diff --git a/main/assets/AGraphicContainer-LUCT6Gle-CGns4AG2.js b/main/assets/AGraphicContainer-LUCT6Gle-CGns4AG2.js deleted file mode 100644 index b5fd5ebbf..000000000 --- a/main/assets/AGraphicContainer-LUCT6Gle-CGns4AG2.js +++ /dev/null @@ -1,12 +0,0 @@ -import{aA as O,hT as D}from"./main-BZaw9FpY.js";import{j as I,Z as V,G as z}from"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import{N as C,e as g}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{o as h}from"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import{R as T,E as w,C as E,G as N,D as G}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as L}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as $}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as k}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{T as F}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{G as P}from"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import{r as v}from"./BufferObject-BM_7mcDb-QLZylgsX.js";import{A as b,T as U,I as R,n as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as j}from"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";let H=0;function c(f,t){return new V(z(H++),f,t)}const d={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class W{constructor(){this.instances={fill:c(h.fill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),marker:c(h.marker,{uniforms:d,optionalAttributes:{zoomRange:!0}}),line:c(h.line,{uniforms:d,optionalAttributes:{zoomRange:!0}}),text:c(h.text,{uniforms:d,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}}),complexFill:c(h.complexFill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),texturedLine:c(h.texturedLine,{uniforms:d,optionalAttributes:{zoomRange:!0}}),animatedMarker:c(h.animatedMarker,{uniforms:d,optionalAttributes:{zoomRange:!0}})},this._instancesById=Object.values(this.instances).reduce((t,e)=>(t.set(e.instanceId,e),t),new Map)}getInstance(t){return this._instancesById.get(t)}}const q=Math.PI/180,Y=4;class J extends F{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=g(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=D(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(b.ONE,b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const a=this._program;e.bindVAO(this._vao),e.useProgram(a),a.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(U.LINES,8*r.length,R.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{displayViewScreenMat3:g()}}_createShaderProgram(t){if(this._program)return;const e=`precision highp float; - uniform mat3 u_dvsMat3; - - attribute vec2 a_position; - - void main() { - mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0); - gl_Position = vec4(pos.xy, 0.0, 1.0); - }`,r=`precision mediump float; - void main() { - gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75); - }`;this._program=t.programCache.acquire(e,r,S().attributes)}_updateMatricesAndLocalOrigin(t){const{state:e}=t,{displayMat3:r,size:a,resolution:m,pixelRatio:n,rotation:o,viewpoint:i}=e,l=q*o,{x:s,y:A}=i.targetGeometry,M=k(s,e.spatialReference);this._localOrigin.x=M,this._localOrigin.y=A;const p=n*a[0],_=n*a[1],y=m*p,B=m*_,u=T(this._dvsMat3);w(u,u,r),E(u,u,L(p/2,_/2)),N(u,u,$(a[0]/y,-_/B,1)),G(u,u,-l)}_updateBufferData(t,e){const{x:r,y:a}=this._localOrigin,m=2*Y*e.length,n=new Float32Array(m),o=new Uint32Array(8*e.length);let i=0,l=0;for(const s of e)s&&(n[2*i]=s[0]-r,n[2*i+1]=s[1]-a,n[2*i+2]=s[0]-r,n[2*i+3]=s[3]-a,n[2*i+4]=s[2]-r,n[2*i+5]=s[3]-a,n[2*i+6]=s[2]-r,n[2*i+7]=s[1]-a,o[l]=i+0,o[l+1]=i+3,o[l+2]=i+3,o[l+3]=i+2,o[l+4]=i+2,o[l+5]=i+1,o[l+6]=i+1,o[l+7]=i+0,i+=4,l+=8);if(this._vertexBuffer?this._vertexBuffer.setData(n.buffer):this._vertexBuffer=v.createVertex(t,x.DYNAMIC_DRAW,n.buffer),this._indexBuffer?this._indexBuffer.setData(o):this._indexBuffer=v.createIndex(t,x.DYNAMIC_DRAW,o),!this._vao){const s=S();this._vao=new j(t,s.attributes,s.bufferLayouts,new Map([["geometry",this._vertexBuffer]]),this._indexBuffer)}}}const S=()=>P("bounds",{geometry:[{location:0,name:"a_position",count:2,type:R.FLOAT}]});class ut extends I{constructor(t){super(t),this._instanceStore=new W,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=O(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(t){this._boundsRenderer=new J(t),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(t,e){t.onMessage(e),this.contains(t)||this.addChild(t),this.requestRender()}_renderChildren(t,e){t.selection=e;for(const r of this.children)r.visible&&r.getDisplayList(this._instanceStore,C.STRICT_ORDER)?.render(t)}}export{ut as K}; diff --git a/main/assets/AGraphicContainer-LUCT6Gle-DajlweKQ.js b/main/assets/AGraphicContainer-LUCT6Gle-DajlweKQ.js new file mode 100644 index 000000000..12a69eaa2 --- /dev/null +++ b/main/assets/AGraphicContainer-LUCT6Gle-DajlweKQ.js @@ -0,0 +1,12 @@ +import{aA as O,hT as D}from"./main-C7yV2j71.js";import{j as I,Z as V,G as z}from"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import{N as C,e as g}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{o as h}from"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import{R as T,E as w,C as E,G as N,D as G}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as L}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as $}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as k}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{T as F}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{G as P}from"./LabelMetric-BeluzH3o-CQPyji82.js";import{r as v}from"./BufferObject-BM_7mcDb-CTo2uuE5.js";import{A as b,T as U,I as R,n as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as j}from"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";let H=0;function c(f,t){return new V(z(H++),f,t)}const d={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class W{constructor(){this.instances={fill:c(h.fill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),marker:c(h.marker,{uniforms:d,optionalAttributes:{zoomRange:!0}}),line:c(h.line,{uniforms:d,optionalAttributes:{zoomRange:!0}}),text:c(h.text,{uniforms:d,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}}),complexFill:c(h.complexFill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),texturedLine:c(h.texturedLine,{uniforms:d,optionalAttributes:{zoomRange:!0}}),animatedMarker:c(h.animatedMarker,{uniforms:d,optionalAttributes:{zoomRange:!0}})},this._instancesById=Object.values(this.instances).reduce((t,e)=>(t.set(e.instanceId,e),t),new Map)}getInstance(t){return this._instancesById.get(t)}}const q=Math.PI/180,Y=4;class J extends F{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=g(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=D(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(b.ONE,b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const a=this._program;e.bindVAO(this._vao),e.useProgram(a),a.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(U.LINES,8*r.length,R.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{displayViewScreenMat3:g()}}_createShaderProgram(t){if(this._program)return;const e=`precision highp float; + uniform mat3 u_dvsMat3; + + attribute vec2 a_position; + + void main() { + mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0); + gl_Position = vec4(pos.xy, 0.0, 1.0); + }`,r=`precision mediump float; + void main() { + gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75); + }`;this._program=t.programCache.acquire(e,r,S().attributes)}_updateMatricesAndLocalOrigin(t){const{state:e}=t,{displayMat3:r,size:a,resolution:m,pixelRatio:n,rotation:o,viewpoint:i}=e,l=q*o,{x:s,y:A}=i.targetGeometry,M=k(s,e.spatialReference);this._localOrigin.x=M,this._localOrigin.y=A;const p=n*a[0],_=n*a[1],y=m*p,B=m*_,u=T(this._dvsMat3);w(u,u,r),E(u,u,L(p/2,_/2)),N(u,u,$(a[0]/y,-_/B,1)),G(u,u,-l)}_updateBufferData(t,e){const{x:r,y:a}=this._localOrigin,m=2*Y*e.length,n=new Float32Array(m),o=new Uint32Array(8*e.length);let i=0,l=0;for(const s of e)s&&(n[2*i]=s[0]-r,n[2*i+1]=s[1]-a,n[2*i+2]=s[0]-r,n[2*i+3]=s[3]-a,n[2*i+4]=s[2]-r,n[2*i+5]=s[3]-a,n[2*i+6]=s[2]-r,n[2*i+7]=s[1]-a,o[l]=i+0,o[l+1]=i+3,o[l+2]=i+3,o[l+3]=i+2,o[l+4]=i+2,o[l+5]=i+1,o[l+6]=i+1,o[l+7]=i+0,i+=4,l+=8);if(this._vertexBuffer?this._vertexBuffer.setData(n.buffer):this._vertexBuffer=v.createVertex(t,x.DYNAMIC_DRAW,n.buffer),this._indexBuffer?this._indexBuffer.setData(o):this._indexBuffer=v.createIndex(t,x.DYNAMIC_DRAW,o),!this._vao){const s=S();this._vao=new j(t,s.attributes,s.bufferLayouts,new Map([["geometry",this._vertexBuffer]]),this._indexBuffer)}}}const S=()=>P("bounds",{geometry:[{location:0,name:"a_position",count:2,type:R.FLOAT}]});class ut extends I{constructor(t){super(t),this._instanceStore=new W,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=O(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(t){this._boundsRenderer=new J(t),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(t,e){t.onMessage(e),this.contains(t)||this.addChild(t),this.requestRender()}_renderChildren(t,e){t.selection=e;for(const r of this.children)r.visible&&r.getDisplayList(this._instanceStore,C.STRICT_ORDER)?.render(t)}}export{ut as K}; diff --git a/main/assets/APIKeyMixin-BUMSx9ny-AE1ffoPb.js b/main/assets/APIKeyMixin-BUMSx9ny-AE1ffoPb.js new file mode 100644 index 000000000..0d026fdba --- /dev/null +++ b/main/assets/APIKeyMixin-BUMSx9ny-AE1ffoPb.js @@ -0,0 +1 @@ +import{v as r,S as s,i as a}from"./main-C7yV2j71.js";function n(i){return"portalItem"in i}const l=i=>{let e=class extends i{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):n(this)?this.portalItem?.apiKey:null}set apiKey(t){t!=null?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return r([s({type:String})],e.prototype,"apiKey",null),e=r([a("esri.layers.mixins.APIKeyMixin")],e),e};export{l as n}; diff --git a/main/assets/APIKeyMixin-BUMSx9ny-xmyEzAt4.js b/main/assets/APIKeyMixin-BUMSx9ny-xmyEzAt4.js deleted file mode 100644 index 856293d70..000000000 --- a/main/assets/APIKeyMixin-BUMSx9ny-xmyEzAt4.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as s,i as a}from"./main-BZaw9FpY.js";function n(i){return"portalItem"in i}const l=i=>{let e=class extends i{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):n(this)?this.portalItem?.apiKey:null}set apiKey(t){t!=null?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return r([s({type:String})],e.prototype,"apiKey",null),e=r([a("esri.layers.mixins.APIKeyMixin")],e),e};export{l as n}; diff --git a/main/assets/Analysis-BPgJ-FCw-72MMAaCQ.js b/main/assets/Analysis-BPgJ-FCw-72MMAaCQ.js deleted file mode 100644 index 66c3f411d..000000000 --- a/main/assets/Analysis-BPgJ-FCw-72MMAaCQ.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as n,aa as r,bR as l,aq as o,v as s,S as i,i as p,j as y}from"./main-BZaw9FpY.js";let c=0,e=class extends n(r(l(y))){constructor(a){super(a),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(a){const t=this.parent;if(t!=null)switch(t.type){case"line-of-sight":case"dimension":case"viewshed":t.releaseAnalysis(this);break;case"2d":case"3d":t.analyses.includes(this)&&t.analyses.remove(this)}this._set("parent",a)}get isEditable(){return this.requiredPropertiesForEditing.every(o)}};s([i({type:String,constructOnly:!0,clonable:!1})],e.prototype,"id",void 0),s([i({type:String})],e.prototype,"title",void 0),s([i({clonable:!1,value:null})],e.prototype,"parent",null),s([i({readOnly:!0})],e.prototype,"isEditable",null),e=s([p("esri.analysis.Analysis")],e);const u=e;export{u as y}; diff --git a/main/assets/Analysis-BPgJ-FCw-Bdup4FTz.js b/main/assets/Analysis-BPgJ-FCw-Bdup4FTz.js new file mode 100644 index 000000000..1874eece0 --- /dev/null +++ b/main/assets/Analysis-BPgJ-FCw-Bdup4FTz.js @@ -0,0 +1 @@ +import{bA as n,aa as r,bR as l,aq as o,v as s,S as i,i as p,j as y}from"./main-C7yV2j71.js";let c=0,e=class extends n(r(l(y))){constructor(a){super(a),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(a){const t=this.parent;if(t!=null)switch(t.type){case"line-of-sight":case"dimension":case"viewshed":t.releaseAnalysis(this);break;case"2d":case"3d":t.analyses.includes(this)&&t.analyses.remove(this)}this._set("parent",a)}get isEditable(){return this.requiredPropertiesForEditing.every(o)}};s([i({type:String,constructOnly:!0,clonable:!1})],e.prototype,"id",void 0),s([i({type:String})],e.prototype,"title",void 0),s([i({clonable:!1,value:null})],e.prototype,"parent",null),s([i({readOnly:!0})],e.prototype,"isEditable",null),e=s([p("esri.analysis.Analysis")],e);const u=e;export{u as y}; diff --git a/main/assets/ArcGISCachedService-C64Ko1TY-C2ql8te1.js b/main/assets/ArcGISCachedService-C64Ko1TY-C2ql8te1.js new file mode 100644 index 000000000..4fa0578ae --- /dev/null +++ b/main/assets/ArcGISCachedService-C64Ko1TY-C2ql8te1.js @@ -0,0 +1 @@ +import{v as l,S as i,a0 as m,J as v,i as S}from"./main-C7yV2j71.js";import{V as d}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{c as x}from"./TileInfoTilemapCache-D1SExPij-6JuHkhwl.js";import{f as I}from"./TilemapCache-CRRxws77-Cj_Hxxs_.js";const g=y=>{let e=class extends y{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}readMaxScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(s,t,f){const h=t.capabilities?.includes("Tilemap");let{minLOD:r,maxLOD:a,minScale:p,maxScale:c}=t;if(r==null&&a==null&&p!==0&&c!==0){const o=n=>Math.round(1e4*n)/1e4;p=o(p||t.tileInfo.lods[0].scale),c=o(c||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(const n of t.tileInfo.lods){const u=o(n.scale);r=u>=p?n.level:r,a=u>=c?n.level:a}}if(h)return new I({layer:this,minLOD:r,maxLOD:a});if(t.tileInfo){const o=new d;return o.read(t.tileInfo,f),new x(o,r,a)}return null}};return l([i({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),l([i()],e.prototype,"minScale",void 0),l([m("service","minScale")],e.prototype,"readMinScale",null),l([i()],e.prototype,"maxScale",void 0),l([m("service","maxScale")],e.prototype,"readMaxScale",null),l([i({type:v})],e.prototype,"spatialReference",void 0),l([i({readOnly:!0})],e.prototype,"supportsBlankTile",null),l([i({type:d})],e.prototype,"tileInfo",void 0),l([i()],e.prototype,"tilemapCache",void 0),l([m("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),l([i()],e.prototype,"version",void 0),e=l([S("esri.layers.mixins.ArcGISCachedService")],e),e};export{g as O}; diff --git a/main/assets/ArcGISCachedService-C64Ko1TY-YBzt3RaL.js b/main/assets/ArcGISCachedService-C64Ko1TY-YBzt3RaL.js deleted file mode 100644 index 077f4a787..000000000 --- a/main/assets/ArcGISCachedService-C64Ko1TY-YBzt3RaL.js +++ /dev/null @@ -1 +0,0 @@ -import{v as l,S as i,a0 as m,J as v,i as S}from"./main-BZaw9FpY.js";import{V as d}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{c as x}from"./TileInfoTilemapCache-D1SExPij-UDulH8vT.js";import{f as I}from"./TilemapCache-CRRxws77-B5V8seF0.js";const g=y=>{let e=class extends y{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}readMaxScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(s,t,f){const h=t.capabilities?.includes("Tilemap");let{minLOD:r,maxLOD:a,minScale:p,maxScale:c}=t;if(r==null&&a==null&&p!==0&&c!==0){const o=n=>Math.round(1e4*n)/1e4;p=o(p||t.tileInfo.lods[0].scale),c=o(c||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(const n of t.tileInfo.lods){const u=o(n.scale);r=u>=p?n.level:r,a=u>=c?n.level:a}}if(h)return new I({layer:this,minLOD:r,maxLOD:a});if(t.tileInfo){const o=new d;return o.read(t.tileInfo,f),new x(o,r,a)}return null}};return l([i({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),l([i()],e.prototype,"minScale",void 0),l([m("service","minScale")],e.prototype,"readMinScale",null),l([i()],e.prototype,"maxScale",void 0),l([m("service","maxScale")],e.prototype,"readMaxScale",null),l([i({type:v})],e.prototype,"spatialReference",void 0),l([i({readOnly:!0})],e.prototype,"supportsBlankTile",null),l([i({type:d})],e.prototype,"tileInfo",void 0),l([i()],e.prototype,"tilemapCache",void 0),l([m("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),l([i()],e.prototype,"version",void 0),e=l([S("esri.layers.mixins.ArcGISCachedService")],e),e};export{g as O}; diff --git a/main/assets/ArcGISService-BYA-y6X6-BtWUPppI.js b/main/assets/ArcGISService-BYA-y6X6-BtWUPppI.js new file mode 100644 index 000000000..096c63b24 --- /dev/null +++ b/main/assets/ArcGISService-BYA-y6X6-BtWUPppI.js @@ -0,0 +1 @@ +import{v as i,S as r,i as s,a1 as n}from"./main-C7yV2j71.js";import{i as o,j as u}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";const h=l=>{let e=class extends l{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=o(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",u(t,n.getLogger(this)))}};return i([r()],e.prototype,"title",null),i([r({type:String})],e.prototype,"url",null),e=i([s("esri.layers.mixins.ArcGISService")],e),e};export{h as a}; diff --git a/main/assets/ArcGISService-BYA-y6X6-DLcDzG-r.js b/main/assets/ArcGISService-BYA-y6X6-DLcDzG-r.js deleted file mode 100644 index 536dc4458..000000000 --- a/main/assets/ArcGISService-BYA-y6X6-DLcDzG-r.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as r,i as s,a1 as n}from"./main-BZaw9FpY.js";import{i as o,j as u}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";const h=l=>{let e=class extends l{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=o(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",u(t,n.getLogger(this)))}};return i([r()],e.prototype,"title",null),i([r({type:String})],e.prototype,"url",null),e=i([s("esri.layers.mixins.ArcGISService")],e),e};export{h as a}; diff --git a/main/assets/AttachmentInfo-D9RFO8W2-BdVN-3Ab.js b/main/assets/AttachmentInfo-D9RFO8W2-BdVN-3Ab.js new file mode 100644 index 000000000..10262efc6 --- /dev/null +++ b/main/assets/AttachmentInfo-D9RFO8W2-BdVN-3Ab.js @@ -0,0 +1 @@ +import{v as o,S as e,bB as s,i as u,e as f}from"./main-C7yV2j71.js";function y(n){const{exifInfo:i,exifName:r,tagName:a}=n;if(!i||!r||!a)return null;const d=i.find(p=>p.name===r);return d?m({tagName:a,tags:d.tags}):null}function m(n){const{tagName:i,tags:r}=n;return!r||!i?null:r.find(a=>a.name===i)?.value||null}var l;const I={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let t=l=class extends f{constructor(n){super(n),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:n}=this,i=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return I[i]||null}clone(){return new l({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=l=o([u("esri.rest.query.support.AttachmentInfo")],t);const c=t;export{c as h}; diff --git a/main/assets/AttachmentInfo-D9RFO8W2-CP6YNuYr.js b/main/assets/AttachmentInfo-D9RFO8W2-CP6YNuYr.js deleted file mode 100644 index 78f241cdf..000000000 --- a/main/assets/AttachmentInfo-D9RFO8W2-CP6YNuYr.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as e,bB as s,i as u,e as f}from"./main-BZaw9FpY.js";function y(n){const{exifInfo:i,exifName:r,tagName:a}=n;if(!i||!r||!a)return null;const d=i.find(p=>p.name===r);return d?m({tagName:a,tags:d.tags}):null}function m(n){const{tagName:i,tags:r}=n;return!r||!i?null:r.find(a=>a.name===i)?.value||null}var l;const I={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let t=l=class extends f{constructor(n){super(n),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:n}=this,i=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return I[i]||null}clone(){return new l({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=l=o([u("esri.rest.query.support.AttachmentInfo")],t);const c=t;export{c as h}; diff --git a/main/assets/AttributeArray-BWXEft_i-BHxkzONu.js b/main/assets/AttributeArray-BWXEft_i-BHxkzONu.js new file mode 100644 index 000000000..14e7fafd7 --- /dev/null +++ b/main/assets/AttributeArray-BWXEft_i-BHxkzONu.js @@ -0,0 +1,1068 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./HUDMaterial.glsl-BLhEaLk5-C_G8bhtR.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./QueryEngine-CH5uUhZK-DnnsKt6q.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./featureConversionUtils-D6hFQ4Af-sYSorBK9.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./LRUCache-C3erQTWv-DhyPlt5p.js","./WhereClause-DxwoyBMS-DCzFGfA-.js","./TimeOnly-DSMefxKy-C21ZkqlE.js","./UnknownTimeZone-C--TOcPG-DfRfNtw8.js","./fieldType-CD2CL2hr-B1iISniv.js","./timeSupport-jPViR5jn-BnQYlj-C.js","./queryUtils-Brxu6254-T3UhaATW.js","./json-BI97KiBB-Ce5cWfI2.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./quantizationUtils-bJy1cRwp-1xSDkBxg.js","./utils-HtkT8Fn3-d1uN_zlY.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./heatmapUtils-seiMkkkR-BSMLb7yQ.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-DyydRFHu-DkAWn-U5.js","./Basemap-BEqqSTw9-COwFtp-h.js","./loadAll-e978YItg-NjG3VBGi.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./writeUtils-D5qlLkwk-IaioN2Q8.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./utils-tNxq3jkf-DW91Ot0z.js","./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js","./FieldsIndex-HmzMbJQG-CzzKuIHi.js","./Scheduler-B7UX7Wr5-BziCzZ_c.js","./signal-CETehA7D-DxK1orqE.js","./Query-BrwMGK8U-DV_czrJX.js","./Field-C6hA1tZj-C0Sp7XvY.js","./ReactiveMap-CFk6jPfN-CM49HI11.js","./PooledRBush-DbfAmeLn-dj1fSLWj.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./query-DFW9-NG_-CfusC8cS.js","./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js","./pbf-D-y3_eZO-SEvl9j6c.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./Indices-DEr2HrWx-Cd6y9wum.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./glUtil-n1JOrdV3-CRAZdee5.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./Util-BjGjeg6f-08Szkf4F.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./InterleavedLayout-DXzw3B2n-BD0-ikLj.js","./BufferView-PQoE3GL7-M6q1od-Y.js","./types-ChhhI6OU-Cxh6dPlX.js","./Octree-CJNwbhg4-D0u91mrh.js","./sphere-BenPORjV-CiIWUavi.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-CdQQbSdq.js","./quatf64-C16JxGFv-BKWK1F8U.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./BufferObject-BM_7mcDb-CTo2uuE5.js","./Texture-BCt2hphT-CtQVMDnp.js","./boundedPlane-DlvE0eNx-DhJ9Zyo3.js","./lineSegment-CcqvCARM-_ZNy9SM-.js","./VertexArrayObject-M4iRGGoi-DLhbl4qv.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./floatRGBA-4pIJN00G-ClP9XgP7.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./renderState-Dap0WV9P-D4IHxyei.js","./projectVectorToVector-sIYLNlex-B5U5xz17.js","./projectPointToVector-B2UUY9SE-BWg0qYG-.js","./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./vec3f32-BS0cezmI-B_madU1n.js","./orientedBoundingBox-oHezdpWm-BA8RF5F7.js","./quat-BODLR7mS-Dbd8ftOx.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js","./triangle-hqU-Tc1X-0gyFMdne.js","./BindType-9iOk18Ed-CRW1cdX4.js","./requestImageUtils-Ut4YcoNU-BcLxhYtL.js","./lengthUtils-DKpMe5qR-E2FfnN85.js"])))=>i.map(i=>d[i]); +import{v as m,S as z,i as ur,gU as go,dD as si,j as li,dU as I,ah as ci,aL as xo,o as Te,aN as St,hT as Rt,dG as di,h_ as Ke,i0 as ut,_ as _t,hZ as It,K as _o,hB as To,bl as bo,ae as hr,U as Oe,t as Eo,I as So,dq as Ir,d7 as Ao,hU as rt,hY as it,$ as Lr,iy as Co,E as wo,aS as Mo,iz as Oo,iA as yo,hq as ui,i8 as Ro,hc as Io,hV as Lo,a1 as hi,al as No,bw as Po}from"./main-C7yV2j71.js";import{r as Do}from"./requestImageUtils-Ut4YcoNU-BcLxhYtL.js";import{i as ve,N as ge,e as Tt,s as Ft,O as Qt,t as er,D as Ve}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{A as At,L as de,D as ae,G as ht,U as Ie,s as Fo,R as Bo,T as zo,f as Go,M as Je,X as ye,t as pe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as mi,V as ke,F as Vo,X as Ho}from"./Texture-BCt2hphT-CtQVMDnp.js";import{h as W}from"./Util-BjGjeg6f-08Szkf4F.js";import{b as xe,_ as Y,N as He,R as fi,Y as mt,j as Uo,r as nt,A as yt,l as mr,L as Nr,y as Wo,Z as jo,k as Ye,S as pi,X as Pr,p as $o}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{l as tr}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{R as qo}from"./InterleavedLayout-DXzw3B2n-BD0-ikLj.js";import{o as F,t as Q,c as ft,S as Bt,i as fe,h as vi,g as Dr,p as kt,f as ko}from"./NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js";import{t as zt}from"./compilerUtils-CV1QYWI8-89qN_-l3.js";import{e as s,c as y,i as Qe}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{a as R}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{o as be}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-DhJ9Zyo3.js";import{b as gi,F as _e}from"./sphere-BenPORjV-CiIWUavi.js";import{f as Yo,K as Gt,B as Xo,m as Vt,y as Jo,D as Zo,N as Ko}from"./renderState-Dap0WV9P-D4IHxyei.js";import{U as Qo}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as bt,u as et}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{H as rr,i as xi,c as _i}from"./mat4-DX7gBViE-vewreEuZ.js";import{t as fr,u as Fr}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{i as ea,v as ta}from"./orientedBoundingBox-oHezdpWm-BA8RF5F7.js";import{L as Ti,X as Br,J as ra,p as ia,j as oa,l as zr}from"./BufferView-PQoE3GL7-M6q1od-Y.js";import{o as Ht,e as aa}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{l as na,r as sa}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{y as oe}from"./vec42-D8CJyqHG-DnfLTeQH.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import{o as Ut,l as la}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as Pe}from"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";function Ul(e,t=!1){return e<=di?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function ca(e){e.vertex.code.add(s` + vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) { + float symbolAlpha = 0.0; + + const float maxTint = 85.0; + const float maxReplace = 170.0; + const float scaleAlpha = 3.0; + + if (symbolColor.a > maxReplace) { + colorMixMode = ${s.int(fe.Multiply)}; + symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace); + } else if (symbolColor.a > maxTint) { + colorMixMode = ${s.int(fe.Replace)}; + symbolAlpha = scaleAlpha * (symbolColor.a - maxTint); + } else if (symbolColor.a > 0.0) { + colorMixMode = ${s.int(fe.Tint)}; + symbolAlpha = scaleAlpha * symbolColor.a; + } else { + colorMixMode = ${s.int(fe.Multiply)}; + symbolAlpha = 0.0; + } + + return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha); + } + `)}let J=class{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={[R.Pass]:null,[R.Draw]:null},i)switch(r){case R.Pass:this.bind[R.Pass]=i;break;case R.Draw:this.bind[R.Draw]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}},pt=class extends J{constructor(e,t){super(e,"sampler2D",R.Draw,(r,i,o)=>r.bindTexture(e,t(i,o)))}};function da(){return!!_o("enable-feature:objectAndLayerId-rendering")}function bi({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(s`vec3 dpPlusFrc(vec3 a, vec3 b) { +return mix(a, a + b, vec3(notEqual(b, vec3(0)))); +} +vec3 dpMinusFrc(vec3 a, vec3 b) { +return mix(vec3(0), a - b, vec3(notEqual(a, b))); +} +vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { +vec3 t1 = dpPlusFrc(hiA, hiB); +vec3 e = dpMinusFrc(t1, hiA); +vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; +return t1 + t2; +}`):e.add(s`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { +vec3 t1 = hiA + hiB; +vec3 e = t1 - hiA; +vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; +return t1 + t2; +}`)}let le=class extends J{constructor(e,t){super(e,"vec3",R.Draw,(r,i,o,a)=>r.setUniform3fv(e,t(i,o,a)))}},q=class extends J{constructor(e,t){super(e,"vec3",R.Pass,(r,i,o)=>r.setUniform3fv(e,t(i,o)))}},ie=class extends J{constructor(e,t){super(e,"float",R.Pass,(r,i,o)=>r.setUniform1f(e,t(i,o)))}},Ei=class extends J{constructor(e,t){super(e,"mat3",R.Draw,(r,i,o)=>r.setUniformMatrix3fv(e,t(i,o)))}},ue=class extends J{constructor(e,t){super(e,"mat3",R.Pass,(r,i,o)=>r.setUniformMatrix3fv(e,t(i,o)))}},Xe=class extends J{constructor(e,t){super(e,"mat4",R.Pass,(r,i,o)=>r.setUniformMatrix4fv(e,t(i,o)))}},U=class extends li{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};m([z()],U.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_GRID",void 0),m([z()],U.prototype,"LABELS_SHOW_BORDER",void 0),m([z()],U.prototype,"TEXT_SHOW_BASELINE",void 0),m([z()],U.prototype,"TEXT_SHOW_BORDER",void 0),m([z()],U.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),m([z()],U.prototype,"OVERLAY_SHOW_CENTER",void 0),m([z()],U.prototype,"SHOW_POI",void 0),m([z()],U.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),m([z()],U.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),m([z()],U.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),m([z()],U.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),m([z()],U.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"I3S_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"I3S_SHOW_MODIFICATIONS",void 0),m([z()],U.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),m([z()],U.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),m([z()],U.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),m([z()],U.prototype,"LINE_WIREFRAMES",void 0),U=m([ur("esri.views.3d.support.debugFlags")],U);const Wl=new U;var st;(function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=16]="DRAPED_MATERIAL",e[e.DRAPED_WATER=17]="DRAPED_WATER",e[e.VOXEL=18]="VOXEL",e[e.MAX_SLOTS=19]="MAX_SLOTS"})(st||(st={}));function pr(e){e.attributes.add(p.POSITION,"vec3"),e.vertex.code.add(s`vec3 positionModel() { return position; }`)}function ua(e,t){e.include(pr);const r=e.vertex;r.include(bi,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new q("transformWorldFromViewTH",i=>i.transformWorldFromViewTH),new q("transformWorldFromViewTL",i=>i.transformWorldFromViewTL),new ue("transformViewFromCameraRelativeRS",i=>i.transformViewFromCameraRelativeRS),new Xe("transformProjFromView",i=>i.transformProjFromView),new Ei("transformWorldFromModelRS",i=>i.transformWorldFromModelRS),new le("transformWorldFromModelTH",i=>i.transformWorldFromModelTH),new le("transformWorldFromModelTL",i=>i.transformWorldFromModelTL)),r.code.add(s`vec3 positionWorldCameraRelative() { +vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel(); +vec3 transform_CameraRelativeFromModel = dpAdd( +transformWorldFromModelTL, +transformWorldFromModelTH, +-transformWorldFromViewTL, +-transformWorldFromViewTH +); +return transform_CameraRelativeFromModel + rotatedModelPosition; +}`),r.code.add(s` + void forwardPosition(float fOffset) { + vPositionWorldCameraRelative = positionWorldCameraRelative(); + if (fOffset != 0.0) { + vPositionWorldCameraRelative += fOffset * ${t.spherical?s`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:s`vec3(0.0, 0.0, 1.0)`}; + } + + vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative; + gl_Position = transformProjFromView * vec4(vPosition_view, 1.0); + } + `),e.fragment.uniforms.add(new q("transformWorldFromViewTL",i=>i.transformWorldFromViewTL)),r.code.add(s`vec3 positionWorld() { +return transformWorldFromViewTL + vPositionWorldCameraRelative; +}`),e.fragment.code.add(s`vec3 positionWorld() { +return transformWorldFromViewTL + vPositionWorldCameraRelative; +}`)}let ha=class extends Qe{constructor(){super(...arguments),this.transformWorldFromViewTH=I(),this.transformWorldFromViewTL=I(),this.transformViewFromCameraRelativeRS=bt(),this.transformProjFromView=fr()}},ma=class extends Qe{constructor(){super(...arguments),this.transformWorldFromModelRS=bt(),this.transformWorldFromModelTH=I(),this.transformWorldFromModelTL=I()}};function Si(e,t){switch(t.normalType){case Q.Attribute:case Q.Compressed:e.include(Bt,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new Ei("transformNormalGlobalFromModel",r=>r.transformNormalGlobalFromModel),new ue("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal)),e.vertex.code.add(s`void forwardNormal() { +vNormalWorld = transformNormalGlobalFromModel * normalModel(); +vNormalView = transformNormalViewFromGlobal * vNormalWorld; +}`);break;case Q.ScreenDerivative:e.vertex.code.add(s`void forwardNormal() {}`);break;default:zt(t.normalType);case Q.COUNT:}}let fa=class extends ha{constructor(){super(...arguments),this.transformNormalViewFromGlobal=bt()}},pa=class extends ma{constructor(){super(...arguments),this.transformNormalGlobalFromModel=bt(),this.toMapSpace=Ht()}};const Ai=new Map([[p.POSITION,0],[p.NORMAL,1],[p.NORMALCOMPRESSED,1],[p.UV0,2],[p.COLOR,3],[p.COLORFEATUREATTRIBUTE,3],[p.SIZE,4],[p.TANGENT,4],[p.CENTEROFFSETANDDISTANCE,5],[p.SYMBOLCOLOR,5],[p.FEATUREATTRIBUTE,6],[p.INSTANCEFEATUREATTRIBUTE,6],[p.INSTANCECOLOR,7],[p.OBJECTANDLAYERIDCOLOR,7],[p.INSTANCEOBJECTANDLAYERIDCOLOR,7],[p.ROTATION,8],[p.INSTANCEMODEL,8],[p.INSTANCEMODELNORMAL,12],[p.INSTANCEMODELORIGINHI,11],[p.INSTANCEMODELORIGINLO,15]]);let Ci=class{constructor(){this.id=To()}},va=class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=I(),this._tmpMbs=gi(),this._tmpObb=new ea,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=xe(e)}applyToVertex(e,t,r){const i=Y(wi,e,t,r),o=Y(_a,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/xe(o);return He(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],l=e[5]+t,c=Math.abs(r),u=Math.abs(i),d=Math.abs(o),h=Math.abs(a),v=Math.abs(n),f=Math.abs(l),T=.5*(1+Math.sign(r*a))*Math.min(c,h),_=.5*(1+Math.sign(i*n))*Math.min(u,v),x=.5*(1+Math.sign(o*l))*Math.min(d,f),V=Math.max(c,h),D=Math.max(u,v),B=Math.max(d,f),P=Math.sqrt(T*T+_*_+x*x),G=Math.sign(c+r),w=Math.sign(u+i),S=Math.sign(d+o),E=Math.sign(h+a),M=Math.sign(v+n),O=Math.sign(f+l),g=this._totalOffset;if(P{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=Vo()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(t?.glName==null){const i=this._textures.get(e);return i&&(this._context.bindTexture(null,i.unit),this._freeTextureUnit(i),this._textures.delete(e)),null}let r=this._textures.get(e);return r==null?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)}),this._fragmentUniforms?.forEach(e=>{e.type!=="sampler2D"&&e.type!=="samplerCube"||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)})}_allocTextureUnit(e){return{texture:e,unit:this._freeTextureUnits.length===0?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}},vr=class{constructor(e,t,r,i,o=Ai){this.release=i,this.locations=o,this.primitiveType=zo.TRIANGLES,this.key=t.key,this._program=new Hr(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t),this.reload=async a=>{if(a&&await r.reload(),!this.key.equals(t.key))throw new Error("Configuration was changed after construction, cannot reload shader");Rt(this._program),this._program=new Hr(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=Rt(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return Gt({blending:Xo,colorWrite:Vt})}};var vt;(function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"})(vt||(vt={}));let Ca=class extends Ci{constructor(e,t){super(),this.type=vt.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=Ai,this._pp0=It(0,0,1),this._pp1=It(0,0,0),this._parameters=new t,Vr(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){Vr(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&!!(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}intersectDraped(e,t,r,i,o,a){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}};var ir;(function(e){e[e.None=0]="None",e[e.Occlude=1]="Occlude",e[e.Transparent=2]="Transparent",e[e.OccludeAndTransparent=4]="OccludeAndTransparent",e[e.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",e[e.Opaque=16]="Opaque"})(ir||(ir={}));var k;(function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"})(k||(k={}));const yi=Yo(At.ONE,At.ZERO,At.ONE,At.ONE_MINUS_SRC_ALPHA);function ql(e){return e===k.FrontFace?null:yi}function wa(e){switch(e){case k.NONE:return Zo;case k.ColorAlpha:return yi;case k.FrontFace:case k.COUNT:return null}}function Ma(e){if(e.draped)return null;switch(e.oitPass){case k.NONE:case k.FrontFace:return e.writeDepth?Ko:null;case k.ColorAlpha:case k.COUNT:return null}}const Oa=5e5,ya={factor:-1,units:-2};function Ra(e){return e?ya:null}function Ia(e,t=de.LESS){return e===k.NONE||e===k.FrontFace?t:de.LEQUAL}function La(e,t){const r=vi(t);return e===k.ColorAlpha?r?{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1,ye.COLOR_ATTACHMENT2]}:{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1]}:r?{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1]}:null}de.LESS,de.ALWAYS;const Na={mask:255},Pa={function:{func:de.ALWAYS,ref:ve.OutlineVisualElementMask,mask:ve.OutlineVisualElementMask},operation:{fail:ae.KEEP,zFail:ae.KEEP,zPass:ae.ZERO}},Da={function:{func:de.ALWAYS,ref:ve.OutlineVisualElementMask,mask:ve.OutlineVisualElementMask},operation:{fail:ae.KEEP,zFail:ae.KEEP,zPass:ae.REPLACE}};de.EQUAL,ve.OutlineVisualElementMask,ve.OutlineVisualElementMask,ae.KEEP,ae.KEEP,ae.KEEP,de.NOTEQUAL,ve.OutlineVisualElementMask,ve.OutlineVisualElementMask,ae.KEEP,ae.KEEP,ae.KEEP;function kl({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return e==null&&t==null&&o==null&&(a==null||fi(a,Ke))&&n==null&&(i==null||i===1)&&(r==null||r===1)}const Fa=ut(1,1,.5),Yl=ut(0,.6,.2),Xl=ut(0,1,.2);let Ze=class extends J{constructor(e,t){super(e,"vec2",R.Pass,(r,i,o)=>r.setUniform2fv(e,t(i,o)))}};function Ur(e){e.varyings.add("linearDepth","float")}function Ri(e){e.vertex.uniforms.add(new Ze("nearFar",(t,r)=>r.camera.nearFar))}function Ii(e){e.vertex.code.add(s`float calculateLinearDepth(vec2 nearFar,float z) { +return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]); +}`)}function Li(e,t){const{vertex:r}=e;switch(t.output){case F.Color:case F.ColorEmission:if(t.receiveShadows)return Ur(e),void r.code.add(s`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:return e.include(ua,t),Ur(e),Ri(e),Ii(e),void r.code.add(s`void forwardLinearDepth() { +linearDepth = calculateLinearDepth(nearFar, vPosition_view.z); +}`)}r.code.add(s`void forwardLinearDepth() {}`)}function Ni(e){e.vertex.code.add(s`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) { +vec3 camToVert = posWorld - camPosWorld; +bool isBackface = dot(camToVert, normalWorld) > 0.0; +if (isBackface) { +posClip.z += 0.0000003 * posClip.w; +} +return posClip; +}`)}function Ue(e,t){Ba(e,t,new le("slicePlaneOrigin",(r,i)=>za(t,r,i)),new le("slicePlaneBasis1",(r,i)=>Wr(t,r,i,i.slicePlane?.basis1)),new le("slicePlaneBasis2",(r,i)=>Wr(t,r,i,i.slicePlane?.basis2)))}function Ba(e,t,...r){if(!t.hasSlicePlane){const n=s`#define rejectBySlice(_pos_) false +#define discardBySlice(_pos_) {} +#define highlightSlice(_color_, _pos_) (_color_)`;return t.hasSliceInVertexProgram&&e.vertex.code.add(n),void e.fragment.code.add(n)}const i=s`struct SliceFactors { +float front; +float side0; +float side1; +float side2; +float side3; +}; +SliceFactors calculateSliceFactors(vec3 pos) { +vec3 rel = pos - slicePlaneOrigin; +vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2); +float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin); +float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1); +float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2); +float basis1Dot = dot(slicePlaneBasis1, rel); +float basis2Dot = dot(slicePlaneBasis2, rel); +return SliceFactors( +dot(slicePlaneNormal, pos) + slicePlaneW, +-basis1Dot - basis1Len2, +basis1Dot - basis1Len2, +-basis2Dot - basis2Len2, +basis2Dot - basis2Len2 +); +} +bool sliceByFactors(SliceFactors factors) { +return factors.front < 0.0 +&& factors.side0 < 0.0 +&& factors.side1 < 0.0 +&& factors.side2 < 0.0 +&& factors.side3 < 0.0; +} +bool sliceEnabled() { +return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0; +} +bool sliceByPlane(vec3 pos) { +return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos)); +} +#define rejectBySlice(_pos_) sliceByPlane(_pos_) +#define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,o=s`vec4 applySliceHighlight(vec4 color, vec3 pos) { +SliceFactors factors = calculateSliceFactors(pos); +const float HIGHLIGHT_WIDTH = 1.0; +const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3); +factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front); +factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0); +factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1); +factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2); +factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3); +if (sliceByFactors(factors)) { +return color; +} +float highlightFactor = (1.0 - step(0.5, factors.front)) +* (1.0 - step(0.5, factors.side0)) +* (1.0 - step(0.5, factors.side1)) +* (1.0 - step(0.5, factors.side2)) +* (1.0 - step(0.5, factors.side3)); +return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a); +}`,a=t.hasSliceHighlight?s` + ${o} + #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_)) + `:s`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.uniforms.add(...r).code.add(i),e.fragment.uniforms.add(...r).code.add(i),e.fragment.code.add(a)}function Pi(e,t,r){return e.instancedDoublePrecision?Y(Ga,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function Di(e,t){return e!=null?nt(Lt,t.origin,e):t.origin}function Fi(e,t,r){return e.hasSliceTranslatedView?t!=null?rr(Va,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function za(e,t,r){if(r.slicePlane==null)return Ke;const i=Pi(e,t,r),o=Di(i,r.slicePlane),a=Fi(e,i,r);return a!=null?mt(Lt,o,a):o}function Wr(e,t,r,i){if(i==null||r.slicePlane==null)return Ke;const o=Pi(e,t,r),a=Di(o,r.slicePlane),n=Fi(e,o,r);return n!=null?(Uo(tt,i,a),mt(Lt,a,n),mt(tt,tt,n),nt(tt,tt,Lt)):i}const Ga=I(),Lt=I(),tt=I(),Va=fr();function We(e){Ii(e),e.vertex.code.add(s`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) { +vec4 eye = view * vec4(pos, 1.0); +depth = calculateLinearDepth(nearFar,eye.z); +return proj * eye; +}`),e.vertex.code.add(s`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) { +return proj * (view * vec4(pos, 1.0)); +}`)}let Ha=class extends J{constructor(e,t){super(e,"mat4",R.Draw,(r,i,o)=>r.setUniformMatrix4fv(e,t(i,o)))}};function gt(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",Ke):e.uniforms.add(new le("cameraPosition",(r,i)=>Y(Bi,i.camera.viewInverseTransposeMatrix[3]-r.origin[0],i.camera.viewInverseTransposeMatrix[7]-r.origin[1],i.camera.viewInverseTransposeMatrix[11]-r.origin[2])))}function je(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new Xe("proj",(i,o)=>o.camera.projectionMatrix),new Ha("view",(i,o)=>rr(jr,o.camera.viewMatrix,i.origin)),new le("localOrigin",i=>i.origin));const r=i=>Y(Bi,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new Xe("proj",(i,o)=>o.camera.projectionMatrix),new Xe("view",(i,o)=>rr(jr,o.camera.viewMatrix,r(o))),new q("localOrigin",(i,o)=>r(o)))}const jr=fr(),Bi=I();function Ua(e){e.uniforms.add(new Xe("viewNormal",(t,r)=>r.camera.viewInverseTransposeMatrix))}function Jl(e){e.uniforms.add(new ie("pixelRatio",(t,r)=>r.camera.pixelRatio/r.overlayStretch))}const $r=bt();function zi(e,t){const r=t.hasModelTransformation,i=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new Xe("model",a=>a.modelTransformation??Fr)),e.vertex.uniforms.add(new ue("normalLocalOriginFromModel",a=>(Qo($r,a.modelTransformation??Fr),$r)))),t.instanced&&i&&(e.attributes.add(p.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(p.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(p.INSTANCEMODEL,"mat3"),e.attributes.add(p.INSTANCEMODELNORMAL,"mat3"));const o=e.vertex;i&&(o.include(bi,t),o.uniforms.add(new le("viewOriginHi",(a,n)=>na(Y(Ct,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),Ct)),new le("viewOriginLo",(a,n)=>sa(Y(Ct,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),Ct)))),o.code.add(s` + vec3 getVertexInLocalOriginSpace() { + return ${r?i?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":i?"instanceModel * localPosition().xyz":"localPosition().xyz"}; + } + + vec3 subtractOrigin(vec3 _pos) { + ${i?s` + // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped + // working for macOS 14+ and iOS 17+. + // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280 + vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo); + return _pos - originDelta;`:"return vpos;"} + } + `),o.code.add(s` + vec3 dpNormal(vec4 _normal) { + return normalize(${r?i?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":i?"instanceModelNormal * _normal.xyz":"_normal.xyz"}); + } + `),t.output===F.Normal&&(Ua(o),o.code.add(s` + vec3 dpNormalView(vec4 _normal) { + return normalize((viewNormal * ${r?i?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":i?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz); + } + `)),t.hasVertexTangents&&o.code.add(s` + vec4 dpTransformVertexTangent(vec4 _tangent) { + ${r?i?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":i?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"} + }`)}const Ct=I();let gr=class extends J{constructor(e,t){super(e,"int",R.Pass,(r,i,o)=>r.setUniform1i(e,t(i,o)))}};function Gi(e,t){t.hasSymbolColors?(e.include(ca),e.attributes.add(p.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(s`int symbolColorMixMode; +vec4 getSymbolColor() { +return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; +} +void forwardColorMixMode() { +colorMixMode = float(symbolColorMixMode) + 0.5; +}`)):(e.fragment.uniforms.add(new gr("colorMixMode",r=>Aa[r.colorMixMode])),e.vertex.code.add(s`vec4 getSymbolColor() { return vec4(1.0); } +void forwardColorMixMode() {}`))}var K;function Ne(e,t){switch(t.textureCoordinateType){case K.Default:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(s`void forwardTextureCoordinates() { +vuv0 = uv0; +}`);case K.Compressed:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(s`vec2 getUV0() { +return uv0 / 16384.0; +} +void forwardTextureCoordinates() { +vuv0 = getUV0(); +}`);case K.Atlas:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(p.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(s`void forwardTextureCoordinates() { +vuv0 = uv0; +vuvRegion = uvRegion; +}`);default:zt(t.textureCoordinateType);case K.None:return void e.vertex.code.add(s`void forwardTextureCoordinates() {}`);case K.COUNT:return}}(function(e){e[e.None=0]="None",e[e.Default=1]="Default",e[e.Atlas=2]="Atlas",e[e.Compressed=3]="Compressed",e[e.COUNT=4]="COUNT"})(K||(K={}));function Vi(e,t){t.hasVertexColors?(e.attributes.add(p.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(s`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(s`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(s`void forwardVertexColor() {} +void forwardNormalizedVertexColor() {}`)}function Wa(e){e.vertex.code.add(s`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) { +return absCosAngle * absCosAngle * absCosAngle; +}`),e.vertex.code.add(s`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) { +return vec3( +min(params.x / (distanceToCamera - params.y), 1.0), +screenSizePerspectiveViewAngleDependentFactor(absCosAngle), +params.z +); +}`),e.vertex.code.add(s`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) { +return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); +}`),e.vertex.code.add(s`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) { +return applyScreenSizePerspectiveScaleFactorFloat( +size, +screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params) +); +}`),e.vertex.code.add(s`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) { +return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); +}`),e.vertex.code.add(s`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) { +return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)); +}`)}function Zl(e){e.uniforms.add(new q("screenSizePerspective",t=>Hi(t.screenSizePerspective)))}function ja(e){e.uniforms.add(new q("screenSizePerspectiveAlignment",t=>Hi(t.screenSizePerspectiveAlignment||t.screenSizePerspective)))}function Hi(e){return Y($a,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const $a=I();let te=class extends J{constructor(e,t){super(e,"vec4",R.Pass,(r,i,o)=>r.setUniform4fv(e,t(i,o)))}};function Ui(e,t){const r=e.vertex;t.hasVerticalOffset?(ka(r),t.hasScreenSizePerspective&&(e.include(Wa),ja(r),gt(e.vertex,t)),r.code.add(s` + vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) { + float viewDistance = length((view * vec4(worldPos, 1.0)).xyz); + ${t.spherical?s`vec3 worldNormal = normalize(worldPos + localOrigin);`:s`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`} + ${t.hasScreenSizePerspective?s` + float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition)); + float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:s` + float verticalOffsetScreenHeight = verticalOffset.x;`} + // Screen sized offset in world space, used for example for line callouts + float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w); + return worldNormal * worldOffset; + } + + vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { + return worldPos + calculateVerticalOffset(worldPos, localOrigin); + } + `)):r.code.add(s`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const qa=Ht();function ka(e){e.uniforms.add(new te("verticalOffset",(t,r)=>{const{minWorldLength:i,maxWorldLength:o,screenLength:a}=t.verticalOffset,n=Math.tan(.5*r.camera.fovY)/(.5*r.camera.fullViewport[3]),l=r.camera.pixelRatio||1;return oe(qa,a*l,n,i,o)}))}function Ya(e,t){if(t.output!==F.ObjectAndLayerIdColor)return e.vertex.code.add(s`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(s`void outputObjectAndLayerIdColor() {}`);const r=t.objectAndLayerIdColorInstanced;e.varyings.add("objectAndLayerIdColorVarying","vec4"),e.attributes.add(r?p.INSTANCEOBJECTANDLAYERIDCOLOR:p.OBJECTANDLAYERIDCOLOR,"vec4"),e.vertex.code.add(s` + void forwardObjectAndLayerIdColor() { + objectAndLayerIdColorVarying = ${r?"instanceObjectAndLayerIdColor":"objectAndLayerIdColor"} * 0.003921568627451; + }`),e.fragment.code.add(s`void outputObjectAndLayerIdColor() { +fragColor = objectAndLayerIdColorVarying; +}`)}function Wi(e){e.code.add(s`const float MAX_RGBA4_FLOAT = +15.0 / 16.0 + +15.0 / 16.0 / 16.0 + +15.0 / 16.0 / 16.0 / 16.0 + +15.0 / 16.0 / 16.0 / 16.0 / 16.0; +const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0); +vec4 floatToRgba4(const float value) { +float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT); +vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0); +const float toU4AsFloat = 1.0 / 15.0; +return fixedPointU4 * toU4AsFloat; +} +const vec4 RGBA4_2_FLOAT_FACTORS = vec4( +15.0 / (16.0), +15.0 / (16.0 * 16.0), +15.0 / (16.0 * 16.0 * 16.0), +15.0 / (16.0 * 16.0 * 16.0 * 16.0) +); +float rgba4ToFloat(vec4 rgba) { +return dot(rgba, RGBA4_2_FLOAT_FACTORS); +}`)}function Xa(e,t){switch(t.output){case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:e.fragment.include(Wi),e.fragment.code.add(s`float _calculateFragDepth(const in float depth) { +const float SLOPE_SCALE = 2.0; +const float BIAS = 20.0 * .000015259; +float m = max(abs(dFdx(depth)), abs(dFdy(depth))); +return depth + SLOPE_SCALE * m + BIAS; +} +void outputDepth(float _linearDepth) { +fragColor = floatToRgba4(_calculateFragDepth(_linearDepth)); +}`)}}let Ja=class extends J{constructor(e,t){super(e,"ivec2",R.Pass,(r,i,o)=>r.setUniform2iv(e,t(i,o)))}},X=class extends J{constructor(e,t){super(e,"sampler2D",R.Pass,(r,i,o)=>r.bindTexture(e,t(i,o)))}};function ji(e,t){const{fragment:r}=e;t.output===F.Highlight?(r.uniforms.add(new X("depthTexture",(i,o)=>o.mainDepth),new X("highlightTexture",(i,o)=>o.highlightMixTexture),new gr("highlightLevel",(i,o)=>o.highlightLevel),new Ja("highlightMixOrigin",(i,o)=>o.highlightMixOrigin)),e.outputs.add("fragHighlight","vec2",0),r.code.add(s`vec2 getAccumulatedHighlight() { +return texelFetch(highlightTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg; +} +void outputHighlight(bool occluded) { +if (highlightLevel == 0) { +uint bits = occluded ? 3u : 1u; +fragHighlight = vec2(float(bits) / 255.0, 0.0); +} else { +int ll = (highlightLevel & 3) << 1; +int li = (highlightLevel >> 2) & 3; +uint bits; +if (occluded) { +bits = 3u << ll; +} else { +bits = 1u << ll; +} +vec2 combinedHighlight = getAccumulatedHighlight(); +uint accumulatedI = uint(combinedHighlight[li] * 255.0); +combinedHighlight[li] = float(bits | accumulatedI) / 255.0; +fragHighlight = combinedHighlight; +} +} +bool isHighlightOccluded() { +float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x; +return gl_FragCoord.z > sceneDepth + 5e-7; +} +void calculateOcclusionAndOutputHighlight() { +outputHighlight(isHighlightOccluded()); +}`),t.canHaveOverlay&&(r.constants.add("occlusionAndMask","int",85),r.code.add(s`void outputAllHighlights(vec2 highlightToAdd) { +if (highlightToAdd == vec2(0.0)) { discard; } +int occludedOrMask = isHighlightOccluded() ? 0xaa : 0; +ivec2 added = ivec2(highlightToAdd * 255.0); +ivec2 masked = (added & ivec2(occlusionAndMask)) | (ivec2(occludedOrMask) & (added<<1)); +fragHighlight = vec2(masked) / 255.0; +}`))):r.code.add(s`void calculateOcclusionAndOutputHighlight() {}`)}let Za=class extends J{constructor(e,t,r){super(e,"vec4",R.Pass,(i,o,a)=>i.setUniform4fv(e,t(o,a)),r)}},Ka=class extends J{constructor(e,t,r){super(e,"float",R.Pass,(i,o,a)=>i.setUniform1fv(e,t(o,a)),r)}};var qr,kr;(function(e){e[e.Undefined=0]="Undefined",e[e.DefinedSize=1]="DefinedSize",e[e.DefinedScale=2]="DefinedScale"})(qr||(qr={})),function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(kr||(kr={}));function Kl(e,t,r){if(!t.vvSize)return Y(e,1,1,1),e;for(let i=0;i<3;++i){const o=t.vvSize.offset[i]+r[0]*t.vvSize.factor[i];e[i]=hr(o,t.vvSize.minSize[i],t.vvSize.maxSize[i])}return e}const Xt=8;function lt(e,t){const{vertex:r,attributes:i}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&i.add(p.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new q("vvSizeMinSize",o=>o.vvSize.minSize)),r.uniforms.add(new q("vvSizeMaxSize",o=>o.vvSize.maxSize)),r.uniforms.add(new q("vvSizeOffset",o=>o.vvSize.offset)),r.uniforms.add(new q("vvSizeFactor",o=>o.vvSize.factor)),r.uniforms.add(new ue("vvSymbolRotationMatrix",o=>o.vvSymbolRotationMatrix)),r.uniforms.add(new q("vvSymbolAnchor",o=>o.vvSymbolAnchor)),r.code.add(s`vec3 vvScale(vec4 _featureAttribute) { +return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize); +} +vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) { +return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0); +}`),r.code.add(s` + const float eps = 1.192092896e-07; + vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) { + vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize); + return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0); + } + + ${t.hasVvInstancing?s` + vec4 vvLocalNormal(vec3 _normal) { + return vvTransformNormal(_normal, instanceFeatureAttribute); + } + + vec4 localPosition() { + return vvTransformPosition(position, instanceFeatureAttribute); + }`:""} + `)):r.code.add(s`vec4 localPosition() { return vec4(position, 1.0); } +vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",Xt),r.uniforms.add(new Ka("vvColorValues",o=>o.vvColor.values,Xt),new Za("vvColorColors",o=>o.vvColor.colors,Xt)),r.code.add(s` + vec4 interpolateVVColor(float value) { + if (value <= vvColorValues[0]) { + return vvColorColors[0]; + } + + for (int i = 1; i < vvColorNumber; ++i) { + if (vvColorValues[i] >= value) { + float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); + return mix(vvColorColors[i-1], vvColorColors[i], f); + } + } + return vvColorColors[vvColorNumber - 1]; + } + + vec4 vvGetColor(vec4 featureAttribute) { + return interpolateVVColor(featureAttribute.y); + } + + ${t.hasVvInstancing?s` + vec4 vvColor() { + return vvGetColor(instanceFeatureAttribute); + }`:"vec4 vvColor() { return vec4(1.0); }"} + `)):r.code.add(s`vec4 vvColor() { return vec4(1.0); }`)}function $e(e,t){Qa(e,t,new ie("textureAlphaCutoff",r=>r.textureAlphaCutoff))}function Qa(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode){case ge.Blend:e.fragment.code.add(s` + #define discardOrAdjustAlpha(color) { if (color.a < ${s.float(be)}) { discard; } } + `);break;case ge.Opaque:i.code.add(s`void discardOrAdjustAlpha(inout vec4 color) { +color.a = 1.0; +}`);break;case ge.Mask:i.uniforms.add(r).code.add(s`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case ge.MaskBlend:i.uniforms.add(r).code.add(s`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}function $i(e,t){const{vertex:r,fragment:i}=e,o=t.hasColorTexture&&t.alphaDiscardMode!==ge.Opaque,{output:a,normalType:n,hasColorTextureTransform:l}=t;switch(a){case F.Depth:je(r,t),e.include(We,t),e.include(Ue,t),e.include(Ne,t),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); +vpos = subtractOrigin(vpos); +vpos = addVerticalOffset(vpos, localOrigin); +gl_Position = transformPosition(proj, view, vpos); +forwardTextureCoordinates();`),e.include($e,t),i.main.add(s` + discardBySlice(vpos); + ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); + discardOrAdjustAlpha(texColor);`)}`);break;case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:case F.ObjectAndLayerIdColor:je(r,t),e.include(We,t),e.include(Ne,t),e.include(lt,t),e.include(Xa,t),e.include(Ue,t),e.include(Ya,t),Ri(e),e.varyings.add("depth","float"),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); +vpos = subtractOrigin(vpos); +vpos = addVerticalOffset(vpos, localOrigin); +gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); +forwardTextureCoordinates(); +forwardObjectAndLayerIdColor();`),e.include($e,t),i.main.add(s` + discardBySlice(vpos); + ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); + discardOrAdjustAlpha(texColor);`)} + ${a===F.ObjectAndLayerIdColor?s`outputObjectAndLayerIdColor();`:s`outputDepth(depth);`}`);break;case F.Normal:{je(r,t),e.include(We,t),e.include(Bt,t),e.include(Si,t),e.include(Ne,t),e.include(lt,t),o&&i.uniforms.add(new X("tex",u=>u.texture)),n===Q.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const c=n===Q.Attribute||n===Q.Compressed;r.main.add(s` + vpos = getVertexInLocalOriginSpace(); + ${c?s`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:s`vPositionView = (view * vec4(vpos, 1.0)).xyz;`} + vpos = subtractOrigin(vpos); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + forwardTextureCoordinates();`),e.include(Ue,t),e.include($e,t),i.main.add(s` + discardBySlice(vpos); + ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); + discardOrAdjustAlpha(texColor);`)} + + ${n===Q.ScreenDerivative?s`vec3 normal = screenDerivativeNormal(vPositionView);`:s`vec3 normal = normalize(vNormalWorld); + if (gl_FrontFacing == false){ + normal = -normal; + }`} + fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case F.Highlight:je(r,t),e.include(We,t),e.include(Ne,t),e.include(lt,t),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); +vpos = subtractOrigin(vpos); +vpos = addVerticalOffset(vpos, localOrigin); +gl_Position = transformPosition(proj, view, vpos); +forwardTextureCoordinates();`),e.include(Ue,t),e.include($e,t),e.include(ji,t),i.main.add(s` + discardBySlice(vpos); + ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); + discardOrAdjustAlpha(texColor);`)} + calculateOcclusionAndOutputHighlight();`)}}function en(e){e.fragment.code.add(s`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) { +vec2 atlasScale = atlasRegion.zw - atlasRegion.xy; +vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy; +float maxdUV = 0.125; +vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale; +vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale; +return textureGrad(tex, uvAtlas, dUVdx, dUVdy); +}`)}function xr(e,t){const{textureCoordinateType:r}=t;if(r===K.None||r===K.COUNT)return;e.include(Ne,t);const i=r===K.Atlas;i&&e.include(en),e.fragment.code.add(s` + vec4 textureLookup(sampler2D tex, vec2 uv) { + return ${i?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"}; + } + `)}function tn(e,t){const r=e.fragment;switch(r.code.add(s`struct ShadingNormalParameters { +vec3 normalView; +vec3 viewDirection; +} shadingParams;`),t.doubleSidedMode){case re.None:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { +return normalize(params.normalView); +}`);break;case re.View:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { +return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView); +}`);break;case re.WindingOrder:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { +return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView); +}`);break;default:zt(t.doubleSidedMode);case re.COUNT:}}var re;(function(e){e[e.None=0]="None",e[e.View=1]="View",e[e.WindingOrder=2]="WindingOrder",e[e.COUNT=3]="COUNT"})(re||(re={}));function rn(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(p.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===re.WindingOrder?r.code.add(s`mat3 computeTangentSpace(vec3 normal) { +float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w; +vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz); +vec3 bitangent = cross(normal, tangent) * tangentHeadedness; +return mat3(tangent, bitangent, normal); +}`):r.code.add(s`mat3 computeTangentSpace(vec3 normal) { +float tangentHeadedness = vTangent.w; +vec3 tangent = normalize(vTangent.xyz); +vec3 bitangent = cross(normal, tangent) * tangentHeadedness; +return mat3(tangent, bitangent, normal); +}`)):r.code.add(s`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) { +vec3 Q1 = dFdx(pos); +vec3 Q2 = dFdy(pos); +vec2 stx = dFdx(st); +vec2 sty = dFdy(st); +float det = stx.t * sty.s - sty.t * stx.s; +vec3 T = stx.t * Q2 - sty.t * Q1; +T = T - normal * dot(normal, T); +T *= inversesqrt(max(dot(T,T), 1.e-10)); +vec3 B = sign(det) * cross(normal, T); +return mat3(T, B, normal); +}`),t.textureCoordinateType!==K.None&&(e.include(xr,t),r.uniforms.add(t.bindType===R.Pass?new X("normalTexture",i=>i.textureNormal):new pt("normalTexture",i=>i.textureNormal)),t.hasNormalTextureTransform&&(r.uniforms.add(new Ze("scale",i=>i.scale??la)),r.uniforms.add(new ue("normalTextureTransformMatrix",i=>i.normalTextureTransformMatrix??et))),r.code.add(s`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) { +vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),t.hasNormalTextureTransform&&r.code.add(s`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0, +normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0, +0.0, 0.0, 0.0 ); +rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(s`return tangentSpace * rawNormal; +}`))}var or,ct;(function(e){e.OPAQUE="opaque-color",e.TRANSPARENT="transparent-color",e.COMPOSITE="composite-color",e.FINAL="final-color"})(or||(or={})),function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color"}(ct||(ct={}));var qe,Yr;(function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"})(qe||(qe={})),function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(Yr||(Yr={}));let Ge=class extends li{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=or.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([ci(()=>this.view.ready,e=>{e&&this.view._stage?.renderer.addRenderNode(this)},xo)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Te("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view._stage.renderView.renderingContext.gl}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view._stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===Qt.UPDATE&&this.view._stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view._stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view._stage.renderView.renderingContext}get renderContext(){return this.view._stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:t})=>t===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};m([z({constructOnly:!0})],Ge.prototype,"view",void 0),m([z({constructOnly:!0})],Ge.prototype,"consumes",void 0),m([z()],Ge.prototype,"produces",void 0),Ge=m([ur("esri.views.3d.webgl.RenderNode")],Ge);const on=Ge,an=3e5,Xr=5e5;function qi(e,t=!0){e.attributes.add(p.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(s` + gl_Position = vec4(position, 0.0, 1.0); + ${t?s`uv = position * 0.5 + vec2(0.5);`:""} + `)}function _r(e){e.uniforms.add(new Ze("zProjectionMap",(t,r)=>nn(r.camera))),e.code.add(s`float linearizeDepth(float depth) { +float depthNdc = depth * 2.0 - 1.0; +float c1 = zProjectionMap[0]; +float c2 = zProjectionMap[1]; +return -(c1 / (depthNdc + c2 + 1e-7)); +}`),e.code.add(s`float depthFromTexture(sampler2D depthTexture, vec2 uv) { +ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0))); +float depth = texelFetch(depthTexture, iuv, 0).r; +return depth; +}`),e.code.add(s`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) { +return linearizeDepth(depthFromTexture(depthTexture, uv)); +}`)}function nn(e){const t=e.projectionMatrix;return Pe(sn,t[14],t[10])}const sn=Ut();let ln=class extends J{constructor(e,t){super(e,"vec2",R.Draw,(r,i,o,a)=>r.setUniform2fv(e,t(i,o,a)))}};const cn=()=>hi.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let ki=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},jt=class extends ki{constructor(){super(...arguments),this.vertex=new Jr,this.fragment=new Jr,this.attributes=new mn,this.varyings=new fn,this.extensions=new ar,this.outputs=new sr}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o=e==="vertex"?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),l=o.main.generateSource(),c=e==="vertex"?gn:vn,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es +${t.join(` +`)} + +${c} + +${u.join(` +`)} + +${a.join(` +`)} + +${r.join(` +`)} + +${i.join(` +`)} + +${d.join(` +`)} + +${n.join(` +`)} + +${l.join(` +`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(o=>{const a=o.bind[R.Pass];a&&t.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[R.Pass];a&&t.set(o.name,a)});const r=Array.from(t.values()),i=r.length;return(o,a)=>{for(let n=0;n{const a=o.bind[R.Draw];a&&t.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[R.Draw];a&&t.set(o.name,a)});const r=Array.from(t.values()),i=r.length;return(o,a,n)=>{for(let l=0;le.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},un=class{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(){if(this._bodies.length>0)return[`void main() { + ${this._bodies.join(` +`)||""} +}`];throw new Te("Shader does not contain main function body.")}},hn=class{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}},Jr=class extends ki{constructor(){super(...arguments),this.uniforms=new dn(this),this.main=new un(this),this.code=new hn(this),this.constants=new pn(this)}get builder(){return this}},mn=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},fn=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&W(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push(e==="vertex"?`out ${r} ${i};`:`in ${r} ${i};`)),t}},ar=class nr{constructor(){this._entries=new Set}add(t){this._entries.add(t)}generateSource(t){const r=t==="vertex"?nr.ALLOWLIST_VERTEX:nr.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>r.includes(i)).map(i=>`#extension ${i} : enable`)}};ar.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],ar.ALLOWLIST_VERTEX=[];let sr=class lr{constructor(){this._entries=new Map}add(t,r,i=0){const o=this._entries.get(i);o?W(o.name===t&&o.type===r,`Fragment shader output location ${i} occupied`):this._entries.set(i,{name:t,type:r})}generateSource(t){if(t==="vertex")return[];this._entries.size===0&&this._entries.set(0,{name:lr.DEFAULT_NAME,type:lr.DEFAULT_TYPE});const r=new Array;return this._entries.forEach((i,o)=>r.push(`layout(location = ${o}) out ${i.type} ${i.name};`)),r}};sr.DEFAULT_TYPE="vec4",sr.DEFAULT_NAME="fragColor";let pn=class j{constructor(t){this._stage=t,this._entries=new Set}add(t,r,i){let o="ERROR_CONSTRUCTOR_STRING";switch(r){case"float":o=j._numberToFloatStr(i);break;case"int":o=j._numberToIntStr(i);break;case"bool":o=i.toString();break;case"vec2":o=`vec2(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])})`;break;case"vec3":o=`vec3(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])}, ${j._numberToFloatStr(i[2])})`;break;case"vec4":o=`vec4(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])}, ${j._numberToFloatStr(i[2])}, ${j._numberToFloatStr(i[3])})`;break;case"ivec2":o=`ivec2(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])})`;break;case"ivec3":o=`ivec3(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])}, ${j._numberToIntStr(i[2])})`;break;case"ivec4":o=`ivec4(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])}, ${j._numberToIntStr(i[2])}, ${j._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":o=`${r}(${Array.prototype.map.call(i,a=>j._numberToFloatStr(a)).join(", ")})`}return this._entries.add(`const ${r} ${t} = ${o};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}};const vn=`#ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + precision highp sampler2D; +#else + precision mediump float; + precision mediump sampler2D; +#endif`,gn=`precision highp float; +precision highp sampler2D;`,Jt=4;function xn(){const e=new jt,t=e.fragment;e.include(qi);const r=(Jt+1)/2,i=1/(2*r*r);return t.include(_r),t.uniforms.add(new X("depthMap",o=>o.depthTexture),new pt("tex",o=>o.colorTexture),new ln("blurSize",o=>o.blurSize),new ie("projScale",(o,a)=>{const n=a.camera.distance;return n>5e4?Math.max(0,o.projScale-(n-5e4)):o.projScale})),t.code.add(s` + void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) { + float c = texture(tex, uv).r; + float d = linearDepthFromTexture(depthMap, uv); + + float ddiff = d - center_d; + + float w = exp(-r * r * ${s.float(i)} - ddiff * ddiff * sharpness); + wTotal += w; + bTotal += w * c; + } + `),e.outputs.add("fragBlur","float"),t.main.add(s` + float b = 0.0; + float w_total = 0.0; + + float center_d = linearDepthFromTexture(depthMap, uv); + + float sharpness = -0.05 * projScale / center_d; + for (int r = -${s.int(Jt)}; r <= ${s.int(Jt)}; ++r) { + float rf = float(r); + vec2 uvOffset = uv + rf * blurSize; + blurFunction(uvOffset, rf, center_d, sharpness, w_total, b); + } + fragBlur = b / w_total;`),e}const _n=Object.freeze(Object.defineProperty({__proto__:null,build:xn},Symbol.toStringTag,{value:"Module"}));let Zr=class extends vr{constructor(e,t,r){super(e,t,new Wt(_n,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-C_G8bhtR.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url).then(i=>i.S)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const Tn="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";let bn=class extends Qe{constructor(){super(...arguments),this.projScale=1}},En=class extends bn{constructor(){super(...arguments),this.intensity=1}},Sn=class extends Qe{},An=class extends Sn{constructor(){super(...arguments),this.blurSize=Ut()}};function Cn(e){e.fragment.uniforms.add(new te("projInfo",(t,r)=>wn(r.camera))),e.fragment.uniforms.add(new Ze("zScale",(t,r)=>Mn(r.camera))),e.fragment.code.add(s`vec3 reconstructPosition(vec2 fragCoord, float depth) { +return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); +}`)}function wn(e){const t=e.projectionMatrix;return t[11]===0?oe(Kr,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):oe(Kr,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}const Kr=Ht();function Mn(e){return e.projectionMatrix[11]===0?Pe(Qr,0,1):Pe(Qr,1,0)}const Qr=Ut(),ei=16;function On(){const e=new jt,t=e.fragment;return e.include(qi),e.include(Cn),t.include(_r),t.uniforms.add(new ie("radius",(r,i)=>Tr(i.camera))).code.add(s`vec3 sphere[16] = vec3[16]( +vec3(0.186937, 0.0, 0.0), +vec3(0.700542, 0.0, 0.0), +vec3(-0.864858, -0.481795, -0.111713), +vec3(-0.624773, 0.102853, -0.730153), +vec3(-0.387172, 0.260319, 0.007229), +vec3(-0.222367, -0.642631, -0.707697), +vec3(-0.01336, -0.014956, 0.169662), +vec3(0.122575, 0.1544, -0.456944), +vec3(-0.177141, 0.85997, -0.42346), +vec3(-0.131631, 0.814545, 0.524355), +vec3(-0.779469, 0.007991, 0.624833), +vec3(0.308092, 0.209288,0.35969), +vec3(0.359331, -0.184533, -0.377458), +vec3(0.192633, -0.482999, -0.065284), +vec3(0.233538, 0.293706, -0.055139), +vec3(0.417709, -0.386701, 0.442449) +); +float fallOffFunction(float vv, float vn, float bias) { +float f = max(radius * radius - vv, 0.0); +return f * f * f * max(vn - bias, 0.0); +}`),t.code.add(s`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) { +vec3 v = Q - C; +float vv = dot(v, v); +float vn = dot(normalize(v), n_C); +return fallOffFunction(vv, vn, 0.1); +}`),t.uniforms.add(new X("normalMap",r=>r.normalTexture),new X("depthMap",r=>r.depthTexture),new ie("projScale",r=>r.projScale),new X("rnm",r=>r.noiseTexture),new Ze("rnmScale",(r,i)=>Pe(ti,i.camera.fullWidth/r.noiseTexture.descriptor.width,i.camera.fullHeight/r.noiseTexture.descriptor.height)),new ie("intensity",r=>r.intensity),new Ze("screenSize",(r,i)=>Pe(ti,i.camera.fullWidth,i.camera.fullHeight))),e.outputs.add("fragOcclusion","float"),t.main.add(s` + float depth = depthFromTexture(depthMap, uv); + + // Early out if depth is out of range, such as in the sky + if (depth >= 1.0 || depth <= 0.0) { + fragOcclusion = 1.0; + return; + } + + // get the normal of current fragment + vec4 norm4 = texture(normalMap, uv); + if(norm4.a != 1.0) { + fragOcclusion = 1.0; + return; + } + vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz; + + float currentPixelDepth = linearizeDepth(depth); + vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth); + + float sum = 0.0; + vec3 tapPixelPos; + + vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0); + + // note: the factor 2.0 should not be necessary, but makes ssao much nicer. + // bug or deviation from CE somewhere else? + float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y); + + for(int i = 0; i < ${s.int(ei)}; ++i) { + vec2 unitOffset = reflect(sphere[i], fres).xy; + vec2 offset = vec2(-unitOffset * radius * ps); + + // don't use current or very nearby samples + if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){ + continue; + } + + vec2 tc = vec2(gl_FragCoord.xy + offset); + if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue; + vec2 tcTap = tc / screenSize; + float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap); + + tapPixelPos = reconstructPosition(tc, occluderFragmentDepth); + + sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos); + } + + // output the result + float A = max(1.0 - sum * intensity / float(${s.int(ei)}), 0.0); + + // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2 + A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2; + + fragOcclusion = A;`),e}function Tr(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const ti=Ut(),yn=Object.freeze(Object.defineProperty({__proto__:null,build:On,getRadius:Tr},Symbol.toStringTag,{value:"Module"}));let ri=class extends vr{constructor(e,t,r){super(e,t,new Wt(yn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-C_G8bhtR.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url).then(i=>i.a)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const ot=2;let ze=class extends on{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=ct.SSAO,this.isEnabled=()=>!1,this._enableTime=St(0),this._passParameters=new En,this._drawParameters=new An}initialize(){const e=Uint8Array.from(atob(Tn),r=>r.charCodeAt(0)),t=new mi;t.wrapMode=ht.CLAMP_TO_EDGE,t.pixelFormat=Ie.RGB,t.wrapMode=ht.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new ke(this.renderingContext,t,e),this.techniques.precompile(ri),this.techniques.precompile(Zr),this.addHandles(ci(()=>this.isEnabled(),()=>this._enableTime=St(0)))}destroy(){this._passParameters.noiseTexture=Rt(this._passParameters.noiseTexture)}render(e){const t=this.bindParameters,r=e.find(({name:w})=>w==="normals"),i=r?.getTexture(),o=r?.getTexture(Fo),a=this.fboCache,n=t.camera,l=n.fullViewport[2],c=n.fullViewport[3],u=Math.round(l/ot),d=Math.round(c/ot),h=this.techniques.acquire(ri),v=this.techniques.acquire(Zr);if(!h.compiled||!v.compiled)return this._enableTime=St(performance.now()),this.requestRender(Qt.UPDATE),h.release(),v.release(),a.acquire(u,d,ct.SSAO,qe.RED);this._enableTime===0&&(this._enableTime=St(performance.now()));const f=this.renderingContext,T=this.view.qualitySettings.fadeDuration,_=n.relativeElevation,x=hr((Xr-_)/(Xr-an),0,1),V=T>0?Math.min(T,performance.now()-this._enableTime)/T:1,D=V*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=o,this._passParameters.projScale=1/n.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Rn/Tr(n)**6*D;const B=a.acquire(l,c,"ssao input",qe.RG);f.bindFramebuffer(B.fbo),f.setViewport(0,0,l,c),f.bindTechnique(h,t,this._passParameters,this._drawParameters),f.screen.draw(),h.release();const P=a.acquire(u,d,"ssao blur",qe.RED);f.bindFramebuffer(P.fbo),this._drawParameters.colorTexture=B.getTexture(),Pe(this._drawParameters.blurSize,0,ot/c),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),B.release();const G=a.acquire(u,d,ct.SSAO,qe.RED);return f.bindFramebuffer(G.fbo),f.setViewport(0,0,l,c),f.setClearColor(1,1,1,0),f.clear(Bo.COLOR),this._drawParameters.colorTexture=P.getTexture(),Pe(this._drawParameters.blurSize,ot/l,0),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),v.release(),f.setViewport4fv(n.fullViewport),P.release(),V<1&&this.requestRender(Qt.UPDATE),G}};m([z()],ze.prototype,"consumes",void 0),m([z()],ze.prototype,"produces",void 0),m([z({constructOnly:!0})],ze.prototype,"techniques",void 0),m([z({constructOnly:!0})],ze.prototype,"isEnabled",void 0),ze=m([ur("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ze);const Rn=.5;function br(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new X("ssaoTex",(i,o)=>o.ssao?.getTexture())),r.constants.add("blurSizePixelsInverse","float",1/ot),r.code.add(s`float evaluateAmbientOcclusionInverse() { +vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0)); +return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r; +} +float evaluateAmbientOcclusion() { +return 1.0 - evaluateAmbientOcclusionInverse(); +}`)):r.code.add(s`float evaluateAmbientOcclusionInverse() { return 1.0; } +float evaluateAmbientOcclusion() { return 0.0; }`)}let In=class{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context.stippleTextures}get _markerTextures(){return this._techniques.context.markerTextures}acquireTechnique(e,t){return this._techniques.acquire(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return er.LOADED}},Ln=class extends In{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this._textureId=e.textureId,this._acquire(e.textureId,t=>this._texture=t),this._acquire(e.normalTextureId,t=>this._textureNormal=t),this._acquire(e.emissiveTextureId,t=>this._textureEmissive=t),this._acquire(e.occlusionTextureId,t=>this._textureOcclusion=t),this._acquire(e.metallicRoughnessTextureId,t=>this._textureMetallicRoughness=t)}dispose(){super.dispose(),this._texture=Oe(this._texture),this._textureNormal=Oe(this._textureNormal),this._textureEmissive=Oe(this._textureEmissive),this._textureOcclusion=Oe(this._textureOcclusion),this._textureMetallicRoughness=Oe(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return this._numLoading===0?er.LOADED:er.LOADING}get textureBindParameters(){return new Pn(this._texture!=null?this._texture.glTexture:null,this._textureNormal!=null?this._textureNormal.glTexture:null,this._textureEmissive!=null?this._textureEmissive.glTexture:null,this._textureOcclusion!=null?this._textureOcclusion.glTexture:null,this._textureMetallicRoughness!=null?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){this._texture!=null&&e===this._texture.id||(this._texture=Oe(this._texture),this._textureId=e,this._acquire(this._textureId,t=>this._texture=t))}_acquire(e,t){if(e==null)return void t(null);const r=this._textures.acquire(e);if(Eo(r))return++this._numLoading,void r.then(i=>{if(this._disposed)return Oe(i),void t(null);t(i)}).finally(()=>--this._numLoading);t(r)}},Nn=class extends Qe{constructor(e=null){super(),this.textureEmissive=e}},Pn=class extends Nn{constructor(e=null,t=null,r=null,i=null,o=null,a,n){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=a,this.normalTextureTransformMatrix=n}};var N;(function(e){e[e.Disabled=0]="Disabled",e[e.Normal=1]="Normal",e[e.Schematic=2]="Schematic",e[e.Water=3]="Water",e[e.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",e[e.Simplified=5]="Simplified",e[e.TerrainWithWater=6]="TerrainWithWater",e[e.COUNT=7]="COUNT"})(N||(N={}));function Yi(e,t){const r=t.pbrMode,i=e.fragment;if(r!==N.Schematic&&r!==N.Disabled&&r!==N.Normal)return void i.code.add(s`void applyPBRFactors() {}`);if(r===N.Disabled)return void i.code.add(s`void applyPBRFactors() {} +float getBakedOcclusion() { return 1.0; }`);if(r===N.Schematic)return void i.code.add(s`vec3 mrr = vec3(0.0, 0.6, 0.2); +float occlusion = 1.0; +void applyPBRFactors() {} +float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:o,hasMetallicRoughnessTextureTransform:a,hasOcclusionTexture:n,hasOcclusionTextureTransform:l,bindType:c}=t;(o||n)&&e.include(xr,t),i.code.add(s`vec3 mrr; +float occlusion;`),o&&i.uniforms.add(c===R.Pass?new X("texMetallicRoughness",u=>u.textureMetallicRoughness):new pt("texMetallicRoughness",u=>u.textureMetallicRoughness)),n&&i.uniforms.add(c===R.Pass?new X("texOcclusion",u=>u.textureOcclusion):new pt("texOcclusion",u=>u.textureOcclusion)),i.uniforms.add(c===R.Pass?new q("mrrFactors",u=>u.mrrFactors):new le("mrrFactors",u=>u.mrrFactors)),i.code.add(s` + ${y(o,s`void applyMetallicRoughness(vec2 uv) { + vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb; + mrr[0] *= metallicRoughness.b; + mrr[1] *= metallicRoughness.g; + }`)} + + ${y(n,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")} + + float getBakedOcclusion() { + return ${n?"occlusion":"1.0"}; + } + + void applyPBRFactors() { + mrr = mrrFactors; + occlusion = 1.0; + + ${y(o,`applyMetallicRoughness(${a?"metallicRoughnessUV":"vuv0"});`)} + ${y(n,`applyOcclusion(${l?"occlusionUV":"vuv0"});`)} + } + `)}function Dn(e,t){const r=e.fragment,i=t.lightingSphericalHarmonicsOrder!==void 0?t.lightingSphericalHarmonicsOrder:2;i===0?(r.uniforms.add(new q("lightingAmbientSH0",(o,a)=>Y(ii,a.lighting.sh.r[0],a.lighting.sh.g[0],a.lighting.sh.b[0]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec3 ambientLight = 0.282095 * lightingAmbientSH0; +return ambientLight * (1.0 - ambientOcclusion); +}`)):i===1?(r.uniforms.add(new te("lightingAmbientSH_R",(o,a)=>oe(me,a.lighting.sh.r[0],a.lighting.sh.r[1],a.lighting.sh.r[2],a.lighting.sh.r[3])),new te("lightingAmbientSH_G",(o,a)=>oe(me,a.lighting.sh.g[0],a.lighting.sh.g[1],a.lighting.sh.g[2],a.lighting.sh.g[3])),new te("lightingAmbientSH_B",(o,a)=>oe(me,a.lighting.sh.b[0],a.lighting.sh.b[1],a.lighting.sh.b[2],a.lighting.sh.b[3]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec4 sh0 = vec4( +0.282095, +0.488603 * normal.x, +0.488603 * normal.z, +0.488603 * normal.y +); +vec3 ambientLight = vec3( +dot(lightingAmbientSH_R, sh0), +dot(lightingAmbientSH_G, sh0), +dot(lightingAmbientSH_B, sh0) +); +return ambientLight * (1.0 - ambientOcclusion); +}`)):i===2&&(r.uniforms.add(new q("lightingAmbientSH0",(o,a)=>Y(ii,a.lighting.sh.r[0],a.lighting.sh.g[0],a.lighting.sh.b[0])),new te("lightingAmbientSH_R1",(o,a)=>oe(me,a.lighting.sh.r[1],a.lighting.sh.r[2],a.lighting.sh.r[3],a.lighting.sh.r[4])),new te("lightingAmbientSH_G1",(o,a)=>oe(me,a.lighting.sh.g[1],a.lighting.sh.g[2],a.lighting.sh.g[3],a.lighting.sh.g[4])),new te("lightingAmbientSH_B1",(o,a)=>oe(me,a.lighting.sh.b[1],a.lighting.sh.b[2],a.lighting.sh.b[3],a.lighting.sh.b[4])),new te("lightingAmbientSH_R2",(o,a)=>oe(me,a.lighting.sh.r[5],a.lighting.sh.r[6],a.lighting.sh.r[7],a.lighting.sh.r[8])),new te("lightingAmbientSH_G2",(o,a)=>oe(me,a.lighting.sh.g[5],a.lighting.sh.g[6],a.lighting.sh.g[7],a.lighting.sh.g[8])),new te("lightingAmbientSH_B2",(o,a)=>oe(me,a.lighting.sh.b[5],a.lighting.sh.b[6],a.lighting.sh.b[7],a.lighting.sh.b[8]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec3 ambientLight = 0.282095 * lightingAmbientSH0; +vec4 sh1 = vec4( +0.488603 * normal.x, +0.488603 * normal.z, +0.488603 * normal.y, +1.092548 * normal.x * normal.y +); +vec4 sh2 = vec4( +1.092548 * normal.y * normal.z, +0.315392 * (3.0 * normal.z * normal.z - 1.0), +1.092548 * normal.x * normal.z, +0.546274 * (normal.x * normal.x - normal.y * normal.y) +); +ambientLight += vec3( +dot(lightingAmbientSH_R1, sh1), +dot(lightingAmbientSH_G1, sh1), +dot(lightingAmbientSH_B1, sh1) +); +ambientLight += vec3( +dot(lightingAmbientSH_R2, sh2), +dot(lightingAmbientSH_G2, sh2), +dot(lightingAmbientSH_B2, sh2) +); +return ambientLight * (1.0 - ambientOcclusion); +}`),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic||r.code.add(s`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0); +vec3 calculateAmbientRadiance(float ambientOcclusion) +{ +vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2; +return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance; +}`))}const ii=I(),me=Ht();function Nt(e){e.uniforms.add(new q("mainLightDirection",(t,r)=>r.lighting.mainLight.direction))}function xt(e){e.uniforms.add(new q("mainLightIntensity",(t,r)=>r.lighting.mainLight.intensity))}function Fn(e){Nt(e.fragment),xt(e.fragment),e.fragment.code.add(s`vec3 applyShading(vec3 shadingNormalWorld, float shadow) { +float dotVal = clamp(dot(shadingNormalWorld, mainLightDirection), 0.0, 1.0); +return mainLightIntensity * ((1.0 - shadow) * dotVal); +}`)}function Bn(e){const t=e.fragment.code;t.add(s`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) +{ +return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5; +}`),t.add(s`float integratedRadiance(float cosTheta2, float roughness) +{ +return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0); +}`),t.add(s`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) +{ +float cosTheta2 = 1.0 - RdotNG * RdotNG; +float intRadTheta = integratedRadiance(cosTheta2, roughness); +float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta; +float sky = 2.0 - ground; +return (ground * ambientGround + sky * ambientSky) * 0.5; +}`)}function Xi(e){const t=3.141592653589793,r=.3183098861837907;e.vertex.constants.add("PI","float",t),e.fragment.constants.add("PI","float",t),e.fragment.constants.add("LIGHT_NORMALIZATION","float",r),e.fragment.constants.add("INV_PI","float",r),e.fragment.constants.add("HALF_PI","float",1.570796326794897),e.fragment.constants.add("TWO_PI","float",6.28318530717958)}function Er(e,t){const r=e.fragment.code;e.include(Xi),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic&&t.pbrMode!==N.Simplified&&t.pbrMode!==N.TerrainWithWater||(r.add(s`float normalDistribution(float NdotH, float roughness) +{ +float a = NdotH * roughness; +float b = roughness / (1.0 - NdotH * NdotH + a * a); +return b * b * INV_PI; +}`),r.add(s`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022); +const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040); +const vec2 c2 = vec2(-1.04, 1.04); +vec2 prefilteredDFGAnalytical(float roughness, float NdotV) { +vec4 r = roughness * c0 + c1; +float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y; +return c2 * a004 + r.zw; +}`)),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic||(e.include(Bn),r.add(s`struct PBRShadingInfo +{ +float NdotV; +float LdotH; +float NdotNG; +float RdotNG; +float NdotAmbDir; +float NdotH_Horizon; +vec3 skyRadianceToSurface; +vec3 groundRadianceToSurface; +vec3 skyIrradianceToSurface; +vec3 groundIrradianceToSurface; +float averageAmbientRadiance; +float ssao; +vec3 albedoLinear; +vec3 f0; +vec3 f90; +vec3 diffuseColor; +float metalness; +float roughness; +};`),r.add(s`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) { +vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG); +vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness); +vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI; +vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV); +vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y; +vec3 specularComponent = specularColor * indirectSpecular; +return (diffuseComponent + specularComponent); +}`),r.add(s`float gamutMapChanel(float x, vec2 p){ +return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) ); +}`),r.add(s`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){ +vec3 outColor; +vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance)); +outColor.x = gamutMapChanel(inColor.x, p) ; +outColor.y = gamutMapChanel(inColor.y, p) ; +outColor.z = gamutMapChanel(inColor.z, p) ; +return outColor; +}`))}let zn=class extends J{constructor(e,t){super(e,"bool",R.Pass,(r,i,o)=>r.setUniform1b(e,t(i,o)))}};const Gn=.4;function Sr(e){e.constants.add("ambientBoostFactor","float",Gn)}function Ar(e){e.uniforms.add(new ie("lightingGlobalFactor",(t,r)=>r.lighting.globalFactor))}function Ji(e,t){const r=e.fragment;switch(e.include(br,t),t.pbrMode!==N.Disabled&&e.include(Er,t),e.include(Dn,t),e.include(Xi),r.code.add(s` + const float GAMMA_SRGB = 2.1; + const float INV_GAMMA_SRGB = 0.4761904; + ${t.pbrMode===N.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"} + `),Sr(r),Ar(r),Nt(r),r.code.add(s` + float additionalDirectedAmbientLight(vec3 vPosWorld) { + float vndl = dot(${t.spherical?s`normalize(vPosWorld)`:s`vec3(0.0, 0.0, 1.0)`}, mainLightDirection); + return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0)); + } + `),xt(r),r.code.add(s`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) { +float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld); +return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity; +}`),t.pbrMode){case N.Disabled:case N.WaterOnIntegratedMesh:case N.Water:e.include(Fn),r.code.add(s`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) { +vec3 mainLighting = applyShading(normalWorld, shadow); +vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao); +vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); +vec3 totalLight = mainLighting + ambientLighting + additionalLight; +totalLight = min(totalLight, vec3(PI)); +vec3 outColor = vec3((albedoLinear / PI) * totalLight); +return pow(outColor, vec3(INV_GAMMA_SRGB)); +}`);break;case N.Normal:case N.Schematic:r.code.add(s`const float fillLightIntensity = 0.25; +const float horizonLightDiffusion = 0.4; +const float additionalAmbientIrradianceFactor = 0.02; +vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec4 _emission, float additionalAmbientIrradiance) +{ +vec3 viewDirection = -viewDir; +vec3 h = normalize(viewDirection + mainLightDirection); +PBRShadingInfo inputs; +inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0); +inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0); +vec3 reflectedView = normalize(reflect(viewDirection, normal)); +inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0); +inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); +inputs.ssao = ssao; +inputs.metalness = mrr[0]; +inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(s`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness; +inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0)); +inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new zn("hasFillLights",(i,o)=>o.enableFillLights)):r.constants.add("hasFillLights","bool",!1),r.code.add(s`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]); +ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0)); +inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0; +float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0); +vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity; +vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity; +vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight; +inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ; +inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new ie("lightingSpecularStrength",(i,o)=>o.lighting.mainLight.specularStrength),new ie("lightingEnvironmentStrength",(i,o)=>o.lighting.mainLight.environmentStrength)).code.add(s`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView; +vec3 horizonRingH = normalize(viewDirection + horizonRingDir); +inputs.NdotH_Horizon = dot(normal, horizonRingH); +float NdotH = clamp(dot(normal, h), 0.0, 1.0); +vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow); +vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity; +vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight; +float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0)); +inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; +inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; +inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(s` + vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs); + vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance; + vec3 emissionComponent = _emission.rgb == vec3(0.0) ? _emission.rgb : pow(_emission.rgb, vec3(GAMMA_SRGB)); + vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent; + ${t.pbrMode!==N.Schematic||t.hasColorTexture?s`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:s`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`} + return outColor; + } + `);break;case N.Simplified:case N.TerrainWithWater:Nt(r),xt(r),r.code.add(s`const float roughnessTerrain = 0.5; +const float specularityTerrain = 0.5; +const vec3 fresnelReflectionTerrain = vec3(0.04); +vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) { +vec3 viewDirection = -vd; +vec3 h = normalize(viewDirection + mainLightDirection); +float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0); +float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0); +float NdotH = clamp(dot(n, h), 0.0, 1.0); +float NdotNG = clamp(dot(n, nup), -1.0, 1.0); +vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB)); +float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2]; +vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain; +vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0)); +vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity; +vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al; +vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent; +vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5; +vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI; +vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity; +vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV); +vec3 specularColor = f0 * dfg.x + f90 * dfg.y; +vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent; +vec3 outColorLinear = outDiffColor + specularComponent; +vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB)); +return outColor; +}`);break;default:zt(t.pbrMode);case N.COUNT:}}let Vn=class extends J{constructor(e,t,r){super(e,"mat4",R.Draw,(i,o,a,n)=>i.setUniformMatrix4fv(e,t(o,a,n)),r)}},Hn=class extends J{constructor(e,t,r){super(e,"mat4",R.Pass,(i,o,a)=>i.setUniformMatrix4fv(e,t(o,a)),r)}};function Zi(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new Hn("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),Qi(e))}function Ki(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new Vn("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),Qi(e))}function Qi(e){const t=e.fragment;t.include(Wi),t.uniforms.add(new X("shadowMap",(r,i)=>i.shadowMap.depthTexture),new gr("numCascades",(r,i)=>i.shadowMap.numCascades),new te("cascadeDistances",(r,i)=>i.shadowMap.cascadeDistances)).code.add(s`int chooseCascade(float depth, out mat4 mat) { +vec4 distance = cascadeDistances; +int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3; +mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3]; +return i; +} +vec3 lightSpacePosition(vec3 _vpos, mat4 mat) { +vec4 lv = mat * vec4(_vpos, 1.0); +lv.xy /= lv.w; +return 0.5 * lv.xyz + vec3(0.5); +} +vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) { +float xScale = float(textureSize.y) / float(textureSize.x); +return vec2((float(i) + lvpos.x) * xScale, lvpos.y); +} +float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) { +return rgba4ToFloat(texelFetch(_depthTex, uv, 0)); +} +float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) { +return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0; +} +float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) { +vec2 st = fract(uv * vec2(texSize) + vec2(0.5)); +ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5)); +float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex); +float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex); +float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex); +float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex); +return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y); +} +float readShadowMap(const in vec3 _vpos, float _linearDepth) { +mat4 mat; +int i = chooseCascade(_linearDepth, mat); +if (i >= numCascades) { return 0.0; } +vec3 lvpos = lightSpacePosition(_vpos, mat); +if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; } +ivec2 size = textureSize(shadowMap, 0); +vec2 uv = cascadeCoordinates(i, size, lvpos); +return filterShadow(uv, lvpos, size, shadowMap); +}`)}function eo(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:i}){r?(e.fragment.include(_r),e.fragment.uniforms.add(new X("terrainDepthTexture",(o,a)=>a.terrainDepth?.attachment)).code.add(s` + ${t?"bool":"void"} terrainDepthTest(float fragmentDepth) { + float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r; + float linearDepth = linearizeDepth(depth); + ${t?s`return fragmentDepth < linearDepth && depth < 1.0;`:s`if(fragmentDepth ${i?">":"<="} linearDepth) discard;`} + }`)):t?e.fragment.code.add(s`#define terrainDepthTest(fragmentDepth) false`):e.fragment.code.add(s`#define terrainDepthTest(fragmentDepth) {}`)}function Un(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new ue("colorTextureTransformMatrix",r=>r.colorTextureTransformMatrix??et)).code.add(s`void forwardColorUV(){ +colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardColorUV(){}`)}function Wn(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new ue("normalTextureTransformMatrix",r=>r.normalTextureTransformMatrix??et)).code.add(s`void forwardNormalUV(){ +normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardNormalUV(){}`)}function jn(e,t){t.hasEmissionTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new ue("emissiveTextureTransformMatrix",r=>r.emissiveTextureTransformMatrix??et)).code.add(s`void forwardEmissiveUV(){ +emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardEmissiveUV(){}`)}function $n(e,t){t.hasOcclusionTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new ue("occlusionTextureTransformMatrix",r=>r.occlusionTextureTransformMatrix??et)).code.add(s`void forwardOcclusionUV(){ +occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardOcclusionUV(){}`)}function qn(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new ue("metallicRoughnessTextureTransformMatrix",r=>r.metallicRoughnessTextureTransformMatrix??et)).code.add(s`void forwardMetallicRoughnessUV(){ +metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardMetallicRoughnessUV(){}`)}function to(e){e.code.add(s`vec4 premultiplyAlpha(vec4 v) { +return vec4(v.rgb * v.a, v.a); +} +vec3 rgb2hsv(vec3 c) { +vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); +vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); +float d = q.x - min(q.w, q.y); +float e = 1.0e-10; +return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); +} +vec3 hsv2rgb(vec3 c) { +vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); +return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} +float rgb2v(vec3 c) { +return max(c.x, max(c.y, c.z)); +}`)}function ro(e){e.include(to),e.code.add(s` + vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) { + // workaround for artifacts in macOS using Intel Iris Pro + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 + vec3 internalMixed = internalColor * textureColor; + vec3 allMixed = internalMixed * externalColor; + + if (mode == ${s.int(fe.Multiply)}) { + return allMixed; + } + if (mode == ${s.int(fe.Ignore)}) { + return internalMixed; + } + if (mode == ${s.int(fe.Replace)}) { + return externalColor; + } + + // tint (or something invalid) + float vIn = rgb2v(internalMixed); + vec3 hsvTint = rgb2hsv(externalColor); + vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z); + return hsv2rgb(hsvOut); + } + + float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) { + // workaround for artifacts in macOS using Intel Iris Pro + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 + float internalMixed = internalOpacity * textureOpacity; + float allMixed = internalMixed * externalOpacity; + + if (mode == ${s.int(fe.Ignore)}) { + return internalMixed; + } + if (mode == ${s.int(fe.Replace)}) { + return externalOpacity; + } + + // multiply or tint (or something invalid) + return allMixed; + } + `)}var se;(function(e){e[e.None=0]="None",e[e.Value=1]="Value",e[e.Texture=2]="Texture",e[e.COUNT=3]="COUNT"})(se||(se={}));function kn(e,t){if(!ft(t.output))return;const{emissionSource:r,hasEmissiveTextureTransform:i,bindType:o}=t,a=r===se.Texture;a&&(e.include(xr,t),e.fragment.uniforms.add(o===R.Pass?new X("texEmission",l=>l.textureEmissive):new pt("texEmission",l=>l.textureEmissive)));const n=r===se.Value||a;n&&e.fragment.uniforms.add(o===R.Pass?new q("emissionFactor",l=>l.emissiveFactor):new le("emissionFactor",l=>l.emissiveFactor)),e.fragment.code.add(s` + vec4 getEmissions() { + vec4 emissions = ${n?"vec4(emissionFactor, 1.0)":"vec4(0.0)"}; + ${y(a,`emissions *= textureLookup(texEmission, ${i?"emissiveUV":"vuv0"}); + emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}; + return emissions; + } + `)}function io(e,t){e.include(ji,t),e.include(kn,t),e.fragment.include(to);const r=t.output===F.ObjectAndLayerIdColor,i=vi(t.output),o=ft(t.output)&&t.oitPass===k.ColorAlpha,a=ft(t.output)&&t.oitPass!==k.ColorAlpha,n=t.discardInvisibleFragments;let l=0;(a||i||o)&&e.outputs.add("fragColor","vec4",l++),i&&e.outputs.add("fragEmission","vec4",l++),o&&e.outputs.add("fragAlpha","float",l++),e.fragment.code.add(s` + void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) { + ${y(r,s`finalColor.a = 1.0;`)} + + ${y(n,s`if (finalColor.a < ${s.float(be)}){ + discard; + return; + }`)} + + finalColor = highlightSlice(finalColor, vWorldPosition); + ${y(o,s`fragColor = premultiplyAlpha(finalColor); + fragAlpha = finalColor.a;`)} + ${y(a,"fragColor = finalColor;")} + ${y(i,"fragEmission = getEmissions();")} + calculateOcclusionAndOutputHighlight(); + ${y(r,"outputObjectAndLayerIdColor();")} + } + `)}function Yn(e){const t=new jt,{vertex:r,fragment:i,varyings:o}=t,{output:a,normalType:n,offsetBackfaces:l,instancedColor:c,spherical:u,receiveShadows:d,snowCover:h,pbrMode:v,textureAlphaPremultiplied:f,instancedDoublePrecision:T,hasVertexColors:_,hasVertexTangents:x,hasColorTexture:V,hasNormalTexture:D,hasNormalTextureTransform:B,hasColorTextureTransform:P}=e;if(je(r,e),t.include(pr),o.add("vpos","vec3"),t.include(lt,e),t.include(zi,e),t.include(Ui,e),t.include(Un,e),!ft(a))return t.include($i,e),t;t.include(Wn,e),t.include(jn,e),t.include($n,e),t.include(qn,e),gt(r,e),t.include(Bt,e),t.include(We,e);const G=n===Q.Attribute||n===Q.Compressed;return G&&l&&t.include(Ni),t.include(rn,e),t.include(Si,e),c&&t.attributes.add(p.INSTANCECOLOR,"vec4"),o.add("vPositionLocal","vec3"),t.include(Ne,e),t.include(Li,e),t.include(Gi,e),t.include(Vi,e),r.uniforms.add(new te("externalColor",w=>w.externalColor)),o.add("vcolorExt","vec4"),e.terrainDepthTest&&o.add("depth","float"),r.main.add(s` + forwardNormalizedVertexColor(); + vcolorExt = externalColor; + ${y(c,"vcolorExt *= instanceColor * 0.003921568627451;")} + vcolorExt *= vvColor(); + vcolorExt *= getSymbolColor(); + forwardColorMixMode(); + + if (vcolorExt.a < ${s.float(be)}) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + } else { + vpos = getVertexInLocalOriginSpace(); + vPositionLocal = vpos - view[3].xyz; + vpos = subtractOrigin(vpos); + ${y(G,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")} + vpos = addVerticalOffset(vpos, localOrigin); + ${y(x,"vTangent = dpTransformVertexTangent(tangent);")} + gl_Position = transformPosition(proj, view, vpos); + ${y(G&&l,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")} + } + + ${y(e.terrainDepthTest,"depth = (view * vec4(vpos, 1.0)).z;")} + forwardLinearDepth(); + forwardTextureCoordinates(); + forwardColorUV(); + forwardNormalUV(); + forwardEmissiveUV(); + forwardOcclusionUV(); + forwardMetallicRoughnessUV(); + `),t.include(Ji,e),t.include(br,e),t.include($e,e),t.include(T?Zi:Ki,e),t.include(eo,e),t.include(Ue,e),t.include(io,e),gt(i,e),i.uniforms.add(r.uniforms.get("localOrigin"),new q("ambient",w=>w.ambient),new q("diffuse",w=>w.diffuse),new ie("opacity",w=>w.opacity),new ie("layerOpacity",w=>w.layerOpacity)),V&&i.uniforms.add(new X("tex",w=>w.texture)),t.include(Yi,e),t.include(Er,e),i.include(ro),t.include(tn,e),Sr(i),Ar(i),xt(i),i.main.add(s` + discardBySlice(vpos); + ${y(e.terrainDepthTest,"terrainDepthTest(depth);")} + ${V?s` + vec4 texColor = texture(tex, ${P?"colorUV":"vuv0"}); + ${y(f,"texColor.rgb /= texColor.a;")} + discardOrAdjustAlpha(texColor);`:s`vec4 texColor = vec4(1.0);`} + shadingParams.viewDirection = normalize(vpos - cameraPosition); + ${n===Q.ScreenDerivative?s`vec3 normal = screenDerivativeNormal(vPositionLocal);`:s`shadingParams.normalView = vNormalWorld; + vec3 normal = shadingNormal(shadingParams);`} + applyPBRFactors(); + float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion(); + + vec3 posWorld = vpos + localOrigin; + + float additionalAmbientScale = additionalDirectedAmbientLight(posWorld); + float shadow = ${d?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":y(u,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")}; + + vec3 matColor = max(ambient, diffuse); + vec3 albedo = mixExternalColor(${y(_,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(${y(_,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, int(colorMixMode)); + ${D?`mat3 tangentSpace = computeTangentSpace(${x?"normal":"normal, vpos, vuv0"}); + vec3 shadingNormal = computeTextureNormal(tangentSpace, ${B?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"} + vec3 normalGround = ${u?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"} + + ${y(h,s` + float snow = smoothstep(0.5, 0.55, dot(normal, normalGround)); + albedo = mix(albedo, vec3(1), snow); + shadingNormal = mix(shadingNormal, normal, snow); + ssao = mix(ssao, 1.0, snow);`)} + + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + + ${v===N.Normal||v===N.Schematic?s` + float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; + ${y(h,s`mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);`)} + vec4 emission = ${h?"mix(getEmissions(), vec4(0.0), snow)":"getEmissions()"}; + vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} + vec4 finalColor = vec4(shadedColor, opacity_); + outputColorHighlightOID(finalColor, vpos); + `),t}const Xn=Object.freeze(Object.defineProperty({__proto__:null,build:Yn},Symbol.toStringTag,{value:"Module"}));let Jn=class extends fa{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Fa,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Tt.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=Ke,this.instancedDoublePrecision=!1,this.normalType=Q.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=ut(.2,.2,.2),this.diffuse=ut(.8,.8,.8),this.externalColor=aa(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=I(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=Ft.Less,this.textureAlphaMode=ge.Blend,this.textureAlphaCutoff=be,this.textureAlphaPremultiplied=!1,this.renderOccluded=ir.Occlude,this.isDecoration=!1}},Ql=class extends pa{constructor(){super(...arguments),this.origin=I(),this.slicePlaneLocalOrigin=this.origin}},oo=class extends vr{constructor(e,t,r,i=new Wt(Xn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-C_G8bhtR.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url).then(o=>o.D))){super(e,t,i,r),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:a,customDepthTest:n,hasOccludees:l,enableOffset:c}=e,u=r===k.NONE,d=r===k.FrontFace;return Gt({blending:ft(i)&&o?wa(r):null,culling:Kn(e)?Jo(a):null,depthTest:{func:Ia(r,Zn(n))},depthWrite:Ma(e),drawBuffers:i===F.Depth?{buffers:[Go.NONE]}:La(r,i),colorWrite:Vt,stencilWrite:l?Na:null,stencilTest:l?t?Da:Pa:null,polygonOffset:u||d?null:Ra(c)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function Zn(e){return e===Ft.Lequal?de.LEQUAL:de.LESS}function Kn(e){return e.cullFace!==Tt.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qn(){return oi??=(async()=>{const e=await _t(()=>import("./basis_transcoder-BQKD9Nty-CAkTxthP.js"),[],import.meta.url),t=await e.default({locateFile:r=>Po(`esri/libs/basisu/${r}`)});return t.initializeBasis(),t})(),oi}let oi;var Le;(function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"})(Le||(Le={}));let ce=null,wt=null;async function ao(){return wt==null&&(wt=Qn(),ce=await wt),wt}function es(e,t){if(ce==null)return e.byteLength;const r=new ce.BasisFile(new Uint8Array(e)),i=so(r)?no(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function ts(e,t){if(ce==null)return e.byteLength;const r=new ce.KTX2File(new Uint8Array(e)),i=lo(r)?no(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function no(e,t,r,i,o){const a=Ho(t?pe.COMPRESSED_RGBA8_ETC2_EAC:pe.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function so(e){return e.getNumImages()>=1&&!e.isUASTC()}function lo(e){return e.getFaces()>=1&&e.isETC1S()}async function rs(e,t,r){ce==null&&(ce=await ao());const i=new ce.BasisFile(new Uint8Array(r));if(!so(i))return null;i.startTranscoding();const o=co(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(a,n)=>i.getImageTranscodedSizeInBytes(0,a,n),(a,n,l)=>i.transcodeImage(l,0,a,n,0,0));return i.close(),i.delete(),o}async function is(e,t,r){ce==null&&(ce=await ao());const i=new ce.KTX2File(new Uint8Array(r));if(!lo(i))return null;i.startTranscoding();const o=co(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(a,n)=>i.getImageTranscodedSizeInBytes(a,0,0,n),(a,n,l)=>i.transcodeImage(l,a,0,0,n,0,-1,-1));return i.close(),i.delete(),o}function co(e,t,r,i,o,a,n,l){const{compressedTextureETC:c,compressedTextureS3TC:u}=e.capabilities,[d,h]=c?i?[Le.ETC2_RGBA,pe.COMPRESSED_RGBA8_ETC2_EAC]:[Le.ETC1_RGB,pe.COMPRESSED_RGB8_ETC2]:u?i?[Le.BC3_RGBA,pe.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[Le.BC1_RGB,pe.COMPRESSED_RGB_S3TC_DXT1_EXT]:[Le.RGBA32,Ie.RGBA],v=t.hasMipmap?r:Math.min(1,r),f=[];for(let T=0;T1,t.samplingMode=t.hasMipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.width=o,t.height=a,new ke(e,t,{type:"compressed",levels:f})}const Mt=()=>hi.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),os=542327876,as=131072,ns=4;function Cr(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function ss(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}const ls=Cr("DXT1"),cs=Cr("DXT3"),ds=Cr("DXT5"),us=31,hs=0,ms=1,fs=2,ps=3,vs=4,gs=7,xs=20,_s=21;function Ts(e,t,r){const i=bs(r,t.hasMipmap??!1);if(i==null)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:l}=i;return t.samplingMode=o.levels.length>1?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=l,new ke(e,t,o)}function bs(e,t){const r=new Int32Array(e.buffer,e.byteOffset,us);if(r[hs]!==os)return Mt().error("Invalid magic number in DDS header"),null;if(!(r[xs]&ns))return Mt().error("Unsupported format, must contain a FourCC code"),null;const i=r[_s];let o,a;switch(i){case ls:o=8,a=pe.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case cs:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ds:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Mt().error("Unsupported FourCC code:",ss(i)),null}let n=1,l=r[vs],c=r[ps];(3&l||3&c)&&(Mt().warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const u=l,d=c;let h,v;r[fs]&as&&t!==!1&&(n=Math.max(1,r[gs]));let f=e.byteOffset+r[ms]+4;const T=[];for(let _=0;_>2)*(c+3>>2)*o,h=new Uint8Array(e.buffer,f,v),T.push(h),f+=v,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:T},internalFormat:a,width:u,height:d}}function Es(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?uo(e):e;let i=e.width,o=e.height;do i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o;while(r>1048576||t!=null&&(i>t||o>t));return wr(e,i,o)}function Ss(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return wr(e,Math.round(e.width*i),Math.round(e.height*i))}function wr(e,t,r){if(e instanceof ImageData)return wr(uo(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function uo(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(r==null)throw new Te("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}let ec=class extends Ci{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=vt.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new So,this._parameters={...Cs,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(Ir(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const r=()=>{e.removeEventListener("canplay",r),e.play()};e.addEventListener("canplay",r)}}}_startPreloadImageElement(e){Ao(e.src)||Ir(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new mi;return t.wrapMode=this._parameters.wrap??ht.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||As(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return t==null?(this._glTexture=new ke(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof t=="string"?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):rt(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,t):it(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):(it(t)||rt(t))&&this._parameters.encoding===Ve.KTX2_ENCODING?this._loadFromKTX2(e,t):(it(t)||rt(t))&&this._parameters.encoding===Ve.BASIS_ENCODING?this._loadFromBasis(e,t):rt(t)?this._loadFromPixelData(e,t):it(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return this._glTexture==null||e.readyStateis(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromBasis(e,t){return this._loadAsync(()=>rs(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromPixelData(e,t){W(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=this._parameters.components===1?Ie.LUMINANCE:this._parameters.components===3?Ie.RGB:Ie.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ke(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await Do(t,{signal:r});return Lr(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await Co(t,t.src,!1,r);return Lr(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=dt.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",l),No(c)},n=()=>{t.readyState>=dt.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},l=u=>{a(),o(u||new Te("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",l);const c=wo(r,()=>l(Mo()))}))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:a}=e.parameters;r=this._parameters.downsampleUncompressed?Es(r,a):Ss(r,a)}const i=ho(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=this._parameters.components===3?Ie.RGB:Ie.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new ke(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=Rt(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function As(e,t){if(e==null)return 0;if(it(e)||rt(e))return t.encoding===Ve.KTX2_ENCODING?ts(e,!!t.mipmap):t.encoding===Ve.BASIS_ENCODING?es(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ho(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}function ho(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}var dt;(function(e){e[e.HAVE_NOTHING=0]="HAVE_NOTHING",e[e.HAVE_METADATA=1]="HAVE_METADATA",e[e.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",e[e.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",e[e.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(dt||(dt={}));const Cs={wrap:{s:ht.REPEAT,t:ht.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};class ws{constructor(t=!1,r=!0){this.isVerticalRay=t,this.normalRequired=r}}const Ot=go();function Ms(e,t,r,i,o,a){if(!e.visible)return;const n=Ye(Hs,i,r),l=(u,d,h)=>{a(u,h,d,!1)},c=new ws(!1,t.options.normalRequired);if(e.boundingInfo){W(e.type===vt.Mesh);const u=t.tolerance;mo(e.boundingInfo,r,n,u,o,c,l)}else{const u=e.attributes.get(p.POSITION),d=u.indices;Rs(r,n,0,d.length/3,d,u.data,u.stride,o,c,l)}}const Os=I();function mo(e,t,r,i,o,a,n){if(e==null)return;const l=Fs(r,Os);if(Oo(Ot,e.bbMin),yo(Ot,e.bbMax),o?.applyToAabb(Ot),Bs(Ot,t,l,i)){const{primitiveIndices:c,position:u}=e,d=c?c.length:u.indices.length/3;if(d>Gs){const h=e.getChildren();if(h!==void 0){for(const v of h)mo(v,t,r,i,o,a,n);return}}ys(t,r,0,d,u.indices,u.data,u.stride,c,o,a,n)}}const at=I();function ys(e,t,r,i,o,a,n,l,c,u,d){const h=e[0],v=e[1],f=e[2],T=t[0],_=t[1],x=t[2],{normalRequired:V}=u;for(let D=r;D0){if(Be<0||Be>ne)continue}else if(Be>0||Be0){if(Et<0||Be+Et>ne)continue}else if(Et>0||Be+Et=0&&d(Rr,B,V?Ps(ee,Ee,Se,Ae,Ce,he,at):null)}}function Rs(e,t,r,i,o,a,n,l,c,u){const d=t,h=Us,v=Math.abs(d[0]),f=Math.abs(d[1]),T=Math.abs(d[2]),_=v>=f?v>=T?0:2:f>=T?1:2,x=_,V=d[x]<0?2:1,D=(_+V)%3,B=(_+(3-V))%3,P=d[D]/d[x],G=d[B]/d[x],w=1/d[x],S=Is,E=Ls,M=Ns,{normalRequired:O}=c;for(let g=r;g0||we>0||Me>0))continue;const De=he+we+Me;if(De===0)continue;const ne=he*(w*S[x])+we*(w*E[x])+Me*(w*M[x]);if(ne*Math.sign(De)<0)continue;const Fe=ne/De;Fe>=0&&u(Fe,g,O?Ds(h):null)}}const Is=I(),Ls=I(),Ns=I();function Ps(e,t,r,i,o,a,n){return Y(Pt,e,t,r),Y(Dt,i,o,a),pi(n,Pt,Dt),mr(n,n),n}function Ds(e){return Ye(Pt,e[1],e[0]),Ye(Dt,e[2],e[0]),pi(at,Pt,Dt),mr(at,at),at}const Pt=I(),Dt=I();function Fs(e,t){return Y(t,1/e[0],1/e[1],1/e[2])}function Bs(e,t,r,i){return zs(e,t,r,i,1/0)}function zs(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let l=Math.min(a,n),c=Math.max(a,n);const u=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(c=Math.min(c,Math.max(u,d)),c<0||(l=Math.max(l,Math.min(u,d)),l>c))return!1;const h=(e[2]-i-t[2])*r[2],v=(e[5]+i-t[2])*r[2];return c=Math.min(c,Math.max(h,v)),!(c<0)&&(l=Math.max(l,Math.min(h,v)),!(l>c)&&l{w=a[O]+B,S=a[O+1]+P,E=a[O+2]+G}:O=>{const g=a[O],L=a[O+1],C=a[O+2];w=d*g+f*L+x*C+B,S=h*g+T*L+V*C+P,E=v*g+_*L+D*C+G};if(o===1)for(let O=0;O{S=a[g],E=a[g+1],M=a[g+2]}:g=>{const L=a[g],C=a[g+1],H=a[g+2];S=h*L+T*C+V*H,E=v*L+_*C+D*H,M=f*L+x*C+B*H};if(o===1)if(P)for(let g=0;gG){const C=1/Math.sqrt(L);c[i]=S*C,c[i+1]=E*C,c[i+2]=M*C}else c[i]=S,c[i+1]=E,c[i+2]=M;i+=u}else for(let g=0;gG){const C=1/Math.sqrt(L);S*=C,E*=C,M*=C}}for(let L=0;LG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}c[i]=C,c[i+1]=H,c[i+2]=$,c[i+3]=L,i+=u}else for(let S=0;SG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}for(let Z=0;Z0)??[],this._parameterNames??=[]}get key(){return this._key??=new Ks(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(i=>` ${i}: ${this[i]}`).join(` +`);return this._parameterBits=t,r}};function b(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const i=e.count||2,o=Math.ceil(Math.log2(i)),a=t._parameterBits;let n=0;for(;a[n]+o>16;)n++,n>=a.length&&a.push(0);const l=a[n],c=(1<>l},set(u){if(this[r]!==u){if(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<>l)},set(u){if(this[r]!==u&&(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<v.externalColor)),o.add("vcolorExt","vec4"),r.main.add(s` + forwardNormalizedVertexColor(); + vcolorExt = externalColor; + ${y(l,"vcolorExt *= instanceColor * 0.003921568627451;")} + vcolorExt *= vvColor(); + vcolorExt *= getSymbolColor(); + forwardColorMixMode(); + + if (vcolorExt.a < ${s.float(be)}) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + } else { + vpos = getVertexInLocalOriginSpace(); + localvpos = vpos - view[3].xyz; + vpos = subtractOrigin(vpos); + vNormalWorld = dpNormal(vvLocalNormal(normalModel())); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + ${y(n,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")} + } + ${y(e.terrainDepthTest,"depth = (view * vec4(vpos, 1.0)).z;")} + forwardLinearDepth(); + forwardTextureCoordinates();`)),a===F.Color){const{hasColorTexture:v,hasColorTextureTransform:f,receiveShadows:T}=e;t.include(Ji,e),t.include(br,e),t.include($e,e),t.include(e.instancedDoublePrecision?Zi:Ki,e),t.include(eo,e),t.include(Ue,e),t.include(io,e),gt(t.fragment,e),Nt(i),Sr(i),Ar(i),i.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new q("ambient",_=>_.ambient),new q("diffuse",_=>_.diffuse),new ie("opacity",_=>_.opacity),new ie("layerOpacity",_=>_.layerOpacity)),v&&i.uniforms.add(new X("tex",_=>_.texture)),t.include(Yi,e),t.include(Er,e),i.include(ro),xt(i),i.main.add(s` + discardBySlice(vpos); + ${y(e.terrainDepthTest,"terrainDepthTest(depth);")} + vec4 texColor = ${v?`texture(tex, ${f?"colorUV":"vuv0"})`:" vec4(1.0)"}; + ${y(v,`${y(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")} + discardOrAdjustAlpha(texColor);`)} + vec3 viewDirection = normalize(vpos - cameraPosition); + applyPBRFactors(); + float ssao = evaluateAmbientOcclusionInverse(); + ssao *= getBakedOcclusion(); + + float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + float shadow = ${T?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":d?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; + vec3 matColor = max(ambient, diffuse); + ${e.hasVertexColors?s`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:s`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + ${y(u,"albedo = mix(albedo, vec3(1), 0.9);")} + ${s`vec3 shadingNormal = normalize(vNormalWorld); + albedo *= 1.2; + vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]); + float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0); + float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0); + float treeRadialFalloff = vColor.r; + float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow); + additionalLight += backLightFactor * mainLightIntensity;`} + ${y(h,`vec3 normalGround = ${d?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)} + ${h?s`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; + ${y(u,s`mrr = vec3(0.0, 1.0, 0.04);`)} + vec4 emission = ${u?"vec4(0.0)":"getEmissions()"}; + vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} + vec4 finalColor = vec4(shadedColor, opacity_); + outputColorHighlightOID(finalColor, vpos);`)}return t.include($i,e),t}const tl=Object.freeze(Object.defineProperty({__proto__:null,build:el},Symbol.toStringTag,{value:"Module"}));class rl extends oo{constructor(t,r,i){super(t,r,i,new Wt(tl,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-C_G8bhtR.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url).then(o=>o.R))),this.type="RealisticTreeTechnique"}}class ic extends Ca{constructor(t,r){super(t,ol),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[st.OPAQUE_MATERIAL,i=>(Dr(i)||kt(i))&&!this.parameters.transparent],[st.TRANSPARENT_MATERIAL,i=>(Dr(i)||kt(i))&&this.parameters.transparent&&this.parameters.writeDepth],[st.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,i=>(ko(i)||kt(i))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=nl(this.parameters),this._configuration=new A(r.spherical,r.doublePrecisionRequiresObfuscation)}isVisibleForOutput(t){return t!==F.Shadow&&t!==F.ShadowExcludeHighlight&&t!==F.ShadowHighlight||this.parameters.castShadows}get visible(){const t=this.parameters;if(t.layerOpacity=be;if(i&&n)return l||c;const u=t.externalColor&&t.externalColor[3]>=be;return i?l?u:c:n?l||c:l?u:c}get hasEmissions(){return!!this.parameters.emissiveTextureId||!fi(this.parameters.emissiveFactor,Ke)}getConfiguration(t,r){const i=this.parameters,{treeRendering:o,doubleSided:a,doubleSidedType:n}=i;return this._configuration.output=t,this._configuration.hasNormalTexture=!o&&!!i.normalTextureId,this._configuration.hasColorTexture=!!i.textureId,this._configuration.hasVertexTangents=!o&&i.hasVertexTangents,this._configuration.instanced=i.isInstanced,this._configuration.instancedDoublePrecision=i.instancedDoublePrecision,this._configuration.vvSize=!!i.vvSize,this._configuration.hasVerticalOffset=i.verticalOffset!=null,this._configuration.hasScreenSizePerspective=i.screenSizePerspective!=null,this._configuration.hasSlicePlane=i.hasSlicePlane,this._configuration.hasSliceHighlight=i.hasSliceHighlight,this._configuration.alphaDiscardMode=i.textureAlphaMode,this._configuration.normalType=o?Q.Attribute:i.normalType,this._configuration.transparent=i.transparent,this._configuration.writeDepth=i.writeDepth,i.customDepthTest!=null&&(this._configuration.customDepthTest=i.customDepthTest),this._configuration.hasOccludees=r.hasOccludees,this._configuration.cullFace=i.hasSlicePlane?Tt.None:i.cullFace,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasModelTransformation=!o&&i.modelTransformation!=null,this._configuration.hasVertexColors=i.hasVertexColors,this._configuration.hasSymbolColors=i.hasSymbolColors,this._configuration.doubleSidedMode=o?re.WindingOrder:a&&n==="normal"?re.View:a&&n==="winding-order"?re.WindingOrder:re.None,this._configuration.instancedColor=i.hasInstancedColor,this._configuration.receiveShadows=i.receiveShadows&&i.receiveShadows,this._configuration.receiveAmbientOcclusion=i.receiveAmbientOcclusion&&r.ssao!=null,this._configuration.vvColor=!!i.vvColor,this._configuration.textureAlphaPremultiplied=!!i.textureAlphaPremultiplied,this._configuration.pbrMode=i.usePBR?i.isSchematic?N.Schematic:N.Normal:N.Disabled,this._configuration.hasMetallicRoughnessTexture=!o&&!!i.metallicRoughnessTextureId,this._configuration.emissionSource=o?se.None:i.emissiveTextureId!=null?se.Texture:i.usePBR?se.Value:se.None,this._configuration.hasOcclusionTexture=!o&&!!i.occlusionTextureId,this._configuration.offsetBackfaces=!(!i.transparent||!i.offsetTransparentBackfaces),this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation=1),W(i.size===3||i.size===4);const{data:o,size:a,indices:n}=i;W(n.length%this._numIndexPerPrimitive==0),W(n.length>=t.length*this._numIndexPerPrimitive);const l=t.length;let c=a*n[this._numIndexPerPrimitive*t[0]];Re.clear(),Re.push(c);const u=It(o[c],o[c+1],o[c+2]),d=Ro(u);for(let f=0;f0&&++c;if(c<2)return;const u=new Array(8);for(let d=0;d<8;++d)u[d]=o[d]>0?new Uint32Array(o[d]):void 0;for(let d=0;d<8;++d)o[d]=0;for(let d=0;di.map(i=>d[i]); -import{v as m,S as z,i as ur,gU as go,dD as si,j as li,dU as I,ah as ci,aL as xo,o as Te,aN as St,hT as Rt,dG as di,h_ as Ke,i0 as ut,_ as _t,hZ as It,K as _o,hB as To,bl as bo,ae as hr,U as Oe,t as Eo,I as So,dq as Ir,d7 as Ao,hU as rt,hY as it,$ as Lr,iy as Co,E as wo,aS as Mo,iz as Oo,iA as yo,hq as ui,i8 as Ro,hc as Io,hV as Lo,a1 as hi,al as No,bw as Po}from"./main-BZaw9FpY.js";import{r as Do}from"./requestImageUtils-Ut4YcoNU-DS9BT3TV.js";import{i as ve,N as ge,e as Tt,s as Ft,O as Qt,t as er,D as Ve}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{A as At,L as de,D as ae,G as ht,U as Ie,s as Fo,R as Bo,T as zo,f as Go,M as Je,X as ye,t as pe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as mi,V as ke,F as Vo,X as Ho}from"./Texture-BCt2hphT-D-X9O5uh.js";import{h as W}from"./Util-BjGjeg6f-08Szkf4F.js";import{b as xe,_ as Y,N as He,R as fi,Y as mt,j as Uo,r as nt,A as yt,l as mr,L as Nr,y as Wo,Z as jo,k as Ye,S as pi,X as Pr,p as $o}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{l as tr}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{R as qo}from"./InterleavedLayout-DXzw3B2n-BD8s1eQP.js";import{o as F,t as Q,c as ft,S as Bt,i as fe,h as vi,g as Dr,p as kt,f as ko}from"./NormalAttribute.glsl-axtNsUxo-corrAl_5.js";import{t as zt}from"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import{e as s,c as y,i as Qe}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{a as R}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{o as be}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-BetNH2zh.js";import{b as gi,F as _e}from"./sphere-BenPORjV-CgNvGf8s.js";import{f as Yo,K as Gt,B as Xo,m as Vt,y as Jo,D as Zo,N as Ko}from"./renderState-Dap0WV9P-D4IHxyei.js";import{U as Qo}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as bt,u as et}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{H as rr,i as xi,c as _i}from"./mat4-DX7gBViE-CQMXDC3Z.js";import{t as fr,u as Fr}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{i as ea,v as ta}from"./orientedBoundingBox-oHezdpWm-CdJ2bdTT.js";import{L as Ti,X as Br,J as ra,p as ia,j as oa,l as zr}from"./BufferView-PQoE3GL7-DXIpDOUe.js";import{o as Ht,e as aa}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{l as na,r as sa}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{y as oe}from"./vec42-D8CJyqHG-DnfLTeQH.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import{o as Ut,l as la}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as Pe}from"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";function Ul(e,t=!1){return e<=di?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function ca(e){e.vertex.code.add(s` - vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) { - float symbolAlpha = 0.0; - - const float maxTint = 85.0; - const float maxReplace = 170.0; - const float scaleAlpha = 3.0; - - if (symbolColor.a > maxReplace) { - colorMixMode = ${s.int(fe.Multiply)}; - symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace); - } else if (symbolColor.a > maxTint) { - colorMixMode = ${s.int(fe.Replace)}; - symbolAlpha = scaleAlpha * (symbolColor.a - maxTint); - } else if (symbolColor.a > 0.0) { - colorMixMode = ${s.int(fe.Tint)}; - symbolAlpha = scaleAlpha * symbolColor.a; - } else { - colorMixMode = ${s.int(fe.Multiply)}; - symbolAlpha = 0.0; - } - - return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha); - } - `)}let J=class{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={[R.Pass]:null,[R.Draw]:null},i)switch(r){case R.Pass:this.bind[R.Pass]=i;break;case R.Draw:this.bind[R.Draw]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}},pt=class extends J{constructor(e,t){super(e,"sampler2D",R.Draw,(r,i,o)=>r.bindTexture(e,t(i,o)))}};function da(){return!!_o("enable-feature:objectAndLayerId-rendering")}function bi({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(s`vec3 dpPlusFrc(vec3 a, vec3 b) { -return mix(a, a + b, vec3(notEqual(b, vec3(0)))); -} -vec3 dpMinusFrc(vec3 a, vec3 b) { -return mix(vec3(0), a - b, vec3(notEqual(a, b))); -} -vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { -vec3 t1 = dpPlusFrc(hiA, hiB); -vec3 e = dpMinusFrc(t1, hiA); -vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; -return t1 + t2; -}`):e.add(s`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { -vec3 t1 = hiA + hiB; -vec3 e = t1 - hiA; -vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; -return t1 + t2; -}`)}let le=class extends J{constructor(e,t){super(e,"vec3",R.Draw,(r,i,o,a)=>r.setUniform3fv(e,t(i,o,a)))}},q=class extends J{constructor(e,t){super(e,"vec3",R.Pass,(r,i,o)=>r.setUniform3fv(e,t(i,o)))}},ie=class extends J{constructor(e,t){super(e,"float",R.Pass,(r,i,o)=>r.setUniform1f(e,t(i,o)))}},Ei=class extends J{constructor(e,t){super(e,"mat3",R.Draw,(r,i,o)=>r.setUniformMatrix3fv(e,t(i,o)))}},ue=class extends J{constructor(e,t){super(e,"mat3",R.Pass,(r,i,o)=>r.setUniformMatrix3fv(e,t(i,o)))}},Xe=class extends J{constructor(e,t){super(e,"mat4",R.Pass,(r,i,o)=>r.setUniformMatrix4fv(e,t(i,o)))}},U=class extends li{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};m([z()],U.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_GRID",void 0),m([z()],U.prototype,"LABELS_SHOW_BORDER",void 0),m([z()],U.prototype,"TEXT_SHOW_BASELINE",void 0),m([z()],U.prototype,"TEXT_SHOW_BORDER",void 0),m([z()],U.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),m([z()],U.prototype,"OVERLAY_SHOW_CENTER",void 0),m([z()],U.prototype,"SHOW_POI",void 0),m([z()],U.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),m([z()],U.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),m([z()],U.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),m([z()],U.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),m([z()],U.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"I3S_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"I3S_SHOW_MODIFICATIONS",void 0),m([z()],U.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),m([z()],U.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),m([z()],U.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),m([z()],U.prototype,"LINE_WIREFRAMES",void 0),U=m([ur("esri.views.3d.support.debugFlags")],U);const Wl=new U;var st;(function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=16]="DRAPED_MATERIAL",e[e.DRAPED_WATER=17]="DRAPED_WATER",e[e.VOXEL=18]="VOXEL",e[e.MAX_SLOTS=19]="MAX_SLOTS"})(st||(st={}));function pr(e){e.attributes.add(p.POSITION,"vec3"),e.vertex.code.add(s`vec3 positionModel() { return position; }`)}function ua(e,t){e.include(pr);const r=e.vertex;r.include(bi,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new q("transformWorldFromViewTH",i=>i.transformWorldFromViewTH),new q("transformWorldFromViewTL",i=>i.transformWorldFromViewTL),new ue("transformViewFromCameraRelativeRS",i=>i.transformViewFromCameraRelativeRS),new Xe("transformProjFromView",i=>i.transformProjFromView),new Ei("transformWorldFromModelRS",i=>i.transformWorldFromModelRS),new le("transformWorldFromModelTH",i=>i.transformWorldFromModelTH),new le("transformWorldFromModelTL",i=>i.transformWorldFromModelTL)),r.code.add(s`vec3 positionWorldCameraRelative() { -vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel(); -vec3 transform_CameraRelativeFromModel = dpAdd( -transformWorldFromModelTL, -transformWorldFromModelTH, --transformWorldFromViewTL, --transformWorldFromViewTH -); -return transform_CameraRelativeFromModel + rotatedModelPosition; -}`),r.code.add(s` - void forwardPosition(float fOffset) { - vPositionWorldCameraRelative = positionWorldCameraRelative(); - if (fOffset != 0.0) { - vPositionWorldCameraRelative += fOffset * ${t.spherical?s`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:s`vec3(0.0, 0.0, 1.0)`}; - } - - vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative; - gl_Position = transformProjFromView * vec4(vPosition_view, 1.0); - } - `),e.fragment.uniforms.add(new q("transformWorldFromViewTL",i=>i.transformWorldFromViewTL)),r.code.add(s`vec3 positionWorld() { -return transformWorldFromViewTL + vPositionWorldCameraRelative; -}`),e.fragment.code.add(s`vec3 positionWorld() { -return transformWorldFromViewTL + vPositionWorldCameraRelative; -}`)}let ha=class extends Qe{constructor(){super(...arguments),this.transformWorldFromViewTH=I(),this.transformWorldFromViewTL=I(),this.transformViewFromCameraRelativeRS=bt(),this.transformProjFromView=fr()}},ma=class extends Qe{constructor(){super(...arguments),this.transformWorldFromModelRS=bt(),this.transformWorldFromModelTH=I(),this.transformWorldFromModelTL=I()}};function Si(e,t){switch(t.normalType){case Q.Attribute:case Q.Compressed:e.include(Bt,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new Ei("transformNormalGlobalFromModel",r=>r.transformNormalGlobalFromModel),new ue("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal)),e.vertex.code.add(s`void forwardNormal() { -vNormalWorld = transformNormalGlobalFromModel * normalModel(); -vNormalView = transformNormalViewFromGlobal * vNormalWorld; -}`);break;case Q.ScreenDerivative:e.vertex.code.add(s`void forwardNormal() {}`);break;default:zt(t.normalType);case Q.COUNT:}}let fa=class extends ha{constructor(){super(...arguments),this.transformNormalViewFromGlobal=bt()}},pa=class extends ma{constructor(){super(...arguments),this.transformNormalGlobalFromModel=bt(),this.toMapSpace=Ht()}};const Ai=new Map([[p.POSITION,0],[p.NORMAL,1],[p.NORMALCOMPRESSED,1],[p.UV0,2],[p.COLOR,3],[p.COLORFEATUREATTRIBUTE,3],[p.SIZE,4],[p.TANGENT,4],[p.CENTEROFFSETANDDISTANCE,5],[p.SYMBOLCOLOR,5],[p.FEATUREATTRIBUTE,6],[p.INSTANCEFEATUREATTRIBUTE,6],[p.INSTANCECOLOR,7],[p.OBJECTANDLAYERIDCOLOR,7],[p.INSTANCEOBJECTANDLAYERIDCOLOR,7],[p.ROTATION,8],[p.INSTANCEMODEL,8],[p.INSTANCEMODELNORMAL,12],[p.INSTANCEMODELORIGINHI,11],[p.INSTANCEMODELORIGINLO,15]]);let Ci=class{constructor(){this.id=To()}},va=class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=I(),this._tmpMbs=gi(),this._tmpObb=new ea,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=xe(e)}applyToVertex(e,t,r){const i=Y(wi,e,t,r),o=Y(_a,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/xe(o);return He(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],l=e[5]+t,c=Math.abs(r),u=Math.abs(i),d=Math.abs(o),h=Math.abs(a),v=Math.abs(n),f=Math.abs(l),T=.5*(1+Math.sign(r*a))*Math.min(c,h),_=.5*(1+Math.sign(i*n))*Math.min(u,v),x=.5*(1+Math.sign(o*l))*Math.min(d,f),V=Math.max(c,h),D=Math.max(u,v),B=Math.max(d,f),P=Math.sqrt(T*T+_*_+x*x),G=Math.sign(c+r),w=Math.sign(u+i),S=Math.sign(d+o),E=Math.sign(h+a),M=Math.sign(v+n),O=Math.sign(f+l),g=this._totalOffset;if(P{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=Vo()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(t?.glName==null){const i=this._textures.get(e);return i&&(this._context.bindTexture(null,i.unit),this._freeTextureUnit(i),this._textures.delete(e)),null}let r=this._textures.get(e);return r==null?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)}),this._fragmentUniforms?.forEach(e=>{e.type!=="sampler2D"&&e.type!=="samplerCube"||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)})}_allocTextureUnit(e){return{texture:e,unit:this._freeTextureUnits.length===0?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}},vr=class{constructor(e,t,r,i,o=Ai){this.release=i,this.locations=o,this.primitiveType=zo.TRIANGLES,this.key=t.key,this._program=new Hr(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t),this.reload=async a=>{if(a&&await r.reload(),!this.key.equals(t.key))throw new Error("Configuration was changed after construction, cannot reload shader");Rt(this._program),this._program=new Hr(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=Rt(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return Gt({blending:Xo,colorWrite:Vt})}};var vt;(function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"})(vt||(vt={}));let Ca=class extends Ci{constructor(e,t){super(),this.type=vt.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=Ai,this._pp0=It(0,0,1),this._pp1=It(0,0,0),this._parameters=new t,Vr(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){Vr(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&!!(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}intersectDraped(e,t,r,i,o,a){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}};var ir;(function(e){e[e.None=0]="None",e[e.Occlude=1]="Occlude",e[e.Transparent=2]="Transparent",e[e.OccludeAndTransparent=4]="OccludeAndTransparent",e[e.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",e[e.Opaque=16]="Opaque"})(ir||(ir={}));var k;(function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"})(k||(k={}));const yi=Yo(At.ONE,At.ZERO,At.ONE,At.ONE_MINUS_SRC_ALPHA);function ql(e){return e===k.FrontFace?null:yi}function wa(e){switch(e){case k.NONE:return Zo;case k.ColorAlpha:return yi;case k.FrontFace:case k.COUNT:return null}}function Ma(e){if(e.draped)return null;switch(e.oitPass){case k.NONE:case k.FrontFace:return e.writeDepth?Ko:null;case k.ColorAlpha:case k.COUNT:return null}}const Oa=5e5,ya={factor:-1,units:-2};function Ra(e){return e?ya:null}function Ia(e,t=de.LESS){return e===k.NONE||e===k.FrontFace?t:de.LEQUAL}function La(e,t){const r=vi(t);return e===k.ColorAlpha?r?{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1,ye.COLOR_ATTACHMENT2]}:{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1]}:r?{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1]}:null}de.LESS,de.ALWAYS;const Na={mask:255},Pa={function:{func:de.ALWAYS,ref:ve.OutlineVisualElementMask,mask:ve.OutlineVisualElementMask},operation:{fail:ae.KEEP,zFail:ae.KEEP,zPass:ae.ZERO}},Da={function:{func:de.ALWAYS,ref:ve.OutlineVisualElementMask,mask:ve.OutlineVisualElementMask},operation:{fail:ae.KEEP,zFail:ae.KEEP,zPass:ae.REPLACE}};de.EQUAL,ve.OutlineVisualElementMask,ve.OutlineVisualElementMask,ae.KEEP,ae.KEEP,ae.KEEP,de.NOTEQUAL,ve.OutlineVisualElementMask,ve.OutlineVisualElementMask,ae.KEEP,ae.KEEP,ae.KEEP;function kl({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return e==null&&t==null&&o==null&&(a==null||fi(a,Ke))&&n==null&&(i==null||i===1)&&(r==null||r===1)}const Fa=ut(1,1,.5),Yl=ut(0,.6,.2),Xl=ut(0,1,.2);let Ze=class extends J{constructor(e,t){super(e,"vec2",R.Pass,(r,i,o)=>r.setUniform2fv(e,t(i,o)))}};function Ur(e){e.varyings.add("linearDepth","float")}function Ri(e){e.vertex.uniforms.add(new Ze("nearFar",(t,r)=>r.camera.nearFar))}function Ii(e){e.vertex.code.add(s`float calculateLinearDepth(vec2 nearFar,float z) { -return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]); -}`)}function Li(e,t){const{vertex:r}=e;switch(t.output){case F.Color:case F.ColorEmission:if(t.receiveShadows)return Ur(e),void r.code.add(s`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:return e.include(ua,t),Ur(e),Ri(e),Ii(e),void r.code.add(s`void forwardLinearDepth() { -linearDepth = calculateLinearDepth(nearFar, vPosition_view.z); -}`)}r.code.add(s`void forwardLinearDepth() {}`)}function Ni(e){e.vertex.code.add(s`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) { -vec3 camToVert = posWorld - camPosWorld; -bool isBackface = dot(camToVert, normalWorld) > 0.0; -if (isBackface) { -posClip.z += 0.0000003 * posClip.w; -} -return posClip; -}`)}function Ue(e,t){Ba(e,t,new le("slicePlaneOrigin",(r,i)=>za(t,r,i)),new le("slicePlaneBasis1",(r,i)=>Wr(t,r,i,i.slicePlane?.basis1)),new le("slicePlaneBasis2",(r,i)=>Wr(t,r,i,i.slicePlane?.basis2)))}function Ba(e,t,...r){if(!t.hasSlicePlane){const n=s`#define rejectBySlice(_pos_) false -#define discardBySlice(_pos_) {} -#define highlightSlice(_color_, _pos_) (_color_)`;return t.hasSliceInVertexProgram&&e.vertex.code.add(n),void e.fragment.code.add(n)}const i=s`struct SliceFactors { -float front; -float side0; -float side1; -float side2; -float side3; -}; -SliceFactors calculateSliceFactors(vec3 pos) { -vec3 rel = pos - slicePlaneOrigin; -vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2); -float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin); -float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1); -float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2); -float basis1Dot = dot(slicePlaneBasis1, rel); -float basis2Dot = dot(slicePlaneBasis2, rel); -return SliceFactors( -dot(slicePlaneNormal, pos) + slicePlaneW, --basis1Dot - basis1Len2, -basis1Dot - basis1Len2, --basis2Dot - basis2Len2, -basis2Dot - basis2Len2 -); -} -bool sliceByFactors(SliceFactors factors) { -return factors.front < 0.0 -&& factors.side0 < 0.0 -&& factors.side1 < 0.0 -&& factors.side2 < 0.0 -&& factors.side3 < 0.0; -} -bool sliceEnabled() { -return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0; -} -bool sliceByPlane(vec3 pos) { -return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos)); -} -#define rejectBySlice(_pos_) sliceByPlane(_pos_) -#define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,o=s`vec4 applySliceHighlight(vec4 color, vec3 pos) { -SliceFactors factors = calculateSliceFactors(pos); -const float HIGHLIGHT_WIDTH = 1.0; -const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3); -factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front); -factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0); -factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1); -factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2); -factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3); -if (sliceByFactors(factors)) { -return color; -} -float highlightFactor = (1.0 - step(0.5, factors.front)) -* (1.0 - step(0.5, factors.side0)) -* (1.0 - step(0.5, factors.side1)) -* (1.0 - step(0.5, factors.side2)) -* (1.0 - step(0.5, factors.side3)); -return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a); -}`,a=t.hasSliceHighlight?s` - ${o} - #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_)) - `:s`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.uniforms.add(...r).code.add(i),e.fragment.uniforms.add(...r).code.add(i),e.fragment.code.add(a)}function Pi(e,t,r){return e.instancedDoublePrecision?Y(Ga,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function Di(e,t){return e!=null?nt(Lt,t.origin,e):t.origin}function Fi(e,t,r){return e.hasSliceTranslatedView?t!=null?rr(Va,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function za(e,t,r){if(r.slicePlane==null)return Ke;const i=Pi(e,t,r),o=Di(i,r.slicePlane),a=Fi(e,i,r);return a!=null?mt(Lt,o,a):o}function Wr(e,t,r,i){if(i==null||r.slicePlane==null)return Ke;const o=Pi(e,t,r),a=Di(o,r.slicePlane),n=Fi(e,o,r);return n!=null?(Uo(tt,i,a),mt(Lt,a,n),mt(tt,tt,n),nt(tt,tt,Lt)):i}const Ga=I(),Lt=I(),tt=I(),Va=fr();function We(e){Ii(e),e.vertex.code.add(s`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) { -vec4 eye = view * vec4(pos, 1.0); -depth = calculateLinearDepth(nearFar,eye.z); -return proj * eye; -}`),e.vertex.code.add(s`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) { -return proj * (view * vec4(pos, 1.0)); -}`)}let Ha=class extends J{constructor(e,t){super(e,"mat4",R.Draw,(r,i,o)=>r.setUniformMatrix4fv(e,t(i,o)))}};function gt(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",Ke):e.uniforms.add(new le("cameraPosition",(r,i)=>Y(Bi,i.camera.viewInverseTransposeMatrix[3]-r.origin[0],i.camera.viewInverseTransposeMatrix[7]-r.origin[1],i.camera.viewInverseTransposeMatrix[11]-r.origin[2])))}function je(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new Xe("proj",(i,o)=>o.camera.projectionMatrix),new Ha("view",(i,o)=>rr(jr,o.camera.viewMatrix,i.origin)),new le("localOrigin",i=>i.origin));const r=i=>Y(Bi,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new Xe("proj",(i,o)=>o.camera.projectionMatrix),new Xe("view",(i,o)=>rr(jr,o.camera.viewMatrix,r(o))),new q("localOrigin",(i,o)=>r(o)))}const jr=fr(),Bi=I();function Ua(e){e.uniforms.add(new Xe("viewNormal",(t,r)=>r.camera.viewInverseTransposeMatrix))}function Jl(e){e.uniforms.add(new ie("pixelRatio",(t,r)=>r.camera.pixelRatio/r.overlayStretch))}const $r=bt();function zi(e,t){const r=t.hasModelTransformation,i=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new Xe("model",a=>a.modelTransformation??Fr)),e.vertex.uniforms.add(new ue("normalLocalOriginFromModel",a=>(Qo($r,a.modelTransformation??Fr),$r)))),t.instanced&&i&&(e.attributes.add(p.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(p.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(p.INSTANCEMODEL,"mat3"),e.attributes.add(p.INSTANCEMODELNORMAL,"mat3"));const o=e.vertex;i&&(o.include(bi,t),o.uniforms.add(new le("viewOriginHi",(a,n)=>na(Y(Ct,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),Ct)),new le("viewOriginLo",(a,n)=>sa(Y(Ct,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),Ct)))),o.code.add(s` - vec3 getVertexInLocalOriginSpace() { - return ${r?i?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":i?"instanceModel * localPosition().xyz":"localPosition().xyz"}; - } - - vec3 subtractOrigin(vec3 _pos) { - ${i?s` - // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped - // working for macOS 14+ and iOS 17+. - // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280 - vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo); - return _pos - originDelta;`:"return vpos;"} - } - `),o.code.add(s` - vec3 dpNormal(vec4 _normal) { - return normalize(${r?i?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":i?"instanceModelNormal * _normal.xyz":"_normal.xyz"}); - } - `),t.output===F.Normal&&(Ua(o),o.code.add(s` - vec3 dpNormalView(vec4 _normal) { - return normalize((viewNormal * ${r?i?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":i?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz); - } - `)),t.hasVertexTangents&&o.code.add(s` - vec4 dpTransformVertexTangent(vec4 _tangent) { - ${r?i?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":i?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"} - }`)}const Ct=I();let gr=class extends J{constructor(e,t){super(e,"int",R.Pass,(r,i,o)=>r.setUniform1i(e,t(i,o)))}};function Gi(e,t){t.hasSymbolColors?(e.include(ca),e.attributes.add(p.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(s`int symbolColorMixMode; -vec4 getSymbolColor() { -return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; -} -void forwardColorMixMode() { -colorMixMode = float(symbolColorMixMode) + 0.5; -}`)):(e.fragment.uniforms.add(new gr("colorMixMode",r=>Aa[r.colorMixMode])),e.vertex.code.add(s`vec4 getSymbolColor() { return vec4(1.0); } -void forwardColorMixMode() {}`))}var K;function Ne(e,t){switch(t.textureCoordinateType){case K.Default:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(s`void forwardTextureCoordinates() { -vuv0 = uv0; -}`);case K.Compressed:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(s`vec2 getUV0() { -return uv0 / 16384.0; -} -void forwardTextureCoordinates() { -vuv0 = getUV0(); -}`);case K.Atlas:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(p.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(s`void forwardTextureCoordinates() { -vuv0 = uv0; -vuvRegion = uvRegion; -}`);default:zt(t.textureCoordinateType);case K.None:return void e.vertex.code.add(s`void forwardTextureCoordinates() {}`);case K.COUNT:return}}(function(e){e[e.None=0]="None",e[e.Default=1]="Default",e[e.Atlas=2]="Atlas",e[e.Compressed=3]="Compressed",e[e.COUNT=4]="COUNT"})(K||(K={}));function Vi(e,t){t.hasVertexColors?(e.attributes.add(p.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(s`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(s`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(s`void forwardVertexColor() {} -void forwardNormalizedVertexColor() {}`)}function Wa(e){e.vertex.code.add(s`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) { -return absCosAngle * absCosAngle * absCosAngle; -}`),e.vertex.code.add(s`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) { -return vec3( -min(params.x / (distanceToCamera - params.y), 1.0), -screenSizePerspectiveViewAngleDependentFactor(absCosAngle), -params.z -); -}`),e.vertex.code.add(s`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) { -return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); -}`),e.vertex.code.add(s`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) { -return applyScreenSizePerspectiveScaleFactorFloat( -size, -screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params) -); -}`),e.vertex.code.add(s`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) { -return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); -}`),e.vertex.code.add(s`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) { -return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)); -}`)}function Zl(e){e.uniforms.add(new q("screenSizePerspective",t=>Hi(t.screenSizePerspective)))}function ja(e){e.uniforms.add(new q("screenSizePerspectiveAlignment",t=>Hi(t.screenSizePerspectiveAlignment||t.screenSizePerspective)))}function Hi(e){return Y($a,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const $a=I();let te=class extends J{constructor(e,t){super(e,"vec4",R.Pass,(r,i,o)=>r.setUniform4fv(e,t(i,o)))}};function Ui(e,t){const r=e.vertex;t.hasVerticalOffset?(ka(r),t.hasScreenSizePerspective&&(e.include(Wa),ja(r),gt(e.vertex,t)),r.code.add(s` - vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) { - float viewDistance = length((view * vec4(worldPos, 1.0)).xyz); - ${t.spherical?s`vec3 worldNormal = normalize(worldPos + localOrigin);`:s`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`} - ${t.hasScreenSizePerspective?s` - float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition)); - float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:s` - float verticalOffsetScreenHeight = verticalOffset.x;`} - // Screen sized offset in world space, used for example for line callouts - float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w); - return worldNormal * worldOffset; - } - - vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { - return worldPos + calculateVerticalOffset(worldPos, localOrigin); - } - `)):r.code.add(s`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const qa=Ht();function ka(e){e.uniforms.add(new te("verticalOffset",(t,r)=>{const{minWorldLength:i,maxWorldLength:o,screenLength:a}=t.verticalOffset,n=Math.tan(.5*r.camera.fovY)/(.5*r.camera.fullViewport[3]),l=r.camera.pixelRatio||1;return oe(qa,a*l,n,i,o)}))}function Ya(e,t){if(t.output!==F.ObjectAndLayerIdColor)return e.vertex.code.add(s`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(s`void outputObjectAndLayerIdColor() {}`);const r=t.objectAndLayerIdColorInstanced;e.varyings.add("objectAndLayerIdColorVarying","vec4"),e.attributes.add(r?p.INSTANCEOBJECTANDLAYERIDCOLOR:p.OBJECTANDLAYERIDCOLOR,"vec4"),e.vertex.code.add(s` - void forwardObjectAndLayerIdColor() { - objectAndLayerIdColorVarying = ${r?"instanceObjectAndLayerIdColor":"objectAndLayerIdColor"} * 0.003921568627451; - }`),e.fragment.code.add(s`void outputObjectAndLayerIdColor() { -fragColor = objectAndLayerIdColorVarying; -}`)}function Wi(e){e.code.add(s`const float MAX_RGBA4_FLOAT = -15.0 / 16.0 + -15.0 / 16.0 / 16.0 + -15.0 / 16.0 / 16.0 / 16.0 + -15.0 / 16.0 / 16.0 / 16.0 / 16.0; -const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0); -vec4 floatToRgba4(const float value) { -float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT); -vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0); -const float toU4AsFloat = 1.0 / 15.0; -return fixedPointU4 * toU4AsFloat; -} -const vec4 RGBA4_2_FLOAT_FACTORS = vec4( -15.0 / (16.0), -15.0 / (16.0 * 16.0), -15.0 / (16.0 * 16.0 * 16.0), -15.0 / (16.0 * 16.0 * 16.0 * 16.0) -); -float rgba4ToFloat(vec4 rgba) { -return dot(rgba, RGBA4_2_FLOAT_FACTORS); -}`)}function Xa(e,t){switch(t.output){case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:e.fragment.include(Wi),e.fragment.code.add(s`float _calculateFragDepth(const in float depth) { -const float SLOPE_SCALE = 2.0; -const float BIAS = 20.0 * .000015259; -float m = max(abs(dFdx(depth)), abs(dFdy(depth))); -return depth + SLOPE_SCALE * m + BIAS; -} -void outputDepth(float _linearDepth) { -fragColor = floatToRgba4(_calculateFragDepth(_linearDepth)); -}`)}}let Ja=class extends J{constructor(e,t){super(e,"ivec2",R.Pass,(r,i,o)=>r.setUniform2iv(e,t(i,o)))}},X=class extends J{constructor(e,t){super(e,"sampler2D",R.Pass,(r,i,o)=>r.bindTexture(e,t(i,o)))}};function ji(e,t){const{fragment:r}=e;t.output===F.Highlight?(r.uniforms.add(new X("depthTexture",(i,o)=>o.mainDepth),new X("highlightTexture",(i,o)=>o.highlightMixTexture),new gr("highlightLevel",(i,o)=>o.highlightLevel),new Ja("highlightMixOrigin",(i,o)=>o.highlightMixOrigin)),e.outputs.add("fragHighlight","vec2",0),r.code.add(s`vec2 getAccumulatedHighlight() { -return texelFetch(highlightTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg; -} -void outputHighlight(bool occluded) { -if (highlightLevel == 0) { -uint bits = occluded ? 3u : 1u; -fragHighlight = vec2(float(bits) / 255.0, 0.0); -} else { -int ll = (highlightLevel & 3) << 1; -int li = (highlightLevel >> 2) & 3; -uint bits; -if (occluded) { -bits = 3u << ll; -} else { -bits = 1u << ll; -} -vec2 combinedHighlight = getAccumulatedHighlight(); -uint accumulatedI = uint(combinedHighlight[li] * 255.0); -combinedHighlight[li] = float(bits | accumulatedI) / 255.0; -fragHighlight = combinedHighlight; -} -} -bool isHighlightOccluded() { -float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x; -return gl_FragCoord.z > sceneDepth + 5e-7; -} -void calculateOcclusionAndOutputHighlight() { -outputHighlight(isHighlightOccluded()); -}`),t.canHaveOverlay&&(r.constants.add("occlusionAndMask","int",85),r.code.add(s`void outputAllHighlights(vec2 highlightToAdd) { -if (highlightToAdd == vec2(0.0)) { discard; } -int occludedOrMask = isHighlightOccluded() ? 0xaa : 0; -ivec2 added = ivec2(highlightToAdd * 255.0); -ivec2 masked = (added & ivec2(occlusionAndMask)) | (ivec2(occludedOrMask) & (added<<1)); -fragHighlight = vec2(masked) / 255.0; -}`))):r.code.add(s`void calculateOcclusionAndOutputHighlight() {}`)}let Za=class extends J{constructor(e,t,r){super(e,"vec4",R.Pass,(i,o,a)=>i.setUniform4fv(e,t(o,a)),r)}},Ka=class extends J{constructor(e,t,r){super(e,"float",R.Pass,(i,o,a)=>i.setUniform1fv(e,t(o,a)),r)}};var qr,kr;(function(e){e[e.Undefined=0]="Undefined",e[e.DefinedSize=1]="DefinedSize",e[e.DefinedScale=2]="DefinedScale"})(qr||(qr={})),function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(kr||(kr={}));function Kl(e,t,r){if(!t.vvSize)return Y(e,1,1,1),e;for(let i=0;i<3;++i){const o=t.vvSize.offset[i]+r[0]*t.vvSize.factor[i];e[i]=hr(o,t.vvSize.minSize[i],t.vvSize.maxSize[i])}return e}const Xt=8;function lt(e,t){const{vertex:r,attributes:i}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&i.add(p.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new q("vvSizeMinSize",o=>o.vvSize.minSize)),r.uniforms.add(new q("vvSizeMaxSize",o=>o.vvSize.maxSize)),r.uniforms.add(new q("vvSizeOffset",o=>o.vvSize.offset)),r.uniforms.add(new q("vvSizeFactor",o=>o.vvSize.factor)),r.uniforms.add(new ue("vvSymbolRotationMatrix",o=>o.vvSymbolRotationMatrix)),r.uniforms.add(new q("vvSymbolAnchor",o=>o.vvSymbolAnchor)),r.code.add(s`vec3 vvScale(vec4 _featureAttribute) { -return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize); -} -vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) { -return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0); -}`),r.code.add(s` - const float eps = 1.192092896e-07; - vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) { - vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize); - return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0); - } - - ${t.hasVvInstancing?s` - vec4 vvLocalNormal(vec3 _normal) { - return vvTransformNormal(_normal, instanceFeatureAttribute); - } - - vec4 localPosition() { - return vvTransformPosition(position, instanceFeatureAttribute); - }`:""} - `)):r.code.add(s`vec4 localPosition() { return vec4(position, 1.0); } -vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",Xt),r.uniforms.add(new Ka("vvColorValues",o=>o.vvColor.values,Xt),new Za("vvColorColors",o=>o.vvColor.colors,Xt)),r.code.add(s` - vec4 interpolateVVColor(float value) { - if (value <= vvColorValues[0]) { - return vvColorColors[0]; - } - - for (int i = 1; i < vvColorNumber; ++i) { - if (vvColorValues[i] >= value) { - float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); - return mix(vvColorColors[i-1], vvColorColors[i], f); - } - } - return vvColorColors[vvColorNumber - 1]; - } - - vec4 vvGetColor(vec4 featureAttribute) { - return interpolateVVColor(featureAttribute.y); - } - - ${t.hasVvInstancing?s` - vec4 vvColor() { - return vvGetColor(instanceFeatureAttribute); - }`:"vec4 vvColor() { return vec4(1.0); }"} - `)):r.code.add(s`vec4 vvColor() { return vec4(1.0); }`)}function $e(e,t){Qa(e,t,new ie("textureAlphaCutoff",r=>r.textureAlphaCutoff))}function Qa(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode){case ge.Blend:e.fragment.code.add(s` - #define discardOrAdjustAlpha(color) { if (color.a < ${s.float(be)}) { discard; } } - `);break;case ge.Opaque:i.code.add(s`void discardOrAdjustAlpha(inout vec4 color) { -color.a = 1.0; -}`);break;case ge.Mask:i.uniforms.add(r).code.add(s`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case ge.MaskBlend:i.uniforms.add(r).code.add(s`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}function $i(e,t){const{vertex:r,fragment:i}=e,o=t.hasColorTexture&&t.alphaDiscardMode!==ge.Opaque,{output:a,normalType:n,hasColorTextureTransform:l}=t;switch(a){case F.Depth:je(r,t),e.include(We,t),e.include(Ue,t),e.include(Ne,t),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); -vpos = subtractOrigin(vpos); -vpos = addVerticalOffset(vpos, localOrigin); -gl_Position = transformPosition(proj, view, vpos); -forwardTextureCoordinates();`),e.include($e,t),i.main.add(s` - discardBySlice(vpos); - ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); - discardOrAdjustAlpha(texColor);`)}`);break;case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:case F.ObjectAndLayerIdColor:je(r,t),e.include(We,t),e.include(Ne,t),e.include(lt,t),e.include(Xa,t),e.include(Ue,t),e.include(Ya,t),Ri(e),e.varyings.add("depth","float"),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); -vpos = subtractOrigin(vpos); -vpos = addVerticalOffset(vpos, localOrigin); -gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); -forwardTextureCoordinates(); -forwardObjectAndLayerIdColor();`),e.include($e,t),i.main.add(s` - discardBySlice(vpos); - ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); - discardOrAdjustAlpha(texColor);`)} - ${a===F.ObjectAndLayerIdColor?s`outputObjectAndLayerIdColor();`:s`outputDepth(depth);`}`);break;case F.Normal:{je(r,t),e.include(We,t),e.include(Bt,t),e.include(Si,t),e.include(Ne,t),e.include(lt,t),o&&i.uniforms.add(new X("tex",u=>u.texture)),n===Q.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const c=n===Q.Attribute||n===Q.Compressed;r.main.add(s` - vpos = getVertexInLocalOriginSpace(); - ${c?s`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:s`vPositionView = (view * vec4(vpos, 1.0)).xyz;`} - vpos = subtractOrigin(vpos); - vpos = addVerticalOffset(vpos, localOrigin); - gl_Position = transformPosition(proj, view, vpos); - forwardTextureCoordinates();`),e.include(Ue,t),e.include($e,t),i.main.add(s` - discardBySlice(vpos); - ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); - discardOrAdjustAlpha(texColor);`)} - - ${n===Q.ScreenDerivative?s`vec3 normal = screenDerivativeNormal(vPositionView);`:s`vec3 normal = normalize(vNormalWorld); - if (gl_FrontFacing == false){ - normal = -normal; - }`} - fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case F.Highlight:je(r,t),e.include(We,t),e.include(Ne,t),e.include(lt,t),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); -vpos = subtractOrigin(vpos); -vpos = addVerticalOffset(vpos, localOrigin); -gl_Position = transformPosition(proj, view, vpos); -forwardTextureCoordinates();`),e.include(Ue,t),e.include($e,t),e.include(ji,t),i.main.add(s` - discardBySlice(vpos); - ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); - discardOrAdjustAlpha(texColor);`)} - calculateOcclusionAndOutputHighlight();`)}}function en(e){e.fragment.code.add(s`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) { -vec2 atlasScale = atlasRegion.zw - atlasRegion.xy; -vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy; -float maxdUV = 0.125; -vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale; -vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale; -return textureGrad(tex, uvAtlas, dUVdx, dUVdy); -}`)}function xr(e,t){const{textureCoordinateType:r}=t;if(r===K.None||r===K.COUNT)return;e.include(Ne,t);const i=r===K.Atlas;i&&e.include(en),e.fragment.code.add(s` - vec4 textureLookup(sampler2D tex, vec2 uv) { - return ${i?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"}; - } - `)}function tn(e,t){const r=e.fragment;switch(r.code.add(s`struct ShadingNormalParameters { -vec3 normalView; -vec3 viewDirection; -} shadingParams;`),t.doubleSidedMode){case re.None:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { -return normalize(params.normalView); -}`);break;case re.View:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { -return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView); -}`);break;case re.WindingOrder:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { -return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView); -}`);break;default:zt(t.doubleSidedMode);case re.COUNT:}}var re;(function(e){e[e.None=0]="None",e[e.View=1]="View",e[e.WindingOrder=2]="WindingOrder",e[e.COUNT=3]="COUNT"})(re||(re={}));function rn(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(p.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===re.WindingOrder?r.code.add(s`mat3 computeTangentSpace(vec3 normal) { -float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w; -vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz); -vec3 bitangent = cross(normal, tangent) * tangentHeadedness; -return mat3(tangent, bitangent, normal); -}`):r.code.add(s`mat3 computeTangentSpace(vec3 normal) { -float tangentHeadedness = vTangent.w; -vec3 tangent = normalize(vTangent.xyz); -vec3 bitangent = cross(normal, tangent) * tangentHeadedness; -return mat3(tangent, bitangent, normal); -}`)):r.code.add(s`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) { -vec3 Q1 = dFdx(pos); -vec3 Q2 = dFdy(pos); -vec2 stx = dFdx(st); -vec2 sty = dFdy(st); -float det = stx.t * sty.s - sty.t * stx.s; -vec3 T = stx.t * Q2 - sty.t * Q1; -T = T - normal * dot(normal, T); -T *= inversesqrt(max(dot(T,T), 1.e-10)); -vec3 B = sign(det) * cross(normal, T); -return mat3(T, B, normal); -}`),t.textureCoordinateType!==K.None&&(e.include(xr,t),r.uniforms.add(t.bindType===R.Pass?new X("normalTexture",i=>i.textureNormal):new pt("normalTexture",i=>i.textureNormal)),t.hasNormalTextureTransform&&(r.uniforms.add(new Ze("scale",i=>i.scale??la)),r.uniforms.add(new ue("normalTextureTransformMatrix",i=>i.normalTextureTransformMatrix??et))),r.code.add(s`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) { -vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),t.hasNormalTextureTransform&&r.code.add(s`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0, -normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0, -0.0, 0.0, 0.0 ); -rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(s`return tangentSpace * rawNormal; -}`))}var or,ct;(function(e){e.OPAQUE="opaque-color",e.TRANSPARENT="transparent-color",e.COMPOSITE="composite-color",e.FINAL="final-color"})(or||(or={})),function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color"}(ct||(ct={}));var qe,Yr;(function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"})(qe||(qe={})),function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(Yr||(Yr={}));let Ge=class extends li{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=or.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([ci(()=>this.view.ready,e=>{e&&this.view._stage?.renderer.addRenderNode(this)},xo)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Te("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view._stage.renderView.renderingContext.gl}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view._stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===Qt.UPDATE&&this.view._stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view._stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view._stage.renderView.renderingContext}get renderContext(){return this.view._stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:t})=>t===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};m([z({constructOnly:!0})],Ge.prototype,"view",void 0),m([z({constructOnly:!0})],Ge.prototype,"consumes",void 0),m([z()],Ge.prototype,"produces",void 0),Ge=m([ur("esri.views.3d.webgl.RenderNode")],Ge);const on=Ge,an=3e5,Xr=5e5;function qi(e,t=!0){e.attributes.add(p.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(s` - gl_Position = vec4(position, 0.0, 1.0); - ${t?s`uv = position * 0.5 + vec2(0.5);`:""} - `)}function _r(e){e.uniforms.add(new Ze("zProjectionMap",(t,r)=>nn(r.camera))),e.code.add(s`float linearizeDepth(float depth) { -float depthNdc = depth * 2.0 - 1.0; -float c1 = zProjectionMap[0]; -float c2 = zProjectionMap[1]; -return -(c1 / (depthNdc + c2 + 1e-7)); -}`),e.code.add(s`float depthFromTexture(sampler2D depthTexture, vec2 uv) { -ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0))); -float depth = texelFetch(depthTexture, iuv, 0).r; -return depth; -}`),e.code.add(s`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) { -return linearizeDepth(depthFromTexture(depthTexture, uv)); -}`)}function nn(e){const t=e.projectionMatrix;return Pe(sn,t[14],t[10])}const sn=Ut();let ln=class extends J{constructor(e,t){super(e,"vec2",R.Draw,(r,i,o,a)=>r.setUniform2fv(e,t(i,o,a)))}};const cn=()=>hi.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let ki=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},jt=class extends ki{constructor(){super(...arguments),this.vertex=new Jr,this.fragment=new Jr,this.attributes=new mn,this.varyings=new fn,this.extensions=new ar,this.outputs=new sr}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o=e==="vertex"?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),l=o.main.generateSource(),c=e==="vertex"?gn:vn,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es -${t.join(` -`)} - -${c} - -${u.join(` -`)} - -${a.join(` -`)} - -${r.join(` -`)} - -${i.join(` -`)} - -${d.join(` -`)} - -${n.join(` -`)} - -${l.join(` -`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(o=>{const a=o.bind[R.Pass];a&&t.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[R.Pass];a&&t.set(o.name,a)});const r=Array.from(t.values()),i=r.length;return(o,a)=>{for(let n=0;n{const a=o.bind[R.Draw];a&&t.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[R.Draw];a&&t.set(o.name,a)});const r=Array.from(t.values()),i=r.length;return(o,a,n)=>{for(let l=0;le.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},un=class{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(){if(this._bodies.length>0)return[`void main() { - ${this._bodies.join(` -`)||""} -}`];throw new Te("Shader does not contain main function body.")}},hn=class{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}},Jr=class extends ki{constructor(){super(...arguments),this.uniforms=new dn(this),this.main=new un(this),this.code=new hn(this),this.constants=new pn(this)}get builder(){return this}},mn=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},fn=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&W(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push(e==="vertex"?`out ${r} ${i};`:`in ${r} ${i};`)),t}},ar=class nr{constructor(){this._entries=new Set}add(t){this._entries.add(t)}generateSource(t){const r=t==="vertex"?nr.ALLOWLIST_VERTEX:nr.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>r.includes(i)).map(i=>`#extension ${i} : enable`)}};ar.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],ar.ALLOWLIST_VERTEX=[];let sr=class lr{constructor(){this._entries=new Map}add(t,r,i=0){const o=this._entries.get(i);o?W(o.name===t&&o.type===r,`Fragment shader output location ${i} occupied`):this._entries.set(i,{name:t,type:r})}generateSource(t){if(t==="vertex")return[];this._entries.size===0&&this._entries.set(0,{name:lr.DEFAULT_NAME,type:lr.DEFAULT_TYPE});const r=new Array;return this._entries.forEach((i,o)=>r.push(`layout(location = ${o}) out ${i.type} ${i.name};`)),r}};sr.DEFAULT_TYPE="vec4",sr.DEFAULT_NAME="fragColor";let pn=class j{constructor(t){this._stage=t,this._entries=new Set}add(t,r,i){let o="ERROR_CONSTRUCTOR_STRING";switch(r){case"float":o=j._numberToFloatStr(i);break;case"int":o=j._numberToIntStr(i);break;case"bool":o=i.toString();break;case"vec2":o=`vec2(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])})`;break;case"vec3":o=`vec3(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])}, ${j._numberToFloatStr(i[2])})`;break;case"vec4":o=`vec4(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])}, ${j._numberToFloatStr(i[2])}, ${j._numberToFloatStr(i[3])})`;break;case"ivec2":o=`ivec2(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])})`;break;case"ivec3":o=`ivec3(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])}, ${j._numberToIntStr(i[2])})`;break;case"ivec4":o=`ivec4(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])}, ${j._numberToIntStr(i[2])}, ${j._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":o=`${r}(${Array.prototype.map.call(i,a=>j._numberToFloatStr(a)).join(", ")})`}return this._entries.add(`const ${r} ${t} = ${o};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}};const vn=`#ifdef GL_FRAGMENT_PRECISION_HIGH - precision highp float; - precision highp sampler2D; -#else - precision mediump float; - precision mediump sampler2D; -#endif`,gn=`precision highp float; -precision highp sampler2D;`,Jt=4;function xn(){const e=new jt,t=e.fragment;e.include(qi);const r=(Jt+1)/2,i=1/(2*r*r);return t.include(_r),t.uniforms.add(new X("depthMap",o=>o.depthTexture),new pt("tex",o=>o.colorTexture),new ln("blurSize",o=>o.blurSize),new ie("projScale",(o,a)=>{const n=a.camera.distance;return n>5e4?Math.max(0,o.projScale-(n-5e4)):o.projScale})),t.code.add(s` - void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) { - float c = texture(tex, uv).r; - float d = linearDepthFromTexture(depthMap, uv); - - float ddiff = d - center_d; - - float w = exp(-r * r * ${s.float(i)} - ddiff * ddiff * sharpness); - wTotal += w; - bTotal += w * c; - } - `),e.outputs.add("fragBlur","float"),t.main.add(s` - float b = 0.0; - float w_total = 0.0; - - float center_d = linearDepthFromTexture(depthMap, uv); - - float sharpness = -0.05 * projScale / center_d; - for (int r = -${s.int(Jt)}; r <= ${s.int(Jt)}; ++r) { - float rf = float(r); - vec2 uvOffset = uv + rf * blurSize; - blurFunction(uvOffset, rf, center_d, sharpness, w_total, b); - } - fragBlur = b / w_total;`),e}const _n=Object.freeze(Object.defineProperty({__proto__:null,build:xn},Symbol.toStringTag,{value:"Module"}));let Zr=class extends vr{constructor(e,t,r){super(e,t,new Wt(_n,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-LuDZJbYW.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url).then(i=>i.S)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const Tn="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";let bn=class extends Qe{constructor(){super(...arguments),this.projScale=1}},En=class extends bn{constructor(){super(...arguments),this.intensity=1}},Sn=class extends Qe{},An=class extends Sn{constructor(){super(...arguments),this.blurSize=Ut()}};function Cn(e){e.fragment.uniforms.add(new te("projInfo",(t,r)=>wn(r.camera))),e.fragment.uniforms.add(new Ze("zScale",(t,r)=>Mn(r.camera))),e.fragment.code.add(s`vec3 reconstructPosition(vec2 fragCoord, float depth) { -return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); -}`)}function wn(e){const t=e.projectionMatrix;return t[11]===0?oe(Kr,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):oe(Kr,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}const Kr=Ht();function Mn(e){return e.projectionMatrix[11]===0?Pe(Qr,0,1):Pe(Qr,1,0)}const Qr=Ut(),ei=16;function On(){const e=new jt,t=e.fragment;return e.include(qi),e.include(Cn),t.include(_r),t.uniforms.add(new ie("radius",(r,i)=>Tr(i.camera))).code.add(s`vec3 sphere[16] = vec3[16]( -vec3(0.186937, 0.0, 0.0), -vec3(0.700542, 0.0, 0.0), -vec3(-0.864858, -0.481795, -0.111713), -vec3(-0.624773, 0.102853, -0.730153), -vec3(-0.387172, 0.260319, 0.007229), -vec3(-0.222367, -0.642631, -0.707697), -vec3(-0.01336, -0.014956, 0.169662), -vec3(0.122575, 0.1544, -0.456944), -vec3(-0.177141, 0.85997, -0.42346), -vec3(-0.131631, 0.814545, 0.524355), -vec3(-0.779469, 0.007991, 0.624833), -vec3(0.308092, 0.209288,0.35969), -vec3(0.359331, -0.184533, -0.377458), -vec3(0.192633, -0.482999, -0.065284), -vec3(0.233538, 0.293706, -0.055139), -vec3(0.417709, -0.386701, 0.442449) -); -float fallOffFunction(float vv, float vn, float bias) { -float f = max(radius * radius - vv, 0.0); -return f * f * f * max(vn - bias, 0.0); -}`),t.code.add(s`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) { -vec3 v = Q - C; -float vv = dot(v, v); -float vn = dot(normalize(v), n_C); -return fallOffFunction(vv, vn, 0.1); -}`),t.uniforms.add(new X("normalMap",r=>r.normalTexture),new X("depthMap",r=>r.depthTexture),new ie("projScale",r=>r.projScale),new X("rnm",r=>r.noiseTexture),new Ze("rnmScale",(r,i)=>Pe(ti,i.camera.fullWidth/r.noiseTexture.descriptor.width,i.camera.fullHeight/r.noiseTexture.descriptor.height)),new ie("intensity",r=>r.intensity),new Ze("screenSize",(r,i)=>Pe(ti,i.camera.fullWidth,i.camera.fullHeight))),e.outputs.add("fragOcclusion","float"),t.main.add(s` - float depth = depthFromTexture(depthMap, uv); - - // Early out if depth is out of range, such as in the sky - if (depth >= 1.0 || depth <= 0.0) { - fragOcclusion = 1.0; - return; - } - - // get the normal of current fragment - vec4 norm4 = texture(normalMap, uv); - if(norm4.a != 1.0) { - fragOcclusion = 1.0; - return; - } - vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz; - - float currentPixelDepth = linearizeDepth(depth); - vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth); - - float sum = 0.0; - vec3 tapPixelPos; - - vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0); - - // note: the factor 2.0 should not be necessary, but makes ssao much nicer. - // bug or deviation from CE somewhere else? - float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y); - - for(int i = 0; i < ${s.int(ei)}; ++i) { - vec2 unitOffset = reflect(sphere[i], fres).xy; - vec2 offset = vec2(-unitOffset * radius * ps); - - // don't use current or very nearby samples - if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){ - continue; - } - - vec2 tc = vec2(gl_FragCoord.xy + offset); - if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue; - vec2 tcTap = tc / screenSize; - float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap); - - tapPixelPos = reconstructPosition(tc, occluderFragmentDepth); - - sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos); - } - - // output the result - float A = max(1.0 - sum * intensity / float(${s.int(ei)}), 0.0); - - // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2 - A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2; - - fragOcclusion = A;`),e}function Tr(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const ti=Ut(),yn=Object.freeze(Object.defineProperty({__proto__:null,build:On,getRadius:Tr},Symbol.toStringTag,{value:"Module"}));let ri=class extends vr{constructor(e,t,r){super(e,t,new Wt(yn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-LuDZJbYW.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url).then(i=>i.a)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const ot=2;let ze=class extends on{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=ct.SSAO,this.isEnabled=()=>!1,this._enableTime=St(0),this._passParameters=new En,this._drawParameters=new An}initialize(){const e=Uint8Array.from(atob(Tn),r=>r.charCodeAt(0)),t=new mi;t.wrapMode=ht.CLAMP_TO_EDGE,t.pixelFormat=Ie.RGB,t.wrapMode=ht.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new ke(this.renderingContext,t,e),this.techniques.precompile(ri),this.techniques.precompile(Zr),this.addHandles(ci(()=>this.isEnabled(),()=>this._enableTime=St(0)))}destroy(){this._passParameters.noiseTexture=Rt(this._passParameters.noiseTexture)}render(e){const t=this.bindParameters,r=e.find(({name:w})=>w==="normals"),i=r?.getTexture(),o=r?.getTexture(Fo),a=this.fboCache,n=t.camera,l=n.fullViewport[2],c=n.fullViewport[3],u=Math.round(l/ot),d=Math.round(c/ot),h=this.techniques.acquire(ri),v=this.techniques.acquire(Zr);if(!h.compiled||!v.compiled)return this._enableTime=St(performance.now()),this.requestRender(Qt.UPDATE),h.release(),v.release(),a.acquire(u,d,ct.SSAO,qe.RED);this._enableTime===0&&(this._enableTime=St(performance.now()));const f=this.renderingContext,T=this.view.qualitySettings.fadeDuration,_=n.relativeElevation,x=hr((Xr-_)/(Xr-an),0,1),V=T>0?Math.min(T,performance.now()-this._enableTime)/T:1,D=V*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=o,this._passParameters.projScale=1/n.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Rn/Tr(n)**6*D;const B=a.acquire(l,c,"ssao input",qe.RG);f.bindFramebuffer(B.fbo),f.setViewport(0,0,l,c),f.bindTechnique(h,t,this._passParameters,this._drawParameters),f.screen.draw(),h.release();const P=a.acquire(u,d,"ssao blur",qe.RED);f.bindFramebuffer(P.fbo),this._drawParameters.colorTexture=B.getTexture(),Pe(this._drawParameters.blurSize,0,ot/c),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),B.release();const G=a.acquire(u,d,ct.SSAO,qe.RED);return f.bindFramebuffer(G.fbo),f.setViewport(0,0,l,c),f.setClearColor(1,1,1,0),f.clear(Bo.COLOR),this._drawParameters.colorTexture=P.getTexture(),Pe(this._drawParameters.blurSize,ot/l,0),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),v.release(),f.setViewport4fv(n.fullViewport),P.release(),V<1&&this.requestRender(Qt.UPDATE),G}};m([z()],ze.prototype,"consumes",void 0),m([z()],ze.prototype,"produces",void 0),m([z({constructOnly:!0})],ze.prototype,"techniques",void 0),m([z({constructOnly:!0})],ze.prototype,"isEnabled",void 0),ze=m([ur("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ze);const Rn=.5;function br(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new X("ssaoTex",(i,o)=>o.ssao?.getTexture())),r.constants.add("blurSizePixelsInverse","float",1/ot),r.code.add(s`float evaluateAmbientOcclusionInverse() { -vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0)); -return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r; -} -float evaluateAmbientOcclusion() { -return 1.0 - evaluateAmbientOcclusionInverse(); -}`)):r.code.add(s`float evaluateAmbientOcclusionInverse() { return 1.0; } -float evaluateAmbientOcclusion() { return 0.0; }`)}let In=class{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context.stippleTextures}get _markerTextures(){return this._techniques.context.markerTextures}acquireTechnique(e,t){return this._techniques.acquire(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return er.LOADED}},Ln=class extends In{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this._textureId=e.textureId,this._acquire(e.textureId,t=>this._texture=t),this._acquire(e.normalTextureId,t=>this._textureNormal=t),this._acquire(e.emissiveTextureId,t=>this._textureEmissive=t),this._acquire(e.occlusionTextureId,t=>this._textureOcclusion=t),this._acquire(e.metallicRoughnessTextureId,t=>this._textureMetallicRoughness=t)}dispose(){super.dispose(),this._texture=Oe(this._texture),this._textureNormal=Oe(this._textureNormal),this._textureEmissive=Oe(this._textureEmissive),this._textureOcclusion=Oe(this._textureOcclusion),this._textureMetallicRoughness=Oe(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return this._numLoading===0?er.LOADED:er.LOADING}get textureBindParameters(){return new Pn(this._texture!=null?this._texture.glTexture:null,this._textureNormal!=null?this._textureNormal.glTexture:null,this._textureEmissive!=null?this._textureEmissive.glTexture:null,this._textureOcclusion!=null?this._textureOcclusion.glTexture:null,this._textureMetallicRoughness!=null?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){this._texture!=null&&e===this._texture.id||(this._texture=Oe(this._texture),this._textureId=e,this._acquire(this._textureId,t=>this._texture=t))}_acquire(e,t){if(e==null)return void t(null);const r=this._textures.acquire(e);if(Eo(r))return++this._numLoading,void r.then(i=>{if(this._disposed)return Oe(i),void t(null);t(i)}).finally(()=>--this._numLoading);t(r)}},Nn=class extends Qe{constructor(e=null){super(),this.textureEmissive=e}},Pn=class extends Nn{constructor(e=null,t=null,r=null,i=null,o=null,a,n){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=a,this.normalTextureTransformMatrix=n}};var N;(function(e){e[e.Disabled=0]="Disabled",e[e.Normal=1]="Normal",e[e.Schematic=2]="Schematic",e[e.Water=3]="Water",e[e.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",e[e.Simplified=5]="Simplified",e[e.TerrainWithWater=6]="TerrainWithWater",e[e.COUNT=7]="COUNT"})(N||(N={}));function Yi(e,t){const r=t.pbrMode,i=e.fragment;if(r!==N.Schematic&&r!==N.Disabled&&r!==N.Normal)return void i.code.add(s`void applyPBRFactors() {}`);if(r===N.Disabled)return void i.code.add(s`void applyPBRFactors() {} -float getBakedOcclusion() { return 1.0; }`);if(r===N.Schematic)return void i.code.add(s`vec3 mrr = vec3(0.0, 0.6, 0.2); -float occlusion = 1.0; -void applyPBRFactors() {} -float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:o,hasMetallicRoughnessTextureTransform:a,hasOcclusionTexture:n,hasOcclusionTextureTransform:l,bindType:c}=t;(o||n)&&e.include(xr,t),i.code.add(s`vec3 mrr; -float occlusion;`),o&&i.uniforms.add(c===R.Pass?new X("texMetallicRoughness",u=>u.textureMetallicRoughness):new pt("texMetallicRoughness",u=>u.textureMetallicRoughness)),n&&i.uniforms.add(c===R.Pass?new X("texOcclusion",u=>u.textureOcclusion):new pt("texOcclusion",u=>u.textureOcclusion)),i.uniforms.add(c===R.Pass?new q("mrrFactors",u=>u.mrrFactors):new le("mrrFactors",u=>u.mrrFactors)),i.code.add(s` - ${y(o,s`void applyMetallicRoughness(vec2 uv) { - vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb; - mrr[0] *= metallicRoughness.b; - mrr[1] *= metallicRoughness.g; - }`)} - - ${y(n,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")} - - float getBakedOcclusion() { - return ${n?"occlusion":"1.0"}; - } - - void applyPBRFactors() { - mrr = mrrFactors; - occlusion = 1.0; - - ${y(o,`applyMetallicRoughness(${a?"metallicRoughnessUV":"vuv0"});`)} - ${y(n,`applyOcclusion(${l?"occlusionUV":"vuv0"});`)} - } - `)}function Dn(e,t){const r=e.fragment,i=t.lightingSphericalHarmonicsOrder!==void 0?t.lightingSphericalHarmonicsOrder:2;i===0?(r.uniforms.add(new q("lightingAmbientSH0",(o,a)=>Y(ii,a.lighting.sh.r[0],a.lighting.sh.g[0],a.lighting.sh.b[0]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { -vec3 ambientLight = 0.282095 * lightingAmbientSH0; -return ambientLight * (1.0 - ambientOcclusion); -}`)):i===1?(r.uniforms.add(new te("lightingAmbientSH_R",(o,a)=>oe(me,a.lighting.sh.r[0],a.lighting.sh.r[1],a.lighting.sh.r[2],a.lighting.sh.r[3])),new te("lightingAmbientSH_G",(o,a)=>oe(me,a.lighting.sh.g[0],a.lighting.sh.g[1],a.lighting.sh.g[2],a.lighting.sh.g[3])),new te("lightingAmbientSH_B",(o,a)=>oe(me,a.lighting.sh.b[0],a.lighting.sh.b[1],a.lighting.sh.b[2],a.lighting.sh.b[3]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { -vec4 sh0 = vec4( -0.282095, -0.488603 * normal.x, -0.488603 * normal.z, -0.488603 * normal.y -); -vec3 ambientLight = vec3( -dot(lightingAmbientSH_R, sh0), -dot(lightingAmbientSH_G, sh0), -dot(lightingAmbientSH_B, sh0) -); -return ambientLight * (1.0 - ambientOcclusion); -}`)):i===2&&(r.uniforms.add(new q("lightingAmbientSH0",(o,a)=>Y(ii,a.lighting.sh.r[0],a.lighting.sh.g[0],a.lighting.sh.b[0])),new te("lightingAmbientSH_R1",(o,a)=>oe(me,a.lighting.sh.r[1],a.lighting.sh.r[2],a.lighting.sh.r[3],a.lighting.sh.r[4])),new te("lightingAmbientSH_G1",(o,a)=>oe(me,a.lighting.sh.g[1],a.lighting.sh.g[2],a.lighting.sh.g[3],a.lighting.sh.g[4])),new te("lightingAmbientSH_B1",(o,a)=>oe(me,a.lighting.sh.b[1],a.lighting.sh.b[2],a.lighting.sh.b[3],a.lighting.sh.b[4])),new te("lightingAmbientSH_R2",(o,a)=>oe(me,a.lighting.sh.r[5],a.lighting.sh.r[6],a.lighting.sh.r[7],a.lighting.sh.r[8])),new te("lightingAmbientSH_G2",(o,a)=>oe(me,a.lighting.sh.g[5],a.lighting.sh.g[6],a.lighting.sh.g[7],a.lighting.sh.g[8])),new te("lightingAmbientSH_B2",(o,a)=>oe(me,a.lighting.sh.b[5],a.lighting.sh.b[6],a.lighting.sh.b[7],a.lighting.sh.b[8]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { -vec3 ambientLight = 0.282095 * lightingAmbientSH0; -vec4 sh1 = vec4( -0.488603 * normal.x, -0.488603 * normal.z, -0.488603 * normal.y, -1.092548 * normal.x * normal.y -); -vec4 sh2 = vec4( -1.092548 * normal.y * normal.z, -0.315392 * (3.0 * normal.z * normal.z - 1.0), -1.092548 * normal.x * normal.z, -0.546274 * (normal.x * normal.x - normal.y * normal.y) -); -ambientLight += vec3( -dot(lightingAmbientSH_R1, sh1), -dot(lightingAmbientSH_G1, sh1), -dot(lightingAmbientSH_B1, sh1) -); -ambientLight += vec3( -dot(lightingAmbientSH_R2, sh2), -dot(lightingAmbientSH_G2, sh2), -dot(lightingAmbientSH_B2, sh2) -); -return ambientLight * (1.0 - ambientOcclusion); -}`),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic||r.code.add(s`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0); -vec3 calculateAmbientRadiance(float ambientOcclusion) -{ -vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2; -return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance; -}`))}const ii=I(),me=Ht();function Nt(e){e.uniforms.add(new q("mainLightDirection",(t,r)=>r.lighting.mainLight.direction))}function xt(e){e.uniforms.add(new q("mainLightIntensity",(t,r)=>r.lighting.mainLight.intensity))}function Fn(e){Nt(e.fragment),xt(e.fragment),e.fragment.code.add(s`vec3 applyShading(vec3 shadingNormalWorld, float shadow) { -float dotVal = clamp(dot(shadingNormalWorld, mainLightDirection), 0.0, 1.0); -return mainLightIntensity * ((1.0 - shadow) * dotVal); -}`)}function Bn(e){const t=e.fragment.code;t.add(s`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) -{ -return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5; -}`),t.add(s`float integratedRadiance(float cosTheta2, float roughness) -{ -return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0); -}`),t.add(s`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) -{ -float cosTheta2 = 1.0 - RdotNG * RdotNG; -float intRadTheta = integratedRadiance(cosTheta2, roughness); -float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta; -float sky = 2.0 - ground; -return (ground * ambientGround + sky * ambientSky) * 0.5; -}`)}function Xi(e){const t=3.141592653589793,r=.3183098861837907;e.vertex.constants.add("PI","float",t),e.fragment.constants.add("PI","float",t),e.fragment.constants.add("LIGHT_NORMALIZATION","float",r),e.fragment.constants.add("INV_PI","float",r),e.fragment.constants.add("HALF_PI","float",1.570796326794897),e.fragment.constants.add("TWO_PI","float",6.28318530717958)}function Er(e,t){const r=e.fragment.code;e.include(Xi),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic&&t.pbrMode!==N.Simplified&&t.pbrMode!==N.TerrainWithWater||(r.add(s`float normalDistribution(float NdotH, float roughness) -{ -float a = NdotH * roughness; -float b = roughness / (1.0 - NdotH * NdotH + a * a); -return b * b * INV_PI; -}`),r.add(s`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022); -const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040); -const vec2 c2 = vec2(-1.04, 1.04); -vec2 prefilteredDFGAnalytical(float roughness, float NdotV) { -vec4 r = roughness * c0 + c1; -float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y; -return c2 * a004 + r.zw; -}`)),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic||(e.include(Bn),r.add(s`struct PBRShadingInfo -{ -float NdotV; -float LdotH; -float NdotNG; -float RdotNG; -float NdotAmbDir; -float NdotH_Horizon; -vec3 skyRadianceToSurface; -vec3 groundRadianceToSurface; -vec3 skyIrradianceToSurface; -vec3 groundIrradianceToSurface; -float averageAmbientRadiance; -float ssao; -vec3 albedoLinear; -vec3 f0; -vec3 f90; -vec3 diffuseColor; -float metalness; -float roughness; -};`),r.add(s`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) { -vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG); -vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness); -vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI; -vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV); -vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y; -vec3 specularComponent = specularColor * indirectSpecular; -return (diffuseComponent + specularComponent); -}`),r.add(s`float gamutMapChanel(float x, vec2 p){ -return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) ); -}`),r.add(s`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){ -vec3 outColor; -vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance)); -outColor.x = gamutMapChanel(inColor.x, p) ; -outColor.y = gamutMapChanel(inColor.y, p) ; -outColor.z = gamutMapChanel(inColor.z, p) ; -return outColor; -}`))}let zn=class extends J{constructor(e,t){super(e,"bool",R.Pass,(r,i,o)=>r.setUniform1b(e,t(i,o)))}};const Gn=.4;function Sr(e){e.constants.add("ambientBoostFactor","float",Gn)}function Ar(e){e.uniforms.add(new ie("lightingGlobalFactor",(t,r)=>r.lighting.globalFactor))}function Ji(e,t){const r=e.fragment;switch(e.include(br,t),t.pbrMode!==N.Disabled&&e.include(Er,t),e.include(Dn,t),e.include(Xi),r.code.add(s` - const float GAMMA_SRGB = 2.1; - const float INV_GAMMA_SRGB = 0.4761904; - ${t.pbrMode===N.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"} - `),Sr(r),Ar(r),Nt(r),r.code.add(s` - float additionalDirectedAmbientLight(vec3 vPosWorld) { - float vndl = dot(${t.spherical?s`normalize(vPosWorld)`:s`vec3(0.0, 0.0, 1.0)`}, mainLightDirection); - return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0)); - } - `),xt(r),r.code.add(s`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) { -float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld); -return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity; -}`),t.pbrMode){case N.Disabled:case N.WaterOnIntegratedMesh:case N.Water:e.include(Fn),r.code.add(s`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) { -vec3 mainLighting = applyShading(normalWorld, shadow); -vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao); -vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); -vec3 totalLight = mainLighting + ambientLighting + additionalLight; -totalLight = min(totalLight, vec3(PI)); -vec3 outColor = vec3((albedoLinear / PI) * totalLight); -return pow(outColor, vec3(INV_GAMMA_SRGB)); -}`);break;case N.Normal:case N.Schematic:r.code.add(s`const float fillLightIntensity = 0.25; -const float horizonLightDiffusion = 0.4; -const float additionalAmbientIrradianceFactor = 0.02; -vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec4 _emission, float additionalAmbientIrradiance) -{ -vec3 viewDirection = -viewDir; -vec3 h = normalize(viewDirection + mainLightDirection); -PBRShadingInfo inputs; -inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0); -inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0); -vec3 reflectedView = normalize(reflect(viewDirection, normal)); -inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0); -inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); -inputs.ssao = ssao; -inputs.metalness = mrr[0]; -inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(s`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness; -inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0)); -inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new zn("hasFillLights",(i,o)=>o.enableFillLights)):r.constants.add("hasFillLights","bool",!1),r.code.add(s`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]); -ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0)); -inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0; -float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0); -vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity; -vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity; -vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight; -inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ; -inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new ie("lightingSpecularStrength",(i,o)=>o.lighting.mainLight.specularStrength),new ie("lightingEnvironmentStrength",(i,o)=>o.lighting.mainLight.environmentStrength)).code.add(s`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView; -vec3 horizonRingH = normalize(viewDirection + horizonRingDir); -inputs.NdotH_Horizon = dot(normal, horizonRingH); -float NdotH = clamp(dot(normal, h), 0.0, 1.0); -vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow); -vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity; -vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight; -float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0)); -inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; -inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; -inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(s` - vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs); - vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance; - vec3 emissionComponent = _emission.rgb == vec3(0.0) ? _emission.rgb : pow(_emission.rgb, vec3(GAMMA_SRGB)); - vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent; - ${t.pbrMode!==N.Schematic||t.hasColorTexture?s`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:s`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`} - return outColor; - } - `);break;case N.Simplified:case N.TerrainWithWater:Nt(r),xt(r),r.code.add(s`const float roughnessTerrain = 0.5; -const float specularityTerrain = 0.5; -const vec3 fresnelReflectionTerrain = vec3(0.04); -vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) { -vec3 viewDirection = -vd; -vec3 h = normalize(viewDirection + mainLightDirection); -float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0); -float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0); -float NdotH = clamp(dot(n, h), 0.0, 1.0); -float NdotNG = clamp(dot(n, nup), -1.0, 1.0); -vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB)); -float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2]; -vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain; -vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0)); -vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity; -vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al; -vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent; -vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5; -vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI; -vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity; -vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV); -vec3 specularColor = f0 * dfg.x + f90 * dfg.y; -vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent; -vec3 outColorLinear = outDiffColor + specularComponent; -vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB)); -return outColor; -}`);break;default:zt(t.pbrMode);case N.COUNT:}}let Vn=class extends J{constructor(e,t,r){super(e,"mat4",R.Draw,(i,o,a,n)=>i.setUniformMatrix4fv(e,t(o,a,n)),r)}},Hn=class extends J{constructor(e,t,r){super(e,"mat4",R.Pass,(i,o,a)=>i.setUniformMatrix4fv(e,t(o,a)),r)}};function Zi(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new Hn("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),Qi(e))}function Ki(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new Vn("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),Qi(e))}function Qi(e){const t=e.fragment;t.include(Wi),t.uniforms.add(new X("shadowMap",(r,i)=>i.shadowMap.depthTexture),new gr("numCascades",(r,i)=>i.shadowMap.numCascades),new te("cascadeDistances",(r,i)=>i.shadowMap.cascadeDistances)).code.add(s`int chooseCascade(float depth, out mat4 mat) { -vec4 distance = cascadeDistances; -int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3; -mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3]; -return i; -} -vec3 lightSpacePosition(vec3 _vpos, mat4 mat) { -vec4 lv = mat * vec4(_vpos, 1.0); -lv.xy /= lv.w; -return 0.5 * lv.xyz + vec3(0.5); -} -vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) { -float xScale = float(textureSize.y) / float(textureSize.x); -return vec2((float(i) + lvpos.x) * xScale, lvpos.y); -} -float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) { -return rgba4ToFloat(texelFetch(_depthTex, uv, 0)); -} -float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) { -return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0; -} -float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) { -vec2 st = fract(uv * vec2(texSize) + vec2(0.5)); -ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5)); -float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex); -float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex); -float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex); -float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex); -return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y); -} -float readShadowMap(const in vec3 _vpos, float _linearDepth) { -mat4 mat; -int i = chooseCascade(_linearDepth, mat); -if (i >= numCascades) { return 0.0; } -vec3 lvpos = lightSpacePosition(_vpos, mat); -if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; } -ivec2 size = textureSize(shadowMap, 0); -vec2 uv = cascadeCoordinates(i, size, lvpos); -return filterShadow(uv, lvpos, size, shadowMap); -}`)}function eo(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:i}){r?(e.fragment.include(_r),e.fragment.uniforms.add(new X("terrainDepthTexture",(o,a)=>a.terrainDepth?.attachment)).code.add(s` - ${t?"bool":"void"} terrainDepthTest(float fragmentDepth) { - float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r; - float linearDepth = linearizeDepth(depth); - ${t?s`return fragmentDepth < linearDepth && depth < 1.0;`:s`if(fragmentDepth ${i?">":"<="} linearDepth) discard;`} - }`)):t?e.fragment.code.add(s`#define terrainDepthTest(fragmentDepth) false`):e.fragment.code.add(s`#define terrainDepthTest(fragmentDepth) {}`)}function Un(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new ue("colorTextureTransformMatrix",r=>r.colorTextureTransformMatrix??et)).code.add(s`void forwardColorUV(){ -colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardColorUV(){}`)}function Wn(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new ue("normalTextureTransformMatrix",r=>r.normalTextureTransformMatrix??et)).code.add(s`void forwardNormalUV(){ -normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardNormalUV(){}`)}function jn(e,t){t.hasEmissionTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new ue("emissiveTextureTransformMatrix",r=>r.emissiveTextureTransformMatrix??et)).code.add(s`void forwardEmissiveUV(){ -emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardEmissiveUV(){}`)}function $n(e,t){t.hasOcclusionTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new ue("occlusionTextureTransformMatrix",r=>r.occlusionTextureTransformMatrix??et)).code.add(s`void forwardOcclusionUV(){ -occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardOcclusionUV(){}`)}function qn(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new ue("metallicRoughnessTextureTransformMatrix",r=>r.metallicRoughnessTextureTransformMatrix??et)).code.add(s`void forwardMetallicRoughnessUV(){ -metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardMetallicRoughnessUV(){}`)}function to(e){e.code.add(s`vec4 premultiplyAlpha(vec4 v) { -return vec4(v.rgb * v.a, v.a); -} -vec3 rgb2hsv(vec3 c) { -vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); -vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); -vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); -float d = q.x - min(q.w, q.y); -float e = 1.0e-10; -return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); -} -vec3 hsv2rgb(vec3 c) { -vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); -return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); -} -float rgb2v(vec3 c) { -return max(c.x, max(c.y, c.z)); -}`)}function ro(e){e.include(to),e.code.add(s` - vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) { - // workaround for artifacts in macOS using Intel Iris Pro - // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 - vec3 internalMixed = internalColor * textureColor; - vec3 allMixed = internalMixed * externalColor; - - if (mode == ${s.int(fe.Multiply)}) { - return allMixed; - } - if (mode == ${s.int(fe.Ignore)}) { - return internalMixed; - } - if (mode == ${s.int(fe.Replace)}) { - return externalColor; - } - - // tint (or something invalid) - float vIn = rgb2v(internalMixed); - vec3 hsvTint = rgb2hsv(externalColor); - vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z); - return hsv2rgb(hsvOut); - } - - float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) { - // workaround for artifacts in macOS using Intel Iris Pro - // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 - float internalMixed = internalOpacity * textureOpacity; - float allMixed = internalMixed * externalOpacity; - - if (mode == ${s.int(fe.Ignore)}) { - return internalMixed; - } - if (mode == ${s.int(fe.Replace)}) { - return externalOpacity; - } - - // multiply or tint (or something invalid) - return allMixed; - } - `)}var se;(function(e){e[e.None=0]="None",e[e.Value=1]="Value",e[e.Texture=2]="Texture",e[e.COUNT=3]="COUNT"})(se||(se={}));function kn(e,t){if(!ft(t.output))return;const{emissionSource:r,hasEmissiveTextureTransform:i,bindType:o}=t,a=r===se.Texture;a&&(e.include(xr,t),e.fragment.uniforms.add(o===R.Pass?new X("texEmission",l=>l.textureEmissive):new pt("texEmission",l=>l.textureEmissive)));const n=r===se.Value||a;n&&e.fragment.uniforms.add(o===R.Pass?new q("emissionFactor",l=>l.emissiveFactor):new le("emissionFactor",l=>l.emissiveFactor)),e.fragment.code.add(s` - vec4 getEmissions() { - vec4 emissions = ${n?"vec4(emissionFactor, 1.0)":"vec4(0.0)"}; - ${y(a,`emissions *= textureLookup(texEmission, ${i?"emissiveUV":"vuv0"}); - emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}; - return emissions; - } - `)}function io(e,t){e.include(ji,t),e.include(kn,t),e.fragment.include(to);const r=t.output===F.ObjectAndLayerIdColor,i=vi(t.output),o=ft(t.output)&&t.oitPass===k.ColorAlpha,a=ft(t.output)&&t.oitPass!==k.ColorAlpha,n=t.discardInvisibleFragments;let l=0;(a||i||o)&&e.outputs.add("fragColor","vec4",l++),i&&e.outputs.add("fragEmission","vec4",l++),o&&e.outputs.add("fragAlpha","float",l++),e.fragment.code.add(s` - void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) { - ${y(r,s`finalColor.a = 1.0;`)} - - ${y(n,s`if (finalColor.a < ${s.float(be)}){ - discard; - return; - }`)} - - finalColor = highlightSlice(finalColor, vWorldPosition); - ${y(o,s`fragColor = premultiplyAlpha(finalColor); - fragAlpha = finalColor.a;`)} - ${y(a,"fragColor = finalColor;")} - ${y(i,"fragEmission = getEmissions();")} - calculateOcclusionAndOutputHighlight(); - ${y(r,"outputObjectAndLayerIdColor();")} - } - `)}function Yn(e){const t=new jt,{vertex:r,fragment:i,varyings:o}=t,{output:a,normalType:n,offsetBackfaces:l,instancedColor:c,spherical:u,receiveShadows:d,snowCover:h,pbrMode:v,textureAlphaPremultiplied:f,instancedDoublePrecision:T,hasVertexColors:_,hasVertexTangents:x,hasColorTexture:V,hasNormalTexture:D,hasNormalTextureTransform:B,hasColorTextureTransform:P}=e;if(je(r,e),t.include(pr),o.add("vpos","vec3"),t.include(lt,e),t.include(zi,e),t.include(Ui,e),t.include(Un,e),!ft(a))return t.include($i,e),t;t.include(Wn,e),t.include(jn,e),t.include($n,e),t.include(qn,e),gt(r,e),t.include(Bt,e),t.include(We,e);const G=n===Q.Attribute||n===Q.Compressed;return G&&l&&t.include(Ni),t.include(rn,e),t.include(Si,e),c&&t.attributes.add(p.INSTANCECOLOR,"vec4"),o.add("vPositionLocal","vec3"),t.include(Ne,e),t.include(Li,e),t.include(Gi,e),t.include(Vi,e),r.uniforms.add(new te("externalColor",w=>w.externalColor)),o.add("vcolorExt","vec4"),e.terrainDepthTest&&o.add("depth","float"),r.main.add(s` - forwardNormalizedVertexColor(); - vcolorExt = externalColor; - ${y(c,"vcolorExt *= instanceColor * 0.003921568627451;")} - vcolorExt *= vvColor(); - vcolorExt *= getSymbolColor(); - forwardColorMixMode(); - - if (vcolorExt.a < ${s.float(be)}) { - gl_Position = vec4(1e38, 1e38, 1e38, 1.0); - } else { - vpos = getVertexInLocalOriginSpace(); - vPositionLocal = vpos - view[3].xyz; - vpos = subtractOrigin(vpos); - ${y(G,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")} - vpos = addVerticalOffset(vpos, localOrigin); - ${y(x,"vTangent = dpTransformVertexTangent(tangent);")} - gl_Position = transformPosition(proj, view, vpos); - ${y(G&&l,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")} - } - - ${y(e.terrainDepthTest,"depth = (view * vec4(vpos, 1.0)).z;")} - forwardLinearDepth(); - forwardTextureCoordinates(); - forwardColorUV(); - forwardNormalUV(); - forwardEmissiveUV(); - forwardOcclusionUV(); - forwardMetallicRoughnessUV(); - `),t.include(Ji,e),t.include(br,e),t.include($e,e),t.include(T?Zi:Ki,e),t.include(eo,e),t.include(Ue,e),t.include(io,e),gt(i,e),i.uniforms.add(r.uniforms.get("localOrigin"),new q("ambient",w=>w.ambient),new q("diffuse",w=>w.diffuse),new ie("opacity",w=>w.opacity),new ie("layerOpacity",w=>w.layerOpacity)),V&&i.uniforms.add(new X("tex",w=>w.texture)),t.include(Yi,e),t.include(Er,e),i.include(ro),t.include(tn,e),Sr(i),Ar(i),xt(i),i.main.add(s` - discardBySlice(vpos); - ${y(e.terrainDepthTest,"terrainDepthTest(depth);")} - ${V?s` - vec4 texColor = texture(tex, ${P?"colorUV":"vuv0"}); - ${y(f,"texColor.rgb /= texColor.a;")} - discardOrAdjustAlpha(texColor);`:s`vec4 texColor = vec4(1.0);`} - shadingParams.viewDirection = normalize(vpos - cameraPosition); - ${n===Q.ScreenDerivative?s`vec3 normal = screenDerivativeNormal(vPositionLocal);`:s`shadingParams.normalView = vNormalWorld; - vec3 normal = shadingNormal(shadingParams);`} - applyPBRFactors(); - float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion(); - - vec3 posWorld = vpos + localOrigin; - - float additionalAmbientScale = additionalDirectedAmbientLight(posWorld); - float shadow = ${d?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":y(u,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")}; - - vec3 matColor = max(ambient, diffuse); - vec3 albedo = mixExternalColor(${y(_,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); - float opacity_ = layerOpacity * mixExternalOpacity(${y(_,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, int(colorMixMode)); - ${D?`mat3 tangentSpace = computeTangentSpace(${x?"normal":"normal, vpos, vuv0"}); - vec3 shadingNormal = computeTextureNormal(tangentSpace, ${B?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"} - vec3 normalGround = ${u?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"} - - ${y(h,s` - float snow = smoothstep(0.5, 0.55, dot(normal, normalGround)); - albedo = mix(albedo, vec3(1), snow); - shadingNormal = mix(shadingNormal, normal, snow); - ssao = mix(ssao, 1.0, snow);`)} - - vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; - - ${v===N.Normal||v===N.Schematic?s` - float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; - ${y(h,s`mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);`)} - vec4 emission = ${h?"mix(getEmissions(), vec4(0.0), snow)":"getEmissions()"}; - vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} - vec4 finalColor = vec4(shadedColor, opacity_); - outputColorHighlightOID(finalColor, vpos); - `),t}const Xn=Object.freeze(Object.defineProperty({__proto__:null,build:Yn},Symbol.toStringTag,{value:"Module"}));let Jn=class extends fa{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Fa,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Tt.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=Ke,this.instancedDoublePrecision=!1,this.normalType=Q.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=ut(.2,.2,.2),this.diffuse=ut(.8,.8,.8),this.externalColor=aa(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=I(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=Ft.Less,this.textureAlphaMode=ge.Blend,this.textureAlphaCutoff=be,this.textureAlphaPremultiplied=!1,this.renderOccluded=ir.Occlude,this.isDecoration=!1}},Ql=class extends pa{constructor(){super(...arguments),this.origin=I(),this.slicePlaneLocalOrigin=this.origin}},oo=class extends vr{constructor(e,t,r,i=new Wt(Xn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-LuDZJbYW.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url).then(o=>o.D))){super(e,t,i,r),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:a,customDepthTest:n,hasOccludees:l,enableOffset:c}=e,u=r===k.NONE,d=r===k.FrontFace;return Gt({blending:ft(i)&&o?wa(r):null,culling:Kn(e)?Jo(a):null,depthTest:{func:Ia(r,Zn(n))},depthWrite:Ma(e),drawBuffers:i===F.Depth?{buffers:[Go.NONE]}:La(r,i),colorWrite:Vt,stencilWrite:l?Na:null,stencilTest:l?t?Da:Pa:null,polygonOffset:u||d?null:Ra(c)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function Zn(e){return e===Ft.Lequal?de.LEQUAL:de.LESS}function Kn(e){return e.cullFace!==Tt.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qn(){return oi??=(async()=>{const e=await _t(()=>import("./basis_transcoder-BQKD9Nty-CAkTxthP.js"),[],import.meta.url),t=await e.default({locateFile:r=>Po(`esri/libs/basisu/${r}`)});return t.initializeBasis(),t})(),oi}let oi;var Le;(function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"})(Le||(Le={}));let ce=null,wt=null;async function ao(){return wt==null&&(wt=Qn(),ce=await wt),wt}function es(e,t){if(ce==null)return e.byteLength;const r=new ce.BasisFile(new Uint8Array(e)),i=so(r)?no(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function ts(e,t){if(ce==null)return e.byteLength;const r=new ce.KTX2File(new Uint8Array(e)),i=lo(r)?no(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function no(e,t,r,i,o){const a=Ho(t?pe.COMPRESSED_RGBA8_ETC2_EAC:pe.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function so(e){return e.getNumImages()>=1&&!e.isUASTC()}function lo(e){return e.getFaces()>=1&&e.isETC1S()}async function rs(e,t,r){ce==null&&(ce=await ao());const i=new ce.BasisFile(new Uint8Array(r));if(!so(i))return null;i.startTranscoding();const o=co(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(a,n)=>i.getImageTranscodedSizeInBytes(0,a,n),(a,n,l)=>i.transcodeImage(l,0,a,n,0,0));return i.close(),i.delete(),o}async function is(e,t,r){ce==null&&(ce=await ao());const i=new ce.KTX2File(new Uint8Array(r));if(!lo(i))return null;i.startTranscoding();const o=co(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(a,n)=>i.getImageTranscodedSizeInBytes(a,0,0,n),(a,n,l)=>i.transcodeImage(l,a,0,0,n,0,-1,-1));return i.close(),i.delete(),o}function co(e,t,r,i,o,a,n,l){const{compressedTextureETC:c,compressedTextureS3TC:u}=e.capabilities,[d,h]=c?i?[Le.ETC2_RGBA,pe.COMPRESSED_RGBA8_ETC2_EAC]:[Le.ETC1_RGB,pe.COMPRESSED_RGB8_ETC2]:u?i?[Le.BC3_RGBA,pe.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[Le.BC1_RGB,pe.COMPRESSED_RGB_S3TC_DXT1_EXT]:[Le.RGBA32,Ie.RGBA],v=t.hasMipmap?r:Math.min(1,r),f=[];for(let T=0;T1,t.samplingMode=t.hasMipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.width=o,t.height=a,new ke(e,t,{type:"compressed",levels:f})}const Mt=()=>hi.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),os=542327876,as=131072,ns=4;function Cr(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function ss(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}const ls=Cr("DXT1"),cs=Cr("DXT3"),ds=Cr("DXT5"),us=31,hs=0,ms=1,fs=2,ps=3,vs=4,gs=7,xs=20,_s=21;function Ts(e,t,r){const i=bs(r,t.hasMipmap??!1);if(i==null)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:l}=i;return t.samplingMode=o.levels.length>1?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=l,new ke(e,t,o)}function bs(e,t){const r=new Int32Array(e.buffer,e.byteOffset,us);if(r[hs]!==os)return Mt().error("Invalid magic number in DDS header"),null;if(!(r[xs]&ns))return Mt().error("Unsupported format, must contain a FourCC code"),null;const i=r[_s];let o,a;switch(i){case ls:o=8,a=pe.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case cs:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ds:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Mt().error("Unsupported FourCC code:",ss(i)),null}let n=1,l=r[vs],c=r[ps];(3&l||3&c)&&(Mt().warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const u=l,d=c;let h,v;r[fs]&as&&t!==!1&&(n=Math.max(1,r[gs]));let f=e.byteOffset+r[ms]+4;const T=[];for(let _=0;_>2)*(c+3>>2)*o,h=new Uint8Array(e.buffer,f,v),T.push(h),f+=v,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:T},internalFormat:a,width:u,height:d}}function Es(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?uo(e):e;let i=e.width,o=e.height;do i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o;while(r>1048576||t!=null&&(i>t||o>t));return wr(e,i,o)}function Ss(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return wr(e,Math.round(e.width*i),Math.round(e.height*i))}function wr(e,t,r){if(e instanceof ImageData)return wr(uo(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function uo(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(r==null)throw new Te("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}let ec=class extends Ci{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=vt.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new So,this._parameters={...Cs,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(Ir(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const r=()=>{e.removeEventListener("canplay",r),e.play()};e.addEventListener("canplay",r)}}}_startPreloadImageElement(e){Ao(e.src)||Ir(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new mi;return t.wrapMode=this._parameters.wrap??ht.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||As(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return t==null?(this._glTexture=new ke(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof t=="string"?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):rt(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,t):it(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):(it(t)||rt(t))&&this._parameters.encoding===Ve.KTX2_ENCODING?this._loadFromKTX2(e,t):(it(t)||rt(t))&&this._parameters.encoding===Ve.BASIS_ENCODING?this._loadFromBasis(e,t):rt(t)?this._loadFromPixelData(e,t):it(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return this._glTexture==null||e.readyStateis(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromBasis(e,t){return this._loadAsync(()=>rs(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromPixelData(e,t){W(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=this._parameters.components===1?Ie.LUMINANCE:this._parameters.components===3?Ie.RGB:Ie.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ke(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await Do(t,{signal:r});return Lr(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await Co(t,t.src,!1,r);return Lr(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=dt.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",l),No(c)},n=()=>{t.readyState>=dt.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},l=u=>{a(),o(u||new Te("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",l);const c=wo(r,()=>l(Mo()))}))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:a}=e.parameters;r=this._parameters.downsampleUncompressed?Es(r,a):Ss(r,a)}const i=ho(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=this._parameters.components===3?Ie.RGB:Ie.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new ke(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=Rt(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function As(e,t){if(e==null)return 0;if(it(e)||rt(e))return t.encoding===Ve.KTX2_ENCODING?ts(e,!!t.mipmap):t.encoding===Ve.BASIS_ENCODING?es(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ho(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}function ho(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}var dt;(function(e){e[e.HAVE_NOTHING=0]="HAVE_NOTHING",e[e.HAVE_METADATA=1]="HAVE_METADATA",e[e.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",e[e.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",e[e.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(dt||(dt={}));const Cs={wrap:{s:ht.REPEAT,t:ht.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};class ws{constructor(t=!1,r=!0){this.isVerticalRay=t,this.normalRequired=r}}const Ot=go();function Ms(e,t,r,i,o,a){if(!e.visible)return;const n=Ye(Hs,i,r),l=(u,d,h)=>{a(u,h,d,!1)},c=new ws(!1,t.options.normalRequired);if(e.boundingInfo){W(e.type===vt.Mesh);const u=t.tolerance;mo(e.boundingInfo,r,n,u,o,c,l)}else{const u=e.attributes.get(p.POSITION),d=u.indices;Rs(r,n,0,d.length/3,d,u.data,u.stride,o,c,l)}}const Os=I();function mo(e,t,r,i,o,a,n){if(e==null)return;const l=Fs(r,Os);if(Oo(Ot,e.bbMin),yo(Ot,e.bbMax),o?.applyToAabb(Ot),Bs(Ot,t,l,i)){const{primitiveIndices:c,position:u}=e,d=c?c.length:u.indices.length/3;if(d>Gs){const h=e.getChildren();if(h!==void 0){for(const v of h)mo(v,t,r,i,o,a,n);return}}ys(t,r,0,d,u.indices,u.data,u.stride,c,o,a,n)}}const at=I();function ys(e,t,r,i,o,a,n,l,c,u,d){const h=e[0],v=e[1],f=e[2],T=t[0],_=t[1],x=t[2],{normalRequired:V}=u;for(let D=r;D0){if(Be<0||Be>ne)continue}else if(Be>0||Be0){if(Et<0||Be+Et>ne)continue}else if(Et>0||Be+Et=0&&d(Rr,B,V?Ps(ee,Ee,Se,Ae,Ce,he,at):null)}}function Rs(e,t,r,i,o,a,n,l,c,u){const d=t,h=Us,v=Math.abs(d[0]),f=Math.abs(d[1]),T=Math.abs(d[2]),_=v>=f?v>=T?0:2:f>=T?1:2,x=_,V=d[x]<0?2:1,D=(_+V)%3,B=(_+(3-V))%3,P=d[D]/d[x],G=d[B]/d[x],w=1/d[x],S=Is,E=Ls,M=Ns,{normalRequired:O}=c;for(let g=r;g0||we>0||Me>0))continue;const De=he+we+Me;if(De===0)continue;const ne=he*(w*S[x])+we*(w*E[x])+Me*(w*M[x]);if(ne*Math.sign(De)<0)continue;const Fe=ne/De;Fe>=0&&u(Fe,g,O?Ds(h):null)}}const Is=I(),Ls=I(),Ns=I();function Ps(e,t,r,i,o,a,n){return Y(Pt,e,t,r),Y(Dt,i,o,a),pi(n,Pt,Dt),mr(n,n),n}function Ds(e){return Ye(Pt,e[1],e[0]),Ye(Dt,e[2],e[0]),pi(at,Pt,Dt),mr(at,at),at}const Pt=I(),Dt=I();function Fs(e,t){return Y(t,1/e[0],1/e[1],1/e[2])}function Bs(e,t,r,i){return zs(e,t,r,i,1/0)}function zs(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let l=Math.min(a,n),c=Math.max(a,n);const u=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(c=Math.min(c,Math.max(u,d)),c<0||(l=Math.max(l,Math.min(u,d)),l>c))return!1;const h=(e[2]-i-t[2])*r[2],v=(e[5]+i-t[2])*r[2];return c=Math.min(c,Math.max(h,v)),!(c<0)&&(l=Math.max(l,Math.min(h,v)),!(l>c)&&l{w=a[O]+B,S=a[O+1]+P,E=a[O+2]+G}:O=>{const g=a[O],L=a[O+1],C=a[O+2];w=d*g+f*L+x*C+B,S=h*g+T*L+V*C+P,E=v*g+_*L+D*C+G};if(o===1)for(let O=0;O{S=a[g],E=a[g+1],M=a[g+2]}:g=>{const L=a[g],C=a[g+1],H=a[g+2];S=h*L+T*C+V*H,E=v*L+_*C+D*H,M=f*L+x*C+B*H};if(o===1)if(P)for(let g=0;gG){const C=1/Math.sqrt(L);c[i]=S*C,c[i+1]=E*C,c[i+2]=M*C}else c[i]=S,c[i+1]=E,c[i+2]=M;i+=u}else for(let g=0;gG){const C=1/Math.sqrt(L);S*=C,E*=C,M*=C}}for(let L=0;LG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}c[i]=C,c[i+1]=H,c[i+2]=$,c[i+3]=L,i+=u}else for(let S=0;SG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}for(let Z=0;Z0)??[],this._parameterNames??=[]}get key(){return this._key??=new Ks(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(i=>` ${i}: ${this[i]}`).join(` -`);return this._parameterBits=t,r}};function b(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const i=e.count||2,o=Math.ceil(Math.log2(i)),a=t._parameterBits;let n=0;for(;a[n]+o>16;)n++,n>=a.length&&a.push(0);const l=a[n],c=(1<>l},set(u){if(this[r]!==u){if(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<>l)},set(u){if(this[r]!==u&&(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<v.externalColor)),o.add("vcolorExt","vec4"),r.main.add(s` - forwardNormalizedVertexColor(); - vcolorExt = externalColor; - ${y(l,"vcolorExt *= instanceColor * 0.003921568627451;")} - vcolorExt *= vvColor(); - vcolorExt *= getSymbolColor(); - forwardColorMixMode(); - - if (vcolorExt.a < ${s.float(be)}) { - gl_Position = vec4(1e38, 1e38, 1e38, 1.0); - } else { - vpos = getVertexInLocalOriginSpace(); - localvpos = vpos - view[3].xyz; - vpos = subtractOrigin(vpos); - vNormalWorld = dpNormal(vvLocalNormal(normalModel())); - vpos = addVerticalOffset(vpos, localOrigin); - gl_Position = transformPosition(proj, view, vpos); - ${y(n,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")} - } - ${y(e.terrainDepthTest,"depth = (view * vec4(vpos, 1.0)).z;")} - forwardLinearDepth(); - forwardTextureCoordinates();`)),a===F.Color){const{hasColorTexture:v,hasColorTextureTransform:f,receiveShadows:T}=e;t.include(Ji,e),t.include(br,e),t.include($e,e),t.include(e.instancedDoublePrecision?Zi:Ki,e),t.include(eo,e),t.include(Ue,e),t.include(io,e),gt(t.fragment,e),Nt(i),Sr(i),Ar(i),i.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new q("ambient",_=>_.ambient),new q("diffuse",_=>_.diffuse),new ie("opacity",_=>_.opacity),new ie("layerOpacity",_=>_.layerOpacity)),v&&i.uniforms.add(new X("tex",_=>_.texture)),t.include(Yi,e),t.include(Er,e),i.include(ro),xt(i),i.main.add(s` - discardBySlice(vpos); - ${y(e.terrainDepthTest,"terrainDepthTest(depth);")} - vec4 texColor = ${v?`texture(tex, ${f?"colorUV":"vuv0"})`:" vec4(1.0)"}; - ${y(v,`${y(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")} - discardOrAdjustAlpha(texColor);`)} - vec3 viewDirection = normalize(vpos - cameraPosition); - applyPBRFactors(); - float ssao = evaluateAmbientOcclusionInverse(); - ssao *= getBakedOcclusion(); - - float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); - vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; - float shadow = ${T?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":d?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; - vec3 matColor = max(ambient, diffuse); - ${e.hasVertexColors?s`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); - float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:s`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); - float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} - ${y(u,"albedo = mix(albedo, vec3(1), 0.9);")} - ${s`vec3 shadingNormal = normalize(vNormalWorld); - albedo *= 1.2; - vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]); - float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0); - float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0); - float treeRadialFalloff = vColor.r; - float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow); - additionalLight += backLightFactor * mainLightIntensity;`} - ${y(h,`vec3 normalGround = ${d?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)} - ${h?s`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; - ${y(u,s`mrr = vec3(0.0, 1.0, 0.04);`)} - vec4 emission = ${u?"vec4(0.0)":"getEmissions()"}; - vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} - vec4 finalColor = vec4(shadedColor, opacity_); - outputColorHighlightOID(finalColor, vpos);`)}return t.include($i,e),t}const tl=Object.freeze(Object.defineProperty({__proto__:null,build:el},Symbol.toStringTag,{value:"Module"}));class rl extends oo{constructor(t,r,i){super(t,r,i,new Wt(tl,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-LuDZJbYW.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url).then(o=>o.R))),this.type="RealisticTreeTechnique"}}class ic extends Ca{constructor(t,r){super(t,ol),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[st.OPAQUE_MATERIAL,i=>(Dr(i)||kt(i))&&!this.parameters.transparent],[st.TRANSPARENT_MATERIAL,i=>(Dr(i)||kt(i))&&this.parameters.transparent&&this.parameters.writeDepth],[st.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,i=>(ko(i)||kt(i))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=nl(this.parameters),this._configuration=new A(r.spherical,r.doublePrecisionRequiresObfuscation)}isVisibleForOutput(t){return t!==F.Shadow&&t!==F.ShadowExcludeHighlight&&t!==F.ShadowHighlight||this.parameters.castShadows}get visible(){const t=this.parameters;if(t.layerOpacity=be;if(i&&n)return l||c;const u=t.externalColor&&t.externalColor[3]>=be;return i?l?u:c:n?l||c:l?u:c}get hasEmissions(){return!!this.parameters.emissiveTextureId||!fi(this.parameters.emissiveFactor,Ke)}getConfiguration(t,r){const i=this.parameters,{treeRendering:o,doubleSided:a,doubleSidedType:n}=i;return this._configuration.output=t,this._configuration.hasNormalTexture=!o&&!!i.normalTextureId,this._configuration.hasColorTexture=!!i.textureId,this._configuration.hasVertexTangents=!o&&i.hasVertexTangents,this._configuration.instanced=i.isInstanced,this._configuration.instancedDoublePrecision=i.instancedDoublePrecision,this._configuration.vvSize=!!i.vvSize,this._configuration.hasVerticalOffset=i.verticalOffset!=null,this._configuration.hasScreenSizePerspective=i.screenSizePerspective!=null,this._configuration.hasSlicePlane=i.hasSlicePlane,this._configuration.hasSliceHighlight=i.hasSliceHighlight,this._configuration.alphaDiscardMode=i.textureAlphaMode,this._configuration.normalType=o?Q.Attribute:i.normalType,this._configuration.transparent=i.transparent,this._configuration.writeDepth=i.writeDepth,i.customDepthTest!=null&&(this._configuration.customDepthTest=i.customDepthTest),this._configuration.hasOccludees=r.hasOccludees,this._configuration.cullFace=i.hasSlicePlane?Tt.None:i.cullFace,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasModelTransformation=!o&&i.modelTransformation!=null,this._configuration.hasVertexColors=i.hasVertexColors,this._configuration.hasSymbolColors=i.hasSymbolColors,this._configuration.doubleSidedMode=o?re.WindingOrder:a&&n==="normal"?re.View:a&&n==="winding-order"?re.WindingOrder:re.None,this._configuration.instancedColor=i.hasInstancedColor,this._configuration.receiveShadows=i.receiveShadows&&i.receiveShadows,this._configuration.receiveAmbientOcclusion=i.receiveAmbientOcclusion&&r.ssao!=null,this._configuration.vvColor=!!i.vvColor,this._configuration.textureAlphaPremultiplied=!!i.textureAlphaPremultiplied,this._configuration.pbrMode=i.usePBR?i.isSchematic?N.Schematic:N.Normal:N.Disabled,this._configuration.hasMetallicRoughnessTexture=!o&&!!i.metallicRoughnessTextureId,this._configuration.emissionSource=o?se.None:i.emissiveTextureId!=null?se.Texture:i.usePBR?se.Value:se.None,this._configuration.hasOcclusionTexture=!o&&!!i.occlusionTextureId,this._configuration.offsetBackfaces=!(!i.transparent||!i.offsetTransparentBackfaces),this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation=1),W(i.size===3||i.size===4);const{data:o,size:a,indices:n}=i;W(n.length%this._numIndexPerPrimitive==0),W(n.length>=t.length*this._numIndexPerPrimitive);const l=t.length;let c=a*n[this._numIndexPerPrimitive*t[0]];Re.clear(),Re.push(c);const u=It(o[c],o[c+1],o[c+2]),d=Ro(u);for(let f=0;f0&&++c;if(c<2)return;const u=new Array(8);for(let d=0;d<8;++d)u[d]=o[d]>0?new Uint32Array(o[d]):void 0;for(let d=0;d<8;++d)o[d]=0;for(let d=0;d=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+i*this._buffer.BYTES_PER_ELEMENT)*Ge,this._buffer.BYTES_PER_ELEMENT),t=new ArrayBuffer(e),r=new this._ctor(t);r.set(this._buffer,0),this._array=t,this._buffer=r,this._i16View=new Int16Array(this._array)}}ensureSize(i){this._ensureSize(i)}writeF32(i){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=i,this._pos++,e}push(i){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=i,e}writeFixed(i){this._buffer[this._pos++]=i}setValue(i,e){this._buffer[i]=e}i1616Add(i,e,t){this._i16View[2*i]+=e,this._i16View[2*i+1]+=t}getValue(i){return this._buffer[i]}getValueF32(i){return new Float32Array(this._array,4*i,1)[0]}incr(i){if(this._buffer.lengtha.name==="pos"||a.name==="position");if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...e,position:o},this._indices=new v(Uint32Array,r),this._vertices=new v(Uint32Array,s),this._metrics=new v(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=i}serialize(i){const e=this._indices.buffer(),t=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null;return i.push(e,t),{instanceId:this._instanceId,layout:this.layout,indices:e,vertices:t,metrics:r}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(i){this._vertices.ensureSize(i)}indexEnsureSize(i){this._indices.ensureSize(i)}writeIndex(i){this._indices.push(i)}writeVertex(i){this._vertices.push(i)}writeVertexRegion(i){this._vertices.writeRegion(i)}writeVertexF32(i){this._vertices.writeF32(i)}writeMetric(i){this._metrics.incr(this._metricCountOffset),i.serialize(this._metrics)}},Et=class{constructor(i,e=0){this._id=i,this._sizeHint=e,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new v(Uint32Array,this._sizeHint*ne.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const i=new Array,e=[],t=this._entities.buffer();for(const r of this._instanceIdToVertexData.values())e.push(r.serialize(i));return{message:{data:e,entities:t},transferList:i}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(i){this._current.writer.vertexEnsureSize(i)}indexEnsureSize(i){this._current.writer.indexEnsureSize(i)}vertexWrite(i){this._current.writer.writeVertex(i)}vertexWriteRegion(i){this._current.writer.writeVertexRegion(i)}vertexWriteF32(i){this._current.writer.writeVertexF32(i)}recordBounds(i,e,t,r){}indexWrite(i){this._current.writer.writeIndex(i)}metricStart(i){this._current.metric=i}metricEnd(){const i=this._current.writer;this._current.metric.bounds.length&&i.writeMetric(this._current.metric)}metricBoxWrite(i){this._current.metric.bounds.push(i)}entityStart(i,e=i){this._entityIdIndex=this._entities.push(i),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(i,e,t=0){this._current.writer=this._getVertexWriter(i,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=i,this._current.layoutHash=e.hash,this._current.textureKey=t}recordEnd(i=0){const e=this._current.vertexStart,t=this._current.writer.vertexCount-e;if(!t)return!1;const r=this._current.indexStart,s=this._current.writer.indexCount-r;return this._recordIndexStart=r,this._recordIndexCount=s,this._recordVertexStart=e,this._recordVertexCount=t,this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,r,s,e,t,i),!0}copyLast(i,e){const t=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,t,this._recordVertexCount,0);const r=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let _=this._recordIndexStart;_!==n;_++){const l=r.getValue(_);r.push(l+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*a,d=(this._recordVertexStart+this._recordVertexCount)*a;for(let _=h;_!==d;_++){const l=s.getValue(_);s.push(l)}const u=this._current.writer.layout.position,y=u.packPrecisionFactor??1,p=u.offset/Uint32Array.BYTES_PER_ELEMENT,x=i*y,f=e*y;for(let _=t*a;_<=s.length;_+=a)s.i1616Add(_+p,x,f)}copyLastFrom(i,e,t){const r=i._entities.getValue(i._entityIdIndex);if(r!==this._entities.getValue(this._entityIdIndex)){const l=i._entities.getValueF32(i._entitySortKeyIndex);this.entityStart(r,l)}this.recordStart(i._current.instanceId,i._current.writer.layout,i._current.textureKey);const s=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=i._current.vertexStart-n,a=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,d=i._current.writer.indexWriter,u=i._current.writer.vertexWriter;for(let l=i._current.indexStart;l!==d.length;l++){const O=d.getValue(l);a.push(O-o)}for(let l=i._current.vertexStart*s;l!==u.length;l++){const O=u.getValue(l);h.push(O)}const y=this._current.writer.layout.position,p=y.packPrecisionFactor??1,x=y.offset/Uint32Array.BYTES_PER_ELEMENT,f=e*p,_=t*p;for(let l=n*s;l<=h.length;l+=s)h.i1616Add(l+x,f,_);this.recordEnd()}_getVertexWriter(i,e){const t=this._instanceIdToVertexData;return t.has(i)||t.set(i,new ke(i,e,this._sizeHint)),t.get(i)}},Ne=class{},Ct=class extends Ne{constructor(i){super(),this._fetcher=i,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(i){const e=oe(i.resource),t=q(JSON.stringify(e));return this._pendingIds.has(t)||(this._pendingIds.add(t),this._pendingRequests.push({...i,resourceId:t})),t}async fetchEnqueuedResources(){const i=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const e=await this._fetcher.fetch(i,this._abortOptions);for(let t=0;t>>=1,s++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}},We=class{constructor(i){this._valid=W.create(i),this._data=new Array(i)}has(i){return this._valid.has(i)}set(i,e){this._valid.set(i),this._data[i]=e}get(i){return this._data[i]}};const M=m("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],Le=M[0],Pe=M[1],Ue=M[2],Ye=M[3],L=m("featurelayer-simplify-payload-size-factors")??[1,2,4],$e=L[0],Ze=L[1],He=L[2],Xe=m("featurelayer-simplify-mobile-factor")??2,Je=m("esri-mobile"),Q=4294967295;function Qe(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}class At{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=Je?Xe:1;t>4e6?r=He*s:t>1e6?r=Ze*s:t>5e5?r=$e*s:t>1e5&&(r=s);let n=0;return e>4e3?n=Ye*r:e>2e3?n=Ue*r:e>100?n=Pe:e>15&&(n=Le),n}getBounds(e){if(Qe(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===Q)return!1;if(this.getBoundsXMin()===0){const o=this.readGeometryWorldSpace();if(!o)return this.setBoundsXMin(Q),!1;let a=1/0,h=1/0,d=-1/0,u=-1/0;return o.forEachVertex((y,p)=>{a=Math.min(a,y),h=Math.min(h,p),d=Math.max(d,y),u=Math.max(u,p)}),this.setBoundsXMin(a),this.setBoundsYMin(h),this.setBoundsXMax(d),this.setBoundsYMax(u),j(e,a,h,d,u),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),n=this.getBoundsYMax();return j(e,t,r,s,n),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const s of this._joined){s.setIndex(this.getIndex());const n=s._readAttribute(e,t);if(n!==void 0)return n}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const s of Object.keys(r))e[s]=r[s]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,s=this.getCursor();for(;s.next();){const n=s.getObjectId();_e(n),r.set(n,s.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new ze(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return R(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&H(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return s!=null&&H(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new We(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=R(e,this.geometryType,this.hasZ,this.hasM),r=fe(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?F.unknownDateJSToArcadeDate(t):F.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??ye):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===pe}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const n=r.attributes[s];n instanceof Date&&(r.attributes[s]=n.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return ve(new E,e,this.hasM,this.hasZ);const t=Fe.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=Ee(t);return r?(r[1]*=-1,new E([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return R(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new E([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new E([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=W.create(this.getSize())),this._deleted.set(e)}}let Ke=class extends B{constructor(i){super(),this._field=i}resize(i){throw new Error("Method not implemented.")}read(i,e){return i.readAttribute(this._field)}readWithDefault(i,e){return i.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}},qe=class te extends B{static async create(e,t){const r=await he(e,t.spatialReference,t.fields),s=q(e);return new te(r,s)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.referencesScale()||t.$view.timeZone!=="system"?X(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.referencesScale()||t.$view.timeZone!=="system"?J(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(e,t){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const r=X(this._compiled,e,t);return e.setCachedValue(r),r}_readWithDefaultCached(e,t,r){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const s=J(this._compiled,e,t,r);return e.setCachedValue(s),s}};function et(i,e){if(i==null)return"";const t=e.domain;if(t){if(t.type==="codedValue"||t.type==="coded-value"){const s=i;for(const n of t.codedValues)if(n.code===s)return n.name}else if(t.type==="range"){const{max:s,min:n}=me(e),o=+i;if(n!=null&&s!=null&&n<=o&&o<=s)return t.name}}let r=i;return ge(e)?r=be(r,xe("short-date")):Ie(e)&&(r=we(+r)),r||""}let tt=class ie extends B{static async create(e,t){const r=De(e);return new ie(s=>r.replaceAll(/{[^}]*}/g,n=>{const o=n.slice(1,-1),a=s.metadata.fieldsIndex.get(o);if(a==null)return n;const h=s.readAttribute(o);return h==null?"":et(h,a)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const s=this._evaluator(e);return ee(s)?r:s}referencesScale(){return!1}referencesGeometry(){return!1}};class it extends B{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:s,normalizationType:n}=this._normalizationInfo,o=e.readAttribute(r);switch(n??"esriNormalizeByField"){case"esriNormalizeByField":return o?o?t/o:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return s?t/s*100:null}}}const V=()=>T.getLogger("esri.views.2d.layers.features.support.whereUtils"),rt={getAttribute:(i,e)=>i.readAttribute(e)};async function re(i,e){try{const t=await ue(i,e);if(!t.isStandardized){const r=new S("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);V().error(r)}return r=>{const s=r.readArcadeFeature();try{return t.testFeature(s,rt)}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),!0}}}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),t=>!0}}const K=()=>T.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),g=4294967295;function A(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let vt=class{constructor(i){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=i}createBitset(){const i=this._bitsets.length;return this._bitsets.push(W.create(this._allocatedSize,c)),i+1}async createComputedField(i,e=!1){if(i.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return e?await tt.create(i.expression,this.compilationOptions):await qe.create(i.expression,this.compilationOptions)}catch(r){const s=new S("featurelayer","Failed to compile arcade expression",{error:r,expression:i.expression});return K().error(s),null}if(i.normalizationType||i.normalizationField)return new it(i.field,i);if(i.field)return new Ke(i.field);const t=new S("featurelayer","Unable to create computed field. No expression or field found",{info:i});return K().error(t),null}async createWhereClause(i){return i?re(i,this.compilationOptions.fields):null}getBitset(i){return this._bitsets[i-1]}getComputedNumeric(i,e){return this.getComputedNumericAtIndex(i&c,0)}setComputedNumeric(i,e,t){return this.setComputedNumericAtIndex(i&c,t,0)}getComputedString(i,e){return this.getComputedStringAtIndex(i&c,0)}setComputedString(i,e,t){return this.setComputedStringAtIndex(i&c,0,t)}getComputedNumericAtIndex(i,e){const t=i&c;return this._ensureNumeric(e,t),this._numerics[e][t]}setComputedNumericAtIndex(i,e,t){const r=i&c;this._ensureNumeric(e,r),this._numerics[e][r]=t}getPackedChunkId(i){const e=i&c;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(i,e){const t=i&c;this._ensureInstanceId(t),this._instanceIds[t]=e}getComputedStringAtIndex(i,e){const t=i&c;return this._ensureString(e,t),this._strings[e][t]}setComputedStringAtIndex(i,e,t){const r=i&c;this._ensureString(e,r),this._strings[e][r]=t}getXMin(i){return this._bounds[4*(i&c)]}getYMin(i){return this._bounds[4*(i&c)+1]}getXMax(i){return this._bounds[4*(i&c)+2]}getYMax(i){return this._bounds[4*(i&c)+3]}setBounds(i,e,t=!1){const r=i&c;if(!t&&!this._dirtyBitset.has(i))return this._bounds[4*r]!==g;this._dirtyBitset.unset(i);const s=e.readGeometryWorldSpace();if(A(this._bounds,4*r+4,0),!s||!s.coords.length)return this._bounds[4*r]=g,this._bounds[4*r+1]=g,this._bounds[4*r+2]=g,this._bounds[4*r+3]=g,!1;let n=1/0,o=1/0,a=-1/0,h=-1/0;return s.forEachVertex((d,u)=>{n=Math.min(n,d),o=Math.min(o,u),a=Math.max(a,d),h=Math.max(h,u)}),this._bounds[4*r]=n,this._bounds[4*r+1]=o,this._bounds[4*r+2]=a,this._bounds[4*r+3]=h,!0}getBounds(i,e){const t=this.getXMin(e),r=this.getYMin(e),s=this.getXMax(e),n=this.getYMax(e);return j(i,t,r,s,n),t!==g}_ensureNumeric(i,e){this._numerics[i]||(this._numerics[i]=[]),A(this._numerics[i],e,0)}_ensureInstanceId(i){A(this._instanceIds,i,0)}_ensureString(i,e){this._strings[i]||(this._strings[i]=[]),A(this._strings[i],e,null)}},N=class{getObjectId(i){return i.getObjectId()}getAttributes(i){return i.readAttributes()}getAttribute(i,e){return i.readAttribute(e)}getAttributeAsTimestamp(i,e){return i.readAttributeAsTimestamp(e)}cloneWithGeometry(i,e){return i}getGeometry(i){return i.readGeometryWorldSpace()}getCentroid(i,e){return i.readCentroidForDisplay()}};N.Shared=new N;const w=1,st=2;class P{constructor(e){this._geometryBounds=de(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new P(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,w)}setTrue(e){const t=[],r=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const a=!!(this._idToVisibility.get(o)&w),h=s.has(o);!a&&h?t.push(o):a&&!h&&r.push(o),this._idToVisibility.set(o,h?w|st:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n}=this;return Re.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const r=await Oe(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await re(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",s=await Ce(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);le(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=Ae(this._serviceInfo.timeInfo,e.timeExtent,N.Shared);else{const t=new S("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);T.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&w||(this._idToVisibility.set(r,w),e.push(r))}),e}}class D{static minimal(e,t,r=[]){return new D({geometryType:e,fieldsIndex:new k(r).toJSON(),objectIdField:t,subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null})}static createFeature(e){return new D(e)}constructor(e){this._options=e,this._fieldsIndex=k.fromJSON(e.fieldsIndex),e.spatialReference&&(this._spatialReference=ce.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType==="esriGeometryMultiPatch"?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}let zt=class se extends D{static createGraphics(e){return new se({fieldsIndex:new k().toJSON(),objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}};const nt=(i,e)=>()=>null,ot=!1;class at{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}}class ht{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new at(Te(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return t!=null?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}function ut(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const U=()=>T.getLogger("esri.views.layers.2d.features.support.AttributeStore"),dt=nt(ot,U());m("esri-shared-array-buffer"),m("esri-atomics");class lt{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:n,textureOnly:o}=t;this.textureOnly=o||!1,this.pixelType=s,this.layout=n,this._resetRange(),this.size=e,this.isLocal=r,o||(this.data=this._initData(s,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let s=0;st)return null;this._resetRange();const s=!this.isLocal,n=this.pixelType,o=this.layout,a=this.data;return{start:e,end:t,data:s&&a.slice(e*r,(t+1)*r)||null,pixelType:n,layout:o}}_initData(e,t){const r=ArrayBuffer,s=ae(e),n=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let o=0;onull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,s,n=0){const o=Be(this._schema,e);if(this.version=n,o&&(m("esri-2d-update-debug")&&console.debug(`Version[${n}] AttributeStore.update`,{changed:o}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(a=>a?P.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:s??r.spatialReference,filterJSON:a}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async a=>{const h=await this._bind(t,a);this._referencesGeometry=this._referencesGeometry||(h?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(h?.referencesScale()??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const a in e.bindings){const h=e.bindings[a];await Promise.all(h.map(async d=>{const u=await this._bind(t,d,parseInt(a,10));this._referencesGeometry=this._referencesGeometry||(u?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(u?.referencesScale()??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{const y=u*o%a,p=Math.floor(u*o/a),x=this._getBlock(p+C.VV);let f=d.field?.read(t,r);d.valueRepresentation&&(f=ut(f,d.valueRepresentation)),(f===null||isNaN(f)||f===1/0||f===-1/0)&&(f=Se),x.setData(s,y,f)}))}get epoch(){return this._epoch}sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const s=await e.createComputedField(t),{valueRepresentation:n}=t,o=this._attributeComputeInfo;if(o.isSubtype){const a=o.map.get(r)??new Map;a.set(t.binding,{field:s,valueRepresentation:n}),o.map.set(r,a)}else o.map.set(t.binding,{field:s,valueRepresentation:n});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(C.Animation),this._getBlock(C.GPGPU),this._getBlock(C.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;const r=new lt(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._size=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+i*this._buffer.BYTES_PER_ELEMENT)*Ge,this._buffer.BYTES_PER_ELEMENT),t=new ArrayBuffer(e),r=new this._ctor(t);r.set(this._buffer,0),this._array=t,this._buffer=r,this._i16View=new Int16Array(this._array)}}ensureSize(i){this._ensureSize(i)}writeF32(i){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=i,this._pos++,e}push(i){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=i,e}writeFixed(i){this._buffer[this._pos++]=i}setValue(i,e){this._buffer[i]=e}i1616Add(i,e,t){this._i16View[2*i]+=e,this._i16View[2*i+1]+=t}getValue(i){return this._buffer[i]}getValueF32(i){return new Float32Array(this._array,4*i,1)[0]}incr(i){if(this._buffer.lengtha.name==="pos"||a.name==="position");if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...e,position:o},this._indices=new v(Uint32Array,r),this._vertices=new v(Uint32Array,s),this._metrics=new v(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=i}serialize(i){const e=this._indices.buffer(),t=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null;return i.push(e,t),{instanceId:this._instanceId,layout:this.layout,indices:e,vertices:t,metrics:r}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(i){this._vertices.ensureSize(i)}indexEnsureSize(i){this._indices.ensureSize(i)}writeIndex(i){this._indices.push(i)}writeVertex(i){this._vertices.push(i)}writeVertexRegion(i){this._vertices.writeRegion(i)}writeVertexF32(i){this._vertices.writeF32(i)}writeMetric(i){this._metrics.incr(this._metricCountOffset),i.serialize(this._metrics)}},Et=class{constructor(i,e=0){this._id=i,this._sizeHint=e,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new v(Uint32Array,this._sizeHint*ne.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const i=new Array,e=[],t=this._entities.buffer();for(const r of this._instanceIdToVertexData.values())e.push(r.serialize(i));return{message:{data:e,entities:t},transferList:i}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(i){this._current.writer.vertexEnsureSize(i)}indexEnsureSize(i){this._current.writer.indexEnsureSize(i)}vertexWrite(i){this._current.writer.writeVertex(i)}vertexWriteRegion(i){this._current.writer.writeVertexRegion(i)}vertexWriteF32(i){this._current.writer.writeVertexF32(i)}recordBounds(i,e,t,r){}indexWrite(i){this._current.writer.writeIndex(i)}metricStart(i){this._current.metric=i}metricEnd(){const i=this._current.writer;this._current.metric.bounds.length&&i.writeMetric(this._current.metric)}metricBoxWrite(i){this._current.metric.bounds.push(i)}entityStart(i,e=i){this._entityIdIndex=this._entities.push(i),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(i,e,t=0){this._current.writer=this._getVertexWriter(i,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=i,this._current.layoutHash=e.hash,this._current.textureKey=t}recordEnd(i=0){const e=this._current.vertexStart,t=this._current.writer.vertexCount-e;if(!t)return!1;const r=this._current.indexStart,s=this._current.writer.indexCount-r;return this._recordIndexStart=r,this._recordIndexCount=s,this._recordVertexStart=e,this._recordVertexCount=t,this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,r,s,e,t,i),!0}copyLast(i,e){const t=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,t,this._recordVertexCount,0);const r=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let _=this._recordIndexStart;_!==n;_++){const l=r.getValue(_);r.push(l+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*a,d=(this._recordVertexStart+this._recordVertexCount)*a;for(let _=h;_!==d;_++){const l=s.getValue(_);s.push(l)}const u=this._current.writer.layout.position,y=u.packPrecisionFactor??1,p=u.offset/Uint32Array.BYTES_PER_ELEMENT,x=i*y,f=e*y;for(let _=t*a;_<=s.length;_+=a)s.i1616Add(_+p,x,f)}copyLastFrom(i,e,t){const r=i._entities.getValue(i._entityIdIndex);if(r!==this._entities.getValue(this._entityIdIndex)){const l=i._entities.getValueF32(i._entitySortKeyIndex);this.entityStart(r,l)}this.recordStart(i._current.instanceId,i._current.writer.layout,i._current.textureKey);const s=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=i._current.vertexStart-n,a=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,d=i._current.writer.indexWriter,u=i._current.writer.vertexWriter;for(let l=i._current.indexStart;l!==d.length;l++){const O=d.getValue(l);a.push(O-o)}for(let l=i._current.vertexStart*s;l!==u.length;l++){const O=u.getValue(l);h.push(O)}const y=this._current.writer.layout.position,p=y.packPrecisionFactor??1,x=y.offset/Uint32Array.BYTES_PER_ELEMENT,f=e*p,_=t*p;for(let l=n*s;l<=h.length;l+=s)h.i1616Add(l+x,f,_);this.recordEnd()}_getVertexWriter(i,e){const t=this._instanceIdToVertexData;return t.has(i)||t.set(i,new ke(i,e,this._sizeHint)),t.get(i)}},Ne=class{},Ct=class extends Ne{constructor(i){super(),this._fetcher=i,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(i){const e=oe(i.resource),t=q(JSON.stringify(e));return this._pendingIds.has(t)||(this._pendingIds.add(t),this._pendingRequests.push({...i,resourceId:t})),t}async fetchEnqueuedResources(){const i=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const e=await this._fetcher.fetch(i,this._abortOptions);for(let t=0;t>>=1,s++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}},We=class{constructor(i){this._valid=W.create(i),this._data=new Array(i)}has(i){return this._valid.has(i)}set(i,e){this._valid.set(i),this._data[i]=e}get(i){return this._data[i]}};const M=m("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],Le=M[0],Pe=M[1],Ue=M[2],Ye=M[3],L=m("featurelayer-simplify-payload-size-factors")??[1,2,4],$e=L[0],Ze=L[1],He=L[2],Xe=m("featurelayer-simplify-mobile-factor")??2,Je=m("esri-mobile"),Q=4294967295;function Qe(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}class At{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=Je?Xe:1;t>4e6?r=He*s:t>1e6?r=Ze*s:t>5e5?r=$e*s:t>1e5&&(r=s);let n=0;return e>4e3?n=Ye*r:e>2e3?n=Ue*r:e>100?n=Pe:e>15&&(n=Le),n}getBounds(e){if(Qe(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===Q)return!1;if(this.getBoundsXMin()===0){const o=this.readGeometryWorldSpace();if(!o)return this.setBoundsXMin(Q),!1;let a=1/0,h=1/0,d=-1/0,u=-1/0;return o.forEachVertex((y,p)=>{a=Math.min(a,y),h=Math.min(h,p),d=Math.max(d,y),u=Math.max(u,p)}),this.setBoundsXMin(a),this.setBoundsYMin(h),this.setBoundsXMax(d),this.setBoundsYMax(u),j(e,a,h,d,u),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),n=this.getBoundsYMax();return j(e,t,r,s,n),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const s of this._joined){s.setIndex(this.getIndex());const n=s._readAttribute(e,t);if(n!==void 0)return n}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const s of Object.keys(r))e[s]=r[s]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,s=this.getCursor();for(;s.next();){const n=s.getObjectId();_e(n),r.set(n,s.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new ze(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return R(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&H(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return s!=null&&H(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new We(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=R(e,this.geometryType,this.hasZ,this.hasM),r=fe(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?F.unknownDateJSToArcadeDate(t):F.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??ye):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===pe}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const n=r.attributes[s];n instanceof Date&&(r.attributes[s]=n.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return ve(new E,e,this.hasM,this.hasZ);const t=Fe.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=Ee(t);return r?(r[1]*=-1,new E([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return R(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new E([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new E([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=W.create(this.getSize())),this._deleted.set(e)}}let Ke=class extends B{constructor(i){super(),this._field=i}resize(i){throw new Error("Method not implemented.")}read(i,e){return i.readAttribute(this._field)}readWithDefault(i,e){return i.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}},qe=class te extends B{static async create(e,t){const r=await he(e,t.spatialReference,t.fields),s=q(e);return new te(r,s)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.referencesScale()||t.$view.timeZone!=="system"?X(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.referencesScale()||t.$view.timeZone!=="system"?J(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(e,t){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const r=X(this._compiled,e,t);return e.setCachedValue(r),r}_readWithDefaultCached(e,t,r){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const s=J(this._compiled,e,t,r);return e.setCachedValue(s),s}};function et(i,e){if(i==null)return"";const t=e.domain;if(t){if(t.type==="codedValue"||t.type==="coded-value"){const s=i;for(const n of t.codedValues)if(n.code===s)return n.name}else if(t.type==="range"){const{max:s,min:n}=me(e),o=+i;if(n!=null&&s!=null&&n<=o&&o<=s)return t.name}}let r=i;return ge(e)?r=be(r,xe("short-date")):Ie(e)&&(r=we(+r)),r||""}let tt=class ie extends B{static async create(e,t){const r=De(e);return new ie(s=>r.replaceAll(/{[^}]*}/g,n=>{const o=n.slice(1,-1),a=s.metadata.fieldsIndex.get(o);if(a==null)return n;const h=s.readAttribute(o);return h==null?"":et(h,a)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const s=this._evaluator(e);return ee(s)?r:s}referencesScale(){return!1}referencesGeometry(){return!1}};class it extends B{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:s,normalizationType:n}=this._normalizationInfo,o=e.readAttribute(r);switch(n??"esriNormalizeByField"){case"esriNormalizeByField":return o?o?t/o:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return s?t/s*100:null}}}const V=()=>T.getLogger("esri.views.2d.layers.features.support.whereUtils"),rt={getAttribute:(i,e)=>i.readAttribute(e)};async function re(i,e){try{const t=await ue(i,e);if(!t.isStandardized){const r=new S("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);V().error(r)}return r=>{const s=r.readArcadeFeature();try{return t.testFeature(s,rt)}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),!0}}}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),t=>!0}}const K=()=>T.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),g=4294967295;function A(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let vt=class{constructor(i){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=i}createBitset(){const i=this._bitsets.length;return this._bitsets.push(W.create(this._allocatedSize,c)),i+1}async createComputedField(i,e=!1){if(i.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return e?await tt.create(i.expression,this.compilationOptions):await qe.create(i.expression,this.compilationOptions)}catch(r){const s=new S("featurelayer","Failed to compile arcade expression",{error:r,expression:i.expression});return K().error(s),null}if(i.normalizationType||i.normalizationField)return new it(i.field,i);if(i.field)return new Ke(i.field);const t=new S("featurelayer","Unable to create computed field. No expression or field found",{info:i});return K().error(t),null}async createWhereClause(i){return i?re(i,this.compilationOptions.fields):null}getBitset(i){return this._bitsets[i-1]}getComputedNumeric(i,e){return this.getComputedNumericAtIndex(i&c,0)}setComputedNumeric(i,e,t){return this.setComputedNumericAtIndex(i&c,t,0)}getComputedString(i,e){return this.getComputedStringAtIndex(i&c,0)}setComputedString(i,e,t){return this.setComputedStringAtIndex(i&c,0,t)}getComputedNumericAtIndex(i,e){const t=i&c;return this._ensureNumeric(e,t),this._numerics[e][t]}setComputedNumericAtIndex(i,e,t){const r=i&c;this._ensureNumeric(e,r),this._numerics[e][r]=t}getPackedChunkId(i){const e=i&c;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(i,e){const t=i&c;this._ensureInstanceId(t),this._instanceIds[t]=e}getComputedStringAtIndex(i,e){const t=i&c;return this._ensureString(e,t),this._strings[e][t]}setComputedStringAtIndex(i,e,t){const r=i&c;this._ensureString(e,r),this._strings[e][r]=t}getXMin(i){return this._bounds[4*(i&c)]}getYMin(i){return this._bounds[4*(i&c)+1]}getXMax(i){return this._bounds[4*(i&c)+2]}getYMax(i){return this._bounds[4*(i&c)+3]}setBounds(i,e,t=!1){const r=i&c;if(!t&&!this._dirtyBitset.has(i))return this._bounds[4*r]!==g;this._dirtyBitset.unset(i);const s=e.readGeometryWorldSpace();if(A(this._bounds,4*r+4,0),!s||!s.coords.length)return this._bounds[4*r]=g,this._bounds[4*r+1]=g,this._bounds[4*r+2]=g,this._bounds[4*r+3]=g,!1;let n=1/0,o=1/0,a=-1/0,h=-1/0;return s.forEachVertex((d,u)=>{n=Math.min(n,d),o=Math.min(o,u),a=Math.max(a,d),h=Math.max(h,u)}),this._bounds[4*r]=n,this._bounds[4*r+1]=o,this._bounds[4*r+2]=a,this._bounds[4*r+3]=h,!0}getBounds(i,e){const t=this.getXMin(e),r=this.getYMin(e),s=this.getXMax(e),n=this.getYMax(e);return j(i,t,r,s,n),t!==g}_ensureNumeric(i,e){this._numerics[i]||(this._numerics[i]=[]),A(this._numerics[i],e,0)}_ensureInstanceId(i){A(this._instanceIds,i,0)}_ensureString(i,e){this._strings[i]||(this._strings[i]=[]),A(this._strings[i],e,null)}},N=class{getObjectId(i){return i.getObjectId()}getAttributes(i){return i.readAttributes()}getAttribute(i,e){return i.readAttribute(e)}getAttributeAsTimestamp(i,e){return i.readAttributeAsTimestamp(e)}cloneWithGeometry(i,e){return i}getGeometry(i){return i.readGeometryWorldSpace()}getCentroid(i,e){return i.readCentroidForDisplay()}};N.Shared=new N;const w=1,st=2;class P{constructor(e){this._geometryBounds=de(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new P(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,w)}setTrue(e){const t=[],r=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const a=!!(this._idToVisibility.get(o)&w),h=s.has(o);!a&&h?t.push(o):a&&!h&&r.push(o),this._idToVisibility.set(o,h?w|st:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n}=this;return Re.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const r=await Oe(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await re(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",s=await Ce(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);le(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=Ae(this._serviceInfo.timeInfo,e.timeExtent,N.Shared);else{const t=new S("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);T.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&w||(this._idToVisibility.set(r,w),e.push(r))}),e}}class D{static minimal(e,t,r=[]){return new D({geometryType:e,fieldsIndex:new k(r).toJSON(),objectIdField:t,subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null})}static createFeature(e){return new D(e)}constructor(e){this._options=e,this._fieldsIndex=k.fromJSON(e.fieldsIndex),e.spatialReference&&(this._spatialReference=ce.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType==="esriGeometryMultiPatch"?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}let zt=class se extends D{static createGraphics(e){return new se({fieldsIndex:new k().toJSON(),objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}};const nt=(i,e)=>()=>null,ot=!1;class at{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}}class ht{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new at(Te(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return t!=null?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}function ut(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const U=()=>T.getLogger("esri.views.layers.2d.features.support.AttributeStore"),dt=nt(ot,U());m("esri-shared-array-buffer"),m("esri-atomics");class lt{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:n,textureOnly:o}=t;this.textureOnly=o||!1,this.pixelType=s,this.layout=n,this._resetRange(),this.size=e,this.isLocal=r,o||(this.data=this._initData(s,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let s=0;st)return null;this._resetRange();const s=!this.isLocal,n=this.pixelType,o=this.layout,a=this.data;return{start:e,end:t,data:s&&a.slice(e*r,(t+1)*r)||null,pixelType:n,layout:o}}_initData(e,t){const r=ArrayBuffer,s=ae(e),n=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let o=0;onull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,s,n=0){const o=Be(this._schema,e);if(this.version=n,o&&(m("esri-2d-update-debug")&&console.debug(`Version[${n}] AttributeStore.update`,{changed:o}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(a=>a?P.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:s??r.spatialReference,filterJSON:a}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async a=>{const h=await this._bind(t,a);this._referencesGeometry=this._referencesGeometry||(h?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(h?.referencesScale()??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const a in e.bindings){const h=e.bindings[a];await Promise.all(h.map(async d=>{const u=await this._bind(t,d,parseInt(a,10));this._referencesGeometry=this._referencesGeometry||(u?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(u?.referencesScale()??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{const y=u*o%a,p=Math.floor(u*o/a),x=this._getBlock(p+C.VV);let f=d.field?.read(t,r);d.valueRepresentation&&(f=ut(f,d.valueRepresentation)),(f===null||isNaN(f)||f===1/0||f===-1/0)&&(f=Se),x.setData(s,y,f)}))}get epoch(){return this._epoch}sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const s=await e.createComputedField(t),{valueRepresentation:n}=t,o=this._attributeComputeInfo;if(o.isSubtype){const a=o.map.get(r)??new Map;a.set(t.binding,{field:s,valueRepresentation:n}),o.map.set(r,a)}else o.map.set(t.binding,{field:s,valueRepresentation:n});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(C.Animation),this._getBlock(C.GPGPU),this._getBlock(C.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;const r=new lt(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._size{e(i)||a.getLogger(this).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this._strategy=new g({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(r,i,m){return this.layer.fetchImageBitmap(r,i,m)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};o([p()],t.prototype,"_strategy",void 0),o([p()],t.prototype,"updating",void 0),t=o([s("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const $t=t;export{$t as default}; diff --git a/main/assets/BaseDynamicLayerView2D-AQ-6l0DU-Cy76IH9A.js b/main/assets/BaseDynamicLayerView2D-AQ-6l0DU-Cy76IH9A.js deleted file mode 100644 index 9421ccc80..000000000 --- a/main/assets/BaseDynamicLayerView2D-AQ-6l0DU-Cy76IH9A.js +++ /dev/null @@ -1 +0,0 @@ -import{aU as e,a1 as a,v as o,S as p,i as s}from"./main-BZaw9FpY.js";import{d as n}from"./BitmapContainer-BC8fvmFc-DzZ9OrT1.js";import{X as h,Y as d}from"./LayerView-Bish-E63-DRGspiuk.js";import{K as g}from"./ExportStrategy-BNE7Gp0u-CVNDsUmZ.js";import{n as u}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./signal-CETehA7D-vStzfbaY.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./Bitmap-CcqmzvfR-Cl_blWW9.js";let t=class extends u(h(d)){update(r){this._strategy.update(r).catch(i=>{e(i)||a.getLogger(this).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this._strategy=new g({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(r,i,m){return this.layer.fetchImageBitmap(r,i,m)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};o([p()],t.prototype,"_strategy",void 0),o([p()],t.prototype,"updating",void 0),t=o([s("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const $t=t;export{$t as default}; diff --git a/main/assets/Basemap-BEqqSTw9-BkQ-c4vY.js b/main/assets/Basemap-BEqqSTw9-BkQ-c4vY.js deleted file mode 100644 index cdfdac5fb..000000000 --- a/main/assets/Basemap-BEqqSTw9-BkQ-c4vY.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersCreator-CW56kDKc-gpROgX1S.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./portalLayers-Bh9bAhk4-BaKPDASj.js","./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./fetchService-DbaKmJhP-CtznRt8p.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js"])))=>i.map(i=>d[i]); -import{bw as t,v as l,bA as A,ag as h,a1 as u,aA as O,am as S,da as L,P as k,db as f,$ as T,_ as D,a as M,r as I,f as B,S as c,ac as V,bq as W,i as G,J as R,j,h as H,dc as N,aB as C}from"./main-BZaw9FpY.js";import{y as P}from"./loadAll-e978YItg-CB-7_cng.js";import x from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import{y as w}from"./writeUtils-D5qlLkwk-DIX6zS6N.js";async function E(e){if(!e)return;const r=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,s=await W("esri/t9n/basemaps");return s[e]||s[r]}const F={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return t("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return t("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return t("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return t("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return t("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return t("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return t("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return t("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return t("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return t("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},$=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let y=class extends j{constructor(e){super(e),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const e=H().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const r=N(e);return r==="pt"?"pt-BR":r&&$.has(r)?r:"global"}};l([c()],y.prototype,"apiKey",void 0),l([c()],y.prototype,"id",void 0),l([c()],y.prototype,"language",void 0),l([c()],y.prototype,"places",void 0),l([c()],y.prototype,"serviceUrl",void 0),l([c()],y.prototype,"worldview",void 0),y=l([G("esri.support.BasemapStyle")],y);const z=y;var d;let J=0,p=d=class extends A(C){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+J++,this.baseLayers=new h,this.referenceLayers=new h;const r=a=>{a.parent&&a.parent!==this&&"remove"in a.parent&&a.parent.remove(a),a.parent=this,a.type==="elevation"&&u.getLogger(this).error(`Layer '${a.title}, id:${a.id}' of type '${a.type}' is not supported as a basemap layer and will therefore be ignored.`)},s=a=>{a.parent=null};this.addHandles([this.baseLayers.on("after-add",a=>r(a.item)),this.referenceLayers.on("after-add",a=>r(a.item)),this.baseLayers.on("after-remove",a=>s(a.item)),this.referenceLayers.on("after-remove",a=>s(a.item))])}initialize(){this.when().catch(e=>{u.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const s of e)s.destroy();const r=this.referenceLayers.toArray();for(const s of r)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=O(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",S(e,this._get("baseLayers")))}_writeBaseLayers(e,r,s){const a=[];e&&(s={...s,layerContainerType:"basemap"},this.baseLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&a.push(o)}),this.referenceLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&(i.type!=="scene"&&(o.isReference=!0),a.push(o))})),r.baseMapLayers=a}set referenceLayers(e){this._set("referenceLayers",S(e,this._get("referenceLayers")))}writeTitle(e,r){r.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return P(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(r=>L(r)?r.clone():r),referenceLayers:this.referenceLayers.map(r=>L(r)?r.clone():r)};return this.loaded&&(e.loadStatus="loaded"),new d({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set("resourceInfo",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:"web-map",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(s=>{const a=k(s);return a.url&&f(a.url)&&(a.url=`https:${a.url}`),a.templateUrl&&f(a.templateUrl)&&(a.templateUrl=`https:${a.templateUrl}`),a})),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:s,style:a}=this;T(e);const i=[];if(r){const o=r.context?r.context.url:null;if(i.push(this._loadLayersFromJSON(r.data,o,e)),r.data.id&&!r.data.title){const g=r.data.id;i.push(E(g).then(n=>{n&&this.read({title:n},r.context)}))}}else s?i.push(this._loadFromItem(s,e)):a&&i.push(this._loadFromStylesService(a,e));await Promise.all(i)}async _loadLayersFromJSON(e,r,s){const a=this.resourceInfo?.context,i=this.portalItem?.portal||a?.portal||null,o=q[a?.origin||""]??"web-map",{populateOperationalLayers:g}=await D(async()=>{const{populateOperationalLayers:b}=await import("./layersCreator-CW56kDKc-gpROgX1S.js");return{populateOperationalLayers:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),n=[];if(T(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const b={context:{...a,origin:o,url:r,portal:i,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},v=m=>o==="web-scene"&&m.layerType==="ArcGISSceneServiceLayer"||m.isReference,_=g(this.baseLayers,e.baseMapLayers.filter(m=>!v(m)),b);n.push(_);const U=g(this.referenceLayers,e.baseMapLayers.filter(v),b);n.push(U)}await Promise.allSettled(n)}async _loadFromItem(e,r){const s=await e.load(r),a=await s.fetchData("json",r),i=M(e.itemUrl??"");return this._set("resourceInfo",{data:a.baseMap??{},context:{origin:K[e.type||""]??"web-map",portal:e.portal||I.getDefault(),url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||I.getDefault(),url:i}),this._loadLayersFromJSON(this.resourceInfo.data,i,r)}async _loadFromStylesService(e,r){const s=`${e.serviceUrl}/${e.id}`,a=(await B(s,{query:{language:e.getLanguageParamValue(),places:e.places,worldview:e.worldview,token:e.apiKey},signal:r?.signal})).data,i=M(s);if(this._set("resourceInfo",{data:a.baseMap??{},context:{origin:"web-map",url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,i,r),e.apiKey)for(const o of[...this.baseLayers,...this.referenceLayers])"apiKey"in o&&(o.apiKey=e.apiKey)}static fromId(e){const r=F[e];return r?r.itemId?new d({portalItem:{id:r.itemId,portal:{url:"https://www.arcgis.com"}}}):d.fromJSON(r,{origin:r.is3d?"web-scene":"web-map"}):null}};l([c({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,r,s,a){this._writeBaseLayers(e,r,a)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:h}},writer(e,r,s,a){this._writeBaseLayers(e,r,a)}}}}}})],p.prototype,"baseLayers",null),l([c({type:String,json:{origins:{"web-scene":{write:!0}}}})],p.prototype,"id",void 0),l([c({type:x})],p.prototype,"portalItem",void 0),l([c()],p.prototype,"referenceLayers",null),l([c({readOnly:!0})],p.prototype,"resourceInfo",void 0),l([c({type:R})],p.prototype,"spatialReference",void 0),l([c({type:z})],p.prototype,"style",void 0),l([c()],p.prototype,"thumbnailUrl",void 0),l([c({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],p.prototype,"title",void 0),l([V("title")],p.prototype,"writeTitle",null),p=d=l([G("esri.Basemap")],p);const K={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},q={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},Q=p,re=Object.freeze(Object.defineProperty({__proto__:null,default:Q},Symbol.toStringTag,{value:"Module"}));export{re as B,Q as F,F as s}; diff --git a/main/assets/Basemap-BEqqSTw9-COwFtp-h.js b/main/assets/Basemap-BEqqSTw9-COwFtp-h.js new file mode 100644 index 000000000..136df947e --- /dev/null +++ b/main/assets/Basemap-BEqqSTw9-COwFtp-h.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersCreator-CW56kDKc-CK8sXxzK.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./portalLayers-Bh9bAhk4-CIQyh8K9.js","./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./fetchService-DbaKmJhP-DPDp5i2e.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./styleUtils-ChrJTYIw-OCRItq_6.js"])))=>i.map(i=>d[i]); +import{bw as t,v as l,bA as A,ag as h,a1 as u,aA as O,am as S,da as L,P as k,db as f,$ as T,_ as D,a as M,r as I,f as B,S as c,ac as V,bq as W,i as G,J as R,j,h as H,dc as N,aB as C}from"./main-C7yV2j71.js";import{y as P}from"./loadAll-e978YItg-NjG3VBGi.js";import x from"./PortalItem-CctGdnxF-CHPkp6yW.js";import{y as w}from"./writeUtils-D5qlLkwk-IaioN2Q8.js";async function E(e){if(!e)return;const r=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,s=await W("esri/t9n/basemaps");return s[e]||s[r]}const F={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return t("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return t("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return t("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return t("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return t("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return t("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return t("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return t("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return t("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return t("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},$=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let y=class extends j{constructor(e){super(e),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const e=H().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const r=N(e);return r==="pt"?"pt-BR":r&&$.has(r)?r:"global"}};l([c()],y.prototype,"apiKey",void 0),l([c()],y.prototype,"id",void 0),l([c()],y.prototype,"language",void 0),l([c()],y.prototype,"places",void 0),l([c()],y.prototype,"serviceUrl",void 0),l([c()],y.prototype,"worldview",void 0),y=l([G("esri.support.BasemapStyle")],y);const z=y;var d;let J=0,p=d=class extends A(C){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+J++,this.baseLayers=new h,this.referenceLayers=new h;const r=a=>{a.parent&&a.parent!==this&&"remove"in a.parent&&a.parent.remove(a),a.parent=this,a.type==="elevation"&&u.getLogger(this).error(`Layer '${a.title}, id:${a.id}' of type '${a.type}' is not supported as a basemap layer and will therefore be ignored.`)},s=a=>{a.parent=null};this.addHandles([this.baseLayers.on("after-add",a=>r(a.item)),this.referenceLayers.on("after-add",a=>r(a.item)),this.baseLayers.on("after-remove",a=>s(a.item)),this.referenceLayers.on("after-remove",a=>s(a.item))])}initialize(){this.when().catch(e=>{u.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const s of e)s.destroy();const r=this.referenceLayers.toArray();for(const s of r)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=O(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",S(e,this._get("baseLayers")))}_writeBaseLayers(e,r,s){const a=[];e&&(s={...s,layerContainerType:"basemap"},this.baseLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&a.push(o)}),this.referenceLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&(i.type!=="scene"&&(o.isReference=!0),a.push(o))})),r.baseMapLayers=a}set referenceLayers(e){this._set("referenceLayers",S(e,this._get("referenceLayers")))}writeTitle(e,r){r.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return P(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(r=>L(r)?r.clone():r),referenceLayers:this.referenceLayers.map(r=>L(r)?r.clone():r)};return this.loaded&&(e.loadStatus="loaded"),new d({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set("resourceInfo",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:"web-map",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(s=>{const a=k(s);return a.url&&f(a.url)&&(a.url=`https:${a.url}`),a.templateUrl&&f(a.templateUrl)&&(a.templateUrl=`https:${a.templateUrl}`),a})),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:s,style:a}=this;T(e);const i=[];if(r){const o=r.context?r.context.url:null;if(i.push(this._loadLayersFromJSON(r.data,o,e)),r.data.id&&!r.data.title){const g=r.data.id;i.push(E(g).then(n=>{n&&this.read({title:n},r.context)}))}}else s?i.push(this._loadFromItem(s,e)):a&&i.push(this._loadFromStylesService(a,e));await Promise.all(i)}async _loadLayersFromJSON(e,r,s){const a=this.resourceInfo?.context,i=this.portalItem?.portal||a?.portal||null,o=q[a?.origin||""]??"web-map",{populateOperationalLayers:g}=await D(async()=>{const{populateOperationalLayers:b}=await import("./layersCreator-CW56kDKc-CK8sXxzK.js");return{populateOperationalLayers:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),n=[];if(T(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const b={context:{...a,origin:o,url:r,portal:i,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},v=m=>o==="web-scene"&&m.layerType==="ArcGISSceneServiceLayer"||m.isReference,_=g(this.baseLayers,e.baseMapLayers.filter(m=>!v(m)),b);n.push(_);const U=g(this.referenceLayers,e.baseMapLayers.filter(v),b);n.push(U)}await Promise.allSettled(n)}async _loadFromItem(e,r){const s=await e.load(r),a=await s.fetchData("json",r),i=M(e.itemUrl??"");return this._set("resourceInfo",{data:a.baseMap??{},context:{origin:K[e.type||""]??"web-map",portal:e.portal||I.getDefault(),url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||I.getDefault(),url:i}),this._loadLayersFromJSON(this.resourceInfo.data,i,r)}async _loadFromStylesService(e,r){const s=`${e.serviceUrl}/${e.id}`,a=(await B(s,{query:{language:e.getLanguageParamValue(),places:e.places,worldview:e.worldview,token:e.apiKey},signal:r?.signal})).data,i=M(s);if(this._set("resourceInfo",{data:a.baseMap??{},context:{origin:"web-map",url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,i,r),e.apiKey)for(const o of[...this.baseLayers,...this.referenceLayers])"apiKey"in o&&(o.apiKey=e.apiKey)}static fromId(e){const r=F[e];return r?r.itemId?new d({portalItem:{id:r.itemId,portal:{url:"https://www.arcgis.com"}}}):d.fromJSON(r,{origin:r.is3d?"web-scene":"web-map"}):null}};l([c({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,r,s,a){this._writeBaseLayers(e,r,a)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:h}},writer(e,r,s,a){this._writeBaseLayers(e,r,a)}}}}}})],p.prototype,"baseLayers",null),l([c({type:String,json:{origins:{"web-scene":{write:!0}}}})],p.prototype,"id",void 0),l([c({type:x})],p.prototype,"portalItem",void 0),l([c()],p.prototype,"referenceLayers",null),l([c({readOnly:!0})],p.prototype,"resourceInfo",void 0),l([c({type:R})],p.prototype,"spatialReference",void 0),l([c({type:z})],p.prototype,"style",void 0),l([c()],p.prototype,"thumbnailUrl",void 0),l([c({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],p.prototype,"title",void 0),l([V("title")],p.prototype,"writeTitle",null),p=d=l([G("esri.Basemap")],p);const K={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},q={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},Q=p,re=Object.freeze(Object.defineProperty({__proto__:null,default:Q},Symbol.toStringTag,{value:"Module"}));export{re as B,Q as F,F as s}; diff --git a/main/assets/BingMapsLayer-BigMnKl_-D6t2rOyx.js b/main/assets/BingMapsLayer-BigMnKl_-D6t2rOyx.js new file mode 100644 index 000000000..490b9f4c2 --- /dev/null +++ b/main/assets/BingMapsLayer-BigMnKl_-D6t2rOyx.js @@ -0,0 +1 @@ +import{J as h,n as j,bh as x,f as c,o as u,v as a,S as o,i as M,aK as B,w as U}from"./main-C7yV2j71.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as R}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as T}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{T as k}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as I}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{u as f}from"./imageBitmapUtils-DA36kg39-BPA5qQx5.js";import{V as m,d as r}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{e as L}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import{E as _}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";var v;const y=new L("0/0/0",0,0,0,void 0);let g=v=class extends T(I(k(R))){constructor(){super(...arguments),this.tileInfo=m.create({spatialReference:h.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new j(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,h.WebMercator),this.spatialReference=h.WebMercator}getTileBounds(e,t,i,l){const s=l||x();return y.level=e,y.row=t,y.col=i,y.extent=s,this.tileInfo.updateTileInfo(y),y.extent=void 0,s}fetchTile(e,t,i,l={}){const{signal:s}=l,p=this.getTileUrl(e,t,i),d={responseType:"image",signal:s,query:{...this.refreshParameters}};return c(p??"",d).then(b=>b.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:s}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return f(S,e,t,i,s)}const p=this.getTileUrl(e,t,i)??"",d={responseType:"blob",signal:s,query:{...this.refreshParameters}},{data:b}=await c(p,d);return f(b,e,t,i,s)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};a([o({type:m})],g.prototype,"tileInfo",void 0),a([o({type:["show","hide"]})],g.prototype,"listMode",void 0),a([o({readOnly:!0,value:"base-tile"})],g.prototype,"type",void 0),a([o({nonNullable:!0})],g.prototype,"fullExtent",void 0),a([o()],g.prototype,"spatialReference",void 0),g=v=a([M("esri.layers.BaseTileLayer")],g);const O=g,w=new B({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),z="https://dev.virtualearth.net";let n=class extends T(_(P(O))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new U({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new r({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new r({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new r({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new r({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new r({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new r({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new r({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new r({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new r({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new r({level:10,resolution:152.874056570411,scale:577790.554289}),new r({level:11,resolution:76.4370282850732,scale:288895.277144}),new r({level:12,resolution:38.2185141425366,scale:144447.638572}),new r({level:13,resolution:19.1092570712683,scale:72223.819286}),new r({level:14,resolution:9.55462853563415,scale:36111.909643}),new r({level:15,resolution:4.77731426794937,scale:18055.954822}),new r({level:16,resolution:2.38865713397468,scale:9027.977411}),new r({level:17,resolution:1.19432856685505,scale:4513.988705}),new r({level:18,resolution:.597164283559817,scale:2256.994353}),new r({level:19,resolution:.298582141647617,scale:1128.497176}),new r({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],s=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",s).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${z}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return c(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let s=e;s>0;s--){let p=0;const d=1<b.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:s}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return f(S,e,t,i,s)}const p=this.getTileUrl(e,t,i)??"",d={responseType:"blob",signal:s,query:{...this.refreshParameters}},{data:b}=await c(p,d);return f(b,e,t,i,s)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};a([o({type:m})],g.prototype,"tileInfo",void 0),a([o({type:["show","hide"]})],g.prototype,"listMode",void 0),a([o({readOnly:!0,value:"base-tile"})],g.prototype,"type",void 0),a([o({nonNullable:!0})],g.prototype,"fullExtent",void 0),a([o()],g.prototype,"spatialReference",void 0),g=v=a([M("esri.layers.BaseTileLayer")],g);const O=g,w=new B({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),z="https://dev.virtualearth.net";let n=class extends T(_(P(O))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new U({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new r({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new r({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new r({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new r({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new r({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new r({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new r({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new r({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new r({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new r({level:10,resolution:152.874056570411,scale:577790.554289}),new r({level:11,resolution:76.4370282850732,scale:288895.277144}),new r({level:12,resolution:38.2185141425366,scale:144447.638572}),new r({level:13,resolution:19.1092570712683,scale:72223.819286}),new r({level:14,resolution:9.55462853563415,scale:36111.909643}),new r({level:15,resolution:4.77731426794937,scale:18055.954822}),new r({level:16,resolution:2.38865713397468,scale:9027.977411}),new r({level:17,resolution:1.19432856685505,scale:4513.988705}),new r({level:18,resolution:.597164283559817,scale:2256.994353}),new r({level:19,resolution:.298582141647617,scale:1128.497176}),new r({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],s=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",s).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${z}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return c(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let s=e;s>0;s--){let p=0;const d=1<{t.field!=null&&(i.splitByField=t.field),t.expression!=null&&(i.splitBy=t.expression),t.alias!=null&&(i.splitByAlias=t.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(t,i)=>new w({field:i.splitByField,expression:i.splitBy,alias:i.splitByAlias})}}})],s.prototype,"splitByAttributes",void 0),e([r({type:w,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(t,i)=>{t.field!=null&&(i.stackByField=t.field),t.expression!=null&&(i.stackBy=t.expression),t.alias!=null&&(i.stackByAlias=t.alias),t.responseType!=null&&(i.jsonStyle=t.responseType)},overridePolicy(){return{enabled:this.stackByAttributes?.field!=null||this.stackByAttributes?.expression!=null}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(t,i)=>new w({field:i.stackByField,expression:i.stackBy,alias:i.stackByAlias,responseType:i.jsonStyle})}}})],s.prototype,"stackByAttributes",void 0),e([d(H)],s.prototype,"transformation",void 0),s=e([y("esri.rest.support.BinParametersBase")],s);const f=s,K=O()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),T="percent-of-total",z="field",q=t=>{let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let o=this._get("normalizationType");const v=!!this.normalizationField,b=this.normalizationTotal!=null;return v||b?(o=v&&z||b&&T||null,v&&b&&N.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):o!==z&&o!==T||(o=null),o}set normalizationType(o){this._set("normalizationType",o)}};return e([r({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),e([r({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),e([d(K,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=e([y("esri.rest.support.NormalizationBinParametersMixin")],i),i};function A(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let p=class extends q(f){constructor(t){super(t),this.bins=null,this.end=null,this.start=null,this.type="auto-interval"}};e([r({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],p.prototype,"bins",void 0),e([r({json:{name:"parameters.end",write:{writer:A}}})],p.prototype,"end",void 0),e([r({json:{name:"parameters.start",write:{writer:A}}})],p.prototype,"start",void 0),e([d({autoIntervalBin:"auto-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=e([y("esri.rest.support.AutoIntervalBinParameters")],p);const U=p;p.from=h(p);const _=O()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let m=class extends B(g){constructor(t){super(t),this.value=null,this.units=null}};e([r({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),e([d(_,{name:"unit"})],m.prototype,"units",void 0),m=e([y("esri.rest.support.DateBinTimeInterval")],m);const k=m;m.from=h(m);function F(t,i,o){j(o,typeof t=="string"?t:t?.getTime(),i)}function P(t,i){const o=t.parameters[i];return o?typeof o=="string"?o:new Date(o):null}let a=class extends f{constructor(t){super(t),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.end",read:{reader:(t,i)=>P(i,"end")},write:{writer:F}}})],a.prototype,"end",void 0),e([r({type:k,json:{name:"parameters",write:!0}})],a.prototype,"interval",void 0),e([r({type:k,json:{name:"parameters.offset",write:!0}})],a.prototype,"offset",void 0),e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.start",read:{reader:(t,i)=>P(i,"start")},write:{writer:F}}})],a.prototype,"start",void 0),e([d({dateBin:"date"},{readOnly:!0})],a.prototype,"type",void 0),a=e([y("esri.rest.support.DateBinParameters")],a);const G=a;a.from=h(a);function J(t){return t[0]instanceof Date}function W(t,i,o){j(o,t&&J(t)?t.map(v=>v.getTime()):t,i)}let c=class extends f{constructor(t){super(t),this.boundaries=null,this.type="fixed-boundaries"}};e([r({json:{name:"parameters.boundaries",write:{writer:W}}})],c.prototype,"boundaries",void 0),e([d({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=e([y("esri.rest.support.FixedBoundariesBinParameters")],c);const C=c;c.from=h(c);function D(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let u=class extends q(f){constructor(t){super(t),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};e([r({json:{name:"parameters.end",write:{writer:D}}})],u.prototype,"end",void 0),e([r({type:Number,json:{name:"parameters.interval",write:!0}})],u.prototype,"interval",void 0),e([r({json:{name:"parameters.start",write:{writer:D}}})],u.prototype,"start",void 0),e([d({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],u.prototype,"type",void 0),u=e([y("esri.rest.support.FixedIntervalBinParameters")],u);const E=u;u.from=h(u);const Q=new R({asc:"ascending",desc:"descending"}),X={base:f,key:"type",typeMap:{"auto-interval":U,date:G,"fixed-boundaries":C,"fixed-interval":E}};let n=class extends B(g){constructor(t){super(t),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.quantizationParameters=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(t){this._set("outTimeZone",t),t&&!M(t)&&N.getLogger(this).warn("#outTimeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}};e([r({types:X,json:{name:"bin",write:!0}})],n.prototype,"binParameters",void 0),e([d(Q)],n.prototype,"binOrder",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"cacheHint",void 0),e([r({json:{write:!0}})],n.prototype,"datumTransformation",void 0),e([r({type:x,json:{name:"defaultSR",write:!0}})],n.prototype,"defaultSpatialReference",void 0),e([r({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],n.prototype,"distance",void 0),e([r({types:V,json:{read:I,write:!0}})],n.prototype,"geometry",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"lowerBoundaryAlias",void 0),e([r({type:x,json:{name:"outSR",write:!0}})],n.prototype,"outSpatialReference",void 0),e([r({type:[Z],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],n.prototype,"outStatistics",void 0),e([r({value:null,json:{name:"outTimeReference",read:{reader:t=>t.ianaTimeZone},write:{writer:(t,i,o)=>{t&&(i[o]={ianaTimeZone:t})}}}})],n.prototype,"outTimeZone",null),e([r({type:L,json:{write:!0}})],n.prototype,"quantizationParameters",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"returnDistinctValues",void 0),e([d($,{name:"spatialRel"})],n.prototype,"spatialRelationship",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"upperBoundaryAlias",void 0),e([r({type:String,json:{read:S.read,write:{writer:S.write,overridePolicy(t){return{enabled:t!=null&&this.distance!=null&&this.distance>0}}}}})],n.prototype,"units",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"where",void 0),n=e([y("esri.rest.support.BinsQuery")],n);const yt=n;n.from=h(n);export{yt as default}; diff --git a/main/assets/BinsQuery-DjwQZqB8-T-ydjXwz.js b/main/assets/BinsQuery-DjwQZqB8-T-ydjXwz.js deleted file mode 100644 index 344c3f513..000000000 --- a/main/assets/BinsQuery-DjwQZqB8-T-ydjXwz.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as B,e as g,v as e,S as r,i as y,bG as h,aK as R,bz as d,d2 as O,aE as M,a1 as N,J as x,af as V,g as I,el as j}from"./main-BZaw9FpY.js";import{Z as S}from"./queryUtils-Brxu6254-DDAvXp_C.js";import{m as Z,a as L,s as $}from"./Query-BrwMGK8U-sojFdYaD.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";let l=class extends B(g){constructor(t){super(t),this.alias=null,this.expression=null,this.field=null,this.responseType=null}};e([r({type:String,json:{write:!0}})],l.prototype,"alias",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"expression",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"field",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"responseType",void 0),l=e([y("esri.rest.support.BinParametersAttributes")],l);const w=l;l.from=h(l);const H=new R({naturalLog:"natural-log",squareRoot:"square-root"});let s=class extends B(g){constructor(t){super(t),this.expression=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitByAttributes=null,this.stackByAttributes=null,this.transformation=null}};e([r({type:String,json:{write:!0}})],s.prototype,"expression",void 0),e([r({type:String,json:{name:"onField",write:!0}})],s.prototype,"field",void 0),e([r({type:String,json:{write:!0}})],s.prototype,"firstDayOfWeek",void 0),e([r({type:String,json:{write:!0}})],s.prototype,"hideUpperBound",void 0),e([r({type:w,json:{write:{target:{splitBy:{type:String},splitByField:{type:String},splitByAlias:{type:String}},writer:(t,i)=>{t.field!=null&&(i.splitByField=t.field),t.expression!=null&&(i.splitBy=t.expression),t.alias!=null&&(i.splitByAlias=t.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(t,i)=>new w({field:i.splitByField,expression:i.splitBy,alias:i.splitByAlias})}}})],s.prototype,"splitByAttributes",void 0),e([r({type:w,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(t,i)=>{t.field!=null&&(i.stackByField=t.field),t.expression!=null&&(i.stackBy=t.expression),t.alias!=null&&(i.stackByAlias=t.alias),t.responseType!=null&&(i.jsonStyle=t.responseType)},overridePolicy(){return{enabled:this.stackByAttributes?.field!=null||this.stackByAttributes?.expression!=null}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(t,i)=>new w({field:i.stackByField,expression:i.stackBy,alias:i.stackByAlias,responseType:i.jsonStyle})}}})],s.prototype,"stackByAttributes",void 0),e([d(H)],s.prototype,"transformation",void 0),s=e([y("esri.rest.support.BinParametersBase")],s);const f=s,K=O()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),T="percent-of-total",z="field",q=t=>{let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let o=this._get("normalizationType");const v=!!this.normalizationField,b=this.normalizationTotal!=null;return v||b?(o=v&&z||b&&T||null,v&&b&&N.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):o!==z&&o!==T||(o=null),o}set normalizationType(o){this._set("normalizationType",o)}};return e([r({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),e([r({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),e([d(K,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=e([y("esri.rest.support.NormalizationBinParametersMixin")],i),i};function A(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let p=class extends q(f){constructor(t){super(t),this.bins=null,this.end=null,this.start=null,this.type="auto-interval"}};e([r({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],p.prototype,"bins",void 0),e([r({json:{name:"parameters.end",write:{writer:A}}})],p.prototype,"end",void 0),e([r({json:{name:"parameters.start",write:{writer:A}}})],p.prototype,"start",void 0),e([d({autoIntervalBin:"auto-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=e([y("esri.rest.support.AutoIntervalBinParameters")],p);const U=p;p.from=h(p);const _=O()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let m=class extends B(g){constructor(t){super(t),this.value=null,this.units=null}};e([r({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),e([d(_,{name:"unit"})],m.prototype,"units",void 0),m=e([y("esri.rest.support.DateBinTimeInterval")],m);const k=m;m.from=h(m);function F(t,i,o){j(o,typeof t=="string"?t:t?.getTime(),i)}function P(t,i){const o=t.parameters[i];return o?typeof o=="string"?o:new Date(o):null}let a=class extends f{constructor(t){super(t),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.end",read:{reader:(t,i)=>P(i,"end")},write:{writer:F}}})],a.prototype,"end",void 0),e([r({type:k,json:{name:"parameters",write:!0}})],a.prototype,"interval",void 0),e([r({type:k,json:{name:"parameters.offset",write:!0}})],a.prototype,"offset",void 0),e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.start",read:{reader:(t,i)=>P(i,"start")},write:{writer:F}}})],a.prototype,"start",void 0),e([d({dateBin:"date"},{readOnly:!0})],a.prototype,"type",void 0),a=e([y("esri.rest.support.DateBinParameters")],a);const G=a;a.from=h(a);function J(t){return t[0]instanceof Date}function W(t,i,o){j(o,t&&J(t)?t.map(v=>v.getTime()):t,i)}let c=class extends f{constructor(t){super(t),this.boundaries=null,this.type="fixed-boundaries"}};e([r({json:{name:"parameters.boundaries",write:{writer:W}}})],c.prototype,"boundaries",void 0),e([d({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=e([y("esri.rest.support.FixedBoundariesBinParameters")],c);const C=c;c.from=h(c);function D(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let u=class extends q(f){constructor(t){super(t),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};e([r({json:{name:"parameters.end",write:{writer:D}}})],u.prototype,"end",void 0),e([r({type:Number,json:{name:"parameters.interval",write:!0}})],u.prototype,"interval",void 0),e([r({json:{name:"parameters.start",write:{writer:D}}})],u.prototype,"start",void 0),e([d({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],u.prototype,"type",void 0),u=e([y("esri.rest.support.FixedIntervalBinParameters")],u);const E=u;u.from=h(u);const Q=new R({asc:"ascending",desc:"descending"}),X={base:f,key:"type",typeMap:{"auto-interval":U,date:G,"fixed-boundaries":C,"fixed-interval":E}};let n=class extends B(g){constructor(t){super(t),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.quantizationParameters=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(t){this._set("outTimeZone",t),t&&!M(t)&&N.getLogger(this).warn("#outTimeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}};e([r({types:X,json:{name:"bin",write:!0}})],n.prototype,"binParameters",void 0),e([d(Q)],n.prototype,"binOrder",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"cacheHint",void 0),e([r({json:{write:!0}})],n.prototype,"datumTransformation",void 0),e([r({type:x,json:{name:"defaultSR",write:!0}})],n.prototype,"defaultSpatialReference",void 0),e([r({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],n.prototype,"distance",void 0),e([r({types:V,json:{read:I,write:!0}})],n.prototype,"geometry",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"lowerBoundaryAlias",void 0),e([r({type:x,json:{name:"outSR",write:!0}})],n.prototype,"outSpatialReference",void 0),e([r({type:[Z],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],n.prototype,"outStatistics",void 0),e([r({value:null,json:{name:"outTimeReference",read:{reader:t=>t.ianaTimeZone},write:{writer:(t,i,o)=>{t&&(i[o]={ianaTimeZone:t})}}}})],n.prototype,"outTimeZone",null),e([r({type:L,json:{write:!0}})],n.prototype,"quantizationParameters",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"returnDistinctValues",void 0),e([d($,{name:"spatialRel"})],n.prototype,"spatialRelationship",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"upperBoundaryAlias",void 0),e([r({type:String,json:{read:S.read,write:{writer:S.write,overridePolicy(t){return{enabled:t!=null&&this.distance!=null&&this.distance>0}}}}})],n.prototype,"units",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"where",void 0),n=e([y("esri.rest.support.BinsQuery")],n);const yt=n;n.from=h(n);export{yt as default}; diff --git a/main/assets/Bitmap-CcqmzvfR-C92VuEM3.js b/main/assets/Bitmap-CcqmzvfR-C92VuEM3.js new file mode 100644 index 000000000..8ccb1d829 --- /dev/null +++ b/main/assets/Bitmap-CcqmzvfR-C92VuEM3.js @@ -0,0 +1 @@ +import{b as p,dy as c,bt as x}from"./main-C7yV2j71.js";import{R as _,C as a,D as g,H as m,E as f}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as w}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{e as n}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as B}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{B as k,U as S,G as R}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as b,V as y}from"./Texture-BCt2hphT-CtQVMDnp.js";class v{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(e==null)return;const i=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??e});if(i.pixelBlock==null)return;i.pixelBlock.maskIsAlpha&&(i.pixelBlock.premultiplyAlpha=!0);const r=i.pixelBlock.getAsRGBA(),h=t.createImageData(i.pixelBlock.width,i.pixelBlock.height);h.data.set(r),t.putImageData(h,0,0)}getRenderedRasterPixels(){const t=this.filter({extent:this.extent,pixelBlock:this.pixelBlock});return t.pixelBlock==null?null:(t.pixelBlock.maskIsAlpha&&(t.pixelBlock.premultiplyAlpha=!0),{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)})}}function T(s){return s&&"render"in s}function A(s){const t=document.createElement("canvas");return t.width=s.width,t.height=s.height,s.render(t.getContext("2d")),t}function I(s){return T(s)?s instanceof v?s.getRenderedRasterPixels()?.renderedRasterPixels:A(s):s}class C extends B{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){t==null&&this._source==null||(this._source=t,this.invalidateTexture(),this.requestRender())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,e){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const i=new AbortController,r=p();return c(e,()=>i.abort()),c(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=_(this.transforms.displayViewScreenMat3),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,o=h*this.width,l=h*this.height,u=Math.PI*this.rotation/180;a(e,e,n(i,r)),a(e,e,n(o/2,l/2)),g(e,e,-u),a(e,e,n(-o/2,-l/2)),m(e,e,n(o,l)),f(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const i=I(this.source);try{if(this._uploadStatus!=null){const{controller:r,resolver:h}=this._uploadStatus,o={signal:r.signal},{width:l,height:u}=this,d=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:d,width:l,height:u},o),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){x(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:w()}}_createTexture(t){const e=this.immutable,i=new b;return i.internalFormat=e?k.RGBA8:S.RGBA,i.wrapMode=R.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new y(t,i)}}export{C as I,v as d,T as p,A as x}; diff --git a/main/assets/Bitmap-CcqmzvfR-Cl_blWW9.js b/main/assets/Bitmap-CcqmzvfR-Cl_blWW9.js deleted file mode 100644 index d5844cfca..000000000 --- a/main/assets/Bitmap-CcqmzvfR-Cl_blWW9.js +++ /dev/null @@ -1 +0,0 @@ -import{b as p,dy as c,bt as x}from"./main-BZaw9FpY.js";import{R as _,C as a,D as g,H as m,E as f}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as w}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{e as n}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as B}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{B as k,U as S,G as R}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as b,V as y}from"./Texture-BCt2hphT-D-X9O5uh.js";class v{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(e==null)return;const i=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??e});if(i.pixelBlock==null)return;i.pixelBlock.maskIsAlpha&&(i.pixelBlock.premultiplyAlpha=!0);const r=i.pixelBlock.getAsRGBA(),h=t.createImageData(i.pixelBlock.width,i.pixelBlock.height);h.data.set(r),t.putImageData(h,0,0)}getRenderedRasterPixels(){const t=this.filter({extent:this.extent,pixelBlock:this.pixelBlock});return t.pixelBlock==null?null:(t.pixelBlock.maskIsAlpha&&(t.pixelBlock.premultiplyAlpha=!0),{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)})}}function T(s){return s&&"render"in s}function A(s){const t=document.createElement("canvas");return t.width=s.width,t.height=s.height,s.render(t.getContext("2d")),t}function I(s){return T(s)?s instanceof v?s.getRenderedRasterPixels()?.renderedRasterPixels:A(s):s}class C extends B{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){t==null&&this._source==null||(this._source=t,this.invalidateTexture(),this.requestRender())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,e){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const i=new AbortController,r=p();return c(e,()=>i.abort()),c(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=_(this.transforms.displayViewScreenMat3),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,o=h*this.width,l=h*this.height,u=Math.PI*this.rotation/180;a(e,e,n(i,r)),a(e,e,n(o/2,l/2)),g(e,e,-u),a(e,e,n(-o/2,-l/2)),m(e,e,n(o,l)),f(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const i=I(this.source);try{if(this._uploadStatus!=null){const{controller:r,resolver:h}=this._uploadStatus,o={signal:r.signal},{width:l,height:u}=this,d=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:d,width:l,height:u},o),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){x(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:w()}}_createTexture(t){const e=this.immutable,i=new b;return i.internalFormat=e?k.RGBA8:S.RGBA,i.wrapMode=R.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new y(t,i)}}export{C as I,v as d,T as p,A as x}; diff --git a/main/assets/BitmapContainer-BC8fvmFc-CH1ryNve.js b/main/assets/BitmapContainer-BC8fvmFc-CH1ryNve.js new file mode 100644 index 000000000..1104845e4 --- /dev/null +++ b/main/assets/BitmapContainer-BC8fvmFc-CH1ryNve.js @@ -0,0 +1 @@ +import{N as r,s as a}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{E as t}from"./MapView-BGOJJ8ch-CG2YDFKt.js";let h=class extends r{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const s=e.registerRenderPass({name:"bitmap",brushes:[a.bitmap],target:()=>this.children,drawPhase:t.MAP});return[...super.prepareRenderPasses(e),s]}_manageFade(){this.children.reduce((e,s)=>e+(s.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}};export{h as d}; diff --git a/main/assets/BitmapContainer-BC8fvmFc-DzZ9OrT1.js b/main/assets/BitmapContainer-BC8fvmFc-DzZ9OrT1.js deleted file mode 100644 index 5bae01b29..000000000 --- a/main/assets/BitmapContainer-BC8fvmFc-DzZ9OrT1.js +++ /dev/null @@ -1 +0,0 @@ -import{N as r,s as a}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{E as t}from"./MapView-BGOJJ8ch-Dom5daUl.js";let h=class extends r{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const s=e.registerRenderPass({name:"bitmap",brushes:[a.bitmap],target:()=>this.children,drawPhase:t.MAP});return[...super.prepareRenderPasses(e),s]}_manageFade(){this.children.reduce((e,s)=>e+(s.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}};export{h as d}; diff --git a/main/assets/BlendLayer-D1WkSmwP-D_mOfOGH.js b/main/assets/BlendLayer-D1WkSmwP-D_mOfOGH.js new file mode 100644 index 000000000..0649687d9 --- /dev/null +++ b/main/assets/BlendLayer-D1WkSmwP-D_mOfOGH.js @@ -0,0 +1 @@ +import{v as r,S as t,i as n}from"./main-C7yV2j71.js";import{l,p as a}from"./jsonUtils-wIllKWI4-DRJhEzZa.js";const s={type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}},o={read:{reader:l},write:{allowNull:!0,writer:a}},d={json:{read:!1,write:!1,origins:{"web-map":o,"portal-item":o}}},c=i=>{let e=class extends i{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return r([t(s)],e.prototype,"blendMode",void 0),r([t(d)],e.prototype,"effect",void 0),e=r([n("esri.layers.mixins.BlendLayer")],e),e};export{d as a,s as o,c as u}; diff --git a/main/assets/BlendLayer-D1WkSmwP-UVXywJXM.js b/main/assets/BlendLayer-D1WkSmwP-UVXywJXM.js deleted file mode 100644 index 0c2993328..000000000 --- a/main/assets/BlendLayer-D1WkSmwP-UVXywJXM.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as t,i as n}from"./main-BZaw9FpY.js";import{l,p as a}from"./jsonUtils-wIllKWI4-DQ36DuUP.js";const s={type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}},o={read:{reader:l},write:{allowNull:!0,writer:a}},d={json:{read:!1,write:!1,origins:{"web-map":o,"portal-item":o}}},c=i=>{let e=class extends i{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return r([t(s)],e.prototype,"blendMode",void 0),r([t(d)],e.prototype,"effect",void 0),e=r([n("esri.layers.mixins.BlendLayer")],e),e};export{d as a,s as o,c as u}; diff --git a/main/assets/BoundsStore--N6o1xkF-DBAJ8yky.js b/main/assets/BoundsStore--N6o1xkF-DBAJ8yky.js deleted file mode 100644 index f32c6f2ba..000000000 --- a/main/assets/BoundsStore--N6o1xkF-DBAJ8yky.js +++ /dev/null @@ -1 +0,0 @@ -import{K as o,h6 as h}from"./main-BZaw9FpY.js";import{N as a}from"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";const _=5e4,n={minX:0,minY:0,maxX:0,maxY:0};function u(d){n.minX=d[0],n.minY=d[1],n.maxX=d[2],n.maxY=d[3]}function l(d,i,s){u(i),d.search(n,s)}class B{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new a(9,o("esri-csp-restrictions")?i=>({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const i=new Array(this._idByBounds.size);let s=0;this._idByBounds.forEach((t,e)=>{i[s++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(i)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(i=>this._idByBounds.has(i))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const i=h();for(const s of this._boundsById.values())s&&(i[0]=Math.min(s[0],i[0]),i[1]=Math.min(s[1],i[1]),i[2]=Math.max(s[2],i[2]),i[3]=Math.max(s[3],i[3]));return i}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(i){const s=this._boundsById.get(i);this._boundsById.delete(i),s&&(this._idByBounds.delete(s),this._indexInvalid||this._index.remove(s))}forEachInBounds(i,s){this._loadIndex(),l(this._index,i,t=>s(this._idByBounds.get(t)))}get(i){return this._boundsById.get(i)}has(i){return this._boundsById.has(i)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(i,s){if(!this._indexInvalid){const t=this._boundsById.get(i);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(i,s),s&&(this._idByBounds.set(s,i),this._indexInvalid||(this._boundsToLoad.push(s),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as r}; diff --git a/main/assets/BoundsStore--N6o1xkF-mEMXylgh.js b/main/assets/BoundsStore--N6o1xkF-mEMXylgh.js new file mode 100644 index 000000000..3385bb377 --- /dev/null +++ b/main/assets/BoundsStore--N6o1xkF-mEMXylgh.js @@ -0,0 +1 @@ +import{K as o,h6 as h}from"./main-C7yV2j71.js";import{N as a}from"./PooledRBush-DbfAmeLn-dj1fSLWj.js";const _=5e4,n={minX:0,minY:0,maxX:0,maxY:0};function u(d){n.minX=d[0],n.minY=d[1],n.maxX=d[2],n.maxY=d[3]}function l(d,i,s){u(i),d.search(n,s)}class B{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new a(9,o("esri-csp-restrictions")?i=>({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const i=new Array(this._idByBounds.size);let s=0;this._idByBounds.forEach((t,e)=>{i[s++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(i)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(i=>this._idByBounds.has(i))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const i=h();for(const s of this._boundsById.values())s&&(i[0]=Math.min(s[0],i[0]),i[1]=Math.min(s[1],i[1]),i[2]=Math.max(s[2],i[2]),i[3]=Math.max(s[3],i[3]));return i}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(i){const s=this._boundsById.get(i);this._boundsById.delete(i),s&&(this._idByBounds.delete(s),this._indexInvalid||this._index.remove(s))}forEachInBounds(i,s){this._loadIndex(),l(this._index,i,t=>s(this._idByBounds.get(t)))}get(i){return this._boundsById.get(i)}has(i){return this._boundsById.has(i)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(i,s){if(!this._indexInvalid){const t=this._boundsById.get(i);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(i,s),s&&(this._idByBounds.set(s,i),this._indexInvalid||(this._boundsToLoad.push(s),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as r}; diff --git a/main/assets/BufferObject-BM_7mcDb-CTo2uuE5.js b/main/assets/BufferObject-BM_7mcDb-CTo2uuE5.js new file mode 100644 index 000000000..a3d05e235 --- /dev/null +++ b/main/assets/BufferObject-BM_7mcDb-CTo2uuE5.js @@ -0,0 +1 @@ +import{hU as R,hV as A,hW as F,hX as b,a1 as T}from"./main-C7yV2j71.js";import{N as h}from"./Texture-BCt2hphT-CtQVMDnp.js";import{S as n,n as f,V as E,I as r}from"./enums-DBi1-Mm2-CUS1pvQe.js";const c=()=>T.getLogger("esri.views.webgl.BufferObject");class _{static createIndex(e,t,i){return new _(e,n.ELEMENT_ARRAY_BUFFER,t,i)}static createVertex(e,t,i){return new _(e,n.ARRAY_BUFFER,t,i)}static createUniform(e,t,i){return new _(e,n.UNIFORM_BUFFER,t,i)}static createPixelPack(e,t=f.STREAM_READ,i){const s=new _(e,n.PIXEL_PACK_BUFFER,t);return i&&s.setSize(i),s}static createPixelUnpack(e,t=f.STREAM_DRAW,i){return new _(e,n.PIXEL_UNPACK_BUFFER,t,i)}static createTransformFeedback(e,t=f.STATIC_DRAW,i){const s=new _(e,n.TRANSFORM_FEEDBACK_BUFFER,t);return s.setSize(i),s}constructor(e,t,i,s){this._context=e,this.bufferType=t,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(E.BufferObject,this),this._glName=this._context.gl.createBuffer(),h(this._context.gl),s&&this.setData(s)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER){if(this._indexType===r.UNSIGNED_INT)return 4*this._size;if(this._indexType===r.UNSIGNED_SHORT)return 2*this._size}return this._size}get _isVAOAware(){return this.bufferType===n.ELEMENT_ARRAY_BUFFER||this.bufferType===n.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(E.BufferObject,this),this._context=null):this._glName&&c().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER&&t!=null)switch(this._indexType=t,t){case r.UNSIGNED_SHORT:e*=2;break;case r.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===n.ELEMENT_ARRAY_BUFFER&&(R(e)?this._indexType=r.UNSIGNED_BYTE:A(e)?(t/=2,this._indexType=r.UNSIGNED_SHORT):F(e)&&(t/=4,this._indexType=r.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;t!=null?s.bufferData(this.bufferType,t,this.usage):s.bufferData(this.bufferType,e,this.usage),h(s),this._isVAOAware&&this._context.bindVAO(i)}setSubData(e,t,i,s){if(!e)return;const u=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:a}=this._context;a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,i,s-i),h(a),this._isVAOAware&&this._context.bindVAO(u)}getSubData(e,t=0,i,s){if(i<0||s<0)return;const u=B(e)?e.BYTES_PER_ELEMENT:1;if(u*((i??0)+(s??0))>e.byteLength)return;t+u*(s??0)>this.usedMemory&&c().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this.bufferType===n.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,n.TRANSFORM_FEEDBACK_BUFFER),a.getBufferSubData(n.TRANSFORM_FEEDBACK_BUFFER,t,e,i,s),this._context.unbindBuffer(n.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,n.COPY_READ_BUFFER),a.getBufferSubData(n.COPY_READ_BUFFER,t,e,i,s),this._context.unbindBuffer(n.COPY_READ_BUFFER))}async getSubDataAsync(e,t=0,i,s){await this._context.clientWaitAsync(),this.getSubData(e,t,i,s)}}function B(o){return b(o)}export{_ as r}; diff --git a/main/assets/BufferObject-BM_7mcDb-QLZylgsX.js b/main/assets/BufferObject-BM_7mcDb-QLZylgsX.js deleted file mode 100644 index afa031e24..000000000 --- a/main/assets/BufferObject-BM_7mcDb-QLZylgsX.js +++ /dev/null @@ -1 +0,0 @@ -import{hU as R,hV as A,hW as F,hX as b,a1 as T}from"./main-BZaw9FpY.js";import{N as h}from"./Texture-BCt2hphT-D-X9O5uh.js";import{S as n,n as f,V as E,I as r}from"./enums-DBi1-Mm2-CUS1pvQe.js";const c=()=>T.getLogger("esri.views.webgl.BufferObject");class _{static createIndex(e,t,i){return new _(e,n.ELEMENT_ARRAY_BUFFER,t,i)}static createVertex(e,t,i){return new _(e,n.ARRAY_BUFFER,t,i)}static createUniform(e,t,i){return new _(e,n.UNIFORM_BUFFER,t,i)}static createPixelPack(e,t=f.STREAM_READ,i){const s=new _(e,n.PIXEL_PACK_BUFFER,t);return i&&s.setSize(i),s}static createPixelUnpack(e,t=f.STREAM_DRAW,i){return new _(e,n.PIXEL_UNPACK_BUFFER,t,i)}static createTransformFeedback(e,t=f.STATIC_DRAW,i){const s=new _(e,n.TRANSFORM_FEEDBACK_BUFFER,t);return s.setSize(i),s}constructor(e,t,i,s){this._context=e,this.bufferType=t,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(E.BufferObject,this),this._glName=this._context.gl.createBuffer(),h(this._context.gl),s&&this.setData(s)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER){if(this._indexType===r.UNSIGNED_INT)return 4*this._size;if(this._indexType===r.UNSIGNED_SHORT)return 2*this._size}return this._size}get _isVAOAware(){return this.bufferType===n.ELEMENT_ARRAY_BUFFER||this.bufferType===n.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(E.BufferObject,this),this._context=null):this._glName&&c().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER&&t!=null)switch(this._indexType=t,t){case r.UNSIGNED_SHORT:e*=2;break;case r.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===n.ELEMENT_ARRAY_BUFFER&&(R(e)?this._indexType=r.UNSIGNED_BYTE:A(e)?(t/=2,this._indexType=r.UNSIGNED_SHORT):F(e)&&(t/=4,this._indexType=r.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;t!=null?s.bufferData(this.bufferType,t,this.usage):s.bufferData(this.bufferType,e,this.usage),h(s),this._isVAOAware&&this._context.bindVAO(i)}setSubData(e,t,i,s){if(!e)return;const u=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:a}=this._context;a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,i,s-i),h(a),this._isVAOAware&&this._context.bindVAO(u)}getSubData(e,t=0,i,s){if(i<0||s<0)return;const u=B(e)?e.BYTES_PER_ELEMENT:1;if(u*((i??0)+(s??0))>e.byteLength)return;t+u*(s??0)>this.usedMemory&&c().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this.bufferType===n.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,n.TRANSFORM_FEEDBACK_BUFFER),a.getBufferSubData(n.TRANSFORM_FEEDBACK_BUFFER,t,e,i,s),this._context.unbindBuffer(n.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,n.COPY_READ_BUFFER),a.getBufferSubData(n.COPY_READ_BUFFER,t,e,i,s),this._context.unbindBuffer(n.COPY_READ_BUFFER))}async getSubDataAsync(e,t=0,i,s){await this._context.clientWaitAsync(),this.getSubData(e,t,i,s)}}function B(o){return b(o)}export{_ as r}; diff --git a/main/assets/BufferView-PQoE3GL7-DXIpDOUe.js b/main/assets/BufferView-PQoE3GL7-DXIpDOUe.js deleted file mode 100644 index 81cfbd52c..000000000 --- a/main/assets/BufferView-PQoE3GL7-DXIpDOUe.js +++ /dev/null @@ -1 +0,0 @@ -import{m as D}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as G}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{y as H}from"./vec42-D8CJyqHG-DnfLTeQH.js";let k=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=9;const i=this.TypedArrayConstructor;r===void 0&&(r=9*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;for(let y=0;y<9;++y)r[i++]=s[u++]}get buffer(){return this.typedBuffer.buffer}};k.ElementCount=9;let q=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=16;const i=this.TypedArrayConstructor;r===void 0&&(r=16*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){this.copyFromTypedBuffer(f,e.typedBuffer,t*e.typedBufferStride)}copyFromTypedBuffer(f,e,t){const r=this.typedBuffer;let s=f*this.typedBufferStride;for(let i=0;i<16;++i)r[s++]=e[t++]}get buffer(){return this.typedBuffer.buffer}};q.ElementCount=16;class n{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=1;const u=this.TypedArrayConstructor;s===void 0&&(s=u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}n.ElementCount=1;let h=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=2;const i=this.TypedArrayConstructor;r===void 0&&(r=2*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,D(e,this.typedBuffer[f],this.typedBuffer[f+1])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f]=e[1]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};h.ElementCount=2;let c=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=3;const i=this.TypedArrayConstructor;r===void 0&&(r=3*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,G(e,this.typedBuffer[f],this.typedBuffer[f+1],this.typedBuffer[f+2])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f++]=e[1],this.typedBuffer[f]=e[2]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t,r){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f++]=t,this.typedBuffer[f]=r}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};c.ElementCount=3;class d{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const u=this.TypedArrayConstructor;s===void 0&&(s=4*u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,H(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=s,this.typedBuffer[e]=i}copyFrom(e,t,r){const s=this.typedBuffer,i=t.typedBuffer;let u=e*this.typedBufferStride,y=r*t.typedBufferStride;s[u++]=i[y++],s[u++]=i[y++],s[u++]=i[y++],s[u]=i[y]}get buffer(){return this.typedBuffer.buffer}}d.ElementCount=4;class z extends n{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static fromTypedArray(e,t){return new z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}z.ElementType="f32";class p extends h{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(p,e,t)}static fromTypedArray(e,t){return new p(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}p.ElementType="f32";class l extends c{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}l.ElementType="f32";let _=class j extends d{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(j,e,t)}static fromTypedArray(e,t){return new j(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};_.ElementType="f32";class o extends k{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}o.ElementType="f32";class B extends k{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}B.ElementType="f64";class a extends q{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}a.ElementType="f32";class b extends q{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}b.ElementType="f64";class T extends n{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}T.ElementType="f64";class E extends h{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}E.ElementType="f64";class m extends c{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}m.ElementType="f64";class A extends d{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}A.ElementType="f64";class O extends n{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}O.ElementType="u8";class S extends h{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}S.ElementType="u8";class g extends c{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}g.ElementType="u8";class L extends d{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}L.ElementType="u8";class w extends n{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}w.ElementType="u16";class x extends h{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}x.ElementType="u16";class M extends c{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}M.ElementType="u16";class C extends d{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}C.ElementType="u16";class N extends n{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}N.ElementType="u32";class P extends h{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}P.ElementType="u32";class R extends c{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(R,e,t)}static fromTypedArray(e,t){return new R(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}R.ElementType="u32";class Y extends d{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Y,e,t)}static fromTypedArray(e,t){return new Y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Y.ElementType="u32";class F extends n{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}F.ElementType="i8";class I extends h{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}I.ElementType="i8";class U extends c{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}U.ElementType="i8";class V extends d{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}V.ElementType="i8";class v extends n{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}v.ElementType="i16";class K extends h{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}K.ElementType="i16";class Q extends c{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Q.ElementType="i16";class W extends d{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(W,e,t)}static fromTypedArray(e,t){return new W(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}W.ElementType="i16";class X extends n{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(X,e,t)}static fromTypedArray(e,t){return new X(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}X.ElementType="i32";class $ extends h{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i32";class J extends c{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}J.ElementType="i32";class Z extends d{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Z,e,t)}static fromTypedArray(e,t){return new Z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Z.ElementType="i32";export{A,a as B,C,X as D,E,F,$ as G,J as H,I,z as J,L,M,N,O,P,R,S,T,U,V,_ as X,Y,B as a,b,g,K as j,Q as k,l,m,o,p,W as q,v,w,x,Z as z}; diff --git a/main/assets/BufferView-PQoE3GL7-M6q1od-Y.js b/main/assets/BufferView-PQoE3GL7-M6q1od-Y.js new file mode 100644 index 000000000..97e6f8899 --- /dev/null +++ b/main/assets/BufferView-PQoE3GL7-M6q1od-Y.js @@ -0,0 +1 @@ +import{m as D}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as G}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{y as H}from"./vec42-D8CJyqHG-DnfLTeQH.js";let k=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=9;const i=this.TypedArrayConstructor;r===void 0&&(r=9*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;for(let y=0;y<9;++y)r[i++]=s[u++]}get buffer(){return this.typedBuffer.buffer}};k.ElementCount=9;let q=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=16;const i=this.TypedArrayConstructor;r===void 0&&(r=16*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){this.copyFromTypedBuffer(f,e.typedBuffer,t*e.typedBufferStride)}copyFromTypedBuffer(f,e,t){const r=this.typedBuffer;let s=f*this.typedBufferStride;for(let i=0;i<16;++i)r[s++]=e[t++]}get buffer(){return this.typedBuffer.buffer}};q.ElementCount=16;class n{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=1;const u=this.TypedArrayConstructor;s===void 0&&(s=u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}n.ElementCount=1;let h=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=2;const i=this.TypedArrayConstructor;r===void 0&&(r=2*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,D(e,this.typedBuffer[f],this.typedBuffer[f+1])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f]=e[1]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};h.ElementCount=2;let c=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=3;const i=this.TypedArrayConstructor;r===void 0&&(r=3*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,G(e,this.typedBuffer[f],this.typedBuffer[f+1],this.typedBuffer[f+2])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f++]=e[1],this.typedBuffer[f]=e[2]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t,r){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f++]=t,this.typedBuffer[f]=r}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};c.ElementCount=3;class d{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const u=this.TypedArrayConstructor;s===void 0&&(s=4*u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,H(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=s,this.typedBuffer[e]=i}copyFrom(e,t,r){const s=this.typedBuffer,i=t.typedBuffer;let u=e*this.typedBufferStride,y=r*t.typedBufferStride;s[u++]=i[y++],s[u++]=i[y++],s[u++]=i[y++],s[u]=i[y]}get buffer(){return this.typedBuffer.buffer}}d.ElementCount=4;class z extends n{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static fromTypedArray(e,t){return new z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}z.ElementType="f32";class p extends h{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(p,e,t)}static fromTypedArray(e,t){return new p(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}p.ElementType="f32";class l extends c{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}l.ElementType="f32";let _=class j extends d{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(j,e,t)}static fromTypedArray(e,t){return new j(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};_.ElementType="f32";class o extends k{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}o.ElementType="f32";class B extends k{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}B.ElementType="f64";class a extends q{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}a.ElementType="f32";class b extends q{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}b.ElementType="f64";class T extends n{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}T.ElementType="f64";class E extends h{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}E.ElementType="f64";class m extends c{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}m.ElementType="f64";class A extends d{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}A.ElementType="f64";class O extends n{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}O.ElementType="u8";class S extends h{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}S.ElementType="u8";class g extends c{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}g.ElementType="u8";class L extends d{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}L.ElementType="u8";class w extends n{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}w.ElementType="u16";class x extends h{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}x.ElementType="u16";class M extends c{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}M.ElementType="u16";class C extends d{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}C.ElementType="u16";class N extends n{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}N.ElementType="u32";class P extends h{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}P.ElementType="u32";class R extends c{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(R,e,t)}static fromTypedArray(e,t){return new R(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}R.ElementType="u32";class Y extends d{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Y,e,t)}static fromTypedArray(e,t){return new Y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Y.ElementType="u32";class F extends n{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}F.ElementType="i8";class I extends h{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}I.ElementType="i8";class U extends c{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}U.ElementType="i8";class V extends d{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}V.ElementType="i8";class v extends n{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}v.ElementType="i16";class K extends h{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}K.ElementType="i16";class Q extends c{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Q.ElementType="i16";class W extends d{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(W,e,t)}static fromTypedArray(e,t){return new W(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}W.ElementType="i16";class X extends n{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(X,e,t)}static fromTypedArray(e,t){return new X(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}X.ElementType="i32";class $ extends h{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i32";class J extends c{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}J.ElementType="i32";class Z extends d{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Z,e,t)}static fromTypedArray(e,t){return new Z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Z.ElementType="i32";export{A,a as B,C,X as D,E,F,$ as G,J as H,I,z as J,L,M,N,O,P,R,S,T,U,V,_ as X,Y,B as a,b,g,K as j,Q as k,l,m,o,p,W as q,v,w,x,Z as z}; diff --git a/main/assets/BuildingSceneLayer-IIePcdNz-ByUbiYty.js b/main/assets/BuildingSceneLayer-IIePcdNz-ByUbiYty.js deleted file mode 100644 index 05aed87f2..000000000 --- a/main/assets/BuildingSceneLayer-IIePcdNz-ByUbiYty.js +++ /dev/null @@ -1 +0,0 @@ -import{bR as de,v as t,S as i,a0 as I,bB as ce,i as p,aB as Y,at as ee,a1 as x,f as te,j3 as me,o as F,bi as he,n as fe,J as re,bL as ge,bz as ie,aK as ve,ag as v,jv as be,P as d,bX as Se,W as we,b0 as Oe,e as h}from"./main-BZaw9FpY.js";import{f as je}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import{y as xe,s as Fe}from"./loadAll-e978YItg-CB-7_cng.js";import{m as Ie,_ as Le}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as Te}from"./Layer-ChoECxvZ-C4wLrCej.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{u as Be}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import oe from"./FeatureLayer-BrRKw5Si-CHreUEJ9.js";import{H as P,X as Ee,Q as _e,_ as Ae,$ as $e}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{t as Pe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{f as qe}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{o as Re}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{T as Ne,W as ke,f as J}from"./SceneService-BZqGtWmG-B8Xgkv2e.js";import{y as Me,o as Qe,d as De,m as Ke}from"./I3SLayerDefinitions-CwLXCKtU-DIMh5lHL.js";import{b as Ce}from"./Query-BrwMGK8U-sojFdYaD.js";import{w as Ue}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{q as Ve}from"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import{_ as Je}from"./I3SUtil-Bq8KpP2j-B88-rKNw.js";import{h as He,m as Ze}from"./popupUtils-nV1O8RUO-xbvi-u4x.js";import{n as Ge}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as We}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{i as Xe}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as ze}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as Ye}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as et}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{b as tt}from"./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js";import{r as rt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{k as H,R as it,j as ot}from"./elevationInfoUtils-mOZsPH2J-CGmjotSk.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./versionUtils-LZYZz-38-xZnsxhiL.js";import"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./jsonContext-BA8GHqVk-BMETb6sX.js";import"./resourceUtils-BmW6QqlX-Cs99W_og.js";import"./resourceUtils-rTM6Iemx-C_sFWCPe.js";import"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./projectVectorToVector-sIYLNlex-CXXu_lyF.js";import"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import"./sphere-BenPORjV-CgNvGf8s.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-fuXvBrPY.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./NormalAttribute.glsl-axtNsUxo-corrAl_5.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-CdJ2bdTT.js";import"./quat-BODLR7mS-Bk09s2KF.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";let y=class extends de(Le){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(e,r){return typeof r.alias=="string"?r.alias:typeof r.name=="string"?r.name:""}readIdOnlyOnce(e){return this.id!==-1?this.id:typeof e=="number"?e:-1}};t([i({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([I("service","title",["alias","name"])],y.prototype,"readTitle",null),t([i()],y.prototype,"layer",void 0),t([i({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([I("service","id")],y.prototype,"readIdOnlyOnce",null),t([i(P(String))],y.prototype,"modelName",void 0),t([i(P(Boolean))],y.prototype,"isEmpty",void 0),t([i({type:Boolean,nonNullable:!0})],y.prototype,"legendEnabled",void 0),t([i({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const se=y,Z=qe();let s=class extends Y.LoadableMixin(ee(se)){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new Re(this.fields)}readAssociatedLayer(e,r){const o=this.layer.associatedFeatureServiceItem,a=r.associatedLayerID;return o!=null&&typeof a=="number"?new oe({portalItem:o,customParameters:this.customParameters,layerId:a}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=e!=null?e.signal:null,o=this._fetchService(r).then(()=>{this.indexInfo=Ne(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,x.getLogger(this),r)});return this.addResolvingPromise(o),Promise.resolve(this)}createPopupTemplate(e){return Ue(this,e)}async _fetchService(e){const r=(await te(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){const o=this.getFeatureType(r?.feature)?.domains?.[e];return o&&o.type!=="inherited"?o:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Pe,{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}=e;return{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}}createQuery(){const e=new Ce;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatures(e||this.createQuery(),r)).then(o=>{if(o?.features)for(const a of o.features)a.layer=this.layer,a.sourceLayer=this;return o})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const o=me(this.fieldsIndex,await He(this,Ze(this)));return Je(this.parsedUrl.path,this.attributeStorageInfo,e,r,o,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const o=await this.queryCachedAttributes(e,[r]);if(!o||o.length===0)throw new F("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new he({attributes:o[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([i({readOnly:!0})],s.prototype,"parsedUrl",null),t([i({type:Me,readOnly:!0})],s.prototype,"nodePages",void 0),t([i({type:[Qe],readOnly:!0})],s.prototype,"materialDefinitions",void 0),t([i({type:[De],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),t([i({type:[Ke],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),t([i({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),t([i({readOnly:!0})],s.prototype,"store",void 0),t([i({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],s.prototype,"rootNode",void 0),t([i({readOnly:!0})],s.prototype,"attributeStorageInfo",void 0),t([i(Z.fields)],s.prototype,"fields",void 0),t([i({readOnly:!0})],s.prototype,"fieldsIndex",null),t([i({readOnly:!0,type:oe})],s.prototype,"associatedLayer",void 0),t([I("service","associatedLayer",["associatedLayerID"])],s.prototype,"readAssociatedLayer",null),t([i(Z.outFields)],s.prototype,"outFields",void 0),t([i({type:String,readOnly:!0})],s.prototype,"objectIdField",null),t([i({readOnly:!0,type:String,json:{read:!1}})],s.prototype,"displayField",null),t([i({readOnly:!0,type:String})],s.prototype,"apiKey",null),t([i({readOnly:!0,type:String})],s.prototype,"customParameters",null),t([i({readOnly:!0,type:fe})],s.prototype,"fullExtent",null),t([i({readOnly:!0,type:re})],s.prototype,"spatialReference",null),t([i({readOnly:!0})],s.prototype,"version",null),t([i({readOnly:!0,type:Ve})],s.prototype,"elevationInfo",null),t([i({readOnly:!0,type:Number})],s.prototype,"minScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"maxScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"effectiveScaleRange",null),t([i({type:["hide","show"],json:{write:!0}})],s.prototype,"listMode",void 0),t([i({types:Be,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],s.prototype,"renderer",void 0),t([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),t([i(Ee)],s.prototype,"popupEnabled",void 0),t([i({type:ge,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],s.prototype,"popupTemplate",void 0),t([i({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],s.prototype,"normalReferenceFrame",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"defaultPopupTemplate",null),t([i()],s.prototype,"types",null),t([i()],s.prototype,"typeIdField",null),t([i({json:{write:!1}}),ie(new ve({"3DObject":"3d-object",Point:"point"}))],s.prototype,"layerType",void 0),t([i()],s.prototype,"geometryType",null),t([i()],s.prototype,"profile",null),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"capabilities",null),t([i({readOnly:!0})],s.prototype,"statisticsInfo",void 0),s=t([p("esri.layers.buildingSublayers.BuildingComponentSublayer")],s);const q=s;var R;const G={type:v,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:ae}}},read:!1}};function ae(e,r,o){if(e&&Array.isArray(e))return new v(e.map(a=>{const l=st(a);if(l){const b=new l;return b.read(a,o),b}return o?.messages&&a&&o.messages.push(new Oe("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(a.type||"unknown")+"' are not supported",{definition:a,context:o})),null}))}let m=R=class extends se{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return Fe(this,e=>R.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function st(e){return e.layerType==="group"?m:q}t([i({type:["hide","show","hide-children"],json:{write:!0}})],m.prototype,"listMode",void 0),t([i(G)],m.prototype,"sublayers",void 0),m=R=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],m),function(e){function r(o,a){o.forEach(l=>{a(l),l.type==="building-group"&&r(l.sublayers,a)})}e.sublayersProperty=G,e.readSublayers=ae,e.forEachSublayer=r}(m||(m={}));const g=m;let L=class extends h{constructor(){super(...arguments),this.type=null}};t([i({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const ne=L;var N;let S=N=class extends h{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new N({filterType:this.filterType,filterValues:d(this.filterValues)})}};t([i({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([i({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=N=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const at=S;var k;const nt=v.ofType(at);let T=k=class extends h{clone(){return new k({filterTypes:d(this.filterTypes)})}};t([i({type:nt,json:{write:!0}})],T.prototype,"filterTypes",void 0),T=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],T);const lt=T;var M;const pt=v.ofType(lt);let w=M=class extends ne{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:d(this.filterBlocks)})}};t([i({type:["checkbox"]})],w.prototype,"type",void 0),t([i({type:pt,json:{write:!0}})],w.prototype,"filterBlocks",void 0),w=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],w);const W=w;let B=class extends h{};t([i({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),B=t([p("esri.layers.support.BuildingFilterMode")],B);const A=B;var Q;let E=Q=class extends A{constructor(){super(...arguments),this.type="solid"}clone(){return new Q}};t([i({type:["solid"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=Q=t([p("esri.layers.support.BuildingFilterModeSolid")],E);const D=E;var K;let O=K=class extends A{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new K({edges:d(this.edges)})}};t([ie({wireFrame:"wire-frame"})],O.prototype,"type",void 0),t([i(be)],O.prototype,"edges",void 0),O=K=t([p("esri.layers.support.BuildingFilterModeWireFrame")],O);const X=O;var C;let _=C=class extends A{constructor(){super(...arguments),this.type="x-ray"}clone(){return new C}};t([i({type:["x-ray"],readOnly:!0,json:{write:!0}})],_.prototype,"type",void 0),_=C=t([p("esri.layers.support.BuildingFilterModeXRay")],_);const z=_;var U;const yt={nonNullable:!0,types:{key:"type",base:A,typeMap:{solid:D,"wire-frame":X,"x-ray":z}},json:{read:e=>{switch(e?.type){case"solid":return D.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return z.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let f=U=class extends h{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new D,this.title=""}clone(){return new U({filterExpression:this.filterExpression,filterMode:d(this.filterMode),title:this.title})}};t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"filterExpression",void 0),t([i(yt)],f.prototype,"filterMode",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"title",void 0),f=U=t([p("esri.layers.support.BuildingFilterBlock")],f);const ut=f;var V;const dt=v.ofType(ut);let c=V=class extends h{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=rt(),this.name=null}clone(){return new V({description:this.description,filterBlocks:d(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:d(this.filterAuthoringInfo)})}};t([i({type:String,json:{write:!0}})],c.prototype,"description",void 0),t([i({type:dt,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"filterBlocks",void 0),t([i({types:{key:"type",base:ne,typeMap:{checkbox:W}},json:{read:e=>e?.type==="checkbox"?W.fromJSON(e):null,write:!0}})],c.prototype,"filterAuthoringInfo",void 0),t([i({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"id",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"name",void 0),c=V=t([p("esri.layers.support.BuildingFilter")],c);const ct=c;let u=class extends h{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([i({type:String})],u.prototype,"fieldName",void 0),t([i({type:String})],u.prototype,"modelName",void 0),t([i({type:String})],u.prototype,"label",void 0),t([i({type:Number})],u.prototype,"min",void 0),t([i({type:Number})],u.prototype,"max",void 0),t([i({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],u.prototype,"mostFrequentValues",void 0),t([i({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingSummaryStatistics.BuildingFieldStatistics")],u);let j=class extends Y.LoadableMixin(ee(h)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(x.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await te(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([i({constructOnly:!0,type:String})],j.prototype,"url",void 0),t([i({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],j.prototype,"fields",null),j=t([p("esri.layers.support.BuildingSummaryStatistics")],j);const le=j,pe=v.ofType(ct),ye=d(g.sublayersProperty),$=ye.json?.origins;$&&($["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},$["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let n=class extends ke(We(ze(Ye(et(Ie(Xe(Ge(Te)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new je({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._allSublayerOverrides=null,this.filters=new pe,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,o){const a=g.readSublayers(e,r,o);return g.forEachSublayer(a,l=>l.layer=this),this._allSublayerOverrides&&(mt(a,this._allSublayerOverrides),this._allSublayerOverrides=null),a}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?ft(this.sublayers,e,r):this._allSublayerOverrides&>(this._allSublayerOverrides,e,r)),e}read(e,r){if(super.read(e,r),(r?.origin==="web-scene"||r?.origin==="portal-item")&&Array.isArray(e?.sublayers)){const o=ht(e.sublayers,r);this.sublayers?ue(this.sublayers,o):(this._allSublayerOverrides??=new Map,this._allSublayerOverrides.set(r.origin,o))}}readSummaryStatistics(e,r){if(typeof r.statisticsHRef=="string"){const o=Se(this.parsedUrl?.path,r.statisticsHRef);return new le({url:o})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,o=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(we).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(o),Promise.resolve(this)}loadAll(){return xe(this,e=>{g.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(J.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(J.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new F("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await tt(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){x.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";H(x.getLogger(this),it(r,"absolute-height",e)),H(x.getLogger(this),ot(r,e))}};function mt(e,r){r.forEach(o=>ue(e,o))}function ue(e,r){const{overrides:o,context:a}=r;g.forEachSublayer(e,l=>l.read(o.get(l.id),a))}function ht(e,r){const o=new Map;for(const a of e)a!=null&&typeof a=="object"&&typeof a.id=="number"?o.set(a.id,a):r.messages?.push(new F("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:a}));return{overrides:o,context:r}}function ft(e,r,o){const a=[];g.forEachSublayer(e,l=>{const b=l.write({},o);Object.keys(b).length>1&&a.push(b)}),a.length>0&&(r.sublayers=a)}function gt(e,r,o){const a=o?.origin&&e.get(o.origin);a&&(r.sublayers=[],a.overrides.forEach(l=>{r.sublayers.push(d(l))}))}t([i({type:["BuildingSceneLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({readOnly:!0})],n.prototype,"allSublayers",void 0),t([i(ye)],n.prototype,"sublayers",void 0),t([I("service","sublayers")],n.prototype,"readSublayers",null),t([i({type:pe,nonNullable:!0,json:{write:!0}})],n.prototype,"filters",void 0),t([i({type:String,json:{write:!0}})],n.prototype,"activeFilterId",void 0),t([i({readOnly:!0,type:le})],n.prototype,"summaryStatistics",void 0),t([I("summaryStatistics",["statisticsHRef"])],n.prototype,"readSummaryStatistics",null),t([i({type:[String],json:{read:!1}})],n.prototype,"outFields",void 0),t([i(_e)],n.prototype,"fullExtent",void 0),t([i(Ae)],n.prototype,"legendEnabled",void 0),t([i({type:["show","hide","hide-children"]})],n.prototype,"listMode",void 0),t([i(P(re))],n.prototype,"spatialReference",void 0),t([i($e)],n.prototype,"elevationInfo",null),t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i()],n.prototype,"associatedFeatureServiceItem",void 0),n=t([p("esri.layers.BuildingSceneLayer")],n);const Bi=n;export{Bi as default}; diff --git a/main/assets/BuildingSceneLayer-IIePcdNz-xcftlFLr.js b/main/assets/BuildingSceneLayer-IIePcdNz-xcftlFLr.js new file mode 100644 index 000000000..0bf592efc --- /dev/null +++ b/main/assets/BuildingSceneLayer-IIePcdNz-xcftlFLr.js @@ -0,0 +1 @@ +import{bR as de,v as t,S as i,a0 as I,bB as ce,i as p,aB as Y,at as ee,a1 as x,f as te,j3 as me,o as F,bi as he,n as fe,J as re,bL as ge,bz as ie,aK as ve,ag as v,jv as be,P as d,bX as Se,W as we,b0 as Oe,e as h}from"./main-C7yV2j71.js";import{f as je}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import{y as xe,s as Fe}from"./loadAll-e978YItg-NjG3VBGi.js";import{m as Ie,_ as Le}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as Te}from"./Layer-ChoECxvZ--vVxyMLZ.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{u as Be}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import oe from"./FeatureLayer-BrRKw5Si-Rem12G_g.js";import{H as P,X as Ee,Q as _e,_ as Ae,$ as $e}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{t as Pe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{f as qe}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{o as Re}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{T as Ne,W as ke,f as J}from"./SceneService-BZqGtWmG-B9O0VJ5b.js";import{y as Me,o as Qe,d as De,m as Ke}from"./I3SLayerDefinitions-CwLXCKtU-DliEVqX4.js";import{b as Ce}from"./Query-BrwMGK8U-DV_czrJX.js";import{w as Ue}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{q as Ve}from"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import{_ as Je}from"./I3SUtil-Bq8KpP2j-DfTxNx-1.js";import{h as He,m as Ze}from"./popupUtils-nV1O8RUO-X6GWMgRY.js";import{n as Ge}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as We}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{i as Xe}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as ze}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as Ye}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as et}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{b as tt}from"./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js";import{r as rt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{k as H,R as it,j as ot}from"./elevationInfoUtils-mOZsPH2J-Bwot-813.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./editsZScale-BDsX6vv--CoeIQyxn.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import"./versionUtils-LZYZz-38-DgmFurh2.js";import"./styleUtils-ChrJTYIw-OCRItq_6.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./jsonContext-BA8GHqVk-DpBf0bCt.js";import"./resourceUtils-BmW6QqlX-CP-OW4gT.js";import"./resourceUtils-rTM6Iemx-Bu5Czfos.js";import"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./projectVectorToVector-sIYLNlex-B5U5xz17.js";import"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import"./sphere-BenPORjV-CiIWUavi.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CdQQbSdq.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./I3SBinaryReader-DEbI3cKZ-D9EuM1ww.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BA8RF5F7.js";import"./quat-BODLR7mS-Dbd8ftOx.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";let y=class extends de(Le){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(e,r){return typeof r.alias=="string"?r.alias:typeof r.name=="string"?r.name:""}readIdOnlyOnce(e){return this.id!==-1?this.id:typeof e=="number"?e:-1}};t([i({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([I("service","title",["alias","name"])],y.prototype,"readTitle",null),t([i()],y.prototype,"layer",void 0),t([i({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([I("service","id")],y.prototype,"readIdOnlyOnce",null),t([i(P(String))],y.prototype,"modelName",void 0),t([i(P(Boolean))],y.prototype,"isEmpty",void 0),t([i({type:Boolean,nonNullable:!0})],y.prototype,"legendEnabled",void 0),t([i({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const se=y,Z=qe();let s=class extends Y.LoadableMixin(ee(se)){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new Re(this.fields)}readAssociatedLayer(e,r){const o=this.layer.associatedFeatureServiceItem,a=r.associatedLayerID;return o!=null&&typeof a=="number"?new oe({portalItem:o,customParameters:this.customParameters,layerId:a}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=e!=null?e.signal:null,o=this._fetchService(r).then(()=>{this.indexInfo=Ne(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,x.getLogger(this),r)});return this.addResolvingPromise(o),Promise.resolve(this)}createPopupTemplate(e){return Ue(this,e)}async _fetchService(e){const r=(await te(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){const o=this.getFeatureType(r?.feature)?.domains?.[e];return o&&o.type!=="inherited"?o:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Pe,{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}=e;return{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}}createQuery(){const e=new Ce;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatures(e||this.createQuery(),r)).then(o=>{if(o?.features)for(const a of o.features)a.layer=this.layer,a.sourceLayer=this;return o})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const o=me(this.fieldsIndex,await He(this,Ze(this)));return Je(this.parsedUrl.path,this.attributeStorageInfo,e,r,o,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const o=await this.queryCachedAttributes(e,[r]);if(!o||o.length===0)throw new F("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new he({attributes:o[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([i({readOnly:!0})],s.prototype,"parsedUrl",null),t([i({type:Me,readOnly:!0})],s.prototype,"nodePages",void 0),t([i({type:[Qe],readOnly:!0})],s.prototype,"materialDefinitions",void 0),t([i({type:[De],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),t([i({type:[Ke],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),t([i({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),t([i({readOnly:!0})],s.prototype,"store",void 0),t([i({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],s.prototype,"rootNode",void 0),t([i({readOnly:!0})],s.prototype,"attributeStorageInfo",void 0),t([i(Z.fields)],s.prototype,"fields",void 0),t([i({readOnly:!0})],s.prototype,"fieldsIndex",null),t([i({readOnly:!0,type:oe})],s.prototype,"associatedLayer",void 0),t([I("service","associatedLayer",["associatedLayerID"])],s.prototype,"readAssociatedLayer",null),t([i(Z.outFields)],s.prototype,"outFields",void 0),t([i({type:String,readOnly:!0})],s.prototype,"objectIdField",null),t([i({readOnly:!0,type:String,json:{read:!1}})],s.prototype,"displayField",null),t([i({readOnly:!0,type:String})],s.prototype,"apiKey",null),t([i({readOnly:!0,type:String})],s.prototype,"customParameters",null),t([i({readOnly:!0,type:fe})],s.prototype,"fullExtent",null),t([i({readOnly:!0,type:re})],s.prototype,"spatialReference",null),t([i({readOnly:!0})],s.prototype,"version",null),t([i({readOnly:!0,type:Ve})],s.prototype,"elevationInfo",null),t([i({readOnly:!0,type:Number})],s.prototype,"minScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"maxScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"effectiveScaleRange",null),t([i({type:["hide","show"],json:{write:!0}})],s.prototype,"listMode",void 0),t([i({types:Be,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],s.prototype,"renderer",void 0),t([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),t([i(Ee)],s.prototype,"popupEnabled",void 0),t([i({type:ge,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],s.prototype,"popupTemplate",void 0),t([i({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],s.prototype,"normalReferenceFrame",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"defaultPopupTemplate",null),t([i()],s.prototype,"types",null),t([i()],s.prototype,"typeIdField",null),t([i({json:{write:!1}}),ie(new ve({"3DObject":"3d-object",Point:"point"}))],s.prototype,"layerType",void 0),t([i()],s.prototype,"geometryType",null),t([i()],s.prototype,"profile",null),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"capabilities",null),t([i({readOnly:!0})],s.prototype,"statisticsInfo",void 0),s=t([p("esri.layers.buildingSublayers.BuildingComponentSublayer")],s);const q=s;var R;const G={type:v,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:ae}}},read:!1}};function ae(e,r,o){if(e&&Array.isArray(e))return new v(e.map(a=>{const l=st(a);if(l){const b=new l;return b.read(a,o),b}return o?.messages&&a&&o.messages.push(new Oe("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(a.type||"unknown")+"' are not supported",{definition:a,context:o})),null}))}let m=R=class extends se{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return Fe(this,e=>R.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function st(e){return e.layerType==="group"?m:q}t([i({type:["hide","show","hide-children"],json:{write:!0}})],m.prototype,"listMode",void 0),t([i(G)],m.prototype,"sublayers",void 0),m=R=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],m),function(e){function r(o,a){o.forEach(l=>{a(l),l.type==="building-group"&&r(l.sublayers,a)})}e.sublayersProperty=G,e.readSublayers=ae,e.forEachSublayer=r}(m||(m={}));const g=m;let L=class extends h{constructor(){super(...arguments),this.type=null}};t([i({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const ne=L;var N;let S=N=class extends h{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new N({filterType:this.filterType,filterValues:d(this.filterValues)})}};t([i({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([i({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=N=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const at=S;var k;const nt=v.ofType(at);let T=k=class extends h{clone(){return new k({filterTypes:d(this.filterTypes)})}};t([i({type:nt,json:{write:!0}})],T.prototype,"filterTypes",void 0),T=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],T);const lt=T;var M;const pt=v.ofType(lt);let w=M=class extends ne{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:d(this.filterBlocks)})}};t([i({type:["checkbox"]})],w.prototype,"type",void 0),t([i({type:pt,json:{write:!0}})],w.prototype,"filterBlocks",void 0),w=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],w);const W=w;let B=class extends h{};t([i({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),B=t([p("esri.layers.support.BuildingFilterMode")],B);const A=B;var Q;let E=Q=class extends A{constructor(){super(...arguments),this.type="solid"}clone(){return new Q}};t([i({type:["solid"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=Q=t([p("esri.layers.support.BuildingFilterModeSolid")],E);const D=E;var K;let O=K=class extends A{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new K({edges:d(this.edges)})}};t([ie({wireFrame:"wire-frame"})],O.prototype,"type",void 0),t([i(be)],O.prototype,"edges",void 0),O=K=t([p("esri.layers.support.BuildingFilterModeWireFrame")],O);const X=O;var C;let _=C=class extends A{constructor(){super(...arguments),this.type="x-ray"}clone(){return new C}};t([i({type:["x-ray"],readOnly:!0,json:{write:!0}})],_.prototype,"type",void 0),_=C=t([p("esri.layers.support.BuildingFilterModeXRay")],_);const z=_;var U;const yt={nonNullable:!0,types:{key:"type",base:A,typeMap:{solid:D,"wire-frame":X,"x-ray":z}},json:{read:e=>{switch(e?.type){case"solid":return D.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return z.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let f=U=class extends h{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new D,this.title=""}clone(){return new U({filterExpression:this.filterExpression,filterMode:d(this.filterMode),title:this.title})}};t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"filterExpression",void 0),t([i(yt)],f.prototype,"filterMode",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"title",void 0),f=U=t([p("esri.layers.support.BuildingFilterBlock")],f);const ut=f;var V;const dt=v.ofType(ut);let c=V=class extends h{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=rt(),this.name=null}clone(){return new V({description:this.description,filterBlocks:d(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:d(this.filterAuthoringInfo)})}};t([i({type:String,json:{write:!0}})],c.prototype,"description",void 0),t([i({type:dt,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"filterBlocks",void 0),t([i({types:{key:"type",base:ne,typeMap:{checkbox:W}},json:{read:e=>e?.type==="checkbox"?W.fromJSON(e):null,write:!0}})],c.prototype,"filterAuthoringInfo",void 0),t([i({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"id",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"name",void 0),c=V=t([p("esri.layers.support.BuildingFilter")],c);const ct=c;let u=class extends h{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([i({type:String})],u.prototype,"fieldName",void 0),t([i({type:String})],u.prototype,"modelName",void 0),t([i({type:String})],u.prototype,"label",void 0),t([i({type:Number})],u.prototype,"min",void 0),t([i({type:Number})],u.prototype,"max",void 0),t([i({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],u.prototype,"mostFrequentValues",void 0),t([i({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingSummaryStatistics.BuildingFieldStatistics")],u);let j=class extends Y.LoadableMixin(ee(h)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(x.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await te(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([i({constructOnly:!0,type:String})],j.prototype,"url",void 0),t([i({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],j.prototype,"fields",null),j=t([p("esri.layers.support.BuildingSummaryStatistics")],j);const le=j,pe=v.ofType(ct),ye=d(g.sublayersProperty),$=ye.json?.origins;$&&($["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},$["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let n=class extends ke(We(ze(Ye(et(Ie(Xe(Ge(Te)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new je({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._allSublayerOverrides=null,this.filters=new pe,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,o){const a=g.readSublayers(e,r,o);return g.forEachSublayer(a,l=>l.layer=this),this._allSublayerOverrides&&(mt(a,this._allSublayerOverrides),this._allSublayerOverrides=null),a}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?ft(this.sublayers,e,r):this._allSublayerOverrides&>(this._allSublayerOverrides,e,r)),e}read(e,r){if(super.read(e,r),(r?.origin==="web-scene"||r?.origin==="portal-item")&&Array.isArray(e?.sublayers)){const o=ht(e.sublayers,r);this.sublayers?ue(this.sublayers,o):(this._allSublayerOverrides??=new Map,this._allSublayerOverrides.set(r.origin,o))}}readSummaryStatistics(e,r){if(typeof r.statisticsHRef=="string"){const o=Se(this.parsedUrl?.path,r.statisticsHRef);return new le({url:o})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,o=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(we).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(o),Promise.resolve(this)}loadAll(){return xe(this,e=>{g.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(J.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(J.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new F("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await tt(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){x.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";H(x.getLogger(this),it(r,"absolute-height",e)),H(x.getLogger(this),ot(r,e))}};function mt(e,r){r.forEach(o=>ue(e,o))}function ue(e,r){const{overrides:o,context:a}=r;g.forEachSublayer(e,l=>l.read(o.get(l.id),a))}function ht(e,r){const o=new Map;for(const a of e)a!=null&&typeof a=="object"&&typeof a.id=="number"?o.set(a.id,a):r.messages?.push(new F("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:a}));return{overrides:o,context:r}}function ft(e,r,o){const a=[];g.forEachSublayer(e,l=>{const b=l.write({},o);Object.keys(b).length>1&&a.push(b)}),a.length>0&&(r.sublayers=a)}function gt(e,r,o){const a=o?.origin&&e.get(o.origin);a&&(r.sublayers=[],a.overrides.forEach(l=>{r.sublayers.push(d(l))}))}t([i({type:["BuildingSceneLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({readOnly:!0})],n.prototype,"allSublayers",void 0),t([i(ye)],n.prototype,"sublayers",void 0),t([I("service","sublayers")],n.prototype,"readSublayers",null),t([i({type:pe,nonNullable:!0,json:{write:!0}})],n.prototype,"filters",void 0),t([i({type:String,json:{write:!0}})],n.prototype,"activeFilterId",void 0),t([i({readOnly:!0,type:le})],n.prototype,"summaryStatistics",void 0),t([I("summaryStatistics",["statisticsHRef"])],n.prototype,"readSummaryStatistics",null),t([i({type:[String],json:{read:!1}})],n.prototype,"outFields",void 0),t([i(_e)],n.prototype,"fullExtent",void 0),t([i(Ae)],n.prototype,"legendEnabled",void 0),t([i({type:["show","hide","hide-children"]})],n.prototype,"listMode",void 0),t([i(P(re))],n.prototype,"spatialReference",void 0),t([i($e)],n.prototype,"elevationInfo",null),t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i()],n.prototype,"associatedFeatureServiceItem",void 0),n=t([p("esri.layers.BuildingSceneLayer")],n);const Bi=n;export{Bi as default}; diff --git a/main/assets/Button-MQvwxOnj-A6j60P2U.js b/main/assets/Button-MQvwxOnj-A6j60P2U.js deleted file mode 100644 index 2c9a6f19c..000000000 --- a/main/assets/Button-MQvwxOnj-A6j60P2U.js +++ /dev/null @@ -1 +0,0 @@ -import{K as f,H as R,B as _,aw as b,ao as T,aq as g}from"./Theme-rblUnB2V-BIrfCzYF.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,c=t/Math.abs(s),l=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=b(this.get("cornerRadiusTL",8),d),n=b(this.get("cornerRadiusTR",8),d),o=b(this.get("cornerRadiusBR",8),d),h=b(this.get("cornerRadiusBL",8),d),u=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,u),n=g(n,0,u),o=g(o,0,u),h=g(h,0,u);const a=this._display;a.moveTo(r*c,0),a.lineTo(t-n*c,0),n>0&&a.arcTo(t,0,t,n*l,n),a.lineTo(t,i-o*l),o>0&&a.arcTo(t,i,t-o*c,i,o),a.lineTo(h*c,i),h>0&&a.arcTo(0,i,0,i-h*l,h),a.lineTo(0,r*l),r>0&&a.arcTo(0,0,r*c,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])})),this.setPrivate("trustBounds",!0)}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as l,m}; diff --git a/main/assets/Button-MQvwxOnj-DFss60Dm.js b/main/assets/Button-MQvwxOnj-DFss60Dm.js new file mode 100644 index 000000000..22f90ec57 --- /dev/null +++ b/main/assets/Button-MQvwxOnj-DFss60Dm.js @@ -0,0 +1 @@ +import{K as f,H as R,B as _,aw as b,ao as T,aq as g}from"./Theme-rblUnB2V-BgKdZgu2.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,c=t/Math.abs(s),l=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=b(this.get("cornerRadiusTL",8),d),n=b(this.get("cornerRadiusTR",8),d),o=b(this.get("cornerRadiusBR",8),d),h=b(this.get("cornerRadiusBL",8),d),u=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,u),n=g(n,0,u),o=g(o,0,u),h=g(h,0,u);const a=this._display;a.moveTo(r*c,0),a.lineTo(t-n*c,0),n>0&&a.arcTo(t,0,t,n*l,n),a.lineTo(t,i-o*l),o>0&&a.arcTo(t,i,t-o*c,i,o),a.lineTo(h*c,i),h>0&&a.arcTo(0,i,0,i-h*l,h),a.lineTo(0,r*l),r>0&&a.arcTo(0,0,r*c,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])})),this.setPrivate("trustBounds",!0)}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as l,m}; diff --git a/main/assets/CSVLayer-CJQy-BsL-BoJ1PxIN.js b/main/assets/CSVLayer-CJQy-BsL-BoJ1PxIN.js deleted file mode 100644 index 19b63cc67..000000000 --- a/main/assets/CSVLayer-CJQy-BsL-BoJ1PxIN.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as r,i as d,a0 as v,jy as w,du as S,aB as O,bp as F,n as b,K as q,J as I,W as N,a as _,o as c}from"./main-BZaw9FpY.js";import J from"./FeatureLayer-BrRKw5Si-CHreUEJ9.js";import{q as C}from"./workers-PiCjreoO-oGzLvkSt.js";import{O as P}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{$ as j}from"./clientSideDefaults-BqqayPct-BMC57bnT.js";import{b as l}from"./Query-BrwMGK8U-sojFdYaD.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./versionUtils-LZYZz-38-xZnsxhiL.js";import"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";let n=class extends O{constructor(t){super(t),this.type="csv",this.refresh=F(async e=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",e);return s&&(this.sourceJSON.extent=s),a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const s=await this._connection.invoke("queryFeatures",t?t.toJSON():null,e);return P.fromJSON(s)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke("queryFeatures",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke("queryFeatureCount",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke("queryObjectIds",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const s=await this._connection.invoke("queryExtent",t?t.toJSON():null,e);return{count:s.count,extent:b.fromJSON(s.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke("querySnapping",t,e)}async _startWorker(t){this._connection=await C("CSVSourceWorker",{strategy:q("feature-layers-workers")?"dedicated":"local",signal:t,registryTarget:this});const{url:e,delimiter:s,fields:a,latitudeField:m,longitudeField:h,spatialReference:y,timeInfo:f}=this.loadOptions,p=await this._connection.invoke("load",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a?.map(g=>g.toJSON()),latitudeField:m,longitudeField:h,spatialReference:y?.toJSON(),timeInfo:f?.toJSON()}},{signal:t});this.locationInfo=p.locationInfo,this.sourceJSON=p.layerDefinition,this.delimiter=p.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([d("esri.layers.graphics.sources.CSVSource")],n);function u(t,e){throw new c(e,`CSVLayer (title: ${t.title}, id: ${t.id}) cannot be saved to a portal item`)}let o=class extends J{constructor(...t){super(...t),this.geometryType="point",this.capabilities=j(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=I.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},t).catch(N).then(async()=>this.initLayerProperties(await this.createGraphicsSource(e)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(t,e){return e.showLabels!=null?e.showLabels:!!e.layerDefinition?.drawingInfo?.labelingInfo}set url(t){if(!t)return void this._set("url",t);const e=_(t);this._set("url",e.path),e.query&&(this.customParameters={...this.customParameters,...e.query})}async createGraphicsSource(t){const e=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",e),await e.load({signal:t}),this.read({locationInfo:e.locationInfo,columnDelimiter:e.delimiter},{origin:"service",url:this.parsedUrl}),e}queryFeatures(t,e){return this.load().then(()=>this.source.queryFeatures(l.from(t)||this.createQuery())).then(s=>{if(s?.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(t,e){return this.load().then(()=>this.source.queryObjectIds(l.from(t)||this.createQuery()))}queryFeatureCount(t,e){return this.load().then(()=>this.source.queryFeatureCount(l.from(t)||this.createQuery()))}queryExtent(t,e){return this.load().then(()=>this.source.queryExtent(l.from(t)||this.createQuery()))}read(t,e){super.read(t,e),e&&e.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(t,e){return super.write(t,{...e,writeLayerSchema:!0})}clone(){throw new c("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(t){return u(this,"csv-layer:save")}async saveAs(t,e){return u(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:t,updates:e}=await this.source.refresh(this.customParameters);return e!=null&&this.read(e,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),t}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],o.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],o.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([v("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],o.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],o.prototype,"operationalLayerType",void 0),i([r()],o.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],o.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],o.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],o.prototype,"type",void 0),i([r({json:{read:w,write:{isRequired:!0,ignoreOrigin:!0,writer:S}}})],o.prototype,"url",null),o=i([d("esri.layers.CSVLayer")],o);const ue=o;export{ue as default}; diff --git a/main/assets/CSVLayer-CJQy-BsL-CVXWwvJs.js b/main/assets/CSVLayer-CJQy-BsL-CVXWwvJs.js new file mode 100644 index 000000000..e53b01272 --- /dev/null +++ b/main/assets/CSVLayer-CJQy-BsL-CVXWwvJs.js @@ -0,0 +1 @@ +import{v as i,S as r,i as d,a0 as v,jy as w,du as S,aB as O,bp as F,n as b,K as q,J as I,W as N,a as _,o as c}from"./main-C7yV2j71.js";import J from"./FeatureLayer-BrRKw5Si-Rem12G_g.js";import{q as C}from"./workers-PiCjreoO-DqI62TYf.js";import{O as P}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{$ as j}from"./clientSideDefaults-BqqayPct-B0cLE-po.js";import{b as l}from"./Query-BrwMGK8U-DV_czrJX.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./editsZScale-BDsX6vv--CoeIQyxn.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import"./ArcGISService-BYA-y6X6-BtWUPppI.js";import"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./PortalLayer-CElnYuSQ-BV63HHSL.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import"./versionUtils-LZYZz-38-DgmFurh2.js";import"./styleUtils-ChrJTYIw-OCRItq_6.js";import"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";let n=class extends O{constructor(t){super(t),this.type="csv",this.refresh=F(async e=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",e);return s&&(this.sourceJSON.extent=s),a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const s=await this._connection.invoke("queryFeatures",t?t.toJSON():null,e);return P.fromJSON(s)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke("queryFeatures",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke("queryFeatureCount",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke("queryObjectIds",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const s=await this._connection.invoke("queryExtent",t?t.toJSON():null,e);return{count:s.count,extent:b.fromJSON(s.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke("querySnapping",t,e)}async _startWorker(t){this._connection=await C("CSVSourceWorker",{strategy:q("feature-layers-workers")?"dedicated":"local",signal:t,registryTarget:this});const{url:e,delimiter:s,fields:a,latitudeField:m,longitudeField:h,spatialReference:y,timeInfo:f}=this.loadOptions,p=await this._connection.invoke("load",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a?.map(g=>g.toJSON()),latitudeField:m,longitudeField:h,spatialReference:y?.toJSON(),timeInfo:f?.toJSON()}},{signal:t});this.locationInfo=p.locationInfo,this.sourceJSON=p.layerDefinition,this.delimiter=p.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([d("esri.layers.graphics.sources.CSVSource")],n);function u(t,e){throw new c(e,`CSVLayer (title: ${t.title}, id: ${t.id}) cannot be saved to a portal item`)}let o=class extends J{constructor(...t){super(...t),this.geometryType="point",this.capabilities=j(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=I.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},t).catch(N).then(async()=>this.initLayerProperties(await this.createGraphicsSource(e)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(t,e){return e.showLabels!=null?e.showLabels:!!e.layerDefinition?.drawingInfo?.labelingInfo}set url(t){if(!t)return void this._set("url",t);const e=_(t);this._set("url",e.path),e.query&&(this.customParameters={...this.customParameters,...e.query})}async createGraphicsSource(t){const e=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",e),await e.load({signal:t}),this.read({locationInfo:e.locationInfo,columnDelimiter:e.delimiter},{origin:"service",url:this.parsedUrl}),e}queryFeatures(t,e){return this.load().then(()=>this.source.queryFeatures(l.from(t)||this.createQuery())).then(s=>{if(s?.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(t,e){return this.load().then(()=>this.source.queryObjectIds(l.from(t)||this.createQuery()))}queryFeatureCount(t,e){return this.load().then(()=>this.source.queryFeatureCount(l.from(t)||this.createQuery()))}queryExtent(t,e){return this.load().then(()=>this.source.queryExtent(l.from(t)||this.createQuery()))}read(t,e){super.read(t,e),e&&e.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(t,e){return super.write(t,{...e,writeLayerSchema:!0})}clone(){throw new c("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(t){return u(this,"csv-layer:save")}async saveAs(t,e){return u(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:t,updates:e}=await this.source.refresh(this.customParameters);return e!=null&&this.read(e,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),t}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],o.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],o.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([v("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],o.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],o.prototype,"operationalLayerType",void 0),i([r()],o.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],o.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],o.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],o.prototype,"type",void 0),i([r({json:{read:w,write:{isRequired:!0,ignoreOrigin:!0,writer:S}}})],o.prototype,"url",null),o=i([d("esri.layers.CSVLayer")],o);const ue=o;export{ue as default}; diff --git a/main/assets/CSVSourceWorker-Bks0IzRc-Dcjyeguo.js b/main/assets/CSVSourceWorker-Bks0IzRc-Dcjyeguo.js deleted file mode 100644 index 31b84749a..000000000 --- a/main/assets/CSVSourceWorker-Bks0IzRc-Dcjyeguo.js +++ /dev/null @@ -1,4 +0,0 @@ -import{o as F,ay as j,aU as R,a1 as V,a as L,f as P,cY as T,cX as $,aC as A,dR as G,fn as Y,J as M,ft as Q,gK as Z,d0 as I,gT as J}from"./main-BZaw9FpY.js";import{h as B,b as U}from"./date-Cqvy-TgA-DIf-QFLz.js";import{O as z}from"./projection-BA9M1R7d-DoNqITCd.js";import{a as H}from"./json-BI97KiBB-Ce5cWfI2.js";import{i as K,c as W}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{I as X}from"./FeatureStore-Co2V0sVE-CXrTGv5U.js";import{f as ee}from"./queryUtils-Brxu6254-DDAvXp_C.js";import{Z as te}from"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import{N as ie}from"./number-eRKYXfX9-B-l8dJUS.js";import{f as ne,d as re}from"./clientSideDefaults-BqqayPct-BMC57bnT.js";import{o as _}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-DBAJ8yky.js";import"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./signal-CETehA7D-vStzfbaY.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";function oe(o,i,e){i=I(i)?.toLowerCase(),e=I(e)?.toLowerCase();const t=o.map(s=>s.toLowerCase()),n=i?o[t.indexOf(i)]:null,a=e?o[t.indexOf(e)]:null;return{longitudeFieldName:n||o[t.indexOf(ae.find(s=>t.includes(s)))],latitudeFieldName:a||o[t.indexOf(se.find(s=>t.includes(s)))]}}const se=["lat","lat83","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],ae=["lon","lng","lng83","long","long83","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],b=/^\s*"([\S\s]*)"\s*$/,E=/""/g,S=` -`,le=[","," ",";","|"," "];function*O(o,i,e){let t=0;for(;t<=o.length;){const n=o.indexOf(i,t),a=o.slice(t,n>-1?n:void 0);t+=a.length+i.length,e&&!a.trim()||(yield a)}}function C(o){const i=o.includes(`\r -`)?`\r -`:S;return O(o,i,!0)}function q(o,i){return O(o,i,!1)}function ce(o,i,e){o=o.trim(),i=i?.trim();const t=[],n=Array.from(new Set([e?.delimiter,...le])).filter(s=>s!=null);for(const s of n){const l=N(o,s).length,c=N(i,s).length??l;l>1&&t.push({weight:Math.min(l,c),delimiter:s})}const a=t.sort(({weight:s},{weight:l})=>l-s).map(({delimiter:s})=>s);for(const s of a){const l=k(o,s).names,c=oe(l,e?.longitudeField,e?.latitudeField);if(c.longitudeFieldName&&c.latitudeFieldName)return{delimiter:s,locationInfo:c}}return{delimiter:a[0],locationInfo:null}}function*v(o,i,e,t=()=>Object.create(null)){const n=C(o);n.next();let a="",s="",l=0,c=t(),d=0;e:for(const y of n){const f=q(y,e);for(const p of f)if(a+=s+p,s="",l+=D(p),l%2==0){if(l>0){const h=b.exec(a);if(!h){c=t(),d=0,a="",l=0;continue e}c[i[d]]=h[1].replaceAll(E,'"'),d++}else c[i[d]]=a,d++;a="",l=0}else s=e;l===0?(yield c,c=t(),d=0):s=S}}function k(o,i){const e=N(o,i).filter(n=>n!=null),t=e.map(n=>I(n));for(let n=t.length-1;n>=0;n--)t[n]||(t.splice(n,1),e.splice(n,1));return{names:t,aliases:e}}function N(o,i){if(!o?.length)return[];const e=[];let t="",n="",a=0;const s=q(o,i);for(const l of s)if(t+=n+l,n="",a+=D(l),a%2==0){if(a>0){const c=b.exec(t);c&&e.push(c[1].replaceAll(E,'"'))}else e.push(t);t="",a=0}else n=i;return e}function D(o){let i=0,e=0;for(e=o.indexOf('"',e);e>=0;)i++,e=o.indexOf('"',e+1);return i}function ue(o,i,e,t,n){const a=[],s=v(o,e,i),l=[];for(const c of s){if(l.length===10)break;l.push(c)}for(let c=0;cp[d]))){case"integer":f="esriFieldTypeInteger";break;case"double":f="esriFieldTypeDouble";break;case"date":f="esriFieldTypeDate";break;default:f="esriFieldTypeString"}a.push({name:d,type:f,alias:y,length:J(f)})}}return a}function de(o){if(!o.length)return"string";const i=/[^+\-.,0-9]/;return o.map(e=>{if(e!==""){if(!i.test(e)){let t=w(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")&&(t=Number(e),!Number.isNaN(t)||e.includes(",")&&(e=e.replace(",","."),t=Number(e),!Number.isNaN(t))))return"double"}return U(e)?"date":"string"}}).reduce((e,t)=>e===void 0?t:t===void 0?e:e===t?t:e==="string"||t==="string"?"string":e==="double"||t==="double"?"double":void 0)}const w=function(){const o=ie(),i=new RegExp("^"+o.regexp+"$"),e=new RegExp("["+o.group+"\\s\\xa0]","g"),t=o.factor;return n=>{const a=i.exec(n);if(o.factor=t,!a)return NaN;let s=a[1];if(!a[1]){if(!a[2])return NaN;s=a[2],o.factor*=-1}return s=s.replace(e,"").replace(o.decimal,"."),+s*o.factor}}();function me(o){return JSON.parse(JSON.stringify(o))}const fe=re("esriGeometryPoint"),pe=["csv"],he=[0,0];class ye{constructor(i,e){this.x=i,this.y=e}}class mt{constructor(){this._queryEngine=null,this._snapshotFeatures=async i=>{const e=await this._fetch(i);return this._createFeatures(e)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(i,e={}){this._loadOptions=i;const[t]=await Promise.all([this._fetch(e.signal),this._checkProjection(i?.parsingOptions?.spatialReference)]),n=ge(t,i);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const a=await this._createFeatures(t);this._queryEngine.featureStore.addMany(a);const{fullExtent:s,timeExtent:l}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=s,l){const{start:c,end:d}=l;n.layerDefinition.timeInfo.timeExtent=[c,d]}return n}async applyEdits(){throw new F("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(i,e.signal)}async queryFeatureCount(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(i,e.signal)}async queryObjectIds(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(i,e.signal)}async queryExtent(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(i,e.signal)}async querySnapping(i,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(i,e.signal)}async refresh(i){this._loadOptions.customParameters=i,this._snapshotTask?.abort(),this._snapshotTask=j(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),R(n)||V.getLogger("esri.layers.CSVLayer").error(new F("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:e,timeExtent:t}=await this._queryEngine.fetchRecomputedExtents();return{extent:e,timeExtent:t}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(i){const{url:e,customParameters:t}=this._loadOptions;if(!e)throw new F("csv-layer:invalid-source","url not defined");const n=L(e);return(await P(n.path,{query:{...n.query,...t},responseType:"text",signal:i})).data}_createQueryEngine(i){const{objectIdField:e,fields:t,extent:n,timeInfo:a}=i.layerDefinition,s=new X({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new te({fieldsIndex:_.fromLayerJSON({fields:t,dateFieldsTimeReference:{timeZoneIANA:T}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:a,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},featureStore:s})}async _createFeatures(i){const{latitudeFieldName:e,longitudeFieldName:t}=this._locationInfo,{objectIdField:n,fieldsIndex:a,spatialReference:s}=this._queryEngine;let l=[];const c=[],d=a.fields.filter(r=>r.name!==n).map(r=>r.name);let y=0;const f={};for(const r of a.fields)if(r.type!=="esriFieldTypeOID"&&r.type!=="esriFieldTypeGlobalID"){const u=$(r);u!==void 0&&(f[r.name]=u)}const p=v(i,d,this._delimiter,ne(f,n));for(const r of p){const u=this._parseCoordinateValue(r[e]),g=this._parseCoordinateValue(r[t]);if(g!=null&&u!=null&&!isNaN(u)&&!isNaN(g)){r[e]=u,r[t]=g;for(const m in r)if(m!==e&&m!==t)if(a.isDateField(m))r[m]=B(r[m]);else if(a.isNumericField(m)){const x=w(r[m]);isNaN(x)?r[m]=null:r[m]=x}else r[m]!=null&&(r[m]=me(r[m]));r[n]=y,y++,l.push(new ye(g,u)),c.push(r)}}if(!A({wkid:4326},s))if(G(s))for(const r of l)[r.x,r.y]=Y(r.x,r.y,he);else l=z(H,l,M.WGS84,s,null,null);const h=[];for(let r=0;r181)&&(e=parseFloat(i)),e}async _checkProjection(i){try{await ee(Q,i)}catch{throw new F("csv-layer:projection-not-supported","Projection not supported")}}}function ge(o,i){const e=i.parsingOptions||{},t={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=t.layerDefinition={name:Z(i.url,pe)||"csv",dateFieldsTimeReference:{timeZoneIANA:T},drawingInfo:fe,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:e.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:e.spatialReference||{wkid:4326}}},a=C(o),s=a.next().value?.trim(),l=a.next().value?.trim();if(!s)throw new F("csv-layer:empty-csv","CSV is empty",{csv:o});const{delimiter:c,locationInfo:d}=ce(s,l,e);if(!c)throw new F("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:s,secondLine:l,parsingOptions:e});if(!d)throw new F("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:s,secondLine:l,parsingOptions:e});t.locationInfo=d,t.delimiter=c;const{names:y,aliases:f}=k(s,c),p=ue(o,t.delimiter,y,f,t.locationInfo);if(e.fields?.length){const r=new _(e.fields);for(const u of p){const g=r.get(u.name);g&&Object.assign(u,g)}}if(!p.some(r=>r.type==="esriFieldTypeOID"&&(n.objectIdField=r.name,!0))){const r={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=r.name,p.unshift(r)}n.fields=p;const h=new _(n.fields);if(t.locationInfo&&(t.locationInfo.latitudeFieldName=h.get(t.locationInfo.latitudeFieldName).name,t.locationInfo.longitudeFieldName=h.get(t.locationInfo.longitudeFieldName).name),n.timeInfo){const r=n.timeInfo;if(r.startTimeField){const u=h.get(r.startTimeField);u?(r.startTimeField=u.name,u.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const u=h.get(r.endTimeField);u?(r.endTimeField=u.name,u.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const u=h.get(r.trackIdField);r.trackIdField=u?u.name:null}r.startTimeField||r.endTimeField||(n.timeInfo=null)}return t}export{mt as default}; diff --git a/main/assets/CSVSourceWorker-Bks0IzRc-HIEnlbIk.js b/main/assets/CSVSourceWorker-Bks0IzRc-HIEnlbIk.js new file mode 100644 index 000000000..a7e30c4cb --- /dev/null +++ b/main/assets/CSVSourceWorker-Bks0IzRc-HIEnlbIk.js @@ -0,0 +1,4 @@ +import{o as F,ay as j,aU as R,a1 as V,a as L,f as P,cY as T,cX as $,aC as A,dR as G,fn as Y,J as M,ft as Q,gK as Z,d0 as I,gT as J}from"./main-C7yV2j71.js";import{h as B,b as U}from"./date-Cqvy-TgA-DIf-QFLz.js";import{O as z}from"./projection-BA9M1R7d-DXrPfsKU.js";import{a as H}from"./json-BI97KiBB-Ce5cWfI2.js";import{i as K,c as W}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{I as X}from"./FeatureStore-Co2V0sVE-BoTs_3tu.js";import{f as ee}from"./queryUtils-Brxu6254-T3UhaATW.js";import{Z as te}from"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import{N as ie}from"./number-eRKYXfX9-C213qXfW.js";import{f as ne,d as re}from"./clientSideDefaults-BqqayPct-B0cLE-po.js";import{o as _}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-mEMXylgh.js";import"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./signal-CETehA7D-DxK1orqE.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";function oe(o,i,e){i=I(i)?.toLowerCase(),e=I(e)?.toLowerCase();const t=o.map(s=>s.toLowerCase()),n=i?o[t.indexOf(i)]:null,a=e?o[t.indexOf(e)]:null;return{longitudeFieldName:n||o[t.indexOf(ae.find(s=>t.includes(s)))],latitudeFieldName:a||o[t.indexOf(se.find(s=>t.includes(s)))]}}const se=["lat","lat83","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],ae=["lon","lng","lng83","long","long83","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],b=/^\s*"([\S\s]*)"\s*$/,E=/""/g,S=` +`,le=[","," ",";","|"," "];function*O(o,i,e){let t=0;for(;t<=o.length;){const n=o.indexOf(i,t),a=o.slice(t,n>-1?n:void 0);t+=a.length+i.length,e&&!a.trim()||(yield a)}}function C(o){const i=o.includes(`\r +`)?`\r +`:S;return O(o,i,!0)}function q(o,i){return O(o,i,!1)}function ce(o,i,e){o=o.trim(),i=i?.trim();const t=[],n=Array.from(new Set([e?.delimiter,...le])).filter(s=>s!=null);for(const s of n){const l=N(o,s).length,c=N(i,s).length??l;l>1&&t.push({weight:Math.min(l,c),delimiter:s})}const a=t.sort(({weight:s},{weight:l})=>l-s).map(({delimiter:s})=>s);for(const s of a){const l=k(o,s).names,c=oe(l,e?.longitudeField,e?.latitudeField);if(c.longitudeFieldName&&c.latitudeFieldName)return{delimiter:s,locationInfo:c}}return{delimiter:a[0],locationInfo:null}}function*v(o,i,e,t=()=>Object.create(null)){const n=C(o);n.next();let a="",s="",l=0,c=t(),d=0;e:for(const y of n){const f=q(y,e);for(const p of f)if(a+=s+p,s="",l+=D(p),l%2==0){if(l>0){const h=b.exec(a);if(!h){c=t(),d=0,a="",l=0;continue e}c[i[d]]=h[1].replaceAll(E,'"'),d++}else c[i[d]]=a,d++;a="",l=0}else s=e;l===0?(yield c,c=t(),d=0):s=S}}function k(o,i){const e=N(o,i).filter(n=>n!=null),t=e.map(n=>I(n));for(let n=t.length-1;n>=0;n--)t[n]||(t.splice(n,1),e.splice(n,1));return{names:t,aliases:e}}function N(o,i){if(!o?.length)return[];const e=[];let t="",n="",a=0;const s=q(o,i);for(const l of s)if(t+=n+l,n="",a+=D(l),a%2==0){if(a>0){const c=b.exec(t);c&&e.push(c[1].replaceAll(E,'"'))}else e.push(t);t="",a=0}else n=i;return e}function D(o){let i=0,e=0;for(e=o.indexOf('"',e);e>=0;)i++,e=o.indexOf('"',e+1);return i}function ue(o,i,e,t,n){const a=[],s=v(o,e,i),l=[];for(const c of s){if(l.length===10)break;l.push(c)}for(let c=0;cp[d]))){case"integer":f="esriFieldTypeInteger";break;case"double":f="esriFieldTypeDouble";break;case"date":f="esriFieldTypeDate";break;default:f="esriFieldTypeString"}a.push({name:d,type:f,alias:y,length:J(f)})}}return a}function de(o){if(!o.length)return"string";const i=/[^+\-.,0-9]/;return o.map(e=>{if(e!==""){if(!i.test(e)){let t=w(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")&&(t=Number(e),!Number.isNaN(t)||e.includes(",")&&(e=e.replace(",","."),t=Number(e),!Number.isNaN(t))))return"double"}return U(e)?"date":"string"}}).reduce((e,t)=>e===void 0?t:t===void 0?e:e===t?t:e==="string"||t==="string"?"string":e==="double"||t==="double"?"double":void 0)}const w=function(){const o=ie(),i=new RegExp("^"+o.regexp+"$"),e=new RegExp("["+o.group+"\\s\\xa0]","g"),t=o.factor;return n=>{const a=i.exec(n);if(o.factor=t,!a)return NaN;let s=a[1];if(!a[1]){if(!a[2])return NaN;s=a[2],o.factor*=-1}return s=s.replace(e,"").replace(o.decimal,"."),+s*o.factor}}();function me(o){return JSON.parse(JSON.stringify(o))}const fe=re("esriGeometryPoint"),pe=["csv"],he=[0,0];class ye{constructor(i,e){this.x=i,this.y=e}}class mt{constructor(){this._queryEngine=null,this._snapshotFeatures=async i=>{const e=await this._fetch(i);return this._createFeatures(e)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(i,e={}){this._loadOptions=i;const[t]=await Promise.all([this._fetch(e.signal),this._checkProjection(i?.parsingOptions?.spatialReference)]),n=ge(t,i);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const a=await this._createFeatures(t);this._queryEngine.featureStore.addMany(a);const{fullExtent:s,timeExtent:l}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=s,l){const{start:c,end:d}=l;n.layerDefinition.timeInfo.timeExtent=[c,d]}return n}async applyEdits(){throw new F("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(i,e.signal)}async queryFeatureCount(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(i,e.signal)}async queryObjectIds(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(i,e.signal)}async queryExtent(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(i,e.signal)}async querySnapping(i,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(i,e.signal)}async refresh(i){this._loadOptions.customParameters=i,this._snapshotTask?.abort(),this._snapshotTask=j(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),R(n)||V.getLogger("esri.layers.CSVLayer").error(new F("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:e,timeExtent:t}=await this._queryEngine.fetchRecomputedExtents();return{extent:e,timeExtent:t}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(i){const{url:e,customParameters:t}=this._loadOptions;if(!e)throw new F("csv-layer:invalid-source","url not defined");const n=L(e);return(await P(n.path,{query:{...n.query,...t},responseType:"text",signal:i})).data}_createQueryEngine(i){const{objectIdField:e,fields:t,extent:n,timeInfo:a}=i.layerDefinition,s=new X({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new te({fieldsIndex:_.fromLayerJSON({fields:t,dateFieldsTimeReference:{timeZoneIANA:T}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:a,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},featureStore:s})}async _createFeatures(i){const{latitudeFieldName:e,longitudeFieldName:t}=this._locationInfo,{objectIdField:n,fieldsIndex:a,spatialReference:s}=this._queryEngine;let l=[];const c=[],d=a.fields.filter(r=>r.name!==n).map(r=>r.name);let y=0;const f={};for(const r of a.fields)if(r.type!=="esriFieldTypeOID"&&r.type!=="esriFieldTypeGlobalID"){const u=$(r);u!==void 0&&(f[r.name]=u)}const p=v(i,d,this._delimiter,ne(f,n));for(const r of p){const u=this._parseCoordinateValue(r[e]),g=this._parseCoordinateValue(r[t]);if(g!=null&&u!=null&&!isNaN(u)&&!isNaN(g)){r[e]=u,r[t]=g;for(const m in r)if(m!==e&&m!==t)if(a.isDateField(m))r[m]=B(r[m]);else if(a.isNumericField(m)){const x=w(r[m]);isNaN(x)?r[m]=null:r[m]=x}else r[m]!=null&&(r[m]=me(r[m]));r[n]=y,y++,l.push(new ye(g,u)),c.push(r)}}if(!A({wkid:4326},s))if(G(s))for(const r of l)[r.x,r.y]=Y(r.x,r.y,he);else l=z(H,l,M.WGS84,s,null,null);const h=[];for(let r=0;r181)&&(e=parseFloat(i)),e}async _checkProjection(i){try{await ee(Q,i)}catch{throw new F("csv-layer:projection-not-supported","Projection not supported")}}}function ge(o,i){const e=i.parsingOptions||{},t={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=t.layerDefinition={name:Z(i.url,pe)||"csv",dateFieldsTimeReference:{timeZoneIANA:T},drawingInfo:fe,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:e.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:e.spatialReference||{wkid:4326}}},a=C(o),s=a.next().value?.trim(),l=a.next().value?.trim();if(!s)throw new F("csv-layer:empty-csv","CSV is empty",{csv:o});const{delimiter:c,locationInfo:d}=ce(s,l,e);if(!c)throw new F("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:s,secondLine:l,parsingOptions:e});if(!d)throw new F("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:s,secondLine:l,parsingOptions:e});t.locationInfo=d,t.delimiter=c;const{names:y,aliases:f}=k(s,c),p=ue(o,t.delimiter,y,f,t.locationInfo);if(e.fields?.length){const r=new _(e.fields);for(const u of p){const g=r.get(u.name);g&&Object.assign(u,g)}}if(!p.some(r=>r.type==="esriFieldTypeOID"&&(n.objectIdField=r.name,!0))){const r={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=r.name,p.unshift(r)}n.fields=p;const h=new _(n.fields);if(t.locationInfo&&(t.locationInfo.latitudeFieldName=h.get(t.locationInfo.latitudeFieldName).name,t.locationInfo.longitudeFieldName=h.get(t.locationInfo.longitudeFieldName).name),n.timeInfo){const r=n.timeInfo;if(r.startTimeField){const u=h.get(r.startTimeField);u?(r.startTimeField=u.name,u.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const u=h.get(r.endTimeField);u?(r.endTimeField=u.name,u.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const u=h.get(r.trackIdField);r.trackIdField=u?u.name:null}r.startTimeField||r.endTimeField||(n.timeInfo=null)}return t}export{mt as default}; diff --git a/main/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-DaXR8CGJ.js b/main/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-DaXR8CGJ.js deleted file mode 100644 index 30a0a6c86..000000000 --- a/main/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-DaXR8CGJ.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as f,v as i,i as V,S as a,bp as F,bo as C,a2 as U,b9 as H,a1 as _,bV as w}from"./main-BZaw9FpY.js";import{X as x,Y as I}from"./LayerView-Bish-E63-DRGspiuk.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";const y=Symbol(),O=n=>{let e=class extends n{constructor(){super(...arguments),this.layerViews=new f,this._debouncedUpdate=F(async()=>{const{layer:r,parent:o}=this,s=o?.footprintLayerView;let p=[];const d=this._createQuery();if(d&&s){const{features:h}=await s.queryFeatures(d);this.suspended||(p=h.map(u=>r.acquireLayer(u)))}this.removeHandles(y),this.addHandles(p,y)})}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some(r=>r.updating)}enableLayerUpdates(){return C([this._updatingHandles.addWhen(()=>this.parent?.footprintLayerView?.dataUpdating===!1,()=>this.updateLayers()),this._updatingHandles.add(()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended],()=>this.updateLayers()),U(()=>this.removeHandles(y))])}updateLayers(){this.suspended?this.removeHandles(y):this._updatingHandles.addPromise(H(this._debouncedUpdate()).catch(r=>{_.getLogger(this).error(r)}))}_createQuery(){const r=this.parent?.footprintLayerView,o=this.layer?.parent;if(!r||!o||o.destroyed)return null;const{layer:{maximumVisibleSublayers:s},view:{scale:p}}=this;if(!s)return null;const{itemTypeField:d,itemSourceField:h,itemNameField:u,minScaleField:c,maxScaleField:L,objectIdField:v,orderBy:S}=o,$=w(`${c} IS NULL OR ${p} <= ${c} OR ${c} = 0`,`${L} IS NULL OR ${p} >= ${L}`),m=S?.find(l=>l.field&&!l.valueExpression),t=r.createQuery();if(t.returnGeometry=!1,t.num=s,t.outFields=[v,h,u],t.where=w(t.where,$),this.unsupportedItemTypes!=null){const l=`${d} NOT IN (${this.unsupportedItemTypes.map(b=>`'${b}'`)})`;t.where=w(t.where,l)}return m?.field&&(t.orderByFields=[`${m.field} ${m.order==="descending"?"DESC":"ASC"}`],t.outFields.push(m.field)),t}};return i([a({readOnly:!0})],e.prototype,"creatingLayerViews",null),i([a()],e.prototype,"layer",void 0),i([a()],e.prototype,"layerViews",void 0),i([a({readOnly:!0})],e.prototype,"unsupportedItemTypes",void 0),i([a()],e.prototype,"parent",void 0),i([a({readOnly:!0})],e.prototype,"isUpdating",null),e=i([V("esri.views.layers.CatalogDynamicGroupLayerView")],e),e};let g=class extends O(x(I)){constructor(){super(...arguments),this.unsupportedItemTypes=["Scene Service"],this.layerViews=new f}attach(){this.addAttachHandles([this.layerViews.on("after-changes",()=>this._updateStageChildren()),this.enableLayerUpdates()])}detach(){this.container.removeAllChildren()}update(n){this.updateLayers()}viewChange(){}moveEnd(){this.requestUpdate()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((n,e)=>this.container.addChildAt(n.container,e))}};g=i([V("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],g);const qe=g;export{qe as default}; diff --git a/main/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-IDF2ytK8.js b/main/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-IDF2ytK8.js new file mode 100644 index 000000000..cfec288f3 --- /dev/null +++ b/main/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-IDF2ytK8.js @@ -0,0 +1 @@ +import{ag as f,v as i,i as V,S as a,bp as F,bo as C,a2 as U,b9 as H,a1 as _,bV as w}from"./main-C7yV2j71.js";import{X as x,Y as I}from"./LayerView-Bish-E63-I2LV0oDm.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";const y=Symbol(),O=n=>{let e=class extends n{constructor(){super(...arguments),this.layerViews=new f,this._debouncedUpdate=F(async()=>{const{layer:r,parent:o}=this,s=o?.footprintLayerView;let p=[];const d=this._createQuery();if(d&&s){const{features:h}=await s.queryFeatures(d);this.suspended||(p=h.map(u=>r.acquireLayer(u)))}this.removeHandles(y),this.addHandles(p,y)})}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some(r=>r.updating)}enableLayerUpdates(){return C([this._updatingHandles.addWhen(()=>this.parent?.footprintLayerView?.dataUpdating===!1,()=>this.updateLayers()),this._updatingHandles.add(()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended],()=>this.updateLayers()),U(()=>this.removeHandles(y))])}updateLayers(){this.suspended?this.removeHandles(y):this._updatingHandles.addPromise(H(this._debouncedUpdate()).catch(r=>{_.getLogger(this).error(r)}))}_createQuery(){const r=this.parent?.footprintLayerView,o=this.layer?.parent;if(!r||!o||o.destroyed)return null;const{layer:{maximumVisibleSublayers:s},view:{scale:p}}=this;if(!s)return null;const{itemTypeField:d,itemSourceField:h,itemNameField:u,minScaleField:c,maxScaleField:L,objectIdField:v,orderBy:S}=o,$=w(`${c} IS NULL OR ${p} <= ${c} OR ${c} = 0`,`${L} IS NULL OR ${p} >= ${L}`),m=S?.find(l=>l.field&&!l.valueExpression),t=r.createQuery();if(t.returnGeometry=!1,t.num=s,t.outFields=[v,h,u],t.where=w(t.where,$),this.unsupportedItemTypes!=null){const l=`${d} NOT IN (${this.unsupportedItemTypes.map(b=>`'${b}'`)})`;t.where=w(t.where,l)}return m?.field&&(t.orderByFields=[`${m.field} ${m.order==="descending"?"DESC":"ASC"}`],t.outFields.push(m.field)),t}};return i([a({readOnly:!0})],e.prototype,"creatingLayerViews",null),i([a()],e.prototype,"layer",void 0),i([a()],e.prototype,"layerViews",void 0),i([a({readOnly:!0})],e.prototype,"unsupportedItemTypes",void 0),i([a()],e.prototype,"parent",void 0),i([a({readOnly:!0})],e.prototype,"isUpdating",null),e=i([V("esri.views.layers.CatalogDynamicGroupLayerView")],e),e};let g=class extends O(x(I)){constructor(){super(...arguments),this.unsupportedItemTypes=["Scene Service"],this.layerViews=new f}attach(){this.addAttachHandles([this.layerViews.on("after-changes",()=>this._updateStageChildren()),this.enableLayerUpdates()])}detach(){this.container.removeAllChildren()}update(n){this.updateLayers()}viewChange(){}moveEnd(){this.requestUpdate()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((n,e)=>this.container.addChildAt(n.container,e))}};g=i([V("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],g);const qe=g;export{qe as default}; diff --git a/main/assets/CatalogFootprintLayerView2D-C0bBWVdF-B8ZCfrrR.js b/main/assets/CatalogFootprintLayerView2D-C0bBWVdF-B8ZCfrrR.js new file mode 100644 index 000000000..c7e4513ce --- /dev/null +++ b/main/assets/CatalogFootprintLayerView2D-C0bBWVdF-B8ZCfrrR.js @@ -0,0 +1 @@ +import{v as r,i as m,S as p}from"./main-C7yV2j71.js";import{r as s}from"./FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./LayerView-Bish-E63-I2LV0oDm.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./SDFHelper-B6k8Ig6R-C81pIMYz.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-X6GWMgRY.js";import"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";const a=e=>{let t=class extends e{constructor(...o){super(...o)}get updateSuspended(){const o=this.parent?.dynamicGroupLayerView;return this.suspended&&(!o||o.suspended===!0)}};return r([p()],t.prototype,"layer",void 0),r([p()],t.prototype,"parent",void 0),r([p()],t.prototype,"updateSuspended",null),t=r([m("esri.views.layers.CatalogFootprintLayerView")],t),t};let i=class extends a(s){};i=r([m("esri.views.2d.layers.CatalogFootprintLayerView2D")],i);const sr=i;export{sr as default}; diff --git a/main/assets/CatalogFootprintLayerView2D-C0bBWVdF-E56VRyOl.js b/main/assets/CatalogFootprintLayerView2D-C0bBWVdF-E56VRyOl.js deleted file mode 100644 index 99ee7d64a..000000000 --- a/main/assets/CatalogFootprintLayerView2D-C0bBWVdF-E56VRyOl.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,i as m,S as p}from"./main-BZaw9FpY.js";import{r as s}from"./FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./timeSupport-ohWmWReZ-CwKm-94j.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./LayerView-Bish-E63-DRGspiuk.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./SDFHelper-B6k8Ig6R-KWOw5fv6.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-xbvi-u4x.js";import"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";const a=e=>{let t=class extends e{constructor(...o){super(...o)}get updateSuspended(){const o=this.parent?.dynamicGroupLayerView;return this.suspended&&(!o||o.suspended===!0)}};return r([p()],t.prototype,"layer",void 0),r([p()],t.prototype,"parent",void 0),r([p()],t.prototype,"updateSuspended",null),t=r([m("esri.views.layers.CatalogFootprintLayerView")],t),t};let i=class extends a(s){};i=r([m("esri.views.2d.layers.CatalogFootprintLayerView2D")],i);const sr=i;export{sr as default}; diff --git a/main/assets/CatalogLayer-BeO1fLsl-2bzVHku5.js b/main/assets/CatalogLayer-BeO1fLsl-2bzVHku5.js new file mode 100644 index 000000000..8a820d06b --- /dev/null +++ b/main/assets/CatalogLayer-BeO1fLsl-2bzVHku5.js @@ -0,0 +1 @@ +import{ag as q,ah as Q,aT as A,a2 as S,an as R,v as t,S as r,bB as D,i as w,bT as L,P as g,bL as U,bP as Z,W as M,o as f,a as G,bX as N,f as k,Z as H,r as x,Q as j,eC as z}from"./main-C7yV2j71.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as h}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{b as J}from"./LRUCache-C3erQTWv-DhyPlt5p.js";import{h as K}from"./ReactiveMap-CFk6jPfN-CM49HI11.js";import{o as W}from"./signal-CETehA7D-DxK1orqE.js";import{u as I}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{S as O}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{_,E as V,i as X,$ as Y,Y as ee,n as te,t as re,X as ie,e as oe}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{p as ne}from"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import{k as C}from"./utils-tNxq3jkf-DW91Ot0z.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{m as ae,u as se,p as le}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{H as pe,$ as de}from"./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js";import{l as ye}from"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import{C as ue,q as me}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{w as he}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import ce from"./FeatureLayerSource-k4WMYop1-z-zJ1lao.js";import{n as fe}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as ge}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{i as be}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{C as ve}from"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import{E as we}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{p as Fe}from"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import{C as Ie}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as Oe}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{x as _e}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{c as Te,U as Ee,f as Se,e as Le}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{y as xe}from"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import{f as je}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{p as Ce}from"./fetchService-DbaKmJhP-DPDp5i2e.js";import{a as Pe}from"./versionUtils-LZYZz-38-DgmFurh2.js";import qe from"./PortalItem-CctGdnxF-CHPkp6yW.js";import{b as m}from"./Query-BrwMGK8U-DV_czrJX.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./External-D_wl4XAw-Bzqlxz38.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./MeshTransform-C--IG09w-QYZk68_K.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Dbd8ftOx.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./editingSupport-gUqP9iyf-3W9GNLNT.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./clientSideDefaults-BqqayPct-B0cLE-po.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./QueryTask-CwHwH2rS-CT1NKU1Q.js";import"./executeForIds-Z1gkLduF-BNBrXf-U.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./executeQueryPBF-o8010HS9-E5WwNUPn.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./executeQueryJSON-CcHnccia-CB1D7q08.js";import"./editsZScale-BDsX6vv--CoeIQyxn.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";let d=class extends O(I(F(h))){constructor(e){super(e),this._layerCache=new J(20,i=>i.destroy()),this._oidToReference=new K,this._layerToReference=new Map,this.legendEnabled=!0,this.layers=new q,this.maximumVisibleSublayers=10,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.title="Layers in view",this.type="catalog-dynamic-group",this.visible=!0}initialize(){this.addHandles([this.layers.on("after-add",({item:e})=>{e.parent=this}),this.layers.on("after-remove",({item:e})=>{e.parent=null}),Q(()=>this._orderBy,()=>{this._updateLayerSortValues(),this._sortAllLayers()})])}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}destroy(){this._layerCache.destroy(),this._oidToReference.clear(),this._layerToReference.clear()}get _orderBy(){return this.parent?this.parent.orderBy?.find(e=>!e.valueExpression&&e.field)??new ne({field:this.parent.objectIdField}):null}get _referenceComparator(){const e=this._orderBy;if(!this.parent||!e)return()=>0;const i=this.parent.fieldsIndex.get(e.field),a=C(i?.toJSON().type,e.order==="descending"),n=C("esriFieldTypeOID",e.order==="descending");return(l,p)=>a(p.sortValue,l.sortValue)||n(p.objectId,l.objectId)}get fullExtent(){return this.parent?.fullExtent??null}get updating(){return A(this._oidToReference,({pending:e})=>e!=null)}acquireLayer(e){if(this.destroyed)return S();const i=this._getLayerReference(e);return i.count++,S(()=>{i.count--,i.count||this._destroyLayerReference(i)})}_getLayerReference(e){const i=e.getObjectId();return R(this._oidToReference,i,()=>{const a=e.getObjectId(),n=`${a}`,l=e.getAttribute(this.parent.itemSourceField),p=new Re(e,a,l),y=this._layerCache.pop(n);return y?(this._addLayer(p,y),p):(p.pending=this.parent.createLayerFromFootprint(e).then(u=>{p.count?this._addLayer(p,u):(this.destroyed||this._layerCache.get(n)||this._layerCache.put(n,u),p.layer=null)}).catch(()=>{}).finally(()=>{p.pending=null}),p)})}_destroyLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),this.destroyed?e.layer.destroy():this._layerCache.put(`${e.objectId}`,e.layer),e.layer=null),this._oidToReference.delete(e.objectId)}_addLayer(e,i){e.layer=i,i.persistenceEnabled=!1,this._layerToReference.set(i,e),this._updateLayerSortValue(e),this.layers.add(i),this._sortAllLayers()}_updateLayerSortValues(){for(const e of this._layerToReference.values())this._updateLayerSortValue(e)}_updateLayerSortValue(e){this._orderBy&&(e.sortValue=e.footprint.getAttribute(this._orderBy.field))}_sortAllLayers(){this.layers.sort((e,i)=>this._referenceComparator(this._layerToReference.get(e),this._layerToReference.get(i)))}};t([r()],d.prototype,"_orderBy",null),t([r({readOnly:!0})],d.prototype,"_referenceComparator",null),t([r(_)],d.prototype,"legendEnabled",void 0),t([r({type:["show","hide","hide-children"],json:{write:!0}})],d.prototype,"listMode",void 0),t([r({readOnly:!0})],d.prototype,"fullExtent",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],d.prototype,"id",void 0),t([r({readOnly:!0})],d.prototype,"layers",void 0),t([r({type:D,range:{min:0,max:50},json:{write:!0,default:10}})],d.prototype,"maximumVisibleSublayers",void 0),t([r(V)],d.prototype,"opacity",void 0),t([r({clonable:!1})],d.prototype,"parent",void 0),t([r({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],d.prototype,"title",void 0),t([r({json:{read:!1}})],d.prototype,"type",void 0),t([r({readOnly:!0})],d.prototype,"updating",null),t([r({type:Boolean,json:{name:"visibility",write:!0}})],d.prototype,"visible",void 0),d=t([w("esri.layers.catalog.CatalogDynamicGroupLayer")],d);const $=d;class Re{constructor(i,a,n){this.footprint=i,this.objectId=a,this.itemSource=n,this.count=0,this.layer=null,this.sortValue=void 0,this._pending=W(null)}get pending(){return this._pending.value}set pending(i){this._pending.value=i}}function Ve(){const e=new z({style:"solid",color:[0,0,0,0],outline:{style:"solid",color:[96,96,96,.75],width:.75}});return new le({symbol:e})}let o=class extends O(ye(I(F(h)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.elevationInfo=null,this.formTemplate=null,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.title="Footprints",this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.parent.load(e),L(this.renderer,this.fieldsIndex),this.addHandles([this.parent.on("apply-edits",i=>this.emit("apply-edits",i)),this.parent.on("edits",i=>this.emit("edits",i)),this.parent.on("refresh",i=>this.emit("refresh",i))])}get apiKey(){return this.parent?.apiKey}get capabilities(){return this.parent?.capabilities}get customParameters(){return this.parent?.customParameters}get dateFieldsTimeZone(){return this.parent?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this.parent?.datesInUnknownTimezone??!1}get definitionExpression(){return this.parent?.definitionExpression}get editingInfo(){return this.parent?.editingInfo}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get createQueryVersion(){return this.parent?.createQueryVersion}get defaultPopupTemplate(){return this.createPopupTemplate()}get displayField(){return this.parent?.displayField}get effectiveEditingEnabled(){return!1}get fields(){return this.parent?.fields}get fieldsIndex(){return this.parent?.fieldsIndex}get fullExtent(){return this.parent?.fullExtent}get geometryFieldsInfo(){return this.parent?.geometryFieldsInfo}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?.globalIdField}get hasM(){return this.parent?.hasM??!1}get hasZ(){return this.parent?.hasZ??!1}get objectIdField(){return this.parent?.objectIdField}get orderBy(){return this.parent?.orderBy??null}get outFields(){return this.parent?.outFields}get parsedUrl(){return this.parent?.parsedUrl??null}get preferredTimeZone(){return this.parent?.preferredTimeZone??null}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):Ve()}get returnM(){return this.parent?.returnM}get returnZ(){return this.parent?.returnZ}get source(){return this.parent?.source}get timeExtent(){return this.parent?.timeExtent}get timeInfo(){return this.parent?.timeInfo}get timeOffset(){return this.parent?.timeOffset}get typeIdField(){return this.parent?.typeIdField}get types(){return this.parent?.types}get useViewTime(){return this.parent?.useViewTime??!0}get version(){return this.parent?.version}async applyEdits(e,i){return await this.load(),this.parent.applyEdits(e,i)}createPopupTemplate(e){const i={fields:this.fields,objectIdField:this.objectIdField,title:this.title};return he(i,e)}createQuery(){return this.parent?.createQuery()}getField(e){return this.parent?.getField(e)}getFieldDomain(e,i){return this.parent?.getFieldDomain(e,i)}async queryExtent(e,i){return await this.load(),this.parent.queryExtent(e,i)}async queryFeatures(e,i){return await this.load(),this.parent.queryFeatures(e,i)}async queryFeatureCount(e,i){return await this.load(),this.parent.queryFeatureCount(e,i)}async queryObjectIds(e,i){return await this.load(),this.parent.queryObjectIds(e,i)}};t([r(X)],o.prototype,"attributeTableTemplate",void 0),t([r({readOnly:!0})],o.prototype,"apiKey",null),t([r({readOnly:!0})],o.prototype,"capabilities",null),t([r({readOnly:!0})],o.prototype,"customParameters",null),t([r()],o.prototype,"dateFieldsTimeZone",null),t([r({readOnly:!0})],o.prototype,"datesInUnknownTimezone",null),t([r({readOnly:!0})],o.prototype,"definitionExpression",null),t([r({readOnly:!0})],o.prototype,"editingInfo",null),t([r({readOnly:!0})],o.prototype,"effectiveCapabilities",null),t([r({json:{origins:{"web-scene":{write:!1}},write:!0}})],o.prototype,"charts",void 0),t([r({readOnly:!0})],o.prototype,"createQueryVersion",null),t([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),t([r()],o.prototype,"displayField",null),t([r({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),t([r({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),t([r((()=>{const e=g(Y);return e.json.origins["web-map"]={read:!1,write:!1},e})())],o.prototype,"elevationInfo",void 0),t([r({readOnly:!0})],o.prototype,"fields",null),t([r({readOnly:!0})],o.prototype,"fieldsIndex",null),t([r({type:pe,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"formTemplate",void 0),t([r({readOnly:!0})],o.prototype,"fullExtent",null),t([r({readOnly:!0})],o.prototype,"geometryFieldsInfo",null),t([r({readOnly:!0})],o.prototype,"geometryType",null),t([r({readOnly:!0})],o.prototype,"globalIdField",null),t([r({readOnly:!0})],o.prototype,"hasM",null),t([r({readOnly:!0})],o.prototype,"hasZ",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"id",void 0),t([r({type:[ue],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:me,write:!0}})],o.prototype,"labelingInfo",void 0),t([r(ee)],o.prototype,"labelsVisible",void 0),t([r(_)],o.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{write:!0}})],o.prototype,"listMode",void 0),t([r((()=>{const e=g(te);return e.json.origins.service.read=!1,e})())],o.prototype,"maxScale",void 0),t([r((()=>{const e=g(re);return e.json.origins.service.read=!1,e})())],o.prototype,"minScale",void 0),t([r({readOnly:!0})],o.prototype,"objectIdField",null),t([r(V)],o.prototype,"opacity",void 0),t([r({readOnly:!0})],o.prototype,"orderBy",null),t([r({readOnly:!0})],o.prototype,"outFields",null),t([r({clonable:!1})],o.prototype,"parent",void 0),t([r({readOnly:!0})],o.prototype,"parsedUrl",null),t([r(ie)],o.prototype,"popupEnabled",void 0),t([r({type:U,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),t([r({readOnly:!0})],o.prototype,"preferredTimeZone",null),t([r({types:ae,json:{origins:{"web-scene":{types:se}},name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(e,i){return{ignoreOrigin:this.originIdOf(i){const{url:n,source:l,portalItem:p}=this;if(!n)throw new f("catalog-layer:missing-url","Catalog layer must be created with a url");if(this.layerId==null){const u=await this._fetchFirstValidLayerId(i);if(u==null)throw new f("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:n});this.layerId=u}await l.load({signal:i});const{sourceJSON:y}=l;y&&(this.sourceJSON=y,this.read(y,{origin:"service",portalItem:p,portal:p?.portal,url:this.parsedUrl}))}).then(()=>{const n=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],l=n.filter(p=>!this.fieldsIndex.has(p));if(l.length)throw new f("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:n,missingFields:l})}).then(()=>Te(this,"load",e));return this.addResolvingPromise(a),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}get parsedUrl(){const e=G(this.url);return e!=null&&this.layerId!=null&&(e.path=N(e.path,this.layerId.toString())),e}async applyEdits(e,i){return Ee(this,e,i)}on(e,i){return super.on(e,i)}async createLayerFromFootprint(e){const i=await this._createLayer(e);return this._configureLayer(i,e),this._layerToFootprint.set(i,e),i}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new m,i=this.capabilities?.query;e.returnGeometry=!0,i&&(e.compactGeometryEnabled=i.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:a,timeExtent:n}=this;return e.timeExtent=a!=null&&n!=null?n.offset(-a.value,a.unit):n||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return Se(this.types,this.typeIdField,e)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){const a=i?.feature,n=this.getFeatureType(a);if(n){const l=n.domains&&n.domains[e];if(l&&l.type!=="inherited")return l}return this.getField(e)?.domain}async hasDataChanged(){return Le(this)}async queryFeatures(e,i){const a=await this.load(),n=await a.source.queryFeatures(m.from(e)??a.createQuery(),i);if(n?.features)for(const l of n.features)l.layer=l.sourceLayer=a.footprintLayer;return n}async queryObjectIds(e,i){return(await this.load()).source.queryObjectIds(m.from(e)??this.createQuery(),i)}async queryFeatureCount(e,i){return(await this.load()).source.queryFeatureCount(m.from(e)??this.createQuery(),i)}async queryExtent(e,i){return(await this.load()).source.queryExtent(m.from(e)??this.createQuery(),i)}serviceSupportsSpatialReference(e){return this.loaded&&Pe(this,e)}read(e,i){if(super.read(e,i),e){const{footprintLayer:a,dynamicGroupLayer:n}=e;a&&this.footprintLayer.read(a,i),n&&this.dynamicGroupLayer.read(n,i)}}async _fetchFirstValidLayerId(e){const{data:i}=await k(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(Array.isArray(i?.layers))return i.layers.find(({type:a})=>this.supportedSourceTypes.has(a))?.id}async _createLayer(e){const i=e.getAttribute(this.itemSourceField);if(!i)throw new f("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const a=JSON.parse(i);if($e(a)){const{itemId:n,portalUrl:l}=a,p=H(l),y=this.portalItem?.portal,u=x.getDefault();let c,T=!0;y&&j(l,y.url)?c=y:j(l,u.url)?c=u:(c=R(this._portals,p,()=>new x({url:p})),T=!1);const E=await h.fromPortalItem(new qe({id:n,portal:c}));return T||await v(E),E}return Be(a)?h.fromArcGISServerUrl({url:a.url}):new(await Ce.UnsupportedLayer())}_configureLayer(e,i){const a=i.getAttribute(this.itemNameField);a&&(e.title=a);const n=i.getAttribute(this.maxScaleField);n!=null&&"maxScale"in e&&(e.maxScale=n);const l=i.getAttribute(this.minScaleField);l!=null&&"minScale"in e&&(e.minScale=l)}};async function v(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,e.type==="group"&&await Promise.allSettled([...e.layers.map(i=>v(i)),...e.tables.map(i=>v(i))])}}t([r(_)],s.prototype,"legendEnabled",void 0),t([r({readOnly:!0})],s.prototype,"createQueryVersion",null),t([r({readOnly:!0})],s.prototype,"drawOrderField",void 0),t([r({type:$,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"dynamicGroupLayer",void 0),t([r({readOnly:!0})],s.prototype,"editingEnabled",null),t([r({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),t([r({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],s.prototype,"elevationInfo",void 0),t([r({...b.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"fields",void 0),t([r(b.fieldsIndex)],s.prototype,"fieldsIndex",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],s.prototype,"floorInfo",void 0),t([r({type:B,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"footprintLayer",void 0),t([r(oe)],s.prototype,"id",void 0),t([r({readOnly:!0})],s.prototype,"itemNameField",void 0),t([r({readOnly:!0})],s.prototype,"itemSourceField",void 0),t([r({readOnly:!0})],s.prototype,"itemTypeField",void 0),t([r({readOnly:!0})],s.prototype,"layers",void 0),t([r({type:["show","hide","hide-children"]})],s.prototype,"listMode",void 0),t([r({readOnly:!0})],s.prototype,"maxScaleField",void 0),t([r({readOnly:!0})],s.prototype,"minScaleField",void 0),t([r({value:"CatalogLayer",type:["CatalogLayer"]})],s.prototype,"operationalLayerType",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],s.prototype,"orderBy",void 0),t([r(b.outFields)],s.prototype,"outFields",void 0),t([r({readOnly:!0})],s.prototype,"parsedUrl",null),t([r({readOnly:!0})],s.prototype,"source",void 0),t([r({json:{read:!1}})],s.prototype,"type",void 0),t([r({type:String})],s.prototype,"typeIdField",void 0),t([r({type:[xe]})],s.prototype,"types",void 0),s=t([w("esri.layers.CatalogLayer")],s);const Dr=s;export{Dr as default}; diff --git a/main/assets/CatalogLayer-BeO1fLsl-DdxDtWgZ.js b/main/assets/CatalogLayer-BeO1fLsl-DdxDtWgZ.js deleted file mode 100644 index 438de5c88..000000000 --- a/main/assets/CatalogLayer-BeO1fLsl-DdxDtWgZ.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as q,ah as Q,aT as A,a2 as S,an as R,v as t,S as r,bB as D,i as w,bT as L,P as g,bL as U,bP as Z,W as M,o as f,a as G,bX as N,f as k,Z as H,r as x,Q as j,eC as z}from"./main-BZaw9FpY.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as h}from"./Layer-ChoECxvZ-C4wLrCej.js";import{b as J}from"./LRUCache-C3erQTWv-CeYLuvL9.js";import{h as K}from"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import{o as W}from"./signal-CETehA7D-vStzfbaY.js";import{u as I}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{S as O}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{_,E as V,i as X,$ as Y,Y as ee,n as te,t as re,X as ie,e as oe}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{p as ne}from"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import{k as C}from"./utils-tNxq3jkf-ni0gpzk6.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{m as ae,u as se,p as le}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{H as pe,$ as de}from"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import{l as ye}from"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import{C as ue,q as me}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{w as he}from"./popupUtils-B0uZcXX0-BqljON9c.js";import ce from"./FeatureLayerSource-k4WMYop1-BFDYORV0.js";import{n as fe}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as ge}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{i as be}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{C as ve}from"./EditBusLayer-Df29OyJh-C36maE2j.js";import{E as we}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{p as Fe}from"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import{C as Ie}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as Oe}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{x as _e}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{c as Te,U as Ee,f as Se,e as Le}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{y as xe}from"./FeatureType-C9hJmS6_-pVJc0p7X.js";import{f as je}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{p as Ce}from"./fetchService-DbaKmJhP-CtznRt8p.js";import{a as Pe}from"./versionUtils-LZYZz-38-xZnsxhiL.js";import qe from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import{b as m}from"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import"./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./External-D_wl4XAw-MFWeclAP.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./MeshTransform-C--IG09w-B7P01ZzU.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Bk09s2KF.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./editingSupport-gUqP9iyf-Bz3XNCt8.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./clientSideDefaults-BqqayPct-BMC57bnT.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./QueryTask-CwHwH2rS-CU-oJwb3.js";import"./executeForIds-Z1gkLduF-Daa1fnES.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./executeQueryPBF-o8010HS9-dWp8mQx-.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./executeQueryJSON-CcHnccia-DVecwfbV.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";let d=class extends O(I(F(h))){constructor(e){super(e),this._layerCache=new J(20,i=>i.destroy()),this._oidToReference=new K,this._layerToReference=new Map,this.legendEnabled=!0,this.layers=new q,this.maximumVisibleSublayers=10,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.title="Layers in view",this.type="catalog-dynamic-group",this.visible=!0}initialize(){this.addHandles([this.layers.on("after-add",({item:e})=>{e.parent=this}),this.layers.on("after-remove",({item:e})=>{e.parent=null}),Q(()=>this._orderBy,()=>{this._updateLayerSortValues(),this._sortAllLayers()})])}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}destroy(){this._layerCache.destroy(),this._oidToReference.clear(),this._layerToReference.clear()}get _orderBy(){return this.parent?this.parent.orderBy?.find(e=>!e.valueExpression&&e.field)??new ne({field:this.parent.objectIdField}):null}get _referenceComparator(){const e=this._orderBy;if(!this.parent||!e)return()=>0;const i=this.parent.fieldsIndex.get(e.field),a=C(i?.toJSON().type,e.order==="descending"),n=C("esriFieldTypeOID",e.order==="descending");return(l,p)=>a(p.sortValue,l.sortValue)||n(p.objectId,l.objectId)}get fullExtent(){return this.parent?.fullExtent??null}get updating(){return A(this._oidToReference,({pending:e})=>e!=null)}acquireLayer(e){if(this.destroyed)return S();const i=this._getLayerReference(e);return i.count++,S(()=>{i.count--,i.count||this._destroyLayerReference(i)})}_getLayerReference(e){const i=e.getObjectId();return R(this._oidToReference,i,()=>{const a=e.getObjectId(),n=`${a}`,l=e.getAttribute(this.parent.itemSourceField),p=new Re(e,a,l),y=this._layerCache.pop(n);return y?(this._addLayer(p,y),p):(p.pending=this.parent.createLayerFromFootprint(e).then(u=>{p.count?this._addLayer(p,u):(this.destroyed||this._layerCache.get(n)||this._layerCache.put(n,u),p.layer=null)}).catch(()=>{}).finally(()=>{p.pending=null}),p)})}_destroyLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),this.destroyed?e.layer.destroy():this._layerCache.put(`${e.objectId}`,e.layer),e.layer=null),this._oidToReference.delete(e.objectId)}_addLayer(e,i){e.layer=i,i.persistenceEnabled=!1,this._layerToReference.set(i,e),this._updateLayerSortValue(e),this.layers.add(i),this._sortAllLayers()}_updateLayerSortValues(){for(const e of this._layerToReference.values())this._updateLayerSortValue(e)}_updateLayerSortValue(e){this._orderBy&&(e.sortValue=e.footprint.getAttribute(this._orderBy.field))}_sortAllLayers(){this.layers.sort((e,i)=>this._referenceComparator(this._layerToReference.get(e),this._layerToReference.get(i)))}};t([r()],d.prototype,"_orderBy",null),t([r({readOnly:!0})],d.prototype,"_referenceComparator",null),t([r(_)],d.prototype,"legendEnabled",void 0),t([r({type:["show","hide","hide-children"],json:{write:!0}})],d.prototype,"listMode",void 0),t([r({readOnly:!0})],d.prototype,"fullExtent",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],d.prototype,"id",void 0),t([r({readOnly:!0})],d.prototype,"layers",void 0),t([r({type:D,range:{min:0,max:50},json:{write:!0,default:10}})],d.prototype,"maximumVisibleSublayers",void 0),t([r(V)],d.prototype,"opacity",void 0),t([r({clonable:!1})],d.prototype,"parent",void 0),t([r({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],d.prototype,"title",void 0),t([r({json:{read:!1}})],d.prototype,"type",void 0),t([r({readOnly:!0})],d.prototype,"updating",null),t([r({type:Boolean,json:{name:"visibility",write:!0}})],d.prototype,"visible",void 0),d=t([w("esri.layers.catalog.CatalogDynamicGroupLayer")],d);const $=d;class Re{constructor(i,a,n){this.footprint=i,this.objectId=a,this.itemSource=n,this.count=0,this.layer=null,this.sortValue=void 0,this._pending=W(null)}get pending(){return this._pending.value}set pending(i){this._pending.value=i}}function Ve(){const e=new z({style:"solid",color:[0,0,0,0],outline:{style:"solid",color:[96,96,96,.75],width:.75}});return new le({symbol:e})}let o=class extends O(ye(I(F(h)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.elevationInfo=null,this.formTemplate=null,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.title="Footprints",this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.parent.load(e),L(this.renderer,this.fieldsIndex),this.addHandles([this.parent.on("apply-edits",i=>this.emit("apply-edits",i)),this.parent.on("edits",i=>this.emit("edits",i)),this.parent.on("refresh",i=>this.emit("refresh",i))])}get apiKey(){return this.parent?.apiKey}get capabilities(){return this.parent?.capabilities}get customParameters(){return this.parent?.customParameters}get dateFieldsTimeZone(){return this.parent?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this.parent?.datesInUnknownTimezone??!1}get definitionExpression(){return this.parent?.definitionExpression}get editingInfo(){return this.parent?.editingInfo}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get createQueryVersion(){return this.parent?.createQueryVersion}get defaultPopupTemplate(){return this.createPopupTemplate()}get displayField(){return this.parent?.displayField}get effectiveEditingEnabled(){return!1}get fields(){return this.parent?.fields}get fieldsIndex(){return this.parent?.fieldsIndex}get fullExtent(){return this.parent?.fullExtent}get geometryFieldsInfo(){return this.parent?.geometryFieldsInfo}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?.globalIdField}get hasM(){return this.parent?.hasM??!1}get hasZ(){return this.parent?.hasZ??!1}get objectIdField(){return this.parent?.objectIdField}get orderBy(){return this.parent?.orderBy??null}get outFields(){return this.parent?.outFields}get parsedUrl(){return this.parent?.parsedUrl??null}get preferredTimeZone(){return this.parent?.preferredTimeZone??null}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):Ve()}get returnM(){return this.parent?.returnM}get returnZ(){return this.parent?.returnZ}get source(){return this.parent?.source}get timeExtent(){return this.parent?.timeExtent}get timeInfo(){return this.parent?.timeInfo}get timeOffset(){return this.parent?.timeOffset}get typeIdField(){return this.parent?.typeIdField}get types(){return this.parent?.types}get useViewTime(){return this.parent?.useViewTime??!0}get version(){return this.parent?.version}async applyEdits(e,i){return await this.load(),this.parent.applyEdits(e,i)}createPopupTemplate(e){const i={fields:this.fields,objectIdField:this.objectIdField,title:this.title};return he(i,e)}createQuery(){return this.parent?.createQuery()}getField(e){return this.parent?.getField(e)}getFieldDomain(e,i){return this.parent?.getFieldDomain(e,i)}async queryExtent(e,i){return await this.load(),this.parent.queryExtent(e,i)}async queryFeatures(e,i){return await this.load(),this.parent.queryFeatures(e,i)}async queryFeatureCount(e,i){return await this.load(),this.parent.queryFeatureCount(e,i)}async queryObjectIds(e,i){return await this.load(),this.parent.queryObjectIds(e,i)}};t([r(X)],o.prototype,"attributeTableTemplate",void 0),t([r({readOnly:!0})],o.prototype,"apiKey",null),t([r({readOnly:!0})],o.prototype,"capabilities",null),t([r({readOnly:!0})],o.prototype,"customParameters",null),t([r()],o.prototype,"dateFieldsTimeZone",null),t([r({readOnly:!0})],o.prototype,"datesInUnknownTimezone",null),t([r({readOnly:!0})],o.prototype,"definitionExpression",null),t([r({readOnly:!0})],o.prototype,"editingInfo",null),t([r({readOnly:!0})],o.prototype,"effectiveCapabilities",null),t([r({json:{origins:{"web-scene":{write:!1}},write:!0}})],o.prototype,"charts",void 0),t([r({readOnly:!0})],o.prototype,"createQueryVersion",null),t([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),t([r()],o.prototype,"displayField",null),t([r({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),t([r({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),t([r((()=>{const e=g(Y);return e.json.origins["web-map"]={read:!1,write:!1},e})())],o.prototype,"elevationInfo",void 0),t([r({readOnly:!0})],o.prototype,"fields",null),t([r({readOnly:!0})],o.prototype,"fieldsIndex",null),t([r({type:pe,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"formTemplate",void 0),t([r({readOnly:!0})],o.prototype,"fullExtent",null),t([r({readOnly:!0})],o.prototype,"geometryFieldsInfo",null),t([r({readOnly:!0})],o.prototype,"geometryType",null),t([r({readOnly:!0})],o.prototype,"globalIdField",null),t([r({readOnly:!0})],o.prototype,"hasM",null),t([r({readOnly:!0})],o.prototype,"hasZ",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"id",void 0),t([r({type:[ue],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:me,write:!0}})],o.prototype,"labelingInfo",void 0),t([r(ee)],o.prototype,"labelsVisible",void 0),t([r(_)],o.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{write:!0}})],o.prototype,"listMode",void 0),t([r((()=>{const e=g(te);return e.json.origins.service.read=!1,e})())],o.prototype,"maxScale",void 0),t([r((()=>{const e=g(re);return e.json.origins.service.read=!1,e})())],o.prototype,"minScale",void 0),t([r({readOnly:!0})],o.prototype,"objectIdField",null),t([r(V)],o.prototype,"opacity",void 0),t([r({readOnly:!0})],o.prototype,"orderBy",null),t([r({readOnly:!0})],o.prototype,"outFields",null),t([r({clonable:!1})],o.prototype,"parent",void 0),t([r({readOnly:!0})],o.prototype,"parsedUrl",null),t([r(ie)],o.prototype,"popupEnabled",void 0),t([r({type:U,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),t([r({readOnly:!0})],o.prototype,"preferredTimeZone",null),t([r({types:ae,json:{origins:{"web-scene":{types:se}},name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(e,i){return{ignoreOrigin:this.originIdOf(i){const{url:n,source:l,portalItem:p}=this;if(!n)throw new f("catalog-layer:missing-url","Catalog layer must be created with a url");if(this.layerId==null){const u=await this._fetchFirstValidLayerId(i);if(u==null)throw new f("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:n});this.layerId=u}await l.load({signal:i});const{sourceJSON:y}=l;y&&(this.sourceJSON=y,this.read(y,{origin:"service",portalItem:p,portal:p?.portal,url:this.parsedUrl}))}).then(()=>{const n=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],l=n.filter(p=>!this.fieldsIndex.has(p));if(l.length)throw new f("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:n,missingFields:l})}).then(()=>Te(this,"load",e));return this.addResolvingPromise(a),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}get parsedUrl(){const e=G(this.url);return e!=null&&this.layerId!=null&&(e.path=N(e.path,this.layerId.toString())),e}async applyEdits(e,i){return Ee(this,e,i)}on(e,i){return super.on(e,i)}async createLayerFromFootprint(e){const i=await this._createLayer(e);return this._configureLayer(i,e),this._layerToFootprint.set(i,e),i}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new m,i=this.capabilities?.query;e.returnGeometry=!0,i&&(e.compactGeometryEnabled=i.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:a,timeExtent:n}=this;return e.timeExtent=a!=null&&n!=null?n.offset(-a.value,a.unit):n||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return Se(this.types,this.typeIdField,e)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){const a=i?.feature,n=this.getFeatureType(a);if(n){const l=n.domains&&n.domains[e];if(l&&l.type!=="inherited")return l}return this.getField(e)?.domain}async hasDataChanged(){return Le(this)}async queryFeatures(e,i){const a=await this.load(),n=await a.source.queryFeatures(m.from(e)??a.createQuery(),i);if(n?.features)for(const l of n.features)l.layer=l.sourceLayer=a.footprintLayer;return n}async queryObjectIds(e,i){return(await this.load()).source.queryObjectIds(m.from(e)??this.createQuery(),i)}async queryFeatureCount(e,i){return(await this.load()).source.queryFeatureCount(m.from(e)??this.createQuery(),i)}async queryExtent(e,i){return(await this.load()).source.queryExtent(m.from(e)??this.createQuery(),i)}serviceSupportsSpatialReference(e){return this.loaded&&Pe(this,e)}read(e,i){if(super.read(e,i),e){const{footprintLayer:a,dynamicGroupLayer:n}=e;a&&this.footprintLayer.read(a,i),n&&this.dynamicGroupLayer.read(n,i)}}async _fetchFirstValidLayerId(e){const{data:i}=await k(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(Array.isArray(i?.layers))return i.layers.find(({type:a})=>this.supportedSourceTypes.has(a))?.id}async _createLayer(e){const i=e.getAttribute(this.itemSourceField);if(!i)throw new f("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const a=JSON.parse(i);if($e(a)){const{itemId:n,portalUrl:l}=a,p=H(l),y=this.portalItem?.portal,u=x.getDefault();let c,T=!0;y&&j(l,y.url)?c=y:j(l,u.url)?c=u:(c=R(this._portals,p,()=>new x({url:p})),T=!1);const E=await h.fromPortalItem(new qe({id:n,portal:c}));return T||await v(E),E}return Be(a)?h.fromArcGISServerUrl({url:a.url}):new(await Ce.UnsupportedLayer())}_configureLayer(e,i){const a=i.getAttribute(this.itemNameField);a&&(e.title=a);const n=i.getAttribute(this.maxScaleField);n!=null&&"maxScale"in e&&(e.maxScale=n);const l=i.getAttribute(this.minScaleField);l!=null&&"minScale"in e&&(e.minScale=l)}};async function v(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,e.type==="group"&&await Promise.allSettled([...e.layers.map(i=>v(i)),...e.tables.map(i=>v(i))])}}t([r(_)],s.prototype,"legendEnabled",void 0),t([r({readOnly:!0})],s.prototype,"createQueryVersion",null),t([r({readOnly:!0})],s.prototype,"drawOrderField",void 0),t([r({type:$,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"dynamicGroupLayer",void 0),t([r({readOnly:!0})],s.prototype,"editingEnabled",null),t([r({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),t([r({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],s.prototype,"elevationInfo",void 0),t([r({...b.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"fields",void 0),t([r(b.fieldsIndex)],s.prototype,"fieldsIndex",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],s.prototype,"floorInfo",void 0),t([r({type:B,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"footprintLayer",void 0),t([r(oe)],s.prototype,"id",void 0),t([r({readOnly:!0})],s.prototype,"itemNameField",void 0),t([r({readOnly:!0})],s.prototype,"itemSourceField",void 0),t([r({readOnly:!0})],s.prototype,"itemTypeField",void 0),t([r({readOnly:!0})],s.prototype,"layers",void 0),t([r({type:["show","hide","hide-children"]})],s.prototype,"listMode",void 0),t([r({readOnly:!0})],s.prototype,"maxScaleField",void 0),t([r({readOnly:!0})],s.prototype,"minScaleField",void 0),t([r({value:"CatalogLayer",type:["CatalogLayer"]})],s.prototype,"operationalLayerType",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],s.prototype,"orderBy",void 0),t([r(b.outFields)],s.prototype,"outFields",void 0),t([r({readOnly:!0})],s.prototype,"parsedUrl",null),t([r({readOnly:!0})],s.prototype,"source",void 0),t([r({json:{read:!1}})],s.prototype,"type",void 0),t([r({type:String})],s.prototype,"typeIdField",void 0),t([r({type:[xe]})],s.prototype,"types",void 0),s=t([w("esri.layers.CatalogLayer")],s);const Dr=s;export{Dr as default}; diff --git a/main/assets/CatalogLayerView2D-DaUVeBuS-DL2YF1D2.js b/main/assets/CatalogLayerView2D-DaUVeBuS-DL2YF1D2.js new file mode 100644 index 000000000..ed0ef576a --- /dev/null +++ b/main/assets/CatalogLayerView2D-DaUVeBuS-DL2YF1D2.js @@ -0,0 +1 @@ +import{ag as a,v as i,S as o,i as m}from"./main-C7yV2j71.js";import{X as n,Y as s}from"./LayerView-Bish-E63-I2LV0oDm.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";const l=e=>{let t=class extends e{constructor(...r){super(...r),this.layerViews=new a}get dynamicGroupLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.footprintLayer)}isUpdating(){return!this.dynamicGroupLayerView||!this.footprintLayerView||this.dynamicGroupLayerView.updating||this.footprintLayerView.updating}};return i([o()],t.prototype,"layer",void 0),i([o()],t.prototype,"layerViews",void 0),i([o({readOnly:!0})],t.prototype,"dynamicGroupLayerView",null),i([o({readOnly:!0})],t.prototype,"footprintLayerView",null),t=i([m("esri.views.layers.CatalogLayerView")],t),t};let p=class extends l(n(s)){constructor(){super(...arguments),this.layerViews=new a}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};i([o()],p.prototype,"layerViews",void 0),p=i([m("esri.views.2d.layers.CatalogLayerView2D")],p);const ct=p;export{ct as default}; diff --git a/main/assets/CatalogLayerView2D-DaUVeBuS-Ngx1vfNP.js b/main/assets/CatalogLayerView2D-DaUVeBuS-Ngx1vfNP.js deleted file mode 100644 index 2e08f00a5..000000000 --- a/main/assets/CatalogLayerView2D-DaUVeBuS-Ngx1vfNP.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as a,v as i,S as o,i as m}from"./main-BZaw9FpY.js";import{X as n,Y as s}from"./LayerView-Bish-E63-DRGspiuk.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";const l=e=>{let t=class extends e{constructor(...r){super(...r),this.layerViews=new a}get dynamicGroupLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.footprintLayer)}isUpdating(){return!this.dynamicGroupLayerView||!this.footprintLayerView||this.dynamicGroupLayerView.updating||this.footprintLayerView.updating}};return i([o()],t.prototype,"layer",void 0),i([o()],t.prototype,"layerViews",void 0),i([o({readOnly:!0})],t.prototype,"dynamicGroupLayerView",null),i([o({readOnly:!0})],t.prototype,"footprintLayerView",null),t=i([m("esri.views.layers.CatalogLayerView")],t),t};let p=class extends l(n(s)){constructor(){super(...arguments),this.layerViews=new a}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};i([o()],p.prototype,"layerViews",void 0),p=i([m("esri.views.2d.layers.CatalogLayerView2D")],p);const ct=p;export{ct as default}; diff --git a/main/assets/ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js b/main/assets/ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js deleted file mode 100644 index f556afeb3..000000000 --- a/main/assets/ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as r,v as i,bz as o,S as t,i as l,e as d}from"./main-BZaw9FpY.js";const s=new r({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),n=new r({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let e=class extends d{constructor(a){super(a),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};i([o({classBreaksDef:"class-breaks-definition"})],e.prototype,"type",void 0),i([t({json:{write:!0}})],e.prototype,"breakCount",void 0),i([t({json:{write:!0}})],e.prototype,"classificationField",void 0),i([t({type:String,json:{read:s.read,write:s.write}})],e.prototype,"classificationMethod",void 0),i([t({json:{write:!0}})],e.prototype,"normalizationField",void 0),i([t({json:{read:n.read,write:n.write}})],e.prototype,"normalizationType",void 0),i([t({value:null,json:{write:!0}})],e.prototype,"standardDeviationInterval",null),i([t({value:null,json:{write:!0}})],e.prototype,"definedInterval",null),e=i([l("esri.rest.support.ClassBreaksDefinition")],e);const f=e;export{f as p}; diff --git a/main/assets/ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js b/main/assets/ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js new file mode 100644 index 000000000..14aa58f54 --- /dev/null +++ b/main/assets/ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js @@ -0,0 +1 @@ +import{aK as r,v as i,bz as o,S as t,i as l,e as d}from"./main-C7yV2j71.js";const s=new r({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),n=new r({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let e=class extends d{constructor(a){super(a),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};i([o({classBreaksDef:"class-breaks-definition"})],e.prototype,"type",void 0),i([t({json:{write:!0}})],e.prototype,"breakCount",void 0),i([t({json:{write:!0}})],e.prototype,"classificationField",void 0),i([t({type:String,json:{read:s.read,write:s.write}})],e.prototype,"classificationMethod",void 0),i([t({json:{write:!0}})],e.prototype,"normalizationField",void 0),i([t({json:{read:n.read,write:n.write}})],e.prototype,"normalizationType",void 0),i([t({value:null,json:{write:!0}})],e.prototype,"standardDeviationInterval",null),i([t({value:null,json:{write:!0}})],e.prototype,"definedInterval",null),e=i([l("esri.rest.support.ClassBreaksDefinition")],e);const f=e;export{f as p}; diff --git a/main/assets/CollectionFlattener-DkHuHn5E-BN4WFIND.js b/main/assets/CollectionFlattener-DkHuHn5E-BN4WFIND.js new file mode 100644 index 000000000..2db9aaf70 --- /dev/null +++ b/main/assets/CollectionFlattener-DkHuHn5E-BN4WFIND.js @@ -0,0 +1 @@ +import{v as l,S as r,i as f,ag as c,e8 as u,av as a}from"./main-C7yV2j71.js";let s=class extends c{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(u(()=>this._refresh(),a))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let o=0;for(const n of e)n!=null&&(o=this._processCollection(o,n));this.splice(o,this.length)}_createNewInstance(e){return new c(e)}_processCollection(e,o){if(!o)return e;const n=this.itemFilterFunction??(t=>!!t);for(const t of o)if(t){if(n(t)){const i=this.indexOf(t,e);i>=0?i!==e&&this.reorder(t,e):this.add(t,e),++e}if(this.getChildrenFunction){const i=this.getChildrenFunction(t);if(Array.isArray(i))for(const h of i)e=this._processCollection(e,h);else e=this._processCollection(e,i)}}return e}};l([r()],s.prototype,"getCollections",void 0),l([r()],s.prototype,"getChildrenFunction",void 0),l([r()],s.prototype,"itemFilterFunction",void 0),s=l([f("esri.core.CollectionFlattener")],s);const p=s;export{p as f}; diff --git a/main/assets/CollectionFlattener-DkHuHn5E-D3nwGseo.js b/main/assets/CollectionFlattener-DkHuHn5E-D3nwGseo.js deleted file mode 100644 index 141ff1d22..000000000 --- a/main/assets/CollectionFlattener-DkHuHn5E-D3nwGseo.js +++ /dev/null @@ -1 +0,0 @@ -import{v as l,S as r,i as f,ag as c,e8 as u,av as a}from"./main-BZaw9FpY.js";let s=class extends c{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(u(()=>this._refresh(),a))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let o=0;for(const n of e)n!=null&&(o=this._processCollection(o,n));this.splice(o,this.length)}_createNewInstance(e){return new c(e)}_processCollection(e,o){if(!o)return e;const n=this.itemFilterFunction??(t=>!!t);for(const t of o)if(t){if(n(t)){const i=this.indexOf(t,e);i>=0?i!==e&&this.reorder(t,e):this.add(t,e),++e}if(this.getChildrenFunction){const i=this.getChildrenFunction(t);if(Array.isArray(i))for(const h of i)e=this._processCollection(e,h);else e=this._processCollection(e,i)}}return e}};l([r()],s.prototype,"getCollections",void 0),l([r()],s.prototype,"getChildrenFunction",void 0),l([r()],s.prototype,"itemFilterFunction",void 0),s=l([f("esri.core.CollectionFlattener")],s);const p=s;export{p as f}; diff --git a/main/assets/ColorBackground-gVZldRLm-BDCeusMw.js b/main/assets/ColorBackground-gVZldRLm-BDCeusMw.js deleted file mode 100644 index 784ab6a52..000000000 --- a/main/assets/ColorBackground-gVZldRLm-BDCeusMw.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as a,ar as t,i as c,e as n,P as i}from"./main-BZaw9FpY.js";var r;let o=r=class extends n{constructor(s){super(s),this.color=new t([0,0,0,1])}clone(){return new r(i({color:this.color}))}};e([a({type:t,json:{write:!0}})],o.prototype,"color",void 0),o=r=e([c("esri.webmap.background.ColorBackground")],o);const p=o;export{p as default}; diff --git a/main/assets/ColorBackground-gVZldRLm-BdWj-dur.js b/main/assets/ColorBackground-gVZldRLm-BdWj-dur.js new file mode 100644 index 000000000..730add1e9 --- /dev/null +++ b/main/assets/ColorBackground-gVZldRLm-BdWj-dur.js @@ -0,0 +1 @@ +import{v as e,S as a,ar as t,i as c,e as n,P as i}from"./main-C7yV2j71.js";var r;let o=r=class extends n{constructor(s){super(s),this.color=new t([0,0,0,1])}clone(){return new r(i({color:this.color}))}};e([a({type:t,json:{write:!0}})],o.prototype,"color",void 0),o=r=e([c("esri.webmap.background.ColorBackground")],o);const p=o;export{p as default}; diff --git a/main/assets/ColorSet-DkIwOmgs-BZOv8dDH.js b/main/assets/ColorSet-DkIwOmgs-BZOv8dDH.js deleted file mode 100644 index 226277dbb..000000000 --- a/main/assets/ColorSet-DkIwOmgs-BZOv8dDH.js +++ /dev/null @@ -1 +0,0 @@ -import{E as c,a8 as h}from"./Theme-rblUnB2V-BIrfCzYF.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,a=this.get("passOptions"),P=this.get("reuse");for(let i=g;i1;)n-=1;let s=o.s+(a.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(a.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as i}; diff --git a/main/assets/ColorSet-DkIwOmgs-CITJ697b.js b/main/assets/ColorSet-DkIwOmgs-CITJ697b.js new file mode 100644 index 000000000..fae3e0fcd --- /dev/null +++ b/main/assets/ColorSet-DkIwOmgs-CITJ697b.js @@ -0,0 +1 @@ +import{E as c,a8 as h}from"./Theme-rblUnB2V-BgKdZgu2.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,a=this.get("passOptions"),P=this.get("reuse");for(let i=g;i1;)n-=1;let s=o.s+(a.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(a.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as i}; diff --git a/main/assets/Container-BcuL1ZEG-DH5lSN9D.js b/main/assets/Container-BcuL1ZEG-DH5lSN9D.js deleted file mode 100644 index a7a23e7aa..000000000 --- a/main/assets/Container-BcuL1ZEG-DH5lSN9D.js +++ /dev/null @@ -1 +0,0 @@ -import{v as a,S as o,i as m,j as v,K as R,a1 as O,P as _,b as p,I as S,a3 as q,dw as w,dx as g}from"./main-BZaw9FpY.js";import{e as I}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{c as F,C as M,O as V}from"./parser-DyDJ-rlI-mkgQEqcN.js";const u=-1;let c=class extends v{constructor(t){super(t),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=R("mapview-transitions-duration"),this.effects=[]}set effect(t){if(this._get("effect")!==(t=t||"")){this._set("effect",t);try{this._transitionTo(y(t))}catch(e){this._transitionTo([]),O.getLogger(this).warn("Invalid Effect",{effect:t,error:e})}}}get final(){return this._final}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(t){this._updateForScale(t)}get transitioning(){return this._to!==null}canTransitionTo(t){try{return this.scale>0&&b(this._current,y(t),this.scale)}catch{return!1}}transitionStep(t,e){this._applyTimeTransition(t),this._updateForScale(e)}endTransition(){this._applyTimeTransition(this.duration)}_transitionTo(t){this.scale>0&&b(this._current,t,this.scale)?(this._final=t,this._to=_(t),C(this._current,this._to,this.scale),this._from=_(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=t),this._set("effects",this._current[0]?_(this._current[0].effects):[])}_applyTimeTransition(t){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=t;const e=Math.min(1,this._time/this.duration);for(let i=0;i=e[0].scale)s=r=e[0].effects;else if(t<=e[i].scale)s=r=e[i].effects;else for(let n=0;n=t&&h.scale<=t){l=(t-f.scale)/(h.scale-f.scale),r=f.effects,s=h.effects;break}}for(let n=0;n1||e.length>1)&&i<=0)&&M(t[0].effects,e[0].effects)}function C(t,e,i){const r=t.length>e.length?t:e,s=t.length>e.length?e:t,l=s[s.length-1],n=l?.scale??i,f=l?.effects??[];for(let h=s.length;hs?Math.max(s,l-n):Math.min(s,l+n),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.(),this._fadeOutResolver?.(),this._fadeOutResolver=this._fadeInResolver=null)}};a([o()],d.prototype,"computedOpacity",void 0),a([o()],d.prototype,"computedVisible",void 0),a([o()],d.prototype,"opacity",void 0),a([o()],d.prototype,"visible",void 0),a([o()],d.prototype,"transitioning",null),a([o()],d.prototype,"_fadeOutResolver",void 0),a([o()],d.prototype,"_fadeInResolver",void 0),d=a([m("esri.views.2d.engine.transitions.FadeTransition")],d);class x extends S{constructor(){super(...arguments),this._transitionables=null,this._clips=null,this._fadeTransition=null,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get computedOpacity(){return this._fadeTransition?.computedOpacity??this.opacity}get clips(){return this._clips}set clips(e){this._clips=e,this.requestRender()}get fadeTransitionEnabled(){return this._fadeTransition!==null}set fadeTransitionEnabled(e){!this._fadeTransition&&e?(this._fadeTransition=new d({opacity:this.opacity,visible:this.visible}),this.addTransitionable(this._fadeTransition)):this._fadeTransition&&!e&&(this.removeTransitionable(this._fadeTransition),this._fadeTransition=null)}get inFadeTransition(){return this._fadeTransition?.transitioning??!1}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(e){this._opacity!==e&&(this._opacity=Math.min(1,Math.max(e,0)),this._fadeTransition&&(this._fadeTransition.opacity=this._opacity),this.requestRender())}get stage(){return this._stage}set stage(e){if(this._stage===e)return;const i=this._stage;this._stage=e,e?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i?.trashDisplayObject(this)}get transforms(){return this._transforms==null&&(this._transforms=this._createTransforms()),this._transforms}get transitioning(){return this.isTransitioning()}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,this._fadeTransition&&(this._fadeTransition.visible=this._visible),this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}addTransitionable(e){this._transitionables??=[],this._transitionables.push(e),this.requestRender()}removeTransitionable(e){e.endTransition(),this._transitionables&&q(this._transitionables,e),this.requestRender()}fadeIn(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeIn();return this.opacity=1,this.requestRender(),e}fadeOut(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeOut();return this.opacity=0,this.requestRender(),e}endTransitions(){if(this._transitionables){for(const e of this._transitionables)e.endTransition();this.requestRender()}}beforeRender(e){this.transitionStep(e.deltaTime,e.state.scale),this.setTransform(e.state)}afterRender(e){this.transitioning&&this.requestRender()}remove(){this.parent?.removeChild(this)}setTransform(e){}processRender(e){this.stage&&(this._fadeTransition?.computedVisible??this.visible)&&this.doRender(e)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this.endTransitions(),this.onDetach(),this.emit("detach")}isTransitioning(){return this._transitionables?.some(e=>e.transitioning)??!1}transitionStep(e,i){if(this._transitionables)for(const r of this._transitionables)r.transitionStep(e,i)}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}let B=class extends x{constructor(){super(...arguments),this._childrenSet=new Set,this._needsSort=!1,this._children=[],this._childrenObservable=new w,this._effectView=null,this._highlightGradient=null}get blendMode(){return this._blendMode}set blendMode(t){this._blendMode=t,this.requestRender()}get children(){return g(this._childrenObservable),this._children}get clips(){return this._clips}set clips(t){this._clips=t,this.children.forEach(e=>e.clips=t)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(t){(this._effectView||t)&&(this._effectView||(this._effectView=new c,this.addTransitionable(this._effectView)),this._effectView.effect=t,this.requestRender())}get highlightGradient(){return this._highlightGradient}set highlightGradient(t){this._highlightGradient=t,this.requestRender()}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(t=>t.hasHighlight)}get hasLabels(){return this.children.some(t=>t.hasLabels)}get requiresDedicatedFBO(){return this.children.some(t=>"blendMode"in t&&t.blendMode&&t.blendMode!=="normal")}get isReady(){return this.children.every(t=>t.isReady)}get sortFunction(){return this._sortFunction}set sortFunction(t){this._sortFunction=t,t&&(this._needsSort=!0)}doRender(t){const e=this.createRenderParams(t),{painter:i}=e;i.beforeRenderLayer(e,this._clips?.length?255:0,this.computedOpacity),this.renderChildren(e),i.afterRenderLayer(e,this.computedOpacity)}addChild(t){return this.addChildAt(t,this.children.length)}addChildAt(t,e=this.children.length){if(!t||this.contains(t))return t;this._needsSort=!0;const i=t.parent;return i&&i!==this&&i.removeChild(t),e>=this.children.length?this.children.push(t):this.children.splice(e,0,t),this._childrenSet.add(t),t.parent=this,t.stage=this.stage,this!==this.stage&&(t.clips=this.clips),this.requestRender(),this._childrenObservable.notify(),t}contains(t){return g(this._childrenObservable),this._childrenSet.has(t)}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const t of this.children)this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null;this.children.length=0,this._childrenObservable.notify()}removeChild(t){return this.contains(t)?this.removeChildAt(this.children.indexOf(t)):t}removeChildAt(t){if(t<0||t>=this.children.length)return null;this._needsSort=!0;const e=this.children.splice(t,1)[0];return this._childrenSet.delete(e),this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null,this._childrenObservable.notify(),e}beforeRender(t){super.beforeRender(t),this.sortFunction&&this._needsSort&&(this.children.sort(this.sortFunction),this._needsSort=!1,this._childrenObservable.notify());for(const e of this.children)e.beforeRender(t)}afterRender(t){super.afterRender(t);for(const e of this.children)e.afterRender(t)}_createTransforms(){return{displayViewScreenMat3:I()}}onAttach(){super.onAttach();const t=this.stage;for(const e of this.children)e.stage=t}onDetach(){super.onDetach();for(const t of this.children)t.stage=null}renderChildren(t){for(const e of this.children)e.processRender(t)}createRenderParams(t){return{...t,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:t.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||t.highlightGradient}}isTransitioning(){return super.isTransitioning()||this.children.some(t=>t.transitioning)}};export{x as T,c,B as x}; diff --git a/main/assets/Container-BcuL1ZEG-DU-CDj3E.js b/main/assets/Container-BcuL1ZEG-DU-CDj3E.js new file mode 100644 index 000000000..b191ceed1 --- /dev/null +++ b/main/assets/Container-BcuL1ZEG-DU-CDj3E.js @@ -0,0 +1 @@ +import{v as a,S as o,i as m,j as v,K as R,a1 as O,P as _,b as p,I as S,a3 as q,dw as w,dx as g}from"./main-C7yV2j71.js";import{e as I}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{c as F,C as M,O as V}from"./parser-DyDJ-rlI-CV6nO3M9.js";const u=-1;let c=class extends v{constructor(t){super(t),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=R("mapview-transitions-duration"),this.effects=[]}set effect(t){if(this._get("effect")!==(t=t||"")){this._set("effect",t);try{this._transitionTo(y(t))}catch(e){this._transitionTo([]),O.getLogger(this).warn("Invalid Effect",{effect:t,error:e})}}}get final(){return this._final}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(t){this._updateForScale(t)}get transitioning(){return this._to!==null}canTransitionTo(t){try{return this.scale>0&&b(this._current,y(t),this.scale)}catch{return!1}}transitionStep(t,e){this._applyTimeTransition(t),this._updateForScale(e)}endTransition(){this._applyTimeTransition(this.duration)}_transitionTo(t){this.scale>0&&b(this._current,t,this.scale)?(this._final=t,this._to=_(t),C(this._current,this._to,this.scale),this._from=_(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=t),this._set("effects",this._current[0]?_(this._current[0].effects):[])}_applyTimeTransition(t){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=t;const e=Math.min(1,this._time/this.duration);for(let i=0;i=e[0].scale)s=r=e[0].effects;else if(t<=e[i].scale)s=r=e[i].effects;else for(let n=0;n=t&&h.scale<=t){l=(t-f.scale)/(h.scale-f.scale),r=f.effects,s=h.effects;break}}for(let n=0;n1||e.length>1)&&i<=0)&&M(t[0].effects,e[0].effects)}function C(t,e,i){const r=t.length>e.length?t:e,s=t.length>e.length?e:t,l=s[s.length-1],n=l?.scale??i,f=l?.effects??[];for(let h=s.length;hs?Math.max(s,l-n):Math.min(s,l+n),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.(),this._fadeOutResolver?.(),this._fadeOutResolver=this._fadeInResolver=null)}};a([o()],d.prototype,"computedOpacity",void 0),a([o()],d.prototype,"computedVisible",void 0),a([o()],d.prototype,"opacity",void 0),a([o()],d.prototype,"visible",void 0),a([o()],d.prototype,"transitioning",null),a([o()],d.prototype,"_fadeOutResolver",void 0),a([o()],d.prototype,"_fadeInResolver",void 0),d=a([m("esri.views.2d.engine.transitions.FadeTransition")],d);class x extends S{constructor(){super(...arguments),this._transitionables=null,this._clips=null,this._fadeTransition=null,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get computedOpacity(){return this._fadeTransition?.computedOpacity??this.opacity}get clips(){return this._clips}set clips(e){this._clips=e,this.requestRender()}get fadeTransitionEnabled(){return this._fadeTransition!==null}set fadeTransitionEnabled(e){!this._fadeTransition&&e?(this._fadeTransition=new d({opacity:this.opacity,visible:this.visible}),this.addTransitionable(this._fadeTransition)):this._fadeTransition&&!e&&(this.removeTransitionable(this._fadeTransition),this._fadeTransition=null)}get inFadeTransition(){return this._fadeTransition?.transitioning??!1}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(e){this._opacity!==e&&(this._opacity=Math.min(1,Math.max(e,0)),this._fadeTransition&&(this._fadeTransition.opacity=this._opacity),this.requestRender())}get stage(){return this._stage}set stage(e){if(this._stage===e)return;const i=this._stage;this._stage=e,e?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i?.trashDisplayObject(this)}get transforms(){return this._transforms==null&&(this._transforms=this._createTransforms()),this._transforms}get transitioning(){return this.isTransitioning()}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,this._fadeTransition&&(this._fadeTransition.visible=this._visible),this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}addTransitionable(e){this._transitionables??=[],this._transitionables.push(e),this.requestRender()}removeTransitionable(e){e.endTransition(),this._transitionables&&q(this._transitionables,e),this.requestRender()}fadeIn(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeIn();return this.opacity=1,this.requestRender(),e}fadeOut(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeOut();return this.opacity=0,this.requestRender(),e}endTransitions(){if(this._transitionables){for(const e of this._transitionables)e.endTransition();this.requestRender()}}beforeRender(e){this.transitionStep(e.deltaTime,e.state.scale),this.setTransform(e.state)}afterRender(e){this.transitioning&&this.requestRender()}remove(){this.parent?.removeChild(this)}setTransform(e){}processRender(e){this.stage&&(this._fadeTransition?.computedVisible??this.visible)&&this.doRender(e)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this.endTransitions(),this.onDetach(),this.emit("detach")}isTransitioning(){return this._transitionables?.some(e=>e.transitioning)??!1}transitionStep(e,i){if(this._transitionables)for(const r of this._transitionables)r.transitionStep(e,i)}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}let B=class extends x{constructor(){super(...arguments),this._childrenSet=new Set,this._needsSort=!1,this._children=[],this._childrenObservable=new w,this._effectView=null,this._highlightGradient=null}get blendMode(){return this._blendMode}set blendMode(t){this._blendMode=t,this.requestRender()}get children(){return g(this._childrenObservable),this._children}get clips(){return this._clips}set clips(t){this._clips=t,this.children.forEach(e=>e.clips=t)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(t){(this._effectView||t)&&(this._effectView||(this._effectView=new c,this.addTransitionable(this._effectView)),this._effectView.effect=t,this.requestRender())}get highlightGradient(){return this._highlightGradient}set highlightGradient(t){this._highlightGradient=t,this.requestRender()}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(t=>t.hasHighlight)}get hasLabels(){return this.children.some(t=>t.hasLabels)}get requiresDedicatedFBO(){return this.children.some(t=>"blendMode"in t&&t.blendMode&&t.blendMode!=="normal")}get isReady(){return this.children.every(t=>t.isReady)}get sortFunction(){return this._sortFunction}set sortFunction(t){this._sortFunction=t,t&&(this._needsSort=!0)}doRender(t){const e=this.createRenderParams(t),{painter:i}=e;i.beforeRenderLayer(e,this._clips?.length?255:0,this.computedOpacity),this.renderChildren(e),i.afterRenderLayer(e,this.computedOpacity)}addChild(t){return this.addChildAt(t,this.children.length)}addChildAt(t,e=this.children.length){if(!t||this.contains(t))return t;this._needsSort=!0;const i=t.parent;return i&&i!==this&&i.removeChild(t),e>=this.children.length?this.children.push(t):this.children.splice(e,0,t),this._childrenSet.add(t),t.parent=this,t.stage=this.stage,this!==this.stage&&(t.clips=this.clips),this.requestRender(),this._childrenObservable.notify(),t}contains(t){return g(this._childrenObservable),this._childrenSet.has(t)}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const t of this.children)this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null;this.children.length=0,this._childrenObservable.notify()}removeChild(t){return this.contains(t)?this.removeChildAt(this.children.indexOf(t)):t}removeChildAt(t){if(t<0||t>=this.children.length)return null;this._needsSort=!0;const e=this.children.splice(t,1)[0];return this._childrenSet.delete(e),this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null,this._childrenObservable.notify(),e}beforeRender(t){super.beforeRender(t),this.sortFunction&&this._needsSort&&(this.children.sort(this.sortFunction),this._needsSort=!1,this._childrenObservable.notify());for(const e of this.children)e.beforeRender(t)}afterRender(t){super.afterRender(t);for(const e of this.children)e.afterRender(t)}_createTransforms(){return{displayViewScreenMat3:I()}}onAttach(){super.onAttach();const t=this.stage;for(const e of this.children)e.stage=t}onDetach(){super.onDetach();for(const t of this.children)t.stage=null}renderChildren(t){for(const e of this.children)e.processRender(t)}createRenderParams(t){return{...t,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:t.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||t.highlightGradient}}isTransitioning(){return super.isTransitioning()||this.children.some(t=>t.transitioning)}};export{x as T,c,B as x}; diff --git a/main/assets/CustomParametersMixin-vdKsTHer-CoiI71pj.js b/main/assets/CustomParametersMixin-vdKsTHer-CoiI71pj.js deleted file mode 100644 index 62ad670d0..000000000 --- a/main/assets/CustomParametersMixin-vdKsTHer-CoiI71pj.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as o,i}from"./main-BZaw9FpY.js";const n=s=>{let e=class extends s{constructor(){super(...arguments),this.customParameters=null}};return r([o({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=r([i("esri.layers.mixins.CustomParametersMixin")],e),e};export{n as i}; diff --git a/main/assets/CustomParametersMixin-vdKsTHer-DndyRc71.js b/main/assets/CustomParametersMixin-vdKsTHer-DndyRc71.js new file mode 100644 index 000000000..9b9d48c1c --- /dev/null +++ b/main/assets/CustomParametersMixin-vdKsTHer-DndyRc71.js @@ -0,0 +1 @@ +import{v as r,S as o,i}from"./main-C7yV2j71.js";const n=s=>{let e=class extends s{constructor(){super(...arguments),this.customParameters=null}};return r([o({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=r([i("esri.layers.mixins.CustomParametersMixin")],e),e};export{n as i}; diff --git a/main/assets/Cyclical-C_9rKUUQ-CmN6QXv-.js b/main/assets/Cyclical-C_9rKUUQ-CmN6QXv-.js deleted file mode 100644 index 5ee81636e..000000000 --- a/main/assets/Cyclical-C_9rKUUQ-CmN6QXv-.js +++ /dev/null @@ -1 +0,0 @@ -import{ae as r}from"./main-BZaw9FpY.js";class h{constructor(n,i){this.min=n,this.max=i,this.range=i-n}normalize(n,i=0,o=!1){return e(this.range,this.min,this.max,n,i,o)}clamp(n,i=0){return r(n-i,this.min,this.max)+i}monotonic(n,i,o){return nn&&oi&&(o-=a(t,o-i)),m&&o===i&&(o=n),o+s}function a(t,n,i=0){return Math.ceil((n-i)/t)*t+i}const u=new h(0,360);export{u as c,h as o}; diff --git a/main/assets/Cyclical-C_9rKUUQ-DaQlxz0D.js b/main/assets/Cyclical-C_9rKUUQ-DaQlxz0D.js new file mode 100644 index 000000000..160f2fe29 --- /dev/null +++ b/main/assets/Cyclical-C_9rKUUQ-DaQlxz0D.js @@ -0,0 +1 @@ +import{ae as r}from"./main-C7yV2j71.js";class h{constructor(n,i){this.min=n,this.max=i,this.range=i-n}normalize(n,i=0,o=!1){return e(this.range,this.min,this.max,n,i,o)}clamp(n,i=0){return r(n-i,this.min,this.max)+i}monotonic(n,i,o){return nn&&oi&&(o-=a(t,o-i)),m&&o===i&&(o=n),o+s}function a(t,n,i=0){return Math.ceil((n-i)/t)*t+i}const u=new h(0,360);export{u as c,h as o}; diff --git a/main/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-CsDFFIOj.js b/main/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-CsDFFIOj.js deleted file mode 100644 index 4e98e8a6f..000000000 --- a/main/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-CsDFFIOj.js +++ /dev/null @@ -1 +0,0 @@ -import{hc as m,k4 as B,k5 as _,k6 as b,d7 as g,$ as h,k7 as S,f as j,b6 as w,W as I,o as A,hU as T}from"./main-BZaw9FpY.js";import{A as R,h as O}from"./Indices-DEr2HrWx-Cw8IJeSy.js";import{T as l}from"./enums-DBi1-Mm2-CUS1pvQe.js";function k(e,r){d(e.typedBuffer,r.typedBuffer,e.typedBufferStride,r.typedBufferStride)}function d(e,r,f=2,n=f){const o=r.length/2;let t=0,u=0;if(m(r)||B(r)){for(let i=0;i{g.set(s,p)})}class b extends R{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonDisabled:i.fromHex(14342874),primaryButtonTextDisabled:i.fromHex(16777215),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("ZoomableContainer").setAll({width:r,height:r,wheelable:!0,pinchZoom:!0,maxZoomLevel:32,minZoomLevel:1,zoomStep:2,animationEasing:c(u),animationDuration:600,maxPanOut:.4}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("GrainPattern").setAll({width:200,height:200,colors:[i.fromHex(0)],size:1,horizontalGap:0,verticalGap:0,density:1,minOpacity:0,maxOpacity:.2});{const t=e("PatternSet");t.setAll({step:1}),a(t,"color",o,"stroke")}e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:m.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("EditableLabel").setAll({editOn:"click",themeTags:["editablelabel"],multiLine:!0}),e("RoundedRectangle",["editablelabel","background"]).setAll({fillOpacity:0,fill:i.fromHex(0),cornerRadiusBL:3,cornerRadiusBR:3,cornerRadiusTL:3,cornerRadiusTR:3,strokeOpacity:0,stroke:i.fromHex(0)}),e("RoundedRectangle",["editablelabel","background"]).states.create("active",{strokeOpacity:.2}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{}),e("Button").states.create("disabled",{forceInactive:!0});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("RoundedRectangle",["button","background"]).states.create("disabled",{}),"fill",o,"primaryButtonDisabled"),a(e("Graphics",["button","icon"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled"),a(e("Label",["button"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled");{const t=e("Graphics",["button","icon"]);t.setAll({forceInactive:!0}),a(t,"stroke",o,"primaryButtonText")}a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10,isMeasured:!1}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}e("Graphics",["button","plus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0),t.moveTo(0,-4),t.lineTo(0,4)}}),e("Graphics",["button","minus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0)}}),e("Graphics",["button","home","icon"]).setAll({x:n,y:n,svgPath:"M 8 -1 L 6 -1 L 6 7 L 2 7 L 2 1 L -2 1 L -2 7 L -6 7 L -6 -1 L -8 -1 L 0 -9 L 8 -1 Z M 8 -1"}),e("Button",["zoomtools"]).setAll({marginTop:1,marginBottom:2}),e("ZoomTools").setAll({x:r,centerX:r,y:r,centerY:r,paddingRight:10,paddingBottom:10})}}export{b as h,a as o}; diff --git a/main/assets/DefaultTheme-Bt5OI-Ht-D4nvY2Bb.js b/main/assets/DefaultTheme-Bt5OI-Ht-D4nvY2Bb.js deleted file mode 100644 index 0738cb6a8..000000000 --- a/main/assets/DefaultTheme-Bt5OI-Ht-D4nvY2Bb.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as R,a8 as i,as as c,at as n,U as r,Y as m,au as u}from"./Theme-rblUnB2V-BIrfCzYF.js";function a(g,s,o,d){g.set(s,o.get(d)),o.on(d,p=>{g.set(s,p)})}class b extends R{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonDisabled:i.fromHex(14342874),primaryButtonTextDisabled:i.fromHex(16777215),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("ZoomableContainer").setAll({width:r,height:r,wheelable:!0,pinchZoom:!0,maxZoomLevel:32,minZoomLevel:1,zoomStep:2,animationEasing:c(u),animationDuration:600,maxPanOut:.4}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("GrainPattern").setAll({width:200,height:200,colors:[i.fromHex(0)],size:1,horizontalGap:0,verticalGap:0,density:1,minOpacity:0,maxOpacity:.2});{const t=e("PatternSet");t.setAll({step:1}),a(t,"color",o,"stroke")}e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:m.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("EditableLabel").setAll({editOn:"click",themeTags:["editablelabel"],multiLine:!0}),e("RoundedRectangle",["editablelabel","background"]).setAll({fillOpacity:0,fill:i.fromHex(0),cornerRadiusBL:3,cornerRadiusBR:3,cornerRadiusTL:3,cornerRadiusTR:3,strokeOpacity:0,stroke:i.fromHex(0)}),e("RoundedRectangle",["editablelabel","background"]).states.create("active",{strokeOpacity:.2}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{}),e("Button").states.create("disabled",{forceInactive:!0});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("RoundedRectangle",["button","background"]).states.create("disabled",{}),"fill",o,"primaryButtonDisabled"),a(e("Graphics",["button","icon"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled"),a(e("Label",["button"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled");{const t=e("Graphics",["button","icon"]);t.setAll({forceInactive:!0}),a(t,"stroke",o,"primaryButtonText")}a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10,isMeasured:!1}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}e("Graphics",["button","plus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0),t.moveTo(0,-4),t.lineTo(0,4)}}),e("Graphics",["button","minus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0)}}),e("Graphics",["button","home","icon"]).setAll({x:n,y:n,svgPath:"M 8 -1 L 6 -1 L 6 7 L 2 7 L 2 1 L -2 1 L -2 7 L -6 7 L -6 -1 L -8 -1 L 0 -9 L 8 -1 Z M 8 -1"}),e("Button",["zoomtools"]).setAll({marginTop:1,marginBottom:2}),e("ZoomTools").setAll({x:r,centerX:r,y:r,centerY:r,paddingRight:10,paddingBottom:10})}}export{b as h,a as o}; diff --git a/main/assets/DeleteForwardEditsParameters-C-_YAZEH-B6OHx3BV.js b/main/assets/DeleteForwardEditsParameters-C-_YAZEH-B6OHx3BV.js deleted file mode 100644 index 73f288d51..000000000 --- a/main/assets/DeleteForwardEditsParameters-C-_YAZEH-B6OHx3BV.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as o,i as n,e as a,aO as m}from"./main-BZaw9FpY.js";var s;let t=s=class extends a{static from(e){return m(s,e)}constructor(e){super(e),this.sessionId=void 0,this.moment=null}};r([o({type:String,json:{write:!0}})],t.prototype,"sessionId",void 0),r([o({type:Date,json:{type:Number,write:{writer:(e,i)=>{i.moment=e?e.getTime():null}}}})],t.prototype,"moment",void 0),t=s=r([n("esri.rest.versionManagement.gdbVersion.support.DeleteForwardEditsParameters")],t);const d=t;export{d as default}; diff --git a/main/assets/DeleteForwardEditsParameters-C-_YAZEH-DZ1n6SE7.js b/main/assets/DeleteForwardEditsParameters-C-_YAZEH-DZ1n6SE7.js new file mode 100644 index 000000000..a1d508edb --- /dev/null +++ b/main/assets/DeleteForwardEditsParameters-C-_YAZEH-DZ1n6SE7.js @@ -0,0 +1 @@ +import{v as r,S as o,i as n,e as a,aO as m}from"./main-C7yV2j71.js";var s;let t=s=class extends a{static from(e){return m(s,e)}constructor(e){super(e),this.sessionId=void 0,this.moment=null}};r([o({type:String,json:{write:!0}})],t.prototype,"sessionId",void 0),r([o({type:Date,json:{type:Number,write:{writer:(e,i)=>{i.moment=e?e.getTime():null}}}})],t.prototype,"moment",void 0),t=s=r([n("esri.rest.versionManagement.gdbVersion.support.DeleteForwardEditsParameters")],t);const d=t;export{d as default}; diff --git a/main/assets/DimensionLayer-DFh7fPYo-CxFJ4hke.js b/main/assets/DimensionLayer-DFh7fPYo-CxFJ4hke.js new file mode 100644 index 000000000..0aaf82fa7 --- /dev/null +++ b/main/assets/DimensionLayer-DFh7fPYo-CxFJ4hke.js @@ -0,0 +1 @@ +import{bA as P,ar as d,v as t,S as n,bB as h,eo as w,f3 as D,i as m,w as v,ad as S,ab as z,ag as R,eb as E,ah as N,ax as j,ac as _,aP as O,am as k,n as b}from"./main-C7yV2j71.js";import{y as A}from"./Analysis-BPgJ-FCw-Bdup4FTz.js";import{c as C}from"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import{X as L}from"./projection-BA9M1R7d-DXrPfsKU.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as B}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{E as H}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";let r=class extends P(O){constructor(e){super(e),this.type="simple",this.color=new d("black"),this.lineSize=2,this.fontSize=10,this.textColor=new d("black"),this.textBackgroundColor=new d([255,255,255,.6])}};t([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:w,nonNullable:!0,range:{min:D(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:w,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const g=r;var y;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(y||(y={}));const F=[y.Horizontal,y.Vertical,y.Direct];let l=class extends P(O){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};t([n({type:["length"],json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"startPoint",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"endPoint",void 0),t([n({type:F,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"measureType",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),S(e=>C.normalize(z(e),0,!0))],l.prototype,"orientation",void 0),l=t([m("esri.analysis.LengthDimension")],l);const q=l,f=R.ofType(q);let p=class extends A{constructor(e){super(e),this.type="dimension",this.style=new g,this.extent=null}initialize(){this.addHandles(N(()=>this._computeExtent(),e=>{e?.pending==null&&this._set("extent",e!=null?e.extent:null)},j))}get dimensions(){return this._get("dimensions")||new f}set dimensions(e){this._set("dimensions",k(e,this.dimensions,f))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,i)=>(e.push(i.startPoint,i.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const i=[];for(const o of this.dimensions)o.startPoint!=null&&i.push(o.startPoint),o.endPoint!=null&&i.push(o.endPoint);const a=L(i,e);if(a.pending!=null)return{pending:a.pending,extent:null};let c=null;return a.geometries!=null&&(c=a.geometries.reduce((o,u)=>o==null?u!=null?b.fromPoint(u):null:u!=null?o.union(b.fromPoint(u)):o,null)),{pending:null,extent:c}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],p.prototype,"type",void 0),t([n({cast:E,type:f,nonNullable:!0})],p.prototype,"dimensions",null),t([n({readOnly:!0})],p.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},nonNullable:!0})],p.prototype,"style",void 0),t([n({value:null,readOnly:!0})],p.prototype,"extent",void 0),t([n({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([m("esri.analysis.DimensionAnalysis")],p);const x=p;let s=class extends H(T(B)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new x,this.opacity=1,e){const{source:i,style:a}=e;i&&a&&(i.style=a)}}initialize(){this.addHandles([N(()=>this.source,(e,i)=>{i!=null&&i.parent===this&&(i.parent=null),e!=null&&(e.parent=this)},j)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new x)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,i,a,c){i.dimensions=e.filter(({startPoint:o,endPoint:u})=>o!=null&&u!=null).map(o=>o.toJSON(c)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],s.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],s.prototype,"source",void 0),t([n({readOnly:!0})],s.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},json:{write:{ignoreOrigin:!0}}})],s.prototype,"style",null),t([n({readOnly:!0})],s.prototype,"fullExtent",null),t([n({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),t([n({type:["show","hide"]})],s.prototype,"listMode",void 0),t([n({type:R.ofType(q),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],s.prototype,"dimensions",null),t([_("web-scene","dimensions")],s.prototype,"writeDimensions",null),s=t([m("esri.layers.DimensionLayer")],s);const W=s;export{W as default}; diff --git a/main/assets/DimensionLayer-DFh7fPYo-Dagcf84w.js b/main/assets/DimensionLayer-DFh7fPYo-Dagcf84w.js deleted file mode 100644 index 302bb9945..000000000 --- a/main/assets/DimensionLayer-DFh7fPYo-Dagcf84w.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as P,ar as d,v as t,S as n,bB as h,eo as w,f3 as D,i as m,w as v,ad as S,ab as z,ag as R,eb as E,ah as N,ax as j,ac as _,aP as O,am as k,n as b}from"./main-BZaw9FpY.js";import{y as A}from"./Analysis-BPgJ-FCw-72MMAaCQ.js";import{c as C}from"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import{X as L}from"./projection-BA9M1R7d-DoNqITCd.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as B}from"./Layer-ChoECxvZ-C4wLrCej.js";import{E as H}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";let r=class extends P(O){constructor(e){super(e),this.type="simple",this.color=new d("black"),this.lineSize=2,this.fontSize=10,this.textColor=new d("black"),this.textBackgroundColor=new d([255,255,255,.6])}};t([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:w,nonNullable:!0,range:{min:D(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:w,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const g=r;var y;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(y||(y={}));const F=[y.Horizontal,y.Vertical,y.Direct];let l=class extends P(O){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};t([n({type:["length"],json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"startPoint",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"endPoint",void 0),t([n({type:F,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"measureType",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),S(e=>C.normalize(z(e),0,!0))],l.prototype,"orientation",void 0),l=t([m("esri.analysis.LengthDimension")],l);const q=l,f=R.ofType(q);let p=class extends A{constructor(e){super(e),this.type="dimension",this.style=new g,this.extent=null}initialize(){this.addHandles(N(()=>this._computeExtent(),e=>{e?.pending==null&&this._set("extent",e!=null?e.extent:null)},j))}get dimensions(){return this._get("dimensions")||new f}set dimensions(e){this._set("dimensions",k(e,this.dimensions,f))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,i)=>(e.push(i.startPoint,i.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const i=[];for(const o of this.dimensions)o.startPoint!=null&&i.push(o.startPoint),o.endPoint!=null&&i.push(o.endPoint);const a=L(i,e);if(a.pending!=null)return{pending:a.pending,extent:null};let c=null;return a.geometries!=null&&(c=a.geometries.reduce((o,u)=>o==null?u!=null?b.fromPoint(u):null:u!=null?o.union(b.fromPoint(u)):o,null)),{pending:null,extent:c}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],p.prototype,"type",void 0),t([n({cast:E,type:f,nonNullable:!0})],p.prototype,"dimensions",null),t([n({readOnly:!0})],p.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},nonNullable:!0})],p.prototype,"style",void 0),t([n({value:null,readOnly:!0})],p.prototype,"extent",void 0),t([n({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([m("esri.analysis.DimensionAnalysis")],p);const x=p;let s=class extends H(T(B)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new x,this.opacity=1,e){const{source:i,style:a}=e;i&&a&&(i.style=a)}}initialize(){this.addHandles([N(()=>this.source,(e,i)=>{i!=null&&i.parent===this&&(i.parent=null),e!=null&&(e.parent=this)},j)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new x)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,i,a,c){i.dimensions=e.filter(({startPoint:o,endPoint:u})=>o!=null&&u!=null).map(o=>o.toJSON(c)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],s.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],s.prototype,"source",void 0),t([n({readOnly:!0})],s.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},json:{write:{ignoreOrigin:!0}}})],s.prototype,"style",null),t([n({readOnly:!0})],s.prototype,"fullExtent",null),t([n({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),t([n({type:["show","hide"]})],s.prototype,"listMode",void 0),t([n({type:R.ofType(q),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],s.prototype,"dimensions",null),t([_("web-scene","dimensions")],s.prototype,"writeDimensions",null),s=t([m("esri.layers.DimensionLayer")],s);const W=s;export{W as default}; diff --git a/main/assets/EdgeProcessingWorker-DpfeS31e-B_miOcxS.js b/main/assets/EdgeProcessingWorker-DpfeS31e-B_miOcxS.js deleted file mode 100644 index d85895a7c..000000000 --- a/main/assets/EdgeProcessingWorker-DpfeS31e-B_miOcxS.js +++ /dev/null @@ -1 +0,0 @@ -import{W as l}from"./InterleavedLayout-DXzw3B2n-BD8s1eQP.js";import{W as p,m as c,u,l as f,H as d,k as m}from"./edgeProcessing-CALv8P-b-Cef3g_Hy.js";import"./BufferView-PQoE3GL7-DXIpDOUe.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./main-BZaw9FpY.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-cAmFzdIS.js";import"./Indices-DEr2HrWx-Cw8IJeSy.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new l(t.layout)}}class z{async extract(e){const i=o(e),r=p(i),n=[i.data.buffer];return{result:g(r,n),transferList:n}}async extractComponentsEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,w),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}async extractEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,L),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}}function o(t){return{data:f.createView(t.dataBuffer),indices:t.indicesType==="Uint32Array"?new Uint32Array(t.indices):t.indicesType==="Uint16Array"?new Uint16Array(t.indices):t.indices,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function g(t,e){return e.push(t.regular.lodInfo.lengths.buffer),e.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:a(t.regular.instancesData,e),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:a(t.silhouette.instancesData,e),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}class h{allocate(e){return d.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1)}}class y{allocate(e){return m.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1),e.componentIndex.set(i,r.componentIndex)}}const L=new h,w=new y;export{z as default}; diff --git a/main/assets/EdgeProcessingWorker-DpfeS31e-DjVXxipy.js b/main/assets/EdgeProcessingWorker-DpfeS31e-DjVXxipy.js new file mode 100644 index 000000000..de8bc90e8 --- /dev/null +++ b/main/assets/EdgeProcessingWorker-DpfeS31e-DjVXxipy.js @@ -0,0 +1 @@ +import{W as l}from"./InterleavedLayout-DXzw3B2n-BD0-ikLj.js";import{W as p,m as c,u,l as f,H as d,k as m}from"./edgeProcessing-CALv8P-b-BX_riuLT.js";import"./BufferView-PQoE3GL7-M6q1od-Y.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./main-C7yV2j71.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-eujRBTUy.js";import"./Indices-DEr2HrWx-Cd6y9wum.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new l(t.layout)}}class z{async extract(e){const i=o(e),r=p(i),n=[i.data.buffer];return{result:g(r,n),transferList:n}}async extractComponentsEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,w),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}async extractEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,L),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}}function o(t){return{data:f.createView(t.dataBuffer),indices:t.indicesType==="Uint32Array"?new Uint32Array(t.indices):t.indicesType==="Uint16Array"?new Uint16Array(t.indices):t.indices,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function g(t,e){return e.push(t.regular.lodInfo.lengths.buffer),e.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:a(t.regular.instancesData,e),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:a(t.silhouette.instancesData,e),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}class h{allocate(e){return d.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1)}}class y{allocate(e){return m.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1),e.componentIndex.set(i,r.componentIndex)}}const L=new h,w=new y;export{z as default}; diff --git a/main/assets/EditBusLayer-Df29OyJh-C36maE2j.js b/main/assets/EditBusLayer-Df29OyJh-C36maE2j.js deleted file mode 100644 index 5eb91be78..000000000 --- a/main/assets/EditBusLayer-Df29OyJh-C36maE2j.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./deleteForwardEdits-BHWvOnK8-JWeZ9yT2.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./utils-9sQxfkoa-Cus_qP6M.js","./DeleteForwardEditsParameters-C-_YAZEH-B6OHx3BV.js"])))=>i.map(i=>d[i]); -import{I as R,v as E,S as L,i as k,f as P,_ as w,b as T,P as m}from"./main-BZaw9FpY.js";import{c as x}from"./uuid-Dj9mdEVg-BaKSCiyT.js";const D=x(),j=new Map,V=new Map;async function O(e,r,d){if(!e||!d)return!1;if(!r)return!0;const s=new URL(e).host;let i=j.get(s);if(!i){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");i=(await P(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return i===r}async function z(e,r,d=!1){if(!e||!r)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=V.get(s)?.entries();if(i){for(const[t,o]of i)if(o.name===r){const a=!o.stack?.hasForwardEdits();if(!a&&d){const[{deleteForwardEdits:u},{default:h}]=await Promise.all([w(()=>import("./deleteForwardEdits-BHWvOnK8-JWeZ9yT2.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),w(()=>import("./DeleteForwardEditsParameters-C-_YAZEH-B6OHx3BV.js"),__vite__mapDeps([4,1,2]),import.meta.url)]),c=await u(s,t,new h({sessionId:D,moment:o.moment}));return c.success&&o.stack?.clearForwardEdits(),c.success}return a}}return!0}function $(e,r){if(!e)return!1;const d=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),s=V.get(d)?.entries();if(s){for(const[i,t]of s)if(t.name===r)return t.lockType==="edit"}return!1}const I=new R.EventEmitter;function N(e){return I.on("apply-edits",new WeakRef(e))}function W(e){return I.on("update-moment",new WeakRef(e))}function C(e,r,d=null,s=!1){const i=T();return s=r==null||s,I.emit("apply-edits",{serviceUrl:e,layerId:r,gdbVersion:d,mayReceiveServiceEdits:s,result:i.promise}),i}const A=Symbol();function G(e){return e!=null&&typeof e=="object"&&A in e}function p(e){return e!=null&&typeof e=="object"&&"gdbVersion"in e}function g(e,r,d){const s=new URL(e).host,i=j.get(s),t=o=>!o||o===i;return t(r)&&t(d)||r===d}const J=e=>{var r;let d=class extends e{constructor(...s){super(...s),this[r]=!0,this._applyEditsHandler=i=>{const{serviceUrl:t,layerId:o,gdbVersion:a,mayReceiveServiceEdits:u,result:h}=i,c=t===this.url,f=o!=null&&this.layerId!=null&&o===this.layerId,S=p(this),H=p(this)&&g(t,a,this.gdbVersion);if(!c||S&&!H||!f&&!u)return;const U=h.then(n=>{if(this.lastEditsEventDate=new Date,f&&(n.addedFeatures.length||n.updatedFeatures.length||n.deletedFeatures.length||n.addedAttachments.length||n.updatedAttachments.length||n.deletedAttachments.length))return this.emit("edits",m(n)),n;const M=n.editedFeatures?.find(({layerId:F})=>F===this.layerId);if(M){const{adds:F,updates:y,deletes:v}=M.editedFeatures,_={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:F?F.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],updatedFeatures:y?y.map(({current:{attributes:l}})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return this.emit("edits",_),_}const b={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,b.historicMoment)&&this.emit("edits",b),b}).then(n=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,n.historicMoment)&&(this.historicMoment=n.historicMoment),n));this.emit("apply-edits",{result:U})},this._updateMomentHandler=i=>{const{serviceUrl:t,gdbVersion:o,moment:a}=i,u=t===this.url,h=p(this),c=p(this)&&g(t,o,this.gdbVersion),f=p(this)&&!g(t,this.gdbVersion,null);u&&h&&c&&f&&"historicMoment"in this&&this.historicMoment!==a&&(this.historicMoment=a)},this.when().then(()=>{this.addHandles(N(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(W(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(s,i,t){return"historicMoment"in this&&this.historicMoment!==t&&$(s,i)}};return r=A,E([L()],d.prototype,"lastEditsEventDate",void 0),d=E([k("esri.layers.mixins.EditBusLayer")],d),d};export{G as B,J as C,$ as H,O as P,z as W,D as j,C as z}; diff --git a/main/assets/EditBusLayer-Df29OyJh-DJOAJb6r.js b/main/assets/EditBusLayer-Df29OyJh-DJOAJb6r.js new file mode 100644 index 000000000..a0d70ab2a --- /dev/null +++ b/main/assets/EditBusLayer-Df29OyJh-DJOAJb6r.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./deleteForwardEdits-BHWvOnK8-BMOlhqlR.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./utils-9sQxfkoa-Bn_d9vXA.js","./DeleteForwardEditsParameters-C-_YAZEH-DZ1n6SE7.js"])))=>i.map(i=>d[i]); +import{I as R,v as E,S as L,i as k,f as P,_ as w,b as T,P as m}from"./main-C7yV2j71.js";import{c as x}from"./uuid-Dj9mdEVg-BaKSCiyT.js";const D=x(),j=new Map,V=new Map;async function O(e,r,d){if(!e||!d)return!1;if(!r)return!0;const s=new URL(e).host;let i=j.get(s);if(!i){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");i=(await P(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return i===r}async function z(e,r,d=!1){if(!e||!r)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=V.get(s)?.entries();if(i){for(const[t,o]of i)if(o.name===r){const a=!o.stack?.hasForwardEdits();if(!a&&d){const[{deleteForwardEdits:u},{default:h}]=await Promise.all([w(()=>import("./deleteForwardEdits-BHWvOnK8-BMOlhqlR.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),w(()=>import("./DeleteForwardEditsParameters-C-_YAZEH-DZ1n6SE7.js"),__vite__mapDeps([4,1,2]),import.meta.url)]),c=await u(s,t,new h({sessionId:D,moment:o.moment}));return c.success&&o.stack?.clearForwardEdits(),c.success}return a}}return!0}function $(e,r){if(!e)return!1;const d=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),s=V.get(d)?.entries();if(s){for(const[i,t]of s)if(t.name===r)return t.lockType==="edit"}return!1}const I=new R.EventEmitter;function N(e){return I.on("apply-edits",new WeakRef(e))}function W(e){return I.on("update-moment",new WeakRef(e))}function C(e,r,d=null,s=!1){const i=T();return s=r==null||s,I.emit("apply-edits",{serviceUrl:e,layerId:r,gdbVersion:d,mayReceiveServiceEdits:s,result:i.promise}),i}const A=Symbol();function G(e){return e!=null&&typeof e=="object"&&A in e}function p(e){return e!=null&&typeof e=="object"&&"gdbVersion"in e}function g(e,r,d){const s=new URL(e).host,i=j.get(s),t=o=>!o||o===i;return t(r)&&t(d)||r===d}const J=e=>{var r;let d=class extends e{constructor(...s){super(...s),this[r]=!0,this._applyEditsHandler=i=>{const{serviceUrl:t,layerId:o,gdbVersion:a,mayReceiveServiceEdits:u,result:h}=i,c=t===this.url,f=o!=null&&this.layerId!=null&&o===this.layerId,S=p(this),H=p(this)&&g(t,a,this.gdbVersion);if(!c||S&&!H||!f&&!u)return;const U=h.then(n=>{if(this.lastEditsEventDate=new Date,f&&(n.addedFeatures.length||n.updatedFeatures.length||n.deletedFeatures.length||n.addedAttachments.length||n.updatedAttachments.length||n.deletedAttachments.length))return this.emit("edits",m(n)),n;const M=n.editedFeatures?.find(({layerId:F})=>F===this.layerId);if(M){const{adds:F,updates:y,deletes:v}=M.editedFeatures,_={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:F?F.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],updatedFeatures:y?y.map(({current:{attributes:l}})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return this.emit("edits",_),_}const b={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,b.historicMoment)&&this.emit("edits",b),b}).then(n=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,n.historicMoment)&&(this.historicMoment=n.historicMoment),n));this.emit("apply-edits",{result:U})},this._updateMomentHandler=i=>{const{serviceUrl:t,gdbVersion:o,moment:a}=i,u=t===this.url,h=p(this),c=p(this)&&g(t,o,this.gdbVersion),f=p(this)&&!g(t,this.gdbVersion,null);u&&h&&c&&f&&"historicMoment"in this&&this.historicMoment!==a&&(this.historicMoment=a)},this.when().then(()=>{this.addHandles(N(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(W(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(s,i,t){return"historicMoment"in this&&this.historicMoment!==t&&$(s,i)}};return r=A,E([L()],d.prototype,"lastEditsEventDate",void 0),d=E([k("esri.layers.mixins.EditBusLayer")],d),d};export{G as B,J as C,$ as H,O as P,z as W,D as j,C as z}; diff --git a/main/assets/ElevationInfo-yv2-9tj6-CpVy5FM0.js b/main/assets/ElevationInfo-yv2-9tj6-CpVy5FM0.js new file mode 100644 index 000000000..5b1b54e67 --- /dev/null +++ b/main/assets/ElevationInfo-yv2-9tj6-CpVy5FM0.js @@ -0,0 +1 @@ +import{v as s,S as o,d2 as c,aK as y,a0 as E,ac as v,e as l,dL as I,i as d,a3 as w,dM as g}from"./main-C7yV2j71.js";import{m as x}from"./lengthUtils-DKpMe5qR-E2FfnN85.js";var u;let i=u=class extends l{constructor(e){super(e)}async collectRequiredFields(e,t){return I(e,t,this.expression)}clone(){return new u({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};s([o({type:String,json:{write:!0}})],i.prototype,"expression",void 0),s([o({type:String,json:{write:!0}})],i.prototype,"title",void 0),i=u=s([d("esri.symbols.support.FeatureExpressionInfo")],i);const p=i;function S(e){return 1/(x[e]||1)}function j(){const e=Object.keys(x);return w(e,"decimal-degrees"),e.sort(),e}const b=j();var a;const n=c()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),f=new y({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let r=a=class extends l{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e??(t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(e,t,h,m){t[h]=e.write({},m),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):e!=null||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new a({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&g(this.featureExpressionInfo,e.featureExpressionInfo)}};s([o({type:p,json:{write:!0}})],r.prototype,"featureExpressionInfo",void 0),s([E("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],r.prototype,"readFeatureExpressionInfo",null),s([v("featureExpressionInfo",{featureExpressionInfo:{type:p},"featureExpression.value":{type:[0]}})],r.prototype,"writeFeatureExpressionInfo",null),s([o({type:n.apiValues,nonNullable:!0,json:{type:n.jsonValues,read:n.read,write:{writer:n.write,isRequired:!0}}})],r.prototype,"mode",null),s([o({type:Number,json:{write:!0}})],r.prototype,"offset",void 0),s([o({type:b,json:{type:String,read:f.read,write:f.write}})],r.prototype,"unit",null),r=a=s([d("esri.symbols.support.ElevationInfo")],r);const _=r;export{S as j,_ as q}; diff --git a/main/assets/ElevationInfo-yv2-9tj6-pjIBBQET.js b/main/assets/ElevationInfo-yv2-9tj6-pjIBBQET.js deleted file mode 100644 index 4ed199eaa..000000000 --- a/main/assets/ElevationInfo-yv2-9tj6-pjIBBQET.js +++ /dev/null @@ -1 +0,0 @@ -import{v as s,S as o,d2 as c,aK as y,a0 as E,ac as v,e as l,dL as I,i as d,a3 as w,dM as g}from"./main-BZaw9FpY.js";import{m as x}from"./lengthUtils-DKpMe5qR-CD-2dB4t.js";var u;let i=u=class extends l{constructor(e){super(e)}async collectRequiredFields(e,t){return I(e,t,this.expression)}clone(){return new u({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};s([o({type:String,json:{write:!0}})],i.prototype,"expression",void 0),s([o({type:String,json:{write:!0}})],i.prototype,"title",void 0),i=u=s([d("esri.symbols.support.FeatureExpressionInfo")],i);const p=i;function S(e){return 1/(x[e]||1)}function j(){const e=Object.keys(x);return w(e,"decimal-degrees"),e.sort(),e}const b=j();var a;const n=c()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),f=new y({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let r=a=class extends l{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e??(t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(e,t,h,m){t[h]=e.write({},m),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):e!=null||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new a({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&g(this.featureExpressionInfo,e.featureExpressionInfo)}};s([o({type:p,json:{write:!0}})],r.prototype,"featureExpressionInfo",void 0),s([E("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],r.prototype,"readFeatureExpressionInfo",null),s([v("featureExpressionInfo",{featureExpressionInfo:{type:p},"featureExpression.value":{type:[0]}})],r.prototype,"writeFeatureExpressionInfo",null),s([o({type:n.apiValues,nonNullable:!0,json:{type:n.jsonValues,read:n.read,write:{writer:n.write,isRequired:!0}}})],r.prototype,"mode",null),s([o({type:Number,json:{write:!0}})],r.prototype,"offset",void 0),s([o({type:b,json:{type:String,read:f.read,write:f.write}})],r.prototype,"unit",null),r=a=s([d("esri.symbols.support.ElevationInfo")],r);const _=r;export{S as j,_ as q}; diff --git a/main/assets/ElevationLayer-G6y-P-jo-CgtzrvPg.js b/main/assets/ElevationLayer-G6y-P-jo-CgtzrvPg.js deleted file mode 100644 index 3a5385f68..000000000 --- a/main/assets/ElevationLayer-G6y-P-jo-CgtzrvPg.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-DlXaowOR.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./TileKey-B_6qmYK--BtZdR-Xy.js"])))=>i.map(i=>d[i]); -import{U as f,o as g,W as w,f as c,X as V,_ as m,$ as u,v as o,S as l,a0 as y,i as b,a1 as T,a2 as D,a3 as S}from"./main-BZaw9FpY.js";import{m as L}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{M as x}from"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import{D as E}from"./Layer-ChoECxvZ-C4wLrCej.js";import{O as $}from"./ArcGISCachedService-C64Ko1TY-YBzt3RaL.js";import{a as k}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{E as I}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as M}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{Z as O}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{q as N}from"./workers-PiCjreoO-oGzLvkSt.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-UDulH8vT.js";import"./TilemapCache-CRRxws77-B5V8seF0.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";class A{constructor(e,t,i,a){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=a)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:t}=this;let i=1/0,a=-1/0,h=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=na?n:a,h=!1);h?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=a>-3e38?a:0)}}class C{constructor(e,t,i,a,h={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=N(e,{...h,schedule:a}).then(n=>{if(this._thread===void 0){this._thread=n,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const p of this._listeners)this._connectListener(p)}else n.close()}),this._promise.catch(n=>T.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${n}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),D(()=>{i.removed=!0,S(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const a=this._transferLists[e],h=a?a(t):[];return this._thread.invoke(e,t,{transferList:h,signal:i})}return this._promise?this._promise.then(()=>(u(i),this.invokeMethod(e,t,i))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}class v extends C{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(d.forEach((e,t)=>{e===this&&d.delete(t)}),this.destroy())}}const d=new Map;function P(r=null){let e=d.get(r);return e||(r!=null?(e=new v(t=>r.immediate.schedule(t)),d.set(r,e)):(e=new v,d.set(null,e))),++e.ref,e}let s=class extends $(k(I(M(L(E))))){constructor(...r){super(...r),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=P()}normalizeCtorArgs(r,e){return typeof r=="string"?{url:r,...e}:r}destroy(){this._lercDecoder=f(this._lercDecoder)}readCapabilities(r,e){const t=e.capabilities&&e.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(r,e){let t=e.currentVersion;return t||(t=9.3),t}load(r){const e=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{if(t.typeKeywords){for(let i=0;ithis._fetchImageService(e))),Promise.resolve(this)}fetchTile(r,e,t,i){const a=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,h={responseType:"array-buffer",signal:a},n={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(r,e,t,i)).then(()=>c(this.getTileUrl(r,e,t),h)).then(p=>this._lercDecoder.decode(p.data,n,a)).then(p=>new A(p))}getTileUrl(r,e,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,a=V({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${r}/${e}/${t}${a?"?"+a:""}`}async queryElevation(r,e){const{ElevationQuery:t}=await m(()=>import("./ElevationQuery-qAsmERYh-DlXaowOR.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);return u(e),new t().query(this,r,e)}async createElevationSampler(r,e){const{ElevationQuery:t}=await m(()=>import("./ElevationQuery-qAsmERYh-DlXaowOR.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);return u(e),new t().createSampler(this,r,e)}_fetchTileAvailability(r,e,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(r,e,t,i):Promise.resolve("unknown")}async _fetchImageService(r){if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:r},t=await c(this.parsedUrl.path,e);t.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[_]}};o([l({readOnly:!0})],s.prototype,"capabilities",void 0),o([y("service","capabilities",["capabilities"])],s.prototype,"readCapabilities",null),o([l({json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),o([l({readOnly:!0,type:x})],s.prototype,"heightModelInfo",void 0),o([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([l({type:["show","hide"]})],s.prototype,"listMode",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"minScale",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"maxScale",void 0),o([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),o([l({type:["ArcGISTiledElevationServiceLayer"]})],s.prototype,"operationalLayerType",void 0),o([l()],s.prototype,"sourceJSON",void 0),o([l({json:{read:!1},value:"elevation",readOnly:!0})],s.prototype,"type",void 0),o([l(O)],s.prototype,"url",void 0),o([l()],s.prototype,"version",void 0),o([y("version",["currentVersion"])],s.prototype,"readVersion",null),s=o([b("esri.layers.ElevationLayer")],s);const _=Symbol("default-fetch-tile");s.prototype.fetchTile[_]=!0;const ne=s;export{ne as default}; diff --git a/main/assets/ElevationLayer-G6y-P-jo-DB8amMzu.js b/main/assets/ElevationLayer-G6y-P-jo-DB8amMzu.js new file mode 100644 index 000000000..389c6fe0d --- /dev/null +++ b/main/assets/ElevationLayer-G6y-P-jo-DB8amMzu.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-B_vTBwak.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./TileKey-B_6qmYK--BtZdR-Xy.js"])))=>i.map(i=>d[i]); +import{U as f,o as g,W as w,f as c,X as V,_ as m,$ as u,v as o,S as l,a0 as y,i as b,a1 as T,a2 as D,a3 as S}from"./main-C7yV2j71.js";import{m as L}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{M as x}from"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import{D as E}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{O as $}from"./ArcGISCachedService-C64Ko1TY-C2ql8te1.js";import{a as k}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{E as I}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as M}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{Z as O}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{q as N}from"./workers-PiCjreoO-DqI62TYf.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-6JuHkhwl.js";import"./TilemapCache-CRRxws77-Cj_Hxxs_.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";class A{constructor(e,t,i,a){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=a)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:t}=this;let i=1/0,a=-1/0,h=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=na?n:a,h=!1);h?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=a>-3e38?a:0)}}class C{constructor(e,t,i,a,h={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=N(e,{...h,schedule:a}).then(n=>{if(this._thread===void 0){this._thread=n,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const p of this._listeners)this._connectListener(p)}else n.close()}),this._promise.catch(n=>T.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${n}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),D(()=>{i.removed=!0,S(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const a=this._transferLists[e],h=a?a(t):[];return this._thread.invoke(e,t,{transferList:h,signal:i})}return this._promise?this._promise.then(()=>(u(i),this.invokeMethod(e,t,i))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}class v extends C{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(d.forEach((e,t)=>{e===this&&d.delete(t)}),this.destroy())}}const d=new Map;function P(r=null){let e=d.get(r);return e||(r!=null?(e=new v(t=>r.immediate.schedule(t)),d.set(r,e)):(e=new v,d.set(null,e))),++e.ref,e}let s=class extends $(k(I(M(L(E))))){constructor(...r){super(...r),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=P()}normalizeCtorArgs(r,e){return typeof r=="string"?{url:r,...e}:r}destroy(){this._lercDecoder=f(this._lercDecoder)}readCapabilities(r,e){const t=e.capabilities&&e.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(r,e){let t=e.currentVersion;return t||(t=9.3),t}load(r){const e=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{if(t.typeKeywords){for(let i=0;ithis._fetchImageService(e))),Promise.resolve(this)}fetchTile(r,e,t,i){const a=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,h={responseType:"array-buffer",signal:a},n={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(r,e,t,i)).then(()=>c(this.getTileUrl(r,e,t),h)).then(p=>this._lercDecoder.decode(p.data,n,a)).then(p=>new A(p))}getTileUrl(r,e,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,a=V({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${r}/${e}/${t}${a?"?"+a:""}`}async queryElevation(r,e){const{ElevationQuery:t}=await m(()=>import("./ElevationQuery-qAsmERYh-B_vTBwak.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);return u(e),new t().query(this,r,e)}async createElevationSampler(r,e){const{ElevationQuery:t}=await m(()=>import("./ElevationQuery-qAsmERYh-B_vTBwak.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);return u(e),new t().createSampler(this,r,e)}_fetchTileAvailability(r,e,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(r,e,t,i):Promise.resolve("unknown")}async _fetchImageService(r){if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:r},t=await c(this.parsedUrl.path,e);t.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[_]}};o([l({readOnly:!0})],s.prototype,"capabilities",void 0),o([y("service","capabilities",["capabilities"])],s.prototype,"readCapabilities",null),o([l({json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),o([l({readOnly:!0,type:x})],s.prototype,"heightModelInfo",void 0),o([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([l({type:["show","hide"]})],s.prototype,"listMode",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"minScale",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"maxScale",void 0),o([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),o([l({type:["ArcGISTiledElevationServiceLayer"]})],s.prototype,"operationalLayerType",void 0),o([l()],s.prototype,"sourceJSON",void 0),o([l({json:{read:!1},value:"elevation",readOnly:!0})],s.prototype,"type",void 0),o([l(O)],s.prototype,"url",void 0),o([l()],s.prototype,"version",void 0),o([y("version",["currentVersion"])],s.prototype,"readVersion",null),s=o([b("esri.layers.ElevationLayer")],s);const _=Symbol("default-fetch-tile");s.prototype.fetchTile[_]=!0;const ne=s;export{ne as default}; diff --git a/main/assets/ElevationQuery-qAsmERYh-B_vTBwak.js b/main/assets/ElevationQuery-qAsmERYh-B_vTBwak.js new file mode 100644 index 000000000..30a5af509 --- /dev/null +++ b/main/assets/ElevationQuery-qAsmERYh-B_vTBwak.js @@ -0,0 +1 @@ +import{w as q,o as d,gH as Y,O as G,a_ as I,W as Z,bh as N,b6 as ee,G as D,m as te,ee as U,p as R,gI as W,a1 as ne,a2 as ie,gJ as se,b8 as ae}from"./main-C7yV2j71.js";import{N as z,K as M}from"./projection-BA9M1R7d-DXrPfsKU.js";import{e as B}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";const V=()=>ne.getLogger("esri.layers.support.ElevationSampler");class H{queryElevation(e){return oe(e.clone(),this)}on(){return ie()}projectIfRequired(e,t){return J(e,t)}}class le extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){super(),this.tile=e,this.noDataValue=n;const i=e.tile.extent;this.extent=W(i,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=i;const s=R(t.spatialReference),a=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:a,max:a}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return se(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const n=this.extent,i=`${n.xmin}, ${n.ymin}, ${n.xmax}, ${n.ymax}`;return V().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${i})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class O extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){let i;super(),typeof t=="number"?(this.noDataValue=t,i=null):(i=t,this.noDataValue=n),this.samplers=i?e.map(a=>new le(a,i,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:a,max:o}=s.demResolution;this.demResolution={min:a,max:o};for(let r=1;rt?t:l}class qe{async queryAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(c=>c.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const i=x.fromGeometry(t);let s=!1;n?.returnSampleInfo||(s=!0);const a={...g,...n,returnSampleInfo:!0},o=await this.query(e[e.length-1],i,a),r=await this._queryAllContinue(e,o,a);return r.geometry=r.geometry.export(),s&&delete r.sampleInfo,r}async query(e,t,n){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof x)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const i={...g,...n},s=new fe(e,t.spatialReference,i),a=i.signal;return await e.load({signal:a}),await me(s,t,a),await this._selectTiles(s,a),await T(s,a),ge(s),Te(s,a)}async createSampler(e,t,n){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const i={...g,...n};return this._createSampler(e,t,i)}async createSamplerAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(a=>a.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const i={...g,...n,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,i);return this._createSamplerAllContinue(e,t,s,i)}async _createSampler(e,t,n,i){const s=n.signal;await e.load({signal:s});const a=t.spatialReference,o=e.tileInfo.spatialReference;a.equals(o)||(await z([{source:a,dest:o}],{signal:s}),t=M(t,o));const r=new pe(e,t,n,i);return await this._selectTiles(r,s),await T(r,s),new O(r.elevationTiles,r.layer.tileInfo,r.options.noDataValue)}async _createSamplerAllContinue(e,t,n,i){if(e.pop(),!e.length)return n;const s=n.samplers.filter(c=>!c.tile.hasNoDataValues).map(c=>Y(c.extent)),a=await this._createSampler(e[e.length-1],t,i,s);if(a.samplers.length===0)return n;const o=n.samplers.concat(a.samplers),r=new O(o,i.noDataValue);return this._createSamplerAllContinue(e,t,r,i)}async _queryAllContinue(e,t,n){const i=e.pop(),s=t.geometry.coordinates,a=t.sampleInfo;G(a);const o=[],r=[];for(let f=0;f=0?h.source||(h.source=i):e.length&&(o.push(s[f]),r.push(f))}if(!e.length||o.length===0)return t;const c=t.geometry.clone(o),u=await this.query(e[e.length-1],c,n),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return r.forEach((f,h)=>{s[f].z=u.geometry.coordinates[h].z,a[f].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,n)}async _selectTiles(e,t){e.type==="geometry"&&de(e);const n=e.options.demResolution;if(typeof n=="number")xe(e,n);else if(n==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(n!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${n}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}async _selectTilesFinestContiguous(e,t){const{tileInfo:n,tilemapCache:i}=e.layer,s=X(n,i,e.options.minDemResolution);await this._selectTilesFinestContiguousAt(e,s,t)}async _selectTilesFinestContiguousAt(e,t,n){const i=e.layer;if(e.selectTilesAtLOD(t),t<0)return;const s=i.tilemapCache,a=e.getTilesToFetch();try{if(s&&!C(s))await I(Promise.all(a.map(o=>s.fetchAvailability(o.level,o.row,o.col,{signal:n}))),n);else if(await T(e,n),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){Z(o),await this._selectTilesFinestContiguousAt(e,t-1,n)}}async _selectTilesAuto(e,t){we(e),ve(e);const n=e.layer.tilemapCache;if(!n||C(n))return this._selectTilesAutoPrefetchUpsample(e,t);const i=e.getTilesToFetch(),s={},a=i.map(async o=>{const r=new B(null,0,0,0,N()),c=await ee(n.fetchAvailabilityUpsample(o.level,o.row,o.col,r,{signal:t}));c.ok!==!1?o.id!=null&&(s[o.id]=r):Z(c.error)});await I(Promise.all(a),t),e.remapTiles(s)}async _selectTilesAutoPrefetchUpsample(e,t){const n=e.layer.tileInfo;await T(e,t);let i=!1;e.forEachTileToFetch((s,a)=>{n.upsampleTile(s)?i=!0:a()}),i&&await this._selectTilesAutoPrefetchUpsample(e,t)}}class x{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new x;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(n=>n.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await z([{source:this.spatialReference,dest:e}],{signal:t});const n=new D({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),i=M(n,e);if(!i)return null;const s=this.coordinates.map((o,r)=>{const c=o.clone(),u=i.points[r];return c.x=u[0],c.y=u[1],c}),a=this.clone(s);return a.spatialReference=e,a}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(n=>n.clone()),t._exporter=(n,i)=>{const s=e.clone(n);return s.spatialReference=i,s};else switch(e.type){case"point":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?[new p(n.x,n.y,n.z,n.m)]:i?[new p(n.x,n.y,n.z)]:s?[new p(n.x,n.y,null,n.m)]:[new p(n.x,n.y)],t._exporter=(a,o)=>e.hasM?new q(a[0].x,a[0].y,a[0].z,a[0].m,o):new q(a[0].x,a[0].y,a[0].z,o);break}case"multipoint":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?n.points.map(a=>new p(a[0],a[1],a[2],a[3])):i?n.points.map(a=>new p(a[0],a[1],a[2])):s?n.points.map(a=>new p(a[0],a[1],null,a[2])):n.points.map(a=>new p(a[0],a[1])),t._exporter=(a,o)=>e.hasM?new D({points:a.map(r=>[r.x,r.y,r.z,r.m]),hasZ:!0,hasM:!0,spatialReference:o}):new D(a.map(r=>[r.x,r.y,r.z]),o);break}case"polyline":{const n=e,i=[],s=[],{hasZ:a,hasM:o}=e;let r=0;for(const c of n.paths)if(s.push([r,r+c.length]),r+=c.length,a&&o)for(const u of c)i.push(new p(u[0],u[1],u[2],u[3]));else if(a)for(const u of c)i.push(new p(u[0],u[1],u[2]));else if(o)for(const u of c)i.push(new p(u[0],u[1],null,u[2]));else for(const u of c)i.push(new p(u[0],u[1]));t.coordinates=i,t._exporter=(c,u)=>{const m=e.hasM?c.map(h=>[h.x,h.y,h.z??0,h.m??0]):c.map(h=>[h.x,h.y,h.z??0]),f=s.map(h=>m.slice(h[0],h[1]));return new te({paths:f,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class p{constructor(e,t,n=null,i=null,s=null,a=null){this.x=e,this.y=t,this.z=n,this.m=i,this.tile=s,this.elevationTile=a}clone(){return new p(this.x,this.y,this.z,this.m)}}class Q{constructor(e,t){this.layer=e,this.options=t}}class fe extends Q{constructor(e,t,n){super(e,n),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(i,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const n=t.tile?.id;t.tile=n?e[n]:null}}getTilesToFetch(){const e={},t=[];for(const n of this.geometry.coordinates){const i=n.tile;if(!i)continue;const s=n.tile?.id;n.elevationTile||!s||e[s]||(e[s]=i,t.push(i))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class pe extends Q{constructor(e,t,n,i){super(e,n),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=i}selectTilesAtLOD(e,t){const n=this._maximumLodForRequests(t),i=Math.min(n,e);i<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(i)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n);if(!e)return i.length-1;const s=this.extent;if(s==null)return-1;for(let a=i.length-1;a>=0;a--){const o=i[a],r=o.resolution*t.size[0],c=o.resolution*t.size[1];if(Math.ceil(s.width/r)*Math.ceil(s.height/c)<=e)return a}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const n=t.id&&e[t.id];n&&(this._fetchedCandidates.add(t),this.elevationTiles.push(n))}}remapTiles(e){this._candidateTiles=j(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const n=this._candidateTiles;this._candidateTiles=[],n.forEach(i=>{if(this._fetchedCandidates.has(i))return void(t&&t(i));let s=!1;e(i,()=>s=!0),s?t&&t(i):this._candidateTiles.push(i)}),this._candidateTiles=j(this._candidateTiles,t)}_selectCandidateTilesCoveringExtentAt(e){this._candidateTiles.length=0;const t=this.extent;if(t==null)return;const{tileInfo:n,tilemapCache:i}=this.layer,s=v(n,i)[e],a=n.tileAt(s.level,t.xmin,t.ymin),o=a.extent;if(o==null)return;const r=s.resolution*n.size[0],c=s.resolution*n.size[1],u=Math.ceil((t.xmax-o[0])/r),m=Math.ceil((t.ymax-o[1])/c);for(let f=0;fe.extent&&U(t,e.extent))}}function X(l,e,t=0){const n=v(l,e);let i=n.length-1;if(t>0){const s=t/R(l.spatialReference),a=n.findIndex(o=>o.resolution0&&(i=a-1)}return i}const g={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};async function me(l,e,t){let n;const i=l.layer.tileInfo.spatialReference;if(e instanceof x?n=await e.project(i,t):(await z([{source:e.spatialReference,dest:i}],{signal:t}),n=M(e,i)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${e.spatialReference.wkid}' on an elevation service in '${i.wkid}'`);l.geometry=x.fromGeometry(n)}function de(l){if(l.layer.fullExtent==null)return;const e=new K(null);e.sample=()=>l.options.noDataValue,l.outsideExtentTile=e;const t=l.layer.fullExtent;l.geometry.coordinates.forEach(n=>{const i=n.x,s=n.y;(it.xmax||st.ymax)&&(n.elevationTile=e)})}function ye(l,e){const{tileInfo:t,tilemapCache:n}=l.layer,i=e/R(t.spatialReference),s=v(t,n);let a=s[0],o=0;for(let r=1;rs.level>=n&&s.level<=i)}return t}async function T(l,e){const t=l.getTilesToFetch(),n={},i=l.options.cache,s=l.options.noDataValue,a=t.map(async o=>{if(o.id==null)return;const r=`${l.layer.uid}:${o.id}:${s}`,c=i!=null?i.get(r):null,u=c??await l.layer.fetchTile(o.level,o.row,o.col,{noDataValue:s,signal:e});i?.put(r,u),n[o.id]=new K(o,u)});await I(Promise.allSettled(a),e),l.populateElevationTiles(n)}function ve(l){const e=l.layer.tileInfo;let t=0;const n={},i=o=>{o.id!=null&&(o.id in n?n[o.id]++:(n[o.id]=1,t++))},s=o=>{if(o.id==null)return;const r=n[o.id];r===1?(delete n[o.id],t--):n[o.id]=r-1};l.forEachTileToFetch(i,s);let a=!0;for(;a&&(a=!1,l.forEachTileToFetch(o=>{t<=l.options.maximumAutoTileRequests||(s(o),e.upsampleTile(o)&&(a=!0),i(o))},s),a););}function ge(l){l.geometry.coordinates.forEach(e=>{const t=e.elevationTile;let n=l.options.noDataValue;if(t){const i=t.sample(e.x,e.y);i!=null?n=i:e.elevationTile=null}e.z=n})}function j(l,e){const t={},n=[];for(const s of l){const a=s.id;a&&!t[a]?(t[a]=s,n.push(s)):e&&e(s)}const i=n.sort((s,a)=>s.level-a.level);return i.filter((s,a)=>{for(let o=0;o{i.tile=null,i.elevationTile=null}),n}function Re(l){const e=l.layer.tileInfo,t=R(e.spatialReference);return l.geometry.coordinates.map(n=>{let i=-1;return n.elevationTile&&n.elevationTile!==l.outsideExtentTile&&(i=e.lodAt(n.elevationTile.tile.level).resolution*t),{demResolution:i}})}function C(l){return l?.tileInfo!=null}export{qe as ElevationQuery,x as GeometryDescriptor,X as getFinestLodIndex}; diff --git a/main/assets/ElevationQuery-qAsmERYh-DlXaowOR.js b/main/assets/ElevationQuery-qAsmERYh-DlXaowOR.js deleted file mode 100644 index 0ad82f815..000000000 --- a/main/assets/ElevationQuery-qAsmERYh-DlXaowOR.js +++ /dev/null @@ -1 +0,0 @@ -import{w as q,o as d,gH as Y,O as G,a_ as I,W as Z,bh as N,b6 as ee,G as D,m as te,ee as U,p as R,gI as W,a1 as ne,a2 as ie,gJ as se,b8 as ae}from"./main-BZaw9FpY.js";import{N as z,K as M}from"./projection-BA9M1R7d-DoNqITCd.js";import{e as B}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";const V=()=>ne.getLogger("esri.layers.support.ElevationSampler");class H{queryElevation(e){return oe(e.clone(),this)}on(){return ie()}projectIfRequired(e,t){return J(e,t)}}class le extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){super(),this.tile=e,this.noDataValue=n;const i=e.tile.extent;this.extent=W(i,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=i;const s=R(t.spatialReference),a=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:a,max:a}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return se(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const n=this.extent,i=`${n.xmin}, ${n.ymin}, ${n.xmax}, ${n.ymax}`;return V().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${i})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class O extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){let i;super(),typeof t=="number"?(this.noDataValue=t,i=null):(i=t,this.noDataValue=n),this.samplers=i?e.map(a=>new le(a,i,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:a,max:o}=s.demResolution;this.demResolution={min:a,max:o};for(let r=1;rt?t:l}class qe{async queryAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(c=>c.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const i=x.fromGeometry(t);let s=!1;n?.returnSampleInfo||(s=!0);const a={...g,...n,returnSampleInfo:!0},o=await this.query(e[e.length-1],i,a),r=await this._queryAllContinue(e,o,a);return r.geometry=r.geometry.export(),s&&delete r.sampleInfo,r}async query(e,t,n){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof x)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const i={...g,...n},s=new fe(e,t.spatialReference,i),a=i.signal;return await e.load({signal:a}),await me(s,t,a),await this._selectTiles(s,a),await T(s,a),ge(s),Te(s,a)}async createSampler(e,t,n){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const i={...g,...n};return this._createSampler(e,t,i)}async createSamplerAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(a=>a.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const i={...g,...n,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,i);return this._createSamplerAllContinue(e,t,s,i)}async _createSampler(e,t,n,i){const s=n.signal;await e.load({signal:s});const a=t.spatialReference,o=e.tileInfo.spatialReference;a.equals(o)||(await z([{source:a,dest:o}],{signal:s}),t=M(t,o));const r=new pe(e,t,n,i);return await this._selectTiles(r,s),await T(r,s),new O(r.elevationTiles,r.layer.tileInfo,r.options.noDataValue)}async _createSamplerAllContinue(e,t,n,i){if(e.pop(),!e.length)return n;const s=n.samplers.filter(c=>!c.tile.hasNoDataValues).map(c=>Y(c.extent)),a=await this._createSampler(e[e.length-1],t,i,s);if(a.samplers.length===0)return n;const o=n.samplers.concat(a.samplers),r=new O(o,i.noDataValue);return this._createSamplerAllContinue(e,t,r,i)}async _queryAllContinue(e,t,n){const i=e.pop(),s=t.geometry.coordinates,a=t.sampleInfo;G(a);const o=[],r=[];for(let f=0;f=0?h.source||(h.source=i):e.length&&(o.push(s[f]),r.push(f))}if(!e.length||o.length===0)return t;const c=t.geometry.clone(o),u=await this.query(e[e.length-1],c,n),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return r.forEach((f,h)=>{s[f].z=u.geometry.coordinates[h].z,a[f].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,n)}async _selectTiles(e,t){e.type==="geometry"&&de(e);const n=e.options.demResolution;if(typeof n=="number")xe(e,n);else if(n==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(n!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${n}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}async _selectTilesFinestContiguous(e,t){const{tileInfo:n,tilemapCache:i}=e.layer,s=X(n,i,e.options.minDemResolution);await this._selectTilesFinestContiguousAt(e,s,t)}async _selectTilesFinestContiguousAt(e,t,n){const i=e.layer;if(e.selectTilesAtLOD(t),t<0)return;const s=i.tilemapCache,a=e.getTilesToFetch();try{if(s&&!C(s))await I(Promise.all(a.map(o=>s.fetchAvailability(o.level,o.row,o.col,{signal:n}))),n);else if(await T(e,n),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){Z(o),await this._selectTilesFinestContiguousAt(e,t-1,n)}}async _selectTilesAuto(e,t){we(e),ve(e);const n=e.layer.tilemapCache;if(!n||C(n))return this._selectTilesAutoPrefetchUpsample(e,t);const i=e.getTilesToFetch(),s={},a=i.map(async o=>{const r=new B(null,0,0,0,N()),c=await ee(n.fetchAvailabilityUpsample(o.level,o.row,o.col,r,{signal:t}));c.ok!==!1?o.id!=null&&(s[o.id]=r):Z(c.error)});await I(Promise.all(a),t),e.remapTiles(s)}async _selectTilesAutoPrefetchUpsample(e,t){const n=e.layer.tileInfo;await T(e,t);let i=!1;e.forEachTileToFetch((s,a)=>{n.upsampleTile(s)?i=!0:a()}),i&&await this._selectTilesAutoPrefetchUpsample(e,t)}}class x{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new x;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(n=>n.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await z([{source:this.spatialReference,dest:e}],{signal:t});const n=new D({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),i=M(n,e);if(!i)return null;const s=this.coordinates.map((o,r)=>{const c=o.clone(),u=i.points[r];return c.x=u[0],c.y=u[1],c}),a=this.clone(s);return a.spatialReference=e,a}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(n=>n.clone()),t._exporter=(n,i)=>{const s=e.clone(n);return s.spatialReference=i,s};else switch(e.type){case"point":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?[new p(n.x,n.y,n.z,n.m)]:i?[new p(n.x,n.y,n.z)]:s?[new p(n.x,n.y,null,n.m)]:[new p(n.x,n.y)],t._exporter=(a,o)=>e.hasM?new q(a[0].x,a[0].y,a[0].z,a[0].m,o):new q(a[0].x,a[0].y,a[0].z,o);break}case"multipoint":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?n.points.map(a=>new p(a[0],a[1],a[2],a[3])):i?n.points.map(a=>new p(a[0],a[1],a[2])):s?n.points.map(a=>new p(a[0],a[1],null,a[2])):n.points.map(a=>new p(a[0],a[1])),t._exporter=(a,o)=>e.hasM?new D({points:a.map(r=>[r.x,r.y,r.z,r.m]),hasZ:!0,hasM:!0,spatialReference:o}):new D(a.map(r=>[r.x,r.y,r.z]),o);break}case"polyline":{const n=e,i=[],s=[],{hasZ:a,hasM:o}=e;let r=0;for(const c of n.paths)if(s.push([r,r+c.length]),r+=c.length,a&&o)for(const u of c)i.push(new p(u[0],u[1],u[2],u[3]));else if(a)for(const u of c)i.push(new p(u[0],u[1],u[2]));else if(o)for(const u of c)i.push(new p(u[0],u[1],null,u[2]));else for(const u of c)i.push(new p(u[0],u[1]));t.coordinates=i,t._exporter=(c,u)=>{const m=e.hasM?c.map(h=>[h.x,h.y,h.z??0,h.m??0]):c.map(h=>[h.x,h.y,h.z??0]),f=s.map(h=>m.slice(h[0],h[1]));return new te({paths:f,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class p{constructor(e,t,n=null,i=null,s=null,a=null){this.x=e,this.y=t,this.z=n,this.m=i,this.tile=s,this.elevationTile=a}clone(){return new p(this.x,this.y,this.z,this.m)}}class Q{constructor(e,t){this.layer=e,this.options=t}}class fe extends Q{constructor(e,t,n){super(e,n),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(i,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const n=t.tile?.id;t.tile=n?e[n]:null}}getTilesToFetch(){const e={},t=[];for(const n of this.geometry.coordinates){const i=n.tile;if(!i)continue;const s=n.tile?.id;n.elevationTile||!s||e[s]||(e[s]=i,t.push(i))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class pe extends Q{constructor(e,t,n,i){super(e,n),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=i}selectTilesAtLOD(e,t){const n=this._maximumLodForRequests(t),i=Math.min(n,e);i<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(i)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n);if(!e)return i.length-1;const s=this.extent;if(s==null)return-1;for(let a=i.length-1;a>=0;a--){const o=i[a],r=o.resolution*t.size[0],c=o.resolution*t.size[1];if(Math.ceil(s.width/r)*Math.ceil(s.height/c)<=e)return a}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const n=t.id&&e[t.id];n&&(this._fetchedCandidates.add(t),this.elevationTiles.push(n))}}remapTiles(e){this._candidateTiles=j(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const n=this._candidateTiles;this._candidateTiles=[],n.forEach(i=>{if(this._fetchedCandidates.has(i))return void(t&&t(i));let s=!1;e(i,()=>s=!0),s?t&&t(i):this._candidateTiles.push(i)}),this._candidateTiles=j(this._candidateTiles,t)}_selectCandidateTilesCoveringExtentAt(e){this._candidateTiles.length=0;const t=this.extent;if(t==null)return;const{tileInfo:n,tilemapCache:i}=this.layer,s=v(n,i)[e],a=n.tileAt(s.level,t.xmin,t.ymin),o=a.extent;if(o==null)return;const r=s.resolution*n.size[0],c=s.resolution*n.size[1],u=Math.ceil((t.xmax-o[0])/r),m=Math.ceil((t.ymax-o[1])/c);for(let f=0;fe.extent&&U(t,e.extent))}}function X(l,e,t=0){const n=v(l,e);let i=n.length-1;if(t>0){const s=t/R(l.spatialReference),a=n.findIndex(o=>o.resolution0&&(i=a-1)}return i}const g={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};async function me(l,e,t){let n;const i=l.layer.tileInfo.spatialReference;if(e instanceof x?n=await e.project(i,t):(await z([{source:e.spatialReference,dest:i}],{signal:t}),n=M(e,i)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${e.spatialReference.wkid}' on an elevation service in '${i.wkid}'`);l.geometry=x.fromGeometry(n)}function de(l){if(l.layer.fullExtent==null)return;const e=new K(null);e.sample=()=>l.options.noDataValue,l.outsideExtentTile=e;const t=l.layer.fullExtent;l.geometry.coordinates.forEach(n=>{const i=n.x,s=n.y;(it.xmax||st.ymax)&&(n.elevationTile=e)})}function ye(l,e){const{tileInfo:t,tilemapCache:n}=l.layer,i=e/R(t.spatialReference),s=v(t,n);let a=s[0],o=0;for(let r=1;rs.level>=n&&s.level<=i)}return t}async function T(l,e){const t=l.getTilesToFetch(),n={},i=l.options.cache,s=l.options.noDataValue,a=t.map(async o=>{if(o.id==null)return;const r=`${l.layer.uid}:${o.id}:${s}`,c=i!=null?i.get(r):null,u=c??await l.layer.fetchTile(o.level,o.row,o.col,{noDataValue:s,signal:e});i?.put(r,u),n[o.id]=new K(o,u)});await I(Promise.allSettled(a),e),l.populateElevationTiles(n)}function ve(l){const e=l.layer.tileInfo;let t=0;const n={},i=o=>{o.id!=null&&(o.id in n?n[o.id]++:(n[o.id]=1,t++))},s=o=>{if(o.id==null)return;const r=n[o.id];r===1?(delete n[o.id],t--):n[o.id]=r-1};l.forEachTileToFetch(i,s);let a=!0;for(;a&&(a=!1,l.forEachTileToFetch(o=>{t<=l.options.maximumAutoTileRequests||(s(o),e.upsampleTile(o)&&(a=!0),i(o))},s),a););}function ge(l){l.geometry.coordinates.forEach(e=>{const t=e.elevationTile;let n=l.options.noDataValue;if(t){const i=t.sample(e.x,e.y);i!=null?n=i:e.elevationTile=null}e.z=n})}function j(l,e){const t={},n=[];for(const s of l){const a=s.id;a&&!t[a]?(t[a]=s,n.push(s)):e&&e(s)}const i=n.sort((s,a)=>s.level-a.level);return i.filter((s,a)=>{for(let o=0;o{i.tile=null,i.elevationTile=null}),n}function Re(l){const e=l.layer.tileInfo,t=R(e.spatialReference);return l.geometry.coordinates.map(n=>{let i=-1;return n.elevationTile&&n.elevationTile!==l.outsideExtentTile&&(i=e.lodAt(n.elevationTile.tile.level).resolution*t),{demResolution:i}})}function C(l){return l?.tileInfo!=null}export{qe as ElevationQuery,x as GeometryDescriptor,X as getFinestLodIndex}; diff --git a/main/assets/ElevationSamplerWorker-BA9k6xuc-BNsbiikM.js b/main/assets/ElevationSamplerWorker-BA9k6xuc-BNsbiikM.js new file mode 100644 index 000000000..05a2603b3 --- /dev/null +++ b/main/assets/ElevationSamplerWorker-BA9k6xuc-BNsbiikM.js @@ -0,0 +1 @@ +import{K as f}from"./main-C7yV2j71.js";import{N as p}from"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import{y as u}from"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import{b as l}from"./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import"./vec3-BazNroeq-Cdhfm-VN.js";import"./BufferView-PQoE3GL7-M6q1od-Y.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-DGtcegeJ.js";class j{async createIndex(o,r){const n=new Array;if(!o.vertexAttributes?.position)return new p;const e=d(o),s=r!=null?await r.invoke("createIndexThread",e,{transferList:n}):this.createIndexThread(e).result;return m().fromJSON(s)}createIndexThread(o){const r=m();if(!o)return{result:r.toJSON()};const n=new Float64Array(o.position);return o.components?h(r,n,o.components.map(e=>new Uint32Array(e))):x(r,n)}}function x(t,o){const r=new Array(o.length/9);let n=0;for(let e=0;e!i.faces)?{position:s.buffer}:{position:s.buffer,components:t.components.map(i=>i.faces)}:null}function m(){return new p(9,f("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}function c(t,o,r,n){return{minX:Math.min(t[o],t[r],t[n]),maxX:Math.max(t[o],t[r],t[n]),minY:Math.min(t[o+1],t[r+1],t[n+1]),maxY:Math.max(t[o+1],t[r+1],t[n+1]),p0:[t[o],t[o+1],t[o+2]],p1:[t[r],t[r+1],t[r+2]],p2:[t[n],t[n+1],t[n+2]]}}export{j as default}; diff --git a/main/assets/ElevationSamplerWorker-BA9k6xuc-C2sW9B-K.js b/main/assets/ElevationSamplerWorker-BA9k6xuc-C2sW9B-K.js deleted file mode 100644 index cb8d7bb22..000000000 --- a/main/assets/ElevationSamplerWorker-BA9k6xuc-C2sW9B-K.js +++ /dev/null @@ -1 +0,0 @@ -import{K as f}from"./main-BZaw9FpY.js";import{N as p}from"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import{y as u}from"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import{b as l}from"./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js";import"./vec3-BazNroeq-CFXHYIOm.js";import"./BufferView-PQoE3GL7-DXIpDOUe.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-maVOs7I3.js";class j{async createIndex(o,r){const n=new Array;if(!o.vertexAttributes?.position)return new p;const e=d(o),s=r!=null?await r.invoke("createIndexThread",e,{transferList:n}):this.createIndexThread(e).result;return m().fromJSON(s)}createIndexThread(o){const r=m();if(!o)return{result:r.toJSON()};const n=new Float64Array(o.position);return o.components?h(r,n,o.components.map(e=>new Uint32Array(e))):x(r,n)}}function x(t,o){const r=new Array(o.length/9);let n=0;for(let e=0;e!i.faces)?{position:s.buffer}:{position:s.buffer,components:t.components.map(i=>i.faces)}:null}function m(){return new p(9,f("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}function c(t,o,r,n){return{minX:Math.min(t[o],t[r],t[n]),maxX:Math.max(t[o],t[r],t[n]),minY:Math.min(t[o+1],t[r+1],t[n+1]),maxY:Math.max(t[o+1],t[r+1],t[n+1]),p0:[t[o],t[o+1],t[o+2]],p1:[t[r],t[r+1],t[r+2]],p2:[t[n],t[n+1],t[n+2]]}}export{j as default}; diff --git a/main/assets/ExportImageParameters-DxyNGQ57-DAeGZbW_.js b/main/assets/ExportImageParameters-DxyNGQ57-DAeGZbW_.js deleted file mode 100644 index d07678d96..000000000 --- a/main/assets/ExportImageParameters-DxyNGQ57-DAeGZbW_.js +++ /dev/null @@ -1 +0,0 @@ -import{v as a,S as l,i as m,j as u,bV as c}from"./main-BZaw9FpY.js";import{b as p}from"./scaleUtils-DxsfQwK1-OKeSqBb9.js";import{e as y}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{s as b}from"./sublayerUtils-CyM0QC5B-BB_azrTi.js";const d={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let i=class extends u{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(r=>{const t=y(this.floors,r);return r.toExportImageJSON(t)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&b(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",r=>this.notifyChange(d[r.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(r=>r.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,r=this.visibleSublayers.filter(t=>t.definitionExpression!=null||e&&t.floorInfo!=null);return r.length?JSON.stringify(r.reduce((t,n)=>{const o=y(this.floors,n),s=c(o,n.definitionExpression);return s!=null&&(t[n.id]=s),t},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const r=this.layer.sublayers,t=this.scale,n=s=>{s.visible&&(t===0||p(t,s.minScale,s.maxScale))&&(s.sublayers?s.sublayers.forEach(n):e.unshift(s))};r&&r.forEach(n);const o=this._get("visibleSublayers");return!o||o.length!==e.length||o.some((s,h)=>e[h]!==s)?e:o}toJSON(){const e=this.layer;let r={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?r.dynamicLayers=this.dynamicLayers:r={...r,layers:this.layers,layerDefs:this.layerDefs},r}};a([l({readOnly:!0})],i.prototype,"dynamicLayers",null),a([l()],i.prototype,"floors",void 0),a([l({readOnly:!0})],i.prototype,"hasDynamicLayers",null),a([l()],i.prototype,"layer",null),a([l({readOnly:!0})],i.prototype,"layers",null),a([l({readOnly:!0})],i.prototype,"layerDefs",null),a([l({type:Number})],i.prototype,"scale",void 0),a([l({readOnly:!0})],i.prototype,"version",null),a([l({readOnly:!0})],i.prototype,"visibleSublayers",null),i=a([m("esri.layers.support.ExportImageParameters")],i);export{i as r}; diff --git a/main/assets/ExportImageParameters-DxyNGQ57-pIUsifIT.js b/main/assets/ExportImageParameters-DxyNGQ57-pIUsifIT.js new file mode 100644 index 000000000..d8ffbf00d --- /dev/null +++ b/main/assets/ExportImageParameters-DxyNGQ57-pIUsifIT.js @@ -0,0 +1 @@ +import{v as a,S as l,i as m,j as u,bV as c}from"./main-C7yV2j71.js";import{b as p}from"./scaleUtils-DxsfQwK1-B4OFXqEO.js";import{e as y}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{s as b}from"./sublayerUtils-CyM0QC5B-BQ17aSXL.js";const d={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let i=class extends u{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(r=>{const t=y(this.floors,r);return r.toExportImageJSON(t)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&b(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",r=>this.notifyChange(d[r.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(r=>r.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,r=this.visibleSublayers.filter(t=>t.definitionExpression!=null||e&&t.floorInfo!=null);return r.length?JSON.stringify(r.reduce((t,n)=>{const o=y(this.floors,n),s=c(o,n.definitionExpression);return s!=null&&(t[n.id]=s),t},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const r=this.layer.sublayers,t=this.scale,n=s=>{s.visible&&(t===0||p(t,s.minScale,s.maxScale))&&(s.sublayers?s.sublayers.forEach(n):e.unshift(s))};r&&r.forEach(n);const o=this._get("visibleSublayers");return!o||o.length!==e.length||o.some((s,h)=>e[h]!==s)?e:o}toJSON(){const e=this.layer;let r={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?r.dynamicLayers=this.dynamicLayers:r={...r,layers:this.layers,layerDefs:this.layerDefs},r}};a([l({readOnly:!0})],i.prototype,"dynamicLayers",null),a([l()],i.prototype,"floors",void 0),a([l({readOnly:!0})],i.prototype,"hasDynamicLayers",null),a([l()],i.prototype,"layer",null),a([l({readOnly:!0})],i.prototype,"layers",null),a([l({readOnly:!0})],i.prototype,"layerDefs",null),a([l({type:Number})],i.prototype,"scale",void 0),a([l({readOnly:!0})],i.prototype,"version",null),a([l({readOnly:!0})],i.prototype,"visibleSublayers",null),i=a([m("esri.layers.support.ExportImageParameters")],i);export{i as r}; diff --git a/main/assets/ExportStrategy-BNE7Gp0u-CVNDsUmZ.js b/main/assets/ExportStrategy-BNE7Gp0u-CVNDsUmZ.js deleted file mode 100644 index 753246cc1..000000000 --- a/main/assets/ExportStrategy-BNE7Gp0u-CVNDsUmZ.js +++ /dev/null @@ -1 +0,0 @@ -import{bh as E,v as d,S as l,i as N,j as H,bp as P,$ as v,aG as I,W as T,iF as $,gI as z}from"./main-BZaw9FpY.js";import{V as q}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{I as B}from"./Bitmap-CcqmzvfR-Cl_blWW9.js";import{Q as U}from"./Tile-D75RMC64-DprBAZDK.js";import{s as V}from"./TileKey-C5IL-JBr-0HJjsV9n.js";const j=Math.PI/180;function C(e){return e*j}function F(e,i){const r=C(i.rotation),t=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),[o,n]=i.size;return e[0]=Math.round(n*s+o*t),e[1]=Math.round(n*t+o*s),e}function G(e,i,r,t){const[s,o]=i,[n,a]=t,m=.5*r;return e[0]=s-m*n,e[1]=o-m*a,e[2]=s+m*n,e[3]=o+m*a,e}const u=E(),c=[0,0],w=new V(0,0,0,0),y={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let h=class extends H{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=y.hidpi,this.imageMaxWidth=y.imageMaxWidth,this.imageMaxHeight=y.imageMaxHeight,this.imageRotationSupported=y.imageRotationSupported,this.imageNormalizationSupported=y.imageNormalizationSupported,this.update=P(async(i,r)=>{if(v(r),!i.stationary||this.destroyed)return;const t=i.state,s=I(t.spatialReference),o=this.hidpi?i.pixelRatio:1,n=t.worldScreenWidth>0,a=n&&this.imageNormalizationSupported&&t.worldScreenWidthm||Math.floor(c[1])>f,S=s&&(t.extent.xmins.valid[1]),_=!this.imageNormalizationSupported&&S,x=!M&&!_,W=this.imageRotationSupported?t.rotation:0,b=this.container.children.slice();if(x){const p=a?t.paddedViewState.center:t.center;this._imagePromise=this._singleExport(t,c,p,t.resolution,W,o,r)}else{let p=Math.min(m,f);n&&(p=Math.min(t.worldScreenWidth,p),p=Math.round(t.worldScreenWidth/Math.ceil(t.worldScreenWidth/p))),this._imagePromise=this._tiledExport(t,p,o,r)}try{const p=await this._imagePromise??[];v(r);const R=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=p;for(const g of b)p.includes(g)||R.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of p)R.push(g.fadeIn());await Promise.all(R)}catch(p){this._imagePromise=null,T(p)}},5e3),this.updateExports=P(async i=>{const r=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;r.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=$(r).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,i,r,t,s,o){const n=await this.fetchSource(e,Math.floor(i*s),Math.floor(r*s),{rotation:t,pixelRatio:s,signal:o});v(o);const a=new B(null,!0);return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=s,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(n,o),v(o),a}async _singleExport(e,i,r,t,s,o,n){G(u,r,t,i);const a=z(u,e.spatialReference);return[await this._export(a,i[0],i[1],s,o,n)]}_tiledExport(e,i,r,t){const s=q.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new U(s),n=o.getTileCoverage(e);if(!n)return null;const a=[];return n.forEach((m,f,M,S)=>{w.set(m,f,M,0),o.getTileBounds(u,w);const _=z(u,e.spatialReference);a.push(this._export(_,i,i,0,r,t).then(x=>(S!==0&&(w.set(m,f,M,S),o.getTileBounds(u,w),x.x=u[0],x.y=u[3]),x)))}),Promise.all(a)}};d([l()],h.prototype,"_imagePromise",void 0),d([l()],h.prototype,"bitmaps",void 0),d([l()],h.prototype,"container",void 0),d([l()],h.prototype,"fetchSource",void 0),d([l()],h.prototype,"hidpi",void 0),d([l()],h.prototype,"imageMaxWidth",void 0),d([l()],h.prototype,"imageMaxHeight",void 0),d([l()],h.prototype,"imageRotationSupported",void 0),d([l()],h.prototype,"imageNormalizationSupported",void 0),d([l()],h.prototype,"requestUpdate",void 0),d([l()],h.prototype,"updating",null),h=d([N("esri.views.2d.layers.support.ExportStrategy")],h);const O=h;export{O as K}; diff --git a/main/assets/ExportStrategy-BNE7Gp0u-CdeT3qVb.js b/main/assets/ExportStrategy-BNE7Gp0u-CdeT3qVb.js new file mode 100644 index 000000000..84f6929cc --- /dev/null +++ b/main/assets/ExportStrategy-BNE7Gp0u-CdeT3qVb.js @@ -0,0 +1 @@ +import{bh as E,v as d,S as l,i as N,j as H,bp as P,$ as v,aG as I,W as T,iF as $,gI as z}from"./main-C7yV2j71.js";import{V as q}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{I as B}from"./Bitmap-CcqmzvfR-C92VuEM3.js";import{Q as U}from"./Tile-D75RMC64-CM0vKD9b.js";import{s as V}from"./TileKey-C5IL-JBr-COMthbrT.js";const j=Math.PI/180;function C(e){return e*j}function F(e,i){const r=C(i.rotation),t=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),[o,n]=i.size;return e[0]=Math.round(n*s+o*t),e[1]=Math.round(n*t+o*s),e}function G(e,i,r,t){const[s,o]=i,[n,a]=t,m=.5*r;return e[0]=s-m*n,e[1]=o-m*a,e[2]=s+m*n,e[3]=o+m*a,e}const u=E(),c=[0,0],w=new V(0,0,0,0),y={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let h=class extends H{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=y.hidpi,this.imageMaxWidth=y.imageMaxWidth,this.imageMaxHeight=y.imageMaxHeight,this.imageRotationSupported=y.imageRotationSupported,this.imageNormalizationSupported=y.imageNormalizationSupported,this.update=P(async(i,r)=>{if(v(r),!i.stationary||this.destroyed)return;const t=i.state,s=I(t.spatialReference),o=this.hidpi?i.pixelRatio:1,n=t.worldScreenWidth>0,a=n&&this.imageNormalizationSupported&&t.worldScreenWidthm||Math.floor(c[1])>f,S=s&&(t.extent.xmins.valid[1]),_=!this.imageNormalizationSupported&&S,x=!M&&!_,W=this.imageRotationSupported?t.rotation:0,b=this.container.children.slice();if(x){const p=a?t.paddedViewState.center:t.center;this._imagePromise=this._singleExport(t,c,p,t.resolution,W,o,r)}else{let p=Math.min(m,f);n&&(p=Math.min(t.worldScreenWidth,p),p=Math.round(t.worldScreenWidth/Math.ceil(t.worldScreenWidth/p))),this._imagePromise=this._tiledExport(t,p,o,r)}try{const p=await this._imagePromise??[];v(r);const R=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=p;for(const g of b)p.includes(g)||R.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of p)R.push(g.fadeIn());await Promise.all(R)}catch(p){this._imagePromise=null,T(p)}},5e3),this.updateExports=P(async i=>{const r=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;r.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=$(r).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,i,r,t,s,o){const n=await this.fetchSource(e,Math.floor(i*s),Math.floor(r*s),{rotation:t,pixelRatio:s,signal:o});v(o);const a=new B(null,!0);return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=s,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(n,o),v(o),a}async _singleExport(e,i,r,t,s,o,n){G(u,r,t,i);const a=z(u,e.spatialReference);return[await this._export(a,i[0],i[1],s,o,n)]}_tiledExport(e,i,r,t){const s=q.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new U(s),n=o.getTileCoverage(e);if(!n)return null;const a=[];return n.forEach((m,f,M,S)=>{w.set(m,f,M,0),o.getTileBounds(u,w);const _=z(u,e.spatialReference);a.push(this._export(_,i,i,0,r,t).then(x=>(S!==0&&(w.set(m,f,M,S),o.getTileBounds(u,w),x.x=u[0],x.y=u[3]),x)))}),Promise.all(a)}};d([l()],h.prototype,"_imagePromise",void 0),d([l()],h.prototype,"bitmaps",void 0),d([l()],h.prototype,"container",void 0),d([l()],h.prototype,"fetchSource",void 0),d([l()],h.prototype,"hidpi",void 0),d([l()],h.prototype,"imageMaxWidth",void 0),d([l()],h.prototype,"imageMaxHeight",void 0),d([l()],h.prototype,"imageRotationSupported",void 0),d([l()],h.prototype,"imageNormalizationSupported",void 0),d([l()],h.prototype,"requestUpdate",void 0),d([l()],h.prototype,"updating",null),h=d([N("esri.views.2d.layers.support.ExportStrategy")],h);const O=h;export{O as K}; diff --git a/main/assets/ExportWMSImageParameters-CMk80WSM-CQGcVQcn.js b/main/assets/ExportWMSImageParameters-CMk80WSM-CQGcVQcn.js new file mode 100644 index 000000000..ef737093e --- /dev/null +++ b/main/assets/ExportWMSImageParameters-CMk80WSM-CQGcVQcn.js @@ -0,0 +1 @@ +import{v as t,S as a,i as c,j as h}from"./main-C7yV2j71.js";const b={visible:"visibleSublayers"};let s=class extends h{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(b[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,o=e?.sublayers,l=[],i=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:m}=n;m&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(i):l.push(n))};return o?.forEach(i),l}toJSON(){const{layer:e,layers:r}=this,{imageFormat:o,imageTransparency:l,version:i}=e;return{format:o,request:"GetMap",service:"WMS",styles:"",transparent:l?"TRUE":"FALSE",version:i,layers:r}}};t([a()],s.prototype,"layer",null),t([a({readOnly:!0})],s.prototype,"layers",null),t([a({type:Number})],s.prototype,"scale",void 0),t([a({readOnly:!0})],s.prototype,"version",null),t([a({readOnly:!0})],s.prototype,"visibleSublayers",null),s=t([c("esri.layers.support.ExportWMSImageParameters")],s);export{s as r}; diff --git a/main/assets/ExportWMSImageParameters-CMk80WSM-CXXj-iAb.js b/main/assets/ExportWMSImageParameters-CMk80WSM-CXXj-iAb.js deleted file mode 100644 index 59bb4faa5..000000000 --- a/main/assets/ExportWMSImageParameters-CMk80WSM-CXXj-iAb.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as a,i as c,j as h}from"./main-BZaw9FpY.js";const b={visible:"visibleSublayers"};let s=class extends h{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(b[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,o=e?.sublayers,l=[],i=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:m}=n;m&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(i):l.push(n))};return o?.forEach(i),l}toJSON(){const{layer:e,layers:r}=this,{imageFormat:o,imageTransparency:l,version:i}=e;return{format:o,request:"GetMap",service:"WMS",styles:"",transparent:l?"TRUE":"FALSE",version:i,layers:r}}};t([a()],s.prototype,"layer",null),t([a({readOnly:!0})],s.prototype,"layers",null),t([a({type:Number})],s.prototype,"scale",void 0),t([a({readOnly:!0})],s.prototype,"version",null),t([a({readOnly:!0})],s.prototype,"visibleSublayers",null),s=t([c("esri.layers.support.ExportWMSImageParameters")],s);export{s as r}; diff --git a/main/assets/External-D_wl4XAw-Bzqlxz38.js b/main/assets/External-D_wl4XAw-Bzqlxz38.js new file mode 100644 index 000000000..9aac5245d --- /dev/null +++ b/main/assets/External-D_wl4XAw-Bzqlxz38.js @@ -0,0 +1 @@ +import{hq as g,$ as p,f as b}from"./main-C7yV2j71.js";import{c as N,o as v}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";class m{constructor(t,e,s){this.assetName=t,this.assetMimeType=e,this.parts=s}equals(t){return this===t||this.assetName===t.assetName&&this.assetMimeType===t.assetMimeType&&g(this.parts,t.parts,(e,s)=>e.equals(s))}isOnService(t){return this.parts.every(e=>e.isOnService(t))}makeHash(){let t="";for(const e of this.parts)t+=e.partHash;return t}async toBlob(t){const{parts:e}=this;if(e.length===1)return e[0].toBlob(t);const s=await Promise.all(e.map(a=>a.toBlob(t)));return p(t),new Blob(s)}}class H{constructor(t,e){this.partUrl=t,this.partHash=e}equals(t){return this===t||this.partUrl===t.partUrl&&this.partHash===t.partHash}isOnService(t){return this.partUrl.startsWith(`${t.path}/assets/`)}async toBlob(t){const{data:e}=await b(this.partUrl,{responseType:"blob"});return p(t),e}}function M(r){return A(r?.source)}function u(r){return Array.isArray(r)?r.every(t=>t instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,l=/\.(gltf|glb)/i;function A(r){return r?Array.isArray(r)?r.some(f):f(r):!1}function f(r){if(r instanceof File){const{type:t,name:e}=r;return c.test(t)||l.test(e)}return c.test(r.assetMimeType)||l.test(r.assetName)}function U(r,t){if(!r)return!1;const{source:e}=r;return B(e,t)}function O(r,t){if(r===t)return!0;const{source:e}=r,{source:s}=t;if(e===s)return!0;if(u(e)&&u(s)){if(e.length!==s.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...e].sort(a),y=[...s].sort(a);for(let n=0;n0&&e.every(s=>h(s,t))}return h(r,t)}function h(r,t){return r instanceof m&&r.isOnService(t)}function S(r,t){return r instanceof File?N(r,t):v(r.assetMimeType,r.assetName,t)}function d(r){return Array.isArray(r)?r:[r]}function w(r){return!!r.original}export{M as B,U as M,d as O,w as S,O as T,m as i,S as q,H as v}; diff --git a/main/assets/External-D_wl4XAw-MFWeclAP.js b/main/assets/External-D_wl4XAw-MFWeclAP.js deleted file mode 100644 index 72115dcfc..000000000 --- a/main/assets/External-D_wl4XAw-MFWeclAP.js +++ /dev/null @@ -1 +0,0 @@ -import{hq as g,$ as p,f as b}from"./main-BZaw9FpY.js";import{c as N,o as v}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";class m{constructor(t,e,s){this.assetName=t,this.assetMimeType=e,this.parts=s}equals(t){return this===t||this.assetName===t.assetName&&this.assetMimeType===t.assetMimeType&&g(this.parts,t.parts,(e,s)=>e.equals(s))}isOnService(t){return this.parts.every(e=>e.isOnService(t))}makeHash(){let t="";for(const e of this.parts)t+=e.partHash;return t}async toBlob(t){const{parts:e}=this;if(e.length===1)return e[0].toBlob(t);const s=await Promise.all(e.map(a=>a.toBlob(t)));return p(t),new Blob(s)}}class H{constructor(t,e){this.partUrl=t,this.partHash=e}equals(t){return this===t||this.partUrl===t.partUrl&&this.partHash===t.partHash}isOnService(t){return this.partUrl.startsWith(`${t.path}/assets/`)}async toBlob(t){const{data:e}=await b(this.partUrl,{responseType:"blob"});return p(t),e}}function M(r){return A(r?.source)}function u(r){return Array.isArray(r)?r.every(t=>t instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,l=/\.(gltf|glb)/i;function A(r){return r?Array.isArray(r)?r.some(f):f(r):!1}function f(r){if(r instanceof File){const{type:t,name:e}=r;return c.test(t)||l.test(e)}return c.test(r.assetMimeType)||l.test(r.assetName)}function U(r,t){if(!r)return!1;const{source:e}=r;return B(e,t)}function O(r,t){if(r===t)return!0;const{source:e}=r,{source:s}=t;if(e===s)return!0;if(u(e)&&u(s)){if(e.length!==s.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...e].sort(a),y=[...s].sort(a);for(let n=0;n0&&e.every(s=>h(s,t))}return h(r,t)}function h(r,t){return r instanceof m&&r.isOnService(t)}function S(r,t){return r instanceof File?N(r,t):v(r.assetMimeType,r.assetName,t)}function d(r){return Array.isArray(r)?r:[r]}function w(r){return!!r.original}export{M as B,U as M,d as O,w as S,O as T,m as i,S as q,H as v}; diff --git a/main/assets/FeatureCommandQueue-DzV-HBIG-R53oZrzO.js b/main/assets/FeatureCommandQueue-DzV-HBIG-R53oZrzO.js deleted file mode 100644 index 0aadb616f..000000000 --- a/main/assets/FeatureCommandQueue-DzV-HBIG-R53oZrzO.js +++ /dev/null @@ -1,3 +0,0 @@ -import{v as V,t as w,w as O,z as ne,L as S,A as Ce,C as fe,F as Y,I as Je,$ as Ut,M as B,N as me,S as n,T as mt,V as He,a0 as Ge,a1 as Gi,a2 as Be,a3 as Ne,a4 as A,a5 as qi,a6 as Mt,a7 as Q,a8 as Pt,a9 as ni,aa as $e,ab as At,ac as Ct,ad as Z,ae as Wi,_ as li,af as et,ag as ui,ah as ci,ai as ft,aj as pi,ak as Re,al as di,am as mi,an as fi,ao as Rt,ap as Ie,aq as E,ar as v,as as ie,at as L,au as K,av as ot,aw as F,D as G,ax as hi,ay as yi,az as xe,aA as vi,aB as bi,aC as ht,aD as Ht,aE as xi,aF as ji,aG as Ki,aH as Xi,aI as Zi,aJ as Yi,aK as Qi,aL as yt,aM as Ji,aN as Gt,aO as gi,aP as qt,aQ as ut,aR as es,aS as ts,aT as wi,aU as is,aV as Wt,aW as ss,aX as os,aY as as,aZ as rs,a as ns,a_ as j,a$ as jt,b0 as ls,b1 as us,b2 as at,b3 as It,b4 as Ot,b5 as Ft,b6 as Dt,b7 as Et,b8 as Lt,u as le,b9 as kt,ba as cs,bb as Oe,Y as ps,W as ds,X as ms,U as fs,x as hs,bc as ys,k as vs,bd as bs,be as xs}from"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import{w as gs}from"./utils-SPbpQbmm-DpAlEmQT.js";import{r as ws}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as l,hF as D,f4 as be,b9 as Ss,hT as Kt,K as Fe,ff as Vs,o as Ke,a1 as Si,hm as zs,aq as _s,p as Ts,eo as Xt}from"./main-BZaw9FpY.js";import{k as Ms,E as Ps}from"./mat3-CC4Foazl-BWjyqE2v.js";import{D as As,o as k,B as $,C as N,M as H,F as Cs,z as J,H as rt,E as ue,S as we,e as Zt,L as We}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{t as X,v as Yt,x as Rs,K as Qt,g as Is,o as Os}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as te,F as Ue,M as ge,U as ye,L as Fs,D as ct,R as vt,T as Vi,G as bt,H as zi,n as Jt,B as ei}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as ti}from"./BufferObject-BM_7mcDb-QLZylgsX.js";import{c as Ds}from"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import{n as Es}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{a as Ls,E as _i,G as Ti}from"./Program-DLVwTiPA-DUDrdGpa.js";import{H as tt,V as Mi}from"./Texture-BCt2hphT-D-X9O5uh.js";import{t as ks,c as Bs}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{o as ii}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{m as Ns}from"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import{n as Bt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{k as $s}from"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";class Us{get forceStaticPath(){return Fe("esri-cim-animations-enable-status")==="disabled"}get forceAnimatedPath(){return Fe("esri-cim-animations-enable-status")==="forced"}get freezeGlobalTime(){return Fe("esri-cim-animations-freeze-time")??!1}get spotlightAnimatedSymbols(){return!!Fe("esri-cim-animations-spotlight")}get forceGlobalTimeOrigin(){return Fe("esri-cim-animations-freeze-time")!==!1}}const Nt=new Us;function Hs(e){return e.locationsMap}const Da={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};let Gs=class{constructor(){this.drawPhase=ue.MAP|ue.HITTEST|ue.HIGHLIGHT|ue.DEBUG}startup(){}shutdown(e){}};const xt={[te.BYTE]:1,[te.UNSIGNED_BYTE]:1,[te.SHORT]:2,[te.UNSIGNED_SHORT]:2,[te.HALF_FLOAT]:2,[te.INT]:4,[te.UNSIGNED_INT]:4,[te.FLOAT]:4};let qs=class{constructor(e,t){this._boundPart=null,this.vertexBuffers=new Map;for(const[s,o]of Object.entries(t.vertex)){const a=ti.createVertex(e,Jt.STATIC_DRAW,o);this.vertexBuffers.set(s,a)}const i=new Map;for(const[s,o]of Object.entries(t.index??{})){const a=ti.createIndex(e,Jt.STATIC_DRAW,o);i.set(s,a)}this.groups=[];for(const s of t.groups){let o;if(s.index!=null){if(!t.index?.[s.index])throw new Error("No index data.");const{BYTES_PER_ELEMENT:d}=t.index[s.index];d===2?o=te.UNSIGNED_SHORT:d===4&&(o=te.UNSIGNED_INT)}const a=s.index!=null?i.get(s.index):null,r=new Map,u=new Map;for(const d of s.attributes){const{name:p,count:m,type:f,offset:x,normalized:h,divisor:y,stride:b,vertex:g,location:P}=d;let I=u.get(g);I||(I=[],u.set(g,I));const C=new Es(p,m,f,x,b,h,y);I.push(C),r.set(p,P)}const c=new Ds(e,r,u,this.vertexBuffers,a);this.groups.push({...s,vertexArray:c,locations:r,layout:u,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:i}=this.parts[this._boundPart],{vertexArray:s}=this.groups[i];e.bindVAO(s)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:i}=this.parts[this._boundPart],{group:s}=this.parts[this._boundPart],{indexing:o,primitive:a}=this.groups[s];o?e.drawElements(a,i,o,t*xt[o]):e.drawArrays(a,t,i)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}};const Ws={position:{type:te.SHORT,count:2}};let js=class gt extends qs{static create(t,i,s){const o=[];let{stride:a}=i;if(a==null){a=0;for(const[m,{count:f,type:x,offset:h}]of Object.entries(i.layout)){if(h!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");a+=f*xt[x]}}let r=0;for(const[m,{count:f,offset:x,type:h,normalized:y}]of Object.entries(i.layout)){x!=null&&(r=x);const b=s.get(m);if(b==null)throw new Error("Locations must be specified at mesh initialization.");const g={name:m,location:b,vertex:"vertexData",count:f,type:h,offset:r,stride:a,divisor:0,normalized:y!=null&&y};o.push(g),r+=f*xt[h]}const u={attributes:o,primitive:i.primitive};i.index!=null&&(u.index="indexData");let{count:c}=i;if(c==null&&(c=i.index?i.index.length:i.vertex.byteLength/a,Math.floor(c)!==c))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${a}.`);const d={start:0,count:c,group:0,primitive:i.primitive},p={vertex:{vertexData:i.vertex},parts:[d],groups:[u]};return i.index!=null&&(p.index={indexData:i.index}),new gt(t,p,i.layout)}static fromVertexStream(t,i){return gt.create(t,{primitive:Vi.TRIANGLE_STRIP,vertex:new Uint16Array(i),layout:Ws},new Map([["position",0]]))}constructor(t,i,s){super(t,i),this._spec=s}bind(t,i=0){super.bind(t,i)}},he=class extends fe{};l([V(n)],he.prototype,"globalTime",void 0),l([V(v)],he.prototype,"animationTextureSize",void 0),l([V(j)],he.prototype,"animationTexture",void 0),l([V(B)],he.prototype,"toScreen",void 0),l([V(B)],he.prototype,"toNdc",void 0),l([V(n)],he.prototype,"mapRotation",void 0),l([V(n)],he.prototype,"pixelRatio",void 0);let nt=class extends fe{getVVRotationMat4(e){return Y(Ut(e),Je.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new Je(s,i,0,0,i.multiply(new n(-1)),s,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return Y(Ut(e),B.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new B(s,i,0,i.multiply(new n(-1)),s,0,0,0,1)})}getNormalizedAngle(e){const t=me(this.rotationType,new n(mt.Arithmatic));return Y(t,new n(90).subtract(e),e)}};l([V(n)],nt.prototype,"rotationType",void 0);class wt extends He{}l([w(3,S)],wt.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),l([w(4,v)],wt.prototype,"zoomRange",void 0);class Ks extends Oe{}class re extends Ge{_getScreenPosition(t){const{pos:i,translation:s,rotation:o,scale:a,offset:r,id:u,vvScale:c}=t,d=Gi(this,u).multiply(Math.PI/180),p=s.x.multiply(4/3),m=s.y.multiply(-1).multiply(4/3),f=Be(o.subtract(d)),x=Ne(o.subtract(d)),h=new n(0),y=new n(1),{pixelRatio:b}=this.animationInfo,g=new B(y,h,h,h,y,h,p.multiply(b),m.multiply(b),y),P=new B(x,f.multiply(-1),h,f,x,h,0,0,y),I=a.multiply(c).multiply(b).multiply(4/3),C=P.multiply(I),_=this.animationInfo.toScreen.multiply(new A(i,1)),T=g.multiply(_).xy,M=C.multiply(new A(r,0)).xy;return T.add(M)}_clip(t,i){let s=super.clip(t,i);const o=qi(this._getLocalTimeOrigin(t),new n(0));return Nt.forceGlobalTimeOrigin||(s=s.add(Mt([o,()=>new n(2)],[!0,()=>new n(0)]))),s}_getLocalTimeOrigin(t){return this.storage.getLocalTimeOrigin(t)}_toNdc(t){return this.animationInfo.toNdc.multiply(new A(t,1)).xy}_getEvalParams(t,i){const{globalTime:s,animationTextureSize:o,animationTexture:a}=this.animationInfo;return{globalTime:s,localTimeOrigin:this._getLocalTimeOrigin(t.id),animationTextureSize:o,animationTexture:a,pixelDimensions:i}}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a),u=i.outlineSize.multiply(.5),c=At(o).subtract(u),d=$e(new n(.5).subtract(c),new n(0),new n(1)),p=i.outlineColor.multiply(d);return new n(1).subtract(p.a).multiply(r).add(p)}}function Ve(e,t,i){const s=e.add(new v(t,0)),o=Q(i.animationTexture,s.add(.5).divide(i.animationTextureSize)).xy;return e=e.add(o),ls({animationPointer:e,...i},S,null,a=>{const{out:r}=a;if(!r)throw new Error("out is null");return us({...a,out:r})})}l([V(at)],re.prototype,"mosaicInfo",void 0),l([V(he)],re.prototype,"animationInfo",void 0),l([O(It)],re.prototype,"visualVariableColor",void 0),l([O(Ot)],re.prototype,"visualVariableOpacity",void 0),l([O(Ft)],re.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],re.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],re.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],re.prototype,"visualVariableSizeUnitValue",void 0),l([O(nt)],re.prototype,"visualVariableRotation",void 0);var ve;(function(e){e[e.transform=0]="transform",e[e.fromColor=1]="fromColor",e[e.toColor=2]="toColor",e[e.colorMix=3]="colorMix",e[e.toOpacity=4]="toOpacity",e[e.opacityMix=5]="opacityMix"})(ve||(ve={}));let De=class extends wt{};l([w(5,v)],De.prototype,"offset",void 0),l([w(6,v)],De.prototype,"uv",void 0),l([w(7,S)],De.prototype,"sizing",void 0),l([w(8,n)],De.prototype,"angle",void 0);class Ee extends Ct{}l([w(12,v)],Ee.prototype,"offsetNextVertex1",void 0),l([w(13,v)],Ee.prototype,"offsetNextVertex2",void 0),l([w(14,v)],Ee.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],Ee.prototype,"textureUVNextVertex2",void 0);class Xs extends Ks{}function ce(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}let St=class extends re{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}_vertexPreamble(e){const{id:t,pos:i,offset:s,animationPointerAndBaseSizeAndReferenceSize:o,uv:a,sizing:r,angle:u}=e,c=o.xy,d=o.z,p=o.w,m=r.xy,f=r.z,x=Z(e.bitset,le.bitset.isStroke),h=r.w,y=Z(e.bitset,le.bitset.scaleSymbolsProportionally),b=this._getEvalParams(e,m),g=Ve(c,ve.transform,b),P=Mt([me(Z(e.bitset,le.bitset.isMapAligned),new n(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new n(0)]),I=new Wi(Ne(P),Be(P.multiply(-1)),Be(P),Ne(P)).multiply(g.xy),C=g.z.subtract(P).subtract(u.multiply(li)),_=g.w,T=Z(e.bitset,le.bitset.isSDF),M=et(this,t,new n(p)).divide(new n(p));return{baseSize:d,animationPointer:c,strokeWidth:f,isOutline:x,unscaledDistanceToPx:h,scaleSymbolsProportionally:y,isSDF:T,position:this._getScreenPosition({id:t,pos:i,offset:s,referenceSize:p,translation:I,rotation:C,scale:_,vvScale:M}),uv:a,evalParams:b,vvScale:M,scale:_}}vertex(e,t){const{position:i,animationPointer:s,evalParams:o,isOutline:a,unscaledDistanceToPx:r,vvScale:u,uv:c,strokeWidth:d,scaleSymbolsProportionally:p,scale:m,isSDF:f,baseSize:x}=this._vertexPreamble(e),h=this._toNdc(i);let y=Ve(s,ve.fromColor,o);y=new S(y.rgb.multiply(y.a),y.a);let b=Ve(s,ve.toColor,o);b=new S(b.rgb.multiply(b.a),b.a);let g=Ve(s,ve.colorMix,o);g=new S(g.rgb.multiply(g.a),g.a);const P=Ve(s,ve.toOpacity,o).a,I=Ve(s,ve.opacityMix,o).a,C=ui(this,e.id,y,ci(pi(e.bitset,le.bitset.colorLocked),new ft(a))),_=Re(C,b,g),T=di(this,e.id),M=Re(T,P,I),z=_.multiply(M),R=this.clip(e.id,e.zoomRange),Se=r.multiply(u);return{glPosition:new S(h,R,1),uv:c.divide(this.mosaicInfo.size),color:z.multiply(new n(1).subtract(a)),outlineColor:z.multiply(a),distanceToPx:Se,strokeWidth:d.multiply(Re(new n(1),m,p)),isOutline:a,isSDF:f,...this.maybeRunHittest(e,t,{pos:e.pos,size:x,sizeCorrection:new n(1),isMapAligned:new n(1),vvRotationMat3:new B(1,0,0,0,1,0,0,0,1),placementMat3:new B(1,0,0,0,1,0,0,0,1),outlineSize:new n(1),distanceToPx:Se,isSDF:f})}}fragment(e){let t=this._getColor(e.uv,{color:e.color,distanceToPx:e.distanceToPx,isSDF:e.isSDF,outlineColor:e.outlineColor,outlineSize:e.strokeWidth});return Nt.spotlightAnimatedSymbols&&(t=t.add(new S(0,.3,0,.3))),this.getFragmentOutput(t,e)}hittest(e,t,i){return Y(mi(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,i),this._hittestMarker(e,t,i))}_hittestSmallMarker(e,t,i){const{position:s,distance:o,smallSymbolDistance:a}=this.hittestRequest,r=o.subtract(a),{viewMat3:u,tileMat3:c}=this.view,d=u.multiply(c).multiply(new A(i.pos,1)).xy,p=i.size.multiply(.5);return fi(d,s).subtract(p).add(r)}_hittestMarker(e,t,i){const s=this._vertexPreamble({...e}).position,o=this._vertexPreamble({...e,offset:t.offsetNextVertex1,uv:t.textureUVNextVertex1}).position,a=this._vertexPreamble({...e,offset:t.offsetNextVertex2,uv:t.textureUVNextVertex2}).position,r=this.hittestRequest.position,u=this.hittestRequest.distance,c=Rt(r,s,o,a);return Y(Ie(c,u),c,this._hittestSamples(s,o,a,e,t,i))}_hittestSamples(e,t,i,s,o,a){const{outlineSize:r,isSDF:u,distanceToPx:c}=a,d=this.hittestRequest.position,p=this.hittestRequest.distance,m=E(d.add(new v(ie(p),ie(p))),e,t,i),f=E(d.add(new v(0,ie(p))),e,t,i),x=E(d.add(new v(p,ie(p))),e,t,i),h=E(d.add(new v(ie(p),0)),e,t,i),y=E(d,e,t,i),b=E(d.add(new v(p,0)),e,t,i),g=E(d.add(new v(ie(p),p)),e,t,i),P=E(d.add(new v(0,p)),e,t,i),I=E(d.add(new v(p,p)),e,t,i),C=s.uv.divide(this.mosaicInfo.size),_=o.textureUVNextVertex1.divide(this.mosaicInfo.size),T=o.textureUVNextVertex2.divide(this.mosaicInfo.size),M={color:new S(1,1,1,1),outlineSize:r,outlineColor:new S(1,1,1,1),isSDF:u,distanceToPx:c};let z=new n(0);return z=z.add(L(m).multiply(this._getColor(ce(m,C,_,T),M).a)),z=z.add(L(f).multiply(this._getColor(ce(f,C,_,T),M).a)),z=z.add(L(x).multiply(this._getColor(ce(x,C,_,T),M).a)),z=z.add(L(h).multiply(this._getColor(ce(h,C,_,T),M).a)),z=z.add(L(y).multiply(this._getColor(ce(y,C,_,T),M).a)),z=z.add(L(b).multiply(this._getColor(ce(b,C,_,T),M).a)),z=z.add(L(g).multiply(this._getColor(ce(g,C,_,T),M).a)),z=z.add(L(P).multiply(this._getColor(ce(P,C,_,T),M).a)),z=z.add(L(I).multiply(this._getColor(ce(I,C,_,T),M).a)),K(z,new n(.05)).multiply(ot(this.hittestRequest))}};l([D(0,F(De)),D(1,F(Ee))],St.prototype,"vertex",null),l([D(0,F(Xs))],St.prototype,"fragment",null);let q=class extends Gs{constructor(){super(...arguments),this.symbologyPlane=we.FILL,this._input=null}},Zs=class extends q{render(e,t){const{context:i,painter:s}=e,{target:o}=t,{freezeGlobalTime:a}=Nt,r=0,u=s.textureManager.animationStore.getTexture(i,r),c=[2/e.state.size[0],0,0,0,-2/e.state.size[1],0,-1,1,1],d=Array.from(Ms(Zt(),c)),p=Array.from(Ps(Zt(),d,o.transforms.displayViewScreenMat3)),m=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,m.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0),animationInfo:{globalTime:a===!1?e.time/1e3:a,animationTextureSize:[u.descriptor.width,u.descriptor.height],animationTexture:{unit:6,texture:u},toScreen:p,toNdc:c,mapRotation:e.state.rotation,pixelRatio:e.state.pixelRatio}},defines:{...N(e)},optionalAttributes:{zoomRange:!0},useComputeBuffer:!0}),s.setPipelineState({...H(e)}),s.submitDraw(e,t),a===!1&&o.requestRender()}},Ys=class extends Zs{constructor(){super(...arguments),this.type=G.AnimatedMarker,this.shaders={geometry:new St}}},Pi=class extends hi{};l([w(0,v)],Pi.prototype,"pos",void 0);let Qs=class extends Oe{};class Ai extends fe{}l([V(n)],Ai.prototype,"dotSize",void 0);let Xe=class extends fe{};l([V(j)],Xe.prototype,"locations",void 0),l([V(n)],Xe.prototype,"pixelRatio",void 0),l([V(n)],Xe.prototype,"tileZoomFactor",void 0);const Js=1e-6;class _e extends yi{vertex(t){const i=new B(1,0,0,0,-1,0,0,1,1).multiply(new A(t.pos.xy.divide(X),1)),s=Q(this.draw.locations,i.xy),o=xe(this.instance.dotSize.divide(2),new n(1));let a=new n(0);a=a.add(K(s.a,new n(Js)).multiply(2));let r=o.add(this.instance.dotSize);const u=this.view.displayViewScreenMat3.multiply(new A(t.pos.add(.5),1)),c=new S(u.xy,a,1),d=this.instance.dotSize.divide(r),p=new n(-1).divide(o.divide(r));return r=r.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:c,glPointSize:r,color:s,ratio:d,invEdgeRatio:p}}fragment(t){const i=vi(t.glPointCoord.subtract(.5)).multiply(2),s=bi(new n(0),new n(1),t.invEdgeRatio.multiply(i.subtract(t.ratio)).add(1)),o=new kt;return o.glFragColor=t.color.multiply(s),o}}l([V(Ai)],_e.prototype,"instance",void 0),l([V(Xe)],_e.prototype,"draw",void 0),l([V(cs)],_e.prototype,"view",void 0),l([D(0,F(Pi))],_e.prototype,"vertex",null),l([D(0,F(Qs))],_e.prototype,"fragment",null);class Ci extends He{}l([w(3,n)],Ci.prototype,"inverseArea",void 0);let Ze=class extends fe{};l([V(ne.ofType(S,2))],Ze.prototype,"isActive",void 0),l([V(ne.ofType(S,8))],Ze.prototype,"colors",void 0),l([V(n)],Ze.prototype,"dotValue",void 0);let Te=class extends fe{};l([V(j)],Te.prototype,"dotTexture0",void 0),l([V(j)],Te.prototype,"dotTexture1",void 0),l([V(n)],Te.prototype,"tileZoomFactor",void 0),l([V(n)],Te.prototype,"pixelRatio",void 0),l([V(n)],Te.prototype,"tileDotsOverArea",void 0);let Me=class extends Ge{_dotThreshold(e,t,i){return e.divide(t).divide(i)}vertex(e){const t=new B(2/X,0,0,0,-2/X,0,-1,1,1).multiply(new A(e.pos,1)),i=this.clip(e.id),s=new S(t.xy,i,1),o=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),a=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),r=this.draw.tileZoomFactor.multiply(X).divide(this.draw.pixelRatio),u=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),c=this._dotThreshold(a,this.instance.dotValue,this.draw.tileDotsOverArea),d=e.pos.add(.5).divide(r);return{glPosition:s,color:new S(0,0,0,0),textureCoords:d,thresholds0:u,thresholds1:c}}fragment(e){const t=new kt,i=Q(this.draw.dotTexture0,e.textureCoords),s=Q(this.draw.dotTexture1,e.textureCoords),o=e.thresholds0.subtract(i),a=e.thresholds1.subtract(s);let r;const u=Je.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),c=Je.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const d=K(new n(0),o),p=K(new n(0),a),m=ht(d,o).add(ht(p,a)),f=K(m,new n(0)),x=new n(1).subtract(f),h=m.add(f),y=o.multiply(d).divide(h),b=a.multiply(p).divide(h),g=u.multiply(y).add(c.multiply(b));r=x.multiply(g)}else{const d=xe(Ht(o),Ht(a)),p=K(d,new n(0)),m=new n(1).subtract(p),f=K(d,o),x=K(d,a),h=u.multiply(f).add(c.multiply(x));r=m.multiply(h)}return t.glFragColor=r,t}hittest(e){return ot(this.hittestRequest)}};l([Ce],Me.prototype,"blending",void 0),l([V(Ze)],Me.prototype,"instance",void 0),l([V(Te)],Me.prototype,"draw",void 0),l([D(0,F(Ci))],Me.prototype,"vertex",null),l([D(0,F(Oe))],Me.prototype,"fragment",null);const eo={pos:{count:2,type:te.UNSIGNED_SHORT}};let to=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=X,i=X,s=new tt(t,i);s.samplingMode=ge.NEAREST,s.wrapMode=bt.CLAMP_TO_EDGE;const o=new Ls(e,new _i(zi.DEPTH_STENCIL,t,i));this._dotFBO=new Ti(e,s,o)}return this._dotFBO}getDotDensityMesh(e,t){if(this._dotMesh==null){const i=X,s=i*i,o=2,a=new Int16Array(s*o);for(let r=0;rSi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let po=class{destroy(){this._accumulateFramebuffer=Kt(this._accumulateFramebuffer),this._resolveGradientTexture=Kt(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=uo(e,co());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==Ue.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,i){if(this._accumulateFramebuffer==null){const{dataType:s,samplingMode:o,pixelFormat:a,internalFormat:r}=this.loadQualityProfile(e),u=new tt(t,i);u.pixelFormat=a,u.internalFormat=r,u.dataType=s,u.samplingMode=o,u.wrapMode=bt.CLAMP_TO_EDGE;const c=new _i(zi.DEPTH_STENCIL,t,i);this._accumulateFramebuffer=new Ti(e,u,c)}else{const{width:s,height:o}=this._accumulateFramebuffer;s===t&&o===i||this._accumulateFramebuffer.resize(t,i)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,i){if(this._resolveGradientTexture==null){const s=new tt;s.wrapMode=bt.CLAMP_TO_EDGE,this._resolveGradientTexture=new Mi(e,s)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(i.length/4,1),this._resolveGradientTexture.setData(i),this._prevGradientHash=t);return this._resolveGradientTexture}};function Ri(e){return e?.25:1}let Ii=class extends He{};l([w(5,v)],Ii.prototype,"offset",void 0);let mo=class extends Oe{},zt=class extends fe{};l([V(n)],zt.prototype,"radius",void 0),l([V(n)],zt.prototype,"isFieldActive",void 0);class Le extends Ge{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(t){const{radius:i,isFieldActive:s}=this.kernelControls,o=t.offset,a=s.multiply(this.storage.getVVData(t.id).x).add(new n(1).subtract(s)),r=this.view.displayViewScreenMat3.multiply(new A(t.pos,1)).add(this.view.displayViewMat3.multiply(new A(o,0)).multiply(i)),u=this.clip(t.id);return{glPosition:new S(r.xy,u,1),offset:o,fieldValue:a,color:new S(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:i,fieldValue:s}=t,o=vi(i),a=K(o,new n(1)),r=new n(1).subtract(o.multiply(o)),u=r.multiply(r),c=a.multiply(u).multiply(s).multiply(new n(Ri(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new S(c),t)}hittest(t){const{viewMat3:i,tileMat3:s}=this.view,o=i.multiply(s).multiply(new A(t.pos,1));return Qi(o.xy,this.kernelControls.radius,this.hittestRequest.position)}}l([Ce],Le.prototype,"usesHalfFloatPrecision",void 0),l([V(zt)],Le.prototype,"kernelControls",void 0),l([D(0,F(Ii))],Le.prototype,"vertex",null),l([D(0,F(mo))],Le.prototype,"fragment",null);let Oi=class extends hi{};l([w(0,v)],Oi.prototype,"position",void 0);let fo=class extends bs{},Ye=class extends fe{};l([V(j)],Ye.prototype,"texture",void 0),l([V(v)],Ye.prototype,"minAndInvRange",void 0),l([V(n)],Ye.prototype,"normalization",void 0);let Fi=class extends fe{};l([V(j)],Fi.prototype,"texture",void 0);let Pe=class extends yi{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new S(e.position.multiply(2).subtract(1),1,1),uv:e.position}}fragment(e){const{accumulatedDensity:t,gradient:i}=this;let s=Q(t.texture,e.uv).r.divide(new n(Ri(this.usesHalfFloatPrecision)));s=s.multiply(t.normalization),s=s.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const o=Q(i.texture,new v(s,.5)),a=new kt;return a.glFragColor=new S(o.rgb.multiply(o.a),o.a),a}};l([Ce],Pe.prototype,"usesHalfFloatPrecision",void 0),l([V(Ye)],Pe.prototype,"accumulatedDensity",void 0),l([V(Fi)],Pe.prototype,"gradient",void 0),l([D(0,F(Oi))],Pe.prototype,"vertex",null),l([D(0,F(fo))],Pe.prototype,"fragment",null);let ho=class extends q{constructor(){super(...arguments),this.type=G.Heatmap,this.drawPhase=ue.MAP|ue.HITTEST|ue.DEBUG,this.shaders={accumulate:new Le,resolve:new Pe},this._isBound=!1,this._resources=new Map}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:i,painter:s,state:o}=e,a=t.instance.getInput(),{isFieldActive:r}=a.uniforms,u=this._getOrCreateResourcesRecord(i),c=u.loadQualityProfile(i);k(e)||this._bind(e,u,a),s.setShader({shader:this.shaders.accumulate,uniforms:{...$(e,t.target),kernelControls:{radius:si(a,o),isFieldActive:r?1:0}},defines:{...N(e),...c.defines},optionalAttributes:{},useComputeBuffer:k(e)});const d=k(e)?vo:Ei;s.setPipelineState(d),s.submitDraw(e,t)}getStencilReference(e){return Di(e)}renderResolvePass(e,t){if(k(e))return;const{context:i,painter:s}=e,o=this._resources.get(i);if(this._prevFBO==null||this._prevViewport==null||!o?.initialized)return;const{defines:a}=o.loadQualityProfile(i),{minDensity:r,maxDensity:u,radius:c}=t.getInput().uniforms,d=8,p=9,m=o.accumulateFramebuffer,f=o.resolveGradientTexture,x={shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:d,texture:m.colorTexture},minAndInvRange:[r,1/(u-r)],normalization:3/(c*c*Math.PI)},gradient:{texture:{unit:p,texture:f}}},defines:a,optionalAttributes:{},useComputeBuffer:!1};i.bindFramebuffer(this._prevFBO),i.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),i.bindTexture(m.colorTexture,d),i.bindTexture(f,p),s.setPipelineState(bo),s.submitDrawMesh(i,x,s.quadMesh),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new po,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,i){if(this._isBound)return;const{context:s,state:o,pixelRatio:a}=e,r=s.getBoundFramebufferObject(),u=s.getViewport();this._prevFBO=r,this._prevViewport=u;const{gradient:c,gradientHash:d}=i.uniforms;t.ensureResolveGradientTexture(s,d,c);const{width:p,height:m}=u,f=yo(si(i,o),a),x=p*f,h=m*f,y=t.ensureAccumulateFBO(s,x,h);s.blitFramebuffer(r,y,0,0,r.width,r.height,0,0,y.width,y.height,vt.STENCIL,ge.NEAREST),s.bindFramebuffer(y),s.setViewport(0,0,y.width,y.height),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.clear(vt.COLOR),this._isBound=!0}};function yo(e,t){const i=t>1.5?.25:.5;return e<1/(2*i)?1:i}function Di(e){return e.key.level+1}const Ei={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:Di,compare:Fs.GEQUAL,mask:255,op:{fail:ct.KEEP,zFail:ct.KEEP,zPass:ct.REPLACE}}}},vo={...Ei,stencil:!1},bo={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function si(e,t){const{referenceScale:i,radius:s}=e.uniforms;return s*(i!==0?i/t.scale:1)}const xo=360/254;var W;(function(e){e[e.Color=0]="Color",e[e.Outline=1]="Outline",e[e.Halo=2]="Halo"})(W||(W={}));let ee=class extends He{};l([w(3,S)],ee.prototype,"color",void 0),l([w(4,v)],ee.prototype,"offset",void 0),l([w(5,v)],ee.prototype,"textureUV",void 0),l([w(6,n)],ee.prototype,"fontSize",void 0),l([w(7,n)],ee.prototype,"referenceSize",void 0),l([w(8,S)],ee.prototype,"outlineColor",void 0),l([w(9,S)],ee.prototype,"haloColor",void 0),l([w(10,v)],ee.prototype,"outlineAndHaloSize",void 0),l([w(11,v)],ee.prototype,"zoomRange",void 0),l([w(12,n)],ee.prototype,"clipAngle",void 0),l([w(13,S)],ee.prototype,"referenceSymbol",void 0);let _t=class extends Ct{};l([w(14,v)],_t.prototype,"offsetNextVertex1",void 0),l([w(15,v)],_t.prototype,"offsetNextVertex2",void 0);let go=class extends Oe{},U=class extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=W.Color,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,i){const s=t.multiply(xo),o=At(this.view.rotation.subtract(s)),a=yt(new n(360).subtract(o),o);let r=new n(0);const u=Ji(this.view.currentZoom.multiply(Qt)).divide(Qt),c=e.x,d=e.y,p=new n(1).subtract(K(c,u)).multiply(2),m=K(new n(90),a).multiply(2),f=new n(2).multiply(new n(1).subtract(K(u,d)));return r=r.add(i.multiply(p)),r=r.add(i.multiply(m)),r=r.add(f),r}vertex(e,t){const i=Z(e.bitset,ps),s=new n(1).subtract(i);let o=e.fontSize,a=o.divide(Gt);const r=this.textRenderPassType===W.Outline?e.outlineColor:this.textRenderPassType===W.Halo?e.haloColor:this._getVertexColor(e),u=this.isLabel?this.storage.getLabelVisibility(e.id):new n(1),c=this.isLabel?r.multiply(u):r,d=this.view.displayViewScreenMat3.multiply(new A(e.pos,1));let p=e.offset,m=new n(1),f=B.identity(),x=new v(0);if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const _=e.referenceSymbol,T=_.xy,M=_.z,z=this._unpackDirection(_.w),R=et(this,e.id,M).divide(2),Se=z.multiply(R.add(Is));x=T.add(Se),p=p.add(x)}else m=et(this,e.id,e.referenceSize).divide(e.referenceSize),o=o.multiply(m),a=a.multiply(m),p=p.multiply(m),f=gi(this,e.id),p=f.multiply(new A(p,0)).xy;const h=Z(e.bitset,ds),y=this._getViewRotationMatrix(h).multiply(new A(p,0));let b=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,h):this.clip(e.id,e.zoomRange);b=this.isBackgroundPass?b.add(s.multiply(2)):b.add(i.multiply(2));const g=this.isLabel?ci(Ie(b,new n(1)),me(u,new n(0))):new ft(!1),P=new S(d.xy.add(y.xy),b,1),I=e.textureUV.divide(this.mosaicInfo.size);let C=new n(0);if(this.textRenderPassType===W.Outline&&(me(e.outlineAndHaloSize.x,new n(0))&&(b=b.add(new n(2))),C=new n(e.outlineAndHaloSize.x).divide(a).divide(qt)),this.textRenderPassType===W.Halo){const _=e.outlineAndHaloSize.x,T=new n(e.outlineAndHaloSize.y);me(T,new n(0))&&(b=b.add(new n(2))),C=T.add(_).divide(a).divide(qt)}return{glPosition:P,color:c,size:a,textureUV:I,antialiasingWidth:new n(.105*Gt).divide(o).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(e,t,{vvSizeAdjustment:m,vvRotation:f,labelOffset:x,labelClipped:g})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,s=new n(1).subtract(e);return t.multiply(e).add(i.multiply(s))}fragment(e){const t=new n(.25),i=new n(1).subtract(t),s=Q(this.mosaicInfo.texture,e.textureUV).a;let o=i.subtract(e.outlineDistanceOffset);this.highlight&&(o=o.divide(2));const a=e.antialiasingWidth,r=bi(o.subtract(a),o.add(a),s);return this.getFragmentOutput(e.color.multiply(r),e)}hittest(e,t,{vvSizeAdjustment:i,vvRotation:s,labelOffset:o,labelClipped:a}){let r,u,c;this.isLabel?(r=new A(e.offset.add(o),0),u=new A(t.offsetNextVertex1.add(o),0),c=new A(t.offsetNextVertex2.add(o),0)):(r=s.multiply(new A(e.offset.multiply(i),0)),u=s.multiply(new A(t.offsetNextVertex1.multiply(i),0)),c=s.multiply(new A(t.offsetNextVertex2.multiply(i),0)));const{viewMat3:d,tileMat3:p}=this.view,m=d.multiply(p).multiply(new A(e.pos,1)),f=m.add(p.multiply(r)).xy,x=m.add(p.multiply(u)).xy,h=m.add(p.multiply(c)).xy,y=Rt(this.hittestRequest.position,f.xy,x.xy,h.xy);return this.isLabel?Y(a,ot(this.hittestRequest),y):y}_unpackDirection(e){const t=new ut(e),i=es(t,new ut(2)),s=ts(t,new ut(3));return new v(new n(i).subtract(1),new n(s).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const i=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(i,e.color,new ft(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(e.id),s=this.visualVariableOpacity.getOpacity(i);t=t.multiply(s)}return t}};l([O(It)],U.prototype,"visualVariableColor",void 0),l([O(Ot)],U.prototype,"visualVariableOpacity",void 0),l([O(nt)],U.prototype,"visualVariableRotation",void 0),l([O(Ft)],U.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],U.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],U.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],U.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],U.prototype,"mosaicInfo",void 0),l([Ce],U.prototype,"textRenderPassType",void 0),l([Ce],U.prototype,"isBackgroundPass",void 0),l([Ce],U.prototype,"isLabel",void 0),l([D(0,F(ee)),D(1,F(_t))],U.prototype,"vertex",null),l([D(0,F(go))],U.prototype,"fragment",null);let wo=class extends q{constructor(){super(...arguments),this.type=G.Label,this.shaders={geometry:new U},this.drawPhase=ue.LABEL|ue.LABEL_ALPHA|ue.HITTEST,this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a={...H(e)},r=t.instance.getInput(),u={shader:this.shaders.geometry,uniforms:{...J(e,t.target,r.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!0,isLabel:!0},optionalAttributes:r.optionalAttributes,useComputeBuffer:k(e)};s.setShader(u),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Halo,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t)}},So=class extends q{constructor(){super(...arguments),this.type=G.Line,this.shaders={geometry:new wi},this.symbologyPlane=we.LINE}render(e,t){const{painter:i,pixelRatio:s}=e,o=t.instance.getInput();i.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),antialiasingControls:qe(s)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),i.setPipelineState(H(e)),i.submitDraw(e,t)}};class Ae extends is{}l([w(9,n)],Ae.prototype,"accumulatedDistance",void 0),l([w(10,v)],Ae.prototype,"segmentDirection",void 0),l([w(11,n)],Ae.prototype,"offsetAlongLine",void 0),l([w(12,n)],Ae.prototype,"capType",void 0),l([w(13,S)],Ae.prototype,"tlbr",void 0);class Tt extends wi{_getDistanceRatio(t,i){const s=Z(t.bitset,ms);return s.multiply(xe(i,new n(.25)).multiply(new n(2))).add(new n(1).subtract(s).multiply(be(1)))}_getSDFAlpha(t){const{halfWidth:i,normal:s,tlbr:o,patternSize:a,accumulatedDistance:r,offsetAlongLine:u,dashToPx:c,capType:d}=t,p=a.x.divide(ks).multiply(c),m=Wt(r.add(u).divide(p)),f=Re(o.xy,o.zw,new v(m,.5)),x=Pt(Q(this.mosaicInfo.texture,f)).multiply(2).subtract(1).multiply(Bs).multiply(c),h=s.y.multiply(i),y=Mt([me(d,new n(1)),x.subtract(i)],[me(d,new n(2)),ss(os(xe(x,new n(0)),new n(2)).add(h.multiply(h))).subtract(i)],[!0,x]),b=$e(new n(.25).subtract(y),new n(0),new n(1));return new S(b)}_getPatternColor(t){const{halfWidth:i,normal:s,color:o,accumulatedDistance:a,patternSize:r,sampleAlphaOnly:u,tlbr:c}=t,d=r.y.multiply(new n(2).multiply(i).divide(r.x)),p=Wt(a.divide(d)),m=new n(.5).multiply(s.y).add(new n(.5)),f=Re(c.xy,c.zw,new v(m,p));let x=Q(this.mosaicInfo.texture,f);return this.visualVariableColor!=null&&(x=Y(Ie(u,new n(.5)),new S(o.a),o)),x}vertex(t,i){const{segmentDirection:s,tlbr:o,bitset:a}=t,r=as(this,t),u=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(ht(s,r.scaledOffset)),c=new v(o.z.subtract(o.x),o.w.subtract(o.y)),d=o.divide(this.mosaicInfo.size.xyxy),p=Z(a,fs),m=Z(a,hs),f=Y(Ie(p,new n(.5)),this._getDistanceRatio(t,r.scaledHalfWidth),new n(1));return{...r,tlbr:d,patternSize:c,accumulatedDistance:u,isSDF:p,sampleAlphaOnly:m,dashToPx:f,offsetAlongLine:t.offsetAlongLine,capType:t.capType,...this.maybeRunHittest(t,i,r.halfWidth)}}fragment(t){const{color:i,opacity:s,isSDF:o}=t,a=rs(t,this.antialiasingControls.blur),r=Y(Ie(o,new n(.5)),this._getSDFAlpha(t),this._getPatternColor(t)),u=i.multiply(s).multiply(a).multiply(r);return this.getFragmentOutput(u,t)}}l([V(at)],Tt.prototype,"mosaicInfo",void 0),l([D(0,F(Ae)),D(1,F(ys))],Tt.prototype,"vertex",null);let Vo=class extends q{constructor(){super(...arguments),this.type=G.TexturedLine,this.shaders={geometry:new Tt},this.symbologyPlane=we.LINE}render(e,t){const{context:i,painter:s,pixelRatio:o}=e,a=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),antialiasingControls:qe(o),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...N(e)},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}};class de extends He{}l([w(3,S)],de.prototype,"color",void 0),l([w(4,S)],de.prototype,"outlineColor",void 0),l([w(5,v)],de.prototype,"offset",void 0),l([w(6,v)],de.prototype,"textureUV",void 0),l([w(7,S)],de.prototype,"sizing",void 0),l([w(8,n)],de.prototype,"placementAngle",void 0),l([w(9,n)],de.prototype,"sdfDecodeCoeff",void 0),l([w(10,v)],de.prototype,"zoomRange",void 0);class ke extends Ct{}l([w(12,v)],ke.prototype,"offsetNextVertex1",void 0),l([w(13,v)],ke.prototype,"offsetNextVertex2",void 0),l([w(14,v)],ke.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],ke.prototype,"textureUVNextVertex2",void 0);class zo extends Oe{}function pe(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}function pt(e){return e.multiply(e).divide(128)}class se extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,i){const s=pt(t.sizing.x),o=pt(t.sizing.y),a=pt(t.sizing.z),r=t.placementAngle,u=Z(t.bitset,le.bitset.isSDF),c=Z(t.bitset,le.bitset.isMapAligned),d=Z(t.bitset,le.bitset.scaleSymbolsProportionally),p=pi(t.bitset,le.bitset.colorLocked),m=di(this,t.id),f=ui(this,t.id,t.color,p).multiply(m),x=this.view.displayViewScreenMat3.multiply(new A(t.pos.xy,1)),h=et(this,t.id,a).divide(a),y=s.multiply(h),b=t.offset.xy.multiply(h);let g=o.multiply(d.multiply(h.subtract(1)).add(1));g=yt(g,xe(y.subtract(.99),new n(0)));const P=xe(g,new n(1)),I=yt(g,new n(1)),C=B.fromRotation(r.multiply(li)),_=gi(this,t.id),T=this._getViewRotationMatrix(c).multiply(_).multiply(C).multiply(new A(b.xy,0)),M=this.clip(t.id,t.zoomRange),z=new S(x.xy.add(T.xy),M,1),R=t.textureUV.divide(this.mosaicInfo.size),Se=t.outlineColor.multiply(I),Hi=Z(t.bitset,le.bitset.overrideOutlineColor),$t=t.sdfDecodeCoeff.multiply(y);return{glPosition:z,color:f,textureUV:R,outlineColor:Se,outlineSize:P,distanceToPx:$t,isSDF:u,overrideOutlineColor:Hi,...this.maybeRunHittest(t,i,{pos:t.pos,size:y,sizeCorrection:h,isMapAligned:c,vvRotationMat3:_,placementMat3:C,outlineSize:P,distanceToPx:$t,isSDF:u})}}fragment(t){const i=this._getColor(t.textureUV,t);return this.getFragmentOutput(i,t)}hittest(t,i,s){return Y(mi(s.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,i,s),this._hittestMarker(t,i,s))}_getViewRotationMatrix(t){const i=this.view.displayViewMat3,s=this.view.displayMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getViewScreenMatrix(t){const i=this.view.viewMat3.multiply(this.view.tileMat3),s=this.view.tileMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a);let u=i.outlineSize;this.highlight&&(u=xe(u,i.overrideOutlineColor.multiply(4)));const c=u.multiply(.5),d=At(o).subtract(c),p=$e(new n(.5).subtract(d),new n(0),new n(1)),m=Re(i.outlineColor,i.color,i.overrideOutlineColor).multiply(p);return new n(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,i,s){const{position:o,distance:a,smallSymbolDistance:r}=this.hittestRequest,u=a.subtract(r),{viewMat3:c,tileMat3:d}=this.view,p=c.multiply(d).multiply(new A(s.pos,1)).xy,m=s.size.multiply(.5);return fi(p,o).subtract(m).add(u)}_hittestMarker(t,i,s){const{pos:o,sizeCorrection:a,isMapAligned:r}=s,u=new A(t.offset.multiply(a),0),c=new A(i.offsetNextVertex1.multiply(a),0),d=new A(i.offsetNextVertex2.multiply(a),0),{viewMat3:p,tileMat3:m}=this.view,f=p.multiply(m).multiply(new A(o,1)),x=this._getViewScreenMatrix(r).multiply(s.vvRotationMat3).multiply(s.placementMat3),h=f.add(x.multiply(u)).xy,y=f.add(x.multiply(c)).xy,b=f.add(x.multiply(d)).xy,g=this.hittestRequest.position,P=this.hittestRequest.distance,I=Rt(g,h,y,b);return Y(Ie(I,P),I,this._hittestSamples(h,y,b,t,i,s))}_hittestSamples(t,i,s,o,a,r){const{outlineSize:u,isSDF:c,distanceToPx:d}=r,p=this.hittestRequest.position,m=this.hittestRequest.distance,f=E(p.add(new v(ie(m),ie(m))),t,i,s),x=E(p.add(new v(0,ie(m))),t,i,s),h=E(p.add(new v(m,ie(m))),t,i,s),y=E(p.add(new v(ie(m),0)),t,i,s),b=E(p,t,i,s),g=E(p.add(new v(m,0)),t,i,s),P=E(p.add(new v(ie(m),m)),t,i,s),I=E(p.add(new v(0,m)),t,i,s),C=E(p.add(new v(m,m)),t,i,s),_=o.textureUV.divide(this.mosaicInfo.size),T=a.textureUVNextVertex1.divide(this.mosaicInfo.size),M=a.textureUVNextVertex2.divide(this.mosaicInfo.size),z={color:new S(1),outlineColor:new S(1),overrideOutlineColor:new n(1),outlineSize:u,distanceToPx:d,isSDF:c};let R=new n(0);return R=R.add(L(f).multiply(this._getColor(pe(f,_,T,M),z).a)),R=R.add(L(x).multiply(this._getColor(pe(x,_,T,M),z).a)),R=R.add(L(h).multiply(this._getColor(pe(h,_,T,M),z).a)),R=R.add(L(y).multiply(this._getColor(pe(y,_,T,M),z).a)),R=R.add(L(b).multiply(this._getColor(pe(b,_,T,M),z).a)),R=R.add(L(g).multiply(this._getColor(pe(g,_,T,M),z).a)),R=R.add(L(P).multiply(this._getColor(pe(P,_,T,M),z).a)),R=R.add(L(I).multiply(this._getColor(pe(I,_,T,M),z).a)),R=R.add(L(C).multiply(this._getColor(pe(C,_,T,M),z).a)),K(R,new n(.05)).multiply(ot(this.hittestRequest))}}l([O(It)],se.prototype,"visualVariableColor",void 0),l([O(Ot)],se.prototype,"visualVariableOpacity",void 0),l([O(nt)],se.prototype,"visualVariableRotation",void 0),l([O(Ft)],se.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],se.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],se.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],se.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],se.prototype,"mosaicInfo",void 0),l([D(0,F(de)),D(1,F(ke))],se.prototype,"vertex",null),l([D(0,F(zo))],se.prototype,"fragment",null);let _o=class extends q{constructor(){super(...arguments),this.type=G.Marker,this.shaders={geometry:new se},this.symbologyPlane=we.MARKER}render(e,t){const{context:i,painter:s}=e,o=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}},To=class{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([s,o])=>`${s}.${o}`).join("."),i=zs(t);this._locationInfo={hash:i,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,i]of this.locationsMap.entries())e.set("a_"+t,i);return e}getShaderKey(e,t,i){return`${Object.keys(e).map(s=>`${s}.${e[s]}`).join(".")}.${Object.keys(i).filter(s=>i[s]).map(s=>`${s}_${i[s].toString()}`).join(".")}.${Object.keys(t).filter(s=>this.optionPropertyKeys.has(s)).join(".")}`}getProgram(e,t,i,s){let o="",a="";for(const r in i)if(i[r]){const u=typeof i[r]=="boolean"?`#define ${r} -`:`#define ${r} ${i[r]} -`;o+=u,a+=u}return o+=this.vertexShader,a+=this.fragmentShader,new xs(o,a,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(t),this._transformFeedbackBindings)}_getUniformBindings(e){const t=[];for(const i in this.required){const s=this.required[i];t.push({uniformHydrated:null,shaderModulePath:i,uniformName:i,uniformType:s.type,uniformArrayElementType:oi(s),uniformArrayLength:ai(s)})}for(const i in e){const s=this.options[i];if(e[i])for(const o in s){const a=s[o];t.push({uniformHydrated:null,shaderModulePath:`${i}.${o}`,uniformName:o,uniformType:a.type,uniformArrayElementType:oi(a),uniformArrayLength:ai(a)})}}return t}};const oi=e=>e.type==="array"?e.elementType?.type:void 0,ai=e=>e.type==="array"?e.size:void 0,Mo={hittestDist:n,hittestPos:v},Po={filterFlags:j,animation:j,visualVariableData:j,dataDriven0:j,dataDriven1:j,dataDriven2:j,gpgpu:j,size:n},Ao={displayViewScreenMat3:B,displayViewMat3:B,displayMat3:B,viewMat3:B,tileMat3:B,displayZoomFactor:n,requiredZoomFactor:n,tileOffset:v,currentScale:n,currentZoom:n,metersPerSRUnit:n};let Co=class extends To{constructor(){super(...arguments),this.vertexShader=ii("materials/pie/pie.vert"),this.fragmentShader=ii("materials/pie/pie.frag"),this.required={...Po,...Ao,outlineWidth:n,colors:ne,defaultColor:S,othersColor:S,outlineColor:S,donutRatio:n,sectorThreshold:n},this.options={hittestUniforms:Mo,visualVariableSizeMinMaxValue:{minMaxValueAndSize:S},visualVariableSizeScaleStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:n},visualVariableOpacity:{opacities:{...ne.ofType(n,8),type:"array",elementType:n,size:8},opacityValues:{...ne.ofType(n,8),type:"array",elementType:n,size:8}}},this.locations={pos:{index:0,type:v},id:{index:1,type:A},bitset:{index:2,type:n},offset:{index:3,type:v},texCoords:{index:4,type:v},size:{index:5,type:v},referenceSize:{index:6,type:n},zoomRange:{index:7,type:v}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...ne.ofType(S,e),type:"array",elementType:S,size:e}}},Ro=class extends q{constructor(){super(...arguments),this.type=G.PieChart,this.shaders={geometry:new Co},this.symbologyPlane=we.MARKER}render(e,t){const{painter:i}=e,{instance:s,target:o}=t,a=this.shaders.geometry,r=s.getInput(),u=r.uniforms.numberOfFields,c=k(e),d=$(e,o),p=N(e);a.setNumberOfFields(u),i.setShader({shader:a,uniforms:{...J(e,t.target,r.uniforms.shader),...d.storage,...d.view,hittestUniforms:d.hittestRequest?{hittestDist:d.hittestRequest?.distance,hittestPos:d.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!r.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!r.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!r.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!r.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!r.uniforms.shader.visualVariableOpacity,HITTEST:c,highlight:d.highlight?1:0,...p,numberOfFields:u},optionalAttributes:{},useComputeBuffer:c}),i.setPipelineState(H(e)),i.submitDraw(e,t)}},Io=class extends q{constructor(){super(...arguments),this.type=G.Text,this.shaders={geometry:new U},this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a=t.instance.getInput(),r={shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,isBackgroundPass:!0,isLabel:!1,textRenderPassType:W.Color},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)};s.setShader(r),s.setPipelineState(H(e)),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Halo}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Outline}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Color}}),s.submitDraw(e,t)}};const ae={fill:new ao,patternFill:new no,complexFill:new so,outlineFill:new ro,patternOutlineFill:new lo,complexOutlineFill:new oo,marker:new _o,pieChart:new Ro,line:new So,texturedLine:new Vo,text:new Io,label:new wo,heatmap:new ho,dotDensity:new io,animatedMarker:new Ys};function Ea(){for(const e in ae)ae[e].startup()}function La(e){for(const t in ae)ae[t].shutdown(e)}function it(e,t){const i=e.slice(0,t),s=t-i.length;for(let o=0;oSi.getLogger("esri.views.2d.layers.features.support.rendererUtils");function Bi(e){return e.map(t=>Fo(t)?Do(t.clone()):t)}function Fo(e){return(e.type==="size"||e.type==="color"||e.type==="opacity")&&e.stops!=null}function Do(e){return e.stops=ko(e.type,e.stops??[]),e}function ze(e,t,i){return(1-i)*e+i*t}function Eo(e,t){const[i,...s]=t,o=s.pop(),a=s[0].value,r=s[s.length-1].value,u=(r-a)/Li,c=[];for(let d=a;d=s[p].value;)p++;const m=s[p],f=t[p-1],x=d-f.value,h=m.value===f.value?1:x/(m.value-f.value);if(e==="color"){const y=s[p],b=t[p-1],g=y.color.clone();g.r=ze(b.color.r,g.r,h),g.g=ze(b.color.g,g.g,h),g.b=ze(b.color.b,g.b,h),g.a=ze(b.color.a,g.a,h),c.push({value:d,color:g,label:y.label})}else if(e==="size"){const y=s[p],b=t[p-1],g=Xt(y.size),P=ze(Xt(b.size),g,h);c.push({value:d,size:P,label:y.label})}else{const y=s[p],b=ze(t[p-1].opacity,y.opacity,h);c.push({value:d,opacity:b,label:y.label})}}return[i,...c,o]}function Lo(e){const[t,...i]=e,s=i.pop();for(;i.length>Li;){let o=0,a=0;for(let r=1;ra&&(a=d,o=r)}i.splice(o,1)}return[t,...i,s]}function ko(e,t){return t.length<=Qe?t:(ki().warn(`Found ${t.length} Visual Variable stops, but MapView only supports ${Qe}. Displayed stops will be simplified.`),t.length>2*Qe?Eo(e,t):Lo(t))}function Bo(){const{supportsColorBufferFloat:e,supportsColorBufferFloatBlend:t,supportsColorBufferHalfFloat:i}=Bt();return e&&t||i}function ka(e){if(!e)return!0;switch(e.type){case"dot-density":break;case"heatmap":if(!Bo()){const t=Bt(),i=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(s=>!t[s]).join(", ");return ki().errorOnce(new Ke("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${i}`)),!1}}return!0}const No=1.25,je=128,$o=128;function Uo(e){if(!e.stops?.length)return null;const t=e.stops.sort((a,r)=>a.value-r.value),i=it(t,8),s=i.map(({value:a})=>a),o=i.map(({color:a})=>Oo(a));return{values:s,colors:o}}function Ho(e){if(!e.stops?.length)return null;const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{opacityValues:i.map(({value:s})=>s),opacities:i.map(({opacity:s})=>s)}}function Go(e){return{rotationType:e.rotationType==="geographic"?mt.Geographic:mt.Arithmatic}}function dt(e){if(!e.stops?.length)return null;if(e.stops.some(s=>s.useMaxValue||s.useMinValue))return(s,o)=>{const a=s.statisticsByLevel.get(o.key.level),r=e.stops.map(c=>({value:c.useMaxValue?a?.get(e.field)?.maxValue??0:c.useMinValue?a?.get(e.field)?.minValue??0:c.value,size:c.size?be(c.size):Os})).sort((c,d)=>c.value-d.value),u=it(r,8);return{values:u.map(({value:c})=>c),sizes:u.map(({size:c})=>c)}};const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{values:i.map(({value:s})=>s),sizes:i.map(({size:s})=>be(s))}}function qo(e){return t=>{const{state:i}=t;return{unitValueToPixelsRatio:Ts(i.spatialReference)/Ns[e.valueUnit??"meters"]/i.resolution}}}function ri(e,t){const i=t.length;if(e{const u=a.state.scale,c=be(ri(u,s.stops)),d=be(ri(u,o.stops));return{minMaxValueAndSize:[t,i,c,d]}};if(typeof s=="object"||typeof o=="object")throw new Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[t,i,be(s),be(o)]}}const st={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};function Ni(e,t=$o,i=No){if(e.visualVariableSizeMinMaxValue)return e.visualVariableSizeMinMaxValue instanceof Function?je:Math.max(e.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*i,t);if(e.visualVariableSizeScaleStops){if(e.visualVariableSizeScaleStops instanceof Function)return je;const s=e.visualVariableSizeScaleStops.sizes;return Math.max(s[s.length-1]*i,t)}if(e.visualVariableSizeStops){if(e.visualVariableSizeStops instanceof Function)return je;const s=e.visualVariableSizeStops.sizes;return Math.max(s[s.length-1]*i,t)}return e.visualVariableSizeUnitValue?2*je:0}function Ba(e){const t={...st};if(!e||!("visualVariables"in e)||!e.visualVariables)return t;for(const i of Bi(e.visualVariables))switch(i.type){case"color":t.visualVariableColor=Uo(i);break;case"opacity":t.visualVariableOpacity=Ho(i);break;case"rotation":t.visualVariableRotation=Go(i);break;case"size":switch(jo(i)){case"field-stops":t.visualVariableSizeStops=dt(i);break;case"scale-stops":i.target==="outline"?t.visualVariableSizeOutlineScaleStops=dt(i):t.visualVariableSizeScaleStops=dt(i);break;case"min-max":t.visualVariableSizeMinMaxValue=Wo(i);break;case"unit-value":t.visualVariableSizeUnitValue=qo(i)}break}return t}function jo(e){return typeof e.minDataValue=="number"&&typeof e.maxDataValue=="number"&&e.minSize!=null&&e.maxSize!=null?"min-max":e?.valueExpression==="$view.scale"&&Array.isArray(e.stops)?"scale-stops":e.field==null&&e?.valueExpression==="$view.scale"||!(Array.isArray(e.stops)||"levels"in e&&e.levels)?e.field!=null||e?.valueExpression!=="$view.scale"?"unit-value":null:"field-stops"}function Ko(e){return!!(e.visualVariableSizeMinMaxValue||e.visualVariableSizeScaleStops||e.visualVariableSizeStops||e.visualVariableSizeUnitValue||e.visualVariableSizeOutlineScaleStops)}function Na(e){return!!e.visualVariableRotation}function Xo(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function oe(e){if(e==null)return null;if(Array.isArray(e)){const[t,i,s,o]=e;return[t,i,s,255*o]}return typeof e=="string"?e:{...e,defaultValue:oe(e?.defaultValue)}}async function $a(e,t){const{cimResourceManager:i,cimAnalyzer:s,scaleExpression:o}=t.schemaOptions;await Promise.all(vs.fetchResources(e.symbol,i,[]));const a=s.analyzeSymbolReference(e,!1),r={scaleInfo:Xo(e),scaleExpression:o},u=[];for(const c of a)switch(c.type){case"marker":u.push(...Zo(c,t,r));break;case"fill":u.push(...ta(c,t,r));break;case"line":u.push(...sa(c,t,r));break;case"text":u.push(...ra(c,t,r))}return u}function Zo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,visualVariableRotation:s.visualVariableRotation};return e.animationParams?Yo(a.ensureInstance(ae.animatedMarker,{uniforms:r,optionalAttributes:{zoomRange:!0}}),e,st,i):Qo(a.ensureInstance(ae.marker,{uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s,i)}function Yo(e,t,i,s){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,sprite:t.spriteRasterizationParam,animations:t.animationParams,scaleInfo:s.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===ws.MAP,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,referenceSize:t.referenceSize,angleToLine:!!t.markerPlacement&&t.markerPlacement.placement&&"angleToLine"in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine,sizeRatio:t.sizeRatio})]:[]}function Qo(e,t,i,{scaleInfo:s,scaleExpression:o}){const a=Ko(i);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:oe(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:s,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||gs.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:o??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:a,placement:t.markerPlacement,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:Ni(i)})]}function Jo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ea(a.ensureInstance(ae.fill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function ea(e,t,{scaleInfo:i}){return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],scaleInfo:i,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function ta(e,t,i){if(!e.spriteRasterizationParam)return Jo(e,t,i);const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ia(a.ensureInstance(ae.complexFill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s.visualVariableColor!=null,i)}function ia(e,t,i,{scaleInfo:s}){if(!t.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const o=!!t.hasUnresolvedReplacementColor&&(!i||t.colorLocked),a=t.sampleAlphaOnly&&!o,r=t.spriteRasterizationParam;return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:a,scaleProportionally:r.resource.type==="CIMHatchFill",sprite:r,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function sa(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},u={uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}},c=!!(r.visualVariableSizeMinMaxValue||r.visualVariableSizeScaleStops||r.visualVariableSizeStops||r.visualVariableSizeUnitValue);return e.spriteRasterizationParam?aa(a.ensureInstance(ae.texturedLine,u),e,c,i):oa(a.ensureInstance(ae.line,u),e,c,i)}function $i(e,t,{scaleInfo:i}){return{color:oe(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:t,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function oa(e,t,i,s){if(t.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const o=$i(t,i,s);return[e.createMeshInfo(o)]}function aa(e,t,i,s){const{spriteRasterizationParam:o,scaleDash:a,sampleAlphaOnly:r}=t;if(!o)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...$i(t,i,s),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:r,isSDF:o.resource.type!=="CIMPictureStroke",sprite:o})]}function ra(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return na(a.ensureInstance(ae.text,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableRotation:s.visualVariableRotation,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1}}),e,s,i)}function na(e,t,i,{scaleInfo:s,scaleExpression:o}){return[e.createMeshInfo({boxBackgroundColor:oe(t.backgroundColor),boxBorderLineColor:oe(t.borderLineColor),boxBorderLineSize:t.borderLineWidth??0,color:oe(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:oe(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??"center",verticalAlignment:t.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:o??1,minPixelBuffer:Ni(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ua(e,t){return{type:"simple",filters:t,capabilities:{maxTextureSize:Bt().maxTextureSize},bindings:la(e)}}function lt(e){switch(e){case"opacity":return We.OPACITY;case"color":return We.COLOR;case"rotation":return We.ROTATION;case"size":return We.SIZE;default:return null}}function la(e){if(!e)return[];switch(e.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return Ui(e);case"dot-density":return ua(e);case"pie-chart":return ca(e);case"heatmap":return pa(e)}}function ua(e){const t=[];for(const i of e.attributes)t.push({binding:t.length,expression:i.valueExpression,field:i.field});return t}function ca(e){const t=Ui(e);let i=4;for(const s of e.attributes)t.push({binding:i++,expression:s.valueExpression,field:s.field});return t}function pa({valueExpression:e,field:t}){return e||t?[{binding:0,expression:e,field:t}]:[]}function Ui(e){return!("visualVariables"in e)||!e.visualVariables?.length?[]:Bi(e.visualVariables).map(t=>ya(t)).filter(_s)}function da(e){return e.valueExpression==="$view.scale"?null:{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression,valueRepresentation:e.valueRepresentation}}function ma(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function fa(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function ha(e){return{binding:lt(e.type),expression:e.valueExpression,field:e.field}}function ya(e){switch(e.type){case"size":return da(e);case"color":return ma(e);case"opacity":return fa(e);case"rotation":return ha(e)}}class Ha{constructor(t){this.updateTracking=new ns({debugName:"FeatureCommandQueue"}),this._queueProcessor=new $s({concurrency:1,process:t.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(t){return Ss(this.updateTracking.addPromise(this._doPush(t)))}async _doPush(t){const i=this._queueProcessor,s=i.last();switch(t.type){case"update":case"highlight":return s?.type===t.type?void 0:i.push(t);case"edit-by-id":case"edit-by-feature":return i.push(t)}}}export{La as $,oa as J,Qo as K,js as M,Ni as N,qs as P,ka as Q,Gs as T,Ui as U,st as W,Yo as X,ia as Y,ea as Z,Ha as _,na as a,Oo as b,Ko as c,aa as e,Ua as h,Xo as j,Na as l,ae as o,Ea as q,Ba as r,Da as s,Nt as t,$a as u}; diff --git a/main/assets/FeatureCommandQueue-DzV-HBIG-iLonUkVX.js b/main/assets/FeatureCommandQueue-DzV-HBIG-iLonUkVX.js new file mode 100644 index 000000000..1ef1495e0 --- /dev/null +++ b/main/assets/FeatureCommandQueue-DzV-HBIG-iLonUkVX.js @@ -0,0 +1,3 @@ +import{v as V,t as w,w as O,z as ne,L as S,A as Ce,C as fe,F as Y,I as Je,$ as Ut,M as B,N as me,S as n,T as mt,V as He,a0 as Ge,a1 as Gi,a2 as Be,a3 as Ne,a4 as A,a5 as qi,a6 as Mt,a7 as Q,a8 as Pt,a9 as ni,aa as $e,ab as At,ac as Ct,ad as Z,ae as Wi,_ as li,af as et,ag as ui,ah as ci,ai as ft,aj as pi,ak as Re,al as di,am as mi,an as fi,ao as Rt,ap as Ie,aq as E,ar as v,as as ie,at as L,au as K,av as ot,aw as F,D as G,ax as hi,ay as yi,az as xe,aA as vi,aB as bi,aC as ht,aD as Ht,aE as xi,aF as ji,aG as Ki,aH as Xi,aI as Zi,aJ as Yi,aK as Qi,aL as yt,aM as Ji,aN as Gt,aO as gi,aP as qt,aQ as ut,aR as es,aS as ts,aT as wi,aU as is,aV as Wt,aW as ss,aX as os,aY as as,aZ as rs,a as ns,a_ as j,a$ as jt,b0 as ls,b1 as us,b2 as at,b3 as It,b4 as Ot,b5 as Ft,b6 as Dt,b7 as Et,b8 as Lt,u as le,b9 as kt,ba as cs,bb as Oe,Y as ps,W as ds,X as ms,U as fs,x as hs,bc as ys,k as vs,bd as bs,be as xs}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import{w as gs}from"./utils-SPbpQbmm-Dl9Ps2XQ.js";import{r as ws}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as l,hF as D,f4 as be,b9 as Ss,hT as Kt,K as Fe,ff as Vs,o as Ke,a1 as Si,hm as zs,aq as _s,p as Ts,eo as Xt}from"./main-C7yV2j71.js";import{k as Ms,E as Ps}from"./mat3-CC4Foazl-BWjyqE2v.js";import{D as As,o as k,B as $,C as N,M as H,F as Cs,z as J,H as rt,E as ue,S as we,e as Zt,L as We}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{t as X,v as Yt,x as Rs,K as Qt,g as Is,o as Os}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as te,F as Ue,M as ge,U as ye,L as Fs,D as ct,R as vt,T as Vi,G as bt,H as zi,n as Jt,B as ei}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as ti}from"./BufferObject-BM_7mcDb-CTo2uuE5.js";import{c as Ds}from"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import{n as Es}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{a as Ls,E as _i,G as Ti}from"./Program-DLVwTiPA-CHQtoRqS.js";import{H as tt,V as Mi}from"./Texture-BCt2hphT-CtQVMDnp.js";import{t as ks,c as Bs}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{o as ii}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{m as Ns}from"./lengthUtils-DKpMe5qR-E2FfnN85.js";import{n as Bt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{k as $s}from"./QueueProcessor-DbfV9fLy-DobN0ur5.js";class Us{get forceStaticPath(){return Fe("esri-cim-animations-enable-status")==="disabled"}get forceAnimatedPath(){return Fe("esri-cim-animations-enable-status")==="forced"}get freezeGlobalTime(){return Fe("esri-cim-animations-freeze-time")??!1}get spotlightAnimatedSymbols(){return!!Fe("esri-cim-animations-spotlight")}get forceGlobalTimeOrigin(){return Fe("esri-cim-animations-freeze-time")!==!1}}const Nt=new Us;function Hs(e){return e.locationsMap}const Da={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};let Gs=class{constructor(){this.drawPhase=ue.MAP|ue.HITTEST|ue.HIGHLIGHT|ue.DEBUG}startup(){}shutdown(e){}};const xt={[te.BYTE]:1,[te.UNSIGNED_BYTE]:1,[te.SHORT]:2,[te.UNSIGNED_SHORT]:2,[te.HALF_FLOAT]:2,[te.INT]:4,[te.UNSIGNED_INT]:4,[te.FLOAT]:4};let qs=class{constructor(e,t){this._boundPart=null,this.vertexBuffers=new Map;for(const[s,o]of Object.entries(t.vertex)){const a=ti.createVertex(e,Jt.STATIC_DRAW,o);this.vertexBuffers.set(s,a)}const i=new Map;for(const[s,o]of Object.entries(t.index??{})){const a=ti.createIndex(e,Jt.STATIC_DRAW,o);i.set(s,a)}this.groups=[];for(const s of t.groups){let o;if(s.index!=null){if(!t.index?.[s.index])throw new Error("No index data.");const{BYTES_PER_ELEMENT:d}=t.index[s.index];d===2?o=te.UNSIGNED_SHORT:d===4&&(o=te.UNSIGNED_INT)}const a=s.index!=null?i.get(s.index):null,r=new Map,u=new Map;for(const d of s.attributes){const{name:p,count:m,type:f,offset:x,normalized:h,divisor:y,stride:b,vertex:g,location:P}=d;let I=u.get(g);I||(I=[],u.set(g,I));const C=new Es(p,m,f,x,b,h,y);I.push(C),r.set(p,P)}const c=new Ds(e,r,u,this.vertexBuffers,a);this.groups.push({...s,vertexArray:c,locations:r,layout:u,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:i}=this.parts[this._boundPart],{vertexArray:s}=this.groups[i];e.bindVAO(s)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:i}=this.parts[this._boundPart],{group:s}=this.parts[this._boundPart],{indexing:o,primitive:a}=this.groups[s];o?e.drawElements(a,i,o,t*xt[o]):e.drawArrays(a,t,i)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}};const Ws={position:{type:te.SHORT,count:2}};let js=class gt extends qs{static create(t,i,s){const o=[];let{stride:a}=i;if(a==null){a=0;for(const[m,{count:f,type:x,offset:h}]of Object.entries(i.layout)){if(h!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");a+=f*xt[x]}}let r=0;for(const[m,{count:f,offset:x,type:h,normalized:y}]of Object.entries(i.layout)){x!=null&&(r=x);const b=s.get(m);if(b==null)throw new Error("Locations must be specified at mesh initialization.");const g={name:m,location:b,vertex:"vertexData",count:f,type:h,offset:r,stride:a,divisor:0,normalized:y!=null&&y};o.push(g),r+=f*xt[h]}const u={attributes:o,primitive:i.primitive};i.index!=null&&(u.index="indexData");let{count:c}=i;if(c==null&&(c=i.index?i.index.length:i.vertex.byteLength/a,Math.floor(c)!==c))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${a}.`);const d={start:0,count:c,group:0,primitive:i.primitive},p={vertex:{vertexData:i.vertex},parts:[d],groups:[u]};return i.index!=null&&(p.index={indexData:i.index}),new gt(t,p,i.layout)}static fromVertexStream(t,i){return gt.create(t,{primitive:Vi.TRIANGLE_STRIP,vertex:new Uint16Array(i),layout:Ws},new Map([["position",0]]))}constructor(t,i,s){super(t,i),this._spec=s}bind(t,i=0){super.bind(t,i)}},he=class extends fe{};l([V(n)],he.prototype,"globalTime",void 0),l([V(v)],he.prototype,"animationTextureSize",void 0),l([V(j)],he.prototype,"animationTexture",void 0),l([V(B)],he.prototype,"toScreen",void 0),l([V(B)],he.prototype,"toNdc",void 0),l([V(n)],he.prototype,"mapRotation",void 0),l([V(n)],he.prototype,"pixelRatio",void 0);let nt=class extends fe{getVVRotationMat4(e){return Y(Ut(e),Je.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new Je(s,i,0,0,i.multiply(new n(-1)),s,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return Y(Ut(e),B.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new B(s,i,0,i.multiply(new n(-1)),s,0,0,0,1)})}getNormalizedAngle(e){const t=me(this.rotationType,new n(mt.Arithmatic));return Y(t,new n(90).subtract(e),e)}};l([V(n)],nt.prototype,"rotationType",void 0);class wt extends He{}l([w(3,S)],wt.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),l([w(4,v)],wt.prototype,"zoomRange",void 0);class Ks extends Oe{}class re extends Ge{_getScreenPosition(t){const{pos:i,translation:s,rotation:o,scale:a,offset:r,id:u,vvScale:c}=t,d=Gi(this,u).multiply(Math.PI/180),p=s.x.multiply(4/3),m=s.y.multiply(-1).multiply(4/3),f=Be(o.subtract(d)),x=Ne(o.subtract(d)),h=new n(0),y=new n(1),{pixelRatio:b}=this.animationInfo,g=new B(y,h,h,h,y,h,p.multiply(b),m.multiply(b),y),P=new B(x,f.multiply(-1),h,f,x,h,0,0,y),I=a.multiply(c).multiply(b).multiply(4/3),C=P.multiply(I),_=this.animationInfo.toScreen.multiply(new A(i,1)),T=g.multiply(_).xy,M=C.multiply(new A(r,0)).xy;return T.add(M)}_clip(t,i){let s=super.clip(t,i);const o=qi(this._getLocalTimeOrigin(t),new n(0));return Nt.forceGlobalTimeOrigin||(s=s.add(Mt([o,()=>new n(2)],[!0,()=>new n(0)]))),s}_getLocalTimeOrigin(t){return this.storage.getLocalTimeOrigin(t)}_toNdc(t){return this.animationInfo.toNdc.multiply(new A(t,1)).xy}_getEvalParams(t,i){const{globalTime:s,animationTextureSize:o,animationTexture:a}=this.animationInfo;return{globalTime:s,localTimeOrigin:this._getLocalTimeOrigin(t.id),animationTextureSize:o,animationTexture:a,pixelDimensions:i}}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a),u=i.outlineSize.multiply(.5),c=At(o).subtract(u),d=$e(new n(.5).subtract(c),new n(0),new n(1)),p=i.outlineColor.multiply(d);return new n(1).subtract(p.a).multiply(r).add(p)}}function Ve(e,t,i){const s=e.add(new v(t,0)),o=Q(i.animationTexture,s.add(.5).divide(i.animationTextureSize)).xy;return e=e.add(o),ls({animationPointer:e,...i},S,null,a=>{const{out:r}=a;if(!r)throw new Error("out is null");return us({...a,out:r})})}l([V(at)],re.prototype,"mosaicInfo",void 0),l([V(he)],re.prototype,"animationInfo",void 0),l([O(It)],re.prototype,"visualVariableColor",void 0),l([O(Ot)],re.prototype,"visualVariableOpacity",void 0),l([O(Ft)],re.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],re.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],re.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],re.prototype,"visualVariableSizeUnitValue",void 0),l([O(nt)],re.prototype,"visualVariableRotation",void 0);var ve;(function(e){e[e.transform=0]="transform",e[e.fromColor=1]="fromColor",e[e.toColor=2]="toColor",e[e.colorMix=3]="colorMix",e[e.toOpacity=4]="toOpacity",e[e.opacityMix=5]="opacityMix"})(ve||(ve={}));let De=class extends wt{};l([w(5,v)],De.prototype,"offset",void 0),l([w(6,v)],De.prototype,"uv",void 0),l([w(7,S)],De.prototype,"sizing",void 0),l([w(8,n)],De.prototype,"angle",void 0);class Ee extends Ct{}l([w(12,v)],Ee.prototype,"offsetNextVertex1",void 0),l([w(13,v)],Ee.prototype,"offsetNextVertex2",void 0),l([w(14,v)],Ee.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],Ee.prototype,"textureUVNextVertex2",void 0);class Xs extends Ks{}function ce(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}let St=class extends re{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}_vertexPreamble(e){const{id:t,pos:i,offset:s,animationPointerAndBaseSizeAndReferenceSize:o,uv:a,sizing:r,angle:u}=e,c=o.xy,d=o.z,p=o.w,m=r.xy,f=r.z,x=Z(e.bitset,le.bitset.isStroke),h=r.w,y=Z(e.bitset,le.bitset.scaleSymbolsProportionally),b=this._getEvalParams(e,m),g=Ve(c,ve.transform,b),P=Mt([me(Z(e.bitset,le.bitset.isMapAligned),new n(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new n(0)]),I=new Wi(Ne(P),Be(P.multiply(-1)),Be(P),Ne(P)).multiply(g.xy),C=g.z.subtract(P).subtract(u.multiply(li)),_=g.w,T=Z(e.bitset,le.bitset.isSDF),M=et(this,t,new n(p)).divide(new n(p));return{baseSize:d,animationPointer:c,strokeWidth:f,isOutline:x,unscaledDistanceToPx:h,scaleSymbolsProportionally:y,isSDF:T,position:this._getScreenPosition({id:t,pos:i,offset:s,referenceSize:p,translation:I,rotation:C,scale:_,vvScale:M}),uv:a,evalParams:b,vvScale:M,scale:_}}vertex(e,t){const{position:i,animationPointer:s,evalParams:o,isOutline:a,unscaledDistanceToPx:r,vvScale:u,uv:c,strokeWidth:d,scaleSymbolsProportionally:p,scale:m,isSDF:f,baseSize:x}=this._vertexPreamble(e),h=this._toNdc(i);let y=Ve(s,ve.fromColor,o);y=new S(y.rgb.multiply(y.a),y.a);let b=Ve(s,ve.toColor,o);b=new S(b.rgb.multiply(b.a),b.a);let g=Ve(s,ve.colorMix,o);g=new S(g.rgb.multiply(g.a),g.a);const P=Ve(s,ve.toOpacity,o).a,I=Ve(s,ve.opacityMix,o).a,C=ui(this,e.id,y,ci(pi(e.bitset,le.bitset.colorLocked),new ft(a))),_=Re(C,b,g),T=di(this,e.id),M=Re(T,P,I),z=_.multiply(M),R=this.clip(e.id,e.zoomRange),Se=r.multiply(u);return{glPosition:new S(h,R,1),uv:c.divide(this.mosaicInfo.size),color:z.multiply(new n(1).subtract(a)),outlineColor:z.multiply(a),distanceToPx:Se,strokeWidth:d.multiply(Re(new n(1),m,p)),isOutline:a,isSDF:f,...this.maybeRunHittest(e,t,{pos:e.pos,size:x,sizeCorrection:new n(1),isMapAligned:new n(1),vvRotationMat3:new B(1,0,0,0,1,0,0,0,1),placementMat3:new B(1,0,0,0,1,0,0,0,1),outlineSize:new n(1),distanceToPx:Se,isSDF:f})}}fragment(e){let t=this._getColor(e.uv,{color:e.color,distanceToPx:e.distanceToPx,isSDF:e.isSDF,outlineColor:e.outlineColor,outlineSize:e.strokeWidth});return Nt.spotlightAnimatedSymbols&&(t=t.add(new S(0,.3,0,.3))),this.getFragmentOutput(t,e)}hittest(e,t,i){return Y(mi(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,i),this._hittestMarker(e,t,i))}_hittestSmallMarker(e,t,i){const{position:s,distance:o,smallSymbolDistance:a}=this.hittestRequest,r=o.subtract(a),{viewMat3:u,tileMat3:c}=this.view,d=u.multiply(c).multiply(new A(i.pos,1)).xy,p=i.size.multiply(.5);return fi(d,s).subtract(p).add(r)}_hittestMarker(e,t,i){const s=this._vertexPreamble({...e}).position,o=this._vertexPreamble({...e,offset:t.offsetNextVertex1,uv:t.textureUVNextVertex1}).position,a=this._vertexPreamble({...e,offset:t.offsetNextVertex2,uv:t.textureUVNextVertex2}).position,r=this.hittestRequest.position,u=this.hittestRequest.distance,c=Rt(r,s,o,a);return Y(Ie(c,u),c,this._hittestSamples(s,o,a,e,t,i))}_hittestSamples(e,t,i,s,o,a){const{outlineSize:r,isSDF:u,distanceToPx:c}=a,d=this.hittestRequest.position,p=this.hittestRequest.distance,m=E(d.add(new v(ie(p),ie(p))),e,t,i),f=E(d.add(new v(0,ie(p))),e,t,i),x=E(d.add(new v(p,ie(p))),e,t,i),h=E(d.add(new v(ie(p),0)),e,t,i),y=E(d,e,t,i),b=E(d.add(new v(p,0)),e,t,i),g=E(d.add(new v(ie(p),p)),e,t,i),P=E(d.add(new v(0,p)),e,t,i),I=E(d.add(new v(p,p)),e,t,i),C=s.uv.divide(this.mosaicInfo.size),_=o.textureUVNextVertex1.divide(this.mosaicInfo.size),T=o.textureUVNextVertex2.divide(this.mosaicInfo.size),M={color:new S(1,1,1,1),outlineSize:r,outlineColor:new S(1,1,1,1),isSDF:u,distanceToPx:c};let z=new n(0);return z=z.add(L(m).multiply(this._getColor(ce(m,C,_,T),M).a)),z=z.add(L(f).multiply(this._getColor(ce(f,C,_,T),M).a)),z=z.add(L(x).multiply(this._getColor(ce(x,C,_,T),M).a)),z=z.add(L(h).multiply(this._getColor(ce(h,C,_,T),M).a)),z=z.add(L(y).multiply(this._getColor(ce(y,C,_,T),M).a)),z=z.add(L(b).multiply(this._getColor(ce(b,C,_,T),M).a)),z=z.add(L(g).multiply(this._getColor(ce(g,C,_,T),M).a)),z=z.add(L(P).multiply(this._getColor(ce(P,C,_,T),M).a)),z=z.add(L(I).multiply(this._getColor(ce(I,C,_,T),M).a)),K(z,new n(.05)).multiply(ot(this.hittestRequest))}};l([D(0,F(De)),D(1,F(Ee))],St.prototype,"vertex",null),l([D(0,F(Xs))],St.prototype,"fragment",null);let q=class extends Gs{constructor(){super(...arguments),this.symbologyPlane=we.FILL,this._input=null}},Zs=class extends q{render(e,t){const{context:i,painter:s}=e,{target:o}=t,{freezeGlobalTime:a}=Nt,r=0,u=s.textureManager.animationStore.getTexture(i,r),c=[2/e.state.size[0],0,0,0,-2/e.state.size[1],0,-1,1,1],d=Array.from(Ms(Zt(),c)),p=Array.from(Ps(Zt(),d,o.transforms.displayViewScreenMat3)),m=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,m.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0),animationInfo:{globalTime:a===!1?e.time/1e3:a,animationTextureSize:[u.descriptor.width,u.descriptor.height],animationTexture:{unit:6,texture:u},toScreen:p,toNdc:c,mapRotation:e.state.rotation,pixelRatio:e.state.pixelRatio}},defines:{...N(e)},optionalAttributes:{zoomRange:!0},useComputeBuffer:!0}),s.setPipelineState({...H(e)}),s.submitDraw(e,t),a===!1&&o.requestRender()}},Ys=class extends Zs{constructor(){super(...arguments),this.type=G.AnimatedMarker,this.shaders={geometry:new St}}},Pi=class extends hi{};l([w(0,v)],Pi.prototype,"pos",void 0);let Qs=class extends Oe{};class Ai extends fe{}l([V(n)],Ai.prototype,"dotSize",void 0);let Xe=class extends fe{};l([V(j)],Xe.prototype,"locations",void 0),l([V(n)],Xe.prototype,"pixelRatio",void 0),l([V(n)],Xe.prototype,"tileZoomFactor",void 0);const Js=1e-6;class _e extends yi{vertex(t){const i=new B(1,0,0,0,-1,0,0,1,1).multiply(new A(t.pos.xy.divide(X),1)),s=Q(this.draw.locations,i.xy),o=xe(this.instance.dotSize.divide(2),new n(1));let a=new n(0);a=a.add(K(s.a,new n(Js)).multiply(2));let r=o.add(this.instance.dotSize);const u=this.view.displayViewScreenMat3.multiply(new A(t.pos.add(.5),1)),c=new S(u.xy,a,1),d=this.instance.dotSize.divide(r),p=new n(-1).divide(o.divide(r));return r=r.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:c,glPointSize:r,color:s,ratio:d,invEdgeRatio:p}}fragment(t){const i=vi(t.glPointCoord.subtract(.5)).multiply(2),s=bi(new n(0),new n(1),t.invEdgeRatio.multiply(i.subtract(t.ratio)).add(1)),o=new kt;return o.glFragColor=t.color.multiply(s),o}}l([V(Ai)],_e.prototype,"instance",void 0),l([V(Xe)],_e.prototype,"draw",void 0),l([V(cs)],_e.prototype,"view",void 0),l([D(0,F(Pi))],_e.prototype,"vertex",null),l([D(0,F(Qs))],_e.prototype,"fragment",null);class Ci extends He{}l([w(3,n)],Ci.prototype,"inverseArea",void 0);let Ze=class extends fe{};l([V(ne.ofType(S,2))],Ze.prototype,"isActive",void 0),l([V(ne.ofType(S,8))],Ze.prototype,"colors",void 0),l([V(n)],Ze.prototype,"dotValue",void 0);let Te=class extends fe{};l([V(j)],Te.prototype,"dotTexture0",void 0),l([V(j)],Te.prototype,"dotTexture1",void 0),l([V(n)],Te.prototype,"tileZoomFactor",void 0),l([V(n)],Te.prototype,"pixelRatio",void 0),l([V(n)],Te.prototype,"tileDotsOverArea",void 0);let Me=class extends Ge{_dotThreshold(e,t,i){return e.divide(t).divide(i)}vertex(e){const t=new B(2/X,0,0,0,-2/X,0,-1,1,1).multiply(new A(e.pos,1)),i=this.clip(e.id),s=new S(t.xy,i,1),o=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),a=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),r=this.draw.tileZoomFactor.multiply(X).divide(this.draw.pixelRatio),u=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),c=this._dotThreshold(a,this.instance.dotValue,this.draw.tileDotsOverArea),d=e.pos.add(.5).divide(r);return{glPosition:s,color:new S(0,0,0,0),textureCoords:d,thresholds0:u,thresholds1:c}}fragment(e){const t=new kt,i=Q(this.draw.dotTexture0,e.textureCoords),s=Q(this.draw.dotTexture1,e.textureCoords),o=e.thresholds0.subtract(i),a=e.thresholds1.subtract(s);let r;const u=Je.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),c=Je.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const d=K(new n(0),o),p=K(new n(0),a),m=ht(d,o).add(ht(p,a)),f=K(m,new n(0)),x=new n(1).subtract(f),h=m.add(f),y=o.multiply(d).divide(h),b=a.multiply(p).divide(h),g=u.multiply(y).add(c.multiply(b));r=x.multiply(g)}else{const d=xe(Ht(o),Ht(a)),p=K(d,new n(0)),m=new n(1).subtract(p),f=K(d,o),x=K(d,a),h=u.multiply(f).add(c.multiply(x));r=m.multiply(h)}return t.glFragColor=r,t}hittest(e){return ot(this.hittestRequest)}};l([Ce],Me.prototype,"blending",void 0),l([V(Ze)],Me.prototype,"instance",void 0),l([V(Te)],Me.prototype,"draw",void 0),l([D(0,F(Ci))],Me.prototype,"vertex",null),l([D(0,F(Oe))],Me.prototype,"fragment",null);const eo={pos:{count:2,type:te.UNSIGNED_SHORT}};let to=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=X,i=X,s=new tt(t,i);s.samplingMode=ge.NEAREST,s.wrapMode=bt.CLAMP_TO_EDGE;const o=new Ls(e,new _i(zi.DEPTH_STENCIL,t,i));this._dotFBO=new Ti(e,s,o)}return this._dotFBO}getDotDensityMesh(e,t){if(this._dotMesh==null){const i=X,s=i*i,o=2,a=new Int16Array(s*o);for(let r=0;rSi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let po=class{destroy(){this._accumulateFramebuffer=Kt(this._accumulateFramebuffer),this._resolveGradientTexture=Kt(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=uo(e,co());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==Ue.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,i){if(this._accumulateFramebuffer==null){const{dataType:s,samplingMode:o,pixelFormat:a,internalFormat:r}=this.loadQualityProfile(e),u=new tt(t,i);u.pixelFormat=a,u.internalFormat=r,u.dataType=s,u.samplingMode=o,u.wrapMode=bt.CLAMP_TO_EDGE;const c=new _i(zi.DEPTH_STENCIL,t,i);this._accumulateFramebuffer=new Ti(e,u,c)}else{const{width:s,height:o}=this._accumulateFramebuffer;s===t&&o===i||this._accumulateFramebuffer.resize(t,i)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,i){if(this._resolveGradientTexture==null){const s=new tt;s.wrapMode=bt.CLAMP_TO_EDGE,this._resolveGradientTexture=new Mi(e,s)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(i.length/4,1),this._resolveGradientTexture.setData(i),this._prevGradientHash=t);return this._resolveGradientTexture}};function Ri(e){return e?.25:1}let Ii=class extends He{};l([w(5,v)],Ii.prototype,"offset",void 0);let mo=class extends Oe{},zt=class extends fe{};l([V(n)],zt.prototype,"radius",void 0),l([V(n)],zt.prototype,"isFieldActive",void 0);class Le extends Ge{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(t){const{radius:i,isFieldActive:s}=this.kernelControls,o=t.offset,a=s.multiply(this.storage.getVVData(t.id).x).add(new n(1).subtract(s)),r=this.view.displayViewScreenMat3.multiply(new A(t.pos,1)).add(this.view.displayViewMat3.multiply(new A(o,0)).multiply(i)),u=this.clip(t.id);return{glPosition:new S(r.xy,u,1),offset:o,fieldValue:a,color:new S(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:i,fieldValue:s}=t,o=vi(i),a=K(o,new n(1)),r=new n(1).subtract(o.multiply(o)),u=r.multiply(r),c=a.multiply(u).multiply(s).multiply(new n(Ri(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new S(c),t)}hittest(t){const{viewMat3:i,tileMat3:s}=this.view,o=i.multiply(s).multiply(new A(t.pos,1));return Qi(o.xy,this.kernelControls.radius,this.hittestRequest.position)}}l([Ce],Le.prototype,"usesHalfFloatPrecision",void 0),l([V(zt)],Le.prototype,"kernelControls",void 0),l([D(0,F(Ii))],Le.prototype,"vertex",null),l([D(0,F(mo))],Le.prototype,"fragment",null);let Oi=class extends hi{};l([w(0,v)],Oi.prototype,"position",void 0);let fo=class extends bs{},Ye=class extends fe{};l([V(j)],Ye.prototype,"texture",void 0),l([V(v)],Ye.prototype,"minAndInvRange",void 0),l([V(n)],Ye.prototype,"normalization",void 0);let Fi=class extends fe{};l([V(j)],Fi.prototype,"texture",void 0);let Pe=class extends yi{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new S(e.position.multiply(2).subtract(1),1,1),uv:e.position}}fragment(e){const{accumulatedDensity:t,gradient:i}=this;let s=Q(t.texture,e.uv).r.divide(new n(Ri(this.usesHalfFloatPrecision)));s=s.multiply(t.normalization),s=s.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const o=Q(i.texture,new v(s,.5)),a=new kt;return a.glFragColor=new S(o.rgb.multiply(o.a),o.a),a}};l([Ce],Pe.prototype,"usesHalfFloatPrecision",void 0),l([V(Ye)],Pe.prototype,"accumulatedDensity",void 0),l([V(Fi)],Pe.prototype,"gradient",void 0),l([D(0,F(Oi))],Pe.prototype,"vertex",null),l([D(0,F(fo))],Pe.prototype,"fragment",null);let ho=class extends q{constructor(){super(...arguments),this.type=G.Heatmap,this.drawPhase=ue.MAP|ue.HITTEST|ue.DEBUG,this.shaders={accumulate:new Le,resolve:new Pe},this._isBound=!1,this._resources=new Map}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:i,painter:s,state:o}=e,a=t.instance.getInput(),{isFieldActive:r}=a.uniforms,u=this._getOrCreateResourcesRecord(i),c=u.loadQualityProfile(i);k(e)||this._bind(e,u,a),s.setShader({shader:this.shaders.accumulate,uniforms:{...$(e,t.target),kernelControls:{radius:si(a,o),isFieldActive:r?1:0}},defines:{...N(e),...c.defines},optionalAttributes:{},useComputeBuffer:k(e)});const d=k(e)?vo:Ei;s.setPipelineState(d),s.submitDraw(e,t)}getStencilReference(e){return Di(e)}renderResolvePass(e,t){if(k(e))return;const{context:i,painter:s}=e,o=this._resources.get(i);if(this._prevFBO==null||this._prevViewport==null||!o?.initialized)return;const{defines:a}=o.loadQualityProfile(i),{minDensity:r,maxDensity:u,radius:c}=t.getInput().uniforms,d=8,p=9,m=o.accumulateFramebuffer,f=o.resolveGradientTexture,x={shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:d,texture:m.colorTexture},minAndInvRange:[r,1/(u-r)],normalization:3/(c*c*Math.PI)},gradient:{texture:{unit:p,texture:f}}},defines:a,optionalAttributes:{},useComputeBuffer:!1};i.bindFramebuffer(this._prevFBO),i.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),i.bindTexture(m.colorTexture,d),i.bindTexture(f,p),s.setPipelineState(bo),s.submitDrawMesh(i,x,s.quadMesh),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new po,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,i){if(this._isBound)return;const{context:s,state:o,pixelRatio:a}=e,r=s.getBoundFramebufferObject(),u=s.getViewport();this._prevFBO=r,this._prevViewport=u;const{gradient:c,gradientHash:d}=i.uniforms;t.ensureResolveGradientTexture(s,d,c);const{width:p,height:m}=u,f=yo(si(i,o),a),x=p*f,h=m*f,y=t.ensureAccumulateFBO(s,x,h);s.blitFramebuffer(r,y,0,0,r.width,r.height,0,0,y.width,y.height,vt.STENCIL,ge.NEAREST),s.bindFramebuffer(y),s.setViewport(0,0,y.width,y.height),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.clear(vt.COLOR),this._isBound=!0}};function yo(e,t){const i=t>1.5?.25:.5;return e<1/(2*i)?1:i}function Di(e){return e.key.level+1}const Ei={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:Di,compare:Fs.GEQUAL,mask:255,op:{fail:ct.KEEP,zFail:ct.KEEP,zPass:ct.REPLACE}}}},vo={...Ei,stencil:!1},bo={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function si(e,t){const{referenceScale:i,radius:s}=e.uniforms;return s*(i!==0?i/t.scale:1)}const xo=360/254;var W;(function(e){e[e.Color=0]="Color",e[e.Outline=1]="Outline",e[e.Halo=2]="Halo"})(W||(W={}));let ee=class extends He{};l([w(3,S)],ee.prototype,"color",void 0),l([w(4,v)],ee.prototype,"offset",void 0),l([w(5,v)],ee.prototype,"textureUV",void 0),l([w(6,n)],ee.prototype,"fontSize",void 0),l([w(7,n)],ee.prototype,"referenceSize",void 0),l([w(8,S)],ee.prototype,"outlineColor",void 0),l([w(9,S)],ee.prototype,"haloColor",void 0),l([w(10,v)],ee.prototype,"outlineAndHaloSize",void 0),l([w(11,v)],ee.prototype,"zoomRange",void 0),l([w(12,n)],ee.prototype,"clipAngle",void 0),l([w(13,S)],ee.prototype,"referenceSymbol",void 0);let _t=class extends Ct{};l([w(14,v)],_t.prototype,"offsetNextVertex1",void 0),l([w(15,v)],_t.prototype,"offsetNextVertex2",void 0);let go=class extends Oe{},U=class extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=W.Color,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,i){const s=t.multiply(xo),o=At(this.view.rotation.subtract(s)),a=yt(new n(360).subtract(o),o);let r=new n(0);const u=Ji(this.view.currentZoom.multiply(Qt)).divide(Qt),c=e.x,d=e.y,p=new n(1).subtract(K(c,u)).multiply(2),m=K(new n(90),a).multiply(2),f=new n(2).multiply(new n(1).subtract(K(u,d)));return r=r.add(i.multiply(p)),r=r.add(i.multiply(m)),r=r.add(f),r}vertex(e,t){const i=Z(e.bitset,ps),s=new n(1).subtract(i);let o=e.fontSize,a=o.divide(Gt);const r=this.textRenderPassType===W.Outline?e.outlineColor:this.textRenderPassType===W.Halo?e.haloColor:this._getVertexColor(e),u=this.isLabel?this.storage.getLabelVisibility(e.id):new n(1),c=this.isLabel?r.multiply(u):r,d=this.view.displayViewScreenMat3.multiply(new A(e.pos,1));let p=e.offset,m=new n(1),f=B.identity(),x=new v(0);if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const _=e.referenceSymbol,T=_.xy,M=_.z,z=this._unpackDirection(_.w),R=et(this,e.id,M).divide(2),Se=z.multiply(R.add(Is));x=T.add(Se),p=p.add(x)}else m=et(this,e.id,e.referenceSize).divide(e.referenceSize),o=o.multiply(m),a=a.multiply(m),p=p.multiply(m),f=gi(this,e.id),p=f.multiply(new A(p,0)).xy;const h=Z(e.bitset,ds),y=this._getViewRotationMatrix(h).multiply(new A(p,0));let b=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,h):this.clip(e.id,e.zoomRange);b=this.isBackgroundPass?b.add(s.multiply(2)):b.add(i.multiply(2));const g=this.isLabel?ci(Ie(b,new n(1)),me(u,new n(0))):new ft(!1),P=new S(d.xy.add(y.xy),b,1),I=e.textureUV.divide(this.mosaicInfo.size);let C=new n(0);if(this.textRenderPassType===W.Outline&&(me(e.outlineAndHaloSize.x,new n(0))&&(b=b.add(new n(2))),C=new n(e.outlineAndHaloSize.x).divide(a).divide(qt)),this.textRenderPassType===W.Halo){const _=e.outlineAndHaloSize.x,T=new n(e.outlineAndHaloSize.y);me(T,new n(0))&&(b=b.add(new n(2))),C=T.add(_).divide(a).divide(qt)}return{glPosition:P,color:c,size:a,textureUV:I,antialiasingWidth:new n(.105*Gt).divide(o).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(e,t,{vvSizeAdjustment:m,vvRotation:f,labelOffset:x,labelClipped:g})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,s=new n(1).subtract(e);return t.multiply(e).add(i.multiply(s))}fragment(e){const t=new n(.25),i=new n(1).subtract(t),s=Q(this.mosaicInfo.texture,e.textureUV).a;let o=i.subtract(e.outlineDistanceOffset);this.highlight&&(o=o.divide(2));const a=e.antialiasingWidth,r=bi(o.subtract(a),o.add(a),s);return this.getFragmentOutput(e.color.multiply(r),e)}hittest(e,t,{vvSizeAdjustment:i,vvRotation:s,labelOffset:o,labelClipped:a}){let r,u,c;this.isLabel?(r=new A(e.offset.add(o),0),u=new A(t.offsetNextVertex1.add(o),0),c=new A(t.offsetNextVertex2.add(o),0)):(r=s.multiply(new A(e.offset.multiply(i),0)),u=s.multiply(new A(t.offsetNextVertex1.multiply(i),0)),c=s.multiply(new A(t.offsetNextVertex2.multiply(i),0)));const{viewMat3:d,tileMat3:p}=this.view,m=d.multiply(p).multiply(new A(e.pos,1)),f=m.add(p.multiply(r)).xy,x=m.add(p.multiply(u)).xy,h=m.add(p.multiply(c)).xy,y=Rt(this.hittestRequest.position,f.xy,x.xy,h.xy);return this.isLabel?Y(a,ot(this.hittestRequest),y):y}_unpackDirection(e){const t=new ut(e),i=es(t,new ut(2)),s=ts(t,new ut(3));return new v(new n(i).subtract(1),new n(s).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const i=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(i,e.color,new ft(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(e.id),s=this.visualVariableOpacity.getOpacity(i);t=t.multiply(s)}return t}};l([O(It)],U.prototype,"visualVariableColor",void 0),l([O(Ot)],U.prototype,"visualVariableOpacity",void 0),l([O(nt)],U.prototype,"visualVariableRotation",void 0),l([O(Ft)],U.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],U.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],U.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],U.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],U.prototype,"mosaicInfo",void 0),l([Ce],U.prototype,"textRenderPassType",void 0),l([Ce],U.prototype,"isBackgroundPass",void 0),l([Ce],U.prototype,"isLabel",void 0),l([D(0,F(ee)),D(1,F(_t))],U.prototype,"vertex",null),l([D(0,F(go))],U.prototype,"fragment",null);let wo=class extends q{constructor(){super(...arguments),this.type=G.Label,this.shaders={geometry:new U},this.drawPhase=ue.LABEL|ue.LABEL_ALPHA|ue.HITTEST,this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a={...H(e)},r=t.instance.getInput(),u={shader:this.shaders.geometry,uniforms:{...J(e,t.target,r.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!0,isLabel:!0},optionalAttributes:r.optionalAttributes,useComputeBuffer:k(e)};s.setShader(u),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Halo,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t)}},So=class extends q{constructor(){super(...arguments),this.type=G.Line,this.shaders={geometry:new wi},this.symbologyPlane=we.LINE}render(e,t){const{painter:i,pixelRatio:s}=e,o=t.instance.getInput();i.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),antialiasingControls:qe(s)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),i.setPipelineState(H(e)),i.submitDraw(e,t)}};class Ae extends is{}l([w(9,n)],Ae.prototype,"accumulatedDistance",void 0),l([w(10,v)],Ae.prototype,"segmentDirection",void 0),l([w(11,n)],Ae.prototype,"offsetAlongLine",void 0),l([w(12,n)],Ae.prototype,"capType",void 0),l([w(13,S)],Ae.prototype,"tlbr",void 0);class Tt extends wi{_getDistanceRatio(t,i){const s=Z(t.bitset,ms);return s.multiply(xe(i,new n(.25)).multiply(new n(2))).add(new n(1).subtract(s).multiply(be(1)))}_getSDFAlpha(t){const{halfWidth:i,normal:s,tlbr:o,patternSize:a,accumulatedDistance:r,offsetAlongLine:u,dashToPx:c,capType:d}=t,p=a.x.divide(ks).multiply(c),m=Wt(r.add(u).divide(p)),f=Re(o.xy,o.zw,new v(m,.5)),x=Pt(Q(this.mosaicInfo.texture,f)).multiply(2).subtract(1).multiply(Bs).multiply(c),h=s.y.multiply(i),y=Mt([me(d,new n(1)),x.subtract(i)],[me(d,new n(2)),ss(os(xe(x,new n(0)),new n(2)).add(h.multiply(h))).subtract(i)],[!0,x]),b=$e(new n(.25).subtract(y),new n(0),new n(1));return new S(b)}_getPatternColor(t){const{halfWidth:i,normal:s,color:o,accumulatedDistance:a,patternSize:r,sampleAlphaOnly:u,tlbr:c}=t,d=r.y.multiply(new n(2).multiply(i).divide(r.x)),p=Wt(a.divide(d)),m=new n(.5).multiply(s.y).add(new n(.5)),f=Re(c.xy,c.zw,new v(m,p));let x=Q(this.mosaicInfo.texture,f);return this.visualVariableColor!=null&&(x=Y(Ie(u,new n(.5)),new S(o.a),o)),x}vertex(t,i){const{segmentDirection:s,tlbr:o,bitset:a}=t,r=as(this,t),u=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(ht(s,r.scaledOffset)),c=new v(o.z.subtract(o.x),o.w.subtract(o.y)),d=o.divide(this.mosaicInfo.size.xyxy),p=Z(a,fs),m=Z(a,hs),f=Y(Ie(p,new n(.5)),this._getDistanceRatio(t,r.scaledHalfWidth),new n(1));return{...r,tlbr:d,patternSize:c,accumulatedDistance:u,isSDF:p,sampleAlphaOnly:m,dashToPx:f,offsetAlongLine:t.offsetAlongLine,capType:t.capType,...this.maybeRunHittest(t,i,r.halfWidth)}}fragment(t){const{color:i,opacity:s,isSDF:o}=t,a=rs(t,this.antialiasingControls.blur),r=Y(Ie(o,new n(.5)),this._getSDFAlpha(t),this._getPatternColor(t)),u=i.multiply(s).multiply(a).multiply(r);return this.getFragmentOutput(u,t)}}l([V(at)],Tt.prototype,"mosaicInfo",void 0),l([D(0,F(Ae)),D(1,F(ys))],Tt.prototype,"vertex",null);let Vo=class extends q{constructor(){super(...arguments),this.type=G.TexturedLine,this.shaders={geometry:new Tt},this.symbologyPlane=we.LINE}render(e,t){const{context:i,painter:s,pixelRatio:o}=e,a=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),antialiasingControls:qe(o),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...N(e)},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}};class de extends He{}l([w(3,S)],de.prototype,"color",void 0),l([w(4,S)],de.prototype,"outlineColor",void 0),l([w(5,v)],de.prototype,"offset",void 0),l([w(6,v)],de.prototype,"textureUV",void 0),l([w(7,S)],de.prototype,"sizing",void 0),l([w(8,n)],de.prototype,"placementAngle",void 0),l([w(9,n)],de.prototype,"sdfDecodeCoeff",void 0),l([w(10,v)],de.prototype,"zoomRange",void 0);class ke extends Ct{}l([w(12,v)],ke.prototype,"offsetNextVertex1",void 0),l([w(13,v)],ke.prototype,"offsetNextVertex2",void 0),l([w(14,v)],ke.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],ke.prototype,"textureUVNextVertex2",void 0);class zo extends Oe{}function pe(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}function pt(e){return e.multiply(e).divide(128)}class se extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,i){const s=pt(t.sizing.x),o=pt(t.sizing.y),a=pt(t.sizing.z),r=t.placementAngle,u=Z(t.bitset,le.bitset.isSDF),c=Z(t.bitset,le.bitset.isMapAligned),d=Z(t.bitset,le.bitset.scaleSymbolsProportionally),p=pi(t.bitset,le.bitset.colorLocked),m=di(this,t.id),f=ui(this,t.id,t.color,p).multiply(m),x=this.view.displayViewScreenMat3.multiply(new A(t.pos.xy,1)),h=et(this,t.id,a).divide(a),y=s.multiply(h),b=t.offset.xy.multiply(h);let g=o.multiply(d.multiply(h.subtract(1)).add(1));g=yt(g,xe(y.subtract(.99),new n(0)));const P=xe(g,new n(1)),I=yt(g,new n(1)),C=B.fromRotation(r.multiply(li)),_=gi(this,t.id),T=this._getViewRotationMatrix(c).multiply(_).multiply(C).multiply(new A(b.xy,0)),M=this.clip(t.id,t.zoomRange),z=new S(x.xy.add(T.xy),M,1),R=t.textureUV.divide(this.mosaicInfo.size),Se=t.outlineColor.multiply(I),Hi=Z(t.bitset,le.bitset.overrideOutlineColor),$t=t.sdfDecodeCoeff.multiply(y);return{glPosition:z,color:f,textureUV:R,outlineColor:Se,outlineSize:P,distanceToPx:$t,isSDF:u,overrideOutlineColor:Hi,...this.maybeRunHittest(t,i,{pos:t.pos,size:y,sizeCorrection:h,isMapAligned:c,vvRotationMat3:_,placementMat3:C,outlineSize:P,distanceToPx:$t,isSDF:u})}}fragment(t){const i=this._getColor(t.textureUV,t);return this.getFragmentOutput(i,t)}hittest(t,i,s){return Y(mi(s.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,i,s),this._hittestMarker(t,i,s))}_getViewRotationMatrix(t){const i=this.view.displayViewMat3,s=this.view.displayMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getViewScreenMatrix(t){const i=this.view.viewMat3.multiply(this.view.tileMat3),s=this.view.tileMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a);let u=i.outlineSize;this.highlight&&(u=xe(u,i.overrideOutlineColor.multiply(4)));const c=u.multiply(.5),d=At(o).subtract(c),p=$e(new n(.5).subtract(d),new n(0),new n(1)),m=Re(i.outlineColor,i.color,i.overrideOutlineColor).multiply(p);return new n(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,i,s){const{position:o,distance:a,smallSymbolDistance:r}=this.hittestRequest,u=a.subtract(r),{viewMat3:c,tileMat3:d}=this.view,p=c.multiply(d).multiply(new A(s.pos,1)).xy,m=s.size.multiply(.5);return fi(p,o).subtract(m).add(u)}_hittestMarker(t,i,s){const{pos:o,sizeCorrection:a,isMapAligned:r}=s,u=new A(t.offset.multiply(a),0),c=new A(i.offsetNextVertex1.multiply(a),0),d=new A(i.offsetNextVertex2.multiply(a),0),{viewMat3:p,tileMat3:m}=this.view,f=p.multiply(m).multiply(new A(o,1)),x=this._getViewScreenMatrix(r).multiply(s.vvRotationMat3).multiply(s.placementMat3),h=f.add(x.multiply(u)).xy,y=f.add(x.multiply(c)).xy,b=f.add(x.multiply(d)).xy,g=this.hittestRequest.position,P=this.hittestRequest.distance,I=Rt(g,h,y,b);return Y(Ie(I,P),I,this._hittestSamples(h,y,b,t,i,s))}_hittestSamples(t,i,s,o,a,r){const{outlineSize:u,isSDF:c,distanceToPx:d}=r,p=this.hittestRequest.position,m=this.hittestRequest.distance,f=E(p.add(new v(ie(m),ie(m))),t,i,s),x=E(p.add(new v(0,ie(m))),t,i,s),h=E(p.add(new v(m,ie(m))),t,i,s),y=E(p.add(new v(ie(m),0)),t,i,s),b=E(p,t,i,s),g=E(p.add(new v(m,0)),t,i,s),P=E(p.add(new v(ie(m),m)),t,i,s),I=E(p.add(new v(0,m)),t,i,s),C=E(p.add(new v(m,m)),t,i,s),_=o.textureUV.divide(this.mosaicInfo.size),T=a.textureUVNextVertex1.divide(this.mosaicInfo.size),M=a.textureUVNextVertex2.divide(this.mosaicInfo.size),z={color:new S(1),outlineColor:new S(1),overrideOutlineColor:new n(1),outlineSize:u,distanceToPx:d,isSDF:c};let R=new n(0);return R=R.add(L(f).multiply(this._getColor(pe(f,_,T,M),z).a)),R=R.add(L(x).multiply(this._getColor(pe(x,_,T,M),z).a)),R=R.add(L(h).multiply(this._getColor(pe(h,_,T,M),z).a)),R=R.add(L(y).multiply(this._getColor(pe(y,_,T,M),z).a)),R=R.add(L(b).multiply(this._getColor(pe(b,_,T,M),z).a)),R=R.add(L(g).multiply(this._getColor(pe(g,_,T,M),z).a)),R=R.add(L(P).multiply(this._getColor(pe(P,_,T,M),z).a)),R=R.add(L(I).multiply(this._getColor(pe(I,_,T,M),z).a)),R=R.add(L(C).multiply(this._getColor(pe(C,_,T,M),z).a)),K(R,new n(.05)).multiply(ot(this.hittestRequest))}}l([O(It)],se.prototype,"visualVariableColor",void 0),l([O(Ot)],se.prototype,"visualVariableOpacity",void 0),l([O(nt)],se.prototype,"visualVariableRotation",void 0),l([O(Ft)],se.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],se.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],se.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],se.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],se.prototype,"mosaicInfo",void 0),l([D(0,F(de)),D(1,F(ke))],se.prototype,"vertex",null),l([D(0,F(zo))],se.prototype,"fragment",null);let _o=class extends q{constructor(){super(...arguments),this.type=G.Marker,this.shaders={geometry:new se},this.symbologyPlane=we.MARKER}render(e,t){const{context:i,painter:s}=e,o=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}},To=class{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([s,o])=>`${s}.${o}`).join("."),i=zs(t);this._locationInfo={hash:i,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,i]of this.locationsMap.entries())e.set("a_"+t,i);return e}getShaderKey(e,t,i){return`${Object.keys(e).map(s=>`${s}.${e[s]}`).join(".")}.${Object.keys(i).filter(s=>i[s]).map(s=>`${s}_${i[s].toString()}`).join(".")}.${Object.keys(t).filter(s=>this.optionPropertyKeys.has(s)).join(".")}`}getProgram(e,t,i,s){let o="",a="";for(const r in i)if(i[r]){const u=typeof i[r]=="boolean"?`#define ${r} +`:`#define ${r} ${i[r]} +`;o+=u,a+=u}return o+=this.vertexShader,a+=this.fragmentShader,new xs(o,a,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(t),this._transformFeedbackBindings)}_getUniformBindings(e){const t=[];for(const i in this.required){const s=this.required[i];t.push({uniformHydrated:null,shaderModulePath:i,uniformName:i,uniformType:s.type,uniformArrayElementType:oi(s),uniformArrayLength:ai(s)})}for(const i in e){const s=this.options[i];if(e[i])for(const o in s){const a=s[o];t.push({uniformHydrated:null,shaderModulePath:`${i}.${o}`,uniformName:o,uniformType:a.type,uniformArrayElementType:oi(a),uniformArrayLength:ai(a)})}}return t}};const oi=e=>e.type==="array"?e.elementType?.type:void 0,ai=e=>e.type==="array"?e.size:void 0,Mo={hittestDist:n,hittestPos:v},Po={filterFlags:j,animation:j,visualVariableData:j,dataDriven0:j,dataDriven1:j,dataDriven2:j,gpgpu:j,size:n},Ao={displayViewScreenMat3:B,displayViewMat3:B,displayMat3:B,viewMat3:B,tileMat3:B,displayZoomFactor:n,requiredZoomFactor:n,tileOffset:v,currentScale:n,currentZoom:n,metersPerSRUnit:n};let Co=class extends To{constructor(){super(...arguments),this.vertexShader=ii("materials/pie/pie.vert"),this.fragmentShader=ii("materials/pie/pie.frag"),this.required={...Po,...Ao,outlineWidth:n,colors:ne,defaultColor:S,othersColor:S,outlineColor:S,donutRatio:n,sectorThreshold:n},this.options={hittestUniforms:Mo,visualVariableSizeMinMaxValue:{minMaxValueAndSize:S},visualVariableSizeScaleStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:n},visualVariableOpacity:{opacities:{...ne.ofType(n,8),type:"array",elementType:n,size:8},opacityValues:{...ne.ofType(n,8),type:"array",elementType:n,size:8}}},this.locations={pos:{index:0,type:v},id:{index:1,type:A},bitset:{index:2,type:n},offset:{index:3,type:v},texCoords:{index:4,type:v},size:{index:5,type:v},referenceSize:{index:6,type:n},zoomRange:{index:7,type:v}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...ne.ofType(S,e),type:"array",elementType:S,size:e}}},Ro=class extends q{constructor(){super(...arguments),this.type=G.PieChart,this.shaders={geometry:new Co},this.symbologyPlane=we.MARKER}render(e,t){const{painter:i}=e,{instance:s,target:o}=t,a=this.shaders.geometry,r=s.getInput(),u=r.uniforms.numberOfFields,c=k(e),d=$(e,o),p=N(e);a.setNumberOfFields(u),i.setShader({shader:a,uniforms:{...J(e,t.target,r.uniforms.shader),...d.storage,...d.view,hittestUniforms:d.hittestRequest?{hittestDist:d.hittestRequest?.distance,hittestPos:d.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!r.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!r.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!r.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!r.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!r.uniforms.shader.visualVariableOpacity,HITTEST:c,highlight:d.highlight?1:0,...p,numberOfFields:u},optionalAttributes:{},useComputeBuffer:c}),i.setPipelineState(H(e)),i.submitDraw(e,t)}},Io=class extends q{constructor(){super(...arguments),this.type=G.Text,this.shaders={geometry:new U},this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a=t.instance.getInput(),r={shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,isBackgroundPass:!0,isLabel:!1,textRenderPassType:W.Color},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)};s.setShader(r),s.setPipelineState(H(e)),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Halo}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Outline}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Color}}),s.submitDraw(e,t)}};const ae={fill:new ao,patternFill:new no,complexFill:new so,outlineFill:new ro,patternOutlineFill:new lo,complexOutlineFill:new oo,marker:new _o,pieChart:new Ro,line:new So,texturedLine:new Vo,text:new Io,label:new wo,heatmap:new ho,dotDensity:new io,animatedMarker:new Ys};function Ea(){for(const e in ae)ae[e].startup()}function La(e){for(const t in ae)ae[t].shutdown(e)}function it(e,t){const i=e.slice(0,t),s=t-i.length;for(let o=0;oSi.getLogger("esri.views.2d.layers.features.support.rendererUtils");function Bi(e){return e.map(t=>Fo(t)?Do(t.clone()):t)}function Fo(e){return(e.type==="size"||e.type==="color"||e.type==="opacity")&&e.stops!=null}function Do(e){return e.stops=ko(e.type,e.stops??[]),e}function ze(e,t,i){return(1-i)*e+i*t}function Eo(e,t){const[i,...s]=t,o=s.pop(),a=s[0].value,r=s[s.length-1].value,u=(r-a)/Li,c=[];for(let d=a;d=s[p].value;)p++;const m=s[p],f=t[p-1],x=d-f.value,h=m.value===f.value?1:x/(m.value-f.value);if(e==="color"){const y=s[p],b=t[p-1],g=y.color.clone();g.r=ze(b.color.r,g.r,h),g.g=ze(b.color.g,g.g,h),g.b=ze(b.color.b,g.b,h),g.a=ze(b.color.a,g.a,h),c.push({value:d,color:g,label:y.label})}else if(e==="size"){const y=s[p],b=t[p-1],g=Xt(y.size),P=ze(Xt(b.size),g,h);c.push({value:d,size:P,label:y.label})}else{const y=s[p],b=ze(t[p-1].opacity,y.opacity,h);c.push({value:d,opacity:b,label:y.label})}}return[i,...c,o]}function Lo(e){const[t,...i]=e,s=i.pop();for(;i.length>Li;){let o=0,a=0;for(let r=1;ra&&(a=d,o=r)}i.splice(o,1)}return[t,...i,s]}function ko(e,t){return t.length<=Qe?t:(ki().warn(`Found ${t.length} Visual Variable stops, but MapView only supports ${Qe}. Displayed stops will be simplified.`),t.length>2*Qe?Eo(e,t):Lo(t))}function Bo(){const{supportsColorBufferFloat:e,supportsColorBufferFloatBlend:t,supportsColorBufferHalfFloat:i}=Bt();return e&&t||i}function ka(e){if(!e)return!0;switch(e.type){case"dot-density":break;case"heatmap":if(!Bo()){const t=Bt(),i=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(s=>!t[s]).join(", ");return ki().errorOnce(new Ke("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${i}`)),!1}}return!0}const No=1.25,je=128,$o=128;function Uo(e){if(!e.stops?.length)return null;const t=e.stops.sort((a,r)=>a.value-r.value),i=it(t,8),s=i.map(({value:a})=>a),o=i.map(({color:a})=>Oo(a));return{values:s,colors:o}}function Ho(e){if(!e.stops?.length)return null;const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{opacityValues:i.map(({value:s})=>s),opacities:i.map(({opacity:s})=>s)}}function Go(e){return{rotationType:e.rotationType==="geographic"?mt.Geographic:mt.Arithmatic}}function dt(e){if(!e.stops?.length)return null;if(e.stops.some(s=>s.useMaxValue||s.useMinValue))return(s,o)=>{const a=s.statisticsByLevel.get(o.key.level),r=e.stops.map(c=>({value:c.useMaxValue?a?.get(e.field)?.maxValue??0:c.useMinValue?a?.get(e.field)?.minValue??0:c.value,size:c.size?be(c.size):Os})).sort((c,d)=>c.value-d.value),u=it(r,8);return{values:u.map(({value:c})=>c),sizes:u.map(({size:c})=>c)}};const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{values:i.map(({value:s})=>s),sizes:i.map(({size:s})=>be(s))}}function qo(e){return t=>{const{state:i}=t;return{unitValueToPixelsRatio:Ts(i.spatialReference)/Ns[e.valueUnit??"meters"]/i.resolution}}}function ri(e,t){const i=t.length;if(e{const u=a.state.scale,c=be(ri(u,s.stops)),d=be(ri(u,o.stops));return{minMaxValueAndSize:[t,i,c,d]}};if(typeof s=="object"||typeof o=="object")throw new Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[t,i,be(s),be(o)]}}const st={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};function Ni(e,t=$o,i=No){if(e.visualVariableSizeMinMaxValue)return e.visualVariableSizeMinMaxValue instanceof Function?je:Math.max(e.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*i,t);if(e.visualVariableSizeScaleStops){if(e.visualVariableSizeScaleStops instanceof Function)return je;const s=e.visualVariableSizeScaleStops.sizes;return Math.max(s[s.length-1]*i,t)}if(e.visualVariableSizeStops){if(e.visualVariableSizeStops instanceof Function)return je;const s=e.visualVariableSizeStops.sizes;return Math.max(s[s.length-1]*i,t)}return e.visualVariableSizeUnitValue?2*je:0}function Ba(e){const t={...st};if(!e||!("visualVariables"in e)||!e.visualVariables)return t;for(const i of Bi(e.visualVariables))switch(i.type){case"color":t.visualVariableColor=Uo(i);break;case"opacity":t.visualVariableOpacity=Ho(i);break;case"rotation":t.visualVariableRotation=Go(i);break;case"size":switch(jo(i)){case"field-stops":t.visualVariableSizeStops=dt(i);break;case"scale-stops":i.target==="outline"?t.visualVariableSizeOutlineScaleStops=dt(i):t.visualVariableSizeScaleStops=dt(i);break;case"min-max":t.visualVariableSizeMinMaxValue=Wo(i);break;case"unit-value":t.visualVariableSizeUnitValue=qo(i)}break}return t}function jo(e){return typeof e.minDataValue=="number"&&typeof e.maxDataValue=="number"&&e.minSize!=null&&e.maxSize!=null?"min-max":e?.valueExpression==="$view.scale"&&Array.isArray(e.stops)?"scale-stops":e.field==null&&e?.valueExpression==="$view.scale"||!(Array.isArray(e.stops)||"levels"in e&&e.levels)?e.field!=null||e?.valueExpression!=="$view.scale"?"unit-value":null:"field-stops"}function Ko(e){return!!(e.visualVariableSizeMinMaxValue||e.visualVariableSizeScaleStops||e.visualVariableSizeStops||e.visualVariableSizeUnitValue||e.visualVariableSizeOutlineScaleStops)}function Na(e){return!!e.visualVariableRotation}function Xo(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function oe(e){if(e==null)return null;if(Array.isArray(e)){const[t,i,s,o]=e;return[t,i,s,255*o]}return typeof e=="string"?e:{...e,defaultValue:oe(e?.defaultValue)}}async function $a(e,t){const{cimResourceManager:i,cimAnalyzer:s,scaleExpression:o}=t.schemaOptions;await Promise.all(vs.fetchResources(e.symbol,i,[]));const a=s.analyzeSymbolReference(e,!1),r={scaleInfo:Xo(e),scaleExpression:o},u=[];for(const c of a)switch(c.type){case"marker":u.push(...Zo(c,t,r));break;case"fill":u.push(...ta(c,t,r));break;case"line":u.push(...sa(c,t,r));break;case"text":u.push(...ra(c,t,r))}return u}function Zo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,visualVariableRotation:s.visualVariableRotation};return e.animationParams?Yo(a.ensureInstance(ae.animatedMarker,{uniforms:r,optionalAttributes:{zoomRange:!0}}),e,st,i):Qo(a.ensureInstance(ae.marker,{uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s,i)}function Yo(e,t,i,s){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,sprite:t.spriteRasterizationParam,animations:t.animationParams,scaleInfo:s.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===ws.MAP,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,referenceSize:t.referenceSize,angleToLine:!!t.markerPlacement&&t.markerPlacement.placement&&"angleToLine"in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine,sizeRatio:t.sizeRatio})]:[]}function Qo(e,t,i,{scaleInfo:s,scaleExpression:o}){const a=Ko(i);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:oe(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:s,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||gs.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:o??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:a,placement:t.markerPlacement,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:Ni(i)})]}function Jo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ea(a.ensureInstance(ae.fill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function ea(e,t,{scaleInfo:i}){return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],scaleInfo:i,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function ta(e,t,i){if(!e.spriteRasterizationParam)return Jo(e,t,i);const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ia(a.ensureInstance(ae.complexFill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s.visualVariableColor!=null,i)}function ia(e,t,i,{scaleInfo:s}){if(!t.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const o=!!t.hasUnresolvedReplacementColor&&(!i||t.colorLocked),a=t.sampleAlphaOnly&&!o,r=t.spriteRasterizationParam;return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:a,scaleProportionally:r.resource.type==="CIMHatchFill",sprite:r,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function sa(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},u={uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}},c=!!(r.visualVariableSizeMinMaxValue||r.visualVariableSizeScaleStops||r.visualVariableSizeStops||r.visualVariableSizeUnitValue);return e.spriteRasterizationParam?aa(a.ensureInstance(ae.texturedLine,u),e,c,i):oa(a.ensureInstance(ae.line,u),e,c,i)}function $i(e,t,{scaleInfo:i}){return{color:oe(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:t,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function oa(e,t,i,s){if(t.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const o=$i(t,i,s);return[e.createMeshInfo(o)]}function aa(e,t,i,s){const{spriteRasterizationParam:o,scaleDash:a,sampleAlphaOnly:r}=t;if(!o)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...$i(t,i,s),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:r,isSDF:o.resource.type!=="CIMPictureStroke",sprite:o})]}function ra(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return na(a.ensureInstance(ae.text,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableRotation:s.visualVariableRotation,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1}}),e,s,i)}function na(e,t,i,{scaleInfo:s,scaleExpression:o}){return[e.createMeshInfo({boxBackgroundColor:oe(t.backgroundColor),boxBorderLineColor:oe(t.borderLineColor),boxBorderLineSize:t.borderLineWidth??0,color:oe(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:oe(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??"center",verticalAlignment:t.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:o??1,minPixelBuffer:Ni(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ua(e,t){return{type:"simple",filters:t,capabilities:{maxTextureSize:Bt().maxTextureSize},bindings:la(e)}}function lt(e){switch(e){case"opacity":return We.OPACITY;case"color":return We.COLOR;case"rotation":return We.ROTATION;case"size":return We.SIZE;default:return null}}function la(e){if(!e)return[];switch(e.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return Ui(e);case"dot-density":return ua(e);case"pie-chart":return ca(e);case"heatmap":return pa(e)}}function ua(e){const t=[];for(const i of e.attributes)t.push({binding:t.length,expression:i.valueExpression,field:i.field});return t}function ca(e){const t=Ui(e);let i=4;for(const s of e.attributes)t.push({binding:i++,expression:s.valueExpression,field:s.field});return t}function pa({valueExpression:e,field:t}){return e||t?[{binding:0,expression:e,field:t}]:[]}function Ui(e){return!("visualVariables"in e)||!e.visualVariables?.length?[]:Bi(e.visualVariables).map(t=>ya(t)).filter(_s)}function da(e){return e.valueExpression==="$view.scale"?null:{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression,valueRepresentation:e.valueRepresentation}}function ma(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function fa(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function ha(e){return{binding:lt(e.type),expression:e.valueExpression,field:e.field}}function ya(e){switch(e.type){case"size":return da(e);case"color":return ma(e);case"opacity":return fa(e);case"rotation":return ha(e)}}class Ha{constructor(t){this.updateTracking=new ns({debugName:"FeatureCommandQueue"}),this._queueProcessor=new $s({concurrency:1,process:t.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(t){return Ss(this.updateTracking.addPromise(this._doPush(t)))}async _doPush(t){const i=this._queueProcessor,s=i.last();switch(t.type){case"update":case"highlight":return s?.type===t.type?void 0:i.push(t);case"edit-by-id":case"edit-by-feature":return i.push(t)}}}export{La as $,oa as J,Qo as K,js as M,Ni as N,qs as P,ka as Q,Gs as T,Ui as U,st as W,Yo as X,ia as Y,ea as Z,Ha as _,na as a,Oo as b,Ko as c,aa as e,Ua as h,Xo as j,Na as l,ae as o,Ea as q,Ba as r,Da as s,Nt as t,$a as u}; diff --git a/main/assets/FeatureEffect-CDEk9Es7-CW8HxX_m.js b/main/assets/FeatureEffect-CDEk9Es7-CW8HxX_m.js new file mode 100644 index 000000000..4715852d1 --- /dev/null +++ b/main/assets/FeatureEffect-CDEk9Es7-CW8HxX_m.js @@ -0,0 +1 @@ +import{v as i,S as o,el as c,i as b,e as y,o as f}from"./main-C7yV2j71.js";import{l as u,p as d}from"./jsonUtils-wIllKWI4-DRJhEzZa.js";import m from"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";var a;const p={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},w={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},h={name:"showExcludedLabels",default:!0};let t=a=class extends y{constructor(r){super(r),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(r,e){const l=super.write(r,e);if(e?.origin){if(l.filter){const s=Object.keys(l.filter);if(s.length>1||s[0]!=="where")return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in l)return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return l}clone(){return new a({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};i([o({type:m,json:{write:{allowNull:!0,writer(r,e,l,s){const n=r?.write({},s);n&&Object.keys(n).length!==0?c(l,n,e):c(l,null,e)}}}})],t.prototype,"filter",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":p,"portal-item":p}}})],t.prototype,"includedEffect",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":w,"portal-item":w}}})],t.prototype,"excludedEffect",void 0),i([o({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":h,"portal-item":h}}})],t.prototype,"excludedLabelsVisible",void 0),t=a=i([b("esri.layers.support.FeatureEffect")],t);const g=t;export{g as x}; diff --git a/main/assets/FeatureEffect-CDEk9Es7-DK_N6ZYk.js b/main/assets/FeatureEffect-CDEk9Es7-DK_N6ZYk.js deleted file mode 100644 index 78fdbf0ec..000000000 --- a/main/assets/FeatureEffect-CDEk9Es7-DK_N6ZYk.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as o,el as c,i as b,e as y,o as f}from"./main-BZaw9FpY.js";import{l as u,p as d}from"./jsonUtils-wIllKWI4-DQ36DuUP.js";import m from"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";var a;const p={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},w={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},h={name:"showExcludedLabels",default:!0};let t=a=class extends y{constructor(r){super(r),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(r,e){const l=super.write(r,e);if(e?.origin){if(l.filter){const s=Object.keys(l.filter);if(s.length>1||s[0]!=="where")return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in l)return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return l}clone(){return new a({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};i([o({type:m,json:{write:{allowNull:!0,writer(r,e,l,s){const n=r?.write({},s);n&&Object.keys(n).length!==0?c(l,n,e):c(l,null,e)}}}})],t.prototype,"filter",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":p,"portal-item":p}}})],t.prototype,"includedEffect",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":w,"portal-item":w}}})],t.prototype,"excludedEffect",void 0),i([o({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":h,"portal-item":h}}})],t.prototype,"excludedLabelsVisible",void 0),t=a=i([b("esri.layers.support.FeatureEffect")],t);const g=t;export{g as x}; diff --git a/main/assets/FeatureEffectLayer-Cro89IEC-BBkfzwg3.js b/main/assets/FeatureEffectLayer-Cro89IEC-BBkfzwg3.js deleted file mode 100644 index bd8342ae4..000000000 --- a/main/assets/FeatureEffectLayer-Cro89IEC-BBkfzwg3.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as s,i}from"./main-BZaw9FpY.js";import{x as a}from"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";const r={write:{allowNull:!0}},l={type:a,json:{origins:{"web-map":r,"portal-item":r}}},p=o=>{let e=class extends o{constructor(){super(...arguments),this.featureEffect=null}};return t([s(l)],e.prototype,"featureEffect",void 0),e=t([i("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p as l,l as s}; diff --git a/main/assets/FeatureEffectLayer-Cro89IEC-BTHxGcqL.js b/main/assets/FeatureEffectLayer-Cro89IEC-BTHxGcqL.js new file mode 100644 index 000000000..f4c5bf0fa --- /dev/null +++ b/main/assets/FeatureEffectLayer-Cro89IEC-BTHxGcqL.js @@ -0,0 +1 @@ +import{v as t,S as s,i}from"./main-C7yV2j71.js";import{x as a}from"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";const r={write:{allowNull:!0}},l={type:a,json:{origins:{"web-map":r,"portal-item":r}}},p=o=>{let e=class extends o{constructor(){super(...arguments),this.featureEffect=null}};return t([s(l)],e.prototype,"featureEffect",void 0),e=t([i("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p as l,l as s}; diff --git a/main/assets/FeatureFilter-BCFHgLVU-BSMrX0wh.js b/main/assets/FeatureFilter-BCFHgLVU-BSMrX0wh.js deleted file mode 100644 index c04ed006f..000000000 --- a/main/assets/FeatureFilter-BCFHgLVU-BSMrX0wh.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as y,v as i,S as s,af as R,i as w,e as S,P as r}from"./main-BZaw9FpY.js";import{b as v}from"./Query-BrwMGK8U-sojFdYaD.js";import{k as j}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";var m;const c=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=m=class extends S{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:n,geometry:o,spatialRelationship:a,timeExtent:l,objectIds:p,units:u,distance:h}=this;return new v({geometry:r(o),objectIds:r(p),spatialRelationship:a,timeExtent:r(l),where:n,units:u,distance:h,...t})}clone(){const{where:t,geometry:n,spatialRelationship:o,timeExtent:a,objectIds:l,units:p,distance:u}=this;return new m({geometry:r(n),objectIds:r(l),spatialRelationship:o,timeExtent:r(a),where:t,units:p,distance:u})}};i([s({type:String,json:{write:!0}})],e.prototype,"where",void 0),i([s({types:R,json:{write:!0}})],e.prototype,"geometry",void 0),i([s({type:c.apiValues,json:{name:"spatialRel",read:{reader:c.read},write:{allowNull:!1,writer:c.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],e.prototype,"spatialRelationship",void 0),i([s({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"distance",void 0),i([s({type:[Number],json:{write:!0}})],e.prototype,"objectIds",void 0),i([s({type:d.apiValues,json:{read:d.read,write:{writer:d.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"units",void 0),i([s({type:j,json:{write:!0}})],e.prototype,"timeExtent",void 0),e=m=i([w("esri.layers.support.FeatureFilter")],e);const U=e;export{U as default}; diff --git a/main/assets/FeatureFilter-BCFHgLVU-DU6FY8I7.js b/main/assets/FeatureFilter-BCFHgLVU-DU6FY8I7.js new file mode 100644 index 000000000..9aae19f62 --- /dev/null +++ b/main/assets/FeatureFilter-BCFHgLVU-DU6FY8I7.js @@ -0,0 +1 @@ +import{aK as y,v as i,S as s,af as R,i as w,e as S,P as r}from"./main-C7yV2j71.js";import{b as v}from"./Query-BrwMGK8U-DV_czrJX.js";import{k as j}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";var m;const c=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=m=class extends S{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:n,geometry:o,spatialRelationship:a,timeExtent:l,objectIds:p,units:u,distance:h}=this;return new v({geometry:r(o),objectIds:r(p),spatialRelationship:a,timeExtent:r(l),where:n,units:u,distance:h,...t})}clone(){const{where:t,geometry:n,spatialRelationship:o,timeExtent:a,objectIds:l,units:p,distance:u}=this;return new m({geometry:r(n),objectIds:r(l),spatialRelationship:o,timeExtent:r(a),where:t,units:p,distance:u})}};i([s({type:String,json:{write:!0}})],e.prototype,"where",void 0),i([s({types:R,json:{write:!0}})],e.prototype,"geometry",void 0),i([s({type:c.apiValues,json:{name:"spatialRel",read:{reader:c.read},write:{allowNull:!1,writer:c.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],e.prototype,"spatialRelationship",void 0),i([s({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"distance",void 0),i([s({type:[Number],json:{write:!0}})],e.prototype,"objectIds",void 0),i([s({type:d.apiValues,json:{read:d.read,write:{writer:d.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"units",void 0),i([s({type:j,json:{write:!0}})],e.prototype,"timeExtent",void 0),e=m=i([w("esri.layers.support.FeatureFilter")],e);const U=e;export{U as default}; diff --git a/main/assets/FeatureLayer-BrRKw5Si-CHreUEJ9.js b/main/assets/FeatureLayer-BrRKw5Si-CHreUEJ9.js deleted file mode 100644 index def36fabd..000000000 --- a/main/assets/FeatureLayer-BrRKw5Si-CHreUEJ9.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-DR3CjbQa.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./utils-BVWK2jiA-Ewzf326n.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./jsonContext-BA8GHqVk-BMETb6sX.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./fetchService-DbaKmJhP-CtznRt8p.js","./FeatureLayerSource-k4WMYop1-BFDYORV0.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js","./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-MFWeclAP.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-B7P01ZzU.js","./mat4-DX7gBViE-CQMXDC3Z.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Bk09s2KF.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-Bz3XNCt8.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./clientSideDefaults-BqqayPct-BMC57bnT.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-CU-oJwb3.js","./Query-BrwMGK8U-sojFdYaD.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./executeForIds-Z1gkLduF-Daa1fnES.js","./query-DFW9-NG_-1nHUNdNu.js","./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js","./pbf-D-y3_eZO-BOjQwfR-.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./executeQueryPBF-o8010HS9-dWp8mQx-.js","./featureConversionUtils-D6hFQ4Af-CkdezteH.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./executeQueryJSON-CcHnccia-DVecwfbV.js","./featureLayerUtils-DgfQQyK4-D6z7j0IK.js","./jsonUtils-C64Zfu7c-trwRB9M4.js","./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js","./RendererLegendOptions-K3md58-X-B6y5tQg5.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./colorRamps-q0bZVhs2-Bqen3nIx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./styleUtils-BtpNqZyT-B-RFL3S3.js","./LRUCache-C3erQTWv-CeYLuvL9.js","./Version-CoKzbupV-BxOJQpf3.js","./FieldsIndex-HmzMbJQG-CiA2Ur00.js","./UnknownTimeZone-C--TOcPG-hkNbcn35.js","./OverrideHelper-DWRbVlj1-C2SNS5Gu.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-DpAlEmQT.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-72T4gbed.js","./heatmapUtils-seiMkkkR-D9lAE87R.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./editsZScale-BDsX6vv--CeDyYvz6.js","./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js","./BinsQuery-DjwQZqB8-T-ydjXwz.js","./queryUtils-Brxu6254-DDAvXp_C.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{aB as W,at as H,ag as j,o as m,n as K,l as Z,K as z,a1 as F,ek as R,v as o,ea as B,bi as $,bG as U,S as n,i as E,aa as Y,J as X,bp as ee,_ as b,W as te,b0 as re,el as I,a as ie,bX as P,bT as x,a_ as oe,bV as se,f as ae,em as ne,a0 as y,en as le,ac as D,P as O,bD as ue,bL as pe,ad as de,j as ye}from"./main-BZaw9FpY.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{o as ce,m as he,u as me}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as fe}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{i as ge,e as be,Y as we,s as G,K as _e,_ as ve,r as Te,X as Se,V as Fe}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{$ as Ie,H as Ee}from"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import{D as De}from"./Layer-ChoECxvZ-C4wLrCej.js";import{q as Oe}from"./workers-PiCjreoO-oGzLvkSt.js";import{c as Le}from"./editsZScale-BDsX6vv--CeDyYvz6.js";import{n as A}from"./queryZScale-BiYV6Pr6-ci22dEZj.js";import{O as V}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{n as Ce}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as qe}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as je}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as Me}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{C as Re}from"./EditBusLayer-Df29OyJh-C36maE2j.js";import{l as $e}from"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import{v as Pe}from"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import{E as xe}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{p as Ge}from"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import{C as Ae}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as Je}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as Ne}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as Ve}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{I as ke,i as Qe,o as We}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{c as He,l as Ke,n as Ze,r as ze,p as Be,Q as Ue,$ as Ye,U as Xe,Z as et,t as tt,_ as rt,z as it,f as ot,s as st,o as at,i as nt,B as lt,H as ut,K as pt,X as dt,W as yt,Y as ct,m as ht,e as mt,k as J}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{p as k}from"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import{y as Q}from"./FeatureType-C9hJmS6_-pVJc0p7X.js";import{f as ft}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{C as gt,q as L}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{x as bt}from"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import{w as wt}from"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import{a as _t}from"./versionUtils-LZYZz-38-xZnsxhiL.js";import{b as vt,K as Tt}from"./Query-BrwMGK8U-sojFdYaD.js";import{g as St}from"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import{w as Ft}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{o as It}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{E as T}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";let Et=0,f=class extends W.LoadableMixin(H(j)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);A(e,this.layer.spatialReference,r);const i=V.fromJSON(r);if(!this._requiresClientGraphicMapping())return i;const a=this.layer.objectIdField;for(const l of i.features){const u=l.attributes[a],p=this._idToClientGraphic.get(u);p&&(l.geometry=p.geometry)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new m("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return A(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(r=>({count:r.count,extent:K.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new m("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const i=[],a=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=d=>"objectId"in d&&d.objectId!=null?d.objectId:"attributes"in d&&d.attributes[t]!=null?d.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const d of e.deleteFeatures){const g=l(d);g!=null&&i.push(g)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const d of e.updateFeatures)if(a.push(this._serializeFeature(d)),u){const g=l(d);g!=null&&u.set(g,d)}}Le(r?r.features:null,a,this.layer.spatialReference);const{fullExtent:p,featureEditResults:h}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:a,deletes:i});return this.fullExtent=p,r&&r.finish(h.uidToObjectId),this._updateClientGraphicIds(u,h),this._createEditsResult(h)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:i}of e)i==null||i.type!=="mesh"||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const i=e.get(r.objectId);i!=null&&this._addIdToClientGraphic(i)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let l=0;l{F.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),_.preventDefault()}));const g={features:d.features,fields:t?.map(_=>_.toJSON()),geometryType:R.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&a,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:i,spatialReference:h?null:r&&r.toJSON(),timeInfo:u?.toJSON()??null,dateFieldsTimeZone:p},w=await this._connection.invoke("load",g,{signal:e});for(const _ of w.warnings)F.getLogger(this.layer).warn("#load()",`${_.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:_});w.featureErrors.length&&F.getLogger(this.layer).warn("#load()",`Encountered ${w.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:w.featureErrors});const M=w.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(M.geometryType=R.toJSON(d.inferredGeometryType)),this.sourceJSON=M,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),d.finish(w.assignedObjectIds)}};o([B({Type:$,ensureType:U($)})],f.prototype,"itemType",void 0),o([n()],f.prototype,"type",void 0),o([n({constructOnly:!0})],f.prototype,"layer",void 0),o([n({readOnly:!0})],f.prototype,"_workerGeometryType",null),o([n()],f.prototype,"sourceJSON",void 0),f=o([E("esri.layers.graphics.sources.MemorySource")],f);let v=class extends ye{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};o([n()],v.prototype,"updating",void 0),o([n()],v.prototype,"status",void 0),v=o([E("esri.layers.support.PublishingInfo")],v);const Dt=v,Ot=Symbol(),Lt=e=>{var t;let r=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const a=new Dt;return this._checkPublishingStatus(a),a}_checkPublishingStatus(i){let a=0;const l=async p=>{let h;i.updating=!0;try{h=await this.fetchPublishingStatus()}catch{h="unavailable"}h!=="published"&&h!=="unavailable"||(i.status==="publishing"&&this.refresh(),u.remove()),i.status=h,i.updating=!1,u.removed||(a=setTimeout(l,p,p+125))},u={removed:!1,remove(){this.removed=!0,clearTimeout(a)}};this.when().catch(()=>u.remove()),l(250),this.addHandles(u)}};return t=Ot,o([n({readOnly:!0,clonable:!1})],r.prototype,"publishingInfo",null),r=o([E("esri.layers.mixins.PublishableLayer")],r),r},c="FeatureLayer";function S(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function N(e){return e&&e instanceof j}const C=ft();function q(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let s=class extends Ie(Pe($e(Lt(Re(je(Ge(Ve(Ne(Je(qe(xe(Ae(fe(Me(Ce(Y(De))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=X.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ee(async(t,r,i)=>{const{save:a,saveAs:l}=await b(()=>import("./featureLayerUtils-BlPdhYbm-DR3CjbQa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(t){case T.SAVE:return a(this,r);case T.SAVE_AS:return l(this,i,r)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(i=>this.initLayerProperties(i))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(te).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const i=await this._fetchFirstValidLayerId(t);i!=null&&(this.layerId=i)}if(!this.url&&!this._hasMemorySource())throw new m("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>He(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}warnInvisibleDrapedSymbols(){this.elevationInfo?.mode==="on-the-ground"&&this.renderer?.type==="simple"&&this.renderer.symbol?.type==="polygon-3d"&&this.renderer.symbol.symbolLayers.some(e=>e.type==="fill"&&e.material!=null&&(!e.material.color||e.material.color.a*this.opacityk.fromJSON(l)),this._fixTemplates(e,i),this._fixTemplates(e,a),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const a=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?ke(this.url,r):r;let l=r;if(!l&&this.url){const u=Qe(this.url);u!=null&&(l=u.title)}return l?(this.sublayerTitleMode==="item-title-and-service-name"&&a&&a!==l&&(l=a+" - "+l),We(l)):void 0}if(this.sublayerTitleMode==="item-title"&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(a=>a.name.toLowerCase()===r);i&&(r=i.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,a=r?.editorField;return e?.map(l=>(l=Q.fromJSON(l),this._fixTemplates(l.templates,i),this._fixTemplates(l.templates,a),l))}readVisible(e,t){return t.layerDefinition?.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){const r=await Ue(this,e,t,c);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await Ye(this,e,t,r,c);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Xe(this,e,t)}async uploadAssets(e,t){return et(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Ft(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await oe(b(()=>import("./FeatureLayerSource-k4WMYop1-BFDYORV0.js"),__vite__mapDeps([14,1,2,15,16,17,18,19,20,21,9,10,22,23,24,25,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,52,53,12,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=tt(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=se(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await rt(this,e,t,c);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return it(this,e,c)}getFeatureType(e){return ot(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=!!this.subtypes?.length;if(i&&!t?.excludeImpliedDomains){const p=st(this,e);if(p)return p}const a=i&&at(this,r);if(a){const p=a?.domains?.[e];return p?.type==="inherited"?this._getLayerDomain(e):p}const l=this.getFeatureType(r),u=this._getLayerDomain(e);if(l){const p=l.domains&&l.domains[e];if(p&&p?.type!=="inherited")return p}if(u)return u;if(!t?.excludeImpliedDomains){const p=nt(this,e);if(p)return p}return null}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return lt(this,e,t,c)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(vt.from(e)??r.createQuery(),t);if(i?.features)for(const a of i.features)a.layer=a.sourceLayer=r;return i}async queryObjectIds(e,t){return ut(this,e,t,c)}async queryFeatureCount(e,t){return pt(this,e,t,c)}async queryExtent(e,t){return dt(this,e,t,c)}async queryRelatedFeatures(e,t){return yt(this,e,t,c)}async queryRelatedFeaturesCount(e,t){return ct(this,e,t,c)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopFeatures capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js"),__vite__mapDeps([78,1,2,42]),import.meta.url),l=await r.queryTopFeatures(a.default.from(e),t);if(l?.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryBins||!i?.operations?.supportsQueryBins)throw new m(c,"Layer source does not support queryBins capability");ht(e,i,c);const a=await b(()=>import("./BinsQuery-DjwQZqB8-T-ydjXwz.js"),__vite__mapDeps([79,1,2,80,9,10,30,31,32,33,81,39,40,41,42]),import.meta.url),l=await r.queryBins(a.default.from(e),t);if(l.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopObjectIds capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js"),__vite__mapDeps([78,1,2,42]),import.meta.url);return r.queryTopObjectIds(a.default.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopExtents capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js"),__vite__mapDeps([78,1,2,42]),import.meta.url);return r.queryTopExtents(a.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryFeatureCount capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js"),__vite__mapDeps([78,1,2,42]),import.meta.url);return r.queryTopCount(a.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||e.type==="Feature Collection")&&(this.resourceInfo=e),r){const i=r.layers;i&&i.length===1&&(super.read(i[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:a}=t;if(this.dynamicDataSource)return a?.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((r==="web-map"||r==="web-scene")&&i!=="tables")return a?.push(S(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return a?.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(r==="web-map"||r==="web-scene")&&i==="tables")return a?.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new m(c,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&(this.source?.type==="memory"||_t(this,e))}async save(e){return this._debouncedSaveOperations(T.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&r?.origin==="web-map"&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const a=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",a,t),r&&!i?.writeLayerSchema&&(t.capabilities=a)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return ae(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return this.findFirstValidLayerId(r)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),x(this.renderer,this.fieldsIndex),ne(this.timeInfo,this.fieldsIndex),St(this,{origin:"service"})}async hasDataChanged(){return mt(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(r=>{const i=r.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new m("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new m("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};o([n(ge)],s.prototype,"attributeTableTemplate",void 0),o([y("service","capabilities")],s.prototype,"readCapabilities",null),o([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],s.prototype,"charts",void 0),o([n({readOnly:!0})],s.prototype,"createQueryVersion",null),o([n({json:{read:{source:"layerDefinition.copyrightText"}}})],s.prototype,"copyright",void 0),o([n({json:{read:{source:"layerDefinition.displayField"}}})],s.prototype,"displayField",void 0),o([n({types:le,readOnly:!0})],s.prototype,"defaultSymbol",void 0),o([n({type:Tt})],s.prototype,"dynamicDataSource",void 0),o([n({type:Boolean})],s.prototype,"editingEnabled",null),o([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],s.prototype,"readEditingEnabled",null),o([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],s.prototype,"readEditingEnabledFromWebMap",null),o([D(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabled",null),o([D("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabledToWebMap",null),o([n({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),o([n({...C.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:q}}}}})],s.prototype,"fields",void 0),o([n(C.fieldsIndex)],s.prototype,"fieldsIndex",void 0),o([n({type:Ee,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"formTemplate",void 0),o([n({json:{read:{source:"layerDefinition.extent"}}})],s.prototype,"fullExtent",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:q,writer(e,t,r){const i=e?J.toJSON(e):null;i&&I(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:J.read}}})],s.prototype,"geometryType",void 0),o([n({json:{read:{source:"layerDefinition.hasM"}}})],s.prototype,"hasM",void 0),o([n({json:{read:{source:"layerDefinition.hasZ"}}})],s.prototype,"hasZ",void 0),o([n(be)],s.prototype,"id",void 0),o([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"infoFor3D",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],s.prototype,"isTable",void 0),o([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],s.prototype,"readIsTable",null),o([D("web-map","isTable")],s.prototype,"writeIsTable",null),o([n(we)],s.prototype,"labelsVisible",void 0),o([n({type:[gt],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:L,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:{enabled:!0,layerContainerTypes:G}}},name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:!0}})],s.prototype,"labelingInfo",void 0),o([n((()=>{const e=O(_e);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,r,i){I(i,ue(t),r)}}},e})())],s.prototype,"opacity",void 0),o([n(ve)],s.prototype,"legendEnabled",void 0),o([n({type:["show","hide"],json:(()=>{const e=O(Te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],s.prototype,"listMode",void 0),o([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],s.prototype,"readGlobalIdField",null),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:q}}}}})],s.prototype,"objectIdField",void 0),o([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],s.prototype,"readObjectIdField",null),o([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],s.prototype,"operationalLayerType",void 0),o([n(C.outFields)],s.prototype,"outFields",void 0),o([n({readOnly:!0})],s.prototype,"parsedUrl",null),o([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([n(Se)],s.prototype,"popupEnabled",void 0),o([n({type:pe,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),o([n({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),o([n({types:he,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:me,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:G,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],s.prototype,"renderer",null),o([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],s.prototype,"readRenderer",null),o([n()],s.prototype,"resourceInfo",void 0),o([n((()=>{const e=O(Fe);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],s.prototype,"screenSizePerspectiveEnabled",void 0),o([n({clonable:!1})],s.prototype,"source",null),o([de("source")],s.prototype,"castSource",null),o([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],s.prototype,"readSource",null),o([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],s.prototype,"spatialReference",void 0),o([n({type:Number})],s.prototype,"subtypeCode",void 0),o([n({type:[k]})],s.prototype,"templates",void 0),o([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],s.prototype,"readTemplates",null),o([n({type:wt})],s.prototype,"timeInfo",void 0),o([n()],s.prototype,"title",void 0),o([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],s.prototype,"readTitle",null),o([y("web-map","title",["layerDefinition.name","title"])],s.prototype,"readTitleFromWebMap",null),o([n({type:String})],s.prototype,"sublayerTitleMode",void 0),o([n({json:{read:!1}})],s.prototype,"type",void 0),o([n({type:String})],s.prototype,"typeIdField",void 0),o([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],s.prototype,"readTypeIdField",null),o([n({type:[Q]})],s.prototype,"types",void 0),o([y("service","types",["types"]),y("types",["layerDefinition.types"])],s.prototype,"readTypes",null),o([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],s.prototype,"visible",void 0),o([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],s.prototype,"readVisible",null),s=o([E("esri.layers.FeatureLayer")],s);const oi=s;export{oi as default}; diff --git a/main/assets/FeatureLayer-BrRKw5Si-Rem12G_g.js b/main/assets/FeatureLayer-BrRKw5Si-Rem12G_g.js new file mode 100644 index 000000000..8f4d6333a --- /dev/null +++ b/main/assets/FeatureLayer-BrRKw5Si-Rem12G_g.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-DOSVCD4F.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./utils-BVWK2jiA-D8rVYIEJ.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./jsonContext-BA8GHqVk-DpBf0bCt.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./fetchService-DbaKmJhP-DPDp5i2e.js","./FeatureLayerSource-k4WMYop1-z-zJ1lao.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-Bzqlxz38.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-QYZk68_K.js","./mat4-DX7gBViE-vewreEuZ.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Dbd8ftOx.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-3W9GNLNT.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./clientSideDefaults-BqqayPct-B0cLE-po.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-CT1NKU1Q.js","./Query-BrwMGK8U-DV_czrJX.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./executeForIds-Z1gkLduF-BNBrXf-U.js","./query-DFW9-NG_-CfusC8cS.js","./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js","./pbf-D-y3_eZO-SEvl9j6c.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./executeQueryPBF-o8010HS9-E5WwNUPn.js","./featureConversionUtils-D6hFQ4Af-sYSorBK9.js","./FeatureSet-BkVNthuN-DDwR53LR.js","./executeQueryJSON-CcHnccia-CB1D7q08.js","./featureLayerUtils-DgfQQyK4-D0OGSvJx.js","./jsonUtils-C64Zfu7c-BqaK54UK.js","./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js","./RendererLegendOptions-K3md58-X-Bf90N-cx.js","./diffUtils-Cz3Fi8Xb-BvD0JNhD.js","./colorRamps-q0bZVhs2-DeDskCk_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-5umqHW84.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./styleUtils-BtpNqZyT-CwQxANzG.js","./LRUCache-C3erQTWv-DhyPlt5p.js","./Version-CoKzbupV-BKAqCewj.js","./FieldsIndex-HmzMbJQG-CzzKuIHi.js","./UnknownTimeZone-C--TOcPG-DfRfNtw8.js","./OverrideHelper-DWRbVlj1-D6dDt4cu.js","./colorUtils-Cthpxcks-CXgjba3p.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-Dl9Ps2XQ.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-1xSDkBxg.js","./heatmapUtils-seiMkkkR-BSMLb7yQ.js","./RelationshipQuery-DJsz3K0U-BHNd_b19.js","./editsZScale-BDsX6vv--CoeIQyxn.js","./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js","./BinsQuery-DjwQZqB8-CUCgQbor.js","./queryUtils-Brxu6254-T3UhaATW.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); +import{aB as W,at as H,ag as j,o as m,n as K,l as Z,K as z,a1 as F,ek as R,v as o,ea as B,bi as $,bG as U,S as n,i as E,aa as Y,J as X,bp as ee,_ as b,W as te,b0 as re,el as I,a as ie,bX as P,bT as x,a_ as oe,bV as se,f as ae,em as ne,a0 as y,en as le,ac as D,P as O,bD as ue,bL as pe,ad as de,j as ye}from"./main-C7yV2j71.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{o as ce,m as he,u as me}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{m as fe}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{i as ge,e as be,Y as we,s as G,K as _e,_ as ve,r as Te,X as Se,V as Fe}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{$ as Ie,H as Ee}from"./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js";import{D as De}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{q as Oe}from"./workers-PiCjreoO-DqI62TYf.js";import{c as Le}from"./editsZScale-BDsX6vv--CoeIQyxn.js";import{n as A}from"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import{O as V}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{n as Ce}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as qe}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as je}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as Me}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{C as Re}from"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import{l as $e}from"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import{v as Pe}from"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import{E as xe}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{p as Ge}from"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import{C as Ae}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as Je}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as Ne}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as Ve}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{I as ke,i as Qe,o as We}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{c as He,l as Ke,n as Ze,r as ze,p as Be,Q as Ue,$ as Ye,U as Xe,Z as et,t as tt,_ as rt,z as it,f as ot,s as st,o as at,i as nt,B as lt,H as ut,K as pt,X as dt,W as yt,Y as ct,m as ht,e as mt,k as J}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{p as k}from"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import{y as Q}from"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import{f as ft}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{C as gt,q as L}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{x as bt}from"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import{w as wt}from"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import{a as _t}from"./versionUtils-LZYZz-38-DgmFurh2.js";import{b as vt,K as Tt}from"./Query-BrwMGK8U-DV_czrJX.js";import{g as St}from"./styleUtils-ChrJTYIw-OCRItq_6.js";import{w as Ft}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{o as It}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{E as T}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";let Et=0,f=class extends W.LoadableMixin(H(j)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);A(e,this.layer.spatialReference,r);const i=V.fromJSON(r);if(!this._requiresClientGraphicMapping())return i;const a=this.layer.objectIdField;for(const l of i.features){const u=l.attributes[a],p=this._idToClientGraphic.get(u);p&&(l.geometry=p.geometry)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new m("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return A(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(r=>({count:r.count,extent:K.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new m("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const i=[],a=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=d=>"objectId"in d&&d.objectId!=null?d.objectId:"attributes"in d&&d.attributes[t]!=null?d.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const d of e.deleteFeatures){const g=l(d);g!=null&&i.push(g)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const d of e.updateFeatures)if(a.push(this._serializeFeature(d)),u){const g=l(d);g!=null&&u.set(g,d)}}Le(r?r.features:null,a,this.layer.spatialReference);const{fullExtent:p,featureEditResults:h}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:a,deletes:i});return this.fullExtent=p,r&&r.finish(h.uidToObjectId),this._updateClientGraphicIds(u,h),this._createEditsResult(h)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:i}of e)i==null||i.type!=="mesh"||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const i=e.get(r.objectId);i!=null&&this._addIdToClientGraphic(i)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let l=0;l{F.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),_.preventDefault()}));const g={features:d.features,fields:t?.map(_=>_.toJSON()),geometryType:R.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&a,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:i,spatialReference:h?null:r&&r.toJSON(),timeInfo:u?.toJSON()??null,dateFieldsTimeZone:p},w=await this._connection.invoke("load",g,{signal:e});for(const _ of w.warnings)F.getLogger(this.layer).warn("#load()",`${_.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:_});w.featureErrors.length&&F.getLogger(this.layer).warn("#load()",`Encountered ${w.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:w.featureErrors});const M=w.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(M.geometryType=R.toJSON(d.inferredGeometryType)),this.sourceJSON=M,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),d.finish(w.assignedObjectIds)}};o([B({Type:$,ensureType:U($)})],f.prototype,"itemType",void 0),o([n()],f.prototype,"type",void 0),o([n({constructOnly:!0})],f.prototype,"layer",void 0),o([n({readOnly:!0})],f.prototype,"_workerGeometryType",null),o([n()],f.prototype,"sourceJSON",void 0),f=o([E("esri.layers.graphics.sources.MemorySource")],f);let v=class extends ye{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};o([n()],v.prototype,"updating",void 0),o([n()],v.prototype,"status",void 0),v=o([E("esri.layers.support.PublishingInfo")],v);const Dt=v,Ot=Symbol(),Lt=e=>{var t;let r=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const a=new Dt;return this._checkPublishingStatus(a),a}_checkPublishingStatus(i){let a=0;const l=async p=>{let h;i.updating=!0;try{h=await this.fetchPublishingStatus()}catch{h="unavailable"}h!=="published"&&h!=="unavailable"||(i.status==="publishing"&&this.refresh(),u.remove()),i.status=h,i.updating=!1,u.removed||(a=setTimeout(l,p,p+125))},u={removed:!1,remove(){this.removed=!0,clearTimeout(a)}};this.when().catch(()=>u.remove()),l(250),this.addHandles(u)}};return t=Ot,o([n({readOnly:!0,clonable:!1})],r.prototype,"publishingInfo",null),r=o([E("esri.layers.mixins.PublishableLayer")],r),r},c="FeatureLayer";function S(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function N(e){return e&&e instanceof j}const C=ft();function q(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let s=class extends Ie(Pe($e(Lt(Re(je(Ge(Ve(Ne(Je(qe(xe(Ae(fe(Me(Ce(Y(De))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=X.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ee(async(t,r,i)=>{const{save:a,saveAs:l}=await b(()=>import("./featureLayerUtils-BlPdhYbm-DOSVCD4F.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(t){case T.SAVE:return a(this,r);case T.SAVE_AS:return l(this,i,r)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(i=>this.initLayerProperties(i))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(te).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const i=await this._fetchFirstValidLayerId(t);i!=null&&(this.layerId=i)}if(!this.url&&!this._hasMemorySource())throw new m("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>He(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}warnInvisibleDrapedSymbols(){this.elevationInfo?.mode==="on-the-ground"&&this.renderer?.type==="simple"&&this.renderer.symbol?.type==="polygon-3d"&&this.renderer.symbol.symbolLayers.some(e=>e.type==="fill"&&e.material!=null&&(!e.material.color||e.material.color.a*this.opacityk.fromJSON(l)),this._fixTemplates(e,i),this._fixTemplates(e,a),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const a=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?ke(this.url,r):r;let l=r;if(!l&&this.url){const u=Qe(this.url);u!=null&&(l=u.title)}return l?(this.sublayerTitleMode==="item-title-and-service-name"&&a&&a!==l&&(l=a+" - "+l),We(l)):void 0}if(this.sublayerTitleMode==="item-title"&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(a=>a.name.toLowerCase()===r);i&&(r=i.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,a=r?.editorField;return e?.map(l=>(l=Q.fromJSON(l),this._fixTemplates(l.templates,i),this._fixTemplates(l.templates,a),l))}readVisible(e,t){return t.layerDefinition?.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){const r=await Ue(this,e,t,c);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await Ye(this,e,t,r,c);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Xe(this,e,t)}async uploadAssets(e,t){return et(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Ft(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await oe(b(()=>import("./FeatureLayerSource-k4WMYop1-z-zJ1lao.js"),__vite__mapDeps([14,1,2,15,16,17,18,19,20,21,9,10,22,23,24,25,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,52,53,12,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=tt(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=se(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await rt(this,e,t,c);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return it(this,e,c)}getFeatureType(e){return ot(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=!!this.subtypes?.length;if(i&&!t?.excludeImpliedDomains){const p=st(this,e);if(p)return p}const a=i&&at(this,r);if(a){const p=a?.domains?.[e];return p?.type==="inherited"?this._getLayerDomain(e):p}const l=this.getFeatureType(r),u=this._getLayerDomain(e);if(l){const p=l.domains&&l.domains[e];if(p&&p?.type!=="inherited")return p}if(u)return u;if(!t?.excludeImpliedDomains){const p=nt(this,e);if(p)return p}return null}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return lt(this,e,t,c)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(vt.from(e)??r.createQuery(),t);if(i?.features)for(const a of i.features)a.layer=a.sourceLayer=r;return i}async queryObjectIds(e,t){return ut(this,e,t,c)}async queryFeatureCount(e,t){return pt(this,e,t,c)}async queryExtent(e,t){return dt(this,e,t,c)}async queryRelatedFeatures(e,t){return yt(this,e,t,c)}async queryRelatedFeaturesCount(e,t){return ct(this,e,t,c)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopFeatures capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js"),__vite__mapDeps([78,1,2,42]),import.meta.url),l=await r.queryTopFeatures(a.default.from(e),t);if(l?.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryBins||!i?.operations?.supportsQueryBins)throw new m(c,"Layer source does not support queryBins capability");ht(e,i,c);const a=await b(()=>import("./BinsQuery-DjwQZqB8-CUCgQbor.js"),__vite__mapDeps([79,1,2,80,9,10,30,31,32,33,81,39,40,41,42]),import.meta.url),l=await r.queryBins(a.default.from(e),t);if(l.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopObjectIds capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js"),__vite__mapDeps([78,1,2,42]),import.meta.url);return r.queryTopObjectIds(a.default.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopExtents capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js"),__vite__mapDeps([78,1,2,42]),import.meta.url);return r.queryTopExtents(a.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryFeatureCount capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js"),__vite__mapDeps([78,1,2,42]),import.meta.url);return r.queryTopCount(a.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||e.type==="Feature Collection")&&(this.resourceInfo=e),r){const i=r.layers;i&&i.length===1&&(super.read(i[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:a}=t;if(this.dynamicDataSource)return a?.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((r==="web-map"||r==="web-scene")&&i!=="tables")return a?.push(S(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return a?.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(r==="web-map"||r==="web-scene")&&i==="tables")return a?.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new m(c,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&(this.source?.type==="memory"||_t(this,e))}async save(e){return this._debouncedSaveOperations(T.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&r?.origin==="web-map"&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const a=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",a,t),r&&!i?.writeLayerSchema&&(t.capabilities=a)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return ae(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return this.findFirstValidLayerId(r)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),x(this.renderer,this.fieldsIndex),ne(this.timeInfo,this.fieldsIndex),St(this,{origin:"service"})}async hasDataChanged(){return mt(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(r=>{const i=r.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new m("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new m("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};o([n(ge)],s.prototype,"attributeTableTemplate",void 0),o([y("service","capabilities")],s.prototype,"readCapabilities",null),o([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],s.prototype,"charts",void 0),o([n({readOnly:!0})],s.prototype,"createQueryVersion",null),o([n({json:{read:{source:"layerDefinition.copyrightText"}}})],s.prototype,"copyright",void 0),o([n({json:{read:{source:"layerDefinition.displayField"}}})],s.prototype,"displayField",void 0),o([n({types:le,readOnly:!0})],s.prototype,"defaultSymbol",void 0),o([n({type:Tt})],s.prototype,"dynamicDataSource",void 0),o([n({type:Boolean})],s.prototype,"editingEnabled",null),o([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],s.prototype,"readEditingEnabled",null),o([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],s.prototype,"readEditingEnabledFromWebMap",null),o([D(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabled",null),o([D("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabledToWebMap",null),o([n({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),o([n({...C.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:q}}}}})],s.prototype,"fields",void 0),o([n(C.fieldsIndex)],s.prototype,"fieldsIndex",void 0),o([n({type:Ee,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"formTemplate",void 0),o([n({json:{read:{source:"layerDefinition.extent"}}})],s.prototype,"fullExtent",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:q,writer(e,t,r){const i=e?J.toJSON(e):null;i&&I(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:J.read}}})],s.prototype,"geometryType",void 0),o([n({json:{read:{source:"layerDefinition.hasM"}}})],s.prototype,"hasM",void 0),o([n({json:{read:{source:"layerDefinition.hasZ"}}})],s.prototype,"hasZ",void 0),o([n(be)],s.prototype,"id",void 0),o([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"infoFor3D",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],s.prototype,"isTable",void 0),o([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],s.prototype,"readIsTable",null),o([D("web-map","isTable")],s.prototype,"writeIsTable",null),o([n(we)],s.prototype,"labelsVisible",void 0),o([n({type:[gt],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:L,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:{enabled:!0,layerContainerTypes:G}}},name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:!0}})],s.prototype,"labelingInfo",void 0),o([n((()=>{const e=O(_e);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,r,i){I(i,ue(t),r)}}},e})())],s.prototype,"opacity",void 0),o([n(ve)],s.prototype,"legendEnabled",void 0),o([n({type:["show","hide"],json:(()=>{const e=O(Te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],s.prototype,"listMode",void 0),o([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],s.prototype,"readGlobalIdField",null),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:q}}}}})],s.prototype,"objectIdField",void 0),o([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],s.prototype,"readObjectIdField",null),o([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],s.prototype,"operationalLayerType",void 0),o([n(C.outFields)],s.prototype,"outFields",void 0),o([n({readOnly:!0})],s.prototype,"parsedUrl",null),o([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([n(Se)],s.prototype,"popupEnabled",void 0),o([n({type:pe,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),o([n({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),o([n({types:he,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:me,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:G,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],s.prototype,"renderer",null),o([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],s.prototype,"readRenderer",null),o([n()],s.prototype,"resourceInfo",void 0),o([n((()=>{const e=O(Fe);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],s.prototype,"screenSizePerspectiveEnabled",void 0),o([n({clonable:!1})],s.prototype,"source",null),o([de("source")],s.prototype,"castSource",null),o([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],s.prototype,"readSource",null),o([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],s.prototype,"spatialReference",void 0),o([n({type:Number})],s.prototype,"subtypeCode",void 0),o([n({type:[k]})],s.prototype,"templates",void 0),o([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],s.prototype,"readTemplates",null),o([n({type:wt})],s.prototype,"timeInfo",void 0),o([n()],s.prototype,"title",void 0),o([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],s.prototype,"readTitle",null),o([y("web-map","title",["layerDefinition.name","title"])],s.prototype,"readTitleFromWebMap",null),o([n({type:String})],s.prototype,"sublayerTitleMode",void 0),o([n({json:{read:!1}})],s.prototype,"type",void 0),o([n({type:String})],s.prototype,"typeIdField",void 0),o([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],s.prototype,"readTypeIdField",null),o([n({type:[Q]})],s.prototype,"types",void 0),o([y("service","types",["types"]),y("types",["layerDefinition.types"])],s.prototype,"readTypes",null),o([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],s.prototype,"visible",void 0),o([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],s.prototype,"readVisible",null),s=o([E("esri.layers.FeatureLayer")],s);const oi=s;export{oi as default}; diff --git a/main/assets/FeatureLayerBase-vvYyZTfh-CZhAh2L8.js b/main/assets/FeatureLayerBase-vvYyZTfh-CZhAh2L8.js new file mode 100644 index 000000000..ee07a0403 --- /dev/null +++ b/main/assets/FeatureLayerBase-vvYyZTfh-CZhAh2L8.js @@ -0,0 +1 @@ +import{v as e,S as i,i as p,aa as P,e as S,ad as Se,a0 as l,ac as a,eG as tt,bQ as re,bI as it,bH as ot,P as C,n as nt,ag as Fe,J as Te,dL as st,ey as Oe,eH as Pe,eI as Me,eJ as Re,eK as rt,a1 as pt,d3 as Ze}from"./main-C7yV2j71.js";import{n as lt,i as ze}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{$ as at,s as ut,n as dt,t as yt,Z as ct}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{M as mt}from"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import{x as ht,T as vt}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{k as xt,d as ft,O as X,n as wt,r as gt,a as bt}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{v as jt}from"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import{p as It}from"./Relationship-PyhUibYK-DuMEI2S9.js";import{x as St}from"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";var pe;let T=pe=class extends S{constructor(t){super(t),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new pe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};e([i({type:String,json:{write:!0}})],T.prototype,"expression",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"name",void 0),e([i({type:["boolean","date","number","string"],json:{write:!0}})],T.prototype,"returnType",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"title",void 0),T=pe=e([p("esri.form.ExpressionInfo")],T);const Et=T;let O=class extends S{constructor(t){super(t),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};e([i({type:String,json:{write:!0}})],O.prototype,"description",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"label",void 0),e([i()],O.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"visibilityExpression",void 0),O=e([p("esri.form.elements.Element")],O);const M=O;let Z=class extends P(S){constructor(t){super(t),this.type=null}};e([i()],Z.prototype,"type",void 0),Z=e([p("esri.form.elements.inputs.attachments.Input")],Z);const F=Z,K=["any","capture","upload"];let D=class extends F{constructor(t){super(t),this.type="audio",this.inputMethod="any",this.maxDuration=null}};e([i({type:["audio"],readOnly:!0,json:{write:!0}})],D.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],D.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],D.prototype,"maxDuration",void 0),D=e([p("esri.form.elements.inputs.attachments.AudioInput")],D);const De=D;let $=class extends F{constructor(t){super(t),this.type="document",this.maxFileSize=null}};e([i({type:["document"],readOnly:!0,json:{write:!0}})],$.prototype,"type",void 0),e([i({type:Number,json:{write:!0}})],$.prototype,"maxFileSize",void 0),$=e([p("esri.form.elements.inputs.attachments.DocumentInput")],$);const Ve=$;let V=class extends F{constructor(t){super(t),this.type="image",this.inputMethod="any",this.maxImageSize=null}};e([i({type:["image"],readOnly:!0,json:{write:!0}})],V.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],V.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],V.prototype,"maxImageSize",void 0),V=e([p("esri.form.elements.inputs.attachments.ImageInput")],V);const Ne=V;let G=class extends F{constructor(t){super(t),this.type="signature",this.inputMethod="any"}};e([i({type:["signature"],readOnly:!0,json:{write:!0}})],G.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],G.prototype,"inputMethod",void 0),G=e([p("esri.form.elements.inputs.attachments.SignatureInput")],G);const Be=G;let N=class extends F{constructor(t){super(t),this.type="video",this.inputMethod="any",this.maxDuration=null}};e([i({type:["video"],readOnly:!0,json:{write:!0}})],N.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],N.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"maxDuration",void 0),N=e([p("esri.form.elements.inputs.attachments.VideoInput")],N);const ke=N;function He(t){return{nestableTypes:{base:F,key:"type",typeMap:{audio:De,document:Ve,image:Ne,signature:Be,video:ke}},allTypes:{base:F,key:"type",typeMap:{attachment:t,audio:De,document:Ve,image:Ne,signature:Be,video:ke}}}}function Ft(t,o,s){return t?t.map(n=>Ze(o.nestableTypes,n)):null}function Tt(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ot(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}let f=class extends F{constructor(t){super(t),this.type="attachment",this.attachmentAssociationType="exact",this.inputTypes=null}castInputs(t){return Ft(t,Y)}readInputs(t,o){return Tt(o.inputTypes,Y)}writeInputs(t,o){o.inputTypes=Ot(t,Y)}};e([i({type:["attachment"],readOnly:!0,json:{write:!0}})],f.prototype,"type",void 0),e([i({type:["any","exact","exactOrNone"],json:{write:!0}})],f.prototype,"attachmentAssociationType",void 0),e([i({json:{write:{isRequired:!0}}})],f.prototype,"inputTypes",void 0),e([Se("inputTypes")],f.prototype,"castInputs",null),e([l("inputTypes")],f.prototype,"readInputs",null),e([a("inputTypes")],f.prototype,"writeInputs",null),f=e([p("esri.form.elements.inputs.attachments.AttachmentInput")],f);const Y=He(f),Mt=f;var le;const Rt=He(Mt);let d=le=class extends M{constructor(t){super(t),this.allowUserRename=!0,this.attachmentKeyword=null,this.displayFilename=!1,this.editableExpression=null,this.filenameExpression="{attachmentKeyword}_{now}",this.input=null,this.maxAttachmentCount=null,this.minAttachmentCount=null,this.type="attachment",this.useOriginalFilename=!0}clone(){return new le({allowUserRename:this.allowUserRename,attachmentKeyword:this.attachmentKeyword,description:this.description,displayFilename:this.displayFilename,editableExpression:this.editableExpression,filenameExpression:this.filenameExpression,input:this.input?.clone(),label:this.label,maxAttachmentCount:this.maxAttachmentCount,minAttachmentCount:this.minAttachmentCount,useOriginalFilename:this.useOriginalFilename,visibilityExpression:this.visibilityExpression})}};e([i({type:Boolean,json:{write:!0}})],d.prototype,"allowUserRename",void 0),e([i({type:String,json:{write:{isRequired:!0}}})],d.prototype,"attachmentKeyword",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"displayFilename",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"filenameExpression",void 0),e([i({types:Rt.allTypes,json:{read:{source:"inputType"},write:{target:"inputType",isRequired:!0}}})],d.prototype,"input",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"maxAttachmentCount",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"minAttachmentCount",void 0),e([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],d.prototype,"type",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"useOriginalFilename",void 0),d=le=e([p("esri.form.elements.AttachmentElement")],d);const Ae=d;let z=class extends S{constructor(t){super(t),this.type=null}};e([i()],z.prototype,"type",void 0),z=e([p("esri.form.elements.inputs.Input")],z);const E=z;let Q=class extends E{constructor(t){super(t),this.maxLength=null,this.minLength=0}};e([i({type:Number,json:{write:!0}})],Q.prototype,"maxLength",void 0),e([i({type:Number,json:{write:!0}})],Q.prototype,"minLength",void 0),Q=e([p("esri.form.elements.inputs.TextInput")],Q);const Ee=Q;var ae;let H=ae=class extends Ee{constructor(t){super(t),this.type="barcode-scanner"}clone(){return new ae({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["barcode-scanner"],json:{read:!1,write:!0}})],H.prototype,"type",void 0),H=ae=e([p("esri.form.elements.inputs.BarcodeScannerInput")],H);const Dt=H;var ue;let B=ue=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new ue({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};e([i({type:String,json:{write:!0}})],B.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],B.prototype,"showNoValueOption",void 0),e([i({type:["combo-box"],json:{read:!1,write:!0}})],B.prototype,"type",void 0),B=ue=e([p("esri.form.elements.inputs.ComboBoxInput")],B);const Vt=B;var de;function Le(t){return t??null}function Ue(t){return t??null}let x=de=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.type="date-picker"}readMax(t,o){return Le(o.max)}writeMax(t,o){o.max=Ue(t)}readMin(t,o){return Le(o.min)}writeMin(t,o){o.min=Ue(t)}clone(){return new de({max:this.max,min:this.min})}};e([i({type:String,json:{type:String,write:!0}})],x.prototype,"max",void 0),e([l("max")],x.prototype,"readMax",null),e([a("max")],x.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],x.prototype,"min",void 0),e([l("min")],x.prototype,"readMin",null),e([a("min")],x.prototype,"writeMin",null),e([i({type:["date-picker"],json:{read:!1,write:!0}})],x.prototype,"type",void 0),x=de=e([p("esri.form.elements.inputs.DatePickerInput")],x);const Nt=x;var ye;function ee(t){return t??null}function te(t){return t??null}let u=ye=class extends E{constructor(t){super(t),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(t,o){return ee(o.max)}writeMax(t,o){o.max=te(t)}readMin(t,o){return ee(o.min)}writeMin(t,o){o.min=te(t)}readTimeResolution(t,o){return ee(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=te(t)}clone(){return new ye({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:Boolean,json:{write:!0}})],u.prototype,"includeTimeOffset",void 0),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"max",void 0),e([l("max")],u.prototype,"readMax",null),e([a("max")],u.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"min",void 0),e([l("min")],u.prototype,"readMin",null),e([a("min")],u.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"timeResolution",void 0),e([l("timeResolution")],u.prototype,"readTimeResolution",null),e([a("timeResolution")],u.prototype,"writeTimeResolution",null),e([i({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=ye=e([p("esri.form.elements.inputs.DateTimeOffsetPickerInput")],u);const Bt=u;var ce;function Ce(t){return t!=null?new Date(t):null}function $e(t){return t?t.getTime():null}let h=ce=class extends E{constructor(t){super(t),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(t,o){return Ce(o.max)}writeMax(t,o){o.max=$e(t)}readMin(t,o){return Ce(o.min)}writeMin(t,o){o.min=$e(t)}clone(){return new ce({includeTime:this.includeTime,max:this.max,min:this.min})}};e([i({type:Boolean,json:{write:!0}})],h.prototype,"includeTime",void 0),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"max",void 0),e([l("max")],h.prototype,"readMax",null),e([a("max")],h.prototype,"writeMax",null),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"min",void 0),e([l("min")],h.prototype,"readMin",null),e([a("min")],h.prototype,"writeMin",null),e([i({type:["datetime-picker"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=ce=e([p("esri.form.elements.inputs.DateTimePickerInput")],h);const kt=h;var me;let k=me=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new me({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};e([i({type:String,json:{write:!0}})],k.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],k.prototype,"showNoValueOption",void 0),e([i({type:["radio-buttons"],json:{read:!1,write:!0}})],k.prototype,"type",void 0),k=me=e([p("esri.form.elements.inputs.RadioButtonsInput")],k);const At=k;var he;let A=he=class extends E{constructor(t){super(t),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new he({offValue:this.offValue,onValue:this.onValue})}};e([i({type:[String,Number],json:{write:!0}})],A.prototype,"offValue",void 0),e([i({type:[String,Number],json:{write:!0}})],A.prototype,"onValue",void 0),e([i({type:["switch"],json:{read:!1,write:!0}})],A.prototype,"type",void 0),A=he=e([p("esri.form.elements.inputs.SwitchInput")],A);const Lt=A;var ve;let q=ve=class extends Ee{constructor(t){super(t),this.type="text-area"}clone(){return new ve({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-area"],json:{read:!1,write:!0}})],q.prototype,"type",void 0),q=ve=e([p("esri.form.elements.inputs.TextAreaInput")],q);const Ut=q;var xe;let J=xe=class extends Ee{constructor(t){super(t),this.type="text-box"}clone(){return new xe({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-box"],json:{read:!1,write:!0}})],J.prototype,"type",void 0),J=xe=e([p("esri.form.elements.inputs.TextBoxInput")],J);const Ct=J;var fe;function ie(t){return t??null}function oe(t){return t??null}let y=fe=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(t,o){return ie(o.max)}writeMax(t,o){o.max=oe(t)}readMin(t,o){return ie(o.min)}writeMin(t,o){o.min=oe(t)}readTimeResolution(t,o){return ie(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=oe(t)}clone(){return new fe({max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:String,json:{type:String,write:!0}})],y.prototype,"max",void 0),e([l("max")],y.prototype,"readMax",null),e([a("max")],y.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"min",void 0),e([l("min")],y.prototype,"readMin",null),e([a("min")],y.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"timeResolution",void 0),e([l("timeResolution")],y.prototype,"readTimeResolution",null),e([a("timeResolution")],y.prototype,"writeTimeResolution",null),e([i({type:["time-picker"],json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=fe=e([p("esri.form.elements.inputs.TimePickerInput")],y);const $t=y,Gt={base:E,key:"type",typeMap:{"barcode-scanner":Dt,"combo-box":Vt,"date-picker":Nt,"datetime-picker":kt,"datetimeoffset-picker":Bt,"radio-buttons":At,switch:Lt,"text-area":Ut,"text-box":Ct,"time-picker":$t}};var we;let m=we=class extends M{constructor(t){super(t),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new we({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([i({types:lt,json:{read:{reader:ze},write:!0}})],m.prototype,"domain",void 0),e([i({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"hint",void 0),e([i({types:Gt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],m.prototype,"input",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"requiredExpression",void 0),e([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"valueExpression",void 0),m=we=e([p("esri.form.elements.FieldElement")],m);const Ge=m;var ge;let b=ge=class extends M{constructor(t){super(t),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new ge({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:C(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};e([i({type:Number,json:{write:!0}})],b.prototype,"displayCount",void 0),e([i({type:["list"],json:{write:!0}})],b.prototype,"displayType",void 0),e([i({type:String,json:{write:!0}})],b.prototype,"editableExpression",void 0),e([i({type:[tt],json:{write:!0}})],b.prototype,"orderByFields",void 0),e([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),e([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=ge=e([p("esri.form.elements.RelationshipElement")],b);const Qe=b;var be;let L=be=class extends M{constructor(t){super(t),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new be({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};e([i({type:String,json:{write:!0}})],L.prototype,"text",void 0),e([i({type:String,json:{write:!0}})],L.prototype,"textFormat",void 0),e([i({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],L.prototype,"type",void 0),L=be=e([p("esri.form.elements.TextElement")],L);const We=L;function qe(t){return{typesWithGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,group:t,relationship:Qe,text:We}},typesWithoutGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,relationship:Qe,text:We}}}}function Je(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ke(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}function _e(t,o,s=!0){return t?t.map(n=>Ze(s?o.typesWithGroup:o.typesWithoutGroup,n)):null}var je;let w=je=class extends M{constructor(t){super(t),this.elements=null,this.initialState="expanded",this.type="group"}castElements(t){return _e(t,ne,!1)}readElements(t,o){return Je(o.formElements,ne,!1)}writeElements(t,o){o.formElements=Ke(t,ne,!1)}clone(){return new je({description:this.description,elements:C(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([i({json:{write:!0}})],w.prototype,"elements",void 0),e([Se("elements")],w.prototype,"castElements",null),e([l("elements",["formElements"])],w.prototype,"readElements",null),e([a("elements")],w.prototype,"writeElements",null),e([i({type:["collapsed","expanded"],json:{write:!0}})],w.prototype,"initialState",void 0),e([i({type:String,json:{read:!1,write:!0}})],w.prototype,"type",void 0),w=je=e([p("esri.form.elements.GroupElement")],w);const ne=qe(w),Qt=w,Wt=t=>t.type==="field",Pt=t=>t.type==="group",Zt=t=>t.type==="text";var Ie;const se=qe(Qt);let v=Ie=class extends S{constructor(t){super(t),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(t){return _e(t,se)}readElements(t,o){return Je(o.formElements,se)}writeElements(t,o){o.formElements=Ke(t,se)}clone(){return new Ie({description:this.description,expressionInfos:C(this.expressionInfos),elements:C(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(t,o){const s=new Set,{description:n,elements:r,expressionInfos:c,title:R}=this;if(W(s,t,n),W(s,t,R),!r)return[];const et=zt(r,c).map(_=>st(s,t,_));await Promise.all(et);for(const _ of r)Xe(s,{fieldsIndex:t,relationships:o},_);return Array.from(s).sort()}};function Xe(t,o,s){const{fieldsIndex:n}=o;if(!n||n.fields.length!==t.size)switch(W(t,n,s.label),W(t,n,s.description),s.type){case"field":Oe(t,n,s.fieldName);break;case"group":s.elements.forEach(r=>Xe(t,o,r));break;case"relationship":if(o.relationships){const r=o.relationships.find(c=>c.id===s.relationshipId);r&&Oe(t,n,r.keyField)}Pe(t,n,s.orderByFields?.map(r=>r.field));break;case"text":W(t,n,s.text)}}function zt(t,o){if(!o||o.length===0)return[];const s=Ye(t),n=[];for(const r of o)s.has(r.name)&&n.push(r.expression);return n}function Ye(t){const o=new Set;for(const s of t)if(Me(o,s.visibilityExpression),!Zt(s)){if(Pt(s))Re(o,Ye(s.elements));else if(Me(o,s.editableExpression),Wt(s)){const{requiredExpression:n,valueExpression:r}=s;Re(o,[n,r])}}return o}function W(t,o,s){Pe(t,o,rt(s))}e([i({type:String,json:{write:!0}})],v.prototype,"description",void 0),e([i({json:{write:!0}})],v.prototype,"elements",void 0),e([Se("elements")],v.prototype,"castElements",null),e([l("elements",["formElements"])],v.prototype,"readElements",null),e([a("elements")],v.prototype,"writeElements",null),e([i({type:[Et],json:{write:!0}})],v.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],v.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],v.prototype,"title",void 0),v=Ie=e([p("esri.form.FormTemplate")],v);const si=v;let j=class extends P(S){constructor(t){super(t),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([i()],j.prototype,"creatorField",void 0),e([i()],j.prototype,"creationDateField",void 0),e([i()],j.prototype,"editorField",void 0),e([i()],j.prototype,"editDateField",void 0),e([i()],j.prototype,"realm",void 0),e([i(re("dateFieldsTimeReference",!0))],j.prototype,"timeZone",void 0),j=e([p("esri.layers.support.EditFieldsInfo")],j);const Ht=j;let g=class extends P(S){constructor(t){super(t)}};e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"name",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"fields",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isAscending",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"indexType",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isUnique",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"description",void 0),g=e([p("esri.layers.support.FeatureIndex")],g);let U=class extends P(S){constructor(t){super(t),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([i({type:String,json:{read:{source:"shapeAreaFieldName"}}})],U.prototype,"shapeAreaField",void 0),e([i({type:String,json:{read:{source:"shapeLengthFieldName"}}})],U.prototype,"shapeLengthField",void 0),e([i({type:String,json:{read:t=>it.read(t)||ot.read(t)}})],U.prototype,"units",void 0),U=e([p("esri.layers.support.GeometryFieldsInfo")],U);const qt=U;let I=class extends P(S){constructor(t){super(t),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(t){if(!t)return null;const o={};for(const s of Object.keys(t))o[s]=ze(t[s]);return o}writeDomains(t,o){if(!t)return;const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());o.domains=s}};e([i({type:Number,json:{write:!0}})],I.prototype,"code",void 0),e([i({type:Object,json:{write:!0}})],I.prototype,"defaultValues",void 0),e([i({json:{write:!0}})],I.prototype,"domains",void 0),e([l("domains")],I.prototype,"readDomains",null),e([a("domains")],I.prototype,"writeDomains",null),e([i({type:String,json:{write:!0}})],I.prototype,"name",void 0),I=e([p("esri.layers.support.Subtype")],I);const Jt=I,ri=t=>{let o=class extends t{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(Fe.ofType(g)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=Te.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:s}=this;if(s){const{query:r,operations:c,editing:R}=s;if(!r.supportsQueryByOthers||!r.supportsQueryByAnonymous||c.supportsEditing&&!(R.supportsUpdateByOthers&&R.supportsUpdateByAnonymous&&R.supportsDeleteByOthers&&R.supportsDeleteByAnonymous))return"load"}if(this.serviceDefinitionExpression?.toLowerCase().includes("current_user"))return"load";if(this.userHasUpdateItemPrivileges){if(ft(this))return"load";if(this.hasUpdateItemRestrictions)return s.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const n=this.editFieldsInfo;return(n?.creatorField||n?.editorField)&&s?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(s,n){return St(n,this.url)}readEditingInfo(s,n){const{editingInfo:r}=n;return r?{lastEditDate:r.lastEditDate!=null?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const s=this.capabilities;if(!s)return null;const n=C(s),{operations:r,editing:c}=n;return X(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),n):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=c.supportsDeleteByOthers=c.supportsGeometryUpdate=c.supportsUpdateByOthers=!0,n):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=c.supportsGeometryUpdate=!0),n)}readGlobalIdFieldFromService(s,n){return wt(n)}get hasFullEditingRestrictions(){const s=this.capabilities;if(!s||X(this))return!1;const{operations:n,editing:r}=s;return n.supportsEditing&&!(n.supportsAdd&&n.supportsDelete&&n.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const s=this.capabilities;if(!s)return!1;const{operations:n,editing:r}=s;return X(this)?!n.supportsQuery:!(n.supportsAdd&&n.supportsDelete&&n.supportsEditing&&n.supportsQuery&&n.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(s,n){return n.type==="Table"}readMaxScale(s,n){return n.effectiveMaxScale||s||0}readMinScale(s,n){return n.effectiveMinScale||s||0}readObjectIdFieldFromService(s,n){return gt(n)}readServiceDefinitionExpression(s,n){return n.definitionQuery||n.definitionExpression}set url(s){if(s==null)return void this._set("url",s);const n=ht({layer:this,url:s,nonStandardUrlAllowed:!0,logger:pt.getLogger(this)});this._set("url",n.url),n.layerId!=null&&this._set("layerId",n.layerId)}writeUrl(s,n,r,c){vt(this,s,null,n,c)}readVersion(s,n){return bt(n)}};return e([i({readOnly:!0})],o.prototype,"authenticationTriggerEvent",null),e([i({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],o.prototype,"copyright",void 0),e([i({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],o.prototype,"capabilities",void 0),e([l("service","capabilities")],o.prototype,"readCapabilitiesFromService",null),e([i(re("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),e([i({type:Boolean})],o.prototype,"datesInUnknownTimezone",void 0),e([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),e([i({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],o.prototype,"displayField",void 0),e([i({readOnly:!0,type:Ht})],o.prototype,"editFieldsInfo",void 0),e([i({readOnly:!0})],o.prototype,"editingInfo",void 0),e([l("editingInfo")],o.prototype,"readEditingInfo",null),e([i({readOnly:!0})],o.prototype,"effectiveCapabilities",null),e([i((()=>{const s=C(at),n=s.json.origins;return n["web-map"]={read:!1,write:!1},n["portal-item"]={read:!1,write:!1},s})())],o.prototype,"elevationInfo",void 0),e([i({type:jt,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:ut}}}}})],o.prototype,"floorInfo",void 0),e([i({type:nt,json:{origins:{service:{read:{source:"extent"}}}}})],o.prototype,"fullExtent",void 0),e([i()],o.prototype,"gdbVersion",void 0),e([i({readOnly:!0,type:qt,json:{read:{source:"geometryProperties"}}})],o.prototype,"geometryFieldsInfo",void 0),e([i({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:xt.read}}}})],o.prototype,"geometryType",void 0),e([i({type:String})],o.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdFieldFromService",null),e([i({readOnly:!0})],o.prototype,"hasFullEditingRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasM",void 0),e([i({readOnly:!0})],o.prototype,"hasUpdateItemRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasZ",void 0),e([i({readOnly:!0,type:mt})],o.prototype,"heightModelInfo",void 0),e([i({type:Date})],o.prototype,"historicMoment",void 0),e([i({type:Fe.ofType(g),readOnly:!0})],o.prototype,"indexes",void 0),e([i({readOnly:!0})],o.prototype,"isTable",void 0),e([l("service","isTable",["type"])],o.prototype,"readIsTableFromService",null),e([i({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],o.prototype,"layerId",void 0),e([i(dt)],o.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],o.prototype,"readMaxScale",null),e([i(yt)],o.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],o.prototype,"readMinScale",null),e([i({type:String})],o.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdFieldFromService",null),e([i(re("preferredTimeReference"))],o.prototype,"preferredTimeZone",void 0),e([i({type:[It],readOnly:!0})],o.prototype,"relationships",void 0),e([i({type:Boolean})],o.prototype,"returnM",void 0),e([i({type:Boolean})],o.prototype,"returnZ",void 0),e([i({readOnly:!0,json:{write:!1}})],o.prototype,"serverGens",void 0),e([i({readOnly:!0})],o.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],o.prototype,"readServiceDefinitionExpression",null),e([i({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),e([i()],o.prototype,"sourceJSON",void 0),e([i({type:Te,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),e([i({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"subtypeField",void 0),e([i({type:[Jt],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"subtypes",void 0),e([i({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],o.prototype,"trackIdField",void 0),e([i(ct)],o.prototype,"url",null),e([a("url")],o.prototype,"writeUrl",null),e([i({json:{origins:{service:{read:!0}},read:!1}})],o.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],o.prototype,"readVersion",null),o=e([p("esri.layers.mixins.FeatureLayerBase")],o),o};export{ri as $,si as H}; diff --git a/main/assets/FeatureLayerBase-vvYyZTfh-K4Z036-G.js b/main/assets/FeatureLayerBase-vvYyZTfh-K4Z036-G.js deleted file mode 100644 index c5c3abb41..000000000 --- a/main/assets/FeatureLayerBase-vvYyZTfh-K4Z036-G.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as i,i as p,aa as P,e as S,ad as Se,a0 as l,ac as a,eG as tt,bQ as re,bI as it,bH as ot,P as C,n as nt,ag as Fe,J as Te,dL as st,ey as Oe,eH as Pe,eI as Me,eJ as Re,eK as rt,a1 as pt,d3 as Ze}from"./main-BZaw9FpY.js";import{n as lt,i as ze}from"./Field-C6hA1tZj-CbELM0zp.js";import{$ as at,s as ut,n as dt,t as yt,Z as ct}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{M as mt}from"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import{x as ht,T as vt}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{k as xt,d as ft,O as X,n as wt,r as gt,a as bt}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{v as jt}from"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import{p as It}from"./Relationship-PyhUibYK-Bz6HFiBe.js";import{x as St}from"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";var pe;let T=pe=class extends S{constructor(t){super(t),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new pe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};e([i({type:String,json:{write:!0}})],T.prototype,"expression",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"name",void 0),e([i({type:["boolean","date","number","string"],json:{write:!0}})],T.prototype,"returnType",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"title",void 0),T=pe=e([p("esri.form.ExpressionInfo")],T);const Et=T;let O=class extends S{constructor(t){super(t),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};e([i({type:String,json:{write:!0}})],O.prototype,"description",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"label",void 0),e([i()],O.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"visibilityExpression",void 0),O=e([p("esri.form.elements.Element")],O);const M=O;let Z=class extends P(S){constructor(t){super(t),this.type=null}};e([i()],Z.prototype,"type",void 0),Z=e([p("esri.form.elements.inputs.attachments.Input")],Z);const F=Z,K=["any","capture","upload"];let D=class extends F{constructor(t){super(t),this.type="audio",this.inputMethod="any",this.maxDuration=null}};e([i({type:["audio"],readOnly:!0,json:{write:!0}})],D.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],D.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],D.prototype,"maxDuration",void 0),D=e([p("esri.form.elements.inputs.attachments.AudioInput")],D);const De=D;let $=class extends F{constructor(t){super(t),this.type="document",this.maxFileSize=null}};e([i({type:["document"],readOnly:!0,json:{write:!0}})],$.prototype,"type",void 0),e([i({type:Number,json:{write:!0}})],$.prototype,"maxFileSize",void 0),$=e([p("esri.form.elements.inputs.attachments.DocumentInput")],$);const Ve=$;let V=class extends F{constructor(t){super(t),this.type="image",this.inputMethod="any",this.maxImageSize=null}};e([i({type:["image"],readOnly:!0,json:{write:!0}})],V.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],V.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],V.prototype,"maxImageSize",void 0),V=e([p("esri.form.elements.inputs.attachments.ImageInput")],V);const Ne=V;let G=class extends F{constructor(t){super(t),this.type="signature",this.inputMethod="any"}};e([i({type:["signature"],readOnly:!0,json:{write:!0}})],G.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],G.prototype,"inputMethod",void 0),G=e([p("esri.form.elements.inputs.attachments.SignatureInput")],G);const Be=G;let N=class extends F{constructor(t){super(t),this.type="video",this.inputMethod="any",this.maxDuration=null}};e([i({type:["video"],readOnly:!0,json:{write:!0}})],N.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],N.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"maxDuration",void 0),N=e([p("esri.form.elements.inputs.attachments.VideoInput")],N);const ke=N;function He(t){return{nestableTypes:{base:F,key:"type",typeMap:{audio:De,document:Ve,image:Ne,signature:Be,video:ke}},allTypes:{base:F,key:"type",typeMap:{attachment:t,audio:De,document:Ve,image:Ne,signature:Be,video:ke}}}}function Ft(t,o,s){return t?t.map(n=>Ze(o.nestableTypes,n)):null}function Tt(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ot(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}let f=class extends F{constructor(t){super(t),this.type="attachment",this.attachmentAssociationType="exact",this.inputTypes=null}castInputs(t){return Ft(t,Y)}readInputs(t,o){return Tt(o.inputTypes,Y)}writeInputs(t,o){o.inputTypes=Ot(t,Y)}};e([i({type:["attachment"],readOnly:!0,json:{write:!0}})],f.prototype,"type",void 0),e([i({type:["any","exact","exactOrNone"],json:{write:!0}})],f.prototype,"attachmentAssociationType",void 0),e([i({json:{write:{isRequired:!0}}})],f.prototype,"inputTypes",void 0),e([Se("inputTypes")],f.prototype,"castInputs",null),e([l("inputTypes")],f.prototype,"readInputs",null),e([a("inputTypes")],f.prototype,"writeInputs",null),f=e([p("esri.form.elements.inputs.attachments.AttachmentInput")],f);const Y=He(f),Mt=f;var le;const Rt=He(Mt);let d=le=class extends M{constructor(t){super(t),this.allowUserRename=!0,this.attachmentKeyword=null,this.displayFilename=!1,this.editableExpression=null,this.filenameExpression="{attachmentKeyword}_{now}",this.input=null,this.maxAttachmentCount=null,this.minAttachmentCount=null,this.type="attachment",this.useOriginalFilename=!0}clone(){return new le({allowUserRename:this.allowUserRename,attachmentKeyword:this.attachmentKeyword,description:this.description,displayFilename:this.displayFilename,editableExpression:this.editableExpression,filenameExpression:this.filenameExpression,input:this.input?.clone(),label:this.label,maxAttachmentCount:this.maxAttachmentCount,minAttachmentCount:this.minAttachmentCount,useOriginalFilename:this.useOriginalFilename,visibilityExpression:this.visibilityExpression})}};e([i({type:Boolean,json:{write:!0}})],d.prototype,"allowUserRename",void 0),e([i({type:String,json:{write:{isRequired:!0}}})],d.prototype,"attachmentKeyword",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"displayFilename",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"filenameExpression",void 0),e([i({types:Rt.allTypes,json:{read:{source:"inputType"},write:{target:"inputType",isRequired:!0}}})],d.prototype,"input",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"maxAttachmentCount",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"minAttachmentCount",void 0),e([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],d.prototype,"type",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"useOriginalFilename",void 0),d=le=e([p("esri.form.elements.AttachmentElement")],d);const Ae=d;let z=class extends S{constructor(t){super(t),this.type=null}};e([i()],z.prototype,"type",void 0),z=e([p("esri.form.elements.inputs.Input")],z);const E=z;let Q=class extends E{constructor(t){super(t),this.maxLength=null,this.minLength=0}};e([i({type:Number,json:{write:!0}})],Q.prototype,"maxLength",void 0),e([i({type:Number,json:{write:!0}})],Q.prototype,"minLength",void 0),Q=e([p("esri.form.elements.inputs.TextInput")],Q);const Ee=Q;var ae;let H=ae=class extends Ee{constructor(t){super(t),this.type="barcode-scanner"}clone(){return new ae({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["barcode-scanner"],json:{read:!1,write:!0}})],H.prototype,"type",void 0),H=ae=e([p("esri.form.elements.inputs.BarcodeScannerInput")],H);const Dt=H;var ue;let B=ue=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new ue({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};e([i({type:String,json:{write:!0}})],B.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],B.prototype,"showNoValueOption",void 0),e([i({type:["combo-box"],json:{read:!1,write:!0}})],B.prototype,"type",void 0),B=ue=e([p("esri.form.elements.inputs.ComboBoxInput")],B);const Vt=B;var de;function Le(t){return t??null}function Ue(t){return t??null}let x=de=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.type="date-picker"}readMax(t,o){return Le(o.max)}writeMax(t,o){o.max=Ue(t)}readMin(t,o){return Le(o.min)}writeMin(t,o){o.min=Ue(t)}clone(){return new de({max:this.max,min:this.min})}};e([i({type:String,json:{type:String,write:!0}})],x.prototype,"max",void 0),e([l("max")],x.prototype,"readMax",null),e([a("max")],x.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],x.prototype,"min",void 0),e([l("min")],x.prototype,"readMin",null),e([a("min")],x.prototype,"writeMin",null),e([i({type:["date-picker"],json:{read:!1,write:!0}})],x.prototype,"type",void 0),x=de=e([p("esri.form.elements.inputs.DatePickerInput")],x);const Nt=x;var ye;function ee(t){return t??null}function te(t){return t??null}let u=ye=class extends E{constructor(t){super(t),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(t,o){return ee(o.max)}writeMax(t,o){o.max=te(t)}readMin(t,o){return ee(o.min)}writeMin(t,o){o.min=te(t)}readTimeResolution(t,o){return ee(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=te(t)}clone(){return new ye({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:Boolean,json:{write:!0}})],u.prototype,"includeTimeOffset",void 0),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"max",void 0),e([l("max")],u.prototype,"readMax",null),e([a("max")],u.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"min",void 0),e([l("min")],u.prototype,"readMin",null),e([a("min")],u.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"timeResolution",void 0),e([l("timeResolution")],u.prototype,"readTimeResolution",null),e([a("timeResolution")],u.prototype,"writeTimeResolution",null),e([i({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=ye=e([p("esri.form.elements.inputs.DateTimeOffsetPickerInput")],u);const Bt=u;var ce;function Ce(t){return t!=null?new Date(t):null}function $e(t){return t?t.getTime():null}let h=ce=class extends E{constructor(t){super(t),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(t,o){return Ce(o.max)}writeMax(t,o){o.max=$e(t)}readMin(t,o){return Ce(o.min)}writeMin(t,o){o.min=$e(t)}clone(){return new ce({includeTime:this.includeTime,max:this.max,min:this.min})}};e([i({type:Boolean,json:{write:!0}})],h.prototype,"includeTime",void 0),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"max",void 0),e([l("max")],h.prototype,"readMax",null),e([a("max")],h.prototype,"writeMax",null),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"min",void 0),e([l("min")],h.prototype,"readMin",null),e([a("min")],h.prototype,"writeMin",null),e([i({type:["datetime-picker"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=ce=e([p("esri.form.elements.inputs.DateTimePickerInput")],h);const kt=h;var me;let k=me=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new me({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};e([i({type:String,json:{write:!0}})],k.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],k.prototype,"showNoValueOption",void 0),e([i({type:["radio-buttons"],json:{read:!1,write:!0}})],k.prototype,"type",void 0),k=me=e([p("esri.form.elements.inputs.RadioButtonsInput")],k);const At=k;var he;let A=he=class extends E{constructor(t){super(t),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new he({offValue:this.offValue,onValue:this.onValue})}};e([i({type:[String,Number],json:{write:!0}})],A.prototype,"offValue",void 0),e([i({type:[String,Number],json:{write:!0}})],A.prototype,"onValue",void 0),e([i({type:["switch"],json:{read:!1,write:!0}})],A.prototype,"type",void 0),A=he=e([p("esri.form.elements.inputs.SwitchInput")],A);const Lt=A;var ve;let q=ve=class extends Ee{constructor(t){super(t),this.type="text-area"}clone(){return new ve({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-area"],json:{read:!1,write:!0}})],q.prototype,"type",void 0),q=ve=e([p("esri.form.elements.inputs.TextAreaInput")],q);const Ut=q;var xe;let J=xe=class extends Ee{constructor(t){super(t),this.type="text-box"}clone(){return new xe({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-box"],json:{read:!1,write:!0}})],J.prototype,"type",void 0),J=xe=e([p("esri.form.elements.inputs.TextBoxInput")],J);const Ct=J;var fe;function ie(t){return t??null}function oe(t){return t??null}let y=fe=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(t,o){return ie(o.max)}writeMax(t,o){o.max=oe(t)}readMin(t,o){return ie(o.min)}writeMin(t,o){o.min=oe(t)}readTimeResolution(t,o){return ie(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=oe(t)}clone(){return new fe({max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:String,json:{type:String,write:!0}})],y.prototype,"max",void 0),e([l("max")],y.prototype,"readMax",null),e([a("max")],y.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"min",void 0),e([l("min")],y.prototype,"readMin",null),e([a("min")],y.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"timeResolution",void 0),e([l("timeResolution")],y.prototype,"readTimeResolution",null),e([a("timeResolution")],y.prototype,"writeTimeResolution",null),e([i({type:["time-picker"],json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=fe=e([p("esri.form.elements.inputs.TimePickerInput")],y);const $t=y,Gt={base:E,key:"type",typeMap:{"barcode-scanner":Dt,"combo-box":Vt,"date-picker":Nt,"datetime-picker":kt,"datetimeoffset-picker":Bt,"radio-buttons":At,switch:Lt,"text-area":Ut,"text-box":Ct,"time-picker":$t}};var we;let m=we=class extends M{constructor(t){super(t),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new we({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([i({types:lt,json:{read:{reader:ze},write:!0}})],m.prototype,"domain",void 0),e([i({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"hint",void 0),e([i({types:Gt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],m.prototype,"input",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"requiredExpression",void 0),e([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"valueExpression",void 0),m=we=e([p("esri.form.elements.FieldElement")],m);const Ge=m;var ge;let b=ge=class extends M{constructor(t){super(t),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new ge({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:C(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};e([i({type:Number,json:{write:!0}})],b.prototype,"displayCount",void 0),e([i({type:["list"],json:{write:!0}})],b.prototype,"displayType",void 0),e([i({type:String,json:{write:!0}})],b.prototype,"editableExpression",void 0),e([i({type:[tt],json:{write:!0}})],b.prototype,"orderByFields",void 0),e([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),e([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=ge=e([p("esri.form.elements.RelationshipElement")],b);const Qe=b;var be;let L=be=class extends M{constructor(t){super(t),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new be({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};e([i({type:String,json:{write:!0}})],L.prototype,"text",void 0),e([i({type:String,json:{write:!0}})],L.prototype,"textFormat",void 0),e([i({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],L.prototype,"type",void 0),L=be=e([p("esri.form.elements.TextElement")],L);const We=L;function qe(t){return{typesWithGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,group:t,relationship:Qe,text:We}},typesWithoutGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,relationship:Qe,text:We}}}}function Je(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ke(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}function _e(t,o,s=!0){return t?t.map(n=>Ze(s?o.typesWithGroup:o.typesWithoutGroup,n)):null}var je;let w=je=class extends M{constructor(t){super(t),this.elements=null,this.initialState="expanded",this.type="group"}castElements(t){return _e(t,ne,!1)}readElements(t,o){return Je(o.formElements,ne,!1)}writeElements(t,o){o.formElements=Ke(t,ne,!1)}clone(){return new je({description:this.description,elements:C(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([i({json:{write:!0}})],w.prototype,"elements",void 0),e([Se("elements")],w.prototype,"castElements",null),e([l("elements",["formElements"])],w.prototype,"readElements",null),e([a("elements")],w.prototype,"writeElements",null),e([i({type:["collapsed","expanded"],json:{write:!0}})],w.prototype,"initialState",void 0),e([i({type:String,json:{read:!1,write:!0}})],w.prototype,"type",void 0),w=je=e([p("esri.form.elements.GroupElement")],w);const ne=qe(w),Qt=w,Wt=t=>t.type==="field",Pt=t=>t.type==="group",Zt=t=>t.type==="text";var Ie;const se=qe(Qt);let v=Ie=class extends S{constructor(t){super(t),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(t){return _e(t,se)}readElements(t,o){return Je(o.formElements,se)}writeElements(t,o){o.formElements=Ke(t,se)}clone(){return new Ie({description:this.description,expressionInfos:C(this.expressionInfos),elements:C(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(t,o){const s=new Set,{description:n,elements:r,expressionInfos:c,title:R}=this;if(W(s,t,n),W(s,t,R),!r)return[];const et=zt(r,c).map(_=>st(s,t,_));await Promise.all(et);for(const _ of r)Xe(s,{fieldsIndex:t,relationships:o},_);return Array.from(s).sort()}};function Xe(t,o,s){const{fieldsIndex:n}=o;if(!n||n.fields.length!==t.size)switch(W(t,n,s.label),W(t,n,s.description),s.type){case"field":Oe(t,n,s.fieldName);break;case"group":s.elements.forEach(r=>Xe(t,o,r));break;case"relationship":if(o.relationships){const r=o.relationships.find(c=>c.id===s.relationshipId);r&&Oe(t,n,r.keyField)}Pe(t,n,s.orderByFields?.map(r=>r.field));break;case"text":W(t,n,s.text)}}function zt(t,o){if(!o||o.length===0)return[];const s=Ye(t),n=[];for(const r of o)s.has(r.name)&&n.push(r.expression);return n}function Ye(t){const o=new Set;for(const s of t)if(Me(o,s.visibilityExpression),!Zt(s)){if(Pt(s))Re(o,Ye(s.elements));else if(Me(o,s.editableExpression),Wt(s)){const{requiredExpression:n,valueExpression:r}=s;Re(o,[n,r])}}return o}function W(t,o,s){Pe(t,o,rt(s))}e([i({type:String,json:{write:!0}})],v.prototype,"description",void 0),e([i({json:{write:!0}})],v.prototype,"elements",void 0),e([Se("elements")],v.prototype,"castElements",null),e([l("elements",["formElements"])],v.prototype,"readElements",null),e([a("elements")],v.prototype,"writeElements",null),e([i({type:[Et],json:{write:!0}})],v.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],v.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],v.prototype,"title",void 0),v=Ie=e([p("esri.form.FormTemplate")],v);const si=v;let j=class extends P(S){constructor(t){super(t),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([i()],j.prototype,"creatorField",void 0),e([i()],j.prototype,"creationDateField",void 0),e([i()],j.prototype,"editorField",void 0),e([i()],j.prototype,"editDateField",void 0),e([i()],j.prototype,"realm",void 0),e([i(re("dateFieldsTimeReference",!0))],j.prototype,"timeZone",void 0),j=e([p("esri.layers.support.EditFieldsInfo")],j);const Ht=j;let g=class extends P(S){constructor(t){super(t)}};e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"name",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"fields",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isAscending",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"indexType",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isUnique",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"description",void 0),g=e([p("esri.layers.support.FeatureIndex")],g);let U=class extends P(S){constructor(t){super(t),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([i({type:String,json:{read:{source:"shapeAreaFieldName"}}})],U.prototype,"shapeAreaField",void 0),e([i({type:String,json:{read:{source:"shapeLengthFieldName"}}})],U.prototype,"shapeLengthField",void 0),e([i({type:String,json:{read:t=>it.read(t)||ot.read(t)}})],U.prototype,"units",void 0),U=e([p("esri.layers.support.GeometryFieldsInfo")],U);const qt=U;let I=class extends P(S){constructor(t){super(t),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(t){if(!t)return null;const o={};for(const s of Object.keys(t))o[s]=ze(t[s]);return o}writeDomains(t,o){if(!t)return;const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());o.domains=s}};e([i({type:Number,json:{write:!0}})],I.prototype,"code",void 0),e([i({type:Object,json:{write:!0}})],I.prototype,"defaultValues",void 0),e([i({json:{write:!0}})],I.prototype,"domains",void 0),e([l("domains")],I.prototype,"readDomains",null),e([a("domains")],I.prototype,"writeDomains",null),e([i({type:String,json:{write:!0}})],I.prototype,"name",void 0),I=e([p("esri.layers.support.Subtype")],I);const Jt=I,ri=t=>{let o=class extends t{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(Fe.ofType(g)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=Te.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:s}=this;if(s){const{query:r,operations:c,editing:R}=s;if(!r.supportsQueryByOthers||!r.supportsQueryByAnonymous||c.supportsEditing&&!(R.supportsUpdateByOthers&&R.supportsUpdateByAnonymous&&R.supportsDeleteByOthers&&R.supportsDeleteByAnonymous))return"load"}if(this.serviceDefinitionExpression?.toLowerCase().includes("current_user"))return"load";if(this.userHasUpdateItemPrivileges){if(ft(this))return"load";if(this.hasUpdateItemRestrictions)return s.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const n=this.editFieldsInfo;return(n?.creatorField||n?.editorField)&&s?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(s,n){return St(n,this.url)}readEditingInfo(s,n){const{editingInfo:r}=n;return r?{lastEditDate:r.lastEditDate!=null?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const s=this.capabilities;if(!s)return null;const n=C(s),{operations:r,editing:c}=n;return X(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),n):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=c.supportsDeleteByOthers=c.supportsGeometryUpdate=c.supportsUpdateByOthers=!0,n):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=c.supportsGeometryUpdate=!0),n)}readGlobalIdFieldFromService(s,n){return wt(n)}get hasFullEditingRestrictions(){const s=this.capabilities;if(!s||X(this))return!1;const{operations:n,editing:r}=s;return n.supportsEditing&&!(n.supportsAdd&&n.supportsDelete&&n.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const s=this.capabilities;if(!s)return!1;const{operations:n,editing:r}=s;return X(this)?!n.supportsQuery:!(n.supportsAdd&&n.supportsDelete&&n.supportsEditing&&n.supportsQuery&&n.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(s,n){return n.type==="Table"}readMaxScale(s,n){return n.effectiveMaxScale||s||0}readMinScale(s,n){return n.effectiveMinScale||s||0}readObjectIdFieldFromService(s,n){return gt(n)}readServiceDefinitionExpression(s,n){return n.definitionQuery||n.definitionExpression}set url(s){if(s==null)return void this._set("url",s);const n=ht({layer:this,url:s,nonStandardUrlAllowed:!0,logger:pt.getLogger(this)});this._set("url",n.url),n.layerId!=null&&this._set("layerId",n.layerId)}writeUrl(s,n,r,c){vt(this,s,null,n,c)}readVersion(s,n){return bt(n)}};return e([i({readOnly:!0})],o.prototype,"authenticationTriggerEvent",null),e([i({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],o.prototype,"copyright",void 0),e([i({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],o.prototype,"capabilities",void 0),e([l("service","capabilities")],o.prototype,"readCapabilitiesFromService",null),e([i(re("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),e([i({type:Boolean})],o.prototype,"datesInUnknownTimezone",void 0),e([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),e([i({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],o.prototype,"displayField",void 0),e([i({readOnly:!0,type:Ht})],o.prototype,"editFieldsInfo",void 0),e([i({readOnly:!0})],o.prototype,"editingInfo",void 0),e([l("editingInfo")],o.prototype,"readEditingInfo",null),e([i({readOnly:!0})],o.prototype,"effectiveCapabilities",null),e([i((()=>{const s=C(at),n=s.json.origins;return n["web-map"]={read:!1,write:!1},n["portal-item"]={read:!1,write:!1},s})())],o.prototype,"elevationInfo",void 0),e([i({type:jt,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:ut}}}}})],o.prototype,"floorInfo",void 0),e([i({type:nt,json:{origins:{service:{read:{source:"extent"}}}}})],o.prototype,"fullExtent",void 0),e([i()],o.prototype,"gdbVersion",void 0),e([i({readOnly:!0,type:qt,json:{read:{source:"geometryProperties"}}})],o.prototype,"geometryFieldsInfo",void 0),e([i({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:xt.read}}}})],o.prototype,"geometryType",void 0),e([i({type:String})],o.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdFieldFromService",null),e([i({readOnly:!0})],o.prototype,"hasFullEditingRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasM",void 0),e([i({readOnly:!0})],o.prototype,"hasUpdateItemRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasZ",void 0),e([i({readOnly:!0,type:mt})],o.prototype,"heightModelInfo",void 0),e([i({type:Date})],o.prototype,"historicMoment",void 0),e([i({type:Fe.ofType(g),readOnly:!0})],o.prototype,"indexes",void 0),e([i({readOnly:!0})],o.prototype,"isTable",void 0),e([l("service","isTable",["type"])],o.prototype,"readIsTableFromService",null),e([i({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],o.prototype,"layerId",void 0),e([i(dt)],o.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],o.prototype,"readMaxScale",null),e([i(yt)],o.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],o.prototype,"readMinScale",null),e([i({type:String})],o.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdFieldFromService",null),e([i(re("preferredTimeReference"))],o.prototype,"preferredTimeZone",void 0),e([i({type:[It],readOnly:!0})],o.prototype,"relationships",void 0),e([i({type:Boolean})],o.prototype,"returnM",void 0),e([i({type:Boolean})],o.prototype,"returnZ",void 0),e([i({readOnly:!0,json:{write:!1}})],o.prototype,"serverGens",void 0),e([i({readOnly:!0})],o.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],o.prototype,"readServiceDefinitionExpression",null),e([i({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),e([i()],o.prototype,"sourceJSON",void 0),e([i({type:Te,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),e([i({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"subtypeField",void 0),e([i({type:[Jt],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"subtypes",void 0),e([i({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],o.prototype,"trackIdField",void 0),e([i(ct)],o.prototype,"url",null),e([a("url")],o.prototype,"writeUrl",null),e([i({json:{origins:{service:{read:!0}},read:!1}})],o.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],o.prototype,"readVersion",null),o=e([p("esri.layers.mixins.FeatureLayerBase")],o),o};export{ri as $,si as H}; diff --git a/main/assets/FeatureLayerSource-k4WMYop1-BFDYORV0.js b/main/assets/FeatureLayerSource-k4WMYop1-BFDYORV0.js deleted file mode 100644 index aedf93258..000000000 --- a/main/assets/FeatureLayerSource-k4WMYop1-BFDYORV0.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./uploadAssets-fBa6NH35-P_9VDEG7.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./External-D_wl4XAw-MFWeclAP.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./meshSpatialReferenceScaleUtils-B1zR72Os-DiWGnc4E.js","./MeshTransform-C--IG09w-B7P01ZzU.js","./mat4-DX7gBViE-CQMXDC3Z.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Bk09s2KF.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./vec42-D8CJyqHG-DnfLTeQH.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./meshFeatureAttributes-BwKR5odo-DqGm5IB9.js","./convertMeshVertexSpace-BO7NR5uA-BDll_-Zx.js","./MeshVertexAttributes-CbNpPur2-BzFN0z5X.js","./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./projectPointToVector-B2UUY9SE-DeA9AEsl.js","./projection-BA9M1R7d-DoNqITCd.js","./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js","./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js","./vec3-BazNroeq-CFXHYIOm.js","./BufferView-PQoE3GL7-DXIpDOUe.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-maVOs7I3.js"])))=>i.map(i=>d[i]); -import{aK as k,v as E,S as O,i as Q,aB as U,bp as P,ah as $,K as M,f,aq as v,o as S,n as V,bX as T,_ as N,C,a3 as G,az as B,el as H,W as z,a1 as x,J as W,aC as X,he as J,jd as Z,bi as K,g as Y}from"./main-BZaw9FpY.js";import{a as ee}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{y as te}from"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import{t as ae}from"./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js";import{S as se}from"./External-D_wl4XAw-MFWeclAP.js";import{L as re,J as ie,Q as ne}from"./projection-BA9M1R7d-DoNqITCd.js";import{V as oe}from"./MeshTransform-C--IG09w-B7P01ZzU.js";import{isFeatureIdentifierArrayWithGlobalId as ue,isFeatureIdentifierArrayWithObjectId as le}from"./editingSupport-gUqP9iyf-Bz3XNCt8.js";import{d as de}from"./clientSideDefaults-BqqayPct-BMC57bnT.js";import{C as ce}from"./QueryTask-CwHwH2rS-CU-oJwb3.js";import{L as pe}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{c as A}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{S as he}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{u as ye}from"./executeQueryJSON-CcHnccia-DVecwfbV.js";import{c as me}from"./editsZScale-BDsX6vv--CeDyYvz6.js";import{b as fe}from"./Query-BrwMGK8U-sojFdYaD.js";import{k as ge}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{W as we,H as be,P as qe,j as Ie}from"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Bk09s2KF.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./executeForIds-Z1gkLduF-Daa1fnES.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./executeQueryPBF-o8010HS9-dWp8mQx-.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";async function D(t,e,a){const{geometry:r}=e,s={...e.attributes};if(a!=null&&r?.type==="mesh"){const{transformFieldRoles:i}=a,{origin:n,spatialReference:o,vertexSpace:u}=r,d=r.transform??new oe,l=u.type==="local",p=t.spatialReference,q=p.isGeographic,I=X(p,o),h=re(o,p)&&ie(o,p);if(!(l&&q&&h||!l&&!q&&I))return null;const c=ne(n,o,p);if(c==null)return null;if(s[i.originX]=c.x,s[i.originY]=c.y,s[i.originZ]=c.z??0,d!=null){const{translation:R,scale:y,rotation:g}=d,m=l?1:J(o)/J(p);s[i.translationX]=R[0]*m,s[i.translationY]=R[2]*m,s[i.translationZ]=-R[1]*m,s[i.scaleX]=y[0],s[i.scaleY]=y[2],s[i.scaleZ]=y[1],s[i.rotationX]=g[0],s[i.rotationY]=g[2],s[i.rotationZ]=-g[1],s[i.rotationDeg]=g[3]}return{attributes:s}}return r==null?{attributes:s}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:s}}async function Re(t,e){const a=await Promise.all((e.addAttachments??[]).map(i=>L(t,i))),r=await Promise.all((e.updateAttachments??[]).map(i=>L(t,i))),s=e.deleteAttachments??[];return a.length||r.length||s.length?{adds:a,updates:r,deletes:[...s]}:null}async function L(t,e){const{feature:a,attachment:r}=e,{globalId:s,name:i,contentType:n,data:o,uploadId:u}=r,d={globalId:s};if(a&&("attributes"in a?d.parentGlobalId=a.attributes?.[t.globalIdField]:a.globalId&&(d.parentGlobalId=a.globalId)),u)d.uploadId=u;else if(o){const l=await Z(o);l&&(d.contentType=l.mediaType,d.data=l.data),o instanceof File&&(d.name=o.name)}return i&&(d.name=i),n&&(d.contentType=n),d}function Se(t,e,a){if(!e||e.length===0)return[];if(a&&ue(e))return e.map(s=>s.globalId);if(le(e))return e.map(s=>s.objectId);const r=a?t.globalIdField:t.objectIdField;return r?e.map(s=>s.getAttribute(r)):[]}function _e(t){const e=t?.assetMaps;if(e){for(const s of e.addResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`);for(const s of e.updateResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`)}const a=t?.attachments,r={addFeatureResults:t?.addResults?.map(b)??[],updateFeatureResults:t?.updateResults?.map(b)??[],deleteFeatureResults:t?.deleteResults?.map(b)??[],addAttachmentResults:a?.addResults?a.addResults.map(b):[],updateAttachmentResults:a?.updateResults?a.updateResults.map(b):[],deleteAttachmentResults:a?.deleteResults?a.deleteResults.map(b):[]};return t?.editMoment&&(r.editMoment=t.editMoment),r}function b(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new S("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function F(t,e){return new K({attributes:t.attributes,geometry:Y({...t.geometry,spatialReference:e})})}function Ee(t,e){return{adds:t?.adds?.map(a=>F(a,e))||[],updates:t?.updates?.map(a=>({original:F(a[0],e),current:F(a[1],e)}))||[],deletes:t?.deletes?.map(a=>F(a,e))||[],spatialReference:e}}function Oe(t){const e=t.details.raw,a=+e.code,r=+e.extendedCode;return a===500&&(r===-2147217144||r===-2147467261)}const Ae=new k({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),Fe=new k({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let _=class extends U{constructor(t){super(t),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=P(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const a=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:a,updates:a?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}initialize(){this.addHandles([$(()=>{const t=this.layer;return t&&"lastEditsEventDate"in t?t.lastEditsEventDate:null},t=>this._handleLastEditsEventChange(t))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:t,parsedUrl:e,gdbVersion:a,spatialReference:r,fieldsIndex:s}=this.layer,i="infoFor3D"in this.layer?this.layer.infoFor3D:null,n="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,o=M("featurelayer-pbf")&&t?.query.supportsFormatPBF&&i==null,u=t?.operations?.supportsQueryAttachments??!1;return new ce({url:e.path,pbfSupported:o,fieldsIndex:s,infoFor3D:i,dynamicDataSource:n,gdbVersion:a,sourceSpatialReference:r,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/addAttachment",i=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(e,i.query);try{const o=await f(s,{body:n});return b(o.data.addAttachmentResult)}catch(o){throw this._createAttachmentErrorResult(r,o)}}async updateAttachment(t,e,a){await this.load();const{layer:r}=this;await A(r,"editing");const s=t.attributes[r.objectIdField],i=r.parsedUrl.path+"/"+s+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:e}}),o=this._getFormDataForAttachment(a,n.query);try{const u=await f(i,{body:o});return b(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(s,u)}}async applyEdits(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r="infoFor3D"in a?a.infoFor3D:null,s=r!=null,i=s||(e?.globalIdUsed??!1),n=s?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,o=t.addFeatures?.map(w=>D(this.layer,w,r))??[],u=(await Promise.all(o)).filter(v),d=t.updateFeatures?.map(w=>D(this.layer,w,r))??[],l=(await Promise.all(d)).filter(v),p=Se(this.layer,t.deleteFeatures,i);me(u,l,a.spatialReference);const q=await Re(this.layer,t),I=a.capabilities.editing.supportsAsyncApplyEdits&&s,h=e?.gdbVersion||a.gdbVersion,c={gdbVersion:h,rollbackOnFailure:e?.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:e?.returnEditMoment,usePreviousEditMoment:e?.usePreviousEditMoment,async:I};await we(this.layer.url,h,!0);const R=be(this.layer.url,h||null);if(await qe(a.url,h,a.historicMoment))throw new S("feature-layer-source:historic-version","Editing a historic version is not allowed");e?.returnServiceEditsOption?(c.edits=JSON.stringify([{id:a.layerId,adds:u.length?u:null,updates:l.length?l:null,deletes:p.length?p:null,attachments:q,assetMaps:n}]),c.returnServiceEditsOption=Ae.toJSON(e?.returnServiceEditsOption),c.returnServiceEditsInSourceSR=e?.returnServiceEditsInSourceSR):(c.adds=u.length?JSON.stringify(u):null,c.updates=l.length?JSON.stringify(l):null,c.deletes=p.length?i?JSON.stringify(p):p.join(","):null,c.attachments=q&&JSON.stringify(q),c.assetMaps=n!=null?JSON.stringify(n):void 0);const y=this._getLayerRequestOptions({method:"post",query:c});R&&(y.authMode="immediate",y.query.returnEditMoment=!0,y.query.sessionId=Ie);const g=e?.returnServiceEditsOption?a.url:a.parsedUrl.path;let m;try{m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}catch(w){if(!Oe(w))throw w;y.authMode="immediate",m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}return this._createEditsResult(m)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await f(s,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(b)}catch(i){throw this._createAttachmentErrorResult(r,i)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await f(`${s}/${r}`,a),{id:n,extent:o,fullExtent:u,timeExtent:d}=i,l=o||u;return{id:n,fullExtent:l&&V.fromJSON(l),timeExtent:d&&ge.fromJSON({start:d[0],end:d[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return t.outStatistics?.length&&a.features.length&&a.features.forEach(r=>{const s=r.attributes;t.outStatistics?.forEach(({outStatisticFieldName:i})=>{if(i){const n=i.toLowerCase();n&&n in s&&i!==n&&(s[i]=s[n],delete s[n])}})}),a}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryBins(t,e){return await this.load(),this.queryTask.executeBinsQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!pe(this.layer.url))return"unavailable";const t=T(this.layer.url,"status"),e=await f(t,{query:{f:"json"}});return Fe.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await N(()=>import("./uploadAssets-fBa6NH35-P_9VDEG7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url);return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}_handleLastEditsEventChange(t){const e=this.layer;if(t==null||!("capabilities"in e)||!("effectiveCapabilities"in e)||!(!e.capabilities?.operations?.supportsEditing&&e.effectiveCapabilities?.operations?.supportsEditing))return;const a=e.url;a!=null&&("layerId"in e&&T(a,e.layerId.toString()),this._getOrCreateEditInterceptor(a).before=r=>{const s=r.requestOptions.method??"auto";if(s==="auto"||s==="head"){const i=r.requestOptions.query??{};i._ts=t.getTime(),r.requestOptions.query=i}})}_getOrCreateEditInterceptor(t){return this._editInterceptor==null&&(this._editInterceptor={urls:t},C.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(G(C.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(t,e){const a=(await f(t,e)).data.statusUrl;for(;;){const r=(await f(a,{query:{f:"json"},responseType:"json"})).data;switch(r.status){case"Completed":return f(r.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new S("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new S("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await B(xe)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t?.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const r={};M("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),e?.cacheBust&&(r._ts=Date.now());const{data:s}=await f(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:e?.signal}));t=s}this.sourceJSON=await this._patchServiceJSON(t,e?.signal);const a=t.type;if(!this.supportedSourceTypes.has(a))throw new S("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){if(t.type!=="Table"&&t.geometryType&&!t?.drawingInfo?.renderer&&!t.defaultSymbol){const a=de(t.geometryType).renderer;H("drawingInfo.renderer",a,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:a}=await f(this.layer.url,this._getLayerRequestOptions({signal:e}));a.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:a.spatialReference})}catch(a){z(a)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!e?.length||await this._areAllAssetsAlreadyMapped(e))return null;const a=t.addFeatures.filter(i=>i.geometry);if(e.length!==a.length+t.updateFeatures.length)throw new S("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const r=new Array,s=new Map;for(const i of e){const{geometry:n}=i,{vertexSpace:o}=n;if(ae(o))r.push(n);else{const u=n.origin,{convertMeshVertexSpace:d}=await N(async()=>{const{convertMeshVertexSpace:p}=await import("./convertMeshVertexSpace-BO7NR5uA-BDll_-Zx.js");return{convertMeshVertexSpace:p}},__vite__mapDeps([18,1,2,19,20,21,9,12,8,10,14,22,23,24,25,26,27,28,29,30,31,15,32]),import.meta.url),l=await d(n,new te({origin:[u.x,u.y,u.z??0]}));s.set(l,n),i.geometry=l,r.push(l)}}await this.uploadAssets(r);for(const[i,n]of s)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(e),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,r=this.layer.parsedUrl;for(const s of t){const i=s.geometry,{metadata:n}=i,o=n.getExternalSourcesOnService(r),u=s.getAttribute(a);if(o.length===0){x.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:d}=o.find(se)??o[0];for(const l of d)l.parts.length===1?e.push({globalId:ee(),parentGlobalId:u,assetName:l.assetName,assetHash:l.parts[0].partHash,flags:[]}):x.getLogger(this).error(`Skipping asset ${l.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,r=[];let s=null;if(Array.isArray(e))for(const n of e)r.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===a&&(s={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else s=e;const i=_e(s);if(r.length>0){i.editedFeatureResults=[];for(const n of r){const{editedFeatures:o}=n,u=o?.spatialReference?new W(o.spatialReference):null;i.editedFeatureResults.push({layerId:n.id,editedFeatures:Ee(o,u)})}}return i}_createAttachmentErrorResult(t,e){const a=e.details.messages?.[0]||e.message,r=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new S("feature-layer-source:attachment-failure",a,{code:r})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const r in e){const s=e[r];s!=null&&(a.set?a.set(r,s):a.append(r,s))}return a}_getLayerRequestOptions(t={}){const{layer:e,layer:{parsedUrl:a,gdbVersion:r}}=this;return{...t,query:{gdbVersion:r,layer:"dynamicDataSource"in e&&e.dynamicDataSource?JSON.stringify({source:e.dynamicDataSource}):void 0,...a.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _areAllAssetsAlreadyMapped(t){const{layer:e}=this,{globalIdField:a,parsedUrl:r}=e,s="infoFor3D"in e?e.infoFor3D:null;if(s==null||a==null)return!1;const i=he(s);if(i==null)return!1;const n=T(r.path,`../${i.id}`),o=new Array;for(const h of t){if(!(h.geometry.metadata.getExternalSourcesOnService(r).length>0))return!1;o.push(h)}const u=o.map(h=>h.getAttribute(a)).filter(v);if(u.length===0)return!1;const{assetMapFieldRoles:{parentGlobalId:d,assetHash:l}}=s,p=new fe({where:`${d} IN (${u.map(h=>`'${h}'`)})`,outFields:[l,d],returnGeometry:!1}),q=await ye(n,p),{features:I}=q;return I.length!==0&&!o.some(h=>{const c=h.getAttribute(a);if(!c)return!0;const{metadata:R}=h.geometry,y=I.filter(m=>m.getAttribute(d)===c);if(y.length===0)return!0;const g=y.map(m=>m.getAttribute(l));return R.getExternalSourcesOnService(r).flatMap(({source:m})=>m.flatMap(w=>w.parts.map(j=>j.partHash))).some(m=>g.every(w=>m!==w))})}};E([O()],_.prototype,"type",void 0),E([O({constructOnly:!0})],_.prototype,"layer",void 0),E([O({constructOnly:!0})],_.prototype,"supportedSourceTypes",void 0),E([O({readOnly:!0})],_.prototype,"queryTask",null),_=E([Q("esri.layers.graphics.sources.FeatureLayerSource")],_);const xe=1e3,$t=_;export{$t as default}; diff --git a/main/assets/FeatureLayerSource-k4WMYop1-z-zJ1lao.js b/main/assets/FeatureLayerSource-k4WMYop1-z-zJ1lao.js new file mode 100644 index 000000000..eef647b73 --- /dev/null +++ b/main/assets/FeatureLayerSource-k4WMYop1-z-zJ1lao.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./uploadAssets-fBa6NH35-CEsLPQQ4.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./External-D_wl4XAw-Bzqlxz38.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./meshSpatialReferenceScaleUtils-B1zR72Os-BsiWm3Am.js","./MeshTransform-C--IG09w-QYZk68_K.js","./mat4-DX7gBViE-vewreEuZ.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Dbd8ftOx.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./vec42-D8CJyqHG-DnfLTeQH.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./meshFeatureAttributes-BwKR5odo-D0ENCfZG.js","./convertMeshVertexSpace-BO7NR5uA-Clnp7CLV.js","./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js","./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js","./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./projectPointToVector-B2UUY9SE-BWg0qYG-.js","./projection-BA9M1R7d-DXrPfsKU.js","./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./vec3-BazNroeq-Cdhfm-VN.js","./BufferView-PQoE3GL7-M6q1od-Y.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-DGtcegeJ.js"])))=>i.map(i=>d[i]); +import{aK as k,v as E,S as O,i as Q,aB as U,bp as P,ah as $,K as M,f,aq as v,o as S,n as V,bX as T,_ as N,C,a3 as G,az as B,el as H,W as z,a1 as x,J as W,aC as X,he as J,jd as Z,bi as K,g as Y}from"./main-C7yV2j71.js";import{a as ee}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{y as te}from"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import{t as ae}from"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import{S as se}from"./External-D_wl4XAw-Bzqlxz38.js";import{L as re,J as ie,Q as ne}from"./projection-BA9M1R7d-DXrPfsKU.js";import{V as oe}from"./MeshTransform-C--IG09w-QYZk68_K.js";import{isFeatureIdentifierArrayWithGlobalId as ue,isFeatureIdentifierArrayWithObjectId as le}from"./editingSupport-gUqP9iyf-3W9GNLNT.js";import{d as de}from"./clientSideDefaults-BqqayPct-B0cLE-po.js";import{C as ce}from"./QueryTask-CwHwH2rS-CT1NKU1Q.js";import{L as pe}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{c as A}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{S as he}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{u as ye}from"./executeQueryJSON-CcHnccia-CB1D7q08.js";import{c as me}from"./editsZScale-BDsX6vv--CoeIQyxn.js";import{b as fe}from"./Query-BrwMGK8U-DV_czrJX.js";import{k as ge}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{W as we,H as be,P as qe,j as Ie}from"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Dbd8ftOx.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./executeForIds-Z1gkLduF-BNBrXf-U.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./executeQueryPBF-o8010HS9-E5WwNUPn.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";async function D(t,e,a){const{geometry:r}=e,s={...e.attributes};if(a!=null&&r?.type==="mesh"){const{transformFieldRoles:i}=a,{origin:n,spatialReference:o,vertexSpace:u}=r,d=r.transform??new oe,l=u.type==="local",p=t.spatialReference,q=p.isGeographic,I=X(p,o),h=re(o,p)&&ie(o,p);if(!(l&&q&&h||!l&&!q&&I))return null;const c=ne(n,o,p);if(c==null)return null;if(s[i.originX]=c.x,s[i.originY]=c.y,s[i.originZ]=c.z??0,d!=null){const{translation:R,scale:y,rotation:g}=d,m=l?1:J(o)/J(p);s[i.translationX]=R[0]*m,s[i.translationY]=R[2]*m,s[i.translationZ]=-R[1]*m,s[i.scaleX]=y[0],s[i.scaleY]=y[2],s[i.scaleZ]=y[1],s[i.rotationX]=g[0],s[i.rotationY]=g[2],s[i.rotationZ]=-g[1],s[i.rotationDeg]=g[3]}return{attributes:s}}return r==null?{attributes:s}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:s}}async function Re(t,e){const a=await Promise.all((e.addAttachments??[]).map(i=>L(t,i))),r=await Promise.all((e.updateAttachments??[]).map(i=>L(t,i))),s=e.deleteAttachments??[];return a.length||r.length||s.length?{adds:a,updates:r,deletes:[...s]}:null}async function L(t,e){const{feature:a,attachment:r}=e,{globalId:s,name:i,contentType:n,data:o,uploadId:u}=r,d={globalId:s};if(a&&("attributes"in a?d.parentGlobalId=a.attributes?.[t.globalIdField]:a.globalId&&(d.parentGlobalId=a.globalId)),u)d.uploadId=u;else if(o){const l=await Z(o);l&&(d.contentType=l.mediaType,d.data=l.data),o instanceof File&&(d.name=o.name)}return i&&(d.name=i),n&&(d.contentType=n),d}function Se(t,e,a){if(!e||e.length===0)return[];if(a&&ue(e))return e.map(s=>s.globalId);if(le(e))return e.map(s=>s.objectId);const r=a?t.globalIdField:t.objectIdField;return r?e.map(s=>s.getAttribute(r)):[]}function _e(t){const e=t?.assetMaps;if(e){for(const s of e.addResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`);for(const s of e.updateResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`)}const a=t?.attachments,r={addFeatureResults:t?.addResults?.map(b)??[],updateFeatureResults:t?.updateResults?.map(b)??[],deleteFeatureResults:t?.deleteResults?.map(b)??[],addAttachmentResults:a?.addResults?a.addResults.map(b):[],updateAttachmentResults:a?.updateResults?a.updateResults.map(b):[],deleteAttachmentResults:a?.deleteResults?a.deleteResults.map(b):[]};return t?.editMoment&&(r.editMoment=t.editMoment),r}function b(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new S("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function F(t,e){return new K({attributes:t.attributes,geometry:Y({...t.geometry,spatialReference:e})})}function Ee(t,e){return{adds:t?.adds?.map(a=>F(a,e))||[],updates:t?.updates?.map(a=>({original:F(a[0],e),current:F(a[1],e)}))||[],deletes:t?.deletes?.map(a=>F(a,e))||[],spatialReference:e}}function Oe(t){const e=t.details.raw,a=+e.code,r=+e.extendedCode;return a===500&&(r===-2147217144||r===-2147467261)}const Ae=new k({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),Fe=new k({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let _=class extends U{constructor(t){super(t),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=P(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const a=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:a,updates:a?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}initialize(){this.addHandles([$(()=>{const t=this.layer;return t&&"lastEditsEventDate"in t?t.lastEditsEventDate:null},t=>this._handleLastEditsEventChange(t))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:t,parsedUrl:e,gdbVersion:a,spatialReference:r,fieldsIndex:s}=this.layer,i="infoFor3D"in this.layer?this.layer.infoFor3D:null,n="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,o=M("featurelayer-pbf")&&t?.query.supportsFormatPBF&&i==null,u=t?.operations?.supportsQueryAttachments??!1;return new ce({url:e.path,pbfSupported:o,fieldsIndex:s,infoFor3D:i,dynamicDataSource:n,gdbVersion:a,sourceSpatialReference:r,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/addAttachment",i=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(e,i.query);try{const o=await f(s,{body:n});return b(o.data.addAttachmentResult)}catch(o){throw this._createAttachmentErrorResult(r,o)}}async updateAttachment(t,e,a){await this.load();const{layer:r}=this;await A(r,"editing");const s=t.attributes[r.objectIdField],i=r.parsedUrl.path+"/"+s+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:e}}),o=this._getFormDataForAttachment(a,n.query);try{const u=await f(i,{body:o});return b(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(s,u)}}async applyEdits(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r="infoFor3D"in a?a.infoFor3D:null,s=r!=null,i=s||(e?.globalIdUsed??!1),n=s?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,o=t.addFeatures?.map(w=>D(this.layer,w,r))??[],u=(await Promise.all(o)).filter(v),d=t.updateFeatures?.map(w=>D(this.layer,w,r))??[],l=(await Promise.all(d)).filter(v),p=Se(this.layer,t.deleteFeatures,i);me(u,l,a.spatialReference);const q=await Re(this.layer,t),I=a.capabilities.editing.supportsAsyncApplyEdits&&s,h=e?.gdbVersion||a.gdbVersion,c={gdbVersion:h,rollbackOnFailure:e?.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:e?.returnEditMoment,usePreviousEditMoment:e?.usePreviousEditMoment,async:I};await we(this.layer.url,h,!0);const R=be(this.layer.url,h||null);if(await qe(a.url,h,a.historicMoment))throw new S("feature-layer-source:historic-version","Editing a historic version is not allowed");e?.returnServiceEditsOption?(c.edits=JSON.stringify([{id:a.layerId,adds:u.length?u:null,updates:l.length?l:null,deletes:p.length?p:null,attachments:q,assetMaps:n}]),c.returnServiceEditsOption=Ae.toJSON(e?.returnServiceEditsOption),c.returnServiceEditsInSourceSR=e?.returnServiceEditsInSourceSR):(c.adds=u.length?JSON.stringify(u):null,c.updates=l.length?JSON.stringify(l):null,c.deletes=p.length?i?JSON.stringify(p):p.join(","):null,c.attachments=q&&JSON.stringify(q),c.assetMaps=n!=null?JSON.stringify(n):void 0);const y=this._getLayerRequestOptions({method:"post",query:c});R&&(y.authMode="immediate",y.query.returnEditMoment=!0,y.query.sessionId=Ie);const g=e?.returnServiceEditsOption?a.url:a.parsedUrl.path;let m;try{m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}catch(w){if(!Oe(w))throw w;y.authMode="immediate",m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}return this._createEditsResult(m)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await f(s,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(b)}catch(i){throw this._createAttachmentErrorResult(r,i)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await f(`${s}/${r}`,a),{id:n,extent:o,fullExtent:u,timeExtent:d}=i,l=o||u;return{id:n,fullExtent:l&&V.fromJSON(l),timeExtent:d&&ge.fromJSON({start:d[0],end:d[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return t.outStatistics?.length&&a.features.length&&a.features.forEach(r=>{const s=r.attributes;t.outStatistics?.forEach(({outStatisticFieldName:i})=>{if(i){const n=i.toLowerCase();n&&n in s&&i!==n&&(s[i]=s[n],delete s[n])}})}),a}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryBins(t,e){return await this.load(),this.queryTask.executeBinsQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!pe(this.layer.url))return"unavailable";const t=T(this.layer.url,"status"),e=await f(t,{query:{f:"json"}});return Fe.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await N(()=>import("./uploadAssets-fBa6NH35-CEsLPQQ4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url);return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}_handleLastEditsEventChange(t){const e=this.layer;if(t==null||!("capabilities"in e)||!("effectiveCapabilities"in e)||!(!e.capabilities?.operations?.supportsEditing&&e.effectiveCapabilities?.operations?.supportsEditing))return;const a=e.url;a!=null&&("layerId"in e&&T(a,e.layerId.toString()),this._getOrCreateEditInterceptor(a).before=r=>{const s=r.requestOptions.method??"auto";if(s==="auto"||s==="head"){const i=r.requestOptions.query??{};i._ts=t.getTime(),r.requestOptions.query=i}})}_getOrCreateEditInterceptor(t){return this._editInterceptor==null&&(this._editInterceptor={urls:t},C.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(G(C.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(t,e){const a=(await f(t,e)).data.statusUrl;for(;;){const r=(await f(a,{query:{f:"json"},responseType:"json"})).data;switch(r.status){case"Completed":return f(r.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new S("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new S("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await B(xe)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t?.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const r={};M("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),e?.cacheBust&&(r._ts=Date.now());const{data:s}=await f(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:e?.signal}));t=s}this.sourceJSON=await this._patchServiceJSON(t,e?.signal);const a=t.type;if(!this.supportedSourceTypes.has(a))throw new S("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){if(t.type!=="Table"&&t.geometryType&&!t?.drawingInfo?.renderer&&!t.defaultSymbol){const a=de(t.geometryType).renderer;H("drawingInfo.renderer",a,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:a}=await f(this.layer.url,this._getLayerRequestOptions({signal:e}));a.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:a.spatialReference})}catch(a){z(a)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!e?.length||await this._areAllAssetsAlreadyMapped(e))return null;const a=t.addFeatures.filter(i=>i.geometry);if(e.length!==a.length+t.updateFeatures.length)throw new S("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const r=new Array,s=new Map;for(const i of e){const{geometry:n}=i,{vertexSpace:o}=n;if(ae(o))r.push(n);else{const u=n.origin,{convertMeshVertexSpace:d}=await N(async()=>{const{convertMeshVertexSpace:p}=await import("./convertMeshVertexSpace-BO7NR5uA-Clnp7CLV.js");return{convertMeshVertexSpace:p}},__vite__mapDeps([18,1,2,19,20,21,9,12,8,10,14,22,23,24,25,26,27,28,29,30,31,15,32]),import.meta.url),l=await d(n,new te({origin:[u.x,u.y,u.z??0]}));s.set(l,n),i.geometry=l,r.push(l)}}await this.uploadAssets(r);for(const[i,n]of s)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(e),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,r=this.layer.parsedUrl;for(const s of t){const i=s.geometry,{metadata:n}=i,o=n.getExternalSourcesOnService(r),u=s.getAttribute(a);if(o.length===0){x.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:d}=o.find(se)??o[0];for(const l of d)l.parts.length===1?e.push({globalId:ee(),parentGlobalId:u,assetName:l.assetName,assetHash:l.parts[0].partHash,flags:[]}):x.getLogger(this).error(`Skipping asset ${l.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,r=[];let s=null;if(Array.isArray(e))for(const n of e)r.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===a&&(s={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else s=e;const i=_e(s);if(r.length>0){i.editedFeatureResults=[];for(const n of r){const{editedFeatures:o}=n,u=o?.spatialReference?new W(o.spatialReference):null;i.editedFeatureResults.push({layerId:n.id,editedFeatures:Ee(o,u)})}}return i}_createAttachmentErrorResult(t,e){const a=e.details.messages?.[0]||e.message,r=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new S("feature-layer-source:attachment-failure",a,{code:r})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const r in e){const s=e[r];s!=null&&(a.set?a.set(r,s):a.append(r,s))}return a}_getLayerRequestOptions(t={}){const{layer:e,layer:{parsedUrl:a,gdbVersion:r}}=this;return{...t,query:{gdbVersion:r,layer:"dynamicDataSource"in e&&e.dynamicDataSource?JSON.stringify({source:e.dynamicDataSource}):void 0,...a.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _areAllAssetsAlreadyMapped(t){const{layer:e}=this,{globalIdField:a,parsedUrl:r}=e,s="infoFor3D"in e?e.infoFor3D:null;if(s==null||a==null)return!1;const i=he(s);if(i==null)return!1;const n=T(r.path,`../${i.id}`),o=new Array;for(const h of t){if(!(h.geometry.metadata.getExternalSourcesOnService(r).length>0))return!1;o.push(h)}const u=o.map(h=>h.getAttribute(a)).filter(v);if(u.length===0)return!1;const{assetMapFieldRoles:{parentGlobalId:d,assetHash:l}}=s,p=new fe({where:`${d} IN (${u.map(h=>`'${h}'`)})`,outFields:[l,d],returnGeometry:!1}),q=await ye(n,p),{features:I}=q;return I.length!==0&&!o.some(h=>{const c=h.getAttribute(a);if(!c)return!0;const{metadata:R}=h.geometry,y=I.filter(m=>m.getAttribute(d)===c);if(y.length===0)return!0;const g=y.map(m=>m.getAttribute(l));return R.getExternalSourcesOnService(r).flatMap(({source:m})=>m.flatMap(w=>w.parts.map(j=>j.partHash))).some(m=>g.every(w=>m!==w))})}};E([O()],_.prototype,"type",void 0),E([O({constructOnly:!0})],_.prototype,"layer",void 0),E([O({constructOnly:!0})],_.prototype,"supportedSourceTypes",void 0),E([O({readOnly:!0})],_.prototype,"queryTask",null),_=E([Q("esri.layers.graphics.sources.FeatureLayerSource")],_);const xe=1e3,$t=_;export{$t as default}; diff --git a/main/assets/FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js b/main/assets/FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js deleted file mode 100644 index d7e0b128e..000000000 --- a/main/assets/FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js +++ /dev/null @@ -1,9 +0,0 @@ -import{v as h,S as f,i as Q,a0 as ut,aS as Ae,b as ye,b9 as K,o as C,bE as ct,bt as Me,bi as we,ag as dt,aq as pt,a2 as Pe,n as ht,K as g,ah as pe,aL as ft,aA as yt,a1 as x,hC as ke,aU as Ne,j2 as mt,j as et,J as gt,$ as he,I as bt,P as ae,bV as Fe,fl as Ue,hm as St,bh as vt,f4 as H,ax as _t,ai as Be,eQ as Le,j3 as De,ex as wt,j4 as je,j5 as It,j6 as Je,j7 as Vt,j8 as Ft,eH as oe,ey as ve,iJ as xt,ae as tt,eC as it,eD as Et,eB as Rt}from"./main-BZaw9FpY.js";import{t as Ot}from"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import{c as $e}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{k as Qe}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import ee from"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import{T as Ct}from"./timeSupport-ohWmWReZ-CwKm-94j.js";import{O as Ie}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{b as me}from"./Query-BrwMGK8U-sojFdYaD.js";import{X as Tt,Y as zt}from"./LayerView-Bish-E63-DRGspiuk.js";import{i as qt}from"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import{j as At,Z as He,G as Ge}from"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import{s as Mt,E as le,R as L,h as Pt,N as We}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{_ as kt,u as te,o as S,Q as A,h as xe,r as E,W as ge,U as Nt,b as ue,N as k,c as ie,l as Ee}from"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import{D as Re,k as G,bt as Ut,bu as Bt}from"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import{i as rt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./Tile-D75RMC64-DprBAZDK.js";import{s as Y}from"./TileKey-C5IL-JBr-0HJjsV9n.js";import{i as Lt}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{q as Dt}from"./workers-PiCjreoO-oGzLvkSt.js";import{h as jt}from"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import{L as be}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{m as Jt}from"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import{i as q}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{p as $t}from"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import{Q as Qt}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{x as Ht}from"./heatmapUtils-seiMkkkR-D9lAE87R.js";import{r as j,o as ce}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{V as Gt}from"./SDFHelper-B6k8Ig6R-KWOw5fv6.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import{l as de}from"./definitions-DJSdSb77-DkoRHaVx.js";import{n as Wt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{i as Kt}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import{x as Zt}from"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import{i as Ke}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{m as _e,h as Yt}from"./popupUtils-nV1O8RUO-xbvi-u4x.js";import{n as Xt}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";let fe=class extends we{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer?.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};h([f({type:Boolean})],fe.prototype,"isAggregate",void 0),fe=h([Q("esri.AggregateGraphic")],fe);const Oe=fe;let v=class extends et{constructor(e){super(e),this._filter=null,this.duration=g("mapview-transitions-duration"),this._excludedEffectView=new $e(e),this._includedEffectView=new $e(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){return this._filter||this.featureEffect?.filter||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}get transitioningToEmpty(){return!this._excludedEffectView.final&&!this._includedEffectView.final}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransition(){this._includedEffectView.endTransition(),this._excludedEffectView.endTransition(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),i=e,r=i?.includedEffect,s=i?.excludedEffect,a=this._includedEffectView.canTransitionTo(r)&&this._excludedEffectView.canTransitionTo(s);this._includedEffectView.effect=r,this._excludedEffectView.effect=s,this._set("featureEffect",i),this._filter=i?.filter||t?.filter||null,a||this.endTransition()}};h([f()],v.prototype,"_filter",void 0),h([f()],v.prototype,"_excludedEffectView",void 0),h([f()],v.prototype,"_includedEffectView",void 0),h([f()],v.prototype,"duration",void 0),h([f()],v.prototype,"excludedEffects",null),h([f()],v.prototype,"featureEffect",null),h([f()],v.prototype,"filter",null),h([f()],v.prototype,"hasEffects",null),h([f()],v.prototype,"includedEffects",null),h([f({value:0})],v.prototype,"scale",null),h([f()],v.prototype,"transitioning",null),h([f()],v.prototype,"transitioningToEmpty",null),v=h([Q("esri.layers.effects.FeatureEffectView")],v);const ei=v;let X=class extends Ie{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const i=gt.fromJSON(t.spatialReference),r=[];for(let s=0;se)break;this._updateTile(t),this._pendingUpdates.dequeue()}}removeTile(e){const t=this._tiles.get(e);g("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}flush(){for(;this._pendingUpdates.size;){const e=this._pendingUpdates.dequeue();e!=null&&this._updateTile(e)}for(const e of this._tiles.values())e.upload()}_updateTile(e){const{inner:t,objectIdMap:i}=e,r=this.getSubscriptionVersion(t.id);if(r!==t.subscriptionVesrion){if(g("esri-2d-update-debug")){const o=`${t.subscriptionVesrion} != ${r}`;console.debug(`Version[${o}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(g("esri-2d-update-debug")){const o=t.debugInfo?.chunkId??"";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${o}] RenderState.updateTile [${t.type}]`,t)}const s=this._ensureTile(t.id);if(t.type==="update"){const[o,...l]=t.modify;s.onMessage({type:"update",modify:o,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const u of l){const d=this._tiles.get(u.tileId);d&&d.onMessage({type:"update",modify:u,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(t.append==null)return void s.onMessage({type:"append",clear:t.clear,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[a,...n]=t.append;s.onMessage({type:"append",clear:t.clear,append:a,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const o of n){const l=this._tiles.get(o.tileId);l&&l.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){g("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new Y(e),i=this._tileInfoView.getTileBounds(vt(),t),r=this._tileInfoView.getTileResolution(t.level),s=new Lt(t,r,i[0],i[3],!0);if(s.stage=this.getStage(),!s.stage){const a=new C("featurelayerview:webgl","Cannot create tile with empty stage");x.getLogger("esri.views.2d.layers.features.RenderState").error(a)}return s}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let r=-1;r<=1;r++)for(let s=-1;s<=1;s++){if(r===0&&s===0)continue;const a=e.key.getNormalizedNeighbor(s,r,i).id,n=this._tiles.get(a);if(n!=null){const o=1<i.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const i of this._renderState.tiles())i.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(i.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case le.MAP:return this._renderMapPhase(e);case le.HIGHLIGHT:return this._renderHighlightPhase(e);case le.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&S.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(oi(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:i}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=i;else{const r=new ai(t,i);this._subscriptions.set(t,r),this.updatingHandles.addPromise(r.promise)}for(const t of e.unsubscribe)this._subscriptions.get(t)?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){g("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new si(()=>this._stage,t=>this._subscriptions.get(t)?.version,e,this.tileInfoView)}getDisplayStatistics(e,t){const i=this._statisticsByLevel.get(e);return i?i.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let i=this._statisticsByLevel.get(e);i||(i=new Map,this._statisticsByLevel.set(e,i));for(const r of t)i.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){this._renderStateNext&&(g("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){he(t);const i=e.inner;if(!this._subscriptions.has(i.id))return;const r=this._subscriptions.get(i.id);if(r.version!==i.subscriptionVesrion){if(g("esri-2d-update-debug")){const a=`${i.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${a}] Tile[${i.id}] FeatureContainer - Dropping message, outdated version]`,i)}return}const s=this._renderStateNext??this._renderState;if(!s)throw new Error("InternalError: No renderState defined");s.version!==i.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${i.version}]`),s.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:r,y:s})=>r===e.x&&s===e.y);const i=ye();return t?t.resolvers.push(i):(t={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(t)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),i=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((s,a)=>i.set(a,s)),i.size===t.size)break;return i}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:i}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=i&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(this._getHeatmapInstance(e)==null)super.setStencilReference(e);else for(const t of this.children)t.stencilRef=S.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,L.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&Pt(e,!1,t=>{this._renderFeatures(t,L.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,L.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,L.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,L.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,i=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),s=t.getViewport(),a=e.passOptions,n=e.drawPhase;i.bind(e),e.passOptions=i.createOptions(e,this._hitTestsRequests),e.drawPhase=le.HITTEST;const{distance:o,smallSymbolDistance:l}=e.passOptions,u=Math.max(o,l);for(const d of this.children)d.visible&&d.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(d,e,L.All);i.draw(e),i.unbind(),t.bindFramebuffer(r),t.restoreViewport(s),e.passOptions=a,e.drawPhase=n}_renderFeatures(e,t){const i=this._getHeatmapInstance(e);i!=null?this._renderHeatmapFeatures(e,t,i):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const i of this.children)i.visible&&this._renderTile(i,e,t)}_renderHeatmapFeatures(e,t,i){for(const r of this.children)r.visible&&this._renderTile(r,e,t,Re.Heatmap);i.techniqueRef.renderResolvePass(e,i)}_renderTile(e,t,i,r){const s=g("featurelayer-force-marker-text-draw-order")?We.STRICT_MARKERS_AND_TEXT:We.BATCHING,a=e.getDisplayList(this._instanceStore,s);t.selection=i,a?.render(t,r)}};function oi(e){return e.techniqueRef.type===Re.Heatmap}async function li(e){const t=await Dt("FeaturePipelineWorker",{client:e,strategy:"dedicated"});return new ui(t)}let ui=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const ci=10;let O=class extends et{constructor(){super(...arguments),this.events=new bt,this._updatingStrategy=!0,this._tileToEvent=new jt,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e.peekLast()?.type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":{const t=new rt(ci);t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};h([f({readOnly:!0})],O.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],O.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],O.prototype,"hasFullGeometries",null),h([f()],O.prototype,"_updatingStrategy",void 0),h([f()],O.prototype,"_strategyInfo",void 0),h([f()],O.prototype,"_tileToEvent",void 0),O=h([Q("esri.views.2d.layers.features.FeatureSourceEventLog")],O);function R(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";case"multipatch":return"esriGeometryMultiPatch";case"multipoint":return"esriGeometryMultipoint";default:return null}}function w(e,t){const i=e.featureReduction;return i&&i.type!=="selection"&&(!("maxScale"in i)||!i.maxScale||i.maxScale=r?n:a+s*(n-a)}function yi(e,t){const i=e/t.minDataValue,r=F(t.minSize,e),s=F(t.maxSize,e);let a=null;return a=i*r,tt(a,r,s)}function mi(e,t){const[i,r,s]=bi(e,t.cache.ipData);if(i===r)return F(t.stops[i].size,e);{const a=F(t.stops[i].size,e);return a+(F(t.stops[r].size,e)-a)*s}}function gi(e,t){const i=Jt[t.valueUnit],r=F(t.minSize,e),s=F(t.maxSize,e),{valueRepresentation:a}=t;let n=null;return n=a==="area"?2*Math.sqrt(e/di)/i:a==="radius"||a==="distance"?2*e/i:e/i,tt(n,r,s)}function bi(e,t){if(!t)return;let i=0,r=t.length-1;return t.some((s,a)=>et.deconflictionStrategy!=="none"))??!1}function N(e,t){const i=w(e,t);if(i?.labelsVisible&&i.labelingInfo?.length)return i.labelingInfo.every(r=>r.deconflictionStrategy!=="none")}function Si(e){return t=>H(st(t,e))}function M(e){const t=e!=null&&"visualVariables"in e&&e.visualVariables;if(!t)return null;for(const i of t)if(i.type==="size")return Si(i);return null}function U(e,t,i,r){const s=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,a=Fe(e.definitionExpression,s),n=e.customParameters??{};return r&&(n.token=r),{type:"feature",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{queryScaleRanges:e.queryScaleRanges??[],definitionExpression:a,gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),timeExtent:e.timeExtent?.toJSON(),customParameters:n}}}}function vi(e,t,i=0){if(t==null)return e[i]=0,e[i+1]=0,e[i+2]=0,void(e[i+3]=0);const{r,g:s,b:a,a:n}=t;e[i]=r*n/255,e[i+1]=s*n/255,e[i+2]=a*n/255,e[i+3]=n}async function T(e,t){if(!e)return[];switch(e.type){case"simple-fill":return Ve(e,t);case"picture-fill":return Ci(e,t);case"simple-marker":return Ze(e,t);case"picture-marker":return Vi(e,t);case"simple-line":return J(e,t,!1);case"text":return xi(e,t);case"label":return Ei(e,t);case"cim":return te(e.data,t);case"web-style":{const i=await e.fetchCIMSymbol();return te(i.data,t)}case"line-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-line`),J(new Rt,t,!1);case"point-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-marker`),Ze(new Et,t);case"polygon-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-fill`),Ve(new it,t);case"mesh-3d":case"label-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function _i(e,t){const{schemaOptions:i}=t,{store:r}=i,s=new Array(de),a=new Array(de/4);for(let c=0;cue(n.color)),visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:e.attributes.length},optionalAttributes:{}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:k(s)});return[...e.backgroundFillSymbol?await Ve(e.backgroundFillSymbol,{schemaOptions:t,path:"",uniforms:ge}):[],a]}function at(e){if(e.style==="path"){if(e.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const t=G.fromSimpleMarker(e);if("outline"in e&&e.outline&&e.outline.style!=="none"&&e.outline.style!=="solid"){if(!t||!t.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:t.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:Gt(t),overrides:[]}}async function Ze(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;if(e.style==="path"||e.outline&&e.outline.style!=="solid"&&e.outline.style!=="none"){const p=G.fromSimpleMarker(e);if(!p||!p.symbolLayers)throw new Error("Error handling marker! ");if(i.visualVariableRotation&&(p.angleAlignment="Map"),e.style!=="path"){const y=p.symbolLayers[0];if(ie(t.uniforms)){const m=k(t.uniforms,0,1);if(m>y.size){const I=m/y.size;y.size=m;const V=y.markerGraphics?.[0].symbol;(V.symbolLayers&&V.symbolLayers[0]).width*=I}}}return te({type:"CIMSymbolReference",symbol:p},t)}const a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=at(e);let o=e.color?.toArray()??[0,0,0,0];n.resource.type==="CIMVectorMarker"&&(o=[255,255,255,255]);const l=e.style==="triangle"?124/116:1,u=e.size,d=u*l,c=i.visualVariableColor!=null&&(e.style==="cross"||e.style==="x");return[a.createMeshInfo({type:"simple",color:o,height:u,width:d,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:u,sprite:n,overrideOutlineColor:c,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]}function Vi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=G.createPictureMarkerRasterizationParam(e);return n?[a.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]:[]}function Fi(e,t,i){const{uniforms:r,schemaOptions:s}=i,{store:a}=s,n=a.ensureInstance(S.marker,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=at(e),l=6,u=l*t.width,d=u,c=e.color?.toArray()??t.color?.toArray()??[0,0,0,0],p=e.style==="cross"||e.style==="x";let y;switch(e.placement){case"begin-end":y=ce.Both;break;case"begin":y=ce.JustBegin;break;case"end":y=ce.JustEnd;break;default:y=ce.None}const m={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({type:"simple",color:c,height:d,width:u,offsetX:0,offsetY:0,angle:0,alignment:Ee(r)?j.MAP:j.SCREEN,outlineColor:c,outlineSize:p?t.width:0,referenceSize:d/l,sprite:o,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:ie(r),placement:m,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:k(r)})]}function xi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;return[s.ensureInstance(S.text,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}}).createMeshInfo({boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:G.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:k(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ei(e,t){const{schemaOptions:i,uniforms:r}=t,{store:s}=i,a=e.symbol,{allowOverrun:n,repeatLabel:o,repeatLabelDistance:l}=e,u={maxScale:e.maxScale??0,minScale:e.minScale??0},d=s.ensureInstance(S.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}}),c=e.labelPlacement,[p,y]=Ut(c);return[d.createMeshInfo({boxBackgroundColor:a.backgroundColor?.toArray(),boxBorderLineColor:a.borderLineColor?.toArray(),boxBorderLineSize:a.borderLineSize??0,color:a.color?.toArray()??[0,0,0,0],offsetX:a.xoffset,offsetY:a.yoffset,postAngle:a.angle,fontSize:a.font.size,decoration:a.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:a.haloColor?.toArray()??[0,0,0,0],haloSize:a.haloSize??0,lineWidth:a.lineWidth,lineHeightRatio:a.lineHeight,horizontalAlignment:p,verticalAlignment:y,repeatLabel:o,repeatLabelDistance:H(l),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:u,minPixelBuffer:k(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:a.font.toJSON(),textString:a.text,symbol:G.createCIMTextSymbolfromTextSymbol(a),primitiveName:"label-override"},useLegacyLabelEvaluationRules:e.labelExpressionInfo?.expression==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1})]}function Ce(e,t){const i=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:i,referenceWidth:i,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:t}}function Ri(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0],n={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if(e.outline?.style==="solid")return[s.ensureInstance(S.patternOutlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),sprite:n,scaleInfo:null,effects:null})];const o=[],l=s.ensureInstance(S.patternFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:n,scaleInfo:null,effects:null});return o.push(l),e.outline&&o.push(...J(e.outline,t,!0)),o}function Oi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0];if(e.style!=="none"&&e.outline?.style==="solid")return[s.ensureInstance(S.outlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})];const n=[];if(e.style!=="none"){const o=s.ensureInstance(S.fill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,scaleInfo:null,effects:null});n.push(o)}return e.outline&&n.push(...J(e.outline,t,!0)),n}async function Ve(e,t){if(e.type==="cim")return te(e.data,t);const{style:i}=e;return i&&i!=="none"&&i!=="solid"?Ri(e,t):Oi(e,t)}function Ci(e,t){const{outline:i}=e,{uniforms:r,schemaOptions:s}=t,{store:a}=s,n=[],o=G.createPictureFillRasterizationParam(e);if(!o)return[];const{width:l,height:u,xoffset:d,yoffset:c,xscale:p,yscale:y}=e,m={color:[255,255,255,255],sprite:o,height:u,aspectRatio:l/u,offsetX:d,offsetY:c,scaleX:p,scaleY:y,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if(i?.style==="solid")return[a.ensureInstance(S.complexOutlineFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...m,...Ce(i,!!r.visualVariableSizeOutlineScaleStops)})];const I=a.ensureInstance(S.complexFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return n.push(I.createMeshInfo(m)),i&&n.push(...J(i,t,!0)),n}function J(e,t,i){const{color:r,style:s,width:a,cap:n,join:o}=e,{schemaOptions:l}=t,{store:u}=l,d=[],c=i?{...ge,visualVariableSizeScaleStops:t.uniforms.visualVariableSizeOutlineScaleStops}:t.uniforms,p={uniforms:{visualVariableColor:c.visualVariableColor,visualVariableOpacity:c.visualVariableOpacity,visualVariableSizeMinMaxValue:c.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:c.visualVariableSizeScaleStops,visualVariableSizeStops:c.visualVariableSizeStops,visualVariableSizeUnitValue:c.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},y={color:r?.toArray()??[0,0,0,0],width:a,referenceWidth:a,capType:n,joinType:o,miterLimit:e.miterLimit,hasSizeVV:ie(c),effects:null,scaleInfo:null};if(s==null||s==="solid"){const m=u.ensureInstance(S.line,p).createMeshInfo(y);d.push(m)}else if(s!=="none"){const m=u.ensureInstance(S.texturedLine,p).createMeshInfo({...y,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Bt(s,n)},overrides:[]}});d.push(m)}return e.marker!=null&&d.push(...Fi(e.marker,e,t)),d}async function re(e,t,i){const r=t.labelsVisible&&t.labelingInfo||[],s=R(t),a=Qt(r,s);return{type:"label",classes:await Promise.all(a.map((n,o)=>Ti(e,n,o,i)))}}async function Ti(e,t,i,r){const s=await T(t,{path:`${i}`,schemaOptions:e,uniforms:r});return{maxScale:t.maxScale,minScale:t.minScale,expression:t.labelExpressionInfo?.expression??t.labelExpression,where:t.where,meshes:s}}async function se(e,t){if(!t)return{type:"simple",meshes:[]};switch(t.type){case"simple":return zi(e,t);case"dot-density":return qi(e,t);case"class-breaks":return Ai(e,t);case"unique-value":return Mi(e,t);case"dictionary":return Pi(t);case"heatmap":return ki(e,t);case"pie-chart":return Ni(e,t)}}async function zi(e,t){const i=t.getSymbols(),r=i.length?i[0]:null,s=E(t);return{type:"simple",meshes:await T(r,{schemaOptions:e,uniforms:s,path:"renderer.symbol"})}}async function qi(e,t){const i=E(t);return{type:"dot-density",meshes:await _i(t,{schemaOptions:e,uniforms:i,path:"renderer.symbol"})}}async function Ai(e,t){const i=E(t),r=t.backgroundFillSymbol,s=t.normalizationType,a=s==="log"?"esriNormalizeByLog":s==="percent-of-total"?"esriNormalizeByPercentOfTotal":s==="field"?"esriNormalizeByField":null,n=t.classBreakInfos.map(async d=>({meshes:await T(d.symbol,{path:`renderer-stop-${d.minValue}-${d.maxValue}`,schemaOptions:e,uniforms:i}),min:d.minValue,max:d.maxValue})),o=(await Promise.all(n)).sort((d,c)=>d.min-c.min),l=await T(r,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:i.visualVariableSizeOutlineScaleStops}}),u=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:i});return{type:"interval",field:t.field,expression:t.valueExpression,backgroundFill:l,defaultSymbol:u,intervals:o,normalizationField:t.normalizationField,normalizationTotal:t.normalizationTotal,normalizationType:a,isMaxInclusive:t.isMaxInclusive}}async function Mi(e,t){const i=[],r=E(t),s=await T(t.backgroundFillSymbol,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),a=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:r});for(const n of t.uniqueValueInfos??[]){const o=await T(n.symbol,{path:`renderer-unique-value-${n.value}`,schemaOptions:e,uniforms:r});i.push({value:""+n.value,symbol:o})}return{type:"map",field:t.field,expression:t.valueExpression,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,backgroundFill:s,defaultSymbol:a,map:i}}function Pi(e){const t=E(e),i=e.scaleExpression,r=i!=null&&i!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:e.fieldMap,scaleExpression:r,visualVariableUniforms:t}}async function ki(e,t){return{type:"heatmap",meshes:await wi(t,e)}}async function Ni(e,t){return{type:"pie-chart",meshes:await Ii(t,e)}}async function Ui(e,t){const i=t.renderer,r=E(i);return{symbology:await se(e,i),labels:await re(e,t,r)}}async function P(e,t,i,r){const s=i.featureReduction;if(s)switch(s.type){case"binning":return Li(s,e,t,i,r);case"cluster":return Di(s,e,t,i,r)}const a=ji(i.orderBy,i.renderer,i.objectIdField),n=xe(i.renderer,t.filters),o=await Ui(e,i),l=Te(o.symbology);return{storage:n,mesh:{properties:{sortKey:a,timeZone:t.timeZone,returnMeshObjectId:l,displayRefreshVersion:r},strategy:{type:"feature"},factory:o}}}function nt(e,t){return e.fields.map(i=>({...i.toJSON(),type:Bi(i,t)}))}function Bi(e,t){const{onStatisticExpression:i,onStatisticField:r,statisticType:s}=e;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:n}=i;return n?n==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const a=t.find(n=>n.name===r);return a?a.type:"esriFieldTypeString"}}}async function Li(e,t,i,r,s){const a=nt(e,r.fields),n=e.renderer,o=await se(t,n),l=xe(n,[null,null]),u=E(n),d=await re(t,{geometryType:"polygon",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},u),c=Te(o),p=e.binType==="geohash"?{type:"geohash",fixBinLevel:e.fixedBinLevel??3}:{type:"grid",size:H(e.size),fixedBinLevel:e.fixedBinLevel};return{storage:l,mesh:{properties:{sortKey:null,timeZone:i.timeZone,returnMeshObjectId:c,displayRefreshVersion:s},strategy:{type:"binning",fields:a,index:p,featureFilter:i.filters[0]},factory:{labels:d,symbology:o}}}}async function Di(e,t,i,r,s){const a=nt(e,r.fields),n={type:"cluster",feature:await se(t,e.effectiveFeatureRenderer),cluster:await se(t,e.effectiveClusterRenderer)},o=E(e.effectiveFeatureRenderer),l={type:"cluster",feature:await re(t,r,o),cluster:await re(t,{geometryType:"point",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},o)},u=xe(e.effectiveFeatureRenderer,[null,null]),d=Te(n);return{storage:u,mesh:{properties:{sortKey:null,timeZone:i.timeZone,displayRefreshVersion:s,returnMeshObjectId:d},strategy:{type:"cluster",fields:a,featureFilter:i.filters[0],clusterRadius:H(e.clusterRadius/2)},factory:{labels:l,symbology:n}}}}function ji(e,t,i){const r=t!=null&&t.type==="unique-value"&&t.orderByClassesEnabled;if(e!=="default"||r||(e=[new $t({field:i,order:"descending"})]),e!=="default"&&e?.length){e.length;const s=e[0],a=s.order==="ascending"?"asc":"desc";return s.field?{field:s.field,order:a}:s.valueExpression?{expression:s.valueExpression,order:a}:null}return r?{byRenderer:!0,order:"asc"}:null}function Z(e){return e.techniqueType===Re.AnimatedMarker}function Te(e){return!!(e.type==="simple"&&e.meshes.some(Z)||e.type==="interval"&&(e.intervals.some(t=>t.meshes.some(Z))||e.backgroundFill.some(Z))||e.type==="map"&&(e.map.some(t=>t.symbol.some(Z))||e.backgroundFill.some(Z)))}let Ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,globalIdField:a,datesInUnknownTimezone:n,orderBy:o,parsedUrl:l}=t,u=t.fieldsIndex.toJSON(),d=R(t),c=t.timeInfo?.toJSON(),p=t.spatialReference.toJSON(),y=ae(l);let m=s;if(o?.length){const I=!o[0].valueExpression&&o[0].field;I&&(m=I)}return{type:"feature-service",source:y,isSourceHosted:be(y.path),orderByFields:m,outSpatialReference:e.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:n,globalIdField:a,fieldsIndex:u,geometryType:d,objectIdField:s,timeInfo:c,spatialReference:p,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s,apiKey:a}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,a)}createProcessorSchema(e,t,i){const{fields:r,geometryType:s,orderBy:a,objectIdField:n,renderer:o,labelingInfo:l,labelsVisible:u}=this.layer,d={featureReduction:null,fields:r.map(c=>c.toJSON()),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:n,orderBy:a??"default",renderer:o?.clone()};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,apiKey:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,apiKey:r,customParameters:n,definitionExpression:i,labelingInfo:a,orderBy:o,renderer:s}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function ze(e,t){const i=e.extent,r=t?.clone().intersection(i),s=r!=null?r.width*r.height:0,a=t?t.width*t.height:0,n=a===0?0:s/a,o=g("featurelayer-snapshot-point-coverage");return!isNaN(n)&&n>=o}function $(e,t){return e.floorInfo!=null&&(e.floorInfo.viewAllLevelIds.length>0||t.floors.length>0)}function qe(e,t,i){const r=$i(e,t?.where,i);return r&&(t??=new ee,t.where=r),t}function $i(e,t,i){if(e.floorInfo==null||!i.floors?.length)return t;let r=i.floors;const{floorField:s,viewAllLevelIds:a}=e.floorInfo;a.length&&(r=a);const n=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(n.push("''"),t?.includes(s)){let l=new RegExp("AND \\("+s+".*NULL\\)","g");t=t.replace(l,""),l=new RegExp("\\("+s+".*NULL\\)","g"),t=(t=t.replace(l,"")).replaceAll(/\s+/g," ").trim()}let o="("+s+" IN ({ids}) OR "+s+" IS NULL)";return o=o.replace("{ids}",n.join(", ")),Fe(t,o)}let Qi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,typeIdField:a,globalIdField:n,datesInUnknownTimezone:o,orderBy:l,subtypeField:u,refreshInterval:d}=t,c=t.fieldsIndex.toJSON(),p=R(t),y=t.timeInfo?.toJSON(),m=t.spatialReference.toJSON(),I=t.types?.map(B=>B.toJSON()),V=ae(this.layer.parsedUrl);this.layer.dynamicDataSource&&(V.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let W=this.layer.objectIdField;if(l?.length){const B=!l[0].valueExpression&&l[0].field;B&&(W=B)}const Se=r?.lastEditDate==null&&d>0,ne=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!Se,lt=ne&&ze(e,t.fullExtent);return{type:"feature-service",source:V,isSourceHosted:be(V.path),orderByFields:W,outSpatialReference:e.spatialReference.toJSON(),metadata:{typeIdField:a??void 0,types:I,timeReferenceUnknownClient:o,subtypeField:u,globalIdField:n,fieldsIndex:c,geometryType:p,objectIdField:s,timeInfo:y,spatialReference:m,subtypes:this.layer.subtypes?.map(B=>B.toJSON())},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:ne,supportsSnapshotMaxThreshold:lt,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer;return U({definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l},e,t,u)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,gdbVersion:s,apiKey:a,subtypeCode:n}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null,l=t.historicMoment?.getTime()??void 0,u=JSON.stringify(t.customParameters),d=w(t,e),c=JSON.stringify(t.orderBy),p=$(this.layer,e)?e.floors:null;return{outFields:this.layer.outFields,apiKey:a,customParameters:u,definitionExpression:i,featureReduction:d,floors:p,gdbVersion:s,historicMoment:l,labelingInfo:o,orderBy:c,renderer:r,subtypeCode:n}}};function Hi(e){if(!("openPorts"in e))throw new C("source-not-supported")}class Ye{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.timeInfo?.toJSON(),l=i.spatialReference.toJSON();return Hi(i.source),{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,timeInfo:o,spatialReference:l,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r,timeExtent:s}=this.layer;return U({definitionExpression:r,timeExtent:s,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,orderBy:u,objectIdField:d}=this.layer,c={fields:s.map(p=>p.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:d,orderBy:u??"default"};return P(t,i,c,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=w(i,t),o=JSON.stringify(i.orderBy);return{outFields:this.layer.outFields,orderBy:o,definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}}class Gi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.spatialReference.toJSON();return{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:i.timeInfo?.toJSON(),timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r}=this.layer;return U({definitionExpression:r,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i;return{definitionExpression:r,renderer:s,labelingInfo:this.layer.labelsVisible?this.layer.labelingInfo:null,featureReduction:w(i,t)}}}let Wi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r}=t,s=t.fieldsIndex.toJSON(),a=R(t),n=t.timeInfo?.toJSON(),o=t.spatialReference.toJSON(),l=t.source.getSource(),u=this.layer.objectIdField,d=ae(i);return d.query.maxRecordCount=l.maxRecordCount,{type:"ogc",source:l,orderByFields:u,outSpatialReference:e.spatialReference.toJSON(),metadata:{fieldsIndex:s,geometryType:a,objectIdField:r,timeInfo:n,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:d.query.maxRecordCount,supportsCompactGeometry:d.query.supportsCompactGeometry,supportsDefaultSpatialReference:d.query.supportsDefaultSpatialReference,supportsFormatPBF:d.query.supportsFormatPBF,supportsMaxRecordCountFactor:d.query.supportsMaxRecordCountFactor,supportsQuantization:d.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{customParameters:i,timeExtent:r,apiKey:s}=this.layer;return U({customParameters:i,timeExtent:r},e,t,s)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{renderer:i,apiKey:r}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:r,customParameters:JSON.stringify(t.customParameters),featureReduction:w(t,e),labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:i}}},Ki=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r,globalIdField:s,orderBy:a,refreshInterval:n}=t,o=t.fieldsIndex.toJSON(),l=R(t),u=t.timeInfo?.toJSON(),d=t.spatialReference.toJSON(),c=ae(this.layer.parsedUrl);let p=this.layer.objectIdField;if(a?.length){const V=!a[0].valueExpression&&a[0].field;V&&(p=V)}const y=n>0,m=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!y,I=m&&ze(e,t.fullExtent);return{type:"feature-service",source:c,isSourceHosted:be(c.path),orderByFields:p,outSpatialReference:e.spatialReference.toJSON(),metadata:{globalIdField:s,fieldsIndex:o,geometryType:l,objectIdField:r,timeInfo:u,spatialReference:d,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:m,supportsSnapshotMaxThreshold:I,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,null)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,outFields:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=w(t,e);return{outFields:s,orderBy:JSON.stringify(t.orderBy),definitionExpression:i,renderer:r,labelingInfo:a,featureReduction:o,customParameters:n,floors:$(this.layer,e)?e.floors:null}}},Zi=class{constructor(e){this.layer=e}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}getUpdateHashProperties(e){const t=this.layer,{renderer:i}=t,r=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(t.customParameters),a=w(t,e),n=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,labelingInfo:r,featureReduction:a,customParameters:s,orderBy:n,renderer:i}}async createServiceOptions(e){const t=R(this.layer);return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:e.spatialReference.toJSON(),geometryInfo:this.layer.source.geometryInfo,metadata:{spatialReference:this.layer.spatialReference,fieldsIndex:this.layer.fieldsIndex.toJSON(),objectIdField:this.layer.objectIdField,geometryType:t,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null}}}createSourceSchema(e,t){return{type:"parquet",mutable:{sourceRefreshVersion:t,availableFields:e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,t,i){const r={fields:this.layer.fields.map(s=>s.toJSON()),renderer:this.layer.renderer?.clone(),featureReduction:w(this.layer,t),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return P(e,t,r,i)}};class Yi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{objectIdField:r}=i,s=R(i),a=i.timeInfo?.toJSON()||null,n=i.spatialReference?i.spatialReference.toJSON():null;return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:r,timeInfo:a,timeReferenceUnknownClient:null,spatialReference:n,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(t,i){const{definitionExpression:r,geometryDefinition:s,customParameters:a}=this.layer;return{type:"stream",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{geometryDefinition:s?.toJSON(),definitionExpression:r,customParameters:a??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(i.customParameters);return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:w(i,t),customParameters:n,geometryDefinition:i.geometryDefinition,definitionExpressoin:i.definitionExpression}}}async function Xi(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(({renderer:s})=>se(e,s)));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}function er(e,t){const i=Wt();return{type:"subtype",filters:e.filters,capabilities:{maxTextureSize:i.maxTextureSize},subtypeField:t.subtypeField,target:"feature",bindings:t.sublayers.reduce((r,{renderer:s,subtypeCode:a})=>{const n=Nt(s);return{...r,[a]:n}},{})}}async function tr(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(s=>{const a=E(s.renderer),n={...s,geometryType:s.geometryType??null};return re(e,n,a)}));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}async function ir(e,t,i,r){return{storage:er(t,i),mesh:{properties:{timeZone:t.timeZone,displayRefreshVersion:r,returnMeshObjectId:!1,sortKey:null},strategy:{type:"feature"},factory:{symbology:await Xi(e,i),labels:await tr(e,i)}}}}class rr{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(i=>z(i))}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,datesInUnknownTimezone:s,editingInfo:a,globalIdField:n,objectIdField:o,refreshInterval:l,subtypeField:u}=i,d=i.fieldsIndex.toJSON(),c=R(i),p=i.timeInfo?.toJSON(),y=i.spatialReference.toJSON(),m=ae(this.layer.parsedUrl),I=o,V=a?.lastEditDate==null&&l>0,W=!!g("featurelayer-snapshot-enabled")&&i.geometryType==="point"&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!V,Se=W&&ze(t,i.fullExtent);return{type:"feature-service",source:m,isSourceHosted:be(m.path),orderByFields:I,outSpatialReference:t.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:s,subtypeField:u,globalIdField:n,fieldsIndex:d,geometryType:c,objectIdField:o,timeInfo:p,spatialReference:y,subtypes:this.layer.subtypes?.map(ne=>ne.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:W,supportsSnapshotMaxThreshold:Se,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(t,i){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer,d={queryScaleRanges:this.layer.sublayers.items.map(c=>({subtypeCode:c.subtypeCode,minScale:c.minScale,maxScale:c.maxScale})),definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l};return U(d,t,i,u)}createProcessorSchema(t,i,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,a=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:a.labelingInfo,labelsVisible:a.labelsVisible,renderer:a.renderer,subtypeCode:a.subtypeCode,orderBy:null}))};return ir(t,i,s,r)}hasFilters(t){return $(this.layer,t)||sr(this.layer,t)}addFilters(t,i){t=qe(this.layer,t,i);const r=this.layer.sublayers.filter(a=>!ot(a,i)).map(a=>a.subtypeCode);if(!r.length)return t;t??=new ee;const s=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return t.where=Fe(t.where,s),t}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:a}=i,n=i.historicMoment?.getTime()??void 0,o=JSON.stringify(i.customParameters),l=$(this.layer,t)?t.floors:null,u=this.layer.sublayers.map(({renderer:d,labelsVisible:c,labelingInfo:p,visible:y})=>({renderer:d,labelsVisible:c,labelingInfo:p,visible:y}));return{outFields:this.layer.outFields,gdbVersion:s,definitionExpression:r,historicMoment:n,customParameters:o,apiKey:a,sublayers:u,floors:l}}setGraphicOrigin(t){const i=this.layer.fieldsIndex.get(this.layer.subtypeField),r=t.attributes[i.name],s=this.layer.sublayers.find(a=>a.subtypeCode===r);t.layer=t.sourceLayer=s}}function sr(e,t){return e.sublayers.some(i=>!ot(i,t))}function ot(e,t){return e.visible&&(e.minScale===0||Ue(t.scale,e.minScale)||t.scalee.maxScale)}async function b(e,t){try{return await e}catch(i){if(i.name!=="no-queryEngine")throw i;return t}}function D(e,t){const i=new Set;for(const r of e instanceof Set?e.values():e.keys())t.has(r)||i.add(r);return i}class ar{constructor(t,i,r){const s=r?t.getTileCoverage(r,0,!0,"closest"):null,a=t.getTileCoverage(i,0,!0,"closest");if(this._tileKeys=new Map,s)for(const n of s.keys())this._tileKeys.set(n.id,n);if(a)for(const n of a.keys())this._tileKeys.set(n.id,n)}get coverageSet(){return new Set(this._tileKeys.keys())}keys(){return this._tileKeys.values()}}class nr{constructor(t){this.version=t}}class or{constructor(t){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=t}destroy(){}get _coverageSet(){return this._coverage?.coverageSet??new Set}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(t,i){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._updateCoverage(t,i),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(t,i){this._coverage=new ar(this._config.tileInfoView,t,i)}_updateSubscriptions(){const t=this._coverageSet,i=this._updateVisibility(),r=D(i,t),s=D(this._subscriptions,i),a=D(t,this._subscriptions),n=D(s,t),o=D(r,n),l=D(o,this._paused);this._visible=i;for(const u of a.values())this._subscriptions.set(u,new nr(this._version));for(const u of l.values())this._paused.add(u);for(const u of n.values())this._subscriptions.delete(u),this._paused.delete(u);(a.size||n.size||l.size)&&this._sendUpdateSubscriptions(a,n,l)}_sendUpdateSubscriptions(t,i,r){const s=Array.from(t.values()).map(a=>({tileId:a,version:this._subscriptions.get(a).version}));this._config.updateSubscriptions({subscribe:s,unsubscribe:Array.from(i.values()),pause:Array.from(r.values())})}_updateVisibility(){const t=new Set,i=new Set;if(!this._coverage)return t;for(const a of this._coverage.keys()){if(this._config.isDone(a)){t.add(a.id);continue}this._addVisibleParent(t,i,a)||this._addVisibleChildren(t,a)||t.add(a.id)}const r=new Y(0,0,0,0),s=new Y(0,0,0,0);for(const a of i){r.id=a;for(const n of t)s.id=n,r.containsChild(s)&&t.delete(n)}return t}_addVisibleParent(t,i,r){let s=!1;for(const a of this._visible.values())new Y(a).containsChild(r)&&(t.add(a),i.add(a),s=!0);return s}_addVisibleChildren(t,i){let r=!1;for(const s of this._visible.values()){const a=new Y(s);i.containsChild(a)&&(t.add(s),r=!0)}return r}}const lr=e=>{let t=class extends e{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([pe(()=>{const i=this.layer;return[i&&"elevationInfo"in i?i.elevationInfo?.featureExpressionInfo:null,i&&"displayField"in i?i.displayField:null,i&&"timeInfo"in i&&i.timeInfo,i&&"renderer"in i&&i.renderer,i&&"labelingInfo"in i&&i.labelingInfo,i&&"floorInfo"in i&&i.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),_t),Be(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),Be(()=>{const i=this.layer;return i&&"sublayers"in i?i.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:i,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in i&&i.outFields?Le(r,[...De(r,i.outFields),...s]):Le(r,s)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(i){this._override("featureEffect",i)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(i){x.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(i){throw new Error("missing implementation")}createQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=this.filter!=null?this.filter.createQuery(i):new me(i);if("floorInfo"in this.layer&&this.layer.floorInfo){const s=Ke(this);s!=null&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new me(i)}queryFeatures(i,r){throw new Error("missing implementation")}queryObjectIds(i,r){throw new Error("missing implementation")}queryFeatureCount(i,r){throw new Error("missing implementation")}queryExtent(i,r){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(i,r){return this._validateFetchPopupFeatures(i,r),this._fetchPopupFeatures(i,r)}_loadArcadeModules(i){return i.expressionInfos?.length||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression")?wt():Promise.resolve()}_handleRequiredFieldsChange(){const i=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",i),i.then(()=>{this._updatingRequiredFieldsPromise===i&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const i=this.view.type==="3d",{layer:r,layer:{fieldsIndex:s,objectIdField:a}}=this,n="renderer"in r&&r.renderer,o="orderBy"in r&&r.orderBy,l="featureReduction"in r?r.featureReduction:null,u=new Set,d=await Promise.allSettled([n?n.collectRequiredFields(u,s):null,je(u,r),i&&"elevationInfo"in r?It(u,r):null,this.filter!=null?Je(u,r,this.filter):null,i||this.featureEffect==null?null:Je(u,r,this.featureEffect.filter),!i&&l?Vt(u,r,l):null,!i&&o?Ft(u,r,o):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&oe(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&oe(u,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&i&&r.infoFor3D!=null&&(r.globalIdField==null&&x.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),oe(u,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){ve(u,s,r.subtypeField);const p=r.sublayers.map(y=>Promise.all([y.renderer?.collectRequiredFields(u,s),je(u,y)]));await Promise.allSettled(p)}if(r.type==="catalog-footprint"&&r.parent){const p=r.parent;oe(u,s,[p.itemNameField,p.itemSourceField,p.itemTypeField,p.maxScaleField,p.minScaleField])}for(const p of d)p.status==="rejected"&&x.getLogger(this).error(p.reason);ve(u,s,a),i&&"displayField"in r&&r.displayField&&ve(u,s,r.displayField);const c=Array.from(u).sort();this._set("requiredFields",c)}_validateFetchPopupFeatures(i,r){if(r!=null)for(const s of i){const a=s.origin&&"layer"in s.origin?s.origin.layer:s.layer;if("popupEnabled"in a&&!a.popupEnabled)throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a});if(s.isAggregate){const n="featureReduction"in a?a.featureReduction:null;if(!(n&&"popupTemplate"in n&&n.popupEnabled&&n.popupTemplate))throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a})}else if("popupTemplate"in a&&!_e(a,r))throw new C("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:a})}}_popupFeatureHasRequiredFields(i,r){return xt(r,i)}async _fetchPopupFeatures(i,r){const s=new Array(i.length),a=new Map,n=await this._createPopupQuery(i.map(o=>o.origin?.layer??o.layer),r);for(let o=0;oi.add(r)),t&&t.forEach(r=>i.add(r)),i.has("*")?["*"]:Array.from(i)}const Xe=4294967294;let _=class extends lr(Xt(Tt(zt))){constructor(){super(...arguments),this._commandsQueue=new kt({process:e=>{switch(e.type){case"edit-by-feature":case"edit-by-id":return this._doEdit(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new Kt,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new O,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new ei}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(Ae()),this._commandsQueue.destroy()}initialize(){this._workerAttached=ye(),K(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new C("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(e.geometryType==="mesh")throw new C("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if((e.type==="feature"||e.type==="subtype-group")&&ct(e)?.operations.supportsQuery===!1)throw new C("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await li(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(i){this._workerAttached.reject(Ae()),Me(i)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,i=!this.suspended;return e.map(({vvEvaluators:r,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:r,deconflictionEnabled:s,geometryType:t,visible:i}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new Ye(this.layer):new Qi(this.layer);case"geojson":case"csv":case"wfs":return new Ye(this.layer);case"parquet":return new Zi(this.layer);case"subtype-group":return new rr(this.layer);case"ogc-feature":return new Wi(this.layer);case"stream":return new Yi(this.layer);case"oriented-imagery":return new Ki(this.layer);case"knowledge-graph-sublayer":return new Gi(this.layer);case"catalog-footprint":return new Ji(this.layer);default:Ot(this.layer)}return null}get timeExtent(){return Ct(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t="default"){let i;e instanceof we?i=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?i=[e]:dt.isCollection(e)&&e.length>0?i=e.map(s=>s?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(s=>s?.getObjectId()));const r=i?.filter(pt);return r?.length?(this._addHighlights(r,t),Pe(()=>this._removeHighlights(r,t))):Pe()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,t){const i=await this.featureContainer.hitTest(t);if(i.length===0)return null;const r=await this.getWorker(),{features:s,aggregates:a}=await r.pipeline.getDisplayFeatures(i),n=this.featureContainer.getSortKeys(i),o=({displayId:l},{displayId:u})=>n.has(l)&&n.has(u)?n.get(l)-n.get(u):l-u;return s.sort(o).reverse(),a.sort(o).reverse(),[...a.map(l=>this._createGraphicHit(e,Oe.fromJSON(l))),...s.map(l=>this._createGraphicHit(e,we.fromJSON(l)))]}async queryStatistics(){const e=await this.getWorker();return b(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,i);return b(a,{})}async queryAggregateSummaryStatistics(e,t,i){const r={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,i);return b(s,{})}async queryUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(i=>{const r=Ie.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}async queryVisibleFeatures(e,t){const i=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await b(i,{features:[]}),s=Ie.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregates(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await b(i,{features:[]}),s=ti.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregateIds(e,t){const i=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return b(i,[])}async queryAggregateCount(e,t){const i=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return b(i,0)}async queryAggregateJSON(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return b(i,{features:[]})}async queryFeaturesJSON(e,t){const i=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return b(i,{features:[]})}async queryObjectIds(e,t){const i=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return b(i,[])}async queryFeatureCount(e,t){const i=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return b(i,0)}async queryExtent(e,t){const i=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await b(i,{count:0,extent:null});return{count:r.count,extent:ht.fromJSON(r.extent)}}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this._subscriptionManager.update(e.targetState,this._lastTargetState);this.featureContainer.setVisibleTiles(t)}attach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),K(this._updatingHandles.addPromise(this._workerAttached.promise)),K(this._attachProxy()),this.featureContainer=new ni(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new or({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),K(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([pe(()=>JSON.stringify({displayRefreshVersion:this._displayRefreshVersion,timeExtent:this.timeExtent,clips:this.clips,filter:this.filter,featureEffect:this.featureEffect,sourceRefreshVersion:this._sourceRefreshVersion,timeZone:this.view.timeZone,effect:this.featureEffect,...this.layerAdapter.getUpdateHashProperties(this.view)}),()=>this._update(),ft),pe(()=>this.updateSuspended,e=>{e||(this._subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),pe(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this.layer.type!=="stream"&&this.layer.type!=="parquet"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=yt(this._subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=ye(),K(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updateTracking.updating,i=this._updatingRequiredFieldsPromise!=null,r=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||i)||r||this._pipelineUpdating||this.dataUpdating;if(g("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} - -> updateRequested ${this.updateRequested} - -> hasRenderer ${e} - -> updatingRequiredFields ${i} - -> hasPendingCommand ${t} - -> dataUpdating ${this.dataUpdating} - -> processing ${this._pipelineUpdating} - -> updatingContainer ${r} -`);for(const a of this.featureContainer.subscriptions())console.log(` -> Tile[${a.id}] Done: ${a.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:t=>{this._set("_pipelineUpdating",t.pipeline),this._set("dataUpdating",t.data)},emitEvent:t=>{this.emit(t.name,t.event)},get eventLog(){return e.eventLog},fetch:t=>Promise.all(t.map(i=>e.view.stage.painter.textureManager.rasterizeItem(i))),fetchDictionary:t=>Promise.all(t.map(i=>this._fetchDictionaryRequest(i)))}}async _fetchDictionaryRequest(e){try{if(this.layer.type==="subtype-group")throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||t.type!=="dictionary")throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const i=this._lastSchema.processor.mesh.factory.symbology;if(i.type!=="dictionary")throw new Error("InternalError: Expected schema to be of type 'dictionary'");const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:i.scaleExpression};this._fields||(this._fields=this.layer.fields.map(n=>n.toJSON()));const s=i.visualVariableUniforms,a=await t.getSymbolAsync(e.feature,{fields:this._fields});return!a||!a.data?{type:"dictionary-response",meshes:[]}:{type:"dictionary-response",meshes:await te(a.data,{uniforms:s,path:"renderer",schemaOptions:r})}}catch{return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=me.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=me.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const i=t.objectIds??[];for(const r of t.aggregateIds??[])i.push(r);return t.objectIds=i,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.updateSuspended)return void this._subscriptionManager.suspend();const t=this._getEffectiveEdit(e);return t?this._commandsQueue.push(t).catch(Me):void 0}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Xe+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Xe+1}_getEffectiveEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some(o=>o.objectId===-1||!o.objectId),r=t&&this.availableFields.includes(t);if(i&&!r)return x.getLogger(this).error(new C("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null;const s=this.layer,a=e.historicMoment?.getTime()??null,n="layerId"in s&&e.editedFeatures?.find(o=>o.layerId===s.layerId);if(n&&this._canEditByFeature(n)){const o=Mt(this.layer.geometryType),{adds:l,deletes:u,updates:d}=n.editedFeatures,c=this.layer.objectIdField,p=l.map(m=>Qe(m,o,!1,!1)),y=d.map(m=>Qe(m.current,o,!1,!1));return{type:"edit-by-feature",added:p,removed:u.map(m=>"attributes"in m?{globalId:t?m.attributes[t]:null,objectId:c?m.attributes[c]:null}:m),updated:y,historicMoment:a}}return{type:"edit-by-id",added:e.addedFeatures,updated:e.updatedFeatures,removed:e.deletedFeatures,historicMoment:a}}_canEditByFeature(e){const{adds:t,updates:i}=e.editedFeatures;return t.every(r=>this.view.spatialReference.equals(r.geometry?.spatialReference))&&i.every(r=>this.view.spatialReference.equals(r.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await this._updateRequiredFields(),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},r=this._createViewSchemaConfig(),s={source:this.layerAdapter.createSourceSchema(r,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,r,this._displayRefreshVersion)},a=ke(this._lastSchema?.source.mutable,s.source.mutable)||ke(this._lastSchema?.processor,s.processor);if(!a)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=s,this._fields=null;const n=Math.round(performance.now());g("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${n}] FeatureLayerView2D._doUpdate`,{changes:a}),await(await this.getWorker()).pipeline.updateSchema(s,n),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.swapRenderState(),this.featureContainer.requestRender(),g("esri-2d-update-debug")&&console.debug(`Version[${n}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){g("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){const t=await this.getWorker();try{this.featureContainer.editStart(),await t.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(i){Ne(i)}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return this.filter!=null||this.timeExtent!=null||this._visibilityOverrides.size>0||e}_getEffectiveAvailableFields(e){const t=ur(this._lastAvailableFields,e);return this._lastAvailableFields=t,mt(this.layer.fieldsIndex,t)}_createViewSchemaConfig(){const e=[cr(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),filters:e,scale:this.view.scale,timeZone:this.view.timeZone}}_addHighlights(e,t){this._highlightCounter.addGroup(e,t),this._commandsQueue.push({type:"highlight"})}_removeHighlights(e,t){this._highlightCounter.deleteGroup(e,t),this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=[];for(const r of this._highlightCounter.ids()){const s=this._highlightCounter.getHighlightGroups(r),a=this._getHighlightBits(s);e.push({objectId:r,highlightFlags:a})}const t=await this.getWorker();if(this.destroyed)return;const i=t.pipeline.updateHighlight({highlights:e}).catch(r=>{Ne(r)||x.getLogger(this).error(r)});this._updatingHandles.addPromise(i)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function cr(e,t,i,r,s){s&&(s=s.clone());const a=s!=null?s.timeExtent:null,n=i!=null&&a!=null?i.intersection(a):i||a;n&&(s??=new ee,s.timeExtent=n),s=t.addFilters?.(s,e)??s;let o=s?.toJSON()??null;return r.size&&(o??=new ee().toJSON(),o.hiddenIds=Array.from(r)),o}h([f()],_.prototype,"_commandsQueue",void 0),h([f()],_.prototype,"_sourceRefreshVersion",void 0),h([f()],_.prototype,"_displayRefreshVersion",void 0),h([f({readOnly:!0})],_.prototype,"_pipelineUpdating",void 0),h([f({readOnly:!0})],_.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],_.prototype,"hasFullGeometries",null),h([f()],_.prototype,"featureEffectView",void 0),h([f()],_.prototype,"labelingCollisionInfos",null),h([f()],_.prototype,"layerAdapter",null),h([f({readOnly:!0})],_.prototype,"timeExtent",null),h([f()],_.prototype,"updating",void 0),_=h([Q("esri.views.2d.layers.FeatureLayerView2D")],_);const dr=_,ua=Object.freeze(Object.defineProperty({__proto__:null,default:dr},Symbol.toStringTag,{value:"Module"}));export{ua as F,b as n,dr as r}; diff --git a/main/assets/FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js b/main/assets/FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js new file mode 100644 index 000000000..6ea25ef04 --- /dev/null +++ b/main/assets/FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js @@ -0,0 +1,9 @@ +import{v as h,S as f,i as Q,a0 as ut,aS as Ae,b as ye,b9 as K,o as C,bE as ct,bt as Me,bi as we,ag as dt,aq as pt,a2 as Pe,n as ht,K as g,ah as pe,aL as ft,aA as yt,a1 as x,hC as ke,aU as Ne,j2 as mt,j as et,J as gt,$ as he,I as bt,P as ae,bV as Fe,fl as Ue,hm as St,bh as vt,f4 as H,ax as _t,ai as Be,eQ as Le,j3 as De,ex as wt,j4 as je,j5 as It,j6 as Je,j7 as Vt,j8 as Ft,eH as oe,ey as ve,iJ as xt,ae as tt,eC as it,eD as Et,eB as Rt}from"./main-C7yV2j71.js";import{t as Ot}from"./compilerUtils-CV1QYWI8-89qN_-l3.js";import{c as $e}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{k as Qe}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import ee from"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import{T as Ct}from"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import{O as Ie}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{b as me}from"./Query-BrwMGK8U-DV_czrJX.js";import{X as Tt,Y as zt}from"./LayerView-Bish-E63-I2LV0oDm.js";import{i as qt}from"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import{j as At,Z as He,G as Ge}from"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import{s as Mt,E as le,R as L,h as Pt,N as We}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{_ as kt,u as te,o as S,Q as A,h as xe,r as E,W as ge,U as Nt,b as ue,N as k,c as ie,l as Ee}from"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import{D as Re,k as G,bt as Ut,bu as Bt}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import{i as rt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./Tile-D75RMC64-CM0vKD9b.js";import{s as Y}from"./TileKey-C5IL-JBr-COMthbrT.js";import{i as Lt}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{q as Dt}from"./workers-PiCjreoO-DqI62TYf.js";import{h as jt}from"./ReactiveMap-CFk6jPfN-CM49HI11.js";import{L as be}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{m as Jt}from"./lengthUtils-DKpMe5qR-E2FfnN85.js";import{i as q}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{p as $t}from"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import{Q as Qt}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{x as Ht}from"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import{r as j,o as ce}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{V as Gt}from"./SDFHelper-B6k8Ig6R-C81pIMYz.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import{l as de}from"./definitions-DJSdSb77-DkoRHaVx.js";import{n as Wt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{i as Kt}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import{x as Zt}from"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import{i as Ke}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{m as _e,h as Yt}from"./popupUtils-nV1O8RUO-X6GWMgRY.js";import{n as Xt}from"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";let fe=class extends we{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer?.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};h([f({type:Boolean})],fe.prototype,"isAggregate",void 0),fe=h([Q("esri.AggregateGraphic")],fe);const Oe=fe;let v=class extends et{constructor(e){super(e),this._filter=null,this.duration=g("mapview-transitions-duration"),this._excludedEffectView=new $e(e),this._includedEffectView=new $e(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){return this._filter||this.featureEffect?.filter||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}get transitioningToEmpty(){return!this._excludedEffectView.final&&!this._includedEffectView.final}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransition(){this._includedEffectView.endTransition(),this._excludedEffectView.endTransition(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),i=e,r=i?.includedEffect,s=i?.excludedEffect,a=this._includedEffectView.canTransitionTo(r)&&this._excludedEffectView.canTransitionTo(s);this._includedEffectView.effect=r,this._excludedEffectView.effect=s,this._set("featureEffect",i),this._filter=i?.filter||t?.filter||null,a||this.endTransition()}};h([f()],v.prototype,"_filter",void 0),h([f()],v.prototype,"_excludedEffectView",void 0),h([f()],v.prototype,"_includedEffectView",void 0),h([f()],v.prototype,"duration",void 0),h([f()],v.prototype,"excludedEffects",null),h([f()],v.prototype,"featureEffect",null),h([f()],v.prototype,"filter",null),h([f()],v.prototype,"hasEffects",null),h([f()],v.prototype,"includedEffects",null),h([f({value:0})],v.prototype,"scale",null),h([f()],v.prototype,"transitioning",null),h([f()],v.prototype,"transitioningToEmpty",null),v=h([Q("esri.layers.effects.FeatureEffectView")],v);const ei=v;let X=class extends Ie{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const i=gt.fromJSON(t.spatialReference),r=[];for(let s=0;se)break;this._updateTile(t),this._pendingUpdates.dequeue()}}removeTile(e){const t=this._tiles.get(e);g("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}flush(){for(;this._pendingUpdates.size;){const e=this._pendingUpdates.dequeue();e!=null&&this._updateTile(e)}for(const e of this._tiles.values())e.upload()}_updateTile(e){const{inner:t,objectIdMap:i}=e,r=this.getSubscriptionVersion(t.id);if(r!==t.subscriptionVesrion){if(g("esri-2d-update-debug")){const o=`${t.subscriptionVesrion} != ${r}`;console.debug(`Version[${o}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(g("esri-2d-update-debug")){const o=t.debugInfo?.chunkId??"";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${o}] RenderState.updateTile [${t.type}]`,t)}const s=this._ensureTile(t.id);if(t.type==="update"){const[o,...l]=t.modify;s.onMessage({type:"update",modify:o,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const u of l){const d=this._tiles.get(u.tileId);d&&d.onMessage({type:"update",modify:u,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(t.append==null)return void s.onMessage({type:"append",clear:t.clear,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[a,...n]=t.append;s.onMessage({type:"append",clear:t.clear,append:a,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const o of n){const l=this._tiles.get(o.tileId);l&&l.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){g("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new Y(e),i=this._tileInfoView.getTileBounds(vt(),t),r=this._tileInfoView.getTileResolution(t.level),s=new Lt(t,r,i[0],i[3],!0);if(s.stage=this.getStage(),!s.stage){const a=new C("featurelayerview:webgl","Cannot create tile with empty stage");x.getLogger("esri.views.2d.layers.features.RenderState").error(a)}return s}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let r=-1;r<=1;r++)for(let s=-1;s<=1;s++){if(r===0&&s===0)continue;const a=e.key.getNormalizedNeighbor(s,r,i).id,n=this._tiles.get(a);if(n!=null){const o=1<i.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const i of this._renderState.tiles())i.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(i.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case le.MAP:return this._renderMapPhase(e);case le.HIGHLIGHT:return this._renderHighlightPhase(e);case le.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&S.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(oi(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:i}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=i;else{const r=new ai(t,i);this._subscriptions.set(t,r),this.updatingHandles.addPromise(r.promise)}for(const t of e.unsubscribe)this._subscriptions.get(t)?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){g("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new si(()=>this._stage,t=>this._subscriptions.get(t)?.version,e,this.tileInfoView)}getDisplayStatistics(e,t){const i=this._statisticsByLevel.get(e);return i?i.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let i=this._statisticsByLevel.get(e);i||(i=new Map,this._statisticsByLevel.set(e,i));for(const r of t)i.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){this._renderStateNext&&(g("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){he(t);const i=e.inner;if(!this._subscriptions.has(i.id))return;const r=this._subscriptions.get(i.id);if(r.version!==i.subscriptionVesrion){if(g("esri-2d-update-debug")){const a=`${i.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${a}] Tile[${i.id}] FeatureContainer - Dropping message, outdated version]`,i)}return}const s=this._renderStateNext??this._renderState;if(!s)throw new Error("InternalError: No renderState defined");s.version!==i.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${i.version}]`),s.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:r,y:s})=>r===e.x&&s===e.y);const i=ye();return t?t.resolvers.push(i):(t={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(t)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),i=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((s,a)=>i.set(a,s)),i.size===t.size)break;return i}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:i}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=i&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(this._getHeatmapInstance(e)==null)super.setStencilReference(e);else for(const t of this.children)t.stencilRef=S.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,L.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&Pt(e,!1,t=>{this._renderFeatures(t,L.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,L.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,L.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,L.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,i=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),s=t.getViewport(),a=e.passOptions,n=e.drawPhase;i.bind(e),e.passOptions=i.createOptions(e,this._hitTestsRequests),e.drawPhase=le.HITTEST;const{distance:o,smallSymbolDistance:l}=e.passOptions,u=Math.max(o,l);for(const d of this.children)d.visible&&d.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(d,e,L.All);i.draw(e),i.unbind(),t.bindFramebuffer(r),t.restoreViewport(s),e.passOptions=a,e.drawPhase=n}_renderFeatures(e,t){const i=this._getHeatmapInstance(e);i!=null?this._renderHeatmapFeatures(e,t,i):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const i of this.children)i.visible&&this._renderTile(i,e,t)}_renderHeatmapFeatures(e,t,i){for(const r of this.children)r.visible&&this._renderTile(r,e,t,Re.Heatmap);i.techniqueRef.renderResolvePass(e,i)}_renderTile(e,t,i,r){const s=g("featurelayer-force-marker-text-draw-order")?We.STRICT_MARKERS_AND_TEXT:We.BATCHING,a=e.getDisplayList(this._instanceStore,s);t.selection=i,a?.render(t,r)}};function oi(e){return e.techniqueRef.type===Re.Heatmap}async function li(e){const t=await Dt("FeaturePipelineWorker",{client:e,strategy:"dedicated"});return new ui(t)}let ui=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const ci=10;let O=class extends et{constructor(){super(...arguments),this.events=new bt,this._updatingStrategy=!0,this._tileToEvent=new jt,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e.peekLast()?.type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":{const t=new rt(ci);t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};h([f({readOnly:!0})],O.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],O.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],O.prototype,"hasFullGeometries",null),h([f()],O.prototype,"_updatingStrategy",void 0),h([f()],O.prototype,"_strategyInfo",void 0),h([f()],O.prototype,"_tileToEvent",void 0),O=h([Q("esri.views.2d.layers.features.FeatureSourceEventLog")],O);function R(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";case"multipatch":return"esriGeometryMultiPatch";case"multipoint":return"esriGeometryMultipoint";default:return null}}function w(e,t){const i=e.featureReduction;return i&&i.type!=="selection"&&(!("maxScale"in i)||!i.maxScale||i.maxScale=r?n:a+s*(n-a)}function yi(e,t){const i=e/t.minDataValue,r=F(t.minSize,e),s=F(t.maxSize,e);let a=null;return a=i*r,tt(a,r,s)}function mi(e,t){const[i,r,s]=bi(e,t.cache.ipData);if(i===r)return F(t.stops[i].size,e);{const a=F(t.stops[i].size,e);return a+(F(t.stops[r].size,e)-a)*s}}function gi(e,t){const i=Jt[t.valueUnit],r=F(t.minSize,e),s=F(t.maxSize,e),{valueRepresentation:a}=t;let n=null;return n=a==="area"?2*Math.sqrt(e/di)/i:a==="radius"||a==="distance"?2*e/i:e/i,tt(n,r,s)}function bi(e,t){if(!t)return;let i=0,r=t.length-1;return t.some((s,a)=>et.deconflictionStrategy!=="none"))??!1}function N(e,t){const i=w(e,t);if(i?.labelsVisible&&i.labelingInfo?.length)return i.labelingInfo.every(r=>r.deconflictionStrategy!=="none")}function Si(e){return t=>H(st(t,e))}function M(e){const t=e!=null&&"visualVariables"in e&&e.visualVariables;if(!t)return null;for(const i of t)if(i.type==="size")return Si(i);return null}function U(e,t,i,r){const s=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,a=Fe(e.definitionExpression,s),n=e.customParameters??{};return r&&(n.token=r),{type:"feature",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{queryScaleRanges:e.queryScaleRanges??[],definitionExpression:a,gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),timeExtent:e.timeExtent?.toJSON(),customParameters:n}}}}function vi(e,t,i=0){if(t==null)return e[i]=0,e[i+1]=0,e[i+2]=0,void(e[i+3]=0);const{r,g:s,b:a,a:n}=t;e[i]=r*n/255,e[i+1]=s*n/255,e[i+2]=a*n/255,e[i+3]=n}async function T(e,t){if(!e)return[];switch(e.type){case"simple-fill":return Ve(e,t);case"picture-fill":return Ci(e,t);case"simple-marker":return Ze(e,t);case"picture-marker":return Vi(e,t);case"simple-line":return J(e,t,!1);case"text":return xi(e,t);case"label":return Ei(e,t);case"cim":return te(e.data,t);case"web-style":{const i=await e.fetchCIMSymbol();return te(i.data,t)}case"line-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-line`),J(new Rt,t,!1);case"point-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-marker`),Ze(new Et,t);case"polygon-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-fill`),Ve(new it,t);case"mesh-3d":case"label-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function _i(e,t){const{schemaOptions:i}=t,{store:r}=i,s=new Array(de),a=new Array(de/4);for(let c=0;cue(n.color)),visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:e.attributes.length},optionalAttributes:{}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:k(s)});return[...e.backgroundFillSymbol?await Ve(e.backgroundFillSymbol,{schemaOptions:t,path:"",uniforms:ge}):[],a]}function at(e){if(e.style==="path"){if(e.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const t=G.fromSimpleMarker(e);if("outline"in e&&e.outline&&e.outline.style!=="none"&&e.outline.style!=="solid"){if(!t||!t.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:t.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:Gt(t),overrides:[]}}async function Ze(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;if(e.style==="path"||e.outline&&e.outline.style!=="solid"&&e.outline.style!=="none"){const p=G.fromSimpleMarker(e);if(!p||!p.symbolLayers)throw new Error("Error handling marker! ");if(i.visualVariableRotation&&(p.angleAlignment="Map"),e.style!=="path"){const y=p.symbolLayers[0];if(ie(t.uniforms)){const m=k(t.uniforms,0,1);if(m>y.size){const I=m/y.size;y.size=m;const V=y.markerGraphics?.[0].symbol;(V.symbolLayers&&V.symbolLayers[0]).width*=I}}}return te({type:"CIMSymbolReference",symbol:p},t)}const a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=at(e);let o=e.color?.toArray()??[0,0,0,0];n.resource.type==="CIMVectorMarker"&&(o=[255,255,255,255]);const l=e.style==="triangle"?124/116:1,u=e.size,d=u*l,c=i.visualVariableColor!=null&&(e.style==="cross"||e.style==="x");return[a.createMeshInfo({type:"simple",color:o,height:u,width:d,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:u,sprite:n,overrideOutlineColor:c,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]}function Vi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=G.createPictureMarkerRasterizationParam(e);return n?[a.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]:[]}function Fi(e,t,i){const{uniforms:r,schemaOptions:s}=i,{store:a}=s,n=a.ensureInstance(S.marker,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=at(e),l=6,u=l*t.width,d=u,c=e.color?.toArray()??t.color?.toArray()??[0,0,0,0],p=e.style==="cross"||e.style==="x";let y;switch(e.placement){case"begin-end":y=ce.Both;break;case"begin":y=ce.JustBegin;break;case"end":y=ce.JustEnd;break;default:y=ce.None}const m={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({type:"simple",color:c,height:d,width:u,offsetX:0,offsetY:0,angle:0,alignment:Ee(r)?j.MAP:j.SCREEN,outlineColor:c,outlineSize:p?t.width:0,referenceSize:d/l,sprite:o,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:ie(r),placement:m,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:k(r)})]}function xi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;return[s.ensureInstance(S.text,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}}).createMeshInfo({boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:G.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:k(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ei(e,t){const{schemaOptions:i,uniforms:r}=t,{store:s}=i,a=e.symbol,{allowOverrun:n,repeatLabel:o,repeatLabelDistance:l}=e,u={maxScale:e.maxScale??0,minScale:e.minScale??0},d=s.ensureInstance(S.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}}),c=e.labelPlacement,[p,y]=Ut(c);return[d.createMeshInfo({boxBackgroundColor:a.backgroundColor?.toArray(),boxBorderLineColor:a.borderLineColor?.toArray(),boxBorderLineSize:a.borderLineSize??0,color:a.color?.toArray()??[0,0,0,0],offsetX:a.xoffset,offsetY:a.yoffset,postAngle:a.angle,fontSize:a.font.size,decoration:a.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:a.haloColor?.toArray()??[0,0,0,0],haloSize:a.haloSize??0,lineWidth:a.lineWidth,lineHeightRatio:a.lineHeight,horizontalAlignment:p,verticalAlignment:y,repeatLabel:o,repeatLabelDistance:H(l),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:u,minPixelBuffer:k(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:a.font.toJSON(),textString:a.text,symbol:G.createCIMTextSymbolfromTextSymbol(a),primitiveName:"label-override"},useLegacyLabelEvaluationRules:e.labelExpressionInfo?.expression==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1})]}function Ce(e,t){const i=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:i,referenceWidth:i,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:t}}function Ri(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0],n={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if(e.outline?.style==="solid")return[s.ensureInstance(S.patternOutlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),sprite:n,scaleInfo:null,effects:null})];const o=[],l=s.ensureInstance(S.patternFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:n,scaleInfo:null,effects:null});return o.push(l),e.outline&&o.push(...J(e.outline,t,!0)),o}function Oi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0];if(e.style!=="none"&&e.outline?.style==="solid")return[s.ensureInstance(S.outlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})];const n=[];if(e.style!=="none"){const o=s.ensureInstance(S.fill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,scaleInfo:null,effects:null});n.push(o)}return e.outline&&n.push(...J(e.outline,t,!0)),n}async function Ve(e,t){if(e.type==="cim")return te(e.data,t);const{style:i}=e;return i&&i!=="none"&&i!=="solid"?Ri(e,t):Oi(e,t)}function Ci(e,t){const{outline:i}=e,{uniforms:r,schemaOptions:s}=t,{store:a}=s,n=[],o=G.createPictureFillRasterizationParam(e);if(!o)return[];const{width:l,height:u,xoffset:d,yoffset:c,xscale:p,yscale:y}=e,m={color:[255,255,255,255],sprite:o,height:u,aspectRatio:l/u,offsetX:d,offsetY:c,scaleX:p,scaleY:y,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if(i?.style==="solid")return[a.ensureInstance(S.complexOutlineFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...m,...Ce(i,!!r.visualVariableSizeOutlineScaleStops)})];const I=a.ensureInstance(S.complexFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return n.push(I.createMeshInfo(m)),i&&n.push(...J(i,t,!0)),n}function J(e,t,i){const{color:r,style:s,width:a,cap:n,join:o}=e,{schemaOptions:l}=t,{store:u}=l,d=[],c=i?{...ge,visualVariableSizeScaleStops:t.uniforms.visualVariableSizeOutlineScaleStops}:t.uniforms,p={uniforms:{visualVariableColor:c.visualVariableColor,visualVariableOpacity:c.visualVariableOpacity,visualVariableSizeMinMaxValue:c.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:c.visualVariableSizeScaleStops,visualVariableSizeStops:c.visualVariableSizeStops,visualVariableSizeUnitValue:c.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},y={color:r?.toArray()??[0,0,0,0],width:a,referenceWidth:a,capType:n,joinType:o,miterLimit:e.miterLimit,hasSizeVV:ie(c),effects:null,scaleInfo:null};if(s==null||s==="solid"){const m=u.ensureInstance(S.line,p).createMeshInfo(y);d.push(m)}else if(s!=="none"){const m=u.ensureInstance(S.texturedLine,p).createMeshInfo({...y,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Bt(s,n)},overrides:[]}});d.push(m)}return e.marker!=null&&d.push(...Fi(e.marker,e,t)),d}async function re(e,t,i){const r=t.labelsVisible&&t.labelingInfo||[],s=R(t),a=Qt(r,s);return{type:"label",classes:await Promise.all(a.map((n,o)=>Ti(e,n,o,i)))}}async function Ti(e,t,i,r){const s=await T(t,{path:`${i}`,schemaOptions:e,uniforms:r});return{maxScale:t.maxScale,minScale:t.minScale,expression:t.labelExpressionInfo?.expression??t.labelExpression,where:t.where,meshes:s}}async function se(e,t){if(!t)return{type:"simple",meshes:[]};switch(t.type){case"simple":return zi(e,t);case"dot-density":return qi(e,t);case"class-breaks":return Ai(e,t);case"unique-value":return Mi(e,t);case"dictionary":return Pi(t);case"heatmap":return ki(e,t);case"pie-chart":return Ni(e,t)}}async function zi(e,t){const i=t.getSymbols(),r=i.length?i[0]:null,s=E(t);return{type:"simple",meshes:await T(r,{schemaOptions:e,uniforms:s,path:"renderer.symbol"})}}async function qi(e,t){const i=E(t);return{type:"dot-density",meshes:await _i(t,{schemaOptions:e,uniforms:i,path:"renderer.symbol"})}}async function Ai(e,t){const i=E(t),r=t.backgroundFillSymbol,s=t.normalizationType,a=s==="log"?"esriNormalizeByLog":s==="percent-of-total"?"esriNormalizeByPercentOfTotal":s==="field"?"esriNormalizeByField":null,n=t.classBreakInfos.map(async d=>({meshes:await T(d.symbol,{path:`renderer-stop-${d.minValue}-${d.maxValue}`,schemaOptions:e,uniforms:i}),min:d.minValue,max:d.maxValue})),o=(await Promise.all(n)).sort((d,c)=>d.min-c.min),l=await T(r,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:i.visualVariableSizeOutlineScaleStops}}),u=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:i});return{type:"interval",field:t.field,expression:t.valueExpression,backgroundFill:l,defaultSymbol:u,intervals:o,normalizationField:t.normalizationField,normalizationTotal:t.normalizationTotal,normalizationType:a,isMaxInclusive:t.isMaxInclusive}}async function Mi(e,t){const i=[],r=E(t),s=await T(t.backgroundFillSymbol,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),a=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:r});for(const n of t.uniqueValueInfos??[]){const o=await T(n.symbol,{path:`renderer-unique-value-${n.value}`,schemaOptions:e,uniforms:r});i.push({value:""+n.value,symbol:o})}return{type:"map",field:t.field,expression:t.valueExpression,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,backgroundFill:s,defaultSymbol:a,map:i}}function Pi(e){const t=E(e),i=e.scaleExpression,r=i!=null&&i!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:e.fieldMap,scaleExpression:r,visualVariableUniforms:t}}async function ki(e,t){return{type:"heatmap",meshes:await wi(t,e)}}async function Ni(e,t){return{type:"pie-chart",meshes:await Ii(t,e)}}async function Ui(e,t){const i=t.renderer,r=E(i);return{symbology:await se(e,i),labels:await re(e,t,r)}}async function P(e,t,i,r){const s=i.featureReduction;if(s)switch(s.type){case"binning":return Li(s,e,t,i,r);case"cluster":return Di(s,e,t,i,r)}const a=ji(i.orderBy,i.renderer,i.objectIdField),n=xe(i.renderer,t.filters),o=await Ui(e,i),l=Te(o.symbology);return{storage:n,mesh:{properties:{sortKey:a,timeZone:t.timeZone,returnMeshObjectId:l,displayRefreshVersion:r},strategy:{type:"feature"},factory:o}}}function nt(e,t){return e.fields.map(i=>({...i.toJSON(),type:Bi(i,t)}))}function Bi(e,t){const{onStatisticExpression:i,onStatisticField:r,statisticType:s}=e;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:n}=i;return n?n==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const a=t.find(n=>n.name===r);return a?a.type:"esriFieldTypeString"}}}async function Li(e,t,i,r,s){const a=nt(e,r.fields),n=e.renderer,o=await se(t,n),l=xe(n,[null,null]),u=E(n),d=await re(t,{geometryType:"polygon",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},u),c=Te(o),p=e.binType==="geohash"?{type:"geohash",fixBinLevel:e.fixedBinLevel??3}:{type:"grid",size:H(e.size),fixedBinLevel:e.fixedBinLevel};return{storage:l,mesh:{properties:{sortKey:null,timeZone:i.timeZone,returnMeshObjectId:c,displayRefreshVersion:s},strategy:{type:"binning",fields:a,index:p,featureFilter:i.filters[0]},factory:{labels:d,symbology:o}}}}async function Di(e,t,i,r,s){const a=nt(e,r.fields),n={type:"cluster",feature:await se(t,e.effectiveFeatureRenderer),cluster:await se(t,e.effectiveClusterRenderer)},o=E(e.effectiveFeatureRenderer),l={type:"cluster",feature:await re(t,r,o),cluster:await re(t,{geometryType:"point",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},o)},u=xe(e.effectiveFeatureRenderer,[null,null]),d=Te(n);return{storage:u,mesh:{properties:{sortKey:null,timeZone:i.timeZone,displayRefreshVersion:s,returnMeshObjectId:d},strategy:{type:"cluster",fields:a,featureFilter:i.filters[0],clusterRadius:H(e.clusterRadius/2)},factory:{labels:l,symbology:n}}}}function ji(e,t,i){const r=t!=null&&t.type==="unique-value"&&t.orderByClassesEnabled;if(e!=="default"||r||(e=[new $t({field:i,order:"descending"})]),e!=="default"&&e?.length){e.length;const s=e[0],a=s.order==="ascending"?"asc":"desc";return s.field?{field:s.field,order:a}:s.valueExpression?{expression:s.valueExpression,order:a}:null}return r?{byRenderer:!0,order:"asc"}:null}function Z(e){return e.techniqueType===Re.AnimatedMarker}function Te(e){return!!(e.type==="simple"&&e.meshes.some(Z)||e.type==="interval"&&(e.intervals.some(t=>t.meshes.some(Z))||e.backgroundFill.some(Z))||e.type==="map"&&(e.map.some(t=>t.symbol.some(Z))||e.backgroundFill.some(Z)))}let Ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,globalIdField:a,datesInUnknownTimezone:n,orderBy:o,parsedUrl:l}=t,u=t.fieldsIndex.toJSON(),d=R(t),c=t.timeInfo?.toJSON(),p=t.spatialReference.toJSON(),y=ae(l);let m=s;if(o?.length){const I=!o[0].valueExpression&&o[0].field;I&&(m=I)}return{type:"feature-service",source:y,isSourceHosted:be(y.path),orderByFields:m,outSpatialReference:e.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:n,globalIdField:a,fieldsIndex:u,geometryType:d,objectIdField:s,timeInfo:c,spatialReference:p,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s,apiKey:a}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,a)}createProcessorSchema(e,t,i){const{fields:r,geometryType:s,orderBy:a,objectIdField:n,renderer:o,labelingInfo:l,labelsVisible:u}=this.layer,d={featureReduction:null,fields:r.map(c=>c.toJSON()),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:n,orderBy:a??"default",renderer:o?.clone()};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,apiKey:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,apiKey:r,customParameters:n,definitionExpression:i,labelingInfo:a,orderBy:o,renderer:s}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function ze(e,t){const i=e.extent,r=t?.clone().intersection(i),s=r!=null?r.width*r.height:0,a=t?t.width*t.height:0,n=a===0?0:s/a,o=g("featurelayer-snapshot-point-coverage");return!isNaN(n)&&n>=o}function $(e,t){return e.floorInfo!=null&&(e.floorInfo.viewAllLevelIds.length>0||t.floors.length>0)}function qe(e,t,i){const r=$i(e,t?.where,i);return r&&(t??=new ee,t.where=r),t}function $i(e,t,i){if(e.floorInfo==null||!i.floors?.length)return t;let r=i.floors;const{floorField:s,viewAllLevelIds:a}=e.floorInfo;a.length&&(r=a);const n=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(n.push("''"),t?.includes(s)){let l=new RegExp("AND \\("+s+".*NULL\\)","g");t=t.replace(l,""),l=new RegExp("\\("+s+".*NULL\\)","g"),t=(t=t.replace(l,"")).replaceAll(/\s+/g," ").trim()}let o="("+s+" IN ({ids}) OR "+s+" IS NULL)";return o=o.replace("{ids}",n.join(", ")),Fe(t,o)}let Qi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,typeIdField:a,globalIdField:n,datesInUnknownTimezone:o,orderBy:l,subtypeField:u,refreshInterval:d}=t,c=t.fieldsIndex.toJSON(),p=R(t),y=t.timeInfo?.toJSON(),m=t.spatialReference.toJSON(),I=t.types?.map(B=>B.toJSON()),V=ae(this.layer.parsedUrl);this.layer.dynamicDataSource&&(V.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let W=this.layer.objectIdField;if(l?.length){const B=!l[0].valueExpression&&l[0].field;B&&(W=B)}const Se=r?.lastEditDate==null&&d>0,ne=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!Se,lt=ne&&ze(e,t.fullExtent);return{type:"feature-service",source:V,isSourceHosted:be(V.path),orderByFields:W,outSpatialReference:e.spatialReference.toJSON(),metadata:{typeIdField:a??void 0,types:I,timeReferenceUnknownClient:o,subtypeField:u,globalIdField:n,fieldsIndex:c,geometryType:p,objectIdField:s,timeInfo:y,spatialReference:m,subtypes:this.layer.subtypes?.map(B=>B.toJSON())},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:ne,supportsSnapshotMaxThreshold:lt,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer;return U({definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l},e,t,u)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,gdbVersion:s,apiKey:a,subtypeCode:n}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null,l=t.historicMoment?.getTime()??void 0,u=JSON.stringify(t.customParameters),d=w(t,e),c=JSON.stringify(t.orderBy),p=$(this.layer,e)?e.floors:null;return{outFields:this.layer.outFields,apiKey:a,customParameters:u,definitionExpression:i,featureReduction:d,floors:p,gdbVersion:s,historicMoment:l,labelingInfo:o,orderBy:c,renderer:r,subtypeCode:n}}};function Hi(e){if(!("openPorts"in e))throw new C("source-not-supported")}class Ye{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.timeInfo?.toJSON(),l=i.spatialReference.toJSON();return Hi(i.source),{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,timeInfo:o,spatialReference:l,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r,timeExtent:s}=this.layer;return U({definitionExpression:r,timeExtent:s,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,orderBy:u,objectIdField:d}=this.layer,c={fields:s.map(p=>p.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:d,orderBy:u??"default"};return P(t,i,c,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=w(i,t),o=JSON.stringify(i.orderBy);return{outFields:this.layer.outFields,orderBy:o,definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}}class Gi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.spatialReference.toJSON();return{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:i.timeInfo?.toJSON(),timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r}=this.layer;return U({definitionExpression:r,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i;return{definitionExpression:r,renderer:s,labelingInfo:this.layer.labelsVisible?this.layer.labelingInfo:null,featureReduction:w(i,t)}}}let Wi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r}=t,s=t.fieldsIndex.toJSON(),a=R(t),n=t.timeInfo?.toJSON(),o=t.spatialReference.toJSON(),l=t.source.getSource(),u=this.layer.objectIdField,d=ae(i);return d.query.maxRecordCount=l.maxRecordCount,{type:"ogc",source:l,orderByFields:u,outSpatialReference:e.spatialReference.toJSON(),metadata:{fieldsIndex:s,geometryType:a,objectIdField:r,timeInfo:n,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:d.query.maxRecordCount,supportsCompactGeometry:d.query.supportsCompactGeometry,supportsDefaultSpatialReference:d.query.supportsDefaultSpatialReference,supportsFormatPBF:d.query.supportsFormatPBF,supportsMaxRecordCountFactor:d.query.supportsMaxRecordCountFactor,supportsQuantization:d.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{customParameters:i,timeExtent:r,apiKey:s}=this.layer;return U({customParameters:i,timeExtent:r},e,t,s)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{renderer:i,apiKey:r}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:r,customParameters:JSON.stringify(t.customParameters),featureReduction:w(t,e),labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:i}}},Ki=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r,globalIdField:s,orderBy:a,refreshInterval:n}=t,o=t.fieldsIndex.toJSON(),l=R(t),u=t.timeInfo?.toJSON(),d=t.spatialReference.toJSON(),c=ae(this.layer.parsedUrl);let p=this.layer.objectIdField;if(a?.length){const V=!a[0].valueExpression&&a[0].field;V&&(p=V)}const y=n>0,m=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!y,I=m&&ze(e,t.fullExtent);return{type:"feature-service",source:c,isSourceHosted:be(c.path),orderByFields:p,outSpatialReference:e.spatialReference.toJSON(),metadata:{globalIdField:s,fieldsIndex:o,geometryType:l,objectIdField:r,timeInfo:u,spatialReference:d,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:m,supportsSnapshotMaxThreshold:I,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,null)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,outFields:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=w(t,e);return{outFields:s,orderBy:JSON.stringify(t.orderBy),definitionExpression:i,renderer:r,labelingInfo:a,featureReduction:o,customParameters:n,floors:$(this.layer,e)?e.floors:null}}},Zi=class{constructor(e){this.layer=e}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}getUpdateHashProperties(e){const t=this.layer,{renderer:i}=t,r=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(t.customParameters),a=w(t,e),n=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,labelingInfo:r,featureReduction:a,customParameters:s,orderBy:n,renderer:i}}async createServiceOptions(e){const t=R(this.layer);return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:e.spatialReference.toJSON(),geometryInfo:this.layer.source.geometryInfo,metadata:{spatialReference:this.layer.spatialReference,fieldsIndex:this.layer.fieldsIndex.toJSON(),objectIdField:this.layer.objectIdField,geometryType:t,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null}}}createSourceSchema(e,t){return{type:"parquet",mutable:{sourceRefreshVersion:t,availableFields:e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,t,i){const r={fields:this.layer.fields.map(s=>s.toJSON()),renderer:this.layer.renderer?.clone(),featureReduction:w(this.layer,t),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return P(e,t,r,i)}};class Yi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{objectIdField:r}=i,s=R(i),a=i.timeInfo?.toJSON()||null,n=i.spatialReference?i.spatialReference.toJSON():null;return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:r,timeInfo:a,timeReferenceUnknownClient:null,spatialReference:n,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(t,i){const{definitionExpression:r,geometryDefinition:s,customParameters:a}=this.layer;return{type:"stream",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{geometryDefinition:s?.toJSON(),definitionExpression:r,customParameters:a??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(i.customParameters);return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:w(i,t),customParameters:n,geometryDefinition:i.geometryDefinition,definitionExpressoin:i.definitionExpression}}}async function Xi(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(({renderer:s})=>se(e,s)));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}function er(e,t){const i=Wt();return{type:"subtype",filters:e.filters,capabilities:{maxTextureSize:i.maxTextureSize},subtypeField:t.subtypeField,target:"feature",bindings:t.sublayers.reduce((r,{renderer:s,subtypeCode:a})=>{const n=Nt(s);return{...r,[a]:n}},{})}}async function tr(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(s=>{const a=E(s.renderer),n={...s,geometryType:s.geometryType??null};return re(e,n,a)}));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}async function ir(e,t,i,r){return{storage:er(t,i),mesh:{properties:{timeZone:t.timeZone,displayRefreshVersion:r,returnMeshObjectId:!1,sortKey:null},strategy:{type:"feature"},factory:{symbology:await Xi(e,i),labels:await tr(e,i)}}}}class rr{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(i=>z(i))}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,datesInUnknownTimezone:s,editingInfo:a,globalIdField:n,objectIdField:o,refreshInterval:l,subtypeField:u}=i,d=i.fieldsIndex.toJSON(),c=R(i),p=i.timeInfo?.toJSON(),y=i.spatialReference.toJSON(),m=ae(this.layer.parsedUrl),I=o,V=a?.lastEditDate==null&&l>0,W=!!g("featurelayer-snapshot-enabled")&&i.geometryType==="point"&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!V,Se=W&&ze(t,i.fullExtent);return{type:"feature-service",source:m,isSourceHosted:be(m.path),orderByFields:I,outSpatialReference:t.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:s,subtypeField:u,globalIdField:n,fieldsIndex:d,geometryType:c,objectIdField:o,timeInfo:p,spatialReference:y,subtypes:this.layer.subtypes?.map(ne=>ne.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:W,supportsSnapshotMaxThreshold:Se,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(t,i){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer,d={queryScaleRanges:this.layer.sublayers.items.map(c=>({subtypeCode:c.subtypeCode,minScale:c.minScale,maxScale:c.maxScale})),definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l};return U(d,t,i,u)}createProcessorSchema(t,i,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,a=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:a.labelingInfo,labelsVisible:a.labelsVisible,renderer:a.renderer,subtypeCode:a.subtypeCode,orderBy:null}))};return ir(t,i,s,r)}hasFilters(t){return $(this.layer,t)||sr(this.layer,t)}addFilters(t,i){t=qe(this.layer,t,i);const r=this.layer.sublayers.filter(a=>!ot(a,i)).map(a=>a.subtypeCode);if(!r.length)return t;t??=new ee;const s=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return t.where=Fe(t.where,s),t}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:a}=i,n=i.historicMoment?.getTime()??void 0,o=JSON.stringify(i.customParameters),l=$(this.layer,t)?t.floors:null,u=this.layer.sublayers.map(({renderer:d,labelsVisible:c,labelingInfo:p,visible:y})=>({renderer:d,labelsVisible:c,labelingInfo:p,visible:y}));return{outFields:this.layer.outFields,gdbVersion:s,definitionExpression:r,historicMoment:n,customParameters:o,apiKey:a,sublayers:u,floors:l}}setGraphicOrigin(t){const i=this.layer.fieldsIndex.get(this.layer.subtypeField),r=t.attributes[i.name],s=this.layer.sublayers.find(a=>a.subtypeCode===r);t.layer=t.sourceLayer=s}}function sr(e,t){return e.sublayers.some(i=>!ot(i,t))}function ot(e,t){return e.visible&&(e.minScale===0||Ue(t.scale,e.minScale)||t.scalee.maxScale)}async function b(e,t){try{return await e}catch(i){if(i.name!=="no-queryEngine")throw i;return t}}function D(e,t){const i=new Set;for(const r of e instanceof Set?e.values():e.keys())t.has(r)||i.add(r);return i}class ar{constructor(t,i,r){const s=r?t.getTileCoverage(r,0,!0,"closest"):null,a=t.getTileCoverage(i,0,!0,"closest");if(this._tileKeys=new Map,s)for(const n of s.keys())this._tileKeys.set(n.id,n);if(a)for(const n of a.keys())this._tileKeys.set(n.id,n)}get coverageSet(){return new Set(this._tileKeys.keys())}keys(){return this._tileKeys.values()}}class nr{constructor(t){this.version=t}}class or{constructor(t){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=t}destroy(){}get _coverageSet(){return this._coverage?.coverageSet??new Set}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(t,i){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._updateCoverage(t,i),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(t,i){this._coverage=new ar(this._config.tileInfoView,t,i)}_updateSubscriptions(){const t=this._coverageSet,i=this._updateVisibility(),r=D(i,t),s=D(this._subscriptions,i),a=D(t,this._subscriptions),n=D(s,t),o=D(r,n),l=D(o,this._paused);this._visible=i;for(const u of a.values())this._subscriptions.set(u,new nr(this._version));for(const u of l.values())this._paused.add(u);for(const u of n.values())this._subscriptions.delete(u),this._paused.delete(u);(a.size||n.size||l.size)&&this._sendUpdateSubscriptions(a,n,l)}_sendUpdateSubscriptions(t,i,r){const s=Array.from(t.values()).map(a=>({tileId:a,version:this._subscriptions.get(a).version}));this._config.updateSubscriptions({subscribe:s,unsubscribe:Array.from(i.values()),pause:Array.from(r.values())})}_updateVisibility(){const t=new Set,i=new Set;if(!this._coverage)return t;for(const a of this._coverage.keys()){if(this._config.isDone(a)){t.add(a.id);continue}this._addVisibleParent(t,i,a)||this._addVisibleChildren(t,a)||t.add(a.id)}const r=new Y(0,0,0,0),s=new Y(0,0,0,0);for(const a of i){r.id=a;for(const n of t)s.id=n,r.containsChild(s)&&t.delete(n)}return t}_addVisibleParent(t,i,r){let s=!1;for(const a of this._visible.values())new Y(a).containsChild(r)&&(t.add(a),i.add(a),s=!0);return s}_addVisibleChildren(t,i){let r=!1;for(const s of this._visible.values()){const a=new Y(s);i.containsChild(a)&&(t.add(s),r=!0)}return r}}const lr=e=>{let t=class extends e{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([pe(()=>{const i=this.layer;return[i&&"elevationInfo"in i?i.elevationInfo?.featureExpressionInfo:null,i&&"displayField"in i?i.displayField:null,i&&"timeInfo"in i&&i.timeInfo,i&&"renderer"in i&&i.renderer,i&&"labelingInfo"in i&&i.labelingInfo,i&&"floorInfo"in i&&i.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),_t),Be(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),Be(()=>{const i=this.layer;return i&&"sublayers"in i?i.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:i,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in i&&i.outFields?Le(r,[...De(r,i.outFields),...s]):Le(r,s)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(i){this._override("featureEffect",i)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(i){x.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(i){throw new Error("missing implementation")}createQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=this.filter!=null?this.filter.createQuery(i):new me(i);if("floorInfo"in this.layer&&this.layer.floorInfo){const s=Ke(this);s!=null&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new me(i)}queryFeatures(i,r){throw new Error("missing implementation")}queryObjectIds(i,r){throw new Error("missing implementation")}queryFeatureCount(i,r){throw new Error("missing implementation")}queryExtent(i,r){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(i,r){return this._validateFetchPopupFeatures(i,r),this._fetchPopupFeatures(i,r)}_loadArcadeModules(i){return i.expressionInfos?.length||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression")?wt():Promise.resolve()}_handleRequiredFieldsChange(){const i=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",i),i.then(()=>{this._updatingRequiredFieldsPromise===i&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const i=this.view.type==="3d",{layer:r,layer:{fieldsIndex:s,objectIdField:a}}=this,n="renderer"in r&&r.renderer,o="orderBy"in r&&r.orderBy,l="featureReduction"in r?r.featureReduction:null,u=new Set,d=await Promise.allSettled([n?n.collectRequiredFields(u,s):null,je(u,r),i&&"elevationInfo"in r?It(u,r):null,this.filter!=null?Je(u,r,this.filter):null,i||this.featureEffect==null?null:Je(u,r,this.featureEffect.filter),!i&&l?Vt(u,r,l):null,!i&&o?Ft(u,r,o):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&oe(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&oe(u,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&i&&r.infoFor3D!=null&&(r.globalIdField==null&&x.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),oe(u,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){ve(u,s,r.subtypeField);const p=r.sublayers.map(y=>Promise.all([y.renderer?.collectRequiredFields(u,s),je(u,y)]));await Promise.allSettled(p)}if(r.type==="catalog-footprint"&&r.parent){const p=r.parent;oe(u,s,[p.itemNameField,p.itemSourceField,p.itemTypeField,p.maxScaleField,p.minScaleField])}for(const p of d)p.status==="rejected"&&x.getLogger(this).error(p.reason);ve(u,s,a),i&&"displayField"in r&&r.displayField&&ve(u,s,r.displayField);const c=Array.from(u).sort();this._set("requiredFields",c)}_validateFetchPopupFeatures(i,r){if(r!=null)for(const s of i){const a=s.origin&&"layer"in s.origin?s.origin.layer:s.layer;if("popupEnabled"in a&&!a.popupEnabled)throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a});if(s.isAggregate){const n="featureReduction"in a?a.featureReduction:null;if(!(n&&"popupTemplate"in n&&n.popupEnabled&&n.popupTemplate))throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a})}else if("popupTemplate"in a&&!_e(a,r))throw new C("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:a})}}_popupFeatureHasRequiredFields(i,r){return xt(r,i)}async _fetchPopupFeatures(i,r){const s=new Array(i.length),a=new Map,n=await this._createPopupQuery(i.map(o=>o.origin?.layer??o.layer),r);for(let o=0;oi.add(r)),t&&t.forEach(r=>i.add(r)),i.has("*")?["*"]:Array.from(i)}const Xe=4294967294;let _=class extends lr(Xt(Tt(zt))){constructor(){super(...arguments),this._commandsQueue=new kt({process:e=>{switch(e.type){case"edit-by-feature":case"edit-by-id":return this._doEdit(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new Kt,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new O,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new ei}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(Ae()),this._commandsQueue.destroy()}initialize(){this._workerAttached=ye(),K(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new C("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(e.geometryType==="mesh")throw new C("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if((e.type==="feature"||e.type==="subtype-group")&&ct(e)?.operations.supportsQuery===!1)throw new C("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await li(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(i){this._workerAttached.reject(Ae()),Me(i)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,i=!this.suspended;return e.map(({vvEvaluators:r,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:r,deconflictionEnabled:s,geometryType:t,visible:i}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new Ye(this.layer):new Qi(this.layer);case"geojson":case"csv":case"wfs":return new Ye(this.layer);case"parquet":return new Zi(this.layer);case"subtype-group":return new rr(this.layer);case"ogc-feature":return new Wi(this.layer);case"stream":return new Yi(this.layer);case"oriented-imagery":return new Ki(this.layer);case"knowledge-graph-sublayer":return new Gi(this.layer);case"catalog-footprint":return new Ji(this.layer);default:Ot(this.layer)}return null}get timeExtent(){return Ct(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t="default"){let i;e instanceof we?i=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?i=[e]:dt.isCollection(e)&&e.length>0?i=e.map(s=>s?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(s=>s?.getObjectId()));const r=i?.filter(pt);return r?.length?(this._addHighlights(r,t),Pe(()=>this._removeHighlights(r,t))):Pe()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,t){const i=await this.featureContainer.hitTest(t);if(i.length===0)return null;const r=await this.getWorker(),{features:s,aggregates:a}=await r.pipeline.getDisplayFeatures(i),n=this.featureContainer.getSortKeys(i),o=({displayId:l},{displayId:u})=>n.has(l)&&n.has(u)?n.get(l)-n.get(u):l-u;return s.sort(o).reverse(),a.sort(o).reverse(),[...a.map(l=>this._createGraphicHit(e,Oe.fromJSON(l))),...s.map(l=>this._createGraphicHit(e,we.fromJSON(l)))]}async queryStatistics(){const e=await this.getWorker();return b(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,i);return b(a,{})}async queryAggregateSummaryStatistics(e,t,i){const r={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,i);return b(s,{})}async queryUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(i=>{const r=Ie.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}async queryVisibleFeatures(e,t){const i=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await b(i,{features:[]}),s=Ie.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregates(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await b(i,{features:[]}),s=ti.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregateIds(e,t){const i=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return b(i,[])}async queryAggregateCount(e,t){const i=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return b(i,0)}async queryAggregateJSON(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return b(i,{features:[]})}async queryFeaturesJSON(e,t){const i=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return b(i,{features:[]})}async queryObjectIds(e,t){const i=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return b(i,[])}async queryFeatureCount(e,t){const i=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return b(i,0)}async queryExtent(e,t){const i=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await b(i,{count:0,extent:null});return{count:r.count,extent:ht.fromJSON(r.extent)}}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this._subscriptionManager.update(e.targetState,this._lastTargetState);this.featureContainer.setVisibleTiles(t)}attach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),K(this._updatingHandles.addPromise(this._workerAttached.promise)),K(this._attachProxy()),this.featureContainer=new ni(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new or({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),K(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([pe(()=>JSON.stringify({displayRefreshVersion:this._displayRefreshVersion,timeExtent:this.timeExtent,clips:this.clips,filter:this.filter,featureEffect:this.featureEffect,sourceRefreshVersion:this._sourceRefreshVersion,timeZone:this.view.timeZone,effect:this.featureEffect,...this.layerAdapter.getUpdateHashProperties(this.view)}),()=>this._update(),ft),pe(()=>this.updateSuspended,e=>{e||(this._subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),pe(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this.layer.type!=="stream"&&this.layer.type!=="parquet"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=yt(this._subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=ye(),K(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updateTracking.updating,i=this._updatingRequiredFieldsPromise!=null,r=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||i)||r||this._pipelineUpdating||this.dataUpdating;if(g("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} + -> updateRequested ${this.updateRequested} + -> hasRenderer ${e} + -> updatingRequiredFields ${i} + -> hasPendingCommand ${t} + -> dataUpdating ${this.dataUpdating} + -> processing ${this._pipelineUpdating} + -> updatingContainer ${r} +`);for(const a of this.featureContainer.subscriptions())console.log(` -> Tile[${a.id}] Done: ${a.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:t=>{this._set("_pipelineUpdating",t.pipeline),this._set("dataUpdating",t.data)},emitEvent:t=>{this.emit(t.name,t.event)},get eventLog(){return e.eventLog},fetch:t=>Promise.all(t.map(i=>e.view.stage.painter.textureManager.rasterizeItem(i))),fetchDictionary:t=>Promise.all(t.map(i=>this._fetchDictionaryRequest(i)))}}async _fetchDictionaryRequest(e){try{if(this.layer.type==="subtype-group")throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||t.type!=="dictionary")throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const i=this._lastSchema.processor.mesh.factory.symbology;if(i.type!=="dictionary")throw new Error("InternalError: Expected schema to be of type 'dictionary'");const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:i.scaleExpression};this._fields||(this._fields=this.layer.fields.map(n=>n.toJSON()));const s=i.visualVariableUniforms,a=await t.getSymbolAsync(e.feature,{fields:this._fields});return!a||!a.data?{type:"dictionary-response",meshes:[]}:{type:"dictionary-response",meshes:await te(a.data,{uniforms:s,path:"renderer",schemaOptions:r})}}catch{return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=me.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=me.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const i=t.objectIds??[];for(const r of t.aggregateIds??[])i.push(r);return t.objectIds=i,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.updateSuspended)return void this._subscriptionManager.suspend();const t=this._getEffectiveEdit(e);return t?this._commandsQueue.push(t).catch(Me):void 0}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Xe+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Xe+1}_getEffectiveEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some(o=>o.objectId===-1||!o.objectId),r=t&&this.availableFields.includes(t);if(i&&!r)return x.getLogger(this).error(new C("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null;const s=this.layer,a=e.historicMoment?.getTime()??null,n="layerId"in s&&e.editedFeatures?.find(o=>o.layerId===s.layerId);if(n&&this._canEditByFeature(n)){const o=Mt(this.layer.geometryType),{adds:l,deletes:u,updates:d}=n.editedFeatures,c=this.layer.objectIdField,p=l.map(m=>Qe(m,o,!1,!1)),y=d.map(m=>Qe(m.current,o,!1,!1));return{type:"edit-by-feature",added:p,removed:u.map(m=>"attributes"in m?{globalId:t?m.attributes[t]:null,objectId:c?m.attributes[c]:null}:m),updated:y,historicMoment:a}}return{type:"edit-by-id",added:e.addedFeatures,updated:e.updatedFeatures,removed:e.deletedFeatures,historicMoment:a}}_canEditByFeature(e){const{adds:t,updates:i}=e.editedFeatures;return t.every(r=>this.view.spatialReference.equals(r.geometry?.spatialReference))&&i.every(r=>this.view.spatialReference.equals(r.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await this._updateRequiredFields(),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},r=this._createViewSchemaConfig(),s={source:this.layerAdapter.createSourceSchema(r,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,r,this._displayRefreshVersion)},a=ke(this._lastSchema?.source.mutable,s.source.mutable)||ke(this._lastSchema?.processor,s.processor);if(!a)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=s,this._fields=null;const n=Math.round(performance.now());g("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${n}] FeatureLayerView2D._doUpdate`,{changes:a}),await(await this.getWorker()).pipeline.updateSchema(s,n),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.swapRenderState(),this.featureContainer.requestRender(),g("esri-2d-update-debug")&&console.debug(`Version[${n}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){g("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){const t=await this.getWorker();try{this.featureContainer.editStart(),await t.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(i){Ne(i)}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return this.filter!=null||this.timeExtent!=null||this._visibilityOverrides.size>0||e}_getEffectiveAvailableFields(e){const t=ur(this._lastAvailableFields,e);return this._lastAvailableFields=t,mt(this.layer.fieldsIndex,t)}_createViewSchemaConfig(){const e=[cr(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),filters:e,scale:this.view.scale,timeZone:this.view.timeZone}}_addHighlights(e,t){this._highlightCounter.addGroup(e,t),this._commandsQueue.push({type:"highlight"})}_removeHighlights(e,t){this._highlightCounter.deleteGroup(e,t),this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=[];for(const r of this._highlightCounter.ids()){const s=this._highlightCounter.getHighlightGroups(r),a=this._getHighlightBits(s);e.push({objectId:r,highlightFlags:a})}const t=await this.getWorker();if(this.destroyed)return;const i=t.pipeline.updateHighlight({highlights:e}).catch(r=>{Ne(r)||x.getLogger(this).error(r)});this._updatingHandles.addPromise(i)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function cr(e,t,i,r,s){s&&(s=s.clone());const a=s!=null?s.timeExtent:null,n=i!=null&&a!=null?i.intersection(a):i||a;n&&(s??=new ee,s.timeExtent=n),s=t.addFilters?.(s,e)??s;let o=s?.toJSON()??null;return r.size&&(o??=new ee().toJSON(),o.hiddenIds=Array.from(r)),o}h([f()],_.prototype,"_commandsQueue",void 0),h([f()],_.prototype,"_sourceRefreshVersion",void 0),h([f()],_.prototype,"_displayRefreshVersion",void 0),h([f({readOnly:!0})],_.prototype,"_pipelineUpdating",void 0),h([f({readOnly:!0})],_.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],_.prototype,"hasFullGeometries",null),h([f()],_.prototype,"featureEffectView",void 0),h([f()],_.prototype,"labelingCollisionInfos",null),h([f()],_.prototype,"layerAdapter",null),h([f({readOnly:!0})],_.prototype,"timeExtent",null),h([f()],_.prototype,"updating",void 0),_=h([Q("esri.views.2d.layers.FeatureLayerView2D")],_);const dr=_,ua=Object.freeze(Object.defineProperty({__proto__:null,default:dr},Symbol.toStringTag,{value:"Module"}));export{ua as F,b as n,dr as r}; diff --git a/main/assets/FeaturePipelineWorker-7KRvCyaS-Bg5P0_6-.js b/main/assets/FeaturePipelineWorker-7KRvCyaS-Bg5P0_6-.js new file mode 100644 index 000000000..62fe50989 --- /dev/null +++ b/main/assets/FeaturePipelineWorker-7KRvCyaS-Bg5P0_6-.js @@ -0,0 +1 @@ +import{v as V,S as ge,i as Xt,K as w,bo as Se,ah as Ne,b9 as Qt,o as W,f4 as Qs,dA as Zs,bt as et,hC as le,J as P,aA as Zt,$ as Z,j as Ht,f as tt,b as Hs,ff as Jt,bV as Js,x as Ks,hr as er,hn as tr,I as st,gU as rt,E as we,fn as sr,p as rr,fk as ir,bw as nr,ae as ar,O as or,l as dr,n as ur,B as ft,dY as yt,a1 as cr}from"./main-C7yV2j71.js";import{M as it,t as lr}from"./workers-PiCjreoO-DqI62TYf.js";import{V as hr}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{Q as _r,Z as pr,V as gr}from"./Tile-D75RMC64-CM0vKD9b.js";import{s as nt}from"./TileKey-C5IL-JBr-COMthbrT.js";import{t as T}from"./definitions-DJSdSb77-DkoRHaVx.js";import{P as Kt,C as mt,S as bt}from"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import{P as fr,m as yr,o as at,E as ot,W as wt,e as Fe,G as es,O as mr,q as br,L as wr}from"./AttributeStore-DjyP9U7y-Du97X0SU.js";import{d as Ir,g as vr}from"./MeshWriterRegistry-CIC9Yk_f-I3l8mR_m.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import{A as xr,q as ss,d as Sr,j as rs,V as Fr,D as kr,e as Cr,f as Tr,C as Q,$ as is,n as Mr,O as ns,X as qr}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{i as Y,a as he,c as M}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{f as Er,h as Ie}from"./queryUtils-Brxu6254-T3UhaATW.js";import{o as de}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{s as Or}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";import{Z as as}from"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import{P as Rr,p as Ar,q as It}from"./query-DFW9-NG_-CfusC8cS.js";import{L as Pr}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{b as os}from"./Query-BrwMGK8U-DV_czrJX.js";import{k as jr}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{z as ds}from"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import{_ as vt}from"./ogcFeatureUtils-Bs12bZY3-Dzw8-_6l.js";import{o as Dr}from"./pbf-D-y3_eZO-SEvl9j6c.js";import{k as Lr,m as zr}from"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import{i as xt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{createConnection as Ur}from"./createConnection-CrkuTLXs-BPFNVKMW.js";import{a as Wr}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./PieChartMeshWriter-C5yLDFwp-0zzyhiO2.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./TurboLine-CIlsAy5m-Q2LH92mI.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./grouping-RwmXkHDc-Cfuv9DrK.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./signal-CETehA7D-DxK1orqE.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./geojson-CNt_qtQf-utywq02B.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-B0cLE-po.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./sourceUtils-BMeqkJ5g-C2dbTHus.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";let Gr=class{constructor(s){this._client=s,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(s){it(this._eventLog.onEvent(s))}};const ke=1,dt=2,Ce=4,ut=8,ct=16,Te=32,lt=64,Me=128;function je(s){switch(s){case ke:case ut:case Te:return-1;case dt:case lt:return 0;case Ce:case ct:case Me:return 1}}function De(s){switch(s){case ke:case dt:case Ce:return-1;case ut:case ct:return 0;case Te:case lt:case Me:return 1}}const St=ke|ut|Te,Ft=Ce|ct|Me,kt=ke|dt|Ce,Ct=Te|lt|Me;let Nr=class{constructor(s,e,t,r,i=0){this.tileKey=s,this._bufferingEnabled=e,this._sizeHint=i,this._meshes={self:new wt(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=r?1:0;this._copyBufferedDataIntoSelf=t&&this._bufferingEnabled&&s.level===n}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(s){this._meshes.self.indexEnsureSize(s)}entityStart(s,e=s){this._currentEntityOverlaps=0,this._meshes.self.entityStart(s,e)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let s=0;s<8;s++){const e=1<{const n=r.serialize(),a=1<=T-i?St:Ft|St)|(e<0+n?Ct:e>=T-n?kt:Ct|kt));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let s=0;s<8;s++){const e=1<0){const i=this.getBackgroundFill();if(i)return[...i,...r]}return r}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},Br=class cs extends G{static async fromDictionaryRenderer(e,t){return new cs(e,t)}constructor(e,t){super(),this._context=e,this._schema=t,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const r=t.getCursor(),i=[];for(;r.next();)i.push(this._updateMeshWriterGroup(e,r));await Promise.all(i)}match(e,t){const r=e.getAttributeHash();return this._hashToGroup.get(r)}async _updateMeshWriterGroup(e,t){const r=t.readLegacyFeatureForDisplay(),i=t.getAttributeHash();if(this._hashToGroup.has(i))return;this._hashToGroup.set(i,null);const n=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:r});if(!n)return;const a=await this._context.createMeshWriters(n.meshes);this._hashToGroup.set(i,a)}},Vr=class ls extends G{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t){const r=await e.storage.createComputedField(t),i=new ls(r,t.isMaxInclusive);await Promise.all(t.intervals.map(async o=>{const d=await e.createMeshWriters(o.meshes);i.add(o,d)}));const n=await e.createMeshWriters(t.defaultSymbol);i.setDefault(n);const a=await e.createMeshWriters(t.backgroundFill);return i.setBackgroundFill(a),i}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((r,i)=>r.interval.min-i.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){const r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let i=0;i=n.min,d=this._isMaxInclusive?r<=n.max:r{const a=await e.createMeshWriters(n.meshes);return{minScale:n.minScale,maxScale:n.maxScale,meshes:a,expression:null,where:await e.storage.createWhereClause(n.where)}}),i=await Promise.all(r);return new hs(i)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const r=this._getLabels(t.$view.scale),i=[];for(const n of r)n.where&&!n.where(e)||i.push(...n.meshes);return i}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const r=t-t/4,i=t+t/2;return(!e.minScale||e.minScale>=r)&&(!e.maxScale||e.maxScale<=i)}},Xr=class _s extends G{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t){const r=t.expression?[e.storage.createComputedField({expression:t.expression})]:[t.field?e.storage.createComputedField({field:t.field}):null,t.field2?e.storage.createComputedField({field:t.field2}):null,t.field3?e.storage.createComputedField({field:t.field3}):null],i=(await Promise.all(r)).filter(d=>!!d),n=new _s(i,t.fieldDelimiter),a=await e.createMeshWriters(t.defaultSymbol);n.setDefault(a);const o=await e.createMeshWriters(t.backgroundFill);return n.setBackgroundFill(o),await Promise.all(t.map.map(async(d,u)=>{const h=await e.createMeshWriters(d.symbol);d.value===""?n.setNullResult(h):n.add(d.value,h,u+1)})),n}setNullResult(e){this._nullResult=e}getSortKey(e,t){const r=this._getValueFromFields(e,t);if(r==null||r===""||r==="")return 0;const i=this._resultsMap.get(r.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(e,t,r){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:r}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,r+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){const r=this._getValueFromFields(e,t);if(this._nullResult!==null&&(r==null||r===""||r===""))return this._nullResult;if(r==null)return null;const i=r.toString();return this._resultsMap.get(i)?.meshWriters}_getValueFromFields(e,t){const r=[];for(const i of this._fields){const n=i.read(e,t);n==null||n===""?r.push(""):r.push(n)}return r.join(this._separator)}};async function ae(s,e){switch(e.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return G.from(s,e);case"interval":return Vr.fromIntervalSchema(s,e);case"dictionary":return Br.fromDictionaryRenderer(s,e);case"label":return Yr.fromLabelSchema(s,e);case"map":return Xr.fromMatcherSchema(s,e);case"subtype":return Qr.fromSubtypes(s,e);case"cluster":return Zr.fromClusterSchema(s,e);default:throw new Error("Impl")}}let Qr=class ps extends G{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const r=new Map,i=[];for(const n in t.renderers){const a=parseInt(n,10),o=ae(e,t.renderers[n]).then(d=>r.set(a,d));i.push(o)}return await Promise.all(i),new ps(r,t.subtypeField)}match(e,t){const r=e.readAttribute(this._subtypeField),i=this._subMatchers.get(r);return i?i.match(e,t):null}},Zr=class gs extends G{static async fromClusterSchema(e,t){const[r,i]=await Promise.all([ae(e,t.feature),ae(e,t.cluster)]);return new gs(r,i)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},Hr=class fs extends $r{static async create(e,t){const r=await ae(e,t.symbology),i=t.labels?await ae(e,t.labels):null;return new fs(r,i)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,r){const i=this._symbology.match(t,r);if(i){for(const n of i)n.enqueueRequest(e,t,r);if(this._labels){const n=this._labels.match(t,r);if(!n)return;for(const a of n)a.enqueueRequest(e,t,r)}}}write(e,t,r,i,n){const a=this._symbology.match(r,i);if(a){for(const o of a)o.write(e,t,r,i,n);if(e.entityRecordCount()>=1&&this._labels){const o=this._labels.match(r,i);if(!o)return;for(const d of o)d.setReferences(a),d.write(e,t,r,i,n)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},Jr=class{constructor(s,e,t,r){this.storage=s,this.proxy=e,this.viewParams=t,this.registry=r}async createMeshWriters(s){const e=s.map(t=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,t));return Promise.all(e)}},Kr=class{constructor(s){this._outstandingMessages=[],this._queue=new ts({concurrency:s.concurrency,process:e=>s.process(e)})}async push(s){if(s.end)return await Promise.all(this._outstandingMessages),await this._queue.push(s),void(this._outstandingMessages=[]);const e=this._queue.push(s);return this._outstandingMessages.push(e),e}},ys=class $e{static async create(e,t){if(t.statisticType==="count"){const i=new vr(1);return new $e(t.name,t.alias,t.type,t.statisticType,i)}const r=await e.createComputedField({expression:t.onStatisticExpression?.expression,field:t.onStatisticField});return new $e(t.name,t.alias,t.type,t.statisticType,r)}constructor(e,t,r,i,n){this.name=e,this.alias=t,this.type=r,this.statisticType=i,this.computed=n}},ht=class{constructor(s){this.subscription=s,this.handledChunks=new Set}destroy(){}},ms=class{constructor(s,e){this._source=s,this._attributeStore=e,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}onSubscribe(s){const e=this.createState(s);this._sendStates.set(s.key.id,e),this.updateChunks()}onUnsubscribe(s){this._sendStates.get(s.key.id)?.destroy(),this._sendStates.delete(s.key.id)}invalidate(){const s=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of s)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(){}getFeatureObjectIdsForAggregate(s){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(s){return this.displayMap(s,e=>e,e=>e)}getDisplayAndObjectIds(s){return this.displayMap(s,e=>e,(e,t,r)=>[e,r])}beforeUpdateChunks(){}afterUpdateChunks(){}},bs=class extends ms{constructor(s,e,t,r){super(s,e),this.spatialReference=t,this.aggregateFields=r,this.events=new st,this.featureAdapter=Or}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new as({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(s){}forEach(s){return this.forEachAggregateWorldSpace(s)}forEachInBounds(s,e){}forEachBounds(s,e){const t=rt();for(const r of s){const i=Fr(t,r.geometry,!1,!1);i&&e(i)}}},_t=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.clear=t,this.end=r,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"append",clear:this.clear,id:this.id,append:s,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:e,attributeEpoch:t}}},Be=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.remove=t,this.end=r,this.debugInfo=i,this.type="update"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"update",id:this.id,modify:s,debugInfo:this.debugInfo,remove:this.remove,version:e,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:t}}},ei=class ws{static fromReader(e){const t=[],r=e.copy(),i=rt();for(;r.next();)r.getBounds(i)&&t.push(r.getIndex());const n=gr(9,a=>(r.setIndex(a),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return n.load(t),new ws(n)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}};const ti=64;function si(s,e,t,r){const i=[s.xmin,s.ymin,s.xmax,s.ymax],n=dr.fromExtent(ur.fromBounds(i,r)),a=Ie(n,r,P.WGS84,{densificationStep:e*ti});if(!a)return null;const o=ns(new M,a,!1,!1),d=o.coords.filter((y,v)=>!(v%2)),u=o.coords.filter((y,v)=>v%2),h=Math.min(...d),l=Math.min(...u),p=Math.max(...d),g=Math.max(...u),_=Ve(h,l,t,P.WGS84),f=Ve(p,g,t,P.WGS84);return _&&f?{bounds:i,geohashBounds:{xLL:_[0],yLL:_[1],xTR:f[0],yTR:f[1]},level:t}:null}function Ve(s,e,t,r){if(r.isWebMercator){const a=ft(s/yt.radius),o=a-360*Math.floor((a+180)/360),d=[0,0];return Tt(d,0,ft(Math.PI/2-2*Math.atan(Math.exp(-e/yt.radius))),o,t),d}const i=Ie({x:s,y:e},r,P.WGS84);if(!i)return null;const n=[0,0];return Tt(n,0,i.y,i.x,t),n}function ri(s,e){let t=-90,r=90,i=-180,n=180;for(let a=0;a>h,y=(_&s.geohashY)>>l;for(let v=p-1;v>=0;v--){const b=(i+n)/2,F=f&1<=0;v--){const b=(t+r)/2,F=y&1<g?1:0;n|=_<<29-(p+5*l),u=(1-_)*u+_*g,h=(1-_)*g+_*h}for(let p=0;p<5;p++){const g=(o+d)/2,_=t>g?1:0;a|=_<<29-(p+5*l),o=(1-_)*o+_*g,d=(1-_)*g+_*d}}s[2*e]=n,s[2*e+1]=a}let Is=class{constructor(s){this._statistics=s}get statistics(){return this._statistics}};const Mt=Math.PI/180;let vs=class Ye{static create(e){return new Ye(e.map(t=>ii(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const r of this._statistics)r.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function ii(s){switch(s.statisticType){case"min":return new ni(s);case"max":return new ai(s);case"avg":return new di(s);case"avg_angle":return new ui(s);case"sum":case"count":return new oi(s);case"mode":return new ci(s)}}let K=class{constructor(s){this.field=s}insert(s,e){if(!this.field.computed)return;const t=this.field.computed.read(s,e);wr(t)||this._insertValue(t)}},ni=class xs extends K{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new xs(this.field);return e.value=this.value,e}},ai=class Ss extends K{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Ss(this.field);return e.value=this.value,e}},oi=class Fs extends K{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new Fs(this.field);return e.value=this.value,e}},di=class ks extends K{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new ks(this.field);return e._total=this._total,e._count=this._count,e}},ui=class Cs extends K{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,r=180/Math.PI;return Math.atan2(t,e)*r}_insertValue(e){this._x=this._x+Math.cos(e*Mt),this._y=this._y+Math.sin(e*Mt),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Cs(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},ci=class Ts extends K{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[r,i]of this._frequencies.entries())i>t&&(t=i,e=r);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,r]of e._frequencies.entries()){const i=this._frequencies.get(t);i!=null?this._frequencies.set(t,i+r):this._frequencies.set(t,r)}}clone(){const e=new Ts(this.field);return e._frequencies=new Map(this._frequencies),e}},qt=class Xe extends Is{static create(e,t,r,i){const n=vs.create(e),a=new Array(32);for(let o=0;o=r)return this;const o=1-i%2,d=3*o+2*(1-o),u=2*o+3*(1-o),h=30-n-d,l=30-a-u,p=((e&7*o+3*(1-o)<>h)+((t&3*o+7*(1-o)<>l)*(8*o+4*(1-o)),g=this.children[p];return g==null?null:g.find(e,t,r,i+1,n+d,a+u)}_getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),r=Math.floor(e/2),i=30-(3*t+2*r),n=30-(2*t+3*r),a=this.xNode<=a)return;const p=Math.ceil((u+1)/2),g=Math.floor((u+1)/2),_=1-u%2,f=30-(3*p+2*g),y=30-(2*p+3*g),v=(i&7*_+3*(1-_)<>f,b=(n&3*_+7*(1-_)<>y,F=v+b*(8*_+4*(1-_));h=h<<3*_+2*(1-_)|v,l=l<<2*_+3*(1-_)|b,d.children[F]==null&&(d.children[F]=qt.create(this._fields,h,l,u+1),this._depth=Math.max(this._depth,u+1),this._size+=1),u+=1,d=d.children[F]}}putBins(e,t){for(const r of this.getNodes(t)){const i=e.get(r.id);i?i.merge(r):e.set(r.id,r.clone())}}getNodes(e){const t=[],{geohashBounds:r,level:i}=e;let n=this._root;for(;n!==null;){const a=n.depth,o=n.xNode,d=n.yNode;if(a>=i){t.push(n),n=n.next;continue}const u=Math.ceil((a+1)/2),h=Math.floor((a+1)/2),l=1-a%2,p=30-(3*u+2*h),g=30-(2*u+3*h),_=~((1<>p,v=(r.yLL&f)>>g,b=(r.xTR&_)>>p,F=(r.yTR&f)>>g,C=o<<3*l+2*(1-l),x=d<<2*l+3*(1-l),S=C+8*l+4*(1-l),k=x+4*l+8*(1-l),E=Math.max(C,y),L=Math.max(x,v),R=Math.min(S,b),N=Math.min(k,F);let ce=null,Re=null;for(let Ae=L;Ae<=N;Ae++)for(let Pe=E;Pe<=R;Pe++){const Xs=Pe-C+(Ae-x)*(8*l+4*(1-l)),te=n.children[Xs];te&&(ce||(ce=te,ce.next=n.next),Re&&(Re.next=te),Re=te,te.next=n.next)}n=ce||n.next}return t}}let Ms=class{constructor(s){this._options=s}insert(s,e){const t=s.getCursor(),r={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;t.next();)this._insertFeature(t,r,e)}_insertFeature(s,e,t){const{featureFilter:r}=this._options;if(r!==null&&!r.check(s))return;let i=0,n=0;if(s.geometryType==="esriGeometryPoint")i=s.readXWorldSpace(),n=s.readYWorldSpace();else{if(t){const o=s.readCentroidForDisplay();if(o==null)return;const[d,u]=o.coords;if(d<0||d>T||u<0||u>T)return}const a=s.readCentroidWorldSpace();if(a==null)return;i=a.coords[0],n=a.coords[1]}this._insert(s,i,n,e)}},hi=class extends Ms{constructor(s){super(s),this._tree=new li(this._options.fields)}put(s){throw new Error("Geohash tree does not support put")}putBounded(s,e,t){const{geohashLevel:r,spatialReference:i}=this._options,n=si(e,t,r,i);n!=null&&this._tree.putBins(s,n)}_insert(s,e,t,r){const{geohashLevel:i,spatialReference:n}=this._options,a=Ve(e,t,i,n);a&&this._tree.insert(s,e,t,a[0],a[1],i,r)}},Qe=class fe extends Is{static createId(e,t){return`${e}.${t}`}static create(e,t,r,i){return new fe(e,t,vs.create(r),i)}constructor(e,t,r,i){super(r),this.gridX=e,this.gridY=t,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return fe.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new fe(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,r,i){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=i,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:Cr(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:Tr(e,this.centroidYWorld)}getGeometry(e,t){const r=this.gridX*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell,n=new M([4],[r,i,r+this._worldUnitsPerCell,i,r+this._worldUnitsPerCell,i+this._worldUnitsPerCell,r,i+this._worldUnitsPerCell]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPolygon",t)}return n}getCentroid(e){const t=new M([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const r=new M;return Q(r,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e,t){const r=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,n=new M([],[r,i]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPoint",t)}return n}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const _i=96;function Ze(s,e){return rr(s)*ir*_i/e}let pi=class extends Ms{constructor(s){super(s),this._cells=new Map,this._pixelsPerMapUnit=Ze(s.spatialReference,s.scale)}put(s){for(const e of this._cells.values()){const t=s.get(e.id);t?t.merge(e):s.set(e.id,e.clone())}}putBounded(s,e,t){const r=[e.xmin,e.ymin,e.xmax,e.ymax],[i,n,a,o]=r,d=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),u=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(a*this._pixelsPerMapUnit/this._options.cellSize),l=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize);for(let p=u;p<=l;p++)for(let g=d;g<=h;g++){const _=`${g}.${p}`,f=this._cells.get(_);if(!f)continue;const y=s.get(f.id);y?f&&!s.has(f.id)&&y.merge(f):s.set(f.id,f.clone())}}_insert(s,e,t,r){const i=e*this._pixelsPerMapUnit,n=t*this._pixelsPerMapUnit,a=Math.floor(i/this._options.cellSize),o=Math.floor(n/this._options.cellSize);this._getCellOrCreate(a,o).insert(s,r,e,t)}_getCellOrCreate(s,e){const t=Qe.createId(s,e);let r=this._cells.get(t);if(!r){const i=1*this._options.cellSize/this._pixelsPerMapUnit;r=Qe.create(s,e,this._options.fields,i),this._cells.set(t,r)}return r}},gi=class He extends Fe{static from(e,t){return new He(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[l,p]=e.scale,[g,_]=e.translate;return this._displayTranslationX=-g/l,this._displayScaleX=1/l,this._displayTranslationY=_/p,this._displayScaleY=1/-p,void(this._displayTransform=e)}const[r,i]=t.scale,[n,a]=t.translate,[o,d]=e.scale,[u,h]=e.translate;if(this._displayScaleX=r/o,this._displayTranslationX=(n-u)/o,this._displayScaleY=i/d,this._displayTranslationY=(-a+h)/d,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1!(r.objectId!=null&&t.has(r.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new z(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex!t.has(r.objectId))}getTileReader(s){if(!this._features.length)return null;const e=this.queryFeaturesInBounds(s.bounds);return e.setTransformForDisplay(s.transform),e}_onChange(){this.invalidate()}},fi=class extends ht{constructor(s,e){super(s),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=e}reset(){this.destroy(),this.done=!1}invaldateForLocalEditDropped(){this.handledChunks.clear(),this.bins.clear()}destroy(){const s=this.subscription.tile.key.level;for(const e of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${e}.${s}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const s of this.featureCache.values()){const e=s.clone();e.geometry&&kr(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}},yi=class Es extends bs{static async create(e,t,r,i,n){const a=new at({spatialReference:t}),o=await Promise.all(e.fields.map(async u=>ys.create(a,u))),d=e.featureFilter?await es.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return e.index.type==="geohash"&&await Er(t,P.WGS84),new Es(e,d,n,o,t,r,i)}constructor(e,t,r,i,n,a,o){super(a,o,n,i),this._schema=e,this._featureFilter=t,this._timeZone=r,this._metadata=ot.createFeature({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fieldsIndex:new de(e.fields).toJSON(),globalIdField:null,spatialReference:a.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new fi(e,this._attributeStore)}async*applyLocalEdit(e){for(const t of this._sendStates.values())t.reset(),yield new _t(t.subscription,q.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,r){const i=new Map(e.map(a=>[t(a),a])),n=[];for(const a of this._sendStates.values())for(const o of a.featuresWorldSpace()){const{objectId:d,displayId:u}=o,h=i.get(d);if(h!=null){const l=r(u,h,d);n.push(l),i.delete(d)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[];for(const n of this._sendStates.values())for(const a of n.featuresWorldSpace())t.has(a.displayId)&&!r.has(a.objectId)&&(a.geometry&&i.push({...rs(a,this._metadata.geometryType,!1,!1),displayId:a.displayId}),r.add(a.objectId));return{features:[],aggregates:i}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const r of t.bins.values())if(r.id===e)return Array.from(r.containedObjectIds);return[]}beforeUpdateChunks(){const e=this._source.chunks();if(!e.length)return;let t=!1;for(const r of e)qs(r)&&r.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this._lastHandledLocalEdit=r.lastLocalEditDropped,t=!0);if(t)for(const r of this._sendStates.values())r.invaldateForLocalEditDropped()}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const r of this._sendStates.values())for(const i of r.featuresWorldSpace())t.has(i.objectId)||(e(i),t.add(i.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:e.scale};case"grid":{const t=this._schema.index.fixedBinLevel,r=t!=null?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:r}}}}async*_update(e,t){const{handledChunks:r,subscription:i,bins:n,featureCache:a}=e,o=i.tile;if(e.done)return;for(const _ of t.chunks()){if(r.has(_.chunkId))continue;r.add(_.chunkId);const f=_.queryInfo;if("tileId"in f){const y=new nt(f.tileId);if(y.level!==o.level||y.world!==o.key.world)continue}_.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(n,e.tile.extent,e.tile.resolution)}const d=[],u=i.tile.transform,h=i.tile.key.level;for(const _ of n.values()){let f=a.get(_.id);if(f)f.attributes=_.getAttributes();else{const y=_.getGeometry(this.spatialReference,u);f=new Y(y,_.getAttributes(),null),y||(f.centroid=_.getGeometricCentroid(this.spatialReference,u)),f.objectId=_.id,f.displayId=this._attributeStore.createDisplayIdForObjectId(`${f.objectId}.${h}`),a.set(_.id,f)}d.push(f)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=q.fromOptimizedFeatures(d,this._metadata,u),p=l.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._timeZone);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g);yield new Be(e.subscription,l,[],e.done,{})}},mi=class{constructor(s,e){this.inner=s,this.displayId=e}};const _e=128;let bi=class extends ht{constructor(s){super(s),this.didSend=!1,this.done=!1}},wi=class{constructor(s,e,t,r,i){this._level=s,this._scale=e,this._indexOptions=t,this._clusterRadius=r,this._store=i,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const s of this._clusters.values())this._store.releaseDisplayIdForObjectId(s.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const s of this._clusters.values()){const e=s.inner.getCentroid(null),t=new Y(e,s.inner.getAttributes(),null);t.objectId=s.inner.id,t.displayId=s.displayId,yield t}}clusters(){return this._clusters.values()}updateChunks(s,e){let t=!1;for(const a of s){const o=a.queryInfo;"tileId"in o&&new nt(o.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),t=!0,a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells))}const r={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},i=Ze(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of e){const o=a.tile.bounds,d=Math.floor(o[0]*i/n),u=Math.floor(o[1]*i/n),h=Math.ceil(o[2]*i/n),l=Math.ceil(o[3]*i/n);r.xMin=Math.min(r.xMin,d),r.yMin=Math.min(r.yMin,u),r.xMax=Math.max(r.xMax,h),r.yMax=Math.max(r.yMax,l)}return this._lastCellBounds!=null&&r.xMin===this._lastCellBounds.xMin&&r.yMin===this._lastCellBounds.yMin&&r.yMin===this._lastCellBounds.yMin&&r.yMax===this._lastCellBounds.yMax||(t=!0,this._lastCellBounds=r),t&&this._clusterCells(r),t}async updateStatistics(s){let e=!1;for(const t of this._clusters.values())t.inner.count>1&&(e=this._updateAggregateStatistics(this._statistics,t.inner)||e);if(e){const t=Array.from(this._statistics.entries()).map(([r,i])=>({fieldName:r,minValue:i.minValue,maxValue:i.maxValue}));await s.container.updateStatistics(this._level,t)}}createAggregateFeatures(s,e){const t=s.subscription,r=[],i=t.tile.transform;for(const n of this._clusters.values()){let a=n.inner.getCentroidX(i);const o=n.inner.getCentroidY(i),d=t.tile.lod,u=d.wrap?d.worldSize[0]:null,h=n.inner.count===1?n.inner.firstObjectId:n.inner.id,l=n.displayId;if(u!=null)if(u===1){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.geometry.coords[0]-=T,g.objectId=h,g.displayId=l,r.push(g);const _=new M([],[a,o]),f=new Y(_,n.inner.getAttributes(),null);f.geometry.coords[0]+=T,f.objectId=h,f.displayId=l,r.push(f)}else a>T+T/2?a-=u*T:a<-T/2&&(a+=u*T);if(a=-_e&&o=-_e){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.objectId=h,g.displayId=l,r.push(g)}}return q.fromOptimizedFeatures(r,e,t.tile.transform)}_clusterCells(s){let e=Array.from(this._cells.values());e=e.sort((a,o)=>o.count-a.count);const t=[];for(const a of this._clusters.values())t.push(a.inner.id);this._clusters.clear();const r=this._clusterRadius*(1/Ze(this._indexOptions.spatialReference,this._scale)),i=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const a of e){if(n.has(a.id)||a.gridXs.xMax||a.gridYs.yMax)continue;const o=this._store.createDisplayIdForObjectId(a.id),d=new mi(a.clone(),o);n.add(a.id),this._clusters.set(a.id,d);const u=a.centroidXWorld,h=a.centroidYWorld;for(let l=a.gridY-i;l<=a.gridY+i;l++)for(let p=a.gridX-i;p<=a.gridX+i;p++){if(l===a.gridY&&p===a.gridX)continue;const g=this._cells.get(Qe.createId(p,l));if(!g||n.has(g.id))continue;const _=Math.abs(g.centroidXWorld-u),f=Math.abs(g.centroidYWorld-h);_ys.create(o,u))),spatialReference:r,featureFilter:t.featureFilter?await es.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:r,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:a};return new Os(e,t.clusterRadius,d,t.fields,i,n)}constructor(e,t,r,i,n,a){super(n,a,r.spatialReference,r.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=r,this._cellsPerScale=new Map,this._metadata=ot.createFeature({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fieldsIndex:new de([...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new bi(e)}async*applyLocalEdit(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,r){const i=new Map(e.map(o=>[t(o),o])),n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.clusters()){const d=i.get(o.inner.id);if(d==null){if(o.inner.count===1){const u=i.get(o.inner.firstObjectId);if(u!=null){const h=r(o.displayId,u,o.inner.firstObjectId);n.push(h),i.delete(o.inner.firstObjectId)}}}else{const u=r(o.displayId,d,o.inner.id);n.push(u),i.delete(o.inner.id)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.aggregatesWorldSpace())if(t.has(o.displayId)&&!r.has(o.displayId)){const d=rs(o,this._metadata.geometryType,!1,!1);if(r.add(o.displayId),d.attributes.cluster_count===1){i.push({...d,displayId:o.displayId});continue}n.push({...d,displayId:o.displayId})}return{features:i,aggregates:n}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.clusters())if(r.inner.id===e)return Array.from(r.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;for(const a of e)qs(a)&&a.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this.invalidate(),this._lastHandledLocalEdit=a.lastLocalEditDropped);const t=this._getClusterState(this._requiredLevel,this._requiredScale),r=Array.from(this._sendStates.values()).filter(a=>a.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,r)||!this._source.updateTracking.updating)for(const a of r)a.subscription.tile.level===this._requiredLevel&&(a.didSend=!1,a.done=!1);const i=Array.from(this._sendStates.values()).filter(a=>a.done).map(a=>a.subscription.tile.key),n=new Set(i);for(const a of this._sendStates.values())this._source.updateTracking.updating&&(i.some(o=>o.containsChild(a.subscription.tile.key))||a.subscription.tile.key.getChildKeys().every(o=>n.has(o)))||a.didSend||a.subscription.tile.level!==this._requiredLevel||(a.didSend=!0,yield*this._update(a,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.aggregatesWorldSpace())e(r)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let r=this._cellsPerScale.get(t);return r||(r=new wi(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,r)),r}async*_update(e,t,r){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!r.updateTracking.updating;const n=i.getCursor(),a=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;n.next();)this._attributeStore.setAttributeData(n.getDisplayId(),n,a);yield new _t(e.subscription,i,!0,e.done,{})}},vi=class extends ht{},xi=class extends ms{constructor(s,e,t){super(s,e),this._timeZone=t,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const s of this._source.chunks())this._cleanupChunkIds(s)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(s){super.onSubscribe(s),this._evalOptions=s.tile.createArcadeEvaluationOptions(this._timeZone)}createState(s){return new vi(s)}get aggregateQueryEngine(){return null}displayMap(s,e,t){const r=new Map(s.map(n=>[e(n),n])),i=[];for(const n of this._source.chunks()){const a=n.reader.getCursor();for(;a.next();){const o=a.getObjectId(),d=a.getDisplayId(),u=r.get(o);if(u!=null){const h=t(d,u,o);i.push(h),r.delete(o)}}}return i}getDisplayFeatures(s){const e=new Set(s),t=new Set,r=[];for(const i of this._source.chunks()){const n=i.reader.getCursor();for(;n.next();){const a=n.getObjectId(),o=n.getDisplayId();e.has(o)&&!t.has(a)&&(r.push({...n.readLegacyFeatureWorldSpace(),displayId:o}),t.add(a))}}return{features:r,aggregates:[]}}async*applyLocalEdit(s){const e=[],t=s.reader.getCursor();for(;t.next();){const n=t.getObjectId(),a=this._attributeStore.createDisplayIdForObjectId(n);t.setDisplayId(a),this._attributeStore.setAttributeData(a,t,this._evalOptions),e.push(a)}const r=[];for(const n of s.removed){const a=this._attributeStore.getDisplayIdForObjectId(n);a!=null&&r.push(a)}w("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:s,modifiedDisplayIds:e,removedDisplayIds:r});const i=new Je(this._source.metadata,"localEdit");i.applyOverrides(s),this.handledChunks.add(i.chunkId),this.handledChunksForAttributeData.add(i.chunkId),this.handledChunksForIdCreation.add(i.chunkId);for(const n of this._sendStates.values())n.handledChunks.add(i.chunkId),yield new Be(n.subscription,null,e,!1,i.queryInfo);for(const n of this._sendStates.values()){const a=i.getTileReader(n.subscription.tile);yield new Be(n.subscription,a,r,!1,i.queryInfo)}for(const n of s.removed)this._attributeStore.releaseDisplayIdForObjectId(n)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const s of this._sendStates.values())yield*this._update(s)}}removeChunks(s){for(const e of s)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const s of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(s);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(s){if(this.handledChunksForIdCreation.has(s.chunkId)){const e=s.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(s.chunkId)}}async _updateAttributeData(){for(const s of this._source.chunks()){const{chunkId:e,reader:t}=s;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const r=t.getCursor();for(;r.next();){const i=this._attributeStore.createDisplayIdForObjectId(r.getObjectId());r.setDisplayId(i)}}}for(const s of this._source.chunks())if(!this.handledChunksForAttributeData.has(s.chunkId)){this.handledChunksForAttributeData.add(s.chunkId);const e=s.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions)}}}*_update(s){const{subscription:e,handledChunks:t}=s;for(const r of this._source.chunks()){const{chunkId:i}=r;if(t.has(i))continue;t.add(i);const n=r.getTileReader(e.tile);n&&(yield new _t(s.subscription,n,!1,r.end,r.queryInfo))}}},Si=class{constructor(s,e){this._connection=s,this._source=e,this._version=1,this._registry=new Ir,this._proxy=new fr({fetch:(t,r)=>this._connection.layerView.fetch(t,r),fetchDictionary:(t,r)=>this._connection.layerView.fetchDictionary(t,r)}),this._attributeStore=new yr({isLocal:!1,update:t=>it(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(s){return this._strategy?this._strategy.getDisplayFeatures(s):{features:[],aggregates:[]}}getDisplayIds(s){const e={};return this._strategy&&this._strategy.displayMap(s,t=>t,(t,r,i)=>{e[i]=t}),e}getFeatureObjectIdsForAggregate(s){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(s):[]}onSubscribe(s){this._strategy?.onSubscribe(s)}onUnsubscribe(s){this._strategy?.onUnsubscribe(s)}async update(s,e,t,r,i){const n=s.processor,a=le(this._schema?.storage,n.storage),o=le(this._schema?.mesh.properties,n.mesh.properties),d=le(this._schema?.mesh.factory,n.mesh.factory),u=le(this._schema?.mesh.strategy,n.mesh.strategy),h=o||d||u;if(!(a||h)&&!r)return;w("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:Kt(this._schema,n),schema:n}),this._schema=n;const l=P.fromJSON(this._source.service.outSpatialReference),p=new at({fields:this._source.metadata.fieldsIndex,spatialReference:l});if(await this._attributeStore.update(n.storage,p,this._source.metadata,l,e),this._strategy?.invalidateAttributeData(),!r&&!h)return;(u||o)&&await this._updateStrategy(n.mesh.strategy,l,i,n.mesh.properties.timeZone),this._updateSortKey(p,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const g=new Jr(p,this._proxy,t,this._registry);return(d||n.mesh.factory.symbology.type==="dictionary")&&(this._factory=await Hr.create(g,n.mesh.factory)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)}async applyLocalEdit(s){if(!this._strategy)return;const e=this._strategy.applyLocalEdit(s);for await(const t of e)try{await this._process(t)}catch{}}async updateChunks(){this._strategy?.beforeUpdateChunks(),await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(s){this._strategy?.removeChunks(s),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:s}){if(!this._strategy)return void this._attributeStore.setHighlight(s.map(({objectId:t,highlightFlags:r})=>({objectId:t,highlightFlags:r,displayId:-1})),s);const e=this._strategy.displayMap(s,({objectId:t})=>t,(t,{highlightFlags:r},i)=>({objectId:i,displayId:t,highlightFlags:r}));this._attributeStore.setHighlight(e,s)}async _doUpdateChunks(){if(!this._strategy)return;const s=this._strategy.updateChunks(),e=[],t=new Map;for await(const r of s){let i=t.get(r.id);i==null&&(i=new Kr({concurrency:16,process:a=>this._process(a)}),t.set(r.id,i));const n=i.push(r).catch(a=>et(a));e.push(n)}try{await Promise.all(e)}catch{}w("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(s,e,t,r){switch(this._strategy?.destroy(),s.type){case"feature":this._strategy=new xi(this._source,this._attributeStore,r);break;case"binning":this._strategy=await yi.create(s,e,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await Ii.create(this._connection,s,e,this._source,this._attributeStore,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(s,e){if(this._sortInfo=Zt(this._sortInfo?.computed),e!=null){const t=e.byRenderer?null:await s.createComputedField(e);this._sortInfo={...e,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(s){const e=s.subscription;if(w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process`)}await this._fetchResources(s),Z(e.signal);const t=await this._write(s,e.tile.createArcadeEvaluationOptions(this._schema?.mesh.properties.timeZone)),r=e.tile.tileInfoView.getLODInfoAt(e.tile.key),{message:i,transferList:n}=t.serialize(r),a={objectIdMap:null,inner:s.createMessage(i,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){a.objectIdMap={};const o=s.reader?.getCursor();if(o)for(;o.next();)a.objectIdMap[o.getDisplayId()]=o.getObjectId()}if(Z(e.signal),await this._connection.container.onMessage(a,{signal:e.signal,transferList:n}),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process.await`)}}async _fetchResources(s){await this._fetchMatcherResources(s),await this._fetchWriterResources(s)}async _fetchMatcherResources(s){if(s.reader)return this._factory.enqueueMatcherRequests(this._proxy,s.reader)}async _fetchWriterResources(s){if(!s.reader)return;const e=s.reader.getCursor(),t=s.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;e.next();)this._factory.enqueueWriterRequests(this._proxy,e,t);await this._proxy.fetchEnqueuedResources()}async _write(s,e){const t=s.subscription.tile,r=s.reader?.getCursor(),i=r?.getSize()??0,n=t.tileInfoView.tileInfo.isWrappable,a=t.tileInfoView.tileInfo.spatialReference.isWGS84,o=new Nr(t.key,this._strategy.enablePixelBuffering,n,a,i);if(!r)return o;const d=t.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;r.next();){const u=this._getSortKeyValue(r,e);o.entityStart(r.getDisplayId(),u),this._factory.write(o,this._proxy,r,d,t.level),o.entityEnd()}return o}_getSortKeyValue(s,e){if(!this._sortInfo)return 0;const{computed:t,order:r,byRenderer:i}=this._sortInfo,n=i?this._factory.getSortKey(s,e):t?.read(s,e);return n==null||isNaN(n)?0:n*(r==="asc"?-1:1)}},Fi=class Rs{static from(e){let t=0,r=0,i=0;return e.forEach(n=>{const a=n._readGeometry();a&&(r+=a.isPoint?1:a.lengths.reduce((o,d)=>o+d,0),i+=a.isPoint?1:a.lengths.length,t+=1)}),new Rs(t,r,i)}constructor(e,t,r){this.featureCount=e,this.vertexCount=t,this.ringCount=r}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const Le=4;function ki(s,e,t){const r=s.orderByFields??t.objectIdField+" ASC",i=s.source,n={returnCentroid:!(i!==null&&typeof i=="object"&&"path"in i&&Pr(i.path))&&t.serviceGeometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:t.timeReferenceUnknownClient??void 0,outSpatialReference:P.fromJSON(s.outSpatialReference),orderByFields:s.type==="memory"?[]:[r],where:e.mutable.dataFilter.definitionExpression??"1=1",outFields:e.mutable.availableFields,multipatchOption:t.serviceGeometryType==="esriGeometryMultiPatch"?"xyFootprint":null};if(e.type==="feature"){const{gdbVersion:a,historicMoment:o,timeExtent:d}=e.mutable.dataFilter;return{...n,gdbVersion:a,historicMoment:o?new Date(o):null,timeExtent:d?jr.fromJSON(d):null,outFields:e.mutable.availableFields}}return n}let Ci=class As{static fromSchema(e,t,r){const i=t.type==="feature"?t.mutable.dataFilter.queryScaleRanges:[];return new As(ki(e,t,r),i,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,i,n,a){this._queryParams=e,this._queryScaleRanges=t,this._subtypeField=r,this._customParameters=i,this._geometryType=n,this._queryMetadata=a}get pageSize(){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?Le:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){if(!t.getSize())return null;const r=e.clone();if(this._queryParams.outFields[0]==="*"){if((r.outFields??[])[0]==="*")return null;r.outFields=this._queryParams.outFields}else{const i=new Set(this._queryParams.outFields),n=[];for(const a of i)t.hasField(a)||n.push(a);if(n.length===0)return null;r.outFields=n}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new os({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),i=r.inner;if(this._queryScaleRanges.length){const n=this._queryScaleRanges.filter(a=>(!a.minScale||a.minScale>=e.maxScale)&&(!a.maxScale||a.maxScale<=e.minScale)).map(a=>a.subtypeCode);if(n.length){const a=`${this._subtypeField} IN (${n})`;i.where=Js(i.where,a)}}if(i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._queryMetadata.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset=e.resolution*w("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(i.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset*=w("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=Le),w("esri-tiles-debug")){const n=e.id.replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,tileId:n}:{tileId:n}}return r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:Le})}};const Ti=2500;let ye=class extends Ht{constructor(s){super(),this._connection=s,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this._queuedCommands=[],this.addHandles([Ne(()=>this._strategy?.connectionStatus??"disconnected",e=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:e})},{initial:!0}),Ne(()=>this._strategy?.errorString||null,e=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:e}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(s){this._strategy==null&&this._resetUpdateInfo(performance.now());const e="event-handles";this.removeHandles(e),s!=null&&(this.addHandles([s.events.on("data-received",t=>this._onFeature(t)),s.events.on("message-received",t=>this._onWebSocketMessage(t)),s.events.on("features-updated",t=>this._onUpdate(t)),s.events.on("tick",()=>this._onTick())],e),this._queuedCommands.forEach(t=>t(s)),this._queuedCommands=[]),this._strategy=s}updateCustomParameters(s){s!=null&&this._callOrEnqueue(e=>e.updateCustomParameters(s))}sendMessageToSocket(s){this._callOrEnqueue(e=>e.sendMessageToSocket(s))}sendMessageToClient(s){this._callOrEnqueue(e=>e.sendMessageToClient(s))}enableEvent(s,e){e?this._enabledEventTypes.add(s):this._enabledEventTypes.delete(s)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(s){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:s})}_onFeature(s){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:s.attributes,centroid:s.centroid,geometry:s.geometry}})}_onUpdate(s){this._updateInfo.client+=s}_onTick(){const s=performance.now(),e=s-this._lastTime;if(e>Ti){const t=Math.round(this._updateInfo.client/(e/1e3)),r=Math.round(this._updateInfo.websocket/(e/1e3));this._resetUpdateInfo(s),this._layerView.emitEvent({name:"update-rate",event:{client:t,websocket:r}})}}_resetUpdateInfo(s){this._lastTime=s,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(s){this._strategy!=null?s(this._strategy):this._queuedCommands.push(s)}};V([ge()],ye.prototype,"_strategy",void 0),ye=V([Xt("esri.views.2d.layers.features.sources.StreamMessenger")],ye);let pt=class{constructor(s){this._store=s,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(s){throw new Error("InternalError: LoadStrategy does not support query info")}async queryOverride(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async queryByObjectId(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(s){throw new Error("InternalError: LoadStrategy does not support loading blobs")}};const ze=268435455;let Mi=class{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}};function qi(s,e,t=!1){const r=s.asUnsafe(),i=r.pos(),n=new Mi;let a=0,o=0;const d=1,u=2,h=4,l=3;let p=null,g=null,_=null,f=!1;const y=[];for(;r.next();)switch(r.tag()){case 1:p=r.getString();break;case 3:g=r.getString();break;case 12:_=r.processMessage(zr);break;case 9:if(n.exceededTransferLimit=r.getBool(),n.exceededTransferLimit){n.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),n.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let b=0;b0:!1}let ji=class Ke extends Fe{static fromBuffer(e,t,r=!1){const i=t.geometryType,n=Oi(e),a=qi(n,i==="esriGeometryPoint",r);return new Ke(n,a,t)}constructor(e,t,r){super(r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Ke(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexu.length)for(let y=0;y=y?(h+=-.5*(R-C)*(N+x),b>1&&Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k):(u[d++]=S,u[d++]=k,b++),C=R,x=N):(E+=S,L+=k),S=E,k=L,v++}b<3||F?d-=2*b:(h+=-.5*(C+S-C)*(x+k+x),Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k,a.push(b)):(u[d++]=S,u[d++]=k,a.push(++b)))}else{let y=0,v=t.getSInt32(),b=t.getSInt32();this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32(),u[d++]=v,u[d++]=b,y+=1;for(let F=1;F2&&Ue(g,u[d-2],u[d-1],C,x)?(u[d-2]+=C,u[d-1]+=x):(u[d++]=C,u[d++]=x,y+=1),v=S,b=k}a.push(y)}break}default:t.skip()}return this._cache.area=h,a.length?new M(a,u):u!=null?this._createQuantizedExtrudedGeometry(u[0],u[1]):null}},qe=class{constructor(s,e){this.service=s,this._metadata=e}destroy(){}};function Di(s,e){switch(s.type){case"memory":return new zi(s,e);case"ogc":return new Gi(s,e);case"feature-service":return s.queryMetadata.supportsFormatPBF&&w("featurelayer-pbf")?new Ui(s,e):new Wi(s,e)}}async function Li(s){const e=new lr;return await e.open(s,{}),e}let zi=class extends qe{constructor(s,e){super(s,e),this._portsOpen=Li(s.source).then(t=>this.client=t)}destroy(){this.client.close(),this.client=null}async executeQuery(s,e){await this._portsOpen;const t=await this.client.invoke("queryFeatures",s.toJSON(),e);return q.fromFeatureSet(t,this._metadata)}},Ui=class extends qe{async executeQuery(s,e){const{data:t}=await Ar(this.service.source,s,e),r=!s.quantizationParameters;return ji.fromBuffer(t,this._metadata,r)}},Wi=class extends qe{async executeQuery(s,e){const{source:t,queryMetadata:r}=this.service;if(s.quantizationParameters!=null&&!r.supportsQuantization){const n=s.clone(),a=ds(n.quantizationParameters);n.quantizationParameters=null;const{data:o}=await It(t,n,this._metadata.spatialReference,e),d=ss(o,this._metadata.objectIdField);return is(a,d),q.fromOptimizedFeatureSet(d,this._metadata)}const{data:i}=await It(t,s,this._metadata.spatialReference,e);return this._metadata.geometryType==="esriGeometryPoint"&&(i.features=i.features?.filter(n=>{if(n.geometry!=null){const a=n.geometry;return Number.isFinite(a.x)&&Number.isFinite(a.y)}return!0})),q.fromFeatureSet(i,this._metadata)}},Gi=class extends qe{async executeQuery(s,e){if(s.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=s.clone(),i=ds(r.quantizationParameters);r.quantizationParameters=null;const n=await vt(this.service.source,s,e);return is(i,n),q.fromOptimizedFeatureSet(n,this._metadata)}const t=await vt(this.service.source,s,e);return q.fromOptimizedFeatureSet(t,this._metadata)}},Ps=class extends pt{constructor(s,e,t,r,i){super(t),this._serviceInfo=s,this._queryInfo=e,this._metadata=r,this._connection=i,this._queue=new ts({concurrency:16,process:async n=>{const a={signal:n.options?.signal,query:n.query.customParameters};return this._adapter.executeQuery(n.query.inner,a)}}),this._adapter=Di(s,r)}unsafeSetQueryHistoricMoment(s){this._queryInfo.updateHistoricMoment(s)}async updateFields(s){this._queryInfo.updateFields(s);const e=Array.from(this._store.chunks()).map(async r=>{const i=os.fromJSON(r.queryInfo.queryJSON);if(i)try{return await this._tryUpdateFields(r.reader,i),null}catch(n){return n}}),t=(await Promise.all(e)).filter(r=>r);if(t.length)throw new W("featurelayer-query","Encountered errors when downloading fields",{errors:t})}async queryByObjectId(s){if(s.length===0)return q.empty(this._metadata);const e=this._queryInfo.createQuery({objectIds:s});return this._fetch(e)}async _fetch(s,e){const t=await this._enqueue(s,e);return await this._tryUpdateFields(t,s.inner),t}async _tryUpdateFields(s,e){const t=this._queryInfo.createPatchFieldsQuery(e,s);if(!t)return;const r=await this._enqueue(t,this._options);s.joinAttributes(r)}async _enqueue(s,e){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:s,options:e}).finally(()=>{this._connection.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},js=class extends Ps{constructor(){super(...arguments),this._chunksById=new Map}unload(s){this._removeChunks(s.tile)}_addChunk(s){const e=s.tile.id;this._chunksById.has(e)||this._chunksById.set(e,[]);const t=s.size();(t||s.first||s.end)&&(w("esri-2d-update-debug")&&console.debug(`Chunk[${s.chunkId}] ATileLoadStrategy.addChunk [count=${t}]`),this._chunksById.get(e).push(s),this._store.insert(s))}_removeChunks(s){const e=this._chunksById.get(s.key.id)??[];for(const t of e)w("esri-2d-update-debug")&&console.debug(`Tile[${s.key.id}] Chunk[${t.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(t);this._chunksById.delete(s.key.id)}},Pt=class extends ue{constructor(s,e,t,r,i,n){super(),this._reader=s,this._queryJSON=e,this._tile=t,this._sourceTile=r,this._sourceTileDepth=i,this._end=n,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(s){return this._tile.key.id===s.key.id?this.reader:null}},Ni=class{constructor(s,e){this.subscription=s,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=Se([we(s.signal,()=>this._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(s){return this._tileIdToResult.get(s)}set(s,e){this._tileIdToResult.set(s,e)}get options(){return{signal:this._controller.signal}}},$i=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Ni(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{for await(const i of this._fetchChunkInfos(e,s.tile,0)){const{queryJSON:n,reader:a,sourceTile:o,sourceTileDepth:d,tile:u}=i,h=new Pt(a,n,u,o,d,!1);Z(e.options),this._addChunk(h)}}catch(i){t=i}const r=new Pt(q.empty(this._metadata),null,s.tile,null,-1,!0);if(this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async*_fetchChunkInfos(s,e,t){let r=s.get(e.id);const i=!!r;if(r||(r=await this._fetchChunkInfo(s,e,t),s.set(e.id,r)),r.reader.exceededTransferLimit&&tthis._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let s=-1;for(const e of this._pages.values())s=Math.max(s,e);return s+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(s,e){this._pages.add(s),this._done=this._done||e}},Vi=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Bi(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{await this._fetchPages(e)}catch(i){t=i}const r=new jt(q.empty(this._metadata),null,s.tile,-1,!0);if(Ks(e.options)||this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async _fetchPages(s){let e=0,t=s.pageStart,r=1;for(;e<20&&!s.done;){const i=[];for(let a=0;a{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Ds.decode();let se=null;function me(){return se!==null&&se.byteLength!==0||(se=new Uint8Array(c.memory.buffer)),se}function X(s,e){return s>>>=0,Ds.decode(me().subarray(s,s+e))}const Dt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{c.__wbindgen_export_0.get(s.dtor)(s.a,s.b)});function Xi(s,e,t,r){const i={a:s,b:e,cnt:1,dtor:t},n=(...a)=>{i.cnt++;const o=i.a;i.a=0;try{return r(o,i.b,...a)}finally{--i.cnt==0?(c.__wbindgen_export_0.get(i.dtor)(o,i.b),Dt.unregister(i)):i.a=o}};return n.original=i,Dt.register(n,i,i),n}function Qi(s,e,t){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7be72b1871260ae2(s,e,m(t))}function Zi(){c.enableTracing()}let O=0;const be=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hi=typeof be.encodeInto=="function"?function(s,e){return be.encodeInto(s,e)}:function(s,e){const t=be.encode(s);return e.set(t),{read:s.length,written:t.length}};function oe(s,e,t){if(t===void 0){const o=be.encode(s),d=e(o.length,1)>>>0;return me().subarray(d,d+o.length).set(o),O=o.length,d}let r=s.length,i=e(r,1)>>>0;const n=me();let a=0;for(;a127)break;n[i+a]=o}if(a!==r){a!==0&&(s=s.slice(a)),i=t(i,r,r=a+3*s.length,1)>>>0;const o=me().subarray(i+a,i+r);a+=Hi(s,o).written,i=t(i,r,a,1)>>>0}return O=a,i}let U=null;function H(){return(U===null||U.buffer.detached===!0||U.buffer.detached===void 0&&U.buffer!==c.memory.buffer)&&(U=new DataView(c.memory.buffer)),U}function j(s,e){try{return s.apply(this,e)}catch(t){c.__wbindgen_exn_store(m(t))}}function Ji(s,e,t,r){c.wasm_bindgen__convert__closures__invoke2_mut__h35729c14da098d24(s,e,m(t),m(r))}let re=null;function Ki(){return re!==null&&re.byteLength!==0||(re=new Uint16Array(c.memory.buffer)),re}function Lt(s,e){const t=e(2*s.length,2)>>>0;return Ki().set(s,t/2),O=s.length,t}function Ls(s,e,t){const r=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;return D(c.readMetadata(r,i,m(e),m(t)))}function zt(s,e){if(!(s instanceof e))throw new Error(`expected instance of ${e.name}`);return s.ptr}function en(s,e,t,r,i){const n=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;zt(r,ee);var o=r.__destroy_into_raw();zt(i,J);var d=i.__destroy_into_raw();return D(c.readFile(n,a,m(e),m(t),o,d))}function We(s){return s==null}const Ut=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_fieldmetadata_free(s>>>0,1));class Ee{static __wrap(e){e>>>=0;const t=Object.create(Ee.prototype);return t.__wbg_ptr=e,Ut.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Ut.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const n=c.__wbindgen_add_to_stack_pointer(-16);c.fieldmetadata_name(n,this.__wbg_ptr);var r=H().getInt32(n+0,!0),i=H().getInt32(n+4,!0);return e=r,t=i,X(r,i)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(e,t,1)}}get index(){return c.fieldmetadata_index(this.__wbg_ptr)}get type(){return["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"][c.fieldmetadata_esri_type(this.__wbg_ptr)]}}const Wt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_filemetadata_free(s>>>0,1));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Wt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_filemetadata_free(e,0)}version(){return c.filemetadata_version(this.__wbg_ptr)}numRows(){return c.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return c.filemetadata_numFields(this.__wbg_ptr)>>>0}keyValueMetadata(e){try{const i=c.__wbindgen_add_to_stack_pointer(-16),n=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;c.filemetadata_keyValueMetadata(i,this.__wbg_ptr,n,a);var t=H().getInt32(i+0,!0),r=H().getInt32(i+4,!0);let o;return t!==0&&(o=X(t,r).slice(),c.__wbindgen_free(t,1*r,1)),o}finally{c.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),r=O,i=c.filemetadata_getFieldIndex(this.__wbg_ptr,t,r);return i===16777215?void 0:i}getFieldByIndex(e){const t=c.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return t===0?void 0:Ee.__wrap(t)}}const Gt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_geometryinfodescriptor_free(s>>>0,1));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,Gt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Gt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_geometryinfodescriptor_free(e,0)}get wkbIndex(){const e=c.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return e===16777215?void 0:e}set wkbIndex(e){c.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,We(e)?16777215:e)}get lngIndex(){const e=c.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return e===16777215?void 0:e}set lngIndex(e){c.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,We(e)?16777215:e)}get latIndex(){const e=c.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return e===16777215?void 0:e}set latIndex(e){c.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,We(e)?16777215:e)}static new(){const e=c.geometryinfodescriptor_new();return J.__wrap(e)}}const Nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetchunk_free(s>>>0,1));class Oe{static __wrap(e){e>>>=0;const t=Object.create(Oe.prototype);return t.__wbg_ptr=e,Nt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Nt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetchunk_free(e,0)}size(){return c.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return c.parquetchunk_hasField(this.__wbg_ptr,e)!==0}readX(e){return c.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return c.parquetchunk_readY(this.__wbg_ptr,e)}readAttributes(e){return D(c.parquetchunk_readAttributes(this.__wbg_ptr,e))}readAttribute(e,t){return D(c.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const $t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetfile_free(s>>>0,1));let zs=class Us{static __wrap(e){e>>>=0;const t=Object.create(Us.prototype);return t.__wbg_ptr=e,$t.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$t.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetfile_free(e,0)}metadata(){const e=c.parquetfile_metadata(this.__wbg_ptr);return ee.__wrap(e)}readChunksWithCallback(e,t){const r=Lt(e,c.__wbindgen_malloc),i=O;return D(c.parquetfile_readChunksWithCallback(this.__wbg_ptr,r,i,m(t)))}updateChunks(e){const t=Lt(e,c.__wbindgen_malloc),r=O;return D(c.parquetfile_updateChunks(this.__wbg_ptr,t,r))}};const Bt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_rangeproviderjs_free(s>>>0,1));class ne{static __wrap(e){e>>>=0;const t=Object.create(ne.prototype);return t.__wbg_ptr=e,Bt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Bt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const r=c.rangeproviderjs_new(m(e),m(t));return ne.__wrap(r)}static withFetch(){const e=c.rangeproviderjs_withFetch();return ne.__wrap(e)}}async function tn(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(r){if(s.headers.get("Content-Type")=="application/wasm")throw r;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",r)}const t=await s.arrayBuffer();return await WebAssembly.instantiate(t,e)}{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function Ws(){const s={wbg:{}};return s.wbg.__wbg_new_abda76e883ba8a5f=function(){return m(new Error)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const r=oe(I(t).stack,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;H().setInt32(e+4,i,!0),H().setInt32(e+0,r,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let r,i;try{r=e,i=t,console.error(X(e,t))}finally{c.__wbindgen_free(r,i,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){D(e)},s.wbg.__wbindgen_is_function=function(e){return typeof I(e)=="function"},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return j(function(){return m(self.self)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return j(function(){return m(window.window)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return j(function(){return m(globalThis.globalThis)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return j(function(){return m(global.global)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return I(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return m(new Function(X(e,t)))},s.wbg.__wbindgen_object_clone_ref=function(e){return m(I(e))},s.wbg.__wbindgen_number_new=function(e){return m(e)},s.wbg.__wbg_new_525245e2b9901204=function(){return m(new Object)},s.wbg.__wbindgen_string_new=function(e,t){return m(X(e,t))},s.wbg.__wbg_call_1084a111329e68ce=function(){return j(function(e,t){return m(I(e).call(I(t)))},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return j(function(e,t,r){return m(I(e).call(I(t),I(r)))},arguments)},s.wbg.__wbg_call_7de908392845a9a5=function(){return j(function(e,t,r,i,n){return m(I(e).call(I(t),I(r),I(i),I(n)))},arguments)},s.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return I(e).valueOf()},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return j(function(e,t,r){return Reflect.set(I(e),I(t),I(r))},arguments)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return m(I(e).buffer)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var r={a:e,b:t},i=(n,a)=>{const o=r.a;r.a=0;try{return Ji(o,r.b,n,a)}finally{r.a=o}};return m(new Promise(i))}finally{r.a=r.b=0}},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){return m(Promise.resolve(I(e)))},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return m(I(e).then(I(t)))},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,r){return m(I(e).then(I(t),I(r)))},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){return m(new Uint8Array(I(e)))},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return I(e).length},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,r){I(e).set(I(t),r>>>0)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(X(e,t))},s.wbg.__wbindgen_memory=function(){return m(c.memory)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return m(I(e).queueMicrotask)},s.wbg.__wbindgen_cb_drop=function(e){const t=D(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(I(e))},s.wbg.__wbg_parquetchunk_new=function(e){return m(Oe.__wrap(e))},s.wbg.__wbindgen_bigint_from_i64=function(e){return m(e)},s.wbg.__wbg_parquetfile_new=function(e){return m(zs.__wrap(e))},s.wbg.__wbg_filemetadata_new=function(e){return m(ee.__wrap(e))},s.wbg.__wbindgen_closure_wrapper1401=function(e,t,r){return m(Xi(e,t,74,Qi))},s}function Gs(s,e){return c=s.exports,Ns.__wbindgen_wasm_module=e,U=null,re=null,se=null,c}function sn(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module:s}=s:console.warn("using deprecated parameters for `initSync()`; pass a single object instead");const e=Ws();return s instanceof WebAssembly.Module||(s=new WebAssembly.Module(s)),Gs(new WebAssembly.Instance(s,e),s)}async function Ns(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead");const e=Ws();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:r}=await tn(await s,e);return Gs(t,r)}const rn=Object.freeze(Object.defineProperty({__proto__:null,FieldMetadata:Ee,FileMetadata:ee,GeometryInfoDescriptor:J,ParquetChunk:Oe,ParquetFile:zs,RangeProviderJs:ne,default:Ns,enableTracing:Zi,initSync:sn,readFile:en,readMetadata:Ls},Symbol.toStringTag,{value:"Module"}));let Ge=null;async function $s(){return Ge||(Ge=nn()),Ge}async function nn(){const s=await Promise.resolve().then(()=>rn);return await s.default({module_or_path:nr("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),s.enableTracing(),s}const Bs=s=>async function(e,t,r){const i=s(),{data:n}=await tt(e,{responseType:"array-buffer",query:i,headers:{range:`bytes=${t}-${r}`}});return n},Vs=s=>async function(e){const t=s(),{data:r}=await tt(e,{responseType:"native",method:"head",query:t}),i=r.headers.get("Content-Length");if(i==null)throw new Error("Unable to parse content length");return parseInt(i,10)};class ve{static async create(e,t){const r=await $s(),i=await r.readMetadata(e,Bs(t),Vs(t));return ve.fromFileMetadata(i)}static fromFileMetadata(e){const t=[];for(let r=0;r65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return"esriGeometryPoint"}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._objectIdFieldIndex!=null?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(;++this._index{const n=Array.from(r).map(a=>i.metadata.getFieldIndex(a));return i.inner.updateChunks(new Uint16Array(n))}))}async load(e){return this._promise==null&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(e){const t=await gt.create(e,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:r}=this._service;Z(this._options);const{fields:i,timeZoneByFieldName:n}=this._service.metadata.fieldsIndex,a=i.map(u=>({...u,index:t.metadata.getFieldIndex(u.name)})),o=de.fromJSON({fields:a,timeZoneByFieldName:n}),d=new Uint16Array(Array.from(this._availableFields.values()).map(u=>o.get(u)?.index));await t.inner.readChunksWithCallback(d,u=>{const h=this._chunkId++,l=new an(this._metadata,o,r,u,h),p=new xe(l,null,h,!1);this._store.insert(p)}),this._files.push(t)}async _download(){try{await Promise.all(this._service.source.urls.map(t=>this._insert(t)));const e=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}class dn extends Ps{constructor(e,t,r,i,n,a){super(e,t,r,n,a),this._random=new Jt(1e3),this._featureCount=i}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return this._promise==null&&(this._promise=this._downloadPages(this._featureCount)),this._promise}unload(e){}async _downloadPages(e){const t=Math.ceil(e/this._queryInfo.pageSize),r=Array.from({length:t},(o,d)=>d).sort((o,d)=>this._random.getInt()-this._random.getInt()),i=await Promise.all(r.map(o=>this._downloadPage(o))),n=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(n);const a=i.filter(o=>o);if(a.length)throw new W("featurelayer-query","Encountered errors when downloading data",{errors:a})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),r=await this._fetch(t,this._options),i=new xe(r,t.inner.toJSON(),e,!1);return Z(this._options),this._store.insert(i),null}catch(t){return t}}}const un="__esri_stream_id__",Vt="__esri_timestamp__",Yt=1e3;class cn{constructor(e,t,r,i,n=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=r,this._purgeOptions=i,this.store=e,this.objectIdField=t,this.purgeInterval=n,this._useGeneratedIds=this.objectIdField===un}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const r of t.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const a=this._nextId();e.attributes[this.objectIdField]=a,e.objectId=a}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new xt(1e5)),void this._trackIdLessObservations.enqueue(t);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const a=this._purgeOptions?.maxObservations!=null?this._purgeOptions.maxObservations:Yt,o=ar(a,0,Yt);this._trackIdToObservations.set(r,new xt(o))}const i=this._trackIdToObservations.get(r),n=i?.enqueue(t);n!=null&&(this._addOrUpdated.has(n)?this._addOrUpdated.delete(n):this._removed.push(n))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const i=[];if(t!=null)for(const a of t){const o=this.store.removeById(a);o!=null&&i.push(o)}const n=[];if(e!=null){const a=new Set(t??[]);for(const o of e)a.has(o.objectId)||(o.attributes[Vt]=r,this.store.add(o),n.push(o))}return!(!n.length&&!i?.length)&&(this.store.update(n,i),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(r=>e[t++]=r),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(t>e.displayCount&&r.size){const i=r.dequeue();this._removed.push(i),t--}}if(this._trackIdLessObservations!=null){let r=t-e.displayCount;for(;r-- >0;){const i=this._trackIdLessObservations.dequeue();i!=null&&this._removed.push(i)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const r=60*e.age*1e3,i=this._maxAge-r;this.store.forEach(n=>{n.attributes[t]{i.attributes[Vt]{e.size===0&&this._trackIdToObservations.delete(t)})}}let B=class extends Ht{constructor(s){super(s)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};V([ge()],B.prototype,"connection",void 0),V([ge()],B.prototype,"connectionStatus",null),V([ge()],B.prototype,"errorString",null),B=V([Xt("esri.views.2d.layers.features.sources.StreamConnectionState")],B);let ln=class{constructor(s,e){this._metadata=s,this._onUpdate=e,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return q.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(s){this._objectIdToFeature.set(s.objectId,s)}forEach(s){this._objectIdToFeature.forEach(s)}removeById(s){const e=this._objectIdToFeature.get(s);return e?(this._objectIdToFeature.delete(s),e):null}clear(){this._objectIdToFeature=new Map}update(s,e){this._onUpdate(s?.length??0)}};class hn extends ue{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class _n extends pt{constructor(e,t,r,i,n){super(r),this._service=e,this._dataFilter=t,this._streamOptions=i,this._metadata=n,this._connectionState=new B,this._forceRefresh=!1,this.events=new st;const{objectIdField:a,timeInfo:o}=this._metadata,{purgeOptions:d}=t;this._stagingStore=new ln(this._metadata,u=>this.events.emit("features-updated",u)),this._manager=new cn(this._stagingStore,a,o,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new hn(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=Zt(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:r,maxReconnectionInterval:i,geometryDefinition:n,definitionExpression:a,customParameters:o}=this._dataFilter;this._connection=Ur(this._service.source,t,this._streamOptions.outSR,e,a,n,r,i,o),this._handlesGroup=Se([this._connection.on("data-received",d=>this._onFeature(d)),this._connection.on("message-received",d=>this._onWebSocketMessage(d))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}}class pn{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new st,this.featureAdapter=new mr}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._localEditChunk!=null&&this._chunksToRemove.push(this._localEditChunk),this._localEditChunk=null}*chunks(){this._localEditChunk&&(yield this._localEditChunk),this._localOverridesChunk&&(yield this._localOverridesChunk),yield*this._chunks.values()}dataChunks(){return this._chunks.values()}insert(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._localOverridesChunk?.overriddenIds.size&&(e.reader.removeIds(this._localOverridesChunk.overriddenIds),e.invalidate()),this._localEditChunk?.overriddenIds.size&&this._localEditChunk.removeOverrides(e),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyLocalOverrides(e,t){this._localOverridesChunk==null&&(this._localOverridesChunk=new Je(t,"localOverride")),this._localOverridesChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localOverridesChunk.overriddenIds),r.invalidate();this.events.emit("changed")}applyLocalEdit(e,t){this._localEditChunk==null&&(this._localEditChunk=new Je(t,"localEdit")),this._localEditChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localEditChunk.overriddenIds),r.invalidate();this.events.emit("changed")}forEach(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i.copy()),t.add(n))}}}forEachUnsafe(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i),t.add(n))}}}forEachInBounds(e,t){const r=new Set;for(const i of this.chunks()){const n=i.queryFeaturesInBounds(e);for(;n.next();){const a=n.getObjectId();r.has(a)||(t(n.copy()),r.add(a))}}}forEachBounds(e,t){const r=rt();for(const i of e)i.getBounds(r)&&t(r)}}class gn{constructor(e,t,r,i,n){this.service=e,this._aggregateAdapter=t,this._subscriptions=r,this._onChange=i,this._connection=n,this._updateTracking=new Wr({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new pn(this._onChange),this._metadata=ot.createFeature(e.metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),this.service.type==="memory"&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return Fi.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,r=this._metadata;this._queryEngine=new as({featureStore:this._store,fieldsIndex:r.fieldsIndex,geometryType:r.geometryType,objectIdField:r.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:r.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._connection.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(Qt(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getLocalEdit(e){return this._updateTracking.addPromise(this._getGetLocalEdit(e))}applyLocalEdit(e){this._didInvalidateData=!0,this._store.applyLocalEdit(e,this.metadata)}async update(e,t){const r=e.source,i=Kt(this._schema?.mutable,r.mutable);if(!i)return!1;if(w("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:i}),this._schema=r,this._queryEngine?.destroy(),this._queryEngine=null,this.service.type==="feature-service"&&this.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),mt(i,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if((r.type==="feature"||r.type==="parquet")&&mt(i,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(r.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(n){this._connection.onEvent({type:"updateFieldsError",error:n})}}return!1}return!(!bt(i,"dataFilter")&&!bt(i,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new ye(this._connection))}async _getGetLocalEdit(e){if(e.historicMoment&&this._schema.type==="feature"&&(this._schema.mutable.dataFilter.historicMoment=e.historicMoment,this._strategy.unsafeSetQueryHistoricMoment(new Date(e.historicMoment))),e.type==="edit-by-feature"){const i=[...e.added,...e.updated].map(n=>Y.fromJSON(n,this.metadata.objectIdField));return{reader:q.fromOptimizedFeatures(i,this.metadata),removed:this._resolveIdentifiers(e.removed)}}const t=this._resolveIdentifiers(e.removed);if(!e.updated.length&&!e.added.length)return{reader:q.empty(this.metadata),removed:t};const r=this._resolveIdentifiers([...e.added,...e.updated]);return{reader:await this._strategy.queryByObjectId(r),removed:t}}_resolveIdentifiers(e){const t=[],r=[];for(const i of e)i.objectId!=null&&i.objectId!==-1?r.push(i.objectId):t.push(i.globalId);if(t.length){const i=new Set(t),n=this.metadata.globalIdField;if(n==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");this._store.forEachUnsafe(a=>{const o=a.readAttribute(n);i.has(o)&&r.push(a.getObjectId())})}return r}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this.service.source,t={...e.query,f:"json"},r=(await tt(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),r=this.service.source&&"collection"in this.service.source,i=e||t||r;if(this._schema.type==="stream"){const d=new _n(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=d,d}if(this._schema.type==="parquet"){const d=this.service;return new on(d,this._metadata,this._schema,this._store)}const n=this.service,a=Ci.fromSchema(n,this._schema,this._metadata),o=await this._supportSnapshotMode(n,a);return o?new dn(n,a,this._store,o.featureCount,this.metadata,this._connection):i?new Vi(n,a,this._store,this.metadata,this._connection):new $i(n,a,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const i=Array.from(this._subscriptions.values());if(!i.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const n=Promise.all(i.map(a=>this._strategy.load(a).then(()=>this._connection.onEvent({type:"loaded",tile:a.tile.id})).catch(o=>this._connection.onEvent({type:"error",tile:a.tile.id,error:o}))));this._updateTracking.addPromise(n);try{r&&await n}catch(a){et(a)}this._connection.onEvent({type:"updateStrategyEnd"}),w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:r}=e,i=r.snapshotInfo;if(!i||!i.supportsSnapshotMinThreshold||!i.snapshotCountThresholds)return null;const n=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const o=(await Rr(n,a.inner,{query:a.customParameters})).data.count,{min:d,max:u}=i.snapshotCountThresholds;return o<=d||i.supportsSnapshotMaxThreshold&&othis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateLocalEditsRequest=null,this._tileInfoView=null}onAttach(e){w("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const t=this._connection,r=hr.fromJSON(e.tileInfoJSON);this._tileInfoView=new _r(r),this._source=new gn(e.service,this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),t),this._processor=new Si(t,this._source),this._handles=Se([Ne(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),Qt(this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){w("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new Gr(e)}get features(){const e=this._source?.queryEngine;if(!e)throw new W("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor?.aggregateQueryEngine;if(!e)throw new W("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}async updateSchema(e,t){return w("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new pe({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new pe(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new pe(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onEdits(e){if(this._updateLocalEditsRequest!=null)throw new W("InternalError - Already processing an edit");this._updateLocalEditsRequest=new pe(e);const t=this._updateLocalEditsRequest.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(Qs(e.radius));let r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const n=typeof e.fieldOffset=="string",a=e.fieldOffset??0,o=Array.from(this._subscriptions.values()),d=this._source.chunks(),u=t**2,h=3/(Math.PI*u),l=2*t,p=Math.ceil(T/l);for(const g of o){const _=g.tile,f=new Float64Array(p*p);for(const y of d){const v=y.getTileReader(_);if(!v)continue;const b=v.getCursor();for(;b.next();){let F=1;if(e.field!=null){const R=b.readAttribute(e.field);F=n?-1*+R:+R+a}const C=b.readXForDisplay()/l,x=b.readYForDisplay()/l,S=Math.floor(C),k=Math.floor(x);if(S<0||k<0||S>=p||k>=p)continue;const E=((.5+S-C)*l)**2+((.5+k-x)*l)**2;if(E>u)continue;const L=F*(h*(1-E/u)**2);f[k+S*p]+=L}}for(let y=0;yd+u.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const d=[];return this._source.store.forEachUnsafe(u=>d.push(u.readLegacyFeatureWorldSpace())),d}return null}const r=new Set,i=[],n=t.map(d=>d.reader.getCursor()),a=new Jt,o=3*e.sampleSize;for(let d=0;d=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,Zs(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=it(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;w("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const r=new pr(this._tileInfoView,t),i=new fn(r,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(w("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const i=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const n of i)this._doUpdateSubscriptions(n.inner),n.resolver.resolve()}const e=this._updateSchemaRequest;if(this._updateSchemaRequest=null,e!=null){const{schema:i,version:n}=e.inner;await this._doUpdateSchema(i,n)}const t=this._updateLocalEditsRequest;if(this._updateLocalEditsRequest=null,t!=null){w("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.inner);const i=await this._source.getLocalEdit(t.inner);await this._processor.applyLocalEdit(i),this._source.applyLocalEdit(i),w("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.inner)}if(this._updateHighlightRequests.length){const i=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const n of i)this._processor.updateHighlight(n.inner),n.resolver.resolve()}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{this._subscriptions.size&&(w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(i){et(i)}t?.resolver.resolve(),e?.resolver.resolve(),this._updateRequested?(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const r={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),n=Array.from(this._subscriptions.values());await this._processor.update(e,t,r,i,n),w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){w("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{eo as default}; diff --git a/main/assets/FeaturePipelineWorker-7KRvCyaS-CrmtlGmf.js b/main/assets/FeaturePipelineWorker-7KRvCyaS-CrmtlGmf.js deleted file mode 100644 index 428acc791..000000000 --- a/main/assets/FeaturePipelineWorker-7KRvCyaS-CrmtlGmf.js +++ /dev/null @@ -1 +0,0 @@ -import{v as V,S as ge,i as Xt,K as w,bo as Se,ah as Ne,b9 as Qt,o as W,f4 as Qs,dA as Zs,bt as et,hC as le,J as P,aA as Zt,$ as Z,j as Ht,f as tt,b as Hs,ff as Jt,bV as Js,x as Ks,hr as er,hn as tr,I as st,gU as rt,E as we,fn as sr,p as rr,fk as ir,bw as nr,ae as ar,O as or,l as dr,n as ur,B as ft,dY as yt,a1 as cr}from"./main-BZaw9FpY.js";import{M as it,t as lr}from"./workers-PiCjreoO-oGzLvkSt.js";import{V as hr}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{Q as _r,Z as pr,V as gr}from"./Tile-D75RMC64-DprBAZDK.js";import{s as nt}from"./TileKey-C5IL-JBr-0HJjsV9n.js";import{t as T}from"./definitions-DJSdSb77-DkoRHaVx.js";import{P as Kt,C as mt,S as bt}from"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import{P as fr,m as yr,o as at,E as ot,W as wt,e as Fe,G as es,O as mr,q as br,L as wr}from"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import{d as Ir,g as vr}from"./MeshWriterRegistry-CIC9Yk_f-DL00Jm1o.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import{A as xr,q as ss,d as Sr,j as rs,V as Fr,D as kr,e as Cr,f as Tr,C as Q,$ as is,n as Mr,O as ns,X as qr}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{i as Y,a as he,c as M}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{f as Er,h as Ie}from"./queryUtils-Brxu6254-DDAvXp_C.js";import{o as de}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{s as Or}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";import{Z as as}from"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import{P as Rr,p as Ar,q as It}from"./query-DFW9-NG_-1nHUNdNu.js";import{L as Pr}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{b as os}from"./Query-BrwMGK8U-sojFdYaD.js";import{k as jr}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{z as ds}from"./quantizationUtils-bJy1cRwp-72T4gbed.js";import{_ as vt}from"./ogcFeatureUtils-Bs12bZY3-DAr9GIuj.js";import{o as Dr}from"./pbf-D-y3_eZO-BOjQwfR-.js";import{k as Lr,m as zr}from"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import{i as xt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{createConnection as Ur}from"./createConnection-CrkuTLXs-CU9LZMAw.js";import{a as Wr}from"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./PieChartMeshWriter-C5yLDFwp-CJPWs81O.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./TurboLine-CIlsAy5m-BrOlSIM-.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./grouping-RwmXkHDc-CUd3AkxY.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./signal-CETehA7D-vStzfbaY.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./geojson-CNt_qtQf-BQNqVsVZ.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-BMC57bnT.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./sourceUtils-BMeqkJ5g-CD_x4f6t.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";let Gr=class{constructor(s){this._client=s,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(s){it(this._eventLog.onEvent(s))}};const ke=1,dt=2,Ce=4,ut=8,ct=16,Te=32,lt=64,Me=128;function je(s){switch(s){case ke:case ut:case Te:return-1;case dt:case lt:return 0;case Ce:case ct:case Me:return 1}}function De(s){switch(s){case ke:case dt:case Ce:return-1;case ut:case ct:return 0;case Te:case lt:case Me:return 1}}const St=ke|ut|Te,Ft=Ce|ct|Me,kt=ke|dt|Ce,Ct=Te|lt|Me;let Nr=class{constructor(s,e,t,r,i=0){this.tileKey=s,this._bufferingEnabled=e,this._sizeHint=i,this._meshes={self:new wt(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=r?1:0;this._copyBufferedDataIntoSelf=t&&this._bufferingEnabled&&s.level===n}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(s){this._meshes.self.indexEnsureSize(s)}entityStart(s,e=s){this._currentEntityOverlaps=0,this._meshes.self.entityStart(s,e)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let s=0;s<8;s++){const e=1<{const n=r.serialize(),a=1<=T-i?St:Ft|St)|(e<0+n?Ct:e>=T-n?kt:Ct|kt));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let s=0;s<8;s++){const e=1<0){const i=this.getBackgroundFill();if(i)return[...i,...r]}return r}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},Br=class cs extends G{static async fromDictionaryRenderer(e,t){return new cs(e,t)}constructor(e,t){super(),this._context=e,this._schema=t,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const r=t.getCursor(),i=[];for(;r.next();)i.push(this._updateMeshWriterGroup(e,r));await Promise.all(i)}match(e,t){const r=e.getAttributeHash();return this._hashToGroup.get(r)}async _updateMeshWriterGroup(e,t){const r=t.readLegacyFeatureForDisplay(),i=t.getAttributeHash();if(this._hashToGroup.has(i))return;this._hashToGroup.set(i,null);const n=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:r});if(!n)return;const a=await this._context.createMeshWriters(n.meshes);this._hashToGroup.set(i,a)}},Vr=class ls extends G{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t){const r=await e.storage.createComputedField(t),i=new ls(r,t.isMaxInclusive);await Promise.all(t.intervals.map(async o=>{const d=await e.createMeshWriters(o.meshes);i.add(o,d)}));const n=await e.createMeshWriters(t.defaultSymbol);i.setDefault(n);const a=await e.createMeshWriters(t.backgroundFill);return i.setBackgroundFill(a),i}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((r,i)=>r.interval.min-i.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){const r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let i=0;i=n.min,d=this._isMaxInclusive?r<=n.max:r{const a=await e.createMeshWriters(n.meshes);return{minScale:n.minScale,maxScale:n.maxScale,meshes:a,expression:null,where:await e.storage.createWhereClause(n.where)}}),i=await Promise.all(r);return new hs(i)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const r=this._getLabels(t.$view.scale),i=[];for(const n of r)n.where&&!n.where(e)||i.push(...n.meshes);return i}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const r=t-t/4,i=t+t/2;return(!e.minScale||e.minScale>=r)&&(!e.maxScale||e.maxScale<=i)}},Xr=class _s extends G{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t){const r=t.expression?[e.storage.createComputedField({expression:t.expression})]:[t.field?e.storage.createComputedField({field:t.field}):null,t.field2?e.storage.createComputedField({field:t.field2}):null,t.field3?e.storage.createComputedField({field:t.field3}):null],i=(await Promise.all(r)).filter(d=>!!d),n=new _s(i,t.fieldDelimiter),a=await e.createMeshWriters(t.defaultSymbol);n.setDefault(a);const o=await e.createMeshWriters(t.backgroundFill);return n.setBackgroundFill(o),await Promise.all(t.map.map(async(d,u)=>{const h=await e.createMeshWriters(d.symbol);d.value===""?n.setNullResult(h):n.add(d.value,h,u+1)})),n}setNullResult(e){this._nullResult=e}getSortKey(e,t){const r=this._getValueFromFields(e,t);if(r==null||r===""||r==="")return 0;const i=this._resultsMap.get(r.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(e,t,r){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:r}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,r+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){const r=this._getValueFromFields(e,t);if(this._nullResult!==null&&(r==null||r===""||r===""))return this._nullResult;if(r==null)return null;const i=r.toString();return this._resultsMap.get(i)?.meshWriters}_getValueFromFields(e,t){const r=[];for(const i of this._fields){const n=i.read(e,t);n==null||n===""?r.push(""):r.push(n)}return r.join(this._separator)}};async function ae(s,e){switch(e.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return G.from(s,e);case"interval":return Vr.fromIntervalSchema(s,e);case"dictionary":return Br.fromDictionaryRenderer(s,e);case"label":return Yr.fromLabelSchema(s,e);case"map":return Xr.fromMatcherSchema(s,e);case"subtype":return Qr.fromSubtypes(s,e);case"cluster":return Zr.fromClusterSchema(s,e);default:throw new Error("Impl")}}let Qr=class ps extends G{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const r=new Map,i=[];for(const n in t.renderers){const a=parseInt(n,10),o=ae(e,t.renderers[n]).then(d=>r.set(a,d));i.push(o)}return await Promise.all(i),new ps(r,t.subtypeField)}match(e,t){const r=e.readAttribute(this._subtypeField),i=this._subMatchers.get(r);return i?i.match(e,t):null}},Zr=class gs extends G{static async fromClusterSchema(e,t){const[r,i]=await Promise.all([ae(e,t.feature),ae(e,t.cluster)]);return new gs(r,i)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},Hr=class fs extends $r{static async create(e,t){const r=await ae(e,t.symbology),i=t.labels?await ae(e,t.labels):null;return new fs(r,i)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,r){const i=this._symbology.match(t,r);if(i){for(const n of i)n.enqueueRequest(e,t,r);if(this._labels){const n=this._labels.match(t,r);if(!n)return;for(const a of n)a.enqueueRequest(e,t,r)}}}write(e,t,r,i,n){const a=this._symbology.match(r,i);if(a){for(const o of a)o.write(e,t,r,i,n);if(e.entityRecordCount()>=1&&this._labels){const o=this._labels.match(r,i);if(!o)return;for(const d of o)d.setReferences(a),d.write(e,t,r,i,n)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},Jr=class{constructor(s,e,t,r){this.storage=s,this.proxy=e,this.viewParams=t,this.registry=r}async createMeshWriters(s){const e=s.map(t=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,t));return Promise.all(e)}},Kr=class{constructor(s){this._outstandingMessages=[],this._queue=new ts({concurrency:s.concurrency,process:e=>s.process(e)})}async push(s){if(s.end)return await Promise.all(this._outstandingMessages),await this._queue.push(s),void(this._outstandingMessages=[]);const e=this._queue.push(s);return this._outstandingMessages.push(e),e}},ys=class $e{static async create(e,t){if(t.statisticType==="count"){const i=new vr(1);return new $e(t.name,t.alias,t.type,t.statisticType,i)}const r=await e.createComputedField({expression:t.onStatisticExpression?.expression,field:t.onStatisticField});return new $e(t.name,t.alias,t.type,t.statisticType,r)}constructor(e,t,r,i,n){this.name=e,this.alias=t,this.type=r,this.statisticType=i,this.computed=n}},ht=class{constructor(s){this.subscription=s,this.handledChunks=new Set}destroy(){}},ms=class{constructor(s,e){this._source=s,this._attributeStore=e,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}onSubscribe(s){const e=this.createState(s);this._sendStates.set(s.key.id,e),this.updateChunks()}onUnsubscribe(s){this._sendStates.get(s.key.id)?.destroy(),this._sendStates.delete(s.key.id)}invalidate(){const s=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of s)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(){}getFeatureObjectIdsForAggregate(s){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(s){return this.displayMap(s,e=>e,e=>e)}getDisplayAndObjectIds(s){return this.displayMap(s,e=>e,(e,t,r)=>[e,r])}beforeUpdateChunks(){}afterUpdateChunks(){}},bs=class extends ms{constructor(s,e,t,r){super(s,e),this.spatialReference=t,this.aggregateFields=r,this.events=new st,this.featureAdapter=Or}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new as({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(s){}forEach(s){return this.forEachAggregateWorldSpace(s)}forEachInBounds(s,e){}forEachBounds(s,e){const t=rt();for(const r of s){const i=Fr(t,r.geometry,!1,!1);i&&e(i)}}},_t=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.clear=t,this.end=r,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"append",clear:this.clear,id:this.id,append:s,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:e,attributeEpoch:t}}},Be=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.remove=t,this.end=r,this.debugInfo=i,this.type="update"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"update",id:this.id,modify:s,debugInfo:this.debugInfo,remove:this.remove,version:e,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:t}}},ei=class ws{static fromReader(e){const t=[],r=e.copy(),i=rt();for(;r.next();)r.getBounds(i)&&t.push(r.getIndex());const n=gr(9,a=>(r.setIndex(a),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return n.load(t),new ws(n)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}};const ti=64;function si(s,e,t,r){const i=[s.xmin,s.ymin,s.xmax,s.ymax],n=dr.fromExtent(ur.fromBounds(i,r)),a=Ie(n,r,P.WGS84,{densificationStep:e*ti});if(!a)return null;const o=ns(new M,a,!1,!1),d=o.coords.filter((y,v)=>!(v%2)),u=o.coords.filter((y,v)=>v%2),h=Math.min(...d),l=Math.min(...u),p=Math.max(...d),g=Math.max(...u),_=Ve(h,l,t,P.WGS84),f=Ve(p,g,t,P.WGS84);return _&&f?{bounds:i,geohashBounds:{xLL:_[0],yLL:_[1],xTR:f[0],yTR:f[1]},level:t}:null}function Ve(s,e,t,r){if(r.isWebMercator){const a=ft(s/yt.radius),o=a-360*Math.floor((a+180)/360),d=[0,0];return Tt(d,0,ft(Math.PI/2-2*Math.atan(Math.exp(-e/yt.radius))),o,t),d}const i=Ie({x:s,y:e},r,P.WGS84);if(!i)return null;const n=[0,0];return Tt(n,0,i.y,i.x,t),n}function ri(s,e){let t=-90,r=90,i=-180,n=180;for(let a=0;a>h,y=(_&s.geohashY)>>l;for(let v=p-1;v>=0;v--){const b=(i+n)/2,F=f&1<=0;v--){const b=(t+r)/2,F=y&1<g?1:0;n|=_<<29-(p+5*l),u=(1-_)*u+_*g,h=(1-_)*g+_*h}for(let p=0;p<5;p++){const g=(o+d)/2,_=t>g?1:0;a|=_<<29-(p+5*l),o=(1-_)*o+_*g,d=(1-_)*g+_*d}}s[2*e]=n,s[2*e+1]=a}let Is=class{constructor(s){this._statistics=s}get statistics(){return this._statistics}};const Mt=Math.PI/180;let vs=class Ye{static create(e){return new Ye(e.map(t=>ii(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const r of this._statistics)r.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function ii(s){switch(s.statisticType){case"min":return new ni(s);case"max":return new ai(s);case"avg":return new di(s);case"avg_angle":return new ui(s);case"sum":case"count":return new oi(s);case"mode":return new ci(s)}}let K=class{constructor(s){this.field=s}insert(s,e){if(!this.field.computed)return;const t=this.field.computed.read(s,e);wr(t)||this._insertValue(t)}},ni=class xs extends K{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new xs(this.field);return e.value=this.value,e}},ai=class Ss extends K{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Ss(this.field);return e.value=this.value,e}},oi=class Fs extends K{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new Fs(this.field);return e.value=this.value,e}},di=class ks extends K{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new ks(this.field);return e._total=this._total,e._count=this._count,e}},ui=class Cs extends K{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,r=180/Math.PI;return Math.atan2(t,e)*r}_insertValue(e){this._x=this._x+Math.cos(e*Mt),this._y=this._y+Math.sin(e*Mt),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Cs(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},ci=class Ts extends K{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[r,i]of this._frequencies.entries())i>t&&(t=i,e=r);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,r]of e._frequencies.entries()){const i=this._frequencies.get(t);i!=null?this._frequencies.set(t,i+r):this._frequencies.set(t,r)}}clone(){const e=new Ts(this.field);return e._frequencies=new Map(this._frequencies),e}},qt=class Xe extends Is{static create(e,t,r,i){const n=vs.create(e),a=new Array(32);for(let o=0;o=r)return this;const o=1-i%2,d=3*o+2*(1-o),u=2*o+3*(1-o),h=30-n-d,l=30-a-u,p=((e&7*o+3*(1-o)<>h)+((t&3*o+7*(1-o)<>l)*(8*o+4*(1-o)),g=this.children[p];return g==null?null:g.find(e,t,r,i+1,n+d,a+u)}_getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),r=Math.floor(e/2),i=30-(3*t+2*r),n=30-(2*t+3*r),a=this.xNode<=a)return;const p=Math.ceil((u+1)/2),g=Math.floor((u+1)/2),_=1-u%2,f=30-(3*p+2*g),y=30-(2*p+3*g),v=(i&7*_+3*(1-_)<>f,b=(n&3*_+7*(1-_)<>y,F=v+b*(8*_+4*(1-_));h=h<<3*_+2*(1-_)|v,l=l<<2*_+3*(1-_)|b,d.children[F]==null&&(d.children[F]=qt.create(this._fields,h,l,u+1),this._depth=Math.max(this._depth,u+1),this._size+=1),u+=1,d=d.children[F]}}putBins(e,t){for(const r of this.getNodes(t)){const i=e.get(r.id);i?i.merge(r):e.set(r.id,r.clone())}}getNodes(e){const t=[],{geohashBounds:r,level:i}=e;let n=this._root;for(;n!==null;){const a=n.depth,o=n.xNode,d=n.yNode;if(a>=i){t.push(n),n=n.next;continue}const u=Math.ceil((a+1)/2),h=Math.floor((a+1)/2),l=1-a%2,p=30-(3*u+2*h),g=30-(2*u+3*h),_=~((1<>p,v=(r.yLL&f)>>g,b=(r.xTR&_)>>p,F=(r.yTR&f)>>g,C=o<<3*l+2*(1-l),x=d<<2*l+3*(1-l),S=C+8*l+4*(1-l),k=x+4*l+8*(1-l),E=Math.max(C,y),L=Math.max(x,v),R=Math.min(S,b),N=Math.min(k,F);let ce=null,Re=null;for(let Ae=L;Ae<=N;Ae++)for(let Pe=E;Pe<=R;Pe++){const Xs=Pe-C+(Ae-x)*(8*l+4*(1-l)),te=n.children[Xs];te&&(ce||(ce=te,ce.next=n.next),Re&&(Re.next=te),Re=te,te.next=n.next)}n=ce||n.next}return t}}let Ms=class{constructor(s){this._options=s}insert(s,e){const t=s.getCursor(),r={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;t.next();)this._insertFeature(t,r,e)}_insertFeature(s,e,t){const{featureFilter:r}=this._options;if(r!==null&&!r.check(s))return;let i=0,n=0;if(s.geometryType==="esriGeometryPoint")i=s.readXWorldSpace(),n=s.readYWorldSpace();else{if(t){const o=s.readCentroidForDisplay();if(o==null)return;const[d,u]=o.coords;if(d<0||d>T||u<0||u>T)return}const a=s.readCentroidWorldSpace();if(a==null)return;i=a.coords[0],n=a.coords[1]}this._insert(s,i,n,e)}},hi=class extends Ms{constructor(s){super(s),this._tree=new li(this._options.fields)}put(s){throw new Error("Geohash tree does not support put")}putBounded(s,e,t){const{geohashLevel:r,spatialReference:i}=this._options,n=si(e,t,r,i);n!=null&&this._tree.putBins(s,n)}_insert(s,e,t,r){const{geohashLevel:i,spatialReference:n}=this._options,a=Ve(e,t,i,n);a&&this._tree.insert(s,e,t,a[0],a[1],i,r)}},Qe=class fe extends Is{static createId(e,t){return`${e}.${t}`}static create(e,t,r,i){return new fe(e,t,vs.create(r),i)}constructor(e,t,r,i){super(r),this.gridX=e,this.gridY=t,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return fe.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new fe(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,r,i){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=i,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:Cr(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:Tr(e,this.centroidYWorld)}getGeometry(e,t){const r=this.gridX*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell,n=new M([4],[r,i,r+this._worldUnitsPerCell,i,r+this._worldUnitsPerCell,i+this._worldUnitsPerCell,r,i+this._worldUnitsPerCell]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPolygon",t)}return n}getCentroid(e){const t=new M([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const r=new M;return Q(r,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e,t){const r=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,n=new M([],[r,i]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPoint",t)}return n}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const _i=96;function Ze(s,e){return rr(s)*ir*_i/e}let pi=class extends Ms{constructor(s){super(s),this._cells=new Map,this._pixelsPerMapUnit=Ze(s.spatialReference,s.scale)}put(s){for(const e of this._cells.values()){const t=s.get(e.id);t?t.merge(e):s.set(e.id,e.clone())}}putBounded(s,e,t){const r=[e.xmin,e.ymin,e.xmax,e.ymax],[i,n,a,o]=r,d=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),u=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(a*this._pixelsPerMapUnit/this._options.cellSize),l=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize);for(let p=u;p<=l;p++)for(let g=d;g<=h;g++){const _=`${g}.${p}`,f=this._cells.get(_);if(!f)continue;const y=s.get(f.id);y?f&&!s.has(f.id)&&y.merge(f):s.set(f.id,f.clone())}}_insert(s,e,t,r){const i=e*this._pixelsPerMapUnit,n=t*this._pixelsPerMapUnit,a=Math.floor(i/this._options.cellSize),o=Math.floor(n/this._options.cellSize);this._getCellOrCreate(a,o).insert(s,r,e,t)}_getCellOrCreate(s,e){const t=Qe.createId(s,e);let r=this._cells.get(t);if(!r){const i=1*this._options.cellSize/this._pixelsPerMapUnit;r=Qe.create(s,e,this._options.fields,i),this._cells.set(t,r)}return r}},gi=class He extends Fe{static from(e,t){return new He(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[l,p]=e.scale,[g,_]=e.translate;return this._displayTranslationX=-g/l,this._displayScaleX=1/l,this._displayTranslationY=_/p,this._displayScaleY=1/-p,void(this._displayTransform=e)}const[r,i]=t.scale,[n,a]=t.translate,[o,d]=e.scale,[u,h]=e.translate;if(this._displayScaleX=r/o,this._displayTranslationX=(n-u)/o,this._displayScaleY=i/d,this._displayTranslationY=(-a+h)/d,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1!(r.objectId!=null&&t.has(r.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new z(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex!t.has(r.objectId))}getTileReader(s){if(!this._features.length)return null;const e=this.queryFeaturesInBounds(s.bounds);return e.setTransformForDisplay(s.transform),e}_onChange(){this.invalidate()}},fi=class extends ht{constructor(s,e){super(s),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=e}reset(){this.destroy(),this.done=!1}invaldateForLocalEditDropped(){this.handledChunks.clear(),this.bins.clear()}destroy(){const s=this.subscription.tile.key.level;for(const e of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${e}.${s}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const s of this.featureCache.values()){const e=s.clone();e.geometry&&kr(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}},yi=class Es extends bs{static async create(e,t,r,i,n){const a=new at({spatialReference:t}),o=await Promise.all(e.fields.map(async u=>ys.create(a,u))),d=e.featureFilter?await es.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return e.index.type==="geohash"&&await Er(t,P.WGS84),new Es(e,d,n,o,t,r,i)}constructor(e,t,r,i,n,a,o){super(a,o,n,i),this._schema=e,this._featureFilter=t,this._timeZone=r,this._metadata=ot.createFeature({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fieldsIndex:new de(e.fields).toJSON(),globalIdField:null,spatialReference:a.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new fi(e,this._attributeStore)}async*applyLocalEdit(e){for(const t of this._sendStates.values())t.reset(),yield new _t(t.subscription,q.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,r){const i=new Map(e.map(a=>[t(a),a])),n=[];for(const a of this._sendStates.values())for(const o of a.featuresWorldSpace()){const{objectId:d,displayId:u}=o,h=i.get(d);if(h!=null){const l=r(u,h,d);n.push(l),i.delete(d)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[];for(const n of this._sendStates.values())for(const a of n.featuresWorldSpace())t.has(a.displayId)&&!r.has(a.objectId)&&(a.geometry&&i.push({...rs(a,this._metadata.geometryType,!1,!1),displayId:a.displayId}),r.add(a.objectId));return{features:[],aggregates:i}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const r of t.bins.values())if(r.id===e)return Array.from(r.containedObjectIds);return[]}beforeUpdateChunks(){const e=this._source.chunks();if(!e.length)return;let t=!1;for(const r of e)qs(r)&&r.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this._lastHandledLocalEdit=r.lastLocalEditDropped,t=!0);if(t)for(const r of this._sendStates.values())r.invaldateForLocalEditDropped()}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const r of this._sendStates.values())for(const i of r.featuresWorldSpace())t.has(i.objectId)||(e(i),t.add(i.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:e.scale};case"grid":{const t=this._schema.index.fixedBinLevel,r=t!=null?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:r}}}}async*_update(e,t){const{handledChunks:r,subscription:i,bins:n,featureCache:a}=e,o=i.tile;if(e.done)return;for(const _ of t.chunks()){if(r.has(_.chunkId))continue;r.add(_.chunkId);const f=_.queryInfo;if("tileId"in f){const y=new nt(f.tileId);if(y.level!==o.level||y.world!==o.key.world)continue}_.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(n,e.tile.extent,e.tile.resolution)}const d=[],u=i.tile.transform,h=i.tile.key.level;for(const _ of n.values()){let f=a.get(_.id);if(f)f.attributes=_.getAttributes();else{const y=_.getGeometry(this.spatialReference,u);f=new Y(y,_.getAttributes(),null),y||(f.centroid=_.getGeometricCentroid(this.spatialReference,u)),f.objectId=_.id,f.displayId=this._attributeStore.createDisplayIdForObjectId(`${f.objectId}.${h}`),a.set(_.id,f)}d.push(f)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=q.fromOptimizedFeatures(d,this._metadata,u),p=l.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._timeZone);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g);yield new Be(e.subscription,l,[],e.done,{})}},mi=class{constructor(s,e){this.inner=s,this.displayId=e}};const _e=128;let bi=class extends ht{constructor(s){super(s),this.didSend=!1,this.done=!1}},wi=class{constructor(s,e,t,r,i){this._level=s,this._scale=e,this._indexOptions=t,this._clusterRadius=r,this._store=i,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const s of this._clusters.values())this._store.releaseDisplayIdForObjectId(s.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const s of this._clusters.values()){const e=s.inner.getCentroid(null),t=new Y(e,s.inner.getAttributes(),null);t.objectId=s.inner.id,t.displayId=s.displayId,yield t}}clusters(){return this._clusters.values()}updateChunks(s,e){let t=!1;for(const a of s){const o=a.queryInfo;"tileId"in o&&new nt(o.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),t=!0,a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells))}const r={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},i=Ze(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of e){const o=a.tile.bounds,d=Math.floor(o[0]*i/n),u=Math.floor(o[1]*i/n),h=Math.ceil(o[2]*i/n),l=Math.ceil(o[3]*i/n);r.xMin=Math.min(r.xMin,d),r.yMin=Math.min(r.yMin,u),r.xMax=Math.max(r.xMax,h),r.yMax=Math.max(r.yMax,l)}return this._lastCellBounds!=null&&r.xMin===this._lastCellBounds.xMin&&r.yMin===this._lastCellBounds.yMin&&r.yMin===this._lastCellBounds.yMin&&r.yMax===this._lastCellBounds.yMax||(t=!0,this._lastCellBounds=r),t&&this._clusterCells(r),t}async updateStatistics(s){let e=!1;for(const t of this._clusters.values())t.inner.count>1&&(e=this._updateAggregateStatistics(this._statistics,t.inner)||e);if(e){const t=Array.from(this._statistics.entries()).map(([r,i])=>({fieldName:r,minValue:i.minValue,maxValue:i.maxValue}));await s.container.updateStatistics(this._level,t)}}createAggregateFeatures(s,e){const t=s.subscription,r=[],i=t.tile.transform;for(const n of this._clusters.values()){let a=n.inner.getCentroidX(i);const o=n.inner.getCentroidY(i),d=t.tile.lod,u=d.wrap?d.worldSize[0]:null,h=n.inner.count===1?n.inner.firstObjectId:n.inner.id,l=n.displayId;if(u!=null)if(u===1){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.geometry.coords[0]-=T,g.objectId=h,g.displayId=l,r.push(g);const _=new M([],[a,o]),f=new Y(_,n.inner.getAttributes(),null);f.geometry.coords[0]+=T,f.objectId=h,f.displayId=l,r.push(f)}else a>T+T/2?a-=u*T:a<-T/2&&(a+=u*T);if(a=-_e&&o=-_e){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.objectId=h,g.displayId=l,r.push(g)}}return q.fromOptimizedFeatures(r,e,t.tile.transform)}_clusterCells(s){let e=Array.from(this._cells.values());e=e.sort((a,o)=>o.count-a.count);const t=[];for(const a of this._clusters.values())t.push(a.inner.id);this._clusters.clear();const r=this._clusterRadius*(1/Ze(this._indexOptions.spatialReference,this._scale)),i=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const a of e){if(n.has(a.id)||a.gridXs.xMax||a.gridYs.yMax)continue;const o=this._store.createDisplayIdForObjectId(a.id),d=new mi(a.clone(),o);n.add(a.id),this._clusters.set(a.id,d);const u=a.centroidXWorld,h=a.centroidYWorld;for(let l=a.gridY-i;l<=a.gridY+i;l++)for(let p=a.gridX-i;p<=a.gridX+i;p++){if(l===a.gridY&&p===a.gridX)continue;const g=this._cells.get(Qe.createId(p,l));if(!g||n.has(g.id))continue;const _=Math.abs(g.centroidXWorld-u),f=Math.abs(g.centroidYWorld-h);_ys.create(o,u))),spatialReference:r,featureFilter:t.featureFilter?await es.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:r,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:a};return new Os(e,t.clusterRadius,d,t.fields,i,n)}constructor(e,t,r,i,n,a){super(n,a,r.spatialReference,r.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=r,this._cellsPerScale=new Map,this._metadata=ot.createFeature({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fieldsIndex:new de([...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new bi(e)}async*applyLocalEdit(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,r){const i=new Map(e.map(o=>[t(o),o])),n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.clusters()){const d=i.get(o.inner.id);if(d==null){if(o.inner.count===1){const u=i.get(o.inner.firstObjectId);if(u!=null){const h=r(o.displayId,u,o.inner.firstObjectId);n.push(h),i.delete(o.inner.firstObjectId)}}}else{const u=r(o.displayId,d,o.inner.id);n.push(u),i.delete(o.inner.id)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.aggregatesWorldSpace())if(t.has(o.displayId)&&!r.has(o.displayId)){const d=rs(o,this._metadata.geometryType,!1,!1);if(r.add(o.displayId),d.attributes.cluster_count===1){i.push({...d,displayId:o.displayId});continue}n.push({...d,displayId:o.displayId})}return{features:i,aggregates:n}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.clusters())if(r.inner.id===e)return Array.from(r.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;for(const a of e)qs(a)&&a.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this.invalidate(),this._lastHandledLocalEdit=a.lastLocalEditDropped);const t=this._getClusterState(this._requiredLevel,this._requiredScale),r=Array.from(this._sendStates.values()).filter(a=>a.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,r)||!this._source.updateTracking.updating)for(const a of r)a.subscription.tile.level===this._requiredLevel&&(a.didSend=!1,a.done=!1);const i=Array.from(this._sendStates.values()).filter(a=>a.done).map(a=>a.subscription.tile.key),n=new Set(i);for(const a of this._sendStates.values())this._source.updateTracking.updating&&(i.some(o=>o.containsChild(a.subscription.tile.key))||a.subscription.tile.key.getChildKeys().every(o=>n.has(o)))||a.didSend||a.subscription.tile.level!==this._requiredLevel||(a.didSend=!0,yield*this._update(a,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.aggregatesWorldSpace())e(r)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let r=this._cellsPerScale.get(t);return r||(r=new wi(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,r)),r}async*_update(e,t,r){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!r.updateTracking.updating;const n=i.getCursor(),a=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;n.next();)this._attributeStore.setAttributeData(n.getDisplayId(),n,a);yield new _t(e.subscription,i,!0,e.done,{})}},vi=class extends ht{},xi=class extends ms{constructor(s,e,t){super(s,e),this._timeZone=t,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const s of this._source.chunks())this._cleanupChunkIds(s)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(s){super.onSubscribe(s),this._evalOptions=s.tile.createArcadeEvaluationOptions(this._timeZone)}createState(s){return new vi(s)}get aggregateQueryEngine(){return null}displayMap(s,e,t){const r=new Map(s.map(n=>[e(n),n])),i=[];for(const n of this._source.chunks()){const a=n.reader.getCursor();for(;a.next();){const o=a.getObjectId(),d=a.getDisplayId(),u=r.get(o);if(u!=null){const h=t(d,u,o);i.push(h),r.delete(o)}}}return i}getDisplayFeatures(s){const e=new Set(s),t=new Set,r=[];for(const i of this._source.chunks()){const n=i.reader.getCursor();for(;n.next();){const a=n.getObjectId(),o=n.getDisplayId();e.has(o)&&!t.has(a)&&(r.push({...n.readLegacyFeatureWorldSpace(),displayId:o}),t.add(a))}}return{features:r,aggregates:[]}}async*applyLocalEdit(s){const e=[],t=s.reader.getCursor();for(;t.next();){const n=t.getObjectId(),a=this._attributeStore.createDisplayIdForObjectId(n);t.setDisplayId(a),this._attributeStore.setAttributeData(a,t,this._evalOptions),e.push(a)}const r=[];for(const n of s.removed){const a=this._attributeStore.getDisplayIdForObjectId(n);a!=null&&r.push(a)}w("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:s,modifiedDisplayIds:e,removedDisplayIds:r});const i=new Je(this._source.metadata,"localEdit");i.applyOverrides(s),this.handledChunks.add(i.chunkId),this.handledChunksForAttributeData.add(i.chunkId),this.handledChunksForIdCreation.add(i.chunkId);for(const n of this._sendStates.values())n.handledChunks.add(i.chunkId),yield new Be(n.subscription,null,e,!1,i.queryInfo);for(const n of this._sendStates.values()){const a=i.getTileReader(n.subscription.tile);yield new Be(n.subscription,a,r,!1,i.queryInfo)}for(const n of s.removed)this._attributeStore.releaseDisplayIdForObjectId(n)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const s of this._sendStates.values())yield*this._update(s)}}removeChunks(s){for(const e of s)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const s of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(s);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(s){if(this.handledChunksForIdCreation.has(s.chunkId)){const e=s.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(s.chunkId)}}async _updateAttributeData(){for(const s of this._source.chunks()){const{chunkId:e,reader:t}=s;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const r=t.getCursor();for(;r.next();){const i=this._attributeStore.createDisplayIdForObjectId(r.getObjectId());r.setDisplayId(i)}}}for(const s of this._source.chunks())if(!this.handledChunksForAttributeData.has(s.chunkId)){this.handledChunksForAttributeData.add(s.chunkId);const e=s.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions)}}}*_update(s){const{subscription:e,handledChunks:t}=s;for(const r of this._source.chunks()){const{chunkId:i}=r;if(t.has(i))continue;t.add(i);const n=r.getTileReader(e.tile);n&&(yield new _t(s.subscription,n,!1,r.end,r.queryInfo))}}},Si=class{constructor(s,e){this._connection=s,this._source=e,this._version=1,this._registry=new Ir,this._proxy=new fr({fetch:(t,r)=>this._connection.layerView.fetch(t,r),fetchDictionary:(t,r)=>this._connection.layerView.fetchDictionary(t,r)}),this._attributeStore=new yr({isLocal:!1,update:t=>it(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(s){return this._strategy?this._strategy.getDisplayFeatures(s):{features:[],aggregates:[]}}getDisplayIds(s){const e={};return this._strategy&&this._strategy.displayMap(s,t=>t,(t,r,i)=>{e[i]=t}),e}getFeatureObjectIdsForAggregate(s){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(s):[]}onSubscribe(s){this._strategy?.onSubscribe(s)}onUnsubscribe(s){this._strategy?.onUnsubscribe(s)}async update(s,e,t,r,i){const n=s.processor,a=le(this._schema?.storage,n.storage),o=le(this._schema?.mesh.properties,n.mesh.properties),d=le(this._schema?.mesh.factory,n.mesh.factory),u=le(this._schema?.mesh.strategy,n.mesh.strategy),h=o||d||u;if(!(a||h)&&!r)return;w("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:Kt(this._schema,n),schema:n}),this._schema=n;const l=P.fromJSON(this._source.service.outSpatialReference),p=new at({fields:this._source.metadata.fieldsIndex,spatialReference:l});if(await this._attributeStore.update(n.storage,p,this._source.metadata,l,e),this._strategy?.invalidateAttributeData(),!r&&!h)return;(u||o)&&await this._updateStrategy(n.mesh.strategy,l,i,n.mesh.properties.timeZone),this._updateSortKey(p,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const g=new Jr(p,this._proxy,t,this._registry);return(d||n.mesh.factory.symbology.type==="dictionary")&&(this._factory=await Hr.create(g,n.mesh.factory)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)}async applyLocalEdit(s){if(!this._strategy)return;const e=this._strategy.applyLocalEdit(s);for await(const t of e)try{await this._process(t)}catch{}}async updateChunks(){this._strategy?.beforeUpdateChunks(),await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(s){this._strategy?.removeChunks(s),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:s}){if(!this._strategy)return void this._attributeStore.setHighlight(s.map(({objectId:t,highlightFlags:r})=>({objectId:t,highlightFlags:r,displayId:-1})),s);const e=this._strategy.displayMap(s,({objectId:t})=>t,(t,{highlightFlags:r},i)=>({objectId:i,displayId:t,highlightFlags:r}));this._attributeStore.setHighlight(e,s)}async _doUpdateChunks(){if(!this._strategy)return;const s=this._strategy.updateChunks(),e=[],t=new Map;for await(const r of s){let i=t.get(r.id);i==null&&(i=new Kr({concurrency:16,process:a=>this._process(a)}),t.set(r.id,i));const n=i.push(r).catch(a=>et(a));e.push(n)}try{await Promise.all(e)}catch{}w("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(s,e,t,r){switch(this._strategy?.destroy(),s.type){case"feature":this._strategy=new xi(this._source,this._attributeStore,r);break;case"binning":this._strategy=await yi.create(s,e,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await Ii.create(this._connection,s,e,this._source,this._attributeStore,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(s,e){if(this._sortInfo=Zt(this._sortInfo?.computed),e!=null){const t=e.byRenderer?null:await s.createComputedField(e);this._sortInfo={...e,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(s){const e=s.subscription;if(w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process`)}await this._fetchResources(s),Z(e.signal);const t=await this._write(s,e.tile.createArcadeEvaluationOptions(this._schema?.mesh.properties.timeZone)),r=e.tile.tileInfoView.getLODInfoAt(e.tile.key),{message:i,transferList:n}=t.serialize(r),a={objectIdMap:null,inner:s.createMessage(i,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){a.objectIdMap={};const o=s.reader?.getCursor();if(o)for(;o.next();)a.objectIdMap[o.getDisplayId()]=o.getObjectId()}if(Z(e.signal),await this._connection.container.onMessage(a,{signal:e.signal,transferList:n}),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process.await`)}}async _fetchResources(s){await this._fetchMatcherResources(s),await this._fetchWriterResources(s)}async _fetchMatcherResources(s){if(s.reader)return this._factory.enqueueMatcherRequests(this._proxy,s.reader)}async _fetchWriterResources(s){if(!s.reader)return;const e=s.reader.getCursor(),t=s.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;e.next();)this._factory.enqueueWriterRequests(this._proxy,e,t);await this._proxy.fetchEnqueuedResources()}async _write(s,e){const t=s.subscription.tile,r=s.reader?.getCursor(),i=r?.getSize()??0,n=t.tileInfoView.tileInfo.isWrappable,a=t.tileInfoView.tileInfo.spatialReference.isWGS84,o=new Nr(t.key,this._strategy.enablePixelBuffering,n,a,i);if(!r)return o;const d=t.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;r.next();){const u=this._getSortKeyValue(r,e);o.entityStart(r.getDisplayId(),u),this._factory.write(o,this._proxy,r,d,t.level),o.entityEnd()}return o}_getSortKeyValue(s,e){if(!this._sortInfo)return 0;const{computed:t,order:r,byRenderer:i}=this._sortInfo,n=i?this._factory.getSortKey(s,e):t?.read(s,e);return n==null||isNaN(n)?0:n*(r==="asc"?-1:1)}},Fi=class Rs{static from(e){let t=0,r=0,i=0;return e.forEach(n=>{const a=n._readGeometry();a&&(r+=a.isPoint?1:a.lengths.reduce((o,d)=>o+d,0),i+=a.isPoint?1:a.lengths.length,t+=1)}),new Rs(t,r,i)}constructor(e,t,r){this.featureCount=e,this.vertexCount=t,this.ringCount=r}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const Le=4;function ki(s,e,t){const r=s.orderByFields??t.objectIdField+" ASC",i=s.source,n={returnCentroid:!(i!==null&&typeof i=="object"&&"path"in i&&Pr(i.path))&&t.serviceGeometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:t.timeReferenceUnknownClient??void 0,outSpatialReference:P.fromJSON(s.outSpatialReference),orderByFields:s.type==="memory"?[]:[r],where:e.mutable.dataFilter.definitionExpression??"1=1",outFields:e.mutable.availableFields,multipatchOption:t.serviceGeometryType==="esriGeometryMultiPatch"?"xyFootprint":null};if(e.type==="feature"){const{gdbVersion:a,historicMoment:o,timeExtent:d}=e.mutable.dataFilter;return{...n,gdbVersion:a,historicMoment:o?new Date(o):null,timeExtent:d?jr.fromJSON(d):null,outFields:e.mutable.availableFields}}return n}let Ci=class As{static fromSchema(e,t,r){const i=t.type==="feature"?t.mutable.dataFilter.queryScaleRanges:[];return new As(ki(e,t,r),i,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,i,n,a){this._queryParams=e,this._queryScaleRanges=t,this._subtypeField=r,this._customParameters=i,this._geometryType=n,this._queryMetadata=a}get pageSize(){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?Le:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){if(!t.getSize())return null;const r=e.clone();if(this._queryParams.outFields[0]==="*"){if((r.outFields??[])[0]==="*")return null;r.outFields=this._queryParams.outFields}else{const i=new Set(this._queryParams.outFields),n=[];for(const a of i)t.hasField(a)||n.push(a);if(n.length===0)return null;r.outFields=n}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new os({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),i=r.inner;if(this._queryScaleRanges.length){const n=this._queryScaleRanges.filter(a=>(!a.minScale||a.minScale>=e.maxScale)&&(!a.maxScale||a.maxScale<=e.minScale)).map(a=>a.subtypeCode);if(n.length){const a=`${this._subtypeField} IN (${n})`;i.where=Js(i.where,a)}}if(i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._queryMetadata.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset=e.resolution*w("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(i.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset*=w("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=Le),w("esri-tiles-debug")){const n=e.id.replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,tileId:n}:{tileId:n}}return r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:Le})}};const Ti=2500;let ye=class extends Ht{constructor(s){super(),this._connection=s,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this._queuedCommands=[],this.addHandles([Ne(()=>this._strategy?.connectionStatus??"disconnected",e=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:e})},{initial:!0}),Ne(()=>this._strategy?.errorString||null,e=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:e}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(s){this._strategy==null&&this._resetUpdateInfo(performance.now());const e="event-handles";this.removeHandles(e),s!=null&&(this.addHandles([s.events.on("data-received",t=>this._onFeature(t)),s.events.on("message-received",t=>this._onWebSocketMessage(t)),s.events.on("features-updated",t=>this._onUpdate(t)),s.events.on("tick",()=>this._onTick())],e),this._queuedCommands.forEach(t=>t(s)),this._queuedCommands=[]),this._strategy=s}updateCustomParameters(s){s!=null&&this._callOrEnqueue(e=>e.updateCustomParameters(s))}sendMessageToSocket(s){this._callOrEnqueue(e=>e.sendMessageToSocket(s))}sendMessageToClient(s){this._callOrEnqueue(e=>e.sendMessageToClient(s))}enableEvent(s,e){e?this._enabledEventTypes.add(s):this._enabledEventTypes.delete(s)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(s){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:s})}_onFeature(s){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:s.attributes,centroid:s.centroid,geometry:s.geometry}})}_onUpdate(s){this._updateInfo.client+=s}_onTick(){const s=performance.now(),e=s-this._lastTime;if(e>Ti){const t=Math.round(this._updateInfo.client/(e/1e3)),r=Math.round(this._updateInfo.websocket/(e/1e3));this._resetUpdateInfo(s),this._layerView.emitEvent({name:"update-rate",event:{client:t,websocket:r}})}}_resetUpdateInfo(s){this._lastTime=s,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(s){this._strategy!=null?s(this._strategy):this._queuedCommands.push(s)}};V([ge()],ye.prototype,"_strategy",void 0),ye=V([Xt("esri.views.2d.layers.features.sources.StreamMessenger")],ye);let pt=class{constructor(s){this._store=s,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(s){throw new Error("InternalError: LoadStrategy does not support query info")}async queryOverride(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async queryByObjectId(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(s){throw new Error("InternalError: LoadStrategy does not support loading blobs")}};const ze=268435455;let Mi=class{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}};function qi(s,e,t=!1){const r=s.asUnsafe(),i=r.pos(),n=new Mi;let a=0,o=0;const d=1,u=2,h=4,l=3;let p=null,g=null,_=null,f=!1;const y=[];for(;r.next();)switch(r.tag()){case 1:p=r.getString();break;case 3:g=r.getString();break;case 12:_=r.processMessage(zr);break;case 9:if(n.exceededTransferLimit=r.getBool(),n.exceededTransferLimit){n.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),n.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let b=0;b0:!1}let ji=class Ke extends Fe{static fromBuffer(e,t,r=!1){const i=t.geometryType,n=Oi(e),a=qi(n,i==="esriGeometryPoint",r);return new Ke(n,a,t)}constructor(e,t,r){super(r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Ke(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexu.length)for(let y=0;y=y?(h+=-.5*(R-C)*(N+x),b>1&&Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k):(u[d++]=S,u[d++]=k,b++),C=R,x=N):(E+=S,L+=k),S=E,k=L,v++}b<3||F?d-=2*b:(h+=-.5*(C+S-C)*(x+k+x),Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k,a.push(b)):(u[d++]=S,u[d++]=k,a.push(++b)))}else{let y=0,v=t.getSInt32(),b=t.getSInt32();this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32(),u[d++]=v,u[d++]=b,y+=1;for(let F=1;F2&&Ue(g,u[d-2],u[d-1],C,x)?(u[d-2]+=C,u[d-1]+=x):(u[d++]=C,u[d++]=x,y+=1),v=S,b=k}a.push(y)}break}default:t.skip()}return this._cache.area=h,a.length?new M(a,u):u!=null?this._createQuantizedExtrudedGeometry(u[0],u[1]):null}},qe=class{constructor(s,e){this.service=s,this._metadata=e}destroy(){}};function Di(s,e){switch(s.type){case"memory":return new zi(s,e);case"ogc":return new Gi(s,e);case"feature-service":return s.queryMetadata.supportsFormatPBF&&w("featurelayer-pbf")?new Ui(s,e):new Wi(s,e)}}async function Li(s){const e=new lr;return await e.open(s,{}),e}let zi=class extends qe{constructor(s,e){super(s,e),this._portsOpen=Li(s.source).then(t=>this.client=t)}destroy(){this.client.close(),this.client=null}async executeQuery(s,e){await this._portsOpen;const t=await this.client.invoke("queryFeatures",s.toJSON(),e);return q.fromFeatureSet(t,this._metadata)}},Ui=class extends qe{async executeQuery(s,e){const{data:t}=await Ar(this.service.source,s,e),r=!s.quantizationParameters;return ji.fromBuffer(t,this._metadata,r)}},Wi=class extends qe{async executeQuery(s,e){const{source:t,queryMetadata:r}=this.service;if(s.quantizationParameters!=null&&!r.supportsQuantization){const n=s.clone(),a=ds(n.quantizationParameters);n.quantizationParameters=null;const{data:o}=await It(t,n,this._metadata.spatialReference,e),d=ss(o,this._metadata.objectIdField);return is(a,d),q.fromOptimizedFeatureSet(d,this._metadata)}const{data:i}=await It(t,s,this._metadata.spatialReference,e);return this._metadata.geometryType==="esriGeometryPoint"&&(i.features=i.features?.filter(n=>{if(n.geometry!=null){const a=n.geometry;return Number.isFinite(a.x)&&Number.isFinite(a.y)}return!0})),q.fromFeatureSet(i,this._metadata)}},Gi=class extends qe{async executeQuery(s,e){if(s.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=s.clone(),i=ds(r.quantizationParameters);r.quantizationParameters=null;const n=await vt(this.service.source,s,e);return is(i,n),q.fromOptimizedFeatureSet(n,this._metadata)}const t=await vt(this.service.source,s,e);return q.fromOptimizedFeatureSet(t,this._metadata)}},Ps=class extends pt{constructor(s,e,t,r,i){super(t),this._serviceInfo=s,this._queryInfo=e,this._metadata=r,this._connection=i,this._queue=new ts({concurrency:16,process:async n=>{const a={signal:n.options?.signal,query:n.query.customParameters};return this._adapter.executeQuery(n.query.inner,a)}}),this._adapter=Di(s,r)}unsafeSetQueryHistoricMoment(s){this._queryInfo.updateHistoricMoment(s)}async updateFields(s){this._queryInfo.updateFields(s);const e=Array.from(this._store.chunks()).map(async r=>{const i=os.fromJSON(r.queryInfo.queryJSON);if(i)try{return await this._tryUpdateFields(r.reader,i),null}catch(n){return n}}),t=(await Promise.all(e)).filter(r=>r);if(t.length)throw new W("featurelayer-query","Encountered errors when downloading fields",{errors:t})}async queryByObjectId(s){if(s.length===0)return q.empty(this._metadata);const e=this._queryInfo.createQuery({objectIds:s});return this._fetch(e)}async _fetch(s,e){const t=await this._enqueue(s,e);return await this._tryUpdateFields(t,s.inner),t}async _tryUpdateFields(s,e){const t=this._queryInfo.createPatchFieldsQuery(e,s);if(!t)return;const r=await this._enqueue(t,this._options);s.joinAttributes(r)}async _enqueue(s,e){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:s,options:e}).finally(()=>{this._connection.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},js=class extends Ps{constructor(){super(...arguments),this._chunksById=new Map}unload(s){this._removeChunks(s.tile)}_addChunk(s){const e=s.tile.id;this._chunksById.has(e)||this._chunksById.set(e,[]);const t=s.size();(t||s.first||s.end)&&(w("esri-2d-update-debug")&&console.debug(`Chunk[${s.chunkId}] ATileLoadStrategy.addChunk [count=${t}]`),this._chunksById.get(e).push(s),this._store.insert(s))}_removeChunks(s){const e=this._chunksById.get(s.key.id)??[];for(const t of e)w("esri-2d-update-debug")&&console.debug(`Tile[${s.key.id}] Chunk[${t.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(t);this._chunksById.delete(s.key.id)}},Pt=class extends ue{constructor(s,e,t,r,i,n){super(),this._reader=s,this._queryJSON=e,this._tile=t,this._sourceTile=r,this._sourceTileDepth=i,this._end=n,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(s){return this._tile.key.id===s.key.id?this.reader:null}},Ni=class{constructor(s,e){this.subscription=s,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=Se([we(s.signal,()=>this._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(s){return this._tileIdToResult.get(s)}set(s,e){this._tileIdToResult.set(s,e)}get options(){return{signal:this._controller.signal}}},$i=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Ni(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{for await(const i of this._fetchChunkInfos(e,s.tile,0)){const{queryJSON:n,reader:a,sourceTile:o,sourceTileDepth:d,tile:u}=i,h=new Pt(a,n,u,o,d,!1);Z(e.options),this._addChunk(h)}}catch(i){t=i}const r=new Pt(q.empty(this._metadata),null,s.tile,null,-1,!0);if(this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async*_fetchChunkInfos(s,e,t){let r=s.get(e.id);const i=!!r;if(r||(r=await this._fetchChunkInfo(s,e,t),s.set(e.id,r)),r.reader.exceededTransferLimit&&tthis._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let s=-1;for(const e of this._pages.values())s=Math.max(s,e);return s+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(s,e){this._pages.add(s),this._done=this._done||e}},Vi=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Bi(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{await this._fetchPages(e)}catch(i){t=i}const r=new jt(q.empty(this._metadata),null,s.tile,-1,!0);if(Ks(e.options)||this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async _fetchPages(s){let e=0,t=s.pageStart,r=1;for(;e<20&&!s.done;){const i=[];for(let a=0;a{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Ds.decode();let se=null;function me(){return se!==null&&se.byteLength!==0||(se=new Uint8Array(c.memory.buffer)),se}function X(s,e){return s>>>=0,Ds.decode(me().subarray(s,s+e))}const Dt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{c.__wbindgen_export_0.get(s.dtor)(s.a,s.b)});function Xi(s,e,t,r){const i={a:s,b:e,cnt:1,dtor:t},n=(...a)=>{i.cnt++;const o=i.a;i.a=0;try{return r(o,i.b,...a)}finally{--i.cnt==0?(c.__wbindgen_export_0.get(i.dtor)(o,i.b),Dt.unregister(i)):i.a=o}};return n.original=i,Dt.register(n,i,i),n}function Qi(s,e,t){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7be72b1871260ae2(s,e,m(t))}function Zi(){c.enableTracing()}let O=0;const be=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hi=typeof be.encodeInto=="function"?function(s,e){return be.encodeInto(s,e)}:function(s,e){const t=be.encode(s);return e.set(t),{read:s.length,written:t.length}};function oe(s,e,t){if(t===void 0){const o=be.encode(s),d=e(o.length,1)>>>0;return me().subarray(d,d+o.length).set(o),O=o.length,d}let r=s.length,i=e(r,1)>>>0;const n=me();let a=0;for(;a127)break;n[i+a]=o}if(a!==r){a!==0&&(s=s.slice(a)),i=t(i,r,r=a+3*s.length,1)>>>0;const o=me().subarray(i+a,i+r);a+=Hi(s,o).written,i=t(i,r,a,1)>>>0}return O=a,i}let U=null;function H(){return(U===null||U.buffer.detached===!0||U.buffer.detached===void 0&&U.buffer!==c.memory.buffer)&&(U=new DataView(c.memory.buffer)),U}function j(s,e){try{return s.apply(this,e)}catch(t){c.__wbindgen_exn_store(m(t))}}function Ji(s,e,t,r){c.wasm_bindgen__convert__closures__invoke2_mut__h35729c14da098d24(s,e,m(t),m(r))}let re=null;function Ki(){return re!==null&&re.byteLength!==0||(re=new Uint16Array(c.memory.buffer)),re}function Lt(s,e){const t=e(2*s.length,2)>>>0;return Ki().set(s,t/2),O=s.length,t}function Ls(s,e,t){const r=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;return D(c.readMetadata(r,i,m(e),m(t)))}function zt(s,e){if(!(s instanceof e))throw new Error(`expected instance of ${e.name}`);return s.ptr}function en(s,e,t,r,i){const n=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;zt(r,ee);var o=r.__destroy_into_raw();zt(i,J);var d=i.__destroy_into_raw();return D(c.readFile(n,a,m(e),m(t),o,d))}function We(s){return s==null}const Ut=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_fieldmetadata_free(s>>>0,1));class Ee{static __wrap(e){e>>>=0;const t=Object.create(Ee.prototype);return t.__wbg_ptr=e,Ut.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Ut.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const n=c.__wbindgen_add_to_stack_pointer(-16);c.fieldmetadata_name(n,this.__wbg_ptr);var r=H().getInt32(n+0,!0),i=H().getInt32(n+4,!0);return e=r,t=i,X(r,i)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(e,t,1)}}get index(){return c.fieldmetadata_index(this.__wbg_ptr)}get type(){return["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"][c.fieldmetadata_esri_type(this.__wbg_ptr)]}}const Wt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_filemetadata_free(s>>>0,1));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Wt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_filemetadata_free(e,0)}version(){return c.filemetadata_version(this.__wbg_ptr)}numRows(){return c.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return c.filemetadata_numFields(this.__wbg_ptr)>>>0}keyValueMetadata(e){try{const i=c.__wbindgen_add_to_stack_pointer(-16),n=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;c.filemetadata_keyValueMetadata(i,this.__wbg_ptr,n,a);var t=H().getInt32(i+0,!0),r=H().getInt32(i+4,!0);let o;return t!==0&&(o=X(t,r).slice(),c.__wbindgen_free(t,1*r,1)),o}finally{c.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),r=O,i=c.filemetadata_getFieldIndex(this.__wbg_ptr,t,r);return i===16777215?void 0:i}getFieldByIndex(e){const t=c.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return t===0?void 0:Ee.__wrap(t)}}const Gt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_geometryinfodescriptor_free(s>>>0,1));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,Gt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Gt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_geometryinfodescriptor_free(e,0)}get wkbIndex(){const e=c.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return e===16777215?void 0:e}set wkbIndex(e){c.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,We(e)?16777215:e)}get lngIndex(){const e=c.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return e===16777215?void 0:e}set lngIndex(e){c.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,We(e)?16777215:e)}get latIndex(){const e=c.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return e===16777215?void 0:e}set latIndex(e){c.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,We(e)?16777215:e)}static new(){const e=c.geometryinfodescriptor_new();return J.__wrap(e)}}const Nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetchunk_free(s>>>0,1));class Oe{static __wrap(e){e>>>=0;const t=Object.create(Oe.prototype);return t.__wbg_ptr=e,Nt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Nt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetchunk_free(e,0)}size(){return c.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return c.parquetchunk_hasField(this.__wbg_ptr,e)!==0}readX(e){return c.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return c.parquetchunk_readY(this.__wbg_ptr,e)}readAttributes(e){return D(c.parquetchunk_readAttributes(this.__wbg_ptr,e))}readAttribute(e,t){return D(c.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const $t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetfile_free(s>>>0,1));let zs=class Us{static __wrap(e){e>>>=0;const t=Object.create(Us.prototype);return t.__wbg_ptr=e,$t.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$t.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetfile_free(e,0)}metadata(){const e=c.parquetfile_metadata(this.__wbg_ptr);return ee.__wrap(e)}readChunksWithCallback(e,t){const r=Lt(e,c.__wbindgen_malloc),i=O;return D(c.parquetfile_readChunksWithCallback(this.__wbg_ptr,r,i,m(t)))}updateChunks(e){const t=Lt(e,c.__wbindgen_malloc),r=O;return D(c.parquetfile_updateChunks(this.__wbg_ptr,t,r))}};const Bt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_rangeproviderjs_free(s>>>0,1));class ne{static __wrap(e){e>>>=0;const t=Object.create(ne.prototype);return t.__wbg_ptr=e,Bt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Bt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const r=c.rangeproviderjs_new(m(e),m(t));return ne.__wrap(r)}static withFetch(){const e=c.rangeproviderjs_withFetch();return ne.__wrap(e)}}async function tn(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(r){if(s.headers.get("Content-Type")=="application/wasm")throw r;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",r)}const t=await s.arrayBuffer();return await WebAssembly.instantiate(t,e)}{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function Ws(){const s={wbg:{}};return s.wbg.__wbg_new_abda76e883ba8a5f=function(){return m(new Error)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const r=oe(I(t).stack,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;H().setInt32(e+4,i,!0),H().setInt32(e+0,r,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let r,i;try{r=e,i=t,console.error(X(e,t))}finally{c.__wbindgen_free(r,i,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){D(e)},s.wbg.__wbindgen_is_function=function(e){return typeof I(e)=="function"},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return j(function(){return m(self.self)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return j(function(){return m(window.window)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return j(function(){return m(globalThis.globalThis)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return j(function(){return m(global.global)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return I(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return m(new Function(X(e,t)))},s.wbg.__wbindgen_object_clone_ref=function(e){return m(I(e))},s.wbg.__wbindgen_number_new=function(e){return m(e)},s.wbg.__wbg_new_525245e2b9901204=function(){return m(new Object)},s.wbg.__wbindgen_string_new=function(e,t){return m(X(e,t))},s.wbg.__wbg_call_1084a111329e68ce=function(){return j(function(e,t){return m(I(e).call(I(t)))},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return j(function(e,t,r){return m(I(e).call(I(t),I(r)))},arguments)},s.wbg.__wbg_call_7de908392845a9a5=function(){return j(function(e,t,r,i,n){return m(I(e).call(I(t),I(r),I(i),I(n)))},arguments)},s.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return I(e).valueOf()},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return j(function(e,t,r){return Reflect.set(I(e),I(t),I(r))},arguments)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return m(I(e).buffer)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var r={a:e,b:t},i=(n,a)=>{const o=r.a;r.a=0;try{return Ji(o,r.b,n,a)}finally{r.a=o}};return m(new Promise(i))}finally{r.a=r.b=0}},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){return m(Promise.resolve(I(e)))},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return m(I(e).then(I(t)))},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,r){return m(I(e).then(I(t),I(r)))},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){return m(new Uint8Array(I(e)))},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return I(e).length},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,r){I(e).set(I(t),r>>>0)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(X(e,t))},s.wbg.__wbindgen_memory=function(){return m(c.memory)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return m(I(e).queueMicrotask)},s.wbg.__wbindgen_cb_drop=function(e){const t=D(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(I(e))},s.wbg.__wbg_parquetchunk_new=function(e){return m(Oe.__wrap(e))},s.wbg.__wbindgen_bigint_from_i64=function(e){return m(e)},s.wbg.__wbg_parquetfile_new=function(e){return m(zs.__wrap(e))},s.wbg.__wbg_filemetadata_new=function(e){return m(ee.__wrap(e))},s.wbg.__wbindgen_closure_wrapper1401=function(e,t,r){return m(Xi(e,t,74,Qi))},s}function Gs(s,e){return c=s.exports,Ns.__wbindgen_wasm_module=e,U=null,re=null,se=null,c}function sn(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module:s}=s:console.warn("using deprecated parameters for `initSync()`; pass a single object instead");const e=Ws();return s instanceof WebAssembly.Module||(s=new WebAssembly.Module(s)),Gs(new WebAssembly.Instance(s,e),s)}async function Ns(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead");const e=Ws();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:r}=await tn(await s,e);return Gs(t,r)}const rn=Object.freeze(Object.defineProperty({__proto__:null,FieldMetadata:Ee,FileMetadata:ee,GeometryInfoDescriptor:J,ParquetChunk:Oe,ParquetFile:zs,RangeProviderJs:ne,default:Ns,enableTracing:Zi,initSync:sn,readFile:en,readMetadata:Ls},Symbol.toStringTag,{value:"Module"}));let Ge=null;async function $s(){return Ge||(Ge=nn()),Ge}async function nn(){const s=await Promise.resolve().then(()=>rn);return await s.default({module_or_path:nr("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),s.enableTracing(),s}const Bs=s=>async function(e,t,r){const i=s(),{data:n}=await tt(e,{responseType:"array-buffer",query:i,headers:{range:`bytes=${t}-${r}`}});return n},Vs=s=>async function(e){const t=s(),{data:r}=await tt(e,{responseType:"native",method:"head",query:t}),i=r.headers.get("Content-Length");if(i==null)throw new Error("Unable to parse content length");return parseInt(i,10)};class ve{static async create(e,t){const r=await $s(),i=await r.readMetadata(e,Bs(t),Vs(t));return ve.fromFileMetadata(i)}static fromFileMetadata(e){const t=[];for(let r=0;r65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return"esriGeometryPoint"}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._objectIdFieldIndex!=null?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(;++this._index{const n=Array.from(r).map(a=>i.metadata.getFieldIndex(a));return i.inner.updateChunks(new Uint16Array(n))}))}async load(e){return this._promise==null&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(e){const t=await gt.create(e,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:r}=this._service;Z(this._options);const{fields:i,timeZoneByFieldName:n}=this._service.metadata.fieldsIndex,a=i.map(u=>({...u,index:t.metadata.getFieldIndex(u.name)})),o=de.fromJSON({fields:a,timeZoneByFieldName:n}),d=new Uint16Array(Array.from(this._availableFields.values()).map(u=>o.get(u)?.index));await t.inner.readChunksWithCallback(d,u=>{const h=this._chunkId++,l=new an(this._metadata,o,r,u,h),p=new xe(l,null,h,!1);this._store.insert(p)}),this._files.push(t)}async _download(){try{await Promise.all(this._service.source.urls.map(t=>this._insert(t)));const e=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}class dn extends Ps{constructor(e,t,r,i,n,a){super(e,t,r,n,a),this._random=new Jt(1e3),this._featureCount=i}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return this._promise==null&&(this._promise=this._downloadPages(this._featureCount)),this._promise}unload(e){}async _downloadPages(e){const t=Math.ceil(e/this._queryInfo.pageSize),r=Array.from({length:t},(o,d)=>d).sort((o,d)=>this._random.getInt()-this._random.getInt()),i=await Promise.all(r.map(o=>this._downloadPage(o))),n=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(n);const a=i.filter(o=>o);if(a.length)throw new W("featurelayer-query","Encountered errors when downloading data",{errors:a})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),r=await this._fetch(t,this._options),i=new xe(r,t.inner.toJSON(),e,!1);return Z(this._options),this._store.insert(i),null}catch(t){return t}}}const un="__esri_stream_id__",Vt="__esri_timestamp__",Yt=1e3;class cn{constructor(e,t,r,i,n=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=r,this._purgeOptions=i,this.store=e,this.objectIdField=t,this.purgeInterval=n,this._useGeneratedIds=this.objectIdField===un}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const r of t.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const a=this._nextId();e.attributes[this.objectIdField]=a,e.objectId=a}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new xt(1e5)),void this._trackIdLessObservations.enqueue(t);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const a=this._purgeOptions?.maxObservations!=null?this._purgeOptions.maxObservations:Yt,o=ar(a,0,Yt);this._trackIdToObservations.set(r,new xt(o))}const i=this._trackIdToObservations.get(r),n=i?.enqueue(t);n!=null&&(this._addOrUpdated.has(n)?this._addOrUpdated.delete(n):this._removed.push(n))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const i=[];if(t!=null)for(const a of t){const o=this.store.removeById(a);o!=null&&i.push(o)}const n=[];if(e!=null){const a=new Set(t??[]);for(const o of e)a.has(o.objectId)||(o.attributes[Vt]=r,this.store.add(o),n.push(o))}return!(!n.length&&!i?.length)&&(this.store.update(n,i),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(r=>e[t++]=r),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(t>e.displayCount&&r.size){const i=r.dequeue();this._removed.push(i),t--}}if(this._trackIdLessObservations!=null){let r=t-e.displayCount;for(;r-- >0;){const i=this._trackIdLessObservations.dequeue();i!=null&&this._removed.push(i)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const r=60*e.age*1e3,i=this._maxAge-r;this.store.forEach(n=>{n.attributes[t]{i.attributes[Vt]{e.size===0&&this._trackIdToObservations.delete(t)})}}let B=class extends Ht{constructor(s){super(s)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};V([ge()],B.prototype,"connection",void 0),V([ge()],B.prototype,"connectionStatus",null),V([ge()],B.prototype,"errorString",null),B=V([Xt("esri.views.2d.layers.features.sources.StreamConnectionState")],B);let ln=class{constructor(s,e){this._metadata=s,this._onUpdate=e,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return q.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(s){this._objectIdToFeature.set(s.objectId,s)}forEach(s){this._objectIdToFeature.forEach(s)}removeById(s){const e=this._objectIdToFeature.get(s);return e?(this._objectIdToFeature.delete(s),e):null}clear(){this._objectIdToFeature=new Map}update(s,e){this._onUpdate(s?.length??0)}};class hn extends ue{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class _n extends pt{constructor(e,t,r,i,n){super(r),this._service=e,this._dataFilter=t,this._streamOptions=i,this._metadata=n,this._connectionState=new B,this._forceRefresh=!1,this.events=new st;const{objectIdField:a,timeInfo:o}=this._metadata,{purgeOptions:d}=t;this._stagingStore=new ln(this._metadata,u=>this.events.emit("features-updated",u)),this._manager=new cn(this._stagingStore,a,o,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new hn(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=Zt(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:r,maxReconnectionInterval:i,geometryDefinition:n,definitionExpression:a,customParameters:o}=this._dataFilter;this._connection=Ur(this._service.source,t,this._streamOptions.outSR,e,a,n,r,i,o),this._handlesGroup=Se([this._connection.on("data-received",d=>this._onFeature(d)),this._connection.on("message-received",d=>this._onWebSocketMessage(d))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}}class pn{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new st,this.featureAdapter=new mr}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._localEditChunk!=null&&this._chunksToRemove.push(this._localEditChunk),this._localEditChunk=null}*chunks(){this._localEditChunk&&(yield this._localEditChunk),this._localOverridesChunk&&(yield this._localOverridesChunk),yield*this._chunks.values()}dataChunks(){return this._chunks.values()}insert(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._localOverridesChunk?.overriddenIds.size&&(e.reader.removeIds(this._localOverridesChunk.overriddenIds),e.invalidate()),this._localEditChunk?.overriddenIds.size&&this._localEditChunk.removeOverrides(e),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyLocalOverrides(e,t){this._localOverridesChunk==null&&(this._localOverridesChunk=new Je(t,"localOverride")),this._localOverridesChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localOverridesChunk.overriddenIds),r.invalidate();this.events.emit("changed")}applyLocalEdit(e,t){this._localEditChunk==null&&(this._localEditChunk=new Je(t,"localEdit")),this._localEditChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localEditChunk.overriddenIds),r.invalidate();this.events.emit("changed")}forEach(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i.copy()),t.add(n))}}}forEachUnsafe(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i),t.add(n))}}}forEachInBounds(e,t){const r=new Set;for(const i of this.chunks()){const n=i.queryFeaturesInBounds(e);for(;n.next();){const a=n.getObjectId();r.has(a)||(t(n.copy()),r.add(a))}}}forEachBounds(e,t){const r=rt();for(const i of e)i.getBounds(r)&&t(r)}}class gn{constructor(e,t,r,i,n){this.service=e,this._aggregateAdapter=t,this._subscriptions=r,this._onChange=i,this._connection=n,this._updateTracking=new Wr({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new pn(this._onChange),this._metadata=ot.createFeature(e.metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),this.service.type==="memory"&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return Fi.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,r=this._metadata;this._queryEngine=new as({featureStore:this._store,fieldsIndex:r.fieldsIndex,geometryType:r.geometryType,objectIdField:r.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:r.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._connection.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(Qt(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getLocalEdit(e){return this._updateTracking.addPromise(this._getGetLocalEdit(e))}applyLocalEdit(e){this._didInvalidateData=!0,this._store.applyLocalEdit(e,this.metadata)}async update(e,t){const r=e.source,i=Kt(this._schema?.mutable,r.mutable);if(!i)return!1;if(w("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:i}),this._schema=r,this._queryEngine?.destroy(),this._queryEngine=null,this.service.type==="feature-service"&&this.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),mt(i,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if((r.type==="feature"||r.type==="parquet")&&mt(i,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(r.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(n){this._connection.onEvent({type:"updateFieldsError",error:n})}}return!1}return!(!bt(i,"dataFilter")&&!bt(i,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new ye(this._connection))}async _getGetLocalEdit(e){if(e.historicMoment&&this._schema.type==="feature"&&(this._schema.mutable.dataFilter.historicMoment=e.historicMoment,this._strategy.unsafeSetQueryHistoricMoment(new Date(e.historicMoment))),e.type==="edit-by-feature"){const i=[...e.added,...e.updated].map(n=>Y.fromJSON(n,this.metadata.objectIdField));return{reader:q.fromOptimizedFeatures(i,this.metadata),removed:this._resolveIdentifiers(e.removed)}}const t=this._resolveIdentifiers(e.removed);if(!e.updated.length&&!e.added.length)return{reader:q.empty(this.metadata),removed:t};const r=this._resolveIdentifiers([...e.added,...e.updated]);return{reader:await this._strategy.queryByObjectId(r),removed:t}}_resolveIdentifiers(e){const t=[],r=[];for(const i of e)i.objectId!=null&&i.objectId!==-1?r.push(i.objectId):t.push(i.globalId);if(t.length){const i=new Set(t),n=this.metadata.globalIdField;if(n==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");this._store.forEachUnsafe(a=>{const o=a.readAttribute(n);i.has(o)&&r.push(a.getObjectId())})}return r}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this.service.source,t={...e.query,f:"json"},r=(await tt(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),r=this.service.source&&"collection"in this.service.source,i=e||t||r;if(this._schema.type==="stream"){const d=new _n(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=d,d}if(this._schema.type==="parquet"){const d=this.service;return new on(d,this._metadata,this._schema,this._store)}const n=this.service,a=Ci.fromSchema(n,this._schema,this._metadata),o=await this._supportSnapshotMode(n,a);return o?new dn(n,a,this._store,o.featureCount,this.metadata,this._connection):i?new Vi(n,a,this._store,this.metadata,this._connection):new $i(n,a,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const i=Array.from(this._subscriptions.values());if(!i.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const n=Promise.all(i.map(a=>this._strategy.load(a).then(()=>this._connection.onEvent({type:"loaded",tile:a.tile.id})).catch(o=>this._connection.onEvent({type:"error",tile:a.tile.id,error:o}))));this._updateTracking.addPromise(n);try{r&&await n}catch(a){et(a)}this._connection.onEvent({type:"updateStrategyEnd"}),w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:r}=e,i=r.snapshotInfo;if(!i||!i.supportsSnapshotMinThreshold||!i.snapshotCountThresholds)return null;const n=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const o=(await Rr(n,a.inner,{query:a.customParameters})).data.count,{min:d,max:u}=i.snapshotCountThresholds;return o<=d||i.supportsSnapshotMaxThreshold&&othis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateLocalEditsRequest=null,this._tileInfoView=null}onAttach(e){w("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const t=this._connection,r=hr.fromJSON(e.tileInfoJSON);this._tileInfoView=new _r(r),this._source=new gn(e.service,this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),t),this._processor=new Si(t,this._source),this._handles=Se([Ne(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),Qt(this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){w("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new Gr(e)}get features(){const e=this._source?.queryEngine;if(!e)throw new W("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor?.aggregateQueryEngine;if(!e)throw new W("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}async updateSchema(e,t){return w("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new pe({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new pe(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new pe(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onEdits(e){if(this._updateLocalEditsRequest!=null)throw new W("InternalError - Already processing an edit");this._updateLocalEditsRequest=new pe(e);const t=this._updateLocalEditsRequest.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(Qs(e.radius));let r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const n=typeof e.fieldOffset=="string",a=e.fieldOffset??0,o=Array.from(this._subscriptions.values()),d=this._source.chunks(),u=t**2,h=3/(Math.PI*u),l=2*t,p=Math.ceil(T/l);for(const g of o){const _=g.tile,f=new Float64Array(p*p);for(const y of d){const v=y.getTileReader(_);if(!v)continue;const b=v.getCursor();for(;b.next();){let F=1;if(e.field!=null){const R=b.readAttribute(e.field);F=n?-1*+R:+R+a}const C=b.readXForDisplay()/l,x=b.readYForDisplay()/l,S=Math.floor(C),k=Math.floor(x);if(S<0||k<0||S>=p||k>=p)continue;const E=((.5+S-C)*l)**2+((.5+k-x)*l)**2;if(E>u)continue;const L=F*(h*(1-E/u)**2);f[k+S*p]+=L}}for(let y=0;yd+u.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const d=[];return this._source.store.forEachUnsafe(u=>d.push(u.readLegacyFeatureWorldSpace())),d}return null}const r=new Set,i=[],n=t.map(d=>d.reader.getCursor()),a=new Jt,o=3*e.sampleSize;for(let d=0;d=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,Zs(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=it(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;w("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const r=new pr(this._tileInfoView,t),i=new fn(r,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(w("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const i=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const n of i)this._doUpdateSubscriptions(n.inner),n.resolver.resolve()}const e=this._updateSchemaRequest;if(this._updateSchemaRequest=null,e!=null){const{schema:i,version:n}=e.inner;await this._doUpdateSchema(i,n)}const t=this._updateLocalEditsRequest;if(this._updateLocalEditsRequest=null,t!=null){w("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.inner);const i=await this._source.getLocalEdit(t.inner);await this._processor.applyLocalEdit(i),this._source.applyLocalEdit(i),w("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.inner)}if(this._updateHighlightRequests.length){const i=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const n of i)this._processor.updateHighlight(n.inner),n.resolver.resolve()}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{this._subscriptions.size&&(w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(i){et(i)}t?.resolver.resolve(),e?.resolver.resolve(),this._updateRequested?(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const r={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),n=Array.from(this._subscriptions.values());await this._processor.update(e,t,r,i,n),w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){w("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{eo as default}; diff --git a/main/assets/FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js b/main/assets/FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js new file mode 100644 index 000000000..f464a8869 --- /dev/null +++ b/main/assets/FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js @@ -0,0 +1 @@ +import{aa as te,e as j,v as n,S as o,i as g,bz as M,bL as B,ab as J,eo as f,ac as _,a0 as x,eL as ie,K,P as p,el as O,ah as re,av as se,eD as ne,o as oe,a1 as ae}from"./main-C7yV2j71.js";import{G as le,y as R,h as ue}from"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{m as U,o as F,p as $}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{Y as D,X,s as pe}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{e as S,c as k}from"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import{p as H}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{C as P}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{k as Q}from"./MD5-CHHr-oed-SuyrCYQ0.js";let v=class extends te(j){constructor(i){super(i),this.expression=null,this.title=null,this.returnType=null}};n([o({type:String,json:{write:!0}})],v.prototype,"expression",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"title",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"returnType",void 0),v=n([g("esri.layers.support.ExpressionInfo")],v);const C=v;var V;let c=V=class extends j{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new V({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:p(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};n([o({type:Boolean,json:{write:!0}})],c.prototype,"isAutoGenerated",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"name",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"alias",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"onStatisticField",void 0),n([o({type:C,json:{write:!0}})],c.prototype,"onStatisticExpression",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"statisticType",void 0),c=V=n([g("esri.layers.support.AggregateField")],c);const m=c;var z;let u=z=class extends S{constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=null,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.size=f("12px"),this.fields=[],this.renderer=null}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?F(t,s,e)??void 0:H(s,e)}clone(){return new z({fields:p(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate),renderer:p(this.renderer),binType:p(this.binType),size:this.size})}};n([M({binning:"binning"})],u.prototype,"type",void 0),n([M({geohash:"geohash",square:"square"}),o({type:["geohash","square"]})],u.prototype,"binType",void 0),n([o({type:Number,json:{write:!0}})],u.prototype,"fixedBinLevel",void 0),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],u.prototype,"labelingInfo",void 0),n([o(D)],u.prototype,"labelsVisible",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],u.prototype,"maxScale",void 0),n([o(X)],u.prototype,"popupEnabled",void 0),n([o({type:B,json:{name:"popupInfo",write:!0}})],u.prototype,"popupTemplate",void 0),n([o({cast:i=>i==="auto"?i:J(f(i))})],u.prototype,"size",void 0),n([o({type:[m],json:{write:!0}})],u.prototype,"fields",void 0),n([_("fields")],u.prototype,"writeFields",null),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],u.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],u.prototype,"readRenderer",null),u=z=n([g("esri.layers.support.FeatureReductionBinning")],u);const Z=u;var T;function L(i){return i.type==="simple"&&!i.visualVariables?.length}let l=T=class extends j{constructor(i){super(i),this.type="cluster",this.clusterRadius=f("80px"),this.clusterMinSize=f("12px"),this.clusterMaxSize=f("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t?L(t)?null:F(t,s,e)??void 0:H(s,e)}readSymbol(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t&&L(t)?F(t,s,e)?.symbol:null}writeSymbol(i,s,e,t){const r=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||r){const a=new $({symbol:i});s.drawingInfo={renderer:a.write({},t)}}}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readFields(i,s,e){return i.filter(t=>!t.isAutoGenerated).map(t=>m.fromJSON(t))}clone(){return new T({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,fields:p(this.fields),maxScale:this.maxScale,renderer:p(this.renderer),symbol:p(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate)})}};n([o({type:["cluster"],readOnly:!0,json:{write:!0}})],l.prototype,"type",void 0),n([o({cast:i=>i==="auto"?i:J(f(i)),json:{write:!0}})],l.prototype,"clusterRadius",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMinSize",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMaxSize",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],l.prototype,"maxScale",void 0),n([o(X)],l.prototype,"popupEnabled",void 0),n([o({type:B,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],l.prototype,"popupTemplate",void 0),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],l.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],l.prototype,"readRenderer",null),n([o({types:ie})],l.prototype,"symbol",void 0),n([x("symbol",["drawingInfo.renderer"])],l.prototype,"readSymbol",null),n([_("symbol")],l.prototype,"writeSymbol",null),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],l.prototype,"labelingInfo",void 0),n([o(D)],l.prototype,"labelsVisible",void 0),n([o({type:[m],json:{write:!0}})],l.prototype,"fields",void 0),n([_("fields")],l.prototype,"writeFields",null),n([x("fields")],l.prototype,"readFields",null),l=T=n([g("esri.layers.support.FeatureReductionCluster")],l);const W=l,N={key:"type",base:S,typeMap:{cluster:W,binning:Z}},de={types:{key:"type",base:S,typeMap:{selection:k,cluster:W,binning:Z}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:N},"portal-item":{types:N},"web-scene":{types:{key:"type",base:S,typeMap:{selection:k}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:pe}}}}},ce=()=>ae.getLogger("esri.views.2d.layers.support.clusterUtils");K.add("esri-cluster-arcade-enabled",!0);const fe=K("esri-cluster-arcade-enabled"),ye=new Set(["simple-line","simple-fill","picture-fill"]);function q(i,s){let e=s.clone();if(!me(e))return e;if(s.getSymbols().some(t=>ye.has(t.type))&&(e=new $({symbol:new ne})),e.authoringInfo||(e.authoringInfo=new ue),e.authoringInfo.isAutoGenerated=!0,"visualVariables"in e){const t=(e.visualVariables||[]).filter(r=>r.valueExpression!=="$view.scale");t.forEach(r=>{r.type==="rotation"?r.field?r.field=y(i,r.field,"avg_angle","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg_angle","number"),r.valueExpression=null):r.normalizationField?(r.field=y(i,r.field,"avg_norm","number",r.normalizationField),r.normalizationField=null):r.field?r.field=y(i,r.field,"avg","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg","number"),r.valueExpression=null)}),e.visualVariables=t}switch(e.type){case"simple":break;case"pie-chart":for(const t of e.attributes)t.field?t.field=y(i,t.field,"sum","number"):t.valueExpression&&(t.field=h(i,t.valueExpression,"sum","number"),t.valueExpression=null);break;case"unique-value":e.field?e.field=y(i,e.field,"mode","string"):e.valueExpression&&(e.field=h(i,e.valueExpression,"mode","string"),e.valueExpression=null);break;case"class-breaks":e.normalizationField?(e.field=y(i,e.field,"avg_norm","number",e.normalizationField),e.normalizationField=null):e.field?e.field=y(i,e.field,"avg","number"):e.valueExpression&&(e.field=h(i,e.valueExpression,"avg","number"),e.valueExpression=null)}return e}const me=i=>{const s=e=>ce().error(new oe("Unsupported-renderer",e,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return s("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const e=i.normalizationType;if(e!=="field")return s(`FeatureReductionCluster does not support a normalizationType of ${e}`),!1}break;case"simple":case"pie-chart":break;default:return s(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!fe){if("valueExpression"in i&&i.valueExpression)return s("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return s("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function be(i,s,e){switch(i){case"sum":return`cluster_sum_${s}`;case"avg":case"avg_angle":return`cluster_avg_${s}`;case"mode":return`cluster_type_${s}`;case"avg_norm":{const t=e,r="field",a=s.toLowerCase()+",norm:"+r+","+t.toLowerCase();return"cluster_avg_"+Q(a)}}}function h(i,s,e,t){const r=Q(s),a=e==="mode"?`cluster_type_${r}`:e==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return i.some(d=>d.name===a)||i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:s,returnType:t}),statisticType:e})),a}function y(i,s,e,t,r){if(s==="cluster_count"||i.some(d=>d.name===s))return s;const a=be(e,s,r);return i.some(d=>d.name===a)||(e==="avg_norm"?i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:`$feature.${s} / $feature.${r}`,returnType:t}),statisticType:"avg"})):i.push(new m({name:a,isAutoGenerated:!0,onStatisticField:s,statisticType:e}))),a}const Re=i=>{let s=class extends i{constructor(...e){super(...e),this.addHandles(re(()=>this.renderer,()=>{if(this.featureReduction){const t=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",t)}},se))}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){}_withClusterVariable(e,t,r){const a=e.clone();return"visualVariables"in a&&(a.visualVariables||(a.visualVariables=[]),a.visualVariables.some(d=>d.type==="size")||a.visualVariables.push(new le({field:"cluster_count",stops:[new R({value:1}),new R({useMinValue:!0,size:t}),new R({useMaxValue:!0,size:r})]}))),a}_normalizeFeatureReduction(e){if(e?.type!=="cluster")return e;const t=e.clone(),r=[new m({name:"cluster_count",alias:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],a=(t.fields??[]).filter(b=>!b.isAutoGenerated),d=e.renderer&&!e.renderer.authoringInfo?.isAutoGenerated,{clusterMinSize:E,clusterMaxSize:I}=t;if(d){t.fields=[...r,...a];const b=this._withClusterVariable(t.renderer,E,I);return t.effectiveFeatureRenderer=b,t.effectiveClusterRenderer=b,t}if(e.symbol){if(t.fields=[...r,...a],t.renderer=null,!this.renderer)return t.effectiveFeatureRenderer=null,t.effectiveClusterRenderer=null,t;const b=q(r,this.renderer),w=this._withClusterVariable(b,E,I),Y="visualVariables"in w&&w.visualVariables?w.visualVariables:[],ee=new $({symbol:e.symbol,visualVariables:Y});return t.fields=[...r,...a],t.effectiveFeatureRenderer=w,t.effectiveClusterRenderer=ee,t}if(!this.renderer)return e;const G=q(r,this.renderer);t.fields=[...r,...a],t.renderer=G;const A=this._withClusterVariable(G,E,I);return t.effectiveFeatureRenderer=A,t.effectiveClusterRenderer=A,t}};return n([o(de)],s.prototype,"featureReduction",null),s=n([g("esri.layers.mixins.FeatureReductionLayer")],s),s};export{de as X,Re as v}; diff --git a/main/assets/FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js b/main/assets/FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js deleted file mode 100644 index e200f69a3..000000000 --- a/main/assets/FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as te,e as j,v as n,S as o,i as g,bz as M,bL as B,ab as J,eo as f,ac as _,a0 as x,eL as ie,K,P as p,el as O,ah as re,av as se,eD as ne,o as oe,a1 as ae}from"./main-BZaw9FpY.js";import{G as le,y as R,h as ue}from"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{m as U,o as F,p as $}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{Y as D,X,s as pe}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{e as S,c as k}from"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import{p as H}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{C as P}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{k as Q}from"./MD5-CHHr-oed-SuyrCYQ0.js";let v=class extends te(j){constructor(i){super(i),this.expression=null,this.title=null,this.returnType=null}};n([o({type:String,json:{write:!0}})],v.prototype,"expression",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"title",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"returnType",void 0),v=n([g("esri.layers.support.ExpressionInfo")],v);const C=v;var V;let c=V=class extends j{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new V({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:p(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};n([o({type:Boolean,json:{write:!0}})],c.prototype,"isAutoGenerated",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"name",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"alias",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"onStatisticField",void 0),n([o({type:C,json:{write:!0}})],c.prototype,"onStatisticExpression",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"statisticType",void 0),c=V=n([g("esri.layers.support.AggregateField")],c);const m=c;var z;let u=z=class extends S{constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=null,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.size=f("12px"),this.fields=[],this.renderer=null}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?F(t,s,e)??void 0:H(s,e)}clone(){return new z({fields:p(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate),renderer:p(this.renderer),binType:p(this.binType),size:this.size})}};n([M({binning:"binning"})],u.prototype,"type",void 0),n([M({geohash:"geohash",square:"square"}),o({type:["geohash","square"]})],u.prototype,"binType",void 0),n([o({type:Number,json:{write:!0}})],u.prototype,"fixedBinLevel",void 0),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],u.prototype,"labelingInfo",void 0),n([o(D)],u.prototype,"labelsVisible",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],u.prototype,"maxScale",void 0),n([o(X)],u.prototype,"popupEnabled",void 0),n([o({type:B,json:{name:"popupInfo",write:!0}})],u.prototype,"popupTemplate",void 0),n([o({cast:i=>i==="auto"?i:J(f(i))})],u.prototype,"size",void 0),n([o({type:[m],json:{write:!0}})],u.prototype,"fields",void 0),n([_("fields")],u.prototype,"writeFields",null),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],u.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],u.prototype,"readRenderer",null),u=z=n([g("esri.layers.support.FeatureReductionBinning")],u);const Z=u;var T;function L(i){return i.type==="simple"&&!i.visualVariables?.length}let l=T=class extends j{constructor(i){super(i),this.type="cluster",this.clusterRadius=f("80px"),this.clusterMinSize=f("12px"),this.clusterMaxSize=f("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t?L(t)?null:F(t,s,e)??void 0:H(s,e)}readSymbol(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t&&L(t)?F(t,s,e)?.symbol:null}writeSymbol(i,s,e,t){const r=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||r){const a=new $({symbol:i});s.drawingInfo={renderer:a.write({},t)}}}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readFields(i,s,e){return i.filter(t=>!t.isAutoGenerated).map(t=>m.fromJSON(t))}clone(){return new T({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,fields:p(this.fields),maxScale:this.maxScale,renderer:p(this.renderer),symbol:p(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate)})}};n([o({type:["cluster"],readOnly:!0,json:{write:!0}})],l.prototype,"type",void 0),n([o({cast:i=>i==="auto"?i:J(f(i)),json:{write:!0}})],l.prototype,"clusterRadius",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMinSize",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMaxSize",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],l.prototype,"maxScale",void 0),n([o(X)],l.prototype,"popupEnabled",void 0),n([o({type:B,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],l.prototype,"popupTemplate",void 0),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],l.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],l.prototype,"readRenderer",null),n([o({types:ie})],l.prototype,"symbol",void 0),n([x("symbol",["drawingInfo.renderer"])],l.prototype,"readSymbol",null),n([_("symbol")],l.prototype,"writeSymbol",null),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],l.prototype,"labelingInfo",void 0),n([o(D)],l.prototype,"labelsVisible",void 0),n([o({type:[m],json:{write:!0}})],l.prototype,"fields",void 0),n([_("fields")],l.prototype,"writeFields",null),n([x("fields")],l.prototype,"readFields",null),l=T=n([g("esri.layers.support.FeatureReductionCluster")],l);const W=l,N={key:"type",base:S,typeMap:{cluster:W,binning:Z}},de={types:{key:"type",base:S,typeMap:{selection:k,cluster:W,binning:Z}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:N},"portal-item":{types:N},"web-scene":{types:{key:"type",base:S,typeMap:{selection:k}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:pe}}}}},ce=()=>ae.getLogger("esri.views.2d.layers.support.clusterUtils");K.add("esri-cluster-arcade-enabled",!0);const fe=K("esri-cluster-arcade-enabled"),ye=new Set(["simple-line","simple-fill","picture-fill"]);function q(i,s){let e=s.clone();if(!me(e))return e;if(s.getSymbols().some(t=>ye.has(t.type))&&(e=new $({symbol:new ne})),e.authoringInfo||(e.authoringInfo=new ue),e.authoringInfo.isAutoGenerated=!0,"visualVariables"in e){const t=(e.visualVariables||[]).filter(r=>r.valueExpression!=="$view.scale");t.forEach(r=>{r.type==="rotation"?r.field?r.field=y(i,r.field,"avg_angle","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg_angle","number"),r.valueExpression=null):r.normalizationField?(r.field=y(i,r.field,"avg_norm","number",r.normalizationField),r.normalizationField=null):r.field?r.field=y(i,r.field,"avg","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg","number"),r.valueExpression=null)}),e.visualVariables=t}switch(e.type){case"simple":break;case"pie-chart":for(const t of e.attributes)t.field?t.field=y(i,t.field,"sum","number"):t.valueExpression&&(t.field=h(i,t.valueExpression,"sum","number"),t.valueExpression=null);break;case"unique-value":e.field?e.field=y(i,e.field,"mode","string"):e.valueExpression&&(e.field=h(i,e.valueExpression,"mode","string"),e.valueExpression=null);break;case"class-breaks":e.normalizationField?(e.field=y(i,e.field,"avg_norm","number",e.normalizationField),e.normalizationField=null):e.field?e.field=y(i,e.field,"avg","number"):e.valueExpression&&(e.field=h(i,e.valueExpression,"avg","number"),e.valueExpression=null)}return e}const me=i=>{const s=e=>ce().error(new oe("Unsupported-renderer",e,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return s("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const e=i.normalizationType;if(e!=="field")return s(`FeatureReductionCluster does not support a normalizationType of ${e}`),!1}break;case"simple":case"pie-chart":break;default:return s(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!fe){if("valueExpression"in i&&i.valueExpression)return s("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return s("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function be(i,s,e){switch(i){case"sum":return`cluster_sum_${s}`;case"avg":case"avg_angle":return`cluster_avg_${s}`;case"mode":return`cluster_type_${s}`;case"avg_norm":{const t=e,r="field",a=s.toLowerCase()+",norm:"+r+","+t.toLowerCase();return"cluster_avg_"+Q(a)}}}function h(i,s,e,t){const r=Q(s),a=e==="mode"?`cluster_type_${r}`:e==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return i.some(d=>d.name===a)||i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:s,returnType:t}),statisticType:e})),a}function y(i,s,e,t,r){if(s==="cluster_count"||i.some(d=>d.name===s))return s;const a=be(e,s,r);return i.some(d=>d.name===a)||(e==="avg_norm"?i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:`$feature.${s} / $feature.${r}`,returnType:t}),statisticType:"avg"})):i.push(new m({name:a,isAutoGenerated:!0,onStatisticField:s,statisticType:e}))),a}const Re=i=>{let s=class extends i{constructor(...e){super(...e),this.addHandles(re(()=>this.renderer,()=>{if(this.featureReduction){const t=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",t)}},se))}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){}_withClusterVariable(e,t,r){const a=e.clone();return"visualVariables"in a&&(a.visualVariables||(a.visualVariables=[]),a.visualVariables.some(d=>d.type==="size")||a.visualVariables.push(new le({field:"cluster_count",stops:[new R({value:1}),new R({useMinValue:!0,size:t}),new R({useMaxValue:!0,size:r})]}))),a}_normalizeFeatureReduction(e){if(e?.type!=="cluster")return e;const t=e.clone(),r=[new m({name:"cluster_count",alias:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],a=(t.fields??[]).filter(b=>!b.isAutoGenerated),d=e.renderer&&!e.renderer.authoringInfo?.isAutoGenerated,{clusterMinSize:E,clusterMaxSize:I}=t;if(d){t.fields=[...r,...a];const b=this._withClusterVariable(t.renderer,E,I);return t.effectiveFeatureRenderer=b,t.effectiveClusterRenderer=b,t}if(e.symbol){if(t.fields=[...r,...a],t.renderer=null,!this.renderer)return t.effectiveFeatureRenderer=null,t.effectiveClusterRenderer=null,t;const b=q(r,this.renderer),w=this._withClusterVariable(b,E,I),Y="visualVariables"in w&&w.visualVariables?w.visualVariables:[],ee=new $({symbol:e.symbol,visualVariables:Y});return t.fields=[...r,...a],t.effectiveFeatureRenderer=w,t.effectiveClusterRenderer=ee,t}if(!this.renderer)return e;const G=q(r,this.renderer);t.fields=[...r,...a],t.renderer=G;const A=this._withClusterVariable(G,E,I);return t.effectiveFeatureRenderer=A,t.effectiveClusterRenderer=A,t}};return n([o(de)],s.prototype,"featureReduction",null),s=n([g("esri.layers.mixins.FeatureReductionLayer")],s),s};export{de as X,Re as v}; diff --git a/main/assets/FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js b/main/assets/FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js new file mode 100644 index 000000000..64ed8e677 --- /dev/null +++ b/main/assets/FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js @@ -0,0 +1 @@ +import{e as p,v as r,S as o,i as n}from"./main-C7yV2j71.js";let e=class extends p{constructor(){super(...arguments),this.type=null}};r([o({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,"type",void 0),e=r([n("esri.layers.support.FeatureReduction")],e);var s;let t=s=class extends e{constructor(i){super(i),this.type="selection"}clone(){return new s}};r([o({type:["selection"]})],t.prototype,"type",void 0),t=s=r([n("esri.layers.support.FeatureReductionSelection")],t);const l=t;export{l as c,e}; diff --git a/main/assets/FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js b/main/assets/FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js deleted file mode 100644 index a1cb9c93d..000000000 --- a/main/assets/FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js +++ /dev/null @@ -1 +0,0 @@ -import{e as p,v as r,S as o,i as n}from"./main-BZaw9FpY.js";let e=class extends p{constructor(){super(...arguments),this.type=null}};r([o({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,"type",void 0),e=r([n("esri.layers.support.FeatureReduction")],e);var s;let t=s=class extends e{constructor(i){super(i),this.type="selection"}clone(){return new s}};r([o({type:["selection"]})],t.prototype,"type",void 0),t=s=r([n("esri.layers.support.FeatureReductionSelection")],t);const l=t;export{l as c,e}; diff --git a/main/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-BvoZC5Ky.js b/main/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-BvoZC5Ky.js deleted file mode 100644 index 990e977a1..000000000 --- a/main/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-BvoZC5Ky.js +++ /dev/null @@ -1 +0,0 @@ -import{bh as W,v as d,S as p,i as R,I as se,b as ie,$ as g,J as v,ah as P,av as K,aw as re,g as ne,an as oe,dV as ae,P as z,hm as D,j as X,hn as M,ho as le,hp as O,hq as ue,aF as he,ay as b,W as N,a1 as j,n as ce,hr as de,gI as pe,hs as U,ht as A,gH as H,hu as fe,hv as q,hw as Y,eP as B}from"./main-BZaw9FpY.js";import{i as ee}from"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import{I as _e}from"./FeatureStore-Co2V0sVE-CXrTGv5U.js";import{Z as ge}from"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import{V as I}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{b as S}from"./Query-BrwMGK8U-sojFdYaD.js";import{q as ye,j as me}from"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import{b as te}from"./LRUCache-C3erQTWv-CeYLuvL9.js";import{s as V}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{L as Fe,q as Ce,V as Ee}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{L as Te}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{U as ve}from"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import{w as Se,J as be,q as Ie,P as we}from"./query-DFW9-NG_-1nHUNdNu.js";import{G as Oe}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{r as xe}from"./BoundsStore--N6o1xkF-DBAJ8yky.js";import{e as Re}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";function $(e=!1,t){if(e){const{elevationInfo:s,alignPointsInFeatures:i}=t;return new Pe(s,i)}return new Ae}let Ae=class{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}};const He=1024;let Pe=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new te(He),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return i==null||i.mode!=="absolute-height"||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(De(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const _ of e)oe(i,_.objectId,Me).push(_);const[r,n,o]=this._prepareQuery(i,t),a=await this._alignPointsInFeatures(r,s);if(g(s),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(r,a,n);const{drapedObjectIds:l,failedObjectIds:h}=a,c=[];for(const _ of e){const{objectId:y}=_;l.has(y)&&_.type==="edge"&&(_.draped=!0),h.has(y)||c.push(_)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[r,n]of e){const o=[];for(const a of n)this._addToQueriesOrCachedResult(r,a.target,o,i),a.type==="edge"&&(this._addToQueriesOrCachedResult(r,a.start,o,i),this._addToQueriesOrCachedResult(r,a.end,o,i));o.length!==0&&s.push({objectId:r,points:o})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const r=k(e,t),n=this._alignmentsCache.get(r);n==null?s.push(t):i.push(new ze(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},r){for(const a of r)a.apply();let n=0;const o=this._alignmentsCache;for(const{objectId:a,points:l}of e.pointsInFeatures){if(i.has(a)){n+=l.length;continue}const h=!s.has(a);for(const c of l){const _=k(a,c),y=t[n++];c.z=y,h&&o.put(_,y,1)}}}};class ze{constructor(t,s){this.point=t,this.z=s}apply(){this.point.z=this.z}}function k(e,{x:t,y:s,z:i,spatialReference:r}){return`${e}-${t}-${s}-${i??0}}-wkid:${r?.wkid}`}function De(e,t,s){const{offset:i,unit:r}=s;if(i==null)return;const n=ae(t),o=i*(me(r??"meters")/n);for(const a of e)switch(a.type){case"edge":a.start.z+=o,a.end.z+=o;continue;case"vertex":a.target.z+=o;continue}}function Me(){return[]}let Ne=class{filter(e,t){return t}notifyElevationSourceChange(){}},je=class{filter(e,t){const{point:s,distance:i}=e,{z:r}=s;if(r==null||t.length===0)return t;const n=$e(i),o=this._updateCandidatesTo3D(t,s,n).filter(Ue);return o.sort(ke),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":qe(i,t,s);continue;case"vertex":Ve(i,t,s);continue}return e}};function Ue(e){return e.distance<=1}function L(e=!1){return e?new je:new Ne}function qe(e,t,{x:s,y:i,z:r}){const{start:n,end:o,target:a}=e;e.draped||Be(a,t,n,o);const l=(t.x-a.x)/s,h=(t.y-a.y)/i,c=(t.z-a.z)/r;e.distance=Math.sqrt(l*l+h*h+c*c)}function Be(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,o=i.z-s.z,a=r*r+n*n+o*o,l=(t.x-s.x)*r+(t.y-s.y)*n+o*(t.z-s.z),h=Math.min(1,Math.max(0,l/a)),c=s.x+r*h,_=s.y+n*h,y=s.z+o*h;e.x=c,e.y=_,e.z=y}function Ve(e,t,{x:s,y:i,z:r}){const{target:n}=e,o=(t.x-n.x)/s,a=(t.y-n.y)/i,l=(t.z-n.z)/r,h=Math.sqrt(o*o+a*a+l*l);e.distance=h}function $e(e){return typeof e=="number"?{x:e,y:e,z:e}:e}function ke(e,t){return e.distance-t.distance}function J(e=!1,t){return e?new Qe(t):new Le}class Le{async fetch(){return[]}notifySymbologyChange(){}}const Je=1024;let Qe=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new te(Je),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const s=[],i=[],r=this._candidatesCache;for(const c of e){const _=Q(c),y=r.get(_);if(y)for(const E of y)i.push(z(E));else s.push(c),r.put(_,[],1)}if(s.length===0)return i;const n=this._cacheVersion,{candidates:o,sourceCandidateIndices:a}=await this._getSymbologyCandidates(s,t);if(g(t),n!==this._cacheVersion)return this.fetch(e,t);const l=[],{length:h}=o;for(let c=0;c{const r=await B(s.fetchCount(this,i));this.state.type===u.FETCH_COUNT&&(this.state=Ge(this.state,r.ok?r.value:1/0))})}}_gotoFetchFeatures(t,s){return{type:u.FETCH_FEATURES,previous:t,task:b(async i=>{const r=await B(s.fetchFeatures(this,t.featureCount,i));this.state.type===u.FETCH_FEATURES&&(this.state=We(this.state,r.ok?r.value:[]))})}}_goToDone(t,s){return s.finish(this,t.features),{type:u.DONE,previous:t}}reset(){const t=this.state;switch(this.state={type:u.CREATED},t.type){case u.CREATED:case u.FETCHED_COUNT:case u.FETCHED_FEATURES:case u.DONE:break;case u.FETCH_COUNT:case u.FETCH_FEATURES:t.task.abort()}}intersects(t){return t==null||!this.data.extent||(H(t,Z),A(this.data.extent,Z))}}function Ge(e,t){return{type:u.FETCHED_COUNT,featureCount:t,previous:e}}function We(e,t){return{type:u.FETCHED_FEATURES,previous:e,features:t}}var u;(function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"})(u||(u={}));const Z=W();let f=class extends X{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=M(e,this._mandatoryOutFields);le(s,t)||(this._set("outFields",s),O(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(e!=null&&t!=null&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new ee}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(e,t)=>{ue(e,t,({id:s},{id:i})=>s===i)||this._process()},K),this.addHandles(he(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const i of this._pendingTiles.values())i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))},s=b(async i=>{try{await this.store.processEdits(t,(r,n)=>this._queryFeaturesById(r,n),i),this._processPendingTiles()}catch(r){N(r),j.getLogger(this).warn("Failed to apply edits",r)}});this.addHandles(s),await this._updatingHandles.addPromise(s.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Te(this.url))return;const e=b(async t=>{try{const s=await Se(this.url,new S({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:t});this.store.extent=ce.fromJSON(s.data?.extent)}catch(s){N(s),j.getLogger(this).warn("Failed to fetch data extent",s)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:t,resolution:s}of e.missingTiles){const i=this._pendingTiles.get(t.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n),this.outFields);e==null?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(t,s)=>this._fetchCount(t,s),fetchFeatures:(t,s,i)=>this._fetchFeatures(t,s,i),finish:(t,s)=>this._finishPendingTile(t,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{r===V(n.attributes[t])&&(i=n.objectId??n.attributes[s])}),i==null)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await be(this.url,e,new ve({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:w,signal:t});return Fe(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await Ie(this.url,e,s,{query:this._configuration.customParameters,timeout:w,signal:t});return Ce(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=e?.data!=null?this.store.getAttributesForTile(e?.data?.id):null,i=M(de(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new S({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:this.tileInfo!=null&&e!=null?pe(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?S.MAX_MAX_RECORD_COUNT_FACTOR:1,h=l*((a||r)&&n?n:o||Ke);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/h)),e.num=Math.min(s,e.maxRecordCountFactor*h)):e.num=Math.min(s,h),!0}};d([p({constructOnly:!0})],f.prototype,"url",void 0),d([p({constructOnly:!0})],f.prototype,"objectIdField",void 0),d([p({constructOnly:!0})],f.prototype,"globalIdField",void 0),d([p({constructOnly:!0})],f.prototype,"capabilities",void 0),d([p({constructOnly:!0})],f.prototype,"sourceSpatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"spatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"store",void 0),d([p({readOnly:!0})],f.prototype,"_minimumVerticesPerFeature",null),d([p()],f.prototype,"_mandatoryOutFields",null),d([p()],f.prototype,"outFields",null),d([p()],f.prototype,"suspended",void 0),d([p()],f.prototype,"_historicMoment",void 0),d([p()],f.prototype,"filter",null),d([p()],f.prototype,"customParameters",null),d([p({readOnly:!0})],f.prototype,"_configuration",null),d([p()],f.prototype,"tileInfo",null),d([p()],f.prototype,"tileSize",null),d([p()],f.prototype,"tilesOfInterest",void 0),d([p({readOnly:!0})],f.prototype,"updating",null),d([p({readOnly:!0})],f.prototype,"availability",void 0),d([p()],f.prototype,"hasZ",null),f=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],f);const Ke=2e3,w=6e5,Xe=1e6,Ye=25,et=1;class tt{constructor(){this._store=new Map,this._byteSize=0}set(t,s){this.delete(t),this._store.set(t,s),this._byteSize+=s.byteSize}delete(t){const s=this._store.get(t);return!!this._store.delete(t)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(t){return this._used(t),this._store.get(t)}has(t){return this._used(t),this._store.has(t)}clear(){this._store.clear()}applyByteSizeLimit(t,s){for(const[i,r]of this._store){if(this._byteSize<=t)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(t){const s=this._store.get(t);s&&(this._store.delete(t),this._store.set(t,s))}}let F=class extends X{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Oe.MEGABYTES,this._tileBounds=new xe,this._tiles=new tt,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=W()}add(e,t){for(const r of t)this._referenceFeature(r.objectId);const s=this.featureStore.upsertMany(t),i=s.map(r=>new Set(Object.keys(r.attributes))).reduce((r,n)=>U(r,n),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map(r=>r.objectId)),it(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,r=>this._removeTileStorage(r))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const r=e.id;this._tiles.set(r,new ot(e,t,s,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)this._unreferenceFeature(i)===C.REMOVED&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const o of i){const a=Ee(this._tmpBoundingRect,o.geometry,r,n);a!=null&&this._tileBounds.forEachInBounds(a,l=>{const h=this._tiles.get(l);this.featureStore.add(o);const c=o.objectId;h.objectIds.has(c)||(h.objectIds.add(c),this._referenceFeature(c),this._tileFeatureCounts.set(h.data.id,h.objectIds.size))})}}process(e,t=()=>!0,s){if(this.tileInfo==null||!e.extent||this.extent!=null&&!A(H(this.extent,this._tmpBoundingRect),e.extent))return new x(e);const i=this.getAttributesForTile(e.id);if(O(s,i))return new x(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(r!=null)return r;const n=await we(t,s,i);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new G(e.level,e.row,e.col);return t.updateTileInfo(s,I.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.data;r&&st(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const n=t.row>>r,o=t.col>>r,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),h=e.children[l];if(h!=null)this._populateChildren(h,t,s,i);else{const c=new G(e.level+1,n,o);s.updateTileInfo(c,I.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=c,this._populateChildren(c,t,s,i)}}_simplify(e,t,s,i,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),s!=null&&(s.children[i]=null),n);const o=r/2,a=o*o;let l=0;for(let h=0;h{const n=this._tiles.get(r.id);if(n){s=s?U(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const o of n.objectIds)t.has(o)||(t.add(o),this._referenceFeature(o));this._remove(r)}}),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)s!=null&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&a),o):this._collectMissingTilesRecurse(l,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?C.ADDED:C.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),C.REMOVED):(t>0&&this._refCounts.set(e,t),C.UNCHANGED)}get test(){}};function st(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.levelt+rt(s),0)}function rt(e){return 32+nt(e.geometry)+fe(e.attributes)}function nt(e){if(e==null)return 0;const t=q(e.lengths,4);return 32+q(e.coords,8)+t}d([p({constructOnly:!0})],F.prototype,"featureStore",void 0),d([p()],F.prototype,"tileInfo",void 0),d([p()],F.prototype,"extent",void 0),d([p()],F.prototype,"maximumByteSize",void 0),F=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],F);let ot=class{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}};class G{constructor(t,s,i){this.level=t,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}}let x=class{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=Y(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},at=class{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new x(t),s!=null&&(this._extent=H(s))}addMissing(e,t,s,i){const r=new Re(null,e,t,s);this._tileInfo.updateTileInfo(r,I.ExtrapolateOptions.POWER_OF_TWO),r.extent==null||this._extent!=null&&!A(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=Y(r.extent))}};const lt=.18751;var C;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"})(C||(C={}));let T=class extends se.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=ie(),this._elevationAligner=$(),this._elevationFilter=L(),this._symbologyCandidatesFetcher=J(),this._updatingHandles=new ee,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return g(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return g(t),i}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:r}=e.serviceInfo,{hasZ:n}=e,o=v.fromJSON(e.spatialReference);this._spatialReference=o,this._featureStore=new _e({...e.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new ge({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new f({store:new F({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:o,sourceSpatialReference:v.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const a=e.configuration.viewType==="3d";return this._elevationAligner=$(a,{elevationInfo:e.elevationInfo!=null?ye.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=L(a),this.addHandles([P(()=>this._featureFetcher.availability,l=>this.emit("notify-availability",{availability:l}),K),P(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),m}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.suspended=e,m}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.outFields=new Set(e??[]),m}async fetchCandidates(e,t){await this._whenSetup.promise,g(t);const s=ut(e),i=t?.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);g(i);const n=await this._elevationAligner.alignCandidates(r.candidates,v.fromJSON(e.point.spatialReference)??v.WGS84,i);g(i);const o=await this._symbologyCandidatesFetcher.fetch(n,i);g(i);const a=o.length===0?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(s,a)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?I.fromJSON(e.tileInfo):null,m}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.refresh(),m}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await re(()=>!this.updating,t),g(t),m}async getDebugInfo(e,t){return g(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),g(t),m}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),m}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),m}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),m}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=J(e,this._getSymbologyCandidates),m}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?S.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};d([p({readOnly:!0})],T.prototype,"updating",null),d([p()],T.prototype,"_isInitializing",void 0),T=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],T);const fs=T;function ut(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:o}=e.filter,a={geometry:e.filter.geometry?ne(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:n,objectIds:o,where:r??"1=1"};return{...e,query:a}}const m={result:{}};export{fs as default}; diff --git a/main/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CxGGk2Se.js b/main/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CxGGk2Se.js new file mode 100644 index 000000000..1703dd708 --- /dev/null +++ b/main/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CxGGk2Se.js @@ -0,0 +1 @@ +import{bh as W,v as d,S as p,i as R,I as se,b as ie,$ as g,J as v,ah as P,av as K,aw as re,g as ne,an as oe,dV as ae,P as z,hm as D,j as X,hn as M,ho as le,hp as O,hq as ue,aF as he,ay as b,W as N,a1 as j,n as ce,hr as de,gI as pe,hs as U,ht as A,gH as H,hu as fe,hv as q,hw as Y,eP as B}from"./main-C7yV2j71.js";import{i as ee}from"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import{I as _e}from"./FeatureStore-Co2V0sVE-BoTs_3tu.js";import{Z as ge}from"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import{V as I}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{b as S}from"./Query-BrwMGK8U-DV_czrJX.js";import{q as ye,j as me}from"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import{b as te}from"./LRUCache-C3erQTWv-DhyPlt5p.js";import{s as V}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{L as Fe,q as Ce,V as Ee}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{L as Te}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{U as ve}from"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import{w as Se,J as be,q as Ie,P as we}from"./query-DFW9-NG_-CfusC8cS.js";import{G as Oe}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{r as xe}from"./BoundsStore--N6o1xkF-mEMXylgh.js";import{e as Re}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";function $(e=!1,t){if(e){const{elevationInfo:s,alignPointsInFeatures:i}=t;return new Pe(s,i)}return new Ae}let Ae=class{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}};const He=1024;let Pe=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new te(He),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return i==null||i.mode!=="absolute-height"||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(De(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const _ of e)oe(i,_.objectId,Me).push(_);const[r,n,o]=this._prepareQuery(i,t),a=await this._alignPointsInFeatures(r,s);if(g(s),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(r,a,n);const{drapedObjectIds:l,failedObjectIds:h}=a,c=[];for(const _ of e){const{objectId:y}=_;l.has(y)&&_.type==="edge"&&(_.draped=!0),h.has(y)||c.push(_)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[r,n]of e){const o=[];for(const a of n)this._addToQueriesOrCachedResult(r,a.target,o,i),a.type==="edge"&&(this._addToQueriesOrCachedResult(r,a.start,o,i),this._addToQueriesOrCachedResult(r,a.end,o,i));o.length!==0&&s.push({objectId:r,points:o})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const r=k(e,t),n=this._alignmentsCache.get(r);n==null?s.push(t):i.push(new ze(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},r){for(const a of r)a.apply();let n=0;const o=this._alignmentsCache;for(const{objectId:a,points:l}of e.pointsInFeatures){if(i.has(a)){n+=l.length;continue}const h=!s.has(a);for(const c of l){const _=k(a,c),y=t[n++];c.z=y,h&&o.put(_,y,1)}}}};class ze{constructor(t,s){this.point=t,this.z=s}apply(){this.point.z=this.z}}function k(e,{x:t,y:s,z:i,spatialReference:r}){return`${e}-${t}-${s}-${i??0}}-wkid:${r?.wkid}`}function De(e,t,s){const{offset:i,unit:r}=s;if(i==null)return;const n=ae(t),o=i*(me(r??"meters")/n);for(const a of e)switch(a.type){case"edge":a.start.z+=o,a.end.z+=o;continue;case"vertex":a.target.z+=o;continue}}function Me(){return[]}let Ne=class{filter(e,t){return t}notifyElevationSourceChange(){}},je=class{filter(e,t){const{point:s,distance:i}=e,{z:r}=s;if(r==null||t.length===0)return t;const n=$e(i),o=this._updateCandidatesTo3D(t,s,n).filter(Ue);return o.sort(ke),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":qe(i,t,s);continue;case"vertex":Ve(i,t,s);continue}return e}};function Ue(e){return e.distance<=1}function L(e=!1){return e?new je:new Ne}function qe(e,t,{x:s,y:i,z:r}){const{start:n,end:o,target:a}=e;e.draped||Be(a,t,n,o);const l=(t.x-a.x)/s,h=(t.y-a.y)/i,c=(t.z-a.z)/r;e.distance=Math.sqrt(l*l+h*h+c*c)}function Be(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,o=i.z-s.z,a=r*r+n*n+o*o,l=(t.x-s.x)*r+(t.y-s.y)*n+o*(t.z-s.z),h=Math.min(1,Math.max(0,l/a)),c=s.x+r*h,_=s.y+n*h,y=s.z+o*h;e.x=c,e.y=_,e.z=y}function Ve(e,t,{x:s,y:i,z:r}){const{target:n}=e,o=(t.x-n.x)/s,a=(t.y-n.y)/i,l=(t.z-n.z)/r,h=Math.sqrt(o*o+a*a+l*l);e.distance=h}function $e(e){return typeof e=="number"?{x:e,y:e,z:e}:e}function ke(e,t){return e.distance-t.distance}function J(e=!1,t){return e?new Qe(t):new Le}class Le{async fetch(){return[]}notifySymbologyChange(){}}const Je=1024;let Qe=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new te(Je),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const s=[],i=[],r=this._candidatesCache;for(const c of e){const _=Q(c),y=r.get(_);if(y)for(const E of y)i.push(z(E));else s.push(c),r.put(_,[],1)}if(s.length===0)return i;const n=this._cacheVersion,{candidates:o,sourceCandidateIndices:a}=await this._getSymbologyCandidates(s,t);if(g(t),n!==this._cacheVersion)return this.fetch(e,t);const l=[],{length:h}=o;for(let c=0;c{const r=await B(s.fetchCount(this,i));this.state.type===u.FETCH_COUNT&&(this.state=Ge(this.state,r.ok?r.value:1/0))})}}_gotoFetchFeatures(t,s){return{type:u.FETCH_FEATURES,previous:t,task:b(async i=>{const r=await B(s.fetchFeatures(this,t.featureCount,i));this.state.type===u.FETCH_FEATURES&&(this.state=We(this.state,r.ok?r.value:[]))})}}_goToDone(t,s){return s.finish(this,t.features),{type:u.DONE,previous:t}}reset(){const t=this.state;switch(this.state={type:u.CREATED},t.type){case u.CREATED:case u.FETCHED_COUNT:case u.FETCHED_FEATURES:case u.DONE:break;case u.FETCH_COUNT:case u.FETCH_FEATURES:t.task.abort()}}intersects(t){return t==null||!this.data.extent||(H(t,Z),A(this.data.extent,Z))}}function Ge(e,t){return{type:u.FETCHED_COUNT,featureCount:t,previous:e}}function We(e,t){return{type:u.FETCHED_FEATURES,previous:e,features:t}}var u;(function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"})(u||(u={}));const Z=W();let f=class extends X{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=M(e,this._mandatoryOutFields);le(s,t)||(this._set("outFields",s),O(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(e!=null&&t!=null&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new ee}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(e,t)=>{ue(e,t,({id:s},{id:i})=>s===i)||this._process()},K),this.addHandles(he(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const i of this._pendingTiles.values())i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))},s=b(async i=>{try{await this.store.processEdits(t,(r,n)=>this._queryFeaturesById(r,n),i),this._processPendingTiles()}catch(r){N(r),j.getLogger(this).warn("Failed to apply edits",r)}});this.addHandles(s),await this._updatingHandles.addPromise(s.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Te(this.url))return;const e=b(async t=>{try{const s=await Se(this.url,new S({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:t});this.store.extent=ce.fromJSON(s.data?.extent)}catch(s){N(s),j.getLogger(this).warn("Failed to fetch data extent",s)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:t,resolution:s}of e.missingTiles){const i=this._pendingTiles.get(t.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n),this.outFields);e==null?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(t,s)=>this._fetchCount(t,s),fetchFeatures:(t,s,i)=>this._fetchFeatures(t,s,i),finish:(t,s)=>this._finishPendingTile(t,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{r===V(n.attributes[t])&&(i=n.objectId??n.attributes[s])}),i==null)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await be(this.url,e,new ve({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:w,signal:t});return Fe(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await Ie(this.url,e,s,{query:this._configuration.customParameters,timeout:w,signal:t});return Ce(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=e?.data!=null?this.store.getAttributesForTile(e?.data?.id):null,i=M(de(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new S({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:this.tileInfo!=null&&e!=null?pe(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?S.MAX_MAX_RECORD_COUNT_FACTOR:1,h=l*((a||r)&&n?n:o||Ke);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/h)),e.num=Math.min(s,e.maxRecordCountFactor*h)):e.num=Math.min(s,h),!0}};d([p({constructOnly:!0})],f.prototype,"url",void 0),d([p({constructOnly:!0})],f.prototype,"objectIdField",void 0),d([p({constructOnly:!0})],f.prototype,"globalIdField",void 0),d([p({constructOnly:!0})],f.prototype,"capabilities",void 0),d([p({constructOnly:!0})],f.prototype,"sourceSpatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"spatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"store",void 0),d([p({readOnly:!0})],f.prototype,"_minimumVerticesPerFeature",null),d([p()],f.prototype,"_mandatoryOutFields",null),d([p()],f.prototype,"outFields",null),d([p()],f.prototype,"suspended",void 0),d([p()],f.prototype,"_historicMoment",void 0),d([p()],f.prototype,"filter",null),d([p()],f.prototype,"customParameters",null),d([p({readOnly:!0})],f.prototype,"_configuration",null),d([p()],f.prototype,"tileInfo",null),d([p()],f.prototype,"tileSize",null),d([p()],f.prototype,"tilesOfInterest",void 0),d([p({readOnly:!0})],f.prototype,"updating",null),d([p({readOnly:!0})],f.prototype,"availability",void 0),d([p()],f.prototype,"hasZ",null),f=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],f);const Ke=2e3,w=6e5,Xe=1e6,Ye=25,et=1;class tt{constructor(){this._store=new Map,this._byteSize=0}set(t,s){this.delete(t),this._store.set(t,s),this._byteSize+=s.byteSize}delete(t){const s=this._store.get(t);return!!this._store.delete(t)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(t){return this._used(t),this._store.get(t)}has(t){return this._used(t),this._store.has(t)}clear(){this._store.clear()}applyByteSizeLimit(t,s){for(const[i,r]of this._store){if(this._byteSize<=t)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(t){const s=this._store.get(t);s&&(this._store.delete(t),this._store.set(t,s))}}let F=class extends X{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Oe.MEGABYTES,this._tileBounds=new xe,this._tiles=new tt,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=W()}add(e,t){for(const r of t)this._referenceFeature(r.objectId);const s=this.featureStore.upsertMany(t),i=s.map(r=>new Set(Object.keys(r.attributes))).reduce((r,n)=>U(r,n),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map(r=>r.objectId)),it(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,r=>this._removeTileStorage(r))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const r=e.id;this._tiles.set(r,new ot(e,t,s,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)this._unreferenceFeature(i)===C.REMOVED&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const o of i){const a=Ee(this._tmpBoundingRect,o.geometry,r,n);a!=null&&this._tileBounds.forEachInBounds(a,l=>{const h=this._tiles.get(l);this.featureStore.add(o);const c=o.objectId;h.objectIds.has(c)||(h.objectIds.add(c),this._referenceFeature(c),this._tileFeatureCounts.set(h.data.id,h.objectIds.size))})}}process(e,t=()=>!0,s){if(this.tileInfo==null||!e.extent||this.extent!=null&&!A(H(this.extent,this._tmpBoundingRect),e.extent))return new x(e);const i=this.getAttributesForTile(e.id);if(O(s,i))return new x(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(r!=null)return r;const n=await we(t,s,i);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new G(e.level,e.row,e.col);return t.updateTileInfo(s,I.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.data;r&&st(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const n=t.row>>r,o=t.col>>r,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),h=e.children[l];if(h!=null)this._populateChildren(h,t,s,i);else{const c=new G(e.level+1,n,o);s.updateTileInfo(c,I.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=c,this._populateChildren(c,t,s,i)}}_simplify(e,t,s,i,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),s!=null&&(s.children[i]=null),n);const o=r/2,a=o*o;let l=0;for(let h=0;h{const n=this._tiles.get(r.id);if(n){s=s?U(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const o of n.objectIds)t.has(o)||(t.add(o),this._referenceFeature(o));this._remove(r)}}),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)s!=null&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&a),o):this._collectMissingTilesRecurse(l,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?C.ADDED:C.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),C.REMOVED):(t>0&&this._refCounts.set(e,t),C.UNCHANGED)}get test(){}};function st(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.levelt+rt(s),0)}function rt(e){return 32+nt(e.geometry)+fe(e.attributes)}function nt(e){if(e==null)return 0;const t=q(e.lengths,4);return 32+q(e.coords,8)+t}d([p({constructOnly:!0})],F.prototype,"featureStore",void 0),d([p()],F.prototype,"tileInfo",void 0),d([p()],F.prototype,"extent",void 0),d([p()],F.prototype,"maximumByteSize",void 0),F=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],F);let ot=class{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}};class G{constructor(t,s,i){this.level=t,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}}let x=class{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=Y(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},at=class{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new x(t),s!=null&&(this._extent=H(s))}addMissing(e,t,s,i){const r=new Re(null,e,t,s);this._tileInfo.updateTileInfo(r,I.ExtrapolateOptions.POWER_OF_TWO),r.extent==null||this._extent!=null&&!A(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=Y(r.extent))}};const lt=.18751;var C;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"})(C||(C={}));let T=class extends se.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=ie(),this._elevationAligner=$(),this._elevationFilter=L(),this._symbologyCandidatesFetcher=J(),this._updatingHandles=new ee,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return g(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return g(t),i}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:r}=e.serviceInfo,{hasZ:n}=e,o=v.fromJSON(e.spatialReference);this._spatialReference=o,this._featureStore=new _e({...e.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new ge({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new f({store:new F({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:o,sourceSpatialReference:v.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const a=e.configuration.viewType==="3d";return this._elevationAligner=$(a,{elevationInfo:e.elevationInfo!=null?ye.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=L(a),this.addHandles([P(()=>this._featureFetcher.availability,l=>this.emit("notify-availability",{availability:l}),K),P(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),m}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.suspended=e,m}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.outFields=new Set(e??[]),m}async fetchCandidates(e,t){await this._whenSetup.promise,g(t);const s=ut(e),i=t?.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);g(i);const n=await this._elevationAligner.alignCandidates(r.candidates,v.fromJSON(e.point.spatialReference)??v.WGS84,i);g(i);const o=await this._symbologyCandidatesFetcher.fetch(n,i);g(i);const a=o.length===0?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(s,a)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?I.fromJSON(e.tileInfo):null,m}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.refresh(),m}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await re(()=>!this.updating,t),g(t),m}async getDebugInfo(e,t){return g(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),g(t),m}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),m}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),m}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),m}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=J(e,this._getSymbologyCandidates),m}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?S.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};d([p({readOnly:!0})],T.prototype,"updating",null),d([p()],T.prototype,"_isInitializing",void 0),T=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],T);const fs=T;function ut(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:o}=e.filter,a={geometry:e.filter.geometry?ne(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:n,objectIds:o,where:r??"1=1"};return{...e,query:a}}const m={result:{}};export{fs as default}; diff --git a/main/assets/FeatureSet-BkVNthuN-D0ikVdR5.js b/main/assets/FeatureSet-BkVNthuN-D0ikVdR5.js deleted file mode 100644 index 5efbab734..000000000 --- a/main/assets/FeatureSet-BkVNthuN-D0ikVdR5.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as S,v as h,S as d,bi as N,a0 as G,ac as z,af as T,J as R,i as P,e as j,g as F,P as J,cN as x}from"./main-BZaw9FpY.js";import{y as q}from"./Field-C6hA1tZj-CbELM0zp.js";var v;const w=new S({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let c=v=class extends j{constructor(n){super(n),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(n,a){const o=R.fromJSON(a.spatialReference),e=[];for(let s=0;s0)for(let o=0;oMath.round((t-e)/a),i=t=>Math.round((s-t)/o),m=this.features,u=this._getQuantizationFunction(this.geometryType,r,i);for(let t=0,y=m.length;tp*r+e,u=p=>s-p*i;let t=null,y=null;if(this.hasZ&&o?.scale?.[2]!=null){const{translate:[,,p],scale:[,,g]}=o;t=f=>f*g+p}if(this.hasM&&o?.scale?.[3]!=null){const{translate:[,,,p],scale:[,,,g]}=o;y=f=>f==null?f:f*g+p}const l=this._getHydrationFunction(n,m,u,t,y);for(const{geometry:p}of a)p!=null&&l&&l(p);return this.transform=null,this}_quantizePoints(n,a,o){let e,s;const r=[];for(let i=0,m=n.length;i0){const t=a(u[0]),y=o(u[1]);t===e&&y===s||(r.push([t-e,y-s]),e=t,s=y)}else e=a(u[0]),s=o(u[1]),r.push([e,s])}return r.length>0?r:null}_getQuantizationFunction(n,a,o){return n==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):n==="polyline"||n==="polygon"?e=>{const s=x(e)?e.rings:e.paths,r=[];for(let i=0,m=s.length;i0?(x(e)?e.rings=r:e.paths=r,e):null}:n==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:n==="extent"?e=>e:null}_getHydrationFunction(n,a,o,e,s){return n==="point"?r=>{r.x=a(r.x),r.y=o(r.y),e&&(r.z=e(r.z))}:n==="polyline"||n==="polygon"?r=>{const i=x(r)?r.rings:r.paths;let m,u;for(let t=0,y=i.length;t0?(m+=f[0],u+=f[1]):(m=f[0],u=f[1]),f[0]=a(m),f[1]=o(u)}}if(e&&s)for(let t=0,y=i.length;t{r.xmin=a(r.xmin),r.ymin=o(r.ymin),r.xmax=a(r.xmax),r.ymax=o(r.ymax),e&&r.zmax!=null&&r.zmin!=null&&(r.zmax=e(r.zmax),r.zmin=e(r.zmin)),s&&r.mmax!=null&&r.mmin!=null&&(r.mmax=s(r.mmax),r.mmin=s(r.mmin))}:n==="multipoint"?r=>{const i=r.points;let m,u;for(let t=0,y=i.length;t0?(m+=l[0],u+=l[1]):(m=l[0],u=l[1]),l[0]=a(m),l[1]=o(u)}if(e&&s)for(let t=0,y=i.length;t({enabled:n})}}})],c.prototype,"exceededTransferLimit",void 0),h([d({type:[N],json:{write:!0}})],c.prototype,"features",void 0),h([G("features")],c.prototype,"readFeatures",null),h([d({type:[q],json:{write:!0}})],c.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],c.prototype,"geometryType",void 0),h([z("geometryType")],c.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasZ",void 0),h([d({types:T,json:{write:!0}})],c.prototype,"queryGeometry",void 0),h([G("queryGeometry")],c.prototype,"readQueryGeometry",null),h([d({type:R,json:{write:!0}})],c.prototype,"spatialReference",void 0),h([z("spatialReference")],c.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],c.prototype,"transform",void 0),c=v=h([P("esri.rest.support.FeatureSet")],c),c.prototype.toJSON.isDefaultToJSON=!0;const M=c;export{M as O}; diff --git a/main/assets/FeatureSet-BkVNthuN-DDwR53LR.js b/main/assets/FeatureSet-BkVNthuN-DDwR53LR.js new file mode 100644 index 000000000..935510403 --- /dev/null +++ b/main/assets/FeatureSet-BkVNthuN-DDwR53LR.js @@ -0,0 +1 @@ +import{aK as S,v as h,S as d,bi as N,a0 as G,ac as z,af as T,J as R,i as P,e as j,g as F,P as J,cN as x}from"./main-C7yV2j71.js";import{y as q}from"./Field-C6hA1tZj-C0Sp7XvY.js";var v;const w=new S({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let c=v=class extends j{constructor(n){super(n),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(n,a){const o=R.fromJSON(a.spatialReference),e=[];for(let s=0;s0)for(let o=0;oMath.round((t-e)/a),i=t=>Math.round((s-t)/o),m=this.features,u=this._getQuantizationFunction(this.geometryType,r,i);for(let t=0,y=m.length;tp*r+e,u=p=>s-p*i;let t=null,y=null;if(this.hasZ&&o?.scale?.[2]!=null){const{translate:[,,p],scale:[,,g]}=o;t=f=>f*g+p}if(this.hasM&&o?.scale?.[3]!=null){const{translate:[,,,p],scale:[,,,g]}=o;y=f=>f==null?f:f*g+p}const l=this._getHydrationFunction(n,m,u,t,y);for(const{geometry:p}of a)p!=null&&l&&l(p);return this.transform=null,this}_quantizePoints(n,a,o){let e,s;const r=[];for(let i=0,m=n.length;i0){const t=a(u[0]),y=o(u[1]);t===e&&y===s||(r.push([t-e,y-s]),e=t,s=y)}else e=a(u[0]),s=o(u[1]),r.push([e,s])}return r.length>0?r:null}_getQuantizationFunction(n,a,o){return n==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):n==="polyline"||n==="polygon"?e=>{const s=x(e)?e.rings:e.paths,r=[];for(let i=0,m=s.length;i0?(x(e)?e.rings=r:e.paths=r,e):null}:n==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:n==="extent"?e=>e:null}_getHydrationFunction(n,a,o,e,s){return n==="point"?r=>{r.x=a(r.x),r.y=o(r.y),e&&(r.z=e(r.z))}:n==="polyline"||n==="polygon"?r=>{const i=x(r)?r.rings:r.paths;let m,u;for(let t=0,y=i.length;t0?(m+=f[0],u+=f[1]):(m=f[0],u=f[1]),f[0]=a(m),f[1]=o(u)}}if(e&&s)for(let t=0,y=i.length;t{r.xmin=a(r.xmin),r.ymin=o(r.ymin),r.xmax=a(r.xmax),r.ymax=o(r.ymax),e&&r.zmax!=null&&r.zmin!=null&&(r.zmax=e(r.zmax),r.zmin=e(r.zmin)),s&&r.mmax!=null&&r.mmin!=null&&(r.mmax=s(r.mmax),r.mmin=s(r.mmin))}:n==="multipoint"?r=>{const i=r.points;let m,u;for(let t=0,y=i.length;t0?(m+=l[0],u+=l[1]):(m=l[0],u=l[1]),l[0]=a(m),l[1]=o(u)}if(e&&s)for(let t=0,y=i.length;t({enabled:n})}}})],c.prototype,"exceededTransferLimit",void 0),h([d({type:[N],json:{write:!0}})],c.prototype,"features",void 0),h([G("features")],c.prototype,"readFeatures",null),h([d({type:[q],json:{write:!0}})],c.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],c.prototype,"geometryType",void 0),h([z("geometryType")],c.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasZ",void 0),h([d({types:T,json:{write:!0}})],c.prototype,"queryGeometry",void 0),h([G("queryGeometry")],c.prototype,"readQueryGeometry",null),h([d({type:R,json:{write:!0}})],c.prototype,"spatialReference",void 0),h([z("spatialReference")],c.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],c.prototype,"transform",void 0),c=v=h([P("esri.rest.support.FeatureSet")],c),c.prototype.toJSON.isDefaultToJSON=!0;const M=c;export{M as O}; diff --git a/main/assets/FeatureStore-Co2V0sVE-BoTs_3tu.js b/main/assets/FeatureStore-Co2V0sVE-BoTs_3tu.js new file mode 100644 index 000000000..47129ac55 --- /dev/null +++ b/main/assets/FeatureStore-Co2V0sVE-BoTs_3tu.js @@ -0,0 +1 @@ +import{gU as d,I as f,aq as g,gV as l,a1 as i,o as a,bh as u}from"./main-C7yV2j71.js";import{V as h}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{r as m}from"./BoundsStore--N6o1xkF-mEMXylgh.js";import{r as y}from"./timeSupport-jPViR5jn-BnQYlj-C.js";import{s as _}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";const c=d();class M{constructor(t){this.geometryInfo=t,this._boundsStore=new m,this._featuresById=new Map,this.events=new f,this.featureAdapter=_}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let t=0;return this._featuresById.forEach(e=>{e.geometry!=null&&e.geometry.coords&&(t+=e.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(this.fullBounds==null)return null;const[e,s,r,o]=this.fullBounds;return{xmin:e,ymin:s,xmax:r,ymax:o,spatialReference:y(t)}}add(t){this._add(t),this._emitChanged()}addMany(t){for(const e of t)this._add(e);this._emitChanged()}upsertMany(t){const e=t.map(s=>this._upsert(s));return this._emitChanged(),e.filter(g)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(t){const e=this._featuresById.get(t);return e?(this._remove(e),this._emitChanged(),e):null}removeManyById(t){this._boundsStore.invalidateIndex();for(const e of t){const s=this._featuresById.get(e);s&&this._remove(s)}this._emitChanged()}forEachBounds(t,e){for(const s of t){const r=this._boundsStore.get(s.objectId);r&&e(l(c,r))}}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach(e=>t(e))}forEachInBounds(t,e){this._boundsStore.forEachInBounds(t,s=>{e(this._featuresById.get(s))})}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(!t)return;const e=t.objectId;if(e==null)return void i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t}));const s=this._featuresById.get(e);let r;if(s?(t.displayId=s.displayId,r=this._boundsStore.get(e),this._boundsStore.delete(e)):this.onFeatureAdd!=null&&this.onFeatureAdd(t),!t.geometry?.coords?.length)return this._boundsStore.set(e,null),void this._featuresById.set(e,t);r=h(r??u(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(e,r),this._featuresById.set(e,t)}_upsert(t){const e=t?.objectId;if(e==null)return i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t})),null;const s=this._featuresById.get(e);if(!s)return this._add(t),t;const{geometry:r,attributes:o}=t;for(const n in o)s.attributes[n]=o[n];return r&&(s.geometry=r,this._boundsStore.set(e,h(u(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(t){this.onFeatureRemove!=null&&this.onFeatureRemove(t);const e=t.objectId;return this._boundsStore.delete(e),this._featuresById.delete(e),t}}export{M as I}; diff --git a/main/assets/FeatureStore-Co2V0sVE-CXrTGv5U.js b/main/assets/FeatureStore-Co2V0sVE-CXrTGv5U.js deleted file mode 100644 index e56dc0967..000000000 --- a/main/assets/FeatureStore-Co2V0sVE-CXrTGv5U.js +++ /dev/null @@ -1 +0,0 @@ -import{gU as d,I as f,aq as g,gV as l,a1 as i,o as a,bh as u}from"./main-BZaw9FpY.js";import{V as h}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{r as m}from"./BoundsStore--N6o1xkF-DBAJ8yky.js";import{r as y}from"./timeSupport-jPViR5jn-DVbPitWZ.js";import{s as _}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";const c=d();class M{constructor(t){this.geometryInfo=t,this._boundsStore=new m,this._featuresById=new Map,this.events=new f,this.featureAdapter=_}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let t=0;return this._featuresById.forEach(e=>{e.geometry!=null&&e.geometry.coords&&(t+=e.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(this.fullBounds==null)return null;const[e,s,r,o]=this.fullBounds;return{xmin:e,ymin:s,xmax:r,ymax:o,spatialReference:y(t)}}add(t){this._add(t),this._emitChanged()}addMany(t){for(const e of t)this._add(e);this._emitChanged()}upsertMany(t){const e=t.map(s=>this._upsert(s));return this._emitChanged(),e.filter(g)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(t){const e=this._featuresById.get(t);return e?(this._remove(e),this._emitChanged(),e):null}removeManyById(t){this._boundsStore.invalidateIndex();for(const e of t){const s=this._featuresById.get(e);s&&this._remove(s)}this._emitChanged()}forEachBounds(t,e){for(const s of t){const r=this._boundsStore.get(s.objectId);r&&e(l(c,r))}}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach(e=>t(e))}forEachInBounds(t,e){this._boundsStore.forEachInBounds(t,s=>{e(this._featuresById.get(s))})}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(!t)return;const e=t.objectId;if(e==null)return void i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t}));const s=this._featuresById.get(e);let r;if(s?(t.displayId=s.displayId,r=this._boundsStore.get(e),this._boundsStore.delete(e)):this.onFeatureAdd!=null&&this.onFeatureAdd(t),!t.geometry?.coords?.length)return this._boundsStore.set(e,null),void this._featuresById.set(e,t);r=h(r??u(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(e,r),this._featuresById.set(e,t)}_upsert(t){const e=t?.objectId;if(e==null)return i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t})),null;const s=this._featuresById.get(e);if(!s)return this._add(t),t;const{geometry:r,attributes:o}=t;for(const n in o)s.attributes[n]=o[n];return r&&(s.geometry=r,this._boundsStore.set(e,h(u(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(t){this.onFeatureRemove!=null&&this.onFeatureRemove(t);const e=t.objectId;return this._boundsStore.delete(e),this._featuresById.delete(e),t}}export{M as I}; diff --git a/main/assets/FeatureTemplate-SPHPD45f-DdZuptIc.js b/main/assets/FeatureTemplate-SPHPD45f-DdZuptIc.js new file mode 100644 index 000000000..8f0d6c521 --- /dev/null +++ b/main/assets/FeatureTemplate-SPHPD45f-DdZuptIc.js @@ -0,0 +1 @@ +import{aK as l,aa as a,e as s,v as o,S as r,i as n}from"./main-C7yV2j71.js";const t=new l({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let e=class extends a(s){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([n("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; diff --git a/main/assets/FeatureTemplate-SPHPD45f-tAS5Ccaa.js b/main/assets/FeatureTemplate-SPHPD45f-tAS5Ccaa.js deleted file mode 100644 index 841aa584b..000000000 --- a/main/assets/FeatureTemplate-SPHPD45f-tAS5Ccaa.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as l,aa as a,e as s,v as o,S as r,i as n}from"./main-BZaw9FpY.js";const t=new l({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let e=class extends a(s){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([n("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; diff --git a/main/assets/FeatureType-C9hJmS6_-5PPiaaCJ.js b/main/assets/FeatureType-C9hJmS6_-5PPiaaCJ.js new file mode 100644 index 000000000..853dacd51 --- /dev/null +++ b/main/assets/FeatureType-C9hJmS6_-5PPiaaCJ.js @@ -0,0 +1 @@ +import{aa as a,e as p,v as e,S as i,a0 as m,ac as l,i as d}from"./main-C7yV2j71.js";import{i as y}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{p as c}from"./FeatureTemplate-SPHPD45f-DdZuptIc.js";let o=class extends a(p){constructor(t){super(t),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(t){const r={};for(const s of Object.keys(t))r[s]=y(t[s]);return r}writeDomains(t,r){const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());r.domains=s}};e([i({json:{write:!0}})],o.prototype,"id",void 0),e([i({json:{write:!0}})],o.prototype,"name",void 0),e([i({json:{write:!0}})],o.prototype,"domains",void 0),e([m("domains")],o.prototype,"readDomains",null),e([l("domains")],o.prototype,"writeDomains",null),e([i({type:[c],json:{write:!0}})],o.prototype,"templates",void 0),o=e([d("esri.layers.support.FeatureType")],o);const w=o;export{w as y}; diff --git a/main/assets/FeatureType-C9hJmS6_-pVJc0p7X.js b/main/assets/FeatureType-C9hJmS6_-pVJc0p7X.js deleted file mode 100644 index 5916c1b41..000000000 --- a/main/assets/FeatureType-C9hJmS6_-pVJc0p7X.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as a,e as p,v as e,S as i,a0 as m,ac as l,i as d}from"./main-BZaw9FpY.js";import{i as y}from"./Field-C6hA1tZj-CbELM0zp.js";import{p as c}from"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";let o=class extends a(p){constructor(t){super(t),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(t){const r={};for(const s of Object.keys(t))r[s]=y(t[s]);return r}writeDomains(t,r){const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());r.domains=s}};e([i({json:{write:!0}})],o.prototype,"id",void 0),e([i({json:{write:!0}})],o.prototype,"name",void 0),e([i({json:{write:!0}})],o.prototype,"domains",void 0),e([m("domains")],o.prototype,"readDomains",null),e([l("domains")],o.prototype,"writeDomains",null),e([i({type:[c],json:{write:!0}})],o.prototype,"templates",void 0),o=e([d("esri.layers.support.FeatureType")],o);const w=o;export{w as y}; diff --git a/main/assets/Field-C6hA1tZj-C0Sp7XvY.js b/main/assets/Field-C6hA1tZj-C0Sp7XvY.js new file mode 100644 index 000000000..758224491 --- /dev/null +++ b/main/assets/Field-C6hA1tZj-C0Sp7XvY.js @@ -0,0 +1 @@ +import{v as t,S as o,i as l,aK as j,bz as p,a0 as f,bB as x,e as b,P as T}from"./main-C7yV2j71.js";import{i as D}from"./fieldType-CD2CL2hr-B1iISniv.js";var m;let s=m=class extends b{constructor(e){super(e),this.name=null,this.code=null}clone(){return new m({name:this.name,code:this.code})}};t([o({type:String,json:{write:!0}})],s.prototype,"name",void 0),t([o({type:[String,Number],json:{write:!0}})],s.prototype,"code",void 0),s=m=t([l("esri.layers.support.CodedValue")],s);const J=new j({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends b{constructor(e){super(e),this.name=null,this.type=null}};t([o({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([p(J)],d.prototype,"type",void 0),d=t([l("esri.layers.support.Domain")],d);const y=d;var h;let u=h=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let r=null;if(this.codedValues){const i=String(e);this.codedValues.some(w=>(String(w.code)===i&&(r=w.name),!!r))}return r}clone(){return new h({codedValues:T(this.codedValues),name:this.name})}};t([o({type:[s],json:{write:!0}})],u.prototype,"codedValues",void 0),t([p({codedValue:"coded-value"})],u.prototype,"type",void 0),u=h=t([l("esri.layers.support.CodedValueDomain")],u);const S=u;var v;let c=v=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new v}};t([p({inherited:"inherited"})],c.prototype,"type",void 0),c=v=t([l("esri.layers.support.InheritedDomain")],c);const O=c;var g;let a=g=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new g({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,r,i){r[i]=[this.minValue||0,e]}}}})],a.prototype,"maxValue",void 0),t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[0]},write:{target:"range",writer(e,r,i){r[i]=[e,this.maxValue||0]}}}})],a.prototype,"minValue",void 0),t([p({range:"range"})],a.prototype,"type",void 0),a=g=t([l("esri.layers.support.RangeDomain")],a);const N=a,B={key:"type",base:y,typeMap:{range:N,"coded-value":S,inherited:O}};function P(e){if(!e?.type)return null;switch(e.type){case"range":return N.fromJSON(e);case"codedValue":return S.fromJSON(e);case"inherited":return O.fromJSON(e)}return null}var V;const _=new j({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let n=V=class extends b{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?.value??null}readValueType(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?_.fromJSON(i.fieldValueType):null}clone(){return new V({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};t([o({type:String,json:{write:!0}})],n.prototype,"alias",void 0),t([o({type:[String,Number],json:{write:{allowNull:!0}}})],n.prototype,"defaultValue",void 0),t([o()],n.prototype,"description",void 0),t([f("description")],n.prototype,"readDescription",null),t([o({types:B,json:{read:{reader:P},write:!0}})],n.prototype,"domain",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"editable",void 0),t([o({type:x,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],n.prototype,"length",void 0),t([o({type:String,json:{write:!0}})],n.prototype,"name",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"nullable",void 0),t([p(D)],n.prototype,"type",void 0),t([o()],n.prototype,"valueType",void 0),t([f("valueType",["description"])],n.prototype,"readValueType",null),t([o({type:Boolean,json:{read:!1}})],n.prototype,"visible",void 0),n=V=t([l("esri.layers.support.Field")],n);const F=n,R=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{R as F,S as a,P as i,B as n,s as p,F as y}; diff --git a/main/assets/Field-C6hA1tZj-CbELM0zp.js b/main/assets/Field-C6hA1tZj-CbELM0zp.js deleted file mode 100644 index 3b0cc46cc..000000000 --- a/main/assets/Field-C6hA1tZj-CbELM0zp.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as o,i as l,aK as j,bz as p,a0 as f,bB as x,e as b,P as T}from"./main-BZaw9FpY.js";import{i as D}from"./fieldType-CD2CL2hr-BAgRuESI.js";var m;let s=m=class extends b{constructor(e){super(e),this.name=null,this.code=null}clone(){return new m({name:this.name,code:this.code})}};t([o({type:String,json:{write:!0}})],s.prototype,"name",void 0),t([o({type:[String,Number],json:{write:!0}})],s.prototype,"code",void 0),s=m=t([l("esri.layers.support.CodedValue")],s);const J=new j({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends b{constructor(e){super(e),this.name=null,this.type=null}};t([o({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([p(J)],d.prototype,"type",void 0),d=t([l("esri.layers.support.Domain")],d);const y=d;var h;let u=h=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let r=null;if(this.codedValues){const i=String(e);this.codedValues.some(w=>(String(w.code)===i&&(r=w.name),!!r))}return r}clone(){return new h({codedValues:T(this.codedValues),name:this.name})}};t([o({type:[s],json:{write:!0}})],u.prototype,"codedValues",void 0),t([p({codedValue:"coded-value"})],u.prototype,"type",void 0),u=h=t([l("esri.layers.support.CodedValueDomain")],u);const S=u;var v;let c=v=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new v}};t([p({inherited:"inherited"})],c.prototype,"type",void 0),c=v=t([l("esri.layers.support.InheritedDomain")],c);const O=c;var g;let a=g=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new g({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,r,i){r[i]=[this.minValue||0,e]}}}})],a.prototype,"maxValue",void 0),t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[0]},write:{target:"range",writer(e,r,i){r[i]=[e,this.maxValue||0]}}}})],a.prototype,"minValue",void 0),t([p({range:"range"})],a.prototype,"type",void 0),a=g=t([l("esri.layers.support.RangeDomain")],a);const N=a,B={key:"type",base:y,typeMap:{range:N,"coded-value":S,inherited:O}};function P(e){if(!e?.type)return null;switch(e.type){case"range":return N.fromJSON(e);case"codedValue":return S.fromJSON(e);case"inherited":return O.fromJSON(e)}return null}var V;const _=new j({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let n=V=class extends b{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?.value??null}readValueType(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?_.fromJSON(i.fieldValueType):null}clone(){return new V({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};t([o({type:String,json:{write:!0}})],n.prototype,"alias",void 0),t([o({type:[String,Number],json:{write:{allowNull:!0}}})],n.prototype,"defaultValue",void 0),t([o()],n.prototype,"description",void 0),t([f("description")],n.prototype,"readDescription",null),t([o({types:B,json:{read:{reader:P},write:!0}})],n.prototype,"domain",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"editable",void 0),t([o({type:x,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],n.prototype,"length",void 0),t([o({type:String,json:{write:!0}})],n.prototype,"name",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"nullable",void 0),t([p(D)],n.prototype,"type",void 0),t([o()],n.prototype,"valueType",void 0),t([f("valueType",["description"])],n.prototype,"readValueType",null),t([o({type:Boolean,json:{read:!1}})],n.prototype,"visible",void 0),n=V=t([l("esri.layers.support.Field")],n);const F=n,R=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{R as F,S as a,P as i,B as n,s as p,F as y}; diff --git a/main/assets/FieldsIndex-HmzMbJQG-CiA2Ur00.js b/main/assets/FieldsIndex-HmzMbJQG-CiA2Ur00.js deleted file mode 100644 index f9f57e664..000000000 --- a/main/assets/FieldsIndex-HmzMbJQG-CiA2Ur00.js +++ /dev/null @@ -1 +0,0 @@ -import{cT as N,cU as S,cV as y,cW as _,cX as b,a1 as B,o as z,cY as h,cZ as u,b_ as J,an as O,cK as $,c_ as q,c$ as L,d0 as D,d1 as c}from"./main-BZaw9FpY.js";import{t as R}from"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";function I(s){return"timeZone"in s}function x(s){return"timeZone"in s}function C(s){return"dateFieldsTimeZone"in s}const v=new Map;let k=class m{static fromJSON(e){return new m(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new m(e.fields??[],g(e))}static fromLayerJSON(e){return new m(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const i of this.fields){const r=i?.name,o=T(r);if(r&&o){const l=a(r);this._fieldsMap.set(r,i),this._fieldsMap.set(l,i),this._normalizedFieldsMap.set(o,i),n.push(`${l}:${i.type}:${this._timeZoneByFieldName?.get(r)}`),N(i)?(this.dateFields.push(i),this._dateFieldsSet.add(i)):S(i)&&(this._numericFieldsSet.add(i),this.numericFields.push(i)),y(i)||_(i)||(i.editable=i.editable==null||!!i.editable,i.nullable=i.nullable==null||!!i.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)y(e)||_(e)||e.nullable||b(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return this.get(e)!=null}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(a(e))??this._normalizedFieldsMap.get(T(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&typeof e!="string"?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):t.type==="date"||t.type==="esriFieldTypeDate"?(B.getLogger("esri.layers.support.FieldsIndex").error(new z("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),h):Z.has(t.type)?u:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u?R.instance:t===h?J.utcInstance:O(v,t,()=>$.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return q(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>L(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function a(s){return s.trim().toLowerCase()}function T(s){return D(s)?.toLowerCase()??""}const Z=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(s){const e=new Map;if(!s.fields)return e;const t=s.datesInUnknownTimezone===!0,{timeInfo:n,editFieldsInfo:i}=s,r=(n?"startField"in n?n.startField:n.startTimeField:"")??"",o=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=C(s)?s.dateFieldsTimeZone??null:s.dateFieldsTimeReference?c(s.dateFieldsTimeReference):null,F=i?I(i)?i.timeZone??l:i.dateFieldsTimeReference?c(i.dateFieldsTimeReference):l??h:null,p=n?x(n)?n.timeZone??l:n.timeReference?c(n.timeReference):l:null,w=new Map([[a(i?.creationDateField??""),F],[a(i?.editDateField??""),F],[a(r),p],[a(o),p]]);for(const{name:d,type:f}of s.fields)if(Z.has(f))e.set(d,u);else if(f!=="date"&&f!=="esriFieldTypeDate")e.set(d,null);else if(t)e.set(d,u);else{const M=w.get(a(d??""))??l;e.set(d,M)}return e}export{k as o}; diff --git a/main/assets/FieldsIndex-HmzMbJQG-CzzKuIHi.js b/main/assets/FieldsIndex-HmzMbJQG-CzzKuIHi.js new file mode 100644 index 000000000..e8e33fb03 --- /dev/null +++ b/main/assets/FieldsIndex-HmzMbJQG-CzzKuIHi.js @@ -0,0 +1 @@ +import{cT as N,cU as S,cV as y,cW as _,cX as b,a1 as B,o as z,cY as h,cZ as u,b_ as J,an as O,cK as $,c_ as q,c$ as L,d0 as D,d1 as c}from"./main-C7yV2j71.js";import{t as R}from"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";function I(s){return"timeZone"in s}function x(s){return"timeZone"in s}function C(s){return"dateFieldsTimeZone"in s}const v=new Map;let k=class m{static fromJSON(e){return new m(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new m(e.fields??[],g(e))}static fromLayerJSON(e){return new m(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const i of this.fields){const r=i?.name,o=T(r);if(r&&o){const l=a(r);this._fieldsMap.set(r,i),this._fieldsMap.set(l,i),this._normalizedFieldsMap.set(o,i),n.push(`${l}:${i.type}:${this._timeZoneByFieldName?.get(r)}`),N(i)?(this.dateFields.push(i),this._dateFieldsSet.add(i)):S(i)&&(this._numericFieldsSet.add(i),this.numericFields.push(i)),y(i)||_(i)||(i.editable=i.editable==null||!!i.editable,i.nullable=i.nullable==null||!!i.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)y(e)||_(e)||e.nullable||b(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return this.get(e)!=null}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(a(e))??this._normalizedFieldsMap.get(T(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&typeof e!="string"?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):t.type==="date"||t.type==="esriFieldTypeDate"?(B.getLogger("esri.layers.support.FieldsIndex").error(new z("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),h):Z.has(t.type)?u:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u?R.instance:t===h?J.utcInstance:O(v,t,()=>$.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return q(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>L(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function a(s){return s.trim().toLowerCase()}function T(s){return D(s)?.toLowerCase()??""}const Z=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(s){const e=new Map;if(!s.fields)return e;const t=s.datesInUnknownTimezone===!0,{timeInfo:n,editFieldsInfo:i}=s,r=(n?"startField"in n?n.startField:n.startTimeField:"")??"",o=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=C(s)?s.dateFieldsTimeZone??null:s.dateFieldsTimeReference?c(s.dateFieldsTimeReference):null,F=i?I(i)?i.timeZone??l:i.dateFieldsTimeReference?c(i.dateFieldsTimeReference):l??h:null,p=n?x(n)?n.timeZone??l:n.timeReference?c(n.timeReference):l:null,w=new Map([[a(i?.creationDateField??""),F],[a(i?.editDateField??""),F],[a(r),p],[a(o),p]]);for(const{name:d,type:f}of s.fields)if(Z.has(f))e.set(d,u);else if(f!=="date"&&f!=="esriFieldTypeDate")e.set(d,null);else if(t)e.set(d,u);else{const M=w.get(a(d??""))??l;e.set(d,M)}return e}export{k as o}; diff --git a/main/assets/FloatingArrow-BG9llDYg-AyYcVK-v.js b/main/assets/FloatingArrow-BG9llDYg-AyYcVK-v.js new file mode 100644 index 000000000..e1fe2ab24 --- /dev/null +++ b/main/assets/FloatingArrow-BG9llDYg-AyYcVK-v.js @@ -0,0 +1 @@ +import{a}from"./themeUtils-YjM7iIiX-J3djxNmP.js";const s={arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"},d={width:12,height:6,strokeWidth:1},c=({floatingLayout:l,key:n,ref:w})=>{const{width:t,height:e,strokeWidth:r}=d,o=t/2,i=l==="vertical",h=`M0,0 H${t} L${t-o},${e} Q${o},${e} ${o},${e} Z`;return a("svg",{"aria-hidden":"true",class:s.arrow,height:t,key:n,ref:w,viewBox:`0 0 ${t} ${t+(i?0:r)}`,width:t+(i?r:0)},r>0&&a("path",{class:s.arrowStroke,d:h,fill:"none","stroke-width":r+1}),a("path",{d:h,stroke:"none"}))};export{c as $}; diff --git a/main/assets/FloatingArrow-BG9llDYg-B1DQ6cRb.js b/main/assets/FloatingArrow-BG9llDYg-B1DQ6cRb.js deleted file mode 100644 index cfb87fa21..000000000 --- a/main/assets/FloatingArrow-BG9llDYg-B1DQ6cRb.js +++ /dev/null @@ -1 +0,0 @@ -import{a}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";const s={arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"},d={width:12,height:6,strokeWidth:1},c=({floatingLayout:l,key:n,ref:w})=>{const{width:t,height:e,strokeWidth:r}=d,o=t/2,i=l==="vertical",h=`M0,0 H${t} L${t-o},${e} Q${o},${e} ${o},${e} Z`;return a("svg",{"aria-hidden":"true",class:s.arrow,height:t,key:n,ref:w,viewBox:`0 0 ${t} ${t+(i?0:r)}`,width:t+(i?r:0)},r>0&&a("path",{class:s.arrowStroke,d:h,fill:"none","stroke-width":r+1}),a("path",{d:h,stroke:"none"}))};export{c as $}; diff --git a/main/assets/GeoJSONLayer-BFFwDRph-64SMPh4J.js b/main/assets/GeoJSONLayer-BFFwDRph-64SMPh4J.js new file mode 100644 index 000000000..1e764c0a5 --- /dev/null +++ b/main/assets/GeoJSONLayer-BFFwDRph-64SMPh4J.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-3W9GNLNT.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{v as r,S as i,i as E,J as O,W as w,bT as y,em as J,a as f,_ as N,bQ as j,n as S,bW as F,bL as R,aB as T,bp as q,o as g,l as P,K as $,a1 as v}from"./main-C7yV2j71.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{m as D,u as k}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as Q}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{q as G}from"./workers-PiCjreoO-DqI62TYf.js";import{$ as L}from"./clientSideDefaults-BqqayPct-B0cLE-po.js";import{O as Z}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{u as z}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as V}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{l as W}from"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import{v as A}from"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import{E as B}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{p as U}from"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import{C as Y}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as M}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as X}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as H}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{i as K,$ as ee,e as te,Y as re,_ as ie,E as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{p as le}from"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import{y as pe}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{f as ue}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{C as de,q as he}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{b as d}from"./Query-BrwMGK8U-DV_czrJX.js";import{w as me}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";let l=class extends T{constructor(){super(...arguments),this.type="geojson",this.refresh=q(async e=>{await this.load();const{extent:t,timeExtent:s}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,s&&(this.sourceJSON.timeInfo.timeExtent=[s.start,s.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(s=>Z.fromJSON(s))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(s=>({count:s.count,extent:S.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new g("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],h=[];if(e.addFeatures)for(const a of e.addFeatures)s.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)h.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:h,deletes:n}).then(({extent:a,timeExtent:p,featureEditResults:m})=>(this.sourceJSON.extent=a,p&&(this.sourceJSON.timeInfo.timeExtent=[p.start,p.end]),this._createEditsResult(m)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new g("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,s=this._geometryForSerialization(e);return s?{geometry:s.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return t==null?null:t.type==="mesh"||t.type==="extent"?P.fromExtent(t.extent):t}async _startWorker(e){this._connection=await G("GeoJSONSourceWorker",{strategy:$("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:s,hasZ:n,geometryType:h,objectIdField:a,url:p,timeInfo:m,customParameters:I}=this.layer,x=this.layer.originOf("spatialReference")==="defaults",_={url:p,customParameters:I,fields:t&&t.map(c=>c.toJSON()),geometryType:F.toJSON(h),hasZ:n,objectIdField:a,timeInfo:m?m.toJSON():null,spatialReference:x?null:s&&s.toJSON()},u=await this._connection.invoke("load",_,{signal:e});for(const c of u.warnings)v.getLogger(this.layer).warn("#load()",`${c.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:c});u.featureErrors.length&&v.getLogger(this.layer).warn("#load()",`Encountered ${u.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:u.featureErrors}),this.sourceJSON=u.layerDefinition,this.capabilities=L(this.sourceJSON.hasZ,!0)}};r([i()],l.prototype,"capabilities",void 0),r([i()],l.prototype,"type",void 0),r([i({constructOnly:!0})],l.prototype,"layer",void 0),r([i()],l.prototype,"sourceJSON",void 0),l=r([E("esri.layers.graphics.sources.GeoJSONSource")],l);const b=ue();let o=class extends U(V(A(W(z(H(X(M(B(Y(C(Q))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new l({layer:this}),this.spatialReference=O.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(w).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),y(this.renderer,this.fieldsIndex),J(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?f(this.url):null}set renderer(e){y(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=f(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await N(()=>import("./editingSupport-gUqP9iyf-3W9GNLNT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);await this.load();const n=await s(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return me(this,e)}createQuery(){const e=new d,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:s,timeExtent:n}=this;return e.timeExtent=s!=null&&n!=null?n.offset(-s.value,s.unit):n||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(d.from(e)||this.createQuery(),t)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(d.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(d.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(d.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};r([i(K)],o.prototype,"attributeTableTemplate",void 0),r([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"createQueryVersion",null),r([i(j("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Boolean})],o.prototype,"editingEnabled",void 0),r([i(ee)],o.prototype,"elevationInfo",void 0),r([i({type:[pe],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),r([i(b.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({type:S,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),r([i({type:["point","polygon","polyline","multipoint"],json:{read:{reader:F.read}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean})],o.prototype,"hasZ",void 0),r([i(te)],o.prototype,"id",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i(re)],o.prototype,"labelsVisible",void 0),r([i({type:[de],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:he},write:!0}})],o.prototype,"labelingInfo",void 0),r([i(ie)],o.prototype,"legendEnabled",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i(oe)],o.prototype,"opacity",void 0),r([i({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),r([i(b.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"parsedUrl",null),r([i(se)],o.prototype,"popupEnabled",void 0),r([i({type:R,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:D,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:k}}}})],o.prototype,"renderer",null),r([i(ne)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({type:O})],o.prototype,"spatialReference",void 0),r([i({type:[le]})],o.prototype,"templates",void 0),r([i()],o.prototype,"title",void 0),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),r([i(ae)],o.prototype,"url",null),o=r([E("esri.layers.GeoJSONLayer")],o);const Nt=o;export{Nt as default}; diff --git a/main/assets/GeoJSONLayer-BFFwDRph-WFy27EiL.js b/main/assets/GeoJSONLayer-BFFwDRph-WFy27EiL.js deleted file mode 100644 index 357b4464d..000000000 --- a/main/assets/GeoJSONLayer-BFFwDRph-WFy27EiL.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-Bz3XNCt8.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{v as r,S as i,i as E,J as O,W as w,bT as y,em as J,a as f,_ as N,bQ as j,n as S,bW as F,bL as R,aB as T,bp as q,o as g,l as P,K as $,a1 as v}from"./main-BZaw9FpY.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{m as D,u as k}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as Q}from"./Layer-ChoECxvZ-C4wLrCej.js";import{q as G}from"./workers-PiCjreoO-oGzLvkSt.js";import{$ as L}from"./clientSideDefaults-BqqayPct-BMC57bnT.js";import{O as Z}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{u as z}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as V}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{l as W}from"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import{v as A}from"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import{E as B}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{p as U}from"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import{C as Y}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as M}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as X}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as H}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{i as K,$ as ee,e as te,Y as re,_ as ie,E as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{p as le}from"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import{y as pe}from"./Field-C6hA1tZj-CbELM0zp.js";import{f as ue}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{C as de,q as he}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{b as d}from"./Query-BrwMGK8U-sojFdYaD.js";import{w as me}from"./popupUtils-B0uZcXX0-BqljON9c.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";let l=class extends T{constructor(){super(...arguments),this.type="geojson",this.refresh=q(async e=>{await this.load();const{extent:t,timeExtent:s}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,s&&(this.sourceJSON.timeInfo.timeExtent=[s.start,s.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(s=>Z.fromJSON(s))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(s=>({count:s.count,extent:S.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new g("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],h=[];if(e.addFeatures)for(const a of e.addFeatures)s.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)h.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:h,deletes:n}).then(({extent:a,timeExtent:p,featureEditResults:m})=>(this.sourceJSON.extent=a,p&&(this.sourceJSON.timeInfo.timeExtent=[p.start,p.end]),this._createEditsResult(m)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new g("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,s=this._geometryForSerialization(e);return s?{geometry:s.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return t==null?null:t.type==="mesh"||t.type==="extent"?P.fromExtent(t.extent):t}async _startWorker(e){this._connection=await G("GeoJSONSourceWorker",{strategy:$("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:s,hasZ:n,geometryType:h,objectIdField:a,url:p,timeInfo:m,customParameters:I}=this.layer,x=this.layer.originOf("spatialReference")==="defaults",_={url:p,customParameters:I,fields:t&&t.map(c=>c.toJSON()),geometryType:F.toJSON(h),hasZ:n,objectIdField:a,timeInfo:m?m.toJSON():null,spatialReference:x?null:s&&s.toJSON()},u=await this._connection.invoke("load",_,{signal:e});for(const c of u.warnings)v.getLogger(this.layer).warn("#load()",`${c.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:c});u.featureErrors.length&&v.getLogger(this.layer).warn("#load()",`Encountered ${u.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:u.featureErrors}),this.sourceJSON=u.layerDefinition,this.capabilities=L(this.sourceJSON.hasZ,!0)}};r([i()],l.prototype,"capabilities",void 0),r([i()],l.prototype,"type",void 0),r([i({constructOnly:!0})],l.prototype,"layer",void 0),r([i()],l.prototype,"sourceJSON",void 0),l=r([E("esri.layers.graphics.sources.GeoJSONSource")],l);const b=ue();let o=class extends U(V(A(W(z(H(X(M(B(Y(C(Q))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new l({layer:this}),this.spatialReference=O.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(w).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),y(this.renderer,this.fieldsIndex),J(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?f(this.url):null}set renderer(e){y(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=f(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await N(()=>import("./editingSupport-gUqP9iyf-Bz3XNCt8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);await this.load();const n=await s(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return me(this,e)}createQuery(){const e=new d,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:s,timeExtent:n}=this;return e.timeExtent=s!=null&&n!=null?n.offset(-s.value,s.unit):n||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(d.from(e)||this.createQuery(),t)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(d.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(d.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(d.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};r([i(K)],o.prototype,"attributeTableTemplate",void 0),r([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"createQueryVersion",null),r([i(j("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Boolean})],o.prototype,"editingEnabled",void 0),r([i(ee)],o.prototype,"elevationInfo",void 0),r([i({type:[pe],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),r([i(b.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({type:S,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),r([i({type:["point","polygon","polyline","multipoint"],json:{read:{reader:F.read}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean})],o.prototype,"hasZ",void 0),r([i(te)],o.prototype,"id",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i(re)],o.prototype,"labelsVisible",void 0),r([i({type:[de],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:he},write:!0}})],o.prototype,"labelingInfo",void 0),r([i(ie)],o.prototype,"legendEnabled",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i(oe)],o.prototype,"opacity",void 0),r([i({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),r([i(b.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"parsedUrl",null),r([i(se)],o.prototype,"popupEnabled",void 0),r([i({type:R,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:D,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:k}}}})],o.prototype,"renderer",null),r([i(ne)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({type:O})],o.prototype,"spatialReference",void 0),r([i({type:[le]})],o.prototype,"templates",void 0),r([i()],o.prototype,"title",void 0),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),r([i(ae)],o.prototype,"url",null),o=r([E("esri.layers.GeoJSONLayer")],o);const Nt=o;export{Nt as default}; diff --git a/main/assets/GeoJSONSourceWorker-CLrugTuD-Bu4LRCLI.js b/main/assets/GeoJSONSourceWorker-CLrugTuD-Bu4LRCLI.js new file mode 100644 index 000000000..9914e8b74 --- /dev/null +++ b/main/assets/GeoJSONSourceWorker-CLrugTuD-Bu4LRCLI.js @@ -0,0 +1 @@ +import{ft as _,o as I,cX as A,gT as Z,cY as Q,ay as $,aU as v,a1 as G,aC as P,f as M,bK as R}from"./main-C7yV2j71.js";import{z,n as N,A as Y,j as H,k as L}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{I as B}from"./FeatureStore-Co2V0sVE-BoTs_3tu.js";import{f as E,h as b}from"./queryUtils-Brxu6254-T3UhaATW.js";import{Z as J}from"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import{Y as U,_ as V,X as W}from"./geojson-CNt_qtQf-utywq02B.js";import{d as X,A as K,f as ee}from"./clientSideDefaults-BqqayPct-B0cLE-po.js";import{G as te,F as T,j,c as F,x as k}from"./sourceUtils-BMeqkJ5g-C2dbTHus.js";import{o as C}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{i as ie}from"./fieldType-CD2CL2hr-B1iISniv.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-mEMXylgh.js";import"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./signal-CETehA7D-DxK1orqE.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";const se={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class et{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const s=[],[i]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),r=U(i,{geometryType:e.geometryType}),l=e.fields||r.fields||[],p=e.hasZ!=null?e.hasZ:r.hasZ,d=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||_;let a=e.timeInfo;l===r.fields&&r.unknownFields.length>0&&s.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});const o=new C(l);let u=o.get(c);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,c=u.name):(u={alias:c,name:c,type:r.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},l.unshift(u));const y={};for(const n of l){if(n.name==null&&(n.name=n.alias),n.alias==null&&(n.alias=n.name),!n.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:n});if(!ie.jsonValues.includes(n.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${n.name}"`,{field:n});if(n.name!==u.name){const g=A(n);g!==void 0&&(y[n.name]=g)}n.length==null&&(n.length=Z(n))}if(a){if(a.startTimeField){const n=o.get(a.startTimeField);n?(a.startTimeField=n.name,n.type="esriFieldTypeDate"):a.startTimeField=null}if(a.endTimeField){const n=o.get(a.endTimeField);n?(a.endTimeField=n.name,n.type="esriFieldTypeDate"):a.endTimeField=null}if(a.trackIdField){const n=o.get(a.trackIdField);n?a.trackIdField=n.name:(a.trackIdField=null,s.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:a}}))}a.startTimeField||a.endTimeField||(s.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:a}}),a=null)}const m=d?X(d):void 0,w=o.dateFields.length?{timeZoneIANA:Q}:null,f={warnings:s,featureErrors:[],layerDefinition:{...se,drawingInfo:m??void 0,templates:K(y),extent:void 0,geometryType:d,objectIdField:c,fields:l,hasZ:!!p,timeInfo:a,dateFieldsTimeReference:w}};this._queryEngine=new J({fieldsIndex:C.fromLayerJSON({fields:l,timeInfo:a,dateFieldsTimeReference:w}),geometryType:d,hasM:!1,hasZ:p,objectIdField:c,spatialReference:h,timeInfo:a,featureStore:new B({geometryType:d,hasM:!1,hasZ:p})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=ee(y,c);const x=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const O=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany(O);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:n,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[n,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([te(t,s),E(e.adds,t),E(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=$(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const r=this._normalizeFeatures(i);r&&this._queryEngine.featureStore.addMany(r)},i=>{this._queryEngine.featureStore.clear(),v(i)||G.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:s}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:s}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=V(e,{geometryType:t,hasZ:s,objectIdField:i});if(!P(this._queryEngine.spatialReference,_))for(const l of r)l.geometry!=null&&(l.geometry=z(b(N(l.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:s}=this._loadOptions,i=(await M(t??"",{responseType:"json",query:{...s},signal:e})).data;return W(i),i}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const l of e){const p=this._createDefaultAttributes(),d=T(i,p,l.attributes,!0);d?t?.push(d):(this._assignObjectId(p,l.attributes,!0),l.attributes=p,l.objectId=p[s],r.push(l))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const d of i)r.deleteResults.push(j(d));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:l,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();return{extent:l,timeExtent:p,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:l,objectIdField:p,spatialReference:d,featureStore:c,fieldsIndex:h}=this._queryEngine,a=[];for(const o of t){if(o.geometry&&i!==R(o.geometry)){s.push(F("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),y=T(h,u,o.attributes);if(y)s.push(y);else{if(this._assignObjectId(u,o.attributes),o.attributes=u,o.uid!=null){const m=o.attributes[p];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??d;o.geometry=b(k(o.geometry,m),m,d)}a.push(o),s.push(j(o.attributes[p]))}}c.addMany(Y([],a,i,l,r,p))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:l,spatialReference:p,featureStore:d,fieldsIndex:c}=this._queryEngine;for(const h of t){const{attributes:a,geometry:o}=h,u=a?.[l];if(u==null){e.push(F(`Identifier field ${l} missing`));continue}if(!d.has(u)){e.push(F(`Feature with object id ${u} missing`));continue}const y=H(d.getFeature(u),s,r,i);if(o!=null){if(s!==R(o)){e.push(F("Incorrect geometry type."));continue}const m=o.spatialReference??p;y.geometry=b(k(o,m),m,p)}if(a){const m=T(c,y.attributes,a);if(m){e.push(m);continue}}d.add(L(y,s,r,i,l)),e.push(j(u))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if(s.type==="esriFieldTypeString")return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{et as default}; diff --git a/main/assets/GeoJSONSourceWorker-CLrugTuD-Cl6ttqvl.js b/main/assets/GeoJSONSourceWorker-CLrugTuD-Cl6ttqvl.js deleted file mode 100644 index 4b26d23d4..000000000 --- a/main/assets/GeoJSONSourceWorker-CLrugTuD-Cl6ttqvl.js +++ /dev/null @@ -1 +0,0 @@ -import{ft as _,o as I,cX as A,gT as Z,cY as Q,ay as $,aU as v,a1 as G,aC as P,f as M,bK as R}from"./main-BZaw9FpY.js";import{z,n as N,A as Y,j as H,k as L}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{I as B}from"./FeatureStore-Co2V0sVE-CXrTGv5U.js";import{f as E,h as b}from"./queryUtils-Brxu6254-DDAvXp_C.js";import{Z as J}from"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import{Y as U,_ as V,X as W}from"./geojson-CNt_qtQf-BQNqVsVZ.js";import{d as X,A as K,f as ee}from"./clientSideDefaults-BqqayPct-BMC57bnT.js";import{G as te,F as T,j,c as F,x as k}from"./sourceUtils-BMeqkJ5g-CD_x4f6t.js";import{o as C}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{i as ie}from"./fieldType-CD2CL2hr-BAgRuESI.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-DBAJ8yky.js";import"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./signal-CETehA7D-vStzfbaY.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";const se={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class et{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const s=[],[i]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),r=U(i,{geometryType:e.geometryType}),l=e.fields||r.fields||[],p=e.hasZ!=null?e.hasZ:r.hasZ,d=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||_;let a=e.timeInfo;l===r.fields&&r.unknownFields.length>0&&s.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});const o=new C(l);let u=o.get(c);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,c=u.name):(u={alias:c,name:c,type:r.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},l.unshift(u));const y={};for(const n of l){if(n.name==null&&(n.name=n.alias),n.alias==null&&(n.alias=n.name),!n.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:n});if(!ie.jsonValues.includes(n.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${n.name}"`,{field:n});if(n.name!==u.name){const g=A(n);g!==void 0&&(y[n.name]=g)}n.length==null&&(n.length=Z(n))}if(a){if(a.startTimeField){const n=o.get(a.startTimeField);n?(a.startTimeField=n.name,n.type="esriFieldTypeDate"):a.startTimeField=null}if(a.endTimeField){const n=o.get(a.endTimeField);n?(a.endTimeField=n.name,n.type="esriFieldTypeDate"):a.endTimeField=null}if(a.trackIdField){const n=o.get(a.trackIdField);n?a.trackIdField=n.name:(a.trackIdField=null,s.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:a}}))}a.startTimeField||a.endTimeField||(s.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:a}}),a=null)}const m=d?X(d):void 0,w=o.dateFields.length?{timeZoneIANA:Q}:null,f={warnings:s,featureErrors:[],layerDefinition:{...se,drawingInfo:m??void 0,templates:K(y),extent:void 0,geometryType:d,objectIdField:c,fields:l,hasZ:!!p,timeInfo:a,dateFieldsTimeReference:w}};this._queryEngine=new J({fieldsIndex:C.fromLayerJSON({fields:l,timeInfo:a,dateFieldsTimeReference:w}),geometryType:d,hasM:!1,hasZ:p,objectIdField:c,spatialReference:h,timeInfo:a,featureStore:new B({geometryType:d,hasM:!1,hasZ:p})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=ee(y,c);const x=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const O=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany(O);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:n,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[n,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([te(t,s),E(e.adds,t),E(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=$(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const r=this._normalizeFeatures(i);r&&this._queryEngine.featureStore.addMany(r)},i=>{this._queryEngine.featureStore.clear(),v(i)||G.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:s}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:s}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=V(e,{geometryType:t,hasZ:s,objectIdField:i});if(!P(this._queryEngine.spatialReference,_))for(const l of r)l.geometry!=null&&(l.geometry=z(b(N(l.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:s}=this._loadOptions,i=(await M(t??"",{responseType:"json",query:{...s},signal:e})).data;return W(i),i}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const l of e){const p=this._createDefaultAttributes(),d=T(i,p,l.attributes,!0);d?t?.push(d):(this._assignObjectId(p,l.attributes,!0),l.attributes=p,l.objectId=p[s],r.push(l))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const d of i)r.deleteResults.push(j(d));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:l,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();return{extent:l,timeExtent:p,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:l,objectIdField:p,spatialReference:d,featureStore:c,fieldsIndex:h}=this._queryEngine,a=[];for(const o of t){if(o.geometry&&i!==R(o.geometry)){s.push(F("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),y=T(h,u,o.attributes);if(y)s.push(y);else{if(this._assignObjectId(u,o.attributes),o.attributes=u,o.uid!=null){const m=o.attributes[p];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??d;o.geometry=b(k(o.geometry,m),m,d)}a.push(o),s.push(j(o.attributes[p]))}}c.addMany(Y([],a,i,l,r,p))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:l,spatialReference:p,featureStore:d,fieldsIndex:c}=this._queryEngine;for(const h of t){const{attributes:a,geometry:o}=h,u=a?.[l];if(u==null){e.push(F(`Identifier field ${l} missing`));continue}if(!d.has(u)){e.push(F(`Feature with object id ${u} missing`));continue}const y=H(d.getFeature(u),s,r,i);if(o!=null){if(s!==R(o)){e.push(F("Incorrect geometry type."));continue}const m=o.spatialReference??p;y.geometry=b(k(o,m),m,p)}if(a){const m=T(c,y.attributes,a);if(m){e.push(m);continue}}d.add(L(y,s,r,i,l)),e.push(j(u))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if(s.type==="esriFieldTypeString")return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{et as default}; diff --git a/main/assets/GeoRSSLayer-DgF8xnYi-BEBXvG2J.js b/main/assets/GeoRSSLayer-DgF8xnYi-BEBXvG2J.js new file mode 100644 index 000000000..ec6eb9386 --- /dev/null +++ b/main/assets/GeoRSSLayer-DgF8xnYi-BEBXvG2J.js @@ -0,0 +1 @@ +import{gK as n,W as p,f as y,dQ as m,C as u,v as o,S as i,a0 as d,n as h,i as c,et as a,eB as f,fc as S,eD as g,eC as v}from"./main-C7yV2j71.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as b}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as G}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as F}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as _}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as x}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as E}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{e as P,_ as k,Z as w}from"./commonProperties-BtIqvFU_-DuUske_0.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";const R=["atom","xml"],j={base:a,key:"type",typeMap:{"simple-line":f},errorContext:"symbol"},D={base:a,key:"type",typeMap:{"picture-marker":S,"simple-marker":g},errorContext:"symbol"},M={base:a,key:"type",typeMap:{"simple-fill":v},errorContext:"symbol"};let t=class extends G(x(F(_(E(C(b)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(s=>{const l=s.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&l.outline?.style.includes("esriSFS")&&(l.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?n(this.url,R)||"GeoRSS":e}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(p).then(()=>this._fetchService(r)).then(s=>{this.read(s,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:s}=await y(u.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:m(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return s}_hasGeometry(e){return this.featureCollections?.some(r=>r.featureSet?.geometryType===e&&r.featureSet.features?.length>0)??!1}};o([i()],t.prototype,"description",void 0),o([i()],t.prototype,"featureCollections",void 0),o([d("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([i({type:h,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([i(P)],t.prototype,"id",void 0),o([i(k)],t.prototype,"legendEnabled",void 0),o([i({types:j,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({types:D,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([i({types:M,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([i({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([i(w)],t.prototype,"url",void 0),o([i({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([i({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([c("esri.layers.GeoRSSLayer")],t);const te=t;export{te as default}; diff --git a/main/assets/GeoRSSLayer-DgF8xnYi-U408jYSK.js b/main/assets/GeoRSSLayer-DgF8xnYi-U408jYSK.js deleted file mode 100644 index 4257fedde..000000000 --- a/main/assets/GeoRSSLayer-DgF8xnYi-U408jYSK.js +++ /dev/null @@ -1 +0,0 @@ -import{gK as n,W as p,f as y,dQ as m,C as u,v as o,S as i,a0 as d,n as h,i as c,et as a,eB as f,fc as S,eD as g,eC as v}from"./main-BZaw9FpY.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as b}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as G}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as F}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as _}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as x}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as E}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{e as P,_ as k,Z as w}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";const R=["atom","xml"],j={base:a,key:"type",typeMap:{"simple-line":f},errorContext:"symbol"},D={base:a,key:"type",typeMap:{"picture-marker":S,"simple-marker":g},errorContext:"symbol"},M={base:a,key:"type",typeMap:{"simple-fill":v},errorContext:"symbol"};let t=class extends G(x(F(_(E(C(b)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(s=>{const l=s.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&l.outline?.style.includes("esriSFS")&&(l.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?n(this.url,R)||"GeoRSS":e}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(p).then(()=>this._fetchService(r)).then(s=>{this.read(s,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:s}=await y(u.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:m(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return s}_hasGeometry(e){return this.featureCollections?.some(r=>r.featureSet?.geometryType===e&&r.featureSet.features?.length>0)??!1}};o([i()],t.prototype,"description",void 0),o([i()],t.prototype,"featureCollections",void 0),o([d("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([i({type:h,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([i(P)],t.prototype,"id",void 0),o([i(k)],t.prototype,"legendEnabled",void 0),o([i({types:j,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({types:D,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([i({types:M,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([i({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([i(w)],t.prototype,"url",void 0),o([i({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([i({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([c("esri.layers.GeoRSSLayer")],t);const te=t;export{te as default}; diff --git a/main/assets/GeoRSSLayerView2D-BLTYupUX-C7pkROGe.js b/main/assets/GeoRSSLayerView2D-BLTYupUX-C7pkROGe.js new file mode 100644 index 000000000..d73dee4fe --- /dev/null +++ b/main/assets/GeoRSSLayerView2D-BLTYupUX-C7pkROGe.js @@ -0,0 +1 @@ +import{ah as l,aL as h,ag as g,bL as w,v as f,i as d}from"./main-C7yV2j71.js";import{t as u,p as n}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{O as b}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{X as V,Y as S}from"./LayerView-Bish-E63-I2LV0oDm.js";import{d as _}from"./GraphicContainer-DuOHUciE-dHT2kH0f.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";let y=class extends V(S){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(t,o){if(!this.graphicsViews.length)return null;const p=this.layer;return this.graphicsViews.reverse().flatMap(r=>{const i=this._popupTemplates.get(r),m=r.hitTest(t);for(const e of m)e.layer=p,e.sourceLayer=p,e.popupTemplate=i;return m}).map(r=>({type:"graphic",graphic:r,layer:p,mapPoint:t}))}update(t){if(this.graphicsViews)for(const o of this.graphicsViews)o.processUpdate(t)}attach(){this.addAttachHandles([l(()=>this.layer?.featureCollections,t=>{this._clear();for(const{popupInfo:o,featureSet:p,layerDefinition:r}of t){const i=b.fromJSON(p),m=new g(i.features),e=r.drawingInfo,c=o?w.fromJSON(o):null,s=u(e.renderer),a=new v({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:m,renderer:s,container:new _(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=a,this._popupTemplates.set(a,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=s.symbol):this.layer.lineSymbol=s.symbol:this.layer.polygonSymbol=s.symbol,this.graphicsViews.push(a),this.container.addChild(a.container)}},h),l(()=>this.layer?.polygonSymbol,t=>{this._graphicsViewMap.polygon.renderer=new n({symbol:t})},h),l(()=>this.layer?.lineSymbol,t=>{this._graphicsViewMap.polyline.renderer=new n({symbol:t})},h),l(()=>this.layer?.pointSymbol,t=>{this._graphicsViewMap.point.renderer=new n({symbol:t})},h)])}detach(){this._clear()}moveEnd(){}viewChange(){for(const t of this.graphicsViews)t.viewChange()}_clear(){this.container.removeAllChildren();for(const t of this.graphicsViews)t.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=f([d("esri.views.2d.layers.GeoRSSLayerView2D")],y);const Xi=y;export{Xi as default}; diff --git a/main/assets/GeoRSSLayerView2D-BLTYupUX-CpOPIa_K.js b/main/assets/GeoRSSLayerView2D-BLTYupUX-CpOPIa_K.js deleted file mode 100644 index 30c6d3c44..000000000 --- a/main/assets/GeoRSSLayerView2D-BLTYupUX-CpOPIa_K.js +++ /dev/null @@ -1 +0,0 @@ -import{ah as l,aL as h,ag as g,bL as w,v as f,i as d}from"./main-BZaw9FpY.js";import{t as u,p as n}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{O as b}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{X as V,Y as S}from"./LayerView-Bish-E63-DRGspiuk.js";import{d as _}from"./GraphicContainer-DuOHUciE-BvzcbTDZ.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";let y=class extends V(S){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(t,o){if(!this.graphicsViews.length)return null;const p=this.layer;return this.graphicsViews.reverse().flatMap(r=>{const i=this._popupTemplates.get(r),m=r.hitTest(t);for(const e of m)e.layer=p,e.sourceLayer=p,e.popupTemplate=i;return m}).map(r=>({type:"graphic",graphic:r,layer:p,mapPoint:t}))}update(t){if(this.graphicsViews)for(const o of this.graphicsViews)o.processUpdate(t)}attach(){this.addAttachHandles([l(()=>this.layer?.featureCollections,t=>{this._clear();for(const{popupInfo:o,featureSet:p,layerDefinition:r}of t){const i=b.fromJSON(p),m=new g(i.features),e=r.drawingInfo,c=o?w.fromJSON(o):null,s=u(e.renderer),a=new v({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:m,renderer:s,container:new _(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=a,this._popupTemplates.set(a,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=s.symbol):this.layer.lineSymbol=s.symbol:this.layer.polygonSymbol=s.symbol,this.graphicsViews.push(a),this.container.addChild(a.container)}},h),l(()=>this.layer?.polygonSymbol,t=>{this._graphicsViewMap.polygon.renderer=new n({symbol:t})},h),l(()=>this.layer?.lineSymbol,t=>{this._graphicsViewMap.polyline.renderer=new n({symbol:t})},h),l(()=>this.layer?.pointSymbol,t=>{this._graphicsViewMap.point.renderer=new n({symbol:t})},h)])}detach(){this._clear()}moveEnd(){}viewChange(){for(const t of this.graphicsViews)t.viewChange()}_clear(){this.container.removeAllChildren();for(const t of this.graphicsViews)t.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=f([d("esri.views.2d.layers.GeoRSSLayerView2D")],y);const Xi=y;export{Xi as default}; diff --git a/main/assets/GeometryUtils-NHgB9gGQ-B3_wQtO7.js b/main/assets/GeometryUtils-NHgB9gGQ-B3_wQtO7.js new file mode 100644 index 000000000..ecaf98762 --- /dev/null +++ b/main/assets/GeometryUtils-NHgB9gGQ-B3_wQtO7.js @@ -0,0 +1 @@ +import{hS as S}from"./main-C7yV2j71.js";const z=512;var P,p;(function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"})(P||(P={}));let f=class R{constructor(i,s){this.x=i,this.y=s}clone(){return new R(this.x,this.y)}equals(i,s){return i===this.x&&s===this.y}isEqual(i){return i.x===this.x&&i.y===this.y}setCoords(i,s){return this.x=i,this.y=s,this}normalize(){const i=this.x,s=this.y,h=Math.sqrt(i*i+s*s);return this.x/=h,this.y/=h,this}rightPerpendicular(){const i=this.x;return this.x=this.y,this.y=-i,this}leftPerpendicular(){const i=this.x;return this.x=-this.y,this.y=i,this}move(i,s){return this.x+=i,this.y+=s,this}assign(i){return this.x=i.x,this.y=i.y,this}assignAdd(i,s){return this.x=i.x+s.x,this.y=i.y+s.y,this}assignSub(i,s){return this.x=i.x-s.x,this.y=i.y-s.y,this}rotate(i,s){const h=this.x,e=this.y;return this.x=h*i-e*s,this.y=h*s+e*i,this}scale(i){return this.x*=i,this.y*=i,this}length(){const i=this.x,s=this.y;return Math.sqrt(i*i+s*s)}sub(i){return this.x-=i.x,this.y-=i.y,this}add(i){return this.x+=i.x,this.y+=i.y,this}static distance(i,s){const h=s.x-i.x,e=s.y-i.y;return Math.sqrt(h*h+e*e)}static add(i,s){return new R(i.x+s.x,i.y+s.y)}static sub(i,s){return new R(i.x-s.x,i.y-s.y)}};class v{constructor(i,s,h){this.ratio=i,this.x=s,this.y=h}}let C=class{constructor(t,i,s,h=8,e=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=h,this._pixelMargin=e,this._tileSize=z*h,this._dz=t,this._yPos=i,this._xPos=s}setPixelMargin(t){t!==this._pixelMargin&&(this._pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this._finalRatio=this._tileSize/t*(1<>this._dz;i>s&&(i=s),this._margin=i,this._xmin=s*this._xPos-i,this._ymin=s*this._yPos-i,this._xmax=this._xmin+s+2*i,this._ymax=this._ymin+s+2*i}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,i){this._pushLine(),this._prevIsIn=this._isIn(t,i),this._moveTo(t,i,this._prevIsIn),this._prevPt=new f(t,i),this._firstPt=new f(t,i),this._dist=0}lineTo(t,i){const s=this._isIn(t,i),h=new f(t,i),e=f.distance(this._prevPt,h);let l,n,x,_,r,g,m,u;if(s)this._prevIsIn?this._lineTo(t,i,!0):(l=this._prevPt,n=h,x=this._intersect(n,l),this._start=this._dist+e*(1-this._r),this._lineTo(x.x,x.y,!0),this._lineTo(n.x,n.y,!0));else if(this._prevIsIn)n=this._prevPt,l=h,x=this._intersect(n,l),this._lineTo(x.x,x.y,!0),this._lineTo(l.x,l.y,!1);else{const a=this._prevPt,o=h;if(a.x<=this._xmin&&o.x<=this._xmin||a.x>=this._xmax&&o.x>=this._xmax||a.y<=this._ymin&&o.y<=this._ymin||a.y>=this._ymax&&o.y>=this._ymax)this._lineTo(o.x,o.y,!1);else{const y=[];if((a.xthis._xmin||a.x>this._xmin&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmin,u))),(a.xthis._xmax||a.x>this._xmax&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmax,u))),(a.ythis._ymin||a.y>this._ymin&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymin))),(a.ythis._ymax||a.y>this._ymax&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymax))),y.length===0)r?g?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):g?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(y.length>1&&y[0].ratio>y[1].ratio)this._start=this._dist+e*y[1].ratio,this._lineTo(y[1].x,y[1].y,!0),this._lineTo(y[0].x,y[0].y,!0);else{this._start=this._dist+e*y[0].ratio;for(let d=0;d2){const t=this._firstPt,i=this._prevPt;t.x===i.x&&t.y===i.y||this.lineTo(t.x,t.y);const s=this._line;let h=s.length;for(;h>=4&&(s[0].x===s[1].x&&s[0].x===s[h-2].x||s[0].y===s[1].y&&s[0].y===s[h-2].y);)s.pop(),s[0].x=s[h-2].x,s[0].y=s[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===P.Polygon&&t&&D.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==P.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const s=[];for(let h=0;h=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let s,h,e;if(i.x>=this._xmin&&i.x<=this._xmax)h=i.y<=this._ymin?this._ymin:this._ymax,e=(h-t.y)/(i.y-t.y),s=t.x+e*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)s=i.x<=this._xmin?this._xmin:this._xmax,e=(s-t.x)/(i.x-t.x),h=t.y+e*(i.y-t.y);else{h=i.y<=this._ymin?this._ymin:this._ymax,s=i.x<=this._xmin?this._xmin:this._xmax;const l=(s-t.x)/(i.x-t.x),n=(h-t.y)/(i.y-t.y);l0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,s){this._type!==P.Polygon?s&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i))):(s||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,s){let h,e;if(this._type!==P.Polygon)if(s){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(h=this._line[this._line.length-1],h.equals(t,i)))return;this._line.push(new f(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(s||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){h=this._line[this._line.length-1];const l=h.x===t,n=h.y===i;if(l&&n)return;this._isH&&l||this._isV&&n?(h.x=t,h.y=i,e=this._line[this._line.length-2],e.x===t&&e.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(e=this._line[this._line.length-2],this._isH=e.x===t,this._isV=e.y===i)):(this._isH=e.x===t,this._isV=e.y===i)):(this._line.push(new f(t,i)),this._isH=l,this._isV=n)}else this._line.push(new f(t,i))}};class A{setExtent(i){this._ratio=i===4096?1:4096/i}get validateTessellation(){return this._ratio<1}reset(i){this._lines=[],this._line=null}moveTo(i,s){this._line&&this._lines.push(this._line),this._line=[];const h=this._ratio;this._line.push(new f(i*h,s*h))}lineTo(i,s){const h=this._ratio;this._line.push(new f(i*h,s*h))}close(){const i=this._line;i&&!i[0].isEqual(i[i.length-1])&&i.push(i[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}(function(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"})(p||(p={}));let D=class T{static simplify(i,s,h){if(!h)return;const e=-s,l=i+s,n=-s,x=i+s,_=[],r=[],g=h.length;for(let u=0;uo.y?(_.push(u),_.push(c),_.push(p.sideLeft),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideLeft),r.push(-1))),y.x>=l&&(y.y=x&&(y.x>o.x?(_.push(u),_.push(c),_.push(p.sideBottom),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideBottom),r.push(-1)))),y=o}if(_.length===0||r.length===0)return;T.fillParent(h,r,_),T.fillParent(h,_,r);const m=[];T.calcDeltas(m,r,_),T.calcDeltas(m,_,r),T.addDeltas(m,h)}static fillParent(i,s,h){const e=h.length,l=s.length;for(let n=0;n1&&e[n-2]===l?0:(e.push(l),T.calcDelta(l,h,s,e)+1)}static addDeltas(i,s){const h=i.length;let e=0;for(let l=0;le&&(e=n)}for(let l=0;lt>=i&&t<=s||t>=s&&t<=i,O=Number.POSITIVE_INFINITY,L=Math.PI,U=2*L,q=128/L,E=256/360,F=L/180,N=1/Math.LN2;function b(t,i){return(t%=i)>=0?t:t+i}function W(t){return b(t*q,256)}function Y(t){return b(t*E,256)}function j(t){return Math.log(t)*N}function G(t,i,s){return t*(1-s)+i*s}const V=8,k=14,B=16;function J(t){return V+Math.max((t-k)*B,0)}function K(t,i,s){let h,e,l,n=0;for(const x of s){h=x.length;for(let _=1;_i!=l.y>i&&((l.x-e.x)*(i-e.y)-(l.y-e.y)*(t-e.x)>0?n++:n--)}return n!==0}function Q(t,i,s,h){let e,l,n,x;const _=h*h;for(const r of s){const g=r.length;if(!(g<2)){e=r[0].x,l=r[0].y;for(let m=1;m>this._dz;i>s&&(i=s),this._margin=i,this._xmin=s*this._xPos-i,this._ymin=s*this._yPos-i,this._xmax=this._xmin+s+2*i,this._ymax=this._ymin+s+2*i}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,i){this._pushLine(),this._prevIsIn=this._isIn(t,i),this._moveTo(t,i,this._prevIsIn),this._prevPt=new f(t,i),this._firstPt=new f(t,i),this._dist=0}lineTo(t,i){const s=this._isIn(t,i),h=new f(t,i),e=f.distance(this._prevPt,h);let l,n,x,_,r,g,m,u;if(s)this._prevIsIn?this._lineTo(t,i,!0):(l=this._prevPt,n=h,x=this._intersect(n,l),this._start=this._dist+e*(1-this._r),this._lineTo(x.x,x.y,!0),this._lineTo(n.x,n.y,!0));else if(this._prevIsIn)n=this._prevPt,l=h,x=this._intersect(n,l),this._lineTo(x.x,x.y,!0),this._lineTo(l.x,l.y,!1);else{const a=this._prevPt,o=h;if(a.x<=this._xmin&&o.x<=this._xmin||a.x>=this._xmax&&o.x>=this._xmax||a.y<=this._ymin&&o.y<=this._ymin||a.y>=this._ymax&&o.y>=this._ymax)this._lineTo(o.x,o.y,!1);else{const y=[];if((a.xthis._xmin||a.x>this._xmin&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmin,u))),(a.xthis._xmax||a.x>this._xmax&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmax,u))),(a.ythis._ymin||a.y>this._ymin&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymin))),(a.ythis._ymax||a.y>this._ymax&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymax))),y.length===0)r?g?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):g?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(y.length>1&&y[0].ratio>y[1].ratio)this._start=this._dist+e*y[1].ratio,this._lineTo(y[1].x,y[1].y,!0),this._lineTo(y[0].x,y[0].y,!0);else{this._start=this._dist+e*y[0].ratio;for(let d=0;d2){const t=this._firstPt,i=this._prevPt;t.x===i.x&&t.y===i.y||this.lineTo(t.x,t.y);const s=this._line;let h=s.length;for(;h>=4&&(s[0].x===s[1].x&&s[0].x===s[h-2].x||s[0].y===s[1].y&&s[0].y===s[h-2].y);)s.pop(),s[0].x=s[h-2].x,s[0].y=s[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===P.Polygon&&t&&D.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==P.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const s=[];for(let h=0;h=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let s,h,e;if(i.x>=this._xmin&&i.x<=this._xmax)h=i.y<=this._ymin?this._ymin:this._ymax,e=(h-t.y)/(i.y-t.y),s=t.x+e*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)s=i.x<=this._xmin?this._xmin:this._xmax,e=(s-t.x)/(i.x-t.x),h=t.y+e*(i.y-t.y);else{h=i.y<=this._ymin?this._ymin:this._ymax,s=i.x<=this._xmin?this._xmin:this._xmax;const l=(s-t.x)/(i.x-t.x),n=(h-t.y)/(i.y-t.y);l0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,s){this._type!==P.Polygon?s&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i))):(s||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,s){let h,e;if(this._type!==P.Polygon)if(s){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(h=this._line[this._line.length-1],h.equals(t,i)))return;this._line.push(new f(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(s||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){h=this._line[this._line.length-1];const l=h.x===t,n=h.y===i;if(l&&n)return;this._isH&&l||this._isV&&n?(h.x=t,h.y=i,e=this._line[this._line.length-2],e.x===t&&e.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(e=this._line[this._line.length-2],this._isH=e.x===t,this._isV=e.y===i)):(this._isH=e.x===t,this._isV=e.y===i)):(this._line.push(new f(t,i)),this._isH=l,this._isV=n)}else this._line.push(new f(t,i))}};class A{setExtent(i){this._ratio=i===4096?1:4096/i}get validateTessellation(){return this._ratio<1}reset(i){this._lines=[],this._line=null}moveTo(i,s){this._line&&this._lines.push(this._line),this._line=[];const h=this._ratio;this._line.push(new f(i*h,s*h))}lineTo(i,s){const h=this._ratio;this._line.push(new f(i*h,s*h))}close(){const i=this._line;i&&!i[0].isEqual(i[i.length-1])&&i.push(i[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}(function(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"})(p||(p={}));let D=class T{static simplify(i,s,h){if(!h)return;const e=-s,l=i+s,n=-s,x=i+s,_=[],r=[],g=h.length;for(let u=0;uo.y?(_.push(u),_.push(c),_.push(p.sideLeft),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideLeft),r.push(-1))),y.x>=l&&(y.y=x&&(y.x>o.x?(_.push(u),_.push(c),_.push(p.sideBottom),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideBottom),r.push(-1)))),y=o}if(_.length===0||r.length===0)return;T.fillParent(h,r,_),T.fillParent(h,_,r);const m=[];T.calcDeltas(m,r,_),T.calcDeltas(m,_,r),T.addDeltas(m,h)}static fillParent(i,s,h){const e=h.length,l=s.length;for(let n=0;n1&&e[n-2]===l?0:(e.push(l),T.calcDelta(l,h,s,e)+1)}static addDeltas(i,s){const h=i.length;let e=0;for(let l=0;le&&(e=n)}for(let l=0;lt>=i&&t<=s||t>=s&&t<=i,O=Number.POSITIVE_INFINITY,L=Math.PI,U=2*L,q=128/L,E=256/360,F=L/180,N=1/Math.LN2;function b(t,i){return(t%=i)>=0?t:t+i}function W(t){return b(t*q,256)}function Y(t){return b(t*E,256)}function j(t){return Math.log(t)*N}function G(t,i,s){return t*(1-s)+i*s}const V=8,k=14,B=16;function J(t){return V+Math.max((t-k)*B,0)}function K(t,i,s){let h,e,l,n=0;for(const x of s){h=x.length;for(let _=1;_i!=l.y>i&&((l.x-e.x)*(i-e.y)-(l.y-e.y)*(t-e.x)>0?n++:n--)}return n!==0}function Q(t,i,s,h){let e,l,n,x;const _=h*h;for(const r of s){const g=r.length;if(!(g<2)){e=r[0].x,l=r[0].y;for(let m=1;mr.hasData)){switch(e.drawPhase){case s.MAP:this._renderChildren(e,i.All);break;case s.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){t(e,!1,r=>{this._renderChildren(r,i.Highlight)})}};export{l as d}; diff --git a/main/assets/GraphicContainer-DuOHUciE-dHT2kH0f.js b/main/assets/GraphicContainer-DuOHUciE-dHT2kH0f.js new file mode 100644 index 000000000..e17463770 --- /dev/null +++ b/main/assets/GraphicContainer-DuOHUciE-dHT2kH0f.js @@ -0,0 +1 @@ +import{E as s,R as i,h as t}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{K as h}from"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";let l=class extends h{renderChildren(e){for(const r of this.children)r.setTransform(e.state);if(super.renderChildren(e),this._updateAttributeView(),this.children.some(r=>r.hasData)){switch(e.drawPhase){case s.MAP:this._renderChildren(e,i.All);break;case s.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){t(e,!1,r=>{this._renderChildren(r,i.Highlight)})}};export{l as d}; diff --git a/main/assets/GraphicsCollection-CWTXNZOX-8-_pDOZK.js b/main/assets/GraphicsCollection-CWTXNZOX-8-_pDOZK.js deleted file mode 100644 index 8d27f62ba..000000000 --- a/main/assets/GraphicsCollection-CWTXNZOX-8-_pDOZK.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as p,i as a,ea as w,bi as l,bG as y,ag as o,eb as _,am as c}from"./main-BZaw9FpY.js";let s=class extends o{constructor(e){super(e),this.addHandles([this.on("before-add",t=>{t.item==null&&t.preventDefault()}),this.on("after-add",t=>this._own(t.item)),this.on("after-remove",t=>this._release(t.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(o.ofType(this.itemType.Type))(e):new o(e)}};function u(e,t){return{type:e,cast:_,set(h){const n=c(h,this._get(t),e);n.owner=this,this._set(t,n)}}}r([p()],s.prototype,"owner",null),s=r([a("esri.core.support.OwningCollection")],s);let i=class extends s{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};r([w({Type:l,ensureType:y(l)})],i.prototype,"itemType",void 0),i=r([a("esri.support.GraphicsCollection")],i);export{i as o,s,u}; diff --git a/main/assets/GraphicsCollection-CWTXNZOX-BB4NQ39c.js b/main/assets/GraphicsCollection-CWTXNZOX-BB4NQ39c.js new file mode 100644 index 000000000..930927f20 --- /dev/null +++ b/main/assets/GraphicsCollection-CWTXNZOX-BB4NQ39c.js @@ -0,0 +1 @@ +import{v as r,S as p,i as a,ea as w,bi as l,bG as y,ag as o,eb as _,am as c}from"./main-C7yV2j71.js";let s=class extends o{constructor(e){super(e),this.addHandles([this.on("before-add",t=>{t.item==null&&t.preventDefault()}),this.on("after-add",t=>this._own(t.item)),this.on("after-remove",t=>this._release(t.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(o.ofType(this.itemType.Type))(e):new o(e)}};function u(e,t){return{type:e,cast:_,set(h){const n=c(h,this._get(t),e);n.owner=this,this._set(t,n)}}}r([p()],s.prototype,"owner",null),s=r([a("esri.core.support.OwningCollection")],s);let i=class extends s{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};r([w({Type:l,ensureType:y(l)})],i.prototype,"itemType",void 0),i=r([a("esri.support.GraphicsCollection")],i);export{i as o,s,u}; diff --git a/main/assets/GraphicsLayer-DfeGaYc1-DAZy-iUY.js b/main/assets/GraphicsLayer-DfeGaYc1-DAZy-iUY.js new file mode 100644 index 000000000..6367672f5 --- /dev/null +++ b/main/assets/GraphicsLayer-DfeGaYc1-DAZy-iUY.js @@ -0,0 +1 @@ +import{v as e,S as i,i as p}from"./main-C7yV2j71.js";import{o,u as a}from"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import{D as h}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as n}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{S as m}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{q as d}from"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";let t=class extends n(m(h)){constructor(r){super(r),this.elevationInfo=null,this.graphics=new o,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(r){return this.graphics.add(r),this}addMany(r){return this.graphics.addMany(r),this}removeAll(){return this.graphics.removeAll(),this}remove(r){this.graphics.remove(r)}removeMany(r){this.graphics.removeMany(r)}on(r,s){return super.on(r,s)}graphicChanged(r){this.emit("graphic-update",r)}};e([i({type:d})],t.prototype,"elevationInfo",void 0),e([i(a(o,"graphics"))],t.prototype,"graphics",void 0),e([i({type:["show","hide"]})],t.prototype,"listMode",void 0),e([i()],t.prototype,"screenSizePerspectiveEnabled",void 0),e([i({readOnly:!0})],t.prototype,"type",void 0),e([i({constructOnly:!0})],t.prototype,"internal",void 0),t=e([p("esri.layers.GraphicsLayer")],t);const z=t;export{z as default}; diff --git a/main/assets/GraphicsLayer-DfeGaYc1-Dg7ASGSC.js b/main/assets/GraphicsLayer-DfeGaYc1-Dg7ASGSC.js deleted file mode 100644 index 3e756b113..000000000 --- a/main/assets/GraphicsLayer-DfeGaYc1-Dg7ASGSC.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as i,i as p}from"./main-BZaw9FpY.js";import{o,u as a}from"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import{D as h}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as n}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{S as m}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{q as d}from"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";let t=class extends n(m(h)){constructor(r){super(r),this.elevationInfo=null,this.graphics=new o,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(r){return this.graphics.add(r),this}addMany(r){return this.graphics.addMany(r),this}removeAll(){return this.graphics.removeAll(),this}remove(r){this.graphics.remove(r)}removeMany(r){this.graphics.removeMany(r)}on(r,s){return super.on(r,s)}graphicChanged(r){this.emit("graphic-update",r)}};e([i({type:d})],t.prototype,"elevationInfo",void 0),e([i(a(o,"graphics"))],t.prototype,"graphics",void 0),e([i({type:["show","hide"]})],t.prototype,"listMode",void 0),e([i()],t.prototype,"screenSizePerspectiveEnabled",void 0),e([i({readOnly:!0})],t.prototype,"type",void 0),e([i({constructOnly:!0})],t.prototype,"internal",void 0),t=e([p("esri.layers.GraphicsLayer")],t);const z=t;export{z as default}; diff --git a/main/assets/GraphicsLayerView2D-CGXlTqHO--x-cniL0.js b/main/assets/GraphicsLayerView2D-CGXlTqHO--x-cniL0.js new file mode 100644 index 000000000..519b8f8cf --- /dev/null +++ b/main/assets/GraphicsLayerView2D-CGXlTqHO--x-cniL0.js @@ -0,0 +1 @@ +import{aA as s,bi as a,ag as g,aq as l,a2 as h,v as m,S as n,i as c}from"./main-C7yV2j71.js";import{X as d,Y as u}from"./LayerView-Bish-E63-I2LV0oDm.js";import{d as w}from"./GraphicContainer-DuOHUciE-dHT2kH0f.js";import{X as y}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import{i as V}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";let e=class extends d(u){constructor(){super(...arguments),this._highlightCounter=new V}attach(){this.graphicsView=new y({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new w(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles([this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),this.watch("layer.visible",i=>{i&&(this.graphicsView.update({state:this.view.state}),this.graphicsView.pushUpdate())})]),this._updateHighlights()}detach(){this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,t="default"){let r;typeof i=="number"?r=[i]:i instanceof a?r=[i.uid]:Array.isArray(i)&&i.length>0?r=typeof i[0]=="number"?i:i.map(o=>o&&o.uid):g.isCollection(i)&&i.length>0&&(r=i.map(o=>o&&o.uid).toArray());const p=r?.filter(l);return p?.length?(this._addHighlight(p,t),h(()=>this._removeHighlight(p,t))):h()}_addHighlight(i,t){this._highlightCounter.addGroup(i,t),this._updateHighlights()}_removeHighlight(i,t){this._highlightCounter.deleteGroup(i,t),this._updateHighlights()}_updateHighlights(){const i=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighlightGroups(t),p=this._getHighlightBits(r);i.push({objectId:t,highlightFlags:p})}this.graphicsView?.setHighlight(i)}};m([n()],e.prototype,"graphicsView",void 0),e=m([c("esri.views.2d.layers.GraphicsLayerView2D")],e);const wt=e;export{wt as default}; diff --git a/main/assets/GraphicsLayerView2D-CGXlTqHO-2KIrsS1c.js b/main/assets/GraphicsLayerView2D-CGXlTqHO-2KIrsS1c.js deleted file mode 100644 index 112fd2ce6..000000000 --- a/main/assets/GraphicsLayerView2D-CGXlTqHO-2KIrsS1c.js +++ /dev/null @@ -1 +0,0 @@ -import{aA as s,bi as a,ag as g,aq as l,a2 as h,v as m,S as n,i as c}from"./main-BZaw9FpY.js";import{X as d,Y as u}from"./LayerView-Bish-E63-DRGspiuk.js";import{d as w}from"./GraphicContainer-DuOHUciE-BvzcbTDZ.js";import{X as y}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import{i as V}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";let e=class extends d(u){constructor(){super(...arguments),this._highlightCounter=new V}attach(){this.graphicsView=new y({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new w(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles([this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),this.watch("layer.visible",i=>{i&&(this.graphicsView.update({state:this.view.state}),this.graphicsView.pushUpdate())})]),this._updateHighlights()}detach(){this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,t="default"){let r;typeof i=="number"?r=[i]:i instanceof a?r=[i.uid]:Array.isArray(i)&&i.length>0?r=typeof i[0]=="number"?i:i.map(o=>o&&o.uid):g.isCollection(i)&&i.length>0&&(r=i.map(o=>o&&o.uid).toArray());const p=r?.filter(l);return p?.length?(this._addHighlight(p,t),h(()=>this._removeHighlight(p,t))):h()}_addHighlight(i,t){this._highlightCounter.addGroup(i,t),this._updateHighlights()}_removeHighlight(i,t){this._highlightCounter.deleteGroup(i,t),this._updateHighlights()}_updateHighlights(){const i=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighlightGroups(t),p=this._getHighlightBits(r);i.push({objectId:t,highlightFlags:p})}this.graphicsView?.setHighlight(i)}};m([n()],e.prototype,"graphicsView",void 0),e=m([c("esri.views.2d.layers.GraphicsLayerView2D")],e);const wt=e;export{wt as default}; diff --git a/main/assets/GraphicsView2D-C4wYE2ut-Vnl9UY_2.js b/main/assets/GraphicsView2D-C4wYE2ut-Vnl9UY_2.js new file mode 100644 index 000000000..840b47412 --- /dev/null +++ b/main/assets/GraphicsView2D-C4wYE2ut-Vnl9UY_2.js @@ -0,0 +1,3 @@ +import{bR as W,j as L,K as y,ah as X,aq as B,b9 as N,$ as Y,bh as g,cO as Q,iX as J,cN as K,fr as V,iY as ee,iZ as te,bK as E,O as se,v as m,S as _,i as re,ht as ie,aG as oe,g_ as ae,f4 as T,i_ as ne,h0 as he,i$ as de}from"./main-C7yV2j71.js";import{o as ce}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{a as le,bo as ue,k as pe,bp as me,bq as z,br as O,bs as q}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import{c as _e}from"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import{D as ye,t as v,h as ge,j as fe,k as be}from"./definitions-DJSdSb77-DkoRHaVx.js";import{i as we}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{o as Ie,m as ve,u as Se,P as xe,W as Re,e as Me}from"./AttributeStore-DjyP9U7y-Du97X0SU.js";import{_ as Te,h as Ge,j as je,a as Ce,e as ze,J as Pe,Z as Ue,Y as ke,X as $e,K as Oe,W as P}from"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import{z as qe,R as Ae,C as U}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{c as x}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{V as Ve}from"./Tile-D75RMC64-CM0vKD9b.js";import{l as Ee}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{H as De}from"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";import{f as Fe,h as Ze}from"./queryUtils-Brxu6254-T3UhaATW.js";async function He(r,e,t){const s=[],i={scaleInfo:je(r),scaleExpression:null};for(const o of e)switch(o.type){case"marker":if(o.animationParams){s.push(...$e(t.instances.animatedMarker,o,P,i));break}s.push(...Oe(t.instances.marker,o,P,i));break;case"fill":o.spriteRasterizationParam==null?s.push(...Ue(t.instances.fill,o,i)):s.push(...ke(t.instances.complexFill,o,!1,i));break;case"line":o.spriteRasterizationParam?s.push(...ze(t.instances.texturedLine,o,!1,i)):s.push(...Pe(t.instances.line,o,!1,i));break;case"text":s.push(...Ce(t.instances.text,o,P,i))}return s}class G extends Me{static from(e,t,s){return new G(e,t,s)}constructor(e,t,s){super(s),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const i=t.lod;i.wrap&&(this._wrappingInfo={worldSizeX:i.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){const e=E(this._current.geometry);return e==="esriGeometryPoint"?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new G(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1v*(i-1)&&(e[o]=a-v*i)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=he(this._current.projectedGeometry),t=new x([],e);return U(new x,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=ne(e.paths,this.hasZ),s=new x([],t);return U(new x,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const s=this._current.attributes[e];if(s!==void 0)return s;const i=e.toLowerCase();for(const o in this._current.attributes)if(o.toLowerCase()===i)return this._current.attributes[o]}_readAttributes(){return this._current.attributes}}class k{static fromGraphic(e,t,s,i){return new k(e.geometry,t,e.attributes,e.visible,e.uid,e.version,s,i)}constructor(e,t,s,i,o,a,n,l){this.geometry=e,this.symbol=t,this.attributes=s,this.visible=i,this.objectId=o,this._version=a,this.zOrder=n,this.displayId=l,this.bounds=g(),this.prevBounds=g(),this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get hasAnimations(){const{linearCIM:e}=this;return!!e&&e.some(t=>"animationParams"in t&&!!t.animationParams)}update(e,t,s){return(this._version!==e.version||this.zOrder!==s||this.symbol!==t)&&(this.prevBounds=this.bounds,this.bounds=g(),this.zOrder=s,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this._version=e.version,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=q(t)),await Fe(t.spatialReference,e);const s=De(t);if(!s)return;const i=Ze(s,t.spatialReference,e);i&&de(i),this.projectedGeometry=V(i)?q(i):i}}class We{constructor(e,t,s){this.added=e,this.updated=t,this.removed=s}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}const A=1e-5;function Le(r,e){return e.zOrder-r.zOrder}class Xe{constructor(e,t,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new me(t),this._tileInfoView=s,this._store=o;const a=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(a.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const i=[],o=[],a=[],n=new Set,l=[];let d=0;for(const h of e.items){d++;const c=h.uid,u=this._items.get(c),f=t(h);if(n.add(c),u){u.update(h,f,d)&&(o.push(u),l.push(this._updateItem(u,s)));continue}const b=this._store.createDisplayIdForObjectId(c),w=k.fromGraphic(h,f,d,b);l.push(this._updateItem(w,s)),this._items.set(w.objectId,w),i.push(w)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),a.push(c));return await Promise.all(l),this._index=null,new We(i,o,a)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,s,i,o){const a=y("esri-mobile"),n=a?ge:fe,l=n+(a?0:be);e=Ee(e,this._tileInfoView.spatialReference);const d=i*window.devicePixelRatio*l,h=g();h[0]=e-d,h[1]=t-d,h[2]=e+d,h[3]=t+d;const c=i*window.devicePixelRatio*n,u=g();u[0]=e-c,u[1]=t-c,u[2]=e+c,u[3]=t+c;const f=.5*i*(l+z),b=this._searchIndex(e-f,t-f,e+f,t+f);if(!b||b.length===0)return[];const w=[],$=g(),R=g();for(const I of b){if(!I.visible)continue;const{projectedGeometry:C,symbolResource:M}=I;this._getSymbolBounds($,M,C,R,o),R[3]=R[2]=R[1]=R[0]=0,ie($,h)&&w.push(I)}if(w.length===0)return[];const D=this._hittestDrawHelper,j=[];for(const I of w){const{projectedGeometry:C,symbolResource:M}=I;if(!M)continue;const{textInfo:F,symbolInfo:Z}=M,H=Z.cimSymbol;D.hitTest(u,H.symbol,C,F,o,i)&&j.push(I)}return j.sort(Le),j.map(I=>I.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,s,i){return this._boundsDirty&&(this._items.forEach(o=>this._getSymbolBounds(o.bounds,o.symbolResource,o.projectedGeometry,o.size,0)),this._boundsDirty=!1),this._index||(this._index=Ve(9,o=>({minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:s,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,s=e.bounds,i=oe(t);if(i&&t.isWrappable){const[o,a]=i.valid,n=Math.abs(s[2]-a){if(e.type==="update")return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new Ie({spatialReference:this.view.spatialReference,fields:new ce}),this._attributeStore=new ve({isLocal:!0,update:e=>{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const r=Ge(null,[]);this._attributeStore.update(r,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=Se.createGraphics(this.view.spatialReference),this._resourceProxy=new xe({fetch:e=>Promise.all(e.map(t=>this.view.stage.textureManager.rasterizeItem(t))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([X(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new Xe(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const r=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:r,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const r=!this._attached||this._updateTracking.updating;return y("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${r} + -> attaching ${!this._attached} + -> updateTracking ${this._updateTracking.updating}`),r}hitTest(r){if(!this.view||this.view.suspended)return[];const{resolution:e,rotation:t}=this.view.state,s=this._graphicStore.hitTest(r.x,r.y,2,e,t),i=new Set(s),o=this.graphics.items.reduce((a,n)=>(i.has(n.uid)&&a.set(n.uid,n),a),new Map);return s.map(a=>o.get(a)).filter(B)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(r){this.updateRequested&&(this.updateRequested=!1,this.update(r))}viewChange(){this.requestUpdate()}setHighlight(r){const e=[];for(const{objectId:t,highlightFlags:s}of r){const i=this._graphicStore.getItem(t)?.displayId;e.push({objectId:t,highlightFlags:s,displayId:i})}this._attributeStore.setHighlight(e,r),this._pushUpdate()}graphicUpdateHandler(r){this._pushUpdate()}update(r){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(r.state.resolution)}pushUpdate(){this._pushUpdate()}_pushUpdate(){N(this._commandQueue.push({type:"update"}))}async _update(){try{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const r=await this._graphicStore.update(this.graphics,t=>this._getSymbolForGraphic(t),t=>this._ensureSymbolResource(t));for(const t of r.updated)this.container.restartAnimation(t.objectId);if(!r.hasAnyUpdate())return void this._attributeStore.sendUpdates();r.removed.length&&(this._cleanupRequired=!0),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,r);const e=this._createTileMessages(r);await this._fetchResources(e),this._write(e);for(const t of r.added)this._setFilterState(t);for(const t of r.updated)this._setFilterState(t);y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,r),this._attributeStore.sendUpdates(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,r)}catch{}this._cleanupSharedResources()}_createTileMessages(r){const e=new Map;for(const t of r.added){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).append(t)}for(const t of r.updated){const s=this.view.graphicsTileStore.getIntersectingTiles(t.prevBounds),i=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const o of s)S.getOrCreate(o,e,this._metadata).removed.push(t.displayId);for(const o of i)S.getOrCreate(o,e,this._metadata).append(t)}for(const t of r.removed){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).removed.push(t.displayId)}return Array.from(e.values())}async _fetchResources(r){for(const{tile:e,reader:t}of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.id}] GraphicsView fetchResources`,r);const s=t.getCursor();for(;s.next();)for(const i of s.getMeshWriters())i.enqueueRequest(this._resourceProxy,s,e.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(r){for(const e of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView write`,e);const t=this._writeMeshes(e);let s=this._tiles.get(e.tile.key);s||(s=this._createFeatureTile(e.tile.key)),y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView onTileData`,e),this.container.onTileData(s,{type:"update",modify:t,remove:e.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:e.objectIdMap}),this.container.requestRender()}}_writeMeshes(r){const e=new Re(r.tile.id),t=r.reader.getCursor();for(;t.next();){e.entityStart(t.getDisplayId(),t.getZOrder());for(const s of t.getMeshWriters())s.write(e,this._resourceProxy,t,r.tile.createArcadeEvaluationOptions(this.view.timeZone),r.tile.level);e.entityEnd()}return{...e.serialize().message,tileId:r.tile.id}}_setFilterState(r){const e=r.displayId,t=this._attributeStore.getHighlightFlags(r.objectId);this._attributeStore.setData(e,0,0,t|(r.visible?ye:0))}_getSymbolForGraphic(r){return r.symbol!=null?r.symbol:this._effectiveRenderer!=null?this._effectiveRenderer.getSymbol(r):this._getNullSymbol(r)}async _ensureSymbolResource(r){if(!r.symbol)return;const e=await this._getSymbolInfo(r.symbol);if(!e)return;const t=e.linearCIM.filter(s=>s.type==="text");if(t.length>0){const s=await this._getTextResources(r,t);r.symbolResource={symbolInfo:e,textInfo:s}}else r.symbolResource={symbolInfo:e}}_getSymbolInfo(r){const e=r.hash();return this._hashToSymbolInfo.has(e)||this._hashToSymbolInfo.set(e,this._createSymbolInfo(e,r).catch(t=>null)),this._hashToSymbolInfo.get(e)}async _createSymbolInfo(r,e){const t=await this._convertToCIMSymbol(e),s=await this._createLinearCIM(t);return{hash:r,cimSymbol:t,linearCIM:s,meshWriters:await this._createMeshWriters(t,s)}}async _convertToCIMSymbol(r){const e=ue(r);return e.type==="web-style"?(await e.fetchCIMSymbol()).data:e}async _createLinearCIM(r){return await Promise.all(pe.fetchResources(r.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(r,!1)}async _createMeshWriters(r,e){Y(this._controller.signal);const t=this.container.instanceStore,s=this.view.stage.meshWriterRegistry,i=await He(r,e,t);return Promise.all(i.map(o=>s.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},o)))}_onTileUpdate(r){if(r.added&&r.added.length>0)for(const e of r.added)this._updateTracking.addPromise(this._addTile(e));if(r.removed&&r.removed.length>0)for(const e of r.removed)this._removeTile(e.key)}_createFeatureTile(r){const e=this.view.featuresTilingScheme.getTileBounds(g(),r),t=this.view.featuresTilingScheme.getTileResolution(r.level),s=new we(r,t,e[0],e[3]);return this._tiles.set(r,s),this.container.addChild(s),s}async _addTile(r){if(!this._attached)return;const e=this._graphicStore.queryItems(r);if(!e.length)return;const t=this._createFeatureTile(r.key),s=S.fromItems(r,e,this._metadata);await this._fetchResources([s]);const i=this._writeMeshes(s);t.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:s.objectIdMap})}_removeTile(r){if(!this._tiles.has(r))return;const e=this._tiles.get(r);this.container.removeChild(e),e.destroy(),this._tiles.delete(r)}_getNullSymbol(r){const e=r.geometry;return Q(e)?J:K(e)||V(e)?ee:this.defaultPointSymbolEnabled?te:null}async _getTextResources(r,e){const t=new Array,s=new Array;for(let n=0;n0){const c=_e.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:h,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:d.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:d.symbol,textString:d.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},r,this.view.spatialReference,null,E(r.projectedGeometry),null,null);c.then(u=>{const f=u.symbolLayers[0],{textString:b}=f.markerGraphics[0];s.push({type:"cim-rasterization-info",resource:{type:"text",textString:b||"",font:d.font}}),l.text=d.textString=b||""}),t.push(c)}else s.push({type:"cim-rasterization-info",resource:d})}t.length>0&&await Promise.all(t);const i=s.map(n=>this.view.stage.textureManager.rasterizeItem(n)),o=await Promise.all(i);se(o);const a=new Map;for(let n=0;nv*(i-1)&&(e[o]=a-v*i)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=he(this._current.projectedGeometry),t=new x([],e);return U(new x,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=ne(e.paths,this.hasZ),s=new x([],t);return U(new x,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const s=this._current.attributes[e];if(s!==void 0)return s;const i=e.toLowerCase();for(const o in this._current.attributes)if(o.toLowerCase()===i)return this._current.attributes[o]}_readAttributes(){return this._current.attributes}}class k{static fromGraphic(e,t,s,i){return new k(e.geometry,t,e.attributes,e.visible,e.uid,e.version,s,i)}constructor(e,t,s,i,o,a,n,l){this.geometry=e,this.symbol=t,this.attributes=s,this.visible=i,this.objectId=o,this._version=a,this.zOrder=n,this.displayId=l,this.bounds=g(),this.prevBounds=g(),this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get hasAnimations(){const{linearCIM:e}=this;return!!e&&e.some(t=>"animationParams"in t&&!!t.animationParams)}update(e,t,s){return(this._version!==e.version||this.zOrder!==s||this.symbol!==t)&&(this.prevBounds=this.bounds,this.bounds=g(),this.zOrder=s,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this._version=e.version,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=q(t)),await Fe(t.spatialReference,e);const s=De(t);if(!s)return;const i=Ze(s,t.spatialReference,e);i&&de(i),this.projectedGeometry=V(i)?q(i):i}}class We{constructor(e,t,s){this.added=e,this.updated=t,this.removed=s}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}const A=1e-5;function Le(r,e){return e.zOrder-r.zOrder}class Xe{constructor(e,t,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new me(t),this._tileInfoView=s,this._store=o;const a=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(a.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const i=[],o=[],a=[],n=new Set,l=[];let d=0;for(const h of e.items){d++;const c=h.uid,u=this._items.get(c),f=t(h);if(n.add(c),u){u.update(h,f,d)&&(o.push(u),l.push(this._updateItem(u,s)));continue}const b=this._store.createDisplayIdForObjectId(c),w=k.fromGraphic(h,f,d,b);l.push(this._updateItem(w,s)),this._items.set(w.objectId,w),i.push(w)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),a.push(c));return await Promise.all(l),this._index=null,new We(i,o,a)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,s,i,o){const a=y("esri-mobile"),n=a?ge:fe,l=n+(a?0:be);e=Ee(e,this._tileInfoView.spatialReference);const d=i*window.devicePixelRatio*l,h=g();h[0]=e-d,h[1]=t-d,h[2]=e+d,h[3]=t+d;const c=i*window.devicePixelRatio*n,u=g();u[0]=e-c,u[1]=t-c,u[2]=e+c,u[3]=t+c;const f=.5*i*(l+z),b=this._searchIndex(e-f,t-f,e+f,t+f);if(!b||b.length===0)return[];const w=[],$=g(),R=g();for(const I of b){if(!I.visible)continue;const{projectedGeometry:C,symbolResource:M}=I;this._getSymbolBounds($,M,C,R,o),R[3]=R[2]=R[1]=R[0]=0,ie($,h)&&w.push(I)}if(w.length===0)return[];const D=this._hittestDrawHelper,j=[];for(const I of w){const{projectedGeometry:C,symbolResource:M}=I;if(!M)continue;const{textInfo:F,symbolInfo:Z}=M,H=Z.cimSymbol;D.hitTest(u,H.symbol,C,F,o,i)&&j.push(I)}return j.sort(Le),j.map(I=>I.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,s,i){return this._boundsDirty&&(this._items.forEach(o=>this._getSymbolBounds(o.bounds,o.symbolResource,o.projectedGeometry,o.size,0)),this._boundsDirty=!1),this._index||(this._index=Ve(9,o=>({minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:s,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,s=e.bounds,i=oe(t);if(i&&t.isWrappable){const[o,a]=i.valid,n=Math.abs(s[2]-a){if(e.type==="update")return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new Ie({spatialReference:this.view.spatialReference,fields:new ce}),this._attributeStore=new ve({isLocal:!0,update:e=>{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const r=Ge(null,[]);this._attributeStore.update(r,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=Se.createGraphics(this.view.spatialReference),this._resourceProxy=new xe({fetch:e=>Promise.all(e.map(t=>this.view.stage.textureManager.rasterizeItem(t))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([X(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new Xe(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const r=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:r,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const r=!this._attached||this._updateTracking.updating;return y("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${r} - -> attaching ${!this._attached} - -> updateTracking ${this._updateTracking.updating}`),r}hitTest(r){if(!this.view||this.view.suspended)return[];const{resolution:e,rotation:t}=this.view.state,s=this._graphicStore.hitTest(r.x,r.y,2,e,t),i=new Set(s),o=this.graphics.items.reduce((a,n)=>(i.has(n.uid)&&a.set(n.uid,n),a),new Map);return s.map(a=>o.get(a)).filter(B)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(r){this.updateRequested&&(this.updateRequested=!1,this.update(r))}viewChange(){this.requestUpdate()}setHighlight(r){const e=[];for(const{objectId:t,highlightFlags:s}of r){const i=this._graphicStore.getItem(t)?.displayId;e.push({objectId:t,highlightFlags:s,displayId:i})}this._attributeStore.setHighlight(e,r),this._pushUpdate()}graphicUpdateHandler(r){this._pushUpdate()}update(r){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(r.state.resolution)}pushUpdate(){this._pushUpdate()}_pushUpdate(){N(this._commandQueue.push({type:"update"}))}async _update(){try{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const r=await this._graphicStore.update(this.graphics,t=>this._getSymbolForGraphic(t),t=>this._ensureSymbolResource(t));for(const t of r.updated)this.container.restartAnimation(t.objectId);if(!r.hasAnyUpdate())return void this._attributeStore.sendUpdates();r.removed.length&&(this._cleanupRequired=!0),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,r);const e=this._createTileMessages(r);await this._fetchResources(e),this._write(e);for(const t of r.added)this._setFilterState(t);for(const t of r.updated)this._setFilterState(t);y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,r),this._attributeStore.sendUpdates(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,r)}catch{}this._cleanupSharedResources()}_createTileMessages(r){const e=new Map;for(const t of r.added){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).append(t)}for(const t of r.updated){const s=this.view.graphicsTileStore.getIntersectingTiles(t.prevBounds),i=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const o of s)S.getOrCreate(o,e,this._metadata).removed.push(t.displayId);for(const o of i)S.getOrCreate(o,e,this._metadata).append(t)}for(const t of r.removed){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).removed.push(t.displayId)}return Array.from(e.values())}async _fetchResources(r){for(const{tile:e,reader:t}of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.id}] GraphicsView fetchResources`,r);const s=t.getCursor();for(;s.next();)for(const i of s.getMeshWriters())i.enqueueRequest(this._resourceProxy,s,e.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(r){for(const e of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView write`,e);const t=this._writeMeshes(e);let s=this._tiles.get(e.tile.key);s||(s=this._createFeatureTile(e.tile.key)),y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView onTileData`,e),this.container.onTileData(s,{type:"update",modify:t,remove:e.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:e.objectIdMap}),this.container.requestRender()}}_writeMeshes(r){const e=new Re(r.tile.id),t=r.reader.getCursor();for(;t.next();){e.entityStart(t.getDisplayId(),t.getZOrder());for(const s of t.getMeshWriters())s.write(e,this._resourceProxy,t,r.tile.createArcadeEvaluationOptions(this.view.timeZone),r.tile.level);e.entityEnd()}return{...e.serialize().message,tileId:r.tile.id}}_setFilterState(r){const e=r.displayId,t=this._attributeStore.getHighlightFlags(r.objectId);this._attributeStore.setData(e,0,0,t|(r.visible?ye:0))}_getSymbolForGraphic(r){return r.symbol!=null?r.symbol:this._effectiveRenderer!=null?this._effectiveRenderer.getSymbol(r):this._getNullSymbol(r)}async _ensureSymbolResource(r){if(!r.symbol)return;const e=await this._getSymbolInfo(r.symbol);if(!e)return;const t=e.linearCIM.filter(s=>s.type==="text");if(t.length>0){const s=await this._getTextResources(r,t);r.symbolResource={symbolInfo:e,textInfo:s}}else r.symbolResource={symbolInfo:e}}_getSymbolInfo(r){const e=r.hash();return this._hashToSymbolInfo.has(e)||this._hashToSymbolInfo.set(e,this._createSymbolInfo(e,r).catch(t=>null)),this._hashToSymbolInfo.get(e)}async _createSymbolInfo(r,e){const t=await this._convertToCIMSymbol(e),s=await this._createLinearCIM(t);return{hash:r,cimSymbol:t,linearCIM:s,meshWriters:await this._createMeshWriters(t,s)}}async _convertToCIMSymbol(r){const e=ue(r);return e.type==="web-style"?(await e.fetchCIMSymbol()).data:e}async _createLinearCIM(r){return await Promise.all(pe.fetchResources(r.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(r,!1)}async _createMeshWriters(r,e){Y(this._controller.signal);const t=this.container.instanceStore,s=this.view.stage.meshWriterRegistry,i=await He(r,e,t);return Promise.all(i.map(o=>s.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},o)))}_onTileUpdate(r){if(r.added&&r.added.length>0)for(const e of r.added)this._updateTracking.addPromise(this._addTile(e));if(r.removed&&r.removed.length>0)for(const e of r.removed)this._removeTile(e.key)}_createFeatureTile(r){const e=this.view.featuresTilingScheme.getTileBounds(g(),r),t=this.view.featuresTilingScheme.getTileResolution(r.level),s=new we(r,t,e[0],e[3]);return this._tiles.set(r,s),this.container.addChild(s),s}async _addTile(r){if(!this._attached)return;const e=this._graphicStore.queryItems(r);if(!e.length)return;const t=this._createFeatureTile(r.key),s=S.fromItems(r,e,this._metadata);await this._fetchResources([s]);const i=this._writeMeshes(s);t.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:s.objectIdMap})}_removeTile(r){if(!this._tiles.has(r))return;const e=this._tiles.get(r);this.container.removeChild(e),e.destroy(),this._tiles.delete(r)}_getNullSymbol(r){const e=r.geometry;return Q(e)?J:K(e)||V(e)?ee:this.defaultPointSymbolEnabled?te:null}async _getTextResources(r,e){const t=new Array,s=new Array;for(let n=0;n0){const c=_e.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:h,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:d.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:d.symbol,textString:d.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},r,this.view.spatialReference,null,E(r.projectedGeometry),null,null);c.then(u=>{const f=u.symbolLayers[0],{textString:b}=f.markerGraphics[0];s.push({type:"cim-rasterization-info",resource:{type:"text",textString:b||"",font:d.font}}),l.text=d.textString=b||""}),t.push(c)}else s.push({type:"cim-rasterization-info",resource:d})}t.length>0&&await Promise.all(t);const i=s.map(n=>this.view.stage.textureManager.rasterizeItem(n)),o=await Promise.all(i);se(o);const a=new Map;for(let n=0;n{const i=new h(2).multiply(e),s=d(i),a=d(t);return t.subtract(s.multiply(t).multiply(a))}],[Qt(t,new h(.25)),()=>{const i=new h(2).multiply(e),s=Kt(i).multiply(t),a=new h(16).multiply(t).subtract(new h(12)).multiply(t).add(new h(3));return t.add(s.multiply(a))}],[!0,()=>{const i=new h(2).multiply(e),s=Kt(i),a=Ie(t).subtract(t);return t.add(s.multiply(a))}])}function Lt(t,e){const i=d(P(new h(.5),e)).multiply(vt(t,new h(2).multiply(e))),s=P(new h(.5),e).multiply(wt(t,new h(2).multiply(Ve(e,.5))));return i.add(s)}function Yt(t){return F(F(t.r,t.g),t.b)}function ye(t){return Nt(Nt(t.r,t.g),t.b)}function Ut(t){return Pe(t,new b(.3,.59,.11))}function se(t){return ye(t).subtract(Yt(t))}function ri(t){const e=Ut(t),i=Yt(t),s=ye(t);return me([de(i,new h(0)),()=>{const a=t.subtract(e).multiply(e),o=e.subtract(i);return e.add(a.divide(o))}],[Xt(s,new h(1)),()=>{const a=t.subtract(e),o=d(e),n=a.multiply(o),l=s.subtract(e);return e.add(n.divide(l))}],[!0,t])}function Gt(t,e){const i=Ut(t),s=Ut(e).subtract(i);return ri(t.add(new b(s)))}function ne(t,e,i){const s=Yt(t),a=se(t),o=se(e);return Gt(C(Xt(a,new h(0)),()=>t.subtract(s).multiply(o).divide(a),new b(0)),i)}function zt(t,e){return C(D(e,new h(1)),e,()=>{const i=d(e),s=t.multiply(t).divide(i);return F(s,new h(1))})}c([De],dt.prototype,"blendMode",void 0),c([w(J)],dt.prototype,"config",void 0),c([I(0,A(_e))],dt.prototype,"vertex",null),c([I(0,A(ai))],dt.prototype,"fragment",null);class we extends Ct{}c([Mt(0,S)],we.prototype,"position",void 0);class li extends Ft{}let jt=class extends ot{};c([w(j)],jt.prototype,"layerTexture",void 0),c([w(h)],jt.prototype,"opacity",void 0);let Rt=class extends Tt{vertex(t){return{uv:t.position,glPosition:new y(t.position.subtract(new S(.5)).multiply(2),0,1)}}fragment(t){const e=new kt;return e.glFragColor=G(this.config.layerTexture,t.uv).multiply(this.config.opacity),e}};c([w(jt)],Rt.prototype,"config",void 0),c([I(0,A(we))],Rt.prototype,"vertex",null),c([I(0,A(li))],Rt.prototype,"fragment",null);const Pi={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Ai={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},k=!!Wt("esri-2d-profiler");let Zi=class{constructor(t,e){if(this._events=new Te,this._entries=new Map,this._timings=new Ge(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!k)return;this._ext=je(t.gl,{}),this._debugOutput=e;const i=t.gl;if(!this.enableCommandLogging)return;let s;for(s in i)if(typeof i[s]=="function"){const a=i[s],o=s.includes("draw");i[s]=(...n)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:n,isDrawCommand:o}),this._currentSummary&&(this._currentSummary.commands++,o&&this._currentSummary.drawCommands++),a.apply(i,n))}}get enableCommandLogging(){return!(typeof k=="object"&&k.disableCommands)}recordContainerStart(t){k&&(this._currentContainer=t)}recordContainerEnd(){k&&(this._currentContainer=null)}recordPassStart(t){k&&(this._currentPass=t,this._initSummary())}recordPassEnd(){k&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){k&&(this._currentBrush=t)}recordBrushEnd(){k&&(this._currentBrush=null)}recordStart(t){if(k&&this._ext!=null){if(this._entries.has(t)){const i=this._entries.get(t),s=this._ext.resultAvailable(i.query),a=this._ext.disjoint();if(s&&!a){const o=this._ext.getResult(i.query)/1e6;let n=0;if(this._timings.enqueue(o)!=null){const u=this._timings.entries,m=u.length;let _=0;for(const p of u)_+=p;n=_/m}const l=o.toFixed(2),r=n?n.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${l} ms (${r} last 10 avg) +${i.commandsLen} Commands (${i.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(i.summaries),console.log("Commands: ",i.commands),console.groupEnd()):console.log(`Frame report for ${t}, ${l} ms (${r} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${r})`}for(const o of i.handles)o.remove();this._ext.deleteQuery(i.query),this._entries.delete(t)}const e={name:t,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(e.handles.push(this._events.on("command",i=>{e.commandsLen++,e.commands.push(i),i.isDrawCommand&&e.drawCommands++})),e.handles.push(this._events.on("summary",i=>{e.summaries.push(i)}))),this._ext.beginTimeElapsed(e.query),this._entries.set(t,e)}}recordEnd(t){k&&this._ext!=null&&this._entries.has(t)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}};const E=1,bt=0,it=1,st=2;let ui=class{constructor(t,e,i){this._width=t*i,this._height=e*i,this._pixelRatio=i;const s=Math.ceil(this._width/E),a=Math.ceil(this._height/E);this._cols=s,this._rows=a,this._cells=ei.create(s*a)}insertMetrics(t){this._markMetrics(t)}hasCollision(t){let e=0;for(const{transformedX:i,transformedY:s,width:a,height:o}of t.bounds){const n=a*this._pixelRatio,l=o*this._pixelRatio,r=i*this._pixelRatio,u=s*this._pixelRatio;switch(this._collide(r,u,n,l)){case st:return st;case it:e++}}return e===t.bounds.length?it:bt}getCellId(t,e){return t+e*this._cols}has(t){return this._cells.has(t)}hasRange(t,e){return this._cells.hasRange(t,e)}set(t){this._cells.set(t)}setRange(t,e){this._cells.setRange(t,e)}_collide(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s;if(n<0||l<0||a>this._width||o>this._height)return it;const r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);if(this.has(v))return st}return bt}_mark(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s,r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);this.set(v)}return!1}_markMetrics(t){for(const{transformedX:e,transformedY:i,width:s,height:a}of t.bounds){const o=s*this._pixelRatio,n=a*this._pixelRatio,l=e*this._pixelRatio,r=i*this._pixelRatio;this._mark(l,r,o,n)}}};const H=254,pt=255,Q=0;function B(t,e){const i=t.children.slice();i.sort((s,a)=>s.tileAge-a.tileAge),i.forEach(s=>{s.labelMetrics!=null&&s.isReady&&e(s,s.labelMetrics)})}function oe(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}class hi{run(e,i,s,a){const o=[];for(let n=e.length-1;n>=0;n--){const l=e[n];l.labelingCollisionInfos?.length&&o.push(...l.labelingCollisionInfos)}Wt("esri-2d-update-debug")&&o.length&&console.debug("CollisionEngine.run"),this._transformMetrics(o),this._runCollision(o,i,s,a);for(const n of o)n.container.requestRender()}_runCollision(e,i,s,a){const[o,n]=i.state.size,l=new ui(o,n,i.pixelRatio);for(const{container:r,deconflictionEnabled:u,visible:m}of e){const _=r.attributeView;u?m?(this._prepare(r),this._collideVisible(l,r,s,a),this._collideInvisible(l,r)):B(r,(p,g)=>{for(const v of g)_.setLabelMinZoom(v.entityTexel,pt)}):B(r,(p,g)=>{for(const v of g)oe(v,s)?(_.setLabelMinZoom(v.entityTexel,Q),m&&l.insertMetrics(v)):_.setLabelMinZoom(v.entityTexel,H)})}}_isFiltered(e,i,s){const a=i.getFilterFlags(e),o=!s.hasFilter||!!(a&We),n=s.featureEffect==null||s.featureEffect.excludedLabelsVisible||!!(a&Xe);return!(o&&n)}_prepare(e){const i=e.attributeView,s=new Set;B(e,(a,o)=>{for(const n of o){const l=n.entityTexel;if(!s.has(l)){if(s.add(l),this._isFiltered(l,i,e.layerView)){i.setLabelMinZoom(l,H);continue}i.getLabelMinZoom(l)!==Q?i.setLabelMinZoom(l,pt):i.setLabelMinZoom(l,Q)}}})}_collideVisible(e,i,s,a){const o=i.attributeView,n=new Set;B(i,(l,r)=>{for(let u=0;u{for(let l=0;l{const l=i.attributeView,r=o.transforms.labelMat2d;r[4]=Math.round(r[4]),r[5]=Math.round(r[5]);const u=s==="polyline";for(const m of n){const{entityTexel:_,anchorX:p,anchorY:g}=m;let v=m.referenceBounds?.size??0;const T=a[0];if(T!=null){const M=T(l.getVisualVariableData(_,ti.SIZE));v=isNaN(M)||M==null||M===1/0?v:M}const at=Ye+v/2,rt=m.directionX*at,Y=m.directionY*at;for(const M of m.bounds){let lt=p,ut=g;if(u){const ht=p+M.x+rt,ct=g+M.y+Y;lt=r[0]*ht+r[2]*ct+r[4],ut=r[1]*ht+r[3]*ct+r[5];const Me=lt,Ce=ut;M.transformedX=Math.floor(Me),M.transformedY=Math.floor(Ce)}else{lt=r[0]*p+r[2]*g+r[4],ut=r[1]*p+r[3]*g+r[5];const ht=lt+M.x+rt,ct=ut+M.y+Y;M.transformedX=ht,M.transformedY=ct}}}})}}const ci=32;let K=class extends W{constructor(t){super(t),this._lastUpdate=0,this.collisionEngine=new hi,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return Wt("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}: +-> updateRequested: ${this.updateRequested}`),this.updateRequested}update(t){const e=performance.now();e-this._lastUpdate>=ci?(this._lastUpdate=e,this.doUpdate(t)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(t){this.updateRequested&&(this.updateRequested=!1,this.update(t))}doUpdate(t){const e=this.view;if(e)try{const i=t.state.scale,s=e.featuresTilingScheme.getClosestInfoForScale(i).level;this.collisionEngine.run(e.allLayerViews.items,t,i,s)}catch{}}};c([f()],K.prototype,"updateRequested",void 0),c([f()],K.prototype,"updating",null),c([f()],K.prototype,"view",void 0),K=c([X("esri.views.2d.LabelManager")],K);const gt="esri-zoom-box",_t={container:`${gt}__container`,overlay:`${gt}__overlay`,background:`${gt}__overlay-background`,box:`${gt}__outline`},$t={zoom:"Shift",counter:"Control"};let tt=class extends W{constructor(t){super(t),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(t){this.removeAllHandles(),this._destroyOverlay(),this._set("view",t),t&&this.addHandles([t.on("drag",[$t.zoom],e=>this._handleDrag(e,1),ee.INTERNAL),t.on("drag",[$t.zoom,$t.counter],e=>this._handleDrag(e,-1),ee.INTERNAL)])}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,s){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=s,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,i,s,a){const o=this.view,n=o.toMap(ke(t+.5*i,e+.5*s));let l=Math.max(i/o.width,s/o.height);a===-1&&(l=1/l),this._destroyOverlay(),this.navigation.end(),o.goTo({center:n,scale:o.scale*l},{animationMode:"always",duration:pe()})}_updateBox(t,e,i,s){const a=this._boxShape;a.setAttributeNS(null,"x",""+t),a.setAttributeNS(null,"y",""+e),a.setAttributeNS(null,"width",""+i),a.setAttributeNS(null,"height",""+s),a.setAttributeNS(null,"class",_t.box)}_updateBackground(t,e,i,s){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,s,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=_t.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",_t.background);const s=document.createElementNS("http://www.w3.org/2000/svg","rect"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),a.setAttributeNS(null,"class",_t.overlay),a.appendChild(i),a.appendChild(s),this._container.appendChild(a),this._backgroundShape=i,this._boxShape=s,this._overlay=a}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,s,a,o){const n=t+i,l=e+s;return"M 0 0 L "+a+" 0 L "+a+" "+o+" L 0 "+o+" ZM "+t+" "+e+" L "+t+" "+l+" L "+n+" "+l+" L "+n+" "+e+" Z"}_handleDrag(t,e){const i=t.x,s=t.y,a=t.origin.x,o=t.origin.y;let n,l,r,u;switch(i>a?(n=a,r=i-a):(n=i,r=a-i),s>o?(l=o,u=s-o):(l=s,u=o-s),t.action){case"start":this._start();break;case"update":this._update(n,l,r,u);break;case"end":this._end(n,l,r,u,e)}t.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:t,y:e,width:i,height:s}=this._box;this._updateBox(t,e,i,s),this._updateBackground(t,e,i,s),this._rafId=requestAnimationFrame(this._redraw)}};c([f()],tt.prototype,"navigation",void 0),c([f()],tt.prototype,"view",null),tt=c([X("esri.views.2d.navigation.ZoomBox")],tt);const mi=tt;let R=class{constructor(t){this._gain=t,this.lastValue=void 0,this.filteredDelta=void 0}update(t){if(this.hasLastValue()){const e=this.computeDelta(t);this._updateDelta(e)}this.lastValue=t}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(t){return this.lastValue===void 0?NaN:t-this.lastValue}_updateDelta(t){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*t:this.filteredDelta=t}};class Ht{constructor(e,i,s){this._initialVelocity=e,this._stopVelocity=i,this._friction=s,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,i){const s=this.value(e);return this.value(e+i)-s}valueFromInitialVelocity(e,i){i=Math.min(i,this.duration);const s=1-this.friction;return e*(s**i-1)/Math.log(s)}}class di extends Ht{constructor(e,i,s,a,o){super(e,i,s),this._sceneVelocity=a,this.direction=o}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}}class pi{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._time=new R(.6),this._screen=[new R(.4),new R(.4)],this._scene=[new R(.6),new R(.6),new R(.6)],this._tmpDirection=ue()}add(e,i,s){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(s)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(i[0]),this._scene[1].update(i[1]),this._scene[2].update(i[2]),this._time.update(s)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,i=this._screen[1].filteredDelta,s=e==null||i==null?0:Math.sqrt(e*e+i*i),a=this._time.filteredDelta,o=a==null||s==null?0:s/a;return Math.abs(o)0&&ge(this._tmpDirection,this._tmpDirection,1/a);const o=this._time.filteredDelta;return new di(e,i,s,o==null?0:a/o,this._tmpDirection)}}let q=class extends W{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new pi(500,6,.92),this.momentum=null,this.tmpMomentum=ue(),this.momentumFinished=!1,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this._previousDrag=null,he(()=>this.momentumFinished,()=>this.navigation.stop())}begin(t,e){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(e),this._previousDrag=e}update(t,e){this.addToEstimator(e);let i=e.center.x,s=e.center.y;const a=this._previousDrag;i=a?a.center.x-i:-i,s=a?s-a.center.y:s,t.viewpoint=ft(this.viewpoint,t.viewpoint,[i||0,s||0]),this._previousDrag=e}end(t,e){this.addToEstimator(e);const i=t.navigation.effectiveMomentumEnabled;this.momentum=i?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const e=t.center.x,i=t.center.y,s=Fe(-e,i),a=Se(-e,i,0);this.momentumEstimator.add(s,a,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(e,i)=>{const{momentum:s,animationTime:a,tmpMomentum:o}=this,n=.001*i;if(!(this.momentumFinished=!s||s.isFinished(a))){const l=s.valueDelta(a,n);ge(o,s.direction,l),ft(e,e,o),t.constraints.constrainByGeometry(e)}this.animationTime+=n})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};c([f()],q.prototype,"momentumFinished",void 0),c([f()],q.prototype,"viewpoint",void 0),c([f()],q.prototype,"navigation",void 0),q=c([X("esri.views.2d.navigation.actions.Pan")],q);const gi=q;let ve=class{constructor(t=2.5,e=.01,i=.95,s=12){this._minimumInitialVelocity=t,this._stopVelocity=e,this._friction=i,this._maxVelocity=s,this.enabled=!0,this.value=new R(.8),this.time=new R(.3)}add(t,e){if(this.enabled&&e!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(e)<.01)return;if(this.value.hasFilteredDelta()){const i=this.value.computeDelta(t);this.value.filteredDelta*i<0&&this.value.reset()}}this.time.update(e),this.value.update(t)}}reset(){this.value.reset(),this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let t=this.value.filteredDelta/this.time.filteredDelta;return t=L(t,-this._maxVelocity,this._maxVelocity),Math.abs(t)Math.PI;)a-=2*Math.PI;for(;a<-Math.PI;)a+=2*Math.PI;e=s+a}super.add(e,i)}}class yi extends Ht{constructor(e,i,s){super(e,i,s)}value(e){const i=super.value(e);return Math.exp(i)}valueDelta(e,i){const s=super.value(e),a=super.value(e+i)-s;return Math.exp(a)}}class wi extends ve{constructor(e=2.5,i=.01,s=.95,a=12){super(e,i,s,a)}add(e,i){super.add(Math.log(e),i)}createMomentum(e,i,s){return new yi(e,i,s)}}let U=class extends W{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new _i(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new wi,this._zoomOnly=null,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this.zoomMomentum=null,this.rotateMomentum=null,this.addHandles(he(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,e){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=e.angle,this._previousRadius=this._startRadius=e.radius,this._previousCenter=e.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,e.timestamp),this.addToZoomEstimator(e,1)}update(t,e){this._updateTimestamp===null&&(this._updateTimestamp=e.timestamp);const i=e.angle,s=e.radius,a=e.center,o=Math.abs(180*(i-this._startAngle)/Math.PI),n=Math.abs(s-this._startRadius),l=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const r=s/this._previousRadius;let u=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=u>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(this._zoomOnly===null&&e.timestamp-this._updateTimestamp>200&&(this._zoomOnly=n-o>0),this._zoomOnly===null||this._zoomOnly?u=0:this.addToRotateEstimator(i-this._startAngle,e.timestamp)):u=0,this.addToZoomEstimator(e,l),this.navigation.setViewpoint([a.x,a.y],1/r,u,[this._previousCenter.x-a.x,a.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=a}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,e){this._rotationMomentumEstimator.add(t,.001*e)}addToZoomEstimator(t,e){this._zoomMomentumEstimator.add(e,.001*t.timestamp)}canZoomIn(t){const e=t.scale,i=t.constraints.effectiveMaxScale;return i===0||e>i}canZoomOut(t){const e=t.scale,i=t.constraints.effectiveMinScale;return i===0||e{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,a=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),o=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),n=.001*i;if(this._momentumFinished=a&&o,!this._momentumFinished){const l=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,n))*this._rotationDirection*180/Math.PI:0;let r=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,n)):1;const u=nt(),m=nt();if(this._previousCenter){qt(u,this._previousCenter.x,this._previousCenter.y),He(m,t.size,t.padding),ni(u,u,m);const{constraints:_,scale:p}=t,g=p*r;r<1&&!_.canZoomInTo(g)?(r=p/_.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):r>1&&!_.canZoomOutTo(g)&&(r=p/_.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),Qe(e,t.viewpoint,r,l,u,t.size),t.constraints.constrainByGeometry(e)}}this._animationTime+=n})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};c([f()],U.prototype,"_momentumFinished",void 0),c([f()],U.prototype,"viewpoint",void 0),c([f()],U.prototype,"navigation",void 0),U=c([X("esri.views.2d.navigation.actions.Pinch")],U);const vi=U,It=nt(),ae=nt();let et=class extends W{constructor(t){super(t),this._previousCenter=nt(),this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0})}begin(t,e){this.navigation.begin(),qt(this._previousCenter,e.center.x,e.center.y)}update(t,e){const{state:{size:i,padding:s}}=t;qt(It,e.center.x,e.center.y),Ke(ae,i,s),t.viewpoint=Ot(this.viewpoint,t.state.paddedViewState.viewpoint,Je(ae,this._previousCenter,It)),oi(this._previousCenter,It)}end(){this.navigation.end()}};c([f()],et.prototype,"viewpoint",void 0),c([f()],et.prototype,"navigation",void 0),et=c([X("esri.views.2d.navigation.actions.Rotate")],et);const fi=et,O=10,re=1,Pt=new St({targetGeometry:new xt}),At=[0,0],le=250;let V=class extends W{constructor(t){super(t),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new gi({navigation:this}),this.rotate=new fi({navigation:this}),this.pinch=new vi({navigation:this}),this.zoomBox=new mi({view:this.view,navigation:this})}destroy(){this.pan=mt(this.pan),this.rotate=mt(this.rotate),this.pinch=mt(this.pinch),this.zoomBox=mt(this.zoomBox),this.animationManager=null}begin(){this.stop(),this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(le)}async zoom(t,e=this._getDefaultAnchor()){if(this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return t<1?this.zoomIn(e):this.zoomOut(e);this.setViewpoint(e,t,0,[0,0])}async zoomIn(t){const e=this.view,i=e.constraints.snapToNextScale(e.scale);return this._zoomToScale(i,t)}async zoomOut(t){const e=this.view,i=e.constraints.snapToPreviousScale(e.scale);return this._zoomToScale(i,t)}setViewpoint(t,e,i,s){this.begin(),this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,t,e,i,s),this.end()}setViewpointImmediate(t,e=0,i=[0,0],s=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,s,t,e,i)}continuousRotateClockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,-re)})}continuousRotateCounterclockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,re)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continuousPanLeft(){this._continuousPan([-O,0])}continuousPanRight(){this._continuousPan([O,0])}continuousPanUp(){this._continuousPan([0,O])}continuousPanDown(){this._continuousPan([0,-O])}continuousPanVector({x:t,y:e}){this._continuousPan([t*O,e*O])}stop(){this.pan.stopMomentumNavigation(),this.animationManager?.stop(),this.end(),this._endTimer!==null&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(t){const e=this.view.viewpoint;this.animationManager?.animateContinuous(e,i=>{ft(i,i,t),this.view.constraints.constrainByGeometry(i)})}_startTimer(t){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const e=performance.now()-(this._lastEventTimestamp??0);ea&&!u))return ie(Pt,o,t/a,0,e,n,l),s.constrainByGeometry(Pt),i.goTo(Pt,{animate:!0,animationMode:"always",duration:pe(),pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(t,e,i,s,a){const{view:o}=this,{size:n,padding:l,constraints:r,scale:u,viewpoint:m}=o,_=u*i,p=r.canZoomInTo(_),g=r.canZoomOutTo(_);return(i<1&&!p||i>1&&!g)&&(i=1),ft(m,m,a),ie(t,m,i,s,e,n,l),r.constrainByGeometry(t)}};c([f()],V.prototype,"animationManager",void 0),c([f({type:Boolean,readOnly:!0})],V.prototype,"interacting",void 0),c([f()],V.prototype,"pan",void 0),c([f()],V.prototype,"pinch",void 0),c([f()],V.prototype,"rotate",void 0),c([f()],V.prototype,"view",void 0),c([f()],V.prototype,"zoomBox",void 0),V=c([X("esri.views.2d.navigation.MapViewNavigation")],V);const Ni=V;class fe extends Ct{}c([Mt(0,S)],fe.prototype,"position",void 0);class bi extends Ft{}class z extends ot{}c([w(j)],z.prototype,"readbackTexture",void 0),c([w(j)],z.prototype,"maskTexture",void 0),c([w(j)],z.prototype,"overlayTexture",void 0),c([w(y)],z.prototype,"background",void 0),c([w(y)],z.prototype,"drawPos",void 0),c([w(h)],z.prototype,"maskEnabled",void 0),c([w(h)],z.prototype,"overlayEnabled",void 0);class Zt extends Tt{vertex(e){const i=e.position,s=e.position.subtract(new S(.5)).multiply(this.config.drawPos.zw),a=this.config.drawPos.xy.add(s);return{glPosition:new y(a,0,1),texCoord:i}}fragment(e){let i=G(this.config.readbackTexture,xi(e.texCoord));i=i.add(new h(1).subtract(i.a)).multiply(this.config.background);const s=C(D(this.config.maskEnabled,new h(1)),G(this.config.maskTexture,e.texCoord).a,new h(1));i=i.multiply(s);const a=C(D(this.config.overlayEnabled,new h(1)),G(this.config.overlayTexture,e.texCoord),new y(0)),o=new kt;return o.glFragColor=a.add(new h(1).subtract(a.a).multiply(i)),o}}function xi(t){const e=t.multiply(new S(2)).subtract(1);return C(D(e.x,new h(0)).and(D(e.y,new h(0))),new S(.5),()=>{const i=Ae(e.y,e.x),s=Ze(Be(e),new h(Ne)),a=new S(Oe(i),qe(i));return s.multiply(a).multiply(new S(.5)).add(new h(.5))})}c([w(z)],Zt.prototype,"config",void 0),c([I(0,A(fe))],Zt.prototype,"vertex",null),c([I(0,A(bi))],Zt.prototype,"fragment",null);class be extends Ct{}c([Mt(0,S)],be.prototype,"position",void 0);class Mi extends Ft{}class xe extends ot{}c([w(Ue)],xe.prototype,"dvs",void 0);class N extends ot{}c([w(h)],N.prototype,"halfWidth",void 0),c([w(h)],N.prototype,"aaWidth",void 0),c([w(h)],N.prototype,"pxPerCell",void 0),c([w(y)],N.prototype,"minorLineColor",void 0),c([w(y)],N.prototype,"majorLineColor",void 0),c([w(Bt)],N.prototype,"majorLineInterval",void 0);class yt extends Tt{vertex(e){const i=e.position.multiply(2).subtract(1);return{gridPos:this.transform.dvs.multiply(new b(i,1)).xy,glPosition:new y(i,0,1)}}fragment(e){const i=ce(e.gridPos),s=Le(i),a=F(s.x,new h(1).subtract(s.x)),o=F(s.y,new h(1).subtract(s.y)),n=new S(a,o).multiply(this.config.pxPerCell).subtract(this.config.halfWidth),l=F(n.x,n.y),r=new h(1).subtract(ze(new h(0),this.config.aaWidth,l)),u=new Bt(Jt(i.x)),m=new Bt(Jt(i.y)),_=new h(te(u,this.config.majorLineInterval)),p=new h(te(m,this.config.majorLineInterval)),g=C(de(n.x,n.y),_,p),v=Xt(Re(P(n.x,this.config.aaWidth),P(n.y,this.config.aaWidth)),new h(.5)),T=F(_,p),at=C(v,T,g),rt=$e(this.config.majorLineColor,this.config.minorLineColor,F(at,new h(1))),Y=new kt;return Y.glFragColor=rt.multiply(r),Y}}c([w(xe)],yt.prototype,"transform",void 0),c([w(N)],yt.prototype,"config",void 0),c([I(0,A(be))],yt.prototype,"vertex",null),c([I(0,A(Mi))],yt.prototype,"fragment",null);export{Zt as E,Ni as F,Rt as T,$i as a,Ii as b,Pi as c,Zi as d,K as j,Ai as m,yt as r,dt as t}; diff --git a/main/assets/GridShader-75bC4UUM-Czob75PE.js b/main/assets/GridShader-75bC4UUM-Czob75PE.js deleted file mode 100644 index e2585caf5..000000000 --- a/main/assets/GridShader-75bC4UUM-Czob75PE.js +++ /dev/null @@ -1,3 +0,0 @@ -import{o as $}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{v as c,hF as I,K as Wt,j as W,S as f,i as X,w as xt,I as Te,as as ke,dU as ue,aF as he,aA as mt,ae as L,ih as Fe,hZ as Se}from"./main-BZaw9FpY.js";import{t as Mt,v as w,A as De,ax as Ct,C as ot,ay as Tt,L as y,bf as Ee,a7 as G,F as C,N as D,S as h,aa as Z,a4 as b,bg as d,ab as ce,az as Nt,aL as F,au as P,a6 as me,a5 as Qt,bh as Kt,bi as Ve,ap as Xt,aw as A,ar as S,aV as Le,aB as ze,aQ as Bt,bj as Jt,bk as te,am as de,bl as Re,ak as $e,a_ as j,b9 as kt,aW as Ie,aC as Pe,bm as Ae,aX as Ze,bn as Ne,aA as Be,a3 as Oe,a2 as qe,M as Ue,bd as Ft}from"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import{i as Ge}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{b as je}from"./testSVGPremultipliedAlpha-DoZe_f0d-C4elE3ip.js";import{D as We,b as Xe,g as Ye}from"./definitions-DJSdSb77-DkoRHaVx.js";import{f as St,_ as ee,d as pe,k as ft,g as He,G as Qe,$ as Ke,j as Ot,p as Je,n as ie,L as ti}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{B as ei}from"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import{L as ge,_ as ii,b as si}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{m as qt,b as ni,d as oi}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as nt}from"./vec2f64-CeODonrJ-CkkJCdRC.js";const $i={shaders:{vertexShader:$("bitBlit/bitBlit.vert"),fragmentShader:$("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])},Ii={shaders:{vertexShader:$("stencil/stencil.vert"),fragmentShader:$("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])};class _e extends Ct{}c([Mt(0,S)],_e.prototype,"position",void 0);class ai extends Ft{}class J extends ot{}c([w(j)],J.prototype,"layerTexture",void 0),c([w(j)],J.prototype,"backbufferTexture",void 0),c([w(h)],J.prototype,"opacity",void 0),c([w(h)],J.prototype,"inFadeOpacity",void 0);class dt extends Tt{vertex(e){return{uv:e.position,glPosition:new y(Ee(e.position),0,1)}}fragment(e){const i=new kt,s=G(this.config.layerTexture,e.uv),a=G(this.config.backbufferTexture,e.uv),o=C(D(s.a,new h(0)),s.rgb,s.rgb.divide(s.a)),n=C(D(a.a,new h(0)),a.rgb,a.rgb.divide(a.a)),l=this.config.opacity.multiply(s.a),r=a.a;switch(this.blendMode){case"destination-over":i.glFragColor=new y(o.multiply(l).multiply(d(r)).add(n.multiply(r)),l.add(r).subtract(l.multiply(r)));break;case"source-in":{const u=new y(o.multiply(l).multiply(r),l.multiply(r)),m=new y(n.multiply(r),r).multiply(d(this.config.opacity)).multiply(this.config.inFadeOpacity);i.glFragColor=u.add(m)}break;case"destination-in":{const u=new y(n.multiply(r).multiply(l),r.multiply(l)),m=new y(n.multiply(r),r).multiply(new y(d(this.config.opacity).multiply(this.config.inFadeOpacity)));i.glFragColor=u.add(m)}break;case"source-out":i.glFragColor=new y(o.multiply(l).multiply(d(r)),l.multiply(d(r)));break;case"destination-out":i.glFragColor=new y(n.multiply(r).multiply(d(l)),r.multiply(d(l)));break;case"source-atop":i.glFragColor=new y(o.multiply(l).multiply(r).add(n.multiply(r.multiply(d(l)))),r);break;case"destination-atop":i.glFragColor=new y(o.multiply(l.multiply(d(r))).add(n.multiply(r).multiply(l)),l);break;case"xor":i.glFragColor=new y(o.multiply(l.multiply(d(r))).add(n.multiply(r.multiply(d(l)))),l.multiply(d(r)).add(r.multiply(d(l))));break;case"multiply":i.glFragColor=new y(o.multiply(l).multiply(n.multiply(r)).add(o.multiply(l).multiply(d(r))).add(n.multiply(r).multiply(d(l))),l.add(r.multiply(d(l))));break;case"screen":i.glFragColor=new y(o.add(n).subtract(o.multiply(n)).multiply(l.multiply(r)).add(o.multiply(l).multiply(d(r))).add(n.multiply(r).multiply(d(l))),l.add(r.multiply(d(l))));break;case"overlay":{const u=new b(Dt(n.r,o.r),Dt(n.g,o.g),Dt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"darken":{const u=F(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"lighter":i.glFragColor=new y(o.multiply(l).add(n.multiply(r)),l.add(r));break;case"lighten":{const u=Nt(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"color-dodge":{const u=Z(new b(wt(n.r,o.r),wt(n.g,o.g),wt(n.b,o.b)),new b(0),new b(1));i.glFragColor=x(u,o,n,l,r)}break;case"color-burn":{const u=new b(vt(n.r,o.r),vt(n.g,o.g),vt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"hard-light":{const u=new b(Et(n.r,o.r),Et(n.g,o.g),Et(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"soft-light":{const u=new b(Vt(n.r,o.r),Vt(n.g,o.g),Vt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"difference":{const u=ce(n.subtract(o));i.glFragColor=x(u,o,n,l,r)}break;case"exclusion":{const u=o.add(n).subtract(new h(2).multiply(o).multiply(n));i.glFragColor=x(u,o,n,l,r)}break;case"invert":i.glFragColor=new y(new b(1).subtract(n).multiply(l).multiply(r).add(n.multiply(r).multiply(d(l))),r);break;case"vivid-light":{const u=new b(Z(Lt(n.r,o.r),new h(0),new h(1)),Z(Lt(n.g,o.g),new h(0),new h(1)),Z(Lt(n.b,o.b),new h(0),new h(1)));i.glFragColor=x(u,o,n,l,r)}break;case"hue":{const u=ne(o,n,n);i.glFragColor=x(u,o,n,l,r)}break;case"saturation":{const u=ne(n,o,n);i.glFragColor=x(u,o,n,l,r)}break;case"color":{const u=Gt(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"luminosity":{const u=Gt(n,o);i.glFragColor=x(u,o,n,l,r)}break;case"plus":i.glFragColor=Z(new y(s.r.add(n.r),s.g.add(n.g),s.b.add(n.b),l.add(r)),new y(0),new y(1));break;case"minus":i.glFragColor=new y(Z(new b(n.r.subtract(s.r),n.g.subtract(s.g),n.b.subtract(s.b)),new b(0),new b(1)),r.multiply(l));break;case"average":{const u=n.add(o).divide(2);i.glFragColor=x(u,o,n,l,r)}break;case"reflect":{const u=Z(new b(zt(n.r,o.r),zt(n.g,o.g),zt(n.b,o.b)),new b(0),new b(1));i.glFragColor=x(u,o,n,l,r)}break;default:i.glFragColor=s.multiply(this.config.opacity)}return i}}function x(t,e,i,s,a){return new y(t.multiply(s).multiply(a).add(e.multiply(s).multiply(d(a))).add(i.multiply(a).multiply(d(s))),s.add(a.multiply(d(s))))}function Dt(t,e){return new h(1).subtract(P(new h(.5),e)).multiply(d(new h(2).multiply(d(e).multiply(d(t))))).add(P(new h(.5),e).multiply(new h(2).multiply(e).multiply(t)))}function wt(t,e){return C(D(t,new h(0)),new h(0),C(D(e,new h(1)),new h(1),F(new h(1),t.divide(new h(1).subtract(e)))))}function vt(t,e){return C(D(t,new h(1)),new h(1),C(D(e,new h(0)),new h(0),d(F(new h(1),d(t).divide(e)))))}function Et(t,e){return new h(1).subtract(P(new h(.5),e)).multiply(new h(2).multiply(e).multiply(t)).add(P(new h(.5),e).multiply(d(new h(2).multiply(d(e).multiply(d(t))))))}function Vt(t,e){return me([Qt(e,new h(.5)),()=>{const i=new h(2).multiply(e),s=d(i),a=d(t);return t.subtract(s.multiply(t).multiply(a))}],[Qt(t,new h(.25)),()=>{const i=new h(2).multiply(e),s=Kt(i).multiply(t),a=new h(16).multiply(t).subtract(new h(12)).multiply(t).add(new h(3));return t.add(s.multiply(a))}],[!0,()=>{const i=new h(2).multiply(e),s=Kt(i),a=Ie(t).subtract(t);return t.add(s.multiply(a))}])}function Lt(t,e){const i=d(P(new h(.5),e)).multiply(vt(t,new h(2).multiply(e))),s=P(new h(.5),e).multiply(wt(t,new h(2).multiply(Ve(e,.5))));return i.add(s)}function Yt(t){return F(F(t.r,t.g),t.b)}function ye(t){return Nt(Nt(t.r,t.g),t.b)}function Ut(t){return Pe(t,new b(.3,.59,.11))}function se(t){return ye(t).subtract(Yt(t))}function ri(t){const e=Ut(t),i=Yt(t),s=ye(t);return me([de(i,new h(0)),()=>{const a=t.subtract(e).multiply(e),o=e.subtract(i);return e.add(a.divide(o))}],[Xt(s,new h(1)),()=>{const a=t.subtract(e),o=d(e),n=a.multiply(o),l=s.subtract(e);return e.add(n.divide(l))}],[!0,t])}function Gt(t,e){const i=Ut(t),s=Ut(e).subtract(i);return ri(t.add(new b(s)))}function ne(t,e,i){const s=Yt(t),a=se(t),o=se(e);return Gt(C(Xt(a,new h(0)),()=>t.subtract(s).multiply(o).divide(a),new b(0)),i)}function zt(t,e){return C(D(e,new h(1)),e,()=>{const i=d(e),s=t.multiply(t).divide(i);return F(s,new h(1))})}c([De],dt.prototype,"blendMode",void 0),c([w(J)],dt.prototype,"config",void 0),c([I(0,A(_e))],dt.prototype,"vertex",null),c([I(0,A(ai))],dt.prototype,"fragment",null);class we extends Ct{}c([Mt(0,S)],we.prototype,"position",void 0);class li extends Ft{}let jt=class extends ot{};c([w(j)],jt.prototype,"layerTexture",void 0),c([w(h)],jt.prototype,"opacity",void 0);let Rt=class extends Tt{vertex(t){return{uv:t.position,glPosition:new y(t.position.subtract(new S(.5)).multiply(2),0,1)}}fragment(t){const e=new kt;return e.glFragColor=G(this.config.layerTexture,t.uv).multiply(this.config.opacity),e}};c([w(jt)],Rt.prototype,"config",void 0),c([I(0,A(we))],Rt.prototype,"vertex",null),c([I(0,A(li))],Rt.prototype,"fragment",null);const Pi={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Ai={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},k=!!Wt("esri-2d-profiler");let Zi=class{constructor(t,e){if(this._events=new Te,this._entries=new Map,this._timings=new Ge(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!k)return;this._ext=je(t.gl,{}),this._debugOutput=e;const i=t.gl;if(!this.enableCommandLogging)return;let s;for(s in i)if(typeof i[s]=="function"){const a=i[s],o=s.includes("draw");i[s]=(...n)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:n,isDrawCommand:o}),this._currentSummary&&(this._currentSummary.commands++,o&&this._currentSummary.drawCommands++),a.apply(i,n))}}get enableCommandLogging(){return!(typeof k=="object"&&k.disableCommands)}recordContainerStart(t){k&&(this._currentContainer=t)}recordContainerEnd(){k&&(this._currentContainer=null)}recordPassStart(t){k&&(this._currentPass=t,this._initSummary())}recordPassEnd(){k&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){k&&(this._currentBrush=t)}recordBrushEnd(){k&&(this._currentBrush=null)}recordStart(t){if(k&&this._ext!=null){if(this._entries.has(t)){const i=this._entries.get(t),s=this._ext.resultAvailable(i.query),a=this._ext.disjoint();if(s&&!a){const o=this._ext.getResult(i.query)/1e6;let n=0;if(this._timings.enqueue(o)!=null){const u=this._timings.entries,m=u.length;let _=0;for(const p of u)_+=p;n=_/m}const l=o.toFixed(2),r=n?n.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${l} ms (${r} last 10 avg) -${i.commandsLen} Commands (${i.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(i.summaries),console.log("Commands: ",i.commands),console.groupEnd()):console.log(`Frame report for ${t}, ${l} ms (${r} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${r})`}for(const o of i.handles)o.remove();this._ext.deleteQuery(i.query),this._entries.delete(t)}const e={name:t,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(e.handles.push(this._events.on("command",i=>{e.commandsLen++,e.commands.push(i),i.isDrawCommand&&e.drawCommands++})),e.handles.push(this._events.on("summary",i=>{e.summaries.push(i)}))),this._ext.beginTimeElapsed(e.query),this._entries.set(t,e)}}recordEnd(t){k&&this._ext!=null&&this._entries.has(t)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}};const E=1,bt=0,it=1,st=2;let ui=class{constructor(t,e,i){this._width=t*i,this._height=e*i,this._pixelRatio=i;const s=Math.ceil(this._width/E),a=Math.ceil(this._height/E);this._cols=s,this._rows=a,this._cells=ei.create(s*a)}insertMetrics(t){this._markMetrics(t)}hasCollision(t){let e=0;for(const{transformedX:i,transformedY:s,width:a,height:o}of t.bounds){const n=a*this._pixelRatio,l=o*this._pixelRatio,r=i*this._pixelRatio,u=s*this._pixelRatio;switch(this._collide(r,u,n,l)){case st:return st;case it:e++}}return e===t.bounds.length?it:bt}getCellId(t,e){return t+e*this._cols}has(t){return this._cells.has(t)}hasRange(t,e){return this._cells.hasRange(t,e)}set(t){this._cells.set(t)}setRange(t,e){this._cells.setRange(t,e)}_collide(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s;if(n<0||l<0||a>this._width||o>this._height)return it;const r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);if(this.has(v))return st}return bt}_mark(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s,r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);this.set(v)}return!1}_markMetrics(t){for(const{transformedX:e,transformedY:i,width:s,height:a}of t.bounds){const o=s*this._pixelRatio,n=a*this._pixelRatio,l=e*this._pixelRatio,r=i*this._pixelRatio;this._mark(l,r,o,n)}}};const H=254,pt=255,Q=0;function B(t,e){const i=t.children.slice();i.sort((s,a)=>s.tileAge-a.tileAge),i.forEach(s=>{s.labelMetrics!=null&&s.isReady&&e(s,s.labelMetrics)})}function oe(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}class hi{run(e,i,s,a){const o=[];for(let n=e.length-1;n>=0;n--){const l=e[n];l.labelingCollisionInfos?.length&&o.push(...l.labelingCollisionInfos)}Wt("esri-2d-update-debug")&&o.length&&console.debug("CollisionEngine.run"),this._transformMetrics(o),this._runCollision(o,i,s,a);for(const n of o)n.container.requestRender()}_runCollision(e,i,s,a){const[o,n]=i.state.size,l=new ui(o,n,i.pixelRatio);for(const{container:r,deconflictionEnabled:u,visible:m}of e){const _=r.attributeView;u?m?(this._prepare(r),this._collideVisible(l,r,s,a),this._collideInvisible(l,r)):B(r,(p,g)=>{for(const v of g)_.setLabelMinZoom(v.entityTexel,pt)}):B(r,(p,g)=>{for(const v of g)oe(v,s)?(_.setLabelMinZoom(v.entityTexel,Q),m&&l.insertMetrics(v)):_.setLabelMinZoom(v.entityTexel,H)})}}_isFiltered(e,i,s){const a=i.getFilterFlags(e),o=!s.hasFilter||!!(a&We),n=s.featureEffect==null||s.featureEffect.excludedLabelsVisible||!!(a&Xe);return!(o&&n)}_prepare(e){const i=e.attributeView,s=new Set;B(e,(a,o)=>{for(const n of o){const l=n.entityTexel;if(!s.has(l)){if(s.add(l),this._isFiltered(l,i,e.layerView)){i.setLabelMinZoom(l,H);continue}i.getLabelMinZoom(l)!==Q?i.setLabelMinZoom(l,pt):i.setLabelMinZoom(l,Q)}}})}_collideVisible(e,i,s,a){const o=i.attributeView,n=new Set;B(i,(l,r)=>{for(let u=0;u{for(let l=0;l{const l=i.attributeView,r=o.transforms.labelMat2d;r[4]=Math.round(r[4]),r[5]=Math.round(r[5]);const u=s==="polyline";for(const m of n){const{entityTexel:_,anchorX:p,anchorY:g}=m;let v=m.referenceBounds?.size??0;const T=a[0];if(T!=null){const M=T(l.getVisualVariableData(_,ti.SIZE));v=isNaN(M)||M==null||M===1/0?v:M}const at=Ye+v/2,rt=m.directionX*at,Y=m.directionY*at;for(const M of m.bounds){let lt=p,ut=g;if(u){const ht=p+M.x+rt,ct=g+M.y+Y;lt=r[0]*ht+r[2]*ct+r[4],ut=r[1]*ht+r[3]*ct+r[5];const Me=lt,Ce=ut;M.transformedX=Math.floor(Me),M.transformedY=Math.floor(Ce)}else{lt=r[0]*p+r[2]*g+r[4],ut=r[1]*p+r[3]*g+r[5];const ht=lt+M.x+rt,ct=ut+M.y+Y;M.transformedX=ht,M.transformedY=ct}}}})}}const ci=32;let K=class extends W{constructor(t){super(t),this._lastUpdate=0,this.collisionEngine=new hi,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return Wt("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}: --> updateRequested: ${this.updateRequested}`),this.updateRequested}update(t){const e=performance.now();e-this._lastUpdate>=ci?(this._lastUpdate=e,this.doUpdate(t)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(t){this.updateRequested&&(this.updateRequested=!1,this.update(t))}doUpdate(t){const e=this.view;if(e)try{const i=t.state.scale,s=e.featuresTilingScheme.getClosestInfoForScale(i).level;this.collisionEngine.run(e.allLayerViews.items,t,i,s)}catch{}}};c([f()],K.prototype,"updateRequested",void 0),c([f()],K.prototype,"updating",null),c([f()],K.prototype,"view",void 0),K=c([X("esri.views.2d.LabelManager")],K);const gt="esri-zoom-box",_t={container:`${gt}__container`,overlay:`${gt}__overlay`,background:`${gt}__overlay-background`,box:`${gt}__outline`},$t={zoom:"Shift",counter:"Control"};let tt=class extends W{constructor(t){super(t),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(t){this.removeAllHandles(),this._destroyOverlay(),this._set("view",t),t&&this.addHandles([t.on("drag",[$t.zoom],e=>this._handleDrag(e,1),ee.INTERNAL),t.on("drag",[$t.zoom,$t.counter],e=>this._handleDrag(e,-1),ee.INTERNAL)])}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,s){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=s,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,i,s,a){const o=this.view,n=o.toMap(ke(t+.5*i,e+.5*s));let l=Math.max(i/o.width,s/o.height);a===-1&&(l=1/l),this._destroyOverlay(),this.navigation.end(),o.goTo({center:n,scale:o.scale*l},{animationMode:"always",duration:pe()})}_updateBox(t,e,i,s){const a=this._boxShape;a.setAttributeNS(null,"x",""+t),a.setAttributeNS(null,"y",""+e),a.setAttributeNS(null,"width",""+i),a.setAttributeNS(null,"height",""+s),a.setAttributeNS(null,"class",_t.box)}_updateBackground(t,e,i,s){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,s,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=_t.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",_t.background);const s=document.createElementNS("http://www.w3.org/2000/svg","rect"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),a.setAttributeNS(null,"class",_t.overlay),a.appendChild(i),a.appendChild(s),this._container.appendChild(a),this._backgroundShape=i,this._boxShape=s,this._overlay=a}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,s,a,o){const n=t+i,l=e+s;return"M 0 0 L "+a+" 0 L "+a+" "+o+" L 0 "+o+" ZM "+t+" "+e+" L "+t+" "+l+" L "+n+" "+l+" L "+n+" "+e+" Z"}_handleDrag(t,e){const i=t.x,s=t.y,a=t.origin.x,o=t.origin.y;let n,l,r,u;switch(i>a?(n=a,r=i-a):(n=i,r=a-i),s>o?(l=o,u=s-o):(l=s,u=o-s),t.action){case"start":this._start();break;case"update":this._update(n,l,r,u);break;case"end":this._end(n,l,r,u,e)}t.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:t,y:e,width:i,height:s}=this._box;this._updateBox(t,e,i,s),this._updateBackground(t,e,i,s),this._rafId=requestAnimationFrame(this._redraw)}};c([f()],tt.prototype,"navigation",void 0),c([f()],tt.prototype,"view",null),tt=c([X("esri.views.2d.navigation.ZoomBox")],tt);const mi=tt;let R=class{constructor(t){this._gain=t,this.lastValue=void 0,this.filteredDelta=void 0}update(t){if(this.hasLastValue()){const e=this.computeDelta(t);this._updateDelta(e)}this.lastValue=t}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(t){return this.lastValue===void 0?NaN:t-this.lastValue}_updateDelta(t){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*t:this.filteredDelta=t}};class Ht{constructor(e,i,s){this._initialVelocity=e,this._stopVelocity=i,this._friction=s,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,i){const s=this.value(e);return this.value(e+i)-s}valueFromInitialVelocity(e,i){i=Math.min(i,this.duration);const s=1-this.friction;return e*(s**i-1)/Math.log(s)}}class di extends Ht{constructor(e,i,s,a,o){super(e,i,s),this._sceneVelocity=a,this.direction=o}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}}class pi{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._time=new R(.6),this._screen=[new R(.4),new R(.4)],this._scene=[new R(.6),new R(.6),new R(.6)],this._tmpDirection=ue()}add(e,i,s){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(s)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(i[0]),this._scene[1].update(i[1]),this._scene[2].update(i[2]),this._time.update(s)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,i=this._screen[1].filteredDelta,s=e==null||i==null?0:Math.sqrt(e*e+i*i),a=this._time.filteredDelta,o=a==null||s==null?0:s/a;return Math.abs(o)0&&ge(this._tmpDirection,this._tmpDirection,1/a);const o=this._time.filteredDelta;return new di(e,i,s,o==null?0:a/o,this._tmpDirection)}}let q=class extends W{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new pi(500,6,.92),this.momentum=null,this.tmpMomentum=ue(),this.momentumFinished=!1,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this._previousDrag=null,he(()=>this.momentumFinished,()=>this.navigation.stop())}begin(t,e){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(e),this._previousDrag=e}update(t,e){this.addToEstimator(e);let i=e.center.x,s=e.center.y;const a=this._previousDrag;i=a?a.center.x-i:-i,s=a?s-a.center.y:s,t.viewpoint=ft(this.viewpoint,t.viewpoint,[i||0,s||0]),this._previousDrag=e}end(t,e){this.addToEstimator(e);const i=t.navigation.effectiveMomentumEnabled;this.momentum=i?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const e=t.center.x,i=t.center.y,s=Fe(-e,i),a=Se(-e,i,0);this.momentumEstimator.add(s,a,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(e,i)=>{const{momentum:s,animationTime:a,tmpMomentum:o}=this,n=.001*i;if(!(this.momentumFinished=!s||s.isFinished(a))){const l=s.valueDelta(a,n);ge(o,s.direction,l),ft(e,e,o),t.constraints.constrainByGeometry(e)}this.animationTime+=n})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};c([f()],q.prototype,"momentumFinished",void 0),c([f()],q.prototype,"viewpoint",void 0),c([f()],q.prototype,"navigation",void 0),q=c([X("esri.views.2d.navigation.actions.Pan")],q);const gi=q;let ve=class{constructor(t=2.5,e=.01,i=.95,s=12){this._minimumInitialVelocity=t,this._stopVelocity=e,this._friction=i,this._maxVelocity=s,this.enabled=!0,this.value=new R(.8),this.time=new R(.3)}add(t,e){if(this.enabled&&e!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(e)<.01)return;if(this.value.hasFilteredDelta()){const i=this.value.computeDelta(t);this.value.filteredDelta*i<0&&this.value.reset()}}this.time.update(e),this.value.update(t)}}reset(){this.value.reset(),this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let t=this.value.filteredDelta/this.time.filteredDelta;return t=L(t,-this._maxVelocity,this._maxVelocity),Math.abs(t)Math.PI;)a-=2*Math.PI;for(;a<-Math.PI;)a+=2*Math.PI;e=s+a}super.add(e,i)}}class yi extends Ht{constructor(e,i,s){super(e,i,s)}value(e){const i=super.value(e);return Math.exp(i)}valueDelta(e,i){const s=super.value(e),a=super.value(e+i)-s;return Math.exp(a)}}class wi extends ve{constructor(e=2.5,i=.01,s=.95,a=12){super(e,i,s,a)}add(e,i){super.add(Math.log(e),i)}createMomentum(e,i,s){return new yi(e,i,s)}}let U=class extends W{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new _i(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new wi,this._zoomOnly=null,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this.zoomMomentum=null,this.rotateMomentum=null,this.addHandles(he(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,e){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=e.angle,this._previousRadius=this._startRadius=e.radius,this._previousCenter=e.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,e.timestamp),this.addToZoomEstimator(e,1)}update(t,e){this._updateTimestamp===null&&(this._updateTimestamp=e.timestamp);const i=e.angle,s=e.radius,a=e.center,o=Math.abs(180*(i-this._startAngle)/Math.PI),n=Math.abs(s-this._startRadius),l=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const r=s/this._previousRadius;let u=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=u>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(this._zoomOnly===null&&e.timestamp-this._updateTimestamp>200&&(this._zoomOnly=n-o>0),this._zoomOnly===null||this._zoomOnly?u=0:this.addToRotateEstimator(i-this._startAngle,e.timestamp)):u=0,this.addToZoomEstimator(e,l),this.navigation.setViewpoint([a.x,a.y],1/r,u,[this._previousCenter.x-a.x,a.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=a}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,e){this._rotationMomentumEstimator.add(t,.001*e)}addToZoomEstimator(t,e){this._zoomMomentumEstimator.add(e,.001*t.timestamp)}canZoomIn(t){const e=t.scale,i=t.constraints.effectiveMaxScale;return i===0||e>i}canZoomOut(t){const e=t.scale,i=t.constraints.effectiveMinScale;return i===0||e{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,a=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),o=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),n=.001*i;if(this._momentumFinished=a&&o,!this._momentumFinished){const l=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,n))*this._rotationDirection*180/Math.PI:0;let r=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,n)):1;const u=nt(),m=nt();if(this._previousCenter){qt(u,this._previousCenter.x,this._previousCenter.y),He(m,t.size,t.padding),ni(u,u,m);const{constraints:_,scale:p}=t,g=p*r;r<1&&!_.canZoomInTo(g)?(r=p/_.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):r>1&&!_.canZoomOutTo(g)&&(r=p/_.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),Qe(e,t.viewpoint,r,l,u,t.size),t.constraints.constrainByGeometry(e)}}this._animationTime+=n})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};c([f()],U.prototype,"_momentumFinished",void 0),c([f()],U.prototype,"viewpoint",void 0),c([f()],U.prototype,"navigation",void 0),U=c([X("esri.views.2d.navigation.actions.Pinch")],U);const vi=U,It=nt(),ae=nt();let et=class extends W{constructor(t){super(t),this._previousCenter=nt(),this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0})}begin(t,e){this.navigation.begin(),qt(this._previousCenter,e.center.x,e.center.y)}update(t,e){const{state:{size:i,padding:s}}=t;qt(It,e.center.x,e.center.y),Ke(ae,i,s),t.viewpoint=Ot(this.viewpoint,t.state.paddedViewState.viewpoint,Je(ae,this._previousCenter,It)),oi(this._previousCenter,It)}end(){this.navigation.end()}};c([f()],et.prototype,"viewpoint",void 0),c([f()],et.prototype,"navigation",void 0),et=c([X("esri.views.2d.navigation.actions.Rotate")],et);const fi=et,O=10,re=1,Pt=new St({targetGeometry:new xt}),At=[0,0],le=250;let V=class extends W{constructor(t){super(t),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new gi({navigation:this}),this.rotate=new fi({navigation:this}),this.pinch=new vi({navigation:this}),this.zoomBox=new mi({view:this.view,navigation:this})}destroy(){this.pan=mt(this.pan),this.rotate=mt(this.rotate),this.pinch=mt(this.pinch),this.zoomBox=mt(this.zoomBox),this.animationManager=null}begin(){this.stop(),this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(le)}async zoom(t,e=this._getDefaultAnchor()){if(this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return t<1?this.zoomIn(e):this.zoomOut(e);this.setViewpoint(e,t,0,[0,0])}async zoomIn(t){const e=this.view,i=e.constraints.snapToNextScale(e.scale);return this._zoomToScale(i,t)}async zoomOut(t){const e=this.view,i=e.constraints.snapToPreviousScale(e.scale);return this._zoomToScale(i,t)}setViewpoint(t,e,i,s){this.begin(),this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,t,e,i,s),this.end()}setViewpointImmediate(t,e=0,i=[0,0],s=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,s,t,e,i)}continuousRotateClockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,-re)})}continuousRotateCounterclockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,re)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continuousPanLeft(){this._continuousPan([-O,0])}continuousPanRight(){this._continuousPan([O,0])}continuousPanUp(){this._continuousPan([0,O])}continuousPanDown(){this._continuousPan([0,-O])}continuousPanVector({x:t,y:e}){this._continuousPan([t*O,e*O])}stop(){this.pan.stopMomentumNavigation(),this.animationManager?.stop(),this.end(),this._endTimer!==null&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(t){const e=this.view.viewpoint;this.animationManager?.animateContinuous(e,i=>{ft(i,i,t),this.view.constraints.constrainByGeometry(i)})}_startTimer(t){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const e=performance.now()-(this._lastEventTimestamp??0);ea&&!u))return ie(Pt,o,t/a,0,e,n,l),s.constrainByGeometry(Pt),i.goTo(Pt,{animate:!0,animationMode:"always",duration:pe(),pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(t,e,i,s,a){const{view:o}=this,{size:n,padding:l,constraints:r,scale:u,viewpoint:m}=o,_=u*i,p=r.canZoomInTo(_),g=r.canZoomOutTo(_);return(i<1&&!p||i>1&&!g)&&(i=1),ft(m,m,a),ie(t,m,i,s,e,n,l),r.constrainByGeometry(t)}};c([f()],V.prototype,"animationManager",void 0),c([f({type:Boolean,readOnly:!0})],V.prototype,"interacting",void 0),c([f()],V.prototype,"pan",void 0),c([f()],V.prototype,"pinch",void 0),c([f()],V.prototype,"rotate",void 0),c([f()],V.prototype,"view",void 0),c([f()],V.prototype,"zoomBox",void 0),V=c([X("esri.views.2d.navigation.MapViewNavigation")],V);const Ni=V;class fe extends Ct{}c([Mt(0,S)],fe.prototype,"position",void 0);class bi extends Ft{}class z extends ot{}c([w(j)],z.prototype,"readbackTexture",void 0),c([w(j)],z.prototype,"maskTexture",void 0),c([w(j)],z.prototype,"overlayTexture",void 0),c([w(y)],z.prototype,"background",void 0),c([w(y)],z.prototype,"drawPos",void 0),c([w(h)],z.prototype,"maskEnabled",void 0),c([w(h)],z.prototype,"overlayEnabled",void 0);class Zt extends Tt{vertex(e){const i=e.position,s=e.position.subtract(new S(.5)).multiply(this.config.drawPos.zw),a=this.config.drawPos.xy.add(s);return{glPosition:new y(a,0,1),texCoord:i}}fragment(e){let i=G(this.config.readbackTexture,xi(e.texCoord));i=i.add(new h(1).subtract(i.a)).multiply(this.config.background);const s=C(D(this.config.maskEnabled,new h(1)),G(this.config.maskTexture,e.texCoord).a,new h(1));i=i.multiply(s);const a=C(D(this.config.overlayEnabled,new h(1)),G(this.config.overlayTexture,e.texCoord),new y(0)),o=new kt;return o.glFragColor=a.add(new h(1).subtract(a.a).multiply(i)),o}}function xi(t){const e=t.multiply(new S(2)).subtract(1);return C(D(e.x,new h(0)).and(D(e.y,new h(0))),new S(.5),()=>{const i=Ae(e.y,e.x),s=Ze(Be(e),new h(Ne)),a=new S(Oe(i),qe(i));return s.multiply(a).multiply(new S(.5)).add(new h(.5))})}c([w(z)],Zt.prototype,"config",void 0),c([I(0,A(fe))],Zt.prototype,"vertex",null),c([I(0,A(bi))],Zt.prototype,"fragment",null);class be extends Ct{}c([Mt(0,S)],be.prototype,"position",void 0);class Mi extends Ft{}class xe extends ot{}c([w(Ue)],xe.prototype,"dvs",void 0);class N extends ot{}c([w(h)],N.prototype,"halfWidth",void 0),c([w(h)],N.prototype,"aaWidth",void 0),c([w(h)],N.prototype,"pxPerCell",void 0),c([w(y)],N.prototype,"minorLineColor",void 0),c([w(y)],N.prototype,"majorLineColor",void 0),c([w(Bt)],N.prototype,"majorLineInterval",void 0);class yt extends Tt{vertex(e){const i=e.position.multiply(2).subtract(1);return{gridPos:this.transform.dvs.multiply(new b(i,1)).xy,glPosition:new y(i,0,1)}}fragment(e){const i=ce(e.gridPos),s=Le(i),a=F(s.x,new h(1).subtract(s.x)),o=F(s.y,new h(1).subtract(s.y)),n=new S(a,o).multiply(this.config.pxPerCell).subtract(this.config.halfWidth),l=F(n.x,n.y),r=new h(1).subtract(ze(new h(0),this.config.aaWidth,l)),u=new Bt(Jt(i.x)),m=new Bt(Jt(i.y)),_=new h(te(u,this.config.majorLineInterval)),p=new h(te(m,this.config.majorLineInterval)),g=C(de(n.x,n.y),_,p),v=Xt(Re(P(n.x,this.config.aaWidth),P(n.y,this.config.aaWidth)),new h(.5)),T=F(_,p),at=C(v,T,g),rt=$e(this.config.majorLineColor,this.config.minorLineColor,F(at,new h(1))),Y=new kt;return Y.glFragColor=rt.multiply(r),Y}}c([w(xe)],yt.prototype,"transform",void 0),c([w(N)],yt.prototype,"config",void 0),c([I(0,A(be))],yt.prototype,"vertex",null),c([I(0,A(Mi))],yt.prototype,"fragment",null);export{Zt as E,Ni as F,Rt as T,$i as a,Ii as b,Pi as c,Zi as d,K as j,Ai as m,yt as r,dt as t}; diff --git a/main/assets/GroupLayer-ER-XzoYr-B2r6nbwd.js b/main/assets/GroupLayer-ER-XzoYr-B2r6nbwd.js new file mode 100644 index 000000000..c39c7b329 --- /dev/null +++ b/main/assets/GroupLayer-ER-XzoYr-B2r6nbwd.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./groupLayerUtils-D-25JsA_-CXHoRLaC.js","./utils-BVWK2jiA-D8rVYIEJ.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./jsonContext-BA8GHqVk-DpBf0bCt.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js","./resourceUtils-BmW6QqlX-CP-OW4gT.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-Bu5Czfos.js"])))=>i.map(i=>d[i]); +import{bp as u,ah as d,bP as b,W as v,bU as c,v as s,S as l,ac as h,a0 as f,ax as _,ai as w,av as m,i as g,_ as L,a1 as I}from"./main-C7yV2j71.js";import{f as O}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import{y as S}from"./loadAll-e978YItg-NjG3VBGi.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as P}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as V}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as A}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as M}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as x}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{p as C}from"./fetchService-DbaKmJhP-DPDp5i2e.js";import R from"./PortalItem-CctGdnxF-CHPkp6yW.js";import{x as T,L as $,g as G}from"./TablesMixin-C8RojhYs-CMxVrapj.js";import{E as p}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import{i as F}from"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";import{y as H}from"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";const j=Symbol("WebScene");let r=class extends V(x(A(M(T($(E(P))))))){constructor(e){super(e),this.allLayers=new O({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=G(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=u(async(i,t,o)=>{const{save:a,saveAs:n}=await L(()=>import("./groupLayerUtils-D-25JsA_-CXHoRLaC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);switch(i){case p.SAVE:return a(this,t);case p.SAVE_AS:return n(this,o,t)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([d(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&j in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(w(()=>this.tables,"before-add",t=>{t.preventDefault(),I.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},_),d(()=>this.visible,this._onVisibilityChange.bind(this),m)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===b.USER}_writeLayers(e,i,t,o){const a=[];if(!e)return a;e.forEach(n=>{const y=H(n,o.webmap?o.webmap.getLayerJSONFromResourceInfo(n):null,o);y?.layerType&&a.push(y)}),i.layers=a}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,t){const{itemId:o,layerType:a}=i;if(a==="GroupLayer"&&o)return new R({id:o,portal:t?.portal})}writePortalItem(e,i){e?.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return F(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:C},e).catch(t=>{if(v(t),this.sourceIsPortalItem)throw t});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return S(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(p.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(p.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(d(()=>e.visible,i=>this._onChildVisibilityChange(e,i),m),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!c(this).initialized)return;const t=this.layers;let o=t.find(a=>a.visible);switch(e){case"exclusive":t.length&&!o&&(o=t.at(0),o.visible=!0),this._turnOffOtherLayers(o);break;case"inherited":t.forEach(a=>{a.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};s([l({readOnly:!0,dependsOn:[]})],r.prototype,"allLayers",void 0),s([l({readOnly:!0})],r.prototype,"allTables",void 0),s([l({json:{read:!0,write:!0}})],r.prototype,"blendMode",void 0),s([l()],r.prototype,"fullExtent",void 0),s([l({readOnly:!0})],r.prototype,"sourceIsPortalItem",null),s([l({json:{read:!1,write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([h("layers")],r.prototype,"_writeLayers",null),s([l({type:["GroupLayer"]})],r.prototype,"operationalLayerType",void 0),s([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,i,t){return{enabled:e?.type==="Group Layer"&&t?.initiator!==this}}}},"web-scene":{read:!1,write:!1}}}})],r.prototype,"portalItem",null),s([f("web-map","portalItem",["itemId"])],r.prototype,"readPortalItem",null),s([h("web-map","portalItem",{itemId:{type:String}})],r.prototype,"writePortalItem",null),s([l()],r.prototype,"spatialReference",void 0),s([l({json:{read:!1},readOnly:!0,value:"group"})],r.prototype,"type",void 0),s([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,t)=>{e!=="inherited"&&(i[t]=e)}}}}})],r.prototype,"visibilityMode",null),r=s([g("esri.layers.GroupLayer")],r);const me=r;export{me as default}; diff --git a/main/assets/GroupLayer-ER-XzoYr-Dk-USe8D.js b/main/assets/GroupLayer-ER-XzoYr-Dk-USe8D.js deleted file mode 100644 index 0ad492317..000000000 --- a/main/assets/GroupLayer-ER-XzoYr-Dk-USe8D.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./groupLayerUtils-D-25JsA_-3fG5R8MN.js","./utils-BVWK2jiA-Ewzf326n.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./jsonContext-BA8GHqVk-BMETb6sX.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js","./resourceUtils-BmW6QqlX-Cs99W_og.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-C_sFWCPe.js"])))=>i.map(i=>d[i]); -import{bp as u,ah as d,bP as b,W as v,bU as c,v as s,S as l,ac as h,a0 as f,ax as _,ai as w,av as m,i as g,_ as L,a1 as I}from"./main-BZaw9FpY.js";import{f as O}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import{y as S}from"./loadAll-e978YItg-CB-7_cng.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as P}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as V}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as A}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as M}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as x}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{p as C}from"./fetchService-DbaKmJhP-CtznRt8p.js";import R from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import{x as T,L as $,g as G}from"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import{E as p}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import{i as F}from"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import{y as H}from"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";const j=Symbol("WebScene");let r=class extends V(x(A(M(T($(E(P))))))){constructor(e){super(e),this.allLayers=new O({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=G(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=u(async(i,t,o)=>{const{save:a,saveAs:n}=await L(()=>import("./groupLayerUtils-D-25JsA_-3fG5R8MN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);switch(i){case p.SAVE:return a(this,t);case p.SAVE_AS:return n(this,o,t)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([d(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&j in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(w(()=>this.tables,"before-add",t=>{t.preventDefault(),I.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},_),d(()=>this.visible,this._onVisibilityChange.bind(this),m)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===b.USER}_writeLayers(e,i,t,o){const a=[];if(!e)return a;e.forEach(n=>{const y=H(n,o.webmap?o.webmap.getLayerJSONFromResourceInfo(n):null,o);y?.layerType&&a.push(y)}),i.layers=a}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,t){const{itemId:o,layerType:a}=i;if(a==="GroupLayer"&&o)return new R({id:o,portal:t?.portal})}writePortalItem(e,i){e?.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return F(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:C},e).catch(t=>{if(v(t),this.sourceIsPortalItem)throw t});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return S(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(p.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(p.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(d(()=>e.visible,i=>this._onChildVisibilityChange(e,i),m),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!c(this).initialized)return;const t=this.layers;let o=t.find(a=>a.visible);switch(e){case"exclusive":t.length&&!o&&(o=t.at(0),o.visible=!0),this._turnOffOtherLayers(o);break;case"inherited":t.forEach(a=>{a.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};s([l({readOnly:!0,dependsOn:[]})],r.prototype,"allLayers",void 0),s([l({readOnly:!0})],r.prototype,"allTables",void 0),s([l({json:{read:!0,write:!0}})],r.prototype,"blendMode",void 0),s([l()],r.prototype,"fullExtent",void 0),s([l({readOnly:!0})],r.prototype,"sourceIsPortalItem",null),s([l({json:{read:!1,write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([h("layers")],r.prototype,"_writeLayers",null),s([l({type:["GroupLayer"]})],r.prototype,"operationalLayerType",void 0),s([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,i,t){return{enabled:e?.type==="Group Layer"&&t?.initiator!==this}}}},"web-scene":{read:!1,write:!1}}}})],r.prototype,"portalItem",null),s([f("web-map","portalItem",["itemId"])],r.prototype,"readPortalItem",null),s([h("web-map","portalItem",{itemId:{type:String}})],r.prototype,"writePortalItem",null),s([l()],r.prototype,"spatialReference",void 0),s([l({json:{read:!1},readOnly:!0,value:"group"})],r.prototype,"type",void 0),s([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,t)=>{e!=="inherited"&&(i[t]=e)}}}}})],r.prototype,"visibilityMode",null),r=s([g("esri.layers.GroupLayer")],r);const me=r;export{me as default}; diff --git a/main/assets/GroupLayerView2D-BR-kLeLa-BPkZIp1k.js b/main/assets/GroupLayerView2D-BR-kLeLa-BPkZIp1k.js new file mode 100644 index 000000000..8e4082420 --- /dev/null +++ b/main/assets/GroupLayerView2D-BR-kLeLa-BPkZIp1k.js @@ -0,0 +1 @@ +import{v as t,S as s,eb as n,i as h,ag as m,ah as l,av as o,am as d}from"./main-C7yV2j71.js";import{X as V,Y as w}from"./LayerView-Bish-E63-I2LV0oDm.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";let r=class extends w{constructor(i){super(i),this.type="group",this.layerViews=new m}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),l(()=>this.layer?.visibilityMode,()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},o),l(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},o)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}get creatingLayerViews(){return this.view?.layerViewManager?.isCreatingLayerViewsForLayer(this.layer)??!1}set layerViews(i){this._set("layerViews",d(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.creatingLayerViews||this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>!!this._findLayerViewForLayer(e)?.visible);return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(a=>l(()=>a.visible,y=>this._applyVisibility(()=>{y!==this.visible&&(a.visible=this.visible)},()=>this._applyExclusiveVisibility(y?a:null)),o)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e?.visible?e:null))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?i():this.layer?.visibilityMode==="exclusive"&&e())}};t([s({readOnly:!0})],r.prototype,"creatingLayerViews",null),t([s({cast:n})],r.prototype,"layerViews",null),t([s({readOnly:!0})],r.prototype,"updatingProgress",null),t([s()],r.prototype,"view",void 0),r=t([h("esri.views.layers.GroupLayerView")],r);const v=r;let p=class extends V(v){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(i){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};p=t([h("esri.views.2d.layers.GroupLayerView2D")],p);const Li=p;export{Li as default}; diff --git a/main/assets/GroupLayerView2D-BR-kLeLa-qMUg5_Ou.js b/main/assets/GroupLayerView2D-BR-kLeLa-qMUg5_Ou.js deleted file mode 100644 index f5f0e467a..000000000 --- a/main/assets/GroupLayerView2D-BR-kLeLa-qMUg5_Ou.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as s,eb as n,i as h,ag as m,ah as l,av as o,am as d}from"./main-BZaw9FpY.js";import{X as V,Y as w}from"./LayerView-Bish-E63-DRGspiuk.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";let r=class extends w{constructor(i){super(i),this.type="group",this.layerViews=new m}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),l(()=>this.layer?.visibilityMode,()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},o),l(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},o)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}get creatingLayerViews(){return this.view?.layerViewManager?.isCreatingLayerViewsForLayer(this.layer)??!1}set layerViews(i){this._set("layerViews",d(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.creatingLayerViews||this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>!!this._findLayerViewForLayer(e)?.visible);return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(a=>l(()=>a.visible,y=>this._applyVisibility(()=>{y!==this.visible&&(a.visible=this.visible)},()=>this._applyExclusiveVisibility(y?a:null)),o)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e?.visible?e:null))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?i():this.layer?.visibilityMode==="exclusive"&&e())}};t([s({readOnly:!0})],r.prototype,"creatingLayerViews",null),t([s({cast:n})],r.prototype,"layerViews",null),t([s({readOnly:!0})],r.prototype,"updatingProgress",null),t([s()],r.prototype,"view",void 0),r=t([h("esri.views.layers.GroupLayerView")],r);const v=r;let p=class extends V(v){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(i){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};p=t([h("esri.views.2d.layers.GroupLayerView2D")],p);const Li=p;export{Li as default}; diff --git a/main/assets/HUDMaterial.glsl-BLhEaLk5-C_G8bhtR.js b/main/assets/HUDMaterial.glsl-BLhEaLk5-C_G8bhtR.js new file mode 100644 index 000000000..33415b153 --- /dev/null +++ b/main/assets/HUDMaterial.glsl-BLhEaLk5-C_G8bhtR.js @@ -0,0 +1,347 @@ +import{v as m,S as v,i as K,dD as nr,I as ar,J as wr,ah as ns,aL as as,$ as ve,j as ye,ay as os,gI as ls,hT as cs,dk as br,eJ as hs,ig as ds,hb as us,dU as A,ih as fs,bl as Xe,a1 as ps,ii as ms,ij as wi,aq as bi,x as xi,aT as gs,aA as _s,o as Ut,K as vs,dY as ys,a2 as ws,U as bs,gU as xs,ik as Is,il as $t,im as Cs,io as Ts,ip as Ss,iq as Os,ir as Rs,is as As,it as xr,iu as Es,iv as Ms,iw as or,ae as Ds,bh as Ii,bj as Ps,hZ as Fs,fj as qt,h$ as Ci,i9 as je,B as Ls,p as Ns,he as Ir,ix as zs,i1 as Bs}from"./main-C7yV2j71.js";import{Z as Gs}from"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import{b as Cr}from"./Query-BrwMGK8U-DV_czrJX.js";import{h as Vs}from"./ReactiveMap-CFk6jPfN-CM49HI11.js";import{N as js,R as Ti}from"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import{n as Hs}from"./timeSupport-jPViR5jn-BnQYlj-C.js";import{c as kt}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{p as Us}from"./query-DFW9-NG_-CfusC8cS.js";import{o as $s}from"./pbf-D-y3_eZO-SEvl9j6c.js";import{g as qs}from"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import{o as ks}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{k as Ws,m as Ys}from"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import{l as ne}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{A as Qs,w as Js}from"./Indices-DEr2HrWx-Cd6y9wum.js";import{e as ae,o as le,T as Xs,c as Zs,i as Tr,m as Ks}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{d as Si,D as en,m as ft,P as tn}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as X,o as lr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{h as rn,b as F,Q as sn,i as nn,V as an,_ as on,F as ln,J as W,N as Wt,v as cn,x as hn,a as dn,z as Oi,e as un,j as fn,A as pn,t as Me,L as Sr,r as ge,c as Ri,m as mn,G as Ai,d as Yt,u as gn,k as Ue,f as _n,Z as vn,n as yn,g as Ei,X as wn,l as bn,o as Qt,s as pt,p as xn,P as In,q as Cn,U as Tn,w as Sn,y as On,S as Rn,B as An,C as En,$ as Mn,W as Or,D as Dn,T as Pn,E as Fn,H as Ln,I as Nn,K as zn,M as Bn,O as Gn,R as Vn,Y as jn,a0 as Rr,a1 as Ar,a2 as Hn,a3 as Un,a4 as $n,a5 as qn,a6 as kn,a7 as Wn,a8 as Yn,a9 as Qn,aa as Er}from"./AttributeArray-BWXEft_i-BHxkzONu.js";import{p as xt}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{o as E,s as Ct}from"./NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js";import{e as Mr,t as Jn}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{s as Xn}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{k as ce,z as Pe,G as cr,B as Jt,a as Zn,M as Kn,n as ea,Z as ta,N as ra,E as ia}from"./mat4-DX7gBViE-vewreEuZ.js";import{t as L,u as sa}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{h as N}from"./Util-BjGjeg6f-08Szkf4F.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{r as Y,S as $e,l as he,_ as ie,g as Mi,A as j,R as Ze,k as Dr,y as qe,G as Pr,C as na,L as Z,b as me,W as aa,Y as _e,j as ht,Z as oa}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{R as hr}from"./InterleavedLayout-DXzw3B2n-BD0-ikLj.js";import{o as Fr,O as Lr,E as Tt,p as Ke,b as Nr,D as He}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{N as la,S as ca,B as ha,y as Xt}from"./Octree-CJNwbhg4-D0u91mrh.js";import{d as Di,D as da,b as ua,F as fa,H as pa,V as ma,_ as zr}from"./sphere-BenPORjV-CiIWUavi.js";import{l as ga,I as _a,u as va,f as de,r as ya,M as wa}from"./plane-Dt8R0KeE-CdQQbSdq.js";import{I as Fe,A as Br}from"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import{P as dr,k as ba,V as xa}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as ur}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{b as Gr,m as Ia,o as mt,p as Ca,A as Ta,X as Pi,L as ke,O as Vr,l as jr}from"./BufferView-PQoE3GL7-M6q1od-Y.js";import{r as Fi}from"./BufferObject-BM_7mcDb-CTo2uuE5.js";import{G as Hr,n as Li,T as Ur,L as Sa}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{q as Oa,R as Ra}from"./boundedPlane-DlvE0eNx-DhJ9Zyo3.js";import{c as Aa}from"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import{f as Ea}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{i as Ma,p as Da}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import{r as Pa,i as Fa}from"./Texture-BCt2hphT-CtQVMDnp.js";import{l as La}from"./floatRGBA-4pIJN00G-ClP9XgP7.js";import{o as oe}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{N as Na,K as za,B as Ba,m as Ga}from"./renderState-Dap0WV9P-D4IHxyei.js";import{n as Va}from"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import{p as gt}from"./projectVectorToVector-sIYLNlex-B5U5xz17.js";import{G as ja}from"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import{t as re,o as Ye}from"./vec3f32-BS0cezmI-B_madU1n.js";import{M as se}from"./orientedBoundingBox-oHezdpWm-BA8RF5F7.js";import"./triangle-hqU-Tc1X-0gyFMdne.js";import{x as Ha}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import{p as Ua}from"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import{e as w,c as z}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{a as $a}from"./BindType-9iOk18Ed-CRW1cdX4.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./requestImageUtils-Ut4YcoNU-BcLxhYtL.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-_ZNy9SM-.js";import"./signal-CETehA7D-DxK1orqE.js";import"./quat-BODLR7mS-Dbd8ftOx.js";function qa(e){e.code.add(w`const float MAX_RGBA_FLOAT = +255.0 / 256.0 + +255.0 / 256.0 / 256.0 + +255.0 / 256.0 / 256.0 / 256.0 + +255.0 / 256.0 / 256.0 / 256.0 / 256.0; +const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); +vec4 float2rgba(const float value) { +float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); +vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); +const float toU8AsFloat = 1.0 / 255.0; +return fixedPointU8 * toU8AsFloat; +}`),e.code.add(w`const vec4 RGBA_2_FLOAT_FACTORS = vec4( +255.0 / (256.0), +255.0 / (256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0 * 256.0) +); +float rgba2float(vec4 rgba) { +return dot(rgba, RGBA_2_FLOAT_FACTORS); +}`),e.code.add(w`const vec4 uninterpolatedRGBAToFloatFactors = vec4( +1.0 / 256.0, +1.0 / 256.0 / 256.0, +1.0 / 256.0 / 256.0 / 256.0, +1.0 / 256.0 / 256.0 / 256.0 / 256.0 +); +float uninterpolatedRGBAToFloat(vec4 rgba) { +return (dot(round(rgba * 255.0), uninterpolatedRGBAToFloatFactors) - 0.5) * 2.0; +}`)}let ka=class extends wn{constructor(e,t){super(e,"vec4",$a.Draw,(r,i,s)=>r.setUniform4fv(e,t(i,s)))}},fe=class extends ye{constructor(e){super(e),this._removing=0,this._tiles=new Vs}destroy(){for(const e of this._tiles.values())e.remove();this._tiles.clear()}get updating(){if(this._removing>0)return!0;for(const e of this._tiles.values())if(!e.finished)return!0;return!1}async onTileTreeChange(e){const{added:t,removed:r}=e,i=this._tiles,s=[];for(const n of r){const a=i.get(n);a!=null&&(a.abort(),i.delete(n),s.push({tileId:n}))}for(const n of t)i.has(n.id)||i.set(n.id,os(a=>this._addTile(n,a)));await this._removeTiles(s)}async _addTile(e,t){const r=await this.addTile(e,t);return ve(t),r}async _removeTiles(e){this._removing++,await this.removeTiles(e),this._removing--}};m([v()],fe.prototype,"updating",null),m([v({constructOnly:!0})],fe.prototype,"addTile",void 0),m([v({constructOnly:!0})],fe.prototype,"removeTiles",void 0),m([v()],fe.prototype,"_removing",void 0),fe=m([K("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],fe);let Zt=class{constructor(e,t){this._index=e,this._view=t}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new Wa(this._index,this._view,e)}},Wa=class extends Zt{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return Hs(new kt,this._geometryOverride,e.hasZ,e.hasM)}},Ya=class{constructor(){this._storedTiles=new Map,this._pageBounds=new Map,this.events=new ar,this.featureAdapter=Kt.shared}addTile(e){this._storedTiles.set(e.descriptor.id,e);for(const t of e.pages)this._addPage(t)}removeTile(e){const t=this._storedTiles,r=t.get(e);if(r!=null){t.delete(e);for(const i of r.pages)this._removePage(i)}}_addPage(e){const{featureCount:t}=e;if(t===0)return;const r=new js(9,s=>e.getBounds(s)),i=new Array;for(let s=0;se(new Zt(i,t)))}forEachInBounds(e,t){ze.minX=e[0],ze.minY=e[1],ze.maxX=e[2],ze.maxY=e[3];for(const[r,i]of this._pageBounds)i.search(ze,s=>t(new Zt(s,r)))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,s=-1/0;for(const n of this._pageBounds.values()){const{minX:a,minY:o,maxX:l,maxY:c}=n.toJSON();t=Math.min(t,a),r=Math.min(r,o),i=Math.min(i,l),s=Math.min(s,c)}return{xmin:t,ymin:r,xmax:i,ymax:s,spatialReference:e}}},Kt=class{getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}};Kt.shared=new Kt;const ze=new Ti;let Qa=class{constructor(e,t){this.descriptor=e,this.pages=t}},Ja=class{constructor(e){const t=new $s(new Uint8Array(e),new DataView(e));this._reader=t,this._index=Xa(t)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,s=r.get(t)?.index;if(s==null)return;const n=i[e*r.fields.length+s],a=this._reader;return a.move(n),St(a)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return typeof r=="string"?new Date(r).getTime():typeof r=="number"||r==null?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,s=this._reader,n={};for(const a of t.fields){const o=r[i+a.index];s.move(o),n[a.name]=St(s)}return n}getCoordinates(e,t,r=0){const i=this._reader,{transform:s,featureIndices:n}=this._index,{scale:a,translate:o}=s;i.move(n[e]),this._readCoordinates(a,o,t,r)}getOptimizedGeometry(e){const t=A();return this.getCoordinates(e,t),new kt([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,we);const[i,s,n]=we,a=[i,s];return t&&(a[3]=n),r&&(a[t?4:3]=0),new kt([],a)}getBounds(e){this.getCoordinates(e,we);const[t,r]=we,i=new Ti;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,we);const[t,r,i]=we;return Ss(t,r,i,t,r,i)}readAllObjectIds(e,t=0){const r=this._reader,{_index:i,featureCount:s}=this,{objectIdFieldName:n,attributeIndices:a,fieldsIndex:o}=i,l=o.get(n).index,c=o.fields.length;for(let d=0;dt?.release()):e?.release()}let fr=class{constructor(e,t){this._material=e,this._repository=t,this._map=new Map}dispose(){this._map.forEach((e,t)=>{e!=null&&this._repository.release(this._material,t)})}load(e,t,r){if(!this._material.produces.get(t)?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,t,r));const i=this._map.get(r);if(i!=null){if(i.ensureResources(e)===Jn.LOADED)return i;this._repository.requestRender()}return null}},Bi=class extends bn{constructor(e=A()){super(),this.origin=e}get slicePlaneLocalOrigin(){return this.origin}};var kr,pe;(function(e){e[e.ADD=0]="ADD",e[e.UPDATE=1]="UPDATE",e[e.REMOVE=2]="REMOVE"})(kr||(kr={})),function(e){e[e.NONE=0]="NONE",e[e.VISIBILITY=1]="VISIBILITY",e[e.GEOMETRY=2]="GEOMETRY",e[e.TRANSFORMATION=4]="TRANSFORMATION",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.OCCLUDEE=16]="OCCLUDEE"}(pe||(pe={}));let pr=class{constructor(e=0,t=0){this.from=e,this.to=t}get numElements(){return this.to-this.from}};function Wr(e){const t=new Map;e.forAll(i=>t.set(i.from,i));let r=!0;for(;r;){r=!1;for(let i=0;ie||new pr,deallocator:null}),this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightGroups=new Set,this.drawCommandsDefault=et(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=et(),this.drawCommandsShadowHighlightRest=et()}get numElements(){return this._numElements}get instances(){return this._instances}get hasHighlights(){return this.highlightGroups.size>0}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightGroups.clear()}updateIfDrawCommandsDirty(e){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(e)}}addInstance(e,t){this.deleteInstance(e),this._instances.set(e,t),this._numElements+=t.numElements}deleteInstance(e){const t=this._instances.get(e);t&&(this._numElements-=t.numElements,this._instances.delete(e))}updateInstance(e,t,r){const i=this._instances.get(e);i&&(this._numElements-=i.numElements,i.from=t,i.to=r,this._numElements+=i.numElements)}updateDrawState(e){e.isVisible?(e.foreachHighlightGroup(t=>this.highlightGroups.add(t)),e.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(e){if(this.drawCommandsDefault.clear(),this.drawCommandsHighlights.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsShadowHighlightRest.clear(),this.drawCommandsDirty=!1,this._instances.size===0)return;if(!this.needsMultipleCommands()){const i=this.drawCommandsDefault.pushNew(),s=this.holes.front();return this.vao!=null&&this.holes.length===1&&s.to===Math.floor(this.vao.byteSize/e)?(i.first=0,void(i.count=s.from)):(i.first=1/0,i.count=0,this._instances.forEach(n=>{i.first=Math.min(i.first,n.from),i.count=Math.max(i.count,n.to)}),void(i.count-=i.first))}const t=Array.from(this._instances.values()).sort((i,s)=>i.from===s.from?i.to-s.to:i.from-s.from),{drawCommandsHighlights:r}=this;for(const i of t)i.isVisible&&(Ot(i.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,i),i.hasHighlights?i.foreachHighlightGroup(s=>{let n=r.get(s);n||(n=et(),r.set(s,n)),Ot(n,i)}):Ot(this.drawCommandsShadowHighlightRest,i))}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}};function co(e){return e.vao!=null}function et(){return new nr({allocator:e=>e||new oo,deallocator:e=>e})}function Ot(e,t){const r=e.back();if(r==null){const i=e.pushNew();return i.first=t.from,void(i.count=t.numElements)}if(ho(r,t)){const i=t.from-r.first+t.numElements;r.count=i}else{const i=e.pushNew();i.first=t.from,i.count=t.numElements}}function ho(e,t){return e.first+e.count>=t.from}let uo=class{constructor(e){this.origin=e,this.buffers=new Array}dispose(){this.buffers.forEach(e=>e.vao.dispose()),this.buffers.length=0}findBuffer(e){return this.buffers.find(t=>t.instances.has(e))}},Rt=class extends zi{get _hasAnyHighlight(){return this._highlightGroups.size>0}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new Bi,this._highlightGroups=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=cs(this._glMaterials),this._dataByOrigin.forEach(e=>e.dispose()),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this.material.produces.forEach((e,t)=>{this._produces.set(t,r=>!(this._dataByOrigin.size===0||!(r!==E.Highlight&&r!==E.ShadowHighlight||this._hasAnyHighlight))&&e(r))})}initializeRenderContext(e,t){this._glMaterials=new fr(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,xt(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((r,i)=>r+i.instances.size,0)),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((r,i)=>r+i.vao.usedMemory,0)),e}forEachGeometry(e){this._dataByOrigin.forEach(t=>t.buffers.forEach(r=>r.instances.forEach(({geometry:i})=>e(i))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(t==null)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const s=i.renderGeometry,n=this._dataByOrigin.get(s.localOrigin.id),a=n?.findBuffer(s.id);if(a==null)return;const o=a.instances.get(s.id);if(i.updateType&(pe.GEOMETRY|pe.TRANSFORMATION)){const l=it(t.elementCount(o.geometry.geometry.attributes)*r),c=t.vertexBufferLayout.createView(l.buffer);this._writeGeometry(s,c,0),a.vao.vertexBuffers.get("geometry").setSubData(l,o.from*r,0,o.numElements*r)}i.updateType&(pe.HIGHLIGHT|pe.OCCLUDEE|pe.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new Xn;for(const i of e){const s=i.localOrigin;if(s==null)continue;let n=r.get(s.id,null);n==null&&(n=new Qr(s.vec3),r.set(s.id,null,n)),n.changes.push(i)}for(const i of t){const s=i.localOrigin;if(s==null)continue;const n=this._dataByOrigin.get(s.id),a=n?.findBuffer(i.id);if(a==null)continue;let o=r.get(s.id,a);o==null&&(o=new Qr(s.vec3),r.set(s.id,a,o)),o.changes.push(i)}return r}_addAndRemoveGeometries(e,t){if(this._bufferWriter==null||this._vaoCache==null)return;const{_bufferWriter:r,_dataByOrigin:i}=this,s=r.vertexBufferLayout.stride/4,n=this._computeDeltas(e,t);n.forEach((a,o)=>{const l=a.get(null),c=l?.changes??[];n.delete(o,null);let d=i.get(o);if(a.forEach((h,u)=>{if(n.delete(o,u),u==null)return void N(!1,"No VAO for removed geometries");if(u.instances.size===h.changes.length)return this._vaoCache.deleteVao(u.vao),br(d.buffers,u),void(d.buffers.length===0&&c.length===0&&i.delete(o));const f=u.numElements,_=u.vao.byteSize/4,g=c.reduce((O,M)=>O+r.elementCount(M.geometry.attributes),0),C=h.changes.reduce((O,M)=>O+r.elementCount(M.geometry.attributes),0),I=Math.min((f+g-C)*s,rt),x=I>_;I>vt&&I<_/2?(h.changes.forEach(({id:O})=>u.deleteInstance(O)),u.instances.forEach(({geometry:O})=>c.push(O)),this._vaoCache.deleteVao(u.vao),br(d.buffers,u)):x?this._applyAndRebuild(u,c,h):this._applyRemoves(u,h)}),c.length>0)for(d==null&&(d=new uo(l.origin),i.set(o,d)),d.buffers.forEach(h=>this._applyAdds(h,c));c.length>0;)d.buffers.push(this._applyAndRebuild(new lo,c,null))})}_updateDrawCommands(){this._highlightGroups.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach(e=>{e.buffers.forEach(t=>{t.updateIfDrawCommandsDirty(this._bufferWriter.vertexBufferLayout.stride),t.hasHighlights&&hs(this._highlightGroups,t.highlightGroups),this._hasOccludees=this._hasOccludees||t.hasOccludees})})}_applyAndRebuild(e,t,r){if(r)for(const f of r.changes)e.deleteInstance(f.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,n=s/4,a=Math.floor(rt/n);let o=e.numElements;for(;t.length>0;){const f=t.pop(),_=i.elementCount(f.geometry.attributes);if(o+_>a&&o>0){t.push(f);break}o+=_;const g=new Yr(f,0,0);N(e.instances.get(f.id)==null),e.addInstance(f.id,g)}const l=o*n,c=it(l),d=i.vertexBufferLayout.createView(c.buffer);let h=0;e.resetInstanceSummary(),e.instances.forEach((f,_)=>{this._writeGeometry(f.geometry,d,h);const g=h;h+=i.elementCount(f.geometry.geometry.attributes),e.updateInstance(_,g,h),e.updateDrawState(f)}),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(er(l)),e.vao.vertexBuffers.get("geometry").setSubData(c,0,0,h*n),e.holes.clear();const u=e.holes.pushNew();return u.from=h,u.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,t){if(t.changes.length===0||this._bufferWriter==null)return;for(const a of t.changes){const o=a.id,l=e.instances.get(o);if(!l)continue;e.deleteInstance(o);const c=ee.back();if(c){if(c.to===l.from){c.to=l.to;continue}if(c.from===l.to){c.from=l.from;continue}}const d=ee.pushNew();d.from=l.from,d.to=l.to}Wr(ee);const r=this._bufferWriter.vertexBufferLayout.stride/4,i=ee.reduce((a,o)=>Math.max(a,o.numElements),0)*r,s=it(i);s.fill(0,0,i);const n=e.vao.vertexBuffers.get("geometry");ee.forAll(a=>n.setSubData(s,a.from*r,0,a.numElements*r)),e.holes.pushArray(ee.data,ee.length),ee.forAll((a,o)=>ee.data[o]=null),ee.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(t.length===0||this._bufferWriter==null)return;if(!co(e))return void this._applyAndRebuild(e,t,null);const r=this._bufferWriter,i=r.vertexBufferLayout.stride/4,s=e.numElements,n=t.reduce((C,I)=>C+r.elementCount(I.geometry.attributes),0),a=Math.min((s+n)*i,rt),o=4*a;if(e.vao.byteSizee.vao.byteSize)return void this._applyAndRebuild(e,t,null);Wr(e.holes);const l=new Array;for(const C of t){const I=r.elementCount(C.geometry.attributes),x=fo(e.holes,I);l.push(x)}const c=e.vao.vertexBuffers.get("geometry");let d=0,h=0,u=0;const f=it(a),_=r.vertexBufferLayout.createView(f.buffer);t.forEach((C,I)=>{const x=l[I];if(x==null)return;if(u!==x){const y=u-h;y>0&&c.setSubData(f,h*i,0,y*i),h=x,d=0}const O=r.elementCount(C.geometry.attributes);this._writeGeometry(C,_,d),d+=O,u=x+O;const M=new Yr(C,x,x+O);N(e.instances.get(C.id)==null),e.addInstance(C.id,M),e.drawCommandsDirty=!0});const g=u-h;g>0&&c.setSubData(f,h*i,0,g*i),ds(t,(C,I)=>l[I]==null)}_writeGeometry(e,t,r){this._bufferWriter!=null&&(ce(be,e.transformation),be[12]-=e.localOrigin.vec3[0],be[13]-=e.localOrigin.vec3[1],be[14]-=e.localOrigin.vec3[2],Pe(tt,be),cr(tt,tt),this._bufferWriter.write(be,tt,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e;if(!this.material.produces.get(r.slot)?.(t))return null;const{highlightGroupName:i,slot:s}=r,n=t===E.ShadowHighlight,a=t===E.Highlight,o=a||n,l=h=>o&&(this._highlightGroups.size===0||a&&!!i&&!h.has(i));if(l(this._highlightGroups))return null;const c=t===E.ShadowExcludeHighlight,d=!(o||c);for(const{buffers:h}of this._dataByOrigin.values())for(const u of h){if(l(u.highlightGroups))continue;const f=n?u.drawCommandsHighlights.size>0:o?i?u.drawCommandsHighlights.get(i):u.drawCommandsHighlights.size>0:((c&&u.needsMultipleCommands()?u.drawCommandsShadowHighlightRest:u.drawCommandsDefault)||null)?.length??!1,_=d&&u.drawCommandsOccludees||null;if(f||_?.length){const g=this._glMaterials.load(e.rctx,s,t),C=g?.beginSlot(r);if(C)return C}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlightGroupName:n}=i,a=r===E.Highlight;if(a&&!n)return;const o=r===E.ShadowHighlight,l=a||o,c=r===E.ShadowExcludeHighlight,d=!(l||c),h=s===W.OCCLUDER_MATERIAL||s===W.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:u}=e;u.runAppleAmdDriverHelper();const f=u.bindTechnique(t,i,this.material.parameters);for(const _ of this._dataByOrigin.values())for(const g of _.buffers){if(a&&(!g.hasHighlights||!g.drawCommandsHighlights.has(n))||o&&!g.hasHighlights)continue;const C=()=>{const y=[];for(const P of g.drawCommandsHighlights.values())y.push(P);return y},I=l&&!o?g.drawCommandsHighlights.get(n)??null:null,x=o?C():l?I?[I]:Xr:(c&&g.needsMultipleCommands()?[g.drawCommandsShadowHighlightRest]:[g.drawCommandsDefault])||Xr,O=x.some(y=>y.length>0),M=d&&g.drawCommandsOccludees||null;if(O||M?.length){if(this._drawParameters.origin=_.origin,f.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(g.vao),u.bindVAO(g.vao),O)for(const y of x)u.setPipelineState(t.getPipeline(!1,h)),y.forAll(P=>u.drawArrays(t.primitiveType,P.first,P.count));M?.length&&(u.setPipelineState(t.getPipeline(!0,h)),M.forAll(y=>u.drawArrays(t.primitiveType,y.first,y.count)))}}}get test(){}};m([v({constructOnly:!0})],Rt.prototype,"material",void 0),Rt=m([K("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],Rt);let Qr=class{constructor(e){this.origin=e,this.changes=new Array}};function fo(e,t){const r=e.find(s=>s.numElements>=t);if(r==null)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const be=L(),tt=L(),ee=new nr({allocator:e=>e||new pr,deallocator:null}),vt=65536,At=4*vt,Jr=1024,Gi=16777216,rt=Gi/4;let Et=new Float32Array(vt);function it(e){return Et.length{this._produces.set(t,r=>!!(r!==E.Highlight&&r!==E.ShadowHighlight||this._hasHighlights)&&e(r))})}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.removeRenderGeometry(t)}acquireTechniques(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e;return!t.produces.get(i.slot)?.(r)||(r===E.Highlight||r===E.ShadowHighlight)&&!this._hasHighlights?null:this._glMaterials.load(e.rctx,i.slot,r)?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(r.size===0)return;const{bind:i}=e,s=i.slot===W.OCCLUDER_MATERIAL||i.slot===W.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const a=t.program;for(const[o,l]of r)this._drawParameters.origin=l.localOrigin,a.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(l.vao),n.bindVAO(l.vao),n.setPipelineState(t.getPipeline(!1,s)),n.drawArrays(t.primitiveType,0,l.numElements)}initializeRenderContext(e,t){this._glMaterials=new fr(this.material,e.materials);const r=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,xt(this._bufferWriter.vertexBufferLayout));this._vaoCache=r}uninitializeRenderContext(){}addRenderGeometry(e,t,r){this.removeRenderGeometry(e);const i=this._bufferWriter.vertexBufferLayout.stride,s=this._vaoCache.newVao(er(t.data.byteLength));s.vertexBuffers.get("geometry").setSubData(new Uint8Array(t.data),0,0,t.elementCount*i);const n={localOrigin:r,vao:s,numElements:t.elementCount};return this._renderGeometries.set(e,n),n}removeRenderGeometry(e){const t=this._renderGeometries.get(e);t!=null&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}};m([v({constructOnly:!0})],dt.prototype,"material",void 0),dt=m([K("esri.views.3d.layers.graphics.pipeline.rendering.DirectRenderer")],dt);function po(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}function mo(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}function go(e,t,r){return 2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r))}function _o(e,t,r){return 2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r))}var Zr,S;(function(e){e[e.Default=0]="Default",e[e.Screenshot=1]="Screenshot",e[e.ObjectAndLayerID=2]="ObjectAndLayerID"})(Zr||(Zr={})),function(e){e[e.TOP=0]="TOP",e[e.RIGHT=1]="RIGHT",e[e.BOTTOM=2]="BOTTOM",e[e.LEFT=3]="LEFT"}(S||(S={}));var tr;let b=tr=class extends ye{constructor(e){super(e),this._ray=Di(),this._viewport=ae(0,0,1,1),this._padding=ae(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=X(1,1e3),this._viewDirty=!0,this._viewMatrix=L(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=L(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=L(),this._frustumDirty=!0,this._frustum=la(),this._fullViewport=le(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=A(),this._up=A(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return Y(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){ce(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),ie(A(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),ie(A(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),ie(A(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(this.pixelRatio===1)return this._viewport;const e=Fr(le(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&Lr(e,t)?t:e}get screenPadding(){if(this.pixelRatio===1)return this._padding;const e=Fr(le(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&Lr(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[S.LEFT],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[S.BOTTOM],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[S.RIGHT]+this._padding[S.LEFT]}set fullWidth(e){this.width=e-(this._padding[S.RIGHT]+this._padding[S.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[S.TOP]+this._padding[S.BOTTOM]}set fullHeight(e){this.height=e-(this._padding[S.TOP]+this._padding[S.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[S.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[S.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){Tt(this._padding,e)||(this._viewport[0]+=e[S.LEFT]-this._padding[S.LEFT],this._viewport[1]+=e[S.BOTTOM]-this._padding[S.BOTTOM],this._viewport[2]-=e[S.RIGHT]+e[S.LEFT]-(this._padding[S.RIGHT]+this._padding[S.LEFT]),this._viewport[3]-=e[S.TOP]+e[S.BOTTOM]-(this._padding[S.TOP]+this._padding[S.BOTTOM]),Ke(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(Jt(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return Pe(L(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||L()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return go(this._fov,this.width,this.height)}set fovX(e){this._fov=po(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return _o(this._fov,this.width,this.height)}set fovY(e){this._fov=mo(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return Mi(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(Pe(this._viewInverseTransposeMatrix,this.viewMatrix),cr(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const t=2*e-1;return 2*this.near*this.far/(this.far+this.near-t*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return this.relativeElevation!=null&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,s=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,o=a+n,l=-r/2+this.row*s,c=l+s,d=Zn(L(),a*(1+2*this._padding[S.LEFT]/e),o*(1+2*this._padding[S.RIGHT]/e),l*(1+2*this._padding[S.BOTTOM]/t),c*(1+2*this._padding[S.TOP]/t),this.near,this.far),h=this._get("projectionMatrix");return h&&Kn(h,d)?h:d}copyFrom(e){j(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,Ke(this._viewport,e.viewport),this.notifyChange("_viewport"),Ke(this._padding,e.padding),this.notifyChange("_padding"),Si(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||(ce(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||(ca(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(ce(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),Ke(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return new tr().copyFrom(this)}equals(e){return Ze(this.eye,e.eye)&&Ze(this.center,e.center)&&Ze(this.up,e.up)&&Tt(this._viewport,e.viewport)&&Tt(this._padding,e.padding)&&en(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||Nr(e.screenPadding,this.screenPadding)>=t||Nr(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;Dr(B,e.eye,e.center),Dr(Mt,this.eye,this.center);const r=qe(B,Mt),i=Pr(B),s=Pr(Mt),n=5e-4;return r*r>=(1-1e-10)*i*s&&na(e.eye,this.eye)2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Dt),t)}unprojectFromRenderScreen(e,t){if(Jt(st,this.projectionMatrix,this.viewMatrix),!Pe(st,st))return null;const r=this.fullViewport;return T[0]=2*(e[0]-r[0])/r[2]-1,T[1]=2*(e[1]-r[1])/r[3]-1,T[2]=2*e[2]-1,T[3]=1,He(T,T,st),T[3]===0?null:(t[0]=T[0]/T[3],t[1]=T[1]/T[3],t[2]=T[2]/T[3],t)}constrainWindowSize(e,t,r,i){const s=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(s-r/2,0),o=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(s-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-s-r/2,0),h=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(o),Math.round(d),Math.round(h)]}computeUp(e){e===ne.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){Y(B,this.center,this.eye);const e=me(this.center);e<1?(ie(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(qe(B,this.center))>.9999*me(B)*e||($e(this._up,B,this.center),$e(this._up,this._up,B),he(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){aa(B,this.eye,this.center),Math.abs(B[2])<=.9999&&(Z(B,B,B[2]),ie(this._up,-B[0],-B[1],1-B[2]),he(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(e,t,r=""){typeof e[0]=="number"&&isFinite(e[0])&&typeof e[1]=="number"&&isFinite(e[1])&&typeof e[2]=="number"&&isFinite(e[2])?Ze(e,t)||(j(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):ps.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(ha(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(ea(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};m([v()],b.prototype,"_viewport",void 0),m([v()],b.prototype,"_padding",void 0),m([v()],b.prototype,"_fov",void 0),m([v()],b.prototype,"_nearFar",void 0),m([v()],b.prototype,"_viewDirty",void 0),m([v()],b.prototype,"_viewMatrix",void 0),m([v()],b.prototype,"_pixelRatio",void 0),m([v()],b.prototype,"pixelRatio",null),m([v()],b.prototype,"row",void 0),m([v()],b.prototype,"column",void 0),m([v()],b.prototype,"_rows",void 0),m([v()],b.prototype,"rows",null),m([v()],b.prototype,"_columns",void 0),m([v()],b.prototype,"columns",null),m([v()],b.prototype,"eye",null),m([v()],b.prototype,"center",null),m([v()],b.prototype,"_center",void 0),m([v()],b.prototype,"up",null),m([v()],b.prototype,"_up",void 0),m([v()],b.prototype,"viewMatrix",null),m([v({readOnly:!0})],b.prototype,"viewForward",null),m([v({readOnly:!0})],b.prototype,"viewUp",null),m([v({readOnly:!0})],b.prototype,"viewRight",null),m([v({readOnly:!0})],b.prototype,"nearFar",null),m([v()],b.prototype,"near",null),m([v()],b.prototype,"far",null),m([v()],b.prototype,"viewport",null),m([v({readOnly:!0})],b.prototype,"screenViewport",null),m([v({readOnly:!0})],b.prototype,"screenPadding",null),m([v()],b.prototype,"x",null),m([v()],b.prototype,"y",null),m([v()],b.prototype,"width",null),m([v()],b.prototype,"height",null),m([v()],b.prototype,"fullWidth",null),m([v()],b.prototype,"fullHeight",null),m([v({readOnly:!0})],b.prototype,"_aspect",null),m([v()],b.prototype,"padding",null),m([v({readOnly:!0})],b.prototype,"projectionMatrix",null),m([v({readOnly:!0})],b.prototype,"inverseProjectionMatrix",null),m([v()],b.prototype,"fov",null),m([v()],b.prototype,"fovX",null),m([v()],b.prototype,"fovY",null),m([v()],b.prototype,"viewInverseTransposeMatrix",null),m([v({readOnly:!0})],b.prototype,"_projectionMatrixInternal",null),m([v()],b.prototype,"relativeElevation",void 0),b=tr=m([K("esri.views.3d.webgl.RenderCamera")],b);const vo=b,T=le(),st=L(),B=A(),Mt=A(),Dt=ms();let yo=class{constructor(e,t,r){this._elementSize=t,this._buffer=Fi.createVertex(e,Li.STATIC_DRAW),this.resize(r)}destroy(){this._buffer.dispose()}get elementSize(){return this._elementSize}get capacity(){return this._capacity}get array(){return this._array}get buffer(){return this._buffer}get usedMemory(){return this._array.byteLength+this._buffer.usedMemory}copyRange(e,t,r,i=0){const s=new Uint8Array(this.array,e*this.elementSize,(t-e)*this.elementSize);new Uint8Array(r.array,i*this.elementSize).set(s)}transferAll(){this._buffer.setData(this._array)}transferRange(e,t){const r=e*this._elementSize,i=t*this._elementSize;this._buffer.setSubData(new Uint8Array(this._array),r,r,i)}resize(e){const t=e*this._elementSize,r=new ArrayBuffer(t);this._array&&(e>=this._capacity?new Uint8Array(r).set(new Uint8Array(this._array)):new Uint8Array(r).set(new Uint8Array(this._array).subarray(0,e*this._elementSize))),this._array=r,this._buffer.setSize(t),this._capacity=e}},wo=class{constructor(e){this.modelOriginHi=e.getField(p.INSTANCEMODELORIGINHI,jr),this.modelOriginLo=e.getField(p.INSTANCEMODELORIGINLO,jr),this.model=e.getField(p.INSTANCEMODEL,mt),this.modelNormal=e.getField(p.INSTANCEMODELNORMAL,mt),this.featureAttribute=e.getField(p.INSTANCEFEATUREATTRIBUTE,Pi),this.color=e.getField(p.INSTANCECOLOR,ke),this.objectAndLayerIdColor=e.getField(p.INSTANCEOBJECTANDLAYERIDCOLOR,ke)}},bo=class{constructor(e,t){this._rctx=e,this._instanceBufferLayout=t,this._headIndex=0,this._tailIndex=0,this._firstIndex=null,this._captureFirstIndex=!0,this._updating=!1,this._prevHeadIndex=0,this._resized=!1,this._capacity=1}destroy(){this._buffer&&this._buffer.destroy()}get buffer(){return this._buffer.buffer}get view(){return this._view}get capacity(){return this._capacity}get size(){const e=this._headIndex,t=this._tailIndex;return e>=t?e-t:e+this._capacity-t}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get usedMemory(){return this._buffer?.usedMemory??0}reset(){this._headIndex=0,this._tailIndex=0,this._firstIndex=null}startUpdateCycle(){this._captureFirstIndex=!0}beginUpdate(){N(!this._updating,"already updating"),this._updating=!0,this._prevHeadIndex=this._headIndex}endUpdate(){N(this._updating,"not updating"),this.size0,"invalid size");const e=this._tailIndex===this._firstIndex;this._incrementTail(),e&&(this._firstIndex=this._tailIndex)}_grow(){const e=Math.max(yt,Math.floor(this._capacity*wi));this._resize(e)}_shrink(){const e=Math.max(yt,Math.floor(this._capacity*Rs));this._resize(e)}_resize(e){if(N(this._updating,"not updating"),e===this._capacity)return;const t=new yo(this._rctx,this._instanceBufferLayout.stride,e);if(this._buffer){this._firstIndex&&(this._firstIndex=(this._firstIndex+this._capacity-this._tailIndex)%this._capacity);const r=this.size,i=this._compactInstances(t);N(i===r,"invalid compaction"),this._buffer.destroy(),this._tailIndex=0,this._headIndex=i,this._prevHeadIndex=0}this._resized=!0,this._capacity=e,this._buffer=t,this._view=new wo(this._instanceBufferLayout.createView(this._buffer.array))}_compactInstances(e){const t=this._headIndex,r=this._tailIndex;return rt?(this._buffer.copyRange(r,this._capacity,e),t>0&&this._buffer.copyRange(0,t,e,this._capacity-r),t+(this._capacity-r)):0}_incrementHead(e=1){this._headIndex=(this._headIndex+e)%this._capacity}_incrementTail(e=1){this._tailIndex=(this._tailIndex+e)%this._capacity}_transferRange(e,t){et&&(t>0&&this._buffer.transferRange(0,t),this._buffer.transferRange(e,this._capacity))}};const yt=64;var R;function xo(e){let t=hr().mat4f64(p.LOCALTRANSFORM).mat4f64(p.GLOBALTRANSFORM).vec4f64(p.BOUNDINGSPHERE).vec3f64(p.MODELORIGIN).mat3f(p.INSTANCEMODEL).mat3f(p.INSTANCEMODELNORMAL).vec2f(p.MODELSCALEFACTORS);return e.includes(p.FEATUREATTRIBUTE)&&(t=t.vec4f(p.FEATUREATTRIBUTE)),e.includes(p.COLOR)&&(t=t.vec4u8(p.COLOR)),e.includes(p.OBJECTANDLAYERIDCOLOR)&&(t=t.vec4u8(p.OBJECTANDLAYERIDCOLOR)),t=t.u8(p.STATE).u8(p.LODLEVEL),t}(function(e){e[e.ALLOCATED=1]="ALLOCATED",e[e.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",e[e.VISIBLE=4]="VISIBLE",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",e[e.REMOVE=32]="REMOVE",e[e.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",e[e.ACTIVE=18]="ACTIVE"})(R||(R={}));let Kr=class{constructor(e){this.localTransform=e.getField(p.LOCALTRANSFORM,Gr),this.globalTransform=e.getField(p.GLOBALTRANSFORM,Gr),this.modelOrigin=e.getField(p.MODELORIGIN,Ia),this.model=e.getField(p.INSTANCEMODEL,mt),this.modelNormal=e.getField(p.INSTANCEMODELNORMAL,mt),this.modelScaleFactors=e.getField(p.MODELSCALEFACTORS,Ca),this.boundingSphere=e.getField(p.BOUNDINGSPHERE,Ta),this.featureAttribute=e.getField(p.FEATUREATTRIBUTE,Pi),this.color=e.getField(p.COLOR,ke),this.objectAndLayerIdColor=e.getField(p.OBJECTANDLAYERIDCOLOR,ke),this.state=e.getField(p.STATE,Vr),this.lodLevel=e.getField(p.LODLEVEL,Vr)}},Ee=class extends ye{constructor(e,t){super(e),this.events=new ar,this._capacity=0,this._size=0,this._next=0,this._highlightGroupMap=new Map,this._highlightGroupMapPrev=new Map,this._layout=xo(t),this._capacity=yt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Kr(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,R.ALLOCATED),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;N(e>=0&&e=0&&eda(this._instanceData.view.boundingSphere.getVec(r,this._tmpSphere)),{maximumDepth:25}),this._instanceData=e,this._boundingSphere=t,this._tmpSphere=ua(),this._tmpMat4=L()}addInstance(e){const t=this._instanceData.view.boundingSphere,r=this._instanceData.getCombinedModelTransform(e,this._tmpMat4);_e(fa(this._tmpSphere),this._boundingSphere.center,r),this._tmpSphere[3]=this._boundingSphere.radius*va(r),t.setVec(e,this._tmpSphere),this.add([e])}removeInstance(e){this.remove([e])}},To=class{constructor(e,t){this._worldSpaceRadius=e,this._minScreenSpaceRadii=t}selectLevel(e,t,r){const i=r.computeScreenPixelSizeAt(e),s=this._worldSpaceRadius*t/i;let n=0;for(let a=1;a=this._minScreenSpaceRadii[a]&&(n=a);return n}},So=class{constructor(e){this.layerUid=e}},Oo=class extends So{constructor(e,t){super(e),this.graphicUid=t}};function Ro(e){return e?.dist!=null}let Ao=class{get ray(){return this._ray}get distanceInRenderSpace(){return this.dist!=null?(Z(nt,this.ray.direction,this.dist),me(nt)):null}getIntersectionPoint(e){return!!Ro(this)&&(Z(nt,this.ray.direction,this.dist),ht(e,this.ray.origin,nt),!0)}getTransformedNormal(e){return j(Be,this.normal),Be[3]=0,He(Be,Be,this.transformation),j(e,Be),he(e,e)}constructor(e){this.intersector=Fe.OBJECT,this.normal=A(),this.transformation=L(),this._ray=Di(),this.init(e)}init(e){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=Fe.OBJECT,zr(e,this._ray)}set(e,t,r,i,s,n,a){this.intersector=e,this.dist=r,j(this.normal,i??Bs),ce(this.transformation,s??sa),this.target=t,this.drapedLayerOrder=n,this.drapedLayerGraphicOrder=a}copy(e){zr(e.ray,this._ray),this.intersector=e.intersector,this.dist=e.dist,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.drapedLayerGraphicOrder=e.drapedLayerGraphicOrder,j(this.normal,e.normal),ce(this.transformation,e.transformation)}};function Eo(e){return new Ao(e)}const nt=A(),Be=le();let Mo=class extends Aa{},Do=class extends Oo{constructor(e,t,r,i,s,n){super(e,t),this.layerUid=e,this.graphicUid=t,this.geometryId=r,this.triangleNr=i,this.baseBoundingSphere=s,this.numLodLevels=n}};function Po(e,t,r,i=null){const s=e.createBufferWriter(),n=s.vertexBufferLayout,a=s.elementCount(t),o=n.createBuffer(a);return s.write(null,null,t,i,o,0),{material:e,vertexBufferLayout:n,buffer:o.buffer,elementCount:a,boundingInfo:r}}let Fo=class{constructor(e,t){const r=e.renderContext.rctx,i=t.geometry;let s=null;s=i instanceof pt?Po(i.material,i.attributes,i.boundingInfo):i;const n=s.material;this._materials=e.materials,n.setParameters({instancedDoublePrecision:!0}),this.geometry=i,this.material=n,this.glMaterials=new fr(n,this._materials),this.vertexBufferLayout=s.vertexBufferLayout,this.vbo=Fi.createVertex(r,Li.STATIC_DRAW,s.buffer),this.vao=new Mo(r,Qt,new Map([["geometry",xt(s.vertexBufferLayout)]]),new Map([["geometry",this.vbo]])),this.vertexCount=s.elementCount}destroy(){this.glMaterials.dispose(),this.vbo.dispose(),this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}intersect(e,t,r,i,s,n,a,o){if(!(this.geometry instanceof pt))return;const l=this.geometry.id;this.material.intersect(this.geometry,e.transform.transform,e,r,i,(c,d,h,u,f)=>{if(c>=0){if(t!=null&&!t(e.rayBegin,e.rayEnd,c))return;const _=new Do(n.layerUid,n.graphicUid(s),l,h,a,o);if((e.results.min.drapedLayerOrder==null||f>=e.results.min.drapedLayerOrder)&&(e.results.min.dist==null||c=e.results.max.drapedLayerOrder)&&(e.results.max.dist==null||c>e.results.max.dist)&&e.results.max.set(Fe.LOD,_,c,d,e.transform.transform,f),e.options.store===Br.ALL){const g=Eo(e.results.min.ray);g.set(Fe.LOD,_,c,d,e.transform.transform,f),e.results.all.push(g)}}})}},Lo=class Vi{static async create(t,r,i){const s=await Promise.allSettled(r.components.map(a=>t.controller.schedule(()=>new Fo(t,a),i))),n=s.map(a=>a.status==="fulfilled"?a.value:null).filter(bi);if(xi(i)||n.length!==s.length){n.forEach(a=>a.destroy()),ve(i);for(const a of s)if(a.status==="rejected")throw a.reason}return new Vi(r.minScreenSpaceRadius,n)}constructor(t,r){this.minScreenSpaceRadius=t,this.components=r}destroy(){this.components.forEach(t=>t.destroy())}intersect(t,r,i,s,n,a,o){this.components.forEach(l=>l.intersect(t,r,i,s,n,a,this.boundingSphere,o))}get boundingBox(){if(this._boundingBox==null){const t=As();this.components.forEach(r=>{r.boundingInfo!=null&&(xr(t,r.boundingInfo.bbMin),xr(t,r.boundingInfo.bbMax))}),this._boundingBox=t}return this._boundingBox}get boundingSphere(){if(this._boundingSphere==null){const t=this.boundingBox,r=A();Es(t,r),this._boundingSphere={center:r,radius:.5*Ms(t)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((t,r)=>t+r.triangleCount,0)}};function No(e,t,r,i,s){at[0]=e.get(t,0),at[1]=e.get(t,1),at[2]=e.get(t,2),Ea(at,ue,3),r.set(s,0,ue[0]),i.set(s,0,ue[1]),r.set(s,1,ue[2]),i.set(s,1,ue[3]),r.set(s,2,ue[4]),i.set(s,2,ue[5])}const at=A(),ue=new Float32Array(6),zo=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map(i=>i.minScreenSpaceRadius);return new To(t,r)};let Q=class extends no{constructor(e,t){super(e),this.type=Fe.LOD,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDataMap=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new vo,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[W.OPAQUE_MATERIAL,r=>this._produces(r)],[W.TRANSPARENT_MATERIAL,r=>!!this._hasTransparentLevels()&&this._produces(r)]]),this._instanceData=new Ee({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(t.registerTask(Ma.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=Go(this.optionalFields),this._glInstanceBufferLayout=xt(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDataMap)e.push(t[1]);return e}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get hasEmissions(){return this.baseMaterial.hasEmissions}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((r,i)=>r+i.usedMemory,e),0)}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((r,i)=>{const s=this._allRenderInstanceData[0][i].size+this._allRenderInstanceData[1][i].size,n=r.triangleCount;t.push({renderedInstances:s,renderedTriangles:s*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((r,i)=>r+i.renderedInstances,0),renderedTriangles:t.reduce((r,i)=>r+i.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(e=[]){const{rctx:t}=this._context.renderContext;return this.symbol.levels.map(r=>{e.push(new bo(t,this._instanceBufferLayout))}),e}async initializeRenderContext(e,t){this._context=e,this._createRenderInstanceDataArray(this._defaultRenderInstanceData);const r=await Promise.allSettled(this.symbol.levels.map(s=>Lo.create(e,s,t))),i=r.map(s=>s.status==="fulfilled"?s.value:null).filter(bi);if(xi(t)||i.length!==r.length){i.forEach(s=>s.destroy()),ve(t);for(const s of r)if(s.status==="rejected")throw s.reason}this._levels=i,this._levelSelector=zo(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDataMap.forEach(e=>e.forEach(t=>t.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(t=>t.material.produces.get(W.TRANSPARENT_MATERIAL)?.(E.Color)))}hasHighlights(){return gs(this._highlightRenderInstanceDataMap,e=>e.some(t=>t.size>0))}_produces(e){return e!==E.Highlight&&e!==E.ShadowHighlight||this.hasHighlights()}prepareRender(e){if(!Wt.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(Da),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const r=new Array,i=this.levels;return t.forEach(s=>i.forEach(({components:n},a)=>n.forEach(o=>r.push(this._beginComponent(e,s[a],o))))),r}render(e,t){const r=this._getInstanceDatas(e);if(!r||t==null)return;let i=0;e.rctx.bindVAO();const s=this.levels;r.forEach(n=>s.forEach(({components:a},o)=>a.forEach(l=>this._renderComponent(e,t[i++],n[o],l,o))))}_getInstanceDatas(e){const{output:t,bind:r}=e,i=t===E.Highlight,s=!i&&t!==E.ShadowHighlight,n=t!==E.ShadowExcludeHighlight;if(s)return n?this._allRenderInstanceData:[this._defaultRenderInstanceData];if(n){if(i){const{highlightGroupName:o}=r;if(!o)return null;const l=this._highlightRenderInstanceDataMap.get(o);return l?[l]:null}const a=[];for(const o of this._highlightRenderInstanceDataMap)a.push(o[1]);return a}return null}intersect(e,t,r,i){if(!this.baseMaterial.visible||this._octree==null)return;const s=A();Y(s,i,r);const n=a=>{this._instanceData.getCombinedModelTransform(a,ii),e.transform.set(ii),_e(si,r,e.transform.inverse),_e(ni,i,e.transform.inverse);const o=this._instanceData.getState(a),l=this._instanceData.getLodLevel(a),c=this._levels.length;N(!!(o&R.ACTIVE),"invalid instance state"),N(l>=0&&le.forEach(t=>t.startUpdateCycle()))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:i}=this;this._allRenderInstanceData.forEach(d=>d.forEach(h=>h.beginUpdate()));const s=this._instanceData,n=s.view;let a=s.size;const o=s.capacity;let l=this._instanceIndex;const c=Math.ceil(o/500);for(let d=0;d{const g=this._highlightRenderInstanceDataMap.get(_);if(!g)throw new Ut("Internal error in lodRenderer");g[f].freeTail()}),h&R.REMOVE)s.freeInstance(l);else if(h&R.VISIBLE){let _=0;t&&(n.modelOrigin.getVec(l,ri),_=i.selectLevel(ri,s.getCombinedMedianScaleFactor(l),r)),u=h&~(R.ACTIVE|R.TRANSFORM_CHANGED),_>=0&&(h&R.HIGHLIGHT?(s.foreachHighlightGroup(l,g=>{let C=this._highlightRenderInstanceDataMap.get(g);if(C||(C=this._createRenderInstanceDataArray(),C.forEach(I=>I.beginUpdate()),this._highlightRenderInstanceDataMap.set(g,C)),_>=C.length)throw new Ut(`LodRenderer internal error - missing lodLevel ${_}`);ti(C[_],n,l)}),u|=R.HIGHLIGHT_ACTIVE):(ti(this._defaultRenderInstanceData[_],n,l),u|=R.DEFAULT_ACTIVE)),n.state.set(l,u),n.lodLevel.set(l,_)}else u=h&~(R.ACTIVE|R.TRANSFORM_CHANGED),n.state.set(l,u);if(this._octreeCached!=null){const _=!!(h&R.ACTIVE),g=!!(u&R.ACTIVE);!_&&g?this._octreeCached.addInstance(l):_&&!g?this._octreeCached.removeInstance(l):_&&g&&h&R.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(l),this._octreeCached.addInstance(l))}l=l+1===o?0:l+1,l%c==0&&e.madeProgress()}this._instanceIndex=l,this._allRenderInstanceData.forEach(d=>d.forEach(h=>h.endUpdate())),this._context.requestRender()}_beginComponent(e,t,r){return t.size===0?null:r.glMaterials.load(e.rctx,e.bind.slot,e.output)?.beginSlot(e.bind)}_renderComponent(e,t,r,i,s){if(!t)return;const{bind:n,rctx:a}=e;a.runAppleAmdDriverHelper();const o=a.bindTechnique(t,n,i.material.parameters,Vo);a.bindVAO(i.vao),t.ensureAttributeLocations(i.vao),Wt.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&e.output===E.Color&&(o.setUniform4fv("externalColor",ai[Math.min(s,ai.length-1)]),o.setUniform1i("colorMixMode",cn.replace));const l=r.capacity,c=r.headIndex,d=r.tailIndex,h=r.firstIndex,u=this._glInstanceBufferLayout,f=(_,g)=>{Pa(a,Qt,r.buffer,u,_),a.drawArraysInstanced(t.primitiveType,0,i.vertexCount,g-_),Fa(a,Qt,r.buffer,u)};i.material.parameters.transparent&&h!=null?c>d?(N(h>=d&&h<=c,"invalid firstIndex"),f(h,c),f(d,h)):c=0&&h<=c,"invalid firstIndex"),f(h,c),f(d,l),f(0,h)):(N(h>=d&&h<=l,"invalid firstIndex"),f(h,l),f(0,c),f(d,h))):c>d?f(d,c):cs.geometry));this.numVertices=i.reduce((s,n)=>s+Ho(n),0)}},$o=class{constructor(e){this.levels=e,this.levels.sort((t,r)=>t.minScreenSpaceRadius===r.minScreenSpaceRadius?t.numVertices-r.numVertices:t.minScreenSpaceRadius-r.minScreenSpaceRadius)}};function qo(e){const t=[];return e.levels.forEach(r=>r.components.forEach(i=>t.push(i.geometry.material))),or(t)}function ko(e){const t=new Array;return e.levels.forEach(r=>r.components.forEach(i=>{i.textures!=null&&t.push(...i.textures)})),or(t)}let rr=class{constructor(e){this._optionalFields=new Array,this._instanceIndexToFeatureId=new Map,this._featureIdToInstanceIndex=new Map,this._disposeResourceHandles=new Array,this._lodRendererResources=null,this.layerUid=e.layerUid,this.view=e.view,this.sharedResources=this.view.sharedSymbolResources,this.scheduler=this.view.resourceController.scheduler}async doLoad(e,t,r){vs("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(p.OBJECTANDLAYERIDCOLOR);const i=Wo(l=>t(l),e),s=this.view._stage,n=qo(i);s.addMany(n),this._addDisposeResource(()=>s.removeMany(n));const a=ko(i);s.addMany(a),this._addDisposeResource(()=>{a.forEach(l=>l.unload()),s.removeMany(a)}),await Promise.all(a.map(l=>this.view._stage.schedule(()=>l.load(s.renderView.renderingContext),r))),ve(r);const o=await this._createLodRenderer(i,r);this._lodRendererResources={lodRenderer:o,materials:n,textures:a}}addInstances(e){const t=this._lodRendererResources;if(t==null)return;const{featureIds:r,localTransforms:i,globalTransforms:s}=e,n=t.lodRenderer;if(n==null)return;const a=n.instanceData,o=r.length;for(let l=0;l1,notifyGraphicGeometryChanged:n=>1,notifyGraphicVisibilityChanged:n=>1},s=new Q({symbol:e,optionalFields:this._optionalFields,metadata:i,shaderTransformation:null},this.scheduler);return s.slicePlaneEnabled=!1,this._addDisposeResource(()=>{r.removeRenderPlugin(s),s.destroy()}),await r.addRenderPlugin(s,t),s}};function Wo(e,t){const r=t.levels.map(i=>{const s=i.components.map(n=>{const a=e(n.materialId);if(!Yo(a))throw new Error("LodRenderer only supports DefaultMaterial");const o=a.createBufferWriter(),l={material:a,vertexBufferLayout:o.vertexBufferLayout,buffer:n.renderGeometryBuffer.data,elementCount:n.renderGeometryBuffer.elementCount,boundingInfo:n.boundingInfo};return new jo(l)});return new Uo(s,i.minScreenSpaceRadius)});return new $o(r)}function Yo(e){return e!=null&&"materialType"in e&&e.materialType==="default"}rr=m([K("esri.views.3d.layers.graphics.pipeline.rendering.LodRenderer")],rr);const ji=128,De=.5;function Qo(e){return e==="cross"||e==="x"}function Jo(e,t=ji,r=t*De,i=0){const s=Xo(e,t,r,i);return new xn(s,{mipmap:!1,wrap:{s:Hr.CLAMP_TO_EDGE,t:Hr.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0})}function Xo(e,t=ji,r=t*De,i=0){switch(e){case"circle":default:return Zo(t,r);case"square":return Ko(t,r);case"cross":return tl(t,r,i);case"x":return rl(t,r,i);case"kite":return el(t,r);case"triangle":return il(t,r);case"arrow":return sl(t,r)}}function Zo(e,t){const r=e/2-.5;return Qe(e,$i(r,r,t/2))}function Ko(e,t){return Hi(e,t,!1)}function el(e,t){return Hi(e,t,!0)}function tl(e,t,r=0){return Ui(e,t,!1,r)}function rl(e,t,r=0){return Ui(e,t,!0,r)}function il(e,t){return Qe(e,qi(e/2,t,t/2))}function sl(e,t){const r=t,i=t/2,s=e/2,n=.8*r,a=$i(s,(e-t)/2-n,Math.sqrt(n*n+i*i)),o=qi(s,r,i);return Qe(e,(l,c)=>Math.max(o(l,c),-a(l,c)))}function Hi(e,t,r){return r&&(t/=Math.SQRT2),Qe(e,(i,s)=>{let n=i-.5*e+.25,a=.5*e-s-.75;if(r){const o=(n+a)/Math.SQRT2;a=(a-n)/Math.SQRT2,n=o}return Math.max(Math.abs(n),Math.abs(a))-.5*t})}function Ui(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const s=.5*t;return Qe(e,(n,a)=>{let o,l=n-.5*e,c=.5*e-a-1;if(r){const d=(l+c)/Math.SQRT2;c=(c-l)/Math.SQRT2,l=d}return l=Math.abs(l),c=Math.abs(c),o=l>c?l>s?Math.sqrt((l-s)*(l-s)+c*c):c:c>s?Math.sqrt(l*l+(c-s)*(c-s)):l,o-=i/2,o})}function $i(e,t,r){return(i,s)=>{const n=i-e,a=s-t;return Math.sqrt(n*n+a*a)-r}}function qi(e,t,r){const i=Math.sqrt(t*t+r*r);return(s,n)=>{const a=Math.abs(s-e)-r,o=n-e+t/2+.75,l=(t*a+r*o)/i,c=-o;return Math.max(l,c)}}function Qe(e,t){const r=new Uint8Array(4*e*e);for(let i=0;i=16}function al(e){return Array.isArray(e)&&e.length>=16}function ol(e){return nl(e)||al(e)}const ki=.5;function ll(e,t){e.include(Oi),e.attributes.add(p.POSITION,"vec3"),e.attributes.add(p.NORMAL,"vec3"),e.attributes.add(p.CENTEROFFSETANDDISTANCE,"vec4");const r=e.vertex;In(r,t),Cn(r,t),r.uniforms.add(new Me("viewport",(i,s)=>s.camera.fullViewport),new ge("polygonOffset",i=>i.shaderPolygonOffset),new ge("cameraGroundRelative",(i,s)=>s.camera.aboveGround?1:-1)),t.hasVerticalOffset&&Tn(r),r.constants.add("smallOffsetAngle","float",.984807753012208),r.code.add(w`struct ProjectHUDAux { +vec3 posModel; +vec3 posView; +vec3 vnormal; +float distanceToCamera; +float absCosAngle; +};`),r.code.add(w` + float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) { + float pointGroundSign = ${t.terrainDepthTest?w.float(0):w`sign(pointGroundDistance)`}; + if (pointGroundSign == 0.0) { + pointGroundSign = cameraGroundRelative; + } + + // cameraGroundRelative is -1 if camera is below ground, 1 if above ground + // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise + float groundRelative = cameraGroundRelative * pointGroundSign; + + // view angle dependent part of polygon offset emulation: we take the absolute value because the sign that is + // dropped is instead introduced using the ground-relative position of the symbol and the camera + if (polygonOffset > .0) { + float cosAlpha = clamp(absCosAngle, 0.01, 1.0); + float tanAlpha = sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha; + float factor = (1.0 - tanAlpha / viewport[2]); + + // same side of the terrain + if (groundRelative > 0.0) { + posView *= factor; + } + // opposite sides of the terrain + else { + posView /= factor; + } + } + + return groundRelative; + } + `),t.draped&&!t.hasVerticalOffset||Sn(r),t.draped||(r.uniforms.add(new ge("perDistancePixelRatio",(i,s)=>Math.tan(s.camera.fovY/2)/(s.camera.fullViewport[2]/2))),r.code.add(w` + void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) { + float distanceToCamera = length(posView); + + // Compute offset in world units for a half pixel shift + float pixelOffset = distanceToCamera * perDistancePixelRatio * ${w.float(ki)}; + + // Apply offset along normal in the direction away from the ground surface + vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset; + + // Apply the same offset also on the view space position + vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; + + posModel += modelOffset; + posView += viewOffset; + } + `)),t.screenCenterOffsetUnitsEnabled&&Ri(r),t.hasScreenSizePerspective&&Ai(r),r.code.add(w` + vec4 projectPositionHUD(out ProjectHUDAux aux) { + vec3 centerOffset = centerOffsetAndDistance.xyz; + float pointGroundDistance = centerOffsetAndDistance.w; + + aux.posModel = position; + aux.posView = (view * vec4(aux.posModel, 1.0)).xyz; + aux.vnormal = normal; + ${t.draped?"":"applyHUDVerticalGroundOffset(aux.vnormal, aux.posModel, aux.posView);"} + + // Screen sized offset in world space, used for example for line callouts + // Note: keep this implementation in sync with the CPU implementation, see + // - MaterialUtil.verticalOffsetAtDistance + // - HUDMaterial.applyVerticalOffsetTransformation + + aux.distanceToCamera = length(aux.posView); + + vec3 viewDirObjSpace = normalize(cameraPosition - aux.posModel); + float cosAngle = dot(aux.vnormal, viewDirObjSpace); + + aux.absCosAngle = abs(cosAngle); + + ${t.hasScreenSizePerspective&&(t.hasVerticalOffset||t.screenCenterOffsetUnitsEnabled)?"vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);":""} + + ${t.hasVerticalOffset?t.hasScreenSizePerspective?"float verticalOffsetScreenHeight = applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);":"float verticalOffsetScreenHeight = verticalOffset.x;":""} + + ${t.hasVerticalOffset?w` + float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w); + vec3 modelOffset = aux.vnormal * worldOffset; + aux.posModel += modelOffset; + vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; + aux.posView += viewOffset; + // Since we elevate the object, we need to take that into account + // in the distance to ground + pointGroundDistance += worldOffset;`:""} + + float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView); + + ${t.screenCenterOffsetUnitsEnabled?"":w` + // Apply x/y in view space, but z in screen space (i.e. along posView direction) + aux.posView += vec3(centerOffset.x, centerOffset.y, 0.0); + + // Same material all have same z != 0.0 condition so should not lead to + // branch fragmentation and will save a normalization if it's not needed + if (centerOffset.z != 0.0) { + aux.posView -= normalize(aux.posView) * centerOffset.z; + } + `} + + vec4 posProj = proj * vec4(aux.posView, 1.0); + + ${t.screenCenterOffsetUnitsEnabled?t.hasScreenSizePerspective?"float centerOffsetY = applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);":"float centerOffsetY = centerOffset.y;":""} + + ${t.screenCenterOffsetUnitsEnabled?"posProj.xy += vec2(centerOffset.x, centerOffsetY) * pixelRatio * 2.0 / viewport.zw * posProj.w;":""} + + // constant part of polygon offset emulation + posProj.z -= groundRelative * polygonOffset * posProj.w; + return posProj; + } + `)}let cl=class{constructor(){this.factor=new oi,this.factorAlignment=new oi}},oi=class{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}};function mr(e){e.uniforms.add(new On("alignPixelEnabled",(t,r)=>r.alignPixelEnabled)),e.code.add(w`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) { +if (!alignPixelEnabled) +return clipCoord; +vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w; +vec2 pixelSz = vec2(1.0) / widthHeight; +vec2 ij = (floor(xy * widthHeight) + vec2(0.5)) * pixelSz; +vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; +return vec4(result, clipCoord.zw); +}`),e.code.add(w`vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) { +if (!alignPixelEnabled) +return clipCoord; +vec2 xy = vec2(0.5) + 0.5 * clipCoord.xy / clipCoord.w; +vec2 pixelSz = vec2(1.0) / widthHeight; +vec2 ij = floor((xy + 0.5 * pixelSz) * widthHeight) * pixelSz; +vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; +return vec4(result, clipCoord.zw); +}`)}function hl(e,t){const{vertex:r,fragment:i}=e;e.include(Rn,t),r.include(mr),t.terrainDepthTest&&e.varyings.add("depth","float"),r.main.add(w` + vec4 posProjCenter; + if (dot(position, position) > 0.0) { + // Render single point to center of the pixel to avoid subpixel filtering to affect the marker color + ProjectHUDAux projectAux; + vec4 posProj = projectPositionHUD(projectAux); + posProjCenter = alignToPixelCenter(posProj, viewport.zw); + + ${t.terrainDepthTest?w`depth = projectAux.posView.z;`:""} + vec3 vpos = projectAux.posModel; + if (rejectBySlice(vpos)) { + // Project out of clip space + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + } + + } else { + // Project out of clip space + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + } + + gl_Position = posProjCenter; + gl_PointSize = 1.0; + `),i.main.add(w`fragColor = vec4(1); +if(terrainDepthTest(depth)) { +fragColor.g = 0.5; +}`)}var wt;(function(e){e[e.Occluded=0]="Occluded",e[e.NotOccluded=1]="NotOccluded",e[e.Both=2]="Both",e[e.COUNT=3]="COUNT"})(wt||(wt={}));function dl(e){e.vertex.uniforms.add(new ge("renderTransparentlyOccludedHUD",(t,r)=>r.hudRenderStyle===wt.Occluded?1:r.hudRenderStyle===wt.NotOccluded?0:.75),new Me("viewport",(t,r)=>r.camera.fullViewport),new Yt("hudVisibilityTexture",(t,r)=>r.hudVisibility?.getTexture())),e.vertex.include(mr),e.vertex.code.add(w`bool testHUDVisibility(vec4 posProj) { +vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw); +vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w); +if (renderTransparentlyOccludedHUD > 0.5) { +return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0; +} +return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0; +}`)}const gr={occludedFadeFactor:.6};function Wi(e){const t=new hn,r=e.signedDistanceFieldEnabled;if(t.include(ll,e),t.include(dn,e),e.occlusionPass)return t.include(hl,e),t;const{vertex:i,fragment:s}=t;t.include(Oi),t.include(un,e),t.include(fn,e),t.include(dl),s.include(qa),s.include(pn),t.varyings.add("vcolor","vec4"),t.varyings.add("vtc","vec2"),t.varyings.add("vsize","vec2"),t.varyings.add("voccluded","float"),i.uniforms.add(new Me("viewport",(d,h)=>h.camera.fullViewport),new Sr("screenOffset",(d,h)=>ft(Yi,2*d.screenOffset[0]*h.camera.pixelRatio,2*d.screenOffset[1]*h.camera.pixelRatio)),new Sr("anchorPosition",d=>We(d)),new Me("materialColor",d=>d.color),new ge("materialRotation",d=>d.rotation)),Ri(i),r&&(i.uniforms.add(new Me("outlineColor",d=>d.outlineColor)),s.uniforms.add(new Me("outlineColor",d=>li(d)?d.outlineColor:Xs),new ge("outlineSize",d=>li(d)?d.outlineSize:0))),e.horizonCullingEnabled&&i.uniforms.add(new ka("pointDistanceSphere",(d,h)=>{const u=h.camera.eye,f=d.origin;return ae(f[0]-u[0],f[1]-u[1],f[2]-u[2],ys.radius)})),e.pixelSnappingEnabled&&i.include(mr),e.hasScreenSizePerspective&&(mn(i),Ai(i)),e.debugDrawLabelBorder&&t.varyings.add("debugBorderCoords","vec4"),t.attributes.add(p.UV0,"vec2"),t.attributes.add(p.COLOR,"vec4"),t.attributes.add(p.SIZE,"vec2"),t.attributes.add(p.ROTATION,"float"),t.attributes.add(p.FEATUREATTRIBUTE,"vec4"),i.code.add(e.horizonCullingEnabled?w`bool behindHorizon(vec3 posModel) { +vec3 camToEarthCenter = pointDistanceSphere.xyz - localOrigin; +vec3 camToPos = pointDistanceSphere.xyz + posModel; +float earthRadius = pointDistanceSphere.w; +float a = dot(camToPos, camToPos); +float b = dot(camToPos, camToEarthCenter); +float c = dot(camToEarthCenter, camToEarthCenter) - earthRadius * earthRadius; +return b > 0.0 && b < a && b * b > a * c; +}`:w`bool behindHorizon(vec3 posModel) { return false; }`),i.main.add(w` + ProjectHUDAux projectAux; + vec4 posProj = projectPositionHUD(projectAux); + forwardObjectAndLayerIdColor(); + + if (rejectBySlice(projectAux.posModel)) { + // Project outside of clip plane + gl_Position = vec4(1e038, 1e038, 1e038, 1.0); + return; + } + + if (behindHorizon(projectAux.posModel)) { + // Project outside of clip plane + gl_Position = vec4(1e038, 1e038, 1e038, 1.0); + return; + } + + vec2 inputSize; + ${z(e.hasScreenSizePerspective,w` + inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective); + vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);`,w` + inputSize = size; + vec2 screenOffsetScaled = screenOffset;`)} + ${z(e.vvSize,w`inputSize *= vvScale(featureAttribute).xx;`)} + + vec2 combinedSize = inputSize * pixelRatio; + vec4 quadOffset = vec4(0.0); + bool visible = testHUDVisibility(posProj); + voccluded = visible ? 0.0 : 1.0; + `);const n=w` + vec2 uv01 = floor(uv0); + vec2 uv = uv0 - uv01; + quadOffset.xy = (uv01 - anchorPosition) * 2.0 * combinedSize; + + ${z(e.hasRotation,w` + float angle = radians(materialRotation + rotation); + float cosAngle = cos(angle); + float sinAngle = sin(angle); + mat2 rotate = mat2(cosAngle, -sinAngle, sinAngle, cosAngle); + + quadOffset.xy = rotate * quadOffset.xy; + `)} + + quadOffset.xy = (quadOffset.xy + screenOffsetScaled) / viewport.zw * posProj.w; + `,a=e.pixelSnappingEnabled?r?w`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:w`posProj += quadOffset; +if (inputSize.x == size.x) { +posProj = alignToPixelOrigin(posProj, viewport.zw); +}`:w`posProj += quadOffset;`;i.main.add(w` + ${z(e.occlusionTestEnabled,w` + if (!visible) { + vtc = vec2(0.0); + ${z(e.debugDrawLabelBorder,"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);")} + return; + }`)} + ${n} + ${e.vvColor?"vcolor = interpolateVVColor(featureAttribute.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"} + + ${z(e.output===E.ObjectAndLayerIdColor,w`vcolor.a = 1.0;`)} + + bool alphaDiscard = vcolor.a < ${w.float(oe)}; + ${z(r,`alphaDiscard = alphaDiscard && outlineColor.a < ${w.float(oe)};`)} + if (alphaDiscard) { + // "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } else { + ${a} + gl_Position = posProj; + } + + vtc = uv; + + ${z(e.debugDrawLabelBorder,w`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)} + vsize = inputSize; + `),s.uniforms.add(new Yt("tex",d=>d.texture)),e.occludedFragmentFade&&(s.uniforms.add(new Yt("depthMap",(d,h)=>h.mainDepth)),s.uniforms.add(new ge("fadeFactor",()=>gr.occludedFadeFactor)));const o=e.debugDrawLabelBorder?w`(isBorder > 0.0 ? 0.0 : ${w.float(oe)})`:w.float(oe),l=e.output===E.Highlight,c=w` + ${z(e.debugDrawLabelBorder,w`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)} + + ${z(e.sampleSignedDistanceFieldTexelCenter,w` + float txSize = float(textureSize(tex, 0).x); + float texelSize = 1.0 / txSize; + + // Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel + vec2 scaleFactor = (vsize - txSize) * texelSize; + vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor;`,w`vec2 samplePos = vtc;`)} + + ${r?w` + vec4 fillPixelColor = vcolor; + + // Get distance and map it into [-0.5, 0.5] + float d = rgba2float(texture(tex, samplePos)) - 0.5; + + // Distance in output units (i.e. pixels) + float dist = d * vsize.x; + + // Create smooth transition from the icon into its outline + float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0); + fillPixelColor.a *= fillAlphaFactor; + + if (outlineSize > 0.25) { + vec4 outlinePixelColor = outlineColor; + float clampedOutlineSize = min(outlineSize, 0.5*vsize.x); + + // Create smooth transition around outline + float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0); + outlinePixelColor.a *= outlineAlphaFactor; + + if ( + outlineAlphaFactor + fillAlphaFactor < ${o} || + fillPixelColor.a + outlinePixelColor.a < ${w.float(oe)} + ) { + discard; + } + + // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description) + float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a); + vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a + + vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a); + + ${z(!l,w`fragColor = vec4(compositeColor, compositeAlpha);`)} + } else { + if (fillAlphaFactor < ${o}) { + discard; + } + + ${z(!l,w`fragColor = premultiplyAlpha(fillPixelColor);`)} + } + + // visualize SDF: + // fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0); + `:w` + vec4 texColor = texture(tex, vtc, -0.5); + if (texColor.a < ${o}) { + discard; + } + ${z(!l,w`fragColor = texColor * premultiplyAlpha(vcolor);`)} + `} + + ${z(e.occludedFragmentFade&&!l,w` + float zSample = texelFetch(depthMap, ivec2(gl_FragCoord.xy), 0).x; + if (zSample < gl_FragCoord.z) { + fragColor *= fadeFactor; + } + `)} + + ${z(!l&&e.debugDrawLabelBorder,w`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`)} + `;switch(e.output){case E.Color:e.oitPass===Ue.ColorAlpha&&(t.outputs.add("fragColor","vec4",0),t.outputs.add("fragAlpha","float",1)),s.main.add(w` + ${c} + ${z(e.oitPass===Ue.FrontFace,w`fragColor.rgb /= fragColor.a;`)} + ${z(e.oitPass===Ue.ColorAlpha,w`fragAlpha = fragColor.a;`)}`);break;case E.ObjectAndLayerIdColor:s.main.add(w` + ${c} + outputObjectAndLayerIdColor();`);break;case E.Highlight:t.include(gn,e),s.main.add(w` + ${c} + outputHighlight(voccluded == 1.0);`)}return t}function li(e){return e.outlineColor[3]>0&&e.outlineSize>0}function We(e,t=Yi){return e.textureIsSignedDistanceField?ul(e.anchorPosition,e.distanceFieldBoundingBox,t):Si(t,e.anchorPosition),t}function ul(e,t,r){t!=null?ft(r,e[0]*(t[2]-t[0])+t[0],e[1]*(t[3]-t[1])+t[1]):ft(r,0,0)}const Yi=lr(),fl=Object.freeze(Object.defineProperty({__proto__:null,build:Wi,calculateAnchorPosForRendering:We,shaderSettings:gr},Symbol.toStringTag,{value:"Module"}));let pl=class extends qn{constructor(e,t,r){super(e,t,new kn(fl,()=>Promise.resolve().then(()=>cc)),r),this.primitiveType=t.occlusionPass?Ur.POINTS:Ur.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:i,output:s,depthTestEnabled:n}=e,a=t===Ue.NONE,o=r?ml:null,l=t===Ue.ColorAlpha,c=i||!n||l||s===E.Highlight?null:Na;return za({blending:s===E.Color?a?Ba:Wn(t):null,depthTest:n&&!i?{func:Sa.LEQUAL}:null,depthWrite:c,drawBuffers:Yn(t,s),colorWrite:Ga,polygonOffset:o})}};const ml={factor:0,units:-4};let D=class extends _n{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.textureCoordinateType=vn.None,this.emissionSource=yn.None,this.discardInvisibleFragments=!0,this.hasSliceInVertexProgram=!0,this.hasVvInstancing=!1}};m([F()],D.prototype,"screenCenterOffsetUnitsEnabled",void 0),m([F()],D.prototype,"occlusionTestEnabled",void 0),m([F()],D.prototype,"signedDistanceFieldEnabled",void 0),m([F()],D.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),m([F()],D.prototype,"vvSize",void 0),m([F()],D.prototype,"vvColor",void 0),m([F()],D.prototype,"hasVerticalOffset",void 0),m([F()],D.prototype,"hasScreenSizePerspective",void 0),m([F()],D.prototype,"hasRotation",void 0),m([F()],D.prototype,"debugDrawLabelBorder",void 0),m([F()],D.prototype,"hasSlicePlane",void 0),m([F()],D.prototype,"hasPolygonOffset",void 0),m([F()],D.prototype,"depthTestEnabled",void 0),m([F()],D.prototype,"pixelSnappingEnabled",void 0),m([F()],D.prototype,"draped",void 0),m([F()],D.prototype,"terrainDepthTest",void 0),m([F()],D.prototype,"cullAboveTerrain",void 0),m([F()],D.prototype,"occlusionPass",void 0),m([F()],D.prototype,"occludedFragmentFade",void 0),m([F()],D.prototype,"objectAndLayerIdColorInstanced",void 0),m([F()],D.prototype,"horizonCullingEnabled",void 0);class gl extends An{constructor(t,r){super(t,Sl),this.produces=new Map([[W.HUD_MATERIAL,i=>Ct(i)&&!this.parameters.drawInSecondSlot],[W.LABEL_MATERIAL,i=>Ct(i)&&this.parameters.drawInSecondSlot],[W.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[W.DRAPED_MATERIAL,i=>this.parameters.draped&&Ct(i)]]),this._visible=!0,this._configuration=new D(r)}getConfiguration(t,r){return this._configuration.output=t,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled=this.parameters.centerOffsetUnits==="screen",this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=r.slot===W.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.depthTestEnabled=this.parameters.depthEnabled||r.slot===W.OCCLUSION_PIXELS,t===E.Color&&(this._configuration.debugDrawLabelBorder=!!Wt.LABELS_SHOW_BORDER),this._configuration.oitPass=r.oitPass,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration}intersect(t,r,i,s,n,a){const{options:{selectionMode:o,hud:l,excludeLabels:c},point:d,camera:h}=i,{parameters:u}=this;if(!o||!l||c&&u.isLabel||!t.visible||!d)return;const{scaleX:f,scaleY:_}=this._getScreenScale(t,h.pixelRatio);dr(Lt,r),t.attributes.has(p.FEATUREATTRIBUTE)&&yl(Lt);const g=t.attributes.get(p.POSITION),C=t.attributes.get(p.SIZE),I=t.attributes.get(p.NORMAL),x=t.attributes.get(p.ROTATION),O=t.attributes.get(p.CENTEROFFSETANDDISTANCE);N(g.size>=3);const M=We(u),y=this.parameters.centerOffsetUnits==="screen";for(let P=0;P-1){y&&(k[0]||k[1])&&(V[0]+=k[0]*h.pixelRatio,k[1]!==0&&(V[1]+=En(k[1],Ft.factorAlignment)*h.pixelRatio),h.unapplyProjection(V,G)),V[0]+=this.parameters.screenOffset[0]*h.pixelRatio,V[1]+=this.parameters.screenOffset[1]*h.pixelRatio,V[0]=Math.floor(V[0]),V[1]=Math.floor(V[1]);const Je=P*C.size;$[0]=C.data[Je],$[1]=C.data[Je+1],Mn($,Ft.factor,$);const rs=Il*h.pixelRatio;let _r=0;u.textureIsSignedDistanceField&&(_r=Math.min(u.outlineSize,.5*$[0])*h.pixelRatio/2),$[0]*=f,$[1]*=_;const is=P*x.size,ss=u.rotation+x.data[is];if(hi(d,V[0],V[1],$,rs,_r,ss,u,M)){const vr=i.ray;if(_e(di,G,Pe(bl,h.viewMatrix)),V[0]=d[0],V[1]=d[1],h.unprojectFromRenderScreen(V,G)){const Ne=A();j(Ne,vr.direction);const yr=1/me(Ne);Z(Ne,Ne,yr),a(Mi(vr.origin,G)*yr,Ne,-1,!0,1,di)}}}}}intersectDraped(t,r,i,s,n,a){const o=t.attributes.get(p.POSITION),l=t.attributes.get(p.SIZE),c=t.attributes.get(p.ROTATION),d=this.parameters,h=We(d),{scaleX:u,scaleY:f}=this._getScreenScale(t,t.screenToWorldRatio),_=Cl*t.screenToWorldRatio;for(let g=0;g0?d:1/d),n}_applyVerticalGroundOffsetView(t,r,i,s){const n=me(t),a=i.aboveGround?1:-1,o=i.computeRenderPixelSizeAtDist(n)*ki,l=Z(G,r.normal,a*o);return ht(s,t,l),s}_applyVerticalOffsetTransformationView(t,r,i,s){const n=this.parameters;if(!n.verticalOffset?.screenLength){if(n.screenSizePerspective||n.screenSizePerspectiveAlignment){const c=me(t);this._updateScaleInfo(s,c,r.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return t}const a=me(t),o=n.screenSizePerspectiveAlignment??n.screenSizePerspective,l=Dn(i,a,n.verticalOffset,r.cosAngle,o);return this._updateScaleInfo(s,a,r.cosAngle),Z(r.normal,r.normal,l),ht(t,t,r.normal)}_applyCenterOffsetView(t,r,i){const s=this.parameters.centerOffsetUnits!=="screen";return i!==t&&j(i,t),s&&(i[0]+=r[0],i[1]+=r[1],r[2]&&(he(Ge,i),ht(i,i,Z(Ge,Ge,r[2])))),i}_applyCenterOffsetNDC(t,r,i,s){const n=this.parameters.centerOffsetUnits!=="screen";return s!==t&&j(s,t),n||(s[0]+=r[0]/i.fullWidth*2,s[1]+=r[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(t,r,i,s){const n=this.parameters.shaderPolygonOffset;if(t!==s&&j(s,t),n){const a=i.aboveGround?1:-1,o=a*Math.sign(r[3]);s[2]-=(o||a)*n}return s}set visible(t){this._visible=t}get visible(){const{color:t,outlineSize:r,outlineColor:i}=this.parameters,s=t[3]>=oe||r>=oe&&i[3]>=oe;return this._visible&&s}createGLMaterial(t){return new _l(t)}calculateRelativeScreenBounds(t,r,i=Ii()){return vl(this.parameters,t,r,i),i[2]=i[0]+t[0],i[3]=i[1]+t[1],i}_getScreenScale(t,r){const i=t.attributes.get(p.FEATUREATTRIBUTE);if(i==null)return{scaleX:r,scaleY:r};const s=Zs(i.data,xl);return Pn(Nt,this.parameters,s),{scaleX:Nt[0]*r,scaleY:Nt[1]*r}}}class _l extends Fn{constructor(t){super({...t,...t.material.parameters})}beginSlot(t){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.acquireTechnique(pl,t)}}function vl(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}function ci(e,t,r,i){return ol(t)&&(t=dr(wl,t)),oa(i.normal,e,t),_e(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=qe(Qi,Tl),i}function yl(e){const t=e[0],r=e[1],i=e[2],s=e[3],n=e[4],a=e[5],o=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+i*i),h=1/Math.sqrt(s*s+n*n+a*a),u=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*d,e[1]=r*d,e[2]=i*d,e[3]=s*h,e[4]=n*h,e[5]=a*h,e[6]=o*u,e[7]=l*u,e[8]=c*u,e}function hi(e,t,r,i,s,n,a,o,l){let c=t-s-i[0]*l[0],d=c+i[0]+2*s,h=r-s-i[1]*l[1],u=h+i[1]+2*s;const f=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&f!=null&&(c+=i[0]*f[0],h+=i[1]*f[1],d-=i[0]*(1-f[2]),u-=i[1]*(1-f[3]),c-=n,d+=n,h-=n,u+=n),ft(ui,t,r),tn(Ve,e,ui,Ps(a)),Ve[0]>c&&Ve[0]h&&Ve[1]=4&&(l=o[0],c=o[1],d=o[2],h=o[3]),d=Math.min(1.99999,d+1),h=Math.min(1.99999,h+1);let u=i.get(p.POSITION).indices.length,f=a;const _=n.uv0;for(let x=0;xbs(o))]),n=a}break;default:throw new Error(`unable to create unknown material type ${e.type}`)}this._materials.set(e.materialId,n)}_getMaterial(e){return this._materials.get(e)}async _createDirectRenderer(e){const t=e.materialId,r=this._getMaterial(t);if(r==null)throw new Error(`material not found ${t}`);const{view:i}=this,s=new dt({material:r});this._directRenderers.set(t,s),i._stage.addRenderPlugin(s),i._stage.renderView.renderer.updateHasFlags()}async _addDirectRendererGeometry(e){const t=e.renderGeometryId,r=e.materialId;this._renderGeometries.get(t)!=null&&await this._removeDirectRendererGeometry({renderGeometryId:t});const i=this._directRenderers.get(r);if(i==null)return void console.error("no renderer assigned to provided material");const s=i.addRenderGeometry(t,e.renderGeometryBuffer,e.localOrigin);this._renderGeometries.set(t,{renderGeometry:s,materialId:r}),this.view._stage.renderView.requestRender()}async _removeDirectRendererGeometry(e){const t=e.renderGeometryId,r=this._renderGeometries.get(t);if(r==null)return;const i=r.materialId,s=this._directRenderers.get(i);s!=null?s.removeRenderGeometry(e.renderGeometryId):console.error("no renderer assigned to provided material")}async _createLodRenderer(e){const t=new rr({view:this.view,layerUid:this.layerUid}),r=new AbortController,i=s=>this._getMaterial(s);await t.doLoad(e.lodRenderGeometry,i,r.signal),this._lodRenderers.set(e.lodRendererId,t)}async _addLodInstances(e){const t=this._lodRenderers.get(e.lodRendererId);if(t==null)throw new Error("no lod renderer assigned to provided lod renderer Id");t.addInstances(e.data)}async _removeLodInstances(e){const t=this._lodRenderers.get(e.lodRendererId);if(t==null)throw new Error("no lod renderer assigned to provided lod renderer Id");t.removeInstances(e.featureIds)}};function Xi(e,t){const r={anchorPosition:io.center,occlusionTest:!0,hasSlicePlane:!1},i=r,s=1;i.color=[1,0,0,1],i.outlineColor=[0,0,0,1],i.outlineSize=s;const n=null;if(e!=null){const a=e.fromData("circle-icon",()=>Jo("circle"));i.textureId=a.texture.id,i.textureIsSignedDistanceField=!0,i.sampleSignedDistanceFieldTexelCenter=Qo("circle")}return i.distanceFieldBoundingBox=Ml,[new gl(r,t),n]}function Al(e,t,r){const i={usePBR:t.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:Un,ambient:qt,diffuse:qt,hasSlicePlane:t.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:t.castShadows,offsetTransparentBackfaces:!t.isPrimitive};return El(i),i.screenSizePerspective=e.screenSizePerspectiveSettings,i.externalColor=Ks,i.isInstanced=!0,new Ei(i,{spherical:r,doublePrecisionRequiresObfuscation:!0})}function El(e){const t=e.opacity??1,r=t<1;return e.transparent=r,e.opacity=t,e.cullFace=r?Mr.None:Mr.Back,e}fi=m([K("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderManager")],fi);const Ml=[De/2,De/2,1-De/2,1-De/2];let pi=class{constructor(e){this._bufferWriter=null,this._bufferWriter=e.createBufferWriter()}createBuffer(e,t){const r=this._bufferWriter;let i=null;if(e.transformation&&t)ce(xe,e.transformation),xe[12]-=t[0],xe[13]-=t[1],xe[14]-=t[2],i=xe;else{if(t)throw new Error("not implemented");e.transformation&&(i=e.transformation)}let s=null;i&&(Pe(ot,xe),cr(ot,ot),s=ot);const n=e.attributes,a=r.elementCount(n),o=r.vertexBufferLayout.stride/4;a>Math.floor(Dl/o)&&console.warn("geometry with very large number of elements encountered");const l=r.vertexBufferLayout.createBuffer(a);return r.write(i,s,n,e.objectAndLayerIdColor,l,0),{data:l.buffer,elementCount:a}}};const xe=L(),ot=L(),Dl=16777216/4;let Pl=class{constructor(e){this._context=e,this._commands=[],this._transferables=new Set}createMaterial(e){const t=this._context,r=t.generateId("material");switch(e){case"default":{const i=new Ei({},{spherical:this._context.globalViewingMode,doublePrecisionRequiresObfuscation:!0}),s=new pi(i);t.registerRenderGeometryBufferWriter(r,s)}break;case"hud":{const i=Xi(null,this._context.globalViewingMode)[0],s=new pi(i);t.registerRenderGeometryBufferWriter(r,s)}}return this._commands.push({id:"create-material",type:e,materialId:r}),r}createDirectRenderer(e){const t=this._context.generateId("material-renderer");return this._commands.push({id:"create-direct-renderer",materialRendererId:t,materialId:e}),t}addDirectRendererGeometry(e,t,r){const i=t.materialId,s=this._context.getRenderGeometryBufferWriter(i);if(s==null)throw new Error(`no bufferwriter found for material ${i}`);const n=s.createBuffer(t,r);this._transferables.add(n.data),this._commands.push({id:"add-direct-renderer-geometry",renderGeometryId:e,materialId:i,renderGeometryBuffer:n,localOrigin:r})}removeDirectRendererGeometry(e){this._commands.push({id:"remove-direct-renderer-geometry",renderGeometryId:e})}createLodRenderer(e){const t=this._context.generateId("lod-renderer"),r={levels:e.levels.map(i=>({components:i.components.map(s=>{const n=s.attributes.get(p.POSITION);if(!n||n.indices.length===0)throw new Error("positions attribute expected");const a=3,o=Qs(n.indices.length/a),l=new $n(o,a,n),c=this._context.getRenderGeometryBufferWriter(s.materialId);if(c==null)throw new Error("writer not found");const d=c.createBuffer(s,null);return this._transferables.add(d.data),{materialId:s.materialId,renderGeometryBuffer:d,boundingInfo:{bbMax:l.bbMax,bbMin:l.bbMin}}}),minScreenSpaceRadius:i.minScreenSpaceRadius}))};return this._commands.push({id:"create-lod-renderer",lodRendererId:t,lodRenderGeometry:r}),t}addLodInstances(e,t){this._commands.push({id:"add-lod-instances",lodRendererId:e,data:t}),this._transferables.add(t.featureIds.buffer),this._transferables.add(t.globalTransforms.buffer),this._transferables.add(t.localTransforms.buffer)}removeLodInstances(e,t){this._commands.push({id:"remove-lod-instances",lodRendererId:e,featureIds:t}),this._transferables.add(t.buffer)}async dispatch(){const e=this._commands,t=Array.from(this._transferables);this._clearCommandBuffer(),this._context.dispatchRenderCommands(e,t)}_clearCommandBuffer(){this._commands=[],this._transferables.clear()}},Fl=class{constructor(e){this._idCounter=0,this._bufferWriters=new Map,this._dispatchRenderCommandsCallback=async()=>{},this.globalViewingMode=!1,this.globalViewingMode=e.viewingMode===ne.Global,this._dispatchRenderCommandsCallback=e.dispatchRenderCommandsCallback}generateId(e=""){return`${e}${this._idCounter++}`}createEncoder(){return new Pl(this)}async dispatchRenderCommands(e,t){this._dispatchRenderCommandsCallback(e,t)}registerRenderGeometryBufferWriter(e,t){this._bufferWriters.set(e,t)}getRenderGeometryBufferWriter(e){return this._bufferWriters.get(e)}};var q;(function(e){e[e.OBJECT_ID=0]="OBJECT_ID",e[e.PARTITION_ID=1]="PARTITION_ID",e[e.GEOMETRY_MAP_COORDINATES=2]="GEOMETRY_MAP_COORDINATES",e[e.GEOMETRY_RENDER_COORDINATES=3]="GEOMETRY_RENDER_COORDINATES",e[e.TILE_CENTER_RENDER_COORDINATES=4]="TILE_CENTER_RENDER_COORDINATES"})(q||(q={}));async function Ll(e,t){const{numFeatures:r,tile:i,partitionInfo:s}=e,{pages:n}=i;if(n.length===0||r===0)return new Uint32Array;const a=new Uint32Array(r);if(s){const o=n.reduce((h,{featureCount:u})=>h+u,0),l=new Uint32Array(o);let c=0;for(const h of n)c=h.readAllObjectIds(l,c);const d=s.tileIndices;for(let h=0;hh+u,0),l=new Float64Array(3*o);let c=0;for(const h of n)c=h.readAllCoordinates(l,c);const d=s.tileIndices;for(let h=0;h=0;o--){const l=e[o];let c;const d=l!=null,h=o===0&&!n&&!d,u=r[o];l==="symbol-value"||h?c=u!==0?t[o]/u:1:d&&l!=="proportional"&&isFinite(l)&&(c=u!==0?l/u:1),c!=null&&(s[o]=c,n=c,a=Math.max(a,Math.abs(c)))}for(let o=2;o>=0;o--)s[o]==null?s[o]=n:s[o]===0&&(s[o]=.001*a)}for(let n=2;n>=0;n--)s[n]/=i;return $t(s)}function Ki(e){const t=new Map;for(const[r,i]of e)t.set(r,{...i,indices:Js(i.indices)});return t}var mi;(function(e){function t(a,o){const l=a[o],c=a[o+1],d=a[o+2];return Math.sqrt(l*l+c*c+d*d)}function r(a,o){const l=a[o],c=a[o+1],d=a[o+2],h=1/Math.sqrt(l*l+c*c+d*d);a[o]*=h,a[o+1]*=h,a[o+2]*=h}function i(a,o,l){a[o]*=l,a[o+1]*=l,a[o+2]*=l}function s(a,o,l,c,d,h=o){(d=d||a)[h]=a[o]+l[c],d[h+1]=a[o+1]+l[c+1],d[h+2]=a[o+2]+l[c+2]}function n(a,o,l,c,d,h=o){(d=d||a)[h]=a[o]-l[c],d[h+1]=a[o+1]-l[c+1],d[h+2]=a[o+2]-l[c+2]}e.length=t,e.normalize=r,e.scale=i,e.add=s,e.subtract=n})(mi||(mi={}));const Vl=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)Vl[6*e+t]=e;const Ie=new Array(36);for(let e=0;e<6;e++)Ie[6*e]=0,Ie[6*e+1]=1,Ie[6*e+2]=2,Ie[6*e+3]=2,Ie[6*e+4]=3,Ie[6*e+5]=0;const Bt=re(-.5,0,-.5),Gt=re(.5,0,-.5),Vt=re(0,0,.5),jt=re(0,.5,0),Ce=Ye(),Te=Ye(),Se=Ye(),Oe=Ye(),Re=Ye();Y(Ce,Bt,jt),Y(Te,Bt,Gt),$e(Se,Ce,Te),he(Se,Se),Y(Ce,Gt,jt),Y(Te,Gt,Vt),$e(Oe,Ce,Te),he(Oe,Oe),Y(Ce,Vt,jt),Y(Te,Vt,Bt),$e(Re,Ce,Te),he(Re,Re),Se[0],Se[1],Se[2],Oe[0],Oe[1],Oe[2],Re[0],Re[1],Re[2];function jl(e,t,r,i,s=!0,n=!0){let a=0;const o=t,l=e;let c=re(0,a,0),d=re(0,a+l,0),h=re(0,-1,0),u=re(0,1,0);const f=[d,c],_=[h,u],g=r+2,C=Math.sqrt(l*l+o*o);for(let y=0;y({levels:i.map(a=>{const o=Ki(s(a.tesselation));return n&&Ul(o),{components:[{attributes:o,objectAndLayerIdColor:void 0,transformation:null,materialId:t}],minScreenSpaceRadius:a.minScreenSpaceRadius}})});switch(e){case"cone":return r($l,i=>jl(1,.5,i),!0);case"sphere":case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Ul(e){const t=e,r=t.get(p.POSITION).data,i=t.get(p.NORMAL).data;if(i){const s=gi(e,p.NORMAL).data;for(let n=0;n{const n=await this._provisionSymbol(s.partitionInfo?.index,r);n&&await n.add(s,r)}))}async remove(t,r){const i=t.partitions;if(!i)throw new Error("partitioned featureset expected");await Promise.all(i.map(async s=>{const n=await this._provisionSymbol(s.partitionInfo?.index,r);n&&await n.remove(s,r)}))}async _provisionFeatureData(t,r){await t.provision([q.PARTITION_ID,q.OBJECT_ID],r)}async _provisionSymbol(t,r){if(t==null)return null;const i=this._symbols.get(t);return i?(i.loaded||await i.load(r),i):null}_partition(t){const{numFeatures:r,objectIds:i,partitionIds:s}=t,n=[[],[]];for(let a=0;aa.length>0).map((a,o)=>{const l=a.length,c={index:o,tileIndices:new Uint32Array(a)};return new Zi(t.tile,l,c)}),t.partitions}}function Yl(e,t,r){return!!gt(e,t,ct,r.spatialReference)&&(r.x=ct[0],r.y=ct[1],r.z=ct[2],!0)}const ct=A();function Ql(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}function Jl(e,t,r){return e.operations.setExtent(e.value,t,r.value),r}function Xl(e,t){return e.operations.getExtent(e.value,t),t}function Zl(e){return{operations:e,value:e.create()}}function es(e,t,r=Zl(e)){return r.operations=e,e.copy(t,r.value),r}function Kl(e){return es(ma,pa(0,0,0,Ci(e).radius))}const _i=2**50;function ec(){return es(Ra,Oa([0,0,0],[_i,0,0],[0,_i,0]))}function tc(e,t,r){return e.operations.axisAt(e.value,t,je.Z,r)}function rc(e,t,r,i){return e.operations.axisAt(e.value,t,r,i)}function ic(e,t,r){return e.operations.intersectRay(e.value,t,r)}function sc(e,t,r){return e.operations.intersectRayClosestSilhouette(e.value,t,r)}function nc(e,t){return e.operations.altitudeAt(e.value,t)}function ts(e,t,r,i){return e.operations.setAltitudeAt(e.value,t,r,i)}function ac(e,t,r,i){return t!==i&&ce(i,t),ie(Ae,i[12],i[13],i[14]),ts(e,Ae,r,Ae),i[12]=Ae[0],i[13]=Ae[1],i[14]=Ae[2],i}function Ht(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Ae=A();function vi(e){return e.type==="point"}class bt{constructor(t,r,i,s){this.viewingMode=t,this.spatialReference=r,this.unitInMeters=i,this._coordinateSystem=s,this._tmpCoordinateSystem=Ql(s),this.referenceEllipsoid=Ci(r),this.sphericalPCPF=Ha(r)}set extent(t){t&&Jl(this._coordinateSystem,t,this._coordinateSystem)}get extent(){return Xl(this._coordinateSystem,Ii())}getAltitude(t){return nc(this._coordinateSystem,t)}setAltitude(t,r,i=t){return ts(this._coordinateSystem,i,r,t)}setAltitudeOfTransformation(t,r){ac(this._coordinateSystem,r,t,r)}worldUpAtPosition(t,r){return tc(this._coordinateSystem,t,r)}worldBasisAtPosition(t,r,i){return rc(this._coordinateSystem,t,r,i)}basisMatrixAtPosition(t,r){const i=this.worldBasisAtPosition(t,je.X,de.get()),s=this.worldBasisAtPosition(t,je.Y,de.get()),n=this.worldBasisAtPosition(t,je.Z,de.get());return ia(r,i[0],i[1],i[2],0,s[0],s[1],s[2],0,n[0],n[1],n[2],0,0,0,0,1),r}headingAtPosition(t,r){const i=this.worldUpAtPosition(t,de.get()),s=this.worldBasisAtPosition(t,je.Y,de.get()),n=ya(r,s,i);return Ls(n)}intersectManifoldClosestSilhouette(t,r,i){return Ht(this._coordinateSystem,r,this._tmpCoordinateSystem),sc(this._tmpCoordinateSystem,t,i),i}intersectManifold(t,r,i){Ht(this._coordinateSystem,r,this._tmpCoordinateSystem);const s=de.get();return ic(this._tmpCoordinateSystem,t,s)?j(i,s):null}intersectInfiniteManifold(t,r,i){if(this.viewingMode===ne.Global)return this.intersectManifold(t,r,i);Ht(this._coordinateSystem,r,this._tmpCoordinateSystem);const s=this._tmpCoordinateSystem.value,n=de.get();return wa(s.plane,t,n)?j(i,n):null}toRenderCoords(t,r,i){return vi(t)?Ua(t,r,this.spatialReference):gt(t,r,i,this.spatialReference)}fromRenderCoords(t,r,i=null){return vi(r)?(i!=null&&(r.spatialReference=i),Yl(t,this.spatialReference,r)?r:null):gt(t,this.spatialReference,r,i)?r:null}static create(t,r){switch(t){case ne.Local:return new bt(ne.Local,r,Ns(r),ec());case ne.Global:return new bt(ne.Global,r,1,Kl(r))}}static renderUnitScaleFactor(t,r){return Ir(t)/Ir(r)}}class oc{constructor(t){this._tileFeatureData=new Map,this._context={viewSpatialReference:t.viewSpatialReference,renderSpatialReference:t.renderSpatialReference,renderCoordsHelper:bt.create(t.viewingMode,t.renderSpatialReference)}}async add(t,r){this._featureRenderer||(this._featureRenderer=new Wl(this._context),await this._featureRenderer.load());const i=this._addTileFeatureData(t);await this._featureRenderer.add(i,r)}async remove(t,r){const i=this._getFeatureSetFromTileId(t);i&&(this._featureRenderer&&this._featureRenderer.remove(i,r),this._removeTileFeatureData(t))}_getFeatureSetFromTileId(t){return this._tileFeatureData.get(t)}_addTileFeatureData(t){const r=t.descriptor.id,i=t.pages.reduce((n,{featureCount:a})=>n+a,0),s=new Zi(t,i);return this._tileFeatureData.set(r,s),s}_removeTileFeatureData(t){const r=this._tileFeatureData.get(t);r&&(r.dispose(),this._tileFeatureData.delete(t))}}let ut=class extends ar.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new Ya,this._tileManager=new fe({addTile:(e,t)=>this._addTile(e,t),removeTiles:e=>this._removeTiles(e)}),this._renderCommandContext=null,this._fetcher=null,this._symbolizer=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,baseQuery:i,url:s,objectIdField:n,capabilities:a,fieldsIndex:o,timeInfo:l}){this._renderCommandContext=new Fl({viewingMode:r,dispatchRenderCommandsCallback:(h,u)=>this.remoteClient.invoke("dispatchRenderCommands",h,{transferList:u})});const c=wr.fromJSON(e),d=wr.fromJSON(t);return this._fetcher=new ro(c,Cr.fromJSON(i),s,n,a),this._symbolizer=new oc({viewSpatialReference:c,renderSpatialReference:d,viewingMode:r}),this._queryEngine=new Gs({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:n,fieldsIndex:o,availableFields:[n],spatialReference:e,featureStore:this._featureStore,timeInfo:l}),this._defaultQueryJSON=new Cr({outSpatialReference:c}).toJSON(),this.addHandles(ns(()=>this.updating,async h=>{this.emit("notify-updating",{updating:h})}),as),yi}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),yi}async _addTile(e,t){const r=await this._fetcher.fetch(e,t);ve(t),this._featureStore.addTile(r);const i=this._renderCommandContext.createEncoder();return await this._symbolizer.add(r,i),await i.dispatch(),r}async _removeTiles(e){const t=this._renderCommandContext.createEncoder(),r=this._featureStore,i=this._symbolizer;for(const s of e)r.removeTile(s.tileId),await i.remove(s.tileId,t);await t.dispatch()}_ensureQuery(e){return e??this._defaultQueryJSON}};m([v()],ut.prototype,"updating",null),ut=m([K("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],ut);const lc=ut,yi={result:void 0},Zh=Object.freeze(Object.defineProperty({__proto__:null,default:lc},Symbol.toStringTag,{value:"Module"})),Kh=Object.freeze(Object.defineProperty({__proto__:null,build:sn},Symbol.toStringTag,{value:"Module"})),ed=Object.freeze(Object.defineProperty({__proto__:null,build:nn,getRadius:an},Symbol.toStringTag,{value:"Module"})),td=Object.freeze(Object.defineProperty({__proto__:null,build:on},Symbol.toStringTag,{value:"Module"})),rd=Object.freeze(Object.defineProperty({__proto__:null,build:ln},Symbol.toStringTag,{value:"Module"})),cc=Object.freeze(Object.defineProperty({__proto__:null,build:Wi,calculateAnchorPosForRendering:We,shaderSettings:gr},Symbol.toStringTag,{value:"Module"}));export{td as D,Zh as F,rd as R,Kh as S,ed as a}; diff --git a/main/assets/HUDMaterial.glsl-BLhEaLk5-LuDZJbYW.js b/main/assets/HUDMaterial.glsl-BLhEaLk5-LuDZJbYW.js deleted file mode 100644 index 3972d7c01..000000000 --- a/main/assets/HUDMaterial.glsl-BLhEaLk5-LuDZJbYW.js +++ /dev/null @@ -1,347 +0,0 @@ -import{v as m,S as v,i as K,dD as nr,I as ar,J as wr,ah as ns,aL as as,$ as ve,j as ye,ay as os,gI as ls,hT as cs,dk as br,eJ as hs,ig as ds,hb as us,dU as A,ih as fs,bl as Xe,a1 as ps,ii as ms,ij as wi,aq as bi,x as xi,aT as gs,aA as _s,o as Ut,K as vs,dY as ys,a2 as ws,U as bs,gU as xs,ik as Is,il as $t,im as Cs,io as Ts,ip as Ss,iq as Os,ir as Rs,is as As,it as xr,iu as Es,iv as Ms,iw as or,ae as Ds,bh as Ii,bj as Ps,hZ as Fs,fj as qt,h$ as Ci,i9 as je,B as Ls,p as Ns,he as Ir,ix as zs,i1 as Bs}from"./main-BZaw9FpY.js";import{Z as Gs}from"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import{b as Cr}from"./Query-BrwMGK8U-sojFdYaD.js";import{h as Vs}from"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import{N as js,R as Ti}from"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import{n as Hs}from"./timeSupport-jPViR5jn-DVbPitWZ.js";import{c as kt}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{p as Us}from"./query-DFW9-NG_-1nHUNdNu.js";import{o as $s}from"./pbf-D-y3_eZO-BOjQwfR-.js";import{g as qs}from"./quantizationUtils-bJy1cRwp-72T4gbed.js";import{o as ks}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{k as Ws,m as Ys}from"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import{l as ne}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{A as Qs,w as Js}from"./Indices-DEr2HrWx-Cw8IJeSy.js";import{e as ae,o as le,T as Xs,c as Zs,i as Tr,m as Ks}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{d as Si,D as en,m as ft,P as tn}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as X,o as lr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{h as rn,b as F,Q as sn,i as nn,V as an,_ as on,F as ln,J as W,N as Wt,v as cn,x as hn,a as dn,z as Oi,e as un,j as fn,A as pn,t as Me,L as Sr,r as ge,c as Ri,m as mn,G as Ai,d as Yt,u as gn,k as Ue,f as _n,Z as vn,n as yn,g as Ei,X as wn,l as bn,o as Qt,s as pt,p as xn,P as In,q as Cn,U as Tn,w as Sn,y as On,S as Rn,B as An,C as En,$ as Mn,W as Or,D as Dn,T as Pn,E as Fn,H as Ln,I as Nn,K as zn,M as Bn,O as Gn,R as Vn,Y as jn,a0 as Rr,a1 as Ar,a2 as Hn,a3 as Un,a4 as $n,a5 as qn,a6 as kn,a7 as Wn,a8 as Yn,a9 as Qn,aa as Er}from"./AttributeArray-BWXEft_i-D9qItgJD.js";import{p as xt}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{o as E,s as Ct}from"./NormalAttribute.glsl-axtNsUxo-corrAl_5.js";import{e as Mr,t as Jn}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{s as Xn}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{k as ce,z as Pe,G as cr,B as Jt,a as Zn,M as Kn,n as ea,Z as ta,N as ra,E as ia}from"./mat4-DX7gBViE-CQMXDC3Z.js";import{t as L,u as sa}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{h as N}from"./Util-BjGjeg6f-08Szkf4F.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{r as Y,S as $e,l as he,_ as ie,g as Mi,A as j,R as Ze,k as Dr,y as qe,G as Pr,C as na,L as Z,b as me,W as aa,Y as _e,j as ht,Z as oa}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{R as hr}from"./InterleavedLayout-DXzw3B2n-BD8s1eQP.js";import{o as Fr,O as Lr,E as Tt,p as Ke,b as Nr,D as He}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{N as la,S as ca,B as ha,y as Xt}from"./Octree-CJNwbhg4-DwYbmQHL.js";import{d as Di,D as da,b as ua,F as fa,H as pa,V as ma,_ as zr}from"./sphere-BenPORjV-CgNvGf8s.js";import{l as ga,I as _a,u as va,f as de,r as ya,M as wa}from"./plane-Dt8R0KeE-fuXvBrPY.js";import{I as Fe,A as Br}from"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import{P as dr,k as ba,V as xa}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as ur}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{b as Gr,m as Ia,o as mt,p as Ca,A as Ta,X as Pi,L as ke,O as Vr,l as jr}from"./BufferView-PQoE3GL7-DXIpDOUe.js";import{r as Fi}from"./BufferObject-BM_7mcDb-QLZylgsX.js";import{G as Hr,n as Li,T as Ur,L as Sa}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{q as Oa,R as Ra}from"./boundedPlane-DlvE0eNx-BetNH2zh.js";import{c as Aa}from"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import{f as Ea}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{i as Ma,p as Da}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import{r as Pa,i as Fa}from"./Texture-BCt2hphT-D-X9O5uh.js";import{l as La}from"./floatRGBA-4pIJN00G-DwTr03sX.js";import{o as oe}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{N as Na,K as za,B as Ba,m as Ga}from"./renderState-Dap0WV9P-D4IHxyei.js";import{n as Va}from"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import{p as gt}from"./projectVectorToVector-sIYLNlex-CXXu_lyF.js";import{G as ja}from"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import{t as re,o as Ye}from"./vec3f32-BS0cezmI-B_madU1n.js";import{M as se}from"./orientedBoundingBox-oHezdpWm-CdJ2bdTT.js";import"./triangle-hqU-Tc1X-DRFR6OWE.js";import{x as Ha}from"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import{p as Ua}from"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import{e as w,c as z}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{a as $a}from"./BindType-9iOk18Ed-CRW1cdX4.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./requestImageUtils-Ut4YcoNU-DS9BT3TV.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-D_SdPttv.js";import"./signal-CETehA7D-vStzfbaY.js";import"./quat-BODLR7mS-Bk09s2KF.js";function qa(e){e.code.add(w`const float MAX_RGBA_FLOAT = -255.0 / 256.0 + -255.0 / 256.0 / 256.0 + -255.0 / 256.0 / 256.0 / 256.0 + -255.0 / 256.0 / 256.0 / 256.0 / 256.0; -const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); -vec4 float2rgba(const float value) { -float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); -vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); -const float toU8AsFloat = 1.0 / 255.0; -return fixedPointU8 * toU8AsFloat; -}`),e.code.add(w`const vec4 RGBA_2_FLOAT_FACTORS = vec4( -255.0 / (256.0), -255.0 / (256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0 * 256.0) -); -float rgba2float(vec4 rgba) { -return dot(rgba, RGBA_2_FLOAT_FACTORS); -}`),e.code.add(w`const vec4 uninterpolatedRGBAToFloatFactors = vec4( -1.0 / 256.0, -1.0 / 256.0 / 256.0, -1.0 / 256.0 / 256.0 / 256.0, -1.0 / 256.0 / 256.0 / 256.0 / 256.0 -); -float uninterpolatedRGBAToFloat(vec4 rgba) { -return (dot(round(rgba * 255.0), uninterpolatedRGBAToFloatFactors) - 0.5) * 2.0; -}`)}let ka=class extends wn{constructor(e,t){super(e,"vec4",$a.Draw,(r,i,s)=>r.setUniform4fv(e,t(i,s)))}},fe=class extends ye{constructor(e){super(e),this._removing=0,this._tiles=new Vs}destroy(){for(const e of this._tiles.values())e.remove();this._tiles.clear()}get updating(){if(this._removing>0)return!0;for(const e of this._tiles.values())if(!e.finished)return!0;return!1}async onTileTreeChange(e){const{added:t,removed:r}=e,i=this._tiles,s=[];for(const n of r){const a=i.get(n);a!=null&&(a.abort(),i.delete(n),s.push({tileId:n}))}for(const n of t)i.has(n.id)||i.set(n.id,os(a=>this._addTile(n,a)));await this._removeTiles(s)}async _addTile(e,t){const r=await this.addTile(e,t);return ve(t),r}async _removeTiles(e){this._removing++,await this.removeTiles(e),this._removing--}};m([v()],fe.prototype,"updating",null),m([v({constructOnly:!0})],fe.prototype,"addTile",void 0),m([v({constructOnly:!0})],fe.prototype,"removeTiles",void 0),m([v()],fe.prototype,"_removing",void 0),fe=m([K("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],fe);let Zt=class{constructor(e,t){this._index=e,this._view=t}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new Wa(this._index,this._view,e)}},Wa=class extends Zt{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return Hs(new kt,this._geometryOverride,e.hasZ,e.hasM)}},Ya=class{constructor(){this._storedTiles=new Map,this._pageBounds=new Map,this.events=new ar,this.featureAdapter=Kt.shared}addTile(e){this._storedTiles.set(e.descriptor.id,e);for(const t of e.pages)this._addPage(t)}removeTile(e){const t=this._storedTiles,r=t.get(e);if(r!=null){t.delete(e);for(const i of r.pages)this._removePage(i)}}_addPage(e){const{featureCount:t}=e;if(t===0)return;const r=new js(9,s=>e.getBounds(s)),i=new Array;for(let s=0;se(new Zt(i,t)))}forEachInBounds(e,t){ze.minX=e[0],ze.minY=e[1],ze.maxX=e[2],ze.maxY=e[3];for(const[r,i]of this._pageBounds)i.search(ze,s=>t(new Zt(s,r)))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,s=-1/0;for(const n of this._pageBounds.values()){const{minX:a,minY:o,maxX:l,maxY:c}=n.toJSON();t=Math.min(t,a),r=Math.min(r,o),i=Math.min(i,l),s=Math.min(s,c)}return{xmin:t,ymin:r,xmax:i,ymax:s,spatialReference:e}}},Kt=class{getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}};Kt.shared=new Kt;const ze=new Ti;let Qa=class{constructor(e,t){this.descriptor=e,this.pages=t}},Ja=class{constructor(e){const t=new $s(new Uint8Array(e),new DataView(e));this._reader=t,this._index=Xa(t)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,s=r.get(t)?.index;if(s==null)return;const n=i[e*r.fields.length+s],a=this._reader;return a.move(n),St(a)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return typeof r=="string"?new Date(r).getTime():typeof r=="number"||r==null?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,s=this._reader,n={};for(const a of t.fields){const o=r[i+a.index];s.move(o),n[a.name]=St(s)}return n}getCoordinates(e,t,r=0){const i=this._reader,{transform:s,featureIndices:n}=this._index,{scale:a,translate:o}=s;i.move(n[e]),this._readCoordinates(a,o,t,r)}getOptimizedGeometry(e){const t=A();return this.getCoordinates(e,t),new kt([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,we);const[i,s,n]=we,a=[i,s];return t&&(a[3]=n),r&&(a[t?4:3]=0),new kt([],a)}getBounds(e){this.getCoordinates(e,we);const[t,r]=we,i=new Ti;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,we);const[t,r,i]=we;return Ss(t,r,i,t,r,i)}readAllObjectIds(e,t=0){const r=this._reader,{_index:i,featureCount:s}=this,{objectIdFieldName:n,attributeIndices:a,fieldsIndex:o}=i,l=o.get(n).index,c=o.fields.length;for(let d=0;dt?.release()):e?.release()}let fr=class{constructor(e,t){this._material=e,this._repository=t,this._map=new Map}dispose(){this._map.forEach((e,t)=>{e!=null&&this._repository.release(this._material,t)})}load(e,t,r){if(!this._material.produces.get(t)?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,t,r));const i=this._map.get(r);if(i!=null){if(i.ensureResources(e)===Jn.LOADED)return i;this._repository.requestRender()}return null}},Bi=class extends bn{constructor(e=A()){super(),this.origin=e}get slicePlaneLocalOrigin(){return this.origin}};var kr,pe;(function(e){e[e.ADD=0]="ADD",e[e.UPDATE=1]="UPDATE",e[e.REMOVE=2]="REMOVE"})(kr||(kr={})),function(e){e[e.NONE=0]="NONE",e[e.VISIBILITY=1]="VISIBILITY",e[e.GEOMETRY=2]="GEOMETRY",e[e.TRANSFORMATION=4]="TRANSFORMATION",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.OCCLUDEE=16]="OCCLUDEE"}(pe||(pe={}));let pr=class{constructor(e=0,t=0){this.from=e,this.to=t}get numElements(){return this.to-this.from}};function Wr(e){const t=new Map;e.forAll(i=>t.set(i.from,i));let r=!0;for(;r;){r=!1;for(let i=0;ie||new pr,deallocator:null}),this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightGroups=new Set,this.drawCommandsDefault=et(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=et(),this.drawCommandsShadowHighlightRest=et()}get numElements(){return this._numElements}get instances(){return this._instances}get hasHighlights(){return this.highlightGroups.size>0}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightGroups.clear()}updateIfDrawCommandsDirty(e){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(e)}}addInstance(e,t){this.deleteInstance(e),this._instances.set(e,t),this._numElements+=t.numElements}deleteInstance(e){const t=this._instances.get(e);t&&(this._numElements-=t.numElements,this._instances.delete(e))}updateInstance(e,t,r){const i=this._instances.get(e);i&&(this._numElements-=i.numElements,i.from=t,i.to=r,this._numElements+=i.numElements)}updateDrawState(e){e.isVisible?(e.foreachHighlightGroup(t=>this.highlightGroups.add(t)),e.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(e){if(this.drawCommandsDefault.clear(),this.drawCommandsHighlights.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsShadowHighlightRest.clear(),this.drawCommandsDirty=!1,this._instances.size===0)return;if(!this.needsMultipleCommands()){const i=this.drawCommandsDefault.pushNew(),s=this.holes.front();return this.vao!=null&&this.holes.length===1&&s.to===Math.floor(this.vao.byteSize/e)?(i.first=0,void(i.count=s.from)):(i.first=1/0,i.count=0,this._instances.forEach(n=>{i.first=Math.min(i.first,n.from),i.count=Math.max(i.count,n.to)}),void(i.count-=i.first))}const t=Array.from(this._instances.values()).sort((i,s)=>i.from===s.from?i.to-s.to:i.from-s.from),{drawCommandsHighlights:r}=this;for(const i of t)i.isVisible&&(Ot(i.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,i),i.hasHighlights?i.foreachHighlightGroup(s=>{let n=r.get(s);n||(n=et(),r.set(s,n)),Ot(n,i)}):Ot(this.drawCommandsShadowHighlightRest,i))}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}};function co(e){return e.vao!=null}function et(){return new nr({allocator:e=>e||new oo,deallocator:e=>e})}function Ot(e,t){const r=e.back();if(r==null){const i=e.pushNew();return i.first=t.from,void(i.count=t.numElements)}if(ho(r,t)){const i=t.from-r.first+t.numElements;r.count=i}else{const i=e.pushNew();i.first=t.from,i.count=t.numElements}}function ho(e,t){return e.first+e.count>=t.from}let uo=class{constructor(e){this.origin=e,this.buffers=new Array}dispose(){this.buffers.forEach(e=>e.vao.dispose()),this.buffers.length=0}findBuffer(e){return this.buffers.find(t=>t.instances.has(e))}},Rt=class extends zi{get _hasAnyHighlight(){return this._highlightGroups.size>0}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new Bi,this._highlightGroups=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=cs(this._glMaterials),this._dataByOrigin.forEach(e=>e.dispose()),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this.material.produces.forEach((e,t)=>{this._produces.set(t,r=>!(this._dataByOrigin.size===0||!(r!==E.Highlight&&r!==E.ShadowHighlight||this._hasAnyHighlight))&&e(r))})}initializeRenderContext(e,t){this._glMaterials=new fr(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,xt(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((r,i)=>r+i.instances.size,0)),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((r,i)=>r+i.vao.usedMemory,0)),e}forEachGeometry(e){this._dataByOrigin.forEach(t=>t.buffers.forEach(r=>r.instances.forEach(({geometry:i})=>e(i))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(t==null)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const s=i.renderGeometry,n=this._dataByOrigin.get(s.localOrigin.id),a=n?.findBuffer(s.id);if(a==null)return;const o=a.instances.get(s.id);if(i.updateType&(pe.GEOMETRY|pe.TRANSFORMATION)){const l=it(t.elementCount(o.geometry.geometry.attributes)*r),c=t.vertexBufferLayout.createView(l.buffer);this._writeGeometry(s,c,0),a.vao.vertexBuffers.get("geometry").setSubData(l,o.from*r,0,o.numElements*r)}i.updateType&(pe.HIGHLIGHT|pe.OCCLUDEE|pe.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new Xn;for(const i of e){const s=i.localOrigin;if(s==null)continue;let n=r.get(s.id,null);n==null&&(n=new Qr(s.vec3),r.set(s.id,null,n)),n.changes.push(i)}for(const i of t){const s=i.localOrigin;if(s==null)continue;const n=this._dataByOrigin.get(s.id),a=n?.findBuffer(i.id);if(a==null)continue;let o=r.get(s.id,a);o==null&&(o=new Qr(s.vec3),r.set(s.id,a,o)),o.changes.push(i)}return r}_addAndRemoveGeometries(e,t){if(this._bufferWriter==null||this._vaoCache==null)return;const{_bufferWriter:r,_dataByOrigin:i}=this,s=r.vertexBufferLayout.stride/4,n=this._computeDeltas(e,t);n.forEach((a,o)=>{const l=a.get(null),c=l?.changes??[];n.delete(o,null);let d=i.get(o);if(a.forEach((h,u)=>{if(n.delete(o,u),u==null)return void N(!1,"No VAO for removed geometries");if(u.instances.size===h.changes.length)return this._vaoCache.deleteVao(u.vao),br(d.buffers,u),void(d.buffers.length===0&&c.length===0&&i.delete(o));const f=u.numElements,_=u.vao.byteSize/4,g=c.reduce((O,M)=>O+r.elementCount(M.geometry.attributes),0),C=h.changes.reduce((O,M)=>O+r.elementCount(M.geometry.attributes),0),I=Math.min((f+g-C)*s,rt),x=I>_;I>vt&&I<_/2?(h.changes.forEach(({id:O})=>u.deleteInstance(O)),u.instances.forEach(({geometry:O})=>c.push(O)),this._vaoCache.deleteVao(u.vao),br(d.buffers,u)):x?this._applyAndRebuild(u,c,h):this._applyRemoves(u,h)}),c.length>0)for(d==null&&(d=new uo(l.origin),i.set(o,d)),d.buffers.forEach(h=>this._applyAdds(h,c));c.length>0;)d.buffers.push(this._applyAndRebuild(new lo,c,null))})}_updateDrawCommands(){this._highlightGroups.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach(e=>{e.buffers.forEach(t=>{t.updateIfDrawCommandsDirty(this._bufferWriter.vertexBufferLayout.stride),t.hasHighlights&&hs(this._highlightGroups,t.highlightGroups),this._hasOccludees=this._hasOccludees||t.hasOccludees})})}_applyAndRebuild(e,t,r){if(r)for(const f of r.changes)e.deleteInstance(f.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,n=s/4,a=Math.floor(rt/n);let o=e.numElements;for(;t.length>0;){const f=t.pop(),_=i.elementCount(f.geometry.attributes);if(o+_>a&&o>0){t.push(f);break}o+=_;const g=new Yr(f,0,0);N(e.instances.get(f.id)==null),e.addInstance(f.id,g)}const l=o*n,c=it(l),d=i.vertexBufferLayout.createView(c.buffer);let h=0;e.resetInstanceSummary(),e.instances.forEach((f,_)=>{this._writeGeometry(f.geometry,d,h);const g=h;h+=i.elementCount(f.geometry.geometry.attributes),e.updateInstance(_,g,h),e.updateDrawState(f)}),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(er(l)),e.vao.vertexBuffers.get("geometry").setSubData(c,0,0,h*n),e.holes.clear();const u=e.holes.pushNew();return u.from=h,u.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,t){if(t.changes.length===0||this._bufferWriter==null)return;for(const a of t.changes){const o=a.id,l=e.instances.get(o);if(!l)continue;e.deleteInstance(o);const c=ee.back();if(c){if(c.to===l.from){c.to=l.to;continue}if(c.from===l.to){c.from=l.from;continue}}const d=ee.pushNew();d.from=l.from,d.to=l.to}Wr(ee);const r=this._bufferWriter.vertexBufferLayout.stride/4,i=ee.reduce((a,o)=>Math.max(a,o.numElements),0)*r,s=it(i);s.fill(0,0,i);const n=e.vao.vertexBuffers.get("geometry");ee.forAll(a=>n.setSubData(s,a.from*r,0,a.numElements*r)),e.holes.pushArray(ee.data,ee.length),ee.forAll((a,o)=>ee.data[o]=null),ee.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(t.length===0||this._bufferWriter==null)return;if(!co(e))return void this._applyAndRebuild(e,t,null);const r=this._bufferWriter,i=r.vertexBufferLayout.stride/4,s=e.numElements,n=t.reduce((C,I)=>C+r.elementCount(I.geometry.attributes),0),a=Math.min((s+n)*i,rt),o=4*a;if(e.vao.byteSizee.vao.byteSize)return void this._applyAndRebuild(e,t,null);Wr(e.holes);const l=new Array;for(const C of t){const I=r.elementCount(C.geometry.attributes),x=fo(e.holes,I);l.push(x)}const c=e.vao.vertexBuffers.get("geometry");let d=0,h=0,u=0;const f=it(a),_=r.vertexBufferLayout.createView(f.buffer);t.forEach((C,I)=>{const x=l[I];if(x==null)return;if(u!==x){const y=u-h;y>0&&c.setSubData(f,h*i,0,y*i),h=x,d=0}const O=r.elementCount(C.geometry.attributes);this._writeGeometry(C,_,d),d+=O,u=x+O;const M=new Yr(C,x,x+O);N(e.instances.get(C.id)==null),e.addInstance(C.id,M),e.drawCommandsDirty=!0});const g=u-h;g>0&&c.setSubData(f,h*i,0,g*i),ds(t,(C,I)=>l[I]==null)}_writeGeometry(e,t,r){this._bufferWriter!=null&&(ce(be,e.transformation),be[12]-=e.localOrigin.vec3[0],be[13]-=e.localOrigin.vec3[1],be[14]-=e.localOrigin.vec3[2],Pe(tt,be),cr(tt,tt),this._bufferWriter.write(be,tt,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e;if(!this.material.produces.get(r.slot)?.(t))return null;const{highlightGroupName:i,slot:s}=r,n=t===E.ShadowHighlight,a=t===E.Highlight,o=a||n,l=h=>o&&(this._highlightGroups.size===0||a&&!!i&&!h.has(i));if(l(this._highlightGroups))return null;const c=t===E.ShadowExcludeHighlight,d=!(o||c);for(const{buffers:h}of this._dataByOrigin.values())for(const u of h){if(l(u.highlightGroups))continue;const f=n?u.drawCommandsHighlights.size>0:o?i?u.drawCommandsHighlights.get(i):u.drawCommandsHighlights.size>0:((c&&u.needsMultipleCommands()?u.drawCommandsShadowHighlightRest:u.drawCommandsDefault)||null)?.length??!1,_=d&&u.drawCommandsOccludees||null;if(f||_?.length){const g=this._glMaterials.load(e.rctx,s,t),C=g?.beginSlot(r);if(C)return C}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlightGroupName:n}=i,a=r===E.Highlight;if(a&&!n)return;const o=r===E.ShadowHighlight,l=a||o,c=r===E.ShadowExcludeHighlight,d=!(l||c),h=s===W.OCCLUDER_MATERIAL||s===W.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:u}=e;u.runAppleAmdDriverHelper();const f=u.bindTechnique(t,i,this.material.parameters);for(const _ of this._dataByOrigin.values())for(const g of _.buffers){if(a&&(!g.hasHighlights||!g.drawCommandsHighlights.has(n))||o&&!g.hasHighlights)continue;const C=()=>{const y=[];for(const P of g.drawCommandsHighlights.values())y.push(P);return y},I=l&&!o?g.drawCommandsHighlights.get(n)??null:null,x=o?C():l?I?[I]:Xr:(c&&g.needsMultipleCommands()?[g.drawCommandsShadowHighlightRest]:[g.drawCommandsDefault])||Xr,O=x.some(y=>y.length>0),M=d&&g.drawCommandsOccludees||null;if(O||M?.length){if(this._drawParameters.origin=_.origin,f.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(g.vao),u.bindVAO(g.vao),O)for(const y of x)u.setPipelineState(t.getPipeline(!1,h)),y.forAll(P=>u.drawArrays(t.primitiveType,P.first,P.count));M?.length&&(u.setPipelineState(t.getPipeline(!0,h)),M.forAll(y=>u.drawArrays(t.primitiveType,y.first,y.count)))}}}get test(){}};m([v({constructOnly:!0})],Rt.prototype,"material",void 0),Rt=m([K("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],Rt);let Qr=class{constructor(e){this.origin=e,this.changes=new Array}};function fo(e,t){const r=e.find(s=>s.numElements>=t);if(r==null)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const be=L(),tt=L(),ee=new nr({allocator:e=>e||new pr,deallocator:null}),vt=65536,At=4*vt,Jr=1024,Gi=16777216,rt=Gi/4;let Et=new Float32Array(vt);function it(e){return Et.length{this._produces.set(t,r=>!!(r!==E.Highlight&&r!==E.ShadowHighlight||this._hasHighlights)&&e(r))})}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.removeRenderGeometry(t)}acquireTechniques(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e;return!t.produces.get(i.slot)?.(r)||(r===E.Highlight||r===E.ShadowHighlight)&&!this._hasHighlights?null:this._glMaterials.load(e.rctx,i.slot,r)?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(r.size===0)return;const{bind:i}=e,s=i.slot===W.OCCLUDER_MATERIAL||i.slot===W.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const a=t.program;for(const[o,l]of r)this._drawParameters.origin=l.localOrigin,a.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(l.vao),n.bindVAO(l.vao),n.setPipelineState(t.getPipeline(!1,s)),n.drawArrays(t.primitiveType,0,l.numElements)}initializeRenderContext(e,t){this._glMaterials=new fr(this.material,e.materials);const r=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,xt(this._bufferWriter.vertexBufferLayout));this._vaoCache=r}uninitializeRenderContext(){}addRenderGeometry(e,t,r){this.removeRenderGeometry(e);const i=this._bufferWriter.vertexBufferLayout.stride,s=this._vaoCache.newVao(er(t.data.byteLength));s.vertexBuffers.get("geometry").setSubData(new Uint8Array(t.data),0,0,t.elementCount*i);const n={localOrigin:r,vao:s,numElements:t.elementCount};return this._renderGeometries.set(e,n),n}removeRenderGeometry(e){const t=this._renderGeometries.get(e);t!=null&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}};m([v({constructOnly:!0})],dt.prototype,"material",void 0),dt=m([K("esri.views.3d.layers.graphics.pipeline.rendering.DirectRenderer")],dt);function po(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}function mo(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}function go(e,t,r){return 2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r))}function _o(e,t,r){return 2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r))}var Zr,S;(function(e){e[e.Default=0]="Default",e[e.Screenshot=1]="Screenshot",e[e.ObjectAndLayerID=2]="ObjectAndLayerID"})(Zr||(Zr={})),function(e){e[e.TOP=0]="TOP",e[e.RIGHT=1]="RIGHT",e[e.BOTTOM=2]="BOTTOM",e[e.LEFT=3]="LEFT"}(S||(S={}));var tr;let b=tr=class extends ye{constructor(e){super(e),this._ray=Di(),this._viewport=ae(0,0,1,1),this._padding=ae(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=X(1,1e3),this._viewDirty=!0,this._viewMatrix=L(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=L(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=L(),this._frustumDirty=!0,this._frustum=la(),this._fullViewport=le(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=A(),this._up=A(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return Y(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){ce(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),ie(A(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),ie(A(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),ie(A(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(this.pixelRatio===1)return this._viewport;const e=Fr(le(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&Lr(e,t)?t:e}get screenPadding(){if(this.pixelRatio===1)return this._padding;const e=Fr(le(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&Lr(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[S.LEFT],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[S.BOTTOM],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[S.RIGHT]+this._padding[S.LEFT]}set fullWidth(e){this.width=e-(this._padding[S.RIGHT]+this._padding[S.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[S.TOP]+this._padding[S.BOTTOM]}set fullHeight(e){this.height=e-(this._padding[S.TOP]+this._padding[S.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[S.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[S.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){Tt(this._padding,e)||(this._viewport[0]+=e[S.LEFT]-this._padding[S.LEFT],this._viewport[1]+=e[S.BOTTOM]-this._padding[S.BOTTOM],this._viewport[2]-=e[S.RIGHT]+e[S.LEFT]-(this._padding[S.RIGHT]+this._padding[S.LEFT]),this._viewport[3]-=e[S.TOP]+e[S.BOTTOM]-(this._padding[S.TOP]+this._padding[S.BOTTOM]),Ke(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(Jt(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return Pe(L(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||L()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return go(this._fov,this.width,this.height)}set fovX(e){this._fov=po(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return _o(this._fov,this.width,this.height)}set fovY(e){this._fov=mo(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return Mi(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(Pe(this._viewInverseTransposeMatrix,this.viewMatrix),cr(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const t=2*e-1;return 2*this.near*this.far/(this.far+this.near-t*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return this.relativeElevation!=null&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,s=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,o=a+n,l=-r/2+this.row*s,c=l+s,d=Zn(L(),a*(1+2*this._padding[S.LEFT]/e),o*(1+2*this._padding[S.RIGHT]/e),l*(1+2*this._padding[S.BOTTOM]/t),c*(1+2*this._padding[S.TOP]/t),this.near,this.far),h=this._get("projectionMatrix");return h&&Kn(h,d)?h:d}copyFrom(e){j(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,Ke(this._viewport,e.viewport),this.notifyChange("_viewport"),Ke(this._padding,e.padding),this.notifyChange("_padding"),Si(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||(ce(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||(ca(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(ce(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),Ke(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return new tr().copyFrom(this)}equals(e){return Ze(this.eye,e.eye)&&Ze(this.center,e.center)&&Ze(this.up,e.up)&&Tt(this._viewport,e.viewport)&&Tt(this._padding,e.padding)&&en(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||Nr(e.screenPadding,this.screenPadding)>=t||Nr(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;Dr(B,e.eye,e.center),Dr(Mt,this.eye,this.center);const r=qe(B,Mt),i=Pr(B),s=Pr(Mt),n=5e-4;return r*r>=(1-1e-10)*i*s&&na(e.eye,this.eye)2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Dt),t)}unprojectFromRenderScreen(e,t){if(Jt(st,this.projectionMatrix,this.viewMatrix),!Pe(st,st))return null;const r=this.fullViewport;return T[0]=2*(e[0]-r[0])/r[2]-1,T[1]=2*(e[1]-r[1])/r[3]-1,T[2]=2*e[2]-1,T[3]=1,He(T,T,st),T[3]===0?null:(t[0]=T[0]/T[3],t[1]=T[1]/T[3],t[2]=T[2]/T[3],t)}constrainWindowSize(e,t,r,i){const s=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(s-r/2,0),o=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(s-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-s-r/2,0),h=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(o),Math.round(d),Math.round(h)]}computeUp(e){e===ne.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){Y(B,this.center,this.eye);const e=me(this.center);e<1?(ie(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(qe(B,this.center))>.9999*me(B)*e||($e(this._up,B,this.center),$e(this._up,this._up,B),he(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){aa(B,this.eye,this.center),Math.abs(B[2])<=.9999&&(Z(B,B,B[2]),ie(this._up,-B[0],-B[1],1-B[2]),he(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(e,t,r=""){typeof e[0]=="number"&&isFinite(e[0])&&typeof e[1]=="number"&&isFinite(e[1])&&typeof e[2]=="number"&&isFinite(e[2])?Ze(e,t)||(j(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):ps.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(ha(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(ea(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};m([v()],b.prototype,"_viewport",void 0),m([v()],b.prototype,"_padding",void 0),m([v()],b.prototype,"_fov",void 0),m([v()],b.prototype,"_nearFar",void 0),m([v()],b.prototype,"_viewDirty",void 0),m([v()],b.prototype,"_viewMatrix",void 0),m([v()],b.prototype,"_pixelRatio",void 0),m([v()],b.prototype,"pixelRatio",null),m([v()],b.prototype,"row",void 0),m([v()],b.prototype,"column",void 0),m([v()],b.prototype,"_rows",void 0),m([v()],b.prototype,"rows",null),m([v()],b.prototype,"_columns",void 0),m([v()],b.prototype,"columns",null),m([v()],b.prototype,"eye",null),m([v()],b.prototype,"center",null),m([v()],b.prototype,"_center",void 0),m([v()],b.prototype,"up",null),m([v()],b.prototype,"_up",void 0),m([v()],b.prototype,"viewMatrix",null),m([v({readOnly:!0})],b.prototype,"viewForward",null),m([v({readOnly:!0})],b.prototype,"viewUp",null),m([v({readOnly:!0})],b.prototype,"viewRight",null),m([v({readOnly:!0})],b.prototype,"nearFar",null),m([v()],b.prototype,"near",null),m([v()],b.prototype,"far",null),m([v()],b.prototype,"viewport",null),m([v({readOnly:!0})],b.prototype,"screenViewport",null),m([v({readOnly:!0})],b.prototype,"screenPadding",null),m([v()],b.prototype,"x",null),m([v()],b.prototype,"y",null),m([v()],b.prototype,"width",null),m([v()],b.prototype,"height",null),m([v()],b.prototype,"fullWidth",null),m([v()],b.prototype,"fullHeight",null),m([v({readOnly:!0})],b.prototype,"_aspect",null),m([v()],b.prototype,"padding",null),m([v({readOnly:!0})],b.prototype,"projectionMatrix",null),m([v({readOnly:!0})],b.prototype,"inverseProjectionMatrix",null),m([v()],b.prototype,"fov",null),m([v()],b.prototype,"fovX",null),m([v()],b.prototype,"fovY",null),m([v()],b.prototype,"viewInverseTransposeMatrix",null),m([v({readOnly:!0})],b.prototype,"_projectionMatrixInternal",null),m([v()],b.prototype,"relativeElevation",void 0),b=tr=m([K("esri.views.3d.webgl.RenderCamera")],b);const vo=b,T=le(),st=L(),B=A(),Mt=A(),Dt=ms();let yo=class{constructor(e,t,r){this._elementSize=t,this._buffer=Fi.createVertex(e,Li.STATIC_DRAW),this.resize(r)}destroy(){this._buffer.dispose()}get elementSize(){return this._elementSize}get capacity(){return this._capacity}get array(){return this._array}get buffer(){return this._buffer}get usedMemory(){return this._array.byteLength+this._buffer.usedMemory}copyRange(e,t,r,i=0){const s=new Uint8Array(this.array,e*this.elementSize,(t-e)*this.elementSize);new Uint8Array(r.array,i*this.elementSize).set(s)}transferAll(){this._buffer.setData(this._array)}transferRange(e,t){const r=e*this._elementSize,i=t*this._elementSize;this._buffer.setSubData(new Uint8Array(this._array),r,r,i)}resize(e){const t=e*this._elementSize,r=new ArrayBuffer(t);this._array&&(e>=this._capacity?new Uint8Array(r).set(new Uint8Array(this._array)):new Uint8Array(r).set(new Uint8Array(this._array).subarray(0,e*this._elementSize))),this._array=r,this._buffer.setSize(t),this._capacity=e}},wo=class{constructor(e){this.modelOriginHi=e.getField(p.INSTANCEMODELORIGINHI,jr),this.modelOriginLo=e.getField(p.INSTANCEMODELORIGINLO,jr),this.model=e.getField(p.INSTANCEMODEL,mt),this.modelNormal=e.getField(p.INSTANCEMODELNORMAL,mt),this.featureAttribute=e.getField(p.INSTANCEFEATUREATTRIBUTE,Pi),this.color=e.getField(p.INSTANCECOLOR,ke),this.objectAndLayerIdColor=e.getField(p.INSTANCEOBJECTANDLAYERIDCOLOR,ke)}},bo=class{constructor(e,t){this._rctx=e,this._instanceBufferLayout=t,this._headIndex=0,this._tailIndex=0,this._firstIndex=null,this._captureFirstIndex=!0,this._updating=!1,this._prevHeadIndex=0,this._resized=!1,this._capacity=1}destroy(){this._buffer&&this._buffer.destroy()}get buffer(){return this._buffer.buffer}get view(){return this._view}get capacity(){return this._capacity}get size(){const e=this._headIndex,t=this._tailIndex;return e>=t?e-t:e+this._capacity-t}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get usedMemory(){return this._buffer?.usedMemory??0}reset(){this._headIndex=0,this._tailIndex=0,this._firstIndex=null}startUpdateCycle(){this._captureFirstIndex=!0}beginUpdate(){N(!this._updating,"already updating"),this._updating=!0,this._prevHeadIndex=this._headIndex}endUpdate(){N(this._updating,"not updating"),this.size0,"invalid size");const e=this._tailIndex===this._firstIndex;this._incrementTail(),e&&(this._firstIndex=this._tailIndex)}_grow(){const e=Math.max(yt,Math.floor(this._capacity*wi));this._resize(e)}_shrink(){const e=Math.max(yt,Math.floor(this._capacity*Rs));this._resize(e)}_resize(e){if(N(this._updating,"not updating"),e===this._capacity)return;const t=new yo(this._rctx,this._instanceBufferLayout.stride,e);if(this._buffer){this._firstIndex&&(this._firstIndex=(this._firstIndex+this._capacity-this._tailIndex)%this._capacity);const r=this.size,i=this._compactInstances(t);N(i===r,"invalid compaction"),this._buffer.destroy(),this._tailIndex=0,this._headIndex=i,this._prevHeadIndex=0}this._resized=!0,this._capacity=e,this._buffer=t,this._view=new wo(this._instanceBufferLayout.createView(this._buffer.array))}_compactInstances(e){const t=this._headIndex,r=this._tailIndex;return rt?(this._buffer.copyRange(r,this._capacity,e),t>0&&this._buffer.copyRange(0,t,e,this._capacity-r),t+(this._capacity-r)):0}_incrementHead(e=1){this._headIndex=(this._headIndex+e)%this._capacity}_incrementTail(e=1){this._tailIndex=(this._tailIndex+e)%this._capacity}_transferRange(e,t){et&&(t>0&&this._buffer.transferRange(0,t),this._buffer.transferRange(e,this._capacity))}};const yt=64;var R;function xo(e){let t=hr().mat4f64(p.LOCALTRANSFORM).mat4f64(p.GLOBALTRANSFORM).vec4f64(p.BOUNDINGSPHERE).vec3f64(p.MODELORIGIN).mat3f(p.INSTANCEMODEL).mat3f(p.INSTANCEMODELNORMAL).vec2f(p.MODELSCALEFACTORS);return e.includes(p.FEATUREATTRIBUTE)&&(t=t.vec4f(p.FEATUREATTRIBUTE)),e.includes(p.COLOR)&&(t=t.vec4u8(p.COLOR)),e.includes(p.OBJECTANDLAYERIDCOLOR)&&(t=t.vec4u8(p.OBJECTANDLAYERIDCOLOR)),t=t.u8(p.STATE).u8(p.LODLEVEL),t}(function(e){e[e.ALLOCATED=1]="ALLOCATED",e[e.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",e[e.VISIBLE=4]="VISIBLE",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",e[e.REMOVE=32]="REMOVE",e[e.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",e[e.ACTIVE=18]="ACTIVE"})(R||(R={}));let Kr=class{constructor(e){this.localTransform=e.getField(p.LOCALTRANSFORM,Gr),this.globalTransform=e.getField(p.GLOBALTRANSFORM,Gr),this.modelOrigin=e.getField(p.MODELORIGIN,Ia),this.model=e.getField(p.INSTANCEMODEL,mt),this.modelNormal=e.getField(p.INSTANCEMODELNORMAL,mt),this.modelScaleFactors=e.getField(p.MODELSCALEFACTORS,Ca),this.boundingSphere=e.getField(p.BOUNDINGSPHERE,Ta),this.featureAttribute=e.getField(p.FEATUREATTRIBUTE,Pi),this.color=e.getField(p.COLOR,ke),this.objectAndLayerIdColor=e.getField(p.OBJECTANDLAYERIDCOLOR,ke),this.state=e.getField(p.STATE,Vr),this.lodLevel=e.getField(p.LODLEVEL,Vr)}},Ee=class extends ye{constructor(e,t){super(e),this.events=new ar,this._capacity=0,this._size=0,this._next=0,this._highlightGroupMap=new Map,this._highlightGroupMapPrev=new Map,this._layout=xo(t),this._capacity=yt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Kr(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,R.ALLOCATED),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;N(e>=0&&e=0&&eda(this._instanceData.view.boundingSphere.getVec(r,this._tmpSphere)),{maximumDepth:25}),this._instanceData=e,this._boundingSphere=t,this._tmpSphere=ua(),this._tmpMat4=L()}addInstance(e){const t=this._instanceData.view.boundingSphere,r=this._instanceData.getCombinedModelTransform(e,this._tmpMat4);_e(fa(this._tmpSphere),this._boundingSphere.center,r),this._tmpSphere[3]=this._boundingSphere.radius*va(r),t.setVec(e,this._tmpSphere),this.add([e])}removeInstance(e){this.remove([e])}},To=class{constructor(e,t){this._worldSpaceRadius=e,this._minScreenSpaceRadii=t}selectLevel(e,t,r){const i=r.computeScreenPixelSizeAt(e),s=this._worldSpaceRadius*t/i;let n=0;for(let a=1;a=this._minScreenSpaceRadii[a]&&(n=a);return n}},So=class{constructor(e){this.layerUid=e}},Oo=class extends So{constructor(e,t){super(e),this.graphicUid=t}};function Ro(e){return e?.dist!=null}let Ao=class{get ray(){return this._ray}get distanceInRenderSpace(){return this.dist!=null?(Z(nt,this.ray.direction,this.dist),me(nt)):null}getIntersectionPoint(e){return!!Ro(this)&&(Z(nt,this.ray.direction,this.dist),ht(e,this.ray.origin,nt),!0)}getTransformedNormal(e){return j(Be,this.normal),Be[3]=0,He(Be,Be,this.transformation),j(e,Be),he(e,e)}constructor(e){this.intersector=Fe.OBJECT,this.normal=A(),this.transformation=L(),this._ray=Di(),this.init(e)}init(e){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=Fe.OBJECT,zr(e,this._ray)}set(e,t,r,i,s,n,a){this.intersector=e,this.dist=r,j(this.normal,i??Bs),ce(this.transformation,s??sa),this.target=t,this.drapedLayerOrder=n,this.drapedLayerGraphicOrder=a}copy(e){zr(e.ray,this._ray),this.intersector=e.intersector,this.dist=e.dist,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.drapedLayerGraphicOrder=e.drapedLayerGraphicOrder,j(this.normal,e.normal),ce(this.transformation,e.transformation)}};function Eo(e){return new Ao(e)}const nt=A(),Be=le();let Mo=class extends Aa{},Do=class extends Oo{constructor(e,t,r,i,s,n){super(e,t),this.layerUid=e,this.graphicUid=t,this.geometryId=r,this.triangleNr=i,this.baseBoundingSphere=s,this.numLodLevels=n}};function Po(e,t,r,i=null){const s=e.createBufferWriter(),n=s.vertexBufferLayout,a=s.elementCount(t),o=n.createBuffer(a);return s.write(null,null,t,i,o,0),{material:e,vertexBufferLayout:n,buffer:o.buffer,elementCount:a,boundingInfo:r}}let Fo=class{constructor(e,t){const r=e.renderContext.rctx,i=t.geometry;let s=null;s=i instanceof pt?Po(i.material,i.attributes,i.boundingInfo):i;const n=s.material;this._materials=e.materials,n.setParameters({instancedDoublePrecision:!0}),this.geometry=i,this.material=n,this.glMaterials=new fr(n,this._materials),this.vertexBufferLayout=s.vertexBufferLayout,this.vbo=Fi.createVertex(r,Li.STATIC_DRAW,s.buffer),this.vao=new Mo(r,Qt,new Map([["geometry",xt(s.vertexBufferLayout)]]),new Map([["geometry",this.vbo]])),this.vertexCount=s.elementCount}destroy(){this.glMaterials.dispose(),this.vbo.dispose(),this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}intersect(e,t,r,i,s,n,a,o){if(!(this.geometry instanceof pt))return;const l=this.geometry.id;this.material.intersect(this.geometry,e.transform.transform,e,r,i,(c,d,h,u,f)=>{if(c>=0){if(t!=null&&!t(e.rayBegin,e.rayEnd,c))return;const _=new Do(n.layerUid,n.graphicUid(s),l,h,a,o);if((e.results.min.drapedLayerOrder==null||f>=e.results.min.drapedLayerOrder)&&(e.results.min.dist==null||c=e.results.max.drapedLayerOrder)&&(e.results.max.dist==null||c>e.results.max.dist)&&e.results.max.set(Fe.LOD,_,c,d,e.transform.transform,f),e.options.store===Br.ALL){const g=Eo(e.results.min.ray);g.set(Fe.LOD,_,c,d,e.transform.transform,f),e.results.all.push(g)}}})}},Lo=class Vi{static async create(t,r,i){const s=await Promise.allSettled(r.components.map(a=>t.controller.schedule(()=>new Fo(t,a),i))),n=s.map(a=>a.status==="fulfilled"?a.value:null).filter(bi);if(xi(i)||n.length!==s.length){n.forEach(a=>a.destroy()),ve(i);for(const a of s)if(a.status==="rejected")throw a.reason}return new Vi(r.minScreenSpaceRadius,n)}constructor(t,r){this.minScreenSpaceRadius=t,this.components=r}destroy(){this.components.forEach(t=>t.destroy())}intersect(t,r,i,s,n,a,o){this.components.forEach(l=>l.intersect(t,r,i,s,n,a,this.boundingSphere,o))}get boundingBox(){if(this._boundingBox==null){const t=As();this.components.forEach(r=>{r.boundingInfo!=null&&(xr(t,r.boundingInfo.bbMin),xr(t,r.boundingInfo.bbMax))}),this._boundingBox=t}return this._boundingBox}get boundingSphere(){if(this._boundingSphere==null){const t=this.boundingBox,r=A();Es(t,r),this._boundingSphere={center:r,radius:.5*Ms(t)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((t,r)=>t+r.triangleCount,0)}};function No(e,t,r,i,s){at[0]=e.get(t,0),at[1]=e.get(t,1),at[2]=e.get(t,2),Ea(at,ue,3),r.set(s,0,ue[0]),i.set(s,0,ue[1]),r.set(s,1,ue[2]),i.set(s,1,ue[3]),r.set(s,2,ue[4]),i.set(s,2,ue[5])}const at=A(),ue=new Float32Array(6),zo=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map(i=>i.minScreenSpaceRadius);return new To(t,r)};let Q=class extends no{constructor(e,t){super(e),this.type=Fe.LOD,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDataMap=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new vo,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[W.OPAQUE_MATERIAL,r=>this._produces(r)],[W.TRANSPARENT_MATERIAL,r=>!!this._hasTransparentLevels()&&this._produces(r)]]),this._instanceData=new Ee({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(t.registerTask(Ma.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=Go(this.optionalFields),this._glInstanceBufferLayout=xt(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDataMap)e.push(t[1]);return e}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get hasEmissions(){return this.baseMaterial.hasEmissions}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((r,i)=>r+i.usedMemory,e),0)}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((r,i)=>{const s=this._allRenderInstanceData[0][i].size+this._allRenderInstanceData[1][i].size,n=r.triangleCount;t.push({renderedInstances:s,renderedTriangles:s*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((r,i)=>r+i.renderedInstances,0),renderedTriangles:t.reduce((r,i)=>r+i.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(e=[]){const{rctx:t}=this._context.renderContext;return this.symbol.levels.map(r=>{e.push(new bo(t,this._instanceBufferLayout))}),e}async initializeRenderContext(e,t){this._context=e,this._createRenderInstanceDataArray(this._defaultRenderInstanceData);const r=await Promise.allSettled(this.symbol.levels.map(s=>Lo.create(e,s,t))),i=r.map(s=>s.status==="fulfilled"?s.value:null).filter(bi);if(xi(t)||i.length!==r.length){i.forEach(s=>s.destroy()),ve(t);for(const s of r)if(s.status==="rejected")throw s.reason}this._levels=i,this._levelSelector=zo(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDataMap.forEach(e=>e.forEach(t=>t.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(t=>t.material.produces.get(W.TRANSPARENT_MATERIAL)?.(E.Color)))}hasHighlights(){return gs(this._highlightRenderInstanceDataMap,e=>e.some(t=>t.size>0))}_produces(e){return e!==E.Highlight&&e!==E.ShadowHighlight||this.hasHighlights()}prepareRender(e){if(!Wt.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(Da),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const r=new Array,i=this.levels;return t.forEach(s=>i.forEach(({components:n},a)=>n.forEach(o=>r.push(this._beginComponent(e,s[a],o))))),r}render(e,t){const r=this._getInstanceDatas(e);if(!r||t==null)return;let i=0;e.rctx.bindVAO();const s=this.levels;r.forEach(n=>s.forEach(({components:a},o)=>a.forEach(l=>this._renderComponent(e,t[i++],n[o],l,o))))}_getInstanceDatas(e){const{output:t,bind:r}=e,i=t===E.Highlight,s=!i&&t!==E.ShadowHighlight,n=t!==E.ShadowExcludeHighlight;if(s)return n?this._allRenderInstanceData:[this._defaultRenderInstanceData];if(n){if(i){const{highlightGroupName:o}=r;if(!o)return null;const l=this._highlightRenderInstanceDataMap.get(o);return l?[l]:null}const a=[];for(const o of this._highlightRenderInstanceDataMap)a.push(o[1]);return a}return null}intersect(e,t,r,i){if(!this.baseMaterial.visible||this._octree==null)return;const s=A();Y(s,i,r);const n=a=>{this._instanceData.getCombinedModelTransform(a,ii),e.transform.set(ii),_e(si,r,e.transform.inverse),_e(ni,i,e.transform.inverse);const o=this._instanceData.getState(a),l=this._instanceData.getLodLevel(a),c=this._levels.length;N(!!(o&R.ACTIVE),"invalid instance state"),N(l>=0&&le.forEach(t=>t.startUpdateCycle()))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:i}=this;this._allRenderInstanceData.forEach(d=>d.forEach(h=>h.beginUpdate()));const s=this._instanceData,n=s.view;let a=s.size;const o=s.capacity;let l=this._instanceIndex;const c=Math.ceil(o/500);for(let d=0;d{const g=this._highlightRenderInstanceDataMap.get(_);if(!g)throw new Ut("Internal error in lodRenderer");g[f].freeTail()}),h&R.REMOVE)s.freeInstance(l);else if(h&R.VISIBLE){let _=0;t&&(n.modelOrigin.getVec(l,ri),_=i.selectLevel(ri,s.getCombinedMedianScaleFactor(l),r)),u=h&~(R.ACTIVE|R.TRANSFORM_CHANGED),_>=0&&(h&R.HIGHLIGHT?(s.foreachHighlightGroup(l,g=>{let C=this._highlightRenderInstanceDataMap.get(g);if(C||(C=this._createRenderInstanceDataArray(),C.forEach(I=>I.beginUpdate()),this._highlightRenderInstanceDataMap.set(g,C)),_>=C.length)throw new Ut(`LodRenderer internal error - missing lodLevel ${_}`);ti(C[_],n,l)}),u|=R.HIGHLIGHT_ACTIVE):(ti(this._defaultRenderInstanceData[_],n,l),u|=R.DEFAULT_ACTIVE)),n.state.set(l,u),n.lodLevel.set(l,_)}else u=h&~(R.ACTIVE|R.TRANSFORM_CHANGED),n.state.set(l,u);if(this._octreeCached!=null){const _=!!(h&R.ACTIVE),g=!!(u&R.ACTIVE);!_&&g?this._octreeCached.addInstance(l):_&&!g?this._octreeCached.removeInstance(l):_&&g&&h&R.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(l),this._octreeCached.addInstance(l))}l=l+1===o?0:l+1,l%c==0&&e.madeProgress()}this._instanceIndex=l,this._allRenderInstanceData.forEach(d=>d.forEach(h=>h.endUpdate())),this._context.requestRender()}_beginComponent(e,t,r){return t.size===0?null:r.glMaterials.load(e.rctx,e.bind.slot,e.output)?.beginSlot(e.bind)}_renderComponent(e,t,r,i,s){if(!t)return;const{bind:n,rctx:a}=e;a.runAppleAmdDriverHelper();const o=a.bindTechnique(t,n,i.material.parameters,Vo);a.bindVAO(i.vao),t.ensureAttributeLocations(i.vao),Wt.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&e.output===E.Color&&(o.setUniform4fv("externalColor",ai[Math.min(s,ai.length-1)]),o.setUniform1i("colorMixMode",cn.replace));const l=r.capacity,c=r.headIndex,d=r.tailIndex,h=r.firstIndex,u=this._glInstanceBufferLayout,f=(_,g)=>{Pa(a,Qt,r.buffer,u,_),a.drawArraysInstanced(t.primitiveType,0,i.vertexCount,g-_),Fa(a,Qt,r.buffer,u)};i.material.parameters.transparent&&h!=null?c>d?(N(h>=d&&h<=c,"invalid firstIndex"),f(h,c),f(d,h)):c=0&&h<=c,"invalid firstIndex"),f(h,c),f(d,l),f(0,h)):(N(h>=d&&h<=l,"invalid firstIndex"),f(h,l),f(0,c),f(d,h))):c>d?f(d,c):cs.geometry));this.numVertices=i.reduce((s,n)=>s+Ho(n),0)}},$o=class{constructor(e){this.levels=e,this.levels.sort((t,r)=>t.minScreenSpaceRadius===r.minScreenSpaceRadius?t.numVertices-r.numVertices:t.minScreenSpaceRadius-r.minScreenSpaceRadius)}};function qo(e){const t=[];return e.levels.forEach(r=>r.components.forEach(i=>t.push(i.geometry.material))),or(t)}function ko(e){const t=new Array;return e.levels.forEach(r=>r.components.forEach(i=>{i.textures!=null&&t.push(...i.textures)})),or(t)}let rr=class{constructor(e){this._optionalFields=new Array,this._instanceIndexToFeatureId=new Map,this._featureIdToInstanceIndex=new Map,this._disposeResourceHandles=new Array,this._lodRendererResources=null,this.layerUid=e.layerUid,this.view=e.view,this.sharedResources=this.view.sharedSymbolResources,this.scheduler=this.view.resourceController.scheduler}async doLoad(e,t,r){vs("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(p.OBJECTANDLAYERIDCOLOR);const i=Wo(l=>t(l),e),s=this.view._stage,n=qo(i);s.addMany(n),this._addDisposeResource(()=>s.removeMany(n));const a=ko(i);s.addMany(a),this._addDisposeResource(()=>{a.forEach(l=>l.unload()),s.removeMany(a)}),await Promise.all(a.map(l=>this.view._stage.schedule(()=>l.load(s.renderView.renderingContext),r))),ve(r);const o=await this._createLodRenderer(i,r);this._lodRendererResources={lodRenderer:o,materials:n,textures:a}}addInstances(e){const t=this._lodRendererResources;if(t==null)return;const{featureIds:r,localTransforms:i,globalTransforms:s}=e,n=t.lodRenderer;if(n==null)return;const a=n.instanceData,o=r.length;for(let l=0;l1,notifyGraphicGeometryChanged:n=>1,notifyGraphicVisibilityChanged:n=>1},s=new Q({symbol:e,optionalFields:this._optionalFields,metadata:i,shaderTransformation:null},this.scheduler);return s.slicePlaneEnabled=!1,this._addDisposeResource(()=>{r.removeRenderPlugin(s),s.destroy()}),await r.addRenderPlugin(s,t),s}};function Wo(e,t){const r=t.levels.map(i=>{const s=i.components.map(n=>{const a=e(n.materialId);if(!Yo(a))throw new Error("LodRenderer only supports DefaultMaterial");const o=a.createBufferWriter(),l={material:a,vertexBufferLayout:o.vertexBufferLayout,buffer:n.renderGeometryBuffer.data,elementCount:n.renderGeometryBuffer.elementCount,boundingInfo:n.boundingInfo};return new jo(l)});return new Uo(s,i.minScreenSpaceRadius)});return new $o(r)}function Yo(e){return e!=null&&"materialType"in e&&e.materialType==="default"}rr=m([K("esri.views.3d.layers.graphics.pipeline.rendering.LodRenderer")],rr);const ji=128,De=.5;function Qo(e){return e==="cross"||e==="x"}function Jo(e,t=ji,r=t*De,i=0){const s=Xo(e,t,r,i);return new xn(s,{mipmap:!1,wrap:{s:Hr.CLAMP_TO_EDGE,t:Hr.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0})}function Xo(e,t=ji,r=t*De,i=0){switch(e){case"circle":default:return Zo(t,r);case"square":return Ko(t,r);case"cross":return tl(t,r,i);case"x":return rl(t,r,i);case"kite":return el(t,r);case"triangle":return il(t,r);case"arrow":return sl(t,r)}}function Zo(e,t){const r=e/2-.5;return Qe(e,$i(r,r,t/2))}function Ko(e,t){return Hi(e,t,!1)}function el(e,t){return Hi(e,t,!0)}function tl(e,t,r=0){return Ui(e,t,!1,r)}function rl(e,t,r=0){return Ui(e,t,!0,r)}function il(e,t){return Qe(e,qi(e/2,t,t/2))}function sl(e,t){const r=t,i=t/2,s=e/2,n=.8*r,a=$i(s,(e-t)/2-n,Math.sqrt(n*n+i*i)),o=qi(s,r,i);return Qe(e,(l,c)=>Math.max(o(l,c),-a(l,c)))}function Hi(e,t,r){return r&&(t/=Math.SQRT2),Qe(e,(i,s)=>{let n=i-.5*e+.25,a=.5*e-s-.75;if(r){const o=(n+a)/Math.SQRT2;a=(a-n)/Math.SQRT2,n=o}return Math.max(Math.abs(n),Math.abs(a))-.5*t})}function Ui(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const s=.5*t;return Qe(e,(n,a)=>{let o,l=n-.5*e,c=.5*e-a-1;if(r){const d=(l+c)/Math.SQRT2;c=(c-l)/Math.SQRT2,l=d}return l=Math.abs(l),c=Math.abs(c),o=l>c?l>s?Math.sqrt((l-s)*(l-s)+c*c):c:c>s?Math.sqrt(l*l+(c-s)*(c-s)):l,o-=i/2,o})}function $i(e,t,r){return(i,s)=>{const n=i-e,a=s-t;return Math.sqrt(n*n+a*a)-r}}function qi(e,t,r){const i=Math.sqrt(t*t+r*r);return(s,n)=>{const a=Math.abs(s-e)-r,o=n-e+t/2+.75,l=(t*a+r*o)/i,c=-o;return Math.max(l,c)}}function Qe(e,t){const r=new Uint8Array(4*e*e);for(let i=0;i=16}function al(e){return Array.isArray(e)&&e.length>=16}function ol(e){return nl(e)||al(e)}const ki=.5;function ll(e,t){e.include(Oi),e.attributes.add(p.POSITION,"vec3"),e.attributes.add(p.NORMAL,"vec3"),e.attributes.add(p.CENTEROFFSETANDDISTANCE,"vec4");const r=e.vertex;In(r,t),Cn(r,t),r.uniforms.add(new Me("viewport",(i,s)=>s.camera.fullViewport),new ge("polygonOffset",i=>i.shaderPolygonOffset),new ge("cameraGroundRelative",(i,s)=>s.camera.aboveGround?1:-1)),t.hasVerticalOffset&&Tn(r),r.constants.add("smallOffsetAngle","float",.984807753012208),r.code.add(w`struct ProjectHUDAux { -vec3 posModel; -vec3 posView; -vec3 vnormal; -float distanceToCamera; -float absCosAngle; -};`),r.code.add(w` - float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) { - float pointGroundSign = ${t.terrainDepthTest?w.float(0):w`sign(pointGroundDistance)`}; - if (pointGroundSign == 0.0) { - pointGroundSign = cameraGroundRelative; - } - - // cameraGroundRelative is -1 if camera is below ground, 1 if above ground - // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise - float groundRelative = cameraGroundRelative * pointGroundSign; - - // view angle dependent part of polygon offset emulation: we take the absolute value because the sign that is - // dropped is instead introduced using the ground-relative position of the symbol and the camera - if (polygonOffset > .0) { - float cosAlpha = clamp(absCosAngle, 0.01, 1.0); - float tanAlpha = sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha; - float factor = (1.0 - tanAlpha / viewport[2]); - - // same side of the terrain - if (groundRelative > 0.0) { - posView *= factor; - } - // opposite sides of the terrain - else { - posView /= factor; - } - } - - return groundRelative; - } - `),t.draped&&!t.hasVerticalOffset||Sn(r),t.draped||(r.uniforms.add(new ge("perDistancePixelRatio",(i,s)=>Math.tan(s.camera.fovY/2)/(s.camera.fullViewport[2]/2))),r.code.add(w` - void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) { - float distanceToCamera = length(posView); - - // Compute offset in world units for a half pixel shift - float pixelOffset = distanceToCamera * perDistancePixelRatio * ${w.float(ki)}; - - // Apply offset along normal in the direction away from the ground surface - vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset; - - // Apply the same offset also on the view space position - vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; - - posModel += modelOffset; - posView += viewOffset; - } - `)),t.screenCenterOffsetUnitsEnabled&&Ri(r),t.hasScreenSizePerspective&&Ai(r),r.code.add(w` - vec4 projectPositionHUD(out ProjectHUDAux aux) { - vec3 centerOffset = centerOffsetAndDistance.xyz; - float pointGroundDistance = centerOffsetAndDistance.w; - - aux.posModel = position; - aux.posView = (view * vec4(aux.posModel, 1.0)).xyz; - aux.vnormal = normal; - ${t.draped?"":"applyHUDVerticalGroundOffset(aux.vnormal, aux.posModel, aux.posView);"} - - // Screen sized offset in world space, used for example for line callouts - // Note: keep this implementation in sync with the CPU implementation, see - // - MaterialUtil.verticalOffsetAtDistance - // - HUDMaterial.applyVerticalOffsetTransformation - - aux.distanceToCamera = length(aux.posView); - - vec3 viewDirObjSpace = normalize(cameraPosition - aux.posModel); - float cosAngle = dot(aux.vnormal, viewDirObjSpace); - - aux.absCosAngle = abs(cosAngle); - - ${t.hasScreenSizePerspective&&(t.hasVerticalOffset||t.screenCenterOffsetUnitsEnabled)?"vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);":""} - - ${t.hasVerticalOffset?t.hasScreenSizePerspective?"float verticalOffsetScreenHeight = applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);":"float verticalOffsetScreenHeight = verticalOffset.x;":""} - - ${t.hasVerticalOffset?w` - float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w); - vec3 modelOffset = aux.vnormal * worldOffset; - aux.posModel += modelOffset; - vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; - aux.posView += viewOffset; - // Since we elevate the object, we need to take that into account - // in the distance to ground - pointGroundDistance += worldOffset;`:""} - - float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView); - - ${t.screenCenterOffsetUnitsEnabled?"":w` - // Apply x/y in view space, but z in screen space (i.e. along posView direction) - aux.posView += vec3(centerOffset.x, centerOffset.y, 0.0); - - // Same material all have same z != 0.0 condition so should not lead to - // branch fragmentation and will save a normalization if it's not needed - if (centerOffset.z != 0.0) { - aux.posView -= normalize(aux.posView) * centerOffset.z; - } - `} - - vec4 posProj = proj * vec4(aux.posView, 1.0); - - ${t.screenCenterOffsetUnitsEnabled?t.hasScreenSizePerspective?"float centerOffsetY = applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);":"float centerOffsetY = centerOffset.y;":""} - - ${t.screenCenterOffsetUnitsEnabled?"posProj.xy += vec2(centerOffset.x, centerOffsetY) * pixelRatio * 2.0 / viewport.zw * posProj.w;":""} - - // constant part of polygon offset emulation - posProj.z -= groundRelative * polygonOffset * posProj.w; - return posProj; - } - `)}let cl=class{constructor(){this.factor=new oi,this.factorAlignment=new oi}},oi=class{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}};function mr(e){e.uniforms.add(new On("alignPixelEnabled",(t,r)=>r.alignPixelEnabled)),e.code.add(w`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) { -if (!alignPixelEnabled) -return clipCoord; -vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w; -vec2 pixelSz = vec2(1.0) / widthHeight; -vec2 ij = (floor(xy * widthHeight) + vec2(0.5)) * pixelSz; -vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; -return vec4(result, clipCoord.zw); -}`),e.code.add(w`vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) { -if (!alignPixelEnabled) -return clipCoord; -vec2 xy = vec2(0.5) + 0.5 * clipCoord.xy / clipCoord.w; -vec2 pixelSz = vec2(1.0) / widthHeight; -vec2 ij = floor((xy + 0.5 * pixelSz) * widthHeight) * pixelSz; -vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; -return vec4(result, clipCoord.zw); -}`)}function hl(e,t){const{vertex:r,fragment:i}=e;e.include(Rn,t),r.include(mr),t.terrainDepthTest&&e.varyings.add("depth","float"),r.main.add(w` - vec4 posProjCenter; - if (dot(position, position) > 0.0) { - // Render single point to center of the pixel to avoid subpixel filtering to affect the marker color - ProjectHUDAux projectAux; - vec4 posProj = projectPositionHUD(projectAux); - posProjCenter = alignToPixelCenter(posProj, viewport.zw); - - ${t.terrainDepthTest?w`depth = projectAux.posView.z;`:""} - vec3 vpos = projectAux.posModel; - if (rejectBySlice(vpos)) { - // Project out of clip space - posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); - } - - } else { - // Project out of clip space - posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); - } - - gl_Position = posProjCenter; - gl_PointSize = 1.0; - `),i.main.add(w`fragColor = vec4(1); -if(terrainDepthTest(depth)) { -fragColor.g = 0.5; -}`)}var wt;(function(e){e[e.Occluded=0]="Occluded",e[e.NotOccluded=1]="NotOccluded",e[e.Both=2]="Both",e[e.COUNT=3]="COUNT"})(wt||(wt={}));function dl(e){e.vertex.uniforms.add(new ge("renderTransparentlyOccludedHUD",(t,r)=>r.hudRenderStyle===wt.Occluded?1:r.hudRenderStyle===wt.NotOccluded?0:.75),new Me("viewport",(t,r)=>r.camera.fullViewport),new Yt("hudVisibilityTexture",(t,r)=>r.hudVisibility?.getTexture())),e.vertex.include(mr),e.vertex.code.add(w`bool testHUDVisibility(vec4 posProj) { -vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw); -vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w); -if (renderTransparentlyOccludedHUD > 0.5) { -return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0; -} -return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0; -}`)}const gr={occludedFadeFactor:.6};function Wi(e){const t=new hn,r=e.signedDistanceFieldEnabled;if(t.include(ll,e),t.include(dn,e),e.occlusionPass)return t.include(hl,e),t;const{vertex:i,fragment:s}=t;t.include(Oi),t.include(un,e),t.include(fn,e),t.include(dl),s.include(qa),s.include(pn),t.varyings.add("vcolor","vec4"),t.varyings.add("vtc","vec2"),t.varyings.add("vsize","vec2"),t.varyings.add("voccluded","float"),i.uniforms.add(new Me("viewport",(d,h)=>h.camera.fullViewport),new Sr("screenOffset",(d,h)=>ft(Yi,2*d.screenOffset[0]*h.camera.pixelRatio,2*d.screenOffset[1]*h.camera.pixelRatio)),new Sr("anchorPosition",d=>We(d)),new Me("materialColor",d=>d.color),new ge("materialRotation",d=>d.rotation)),Ri(i),r&&(i.uniforms.add(new Me("outlineColor",d=>d.outlineColor)),s.uniforms.add(new Me("outlineColor",d=>li(d)?d.outlineColor:Xs),new ge("outlineSize",d=>li(d)?d.outlineSize:0))),e.horizonCullingEnabled&&i.uniforms.add(new ka("pointDistanceSphere",(d,h)=>{const u=h.camera.eye,f=d.origin;return ae(f[0]-u[0],f[1]-u[1],f[2]-u[2],ys.radius)})),e.pixelSnappingEnabled&&i.include(mr),e.hasScreenSizePerspective&&(mn(i),Ai(i)),e.debugDrawLabelBorder&&t.varyings.add("debugBorderCoords","vec4"),t.attributes.add(p.UV0,"vec2"),t.attributes.add(p.COLOR,"vec4"),t.attributes.add(p.SIZE,"vec2"),t.attributes.add(p.ROTATION,"float"),t.attributes.add(p.FEATUREATTRIBUTE,"vec4"),i.code.add(e.horizonCullingEnabled?w`bool behindHorizon(vec3 posModel) { -vec3 camToEarthCenter = pointDistanceSphere.xyz - localOrigin; -vec3 camToPos = pointDistanceSphere.xyz + posModel; -float earthRadius = pointDistanceSphere.w; -float a = dot(camToPos, camToPos); -float b = dot(camToPos, camToEarthCenter); -float c = dot(camToEarthCenter, camToEarthCenter) - earthRadius * earthRadius; -return b > 0.0 && b < a && b * b > a * c; -}`:w`bool behindHorizon(vec3 posModel) { return false; }`),i.main.add(w` - ProjectHUDAux projectAux; - vec4 posProj = projectPositionHUD(projectAux); - forwardObjectAndLayerIdColor(); - - if (rejectBySlice(projectAux.posModel)) { - // Project outside of clip plane - gl_Position = vec4(1e038, 1e038, 1e038, 1.0); - return; - } - - if (behindHorizon(projectAux.posModel)) { - // Project outside of clip plane - gl_Position = vec4(1e038, 1e038, 1e038, 1.0); - return; - } - - vec2 inputSize; - ${z(e.hasScreenSizePerspective,w` - inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective); - vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);`,w` - inputSize = size; - vec2 screenOffsetScaled = screenOffset;`)} - ${z(e.vvSize,w`inputSize *= vvScale(featureAttribute).xx;`)} - - vec2 combinedSize = inputSize * pixelRatio; - vec4 quadOffset = vec4(0.0); - bool visible = testHUDVisibility(posProj); - voccluded = visible ? 0.0 : 1.0; - `);const n=w` - vec2 uv01 = floor(uv0); - vec2 uv = uv0 - uv01; - quadOffset.xy = (uv01 - anchorPosition) * 2.0 * combinedSize; - - ${z(e.hasRotation,w` - float angle = radians(materialRotation + rotation); - float cosAngle = cos(angle); - float sinAngle = sin(angle); - mat2 rotate = mat2(cosAngle, -sinAngle, sinAngle, cosAngle); - - quadOffset.xy = rotate * quadOffset.xy; - `)} - - quadOffset.xy = (quadOffset.xy + screenOffsetScaled) / viewport.zw * posProj.w; - `,a=e.pixelSnappingEnabled?r?w`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:w`posProj += quadOffset; -if (inputSize.x == size.x) { -posProj = alignToPixelOrigin(posProj, viewport.zw); -}`:w`posProj += quadOffset;`;i.main.add(w` - ${z(e.occlusionTestEnabled,w` - if (!visible) { - vtc = vec2(0.0); - ${z(e.debugDrawLabelBorder,"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);")} - return; - }`)} - ${n} - ${e.vvColor?"vcolor = interpolateVVColor(featureAttribute.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"} - - ${z(e.output===E.ObjectAndLayerIdColor,w`vcolor.a = 1.0;`)} - - bool alphaDiscard = vcolor.a < ${w.float(oe)}; - ${z(r,`alphaDiscard = alphaDiscard && outlineColor.a < ${w.float(oe)};`)} - if (alphaDiscard) { - // "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent - gl_Position = vec4(1e38, 1e38, 1e38, 1.0); - return; - } else { - ${a} - gl_Position = posProj; - } - - vtc = uv; - - ${z(e.debugDrawLabelBorder,w`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)} - vsize = inputSize; - `),s.uniforms.add(new Yt("tex",d=>d.texture)),e.occludedFragmentFade&&(s.uniforms.add(new Yt("depthMap",(d,h)=>h.mainDepth)),s.uniforms.add(new ge("fadeFactor",()=>gr.occludedFadeFactor)));const o=e.debugDrawLabelBorder?w`(isBorder > 0.0 ? 0.0 : ${w.float(oe)})`:w.float(oe),l=e.output===E.Highlight,c=w` - ${z(e.debugDrawLabelBorder,w`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)} - - ${z(e.sampleSignedDistanceFieldTexelCenter,w` - float txSize = float(textureSize(tex, 0).x); - float texelSize = 1.0 / txSize; - - // Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel - vec2 scaleFactor = (vsize - txSize) * texelSize; - vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor;`,w`vec2 samplePos = vtc;`)} - - ${r?w` - vec4 fillPixelColor = vcolor; - - // Get distance and map it into [-0.5, 0.5] - float d = rgba2float(texture(tex, samplePos)) - 0.5; - - // Distance in output units (i.e. pixels) - float dist = d * vsize.x; - - // Create smooth transition from the icon into its outline - float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0); - fillPixelColor.a *= fillAlphaFactor; - - if (outlineSize > 0.25) { - vec4 outlinePixelColor = outlineColor; - float clampedOutlineSize = min(outlineSize, 0.5*vsize.x); - - // Create smooth transition around outline - float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0); - outlinePixelColor.a *= outlineAlphaFactor; - - if ( - outlineAlphaFactor + fillAlphaFactor < ${o} || - fillPixelColor.a + outlinePixelColor.a < ${w.float(oe)} - ) { - discard; - } - - // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description) - float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a); - vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a + - vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a); - - ${z(!l,w`fragColor = vec4(compositeColor, compositeAlpha);`)} - } else { - if (fillAlphaFactor < ${o}) { - discard; - } - - ${z(!l,w`fragColor = premultiplyAlpha(fillPixelColor);`)} - } - - // visualize SDF: - // fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0); - `:w` - vec4 texColor = texture(tex, vtc, -0.5); - if (texColor.a < ${o}) { - discard; - } - ${z(!l,w`fragColor = texColor * premultiplyAlpha(vcolor);`)} - `} - - ${z(e.occludedFragmentFade&&!l,w` - float zSample = texelFetch(depthMap, ivec2(gl_FragCoord.xy), 0).x; - if (zSample < gl_FragCoord.z) { - fragColor *= fadeFactor; - } - `)} - - ${z(!l&&e.debugDrawLabelBorder,w`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`)} - `;switch(e.output){case E.Color:e.oitPass===Ue.ColorAlpha&&(t.outputs.add("fragColor","vec4",0),t.outputs.add("fragAlpha","float",1)),s.main.add(w` - ${c} - ${z(e.oitPass===Ue.FrontFace,w`fragColor.rgb /= fragColor.a;`)} - ${z(e.oitPass===Ue.ColorAlpha,w`fragAlpha = fragColor.a;`)}`);break;case E.ObjectAndLayerIdColor:s.main.add(w` - ${c} - outputObjectAndLayerIdColor();`);break;case E.Highlight:t.include(gn,e),s.main.add(w` - ${c} - outputHighlight(voccluded == 1.0);`)}return t}function li(e){return e.outlineColor[3]>0&&e.outlineSize>0}function We(e,t=Yi){return e.textureIsSignedDistanceField?ul(e.anchorPosition,e.distanceFieldBoundingBox,t):Si(t,e.anchorPosition),t}function ul(e,t,r){t!=null?ft(r,e[0]*(t[2]-t[0])+t[0],e[1]*(t[3]-t[1])+t[1]):ft(r,0,0)}const Yi=lr(),fl=Object.freeze(Object.defineProperty({__proto__:null,build:Wi,calculateAnchorPosForRendering:We,shaderSettings:gr},Symbol.toStringTag,{value:"Module"}));let pl=class extends qn{constructor(e,t,r){super(e,t,new kn(fl,()=>Promise.resolve().then(()=>cc)),r),this.primitiveType=t.occlusionPass?Ur.POINTS:Ur.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:i,output:s,depthTestEnabled:n}=e,a=t===Ue.NONE,o=r?ml:null,l=t===Ue.ColorAlpha,c=i||!n||l||s===E.Highlight?null:Na;return za({blending:s===E.Color?a?Ba:Wn(t):null,depthTest:n&&!i?{func:Sa.LEQUAL}:null,depthWrite:c,drawBuffers:Yn(t,s),colorWrite:Ga,polygonOffset:o})}};const ml={factor:0,units:-4};let D=class extends _n{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.textureCoordinateType=vn.None,this.emissionSource=yn.None,this.discardInvisibleFragments=!0,this.hasSliceInVertexProgram=!0,this.hasVvInstancing=!1}};m([F()],D.prototype,"screenCenterOffsetUnitsEnabled",void 0),m([F()],D.prototype,"occlusionTestEnabled",void 0),m([F()],D.prototype,"signedDistanceFieldEnabled",void 0),m([F()],D.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),m([F()],D.prototype,"vvSize",void 0),m([F()],D.prototype,"vvColor",void 0),m([F()],D.prototype,"hasVerticalOffset",void 0),m([F()],D.prototype,"hasScreenSizePerspective",void 0),m([F()],D.prototype,"hasRotation",void 0),m([F()],D.prototype,"debugDrawLabelBorder",void 0),m([F()],D.prototype,"hasSlicePlane",void 0),m([F()],D.prototype,"hasPolygonOffset",void 0),m([F()],D.prototype,"depthTestEnabled",void 0),m([F()],D.prototype,"pixelSnappingEnabled",void 0),m([F()],D.prototype,"draped",void 0),m([F()],D.prototype,"terrainDepthTest",void 0),m([F()],D.prototype,"cullAboveTerrain",void 0),m([F()],D.prototype,"occlusionPass",void 0),m([F()],D.prototype,"occludedFragmentFade",void 0),m([F()],D.prototype,"objectAndLayerIdColorInstanced",void 0),m([F()],D.prototype,"horizonCullingEnabled",void 0);class gl extends An{constructor(t,r){super(t,Sl),this.produces=new Map([[W.HUD_MATERIAL,i=>Ct(i)&&!this.parameters.drawInSecondSlot],[W.LABEL_MATERIAL,i=>Ct(i)&&this.parameters.drawInSecondSlot],[W.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[W.DRAPED_MATERIAL,i=>this.parameters.draped&&Ct(i)]]),this._visible=!0,this._configuration=new D(r)}getConfiguration(t,r){return this._configuration.output=t,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled=this.parameters.centerOffsetUnits==="screen",this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=r.slot===W.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.depthTestEnabled=this.parameters.depthEnabled||r.slot===W.OCCLUSION_PIXELS,t===E.Color&&(this._configuration.debugDrawLabelBorder=!!Wt.LABELS_SHOW_BORDER),this._configuration.oitPass=r.oitPass,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration}intersect(t,r,i,s,n,a){const{options:{selectionMode:o,hud:l,excludeLabels:c},point:d,camera:h}=i,{parameters:u}=this;if(!o||!l||c&&u.isLabel||!t.visible||!d)return;const{scaleX:f,scaleY:_}=this._getScreenScale(t,h.pixelRatio);dr(Lt,r),t.attributes.has(p.FEATUREATTRIBUTE)&&yl(Lt);const g=t.attributes.get(p.POSITION),C=t.attributes.get(p.SIZE),I=t.attributes.get(p.NORMAL),x=t.attributes.get(p.ROTATION),O=t.attributes.get(p.CENTEROFFSETANDDISTANCE);N(g.size>=3);const M=We(u),y=this.parameters.centerOffsetUnits==="screen";for(let P=0;P-1){y&&(k[0]||k[1])&&(V[0]+=k[0]*h.pixelRatio,k[1]!==0&&(V[1]+=En(k[1],Ft.factorAlignment)*h.pixelRatio),h.unapplyProjection(V,G)),V[0]+=this.parameters.screenOffset[0]*h.pixelRatio,V[1]+=this.parameters.screenOffset[1]*h.pixelRatio,V[0]=Math.floor(V[0]),V[1]=Math.floor(V[1]);const Je=P*C.size;$[0]=C.data[Je],$[1]=C.data[Je+1],Mn($,Ft.factor,$);const rs=Il*h.pixelRatio;let _r=0;u.textureIsSignedDistanceField&&(_r=Math.min(u.outlineSize,.5*$[0])*h.pixelRatio/2),$[0]*=f,$[1]*=_;const is=P*x.size,ss=u.rotation+x.data[is];if(hi(d,V[0],V[1],$,rs,_r,ss,u,M)){const vr=i.ray;if(_e(di,G,Pe(bl,h.viewMatrix)),V[0]=d[0],V[1]=d[1],h.unprojectFromRenderScreen(V,G)){const Ne=A();j(Ne,vr.direction);const yr=1/me(Ne);Z(Ne,Ne,yr),a(Mi(vr.origin,G)*yr,Ne,-1,!0,1,di)}}}}}intersectDraped(t,r,i,s,n,a){const o=t.attributes.get(p.POSITION),l=t.attributes.get(p.SIZE),c=t.attributes.get(p.ROTATION),d=this.parameters,h=We(d),{scaleX:u,scaleY:f}=this._getScreenScale(t,t.screenToWorldRatio),_=Cl*t.screenToWorldRatio;for(let g=0;g0?d:1/d),n}_applyVerticalGroundOffsetView(t,r,i,s){const n=me(t),a=i.aboveGround?1:-1,o=i.computeRenderPixelSizeAtDist(n)*ki,l=Z(G,r.normal,a*o);return ht(s,t,l),s}_applyVerticalOffsetTransformationView(t,r,i,s){const n=this.parameters;if(!n.verticalOffset?.screenLength){if(n.screenSizePerspective||n.screenSizePerspectiveAlignment){const c=me(t);this._updateScaleInfo(s,c,r.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return t}const a=me(t),o=n.screenSizePerspectiveAlignment??n.screenSizePerspective,l=Dn(i,a,n.verticalOffset,r.cosAngle,o);return this._updateScaleInfo(s,a,r.cosAngle),Z(r.normal,r.normal,l),ht(t,t,r.normal)}_applyCenterOffsetView(t,r,i){const s=this.parameters.centerOffsetUnits!=="screen";return i!==t&&j(i,t),s&&(i[0]+=r[0],i[1]+=r[1],r[2]&&(he(Ge,i),ht(i,i,Z(Ge,Ge,r[2])))),i}_applyCenterOffsetNDC(t,r,i,s){const n=this.parameters.centerOffsetUnits!=="screen";return s!==t&&j(s,t),n||(s[0]+=r[0]/i.fullWidth*2,s[1]+=r[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(t,r,i,s){const n=this.parameters.shaderPolygonOffset;if(t!==s&&j(s,t),n){const a=i.aboveGround?1:-1,o=a*Math.sign(r[3]);s[2]-=(o||a)*n}return s}set visible(t){this._visible=t}get visible(){const{color:t,outlineSize:r,outlineColor:i}=this.parameters,s=t[3]>=oe||r>=oe&&i[3]>=oe;return this._visible&&s}createGLMaterial(t){return new _l(t)}calculateRelativeScreenBounds(t,r,i=Ii()){return vl(this.parameters,t,r,i),i[2]=i[0]+t[0],i[3]=i[1]+t[1],i}_getScreenScale(t,r){const i=t.attributes.get(p.FEATUREATTRIBUTE);if(i==null)return{scaleX:r,scaleY:r};const s=Zs(i.data,xl);return Pn(Nt,this.parameters,s),{scaleX:Nt[0]*r,scaleY:Nt[1]*r}}}class _l extends Fn{constructor(t){super({...t,...t.material.parameters})}beginSlot(t){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.acquireTechnique(pl,t)}}function vl(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}function ci(e,t,r,i){return ol(t)&&(t=dr(wl,t)),oa(i.normal,e,t),_e(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=qe(Qi,Tl),i}function yl(e){const t=e[0],r=e[1],i=e[2],s=e[3],n=e[4],a=e[5],o=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+i*i),h=1/Math.sqrt(s*s+n*n+a*a),u=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*d,e[1]=r*d,e[2]=i*d,e[3]=s*h,e[4]=n*h,e[5]=a*h,e[6]=o*u,e[7]=l*u,e[8]=c*u,e}function hi(e,t,r,i,s,n,a,o,l){let c=t-s-i[0]*l[0],d=c+i[0]+2*s,h=r-s-i[1]*l[1],u=h+i[1]+2*s;const f=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&f!=null&&(c+=i[0]*f[0],h+=i[1]*f[1],d-=i[0]*(1-f[2]),u-=i[1]*(1-f[3]),c-=n,d+=n,h-=n,u+=n),ft(ui,t,r),tn(Ve,e,ui,Ps(a)),Ve[0]>c&&Ve[0]h&&Ve[1]=4&&(l=o[0],c=o[1],d=o[2],h=o[3]),d=Math.min(1.99999,d+1),h=Math.min(1.99999,h+1);let u=i.get(p.POSITION).indices.length,f=a;const _=n.uv0;for(let x=0;xbs(o))]),n=a}break;default:throw new Error(`unable to create unknown material type ${e.type}`)}this._materials.set(e.materialId,n)}_getMaterial(e){return this._materials.get(e)}async _createDirectRenderer(e){const t=e.materialId,r=this._getMaterial(t);if(r==null)throw new Error(`material not found ${t}`);const{view:i}=this,s=new dt({material:r});this._directRenderers.set(t,s),i._stage.addRenderPlugin(s),i._stage.renderView.renderer.updateHasFlags()}async _addDirectRendererGeometry(e){const t=e.renderGeometryId,r=e.materialId;this._renderGeometries.get(t)!=null&&await this._removeDirectRendererGeometry({renderGeometryId:t});const i=this._directRenderers.get(r);if(i==null)return void console.error("no renderer assigned to provided material");const s=i.addRenderGeometry(t,e.renderGeometryBuffer,e.localOrigin);this._renderGeometries.set(t,{renderGeometry:s,materialId:r}),this.view._stage.renderView.requestRender()}async _removeDirectRendererGeometry(e){const t=e.renderGeometryId,r=this._renderGeometries.get(t);if(r==null)return;const i=r.materialId,s=this._directRenderers.get(i);s!=null?s.removeRenderGeometry(e.renderGeometryId):console.error("no renderer assigned to provided material")}async _createLodRenderer(e){const t=new rr({view:this.view,layerUid:this.layerUid}),r=new AbortController,i=s=>this._getMaterial(s);await t.doLoad(e.lodRenderGeometry,i,r.signal),this._lodRenderers.set(e.lodRendererId,t)}async _addLodInstances(e){const t=this._lodRenderers.get(e.lodRendererId);if(t==null)throw new Error("no lod renderer assigned to provided lod renderer Id");t.addInstances(e.data)}async _removeLodInstances(e){const t=this._lodRenderers.get(e.lodRendererId);if(t==null)throw new Error("no lod renderer assigned to provided lod renderer Id");t.removeInstances(e.featureIds)}};function Xi(e,t){const r={anchorPosition:io.center,occlusionTest:!0,hasSlicePlane:!1},i=r,s=1;i.color=[1,0,0,1],i.outlineColor=[0,0,0,1],i.outlineSize=s;const n=null;if(e!=null){const a=e.fromData("circle-icon",()=>Jo("circle"));i.textureId=a.texture.id,i.textureIsSignedDistanceField=!0,i.sampleSignedDistanceFieldTexelCenter=Qo("circle")}return i.distanceFieldBoundingBox=Ml,[new gl(r,t),n]}function Al(e,t,r){const i={usePBR:t.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:Un,ambient:qt,diffuse:qt,hasSlicePlane:t.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:t.castShadows,offsetTransparentBackfaces:!t.isPrimitive};return El(i),i.screenSizePerspective=e.screenSizePerspectiveSettings,i.externalColor=Ks,i.isInstanced=!0,new Ei(i,{spherical:r,doublePrecisionRequiresObfuscation:!0})}function El(e){const t=e.opacity??1,r=t<1;return e.transparent=r,e.opacity=t,e.cullFace=r?Mr.None:Mr.Back,e}fi=m([K("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderManager")],fi);const Ml=[De/2,De/2,1-De/2,1-De/2];let pi=class{constructor(e){this._bufferWriter=null,this._bufferWriter=e.createBufferWriter()}createBuffer(e,t){const r=this._bufferWriter;let i=null;if(e.transformation&&t)ce(xe,e.transformation),xe[12]-=t[0],xe[13]-=t[1],xe[14]-=t[2],i=xe;else{if(t)throw new Error("not implemented");e.transformation&&(i=e.transformation)}let s=null;i&&(Pe(ot,xe),cr(ot,ot),s=ot);const n=e.attributes,a=r.elementCount(n),o=r.vertexBufferLayout.stride/4;a>Math.floor(Dl/o)&&console.warn("geometry with very large number of elements encountered");const l=r.vertexBufferLayout.createBuffer(a);return r.write(i,s,n,e.objectAndLayerIdColor,l,0),{data:l.buffer,elementCount:a}}};const xe=L(),ot=L(),Dl=16777216/4;let Pl=class{constructor(e){this._context=e,this._commands=[],this._transferables=new Set}createMaterial(e){const t=this._context,r=t.generateId("material");switch(e){case"default":{const i=new Ei({},{spherical:this._context.globalViewingMode,doublePrecisionRequiresObfuscation:!0}),s=new pi(i);t.registerRenderGeometryBufferWriter(r,s)}break;case"hud":{const i=Xi(null,this._context.globalViewingMode)[0],s=new pi(i);t.registerRenderGeometryBufferWriter(r,s)}}return this._commands.push({id:"create-material",type:e,materialId:r}),r}createDirectRenderer(e){const t=this._context.generateId("material-renderer");return this._commands.push({id:"create-direct-renderer",materialRendererId:t,materialId:e}),t}addDirectRendererGeometry(e,t,r){const i=t.materialId,s=this._context.getRenderGeometryBufferWriter(i);if(s==null)throw new Error(`no bufferwriter found for material ${i}`);const n=s.createBuffer(t,r);this._transferables.add(n.data),this._commands.push({id:"add-direct-renderer-geometry",renderGeometryId:e,materialId:i,renderGeometryBuffer:n,localOrigin:r})}removeDirectRendererGeometry(e){this._commands.push({id:"remove-direct-renderer-geometry",renderGeometryId:e})}createLodRenderer(e){const t=this._context.generateId("lod-renderer"),r={levels:e.levels.map(i=>({components:i.components.map(s=>{const n=s.attributes.get(p.POSITION);if(!n||n.indices.length===0)throw new Error("positions attribute expected");const a=3,o=Qs(n.indices.length/a),l=new $n(o,a,n),c=this._context.getRenderGeometryBufferWriter(s.materialId);if(c==null)throw new Error("writer not found");const d=c.createBuffer(s,null);return this._transferables.add(d.data),{materialId:s.materialId,renderGeometryBuffer:d,boundingInfo:{bbMax:l.bbMax,bbMin:l.bbMin}}}),minScreenSpaceRadius:i.minScreenSpaceRadius}))};return this._commands.push({id:"create-lod-renderer",lodRendererId:t,lodRenderGeometry:r}),t}addLodInstances(e,t){this._commands.push({id:"add-lod-instances",lodRendererId:e,data:t}),this._transferables.add(t.featureIds.buffer),this._transferables.add(t.globalTransforms.buffer),this._transferables.add(t.localTransforms.buffer)}removeLodInstances(e,t){this._commands.push({id:"remove-lod-instances",lodRendererId:e,featureIds:t}),this._transferables.add(t.buffer)}async dispatch(){const e=this._commands,t=Array.from(this._transferables);this._clearCommandBuffer(),this._context.dispatchRenderCommands(e,t)}_clearCommandBuffer(){this._commands=[],this._transferables.clear()}},Fl=class{constructor(e){this._idCounter=0,this._bufferWriters=new Map,this._dispatchRenderCommandsCallback=async()=>{},this.globalViewingMode=!1,this.globalViewingMode=e.viewingMode===ne.Global,this._dispatchRenderCommandsCallback=e.dispatchRenderCommandsCallback}generateId(e=""){return`${e}${this._idCounter++}`}createEncoder(){return new Pl(this)}async dispatchRenderCommands(e,t){this._dispatchRenderCommandsCallback(e,t)}registerRenderGeometryBufferWriter(e,t){this._bufferWriters.set(e,t)}getRenderGeometryBufferWriter(e){return this._bufferWriters.get(e)}};var q;(function(e){e[e.OBJECT_ID=0]="OBJECT_ID",e[e.PARTITION_ID=1]="PARTITION_ID",e[e.GEOMETRY_MAP_COORDINATES=2]="GEOMETRY_MAP_COORDINATES",e[e.GEOMETRY_RENDER_COORDINATES=3]="GEOMETRY_RENDER_COORDINATES",e[e.TILE_CENTER_RENDER_COORDINATES=4]="TILE_CENTER_RENDER_COORDINATES"})(q||(q={}));async function Ll(e,t){const{numFeatures:r,tile:i,partitionInfo:s}=e,{pages:n}=i;if(n.length===0||r===0)return new Uint32Array;const a=new Uint32Array(r);if(s){const o=n.reduce((h,{featureCount:u})=>h+u,0),l=new Uint32Array(o);let c=0;for(const h of n)c=h.readAllObjectIds(l,c);const d=s.tileIndices;for(let h=0;hh+u,0),l=new Float64Array(3*o);let c=0;for(const h of n)c=h.readAllCoordinates(l,c);const d=s.tileIndices;for(let h=0;h=0;o--){const l=e[o];let c;const d=l!=null,h=o===0&&!n&&!d,u=r[o];l==="symbol-value"||h?c=u!==0?t[o]/u:1:d&&l!=="proportional"&&isFinite(l)&&(c=u!==0?l/u:1),c!=null&&(s[o]=c,n=c,a=Math.max(a,Math.abs(c)))}for(let o=2;o>=0;o--)s[o]==null?s[o]=n:s[o]===0&&(s[o]=.001*a)}for(let n=2;n>=0;n--)s[n]/=i;return $t(s)}function Ki(e){const t=new Map;for(const[r,i]of e)t.set(r,{...i,indices:Js(i.indices)});return t}var mi;(function(e){function t(a,o){const l=a[o],c=a[o+1],d=a[o+2];return Math.sqrt(l*l+c*c+d*d)}function r(a,o){const l=a[o],c=a[o+1],d=a[o+2],h=1/Math.sqrt(l*l+c*c+d*d);a[o]*=h,a[o+1]*=h,a[o+2]*=h}function i(a,o,l){a[o]*=l,a[o+1]*=l,a[o+2]*=l}function s(a,o,l,c,d,h=o){(d=d||a)[h]=a[o]+l[c],d[h+1]=a[o+1]+l[c+1],d[h+2]=a[o+2]+l[c+2]}function n(a,o,l,c,d,h=o){(d=d||a)[h]=a[o]-l[c],d[h+1]=a[o+1]-l[c+1],d[h+2]=a[o+2]-l[c+2]}e.length=t,e.normalize=r,e.scale=i,e.add=s,e.subtract=n})(mi||(mi={}));const Vl=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)Vl[6*e+t]=e;const Ie=new Array(36);for(let e=0;e<6;e++)Ie[6*e]=0,Ie[6*e+1]=1,Ie[6*e+2]=2,Ie[6*e+3]=2,Ie[6*e+4]=3,Ie[6*e+5]=0;const Bt=re(-.5,0,-.5),Gt=re(.5,0,-.5),Vt=re(0,0,.5),jt=re(0,.5,0),Ce=Ye(),Te=Ye(),Se=Ye(),Oe=Ye(),Re=Ye();Y(Ce,Bt,jt),Y(Te,Bt,Gt),$e(Se,Ce,Te),he(Se,Se),Y(Ce,Gt,jt),Y(Te,Gt,Vt),$e(Oe,Ce,Te),he(Oe,Oe),Y(Ce,Vt,jt),Y(Te,Vt,Bt),$e(Re,Ce,Te),he(Re,Re),Se[0],Se[1],Se[2],Oe[0],Oe[1],Oe[2],Re[0],Re[1],Re[2];function jl(e,t,r,i,s=!0,n=!0){let a=0;const o=t,l=e;let c=re(0,a,0),d=re(0,a+l,0),h=re(0,-1,0),u=re(0,1,0);const f=[d,c],_=[h,u],g=r+2,C=Math.sqrt(l*l+o*o);for(let y=0;y({levels:i.map(a=>{const o=Ki(s(a.tesselation));return n&&Ul(o),{components:[{attributes:o,objectAndLayerIdColor:void 0,transformation:null,materialId:t}],minScreenSpaceRadius:a.minScreenSpaceRadius}})});switch(e){case"cone":return r($l,i=>jl(1,.5,i),!0);case"sphere":case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Ul(e){const t=e,r=t.get(p.POSITION).data,i=t.get(p.NORMAL).data;if(i){const s=gi(e,p.NORMAL).data;for(let n=0;n{const n=await this._provisionSymbol(s.partitionInfo?.index,r);n&&await n.add(s,r)}))}async remove(t,r){const i=t.partitions;if(!i)throw new Error("partitioned featureset expected");await Promise.all(i.map(async s=>{const n=await this._provisionSymbol(s.partitionInfo?.index,r);n&&await n.remove(s,r)}))}async _provisionFeatureData(t,r){await t.provision([q.PARTITION_ID,q.OBJECT_ID],r)}async _provisionSymbol(t,r){if(t==null)return null;const i=this._symbols.get(t);return i?(i.loaded||await i.load(r),i):null}_partition(t){const{numFeatures:r,objectIds:i,partitionIds:s}=t,n=[[],[]];for(let a=0;aa.length>0).map((a,o)=>{const l=a.length,c={index:o,tileIndices:new Uint32Array(a)};return new Zi(t.tile,l,c)}),t.partitions}}function Yl(e,t,r){return!!gt(e,t,ct,r.spatialReference)&&(r.x=ct[0],r.y=ct[1],r.z=ct[2],!0)}const ct=A();function Ql(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}function Jl(e,t,r){return e.operations.setExtent(e.value,t,r.value),r}function Xl(e,t){return e.operations.getExtent(e.value,t),t}function Zl(e){return{operations:e,value:e.create()}}function es(e,t,r=Zl(e)){return r.operations=e,e.copy(t,r.value),r}function Kl(e){return es(ma,pa(0,0,0,Ci(e).radius))}const _i=2**50;function ec(){return es(Ra,Oa([0,0,0],[_i,0,0],[0,_i,0]))}function tc(e,t,r){return e.operations.axisAt(e.value,t,je.Z,r)}function rc(e,t,r,i){return e.operations.axisAt(e.value,t,r,i)}function ic(e,t,r){return e.operations.intersectRay(e.value,t,r)}function sc(e,t,r){return e.operations.intersectRayClosestSilhouette(e.value,t,r)}function nc(e,t){return e.operations.altitudeAt(e.value,t)}function ts(e,t,r,i){return e.operations.setAltitudeAt(e.value,t,r,i)}function ac(e,t,r,i){return t!==i&&ce(i,t),ie(Ae,i[12],i[13],i[14]),ts(e,Ae,r,Ae),i[12]=Ae[0],i[13]=Ae[1],i[14]=Ae[2],i}function Ht(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Ae=A();function vi(e){return e.type==="point"}class bt{constructor(t,r,i,s){this.viewingMode=t,this.spatialReference=r,this.unitInMeters=i,this._coordinateSystem=s,this._tmpCoordinateSystem=Ql(s),this.referenceEllipsoid=Ci(r),this.sphericalPCPF=Ha(r)}set extent(t){t&&Jl(this._coordinateSystem,t,this._coordinateSystem)}get extent(){return Xl(this._coordinateSystem,Ii())}getAltitude(t){return nc(this._coordinateSystem,t)}setAltitude(t,r,i=t){return ts(this._coordinateSystem,i,r,t)}setAltitudeOfTransformation(t,r){ac(this._coordinateSystem,r,t,r)}worldUpAtPosition(t,r){return tc(this._coordinateSystem,t,r)}worldBasisAtPosition(t,r,i){return rc(this._coordinateSystem,t,r,i)}basisMatrixAtPosition(t,r){const i=this.worldBasisAtPosition(t,je.X,de.get()),s=this.worldBasisAtPosition(t,je.Y,de.get()),n=this.worldBasisAtPosition(t,je.Z,de.get());return ia(r,i[0],i[1],i[2],0,s[0],s[1],s[2],0,n[0],n[1],n[2],0,0,0,0,1),r}headingAtPosition(t,r){const i=this.worldUpAtPosition(t,de.get()),s=this.worldBasisAtPosition(t,je.Y,de.get()),n=ya(r,s,i);return Ls(n)}intersectManifoldClosestSilhouette(t,r,i){return Ht(this._coordinateSystem,r,this._tmpCoordinateSystem),sc(this._tmpCoordinateSystem,t,i),i}intersectManifold(t,r,i){Ht(this._coordinateSystem,r,this._tmpCoordinateSystem);const s=de.get();return ic(this._tmpCoordinateSystem,t,s)?j(i,s):null}intersectInfiniteManifold(t,r,i){if(this.viewingMode===ne.Global)return this.intersectManifold(t,r,i);Ht(this._coordinateSystem,r,this._tmpCoordinateSystem);const s=this._tmpCoordinateSystem.value,n=de.get();return wa(s.plane,t,n)?j(i,n):null}toRenderCoords(t,r,i){return vi(t)?Ua(t,r,this.spatialReference):gt(t,r,i,this.spatialReference)}fromRenderCoords(t,r,i=null){return vi(r)?(i!=null&&(r.spatialReference=i),Yl(t,this.spatialReference,r)?r:null):gt(t,this.spatialReference,r,i)?r:null}static create(t,r){switch(t){case ne.Local:return new bt(ne.Local,r,Ns(r),ec());case ne.Global:return new bt(ne.Global,r,1,Kl(r))}}static renderUnitScaleFactor(t,r){return Ir(t)/Ir(r)}}class oc{constructor(t){this._tileFeatureData=new Map,this._context={viewSpatialReference:t.viewSpatialReference,renderSpatialReference:t.renderSpatialReference,renderCoordsHelper:bt.create(t.viewingMode,t.renderSpatialReference)}}async add(t,r){this._featureRenderer||(this._featureRenderer=new Wl(this._context),await this._featureRenderer.load());const i=this._addTileFeatureData(t);await this._featureRenderer.add(i,r)}async remove(t,r){const i=this._getFeatureSetFromTileId(t);i&&(this._featureRenderer&&this._featureRenderer.remove(i,r),this._removeTileFeatureData(t))}_getFeatureSetFromTileId(t){return this._tileFeatureData.get(t)}_addTileFeatureData(t){const r=t.descriptor.id,i=t.pages.reduce((n,{featureCount:a})=>n+a,0),s=new Zi(t,i);return this._tileFeatureData.set(r,s),s}_removeTileFeatureData(t){const r=this._tileFeatureData.get(t);r&&(r.dispose(),this._tileFeatureData.delete(t))}}let ut=class extends ar.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new Ya,this._tileManager=new fe({addTile:(e,t)=>this._addTile(e,t),removeTiles:e=>this._removeTiles(e)}),this._renderCommandContext=null,this._fetcher=null,this._symbolizer=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,baseQuery:i,url:s,objectIdField:n,capabilities:a,fieldsIndex:o,timeInfo:l}){this._renderCommandContext=new Fl({viewingMode:r,dispatchRenderCommandsCallback:(h,u)=>this.remoteClient.invoke("dispatchRenderCommands",h,{transferList:u})});const c=wr.fromJSON(e),d=wr.fromJSON(t);return this._fetcher=new ro(c,Cr.fromJSON(i),s,n,a),this._symbolizer=new oc({viewSpatialReference:c,renderSpatialReference:d,viewingMode:r}),this._queryEngine=new Gs({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:n,fieldsIndex:o,availableFields:[n],spatialReference:e,featureStore:this._featureStore,timeInfo:l}),this._defaultQueryJSON=new Cr({outSpatialReference:c}).toJSON(),this.addHandles(ns(()=>this.updating,async h=>{this.emit("notify-updating",{updating:h})}),as),yi}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),yi}async _addTile(e,t){const r=await this._fetcher.fetch(e,t);ve(t),this._featureStore.addTile(r);const i=this._renderCommandContext.createEncoder();return await this._symbolizer.add(r,i),await i.dispatch(),r}async _removeTiles(e){const t=this._renderCommandContext.createEncoder(),r=this._featureStore,i=this._symbolizer;for(const s of e)r.removeTile(s.tileId),await i.remove(s.tileId,t);await t.dispatch()}_ensureQuery(e){return e??this._defaultQueryJSON}};m([v()],ut.prototype,"updating",null),ut=m([K("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],ut);const lc=ut,yi={result:void 0},Zh=Object.freeze(Object.defineProperty({__proto__:null,default:lc},Symbol.toStringTag,{value:"Module"})),Kh=Object.freeze(Object.defineProperty({__proto__:null,build:sn},Symbol.toStringTag,{value:"Module"})),ed=Object.freeze(Object.defineProperty({__proto__:null,build:nn,getRadius:an},Symbol.toStringTag,{value:"Module"})),td=Object.freeze(Object.defineProperty({__proto__:null,build:on},Symbol.toStringTag,{value:"Module"})),rd=Object.freeze(Object.defineProperty({__proto__:null,build:ln},Symbol.toStringTag,{value:"Module"})),cc=Object.freeze(Object.defineProperty({__proto__:null,build:Wi,calculateAnchorPosForRendering:We,shaderSettings:gr},Symbol.toStringTag,{value:"Module"}));export{td as D,Zh as F,rd as R,Kh as S,ed as a}; diff --git a/main/assets/HeightModelInfo-C5vFqzyF-D9ss-Vrr.js b/main/assets/HeightModelInfo-C5vFqzyF-D9ss-Vrr.js deleted file mode 100644 index ee9e88867..000000000 --- a/main/assets/HeightModelInfo-C5vFqzyF-D9ss-Vrr.js +++ /dev/null @@ -1 +0,0 @@ -import{d2 as g,dk as p,v as s,S as h,ac as v,a0 as a,e as y,dl as m,dm as w,b0 as c,i as S}from"./main-BZaw9FpY.js";var n;const l=g()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),u=l.jsonValues.slice();p(u,"orthometric");const o=g()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let r=n=class extends y{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return l.write(e,t,i)}readHeightModel(e,t,i){return l.read(e)||(i?.messages&&i.messages.push(f(e,{context:i})),null)}readHeightUnit(e,t,i){return o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readHeightUnitService(e,t,i){return m(e)||o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new n({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=w(t);return new n({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new n;return t.read(e,{origin:"web-scene"}),t}};function d(e,t){return new c("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function f(e,t){return new c("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}s([h({type:l.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:u,default:"ellipsoidal"}}}})],r.prototype,"heightModel",void 0),s([v("web-scene","heightModel")],r.prototype,"writeHeightModel",null),s([a(["web-scene","service"],"heightModel")],r.prototype,"readHeightModel",null),s([h({type:o.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:o.jsonValues,write:o.write}}}})],r.prototype,"heightUnit",void 0),s([a("web-scene","heightUnit")],r.prototype,"readHeightUnit",null),s([a("service","heightUnit")],r.prototype,"readHeightUnitService",null),s([h({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],r.prototype,"vertCRS",void 0),s([a("service","vertCRS",["vertCRS","ellipsoid","geoid"])],r.prototype,"readVertCRS",null),r=n=s([S("esri.geometry.HeightModelInfo")],r);const U=r;export{U as M}; diff --git a/main/assets/HeightModelInfo-C5vFqzyF-DTZiz4z_.js b/main/assets/HeightModelInfo-C5vFqzyF-DTZiz4z_.js new file mode 100644 index 000000000..65570cb97 --- /dev/null +++ b/main/assets/HeightModelInfo-C5vFqzyF-DTZiz4z_.js @@ -0,0 +1 @@ +import{d2 as g,dk as p,v as s,S as h,ac as v,a0 as a,e as y,dl as m,dm as w,b0 as c,i as S}from"./main-C7yV2j71.js";var n;const l=g()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),u=l.jsonValues.slice();p(u,"orthometric");const o=g()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let r=n=class extends y{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return l.write(e,t,i)}readHeightModel(e,t,i){return l.read(e)||(i?.messages&&i.messages.push(f(e,{context:i})),null)}readHeightUnit(e,t,i){return o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readHeightUnitService(e,t,i){return m(e)||o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new n({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=w(t);return new n({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new n;return t.read(e,{origin:"web-scene"}),t}};function d(e,t){return new c("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function f(e,t){return new c("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}s([h({type:l.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:u,default:"ellipsoidal"}}}})],r.prototype,"heightModel",void 0),s([v("web-scene","heightModel")],r.prototype,"writeHeightModel",null),s([a(["web-scene","service"],"heightModel")],r.prototype,"readHeightModel",null),s([h({type:o.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:o.jsonValues,write:o.write}}}})],r.prototype,"heightUnit",void 0),s([a("web-scene","heightUnit")],r.prototype,"readHeightUnit",null),s([a("service","heightUnit")],r.prototype,"readHeightUnitService",null),s([h({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],r.prototype,"vertCRS",void 0),s([a("service","vertCRS",["vertCRS","ellipsoid","geoid"])],r.prototype,"readVertCRS",null),r=n=s([S("esri.geometry.HeightModelInfo")],r);const U=r;export{U as M}; diff --git a/main/assets/HighlightGraphicContainer-Dt5r6lMq-BNbDeHiI.js b/main/assets/HighlightGraphicContainer-Dt5r6lMq-BNbDeHiI.js new file mode 100644 index 000000000..a5baf31ee --- /dev/null +++ b/main/assets/HighlightGraphicContainer-Dt5r6lMq-BNbDeHiI.js @@ -0,0 +1 @@ +import{v as i,i as s}from"./main-C7yV2j71.js";import{E as a,h,R as n}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{K as l}from"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";let r=class extends l{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===a.HIGHLIGHT&&this.children.some(t=>t.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),h(e,!0,t=>{this._renderChildren(t,n.All)},0))}};r=i([s("esri.views.2d.layers.graphics.HighlightGraphicContainer")],r);const m=r;export{m as l}; diff --git a/main/assets/HighlightGraphicContainer-Dt5r6lMq-C0o3U8Y8.js b/main/assets/HighlightGraphicContainer-Dt5r6lMq-C0o3U8Y8.js deleted file mode 100644 index 610211474..000000000 --- a/main/assets/HighlightGraphicContainer-Dt5r6lMq-C0o3U8Y8.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,i as s}from"./main-BZaw9FpY.js";import{E as a,h,R as n}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{K as l}from"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";let r=class extends l{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===a.HIGHLIGHT&&this.children.some(t=>t.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),h(e,!0,t=>{this._renderChildren(t,n.All)},0))}};r=i([s("esri.views.2d.layers.graphics.HighlightGraphicContainer")],r);const m=r;export{m as l}; diff --git a/main/assets/I3SBinaryReader-DEbI3cKZ-D9EuM1ww.js b/main/assets/I3SBinaryReader-DEbI3cKZ-D9EuM1ww.js new file mode 100644 index 000000000..275995379 --- /dev/null +++ b/main/assets/I3SBinaryReader-DEbI3cKZ-D9EuM1ww.js @@ -0,0 +1,2 @@ +import{o as f,a1 as D,P as S}from"./main-C7yV2j71.js";import{T as U}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";const d=!0,m={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function z(t,e,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,r+m.identifierOffset,m.identifierLength)),version:e.getUint16(r+m.versionOffset,d),checksum:e.getUint32(r+m.checksumOffset,d)}}const y={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function k(t,e){return{sizeLo:t.getUint32(e+y.sizeLo,d),sizeHi:t.getUint32(e+y.sizeHi,d),minX:t.getFloat64(e+y.minX,d),minY:t.getFloat64(e+y.minY,d),minZ:t.getFloat64(e+y.minZ,d),maxX:t.getFloat64(e+y.maxX,d),maxY:t.getFloat64(e+y.maxY,d),maxZ:t.getFloat64(e+y.maxZ,d),errorX:t.getFloat64(e+y.errorX,d),errorY:t.getFloat64(e+y.errorY,d),errorZ:t.getFloat64(e+y.errorZ,d),count:t.getUint32(e+y.count,d),reserved:t.getUint32(e+y.reserved,d)}}function q(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="LEPCC ")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=k(e,r);if(r+=y.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),a=[],i=[],u=[],l=[];if(r=I(t,r,a),r=I(t,r,i),r=I(t,r,u),r=I(t,r,l),r!==t.byteLength)throw new f("lepcc-decode-error","Bad length");let g=0,w=0;for(let b=0;b>6;let i=0;if(a===0)i=c.getUint32(1,d),e+=5;else if(a===1)i=c.getUint16(1,d),e+=3;else{if(a!==2)throw new f("lepcc-decode-error","Bad count type");i=c.getUint8(1),e+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const u=Math.ceil(i*n/8),l=new Uint8Array(t,e,u);let g=0,w=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,w-=n,w+n>32&&(g|=l[b-1]>>8-w)}return e+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Y(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,d),sizeHi:t.getUint32(e+h.sizeHi,d),count:t.getUint32(e+h.count,d),colorMapCount:t.getUint16(e+h.colorMapCount,d),lookupMethod:t.getUint8(e+h.lookupMethod),compressionMethod:t.getUint8(e+h.compressionMethod)}}function V(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=Y(e,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==t.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(t,r,3*n.colorMapCount),a=new Uint8Array(t,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let u=0;u1)throw new f("lepcc-decode-error","Unknown version");const n=X(e,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const a=new Uint8Array(t,r,n.count);for(let i=0;iD.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function H(t,e,r){let c="",o=0;for(;o=192&&n<224){if(o+1>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const s=(31&n)<<6|63&t[e+o+1];c+=String.fromCharCode(s),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(15&n)<<12|(63&t[e+o+1])<<6|63&t[e+o+2];c+=String.fromCharCode(s),o+=3}else{if(!(n>=240&&n<248))throw new f("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(7&n)<<18|(63&t[e+o+1])<<12|(63&t[e+o+2])<<6|63&t[e+o+3];if(s>=65536){const a=55296+(s-65536>>10),i=56320+(1023&s);c+=String.fromCharCode(a,i)}else c+=String.fromCharCode(s);o+=4}}}return c}function B(t,e){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o==null||Number.isNaN(o)?null:o})}function T(t,e,r){const c=[];let o,n,s=0;for(n=0;n0){if(c.push(H(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else c.push(null);s+=o}return c}function F(t,e){return new L[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function j(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function R(t,e,r){const c=e.header!=null?B(t,e.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let s=0;snew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function P(t){return L.hasOwnProperty(t)}function A(t){return P(t)?L[t].BYTES_PER_ELEMENT:0}export{J as $,F,K as G,q as Y}; diff --git a/main/assets/I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js b/main/assets/I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js deleted file mode 100644 index 74197f695..000000000 --- a/main/assets/I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js +++ /dev/null @@ -1,2 +0,0 @@ -import{o as f,a1 as D,P as S}from"./main-BZaw9FpY.js";import{T as U}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";const d=!0,m={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function z(t,e,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,r+m.identifierOffset,m.identifierLength)),version:e.getUint16(r+m.versionOffset,d),checksum:e.getUint32(r+m.checksumOffset,d)}}const y={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function k(t,e){return{sizeLo:t.getUint32(e+y.sizeLo,d),sizeHi:t.getUint32(e+y.sizeHi,d),minX:t.getFloat64(e+y.minX,d),minY:t.getFloat64(e+y.minY,d),minZ:t.getFloat64(e+y.minZ,d),maxX:t.getFloat64(e+y.maxX,d),maxY:t.getFloat64(e+y.maxY,d),maxZ:t.getFloat64(e+y.maxZ,d),errorX:t.getFloat64(e+y.errorX,d),errorY:t.getFloat64(e+y.errorY,d),errorZ:t.getFloat64(e+y.errorZ,d),count:t.getUint32(e+y.count,d),reserved:t.getUint32(e+y.reserved,d)}}function q(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="LEPCC ")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=k(e,r);if(r+=y.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),a=[],i=[],u=[],l=[];if(r=I(t,r,a),r=I(t,r,i),r=I(t,r,u),r=I(t,r,l),r!==t.byteLength)throw new f("lepcc-decode-error","Bad length");let g=0,w=0;for(let b=0;b>6;let i=0;if(a===0)i=c.getUint32(1,d),e+=5;else if(a===1)i=c.getUint16(1,d),e+=3;else{if(a!==2)throw new f("lepcc-decode-error","Bad count type");i=c.getUint8(1),e+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const u=Math.ceil(i*n/8),l=new Uint8Array(t,e,u);let g=0,w=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,w-=n,w+n>32&&(g|=l[b-1]>>8-w)}return e+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Y(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,d),sizeHi:t.getUint32(e+h.sizeHi,d),count:t.getUint32(e+h.count,d),colorMapCount:t.getUint16(e+h.colorMapCount,d),lookupMethod:t.getUint8(e+h.lookupMethod),compressionMethod:t.getUint8(e+h.compressionMethod)}}function V(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=Y(e,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==t.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(t,r,3*n.colorMapCount),a=new Uint8Array(t,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let u=0;u1)throw new f("lepcc-decode-error","Unknown version");const n=X(e,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const a=new Uint8Array(t,r,n.count);for(let i=0;iD.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function H(t,e,r){let c="",o=0;for(;o=192&&n<224){if(o+1>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const s=(31&n)<<6|63&t[e+o+1];c+=String.fromCharCode(s),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(15&n)<<12|(63&t[e+o+1])<<6|63&t[e+o+2];c+=String.fromCharCode(s),o+=3}else{if(!(n>=240&&n<248))throw new f("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(7&n)<<18|(63&t[e+o+1])<<12|(63&t[e+o+2])<<6|63&t[e+o+3];if(s>=65536){const a=55296+(s-65536>>10),i=56320+(1023&s);c+=String.fromCharCode(a,i)}else c+=String.fromCharCode(s);o+=4}}}return c}function B(t,e){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o==null||Number.isNaN(o)?null:o})}function T(t,e,r){const c=[];let o,n,s=0;for(n=0;n0){if(c.push(H(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else c.push(null);s+=o}return c}function F(t,e){return new L[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function j(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function R(t,e,r){const c=e.header!=null?B(t,e.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let s=0;snew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function P(t){return L.hasOwnProperty(t)}function A(t){return P(t)?L[t].BYTES_PER_ELEMENT:0}export{J as $,F,K as G,q as Y}; diff --git a/main/assets/I3SLayerDefinitions-CwLXCKtU-DIMh5lHL.js b/main/assets/I3SLayerDefinitions-CwLXCKtU-DIMh5lHL.js deleted file mode 100644 index 02a373408..000000000 --- a/main/assets/I3SLayerDefinitions-CwLXCKtU-DIMh5lHL.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as t,i,bz as l,e as p}from"./main-BZaw9FpY.js";let y=class extends p{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],y.prototype,"nodesPerPage",void 0),e([t({type:Number})],y.prototype,"rootIndex",void 0),e([t({type:String})],y.prototype,"lodSelectionMetricType",void 0),y=e([i("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],y);let n=class extends p{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],n.prototype,"id",void 0),e([t({type:Number})],n.prototype,"factor",void 0),n=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],n);let a=class extends p{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],a.prototype,"baseColorFactor",void 0),e([t({type:n})],a.prototype,"baseColorTexture",void 0),e([t({type:n})],a.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],a.prototype,"metallicFactor",void 0),e([t({type:Number})],a.prototype,"roughnessFactor",void 0),a=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],a);let o=class extends p{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([l({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([l({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:n})],o.prototype,"normalTexture",void 0),e([t({type:n})],o.prototype,"occlusionTexture",void 0),e([t({type:n})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:a})],o.prototype,"pbrMetallicRoughness",void 0),o=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],o);let u=class extends p{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,f)=>v??`${f.index}`}}})],u.prototype,"name",void 0),e([l({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],u.prototype,"format",void 0),u=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],u);let c=class extends p{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[u]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],c);let s=class extends p{};e([l({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],s.prototype,"type",void 0),e([t({type:Number})],s.prototype,"component",void 0),s=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],s);let d=class extends p{};e([l({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],d);let r=class extends p{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:s})],r.prototype,"position",void 0),e([t({type:s})],r.prototype,"normal",void 0),e([t({type:s})],r.prototype,"uv0",void 0),e([t({type:s})],r.prototype,"color",void 0),e([t({type:s})],r.prototype,"uvRegion",void 0),e([t({type:s})],r.prototype,"featureId",void 0),e([t({type:s})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],r);let m=class extends p{};e([l({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],m);export{c as d,m,o,y}; diff --git a/main/assets/I3SLayerDefinitions-CwLXCKtU-DliEVqX4.js b/main/assets/I3SLayerDefinitions-CwLXCKtU-DliEVqX4.js new file mode 100644 index 000000000..a6e745a54 --- /dev/null +++ b/main/assets/I3SLayerDefinitions-CwLXCKtU-DliEVqX4.js @@ -0,0 +1 @@ +import{v as e,S as t,i,bz as l,e as p}from"./main-C7yV2j71.js";let y=class extends p{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],y.prototype,"nodesPerPage",void 0),e([t({type:Number})],y.prototype,"rootIndex",void 0),e([t({type:String})],y.prototype,"lodSelectionMetricType",void 0),y=e([i("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],y);let n=class extends p{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],n.prototype,"id",void 0),e([t({type:Number})],n.prototype,"factor",void 0),n=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],n);let a=class extends p{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],a.prototype,"baseColorFactor",void 0),e([t({type:n})],a.prototype,"baseColorTexture",void 0),e([t({type:n})],a.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],a.prototype,"metallicFactor",void 0),e([t({type:Number})],a.prototype,"roughnessFactor",void 0),a=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],a);let o=class extends p{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([l({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([l({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:n})],o.prototype,"normalTexture",void 0),e([t({type:n})],o.prototype,"occlusionTexture",void 0),e([t({type:n})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:a})],o.prototype,"pbrMetallicRoughness",void 0),o=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],o);let u=class extends p{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,f)=>v??`${f.index}`}}})],u.prototype,"name",void 0),e([l({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],u.prototype,"format",void 0),u=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],u);let c=class extends p{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[u]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],c);let s=class extends p{};e([l({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],s.prototype,"type",void 0),e([t({type:Number})],s.prototype,"component",void 0),s=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],s);let d=class extends p{};e([l({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],d);let r=class extends p{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:s})],r.prototype,"position",void 0),e([t({type:s})],r.prototype,"normal",void 0),e([t({type:s})],r.prototype,"uv0",void 0),e([t({type:s})],r.prototype,"color",void 0),e([t({type:s})],r.prototype,"uvRegion",void 0),e([t({type:s})],r.prototype,"featureId",void 0),e([t({type:s})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],r);let m=class extends p{};e([l({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],m);export{c as d,m,o,y}; diff --git a/main/assets/I3SUtil-Bq8KpP2j-B88-rKNw.js b/main/assets/I3SUtil-Bq8KpP2j-B88-rKNw.js deleted file mode 100644 index 6c44e2c82..000000000 --- a/main/assets/I3SUtil-Bq8KpP2j-B88-rKNw.js +++ /dev/null @@ -1 +0,0 @@ -import{bh as s,f as C,ia as y,ib as A}from"./main-BZaw9FpY.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./projectVectorToVector-sIYLNlex-CXXu_lyF.js";import"./sphere-BenPORjV-CgNvGf8s.js";import"./Query-BrwMGK8U-sojFdYaD.js";import{G as d}from"./I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js";import{e as h}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./NormalAttribute.glsl-axtNsUxo-corrAl_5.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{i as g}from"./orientedBoundingBox-oHezdpWm-CdJ2bdTT.js";var o;(function(t){t[t.TRANSPARENT=0]="TRANSPARENT",t[t.OPAQUE=1]="OPAQUE"})(o||(o={}));var u;(function(t){t[t.Uniform=0]="Uniform",t[t.Varying=1]="Varying",t[t.COUNT=2]="COUNT"})(u||(u={}));var f,S;(function(t){t[t.Solid=0]="Solid",t[t.Sketch=1]="Sketch",t[t.Mixed=2]="Mixed",t[t.COUNT=3]="COUNT"})(f||(f={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.SILHOUETTE=1]="SILHOUETTE"}(S||(S={}));function D(t){return{...P,...t,type:f.Solid}}const P={color:h(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:o.OPAQUE,hasSlicePlane:!1};o.OPAQUE,s();var m;async function K(t,a,n,p,I,N,U,R){const E=[];for(const r of a)if(r&&I.includes(r.name)){const i=`${t}/nodes/${n}/attributes/${r.key}/0`;E.push({url:i,storageInfo:r})}const c=await Promise.allSettled(E.map(r=>C(r.url,{responseType:"array-buffer",query:{...U,token:N},signal:R?.signal}).then(i=>d(r.storageInfo,i.data)))),T=[];for(const r of p){const i={};for(let e=0;eC(r.url,{responseType:"array-buffer",query:{...U,token:N},signal:R?.signal}).then(i=>d(r.storageInfo,i.data)))),T=[];for(const r of p){const i={};for(let e=0;ei.map(i=>d[i]); +import{v as u,S as _,i as z,I as ne,M as ae,z as ue,e as he,a as $,b as E,E as C,o as A,x as pe,s as R,c as b,f as P,u as j,T as H,L as F,X as ee,H as _e,Z as te,C as J,k as fe,A as ge,N,Y as se,y as me,V,_ as D}from"./main-C7yV2j71.js";import{_ as re,R as ve,k as we,P as O,x as Se,X as Ie}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{b as ye}from"./substitute-j49H6mVR-BNTkzCQd.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const W="esri-identity-modal",G={base:W,info:`${W}__info`,notice:`${W}__notice`},ke="ArcGIS Online";let T=class extends ve{constructor(d,e){super(d,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return we({button:()=>D(()=>import("./calcite-button-Cm9_TJei-CW2FD2Xf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),dialog:()=>D(()=>import("./calcite-dialog-DAngwHC1-DKYOLeFn.js"),__vite__mapDeps([18,1,2,3,4,6,19,17,12,10,20,7,11,13,9,14,15,16,21,22,23,24,25,26]),import.meta.url),input:()=>D(()=>import("./calcite-input-BKRd7MCS-DmQD4QYo.js"),__vite__mapDeps([27,28,1,2,3,4,6,5,7,12,8,9,10,11,13,14,15]),import.meta.url),label:()=>D(()=>import("./calcite-label-DMj3M4QR-C9p7ZdtQ.js"),__vite__mapDeps([29,1,2,3,4,8,6,9]),import.meta.url),notice:()=>D(()=>import("./calcite-notice-DeAGopAs-Cw8GCh9D.js"),__vite__mapDeps([30,1,2,3,4,31,13,6,10,11,12,14,23,9,15]),import.meta.url)})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:d,title:e,messages:s,signingIn:t,oAuthPrompt:r,server:i,resource:n,error:h}=this,{info:p,oAuthInfo:o,lblItem:l,invalidUser:c,noAuthService:a,lblUser:f,lblPwd:g,lblCancel:v,lblSigning:w,lblOk:k}=s;return O("div",{class:this.classes(G.base,Se())},O("form",{bind:this,onsubmit:this._submit},O("calcite-dialog",{bind:this,heading:e,modal:!0,open:d,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},O("div",{class:G.info},ye(r?o:p,{server:i&&/\.arcgis\.com/i.test(i)?ke:i,resource:`(${n||l})`})),h?O("calcite-notice",{class:G.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},O("div",{slot:"message"},h.details?.httpStatus?c:a)):null,r?null:[O("calcite-label",null,f,O("calcite-input",{afterCreate:m=>this._usernameInputNode=m,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),O("calcite-label",null,g,O("calcite-input",{afterCreate:m=>this._passwordInputNode=m,bind:this,name:"password",required:!0,type:"password",value:""}))],O("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},v),O("calcite-button",{loading:!!t,slot:"footer-end",type:"submit"},t?w:k))))}_focusUsernameInput(){return Ie(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(d){d.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",e)}};u([_({readOnly:!0})],T.prototype,"container",void 0),u([_(),re("esri/t9n/common")],T.prototype,"commonMessages",void 0),u([_()],T.prototype,"error",void 0),u([_(),re("esri/identity/t9n/identity")],T.prototype,"messages",void 0),u([_()],T.prototype,"oAuthPrompt",void 0),u([_()],T.prototype,"open",void 0),u([_()],T.prototype,"signingIn",void 0),u([_()],T.prototype,"server",void 0),u([_({readOnly:!0})],T.prototype,"title",null),u([_()],T.prototype,"resource",void 0),T=u([z("esri.identity.IdentityModal")],T);const ie=T,X="esriJSAPIOAuth";class K{constructor(e,s){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=s,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const s=Date.now();this.expires>s&&(this.expires-s)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t||(t=e[s.authNamespace]={}),this.appId||(this.appId=s.appId),t[s.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(X,JSON.stringify(e))}catch(r){return console.warn(r),!1}return!0}return!1}destroy(){const e=this._load(),s=this.oAuthInfo;if(s?.appId&&s?.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const t=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",s.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(t,r);else{const i=new XMLHttpRequest;i.open("POST",t),i.send(r)}}if(s?.authNamespace&&s.portalUrl&&this.storage){const t=e[s.authNamespace];if(t){delete t[s.portalUrl];try{this.storage.setItem(X,JSON.stringify(e))}catch(r){console.log(r)}}}s&&(s._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t&&(t=t[s.portalUrl],t&&(this.appId=t.appId,this.codeVerifier=t.codeVerifier,this.expires=t.expires,this.refreshToken=t.refreshToken,this.ssl=t.ssl,this.stateUID=t.stateUID,this.token=t.token,this.userId=t.userId))}}_load(){let e={};if(this.storage){const s=this.storage.getItem(X);if(s)try{e=JSON.parse(s)}catch(t){console.warn(t)}}return e}}K.prototype.declaredClass="esri.identity.OAuthCredential";var Q;let U=Q=class extends he{constructor(d){super(d),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Q.fromJSON(this.toJSON())}};u([_({json:{write:!0}})],U.prototype,"appId",void 0),u([_({json:{write:!0}})],U.prototype,"authNamespace",void 0),u([_({json:{write:!0}})],U.prototype,"expiration",void 0),u([_({json:{write:!0}})],U.prototype,"flowType",void 0),u([_({json:{write:!0}})],U.prototype,"forceLogin",void 0),u([_({json:{write:!0}})],U.prototype,"forceUserId",void 0),u([_({json:{write:!0}})],U.prototype,"locale",void 0),u([_({json:{write:!0}})],U.prototype,"minTimeUntilExpiration",void 0),u([_({json:{write:!0}})],U.prototype,"popup",void 0),u([_({json:{write:!0}})],U.prototype,"popupCallbackUrl",void 0),u([_({json:{write:!0}})],U.prototype,"popupWindowFeatures",void 0),u([_({json:{write:!0}})],U.prototype,"portalUrl",void 0),u([_({json:{write:!0}})],U.prototype,"preserveUrlHash",void 0),u([_({json:{write:!0}})],U.prototype,"userId",void 0),U=Q=u([z("esri.identity.OAuthInfo")],U);const oe=U;let x=class extends he{constructor(d){super(d),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};u([_({json:{write:!0}})],x.prototype,"adminTokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"currentVersion",void 0),u([_({json:{write:!0}})],x.prototype,"hasPortal",void 0),u([_({json:{write:!0}})],x.prototype,"hasServer",void 0),u([_({json:{write:!0}})],x.prototype,"owningSystemUrl",void 0),u([_({json:{write:!0}})],x.prototype,"owningTenant",void 0),u([_({json:{write:!0}})],x.prototype,"server",void 0),u([_({json:{write:!0}})],x.prototype,"shortLivedTokenValidity",void 0),u([_({json:{write:!0}})],x.prototype,"tokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"webTierAuth",void 0),x=u([z("esri.identity.ServerInfo")],x);const Y=x,L={},le=d=>{const e=new b(d.owningSystemUrl).host,s=new b(d.server).host,t=/.+\.arcgis\.com$/i;return t.test(e)&&t.test(s)},Z=(d,e)=>!!(le(d)&&e&&e.some(s=>s.test(d.server)));let M=null,B=null;try{M=window.localStorage,B=window.sessionStorage}catch{}class ce extends ne{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=$(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const s=this.serverInfos;s?(e=e.filter(t=>!this.findServerInfo(t.server)),this.serverInfos=s.concat(e)):this.serverInfos=e,e.forEach(t=>{t.owningSystemUrl&&this._portals.push(t.owningSystemUrl),t.hasPortal&&this._portals.push(t.server)})}registerOAuthInfos(e){const s=this.oAuthInfos;if(s){for(const t of e){const r=this.findOAuthInfo(t.portalUrl);r&&s.splice(s.indexOf(r),1)}this.oAuthInfos=s.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const s=this._sanitizeUrl(e.server),t=this._isServerRsrc(s);let r,i=this.findServerInfo(s),n=!0;i||(i=new Y,i.server=this._getServerInstanceRoot(s),t?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(s),i.hasPortal=!0),this.registerServers([i])),r=this._findCredential(s),r?(delete e.server,Object.assign(r,e),n=!1):(r=new I({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:t?"server":"portal"}),r.resources=[s],this.credentials.push(r)),r.emitTokenChange(!1),n||r.refreshServerTokens()}toJSON(){return ae({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const s=e.serverInfos,t=e.oAuthInfos,r=e.credentials;if(s){const i=[];s.forEach(n=>{n.server&&n.tokenServiceUrl&&i.push(n.declaredClass?n:new Y(n))}),i.length&&this.registerServers(i)}if(t){const i=[];t.forEach(n=>{n.appId&&i.push(n.declaredClass?n:new oe(n))}),i.length&&this.registerOAuthInfos(i)}r&&r.forEach(i=>{i.server&&i.token&&i.expires&&i.expires>Date.now()&&((i=i.declaredClass?i:new I(i)).emitTokenChange(),this.credentials.push(i))})}findServerInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.serverInfos)if(this._hasSameServerInstance(t.server,e)){s=t;break}return s}findOAuthInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.oAuthInfos)if(this._hasSameServerInstance(t.portalUrl,e)){s=t;break}return s}findCredential(e,s){if(!e)return;let t;e=this._sanitizeUrl(e);const r=this._isServerRsrc(e)?"server":"portal";if(s){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&s===i.userId&&i.scope===r){t=i;break}}else for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&this._getIdenticalSvcIdx(e,i)!==-1&&i.scope===r){t=i;break}return t}getCredential(e,s){let t,r,i=!0;s&&(t=!!s.token,r=s.error,i=s.prompt!==!1),s={...s},e=this._sanitizeUrl(e);const n=new AbortController,h=E();if(s.signal&&C(s.signal,()=>{n.abort()}),C(n,()=>{h.reject(new A("identity-manager:user-aborted","ABORTED"))}),pe(n))return h.promise;s.signal=n.signal;const p=this._isAdminResource(e),o=t?this.findCredential(e):null;let l;if(o&&r&&r.details&&r.details.httpStatus===498)o.destroy();else if(o)return l=new A("identity-manager:not-authorized","You are currently signed in as: '"+o.userId+"'. You do not have access to this resource: "+e,{error:r}),h.reject(l),h.promise;const c=this._findCredential(e,s);if(c)return h.resolve(c),h.promise;let a=this.findServerInfo(e);if(a)!a.hasPortal&&a.server&&a.owningSystemUrl&&this._hasSameServerInstance(a.server,a.owningSystemUrl)&&(a.hasPortal=!0),!a.hasServer&&this._isServerRsrc(e)&&(a._restInfoPms=this._getTokenSvcUrl(e),a.hasServer=!0);else{const f=this._getTokenSvcUrl(e);if(!f)return l=new A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),h.reject(l),h.promise;a=new Y,a.server=this._getServerInstanceRoot(e),typeof f=="string"?(a.tokenServiceUrl=f,a.hasPortal=!0):(a._restInfoPms=f,a.hasServer=!0),this.registerServers([a])}return a.hasPortal&&a._selfReq===void 0&&(i||R(a.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(f=>f.tokenServiceUrl===a.tokenServiceUrl))&&(a._selfReq={owningTenant:s?.owningTenant,selfDfd:this._getPortalSelf(a.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,a,s,h,p)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,s,t){const r=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new b(this._appOrigin),n=e.shortLivedTokenValidity;let h,p,o,l,c,a,f,g;s&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),t&&(h=t.isAdmin,p=t.serverUrl,o=t.token,a=t.signal,f=t.ssl,e.customParameters=t.customParameters),h?l=e.adminTokenServiceUrl:(l=e.tokenServiceUrl,c=new b(l.toLowerCase()),e.webTierAuth&&t?.serverUrl&&!f&&i.scheme==="http"&&(R(i.uri,l,!0)||c.scheme==="https"&&i.host===c.host&&i.port==="7080"&&c.port==="7443")&&(l=l.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:s?.username,password:s?.password,serverUrl:p,token:o,expiration:g,referer:h||r?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,t),signal:a,...t?.ioArgs};return r||(v.withCredentials=!1),P(l,v).then(w=>{const k=w.data;if(!k?.token)return new A("identity-manager:authentication-failed","Unable to generate token");const m=e.server;return L[m]||(L[m]={}),s&&(L[m][s.username]=s.password),k.validity=g,k})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,s,t){let r=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let n;const h={f:"json"};if(i.scope==="portal")if(s&&(this._doPortalSignIn(e)||t?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=s;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(h.token=i.token),P(n,{query:h,authMode:"anonymous"}).then(p=>{if(p.data.valid===!1)throw new A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,p.data);return r=!!p.data.viewOnlyUserTypeApp,{credential:i}}).catch(p=>{if(p.name==="identity-manager:not-authorized")throw p;const o=p.details?.httpStatus;if(o===498)throw i.destroy(),new A("identity-manager:not-authenticated","User is not signed in.");if(o===400)throw new A("identity-manager:invalid-request");return{credential:i}})}).then(i=>({credential:i.credential,viewOnly:r}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,s,t={}){const r=E(),i=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=p=o=null},n=()=>{i(),this._oAuthDfd=null,r.reject(new A("identity-manager:user-aborted","ABORTED"))};t.signal&&C(t.signal,()=>{n()});const h=new ie({open:!0,resource:this.getResourceName(e),server:s.server});this.dialog=h,this.emit("dialog-create");let p=h.on("cancel",n),o=h.on("submit",l=>{this.generateToken(s,l,{isAdmin:t.isAdmin,signal:t.signal}).then(c=>{i();const a=new I({userId:l.username,server:s.server??void 0,token:c.token,expires:c.expires!=null?Number(c.expires):null,ssl:!!c.ssl,isAdmin:t.isAdmin,validity:c.validity});r.resolve(a)}).catch(c=>{h.error=c,h.signingIn=!1})});return r.promise}oAuthSignIn(e,s,t,r){this._oAuthDfd=E();const i=this._oAuthDfd;let n;r?.signal&&C(r.signal,()=>{const a=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;a&&!a.closed?a.close():this.dialog&&l()}),i.resUrl_=e,i.sinfo_=s,i.oinfo_=t;const h=t._oAuthCred;if(h.storage&&(t.flowType==="authorization-code"||t.flowType==="auto"&&s.currentVersion>=8.4)){let a=crypto.getRandomValues(new Uint8Array(32));n=H(a),h.codeVerifier=n,a=crypto.getRandomValues(new Uint8Array(32)),h.stateUID=H(a),h.save()||(h.codeVerifier=n=null)}else h.codeVerifier=null;let p,o;this._getCodeChallenge(n).then(a=>{const f=!r||r.oAuthPopupConfirmation!==!1;if(!t.popup||!f)return void this._doOAuthSignIn(e,s,t,a);const g=new ie({oAuthPrompt:!0,server:s.server,open:!0});this.dialog=g,this.emit("dialog-create"),p=g.on("cancel",l),o=g.on("submit",()=>{c(),this._doOAuthSignIn(e,s,t,a)})});const l=()=>{c(),this._oAuthDfd=null,i.reject(new A("identity-manager:user-aborted","ABORTED"))},c=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=F(window,"message",s=>{if((s.origin===this._appOrigin||s.origin.endsWith(".arcgis.com"))&&s.data?.type==="arcgis:auth:requestCredential"){const t=s.source;this.getCredential(e).then(r=>{t.postMessage({type:"arcgis:auth:credential",credential:{expires:r.expires,server:r.server,ssl:r.ssl,token:r.token,userId:r.userId}},s.origin)}).catch(r=>{t.postMessage({type:"arcgis:auth:error",error:{name:r.name,message:r.message}},s.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.slice(1));const t=j(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let s=window.location.search;if(s){s.charAt(0)==="?"&&(s=s.slice(1));const t=j(s);let r=!1;if(t.code&&t.state)try{t.state=JSON.parse(t.state),t.state.portalUrl&&t.state.uid&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}if(r){const i={...t};["code","error","error_description","message_code","persist","state"].forEach(p=>{delete i[p]});const n=ee(i),h=window.location.pathname+(n?`?${n}`:"")+(t.state?.hash||"");window.history.replaceState(window.history.state,"",h)}}}_getOAuthToken(e,s,t,r,i){return e=e.replace(/^http:/i,"https:"),P(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:r&&i?{grant_type:"authorization_code",code:s,redirect_uri:r,client_id:t,code_verifier:i}:{grant_type:"refresh_token",refresh_token:s,client_id:t}}).then(n=>n.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const s=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-256",s);return H(new Uint8Array(t))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const s=new A("identity-manager:user-aborted","ABORTED");this._errbackFunc(s)}}_findCredential(e,s){let t,r,i,n,h=-1;const p=s?.token,o=s?.resource,l=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter(a=>this._hasSameServerInstance(a.server,e)&&a.scope===l);if(e=o||e,c.length)if(c.length===1){if(t=c[0],i=this.findServerInfo(t.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,t.userId):void 0,h=this._getIdenticalSvcIdx(e,t),!p)return h===-1&&t.resources.push(e),this._addResource(e,n),t;h!==-1&&(t.resources.splice(h,1),this._removeResource(e,n))}else{let a,f;if(c.some(g=>(f=this._getIdenticalSvcIdx(e,g),f!==-1&&(a=g,i=this.findServerInfo(a.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,a.userId):void 0,h=f,!0))),p)a&&(a.resources.splice(h,1),this._removeResource(e,n));else if(a)return this._addResource(e,n),a}}_findOAuthInfo(e){let s=this.findOAuthInfo(e);if(!s){for(const t of this.oAuthInfos)if(this._isIdProvider(t.portalUrl,e)){s=t;break}}return s}_addResource(e,s){s&&this._getIdenticalSvcIdx(e,s)===-1&&s.resources.push(e)}_removeResource(e,s){let t=-1;s&&(t=this._getIdenticalSvcIdx(e,s),t>-1&&s.resources.splice(t,1))}_useProxy(e,s){return s?.isAdmin&&!R(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!R(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const s=new b(e);return s.scheme+"://"+s.host+(s.port!=null?":"+s.port:"")}_getServerInstanceRoot(e){const s=e.toLowerCase();let t=s.indexOf(this._agsRest);return t===-1&&this._isAdminResource(e)&&(t=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),t!==-1||_e(s)||(t=s.indexOf("/sharing")),t===-1&&s.endsWith("/")&&(t=s.length-1),t>-1?e.slice(0,t):e}_hasSameServerInstance(e,s){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),s=this._getServerInstanceRoot(s).toLowerCase(),e=te(e),s=te(s),(e=e.slice(Math.max(0,e.indexOf(":"))))===(s=s.slice(Math.max(0,s.indexOf(":"))))}_sanitizeUrl(e){const s=(J.request.proxyUrl||"").toLowerCase(),t=s?e.toLowerCase().indexOf(s+"?"):-1;return t!==-1&&(e=e.slice(t+s.length+1)),e=fe(e),$(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,s){let t=!1;if(this._isRESTService(e)&&this._isRESTService(s)){const r=this._getSuffix(e).toLowerCase(),i=this._getSuffix(s).toLowerCase();if(t=r===i,!t){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;t=r.replaceAll(n,"$1")===i.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(s)?t=!0:this._isServerRsrc(e)||this._isServerRsrc(s)||!this._isPortalDomain(e)||(t=!0);return t}_isPortalDomain(e){const s=new b(e.toLowerCase()),t=this._portalConfig;let r=this._gwDomains.some(i=>i.regex.test(s.uri));return!r&&t&&(r=this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),s.uri)),r||J.portalUrl&&(r=R(s,J.portalUrl,!0)),r||(r=this._portals.some(i=>this._hasSameServerInstance(i,s.uri))),r=r||this._agsPortal.test(s.path),r}_isIdProvider(e,s){let t=-1,r=-1;this._gwDomains.forEach((n,h)=>{t===-1&&n.regex.test(e)&&(t=h),r===-1&&n.regex.test(s)&&(r=h)});let i=!1;if(t>-1&&r>-1&&(t===0||t===4?r!==0&&r!==4||(i=!0):t===1?r!==1&&r!==2||(i=!0):t===2?r===2&&(i=!0):t===3&&r===3&&(i=!0)),!i){const n=this.findServerInfo(s),h=n?.owningSystemUrl;h&&le(n)&&this._isPortalDomain(h)&&this._isIdProvider(e,h)&&(i=!0)}return i}_getIdenticalSvcIdx(e,s){let t=-1;for(let r=0;rn.data),{adminUrl:s,promise:t}}if(this._isPortalDomain(e)){let i="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(i=n.tokenServiceUrl),!!i)),i||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(i=n+this._gwTokenUrl),!!i)),i||(r=e.toLowerCase().indexOf("/sharing"),r!==-1&&(i=e.slice(0,r)+this._gwTokenUrl)),i||(i=this._getOrigin(e)+this._gwTokenUrl),i){const n=new b(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(i=i.replace(/:7080/i,":7443")),i=i.replace(/http:/i,"https:")}return i}}_processOAuthResponseParams(e,s,t){const r=s._oAuthCred;if(e.code){const n=r.codeVerifier;return r.codeVerifier=null,r.stateUID=null,r.save(),this._getOAuthToken(t.server,e.code,s.appId,this._getRedirectURI(s,!0),n).then(h=>{const p=new I({userId:h.username,server:t.server??void 0,token:h.access_token,expires:Date.now()+1e3*h.expires_in,ssl:h.ssl,oAuthState:e.state,_oAuthCred:r});return s.userId=p.userId,r.storage=h.persist?M:B,r.refreshToken=h.refresh_token,r.token=null,r.expires=h.refresh_token_expires_in?Date.now()+1e3*h.refresh_token_expires_in:null,r.userId=p.userId,r.ssl=p.ssl,r.save(),p})}const i=new I({userId:e.username,server:t.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:r});return s.userId=i.userId,r.storage=e.persist?M:B,r.refreshToken=null,r.token=i.token,r.expires=i.expires,r.userId=i.userId,r.ssl=i.ssl,r.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const s=this._oAuthDfd;if(this._oAuthDfd=null,s)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const t=e.error==="access_denied",r=new A(t?"identity-manager:user-aborted":"identity-manager:authentication-failed",t?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);s.reject(r)}else this._processOAuthResponseParams(e,s.oinfo_,s.sinfo_).then(t=>{s.resolve(t)}).catch(t=>{s.reject(t)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}async _exchangeToken(e,s,t){return(await P(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:s,token:t}})).data.token}async _getPlatformSelf(e,s){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const t=await P(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":s,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,t.data}catch(t){throw t.details?.messageCode==="OAUTH_0066"&&(this._getPlatformSelfError=[t,Date.now()]),t}}_getPortalSelf(e,s){let t;return this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.customBaseUrl),!!t)),t?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:t,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(s)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),P(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(r=>r.data))}_doPortalSignIn(e){const s=this._portalConfig,t=window.location.href,r=this.findServerInfo(e);return!(!s&&!this._isPortalDomain(t)||!(r?r.hasPortal||r.owningSystemUrl&&this._isPortalDomain(r.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(t,e)||s&&(this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),e)||this._isIdProvider(s.restBaseUrl,e))||R(t,e,!0)))}_checkProtocol(e,s,t,r){let i=!0;const n=r?s.adminTokenServiceUrl:s.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&ge(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:s}),!i)&&t(new A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,s,t,r,i,n){return r||(r=E()),r.resUrl_=e,r.sinfo_=s,r.options_=t,r.admin_=i,r.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(r)):this._xoReqs.push(r):this._doSignIn(r),r.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const s=o=>{const l=e.options_?.resource,c=e.resUrl_,a=e.refresh_;let f=!1;this.credentials.includes(o)||(a&&this.credentials.includes(a)?(a.userId=o.userId,a.token=o.token,a.expires=o.expires,a.validity=o.validity,a.ssl=o.ssl,a.creationTime=o.creationTime,f=!0,o=a):this.credentials.push(o)),o.resources||(o.resources=[]),o.resources.includes(l||c)||o.resources.push(l||c),o.scope=this._isServerRsrc(c)?"server":"portal",o.emitTokenChange();const g=this._soReqs,v={};this._soReqs=[],g.forEach(w=>{if(!this._isIdenticalService(c,w.resUrl_)){const k=this._getSuffix(w.resUrl_);v[k]||(v[k]=!0,o.resources.push(w.resUrl_))}}),e.resolve(o),g.forEach(w=>{this._hasSameServerInstance(this._getServerInstanceRoot(c),w.resUrl_)?w.resolve(o):this._soReqs.push(w)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,f||this.emit("credential-create",{credential:o}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},t=o=>{e.reject(o),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=(o,l,c,a)=>{const f=e.sinfo_,g=!e.options_||e.options_.prompt!==!1,v=f.hasPortal&&this._findOAuthInfo(e.resUrl_);let w,k;if(o)s(new I({userId:o,server:f.server??void 0,token:c??void 0,expires:a!=null?Number(a):null,ssl:!!l}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const m=F(window,"message",y=>{y.source===window.parent&&y.data&&(y.data.type==="arcgis:auth:credential"?(m.remove(),y.data.credential.expires{m.remove()})}else if(v){let m=v._oAuthCred;if(!m){const y=new K(v,M),S=new K(v,B);y.isValid()&&S.isValid()?y.expires>S.expires?(m=y,S.destroy()):(m=S,y.destroy()):m=y.isValid()?y:S,v._oAuthCred=m}if(m.isValid()){w=new I({userId:m.userId??void 0,server:f.server??void 0,token:m.token??void 0,expires:m.expires,ssl:m.ssl??void 0,_oAuthCred:m});const y=v.appId!==m.appId&&this._doPortalSignIn(e.resUrl_);y||m.refreshToken?(e._pendingDfd=m.refreshToken?this._getOAuthToken(f.server,m.refreshToken,m.appId).then(S=>(w.expires=Date.now()+1e3*S.expires_in,w.token=S.access_token,w)):Promise.resolve(w),e._pendingDfd.then(S=>y?this._exchangeToken(S.server,v.appId,S.token).then(q=>(S.token=q,S)).catch(()=>S):S).then(S=>{s(S)}).catch(S=>{const q=S.details?.httpStatus;q>0&&q!==404?(m.destroy(),r()):t(S)})):s(w)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(v.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===m.stateUID&&m.codeVerifier)){const y=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(y,v,f).then(S=>{s(S)}).catch(t)}else{const y=()=>{g?e._pendingDfd=this.oAuthSignIn(e.resUrl_,f,v,e.options_).then(s,t):(k=new A("identity-manager:not-authenticated","User is not signed in."),t(k))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(f.server,v.appId).then(S=>{R(S.portalUrl,this._appOrigin,!0)?(w=new I({userId:S.username,server:f.server??void 0,expires:Date.now()+1e3*S.expires_in,token:S.token}),s(w)):y()}).catch(y):y()}}else if(g){if(this._checkProtocol(e.resUrl_,f,t,e.admin_)){let m=e.options_;e.admin_&&(m=m||{},m.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,f,m).then(s,t)}}else k=new A("identity-manager:not-authenticated","User is not signed in."),t(k)},i=()=>{const o=e.sinfo_,l=o.owningSystemUrl,c=e.options_;let a,f,g,v;if(c&&(a=c.token,f=c.error,g=c.prompt),v=this._findCredential(l,{token:a,resource:e.resUrl_}),!v){for(const w of this.credentials)if(this._isIdProvider(l,w.server)){v=w;break}}if(v){const w=this.findCredential(e.resUrl_,v.userId);if(w)s(w);else if(Z(o,this._legacyFed)){const k=v.toJSON();k.server=o.server,k.resources=null,s(new I(k))}else(e._pendingDfd=this.generateToken(this.findServerInfo(v.server),null,{serverUrl:e.resUrl_,token:v.token,signal:e.options_.signal,ssl:v.ssl})).then(k=>{s(new I({userId:v?.userId,server:o.server??void 0,token:k.token,expires:k.expires!=null?Number(k.expires):null,ssl:!!k.ssl,isAdmin:e.admin_,validity:k.validity}))},t)}else this._busy=null,a&&(e.options_.token=null),(e._pendingDfd=this.getCredential(l.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:o.owningTenant,signal:e.options_.signal,token:a,error:f,prompt:g})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},w=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(w)})};this._errbackFunc=t;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),p=e.sinfo_._restInfoPms;p?p.promise.then(o=>{const l=e.sinfo_;if(l._restInfoPms){l.adminTokenServiceUrl=l._restInfoPms.adminUrl,l._restInfoPms=null,l.tokenServiceUrl=(N("authInfo.tokenServicesUrl",o)||N("authInfo.tokenServiceUrl",o)||N("tokenServiceUrl",o))??null,l.shortLivedTokenValidity=N("authInfo.shortLivedTokenValidity",o)??null,l.currentVersion=o.currentVersion,l.owningTenant=o.owningTenant;const c=l.owningSystemUrl=o.owningSystemUrl;c&&this._portals.push(c)}h&&l.owningSystemUrl?i():r()},()=>{e.sinfo_._restInfoPms=null;const o=new A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");t(o)}):h&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(o=>{const l={};let c,a,f,g;return o&&(c=o.user?.username,l.username=c,l.allSSL=o.allSSL,a=o.supportsOAuth,g=parseFloat(o.currentVersion),o.portalMode==="multitenant"&&(f=o.customBaseUrl),e.sinfo_.currentVersion=g),e.sinfo_.webTierAuth=!!c,c&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:l.allSSL}).catch(()=>null).then(v=>(l.portalToken=v?.token,l.tokenExpiration=v?.expires,l)):!c&&a&&g>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:f,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>l):l}).catch(()=>null).then(o=>{e.sinfo_._selfReq=null,o?r(o.username,o.allSSL,o.portalToken,o.tokenExpiration):r()}):r()}_generateOAuthInfo(e){let s,t=null,r=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,h=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(h){t=window.location.href;let p=t.indexOf("?");p>-1&&(t=t.slice(0,p)),p=t.search(/\/(apps|home)\//),t=p>-1?t.slice(0,p):null}return h&&t?(this._hasTestedIfAppIsOnPortal=!0,s=P(t+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new oe({appId:"arcgisonline",popupCallbackUrl:t+"/home/oauth-callback.html"})})):s=Promise.resolve(),s.then(()=>{if(this._defaultOAuthInfo)return r=r.replace(/^http:/i,"https:"),P(r+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:se(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(p=>{if(p.data.valid){const o=this._defaultOAuthInfo.clone();p.data.urlKey&&i?o.portalUrl="https://"+p.data.urlKey.toLowerCase()+"."+i:o.portalUrl=r,o.popup=window!==window.top||!(R(r,this._appOrigin)||this._gwDomains.some(l=>l.regex.test(r)&&l.regex.test(this._appOrigin))),this.oAuthInfos.push(o)}})})}_doOAuthSignIn(e,s,t,r){const i=t._oAuthCred,n={portalUrl:t.portalUrl};!t.popup&&t.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const h={client_id:t.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:t.expiration,locale:t.locale,redirect_uri:this._getRedirectURI(t,!!i.codeVerifier)};t.forceLogin&&(h.force_login=!0),t.forceUserId&&t.userId&&(h.prepopulatedusername=t.userId),!t.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),i.codeVerifier&&(h.code_challenge=r||i.codeVerifier,h.code_challenge_method=r?"S256":"plain");const p=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",o=p+"?"+ee(h);if(t.popup){const l=window.open(o,"esriJSAPIOAuth",t.popupWindowFeatures);if(l)l.focus(),this._oAuthDfd.oAuthWin_=l,this._oAuthIntervalId=setInterval(()=>{if(l.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const c=this._oAuthDfd;if(c){const a=new A("identity-manager:user-aborted","ABORTED");c.reject(a)}}},500),this._oAuthOnPopupHandle=F(window,["arcgis:auth:hash","arcgis:auth:location:search"],c=>{c.type==="arcgis:auth:hash"?this.setOAuthResponseHash(c.detail):this._setOAuthResponseQueryString(c.detail)});else{const c=new A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(c)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:p,resourceUrl:e,serverInfo:s,oAuthInfo:t}):window.location.href=o}_getRedirectURI(e,s){const t=window.location.href.replace(/#.*$/,"");if(e.popup)return se(e.popupCallbackUrl);if(s){const r=$(t);return r.query&&["code","error","error_description","message_code","persist","state"].forEach(i=>{delete r.query[i]}),me(r.path,r.query)}return t}}ce.prototype.declaredClass="esri.identity.IdentityManagerBase";let I=class extends ne.EventedAccessor{constructor(d){super(d),this._oAuthCred=null,this.tokenRefreshBuffer=2,d?._oAuthCred&&(this._oAuthCred=d._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const d=V,e=d.findServerInfo(this.server),s=e?.owningSystemUrl,t=!!s&&this.scope==="server",r=t&&Z(e,d._legacyFed),i=e.webTierAuth,n=i&&d.normalizeWebTierAuth,h=L[this.server],p=h?.[this.userId];let o,l=this.resources&&this.resources[0],c=t?d.findServerInfo(s):null,a={username:this.userId,password:p};if(i&&!n)return;t&&!c&&d.serverInfos.some(g=>(d._isIdProvider(s,g.server)&&(c=g),!!c));const f=c?d.findCredential(c.server,this.userId):null;if(!t||f){if(!r){if(t)o={serverUrl:l,token:f?.token,ssl:f?.ssl};else if(n)a=null,o={ssl:this.ssl};else{if(!p){let g;return l&&(l=d._sanitizeUrl(l),this._enqueued=1,g=d._enqueue(l,e,null,null,this.isAdmin,this),g.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),g}this.isAdmin&&(o={isAdmin:!0})}return d.generateToken(t?c:e,t?null:a,o).then(g=>{this.token=g.token,this.expires=g.expires!=null?Number(g.expires):null,this.creationTime=Date.now(),this.validity=g.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}f?.refreshToken()}}refreshServerTokens(){if(this.scope==="portal"){const d=V;d.credentials.forEach(e=>{const s=d.findServerInfo(e.server),t=s?.owningSystemUrl;e!==this&&e.userId===this.userId&&t&&e.scope==="server"&&(d._hasSameServerInstance(this.server,t)||d._isIdProvider(t,this.server))&&(Z(s,d._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())})}}emitTokenChange(d){clearTimeout(this._refreshTimer);const e=V,s=this.server?e.findServerInfo(this.server):null,t=s?.owningSystemUrl,r=t?e.findServerInfo(t):null;d===!1||t&&this.scope!=="portal"&&(!r?.webTierAuth||e.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const d=V,e=d.credentials.indexOf(this);e>-1&&d.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const d=ae({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(d.resources=e.slice()),d}_startRefreshTimer(){clearTimeout(this._refreshTimer);const d=6e4*this.tokenRefreshBuffer,e=2**31-1;let s=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();s<0?s=0:s>e&&(s=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),s>d?s-d:s)}};u([_()],I.prototype,"creationTime",void 0),u([_()],I.prototype,"expires",void 0),u([_()],I.prototype,"isAdmin",void 0),u([_()],I.prototype,"oAuthState",void 0),u([_()],I.prototype,"resources",void 0),u([_()],I.prototype,"scope",void 0),u([_()],I.prototype,"server",void 0),u([_()],I.prototype,"ssl",void 0),u([_()],I.prototype,"token",void 0),u([_()],I.prototype,"tokenRefreshBuffer",void 0),u([_()],I.prototype,"userId",void 0),u([_()],I.prototype,"validity",void 0),I=u([z("esri.identity.Credential")],I);class de extends ce{}de.prototype.declaredClass="esri.identity.IdentityManager";const Ae=new de;ue(Ae);export{Ae as default}; diff --git a/main/assets/IdentityManager-DCHYmv7j-Du2I-Uqb.js b/main/assets/IdentityManager-DCHYmv7j-Du2I-Uqb.js deleted file mode 100644 index f9f954875..000000000 --- a/main/assets/IdentityManager-DCHYmv7j-Du2I-Uqb.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-BWKp46iV.js","./themeUtils-YjM7iIiX-xQe6qdbF.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-Cd5gFTXp.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-DrUFww1w.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-Cc9Ee-I5.js","./locale-Cn_GDVD_-CiwD7jxT.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-DJJPVpPW.js","./t9n-C_hcZMZJ-BmtPt6-4.js","./icon-BXFbBbop-O5hL8B42.js","./loader-Ch7Jr16w-ztJ2p2Gj.js","./guid-Dls486Er-CBh637k4.js","./calcite-dialog-DAngwHC1-CHG3gNw0.js","./action-menu-DTIJuZNc-DM_2ZtiL.js","./action-GCQoufcz-Cwgl1KRC.js","./floating-ui-DKFFlLv3-DZ3_fUHw.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js","./FloatingArrow-BG9llDYg-B1DQ6cRb.js","./panel-DRUEhsxp-DdHxn7R2.js","./scrim-BscQh4v9-uedhhKYH.js","./calcite-input-BKRd7MCS-BjdnYfeD.js","./input2-eOtqu-iO-CInnv9HE.js","./calcite-label-DMj3M4QR-DVsijlea.js","./calcite-notice-DeAGopAs-D67uezlU.js","./conditionalSlot-DsCzytJ4-Ay0m1nEb.js"])))=>i.map(i=>d[i]); -import{v as u,S as _,i as z,I as ne,M as ae,z as ue,e as he,a as $,b as E,E as C,o as A,x as pe,s as R,c as b,f as P,u as j,T as H,L as F,X as ee,H as _e,Z as te,C as J,k as fe,A as ge,N,Y as se,y as me,V,_ as D}from"./main-BZaw9FpY.js";import{_ as re,R as ve,k as we,P as O,x as Se,X as Ie}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{b as ye}from"./substitute-j49H6mVR-DelduE0n.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const W="esri-identity-modal",G={base:W,info:`${W}__info`,notice:`${W}__notice`},ke="ArcGIS Online";let T=class extends ve{constructor(d,e){super(d,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return we({button:()=>D(()=>import("./calcite-button-Cm9_TJei-BWKp46iV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),dialog:()=>D(()=>import("./calcite-dialog-DAngwHC1-CHG3gNw0.js"),__vite__mapDeps([18,1,2,3,4,6,19,17,12,10,20,7,11,13,9,14,15,16,21,22,23,24,25,26]),import.meta.url),input:()=>D(()=>import("./calcite-input-BKRd7MCS-BjdnYfeD.js"),__vite__mapDeps([27,28,1,2,3,4,6,5,7,12,8,9,10,11,13,14,15]),import.meta.url),label:()=>D(()=>import("./calcite-label-DMj3M4QR-DVsijlea.js"),__vite__mapDeps([29,1,2,3,4,8,6,9]),import.meta.url),notice:()=>D(()=>import("./calcite-notice-DeAGopAs-D67uezlU.js"),__vite__mapDeps([30,1,2,3,4,31,13,6,10,11,12,14,23,9,15]),import.meta.url)})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:d,title:e,messages:s,signingIn:t,oAuthPrompt:r,server:i,resource:n,error:h}=this,{info:p,oAuthInfo:o,lblItem:l,invalidUser:c,noAuthService:a,lblUser:f,lblPwd:g,lblCancel:v,lblSigning:w,lblOk:k}=s;return O("div",{class:this.classes(G.base,Se())},O("form",{bind:this,onsubmit:this._submit},O("calcite-dialog",{bind:this,heading:e,modal:!0,open:d,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},O("div",{class:G.info},ye(r?o:p,{server:i&&/\.arcgis\.com/i.test(i)?ke:i,resource:`(${n||l})`})),h?O("calcite-notice",{class:G.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},O("div",{slot:"message"},h.details?.httpStatus?c:a)):null,r?null:[O("calcite-label",null,f,O("calcite-input",{afterCreate:m=>this._usernameInputNode=m,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),O("calcite-label",null,g,O("calcite-input",{afterCreate:m=>this._passwordInputNode=m,bind:this,name:"password",required:!0,type:"password",value:""}))],O("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},v),O("calcite-button",{loading:!!t,slot:"footer-end",type:"submit"},t?w:k))))}_focusUsernameInput(){return Ie(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(d){d.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",e)}};u([_({readOnly:!0})],T.prototype,"container",void 0),u([_(),re("esri/t9n/common")],T.prototype,"commonMessages",void 0),u([_()],T.prototype,"error",void 0),u([_(),re("esri/identity/t9n/identity")],T.prototype,"messages",void 0),u([_()],T.prototype,"oAuthPrompt",void 0),u([_()],T.prototype,"open",void 0),u([_()],T.prototype,"signingIn",void 0),u([_()],T.prototype,"server",void 0),u([_({readOnly:!0})],T.prototype,"title",null),u([_()],T.prototype,"resource",void 0),T=u([z("esri.identity.IdentityModal")],T);const ie=T,X="esriJSAPIOAuth";class K{constructor(e,s){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=s,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const s=Date.now();this.expires>s&&(this.expires-s)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t||(t=e[s.authNamespace]={}),this.appId||(this.appId=s.appId),t[s.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(X,JSON.stringify(e))}catch(r){return console.warn(r),!1}return!0}return!1}destroy(){const e=this._load(),s=this.oAuthInfo;if(s?.appId&&s?.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const t=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",s.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(t,r);else{const i=new XMLHttpRequest;i.open("POST",t),i.send(r)}}if(s?.authNamespace&&s.portalUrl&&this.storage){const t=e[s.authNamespace];if(t){delete t[s.portalUrl];try{this.storage.setItem(X,JSON.stringify(e))}catch(r){console.log(r)}}}s&&(s._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t&&(t=t[s.portalUrl],t&&(this.appId=t.appId,this.codeVerifier=t.codeVerifier,this.expires=t.expires,this.refreshToken=t.refreshToken,this.ssl=t.ssl,this.stateUID=t.stateUID,this.token=t.token,this.userId=t.userId))}}_load(){let e={};if(this.storage){const s=this.storage.getItem(X);if(s)try{e=JSON.parse(s)}catch(t){console.warn(t)}}return e}}K.prototype.declaredClass="esri.identity.OAuthCredential";var Q;let U=Q=class extends he{constructor(d){super(d),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Q.fromJSON(this.toJSON())}};u([_({json:{write:!0}})],U.prototype,"appId",void 0),u([_({json:{write:!0}})],U.prototype,"authNamespace",void 0),u([_({json:{write:!0}})],U.prototype,"expiration",void 0),u([_({json:{write:!0}})],U.prototype,"flowType",void 0),u([_({json:{write:!0}})],U.prototype,"forceLogin",void 0),u([_({json:{write:!0}})],U.prototype,"forceUserId",void 0),u([_({json:{write:!0}})],U.prototype,"locale",void 0),u([_({json:{write:!0}})],U.prototype,"minTimeUntilExpiration",void 0),u([_({json:{write:!0}})],U.prototype,"popup",void 0),u([_({json:{write:!0}})],U.prototype,"popupCallbackUrl",void 0),u([_({json:{write:!0}})],U.prototype,"popupWindowFeatures",void 0),u([_({json:{write:!0}})],U.prototype,"portalUrl",void 0),u([_({json:{write:!0}})],U.prototype,"preserveUrlHash",void 0),u([_({json:{write:!0}})],U.prototype,"userId",void 0),U=Q=u([z("esri.identity.OAuthInfo")],U);const oe=U;let x=class extends he{constructor(d){super(d),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};u([_({json:{write:!0}})],x.prototype,"adminTokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"currentVersion",void 0),u([_({json:{write:!0}})],x.prototype,"hasPortal",void 0),u([_({json:{write:!0}})],x.prototype,"hasServer",void 0),u([_({json:{write:!0}})],x.prototype,"owningSystemUrl",void 0),u([_({json:{write:!0}})],x.prototype,"owningTenant",void 0),u([_({json:{write:!0}})],x.prototype,"server",void 0),u([_({json:{write:!0}})],x.prototype,"shortLivedTokenValidity",void 0),u([_({json:{write:!0}})],x.prototype,"tokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"webTierAuth",void 0),x=u([z("esri.identity.ServerInfo")],x);const Y=x,L={},le=d=>{const e=new b(d.owningSystemUrl).host,s=new b(d.server).host,t=/.+\.arcgis\.com$/i;return t.test(e)&&t.test(s)},Z=(d,e)=>!!(le(d)&&e&&e.some(s=>s.test(d.server)));let M=null,B=null;try{M=window.localStorage,B=window.sessionStorage}catch{}class ce extends ne{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=$(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const s=this.serverInfos;s?(e=e.filter(t=>!this.findServerInfo(t.server)),this.serverInfos=s.concat(e)):this.serverInfos=e,e.forEach(t=>{t.owningSystemUrl&&this._portals.push(t.owningSystemUrl),t.hasPortal&&this._portals.push(t.server)})}registerOAuthInfos(e){const s=this.oAuthInfos;if(s){for(const t of e){const r=this.findOAuthInfo(t.portalUrl);r&&s.splice(s.indexOf(r),1)}this.oAuthInfos=s.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const s=this._sanitizeUrl(e.server),t=this._isServerRsrc(s);let r,i=this.findServerInfo(s),n=!0;i||(i=new Y,i.server=this._getServerInstanceRoot(s),t?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(s),i.hasPortal=!0),this.registerServers([i])),r=this._findCredential(s),r?(delete e.server,Object.assign(r,e),n=!1):(r=new I({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:t?"server":"portal"}),r.resources=[s],this.credentials.push(r)),r.emitTokenChange(!1),n||r.refreshServerTokens()}toJSON(){return ae({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const s=e.serverInfos,t=e.oAuthInfos,r=e.credentials;if(s){const i=[];s.forEach(n=>{n.server&&n.tokenServiceUrl&&i.push(n.declaredClass?n:new Y(n))}),i.length&&this.registerServers(i)}if(t){const i=[];t.forEach(n=>{n.appId&&i.push(n.declaredClass?n:new oe(n))}),i.length&&this.registerOAuthInfos(i)}r&&r.forEach(i=>{i.server&&i.token&&i.expires&&i.expires>Date.now()&&((i=i.declaredClass?i:new I(i)).emitTokenChange(),this.credentials.push(i))})}findServerInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.serverInfos)if(this._hasSameServerInstance(t.server,e)){s=t;break}return s}findOAuthInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.oAuthInfos)if(this._hasSameServerInstance(t.portalUrl,e)){s=t;break}return s}findCredential(e,s){if(!e)return;let t;e=this._sanitizeUrl(e);const r=this._isServerRsrc(e)?"server":"portal";if(s){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&s===i.userId&&i.scope===r){t=i;break}}else for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&this._getIdenticalSvcIdx(e,i)!==-1&&i.scope===r){t=i;break}return t}getCredential(e,s){let t,r,i=!0;s&&(t=!!s.token,r=s.error,i=s.prompt!==!1),s={...s},e=this._sanitizeUrl(e);const n=new AbortController,h=E();if(s.signal&&C(s.signal,()=>{n.abort()}),C(n,()=>{h.reject(new A("identity-manager:user-aborted","ABORTED"))}),pe(n))return h.promise;s.signal=n.signal;const p=this._isAdminResource(e),o=t?this.findCredential(e):null;let l;if(o&&r&&r.details&&r.details.httpStatus===498)o.destroy();else if(o)return l=new A("identity-manager:not-authorized","You are currently signed in as: '"+o.userId+"'. You do not have access to this resource: "+e,{error:r}),h.reject(l),h.promise;const c=this._findCredential(e,s);if(c)return h.resolve(c),h.promise;let a=this.findServerInfo(e);if(a)!a.hasPortal&&a.server&&a.owningSystemUrl&&this._hasSameServerInstance(a.server,a.owningSystemUrl)&&(a.hasPortal=!0),!a.hasServer&&this._isServerRsrc(e)&&(a._restInfoPms=this._getTokenSvcUrl(e),a.hasServer=!0);else{const f=this._getTokenSvcUrl(e);if(!f)return l=new A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),h.reject(l),h.promise;a=new Y,a.server=this._getServerInstanceRoot(e),typeof f=="string"?(a.tokenServiceUrl=f,a.hasPortal=!0):(a._restInfoPms=f,a.hasServer=!0),this.registerServers([a])}return a.hasPortal&&a._selfReq===void 0&&(i||R(a.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(f=>f.tokenServiceUrl===a.tokenServiceUrl))&&(a._selfReq={owningTenant:s?.owningTenant,selfDfd:this._getPortalSelf(a.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,a,s,h,p)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,s,t){const r=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new b(this._appOrigin),n=e.shortLivedTokenValidity;let h,p,o,l,c,a,f,g;s&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),t&&(h=t.isAdmin,p=t.serverUrl,o=t.token,a=t.signal,f=t.ssl,e.customParameters=t.customParameters),h?l=e.adminTokenServiceUrl:(l=e.tokenServiceUrl,c=new b(l.toLowerCase()),e.webTierAuth&&t?.serverUrl&&!f&&i.scheme==="http"&&(R(i.uri,l,!0)||c.scheme==="https"&&i.host===c.host&&i.port==="7080"&&c.port==="7443")&&(l=l.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:s?.username,password:s?.password,serverUrl:p,token:o,expiration:g,referer:h||r?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,t),signal:a,...t?.ioArgs};return r||(v.withCredentials=!1),P(l,v).then(w=>{const k=w.data;if(!k?.token)return new A("identity-manager:authentication-failed","Unable to generate token");const m=e.server;return L[m]||(L[m]={}),s&&(L[m][s.username]=s.password),k.validity=g,k})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,s,t){let r=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let n;const h={f:"json"};if(i.scope==="portal")if(s&&(this._doPortalSignIn(e)||t?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=s;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(h.token=i.token),P(n,{query:h,authMode:"anonymous"}).then(p=>{if(p.data.valid===!1)throw new A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,p.data);return r=!!p.data.viewOnlyUserTypeApp,{credential:i}}).catch(p=>{if(p.name==="identity-manager:not-authorized")throw p;const o=p.details?.httpStatus;if(o===498)throw i.destroy(),new A("identity-manager:not-authenticated","User is not signed in.");if(o===400)throw new A("identity-manager:invalid-request");return{credential:i}})}).then(i=>({credential:i.credential,viewOnly:r}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,s,t={}){const r=E(),i=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=p=o=null},n=()=>{i(),this._oAuthDfd=null,r.reject(new A("identity-manager:user-aborted","ABORTED"))};t.signal&&C(t.signal,()=>{n()});const h=new ie({open:!0,resource:this.getResourceName(e),server:s.server});this.dialog=h,this.emit("dialog-create");let p=h.on("cancel",n),o=h.on("submit",l=>{this.generateToken(s,l,{isAdmin:t.isAdmin,signal:t.signal}).then(c=>{i();const a=new I({userId:l.username,server:s.server??void 0,token:c.token,expires:c.expires!=null?Number(c.expires):null,ssl:!!c.ssl,isAdmin:t.isAdmin,validity:c.validity});r.resolve(a)}).catch(c=>{h.error=c,h.signingIn=!1})});return r.promise}oAuthSignIn(e,s,t,r){this._oAuthDfd=E();const i=this._oAuthDfd;let n;r?.signal&&C(r.signal,()=>{const a=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;a&&!a.closed?a.close():this.dialog&&l()}),i.resUrl_=e,i.sinfo_=s,i.oinfo_=t;const h=t._oAuthCred;if(h.storage&&(t.flowType==="authorization-code"||t.flowType==="auto"&&s.currentVersion>=8.4)){let a=crypto.getRandomValues(new Uint8Array(32));n=H(a),h.codeVerifier=n,a=crypto.getRandomValues(new Uint8Array(32)),h.stateUID=H(a),h.save()||(h.codeVerifier=n=null)}else h.codeVerifier=null;let p,o;this._getCodeChallenge(n).then(a=>{const f=!r||r.oAuthPopupConfirmation!==!1;if(!t.popup||!f)return void this._doOAuthSignIn(e,s,t,a);const g=new ie({oAuthPrompt:!0,server:s.server,open:!0});this.dialog=g,this.emit("dialog-create"),p=g.on("cancel",l),o=g.on("submit",()=>{c(),this._doOAuthSignIn(e,s,t,a)})});const l=()=>{c(),this._oAuthDfd=null,i.reject(new A("identity-manager:user-aborted","ABORTED"))},c=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=F(window,"message",s=>{if((s.origin===this._appOrigin||s.origin.endsWith(".arcgis.com"))&&s.data?.type==="arcgis:auth:requestCredential"){const t=s.source;this.getCredential(e).then(r=>{t.postMessage({type:"arcgis:auth:credential",credential:{expires:r.expires,server:r.server,ssl:r.ssl,token:r.token,userId:r.userId}},s.origin)}).catch(r=>{t.postMessage({type:"arcgis:auth:error",error:{name:r.name,message:r.message}},s.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.slice(1));const t=j(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let s=window.location.search;if(s){s.charAt(0)==="?"&&(s=s.slice(1));const t=j(s);let r=!1;if(t.code&&t.state)try{t.state=JSON.parse(t.state),t.state.portalUrl&&t.state.uid&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}if(r){const i={...t};["code","error","error_description","message_code","persist","state"].forEach(p=>{delete i[p]});const n=ee(i),h=window.location.pathname+(n?`?${n}`:"")+(t.state?.hash||"");window.history.replaceState(window.history.state,"",h)}}}_getOAuthToken(e,s,t,r,i){return e=e.replace(/^http:/i,"https:"),P(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:r&&i?{grant_type:"authorization_code",code:s,redirect_uri:r,client_id:t,code_verifier:i}:{grant_type:"refresh_token",refresh_token:s,client_id:t}}).then(n=>n.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const s=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-256",s);return H(new Uint8Array(t))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const s=new A("identity-manager:user-aborted","ABORTED");this._errbackFunc(s)}}_findCredential(e,s){let t,r,i,n,h=-1;const p=s?.token,o=s?.resource,l=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter(a=>this._hasSameServerInstance(a.server,e)&&a.scope===l);if(e=o||e,c.length)if(c.length===1){if(t=c[0],i=this.findServerInfo(t.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,t.userId):void 0,h=this._getIdenticalSvcIdx(e,t),!p)return h===-1&&t.resources.push(e),this._addResource(e,n),t;h!==-1&&(t.resources.splice(h,1),this._removeResource(e,n))}else{let a,f;if(c.some(g=>(f=this._getIdenticalSvcIdx(e,g),f!==-1&&(a=g,i=this.findServerInfo(a.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,a.userId):void 0,h=f,!0))),p)a&&(a.resources.splice(h,1),this._removeResource(e,n));else if(a)return this._addResource(e,n),a}}_findOAuthInfo(e){let s=this.findOAuthInfo(e);if(!s){for(const t of this.oAuthInfos)if(this._isIdProvider(t.portalUrl,e)){s=t;break}}return s}_addResource(e,s){s&&this._getIdenticalSvcIdx(e,s)===-1&&s.resources.push(e)}_removeResource(e,s){let t=-1;s&&(t=this._getIdenticalSvcIdx(e,s),t>-1&&s.resources.splice(t,1))}_useProxy(e,s){return s?.isAdmin&&!R(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!R(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const s=new b(e);return s.scheme+"://"+s.host+(s.port!=null?":"+s.port:"")}_getServerInstanceRoot(e){const s=e.toLowerCase();let t=s.indexOf(this._agsRest);return t===-1&&this._isAdminResource(e)&&(t=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),t!==-1||_e(s)||(t=s.indexOf("/sharing")),t===-1&&s.endsWith("/")&&(t=s.length-1),t>-1?e.slice(0,t):e}_hasSameServerInstance(e,s){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),s=this._getServerInstanceRoot(s).toLowerCase(),e=te(e),s=te(s),(e=e.slice(Math.max(0,e.indexOf(":"))))===(s=s.slice(Math.max(0,s.indexOf(":"))))}_sanitizeUrl(e){const s=(J.request.proxyUrl||"").toLowerCase(),t=s?e.toLowerCase().indexOf(s+"?"):-1;return t!==-1&&(e=e.slice(t+s.length+1)),e=fe(e),$(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,s){let t=!1;if(this._isRESTService(e)&&this._isRESTService(s)){const r=this._getSuffix(e).toLowerCase(),i=this._getSuffix(s).toLowerCase();if(t=r===i,!t){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;t=r.replaceAll(n,"$1")===i.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(s)?t=!0:this._isServerRsrc(e)||this._isServerRsrc(s)||!this._isPortalDomain(e)||(t=!0);return t}_isPortalDomain(e){const s=new b(e.toLowerCase()),t=this._portalConfig;let r=this._gwDomains.some(i=>i.regex.test(s.uri));return!r&&t&&(r=this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),s.uri)),r||J.portalUrl&&(r=R(s,J.portalUrl,!0)),r||(r=this._portals.some(i=>this._hasSameServerInstance(i,s.uri))),r=r||this._agsPortal.test(s.path),r}_isIdProvider(e,s){let t=-1,r=-1;this._gwDomains.forEach((n,h)=>{t===-1&&n.regex.test(e)&&(t=h),r===-1&&n.regex.test(s)&&(r=h)});let i=!1;if(t>-1&&r>-1&&(t===0||t===4?r!==0&&r!==4||(i=!0):t===1?r!==1&&r!==2||(i=!0):t===2?r===2&&(i=!0):t===3&&r===3&&(i=!0)),!i){const n=this.findServerInfo(s),h=n?.owningSystemUrl;h&&le(n)&&this._isPortalDomain(h)&&this._isIdProvider(e,h)&&(i=!0)}return i}_getIdenticalSvcIdx(e,s){let t=-1;for(let r=0;rn.data),{adminUrl:s,promise:t}}if(this._isPortalDomain(e)){let i="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(i=n.tokenServiceUrl),!!i)),i||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(i=n+this._gwTokenUrl),!!i)),i||(r=e.toLowerCase().indexOf("/sharing"),r!==-1&&(i=e.slice(0,r)+this._gwTokenUrl)),i||(i=this._getOrigin(e)+this._gwTokenUrl),i){const n=new b(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(i=i.replace(/:7080/i,":7443")),i=i.replace(/http:/i,"https:")}return i}}_processOAuthResponseParams(e,s,t){const r=s._oAuthCred;if(e.code){const n=r.codeVerifier;return r.codeVerifier=null,r.stateUID=null,r.save(),this._getOAuthToken(t.server,e.code,s.appId,this._getRedirectURI(s,!0),n).then(h=>{const p=new I({userId:h.username,server:t.server??void 0,token:h.access_token,expires:Date.now()+1e3*h.expires_in,ssl:h.ssl,oAuthState:e.state,_oAuthCred:r});return s.userId=p.userId,r.storage=h.persist?M:B,r.refreshToken=h.refresh_token,r.token=null,r.expires=h.refresh_token_expires_in?Date.now()+1e3*h.refresh_token_expires_in:null,r.userId=p.userId,r.ssl=p.ssl,r.save(),p})}const i=new I({userId:e.username,server:t.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:r});return s.userId=i.userId,r.storage=e.persist?M:B,r.refreshToken=null,r.token=i.token,r.expires=i.expires,r.userId=i.userId,r.ssl=i.ssl,r.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const s=this._oAuthDfd;if(this._oAuthDfd=null,s)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const t=e.error==="access_denied",r=new A(t?"identity-manager:user-aborted":"identity-manager:authentication-failed",t?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);s.reject(r)}else this._processOAuthResponseParams(e,s.oinfo_,s.sinfo_).then(t=>{s.resolve(t)}).catch(t=>{s.reject(t)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}async _exchangeToken(e,s,t){return(await P(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:s,token:t}})).data.token}async _getPlatformSelf(e,s){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const t=await P(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":s,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,t.data}catch(t){throw t.details?.messageCode==="OAUTH_0066"&&(this._getPlatformSelfError=[t,Date.now()]),t}}_getPortalSelf(e,s){let t;return this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.customBaseUrl),!!t)),t?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:t,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(s)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),P(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(r=>r.data))}_doPortalSignIn(e){const s=this._portalConfig,t=window.location.href,r=this.findServerInfo(e);return!(!s&&!this._isPortalDomain(t)||!(r?r.hasPortal||r.owningSystemUrl&&this._isPortalDomain(r.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(t,e)||s&&(this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),e)||this._isIdProvider(s.restBaseUrl,e))||R(t,e,!0)))}_checkProtocol(e,s,t,r){let i=!0;const n=r?s.adminTokenServiceUrl:s.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&ge(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:s}),!i)&&t(new A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,s,t,r,i,n){return r||(r=E()),r.resUrl_=e,r.sinfo_=s,r.options_=t,r.admin_=i,r.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(r)):this._xoReqs.push(r):this._doSignIn(r),r.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const s=o=>{const l=e.options_?.resource,c=e.resUrl_,a=e.refresh_;let f=!1;this.credentials.includes(o)||(a&&this.credentials.includes(a)?(a.userId=o.userId,a.token=o.token,a.expires=o.expires,a.validity=o.validity,a.ssl=o.ssl,a.creationTime=o.creationTime,f=!0,o=a):this.credentials.push(o)),o.resources||(o.resources=[]),o.resources.includes(l||c)||o.resources.push(l||c),o.scope=this._isServerRsrc(c)?"server":"portal",o.emitTokenChange();const g=this._soReqs,v={};this._soReqs=[],g.forEach(w=>{if(!this._isIdenticalService(c,w.resUrl_)){const k=this._getSuffix(w.resUrl_);v[k]||(v[k]=!0,o.resources.push(w.resUrl_))}}),e.resolve(o),g.forEach(w=>{this._hasSameServerInstance(this._getServerInstanceRoot(c),w.resUrl_)?w.resolve(o):this._soReqs.push(w)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,f||this.emit("credential-create",{credential:o}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},t=o=>{e.reject(o),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=(o,l,c,a)=>{const f=e.sinfo_,g=!e.options_||e.options_.prompt!==!1,v=f.hasPortal&&this._findOAuthInfo(e.resUrl_);let w,k;if(o)s(new I({userId:o,server:f.server??void 0,token:c??void 0,expires:a!=null?Number(a):null,ssl:!!l}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const m=F(window,"message",y=>{y.source===window.parent&&y.data&&(y.data.type==="arcgis:auth:credential"?(m.remove(),y.data.credential.expires{m.remove()})}else if(v){let m=v._oAuthCred;if(!m){const y=new K(v,M),S=new K(v,B);y.isValid()&&S.isValid()?y.expires>S.expires?(m=y,S.destroy()):(m=S,y.destroy()):m=y.isValid()?y:S,v._oAuthCred=m}if(m.isValid()){w=new I({userId:m.userId??void 0,server:f.server??void 0,token:m.token??void 0,expires:m.expires,ssl:m.ssl??void 0,_oAuthCred:m});const y=v.appId!==m.appId&&this._doPortalSignIn(e.resUrl_);y||m.refreshToken?(e._pendingDfd=m.refreshToken?this._getOAuthToken(f.server,m.refreshToken,m.appId).then(S=>(w.expires=Date.now()+1e3*S.expires_in,w.token=S.access_token,w)):Promise.resolve(w),e._pendingDfd.then(S=>y?this._exchangeToken(S.server,v.appId,S.token).then(q=>(S.token=q,S)).catch(()=>S):S).then(S=>{s(S)}).catch(S=>{const q=S.details?.httpStatus;q>0&&q!==404?(m.destroy(),r()):t(S)})):s(w)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(v.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===m.stateUID&&m.codeVerifier)){const y=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(y,v,f).then(S=>{s(S)}).catch(t)}else{const y=()=>{g?e._pendingDfd=this.oAuthSignIn(e.resUrl_,f,v,e.options_).then(s,t):(k=new A("identity-manager:not-authenticated","User is not signed in."),t(k))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(f.server,v.appId).then(S=>{R(S.portalUrl,this._appOrigin,!0)?(w=new I({userId:S.username,server:f.server??void 0,expires:Date.now()+1e3*S.expires_in,token:S.token}),s(w)):y()}).catch(y):y()}}else if(g){if(this._checkProtocol(e.resUrl_,f,t,e.admin_)){let m=e.options_;e.admin_&&(m=m||{},m.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,f,m).then(s,t)}}else k=new A("identity-manager:not-authenticated","User is not signed in."),t(k)},i=()=>{const o=e.sinfo_,l=o.owningSystemUrl,c=e.options_;let a,f,g,v;if(c&&(a=c.token,f=c.error,g=c.prompt),v=this._findCredential(l,{token:a,resource:e.resUrl_}),!v){for(const w of this.credentials)if(this._isIdProvider(l,w.server)){v=w;break}}if(v){const w=this.findCredential(e.resUrl_,v.userId);if(w)s(w);else if(Z(o,this._legacyFed)){const k=v.toJSON();k.server=o.server,k.resources=null,s(new I(k))}else(e._pendingDfd=this.generateToken(this.findServerInfo(v.server),null,{serverUrl:e.resUrl_,token:v.token,signal:e.options_.signal,ssl:v.ssl})).then(k=>{s(new I({userId:v?.userId,server:o.server??void 0,token:k.token,expires:k.expires!=null?Number(k.expires):null,ssl:!!k.ssl,isAdmin:e.admin_,validity:k.validity}))},t)}else this._busy=null,a&&(e.options_.token=null),(e._pendingDfd=this.getCredential(l.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:o.owningTenant,signal:e.options_.signal,token:a,error:f,prompt:g})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},w=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(w)})};this._errbackFunc=t;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),p=e.sinfo_._restInfoPms;p?p.promise.then(o=>{const l=e.sinfo_;if(l._restInfoPms){l.adminTokenServiceUrl=l._restInfoPms.adminUrl,l._restInfoPms=null,l.tokenServiceUrl=(N("authInfo.tokenServicesUrl",o)||N("authInfo.tokenServiceUrl",o)||N("tokenServiceUrl",o))??null,l.shortLivedTokenValidity=N("authInfo.shortLivedTokenValidity",o)??null,l.currentVersion=o.currentVersion,l.owningTenant=o.owningTenant;const c=l.owningSystemUrl=o.owningSystemUrl;c&&this._portals.push(c)}h&&l.owningSystemUrl?i():r()},()=>{e.sinfo_._restInfoPms=null;const o=new A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");t(o)}):h&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(o=>{const l={};let c,a,f,g;return o&&(c=o.user?.username,l.username=c,l.allSSL=o.allSSL,a=o.supportsOAuth,g=parseFloat(o.currentVersion),o.portalMode==="multitenant"&&(f=o.customBaseUrl),e.sinfo_.currentVersion=g),e.sinfo_.webTierAuth=!!c,c&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:l.allSSL}).catch(()=>null).then(v=>(l.portalToken=v?.token,l.tokenExpiration=v?.expires,l)):!c&&a&&g>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:f,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>l):l}).catch(()=>null).then(o=>{e.sinfo_._selfReq=null,o?r(o.username,o.allSSL,o.portalToken,o.tokenExpiration):r()}):r()}_generateOAuthInfo(e){let s,t=null,r=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,h=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(h){t=window.location.href;let p=t.indexOf("?");p>-1&&(t=t.slice(0,p)),p=t.search(/\/(apps|home)\//),t=p>-1?t.slice(0,p):null}return h&&t?(this._hasTestedIfAppIsOnPortal=!0,s=P(t+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new oe({appId:"arcgisonline",popupCallbackUrl:t+"/home/oauth-callback.html"})})):s=Promise.resolve(),s.then(()=>{if(this._defaultOAuthInfo)return r=r.replace(/^http:/i,"https:"),P(r+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:se(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(p=>{if(p.data.valid){const o=this._defaultOAuthInfo.clone();p.data.urlKey&&i?o.portalUrl="https://"+p.data.urlKey.toLowerCase()+"."+i:o.portalUrl=r,o.popup=window!==window.top||!(R(r,this._appOrigin)||this._gwDomains.some(l=>l.regex.test(r)&&l.regex.test(this._appOrigin))),this.oAuthInfos.push(o)}})})}_doOAuthSignIn(e,s,t,r){const i=t._oAuthCred,n={portalUrl:t.portalUrl};!t.popup&&t.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const h={client_id:t.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:t.expiration,locale:t.locale,redirect_uri:this._getRedirectURI(t,!!i.codeVerifier)};t.forceLogin&&(h.force_login=!0),t.forceUserId&&t.userId&&(h.prepopulatedusername=t.userId),!t.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),i.codeVerifier&&(h.code_challenge=r||i.codeVerifier,h.code_challenge_method=r?"S256":"plain");const p=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",o=p+"?"+ee(h);if(t.popup){const l=window.open(o,"esriJSAPIOAuth",t.popupWindowFeatures);if(l)l.focus(),this._oAuthDfd.oAuthWin_=l,this._oAuthIntervalId=setInterval(()=>{if(l.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const c=this._oAuthDfd;if(c){const a=new A("identity-manager:user-aborted","ABORTED");c.reject(a)}}},500),this._oAuthOnPopupHandle=F(window,["arcgis:auth:hash","arcgis:auth:location:search"],c=>{c.type==="arcgis:auth:hash"?this.setOAuthResponseHash(c.detail):this._setOAuthResponseQueryString(c.detail)});else{const c=new A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(c)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:p,resourceUrl:e,serverInfo:s,oAuthInfo:t}):window.location.href=o}_getRedirectURI(e,s){const t=window.location.href.replace(/#.*$/,"");if(e.popup)return se(e.popupCallbackUrl);if(s){const r=$(t);return r.query&&["code","error","error_description","message_code","persist","state"].forEach(i=>{delete r.query[i]}),me(r.path,r.query)}return t}}ce.prototype.declaredClass="esri.identity.IdentityManagerBase";let I=class extends ne.EventedAccessor{constructor(d){super(d),this._oAuthCred=null,this.tokenRefreshBuffer=2,d?._oAuthCred&&(this._oAuthCred=d._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const d=V,e=d.findServerInfo(this.server),s=e?.owningSystemUrl,t=!!s&&this.scope==="server",r=t&&Z(e,d._legacyFed),i=e.webTierAuth,n=i&&d.normalizeWebTierAuth,h=L[this.server],p=h?.[this.userId];let o,l=this.resources&&this.resources[0],c=t?d.findServerInfo(s):null,a={username:this.userId,password:p};if(i&&!n)return;t&&!c&&d.serverInfos.some(g=>(d._isIdProvider(s,g.server)&&(c=g),!!c));const f=c?d.findCredential(c.server,this.userId):null;if(!t||f){if(!r){if(t)o={serverUrl:l,token:f?.token,ssl:f?.ssl};else if(n)a=null,o={ssl:this.ssl};else{if(!p){let g;return l&&(l=d._sanitizeUrl(l),this._enqueued=1,g=d._enqueue(l,e,null,null,this.isAdmin,this),g.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),g}this.isAdmin&&(o={isAdmin:!0})}return d.generateToken(t?c:e,t?null:a,o).then(g=>{this.token=g.token,this.expires=g.expires!=null?Number(g.expires):null,this.creationTime=Date.now(),this.validity=g.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}f?.refreshToken()}}refreshServerTokens(){if(this.scope==="portal"){const d=V;d.credentials.forEach(e=>{const s=d.findServerInfo(e.server),t=s?.owningSystemUrl;e!==this&&e.userId===this.userId&&t&&e.scope==="server"&&(d._hasSameServerInstance(this.server,t)||d._isIdProvider(t,this.server))&&(Z(s,d._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())})}}emitTokenChange(d){clearTimeout(this._refreshTimer);const e=V,s=this.server?e.findServerInfo(this.server):null,t=s?.owningSystemUrl,r=t?e.findServerInfo(t):null;d===!1||t&&this.scope!=="portal"&&(!r?.webTierAuth||e.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const d=V,e=d.credentials.indexOf(this);e>-1&&d.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const d=ae({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(d.resources=e.slice()),d}_startRefreshTimer(){clearTimeout(this._refreshTimer);const d=6e4*this.tokenRefreshBuffer,e=2**31-1;let s=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();s<0?s=0:s>e&&(s=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),s>d?s-d:s)}};u([_()],I.prototype,"creationTime",void 0),u([_()],I.prototype,"expires",void 0),u([_()],I.prototype,"isAdmin",void 0),u([_()],I.prototype,"oAuthState",void 0),u([_()],I.prototype,"resources",void 0),u([_()],I.prototype,"scope",void 0),u([_()],I.prototype,"server",void 0),u([_()],I.prototype,"ssl",void 0),u([_()],I.prototype,"token",void 0),u([_()],I.prototype,"tokenRefreshBuffer",void 0),u([_()],I.prototype,"userId",void 0),u([_()],I.prototype,"validity",void 0),I=u([z("esri.identity.Credential")],I);class de extends ce{}de.prototype.declaredClass="esri.identity.IdentityManager";const Ae=new de;ue(Ae);export{Ae as default}; diff --git a/main/assets/ImageryLayer-B-bJb8lU-B5SbVSix.js b/main/assets/ImageryLayer-B-bJb8lU-B5SbVSix.js deleted file mode 100644 index 91447e469..000000000 --- a/main/assets/ImageryLayer-B-bJb8lU-B5SbVSix.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./imageryUtils-6MVSqijr-DkiL-1bk.js","./utils-BVWK2jiA-Ewzf326n.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./jsonContext-BA8GHqVk-BMETb6sX.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js"])))=>i.map(i=>d[i]); -import{v as s,S as a,ac as I,i as R,aa as fe,e as F,w as V,J as re,bB as Le,aK as $t,af as ne,bH as ge,bI as et,bJ as tt,a0 as E,bK as Y,g as ee,bz as zt,bp as Ut,_ as Ht,W as Bt,o as b,bL as Qt,P as C,l as ut,n as Ee,G as kt,a as Wt,a1 as It,f as x,bM as pt,aO as M,ah as Kt,bi as Zt,bN as Xt,ab as Yt}from"./main-BZaw9FpY.js";import{m as er}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as tr}from"./Layer-ChoECxvZ-C4wLrCej.js";import{p as he,d as qe,M as H,k as S,J as rr,A as ir,l as sr,c as nr,u as nt,a as ar,E as Ft,P as or,V as lr,j as ur,v as pr,w as cr,S as mr,b as dr,f as yr,Z as hr}from"./RasterPresetRendererMixin-D6W9pUY6-BpvSTPuo.js";import{_ as gr,X as fr,E as wr,Z as Rr}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{E as at,z as vr,g as br,j as Sr}from"./multidimensionalUtils-BwTugeu7-CpzGLouA.js";import{n as xr,D as ot,R as Ir,x as Fr}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{W as Nt,K as _t,i as Ot,Y as Dr,B as Tr,a as Pr,t as jr,V as Dt,b as Nr,c as _r}from"./RasterSymbolizer-BVys6HkM-CeBx4Ld8.js";import{G as Or}from"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{y as we}from"./Field-C6hA1tZj-CbELM0zp.js";import{o as Cr}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{i as Tt}from"./imageBitmapUtils-DA36kg39-CBVFUZAU.js";import{B as xe}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{y as q,n as L,a as $}from"./utils-9sQxfkoa-Cus_qP6M.js";import{s as Ar,b as lt}from"./Query-BrwMGK8U-sojFdYaD.js";import{k as bt}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{O as Ct}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{e as Vr,i as Mr}from"./executeForIds-Z1gkLduF-Daa1fnES.js";import{u as Jr}from"./executeQueryJSON-CcHnccia-DVecwfbV.js";import{a as Er}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as qr}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as Gr}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as Lr}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as $r}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as zr}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as Ur}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as Hr}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{a as Br}from"./versionUtils-LZYZz-38-xZnsxhiL.js";import{w as Qr}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{E as Ue}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./utils-DPtQ14k3-D1wtSpry.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";const kr={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},Wr=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Kr={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},Zr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function At(i){return Zr.has(i.type)}function ct(i,t){if(!i||!t)return C(i||t);const o=C(i);if(o.functionDefinition&&t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=void 0),Vt(o.functionDefinition.arguments,t),o.rasterFunctionDefinition=o.functionDefinition.toJSON()}else t.functionName?.toLowerCase()!=="none"&&(Mt(o.functionArguments).Raster=t);return o}function Vt(i,t){for(const o in i)o.toLowerCase()==="raster"&&(i[o].type==="RasterFunctionVariable"?(i[o]=t.rasterFunctionDefinition,i[o].type="RasterFunctionTemplate"):i[o].type==="RasterFunctionTemplate"&&Vt(i[o].arguments,t))}function ie(i){const t=C(kr[i.functionName+"Function"]),o=i.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(t.arguments[e]=ie(o[e]),t.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(t.arguments[e].value=ni(o[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=o[e];return t}function Xr(i,t){switch(t=t||{},i.type){case"raster-stretch":return ti(i,t);case"class-breaks":return ri(i,t);case"unique-value":return ii(i,t);case"raster-colormap":return si(i,t);case"vector-field":return Yr(i,t);case"raster-shaded-relief":return ei(i,t);case"flow":throw new Error("Unsupported rendering rule.")}}function Mt(i){const t=i?.Raster??i?.raster;return t&&t.declaredClass==="esri.layers.support.RasterFunction"?Mt(t.functionArguments):i}const Ce={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function Yr(i,t){const o=new S;o.functionName="VectorFieldRenderer";const{dataType:e,bandNames:r}=t,n=e==="vector-uv";let l,u;if(r&&r.length===2){const h=r.map(f=>f.toLowerCase());l=h.indexOf("magnitude"),u=h.indexOf("direction")}l!==-1&&l!==null||(l=0,u=1);const p=i.rotationType==="arithmetic"?1:2,m=i.flowRepresentation==="flow-from"?0:1,c=i.visualVariables?i.visualVariables.find(h=>h.field==="Magnitude"):new Or,d={magnitudeBandID:l,directionBandID:u,isUVComponents:n,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Kr[i.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};o.functionArguments=d;const g=ie(o);return t.convertToRFT?S.fromJSON({rasterFunctionDefinition:g}):o}function ei(i,t){const o=t.convertToRFT;if(t.dataType!=="elevation"&&(t.dataType!=="generic"||t.bandCount!==1||t.pixelType!=="s16"&&t.pixelType!=="s32"&&t.pixelType!=="f32"&&t.pixelType!=="f64"))return new S;const e=new S;e.functionName="Hillshade";const r=i.hillshadeType==="traditional"?0:1,n=i.scalingType==="none"?1:3,l={HillshadeType:r,SlopeType:n,ZFactor:i.zFactor};return r===0&&(l.Azimuth=i.azimuth,l.Altitude=i.altitude),n===3&&(l.PSPower=i.pixelSizePower,l.PSZFactor=i.pixelSizeFactor),e.functionArguments=l,e.variableName="Raster",i.colorRamp&&(e.functionName="ShadedRelief",o?l.ColorRamp=_t(i.colorRamp):l.Colormap=Ot(i.colorRamp)),o?new S({rasterFunctionDefinition:ie(e)}):e}function ti(i,t){const o=t.convertToRFT,e=new S;e.functionName="Stretch";const r=Ce[Dr.toJSON(i.stretchType)],n="u8",l=i.customStatistics?.map(p=>[p.min,p.max,p.avg??0,p.stddev??1]),u={StretchType:r,Statistics:l,DRA:i.dynamicRangeAdjustment,UseGamma:i.useGamma,Gamma:i.gamma,ComputeGamma:i.computeGamma};if(i.outputMin!=null&&(u.Min=i.outputMin),i.outputMax!=null&&(u.Max=i.outputMax),r===Ce.standardDeviation?(u.NumberOfStandardDeviations=i.numberOfStandardDeviations,e.outputPixelType=n):r===Ce.percentClip?(u.MinPercent=i.minPercent,u.MaxPercent=i.maxPercent,e.outputPixelType=n):r===Ce.minMax?e.outputPixelType=n:r===Ce.sigmoid&&(u.SigmoidStrengthLevel=i.sigmoidStrengthLevel),e.functionArguments=u,e.variableName="Raster",i.colorRamp){const p=i.colorRamp,m=new S;if(o)m.functionArguments={ColorRamp:_t(p)};else{const c=Tr(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!t.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=i.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&d.colorRamps?.length&&d.colorRamps.forEach(g=>g.algorithm=g.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Ot(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new S({rasterFunctionDefinition:ie(m)}):m}return o?new S({rasterFunctionDefinition:ie(e)}):e}function ri(i,t){const o=[],e=[],r=[],n=[],{pixelType:l,rasterAttributeTable:u}=t,p=u==null?null:u.features,m=Jt(u);if(m&&p&&Array.isArray(p)&&i.classBreakInfos){i.classBreakInfos.forEach((y,v)=>{const w=y.symbol?.color;let T;w?.a&&y.minValue!=null&&y.maxValue!=null&&p.forEach(j=>{y.minValue!=null&&y.maxValue!=null&&(T=j.attributes[i.field],(T>=y.minValue&&T=y.minValue)&&n.push([j.attributes[m],w.r,w.g,w.b]))})});const h=l?rt(n,l):n,f=new S;return f.functionName="Colormap",f.functionArguments={},f.functionArguments.Colormap=h,f.variableName="Raster",t.convertToRFT?new S({rasterFunctionDefinition:ie(f)}):f}i.classBreakInfos.forEach((h,f)=>{if(h.minValue==null||h.maxValue==null)return;const y=h.symbol&&h.symbol.color;y?.a?(f===0?o.push(h.minValue,h.maxValue+1e-4):o.push(h.minValue+1e-4,h.maxValue+1e-4),e.push(f),n.push([f,y.r,y.g,y.b])):r.push(h.minValue,h.maxValue)});const c=l?rt(n,l):n,d=new S;d.functionName="Remap",d.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:r},d.variableName="Raster";const g=new S;return g.functionName="Colormap",g.functionArguments={Colormap:c,Raster:d},t.convertToRFT?new S({rasterFunctionDefinition:ie(g)}):g}function rt(i,t){const o=Wr.has(t)?xr(t):null;return o&&i.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),i}function Jt(i){if(i==null)return;const{fields:t}=i;return t?.find(o=>o?.name&&o.name.toLowerCase()==="value")?.name}function ii(i,t){const o=[],{pixelType:e,rasterAttributeTable:r}=t,n=r==null?null:r.features,l=Jt(r),u=i.defaultSymbol?.color?.toRgb(),p=i.uniqueValueInfos;if(p)if(n){if(l){const d=new Map;p.forEach(h=>{const f=h.value,y=Pt(h);f!=null&&y?.a&&d.set(String(f),y.toRgb())});const g=i.field;g&&n.forEach(({attributes:h})=>{const f=String(h[g]),y=h[l],v=d.get(f);v?o.push([y,...v]):u&&o.push([y,...u])})}}else for(let d=0;dt.type==="fill")?.material?.color:i.symbol?.color}function si(i,t){const o=i.extractColormap();if(!o||o.length===0)return null;const{pixelType:e}=t,r=e?rt(o,e):o,n=new S;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=r,t.convertToRFT?new S({rasterFunctionDefinition:ie(n)}):n}function ni(i){const t=[],o=[];return i.forEach(e=>{t.push(e[0]),o.push(Pr([...e.slice(1),255]))}),{type:"RasterColormap",values:t,colors:o}}let _=class extends F{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,t,o){this.layer.version<10.3||(t[o]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,t,o){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(t[o]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,t,o){this.format==="lerc"&&i!=null&&(t[o]=i)}get format(){return this.layer.renderer?.type==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,t,o){this.format==="lerc"&&this.layer.version>=10.5&&(t[o]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let t=i.mosaicRule;const o=i.definitionExpression;return t?o&&o!==t.where&&(t=t.clone(),t.where=o):o&&(t=new H({where:o})),t}get rasterFunction(){const i=this.layer;let{rasterFunction:t}=i;const o=i.pixelFilter,e=!i.format||i.format.includes("jpg")||i.format.includes("png");t=this._addResampleRasterFunction(t);const r=i.multidimensionalSubset?.areaOfInterest;return r&&(t=ai(t,r)),e&&!o&&i.renderer?.type!=="vector-field"&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(i){const t=this.layer,{rasterInfo:o,renderer:e}=t;return i=i||t.rasterFunction,!e||!At(e)?i:ct(Xr(e,{rasterAttributeTable:o.attributeTable,pixelType:o.pixelType,dataType:o.dataType,bandNames:o.bandInfos.map(({name:r})=>r),convertColorRampToColormap:t.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition,bandCount:o.bandCount}),i)}_addResampleRasterFunction(i){if(this.layer.renderer?.type!=="vector-field"||i?.functionName==="Resample")return i;const t=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,o=this.layer.serviceRasterInfo.pixelSize;let e=new S({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:o}});return e=i?.rasterFunctionDefinition?new S({rasterFunctionDefinition:ie(e)}):e,ct(e,i)}};function ai(i,t){const o=new S({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return ct(o,i)}s([a()],_.prototype,"layer",void 0),s([a({json:{write:!0}})],_.prototype,"adjustAspectRatio",null),s([I("adjustAspectRatio")],_.prototype,"writeAdjustAspectRatio",null),s([a({json:{write:!0}})],_.prototype,"bandIds",null),s([a({json:{write:!0}})],_.prototype,"compression",void 0),s([a({json:{write:!0}})],_.prototype,"compressionQuality",null),s([I("compressionQuality")],_.prototype,"writeCompressionQuality",null),s([a({json:{write:!0}})],_.prototype,"compressionTolerance",null),s([I("compressionTolerance")],_.prototype,"writeCompressionTolerance",null),s([a({json:{write:!0}})],_.prototype,"format",null),s([a({type:String,json:{read:{reader:he.read},write:{writer:he.write}}})],_.prototype,"interpolation",null),s([a({json:{write:!0}})],_.prototype,"noData",null),s([a({type:String,json:{read:{reader:qe.read},write:{writer:qe.write}}})],_.prototype,"noDataInterpretation",null),s([a({json:{write:!0}})],_.prototype,"pixelType",void 0),s([a({json:{write:!0}})],_.prototype,"lercVersion",void 0),s([I("lercVersion")],_.prototype,"writeLercVersion",null),s([a({type:Number})],_.prototype,"version",null),s([a({json:{write:!0}})],_.prototype,"mosaicRule",null),s([a({json:{write:!0,name:"renderingRule"}})],_.prototype,"rasterFunction",null),_=s([R("esri.layers.support.ExportImageServiceParameters")],_);let ce=class extends fe(F){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};s([a({type:V,json:{read:!0}})],ce.prototype,"fromGeometry",void 0),s([a({type:V,json:{read:!0,write:!0}})],ce.prototype,"toGeometry",void 0),s([a({json:{write:!0}})],ce.prototype,"objectIds",void 0),s([a({type:String,json:{write:!0}})],ce.prototype,"where",void 0),s([a({type:Number,json:{write:!0}})],ce.prototype,"maxCount",void 0),ce=s([R("esri.rest.support.FindImagesParameters")],ce);const oi=ce,Et=i=>{let t=class extends i{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return s([a({json:{write:!0}})],t.prototype,"make",void 0),s([a({json:{write:!0}})],t.prototype,"model",void 0),s([a({json:{write:!0}})],t.prototype,"focalLength",void 0),s([a({json:{write:!0}})],t.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],t.prototype,"rows",void 0),s([a({json:{write:!0}})],t.prototype,"cols",void 0),t=s([R("esri.rest.support.CameraInfoMixin")],t),t};let W=class extends Et(F){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],W.prototype,"id",void 0),s([a({json:{name:"uri",write:!0}})],W.prototype,"referenceUri",void 0),s([a({type:Date,json:{write:!0}})],W.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],W.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],W.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"center",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"perspectiveCenter",void 0),s([a({json:{write:!0}})],W.prototype,"orientation",void 0),W=s([R("esri.rest.support.ImageInspectionInfo")],W);const li=W;let He=class extends F{constructor(){super(...arguments),this.images=null}};s([a({type:[li],json:{write:!0}})],He.prototype,"images",void 0),He=s([R("esri.rest.support.FindImagesResult")],He);const ui=He;var mt;let Re=mt=class extends F{constructor(i){super(i),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new mt(C({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};s([a({type:[String],json:{name:"angleName",write:!0}})],Re.prototype,"angleNames",void 0),s([a({type:V,json:{write:!0}})],Re.prototype,"point",void 0),s([a({type:re,json:{write:!0}})],Re.prototype,"spatialReference",void 0),s([a({type:Le,json:{write:!0}})],Re.prototype,"rasterId",void 0),Re=mt=s([R("esri.rest.support.ImageAngleParameters")],Re);const pi=Re;let Fe=class extends F{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};s([a({type:Number,json:{write:!0}})],Fe.prototype,"north",void 0),s([a({type:Number,json:{write:!0}})],Fe.prototype,"up",void 0),s([a({type:re,json:{write:!0}})],Fe.prototype,"spatialReference",void 0),Fe=s([R("esri.rest.support.ImageAngleResult")],Fe);const ci=Fe,B=new $t({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let X=class extends F{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};s([a()],X.prototype,"type",void 0),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],X.prototype,"measureOperation",void 0),s([a({type:H,json:{write:!0}})],X.prototype,"mosaicRule",void 0),s([a({type:V,json:{write:!0}})],X.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],X.prototype,"raster",void 0),X=s([R("esri.rest.support.BaseImageMeasureParameters")],X);var dt;let ae=dt=class extends X{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new dt(C({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:!0,write:!0}})],ae.prototype,"geometry",void 0),s([I("geometry")],ae.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{write:B.write}})],ae.prototype,"measureOperation",null),s([a({json:{read:!0}})],ae.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],ae.prototype,"linearUnit",void 0),s([a({type:String,json:{read:et.read,write:et.write}})],ae.prototype,"areaUnit",void 0),ae=dt=s([R("esri.rest.support.ImageAreaParameters")],ae);const mi=ae;let de=class extends F{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"value",void 0),s([a({type:String,json:{read:!0,write:!0}})],de.prototype,"displayValue",void 0),s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"uncertainty",void 0),de=s([R("esri.rest.support.BaseImageMeasureResult.BaseImageMeasureResultValue")],de);let Ne=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:ge.read,write:ge.write}})],Ne.prototype,"unit",void 0),Ne=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultLengthValue")],Ne);let Be=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:et.read,write:et.write}})],Be.prototype,"unit",void 0),Be=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAreaValue")],Be);let Ge=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:tt.read,write:tt.write}})],Ge.prototype,"unit",void 0),Ge=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAngleValue")],Ge);let ye=class extends F{constructor(){super(...arguments),this.name=null,this.sensorName=null}};s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"name",void 0),s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"sensorName",void 0),ye=s([R("esri.rest.support.BaseImageMeasureResult")],ye);let Ae=class extends ye{constructor(){super(...arguments),this.area=null,this.perimeter=null}};s([a({type:Be,json:{read:!0,write:!0}})],Ae.prototype,"area",void 0),s([a({type:Ne,json:{read:!0,write:!0}})],Ae.prototype,"perimeter",void 0),Ae=s([R("esri.rest.support.ImageAreaResult")],Ae);const di=Ae;let Qe=class extends fe(F){constructor(){super(...arguments),this.outSpatialReference=null}};s([a({type:re,json:{name:"outSR",write:!0}})],Qe.prototype,"outSpatialReference",void 0),Qe=s([R("esri.rest.support.ImageBoundaryParameters")],Qe);const yi=Qe;let De=class extends F{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(i,t){return i==null?null:i.rings?ut.fromJSON(i):Ee.fromJSON(i)}};s([a({type:Number,json:{write:!0}})],De.prototype,"area",void 0),s([a({json:{name:"shape",write:!0}})],De.prototype,"geometry",void 0),s([E("geometry")],De.prototype,"readGeometry",null),De=s([R("esri.rest.support.ImageBoundaryResult")],De);const hi=De;var yt;let te=yt=class extends X{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new yt(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"fromGeometry",void 0),s([I("fromGeometry")],te.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],te.prototype,"measureOperation",null),s([a({json:{read:!0}})],te.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],te.prototype,"linearUnit",void 0),s([a({type:String,json:{read:tt.read,write:tt.write}})],te.prototype,"angularUnit",void 0),te=yt=s([R("esri.rest.support.ImageDistanceParameters")],te);const gi=te;let Te=class extends ye{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};s([a({type:Ne,json:{read:!0,write:!0}})],Te.prototype,"distance",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"azimuthAngle",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"elevationAngle",void 0),Te=s([R("esri.rest.support.ImageDistanceResult")],Te);const fi=Te;let oe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}};s([a({types:ne,json:{read:ee,write:!0}})],oe.prototype,"geometry",void 0),s([I("geometry")],oe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],oe.prototype,"objectIds",void 0),s([zt(Ar,{ignoreUnknown:!1,name:"spatialRel"})],oe.prototype,"spatialRelationship",void 0),s([a({type:bt,json:{name:"time",write:!0}})],oe.prototype,"timeExtent",void 0),s([a({type:String,json:{write:!0}})],oe.prototype,"where",void 0),oe=s([R("esri.rest.support.ImageGPSInfoParameters")],oe);const wi=oe;let ke=class extends Et(F){constructor(){super(...arguments),this.id=null}};s([a({json:{write:!0}})],ke.prototype,"id",void 0),ke=s([R("esri.rest.support.CameraInfo")],ke);const Ri=ke;let K=class extends F{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],K.prototype,"id",void 0),s([a({json:{write:!0}})],K.prototype,"name",void 0),s([a({type:Date,json:{write:!0}})],K.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],K.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],K.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],K.prototype,"center",void 0),s([a({json:{write:!0}})],K.prototype,"gps",void 0),s([a({json:{write:!0}})],K.prototype,"orientation",void 0),K=s([R("esri.rest.support.ImageGPSInfo")],K);const vi=K;let Ve=class extends F{constructor(){super(...arguments),this.images=null,this.cameras=null}};s([a({type:[vi],json:{write:!0}})],Ve.prototype,"images",void 0),s([a({type:[Ri],json:{write:!0}})],Ve.prototype,"cameras",void 0),Ve=s([R("esri.rest.support.ImageGPSInfoResult")],Ve);const bi=Ve;var ht;let le=ht=class extends X{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.operationType}clone(){return new ht(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0}})],le.prototype,"fromGeometry",void 0),s([I("fromGeometry")],le.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],le.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],le.prototype,"measureOperation",null),s([a({json:{read:!0}})],le.prototype,"operationType",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],le.prototype,"linearUnit",void 0),le=ht=s([R("esri.rest.support.ImageHeightParameters")],le);const Si=le;let We=class extends ye{constructor(){super(...arguments),this.height=null}};s([a({type:Ne,json:{read:!0,write:!0}})],We.prototype,"height",void 0),We=s([R("esri.rest.support.ImageHeightResult")],We);const xi=We;var gt;let O=gt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}set mosaicRule(i){let t=i;t?.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON()))}set rasterFunction(i){let t=i;t?.rasterFunction&&(t=S.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}writeRasterFunction(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON())),i.rasterFunctionDefinition&&(t[o]=JSON.stringify(i.rasterFunctionDefinition))}writeRasterFunctions(i,t,o){i!=null&&(t[o]=JSON.stringify(i.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(i,t,o){i!=null&&(t[o]=JSON.stringify(i))}writeTimeExtent(i,t,o){if(i!=null){const e=i.start!=null?i.start.getTime():null,r=i.end!=null?i.end.getTime():null;t[o]=e!=null?r!=null?`${e},${r}`:`${e}`:null}}clone(){return new gt(C({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};s([a({json:{write:!0}})],O.prototype,"geometry",void 0),s([I("geometry")],O.prototype,"writeGeometry",null),s([a({type:H,json:{write:!0}})],O.prototype,"mosaicRule",null),s([I("mosaicRule")],O.prototype,"writeMosaicRule",null),s([a({type:S,json:{write:!0,name:"renderingRule"}})],O.prototype,"rasterFunction",null),s([I("rasterFunction")],O.prototype,"writeRasterFunction",null),s([a({type:[S],json:{write:!0,name:"renderingRules"}})],O.prototype,"rasterFunctions",void 0),s([I("rasterFunctions")],O.prototype,"writeRasterFunctions",null),s([a({type:V,json:{write:!0}})],O.prototype,"pixelSize",void 0),s([I("pixelSize")],O.prototype,"writePixelSize",null),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnGeometry",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnCatalogItems",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnPixelValues",void 0),s([a({type:Number,json:{write:!0}})],O.prototype,"maxItemCount",void 0),s([a({type:bt,json:{write:{target:"time"}}})],O.prototype,"timeExtent",void 0),s([I("timeExtent")],O.prototype,"writeTimeExtent",null),s([a({json:{write:!0}})],O.prototype,"raster",void 0),s([a({json:{write:!0}})],O.prototype,"viewId",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"processAsMultidimensional",void 0),O=gt=s([R("esri.rest.support.ImageIdentifyParameters")],O);const qt=O;let Z=class extends F{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};s([a({json:{write:!0}})],Z.prototype,"catalogItemVisibilities",void 0),s([a({type:Ct,json:{write:!0}})],Z.prototype,"catalogItems",void 0),s([a({type:V,json:{write:!0}})],Z.prototype,"location",void 0),s([a({json:{write:!0}})],Z.prototype,"name",void 0),s([a({json:{write:!0}})],Z.prototype,"objectId",void 0),s([a({json:{write:!0}})],Z.prototype,"processedValues",void 0),s([a({json:{write:!0}})],Z.prototype,"properties",void 0),s([a({json:{write:!0}})],Z.prototype,"value",void 0),Z=s([R("esri.rest.support.ImageIdentifyResult")],Z);const Ii=Z;var ft;let Pe=ft=class extends F{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(i,t,o){t.geometries={geometryType:"esriGeometryPoint",geometries:i.map(e=>e.toJSON())}}clone(){return new ft({geometries:this.geometries?.map(i=>i.clone())??[],rasterId:this.rasterId})}};s([a({type:[V],json:{write:!0}})],Pe.prototype,"geometries",void 0),s([I("geometries")],Pe.prototype,"writeGeometry",null),s([a({type:Le,json:{write:!0}})],Pe.prototype,"rasterId",void 0),Pe=ft=s([R("esri.rest.support.ImagePixelLocationParameters")],Pe);const Fi=Pe;let Ke=class extends F{constructor(){super(...arguments),this.geometries=null}};s([a({json:{write:!0}})],Ke.prototype,"geometries",void 0),Ke=s([R("esri.rest.support.ImagePixelLocationResult")],Ke);const Di=Ke;var wt;let ve=wt=class extends X{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){const{is3D:i,geometry:t}=this;return t.type==="point"?i?"point-3D":"point":i?"centroid-3D":"centroid"}clone(){return new wt(C({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:ee}})],ve.prototype,"geometry",void 0),s([I("geometry")],ve.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],ve.prototype,"measureOperation",null),s([a({json:{read:!0}})],ve.prototype,"is3D",void 0),ve=wt=s([R("esri.rest.support.ImagePointParameters")],ve);const Ti=ve;let Ze=class extends ye{constructor(){super(...arguments),this.point=null}};s([a({type:V,json:{name:"point.value",read:!0,write:!0}})],Ze.prototype,"point",void 0),Ze=s([R("esri.rest.support.ImagePointResult")],Ze);const Pi=Ze;var Rt;let G=Rt=class extends F{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}set locations(i){if(i?.length){const t=new kt({spatialReference:i[0].spatialReference,points:i.map(({x:o,y:e})=>[o,e])});this._set("locations",i),this.geometry=t}}clone(){return new Rt(C({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};s([a({types:ne,json:{read:ee}})],G.prototype,"geometry",void 0),s([I("geometry")],G.prototype,"writeGeometry",null),s([a()],G.prototype,"locations",null),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],G.prototype,"interpolation",void 0),s([a({type:H,json:{write:!0}})],G.prototype,"mosaicRule",void 0),s([a({type:[String],json:{write:!0}})],G.prototype,"outFields",void 0),s([a({type:V,json:{write:!0}})],G.prototype,"pixelSize",void 0),s([a({type:String,json:{write:!0}})],G.prototype,"raster",void 0),s([a({type:Boolean,json:{write:!0}})],G.prototype,"returnFirstValueOnly",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleDistance",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleCount",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sliceId",void 0),s([a({type:bt,json:{read:{source:"time"},write:{target:"time"}}})],G.prototype,"timeExtent",void 0),G=Rt=s([R("esri.rest.support.ImageSampleParameters")],G);const ji=G;let ue=class extends F{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};s([a({json:{write:!0}})],ue.prototype,"attributes",void 0),s([a({type:V,json:{write:!0}})],ue.prototype,"location",void 0),s([a({json:{write:!0}})],ue.prototype,"locationId",void 0),s([a({json:{write:!0}})],ue.prototype,"rasterId",void 0),s([a({json:{write:!0}})],ue.prototype,"resolution",void 0),s([a({json:{write:!0}})],ue.prototype,"pixelValue",void 0),ue=s([R("esri.rest.support.ImageSample")],ue);const Ni=ue;let Xe=class extends F{constructor(){super(...arguments),this.samples=null}};s([a({type:[Ni],json:{write:!0}})],Xe.prototype,"samples",void 0),Xe=s([R("esri.rest.support.ImageSampleResult")],Xe);const _i=Xe;let be=class extends fe(F){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(i,t,o){t.geometries=i?.length?{geometryType:Y(i[0]),geometries:i.map(e=>({...e.toJSON(),spatialReference:void 0}))}:null}};s([a({types:[ne]})],be.prototype,"geometries",void 0),s([I("geometries")],be.prototype,"writeGeometries",null),s([a({type:[Le],json:{write:!0}})],be.prototype,"rasterIds",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],be.prototype,"outSpatialReference",void 0),be=s([R("esri.rest.support.ImageToMapMultirayParameters")],be);const Oi=be;let pe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}};s([a({types:ne,json:{read:ee,write:!0}})],pe.prototype,"geometry",void 0),s([I("geometry")],pe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],pe.prototype,"rasterId",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],pe.prototype,"outSpatialReference",void 0),s([a({json:{name:"options.DOff",write:!0}})],pe.prototype,"depthOffset",void 0),s([a({json:{name:"options.Adjust",write:!0}})],pe.prototype,"adjust",void 0),pe=s([R("esri.rest.support.ImageToMapParameters")],pe);const Ci=pe;let Me=class extends fe(F){constructor(){super(...arguments),this.referenceUri=null,this.rasterId=null}};s([a({type:String,json:{name:"uri",write:!0}})],Me.prototype,"referenceUri",void 0),s([a({type:Number,json:{write:!0}})],Me.prototype,"rasterId",void 0),Me=s([R("esri.rest.support.ImageUrlParameters")],Me);const Ai=Me;let Ye=class extends F{constructor(){super(...arguments),this.url=null}};s([a({json:{name:"imageURL",write:!0}})],Ye.prototype,"url",void 0),Ye=s([R("esri.rest.support.ImageUrlResult")],Ye);const Vi=Ye;let Se=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i))}};s([a({types:ne,json:{read:ee,write:!0}})],Se.prototype,"geometry",void 0),s([I("geometry")],Se.prototype,"writeGeometry",null),s([a({json:{write:!0}})],Se.prototype,"rasterId",void 0),s([a({json:{name:"options.VisibleOnly",write:!0}})],Se.prototype,"visibleOnly",void 0),Se=s([R("esri.rest.support.MapToImageParameters")],Se);const Mi=Se;let me=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(i,t){return i.spatialReference||(i={...i,spatialReference:t.Shape.spatialReference}),V.fromJSON(i)}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],me.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],me.prototype,"length",void 0),s([a({json:{name:"Area",write:!0}})],me.prototype,"area",void 0),s([a({json:{name:"Center",write:!0}})],me.prototype,"center",void 0),s([E("center")],me.prototype,"readCenter",null),me=s([R("esri.rest.support.MeasureAreaFromImageResult")],me);const Ji=me;var vt;let je=vt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}clone(){const i=C({geometry:this.geometry,rasterId:this.rasterId});return new vt(i)}};s([a({types:ne,json:{name:"fromGeometry",read:ee,write:!0}})],je.prototype,"geometry",void 0),s([I("geometry")],je.prototype,"writeGeometry",null),s([a({json:{write:!0}})],je.prototype,"rasterId",void 0),je=vt=s([R("esri.rest.support.MeasureFromImageParameters")],je);const Ei=je;let Je=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],Je.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],Je.prototype,"length",void 0),Je=s([R("esri.rest.support.MeasureLengthFromImageResult")],Je);const qi=Je;function St(i){const t=i?.time;if(t&&(t.start!=null||t.end!=null)){const o=[];t.start!=null&&o.push(t.start),t.end==null||o.includes(t.end)||o.push(t.end),i.time=o.join(",")}}async function Gt(i,t,o){t=M(hr,t);const e=q(i),r=t.geometry?[t.geometry]:[],n=await xe(r),l=t.toJSON();St(l);const u=n?.[0];u!=null&&(l.geometry=se(u));const p=L({...e.query,f:"json",...l});return $(p,o)}async function Gi(i,t,o){const e=(t=M(pi,t)).toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),t?.point?.spatialReference?.imageCoordinateSystem&&(e.point.spatialReference=st(t.point.spatialReference)),t?.spatialReference?.imageCoordinateSystem&&(e.spatialReference=_e(t.spatialReference));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/computeAngles`,l);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new re({wkid:0,imageCoordinateSystem:u.spatialReference}):re.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new ci(u)}async function Li(i,t,o){const e=(t=M(Fi,t)).toJSON(),{geometries:r}=t;if(r)for(let m=0;m{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:l,histograms:n.histograms}}async function zi(i,t,o){const e=await Gt(i,t,o),r=q(i),{data:n}=await x(`${r.path}/computeHistograms`,e);return{histograms:n.histograms}}async function Ui(i,t,o){const e=(t=M(ji,t)).toJSON();St(e),e.outFields?.length&&(e.outFields=e.outFields.join(","));const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=q(i),u=L({...l.query,f:"json",...e}),p=$(u,o),{data:m}=await x(`${l.path}/getSamples`,p),c=m?.samples?.map(d=>{const g=d.value==="NaN"||d.value===""?null:d.value.split(" ").map(h=>Number(h));return{...d,pixelValue:g}});return _i.fromJSON({samples:c})}async function jt(i,t,o){t=M(qt,t);const e=q(i),r=t.geometry?[t.geometry]:[];return xe(r).then(n=>{const l=t.toJSON(),u=n?.[0];u!=null&&(l.geometry=JSON.stringify(se(u)));const p=L({...e.query,f:"json",...l}),m=$(p,o);return x(e.path+"/identify",m)}).then(n=>Ii.fromJSON(n.data))}async function Hi(i,t,o){t=M(Si,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return xi.fromJSON(e)}async function Bi(i,t,o){t=M(mi,t);const e=await it(i,t,[t.geometry],o);return di.fromJSON(e)}async function Qi(i,t,o){t=M(Ti,t);const e=await it(i,t,[t.geometry],o);return Pi.fromJSON(e)}async function ki(i,t,o){t=M(gi,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return fi.fromJSON(e)}async function it(i,t,o,e){const r=q(i),n=await xe(o),l=t.toJSON();n[0]!=null&&(l.fromGeometry=JSON.stringify(se(n[0]))),n[1]!=null&&(l.toGeometry=JSON.stringify(se(n[1])));const u=L({...r.query,f:"json",...l}),p=$(u,e),{data:m}=await x(r.path+"/measure",p);return m}async function Wi(i,t,o){const e=await Lt(i,t,o);return qi.fromJSON(e)}async function Ki(i,t,o){const e=await Lt(i,t,o);return Ji.fromJSON(e)}async function Lt(i,t,o){t=M(Ei,t);const e=q(i),r=t.toJSON(),n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/measureFromImage",l);return u}function se(i){const t=i.toJSON();return i.spatialReference?.imageCoordinateSystem&&(t.spatialReference=st(i.spatialReference)),t}function st(i){const{imageCoordinateSystem:t}=i;if(t){const{id:o,referenceServiceName:e}=t;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:t}}return i.toJSON()}function _e(i,t){if(!i.imageCoordinateSystem)return pt(i);const o=st(i),{icsid:e,icsns:r}=o;return e==null||r!=null&&!t?.toLowerCase().includes("/"+r.toLowerCase()+"/")?JSON.stringify(o):`0:${e}`}async function Zi(i,t,o){t=M(yi,t);const e=q(i),r=t.toJSON();t.outSpatialReference&&(r.outSR=_e(t.outSpatialReference));const n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/queryBoundary",l);return hi.fromJSON(u)}async function Xi(i,t,o){const e=(t=M(wi,t)).toJSON();St(e),e.objectIds?.length&&(e.objectIds=e.objectIds.join(",")),e.geometry||e.objectIds||e.time||e.where||(e.where="1=1");const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/queryGPSInfo`,m);return bi.fromJSON(c)}async function Yi(i,t,o){const e=(t=M(Ci,t)).toJSON();t.geometry.spatialReference.imageCoordinateSystem&&(e.geometry=se(t.geometry)),t.depthOffset&&t.adjust||delete e.options;const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMap`,l);return ee(u)}async function es(i,t,o){const e=(t=M(Oi,t)).toJSON();t.rasterIds?.length&&(e.rasterIds=t.rasterIds.join(","));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMapMultiray`,l);return ee(u)}async function ts(i,t,o){const e=(t=M(Mi,t)).toJSON(),r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n)),t.visibleOnly||delete e.options;const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/mapToImage`,m);return ee(c)}async function rs(i,t,o){const e=(t=M(Ai,t)).toJSON(),r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/getImageUrl`,l);return Vi.fromJSON(u)}async function is(i,t,o){const e=(t=M(oi,t)).toJSON(),r=await xe([t.fromGeometry,t.toGeometry]);r[0]!=null&&(e.fromGeometry=se(r[0]),r[0].spatialReference&&(e.inSR=_e(r[0].spatialReference))),r[1]!=null&&(e.toGeometry=se(r[1])),t.objectIds?.length&&(e.objectIds=e.objectIds.join(","));const n=q(i),l=L({...n.query,f:"json",...e}),u=$(l,o),{data:p}=await x(`${n.path}/find`,u);return ui.fromJSON(p)}async function ss(i,t,o){const e=q(i),r=L({...e?.query,f:"json"}),n=$(r,o),l=`${e?.path}/${t}/info`,u=x(`${l}`,n),p=x(`${l}/keyProperties`,n),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let g=null;c.statistics?.length&&(g=c.statistics.map(J=>({min:J[0],max:J[1],avg:J[2],stddev:J[3]})));const h=Ee.fromJSON(c.extent),f=Math.ceil(h.width/c.pixelSizeX-.1),y=Math.ceil(h.height/c.pixelSizeY-.1),v=h.spatialReference,w=new V({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:v}),T=c.histograms?.length?c.histograms:null,j=new _r({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Nt({width:f,height:y,bandCount:c.bandCount,extent:h,spatialReference:v,pixelSize:w,pixelType:c.pixelType.toLowerCase(),statistics:g,histograms:T,keyProperties:d,storageInfo:j})}const ns=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),as=Xt(Yt,{min:0,max:255});function os(i){const t=JSON.stringify(i),o=t.includes('"rasterFunctionDefinition":{'),e=o?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),r=e?.map(n=>o?n.slice(8,-18):n.slice(18,-1));return r?r.join("/"):null}const ls=i=>{let t=class extends i{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new _({layer:this}))}readServiceSupportsMosaicRule(e,r){return this._isMosaicRuleSupported(r)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(r=>{e.set(r.name.toLowerCase().replaceAll(/ /gi,"_"),r.name)}),e}readBandIds(e,r){if(Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="number"))return e}readCapabilities(e,r){return this._readCapabilities(r)}writeCompressionQuality(e,r,n){e!=null&&this.format!=="lerc"&&(r[n]=e)}writeCompressionTolerance(e,r,n){this.format==="lerc"&&e!=null&&(r[n]=e)}readDefaultMosaicRule(e,r){return this._serviceSupportsMosaicRule?H.fromJSON(r):null}get fieldsIndex(){return this.fields?new Cr(this.fields):null}set format(e){e&&ns.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,r){return r.serviceDataType==="esriImageServiceDataTypeVector-UV"||r.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}readMaxScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}set mosaicRule(e){let r=e;r?.mosaicMethod&&(r=H.fromJSON({...r.toJSON(),mosaicMethod:r.mosaicMethod,mosaicOperation:r.mosaicOperation})),this._set("mosaicRule",r)}readMosaicRule(e,r){const n=e||r.mosaicRule;return n?H.fromJSON(n):this._isMosaicRuleSupported(r)?H.fromJSON(r):null}writeMosaicRule(e,r,n){let l=this.mosaicRule;const u=this.definitionExpression;l?u&&u!==l.where&&(l=l.clone(),l.where=u):u&&(l=new H({where:u})),this._isValidCustomizedMosaicRule(l)&&(r[n]=l.toJSON())}writeNoData(e,r,n){e!=null&&typeof e=="number"&&(r[n]=as(e))}readObjectIdField(e,r){return e||(e=r.fields.find(n=>n.type==="esriFieldTypeOID"||n.type==="oid")?.name),e}get parsedUrl(){return Wt(this.url)}readSourceType(e,r){return this._isMosaicDataset(r)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:r}=this;return e?r?.find(({name:n})=>n===e)?.renderer.clone():this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,r,n){const l=r?.layerDefinition?.drawingInfo?.renderer,u=ar(l,n);return u==null?null:(u.type==="vector-field"&&r.symbolTileSize&&!l.symbolTileSize&&(u.symbolTileSize=r.symbolTileSize),At(u)||It.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,r,n){r.layerDefinition=r.layerDefinition||{},r.layerDefinition.drawingInfo=r.layerDefinition.drawingInfo||{},r.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(r.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this._rasterAttributeTableFieldPrefix,r=new we({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new we({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),l=new we({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?C(this.fields):[];u.push(n),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(r),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(m=>m.name.toLowerCase()==="none")&&u.push(l),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(m=>m.name.toLowerCase()!=="none").forEach(m=>{u.push(new we({name:"Raster.ServicePixelValue."+m.name,alias:m.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new we({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new we({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const m=p.fields.filter(c=>c.type!=="esriFieldTypeOID"&&c.name.toLowerCase()!=="value").map(c=>{const d=C(c);return d.name=e+c.name,d});u=u.concat(m)}return u}set rasterFunction(e){let r=e;r?.rasterFunction&&(r=S.fromJSON({...r.toJSON(),rasterFunction:r.rasterFunction,rasterFunctionArguments:r.rasterFunctionArguments})),this._set("rasterFunction",r)}readRasterFunction(e,r){const n=r.rasterFunctionInfos;return r.renderingRule||n?.length&&n[0].name!=="None"?this._isRFTJson(r.renderingRule)?S.fromJSON({rasterFunctionDefinition:r.renderingRule}):S.fromJSON(r.renderingRule||{rasterFunctionInfos:r.rasterFunctionInfos}):null}readSpatialReference(e,r){const n=e||r.extent.spatialReference;return n?re.fromJSON(n):null}readPixelType(e){return nt.fromJSON(e)||e}writePixelType(e,r,n){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(r[n]=nt.toJSON(e))}readVersion(e,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("fields")||r.hasOwnProperty("timeInfo")?10:9.3),n}applyFilter(e){let r=e;return this.pixelFilter&&(r=this._clonePixelData(e),this.pixelFilter(r)),r}async applyRenderer(e,r){let n=e;const{renderer:l,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&l&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(l.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,r),this._cachedRendererJson=l.toJSON());const g=await d.symbolize({bandIds:m,...e},r);n={extent:e.extent,pixelBlock:g}}else n={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return n}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeAngles)throw new b("imagery-layer:compute-angles","this operation is not supported on the input image service");return Gi(this.url,e,this._getRequestOptions(r))}async computePixelSpaceLocations(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputePixelLocation)throw new b("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return Li(this.url,e,this._getRequestOptions(r))}async computeHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeHistograms)throw new b("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),zi(this.url,e,this._getRequestOptions(r))}async computeStatisticsHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeStatisticsHistograms)throw new b("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),$i(this.url,e,this._getRequestOptions(r))}async measureHeight(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(e.operationType==="base-and-top"?n.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new b("imagery-layer:measure-height","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Hi(this.url,e,this._getRequestOptions(r))}async measureAreaAndPerimeter(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsAreaAndPerimeter&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Bi(this.url,e,this._getRequestOptions(r))}async measureDistanceAndAngle(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsDistanceAndAngle&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),ki(this.url,e,this._getRequestOptions(r))}async measurePointOrCentroid(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsPointOrCentroid&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Qi(this.url,e,this._getRequestOptions(r))}async measureLengthFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polyline")throw new b("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return Wi(this.url,e,this._getRequestOptions(r))}async measureAreaFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polygon")throw new b("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return Ki(this.url,e,this._getRequestOptions(r))}getField(e){const{fieldsIndex:r}=this;return r?.get(e)}getFieldDomain(e,r){const n=this.getField(e);return n?n.domain:null}async fetchImage(e,r,n,l={}){if(e==null||r==null||n==null)throw new b("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const d=await this._generateRasterInfo(this.rasterFunction,{signal:l.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,r,n,l.timeExtent);if(u==null){if(l.requestAsImageElement&&this._canRequestImageElement(this.format)){const w=document.createElement("canvas");return w.width=r,w.height=n,l.returnImageBitmap?{imageBitmap:await Tt(w,`${o(this.parsedUrl)}/exportImage`,l.signal)}:{imageOrCanvasElement:w}}const{bandIds:d,rasterInfo:g}=this,h=(d?.length||g.bandCount)??0,f=r*n,y=g.pixelType,v=[];for(let w=0;w=10.3?e?.rasterFunction:null})}).then(r=>r.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):x(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(r=>Ct.fromJSON(r.data))}getCatalogItemRasterInfo(e,r){const n={...r,query:this._getQueryParams()};return ss(o(this.parsedUrl),e,n)}async getCatalogItemICSInfo(e,r){const{data:n}=await x(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...r}),l=n?.ics;if(!l)return;let u=null;try{u=(await x(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...r})).data.extent}catch{}if(!u?.spatialReference)return{ics:l,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?x(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...r}).then(P=>P.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:pt(m),outSR:"0:"+e},d=x(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...r}).then(P=>P.data).catch(()=>({})),g=5,h=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(g+1),y=u.ymin+f,v=[];for(let P=0;PP.data).catch(()=>({})),j=await Promise.all([p,d,T]);let J=j[0].ipxf;if(J==null){const P=l.geodataXform?.xf_0;P?.name?.toLowerCase()==="topup"&&P?.coefficients?.length===6&&(J={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:P.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const N=Ee.fromJSON(j[1]?.geometries?.[0]);N&&(N.spatialReference=new re({wkid:0,imageCoordinateSystem:l}));const D=j[2].geometries?j[2].geometries.filter(P=>P?.x!=null&&P.y!=null&&P.x!=="NaN"&&P.y!=="NaN"):[],A=D.length;if(A<3)return{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:null};let U=0,Oe=0,$e=0,ze=0;for(let P=0;PD[0].x,xt=D[g-1].y>D[0].y;return Q===1/0?k=xt?90:270:Q===0?k=Ie?0:180:Q>0?k=Ie?180*Math.atan(Q)/Math.PI:180*Math.atan(Q)/Math.PI+180:Q<0&&(k=xt?180+180*Math.atan(Q)/Math.PI:360+180*Math.atan(Q)/Math.PI),{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:k}}async generateRasterInfo(e,r){e=M(S,e);const n={...r,query:this._getQueryParams()};if(!e||e.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(e))return this.serviceRasterInfo??Ft(o(this.parsedUrl),this.sourceJSON,n);const l=os(e);if(!l)throw new b("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[l])return this._functionRasterInfos[l];const u=or(o(this.parsedUrl),e,n);this._functionRasterInfos[l]=u;try{return await u}catch(p){throw this._functionRasterInfos[l]=null,p}}getExportImageServiceParameters(e,r,n,l){e=e.clone().shiftCentralMeridian();const u=_e(e.spatialReference,o(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const g=this.rasterFunction?.rasterFunctionDefinition,h=this.renderer?.type,f=!h||h==="raster-stretch"||h==="raster-colormap"||h==="unique-value"||h==="class-breaks"||h==="raster-shaded-relief";if(m?.length&&this._hasRasterFunction(this.rasterFunction)&&!g&&f){const w={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")w.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=w;else if(d.rasterFunction==="Colormap"){const T=d.rasterFunctionArguments.Raster;T?.rasterFunction==="Stretch"?(w.rasterFunctionArguments.Raster=T.rasterFunctionArguments.Raster,T.rasterFunctionArguments.Raster=w):(w.rasterFunctionArguments.Raster=T,d.rasterFunctionArguments.Raster=w)}else w.rasterFunctionArguments.Raster=d,d=w;p.bandIds=void 0}else p.bandIds=m?.join(",");Array.isArray(c)&&c.length>0&&(p.noData=c.join(","));const y=this._processMultidimensionalIntersection(null,l,this.exportImageServiceParameters.mosaicRule);if(y.isOutSide)return null;p.mosaicRule=y.mosaicRule!=null?JSON.stringify(y.mosaicRule):null,l=y.timeExtent,p.renderingRule=this._getRenderingRuleString(S.fromJSON(d));const v={};if(l!=null){const{start:w,end:T}=l.toJSON();w&&T&&w===T?v.time=""+w:w==null&&T==null||(v.time=`${w??"null"},${T??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:r+","+n,...p,...v}}async getSamples(e,r){if(!(await this._fetchCapabilities(r?.signal))?.operations.supportsGetSamples)throw new b("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=C(e);const{raster:n}=this;return n&&e.raster==null&&(e.raster=n),Ui(this.url,e,this._getRequestOptions(r))}async identify(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsIdentify)throw new b("imagery-layer:identify","identify operation is not supported on the input image service");e=C(e),this.version<10.91&&e.geometry?.type==="extent"&&(e.geometry=ut.fromExtent(e.geometry));const n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new b("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;const{raster:l,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),l&&e.raster==null&&(e.raster=l),jt(this.url,e,this._getRequestOptions(r))}async imageToMap(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMap)throw new b("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return Yi(o(this.parsedUrl),e,this._getRequestOptions(r))}async imageToMapMultiray(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMapMultiray)throw new b("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return es(o(this.parsedUrl),e,this._getRequestOptions(r))}async mapToImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMapToImage)throw new b("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return ts(o(this.parsedUrl),e,this._getRequestOptions(r))}async findImages(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsFindImages)throw new b("imagery-layer:find-images","findImages operation is not supported on the input image service");return is(o(this.parsedUrl),e,this._getRequestOptions(r))}async getImageUrl(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsGetImageUrl)throw new b("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return rs(o(this.parsedUrl),e,this._getRequestOptions(r))}createQuery(){return new lt({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryBoundary)throw new b("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Zi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasters(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Jr(this.url,e,r)}async queryObjectIds(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Vr(this.url,e,r)}async queryGPSInfo(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryGPSInfo)throw new b("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},Xi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasterCount(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Mr(this.url,e,r)}async queryVisibleRasters(e,r){if(!e)throw new b("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:n,returnDomainValues:l,returnTopmostRaster:u,showNoDataRecords:p}=r||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const g="raster.servicepixelvalue",h=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(N=>!N.toLowerCase().includes(g)),this.version>=10.4)){const N=e.outFields.filter(A=>A.toLowerCase().includes(g)&&A.length>g.length).map(A=>{const U=A.slice(g.length+1);return[this._updateRenderingRulesFunctionName(U,h),U]});c=N.map(A=>new S({functionName:A[0]})),d=N.map(A=>A[1]);const{rasterFunction:D}=this;c.length===0?D?.functionName?(c.push(D),d.push(D.functionName)):c=null:D?.functionName&&!c.some(A=>A.functionName===D.functionName)&&(c.push(D),d.push(D.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:y}=this;let v=e.timeExtent||this.timeExtent;if(y){const{isOutside:N,intersection:D}=at(y,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(N)throw new b("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");D?.timeExtent!=null&&(v=D.timeExtent)}const w=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,v);let T=e.geometry;this.version<10.91&&T?.type==="extent"&&(T=ut.fromExtent(T));const j=this._getQueryParams({geometry:T,timeExtent:v,mosaicRule:w,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete j.f;const J=new qt(j);try{await this._generateRasterInfo(this.rasterFunction);const N=await jt(this.url,J,{signal:r?.signal,query:{...this.customParameters}}),D=e.outFields,A=N.value!=null&&N.value.toLowerCase().includes("nodata");if(!(m&&!f&&N?.catalogItems?.features.length&&(p||!A)))return this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D});const U=this.objectIdField||"ObjectId",Oe=N.catalogItems?.features??[],$e=Oe.map(k=>k.attributes?.[U]),ze=new lt({objectIds:$e,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[U]}),Q=await this.queryRasters(ze);return Q?.features?.length&&Q.features.forEach(k=>{Oe.forEach(Ie=>{Ie.attributes[U]===k.attributes[U]&&k.geometry&&(Ie.geometry=k.geometry.clone(),e.outSpatialReference!=null&&(Ie.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D})}catch{throw new b("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,r){const n=x(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.statistics),l=x(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.histograms),u=await Promise.all([n,l]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,r){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(e,r):Ir(e.meshType,e.simulationSettings,e.flowData,r.signal!=null?r.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const r=e??this.serviceRasterInfo.multidimensionalInfo;return vr(this.multidimensionalSubset,r)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const r=this.sourceJSON,n=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Ft(o(this.parsedUrl),r,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),lr(p,r),p)),l=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([n,l,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),It.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([Kt(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,r){const n=this.timeInfo,{multidimensionalInfo:l}=this.serviceRasterInfo;if(e==null||l==null||r==null||n?.startField==null)return e;const{startField:u}=n,p=l.variables.some(y=>y.dimensions.some(v=>v.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(y=>y.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(y=>y.dimensionName===p),c=r.start!=null?r.start.getTime():null,d=r.end!=null?r.end.getTime():null,g=c==null||d==null||c===d,h=g?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(y=>{y.dimensionName===p&&(f?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=g,y.values=h))});else if(!f){const y=e.multidimensionalDefinition.filter(v=>v.variableName!=null&&v.dimensionName==null);y.length?y.forEach(v=>{v.dimensionName=p,v.isSlice=g,v.values=h}):e.multidimensionalDefinition.push(new br({variableName:"",dimensionName:p,isSlice:g,values:h}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(r=>!(!r.variableName&&!r.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQuery)throw new b("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?M(lt,e):this.createQuery(),r=this._getRequestOptions(r),this.raster&&(r.query={...r.query,raster:this.raster}),{query:e,requestOptions:r}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new yr;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:r,rasterFunction:n}=this;return e.type==="unique-value"&&this._hasRasterFunction(n)&&r?.bandCount===1&&["u8","s8"].includes(r.pixelType)||r!=null&&e!=null&&ur(r).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let r=this.sourceJSON;if(!r){const{data:n,ssl:l}=await x(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});r=n,this.sourceJSON=r,l&&(this.url=this.url.replace(/^http:/i,"https:"))}if(r.capabilities?.toLowerCase().split(",").map(n=>n.trim()).indexOf("tilesonly")>-1)throw new b("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(r,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const r=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return r||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:r,functionArguments:n}=e,l=r?.toLowerCase()==="resample",u=n?.ResampleType||n?.resampleType;return l&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const r=this._isPicture(),{rasterInfo:n}=this;if(!r&&!this.pixelFilter||this._isVectorDataSet()){const l=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,u=pr({variableName:l,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&n.bandCount>=3){const m=u?.bandIds??cr(n);!m||n.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=u?.renderer??mr(n,{bandIds:this.bandIds,variableName:this.rasterFunction?null:l}));const p=dr(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=n):this.symbolizer=new jr({rendererJSON:p,rasterInfo:n}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){e?.renderingRule!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:r,viewId:n}=this;return{raster:r,viewId:n,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,r,n){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:r}):Dt(e,r,n)}async _getRasterFunctionInfos(e){const r=this.sourceJSON.rasterFunctionInfos;return this.loaded?r:r&&this.version>=10.3?r.length===1&&r[0].name.toLowerCase()==="none"?r:(await x(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:r,requestAsImageElement:n,returnImageBitmap:l,signal:u}=e;if(n&&this._canRequestImageElement(r.format)){const f=`${o(this.parsedUrl)}/exportImage`,{data:y}=await x(f,{responseType:l?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return y instanceof Blob?{imageBitmap:await Tt(y,f,u),params:r}:{imageOrCanvasElement:y,params:r}}const p=this._initJobHandler(),m=x(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=r.format||"jpgpng";let g=d;if(g!=="bsq"&&g!=="bip"&&(g=Nr(c)),!g)throw new b("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const h={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(g==="png"||g==="jpg")?Dt(c,{useCanvas:!0,...r},h):this._decodePixelBlock(c,{width:r.width,height:r.height,planes:null,pixelType:null,noDataValue:null,format:d},h)),extent:r.extent},params:r}}_generateRasterInfo(e,r){return this.generateRasterInfo(e,r).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let r=Sr(e,{multidimensionalSubset:this.multidimensionalSubset});if(r!=null&&r.length>0){this.mosaicRule=this.mosaicRule||new H;const n=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!=="none"&&r.forEach(l=>l.variableName=""),r=r.filter(({variableName:l,dimensionName:u})=>l&&l!=="*"||u),!n?.length&&r.length&&(this.mosaicRule.multidimensionalDefinition=r)}}_processVisibleRastersResponse(e,r){r=r||{};const n=e.value,{templateRRFunctionNames:l,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=r,c=e.processedValues;let d=e.catalogItems?.features,g=e.properties?.Values?.map(j=>j.replaceAll(/ /gi,", "))||[];const h=this.objectIdField||"ObjectId",f=typeof n=="string"&&n.toLowerCase().includes("nodata"),y=[];if(n&&!d&&!f){const j={};j[h]=0,g=[n],d=[new Zt({geometry:this.fullExtent,attributes:j})]}if(!d)return[];let v,w,T;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let j=0;j0&&l&&l.length>0&&l.includes(this.rasterFunction.functionName)?c[l.indexOf(this.rasterFunction.functionName)]:n,w.toLowerCase()==="nodata"&&!u)continue;const J="Raster.ItemPixelValue",N="Raster.ServicePixelValue";v.attributes[J]=w,v.attributes[N]=T,this._updateFeatureWithMagDirValues(v,w);const D=this.fields&&this.fields.length>0;let A=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?D?w:n:T;this.rasterFunction||(A=D?w:n),this._updateFeatureWithRasterAttributeTableValues(v,A)}if(v.sourceLayer=v.layer=this,p&&this._updateFeatureWithDomainValues(v),l&&c&&l.length===c.length)for(let J=0;Jc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=l.filter(c=>c.attributes[p]===(r!=null?parseInt(r,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,r){if(!this._isVectorDataSet())return;const n=r.split(/,\s*/).map(c=>parseFloat(c)),l=n.map(c=>[c]),u=n.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new ot({height:1,width:1,pixelType:"f32",pixels:l,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new Ee(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:Fr([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){(this.fields&&this.fields.filter(r=>r.domain&&r.domain.type==="coded-value"))?.forEach(r=>{const n=e.attributes[r.name];if(n!=null){const l=r.domain.codedValues.find(u=>u.code===n);l&&(e.attributes[r.name]=l.name)}})}_updateResponseFieldNames(e,r){if(!r||r.length<1)return;const n=this.fieldsIndex;n!=null&&e.forEach(l=>{if(l?.attributes)for(const u of r){const p=n.get(u)?.name;p&&p!==u&&(l.attributes[u]=l.attributes[p],delete l.attributes[p])}})}_getRenderingRuleString(e){if(e){let r=e.toJSON();return r=r.rasterFunctionDefinition??r,(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=null),JSON.stringify(r)}return null}_hasRasterFunction(e){return e?.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,r){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const n=e.toLowerCase().replaceAll(/ /gi,"_");return r.has(n)?r.get(n):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:r,mosaicRule:n,rasterFunction:l}=this;l&&"rasterFunction"in e&&e.rasterFunction==null&&(e.rasterFunction=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),r&&e.raster==null&&(e.raster=r)}_readCapabilities(e){const r=e.capabilities?e.capabilities.toLowerCase().split(",").map(w=>w.trim()):["image","catalog"],{currentVersion:n,advancedQueryCapabilities:l,maxRecordCount:u}=e,p=r.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!e.extent?.spatialReference),d=r.includes("edit"),g=r.includes("mensuration")&&c,h=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(w=>w.trim()),f=g&&h.includes("basic"),y=this._isMosaicDataset(e)&&r.includes("catalog"),v=r.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsImageToMap:n>=11.2&&y,supportsImageToMapMultiray:n>=11.2&&y,supportsMapToImage:n>=11.2&&y,supportsFindImages:n>=11.2&&y,supportsGetImageUrl:n>=11.3&&v,supportsMeasure:g,supportsMeasureFromImage:n>=11.2,supportsDownload:v,supportsQuery:y&&e.fields&&e.fields.length>0,supportsGetSamples:n>=10.2&&p,supportsProject:n>=10.3&&p,supportsComputeStatisticsHistograms:n>=10.4&&p,supportsQueryBoundary:n>=10.6&&p,supportsCalculateVolume:n>=10.7&&m,supportsComputePixelLocation:n>=10.7&&y,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&y,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!l?.supportsStatistics,supportsOrderBy:!!l?.supportsOrderBy,supportsDistinct:!!l?.supportsDistinct,supportsPagination:!!l?.supportsPagination,supportsStandardizedQueriesOnly:!!l?.useStandardizedQueries,supportsPercentileStatistics:!!l?.supportsPercentileStatistics,supportsCentroid:!!l?.supportsReturningGeometryCentroid,supportsDistance:!!l?.supportsQueryWithDistance,supportsExtent:!!l?.supportsReturningQueryExtent,supportsGeometryProperties:!!l?.supportsReturningGeometryProperties,supportsHavingClause:!!l?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!l?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:g&&h.includes("base-top height"),supportsHeightFromBaseAndTopShadow:g&&h.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:g&&h.includes("top-top shadow height"),supports3D:g&&h.includes("3d")}}}};function o(e){return e?.path??""}return s([a({clonable:!1})],t.prototype,"_functionRasterInfos",void 0),s([a({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),s([a({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),s([a({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),s([E("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),s([a({readOnly:!0})],t.prototype,"_rasterAttributeTableFieldPrefix",void 0),s([a({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),s([a()],t.prototype,"adjustAspectRatio",void 0),s([a({type:[Le],json:{write:!0}})],t.prototype,"bandIds",void 0),s([E("bandIds")],t.prototype,"readBandIds",null),s([a({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),s([E("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),s([a({type:Number})],t.prototype,"compressionQuality",void 0),s([I("compressionQuality")],t.prototype,"writeCompressionQuality",null),s([a({type:Number})],t.prototype,"compressionTolerance",void 0),s([I("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),s([a({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),s([a({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"defaultMosaicRule",void 0),s([E("defaultMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultMosaicRule",null),s([a({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),s([a({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),s([a()],t.prototype,"rasterInfo",void 0),s([a({readOnly:!0,type:[we]})],t.prototype,"fields",void 0),s([a({readOnly:!0})],t.prototype,"fieldsIndex",null),s([a({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],t.prototype,"format",null),s([E("service","format",["serviceDataType"])],t.prototype,"readFormat",null),s([a({type:Ee})],t.prototype,"fullExtent",void 0),s([a({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),s([a({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),s([a({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],t.prototype,"interpolation",void 0),s([a()],t.prototype,"minScale",void 0),s([E("service","minScale")],t.prototype,"readMinScale",null),s([a()],t.prototype,"maxScale",void 0),s([E("service","maxScale")],t.prototype,"readMaxScale",null),s([a({type:H})],t.prototype,"mosaicRule",null),s([E("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),s([I("mosaicRule")],t.prototype,"writeMosaicRule",null),s([a()],t.prototype,"multidimensionalInfo",void 0),s([a({type:ir,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),s([a({json:{type:Le}})],t.prototype,"noData",void 0),s([I("noData")],t.prototype,"writeNoData",null),s([a({type:String,json:{type:qe.jsonValues,read:qe.read,write:qe.write}})],t.prototype,"noDataInterpretation",void 0),s([a({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),s([E("objectIdField")],t.prototype,"readObjectIdField",null),s([a({readOnly:!0})],t.prototype,"geometryType",void 0),s([a({})],t.prototype,"typeIdField",void 0),s([a({})],t.prototype,"types",void 0),s([a({readOnly:!0})],t.prototype,"parsedUrl",null),s([a({type:Function})],t.prototype,"pixelFilter",void 0),s([a()],t.prototype,"raster",void 0),s([a({readOnly:!0})],t.prototype,"sourceType",void 0),s([E("sourceType",["serviceSourceType","fields"])],t.prototype,"readSourceType",null),s([a()],t.prototype,"viewId",void 0),s([a()],t.prototype,"renderer",null),s([a({types:sr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:nr,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],t.prototype,"internalRenderer",null),s([E("internalRenderer")],t.prototype,"readRenderer",null),s([I("internalRenderer")],t.prototype,"writeRenderer",null),s([a({clonable:!1})],t.prototype,"symbolizer",void 0),s([a(wr)],t.prototype,"opacity",void 0),s([a({readOnly:!0})],t.prototype,"rasterFields",null),s([a({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),s([a({type:S,json:{name:"renderingRule"}})],t.prototype,"rasterFunction",null),s([E("rasterFunction",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRasterFunction",null),s([a({readOnly:!0})],t.prototype,"serviceDataType",void 0),s([a({readOnly:!0,type:re})],t.prototype,"spatialReference",void 0),s([E("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),s([a({json:{type:nt.jsonValues}})],t.prototype,"pixelType",void 0),s([E("pixelType")],t.prototype,"readPixelType",null),s([I("pixelType")],t.prototype,"writePixelType",null),s([a({constructOnly:!0,type:Nt})],t.prototype,"serviceRasterInfo",void 0),s([a()],t.prototype,"sourceJSON",void 0),s([a(Rr)],t.prototype,"url",void 0),s([a({readOnly:!0})],t.prototype,"version",void 0),s([E("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=s([R("esri.layers.mixins.ArcGISImageService")],t),t};let z=class extends qr(Hr(Ur(Lr($r(rr(ls(zr(Gr(Er(er(fe(tr)))))))))))){constructor(...i){super(...i),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=Ut(async(t,o,e)=>{const{save:r,saveAs:n}=await Ht(()=>import("./imageryUtils-6MVSqijr-DkiL-1bk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);switch(t){case Ue.SAVE:return r(this,o);case Ue.SAVE_AS:return n(this,e,o)}})}normalizeCtorArgs(i,t){return typeof i=="string"?{url:i,...t}:i}load(i){const t=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},i).catch(Bt).then(()=>this._fetchService(t))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(i){this._set("legendEnabled",i)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(i){this._set("listMode",i)}writeOperationalLayerType(i,t,o){const e=this.renderer?.type==="vector-field";t[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(i){const t=this.rasterFields,o=this.title,e=new Set;let r=!1,n=!1;this.capabilities&&(r=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const l=new Set;r&&l.add("raster.itempixelvalue");for(const p of t){const m=p.name.toLowerCase();l.has(m)||m.includes("raster.servicepixelvalue.")||e.add(p.name)}n&&e.add("raster.magnitude").add("raster.direction");const u=Qr({fields:t,title:o},{...i,visibleFieldNames:e});return u?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&u.fieldInfos.forEach(({format:p,fieldName:m})=>{p&&m&&/^raster\.(item|service)pixelvalue/i.test(m)&&(p.places=2)}),u}queryFeatures(i,t){return this.queryRasters(i,t).then(o=>{if(o?.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(i,t){return this.queryRasterCount(i,t)}redraw(){this.emit("redraw")}async save(i){return this._debouncedSaveOperations(Ue.SAVE,i)}async saveAs(i,t){return this._debouncedSaveOperations(Ue.SAVE_AS,t,i)}serviceSupportsSpatialReference(i){return Br(this,i)}write(i,t){if(!this._isPreviewLayer)return super.write(i,t);if(t?.messages){const o=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new b("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this}))}return null}};s([a(gr)],z.prototype,"legendEnabled",null),s([a({type:["show","hide"]})],z.prototype,"listMode",null),s([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],z.prototype,"isReference",void 0),s([a({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],z.prototype,"operationalLayerType",void 0),s([I("web-map","operationalLayerType")],z.prototype,"writeOperationalLayerType",null),s([a(fr)],z.prototype,"popupEnabled",void 0),s([a({type:Qt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],z.prototype,"popupTemplate",void 0),s([a({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),s([a({readOnly:!0,json:{read:!1}})],z.prototype,"type",void 0),s([a({readOnly:!0})],z.prototype,"_isPreviewLayer",null),z=s([R("esri.layers.ImageryLayer")],z);const Tn=z;export{Tn as default}; diff --git a/main/assets/ImageryLayer-B-bJb8lU-DHQsi7TZ.js b/main/assets/ImageryLayer-B-bJb8lU-DHQsi7TZ.js new file mode 100644 index 000000000..9d98cc3c7 --- /dev/null +++ b/main/assets/ImageryLayer-B-bJb8lU-DHQsi7TZ.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./imageryUtils-6MVSqijr-wws7sSH-.js","./utils-BVWK2jiA-D8rVYIEJ.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./jsonContext-BA8GHqVk-DpBf0bCt.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js"])))=>i.map(i=>d[i]); +import{v as s,S as a,ac as I,i as R,aa as fe,e as F,w as V,J as re,bB as Le,aK as $t,af as ne,bH as ge,bI as et,bJ as tt,a0 as E,bK as Y,g as ee,bz as zt,bp as Ut,_ as Ht,W as Bt,o as b,bL as Qt,P as C,l as ut,n as Ee,G as kt,a as Wt,a1 as It,f as x,bM as pt,aO as M,ah as Kt,bi as Zt,bN as Xt,ab as Yt}from"./main-C7yV2j71.js";import{m as er}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as tr}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{p as he,d as qe,M as H,k as S,J as rr,A as ir,l as sr,c as nr,u as nt,a as ar,E as Ft,P as or,V as lr,j as ur,v as pr,w as cr,S as mr,b as dr,f as yr,Z as hr}from"./RasterPresetRendererMixin-D6W9pUY6-Q9Qi8PwW.js";import{_ as gr,X as fr,E as wr,Z as Rr}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{E as at,z as vr,g as br,j as Sr}from"./multidimensionalUtils-BwTugeu7-LevYq4ep.js";import{n as xr,D as ot,R as Ir,x as Fr}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{W as Nt,K as _t,i as Ot,Y as Dr,B as Tr,a as Pr,t as jr,V as Dt,b as Nr,c as _r}from"./RasterSymbolizer-BVys6HkM-BxgX8zwh.js";import{G as Or}from"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{y as we}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{o as Cr}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{i as Tt}from"./imageBitmapUtils-DA36kg39-BPA5qQx5.js";import{B as xe}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{y as q,n as L,a as $}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{s as Ar,b as lt}from"./Query-BrwMGK8U-DV_czrJX.js";import{k as bt}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{O as Ct}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{e as Vr,i as Mr}from"./executeForIds-Z1gkLduF-BNBrXf-U.js";import{u as Jr}from"./executeQueryJSON-CcHnccia-CB1D7q08.js";import{a as Er}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as qr}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as Gr}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as Lr}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as $r}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as zr}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as Ur}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as Hr}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{a as Br}from"./versionUtils-LZYZz-38-DgmFurh2.js";import{w as Qr}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{E as Ue}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./utils-DPtQ14k3-BW98GOs_.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./cimSymbolUtils-CKIzBgMU-D2oNADot.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";const kr={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},Wr=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Kr={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},Zr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function At(i){return Zr.has(i.type)}function ct(i,t){if(!i||!t)return C(i||t);const o=C(i);if(o.functionDefinition&&t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=void 0),Vt(o.functionDefinition.arguments,t),o.rasterFunctionDefinition=o.functionDefinition.toJSON()}else t.functionName?.toLowerCase()!=="none"&&(Mt(o.functionArguments).Raster=t);return o}function Vt(i,t){for(const o in i)o.toLowerCase()==="raster"&&(i[o].type==="RasterFunctionVariable"?(i[o]=t.rasterFunctionDefinition,i[o].type="RasterFunctionTemplate"):i[o].type==="RasterFunctionTemplate"&&Vt(i[o].arguments,t))}function ie(i){const t=C(kr[i.functionName+"Function"]),o=i.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(t.arguments[e]=ie(o[e]),t.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(t.arguments[e].value=ni(o[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=o[e];return t}function Xr(i,t){switch(t=t||{},i.type){case"raster-stretch":return ti(i,t);case"class-breaks":return ri(i,t);case"unique-value":return ii(i,t);case"raster-colormap":return si(i,t);case"vector-field":return Yr(i,t);case"raster-shaded-relief":return ei(i,t);case"flow":throw new Error("Unsupported rendering rule.")}}function Mt(i){const t=i?.Raster??i?.raster;return t&&t.declaredClass==="esri.layers.support.RasterFunction"?Mt(t.functionArguments):i}const Ce={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function Yr(i,t){const o=new S;o.functionName="VectorFieldRenderer";const{dataType:e,bandNames:r}=t,n=e==="vector-uv";let l,u;if(r&&r.length===2){const h=r.map(f=>f.toLowerCase());l=h.indexOf("magnitude"),u=h.indexOf("direction")}l!==-1&&l!==null||(l=0,u=1);const p=i.rotationType==="arithmetic"?1:2,m=i.flowRepresentation==="flow-from"?0:1,c=i.visualVariables?i.visualVariables.find(h=>h.field==="Magnitude"):new Or,d={magnitudeBandID:l,directionBandID:u,isUVComponents:n,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Kr[i.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};o.functionArguments=d;const g=ie(o);return t.convertToRFT?S.fromJSON({rasterFunctionDefinition:g}):o}function ei(i,t){const o=t.convertToRFT;if(t.dataType!=="elevation"&&(t.dataType!=="generic"||t.bandCount!==1||t.pixelType!=="s16"&&t.pixelType!=="s32"&&t.pixelType!=="f32"&&t.pixelType!=="f64"))return new S;const e=new S;e.functionName="Hillshade";const r=i.hillshadeType==="traditional"?0:1,n=i.scalingType==="none"?1:3,l={HillshadeType:r,SlopeType:n,ZFactor:i.zFactor};return r===0&&(l.Azimuth=i.azimuth,l.Altitude=i.altitude),n===3&&(l.PSPower=i.pixelSizePower,l.PSZFactor=i.pixelSizeFactor),e.functionArguments=l,e.variableName="Raster",i.colorRamp&&(e.functionName="ShadedRelief",o?l.ColorRamp=_t(i.colorRamp):l.Colormap=Ot(i.colorRamp)),o?new S({rasterFunctionDefinition:ie(e)}):e}function ti(i,t){const o=t.convertToRFT,e=new S;e.functionName="Stretch";const r=Ce[Dr.toJSON(i.stretchType)],n="u8",l=i.customStatistics?.map(p=>[p.min,p.max,p.avg??0,p.stddev??1]),u={StretchType:r,Statistics:l,DRA:i.dynamicRangeAdjustment,UseGamma:i.useGamma,Gamma:i.gamma,ComputeGamma:i.computeGamma};if(i.outputMin!=null&&(u.Min=i.outputMin),i.outputMax!=null&&(u.Max=i.outputMax),r===Ce.standardDeviation?(u.NumberOfStandardDeviations=i.numberOfStandardDeviations,e.outputPixelType=n):r===Ce.percentClip?(u.MinPercent=i.minPercent,u.MaxPercent=i.maxPercent,e.outputPixelType=n):r===Ce.minMax?e.outputPixelType=n:r===Ce.sigmoid&&(u.SigmoidStrengthLevel=i.sigmoidStrengthLevel),e.functionArguments=u,e.variableName="Raster",i.colorRamp){const p=i.colorRamp,m=new S;if(o)m.functionArguments={ColorRamp:_t(p)};else{const c=Tr(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!t.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=i.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&d.colorRamps?.length&&d.colorRamps.forEach(g=>g.algorithm=g.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Ot(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new S({rasterFunctionDefinition:ie(m)}):m}return o?new S({rasterFunctionDefinition:ie(e)}):e}function ri(i,t){const o=[],e=[],r=[],n=[],{pixelType:l,rasterAttributeTable:u}=t,p=u==null?null:u.features,m=Jt(u);if(m&&p&&Array.isArray(p)&&i.classBreakInfos){i.classBreakInfos.forEach((y,v)=>{const w=y.symbol?.color;let T;w?.a&&y.minValue!=null&&y.maxValue!=null&&p.forEach(j=>{y.minValue!=null&&y.maxValue!=null&&(T=j.attributes[i.field],(T>=y.minValue&&T=y.minValue)&&n.push([j.attributes[m],w.r,w.g,w.b]))})});const h=l?rt(n,l):n,f=new S;return f.functionName="Colormap",f.functionArguments={},f.functionArguments.Colormap=h,f.variableName="Raster",t.convertToRFT?new S({rasterFunctionDefinition:ie(f)}):f}i.classBreakInfos.forEach((h,f)=>{if(h.minValue==null||h.maxValue==null)return;const y=h.symbol&&h.symbol.color;y?.a?(f===0?o.push(h.minValue,h.maxValue+1e-4):o.push(h.minValue+1e-4,h.maxValue+1e-4),e.push(f),n.push([f,y.r,y.g,y.b])):r.push(h.minValue,h.maxValue)});const c=l?rt(n,l):n,d=new S;d.functionName="Remap",d.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:r},d.variableName="Raster";const g=new S;return g.functionName="Colormap",g.functionArguments={Colormap:c,Raster:d},t.convertToRFT?new S({rasterFunctionDefinition:ie(g)}):g}function rt(i,t){const o=Wr.has(t)?xr(t):null;return o&&i.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),i}function Jt(i){if(i==null)return;const{fields:t}=i;return t?.find(o=>o?.name&&o.name.toLowerCase()==="value")?.name}function ii(i,t){const o=[],{pixelType:e,rasterAttributeTable:r}=t,n=r==null?null:r.features,l=Jt(r),u=i.defaultSymbol?.color?.toRgb(),p=i.uniqueValueInfos;if(p)if(n){if(l){const d=new Map;p.forEach(h=>{const f=h.value,y=Pt(h);f!=null&&y?.a&&d.set(String(f),y.toRgb())});const g=i.field;g&&n.forEach(({attributes:h})=>{const f=String(h[g]),y=h[l],v=d.get(f);v?o.push([y,...v]):u&&o.push([y,...u])})}}else for(let d=0;dt.type==="fill")?.material?.color:i.symbol?.color}function si(i,t){const o=i.extractColormap();if(!o||o.length===0)return null;const{pixelType:e}=t,r=e?rt(o,e):o,n=new S;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=r,t.convertToRFT?new S({rasterFunctionDefinition:ie(n)}):n}function ni(i){const t=[],o=[];return i.forEach(e=>{t.push(e[0]),o.push(Pr([...e.slice(1),255]))}),{type:"RasterColormap",values:t,colors:o}}let _=class extends F{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,t,o){this.layer.version<10.3||(t[o]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,t,o){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(t[o]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,t,o){this.format==="lerc"&&i!=null&&(t[o]=i)}get format(){return this.layer.renderer?.type==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,t,o){this.format==="lerc"&&this.layer.version>=10.5&&(t[o]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let t=i.mosaicRule;const o=i.definitionExpression;return t?o&&o!==t.where&&(t=t.clone(),t.where=o):o&&(t=new H({where:o})),t}get rasterFunction(){const i=this.layer;let{rasterFunction:t}=i;const o=i.pixelFilter,e=!i.format||i.format.includes("jpg")||i.format.includes("png");t=this._addResampleRasterFunction(t);const r=i.multidimensionalSubset?.areaOfInterest;return r&&(t=ai(t,r)),e&&!o&&i.renderer?.type!=="vector-field"&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(i){const t=this.layer,{rasterInfo:o,renderer:e}=t;return i=i||t.rasterFunction,!e||!At(e)?i:ct(Xr(e,{rasterAttributeTable:o.attributeTable,pixelType:o.pixelType,dataType:o.dataType,bandNames:o.bandInfos.map(({name:r})=>r),convertColorRampToColormap:t.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition,bandCount:o.bandCount}),i)}_addResampleRasterFunction(i){if(this.layer.renderer?.type!=="vector-field"||i?.functionName==="Resample")return i;const t=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,o=this.layer.serviceRasterInfo.pixelSize;let e=new S({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:o}});return e=i?.rasterFunctionDefinition?new S({rasterFunctionDefinition:ie(e)}):e,ct(e,i)}};function ai(i,t){const o=new S({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return ct(o,i)}s([a()],_.prototype,"layer",void 0),s([a({json:{write:!0}})],_.prototype,"adjustAspectRatio",null),s([I("adjustAspectRatio")],_.prototype,"writeAdjustAspectRatio",null),s([a({json:{write:!0}})],_.prototype,"bandIds",null),s([a({json:{write:!0}})],_.prototype,"compression",void 0),s([a({json:{write:!0}})],_.prototype,"compressionQuality",null),s([I("compressionQuality")],_.prototype,"writeCompressionQuality",null),s([a({json:{write:!0}})],_.prototype,"compressionTolerance",null),s([I("compressionTolerance")],_.prototype,"writeCompressionTolerance",null),s([a({json:{write:!0}})],_.prototype,"format",null),s([a({type:String,json:{read:{reader:he.read},write:{writer:he.write}}})],_.prototype,"interpolation",null),s([a({json:{write:!0}})],_.prototype,"noData",null),s([a({type:String,json:{read:{reader:qe.read},write:{writer:qe.write}}})],_.prototype,"noDataInterpretation",null),s([a({json:{write:!0}})],_.prototype,"pixelType",void 0),s([a({json:{write:!0}})],_.prototype,"lercVersion",void 0),s([I("lercVersion")],_.prototype,"writeLercVersion",null),s([a({type:Number})],_.prototype,"version",null),s([a({json:{write:!0}})],_.prototype,"mosaicRule",null),s([a({json:{write:!0,name:"renderingRule"}})],_.prototype,"rasterFunction",null),_=s([R("esri.layers.support.ExportImageServiceParameters")],_);let ce=class extends fe(F){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};s([a({type:V,json:{read:!0}})],ce.prototype,"fromGeometry",void 0),s([a({type:V,json:{read:!0,write:!0}})],ce.prototype,"toGeometry",void 0),s([a({json:{write:!0}})],ce.prototype,"objectIds",void 0),s([a({type:String,json:{write:!0}})],ce.prototype,"where",void 0),s([a({type:Number,json:{write:!0}})],ce.prototype,"maxCount",void 0),ce=s([R("esri.rest.support.FindImagesParameters")],ce);const oi=ce,Et=i=>{let t=class extends i{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return s([a({json:{write:!0}})],t.prototype,"make",void 0),s([a({json:{write:!0}})],t.prototype,"model",void 0),s([a({json:{write:!0}})],t.prototype,"focalLength",void 0),s([a({json:{write:!0}})],t.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],t.prototype,"rows",void 0),s([a({json:{write:!0}})],t.prototype,"cols",void 0),t=s([R("esri.rest.support.CameraInfoMixin")],t),t};let W=class extends Et(F){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],W.prototype,"id",void 0),s([a({json:{name:"uri",write:!0}})],W.prototype,"referenceUri",void 0),s([a({type:Date,json:{write:!0}})],W.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],W.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],W.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"center",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"perspectiveCenter",void 0),s([a({json:{write:!0}})],W.prototype,"orientation",void 0),W=s([R("esri.rest.support.ImageInspectionInfo")],W);const li=W;let He=class extends F{constructor(){super(...arguments),this.images=null}};s([a({type:[li],json:{write:!0}})],He.prototype,"images",void 0),He=s([R("esri.rest.support.FindImagesResult")],He);const ui=He;var mt;let Re=mt=class extends F{constructor(i){super(i),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new mt(C({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};s([a({type:[String],json:{name:"angleName",write:!0}})],Re.prototype,"angleNames",void 0),s([a({type:V,json:{write:!0}})],Re.prototype,"point",void 0),s([a({type:re,json:{write:!0}})],Re.prototype,"spatialReference",void 0),s([a({type:Le,json:{write:!0}})],Re.prototype,"rasterId",void 0),Re=mt=s([R("esri.rest.support.ImageAngleParameters")],Re);const pi=Re;let Fe=class extends F{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};s([a({type:Number,json:{write:!0}})],Fe.prototype,"north",void 0),s([a({type:Number,json:{write:!0}})],Fe.prototype,"up",void 0),s([a({type:re,json:{write:!0}})],Fe.prototype,"spatialReference",void 0),Fe=s([R("esri.rest.support.ImageAngleResult")],Fe);const ci=Fe,B=new $t({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let X=class extends F{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};s([a()],X.prototype,"type",void 0),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],X.prototype,"measureOperation",void 0),s([a({type:H,json:{write:!0}})],X.prototype,"mosaicRule",void 0),s([a({type:V,json:{write:!0}})],X.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],X.prototype,"raster",void 0),X=s([R("esri.rest.support.BaseImageMeasureParameters")],X);var dt;let ae=dt=class extends X{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new dt(C({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:!0,write:!0}})],ae.prototype,"geometry",void 0),s([I("geometry")],ae.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{write:B.write}})],ae.prototype,"measureOperation",null),s([a({json:{read:!0}})],ae.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],ae.prototype,"linearUnit",void 0),s([a({type:String,json:{read:et.read,write:et.write}})],ae.prototype,"areaUnit",void 0),ae=dt=s([R("esri.rest.support.ImageAreaParameters")],ae);const mi=ae;let de=class extends F{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"value",void 0),s([a({type:String,json:{read:!0,write:!0}})],de.prototype,"displayValue",void 0),s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"uncertainty",void 0),de=s([R("esri.rest.support.BaseImageMeasureResult.BaseImageMeasureResultValue")],de);let Ne=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:ge.read,write:ge.write}})],Ne.prototype,"unit",void 0),Ne=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultLengthValue")],Ne);let Be=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:et.read,write:et.write}})],Be.prototype,"unit",void 0),Be=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAreaValue")],Be);let Ge=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:tt.read,write:tt.write}})],Ge.prototype,"unit",void 0),Ge=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAngleValue")],Ge);let ye=class extends F{constructor(){super(...arguments),this.name=null,this.sensorName=null}};s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"name",void 0),s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"sensorName",void 0),ye=s([R("esri.rest.support.BaseImageMeasureResult")],ye);let Ae=class extends ye{constructor(){super(...arguments),this.area=null,this.perimeter=null}};s([a({type:Be,json:{read:!0,write:!0}})],Ae.prototype,"area",void 0),s([a({type:Ne,json:{read:!0,write:!0}})],Ae.prototype,"perimeter",void 0),Ae=s([R("esri.rest.support.ImageAreaResult")],Ae);const di=Ae;let Qe=class extends fe(F){constructor(){super(...arguments),this.outSpatialReference=null}};s([a({type:re,json:{name:"outSR",write:!0}})],Qe.prototype,"outSpatialReference",void 0),Qe=s([R("esri.rest.support.ImageBoundaryParameters")],Qe);const yi=Qe;let De=class extends F{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(i,t){return i==null?null:i.rings?ut.fromJSON(i):Ee.fromJSON(i)}};s([a({type:Number,json:{write:!0}})],De.prototype,"area",void 0),s([a({json:{name:"shape",write:!0}})],De.prototype,"geometry",void 0),s([E("geometry")],De.prototype,"readGeometry",null),De=s([R("esri.rest.support.ImageBoundaryResult")],De);const hi=De;var yt;let te=yt=class extends X{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new yt(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"fromGeometry",void 0),s([I("fromGeometry")],te.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],te.prototype,"measureOperation",null),s([a({json:{read:!0}})],te.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],te.prototype,"linearUnit",void 0),s([a({type:String,json:{read:tt.read,write:tt.write}})],te.prototype,"angularUnit",void 0),te=yt=s([R("esri.rest.support.ImageDistanceParameters")],te);const gi=te;let Te=class extends ye{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};s([a({type:Ne,json:{read:!0,write:!0}})],Te.prototype,"distance",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"azimuthAngle",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"elevationAngle",void 0),Te=s([R("esri.rest.support.ImageDistanceResult")],Te);const fi=Te;let oe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}};s([a({types:ne,json:{read:ee,write:!0}})],oe.prototype,"geometry",void 0),s([I("geometry")],oe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],oe.prototype,"objectIds",void 0),s([zt(Ar,{ignoreUnknown:!1,name:"spatialRel"})],oe.prototype,"spatialRelationship",void 0),s([a({type:bt,json:{name:"time",write:!0}})],oe.prototype,"timeExtent",void 0),s([a({type:String,json:{write:!0}})],oe.prototype,"where",void 0),oe=s([R("esri.rest.support.ImageGPSInfoParameters")],oe);const wi=oe;let ke=class extends Et(F){constructor(){super(...arguments),this.id=null}};s([a({json:{write:!0}})],ke.prototype,"id",void 0),ke=s([R("esri.rest.support.CameraInfo")],ke);const Ri=ke;let K=class extends F{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],K.prototype,"id",void 0),s([a({json:{write:!0}})],K.prototype,"name",void 0),s([a({type:Date,json:{write:!0}})],K.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],K.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],K.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],K.prototype,"center",void 0),s([a({json:{write:!0}})],K.prototype,"gps",void 0),s([a({json:{write:!0}})],K.prototype,"orientation",void 0),K=s([R("esri.rest.support.ImageGPSInfo")],K);const vi=K;let Ve=class extends F{constructor(){super(...arguments),this.images=null,this.cameras=null}};s([a({type:[vi],json:{write:!0}})],Ve.prototype,"images",void 0),s([a({type:[Ri],json:{write:!0}})],Ve.prototype,"cameras",void 0),Ve=s([R("esri.rest.support.ImageGPSInfoResult")],Ve);const bi=Ve;var ht;let le=ht=class extends X{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.operationType}clone(){return new ht(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0}})],le.prototype,"fromGeometry",void 0),s([I("fromGeometry")],le.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],le.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],le.prototype,"measureOperation",null),s([a({json:{read:!0}})],le.prototype,"operationType",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],le.prototype,"linearUnit",void 0),le=ht=s([R("esri.rest.support.ImageHeightParameters")],le);const Si=le;let We=class extends ye{constructor(){super(...arguments),this.height=null}};s([a({type:Ne,json:{read:!0,write:!0}})],We.prototype,"height",void 0),We=s([R("esri.rest.support.ImageHeightResult")],We);const xi=We;var gt;let O=gt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}set mosaicRule(i){let t=i;t?.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON()))}set rasterFunction(i){let t=i;t?.rasterFunction&&(t=S.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}writeRasterFunction(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON())),i.rasterFunctionDefinition&&(t[o]=JSON.stringify(i.rasterFunctionDefinition))}writeRasterFunctions(i,t,o){i!=null&&(t[o]=JSON.stringify(i.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(i,t,o){i!=null&&(t[o]=JSON.stringify(i))}writeTimeExtent(i,t,o){if(i!=null){const e=i.start!=null?i.start.getTime():null,r=i.end!=null?i.end.getTime():null;t[o]=e!=null?r!=null?`${e},${r}`:`${e}`:null}}clone(){return new gt(C({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};s([a({json:{write:!0}})],O.prototype,"geometry",void 0),s([I("geometry")],O.prototype,"writeGeometry",null),s([a({type:H,json:{write:!0}})],O.prototype,"mosaicRule",null),s([I("mosaicRule")],O.prototype,"writeMosaicRule",null),s([a({type:S,json:{write:!0,name:"renderingRule"}})],O.prototype,"rasterFunction",null),s([I("rasterFunction")],O.prototype,"writeRasterFunction",null),s([a({type:[S],json:{write:!0,name:"renderingRules"}})],O.prototype,"rasterFunctions",void 0),s([I("rasterFunctions")],O.prototype,"writeRasterFunctions",null),s([a({type:V,json:{write:!0}})],O.prototype,"pixelSize",void 0),s([I("pixelSize")],O.prototype,"writePixelSize",null),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnGeometry",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnCatalogItems",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnPixelValues",void 0),s([a({type:Number,json:{write:!0}})],O.prototype,"maxItemCount",void 0),s([a({type:bt,json:{write:{target:"time"}}})],O.prototype,"timeExtent",void 0),s([I("timeExtent")],O.prototype,"writeTimeExtent",null),s([a({json:{write:!0}})],O.prototype,"raster",void 0),s([a({json:{write:!0}})],O.prototype,"viewId",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"processAsMultidimensional",void 0),O=gt=s([R("esri.rest.support.ImageIdentifyParameters")],O);const qt=O;let Z=class extends F{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};s([a({json:{write:!0}})],Z.prototype,"catalogItemVisibilities",void 0),s([a({type:Ct,json:{write:!0}})],Z.prototype,"catalogItems",void 0),s([a({type:V,json:{write:!0}})],Z.prototype,"location",void 0),s([a({json:{write:!0}})],Z.prototype,"name",void 0),s([a({json:{write:!0}})],Z.prototype,"objectId",void 0),s([a({json:{write:!0}})],Z.prototype,"processedValues",void 0),s([a({json:{write:!0}})],Z.prototype,"properties",void 0),s([a({json:{write:!0}})],Z.prototype,"value",void 0),Z=s([R("esri.rest.support.ImageIdentifyResult")],Z);const Ii=Z;var ft;let Pe=ft=class extends F{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(i,t,o){t.geometries={geometryType:"esriGeometryPoint",geometries:i.map(e=>e.toJSON())}}clone(){return new ft({geometries:this.geometries?.map(i=>i.clone())??[],rasterId:this.rasterId})}};s([a({type:[V],json:{write:!0}})],Pe.prototype,"geometries",void 0),s([I("geometries")],Pe.prototype,"writeGeometry",null),s([a({type:Le,json:{write:!0}})],Pe.prototype,"rasterId",void 0),Pe=ft=s([R("esri.rest.support.ImagePixelLocationParameters")],Pe);const Fi=Pe;let Ke=class extends F{constructor(){super(...arguments),this.geometries=null}};s([a({json:{write:!0}})],Ke.prototype,"geometries",void 0),Ke=s([R("esri.rest.support.ImagePixelLocationResult")],Ke);const Di=Ke;var wt;let ve=wt=class extends X{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){const{is3D:i,geometry:t}=this;return t.type==="point"?i?"point-3D":"point":i?"centroid-3D":"centroid"}clone(){return new wt(C({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:ee}})],ve.prototype,"geometry",void 0),s([I("geometry")],ve.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],ve.prototype,"measureOperation",null),s([a({json:{read:!0}})],ve.prototype,"is3D",void 0),ve=wt=s([R("esri.rest.support.ImagePointParameters")],ve);const Ti=ve;let Ze=class extends ye{constructor(){super(...arguments),this.point=null}};s([a({type:V,json:{name:"point.value",read:!0,write:!0}})],Ze.prototype,"point",void 0),Ze=s([R("esri.rest.support.ImagePointResult")],Ze);const Pi=Ze;var Rt;let G=Rt=class extends F{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}set locations(i){if(i?.length){const t=new kt({spatialReference:i[0].spatialReference,points:i.map(({x:o,y:e})=>[o,e])});this._set("locations",i),this.geometry=t}}clone(){return new Rt(C({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};s([a({types:ne,json:{read:ee}})],G.prototype,"geometry",void 0),s([I("geometry")],G.prototype,"writeGeometry",null),s([a()],G.prototype,"locations",null),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],G.prototype,"interpolation",void 0),s([a({type:H,json:{write:!0}})],G.prototype,"mosaicRule",void 0),s([a({type:[String],json:{write:!0}})],G.prototype,"outFields",void 0),s([a({type:V,json:{write:!0}})],G.prototype,"pixelSize",void 0),s([a({type:String,json:{write:!0}})],G.prototype,"raster",void 0),s([a({type:Boolean,json:{write:!0}})],G.prototype,"returnFirstValueOnly",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleDistance",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleCount",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sliceId",void 0),s([a({type:bt,json:{read:{source:"time"},write:{target:"time"}}})],G.prototype,"timeExtent",void 0),G=Rt=s([R("esri.rest.support.ImageSampleParameters")],G);const ji=G;let ue=class extends F{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};s([a({json:{write:!0}})],ue.prototype,"attributes",void 0),s([a({type:V,json:{write:!0}})],ue.prototype,"location",void 0),s([a({json:{write:!0}})],ue.prototype,"locationId",void 0),s([a({json:{write:!0}})],ue.prototype,"rasterId",void 0),s([a({json:{write:!0}})],ue.prototype,"resolution",void 0),s([a({json:{write:!0}})],ue.prototype,"pixelValue",void 0),ue=s([R("esri.rest.support.ImageSample")],ue);const Ni=ue;let Xe=class extends F{constructor(){super(...arguments),this.samples=null}};s([a({type:[Ni],json:{write:!0}})],Xe.prototype,"samples",void 0),Xe=s([R("esri.rest.support.ImageSampleResult")],Xe);const _i=Xe;let be=class extends fe(F){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(i,t,o){t.geometries=i?.length?{geometryType:Y(i[0]),geometries:i.map(e=>({...e.toJSON(),spatialReference:void 0}))}:null}};s([a({types:[ne]})],be.prototype,"geometries",void 0),s([I("geometries")],be.prototype,"writeGeometries",null),s([a({type:[Le],json:{write:!0}})],be.prototype,"rasterIds",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],be.prototype,"outSpatialReference",void 0),be=s([R("esri.rest.support.ImageToMapMultirayParameters")],be);const Oi=be;let pe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}};s([a({types:ne,json:{read:ee,write:!0}})],pe.prototype,"geometry",void 0),s([I("geometry")],pe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],pe.prototype,"rasterId",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],pe.prototype,"outSpatialReference",void 0),s([a({json:{name:"options.DOff",write:!0}})],pe.prototype,"depthOffset",void 0),s([a({json:{name:"options.Adjust",write:!0}})],pe.prototype,"adjust",void 0),pe=s([R("esri.rest.support.ImageToMapParameters")],pe);const Ci=pe;let Me=class extends fe(F){constructor(){super(...arguments),this.referenceUri=null,this.rasterId=null}};s([a({type:String,json:{name:"uri",write:!0}})],Me.prototype,"referenceUri",void 0),s([a({type:Number,json:{write:!0}})],Me.prototype,"rasterId",void 0),Me=s([R("esri.rest.support.ImageUrlParameters")],Me);const Ai=Me;let Ye=class extends F{constructor(){super(...arguments),this.url=null}};s([a({json:{name:"imageURL",write:!0}})],Ye.prototype,"url",void 0),Ye=s([R("esri.rest.support.ImageUrlResult")],Ye);const Vi=Ye;let Se=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i))}};s([a({types:ne,json:{read:ee,write:!0}})],Se.prototype,"geometry",void 0),s([I("geometry")],Se.prototype,"writeGeometry",null),s([a({json:{write:!0}})],Se.prototype,"rasterId",void 0),s([a({json:{name:"options.VisibleOnly",write:!0}})],Se.prototype,"visibleOnly",void 0),Se=s([R("esri.rest.support.MapToImageParameters")],Se);const Mi=Se;let me=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(i,t){return i.spatialReference||(i={...i,spatialReference:t.Shape.spatialReference}),V.fromJSON(i)}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],me.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],me.prototype,"length",void 0),s([a({json:{name:"Area",write:!0}})],me.prototype,"area",void 0),s([a({json:{name:"Center",write:!0}})],me.prototype,"center",void 0),s([E("center")],me.prototype,"readCenter",null),me=s([R("esri.rest.support.MeasureAreaFromImageResult")],me);const Ji=me;var vt;let je=vt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}clone(){const i=C({geometry:this.geometry,rasterId:this.rasterId});return new vt(i)}};s([a({types:ne,json:{name:"fromGeometry",read:ee,write:!0}})],je.prototype,"geometry",void 0),s([I("geometry")],je.prototype,"writeGeometry",null),s([a({json:{write:!0}})],je.prototype,"rasterId",void 0),je=vt=s([R("esri.rest.support.MeasureFromImageParameters")],je);const Ei=je;let Je=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],Je.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],Je.prototype,"length",void 0),Je=s([R("esri.rest.support.MeasureLengthFromImageResult")],Je);const qi=Je;function St(i){const t=i?.time;if(t&&(t.start!=null||t.end!=null)){const o=[];t.start!=null&&o.push(t.start),t.end==null||o.includes(t.end)||o.push(t.end),i.time=o.join(",")}}async function Gt(i,t,o){t=M(hr,t);const e=q(i),r=t.geometry?[t.geometry]:[],n=await xe(r),l=t.toJSON();St(l);const u=n?.[0];u!=null&&(l.geometry=se(u));const p=L({...e.query,f:"json",...l});return $(p,o)}async function Gi(i,t,o){const e=(t=M(pi,t)).toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),t?.point?.spatialReference?.imageCoordinateSystem&&(e.point.spatialReference=st(t.point.spatialReference)),t?.spatialReference?.imageCoordinateSystem&&(e.spatialReference=_e(t.spatialReference));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/computeAngles`,l);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new re({wkid:0,imageCoordinateSystem:u.spatialReference}):re.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new ci(u)}async function Li(i,t,o){const e=(t=M(Fi,t)).toJSON(),{geometries:r}=t;if(r)for(let m=0;m{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:l,histograms:n.histograms}}async function zi(i,t,o){const e=await Gt(i,t,o),r=q(i),{data:n}=await x(`${r.path}/computeHistograms`,e);return{histograms:n.histograms}}async function Ui(i,t,o){const e=(t=M(ji,t)).toJSON();St(e),e.outFields?.length&&(e.outFields=e.outFields.join(","));const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=q(i),u=L({...l.query,f:"json",...e}),p=$(u,o),{data:m}=await x(`${l.path}/getSamples`,p),c=m?.samples?.map(d=>{const g=d.value==="NaN"||d.value===""?null:d.value.split(" ").map(h=>Number(h));return{...d,pixelValue:g}});return _i.fromJSON({samples:c})}async function jt(i,t,o){t=M(qt,t);const e=q(i),r=t.geometry?[t.geometry]:[];return xe(r).then(n=>{const l=t.toJSON(),u=n?.[0];u!=null&&(l.geometry=JSON.stringify(se(u)));const p=L({...e.query,f:"json",...l}),m=$(p,o);return x(e.path+"/identify",m)}).then(n=>Ii.fromJSON(n.data))}async function Hi(i,t,o){t=M(Si,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return xi.fromJSON(e)}async function Bi(i,t,o){t=M(mi,t);const e=await it(i,t,[t.geometry],o);return di.fromJSON(e)}async function Qi(i,t,o){t=M(Ti,t);const e=await it(i,t,[t.geometry],o);return Pi.fromJSON(e)}async function ki(i,t,o){t=M(gi,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return fi.fromJSON(e)}async function it(i,t,o,e){const r=q(i),n=await xe(o),l=t.toJSON();n[0]!=null&&(l.fromGeometry=JSON.stringify(se(n[0]))),n[1]!=null&&(l.toGeometry=JSON.stringify(se(n[1])));const u=L({...r.query,f:"json",...l}),p=$(u,e),{data:m}=await x(r.path+"/measure",p);return m}async function Wi(i,t,o){const e=await Lt(i,t,o);return qi.fromJSON(e)}async function Ki(i,t,o){const e=await Lt(i,t,o);return Ji.fromJSON(e)}async function Lt(i,t,o){t=M(Ei,t);const e=q(i),r=t.toJSON(),n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/measureFromImage",l);return u}function se(i){const t=i.toJSON();return i.spatialReference?.imageCoordinateSystem&&(t.spatialReference=st(i.spatialReference)),t}function st(i){const{imageCoordinateSystem:t}=i;if(t){const{id:o,referenceServiceName:e}=t;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:t}}return i.toJSON()}function _e(i,t){if(!i.imageCoordinateSystem)return pt(i);const o=st(i),{icsid:e,icsns:r}=o;return e==null||r!=null&&!t?.toLowerCase().includes("/"+r.toLowerCase()+"/")?JSON.stringify(o):`0:${e}`}async function Zi(i,t,o){t=M(yi,t);const e=q(i),r=t.toJSON();t.outSpatialReference&&(r.outSR=_e(t.outSpatialReference));const n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/queryBoundary",l);return hi.fromJSON(u)}async function Xi(i,t,o){const e=(t=M(wi,t)).toJSON();St(e),e.objectIds?.length&&(e.objectIds=e.objectIds.join(",")),e.geometry||e.objectIds||e.time||e.where||(e.where="1=1");const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/queryGPSInfo`,m);return bi.fromJSON(c)}async function Yi(i,t,o){const e=(t=M(Ci,t)).toJSON();t.geometry.spatialReference.imageCoordinateSystem&&(e.geometry=se(t.geometry)),t.depthOffset&&t.adjust||delete e.options;const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMap`,l);return ee(u)}async function es(i,t,o){const e=(t=M(Oi,t)).toJSON();t.rasterIds?.length&&(e.rasterIds=t.rasterIds.join(","));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMapMultiray`,l);return ee(u)}async function ts(i,t,o){const e=(t=M(Mi,t)).toJSON(),r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n)),t.visibleOnly||delete e.options;const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/mapToImage`,m);return ee(c)}async function rs(i,t,o){const e=(t=M(Ai,t)).toJSON(),r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/getImageUrl`,l);return Vi.fromJSON(u)}async function is(i,t,o){const e=(t=M(oi,t)).toJSON(),r=await xe([t.fromGeometry,t.toGeometry]);r[0]!=null&&(e.fromGeometry=se(r[0]),r[0].spatialReference&&(e.inSR=_e(r[0].spatialReference))),r[1]!=null&&(e.toGeometry=se(r[1])),t.objectIds?.length&&(e.objectIds=e.objectIds.join(","));const n=q(i),l=L({...n.query,f:"json",...e}),u=$(l,o),{data:p}=await x(`${n.path}/find`,u);return ui.fromJSON(p)}async function ss(i,t,o){const e=q(i),r=L({...e?.query,f:"json"}),n=$(r,o),l=`${e?.path}/${t}/info`,u=x(`${l}`,n),p=x(`${l}/keyProperties`,n),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let g=null;c.statistics?.length&&(g=c.statistics.map(J=>({min:J[0],max:J[1],avg:J[2],stddev:J[3]})));const h=Ee.fromJSON(c.extent),f=Math.ceil(h.width/c.pixelSizeX-.1),y=Math.ceil(h.height/c.pixelSizeY-.1),v=h.spatialReference,w=new V({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:v}),T=c.histograms?.length?c.histograms:null,j=new _r({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Nt({width:f,height:y,bandCount:c.bandCount,extent:h,spatialReference:v,pixelSize:w,pixelType:c.pixelType.toLowerCase(),statistics:g,histograms:T,keyProperties:d,storageInfo:j})}const ns=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),as=Xt(Yt,{min:0,max:255});function os(i){const t=JSON.stringify(i),o=t.includes('"rasterFunctionDefinition":{'),e=o?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),r=e?.map(n=>o?n.slice(8,-18):n.slice(18,-1));return r?r.join("/"):null}const ls=i=>{let t=class extends i{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new _({layer:this}))}readServiceSupportsMosaicRule(e,r){return this._isMosaicRuleSupported(r)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(r=>{e.set(r.name.toLowerCase().replaceAll(/ /gi,"_"),r.name)}),e}readBandIds(e,r){if(Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="number"))return e}readCapabilities(e,r){return this._readCapabilities(r)}writeCompressionQuality(e,r,n){e!=null&&this.format!=="lerc"&&(r[n]=e)}writeCompressionTolerance(e,r,n){this.format==="lerc"&&e!=null&&(r[n]=e)}readDefaultMosaicRule(e,r){return this._serviceSupportsMosaicRule?H.fromJSON(r):null}get fieldsIndex(){return this.fields?new Cr(this.fields):null}set format(e){e&&ns.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,r){return r.serviceDataType==="esriImageServiceDataTypeVector-UV"||r.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}readMaxScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}set mosaicRule(e){let r=e;r?.mosaicMethod&&(r=H.fromJSON({...r.toJSON(),mosaicMethod:r.mosaicMethod,mosaicOperation:r.mosaicOperation})),this._set("mosaicRule",r)}readMosaicRule(e,r){const n=e||r.mosaicRule;return n?H.fromJSON(n):this._isMosaicRuleSupported(r)?H.fromJSON(r):null}writeMosaicRule(e,r,n){let l=this.mosaicRule;const u=this.definitionExpression;l?u&&u!==l.where&&(l=l.clone(),l.where=u):u&&(l=new H({where:u})),this._isValidCustomizedMosaicRule(l)&&(r[n]=l.toJSON())}writeNoData(e,r,n){e!=null&&typeof e=="number"&&(r[n]=as(e))}readObjectIdField(e,r){return e||(e=r.fields.find(n=>n.type==="esriFieldTypeOID"||n.type==="oid")?.name),e}get parsedUrl(){return Wt(this.url)}readSourceType(e,r){return this._isMosaicDataset(r)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:r}=this;return e?r?.find(({name:n})=>n===e)?.renderer.clone():this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,r,n){const l=r?.layerDefinition?.drawingInfo?.renderer,u=ar(l,n);return u==null?null:(u.type==="vector-field"&&r.symbolTileSize&&!l.symbolTileSize&&(u.symbolTileSize=r.symbolTileSize),At(u)||It.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,r,n){r.layerDefinition=r.layerDefinition||{},r.layerDefinition.drawingInfo=r.layerDefinition.drawingInfo||{},r.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(r.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this._rasterAttributeTableFieldPrefix,r=new we({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new we({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),l=new we({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?C(this.fields):[];u.push(n),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(r),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(m=>m.name.toLowerCase()==="none")&&u.push(l),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(m=>m.name.toLowerCase()!=="none").forEach(m=>{u.push(new we({name:"Raster.ServicePixelValue."+m.name,alias:m.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new we({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new we({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const m=p.fields.filter(c=>c.type!=="esriFieldTypeOID"&&c.name.toLowerCase()!=="value").map(c=>{const d=C(c);return d.name=e+c.name,d});u=u.concat(m)}return u}set rasterFunction(e){let r=e;r?.rasterFunction&&(r=S.fromJSON({...r.toJSON(),rasterFunction:r.rasterFunction,rasterFunctionArguments:r.rasterFunctionArguments})),this._set("rasterFunction",r)}readRasterFunction(e,r){const n=r.rasterFunctionInfos;return r.renderingRule||n?.length&&n[0].name!=="None"?this._isRFTJson(r.renderingRule)?S.fromJSON({rasterFunctionDefinition:r.renderingRule}):S.fromJSON(r.renderingRule||{rasterFunctionInfos:r.rasterFunctionInfos}):null}readSpatialReference(e,r){const n=e||r.extent.spatialReference;return n?re.fromJSON(n):null}readPixelType(e){return nt.fromJSON(e)||e}writePixelType(e,r,n){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(r[n]=nt.toJSON(e))}readVersion(e,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("fields")||r.hasOwnProperty("timeInfo")?10:9.3),n}applyFilter(e){let r=e;return this.pixelFilter&&(r=this._clonePixelData(e),this.pixelFilter(r)),r}async applyRenderer(e,r){let n=e;const{renderer:l,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&l&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(l.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,r),this._cachedRendererJson=l.toJSON());const g=await d.symbolize({bandIds:m,...e},r);n={extent:e.extent,pixelBlock:g}}else n={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return n}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeAngles)throw new b("imagery-layer:compute-angles","this operation is not supported on the input image service");return Gi(this.url,e,this._getRequestOptions(r))}async computePixelSpaceLocations(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputePixelLocation)throw new b("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return Li(this.url,e,this._getRequestOptions(r))}async computeHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeHistograms)throw new b("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),zi(this.url,e,this._getRequestOptions(r))}async computeStatisticsHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeStatisticsHistograms)throw new b("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),$i(this.url,e,this._getRequestOptions(r))}async measureHeight(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(e.operationType==="base-and-top"?n.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new b("imagery-layer:measure-height","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Hi(this.url,e,this._getRequestOptions(r))}async measureAreaAndPerimeter(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsAreaAndPerimeter&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Bi(this.url,e,this._getRequestOptions(r))}async measureDistanceAndAngle(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsDistanceAndAngle&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),ki(this.url,e,this._getRequestOptions(r))}async measurePointOrCentroid(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsPointOrCentroid&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Qi(this.url,e,this._getRequestOptions(r))}async measureLengthFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polyline")throw new b("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return Wi(this.url,e,this._getRequestOptions(r))}async measureAreaFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polygon")throw new b("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return Ki(this.url,e,this._getRequestOptions(r))}getField(e){const{fieldsIndex:r}=this;return r?.get(e)}getFieldDomain(e,r){const n=this.getField(e);return n?n.domain:null}async fetchImage(e,r,n,l={}){if(e==null||r==null||n==null)throw new b("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const d=await this._generateRasterInfo(this.rasterFunction,{signal:l.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,r,n,l.timeExtent);if(u==null){if(l.requestAsImageElement&&this._canRequestImageElement(this.format)){const w=document.createElement("canvas");return w.width=r,w.height=n,l.returnImageBitmap?{imageBitmap:await Tt(w,`${o(this.parsedUrl)}/exportImage`,l.signal)}:{imageOrCanvasElement:w}}const{bandIds:d,rasterInfo:g}=this,h=(d?.length||g.bandCount)??0,f=r*n,y=g.pixelType,v=[];for(let w=0;w=10.3?e?.rasterFunction:null})}).then(r=>r.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):x(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(r=>Ct.fromJSON(r.data))}getCatalogItemRasterInfo(e,r){const n={...r,query:this._getQueryParams()};return ss(o(this.parsedUrl),e,n)}async getCatalogItemICSInfo(e,r){const{data:n}=await x(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...r}),l=n?.ics;if(!l)return;let u=null;try{u=(await x(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...r})).data.extent}catch{}if(!u?.spatialReference)return{ics:l,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?x(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...r}).then(P=>P.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:pt(m),outSR:"0:"+e},d=x(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...r}).then(P=>P.data).catch(()=>({})),g=5,h=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(g+1),y=u.ymin+f,v=[];for(let P=0;PP.data).catch(()=>({})),j=await Promise.all([p,d,T]);let J=j[0].ipxf;if(J==null){const P=l.geodataXform?.xf_0;P?.name?.toLowerCase()==="topup"&&P?.coefficients?.length===6&&(J={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:P.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const N=Ee.fromJSON(j[1]?.geometries?.[0]);N&&(N.spatialReference=new re({wkid:0,imageCoordinateSystem:l}));const D=j[2].geometries?j[2].geometries.filter(P=>P?.x!=null&&P.y!=null&&P.x!=="NaN"&&P.y!=="NaN"):[],A=D.length;if(A<3)return{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:null};let U=0,Oe=0,$e=0,ze=0;for(let P=0;PD[0].x,xt=D[g-1].y>D[0].y;return Q===1/0?k=xt?90:270:Q===0?k=Ie?0:180:Q>0?k=Ie?180*Math.atan(Q)/Math.PI:180*Math.atan(Q)/Math.PI+180:Q<0&&(k=xt?180+180*Math.atan(Q)/Math.PI:360+180*Math.atan(Q)/Math.PI),{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:k}}async generateRasterInfo(e,r){e=M(S,e);const n={...r,query:this._getQueryParams()};if(!e||e.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(e))return this.serviceRasterInfo??Ft(o(this.parsedUrl),this.sourceJSON,n);const l=os(e);if(!l)throw new b("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[l])return this._functionRasterInfos[l];const u=or(o(this.parsedUrl),e,n);this._functionRasterInfos[l]=u;try{return await u}catch(p){throw this._functionRasterInfos[l]=null,p}}getExportImageServiceParameters(e,r,n,l){e=e.clone().shiftCentralMeridian();const u=_e(e.spatialReference,o(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const g=this.rasterFunction?.rasterFunctionDefinition,h=this.renderer?.type,f=!h||h==="raster-stretch"||h==="raster-colormap"||h==="unique-value"||h==="class-breaks"||h==="raster-shaded-relief";if(m?.length&&this._hasRasterFunction(this.rasterFunction)&&!g&&f){const w={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")w.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=w;else if(d.rasterFunction==="Colormap"){const T=d.rasterFunctionArguments.Raster;T?.rasterFunction==="Stretch"?(w.rasterFunctionArguments.Raster=T.rasterFunctionArguments.Raster,T.rasterFunctionArguments.Raster=w):(w.rasterFunctionArguments.Raster=T,d.rasterFunctionArguments.Raster=w)}else w.rasterFunctionArguments.Raster=d,d=w;p.bandIds=void 0}else p.bandIds=m?.join(",");Array.isArray(c)&&c.length>0&&(p.noData=c.join(","));const y=this._processMultidimensionalIntersection(null,l,this.exportImageServiceParameters.mosaicRule);if(y.isOutSide)return null;p.mosaicRule=y.mosaicRule!=null?JSON.stringify(y.mosaicRule):null,l=y.timeExtent,p.renderingRule=this._getRenderingRuleString(S.fromJSON(d));const v={};if(l!=null){const{start:w,end:T}=l.toJSON();w&&T&&w===T?v.time=""+w:w==null&&T==null||(v.time=`${w??"null"},${T??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:r+","+n,...p,...v}}async getSamples(e,r){if(!(await this._fetchCapabilities(r?.signal))?.operations.supportsGetSamples)throw new b("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=C(e);const{raster:n}=this;return n&&e.raster==null&&(e.raster=n),Ui(this.url,e,this._getRequestOptions(r))}async identify(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsIdentify)throw new b("imagery-layer:identify","identify operation is not supported on the input image service");e=C(e),this.version<10.91&&e.geometry?.type==="extent"&&(e.geometry=ut.fromExtent(e.geometry));const n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new b("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;const{raster:l,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),l&&e.raster==null&&(e.raster=l),jt(this.url,e,this._getRequestOptions(r))}async imageToMap(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMap)throw new b("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return Yi(o(this.parsedUrl),e,this._getRequestOptions(r))}async imageToMapMultiray(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMapMultiray)throw new b("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return es(o(this.parsedUrl),e,this._getRequestOptions(r))}async mapToImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMapToImage)throw new b("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return ts(o(this.parsedUrl),e,this._getRequestOptions(r))}async findImages(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsFindImages)throw new b("imagery-layer:find-images","findImages operation is not supported on the input image service");return is(o(this.parsedUrl),e,this._getRequestOptions(r))}async getImageUrl(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsGetImageUrl)throw new b("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return rs(o(this.parsedUrl),e,this._getRequestOptions(r))}createQuery(){return new lt({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryBoundary)throw new b("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Zi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasters(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Jr(this.url,e,r)}async queryObjectIds(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Vr(this.url,e,r)}async queryGPSInfo(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryGPSInfo)throw new b("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},Xi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasterCount(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Mr(this.url,e,r)}async queryVisibleRasters(e,r){if(!e)throw new b("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:n,returnDomainValues:l,returnTopmostRaster:u,showNoDataRecords:p}=r||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const g="raster.servicepixelvalue",h=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(N=>!N.toLowerCase().includes(g)),this.version>=10.4)){const N=e.outFields.filter(A=>A.toLowerCase().includes(g)&&A.length>g.length).map(A=>{const U=A.slice(g.length+1);return[this._updateRenderingRulesFunctionName(U,h),U]});c=N.map(A=>new S({functionName:A[0]})),d=N.map(A=>A[1]);const{rasterFunction:D}=this;c.length===0?D?.functionName?(c.push(D),d.push(D.functionName)):c=null:D?.functionName&&!c.some(A=>A.functionName===D.functionName)&&(c.push(D),d.push(D.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:y}=this;let v=e.timeExtent||this.timeExtent;if(y){const{isOutside:N,intersection:D}=at(y,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(N)throw new b("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");D?.timeExtent!=null&&(v=D.timeExtent)}const w=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,v);let T=e.geometry;this.version<10.91&&T?.type==="extent"&&(T=ut.fromExtent(T));const j=this._getQueryParams({geometry:T,timeExtent:v,mosaicRule:w,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete j.f;const J=new qt(j);try{await this._generateRasterInfo(this.rasterFunction);const N=await jt(this.url,J,{signal:r?.signal,query:{...this.customParameters}}),D=e.outFields,A=N.value!=null&&N.value.toLowerCase().includes("nodata");if(!(m&&!f&&N?.catalogItems?.features.length&&(p||!A)))return this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D});const U=this.objectIdField||"ObjectId",Oe=N.catalogItems?.features??[],$e=Oe.map(k=>k.attributes?.[U]),ze=new lt({objectIds:$e,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[U]}),Q=await this.queryRasters(ze);return Q?.features?.length&&Q.features.forEach(k=>{Oe.forEach(Ie=>{Ie.attributes[U]===k.attributes[U]&&k.geometry&&(Ie.geometry=k.geometry.clone(),e.outSpatialReference!=null&&(Ie.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D})}catch{throw new b("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,r){const n=x(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.statistics),l=x(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.histograms),u=await Promise.all([n,l]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,r){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(e,r):Ir(e.meshType,e.simulationSettings,e.flowData,r.signal!=null?r.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const r=e??this.serviceRasterInfo.multidimensionalInfo;return vr(this.multidimensionalSubset,r)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const r=this.sourceJSON,n=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Ft(o(this.parsedUrl),r,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),lr(p,r),p)),l=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([n,l,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),It.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([Kt(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,r){const n=this.timeInfo,{multidimensionalInfo:l}=this.serviceRasterInfo;if(e==null||l==null||r==null||n?.startField==null)return e;const{startField:u}=n,p=l.variables.some(y=>y.dimensions.some(v=>v.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(y=>y.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(y=>y.dimensionName===p),c=r.start!=null?r.start.getTime():null,d=r.end!=null?r.end.getTime():null,g=c==null||d==null||c===d,h=g?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(y=>{y.dimensionName===p&&(f?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=g,y.values=h))});else if(!f){const y=e.multidimensionalDefinition.filter(v=>v.variableName!=null&&v.dimensionName==null);y.length?y.forEach(v=>{v.dimensionName=p,v.isSlice=g,v.values=h}):e.multidimensionalDefinition.push(new br({variableName:"",dimensionName:p,isSlice:g,values:h}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(r=>!(!r.variableName&&!r.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQuery)throw new b("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?M(lt,e):this.createQuery(),r=this._getRequestOptions(r),this.raster&&(r.query={...r.query,raster:this.raster}),{query:e,requestOptions:r}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new yr;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:r,rasterFunction:n}=this;return e.type==="unique-value"&&this._hasRasterFunction(n)&&r?.bandCount===1&&["u8","s8"].includes(r.pixelType)||r!=null&&e!=null&&ur(r).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let r=this.sourceJSON;if(!r){const{data:n,ssl:l}=await x(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});r=n,this.sourceJSON=r,l&&(this.url=this.url.replace(/^http:/i,"https:"))}if(r.capabilities?.toLowerCase().split(",").map(n=>n.trim()).indexOf("tilesonly")>-1)throw new b("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(r,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const r=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return r||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:r,functionArguments:n}=e,l=r?.toLowerCase()==="resample",u=n?.ResampleType||n?.resampleType;return l&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const r=this._isPicture(),{rasterInfo:n}=this;if(!r&&!this.pixelFilter||this._isVectorDataSet()){const l=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,u=pr({variableName:l,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&n.bandCount>=3){const m=u?.bandIds??cr(n);!m||n.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=u?.renderer??mr(n,{bandIds:this.bandIds,variableName:this.rasterFunction?null:l}));const p=dr(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=n):this.symbolizer=new jr({rendererJSON:p,rasterInfo:n}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){e?.renderingRule!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:r,viewId:n}=this;return{raster:r,viewId:n,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,r,n){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:r}):Dt(e,r,n)}async _getRasterFunctionInfos(e){const r=this.sourceJSON.rasterFunctionInfos;return this.loaded?r:r&&this.version>=10.3?r.length===1&&r[0].name.toLowerCase()==="none"?r:(await x(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:r,requestAsImageElement:n,returnImageBitmap:l,signal:u}=e;if(n&&this._canRequestImageElement(r.format)){const f=`${o(this.parsedUrl)}/exportImage`,{data:y}=await x(f,{responseType:l?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return y instanceof Blob?{imageBitmap:await Tt(y,f,u),params:r}:{imageOrCanvasElement:y,params:r}}const p=this._initJobHandler(),m=x(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=r.format||"jpgpng";let g=d;if(g!=="bsq"&&g!=="bip"&&(g=Nr(c)),!g)throw new b("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const h={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(g==="png"||g==="jpg")?Dt(c,{useCanvas:!0,...r},h):this._decodePixelBlock(c,{width:r.width,height:r.height,planes:null,pixelType:null,noDataValue:null,format:d},h)),extent:r.extent},params:r}}_generateRasterInfo(e,r){return this.generateRasterInfo(e,r).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let r=Sr(e,{multidimensionalSubset:this.multidimensionalSubset});if(r!=null&&r.length>0){this.mosaicRule=this.mosaicRule||new H;const n=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!=="none"&&r.forEach(l=>l.variableName=""),r=r.filter(({variableName:l,dimensionName:u})=>l&&l!=="*"||u),!n?.length&&r.length&&(this.mosaicRule.multidimensionalDefinition=r)}}_processVisibleRastersResponse(e,r){r=r||{};const n=e.value,{templateRRFunctionNames:l,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=r,c=e.processedValues;let d=e.catalogItems?.features,g=e.properties?.Values?.map(j=>j.replaceAll(/ /gi,", "))||[];const h=this.objectIdField||"ObjectId",f=typeof n=="string"&&n.toLowerCase().includes("nodata"),y=[];if(n&&!d&&!f){const j={};j[h]=0,g=[n],d=[new Zt({geometry:this.fullExtent,attributes:j})]}if(!d)return[];let v,w,T;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let j=0;j0&&l&&l.length>0&&l.includes(this.rasterFunction.functionName)?c[l.indexOf(this.rasterFunction.functionName)]:n,w.toLowerCase()==="nodata"&&!u)continue;const J="Raster.ItemPixelValue",N="Raster.ServicePixelValue";v.attributes[J]=w,v.attributes[N]=T,this._updateFeatureWithMagDirValues(v,w);const D=this.fields&&this.fields.length>0;let A=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?D?w:n:T;this.rasterFunction||(A=D?w:n),this._updateFeatureWithRasterAttributeTableValues(v,A)}if(v.sourceLayer=v.layer=this,p&&this._updateFeatureWithDomainValues(v),l&&c&&l.length===c.length)for(let J=0;Jc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=l.filter(c=>c.attributes[p]===(r!=null?parseInt(r,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,r){if(!this._isVectorDataSet())return;const n=r.split(/,\s*/).map(c=>parseFloat(c)),l=n.map(c=>[c]),u=n.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new ot({height:1,width:1,pixelType:"f32",pixels:l,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new Ee(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:Fr([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){(this.fields&&this.fields.filter(r=>r.domain&&r.domain.type==="coded-value"))?.forEach(r=>{const n=e.attributes[r.name];if(n!=null){const l=r.domain.codedValues.find(u=>u.code===n);l&&(e.attributes[r.name]=l.name)}})}_updateResponseFieldNames(e,r){if(!r||r.length<1)return;const n=this.fieldsIndex;n!=null&&e.forEach(l=>{if(l?.attributes)for(const u of r){const p=n.get(u)?.name;p&&p!==u&&(l.attributes[u]=l.attributes[p],delete l.attributes[p])}})}_getRenderingRuleString(e){if(e){let r=e.toJSON();return r=r.rasterFunctionDefinition??r,(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=null),JSON.stringify(r)}return null}_hasRasterFunction(e){return e?.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,r){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const n=e.toLowerCase().replaceAll(/ /gi,"_");return r.has(n)?r.get(n):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:r,mosaicRule:n,rasterFunction:l}=this;l&&"rasterFunction"in e&&e.rasterFunction==null&&(e.rasterFunction=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),r&&e.raster==null&&(e.raster=r)}_readCapabilities(e){const r=e.capabilities?e.capabilities.toLowerCase().split(",").map(w=>w.trim()):["image","catalog"],{currentVersion:n,advancedQueryCapabilities:l,maxRecordCount:u}=e,p=r.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!e.extent?.spatialReference),d=r.includes("edit"),g=r.includes("mensuration")&&c,h=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(w=>w.trim()),f=g&&h.includes("basic"),y=this._isMosaicDataset(e)&&r.includes("catalog"),v=r.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsImageToMap:n>=11.2&&y,supportsImageToMapMultiray:n>=11.2&&y,supportsMapToImage:n>=11.2&&y,supportsFindImages:n>=11.2&&y,supportsGetImageUrl:n>=11.3&&v,supportsMeasure:g,supportsMeasureFromImage:n>=11.2,supportsDownload:v,supportsQuery:y&&e.fields&&e.fields.length>0,supportsGetSamples:n>=10.2&&p,supportsProject:n>=10.3&&p,supportsComputeStatisticsHistograms:n>=10.4&&p,supportsQueryBoundary:n>=10.6&&p,supportsCalculateVolume:n>=10.7&&m,supportsComputePixelLocation:n>=10.7&&y,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&y,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!l?.supportsStatistics,supportsOrderBy:!!l?.supportsOrderBy,supportsDistinct:!!l?.supportsDistinct,supportsPagination:!!l?.supportsPagination,supportsStandardizedQueriesOnly:!!l?.useStandardizedQueries,supportsPercentileStatistics:!!l?.supportsPercentileStatistics,supportsCentroid:!!l?.supportsReturningGeometryCentroid,supportsDistance:!!l?.supportsQueryWithDistance,supportsExtent:!!l?.supportsReturningQueryExtent,supportsGeometryProperties:!!l?.supportsReturningGeometryProperties,supportsHavingClause:!!l?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!l?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:g&&h.includes("base-top height"),supportsHeightFromBaseAndTopShadow:g&&h.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:g&&h.includes("top-top shadow height"),supports3D:g&&h.includes("3d")}}}};function o(e){return e?.path??""}return s([a({clonable:!1})],t.prototype,"_functionRasterInfos",void 0),s([a({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),s([a({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),s([a({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),s([E("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),s([a({readOnly:!0})],t.prototype,"_rasterAttributeTableFieldPrefix",void 0),s([a({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),s([a()],t.prototype,"adjustAspectRatio",void 0),s([a({type:[Le],json:{write:!0}})],t.prototype,"bandIds",void 0),s([E("bandIds")],t.prototype,"readBandIds",null),s([a({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),s([E("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),s([a({type:Number})],t.prototype,"compressionQuality",void 0),s([I("compressionQuality")],t.prototype,"writeCompressionQuality",null),s([a({type:Number})],t.prototype,"compressionTolerance",void 0),s([I("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),s([a({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),s([a({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"defaultMosaicRule",void 0),s([E("defaultMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultMosaicRule",null),s([a({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),s([a({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),s([a()],t.prototype,"rasterInfo",void 0),s([a({readOnly:!0,type:[we]})],t.prototype,"fields",void 0),s([a({readOnly:!0})],t.prototype,"fieldsIndex",null),s([a({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],t.prototype,"format",null),s([E("service","format",["serviceDataType"])],t.prototype,"readFormat",null),s([a({type:Ee})],t.prototype,"fullExtent",void 0),s([a({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),s([a({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),s([a({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],t.prototype,"interpolation",void 0),s([a()],t.prototype,"minScale",void 0),s([E("service","minScale")],t.prototype,"readMinScale",null),s([a()],t.prototype,"maxScale",void 0),s([E("service","maxScale")],t.prototype,"readMaxScale",null),s([a({type:H})],t.prototype,"mosaicRule",null),s([E("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),s([I("mosaicRule")],t.prototype,"writeMosaicRule",null),s([a()],t.prototype,"multidimensionalInfo",void 0),s([a({type:ir,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),s([a({json:{type:Le}})],t.prototype,"noData",void 0),s([I("noData")],t.prototype,"writeNoData",null),s([a({type:String,json:{type:qe.jsonValues,read:qe.read,write:qe.write}})],t.prototype,"noDataInterpretation",void 0),s([a({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),s([E("objectIdField")],t.prototype,"readObjectIdField",null),s([a({readOnly:!0})],t.prototype,"geometryType",void 0),s([a({})],t.prototype,"typeIdField",void 0),s([a({})],t.prototype,"types",void 0),s([a({readOnly:!0})],t.prototype,"parsedUrl",null),s([a({type:Function})],t.prototype,"pixelFilter",void 0),s([a()],t.prototype,"raster",void 0),s([a({readOnly:!0})],t.prototype,"sourceType",void 0),s([E("sourceType",["serviceSourceType","fields"])],t.prototype,"readSourceType",null),s([a()],t.prototype,"viewId",void 0),s([a()],t.prototype,"renderer",null),s([a({types:sr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:nr,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],t.prototype,"internalRenderer",null),s([E("internalRenderer")],t.prototype,"readRenderer",null),s([I("internalRenderer")],t.prototype,"writeRenderer",null),s([a({clonable:!1})],t.prototype,"symbolizer",void 0),s([a(wr)],t.prototype,"opacity",void 0),s([a({readOnly:!0})],t.prototype,"rasterFields",null),s([a({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),s([a({type:S,json:{name:"renderingRule"}})],t.prototype,"rasterFunction",null),s([E("rasterFunction",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRasterFunction",null),s([a({readOnly:!0})],t.prototype,"serviceDataType",void 0),s([a({readOnly:!0,type:re})],t.prototype,"spatialReference",void 0),s([E("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),s([a({json:{type:nt.jsonValues}})],t.prototype,"pixelType",void 0),s([E("pixelType")],t.prototype,"readPixelType",null),s([I("pixelType")],t.prototype,"writePixelType",null),s([a({constructOnly:!0,type:Nt})],t.prototype,"serviceRasterInfo",void 0),s([a()],t.prototype,"sourceJSON",void 0),s([a(Rr)],t.prototype,"url",void 0),s([a({readOnly:!0})],t.prototype,"version",void 0),s([E("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=s([R("esri.layers.mixins.ArcGISImageService")],t),t};let z=class extends qr(Hr(Ur(Lr($r(rr(ls(zr(Gr(Er(er(fe(tr)))))))))))){constructor(...i){super(...i),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=Ut(async(t,o,e)=>{const{save:r,saveAs:n}=await Ht(()=>import("./imageryUtils-6MVSqijr-wws7sSH-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);switch(t){case Ue.SAVE:return r(this,o);case Ue.SAVE_AS:return n(this,e,o)}})}normalizeCtorArgs(i,t){return typeof i=="string"?{url:i,...t}:i}load(i){const t=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},i).catch(Bt).then(()=>this._fetchService(t))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(i){this._set("legendEnabled",i)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(i){this._set("listMode",i)}writeOperationalLayerType(i,t,o){const e=this.renderer?.type==="vector-field";t[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(i){const t=this.rasterFields,o=this.title,e=new Set;let r=!1,n=!1;this.capabilities&&(r=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const l=new Set;r&&l.add("raster.itempixelvalue");for(const p of t){const m=p.name.toLowerCase();l.has(m)||m.includes("raster.servicepixelvalue.")||e.add(p.name)}n&&e.add("raster.magnitude").add("raster.direction");const u=Qr({fields:t,title:o},{...i,visibleFieldNames:e});return u?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&u.fieldInfos.forEach(({format:p,fieldName:m})=>{p&&m&&/^raster\.(item|service)pixelvalue/i.test(m)&&(p.places=2)}),u}queryFeatures(i,t){return this.queryRasters(i,t).then(o=>{if(o?.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(i,t){return this.queryRasterCount(i,t)}redraw(){this.emit("redraw")}async save(i){return this._debouncedSaveOperations(Ue.SAVE,i)}async saveAs(i,t){return this._debouncedSaveOperations(Ue.SAVE_AS,t,i)}serviceSupportsSpatialReference(i){return Br(this,i)}write(i,t){if(!this._isPreviewLayer)return super.write(i,t);if(t?.messages){const o=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new b("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this}))}return null}};s([a(gr)],z.prototype,"legendEnabled",null),s([a({type:["show","hide"]})],z.prototype,"listMode",null),s([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],z.prototype,"isReference",void 0),s([a({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],z.prototype,"operationalLayerType",void 0),s([I("web-map","operationalLayerType")],z.prototype,"writeOperationalLayerType",null),s([a(fr)],z.prototype,"popupEnabled",void 0),s([a({type:Qt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],z.prototype,"popupTemplate",void 0),s([a({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),s([a({readOnly:!0,json:{read:!1}})],z.prototype,"type",void 0),s([a({readOnly:!0})],z.prototype,"_isPreviewLayer",null),z=s([R("esri.layers.ImageryLayer")],z);const Tn=z;export{Tn as default}; diff --git a/main/assets/ImageryLayerView2D-CVDvTIGY-5bfgF9Fc.js b/main/assets/ImageryLayerView2D-CVDvTIGY-5bfgF9Fc.js deleted file mode 100644 index 30dbb001e..000000000 --- a/main/assets/ImageryLayerView2D-CVDvTIGY-5bfgF9Fc.js +++ /dev/null @@ -1,4 +0,0 @@ -import{v as s,S as o,i as w,ah as f,av as V,ag as E,bi as b,a2 as S,K as F,j as R,aU as _,a1 as P,bp as I,n as D,ax as $,f as A,bM as U,o as C,$ as L,w as q}from"./main-BZaw9FpY.js";import{o as M}from"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import{o as N,c as O,l as j}from"./RasterVFDisplayObject-CnriTVT9-DOIQa1VK.js";import{X as H,Y as G}from"./LayerView-Bish-E63-DRGspiuk.js";import{X as J}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import{l as W}from"./HighlightGraphicContainer-Dt5r6lMq-C0o3U8Y8.js";import{z as X,P as K,w as Q}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{d as Y}from"./BitmapContainer-BC8fvmFc-DzZ9OrT1.js";import{x as Z}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{d as tt}from"./Bitmap-CcqmzvfR-Cl_blWW9.js";import{K as et}from"./ExportStrategy-BNE7Gp0u-CVNDsUmZ.js";import{o as it}from"./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js";import{E as B}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{N as rt}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{T as st}from"./timeSupport-ohWmWReZ-CwKm-94j.js";import{b as at}from"./Query-BrwMGK8U-sojFdYaD.js";import{m as ot}from"./popupUtils-nV1O8RUO-xbvi-u4x.js";import{n as nt}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./signal-CETehA7D-vStzfbaY.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";let h=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new Z,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Y}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(e=>{_(e)||P.getLogger(this).error(e)})}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new et({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=await this.layer.applyRenderer({extent:e.extent,pixelBlock:e.originalPixelBlock??e.pixelBlock});e.filter=r=>this.layer.pixelFilter?this.layer.applyFilter(r):{...i,extent:e.extent}}).catch(t=>{_(t)||P.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(t.length===1&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(a=>a.source).filter(a=>a.extent&&a.extent.intersects(e)).map(a=>({extent:a.extent,pixelBlock:a.originalPixelBlock})),r=X(i,e);return r!=null?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,r.returnImageBitmap=!0;const a=await this.layer.fetchImage(t,e,i,r);if(a.imageBitmap)return a.imageBitmap;const n=await this.layer.applyRenderer(a.pixelData,{signal:r.signal}),l=new tt(n.pixelBlock,n.extent?.clone(),a.pixelData.pixelBlock);return l.filter=u=>this.layer.applyFilter(u),l}};s([o()],h.prototype,"attached",void 0),s([o()],h.prototype,"container",void 0),s([o()],h.prototype,"layer",void 0),s([o()],h.prototype,"strategy",void 0),s([o()],h.prototype,"timeExtent",void 0),s([o()],h.prototype,"view",void 0),s([o()],h.prototype,"updateRequested",void 0),s([o()],h.prototype,"updating",null),s([o()],h.prototype,"type",void 0),h=s([w("esri.views.2d.layers.imagery.ImageryView2D")],h);const lt=h;class ht extends rt{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf)",brushes:[j],target:()=>this.children,drawPhase:B.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===B.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}}let y=class extends R{constructor(t){super(t),this._loading=null,this.update=I((e,i)=>this._update(e,i).catch(r=>{_(r)||P.getLogger(this).error(r)}))}get updating(){return!!this._loading}redraw(t){if(!this.container.children.length)return;const e=this.container.children[0];e.symbolizerParameters=t,e.invalidateVAO(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(t,e,i){if(!t.stationary)return;const{extent:r,spatialReference:a}=t.state,n=new D({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:a}),[l,u]=t.state.size;this._loading=this.fetchPixels(n,l,u,i);const m=await this._loading;this._addToDisplay(m,e,t.state),this._loading=null}_addToDisplay(t,e,i){if(t.pixelBlock==null)return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:a}=t,n=new O(a);n.offset=[0,0],n.symbolizerParameters=e,n.rawPixelData=t,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=a.width*e.symbolTileSize,n.height=a.height*e.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};s([o()],y.prototype,"fetchPixels",void 0),s([o()],y.prototype,"container",void 0),s([o()],y.prototype,"_loading",void 0),s([o()],y.prototype,"updating",null),y=s([w("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const pt=y;let p=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new ht,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(t,e,i,r)=>{const a=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:u,height:m}=K(t,e,i,n,a);if(a!=null&&!a.intersects(t))return{extent:l,pixelBlock:null};const d={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(d)){const c=this.getPixelData();if(c!=null&&`${c.extent.xmin}, ${c.extent.ymin}, ${c.extent.xmax}, ${c.extent.ymax}`===d.bbox)return c}const{pixelData:v}=await this.layer.fetchImage(l,u,m,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});this._dataParameters=d;const g=v?.pixelBlock;return g==null?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?Q(g,"vector-uv"):g}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new pt({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(f(()=>this.layer.renderer,t=>this._updateSymbolizerParams(t),$),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(t=>t.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const t=this.container.children[0]?.rawPixelData;if(this.updating||!t)return null;const{extent:e,pixelBlock:i}=t;return{extent:e,pixelBlock:i}}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}update(t){this._strategy.update(t,this._symbolizerParams).catch(e=>{_(e)||P.getLogger(this).error(e)})}redraw(){const{renderer:t}=this.layer;t&&(this._updateSymbolizerParams(t),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(t){const e=this._dataParameters.exportParametersVersion===t.exportParametersVersion,i=this._dataParameters.time===t.time,r=this._dataParameters.symbolTileSize===t.symbolTileSize,a=this._dataParameters.bbox===t.bbox;return e&&i&&r&&a}async _getProjectedFullExtent(t){try{return it(this.layer.fullExtent,t)}catch{try{const e=(await A(this.layer.url,{query:{option:"footprints",outSR:U(t),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return e?D.fromJSON(e):null}catch{return null}}}_updateSymbolizerParams(t){t.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};s([o()],p.prototype,"attached",void 0),s([o()],p.prototype,"container",void 0),s([o()],p.prototype,"layer",void 0),s([o()],p.prototype,"timeExtent",void 0),s([o()],p.prototype,"type",void 0),s([o()],p.prototype,"view",void 0),s([o()],p.prototype,"updating",null),p=s([w("esri.views.2d.layers.imagery.VectorFieldView2D")],p);const mt=p,dt=t=>{let e=class extends t{constructor(){super(...arguments),this.view=null}get timeExtent(){return st(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,r){const{layer:a}=this;if(!i)throw new C("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:n}=a,l=ot(a,r);if(!n||l==null)return[];const u=await l.getRequiredFields();L(r);const m=new at;m.timeExtent=this.timeExtent,m.geometry=i,m.outFields=u,m.outSpatialReference=i.spatialReference;const{resolution:d,spatialReference:v}=this.view,g=this.view.type==="2d"?new q(d,d,v):new q(.5*d,.5*d,v),{returnTopmostRaster:c,showNoDataRecords:k}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},z={returnDomainValues:!0,returnTopmostRaster:c,pixelSize:g,showNoDataRecords:k,signal:r?.signal};return a.queryVisibleRasters(m,z).then(T=>T)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return s([o()],e.prototype,"layer",void 0),s([o()],e.prototype,"suspended",void 0),s([o({readOnly:!0})],e.prototype,"timeExtent",null),s([o()],e.prototype,"view",void 0),e=s([w("esri.views.layers.ImageryLayerView")],e),e};let x=class extends dt(nt(H(G))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new M,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new J({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new W(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([f(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},V),f(()=>this.timeExtent,t=>{const{subview:e}=this;e&&(e.timeExtent=t,"redraw"in e?this.requestUpdate():e.redrawOrRefetch())},V),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),f(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(t,e){if(!((Array.isArray(t)?t[0]:E.isCollection(t)?t.at(0):t)instanceof b))return S();let i=[];return Array.isArray(t)||E.isCollection(t)?i=t.map(r=>r.clone()):t instanceof b&&(i=[t.clone()]),this._highlightGraphics.addMany(i),S(()=>this._highlightGraphics.removeMany(i))}async doRefresh(){this.requestUpdate()}isUpdating(){const t=!this.subview||this.subview.updating||!!this._highlightView?.updating;return F("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${t} --> subview ${!this.subview||this.subview.updating} --> higlightView ${this._highlightView?.updating} -`),t}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let e="imagery";if(t==="vector-field"?e="imageryVF":t==="flow"&&(e="flow"),this.subview){const{type:i}=this.subview;if(i===e)return this._attachSubview(this.subview),void(i==="flow"?this.subview.redrawOrRefetch():i==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}this.subview=e==="imagery"?new lt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):e==="imageryVF"?new mt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new N({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}};s([o()],x.prototype,"pixelData",null),s([o()],x.prototype,"subview",void 0),x=s([w("esri.views.2d.layers.ImageryLayerView2D")],x);const wi=x;export{wi as default}; diff --git a/main/assets/ImageryLayerView2D-CVDvTIGY-C8PDlzd1.js b/main/assets/ImageryLayerView2D-CVDvTIGY-C8PDlzd1.js new file mode 100644 index 000000000..1c1302d54 --- /dev/null +++ b/main/assets/ImageryLayerView2D-CVDvTIGY-C8PDlzd1.js @@ -0,0 +1,4 @@ +import{v as s,S as o,i as w,ah as f,av as V,ag as E,bi as b,a2 as S,K as F,j as R,aU as _,a1 as P,bp as I,n as D,ax as $,f as A,bM as U,o as C,$ as L,w as q}from"./main-C7yV2j71.js";import{o as M}from"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import{o as N,c as O,l as j}from"./RasterVFDisplayObject-CnriTVT9-7AFXrs58.js";import{X as H,Y as G}from"./LayerView-Bish-E63-I2LV0oDm.js";import{X as J}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import{l as W}from"./HighlightGraphicContainer-Dt5r6lMq-BNbDeHiI.js";import{z as X,P as K,w as Q}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{d as Y}from"./BitmapContainer-BC8fvmFc-CH1ryNve.js";import{x as Z}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{d as tt}from"./Bitmap-CcqmzvfR-C92VuEM3.js";import{K as et}from"./ExportStrategy-BNE7Gp0u-CdeT3qVb.js";import{o as it}from"./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js";import{E as B}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{N as rt}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{T as st}from"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import{b as at}from"./Query-BrwMGK8U-DV_czrJX.js";import{m as ot}from"./popupUtils-nV1O8RUO-X6GWMgRY.js";import{n as nt}from"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./signal-CETehA7D-DxK1orqE.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";let h=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new Z,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Y}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(e=>{_(e)||P.getLogger(this).error(e)})}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new et({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=await this.layer.applyRenderer({extent:e.extent,pixelBlock:e.originalPixelBlock??e.pixelBlock});e.filter=r=>this.layer.pixelFilter?this.layer.applyFilter(r):{...i,extent:e.extent}}).catch(t=>{_(t)||P.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(t.length===1&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(a=>a.source).filter(a=>a.extent&&a.extent.intersects(e)).map(a=>({extent:a.extent,pixelBlock:a.originalPixelBlock})),r=X(i,e);return r!=null?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,r.returnImageBitmap=!0;const a=await this.layer.fetchImage(t,e,i,r);if(a.imageBitmap)return a.imageBitmap;const n=await this.layer.applyRenderer(a.pixelData,{signal:r.signal}),l=new tt(n.pixelBlock,n.extent?.clone(),a.pixelData.pixelBlock);return l.filter=u=>this.layer.applyFilter(u),l}};s([o()],h.prototype,"attached",void 0),s([o()],h.prototype,"container",void 0),s([o()],h.prototype,"layer",void 0),s([o()],h.prototype,"strategy",void 0),s([o()],h.prototype,"timeExtent",void 0),s([o()],h.prototype,"view",void 0),s([o()],h.prototype,"updateRequested",void 0),s([o()],h.prototype,"updating",null),s([o()],h.prototype,"type",void 0),h=s([w("esri.views.2d.layers.imagery.ImageryView2D")],h);const lt=h;class ht extends rt{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf)",brushes:[j],target:()=>this.children,drawPhase:B.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===B.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}}let y=class extends R{constructor(t){super(t),this._loading=null,this.update=I((e,i)=>this._update(e,i).catch(r=>{_(r)||P.getLogger(this).error(r)}))}get updating(){return!!this._loading}redraw(t){if(!this.container.children.length)return;const e=this.container.children[0];e.symbolizerParameters=t,e.invalidateVAO(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(t,e,i){if(!t.stationary)return;const{extent:r,spatialReference:a}=t.state,n=new D({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:a}),[l,u]=t.state.size;this._loading=this.fetchPixels(n,l,u,i);const m=await this._loading;this._addToDisplay(m,e,t.state),this._loading=null}_addToDisplay(t,e,i){if(t.pixelBlock==null)return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:a}=t,n=new O(a);n.offset=[0,0],n.symbolizerParameters=e,n.rawPixelData=t,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=a.width*e.symbolTileSize,n.height=a.height*e.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};s([o()],y.prototype,"fetchPixels",void 0),s([o()],y.prototype,"container",void 0),s([o()],y.prototype,"_loading",void 0),s([o()],y.prototype,"updating",null),y=s([w("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const pt=y;let p=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new ht,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(t,e,i,r)=>{const a=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:u,height:m}=K(t,e,i,n,a);if(a!=null&&!a.intersects(t))return{extent:l,pixelBlock:null};const d={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(d)){const c=this.getPixelData();if(c!=null&&`${c.extent.xmin}, ${c.extent.ymin}, ${c.extent.xmax}, ${c.extent.ymax}`===d.bbox)return c}const{pixelData:v}=await this.layer.fetchImage(l,u,m,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});this._dataParameters=d;const g=v?.pixelBlock;return g==null?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?Q(g,"vector-uv"):g}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new pt({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(f(()=>this.layer.renderer,t=>this._updateSymbolizerParams(t),$),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(t=>t.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const t=this.container.children[0]?.rawPixelData;if(this.updating||!t)return null;const{extent:e,pixelBlock:i}=t;return{extent:e,pixelBlock:i}}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}update(t){this._strategy.update(t,this._symbolizerParams).catch(e=>{_(e)||P.getLogger(this).error(e)})}redraw(){const{renderer:t}=this.layer;t&&(this._updateSymbolizerParams(t),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(t){const e=this._dataParameters.exportParametersVersion===t.exportParametersVersion,i=this._dataParameters.time===t.time,r=this._dataParameters.symbolTileSize===t.symbolTileSize,a=this._dataParameters.bbox===t.bbox;return e&&i&&r&&a}async _getProjectedFullExtent(t){try{return it(this.layer.fullExtent,t)}catch{try{const e=(await A(this.layer.url,{query:{option:"footprints",outSR:U(t),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return e?D.fromJSON(e):null}catch{return null}}}_updateSymbolizerParams(t){t.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};s([o()],p.prototype,"attached",void 0),s([o()],p.prototype,"container",void 0),s([o()],p.prototype,"layer",void 0),s([o()],p.prototype,"timeExtent",void 0),s([o()],p.prototype,"type",void 0),s([o()],p.prototype,"view",void 0),s([o()],p.prototype,"updating",null),p=s([w("esri.views.2d.layers.imagery.VectorFieldView2D")],p);const mt=p,dt=t=>{let e=class extends t{constructor(){super(...arguments),this.view=null}get timeExtent(){return st(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,r){const{layer:a}=this;if(!i)throw new C("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:n}=a,l=ot(a,r);if(!n||l==null)return[];const u=await l.getRequiredFields();L(r);const m=new at;m.timeExtent=this.timeExtent,m.geometry=i,m.outFields=u,m.outSpatialReference=i.spatialReference;const{resolution:d,spatialReference:v}=this.view,g=this.view.type==="2d"?new q(d,d,v):new q(.5*d,.5*d,v),{returnTopmostRaster:c,showNoDataRecords:k}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},z={returnDomainValues:!0,returnTopmostRaster:c,pixelSize:g,showNoDataRecords:k,signal:r?.signal};return a.queryVisibleRasters(m,z).then(T=>T)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return s([o()],e.prototype,"layer",void 0),s([o()],e.prototype,"suspended",void 0),s([o({readOnly:!0})],e.prototype,"timeExtent",null),s([o()],e.prototype,"view",void 0),e=s([w("esri.views.layers.ImageryLayerView")],e),e};let x=class extends dt(nt(H(G))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new M,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new J({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new W(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([f(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},V),f(()=>this.timeExtent,t=>{const{subview:e}=this;e&&(e.timeExtent=t,"redraw"in e?this.requestUpdate():e.redrawOrRefetch())},V),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),f(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(t,e){if(!((Array.isArray(t)?t[0]:E.isCollection(t)?t.at(0):t)instanceof b))return S();let i=[];return Array.isArray(t)||E.isCollection(t)?i=t.map(r=>r.clone()):t instanceof b&&(i=[t.clone()]),this._highlightGraphics.addMany(i),S(()=>this._highlightGraphics.removeMany(i))}async doRefresh(){this.requestUpdate()}isUpdating(){const t=!this.subview||this.subview.updating||!!this._highlightView?.updating;return F("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${t} +-> subview ${!this.subview||this.subview.updating} +-> higlightView ${this._highlightView?.updating} +`),t}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let e="imagery";if(t==="vector-field"?e="imageryVF":t==="flow"&&(e="flow"),this.subview){const{type:i}=this.subview;if(i===e)return this._attachSubview(this.subview),void(i==="flow"?this.subview.redrawOrRefetch():i==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}this.subview=e==="imagery"?new lt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):e==="imageryVF"?new mt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new N({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}};s([o()],x.prototype,"pixelData",null),s([o()],x.prototype,"subview",void 0),x=s([w("esri.views.2d.layers.ImageryLayerView2D")],x);const wi=x;export{wi as default}; diff --git a/main/assets/ImageryTileLayer-DixyNESc-BPxwTHVO.js b/main/assets/ImageryTileLayer-DixyNESc-BPxwTHVO.js deleted file mode 100644 index 7a7055717..000000000 --- a/main/assets/ImageryTileLayer-DixyNESc-BPxwTHVO.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-BRF8cFYX.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-CV-sFImk.js","./imageryUtils-6MVSqijr-DkiL-1bk.js","./utils-BVWK2jiA-Ewzf326n.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./jsonContext-BA8GHqVk-BMETb6sX.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js"])))=>i.map(i=>d[i]); -import{v as w,S as b,i as K,aa as wt,bp as It,W as bt,aO as Ae,o as C,ah as Rt,a1 as ne,bL as vt,e as St,w as A,n as W,f as at,J as L,E as Tt,_ as ot,l as _t,bB as Ft,bz as kt,a0 as Ct,iF as lt,K as Ot,aS as Pt,O as Mt,a as Nt,aq as Me,fd as Dt,aG as Et,jz as Jt,ar as Bt,dc as At}from"./main-BZaw9FpY.js";import{m as Lt}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as Ht}from"./Layer-ChoECxvZ-C4wLrCej.js";import{a as zt}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as Wt}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as Gt}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{J as $t,k as Ne,p as qt,A as Vt,l as jt,c as Ut,V as Yt,E as Kt,a as Xt,Z as Qt,b as je,I as Ue,T as Zt,v as ei,w as ti,C as ii,S as Ye,f as si}from"./RasterPresetRendererMixin-D6W9pUY6-BpvSTPuo.js";import{j as ct}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{Z as ut,_ as ri}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{R as ht,J as mt,Y as ni,I as ai,g as Le,j as Ke,p as oi,T as Xe,z as li}from"./multidimensionalUtils-BwTugeu7-CpzGLouA.js";import{V as ee,d as ci}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{V as ui,c as Re,W as ve,S as hi,d as He,s as ze,b as mi,u as fi,v as pi,A as di,D as yi,E as pe,F as gi,H as xi,N as wi,J as Ii,t as bi,L as Qe}from"./RasterSymbolizer-BVys6HkM-CeBx4Ld8.js";import{K as Ze,U as et,V as tt,X as Ri,Q as vi}from"./RawBlockCache-Cj_tmHDm-d1RSObdh.js";import{f as Te,A as ft,M as Si,v as Ti,x as _i,b as Fi,k as ki,y as Ci,E as Oi,D as we,w as Pi,R as Mi,K as Ni}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{k as de,L as De,n as it,Q as st,X as Di,s as _e,o as Ie,K as Ei,Y as Ji,W as Bi,F as Ee}from"./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js";import{k as Ai}from"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import{D as Li,h as pt,E as Je,v as We,x as Hi,B as zi}from"./PolynomialTransform-C3nWCu0l-Draevh5B.js";import{O as Ge}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{E as Wi}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as Gi}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as $i}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as qi}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as Vi}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{y as ce}from"./Field-C6hA1tZj-CbELM0zp.js";import{f as ji}from"./TilemapCache-CRRxws77-B5V8seF0.js";import{w as Ui}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{E as ye}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./utils-DPtQ14k3-D1wtSpry.js";import"./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./signal-CETehA7D-vStzfbaY.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";const rt=8,Yi=256;let Ki=0,J=class extends St{constructor(){super(...arguments),this._tileFetchQueue=new Ai({concurrency:32,process:(t,e)=>this._fetchRawTile(t.pyramidLevel,t.row,t.col,{...t.options,signal:e})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(t){return t?.ioConfig&&(t={...t,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:ee.create(),...t.ioConfig}}),t}get _isGlobalWrappableSource(){const{rasterInfo:t}=this,e=de(t.spatialReference);return e!=null&&t.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:t}=this.rasterInfo;return t==null||t.type==="gcs-shift"}set rasterJobHandler(t){this._set("rasterJobHandler",t),this.datasetFormat==="Function"&&this.primaryRasters?.rasters?.forEach(e=>e.rasterJobHandler=t)}get rasterId(){return this.url||"rasterId-"+Ki++}set url(t){this._set("url",ct(t,ne.getLogger(this)))}async open(t){return this._openPromise??=De().then(()=>this._open(t)),this._openPromise}async fetchTile(t,e,r,i={}){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,a=this.getTileExtentFromTileInfo(t,e,r,s);return i={noClip:!0,...i},this.fetchPixels(a,s.size[0],s.size[1],i)}async identify(t,e={}){t=Ae(A,t).clone().normalize();const{multidimensionalDefinition:r,timeExtent:i}=e,{rasterInfo:s}=this,{hasMultidimensionalTranspose:a,multidimensionalInfo:n}=s;let{transposedVariableName:l}=e;const o=n!=null&&a&&(i!=null||ht(r));o&&!l&&(l=r!=null&&r.length>0?r[0].variableName??void 0:n.variables[0].name,e={...e,transposedVariableName:l}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:u}=s,{datumTransformation:f}=e;let h=it(t,c,f);if(!u.intersects(h))return{location:h,value:null};if(s.transform!=null){const F=s.transform.inverseTransform(h);if(!s.nativeExtent.intersects(F))return{location:F,value:null};h=F}let m=0;const y=l!=null&&n!=null&&s.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const F=this.primaryRasters.rasters[0];if(y)return F.identify(h,e);const{pixelSize:M}=s,O=3,N=M.x*O/2,D=M.y*O/2,B=new W({xmin:h.x-N,xmax:h.x+N,ymin:h.y-D,ymax:h.y+D,spatialReference:c}),z={interpolation:"nearest",multidimensionalDefinition:r,sliceId:e.sliceId},{pixelBlock:j}=await F.fetchPixels(B,O,O,z),{pixelBlock:G}=await this.fetchPixels(B,O,O,z);if(j==null)return{location:h,value:null};const $=Math.floor(O*O*.5),X=!j.mask||j.mask[$]?j.pixels.map(V=>V[$]):null;let te;return G!=null&&(te=!G.mask||G.mask[$]?G.pixels.map(V=>V[$]):void 0),{location:h,value:X,processedValue:te,pyramidLevel:0}}if(!y){if(e.srcResolution)m=st(e.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(m=await this.computeBestPyramidLevelForLocation(t,e),m==null)return{location:h,value:null}}const g=this.identifyPixelLocation(h,m,null,y);if(g===null)return{location:h,value:null};const{row:p,col:d,rowOffset:x,colOffset:I,blockWidth:R}=g,S=l??e.sliceId,T=Ze(this.rasterId,S),v=`${m}/${p}/${d}`;let k=et(T,null,v);k==null&&(k=this.fetchRawTile(m,p,d,e),tt(T,null,v,k));const _=await k;if(!_?.pixels?.length)return{location:h,value:null};const P=x*R+I;return this._processIdentifyResult(_,{srcLocation:h,position:P,pyramidLevel:m,useTransposedTile:!!y,requestSomeSlices:o,identifyOptions:e})}async fetchPixels(t,e,r,i={}){t=Di(t),i=this._getRequestOptionsWithSliceId(i);const{_hasNoneOrGCSShiftTransform:s}=this;if(i.requestRawData&&s)return this._fetchPixels(t,e,r,i);const a=de(t.spatialReference),n=_e(t);if(a==null||n===0||n===1&&this._isGlobalWrappableSource&&s)return this._fetchPixels(t,e,r,i);if(n>=3)return{extent:t,pixelBlock:null};const l=[],{xmin:o,xmax:c}=t,u=Math.round(a/(c-o)*e),f=u-Math.round((a/2-o)/(c-o)*e);let h=0;const m=[];for(let d=0;d<=n;d++){const x=new W({xmin:d===0?o:-a/2,xmax:d===n?c-a*d:a/2,ymin:t.ymin,ymax:t.ymax,spatialReference:t.spatialReference}),I=d===0?u-f:d===n?e-h:u;h+=I,m.push(I);const R=i.disableWrapAround&&d>0?null:this._fetchPixels(x,I,r,i);l.push(R)}const y=(await Promise.all(l)).map(d=>d?.pixelBlock);let g=null;const p={width:e,height:r};return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:y,srcMosaicSize:p,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i)).pixelBlock:g=Te(y,p,{blockWidths:m}),{extent:t,srcExtent:Ie(t,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:g}}async fetchRawPixels(t,e,r,i={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const s=await this._fetchRawTiles(t,e,r,i),{nativeExtent:a,nativePixelSize:n,storageInfo:l}=this.rasterInfo,o=2**t,c=n.x*o,u=n.y*o,f=new W({xmin:a.xmin+c*e.x,xmax:a.xmin+c*(e.x+r.width-1),ymin:a.ymax-u*(e.y+r.height-1),ymax:a.ymax-u*e.y,spatialReference:a.spatialReference});if(!s)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:h,mosaicSize:m}=s;if(h.length===1&&h[0]!=null&&h[0].width===r.width&&h[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:s.pixelBlocks[0]};const y=t>0?l.pyramidBlockWidth:l.blockWidth,g=t>0?l.pyramidBlockHeight:l.blockHeight,p={x:e.x%y,y:e.y%g};let d;return this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:m,destDimension:r,clipOffset:p,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:d=Te(h,m,{clipOffset:p,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:d}}fetchRawTile(t,e,r,i){throw new C("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(t){return Ie(this.rasterInfo.extent,t)}decodePixelBlock(t,e){return!this.rasterJobHandler||e.useCanvas?ui(t,e):this.rasterJobHandler.decode({data:t,options:e})}async request(t,e,r=0){const{customFetchParameters:i}=this.ioConfig,{range:s,query:a,headers:n}=e;r=r??e.retryCount??this.ioConfig.retryCount;const l=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await at(t,{...e,query:{...a,...i},headers:{...n,...l}})}catch(o){if(r>0)return r--,this.request(t,e,r);throw o}}getSliceIndex(t){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||t==null||t.length===0?null:mt(t,e)}getTileExtentFromTileInfo(t,e,r,i){const s=i.lodAt(t);return this.getTileExtent({x:s.resolution,y:s.resolution},e,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:t,spatialReference:e,extent:r,pixelSize:i}=this.rasterInfo,{pyramidResolutions:s}=t;if(!t.tileInfo){const a=[],n=t.maximumPyramidLevel||0;let l=(i.x+i.y)/2,o=1/.0254*96*l;for(let u=0;u<=n&&(a.unshift(new ci({level:n-u,resolution:l,scale:o})),u!==n);u++)if(s){const f=(s[u].x+s[u].y)/2;o*=f/l,l=f}else l*=2,o*=2;const c=new A({x:r.xmin,y:r.ymax,spatialReference:e});t.tileInfo=new ee({origin:c,size:[t.blockWidth,t.blockHeight],spatialReference:e,lods:a}),t.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(t,e=512,r=512,i){const{width:s,height:a,nativeExtent:n,pixelSize:l,spatialReference:o}=t,c=new A({x:n.xmin,y:n.ymax,spatialReference:o});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(s,a))/Math.LN2-8)));const u=this.computeBlockBoundary(n,512,512,{x:n.xmin,y:n.ymax},[l],i);t.storageInfo=new Re({blockWidth:e,blockHeight:r,pyramidBlockWidth:e,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(t,e={}){return 0}computeBlockBoundary(t,e,r,i,s,a=0,n=2){if(s.length===1&&a>0){s=[...s];let{x:u,y:f}=s[0];for(let h=0;hl)return null;const m=this.getPyramidPixelSize(e),{x:y,y:g}=m,p=(o.y-h.y)/g/f,d=(h.x-o.x)/y/u,x=Math.min(f-1,Math.floor((p-Math.floor(p))*f)),I=Math.min(u-1,Math.floor((d-Math.floor(d))*u));return{pyramidLevel:e,row:Math.floor(p),col:Math.floor(d),rowOffset:x,colOffset:I,blockWidth:u,srcLocation:h}}getTileExtent(t,e,r,i,s,a){const[n,l]=a,o=i.x+r*n*t.x,c=o+n*t.x,u=i.y-e*l*t.y,f=u-l*t.y;return new W({xmin:o,xmax:c,ymin:f,ymax:u,spatialReference:s})}getBlockWidthHeight(t){return{blockWidth:t>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:t>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(t,e,r){const i=this.rasterInfo.storageInfo.blockBoundary[t];return!i||i.maxRowe||i.minCol>r}updateImageSpaceRasterInfo(t){const{pixelSize:e}=t,{width:r,height:i}=t,s=L.WebMercator;t.spatialReference=s,t.extent=t.nativeExtent=new W({xmin:-.5,ymax:.5,xmax:r-.5,ymin:.5-i,spatialReference:s}),t.isPseudoSpatialReference=!0,t.transform=null,t.pixelSize=new A({x:1,y:1,spatialReference:s});const{extent:a,storageInfo:n}=t;if(n){n.origin=new A({x:a.xmin,y:a.ymax,spatialReference:s});const{pyramidResolutions:l,tileInfo:o}=n;if(l&&l.forEach(c=>{c.x/=e.x,c.y/=e.y}),o){o.origin=n.origin;const c=(t.nativePixelSize.x+t.nativePixelSize.y)/2;o.lods.forEach((u,f)=>{u.resolution=c*2**f,u.scale=96*u.resolution/.0254})}}}async _fetchPixels(t,e,r,i={}){let s=_e(t);if(s>=2)return{extent:t,pixelBlock:null};const a=this._getSourceDataInfo(t,e,r,i),{pyramidLevel:n,srcResolution:l,srcExtent:o,srcWidth:c,srcHeight:u,ul:f}=a;if(c===0||u===0)return{extent:t,srcExtent:o,pixelBlock:null};const{rasterInfo:h}=this,m=h.transform,y=m?.type==="gcs-shift",g=de(t.spatialReference)!=null;!y&&g||(s=_e(a.srcExtent,y));const p=await this._fetchRawTiles(n,f,{width:c,height:u,wrapCount:s},i);if(!p)return{extent:t,srcExtent:o,pixelBlock:null};const d=h.storageInfo,x=n>0?d.pyramidBlockWidth:d.blockWidth,I=n>0?d.pyramidBlockHeight:d.blockHeight;let{x:R,y:S}=h.pixelSize;if(n>0){const{pyramidResolutions:Q,pyramidScalingFactor:xt}=d;if(Q!=null&&Q[n-1])({x:R,y:S}=Q[n-1]);else{const Ve=xt**n;R*=Ve,S*=Ve}}const T=h.spatialReference,v=new A({x:R,y:S,spatialReference:T}),k=x===c&&I===u&&f.x%x==0&&f.y%I==0,_=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference}),P=!t.spatialReference.equals(T),F=T.isGeographic?1e-9:1e-4,{datumTransformation:M}=i;if(!P&&k&&p.pixelBlocks.length===1&&x===e&&I===r&&Xi(l,_,F))return{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:p.pixelBlocks[0]};const O=g&&de(o.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,N=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");N&&!this.rasterJobHandler&&await De();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_.toJSON(),datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:N},i):Ei({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_,datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:!1,includeGCSGrid:N});let B;const z=!i.requestRawData,j={rows:D.spacing[0],cols:D.spacing[1]},G=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(n,p.extent.xmin):void 0,{pixelBlocks:$,mosaicSize:X,isPartiallyFilled:te}=p;let V=null;if(this.rasterJobHandler)({pixelBlock:B,localNorthDirections:V}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:$,srcMosaicSize:X,destDimension:z?{width:e,height:r}:null,coefs:z?D.coefficients:null,sampleSpacing:z?j:null,projectDirections:N,gcsGrid:N?D.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:G,blockWidths:null},i));else{const Q=Te($,X,{alignmentInfo:G});B=z?ft(Q,{width:e,height:r},D.coefficients,j,i.interpolation):Q,N&&D.gcsGrid&&(V=Si({width:e,height:r},D.gcsGrid),B=Ti(B,this.rasterInfo.dataType,V))}return i.requestRawData||N?{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:B,transformGrid:D,localNorthDirections:V,isPartiallyFilled:te}:{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:B}}async _fetchRawTiles(t,e,r,i){const{origin:s,blockBoundary:a}=this.rasterInfo.storageInfo,{blockWidth:n,blockHeight:l}=this.getBlockWidthHeight(t);let{x:o,y:c}=e,{width:u,height:f,wrapCount:h}=r;const m=this._getRasterTileAlignmentInfo(t,0);i.buffer&&(o-=i.buffer.cols,c-=i.buffer.rows,u+=2*i.buffer.cols,f+=2*i.buffer.rows);let y=0,g=0,p=0;h&&m!=null&&({worldColumnCountFromOrigin:g,originColumnOffset:p,rightPadding:y}=m,g*m.blockWidth-y>=o+u&&(y=0));const d=Math.floor(o/n),x=Math.floor(c/l),I=Math.floor((o+u+y-1)/n),R=Math.floor((c+f+y-1)/l),S=a[t];if(!S)return null;const{minRow:T,minCol:v,maxCol:k,maxRow:_}=S;if(h===0&&(R_||d>k))return null;const P=new Array;let F=!1;const M=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let G=x;G<=R;G++)for(let $=d;$<=I;$++){let X=$;if(!i.disableWrapAround&&h&&m!=null&&g<=$&&(X=$-g-p),G>=T&&X>=v&&_>=G&&k>=X){const te=this._tileFetchQueue.push({pyramidLevel:t,row:G,col:X,options:i},{signal:i.signal});M?P.push(new Promise(V=>{te.then(Q=>V(Q)).catch(()=>{F=!0,V(null)})})):P.push(te)}else P.push(Promise.resolve(null))}if(P.length===0)return null;const O=await Promise.all(P),N={height:(R-x+1)*l,width:(I-d+1)*n},{spatialReference:D}=this.rasterInfo,B=this.getPyramidPixelSize(t),{x:z,y:j}=B;return{extent:new W({xmin:s.x+d*n*z,xmax:s.x+(I+1)*n*z,ymin:s.y-(R+1)*l*j,ymax:s.y-x*l*j,spatialReference:D}),pixelBlocks:O,mosaicSize:N,isPartiallyFilled:F}}_fetchRawTile(t,e,r,i){const s=this.rasterInfo.storageInfo.blockBoundary[t];if(!s)return Promise.resolve(null);const{minRow:a,minCol:n,maxCol:l,maxRow:o}=s;if(eo||r>l)return Promise.resolve(null);const c=Ze(this.rasterId,i.sliceId),u=`${t}/${e}/${r}`;let f=et(c,i.registryId,u);if(f==null){const h=new AbortController;f=this.fetchRawTile(t,e,r,{...i,signal:h.signal}),tt(c,i.registryId,u,f,h),f.catch(()=>Ri(c,i.registryId,u))}return i.signal&&Tt(i,()=>{vi(c,i.registryId,u)}),f}_computeMagDirValues(t){const{bandCount:e,dataType:r}=this.rasterInfo;if(!(e===2&&r==="vector-magdir"||r==="vector-uv")||t?.length!==2||!t[0]?.length)return null;const i=t[0].length;if(r==="vector-magdir"){const o=t[1].map(c=>(c+360)%360);return[t[0],o]}const[s,a]=t,n=[],l=[];for(let o=0;o=16,h=o===a&&this._requireTooManySrcTiles(n,l,e,r);if(f||h||n===0||l===0){const m=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference});let y=Bi(m,this.rasterInfo.spatialReference,t,s.datumTransformation);const g=!y||i.srcResolution&&y.x+y.y=p){const d=2**p;y={x:i.srcResolution.x*d,y:i.srcResolution.y*d}}}y&&(s.srcResolution=y,this._updateSourceDataInfo(t,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,e,r)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(t,e,r,i){const{tileInfo:s}=this.rasterInfo.storageInfo,a=Math.ceil(t/s.size[0])*Math.ceil(e/s.size[1]),n=t/r,l=e/i,o=Math.max(1,(r+i)/1024);return a>=Yi*o||n>rt||l>rt}_updateSourceDataInfo(t,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:r}=this,i=r.spatialReference,{srcResolution:s,datumTransformation:a}=e,{pyramidLevel:n,pyramidResolution:l,excessiveReading:o}=st(s,r,this.ioConfig.sampling);if(o)return;let c=e.srcExtent||Ie(t,i,a);if(c==null)return;const u=r.transform;u&&(c=u.inverseTransform(c)),e.srcExtent=c;const{x:f,y:h}=r.storageInfo.origin,m=Math.floor((c.xmin-f)/l.x+.1),y=Math.floor((h-c.ymax)/l.y+.1),g=Math.floor((c.xmax-f)/l.x-.1),p=Math.floor((h-c.ymin)/l.y-.1),d=c.width<.1*l.x?0:g-m+1,x=c.height<.1*l.y?0:p-y+1;e.pyramidLevel=n,e.pyramidResolution=l,e.srcWidth=d,e.srcHeight=x,e.ul={x:m,y}}_getRequestOptionsWithSliceId(t){return this.rasterInfo.multidimensionalInfo!=null&&t.sliceId==null&&(t={...t,sliceId:this.getSliceIndex(t.multidimensionalDefinition)}),t}_processIdentifyResult(t,e){const{srcLocation:r,position:i,pyramidLevel:s,useTransposedTile:a}=e,n=t.pixels[0].length/t.width/t.height;if(!(!t.mask||t.mask[i]))return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(l==null||!a){const p=t.pixels.map(I=>I[i]),d={location:r,value:p,pyramidLevel:s},x=this._computeMagDirValues(p.map(I=>[I]));return x?.length&&(d.magdirValue=x.map(I=>I[0])),d}let o=t.pixels.map(p=>p.slice(i*n,i*n+n)),c=this._computeMagDirValues(o);const{requestSomeSlices:u,identifyOptions:f}=e;let h=ni(l,f.transposedVariableName);if(u){const p=ai(h,f.multidimensionalDefinition,f.timeExtent);o=o.map(d=>p.map(x=>d[x])),c=c?.map(d=>p.map(x=>d[x])),h=p.map(d=>h[d])}const m=t.noDataValues||this.rasterInfo.noDataValue,y={pixels:o,pixelType:t.pixelType};let g;return m!=null&&(Fi(y,m),g=y.mask),{location:r,value:null,dataSeries:h.map((p,d)=>{const x={value:g?.[d]===0?null:o.map(I=>I[d]),multidimensionalDefinition:p.multidimensionalDefinition.map(I=>new Le({...I,isSlice:!0}))};return c?.length&&(x.magdirValue=[c[0][d],c[1][d]]),x}),pyramidLevel:s}}};function Xi(t,e,r){return Math.abs(t.x-e.x)I.fetchPixels(t,e,r,i)),u=await Promise.all(c),f=u.map(I=>I.pixelBlock),h=n||i.requestRawData?u.map(I=>I.srcTilePixelSize):null;if(i.skipRasterFunction||f.every(I=>I==null))return u[0];const m=u.find(I=>I.pixelBlock!=null)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a}):this.rasterFunction.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a});const{transformGrid:g}=u[0];if(!n||y==null||g==null){const I=i.noClip?null:this.getClippingGeometry(m.spatialReference);return i.noClip||i.requestRawData||y==null||!I||(y=await Je(y,m,I)),{...u[0],pixelBlock:y}}const p={rows:g.spacing[0],cols:g.spacing[1]};let d;this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:p,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock:d=ft(y,{width:e,height:r},g.coefficients,p,l);const x=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||i.requestRawData||d==null||x==null||(d=await Je(d,t,x)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:d}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=es(t);let i=this._clippingGeometry.get(r);return i!=null||(i=t.equals(e.spatialReference)?e:Ee(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:e}=this;this.primaryRasters?.rasters?.length?e.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(c=>c.rasterJobHandler=this.rasterJobHandler));const{rasters:r,rasterIds:i}=this.primaryRasters,s=r.map(c=>c.rasterInfo?void 0:c.open(t));await Promise.all(s);const a=r.map(({rasterInfo:c})=>c),n=e.bind({rasterInfos:a,rasterIds:i});if(e.rawSourceRasterInfos=a,!n.success||a.length===0)throw new C("raster-function:open",`cannot bind the function: ${n.error??""}`);const l=e.functionName==="Table"?e:e.functionArguments?.raster;l?.functionName==="Table"&&(e.rasterInfo.attributeTable=Ge.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const o=a[0];this.hasUniqueSourceStorageInfo=a.length===1||a.slice(1).every(c=>Zi(c,o)),this.set("sourceJSON",r[0].sourceJSON),this.set("rasterInfo",e.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&t.clippingType==="inside"){const{extent:r}=this.rasterInfo,{difference:i,densify:s}=await ot(async()=>{const{difference:n,densify:l}=await import("./geometryEngine-CdPoFSE4-BRF8cFYX.js");return{difference:n,densify:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);let a=s(_t.fromExtent(r),2*(r.width+r.height)/Qi);a=Ee(a,e.spatialReference),e=i(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};w([b({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),w([b()],ie.prototype,"tileType",void 0),w([b()],ie.prototype,"rasterFunction",void 0),w([b()],ie.prototype,"primaryRasters",void 0),ie=w([K("esri.layers.support.rasterDatasets.FunctionRaster")],ie);const dt=ie;function Zi(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:n,pixelSize:l,spatialReference:o,extent:c}=e;return i.x===l.x&&i.y===l.y&&s.equals(o)&&a.equals(c)&&r.blockHeight===n.blockHeight&&r.blockWidth===n.blockWidth&&r.maximumPyramidLevel===n.maximumPyramidLevel}function es(t){return String(t.wkid??t.wkt??t.wkt2)}const ts=t=>{let e=class extends t{constructor(...i){super(...i),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=i[0]?.raster?.datasetFormat==="Function"}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(i){this._set("multidimensionalDefinition",i),this.updateRenderer()}set rasterFunction(i){i?.functionName?.toLowerCase()==="none"&&(i=void 0),this._set("rasterFunction",i),this.updateRasterFunction()}get rasterInfo(){return Dt(ne.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(i){this._set("url",ct(i,ne.getLogger(this)))}get renderer(){if(this.type!=="imagery-tile")return this.internalRenderer;const{activePresetRendererName:i,presetRenderers:s}=this;return i?s?.find(({name:a})=>a===i)?.renderer.clone():this.internalRenderer}set renderer(i){this.type==="imagery-tile"&&(this.activePresetRendererName=null),this.internalRenderer=i}set internalRenderer(i){i==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("internalRenderer",i),this.updateRenderer())}readRenderer(i,s,a){const n=s?.layerDefinition?.drawingInfo?.renderer;return Xt(n,a)||void 0}async convertVectorFieldData(i,s){const{serviceRasterInfo:a}=this;if(i==null||!a)return null;const n=this._rasterJobHandler.instance,l=a.dataType;return n?n.convertVectorFieldData({pixelBlock:i,dataType:l},s):Pi(i,l)}async computeStatisticsHistograms(i,s){await this.load(s),i=Ae(Qt,i).clone();const{serviceRasterInfo:a}=this;if(a==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=i;if(n==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let l=n;const{spatialReference:o}=a;n.spatialReference.equals(o)||(await De(),l=n.type==="extent"?Ie(n,o):Ee(n,o));const c=i.pixelSize??new A({x:a.pixelSize.x,y:a.pixelSize.y,spatialReference:o}),{extent:u,width:f,height:h}=zi(a,l,c),m=await this.fetchPixels(u,f,h,{...s,interpolation:"nearest"});if(m.pixelBlock==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const y=await Je(m.pixelBlock,u,l),g=this._rasterJobHandler.instance;return g?g.computeStatisticsHistograms({pixelBlock:y},s):He(y)}async createFlowMesh(i,s){const a=this._rasterJobHandler.instance;return a?a.createFlowMesh(i,s):Mi(i.meshType,i.simulationSettings,i.flowData,s.signal!=null?s.signal:new AbortController().signal)}normalizeRasterFetchOptions(i){const{multidimensionalInfo:s}=this.serviceRasterInfo??{};if(s==null)return i;let a=i.multidimensionalDefinition||this.multidimensionalDefinition;a?.length||(a=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=i.timeExtent||this.timeExtent;if(a!=null&&n!=null&&(n.start!=null||n.end!=null)){a=a.map(g=>g.clone());const l=s.variables.find(({name:g})=>g===a[0].variableName)?.dimensions?.find(({name:g})=>g==="StdTime"),o=a.find(({dimensionName:g})=>g==="StdTime");if(!l||!o)return{...i,multidimensionalDefinition:null};const{start:c,end:u}=n,f=c==null?null:c.getTime(),h=u==null?null:u.getTime(),m=f??h,y=h??f;if(l.values!=null){const g=l.values.filter(p=>{if(Array.isArray(p)){if(m===y)return p[0]<=m&&p[1]>=m;const d=p[0]<=m&&p[1]>m||p[0]=y,x=p[0]>=m&&p[1]<=y||p[0]y;return d||x}return m===y?p===m:p>=m&&p<=y});if(g.length){const p=g.sort((d,x)=>{const I=Array.isArray(d)?d[0]:d,R=Array.isArray(d)?d[1]:d,S=Array.isArray(x)?x[0]:x,T=Array.isArray(x)?x[1]:x;return m===y?I-S:Math.abs(R-y)-Math.abs(T-y)})[0];o.values=[p]}else a=null}else if(l.hasRegularIntervals&&l.extent){const[g,p]=l.extent;m>p||y1&&i.forEach(m=>u[m.url]=m);const f=pt(n.functionDefinition?.toJSON()??n.toJSON(),u),h=new dt({rasterFunction:f});h.rasterJobHandler=this._rasterJobHandler.instance,await h.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=h}else this.raster=s,this._cachedRasterFunctionJson=null,await s.open();if(this._cachedRendererJson=null,!a&&!n)return;const{bandIds:l}=this,{bandCount:o}=this.raster.rasterInfo,c=l?.length?l.some(u=>u>=o):o>=3;l&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:i,symbolizer:s}=this;if(!i||!s||!this.renderer)return;const{rasterInfo:a}=this.raster,n=Xe(a,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),l=n?.name,o=je({...this.renderer.toJSON(),variableName:l});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(o))return;const c=this._rasterJobHandler.instance;c&&(s.rasterInfo=Ue(a,l),s.rendererJSON=o,s.bind(),await c.updateSymbolizer(s),this._cachedRendererJson=o)}async applyRenderer(i,s){const a=i?.pixelBlock;if(!(a!=null&&a.pixels&&a.pixels.length>0))return null;let n;await this.updateRenderer();const l=this._rasterJobHandler.instance,o=this.bandIds??[];return n=l?await l.symbolize({...i,simpleStretchParams:s,bandIds:o}):this.symbolizer.symbolize({...i,simpleStretchParams:s,bandIds:o}),n}getTileUrl(i,s,a){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${i}/${s}/${a}`:""}getCompatibleTileInfo(i,s,a=!1){if(!this.loaded||s==null)return null;if(a&&i.equals(this.spatialReference))return this.tileInfo;const n=Et(i);return ee.create({size:256,spatialReference:i,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:s.xmin,y:s.ymax}})}getCompatibleFullExtent(i){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(i)||(this._compatibleFullExtent=this.raster.computeExtent(i)),this._compatibleFullExtent):null}async fetchTile(i,s,a,n={}){if(r(this),n.requestAsImageElement){const o=this.getTileUrl(i,s,a);return at(o,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(c=>c.data)}const{serviceRasterInfo:l}=this;if(l.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null){const o=n.tileInfo||l.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(i,s,a,o),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),this.renderer?.type==="raster-shaded-relief"&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(i,s,a,n)}async fetchPixels(i,s,a,n={}){return this.serviceRasterInfo.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null?{extent:i,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),s=Math.round(s),a=Math.round(a),this.raster.fetchPixels(i,s,a,n))}async identify(i,s={}){await this.load();const{raster:a,serviceRasterInfo:n}=this;if(n?.multidimensionalInfo!=null&&!(n.hasMultidimensionalTranspose&&(ht(s.multidimensionalDefinition)||s.transposedVariableName||s.timeExtent))&&(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition==null)return{location:i,value:null};const l=this.multidimensionalSubset?.areaOfInterest;if(l&&!l.contains(i))throw new C("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return a.identify(i,s)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const i=this.serviceRasterInfo?.multidimensionalInfo;if(i==null||this.serviceRasterInfo?.dataType!=="standard-time")return!1;const s=this.multidimensionalDefinition,a=s?.[0]?.variableName;return i.variables.some(n=>n.name===a&&(!s?.[0].dimensionName||n.dimensions.some(l=>l.name==="StdTime")))}getStandardTimeValue(i){return new Date(24*(i-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(i){const s=i??this.serviceRasterInfo?.multidimensionalInfo;return li(this.multidimensionalSubset,s)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const i=new si;return this._rasterJobHandler.connectionPromise=i.initialize().then(async()=>{r(this),this._rasterJobHandler.instance=i,this.raster.rasterJobHandler=i,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(this.interpolation==null){r(this);const{raster:i}=this,s=Zt(i.rasterInfo,i.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",s)}}_configDefaultRenderer(i="no"){r(this);const{rasterInfo:s}=this.raster,a=Xe(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=a?.name,l=ei({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&s.bandCount>1&&(this.bandIds=l?.bandIds??ti(s)),!this.renderer||i==="override"){const f=ii(this.raster),h=l?.renderer??Ye(s,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:f}),m=s.statistics,y=m&&m.length>0?m[0]:null,g=y?.max??0,p=y?.min??0;this.raster.datasetFormat==="WCSServer"&&h.type==="raster-stretch"&&(g>1e24||p<-1e24)&&(h.dynamicRangeAdjustment=!0,h.customStatistics=null,h.stretchType==="none"&&(h.stretchType="min-max")),this.renderer=h}const o=je({...this.renderer.toJSON(),variableName:n}),c=Ue(s,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=c):this.symbolizer=new bi({rendererJSON:o,rasterInfo:c});const u=this.symbolizer.bind();if(u.success){if(i==="auto"){const{colormap:f}=this.raster.rasterInfo,h=this.renderer;if(f!=null&&h.type==="raster-colormap"){const m=Ye(this.raster.rasterInfo);JSON.stringify(m)!==JSON.stringify(h)&&this._configDefaultRenderer("override")}else if(h.type==="raster-stretch"){const m=this.bandIds?.length,y=h.customStatistics?.length;!h.dynamicRangeAdjustment&&y&&m&&y!==m&&this._configDefaultRenderer("override")}}}else ne.getLogger(this).warn("imagery-tile-mixin",u.error||"The given renderer is not supported by the layer."),i==="auto"&&this._configDefaultRenderer("override")}};function r(i){if(!i.raster||!i.serviceRasterInfo)throw new C("imagery-tile","no raster")}return w([b({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),w([b({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),w([b({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),w([b({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),w([b({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),w([b({type:[Ft],json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.bandIds?.join(",")!=="0,1,2"}}}}})],e.prototype,"bandIds",void 0),w([b({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),w([b({json:{read:!1}})],e.prototype,"fullExtent",null),w([b({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),kt(qt)],e.prototype,"interpolation",void 0),w([b()],e.prototype,"ioConfig",void 0),w([b({type:[Le],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),w([b({type:Vt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),w([b()],e.prototype,"raster",void 0),w([b({type:Ne,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),w([b({readOnly:!0})],e.prototype,"rasterInfo",null),w([b()],e.prototype,"serviceRasterInfo",void 0),w([b()],e.prototype,"sourceJSON",void 0),w([b({readOnly:!0,type:L,json:{read:!1}})],e.prototype,"spatialReference",void 0),w([b({type:ee})],e.prototype,"tileInfo",void 0),w([b(ut)],e.prototype,"url",null),w([b()],e.prototype,"renderer",null),w([b({types:jt,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const i=this.renderer?.type==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!i}}},origins:{"web-scene":{types:Ut,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:i=>({enabled:i&&i.type!=="vector-field"&&i.type!=="flow"})}}}}})],e.prototype,"internalRenderer",null),w([Ct("internalRenderer")],e.prototype,"readRenderer",null),w([b({clonable:!1})],e.prototype,"symbolizer",void 0),e=w([K("esri.layers.mixins.ImageryTileMixin")],e),e};function yt(t){return["x","e","east","long","longitude"].includes(t.toLowerCase())}function gt(t){return["y","n","west","lat","latitude"].includes(t.toLowerCase())}function is(t){const{axes:e}=t.domain,r=Object.keys(e),i=[],s=[];let a=-1,n=-1,l=[];for(let x=0;xS.push(typeof v=="string"?new Date(v).getTime():v));const T=S[1]-S[0];i.push([S[0]-.5*T,S[S.length-1]+.5*T]),s.push(T)}else{const{start:T,stop:v,num:k}=R,_=(v-T)/(k-1);i.push([T-.5*_,v+.5*_]),s.push(_);for(let P=0;P-1&&n===-1?n=a===0?1:0:n>-1&&a===-1?a=n===0?1:0:n===-1&&a===-1&&(a=0,n=1),l=l.filter((x,I)=>!(I===a||I===n));const{referencing:o}=t.domain,c=o.find(x=>x.coordinates.includes(r[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=u==null||u==="CRS84"?4326:Number(u),h=new L({wkid:f}),[m,y]=i[a],[g,p]=i[n],d=new W({xmin:m,xmax:y,ymin:g,ymax:p,spatialReference:h});return{width:Math.round(d.width/s[a]),height:Math.round(d.height/s[n]),extent:d,dimensions:l}}function Fe(t){const e=At();return e?t[e]??Object.values(t)[0]:Object.values(t)[0]}function ke(){return Math.round(255*Math.random())}function ss(t){const e={},{parameters:r}=t;if(!r)return e;for(const[i,s]of Object.entries(r)){const{type:a,description:n,unit:l,categoryEncoding:o,observedProperty:c}=s;if(a==="Parameter"&&(e[i]={},n&&(e[i].description=Fe(n)),l&&(e[i].unit=l.label?Fe(l.label):null,e[i].symbol=l.symbol?.value),o)){const u=Object.entries(o).map((m,y)=>({OID:y,Value:Number(m[1]),ClassName:m[0].slice(m[0].lastIndexOf("/")+1),Count:1}));let f=!1;c?.categories?.length&&(c.categories.forEach(m=>{if(!m.id)return;const y=m.id.slice(m.id.lastIndexOf("/")+1),g=u.find(d=>d.ClassName===y);if(!g)return;const p=m.label?Fe(m.label):null;if(g.Label=p,m.preferredColor){const d=Bt.fromHex(m.preferredColor);d&&(f=!0,g.Red=d.r,g.Green=d.g,g.Blue=d.b)}}),f&&u.forEach(m=>{m.Red==null&&(m.Red=ke(),m.Green=ke(),m.Blue=ke())}));const h={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:u.map(m=>({attributes:m}))};f&&h.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),e[i].attributeTable=h}}return e}function rs(t){let e=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let i=0;ir&&(r=s))}return Ni(e,r)}function ns(t,e,r){const i=t.map((o,c)=>({name:o,count:e[c]})).sort((o,c)=>o.name>c.name?-1:1),s=(a=1,o=>a*=o.count);var a;const n=[...i.slice(1),{name:"",count:1}].reverse().map(s).reverse();let l=0;for(let o=t.length-1;o>=0;o--)l+=n[i.findIndex(({name:c})=>c===t[o])]*(r%e[o]),r=Math.floor(r/e[o]);return l}function as(t){const{width:e,height:r,extent:i,dimensions:s}=is(t),{ranges:a}=t,n=Object.keys(a).sort((h,m)=>ho[h.name]&&Object.assign(h,o[h.name]));const c=l.length?{variables:l}:void 0,u=[];for(let h=0;h2?h*d.slice(0,-2).reduce((k,_)=>k*_):0,I=p.slice(0,-2),R=d.slice(0,-2),S=g==="float"?"f32":rs(y),T=e*r,v=y.length/T;for(let k=0;kh.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}let oe=class extends ae{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,r,i={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[n,l]=a.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:c}=this.source,u={pixelBlock:o==null?c[0]:c[o],useBilinear:a.dataType!=="thematic",tileSize:{width:n,height:l},level:t,row:e,col:r},f=this.rasterJobHandler?this.rasterJobHandler.clipTile(u,i):ki(u);return Promise.resolve(f)}const s=this._pixelBlockTiles.get(`${t}/${e}/${r}`);return Promise.resolve(s)}async _open(t){const e=this.source,{pixelBlocks:r,attributeTable:i,statistics:s,histograms:a,name:n,nativeExtent:l,transform:o}=e,c=r[0],{width:u,height:f,pixelType:h}=c,m=e.extent??new W({xmin:-.5,ymin:.5,xmax:u-.5,ymax:f-.5,spatialReference:new L({wkid:3857})}),y=e.isPseudoSpatialReference??!e.extent,g={x:m.width/u,y:m.height/f},p={...e.keyProperties};i&&(p.DataType="Thematic");const d=new ve({width:u,height:f,pixelType:h,extent:m,nativeExtent:l,attributeTable:i,transform:o,pixelSize:g,spatialReference:m.spatialReference,bandCount:c.pixels.length,keyProperties:p,multidimensionalInfo:e.multidimensionalInfo,statistics:s,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(d),this.createRemoteDatasetStorageInfo(d,512,512),this._set("rasterInfo",d),this.updateTileInfo(),d.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,d.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},t),d.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(t,e,r){const{rasterInfo:i}=this,s=i.storageInfo.maximumPyramidLevel??0,a=i.dataType!=="thematic",n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:e,maximumPyramidLevel:s,useBilinear:a},r):Promise.resolve(Ci(t,e,s,a)),l=i.statistics!=null,o=i.histograms!=null,c=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},r):Promise.resolve(hi(t)),u=await lt([n,c]);if(!u[0].value&&u[1].value)throw new C("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(i.statistics=u[1].value?.statistics),o||(i.histograms=u[1].value?.histograms)}async _buildMDimStats(t,e,r){for(let i=0;inew Le({variableName:s.name,dimensionName:c.name,values:[c.values?.[0]??c.extent?.[0]],isSlice:!0})),n=mt(a,e),l=n==null?null:t[n];if(l==null)continue;const o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},r):He(l);s.statistics=o.statistics,s.histograms||(s.histograms=o.histograms)}}};w([b({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),w([b()],oe.prototype,"source",void 0),w([b()],oe.prototype,"url",null),oe=w([K("esri.layers.support.rasterDatasets.InMemoryRaster")],oe);const $e=oe;let he=class extends ae{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const{extent:e,pixelBlocks:r,multidimensionalInfo:i,attributeTable:s,bandNames:a}=await this._fetchData(t),{statistics:n,histograms:l}=He(r[0]),o=a?.map(h=>({BandName:h})),c={DataType:s?"Thematic":i?"Scientific":"Generic",BandProperties:o},u=new $e({source:{extent:e,pixelBlocks:r,attributeTable:s?Ge.fromJSON(s):null,multidimensionalInfo:i,statistics:n,histograms:l,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(t){const e=this.source??(await this.request(this.url,{signal:t?.signal})).data,r="imagery-tile-layer:open-coverage-json";if(e.type?.toLowerCase()!=="coverage"||e.domain?.domainType?.toLowerCase()!=="grid")throw new C(r,"Only coverage with Grid domain type is supported");if(!e.ranges)throw new C(r,"Missing ranges in the grid coverage data");if(!e.domain.referencing?.length)throw new C(r,"Missing domain referencing in the grid coverage data");const i=Object.values(e.ranges);for(let s=0;si.push(l));return i}const s=t.getElementsByTagNameNS("*",r);if(!s||s.length===0)return[];for(let a=0;a0?e?q(i[0],e):i[0]:null}function Y(t,e=null){const r=e?q(t,e):t;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function ls(t,e){const r=ue(t,e),i=[];let s;for(let a=0;aNumber(r))}function re(t,e){const r=Y(t,e);return Number(r)}function Ce(t,e){const r=t?.nodeName?.toLowerCase(),i=e.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}function nt(t,e){if(!t||!e)return null;const r=[];for(let i=0;iNumber(h));let l,o,c,u;ue(t,"Metadata/MDI").forEach(h=>{const m=Number(h.textContent??h.nodeValue);switch(h.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=m;break;case"STATISTICS_MAXIMUM":o=m;break;case"STATISTICS_MEAN":c=m;break;case"STATISTICS_STDDEV":u=m}});const f=re(t,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:n?.length&&i!=null&&s!=null?{min:i,max:s,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:l!=null&&o!=null?{min:l,max:o,avg:c,stddev:u}:null}}function Se(t){if(!t)return null;let e=Number(t);if(!isNaN(e)&&e!==0)return new L({wkid:e});if(t=String(t).trim(),Jt(t))return new L({wkt2:t});const r=t.toUpperCase();if(r.startsWith("COMPD_CS")){if(!r.includes("VERTCS")||!r.includes("GEOGCS")&&!r.startsWith("PROJCS"))return null;const i=r.indexOf("VERTCS"),s=r.indexOf("PROJCS"),a=s>-1?s:r.indexOf("GEOGCS");if(a===-1)return null;const n=t.slice(a,t.lastIndexOf("]",i)+1).trim(),l=t.slice(i,t.lastIndexOf("]")).trim();e=Oe(n);const o=new L(e?{wkid:e}:{wkt:n}),c=Oe(l);return c&&(o.vcsWkid=c),o}return r.startsWith("GEOGCS")||r.startsWith("PROJCS")?(e=Oe(t),new L(e!==0?{wkid:e}:{wkt:t})):null}function Oe(t){const e=t.replaceAll("]","[").replaceAll('"',"").split("[").map(s=>s.trim()).filter(s=>s!==""),r=e[e.length-1].split(","),i=r[0]?.toLowerCase();if((i==="epsg"||i==="esri")&&t.endsWith('"]]')){const s=Number(r[1]);if(!isNaN(s)&&s!==0)return s}return 0}function qe(t){if(t?.documentElement.tagName?.toLowerCase()!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};t.documentElement.childNodes.forEach(i=>{if(i.nodeType===1){if(Ce(i,"SRS")){if(!e.spatialReference){const s=Y(i);e.spatialReference=Se(s)}}else if(Ce(i,"Metadata"))if(i.getAttribute("domain")==="xml:ESRI"){const{spatialReference:s,transform:a}=cs(i);e.transform=a,e.spatialReference||(e.spatialReference=s)}else ue(i,"MDI").forEach(s=>e.metadata[s.getAttribute("key")]=Y(s));else if(Ce(i,"PAMRasterBand")){const s=us(i);s.sourceBandIndex!=null&&e.rasterBands[s.sourceBandIndex]==null?e.rasterBands[s.sourceBandIndex]=s:e.rasterBands.push(s)}}});const r=e.rasterBands;if(r.length){const i=!!r[0].statistics;e.statistics=i?r.map(a=>a.statistics).filter(Me):null;const s=!!r[0].histogram;e.histograms=s?r.map(a=>a.histogram).filter(Me):null}return e}let be=class extends ae{fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const e=await this._fetchData(t);let{spatialReference:r,statistics:i,histograms:s,transform:a}=await this._fetchAuxiliaryData(t);const n=!r;n&&(r=new L({wkid:3857})),s?.length&&i==null&&(i=ze(s));const{width:l,height:o}=e;let c=new W({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:r});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const m=a.forwardCoefficients;f=m&&m[1]===0&&m[2]===0,f&&(a=null,c=u)}const h=new $e({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[e],statistics:i,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(t){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=mi(e).toUpperCase();if(r!=="JPG"&&r!=="PNG"&&r!=="GIF"&&r!=="BMP")throw new C("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const i=r.toLowerCase(),s=i==="gif"||i==="bmp"||!Ot("ios"),a=await this.decodePixelBlock(e,{format:i,useCanvas:s,hasNoZlibMask:!0});if(a==null)throw new C("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:r=[],skipMapInfo:i}=this.ioConfig,s=i||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),a=this.datasetFormat,n=a==="JPG"?"jgw":a==="PNG"?"pgw":a==="BMP"?"bpw":null,l=n&&r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:e}),o=await lt([s,l]);if(e?.aborted)throw Pt();const c=qe(o[0].value?.data);if(!c.transform){const u=o[1].value?o[1].value.data.split(` -`).slice(0,6).map(f=>Number(f)):null;c.transform=u?.length===6?new We({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return c}};w([b({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),be=w([K("esri.layers.support.rasterDatasets.ImageAuxRaster")],be);const xe=be;let me=class extends ae{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(t,e,r,i={}){const{storageInfo:s,extent:a}=this.rasterInfo,{transposeInfo:n}=s,l=n!=null&&!!i.transposedVariableName;if(this._slices&&!l&&i.sliceId==null)return null;const o=l?0:s.maximumPyramidLevel-t+this._levelOffset,c=`${this.url}/tile/${o}/${e}/${r}`,u=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(c,{query:u,responseType:"array-buffer",signal:i.signal});if(!f)return null;const h=l?n.tileSize:s.tileInfo.size,m=await this.decodePixelBlock(f,{width:h[0],height:h[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(m==null)return null;const y=s.blockBoundary[t];if(s.compression!=="jpg"||r>y.minCol&&ry.minRow&&e{const a=e.find(n=>s.variableName===n.variableName&&n.dimensionName===s.dimensionName);return a?(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return r}return null}async fetchVariableStatisticsHistograms(t,e){const r=this.request(this.url+"/statistics",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.histograms),s=await Promise.all([r,i]);return s[0]&&s[0].forEach(a=>{a.avg=a.mean,a.stddev=a.standardDeviation}),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(t,e={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(t,0,e.datumTransformation);if(r===null)return null;let i=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let a=s-i+this._levelOffset;const n=r.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,r.row,r.col,e)==="available")break}catch{}if(a--,i++,r=this.identifyPixelLocation(n,i,e.datumTransformation),r===null)return null}return a===-1||r==null?null:i}async _open(t){const e=t?.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new C("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new C("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const s=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=i.cacheType,this.tileType==null&&(s.includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":i.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name?.slice(i.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:e});if(a==null)throw new C("image-server-raster:open","cannot initialize image service");Yt(a,i);const n=this.tileType==="Map"?hs(i.tileInfo,i):ee.fromJSON(i.tileInfo);Mt(n);const[l,o]=this._computeMinMaxLOD(a,n),{extent:c,pixelSize:u}=a,f=.5/a.width*u.x,h=Math.max(u.x,u.y),{lods:m}=n;(this.tileType!=="Map"&&i.maxScale!==0||Math.abs(u.x-u.y)>f||!m.some(v=>Math.abs(v.resolution-h){v.level>=o.level&&v.level<=l.level&&d.push({x:v.resolution,y:v.resolution}),kv.x-k.x);const I=this.computeBlockBoundary(c,g,p,n.origin,d,y),R=d.length>1?d.slice(1):null;let S;i.transposeInfo&&(S={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const T=x.length<=1||x.length>=3&&x.slice(0,-1).every(v=>v===x[0])?x[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/y))/10;if(a.storageInfo=new Re({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:R,pyramidScalingFactor:T,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:y,tileInfo:n,transposeInfo:S,blockBoundary:I}),ms(a),this._set("rasterInfo",a),i.capabilities.toLowerCase().includes("tilemap")){const v={tileInfo:a.storageInfo.tileInfo,parsedUrl:Nt(this.url),url:this.url,tileServers:[]};this._tilemapCache=new ji({layer:v})}}async _fetchRasterInfo(t){const e=this.sourceJSON;if(this.tileType==="Map"){const n=e.fullExtent||e.extent,l=Math.ceil((n.xmax-n.xmin)/e.pixelSizeX-.1),o=Math.ceil((n.ymax-n.ymin)/e.pixelSizeY-.1),c=L.fromJSON(e.spatialReference||n.spatialReference),u=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new ve({width:l,height:o,bandCount:3,extent:W.fromJSON(n),spatialReference:c,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=t,i=Kt(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),s=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then(n=>n.data?.slices).catch(()=>null):null,a=await Promise.all([i,s]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:t}=this;t.minScale&&t.minScale<0&&(t.minScale=0),t.maxScale&&t.maxScale<0&&(t.maxScale=0)}_computeMinMaxLOD(t,e){const{pixelSize:r}=t,i=.5/t.width*r.x,{lods:s}=e,a=e.lodAt(Math.max.apply(null,s.map(h=>h.level))),n=e.lodAt(Math.min.apply(null,s.map(h=>h.level))),{tileType:l}=this;if(l==="Map")return this._levelOffset=s[0].level,[a,n];if(l==="Raster")return[s.find(h=>h.resolution===r.x)??a,n];const{minScale:o,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=s.find(h=>Math.abs(h.scale-c)h.scale>c).sort((h,m)=>h.scale>m.scale?1:-1)[0]??a));let f=n;return o>0&&(f=s.find(h=>Math.abs(h.scale-o)n!=null&&n>=s&&n<=a)});if(r!==0&&i!==0){const n=c=>Math.round(1e4*c)/1e4,l=r?n(r):1/0,o=i?n(i):-1/0;return ee.fromJSON({...t,lods:t.lods.filter(c=>{const u=n(c.scale);return u<=l&&u>=o})})}return ee.fromJSON(t)}function ms(t){const{extent:e,spatialReference:r}=t;e.xmin>-1&&e.xmax>181&&r?.wkid&&r.isGeographic&&(t.nativeExtent=t.extent,t.transform=new Hi,t.extent=t.transform.forwardTransform(e))}w([b({type:String,json:{write:!0}})],me.prototype,"datasetFormat",void 0),w([b()],me.prototype,"tileType",void 0),me=w([K("esri.layers.support.rasterDatasets.ImageServerRaster")],me);const fs=me,U=new Map;U.set("Int8","s8"),U.set("UInt8","u8"),U.set("Int16","s16"),U.set("UInt16","u16"),U.set("Int32","s32"),U.set("UInt32","u32"),U.set("Float32","f32"),U.set("Float64","f32"),U.set("Double64","f32");const Z=new Map;Z.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Z.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Z.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Z.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let le=class extends ae{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,r,i={}){const{blockWidth:s,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[t];if(!l||l.maxRowe||l.minCol>r)return null;const{bandCount:o,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!u||u.length===0)return null;if(u[0].from===0&&u[0].to===0){const F=new Uint8Array(s*a);return new we({width:s,height:a,pixels:void 0,mask:F,validPixelCount:0})}const{bandIds:m}=this.ioConfig,y=this._getBandSegmentCount(),g=[];let p=0;for(p=0;pF.data.byteLength).reduce((F,M)=>F+M),I=new Uint8Array(x),R=[];let S=0;for(p=0;p1e24)for(p=0;p1e-6&&(M[p]=1);else for(p=0;p0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}_getBandSegmentCount(){return Z.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:i,blockHeight:s,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:l}=this.rasterInfo,o=this._getBandSegmentCount();let c,u,f,h=0,m=0;for(f=0;fparseFloat(F)))),q(t,"MRF_META/CachedSource"))throw new C("mrf:open","currently does not support MRF referencing other data files");const g=q(t,"MRF_META/GeoTags"),p=q(g,"BoundingBox");let d,x=!1;if(p!=null){const F=parseFloat(p.getAttribute("minx")),M=parseFloat(p.getAttribute("miny")),O=parseFloat(p.getAttribute("maxx")),N=parseFloat(p.getAttribute("maxy")),D=Y(g,"Projection")||"";let B=L.WGS84;if(D!=="LOCAL_CS[]")if(D.toLowerCase().startsWith("epsg:")){const z=Number(D.slice(5));isNaN(z)||z===0||(B=new L({wkid:z}))}else B=Se(D)??L.WGS84;else x=!0,B=new L({wkid:3857});d=new W(F,M,O,N),d.spatialReference=B}else x=!0,d=new W({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:new L({wkid:3857})});const I=q(t,"MRF_META/Rsets"),R=parseInt(I?.getAttribute("scale")||"2",10),S=d.spatialReference,T=new Re({origin:new A({x:d.xmin,y:d.ymax,spatialReference:S}),blockWidth:u,blockHeight:f,pyramidBlockWidth:u,pyramidBlockHeight:f,compression:n,pyramidScalingFactor:R}),v=new A({x:d.width/i,y:d.height/s,spatialReference:S}),k=new ve({width:i,height:s,extent:d,isPseudoSpatialReference:x,spatialReference:S,bandCount:a,pixelType:o,pixelSize:v,noDataValue:m,storageInfo:T}),_=Y(t,"datafile"),P=Y(t,"IndexFile");return{rasterInfo:k,files:{mrf:this.url,index:P||this.url.replace(".mrf",".idx"),data:_||this.url.replace(".mrf",Z.get(n).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return qe(e)}catch{return null}}};function ps(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,r,i,s,a,n;if(fi){for(r=new Uint8Array(t),s=new ArrayBuffer(t.byteLength),i=new Uint8Array(s),a=0;ac.name.toLowerCase()==="oid")?"OBJECTID":"OID",s=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),a=s.map(c=>c.name),n=[];let l=0,o=0;return r.forEach(c=>{const u={};for(u[i]=l++,o=1;o0)for(;u.lengthn;){const h=[];r.getUint8(o)===32?(o+=1,c.forEach(m=>{if(m.type==="C")h.push(Qe(new Uint8Array(e,o,m.length)).trim());else if(m.type==="N")h.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim(),10));else if(m.type==="F")h.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim()));else if(m.type==="D"){const y=String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim();h.push(new Date(parseInt(y.slice(0,4),10),parseInt(y.slice(4,6),10)-1,parseInt(y.slice(6,8),10)))}o+=m.length}),u.push(h)):o+=n}}return{header:l,fields:c,records:u,recordSet:ys({fields:c,records:u})}}}const Be=(t,e)=>t.get(e)?.values,fe=(t,e)=>t.get(e)?.values?.[0];let se=class extends ae{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async fetchRawTile(t,e,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(t,e,r))return null;const s=await this._fetchRawTiffTile(t,e,r,!1,i);if(s!=null&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(t,e,r,!0,i);a!=null&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(t){const e=t?t.signal:null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!r)throw new C("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:i,firstIFDPos:s,isBigTiff:a}=pi(r),n=[];await this._readIFDs(n,r,i,s,0,a?8:4,e);const{imageInfo:l,rasterInfo:o}=xs(n),c=di(n),u=yi(n);if(this._headerInfo={littleEndian:i,isBigTiff:a,ifds:n,pyramidIFDs:c,maskIFDs:u,...l},this._set("rasterInfo",o),!l.isSupported)throw new C("tiffraster:open","this tiff is not supported: "+l.message);if(!l.tileWidth)throw new C("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");o.isPseudoSpatialReference&&ne.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const f=n[0].get("PREDICTOR")?.values?.[0];if(n[0].get("SAMPLEFORMAT")?.values?.[0]===3&&f===2)throw new C("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:h,skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")&&!h){const y=await this._fetchAuxiliaryMetaData(t);y!=null&&ws(y,o)}m.includes("vat.dbf")||o.bandCount!==1||o.pixelType!=="u8"||h||(o.attributeTable=await this._fetchAuxiliaryTable(t),o.attributeTable!=null&&(o.keyProperties.DataType="thematic")),h&&this.updateImageSpaceRasterInfo(o),this.updateTileInfo()}async _readIFDs(t,e,r,i,s,a=4,n){if(!i)return null;(i>=e.byteLength||i<0)&&(e=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:n})).data,s=i+s,i=0);const l=await this._readIFD(e,r,i,s,pe.tiffTags,a,n);if(t.push(l.ifd),!l.nextIFD)return null;await this._readIFDs(t,e,r,l.nextIFD-s,s,a,n)}async _readIFD(t,e,r,i,s=pe.tiffTags,a=4,n){if(!t)return null;const l=gi(t,e,r,i,s,a);if(l.success){const o=[];if(l.ifd?.forEach(c=>{c.values||o.push(c)}),o.length>0){const c=o.map(f=>f.offlineOffsetSize).filter(Me),u=Math.min.apply(null,c.map(f=>f[0]));if(Math.min.apply(null,c.map(f=>f[0]+f[1]))-u<=this._bufferSize){const{data:f}=await this.request(this.url,{range:{from:u,to:u+this._bufferSize},responseType:"array-buffer",signal:n});t=f,i=u,o.forEach(h=>xi(t,e,h,i))}}if(l.ifd?.has("GEOKEYDIRECTORY")){const c=l.ifd.get("GEOKEYDIRECTORY"),u=c?.values;if(u&&u.length>4){const f=u[0]+"."+u[1]+"."+u[2],h=await this._readIFD(t,e,c.valueOffset+6-i,i,pe.geoKeys,2,n);c.data=h.ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[f]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==t.byteLength)return(t=(await this.request(this.url,{range:{from:i,to:i+l.requiredBufferSize+4},responseType:"array-buffer",signal:n})).data).byteLengththis.request(this.url,{range:T,responseType:"array-buffer",signal:s.signal})),f=await Promise.all(u),h=f.map(T=>T.data.byteLength).reduce((T,v)=>T+v),m=f.length===1?f[0].data:new ArrayBuffer(h),y=[0],g=[0];if(f.length>1){const T=new Uint8Array(m);for(let v=0,k=0;vy||r>g||e3&&F.length%3==0){_=[];const O=F.length/3;for(let N=0;N>>8,F[N+O]>>>8,F[N+2*O]>>>8])}const M=new ve({width:r,height:i,bandCount:n,pixelType:l,pixelSize:v,storageInfo:T,spatialReference:x,isPseudoSpatialReference:I,keyProperties:k,extent:R,colormap:_,statistics:p?p.statistics:null});if(g?.length&&(M.nativeExtent=new W({xmin:-.5,ymin:.5-i,xmax:r-.5,ymax:.5,spatialReference:x}),M.transform=new We({polynomialOrder:1,forwardCoefficients:[g[2]+g[0]/2,g[5]-g[3]/2,g[0],g[3],-g[1],-g[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(R.xmax-R.xmin)/r,y:(R.ymax-R.ymin)/i,spatialReference:x}),T.origin.x=-.5,T.origin.y=.5),m){const{x:O,y:N}=M.pixelSize;m.forEach(D=>{D.x*=O,D.y*=N})}return{imageInfo:e,rasterInfo:M}}function ws(t,e){if(e.statistics=t.statistics??e.statistics,e.histograms=t.histograms,t.histograms&&e.statistics==null&&(e.statistics=ze(t.histograms)),t.transform&&e.transform==null){e.transform=t.transform,e.nativeExtent=e.extent;const r=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(r.xmax-r.xmin)/e.width,y:(r.ymax-r.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=r}e.isPseudoSpatialReference&&t.spatialReference&&(e.spatialReference=t.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}w([b()],se.prototype,"_files",void 0),w([b()],se.prototype,"_headerInfo",void 0),w([b()],se.prototype,"_bufferSize",void 0),w([b({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),se=w([K("esri.layers.support.rasterDatasets.TIFFRaster")],se);const Is=se,H=new Map;H.set("MRF",{desc:"Meta Raster Format",constructor:ds}),H.set("TIFF",{desc:"GeoTIFF",constructor:Is}),H.set("RasterTileServer",{desc:"Raster Tile Server",constructor:fs}),H.set("JPG",{desc:"JPG Raster Format",constructor:xe}),H.set("PNG",{desc:"PNG Raster Format",constructor:xe}),H.set("GIF",{desc:"GIF Raster Format",constructor:xe}),H.set("BMP",{desc:"BMP Raster Format",constructor:xe}),H.set("CovJSON",{desc:"COVJSON Raster Format",constructor:os}),H.set("MEMORY",{desc:"In Memory Raster Format",constructor:$e});class Pe{static get supportedFormats(){const e=new Set;return H.forEach((r,i)=>e.add(i)),e}static async open(e){const{url:r,ioConfig:i,source:s,sourceJSON:a}=e;let n=e.datasetFormat??i?.datasetFormat;n==null&&(r.includes(".")?n=r.slice(r.lastIndexOf(".")+1).toUpperCase():s?.type?.toLowerCase()==="coverage"?n="CovJSON":s?.extent&&s.pixelblocks&&(n="MEMORY")),n==="OVR"||n==="TIF"?n="TIFF":n==="JPG"||n==="JPEG"||n==="JFIF"?n="JPG":n==="COVJSON"&&(n="CovJSON"),r.toLowerCase().includes("/imageserver")&&!r.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:r,source:s,sourceJSON:a,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(f=>{l[f]==null&&delete l[f]}),n){if(!this.supportedFormats.has(n))throw new C("rasterfactory:open","not a supported format "+n);if(n==="CRF")throw new C("rasterfactory:open",`cannot open raster: ${r}`);const f=new(H.get(n)).constructor(l);return await f.open({signal:e.signal}),f}const o=Array.from(H.keys()).filter(f=>f!=="CovJSON"&&f!=="Memory");let c=0;const u=()=>{if(n=o[c++],!n||n==="CRF")return null;const f=new(H.get(n)).constructor(l);return f.open({signal:e.signal}).then(()=>f).catch(()=>u())};return u()}static register(e,r,i){H.has(e.toUpperCase())||H.set(e.toUpperCase(),{desc:r,constructor:i})}}let E=class extends Wt(qi(Wi(Gi($t(Gt(ts(Vi(zt($i(Lt(wt(Ht)))))))))))){constructor(...t){super(...t),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=It(async(e,r,i)=>{const{save:s,saveAs:a}=await ot(()=>import("./imageryUtils-6MVSqijr-DkiL-1bk.js"),__vite__mapDeps([6,7,1,2,8,9,10,11,12,13,14,15]),import.meta.url);switch(e){case ye.SAVE:return s(this,r);case ye.SAVE_AS:return a(this,i,r)}})}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},t).catch(bt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const t=[new ce({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new ce({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],e=this.raster?.rasterInfo??this.serviceRasterInfo,r=e?.attributeTable,i=r!=null?r.fields:null,s="Raster.";if(i){const l=i.filter(o=>o.type!=="oid"&&o.name.toLowerCase()!=="value").map(o=>{const c=o.clone();return c.name=s+o.name,c});t.push(...l)}const a=e?.dataType,n=e?.multidimensionalInfo;if((a==="vector-magdir"||a==="vector-uv")&&n!=null){const l=n.variables[0].unit?.trim(),o="Magnitude"+(l?` (${l})`:"");t.push(new ce({name:"Raster.Magnitude",alias:o,domain:null,editable:!1,type:"double"})),t.push(new ce({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return t}createPopupTemplate(t){const{rasterFields:e}=this,r=t?.visibleFieldNames??new Set(e.map(({name:a})=>a).filter(a=>a.toLowerCase()!=="raster.servicepixelvalue.raw")),i=Ui({fields:e,title:this.title},{...t,visibleFieldNames:r}),{rasterInfo:s}=this.raster;return i?.fieldInfos&&s?.pixelType.startsWith("f")&&i.fieldInfos.forEach(({format:a,fieldName:n})=>{a&&n&&/^raster\.(item|service)pixelvalue/i.test(n)&&(a.places=2)}),i}async generateRasterInfo(t,e){if(t=Ae(Ne,t),await this.load(),!t||t.functionName?.toLowerCase()==="none")return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(t,e);return r}catch(r){throw r instanceof C?r:new C("imagery-tile-layer","the given raster function is not supported")}}async save(t){return this._debouncedSaveOperations(ye.SAVE,t)}async saveAs(t,e){return this._debouncedSaveOperations(ye.SAVE_AS,e,t)}write(t,e){const r=this._primaryRasters[0]??this.raster;if(this.loaded?r.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(t,e);if(e?.messages){const i=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new C("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${i}'`,{layer:this}))}return null}async _openRaster(t){let e=!1;if(this.raster)await this._openFromRaster(this.raster,t),e=this.raster.datasetFormat==="Function",!e&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:i,rasterFunction:s,source:a}=this;if(!i&&!a)throw new C("imagery-tile-layer:open","missing url or source parameter");a?await this._openFromSource(a,t):s?await this._openFromUrlWithRasterFunction(i,s,t):await this._openFromUrl(i,t)}const r=this.raster.rasterInfo;if(!r)throw new C("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",e?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const i=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(i,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Rt(()=>this.customParameters,i=>{this.raster&&(this.raster.ioConfig.customFetchParameters=i)}))}async _openFromRaster(t,e){t.rasterInfo||await t.open({signal:e}),this._primaryRasters=t.datasetFormat==="Function"?t.primaryRasters.rasters:[t],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(t,e,r){const i=[t];e&&Li(e.toJSON(),i);const s=await Promise.all(i.map(n=>Pe.open({url:n,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=s.findIndex(n=>n==null);if(a>-1)throw new C("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(e)}async _openFromUrl(t,e){const r=await Pe.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(r==null)throw new C("imagery-tile-layer:open",`cannot open raster: ${t}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(t,e){const r="the tiled imagery data source is not supported",i=t.type?.toLowerCase()==="coverage"?"CovJSON":t.extent&&t.pixelBlock?"MEMORY":null;if(!i)throw new C("imagery-tile-layer:open",r);i==="MEMORY"&&(t={...t,pixelBlock:void 0,pixelBlocks:[t.pixelBlock]});const s=await Pe.open({url:"",source:t,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(s==null)throw new C("imagery-tile-layer:open",r);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(t,e){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(a=>r[a.url]=a);const i=pt(t.functionDefinition?.toJSON()??t.toJSON(),r),s=new dt({rasterFunction:i});return await s.open(e),s}async _initializeWithFunctionRaster(t,e){try{this.raster=await this._openFunctionRaster(t,e)}catch(r){r instanceof C&&ne.getLogger(this).error("imagery-tile-layer:open",r.message),ne.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};w([b({clonable:!1})],E.prototype,"_primaryRasters",void 0),w([b(ri)],E.prototype,"legendEnabled",void 0),w([b({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],E.prototype,"isReference",void 0),w([b({type:["show","hide"]})],E.prototype,"listMode",void 0),w([b({json:{read:!0,write:!0}})],E.prototype,"blendMode",void 0),w([b()],E.prototype,"sourceJSON",void 0),w([b({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],E.prototype,"version",void 0),w([b({readOnly:!0,json:{read:!1}})],E.prototype,"type",void 0),w([b({type:["ArcGISTiledImageServiceLayer"]})],E.prototype,"operationalLayerType",void 0),w([b({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(t,e,r){e[r]=!t}}}})],E.prototype,"popupEnabled",void 0),w([b({type:vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],E.prototype,"popupTemplate",void 0),w([b({readOnly:!0})],E.prototype,"defaultPopupTemplate",null),w([b({readOnly:!0,type:[ce]})],E.prototype,"fields",void 0),w([b({readOnly:!0,type:[ce]})],E.prototype,"rasterFields",null),w([b({constructOnly:!0})],E.prototype,"source",void 0),E=w([K("esri.layers.ImageryTileLayer")],E);const Er=E;export{Er as default}; diff --git a/main/assets/ImageryTileLayer-DixyNESc-CLvjCbqI.js b/main/assets/ImageryTileLayer-DixyNESc-CLvjCbqI.js new file mode 100644 index 000000000..86601984c --- /dev/null +++ b/main/assets/ImageryTileLayer-DixyNESc-CLvjCbqI.js @@ -0,0 +1,3 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-Bq1o6CJZ.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-wGAJYB2w.js","./imageryUtils-6MVSqijr-wws7sSH-.js","./utils-BVWK2jiA-D8rVYIEJ.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./jsonContext-BA8GHqVk-DpBf0bCt.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js"])))=>i.map(i=>d[i]); +import{v as w,S as b,i as K,aa as wt,bp as It,W as bt,aO as Ae,o as C,ah as Rt,a1 as ne,bL as vt,e as St,w as A,n as W,f as at,J as L,E as Tt,_ as ot,l as _t,bB as Ft,bz as kt,a0 as Ct,iF as lt,K as Ot,aS as Pt,O as Mt,a as Nt,aq as Me,fd as Dt,aG as Et,jz as Jt,ar as Bt,dc as At}from"./main-C7yV2j71.js";import{m as Lt}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as Ht}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{a as zt}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as Wt}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as Gt}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{J as $t,k as Ne,p as qt,A as Vt,l as jt,c as Ut,V as Yt,E as Kt,a as Xt,Z as Qt,b as je,I as Ue,T as Zt,v as ei,w as ti,C as ii,S as Ye,f as si}from"./RasterPresetRendererMixin-D6W9pUY6-Q9Qi8PwW.js";import{j as ct}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{Z as ut,_ as ri}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{R as ht,J as mt,Y as ni,I as ai,g as Le,j as Ke,p as oi,T as Xe,z as li}from"./multidimensionalUtils-BwTugeu7-LevYq4ep.js";import{V as ee,d as ci}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{V as ui,c as Re,W as ve,S as hi,d as He,s as ze,b as mi,u as fi,v as pi,A as di,D as yi,E as pe,F as gi,H as xi,N as wi,J as Ii,t as bi,L as Qe}from"./RasterSymbolizer-BVys6HkM-BxgX8zwh.js";import{K as Ze,U as et,V as tt,X as Ri,Q as vi}from"./RawBlockCache-Cj_tmHDm-CYD33Wpe.js";import{f as Te,A as ft,M as Si,v as Ti,x as _i,b as Fi,k as ki,y as Ci,E as Oi,D as we,w as Pi,R as Mi,K as Ni}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{k as de,L as De,n as it,Q as st,X as Di,s as _e,o as Ie,K as Ei,Y as Ji,W as Bi,F as Ee}from"./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js";import{k as Ai}from"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import{D as Li,h as pt,E as Je,v as We,x as Hi,B as zi}from"./PolynomialTransform-C3nWCu0l-DmoNKYd3.js";import{O as Ge}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{E as Wi}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as Gi}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as $i}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as qi}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as Vi}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{y as ce}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{f as ji}from"./TilemapCache-CRRxws77-Cj_Hxxs_.js";import{w as Ui}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{E as ye}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./utils-DPtQ14k3-BW98GOs_.js";import"./cimSymbolUtils-CKIzBgMU-D2oNADot.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./signal-CETehA7D-DxK1orqE.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";const rt=8,Yi=256;let Ki=0,J=class extends St{constructor(){super(...arguments),this._tileFetchQueue=new Ai({concurrency:32,process:(t,e)=>this._fetchRawTile(t.pyramidLevel,t.row,t.col,{...t.options,signal:e})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(t){return t?.ioConfig&&(t={...t,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:ee.create(),...t.ioConfig}}),t}get _isGlobalWrappableSource(){const{rasterInfo:t}=this,e=de(t.spatialReference);return e!=null&&t.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:t}=this.rasterInfo;return t==null||t.type==="gcs-shift"}set rasterJobHandler(t){this._set("rasterJobHandler",t),this.datasetFormat==="Function"&&this.primaryRasters?.rasters?.forEach(e=>e.rasterJobHandler=t)}get rasterId(){return this.url||"rasterId-"+Ki++}set url(t){this._set("url",ct(t,ne.getLogger(this)))}async open(t){return this._openPromise??=De().then(()=>this._open(t)),this._openPromise}async fetchTile(t,e,r,i={}){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,a=this.getTileExtentFromTileInfo(t,e,r,s);return i={noClip:!0,...i},this.fetchPixels(a,s.size[0],s.size[1],i)}async identify(t,e={}){t=Ae(A,t).clone().normalize();const{multidimensionalDefinition:r,timeExtent:i}=e,{rasterInfo:s}=this,{hasMultidimensionalTranspose:a,multidimensionalInfo:n}=s;let{transposedVariableName:l}=e;const o=n!=null&&a&&(i!=null||ht(r));o&&!l&&(l=r!=null&&r.length>0?r[0].variableName??void 0:n.variables[0].name,e={...e,transposedVariableName:l}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:u}=s,{datumTransformation:f}=e;let h=it(t,c,f);if(!u.intersects(h))return{location:h,value:null};if(s.transform!=null){const F=s.transform.inverseTransform(h);if(!s.nativeExtent.intersects(F))return{location:F,value:null};h=F}let m=0;const y=l!=null&&n!=null&&s.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const F=this.primaryRasters.rasters[0];if(y)return F.identify(h,e);const{pixelSize:M}=s,O=3,N=M.x*O/2,D=M.y*O/2,B=new W({xmin:h.x-N,xmax:h.x+N,ymin:h.y-D,ymax:h.y+D,spatialReference:c}),z={interpolation:"nearest",multidimensionalDefinition:r,sliceId:e.sliceId},{pixelBlock:j}=await F.fetchPixels(B,O,O,z),{pixelBlock:G}=await this.fetchPixels(B,O,O,z);if(j==null)return{location:h,value:null};const $=Math.floor(O*O*.5),X=!j.mask||j.mask[$]?j.pixels.map(V=>V[$]):null;let te;return G!=null&&(te=!G.mask||G.mask[$]?G.pixels.map(V=>V[$]):void 0),{location:h,value:X,processedValue:te,pyramidLevel:0}}if(!y){if(e.srcResolution)m=st(e.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(m=await this.computeBestPyramidLevelForLocation(t,e),m==null)return{location:h,value:null}}const g=this.identifyPixelLocation(h,m,null,y);if(g===null)return{location:h,value:null};const{row:p,col:d,rowOffset:x,colOffset:I,blockWidth:R}=g,S=l??e.sliceId,T=Ze(this.rasterId,S),v=`${m}/${p}/${d}`;let k=et(T,null,v);k==null&&(k=this.fetchRawTile(m,p,d,e),tt(T,null,v,k));const _=await k;if(!_?.pixels?.length)return{location:h,value:null};const P=x*R+I;return this._processIdentifyResult(_,{srcLocation:h,position:P,pyramidLevel:m,useTransposedTile:!!y,requestSomeSlices:o,identifyOptions:e})}async fetchPixels(t,e,r,i={}){t=Di(t),i=this._getRequestOptionsWithSliceId(i);const{_hasNoneOrGCSShiftTransform:s}=this;if(i.requestRawData&&s)return this._fetchPixels(t,e,r,i);const a=de(t.spatialReference),n=_e(t);if(a==null||n===0||n===1&&this._isGlobalWrappableSource&&s)return this._fetchPixels(t,e,r,i);if(n>=3)return{extent:t,pixelBlock:null};const l=[],{xmin:o,xmax:c}=t,u=Math.round(a/(c-o)*e),f=u-Math.round((a/2-o)/(c-o)*e);let h=0;const m=[];for(let d=0;d<=n;d++){const x=new W({xmin:d===0?o:-a/2,xmax:d===n?c-a*d:a/2,ymin:t.ymin,ymax:t.ymax,spatialReference:t.spatialReference}),I=d===0?u-f:d===n?e-h:u;h+=I,m.push(I);const R=i.disableWrapAround&&d>0?null:this._fetchPixels(x,I,r,i);l.push(R)}const y=(await Promise.all(l)).map(d=>d?.pixelBlock);let g=null;const p={width:e,height:r};return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:y,srcMosaicSize:p,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i)).pixelBlock:g=Te(y,p,{blockWidths:m}),{extent:t,srcExtent:Ie(t,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:g}}async fetchRawPixels(t,e,r,i={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const s=await this._fetchRawTiles(t,e,r,i),{nativeExtent:a,nativePixelSize:n,storageInfo:l}=this.rasterInfo,o=2**t,c=n.x*o,u=n.y*o,f=new W({xmin:a.xmin+c*e.x,xmax:a.xmin+c*(e.x+r.width-1),ymin:a.ymax-u*(e.y+r.height-1),ymax:a.ymax-u*e.y,spatialReference:a.spatialReference});if(!s)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:h,mosaicSize:m}=s;if(h.length===1&&h[0]!=null&&h[0].width===r.width&&h[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:s.pixelBlocks[0]};const y=t>0?l.pyramidBlockWidth:l.blockWidth,g=t>0?l.pyramidBlockHeight:l.blockHeight,p={x:e.x%y,y:e.y%g};let d;return this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:m,destDimension:r,clipOffset:p,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:d=Te(h,m,{clipOffset:p,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:d}}fetchRawTile(t,e,r,i){throw new C("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(t){return Ie(this.rasterInfo.extent,t)}decodePixelBlock(t,e){return!this.rasterJobHandler||e.useCanvas?ui(t,e):this.rasterJobHandler.decode({data:t,options:e})}async request(t,e,r=0){const{customFetchParameters:i}=this.ioConfig,{range:s,query:a,headers:n}=e;r=r??e.retryCount??this.ioConfig.retryCount;const l=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await at(t,{...e,query:{...a,...i},headers:{...n,...l}})}catch(o){if(r>0)return r--,this.request(t,e,r);throw o}}getSliceIndex(t){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||t==null||t.length===0?null:mt(t,e)}getTileExtentFromTileInfo(t,e,r,i){const s=i.lodAt(t);return this.getTileExtent({x:s.resolution,y:s.resolution},e,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:t,spatialReference:e,extent:r,pixelSize:i}=this.rasterInfo,{pyramidResolutions:s}=t;if(!t.tileInfo){const a=[],n=t.maximumPyramidLevel||0;let l=(i.x+i.y)/2,o=1/.0254*96*l;for(let u=0;u<=n&&(a.unshift(new ci({level:n-u,resolution:l,scale:o})),u!==n);u++)if(s){const f=(s[u].x+s[u].y)/2;o*=f/l,l=f}else l*=2,o*=2;const c=new A({x:r.xmin,y:r.ymax,spatialReference:e});t.tileInfo=new ee({origin:c,size:[t.blockWidth,t.blockHeight],spatialReference:e,lods:a}),t.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(t,e=512,r=512,i){const{width:s,height:a,nativeExtent:n,pixelSize:l,spatialReference:o}=t,c=new A({x:n.xmin,y:n.ymax,spatialReference:o});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(s,a))/Math.LN2-8)));const u=this.computeBlockBoundary(n,512,512,{x:n.xmin,y:n.ymax},[l],i);t.storageInfo=new Re({blockWidth:e,blockHeight:r,pyramidBlockWidth:e,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(t,e={}){return 0}computeBlockBoundary(t,e,r,i,s,a=0,n=2){if(s.length===1&&a>0){s=[...s];let{x:u,y:f}=s[0];for(let h=0;hl)return null;const m=this.getPyramidPixelSize(e),{x:y,y:g}=m,p=(o.y-h.y)/g/f,d=(h.x-o.x)/y/u,x=Math.min(f-1,Math.floor((p-Math.floor(p))*f)),I=Math.min(u-1,Math.floor((d-Math.floor(d))*u));return{pyramidLevel:e,row:Math.floor(p),col:Math.floor(d),rowOffset:x,colOffset:I,blockWidth:u,srcLocation:h}}getTileExtent(t,e,r,i,s,a){const[n,l]=a,o=i.x+r*n*t.x,c=o+n*t.x,u=i.y-e*l*t.y,f=u-l*t.y;return new W({xmin:o,xmax:c,ymin:f,ymax:u,spatialReference:s})}getBlockWidthHeight(t){return{blockWidth:t>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:t>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(t,e,r){const i=this.rasterInfo.storageInfo.blockBoundary[t];return!i||i.maxRowe||i.minCol>r}updateImageSpaceRasterInfo(t){const{pixelSize:e}=t,{width:r,height:i}=t,s=L.WebMercator;t.spatialReference=s,t.extent=t.nativeExtent=new W({xmin:-.5,ymax:.5,xmax:r-.5,ymin:.5-i,spatialReference:s}),t.isPseudoSpatialReference=!0,t.transform=null,t.pixelSize=new A({x:1,y:1,spatialReference:s});const{extent:a,storageInfo:n}=t;if(n){n.origin=new A({x:a.xmin,y:a.ymax,spatialReference:s});const{pyramidResolutions:l,tileInfo:o}=n;if(l&&l.forEach(c=>{c.x/=e.x,c.y/=e.y}),o){o.origin=n.origin;const c=(t.nativePixelSize.x+t.nativePixelSize.y)/2;o.lods.forEach((u,f)=>{u.resolution=c*2**f,u.scale=96*u.resolution/.0254})}}}async _fetchPixels(t,e,r,i={}){let s=_e(t);if(s>=2)return{extent:t,pixelBlock:null};const a=this._getSourceDataInfo(t,e,r,i),{pyramidLevel:n,srcResolution:l,srcExtent:o,srcWidth:c,srcHeight:u,ul:f}=a;if(c===0||u===0)return{extent:t,srcExtent:o,pixelBlock:null};const{rasterInfo:h}=this,m=h.transform,y=m?.type==="gcs-shift",g=de(t.spatialReference)!=null;!y&&g||(s=_e(a.srcExtent,y));const p=await this._fetchRawTiles(n,f,{width:c,height:u,wrapCount:s},i);if(!p)return{extent:t,srcExtent:o,pixelBlock:null};const d=h.storageInfo,x=n>0?d.pyramidBlockWidth:d.blockWidth,I=n>0?d.pyramidBlockHeight:d.blockHeight;let{x:R,y:S}=h.pixelSize;if(n>0){const{pyramidResolutions:Q,pyramidScalingFactor:xt}=d;if(Q!=null&&Q[n-1])({x:R,y:S}=Q[n-1]);else{const Ve=xt**n;R*=Ve,S*=Ve}}const T=h.spatialReference,v=new A({x:R,y:S,spatialReference:T}),k=x===c&&I===u&&f.x%x==0&&f.y%I==0,_=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference}),P=!t.spatialReference.equals(T),F=T.isGeographic?1e-9:1e-4,{datumTransformation:M}=i;if(!P&&k&&p.pixelBlocks.length===1&&x===e&&I===r&&Xi(l,_,F))return{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:p.pixelBlocks[0]};const O=g&&de(o.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,N=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");N&&!this.rasterJobHandler&&await De();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_.toJSON(),datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:N},i):Ei({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_,datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:!1,includeGCSGrid:N});let B;const z=!i.requestRawData,j={rows:D.spacing[0],cols:D.spacing[1]},G=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(n,p.extent.xmin):void 0,{pixelBlocks:$,mosaicSize:X,isPartiallyFilled:te}=p;let V=null;if(this.rasterJobHandler)({pixelBlock:B,localNorthDirections:V}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:$,srcMosaicSize:X,destDimension:z?{width:e,height:r}:null,coefs:z?D.coefficients:null,sampleSpacing:z?j:null,projectDirections:N,gcsGrid:N?D.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:G,blockWidths:null},i));else{const Q=Te($,X,{alignmentInfo:G});B=z?ft(Q,{width:e,height:r},D.coefficients,j,i.interpolation):Q,N&&D.gcsGrid&&(V=Si({width:e,height:r},D.gcsGrid),B=Ti(B,this.rasterInfo.dataType,V))}return i.requestRawData||N?{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:B,transformGrid:D,localNorthDirections:V,isPartiallyFilled:te}:{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:B}}async _fetchRawTiles(t,e,r,i){const{origin:s,blockBoundary:a}=this.rasterInfo.storageInfo,{blockWidth:n,blockHeight:l}=this.getBlockWidthHeight(t);let{x:o,y:c}=e,{width:u,height:f,wrapCount:h}=r;const m=this._getRasterTileAlignmentInfo(t,0);i.buffer&&(o-=i.buffer.cols,c-=i.buffer.rows,u+=2*i.buffer.cols,f+=2*i.buffer.rows);let y=0,g=0,p=0;h&&m!=null&&({worldColumnCountFromOrigin:g,originColumnOffset:p,rightPadding:y}=m,g*m.blockWidth-y>=o+u&&(y=0));const d=Math.floor(o/n),x=Math.floor(c/l),I=Math.floor((o+u+y-1)/n),R=Math.floor((c+f+y-1)/l),S=a[t];if(!S)return null;const{minRow:T,minCol:v,maxCol:k,maxRow:_}=S;if(h===0&&(R_||d>k))return null;const P=new Array;let F=!1;const M=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let G=x;G<=R;G++)for(let $=d;$<=I;$++){let X=$;if(!i.disableWrapAround&&h&&m!=null&&g<=$&&(X=$-g-p),G>=T&&X>=v&&_>=G&&k>=X){const te=this._tileFetchQueue.push({pyramidLevel:t,row:G,col:X,options:i},{signal:i.signal});M?P.push(new Promise(V=>{te.then(Q=>V(Q)).catch(()=>{F=!0,V(null)})})):P.push(te)}else P.push(Promise.resolve(null))}if(P.length===0)return null;const O=await Promise.all(P),N={height:(R-x+1)*l,width:(I-d+1)*n},{spatialReference:D}=this.rasterInfo,B=this.getPyramidPixelSize(t),{x:z,y:j}=B;return{extent:new W({xmin:s.x+d*n*z,xmax:s.x+(I+1)*n*z,ymin:s.y-(R+1)*l*j,ymax:s.y-x*l*j,spatialReference:D}),pixelBlocks:O,mosaicSize:N,isPartiallyFilled:F}}_fetchRawTile(t,e,r,i){const s=this.rasterInfo.storageInfo.blockBoundary[t];if(!s)return Promise.resolve(null);const{minRow:a,minCol:n,maxCol:l,maxRow:o}=s;if(eo||r>l)return Promise.resolve(null);const c=Ze(this.rasterId,i.sliceId),u=`${t}/${e}/${r}`;let f=et(c,i.registryId,u);if(f==null){const h=new AbortController;f=this.fetchRawTile(t,e,r,{...i,signal:h.signal}),tt(c,i.registryId,u,f,h),f.catch(()=>Ri(c,i.registryId,u))}return i.signal&&Tt(i,()=>{vi(c,i.registryId,u)}),f}_computeMagDirValues(t){const{bandCount:e,dataType:r}=this.rasterInfo;if(!(e===2&&r==="vector-magdir"||r==="vector-uv")||t?.length!==2||!t[0]?.length)return null;const i=t[0].length;if(r==="vector-magdir"){const o=t[1].map(c=>(c+360)%360);return[t[0],o]}const[s,a]=t,n=[],l=[];for(let o=0;o=16,h=o===a&&this._requireTooManySrcTiles(n,l,e,r);if(f||h||n===0||l===0){const m=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference});let y=Bi(m,this.rasterInfo.spatialReference,t,s.datumTransformation);const g=!y||i.srcResolution&&y.x+y.y=p){const d=2**p;y={x:i.srcResolution.x*d,y:i.srcResolution.y*d}}}y&&(s.srcResolution=y,this._updateSourceDataInfo(t,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,e,r)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(t,e,r,i){const{tileInfo:s}=this.rasterInfo.storageInfo,a=Math.ceil(t/s.size[0])*Math.ceil(e/s.size[1]),n=t/r,l=e/i,o=Math.max(1,(r+i)/1024);return a>=Yi*o||n>rt||l>rt}_updateSourceDataInfo(t,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:r}=this,i=r.spatialReference,{srcResolution:s,datumTransformation:a}=e,{pyramidLevel:n,pyramidResolution:l,excessiveReading:o}=st(s,r,this.ioConfig.sampling);if(o)return;let c=e.srcExtent||Ie(t,i,a);if(c==null)return;const u=r.transform;u&&(c=u.inverseTransform(c)),e.srcExtent=c;const{x:f,y:h}=r.storageInfo.origin,m=Math.floor((c.xmin-f)/l.x+.1),y=Math.floor((h-c.ymax)/l.y+.1),g=Math.floor((c.xmax-f)/l.x-.1),p=Math.floor((h-c.ymin)/l.y-.1),d=c.width<.1*l.x?0:g-m+1,x=c.height<.1*l.y?0:p-y+1;e.pyramidLevel=n,e.pyramidResolution=l,e.srcWidth=d,e.srcHeight=x,e.ul={x:m,y}}_getRequestOptionsWithSliceId(t){return this.rasterInfo.multidimensionalInfo!=null&&t.sliceId==null&&(t={...t,sliceId:this.getSliceIndex(t.multidimensionalDefinition)}),t}_processIdentifyResult(t,e){const{srcLocation:r,position:i,pyramidLevel:s,useTransposedTile:a}=e,n=t.pixels[0].length/t.width/t.height;if(!(!t.mask||t.mask[i]))return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(l==null||!a){const p=t.pixels.map(I=>I[i]),d={location:r,value:p,pyramidLevel:s},x=this._computeMagDirValues(p.map(I=>[I]));return x?.length&&(d.magdirValue=x.map(I=>I[0])),d}let o=t.pixels.map(p=>p.slice(i*n,i*n+n)),c=this._computeMagDirValues(o);const{requestSomeSlices:u,identifyOptions:f}=e;let h=ni(l,f.transposedVariableName);if(u){const p=ai(h,f.multidimensionalDefinition,f.timeExtent);o=o.map(d=>p.map(x=>d[x])),c=c?.map(d=>p.map(x=>d[x])),h=p.map(d=>h[d])}const m=t.noDataValues||this.rasterInfo.noDataValue,y={pixels:o,pixelType:t.pixelType};let g;return m!=null&&(Fi(y,m),g=y.mask),{location:r,value:null,dataSeries:h.map((p,d)=>{const x={value:g?.[d]===0?null:o.map(I=>I[d]),multidimensionalDefinition:p.multidimensionalDefinition.map(I=>new Le({...I,isSlice:!0}))};return c?.length&&(x.magdirValue=[c[0][d],c[1][d]]),x}),pyramidLevel:s}}};function Xi(t,e,r){return Math.abs(t.x-e.x)I.fetchPixels(t,e,r,i)),u=await Promise.all(c),f=u.map(I=>I.pixelBlock),h=n||i.requestRawData?u.map(I=>I.srcTilePixelSize):null;if(i.skipRasterFunction||f.every(I=>I==null))return u[0];const m=u.find(I=>I.pixelBlock!=null)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a}):this.rasterFunction.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a});const{transformGrid:g}=u[0];if(!n||y==null||g==null){const I=i.noClip?null:this.getClippingGeometry(m.spatialReference);return i.noClip||i.requestRawData||y==null||!I||(y=await Je(y,m,I)),{...u[0],pixelBlock:y}}const p={rows:g.spacing[0],cols:g.spacing[1]};let d;this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:p,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock:d=ft(y,{width:e,height:r},g.coefficients,p,l);const x=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||i.requestRawData||d==null||x==null||(d=await Je(d,t,x)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:d}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=es(t);let i=this._clippingGeometry.get(r);return i!=null||(i=t.equals(e.spatialReference)?e:Ee(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:e}=this;this.primaryRasters?.rasters?.length?e.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(c=>c.rasterJobHandler=this.rasterJobHandler));const{rasters:r,rasterIds:i}=this.primaryRasters,s=r.map(c=>c.rasterInfo?void 0:c.open(t));await Promise.all(s);const a=r.map(({rasterInfo:c})=>c),n=e.bind({rasterInfos:a,rasterIds:i});if(e.rawSourceRasterInfos=a,!n.success||a.length===0)throw new C("raster-function:open",`cannot bind the function: ${n.error??""}`);const l=e.functionName==="Table"?e:e.functionArguments?.raster;l?.functionName==="Table"&&(e.rasterInfo.attributeTable=Ge.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const o=a[0];this.hasUniqueSourceStorageInfo=a.length===1||a.slice(1).every(c=>Zi(c,o)),this.set("sourceJSON",r[0].sourceJSON),this.set("rasterInfo",e.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&t.clippingType==="inside"){const{extent:r}=this.rasterInfo,{difference:i,densify:s}=await ot(async()=>{const{difference:n,densify:l}=await import("./geometryEngine-CdPoFSE4-Bq1o6CJZ.js");return{difference:n,densify:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);let a=s(_t.fromExtent(r),2*(r.width+r.height)/Qi);a=Ee(a,e.spatialReference),e=i(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};w([b({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),w([b()],ie.prototype,"tileType",void 0),w([b()],ie.prototype,"rasterFunction",void 0),w([b()],ie.prototype,"primaryRasters",void 0),ie=w([K("esri.layers.support.rasterDatasets.FunctionRaster")],ie);const dt=ie;function Zi(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:n,pixelSize:l,spatialReference:o,extent:c}=e;return i.x===l.x&&i.y===l.y&&s.equals(o)&&a.equals(c)&&r.blockHeight===n.blockHeight&&r.blockWidth===n.blockWidth&&r.maximumPyramidLevel===n.maximumPyramidLevel}function es(t){return String(t.wkid??t.wkt??t.wkt2)}const ts=t=>{let e=class extends t{constructor(...i){super(...i),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=i[0]?.raster?.datasetFormat==="Function"}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(i){this._set("multidimensionalDefinition",i),this.updateRenderer()}set rasterFunction(i){i?.functionName?.toLowerCase()==="none"&&(i=void 0),this._set("rasterFunction",i),this.updateRasterFunction()}get rasterInfo(){return Dt(ne.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(i){this._set("url",ct(i,ne.getLogger(this)))}get renderer(){if(this.type!=="imagery-tile")return this.internalRenderer;const{activePresetRendererName:i,presetRenderers:s}=this;return i?s?.find(({name:a})=>a===i)?.renderer.clone():this.internalRenderer}set renderer(i){this.type==="imagery-tile"&&(this.activePresetRendererName=null),this.internalRenderer=i}set internalRenderer(i){i==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("internalRenderer",i),this.updateRenderer())}readRenderer(i,s,a){const n=s?.layerDefinition?.drawingInfo?.renderer;return Xt(n,a)||void 0}async convertVectorFieldData(i,s){const{serviceRasterInfo:a}=this;if(i==null||!a)return null;const n=this._rasterJobHandler.instance,l=a.dataType;return n?n.convertVectorFieldData({pixelBlock:i,dataType:l},s):Pi(i,l)}async computeStatisticsHistograms(i,s){await this.load(s),i=Ae(Qt,i).clone();const{serviceRasterInfo:a}=this;if(a==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=i;if(n==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let l=n;const{spatialReference:o}=a;n.spatialReference.equals(o)||(await De(),l=n.type==="extent"?Ie(n,o):Ee(n,o));const c=i.pixelSize??new A({x:a.pixelSize.x,y:a.pixelSize.y,spatialReference:o}),{extent:u,width:f,height:h}=zi(a,l,c),m=await this.fetchPixels(u,f,h,{...s,interpolation:"nearest"});if(m.pixelBlock==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const y=await Je(m.pixelBlock,u,l),g=this._rasterJobHandler.instance;return g?g.computeStatisticsHistograms({pixelBlock:y},s):He(y)}async createFlowMesh(i,s){const a=this._rasterJobHandler.instance;return a?a.createFlowMesh(i,s):Mi(i.meshType,i.simulationSettings,i.flowData,s.signal!=null?s.signal:new AbortController().signal)}normalizeRasterFetchOptions(i){const{multidimensionalInfo:s}=this.serviceRasterInfo??{};if(s==null)return i;let a=i.multidimensionalDefinition||this.multidimensionalDefinition;a?.length||(a=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=i.timeExtent||this.timeExtent;if(a!=null&&n!=null&&(n.start!=null||n.end!=null)){a=a.map(g=>g.clone());const l=s.variables.find(({name:g})=>g===a[0].variableName)?.dimensions?.find(({name:g})=>g==="StdTime"),o=a.find(({dimensionName:g})=>g==="StdTime");if(!l||!o)return{...i,multidimensionalDefinition:null};const{start:c,end:u}=n,f=c==null?null:c.getTime(),h=u==null?null:u.getTime(),m=f??h,y=h??f;if(l.values!=null){const g=l.values.filter(p=>{if(Array.isArray(p)){if(m===y)return p[0]<=m&&p[1]>=m;const d=p[0]<=m&&p[1]>m||p[0]=y,x=p[0]>=m&&p[1]<=y||p[0]y;return d||x}return m===y?p===m:p>=m&&p<=y});if(g.length){const p=g.sort((d,x)=>{const I=Array.isArray(d)?d[0]:d,R=Array.isArray(d)?d[1]:d,S=Array.isArray(x)?x[0]:x,T=Array.isArray(x)?x[1]:x;return m===y?I-S:Math.abs(R-y)-Math.abs(T-y)})[0];o.values=[p]}else a=null}else if(l.hasRegularIntervals&&l.extent){const[g,p]=l.extent;m>p||y1&&i.forEach(m=>u[m.url]=m);const f=pt(n.functionDefinition?.toJSON()??n.toJSON(),u),h=new dt({rasterFunction:f});h.rasterJobHandler=this._rasterJobHandler.instance,await h.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=h}else this.raster=s,this._cachedRasterFunctionJson=null,await s.open();if(this._cachedRendererJson=null,!a&&!n)return;const{bandIds:l}=this,{bandCount:o}=this.raster.rasterInfo,c=l?.length?l.some(u=>u>=o):o>=3;l&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:i,symbolizer:s}=this;if(!i||!s||!this.renderer)return;const{rasterInfo:a}=this.raster,n=Xe(a,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),l=n?.name,o=je({...this.renderer.toJSON(),variableName:l});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(o))return;const c=this._rasterJobHandler.instance;c&&(s.rasterInfo=Ue(a,l),s.rendererJSON=o,s.bind(),await c.updateSymbolizer(s),this._cachedRendererJson=o)}async applyRenderer(i,s){const a=i?.pixelBlock;if(!(a!=null&&a.pixels&&a.pixels.length>0))return null;let n;await this.updateRenderer();const l=this._rasterJobHandler.instance,o=this.bandIds??[];return n=l?await l.symbolize({...i,simpleStretchParams:s,bandIds:o}):this.symbolizer.symbolize({...i,simpleStretchParams:s,bandIds:o}),n}getTileUrl(i,s,a){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${i}/${s}/${a}`:""}getCompatibleTileInfo(i,s,a=!1){if(!this.loaded||s==null)return null;if(a&&i.equals(this.spatialReference))return this.tileInfo;const n=Et(i);return ee.create({size:256,spatialReference:i,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:s.xmin,y:s.ymax}})}getCompatibleFullExtent(i){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(i)||(this._compatibleFullExtent=this.raster.computeExtent(i)),this._compatibleFullExtent):null}async fetchTile(i,s,a,n={}){if(r(this),n.requestAsImageElement){const o=this.getTileUrl(i,s,a);return at(o,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(c=>c.data)}const{serviceRasterInfo:l}=this;if(l.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null){const o=n.tileInfo||l.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(i,s,a,o),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),this.renderer?.type==="raster-shaded-relief"&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(i,s,a,n)}async fetchPixels(i,s,a,n={}){return this.serviceRasterInfo.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null?{extent:i,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),s=Math.round(s),a=Math.round(a),this.raster.fetchPixels(i,s,a,n))}async identify(i,s={}){await this.load();const{raster:a,serviceRasterInfo:n}=this;if(n?.multidimensionalInfo!=null&&!(n.hasMultidimensionalTranspose&&(ht(s.multidimensionalDefinition)||s.transposedVariableName||s.timeExtent))&&(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition==null)return{location:i,value:null};const l=this.multidimensionalSubset?.areaOfInterest;if(l&&!l.contains(i))throw new C("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return a.identify(i,s)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const i=this.serviceRasterInfo?.multidimensionalInfo;if(i==null||this.serviceRasterInfo?.dataType!=="standard-time")return!1;const s=this.multidimensionalDefinition,a=s?.[0]?.variableName;return i.variables.some(n=>n.name===a&&(!s?.[0].dimensionName||n.dimensions.some(l=>l.name==="StdTime")))}getStandardTimeValue(i){return new Date(24*(i-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(i){const s=i??this.serviceRasterInfo?.multidimensionalInfo;return li(this.multidimensionalSubset,s)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const i=new si;return this._rasterJobHandler.connectionPromise=i.initialize().then(async()=>{r(this),this._rasterJobHandler.instance=i,this.raster.rasterJobHandler=i,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(this.interpolation==null){r(this);const{raster:i}=this,s=Zt(i.rasterInfo,i.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",s)}}_configDefaultRenderer(i="no"){r(this);const{rasterInfo:s}=this.raster,a=Xe(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=a?.name,l=ei({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&s.bandCount>1&&(this.bandIds=l?.bandIds??ti(s)),!this.renderer||i==="override"){const f=ii(this.raster),h=l?.renderer??Ye(s,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:f}),m=s.statistics,y=m&&m.length>0?m[0]:null,g=y?.max??0,p=y?.min??0;this.raster.datasetFormat==="WCSServer"&&h.type==="raster-stretch"&&(g>1e24||p<-1e24)&&(h.dynamicRangeAdjustment=!0,h.customStatistics=null,h.stretchType==="none"&&(h.stretchType="min-max")),this.renderer=h}const o=je({...this.renderer.toJSON(),variableName:n}),c=Ue(s,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=c):this.symbolizer=new bi({rendererJSON:o,rasterInfo:c});const u=this.symbolizer.bind();if(u.success){if(i==="auto"){const{colormap:f}=this.raster.rasterInfo,h=this.renderer;if(f!=null&&h.type==="raster-colormap"){const m=Ye(this.raster.rasterInfo);JSON.stringify(m)!==JSON.stringify(h)&&this._configDefaultRenderer("override")}else if(h.type==="raster-stretch"){const m=this.bandIds?.length,y=h.customStatistics?.length;!h.dynamicRangeAdjustment&&y&&m&&y!==m&&this._configDefaultRenderer("override")}}}else ne.getLogger(this).warn("imagery-tile-mixin",u.error||"The given renderer is not supported by the layer."),i==="auto"&&this._configDefaultRenderer("override")}};function r(i){if(!i.raster||!i.serviceRasterInfo)throw new C("imagery-tile","no raster")}return w([b({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),w([b({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),w([b({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),w([b({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),w([b({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),w([b({type:[Ft],json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.bandIds?.join(",")!=="0,1,2"}}}}})],e.prototype,"bandIds",void 0),w([b({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),w([b({json:{read:!1}})],e.prototype,"fullExtent",null),w([b({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),kt(qt)],e.prototype,"interpolation",void 0),w([b()],e.prototype,"ioConfig",void 0),w([b({type:[Le],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),w([b({type:Vt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),w([b()],e.prototype,"raster",void 0),w([b({type:Ne,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),w([b({readOnly:!0})],e.prototype,"rasterInfo",null),w([b()],e.prototype,"serviceRasterInfo",void 0),w([b()],e.prototype,"sourceJSON",void 0),w([b({readOnly:!0,type:L,json:{read:!1}})],e.prototype,"spatialReference",void 0),w([b({type:ee})],e.prototype,"tileInfo",void 0),w([b(ut)],e.prototype,"url",null),w([b()],e.prototype,"renderer",null),w([b({types:jt,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const i=this.renderer?.type==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!i}}},origins:{"web-scene":{types:Ut,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:i=>({enabled:i&&i.type!=="vector-field"&&i.type!=="flow"})}}}}})],e.prototype,"internalRenderer",null),w([Ct("internalRenderer")],e.prototype,"readRenderer",null),w([b({clonable:!1})],e.prototype,"symbolizer",void 0),e=w([K("esri.layers.mixins.ImageryTileMixin")],e),e};function yt(t){return["x","e","east","long","longitude"].includes(t.toLowerCase())}function gt(t){return["y","n","west","lat","latitude"].includes(t.toLowerCase())}function is(t){const{axes:e}=t.domain,r=Object.keys(e),i=[],s=[];let a=-1,n=-1,l=[];for(let x=0;xS.push(typeof v=="string"?new Date(v).getTime():v));const T=S[1]-S[0];i.push([S[0]-.5*T,S[S.length-1]+.5*T]),s.push(T)}else{const{start:T,stop:v,num:k}=R,_=(v-T)/(k-1);i.push([T-.5*_,v+.5*_]),s.push(_);for(let P=0;P-1&&n===-1?n=a===0?1:0:n>-1&&a===-1?a=n===0?1:0:n===-1&&a===-1&&(a=0,n=1),l=l.filter((x,I)=>!(I===a||I===n));const{referencing:o}=t.domain,c=o.find(x=>x.coordinates.includes(r[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=u==null||u==="CRS84"?4326:Number(u),h=new L({wkid:f}),[m,y]=i[a],[g,p]=i[n],d=new W({xmin:m,xmax:y,ymin:g,ymax:p,spatialReference:h});return{width:Math.round(d.width/s[a]),height:Math.round(d.height/s[n]),extent:d,dimensions:l}}function Fe(t){const e=At();return e?t[e]??Object.values(t)[0]:Object.values(t)[0]}function ke(){return Math.round(255*Math.random())}function ss(t){const e={},{parameters:r}=t;if(!r)return e;for(const[i,s]of Object.entries(r)){const{type:a,description:n,unit:l,categoryEncoding:o,observedProperty:c}=s;if(a==="Parameter"&&(e[i]={},n&&(e[i].description=Fe(n)),l&&(e[i].unit=l.label?Fe(l.label):null,e[i].symbol=l.symbol?.value),o)){const u=Object.entries(o).map((m,y)=>({OID:y,Value:Number(m[1]),ClassName:m[0].slice(m[0].lastIndexOf("/")+1),Count:1}));let f=!1;c?.categories?.length&&(c.categories.forEach(m=>{if(!m.id)return;const y=m.id.slice(m.id.lastIndexOf("/")+1),g=u.find(d=>d.ClassName===y);if(!g)return;const p=m.label?Fe(m.label):null;if(g.Label=p,m.preferredColor){const d=Bt.fromHex(m.preferredColor);d&&(f=!0,g.Red=d.r,g.Green=d.g,g.Blue=d.b)}}),f&&u.forEach(m=>{m.Red==null&&(m.Red=ke(),m.Green=ke(),m.Blue=ke())}));const h={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:u.map(m=>({attributes:m}))};f&&h.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),e[i].attributeTable=h}}return e}function rs(t){let e=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let i=0;ir&&(r=s))}return Ni(e,r)}function ns(t,e,r){const i=t.map((o,c)=>({name:o,count:e[c]})).sort((o,c)=>o.name>c.name?-1:1),s=(a=1,o=>a*=o.count);var a;const n=[...i.slice(1),{name:"",count:1}].reverse().map(s).reverse();let l=0;for(let o=t.length-1;o>=0;o--)l+=n[i.findIndex(({name:c})=>c===t[o])]*(r%e[o]),r=Math.floor(r/e[o]);return l}function as(t){const{width:e,height:r,extent:i,dimensions:s}=is(t),{ranges:a}=t,n=Object.keys(a).sort((h,m)=>ho[h.name]&&Object.assign(h,o[h.name]));const c=l.length?{variables:l}:void 0,u=[];for(let h=0;h2?h*d.slice(0,-2).reduce((k,_)=>k*_):0,I=p.slice(0,-2),R=d.slice(0,-2),S=g==="float"?"f32":rs(y),T=e*r,v=y.length/T;for(let k=0;kh.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}let oe=class extends ae{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,r,i={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[n,l]=a.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:c}=this.source,u={pixelBlock:o==null?c[0]:c[o],useBilinear:a.dataType!=="thematic",tileSize:{width:n,height:l},level:t,row:e,col:r},f=this.rasterJobHandler?this.rasterJobHandler.clipTile(u,i):ki(u);return Promise.resolve(f)}const s=this._pixelBlockTiles.get(`${t}/${e}/${r}`);return Promise.resolve(s)}async _open(t){const e=this.source,{pixelBlocks:r,attributeTable:i,statistics:s,histograms:a,name:n,nativeExtent:l,transform:o}=e,c=r[0],{width:u,height:f,pixelType:h}=c,m=e.extent??new W({xmin:-.5,ymin:.5,xmax:u-.5,ymax:f-.5,spatialReference:new L({wkid:3857})}),y=e.isPseudoSpatialReference??!e.extent,g={x:m.width/u,y:m.height/f},p={...e.keyProperties};i&&(p.DataType="Thematic");const d=new ve({width:u,height:f,pixelType:h,extent:m,nativeExtent:l,attributeTable:i,transform:o,pixelSize:g,spatialReference:m.spatialReference,bandCount:c.pixels.length,keyProperties:p,multidimensionalInfo:e.multidimensionalInfo,statistics:s,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(d),this.createRemoteDatasetStorageInfo(d,512,512),this._set("rasterInfo",d),this.updateTileInfo(),d.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,d.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},t),d.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(t,e,r){const{rasterInfo:i}=this,s=i.storageInfo.maximumPyramidLevel??0,a=i.dataType!=="thematic",n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:e,maximumPyramidLevel:s,useBilinear:a},r):Promise.resolve(Ci(t,e,s,a)),l=i.statistics!=null,o=i.histograms!=null,c=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},r):Promise.resolve(hi(t)),u=await lt([n,c]);if(!u[0].value&&u[1].value)throw new C("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(i.statistics=u[1].value?.statistics),o||(i.histograms=u[1].value?.histograms)}async _buildMDimStats(t,e,r){for(let i=0;inew Le({variableName:s.name,dimensionName:c.name,values:[c.values?.[0]??c.extent?.[0]],isSlice:!0})),n=mt(a,e),l=n==null?null:t[n];if(l==null)continue;const o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},r):He(l);s.statistics=o.statistics,s.histograms||(s.histograms=o.histograms)}}};w([b({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),w([b()],oe.prototype,"source",void 0),w([b()],oe.prototype,"url",null),oe=w([K("esri.layers.support.rasterDatasets.InMemoryRaster")],oe);const $e=oe;let he=class extends ae{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const{extent:e,pixelBlocks:r,multidimensionalInfo:i,attributeTable:s,bandNames:a}=await this._fetchData(t),{statistics:n,histograms:l}=He(r[0]),o=a?.map(h=>({BandName:h})),c={DataType:s?"Thematic":i?"Scientific":"Generic",BandProperties:o},u=new $e({source:{extent:e,pixelBlocks:r,attributeTable:s?Ge.fromJSON(s):null,multidimensionalInfo:i,statistics:n,histograms:l,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(t){const e=this.source??(await this.request(this.url,{signal:t?.signal})).data,r="imagery-tile-layer:open-coverage-json";if(e.type?.toLowerCase()!=="coverage"||e.domain?.domainType?.toLowerCase()!=="grid")throw new C(r,"Only coverage with Grid domain type is supported");if(!e.ranges)throw new C(r,"Missing ranges in the grid coverage data");if(!e.domain.referencing?.length)throw new C(r,"Missing domain referencing in the grid coverage data");const i=Object.values(e.ranges);for(let s=0;si.push(l));return i}const s=t.getElementsByTagNameNS("*",r);if(!s||s.length===0)return[];for(let a=0;a0?e?q(i[0],e):i[0]:null}function Y(t,e=null){const r=e?q(t,e):t;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function ls(t,e){const r=ue(t,e),i=[];let s;for(let a=0;aNumber(r))}function re(t,e){const r=Y(t,e);return Number(r)}function Ce(t,e){const r=t?.nodeName?.toLowerCase(),i=e.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}function nt(t,e){if(!t||!e)return null;const r=[];for(let i=0;iNumber(h));let l,o,c,u;ue(t,"Metadata/MDI").forEach(h=>{const m=Number(h.textContent??h.nodeValue);switch(h.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=m;break;case"STATISTICS_MAXIMUM":o=m;break;case"STATISTICS_MEAN":c=m;break;case"STATISTICS_STDDEV":u=m}});const f=re(t,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:n?.length&&i!=null&&s!=null?{min:i,max:s,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:l!=null&&o!=null?{min:l,max:o,avg:c,stddev:u}:null}}function Se(t){if(!t)return null;let e=Number(t);if(!isNaN(e)&&e!==0)return new L({wkid:e});if(t=String(t).trim(),Jt(t))return new L({wkt2:t});const r=t.toUpperCase();if(r.startsWith("COMPD_CS")){if(!r.includes("VERTCS")||!r.includes("GEOGCS")&&!r.startsWith("PROJCS"))return null;const i=r.indexOf("VERTCS"),s=r.indexOf("PROJCS"),a=s>-1?s:r.indexOf("GEOGCS");if(a===-1)return null;const n=t.slice(a,t.lastIndexOf("]",i)+1).trim(),l=t.slice(i,t.lastIndexOf("]")).trim();e=Oe(n);const o=new L(e?{wkid:e}:{wkt:n}),c=Oe(l);return c&&(o.vcsWkid=c),o}return r.startsWith("GEOGCS")||r.startsWith("PROJCS")?(e=Oe(t),new L(e!==0?{wkid:e}:{wkt:t})):null}function Oe(t){const e=t.replaceAll("]","[").replaceAll('"',"").split("[").map(s=>s.trim()).filter(s=>s!==""),r=e[e.length-1].split(","),i=r[0]?.toLowerCase();if((i==="epsg"||i==="esri")&&t.endsWith('"]]')){const s=Number(r[1]);if(!isNaN(s)&&s!==0)return s}return 0}function qe(t){if(t?.documentElement.tagName?.toLowerCase()!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};t.documentElement.childNodes.forEach(i=>{if(i.nodeType===1){if(Ce(i,"SRS")){if(!e.spatialReference){const s=Y(i);e.spatialReference=Se(s)}}else if(Ce(i,"Metadata"))if(i.getAttribute("domain")==="xml:ESRI"){const{spatialReference:s,transform:a}=cs(i);e.transform=a,e.spatialReference||(e.spatialReference=s)}else ue(i,"MDI").forEach(s=>e.metadata[s.getAttribute("key")]=Y(s));else if(Ce(i,"PAMRasterBand")){const s=us(i);s.sourceBandIndex!=null&&e.rasterBands[s.sourceBandIndex]==null?e.rasterBands[s.sourceBandIndex]=s:e.rasterBands.push(s)}}});const r=e.rasterBands;if(r.length){const i=!!r[0].statistics;e.statistics=i?r.map(a=>a.statistics).filter(Me):null;const s=!!r[0].histogram;e.histograms=s?r.map(a=>a.histogram).filter(Me):null}return e}let be=class extends ae{fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const e=await this._fetchData(t);let{spatialReference:r,statistics:i,histograms:s,transform:a}=await this._fetchAuxiliaryData(t);const n=!r;n&&(r=new L({wkid:3857})),s?.length&&i==null&&(i=ze(s));const{width:l,height:o}=e;let c=new W({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:r});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const m=a.forwardCoefficients;f=m&&m[1]===0&&m[2]===0,f&&(a=null,c=u)}const h=new $e({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[e],statistics:i,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(t){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=mi(e).toUpperCase();if(r!=="JPG"&&r!=="PNG"&&r!=="GIF"&&r!=="BMP")throw new C("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const i=r.toLowerCase(),s=i==="gif"||i==="bmp"||!Ot("ios"),a=await this.decodePixelBlock(e,{format:i,useCanvas:s,hasNoZlibMask:!0});if(a==null)throw new C("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:r=[],skipMapInfo:i}=this.ioConfig,s=i||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),a=this.datasetFormat,n=a==="JPG"?"jgw":a==="PNG"?"pgw":a==="BMP"?"bpw":null,l=n&&r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:e}),o=await lt([s,l]);if(e?.aborted)throw Pt();const c=qe(o[0].value?.data);if(!c.transform){const u=o[1].value?o[1].value.data.split(` +`).slice(0,6).map(f=>Number(f)):null;c.transform=u?.length===6?new We({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return c}};w([b({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),be=w([K("esri.layers.support.rasterDatasets.ImageAuxRaster")],be);const xe=be;let me=class extends ae{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(t,e,r,i={}){const{storageInfo:s,extent:a}=this.rasterInfo,{transposeInfo:n}=s,l=n!=null&&!!i.transposedVariableName;if(this._slices&&!l&&i.sliceId==null)return null;const o=l?0:s.maximumPyramidLevel-t+this._levelOffset,c=`${this.url}/tile/${o}/${e}/${r}`,u=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(c,{query:u,responseType:"array-buffer",signal:i.signal});if(!f)return null;const h=l?n.tileSize:s.tileInfo.size,m=await this.decodePixelBlock(f,{width:h[0],height:h[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(m==null)return null;const y=s.blockBoundary[t];if(s.compression!=="jpg"||r>y.minCol&&ry.minRow&&e{const a=e.find(n=>s.variableName===n.variableName&&n.dimensionName===s.dimensionName);return a?(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return r}return null}async fetchVariableStatisticsHistograms(t,e){const r=this.request(this.url+"/statistics",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.histograms),s=await Promise.all([r,i]);return s[0]&&s[0].forEach(a=>{a.avg=a.mean,a.stddev=a.standardDeviation}),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(t,e={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(t,0,e.datumTransformation);if(r===null)return null;let i=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let a=s-i+this._levelOffset;const n=r.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,r.row,r.col,e)==="available")break}catch{}if(a--,i++,r=this.identifyPixelLocation(n,i,e.datumTransformation),r===null)return null}return a===-1||r==null?null:i}async _open(t){const e=t?.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new C("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new C("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const s=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=i.cacheType,this.tileType==null&&(s.includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":i.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name?.slice(i.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:e});if(a==null)throw new C("image-server-raster:open","cannot initialize image service");Yt(a,i);const n=this.tileType==="Map"?hs(i.tileInfo,i):ee.fromJSON(i.tileInfo);Mt(n);const[l,o]=this._computeMinMaxLOD(a,n),{extent:c,pixelSize:u}=a,f=.5/a.width*u.x,h=Math.max(u.x,u.y),{lods:m}=n;(this.tileType!=="Map"&&i.maxScale!==0||Math.abs(u.x-u.y)>f||!m.some(v=>Math.abs(v.resolution-h){v.level>=o.level&&v.level<=l.level&&d.push({x:v.resolution,y:v.resolution}),kv.x-k.x);const I=this.computeBlockBoundary(c,g,p,n.origin,d,y),R=d.length>1?d.slice(1):null;let S;i.transposeInfo&&(S={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const T=x.length<=1||x.length>=3&&x.slice(0,-1).every(v=>v===x[0])?x[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/y))/10;if(a.storageInfo=new Re({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:R,pyramidScalingFactor:T,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:y,tileInfo:n,transposeInfo:S,blockBoundary:I}),ms(a),this._set("rasterInfo",a),i.capabilities.toLowerCase().includes("tilemap")){const v={tileInfo:a.storageInfo.tileInfo,parsedUrl:Nt(this.url),url:this.url,tileServers:[]};this._tilemapCache=new ji({layer:v})}}async _fetchRasterInfo(t){const e=this.sourceJSON;if(this.tileType==="Map"){const n=e.fullExtent||e.extent,l=Math.ceil((n.xmax-n.xmin)/e.pixelSizeX-.1),o=Math.ceil((n.ymax-n.ymin)/e.pixelSizeY-.1),c=L.fromJSON(e.spatialReference||n.spatialReference),u=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new ve({width:l,height:o,bandCount:3,extent:W.fromJSON(n),spatialReference:c,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=t,i=Kt(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),s=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then(n=>n.data?.slices).catch(()=>null):null,a=await Promise.all([i,s]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:t}=this;t.minScale&&t.minScale<0&&(t.minScale=0),t.maxScale&&t.maxScale<0&&(t.maxScale=0)}_computeMinMaxLOD(t,e){const{pixelSize:r}=t,i=.5/t.width*r.x,{lods:s}=e,a=e.lodAt(Math.max.apply(null,s.map(h=>h.level))),n=e.lodAt(Math.min.apply(null,s.map(h=>h.level))),{tileType:l}=this;if(l==="Map")return this._levelOffset=s[0].level,[a,n];if(l==="Raster")return[s.find(h=>h.resolution===r.x)??a,n];const{minScale:o,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=s.find(h=>Math.abs(h.scale-c)h.scale>c).sort((h,m)=>h.scale>m.scale?1:-1)[0]??a));let f=n;return o>0&&(f=s.find(h=>Math.abs(h.scale-o)n!=null&&n>=s&&n<=a)});if(r!==0&&i!==0){const n=c=>Math.round(1e4*c)/1e4,l=r?n(r):1/0,o=i?n(i):-1/0;return ee.fromJSON({...t,lods:t.lods.filter(c=>{const u=n(c.scale);return u<=l&&u>=o})})}return ee.fromJSON(t)}function ms(t){const{extent:e,spatialReference:r}=t;e.xmin>-1&&e.xmax>181&&r?.wkid&&r.isGeographic&&(t.nativeExtent=t.extent,t.transform=new Hi,t.extent=t.transform.forwardTransform(e))}w([b({type:String,json:{write:!0}})],me.prototype,"datasetFormat",void 0),w([b()],me.prototype,"tileType",void 0),me=w([K("esri.layers.support.rasterDatasets.ImageServerRaster")],me);const fs=me,U=new Map;U.set("Int8","s8"),U.set("UInt8","u8"),U.set("Int16","s16"),U.set("UInt16","u16"),U.set("Int32","s32"),U.set("UInt32","u32"),U.set("Float32","f32"),U.set("Float64","f32"),U.set("Double64","f32");const Z=new Map;Z.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Z.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Z.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Z.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let le=class extends ae{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,r,i={}){const{blockWidth:s,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[t];if(!l||l.maxRowe||l.minCol>r)return null;const{bandCount:o,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!u||u.length===0)return null;if(u[0].from===0&&u[0].to===0){const F=new Uint8Array(s*a);return new we({width:s,height:a,pixels:void 0,mask:F,validPixelCount:0})}const{bandIds:m}=this.ioConfig,y=this._getBandSegmentCount(),g=[];let p=0;for(p=0;pF.data.byteLength).reduce((F,M)=>F+M),I=new Uint8Array(x),R=[];let S=0;for(p=0;p1e24)for(p=0;p1e-6&&(M[p]=1);else for(p=0;p0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}_getBandSegmentCount(){return Z.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:i,blockHeight:s,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:l}=this.rasterInfo,o=this._getBandSegmentCount();let c,u,f,h=0,m=0;for(f=0;fparseFloat(F)))),q(t,"MRF_META/CachedSource"))throw new C("mrf:open","currently does not support MRF referencing other data files");const g=q(t,"MRF_META/GeoTags"),p=q(g,"BoundingBox");let d,x=!1;if(p!=null){const F=parseFloat(p.getAttribute("minx")),M=parseFloat(p.getAttribute("miny")),O=parseFloat(p.getAttribute("maxx")),N=parseFloat(p.getAttribute("maxy")),D=Y(g,"Projection")||"";let B=L.WGS84;if(D!=="LOCAL_CS[]")if(D.toLowerCase().startsWith("epsg:")){const z=Number(D.slice(5));isNaN(z)||z===0||(B=new L({wkid:z}))}else B=Se(D)??L.WGS84;else x=!0,B=new L({wkid:3857});d=new W(F,M,O,N),d.spatialReference=B}else x=!0,d=new W({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:new L({wkid:3857})});const I=q(t,"MRF_META/Rsets"),R=parseInt(I?.getAttribute("scale")||"2",10),S=d.spatialReference,T=new Re({origin:new A({x:d.xmin,y:d.ymax,spatialReference:S}),blockWidth:u,blockHeight:f,pyramidBlockWidth:u,pyramidBlockHeight:f,compression:n,pyramidScalingFactor:R}),v=new A({x:d.width/i,y:d.height/s,spatialReference:S}),k=new ve({width:i,height:s,extent:d,isPseudoSpatialReference:x,spatialReference:S,bandCount:a,pixelType:o,pixelSize:v,noDataValue:m,storageInfo:T}),_=Y(t,"datafile"),P=Y(t,"IndexFile");return{rasterInfo:k,files:{mrf:this.url,index:P||this.url.replace(".mrf",".idx"),data:_||this.url.replace(".mrf",Z.get(n).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return qe(e)}catch{return null}}};function ps(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,r,i,s,a,n;if(fi){for(r=new Uint8Array(t),s=new ArrayBuffer(t.byteLength),i=new Uint8Array(s),a=0;ac.name.toLowerCase()==="oid")?"OBJECTID":"OID",s=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),a=s.map(c=>c.name),n=[];let l=0,o=0;return r.forEach(c=>{const u={};for(u[i]=l++,o=1;o0)for(;u.lengthn;){const h=[];r.getUint8(o)===32?(o+=1,c.forEach(m=>{if(m.type==="C")h.push(Qe(new Uint8Array(e,o,m.length)).trim());else if(m.type==="N")h.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim(),10));else if(m.type==="F")h.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim()));else if(m.type==="D"){const y=String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim();h.push(new Date(parseInt(y.slice(0,4),10),parseInt(y.slice(4,6),10)-1,parseInt(y.slice(6,8),10)))}o+=m.length}),u.push(h)):o+=n}}return{header:l,fields:c,records:u,recordSet:ys({fields:c,records:u})}}}const Be=(t,e)=>t.get(e)?.values,fe=(t,e)=>t.get(e)?.values?.[0];let se=class extends ae{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async fetchRawTile(t,e,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(t,e,r))return null;const s=await this._fetchRawTiffTile(t,e,r,!1,i);if(s!=null&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(t,e,r,!0,i);a!=null&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(t){const e=t?t.signal:null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!r)throw new C("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:i,firstIFDPos:s,isBigTiff:a}=pi(r),n=[];await this._readIFDs(n,r,i,s,0,a?8:4,e);const{imageInfo:l,rasterInfo:o}=xs(n),c=di(n),u=yi(n);if(this._headerInfo={littleEndian:i,isBigTiff:a,ifds:n,pyramidIFDs:c,maskIFDs:u,...l},this._set("rasterInfo",o),!l.isSupported)throw new C("tiffraster:open","this tiff is not supported: "+l.message);if(!l.tileWidth)throw new C("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");o.isPseudoSpatialReference&&ne.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const f=n[0].get("PREDICTOR")?.values?.[0];if(n[0].get("SAMPLEFORMAT")?.values?.[0]===3&&f===2)throw new C("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:h,skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")&&!h){const y=await this._fetchAuxiliaryMetaData(t);y!=null&&ws(y,o)}m.includes("vat.dbf")||o.bandCount!==1||o.pixelType!=="u8"||h||(o.attributeTable=await this._fetchAuxiliaryTable(t),o.attributeTable!=null&&(o.keyProperties.DataType="thematic")),h&&this.updateImageSpaceRasterInfo(o),this.updateTileInfo()}async _readIFDs(t,e,r,i,s,a=4,n){if(!i)return null;(i>=e.byteLength||i<0)&&(e=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:n})).data,s=i+s,i=0);const l=await this._readIFD(e,r,i,s,pe.tiffTags,a,n);if(t.push(l.ifd),!l.nextIFD)return null;await this._readIFDs(t,e,r,l.nextIFD-s,s,a,n)}async _readIFD(t,e,r,i,s=pe.tiffTags,a=4,n){if(!t)return null;const l=gi(t,e,r,i,s,a);if(l.success){const o=[];if(l.ifd?.forEach(c=>{c.values||o.push(c)}),o.length>0){const c=o.map(f=>f.offlineOffsetSize).filter(Me),u=Math.min.apply(null,c.map(f=>f[0]));if(Math.min.apply(null,c.map(f=>f[0]+f[1]))-u<=this._bufferSize){const{data:f}=await this.request(this.url,{range:{from:u,to:u+this._bufferSize},responseType:"array-buffer",signal:n});t=f,i=u,o.forEach(h=>xi(t,e,h,i))}}if(l.ifd?.has("GEOKEYDIRECTORY")){const c=l.ifd.get("GEOKEYDIRECTORY"),u=c?.values;if(u&&u.length>4){const f=u[0]+"."+u[1]+"."+u[2],h=await this._readIFD(t,e,c.valueOffset+6-i,i,pe.geoKeys,2,n);c.data=h.ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[f]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==t.byteLength)return(t=(await this.request(this.url,{range:{from:i,to:i+l.requiredBufferSize+4},responseType:"array-buffer",signal:n})).data).byteLengththis.request(this.url,{range:T,responseType:"array-buffer",signal:s.signal})),f=await Promise.all(u),h=f.map(T=>T.data.byteLength).reduce((T,v)=>T+v),m=f.length===1?f[0].data:new ArrayBuffer(h),y=[0],g=[0];if(f.length>1){const T=new Uint8Array(m);for(let v=0,k=0;vy||r>g||e3&&F.length%3==0){_=[];const O=F.length/3;for(let N=0;N>>8,F[N+O]>>>8,F[N+2*O]>>>8])}const M=new ve({width:r,height:i,bandCount:n,pixelType:l,pixelSize:v,storageInfo:T,spatialReference:x,isPseudoSpatialReference:I,keyProperties:k,extent:R,colormap:_,statistics:p?p.statistics:null});if(g?.length&&(M.nativeExtent=new W({xmin:-.5,ymin:.5-i,xmax:r-.5,ymax:.5,spatialReference:x}),M.transform=new We({polynomialOrder:1,forwardCoefficients:[g[2]+g[0]/2,g[5]-g[3]/2,g[0],g[3],-g[1],-g[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(R.xmax-R.xmin)/r,y:(R.ymax-R.ymin)/i,spatialReference:x}),T.origin.x=-.5,T.origin.y=.5),m){const{x:O,y:N}=M.pixelSize;m.forEach(D=>{D.x*=O,D.y*=N})}return{imageInfo:e,rasterInfo:M}}function ws(t,e){if(e.statistics=t.statistics??e.statistics,e.histograms=t.histograms,t.histograms&&e.statistics==null&&(e.statistics=ze(t.histograms)),t.transform&&e.transform==null){e.transform=t.transform,e.nativeExtent=e.extent;const r=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(r.xmax-r.xmin)/e.width,y:(r.ymax-r.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=r}e.isPseudoSpatialReference&&t.spatialReference&&(e.spatialReference=t.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}w([b()],se.prototype,"_files",void 0),w([b()],se.prototype,"_headerInfo",void 0),w([b()],se.prototype,"_bufferSize",void 0),w([b({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),se=w([K("esri.layers.support.rasterDatasets.TIFFRaster")],se);const Is=se,H=new Map;H.set("MRF",{desc:"Meta Raster Format",constructor:ds}),H.set("TIFF",{desc:"GeoTIFF",constructor:Is}),H.set("RasterTileServer",{desc:"Raster Tile Server",constructor:fs}),H.set("JPG",{desc:"JPG Raster Format",constructor:xe}),H.set("PNG",{desc:"PNG Raster Format",constructor:xe}),H.set("GIF",{desc:"GIF Raster Format",constructor:xe}),H.set("BMP",{desc:"BMP Raster Format",constructor:xe}),H.set("CovJSON",{desc:"COVJSON Raster Format",constructor:os}),H.set("MEMORY",{desc:"In Memory Raster Format",constructor:$e});class Pe{static get supportedFormats(){const e=new Set;return H.forEach((r,i)=>e.add(i)),e}static async open(e){const{url:r,ioConfig:i,source:s,sourceJSON:a}=e;let n=e.datasetFormat??i?.datasetFormat;n==null&&(r.includes(".")?n=r.slice(r.lastIndexOf(".")+1).toUpperCase():s?.type?.toLowerCase()==="coverage"?n="CovJSON":s?.extent&&s.pixelblocks&&(n="MEMORY")),n==="OVR"||n==="TIF"?n="TIFF":n==="JPG"||n==="JPEG"||n==="JFIF"?n="JPG":n==="COVJSON"&&(n="CovJSON"),r.toLowerCase().includes("/imageserver")&&!r.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:r,source:s,sourceJSON:a,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(f=>{l[f]==null&&delete l[f]}),n){if(!this.supportedFormats.has(n))throw new C("rasterfactory:open","not a supported format "+n);if(n==="CRF")throw new C("rasterfactory:open",`cannot open raster: ${r}`);const f=new(H.get(n)).constructor(l);return await f.open({signal:e.signal}),f}const o=Array.from(H.keys()).filter(f=>f!=="CovJSON"&&f!=="Memory");let c=0;const u=()=>{if(n=o[c++],!n||n==="CRF")return null;const f=new(H.get(n)).constructor(l);return f.open({signal:e.signal}).then(()=>f).catch(()=>u())};return u()}static register(e,r,i){H.has(e.toUpperCase())||H.set(e.toUpperCase(),{desc:r,constructor:i})}}let E=class extends Wt(qi(Wi(Gi($t(Gt(ts(Vi(zt($i(Lt(wt(Ht)))))))))))){constructor(...t){super(...t),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=It(async(e,r,i)=>{const{save:s,saveAs:a}=await ot(()=>import("./imageryUtils-6MVSqijr-wws7sSH-.js"),__vite__mapDeps([6,7,1,2,8,9,10,11,12,13,14,15]),import.meta.url);switch(e){case ye.SAVE:return s(this,r);case ye.SAVE_AS:return a(this,i,r)}})}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},t).catch(bt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const t=[new ce({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new ce({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],e=this.raster?.rasterInfo??this.serviceRasterInfo,r=e?.attributeTable,i=r!=null?r.fields:null,s="Raster.";if(i){const l=i.filter(o=>o.type!=="oid"&&o.name.toLowerCase()!=="value").map(o=>{const c=o.clone();return c.name=s+o.name,c});t.push(...l)}const a=e?.dataType,n=e?.multidimensionalInfo;if((a==="vector-magdir"||a==="vector-uv")&&n!=null){const l=n.variables[0].unit?.trim(),o="Magnitude"+(l?` (${l})`:"");t.push(new ce({name:"Raster.Magnitude",alias:o,domain:null,editable:!1,type:"double"})),t.push(new ce({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return t}createPopupTemplate(t){const{rasterFields:e}=this,r=t?.visibleFieldNames??new Set(e.map(({name:a})=>a).filter(a=>a.toLowerCase()!=="raster.servicepixelvalue.raw")),i=Ui({fields:e,title:this.title},{...t,visibleFieldNames:r}),{rasterInfo:s}=this.raster;return i?.fieldInfos&&s?.pixelType.startsWith("f")&&i.fieldInfos.forEach(({format:a,fieldName:n})=>{a&&n&&/^raster\.(item|service)pixelvalue/i.test(n)&&(a.places=2)}),i}async generateRasterInfo(t,e){if(t=Ae(Ne,t),await this.load(),!t||t.functionName?.toLowerCase()==="none")return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(t,e);return r}catch(r){throw r instanceof C?r:new C("imagery-tile-layer","the given raster function is not supported")}}async save(t){return this._debouncedSaveOperations(ye.SAVE,t)}async saveAs(t,e){return this._debouncedSaveOperations(ye.SAVE_AS,e,t)}write(t,e){const r=this._primaryRasters[0]??this.raster;if(this.loaded?r.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(t,e);if(e?.messages){const i=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new C("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${i}'`,{layer:this}))}return null}async _openRaster(t){let e=!1;if(this.raster)await this._openFromRaster(this.raster,t),e=this.raster.datasetFormat==="Function",!e&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:i,rasterFunction:s,source:a}=this;if(!i&&!a)throw new C("imagery-tile-layer:open","missing url or source parameter");a?await this._openFromSource(a,t):s?await this._openFromUrlWithRasterFunction(i,s,t):await this._openFromUrl(i,t)}const r=this.raster.rasterInfo;if(!r)throw new C("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",e?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const i=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(i,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Rt(()=>this.customParameters,i=>{this.raster&&(this.raster.ioConfig.customFetchParameters=i)}))}async _openFromRaster(t,e){t.rasterInfo||await t.open({signal:e}),this._primaryRasters=t.datasetFormat==="Function"?t.primaryRasters.rasters:[t],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(t,e,r){const i=[t];e&&Li(e.toJSON(),i);const s=await Promise.all(i.map(n=>Pe.open({url:n,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=s.findIndex(n=>n==null);if(a>-1)throw new C("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(e)}async _openFromUrl(t,e){const r=await Pe.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(r==null)throw new C("imagery-tile-layer:open",`cannot open raster: ${t}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(t,e){const r="the tiled imagery data source is not supported",i=t.type?.toLowerCase()==="coverage"?"CovJSON":t.extent&&t.pixelBlock?"MEMORY":null;if(!i)throw new C("imagery-tile-layer:open",r);i==="MEMORY"&&(t={...t,pixelBlock:void 0,pixelBlocks:[t.pixelBlock]});const s=await Pe.open({url:"",source:t,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(s==null)throw new C("imagery-tile-layer:open",r);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(t,e){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(a=>r[a.url]=a);const i=pt(t.functionDefinition?.toJSON()??t.toJSON(),r),s=new dt({rasterFunction:i});return await s.open(e),s}async _initializeWithFunctionRaster(t,e){try{this.raster=await this._openFunctionRaster(t,e)}catch(r){r instanceof C&&ne.getLogger(this).error("imagery-tile-layer:open",r.message),ne.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};w([b({clonable:!1})],E.prototype,"_primaryRasters",void 0),w([b(ri)],E.prototype,"legendEnabled",void 0),w([b({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],E.prototype,"isReference",void 0),w([b({type:["show","hide"]})],E.prototype,"listMode",void 0),w([b({json:{read:!0,write:!0}})],E.prototype,"blendMode",void 0),w([b()],E.prototype,"sourceJSON",void 0),w([b({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],E.prototype,"version",void 0),w([b({readOnly:!0,json:{read:!1}})],E.prototype,"type",void 0),w([b({type:["ArcGISTiledImageServiceLayer"]})],E.prototype,"operationalLayerType",void 0),w([b({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(t,e,r){e[r]=!t}}}})],E.prototype,"popupEnabled",void 0),w([b({type:vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],E.prototype,"popupTemplate",void 0),w([b({readOnly:!0})],E.prototype,"defaultPopupTemplate",null),w([b({readOnly:!0,type:[ce]})],E.prototype,"fields",void 0),w([b({readOnly:!0,type:[ce]})],E.prototype,"rasterFields",null),w([b({constructOnly:!0})],E.prototype,"source",void 0),E=w([K("esri.layers.ImageryTileLayer")],E);const Er=E;export{Er as default}; diff --git a/main/assets/ImageryTileLayerView2D-nEz2YhMc-BvGHSsMi.js b/main/assets/ImageryTileLayerView2D-nEz2YhMc-BvGHSsMi.js new file mode 100644 index 000000000..8da3776f0 --- /dev/null +++ b/main/assets/ImageryTileLayerView2D-nEz2YhMc-BvGHSsMi.js @@ -0,0 +1 @@ +import{v as h,S as p,i as M,ah as L,aU as R,a1 as I,av as ge,aL as _e,j as ye,bp as xe,n as be,O as we,w as ve,bh as ne,o as Te,bi as Pe,hT as F}from"./main-C7yV2j71.js";import{p as Z}from"./multidimensionalUtils-BwTugeu7-LevYq4ep.js";import{o as Se,l as Ue,c as Re}from"./RasterVFDisplayObject-CnriTVT9-7AFXrs58.js";import{X as Ie,A as Fe,Y as Ce}from"./LayerView-Bish-E63-I2LV0oDm.js";import{t as oe,E as k,m as ze,e as z}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{Q as Me,E as le,R as Ve,C as E,D as Be,H as Ge}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as B}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as Le}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{A as G,L as J,M as A,B as Oe,F as ke,G as De}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{N as U,k as w,w as q,G as Ee,x as Ae,U as j,b as je,V as qe,M as We,L as Ne,F as $e}from"./rasterUtils-DqAu9qES-DpmWvz0K.js";import{s as Y}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{H as Qe,V as He}from"./Texture-BCt2hphT-CtQVMDnp.js";import{t as C}from"./definitions-DJSdSb77-DkoRHaVx.js";import{k as Ze,F as K,K as ue}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{G as Je}from"./Program-DLVwTiPA-CHQtoRqS.js";import{h as ce}from"./TileContainer-D48pXXgL-DSah9A2g.js";import{i as Ye}from"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import{D as Ke,B as Xe}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{V as X}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{Z as ee,P as te,K as et,O as tt}from"./RawBlockCache-Cj_tmHDm-CYD33Wpe.js";import{k as rt,U as st,p as it,r as re}from"./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js";import{a as se,Q as at,$ as nt}from"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import{i as ot}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import{n as lt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{T as ut}from"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import{m as ct}from"./popupUtils-nV1O8RUO-X6GWMgRY.js";import{n as ht}from"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";const dt={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class mt extends Le{constructor(e=null,r=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=r,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(F(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||dt}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdsChanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?A.LINEAR:A.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=F(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){const r=e||this.projected;return[r?this.width:this.source?.width||this.width,r?this.height:this.source?.height||this.height]}getRasterCellSize(){const e=this.rawPixelData?.srcPixelSize,{projected:r,resolution:s}=this;return e&&!r?[e.x,e.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:z()}}setTransform(e){const r=Ve(this.transforms.displayViewScreenMat3),[s,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),a=this.resolution/this.pixelRatio/e.resolution,n=a*this.width,o=a*this.height,l=Math.PI*this.rotation/180;E(r,r,B(s,i)),E(r,r,B(n/2,o/2)),Be(r,r,-l),E(r,r,B(-n/2,-o/2)),Ge(r,r,B(n,o)),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,r)}getTextures({forProcessing:e=!1,useProcessedTexture:r=!1}={}){const s=r?this._processedTexture??this._rasterTexture:this._rasterTexture,i=[],a=[];return s?(this._transformGridTexture&&!this.projected&&(a.push(this._transformGridTexture),i.push("u_transformGrid")),r?(a.push(s),i.push("u_image"),this._colormapTexture&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a}):(a.push(s),i.push("u_image"),this._colormapTexture&&!e&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a})):{names:i,textures:a}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const r=this._isValidSource(this.source);r&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(r?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=We(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(r=>r?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const r=this.source?.extractBands(this.bandIds);if(!this._isValidSource(r))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=Ne(e,r,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const r=this._rasterTextureBandIds;return!(r==null&&e==null||r&&e&&r.join("")===e.join(""))}_isValidSource(e){return e!=null&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:r}=this.symbolizerParameters,s=r==="lut"&&!this.symbolizerParameters.isClassBreaks||r==="hillshade"||r==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||s||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,s=this.symbolizerParameters.colormap;return s?r?s.length!==r.length||s.some((i,a)=>i!==r[a])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=j(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=j(e,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}function pt(t){return t.source!=null}function W(t){const e=[];return t&&(e.push("applyProjection"),t.spacing[0]===1&&e.push("lookupProjection")),e}function he(t,e,r){const s=!r.capabilities.textureFloatLinear,i=[];return t==="cubic"?i.push("bicubic"):t==="bilinear"&&(e?(i.push("bilinear"),i.push("nnedge")):s&&i.push("bilinear")),i}const ft={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function gt(t,e,r){const s=r?[]:W(e.transformGrid);return{defines:s,program:t.painter.materialManager.getProgram(ft,s)}}function _t(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const{colormap:o,colormapOffset:l}=r.symbolizerParameters,c=q(o,l);w(e,s,c)}const yt={createProgram:gt,bindTextureAndUniforms:_t},xt={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function bt(t,e,r){const{colormap:s}=e.symbolizerParameters,i=[...r?[]:W(e.transformGrid),...he(e.interpolation,!0,t.context)];return s!=null&&i.push("applyColormap"),{defines:i,program:t.painter.materialManager.getProgram(xt,i)}}function wt(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ee(o);w(e,s,{...d,u_scaling:1})}const vt={createProgram:bt,bindTextureAndUniforms:wt},Tt={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pt(t,e,r){const{colormap:s,bandCount:i}=e.symbolizerParameters,a=[...r?[]:W(e.transformGrid),...he(e.interpolation,i===1,t.context)];return e.isRendereredSource&&!r?a.push("noop"):s!=null&&a.push("applyColormap"),{defines:a,program:t.painter.materialManager.getProgram(Tt,a)}}function St(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ae(o);w(e,s,d)}const Ut={createProgram:Pt,bindTextureAndUniforms:St},O=new Map;function Rt(t){return O.get(t)}O.set("lut",yt),O.set("hillshade",vt),O.set("stretch",Ut);const It=[1,1],Ft=[2,0,0,0,2,0,-1,-1,0];function x(t,e,r,s){const{context:i,rasterFunction:a,hasBranches:n}=t,{raster:o}=a.parameters,l=n?o?.id??-1:0,c=[r.functionTextures[l]??r.rasterTexture],d=["u_image"];if(s){const u=j(i,s);r.functionTextures[100]=u,c.push(u),d.push("u_colormap")}U(i,e,d,c)}function N(t,e,r){const{rasters:s}=t.rasterFunction.parameters;if(!s)return;if(s.length<2)return x(t,e,r);const i=s.filter(a=>a.name!=="Constant").map(a=>a.id!=null&&a.name!=="Identity"?r.functionTextures[a.id]:r.rasterTexture);if(U(t.context,e,["u_image","u_image1","u_image2"].slice(0,i.length),i),i.length!==s.length){if(s.length===2){const a=s.findIndex(l=>l.name==="Constant"),n=a===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:o}=s[a].parameters;e.setUniform1f("u_image1Const",o),e.setUniformMatrix3fv("u_imageSwap",n)}else if(s.length===3){const a=[];if(s.forEach((n,o)=>n.name==="Constant"&&a.push(o)),a.length===1){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const o=a[0]===0?[0,1,0,0,0,1,1,0,0]:a[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",o)}else if(a.length===2){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const{value:o}=s[a[1]].parameters;e.setUniform1f("u_image2Const",o);const l=s.findIndex(d=>d.name!=="Constant"),c=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",c)}}}}function y(t){t.setUniform2fv("u_coordScale",It),t.setUniformMatrix3fv("u_dvsMat3",Ft)}const Ct={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zt(t,e){return t.painter.materialManager.getProgram(Ct,[])}function Mt(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i)}const Vt={createProgram:zt,bindTextureAndUniforms:Mt},Bt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gt(t,e){const{painter:r,rasterFunction:s}=t,{indexType:i,isOutputRounded:a}=s.parameters,n=[i];return a&&n.push("roundOutput"),r.materialManager.getProgram(Bt,n)}function Lt(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s,adjustments:i}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s),e.setUniform1fv("u_adjustments",i)}const Ot={createProgram:Gt,bindTextureAndUniforms:Lt},kt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/colormap2rgb",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dt(t){const{painter:e}=t;return e.materialManager.getProgram(kt,[])}function Et(t,e,r){const{indexedColormap:s,offset:i}=t.rasterFunction.parameters;x(t,e,r,s),y(e),e.setUniform1f("u_colormapOffset",i),e.setUniform1f("u_colormapMaxIndex",s.length/4-1)}const At={createProgram:Dt,bindTextureAndUniforms:Et},jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qt(t,e){const r=t.rasterFunction.parameters.rasters.filter(i=>i.name==="Constant"),s=[];return r.length&&(s.push("oneConstant"),r.length===2&&s.push("twoConstant")),t.painter.materialManager.getProgram(jt,s)}function Wt(t,e,r){N(t,e,r),y(e)}const Nt={createProgram:qt,bindTextureAndUniforms:Wt},$t={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/computechange",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qt(t){const{painter:e,rasterFunction:r}=t,{method:s,rasters:i,isOutputRounded:a}=r.parameters,n=[s.includes("-")?s.slice(0,s.indexOf("-")):s];return i.filter(o=>o.name==="Constant").length&&n.push("oneConstant"),a&&n.push("roundOutput"),e.materialManager.getProgram($t,n)}function Ht(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const Zt={createProgram:Qt,bindTextureAndUniforms:Ht},Jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Yt(t,e){return t.painter.materialManager.getProgram(Jt,[])}function Kt(t,e,r){x(t,e,r),y(e);const{contrastOffset:s,brightnessOffset:i}=t.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",s),e.setUniform1f("u_brightnessOffset",i)}const Xt={createProgram:Yt,bindTextureAndUniforms:Kt},er={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function tr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a}=s.parameters,n=[{name:"rows",value:i},{name:"cols",value:a}];return r.materialManager.getProgram(er,n)}function rr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{kernel:s,clampRange:i}=t.rasterFunction.parameters;e.setUniform1fv("u_kernel",s),e.setUniform2fv("u_clampRange",i)}const sr={createProgram:tr,bindTextureAndUniforms:rr},ir={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ar(t,e){const{painter:r,rasterFunction:s}=t,{curvatureType:i}=s.parameters,a=[i];return r.materialManager.getProgram(ir,a)}function nr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const{zFactor:i}=t.rasterFunction.parameters,a=r.getRasterCellSize();e.setUniform1f("u_zlFactor",200*i/a[0]/a[1])}const or={createProgram:ar,bindTextureAndUniforms:nr},lr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ur(t,e){return t.painter.materialManager.getProgram(lr,[])}function cr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const hr={createProgram:ur,bindTextureAndUniforms:cr},dr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function mr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a,fillNoDataOnly:n,statisticsType:o}=s.parameters,l=[{name:"rows",value:i},{name:"cols",value:a},o];return n&&l.push("fill"),r.materialManager.getProgram(dr,l)}function pr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{clampRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_clampRange",s)}const fr={createProgram:mr,bindTextureAndUniforms:pr},gr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _r(t,e){return t.painter.materialManager.getProgram(gr,[])}function yr(t,e,r){x(t,e,r),y(e);const{weights:s}=t.rasterFunction.parameters;e.setUniform3fv("u_weights",s)}const xr={createProgram:_r,bindTextureAndUniforms:yr},br={vsPath:"raster/rfx/vs",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function wr(t,e){const{indexedColormap:r}=t.rasterFunction.parameters,s=[];return r?.length&&s.push("applyColormap"),t.painter.materialManager.getProgram(br,s)}function vr(t,e,r){const s=t.rasterFunction.parameters,{indexedColormap:i}=s;x(t,e,r,i),y(e);const a=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",a);const n=r.getRasterCellSize();e.setUniform2fv("u_cellSize",n);const{pixelSizeFactor:o}=s;if(o===0)e.setUniform2fv("u_factor",[s.factor[0]/n[0],s.factor[1]/n[1]]);else{const{zFactor:l,pixelSizePower:c,gcsFactor:d}=s,u=n[0]*d,m=n[1]*d,f=(l+u**c*o)/(8*u),_=(l+m**c*o)/(8*m);e.setUniform2fv("u_factor",[f,_])}e.setUniform1i("u_hillshadeType",s.hillshadeType),e.setUniform1fv("u_sinZcosAs",s.sinZcosAs),e.setUniform1fv("u_sinZsinAs",s.sinZsinAs),e.setUniform1fv("u_cosZs",s.cosZs),e.setUniform1fv("u_weights",s.weights),e.setUniform1f("u_opacity",1),e.setUniform1i("u_flipY",0),e.setUniform1f("u_scaling",255),e.setUniform1f("u_minValue",s.minValue),e.setUniform1f("u_maxValue",s.maxValue),i&&(e.setUniform1f("u_colormapOffset",s.offset),e.setUniform1f("u_colormapMaxIndex",i.length/4-1))}const ie={createProgram:wr,bindTextureAndUniforms:vr},Tr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pr(t){const{painter:e,rasterFunction:r}=t,{imageCount:s,operationName:i,rasters:a,isOutputRounded:n}=r.parameters,o=[i.toLowerCase()];s===2&&o.push("twoImages");const l=a.filter(c=>c.name==="Constant");return l.length&&(o.push("oneConstant"),l.length===2&&o.push("twoConstant")),n&&o.push("roundOutput"),e.materialManager.getProgram(Tr,o)}function Sr(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const ae={createProgram:Pr,bindTextureAndUniforms:Sr},Ur={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Rr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.bandCount>1?["multiBand"]:[];return r.materialManager.getProgram(Ur,i)}function Ir(t,e,r){x(t,e,r),y(e);const{includedRanges:s,noDataValues:i}=t.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",s),e.setUniform1fv("u_noDataValues",i)}const Fr={createProgram:Rr,bindTextureAndUniforms:Ir},Cr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.scaled?["scaled"]:[];return r.materialManager.getProgram(Cr,i)}function Mr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const Vr={createProgram:zr,bindTextureAndUniforms:Mr},Br={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gr(t,e){return t.painter.materialManager.getProgram(Br,[])}function Lr(t,e,r){x(t,e,r),y(e);const{noDataRanges:s,rangeMaps:i,allowUnmatched:a,clampRange:n}=t.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",s),e.setUniform1fv("u_rangeMaps",i),e.setUniform1f("u_unmatchMask",a?1:0),e.setUniform2fv("u_clampRange",n)}const Or={createProgram:Gr,bindTextureAndUniforms:Lr},kr={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dr(t,e){const{painter:r}=t,s=[],{interpolation:i,transformGrid:a}=e,n=t.rasterFunction?.parameters;return i==="cubic"?s.push("bicubic"):i==="bilinear"&&(s.push("bilinear"),n?.requireNNEdge&&s.push("nnedge")),a&&(s.push("applyProjection"),a.spacing[0]===1&&s.push("lookupProjection")),r.materialManager.getProgram(kr,s)}function Er(t,e,r){const{names:s,textures:i}=r.getTextures({forProcessing:!0});U(t.context,e,s,i),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:a,height:n,source:o,transformGrid:l}=r;e.setUniform2fv("u_srcImageSize",[o.width,o.height]),e.setUniform2fv("u_targetImageSize",[a,n]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Y),e.setUniform2fv("u_transformGridSize",l?l.size:Y)}const Ar={createProgram:Dr,bindTextureAndUniforms:Er},jr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qr(t,e){const{painter:r,rasterFunction:s}=t,{slopeType:i,isOutputRounded:a}=s.parameters,n=[];return i==="percent-rise"&&n.push("percentRise"),a&&n.push("roundOutput"),r.materialManager.getProgram(jr,n)}function Wr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i);const{zFactor:a,slopeType:n,pixelSizePower:o,pixelSizeFactor:l}=t.rasterFunction.parameters;e.setUniform1f("u_zFactor",a),e.setUniform1f("u_pixelSizePower",n==="adjusted"?o:0),e.setUniform1f("u_pixelSizeFactor",n==="adjusted"?l:0)}const Nr={createProgram:qr,bindTextureAndUniforms:Wr},$r={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qr(t,e){const{useGamma:r,bandCount:s,isOutputRounded:i}=t.rasterFunction.parameters,a=[];return r&&a.push("useGamma"),s>1&&a.push("multiBand"),i&&a.push("roundOutput"),t.painter.materialManager.getProgram($r,a)}function Hr(t,e,r){x(t,e,r),y(e);const{width:s,height:i}=r,a=t.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[s,i]),e.setUniform1f("u_minOutput",a.outMin),e.setUniform1f("u_maxOutput",a.outMax),e.setUniform1fv("u_factor",a.factor),e.setUniform1fv("u_minCutOff",a.minCutOff),e.setUniform1fv("u_maxCutOff",a.maxCutOff),e.setUniform1fv("u_gamma",a.gamma),e.setUniform1fv("u_gammaCorrection",a.gammaCorrection)}const Zr={createProgram:Qr,bindTextureAndUniforms:Hr},g=new Map;function de(t,e){const r=new Qe;return r.width=t,r.height=e,r.internalFormat=Oe.RGBA32F,r.samplingMode=A.NEAREST,r.dataType=ke.FLOAT,r.isImmutable=!0,r.wrapMode=De.CLAMP_TO_EDGE,r}function Jr(t,e,r,s){const{context:i,requestRender:a,allowDelayedRender:n}=t,o=s.createProgram(t,r);return n&&a!=null&&!o.compiled?(a(),null):(i.bindFramebuffer(e),i.setViewport(0,0,e.width,e.height),i.useProgram(o),o)}function Yr(t){return g.get(t.toLowerCase())}function Kr(t,e,r,s){const i=t.rasterFunction.name.toLowerCase(),a=i==="reproject"?Ar:Yr(i);if(a==null)return;const n=Jr(t,r,s,a);if(!n)return;a.bindTextureAndUniforms(t,n,s);const{interpolation:o}=s;i==="reproject"&&(s.interpolation="nearest"),e.draw();const[l,c]=s.getRasterTextureSize(i==="reproject"),d=de(l,c),u=new He(t.context,d);if(r.copyToTexture(0,0,l,c,0,0,u),i==="reproject")s.rasterTexture=u,s.projected=!0,s.interpolation=o;else{const m=t.hasBranches?t.rasterFunction.id:0;s.functionTextures[m]=u}}g.set("arithmetic",ae),g.set("aspect",Vt),g.set("bandarithmetic",Ot),g.set("colormaptorgb",At),g.set("computechange",Zt),g.set("compositeband",Nt),g.set("convolution",sr),g.set("contrastbrightness",Xt),g.set("curvature",or),g.set("extractband",hr),g.set("statistics",fr),g.set("grayscale",xr),g.set("hillshade",ie),g.set("shadedrelief",ie),g.set("local",ae),g.set("mask",Fr),g.set("ndvi",Vr),g.set("remap",Or),g.set("slope",Nr),g.set("stretch",Zr);class Xr extends Ze{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){F(this._quad),F(this._fbo)}prepareState(e){const{context:r,renderPass:s}=e,i=s==="raster";r.setBlendingEnabled(!i),r.setBlendFunctionSeparate(G.ONE,G.ONE_MINUS_SRC_ALPHA,G.ONE,G.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),r.setStencilWriteMask(0),r.setStencilTestEnabled(!i)}draw(e,r){if(!pt(r)||r.suspended)return;const{renderPass:s}=e;if(s!=="raster-bitmap")return s==="raster"?this._process(e,r):void this._drawBitmap(e,r,!0);this._drawBitmap(e,r)}_process(e,r){const{rasterFunction:s}=e,i=s.name==="Reproject";if(!(i?!(r.rasterTexture&&r.projected):!r.processed))return;const{timeline:a,context:n}=e;a.begin(this.name);const o=n.getBoundFramebufferObject(),l=n.getViewport();i||(r.processedTexture=F(r.processedTexture)),n.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),this._initQuad(n);const[c,d]=r.getRasterTextureSize(i),{isStandardRasterTileSize:u,fbo:m}=this._getRasterFBO(n,c,d);Kr(e,this._quad,m,r),u||m.dispose(),n.bindFramebuffer(o),n.setViewport(l.x,l.y,l.width,l.height),a.end(this.name)}_drawBitmap(e,r,s=!1){const{timeline:i,context:a}=e;if(i.begin(this.name),a.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),s&&!r.processedTexture){if(r.updateProcessedTexture(),!r.processedTexture)return void i.end(this.name);r.processed=!0}this._initBitmapCommonUniforms(r);const n=r.symbolizerParameters.type,o=Rt(n),{requestRender:l,allowDelayedRender:c}=e,{defines:d,program:u}=o.createProgram(e,r,r.projected&&s);if(c&&l!=null&&!u.compiled)return void l();a.useProgram(u);const m=this._getUniformInfos(n,a,u,d);this._quad||(this._quad=new K(a,[0,0,1,0,0,1,1,1])),o.bindTextureAndUniforms(e,u,r,m,s),this._quad.draw(),i.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const r=$e(1,[0,0]),{transformGrid:s,width:i,height:a}=e,n=je(s,[i,a],[e.source.width,e.source.height],1,!1);e.commonUniforms={...r,...n,u_coordScale:e.coordScale}}}_getRasterFBO(e,r,s){const i=r===C&&s===C;return i?(this._fbo||(this._fbo=this._createNewFBO(e,r,s)),{isStandardRasterTileSize:i,fbo:this._fbo}):{isStandardRasterTileSize:i,fbo:this._createNewFBO(e,r,s)}}_createNewFBO(e,r,s){const i=de(r,s);return new Je(e,i)}_initQuad(e){this._quad||(this._quad=new K(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,r,s,i){const a=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(a))return this._rendererUniformInfos.get(a);const n=qe(r,s);return this._rendererUniformInfos.set(a,n),n}}class es extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.bitmap=null,this.bitmap=new mt(o,null,null),this.bitmap.coordScale=[a,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}let ts=class extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(t){const e=this._getTileBounds(t),[r,s]=this.tileInfoView.tileInfo.size,i=this.tileInfoView.getTileResolution(t.level);return new es(t,i,e[0],e[3],r,s)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"imagery (tile)",brushes:[Xr],target:()=>this.children.map(r=>r.bitmap),drawPhase:k.MAP});return[...super.prepareRenderPasses(t),e]}doRender(t){if(!this.visible||t.drawPhase!==k.MAP)return;const{rasterFunctionChain:e}=this;if(!e)return t.renderPass="raster-bitmap",void super.doRender(t);if(!e.hasFocalFunction){const[r,s]=this.tileInfoView.tileInfo.size;t.renderPass="raster",t.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,s],requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(t)}if(e?.functions.length){const{functions:r,hasBranches:s}=e;for(let i=0;i{const e=this._rasterFunctionState;if(t.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const r=this._rasterFunctionState,{type:s}=this;return t.refetch||s!=="raster"&&t.reprocess||r==="cpu"||e==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(t.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(t){this._set("useWebGLForProcessing",t)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(t){if(this._tileStrategy&&this.useProgressiveUpdate!==t){this._tileStrategy.destroy(),this.container.removeAllChildren();const e=this._getCacheSize(t);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:e,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",t),this.layerView.requestUpdate()}}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume();const{extent:e,resolution:r,scale:s}=t.state,i=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const a=this._srcResolutions[i.level],n=e.toJSON?e:be.fromJSON(e);ee(this._blockCacheRegistryUrl,this._blockCacheRegistryId,n,r,a,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==i.level&&(this.previousLOD=i,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(t),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const t=lt();this._maxIndexedColormapSize=4*(t.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new at(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new nt({tileInfoView:this._tileInfoView,concurrency:e,process:(s,i)=>this._fetchTile(s,i),priority:ot.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const r=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),cacheSize:r,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(t){const e=this.container.createTile(t);return this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,e}releaseTile(t){this._fetchQueue.abort(t.key.id),this.container.removeChild(t),t.once("detach",()=>{t.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(t=null){const e=t==null||t.join(",")===this._tileInfoView.tileInfo.size.join(",");if(e&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;t=t||this._tileInfoView.tileInfo.size;const[r,s]=t,i=new Ke({width:r,height:s,pixels:[new Uint8Array(r*s)],mask:new Uint8Array(r*s),pixelType:"u8"});return e&&(this._emptyTilePixelBlock=i),i}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:t,raster:e}=this.layer,r="rasterFunction"in e?e.rasterFunction.rawInputBandIds:null;return t?.length&&r?.length&&e.rasterInfo.bandCount!==1?t.map(s=>r[Math.min(s,r.length-1)]):t||r}updateRasterFunctionParameters(){}_fetchTile(t,e){const r=this._getFetchOptions(t.level,e.signal);return this.fetchTile(t,r)}_getFetchOptions(t,e){const r=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:i}=s,a=!i.isWrappable&&rt(s.view.spatialReference)!=null,n=r&&this.layer.raster.hasUniqueSourceStorageInfo;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:r?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:n,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:e,srcResolution:this._srcResolutions[t],timeExtent:s.timeExtent,tileInfo:i,disableWrapAround:a}}_getCacheSize(t){return t?40:0}_initializeTileInfo(){const{layerView:t}=this,e=t.view.spatialReference;if(this._canUseLayerLODs()){const{origin:c,lods:d}=this.layer.tileInfo,u=d.map(({scale:f})=>f),m=X.create({spatialReference:e,size:C,scales:u,origin:c});return t.set("tileInfo",m),void(this._srcResolutions=d.map(({resolution:f})=>({x:f,y:f})))}const{scales:r,srcResolutions:s,isCustomTilingScheme:i}=st(this.layer.serviceRasterInfo,e,{tileSize:C,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),a=X.create({spatialReference:e,size:C,scales:r}),n=a.origin.x===0;we(t.fullExtent);const{xmin:o,ymax:l}=t.fullExtent;(n||i&&a.origin.x>o)&&(a.origin=new ve({x:o,y:l,spatialReference:e})),this._isCustomTilingScheme=i,t.set("tileInfo",a),this._srcResolutions=s??[]}_canUseLayerLODs(){const{layer:t,layerView:e}=this;if(t.raster.tileType!=="Map")return!1;const{lods:r}=t.tileInfo,s=e.view.constraints?.effectiveLODs;return s?.length===r.length&&s.every(({scale:i},a)=>Math.abs(i-r[a].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:t}=this.layer.serviceRasterInfo.storageInfo,e=t[t.length-1];return(e.maxCol-e.minCol+1)*(e.maxRow-e.minRow+1)>64?2:10}async _enqueueTileFetch(t,e){if(!this._fetchQueue.has(t.key.id)){try{const r=await this._fetchQueue.push(t.key),s=this._getBandIds();let i=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){i=!1;try{await this._redrawImage(this._abortController?.signal)}catch(o){R(o)&&I.getLogger(this).error(o)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const a=this._tileInfoView.getTileCoords(rs,t.key),n=this._tileInfoView.getTileResolution(t.key);await this.updateTileSource(t,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:i,bandIds:s,coords:a,resolution:n}),t.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(t)}catch(r){R(r)||I.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(t){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(t):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const e=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(e),this.container.requestRender()}async _updateGlobalSymbolizerParams(t){const e=this._getFetchOptions(this.previousLOD.level,t),r=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,{...e,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:s}=this.previousLOD,i=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(i),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:i});!this.canUseWebGLForProcessing()&&a&&a.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(a.factor=a.factor.map(n=>255*n),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:t}=this.previousLOD,e=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:e})}_updateBlockCacheRegistry(t=!1){const{layer:e,layerView:r}=this,{raster:s}=e,{multidimensionalDefinition:i}=e.normalizeRasterFetchOptions({multidimensionalDefinition:e.multidimensionalDefinition,timeExtent:r.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(i):null,n=et(s.rasterId,a);if(n!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=tt(n,s.rasterInfo),t){const{view:o}=r,l=this._tileInfoView.getClosestInfoForScale(o.scale),c=this._srcResolutions[l.level];ee(n,this._blockCacheRegistryId,o.extent,o.resolution,c,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const t=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(e=>t.push(this._enqueueTileFetch(e))),await this._updatingHandles.addPromise(Promise.allSettled(t))}};h([p()],b.prototype,"_globalUpdateRequested",void 0),h([p()],b.prototype,"attached",void 0),h([p()],b.prototype,"container",void 0),h([p()],b.prototype,"layer",void 0),h([p()],b.prototype,"layerView",void 0),h([p()],b.prototype,"scheduler",void 0),h([p()],b.prototype,"type",void 0),h([p()],b.prototype,"useWebGLForProcessing",null),h([p()],b.prototype,"useProgressiveUpdate",null),h([p()],b.prototype,"timeExtent",void 0),h([p()],b.prototype,"updating",null),b=h([M("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],b);let P=class extends b{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new ts(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){const{symbolizer:t}=this.layer,e=t.lookup?.colormapLut?.indexedColormap,r=e&&e.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&t.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&oe(this.layer))}fetchTile(t,e){return this.layer.fetchTile(t.level,t.row,t.col,e)}updateRasterFunctionParameters(){const{clips:t,view:e}=this.layerView;this._geometry!=null&&t.remove(this._geometry);const{raster:r,type:s}=this.layer;if(r.datasetFormat==="Function"){const f=r.getClippingGeometry(e.spatialReference);if(f){const _=new Fe({geometry:f});t.add(_),this._geometry=_}}const{container:i}=this;if(r.datasetFormat!=="Function"||s==="wcs")return i.rasterFunctionChain=null,i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=!0,_.processed=!1,_.projected&&(_.invalidateTexture(),_.rasterTexture=null))}),void(this._rasterFunctionState="na");const a=this._rasterFunctionState,{rasterFunction:n,primaryRasters:o}=r,l=n.supportsGPU&&(!o||o.rasters.length<=1),c=l?n.flatWebGLFunctionChain:null,{renderer:d}=this.layer,u=!l||!c?.functions.length||d?.type==="raster-stretch"&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();i.rasterFunctionChain=u?null:c;const m=n==null?"na":i.rasterFunctionChain?"gpu":"cpu";i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=a!==m,_.processed=!1,_.processedTexture=null)}),this._rasterFunctionState=m}async updateTileSource(t,e){const r=this._getBandIds(),s=this._getLayerInterpolation(),i=this.canUseWebGLForProcessing(),{source:a,globalSymbolizerParams:n,suspended:o,coords:l,resolution:c}=e,d=this.layerView.hasTilingEffects?n:e.symbolizerParams,{bitmap:u}=t;if([u.x,u.y]=l,u.resolution=c,a?.pixelBlock!=null){const m={extent:a.extent,pixelBlock:a.pixelBlock,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=m,i)u.source=a.pixelBlock,u.isRendereredSource=!1;else{const f=await this.layer.applyRenderer(m,n?.type==="stretch"?n:void 0);u.source=f,u.isRendereredSource=!0}u.symbolizerParameters=i?d:null,u.transformGrid=i?a.transformGrid:null}else{const m=this.createEmptyTilePixelBlock();u.source=m,u.symbolizerParameters=i?d:null,u.transformGrid=null}u.bandIds=i?r:null,u.width=this._tileInfoView.tileInfo.size[0],u.height=this._tileInfoView.tileInfo.size[1],u.interpolation=s,u.suspended=o,u.invalidateTexture()}async updateTileSymbolizerParameters(t,e){const{local:r,global:s}=e,i=this._getBandIds(),a=this._getLayerInterpolation(),n=this.canUseWebGLForProcessing(),{bitmap:o}=t,{rawPixelData:l}=o;n||l==null?(o.isRendereredSource&&l!=null&&(o.source=l.pixelBlock),o.isRendereredSource=!1):(o.source=await this.layer.applyRenderer(l,s?.type==="stretch"?s:void 0),o.isRendereredSource=!0),o.symbolizerParameters=n?this.layerView.hasTilingEffects?s:r:null,o.bandIds=n?i:null,o.interpolation=a,o.suspended=!1}_getLayerInterpolation(){const{interpolation:t,renderer:e}=this.layer;if(!e)return t;const r=e.type;return r==="raster-colormap"||r==="unique-value"?"nearest":e.type==="raster-stretch"&&e.colorRamp!=null?t==="bilinear"||t==="cubic"?"bilinear":"nearest":t}};h([p()],P.prototype,"container",void 0),h([p()],P.prototype,"layer",void 0),h([p()],P.prototype,"type",void 0),P=h([M("esri.views.2d.layers.imagery.ImageryTileView2D")],P);const ss=P;class is extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.tileData=new Re(o),this.tileData.coordScale=[a,n],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}setTransform(e){super.setTransform(e);const r=this.resolution/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[i,a]=this.tileData.offset,n=[this.x+i*this.resolution,this.y-a*this.resolution],[o,l]=e.toScreenNoRotation([0,0],n),{symbolTileSize:c}=this.tileData.symbolizerParameters,d=Math.round((this.width-this.tileData.offset[0])/c)*c,u=Math.round((this.height-this.tileData.offset[1])/c)*c,m=d/this.rangeX*r,f=u/this.rangeY*r;Me(s,m,0,0,0,f,0,o,l,1),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,s),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class as extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const r=this.tileInfoView.getTileBounds(ne(),e),[s,i]=this.tileInfoView.tileInfo.size,a=this.tileInfoView.getTileResolution(e.level);return new is(e,a,r[0],r[3],s,i)}prepareRenderPasses(e){const r=e.registerRenderPass({name:"imagery (vf tile)",brushes:[Ue],target:()=>this.children.map(s=>s.tileData),drawPhase:k.MAP});return[...super.prepareRenderPasses(e),r]}doRender(e){this.visible&&e.drawPhase===k.MAP&&this.symbolTypes.forEach(r=>{e.renderPass=r,super.doRender(e)})}}let S=class extends b{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(t,e){e={...e,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(t.level,t.row,t.col,e);return this.layer.serviceRasterInfo?.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,e)),r}updateTileSource(t,e){const r=e.symbolizerParams,{tileData:s}=t;s.key=t.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:i}=r,{source:a}=e;if(s.offset=this._getTileSymbolOffset(s.key,i),a?.pixelBlock!=null){const n={extent:a.extent,pixelBlock:a.pixelBlock};s.rawPixelData=n,s.symbolizerParameters=r,s.source=this._sampleVectorFieldData(a.pixelBlock,r,s.offset)}else{const n=[Math.round((this._tileInfoView.tileInfo.size[0]-s.offset[0])/i),Math.round((this._tileInfoView.tileInfo.size[1]-s.offset[1])/i)],o=this.createEmptyTilePixelBlock(n);s.source=o,s.symbolizerParameters=r}return s.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(t,e){const r=e.local,{symbolTileSize:s}=r,{tileData:i}=t;i.offset=this._getTileSymbolOffset(i.key,s);const a=i.symbolizerParameters.symbolTileSize;i.symbolizerParameters=r;const n=i.rawPixelData?.pixelBlock;return n!=null&&a!==s&&(i.source=this._sampleVectorFieldData(n,i.symbolizerParameters,i.offset)),Promise.resolve()}attach(){super.attach(),this.container=new as(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=L(()=>this.layer.renderer,t=>this._updateSymbolType(t))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(t,e){const r=t.col*this._tileInfoView.tileInfo.size[0]%e,s=t.row*this._tileInfoView.tileInfo.size[1]%e;return[r>e/2?e-r:-r,s>e/2?e-s:-s]}_sampleVectorFieldData(t,e,r){const{symbolTileSize:s}=e;return Xe(t,"vector-uv",s,r)}_updateSymbolType(t){t.type==="vector-field"&&(this.container.symbolTypes=t.style==="wind-barb"?["scalar","triangle"]:t.style==="simple-scalar"?["scalar"]:["triangle"])}};h([p()],S.prototype,"container",void 0),h([p()],S.prototype,"layer",void 0),h([p()],S.prototype,"type",void 0),S=h([M("esri.views.2d.layers.imagery.VectorFieldTileView2D")],S);const ns=S,os=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return ut(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?it(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(r){try{return!this.layer.loaded||!!re(this.layer.serviceRasterInfo,r)}catch{return!1}}async fetchPopupFeaturesAtLocation(r,s){const{layer:i}=this;if(!r)throw new Te("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:a}=i,n=ct(i,s);if(!a||n==null)return[];const o=[],{value:l,magdirValue:c,processedValue:d}=await i.identify(r,{timeExtent:this.timeExtent,signal:s?.signal});let u="";if(l?.length){u=i.type==="imagery-tile"&&i.hasStandardTime()&&l[0]!=null?l.map(D=>i.getStandardTimeValue(D)).join(", "):l.join(", ");const m={ObjectId:0},f="Raster.ServicePixelValue";m[f]=i.type==="imagery-tile"&&i.raster.datasetFormat==="Function"?d?.join(", "):u,m[f+".Raw"]=u;const _=i.raster?.rasterInfo??i.serviceRasterInfo,$=_?.attributeTable;if($!=null){const{fields:D,features:pe}=$,H=D.find(({name:v})=>v.toLowerCase()==="value"),fe=m[f],V=H?pe.find(v=>String(v.attributes[H.name])===fe):null;if(V)for(const v in V.attributes)V.attributes.hasOwnProperty(v)&&(m[this._rasterFieldPrefix+v]=V.attributes[v])}const Q=_?.dataType;Q!=="vector-magdir"&&Q!=="vector-uv"||(m["Raster.Magnitude"]=c?.[0],m["Raster.Direction"]=c?.[1]);const me=new Pe({geometry:this.fullExtent?.clone(),attributes:m,layer:i,sourceLayer:i});o.push(me)}return o}_getFullExtent(){return re(this.layer.serviceRasterInfo,this.view.spatialReference)}};return h([p()],e.prototype,"fullExtent",null),h([p()],e.prototype,"layer",void 0),h([p({readOnly:!0})],e.prototype,"timeExtent",null),h([p()],e.prototype,"tileInfo",void 0),h([p({readOnly:!0})],e.prototype,"hasTilingEffects",null),h([p()],e.prototype,"datumTransformation",null),e=h([M("esri.views.layers.ImageryTileLayerView")],e),e};let T=class extends os(ht(Ie(Ce))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(t){this._useWebGLForProcessing=t,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=t)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(t){this._useProgressiveUpdate=t,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=t)}get displayParameters(){const{layer:t}=this,e=this._get("displayParameters");return t.renderer?{bandIds:t.bandIds,renderer:t.renderer,interpolation:t.interpolation,multidimensionalDefinition:t.multidimensionalDefinition,rasterFunction:t.type==="imagery-tile"?t.rasterFunction:null}:e}update(t){this.subview?.update(t),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([L(()=>this.displayParameters,(t,e)=>{const r=t.interpolation!==e?.interpolation&&(t.interpolation==="majority"||e?.interpolation==="majority")&&oe(this.layer),s=t.renderer!==e?.renderer&&this._getSubviewType(e?.renderer)!==this._getSubviewType(t.renderer);s&&this._updateSubview();const i=t.multidimensionalDefinition!==e?.multidimensionalDefinition,a=t.rasterFunction!==e?.rasterFunction,n=a&&!this._useWebGLForProcessing,o=i||r||s||n;this.subview.redrawOrRefetch({refetch:o,reprocess:a}).catch(l=>{R(l)||I.getLogger(this).error(l)}),this.notifyChange("updating")}),L(()=>this.layer.multidimensionalSubset??null,(t,e)=>{const{multidimensionalDefinition:r}=this.layer;r!=null&&Z(r,t)!==Z(r,e)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(s=>{R(s)||I.getLogger(this).error(s)}),this.notifyChange("updating"))},ge),L(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(t=>{R(t)||I.getLogger(this).error(t)})},_e)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:t}=this.layer;if(!t)return;const e=this._getSubviewType(t);if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:r}=this;let s;if(s=e==="rasterVF"?new ns({layer:r,layerView:this,scheduler:this.scheduler}):e==="flow"?new Se({layer:r,layerView:this,scheduler:this.scheduler}):new ss({layer:r,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:i}=this;s.previousLOD=i&&"previousLOD"in i?i.previousLOD:null}this._attachSubview(s),this.subview=s,this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_getSubviewType(t){const e=t?.type;return e==="vector-field"?"rasterVF":e==="flow"?"flow":"raster"}};h([p()],T.prototype,"subview",void 0),h([p()],T.prototype,"useWebGLForProcessing",null),h([p()],T.prototype,"useProgressiveUpdate",null),h([p({readOnly:!0})],T.prototype,"displayParameters",null),T=h([M("esri.views.2d.layers.ImageryTileLayerView2D")],T);const ki=T;export{ki as default}; diff --git a/main/assets/ImageryTileLayerView2D-nEz2YhMc-C3hXr143.js b/main/assets/ImageryTileLayerView2D-nEz2YhMc-C3hXr143.js deleted file mode 100644 index 9dce47113..000000000 --- a/main/assets/ImageryTileLayerView2D-nEz2YhMc-C3hXr143.js +++ /dev/null @@ -1 +0,0 @@ -import{v as h,S as p,i as M,ah as L,aU as R,a1 as I,av as ge,aL as _e,j as ye,bp as xe,n as be,O as we,w as ve,bh as ne,o as Te,bi as Pe,hT as F}from"./main-BZaw9FpY.js";import{p as Z}from"./multidimensionalUtils-BwTugeu7-CpzGLouA.js";import{o as Se,l as Ue,c as Re}from"./RasterVFDisplayObject-CnriTVT9-DOIQa1VK.js";import{X as Ie,A as Fe,Y as Ce}from"./LayerView-Bish-E63-DRGspiuk.js";import{t as oe,E as k,m as ze,e as z}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{Q as Me,E as le,R as Ve,C as E,D as Be,H as Ge}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as B}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as Le}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{A as G,L as J,M as A,B as Oe,F as ke,G as De}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{N as U,k as w,w as q,G as Ee,x as Ae,U as j,b as je,V as qe,M as We,L as Ne,F as $e}from"./rasterUtils-DqAu9qES-Bysf-lKe.js";import{s as Y}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{H as Qe,V as He}from"./Texture-BCt2hphT-D-X9O5uh.js";import{t as C}from"./definitions-DJSdSb77-DkoRHaVx.js";import{k as Ze,F as K,K as ue}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{G as Je}from"./Program-DLVwTiPA-DUDrdGpa.js";import{h as ce}from"./TileContainer-D48pXXgL-DNbVOEpu.js";import{i as Ye}from"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import{D as Ke,B as Xe}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{V as X}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{Z as ee,P as te,K as et,O as tt}from"./RawBlockCache-Cj_tmHDm-d1RSObdh.js";import{k as rt,U as st,p as it,r as re}from"./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js";import{a as se,Q as at,$ as nt}from"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import{i as ot}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import{n as lt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{T as ut}from"./timeSupport-ohWmWReZ-CwKm-94j.js";import{m as ct}from"./popupUtils-nV1O8RUO-xbvi-u4x.js";import{n as ht}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";const dt={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class mt extends Le{constructor(e=null,r=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=r,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(F(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||dt}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdsChanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?A.LINEAR:A.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=F(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){const r=e||this.projected;return[r?this.width:this.source?.width||this.width,r?this.height:this.source?.height||this.height]}getRasterCellSize(){const e=this.rawPixelData?.srcPixelSize,{projected:r,resolution:s}=this;return e&&!r?[e.x,e.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:z()}}setTransform(e){const r=Ve(this.transforms.displayViewScreenMat3),[s,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),a=this.resolution/this.pixelRatio/e.resolution,n=a*this.width,o=a*this.height,l=Math.PI*this.rotation/180;E(r,r,B(s,i)),E(r,r,B(n/2,o/2)),Be(r,r,-l),E(r,r,B(-n/2,-o/2)),Ge(r,r,B(n,o)),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,r)}getTextures({forProcessing:e=!1,useProcessedTexture:r=!1}={}){const s=r?this._processedTexture??this._rasterTexture:this._rasterTexture,i=[],a=[];return s?(this._transformGridTexture&&!this.projected&&(a.push(this._transformGridTexture),i.push("u_transformGrid")),r?(a.push(s),i.push("u_image"),this._colormapTexture&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a}):(a.push(s),i.push("u_image"),this._colormapTexture&&!e&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a})):{names:i,textures:a}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const r=this._isValidSource(this.source);r&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(r?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=We(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(r=>r?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const r=this.source?.extractBands(this.bandIds);if(!this._isValidSource(r))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=Ne(e,r,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const r=this._rasterTextureBandIds;return!(r==null&&e==null||r&&e&&r.join("")===e.join(""))}_isValidSource(e){return e!=null&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:r}=this.symbolizerParameters,s=r==="lut"&&!this.symbolizerParameters.isClassBreaks||r==="hillshade"||r==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||s||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,s=this.symbolizerParameters.colormap;return s?r?s.length!==r.length||s.some((i,a)=>i!==r[a])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=j(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=j(e,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}function pt(t){return t.source!=null}function W(t){const e=[];return t&&(e.push("applyProjection"),t.spacing[0]===1&&e.push("lookupProjection")),e}function he(t,e,r){const s=!r.capabilities.textureFloatLinear,i=[];return t==="cubic"?i.push("bicubic"):t==="bilinear"&&(e?(i.push("bilinear"),i.push("nnedge")):s&&i.push("bilinear")),i}const ft={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function gt(t,e,r){const s=r?[]:W(e.transformGrid);return{defines:s,program:t.painter.materialManager.getProgram(ft,s)}}function _t(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const{colormap:o,colormapOffset:l}=r.symbolizerParameters,c=q(o,l);w(e,s,c)}const yt={createProgram:gt,bindTextureAndUniforms:_t},xt={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function bt(t,e,r){const{colormap:s}=e.symbolizerParameters,i=[...r?[]:W(e.transformGrid),...he(e.interpolation,!0,t.context)];return s!=null&&i.push("applyColormap"),{defines:i,program:t.painter.materialManager.getProgram(xt,i)}}function wt(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ee(o);w(e,s,{...d,u_scaling:1})}const vt={createProgram:bt,bindTextureAndUniforms:wt},Tt={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pt(t,e,r){const{colormap:s,bandCount:i}=e.symbolizerParameters,a=[...r?[]:W(e.transformGrid),...he(e.interpolation,i===1,t.context)];return e.isRendereredSource&&!r?a.push("noop"):s!=null&&a.push("applyColormap"),{defines:a,program:t.painter.materialManager.getProgram(Tt,a)}}function St(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ae(o);w(e,s,d)}const Ut={createProgram:Pt,bindTextureAndUniforms:St},O=new Map;function Rt(t){return O.get(t)}O.set("lut",yt),O.set("hillshade",vt),O.set("stretch",Ut);const It=[1,1],Ft=[2,0,0,0,2,0,-1,-1,0];function x(t,e,r,s){const{context:i,rasterFunction:a,hasBranches:n}=t,{raster:o}=a.parameters,l=n?o?.id??-1:0,c=[r.functionTextures[l]??r.rasterTexture],d=["u_image"];if(s){const u=j(i,s);r.functionTextures[100]=u,c.push(u),d.push("u_colormap")}U(i,e,d,c)}function N(t,e,r){const{rasters:s}=t.rasterFunction.parameters;if(!s)return;if(s.length<2)return x(t,e,r);const i=s.filter(a=>a.name!=="Constant").map(a=>a.id!=null&&a.name!=="Identity"?r.functionTextures[a.id]:r.rasterTexture);if(U(t.context,e,["u_image","u_image1","u_image2"].slice(0,i.length),i),i.length!==s.length){if(s.length===2){const a=s.findIndex(l=>l.name==="Constant"),n=a===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:o}=s[a].parameters;e.setUniform1f("u_image1Const",o),e.setUniformMatrix3fv("u_imageSwap",n)}else if(s.length===3){const a=[];if(s.forEach((n,o)=>n.name==="Constant"&&a.push(o)),a.length===1){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const o=a[0]===0?[0,1,0,0,0,1,1,0,0]:a[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",o)}else if(a.length===2){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const{value:o}=s[a[1]].parameters;e.setUniform1f("u_image2Const",o);const l=s.findIndex(d=>d.name!=="Constant"),c=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",c)}}}}function y(t){t.setUniform2fv("u_coordScale",It),t.setUniformMatrix3fv("u_dvsMat3",Ft)}const Ct={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zt(t,e){return t.painter.materialManager.getProgram(Ct,[])}function Mt(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i)}const Vt={createProgram:zt,bindTextureAndUniforms:Mt},Bt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gt(t,e){const{painter:r,rasterFunction:s}=t,{indexType:i,isOutputRounded:a}=s.parameters,n=[i];return a&&n.push("roundOutput"),r.materialManager.getProgram(Bt,n)}function Lt(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s,adjustments:i}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s),e.setUniform1fv("u_adjustments",i)}const Ot={createProgram:Gt,bindTextureAndUniforms:Lt},kt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/colormap2rgb",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dt(t){const{painter:e}=t;return e.materialManager.getProgram(kt,[])}function Et(t,e,r){const{indexedColormap:s,offset:i}=t.rasterFunction.parameters;x(t,e,r,s),y(e),e.setUniform1f("u_colormapOffset",i),e.setUniform1f("u_colormapMaxIndex",s.length/4-1)}const At={createProgram:Dt,bindTextureAndUniforms:Et},jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qt(t,e){const r=t.rasterFunction.parameters.rasters.filter(i=>i.name==="Constant"),s=[];return r.length&&(s.push("oneConstant"),r.length===2&&s.push("twoConstant")),t.painter.materialManager.getProgram(jt,s)}function Wt(t,e,r){N(t,e,r),y(e)}const Nt={createProgram:qt,bindTextureAndUniforms:Wt},$t={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/computechange",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qt(t){const{painter:e,rasterFunction:r}=t,{method:s,rasters:i,isOutputRounded:a}=r.parameters,n=[s.includes("-")?s.slice(0,s.indexOf("-")):s];return i.filter(o=>o.name==="Constant").length&&n.push("oneConstant"),a&&n.push("roundOutput"),e.materialManager.getProgram($t,n)}function Ht(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const Zt={createProgram:Qt,bindTextureAndUniforms:Ht},Jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Yt(t,e){return t.painter.materialManager.getProgram(Jt,[])}function Kt(t,e,r){x(t,e,r),y(e);const{contrastOffset:s,brightnessOffset:i}=t.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",s),e.setUniform1f("u_brightnessOffset",i)}const Xt={createProgram:Yt,bindTextureAndUniforms:Kt},er={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function tr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a}=s.parameters,n=[{name:"rows",value:i},{name:"cols",value:a}];return r.materialManager.getProgram(er,n)}function rr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{kernel:s,clampRange:i}=t.rasterFunction.parameters;e.setUniform1fv("u_kernel",s),e.setUniform2fv("u_clampRange",i)}const sr={createProgram:tr,bindTextureAndUniforms:rr},ir={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ar(t,e){const{painter:r,rasterFunction:s}=t,{curvatureType:i}=s.parameters,a=[i];return r.materialManager.getProgram(ir,a)}function nr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const{zFactor:i}=t.rasterFunction.parameters,a=r.getRasterCellSize();e.setUniform1f("u_zlFactor",200*i/a[0]/a[1])}const or={createProgram:ar,bindTextureAndUniforms:nr},lr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ur(t,e){return t.painter.materialManager.getProgram(lr,[])}function cr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const hr={createProgram:ur,bindTextureAndUniforms:cr},dr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function mr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a,fillNoDataOnly:n,statisticsType:o}=s.parameters,l=[{name:"rows",value:i},{name:"cols",value:a},o];return n&&l.push("fill"),r.materialManager.getProgram(dr,l)}function pr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{clampRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_clampRange",s)}const fr={createProgram:mr,bindTextureAndUniforms:pr},gr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _r(t,e){return t.painter.materialManager.getProgram(gr,[])}function yr(t,e,r){x(t,e,r),y(e);const{weights:s}=t.rasterFunction.parameters;e.setUniform3fv("u_weights",s)}const xr={createProgram:_r,bindTextureAndUniforms:yr},br={vsPath:"raster/rfx/vs",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function wr(t,e){const{indexedColormap:r}=t.rasterFunction.parameters,s=[];return r?.length&&s.push("applyColormap"),t.painter.materialManager.getProgram(br,s)}function vr(t,e,r){const s=t.rasterFunction.parameters,{indexedColormap:i}=s;x(t,e,r,i),y(e);const a=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",a);const n=r.getRasterCellSize();e.setUniform2fv("u_cellSize",n);const{pixelSizeFactor:o}=s;if(o===0)e.setUniform2fv("u_factor",[s.factor[0]/n[0],s.factor[1]/n[1]]);else{const{zFactor:l,pixelSizePower:c,gcsFactor:d}=s,u=n[0]*d,m=n[1]*d,f=(l+u**c*o)/(8*u),_=(l+m**c*o)/(8*m);e.setUniform2fv("u_factor",[f,_])}e.setUniform1i("u_hillshadeType",s.hillshadeType),e.setUniform1fv("u_sinZcosAs",s.sinZcosAs),e.setUniform1fv("u_sinZsinAs",s.sinZsinAs),e.setUniform1fv("u_cosZs",s.cosZs),e.setUniform1fv("u_weights",s.weights),e.setUniform1f("u_opacity",1),e.setUniform1i("u_flipY",0),e.setUniform1f("u_scaling",255),e.setUniform1f("u_minValue",s.minValue),e.setUniform1f("u_maxValue",s.maxValue),i&&(e.setUniform1f("u_colormapOffset",s.offset),e.setUniform1f("u_colormapMaxIndex",i.length/4-1))}const ie={createProgram:wr,bindTextureAndUniforms:vr},Tr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pr(t){const{painter:e,rasterFunction:r}=t,{imageCount:s,operationName:i,rasters:a,isOutputRounded:n}=r.parameters,o=[i.toLowerCase()];s===2&&o.push("twoImages");const l=a.filter(c=>c.name==="Constant");return l.length&&(o.push("oneConstant"),l.length===2&&o.push("twoConstant")),n&&o.push("roundOutput"),e.materialManager.getProgram(Tr,o)}function Sr(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const ae={createProgram:Pr,bindTextureAndUniforms:Sr},Ur={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Rr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.bandCount>1?["multiBand"]:[];return r.materialManager.getProgram(Ur,i)}function Ir(t,e,r){x(t,e,r),y(e);const{includedRanges:s,noDataValues:i}=t.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",s),e.setUniform1fv("u_noDataValues",i)}const Fr={createProgram:Rr,bindTextureAndUniforms:Ir},Cr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.scaled?["scaled"]:[];return r.materialManager.getProgram(Cr,i)}function Mr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const Vr={createProgram:zr,bindTextureAndUniforms:Mr},Br={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gr(t,e){return t.painter.materialManager.getProgram(Br,[])}function Lr(t,e,r){x(t,e,r),y(e);const{noDataRanges:s,rangeMaps:i,allowUnmatched:a,clampRange:n}=t.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",s),e.setUniform1fv("u_rangeMaps",i),e.setUniform1f("u_unmatchMask",a?1:0),e.setUniform2fv("u_clampRange",n)}const Or={createProgram:Gr,bindTextureAndUniforms:Lr},kr={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dr(t,e){const{painter:r}=t,s=[],{interpolation:i,transformGrid:a}=e,n=t.rasterFunction?.parameters;return i==="cubic"?s.push("bicubic"):i==="bilinear"&&(s.push("bilinear"),n?.requireNNEdge&&s.push("nnedge")),a&&(s.push("applyProjection"),a.spacing[0]===1&&s.push("lookupProjection")),r.materialManager.getProgram(kr,s)}function Er(t,e,r){const{names:s,textures:i}=r.getTextures({forProcessing:!0});U(t.context,e,s,i),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:a,height:n,source:o,transformGrid:l}=r;e.setUniform2fv("u_srcImageSize",[o.width,o.height]),e.setUniform2fv("u_targetImageSize",[a,n]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Y),e.setUniform2fv("u_transformGridSize",l?l.size:Y)}const Ar={createProgram:Dr,bindTextureAndUniforms:Er},jr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qr(t,e){const{painter:r,rasterFunction:s}=t,{slopeType:i,isOutputRounded:a}=s.parameters,n=[];return i==="percent-rise"&&n.push("percentRise"),a&&n.push("roundOutput"),r.materialManager.getProgram(jr,n)}function Wr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i);const{zFactor:a,slopeType:n,pixelSizePower:o,pixelSizeFactor:l}=t.rasterFunction.parameters;e.setUniform1f("u_zFactor",a),e.setUniform1f("u_pixelSizePower",n==="adjusted"?o:0),e.setUniform1f("u_pixelSizeFactor",n==="adjusted"?l:0)}const Nr={createProgram:qr,bindTextureAndUniforms:Wr},$r={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qr(t,e){const{useGamma:r,bandCount:s,isOutputRounded:i}=t.rasterFunction.parameters,a=[];return r&&a.push("useGamma"),s>1&&a.push("multiBand"),i&&a.push("roundOutput"),t.painter.materialManager.getProgram($r,a)}function Hr(t,e,r){x(t,e,r),y(e);const{width:s,height:i}=r,a=t.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[s,i]),e.setUniform1f("u_minOutput",a.outMin),e.setUniform1f("u_maxOutput",a.outMax),e.setUniform1fv("u_factor",a.factor),e.setUniform1fv("u_minCutOff",a.minCutOff),e.setUniform1fv("u_maxCutOff",a.maxCutOff),e.setUniform1fv("u_gamma",a.gamma),e.setUniform1fv("u_gammaCorrection",a.gammaCorrection)}const Zr={createProgram:Qr,bindTextureAndUniforms:Hr},g=new Map;function de(t,e){const r=new Qe;return r.width=t,r.height=e,r.internalFormat=Oe.RGBA32F,r.samplingMode=A.NEAREST,r.dataType=ke.FLOAT,r.isImmutable=!0,r.wrapMode=De.CLAMP_TO_EDGE,r}function Jr(t,e,r,s){const{context:i,requestRender:a,allowDelayedRender:n}=t,o=s.createProgram(t,r);return n&&a!=null&&!o.compiled?(a(),null):(i.bindFramebuffer(e),i.setViewport(0,0,e.width,e.height),i.useProgram(o),o)}function Yr(t){return g.get(t.toLowerCase())}function Kr(t,e,r,s){const i=t.rasterFunction.name.toLowerCase(),a=i==="reproject"?Ar:Yr(i);if(a==null)return;const n=Jr(t,r,s,a);if(!n)return;a.bindTextureAndUniforms(t,n,s);const{interpolation:o}=s;i==="reproject"&&(s.interpolation="nearest"),e.draw();const[l,c]=s.getRasterTextureSize(i==="reproject"),d=de(l,c),u=new He(t.context,d);if(r.copyToTexture(0,0,l,c,0,0,u),i==="reproject")s.rasterTexture=u,s.projected=!0,s.interpolation=o;else{const m=t.hasBranches?t.rasterFunction.id:0;s.functionTextures[m]=u}}g.set("arithmetic",ae),g.set("aspect",Vt),g.set("bandarithmetic",Ot),g.set("colormaptorgb",At),g.set("computechange",Zt),g.set("compositeband",Nt),g.set("convolution",sr),g.set("contrastbrightness",Xt),g.set("curvature",or),g.set("extractband",hr),g.set("statistics",fr),g.set("grayscale",xr),g.set("hillshade",ie),g.set("shadedrelief",ie),g.set("local",ae),g.set("mask",Fr),g.set("ndvi",Vr),g.set("remap",Or),g.set("slope",Nr),g.set("stretch",Zr);class Xr extends Ze{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){F(this._quad),F(this._fbo)}prepareState(e){const{context:r,renderPass:s}=e,i=s==="raster";r.setBlendingEnabled(!i),r.setBlendFunctionSeparate(G.ONE,G.ONE_MINUS_SRC_ALPHA,G.ONE,G.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),r.setStencilWriteMask(0),r.setStencilTestEnabled(!i)}draw(e,r){if(!pt(r)||r.suspended)return;const{renderPass:s}=e;if(s!=="raster-bitmap")return s==="raster"?this._process(e,r):void this._drawBitmap(e,r,!0);this._drawBitmap(e,r)}_process(e,r){const{rasterFunction:s}=e,i=s.name==="Reproject";if(!(i?!(r.rasterTexture&&r.projected):!r.processed))return;const{timeline:a,context:n}=e;a.begin(this.name);const o=n.getBoundFramebufferObject(),l=n.getViewport();i||(r.processedTexture=F(r.processedTexture)),n.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),this._initQuad(n);const[c,d]=r.getRasterTextureSize(i),{isStandardRasterTileSize:u,fbo:m}=this._getRasterFBO(n,c,d);Kr(e,this._quad,m,r),u||m.dispose(),n.bindFramebuffer(o),n.setViewport(l.x,l.y,l.width,l.height),a.end(this.name)}_drawBitmap(e,r,s=!1){const{timeline:i,context:a}=e;if(i.begin(this.name),a.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),s&&!r.processedTexture){if(r.updateProcessedTexture(),!r.processedTexture)return void i.end(this.name);r.processed=!0}this._initBitmapCommonUniforms(r);const n=r.symbolizerParameters.type,o=Rt(n),{requestRender:l,allowDelayedRender:c}=e,{defines:d,program:u}=o.createProgram(e,r,r.projected&&s);if(c&&l!=null&&!u.compiled)return void l();a.useProgram(u);const m=this._getUniformInfos(n,a,u,d);this._quad||(this._quad=new K(a,[0,0,1,0,0,1,1,1])),o.bindTextureAndUniforms(e,u,r,m,s),this._quad.draw(),i.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const r=$e(1,[0,0]),{transformGrid:s,width:i,height:a}=e,n=je(s,[i,a],[e.source.width,e.source.height],1,!1);e.commonUniforms={...r,...n,u_coordScale:e.coordScale}}}_getRasterFBO(e,r,s){const i=r===C&&s===C;return i?(this._fbo||(this._fbo=this._createNewFBO(e,r,s)),{isStandardRasterTileSize:i,fbo:this._fbo}):{isStandardRasterTileSize:i,fbo:this._createNewFBO(e,r,s)}}_createNewFBO(e,r,s){const i=de(r,s);return new Je(e,i)}_initQuad(e){this._quad||(this._quad=new K(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,r,s,i){const a=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(a))return this._rendererUniformInfos.get(a);const n=qe(r,s);return this._rendererUniformInfos.set(a,n),n}}class es extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.bitmap=null,this.bitmap=new mt(o,null,null),this.bitmap.coordScale=[a,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}let ts=class extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(t){const e=this._getTileBounds(t),[r,s]=this.tileInfoView.tileInfo.size,i=this.tileInfoView.getTileResolution(t.level);return new es(t,i,e[0],e[3],r,s)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"imagery (tile)",brushes:[Xr],target:()=>this.children.map(r=>r.bitmap),drawPhase:k.MAP});return[...super.prepareRenderPasses(t),e]}doRender(t){if(!this.visible||t.drawPhase!==k.MAP)return;const{rasterFunctionChain:e}=this;if(!e)return t.renderPass="raster-bitmap",void super.doRender(t);if(!e.hasFocalFunction){const[r,s]=this.tileInfoView.tileInfo.size;t.renderPass="raster",t.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,s],requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(t)}if(e?.functions.length){const{functions:r,hasBranches:s}=e;for(let i=0;i{const e=this._rasterFunctionState;if(t.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const r=this._rasterFunctionState,{type:s}=this;return t.refetch||s!=="raster"&&t.reprocess||r==="cpu"||e==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(t.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(t){this._set("useWebGLForProcessing",t)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(t){if(this._tileStrategy&&this.useProgressiveUpdate!==t){this._tileStrategy.destroy(),this.container.removeAllChildren();const e=this._getCacheSize(t);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:e,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",t),this.layerView.requestUpdate()}}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume();const{extent:e,resolution:r,scale:s}=t.state,i=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const a=this._srcResolutions[i.level],n=e.toJSON?e:be.fromJSON(e);ee(this._blockCacheRegistryUrl,this._blockCacheRegistryId,n,r,a,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==i.level&&(this.previousLOD=i,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(t),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const t=lt();this._maxIndexedColormapSize=4*(t.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new at(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new nt({tileInfoView:this._tileInfoView,concurrency:e,process:(s,i)=>this._fetchTile(s,i),priority:ot.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const r=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),cacheSize:r,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(t){const e=this.container.createTile(t);return this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,e}releaseTile(t){this._fetchQueue.abort(t.key.id),this.container.removeChild(t),t.once("detach",()=>{t.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(t=null){const e=t==null||t.join(",")===this._tileInfoView.tileInfo.size.join(",");if(e&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;t=t||this._tileInfoView.tileInfo.size;const[r,s]=t,i=new Ke({width:r,height:s,pixels:[new Uint8Array(r*s)],mask:new Uint8Array(r*s),pixelType:"u8"});return e&&(this._emptyTilePixelBlock=i),i}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:t,raster:e}=this.layer,r="rasterFunction"in e?e.rasterFunction.rawInputBandIds:null;return t?.length&&r?.length&&e.rasterInfo.bandCount!==1?t.map(s=>r[Math.min(s,r.length-1)]):t||r}updateRasterFunctionParameters(){}_fetchTile(t,e){const r=this._getFetchOptions(t.level,e.signal);return this.fetchTile(t,r)}_getFetchOptions(t,e){const r=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:i}=s,a=!i.isWrappable&&rt(s.view.spatialReference)!=null,n=r&&this.layer.raster.hasUniqueSourceStorageInfo;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:r?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:n,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:e,srcResolution:this._srcResolutions[t],timeExtent:s.timeExtent,tileInfo:i,disableWrapAround:a}}_getCacheSize(t){return t?40:0}_initializeTileInfo(){const{layerView:t}=this,e=t.view.spatialReference;if(this._canUseLayerLODs()){const{origin:c,lods:d}=this.layer.tileInfo,u=d.map(({scale:f})=>f),m=X.create({spatialReference:e,size:C,scales:u,origin:c});return t.set("tileInfo",m),void(this._srcResolutions=d.map(({resolution:f})=>({x:f,y:f})))}const{scales:r,srcResolutions:s,isCustomTilingScheme:i}=st(this.layer.serviceRasterInfo,e,{tileSize:C,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),a=X.create({spatialReference:e,size:C,scales:r}),n=a.origin.x===0;we(t.fullExtent);const{xmin:o,ymax:l}=t.fullExtent;(n||i&&a.origin.x>o)&&(a.origin=new ve({x:o,y:l,spatialReference:e})),this._isCustomTilingScheme=i,t.set("tileInfo",a),this._srcResolutions=s??[]}_canUseLayerLODs(){const{layer:t,layerView:e}=this;if(t.raster.tileType!=="Map")return!1;const{lods:r}=t.tileInfo,s=e.view.constraints?.effectiveLODs;return s?.length===r.length&&s.every(({scale:i},a)=>Math.abs(i-r[a].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:t}=this.layer.serviceRasterInfo.storageInfo,e=t[t.length-1];return(e.maxCol-e.minCol+1)*(e.maxRow-e.minRow+1)>64?2:10}async _enqueueTileFetch(t,e){if(!this._fetchQueue.has(t.key.id)){try{const r=await this._fetchQueue.push(t.key),s=this._getBandIds();let i=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){i=!1;try{await this._redrawImage(this._abortController?.signal)}catch(o){R(o)&&I.getLogger(this).error(o)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const a=this._tileInfoView.getTileCoords(rs,t.key),n=this._tileInfoView.getTileResolution(t.key);await this.updateTileSource(t,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:i,bandIds:s,coords:a,resolution:n}),t.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(t)}catch(r){R(r)||I.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(t){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(t):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const e=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(e),this.container.requestRender()}async _updateGlobalSymbolizerParams(t){const e=this._getFetchOptions(this.previousLOD.level,t),r=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,{...e,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:s}=this.previousLOD,i=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(i),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:i});!this.canUseWebGLForProcessing()&&a&&a.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(a.factor=a.factor.map(n=>255*n),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:t}=this.previousLOD,e=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:e})}_updateBlockCacheRegistry(t=!1){const{layer:e,layerView:r}=this,{raster:s}=e,{multidimensionalDefinition:i}=e.normalizeRasterFetchOptions({multidimensionalDefinition:e.multidimensionalDefinition,timeExtent:r.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(i):null,n=et(s.rasterId,a);if(n!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=tt(n,s.rasterInfo),t){const{view:o}=r,l=this._tileInfoView.getClosestInfoForScale(o.scale),c=this._srcResolutions[l.level];ee(n,this._blockCacheRegistryId,o.extent,o.resolution,c,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const t=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(e=>t.push(this._enqueueTileFetch(e))),await this._updatingHandles.addPromise(Promise.allSettled(t))}};h([p()],b.prototype,"_globalUpdateRequested",void 0),h([p()],b.prototype,"attached",void 0),h([p()],b.prototype,"container",void 0),h([p()],b.prototype,"layer",void 0),h([p()],b.prototype,"layerView",void 0),h([p()],b.prototype,"scheduler",void 0),h([p()],b.prototype,"type",void 0),h([p()],b.prototype,"useWebGLForProcessing",null),h([p()],b.prototype,"useProgressiveUpdate",null),h([p()],b.prototype,"timeExtent",void 0),h([p()],b.prototype,"updating",null),b=h([M("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],b);let P=class extends b{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new ts(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){const{symbolizer:t}=this.layer,e=t.lookup?.colormapLut?.indexedColormap,r=e&&e.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&t.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&oe(this.layer))}fetchTile(t,e){return this.layer.fetchTile(t.level,t.row,t.col,e)}updateRasterFunctionParameters(){const{clips:t,view:e}=this.layerView;this._geometry!=null&&t.remove(this._geometry);const{raster:r,type:s}=this.layer;if(r.datasetFormat==="Function"){const f=r.getClippingGeometry(e.spatialReference);if(f){const _=new Fe({geometry:f});t.add(_),this._geometry=_}}const{container:i}=this;if(r.datasetFormat!=="Function"||s==="wcs")return i.rasterFunctionChain=null,i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=!0,_.processed=!1,_.projected&&(_.invalidateTexture(),_.rasterTexture=null))}),void(this._rasterFunctionState="na");const a=this._rasterFunctionState,{rasterFunction:n,primaryRasters:o}=r,l=n.supportsGPU&&(!o||o.rasters.length<=1),c=l?n.flatWebGLFunctionChain:null,{renderer:d}=this.layer,u=!l||!c?.functions.length||d?.type==="raster-stretch"&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();i.rasterFunctionChain=u?null:c;const m=n==null?"na":i.rasterFunctionChain?"gpu":"cpu";i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=a!==m,_.processed=!1,_.processedTexture=null)}),this._rasterFunctionState=m}async updateTileSource(t,e){const r=this._getBandIds(),s=this._getLayerInterpolation(),i=this.canUseWebGLForProcessing(),{source:a,globalSymbolizerParams:n,suspended:o,coords:l,resolution:c}=e,d=this.layerView.hasTilingEffects?n:e.symbolizerParams,{bitmap:u}=t;if([u.x,u.y]=l,u.resolution=c,a?.pixelBlock!=null){const m={extent:a.extent,pixelBlock:a.pixelBlock,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=m,i)u.source=a.pixelBlock,u.isRendereredSource=!1;else{const f=await this.layer.applyRenderer(m,n?.type==="stretch"?n:void 0);u.source=f,u.isRendereredSource=!0}u.symbolizerParameters=i?d:null,u.transformGrid=i?a.transformGrid:null}else{const m=this.createEmptyTilePixelBlock();u.source=m,u.symbolizerParameters=i?d:null,u.transformGrid=null}u.bandIds=i?r:null,u.width=this._tileInfoView.tileInfo.size[0],u.height=this._tileInfoView.tileInfo.size[1],u.interpolation=s,u.suspended=o,u.invalidateTexture()}async updateTileSymbolizerParameters(t,e){const{local:r,global:s}=e,i=this._getBandIds(),a=this._getLayerInterpolation(),n=this.canUseWebGLForProcessing(),{bitmap:o}=t,{rawPixelData:l}=o;n||l==null?(o.isRendereredSource&&l!=null&&(o.source=l.pixelBlock),o.isRendereredSource=!1):(o.source=await this.layer.applyRenderer(l,s?.type==="stretch"?s:void 0),o.isRendereredSource=!0),o.symbolizerParameters=n?this.layerView.hasTilingEffects?s:r:null,o.bandIds=n?i:null,o.interpolation=a,o.suspended=!1}_getLayerInterpolation(){const{interpolation:t,renderer:e}=this.layer;if(!e)return t;const r=e.type;return r==="raster-colormap"||r==="unique-value"?"nearest":e.type==="raster-stretch"&&e.colorRamp!=null?t==="bilinear"||t==="cubic"?"bilinear":"nearest":t}};h([p()],P.prototype,"container",void 0),h([p()],P.prototype,"layer",void 0),h([p()],P.prototype,"type",void 0),P=h([M("esri.views.2d.layers.imagery.ImageryTileView2D")],P);const ss=P;class is extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.tileData=new Re(o),this.tileData.coordScale=[a,n],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}setTransform(e){super.setTransform(e);const r=this.resolution/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[i,a]=this.tileData.offset,n=[this.x+i*this.resolution,this.y-a*this.resolution],[o,l]=e.toScreenNoRotation([0,0],n),{symbolTileSize:c}=this.tileData.symbolizerParameters,d=Math.round((this.width-this.tileData.offset[0])/c)*c,u=Math.round((this.height-this.tileData.offset[1])/c)*c,m=d/this.rangeX*r,f=u/this.rangeY*r;Me(s,m,0,0,0,f,0,o,l,1),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,s),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class as extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const r=this.tileInfoView.getTileBounds(ne(),e),[s,i]=this.tileInfoView.tileInfo.size,a=this.tileInfoView.getTileResolution(e.level);return new is(e,a,r[0],r[3],s,i)}prepareRenderPasses(e){const r=e.registerRenderPass({name:"imagery (vf tile)",brushes:[Ue],target:()=>this.children.map(s=>s.tileData),drawPhase:k.MAP});return[...super.prepareRenderPasses(e),r]}doRender(e){this.visible&&e.drawPhase===k.MAP&&this.symbolTypes.forEach(r=>{e.renderPass=r,super.doRender(e)})}}let S=class extends b{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(t,e){e={...e,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(t.level,t.row,t.col,e);return this.layer.serviceRasterInfo?.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,e)),r}updateTileSource(t,e){const r=e.symbolizerParams,{tileData:s}=t;s.key=t.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:i}=r,{source:a}=e;if(s.offset=this._getTileSymbolOffset(s.key,i),a?.pixelBlock!=null){const n={extent:a.extent,pixelBlock:a.pixelBlock};s.rawPixelData=n,s.symbolizerParameters=r,s.source=this._sampleVectorFieldData(a.pixelBlock,r,s.offset)}else{const n=[Math.round((this._tileInfoView.tileInfo.size[0]-s.offset[0])/i),Math.round((this._tileInfoView.tileInfo.size[1]-s.offset[1])/i)],o=this.createEmptyTilePixelBlock(n);s.source=o,s.symbolizerParameters=r}return s.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(t,e){const r=e.local,{symbolTileSize:s}=r,{tileData:i}=t;i.offset=this._getTileSymbolOffset(i.key,s);const a=i.symbolizerParameters.symbolTileSize;i.symbolizerParameters=r;const n=i.rawPixelData?.pixelBlock;return n!=null&&a!==s&&(i.source=this._sampleVectorFieldData(n,i.symbolizerParameters,i.offset)),Promise.resolve()}attach(){super.attach(),this.container=new as(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=L(()=>this.layer.renderer,t=>this._updateSymbolType(t))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(t,e){const r=t.col*this._tileInfoView.tileInfo.size[0]%e,s=t.row*this._tileInfoView.tileInfo.size[1]%e;return[r>e/2?e-r:-r,s>e/2?e-s:-s]}_sampleVectorFieldData(t,e,r){const{symbolTileSize:s}=e;return Xe(t,"vector-uv",s,r)}_updateSymbolType(t){t.type==="vector-field"&&(this.container.symbolTypes=t.style==="wind-barb"?["scalar","triangle"]:t.style==="simple-scalar"?["scalar"]:["triangle"])}};h([p()],S.prototype,"container",void 0),h([p()],S.prototype,"layer",void 0),h([p()],S.prototype,"type",void 0),S=h([M("esri.views.2d.layers.imagery.VectorFieldTileView2D")],S);const ns=S,os=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return ut(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?it(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(r){try{return!this.layer.loaded||!!re(this.layer.serviceRasterInfo,r)}catch{return!1}}async fetchPopupFeaturesAtLocation(r,s){const{layer:i}=this;if(!r)throw new Te("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:a}=i,n=ct(i,s);if(!a||n==null)return[];const o=[],{value:l,magdirValue:c,processedValue:d}=await i.identify(r,{timeExtent:this.timeExtent,signal:s?.signal});let u="";if(l?.length){u=i.type==="imagery-tile"&&i.hasStandardTime()&&l[0]!=null?l.map(D=>i.getStandardTimeValue(D)).join(", "):l.join(", ");const m={ObjectId:0},f="Raster.ServicePixelValue";m[f]=i.type==="imagery-tile"&&i.raster.datasetFormat==="Function"?d?.join(", "):u,m[f+".Raw"]=u;const _=i.raster?.rasterInfo??i.serviceRasterInfo,$=_?.attributeTable;if($!=null){const{fields:D,features:pe}=$,H=D.find(({name:v})=>v.toLowerCase()==="value"),fe=m[f],V=H?pe.find(v=>String(v.attributes[H.name])===fe):null;if(V)for(const v in V.attributes)V.attributes.hasOwnProperty(v)&&(m[this._rasterFieldPrefix+v]=V.attributes[v])}const Q=_?.dataType;Q!=="vector-magdir"&&Q!=="vector-uv"||(m["Raster.Magnitude"]=c?.[0],m["Raster.Direction"]=c?.[1]);const me=new Pe({geometry:this.fullExtent?.clone(),attributes:m,layer:i,sourceLayer:i});o.push(me)}return o}_getFullExtent(){return re(this.layer.serviceRasterInfo,this.view.spatialReference)}};return h([p()],e.prototype,"fullExtent",null),h([p()],e.prototype,"layer",void 0),h([p({readOnly:!0})],e.prototype,"timeExtent",null),h([p()],e.prototype,"tileInfo",void 0),h([p({readOnly:!0})],e.prototype,"hasTilingEffects",null),h([p()],e.prototype,"datumTransformation",null),e=h([M("esri.views.layers.ImageryTileLayerView")],e),e};let T=class extends os(ht(Ie(Ce))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(t){this._useWebGLForProcessing=t,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=t)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(t){this._useProgressiveUpdate=t,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=t)}get displayParameters(){const{layer:t}=this,e=this._get("displayParameters");return t.renderer?{bandIds:t.bandIds,renderer:t.renderer,interpolation:t.interpolation,multidimensionalDefinition:t.multidimensionalDefinition,rasterFunction:t.type==="imagery-tile"?t.rasterFunction:null}:e}update(t){this.subview?.update(t),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([L(()=>this.displayParameters,(t,e)=>{const r=t.interpolation!==e?.interpolation&&(t.interpolation==="majority"||e?.interpolation==="majority")&&oe(this.layer),s=t.renderer!==e?.renderer&&this._getSubviewType(e?.renderer)!==this._getSubviewType(t.renderer);s&&this._updateSubview();const i=t.multidimensionalDefinition!==e?.multidimensionalDefinition,a=t.rasterFunction!==e?.rasterFunction,n=a&&!this._useWebGLForProcessing,o=i||r||s||n;this.subview.redrawOrRefetch({refetch:o,reprocess:a}).catch(l=>{R(l)||I.getLogger(this).error(l)}),this.notifyChange("updating")}),L(()=>this.layer.multidimensionalSubset??null,(t,e)=>{const{multidimensionalDefinition:r}=this.layer;r!=null&&Z(r,t)!==Z(r,e)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(s=>{R(s)||I.getLogger(this).error(s)}),this.notifyChange("updating"))},ge),L(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(t=>{R(t)||I.getLogger(this).error(t)})},_e)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:t}=this.layer;if(!t)return;const e=this._getSubviewType(t);if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:r}=this;let s;if(s=e==="rasterVF"?new ns({layer:r,layerView:this,scheduler:this.scheduler}):e==="flow"?new Se({layer:r,layerView:this,scheduler:this.scheduler}):new ss({layer:r,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:i}=this;s.previousLOD=i&&"previousLOD"in i?i.previousLOD:null}this._attachSubview(s),this.subview=s,this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_getSubviewType(t){const e=t?.type;return e==="vector-field"?"rasterVF":e==="flow"?"flow":"raster"}};h([p()],T.prototype,"subview",void 0),h([p()],T.prototype,"useWebGLForProcessing",null),h([p()],T.prototype,"useProgressiveUpdate",null),h([p({readOnly:!0})],T.prototype,"displayParameters",null),T=h([M("esri.views.2d.layers.ImageryTileLayerView2D")],T);const ki=T;export{ki as default}; diff --git a/main/assets/Indices-DEr2HrWx-Cd6y9wum.js b/main/assets/Indices-DEr2HrWx-Cd6y9wum.js new file mode 100644 index 000000000..376120c16 --- /dev/null +++ b/main/assets/Indices-DEr2HrWx-Cd6y9wum.js @@ -0,0 +1 @@ +import{hc as u,dG as f}from"./main-C7yV2j71.js";function c(n){if(u(n)){if(n.length(t=t&&l===0,e=e&&l===A,!t&&!e)),t?h(n.length):e?w(n.length):u(n)||n.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?y(n):n}function y(n){let t=!0;for(const e of n){if(e>=65536)return u(n)?new Uint32Array(n):n;e>=256&&(t=!1)}return t?new Uint8Array(n):new Uint16Array(n)}function g(n){return n<=f?new Array(n):n<=65536?new Uint16Array(n):new Uint32Array(n)}let r=(()=>{const n=new Uint32Array(131072);for(let t=0;t{const n=new Uint16Array(65536);for(let t=0;tr.length){const t=Math.max(2*r.length,n);r=new Uint32Array(t);for(let e=0;ei.length){const t=Math.max(2*i.length,n);i=new Uint8Array(t)}return new Uint8Array(i.buffer,0,n)}export{w as A,g as h,c as w}; diff --git a/main/assets/Indices-DEr2HrWx-Cw8IJeSy.js b/main/assets/Indices-DEr2HrWx-Cw8IJeSy.js deleted file mode 100644 index 35e47a83e..000000000 --- a/main/assets/Indices-DEr2HrWx-Cw8IJeSy.js +++ /dev/null @@ -1 +0,0 @@ -import{hc as u,dG as f}from"./main-BZaw9FpY.js";function c(n){if(u(n)){if(n.length(t=t&&l===0,e=e&&l===A,!t&&!e)),t?h(n.length):e?w(n.length):u(n)||n.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?y(n):n}function y(n){let t=!0;for(const e of n){if(e>=65536)return u(n)?new Uint32Array(n):n;e>=256&&(t=!1)}return t?new Uint8Array(n):new Uint16Array(n)}function g(n){return n<=f?new Array(n):n<=65536?new Uint16Array(n):new Uint32Array(n)}let r=(()=>{const n=new Uint32Array(131072);for(let t=0;t{const n=new Uint16Array(65536);for(let t=0;tr.length){const t=Math.max(2*r.length,n);r=new Uint32Array(t);for(let e=0;ei.length){const t=Math.max(2*i.length,n);i=new Uint8Array(t)}return new Uint8Array(i.buffer,0,n)}export{w as A,g as h,c as w}; diff --git a/main/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-BFGow1HJ.js b/main/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-BFGow1HJ.js new file mode 100644 index 000000000..512bd37f9 --- /dev/null +++ b/main/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-BFGow1HJ.js @@ -0,0 +1 @@ +import{J as g,n as A,B as _,hZ as u,e1 as E,o as j,W as S,f as N,a1 as M,v as d,S as c,i as V,dU as v}from"./main-C7yV2j71.js";import{m as U}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{r as k,j as p,Y as L,A as $,D,E as R,k as f}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{n as I}from"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import{D as z}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{n as X}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as W}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as F}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as G}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as P}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{$ as q,Z as K}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{k as T,R as Z,j as B}from"./elevationInfoUtils-mOZsPH2J-Bwot-813.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";let m=class extends W(F(G(P(U(C(X(z))))))){constructor(r){super(r),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new g({wkid:4326,vcsWkid:115700}),this.fullExtent=new A(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(r){this._set("elevationInfo",r),this._validateElevationInfo()}_verifyArray(r,i){if(!Array.isArray(r)||r.length7972671&&t[7]>7972671&&t[11]>7945940)return}const n=r.root?.transform,w=v();if(i.region&&this._verifyArray(i.region,6)){const t=i.region,l=_(t[0]),s=_(t[1]),o=t[4],a=_(t[2]),e=_(t[3]),y=t[5];this.fullExtent=new A({xmin:l,ymin:s,zmin:o,xmax:a,ymax:e,zmax:y,spatialReference:this.spatialReference})}else if(i.sphere&&this._verifyArray(i.sphere,4)){const t=i.sphere,l=u(t[0],t[1],t[2]),s=t[3]/Math.sqrt(3),o=v();k(o,l,u(s,s,s));const a=v();if(p(a,l,u(s,s,s)),n&&this._verifyArray(n,16)){const x=n;L(w,o,x),$(o,w),L(w,a,x),$(a,w)}I(o,E,0,o,g.WGS84,0),I(a,E,0,a,g.WGS84,0);const e=v(),y=v();D(e,o,a),R(y,o,a),this.fullExtent=new A({xmin:e[0],ymin:e[1],zmin:e[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}else if(i.box&&this._verifyArray(i.box,12)){const t=i.box,l=u(t[0],t[1],t[2]),s=u(t[3],t[4],t[5]),o=u(t[6],t[7],t[8]),a=u(t[9],t[10],t[11]),e=[];for(let h=0;h<8;++h)e.push(v());if(p(e[0],l,s),p(e[0],e[0],o),p(e[0],e[0],a),f(e[1],l,s),p(e[1],e[1],o),p(e[1],e[1],a),p(e[2],l,s),f(e[2],e[2],o),p(e[2],e[2],a),f(e[3],l,s),f(e[3],e[3],o),p(e[3],e[3],a),p(e[4],l,s),p(e[4],e[4],o),f(e[4],e[4],a),f(e[5],l,s),p(e[5],e[5],o),f(e[5],e[5],a),p(e[6],l,s),f(e[6],e[6],o),f(e[6],e[6],a),f(e[7],l,s),f(e[7],e[7],o),f(e[7],e[7],a),n&&this._verifyArray(n,16)){const h=n;for(let b=0;b<8;++b)L(e[b],e[b],h)}const y=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),x=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h<8;++h)I(e[h],E,0,e[h],g.WGS84,0),D(x,x,e[h]),R(y,y,e[h]);this.fullExtent=new A({xmin:x[0],ymin:x[1],zmin:x[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}}async load(r){return this.addResolvingPromise(this._doLoad(r)),this}async _doLoad(r){const i=r!=null?r.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:n=>{if(n.typeKeywords?.includes("IntegratedMesh"))return!0;throw new j("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},r)}catch(n){S(n)}this.url&&await N(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(n=>{this._initFullExtent(n.data)},n=>{S(n)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const r=this.elevationInfo,i="Integrated mesh 3d tiles layers";T(M.getLogger(this),Z(i,"absolute-height",r)),T(M.getLogger(this),B(i,r))}};d([c({type:["IntegratedMesh3DTilesLayer"]})],m.prototype,"operationalLayerType",void 0),d([c({type:g})],m.prototype,"spatialReference",void 0),d([c({type:A})],m.prototype,"fullExtent",void 0),d([c(q)],m.prototype,"elevationInfo",null),d([c({type:["show","hide"]})],m.prototype,"listMode",void 0),d([c(K)],m.prototype,"url",void 0),d([c({readOnly:!0})],m.prototype,"type",void 0),d([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],m.prototype,"path",void 0),d([c({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"minScale",void 0),d([c({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"maxScale",void 0),m=d([V("esri.layers.IntegratedMesh3DTilesLayer")],m);const ue=m;export{ue as default}; diff --git a/main/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-BqNlS4x8.js b/main/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-BqNlS4x8.js deleted file mode 100644 index 659cbfdc5..000000000 --- a/main/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-BqNlS4x8.js +++ /dev/null @@ -1 +0,0 @@ -import{J as g,n as A,B as _,hZ as u,e1 as E,o as j,W as S,f as N,a1 as M,v as d,S as c,i as V,dU as v}from"./main-BZaw9FpY.js";import{m as U}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{r as k,j as p,Y as L,A as $,D,E as R,k as f}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{n as I}from"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import{D as z}from"./Layer-ChoECxvZ-C4wLrCej.js";import{n as X}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as W}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as F}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as G}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as P}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{$ as q,Z as K}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{k as T,R as Z,j as B}from"./elevationInfoUtils-mOZsPH2J-CGmjotSk.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";let m=class extends W(F(G(P(U(C(X(z))))))){constructor(r){super(r),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new g({wkid:4326,vcsWkid:115700}),this.fullExtent=new A(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(r){this._set("elevationInfo",r),this._validateElevationInfo()}_verifyArray(r,i){if(!Array.isArray(r)||r.length7972671&&t[7]>7972671&&t[11]>7945940)return}const n=r.root?.transform,w=v();if(i.region&&this._verifyArray(i.region,6)){const t=i.region,l=_(t[0]),s=_(t[1]),o=t[4],a=_(t[2]),e=_(t[3]),y=t[5];this.fullExtent=new A({xmin:l,ymin:s,zmin:o,xmax:a,ymax:e,zmax:y,spatialReference:this.spatialReference})}else if(i.sphere&&this._verifyArray(i.sphere,4)){const t=i.sphere,l=u(t[0],t[1],t[2]),s=t[3]/Math.sqrt(3),o=v();k(o,l,u(s,s,s));const a=v();if(p(a,l,u(s,s,s)),n&&this._verifyArray(n,16)){const x=n;L(w,o,x),$(o,w),L(w,a,x),$(a,w)}I(o,E,0,o,g.WGS84,0),I(a,E,0,a,g.WGS84,0);const e=v(),y=v();D(e,o,a),R(y,o,a),this.fullExtent=new A({xmin:e[0],ymin:e[1],zmin:e[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}else if(i.box&&this._verifyArray(i.box,12)){const t=i.box,l=u(t[0],t[1],t[2]),s=u(t[3],t[4],t[5]),o=u(t[6],t[7],t[8]),a=u(t[9],t[10],t[11]),e=[];for(let h=0;h<8;++h)e.push(v());if(p(e[0],l,s),p(e[0],e[0],o),p(e[0],e[0],a),f(e[1],l,s),p(e[1],e[1],o),p(e[1],e[1],a),p(e[2],l,s),f(e[2],e[2],o),p(e[2],e[2],a),f(e[3],l,s),f(e[3],e[3],o),p(e[3],e[3],a),p(e[4],l,s),p(e[4],e[4],o),f(e[4],e[4],a),f(e[5],l,s),p(e[5],e[5],o),f(e[5],e[5],a),p(e[6],l,s),f(e[6],e[6],o),f(e[6],e[6],a),f(e[7],l,s),f(e[7],e[7],o),f(e[7],e[7],a),n&&this._verifyArray(n,16)){const h=n;for(let b=0;b<8;++b)L(e[b],e[b],h)}const y=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),x=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h<8;++h)I(e[h],E,0,e[h],g.WGS84,0),D(x,x,e[h]),R(y,y,e[h]);this.fullExtent=new A({xmin:x[0],ymin:x[1],zmin:x[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}}async load(r){return this.addResolvingPromise(this._doLoad(r)),this}async _doLoad(r){const i=r!=null?r.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:n=>{if(n.typeKeywords?.includes("IntegratedMesh"))return!0;throw new j("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},r)}catch(n){S(n)}this.url&&await N(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(n=>{this._initFullExtent(n.data)},n=>{S(n)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const r=this.elevationInfo,i="Integrated mesh 3d tiles layers";T(M.getLogger(this),Z(i,"absolute-height",r)),T(M.getLogger(this),B(i,r))}};d([c({type:["IntegratedMesh3DTilesLayer"]})],m.prototype,"operationalLayerType",void 0),d([c({type:g})],m.prototype,"spatialReference",void 0),d([c({type:A})],m.prototype,"fullExtent",void 0),d([c(q)],m.prototype,"elevationInfo",null),d([c({type:["show","hide"]})],m.prototype,"listMode",void 0),d([c(K)],m.prototype,"url",void 0),d([c({readOnly:!0})],m.prototype,"type",void 0),d([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],m.prototype,"path",void 0),d([c({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"minScale",void 0),d([c({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"maxScale",void 0),m=d([V("esri.layers.IntegratedMesh3DTilesLayer")],m);const ue=m;export{ue as default}; diff --git a/main/assets/IntegratedMeshLayer-C-XaBbXd-BQWd-pKc.js b/main/assets/IntegratedMeshLayer-C-XaBbXd-BQWd-pKc.js new file mode 100644 index 000000000..0a719a04e --- /dev/null +++ b/main/assets/IntegratedMeshLayer-C-XaBbXd-BQWd-pKc.js @@ -0,0 +1 @@ +import{v as i,S as s,l as _,ac as I,i as h,bA as L,ag as x,a as R,f as b,ai as N,a4 as M,W as $,o as m,a1 as v,a0 as A,e as D,b0 as J,P as j,av as E}from"./main-C7yV2j71.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{C as c}from"./persistable-C6RBwzJi-DoQq7vOT.js";import{D as U}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{n as V}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as K}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as k}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as z}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as F}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{W as G,f as S}from"./SceneService-BZqGtWmG-B9O0VJ5b.js";import{$ as W}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{y as q,o as H,d as Y,m as B}from"./I3SLayerDefinitions-CwLXCKtU-DliEVqX4.js";import{J as Q,a as X}from"./projection-BA9M1R7d-DXrPfsKU.js";import{k as w,R as Z,j as ee}from"./elevationInfoUtils-mOZsPH2J-Bwot-813.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-BFbGjGZW.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./jsonContext-BA8GHqVk-DpBf0bCt.js";import"./resourceUtils-BmW6QqlX-CP-OW4gT.js";import"./resourceUtils-rTM6Iemx-Bu5Czfos.js";import"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";var f;let n=f=class extends D{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,a){if(a.layer?.spatialReference&&!a.layer.spatialReference.equals(this.geometry.spatialReference)){if(!Q(e.spatialReference,a.layer.spatialReference))return void(a?.messages&&a.messages.push(new J("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:a.layer.spatialReference,context:a})));const l=new _;X(e,l,a.layer.spatialReference),t[r]=l.toJSON(a)}else t[r]=e.toJSON(a);delete t[r].spatialReference}clone(){return new f({geometry:j(this.geometry),type:this.type})}};i([s({type:_}),c()],n.prototype,"geometry",void 0),i([I(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),i([s({type:["clip","mask","replace"],nonNullable:!0}),c()],n.prototype,"type",void 0),n=f=i([h("esri.layers.support.SceneModification")],n);const d=n;var p;let y=p=class extends L(x.ofType(d)){constructor(e){super(e),this.url=null}clone(){return new p({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const r=new p;for(const a of e)r.add(d.fromJSON(a,t));return r}static async fromUrl(e,t,r){const a={url:R(e),origin:"service"},l=await b(e,{responseType:"json",signal:r?.signal}),O=t.toJSON(),u=[];for(const g of l.data)u.push(d.fromJSON({...g,geometry:{...g.geometry,spatialReference:O}},a));return new p({url:e,items:u})}};i([s({type:String})],y.prototype,"url",void 0),y=p=i([h("esri.layers.support.SceneModifications")],y);const T=y;let o=class extends G(K(k(z(F(P(C(V(U)))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(N(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,E))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:M(e,r),context:r}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){$(r)}if(await this._fetchService(t),this._modificationsSource!=null){const r=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",r,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(S.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(S.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new m("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new m("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new m("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";w(v.getLogger(this),Z(t,"absolute-height",e)),w(v.getLogger(this),ee(t,e))}};i([s({type:String,readOnly:!0})],o.prototype,"geometryType",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["IntegratedMeshLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({type:q,readOnly:!0})],o.prototype,"nodePages",void 0),i([s({type:[H],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[Y],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[B],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({type:T}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],o.prototype,"modifications",void 0),i([A(["web-scene","portal-item"],"modifications")],o.prototype,"readModifications",null),i([s(W)],o.prototype,"elevationInfo",null),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),o=i([h("esri.layers.IntegratedMeshLayer")],o);const De=o;export{De as default}; diff --git a/main/assets/IntegratedMeshLayer-C-XaBbXd-CPvMhR5k.js b/main/assets/IntegratedMeshLayer-C-XaBbXd-CPvMhR5k.js deleted file mode 100644 index ea8ff3c5d..000000000 --- a/main/assets/IntegratedMeshLayer-C-XaBbXd-CPvMhR5k.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as s,l as _,ac as I,i as h,bA as L,ag as x,a as R,f as b,ai as N,a4 as M,W as $,o as m,a1 as v,a0 as A,e as D,b0 as J,P as j,av as E}from"./main-BZaw9FpY.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{C as c}from"./persistable-C6RBwzJi-B2W1QdS_.js";import{D as U}from"./Layer-ChoECxvZ-C4wLrCej.js";import{n as V}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as K}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as k}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as z}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as F}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{W as G,f as S}from"./SceneService-BZqGtWmG-B8Xgkv2e.js";import{$ as W}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{y as q,o as H,d as Y,m as B}from"./I3SLayerDefinitions-CwLXCKtU-DIMh5lHL.js";import{J as Q,a as X}from"./projection-BA9M1R7d-DoNqITCd.js";import{k as w,R as Z,j as ee}from"./elevationInfoUtils-mOZsPH2J-CGmjotSk.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-X6Zoj5Td.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./jsonContext-BA8GHqVk-BMETb6sX.js";import"./resourceUtils-BmW6QqlX-Cs99W_og.js";import"./resourceUtils-rTM6Iemx-C_sFWCPe.js";import"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";var f;let n=f=class extends D{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,a){if(a.layer?.spatialReference&&!a.layer.spatialReference.equals(this.geometry.spatialReference)){if(!Q(e.spatialReference,a.layer.spatialReference))return void(a?.messages&&a.messages.push(new J("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:a.layer.spatialReference,context:a})));const l=new _;X(e,l,a.layer.spatialReference),t[r]=l.toJSON(a)}else t[r]=e.toJSON(a);delete t[r].spatialReference}clone(){return new f({geometry:j(this.geometry),type:this.type})}};i([s({type:_}),c()],n.prototype,"geometry",void 0),i([I(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),i([s({type:["clip","mask","replace"],nonNullable:!0}),c()],n.prototype,"type",void 0),n=f=i([h("esri.layers.support.SceneModification")],n);const d=n;var p;let y=p=class extends L(x.ofType(d)){constructor(e){super(e),this.url=null}clone(){return new p({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const r=new p;for(const a of e)r.add(d.fromJSON(a,t));return r}static async fromUrl(e,t,r){const a={url:R(e),origin:"service"},l=await b(e,{responseType:"json",signal:r?.signal}),O=t.toJSON(),u=[];for(const g of l.data)u.push(d.fromJSON({...g,geometry:{...g.geometry,spatialReference:O}},a));return new p({url:e,items:u})}};i([s({type:String})],y.prototype,"url",void 0),y=p=i([h("esri.layers.support.SceneModifications")],y);const T=y;let o=class extends G(K(k(z(F(P(C(V(U)))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(N(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,E))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:M(e,r),context:r}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){$(r)}if(await this._fetchService(t),this._modificationsSource!=null){const r=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",r,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(S.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(S.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new m("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new m("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new m("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";w(v.getLogger(this),Z(t,"absolute-height",e)),w(v.getLogger(this),ee(t,e))}};i([s({type:String,readOnly:!0})],o.prototype,"geometryType",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["IntegratedMeshLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({type:q,readOnly:!0})],o.prototype,"nodePages",void 0),i([s({type:[H],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[Y],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[B],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({type:T}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],o.prototype,"modifications",void 0),i([A(["web-scene","portal-item"],"modifications")],o.prototype,"readModifications",null),i([s(W)],o.prototype,"elevationInfo",null),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),o=i([h("esri.layers.IntegratedMeshLayer")],o);const De=o;export{De as default}; diff --git a/main/assets/InterleavedLayout-DXzw3B2n-BD0-ikLj.js b/main/assets/InterleavedLayout-DXzw3B2n-BD0-ikLj.js new file mode 100644 index 000000000..7345cc8fc --- /dev/null +++ b/main/assets/InterleavedLayout-DXzw3B2n-BD0-ikLj.js @@ -0,0 +1 @@ +import{J as l,p as o,l as a,X as p,o as c,B as _,T as y,E as F,m,A as g,a as w,b,O as v,S as E,g as L,L as A,w as $,x as R,M as X,C as T,N as M,P as Y,R as k,Y as V,F as U,I as x,U as j,V as q,v as D,j as z,k as G,q as H,D as I,G as J,H as N,z as O}from"./BufferView-PQoE3GL7-M6q1od-Y.js";import{c as f}from"./types-ChhhI6OU-Cxh6dPlX.js";import{h as P}from"./Util-BjGjeg6f-08Szkf4F.js";class h{constructor(t,e){this.layout=t,this.buffer=typeof e=="number"?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const i=t.fields.get(s);this[s]=new i.constructor(this.buffer,i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const s=this[t];return s&&s.elementCount===e.ElementCount&&s.elementType===e.ElementType?s:null}slice(t,e){return new h(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,s=0,i=t.count){const r=this.stride;if(r%4==0){const d=new Uint32Array(t.buffer,e*r,i*r/4);new Uint32Array(this.buffer,s*r,i*r/4).set(d)}else{const d=new Uint8Array(t.buffer,e*r,i*r);new Uint8Array(this.buffer,s*r,i*r).set(d)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(t){this._stride=0,this._lastAligned=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}freeze(){return this}vec2f(t,e){return this._appendField(t,o,e),this}vec2f64(t,e){return this._appendField(t,F,e),this}vec3f(t,e){return this._appendField(t,a,e),this}vec3f64(t,e){return this._appendField(t,m,e),this}vec4f(t,e){return this._appendField(t,p,e),this}vec4f64(t,e){return this._appendField(t,g,e),this}mat3f(t,e){return this._appendField(t,c,e),this}mat3f64(t,e){return this._appendField(t,w,e),this}mat4f(t,e){return this._appendField(t,_,e),this}mat4f64(t,e){return this._appendField(t,b,e),this}vec4u8(t,e){return this._appendField(t,A,e),this}f32(t,e){return this._appendField(t,l,e),this}f64(t,e){return this._appendField(t,y,e),this}u8(t,e){return this._appendField(t,v,e),this}u16(t,e){return this._appendField(t,$,e),this}i8(t,e){return this._appendField(t,U,e),this}vec2i8(t,e){return this._appendField(t,x,e),this}vec2i16(t,e){return this._appendField(t,z,e),this}vec2u8(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,T,e),this}u32(t,e){return this._appendField(t,M,e),this}_appendField(t,e,s){if(this._fields.has(t))return void P(!1,`${t} already added to vertex buffer layout`);const i=e.ElementCount*f(e.ElementType),r=this._stride;this._stride+=i,this._fields.set(t,{size:i,constructor:e,offset:r,optional:s})}createBuffer(t){return new h(this,t)}createView(t){return new h(this,t)}clone(){const t=new u;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,s)=>t._fields.set(s,e)),t.BufferType=this.BufferType,t}get stride(){if(this._lastAligned!==this._fields.size){let t=1;this._fields.forEach(e=>t=Math.max(t,f(e.constructor.ElementType))),this._stride=Math.floor((this._stride+t-1)/t)*t,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function tt(){return new u}class et{constructor(t){this.fields=new Array,t.fields.forEach((e,s)=>{const i={...e,constructor:B(e.constructor)};this.fields.push([s,i])}),this.stride=t.stride}}const S=[l,o,a,p,c,_,y,F,m,g,w,b,v,E,L,A,$,R,X,T,M,Y,k,V,U,x,j,q,D,z,G,H,I,J,N,O];function B(n){return`${n.ElementType}_${n.ElementCount}`}function W(n){return C.get(n)}const C=new Map;S.forEach(n=>C.set(B(n),n));export{tt as R,et as W}; diff --git a/main/assets/InterleavedLayout-DXzw3B2n-BD8s1eQP.js b/main/assets/InterleavedLayout-DXzw3B2n-BD8s1eQP.js deleted file mode 100644 index 217f2e579..000000000 --- a/main/assets/InterleavedLayout-DXzw3B2n-BD8s1eQP.js +++ /dev/null @@ -1 +0,0 @@ -import{J as l,p as o,l as a,X as p,o as c,B as _,T as y,E as F,m,A as g,a as w,b,O as v,S as E,g as L,L as A,w as $,x as R,M as X,C as T,N as M,P as Y,R as k,Y as V,F as U,I as x,U as j,V as q,v as D,j as z,k as G,q as H,D as I,G as J,H as N,z as O}from"./BufferView-PQoE3GL7-DXIpDOUe.js";import{c as f}from"./types-ChhhI6OU-Cxh6dPlX.js";import{h as P}from"./Util-BjGjeg6f-08Szkf4F.js";class h{constructor(t,e){this.layout=t,this.buffer=typeof e=="number"?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const i=t.fields.get(s);this[s]=new i.constructor(this.buffer,i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const s=this[t];return s&&s.elementCount===e.ElementCount&&s.elementType===e.ElementType?s:null}slice(t,e){return new h(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,s=0,i=t.count){const r=this.stride;if(r%4==0){const d=new Uint32Array(t.buffer,e*r,i*r/4);new Uint32Array(this.buffer,s*r,i*r/4).set(d)}else{const d=new Uint8Array(t.buffer,e*r,i*r);new Uint8Array(this.buffer,s*r,i*r).set(d)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(t){this._stride=0,this._lastAligned=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}freeze(){return this}vec2f(t,e){return this._appendField(t,o,e),this}vec2f64(t,e){return this._appendField(t,F,e),this}vec3f(t,e){return this._appendField(t,a,e),this}vec3f64(t,e){return this._appendField(t,m,e),this}vec4f(t,e){return this._appendField(t,p,e),this}vec4f64(t,e){return this._appendField(t,g,e),this}mat3f(t,e){return this._appendField(t,c,e),this}mat3f64(t,e){return this._appendField(t,w,e),this}mat4f(t,e){return this._appendField(t,_,e),this}mat4f64(t,e){return this._appendField(t,b,e),this}vec4u8(t,e){return this._appendField(t,A,e),this}f32(t,e){return this._appendField(t,l,e),this}f64(t,e){return this._appendField(t,y,e),this}u8(t,e){return this._appendField(t,v,e),this}u16(t,e){return this._appendField(t,$,e),this}i8(t,e){return this._appendField(t,U,e),this}vec2i8(t,e){return this._appendField(t,x,e),this}vec2i16(t,e){return this._appendField(t,z,e),this}vec2u8(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,T,e),this}u32(t,e){return this._appendField(t,M,e),this}_appendField(t,e,s){if(this._fields.has(t))return void P(!1,`${t} already added to vertex buffer layout`);const i=e.ElementCount*f(e.ElementType),r=this._stride;this._stride+=i,this._fields.set(t,{size:i,constructor:e,offset:r,optional:s})}createBuffer(t){return new h(this,t)}createView(t){return new h(this,t)}clone(){const t=new u;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,s)=>t._fields.set(s,e)),t.BufferType=this.BufferType,t}get stride(){if(this._lastAligned!==this._fields.size){let t=1;this._fields.forEach(e=>t=Math.max(t,f(e.constructor.ElementType))),this._stride=Math.floor((this._stride+t-1)/t)*t,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function tt(){return new u}class et{constructor(t){this.fields=new Array,t.fields.forEach((e,s)=>{const i={...e,constructor:B(e.constructor)};this.fields.push([s,i])}),this.stride=t.stride}}const S=[l,o,a,p,c,_,y,F,m,g,w,b,v,E,L,A,$,R,X,T,M,Y,k,V,U,x,j,q,D,z,G,H,I,J,N,O];function B(n){return`${n.ElementType}_${n.ElementCount}`}function W(n){return C.get(n)}const C=new Map;S.forEach(n=>C.set(B(n),n));export{tt as R,et as W}; diff --git a/main/assets/KMLLayer-DwQXpcMB-0SwlR7uL.js b/main/assets/KMLLayer-DwQXpcMB-0SwlR7uL.js new file mode 100644 index 000000000..f09910e8c --- /dev/null +++ b/main/assets/KMLLayer-DwQXpcMB-0SwlR7uL.js @@ -0,0 +1 @@ +import{I as k,bA as L,ai as f,ah as y,av as p,aw as v,n as d,bG as _,ag as m,v as r,S as l,jH as F,a0 as h,i as c,J as g,gK as O,W as j,ac as M,aB as I}from"./main-C7yV2j71.js";import{f as R}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as C}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as N}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as K}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as P}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as A}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as J}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{Z as W}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{G as $,N as S,j as w,T as E}from"./kmlUtils-C5oIEoOy-CbWoF4Dn.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";var u;let a=u=class extends k.EventedMixin(L(I)){constructor(...t){super(...t),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([f(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},p),f(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},p),y(()=>this.sublayers,(e,i)=>{if(i)for(const s of i)s.layer=s.parent=null;if(e)for(const s of e)s.parent=this,s.layer=this.layer},p),y(()=>this.layer,e=>{if(this.sublayers)for(const i of this.sublayers)i.layer=e},p)])}initialize(){v(()=>this.networkLink).then(()=>v(()=>this.visible===!0)).then(()=>this.load())}load(t){if(!this.networkLink||this.networkLink.viewFormat)return;const e=t!=null?t.signal:null,i=this._fetchService(this._get("networkLink")?.href??"",e).then(s=>{const n=$(s.sublayers);this.fullExtent=d.fromJSON(n),this.sourceJSON=s;const b=_(m.ofType(u),S(u,s));this.sublayers?this.sublayers.addMany(b):this.sublayers=b,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(i),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(t,e){return!!e.visibility}_fetchService(t,e){return w(t,this.layer.outSpatialReference,this.layer.refreshInterval,e).then(i=>E(i.data))}};r([l()],a.prototype,"description",void 0),r([l({type:d})],a.prototype,"fullExtent",void 0),r([l()],a.prototype,"id",void 0),r([l({readOnly:!0,value:null})],a.prototype,"networkLink",void 0),r([l({json:{write:{allowNull:!0}}})],a.prototype,"parent",void 0),r([l({type:m.ofType(a),json:{write:{allowNull:!0}}})],a.prototype,"sublayers",void 0),r([l({value:null,json:{read:{source:"name",reader:t=>F(t)}}})],a.prototype,"title",void 0),r([l({value:!0})],a.prototype,"visible",null),r([h("visible",["visibility"])],a.prototype,"readVisible",null),r([l()],a.prototype,"sourceJSON",void 0),r([l()],a.prototype,"layer",void 0),a=u=r([c("esri.layers.support.KMLSublayer")],a);const x=a,z=["kml","xml"];let o=class extends N(A(J(K(P(T(C)))))){constructor(...t){super(...t),this._visibleFolders=[],this.allSublayers=new R({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=g.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([y(()=>this.sublayers,(t,e)=>{e&&e.forEach(i=>{i.parent=null,i.layer=null}),t&&t.forEach(i=>{i.parent=this,i.layer=this})},p),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}readSublayersFromItemOrWebMap(t,e){this._visibleFolders=e.visibleFolders}readSublayers(t,e,i){return S(x,e,i,this._visibleFolders)}writeSublayers(t,e){const i=[],s=t.toArray();for(;s.length;){const n=s[0];n.networkLink||(n.visible&&i.push(n.id),n.sublayers&&s.push(...n.sublayers.toArray())),s.shift()}e.visibleFolders=i}get title(){const t=this._get("title");return t&&this.originOf("title")!=="defaults"?t:this.url?O(this.url,z)||"KML":t}set title(t){this._set("title",t)}get visibleSublayers(){const t=this.sublayers,e=[],i=s=>{s.visible&&(e.push(s),s.sublayers&&s.sublayers.forEach(i))};return t&&t.forEach(i),e}get fullExtent(){return this._recomputeFullExtent()}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},t).catch(j).then(()=>this._fetchService(e))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(t){const e=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:w(this.url??"",this.outSpatialReference,this.refreshInterval,t)),i=E(e.data);i&&this.read(i,{origin:"service"})}_recomputeFullExtent(){let t=null;this.extent!=null&&(t=this.extent.clone());const e=i=>{if(i.sublayers)for(const s of i.sublayers.items)e(s),s.visible&&s.fullExtent&&(t!=null?t.union(s.fullExtent):t=s.fullExtent.clone())};return e(this),t}};r([l({readOnly:!0})],o.prototype,"allSublayers",void 0),r([l({type:g})],o.prototype,"outSpatialReference",void 0),r([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),r([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),r([l({type:["show","hide","hide-children"]})],o.prototype,"listMode",void 0),r([l({type:["KML"]})],o.prototype,"operationalLayerType",void 0),r([l({})],o.prototype,"resourceInfo",void 0),r([l({type:m.ofType(x),json:{write:{ignoreOrigin:!0}}})],o.prototype,"sublayers",void 0),r([h(["web-map","portal-item"],"sublayers",["visibleFolders"])],o.prototype,"readSublayersFromItemOrWebMap",null),r([h("service","sublayers",["sublayers"])],o.prototype,"readSublayers",null),r([M("sublayers")],o.prototype,"writeSublayers",null),r([l({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),r([l({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],o.prototype,"title",null),r([l(W)],o.prototype,"url",void 0),r([l({readOnly:!0})],o.prototype,"visibleSublayers",null),r([l({type:d})],o.prototype,"extent",void 0),r([l()],o.prototype,"fullExtent",null),o=r([c("esri.layers.KMLLayer")],o);const Kt=o;export{Kt as default}; diff --git a/main/assets/KMLLayer-DwQXpcMB-Dk5jM17E.js b/main/assets/KMLLayer-DwQXpcMB-Dk5jM17E.js deleted file mode 100644 index 89ef1f1b0..000000000 --- a/main/assets/KMLLayer-DwQXpcMB-Dk5jM17E.js +++ /dev/null @@ -1 +0,0 @@ -import{I as k,bA as L,ai as f,ah as y,av as p,aw as v,n as d,bG as _,ag as m,v as r,S as l,jH as F,a0 as h,i as c,J as g,gK as O,W as j,ac as M,aB as I}from"./main-BZaw9FpY.js";import{f as R}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as C}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as N}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as K}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as P}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as A}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as J}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{Z as W}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{G as $,N as S,j as w,T as E}from"./kmlUtils-C5oIEoOy-CLmxrxRw.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";var u;let a=u=class extends k.EventedMixin(L(I)){constructor(...t){super(...t),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([f(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},p),f(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},p),y(()=>this.sublayers,(e,i)=>{if(i)for(const s of i)s.layer=s.parent=null;if(e)for(const s of e)s.parent=this,s.layer=this.layer},p),y(()=>this.layer,e=>{if(this.sublayers)for(const i of this.sublayers)i.layer=e},p)])}initialize(){v(()=>this.networkLink).then(()=>v(()=>this.visible===!0)).then(()=>this.load())}load(t){if(!this.networkLink||this.networkLink.viewFormat)return;const e=t!=null?t.signal:null,i=this._fetchService(this._get("networkLink")?.href??"",e).then(s=>{const n=$(s.sublayers);this.fullExtent=d.fromJSON(n),this.sourceJSON=s;const b=_(m.ofType(u),S(u,s));this.sublayers?this.sublayers.addMany(b):this.sublayers=b,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(i),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(t,e){return!!e.visibility}_fetchService(t,e){return w(t,this.layer.outSpatialReference,this.layer.refreshInterval,e).then(i=>E(i.data))}};r([l()],a.prototype,"description",void 0),r([l({type:d})],a.prototype,"fullExtent",void 0),r([l()],a.prototype,"id",void 0),r([l({readOnly:!0,value:null})],a.prototype,"networkLink",void 0),r([l({json:{write:{allowNull:!0}}})],a.prototype,"parent",void 0),r([l({type:m.ofType(a),json:{write:{allowNull:!0}}})],a.prototype,"sublayers",void 0),r([l({value:null,json:{read:{source:"name",reader:t=>F(t)}}})],a.prototype,"title",void 0),r([l({value:!0})],a.prototype,"visible",null),r([h("visible",["visibility"])],a.prototype,"readVisible",null),r([l()],a.prototype,"sourceJSON",void 0),r([l()],a.prototype,"layer",void 0),a=u=r([c("esri.layers.support.KMLSublayer")],a);const x=a,z=["kml","xml"];let o=class extends N(A(J(K(P(T(C)))))){constructor(...t){super(...t),this._visibleFolders=[],this.allSublayers=new R({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=g.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([y(()=>this.sublayers,(t,e)=>{e&&e.forEach(i=>{i.parent=null,i.layer=null}),t&&t.forEach(i=>{i.parent=this,i.layer=this})},p),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}readSublayersFromItemOrWebMap(t,e){this._visibleFolders=e.visibleFolders}readSublayers(t,e,i){return S(x,e,i,this._visibleFolders)}writeSublayers(t,e){const i=[],s=t.toArray();for(;s.length;){const n=s[0];n.networkLink||(n.visible&&i.push(n.id),n.sublayers&&s.push(...n.sublayers.toArray())),s.shift()}e.visibleFolders=i}get title(){const t=this._get("title");return t&&this.originOf("title")!=="defaults"?t:this.url?O(this.url,z)||"KML":t}set title(t){this._set("title",t)}get visibleSublayers(){const t=this.sublayers,e=[],i=s=>{s.visible&&(e.push(s),s.sublayers&&s.sublayers.forEach(i))};return t&&t.forEach(i),e}get fullExtent(){return this._recomputeFullExtent()}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},t).catch(j).then(()=>this._fetchService(e))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(t){const e=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:w(this.url??"",this.outSpatialReference,this.refreshInterval,t)),i=E(e.data);i&&this.read(i,{origin:"service"})}_recomputeFullExtent(){let t=null;this.extent!=null&&(t=this.extent.clone());const e=i=>{if(i.sublayers)for(const s of i.sublayers.items)e(s),s.visible&&s.fullExtent&&(t!=null?t.union(s.fullExtent):t=s.fullExtent.clone())};return e(this),t}};r([l({readOnly:!0})],o.prototype,"allSublayers",void 0),r([l({type:g})],o.prototype,"outSpatialReference",void 0),r([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),r([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),r([l({type:["show","hide","hide-children"]})],o.prototype,"listMode",void 0),r([l({type:["KML"]})],o.prototype,"operationalLayerType",void 0),r([l({})],o.prototype,"resourceInfo",void 0),r([l({type:m.ofType(x),json:{write:{ignoreOrigin:!0}}})],o.prototype,"sublayers",void 0),r([h(["web-map","portal-item"],"sublayers",["visibleFolders"])],o.prototype,"readSublayersFromItemOrWebMap",null),r([h("service","sublayers",["sublayers"])],o.prototype,"readSublayers",null),r([M("sublayers")],o.prototype,"writeSublayers",null),r([l({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),r([l({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],o.prototype,"title",null),r([l(W)],o.prototype,"url",void 0),r([l({readOnly:!0})],o.prototype,"visibleSublayers",null),r([l({type:d})],o.prototype,"extent",void 0),r([l()],o.prototype,"fullExtent",null),o=r([c("esri.layers.KMLLayer")],o);const Kt=o;export{Kt as default}; diff --git a/main/assets/KMLLayerView2D-hWgNYT5J-CetUHy5g.js b/main/assets/KMLLayerView2D-hWgNYT5J-CetUHy5g.js deleted file mode 100644 index 7507087af..000000000 --- a/main/assets/KMLLayerView2D-hWgNYT5J-CetUHy5g.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as B,ah as W,aW as $,aA as S,n as k,J as U,cL as z,u as A,X as O,v,S as C,i as N,w as E,f as X}from"./main-BZaw9FpY.js";import{W as H,K as T}from"./projection-BA9M1R7d-DoNqITCd.js";import{L as D,j as K,T as J}from"./kmlUtils-C5oIEoOy-CLmxrxRw.js";import{y as Y}from"./utils-9sQxfkoa-Cus_qP6M.js";import{o as P}from"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import{I as Q,p as Z,x as tt}from"./Bitmap-CcqmzvfR-Cl_blWW9.js";import{d as it}from"./BitmapContainer-BC8fvmFc-DzZ9OrT1.js";import{X as et,Y as rt}from"./LayerView-Bish-E63-DRGspiuk.js";import{d as M}from"./GraphicContainer-DuOHUciE-BvzcbTDZ.js";import{X as R}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import{W as at,K as st}from"./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js";import{F as ot}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{U as nt,p as lt}from"./RenderingContext-DbCVbtGZ-hbunXxQg.js";import{G as L,U as pt,F as mt,X as q}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as ht}from"./Program-DLVwTiPA-DUDrdGpa.js";import{M as ct}from"./rasterUtils-DqAu9qES-Bysf-lKe.js";import{H as j,V as dt}from"./Texture-BCt2hphT-D-X9O5uh.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./webglDeps-Bgavuh0h-C76lWx0y.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-C4elE3ip.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";class m{constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(m._instance)return m._instanceRefCount++,m._instance;m._instanceRefCount=1,m._instance=this,this._ownsRctx=!0;const e=document.createElement("canvas").getContext("webgl2");e.getExtension("OES_texture_float"),this._rctx=new nt(e,{})}const r={applyProjection:!0,bilinear:!1,bicubic:!1},s=lt("raster/reproject","raster/reproject",new Map([["a_position",0]]),r);this._program=this._rctx.programCache.acquire(s.shaders.vertexShader,s.shaders.fragmentShader,s.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new ot(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,r,s=!1){const e=T(t.extent,r),a=new E({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:l,y:p}=at(a,r,t.extent);let o=(l+p)/2;const n=Math.round((e.xmax-e.xmin)/o),u=Math.round((e.ymax-e.ymin)/o);o=(e.width/n+e.height/u)/2;const I=new E({x:o,y:o,spatialReference:e.spatialReference}),g=st({projectedExtent:e,srcBufferExtent:t.extent,pixelSize:I,hasWrapAround:!0,spacing:[16,16]}),w=ct(this._rctx,g),y=new j(n,u);y.wrapMode=L.CLAMP_TO_EDGE;const h=new ht(this._rctx,y);this._rctx.bindFramebuffer(h),this._rctx.setViewport(0,0,n,u),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(w,1),this._quad.bind();const{width:x=0,height:f=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",x,f),this._program.setUniform2fv("u_transformSpacing",g.spacing),this._program.setUniform2fv("u_transformGridSize",g.size),this._program.setUniform2f("u_targetImageSize",n,u),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),w.dispose(),s){const{width:c,height:V}=h,_=new ImageData(c??0,V??0);h.readPixels(0,0,c??0,V??0,pt.RGBA,mt.UNSIGNED_BYTE,_.data);const F=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:F,extent:e,imageData:_}}const b=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:b,extent:e}}reprojectBitmapData(t,r){const s=Z(t.bitmapData)?tt(t.bitmapData):t.bitmapData,e=new j;e.wrapMode=L.CLAMP_TO_EDGE,e.width=t.bitmapData.width,e.height=t.bitmapData.height;const a=new dt(this._rctx,e,s),l=this.reprojectTexture({texture:a,extent:t.extent},r,!0);l.texture.dispose();const p=document.createElement("canvas"),o=l.imageData;return p.width=o.width,p.height=o.height,p.getContext("2d").putImageData(o,0,0),{bitmapData:p,extent:l.extent}}async loadAndReprojectBitmapData(t,r,s){const e=(await X(t,{responseType:"image"})).data,a=document.createElement("canvas");a.width=e.width,a.height=e.height;const l=a.getContext("2d");l.drawImage(e,0,0);const p=l.getImageData(0,0,a.width,a.height);if(r.spatialReference.equals(s))return{bitmapData:p,extent:r};const o=this.reprojectBitmapData({bitmapData:p,extent:r},s);return{bitmapData:o.bitmapData,extent:o.extent}}destroy(){this._ownsRctx?(m._instanceRefCount--,m._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),m._instance=null)):(this._quad.dispose(),this._program.dispose())}}m._instanceRefCount=0;class G{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends et(rt){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new it,this._kmlVisualData=new G,this._fetchController=null,this.allVisiblePoints=new P,this.allVisiblePolylines=new P,this.allVisiblePolygons=new P,this.allVisibleMapImages=new B}async hitTest(i,t){const r=this.layer;return[this._pointsView?.hitTest(i),this._polylinesView?.hitTest(i),this._polygonsView?.hitTest(i)].flat().filter(Boolean).map(s=>(s.layer=r,s.sourceLayer=r,{type:"graphic",graphic:s,layer:r,mapPoint:i}))}update(i){this._polygonsView&&this._polygonsView.processUpdate(i),this._polylinesView&&this._polylinesView.processUpdate(i),this._pointsView&&this._pointsView.processUpdate(i)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new R({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",i=>{i.added.forEach(t=>this._addMapImage(t)),i.removed.forEach(t=>this._removeMapImage(t))}),W(()=>this.layer.visibleSublayers,i=>{for(const t of this._kmlVisualData.allSublayers.values())t.visibility=0;for(const t of i){const r=this._kmlVisualData.allSublayers.get(t.id);r&&(r.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new m}detach(){this._fetchController=$(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=S(this._polygonsView),this._polylinesView=S(this._polylinesView),this._pointsView=S(this._pointsView),this._imageReprojector=S(this._imageReprojector)}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(i){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(i.href,k.fromJSON(i.extent),this.view.spatialReference).then(t=>{const r=new Q(t.bitmapData);r.x=t.extent.xmin,r.y=t.extent.ymax,r.resolution=t.extent.width/t.bitmapData.width,r.rotation=i.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(i,r)})}async _getViewDependentUrl(i,t){const{viewFormat:r,viewBoundScale:s,httpQuery:e}=i;if(r!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let a;if(await H(),s!=null&&s!==1){const c=new k(t.extent);c.expand(s),a=c}else a=t.extent;a=T(a,U.WGS84);const l=T(a,U.WebMercator),p=a.xmin,o=a.xmax,n=a.ymin,u=a.ymax,I=t.size[0]*t.pixelRatio,g=t.size[1]*t.pixelRatio,w=Math.max(l.width,l.height),y={"[bboxWest]":p.toString(),"[bboxEast]":o.toString(),"[bboxSouth]":n.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":w.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":w.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":I.toString(),"[vertPixels]":g.toString(),"[terrainEnabled]":"0","[clientVersion]":z,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},h=c=>{for(const V in c){let _;for(_ in y)c[V]=c[V].replace(_,y[_])}},x=A(r);h(x);let f={};e!=null&&(f=A(e),h(f));const b=Y(i.href);return b.query={...b.query,...x,...f},`${b.path}?${O(x)}`}return i.href}async _fetchService(i){const t=new G;await this._loadVisualData(this.layer.url,t,i),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i))}_isSublayerVisible(i){const t=this._kmlVisualData.allSublayers.get(i);return!!t?.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(i,t,r){return this._fetchParsedKML(i,r).then(async s=>{for(const e of s.sublayers){t.allSublayers.set(e.id,e);const a=e.points?await D(e.points):[],l=e.polylines?await D(e.polylines):[],p=e.polygons?await D(e.polygons):[],o=e.mapImages||[];if(t.allPoints.push(...a.map(n=>({item:n,sublayerId:e.id}))),t.allPolylines.push(...l.map(n=>({item:n,sublayerId:e.id}))),t.allPolygons.push(...p.map(n=>({item:n,sublayerId:e.id}))),t.allMapImages.push(...o.map(n=>({item:n,sublayerId:e.id}))),e.networkLink){const n=await this._getViewDependentUrl(e.networkLink,this.view.state);await this._loadVisualData(n,t,r)}}})}_fetchParsedKML(i,t){return K(i,this.layer.spatialReference,this.layer.refreshInterval,t).then(r=>J(r.data))}_removeMapImage(i){const t=this._bitmapIndex.get(i);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(i))}};v([C()],d.prototype,"_pointsView",void 0),v([C()],d.prototype,"_polylinesView",void 0),v([C()],d.prototype,"_polygonsView",void 0),v([C()],d.prototype,"updating",void 0),d=v([N("esri.views.2d.layers.KMLLayerView2D")],d);const Ae=d;export{Ae as default}; diff --git a/main/assets/KMLLayerView2D-hWgNYT5J-G6dB1WHu.js b/main/assets/KMLLayerView2D-hWgNYT5J-G6dB1WHu.js new file mode 100644 index 000000000..1603a1d53 --- /dev/null +++ b/main/assets/KMLLayerView2D-hWgNYT5J-G6dB1WHu.js @@ -0,0 +1 @@ +import{ag as B,ah as W,aW as $,aA as S,n as k,J as U,cL as z,u as A,X as O,v,S as C,i as N,w as E,f as X}from"./main-C7yV2j71.js";import{W as H,K as T}from"./projection-BA9M1R7d-DXrPfsKU.js";import{L as D,j as K,T as J}from"./kmlUtils-C5oIEoOy-CbWoF4Dn.js";import{y as Y}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{o as P}from"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import{I as Q,p as Z,x as tt}from"./Bitmap-CcqmzvfR-C92VuEM3.js";import{d as it}from"./BitmapContainer-BC8fvmFc-CH1ryNve.js";import{X as et,Y as rt}from"./LayerView-Bish-E63-I2LV0oDm.js";import{d as M}from"./GraphicContainer-DuOHUciE-dHT2kH0f.js";import{X as R}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import{W as at,K as st}from"./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js";import{F as ot}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{U as nt,p as lt}from"./RenderingContext-DbCVbtGZ-C1oa6nV0.js";import{G as L,U as pt,F as mt,X as q}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as ht}from"./Program-DLVwTiPA-CHQtoRqS.js";import{M as ct}from"./rasterUtils-DqAu9qES-DpmWvz0K.js";import{H as j,V as dt}from"./Texture-BCt2hphT-CtQVMDnp.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./webglDeps-Bgavuh0h-8J_tuBZH.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-n0h7HuaO.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";class m{constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(m._instance)return m._instanceRefCount++,m._instance;m._instanceRefCount=1,m._instance=this,this._ownsRctx=!0;const e=document.createElement("canvas").getContext("webgl2");e.getExtension("OES_texture_float"),this._rctx=new nt(e,{})}const r={applyProjection:!0,bilinear:!1,bicubic:!1},s=lt("raster/reproject","raster/reproject",new Map([["a_position",0]]),r);this._program=this._rctx.programCache.acquire(s.shaders.vertexShader,s.shaders.fragmentShader,s.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new ot(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,r,s=!1){const e=T(t.extent,r),a=new E({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:l,y:p}=at(a,r,t.extent);let o=(l+p)/2;const n=Math.round((e.xmax-e.xmin)/o),u=Math.round((e.ymax-e.ymin)/o);o=(e.width/n+e.height/u)/2;const I=new E({x:o,y:o,spatialReference:e.spatialReference}),g=st({projectedExtent:e,srcBufferExtent:t.extent,pixelSize:I,hasWrapAround:!0,spacing:[16,16]}),w=ct(this._rctx,g),y=new j(n,u);y.wrapMode=L.CLAMP_TO_EDGE;const h=new ht(this._rctx,y);this._rctx.bindFramebuffer(h),this._rctx.setViewport(0,0,n,u),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(w,1),this._quad.bind();const{width:x=0,height:f=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",x,f),this._program.setUniform2fv("u_transformSpacing",g.spacing),this._program.setUniform2fv("u_transformGridSize",g.size),this._program.setUniform2f("u_targetImageSize",n,u),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),w.dispose(),s){const{width:c,height:V}=h,_=new ImageData(c??0,V??0);h.readPixels(0,0,c??0,V??0,pt.RGBA,mt.UNSIGNED_BYTE,_.data);const F=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:F,extent:e,imageData:_}}const b=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:b,extent:e}}reprojectBitmapData(t,r){const s=Z(t.bitmapData)?tt(t.bitmapData):t.bitmapData,e=new j;e.wrapMode=L.CLAMP_TO_EDGE,e.width=t.bitmapData.width,e.height=t.bitmapData.height;const a=new dt(this._rctx,e,s),l=this.reprojectTexture({texture:a,extent:t.extent},r,!0);l.texture.dispose();const p=document.createElement("canvas"),o=l.imageData;return p.width=o.width,p.height=o.height,p.getContext("2d").putImageData(o,0,0),{bitmapData:p,extent:l.extent}}async loadAndReprojectBitmapData(t,r,s){const e=(await X(t,{responseType:"image"})).data,a=document.createElement("canvas");a.width=e.width,a.height=e.height;const l=a.getContext("2d");l.drawImage(e,0,0);const p=l.getImageData(0,0,a.width,a.height);if(r.spatialReference.equals(s))return{bitmapData:p,extent:r};const o=this.reprojectBitmapData({bitmapData:p,extent:r},s);return{bitmapData:o.bitmapData,extent:o.extent}}destroy(){this._ownsRctx?(m._instanceRefCount--,m._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),m._instance=null)):(this._quad.dispose(),this._program.dispose())}}m._instanceRefCount=0;class G{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends et(rt){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new it,this._kmlVisualData=new G,this._fetchController=null,this.allVisiblePoints=new P,this.allVisiblePolylines=new P,this.allVisiblePolygons=new P,this.allVisibleMapImages=new B}async hitTest(i,t){const r=this.layer;return[this._pointsView?.hitTest(i),this._polylinesView?.hitTest(i),this._polygonsView?.hitTest(i)].flat().filter(Boolean).map(s=>(s.layer=r,s.sourceLayer=r,{type:"graphic",graphic:s,layer:r,mapPoint:i}))}update(i){this._polygonsView&&this._polygonsView.processUpdate(i),this._polylinesView&&this._polylinesView.processUpdate(i),this._pointsView&&this._pointsView.processUpdate(i)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new R({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",i=>{i.added.forEach(t=>this._addMapImage(t)),i.removed.forEach(t=>this._removeMapImage(t))}),W(()=>this.layer.visibleSublayers,i=>{for(const t of this._kmlVisualData.allSublayers.values())t.visibility=0;for(const t of i){const r=this._kmlVisualData.allSublayers.get(t.id);r&&(r.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new m}detach(){this._fetchController=$(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=S(this._polygonsView),this._polylinesView=S(this._polylinesView),this._pointsView=S(this._pointsView),this._imageReprojector=S(this._imageReprojector)}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(i){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(i.href,k.fromJSON(i.extent),this.view.spatialReference).then(t=>{const r=new Q(t.bitmapData);r.x=t.extent.xmin,r.y=t.extent.ymax,r.resolution=t.extent.width/t.bitmapData.width,r.rotation=i.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(i,r)})}async _getViewDependentUrl(i,t){const{viewFormat:r,viewBoundScale:s,httpQuery:e}=i;if(r!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let a;if(await H(),s!=null&&s!==1){const c=new k(t.extent);c.expand(s),a=c}else a=t.extent;a=T(a,U.WGS84);const l=T(a,U.WebMercator),p=a.xmin,o=a.xmax,n=a.ymin,u=a.ymax,I=t.size[0]*t.pixelRatio,g=t.size[1]*t.pixelRatio,w=Math.max(l.width,l.height),y={"[bboxWest]":p.toString(),"[bboxEast]":o.toString(),"[bboxSouth]":n.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":w.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":w.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":I.toString(),"[vertPixels]":g.toString(),"[terrainEnabled]":"0","[clientVersion]":z,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},h=c=>{for(const V in c){let _;for(_ in y)c[V]=c[V].replace(_,y[_])}},x=A(r);h(x);let f={};e!=null&&(f=A(e),h(f));const b=Y(i.href);return b.query={...b.query,...x,...f},`${b.path}?${O(x)}`}return i.href}async _fetchService(i){const t=new G;await this._loadVisualData(this.layer.url,t,i),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i))}_isSublayerVisible(i){const t=this._kmlVisualData.allSublayers.get(i);return!!t?.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(i,t,r){return this._fetchParsedKML(i,r).then(async s=>{for(const e of s.sublayers){t.allSublayers.set(e.id,e);const a=e.points?await D(e.points):[],l=e.polylines?await D(e.polylines):[],p=e.polygons?await D(e.polygons):[],o=e.mapImages||[];if(t.allPoints.push(...a.map(n=>({item:n,sublayerId:e.id}))),t.allPolylines.push(...l.map(n=>({item:n,sublayerId:e.id}))),t.allPolygons.push(...p.map(n=>({item:n,sublayerId:e.id}))),t.allMapImages.push(...o.map(n=>({item:n,sublayerId:e.id}))),e.networkLink){const n=await this._getViewDependentUrl(e.networkLink,this.view.state);await this._loadVisualData(n,t,r)}}})}_fetchParsedKML(i,t){return K(i,this.layer.spatialReference,this.layer.refreshInterval,t).then(r=>J(r.data))}_removeMapImage(i){const t=this._bitmapIndex.get(i);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(i))}};v([C()],d.prototype,"_pointsView",void 0),v([C()],d.prototype,"_polylinesView",void 0),v([C()],d.prototype,"_polygonsView",void 0),v([C()],d.prototype,"updating",void 0),d=v([N("esri.views.2d.layers.KMLLayerView2D")],d);const Ae=d;export{Ae as default}; diff --git a/main/assets/KnowledgeGraphLayer-BjNFJGLf-DsV8zTWJ.js b/main/assets/KnowledgeGraphLayer-BjNFJGLf-DsV8zTWJ.js deleted file mode 100644 index 8d3f3493d..000000000 --- a/main/assets/KnowledgeGraphLayer-BjNFJGLf-DsV8zTWJ.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as m,ah as M,av as T,W as _,o as g,bP as l,bY as S,a1 as c,a4 as D,bO as L,ez as b,d8 as v,an as A,v as s,S as n,a0 as E,ac as C,i as N,bX as k}from"./main-BZaw9FpY.js";import{m as I}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{r as R}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{D as G}from"./Layer-ChoECxvZ-C4wLrCej.js";import{t as d,B as w,A as O,V as U,Y as $}from"./KnowledgeGraphSublayer-DPj4igi1-DI2RO5d6.js";import{a as z}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as F}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as P}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as j}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as K}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as x}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as Y}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{Z as B}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{F as H}from"./knowledgeGraphService-DOJz0fzA-6E_aD1T8.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-DPu3VSRE.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./FeatureStore-Co2V0sVE-CXrTGv5U.js";import"./BoundsStore--N6o1xkF-DBAJ8yky.js";import"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";import"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./signal-CETehA7D-vStzfbaY.js";import"./clientSideDefaults-BqqayPct-BMC57bnT.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";let r=class extends F(Y(x(z(j(K(I(P(G)))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(m.ofType(d)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(m.ofType(d)),this.type="knowledge-graph",this.url=null,this.addHandles(M(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),T))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(t){_(t)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),await w(this)}async _fetchMetadata(){if(!this.url)throw new g("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await H(this.url);this.knowledgeGraph=e,this._forEachGraphType(t=>{t.name&&this._graphTypeLookup.set(t.name,t)})}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===l.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new O({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await U(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",e,S(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((i,o)=>{const a=this._graphTypeLookup.get(o);if(!a)return c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(o);a.type!=="relationship"&&a.type!=="entity"&&(c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(o))});else if(!e.generateAllSublayers)throw new g("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,o=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):o&&o.size>0&&o.forEach((a,h)=>{const p=this._graphTypeLookup.get(h);switch(p?.type){case"relationship":t.push(p);break;case"entity":e.push(p)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const o=this._graphTypeLookup.get(i);o&&(this._addSublayer(o),o.type==="entity"?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),this.dataManager.sublayerCaches.set(i,new Map))}await w(this,t),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(o=>{const a=this._createSublayer(o);i(a)&&t.push(a),this._updateSublayerCaches(o)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new d({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const o=e.find(a=>a.type===i.graphType&&a.name===i.graphTypeName);o&&(i.objectType=o,this._updateSublayerCaches(o))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_saveUrlAsNewResource(e,t,i,o){e[t]="",i.pendingOperations.push(V(this.inclusionModeDefinition).then(a=>{const h=Z(o);e[t]=h.itemRelativeUrl,i.toAdd.push({resource:h,content:{type:"blob",blob:a},compress:!1,finish:p=>{this.definitionSetMap=p.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}readDefinitionSetMap(e,t,i){return D(e,i)}writeDefinitionSetMap(e,t,i,o){const a=o?.portalItem,h=o?.resources,p=L(o?.origin);if(!a||!h||p==null)return void(e&&(t[i]=b(e,o)));const{inclusionModeDefinition:u}=this;if(!u||this._displaysAllRecords(u))return void(this.definitionSetMap=null);const y=this.originIdOf("inclusionModeDefinition");if(y===l.USER||this._namedTypesModified||p!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===l.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const o=A(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(a=>{o.add(a.id)})})}async addRecords(e){await this._handleNewRecords(e)}async removeRecords(e){const t=[];for(const i of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const i of t)this.sublayerIdsCache.get(i.typeName)?.delete(i.id);return this._refreshNamedTypes(),t}};s([n()],r.prototype,"dataManager",void 0),s([n({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],r.prototype,"definitionSetMap",void 0),s([E("definitionSetMap")],r.prototype,"readDefinitionSetMap",null),s([C("definitionSetMap")],r.prototype,"writeDefinitionSetMap",null),s([n()],r.prototype,"inclusionModeDefinition",null),s([n()],r.prototype,"knowledgeGraph",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([n()],r.prototype,"memberEntityTypes",void 0),s([n()],r.prototype,"memberRelationshipTypes",void 0),s([n({type:["KnowledgeGraphLayer"]})],r.prototype,"operationalLayerType",void 0),s([n()],r.prototype,"sublayerIdsCache",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"tables",void 0),s([n({json:{read:!1}})],r.prototype,"type",void 0),s([n(B)],r.prototype,"url",void 0),r=s([N("esri.layers.KnowledgeGraphLayer")],r);const xt=r;async function V(e){const t=await $(e);return new Blob([t],{type:"application/x-protobuf"})}function Z(e){const t=`definitionSetMap-${R()}.dat`,i=k("knowledgeGraphLayer",t);return e.resourceFromPath(i)}export{xt as default}; diff --git a/main/assets/KnowledgeGraphLayer-BjNFJGLf-uaXruRWF.js b/main/assets/KnowledgeGraphLayer-BjNFJGLf-uaXruRWF.js new file mode 100644 index 000000000..c238c8b6f --- /dev/null +++ b/main/assets/KnowledgeGraphLayer-BjNFJGLf-uaXruRWF.js @@ -0,0 +1 @@ +import{ag as m,ah as M,av as T,W as _,o as g,bP as l,bY as S,a1 as c,a4 as D,bO as L,ez as b,d8 as v,an as A,v as s,S as n,a0 as E,ac as C,i as N,bX as k}from"./main-C7yV2j71.js";import{m as I}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{r as R}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{D as G}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{t as d,B as w,A as O,V as U,Y as $}from"./KnowledgeGraphSublayer-DPj4igi1-DXaAi0X5.js";import{a as z}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as F}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as P}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as j}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as K}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as x}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as Y}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{Z as B}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{F as H}from"./knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./GraphicsLayer-DfeGaYc1-DAZy-iUY.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-DnaxtAbX.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./FeatureStore-Co2V0sVE-BoTs_3tu.js";import"./BoundsStore--N6o1xkF-mEMXylgh.js";import"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";import"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./signal-CETehA7D-DxK1orqE.js";import"./clientSideDefaults-BqqayPct-B0cLE-po.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";let r=class extends F(Y(x(z(j(K(I(P(G)))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(m.ofType(d)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(m.ofType(d)),this.type="knowledge-graph",this.url=null,this.addHandles(M(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),T))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(t){_(t)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),await w(this)}async _fetchMetadata(){if(!this.url)throw new g("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await H(this.url);this.knowledgeGraph=e,this._forEachGraphType(t=>{t.name&&this._graphTypeLookup.set(t.name,t)})}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===l.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new O({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await U(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",e,S(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((i,o)=>{const a=this._graphTypeLookup.get(o);if(!a)return c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(o);a.type!=="relationship"&&a.type!=="entity"&&(c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(o))});else if(!e.generateAllSublayers)throw new g("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,o=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):o&&o.size>0&&o.forEach((a,h)=>{const p=this._graphTypeLookup.get(h);switch(p?.type){case"relationship":t.push(p);break;case"entity":e.push(p)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const o=this._graphTypeLookup.get(i);o&&(this._addSublayer(o),o.type==="entity"?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),this.dataManager.sublayerCaches.set(i,new Map))}await w(this,t),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(o=>{const a=this._createSublayer(o);i(a)&&t.push(a),this._updateSublayerCaches(o)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new d({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const o=e.find(a=>a.type===i.graphType&&a.name===i.graphTypeName);o&&(i.objectType=o,this._updateSublayerCaches(o))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_saveUrlAsNewResource(e,t,i,o){e[t]="",i.pendingOperations.push(V(this.inclusionModeDefinition).then(a=>{const h=Z(o);e[t]=h.itemRelativeUrl,i.toAdd.push({resource:h,content:{type:"blob",blob:a},compress:!1,finish:p=>{this.definitionSetMap=p.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}readDefinitionSetMap(e,t,i){return D(e,i)}writeDefinitionSetMap(e,t,i,o){const a=o?.portalItem,h=o?.resources,p=L(o?.origin);if(!a||!h||p==null)return void(e&&(t[i]=b(e,o)));const{inclusionModeDefinition:u}=this;if(!u||this._displaysAllRecords(u))return void(this.definitionSetMap=null);const y=this.originIdOf("inclusionModeDefinition");if(y===l.USER||this._namedTypesModified||p!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===l.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const o=A(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(a=>{o.add(a.id)})})}async addRecords(e){await this._handleNewRecords(e)}async removeRecords(e){const t=[];for(const i of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const i of t)this.sublayerIdsCache.get(i.typeName)?.delete(i.id);return this._refreshNamedTypes(),t}};s([n()],r.prototype,"dataManager",void 0),s([n({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],r.prototype,"definitionSetMap",void 0),s([E("definitionSetMap")],r.prototype,"readDefinitionSetMap",null),s([C("definitionSetMap")],r.prototype,"writeDefinitionSetMap",null),s([n()],r.prototype,"inclusionModeDefinition",null),s([n()],r.prototype,"knowledgeGraph",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([n()],r.prototype,"memberEntityTypes",void 0),s([n()],r.prototype,"memberRelationshipTypes",void 0),s([n({type:["KnowledgeGraphLayer"]})],r.prototype,"operationalLayerType",void 0),s([n()],r.prototype,"sublayerIdsCache",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"tables",void 0),s([n({json:{read:!1}})],r.prototype,"type",void 0),s([n(B)],r.prototype,"url",void 0),r=s([N("esri.layers.KnowledgeGraphLayer")],r);const xt=r;async function V(e){const t=await $(e);return new Blob([t],{type:"application/x-protobuf"})}function Z(e){const t=`definitionSetMap-${R()}.dat`,i=k("knowledgeGraphLayer",t);return e.resourceFromPath(i)}export{xt as default}; diff --git a/main/assets/KnowledgeGraphLayerView2D-BnEbgXue-BMJK-YHI.js b/main/assets/KnowledgeGraphLayerView2D-BnEbgXue-BMJK-YHI.js deleted file mode 100644 index 5054312a6..000000000 --- a/main/assets/KnowledgeGraphLayerView2D-BnEbgXue-BMJK-YHI.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as p,am as m,v as o,S as e,eb as a,i as s}from"./main-BZaw9FpY.js";import{X as l,Y as n}from"./LayerView-Bish-E63-DRGspiuk.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";let r=class extends l(n){constructor(t){super(t),this.layerViews=new p}set layerViews(t){this._set("layerViews",m(t,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((t,i)=>t+i.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(t){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((t,i)=>this.container.addChildAt(t.container,i))}};o([e({cast:a})],r.prototype,"layerViews",null),o([e({readOnly:!0})],r.prototype,"updatingProgress",null),r=o([s("esri.views.2d.layers.KnowledgeGraphLayerView2D")],r);const yt=r;export{yt as default}; diff --git a/main/assets/KnowledgeGraphLayerView2D-BnEbgXue-DTGORV5F.js b/main/assets/KnowledgeGraphLayerView2D-BnEbgXue-DTGORV5F.js new file mode 100644 index 000000000..ab70aeaf2 --- /dev/null +++ b/main/assets/KnowledgeGraphLayerView2D-BnEbgXue-DTGORV5F.js @@ -0,0 +1 @@ +import{ag as p,am as m,v as o,S as e,eb as a,i as s}from"./main-C7yV2j71.js";import{X as l,Y as n}from"./LayerView-Bish-E63-I2LV0oDm.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";let r=class extends l(n){constructor(t){super(t),this.layerViews=new p}set layerViews(t){this._set("layerViews",m(t,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((t,i)=>t+i.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(t){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((t,i)=>this.container.addChildAt(t.container,i))}};o([e({cast:a})],r.prototype,"layerViews",null),o([e({readOnly:!0})],r.prototype,"updatingProgress",null),r=o([s("esri.views.2d.layers.KnowledgeGraphLayerView2D")],r);const yt=r;export{yt as default}; diff --git a/main/assets/KnowledgeGraphSublayer-DPj4igi1-DI2RO5d6.js b/main/assets/KnowledgeGraphSublayer-DPj4igi1-DI2RO5d6.js deleted file mode 100644 index bcfb75ebe..000000000 --- a/main/assets/KnowledgeGraphSublayer-DPj4igi1-DI2RO5d6.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lclayout-CcimkDVq-BWqQJHW2.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{v as d,S as c,i as he,bW as G,bT as Ve,J as We,n as ne,em as ze,ft as F,l as Ge,m as Ze,w as Ke,P as C,bL as Xe,ac as et,_ as tt,bw as it,o as q,f as nt,an as j,j as rt,a1 as X,eM as ge,bP as ot,g as at}from"./main-BZaw9FpY.js";import{N as ue,K as ie}from"./projection-BA9M1R7d-DoNqITCd.js";import{z as st}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{i as Te}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js";import{M as U,r as Ue,W as lt}from"./knowledgeGraphService-DOJz0fzA-6E_aD1T8.js";import{j as P}from"./Relationship-Db9GUmYx-DPu3VSRE.js";import{b as Q}from"./Query-BrwMGK8U-sojFdYaD.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{t as le,m as pt}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as dt}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{d as yt}from"./workers-PiCjreoO-oGzLvkSt.js";import{D as ut}from"./Layer-ChoECxvZ-C4wLrCej.js";import{I as ct}from"./FeatureStore-Co2V0sVE-CXrTGv5U.js";import{Z as mt}from"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import{$ as ht,d as pe}from"./clientSideDefaults-BqqayPct-BMC57bnT.js";import{f as ft}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{u as gt,o as Tt,a as bt}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{l as wt,s as Et}from"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import{v as It,X as Nt}from"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import{p as Lt,d as Dt}from"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import{T as _t}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as Mt}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as Rt,m as St}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{Y as vt,_ as Ct,n as kt,t as At,E as Ot,X as xt}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{y as ee}from"./Field-C6hA1tZj-CbELM0zp.js";import{C as jt,q as Ft}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{w as qt}from"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import{O as $t}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{w as Pt}from"./popupUtils-B0uZcXX0-BqljON9c.js";const x="ESRI__ID",ce="ESRI__OriginID",me="ESRI__DestID",Qe="ESRI__LayoutGeometry",be="ESRI__AggregationCount",z="LC.ESRI__IsSpatial",Bt={initializeLayersFromClientData:async(e,t)=>{if(t||(t=[...e.layers,...e.tables].map(o=>o.graphTypeName)),t?.length===0)return;const n=new Map;for(const o of t)n.set(o,we(e,o));const i=await lt(e.dataManager.knowledgeGraph,Array.from(n.values()));for(const o of[...e.layers,...e.tables]){const r=o.objectType.name;if(r===null)continue;const s=i.get(we(e,r));if(s){const p=JSON.parse(s);p===null||typeof p!="object"||p.hasOwnProperty("showLabels")||(p.showLabels=!1),o.read(p,{origin:"service"})}}}},we=(e,t)=>e.type==="knowledge-graph"?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function Mi(e,t){return Bt.initializeLayersFromClientData(e,t)}let de=class B{constructor(){this._featureLookup=new Map}static getInstance(){return B.instance||(B.instance=new B),B.instance}static resetInstance(){B.instance&&(B.instance=null)}deleteFromStore(t){t.forEach(n=>{this._featureLookup.delete(n)})}readFromStoreByList(t){const n=[];return t.forEach(i=>{const o=this.readFromStoreById(i);o&&n.push(o)}),n}readFromStoreById(t){return this._featureLookup.get(t)??null}writeToStore(t,n,i){const o=[];return t.forEach(r=>{if(!r?.id)return;r.properties||(r.properties=[]);let s,p=null;if(i&&r.properties[i]&&(p=st(r.properties[i])),"originId"in r&&"destinationId"in r&&(r.properties[ce]=r.originId,r.properties[me]=r.destinationId),r.properties[n]=r.id,r.id&&this._featureLookup.has(r.id)&&this._featureLookup.get(r.id).attributes){const a=this._featureLookup.get(r.id),l=JSON.parse(JSON.stringify(Object.assign(a.attributes,r.properties)));i&&r.properties[i]&&(l[i]=at(r.properties[i])),s=new Te(p?JSON.parse(JSON.stringify(p)):a?.geometry?JSON.parse(JSON.stringify(a.geometry)):null,l,null,r.properties[n])}else s=new Te(p?JSON.parse(JSON.stringify(p)):null,r.properties,null,r.properties[n]);this._featureLookup.set(`${r.typeName?`${r.typeName}__${r.id}`:r.id}`,s),o.push(s)}),o}},ye,E=null;function Ri(){return ye||(ye=tt(()=>import("./lclayout-CcimkDVq-BWqQJHW2.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>it(`esri/libs/linkchartlayout/${t}`)})).then(e=>{Gt(e)}),ye)}function Gt(e){E=e}var Ee,Ie,Z,K;function Ut(e){const t=Object.keys(Z).filter(i=>isNaN(parseInt(i,10))).indexOf(e.timeDirection),n=Object.keys(K).filter(i=>isNaN(parseInt(i,10))).indexOf(e.eventsTicksVisualization);return{timeDirection:{value:t>-1?t:Z.right},timeBannerUTCOffsetInMinutes:e.timeBannerUTCOffsetInMinutes,eventsTicksVisualization:{value:n>-1?n:K.startAndEnd},showDurationLineForNonZeroDurationEntityEvents:e.showDurationLineForNonZeroDurationEntityEvents,durationLineWidth:e.durationLineWidth,entityPositionAtDurationRatio:e.entityPositionAtDurationRatio,showNonZeroDurationIntervalBounds:e.showNonZeroDurationIntervalBounds,separateTimeOverlaps:e.separateTimeOverlaps,separateTimelineOverlaps:e.separateTimelineOverlaps,moveFirstBends:e.moveFirstBends,secondBendRatio:e.secondBendRatio,lineSeparationMultiplier:e.lineSeparationMultiplier,spaceSeparatedLinesEvenly:e.spaceSeparatedLinesEvenly,useBezierCurves:e.useBezierCurves,separatedLineShapeRatio:e.separatedLineShapeRatio}}function $(e,t,n,i,o,r){const s=n.length,p=o.length,a=Float64Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,h=Uint8Array.BYTES_PER_ELEMENT,g=16,y=g+s*(h+2*a)+p*(2*l),b=E._malloc(y);try{const T=b+g-b%g,u=T+s*a,D=u+s*a,L=D+p*l,w=L+p*l,N=()=>[E.HEAPF64.subarray(T>>3,(T>>3)+s),E.HEAPF64.subarray(u>>3,(u>>3)+s),E.HEAPU32.subarray(D>>2,(D>>2)+p),E.HEAPU32.subarray(L>>2,(L>>2)+p),E.HEAPU8.subarray(w,w+s)],[_,I,m,M,R]=N();_.set(n),I.set(i),m.set(o),M.set(r),R.set(t);let S=e(s,w,T,u,p,D,L),A=null,v=null;if(S){const oe=E.getLayoutLinksTypes(),ae=E.getLayoutLinksVerticesEndIndices(),se=E.getLayoutLinksVertices(),fe=E.countLayoutLinksVertices();!p||oe&&ae?fe&&!se?S=!1:(A={types:new Uint8Array(E.HEAPU8.subarray(oe,oe+p)),vertexEndIndex:new Uint32Array(E.HEAPU32.subarray(ae>>2,(ae>>2)+p)),vertices:new Float64Array(E.HEAPF64.subarray(se>>3,(se>>3)+2*fe))},v=E.getAuxiliaryGraphicElements()):S=!1}const[J,Y,V,re,Ye]=N();return n.set(J),i.set(Y),o.set(V),r.set(re),t.set(Ye),{success:S,links:A,graphics:v}}finally{E._free(b),E.cleanupLayout()}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot",e[e.IsOld=8]="IsOld"})(Ee||(Ee={})),function(e){e[e.Regular=0]="Regular",e[e.Curved=1]="Curved",e[e.Recursive=2]="Recursive"}(Ie||(Ie={})),function(e){e[e.right=0]="right",e[e.left=1]="left",e[e.top=2]="top",e[e.bottom=3]="bottom"}(Z||(Z={})),function(e){e[e.none=0]="none",e[e.startOnly=1]="startOnly",e[e.startAndEnd=2]="startAndEnd"}(K||(K={}));const Ne=2,Le=1,De=-1;var _e,Me,Re,Se,ve,Ce,ke,Ae,Oe;(function(e){function t(){return E.getMinIdealEdgeLength()}function n(i,o,r,s,p,a=Ne,l=Le,h=De){return $((g,y,b,T,u,D,L)=>E.applyForceDirectedLayout(g,y,b,T,u,D,L,a,l,h),i,o,r,s,p)}e.getMinIdealEdgeLength=t,e.apply=n})(_e||(_e={})),function(e){function t(n,i,o,r,s,p=Ne,a=Le,l=De){return $((h,g,y,b,T,u,D)=>E.applyCommunityLayout(h,g,y,b,T,u,D,p,a,l),n,i,o,r,s)}e.apply=t}(Me||(Me={})),function(e){function t(n,i,o,r,s){return $(E.applySimpleLayout,n,i,o,r,s)}e.apply=t}(Re||(Re={})),function(e){function t(n,i,o,r,s){return $(E.applyHierarchicalLayout,n,i,o,r,s)}e.apply=t}(Se||(Se={})),function(e){function t(n,i,o,r,s){return $(E.applyRadialTreeLayout,n,i,o,r,s)}e.apply=t}(ve||(ve={})),function(e){function t(n,i,o,r,s){return $(E.applySmartTreeLayout,n,i,o,r,s)}e.apply=t}(Ce||(Ce={})),function(e){function t(n,i,o,r,s,p,a,l,h,g,y){const b={timeDirection:Z.right,timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:K.startAndEnd,showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0};return $((T,u,D,L,w,N,_)=>{if(r.length!==T||s.length!==T||l.length!==w||h.length!==w)return!1;const I=Float64Array.BYTES_PER_ELEMENT,m=16,M=E._malloc(m+T*I),R=E._malloc(m+T*I),S=E._malloc(m+w*I),A=E._malloc(m+w*I),v=M+m-M%m,J=R+m-R%m,Y=S+m-S%m,V=A+m-A%m;try{E.HEAPF64.subarray(v>>3,(v>>3)+T).set(r),E.HEAPF64.subarray(J>>3,(J>>3)+T).set(s),E.HEAPF64.subarray(Y>>3,(Y>>3)+w).set(l),E.HEAPF64.subarray(V>>3,(V>>3)+w).set(h);const re=Ut(Object.assign(b,y));return E.applyChronologicalLayout(T,u,D,L,v,J,w,N,_,Y,V,g,re)}finally{E._free(M),E._free(R),E._free(S),E._free(A)}},n,i,o,p,a)}e.apply=t}(ke||(ke={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Ae||(Ae={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Oe||(Oe={}));var te;(function(e){e.ELEMENTUID="ELEMENTUID",e.TYPENAME="TYPENAME"})(te||(te={})),te.ELEMENTUID,te.TYPENAME;var xe,je;(function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME"})(xe||(xe={})),function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME",e[e.FROMUID=2]="FROMUID",e[e.TOUID=3]="TOUID"}(je||(je={}));var Fe,qe,$e,H;(function(e){e[e.featureResult=0]="featureResult",e[e.countResult=1]="countResult",e[e.idsResult=2]="idsResult"})(Fe||(Fe={})),function(e){e[e.upperLeft=0]="upperLeft",e[e.lowerLeft=1]="lowerLeft"}(qe||(qe={})),function(e){e[e.sqlTypeBigInt=0]="sqlTypeBigInt",e[e.sqlTypeBinary=1]="sqlTypeBinary",e[e.sqlTypeBit=2]="sqlTypeBit",e[e.sqlTypeChar=3]="sqlTypeChar",e[e.sqlTypeDate=4]="sqlTypeDate",e[e.sqlTypeDecimal=5]="sqlTypeDecimal",e[e.sqlTypeDouble=6]="sqlTypeDouble",e[e.sqlTypeFloat=7]="sqlTypeFloat",e[e.sqlTypeGeometry=8]="sqlTypeGeometry",e[e.sqlTypeGUID=9]="sqlTypeGUID",e[e.sqlTypeInteger=10]="sqlTypeInteger",e[e.sqlTypeLongNVarchar=11]="sqlTypeLongNVarchar",e[e.sqlTypeLongVarbinary=12]="sqlTypeLongVarbinary",e[e.sqlTypeLongVarchar=13]="sqlTypeLongVarchar",e[e.sqlTypeNChar=14]="sqlTypeNChar",e[e.sqlTypeNVarChar=15]="sqlTypeNVarChar",e[e.sqlTypeOther=16]="sqlTypeOther",e[e.sqlTypeReal=17]="sqlTypeReal",e[e.sqlTypeSmallInt=18]="sqlTypeSmallInt",e[e.sqlTypeSqlXml=19]="sqlTypeSqlXml",e[e.sqlTypeTime=20]="sqlTypeTime",e[e.sqlTypeTimestamp=21]="sqlTypeTimestamp",e[e.sqlTypeTimestamp2=22]="sqlTypeTimestamp2",e[e.sqlTypeTinyInt=23]="sqlTypeTinyInt",e[e.sqlTypeVarbinary=24]="sqlTypeVarbinary",e[e.sqlTypeVarchar=25]="sqlTypeVarchar"}($e||($e={})),function(e){e[e.OID_ARRAY=0]="OID_ARRAY",e[e.GLOBALID_ARRAY=1]="GLOBALID_ARRAY",e[e.STRING_ARRAY=2]="STRING_ARRAY",e[e.IDENTIFIER_ARRAY=3]="IDENTIFIER_ARRAY"}(H||(H={}));function Qt(e){if(!e.spatialReference.isWGS84)throw new q("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map(t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]])}async function Si(e,t){const n=[],i=new Map,o=[];if(t.dataModel?.relationshipTypes)for(const r of t.dataModel.relationshipTypes)r.name&&i.set(r.name,[]);for(const r of e)i.has(r.typeName)&&i.get(r.typeName)?.push(r.id);for(const[r,s]of i){if(s.length<1)continue;const p=new P({openCypherQuery:`MATCH (n)-[r:${r}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:s}});o.push(U(t,p).then(async a=>{const l=a.resultRowsStream.getReader();for(;;){const{done:h,value:g}=await l.read();if(h)break;for(const y of g)n.push({id:y[0],typeName:y[1]}),n.push({id:y[2],typeName:y[3]})}}))}return await Promise.all(o),n}async function vi(e,t){t??=!1;const n={generateAllSublayers:t,namedTypeDefinitions:new Map};return await Jt(e).then(i=>{Vt(i,n)}),n}async function Ci(e){const t=await Ue(),n=new t.MapOfObjectIdentifierSets;Ht(n,t,e);const i=new t.MapOfObjectIdentifierSetsEncoder;try{i.set_map_of_identifier_sets(n),i.encode();const o=i.get_encoding_result();if(o.error.error_code!==0)throw new q("knowledge-graph:layer-support-utils",o.error.error_message);const r=structuredClone(o.get_byte_buffer());return i.delete(),r}finally{n.delete()}}function Ht(e,t,n){for(const[i,o]of n.namedTypeDefinitions){if(!o.members||o.useAllData)continue;const r=o.members.keys();let s=!1,p=!0;const a=new t.ObjectIdArray,l=new t.StringArray,h=new t.GlobalIdArray,g=new t.IdentifierArray,y=new t.ObjectIdentifierSet;for(const b of r)p&&(s=!isNaN(Number(b)),p=!1),s?a.add_objectid(Number(b)):(l.add_string(b),h.add_globalid(b)),g.add_identifier(b);y.set_oid_array(a),y.set_string_array(l),y.set_globalid_array(h),y.set_identifier_array(g),a.delete(),l.delete(),h.delete(),g.delete(),e.put_identifier_set(i,y),y.delete()}return e}async function Jt(e){const t=await nt(e,{responseType:"array-buffer"}),n=await t.data;return Yt(new Uint8Array(n))}async function Yt(e){const t=new(await Ue()).MapOfObjectIdentifierSetsDecoder,n=t.decode(new Uint8Array(e)),i=new Map;if(n.error_code!==0)throw new q("knowledge-graph:layer-support-utils",n.error_message);const o=t.get_map_of_identifier_sets(),r=o.keys,s=r.size();for(let p=0;p({useAllData:!1,members:new Map}));for(const r of i)o.members.has(r)||o.members.set(r,{id:r})}return t}let O=class extends rt{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(n=>{n.name&&(t.set(n.name,"entity"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(n=>{n.name&&(t.set(n.name,"relationship"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,i)=>{if(t.get(i)==="entity")this.entityTypeNames.add(i);else{if(t.get(i)!=="relationship")return X.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(i);this.relationshipTypeNames.add(i)}const o=new Map;n.members?.forEach(r=>{j(this.memberIdTypeLookup,r.id,()=>new Set).add(i);const s=this.getById(r.id);s&&o.set(r.id,s)}),this.sublayerCaches.set(i,o)})}addToLayer(e){e.forEach(({typeName:t,id:n})=>{if(!this.inclusionModeDefinition)throw new q("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(t);i.members||(i.members=new Map),i.members.set(n,{id:n}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}}else{const i=new Map;i.set(n,{id:n}),this.inclusionModeDefinition.namedTypeDefinitions.set(t,{useAllData:!1,members:i}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}})}getById(e){return de.getInstance().readFromStoreById(e)}async getData(e,t,n){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let i;if(i=e||new Q({where:"1=1",outFields:["*"]}),t.parentCompositeLayer.type==="link-chart"){const o=t.parentCompositeLayer,r=this._processingCacheUpdatesLookup.get(t.objectType.name??""),s=i.outFields;s&&s.length===1&&s[0]===x&&i.where==="1=1"||await Promise.all(r??[]);const p=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return p.forEach(l=>{if(this.relationshipTypeNames.has(t.objectType.name)){l.geometry=o.relationshipLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.memberIdTypeLookup.get(l.attributes[ce]),g=this.memberIdTypeLookup.get(l.attributes[me]),y=this._isEndEntitySpatial(h,l,ce),b=this._isEndEntitySpatial(g,l,me);l.attributes[z]=Number(y&&b)}else{l.geometry=o.entityLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.geographicLookup.get(t.objectType.name);h&&l.attributes[h.name]?l.attributes[z]=1:l.attributes[z]=0}l.attributes[Qe]=l.geometry,a.push(l)}),a}return this.retrieveDataFromService(i,t,n)}async getConnectedRecordIds(e,t){const n=[];let i="";const o=[],r=new Map;if(e.forEach(h=>{if(this.memberIdTypeLookup.has(h))for(const g of this.memberIdTypeLookup.get(h)){if(!this.entityTypeNames.has(g))return;r.has(g)?r.get(g)?.push(h):r.set(g,[h])}}),t&&t?.length!==0){for(const h of t)i=i+h+"|";i=i.slice(0,-1)}const s={};let p="",a=-1;for(const[h,g]of r){a++,a!==0&&(p+=" UNION ");const y=`${h}_ids`;s[y]=g,p+=t&&t?.length!==0?`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r:${i}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`:`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`}if(!p)return n;const l=new Promise(h=>{(async()=>{const g=(await U(this.knowledgeGraph,new P({openCypherQuery:p,bindParameters:s}))).resultRowsStream.getReader();try{for(;;){const{done:y,value:b}=await g.read();if(y)break;for(let T=0;T{h()})});return o.push(l),this.refreshCacheContent(),await Promise.all(o),n}async getRelationshipsBetweenNodes(e,t){const n=[],i="MATCH (n)-[r]->(m) WHERE id(n) IN $nodeIds AND id(m) in $nodeIds AND NOT id(r) IN $relationshipExclusionIds return id(r), type(r)",o=(await U(this.knowledgeGraph,new P({openCypherQuery:i,bindParameters:{nodeIds:e,relationshipExclusionIds:t}}))).resultRowsStream.getReader();try{for(;;){const{done:r,value:s}=await o.read();if(r)break;for(let p=0;p{a.name&&p.set(a.name,a)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(a=>{a.name&&p.set(a.name,a)}),e||this.inclusionModeDefinition?e?e.forEach(a=>{if(this.memberIdTypeLookup.has(a))for(const l of this.memberIdTypeLookup.get(a))s.has(l)?s.get(l)?.push(a):s.set(l,[a])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((a,l)=>{a.useAllData?s.set(l,null):a.members&&a.members.forEach(h=>{s.has(l)&&s.get(l)!==null?s.get(l)?.push(h.id):s.set(l,[h.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}));for(const[a,l]of s){const h=new Promise(g=>{(async()=>{const y=new Set,b=[];let T,u="",D=!1;if(t||p.get(a)?.properties?.forEach(w=>{w.name&&y.add(w.name)}),n&&this.geographicLookup.has(a)){const w=this.geographicLookup.get(a)?.name;w&&y.add(w)}if(this.entityTypeNames.has(a))u=`MATCH (n:${a}) ${l?"WHERE id(n) IN $ids ":""}return ID(n)`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)});else{if(!this.relationshipTypeNames.has(a))throw new q("knowledge-graph:layer-data-manager",`The graph type of ${a} could not be determined. Was this type set in the KG data model and inclusion definition?`);D=!0,u=`MATCH ()-[n:${a}]->() ${l?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)})}T=new P(l?{openCypherQuery:u,bindParameters:{ids:l}}:{openCypherQuery:u});const L=(await U(this.knowledgeGraph,T)).resultRowsStream.getReader();for(;;){const{done:w,value:N}=await L.read();if(w)break;const _=[];for(let M=0;Mnew Set).add(v.id),j(this.nodeConnectionsLookup,v.destinationId,()=>new Set).add(v.id),j(this.relationshipConnectionsLookup,v.id,()=>[v.originId,v.destinationId]));S{m?.set(M.attributes[x],M),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.has(M.attributes[x])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.set(M.attributes[x],{id:M.attributes[x]}),j(this.memberIdTypeLookup,M.attributes[x],()=>new Set).add(a))})}})().then(()=>{g(null)})});r.push(h),this._processingCacheUpdatesLookup.get(a)?.push(h)}await Promise.all(r)}removeFromLayer(e){const t=new Set,n=new Set(e.map(i=>i.id));for(const i of e)t.add(i.typeName),this.memberIdTypeLookup.get(i.id)?.size===1?this.memberIdTypeLookup.delete(i.id):this.memberIdTypeLookup.get(i.id)?.delete(i.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((o,r)=>{r===i.typeName&&o.members?.has(i.id)&&o.members.delete(i.id)});t.forEach(i=>{this.sublayerCaches.get(i)?.forEach((o,r)=>{n.has(r)&&this.sublayerCaches.get(i)?.delete(r)})})}async retrieveDataFromService(e,t,n){const i=de.getInstance(),o=new Set,r=[];let s,p="",a=[];const l=t.graphType==="relationship",h=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,g=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let y=!h&&g?Array.from(g).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&e.objectIds!=null&&(y=e.objectIds);else if(e.objectIds!=null&&y&&y.length>0){const T=e.objectIds;e.objectIds=y.filter(u=>T.includes(u))}else if(e.objectIds!=null)y=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=y}if(e.outFields!=null){const T=e.outFields;T.includes("*")?t.fields.forEach(u=>{o.add(u.name)}):T.forEach(u=>{u!==x&&u!==t.geometryFieldName&&o.add(u)})}if(e.geometry!=null){const T=e.geometry;let u;const D=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,L=D?.spatialReference,w=D?.serviceCapabilities?.geometryCapabilities;let N=w?.geometryMaxBoundingRectangleSizeX,_=w?.geometryMaxBoundingRectangleSizeY;if(T.type==="point"){let I=T;I.spatialReference?.isWGS84||(await ue(I.spatialReference,F),I=ie(I,F)),u=new ne({spatialReference:F,xmin:I.x-1e-4,ymin:I.y-1e-4,xmax:I.x+1e-4,ymax:I.y+1e-4})}else T?.extent?.spatialReference&&!T.spatialReference?.isWGS84?(await ue(T.extent.spatialReference,F),u=ie(T.extent,F)):u=T.extent;if(N&&_&&L){if(L.wkid!==4326){const I=new ne({spatialReference:L,xmax:N,ymax:_}),m=ie(I,F);N=m.xmax,_=m.ymax}if(u.xmax-u.xmin>N)throw new q("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${N}° latitude, limit exceeded`);if(u.ymax-u.ymin>_)throw new q("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${_}° longitude, limit exceeded`)}if(e.where!=null&&e.where!=="1=1"){const I=await ge(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(m=>{I.fieldNames.includes(m.name)&&o.add(m.name)})}p=l?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(I=>{p+=`, n.${I}`,r.push(I)}),s=new P({openCypherQuery:p,bindParameters:{param_filter_geom:new Ge({rings:Qt(u)})}})}else{let T="";if(e.where!=null&&e.where!=="1=1"){const L=await ge(e.where,t.fieldsIndex);t.fields.forEach(m=>{L.fieldNames.includes(m.name)&&o.add(m.name)});const w=new Set(["column-reference","string","number","binary-expression"]),N=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let _=!1;const I=m=>{if(m.type==="column-reference")return`n.${m.column}`;if(m.type==="string")return`'${m.value}'`;if(m.type==="number")return`${m.value}`;if(m.type==="binary-expression"&&w.has(m.left.type)&&w.has(m.right.type)&&N.has(m.operator))return`${I(m.left)} ${m.operator} ${I(m.right)}`;if(m.type==="binary-expression"&&m.operator==="LIKE"){let M="";if(m.left.type==="function"&&m.left.args.value[0].type==="column-reference")M+=`lower(n.${m.left.args.value[0].column})`;else{if(m.left.type!=="column-reference")return _=!0,"";M+=`lower(n.${m.left.column})`}if(M+=" CONTAINS (",m.right.type!=="string")return _=!0,"";{let R=m.right.value;R.charAt(0)==="%"&&(R=R.slice(1)),R.charAt(R.length-1)==="%"&&(R=R.slice(0,-1)),M+=`'${R.toLowerCase()}')`}return M}return _=!0,""};T=I(L.parseTree),_&&(T="")}let u="";u=l?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let D=!1;y&&(D=!0,u+=" WHERE ID(n) IN $ids"),T&&(u+=D?" AND":" WHERE",u+=` ${T}`),u+=" return ID(n)",l&&(u+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(L=>{u+=`, n.${L}`,r.push(L)}),s=new P(y?{openCypherQuery:u,bindParameters:{ids:y}}:{openCypherQuery:u})}const b=(await U(t.parentCompositeLayer.dataManager.knowledgeGraph,s,n)).resultRowsStream.getReader();for(;;){const{done:T,value:u}=await b.read();if(T)break;const D=[];for(let L=0;L{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return d([c(Pe.fields)],t.prototype,"fields",void 0),d([c(Pe.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayerBase")],t),t};function k(e){if(!e.json)return e;e.json.write=Be(e.json.write);const t=e.json.origins;if(!t)return e;let n;for(n in t){const i=t[n];i&&(i.write=Be(i.write))}return e}function Be(e){return typeof e=="object"&&e?(e.enabled!==!1&&(e.overridePolicy=zt(e)),e):e===!0?W():e}function zt(e){const{target:t,writer:n,overridePolicy:i,...o}=e;return function(r,s){const p=He.call(this,r,s);return p.enabled?{...o,...p}:p}}function W(){return{overridePolicy:He}}function He(e,t){const n=!!this.geometryType;let i={enabled:n};return n&&(i={...i,...Je.call(this,e,t)}),i}function Je(e,t){return{ignoreOrigin:this.originIdOf(t)>ot.DEFAULTS}}let f=class extends Wt(It(wt(gt(Lt(Rt(Mt(_t(dt(ut))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=ht(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=x,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const t=new MessageChannel;return new yt(t.port1,{channel:t,client:{queryFeatures:(n,i={})=>{const o=Q.fromJSON(n);return this.queryFeaturesJSON(o,i)}}}),[t.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const n=t.fieldType==="esriFieldTypeOID"?"esriFieldTypeInteger":t.fieldType;e.push(ee.fromJSON({name:t.name,type:n,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(ee.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),ee.fromJSON({name:be,type:"esriFieldTypeInteger",alias:be,editable:!1}),ee.fromJSON({name:z,type:"esriFieldTypeInteger",alias:z,editable:!1})),e}get geometryType(){if(this.parentCompositeLayer?.type==="link-chart")return this.graphType==="relationship"?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&t!=="esriGeometryNull"?G.fromJSON(t):null}get geometryFieldName(){return this.parentCompositeLayer?.type==="link-chart"?Qe:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasZ??!1}set renderer(e){Ve(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):this.parentCompositeLayer?.type==="link-chart"?this.graphType==="relationship"?le(pe(G.toJSON("polyline")).renderer):le(pe(G.toJSON("point")).renderer):le(pe(G.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??We.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return Pt(this,e)}createQuery(){return new Q({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t{r.sourceLayer=this}),o}async queryFeaturesJSON(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(n.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(n.toJSON(),t?.signal)}async queryExtent(e={},t){const n={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(n),r=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=r.extent?.xmin!=null&&r.extent?.xmax!=null&&r.extent?.ymin!=null&&r.extent?.ymax!=null?new ne(r.extent):new ne,{count:r.count,extent:s}}async queryObjectIds(e,t){const n=Q.from(e);let i;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const o=await this.parentCompositeLayer.dataManager.getData(n,this,t);i=this.loadQueryEngine(o)}return i.executeQueryForIds(n.toJSON(),t?.signal)}loadQueryEngine(e){const t=new ct({geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new mt({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new Q({where:"1=1",outFields:[x]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>{ze(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}async _setupQueryObjects(e,t){const n=Q.from(e),i=n.geometry;let o;if(i&&!i.spatialReference?.isWGS84&&(await ue(i.spatialReference,F),n.geometry=ie(i instanceof Ge||i instanceof Ze||i instanceof Ke?i:i.extent,F)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const r=await this.parentCompositeLayer.dataManager.getData(n,this,t);o=this.loadQueryEngine(r)}return{resolvedQuery:n,queryEngine:o}}};d([c(k(C(Tt)))],f.prototype,"blendMode",void 0),d([c()],f.prototype,"capabilities",void 0),d([c({json:{origins:{"web-scene":{write:!1}},write:W()}})],f.prototype,"charts",void 0),d([c({readOnly:!0})],f.prototype,"defaultPopupTemplate",null),d([c({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],f.prototype,"definitionExpression",void 0),d([c()],f.prototype,"displayField",void 0),d([c(k(C(bt)))],f.prototype,"effect",void 0),d([c()],f.prototype,"elevationInfo",void 0),d([c(k(C(Et)))],f.prototype,"featureEffect",void 0),d([c(k(C(Nt)))],f.prototype,"featureReduction",null),d([c()],f.prototype,"fields",null),d([c()],f.prototype,"geometryType",null),d([c()],f.prototype,"geometryFieldName",null),d([c({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphType",void 0),d([c({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphTypeName",null),d([c()],f.prototype,"hasM",null),d([c()],f.prototype,"hasZ",null),d([c({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],f.prototype,"id",void 0),d([c(k(C(vt)))],f.prototype,"labelsVisible",void 0),d([c({type:[jt],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Ft,write:W()}})],f.prototype,"labelingInfo",void 0),d([c({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"layerType",void 0),d([c(k(C(Ct)))],f.prototype,"legendEnabled",void 0),d([c(k(C(kt)))],f.prototype,"maxScale",void 0),d([c(k(C(At)))],f.prototype,"minScale",void 0),d([c()],f.prototype,"objectIdField",void 0),d([c()],f.prototype,"objectType",void 0),d([c(k(C(Ot)))],f.prototype,"opacity",void 0),d([c(k(C(Dt)))],f.prototype,"orderBy",void 0),d([c({clonable:!1})],f.prototype,"parent",void 0),d([c()],f.prototype,"parentCompositeLayer",void 0),d([c(k(C(xt)))],f.prototype,"popupEnabled",void 0),d([c({type:Xe,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],f.prototype,"popupTemplate",void 0),d([c({type:Number,json:{write:{overridePolicy:Je}}})],f.prototype,"refreshInterval",void 0),d([c({types:pt,json:{name:"layerDefinition.drawingInfo.renderer",write:W()}})],f.prototype,"renderer",null),d([c()],f.prototype,"source",void 0),d([c()],f.prototype,"spatialReference",null),d([c({type:qt,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],f.prototype,"timeInfo",null),d([c({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"title",null),d([et("title")],f.prototype,"writeTitle",null),d([c({json:{read:!1}})],f.prototype,"type",void 0),d([c(k(C(St)))],f.prototype,"useViewTime",void 0),d([c({type:Boolean,json:{name:"visibility",write:W()}})],f.prototype,"visible",void 0),f=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],f);const ki=f;export{O as A,Mi as B,Ce as D,Me as E,Re as I,Si as J,ve as L,ke as M,Se as N,Ri as P,Ee as T,vi as V,Ci as Y,Ie as b,be as f,x as k,Qe as m,ce as n,de as o,me as r,ki as t,_e as w}; diff --git a/main/assets/KnowledgeGraphSublayer-DPj4igi1-DXaAi0X5.js b/main/assets/KnowledgeGraphSublayer-DPj4igi1-DXaAi0X5.js new file mode 100644 index 000000000..7a0cfcaaf --- /dev/null +++ b/main/assets/KnowledgeGraphSublayer-DPj4igi1-DXaAi0X5.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lclayout-CcimkDVq-BWqQJHW2.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{v as d,S as c,i as he,bW as G,bT as Ve,J as We,n as ne,em as ze,ft as F,l as Ge,m as Ze,w as Ke,P as C,bL as Xe,ac as et,_ as tt,bw as it,o as q,f as nt,an as j,j as rt,a1 as X,eM as ge,bP as ot,g as at}from"./main-C7yV2j71.js";import{N as ue,K as ie}from"./projection-BA9M1R7d-DXrPfsKU.js";import{z as st}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{i as Te}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GraphicsLayer-DfeGaYc1-DAZy-iUY.js";import{M as U,r as Ue,W as lt}from"./knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js";import{j as P}from"./Relationship-Db9GUmYx-DnaxtAbX.js";import{b as Q}from"./Query-BrwMGK8U-DV_czrJX.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{t as le,m as pt}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{m as dt}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{d as yt}from"./workers-PiCjreoO-DqI62TYf.js";import{D as ut}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{I as ct}from"./FeatureStore-Co2V0sVE-BoTs_3tu.js";import{Z as mt}from"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import{$ as ht,d as pe}from"./clientSideDefaults-BqqayPct-B0cLE-po.js";import{f as ft}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{u as gt,o as Tt,a as bt}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{l as wt,s as Et}from"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import{v as It,X as Nt}from"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import{p as Lt,d as Dt}from"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import{T as _t}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as Mt}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as Rt,m as St}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{Y as vt,_ as Ct,n as kt,t as At,E as Ot,X as xt}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{y as ee}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{C as jt,q as Ft}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{w as qt}from"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import{O as $t}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{w as Pt}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";const x="ESRI__ID",ce="ESRI__OriginID",me="ESRI__DestID",Qe="ESRI__LayoutGeometry",be="ESRI__AggregationCount",z="LC.ESRI__IsSpatial",Bt={initializeLayersFromClientData:async(e,t)=>{if(t||(t=[...e.layers,...e.tables].map(o=>o.graphTypeName)),t?.length===0)return;const n=new Map;for(const o of t)n.set(o,we(e,o));const i=await lt(e.dataManager.knowledgeGraph,Array.from(n.values()));for(const o of[...e.layers,...e.tables]){const r=o.objectType.name;if(r===null)continue;const s=i.get(we(e,r));if(s){const p=JSON.parse(s);p===null||typeof p!="object"||p.hasOwnProperty("showLabels")||(p.showLabels=!1),o.read(p,{origin:"service"})}}}},we=(e,t)=>e.type==="knowledge-graph"?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function Mi(e,t){return Bt.initializeLayersFromClientData(e,t)}let de=class B{constructor(){this._featureLookup=new Map}static getInstance(){return B.instance||(B.instance=new B),B.instance}static resetInstance(){B.instance&&(B.instance=null)}deleteFromStore(t){t.forEach(n=>{this._featureLookup.delete(n)})}readFromStoreByList(t){const n=[];return t.forEach(i=>{const o=this.readFromStoreById(i);o&&n.push(o)}),n}readFromStoreById(t){return this._featureLookup.get(t)??null}writeToStore(t,n,i){const o=[];return t.forEach(r=>{if(!r?.id)return;r.properties||(r.properties=[]);let s,p=null;if(i&&r.properties[i]&&(p=st(r.properties[i])),"originId"in r&&"destinationId"in r&&(r.properties[ce]=r.originId,r.properties[me]=r.destinationId),r.properties[n]=r.id,r.id&&this._featureLookup.has(r.id)&&this._featureLookup.get(r.id).attributes){const a=this._featureLookup.get(r.id),l=JSON.parse(JSON.stringify(Object.assign(a.attributes,r.properties)));i&&r.properties[i]&&(l[i]=at(r.properties[i])),s=new Te(p?JSON.parse(JSON.stringify(p)):a?.geometry?JSON.parse(JSON.stringify(a.geometry)):null,l,null,r.properties[n])}else s=new Te(p?JSON.parse(JSON.stringify(p)):null,r.properties,null,r.properties[n]);this._featureLookup.set(`${r.typeName?`${r.typeName}__${r.id}`:r.id}`,s),o.push(s)}),o}},ye,E=null;function Ri(){return ye||(ye=tt(()=>import("./lclayout-CcimkDVq-BWqQJHW2.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>it(`esri/libs/linkchartlayout/${t}`)})).then(e=>{Gt(e)}),ye)}function Gt(e){E=e}var Ee,Ie,Z,K;function Ut(e){const t=Object.keys(Z).filter(i=>isNaN(parseInt(i,10))).indexOf(e.timeDirection),n=Object.keys(K).filter(i=>isNaN(parseInt(i,10))).indexOf(e.eventsTicksVisualization);return{timeDirection:{value:t>-1?t:Z.right},timeBannerUTCOffsetInMinutes:e.timeBannerUTCOffsetInMinutes,eventsTicksVisualization:{value:n>-1?n:K.startAndEnd},showDurationLineForNonZeroDurationEntityEvents:e.showDurationLineForNonZeroDurationEntityEvents,durationLineWidth:e.durationLineWidth,entityPositionAtDurationRatio:e.entityPositionAtDurationRatio,showNonZeroDurationIntervalBounds:e.showNonZeroDurationIntervalBounds,separateTimeOverlaps:e.separateTimeOverlaps,separateTimelineOverlaps:e.separateTimelineOverlaps,moveFirstBends:e.moveFirstBends,secondBendRatio:e.secondBendRatio,lineSeparationMultiplier:e.lineSeparationMultiplier,spaceSeparatedLinesEvenly:e.spaceSeparatedLinesEvenly,useBezierCurves:e.useBezierCurves,separatedLineShapeRatio:e.separatedLineShapeRatio}}function $(e,t,n,i,o,r){const s=n.length,p=o.length,a=Float64Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,h=Uint8Array.BYTES_PER_ELEMENT,g=16,y=g+s*(h+2*a)+p*(2*l),b=E._malloc(y);try{const T=b+g-b%g,u=T+s*a,D=u+s*a,L=D+p*l,w=L+p*l,N=()=>[E.HEAPF64.subarray(T>>3,(T>>3)+s),E.HEAPF64.subarray(u>>3,(u>>3)+s),E.HEAPU32.subarray(D>>2,(D>>2)+p),E.HEAPU32.subarray(L>>2,(L>>2)+p),E.HEAPU8.subarray(w,w+s)],[_,I,m,M,R]=N();_.set(n),I.set(i),m.set(o),M.set(r),R.set(t);let S=e(s,w,T,u,p,D,L),A=null,v=null;if(S){const oe=E.getLayoutLinksTypes(),ae=E.getLayoutLinksVerticesEndIndices(),se=E.getLayoutLinksVertices(),fe=E.countLayoutLinksVertices();!p||oe&&ae?fe&&!se?S=!1:(A={types:new Uint8Array(E.HEAPU8.subarray(oe,oe+p)),vertexEndIndex:new Uint32Array(E.HEAPU32.subarray(ae>>2,(ae>>2)+p)),vertices:new Float64Array(E.HEAPF64.subarray(se>>3,(se>>3)+2*fe))},v=E.getAuxiliaryGraphicElements()):S=!1}const[J,Y,V,re,Ye]=N();return n.set(J),i.set(Y),o.set(V),r.set(re),t.set(Ye),{success:S,links:A,graphics:v}}finally{E._free(b),E.cleanupLayout()}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot",e[e.IsOld=8]="IsOld"})(Ee||(Ee={})),function(e){e[e.Regular=0]="Regular",e[e.Curved=1]="Curved",e[e.Recursive=2]="Recursive"}(Ie||(Ie={})),function(e){e[e.right=0]="right",e[e.left=1]="left",e[e.top=2]="top",e[e.bottom=3]="bottom"}(Z||(Z={})),function(e){e[e.none=0]="none",e[e.startOnly=1]="startOnly",e[e.startAndEnd=2]="startAndEnd"}(K||(K={}));const Ne=2,Le=1,De=-1;var _e,Me,Re,Se,ve,Ce,ke,Ae,Oe;(function(e){function t(){return E.getMinIdealEdgeLength()}function n(i,o,r,s,p,a=Ne,l=Le,h=De){return $((g,y,b,T,u,D,L)=>E.applyForceDirectedLayout(g,y,b,T,u,D,L,a,l,h),i,o,r,s,p)}e.getMinIdealEdgeLength=t,e.apply=n})(_e||(_e={})),function(e){function t(n,i,o,r,s,p=Ne,a=Le,l=De){return $((h,g,y,b,T,u,D)=>E.applyCommunityLayout(h,g,y,b,T,u,D,p,a,l),n,i,o,r,s)}e.apply=t}(Me||(Me={})),function(e){function t(n,i,o,r,s){return $(E.applySimpleLayout,n,i,o,r,s)}e.apply=t}(Re||(Re={})),function(e){function t(n,i,o,r,s){return $(E.applyHierarchicalLayout,n,i,o,r,s)}e.apply=t}(Se||(Se={})),function(e){function t(n,i,o,r,s){return $(E.applyRadialTreeLayout,n,i,o,r,s)}e.apply=t}(ve||(ve={})),function(e){function t(n,i,o,r,s){return $(E.applySmartTreeLayout,n,i,o,r,s)}e.apply=t}(Ce||(Ce={})),function(e){function t(n,i,o,r,s,p,a,l,h,g,y){const b={timeDirection:Z.right,timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:K.startAndEnd,showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0};return $((T,u,D,L,w,N,_)=>{if(r.length!==T||s.length!==T||l.length!==w||h.length!==w)return!1;const I=Float64Array.BYTES_PER_ELEMENT,m=16,M=E._malloc(m+T*I),R=E._malloc(m+T*I),S=E._malloc(m+w*I),A=E._malloc(m+w*I),v=M+m-M%m,J=R+m-R%m,Y=S+m-S%m,V=A+m-A%m;try{E.HEAPF64.subarray(v>>3,(v>>3)+T).set(r),E.HEAPF64.subarray(J>>3,(J>>3)+T).set(s),E.HEAPF64.subarray(Y>>3,(Y>>3)+w).set(l),E.HEAPF64.subarray(V>>3,(V>>3)+w).set(h);const re=Ut(Object.assign(b,y));return E.applyChronologicalLayout(T,u,D,L,v,J,w,N,_,Y,V,g,re)}finally{E._free(M),E._free(R),E._free(S),E._free(A)}},n,i,o,p,a)}e.apply=t}(ke||(ke={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Ae||(Ae={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Oe||(Oe={}));var te;(function(e){e.ELEMENTUID="ELEMENTUID",e.TYPENAME="TYPENAME"})(te||(te={})),te.ELEMENTUID,te.TYPENAME;var xe,je;(function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME"})(xe||(xe={})),function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME",e[e.FROMUID=2]="FROMUID",e[e.TOUID=3]="TOUID"}(je||(je={}));var Fe,qe,$e,H;(function(e){e[e.featureResult=0]="featureResult",e[e.countResult=1]="countResult",e[e.idsResult=2]="idsResult"})(Fe||(Fe={})),function(e){e[e.upperLeft=0]="upperLeft",e[e.lowerLeft=1]="lowerLeft"}(qe||(qe={})),function(e){e[e.sqlTypeBigInt=0]="sqlTypeBigInt",e[e.sqlTypeBinary=1]="sqlTypeBinary",e[e.sqlTypeBit=2]="sqlTypeBit",e[e.sqlTypeChar=3]="sqlTypeChar",e[e.sqlTypeDate=4]="sqlTypeDate",e[e.sqlTypeDecimal=5]="sqlTypeDecimal",e[e.sqlTypeDouble=6]="sqlTypeDouble",e[e.sqlTypeFloat=7]="sqlTypeFloat",e[e.sqlTypeGeometry=8]="sqlTypeGeometry",e[e.sqlTypeGUID=9]="sqlTypeGUID",e[e.sqlTypeInteger=10]="sqlTypeInteger",e[e.sqlTypeLongNVarchar=11]="sqlTypeLongNVarchar",e[e.sqlTypeLongVarbinary=12]="sqlTypeLongVarbinary",e[e.sqlTypeLongVarchar=13]="sqlTypeLongVarchar",e[e.sqlTypeNChar=14]="sqlTypeNChar",e[e.sqlTypeNVarChar=15]="sqlTypeNVarChar",e[e.sqlTypeOther=16]="sqlTypeOther",e[e.sqlTypeReal=17]="sqlTypeReal",e[e.sqlTypeSmallInt=18]="sqlTypeSmallInt",e[e.sqlTypeSqlXml=19]="sqlTypeSqlXml",e[e.sqlTypeTime=20]="sqlTypeTime",e[e.sqlTypeTimestamp=21]="sqlTypeTimestamp",e[e.sqlTypeTimestamp2=22]="sqlTypeTimestamp2",e[e.sqlTypeTinyInt=23]="sqlTypeTinyInt",e[e.sqlTypeVarbinary=24]="sqlTypeVarbinary",e[e.sqlTypeVarchar=25]="sqlTypeVarchar"}($e||($e={})),function(e){e[e.OID_ARRAY=0]="OID_ARRAY",e[e.GLOBALID_ARRAY=1]="GLOBALID_ARRAY",e[e.STRING_ARRAY=2]="STRING_ARRAY",e[e.IDENTIFIER_ARRAY=3]="IDENTIFIER_ARRAY"}(H||(H={}));function Qt(e){if(!e.spatialReference.isWGS84)throw new q("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map(t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]])}async function Si(e,t){const n=[],i=new Map,o=[];if(t.dataModel?.relationshipTypes)for(const r of t.dataModel.relationshipTypes)r.name&&i.set(r.name,[]);for(const r of e)i.has(r.typeName)&&i.get(r.typeName)?.push(r.id);for(const[r,s]of i){if(s.length<1)continue;const p=new P({openCypherQuery:`MATCH (n)-[r:${r}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:s}});o.push(U(t,p).then(async a=>{const l=a.resultRowsStream.getReader();for(;;){const{done:h,value:g}=await l.read();if(h)break;for(const y of g)n.push({id:y[0],typeName:y[1]}),n.push({id:y[2],typeName:y[3]})}}))}return await Promise.all(o),n}async function vi(e,t){t??=!1;const n={generateAllSublayers:t,namedTypeDefinitions:new Map};return await Jt(e).then(i=>{Vt(i,n)}),n}async function Ci(e){const t=await Ue(),n=new t.MapOfObjectIdentifierSets;Ht(n,t,e);const i=new t.MapOfObjectIdentifierSetsEncoder;try{i.set_map_of_identifier_sets(n),i.encode();const o=i.get_encoding_result();if(o.error.error_code!==0)throw new q("knowledge-graph:layer-support-utils",o.error.error_message);const r=structuredClone(o.get_byte_buffer());return i.delete(),r}finally{n.delete()}}function Ht(e,t,n){for(const[i,o]of n.namedTypeDefinitions){if(!o.members||o.useAllData)continue;const r=o.members.keys();let s=!1,p=!0;const a=new t.ObjectIdArray,l=new t.StringArray,h=new t.GlobalIdArray,g=new t.IdentifierArray,y=new t.ObjectIdentifierSet;for(const b of r)p&&(s=!isNaN(Number(b)),p=!1),s?a.add_objectid(Number(b)):(l.add_string(b),h.add_globalid(b)),g.add_identifier(b);y.set_oid_array(a),y.set_string_array(l),y.set_globalid_array(h),y.set_identifier_array(g),a.delete(),l.delete(),h.delete(),g.delete(),e.put_identifier_set(i,y),y.delete()}return e}async function Jt(e){const t=await nt(e,{responseType:"array-buffer"}),n=await t.data;return Yt(new Uint8Array(n))}async function Yt(e){const t=new(await Ue()).MapOfObjectIdentifierSetsDecoder,n=t.decode(new Uint8Array(e)),i=new Map;if(n.error_code!==0)throw new q("knowledge-graph:layer-support-utils",n.error_message);const o=t.get_map_of_identifier_sets(),r=o.keys,s=r.size();for(let p=0;p({useAllData:!1,members:new Map}));for(const r of i)o.members.has(r)||o.members.set(r,{id:r})}return t}let O=class extends rt{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(n=>{n.name&&(t.set(n.name,"entity"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(n=>{n.name&&(t.set(n.name,"relationship"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,i)=>{if(t.get(i)==="entity")this.entityTypeNames.add(i);else{if(t.get(i)!=="relationship")return X.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(i);this.relationshipTypeNames.add(i)}const o=new Map;n.members?.forEach(r=>{j(this.memberIdTypeLookup,r.id,()=>new Set).add(i);const s=this.getById(r.id);s&&o.set(r.id,s)}),this.sublayerCaches.set(i,o)})}addToLayer(e){e.forEach(({typeName:t,id:n})=>{if(!this.inclusionModeDefinition)throw new q("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(t);i.members||(i.members=new Map),i.members.set(n,{id:n}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}}else{const i=new Map;i.set(n,{id:n}),this.inclusionModeDefinition.namedTypeDefinitions.set(t,{useAllData:!1,members:i}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}})}getById(e){return de.getInstance().readFromStoreById(e)}async getData(e,t,n){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let i;if(i=e||new Q({where:"1=1",outFields:["*"]}),t.parentCompositeLayer.type==="link-chart"){const o=t.parentCompositeLayer,r=this._processingCacheUpdatesLookup.get(t.objectType.name??""),s=i.outFields;s&&s.length===1&&s[0]===x&&i.where==="1=1"||await Promise.all(r??[]);const p=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return p.forEach(l=>{if(this.relationshipTypeNames.has(t.objectType.name)){l.geometry=o.relationshipLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.memberIdTypeLookup.get(l.attributes[ce]),g=this.memberIdTypeLookup.get(l.attributes[me]),y=this._isEndEntitySpatial(h,l,ce),b=this._isEndEntitySpatial(g,l,me);l.attributes[z]=Number(y&&b)}else{l.geometry=o.entityLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.geographicLookup.get(t.objectType.name);h&&l.attributes[h.name]?l.attributes[z]=1:l.attributes[z]=0}l.attributes[Qe]=l.geometry,a.push(l)}),a}return this.retrieveDataFromService(i,t,n)}async getConnectedRecordIds(e,t){const n=[];let i="";const o=[],r=new Map;if(e.forEach(h=>{if(this.memberIdTypeLookup.has(h))for(const g of this.memberIdTypeLookup.get(h)){if(!this.entityTypeNames.has(g))return;r.has(g)?r.get(g)?.push(h):r.set(g,[h])}}),t&&t?.length!==0){for(const h of t)i=i+h+"|";i=i.slice(0,-1)}const s={};let p="",a=-1;for(const[h,g]of r){a++,a!==0&&(p+=" UNION ");const y=`${h}_ids`;s[y]=g,p+=t&&t?.length!==0?`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r:${i}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`:`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`}if(!p)return n;const l=new Promise(h=>{(async()=>{const g=(await U(this.knowledgeGraph,new P({openCypherQuery:p,bindParameters:s}))).resultRowsStream.getReader();try{for(;;){const{done:y,value:b}=await g.read();if(y)break;for(let T=0;T{h()})});return o.push(l),this.refreshCacheContent(),await Promise.all(o),n}async getRelationshipsBetweenNodes(e,t){const n=[],i="MATCH (n)-[r]->(m) WHERE id(n) IN $nodeIds AND id(m) in $nodeIds AND NOT id(r) IN $relationshipExclusionIds return id(r), type(r)",o=(await U(this.knowledgeGraph,new P({openCypherQuery:i,bindParameters:{nodeIds:e,relationshipExclusionIds:t}}))).resultRowsStream.getReader();try{for(;;){const{done:r,value:s}=await o.read();if(r)break;for(let p=0;p{a.name&&p.set(a.name,a)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(a=>{a.name&&p.set(a.name,a)}),e||this.inclusionModeDefinition?e?e.forEach(a=>{if(this.memberIdTypeLookup.has(a))for(const l of this.memberIdTypeLookup.get(a))s.has(l)?s.get(l)?.push(a):s.set(l,[a])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((a,l)=>{a.useAllData?s.set(l,null):a.members&&a.members.forEach(h=>{s.has(l)&&s.get(l)!==null?s.get(l)?.push(h.id):s.set(l,[h.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}));for(const[a,l]of s){const h=new Promise(g=>{(async()=>{const y=new Set,b=[];let T,u="",D=!1;if(t||p.get(a)?.properties?.forEach(w=>{w.name&&y.add(w.name)}),n&&this.geographicLookup.has(a)){const w=this.geographicLookup.get(a)?.name;w&&y.add(w)}if(this.entityTypeNames.has(a))u=`MATCH (n:${a}) ${l?"WHERE id(n) IN $ids ":""}return ID(n)`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)});else{if(!this.relationshipTypeNames.has(a))throw new q("knowledge-graph:layer-data-manager",`The graph type of ${a} could not be determined. Was this type set in the KG data model and inclusion definition?`);D=!0,u=`MATCH ()-[n:${a}]->() ${l?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)})}T=new P(l?{openCypherQuery:u,bindParameters:{ids:l}}:{openCypherQuery:u});const L=(await U(this.knowledgeGraph,T)).resultRowsStream.getReader();for(;;){const{done:w,value:N}=await L.read();if(w)break;const _=[];for(let M=0;Mnew Set).add(v.id),j(this.nodeConnectionsLookup,v.destinationId,()=>new Set).add(v.id),j(this.relationshipConnectionsLookup,v.id,()=>[v.originId,v.destinationId]));S{m?.set(M.attributes[x],M),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.has(M.attributes[x])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.set(M.attributes[x],{id:M.attributes[x]}),j(this.memberIdTypeLookup,M.attributes[x],()=>new Set).add(a))})}})().then(()=>{g(null)})});r.push(h),this._processingCacheUpdatesLookup.get(a)?.push(h)}await Promise.all(r)}removeFromLayer(e){const t=new Set,n=new Set(e.map(i=>i.id));for(const i of e)t.add(i.typeName),this.memberIdTypeLookup.get(i.id)?.size===1?this.memberIdTypeLookup.delete(i.id):this.memberIdTypeLookup.get(i.id)?.delete(i.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((o,r)=>{r===i.typeName&&o.members?.has(i.id)&&o.members.delete(i.id)});t.forEach(i=>{this.sublayerCaches.get(i)?.forEach((o,r)=>{n.has(r)&&this.sublayerCaches.get(i)?.delete(r)})})}async retrieveDataFromService(e,t,n){const i=de.getInstance(),o=new Set,r=[];let s,p="",a=[];const l=t.graphType==="relationship",h=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,g=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let y=!h&&g?Array.from(g).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&e.objectIds!=null&&(y=e.objectIds);else if(e.objectIds!=null&&y&&y.length>0){const T=e.objectIds;e.objectIds=y.filter(u=>T.includes(u))}else if(e.objectIds!=null)y=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=y}if(e.outFields!=null){const T=e.outFields;T.includes("*")?t.fields.forEach(u=>{o.add(u.name)}):T.forEach(u=>{u!==x&&u!==t.geometryFieldName&&o.add(u)})}if(e.geometry!=null){const T=e.geometry;let u;const D=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,L=D?.spatialReference,w=D?.serviceCapabilities?.geometryCapabilities;let N=w?.geometryMaxBoundingRectangleSizeX,_=w?.geometryMaxBoundingRectangleSizeY;if(T.type==="point"){let I=T;I.spatialReference?.isWGS84||(await ue(I.spatialReference,F),I=ie(I,F)),u=new ne({spatialReference:F,xmin:I.x-1e-4,ymin:I.y-1e-4,xmax:I.x+1e-4,ymax:I.y+1e-4})}else T?.extent?.spatialReference&&!T.spatialReference?.isWGS84?(await ue(T.extent.spatialReference,F),u=ie(T.extent,F)):u=T.extent;if(N&&_&&L){if(L.wkid!==4326){const I=new ne({spatialReference:L,xmax:N,ymax:_}),m=ie(I,F);N=m.xmax,_=m.ymax}if(u.xmax-u.xmin>N)throw new q("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${N}° latitude, limit exceeded`);if(u.ymax-u.ymin>_)throw new q("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${_}° longitude, limit exceeded`)}if(e.where!=null&&e.where!=="1=1"){const I=await ge(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(m=>{I.fieldNames.includes(m.name)&&o.add(m.name)})}p=l?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(I=>{p+=`, n.${I}`,r.push(I)}),s=new P({openCypherQuery:p,bindParameters:{param_filter_geom:new Ge({rings:Qt(u)})}})}else{let T="";if(e.where!=null&&e.where!=="1=1"){const L=await ge(e.where,t.fieldsIndex);t.fields.forEach(m=>{L.fieldNames.includes(m.name)&&o.add(m.name)});const w=new Set(["column-reference","string","number","binary-expression"]),N=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let _=!1;const I=m=>{if(m.type==="column-reference")return`n.${m.column}`;if(m.type==="string")return`'${m.value}'`;if(m.type==="number")return`${m.value}`;if(m.type==="binary-expression"&&w.has(m.left.type)&&w.has(m.right.type)&&N.has(m.operator))return`${I(m.left)} ${m.operator} ${I(m.right)}`;if(m.type==="binary-expression"&&m.operator==="LIKE"){let M="";if(m.left.type==="function"&&m.left.args.value[0].type==="column-reference")M+=`lower(n.${m.left.args.value[0].column})`;else{if(m.left.type!=="column-reference")return _=!0,"";M+=`lower(n.${m.left.column})`}if(M+=" CONTAINS (",m.right.type!=="string")return _=!0,"";{let R=m.right.value;R.charAt(0)==="%"&&(R=R.slice(1)),R.charAt(R.length-1)==="%"&&(R=R.slice(0,-1)),M+=`'${R.toLowerCase()}')`}return M}return _=!0,""};T=I(L.parseTree),_&&(T="")}let u="";u=l?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let D=!1;y&&(D=!0,u+=" WHERE ID(n) IN $ids"),T&&(u+=D?" AND":" WHERE",u+=` ${T}`),u+=" return ID(n)",l&&(u+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(L=>{u+=`, n.${L}`,r.push(L)}),s=new P(y?{openCypherQuery:u,bindParameters:{ids:y}}:{openCypherQuery:u})}const b=(await U(t.parentCompositeLayer.dataManager.knowledgeGraph,s,n)).resultRowsStream.getReader();for(;;){const{done:T,value:u}=await b.read();if(T)break;const D=[];for(let L=0;L{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return d([c(Pe.fields)],t.prototype,"fields",void 0),d([c(Pe.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayerBase")],t),t};function k(e){if(!e.json)return e;e.json.write=Be(e.json.write);const t=e.json.origins;if(!t)return e;let n;for(n in t){const i=t[n];i&&(i.write=Be(i.write))}return e}function Be(e){return typeof e=="object"&&e?(e.enabled!==!1&&(e.overridePolicy=zt(e)),e):e===!0?W():e}function zt(e){const{target:t,writer:n,overridePolicy:i,...o}=e;return function(r,s){const p=He.call(this,r,s);return p.enabled?{...o,...p}:p}}function W(){return{overridePolicy:He}}function He(e,t){const n=!!this.geometryType;let i={enabled:n};return n&&(i={...i,...Je.call(this,e,t)}),i}function Je(e,t){return{ignoreOrigin:this.originIdOf(t)>ot.DEFAULTS}}let f=class extends Wt(It(wt(gt(Lt(Rt(Mt(_t(dt(ut))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=ht(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=x,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const t=new MessageChannel;return new yt(t.port1,{channel:t,client:{queryFeatures:(n,i={})=>{const o=Q.fromJSON(n);return this.queryFeaturesJSON(o,i)}}}),[t.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const n=t.fieldType==="esriFieldTypeOID"?"esriFieldTypeInteger":t.fieldType;e.push(ee.fromJSON({name:t.name,type:n,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(ee.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),ee.fromJSON({name:be,type:"esriFieldTypeInteger",alias:be,editable:!1}),ee.fromJSON({name:z,type:"esriFieldTypeInteger",alias:z,editable:!1})),e}get geometryType(){if(this.parentCompositeLayer?.type==="link-chart")return this.graphType==="relationship"?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&t!=="esriGeometryNull"?G.fromJSON(t):null}get geometryFieldName(){return this.parentCompositeLayer?.type==="link-chart"?Qe:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasZ??!1}set renderer(e){Ve(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):this.parentCompositeLayer?.type==="link-chart"?this.graphType==="relationship"?le(pe(G.toJSON("polyline")).renderer):le(pe(G.toJSON("point")).renderer):le(pe(G.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??We.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return Pt(this,e)}createQuery(){return new Q({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t{r.sourceLayer=this}),o}async queryFeaturesJSON(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(n.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(n.toJSON(),t?.signal)}async queryExtent(e={},t){const n={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(n),r=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=r.extent?.xmin!=null&&r.extent?.xmax!=null&&r.extent?.ymin!=null&&r.extent?.ymax!=null?new ne(r.extent):new ne,{count:r.count,extent:s}}async queryObjectIds(e,t){const n=Q.from(e);let i;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const o=await this.parentCompositeLayer.dataManager.getData(n,this,t);i=this.loadQueryEngine(o)}return i.executeQueryForIds(n.toJSON(),t?.signal)}loadQueryEngine(e){const t=new ct({geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new mt({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new Q({where:"1=1",outFields:[x]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>{ze(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}async _setupQueryObjects(e,t){const n=Q.from(e),i=n.geometry;let o;if(i&&!i.spatialReference?.isWGS84&&(await ue(i.spatialReference,F),n.geometry=ie(i instanceof Ge||i instanceof Ze||i instanceof Ke?i:i.extent,F)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const r=await this.parentCompositeLayer.dataManager.getData(n,this,t);o=this.loadQueryEngine(r)}return{resolvedQuery:n,queryEngine:o}}};d([c(k(C(Tt)))],f.prototype,"blendMode",void 0),d([c()],f.prototype,"capabilities",void 0),d([c({json:{origins:{"web-scene":{write:!1}},write:W()}})],f.prototype,"charts",void 0),d([c({readOnly:!0})],f.prototype,"defaultPopupTemplate",null),d([c({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],f.prototype,"definitionExpression",void 0),d([c()],f.prototype,"displayField",void 0),d([c(k(C(bt)))],f.prototype,"effect",void 0),d([c()],f.prototype,"elevationInfo",void 0),d([c(k(C(Et)))],f.prototype,"featureEffect",void 0),d([c(k(C(Nt)))],f.prototype,"featureReduction",null),d([c()],f.prototype,"fields",null),d([c()],f.prototype,"geometryType",null),d([c()],f.prototype,"geometryFieldName",null),d([c({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphType",void 0),d([c({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphTypeName",null),d([c()],f.prototype,"hasM",null),d([c()],f.prototype,"hasZ",null),d([c({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],f.prototype,"id",void 0),d([c(k(C(vt)))],f.prototype,"labelsVisible",void 0),d([c({type:[jt],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Ft,write:W()}})],f.prototype,"labelingInfo",void 0),d([c({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"layerType",void 0),d([c(k(C(Ct)))],f.prototype,"legendEnabled",void 0),d([c(k(C(kt)))],f.prototype,"maxScale",void 0),d([c(k(C(At)))],f.prototype,"minScale",void 0),d([c()],f.prototype,"objectIdField",void 0),d([c()],f.prototype,"objectType",void 0),d([c(k(C(Ot)))],f.prototype,"opacity",void 0),d([c(k(C(Dt)))],f.prototype,"orderBy",void 0),d([c({clonable:!1})],f.prototype,"parent",void 0),d([c()],f.prototype,"parentCompositeLayer",void 0),d([c(k(C(xt)))],f.prototype,"popupEnabled",void 0),d([c({type:Xe,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],f.prototype,"popupTemplate",void 0),d([c({type:Number,json:{write:{overridePolicy:Je}}})],f.prototype,"refreshInterval",void 0),d([c({types:pt,json:{name:"layerDefinition.drawingInfo.renderer",write:W()}})],f.prototype,"renderer",null),d([c()],f.prototype,"source",void 0),d([c()],f.prototype,"spatialReference",null),d([c({type:qt,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],f.prototype,"timeInfo",null),d([c({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"title",null),d([et("title")],f.prototype,"writeTitle",null),d([c({json:{read:!1}})],f.prototype,"type",void 0),d([c(k(C(St)))],f.prototype,"useViewTime",void 0),d([c({type:Boolean,json:{name:"visibility",write:W()}})],f.prototype,"visible",void 0),f=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],f);const ki=f;export{O as A,Mi as B,Ce as D,Me as E,Re as I,Si as J,ve as L,ke as M,Se as N,Ri as P,Ee as T,vi as V,Ci as Y,Ie as b,be as f,x as k,Qe as m,ce as n,de as o,me as r,ki as t,_e as w}; diff --git a/main/assets/LRUCache-C3erQTWv-CeYLuvL9.js b/main/assets/LRUCache-C3erQTWv-CeYLuvL9.js deleted file mode 100644 index c566d38b2..000000000 --- a/main/assets/LRUCache-C3erQTWv-CeYLuvL9.js +++ /dev/null @@ -1 +0,0 @@ -import{dD as d}from"./main-BZaw9FpY.js";const c=-3,f=c-1;var n;(function(_){_[_.ALL=0]="ALL",_[_.SOME=1]="SOME"})(n||(n={}));class g{get size(){return this._size}constructor(i=10485760){this._maxSize=i,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new d,this._users=new d}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(i){this._users.push(i)}deregister(i){this._users.removeUnordered(i)}registerRemoveFunc(i,t){this._removeFuncs.push([i,t])}deregisterRemoveFunc(i){this._removeFuncs.filterInPlace(t=>t[0]!==i)}get maxSize(){return this._maxSize}set maxSize(i){this._maxSize=Math.max(i,-1),this._checkSize()}getSize(i,t){return this._db.get(i.id+t)?.size??0}put(i,t,e,r,h){t=i.id+t;const s=this._db.get(t);if(s&&(this._size-=s.size,i.size-=s.size,this._db.delete(t),s.entry!==e&&this._notifyRemove(t,s.entry,s.size,n.ALL)),r>this._maxSize)return void this._notifyRemove(t,e,r,n.ALL);if(e===void 0)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return console.warn(`Refusing to cache entry with size ${r} for key ${t}`),void this._notifyRemove(t,e,0,n.ALL);const o=1+Math.max(h,f)-c;this._db.set(t,new S(e,r,o)),this._size+=r,i.size+=r,this._checkSize()}updateSize(i,t,e,r){t=i.id+t;const h=this._db.get(t);if(h&&h.entry===e){for(this._size-=h.size,i.size-=h.size;r>this._maxSize;){const s=this._notifyRemove(t,e,r,n.SOME);if(!(s!=null&&s>0))return void this._db.delete(t);r=s}h.size=r,this._size+=r,i.size+=r,this._checkSize()}}pop(i,t){t=i.id+t;const e=this._db.get(t);if(e)return this._size-=e.size,i.size-=e.size,this._db.delete(t),++this._hit,e.entry;++this._miss}get(i,t){t=i.id+t;const e=this._db.get(t);if(e!==void 0)return this._db.delete(t),e.lives=e.lifetime,this._db.set(t,e),++this._hit,e.entry;++this._miss}peek(i,t){const e=this._db.get(i.id+t);return e?++this._hit:++this._miss,e?.entry}get performanceInfo(){const i={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},e=new Array;this._db.forEach((s,o)=>{const a=s.lifetime;e[a]=(e[a]||0)+s.size,this._users.forAll(u=>{const{id:m,name:z}=u;if(o.startsWith(m)){const l=t[z]||0;t[z]=l+s.size}})});const r={};this._users.forAll(s=>{const o=s.name;if("hitRate"in s&&typeof s.hitRate=="number"&&!isNaN(s.hitRate)&&s.hitRate>0){const a=t[o]||0;t[o]=a,r[o]=Math.round(100*s.hitRate)+"%"}else r[o]="0%"});const h=Object.keys(t);h.sort((s,o)=>t[o]-t[s]),h.forEach(s=>i[s]=Math.round(t[s]/2**20)+"MB / "+r[s]);for(let s=e.length-1;s>=0;--s){const o=e[s];o&&(i["Priority "+(s+c-1)]=Math.round(o/this._size*100)+"%")}return i}resetStats(){this._hit=this._miss=0,this._users.forAll(i=>i.resetHitRate())}clear(i){const t=i.id;this._db.forEach((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,n.ALL))}),i.size=0}clearAll(){this._db.forEach((i,t)=>this._notifyRemove(t,i.entry,i.size,n.ALL)),this._users.forAll(i=>i.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(i,t,e,r){let h;return this._removeFuncs.some(s=>{if(i.startsWith(s[0])){const o=s[1](t,r,e);return typeof o=="number"&&(h=o),!0}return!1}),h}_checkSize(){this._users.forAll(i=>this._checkSizeLimits(i)),this._checkSizeLimits()}_checkSizeLimits(i){const t=i??this;if(t.maxSize<0||t.size<=t.maxSize)return;const e=i?.id;let r=!0;for(;r;){r=!1;for(const[h,s]of this._db)if(s.lifetime===0&&(!e||h.startsWith(e))){if(this._purgeItem(h,s,i),t.size<=.9*t.maxSize)return;r||=this._db.has(h)}}for(const[h,s]of this._db)if((!e||h.startsWith(e))&&(this._purgeItem(h,s,i),t.size<=.9*t.maxSize))return}_purgeItem(i,t,e=this._users.find(r=>i.startsWith(r.id))){if(this._db.delete(i),t.lives<=1){this._size-=t.size,e&&(e.size-=t.size);const r=this._notifyRemove(i,t.entry,t.size,n.SOME);r!=null&&r>0&&(this._size+=r,e&&(e.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(i,t))}else--t.lives,this._db.set(i,t)}}class S{constructor(i,t,e){this.entry=i,this.size=t,this.lifetime=e,this.lives=e}}class v{constructor(i,t){this._storage=new g,this.id="",this.name="",this.size=0,this._storage.maxSize=i,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(i,t,e=1){this._storage.put(this,i,t,e,1)}pop(i){return this._storage.pop(this,i)}get(i){return this._storage.get(this,i)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(i){this._storage.maxSize=i}resetHitRate(){}}export{v as b}; diff --git a/main/assets/LRUCache-C3erQTWv-DhyPlt5p.js b/main/assets/LRUCache-C3erQTWv-DhyPlt5p.js new file mode 100644 index 000000000..d07f12f0a --- /dev/null +++ b/main/assets/LRUCache-C3erQTWv-DhyPlt5p.js @@ -0,0 +1 @@ +import{dD as d}from"./main-C7yV2j71.js";const c=-3,f=c-1;var n;(function(_){_[_.ALL=0]="ALL",_[_.SOME=1]="SOME"})(n||(n={}));class g{get size(){return this._size}constructor(i=10485760){this._maxSize=i,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new d,this._users=new d}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(i){this._users.push(i)}deregister(i){this._users.removeUnordered(i)}registerRemoveFunc(i,t){this._removeFuncs.push([i,t])}deregisterRemoveFunc(i){this._removeFuncs.filterInPlace(t=>t[0]!==i)}get maxSize(){return this._maxSize}set maxSize(i){this._maxSize=Math.max(i,-1),this._checkSize()}getSize(i,t){return this._db.get(i.id+t)?.size??0}put(i,t,e,r,h){t=i.id+t;const s=this._db.get(t);if(s&&(this._size-=s.size,i.size-=s.size,this._db.delete(t),s.entry!==e&&this._notifyRemove(t,s.entry,s.size,n.ALL)),r>this._maxSize)return void this._notifyRemove(t,e,r,n.ALL);if(e===void 0)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return console.warn(`Refusing to cache entry with size ${r} for key ${t}`),void this._notifyRemove(t,e,0,n.ALL);const o=1+Math.max(h,f)-c;this._db.set(t,new S(e,r,o)),this._size+=r,i.size+=r,this._checkSize()}updateSize(i,t,e,r){t=i.id+t;const h=this._db.get(t);if(h&&h.entry===e){for(this._size-=h.size,i.size-=h.size;r>this._maxSize;){const s=this._notifyRemove(t,e,r,n.SOME);if(!(s!=null&&s>0))return void this._db.delete(t);r=s}h.size=r,this._size+=r,i.size+=r,this._checkSize()}}pop(i,t){t=i.id+t;const e=this._db.get(t);if(e)return this._size-=e.size,i.size-=e.size,this._db.delete(t),++this._hit,e.entry;++this._miss}get(i,t){t=i.id+t;const e=this._db.get(t);if(e!==void 0)return this._db.delete(t),e.lives=e.lifetime,this._db.set(t,e),++this._hit,e.entry;++this._miss}peek(i,t){const e=this._db.get(i.id+t);return e?++this._hit:++this._miss,e?.entry}get performanceInfo(){const i={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},e=new Array;this._db.forEach((s,o)=>{const a=s.lifetime;e[a]=(e[a]||0)+s.size,this._users.forAll(u=>{const{id:m,name:z}=u;if(o.startsWith(m)){const l=t[z]||0;t[z]=l+s.size}})});const r={};this._users.forAll(s=>{const o=s.name;if("hitRate"in s&&typeof s.hitRate=="number"&&!isNaN(s.hitRate)&&s.hitRate>0){const a=t[o]||0;t[o]=a,r[o]=Math.round(100*s.hitRate)+"%"}else r[o]="0%"});const h=Object.keys(t);h.sort((s,o)=>t[o]-t[s]),h.forEach(s=>i[s]=Math.round(t[s]/2**20)+"MB / "+r[s]);for(let s=e.length-1;s>=0;--s){const o=e[s];o&&(i["Priority "+(s+c-1)]=Math.round(o/this._size*100)+"%")}return i}resetStats(){this._hit=this._miss=0,this._users.forAll(i=>i.resetHitRate())}clear(i){const t=i.id;this._db.forEach((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,n.ALL))}),i.size=0}clearAll(){this._db.forEach((i,t)=>this._notifyRemove(t,i.entry,i.size,n.ALL)),this._users.forAll(i=>i.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(i,t,e,r){let h;return this._removeFuncs.some(s=>{if(i.startsWith(s[0])){const o=s[1](t,r,e);return typeof o=="number"&&(h=o),!0}return!1}),h}_checkSize(){this._users.forAll(i=>this._checkSizeLimits(i)),this._checkSizeLimits()}_checkSizeLimits(i){const t=i??this;if(t.maxSize<0||t.size<=t.maxSize)return;const e=i?.id;let r=!0;for(;r;){r=!1;for(const[h,s]of this._db)if(s.lifetime===0&&(!e||h.startsWith(e))){if(this._purgeItem(h,s,i),t.size<=.9*t.maxSize)return;r||=this._db.has(h)}}for(const[h,s]of this._db)if((!e||h.startsWith(e))&&(this._purgeItem(h,s,i),t.size<=.9*t.maxSize))return}_purgeItem(i,t,e=this._users.find(r=>i.startsWith(r.id))){if(this._db.delete(i),t.lives<=1){this._size-=t.size,e&&(e.size-=t.size);const r=this._notifyRemove(i,t.entry,t.size,n.SOME);r!=null&&r>0&&(this._size+=r,e&&(e.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(i,t))}else--t.lives,this._db.set(i,t)}}class S{constructor(i,t,e){this.entry=i,this.size=t,this.lifetime=e,this.lives=e}}class v{constructor(i,t){this._storage=new g,this.id="",this.name="",this.size=0,this._storage.maxSize=i,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(i,t,e=1){this._storage.put(this,i,t,e,1)}pop(i){return this._storage.pop(this,i)}get(i){return this._storage.get(this,i)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(i){this._storage.maxSize=i}resetHitRate(){}}export{v as b}; diff --git a/main/assets/LabelMetric-BeluzH3o-CQPyji82.js b/main/assets/LabelMetric-BeluzH3o-CQPyji82.js new file mode 100644 index 000000000..6bcfc2a69 --- /dev/null +++ b/main/assets/LabelMetric-BeluzH3o-CQPyji82.js @@ -0,0 +1 @@ +import{o as g,a1 as U,hm as b}from"./main-C7yV2j71.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as Y,H as L,V as B}from"./Texture-BCt2hphT-CtQVMDnp.js";import{F as f,I as c}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import{n as P}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{e as R,o as k}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";let m=class p{constructor(t,e,n,i,r,o,a){this.instanceId=t,this.textureKey=e,this.indexStart=n,this.indexCount=i,this.vertexStart=r,this.vertexCount=o,this.overlaps=a}updateBaseOffsets(t){this.vertexStart+=t.vertexFrom,this.indexStart+=t.indexFrom}clone(){return new p(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(t,e,n,i,r,o,a,h){t.push(e),t.push(n),t.push(i),t.push(r),t.push(o),t.push(a),t.push(h)}serialize(t){return t.push(this.instanceId),t.push(this.textureKey),t.push(this.indexStart),t.push(this.indexCount),t.push(this.vertexStart),t.push(this.vertexCount),t.push(this.overlaps),t}static deserialize(t){const e=t.readInt32(),n=t.readInt32(),i=t.readInt32(),r=t.readInt32(),o=t.readInt32(),a=t.readInt32(),h=t.readInt32();return new p(e,n,i,r,o,a,h)}};m.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT;function I(s,t){if(t!==null){s.push(t.length);for(const e of t)e.serialize(s);return s}s.push(0)}function M(s,t,e){const n=s.readInt32(),i=new Array(n);for(let r=0;rU.getLogger("esri.views.2d.engine.webgl.Utils");function Q(s){switch(s){case f.UNSIGNED_BYTE:return 1;case f.UNSIGNED_SHORT_4_4_4_4:return 2;case f.FLOAT:return 4;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function Z(s){switch(s){case f.UNSIGNED_BYTE:return Uint8Array;case f.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case f.FLOAT:return Float32Array;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function v(s){const t=new Map;for(const e in s){const n=s[e];let i=0;t.set(e,n.map(r=>{const o=new P(r.name,r.count,r.type,i,0,r.normalized||!1);return i+=r.count*Y(r.type),o})),t.get(e).forEach(r=>r.stride=i)}return t}const C=s=>{const t=new Map;for(const e in s)for(const n of s[e])t.set(n.name,n.location);return t},z=s=>{const t={};return s.forEach((e,n)=>t[n]=e?.length?e[0].stride:0),t},d=new Map,tt=(s,t)=>{if(!d.has(s)){const e=v(t),n={strides:z(e),bufferLayouts:e,attributes:C(t)};d.set(s,n)}return d.get(s)},et=s=>s.includes("data:image/svg+xml");function nt(s){const t=[];for(let e=0;e>>31;let n=t>>>23&255,i=8388607&t;return n-=127,n>15?e<<15|31744:n<-25?0:(n<-14&&(i+=8388608,i/=2**(-14-n),n=-15),n+=15,i/=8192,i=G(i,1023),e<<15|n<<10|i)}function G(s,t){const e=Math.floor(s),n=s-e;return e.5||n===.5&&e%2==1)?e+1:e}function T(s){let t=s>>>15,e=s>>10&31,n=1023&s;return t=t?-1:1,e-=15,n/=1024,e>-15?n+=1:e=-14,t*2**e*n}function ot(s){const t=s.map(({name:e,count:n,type:i})=>`${e}.${n}.${i}`).join(",");return b(t)}function u(s,t,e,n,i,r,o){if(s.primitiveName===t){let a=n?.readWithDefault(i,r,s[e]&&o);return s.type==="text"&&(a=a.toString()),void(s[e]=a)}if("type"in s&&s.type!=null){if(s.effects)for(const a of s.effects)u(a,t,e,n,i,r,o);switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(s.symbolLayers)for(const a of s.symbolLayers)u(a,t,e,n,i,r,o);break;case"CIMTextSymbol":s.symbol&&u(s.symbol,t,e,n,i,r,o);break;case"CIMHatchFill":s.lineSymbol&&u(s.lineSymbol,t,e,n,i,r,o);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(s.markerPlacement&&u(s.markerPlacement,t,e,n,i,r,o),s.type==="CIMVectorMarker"&&s.markerGraphics)for(const a of s.markerGraphics)u(a,t,e,n,i,r,o),u(a.symbol,t,e,n,i,r,o)}}}const W=400;function at(s){const t=s.width;return s.effects!=null?W:Math.max(1.25*t,8)}function ct(s,t,e,n){const i=e.packPrecisionFactor??1;switch(e.type){case c.BYTE:if(e.count===1)s.setInt8(n+e.offset,t*i);else for(let r=0;rU.getLogger("esri.views.2d.engine.webgl.Utils");function Q(s){switch(s){case f.UNSIGNED_BYTE:return 1;case f.UNSIGNED_SHORT_4_4_4_4:return 2;case f.FLOAT:return 4;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function Z(s){switch(s){case f.UNSIGNED_BYTE:return Uint8Array;case f.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case f.FLOAT:return Float32Array;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function v(s){const t=new Map;for(const e in s){const n=s[e];let i=0;t.set(e,n.map(r=>{const o=new P(r.name,r.count,r.type,i,0,r.normalized||!1);return i+=r.count*Y(r.type),o})),t.get(e).forEach(r=>r.stride=i)}return t}const C=s=>{const t=new Map;for(const e in s)for(const n of s[e])t.set(n.name,n.location);return t},z=s=>{const t={};return s.forEach((e,n)=>t[n]=e?.length?e[0].stride:0),t},d=new Map,tt=(s,t)=>{if(!d.has(s)){const e=v(t),n={strides:z(e),bufferLayouts:e,attributes:C(t)};d.set(s,n)}return d.get(s)},et=s=>s.includes("data:image/svg+xml");function nt(s){const t=[];for(let e=0;e>>31;let n=t>>>23&255,i=8388607&t;return n-=127,n>15?e<<15|31744:n<-25?0:(n<-14&&(i+=8388608,i/=2**(-14-n),n=-15),n+=15,i/=8192,i=G(i,1023),e<<15|n<<10|i)}function G(s,t){const e=Math.floor(s),n=s-e;return e.5||n===.5&&e%2==1)?e+1:e}function T(s){let t=s>>>15,e=s>>10&31,n=1023&s;return t=t?-1:1,e-=15,n/=1024,e>-15?n+=1:e=-14,t*2**e*n}function ot(s){const t=s.map(({name:e,count:n,type:i})=>`${e}.${n}.${i}`).join(",");return b(t)}function u(s,t,e,n,i,r,o){if(s.primitiveName===t){let a=n?.readWithDefault(i,r,s[e]&&o);return s.type==="text"&&(a=a.toString()),void(s[e]=a)}if("type"in s&&s.type!=null){if(s.effects)for(const a of s.effects)u(a,t,e,n,i,r,o);switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(s.symbolLayers)for(const a of s.symbolLayers)u(a,t,e,n,i,r,o);break;case"CIMTextSymbol":s.symbol&&u(s.symbol,t,e,n,i,r,o);break;case"CIMHatchFill":s.lineSymbol&&u(s.lineSymbol,t,e,n,i,r,o);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(s.markerPlacement&&u(s.markerPlacement,t,e,n,i,r,o),s.type==="CIMVectorMarker"&&s.markerGraphics)for(const a of s.markerGraphics)u(a,t,e,n,i,r,o),u(a.symbol,t,e,n,i,r,o)}}}const W=400;function at(s){const t=s.width;return s.effects!=null?W:Math.max(1.25*t,8)}function ct(s,t,e,n){const i=e.packPrecisionFactor??1;switch(e.type){case c.BYTE:if(e.count===1)s.setInt8(n+e.offset,t*i);else for(let r=0;ri.map(i=>d[i]); +import{I as h,bR as b,n as p,J as l,_ as y,aU as m,a1 as d,a as v,f,o as g,v as r,C as E,S as i,i as w,aB as I}from"./main-C7yV2j71.js";import{k as _}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";async function L(t){const o="portalItem"in t?t:{portalItem:t},{fromItem:n}=await y(async()=>{const{fromItem:a}=await import("./portalLayers-Bh9bAhk4-CIQyh8K9.js");return{fromItem:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url).then(a=>a.p);try{return await n(o)}catch(a){const s=o?.portalItem,u=s?.id||"unset",c=s?.portal?.url||E.portalUrl;throw d.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+c+"', id: '"+u+"')",a),a}}let D=0,e=class extends h.EventedMixin(b(I)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new p(-180,-90,180,90,l.WGS84),this.id=Date.now().toString(16)+"-layer-"+D++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=l.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const o=typeof t=="string"?{url:t}:t;return(await y(async()=>{const{fromUrl:n}=await import("./arcgisLayers-CL8_MH7S-DkYPKRxI.js");return{fromUrl:n}},__vite__mapDeps([10,1,2,4,3,5,6]),import.meta.url)).fromUrl(o)}static fromPortalItem(t){return L(t)}initialize(){this.when().catch(t=>{m(t)||d.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const o=this;"layers"in t&&t.layers.includes(o)?t.layers.remove(o):"tables"in t&&t.tables.includes(o)?t.tables.remove(o):"baseLayers"in t&&t.baseLayers.includes(o)?t.baseLayers.remove(o):"referenceLayers"in t&&t.referenceLayers.includes(o)&&t.referenceLayers.remove(o),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const o=this.parent;return t&&o&&"effectiveVisible"in o&&(t&&=o.effectiveVisible),t}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return v(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await f(t,{query:{f:"json"},responseType:"json"})).data;throw new g("layer:no-attribution-data","Layer does not have attribution data")}};r([i({type:String})],e.prototype,"attributionDataUrl",void 0),r([i({readOnly:!0})],e.prototype,"effectiveVisible",null),r([i({type:p})],e.prototype,"fullExtent",void 0),r([i({readOnly:!0})],e.prototype,"hasAttributionData",null),r([i({type:String,clonable:!1})],e.prototype,"id",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"legendEnabled",void 0),r([i({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),r([i({type:Number,range:{min:0,max:1},nonNullable:!0})],e.prototype,"opacity",void 0),r([i({clonable:!1})],e.prototype,"parent",void 0),r([i({readOnly:!0})],e.prototype,"parsedUrl",null),r([i({type:Boolean,readOnly:!0})],e.prototype,"persistenceEnabled",void 0),r([i({type:Boolean})],e.prototype,"popupEnabled",void 0),r([i({type:Boolean})],e.prototype,"attributionVisible",void 0),r([i({type:l})],e.prototype,"spatialReference",void 0),r([i({type:String})],e.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],e.prototype,"type",void 0),r([i()],e.prototype,"url",void 0),r([i({type:_})],e.prototype,"visibilityTimeExtent",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"visible",void 0),e=r([w("esri.layers.Layer")],e);const S=e;export{S as D}; diff --git a/main/assets/Layer-ChoECxvZ-C4wLrCej.js b/main/assets/Layer-ChoECxvZ-C4wLrCej.js deleted file mode 100644 index 7906cb986..000000000 --- a/main/assets/Layer-ChoECxvZ-C4wLrCej.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./portalLayers-Bh9bAhk4-BaKPDASj.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./fetchService-DbaKmJhP-CtznRt8p.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./arcgisLayers-CL8_MH7S-B7OganfD.js"])))=>i.map(i=>d[i]); -import{I as h,bR as b,n as p,J as l,_ as y,aU as m,a1 as d,a as v,f,o as g,v as r,C as E,S as i,i as w,aB as I}from"./main-BZaw9FpY.js";import{k as _}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";async function L(t){const o="portalItem"in t?t:{portalItem:t},{fromItem:n}=await y(async()=>{const{fromItem:a}=await import("./portalLayers-Bh9bAhk4-BaKPDASj.js");return{fromItem:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url).then(a=>a.p);try{return await n(o)}catch(a){const s=o?.portalItem,u=s?.id||"unset",c=s?.portal?.url||E.portalUrl;throw d.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+c+"', id: '"+u+"')",a),a}}let D=0,e=class extends h.EventedMixin(b(I)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new p(-180,-90,180,90,l.WGS84),this.id=Date.now().toString(16)+"-layer-"+D++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=l.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const o=typeof t=="string"?{url:t}:t;return(await y(async()=>{const{fromUrl:n}=await import("./arcgisLayers-CL8_MH7S-B7OganfD.js");return{fromUrl:n}},__vite__mapDeps([10,1,2,4,3,5,6]),import.meta.url)).fromUrl(o)}static fromPortalItem(t){return L(t)}initialize(){this.when().catch(t=>{m(t)||d.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const o=this;"layers"in t&&t.layers.includes(o)?t.layers.remove(o):"tables"in t&&t.tables.includes(o)?t.tables.remove(o):"baseLayers"in t&&t.baseLayers.includes(o)?t.baseLayers.remove(o):"referenceLayers"in t&&t.referenceLayers.includes(o)&&t.referenceLayers.remove(o),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const o=this.parent;return t&&o&&"effectiveVisible"in o&&(t&&=o.effectiveVisible),t}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return v(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await f(t,{query:{f:"json"},responseType:"json"})).data;throw new g("layer:no-attribution-data","Layer does not have attribution data")}};r([i({type:String})],e.prototype,"attributionDataUrl",void 0),r([i({readOnly:!0})],e.prototype,"effectiveVisible",null),r([i({type:p})],e.prototype,"fullExtent",void 0),r([i({readOnly:!0})],e.prototype,"hasAttributionData",null),r([i({type:String,clonable:!1})],e.prototype,"id",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"legendEnabled",void 0),r([i({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),r([i({type:Number,range:{min:0,max:1},nonNullable:!0})],e.prototype,"opacity",void 0),r([i({clonable:!1})],e.prototype,"parent",void 0),r([i({readOnly:!0})],e.prototype,"parsedUrl",null),r([i({type:Boolean,readOnly:!0})],e.prototype,"persistenceEnabled",void 0),r([i({type:Boolean})],e.prototype,"popupEnabled",void 0),r([i({type:Boolean})],e.prototype,"attributionVisible",void 0),r([i({type:l})],e.prototype,"spatialReference",void 0),r([i({type:String})],e.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],e.prototype,"type",void 0),r([i()],e.prototype,"url",void 0),r([i({type:_})],e.prototype,"visibilityTimeExtent",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"visible",void 0),e=r([w("esri.layers.Layer")],e);const S=e;export{S as D}; diff --git a/main/assets/LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js b/main/assets/LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js new file mode 100644 index 000000000..f8ace8716 --- /dev/null +++ b/main/assets/LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js @@ -0,0 +1 @@ +import{v as l,S as o,i as t,e as s,ag as v}from"./main-C7yV2j71.js";var i;let e=i=class extends s{constructor(r){super(r),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new v}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};l([o({type:String,json:{write:!0}})],e.prototype,"floorField",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllMode",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllLevelIds",void 0),e=i=l([t("esri.layers.support.LayerFloorInfo")],e);const n=e;export{n as v}; diff --git a/main/assets/LayerFloorInfo-DRJ8wfwx-IneDnHGB.js b/main/assets/LayerFloorInfo-DRJ8wfwx-IneDnHGB.js deleted file mode 100644 index decf13388..000000000 --- a/main/assets/LayerFloorInfo-DRJ8wfwx-IneDnHGB.js +++ /dev/null @@ -1 +0,0 @@ -import{v as l,S as o,i as t,e as s,ag as v}from"./main-BZaw9FpY.js";var i;let e=i=class extends s{constructor(r){super(r),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new v}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};l([o({type:String,json:{write:!0}})],e.prototype,"floorField",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllMode",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllLevelIds",void 0),e=i=l([t("esri.layers.support.LayerFloorInfo")],e);const n=e;export{n as v}; diff --git a/main/assets/LayerView-Bish-E63-DRGspiuk.js b/main/assets/LayerView-Bish-E63-DRGspiuk.js deleted file mode 100644 index 79ddc2a81..000000000 --- a/main/assets/LayerView-Bish-E63-DRGspiuk.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as i,i as u,g as C,ag as b,bR as O,at as x,I as H,j as P,a1 as _,aA as q,e as T,d as E,n as I,l as j,am as L,o as N,ah as o,ax as l,ai as U}from"./main-BZaw9FpY.js";import{x as V}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{i as A,l as k,a as M,r as $,b as B}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{l as R,e as D}from"./layerViewUtils-DURAPenP-BHbJhKE8.js";import{i as F}from"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";function G(s){return s!=null&&typeof s=="object"&&s.type==="2d"&&s.view2dType==="linkchart"}let c=class extends T{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};e([i({readOnly:!0})],c.prototype,"version",null),c=e([u("esri.views.layers.support.ClipArea")],c);const S=c;var f;let p=f=class extends S{constructor(s){super(s),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new f({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};e([i({type:[Number,String],json:{write:!0}})],p.prototype,"left",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"right",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"top",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"bottom",void 0),p=f=e([u("esri.views.layers.support.ClipRect")],p);const z=p;var w;const X={base:E,key:"type",typeMap:{extent:I,polygon:j}};let y=w=class extends S{constructor(s){super(s),this.type="geometry",this.geometry=null}clone(){return new w({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};e([i({types:X,json:{read:C,write:!0}})],y.prototype,"geometry",void 0),y=w=e([u("esri.views.layers.support.Geometry")],y);const J=y;let g=class extends S{constructor(s){super(s),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};e([i({type:[[[Number]]],json:{write:!0}})],g.prototype,"path",void 0),g=e([u("esri.views.layers.support.Path")],g);const K=g,m=b.ofType({key:"type",base:null,typeMap:{rect:z,path:K,geometry:J}}),Q=new(b.ofType(A)),ie=s=>{let n=class extends s{constructor(){super(...arguments),this.attached=!1,this.clips=new m,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const r=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new N("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new V),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},l),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},l),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},l),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},l),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},l),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.options.color,haloColor:t.options.haloColor,fillOpacity:t.options.fillOpacity,haloOpacity:t.options.haloOpacity,haloWidth:t.options.haloWidth,haloBlur:t.options.haloBlur}})),()=>{this.container.highlightGradient=M(this.container.highlightGradient,this._mergedHighlights.items)},l),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._updateHighlights()}),U(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},l),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:h})=>{const d=D(h,t);d!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=d)},l)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}_updateHighlights(){}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return $(this)}set highlightOptions(r){B(this,r)}get _mergedHighlights(){if(!this.view)return Q;if(!this.highlights)return this.view.highlights;const r=this.view.highlights.clone();for(const t of this.highlights){const h=r.find(d=>d.name===t.name);h&&(h.options=t.options)}return r}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const r=this.view?.spatialReference;return r==null||this.supportsSpatialReference(r)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(r){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",r),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(r))):this.updateRequested=!1}hitTest(r,t){return Promise.resolve(null)}supportsSpatialReference(r){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":break;default:if(G(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const r=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(r.spatialReferenceNotSupported=t),r}addAttachHandles(r){this.addHandles(r,"attach")}_getHighlightBits(r){r=new Set(r);let t=1,h=0;if(!this.view)return 0;const d=this._mergedHighlights;for(const{name:v}of d)r.delete(v)&&(h=t),t<<=1;for(const v of r)_.getLogger(this).error("#highlights",`${v} was not found. Features in this group will not be highlighted.`);return h}};return e([i()],n.prototype,"attached",void 0),e([i({type:m,set(r){const t=L(r,this._get("clips"),m);this._set("clips",t)}})],n.prototype,"clips",void 0),e([i()],n.prototype,"container",void 0),e([i({type:k})],n.prototype,"highlightOptions",null),e([i({type:b.ofType(A)})],n.prototype,"highlights",void 0),e([i()],n.prototype,"_mergedHighlights",null),e([i()],n.prototype,"moving",void 0),e([i({readOnly:!0})],n.prototype,"spatialReferenceSupported",null),e([i({readOnly:!0})],n.prototype,"updateParameters",void 0),e([i()],n.prototype,"updateRequested",void 0),e([i()],n.prototype,"updating",null),e([i()],n.prototype,"view",void 0),e([i()],n.prototype,"_visibleAtCurrentScale",void 0),e([i({readOnly:!0})],n.prototype,"visibleAtCurrentScale",null),n=e([u("esri.views.2d.layers.LayerView2D")],n),n};let a=class extends O(x(H.EventedMixin(P))){constructor(s){super(s),this._updatingHandles=new F,this.layer=null,this.parent=null}initialize(){this.when().catch(s=>{if(s.name!=="layerview:create-error"){const n=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";_.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${n}')`,s)}})}destroy(){this._updatingHandles=q(this._updatingHandles)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(s){this._overrideIfSome("visible",s)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const s=this.view.timeExtent,n=this.layer?.visibilityTimeExtent;return!s||!n||!s.intersection(n).isEmpty}canResume(){const s=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&R(s)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const s=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(s.viewNotReady=!0),this.layer&&this.layer.loaded||(s.layerNotLoaded=!0);const n=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return R(n)&&this.visibleAtCurrentScale||(s.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(s.outsideVisibilityTimeExtent=!0),this.visible||(s.layerInvisible=!0),s}isUpdating(){return!1}};e([i()],a.prototype,"view",void 0),e([i()],a.prototype,"fullOpacity",null),e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"parent",void 0),e([i({readOnly:!0})],a.prototype,"suspended",null),e([i({readOnly:!0})],a.prototype,"suspendInfo",null),e([i({readOnly:!0})],a.prototype,"legendEnabled",null),e([i({type:Boolean,readOnly:!0})],a.prototype,"updating",null),e([i({readOnly:!0})],a.prototype,"updatingProgress",null),e([i()],a.prototype,"updateSuspended",null),e([i()],a.prototype,"visible",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentScale",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentTimeExtent",null),a=e([u("esri.views.layers.LayerView")],a);const se=a;export{J as A,ie as X,se as Y}; diff --git a/main/assets/LayerView-Bish-E63-I2LV0oDm.js b/main/assets/LayerView-Bish-E63-I2LV0oDm.js new file mode 100644 index 000000000..e1c3a137d --- /dev/null +++ b/main/assets/LayerView-Bish-E63-I2LV0oDm.js @@ -0,0 +1 @@ +import{v as e,S as i,i as u,g as C,ag as b,bR as O,at as x,I as H,j as P,a1 as _,aA as q,e as T,d as E,n as I,l as j,am as L,o as N,ah as o,ax as l,ai as U}from"./main-C7yV2j71.js";import{x as V}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{i as A,l as k,a as M,r as $,b as B}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{l as R,e as D}from"./layerViewUtils-DURAPenP-Eay0s_jy.js";import{i as F}from"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";function G(s){return s!=null&&typeof s=="object"&&s.type==="2d"&&s.view2dType==="linkchart"}let c=class extends T{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};e([i({readOnly:!0})],c.prototype,"version",null),c=e([u("esri.views.layers.support.ClipArea")],c);const S=c;var f;let p=f=class extends S{constructor(s){super(s),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new f({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};e([i({type:[Number,String],json:{write:!0}})],p.prototype,"left",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"right",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"top",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"bottom",void 0),p=f=e([u("esri.views.layers.support.ClipRect")],p);const z=p;var w;const X={base:E,key:"type",typeMap:{extent:I,polygon:j}};let y=w=class extends S{constructor(s){super(s),this.type="geometry",this.geometry=null}clone(){return new w({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};e([i({types:X,json:{read:C,write:!0}})],y.prototype,"geometry",void 0),y=w=e([u("esri.views.layers.support.Geometry")],y);const J=y;let g=class extends S{constructor(s){super(s),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};e([i({type:[[[Number]]],json:{write:!0}})],g.prototype,"path",void 0),g=e([u("esri.views.layers.support.Path")],g);const K=g,m=b.ofType({key:"type",base:null,typeMap:{rect:z,path:K,geometry:J}}),Q=new(b.ofType(A)),ie=s=>{let n=class extends s{constructor(){super(...arguments),this.attached=!1,this.clips=new m,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const r=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new N("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new V),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},l),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},l),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},l),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},l),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},l),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.options.color,haloColor:t.options.haloColor,fillOpacity:t.options.fillOpacity,haloOpacity:t.options.haloOpacity,haloWidth:t.options.haloWidth,haloBlur:t.options.haloBlur}})),()=>{this.container.highlightGradient=M(this.container.highlightGradient,this._mergedHighlights.items)},l),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._updateHighlights()}),U(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},l),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:h})=>{const d=D(h,t);d!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=d)},l)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}_updateHighlights(){}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return $(this)}set highlightOptions(r){B(this,r)}get _mergedHighlights(){if(!this.view)return Q;if(!this.highlights)return this.view.highlights;const r=this.view.highlights.clone();for(const t of this.highlights){const h=r.find(d=>d.name===t.name);h&&(h.options=t.options)}return r}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const r=this.view?.spatialReference;return r==null||this.supportsSpatialReference(r)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(r){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",r),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(r))):this.updateRequested=!1}hitTest(r,t){return Promise.resolve(null)}supportsSpatialReference(r){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":break;default:if(G(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const r=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(r.spatialReferenceNotSupported=t),r}addAttachHandles(r){this.addHandles(r,"attach")}_getHighlightBits(r){r=new Set(r);let t=1,h=0;if(!this.view)return 0;const d=this._mergedHighlights;for(const{name:v}of d)r.delete(v)&&(h=t),t<<=1;for(const v of r)_.getLogger(this).error("#highlights",`${v} was not found. Features in this group will not be highlighted.`);return h}};return e([i()],n.prototype,"attached",void 0),e([i({type:m,set(r){const t=L(r,this._get("clips"),m);this._set("clips",t)}})],n.prototype,"clips",void 0),e([i()],n.prototype,"container",void 0),e([i({type:k})],n.prototype,"highlightOptions",null),e([i({type:b.ofType(A)})],n.prototype,"highlights",void 0),e([i()],n.prototype,"_mergedHighlights",null),e([i()],n.prototype,"moving",void 0),e([i({readOnly:!0})],n.prototype,"spatialReferenceSupported",null),e([i({readOnly:!0})],n.prototype,"updateParameters",void 0),e([i()],n.prototype,"updateRequested",void 0),e([i()],n.prototype,"updating",null),e([i()],n.prototype,"view",void 0),e([i()],n.prototype,"_visibleAtCurrentScale",void 0),e([i({readOnly:!0})],n.prototype,"visibleAtCurrentScale",null),n=e([u("esri.views.2d.layers.LayerView2D")],n),n};let a=class extends O(x(H.EventedMixin(P))){constructor(s){super(s),this._updatingHandles=new F,this.layer=null,this.parent=null}initialize(){this.when().catch(s=>{if(s.name!=="layerview:create-error"){const n=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";_.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${n}')`,s)}})}destroy(){this._updatingHandles=q(this._updatingHandles)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(s){this._overrideIfSome("visible",s)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const s=this.view.timeExtent,n=this.layer?.visibilityTimeExtent;return!s||!n||!s.intersection(n).isEmpty}canResume(){const s=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&R(s)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const s=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(s.viewNotReady=!0),this.layer&&this.layer.loaded||(s.layerNotLoaded=!0);const n=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return R(n)&&this.visibleAtCurrentScale||(s.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(s.outsideVisibilityTimeExtent=!0),this.visible||(s.layerInvisible=!0),s}isUpdating(){return!1}};e([i()],a.prototype,"view",void 0),e([i()],a.prototype,"fullOpacity",null),e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"parent",void 0),e([i({readOnly:!0})],a.prototype,"suspended",null),e([i({readOnly:!0})],a.prototype,"suspendInfo",null),e([i({readOnly:!0})],a.prototype,"legendEnabled",null),e([i({type:Boolean,readOnly:!0})],a.prototype,"updating",null),e([i({readOnly:!0})],a.prototype,"updatingProgress",null),e([i()],a.prototype,"updateSuspended",null),e([i()],a.prototype,"visible",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentScale",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentTimeExtent",null),a=e([u("esri.views.layers.LayerView")],a);const se=a;export{J as A,ie as X,se as Y}; diff --git a/main/assets/LercWorker-C1_0ReXV-D2YXOGf5.js b/main/assets/LercWorker-C1_0ReXV-D2YXOGf5.js deleted file mode 100644 index aa7dee535..000000000 --- a/main/assets/LercWorker-C1_0ReXV-D2YXOGf5.js +++ /dev/null @@ -1 +0,0 @@ -import{hA as P}from"./main-BZaw9FpY.js";var b={};b.defaultNoDataValue=P(-1/0),b.decode=function(i,t){var s=(t=t||{}).encodedMaskData||t.encodedMaskData===null,e=E(i,t.inputOffset||0,s),c=t.noDataValue!=null?P(t.noDataValue):b.defaultNoDataValue,a=Y(e,t.pixelType||Float32Array,t.encodedMaskData,c,t.returnMask),r={width:e.width,height:e.height,pixelData:a.resultPixels,minValue:e.pixels.minValue,maxValue:e.pixels.maxValue,noDataValue:c};return a.resultMask&&(r.maskData=a.resultMask),t.returnEncodedMask&&e.mask&&(r.encodedMaskData=e.mask.bitset?e.mask.bitset:null),t.returnFileInfo&&(r.fileInfo=X(e,c),t.computeUsedBitDepths&&(r.fileInfo.bitDepths=F(e))),r};var Y=function(i,t,s,e,c){var a,r,d=0,m=i.pixels.numBlocksX,k=i.pixels.numBlocksY,y=Math.floor(i.width/m),v=Math.floor(i.height/k),p=2*i.maxZError;s=s||(i.mask?i.mask.bitset:null),a=new t(i.width*i.height),c&&s&&(r=new Uint8Array(i.width*i.height));for(var g,h,x=new Float32Array(y*v),U=0;U<=k;U++){var V=U!==k?v:i.height%k;if(V!==0)for(var M=0;M<=m;M++){var o=M!==m?y:i.width%m;if(o!==0){var D,l,f,w,n=U*i.width*v+M*y,B=i.width-o,u=i.pixels.blocks[d];if(u.encoding<2?(u.encoding===0?D=u.rawData:(S(u.stuffedData,u.bitsPerPixel,u.numValidPixels,u.offset,p,x,i.pixels.maxValue),D=x),l=0):f=u.encoding===2?0:u.offset,s)for(h=0;h>3],w<<=7&n),g=0;g>3]),128&w?(r&&(r[n]=1),a[n++]=u.encoding<2?D[l++]:f):(r&&(r[n]=0),a[n++]=e),w<<=1;n+=B}else if(u.encoding<2)for(h=0;h0){var r=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(a=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,k=0;do{if(d>0)for(;d--;)r[k++]=a.getUint8(m++);else{var y=a.getUint8(m++);for(d=-d;d--;)r[k++]=y}d=a.getInt16(m,!0),m+=2}while(m0?1:0),h=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*h);for(var x=1e9,U=0,V=0;V3)throw"Invalid block encoding ("+l.encoding+")";if(l.encoding!==2){if(f!==0&&f!==2){if(f>>=6,l.offsetType=f,f===2)l.offset=a.getInt8(1),o++;else if(f===1)l.offset=a.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";l.offset=a.getFloat32(1,!0),o+=4}if(x=Math.min(l.offset,x),l.encoding===1)if(f=a.getUint8(o),o++,l.bitsPerPixel=63&f,f>>=6,l.numValidPixelsType=f,f===2)l.numValidPixels=a.getUint8(o),o++;else if(f===1)l.numValidPixels=a.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";l.numValidPixels=a.getUint32(o,!0),o+=4}}var w;if(t+=o,l.encoding!=3){if(l.encoding===0){var n=(e.pixels.numBytes-1)/4;if(n!==Math.floor(n))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*n),new Uint8Array(w).set(new Uint8Array(i,t,4*n));for(var B=new Float32Array(w),u=0;u=t)m=k>>>p-t&y,p-=t;else{var x=t-p;m=(k&y)<>>(p=32-x)}a[d]=m>3],w<<=7&n),g=0;g>3]),128&w?(r&&(r[n]=1),a[n++]=u.encoding<2?D[l++]:f):(r&&(r[n]=0),a[n++]=e),w<<=1;n+=B}else if(u.encoding<2)for(h=0;h0){var r=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(a=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,k=0;do{if(d>0)for(;d--;)r[k++]=a.getUint8(m++);else{var y=a.getUint8(m++);for(d=-d;d--;)r[k++]=y}d=a.getInt16(m,!0),m+=2}while(m0?1:0),h=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*h);for(var x=1e9,U=0,V=0;V3)throw"Invalid block encoding ("+l.encoding+")";if(l.encoding!==2){if(f!==0&&f!==2){if(f>>=6,l.offsetType=f,f===2)l.offset=a.getInt8(1),o++;else if(f===1)l.offset=a.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";l.offset=a.getFloat32(1,!0),o+=4}if(x=Math.min(l.offset,x),l.encoding===1)if(f=a.getUint8(o),o++,l.bitsPerPixel=63&f,f>>=6,l.numValidPixelsType=f,f===2)l.numValidPixels=a.getUint8(o),o++;else if(f===1)l.numValidPixels=a.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";l.numValidPixels=a.getUint32(o,!0),o+=4}}var w;if(t+=o,l.encoding!=3){if(l.encoding===0){var n=(e.pixels.numBytes-1)/4;if(n!==Math.floor(n))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*n),new Uint8Array(w).set(new Uint8Array(i,t,4*n));for(var B=new Float32Array(w),u=0;u=t)m=k>>>p-t&y,p-=t;else{var x=t-p;m=(k&y)<>>(p=32-x)}a[d]=mthis._computeExtent(),t=>{t?.pending==null&&this._set("extent",t!=null?t.extent:null)},O))}get targets(){return this._get("targets")||new f}set targets(t){this._set("targets",j(t,this.targets,f))}get spatialReference(){return this.observer?.position!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[this.observer?.position]}async waitComputeExtent(){const t=this._computeExtent();return t!=null?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(this.observer?.position==null||t==null)return null;const r=p=>X(p.position,p.elevationInfo)==="absolute-height",n=this.observer.position,v=C(n.x,n.y,n.z,n.x,n.y,n.z);for(const p of this.targets)if(p.position!=null){const u=N(p.position,t);if(u.pending!=null)return{pending:u.pending,extent:null};if(u.geometry!=null){const{x:z,y:S,z:_}=u.geometry;F(v,[z,S,_])}}const d=H(v,t);return r(this.observer)&&this.targets.every(r)||(d.zmin=void 0,d.zmax=void 0),{pending:null,extent:d}}clear(){this.observer=null,this.targets.removeAll()}};e([i({type:["line-of-sight"]})],o.prototype,"type",void 0),e([i({type:E,json:{read:!0,write:!0}})],o.prototype,"observer",void 0),e([i({cast:P,type:f,nonNullable:!0,json:{read:!0,write:!0}})],o.prototype,"targets",null),e([i({value:null,readOnly:!0})],o.prototype,"extent",void 0),e([i({readOnly:!0})],o.prototype,"spatialReference",null),e([i({readOnly:!0})],o.prototype,"requiredPropertiesForEditing",null),o=e([h("esri.analysis.LineOfSightAnalysis")],o);const c=o,V=g.ofType(I);let s=class extends U(Y(D)){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new c,this.opacity=1}initialize(){this.addHandles(w(()=>this.analysis,(t,r)=>{r!=null&&r.parent===this&&(r.parent=null),t!=null&&(t.parent=this)},O))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return this.analysis?.observer}set observer(t){const{analysis:r}=this;r&&(r.observer=t)}get targets(){return this.analysis!=null?this.analysis.targets:new g}set targets(t){j(t,this.analysis?.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new c)}};e([i({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),e([i({type:["LineOfSightLayer"]})],s.prototype,"operationalLayerType",void 0),e([i({type:E,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],s.prototype,"observer",null),e([i({type:V,json:{read:!0,write:{ignoreOrigin:!0}}})],s.prototype,"targets",null),e([i({nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"analysis",void 0),e([i({readOnly:!0})],s.prototype,"fullExtent",null),e([i({readOnly:!0})],s.prototype,"spatialReference",null),e([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),e([i({type:["show","hide"]})],s.prototype,"listMode",void 0),s=e([h("esri.layers.LineOfSightLayer")],s);const Lt=s;export{Lt as default}; diff --git a/main/assets/LineOfSightLayer-D6sUQaEP-CM4VKqod.js b/main/assets/LineOfSightLayer-D6sUQaEP-CM4VKqod.js new file mode 100644 index 000000000..36e286cdf --- /dev/null +++ b/main/assets/LineOfSightLayer-D6sUQaEP-CM4VKqod.js @@ -0,0 +1 @@ +import{bA as x,aa as A,dM as y,v as e,S as i,w as b,i as h,ag as g,eb as P,ah as w,ax as O,am as j,j as T,aP as $,ip as C,it as F,jn as H}from"./main-C7yV2j71.js";import{y as M}from"./Analysis-BPgJ-FCw-Bdup4FTz.js";import{n as q,u as L}from"./featureReferenceUtils-Ct4KY5u7-Cgw_hpcQ.js";import{C as m}from"./persistable-C6RBwzJi-DoQq7vOT.js";import{q as R}from"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import{V as N}from"./projection-BA9M1R7d-DXrPfsKU.js";import{l as X}from"./elevationInfoUtils-mOZsPH2J-Bwot-813.js";import{m as Y}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{E as U}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-CiIWUavi.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CdQQbSdq.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-DhJ9Zyo3.js";import"./lineSegment-CcqvCARM-_ZNy9SM-.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-BFbGjGZW.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";let a=class extends x(A(T)){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return y(this.position,t.position)&&y(this.elevationInfo,t.elevationInfo)&&q(this.feature,t.feature)}};e([i({type:b,json:{write:{isRequired:!0}}})],a.prototype,"position",void 0),e([i({type:R}),m()],a.prototype,"elevationInfo",void 0),e([i(L)],a.prototype,"feature",void 0),a=e([h("esri.analysis.LineOfSightAnalysisObserver")],a);const E=a;let l=class extends x($){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return y(this.position,t.position)&&y(this.elevationInfo,t.elevationInfo)&&q(this.feature,t.feature)}};e([i({type:b}),m()],l.prototype,"position",void 0),e([i({type:R}),m()],l.prototype,"elevationInfo",void 0),e([i(L)],l.prototype,"feature",void 0),l=e([h("esri.analysis.LineOfSightAnalysisTarget")],l);const I=l,f=g.ofType(I);let o=class extends M{constructor(t){super(t),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles(w(()=>this._computeExtent(),t=>{t?.pending==null&&this._set("extent",t!=null?t.extent:null)},O))}get targets(){return this._get("targets")||new f}set targets(t){this._set("targets",j(t,this.targets,f))}get spatialReference(){return this.observer?.position!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[this.observer?.position]}async waitComputeExtent(){const t=this._computeExtent();return t!=null?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(this.observer?.position==null||t==null)return null;const r=p=>X(p.position,p.elevationInfo)==="absolute-height",n=this.observer.position,v=C(n.x,n.y,n.z,n.x,n.y,n.z);for(const p of this.targets)if(p.position!=null){const u=N(p.position,t);if(u.pending!=null)return{pending:u.pending,extent:null};if(u.geometry!=null){const{x:z,y:S,z:_}=u.geometry;F(v,[z,S,_])}}const d=H(v,t);return r(this.observer)&&this.targets.every(r)||(d.zmin=void 0,d.zmax=void 0),{pending:null,extent:d}}clear(){this.observer=null,this.targets.removeAll()}};e([i({type:["line-of-sight"]})],o.prototype,"type",void 0),e([i({type:E,json:{read:!0,write:!0}})],o.prototype,"observer",void 0),e([i({cast:P,type:f,nonNullable:!0,json:{read:!0,write:!0}})],o.prototype,"targets",null),e([i({value:null,readOnly:!0})],o.prototype,"extent",void 0),e([i({readOnly:!0})],o.prototype,"spatialReference",null),e([i({readOnly:!0})],o.prototype,"requiredPropertiesForEditing",null),o=e([h("esri.analysis.LineOfSightAnalysis")],o);const c=o,V=g.ofType(I);let s=class extends U(Y(D)){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new c,this.opacity=1}initialize(){this.addHandles(w(()=>this.analysis,(t,r)=>{r!=null&&r.parent===this&&(r.parent=null),t!=null&&(t.parent=this)},O))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return this.analysis?.observer}set observer(t){const{analysis:r}=this;r&&(r.observer=t)}get targets(){return this.analysis!=null?this.analysis.targets:new g}set targets(t){j(t,this.analysis?.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new c)}};e([i({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),e([i({type:["LineOfSightLayer"]})],s.prototype,"operationalLayerType",void 0),e([i({type:E,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],s.prototype,"observer",null),e([i({type:V,json:{read:!0,write:{ignoreOrigin:!0}}})],s.prototype,"targets",null),e([i({nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"analysis",void 0),e([i({readOnly:!0})],s.prototype,"fullExtent",null),e([i({readOnly:!0})],s.prototype,"spatialReference",null),e([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),e([i({type:["show","hide"]})],s.prototype,"listMode",void 0),s=e([h("esri.layers.LineOfSightLayer")],s);const Lt=s;export{Lt as default}; diff --git a/main/assets/LinkChartLayer-KcYDvLxD-5ZdeWZDk.js b/main/assets/LinkChartLayer-KcYDvLxD-5ZdeWZDk.js deleted file mode 100644 index 20590fbd2..000000000 --- a/main/assets/LinkChartLayer-KcYDvLxD-5ZdeWZDk.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as Y,n as ue,o as Q,ah as Te,av as Ee,a1 as R,an as ce,$ as Ne,bP as ye,w as oe,m as me,v as M,S as w,i as Ie}from"./main-BZaw9FpY.js";import{m as De}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as xe}from"./Layer-ChoECxvZ-C4wLrCej.js";import{z as B}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{c as _e}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as $,A as Re,J as Oe,M as Ae,I as ve,D as Se,L as Ge,N as Pe,E as He,w as Fe,k as T,T as A,n as J,r as V,P as Ue,m as b,b as ge,f as Be,B as fe,o as $e}from"./KnowledgeGraphSublayer-DPj4igi1-DI2RO5d6.js";import{u as ze}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as We}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{F as Qe}from"./knowledgeGraphService-DOJz0fzA-6E_aD1T8.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-DPu3VSRE.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./FeatureStore-Co2V0sVE-CXrTGv5U.js";import"./BoundsStore--N6o1xkF-DBAJ8yky.js";import"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";import"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./signal-CETehA7D-vStzfbaY.js";import"./clientSideDefaults-BqqayPct-BMC57bnT.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";var q;(function(e){e.MULTIPLIER="multiplier",e.ABSOLUTE="absoluteValue"})(q||(q={}));let f=class extends We(ze(je(De(xe)))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(Y.ofType($)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(Y.ofType($)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.inclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.inclusionModeDefinition)throw new Q("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(Te(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),Ee))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}=e;return{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}}_initializeLayerProperties(e){if(!this.title&&this.url){const r=this.url.split("/");this.title=r[r.length-2]}const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new Q("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((r,d)=>{const u=this._graphTypeLookup.get(d);if(!u)return R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(d);u.type==="relationship"?t.has(d)||(t.add(d),a.push(u)):u.type==="entity"?t.has(d)||(t.add(d),i.push(u)):(R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(d))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const o=new Re({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=o}load(e){const t=async()=>{const i=[],a=[];this.loadLayerAssumingLocalCache(),await fe(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(o=>{o.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(o=>{a.push(o.refreshCachedQueryEngine()),i.push(new Promise(r=>{o.on("layerview-create",()=>{r(null)})}))}),this.tables.forEach(o=>{a.push(o.refreshCachedQueryEngine())}),await Promise.all(a)};return this.addResolvingPromise(new Promise(i=>{Qe(this.url).then(async a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const o=$e.getInstance();for(const[r,d]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const u of d.members?.values()??[]){const L=o.readFromStoreById(`${r}__${u.id}`);L&&ce(this.dataManager.sublayerCaches,r,()=>new Map).set(u.id,L)}await t()}else{const o=this.defaultLinkChartConfig?.layoutMode==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,o,!0).then(async()=>{Ne(e),await t()}))}i(null)})})),Promise.resolve(this)}set inclusionModeDefinition(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("inclusionModeDefinition",e):R.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await Oe(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));await this._handleNewRecords(a)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let a=[];for(const r of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id)&&a.push(r);if(t){const r=new Set,d=[];for(const u of a)if(this.dataManager.nodeConnectionsLookup.has(u.id))for(const L of this.dataManager.nodeConnectionsLookup.get(u.id))r.add(L);for(const u of r)if(this.dataManager.memberIdTypeLookup.has(u))for(const L of this.dataManager.memberIdTypeLookup.get(u))this.dataManager.relationshipTypeNames.has(L)&&d.push({id:u,typeName:L});a=a.concat(d)}this.dataManager.removeFromLayer(a);for(const r of a)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);i&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const o=[];return this.layers.forEach(r=>{o.push(r.refreshCachedQueryEngine())}),await Promise.all(o),this._refreshNamedTypes(),a}async expand(e,t){const i=await this.dataManager.getConnectedRecordIds(e,t),a=i.filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));return await this._handleNewRecords(i),{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===ye.DEFAULTS?this._createSublayers(e,this.layers,t=>!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===ye.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const a=ce(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(({id:o,linkChartLocation:r})=>{if(a.add(o),r){const d=r instanceof _e?r:B(r);this.dataManager.relationshipTypeNames.has(i)?this.relationshipLinkChartDiagramLookup.set(o,d):this.entityLinkChartDiagramLookup.set(o,d)}})})}async calculateLinkChartLayout(e="RADIAL_TREE",t){const i=[],a=[],o=[];this.dataManager.sublayerCaches.forEach((n,l)=>{this.dataManager.entityTypeNames.has(l)?n.forEach(s=>{i.push({typeName:l,feature:s})}):this.dataManager.relationshipTypeNames.has(l)&&n.forEach(s=>{a.push({typeName:l,feature:s})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,d=new Map,u=new Map,L=new Map,k=new Uint8Array(i.length),y=new Float64Array(i.length),m=new Float64Array(i.length),g=new Float64Array(i.length),ne=new Float64Array(i.length),K=new Uint32Array(a.length),X=new Uint32Array(a.length),re=new Float64Array(a.length),se=new Float64Array(a.length),c=[],Le="FORCE_DIRECTED",x=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let P,le="FORCE_DIRECTED",p=0,E=0;const Ce=Ae.apply;switch(le=e==="GEOGRAPHIC"?Le:e,le){case"FORCE_DIRECTED":P=Fe.apply;break;case"COMMUNITY":P=He.apply;break;case"HIERARCHICAL":P=Pe.apply;break;case"RADIAL_TREE":P=Ge.apply;break;case"SMART_TREE":P=Se.apply;break;default:P=ve.apply}let Z=!1;i.forEach(({typeName:n,feature:l})=>{if(e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"&&t?.lockedNodeLocations?.has(l.attributes[T])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)?k[p]=A.IsGeographic:k[p]=A.None;const s=t.lockedNodeLocations.get(l.attributes[T]);y[p]=s.x,m[p]=s.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)){k[p]=A.IsGeographic;let s=null;const I=l.attributes[this.dataManager.geographicLookup.get(n).name];switch(this.dataManager.geographicLookup.get(n)?.geometryType){case"esriGeometryPoint":y[p]=I?.x,m[p]=I?.y;break;case"esriGeometryPolygon":s=I?.centroid,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":s=I?.extent?.center,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;default:k[p]=A.IsMovable}(y[p]==null||m[p]==null||Number.isNaN(y[p])||Number.isNaN(m[p]))&&(k[p]=A.IsMovable,y[p]=0,m[p]=0)}else if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){!Z&&t?.lockedNodeLocations?.has(l.attributes[T])&&(Z=!0);const s=t?.timeInfoByTypeName?.get(n),I=s?.startField,v=I&&s?.startField?l.attributes[I]:null;g[p]=v?new Date(v).getTime():NaN;const C=s?.endField,D=C&&s?.endField?l.attributes[C]:null;ne[p]=D?new Date(D).getTime():NaN,y[p]=0,m[p]=0,k[p]=A.IsMovable}else k[p]=A.IsMovable,y[p]=0,m[p]=0;L.set(l.attributes[T],p),c[p]={feature:l,typeName:n},p++}),Z&&R.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let he=!1;const ee=new Map;a.forEach(n=>{const l=n.feature.attributes[J],s=n.feature.attributes[V],I=L.get(l),v=L.get(s),C=t?.timeInfoByTypeName?.get(n.typeName),D=t?.timeInfoByTypeName?C?.startField:null,O=D?n.feature.attributes[D]:null,j=C?.endField,H=j?n.feature.attributes[j]:null;if(I!==void 0&&v!==void 0){let S=l+"-"+s;e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(S=S+"-"+O+"-"+H);const U=ee.get(S);U?.has(n.typeName)||(K[E]=I,X[E]=v,e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(re[E]=O?new Date(O).getTime():NaN,se[E]=H?new Date(H).getTime():NaN),U===void 0?ee.set(S,new Map([[n.typeName,E]])):U.set(n.typeName,E),E++),o.push(n)}else he=!0,this.relationshipLinkChartDiagramLookup.set(l,null)}),he&&R.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const pe=this._validateLayoutSettings(e,t),te=this._convertLayoutSettingsToCalculationSettings(pe);await Ue();let z=!1,N=null;if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){let n;({success:z,links:N,graphics:n}=Ce(k,y,m,g,ne,K.subarray(0,E),X.subarray(0,E),re.subarray(0,E),se.subarray(0,E),e==="CHRONOLOGICAL_MULTIPLE",t?.chronologicalLayoutSettings??{})),z&&(this.chronologicalAuxiliaryGraphics=n)}else({success:z,links:N}=P(k,y,m,K.subarray(0,E),X.subarray(0,E),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(!z)throw new Q("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let n=0;n84.9999?m[n]=84.9999:m[n]<-84.9999&&(m[n]=-84.9999),y[n]>179.9999?y[n]=179.9999:y[n]<-179.9999&&(y[n]=-179.9999),c[n].feature.attributes[b]=new oe(y[n],m[n]),r.has(c[n].typeName))r.get(c[n].typeName)?.set(c[n].feature.attributes[T],c[n].feature);else{const s=new Map;s.set(c[n].feature.attributes[T],c[n].feature),r.set(c[n].typeName,s)}u.set(c[n].feature.attributes[T],c[n].feature);const l=B(c[n].feature.attributes[b]);this.entityLinkChartDiagramLookup.set(c[n].feature.attributes[T],c[n].feature.attributes[b]?l:null),c[n].feature.attributes[b].xx.xmax&&(x.xmax=c[n].feature.attributes[b].x),c[n].feature.attributes[b].yx.ymax&&(x.ymax=c[n].feature.attributes[b].y)}if(this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,!N)throw new Q("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const W=new Map,ae=new Map,ie=new Map,de=new Set;for(let n=0;n85.5?l[h][1]=85.5:l[h][1]<-85.5&&(l[h][1]=-85.5),l[h][0]>179.9999?l[h][0]=179.9999:l[h][0]<-179.9999&&(l[h][0]=-179.9999);W.has(C)?W.get(C).push(l):W.set(C,[l])}const j=W.get(C);ae.has(C)||(ae.set(C,new Map),ie.set(C,new Map));const H=ae.get(C),S=ie.get(C);H.has(s.typeName)||(H.set(s.typeName,j.shift()),S.set(s.typeName,0));const U=H.get(s.typeName);S.set(s.typeName,S.get(s.typeName)+1);const Me=new me({paths:[U]});if(s.feature.attributes[b]=Me,d.has(s.typeName))d.get(s.typeName)?.set(s.feature.attributes[T],s.feature);else{const h=new Map;h.set(s.feature.attributes[T],s.feature),d.set(s.typeName,h)}u.set(s.feature.attributes[T],s.feature);const we=B(s.feature.attributes[b]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[T],s.feature.attributes[b]?we:null)}for(const n of o)n.feature.attributes[Be]=ie.get(n.feature.attributes[J]+"-"+n.feature.attributes[V])?.get(n.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:pe},{nodes:r,links:d,idMap:u}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const i=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(a=>{i.push(a.refreshCachedQueryEngine())}),await Promise.all(i),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(t=>{t?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;a&&(o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(r,new oe({x:o.x,y:o.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((t,i)=>{if(t.useAllData=!1,t.members&&t.members.size>0){if(!this.dataManager.sublayerCaches.get(i))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(i).keys()));Array.from(t.members.keys()).filter(o=>!a.has(o)).forEach(o=>{t.members?.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e){let t=[];for(const a of this.dataManager.relationshipTypeNames){const o=this.sublayerIdsCache.get(a);o&&(t=t.concat(Array.from(o.keys())))}const i=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(i),{records:i}}async connectFromEntities(e){let t=[];for(const o of this.dataManager.relationshipTypeNames){const r=this.sublayerIdsCache.get(o);r&&(t=t.concat(Array.from(r.keys())))}let i=[];for(const o of this.dataManager.entityTypeNames){const r=this.sublayerIdsCache.get(o);r&&(i=i.concat(Array.from(r)))}const a=await this.dataManager.getRelationshipsFromNodes(e,i,t);return await this._handleNewRecords(a),{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const i=new Map;this.layers.forEach(a=>{i.set(a.objectType.name,a.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t){const o=this._graphTypeLookup.get(a);if(o){const r=this._createSublayer(o);o.type==="entity"?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),r.geometryType?this.layers.push(r):this.tables.push(r),this.dataManager.sublayerCaches.set(a,new Map)}}await fe(this,t),await this.dataManager.refreshCacheContent(e.map(a=>a.id));const i=Object.assign({},this._currentLinkChartConfig.layoutOptions);i.lockedNodeLocations=new Map;for(const[a,o]of this.entityLinkChartDiagramLookup.entries())o&&i.lockedNodeLocations.set(a,new oe(o.coords[0],o.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,i)}_createSublayers(e,t,i){e.forEach(a=>{const o=this._createSublayer(a);i(o)&&t.push(o),this._updateSublayerCaches(a)})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const a=e.find(o=>o.type===i.graphType&&o.name===i.graphTypeName);a&&(i.objectType=a,i.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;if(!a)return;o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const d=B(o);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(r,d):this.entityLinkChartDiagramLookup.set(r,d),this.linkChartExtent.xmin>o.x&&(this.linkChartExtent.xmin=o.x),this.linkChartExtent.xmaxo.y&&(this.linkChartExtent.ymin=o.y),this.linkChartExtent.ymax{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(t=>{const i=this.relationshipLinkChartDiagramLookup.get(t.attributes[J]),a=this.relationshipLinkChartDiagramLookup.get(t.attributes[V]);if(i&&a){const o=B(new me({paths:[[[i.coords[0],i.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(t.attributes[T],o)}else this.relationshipLinkChartDiagramLookup.set(t.attributes[T],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(e,t){const i=g=>typeof g=="number"&&!isNaN(g),a=g=>i(g)&&g>=1,o=g=>i(g)&&g>=1,r=g=>Object.values(q).includes(g),d=g=>i(g)&&g>=0,u={organicLayoutSettings:{},chronologicalLayoutSettings:{}};if(!new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC","CHRONOLOGICAL_MULTIPLE","CHRONOLOGICAL_SINGLE"]).has(e)||!t)return u;t.organicLayoutSettings??={};const{computationBudgetTime:L,repulsionRadiusMultiplier:k,idealEdgeLength:y,idealEdgeLengthType:m}=t.organicLayoutSettings;if(o(L)?u.organicLayoutSettings.computationBudgetTime=L:L!==void 0&&R.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),a(k)?u.organicLayoutSettings.repulsionRadiusMultiplier=k:k!==void 0&&R.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting"),e==="GEOGRAPHIC"&&(y!==void 0||m!==void 0)&&(r(m)?u.organicLayoutSettings.idealEdgeLengthType=m:m!==void 0&&R.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),d(y)?u.organicLayoutSettings.idealEdgeLength=y:y!==void 0&&R.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),(e==="CHRONOLOGICAL_MULTIPLE"||e==="CHRONOLOGICAL_SINGLE")&&t.chronologicalLayoutSettings){const g=t.chronologicalLayoutSettings;g.durationLineWidth&&g.durationLineWidth<0&&R.getLogger(this).warn("Invalid layout durationLineWidth setting, will revert to default setting")}return u}_convertLayoutSettingsToCalculationSettings(e){e.organicLayoutSettings??={};let t=e.organicLayoutSettings.idealEdgeLength;return e.organicLayoutSettings.idealEdgeLengthType===q.ABSOLUTE&&(t===void 0?t=-1:t*=-1),{computationBudgetTime:e.organicLayoutSettings.computationBudgetTime,repulsionRadiusMultiplier:e.organicLayoutSettings.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new $({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}};M([w()],f.prototype,"dataPreloadedInLocalCache",void 0),M([w()],f.prototype,"defaultLinkChartConfig",void 0),M([w()],f.prototype,"dataManager",void 0),M([w()],f.prototype,"inclusionModeDefinition",null),M([w()],f.prototype,"knowledgeGraph",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"layers",void 0),M([w()],f.prototype,"entityLinkChartDiagramLookup",void 0),M([w()],f.prototype,"relationshipLinkChartDiagramLookup",void 0),M([w()],f.prototype,"linkChartExtent",void 0),M([w()],f.prototype,"memberEntityTypes",void 0),M([w()],f.prototype,"memberRelationshipTypes",void 0),M([w({type:["LinkChartLayer"]})],f.prototype,"operationalLayerType",void 0),M([w()],f.prototype,"sublayerIdsCache",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"tables",void 0),M([w({json:{read:!1}})],f.prototype,"type",void 0),M([w({json:{read:!1}})],f.prototype,"chronologicalAuxiliaryGraphics",void 0),f=M([Ie("esri.layers.LinkChartLayer")],f);const Ga=f;export{Ga as default}; diff --git a/main/assets/LinkChartLayer-KcYDvLxD-YSUnl4xT.js b/main/assets/LinkChartLayer-KcYDvLxD-YSUnl4xT.js new file mode 100644 index 000000000..10ad7f612 --- /dev/null +++ b/main/assets/LinkChartLayer-KcYDvLxD-YSUnl4xT.js @@ -0,0 +1 @@ +import{ag as Y,n as ue,o as Q,ah as Te,av as Ee,a1 as R,an as ce,$ as Ne,bP as ye,w as oe,m as me,v as M,S as w,i as Ie}from"./main-C7yV2j71.js";import{m as De}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as xe}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{z as B}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{c as _e}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as $,A as Re,J as Oe,M as Ae,I as ve,D as Se,L as Ge,N as Pe,E as He,w as Fe,k as T,T as A,n as J,r as V,P as Ue,m as b,b as ge,f as Be,B as fe,o as $e}from"./KnowledgeGraphSublayer-DPj4igi1-DXaAi0X5.js";import{u as ze}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as We}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{F as Qe}from"./knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./GraphicsLayer-DfeGaYc1-DAZy-iUY.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-DnaxtAbX.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./FeatureStore-Co2V0sVE-BoTs_3tu.js";import"./BoundsStore--N6o1xkF-mEMXylgh.js";import"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";import"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./signal-CETehA7D-DxK1orqE.js";import"./clientSideDefaults-BqqayPct-B0cLE-po.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./popupUtils-B0uZcXX0-B9v3xvNZ.js";var q;(function(e){e.MULTIPLIER="multiplier",e.ABSOLUTE="absoluteValue"})(q||(q={}));let f=class extends We(ze(je(De(xe)))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(Y.ofType($)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(Y.ofType($)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.inclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.inclusionModeDefinition)throw new Q("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(Te(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),Ee))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}=e;return{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}}_initializeLayerProperties(e){if(!this.title&&this.url){const r=this.url.split("/");this.title=r[r.length-2]}const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new Q("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((r,d)=>{const u=this._graphTypeLookup.get(d);if(!u)return R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(d);u.type==="relationship"?t.has(d)||(t.add(d),a.push(u)):u.type==="entity"?t.has(d)||(t.add(d),i.push(u)):(R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(d))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const o=new Re({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=o}load(e){const t=async()=>{const i=[],a=[];this.loadLayerAssumingLocalCache(),await fe(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(o=>{o.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(o=>{a.push(o.refreshCachedQueryEngine()),i.push(new Promise(r=>{o.on("layerview-create",()=>{r(null)})}))}),this.tables.forEach(o=>{a.push(o.refreshCachedQueryEngine())}),await Promise.all(a)};return this.addResolvingPromise(new Promise(i=>{Qe(this.url).then(async a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const o=$e.getInstance();for(const[r,d]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const u of d.members?.values()??[]){const L=o.readFromStoreById(`${r}__${u.id}`);L&&ce(this.dataManager.sublayerCaches,r,()=>new Map).set(u.id,L)}await t()}else{const o=this.defaultLinkChartConfig?.layoutMode==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,o,!0).then(async()=>{Ne(e),await t()}))}i(null)})})),Promise.resolve(this)}set inclusionModeDefinition(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("inclusionModeDefinition",e):R.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await Oe(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));await this._handleNewRecords(a)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let a=[];for(const r of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id)&&a.push(r);if(t){const r=new Set,d=[];for(const u of a)if(this.dataManager.nodeConnectionsLookup.has(u.id))for(const L of this.dataManager.nodeConnectionsLookup.get(u.id))r.add(L);for(const u of r)if(this.dataManager.memberIdTypeLookup.has(u))for(const L of this.dataManager.memberIdTypeLookup.get(u))this.dataManager.relationshipTypeNames.has(L)&&d.push({id:u,typeName:L});a=a.concat(d)}this.dataManager.removeFromLayer(a);for(const r of a)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);i&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const o=[];return this.layers.forEach(r=>{o.push(r.refreshCachedQueryEngine())}),await Promise.all(o),this._refreshNamedTypes(),a}async expand(e,t){const i=await this.dataManager.getConnectedRecordIds(e,t),a=i.filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));return await this._handleNewRecords(i),{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===ye.DEFAULTS?this._createSublayers(e,this.layers,t=>!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===ye.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const a=ce(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(({id:o,linkChartLocation:r})=>{if(a.add(o),r){const d=r instanceof _e?r:B(r);this.dataManager.relationshipTypeNames.has(i)?this.relationshipLinkChartDiagramLookup.set(o,d):this.entityLinkChartDiagramLookup.set(o,d)}})})}async calculateLinkChartLayout(e="RADIAL_TREE",t){const i=[],a=[],o=[];this.dataManager.sublayerCaches.forEach((n,l)=>{this.dataManager.entityTypeNames.has(l)?n.forEach(s=>{i.push({typeName:l,feature:s})}):this.dataManager.relationshipTypeNames.has(l)&&n.forEach(s=>{a.push({typeName:l,feature:s})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,d=new Map,u=new Map,L=new Map,k=new Uint8Array(i.length),y=new Float64Array(i.length),m=new Float64Array(i.length),g=new Float64Array(i.length),ne=new Float64Array(i.length),K=new Uint32Array(a.length),X=new Uint32Array(a.length),re=new Float64Array(a.length),se=new Float64Array(a.length),c=[],Le="FORCE_DIRECTED",x=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let P,le="FORCE_DIRECTED",p=0,E=0;const Ce=Ae.apply;switch(le=e==="GEOGRAPHIC"?Le:e,le){case"FORCE_DIRECTED":P=Fe.apply;break;case"COMMUNITY":P=He.apply;break;case"HIERARCHICAL":P=Pe.apply;break;case"RADIAL_TREE":P=Ge.apply;break;case"SMART_TREE":P=Se.apply;break;default:P=ve.apply}let Z=!1;i.forEach(({typeName:n,feature:l})=>{if(e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"&&t?.lockedNodeLocations?.has(l.attributes[T])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)?k[p]=A.IsGeographic:k[p]=A.None;const s=t.lockedNodeLocations.get(l.attributes[T]);y[p]=s.x,m[p]=s.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)){k[p]=A.IsGeographic;let s=null;const I=l.attributes[this.dataManager.geographicLookup.get(n).name];switch(this.dataManager.geographicLookup.get(n)?.geometryType){case"esriGeometryPoint":y[p]=I?.x,m[p]=I?.y;break;case"esriGeometryPolygon":s=I?.centroid,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":s=I?.extent?.center,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;default:k[p]=A.IsMovable}(y[p]==null||m[p]==null||Number.isNaN(y[p])||Number.isNaN(m[p]))&&(k[p]=A.IsMovable,y[p]=0,m[p]=0)}else if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){!Z&&t?.lockedNodeLocations?.has(l.attributes[T])&&(Z=!0);const s=t?.timeInfoByTypeName?.get(n),I=s?.startField,v=I&&s?.startField?l.attributes[I]:null;g[p]=v?new Date(v).getTime():NaN;const C=s?.endField,D=C&&s?.endField?l.attributes[C]:null;ne[p]=D?new Date(D).getTime():NaN,y[p]=0,m[p]=0,k[p]=A.IsMovable}else k[p]=A.IsMovable,y[p]=0,m[p]=0;L.set(l.attributes[T],p),c[p]={feature:l,typeName:n},p++}),Z&&R.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let he=!1;const ee=new Map;a.forEach(n=>{const l=n.feature.attributes[J],s=n.feature.attributes[V],I=L.get(l),v=L.get(s),C=t?.timeInfoByTypeName?.get(n.typeName),D=t?.timeInfoByTypeName?C?.startField:null,O=D?n.feature.attributes[D]:null,j=C?.endField,H=j?n.feature.attributes[j]:null;if(I!==void 0&&v!==void 0){let S=l+"-"+s;e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(S=S+"-"+O+"-"+H);const U=ee.get(S);U?.has(n.typeName)||(K[E]=I,X[E]=v,e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(re[E]=O?new Date(O).getTime():NaN,se[E]=H?new Date(H).getTime():NaN),U===void 0?ee.set(S,new Map([[n.typeName,E]])):U.set(n.typeName,E),E++),o.push(n)}else he=!0,this.relationshipLinkChartDiagramLookup.set(l,null)}),he&&R.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const pe=this._validateLayoutSettings(e,t),te=this._convertLayoutSettingsToCalculationSettings(pe);await Ue();let z=!1,N=null;if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){let n;({success:z,links:N,graphics:n}=Ce(k,y,m,g,ne,K.subarray(0,E),X.subarray(0,E),re.subarray(0,E),se.subarray(0,E),e==="CHRONOLOGICAL_MULTIPLE",t?.chronologicalLayoutSettings??{})),z&&(this.chronologicalAuxiliaryGraphics=n)}else({success:z,links:N}=P(k,y,m,K.subarray(0,E),X.subarray(0,E),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(!z)throw new Q("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let n=0;n84.9999?m[n]=84.9999:m[n]<-84.9999&&(m[n]=-84.9999),y[n]>179.9999?y[n]=179.9999:y[n]<-179.9999&&(y[n]=-179.9999),c[n].feature.attributes[b]=new oe(y[n],m[n]),r.has(c[n].typeName))r.get(c[n].typeName)?.set(c[n].feature.attributes[T],c[n].feature);else{const s=new Map;s.set(c[n].feature.attributes[T],c[n].feature),r.set(c[n].typeName,s)}u.set(c[n].feature.attributes[T],c[n].feature);const l=B(c[n].feature.attributes[b]);this.entityLinkChartDiagramLookup.set(c[n].feature.attributes[T],c[n].feature.attributes[b]?l:null),c[n].feature.attributes[b].xx.xmax&&(x.xmax=c[n].feature.attributes[b].x),c[n].feature.attributes[b].yx.ymax&&(x.ymax=c[n].feature.attributes[b].y)}if(this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,!N)throw new Q("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const W=new Map,ae=new Map,ie=new Map,de=new Set;for(let n=0;n85.5?l[h][1]=85.5:l[h][1]<-85.5&&(l[h][1]=-85.5),l[h][0]>179.9999?l[h][0]=179.9999:l[h][0]<-179.9999&&(l[h][0]=-179.9999);W.has(C)?W.get(C).push(l):W.set(C,[l])}const j=W.get(C);ae.has(C)||(ae.set(C,new Map),ie.set(C,new Map));const H=ae.get(C),S=ie.get(C);H.has(s.typeName)||(H.set(s.typeName,j.shift()),S.set(s.typeName,0));const U=H.get(s.typeName);S.set(s.typeName,S.get(s.typeName)+1);const Me=new me({paths:[U]});if(s.feature.attributes[b]=Me,d.has(s.typeName))d.get(s.typeName)?.set(s.feature.attributes[T],s.feature);else{const h=new Map;h.set(s.feature.attributes[T],s.feature),d.set(s.typeName,h)}u.set(s.feature.attributes[T],s.feature);const we=B(s.feature.attributes[b]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[T],s.feature.attributes[b]?we:null)}for(const n of o)n.feature.attributes[Be]=ie.get(n.feature.attributes[J]+"-"+n.feature.attributes[V])?.get(n.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:pe},{nodes:r,links:d,idMap:u}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const i=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(a=>{i.push(a.refreshCachedQueryEngine())}),await Promise.all(i),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(t=>{t?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;a&&(o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(r,new oe({x:o.x,y:o.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((t,i)=>{if(t.useAllData=!1,t.members&&t.members.size>0){if(!this.dataManager.sublayerCaches.get(i))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(i).keys()));Array.from(t.members.keys()).filter(o=>!a.has(o)).forEach(o=>{t.members?.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e){let t=[];for(const a of this.dataManager.relationshipTypeNames){const o=this.sublayerIdsCache.get(a);o&&(t=t.concat(Array.from(o.keys())))}const i=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(i),{records:i}}async connectFromEntities(e){let t=[];for(const o of this.dataManager.relationshipTypeNames){const r=this.sublayerIdsCache.get(o);r&&(t=t.concat(Array.from(r.keys())))}let i=[];for(const o of this.dataManager.entityTypeNames){const r=this.sublayerIdsCache.get(o);r&&(i=i.concat(Array.from(r)))}const a=await this.dataManager.getRelationshipsFromNodes(e,i,t);return await this._handleNewRecords(a),{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const i=new Map;this.layers.forEach(a=>{i.set(a.objectType.name,a.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t){const o=this._graphTypeLookup.get(a);if(o){const r=this._createSublayer(o);o.type==="entity"?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),r.geometryType?this.layers.push(r):this.tables.push(r),this.dataManager.sublayerCaches.set(a,new Map)}}await fe(this,t),await this.dataManager.refreshCacheContent(e.map(a=>a.id));const i=Object.assign({},this._currentLinkChartConfig.layoutOptions);i.lockedNodeLocations=new Map;for(const[a,o]of this.entityLinkChartDiagramLookup.entries())o&&i.lockedNodeLocations.set(a,new oe(o.coords[0],o.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,i)}_createSublayers(e,t,i){e.forEach(a=>{const o=this._createSublayer(a);i(o)&&t.push(o),this._updateSublayerCaches(a)})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const a=e.find(o=>o.type===i.graphType&&o.name===i.graphTypeName);a&&(i.objectType=a,i.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;if(!a)return;o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const d=B(o);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(r,d):this.entityLinkChartDiagramLookup.set(r,d),this.linkChartExtent.xmin>o.x&&(this.linkChartExtent.xmin=o.x),this.linkChartExtent.xmaxo.y&&(this.linkChartExtent.ymin=o.y),this.linkChartExtent.ymax{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(t=>{const i=this.relationshipLinkChartDiagramLookup.get(t.attributes[J]),a=this.relationshipLinkChartDiagramLookup.get(t.attributes[V]);if(i&&a){const o=B(new me({paths:[[[i.coords[0],i.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(t.attributes[T],o)}else this.relationshipLinkChartDiagramLookup.set(t.attributes[T],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(e,t){const i=g=>typeof g=="number"&&!isNaN(g),a=g=>i(g)&&g>=1,o=g=>i(g)&&g>=1,r=g=>Object.values(q).includes(g),d=g=>i(g)&&g>=0,u={organicLayoutSettings:{},chronologicalLayoutSettings:{}};if(!new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC","CHRONOLOGICAL_MULTIPLE","CHRONOLOGICAL_SINGLE"]).has(e)||!t)return u;t.organicLayoutSettings??={};const{computationBudgetTime:L,repulsionRadiusMultiplier:k,idealEdgeLength:y,idealEdgeLengthType:m}=t.organicLayoutSettings;if(o(L)?u.organicLayoutSettings.computationBudgetTime=L:L!==void 0&&R.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),a(k)?u.organicLayoutSettings.repulsionRadiusMultiplier=k:k!==void 0&&R.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting"),e==="GEOGRAPHIC"&&(y!==void 0||m!==void 0)&&(r(m)?u.organicLayoutSettings.idealEdgeLengthType=m:m!==void 0&&R.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),d(y)?u.organicLayoutSettings.idealEdgeLength=y:y!==void 0&&R.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),(e==="CHRONOLOGICAL_MULTIPLE"||e==="CHRONOLOGICAL_SINGLE")&&t.chronologicalLayoutSettings){const g=t.chronologicalLayoutSettings;g.durationLineWidth&&g.durationLineWidth<0&&R.getLogger(this).warn("Invalid layout durationLineWidth setting, will revert to default setting")}return u}_convertLayoutSettingsToCalculationSettings(e){e.organicLayoutSettings??={};let t=e.organicLayoutSettings.idealEdgeLength;return e.organicLayoutSettings.idealEdgeLengthType===q.ABSOLUTE&&(t===void 0?t=-1:t*=-1),{computationBudgetTime:e.organicLayoutSettings.computationBudgetTime,repulsionRadiusMultiplier:e.organicLayoutSettings.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new $({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}};M([w()],f.prototype,"dataPreloadedInLocalCache",void 0),M([w()],f.prototype,"defaultLinkChartConfig",void 0),M([w()],f.prototype,"dataManager",void 0),M([w()],f.prototype,"inclusionModeDefinition",null),M([w()],f.prototype,"knowledgeGraph",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"layers",void 0),M([w()],f.prototype,"entityLinkChartDiagramLookup",void 0),M([w()],f.prototype,"relationshipLinkChartDiagramLookup",void 0),M([w()],f.prototype,"linkChartExtent",void 0),M([w()],f.prototype,"memberEntityTypes",void 0),M([w()],f.prototype,"memberRelationshipTypes",void 0),M([w({type:["LinkChartLayer"]})],f.prototype,"operationalLayerType",void 0),M([w()],f.prototype,"sublayerIdsCache",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"tables",void 0),M([w({json:{read:!1}})],f.prototype,"type",void 0),M([w({json:{read:!1}})],f.prototype,"chronologicalAuxiliaryGraphics",void 0),f=M([Ie("esri.layers.LinkChartLayer")],f);const Ga=f;export{Ga as default}; diff --git a/main/assets/Lyr3DWorker-K2Vldrif-BrVo5Re4.js b/main/assets/Lyr3DWorker-K2Vldrif-BrVo5Re4.js new file mode 100644 index 000000000..8d097e367 --- /dev/null +++ b/main/assets/Lyr3DWorker-K2Vldrif-BrVo5Re4.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lyr3DWorker-Cx6akEQX-Bxt_snw4.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{_ as M,bw as T}from"./main-C7yV2j71.js";var p,N,g,f,m,d,S,b,I,U,L,D,h,R,o;(function(t){t.U8="U8",t.I8="I8",t.U16="U16",t.I16="I16",t.U32="U32",t.I32="I32",t.F32="F32",t.F64="F64",t.Utf8String="Utf8String",t.NotSet="NotSet"})(p||(p={})),function(t){t.Png="Png",t.Jpeg="Jpeg",t.Dds="Dds",t.Raw="Raw",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.Etc2="Etc2",t.Astc="Astc",t.Pvrtc="Pvrtc",t.NotSet="NotSet"}(N||(N={})),function(t){t.Rgb8="Rgb8",t.Rgba8="Rgba8",t.R8="R8",t.Bgr8="Bgr8",t.Bgra8="Bgra8",t.Rg8="Rg8",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.NotSet="NotSet"}(g||(g={})),function(t){t.Position="Position",t.Normal="Normal",t.TexCoord="TexCoord",t.Color="Color",t.Tangent="Tangent",t.FeatureIndex="FeatureIndex",t.UvRegion="UvRegion",t.NotSet="NotSet"}(f||(f={})),function(t){t.Opaque="Opaque",t.Mask="Mask",t.Blend="Blend"}(m||(m={})),function(t){t.None="None",t.Mask="Mask",t.Alpha="Alpha",t.PreMultAlpha="PreMultAlpha",t.NotSet="NotSet"}(d||(d={})),function(t){t.Points="Points",t.Lines="Lines",t.LineStrip="LineStrip",t.Triangles="Triangles",t.TriangleStrip="TriangleStrip",t.NotSet="NotSet"}(S||(S={})),function(t){t.None="None",t.WrapXBit="WrapXBit",t.WrapYBit="WrapYBit",t.WrapXy="WrapXy",t.NotSet="NotSet"}(b||(b={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NotSet="NotSet"}(I||(I={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NearestMipmapNearest="NearestMipmapNearest",t.LinearMipmapNearest="LinearMipmapNearest",t.NearestMipmapLinear="NearestMipmapLinear",t.LinearMipmapLinear="LinearMipmapLinear",t.NotSet="NotSet"}(U||(U={})),function(t){t.FeatureId="FeatureId",t.GlobalUid="GlobalUid",t.UnspecifiedDateTime="UnspecifiedDateTime",t.EcmaIso8601DateTime="EcmaIso8601DateTime",t.EcmaIso8601DateOnly="EcmaIso8601DateOnly",t.TimeOnly="TimeOnly",t.TimeStamp="TimeStamp",t.ColorRgb="ColorRgb",t.ColorRgba="ColorRgba",t.Unrecognized="Unrecognized",t.NotSet="NotSet"}(L||(L={})),function(t){t.Texture="Texture",t.VertexAtrb="VertexAtrb",t.Implicit="Implicit",t.NotSet="NotSet"}(D||(D={})),function(t){t.Front="Front",t.Back="Back",t.None="None",t.NotSet="NotSet"}(h||(h={})),function(t){t.Pbr="Pbr",t.Unlit="Unlit"}(R||(R={})),function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.MissingInputs=2]="MissingInputs"}(o||(o={}));function x(){return new Promise(t=>M(()=>import("./lyr3DWorker-Cx6akEQX-Bxt_snw4.js"),__vite__mapDeps([0,1]),import.meta.url).then(a=>a.l).then(({default:a})=>{const n=a({locateFile:y,onRuntimeInitialized:()=>t(n)})})).catch(t=>{throw t})}function y(t){return T(`esri/libs/lyr3d/${t}`)}let e,r;async function F(t){if(await P(),t.inputs.length<1)return{result:{status:o.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const a={ptrs:[],sizes:[]};for(const i of t.inputs){const u=r._malloc(i.byteLength);new Uint8Array(r.HEAPU8.buffer,u,i.byteLength).set(new Uint8Array(i)),a.ptrs.push(u),a.sizes.push(i.byteLength)}const n=r.process(t.jobDescJson,a,t.isMissingResourceCase),l=n.status===o.Succeeded&&n.data,c=n.status===o.MissingInputs&&n.missingInputUrls.length>0;if(l){const i=n.data.slice();n.data=i}else c&&(n.jobDescJson=n.jobDescJson.slice(),n.originalInputs=t.inputs);for(let i=0;i{r=t,r.initialize_lyr3d_worker_wasm(),e=null})),e)}export{w as destroyWasm,P as initialize,F as process}; diff --git a/main/assets/Lyr3DWorker-K2Vldrif-CyaMfETx.js b/main/assets/Lyr3DWorker-K2Vldrif-CyaMfETx.js deleted file mode 100644 index 8b68e1dc6..000000000 --- a/main/assets/Lyr3DWorker-K2Vldrif-CyaMfETx.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lyr3DWorker-Cx6akEQX-Bxt_snw4.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as M,bw as T}from"./main-BZaw9FpY.js";var p,N,g,f,m,d,S,b,I,U,L,D,h,R,o;(function(t){t.U8="U8",t.I8="I8",t.U16="U16",t.I16="I16",t.U32="U32",t.I32="I32",t.F32="F32",t.F64="F64",t.Utf8String="Utf8String",t.NotSet="NotSet"})(p||(p={})),function(t){t.Png="Png",t.Jpeg="Jpeg",t.Dds="Dds",t.Raw="Raw",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.Etc2="Etc2",t.Astc="Astc",t.Pvrtc="Pvrtc",t.NotSet="NotSet"}(N||(N={})),function(t){t.Rgb8="Rgb8",t.Rgba8="Rgba8",t.R8="R8",t.Bgr8="Bgr8",t.Bgra8="Bgra8",t.Rg8="Rg8",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.NotSet="NotSet"}(g||(g={})),function(t){t.Position="Position",t.Normal="Normal",t.TexCoord="TexCoord",t.Color="Color",t.Tangent="Tangent",t.FeatureIndex="FeatureIndex",t.UvRegion="UvRegion",t.NotSet="NotSet"}(f||(f={})),function(t){t.Opaque="Opaque",t.Mask="Mask",t.Blend="Blend"}(m||(m={})),function(t){t.None="None",t.Mask="Mask",t.Alpha="Alpha",t.PreMultAlpha="PreMultAlpha",t.NotSet="NotSet"}(d||(d={})),function(t){t.Points="Points",t.Lines="Lines",t.LineStrip="LineStrip",t.Triangles="Triangles",t.TriangleStrip="TriangleStrip",t.NotSet="NotSet"}(S||(S={})),function(t){t.None="None",t.WrapXBit="WrapXBit",t.WrapYBit="WrapYBit",t.WrapXy="WrapXy",t.NotSet="NotSet"}(b||(b={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NotSet="NotSet"}(I||(I={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NearestMipmapNearest="NearestMipmapNearest",t.LinearMipmapNearest="LinearMipmapNearest",t.NearestMipmapLinear="NearestMipmapLinear",t.LinearMipmapLinear="LinearMipmapLinear",t.NotSet="NotSet"}(U||(U={})),function(t){t.FeatureId="FeatureId",t.GlobalUid="GlobalUid",t.UnspecifiedDateTime="UnspecifiedDateTime",t.EcmaIso8601DateTime="EcmaIso8601DateTime",t.EcmaIso8601DateOnly="EcmaIso8601DateOnly",t.TimeOnly="TimeOnly",t.TimeStamp="TimeStamp",t.ColorRgb="ColorRgb",t.ColorRgba="ColorRgba",t.Unrecognized="Unrecognized",t.NotSet="NotSet"}(L||(L={})),function(t){t.Texture="Texture",t.VertexAtrb="VertexAtrb",t.Implicit="Implicit",t.NotSet="NotSet"}(D||(D={})),function(t){t.Front="Front",t.Back="Back",t.None="None",t.NotSet="NotSet"}(h||(h={})),function(t){t.Pbr="Pbr",t.Unlit="Unlit"}(R||(R={})),function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.MissingInputs=2]="MissingInputs"}(o||(o={}));function x(){return new Promise(t=>M(()=>import("./lyr3DWorker-Cx6akEQX-Bxt_snw4.js"),__vite__mapDeps([0,1]),import.meta.url).then(a=>a.l).then(({default:a})=>{const n=a({locateFile:y,onRuntimeInitialized:()=>t(n)})})).catch(t=>{throw t})}function y(t){return T(`esri/libs/lyr3d/${t}`)}let e,r;async function F(t){if(await P(),t.inputs.length<1)return{result:{status:o.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const a={ptrs:[],sizes:[]};for(const i of t.inputs){const u=r._malloc(i.byteLength);new Uint8Array(r.HEAPU8.buffer,u,i.byteLength).set(new Uint8Array(i)),a.ptrs.push(u),a.sizes.push(i.byteLength)}const n=r.process(t.jobDescJson,a,t.isMissingResourceCase),l=n.status===o.Succeeded&&n.data,c=n.status===o.MissingInputs&&n.missingInputUrls.length>0;if(l){const i=n.data.slice();n.data=i}else c&&(n.jobDescJson=n.jobDescJson.slice(),n.originalInputs=t.inputs);for(let i=0;i{r=t,r.initialize_lyr3d_worker_wasm(),e=null})),e)}export{w as destroyWasm,P as initialize,F as process}; diff --git a/main/assets/Map-1zd11DKO-Bvo5kMfb.js b/main/assets/Map-1zd11DKO-Bvo5kMfb.js new file mode 100644 index 000000000..a24ce7426 --- /dev/null +++ b/main/assets/Map-1zd11DKO-Bvo5kMfb.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-B_vTBwak.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./layersCreator-CW56kDKc-CK8sXxzK.js","./portalLayers-Bh9bAhk4-CIQyh8K9.js","./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./fetchService-DbaKmJhP-DPDp5i2e.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./styleUtils-ChrJTYIw-OCRItq_6.js"])))=>i.map(i=>d[i]); +import{v as s,bz as B,i as C,bA as N,aB as P,ag as D,aU as G,a1 as m,aA as f,am as U,o as R,_ as b,$ as w,P as E,S as n,ac as M,bB as T,bC as V,bD as z,ar as J,I as Q,j as W,ad as S,e as Z,bE as q,bF as H,C as K,bG as F,ah as k,ax as X,a2 as Y}from"./main-C7yV2j71.js";import{F as c,s as A}from"./Basemap-BEqqSTw9-COwFtp-h.js";import{o as ee}from"./compilerUtils-CV1QYWI8-89qN_-l3.js";import{y as te}from"./loadAll-e978YItg-NjG3VBGi.js";import{f as $}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import{x as re,L as ae,g as se}from"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";var _;let h=_=class extends Z{constructor(e){super(e),this.type="none"}clone(){return new _({type:this.type})}};s([B({none:"none",stayAbove:"stay-above"})],h.prototype,"type",void 0),h=_=s([C("esri.ground.NavigationConstraint")],h);var I;let d=I=class extends N(P){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new D;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&m.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},a=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>t(r.item)),this.layers.on("after-remove",r=>a(r.item))])}initialize(){this.when().catch(e=>{G(e)||m.getLogger(this).error("#load()","Failed to load ground",e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)f(t);this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",U(e,this._get("layers")))}writeLayers(e,t,a,r){const i=[];e&&(r={...r,layerContainerType:"ground"},e.forEach(l=>{if("write"in l){const p={};ee(l)().write(p,r)&&i.push(p)}else r?.messages&&r.messages.push(new R("layer:unsupported",`Layers (${l.title}, ${l.id}) of type '${l.declaredClass}' cannot be persisted in the ground`,{layer:l}))})),t.layers=i}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return te(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-B_vTBwak.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);w(t);const r=new a,i=this.layers.filter(O).toArray();return r.queryAll(i,e,t)}async createElevationSampler(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-B_vTBwak.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);w(t);const r=new a,i=this.layers.filter(O).toArray();return r.createSamplerAll(i,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:E(this.surfaceColor),navigationConstraint:E(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new I({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}async _loadLayersFromJSON(e,t,a){const r=t?.origin||"web-scene",i=t?.portal||null,l=t?.url||null,{populateOperationalLayers:p}=await b(async()=>{const{populateOperationalLayers:v}=await import("./layersCreator-CW56kDKc-CK8sXxzK.js");return{populateOperationalLayers:v}},__vite__mapDeps([6,1,2,7,8,9,10,11,12,3,4,13]),import.meta.url);w(a);const y=[];if(e.layers&&Array.isArray(e.layers)){const v={context:{origin:r,url:l,portal:i,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};y.push(p(this.layers,e.layers,v))}await Promise.allSettled(y)}};function oe(e){return e&&"createElevationSampler"in e}function O(e){return e.type==="elevation"||oe(e)}s([n({json:{read:!1}})],d.prototype,"layers",null),s([M("layers")],d.prototype,"writeLayers",null),s([n({readOnly:!0})],d.prototype,"resourceInfo",void 0),s([n({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:T,read:{reader:V,source:"transparency"},write:{writer:(e,t)=>{t.transparency=z(e)},target:"transparency"}}})],d.prototype,"opacity",void 0),s([n({type:J,json:{type:[T],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],d.prototype,"surfaceColor",void 0),s([n({type:h,json:{write:!0}})],d.prototype,"navigationConstraint",void 0),d=I=s([C("esri.Ground")],d);const g=d,u=new WeakMap;function j(e){return!e.destroyed&&(u.has(e)||e.addHandles([k(()=>{const t=e.parent;return!(!t||!("type"in t))&&(t.type==="catalog-dynamic-group"||j(t))},t=>u.set(e,t),X),Y(()=>u.delete(e))]),u.get(e))}function ne(e){return typeof e=="object"&&e!=null&&"loaded"in e&&e.loaded===!0&&"type"in e}function ie(e){return!(!ne(e)||!q(e)?.operations?.supportsEditing||"editingEnabled"in e&&!H(e)||j(e))}const L=()=>m.getLogger("esri.support.basemapUtils");function le(){return{}}function de(e){for(const t in e){const a=e[t];f(a),delete e[t]}}function pe(e,t){let a;if(typeof e=="string"){const r=e in A,i=!r&&e.includes("/");if(!r&&!i){if(K.apiKey)L().warn(`Unable to find basemap definition for: ${e}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const l=Object.entries(A).filter(([p,y])=>y.classic||y.is3d).map(([p])=>`"${p}"`).sort().join(", ");L().warn(`Unable to find basemap definition for: ${e}. Try one of these: ${l}`)}return null}t&&(a=t[e]),a||(a=r?c.fromId(e):new c({style:{id:e}}),t&&(t[e]=a))}else a=F(c,e);return a?.destroyed&&(L().warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}const x={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function ye(e){let t=null;if(typeof e=="string")if(e in x){const a=x[e];t=new g({resourceInfo:{data:{layers:[a]}}})}else m.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=F(g,e);return t}let o=class extends re(ae(Q.EventedMixin(W))){constructor(e){super(e),this.allLayers=new $({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=se(this),this.basemap=null,this.editableLayers=new $({getCollections:()=>[this.allLayers],itemFilterFunction:ie}),this.ground=new g,this._basemapCache=le()}destroy(){de(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=f(this.basemap),f(this.ground),this._set("ground",null)}castBasemap(e){return pe(e,this._basemapCache)}castGround(e){return ye(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};s([n({readOnly:!0,dependsOn:[]})],o.prototype,"allLayers",void 0),s([n({readOnly:!0})],o.prototype,"allTables",void 0),s([n({type:c,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],o.prototype,"basemap",void 0),s([S("basemap")],o.prototype,"castBasemap",null),s([n({readOnly:!0})],o.prototype,"editableLayers",void 0),s([n({type:g,nonNullable:!0})],o.prototype,"ground",void 0),s([S("ground")],o.prototype,"castGround",null),s([n()],o.prototype,"undoRedo",void 0),o=s([C("esri.Map")],o);const Ee=o;export{Ee as default}; diff --git a/main/assets/Map-1zd11DKO-DdBAdkuj.js b/main/assets/Map-1zd11DKO-DdBAdkuj.js deleted file mode 100644 index a437015f5..000000000 --- a/main/assets/Map-1zd11DKO-DdBAdkuj.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-DlXaowOR.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./layersCreator-CW56kDKc-gpROgX1S.js","./portalLayers-Bh9bAhk4-BaKPDASj.js","./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./fetchService-DbaKmJhP-CtznRt8p.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js"])))=>i.map(i=>d[i]); -import{v as s,bz as B,i as C,bA as N,aB as P,ag as D,aU as G,a1 as m,aA as f,am as U,o as R,_ as b,$ as w,P as E,S as n,ac as M,bB as T,bC as V,bD as z,ar as J,I as Q,j as W,ad as S,e as Z,bE as q,bF as H,C as K,bG as F,ah as k,ax as X,a2 as Y}from"./main-BZaw9FpY.js";import{F as c,s as A}from"./Basemap-BEqqSTw9-BkQ-c4vY.js";import{o as ee}from"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import{y as te}from"./loadAll-e978YItg-CB-7_cng.js";import{f as $}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import{x as re,L as ae,g as se}from"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";var _;let h=_=class extends Z{constructor(e){super(e),this.type="none"}clone(){return new _({type:this.type})}};s([B({none:"none",stayAbove:"stay-above"})],h.prototype,"type",void 0),h=_=s([C("esri.ground.NavigationConstraint")],h);var I;let d=I=class extends N(P){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new D;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&m.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},a=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>t(r.item)),this.layers.on("after-remove",r=>a(r.item))])}initialize(){this.when().catch(e=>{G(e)||m.getLogger(this).error("#load()","Failed to load ground",e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)f(t);this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",U(e,this._get("layers")))}writeLayers(e,t,a,r){const i=[];e&&(r={...r,layerContainerType:"ground"},e.forEach(l=>{if("write"in l){const p={};ee(l)().write(p,r)&&i.push(p)}else r?.messages&&r.messages.push(new R("layer:unsupported",`Layers (${l.title}, ${l.id}) of type '${l.declaredClass}' cannot be persisted in the ground`,{layer:l}))})),t.layers=i}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return te(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-DlXaowOR.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);w(t);const r=new a,i=this.layers.filter(O).toArray();return r.queryAll(i,e,t)}async createElevationSampler(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-DlXaowOR.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);w(t);const r=new a,i=this.layers.filter(O).toArray();return r.createSamplerAll(i,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:E(this.surfaceColor),navigationConstraint:E(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new I({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}async _loadLayersFromJSON(e,t,a){const r=t?.origin||"web-scene",i=t?.portal||null,l=t?.url||null,{populateOperationalLayers:p}=await b(async()=>{const{populateOperationalLayers:v}=await import("./layersCreator-CW56kDKc-gpROgX1S.js");return{populateOperationalLayers:v}},__vite__mapDeps([6,1,2,7,8,9,10,11,12,3,4,13]),import.meta.url);w(a);const y=[];if(e.layers&&Array.isArray(e.layers)){const v={context:{origin:r,url:l,portal:i,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};y.push(p(this.layers,e.layers,v))}await Promise.allSettled(y)}};function oe(e){return e&&"createElevationSampler"in e}function O(e){return e.type==="elevation"||oe(e)}s([n({json:{read:!1}})],d.prototype,"layers",null),s([M("layers")],d.prototype,"writeLayers",null),s([n({readOnly:!0})],d.prototype,"resourceInfo",void 0),s([n({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:T,read:{reader:V,source:"transparency"},write:{writer:(e,t)=>{t.transparency=z(e)},target:"transparency"}}})],d.prototype,"opacity",void 0),s([n({type:J,json:{type:[T],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],d.prototype,"surfaceColor",void 0),s([n({type:h,json:{write:!0}})],d.prototype,"navigationConstraint",void 0),d=I=s([C("esri.Ground")],d);const g=d,u=new WeakMap;function j(e){return!e.destroyed&&(u.has(e)||e.addHandles([k(()=>{const t=e.parent;return!(!t||!("type"in t))&&(t.type==="catalog-dynamic-group"||j(t))},t=>u.set(e,t),X),Y(()=>u.delete(e))]),u.get(e))}function ne(e){return typeof e=="object"&&e!=null&&"loaded"in e&&e.loaded===!0&&"type"in e}function ie(e){return!(!ne(e)||!q(e)?.operations?.supportsEditing||"editingEnabled"in e&&!H(e)||j(e))}const L=()=>m.getLogger("esri.support.basemapUtils");function le(){return{}}function de(e){for(const t in e){const a=e[t];f(a),delete e[t]}}function pe(e,t){let a;if(typeof e=="string"){const r=e in A,i=!r&&e.includes("/");if(!r&&!i){if(K.apiKey)L().warn(`Unable to find basemap definition for: ${e}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const l=Object.entries(A).filter(([p,y])=>y.classic||y.is3d).map(([p])=>`"${p}"`).sort().join(", ");L().warn(`Unable to find basemap definition for: ${e}. Try one of these: ${l}`)}return null}t&&(a=t[e]),a||(a=r?c.fromId(e):new c({style:{id:e}}),t&&(t[e]=a))}else a=F(c,e);return a?.destroyed&&(L().warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}const x={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function ye(e){let t=null;if(typeof e=="string")if(e in x){const a=x[e];t=new g({resourceInfo:{data:{layers:[a]}}})}else m.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=F(g,e);return t}let o=class extends re(ae(Q.EventedMixin(W))){constructor(e){super(e),this.allLayers=new $({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=se(this),this.basemap=null,this.editableLayers=new $({getCollections:()=>[this.allLayers],itemFilterFunction:ie}),this.ground=new g,this._basemapCache=le()}destroy(){de(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=f(this.basemap),f(this.ground),this._set("ground",null)}castBasemap(e){return pe(e,this._basemapCache)}castGround(e){return ye(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};s([n({readOnly:!0,dependsOn:[]})],o.prototype,"allLayers",void 0),s([n({readOnly:!0})],o.prototype,"allTables",void 0),s([n({type:c,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],o.prototype,"basemap",void 0),s([S("basemap")],o.prototype,"castBasemap",null),s([n({readOnly:!0})],o.prototype,"editableLayers",void 0),s([n({type:g,nonNullable:!0})],o.prototype,"ground",void 0),s([S("ground")],o.prototype,"castGround",null),s([n()],o.prototype,"undoRedo",void 0),o=s([C("esri.Map")],o);const Ee=o;export{Ee as default}; diff --git a/main/assets/MapImageLayer-B_rP0PhA-BMKx3_KE.js b/main/assets/MapImageLayer-B_rP0PhA-BMKx3_KE.js new file mode 100644 index 000000000..4a4c01152 --- /dev/null +++ b/main/assets/MapImageLayer-B_rP0PhA-BMKx3_KE.js @@ -0,0 +1 @@ +import{W as S,bO as f,bP as d,bM as I,f as g,n as w,o as b,aU as O,v as o,S as a,bQ as v,a0 as T,ac as P,bB as M,i as E}from"./main-C7yV2j71.js";import{y as L}from"./loadAll-e978YItg-NjG3VBGi.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{c as R}from"./scaleUtils-DxsfQwK1-B4OFXqEO.js";import{D as U}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{n as _}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{k as $,M as N,A as j}from"./SublayersOwner-DfTaMJ5V-DBe6p6TL.js";import{a as J}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as k}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as q}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as A}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as V}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as D}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as Z}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{Z as z}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{r as B}from"./ExportImageParameters-DxyNGQ57-pIUsifIT.js";import{i as C}from"./imageBitmapUtils-DA36kg39-BPA5qQx5.js";import{f as x}from"./sublayerUtils-CyM0QC5B-BQ17aSXL.js";import{a as G}from"./versionUtils-LZYZz-38-DgmFurh2.js";import{k as H}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./QueryTask-CwHwH2rS-CT1NKU1Q.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./executeForIds-Z1gkLduF-BNBrXf-U.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./executeQueryPBF-o8010HS9-E5WwNUPn.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./executeQueryJSON-CcHnccia-CB1D7q08.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";let e=class extends k(Z(W($(N(J(A(V(F(D(_(q(U)))))))))))){constructor(...r){super(...r),this._exportImageParameters=new B({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(r,t){return typeof r=="string"?{url:r,...t}:r}load(r){const t=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},r).catch(S).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(r,t){const n=t.supportedImageFormatTypes;return n&&n.includes("PNG32")?"png32":"png24"}writeSublayers(r,t,n,s){if(!this.loaded||!r)return;const m=r.slice().reverse().flatten(({sublayers:i})=>i&&i.toArray().reverse()).toArray();let p=!1;const l=f(s.origin);if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){if(l===d.PORTAL_ITEM){const i=this.createSublayersForOrigin("service").sublayers;p=x(m,i,d.SERVICE)}else if(l>d.PORTAL_ITEM){const i=this.createSublayersForOrigin("portal-item");p=x(m,i.sublayers,f(i.origin))}}const h=[],c={writeSublayerStructure:p,...s};let u=p||this.hasVisibleLayersForOrigin(l);m.forEach(i=>{const y=i.write({},c);h.push(y),u=u||i.originOf("visible")==="user"}),h.some(i=>Object.keys(i).length>1)&&(t.layers=h),u&&(t.visibleLayers=m.filter(i=>i.visible).map(i=>i.id))}createExportImageParameters(r,t,n,s){const m=s?.pixelRatio||1;r&&this.version>=10&&(r=r.clone().shiftCentralMeridian()),this._exportImageParameters.floors=s?.floors??null,this._exportImageParameters.scale=R({extent:r,width:t})*m;const p=this._exportImageParameters.toJSON(),l=!s?.rotation||this.version<10.3?{}:{rotation:-s.rotation},h=r?.spatialReference,c=I(h);p.dpi*=m;const u={};if(s?.timeExtent){const{start:i,end:y}=s.timeExtent.toJSON();u.time=i&&y&&i===y?""+i:`${i??"null"},${y??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(u.time="null,null");return{bbox:r&&r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:c,imageSR:c,size:t+","+n,...p,...l,...u}}async fetchImage(r,t,n,s){const{data:m}=await this._fetchImage("image",r,t,n,s);return m}async fetchImageBitmap(r,t,n,s){const{data:m,url:p}=await this._fetchImage("blob",r,t,n,s);return C(m,p,s?.signal)}async fetchRecomputedExtents(r={}){const t={...r,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:n}=await g(this.url,t),{extent:s,fullExtent:m,timeExtent:p}=n,l=s||m;return{fullExtent:l&&w.fromJSON(l),timeExtent:p&&H.fromJSON({start:p[0],end:p[1]})}}loadAll(){return L(this,r=>{r(this.allSublayers),r(this.subtables)})}serviceSupportsSpatialReference(r){return G(this,r)}async _fetchImage(r,t,n,s,m){const p={responseType:r,signal:m?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,n,s,m),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(p.query?.dynamicLayers!=null&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new b("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:p.query});try{const{data:h}=await g(l,p);return{data:h,url:l}}catch(h){throw O(h)?h:new b("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:h})}}async _fetchService(r){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:n}=await g(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:r});n&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(r){return!(r==null||!this.sublayersSourceJSON[r]?.visibleLayers)}};o([a(v("dateFieldsTimeReference"))],e.prototype,"dateFieldsTimeZone",void 0),o([a({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),o([a()],e.prototype,"dpi",void 0),o([a()],e.prototype,"gdbVersion",void 0),o([a()],e.prototype,"imageFormat",void 0),o([T("imageFormat",["supportedImageFormatTypes"])],e.prototype,"readImageFormat",null),o([a({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],e.prototype,"imageMaxHeight",void 0),o([a({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],e.prototype,"imageMaxWidth",void 0),o([a()],e.prototype,"imageTransparency",void 0),o([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],e.prototype,"isReference",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"labelsVisible",void 0),o([a({type:["ArcGISMapServiceLayer"]})],e.prototype,"operationalLayerType",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"popupEnabled",void 0),o([a(v("preferredTimeReference"))],e.prototype,"preferredTimeZone",void 0),o([a()],e.prototype,"sourceJSON",void 0),o([a({json:{write:{ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),o([P("sublayers",{layers:{type:[j]},visibleLayers:{type:[M]}})],e.prototype,"writeSublayers",null),o([a({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),o([a({json:{read:!1},readOnly:!0,value:"map-image"})],e.prototype,"type",void 0),o([a(z)],e.prototype,"url",void 0),e=o([E("esri.layers.MapImageLayer")],e);const Fe=e;export{Fe as default}; diff --git a/main/assets/MapImageLayer-B_rP0PhA-IiizomG9.js b/main/assets/MapImageLayer-B_rP0PhA-IiizomG9.js deleted file mode 100644 index 6dbd45b16..000000000 --- a/main/assets/MapImageLayer-B_rP0PhA-IiizomG9.js +++ /dev/null @@ -1 +0,0 @@ -import{W as S,bO as f,bP as d,bM as I,f as g,n as w,o as b,aU as O,v as o,S as a,bQ as v,a0 as T,ac as P,bB as M,i as E}from"./main-BZaw9FpY.js";import{y as L}from"./loadAll-e978YItg-CB-7_cng.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{c as R}from"./scaleUtils-DxsfQwK1-OKeSqBb9.js";import{D as U}from"./Layer-ChoECxvZ-C4wLrCej.js";import{n as _}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{k as $,M as N,A as j}from"./SublayersOwner-DfTaMJ5V-CcYzSRLx.js";import{a as J}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as k}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as q}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as A}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as V}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as D}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as Z}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{Z as z}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{r as B}from"./ExportImageParameters-DxyNGQ57-DAeGZbW_.js";import{i as C}from"./imageBitmapUtils-DA36kg39-CBVFUZAU.js";import{f as x}from"./sublayerUtils-CyM0QC5B-BB_azrTi.js";import{a as G}from"./versionUtils-LZYZz-38-xZnsxhiL.js";import{k as H}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./QueryTask-CwHwH2rS-CU-oJwb3.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./executeForIds-Z1gkLduF-Daa1fnES.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./executeQueryPBF-o8010HS9-dWp8mQx-.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./executeQueryJSON-CcHnccia-DVecwfbV.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";let e=class extends k(Z(W($(N(J(A(V(F(D(_(q(U)))))))))))){constructor(...r){super(...r),this._exportImageParameters=new B({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(r,t){return typeof r=="string"?{url:r,...t}:r}load(r){const t=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},r).catch(S).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(r,t){const n=t.supportedImageFormatTypes;return n&&n.includes("PNG32")?"png32":"png24"}writeSublayers(r,t,n,s){if(!this.loaded||!r)return;const m=r.slice().reverse().flatten(({sublayers:i})=>i&&i.toArray().reverse()).toArray();let p=!1;const l=f(s.origin);if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){if(l===d.PORTAL_ITEM){const i=this.createSublayersForOrigin("service").sublayers;p=x(m,i,d.SERVICE)}else if(l>d.PORTAL_ITEM){const i=this.createSublayersForOrigin("portal-item");p=x(m,i.sublayers,f(i.origin))}}const h=[],c={writeSublayerStructure:p,...s};let u=p||this.hasVisibleLayersForOrigin(l);m.forEach(i=>{const y=i.write({},c);h.push(y),u=u||i.originOf("visible")==="user"}),h.some(i=>Object.keys(i).length>1)&&(t.layers=h),u&&(t.visibleLayers=m.filter(i=>i.visible).map(i=>i.id))}createExportImageParameters(r,t,n,s){const m=s?.pixelRatio||1;r&&this.version>=10&&(r=r.clone().shiftCentralMeridian()),this._exportImageParameters.floors=s?.floors??null,this._exportImageParameters.scale=R({extent:r,width:t})*m;const p=this._exportImageParameters.toJSON(),l=!s?.rotation||this.version<10.3?{}:{rotation:-s.rotation},h=r?.spatialReference,c=I(h);p.dpi*=m;const u={};if(s?.timeExtent){const{start:i,end:y}=s.timeExtent.toJSON();u.time=i&&y&&i===y?""+i:`${i??"null"},${y??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(u.time="null,null");return{bbox:r&&r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:c,imageSR:c,size:t+","+n,...p,...l,...u}}async fetchImage(r,t,n,s){const{data:m}=await this._fetchImage("image",r,t,n,s);return m}async fetchImageBitmap(r,t,n,s){const{data:m,url:p}=await this._fetchImage("blob",r,t,n,s);return C(m,p,s?.signal)}async fetchRecomputedExtents(r={}){const t={...r,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:n}=await g(this.url,t),{extent:s,fullExtent:m,timeExtent:p}=n,l=s||m;return{fullExtent:l&&w.fromJSON(l),timeExtent:p&&H.fromJSON({start:p[0],end:p[1]})}}loadAll(){return L(this,r=>{r(this.allSublayers),r(this.subtables)})}serviceSupportsSpatialReference(r){return G(this,r)}async _fetchImage(r,t,n,s,m){const p={responseType:r,signal:m?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,n,s,m),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(p.query?.dynamicLayers!=null&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new b("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:p.query});try{const{data:h}=await g(l,p);return{data:h,url:l}}catch(h){throw O(h)?h:new b("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:h})}}async _fetchService(r){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:n}=await g(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:r});n&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(r){return!(r==null||!this.sublayersSourceJSON[r]?.visibleLayers)}};o([a(v("dateFieldsTimeReference"))],e.prototype,"dateFieldsTimeZone",void 0),o([a({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),o([a()],e.prototype,"dpi",void 0),o([a()],e.prototype,"gdbVersion",void 0),o([a()],e.prototype,"imageFormat",void 0),o([T("imageFormat",["supportedImageFormatTypes"])],e.prototype,"readImageFormat",null),o([a({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],e.prototype,"imageMaxHeight",void 0),o([a({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],e.prototype,"imageMaxWidth",void 0),o([a()],e.prototype,"imageTransparency",void 0),o([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],e.prototype,"isReference",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"labelsVisible",void 0),o([a({type:["ArcGISMapServiceLayer"]})],e.prototype,"operationalLayerType",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"popupEnabled",void 0),o([a(v("preferredTimeReference"))],e.prototype,"preferredTimeZone",void 0),o([a()],e.prototype,"sourceJSON",void 0),o([a({json:{write:{ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),o([P("sublayers",{layers:{type:[j]},visibleLayers:{type:[M]}})],e.prototype,"writeSublayers",null),o([a({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),o([a({json:{read:!1},readOnly:!0,value:"map-image"})],e.prototype,"type",void 0),o([a(z)],e.prototype,"url",void 0),e=o([E("esri.layers.MapImageLayer")],e);const Fe=e;export{Fe as default}; diff --git a/main/assets/MapImageLayerView2D-LI7T-1xm-C9rclF9a.js b/main/assets/MapImageLayerView2D-LI7T-1xm-C9rclF9a.js new file mode 100644 index 000000000..d98e7c376 --- /dev/null +++ b/main/assets/MapImageLayerView2D-LI7T-1xm-C9rclF9a.js @@ -0,0 +1 @@ +import{aU as g,a1 as l,ah as d,v as r,S as o,i as h}from"./main-C7yV2j71.js";import{o as u}from"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import{d as c}from"./BitmapContainer-BC8fvmFc-CH1ryNve.js";import{X as y,Y as f}from"./LayerView-Bish-E63-I2LV0oDm.js";import{X as x}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import{l as w}from"./HighlightGraphicContainer-Dt5r6lMq-BNbDeHiI.js";import{K as _}from"./ExportStrategy-BNE7Gp0u-CdeT3qVb.js";import{r as v}from"./ExportImageParameters-DxyNGQ57-pIUsifIT.js";import{T as H}from"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import{n as I}from"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";import{O as U}from"./MapServiceLayerViewHelper-bw3M4B8s-B5cli8RL.js";import{x as V}from"./drapedUtils-BZ1SGPtE-BPt00fGU.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./signal-CETehA7D-DxK1orqE.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./Bitmap-CcqmzvfR-C92VuEM3.js";import"./scaleUtils-DxsfQwK1-B4OFXqEO.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-BQ17aSXL.js";import"./languageUtils-BYxF9hRA-BLoYMqdU.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-CNuAEz8h.js";import"./number-eRKYXfX9-C213qXfW.js";import"./popupUtils-nV1O8RUO-X6GWMgRY.js";const E=t=>{let i=class extends t{initialize(){this.exportImageParameters=new v({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){return this.view?.floors??null}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return H(this.layer,this.view?.timeExtent,this._get("timeExtent"))}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return r([o()],i.prototype,"exportImageParameters",void 0),r([o({readOnly:!0})],i.prototype,"floors",null),r([o({readOnly:!0})],i.prototype,"exportImageVersion",null),r([o()],i.prototype,"layer",void 0),r([o()],i.prototype,"suspended",void 0),r([o({readOnly:!0})],i.prototype,"timeExtent",null),i=r([h("esri.views.layers.MapImageLayerView")],i),i};let m=class extends E(I(y(f))){constructor(){super(...arguments),this._highlightGraphics=new u,this._updateHash=""}fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i)}update(t){const i=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(t).catch(e=>{g(e)||l.getLogger(this).error(e)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:i,version:e}=this.layer,p=e>=10.3,n=e>=10;this._bitmapContainer=new c,this.container.addChild(this._bitmapContainer),this._highlightView=new x({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new U({createFetchPopupFeaturesQueryGeometry:(a,s)=>V(a,s,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(a,s)=>{this._highlightView.graphicUpdateHandler({graphic:a,property:s})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new _({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:i,imageRotationSupported:p,imageNormalizationSupported:n,hidpi:!0}),this.addAttachHandles(d(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,i,e,p){return this.layer.fetchImage(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}fetchImageBitmap(t,i,e,p){return this.layer.fetchImageBitmap(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}highlight(t){return this._popupHighlightHelper.highlight(t)}};r([o()],m.prototype,"strategy",void 0),r([o()],m.prototype,"updating",void 0),m=r([h("esri.views.2d.layers.MapImageLayerView2D")],m);const Oi=m;export{Oi as default}; diff --git a/main/assets/MapImageLayerView2D-LI7T-1xm-N5aTEI2-.js b/main/assets/MapImageLayerView2D-LI7T-1xm-N5aTEI2-.js deleted file mode 100644 index 465c84014..000000000 --- a/main/assets/MapImageLayerView2D-LI7T-1xm-N5aTEI2-.js +++ /dev/null @@ -1 +0,0 @@ -import{aU as g,a1 as l,ah as d,v as r,S as o,i as h}from"./main-BZaw9FpY.js";import{o as u}from"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import{d as c}from"./BitmapContainer-BC8fvmFc-DzZ9OrT1.js";import{X as y,Y as f}from"./LayerView-Bish-E63-DRGspiuk.js";import{X as x}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import{l as w}from"./HighlightGraphicContainer-Dt5r6lMq-C0o3U8Y8.js";import{K as _}from"./ExportStrategy-BNE7Gp0u-CVNDsUmZ.js";import{r as v}from"./ExportImageParameters-DxyNGQ57-DAeGZbW_.js";import{T as H}from"./timeSupport-ohWmWReZ-CwKm-94j.js";import{n as I}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import{O as U}from"./MapServiceLayerViewHelper-bw3M4B8s-BT4W8OxK.js";import{x as V}from"./drapedUtils-BZ1SGPtE-DN0L7Y_o.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./signal-CETehA7D-vStzfbaY.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./Bitmap-CcqmzvfR-Cl_blWW9.js";import"./scaleUtils-DxsfQwK1-OKeSqBb9.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-BB_azrTi.js";import"./languageUtils-BYxF9hRA-Dig_Awzu.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-Cy2KeMh-.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./popupUtils-nV1O8RUO-xbvi-u4x.js";const E=t=>{let i=class extends t{initialize(){this.exportImageParameters=new v({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){return this.view?.floors??null}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return H(this.layer,this.view?.timeExtent,this._get("timeExtent"))}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return r([o()],i.prototype,"exportImageParameters",void 0),r([o({readOnly:!0})],i.prototype,"floors",null),r([o({readOnly:!0})],i.prototype,"exportImageVersion",null),r([o()],i.prototype,"layer",void 0),r([o()],i.prototype,"suspended",void 0),r([o({readOnly:!0})],i.prototype,"timeExtent",null),i=r([h("esri.views.layers.MapImageLayerView")],i),i};let m=class extends E(I(y(f))){constructor(){super(...arguments),this._highlightGraphics=new u,this._updateHash=""}fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i)}update(t){const i=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(t).catch(e=>{g(e)||l.getLogger(this).error(e)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:i,version:e}=this.layer,p=e>=10.3,n=e>=10;this._bitmapContainer=new c,this.container.addChild(this._bitmapContainer),this._highlightView=new x({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new U({createFetchPopupFeaturesQueryGeometry:(a,s)=>V(a,s,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(a,s)=>{this._highlightView.graphicUpdateHandler({graphic:a,property:s})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new _({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:i,imageRotationSupported:p,imageNormalizationSupported:n,hidpi:!0}),this.addAttachHandles(d(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,i,e,p){return this.layer.fetchImage(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}fetchImageBitmap(t,i,e,p){return this.layer.fetchImageBitmap(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}highlight(t){return this._popupHighlightHelper.highlight(t)}};r([o()],m.prototype,"strategy",void 0),r([o()],m.prototype,"updating",void 0),m=r([h("esri.views.2d.layers.MapImageLayerView2D")],m);const Oi=m;export{Oi as default}; diff --git a/main/assets/MapNotesLayer-DauvjDLM-CG1np16e.js b/main/assets/MapNotesLayer-DauvjDLM-CG1np16e.js deleted file mode 100644 index 14f21d035..000000000 --- a/main/assets/MapNotesLayer-DauvjDLM-CG1np16e.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as a,i as T,eC as F,eB as B,eD as C,jI as G,J as h,ag as O,P as w,h6 as x,jJ as N,jK as I,gI as M,bi as z,o as k,el as K,aC as W,b0 as v,a0 as d,ac as A,n as V,jL as D}from"./main-BZaw9FpY.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{V as b,J as H,_ as Q,W as U,K as Z}from"./projection-BA9M1R7d-DoNqITCd.js";import{B as X}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import Y from"./FeatureLayer-BrRKw5Si-CHreUEJ9.js";import ee from"./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js";import{D as te}from"./Layer-ChoECxvZ-C4wLrCej.js";import{i as re}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{u as oe}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as le}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as ae}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{y as E}from"./Field-C6hA1tZj-CbELM0zp.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./versionUtils-LZYZz-38-xZnsxhiL.js";import"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";function g(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!R(e))}function R({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return J.find(i=>r===i.geometryTypeJSON&&t.drawingInfo?.renderer?.symbol?.type===i.identifyingSymbol.type)}function j(){return new V({xmin:-180,ymin:-90,xmax:180,ymax:90})}const L=new E({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new E({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let m=class extends ee{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){const t=this.layer?.spatialReference,e=this.fullBounds;return t?e==null?b(j(),t).geometry:M(e,t):null}get fullBounds(){const t=this.layer?.spatialReference;if(!t)return null;const e=x();return this.graphics.forEach(r=>{const i=r.geometry!=null?b(r.geometry,t).geometry:null;i!=null&&N(e,i.type==="point"?i:i.extent,e)}),I(e,D)?null:e}get sublayers(){return this.graphics}};o([a({readOnly:!0})],m.prototype,"fullExtent",null),o([a({readOnly:!0})],m.prototype,"fullBounds",null),o([a({readOnly:!0})],m.prototype,"sublayers",null),o([a()],m.prototype,"layer",void 0),o([a()],m.prototype,"layerId",void 0),o([a({readOnly:!0})],m.prototype,"visibilityMode",void 0),m=o([T("esri.layers.MapNotesLayer.MapNotesSublayer")],m);const J=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new F().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new B().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new C().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new C().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new G().toJSON()}];let l=class extends oe(ae(ie(le(q(te))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=h.WGS84,this.sublayers=new O(J.map(e=>new m({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!g(e)&&r?.origin!=="portal-item"}}}readFeatureCollections(t,e,r){if(!g(e))return null;const i=e.layers.map(p=>{const n=new Y;return n.read(p,r),n});return new O({items:i})}readLegacyfeatureCollectionJSON(t,e){return g(e)?w(e.featureCollection):null}get fullExtent(){const t=this.spatialReference,e=x();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:r})=>r!=null?N(e,r,e):e,e):this.featureCollectionJSON?.layers.some(r=>r.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(r=>{const i=b(r.layerDefinition.extent,t).geometry;i!=null&&N(e,i,e)}),I(e,D)?b(j(),t).geometry:M(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(g(e))return null;const i=[];let p=e.layers.reduce((n,s)=>Math.max(n,s.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:s,featureSet:y}=n,f=s.id??p++,u=R(n);if(u!=null){const c=new m({id:u.id,title:s.name,layerId:f,layer:this,graphics:y.features.map(({geometry:S,symbol:_,attributes:P,popupInfo:$})=>z.fromJSON({attributes:P,geometry:S,symbol:_,popupTemplate:$}))});i.push(c)}}return new O(i)}writeSublayers(t,e,r,i){const{minScale:p,maxScale:n}=this;if(t==null)return;const s=t.some(u=>u.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new k("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const y=[];let f=this.spatialReference.toJSON();e:for(const u of t)for(const c of u.graphics)if(c.geometry!=null){f=c.geometry.spatialReference.toJSON();break e}for(const u of J){const c=t.find(S=>u.id===S.id);this._writeMapNoteSublayer(y,c,u,p,n,f,i)}K("featureCollection.layers",y,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=w(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const i of this.sublayers)for(const p of i.graphics)if(p.geometry!=null){const n=p.geometry;t?W(n.spatialReference,t)||(H(n.spatialReference,t)||Q()||await U(),p.geometry=Z(n,t)):t=n.spatialReference,e.push(p)}const r=await X(e.map(i=>i.geometry));e.forEach((i,p)=>i.geometry=r[p])}_findSublayer(t){return this.sublayers==null?null:this.sublayers?.find(e=>e.id===t)??null}_writeMapNoteSublayer(t,e,r,i,p,n,s){const y=[];if(e!=null){for(const f of e.graphics)this._writeMapNote(y,f,r.geometryType,s);this._normalizeObjectIds(y,L),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:w(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:i,maxScale:p,objectIdField:"OBJECTID",fields:[L.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,i){if(e==null)return;const{geometry:p,symbol:n,popupTemplate:s}=e;if(p==null)return;if(p.type!==r)return void i?.messages?.push(new v("map-notes-layer:invalid-geometry-type",`Geometry "${p.type}" cannot be saved in "${r}" layer`,{graphic:e}));if(n==null)return void i?.messages?.push(new v("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e}));const y={attributes:{...e.attributes},geometry:p.toJSON(),symbol:n.toJSON()};s!=null&&(y.popupInfo=s.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let i=re(r,t)+1;const p=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:s}=n;(s[r]==null||p.has(s[r]))&&(s[r]=i++),p.add(s[r])}}};o([a({readOnly:!0})],l.prototype,"capabilities",void 0),o([d(["portal-item","web-map"],"capabilities",["layers"])],l.prototype,"readCapabilities",null),o([a({readOnly:!0})],l.prototype,"featureCollections",void 0),o([d(["web-map","portal-item"],"featureCollections",["layers"])],l.prototype,"readFeatureCollections",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],l.prototype,"featureCollectionJSON",void 0),o([d(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],l.prototype,"readLegacyfeatureCollectionJSON",null),o([a({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],l.prototype,"featureCollectionType",void 0),o([a({readOnly:!0})],l.prototype,"fullExtent",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],l.prototype,"legendEnabled",void 0),o([a({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"minScale",void 0),o([d(["web-map","portal-item"],"minScale",["layers"])],l.prototype,"readMinScale",null),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"maxScale",void 0),o([d(["web-map","portal-item"],"maxScale",["layers"])],l.prototype,"readMaxScale",null),o([a({readOnly:!0})],l.prototype,"multipointLayer",null),o([a({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],l.prototype,"operationalLayerType",void 0),o([a({readOnly:!0})],l.prototype,"pointLayer",null),o([a({readOnly:!0})],l.prototype,"polygonLayer",null),o([a({readOnly:!0})],l.prototype,"polylineLayer",null),o([a({type:h})],l.prototype,"spatialReference",void 0),o([d(["web-map","portal-item"],"spatialReference",["layers"])],l.prototype,"readSpatialReference",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],l.prototype,"sublayers",void 0),o([d("web-map","sublayers",["layers"])],l.prototype,"readSublayers",null),o([A("web-map","sublayers")],l.prototype,"writeSublayers",null),o([a({readOnly:!0})],l.prototype,"textLayer",null),o([a()],l.prototype,"title",void 0),o([a({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),l=o([T("esri.layers.MapNotesLayer")],l);const Wt=l;export{Wt as default}; diff --git a/main/assets/MapNotesLayer-DauvjDLM-DfkSCK2i.js b/main/assets/MapNotesLayer-DauvjDLM-DfkSCK2i.js new file mode 100644 index 000000000..22e635400 --- /dev/null +++ b/main/assets/MapNotesLayer-DauvjDLM-DfkSCK2i.js @@ -0,0 +1 @@ +import{v as o,S as a,i as T,eC as F,eB as B,eD as C,jI as G,J as h,ag as O,P as w,h6 as x,jJ as N,jK as I,gI as M,bi as z,o as k,el as K,aC as W,b0 as v,a0 as d,ac as A,n as V,jL as D}from"./main-C7yV2j71.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{V as b,J as H,_ as Q,W as U,K as Z}from"./projection-BA9M1R7d-DXrPfsKU.js";import{B as X}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import Y from"./FeatureLayer-BrRKw5Si-Rem12G_g.js";import ee from"./GraphicsLayer-DfeGaYc1-DAZy-iUY.js";import{D as te}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{i as re}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{u as oe}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as le}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as ae}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{y as E}from"./Field-C6hA1tZj-C0Sp7XvY.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./editsZScale-BDsX6vv--CoeIQyxn.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import"./ArcGISService-BYA-y6X6-BtWUPppI.js";import"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import"./versionUtils-LZYZz-38-DgmFurh2.js";import"./styleUtils-ChrJTYIw-OCRItq_6.js";import"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";function g(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!R(e))}function R({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return J.find(i=>r===i.geometryTypeJSON&&t.drawingInfo?.renderer?.symbol?.type===i.identifyingSymbol.type)}function j(){return new V({xmin:-180,ymin:-90,xmax:180,ymax:90})}const L=new E({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new E({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let m=class extends ee{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){const t=this.layer?.spatialReference,e=this.fullBounds;return t?e==null?b(j(),t).geometry:M(e,t):null}get fullBounds(){const t=this.layer?.spatialReference;if(!t)return null;const e=x();return this.graphics.forEach(r=>{const i=r.geometry!=null?b(r.geometry,t).geometry:null;i!=null&&N(e,i.type==="point"?i:i.extent,e)}),I(e,D)?null:e}get sublayers(){return this.graphics}};o([a({readOnly:!0})],m.prototype,"fullExtent",null),o([a({readOnly:!0})],m.prototype,"fullBounds",null),o([a({readOnly:!0})],m.prototype,"sublayers",null),o([a()],m.prototype,"layer",void 0),o([a()],m.prototype,"layerId",void 0),o([a({readOnly:!0})],m.prototype,"visibilityMode",void 0),m=o([T("esri.layers.MapNotesLayer.MapNotesSublayer")],m);const J=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new F().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new B().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new C().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new C().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new G().toJSON()}];let l=class extends oe(ae(ie(le(q(te))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=h.WGS84,this.sublayers=new O(J.map(e=>new m({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!g(e)&&r?.origin!=="portal-item"}}}readFeatureCollections(t,e,r){if(!g(e))return null;const i=e.layers.map(p=>{const n=new Y;return n.read(p,r),n});return new O({items:i})}readLegacyfeatureCollectionJSON(t,e){return g(e)?w(e.featureCollection):null}get fullExtent(){const t=this.spatialReference,e=x();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:r})=>r!=null?N(e,r,e):e,e):this.featureCollectionJSON?.layers.some(r=>r.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(r=>{const i=b(r.layerDefinition.extent,t).geometry;i!=null&&N(e,i,e)}),I(e,D)?b(j(),t).geometry:M(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(g(e))return null;const i=[];let p=e.layers.reduce((n,s)=>Math.max(n,s.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:s,featureSet:y}=n,f=s.id??p++,u=R(n);if(u!=null){const c=new m({id:u.id,title:s.name,layerId:f,layer:this,graphics:y.features.map(({geometry:S,symbol:_,attributes:P,popupInfo:$})=>z.fromJSON({attributes:P,geometry:S,symbol:_,popupTemplate:$}))});i.push(c)}}return new O(i)}writeSublayers(t,e,r,i){const{minScale:p,maxScale:n}=this;if(t==null)return;const s=t.some(u=>u.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new k("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const y=[];let f=this.spatialReference.toJSON();e:for(const u of t)for(const c of u.graphics)if(c.geometry!=null){f=c.geometry.spatialReference.toJSON();break e}for(const u of J){const c=t.find(S=>u.id===S.id);this._writeMapNoteSublayer(y,c,u,p,n,f,i)}K("featureCollection.layers",y,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=w(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const i of this.sublayers)for(const p of i.graphics)if(p.geometry!=null){const n=p.geometry;t?W(n.spatialReference,t)||(H(n.spatialReference,t)||Q()||await U(),p.geometry=Z(n,t)):t=n.spatialReference,e.push(p)}const r=await X(e.map(i=>i.geometry));e.forEach((i,p)=>i.geometry=r[p])}_findSublayer(t){return this.sublayers==null?null:this.sublayers?.find(e=>e.id===t)??null}_writeMapNoteSublayer(t,e,r,i,p,n,s){const y=[];if(e!=null){for(const f of e.graphics)this._writeMapNote(y,f,r.geometryType,s);this._normalizeObjectIds(y,L),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:w(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:i,maxScale:p,objectIdField:"OBJECTID",fields:[L.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,i){if(e==null)return;const{geometry:p,symbol:n,popupTemplate:s}=e;if(p==null)return;if(p.type!==r)return void i?.messages?.push(new v("map-notes-layer:invalid-geometry-type",`Geometry "${p.type}" cannot be saved in "${r}" layer`,{graphic:e}));if(n==null)return void i?.messages?.push(new v("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e}));const y={attributes:{...e.attributes},geometry:p.toJSON(),symbol:n.toJSON()};s!=null&&(y.popupInfo=s.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let i=re(r,t)+1;const p=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:s}=n;(s[r]==null||p.has(s[r]))&&(s[r]=i++),p.add(s[r])}}};o([a({readOnly:!0})],l.prototype,"capabilities",void 0),o([d(["portal-item","web-map"],"capabilities",["layers"])],l.prototype,"readCapabilities",null),o([a({readOnly:!0})],l.prototype,"featureCollections",void 0),o([d(["web-map","portal-item"],"featureCollections",["layers"])],l.prototype,"readFeatureCollections",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],l.prototype,"featureCollectionJSON",void 0),o([d(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],l.prototype,"readLegacyfeatureCollectionJSON",null),o([a({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],l.prototype,"featureCollectionType",void 0),o([a({readOnly:!0})],l.prototype,"fullExtent",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],l.prototype,"legendEnabled",void 0),o([a({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"minScale",void 0),o([d(["web-map","portal-item"],"minScale",["layers"])],l.prototype,"readMinScale",null),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"maxScale",void 0),o([d(["web-map","portal-item"],"maxScale",["layers"])],l.prototype,"readMaxScale",null),o([a({readOnly:!0})],l.prototype,"multipointLayer",null),o([a({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],l.prototype,"operationalLayerType",void 0),o([a({readOnly:!0})],l.prototype,"pointLayer",null),o([a({readOnly:!0})],l.prototype,"polygonLayer",null),o([a({readOnly:!0})],l.prototype,"polylineLayer",null),o([a({type:h})],l.prototype,"spatialReference",void 0),o([d(["web-map","portal-item"],"spatialReference",["layers"])],l.prototype,"readSpatialReference",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],l.prototype,"sublayers",void 0),o([d("web-map","sublayers",["layers"])],l.prototype,"readSublayers",null),o([A("web-map","sublayers")],l.prototype,"writeSublayers",null),o([a({readOnly:!0})],l.prototype,"textLayer",null),o([a()],l.prototype,"title",void 0),o([a({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),l=o([T("esri.layers.MapNotesLayer")],l);const Wt=l;export{Wt as default}; diff --git a/main/assets/MapNotesLayerView2D-EusnP8A_-CDAqHlRM.js b/main/assets/MapNotesLayerView2D-EusnP8A_-CDAqHlRM.js new file mode 100644 index 000000000..b740e2bdf --- /dev/null +++ b/main/assets/MapNotesLayerView2D-EusnP8A_-CDAqHlRM.js @@ -0,0 +1 @@ +import{bi as u,ag as f,aq as w,a2 as l,ah as p,aL as h,ai as y,v as _,i as V}from"./main-C7yV2j71.js";import{X as v,Y as C}from"./LayerView-Bish-E63-I2LV0oDm.js";import{d as g}from"./GraphicContainer-DuOHUciE-dHT2kH0f.js";import{X as c}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";const d="sublayers",m="layerView",H=new Set(["default"]);let n=class extends v(C){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(i,t){return Array.from(this.graphicsViews(),r=>{const e=r.hitTest(i);if(this._graphicsViewsFeatureCollectionMap!=null){const o=this._graphicsViewsFeatureCollectionMap.get(r);for(const s of e)!s.popupTemplate&&o.popupTemplate&&(s.popupTemplate=o.popupTemplate),s.sourceLayer=s.layer=this.layer}return e}).flat().map(r=>({type:"graphic",graphic:r,layer:this.layer,mapPoint:i}))}highlight(i){let t;typeof i=="number"?t=[i]:i instanceof u?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):f.isCollection(i)&&(t=i.map(e=>e&&e.uid).toArray());const r=t?.filter(w);return r?.length?(this._addHighlight(r),l(()=>this._removeHighlight(r))):l()}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),r=this.layer.featureCollections;if(r!=null&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const e of r){const o=new g(this.view.featuresTilingScheme),s=new c({view:i,graphics:e.source,renderer:e.renderer,requestUpdateCallback:t,container:o});this._graphicsViewsFeatureCollectionMap.set(s,e),this.container.addChild(s.container),this.addHandles([p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),d)}detach(){this._destroyGraphicsViews(),this.removeHandles(d)}moveEnd(){}viewChange(){for(const i of this.graphicsViews())i.viewChange()}isUpdating(){for(const i of this.graphicsViews())if(i.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.removeHandles(m);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const i=[],t=this.view,r=()=>this.requestUpdate();for(const e of this.layer.sublayers){const o=new g(this.view.featuresTilingScheme);o.fadeTransitionEnabled=!0;const s=new c({view:t,graphics:e.graphics,requestUpdateCallback:r,container:o});this.addHandles([e.on("graphic-update",s.graphicUpdateHandler),p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m),this.container.addChild(s.container),i.push(s)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys()),t=this._getHighlightBits(H);for(const r of this.graphicsViews())r.setHighlight(i.map(e=>({objectId:e,highlightFlags:t})))}};n=_([V("esri.views.2d.layers.MapNotesLayerView2D")],n);const Vt=n;export{Vt as default}; diff --git a/main/assets/MapNotesLayerView2D-EusnP8A_-DsvgmiI6.js b/main/assets/MapNotesLayerView2D-EusnP8A_-DsvgmiI6.js deleted file mode 100644 index 0e9dd38ee..000000000 --- a/main/assets/MapNotesLayerView2D-EusnP8A_-DsvgmiI6.js +++ /dev/null @@ -1 +0,0 @@ -import{bi as u,ag as f,aq as w,a2 as l,ah as p,aL as h,ai as y,v as _,i as V}from"./main-BZaw9FpY.js";import{X as v,Y as C}from"./LayerView-Bish-E63-DRGspiuk.js";import{d as g}from"./GraphicContainer-DuOHUciE-BvzcbTDZ.js";import{X as c}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";const d="sublayers",m="layerView",H=new Set(["default"]);let n=class extends v(C){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(i,t){return Array.from(this.graphicsViews(),r=>{const e=r.hitTest(i);if(this._graphicsViewsFeatureCollectionMap!=null){const o=this._graphicsViewsFeatureCollectionMap.get(r);for(const s of e)!s.popupTemplate&&o.popupTemplate&&(s.popupTemplate=o.popupTemplate),s.sourceLayer=s.layer=this.layer}return e}).flat().map(r=>({type:"graphic",graphic:r,layer:this.layer,mapPoint:i}))}highlight(i){let t;typeof i=="number"?t=[i]:i instanceof u?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):f.isCollection(i)&&(t=i.map(e=>e&&e.uid).toArray());const r=t?.filter(w);return r?.length?(this._addHighlight(r),l(()=>this._removeHighlight(r))):l()}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),r=this.layer.featureCollections;if(r!=null&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const e of r){const o=new g(this.view.featuresTilingScheme),s=new c({view:i,graphics:e.source,renderer:e.renderer,requestUpdateCallback:t,container:o});this._graphicsViewsFeatureCollectionMap.set(s,e),this.container.addChild(s.container),this.addHandles([p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),d)}detach(){this._destroyGraphicsViews(),this.removeHandles(d)}moveEnd(){}viewChange(){for(const i of this.graphicsViews())i.viewChange()}isUpdating(){for(const i of this.graphicsViews())if(i.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.removeHandles(m);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const i=[],t=this.view,r=()=>this.requestUpdate();for(const e of this.layer.sublayers){const o=new g(this.view.featuresTilingScheme);o.fadeTransitionEnabled=!0;const s=new c({view:t,graphics:e.graphics,requestUpdateCallback:r,container:o});this.addHandles([e.on("graphic-update",s.graphicUpdateHandler),p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m),this.container.addChild(s.container),i.push(s)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys()),t=this._getHighlightBits(H);for(const r of this.graphicsViews())r.setHighlight(i.map(e=>({objectId:e,highlightFlags:t})))}};n=_([V("esri.views.2d.layers.MapNotesLayerView2D")],n);const Vt=n;export{Vt as default}; diff --git a/main/assets/MapServiceLayerViewHelper-bw3M4B8s-B5cli8RL.js b/main/assets/MapServiceLayerViewHelper-bw3M4B8s-B5cli8RL.js new file mode 100644 index 000000000..18265df50 --- /dev/null +++ b/main/assets/MapServiceLayerViewHelper-bw3M4B8s-B5cli8RL.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./visualVariableUtils-D3kZJRyn-5umqHW84.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./compilerUtils-CV1QYWI8-89qN_-l3.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js"])))=>i.map(i=>d[i]); +import{v as a,S as p,af as X,g as Y,ac as U,n as J,J as ee,i as I,bi as Q,a0 as te,e as B,aO as re,ek as ie,j as se,bp as oe,ai as ne,o as A,ag as ae,aq as T,a2 as k,eD as M,_ as le,an as pe,p as ue,K as ye,$ as L,eH as ce,bV as z,ex as he,f as de,bK as fe,bM as me}from"./main-C7yV2j71.js";import{a8 as ge}from"./languageUtils-BYxF9hRA-BLoYMqdU.js";import{f as we,c as be}from"./scaleUtils-DxsfQwK1-B4OFXqEO.js";import{e as N}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{y as $}from"./drapedUtils-BZ1SGPtE-BPt00fGU.js";import{B as ve}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{y as xe,n as Se,a as Fe}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{s as Oe}from"./sublayerUtils-CyM0QC5B-BQ17aSXL.js";import{k as je}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{h as Ee,m as Re}from"./popupUtils-nV1O8RUO-X6GWMgRY.js";function _e(t,e){const{dpi:i,gdbVersion:o,geometry:r,geometryPrecision:n,height:s,historicMoment:d,layerOption:u,mapExtent:l,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,spatialReference:F,timeExtent:w,tolerance:g,width:b}=t.toJSON(),{dynamicLayers:j,layerDefs:E,layerIds:V}=Pe(t),q=e?.geometry!=null?e.geometry:null,v={historicMoment:d,geometryPrecision:n,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,tolerance:g},R=q?.toJSON()||r;v.imageDisplay=`${b},${s},${i}`,o&&(v.gdbVersion=o),R&&(delete R.spatialReference,v.geometry=JSON.stringify(R),v.geometryType=fe(R));const G=F??R?.spatialReference??l?.spatialReference;if(G&&(v.sr=me(G)),v.time=w?[w.start,w.end].join(","):null,l){const{xmin:Z,ymin:C,xmax:K,ymax:W}=l;v.mapExtent=`${Z},${C},${K},${W}`}return E&&(v.layerDefs=E),j&&!E&&(v.dynamicLayers=j),v.layers=u==="popup"?"visible":u,V&&!j&&(v.layers+=`:${V.join(",")}`),v}function Pe(t){const{mapExtent:e,floors:i,width:o,sublayers:r,layerIds:n,layerOption:s,gdbVersion:d}=t,u=r?.find(f=>f.layer!=null)?.layer?.serviceSublayers,l=s==="popup",y={},c=be({extent:e,width:o,spatialReference:e?.spatialReference}),m=[],x=f=>{const F=c===0,w=f.minScale===0||c<=f.minScale,g=f.maxScale===0||c>=f.maxScale;if(f.visible&&(F||w&&g))if(f.sublayers)f.sublayers.forEach(x);else{if(n?.includes(f.id)===!1||l&&(!f.popupTemplate||!f.popupEnabled))return;m.unshift(f)}};if(r?.forEach(x),r&&!m.length)y.layerIds=[];else{const f=Oe(m,u,d),F=m.map(w=>{const g=N(i,w);return w.toExportImageJSON(g)});if(f)y.dynamicLayers=JSON.stringify(F);else{if(r){let g=m.map(({id:b})=>b);n&&(g=g.filter(b=>n.includes(b))),y.layerIds=g}else n?.length&&(y.layerIds=n);const w=Ie(i,m);if(w!=null&&w.length){const g={};for(const b of w)b.definitionExpression&&(g[b.id]=b.definitionExpression);Object.keys(g).length&&(y.layerDefs=JSON.stringify(g))}}}return y}function Ie(t,e){const i=!!t?.length,o=e.filter(r=>r.definitionExpression!=null||i&&r.floorInfo!=null);return o.length?o.map(r=>{const n=N(t,r),s=z(n,r.definitionExpression);return{id:r.id,definitionExpression:s??void 0}}):null}var P;let h=P=class extends B{static from(t){return re(P,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};a([p({type:Number,json:{write:!0}})],h.prototype,"dpi",void 0),a([p()],h.prototype,"floors",void 0),a([p({type:String,json:{write:!0}})],h.prototype,"gdbVersion",void 0),a([p({types:X,json:{read:Y,write:!0}})],h.prototype,"geometry",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"geometryPrecision",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"height",void 0),a([p({type:Date})],h.prototype,"historicMoment",void 0),a([U("historicMoment")],h.prototype,"writeHistoricMoment",null),a([p({type:[Number],json:{write:!0}})],h.prototype,"layerIds",void 0),a([p({type:["top","visible","all","popup"],json:{write:!0}})],h.prototype,"layerOption",void 0),a([p({type:J,json:{write:!0}})],h.prototype,"mapExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"maxAllowableOffset",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnFieldName",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnGeometry",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnM",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnUnformattedValues",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnZ",void 0),a([p({type:ee,json:{write:!0}})],h.prototype,"spatialReference",void 0),a([p()],h.prototype,"sublayers",void 0),a([p({type:je,json:{write:!0}})],h.prototype,"timeExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"tolerance",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"width",void 0),h=P=a([I("esri.rest.support.IdentifyParameters")],h);const D=h;let S=class extends B{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return Q.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:i,geometry:o}=t;i&&(e.attributes={...i}),o!=null&&(e.geometry=o.toJSON(),e.geometryType=ie.toJSON(o.type))}};a([p({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),a([p({type:Q})],S.prototype,"feature",void 0),a([te("feature",["attributes","geometry"])],S.prototype,"readFeature",null),a([U("feature")],S.prototype,"writeFeature",null),a([p({type:Number,json:{write:!0}})],S.prototype,"layerId",void 0),a([p({type:String,json:{write:!0}})],S.prototype,"layerName",void 0),S=a([I("esri.rest.support.IdentifyResult")],S);const Ne=S;async function Ve(t,e,i){const o=(e=Ae(e)).geometry?[e.geometry]:[],r=xe(t);return r.path+="/identify",ve(o).then(n=>{const s=_e(e,{geometry:n?.[0]}),d=Se({...r.query,f:"json",...s}),u=Fe(d,i);return de(r.path,u).then(Ge).then(l=>Te(l,e.sublayers))})}function Ge(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(i=>Ne.fromJSON(i)),e}function Ae(t){return t=D.from(t)}function Te(t,e){if(!e?.length)return t;const i=new Map;function o(r){i.set(r.id,r),r.sublayers&&r.sublayers.forEach(o)}e.forEach(o);for(const r of t.results)r.feature.sourceLayer=i.get(r.layerId);return t}const H=k();let _=null;function Ke(t,e){return e.type==="tile"||e.type==="map-image"}let O=class extends se{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=oe(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ne(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeaturesAtLocation(t,e){const{layerView:{layer:i,view:{scale:o}}}=this;if(!t)throw new A("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:i});const r=Me(i.sublayers,o,e);if(!r.length)return[];const n=await $e(i,r);if(!((i.capabilities?.operations?.supportsIdentify??!0)&&i.version>=10.5)&&!n)throw new A("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:i});return n?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(t){const e=this.highlightGraphics;if(!t||!e)return H;let i=ge(t)?[t]:ae.isCollection(t)?t.toArray():Array.isArray(t)?t:[];if(i=i?.filter(T),(i?.length??0)===0)return H;for(const o of i){const{sourceLayer:r}=o;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(o.visible=!1)}return e.addMany(i),k(()=>e.removeMany(i??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:i,highlightGraphicUpdated:o}=this;if(i&&o)for(const r of t){const n=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&n&&"getSymbolAsync"in n&&n.getSymbolAsync(r).then(async s=>{s||=new M;let d=null;const u="visualVariables"in n?n.visualVariables?.find(l=>l.type==="size"):void 0;u&&(_||(_=(await le(async()=>{const{getSize:l}=await import("./visualVariableUtils-D3kZJRyn-5umqHW84.js");return{getSize:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).getSize),d=_(u,r,{view:e.type,scale:e.scale,shape:s.type==="simple-marker"?s.style:null})),d||="width"in s&&"height"in s&&s.width!=null&&s.height!=null?Math.max(s.width,s.height):"size"in s?s.size:16,i.includes(r)&&(r.symbol=new M({style:"square",size:d,xoffset:"xoffset"in s?s.xoffset:0,yoffset:"yoffset"in s?s.yoffset:0}),o(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:i},highlightGraphics:o,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!o?.length||!e.capabilities.operations.supportsQuery)return;const n=this._getTargetResolution(t),s=new Map;for(const l of o)if(!this._featuresResolutions.has(l)||this._featuresResolutions.get(l)>n){const y=l.sourceLayer;pe(s,y,()=>new Map).set(l.getObjectId(),l)}const d=Array.from(s,([l,y])=>{const c=l.createQuery();return c.objectIds=[...y.keys()],c.outFields=[l.objectIdField],c.returnGeometry=!0,c.maxAllowableOffset=n,c.outSpatialReference=i.spatialReference,l.queryFeatures(c)}),u=await Promise.all(d);if(!this.destroyed)for(const{features:l}of u)for(const y of l){const c=y.sourceLayer,m=s.get(c).get(y.getObjectId());m&&o.includes(m)&&(m.geometry=y.geometry,r(m,"geometry"),this._featuresResolutions.set(m,n))}}_getTargetResolution(t){const e=t*ue(this.layerView.view.spatialReference),i=e/16;return i<=10?0:t/e*i}async _fetchPopupFeaturesUsingIdentify(t,e,i){const o=await this._createIdentifyParameters(t,e,i);if(o==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,o,i);return r.map(n=>n.feature)}async _createIdentifyParameters(t,e,i){const{floors:o,layer:r,timeExtent:n,view:{spatialReference:s,scale:d}}=this.layerView;if(!e.length)return null;await Promise.all(e.map(({sublayer:x})=>x.load(i).catch(()=>{})));const u=Math.min(ye("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((x,f)=>f.renderer?$({renderer:f.renderer,pointerType:i?.pointerType}):x,2)),l=this.createFetchPopupFeaturesQueryGeometry(t,u),y=we(d,s),c=Math.round(l.width/y),m=new J({xmin:l.center.x-y*c,ymin:l.center.y-y*c,xmax:l.center.x+y*c,ymax:l.center.y+y*c,spatialReference:l.spatialReference});return new D({floors:o,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:c,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:s,sublayers:r.sublayers,timeExtent:n,tolerance:u,width:c})}async _fetchPopupFeaturesUsingQueries(t,e,i){const{layerView:{floors:o,timeExtent:r}}=this,n=e.map(async({sublayer:s,popupTemplate:d})=>{if(await s.load(i).catch(()=>{}),s.capabilities&&!s.capabilities.operations.supportsQuery)return[];const u=s.createQuery(),l=$({renderer:s.renderer,pointerType:i?.pointerType}),y=this.createFetchPopupFeaturesQueryGeometry(t,l),c=new Set,[m]=await Promise.all([Ee(s,d),s.renderer?.collectRequiredFields(c,s.fieldsIndex)]);L(i),ce(c,s.fieldsIndex,m);const x=Array.from(c).sort();u.geometry=y,u.outFields=x,u.timeExtent=r;const f=N(o,s);u.where=z(u.where,f);const F=this._getTargetResolution(y.width/l),w=await Le(d);L(i);const g=s.geometryType==="point"||w&&w.arcadeUtils.hasGeometryOperations(d);g||(u.maxAllowableOffset=F);let{features:b}=await s.queryFeatures(u,i);const j=g?0:F;b=await He(s,b,i);for(const E of b)this._featuresResolutions.set(E,j);return b});return(await Promise.allSettled(n)).reduce((s,d)=>d.status==="fulfilled"?[...s,...d.value]:s,[]).filter(T)}};function Me(t,e,i){const o=[];if(!t)return o;const r=n=>{const s=n.minScale===0||e<=n.minScale,d=n.maxScale===0||e>=n.maxScale;if(n.visible&&s&&d){if(n.sublayers)n.sublayers.forEach(r);else if(n.popupEnabled){const u=Re(n,{...i,defaultPopupTemplateEnabled:!1});u!=null&&o.unshift({sublayer:n,popupTemplate:u})}}};return t.map(r),o}function Le(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(e=>e.type==="expression")?he():Promise.resolve()}async function $e(t,e){if(t.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:i})=>i.load().then(()=>i.capabilities.operations.supportsQuery)))}catch{return!1}}async function He(t,e,i){const o=t.renderer;return o&&"defaultSymbol"in o&&!o.defaultSymbol&&(e=o.valueExpression?await Promise.all(e.map(r=>o.getSymbolAsync(r,i).then(n=>n?r:null))).then(r=>r.filter(n=>n!=null)):e.filter(r=>o.getSymbol(r)!=null)),e}a([p({constructOnly:!0})],O.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),a([p({constructOnly:!0})],O.prototype,"layerView",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphics",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphicUpdated",void 0),a([p({constructOnly:!0})],O.prototype,"updatingHandles",void 0),O=a([I("esri.views.layers.support.MapServiceLayerViewHelper")],O);export{O,Ke as _}; diff --git a/main/assets/MapServiceLayerViewHelper-bw3M4B8s-BT4W8OxK.js b/main/assets/MapServiceLayerViewHelper-bw3M4B8s-BT4W8OxK.js deleted file mode 100644 index e31f78cc9..000000000 --- a/main/assets/MapServiceLayerViewHelper-bw3M4B8s-BT4W8OxK.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js"])))=>i.map(i=>d[i]); -import{v as a,S as p,af as X,g as Y,ac as U,n as J,J as ee,i as I,bi as Q,a0 as te,e as B,aO as re,ek as ie,j as se,bp as oe,ai as ne,o as A,ag as ae,aq as T,a2 as k,eD as M,_ as le,an as pe,p as ue,K as ye,$ as L,eH as ce,bV as z,ex as he,f as de,bK as fe,bM as me}from"./main-BZaw9FpY.js";import{a8 as ge}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{f as we,c as be}from"./scaleUtils-DxsfQwK1-OKeSqBb9.js";import{e as N}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{y as $}from"./drapedUtils-BZ1SGPtE-DN0L7Y_o.js";import{B as ve}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{y as xe,n as Se,a as Fe}from"./utils-9sQxfkoa-Cus_qP6M.js";import{s as Oe}from"./sublayerUtils-CyM0QC5B-BB_azrTi.js";import{k as je}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{h as Ee,m as Re}from"./popupUtils-nV1O8RUO-xbvi-u4x.js";function _e(t,e){const{dpi:i,gdbVersion:o,geometry:r,geometryPrecision:n,height:s,historicMoment:d,layerOption:u,mapExtent:l,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,spatialReference:F,timeExtent:w,tolerance:g,width:b}=t.toJSON(),{dynamicLayers:j,layerDefs:E,layerIds:V}=Pe(t),q=e?.geometry!=null?e.geometry:null,v={historicMoment:d,geometryPrecision:n,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,tolerance:g},R=q?.toJSON()||r;v.imageDisplay=`${b},${s},${i}`,o&&(v.gdbVersion=o),R&&(delete R.spatialReference,v.geometry=JSON.stringify(R),v.geometryType=fe(R));const G=F??R?.spatialReference??l?.spatialReference;if(G&&(v.sr=me(G)),v.time=w?[w.start,w.end].join(","):null,l){const{xmin:Z,ymin:C,xmax:K,ymax:W}=l;v.mapExtent=`${Z},${C},${K},${W}`}return E&&(v.layerDefs=E),j&&!E&&(v.dynamicLayers=j),v.layers=u==="popup"?"visible":u,V&&!j&&(v.layers+=`:${V.join(",")}`),v}function Pe(t){const{mapExtent:e,floors:i,width:o,sublayers:r,layerIds:n,layerOption:s,gdbVersion:d}=t,u=r?.find(f=>f.layer!=null)?.layer?.serviceSublayers,l=s==="popup",y={},c=be({extent:e,width:o,spatialReference:e?.spatialReference}),m=[],x=f=>{const F=c===0,w=f.minScale===0||c<=f.minScale,g=f.maxScale===0||c>=f.maxScale;if(f.visible&&(F||w&&g))if(f.sublayers)f.sublayers.forEach(x);else{if(n?.includes(f.id)===!1||l&&(!f.popupTemplate||!f.popupEnabled))return;m.unshift(f)}};if(r?.forEach(x),r&&!m.length)y.layerIds=[];else{const f=Oe(m,u,d),F=m.map(w=>{const g=N(i,w);return w.toExportImageJSON(g)});if(f)y.dynamicLayers=JSON.stringify(F);else{if(r){let g=m.map(({id:b})=>b);n&&(g=g.filter(b=>n.includes(b))),y.layerIds=g}else n?.length&&(y.layerIds=n);const w=Ie(i,m);if(w!=null&&w.length){const g={};for(const b of w)b.definitionExpression&&(g[b.id]=b.definitionExpression);Object.keys(g).length&&(y.layerDefs=JSON.stringify(g))}}}return y}function Ie(t,e){const i=!!t?.length,o=e.filter(r=>r.definitionExpression!=null||i&&r.floorInfo!=null);return o.length?o.map(r=>{const n=N(t,r),s=z(n,r.definitionExpression);return{id:r.id,definitionExpression:s??void 0}}):null}var P;let h=P=class extends B{static from(t){return re(P,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};a([p({type:Number,json:{write:!0}})],h.prototype,"dpi",void 0),a([p()],h.prototype,"floors",void 0),a([p({type:String,json:{write:!0}})],h.prototype,"gdbVersion",void 0),a([p({types:X,json:{read:Y,write:!0}})],h.prototype,"geometry",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"geometryPrecision",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"height",void 0),a([p({type:Date})],h.prototype,"historicMoment",void 0),a([U("historicMoment")],h.prototype,"writeHistoricMoment",null),a([p({type:[Number],json:{write:!0}})],h.prototype,"layerIds",void 0),a([p({type:["top","visible","all","popup"],json:{write:!0}})],h.prototype,"layerOption",void 0),a([p({type:J,json:{write:!0}})],h.prototype,"mapExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"maxAllowableOffset",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnFieldName",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnGeometry",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnM",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnUnformattedValues",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnZ",void 0),a([p({type:ee,json:{write:!0}})],h.prototype,"spatialReference",void 0),a([p()],h.prototype,"sublayers",void 0),a([p({type:je,json:{write:!0}})],h.prototype,"timeExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"tolerance",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"width",void 0),h=P=a([I("esri.rest.support.IdentifyParameters")],h);const D=h;let S=class extends B{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return Q.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:i,geometry:o}=t;i&&(e.attributes={...i}),o!=null&&(e.geometry=o.toJSON(),e.geometryType=ie.toJSON(o.type))}};a([p({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),a([p({type:Q})],S.prototype,"feature",void 0),a([te("feature",["attributes","geometry"])],S.prototype,"readFeature",null),a([U("feature")],S.prototype,"writeFeature",null),a([p({type:Number,json:{write:!0}})],S.prototype,"layerId",void 0),a([p({type:String,json:{write:!0}})],S.prototype,"layerName",void 0),S=a([I("esri.rest.support.IdentifyResult")],S);const Ne=S;async function Ve(t,e,i){const o=(e=Ae(e)).geometry?[e.geometry]:[],r=xe(t);return r.path+="/identify",ve(o).then(n=>{const s=_e(e,{geometry:n?.[0]}),d=Se({...r.query,f:"json",...s}),u=Fe(d,i);return de(r.path,u).then(Ge).then(l=>Te(l,e.sublayers))})}function Ge(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(i=>Ne.fromJSON(i)),e}function Ae(t){return t=D.from(t)}function Te(t,e){if(!e?.length)return t;const i=new Map;function o(r){i.set(r.id,r),r.sublayers&&r.sublayers.forEach(o)}e.forEach(o);for(const r of t.results)r.feature.sourceLayer=i.get(r.layerId);return t}const H=k();let _=null;function Ke(t,e){return e.type==="tile"||e.type==="map-image"}let O=class extends se{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=oe(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ne(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeaturesAtLocation(t,e){const{layerView:{layer:i,view:{scale:o}}}=this;if(!t)throw new A("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:i});const r=Me(i.sublayers,o,e);if(!r.length)return[];const n=await $e(i,r);if(!((i.capabilities?.operations?.supportsIdentify??!0)&&i.version>=10.5)&&!n)throw new A("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:i});return n?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(t){const e=this.highlightGraphics;if(!t||!e)return H;let i=ge(t)?[t]:ae.isCollection(t)?t.toArray():Array.isArray(t)?t:[];if(i=i?.filter(T),(i?.length??0)===0)return H;for(const o of i){const{sourceLayer:r}=o;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(o.visible=!1)}return e.addMany(i),k(()=>e.removeMany(i??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:i,highlightGraphicUpdated:o}=this;if(i&&o)for(const r of t){const n=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&n&&"getSymbolAsync"in n&&n.getSymbolAsync(r).then(async s=>{s||=new M;let d=null;const u="visualVariables"in n?n.visualVariables?.find(l=>l.type==="size"):void 0;u&&(_||(_=(await le(async()=>{const{getSize:l}=await import("./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js");return{getSize:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).getSize),d=_(u,r,{view:e.type,scale:e.scale,shape:s.type==="simple-marker"?s.style:null})),d||="width"in s&&"height"in s&&s.width!=null&&s.height!=null?Math.max(s.width,s.height):"size"in s?s.size:16,i.includes(r)&&(r.symbol=new M({style:"square",size:d,xoffset:"xoffset"in s?s.xoffset:0,yoffset:"yoffset"in s?s.yoffset:0}),o(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:i},highlightGraphics:o,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!o?.length||!e.capabilities.operations.supportsQuery)return;const n=this._getTargetResolution(t),s=new Map;for(const l of o)if(!this._featuresResolutions.has(l)||this._featuresResolutions.get(l)>n){const y=l.sourceLayer;pe(s,y,()=>new Map).set(l.getObjectId(),l)}const d=Array.from(s,([l,y])=>{const c=l.createQuery();return c.objectIds=[...y.keys()],c.outFields=[l.objectIdField],c.returnGeometry=!0,c.maxAllowableOffset=n,c.outSpatialReference=i.spatialReference,l.queryFeatures(c)}),u=await Promise.all(d);if(!this.destroyed)for(const{features:l}of u)for(const y of l){const c=y.sourceLayer,m=s.get(c).get(y.getObjectId());m&&o.includes(m)&&(m.geometry=y.geometry,r(m,"geometry"),this._featuresResolutions.set(m,n))}}_getTargetResolution(t){const e=t*ue(this.layerView.view.spatialReference),i=e/16;return i<=10?0:t/e*i}async _fetchPopupFeaturesUsingIdentify(t,e,i){const o=await this._createIdentifyParameters(t,e,i);if(o==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,o,i);return r.map(n=>n.feature)}async _createIdentifyParameters(t,e,i){const{floors:o,layer:r,timeExtent:n,view:{spatialReference:s,scale:d}}=this.layerView;if(!e.length)return null;await Promise.all(e.map(({sublayer:x})=>x.load(i).catch(()=>{})));const u=Math.min(ye("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((x,f)=>f.renderer?$({renderer:f.renderer,pointerType:i?.pointerType}):x,2)),l=this.createFetchPopupFeaturesQueryGeometry(t,u),y=we(d,s),c=Math.round(l.width/y),m=new J({xmin:l.center.x-y*c,ymin:l.center.y-y*c,xmax:l.center.x+y*c,ymax:l.center.y+y*c,spatialReference:l.spatialReference});return new D({floors:o,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:c,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:s,sublayers:r.sublayers,timeExtent:n,tolerance:u,width:c})}async _fetchPopupFeaturesUsingQueries(t,e,i){const{layerView:{floors:o,timeExtent:r}}=this,n=e.map(async({sublayer:s,popupTemplate:d})=>{if(await s.load(i).catch(()=>{}),s.capabilities&&!s.capabilities.operations.supportsQuery)return[];const u=s.createQuery(),l=$({renderer:s.renderer,pointerType:i?.pointerType}),y=this.createFetchPopupFeaturesQueryGeometry(t,l),c=new Set,[m]=await Promise.all([Ee(s,d),s.renderer?.collectRequiredFields(c,s.fieldsIndex)]);L(i),ce(c,s.fieldsIndex,m);const x=Array.from(c).sort();u.geometry=y,u.outFields=x,u.timeExtent=r;const f=N(o,s);u.where=z(u.where,f);const F=this._getTargetResolution(y.width/l),w=await Le(d);L(i);const g=s.geometryType==="point"||w&&w.arcadeUtils.hasGeometryOperations(d);g||(u.maxAllowableOffset=F);let{features:b}=await s.queryFeatures(u,i);const j=g?0:F;b=await He(s,b,i);for(const E of b)this._featuresResolutions.set(E,j);return b});return(await Promise.allSettled(n)).reduce((s,d)=>d.status==="fulfilled"?[...s,...d.value]:s,[]).filter(T)}};function Me(t,e,i){const o=[];if(!t)return o;const r=n=>{const s=n.minScale===0||e<=n.minScale,d=n.maxScale===0||e>=n.maxScale;if(n.visible&&s&&d){if(n.sublayers)n.sublayers.forEach(r);else if(n.popupEnabled){const u=Re(n,{...i,defaultPopupTemplateEnabled:!1});u!=null&&o.unshift({sublayer:n,popupTemplate:u})}}};return t.map(r),o}function Le(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(e=>e.type==="expression")?he():Promise.resolve()}async function $e(t,e){if(t.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:i})=>i.load().then(()=>i.capabilities.operations.supportsQuery)))}catch{return!1}}async function He(t,e,i){const o=t.renderer;return o&&"defaultSymbol"in o&&!o.defaultSymbol&&(e=o.valueExpression?await Promise.all(e.map(r=>o.getSymbolAsync(r,i).then(n=>n?r:null))).then(r=>r.filter(n=>n!=null)):e.filter(r=>o.getSymbol(r)!=null)),e}a([p({constructOnly:!0})],O.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),a([p({constructOnly:!0})],O.prototype,"layerView",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphics",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphicUpdated",void 0),a([p({constructOnly:!0})],O.prototype,"updatingHandles",void 0),O=a([I("esri.views.layers.support.MapServiceLayerViewHelper")],O);export{O,Ke as _}; diff --git a/main/assets/MapView-BGOJJ8ch-CG2YDFKt.js b/main/assets/MapView-BGOJJ8ch-CG2YDFKt.js new file mode 100644 index 000000000..6340ad9ee --- /dev/null +++ b/main/assets/MapView-BGOJJ8ch-CG2YDFKt.js @@ -0,0 +1,14 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Popup-DFFZHG5j-CtqoPK1b.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./substitute-j49H6mVR-BNTkzCQd.js","./themeUtils-YjM7iIiX-J3djxNmP.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./ReactiveSet-QxEZenFW-B_-rGoLX.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./Cyclical-C_9rKUUQ-DaQlxz0D.js","./AttachmentInfo-D9RFO8W2-BdVN-3Ab.js","./RelationshipQuery-DJsz3K0U-BHNd_b19.js","./Query-BrwMGK8U-DV_czrJX.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./utils-DyydRFHu-DkAWn-U5.js","./Basemap-BEqqSTw9-COwFtp-h.js","./loadAll-e978YItg-NjG3VBGi.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./writeUtils-D5qlLkwk-IaioN2Q8.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./common-CYWrYyJl-E8-sukrT.js","./RendererLegendOptions-K3md58-X-Bf90N-cx.js","./utils-DPtQ14k3-BW98GOs_.js","./parser-DyDJ-rlI-CV6nO3M9.js","./cimSymbolUtils-CKIzBgMU-D2oNADot.js","./utils-SPbpQbmm-Dl9Ps2XQ.js","./enums-CpSG_SL3-BMD3Tb1v.js","./LRUCache-C3erQTWv-DhyPlt5p.js","./jsonUtils-C64Zfu7c-BqaK54UK.js","./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js","./diffUtils-Cz3Fi8Xb-BvD0JNhD.js","./colorRamps-q0bZVhs2-DeDskCk_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-5umqHW84.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./styleUtils-BtpNqZyT-CwQxANzG.js","./Version-CoKzbupV-BKAqCewj.js","./FieldsIndex-HmzMbJQG-CzzKuIHi.js","./UnknownTimeZone-C--TOcPG-DfRfNtw8.js","./OverrideHelper-DWRbVlj1-D6dDt4cu.js","./colorUtils-Cthpxcks-CXgjba3p.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./quantizationUtils-bJy1cRwp-1xSDkBxg.js","./heatmapUtils-seiMkkkR-BSMLb7yQ.js","./executeQueryJSON-CcHnccia-CB1D7q08.js","./utils-9sQxfkoa-Bn_d9vXA.js","./query-DFW9-NG_-CfusC8cS.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js","./pbf-D-y3_eZO-SEvl9j6c.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./FeatureSet-BkVNthuN-DDwR53LR.js","./shared-D1w-26bA-CNuAEz8h.js","./TimeOnly-DSMefxKy-C21ZkqlE.js","./FeatureLayer-BrRKw5Si-Rem12G_g.js","./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js","./commonProperties-BtIqvFU_-DuUske_0.js","./ElevationInfo-yv2-9tj6-CpVy5FM0.js","./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js","./HeightModelInfo-C5vFqzyF-DTZiz4z_.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./featureLayerUtils-DgfQQyK4-D0OGSvJx.js","./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js","./Relationship-PyhUibYK-DuMEI2S9.js","./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js","./Layer-ChoECxvZ--vVxyMLZ.js","./workers-PiCjreoO-DqI62TYf.js","./editsZScale-BDsX6vv--CoeIQyxn.js","./APIKeyMixin-BUMSx9ny-AE1ffoPb.js","./ArcGISService-BYA-y6X6-BtWUPppI.js","./BlendLayer-D1WkSmwP-D_mOfOGH.js","./jsonUtils-wIllKWI4-DRJhEzZa.js","./CustomParametersMixin-vdKsTHer-DndyRc71.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js","./FeatureEffect-CDEk9Es7-CW8HxX_m.js","./FeatureFilter-BCFHgLVU-DU6FY8I7.js","./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js","./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js","./labelingInfo-DGVNul26-ReCWpi39.js","./labelUtils-BW14kBqX-Cu1LInU4.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-B5IUcPZ-.js","./OrderedLayer-6Qsmrd_l-sp1TyHmN.js","./OrderByInfo-GD2XnU8e-CsM0tB0E.js","./PortalLayer-CElnYuSQ-BV63HHSL.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js","./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js","./TemporalLayer-CpOrN_w9-D1I2RE1l.js","./TimeInfo-w_HB2CsF-Ce-xYAJs.js","./FeatureTemplate-SPHPD45f-DdZuptIc.js","./FeatureType-C9hJmS6_-5PPiaaCJ.js","./fieldProperties-Bq26w7gt-DgCDIFFS.js","./versionUtils-LZYZz-38-DgmFurh2.js","./styleUtils-ChrJTYIw-OCRItq_6.js","./popupUtils-B0uZcXX0-B9v3xvNZ.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./ReactiveMap-CFk6jPfN-CM49HI11.js","./Tile-D75RMC64-CM0vKD9b.js","./TileKey-C5IL-JBr-COMthbrT.js","./vec2-tHZ6OaOy-xCj1obDt.js","./QueueProcessor-DbfV9fLy-DobN0ur5.js","./signal-CETehA7D-DxK1orqE.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./layerViewUtils-DURAPenP-Eay0s_jy.js","./CollectionFlattener-DkHuHn5E-BN4WFIND.js","./TileInfo-CWIRDhZl-CwJ-BCrJ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js","./Map-1zd11DKO-Bvo5kMfb.js","./TablesMixin-C8RojhYs-CMxVrapj.js","./GraphicsCollection-CWTXNZOX-BB4NQ39c.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-BziCzZ_c.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-CtQVMDnp.js","./imageUtils-BA2D6Uf1-DyozB2y5.js","./capabilities-agoTWNzb-CtsNgRyk.js","./ColorBackground-gVZldRLm-BdWj-dur.js","./geometryServiceUtils-nsujb7BH-BZ1M-sZ1.js","./project-DQKhruav-BEFloNIO.js","./webglDeps-Bgavuh0h-8J_tuBZH.js","./BufferObject-BM_7mcDb-CTo2uuE5.js","./Program-DLVwTiPA-CHQtoRqS.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./ProgramTemplate-DQOm6Omy-XULB1YWq.js","./VertexArrayObject-M4iRGGoi-DLhbl4qv.js","./mapViewDeps-CUVU8gUp-CEta8iLu.js","./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js","./BidiEngine-Bdqv5H5j-Dyqh9XG-.js","./GeometryUtils-NHgB9gGQ-B3_wQtO7.js","./Rect-DD6XS68q-D_hsV3ag.js","./LabelMetric-BeluzH3o-CQPyji82.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./BindType-9iOk18Ed-CRW1cdX4.js","./Util-BjGjeg6f-08Szkf4F.js","./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js","./constants-Bqe1QJ4u-F8oTIn7N.js","./WGLContainer-LxgEo4I_-BLj3WxOd.js","./vec3f32-BS0cezmI-B_madU1n.js","./Container-BcuL1ZEG-DU-CDj3E.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./config-nuMERBvb-MDUrh2eL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./featureConversionUtils-D6hFQ4Af-sYSorBK9.js","./SDFHelper-B6k8Ig6R-C81pIMYz.js","./floatRGBA-4pIJN00G-ClP9XgP7.js","./PieChartMeshWriter-C5yLDFwp-0zzyhiO2.js","./TurboLine-CIlsAy5m-Q2LH92mI.js","./enums-qHpGJ28Q-CmnLAccm.js","./GridShader-75bC4UUM-Btv2jyXK.js","./CircularArray-DaQg3PQl-BXS52LZy.js","./testSVGPremultipliedAlpha-DoZe_f0d-n0h7HuaO.js","./AttributeStore-DjyP9U7y-Du97X0SU.js","./timeSupport-jPViR5jn-BnQYlj-C.js","./queryUtils-Brxu6254-T3UhaATW.js","./json-BI97KiBB-Ce5cWfI2.js","./RenderingContext-DbCVbtGZ-C1oa6nV0.js","./renderState-Dap0WV9P-D4IHxyei.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./rasterizingUtils-BmlDdKBf-KXJpDIVD.js","./utils-Dcs650Ic-CVi_9hJ-.js","./grouping-RwmXkHDc-Cfuv9DrK.js","./MeshWriterRegistry-CIC9Yk_f-I3l8mR_m.js","./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js","./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js","./GraphicContainer-DuOHUciE-dHT2kH0f.js","./AGraphicContainer-LUCT6Gle-DajlweKQ.js","./TechniqueInstance-DGTKoOL6-C7NzYd8c.js","./TileContainer-D48pXXgL-DSah9A2g.js","./requestImageUtils-Ut4YcoNU-BcLxhYtL.js","./scaleUtils-DxsfQwK1-B4OFXqEO.js","./geodesicUtils-B8mFUfTk-BoXyQMna.js","./TileLayerView2D-CT-Yu10P-D652aaoE.js","./imageUtils-Co-ELErj-Cnx9scTS.js","./Bitmap-CcqmzvfR-C92VuEM3.js","./LayerView-Bish-E63-I2LV0oDm.js","./HighlightGraphicContainer-Dt5r6lMq-BNbDeHiI.js","./RefreshableLayerView-BdQpGYly-DhXYwWWM.js","./MapServiceLayerViewHelper-bw3M4B8s-B5cli8RL.js","./languageUtils-BYxF9hRA-BLoYMqdU.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./number-eRKYXfX9-C213qXfW.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./drapedUtils-BZ1SGPtE-BPt00fGU.js","./sublayerUtils-CyM0QC5B-BQ17aSXL.js","./popupUtils-nV1O8RUO-X6GWMgRY.js","./FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js","./timeSupport-ohWmWReZ-Ca1Xy2Rx.js","./HighlightCounter-DFWq7PnG-L3ompOf4.js","./BaseDynamicLayerView2D-AQ-6l0DU-BgLvSwS3.js","./BitmapContainer-BC8fvmFc-CH1ryNve.js","./ExportStrategy-BNE7Gp0u-CdeT3qVb.js","./CatalogLayerView2D-DaUVeBuS-DL2YF1D2.js","./CatalogDynamicGroupLayerView2D-Cf-H7gda-IDF2ytK8.js","./CatalogFootprintLayerView2D-C0bBWVdF-B8ZCfrrR.js","./GeoRSSLayerView2D-BLTYupUX-C7pkROGe.js","./GraphicsLayerView2D-CGXlTqHO--x-cniL0.js","./GroupLayerView2D-BR-kLeLa-BPkZIp1k.js","./ImageryLayerView2D-CVDvTIGY-C8PDlzd1.js","./RasterVFDisplayObject-CnriTVT9-7AFXrs58.js","./dataUtils-BkPy4R3C-D8T8_whC.js","./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js","./ImageryTileLayerView2D-nEz2YhMc-BvGHSsMi.js","./multidimensionalUtils-BwTugeu7-LevYq4ep.js","./rasterUtils-DqAu9qES-DpmWvz0K.js","./RawBlockCache-Cj_tmHDm-CYD33Wpe.js","./KMLLayerView2D-hWgNYT5J-G6dB1WHu.js","./kmlUtils-C5oIEoOy-CbWoF4Dn.js","./KnowledgeGraphLayerView2D-BnEbgXue-DTGORV5F.js","./MapImageLayerView2D-LI7T-1xm-C9rclF9a.js","./ExportImageParameters-DxyNGQ57-pIUsifIT.js","./MapNotesLayerView2D-EusnP8A_-CDAqHlRM.js","./MediaLayerView2D-COWFkA3m-u82xL1PC.js","./perspectiveUtils-Bu88xlbg-DmCqcrzQ.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./OverlayContainer-BEHcBpu0-Bl-u4lo3.js","./OGCFeatureLayerView2D-CpSy5D2s-BVehOQQd.js","./RouteLayerView2D-Bpui7Ggx-CzB7Q2o2.js","./Stop-he5xSAJJ-2gQ-bcQc.js","./StreamLayerView2D-Bh_aEalU-BnZnyCg1.js","./SubtypeGroupLayerView2D-Byn0xzbb-BzLYGxjv.js","./VectorTileLayerView2D-B9OYHbL4-CP_gGifv.js","./PooledRBush-DbfAmeLn-dj1fSLWj.js","./SourceLayerData-BT_Ywuvg-BFtXgEqx.js","./StyleRepository-D3WuVprR-DfGaR0vd.js","./VideoLayerView2D-CLcxq4ZA-DOxIETBk.js","./GraphicsLayer-DfeGaYc1-DAZy-iUY.js","./TelemetryDisplay-Bq2PXfI8-8bnvuClQ.js","./WMSLayerView2D-Dz-z-fa9-DQ4tDf76.js","./ExportWMSImageParameters-CMk80WSM-CQGcVQcn.js","./WMTSLayerView2D-Bl5FUDUu-aU1GfclG.js","./calcite-button-Cm9_TJei-CW2FD2Xf.js","./form-CRSw616T-2CDQhr1H.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-D_Gwwuwg.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-YgUDHAtn.js","./locale-Cn_GDVD_-DrOI-_a9.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-Du14S4xc.js","./t9n-C_hcZMZJ-CZmw6XOE.js","./icon-BXFbBbop-Du8Zws1L.js","./loader-Ch7Jr16w-BlGvYEIO.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-CcSx2g4c.js"])))=>i.map(i=>d[i]); +import{v as r,S as l,i as _,aa as js,e as cn,w as V,ab as bt,ac as ka,a0 as Ea,ad as Bt,ae as ke,af as Ca,g as Vn,K as z,I as hi,ag as L,ah as w,ai as ci,aj as Ia,ak as Ft,al as st,am as Da,an as Ra,ao as On,ap as La,aq as ni,j as M,ar as Pt,as as H,C as Va,at as Oa,au as qs,av as Ee,o as C,aw as pn,ax as ct,ay as dn,az as Aa,a1 as D,aA as tt,aB as An,aC as pi,aD as za,aE as Na,aF as Ce,n as Xt,J as si,aG as Bs,aH as un,aI as mn,aJ as Ks,p as Ys,aK as Fa,h as Ha,aL as U,aM as Za,a2 as di,aN as it,l as Xs,aO as Ga,aP as $a,b as ui,aQ as Wa,aR as bi,aS as Qs,aT as Ua,aU as Js,B as ja,aV as Re,aW as ji,x as qa,aX as Ba,t as to,aY as eo,aZ as de,$ as Ot,a_ as Ka,a$ as Ya,b0 as zn,b1 as Xa,b2 as Qa,b3 as Ja,b4 as tr,b5 as Nn,b6 as er,b7 as ir,b8 as nr,O as sr,_ as b,b9 as Fn,ba as ze,L as or,bb as ar,bc as rr,bd as Hn,be as lr,bf as hr,E as Ti,bg as cr,d as io,bh as Ne,bi as pr,bj as gn,bk as dr,bl as Fe,bm as ur,bn as X}from"./main-C7yV2j71.js";import{c as mr}from"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import{f as no}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import{F as gr,B as Zn}from"./workers-PiCjreoO-DqI62TYf.js";import{K as Le,B as yr,_ as yn,J as _n,W as fn}from"./projection-BA9M1R7d-DXrPfsKU.js";import{d as _r,V as fr}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{z as vr,H as wr,_ as mi,o as Gn,K as so,q as br,R as gi,P as B,k as vn,X as Tr,V as $n}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{i as yi}from"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import{o as Mr}from"./signal-CETehA7D-DxK1orqE.js";import xr from"./Map-1zd11DKO-Bvo5kMfb.js";import{o as oo,u as Wn,s as Pr}from"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import{M as wn}from"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import{k as Sr}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{v as Mi}from"./TablesMixin-C8RojhYs-CMxVrapj.js";import{h as kr}from"./ReactiveMap-CFk6jPfN-CM49HI11.js";import{b as Un}from"./Query-BrwMGK8U-DV_czrJX.js";import{i as Er}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{l as jn}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{o as O,e as Cr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as N,v as _i,T as ao,i as qi,j as qn,A as Ir,S as Dr,h as Bn,b as Rr,L as Tt,d as Se,f as Lr,_ as Vr}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{r as ro,n as xi}from"./common-CYWrYyJl-E8-sukrT.js";import{s as Or,t as lo,Q as Ar,U as ho,l as zr,n as co,e as bn,i as oi,V as Nr,Z as Kn,k as Fr,o as Hr}from"./Tile-D75RMC64-CM0vKD9b.js";import{c as Tn,a as Zr}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{Q as Gr,R as $r,C as Yn,D as Wr,E as Ur}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Xn}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{r as jr,F as qr}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{W as Br,u as Pi}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import{s as Kr}from"./TileKey-C5IL-JBr-COMthbrT.js";import{L as Yr}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{e as He,u as Xr,i as Qr,t as Qn}from"./definitions-DJSdSb77-DkoRHaVx.js";import{L as Jr,D as Si,G as tl}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as el,V as il}from"./Texture-BCt2hphT-CtQVMDnp.js";import{y as nl}from"./imageUtils-BA2D6Uf1-DyozB2y5.js";import{n as sl}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{m as ol}from"./Version-CoKzbupV-BKAqCewj.js";import al from"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";let Ht=class extends $a{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return t!=null&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"row",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"column",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"rows",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"columns",void 0),Ht=r([_("esri.CameraLayout")],Ht);const po=Ht;let at=class extends js(cn){constructor(...t){super(...t),this.position=new V([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new po}normalizeCtorArgs(t,e,i,n){if(t&&typeof t=="object"&&("x"in t||Array.isArray(t))){const s={position:t};return e!=null&&(s.heading=e),i!=null&&(s.tilt=i),n!=null&&(s.fov=n),s}return t}writePosition(t,e,i,n){const s=t.clone();s.x=bt(t.x||0),s.y=bt(t.y||0),s.z=t.hasZ?bt(t.z||0):t.z,e[i]=s.write({},n)}readPosition(t,e){const i=new V;return i.read(t,e),i.x=bt(i.x||0),i.y=bt(i.y||0),i.z=i.hasZ?bt(i.z||0):i.z,i}equals(t){return t!=null&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};r([l({type:V,json:{write:{isRequired:!0}}})],at.prototype,"position",void 0),r([ka("position")],at.prototype,"writePosition",null),r([Ea("position")],at.prototype,"readPosition",null),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>mr.normalize(bt(t)))],at.prototype,"heading",void 0),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>ke(bt(t),-180,180))],at.prototype,"tilt",void 0),r([l({type:Number,nonNullable:!0,json:{default:55,write:!0}}),Bt(t=>ke(bt(t,55),1,170))],at.prototype,"fov",void 0),r([l({type:po,nonNullable:!0,json:{read:!1,write:!1}})],at.prototype,"layout",void 0),at=r([_("esri.Camera")],at);const rl=at;var Bi;let Et=Bi=class extends cn{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new Bi({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"rotation",void 0),r([Bt("rotation")],Et.prototype,"castRotation",null),r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"scale",void 0),r([l({types:Ca,json:{read:Vn,write:!0,origins:{"web-scene":{read:Vn,write:{overridePolicy:ki}}}}})],Et.prototype,"targetGeometry",void 0),r([l({type:rl,json:{write:!0}})],Et.prototype,"camera",void 0),Et=Bi=r([_("esri.Viewpoint")],Et);const nt=Et;function ki(){return{enabled:!this.camera}}const Be={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(t){const e=t.viewSize[1],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(t){const e=t.viewSize,i=e[0],n=e[1],s=this.values;return n>=i?s.portrait:s.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Ei={xsmall:544,small:768,medium:992,large:1200};function ll(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Ei}initialize(){this.addHandles(w(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),U))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i!==this._get("breakpoints")){if(!ll(i)){const n=JSON.stringify(Ei,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n),i=Ei}this._set("breakpoints",{...i})}}_updateClassNames(){if(!this.container)return;const i=ze.acquire(),n=ze.acquire();let s,o=!1;for(s in Be){const a=this[s],h=Be[s].getValue({viewSize:this.size,breakpoints:this.breakpoints});a!==h&&(o=!0,this[s]=h,Ci(s,a).forEach(c=>n.push(c)),Ci(s,h).forEach(c=>i.push(c)))}o&&(this._applyClassNameChanges(i,n),ze.release(i),ze.release(n))}_applyClassNameChanges(i,n){const s=this.container;s&&(n.forEach(o=>s.classList.remove(o)),i.forEach(o=>s.classList.add(o)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let n;for(n in Be)Ci(n,this[n]).forEach(s=>i.classList.remove(s))}};return r([l()],e.prototype,"breakpoints",null),r([l()],e.prototype,"orientation",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),r([l()],e.prototype,"heightBreakpoint",void 0),e=r([_("esri.views.BreakpointsOwner")],e),e};let Ct=class extends M{constructor(){super(...arguments),this.items=new L,this._watchUpdatingTracking=new yi,this._callbacks=new Map,this._projector=Gn(),this._hiddenProjector=Gn()}get needsRender(){return this.items.length>0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,e=>{for(const i of e.added){const n=()=>i.render();this._callbacks.set(i,n),this._projector.append(this.surface,n)}for(const i of e.removed){const n=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(n.domNode),this._callbacks.delete(i)}})}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach(t=>this._projector.detach(t)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,i=this._hiddenProjector;let n;const s=()=>(n=t.render(),n);i.append(e,s),i.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n?.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(i.detach(s);e.firstChild;)e.removeChild(e.firstChild);return o}overlaps(t,e){const i=this.computeBoundingRect(t),n=this.computeBoundingRect(e);return Math.max(i.left,n.left)<=Math.min(i.right,n.right)&&Math.max(i.top,n.top)<=Math.min(i.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(t=>t.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(t,e){const i=!!e?.disableDecorations;if(!this.items.some(s=>s.visible&&!(i&&s.isDecoration)))return;const n=t.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{i&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};r([l({readOnly:!0})],Ct.prototype,"surface",void 0),r([l({readOnly:!0})],Ct.prototype,"items",void 0),r([l({readOnly:!0})],Ct.prototype,"needsRender",null),r([l({readOnly:!0})],Ct.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],Ct.prototype,"updating",null),Ct=r([_("esri.views.overlay.ViewOverlay")],Ct);const Jn=Ct,Ii=[0,0];function cl(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return Ii[0]=i.left+(e?.pageXOffset??0),Ii[1]=i.top+(e?.pageYOffset??0),Ii}function ts(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}function pl(t){const e=document.createElement("div");return t.appendChild(e),e}const me=16,Ze=750,dl=512,ul=2,ml=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:me,time:Ze},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([w(()=>this.cursor,n=>{const{surface:s}=this;s&&s.setAttribute("data-cursor",n)}),w(()=>this.navigating,n=>{const{surface:s}=this;s&&s.setAttribute("data-navigating",n.toString())})])}initialize(){this.addHandles([w(()=>this.ui,(i,n)=>this._handleUIChange(i,n),U),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=tt(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const n=this._get("container"),s=so(i);if(s||typeof i!="string"||D.getLogger(this).error("#container",`element with id '${i}' not found`),n===s)return;if(this._stopMeasuring(),n&&(n.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(ts(this.root),this._set("root",null)),this.userContent&&($n(this.userContent,n),ts(this.userContent),this._set("userContent",null))),!s)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);s.classList.add("esri-view");const o=document.createElement("div");o.className="esri-view-user-storage",$n(s,o),s.appendChild(o),this._set("userContent",o);const a=document.createElement("div");a.className="esri-view-root",s.insertBefore(a,s.firstChild),this._set("root",a);const h=document.createElement("div");h.className="esri-view-surface",h.setAttribute("role","application"),h.tabIndex=0,a.appendChild(h),this._set("surface",h);const c=new Jn;a.appendChild(c.surface),this._set("overlay",c),this.addHandles(w(()=>c.needsRender,p=>{p&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=de({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=st(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",s),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(i,n,s){const o=this.position;return i-=o?o[0]:0,n-=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}containerToPage(i,n,s){const o=this.position;return i+=o?o[0]:0,n+=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}_handleUIChange(i,n){this.removeHandles("ui"),n&&n!==i&&n.destroy(),i&&(i.view=this,this.addHandles(w(()=>this.root,s=>{i.container=s?pl(s):null},U),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=me,i.time=Ze,this.addHandles([or(window,"resize",()=>{i.freq=me,i.time=Ze}),de({prepare:n=>{const s=this._measure(),o=this._freqInfo;if(o.time+=n.deltaTime,s&&(o.freq=me,this._get("resizing")||this._set("resizing",!0)),o.time=dl&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,n=i?i.clientWidth:0,s=i?i.clientHeight:0;if(n===0||s===0)return this.suspended||this._set("suspended",!0),!1;const o=this.width,a=this.height;return n===o&&s===a?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",n),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:o,oldHeight:a,width:n,height:s}),!0)}_position(){const i=this.container,n=this.position,s=i&&cl(i);return!!s&&(!n||s[0]!==n[0]||s[1]!==n[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return r([l()],e.prototype,"container",null),r([l({readOnly:!0})],e.prototype,"focused",null),r([l({readOnly:!0})],e.prototype,"height",void 0),r([l()],e.prototype,"messagesCommon",void 0),r([l({type:Jn})],e.prototype,"overlay",void 0),r([l({readOnly:!0})],e.prototype,"position",void 0),r([l({readOnly:!0})],e.prototype,"resizing",void 0),r([l({readOnly:!0})],e.prototype,"root",void 0),r([l({value:null,readOnly:!0})],e.prototype,"size",null),r([l({readOnly:!0})],e.prototype,"surface",void 0),r([l({readOnly:!0})],e.prototype,"suspended",void 0),r([l()],e.prototype,"ui",void 0),r([l({readOnly:!0})],e.prototype,"userContent",void 0),r([l({readOnly:!0})],e.prototype,"width",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),e=r([_("esri.views.DOMContainer")],e),e},gl=z("mac")?"Meta":"Control",yl=new Set(["Alt","Control","Meta","Shift","Ctrl","Primary"]),_l=t=>yl.has(t);let fl=class{constructor(t,e=[]){this.eventType=t,this.keyModifiers=e}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const e=t.modifiers;for(const i of this.keyModifiers)if(!e.has(i))return!1;return!0}},A=class{constructor(t){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=t}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const t in this._incoming){const e=this._incoming[t];for(const i of e)this._incomingEventMatches.push(i.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(t=>t.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(t){this._manager||(t.setEventCallback(e=>this._handleEvent(e)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,e,i){let n;typeof e=="function"?(i=e,n=[]):n=e||[];const s=typeof t=="string"?new fl(t,n):t,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=p=>{const d=this._incoming[p.match.eventType];if(d){const m=d.indexOf(p);d.splice(m,1),o(),this._manager&&this._manager.updateDependencies()}},h=new vl(s,i,{onPause:a,onRemove:a,onResume:p=>{const d=this._incoming[p.match.eventType];d&&!d.includes(p)&&(d.push(p),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.push(h),o(),this._manager&&this._manager.updateDependencies(),h}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const e=new wl(t,{onEmit:(i,n,s,o)=>{this._manager?.emit(i.eventType,n,s,o)},onRemove:i=>{delete this._outgoing[i.eventType],this._manager?.updateDependencies()}});return this._outgoing[t]=e,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),e}startCapturingPointer(t){this._manager?.setPointerCapture(t,!0)}stopCapturingPointer(t){this._manager?.setPointerCapture(t,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager&&(this.onUninstall(),this._manager=null)}_handleEvent(t){const e=this._incoming[t.type];if(e){for(const i of e)if(i.match.matches(t)&&(i.callback?.(t),t.shouldStopPropagation()))break}}},vl=class{constructor(t,e,i){this.match=t,this._callback=e,this._handler=i}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},wl=class{constructor(t,e){this.eventType=t,this._removed=!1,this._handler=e}emit(t,e,i){this._removed||this._handler.onEmit(this,t,e,i)}remove(){this._removed=!0,this._handler.onRemove(this)}},bl=class extends A{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",e=>this._update(e.data))}_update(t){const e=t.native.pointerType==="touch"?"touch":"mouse",{x:i,y:n}=t;e===this._value&&this._x===i&&this._y===n||(this._value=e,this._x=i,this._y=n,this._onChange(e,i,n))}},Tl=class extends A{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=Mr(!1),this._onPointerAdd=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Ml=class{constructor(t,e){this._owner=e,this._properties={},this._afterDispatchHandle=null;for(const i in t){const n=t[i],s=new ar(n,void 0,void 0,2,2);this._properties[i]={pool:s,acquired:[]}}this._afterDispatchHandle=rr(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const e=this._properties[t];for(const i of e.acquired)Hn(i)||e.pool.release(i);e.pool.destroy(),e.pool=null,e.acquired=null}this._properties=null,this._owner=null}get(t){const e=this._owner._get(t),i=this._properties[t];let n=i.pool.acquire();for(i.acquired.push(n);n===e;)i.acquired.push(n),n=i.pool.acquire();return n}_release(){for(const t in this._properties){const e=this._properties[t];let i=0;for(const n of e.acquired)Hn(n)?e.acquired[i++]=n:e.pool.release(n);e.acquired.length=i}}},Q=class extends M{constructor(t){super(t),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=gl,this._latestPointerType="mouse",this._propertiesPool=new Ml({latestPointerLocation:Sl},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const t=Object.keys(this._nameToGroup);for(const e of t)this.uninstallHandlers(e);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(t=>t.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(t,e,i=At.INTERNAL){if(this._nameToGroup[t]||e.length===0)return;const n={name:t,handlers:e.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[t]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,h,c,p,d)=>{this._emitInputEvent(o.priorityIndex+1,a,h,c,d,p)},setPointerCapture:(a,h)=>{this._setPointerCapture(n,o,a,h)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(t){const e=this._nameToGroup[t];e?(e.handlers.forEach(i=>{i.removed=!0,i.uninstallCallback?.()}),delete this._nameToGroup[t],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):D.getLogger(this).error("There is no InputHandler group registered under the name `"+t+"`")}hasHandlers(t){return this._nameToGroup[t]!==void 0}isModifierKeyDown(t){return this._activeKeyModifiers.has(t)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const t=new Set,e=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const n=this._handlers[i];n.priorityIndex=i,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(t.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){t.add(o.eventType);for(const a of o.keyModifiers)_l(a)||e.add(a)}n.active=s}this._sourceEvents=t,this._keyModifiers=e,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(t,e,i){this._latestPointerType=t;const n=this._get("latestPointerLocation");if(n==null||n.x!==e||n.y!==i){const s=this._propertiesPool.get("latestPointerLocation");s.x=e,s.y=i,this._set("latestPointerLocation",s)}}_onEventReceived(t,e){if(t==="pointer-capture-lost"){const s=e;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(t,e);const i=this.test.timestamp!=null?this.test.timestamp:e.native?e.native.timestamp:void 0,n=e.native?e.native.cancelable:void 0;this._emitInputEventFromSource(t,e,i,n)}_updateKeyModifiers(t,e){if(!e)return;let i=!1;const n=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},s=(a,h)=>{h&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!h&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(t==="key-down"||t==="key-up"){const a=e.key;this._keyModifiers.has(a)&&s(a,t==="key-down")}const o=e.native;s("Alt",!!o?.altKey),s("Control",!!o?.ctrlKey),s("Ctrl",!!o?.ctrlKey),s("Shift",!!o?.shiftKey),s("Meta",!!o?.metaKey),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new bl((t,e,i)=>this._setLatestPointer(t,e,i)),this._multiTouchHandler=new Tl,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],At.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,At.INTERNAL)}_setPointerCapture(t,e,i,n){const s=t.name+"-"+e.priorityIndex,o=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(t=>!t.removed),this.updateDependencies()}_emitInputEventFromSource(t,e,i,n){this._emitInputEvent(0,t,e,i,n)}_emitInputEvent(t,e,i,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),h=s!==void 0&&s,c={event:new xl(e,i,a,o||this._activeKeyModifiers,h),priorityIndex:t};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(t){this._currentPropagation={events:new Zn,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:t.event.timestamp},this._currentPropagation.events.push(t),this._continuePropagation()}_continuePropagation(){this._paused=!1;const t=this._currentPropagation;if(t){for(;t.events.length>0;){const{event:e,priorityIndex:i}=t.events.pop(),n=e.data?.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(t.currentHandler=this._handlersPriority[i];t.currentHandler;){if(t.currentHandler.removed)t.needsHandlerGarbageCollect=!0;else{if(t.currentHandler.active&&!e.shouldStopPropagation()&&t.currentHandler.eventCallback?.(e),e.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(e.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:e,priorityIndex:t.currentHandler.priorityIndex+1})}t.currentHandler=this._handlersPriority[t.currentHandler.priorityIndex+1]}}t.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(t){const e=new Zn;e.push(t);const i=this._currentPropagation;if(i){for(;i.events.length;)e.push(i.events.pop());i.events=e,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(t,e){if(t.handler.hasSideEffects!==e.handler.hasSideEffects)return t.handler.hasSideEffects?1:-1;if(t.groupPriority!==e.groupPriority)return t.groupPriority>e.groupPriority?-1:1;for(const i of t.handler.incomingEventMatches)for(const n of e.handler.incomingEventMatches){if(i.eventType!==n.eventType)continue;const s=i.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===i.keyModifiers.length!=(s.length===n.keyModifiers.length))return i.keyModifiers.length>n.keyModifiers.length?-1:1}return t.priorityIndex>e.priorityIndex?-1:1}_sortHandlersPriority(t){const e=[];for(const i of t){let n=0;for(;n=0;)n++;e.splice(n,0,i)}return e}get debug(){const t=e=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=i};return{injectEvent:(e,i)=>{t(()=>this._onEventReceived(e,i))},disablePointerCapture:t}}};r([l({readOnly:!0})],Q.prototype,"hasPendingInputs",null),r([l({constructOnly:!0})],Q.prototype,"eventSource",void 0),r([l({constructOnly:!0})],Q.prototype,"recognizers",void 0),r([l()],Q.prototype,"_latestPointerType",void 0),r([l()],Q.prototype,"latestPointerType",null),r([l()],Q.prototype,"multiTouchActive",null),r([l({readOnly:!0})],Q.prototype,"latestPointerLocation",void 0),r([l()],Q.prototype,"_paused",void 0),r([l({readOnly:!0})],Q.prototype,"updating",null),Q=r([_("esri.views.input.InputManager")],Q);let xl=class{constructor(t,e,i,n,s){this.type=t,this.data=e,this.timestamp=i,this.modifiers=n,this.cancelable=s,this._propagationState=Vt.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Vt.STOPPED}shouldStopPropagation(){return!!(this._propagationState&Vt.STOPPED)}async(t){this._propagationState|=Vt.PAUSED;const e=(i,n)=>{this._propagationState&=~Vt.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw i;return i};return(typeof t=="function"?t():t).then(i=>e(i,!1),i=>e(i,!0))}shouldPausePropagation(t){return!!(this._propagationState&Vt.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}};var Vt;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(Vt||(Vt={}));const At={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Pl=class{};const Sl=Pl;function kt(t){return t!=null&&"open"in t&&"declaredClass"in t}function es(t){return t!=null&&"declaredClass"in t&&"dockOptions"in t}const kl=t=>{let e=class extends t{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([w(()=>[this.ui,this.popup],([i,n],s)=>{const o="popup",a="manual";if(s){const[h,c]=s;h&&kt(c)&&(c.view=null,es(c)&&h.remove(c,o))}i&&kt(n)&&(n.view=this,es(n)&&i.add(n,{key:o,position:a,internal:!0}))},U),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(kt(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),kt(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)}))},At.WIDGET)]),pn(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{b(()=>import("./Popup-DFFZHG5j-CtqoPK1b.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136]),import.meta.url)})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(kt(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void D.getLogger(this).error(new C("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){this._popupSetupTask?.abort(),kt(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,n){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(i,n),n)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!kt(this.popup))return this._popupSetupTask=dn(async i=>{const{default:n}=await b(()=>import("./Popup-DFFZHG5j-CtqoPK1b.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136]),import.meta.url);if(Ot(i),!this.popup||kt(this.popup))return;const s=this.popup;delete s.open,delete s.close,this.popup=new n(s)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:i,hits:n},s){const o=[],a=[];let h=!1;const c=lr(s,z("popup-view-fetch-timeout")??Cl),p=u=>{const g=new El(u);return a.push(g),o.push(g.promise),g},d=u=>{const g=a.at(-1);return g&&g.layerView===u&&!h?g:p(u)};for(const u of n)"graphic"in u?(d(u.layerView).graphics.push(u.graphic),h=!1):(o.push(u.layerView.fetchPopupFeaturesAtLocation(u.mapPoint,c)),h=!0);a.map(u=>u.resolve(c));const m=hr(o).then(u=>u.filter(g=>!!g).flat());return{pendingFeatures:o,allGraphicsPromise:m,location:i}}async _getPopupHits(i,n){const{hits:s,location:o}=await this.popupHitTest(i);Ot(n);const a=[];for(const h of s)if("graphic"in h){if(this._isValidPopupGraphic(h.graphic,n)){const c=this._isValidPopupGraphicsLayerView(h.layerView)?h.layerView:void 0;a.push({graphic:h.graphic,layerView:c})}}else this._isValidPopupLocationLayerView(h.layerView)&&a.push({mapPoint:h.mapPoint,layerView:h.layerView});return{hits:a,location:o}}_isValidPopupGraphic(i,n){return i&&!!i.getEffectivePopupTemplate(n?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(i){return!i||(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesFromGraphics"in i}_isValidPopupLocationLayerView(i){return(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesAtLocation"in i}};return r([l()],e.prototype,"popup",void 0),r([l()],e.prototype,"popupEnabled",void 0),e=r([_("esri.views.PopupView")],e),e};let El=class{constructor(t){this.layerView=t,this._resolver=ui(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(t){const{layerView:e,graphics:i,_resolver:n}=this;if(!e)return n.resolve(i),n.promise;let s;return e.fetchPopupFeaturesFromGraphics(i,t).catch(o=>(s=o,null)).then(o=>{o?n.resolve(o):n.reject(s)}),n.promise}};const Cl=5e3;let ai=class extends Pr{constructor(t){super(t),this.addHandles(this.on("before-add",e=>{e.item!=null&&e.item.parent===this.owner&&(D.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),e.preventDefault())}))}_own(t){t.parent=this.owner}_release(t){t.parent=null}};ai=r([_("esri.support.AnalysesCollection")],ai);let It=class extends M{constructor(t){super(t),this.view=null,this.baseLayerViews=new L,this.referenceLayerViews=new L,this._loadingHandle=w(()=>this.view?.map?.basemap,e=>{e&&e.load().catch(()=>{})},U)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const t of this.baseLayerViews)t.destroy();this.baseLayerViews.length=0;for(const t of this.referenceLayerViews)t.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view?.suspended)return!1;const t=this.view?.map?.basemap;return!!t&&!!t.loaded&&(this.baseLayerViews.some(e=>e.updating)||this.referenceLayerViews.some(e=>e.updating))}};r([l({constructOnly:!0})],It.prototype,"view",void 0),r([l({readOnly:!0})],It.prototype,"baseLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"referenceLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"suspended",null),r([l({type:Boolean,readOnly:!0})],It.prototype,"updating",null),It=r([_("esri.views.BasemapView")],It);const Il=It;function Dl(t){return"tryRecycleWith"in t}function Rl(t){return t!=null&&typeof t=="object"&&"layerViews"in t}let Ll=class{constructor(t,e,i){this.layer=t,this.view=e,this.layerViewImporter=i,this._controller=new AbortController,this._deferred=ui(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Ti(this._controller.signal,()=>{const n=new C("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(n)})}tryRecycle(t){if(!this.done||!this.layerView||!Dl(this.layerView))return null;const e=this.layer.type,i=this._controller.signal;for(let n=0;n(Ot(this._controller.signal),s.emit("layerview-destroy",{view:h,layerView:a}),h.emit("layerview-destroy",{view:h,layerView:a}),s.emit("layerview-create",{view:h,layerView:a}),h.emit("layerview-create",{view:h,layerView:a}),a)),new Promise((c,p)=>Ti(this._controller.signal,()=>p(Qs())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:t}=this;if(t){const{layer:e,view:i}=this;e.emit("layerview-destroy",{view:i,layerView:t}),i.emit("layerview-destroy",{layer:e,layerView:t})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:e,view:i}=this;this._map=i.map;try{let n,s;if(await e.load({signal:t}),e.prefetchResources&&await e.prefetchResources({signal:t}),Ol(e))n=await e.createLayerView(i,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(e))throw new C("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(e);Ot(t),n="default"in a?new a.default({layer:e,view:i}):new a({layer:e,view:i})}const o=()=>{s=st(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=Ti(t,o),Ot(t);try{await n.when()}catch(a){throw o(),a}if(!this._map?.allLayers?.includes(e))return o(),void this._deferred.reject(new C("view:no-layerview-for-layer","The layer has been removed from the map",{layer:e}));this.layerView=n,e.emit("layerview-create",{view:i,layerView:n}),i.emit("layerview-create",{layer:e,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){e.emit("layerview-create-error",{view:i,error:n}),i.emit("layerview-create-error",{layer:e,error:n}),this.done=!0,this._deferred.reject(new C("layerview:create-error","layerview creation failed",{layer:e,error:n}))}}},J=class extends M{constructor(t){super(t),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new yi,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const i of e)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=ui(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(Wa(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=new Set,n=[],s=this.view.ready,o=h=>{if(h!=null){for(const c of h)if(c){i.add(c);const p=this._layerLayerViewInfoMap.get(c);p&&s?p.start():p||this._recyclingInfoMap.has(c)||n.push(c),"layers"in c&&c.layers&&o(c.layers)}}};for(const h of this._rootCollectionNames)o(bi(this,h));for(const[h,c]of this._layerLayerViewInfoMap)if(!i.has(h)){this._layerLayerViewInfoMap.delete(c.layer);const p=c.tryRecycle(n);p?(this.notifyChange("updating"),this._recyclingInfoMap.set(c.layer,c),p.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),this._layerLayerViewInfoMap.set(c.layer,c),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy(),this._reschedule()})):c.destroy()}for(const[h,c]of this._recyclingInfoMap)i.has(h)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy());for(const h of n)this._createLayerView(h);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter(h=>!!h);i.forEach(h=>"layers"in h&&a.push(h.layers)),this.addHandles(a.map(h=>this._watchUpdatingTracking.addOnCollectionChange(()=>h,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([ci(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),w(()=>{const t=this.view,e=t?.map;return[e?.basemap,e?.ground,e?.layers,t?.ready]},()=>this._reschedule(),ct)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),Mi(this._recyclingInfoMap),Mi(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(Qs()),this._workPromise=null)}get _layersToLayerViews(){const t=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&t.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(t)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||Ua(this._layerLayerViewInfoMap,t=>!t.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let t=0;for(const e of this._layerLayerViewInfoMap.values())e.done||++t;return t}clear(){this.destroyed||(Mi(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(t){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(t)){if(this._recyclingInfoMap.has(t))return this._recyclingInfoMap.get(t).promise;throw new C("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:t})}return this._layerLayerViewInfoMap.get(t).promise}isCreatingLayerViewsForLayer(t,e){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(t);if(!i?.done)return!0;const n=i.layerView;return!(!n||!e||n.parent===e)||!!(i.done&&n&&"layers"in t&&t.layers?.length)&&t.layers.some(s=>this.isCreatingLayerViewsForLayer(s,n))}_refreshCollections(){for(const[t,e]of this._layersToLayerViews)this._populateLayerViewsOwners(bi(this,t),bi(this,e),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(t,e,i){if(!t||!e)return void(e&&e.removeAll());let n=0;for(const s of t){const o=this._layerLayerViewInfoMap.get(s);if(!o?.layerView)continue;const a=o.layerView;a.layer=s,a.parent=i,e.at(n)!==a&&e.splice(n,0,a),"layers"in s&&Rl(a)&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(t)&&this.layerViewImporter.importLayerView(t);const e=new Ll(t,this.view,this.layerViewImporter);e.promise.then(()=>this._refreshCollections(),i=>{i&&(Js(i)||i.name==="cancelled:layerview-create")||D.getLogger(this).error(`Failed to create layerview for layer title:'${t.title??"no title"}', id:'${t.id??"no id"}' of type '${t.type}'.`,{layer:t,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(t,e),this.view.ready&&e.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};r([l()],J.prototype,"_workPromise",void 0),r([l({readOnly:!0})],J.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],J.prototype,"_layersToLayerViews",null),r([l({readOnly:!0})],J.prototype,"_rootCollectionNames",null),r([l()],J.prototype,"layerViewImporter",void 0),r([l()],J.prototype,"supportsGround",void 0),r([l({readOnly:!0})],J.prototype,"updating",null),r([l({readOnly:!0})],J.prototype,"updatingRemaining",null),r([l({constructOnly:!0})],J.prototype,"view",void 0),J=r([_("esri.views.LayerViewManager")],J);const Vl=J;function Ol(t){return"createLayerView"in t&&t.createLayerView!=null}let Y=class extends M{constructor(t){super(t),this.factor=1.5,this.offset=H(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};r([l({type:Number})],Y.prototype,"factor",void 0),r([l({nonNullable:!0})],Y.prototype,"offset",void 0),r([l()],Y.prototype,"position",void 0),r([l({type:Number,range:{min:0}})],Y.prototype,"size",void 0),r([l()],Y.prototype,"maskUrl",void 0),r([l()],Y.prototype,"maskEnabled",void 0),r([l()],Y.prototype,"overlayUrl",void 0),r([l()],Y.prototype,"overlayEnabled",void 0),r([l({readOnly:!0})],Y.prototype,"version",null),r([l({type:Boolean})],Y.prototype,"visible",void 0),Y=r([_("esri.views.Magnifier")],Y);const uo=Y;function Ge(t){return!!(t!=null&&typeof t=="object"&&"createQuery"in t&&t.createQuery&&"on"in t&&t.on)}let yt=class extends hi.EventedAccessor{constructor(t){super(t),this._selectionMap=new kr,this._sources=new L,this._trashCan=[],this._layerEditHandles=new L,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([w(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),ci(()=>this.sources,"change",e=>{const i=this._selectionMap;for(const n of e.removed)i.delete(n);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const t=new L;this.view.when().then(()=>{this.view.map&&(this.view.map.allLayers.flatten(e=>"sublayers"in e&&e.sublayers?e.sublayers:null).forEach(e=>{(Ge(e)&&!Ia(e)||Ft(e))&&t.add(e)}),this.sources=t)})}destroy(){this._layerEditHandles.drain(st)}get selections(){return Array.from(this._selectionMap.entries()).map(t=>{const[e,i]=t;return{layer:e,selection:[...i.selection]}})}get count(){let t=0;for(const e of this._selectionMap.values())t+=e.selection.length;return t}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(t){Da(t,this._sources)}async getSelectedFeatures(t,e={},i="layerView"){const{view:n,selections:s}=this,o=(t!==void 0?s.filter(a=>t.includes(a.layer)):s).filter(a=>a.selection.length>0).map(async a=>{const{layer:h,selection:c}=a,p=Ft(h)?h.parent:h;if(p==null||!ns(p))return null;if(i==="layer")return ss(p,c,e);if(is(p))return null;const d=await n.whenLayerView(p).catch(()=>null);return d?ss(d,c,e):null});return(await Promise.all(o)).filter(a=>a!=null)}updateSelection(t){const e=new Map;for(const[s,o]of this._selectionMap)e.set(s,[...o.selection]);let i=!1;const n=t.current.concat(t.added);for(const s of n){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=Ra(e,o,()=>[]);h.includes(a)||(h.push(a),i=!0)}}for(const s of t.removed){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=e.get(o),c=h?.indexOf(a);c!==void 0&&c>=0&&(h?.splice(c,1),i=!0)}}if(i){const{_selectionMap:s,_trashCan:o}=this,a=[];for(const[h,c]of e){const p=s.get(h);p!==void 0&&o.push(p),s.set(h,{selection:c}),a.push({layer:h,selection:c,...On(p!==void 0?p.selection:[],c)})}this._onSelectionChange(a)}}setSelection(t,e){this._setSelection(t,e)}getSelection(t){return this._selectionMap.get(t)?.selection}appendToSelection(t,e){const i=this._selectionMap.get(t),n=i!==void 0?[...i.selection]:[];for(const s of e)n.includes(s)||n.push(s);this._setSelection(t,n)}removeFromSelection(t,e){const i=this._selectionMap.get(t);if(!i)return;const n=[];for(const s of i.selection)e.includes(s)||n.push(s);this._setSelection(t,n)}toggleInSelection(t,e){const i=this._selectionMap.get(t);if(!i||i.selection.length===0)return void this._setSelection(t,e);const n=new Set(i.selection),s=new Set(e),o=La(n,s);this._setSelection(t,Array.from(o))}clear(){const t=this._selectionMap.values();this._trashCan.push(...t);const e=[];for(const[i,n]of this._selectionMap.entries())e.push({layer:i,added:[],removed:[...n.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(e)}_onSelectionChange(t){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:t})}_refreshVisualization(){if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;)this._trashCan.pop()?.highlightHandle?.remove();const{sources:t,view:e,_selectionMap:i,showHighlight:n}=this,s=this._vizTaskId;for(const o of t){const a=i.get(o),h=Ft(o)?o.parent:o;if(h!=null&&ns(h)){if(is(h))continue;e.whenLayerView(h).then(c=>{a?.highlightHandle?.remove(),a!=null&&n&&s===this._vizTaskId&&"highlight"in c&&typeof c.highlight=="function"&&a.selection.length>0&&(a.highlightHandle=c.highlight(a.selection,"selection"))}).catch(()=>{a?.highlightHandle?.remove()})}}}_refreshListeners(){this._layerEditHandles.drain(st);for(const t of this.sources){const e=Ft(t)?t.parent:t;if(e!=null&&Ge(e)){const i=e.on("edits",n=>{this._handleEditChanges(n,t)});this._layerEditHandles.push(i)}}}_handleEditChanges(t,e){if(t.deletedFeatures!==void 0&&t.deletedFeatures.length>0&&this._selectionMap.has(e)){const i=t.deletedFeatures.filter(n=>n.error==null).map(n=>n.objectId).filter(ni);this.removeFromSelection(e,i)}}_setSelection(t,e){if(!this.sources.includes(t))throw new Error(`Cannot set selection on layer ${t.title} because it is not in 'sources'`);const i=this._selectionMap.get(t);if(i===void 0||!zl(i,{selection:e})){i!==void 0&&this._trashCan.push(i),this._selectionMap.set(t,{selection:[...e]});const n={layer:t,selection:[...e],...On(i!==void 0?i.selection:[],e)};this._onSelectionChange([n])}}};r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"selections",null),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"count",null),r([l({constructOnly:!0,nonNullable:!0})],yt.prototype,"view",void 0),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"hasSelection",null),r([l()],yt.prototype,"showHighlight",void 0),r([l()],yt.prototype,"sources",null),yt=r([_("esri.views.SelectionManager")],yt);const is=t=>Ft(t)?t.parent?.isTable===!0:t.isTable,Al=t=>t.layer!==void 0,ns=t=>t?.when!==void 0,zl=(t,e)=>{if(t==null&&e==null)return!0;if(t!=null&&e==null||t==null&&e!=null)return!1;if(t!=null&&e!=null&&t.selection!=null&&e.selection!=null){const i=[...t.selection],n=[...e.selection];if(i.length!==n.length)return!1;i.sort(),n.sort();for(let s=0;s{let n;if(Al(t)){const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:t.layer}))}else{const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:s}))}return n},Nl=yt;let ve=class extends js(M){constructor(t){super(t),this.accentColor=new Pt([255,127,0]),this.textColor=new Pt([255,255,255])}};r([l({type:Pt,nonNullable:!0})],ve.prototype,"accentColor",void 0),r([l({type:Pt,nonNullable:!0})],ve.prototype,"textColor",void 0),ve=r([_("esri.views.Theme")],ve);const Ki=ve;var os;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(os||(os={}));const mo=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],go={};function yo(t){return!!go[t]}function Fl(t){for(const e of t)if(!yo(e))return!1;return!0}mo.forEach(t=>{go[t]=!0});let Hl=class{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach(({handler:e,priority:i},n)=>this.inputManager?.installHandlers(n,[e],i))}disconnect(){this.inputManager&&this._handlers.forEach((t,e)=>this.inputManager?.uninstallHandlers(e)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,e,i,n){const s=Array.isArray(t)?t:t.split(",");if(!Fl(s))return s.some(yo)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(e)?a=e:(o=e,a=[]),typeof i=="function"?o=i:n=i,n=n??At.DEFAULT;const h=this._createUniqueGroupName(),c=new Zl(this.view,s,a,o);this._handlers.set(h,{handler:c,priority:n});for(const p of s){const d=this._handlerCounts.get(p)||0;this._handlerCounts.set(p,d+1)}return this.inputManager&&this.inputManager.installHandlers(h,[c],n),di(()=>this._removeHandler(h,s))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,e){if(this._handlers.has(t)){this._handlers.delete(t);for(const i of e){const n=this._handlerCounts.get(i);n===void 0||(n===1?this._handlerCounts.delete(i):this._handlerCounts.set(i,n-1))}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},Zl=class extends A{constructor(t,e,i,n){super(!0),this._latestDragStart=void 0,this.view=t;for(const s of e)switch(s){case"click":this.registerIncoming("click",i,o=>n(Wl(t,o)));break;case"double-click":this.registerIncoming("double-click",i,o=>n(Ul(t,o)));break;case"immediate-click":this.registerIncoming("immediate-click",i,o=>n(jl(t,o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",i,o=>n(ql(t,o)));break;case"hold":this.registerIncoming("hold",i,o=>n(Bl(t,o)));break;case"drag":this.registerIncoming("drag",i,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",i,o=>n(Kl(o)));break;case"key-up":this.registerIncoming("key-up",i,o=>n(Yl(o)));break;case"pointer-down":this.registerIncoming("pointer-down",i,o=>n(ge(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",i,o=>n(ge(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",i,o=>n(ge(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",i,o=>n(Xl(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",i,o=>n(Ql(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",i,o=>n(ge(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",i,o=>n(ge(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",i,o=>{n(Jl(o))});break;case"focus":this.registerIncoming("focus",i,o=>{n(Gl(o))});break;case"blur":this.registerIncoming("blur",i,o=>{n($l(o))})}}_wrapDrag(t){const e=t.data,{x:i,y:n}=e.center,{action:s,pointerType:o,button:a}=e;if(s==="start"&&(this._latestDragStart=e),!this._latestDragStart)return;const h=e.pointer.native,c=e.buttons,{cancelable:p,timestamp:d}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:i,y:n,origin:m,pointerType:o,button:a,buttons:c,radius:e.radius,angle:ja(e.angle),native:h,timestamp:d,cancelable:p,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}};function Gl(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function $l(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function Wl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,screenPoint:H(o,a),mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function Ul(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"double-click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function jl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function ql(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-double-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function Bl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h}=e.data,{cancelable:c,timestamp:p}=e;return{type:"hold",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:p,mapPoint:Ve(t,o,a),cancelable:c,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}function Ve(t,e,i){return t.toMap(H(e,i),{exclude:[]})}function Kl(t){const{key:e,repeat:i,native:n}=t.data,{cancelable:s,timestamp:o}=t;return{type:"key-down",key:e,repeat:i,native:n,timestamp:o,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:a=>t.async(a),preventDefault:()=>t.preventDefault()}}function Yl(t){const{key:e,native:i}=t.data,{cancelable:n,timestamp:s}=t;return{type:"key-up",key:e,native:i,timestamp:s,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}function ge(t,e){const{x:i,y:n,button:s,buttons:o,native:a,eventId:h}=t.data,c=a.pointerId,p=a.pointerType,{cancelable:d,timestamp:m}=t;return{type:e,x:i,y:n,pointerId:c,pointerType:p,button:s,buttons:o,native:a,timestamp:m,eventId:h,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}function Xl(t){const{x:e,y:i,buttons:n,native:s,eventId:o}=t.data.currentEvent,{button:a}=t.data.startEvent,h=t.data.startEvent.native.pointerId,c=t.data.startEvent.native.pointerType,p=t.data.action,d={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:m,timestamp:u}=t;return{type:"pointer-drag",x:e,y:i,pointerId:h,pointerType:c,button:a,buttons:n,action:p,origin:d,native:s,timestamp:u,eventId:o,cancelable:m,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}function Ql(t){const{cancelable:e,data:i,timestamp:n}=t,{x:s,y:o,deltaY:a,native:h}=i;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:h,timestamp:n,cancelable:e,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}function Jl(t){const{action:e,state:i,device:n}=t.data,{cancelable:s,timestamp:o}=t,{buttons:a,axes:h}=i;return{type:"gamepad",device:n,timestamp:o,action:e,buttons:a,axes:h,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}var Ie,as,rs;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(Ie||(Ie={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(as||(as={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(rs||(rs={}));function th(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return D.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function Yi(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(Ie.USER)&&t.getEditableFlag(Ie.MANAGER)}function rt(t){return H(t.x,t.y)}function _o(t,e){const i=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return i?H(e.clientX-i.left,e.clientY-i.top):H(0,0)}function fo(t,e){return e instanceof Event?_o(t,e):rt(e)}function vo(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let eh=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._externallyDragging=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const i=()=>t.stopPropagation();switch(t.type){case"pointer-move":hs(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0?this._stopDrag=!0:t.action==="start"?this._externallyDragging=!0:t.action==="end"&&(this._externallyDragging=!1),this._stopDrag&&(i(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!cs(t))break;const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(t)||!o.grabbing||o.dragging||this._releaseManipulatorBeforeDragging(o,t,e),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(t)&&!o.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:o,tool:a,start:n,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&e.activeTool==null&&(this._revertToNullActiveTool=!0,e.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:n}),i());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case"pointer-drag":{if(!cs(t))break;const n=this._grabbedManipulators.get(t.pointerId),s=n?.manipulator,o=n?.tool;if(s==null||o==null)break;const a=rt(t);a.x=ke(a.x,0,e.view.width),a.y=ke(a.y,0,e.view.height);const h=n.start,c=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?s.events.emit("drag",{action:"update",start:h,screenPoint:a}):s.events.emit("drag",{action:"start",start:h,screenPoint:a,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:o,manipulator:s,start:h}));break;case"end":s.dragging=!1,c&&s.events.emit("drag",{action:"end",start:h,screenPoint:a}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}i();break}case"immediate-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(ih(t)||e.forEachTool(c=>{if((s==null||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let p=!1;c.manipulators.forEach(({manipulator:d})=>{d.selected&&(d.selected=!1,p=!0)}),p&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const h=t.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:h,stopPropagation:i}),Di(o,i);break}case"click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s?.manipulator;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit(t.type,{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a}),i();break}case"double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),Di(o,i);break}case"immediate-double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),t.pointerType==="mouse"&&Di(o,i);break}}this._onFocusChange(e.forEachTool)}_releaseManipulatorBeforeDragging(t,e,i){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:rt(e)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===t&&this._grabbedManipulators.delete(s)}),this._afterManipulatorRelease(i.setActiveTool)}_handlePointerEnd(t,e){const i=this._grabbedManipulators.get(t.pointerId)?.manipulator;i!=null&&i.grabbing&&(i.grabbing=!1,i.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:rt(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(e.setActiveTool))}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=ls(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=ls(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const e=new Set,i=new Set;this._grabbedManipulators.forEach(({tool:n})=>{e.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{i.add(n)}),t(n=>{n.hasGrabbedManipulators=e.has(n),n.hasHoveredManipulators=i.has(n);const s=this._grabbedManipulators.values(),o=cr(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(t,{forEachTool:e,setActiveTool:i},n=!0,s){const o=(a,h)=>a===t&&(s==null||s===h);this._grabbedManipulators.forEach(({tool:a,manipulator:h,pointerType:c},p)=>{o(a,h)&&(this._grabbedManipulators.delete(p),h.grabbing=!1,h.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._draggedManipulators.delete(c),h.dragging=!1,h.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._hoveredManipulators.delete(c),h.hovering=!1)}),this._afterManipulatorRelease(i),this._onFocusChange(e)}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((e,i)=>{this._updateHoveredStateForPointerAtScreenPosition(H(e.x,e.y),i,e.pointerType,t)})}handleHoverEvent(t,e){const i=t.type;i!=="pointer-up"&&i!=="immediate-click"&&i!=="pointer-move"||!hs(t.pointerType)||(i!=="pointer-up"&&this._externallyDragging?this._clearHoveredManipulatorStates(t.pointerId):this._updateHoveredStateForPointerAtScreenPosition(rt(t),t.pointerId,t.pointerType,e))}_updateHoveredStateForPointerAtScreenPosition(t,e,i,n){let s=te(t,i,n);const o=this._hoveredManipulators.get(e)?.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(e,s)):this._hoveredManipulators.delete(e),this._onFocusChange(n))}_afterManipulatorRelease(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}_clearHoveredManipulatorStates(t){this._hoveredManipulators.forEach(({manipulator:e},i)=>{t===i&&(this._hoveredManipulators.delete(t),e.hovering=!1)})}};function ls(t){for(const{manipulator:e}of t.values())if(e!=null&&e.interactive){if(e.grabbing&&e.grabCursor)return e.grabCursor;if(e.cursor)return e.cursor}return null}function te(t,e,i){let n=null;return i(s=>{if(s.manipulators==null||!Yi(s))return!1;const o=s.manipulators.intersect(t,e);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}function hs(t){return t==="mouse"}function cs(t){return t.pointerType!=="mouse"||t.button===0}function ih(t){return!!t.native.shiftKey}function Di(t,e){t?.consumesClicks&&e()}const ps="attached",Ri="tools",nh=1e3;let lt=class extends M{constructor(t){super(t),this._updatingHandles=new yi,this._clock=Re,this._manipulatorState=new eh,this.tools=new L,this.cursor=null,this._interacting=!1,this._interactingTimeout=nh,this._interactingTimeoutHandle=null,this._forEachTool=e=>{for(const i of this.tools.items)if(e(i))return}}initialize(){this.addHandles([this.view.on(mo,t=>{this._handleInputEvent(t)},At.TOOL),...th(this.tools),this.tools.on("before-add",({item:t})=>{this._updateToolEditableFlag(t)}),this.tools.on("before-remove",({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(t=>t.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(t!=null&&!this.view.ready)return void D.getLogger(this).error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return;const e=this.activeTool;this._set("activeTool",t),e?.deactivate(),t?.activate(),this._removeIncompleteTools(t);for(const i of this.tools){this._updateToolEditableFlag(i);const n=Yi(i);this.activeTool!=null&&n||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(t=>t.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=st(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){this.view.type==="3d"?this.addHandles([w(()=>{const{state:t}=this.view;return"camera"in t&&t.camera},()=>this._forEachManipulator(t=>t.onViewChange())),this.view.elevationProvider?.on("elevation-change",t=>this._forEachManipulator(e=>e.onElevationChange(t)))],ps):this.addHandles(w(()=>this.view.extent,()=>this._forEachManipulator(t=>t.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ps),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool(e=>{e.manipulators&&e.manipulators.forEach(({manipulator:i})=>t(i,e))})}_handleInputEvent(t){let e=!1;const i={...t,stopPropagation:()=>{e=!0,t.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(n=>{!e&&n.visible&&n.handleInputEvent(i)}),!e&&t.type==="key-down"&&t.key==="Escape"&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),e||this.activeTool==null||this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor(),t.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(Ri),this._forEachTool(t=>{if(t instanceof M){const e=w(()=>[t.cursor,t.visible,t.editable],()=>{Yi(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(e,Ri)}t.manipulators&&this.addHandles([t.manipulators.on("after-remove",e=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,e.item.manipulator)}),t.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Ri)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){t.setEditableFlag?.(Ie.MANAGER,this.activeTool==null||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;t==null&&this._forEachTool(e=>!(e.cursor==null||!e.visible)&&(t=e.cursor,!0)),this._get("cursor")!==t&&this._set("cursor",t)}_removeIncompleteTools(t){this.tools.filter(e=>(t==null||e!==t)&&!e.created&&e.removeIncompleteOnCancel).forEach(e=>{this.tools.remove(e)})}get test(){}};r([l({constructOnly:!0,nonNullable:!0})],lt.prototype,"view",void 0),r([l({value:null})],lt.prototype,"activeTool",null),r([l({readOnly:!0,type:L})],lt.prototype,"tools",void 0),r([l({readOnly:!0})],lt.prototype,"cursor",void 0),r([l({readOnly:!0})],lt.prototype,"updating",null),r([l()],lt.prototype,"_interacting",void 0),r([l({readOnly:!0})],lt.prototype,"interacting",null),lt=r([_("esri.views.ToolViewManager")],lt);let se=class extends M{constructor(t){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",t.mapping==="standard"?this._detectedDeviceType="standard":sh.test(t.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=t.index}get native(){const t=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexVa.respectPrefersReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;let Dt=class extends M{constructor(t){super(t),this.enabled=!0,this.device=null,this.mode="pan",this.tiltDirection="forward-down",this.velocityFactor=1}};r([l({type:Boolean,nonNullable:!0})],Dt.prototype,"enabled",void 0),r([l({type:Mn})],Dt.prototype,"device",void 0),r([l({type:["pan","zoom"],nonNullable:!0})],Dt.prototype,"mode",void 0),r([l({type:["forward-down","forward-up"],nonNullable:!0})],Dt.prototype,"tiltDirection",void 0),r([l({type:Number,nonNullable:!0})],Dt.prototype,"velocityFactor",void 0),Dt=r([_("esri.views.navigation.gamepad.GamepadSettings")],Dt);const bo=Dt;let Zt=class extends M{constructor(t){super(t),this.browserTouchPanEnabled=!0,this.gamepad=new bo,this.momentumEnabled=!0,this.mouseWheelZoomEnabled=!0}get effectiveMomentumEnabled(){return this.momentumEnabled&&!wo()}};r([l({type:Boolean})],Zt.prototype,"browserTouchPanEnabled",void 0),r([l({type:bo,nonNullable:!0})],Zt.prototype,"gamepad",void 0),r([l({type:Boolean})],Zt.prototype,"momentumEnabled",void 0),r([l({type:Boolean})],Zt.prototype,"mouseWheelZoomEnabled",void 0),Zt=r([_("esri.views.navigation.Navigation")],Zt);const To=Zt;var ds;function lh(t){if(t.type==="integrated-mesh-3dtiles")return null;const e=t.url?Er(t.url):void 0;return!(t.spatialReference?.vcsWkid==null&&e!=null&&e.serverType==="ImageServer")&&Mo(t)&&t.heightModelInfo?t.heightModelInfo:hh(t)?wn.deriveUnitFromSR(ph,t.spatialReference):null}function Mo(t){return"heightModelInfo"in t}function xo(t){if(t.type==="unknown"||!("capabilities"in t))return!1;switch(t.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function hh(t){return xo(t)?!!(t.capabilities&&t.capabilities.data&&t.capabilities.data.supportsZ):Po(t)}function ch(t){return t.layers!=null||Po(t)||xo(t)||Mo(t)}function Po(t){switch(t.type){case"building-scene":case"elevation":case"integrated-mesh":case"integrated-mesh-3dtiles":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"catalog":case"catalog-footprint":case"catalog-dynamic-group":case"csv":case"dimension":case"geojson":case"feature":case"focusArea":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"parquet":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"viewshed":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}(function(t){t[t.Ok=0]="Ok",t[t.Units=1]="Units",t[t.HeightModel=2]="HeightModel",t[t.CRS=3]="CRS",t[t.Unsupported=4]="Unsupported"})(ds||(ds={}));const ph=new wn({heightModel:"gravity-related-height"});let Xi,Li=null;async function dh(t){Li||(Li=b(()=>import("./geometryServiceUtils-nsujb7BH-BZ1M-sZ1.js"),__vite__mapDeps([137,1,2,138,49,53]),import.meta.url).then(e=>Xi=e)),await Li,Ot(t)}async function So(t,e,i,n){if(!t)return null;const s=t.spatialReference;return yn()||_n(s,e)?Le(t,e):Xi?Xi.projectGeometry(t,e,i,n):(await Promise.race([dh(n),fn(n)]),So(t,e,i,n))}let P=class extends M{constructor(t){super(t),this.required={extent:!1,heightModelInfo:!1,tileInfo:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference??this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const t=this.map?.(),e=[];return this.priorityCollection!=null&&e.push(this.priorityCollection),e.push({parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers},{parent:t?.ground,layers:t?.ground?.layers},{parent:t?.basemap,layers:t?.basemap?.referenceLayers}),e}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};let t;if(this._collectLayers(this.mapCollections,i=>{const n=this._getSupportedSpatialReferences(i);if(n.length>0){const s=this._narrowDownSpatialReferenceCandidates(t,n);s!=null&&(t=s)}return t?.length===1})&&t?.length!==1)return{updating:!0};const e=this._pickSpatialReferenceCandidate(t);return{spatialReference:e?.spatialReference??null,viewingMode:e?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};const t=this.map?.(),e=this.spatialReference;if(!e)return{updating:this._spatialReferenceTask.updating};let i;const n=this._collectLayers([{parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers}],s=>!(!("tileInfo"in s)||!s.tileInfo?.spatialReference.equals(e))&&(i=s,!0),s=>"tileInfo"in s);return i?{tileInfo:i.tileInfo,updating:!1}:{updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};let t={};const e=this._collectLayers(this.mapCollections,i=>{const n=lh(i);return!!n&&(t={heightModelInfo:n,vcsWkid:i.spatialReference?.vcsWkid,latestVcsWkid:i.spatialReference?.latestVcsWkid},!0)},i=>ch(i));return{...t,updating:e}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=[],e=this._collectLayers(this.mapCollections,i=>{const n="fullExtents"in i&&i.fullExtents||(i.fullExtent!=null?[i.fullExtent]:[]),s=this.requiresExtentInSpatialReference?null:n[0],o=n.find(a=>a.spatialReference.equals(this.spatialReference))??s;if(o)return t.push({extent:o,layer:i}),!0;if(this._getSupportedSpatialReferences(i).length>0)for(const a of n)t.push({extent:a,layer:i});return!1});return{candidates:t,updating:e}}get _extentTask(){const{candidates:t,updating:e}=this._extentCandidatesTask;if(e)return{updating:e};if(t==null||t.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(t),n=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:n.clone(),task:dn(async s=>{try{const o=await So(i.extent,n,"portalItem"in i.layer?i.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(qa(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(t,e){if(t==null)return e;const i=new Array;for(const n of t)for(const s of e){if(!n.spatialReference.equals(s.spatialReference))continue;const o=mh(n.viewingMode,s.viewingMode);if(o!==!1){i.push({spatialReference:n.spatialReference,viewingMode:o});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(t){const e=this.defaultSpatialReference;return t==null||t.length<1?e?{spatialReference:e,viewingMode:null}:null:(e!=null&&t.length>1&&t.some(({spatialReference:i})=>i.equals(e))&&(t=t.filter(({spatialReference:i})=>i.equals(e))),t.length>1&&t.some(({viewingMode:i})=>i!==jn.Local)&&(t=t.filter(({viewingMode:i})=>i!==jn.Local)),t[0])}_getSupportedSpatialReferences(t){const e="supportedSpatialReferences"in t&&t.supportedSpatialReferences||(t.spatialReference?[t.spatialReference]:[]);if(e.length===0)return[];const i=[];for(const n of e){const s=this.getSpatialReferenceSupport(n,t);if(s!=null){const o=s.constraints??[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:h}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||i.push({spatialReference:a,viewingMode:h})}}return i}_pickExtentCandidate(t){const e=this.spatialReference;return t.find(({extent:i})=>e.equals(i.spatialReference))||t[0]}_collectLayers(t,e,i=()=>!0){if(this._loadMaybe(this.map?.())!=="loaded")return!0;const n=new uh(i,e);for(const s of t)if(this._collectCollection(s,n),n.done||n.preloading===this.sourcePreloadCount)break;return n.updating}_collectCollection(t,e){if(t.layers){switch(this._loadMaybe(t.parent)){case"loading":return e.updating=!0,void++e.preloading;case"failed":return}for(const i of t.layers)if(e.layerFilter(i)){switch(this._loadMaybe(i)){case"failed":continue;case"loading":e.updating=!0,++e.preloading;break;case"loaded":if(e.updating||(e.done=e.pushLayer(i)),e.done||e.preloading===this.sourcePreloadCount)break;"layers"in i&&this._collectCollection({layers:i.layers},e)}if(e.done||e.preloading===this.sourcePreloadCount)break}}}_loadMaybe(t){return t&&"loadStatus"in t&&t.loadStatus!=null?t.loadStatus==="not-loaded"?(t.load().catch(e=>{Js(e)}),"loading"):t.loadStatus:"loaded"}};r([l()],P.prototype,"required",void 0),r([l({constructOnly:!0})],P.prototype,"map",void 0),r([l({constructOnly:!0})],P.prototype,"getSpatialReferenceSupport",void 0),r([l()],P.prototype,"defaultSpatialReference",void 0),r([l()],P.prototype,"userSpatialReference",void 0),r([l()],P.prototype,"sourcePreloadCount",void 0),r([l()],P.prototype,"priorityCollection",void 0),r([l()],P.prototype,"requiresExtentInSpatialReference",void 0),r([l()],P.prototype,"suspended",void 0),r([l({readOnly:!0})],P.prototype,"ready",null),r([l({readOnly:!0})],P.prototype,"heightModelInfoReady",null),r([l({readOnly:!0})],P.prototype,"spatialReference",null),r([l({readOnly:!0})],P.prototype,"extent",null),r([l({readOnly:!0})],P.prototype,"heightModelInfo",null),r([l({readOnly:!0})],P.prototype,"vcsWkid",null),r([l({readOnly:!0})],P.prototype,"latestVcsWkid",null),r([l({readOnly:!0})],P.prototype,"viewingMode",null),r([l({readOnly:!0})],P.prototype,"tileInfo",null),r([l({readOnly:!0})],P.prototype,"mapCollections",null),r([l({readOnly:!0})],P.prototype,"_spatialReferenceTask",null),r([l({readOnly:!0})],P.prototype,"_tileInfoTask",null),r([l({readOnly:!0})],P.prototype,"_heightModelInfoTask",null),r([l({readOnly:!0})],P.prototype,"_extentCandidatesTask",null),r([l()],P.prototype,"_extentTask",null),r([l()],P.prototype,"_projectExtentTask",void 0),P=r([_("esri.views.support.DefaultsFromMap")],P);let uh=class{constructor(t,e){this.layerFilter=t,this.pushLayer=e,this.preloading=-1,this.updating=!1,this.done=!1}};function mh(t,e){return t!=null?e!=null?t===e&&t:t:e}var be;let y=be=class extends hi.EventedMixin(Oa(M)){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.handles=new qs,this.updatingHandles=new yi,this.allLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:yh}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new oo,this.analyses=new ai,this.typeSpecificPreconditionsReady=!0,this.layerViews=new L,this.magnifier=new uo,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new rh,this.navigation=new To,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Hl(this),this.persistableViewModels=new L,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(w(()=>this.preconditionsReady,e=>{const i=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,be.views.add(this)):(this._lockedSpatialReference=null,be.views.remove(this)),this.notifyChange("spatialReference"),!e&&i)this.toolViewManager?.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!i){try{this._startup()}catch(n){return void queueMicrotask(()=>{this.fatalError=new C("startup-error",null,n)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Ee))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,pn(()=>this.ready)))),this.basemapView=new Il({view:this}),this.layerViewManager=new Vl({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new lt({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new Nl({view:this}),this.addHandles([w(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},ct),w(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},Ee),w(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},ct)])}_setupSpatialReferenceLogger(){let t=null;this.addHandles([w(()=>this.defaultsFromMap?.ready,e=>{const i=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&i){if(t!=null)return;const n=di(()=>t=ji(t));t=dn(async s=>{try{await Aa(this.spatialReferenceWarningDelay,null,s)}catch{return}finally{t=null}D.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(n,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){this.destroyed||(be.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=tt(this.graphics),this.analyses=tt(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),tt(this.analysisViewManager),this.toolViewManager=tt(this.toolViewManager),this.layerViewManager=tt(this.layerViewManager),this.selectionManager=tt(this.selectionManager),this.basemapView=tt(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(t=>t.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=tt(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return D.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new P({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(t,e)=>this.getSpatialReferenceSupport(t,e),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||An.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t?.destroyed&&(D.getLogger(this).warn("#map","The provided map is already destroyed",{map:t}),t=null),An.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",t))}get spatialReference(){const t=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(t&&this.defaultsFromMap?.required?.heightModelInfo){const e=t.clone();return e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,e}return t}set spatialReference(t){const e=!pi(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(t){this._userTimeExtent=t}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??za}set timeZone(t){this._userTimeZone=t,Na(t)||D.getLogger(this).warn("#timeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Ki}whenLayerView(t){return this.layerViewManager?.whenLayerView(t)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(t){throw new C("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return this.getSpatialReferenceSupport(t)!=null}when(t,e){return this.isResolved()&&!this.ready&&D.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(t,e)}forceReadyCycle(){this.ready&&(Ce(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};y.views=new L,r([l()],y.prototype,"_userSpatialReference",void 0),r([l()],y.prototype,"activeTool",null),r([l({readOnly:!0})],y.prototype,"allLayerViews",void 0),r([l()],y.prototype,"groundView",void 0),r([l()],y.prototype,"animation",null),r([l()],y.prototype,"basemapView",void 0),r([l()],y.prototype,"center",null),r([l()],y.prototype,"defaultsFromMapSettings",null),r([l()],y.prototype,"defaultsFromMap",null),r([l()],y.prototype,"fatalError",void 0),r([l({type:Xt})],y.prototype,"extent",null),r([l(Wn(oo,"graphics"))],y.prototype,"graphics",void 0),r([l(Wn(ai,"analyses"))],y.prototype,"analyses",void 0),r([l({readOnly:!0,type:wn})],y.prototype,"heightModelInfo",null),r([l({readOnly:!0})],y.prototype,"interacting",null),r([l({readOnly:!0})],y.prototype,"navigating",null),r([l({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],y.prototype,"preconditionsReady",null),r([l({readOnly:!0})],y.prototype,"typeSpecificPreconditionsReady",void 0),r([l({type:L,readOnly:!0})],y.prototype,"layerViews",void 0),r([l()],y.prototype,"resolution",null),r([l({type:uo})],y.prototype,"magnifier",void 0),r([l({value:null,type:xr})],y.prototype,"map",null),r([l()],y.prototype,"padding",void 0),r([l({readOnly:!0})],y.prototype,"ready",void 0),r([l({type:si})],y.prototype,"spatialReference",null),r([l()],y.prototype,"spatialReferenceWarningDelay",void 0),r([l()],y.prototype,"stationary",null),r([l({readOnly:!0})],y.prototype,"supportsGround",void 0),r([l({type:Sr})],y.prototype,"timeExtent",null),r([l({type:String,nonNullable:!0})],y.prototype,"timeZone",null),r([l()],y.prototype,"tools",null),r([l()],y.prototype,"toolViewManager",void 0),r([l({readOnly:!0})],y.prototype,"type",void 0),r([l({type:Number})],y.prototype,"scale",void 0),r([l({readOnly:!0})],y.prototype,"updating",void 0),r([l({readOnly:!0})],y.prototype,"initialExtentRequired",void 0),r([l({readOnly:!0})],y.prototype,"initialExtent",null),r([l()],y.prototype,"cursor",null),r([l({readOnly:!0})],y.prototype,"input",void 0),r([l({type:To,nonNullable:!0})],y.prototype,"navigation",void 0),r([l()],y.prototype,"layerViewManager",void 0),r([l()],y.prototype,"analysisViewManager",void 0),r([l()],y.prototype,"selectionManager",void 0),r([l()],y.prototype,"width",void 0),r([l()],y.prototype,"height",void 0),r([l({readOnly:!0})],y.prototype,"resizing",void 0),r([l({value:null,readOnly:!0})],y.prototype,"size",null),r([l({readOnly:!0})],y.prototype,"suspended",void 0),r([l({readOnly:!0})],y.prototype,"viewEvents",void 0),r([l({readOnly:!0})],y.prototype,"persistableViewModels",void 0),r([l()],y.prototype,"_isValid",void 0),r([l()],y.prototype,"_readyCycleForced",void 0),r([l()],y.prototype,"_lockedSpatialReference",void 0),r([l()],y.prototype,"_userTimeZone",void 0),r([l()],y.prototype,"_lockedTimeZone",void 0),r([l()],y.prototype,"_userTimeExtent",void 0),r([l()],y.prototype,"_lockedTimeExtent",void 0),r([l({type:Ki})],y.prototype,"theme",void 0),r([l({readOnly:!0,type:Ki})],y.prototype,"effectiveTheme",null),y=be=r([_("esri.views.View")],y);const Vi=globalThis.$arcgis;Vi&&!Vi.views&&Object.defineProperty(Vi,"views",{configurable:!1,enumerable:!0,writable:!1,value:y.views});const gh=y;function yh(t){return t.layerViews}let Rt=class extends Ba{constructor(t){super(t),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=ui(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._resolver?.reject(new C("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._resolver?.resolve())}update(t,e){e||(e=to(t)?"waiting-for-target":"running"),this._set("target",t),this._set("state",e)}};r([l({readOnly:!0})],Rt.prototype,"done",null),r([l({readOnly:!0,type:String})],Rt.prototype,"state",void 0),r([l()],Rt.prototype,"target",void 0),Rt=r([_("esri.views.ViewAnimation")],Rt),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Rt||(Rt={}));const Qi=Rt;function xt(){return[1,0,0,1,0,0]}function _h(t){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function fh(t,e,i,n,s,o){return[t,e,i,n,s,o]}function vh(t,e){return new Float64Array(t,e,6)}const wh=xt();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:wh,clone:_h,create:xt,createView:vh,fromValues:fh},Symbol.toStringTag,{value:"Module"}));const ko=96,Eo=39.37,bh=180/Math.PI;function Co(t){return t.wkid?t:t.spatialReference||si.WGS84}function xn(t,e){return e.type?N(t,e.x,e.y):Se(t,e)}function Io(t){return Ys(t)}function fi(t,e,i=0){let n=t.width,s=t.height;if(i!==0){const h=gn(i),c=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));n=t.width*c+t.height*p,s=t.width*p+t.height*c}const o=Math.max(1,e[0]),a=Math.max(1,e[1]);return Math.max(n/o,s/a)*Ch(t.spatialReference)}async function Te(t,e,i,n){let s,o;if(!t||Array.isArray(t)&&!t.length)return null;if(L.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&typeof t[0]=="object"){const h=t.every(d=>"attributes"in d),c=t.some(d=>!d.geometry);let p=t;if(h&&c&&e&&e.allLayerViews){const d=new Map;for(const f of t){const T=f.layer,I=d.get(T)||[],E=f.attributes[T.objectIdField];E!=null&&I.push(E),d.set(T,I)}const m=[];d.forEach((f,T)=>{const I=e.allLayerViews.find(E=>E.layer.id===T.id);if(I&&"queryFeatures"in I){const E=T.createQuery();E.objectIds=f,E.returnGeometry=!0,m.push(I.queryFeatures(E))}});const u=await Promise.all(m),g=[];for(const f of u)if(f&&f.features&&f.features.length)for(const T of f.features)T.geometry!=null&&g.push(T.geometry);p=g}for(const d of p)n=await Te(d,e,i,n);return n}if(Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")s=new V(t);else if(t instanceof io)s=t;else if("geometry"in t){if(t.geometry)s=t.geometry;else if(t.layer){const h=t.layer,c=e.allLayerViews.find(p=>p.layer.id===h.id);if(c&&"queryFeatures"in c){const p=h.createQuery();p.objectIds=[t.attributes[h.objectIdField]],p.returnGeometry=!0,s=(await c.queryFeatures(p))?.features?.[0]?.geometry}}}if(s==null)return null;switch(s.type){case"point":o=new Xt({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":o=Zr(s);break;default:o=s.extent}if(!o)return null;yn()||_n(o.spatialReference,i)||await fn();const a=Le(o,i);if(!a)return null;if(n){const h=a.center,c=h.clone();c.x=Tn(h.x,n.center.x,i),c.x!==h.x&&a.centerAt(c),n=n.union(a)}else n=a;return n}function Th(t){if(t&&(!Array.isArray(t)||typeof t[0]!="number")&&(typeof t=="object"||Array.isArray(t)&&typeof t[0]=="object")){if("layer"in t&&t.layer?.minScale!=null&&t.layer.maxScale!=null){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every(e=>"layer"in e)){let e=0,i=0;for(const n of t){const s=n.layer;s?.minScale&&s.maxScale&&(e=s.minScalei?s.maxScale:i)}return e&&i?{min:e,max:i}:null}}}function us(t,e){const i=Co(t);return pi(i,e)||i.imageCoordinateSystem||e.imageCoordinateSystem?t:Le(t,e)}async function Mh(t,e){if(!t||!e)return new nt({targetGeometry:new V,scale:0,rotation:0});let i=e.spatialReference;const{constraints:n,padding:s,viewpoint:o,size:a}=e,h=[s?a[0]-s.left-s.right:a[0],s?a[1]-s.top-s.bottom:a[1]];let c=null;t instanceof nt?c=t:t.viewpoint?c=t.viewpoint:t.target&&t.target.declaredClass==="esri.Viewpoint"&&(c=t.target);let p=null;c?.targetGeometry?p=c.targetGeometry:t instanceof Xt?p=t:t instanceof io?p=await Te(t,e,i):t&&(p=await Te(t.center,e,i)||await Te(t.target,e,i)||await Te(t,e,i)),!p&&o?.targetGeometry?p=o.targetGeometry:!p&&e.extent&&(p=e.extent),i||(i=Co(e.spatialReference||e.extent||p)),yn()||pi(p.spatialReference,i)||_n(p.spatialReference,i)||await fn();const d=us(p,i),m="center"in d?d.center:d;e.pickClosestTarget!==!1&&m.type==="point"&&o.targetGeometry?.type==="point"&&(m.x=Tn(m.x,o.targetGeometry.x,m.spatialReference));let u=0;c?u=c.rotation:t.hasOwnProperty("rotation")?u=t.rotation:o&&(u=o.rotation);let g=0;g=c?.targetGeometry!=null&&c.targetGeometry.type==="point"?c.scale:"scale"in t&&t.scale?t.scale:"zoom"in t&&t.zoom!==-1&&n&&n.effectiveLODs?n.zoomToScale(t.zoom):Array.isArray(p)||p.type==="point"||p.type==="extent"&&p.width===0&&p.height===0?o.scale:fi(us(p.extent,i),h,u);const f=Th(t.target??t);f&&(f.min&&f.ming&&(g=f.max));let T=new nt({targetGeometry:m,scale:g,rotation:u});return n&&(T=n.fit(T),n.constrainByGeometry(T),n.rotationEnabled||(T.rotation=o.rotation)),T}function G(t,e){const i=t.targetGeometry,n=e.targetGeometry;return i.x=n.x,i.y=n.y,i.spatialReference=n.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function xh(t,e,i){return i?N(t,.5*(e[0]-i.right+i.left),.5*(e[1]-i.bottom+i.top)):_i(t,e,.5)}const Ph=function(){const t=O();return function(e,i,n){const s=i.targetGeometry;xn(t,s);const o=.5*ue(i);return e.xmin=t[0]-o*n[0],e.ymin=t[1]-o*n[1],e.xmax=t[0]+o*n[0],e.ymax=t[1]+o*n[1],e.spatialReference=s.spatialReference,e}}();function Sh(t,e,i,n,s){return Ji(t,e,i.center),t.scale=fi(i,n),s?.constraints?.constrain(t),t}function kh(t,e,i,n){return kn(t,e,i,n),ho(t,t)}const Do=function(){const t=O();return function(e,i,n){return ao(e,Ih(e,i),xh(t,i,n))}}(),Eh=function(){const t=xt(),e=O();return function(i,n,s,o){const a=ue(n),h=Pn(n);return N(e,a,a),Hr(t,e),bn(t,t,h),oi(t,t,Do(e,s,o)),oi(t,t,[0,o.top-o.bottom]),N(i,t[4],t[5])}}();function ue(t){return t.scale*Ro(t.targetGeometry?.spatialReference)}function Ro(t){return t!=null&&eo(t)?1/(Io(t)*Eo*ko):1}function Pn(t){return ro(t.rotation)||0}function Ch(t){return eo(t)?Io(t)*Eo*ko:1}function Ih(t,e){return _i(t,e,.5)}const Sn=function(){const t=O(),e=O(),i=O();return function(n,s,o,a,h,c){return Vr(t,s),_i(e,o,.5*c),N(i,1/a*c,-1/a*c),co(n,e),h&&bn(n,n,h),lo(n,n,i),oi(n,n,t),n}}(),kn=function(){const t=O();return function(e,i,n,s){const o=ue(i),a=Pn(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,a,s)}}(),Dh=function(){const t=O();return function(e,i,n,s){const o=ue(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,0,s)}}();function Lo(t){const e=Bs(t);return e?e.valid[1]-e.valid[0]:0}function Rh(t,e){return Math.round(Lo(t)/e)}const Lh=function(){const t=O(),e=O(),i=[0,0,0];return function(n,s,o){qi(t,n,s),qn(t,t),qi(e,n,o),qn(e,e),Ir(i,t,e);let a=Math.acos(Dr(t,e)/(Bn(t)*Bn(e)))*bh;return i[2]<0&&(a=-a),isNaN(a)&&(a=0),a}}(),Vh=function(){const t=O();return function(e,i,n,s){const o=e.targetGeometry;return G(e,i),Eh(t,i,n,s),o.x+=t[0],o.y+=t[1],e}}(),Ji=function(t,e,i){G(t,e);const n=t.targetGeometry;return n.x=i.x,n.y=i.y,n.spatialReference=i.spatialReference,t},Oh=function(){const t=O();return function(e,i,n,s,o){o||(o="center"),ao(t,n,s),_i(t,t,.5);const a=t[0],h=t[1];switch(o){case"center":N(t,0,0);break;case"left":N(t,-a,0);break;case"top":N(t,0,h);break;case"right":N(t,a,0);break;case"bottom":N(t,0,-h);break;case"top-left":N(t,-a,h);break;case"bottom-left":N(t,-a,-h);break;case"top-right":N(t,a,h);break;case"bottom-right":N(t,a,-h)}return vi(e,i,t),e}}();function Mu(t,e,i){return G(t,e),t.rotation+=i,t}function Ah(t,e,i){return G(t,e),t.rotation=i,t}const zh=function(){const t=O();return function(e,i,n,s,o){return G(e,i),isNaN(n)||n===0||(Oo(t,s,i,o),e.scale=i.scale*n,Ao(t,t,e,o),vi(e,e,N(t,t[0]-s[0],s[1]-t[1]))),e}}();function ms(t,e,i){return G(t,e),t.scale=i,t}const Vo=function(){const t=O();return function(e,i,n,s,o,a){return G(e,i),isNaN(n)||n===0||(Oo(t,o,i,a),e.scale=i.scale*n,e.rotation+=s,Ao(t,t,e,a),vi(e,e,N(t,t[0]-o[0],o[1]-t[1]))),e}}(),xu=function(){const t=O(),e=O();return function(i,n,s,o,a,h,c){return Do(e,h,c),Rr(t,a,e),o?Vo(i,n,s,o,t,h):zh(i,n,s,t,h)}}(),Oo=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kh(t,n,s,1))}}(),Ao=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kn(t,n,s,1))}}(),vi=function(){const t=O(),e=xt();return function(i,n,s){G(i,n);const o=ue(n),a=i.targetGeometry;return Or(e,Pn(n)),lo(e,e,Cr(o,o)),Tt(t,s,e),a.x+=t[0],a.y+=t[1],i}}();function Ye(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function Nh(t){const e=new Float32Array(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Fh(t,e,i,n,s,o,a,h,c){const p=new Float32Array(9);return p[0]=t,p[1]=e,p[2]=i,p[3]=n,p[4]=s,p[5]=o,p[6]=a,p[7]=h,p[8]=c,p}function Hh(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:Nh,create:Ye,createView:Hh,fromValues:Fh},Symbol.toStringTag,{value:"Module"}));function Zh(t){return t instanceof Float32Array&&t.length>=2}function Gh(t){return Array.isArray(t)&&t.length>=2}function Oi(t){return Zh(t)||Gh(t)}var tn;const ut=[0,0];let _t=tn=class extends cn{constructor(t){super(t),this._viewpoint2D={center:O(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Xt,this.id=0,this.inverseTransform=xt(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=xt(),this.transformNoRotation=xt(),this.displayMat3=Ye(),this.displayViewMat3=Ye(),this.viewMat3=Ye(),this.viewMat2d=zr(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,i=t.targetGeometry;e.center[0]=i.x,e.center[1]=i.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=i.spatialReference}this._update()}get visibleArea(){const[t,e]=this.size;return[this.toMap([0,0],0,0),this.toMap([0,0],0,e),this.toMap([0,0],t,e),this.toMap([0,0],t,0)]}copy(t){const e=this.size,i=this.viewpoint;return i&&e?(this.viewpoint=G(i,t.viewpoint),this._set("size",Se(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new tn({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,i){return Oi(e)?Tt(t,e,this.inverseTransform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.inverseTransform))}toScreen(t,e,i){return Oi(e)?Tt(t,e,this.transform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transform))}toScreenNoRotation(t,e,i){return Oi(e)?Tt(t,e,this.transformNoRotation):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transformNoRotation))}wrapMapCoordinate(t,e){Se(t,e);const[i]=e,[n]=this.center,{extent:s,spatialReference:o}=this;let{xmin:a,xmax:h}=s;if(o.isWrappable){const c=Lo(o)/2;a=Math.max(a,n-c),h=Math.min(h,n+c)}return(ih)&&(t[0]=Tn(i,n,o)),t}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size");return Sn(t,i,s,e,0,n),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:n}=this._viewpoint2D,s=this._get("pixelRatio")||1,o=this._get("size"),a=new nt({targetGeometry:new V(t[0],t[1],e),scale:i,rotation:n});if(this._set("viewpoint",a),!o||!e||!i)return;this.resolution=ue(a),this.rotation=n,this.scale=i,this.spatialReference=e,Se(this.center,t);const h=o[0]!==0?2/o[0]:0,c=o[1]!==0?-2/o[1]:0;Gr(this.displayMat3,h,0,0,0,c,0,-1,1,1);const p=$r(this.viewMat3),d=Xn(o[0]/2,o[1]/2),m=Xn(-o[0]/2,-o[1]/2),u=ro(n);Yn(p,p,d),Wr(p,p,u),Yn(p,p,m),Ur(this.displayViewMat3,this.displayMat3,p);const g=co(this.viewMat2d,d);return bn(g,g,u),oi(g,g,m),Ph(this.extent,a,o),kn(this.transform,a,o,s),ho(this.inverseTransform,this.transform),Dh(this.transformNoRotation,a,o,s),this.worldScreenWidth=Rh(this.spatialReference,this.resolution),this._set("id",this.id+1),this.notifyChange("visibleArea"),this}};r([l({readOnly:!0})],_t.prototype,"id",void 0),r([l({value:1,json:{write:!0}})],_t.prototype,"pixelRatio",null),r([l({json:{write:!0}})],_t.prototype,"size",null),r([l()],_t.prototype,"spatialReference",void 0),r([l({type:nt,json:{write:!0}})],_t.prototype,"viewpoint",null),r([l({readOnly:!0})],_t.prototype,"visibleArea",null),_t=tn=r([_("esri.views.2d.ViewState")],_t);const gs=_t;var en,nn;let Mt=en=class extends M{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new en({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};r([l()],Mt.prototype,"left",void 0),r([l()],Mt.prototype,"top",void 0),r([l()],Mt.prototype,"right",void 0),r([l()],Mt.prototype,"bottom",void 0),Mt=en=r([_("esri.views.2d.PaddedViewState.Padding")],Mt);let oe=nn=class extends gs{constructor(...t){super(...t),this.paddedViewState=new gs,this._updateContent=(()=>{const e=O();return()=>{const i=this._get("size"),n=this._get("padding");if(!i||!n)return;const s=this.paddedViewState;N(e,n.left+n.right,n.top+n.bottom),qi(e,i,e),Se(s.size,e);const o=s.viewpoint;o&&(this.viewpoint=o)}})(),this.addHandles(w(()=>[this.size,this.padding],()=>this._updateContent(),Ee)),this.padding=new Mt,this.size=[0,0]}set padding(t){this._set("padding",t||new Mt)}set viewpoint(t){if(t){this.paddedViewState.viewpoint=t;let e=t;const i=this._get("padding");i&&(e=Vh(t.clone(),t,this._get("size"),i));const{targetGeometry:n,rotation:s,scale:o}=e,{x:a,y:h,spatialReference:c}=n,p=this._viewpoint2D;p.center[0]=a,p.center[1]=h,p.rotation=s,p.scale=o,p.spatialReference=c,this._update()}}clone(){return new nn({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};r([l()],oe.prototype,"paddedViewState",void 0),r([l({type:Mt})],oe.prototype,"padding",null),r([l()],oe.prototype,"viewpoint",null),oe=nn=r([_("esri.views.2d.PaddedViewState")],oe);const En=oe;let ys=class{constructor(t){this._view=t,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0})}get view(){return this._view}get size(){const[t,e]=this._view.size;return Math.sqrt(t*t+e*e)}get scale(){return this.viewpoint.scale}get rotation(){return this.viewpoint.rotation}get center(){return this.viewpoint.targetGeometry}get scaleToResolutionFactor(){return Ro(this.center.spatialReference)}pixelsPerPanAtZoom(t){return 1/(t*this.scaleToResolutionFactor)}zoomAtPixelsPerPan(t){return 1/(t*this.scaleToResolutionFactor)}pixelsPerRotate(){return this.size/2}compareTo(t,e){e.pan=dr(this.center,t.center);let i=Math.abs(t.rotation-this.rotation);i=i>=180?360-i:i,e.rotate=gn(i),e.sourceZoom=this.scale,e.targetZoom=t.scale}interpolate(t,e,i){const{pan:n,rotate:s,zoom:o,zoomOffset:a}=i,{center:h}=this;h.spatialReference=t.center.spatialReference,h.x=Fe(t.center.x,e.center.x,n),h.y=Fe(t.center.y,e.center.y,n),this.viewpoint.scale=Fe(t.scale,e.scale+a,o);let c=t.rotation;const p=e.rotation;Math.abs(p-c)>=180&&(c+=360*(ct*t,$h=t=>1-zo(1-t),Wh=t=>2**(10*(t-1)),Uh=t=>1-Wh(1-t);function jh(t){const e=2*(t-Math.sqrt((t-1)*t)),i=e/2/t;return n=>ni1e-5}get hasPan(){return this.compared.pan>xi()}get hasFov(){return Math.abs(this.compared.fov)>xi()}get hasRotate(){return this.compared.rotate>xi()}},Yh=class{constructor(){this.pan=0,this.rotate=0,this.zoom=0,this.fov=0,this.zoomOffset=0}},Xh=class{constructor(){this.segments=new Array}get time(){return this.segments.reduce((t,e)=>X(t+e.time),X(0))}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),t*=this.time;let i=0,n=0;const s=this.definition,o=this.segments.reduce((a,h)=>a||h.definition.hasZoom,!1);for(let a=0;aMath.abs(p-u)?d:p;e.zoomOffset=f-g,e.zoom=(m-u)/(f-u)}else e.zoom=1;return e}t-=h.time,i+=c.compared.pan,n+=c.compared.rotate}}segmentInterpolateComponentsAt(t,e,i){t.interpolateComponentsAt(e,i)}},Ai=class{get time(){return this._time}constructor(t){t&&this.update(t)}update(t){t&&(this.definition?this.definition.copyFrom(t):this.definition=t.clone()),this._updatePrecomputedVariables(),this._updatePixelFlow()}_updatePrecomputedVariables(){const t=this.definition,e=t.compared,i=e.sourceZoom,n=e.targetZoom;this._zoomSign=i>n?1:-1,this._panPixelsAtSource=e.pan*t.source.pixelsPerPanAtZoom(i);const s=(t.source.pixelsPerRotate()+t.target.pixelsPerRotate())/2;this._rotatePixels=e.rotate*s}_updatePixelFlow(){const t=this.definition.compared.sourceZoom,e=this.definition.compared.targetZoom,{hasZoom:i,hasPan:n,hasRotate:s}=this.definition;let o=0,a=0;i&&(n&&(o=(e/t-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),s&&(a=this._zoomSign*(Math.log(t/e)/Math.LN2)*this.definition.halfWindowSize/this._rotatePixels)),this._zoomPixelFlow=0,this._panPixelFlow=0,this._rotatePixelFlow=0;const h=this.definition.desiredPixelFlow;if(i&&n&&s){const c=o+a+o*a;this._zoomPixelFlow=o*a/c*h,this._panPixelFlow=a/c*h,this._rotatePixelFlow=o/c*h}else if(i&&n){const c=1+o;this._zoomPixelFlow=o/c*h,this._panPixelFlow=1/c*h}else if(i&&s){const c=1+a;this._zoomPixelFlow=a/c*h,this._rotatePixelFlow=1/c*h}else if(n&&s){const c=this._panPixelsAtSource/this._rotatePixels,p=1+c;this._panPixelFlow=c/p*h,this._rotatePixelFlow=1/p*h}else n?this._panPixelFlow=h:i?this._zoomPixelFlow=h:s&&(this._rotatePixelFlow=h);if(this._time=X(Math.max(this.rotateTime,this.zoomTime,this.panTime)),this.fovTime>this._time){const c=this.fovTime/this._time;this._time=this.fovTime,this._zoomPixelFlow/=c,this._panPixelFlow/=c,this._rotatePixelFlow/=c}}get rotateTime(){return this.definition.hasRotate?X(this._rotatePixels/this._rotatePixelFlow):X(0)}get zoomTime(){return this.definition.hasZoom?X(this._zoomSign*(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2)*this.definition.halfWindowSize/this._zoomPixelFlow):X(0)}get fovTime(){return this.definition.hasFov?X(Math.abs(this.definition.compared.fov)/Qh):X(0)}get panTime(){if(!this.definition.hasPan)return X(0);if(this.definition.hasZoom){const t=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2,e=t*this._panPixelsAtSource;return X(Math.log(e*(this._zoomPixelFlow/this._panPixelFlow)+1)/(t*this._zoomPixelFlow))}return X(this._panPixelsAtSource/this._panPixelFlow)}_interpolateComponentsZoom(t){if(t===0||t===1)return t;if(this.definition.hasZoom){const e=this.definition.compared.sourceZoom,i=this.definition.compared.targetZoom;return(e*(e/i)**-t-e)/(i-e)}return t}_interpolateComponentsFov(t){if(t===0)return this.definition.segmentStart;if(t===1)return this.definition.segmentEnd;if(this.definition.hasFov){const{segmentStart:e,segmentEnd:i}=this.definition;return e+t*(i-e)}return this.definition.segmentStart}_interpolateComponentsPan(t){if(t===0||t===1)return t;if(this.definition.hasPan&&this.definition.hasZoom){const e=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*(this._panPixelFlow*(2**(e*t*this._time)-1))/(e*Math.LN2)}return t}_interpolateComponentsRotate(t){return t}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),e.zoom=this._interpolateComponentsZoom(t),e.pan=this._interpolateComponentsPan(t),e.rotate=this._interpolateComponentsRotate(t),e.zoomOffset=0,e.fov=this._interpolateComponentsFov(t)}};const Qh=gn(45);function Jh(t,e,i){const n=e-t.compared.sourceZoom,s=t.halfWindowPanAtZoom(n);return-t.halfWindowSize*(i.ascensionFactor*Math.LN2*t.compared.pan+s)*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2*s)}function tc(t,e,i){const n=1/e,s=Math.log(t.compared.sourceZoom*n),o=1/t.desiredPixelFlow,a=1/Math.LN2,h=e-t.compared.sourceZoom,c=1/h,p=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(h))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*o*a*c*p-t.halfWindowSize*s*o*a*c+t.halfWindowSize*s*o*a*p/(h*h)}function ec(t,e,i){const n=e-t.compared.sourceZoom,s=1/n,o=1/e,a=Math.log(t.compared.sourceZoom*o),h=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(n))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h+2*s*a+2*o-2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function ic(t,e){return-t.halfWindowSize*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2)}function nc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function sc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function oc(t,e,i){return-t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e))}function ac(t,e,i){return t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e))}function rc(t,e,i){return-2*t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e*e))}function lc(t,e,i){return t.halfWindowSize*(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*t.halfWindowPanAtZoom(-e+t.compared.targetZoom))}function hc(t,e,i){const n=Math.log(e/t.compared.targetZoom),s=1/t.desiredPixelFlow,o=1/Math.LN2,a=-e+t.compared.targetZoom,h=1/a,c=(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return-t.halfWindowSize*n*s*o*h+t.halfWindowSize*n*s*o*c/(a*a)+t.halfWindowSize*s*o*h*c/e}function cc(t,e,i){const n=e-t.compared.targetZoom,s=1/n,o=1/e,a=Math.log(e/t.compared.targetZoom),h=(t.halfWindowPanAtZoom(e)+i.descensionFactor*Math.LN2*t.compared.pan-t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h-2*s*a+2*o+2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function pc(t,e){return t.halfWindowSize*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2)}function dc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function uc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function mc(t){const e=t.compared.sourceZoom-t.compared.targetZoom;if(e===0)return t.compared.pan*t.halfWindowSize/(t.desiredPixelFlow*t.halfWindowPanAtZoom(t.compared.sourceZoom));const i=Math.LN2*t.compared.pan,n=e,s=t.halfWindowPanAtZoom(n),o=t.halfWindowSize*Math.log(t.compared.sourceZoom/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*s);return t.compared.sourceZoom<=t.compared.targetZoom?o*(i-s):o*(i+s)}function gc(t,e){let i=yc(t,e);const n={ascensionFactor:e.ascensionFactor!=null?e.ascensionFactor:.5,descensionFactor:e.descensionFactor!=null?e.descensionFactor:.5},s=n.ascensionFactor===0,o=n.descensionFactor===0,a=s?ic:Jh,h=s?nc:tc,c=s?sc:ec,p=o?pc:lc,d=o?dc:hc,m=o?uc:cc,u=x=>a(t,x,n)+oc(t,x,n)+p(t,x,n),g=x=>h(t,x,n)+ac(t,x,n)+d(t,x,n),f=x=>c(t,x,n)+rc(t,x,n)+m(t,x,n);let T=u(i);const I=mc(t);let E;const ot=e.maximumIterations||20,S=e.maximumDistance!=null?e.maximumDistance:1/0;for(E=0;Ex&&($+=x);const K=$/f(i);if(isNaN(K)||i>=S&&K<0){if(!isFinite(S))return null;i=S,T=u(i);break}if(i-=K,iI*(1-.3)||i0&&(n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.copyFrom(this.definition),n.definition.compared.sourceZoom=t,n.definition.compared.targetZoom=t,n.definition.compared.pan=this.definition.compared.pan*h,n.definition.compared.rotate=this.definition.compared.rotate*h,n.definition.segmentStart=i.definition.segmentEnd,n.definition.segmentEnd=i.definition.segmentEnd+h,n.update(),this.segments.push(n)),s.definition?s.definition.copyFrom(this.definition):s.definition=this.definition.clone(),s.definition.compared.sourceZoom=t,s.definition.compared.pan=this.definition.compared.pan*a,s.definition.compared.rotate=this.definition.compared.rotate*a,s.definition.segmentStart=o+h,s.update(),this._descensionSegment=s,this.segments.push(s)}_updateWithoutApex(){const[t]=this._preallocSegments;t.update(this.definition),this.segments.push(t)}};const fc=new Yh;let vc=class{get time(){return this._time}get isLinear(){return this.path.segments.length===1}constructor(t){this._time=it(0),this._easing=_s,this.definition=new Kh(t),this.path=new _c}update(t,e,i){this.definition.update(t,e,i),this.path.update(this.definition,i),this._time=this._applyTimeSettings(ur(isFinite(this.path.time)?this.path.time:X(0)),i),this._easing=i.easing??(this._time>=1e3?_s:Uh)}cameraAt(t,e){t=Math.min(Math.max(0,t),1),t=this._normalizedEasing(t);const i=this.path.interpolateComponentsAt(t,fc);e.interpolate(this.definition.source,this.definition.target,i)}_normalizedEasing(t){const e=this._easing(0,this._time),i=this._easing(1,this._time);return(this._easing(t,this._time)-e)/(i-e)}_applyTimeSettings(t,e){const i=e.speedFactor!=null?e.speedFactor:1,n=e.minDuration??De.minDuration/i,s=e.maxDuration??De.maxDuration/i;return t=e.duration!=null?e.duration:it(Math.min(Math.max(t/i,n),s))}};const fs=2e3,wc=64;let bc=class{constructor(t){this._view=t,this._animation=new vc(()=>new ys(this._view)),this._current=new ys(this._view)}get _source(){return this._animation.definition.source}get _target(){return this._animation.definition.target}get duration(){return this._animation.time}get animation(){return this._animation}update(t,e,i={}){G(this._current.viewpoint,t),G(this._source.viewpoint,t),G(this._target.viewpoint,e),this._animation.update(this._source,this._target,i)}applyRatio(t,e){this._animation.cameraAt(e,this._current),G(t,this._current.viewpoint)}},ae=class extends M{constructor(t){super(t),this._animation=null,this._destinationViewState=new En,this.updateFunction=null,this.easing=jr.ease,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0}),this._updateTask=de({postRender:this._postRender.bind(this)}),this._updateTask.pause(),this._transition=new bc(t.view)}destroy(){this._updateTask=st(this._updateTask)}get animation(){return this._animation}set animation(t){this._animation=t,this.view.animation=t}animate(t,e,i){this.stop();const n=this.viewpoint;G(n,e);const s=(typeof i?.easing=="string"?qr(i.easing):i?.easing)||this.easing,o=t.target;this._transition.update(this.viewpoint,o,{apex:{maximumDistance:Math.min(Math.min(e.scale,o.scale)*wc,this.view.constraints.effectiveMinScale),desiredSlope:5e-8},duration:i?.duration,maxDuration:i?.animationMode==="auto"?it(1/0):i?.maxDuration??No.maxDuration,speedFactor:i?.speedFactor,easing:typeof s=="function"?h=>s(h):void 0}),i?.animationMode==="auto"&&(this._destinationViewState.copy(this.view.state),this._destinationViewState.viewpoint=o,Tc(this._transition.animation,i,this.view.state,this._destinationViewState)||this._transition.update(this.viewpoint,o,{duration:it(0)}));const a=()=>{this.animation===t&&this._updateTask&&(t.state==="finished"&&(this._transition.applyRatio(this.viewpoint,1),this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return t.when(a,a),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinuous(t,e){this.stop(),this.updateFunction=e,this.viewpoint=t;const i=new Qi({target:t.clone()}),n=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){const e=this.animation;if(e&&e.state!==Qi.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime),this.animation?.update(this.viewpoint);else{const i=performance.now()-this._startTime,n=this._transition.duration,s=n>0?i/n:1,o=s>=1;this._transition.applyRatio(this.viewpoint,s),o&&this.animation?.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};function Tc(t,e,i,n){if(e?.duration!=null)return!0;const{time:s,isLinear:o}=t,a=e?.speedFactor||1,h=e?.maxDuration??No.maxDuration/a;if(z("esri-goto-debug")&&(console.log("speed factor:",a),console.log("adjusted duration: ",s),console.log("adjusted max duration: ",h),console.log("is linear:",o)),s>h)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: animations must be shorter than ${h/1e3}s`),!1;if(o){const c=O(),p=H(...n.toScreen(c,...i.center)),d=H(...i.toScreen(c,...n.center)),m=d!=null&&d.x>-(1.5-.5)*i.size[0]&&d.x<(1.5+.5)*i.size[0]&&d.y>-(1.5-.5)*i.size[1]&&d.y<(1.5+.5)*i.size[1],u=p!=null&&p.x>-(1.5-.5)*n.size[0]&&p.x<(1.5+.5)*n.size[0]&&p.y>-(1.5-.5)*n.size[1]&&p.y<(1.5+.5)*n.size[1];if(z("esri-goto-debug")&&(console.log(`dest is within ${1.5} screens at start view:`,m),console.log(`start is within ${1.5} screens at dest view:`,u)),s>fs/a&&!m&&!u)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: linear animations must be... + - shorter than ${fs/1e3/a}s, or + - shorter than ${h/1e3}s and the destination is close enough to the starting screen, or + - shorter than ${h/1e3}s and the start point is close enough to the destination screen`),!1}return!0}r([l()],ae.prototype,"easing",void 0),r([l()],ae.prototype,"view",void 0),r([l()],ae.prototype,"viewpoint",void 0),ae=r([_("esri.views.2d.AnimationManager")],ae);const Mc=ae;let xc=class{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=Br(),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),this.view.animation?.target==null||to(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=e=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:i,graphicsView:n,labelManager:s,state:{id:o}}=this.view;i.forEach(this._updateLayerView,this),s!=null&&(s.lastUpdateId!==o&&(s.viewChange(),s.lastUpdateId=o),s.updateRequested&&s.processUpdate(this._updateParameters)),n!=null&&(n.lastUpdateId!==o&&(n.viewChange(),n.lastUpdateId=o),n.updateRequested&&n.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=Pi.ANIMATING:this.view.interacting?this._scheduler.state=Pi.INTERACTING:this._scheduler.state=Pi.IDLE,this._scheduler.updateBudget(e)&&this._scheduler.frame()}}destroy(){this.stop(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new En,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=w(()=>t.stationary,e=>{this.stationary=e,this.requestFrame()}),this._frameTaskHandle=de(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,i=t.lastUpdateId;i!=null&&(this.stationary||t.moving)||(t.moving=!0),i!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}},Xe=class extends M{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,e){if(!t)return void D.getLogger(this).error("#goTo()","target cannot be null or undefined");const i=new Qi;this.view.animation=i,await pn(()=>this.view.ready,e);const n={...e,animate:e?.animate??!wo(),animationMode:e?.animationMode??"auto"},{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d}=this.view,m=Mh(t,{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d,pickClosestTarget:e?.pickClosestTarget??!0});return i?.update(m),this._gotoTask={},n.animate?this._gotoAnimated(m,n):this._gotoImmediate(m,n)}_gotoImmediate(t,e){const i=this._gotoTask,n=this.view.animation,s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(i,n,s,e)}_gotoAnimated(t,e){const i=this._gotoTask,n=this.view.animation;if(!n)return Promise.resolve();const s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");return n.update(o),this.view.animationManager.animate(n,this.view.viewpoint,e),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(i,n,s,e)}_cancellableGoTo(t,e,i,n){const s=()=>t===this._gotoTask;return Ka(i,n).finally(()=>{s()&&(e.done||e.stop())})}};r([l({constructOnly:!0})],Xe.prototype,"view",void 0),Xe=r([_("esri.views.2d.GoToManager")],Xe);function k(){return Promise.all([b(()=>import("./webglDeps-Bgavuh0h-8J_tuBZH.js"),__vite__mapDeps([139,140,1,2,133,132,141,142,143,144]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-CEta8iLu.js"),__vite__mapDeps([145,1,2,114,43,44,22,45,146,147,56,148,28,27,131,110,111,112,113,76,109,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,120,154,126,144,155,156,143,130,157,158,25,20,21,159,160,161,162,57,37,135,163,164,42,46,165,166,167,139,142,168,169,170,171,63,41,172,173,59,60,51,52,49,53,174,90,40,32,175,176,177,178,179,134,180,55,181,182,183,184,185,186,187,188,189,190,191,192,8,117,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,39,136]),import.meta.url)])}const ye=()=>k().then(()=>b(()=>import("./TileLayerView2D-CT-Yu10P-D652aaoE.js"),__vite__mapDeps([193,1,2,123,43,44,22,45,27,28,164,131,146,147,56,148,110,111,112,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,120,42,46,158,25,20,21,156,144,143,126,130,157,159,160,161,162,57,167,168,169,170,171,63,41,172,173,59,60,51,52,49,53,174,90,40,32,55,154,155,37,135,165,166,176,177,178,184,185,194,195,189,196,116,197,187,188,198,199,200,201,62,202,191,203,204,205,206,129,8,117,118,119,4,5,121,16,17,18,19,36,122,75,69,70,124,128,134,39,136]),import.meta.url)),zt=()=>k().then(()=>b(()=>import("./FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js"),__vite__mapDeps([207,1,2,36,158,25,20,21,22,162,56,57,86,11,12,13,14,208,61,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url).then(t=>t.F)),vs={"base-dynamic":()=>k().then(()=>b(()=>import("./BaseDynamicLayerView2D-AQ-6l0DU-BgLvSwS3.js"),__vite__mapDeps([210,1,2,211,156,131,150,28,133,132,141,140,151,127,144,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,212,118,119,195,198,8,117,59,60,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,129,134,135,39,136]),import.meta.url)),"base-tile":ye,"bing-maps":ye,catalog:()=>k().then(()=>b(()=>import("./CatalogLayerView2D-DaUVeBuS-DL2YF1D2.js"),__vite__mapDeps([213,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),"catalog-dynamic-group":()=>k().then(()=>b(()=>import("./CatalogDynamicGroupLayerView2D-Cf-H7gda-IDF2ytK8.js"),__vite__mapDeps([214,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),"catalog-footprint":()=>k().then(()=>b(()=>import("./CatalogFootprintLayerView2D-C0bBWVdF-B8ZCfrrR.js"),__vite__mapDeps([215,1,2,207,36,158,25,20,21,22,162,56,57,86,11,12,13,14,208,61,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url)),csv:zt,"geo-rss":()=>k().then(()=>b(()=>import("./GeoRSSLayerView2D-BLTYupUX-C7pkROGe.js"),__vite__mapDeps([216,1,2,30,31,23,32,33,34,35,36,37,38,29,39,40,41,42,43,44,22,45,27,28,46,47,61,12,13,196,158,25,20,21,116,120,186,187,188,131,146,147,56,148,110,111,112,113,76,109,114,115,11,14,127,149,150,133,132,141,140,151,152,153,125,189,156,144,143,126,130,157,159,160,161,162,57,154,155,135,51,52,49,53,184,171,63,172,173,59,60,174,90,185,8,117,118,119,4,5,121,16,17,18,19,122,75,123,69,70,124,128,129,134,136]),import.meta.url)),feature:zt,geojson:zt,parquet:zt,graphics:()=>k().then(()=>b(()=>import("./GraphicsLayerView2D-CGXlTqHO--x-cniL0.js"),__vite__mapDeps([217,1,2,196,158,25,20,21,22,116,120,186,187,188,131,146,147,56,148,28,27,110,111,112,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,162,57,154,155,37,135,51,52,49,53,184,40,41,42,43,46,171,63,172,173,59,60,174,90,32,185,209,8,117,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,134,39,136]),import.meta.url)),group:()=>k().then(()=>b(()=>import("./GroupLayerView2D-BR-kLeLa-BPkZIp1k.js"),__vite__mapDeps([218,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),imagery:()=>k().then(()=>b(()=>import("./ImageryLayerView2D-CVDvTIGY-C8PDlzd1.js"),__vite__mapDeps([219,1,2,123,220,140,133,132,144,151,221,156,131,150,28,141,127,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,184,40,41,146,147,148,27,149,152,153,44,45,42,43,46,171,63,172,173,59,60,51,52,49,53,174,90,32,154,155,37,135,185,197,187,188,189,211,195,212,118,119,222,208,206,198,8,117,4,5,121,16,17,18,19,36,122,75,69,70,124,128,129,134,39,136]),import.meta.url)),"imagery-tile":()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-BvGHSsMi.js"),__vite__mapDeps([223,1,2,224,220,140,133,132,144,151,221,156,131,150,28,141,127,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,225,189,118,119,226,222,59,60,129,135,208,206,198,8,117,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,134,39,136]),import.meta.url)),kml:()=>k().then(()=>b(()=>import("./KMLLayerView2D-hWgNYT5J-G6dB1WHu.js"),__vite__mapDeps([227,1,2,59,60,228,30,31,23,32,33,34,35,36,37,38,29,39,40,41,42,43,44,22,45,27,28,46,47,61,12,13,49,123,195,126,127,158,25,20,21,132,133,211,156,131,150,141,140,151,144,143,110,111,112,113,76,109,114,115,11,14,130,157,159,160,161,125,162,56,57,196,116,120,186,187,188,146,147,148,149,152,153,189,154,155,135,51,52,53,184,171,63,172,173,174,90,185,222,175,139,142,176,177,178,170,164,179,225,8,117,118,119,4,5,121,16,17,18,19,122,75,69,70,124,128,129,134,136]),import.meta.url)),"knowledge-graph":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-DTGORV5F.js"),__vite__mapDeps([229,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),"link-chart":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-DTGORV5F.js"),__vite__mapDeps([229,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),"knowledge-graph-sublayer":zt,"map-image":()=>k().then(()=>b(()=>import("./MapImageLayerView2D-LI7T-1xm-C9rclF9a.js"),__vite__mapDeps([230,1,2,123,211,156,131,150,28,133,132,141,140,151,127,144,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,184,40,41,146,147,148,27,149,152,153,44,45,42,43,46,171,63,172,173,59,60,51,52,49,53,174,90,32,154,155,37,135,185,197,187,188,189,212,118,119,195,231,191,203,205,208,198,199,200,201,62,202,204,206,8,117,4,5,121,16,17,18,19,36,122,75,69,70,124,128,129,134,39,136]),import.meta.url)),"map-notes":()=>k().then(()=>b(()=>import("./MapNotesLayerView2D-EusnP8A_-CDAqHlRM.js"),__vite__mapDeps([232,1,2,196,158,25,20,21,22,116,120,186,187,188,131,146,147,56,148,28,27,110,111,112,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,162,57,154,155,37,135,51,52,49,53,184,40,41,42,43,46,171,63,172,173,59,60,174,90,32,185,8,117,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,134,39,136]),import.meta.url)),media:()=>k().then(()=>b(()=>import("./MediaLayerView2D-COWFkA3m-u82xL1PC.js"),__vite__mapDeps([233,1,2,31,23,32,33,34,35,36,37,38,30,29,39,40,41,42,43,44,22,45,27,28,46,47,234,59,60,185,52,126,235,112,130,164,131,146,147,56,148,110,111,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,120,158,25,20,21,156,144,143,157,159,160,161,162,57,167,168,169,170,171,63,172,173,51,49,53,174,90,55,154,155,135,165,166,176,177,178,184,181,182,236,196,116,129,8,117,118,119,4,5,121,16,17,18,19,122,75,123,69,70,124,128,134,136]),import.meta.url)),"ogc-feature":()=>k().then(()=>b(()=>import("./OGCFeatureLayerView2D-CpSy5D2s-BVehOQQd.js"),__vite__mapDeps([237,1,2,207,36,158,25,20,21,22,162,56,57,86,11,12,13,14,208,61,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url)),"open-street-map":ye,"oriented-imagery":zt,route:()=>k().then(()=>b(()=>import("./RouteLayerView2D-Bpui7Ggx-CzB7Q2o2.js"),__vite__mapDeps([238,1,2,117,239,196,158,25,20,21,22,116,120,186,187,188,131,146,147,56,148,28,27,110,111,112,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,162,57,154,155,37,135,51,52,49,53,184,40,41,42,43,46,171,63,172,173,59,60,174,90,32,185,8,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,134,39,136]),import.meta.url)),stream:()=>k().then(()=>b(()=>import("./StreamLayerView2D-Bh_aEalU-BnZnyCg1.js"),__vite__mapDeps([240,1,2,61,12,13,207,36,158,25,20,21,22,162,56,57,86,11,14,208,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url)),"subtype-group":()=>k().then(()=>b(()=>import("./SubtypeGroupLayerView2D-Byn0xzbb-BzLYGxjv.js"),__vite__mapDeps([241,1,2,207,36,158,25,20,21,22,162,56,57,86,11,12,13,14,208,61,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url)),tile:ye,"vector-tile":()=>k().then(()=>b(()=>import("./VectorTileLayerView2D-B9OYHbL4-CP_gGifv.js"),__vite__mapDeps([242,1,2,32,167,76,149,132,133,55,180,164,155,111,29,110,22,112,113,109,114,115,11,12,13,14,126,148,140,144,160,156,131,150,28,141,151,127,143,130,157,158,25,20,21,159,161,125,162,56,57,118,119,189,243,244,245,43,44,45,128,196,116,120,198,129,8,117,59,60,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,134,135,39,136]),import.meta.url)),video:()=>k().then(()=>b(()=>import("./VideoLayerView2D-CLcxq4ZA-DOxIETBk.js"),__vite__mapDeps([246,1,2,247,123,75,14,80,81,25,20,21,22,98,67,37,248,236,126,127,157,51,52,49,53,156,131,150,28,133,132,141,140,151,144,143,110,111,112,113,76,109,114,115,11,12,13,130,158,159,160,161,125,162,56,57,154,146,147,148,27,149,152,153,44,45,120,155,135,59,60,196,116,186,187,188,189,184,40,41,42,43,46,171,63,172,173,174,90,32,185,8,117,118,119,4,5,121,16,17,18,19,36,122,69,70,124,128,129,134,39,136]),import.meta.url)),wcs:()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-BvGHSsMi.js"),__vite__mapDeps([223,1,2,224,220,140,133,132,144,151,221,156,131,150,28,141,127,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,225,189,118,119,226,222,59,60,129,135,208,206,198,8,117,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,134,39,136]),import.meta.url)),"web-tile":ye,wfs:zt,wms:()=>k().then(()=>b(()=>import("./WMSLayerView2D-Dz-z-fa9-DQ4tDf76.js"),__vite__mapDeps([249,1,2,211,156,131,150,28,133,132,141,140,151,127,144,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,212,118,119,195,198,250,208,8,117,59,60,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,129,134,135,39,136]),import.meta.url)),wmts:()=>k().then(()=>b(()=>import("./WMTSLayerView2D-Bl5FUDUu-aU1GfclG.js"),__vite__mapDeps([251,1,2,194,195,126,22,127,158,25,20,21,132,133,156,131,150,28,141,140,151,144,143,110,111,112,113,76,109,114,115,11,12,13,14,130,157,159,160,161,125,162,56,57,189,196,116,120,198,129,8,117,59,60,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,134,135,39,136]),import.meta.url)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,focusArea:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,viewshed:null,voxel:null,scene:null,unknown:null,unsupported:null};function Pc(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new C(`${i}:view-not-supported`,`${e} is not supported in 2D`)}const ws={hasLayerViewModule:t=>vs[t.type]!=null,importLayerView:t=>{const e=vs[t.type];if(e==null)throw Pc(t);return e(t)}};function Sc(t,e){const{spatialReference:i}=e,n=[e.x,e.y];let s=Number.POSITIVE_INFINITY,o=0,a=0;const h=[0,0],c=t.type==="extent"?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:t.rings;for(const p of c)for(let d=0;dd.clone()),e.sort((d,m)=>m.scale-d.scale),e.forEach((d,m)=>d.level=m);for(const d of e)!c&&i>0&&i>=d.scale&&(a=d.level,c=!0),!p&&n>0&&n>=d.scale&&(h=t?t.level:-1,p=!0),t=d;s===-1&&(s=i===0?0:a),o===-1&&(o=n===0?e.length-1:h),s=Math.max(s,0),s=Math.min(s,e.length-1),o=Math.max(o,0),o=Math.min(o,e.length-1),s>o&&([s,o]=[o,s]),i=e[s].scale,n=e[o].scale,e.splice(0,s),e.splice(o-s+1,e.length),e.forEach((d,m)=>{this._lodByScale[d.scale]=d,this._scales[m]=d.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",s),this._set("effectiveMaxZoom",o),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",n)}constrain(t,e){if(e&&t.scale===e.scale)return t;const i=this.effectiveMinScale,n=this.effectiveMaxScale,s=t.targetGeometry,o=e&&e.targetGeometry,a=n!==0&&t.scalei;if(a||h){const c=h?i:n;if(e&&o){const p=(c-e.scale)/(t.scale-e.scale);s.x=o.x+(s.x-o.x)*p,s.y=o.y+(s.y-o.y)*p}t.scale=c}return this.snapToZoom&&this.effectiveLODs&&(t.scale=this._getClosestScale(t.scale)),t}fit(t){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(t,null);const e=this.scaleToZoom(t.scale),i=Math.abs(e-Math.floor(e));return t.scale=this.zoomToScale(i>.99?Math.round(e):Math.floor(e)),t}zoomToScale(t){if(!this.effectiveLODs)return 0;t-=this.effectiveMinZoom,t=Math.max(0,t);const e=this._scales;if(t<=0)return e[0];if(t>=e.length)return e[e.length-1];const i=Math.floor(t),n=Math.ceil(t);return e[i]+(t-i)*(e[n]-e[i])}scaleToZoom(t){if(!this.effectiveLODs)return-1;const e=this._scales;let i,n;if(t>=e[0])return this.effectiveMinZoom;if(t<=e[e.length-1])return this.effectiveMaxZoom;for(let s=0;st&&nMath.abs(i-t)<=Math.abs(e-t)?i:e,this._scales[0])),this._lodByScale[t].scale}};r([l({readOnly:!0})],q.prototype,"effectiveLODs",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinScale",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxScale",void 0),r([l()],q.prototype,"lods",void 0),r([l()],q.prototype,"minZoom",void 0),r([l()],q.prototype,"maxZoom",void 0),r([l()],q.prototype,"minScale",void 0),r([l()],q.prototype,"maxScale",void 0),r([l()],q.prototype,"snapToZoom",void 0),q=an=r([_("esri.views.2d.constraints.ZoomConstraint")],q);const Zo=q,kc={base:null,key:"type",typeMap:{extent:Xt,polygon:Xs}};let R=class extends M{constructor(t){super(t),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new L}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(t){t?this._set("geometry",t):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const t=this._get("_geometry");return t&&this.geometry===t.geometry&&this.view?.constraintsInfo.spatialReference===t.spatialReference?t:new qt({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new Ho({rotationEnabled:this.rotationEnabled})}get _zoom(){const t=this._get("_zoom"),e=this.lods||this.view?.constraintsInfo.lods,i=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return t&&t.lods===e&&t.minZoom===i&&t.maxZoom===n&&t.minScale===s&&t.maxScale===o&&t.snapToZoom===a?t:new Zo({lods:e,minZoom:i,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(t){const e=this.effectiveMaxScale;return e===0||t>=e}canZoomOutTo(t){const e=this.effectiveMinScale;return e===0||t<=e}constrain(t,e){return this._zoom.constrain(t,e),this._rotation.constrain(t,e),this._geometry.constrain(t,e),this.customConstraints.forEach(i=>i.constrain(t,e)),t}constrainByGeometry(t){return this._geometry.constrain(t),this.customConstraints.forEach(e=>e.applyPanConstraint?.(t)),t}fit(t){return this._zoom.fit(t)}zoomToScale(t){return this._zoom.zoomToScale(t)}scaleToZoom(t){return this._zoom.scaleToZoom(t)}snapScale(t){return this._zoom.snapToClosestScale(t)}snapToNextScale(t){return this._zoom.snapToNextScale(t)}snapToPreviousScale(t){return this._zoom.snapToPreviousScale(t)}};r([l({readOnly:!0})],R.prototype,"effectiveLODs",null),r([l({readOnly:!0})],R.prototype,"effectiveMinScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMinZoom",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxZoom",null),r([l({types:kc,value:null})],R.prototype,"geometry",null),r([l({type:[_r]})],R.prototype,"lods",void 0),r([l()],R.prototype,"minScale",void 0),r([l()],R.prototype,"maxScale",void 0),r([l()],R.prototype,"minZoom",void 0),r([l()],R.prototype,"maxZoom",void 0),r([l()],R.prototype,"rotationEnabled",void 0),r([l()],R.prototype,"snapToZoom",void 0),r([l({type:L})],R.prototype,"customConstraints",void 0),r([l()],R.prototype,"view",void 0),r([l({readOnly:!0})],R.prototype,"version",null),r([l({type:qt,readOnly:!0})],R.prototype,"_geometry",null),r([l({type:Ho})],R.prototype,"_rotation",null),r([l({readOnly:!0,type:Zo})],R.prototype,"_zoom",null),R=r([_("esri.views.2d.MapViewConstraints")],R);const Go=R;let Z=class extends M{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([w(()=>this.constraints?.version,e=>{this.constraints&&e&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Ee)])}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:e}=this.state.paddedViewState;return this.state.commitProperty("id"),new V({x:t[0],y:t[1],spatialReference:e})}set center(t){if(t==null)return;if(!this.ready)return void this._set("center",t);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-center","could not project the value in the view's spatial reference",{input:t,error:n}))}const i=this.viewpoint;Ji(i,i,e),this.viewpoint=i}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(t){if(t==null)return;if(!t.width||!t.height)return void D.getLogger(this).error(new C("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",t),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const i=this.viewpoint;Sh(i,i,e,this.state.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const e=this.viewpoint;Ah(e,e,t),this.viewpoint=e}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",void 0);const i=this._get("extent");return void(i&&(this._set("extent",void 0),this._set("center",i.center)))}const e=this.viewpoint;ms(e,e,t),this.viewpoint=e}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(t){if(t==null)return;if(!this.ready)return this._set("viewpoint",t),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let e,i;try{e=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?i=new C("mapview:invalid-viewpoint",`invalid scale value of ${t.scale}`):t.targetGeometry==null&&(i=new C("mapview:invalid-viewpoint","geometry not defined"))}catch(s){i=new C("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(i)return void D.getLogger(this).error(i);this._scaleBeforeChangingSpatialReference=null;const n=new nt({targetGeometry:new V,scale:0,rotation:0});G(n,e),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set("viewpoint",n)}get visibleArea(){return this.ready?this.state.visibleArea:null}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get("zoom")}set zoom(t){if(!(t>=0))return;if(!this.ready){this._set("zoom",t),this._set("scale",void 0);const n=this._get("extent");return void(n&&(this._set("extent",void 0),this._set("center",n.center)))}const e=this.constraints?.zoomToScale(t)??0;if(!e)return void this._set("zoom",-1);const i=this.viewpoint;ms(i,i,e),this.viewpoint=i,this._set("zoom",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:e,constraints:i}=this,n=this._get("center"),s=this._get("extent"),o=this._get("scale"),a=this._get("rotation"),h=this._get("viewpoint"),c=this._get("zoom"),p=c!=null&&i!=null&&i.zoomToScale(c)||void 0;let d,m,u;const g=h?.rotation,f=h?.targetGeometry;f?.type==="extent"?d=f:f?.type==="point"&&(m=f,u=h?.scale);const T=s??d;return{center:n??m??T?.center,rotation:a??g,scale:(o??p??u??(T&&fi(T,[t[0]-e.left-e.right,t[1]-e.top-e.bottom])))||void 0}}startup(t,e,i,n){const s=t.targetGeometry;try{this._project(t,i)}catch(o){D.getLogger(this).warn(new zn("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:s.toJSON(),spatialReference:i,error:o})),t.targetGeometry=n||new V({x:0,y:0,spatialReference:i})}this.constraints?.fit(t),this._set("state",new En({padding:this.padding,size:e,viewpoint:t})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[t,e],spatialReference:i,rotation:n,scale:s}=this.state.paddedViewState,o=new V({x:t,y:e,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",o),this._set("zoom",-1),this._set("rotation",n),this._set("scale",s),this._set("state",null)}changeSpatialReference(t){const e=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=e.scale;else{const h=e.viewpoint.clone();h.scale=this._scaleBeforeChangingSpatialReference,e.viewpoint=h}const i=e.clone(),[n,s]=e.center;let o=null;try{o=this._project(new V({x:n,y:s,spatialReference:e.spatialReference}),t)}catch(h){Xa()||D.getLogger(this).warn(new zn("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o?.toJSON(),spatialReference:t,error:h}))}o||(o=new V({x:0,y:0,spatialReference:t}));const a=Ji(new nt({targetGeometry:new V,scale:0,rotation:0}),e.viewpoint,o);i.viewpoint=a;try{const h=[e.size[0]/2,e.size[1]/2],c=[h[0]+20,h[1]],p=e.toMap([0,0],c),{x:d,y:m}=this._project(new V({x:p[0],y:p[1],spatialReference:e.spatialReference}),t);p[0]=d,p[1]=m,i.toScreen(p,p);const u=Lh(h,p,c),g=Math.hypot(p[0]-h[0],p[1]-h[1])/20;!Number.isFinite(g)||Math.abs(g)>4?(a.rotation=0,a.targetGeometry=new V({x:0,y:0,spatialReference:t})):(a.scale*=g,a.scale>z("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(u)?u:0)}catch{}this._get("constraints")?.constrain(a,void 0),this._get("state").viewpoint=a}resize(t,e){if(!this.ready)return;const i=this.state;let n=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.slice();i.size=[t,e],Oh(n,n,s,this.state.paddedViewState.size,this.resizeAlign),n=this.constraints?.constrain(n,void 0)??n,this.state.viewpoint=n}toMap(t){if(!this.ready)return null;const e=[0,0],[i,n]=this.state.toMap(e,[t.x,t.y]),s=this.state.spatialReference;return new V({x:i,y:n,spatialReference:s})}toScreen(t,e){if(!this.ready)return null;const i=this._project(t,this.state.spatialReference),n=[i.x,i.y];return e?.pickClosestTarget===!1||this.state.paddedViewState.wrapMapCoordinate(n,n),this.state.toScreen(n,n),H(n[0],n[1])}_project(t,e){const i=t?.targetGeometry||t;if(!e)return t;if(!i)return null;if(e.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem||pi(e,i.spatialReference))return t;const n=Le(i,e);if(!n)throw new C("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:i,spatialReference:e});return Ec(t)?(t.targetGeometry=n,t):n}};function Ec(t){return t?.declaredClass==="esri.Viewpoint"}r([l({type:V})],Z.prototype,"center",null),r([l()],Z.prototype,"constraints",void 0),r([l({type:Xt})],Z.prototype,"extent",null),r([l({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],Z.prototype,"padding",null),r([l()],Z.prototype,"ready",void 0),r([l()],Z.prototype,"resizeAlign",void 0),r([l({readOnly:!0})],Z.prototype,"resolution",null),r([l({type:Number})],Z.prototype,"rotation",null),r([l({type:Number})],Z.prototype,"scale",null),r([l({readOnly:!0})],Z.prototype,"state",void 0),r([l({type:nt})],Z.prototype,"viewpoint",null),r([l({readOnly:!0})],Z.prototype,"visibleArea",null),r([l()],Z.prototype,"zoom",null),Z=r([_("esri.views.2d.ViewStateManager")],Z);function Cn(t,e){switch(e){case"primary":return t.pointerType==="touch"||t.button===0;case"secondary":return t.pointerType!=="touch"&&t.button===2;case"tertiary":return t.pointerType!=="touch"&&t.button===1}}let bs=class extends A{constructor(t,e){super(!0),this._view=t,this.registerIncoming("double-click",e,i=>this._handleDoubleClick(i,e))}_handleDoubleClick(t,e){Cn(t.data,"primary")&&(t.stopPropagation(),e?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}},Cc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerType=e,this.registerIncoming("double-tap-drag",i,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(t){const{data:e}=t,{pointerType:i}=e;if(i!==this.pointerType)return;t.stopPropagation();const{action:n,delta:s}=e,{view:o}=this,{mapViewNavigation:a}=o;switch(n){case"begin":{const{scale:h}=o;this._startScale=h,this._currentScale=h,this._previousDelta=s,a.begin();break}case"update":{if(this._previousDelta.y===s.y)return;this._previousDelta=s;const h=1.015**s.y,c=this._startScale*h,p=c/this._currentScale;a.setViewpointImmediate(p),this._currentScale=c;break}case"end":{const{constraints:h}=o,{effectiveLODs:c,snapToZoom:p}=h;if(!p||!c)return void a.end();const d=h.snapScale(this._currentScale),m=(s.y>0?Math.max(d,h.snapToPreviousScale(this._startScale)):Math.min(d,h.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(m).then(()=>{a.end()});break}}}},wi=class{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const e=t.data,i=e.pointers.size;switch(e.action){case"start":this._currentCount=i,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){this._startEvent=t,this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}},Ic=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerAction=e,this.registerIncoming("drag",i,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new wi({start:(e,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(e,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(e,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(e,i)=>e===1&&Cn(i.data,this.pointerAction)})}_handleDrag(t){const e=this.view.mapViewNavigation;e.pinch.zoomMomentum||e.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},Dc=class extends A{constructor(t,e,i){super(!0),this._view=t,this.pointerAction=e;const n=this._view.mapViewNavigation;this._dragEventSeparator=new wi({start:(s,o)=>{n.rotate.begin(this._view,o.data),o.stopPropagation()},update:(s,o)=>{n.rotate.update(this._view,o.data),o.stopPropagation()},end:(s,o)=>{n.rotate.end(),o.stopPropagation()},condition:(s,o)=>s===1&&Cn(o.data,this.pointerAction)}),this.registerIncoming("drag",i,s=>this._dragEventSeparator.handle(s))}};function et(t){let e=t*t;return t<0&&(e*=-1),e}function Rc(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function Lc(t,e,i){const n=i,s=t.state,o=t.device,a=e.tiltDirection==="forward-down"?1:-1,h=1;return o.deviceType==="standard"?(n.translation[0]=et(s.axes[0]),n.translation[1]=et(s.axes[1]),n.translation[2]=et(s.buttons[7])-et(s.buttons[6]),n.heading=et(s.axes[2]),n.tilt=et(s.axes[3])):o.deviceType==="spacemouse"&&(n.translation[0]=1.2*et(s.axes[0]),n.translation[1]=1.2*et(s.axes[1]),n.translation[2]=2*-et(s.axes[2]),n.heading=1.2*et(s.axes[5]),n.tilt=1.2*et(s.axes[3])),n.tilt*=a,Yr(n.translation,n.translation,h),n}function Vc(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let Oc=class extends A{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new qs,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",e=>this._handleGamePadEvent(e)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([w(()=>this._view.navigation.gamepad?.enabled,e=>{e?(this._handle.resume(),this._frameTask||(this._frameTask=de({update:i=>this._frameUpdate(i.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},U)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const e=this._view.navigation.gamepad.device;e&&t.data.device!==e||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Rc(this._transformation)):(this._currentDevice=t.data.device,Lc(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const e=this._transformation;if(Vc(e))return;const i=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=zc*n*t;vi(i,i,[e.translation[0]*s,-e.translation[1]*s]);const o=1+e.translation[2]*Nc*t,a=this._view.constraints.rotationEnabled?-e.heading*Ac*t:0,h=this._view.size,c=[h[0]/2,h[1]];Vo(i,i,o,a,c,h);const p=this._view.constraints.constrain(i,this._view.viewpoint);this._view.viewpoint=p}};const Ac=.06,zc=.7,Nc=6e-4;function $o(t){const e=()=>t(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),di(()=>document.removeEventListener("visibilitychange",e))}let Fc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=n=>{const s=this._keyMap[n.data.key];if(n.modifiers.has("Meta")||n.modifiers.has("Control"))return void this._stopMovement();if(s==null)return;n.stopPropagation(),n.preventDefault();const o=n.type==="key-down";if(this._pressedKeys[o?"add":"delete"](s),o){if(this._direction===s)return;this._direction=s,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const a=this._timeout===void 0,h=this._pressedKeys.size>0;a||h?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",i,this._handleKey),this.registerIncoming("key-up",i,this._handleKey),this.registerIncoming("blur",i,this._stopMovement),this._visibilityHandle=$o(n=>n?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(t){const e=this._currentDirection!=null;if(t!=null){if(e||this.view.mapViewNavigation.begin(),this._currentDirection!==t)switch(t){case"left":this.view.mapViewNavigation.continuousPanLeft();break;case"right":this.view.mapViewNavigation.continuousPanRight();break;case"up":this.view.mapViewNavigation.continuousPanUp();break;case"down":this.view.mapViewNavigation.continuousPanDown()}}else e&&this.view.mapViewNavigation.stop();this._currentDirection=t}_setTimeout(t){clearTimeout(this._timeout),this._timeout=t===void 0?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}},Hc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._pressed=!1,this._keyToDirection={[e.clockwiseOption1]:"clockwise",[e.clockwiseOption2]:"clockwise",[e.counterClockwiseOption1]:"counterClockwise",[e.counterClockwiseOption2]:"counterClockwise",[e.resetOption1]:"reset",[e.resetOption2]:"reset"},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",i,n=>this._handleKeyUp(n)),this.registerIncoming("blur",i,()=>this._handleStop()),this._visibilityHandle=$o(n=>n?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,e){const i=t.modifiers;if(i.size>0&&!i.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[t.data.key];if(this._pressed=n!=null,this._pressed){if(t.preventDefault(),e)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continuousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continuousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}};var ce;(function(t){t[t.IN=0]="IN",t[t.OUT=1]="OUT"})(ce||(ce={}));let Zc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._keysToZoomAction={},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),e.zoomIn.forEach(n=>this._keysToZoomAction[n]=ce.IN),e.zoomOut.forEach(n=>this._keysToZoomAction[n]=ce.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const e=t.modifiers;if(e.size>0&&!e.has("Shift"))return;const{key:i}=t.data;if(!(i in this._keysToZoomAction))return;const n=this._keysToZoomAction[i],{mapViewNavigation:s}=this.view;let o=null;switch(n){case ce.IN:o=s.zoomIn();break;case ce.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),t.stopPropagation()}};const Gc=.6;let $c=class extends A{constructor(t,e){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",e,i=>this._handleMouseWheel(i))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const e=this._view.mapViewNavigation,{x:i,y:n,deltaY:s}=t.data,o=1/Gc**(1/60*s),a=e.zoom(o,[i,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,e.end()}))}},Wc=class extends A{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",i=>this._handleDrag(i)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const e=this.view.mapViewNavigation;this._dragEventSeparator=new wi({start:(i,n)=>{e.pinch.begin(this.view,n.data),n.stopPropagation()},update:(i,n)=>{e.pinch.update(this.view,n.data),n.stopPropagation()},end:(i,n)=>{e.pinch.end(this.view),n.stopPropagation()},condition:i=>i>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function Ts(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value||1:0),axes:e.axes.map(i=>qc(i,t.axisThreshold))}:{buttons:[],axes:[]}}function Uc(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,h=this._inputDevices[a];h&&(this._emitGamepadEvent(o,Ts(h),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(h),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const i="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=i&&n,this.supported&&(Ms(s=>this._connectGamepad(s)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(t){this._hasEventListeners!==t&&(this._hasEventListeners=t,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(t){this._callback=t}_connectGamepad(t){const e=new Mn(t);e.deviceType!=="unknown"&&(this._inputDevices[t.index]=e,this._input.gamepad.devices.add(e)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=de({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),e=this._element.contains(document.activeElement),i=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!e;Ms(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=Ts(s),h=i||jc(a);o&&(o.timestamp===n.timestamp||!o.active&&h||Uc(o.state,a))||this._emitGamepadEvent(n,a,!h)})}_emitGamepadEvent(t,e,i){const n=this._latestUpdate[t.index],s=n&&n.active;if(!s&&!i)return;const o=!s&&i?"start":s&&i?"update":"end";this._latestUpdate[t.index]={timestamp:t.timestamp,state:e,active:i},this._callback&&this._callback({device:this._inputDevices[t.index],state:e,action:o})}};function Kc(t){if(!t||!t.connected)return!1;for(let e=0;e{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new Bc(e,this._input),this._gamepadSource.onEvent=n=>this._callback("gamepad",n)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=tt(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const i in this._active)if(!e||!e.has(i)){const n=this._active[i];this._element.removeEventListener(zi[i],n),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&zi[i]){const n=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(zi[i],n),this._active[i]=n}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,i){i?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?ee.touchNone:ee.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?ee.touchPan:ee.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(ee.touchNone),this._element.classList.remove(ee.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const n=_o(this._element,e);return Uo.test.disableSubpixelCoordinates&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),i.x=n.x,i.y=n.y,i}_handleKey(e,i){const{key:n}=i;n&&e==="key-up"&&this._keyDownState.delete(n);const s={native:i,key:n,repeat:!!n&&this._keyDownState.has(n)};n&&e==="key-down"&&this._keyDownState.add(s.key),this._callback(e,s)}_handlePointer(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(e,n)}_getDeltaFromTrackpadOrMouseWheel(e){return e.shiftKey&&z("mac")&&e.deltaY===0?e.deltaX:e.deltaY}_handleMouseWheel(e,i){let n=this._getDeltaFromTrackpadOrMouseWheel(i);switch(i.deltaMode){case 0:xs&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}xs?n*=.7:Yc||Qc?n*=.6:Xc&&(n*=1.375);const s=100,o=Math.abs(n);o>s&&(n=n/o*200/(1+Math.exp(-.02*(o-s))));const a=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:n});this._callback(e,a)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const n={native:i};i.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};Wo.test={disableSubpixelCoordinates:!1};const zi={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let Jc=class extends A{constructor(){super(!0),this.registerIncoming("context-menu",t=>t.data.native.preventDefault())}};const F={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function ri(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function tp(t,e){const i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}function ep(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:H()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[S,x]=t,[$,K]=[x.x-S.x,x.y-S.y];return e.radius=Math.sqrt($*$+K*K)/2,e.center.x=(S.x+x.x)/2,e.center.y=(S.y+x.y)/2,e}let i=0,n=0;for(let S=0;SS.x-i),o=t.map(S=>S.y-n);let a=0,h=0,c=0,p=0,d=0,m=0,u=0;for(let S=0;Sthis._dragStart(o,a),update:(o,a)=>this._dragUpdate(a),end:(o,a)=>this._dragEnd(a)}),this.registerIncoming("drag",o=>this._dragEventSeparator.handle(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(t=>{t.doubleTapTimeout=st(t.doubleTapTimeout)})}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleTapTimeout!=null)return!0;return!1}_clearPointerDown(t){const e=this._pointerState.get(t);e&&(e.doubleTapTimeout=st(e.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_dragStart(t,e){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:i,modifiers:n}=e,{center:s}=i;this._dragStartCenter=s;const o=Ni("begin",H(0,0),i);this._doubleTapDrag.emit(o,void 0,n),e.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("update",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("end",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:e}=t,i=Kt(e),n=this._pointerState.get(i),{pointerType:s}=e.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(i),ri(n.event.data,e)>o?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:e}=t,{pointerType:i}=e.native,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(n),s);this._pointerState.set(n,{event:t,doubleTapTimeout:o}),this.refreshHasPendingInputs()}};function Ni(t,e,i){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}=i;return{action:t,delta:e,button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}}let np=class extends A{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,e,i,n){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:e.buttons,timestamp:n,pointers:sp(this._activePointerMap),pointer:e,angle:i.angle,radius:i.radius,center:i.center}}_addPointer(t){const e=t.native.pointerId,i=$e(this._activePointerMap).angle,n={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(e,n);const s=Qe(n,jo(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(i)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const e=t.native.pointerId,i=this._activePointerMap.get(e);i?i.event=t:this._addPointer(t)}_removePointer(t){const e=$e(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(e)}_updatePointerAngles(t){const e=$e(this._activePointerMap);this._activePointerMap.forEach(i=>{i.initialAngle=Qe(i,e)-t,i.lastAngle=Qe(i,e)-t})}_emitEvent(t,e,i){const n=$e(this._activePointerMap);this._drag.emit(this._createPayload(t,e,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const e=t.data.native.pointerId,i=it(t.timestamp);this._activePointerMap.get(e)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,i),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(e)):(this._removePointer(e),this._emitEvent("removed",t.data,it(t.timestamp))))}_handlePointerDrag(t){const e=t.data,i=e.currentEvent,n=it(t.timestamp);switch(e.action){case"start":case"update":this._isDragging?this._activePointerMap.has(i.native.pointerId)?(this._updatePointer(i),!this._isCurrentDragSuppressed&&this._emitEvent("update",i,n)):(this._addPointer(i),this._emitEvent("added",i,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(i),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",i,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function jo(t){const e=[];return t.forEach(i=>{e.push(H(i.event.x,i.event.y))}),ep(e)}function $e(t){const e=jo(t);let i=0;return t.forEach(n=>{let s=Qe(n,e),o=s-n.lastAngle;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;s=n.lastAngle+o,n.lastAngle=s;const a=s-n.initialAngle;i+=a}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function sp(t){const e=new Map;return t.forEach((i,n)=>e.set(n,i.event)),e}function Qe(t,e){const i=t.event,n=i.x-e.center.x,s=i.y-e.center.y;return Math.atan2(s,n)}var Ss;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(Ss||(Ss={}));let op=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=Kt(e);if(!this._pointerState.has(i)){const n={downButton:e.native.button,x:e.x,y:e.y,immediateDoubleClick:null};this._pointerState.set(i,n),this.startCapturingPointer(e.native)}}_handlePointerUp(t){const e=t.data,i=Kt(e),n=this._pointerState.get(i);if(n&&n.downButton===e.native.button){const s=n.immediateDoubleClick,o=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),ri(s,t.data)>o?this._startImmediateDoubleClick(t,n):(this._immediateDoubleClick.emit(t.data,void 0,s.modifiers),this._removeState(e))):ri(n,t.data)>o?this._removeState(e):this._startImmediateDoubleClick(t,n)}}_startImmediateDoubleClick(t,e){const i=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;e.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),i)}}_removeState(t){const e=Kt(t);this._pointerState.delete(e),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}},ap=class extends A{constructor(t=F.maximumClickDelay,e=F.movementUntilMouseDrag,i=F.movementUntilPenDrag,n=F.movementUntilTouchDrag,s=F.holdDelay,o=Re){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=e,this._movementUntilPenDrag=i,this._movementUntilTouchDrag=n,this._holdDelay=s,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",a=>this._handlePointerDown(a)),this.registerIncoming("pointer-up",a=>this._handlePointerLoss(a,"pointer-up")),this.registerIncoming("pointer-capture-lost",a=>this._handlePointerLoss(a,"pointer-capture-lost")),this.registerIncoming("pointer-cancel",a=>this._handlePointerLoss(a,"pointer-cancel")),this._moveHandle=this.registerIncoming("pointer-move",a=>this._handlePointerMove(a)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=st(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=e.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(i);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,t.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const s={startEvent:e,previousEvent:e,startTimestamp:t.timestamp,isDragging:!1,downButton:e.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,s),this.startCapturingPointer(e.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_handlePointerMove(t){const e=t.data,i=e.native.pointerId,n=this._pointerState.get(i);n&&(n.isDragging?this._pointerDrag.emit(We("update",n,e),void 0,n.modifiers):tp(e,n.startEvent)>this._getDragThreshold(e.native.pointerType)&&this._startDragging(t),n.previousEvent=e)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const e=t.data,i=e.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=t.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(We("start",n,e)):this._pointerDrag.emit(We("start",n,n.previousEvent),t.timestamp))})}_handlePointerLoss(t,e){const i=t.data,n=i.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(We("end",s,e==="pointer-up"?i:s.previousEvent),void 0,s.modifiers):e==="pointer-up"&&s.downButton===i.native.button&&t.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(i),this._pointerState.delete(n),this.stopCapturingPointer(i.native),this._pointerState.size===0&&this._moveHandle.pause())}};function We(t,e,i){return{action:t,startEvent:e.startEvent,previousEvent:e.previousEvent,currentEvent:i}}let rp=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",o=>this._handleImmediateClick(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o))}onUninstall(){this._pointerState.forEach(t=>t.doubleClickTimer=st(t.doubleClickTimer))}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleClickTimer!=null)return!0;return!1}_clearDoubleClickTimer(t,e){const i=this._pointerState.get(t);i&&(i.doubleClickTimer=st(i.doubleClickTimer),e&&this._click.emit(i.event.data,void 0,i.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const e=this._pointerState.get(t);e.pointerDownCount===1&&this._click.emit(e.event.data,void 0,e.event.modifiers),e.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_handleImmediateClick(t){const e=t.data,{pointerType:i}=e.native,n=lp(e);if(!this._pointerState.has(n))return void this._startClick(t);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,h=i==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;ri(o,e)>h?(this._clearDoubleClickTimer(n,!0),this._startClick(t)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(t){const e=Kt(t.data),i=this._pointerState.get(e);i&&(i.pointerDownCount+=1)}_startClick(t){const{data:e}=t,{native:{pointerType:i}}=e,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s);this._pointerState.set(n,{event:t,doubleClickTimer:o,pointerDownCount:1}),this.refreshHasPendingInputs()}};function lp(t){const{pointerId:e,pointerType:i,button:n}=t.native;return i==="mouse"?`${e}:${n}`:`${i}`}const Ue={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let Gt=class extends M{initialize(){const t=()=>this.view?.ready;this.addHandles([Ce(()=>!t(),()=>this._disconnect()),Ce(t,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=tt(this._inputManager)}_connect(){const t=this.view.surface,e=new Wo(t,this.view.input),i=[new op,new ap,new rp,new np(this.view.navigation),new ip],n=new Q({eventSource:e,recognizers:i});n.installHandlers("prevent-context-menu",[new Jc],At.INTERNAL),n.installHandlers("navigation",[new Wc(this.view),new Oc(this.view),new $c(this.view),new bs(this.view),new bs(this.view,[Ue.counter]),new Ic(this.view,"primary"),new Fc(this.view,Ue.pan),new Zc(this.view,Ue.zoom),new Hc(this.view,Ue.rotate),new Dc(this.view,"secondary"),new Cc(this.view,"touch")],At.INTERNAL),this.view.viewEvents.connect(n),this._source=e,this._inputManager=n,w(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},U)}get test(){}};r([l()],Gt.prototype,"view",void 0),r([l()],Gt.prototype,"latestPointerType",null),r([l()],Gt.prototype,"latestPointerLocation",null),r([l()],Gt.prototype,"multiTouchActive",null),Gt=r([_("esri.views.2d.input.MapViewInputManager")],Gt);const hp=Gt,Nt={added:[],removed:[]},Fi=new Set,cp=new Kr(0,0,0,0);function pp(t,e){const i=Bs(e);if(!i)return null;const[n,s]=i.valid;return t[2]>s?[Ne([t[0],t[1],s,t[3]]),Ne([n,t[1],n+t[2]-s,t[3]])]:t[0]({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=t}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(t){return this._tiles.has(t)}get(t){return this._tiles.get(t)}getIntersectingTiles(t){if(!t||Qa(t)===0||Ja(t)===0)return[];const e=pp(t,this.tileScheme.spatialReference);return e!=null?[...new Set([...this.boundsIntersections(e[0]),...this.boundsIntersections(e[1])])]:this.boundsIntersections(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const e={added:[],removed:[]};for(const i of t.added)if(!this.has(i)){const n=new Kn(this.tileScheme,i);this._tiles.set(i,n),this._index.insert(n),e.added.push(n)}for(const i of t.removed)if(this.has(i)){const n=this.get(i);this._tiles.delete(i),this._index.remove(n),e.removed.push(n)}this.tiles.length=0,this._tiles.forEach(i=>this.tiles.push(i)),(e.added.length||e.removed.length)&&this.emit("update",e)}setViewState(t){const e=this.tileScheme.getTileCoverage(t,0);if(!e)return;const{spans:i,lodInfo:n}=e,{level:s}=n;if(i.length>0)for(const{row:o,colFrom:a,colTo:h}of i)for(let c=a;c<=h;c++){const p=cp.set(s,o,n.normalizeCol(c),n.getWorldForColumn(c)).id;if(Fi.add(p),!this.has(p)){const d=new Kn(this.tileScheme,p);this._tiles.set(p,d),this._index.insert(d),this.tiles.push(d),Nt.added.push(d)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];Fi.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Nt.removed.push(a))}(Nt.added.length||Nt.removed.length)&&this.emit("update",Nt),Fr.pool.release(e),Fi.clear(),Nt.added.length=0,Nt.removed.length=0}};const up=1,Pu=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],Su=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],_e=256,mp=new Pt("cyan"),gp=1,yp=.25;new Pt("black");const _p="default",fp="temporary",vp=new Pt("yellow");let $t=class extends M{constructor(t){super(t),this.color=mp.clone(),this.haloOpacity=gp,this.fillOpacity=yp}equals(t){return this.color.equals(t.color)&&(this.haloColor||this.color).equals(t.haloColor||t.color)&&this.haloOpacity===t.haloOpacity&&this.fillOpacity===t.fillOpacity}};r([l({type:Pt})],$t.prototype,"color",void 0),r([l({type:Pt})],$t.prototype,"haloColor",void 0),r([l()],$t.prototype,"haloOpacity",void 0),r([l()],$t.prototype,"fillOpacity",void 0),$t=r([_("esri.views.support.HighlightOptions")],$t);const wp=$t;var rn;let xe=rn=class extends wp{constructor(t){super(t),this.haloWidth=2.1,this.haloBlur=.8/this.haloWidth}equals(t){return super.equals(t)&&this.haloWidth===t.haloWidth&&this.haloBlur===t.haloBlur}get optionsKey(){return`${this.color};${this.haloColor};${this.haloOpacity};${this.fillOpacity};${this.haloWidth};${this.haloBlur}`}clone(){return new rn({color:this.color.clone(),haloColor:this.haloColor?.clone(),haloOpacity:this.haloOpacity,fillOpacity:this.fillOpacity,haloWidth:this.haloWidth,haloBlur:this.haloBlur})}};r([l()],xe.prototype,"haloWidth",void 0),r([l()],xe.prototype,"haloBlur",void 0),xe=rn=r([_("esri.views.2d.support.HighlightOptions")],xe);const Yt=xe,Hi=()=>D.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function bp(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=t.fillOpacity,e.outlineColor[3]*=t.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=(1-t.haloBlur)*t.haloWidth,e.outerHaloWidth=t.haloBlur*t.haloWidth/2,e.innerHaloWidth=t.haloBlur*t.haloWidth/2,e.outlinePosition=0}const Tp=[0,0,0,0];let qo=class{constructor(){this.type="single",this._highlightOptions=new Yt,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*_e),this._minMaxDistance=[0,0]}setHighlightOptions(t){this._highlightOptions=t}applyHighlightOptions(t,e){this._updateGradientTexture(t),t.bindTexture(this._shadeTex,Xr),e.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<h?Math.round(10*(Math.abs(n)-h))/10:0,p=Math.abs(a)>h?Math.round(10*(Math.abs(a)-h))/10:0;let d;c&&!p?Hi().error("The outer rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!c&&p?Hi().error("The inner rim of the highlight is "+p+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):c&&p&&Hi().error("The highlight is "+Math.max(c,p)+"px away from the edge of the feature; consider reducing some width values.");const m=[void 0,void 0,void 0,void 0];function u(f,T,I){m[0]=(1-I)*f[0]+I*T[0],m[1]=(1-I)*f[1]+I*T[1],m[2]=(1-I)*f[2]+I*T[2],m[3]=(1-I)*f[3]+I*T[3]}const{_texelData:g}=this;for(let f=0;f<_e;++f)d=n+f/(_e-1)*(a-n),dt.stencilRef,compare:Jr.EQUAL,mask:255,op:{fail:Si.KEEP,zFail:Si.KEEP,zPass:Si.REPLACE}}}},xp={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Pp={...Bo,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function Sp({pixelRatio:t,state:e,displayLevel:i,requiredLevel:n},s){const o=1/2**(i-s.key.level),a=1/2**(n-s.key.level);return{displayMat3:e.displayMat3,displayViewMat3:e.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:e.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:o,requiredZoomFactor:a,tileOffset:[s.x,s.y],currentScale:e.scale,currentZoom:i,metersPerSRUnit:Ys(e.spatialReference),rotation:e.rotation,pixelRatio:t}}function Ko(t){return t.passOptions?.type==="highlight"}function Yo(t){return t.passOptions?.type==="hittest"}function kp(t){if(!Yo(t))return null;const{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}}function Ep(t){if(!Ko(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function ku(t,e,i){const n={};for(const s in i)i[s]instanceof Function?n[s]=i[s](t,e):n[s]=i[s];return n}function Eu(t,e){const{attributeView:i,context:n}=t;return{storage:i.getUniforms(n),view:Sp(t,e),hittestRequest:kp(t),highlight:Ep(t)}}function Cu(t){return{inside:t.selection===li.InsideEffect,outside:t.selection===li.OutsideEffect}}function Cp(t){return Yo(t)?xp:Ko(t)&&t.passOptions.stepType==="clear"?Pp:Bo}function Iu(t){const{row:e,col:i}=t.key,n=i*Qn,s=e*Qn;return{tileOffsetFromLocalOrigin:[n%He,s%He],maxIntsToLocalOrigin:[Math.floor(n/He),Math.floor(s/He)]}}const Ip=new Fa({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function Du(t){return Ip.toJSON(t)}function Ru(t){const{bandCount:e,attributeTable:i,colormap:n,pixelType:s}=t.raster.rasterInfo;return e===1&&(i!=null||n!=null||s==="u8"||s==="s8")}function Dp(t,e){return e==null?(t?.destroy(),null):(t?.type==="single"&&Array.isArray(e)&&(t.destroy(),t=null),t?.type!=="multi"||Array.isArray(e)||(t.destroy(),t=null),t||(t=Array.isArray(e)?new Mp:new qo),Array.isArray(e)?t.type==="multi"&&t.setHighlightOptions(e):t.type==="single"&&t.setHighlightOptions(e),t)}function Lu(t,e,i,n){const{painter:s,highlightGradient:o}=t,{highlight:a}=s.effects;if(!o)return;const h=t.passOptions,c=o.getReasonsWithGradients();for(let p=0;pparseFloat(t)/100;function Rp(t,e,i){const n=typeof t.left=="string"?je(t.left)*e:t.left,s=typeof t.right=="string"?je(t.right)*e:t.right,o=typeof t.top=="string"?je(t.top)*i:t.top,a=typeof t.bottom=="string"?je(t.bottom)*i:t.bottom,h=o;return{xmin:n,xmax:Math.max(e-s,n),ymin:h,ymax:Math.max(i-a,o)}}function Xo(t,e,i,n){switch(e.type){case"rect":{const{width:s,height:o}=t,{xmin:a,xmax:h,ymin:c,ymax:p}=Rp(e,s,o),{x:d,y:m}=i;return d>a&&dc&&mt.name);function Lp(t){if(!t.highlights)return null;const e=t.highlights.findIndex(i=>i.name==="default");return e===-1?null:t.highlights.items[e].options}function Vp(t,e){if(!t.highlights){if(!e)return;t.highlights=new Qo([{name:"default",options:new Yt}])}const i=t.highlights.findIndex(n=>n.name==="default");e?t.highlights.items[i].options=e:t.highlights.removeAt(i)}async function Op(t,e,i){const n=vo(e)?fo(t,e):e;if(!t.ready||isNaN(n.x)||isNaN(n.y))return{screenPoint:n,results:[]};let s=new Set;const o=new Set;let a=!1,h=null,c=null;i?.include?As(i.include,Os(t,u=>{s.add(u),Zi(u,g=>o.add(g))},(u,g)=>{o.add(u),s.add(g)},u=>{h||(h=new Set),h.add(u)},u=>s.add(u),()=>a=!0)):(a=!0,s=new Set(t.allLayerViews),s.forEach(u=>{Zi(u,g=>o.add(g))})),i?.exclude&&As(i.exclude,Os(t,u=>{s.delete(u),Zi(u,g=>o.delete(g))},u=>o.delete(u),u=>{c||(c=new Set),c.add(u)}));const p=t.toMap(n),d=t.allLayerViews.filter(u=>!u.suspended&&s.has(u)&&u.clips.every(g=>Xo(t,g,n,p))).reverse();let m=[...a?t.graphicsView.hitTest(p).map(u=>({type:"graphic",graphic:u,layer:null,mapPoint:p})):[],...await Promise.all(d.map(u=>u.hitTest(p,n)).toArray())].filter(ni).flat().filter(ni);return m=m.filter(u=>u.type!=="graphic"||u.layer?.type!=="subtype-group"||o.has(u.graphic.layer)),h&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||h?.has(hn(u.graphic)))),c&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||!c?.has(hn(u.graphic)))),{screenPoint:n,results:m}}function Os(t,e,i,n,s,o){return a=>{if(a instanceof pr){if(a.layer===t)o?.();else{const h=t.allLayerViews.find(c=>c.layer===a.layer);h&&s?.(h)}n(hn(a))}else if(!("layer"in a&&"element"in a))if(a.type==="subtype-sublayer"){const h=t.allLayerViews.find(c=>c.layer===a.parent);h&&i(a,h)}else{const h=t.allLayerViews.find(c=>c.layer===a);h&&e(h)}}}function As(t,e){if(t)if(Nn(t))for(const i of t)if(Nn(i))for(const n of i)e(n);else e(i);else e(t)}function hn(t){const e=t.getObjectId();return e?`${t.layer?.uid??t.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${t.uid}`}function Zi({layer:t},e){t?.type==="subtype-group"&&t.sublayers.forEach(i=>{e(i)})}function ta(t,e,i){const{ctx:n,canvas:s}=ia(t,i),o=n.getImageData(0,0,t.width,t.height),a=sa(s,e);return na(s),{dataUrl:a,data:o}}function ea(t,e){const{ctx:i,canvas:n}=ia(t,e),s=i.getImageData(0,0,t.width,t.height);return na(n),s}function ia(t,e){const i=Ap();e.premultipliedAlpha&&Hp(t),i.width=t.width,i.height=t.height;const n=i.getContext("2d",{willReadFrequently:!0});return n.putImageData(t,0,0),e.flipY&&Fp(n),{ctx:n,canvas:i}}function na(t){t.width=0,t.height=0}function Ap(){return Gi==null&&(Gi=document.createElement("canvas")),Gi}let Gi=null;function sa(t,e){const i=Zp[e.format],n=e.quality/100;return t.toDataURL(i,n)}function oa(t,e){const i=Np(t),n=$p[i];return{format:i,quality:ke(e??n,0,100)}}function aa(t,e){return e/Math.max(t[0],t[1])}function zp(t,e,i,n=0,s=0,o=t.width-n,a=t.height-s,h=!1){const{data:c}=t,{width:p,height:d,data:m}=e,u=o/p,g=a/d,f=Math.ceil(u/2),T=Math.ceil(g/2),I=t.width;for(let E=0;E=1)continue;let St=2*Qt*Qt*Qt-3*Qt*Qt+1;const Jt=4*(n+Ae+(s+Oe)*I);Dn+=St*c[Jt+3],$+=St,!i&&c[Jt+3]<255&&(St=St*c[Jt+3]/255),K+=St*c[Jt],dt+=St*c[Jt+1],In+=St*c[Jt+2],x+=St}}m[S]=K/x,m[S+1]=dt/x,m[S+2]=In/x,m[S+3]=Dn/$}return e}function Np(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return Gp}}function Fp(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function Hp(t){const e=t.data,i=e.length;for(let n=0;n0){const o=255/s;e[n]=e[n]*o,e[n+1]=e[n+1]*o,e[n+2]=e[n+2]*o}}}const Zp={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},zs=98,Gp="png",$p={png:100,jpg:zs,jpeg:zs},Vu=Object.freeze(Object.defineProperty({__proto__:null,createEmptyImageData:nl,encode:ta,encodeData:ea,getFormatAndQuality:oa,getMaximumResolutionScale:aa,resampleHermite:zp,toDataUrl:sa},Symbol.toStringTag,{value:"Module"})),ra={flipY:!0,premultipliedAlpha:!0};async function Wp(t,e){const i=await la(t,e),{format:n,quality:s}=oa(e?.format,e?.quality);return ta(i,{format:n,quality:s},ra)}async function Up(t,e){const i=await la(t,e);return ea(i,ra)}function la(t,e){const i=Bp(e||{},qp(t.stage,t.size),t.size,t.padding),n=jp(e,t.allLayerViews);return t.stage.takeScreenshot(i,n,t.backgroundColor,e?.rotation)}function jp(t={},e){if(!t.layers)return;const i=[];return t.layers.forEach(n=>{const s=e.find(o=>o.layer.id===n.id);s?.container&&i.push(s.container)}),i}function qp(t,e){return Math.min(4,aa(e,Math.min(4096,t.context.parameters.maxTextureSize)))}function Bp(t,e,i,n){t.ignorePadding&&(n={left:0,right:0,top:0,bottom:0});let s=null;t.width!=null&&t.height!=null?s=[t.width,t.height]:t.width==null&&t.height!=null?s=[t.height,t.height]:t.width!=null&&t.height==null?s=[t.width,t.width]:t.width==null&&t.height==null&&(s=null);const o=i[0]-(n.left+n.right),a=i[1]-(n.top+n.bottom);let h,c,p=t.area||{x:0,y:0,width:o,height:a};if(s){const d=o/a,m=s[0]/s[1];if(m>d){const u=p.width/m;p={x:p.x,y:Math.round(p.y+(p.height-u)/2),width:p.width,height:Math.round(u)}}else{const u=p.height*m;p={x:Math.round(p.x+(p.width-u)/2),y:p.y,width:Math.round(u),height:p.height}}}else s=[p.width,p.height];return s[0]>p.width?(h=Math.min(s[0]/p.width,e),c=s[0]/p.width/h):(h=1,c=s[0]/p.width),{cropArea:{x:Math.round((p.x+n.left)*h),y:Math.round((p.y+n.top)*h),width:Math.round(p.width*h),height:Math.round(p.height*h)},outputScale:c,resolutionScale:h}}const Ns=160;let Pe=class extends M{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=Ns&&this.clear()},Ns))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};r([l()],Pe.prototype,"_timer",void 0),r([l()],Pe.prototype,"stationary",null),Pe=r([_("esri.views.2d.support.StationaryManager")],Pe);const Kp=t=>t.includes("Brush");let ha=class{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),Kp(t)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${t}.Start`))}end(t){this._names.has(t)&&!this._names.get(t)&&(this._names.set(t,!0),performance.mark(`Esri.${t}.End`))}record(t){this._names.has(t)||(this._names.set(t,!0),performance.mark(`Esri.${t}`))}};function Yp(t){const e=sl();return e.available?t==="3d"&&e.majorPerformanceCaveat?new C("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):e.supportsHighPrecisionFragment?e.supportsVertexShaderSamplers?null:new C("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new C("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new C("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function Xp(t){return t&&"nodeType"in t}function Qp(t){return t&&typeof t.render=="function"}const Fs={component:"esri-component"};let Wt=class extends M{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(t){this._set("id",t)}set node(t){const e=this._get("node");t!==e&&(t&&t.classList.add(Fs.component),e&&e.classList.remove(Fs.component),this._set("node",t))}castNode(t){return this.widget?.destroy(),t?typeof t=="string"||Xp(t)?(this._set("widget",null),so(t)):(Qp(t)&&!t.domNode&&(t.domNode=document.createElement("div")),this._set("widget",t),t.domNode):(this._set("widget",null),null)}};r([l()],Wt.prototype,"id",null),r([l()],Wt.prototype,"node",null),r([Bt("node")],Wt.prototype,"castNode",null),r([l({readOnly:!0})],Wt.prototype,"widget",void 0),Wt=r([_("esri.views.ui.Component")],Wt);const Je=Wt,Jp={left:0,top:0,bottom:0,right:0},ca={bottom:30,top:15,right:15,left:15},mt="esri-ui",j={ui:mt,corner:`${mt}-corner`,innerContainer:`${mt}-inner-container`,manualContainer:`${mt}-manual-container`,cornerContainer:`${mt}-corner-container`,topLeft:`${mt}-top-left`,topRight:`${mt}-top-right`,bottomLeft:`${mt}-bottom-left`,bottomRight:`${mt}-bottom-right`};function td(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function qe(t){return t===0?"0":`${t}px`}function $i(t){const e=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(e===null||e===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function Wi(t,{top:e,bottom:i,left:n,right:s}){t.style.top=e,t.style.bottom=i,t.style.left=n,t.style.right=s}let ht=class extends hi.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol"),this._locale=Ha(),this.view=null,this._applyViewPadding=()=>{const e=this.container;e&&Wi(e,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const e=this._innerContainer;e&&Wi(e,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([w(()=>[this.view?.padding,this.container],this._applyViewPadding,U),w(()=>this.padding,this._applyUIPadding,U),w(()=>[this.container,this._locale],([t,e])=>{t&&t.setAttribute("lang",e)},U),Za(t=>{this._locale=t})])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const e=this._get("container");t!==e&&(t&&(t.classList.add(j.ui),vr(t),this._attachContainers(t)),e&&(e.classList.remove(j.ui),Wi(e,{top:"",bottom:"",left:"",right:""}),e.textContent=""),this._set("container",t))}get height(){const t=this.view?.height??0;if(t===0)return t;const e=this._getViewPadding(),{top:i,bottom:n}=e;return Math.max(t-i-n,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return typeof t=="number"?{bottom:t,top:t,right:t,left:t}:{...ca,...t}}get width(){const t=this.view?.width??0;if(t===0)return t;const e=this._getViewPadding(),{left:i,right:n}=e;return Math.max(t-i-n,0)}add(t,e){let i,n,s;if(Array.isArray(t))return void t.forEach(a=>this.add(a,e));const o=$i(t);o&&({index:i,position:e,component:t,key:n}=o),e&&typeof e=="object"&&({index:i,key:n,position:e,internal:s}=e),!t||e&&!this._isValidPosition(e)||this._add(t,e,i,n,s)}remove(t,e){if(!t)return;if(Array.isArray(t))return t.map(n=>this.remove(n,e));const i=this._find(t);if(i){if(this._componentMap.has(i)&&this._componentMap.get(i)?.key!==e)return;const n=this._components.indexOf(i);return i.node.parentNode?.removeChild(i.node),this._componentMap.delete(i),i.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.splice(n,1)[0]}}empty(t,e={removeInternal:!1}){if(Array.isArray(t)){for(const s of t)this.empty(s,e);return}const i=this._positionNameToContainerLookup[t??"manual"],n=Array.prototype.slice.call(i.children).map(s=>this._findByNode(s)).filter(s=>s==null?!1:!(this._componentMap.get(s)?.internal??!1)||e.removeInternal);for(const s of n)this.remove(s)}move(t,e){if(Array.isArray(t)&&t.forEach(o=>this.move(o,e)),!t)return;let i;const n=$i(t)||$i(e);if(n&&(i=n.index,e=n.position,t=n.component||t),e&&!this._isValidPosition(e))return;const s=this.remove(t);s&&this.add(s,{position:e,index:i})}find(t){if(!t)return null;const e=this._findById(t);return e&&(e.widget||e.node)}getComponents(t,e={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap(i=>this._getComponentsAtPosition(i,e)):this._getComponentsAtPosition(t,e):this._components.filter(i=>e.includeInternal||!this._componentMap.get(i)?.internal).map(({widget:i,node:n})=>i??n)}getPosition(t){for(const e in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[e].contains(t))return e;return null}_add(t,e,i,n,s){t instanceof Je||(t=new Je({node:t}));const{widget:o}=t;o!=null&&o instanceof M&&o.addHandles(di(()=>{queueMicrotask(()=>this.remove(t))}),this._removeWidgetHandleKey),this._place({component:t,position:e,index:i}),this._components.push(t),this._componentMap.set(t,{key:n,internal:s})}_find(t){return t?t instanceof Je?this._findByComponent(t):typeof t=="string"?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??Jp}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(j.innerContainer,j.cornerContainer);const e=document.createElement("div");e.classList.add(j.innerContainer,j.manualContainer);const i=document.createElement("div");i.classList.add(j.topLeft,j.corner),t.appendChild(i);const n=document.createElement("div");n.classList.add(j.topRight,j.corner),t.appendChild(n);const s=document.createElement("div");s.classList.add(j.bottomLeft,j.corner),t.appendChild(s);const o=document.createElement("div");o.classList.add(j.bottomRight,j.corner),t.appendChild(o),this._innerContainer=t,this._manualContainer=e;const a=wr();this._cornerNameToContainerLookup={"top-left":i,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:i,"top-trailing":a?i:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:e,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const e=t.position??"manual",{component:i,index:n}=t,s=this._positionNameToContainerLookup[e],o=n!=null&&n>-1;if(td(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.from(s.children);if(n===0){const{firstChild:c}=s;return void(c?c.parentNode?.insertBefore(i.node,c):s.appendChild(i.node))}if(n>=a.length)return void s.appendChild(i.node);const h=a[n];h.parentNode?.insertBefore(i.node,h)}_toPixelPosition(t){return{top:qe(t.top),left:qe(t.left),right:qe(t.right),bottom:qe(t.bottom)}}_findByComponent(t){return this._components.find(e=>e===t)??null}_findById(t){return this._components.find(({id:e})=>e===t)??null}_findByNode(t){return this._components.find(({node:e})=>e===t)??null}_getComponentsAtPosition(t,e){const i=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(i.children).map(n=>this._findByNode(n)).filter(ni).filter(n=>e.includeInternal||!this._componentMap.get(n)?.internal).map(({widget:n,node:s})=>n??s)}};r([l()],ht.prototype,"_locale",void 0),r([l()],ht.prototype,"container",null),r([l()],ht.prototype,"height",null),r([l({value:ca})],ht.prototype,"padding",null),r([Bt("padding")],ht.prototype,"castPadding",null),r([l()],ht.prototype,"view",void 0),r([l()],ht.prototype,"width",null),ht=r([_("esri.views.ui.UI")],ht);const ed=ht,id=new Map;function nd(t){return id.get(t)}function Hs(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function sd(t,e){return t.length!==e.length||t.some((i,n)=>i.text!==e[n].text)}function fe(t,e,i){!i||!e||t.find(n=>n.layerView===e&&n.text===i)||t.push({text:i,layerView:e})}function od(t){return t.type==="bing-maps"}const gt=[];let re=class extends M{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new L,this.view=null,this._allLayerViewsChange=e=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const i=this.view?.allLayerViews;i&&(this.addHandles(i.map(n=>w(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),i.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),e?.removed&&e.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([ci(()=>this.view?.allLayerViews,"change",e=>this._allLayerViewsChange(e),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Ce(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews;if(gt.length=0,!t||!e)return void this._clear();e.forEach(n=>{if(n.suspended||!n.layer?.attributionVisible)return;const s=n.layer;if(Hs(s,"user"))return void fe(gt,n,s.copyright);if(s.hasAttributionData){if(this._fetchedAttributionData.has(n)){const a=this._fetchedAttributionData.get(n);return void(a?fe(gt,n,this._getDynamicAttribution(a,t,s)):Hs(s)&&fe(gt,n,s.copyright))}return void this._fetchAttributionData(n)}const o="portalItem"in s?s.portalItem?.accessInformation:void 0;fe(gt,n,o||s.copyright)});const i=e.find(n=>n.layer?.type==="integrated-mesh-3dtiles");if(this.view&&i){const n=nd(this.view);if(n){const s=n.getAttributionText();for(let o=0;o{const d=p.id,m=!c.has(d)&&h&&p.extent&&mn(p.extent,h);return m&&c.add(d),m}).sort((p,d)=>d.score-p.score||p.objectId-d.objectId).map(p=>p.attribution).join(", "):""}};r([l({readOnly:!0,type:L})],re.prototype,"items",void 0),r([l({readOnly:!0})],re.prototype,"state",null),r([l()],re.prototype,"view",void 0),re=r([_("esri.widgets.Attribution.AttributionViewModel")],re);const pa=re,pt={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function ad(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:ld(t[e])}}}function rd(t){const e=t?.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function ld(t){return function(e,...i){rd(e)?br(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}const ie="esri-attribution",ne={base:ie,poweredBy:`${ie}__powered-by`,sources:`${ie}__sources`,open:`${ie}--open`,sourcesOpen:`${ie}__sources--open`,link:`${ie}__link`};let W=class extends gi{constructor(t,e){super(t,e),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(i=>i.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.itemDelimiter=" | ",this.messages=null,this.viewModel=new pa}initialize(){this.addHandles(ci(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((t,e)=>(t.includes(e.text)||t.push(e.text),t),[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t={[ne.open]:this._isOpen};return B("div",{bind:this,class:this.classes(ne.base,pt.widget,t),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return B("div",{class:ne.poweredBy},"Powered by"," ",B("a",{class:ne.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const t=this._isOpen,e=this._isInteractive,i=e?0:void 0,{attributionText:n}=this,s={[ne.sourcesOpen]:t,[pt.interactive]:e};return B("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ne.sources,s),innerHTML:n,tabIndex:i})}_afterSourcesNodeCreate(t){this._prevSourceNodeHeight=t.clientWidth,this._resizeObserver.observe(t)}_checkSourceTextOverflow(t){let e=!1;const{clientHeight:i,clientWidth:n,scrollWidth:s}=t,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(e=!0),this._isOpen){const h=i{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:n}=this;return sr(n),this.goToOverride?this.goToOverride(n,i):n.goTo(i.target,i.options)}};return r([l()],e.prototype,"goToOverride",void 0),r([l()],e.prototype,"view",void 0),e=r([_("esri.widgets.support.GoTo")],e),e};let Ut=class extends dd(M){constructor(t){super(t),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(w(()=>this.view,this._updateRotationWatcher,U))}destroy(){this.view=null}get canShowNorth(){return pd(this.view)}get state(){return!this.view?.ready||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){this.view?.ready&&(this.view?.type==="2d"?this.callGoTo({target:{rotation:0},options:{animationMode:"always",duration:cd()}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(t){t!=null&&this._set("orientation",{z:t})}_updateForCamera(t){if(!t)return;const e=-t.heading;this._set("orientation",{x:0,y:0,z:e})}_updateRotationWatcher(t){this.removeAllHandles(),t&&this.addHandles(t.type==="2d"?w(()=>t?.rotation,this._updateForRotation,U):w(()=>t?.camera,this._updateForCamera,U))}};r([l({readOnly:!0})],Ut.prototype,"canShowNorth",null),r([l({readOnly:!0})],Ut.prototype,"orientation",void 0),r([l({readOnly:!0})],Ut.prototype,"state",null),r([l()],Ut.prototype,"view",void 0),Ut=r([_("esri.widgets.Compass.CompassViewModel")],Ut);const da=Ut,Zs="esri-compass",Gs={base:Zs,iconContainer:`${Zs}__icon-container`};let ft=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new da,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=i=>({transform:`rotateZ(${i.z}deg)`})}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-CW2FD2Xf.js"),__vite__mapDeps([252,4,1,2,5,253,254,255,256,257,258,259,260,261,262,263,264,265]),import.meta.url),icon:()=>b(()=>import("./calcite-icon-laqhdRBY-CcSx2g4c.js"),__vite__mapDeps([266,263,4,1,2,5,254,261]),import.meta.url)})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get icon(){return this.viewModel.state==="rotation"?"arrow-up":"compass-needle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}reset(){return this.viewModel.reset()}render(){const{orientation:t,state:e}=this.viewModel,{messages:i}=this;return B("div",{class:this.classes(Gs.base,pt.widget)},B("calcite-button",{class:pt.widgetButton,disabled:e==="disabled",kind:"neutral",label:i.reset,onclick:this._reset,round:!0,scale:"s",title:i.reset},B("div",{"aria-hidden":"true",class:Gs.iconContainer,title:i.reset},B("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(t)}))))}};r([l()],ft.prototype,"goToOverride",null),r([l()],ft.prototype,"icon",null),r([l()],ft.prototype,"label",null),r([l(),mi("esri/widgets/Compass/t9n/Compass")],ft.prototype,"messages",void 0),r([l()],ft.prototype,"view",null),r([l({type:da})],ft.prototype,"viewModel",void 0),ft=r([_("esri.widgets.Compass")],ft);const ud=ft,$s="esri-navigation-toggle",Ws={base:$s,isLayoutHorizontal:`${$s}--horizontal`};let le=class extends M{constructor(t){super(t),this._navigationMode="pan",this.view=null}initialize(){this.addHandles(Ce(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&this.view?.type==="3d"?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(t){this._navigationMode=t,this._setNavigationMode()}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}_setNavigationMode(){const t=this.view?.inputManager;t&&(t.primaryDragAction=this._navigationMode==="pan"?"pan":"rotate")}};r([l({readOnly:!0})],le.prototype,"state",null),r([l()],le.prototype,"_navigationMode",void 0),r([l()],le.prototype,"view",void 0),le=r([_("esri.widgets.NavigationToggle.NavigationToggleViewModel")],le);const ua=le;let vt=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new ua,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const i=this.viewModel?.navigationMode==="pan"?this._rotateButton:this._panButton;Tr(i),this.toggle()}}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-CW2FD2Xf.js"),__vite__mapDeps([252,4,1,2,5,253,254,255,256,257,258,259,260,261,262,263,264,265]),import.meta.url)})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t=this.viewModel?.state==="disabled",e=this.viewModel?.navigationMode==="pan",i=this.messages.toggle;return B("div",{class:this.classes(Ws.base,pt.widget,{[Ws.isLayoutHorizontal]:this.layout==="horizontal"})},B("calcite-button",{afterCreate:n=>{this._panButton=n},appearance:e?"outline-fill":"solid",class:pt.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?void 0:-1,title:i}),B("calcite-button",{afterCreate:n=>{this._rotateButton=n},appearance:e?"solid":"outline-fill",class:pt.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?-1:void 0,title:i}))}};r([l()],vt.prototype,"icon",null),r([l()],vt.prototype,"label",null),r([l({value:"vertical"})],vt.prototype,"layout",null),r([l(),mi("esri/widgets/NavigationToggle/t9n/NavigationToggle")],vt.prototype,"messages",void 0),r([l()],vt.prototype,"view",null),r([l({type:ua})],vt.prototype,"viewModel",void 0),vt=r([_("esri.widgets.NavigationToggle")],vt);const md=vt;let jt=class extends M{get canZoomIn(){if(!this.view?.ready)return!1;const t=this.view?.constraints?.effectiveMaxScale;return t===0||this._scale>t}get canZoomOut(){const{view:t}=this;if(!t?.ready)return!1;const e=t.constraints?.effectiveMinScale;return e===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-CW2FD2Xf.js"),__vite__mapDeps([252,4,1,2,5,253,254,255,256,257,258,259,260,261,262,263,264,265]),import.meta.url)})}get icon(){return"magnifying-glass-plus"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}set view(t){this.viewModel.view=t}get view(){return this.viewModel.view}render(){const t={[Us.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:e,canZoomOut:i}=this.viewModel,{zoomIn:n,zoomOut:s}=this.messages;return B("div",{class:this.classes(Us.base,pt.widget,t)},B("calcite-button",{class:pt.widgetButton,disabled:!e,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),B("calcite-button",{class:pt.widgetButton,disabled:!i,iconStart:"minus",kind:"neutral",label:s,onclick:this.zoomOut,title:s}))}};r([l()],wt.prototype,"icon",null),r([l()],wt.prototype,"label",null),r([l({value:"vertical"})],wt.prototype,"layout",null),r([l(),mi("esri/widgets/Zoom/t9n/Zoom")],wt.prototype,"messages",void 0),r([l()],wt.prototype,"view",null),r([l({type:ma})],wt.prototype,"viewModel",void 0),wt=r([_("esri.widgets.Zoom")],wt);const _d=wt;function fd(t){return t?.view!==void 0}let ti=class extends ed{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=e=>{this.components.forEach(i=>{const n=this._find(i),s=n?.widget;fd(s)&&(s.view=e)})},this._componentsWatcher=(e,i)=>{this._removeComponents(i),this._addComponents(e),this._adjustPadding(e)}}initialize(){this.addHandles([w(()=>this.components,this._componentsWatcher,U),w(()=>this.view,this._updateViewAwareWidgets,U)])}_add(t,e,i,n,s){let o=t;if(typeof t=="string"&&this._defaultPositionLookup[t]){if(this._find(t))return;o=this._createComponent(t)}super._add(o,e,i,n,s)}_removeComponents(t){t.forEach(e=>{const i=this._find(e);i&&(this.remove(i),i.destroy())})}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:e}=this.padding;this.padding=e}}_addComponents(t){this.constructed&&t.forEach(e=>this.add(this._createComponent(e),this._defaultPositionLookup[e]))}_createComponent(t){const e=this._createWidget(t);return new Je({id:t,node:e})}_createWidget(t){const e=this.view;switch(t){case"attribution":return new hd({view:e});case"compass":return new ud({view:e});case"navigation-toggle":return new md({view:e});case"zoom":return new _d({view:e})}}};r([l()],ti.prototype,"components",void 0),ti=r([_("esri.views.ui.DefaultUI")],ti);const ga=ti;let ei=class extends ga{constructor(t){super(t),this.components=["attribution","zoom"]}};r([l()],ei.prototype,"components",void 0),ei=r([_("esri.views.ui.2d.DefaultUI2D")],ei);const ya=ei;class vd extends ol{constructor(e,i){super(e,i,"webmap")}}function Ui(t){return t!=null&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.WebMap"}new vd(2,32);let _a,fa,va,wa,ba,Ta,Ma;async function wd(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:n,MagnifierView2D:s,GridView2D:o,Stage:a}]=await Promise.all([b(()=>import("./webglDeps-Bgavuh0h-8J_tuBZH.js"),__vite__mapDeps([139,140,1,2,133,132,141,142,143,144]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-CEta8iLu.js"),__vite__mapDeps([145,1,2,114,43,44,22,45,146,147,56,148,28,27,131,110,111,112,113,76,109,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,120,154,126,144,155,156,143,130,157,158,25,20,21,159,160,161,162,57,37,135,163,164,42,46,165,166,167,139,142,168,169,170,171,63,41,172,173,59,60,51,52,49,53,174,90,40,32,175,176,177,178,179,134,180,55,181,182,183,184,185,186,187,188,189,190,191,192,8,117,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,39,136]),import.meta.url)]);fa=t,va=e,wa=i,ba=n,Ta=s,Ma=o,_a=a}let v=class extends hl(kl(ml(gh))){constructor(t){super(t),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new Xe({view:this}),this.graphicsView=null,this.stateManager=new Z({constraints:new Go({view:this})}),this.stationaryManager=new Pe,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new xc(this),this.floors=new L,this.grid=null,this.highlights=Jo(),this.inputManager=new hp({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new ha,this.type="2d",this.view2dType=null,this.ui=new ya,this.test={takeScreenshot:async e=>Up(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([w(()=>this.viewpoint,()=>this.stationaryManager.flip(),Ee),this.on("resize",e=>this.stateManager.resize(e.width,e.height))]),gr()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=tt(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new dp(this.featuresTilingScheme)}get constraintsInfo(){const t=this.defaultsFromMap?.tileInfo,e=this.spatialReference;return{lods:t?.spatialReference?.equals(e)?t.lods:null,spatialReference:e}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:t,constraints:e,center:i,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(e?.effectiveLODs||(o=-1),(!i||t===0&&o===-1)&&(n?.targetGeometry==null||n.targetGeometry.type!=="extent"&&!n.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const e=t.targetGeometry,i=this.spatialReference;return yr(e.spatialReference,i)}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get background(){return Ui(this.map)?this.map.initialViewProperties.background:null}set background(t){this._override("background",t)}get center(){return this.stateManager?.center??null}set center(t){this.stateManager.center=t}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get highlightOptions(){return Lp(this)}set highlightOptions(t){Vp(this,t)}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get scale(){return this.stateManager?.scale??0}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const t=!(!this.magnifier.visible||this.magnifier.position===null||!this._magnifierView?.updatingHandles.updating),e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(i=>!i.destroyed&&!("layerViews"in i)&&i.updating===!0)||t);if(z("esri-2d-log-updating")){const i=this.allLayerViews.reduce((n,s)=>({...n,[`${s.layer.id}(${s.layer.type})`]:!s.destroyed&&!("layerViews"in s)&&s.updating}),{});console.log(`Updating MapView: ${e} +-> Null LayerViewManager: ${!this.layerViewManager} +-> Null LabelManager: ${!this.labelManager} +-> Null GraphicsView: ${!this.graphicsView} +-> layerViewManager.updating: ${this.layerViewManager?.updating} +-> labelManager.updating: ${this.labelManager?.updating} +-> graphicsView.updating: ${this.graphicsView?.updating} +-> allLayerViews: ${JSON.stringify(i)} +-> updatingMagnifier: ${t} +`)}return e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(t){this.stateManager.viewpoint=t,this.frameTask.requestFrame()}get visibleArea(){const t=this.stateManager.visibleArea;return t&&new Xs({rings:[t.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference})}get zoom(){return this.stateManager.zoom??-1}set zoom(t){this.stateManager.zoom=t}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(t,e){return this.goToManager.goTo(t,e)}async hitTest(t,e){return Op(this,t,e)}async takeScreenshot(t){return Wp(this._getScreenshotView(t),t)}toMap(t){if(!this.ready)return null;const e=vo(t)?fo(this,t):t;return this.stateManager.toMap(e)}toScreen(t,e){return this.stateManager.toScreen(t,e)}on(t,e,i,n){return this.inputManager&&this.viewEvents.on(t,e,i,n)||super.on(t,e)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}whenLayerView(t){return super.whenLayerView(t)}graphicChanged(t){this.graphicsView&&this.graphicsView.graphicUpdateHandler(t)}whenReady(){return new Promise(t=>{this.ready?t(this):this._resolveWhenReady.push(t)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return Ui(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return Ui(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(t){return ws.hasLayerViewModule(t)}importLayerView(t){return ws.importLayerView(t)}pixelSizeAt(){return this.ready?this.resolution:(D.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(t){const e=this.toMap(t),i=await this.hitTest(t),n=this.allLayerViews.toArray().filter(c=>c.clips.every(p=>Xo(this,p,t,e))).reverse(),s=new globalThis.Map(n.map(c=>[c.layer.uid,c])),o=[];let a=0,h=0;for(;athis._updateStageChildren()),e.on("webgl-error",a=>this.fatalError=a.error),w(()=>this.stationary,a=>e.stationary=a,ct),w(()=>this.background,a=>{e.backgroundColor=a?.color,this._magnifierView.backgroundColor=a?.color},ct),w(()=>this.magnifier,a=>this._magnifierView.magnifier=a,ct),w(()=>this.grid,a=>this._gridView.grid=a,ct),w(()=>this.renderingOptions,a=>e.renderingOptions=a,ct),w(()=>this.highlights.items.map(a=>({name:a.name,options:{fillColor:a.options.color,haloColor:a.options.haloColor,fillOpacity:a.options.fillOpacity,haloOpacity:a.options.haloOpacity,haloWidth:a.options.haloWidth,haloBlur:a.options.haloBlur}})),()=>{e.highlightGradient=Dp(e.highlightGradient,this.highlights.items)},ct),w(()=>this.state.id,()=>e.state=this.state,ct)],"map-view"),this._updateStageChildren();const o=this._resolveWhenReady;this._resolveWhenReady=[],o.forEach(a=>a(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const t=this.graphicsView;this.stage.addChild(t.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const t=new Ar(fr.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",t);const e=new fa({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new va(t)});this._set("graphicsView",e)}_destroySpatialReferenceDependentProperties(){const t=this.graphicsView;this._set("graphicsView",null),t.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(t){const{allLayerViews:e,padding:i,size:n,stage:s}=this;return{allLayerViews:e,backgroundColor:t?.ignoreBackground?null:this.background?.color,padding:i,size:n,stage:s}}_spatialReferenceChanged(t){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(t),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};v.type="2d",r([l({readOnly:!0})],v.prototype,"animationManager",void 0),r([l({constructOnly:!0})],v.prototype,"deactivatedWebGLExtensions",void 0),r([l({constructOnly:!0})],v.prototype,"debugWebGLExtensions",void 0),r([l({readOnly:!0})],v.prototype,"featuresTilingScheme",void 0),r([l({readOnly:!0})],v.prototype,"fullOpacity",void 0),r([l()],v.prototype,"goToManager",void 0),r([l({readOnly:!0})],v.prototype,"graphicsTileStore",null),r([l()],v.prototype,"graphicsView",void 0),r([l()],v.prototype,"stateManager",void 0),r([l()],v.prototype,"constraintsInfo",null),r([l({readOnly:!0})],v.prototype,"state",null),r([l()],v.prototype,"initialExtentRequired",null),r([l()],v.prototype,"labelManager",void 0),r([l({readOnly:!0})],v.prototype,"mapViewNavigation",void 0),r([l({constructOnly:!0})],v.prototype,"renderCanvas",void 0),r([l()],v.prototype,"renderingOptions",void 0),r([l({constructOnly:!0})],v.prototype,"supersampleScreenshotsEnabled",void 0),r([l({readOnly:!0})],v.prototype,"supportsGround",void 0),r([l()],v.prototype,"defaultsFromMapSettings",null),r([l({readOnly:!0})],v.prototype,"typeSpecificPreconditionsReady",null),r([l()],v.prototype,"animation",null),r([l({type:al})],v.prototype,"background",null),r([l()],v.prototype,"center",null),r([l({type:Go})],v.prototype,"constraints",null),r([l()],v.prototype,"extent",null),r([l()],v.prototype,"floors",void 0),r([l()],v.prototype,"grid",void 0),r([l({type:Yt})],v.prototype,"highlightOptions",null),r([l({type:L.ofType(pe)})],v.prototype,"highlights",void 0),r([l({readOnly:!0})],v.prototype,"inputManager",void 0),r([l()],v.prototype,"map",void 0),r([l()],v.prototype,"padding",null),r([l({readOnly:!0})],v.prototype,"rendering",null),r([l()],v.prototype,"resizeAlign",null),r([l({readOnly:!0})],v.prototype,"resolution",null),r([l()],v.prototype,"rotation",null),r([l()],v.prototype,"scale",null),r([l({constructOnly:!0})],v.prototype,"spatialReferenceLocked",void 0),r([l()],v.prototype,"stationary",null),r([l({readOnly:!0})],v.prototype,"tileInfo",null),r([l({type:ha,readOnly:!0})],v.prototype,"timeline",void 0),r([l({readOnly:!0})],v.prototype,"type",void 0),r([l({readOnly:!0})],v.prototype,"updating",null),r([l({readOnly:!0})],v.prototype,"view2dType",void 0),r([l()],v.prototype,"viewpoint",null),r([l({readOnly:!0})],v.prototype,"visibleArea",null),r([l()],v.prototype,"zoom",null),r([l({readOnly:!0})],v.prototype,"navigating",null),r([l(),Bt(t=>t instanceof ga?t:Ga(ya,t))],v.prototype,"ui",void 0),v=r([_("esri.views.View2D")],v);const bd=v;let ii=class extends bd{constructor(t){super(t),this.view2dType="map"}};r([l({readOnly:!0})],ii.prototype,"view2dType",void 0),ii=r([_("esri.views.MapView")],ii);const Td=ii,Ou=Object.freeze(Object.defineProperty({__proto__:null,default:Td},Symbol.toStringTag,{value:"Module"}));export{xh as $,Ds as A,Eu as B,Cu as C,Ko as D,Es as E,Sp as F,Vo as G,Iu as H,pt as I,wo as J,dd as K,Cs as L,Cp as M,Ls as N,_h as O,gl as P,Ie as Q,li as R,Vs as S,rt as T,Vu as U,Ou as V,At as _,Dp as a,Vp as b,Nh as c,cd as d,Ye as e,nt as f,Do as g,Lu as h,pe as i,Mu as j,vi as k,Yt as l,Lo as m,xu as n,Yo as o,Lh as p,Rp as q,Lp as r,Du as s,Ru as t,xt as u,Pu as v,Su as w,up as x,ha as y,ku as z}; diff --git a/main/assets/MapView-BGOJJ8ch-Dom5daUl.js b/main/assets/MapView-BGOJJ8ch-Dom5daUl.js deleted file mode 100644 index 569f3e6b3..000000000 --- a/main/assets/MapView-BGOJJ8ch-Dom5daUl.js +++ /dev/null @@ -1,14 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Popup-DFFZHG5j-DuBwb8-M.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./substitute-j49H6mVR-DelduE0n.js","./themeUtils-YjM7iIiX-xQe6qdbF.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./ReactiveSet-QxEZenFW-Cl_EaQiS.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./Cyclical-C_9rKUUQ-CmN6QXv-.js","./AttachmentInfo-D9RFO8W2-CP6YNuYr.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./Query-BrwMGK8U-sojFdYaD.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./utils-DyydRFHu-D-5zlVyA.js","./Basemap-BEqqSTw9-BkQ-c4vY.js","./loadAll-e978YItg-CB-7_cng.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./writeUtils-D5qlLkwk-DIX6zS6N.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./common-CYWrYyJl-E8-sukrT.js","./RendererLegendOptions-K3md58-X-B6y5tQg5.js","./utils-DPtQ14k3-D1wtSpry.js","./parser-DyDJ-rlI-mkgQEqcN.js","./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js","./utils-SPbpQbmm-DpAlEmQT.js","./enums-CpSG_SL3-BMD3Tb1v.js","./LRUCache-C3erQTWv-CeYLuvL9.js","./jsonUtils-C64Zfu7c-trwRB9M4.js","./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./colorRamps-q0bZVhs2-Bqen3nIx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./styleUtils-BtpNqZyT-B-RFL3S3.js","./Version-CoKzbupV-BxOJQpf3.js","./FieldsIndex-HmzMbJQG-CiA2Ur00.js","./UnknownTimeZone-C--TOcPG-hkNbcn35.js","./OverrideHelper-DWRbVlj1-C2SNS5Gu.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./quantizationUtils-bJy1cRwp-72T4gbed.js","./heatmapUtils-seiMkkkR-D9lAE87R.js","./executeQueryJSON-CcHnccia-DVecwfbV.js","./utils-9sQxfkoa-Cus_qP6M.js","./query-DFW9-NG_-1nHUNdNu.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-Bq23Xwmj-sYd6uuv5.js","./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js","./pbf-D-y3_eZO-BOjQwfR-.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./shared-D1w-26bA-Cy2KeMh-.js","./TimeOnly-DSMefxKy-DBJeVQCe.js","./FeatureLayer-BrRKw5Si-CHreUEJ9.js","./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js","./commonProperties-BtIqvFU_-Brj0aAM1.js","./ElevationInfo-yv2-9tj6-pjIBBQET.js","./FeatureLayerBase-vvYyZTfh-K4Z036-G.js","./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./featureLayerUtils-DgfQQyK4-D6z7j0IK.js","./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js","./Relationship-PyhUibYK-Bz6HFiBe.js","./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js","./Layer-ChoECxvZ-C4wLrCej.js","./workers-PiCjreoO-oGzLvkSt.js","./editsZScale-BDsX6vv--CeDyYvz6.js","./APIKeyMixin-BUMSx9ny-xmyEzAt4.js","./ArcGISService-BYA-y6X6-DLcDzG-r.js","./BlendLayer-D1WkSmwP-UVXywJXM.js","./jsonUtils-wIllKWI4-DQ36DuUP.js","./CustomParametersMixin-vdKsTHer-CoiI71pj.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js","./FeatureEffect-CDEk9Es7-DK_N6ZYk.js","./FeatureFilter-BCFHgLVU-BSMrX0wh.js","./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js","./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js","./labelingInfo-DGVNul26-CXiwzGiu.js","./labelUtils-BW14kBqX-8wHrIU-s.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-KEXCVZUA.js","./OrderedLayer-6Qsmrd_l-CGz1PXc3.js","./OrderByInfo-GD2XnU8e-C-uyyo-i.js","./PortalLayer-CElnYuSQ-tfjbIq8z.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js","./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js","./TemporalLayer-CpOrN_w9-kgJDrMMF.js","./TimeInfo-w_HB2CsF-wq_g9Zh1.js","./FeatureTemplate-SPHPD45f-tAS5Ccaa.js","./FeatureType-C9hJmS6_-pVJc0p7X.js","./fieldProperties-Bq26w7gt-DT6oRGMS.js","./versionUtils-LZYZz-38-xZnsxhiL.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js","./popupUtils-B0uZcXX0-BqljON9c.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./ReactiveMap-CFk6jPfN-Dz1UG3IA.js","./Tile-D75RMC64-DprBAZDK.js","./TileKey-C5IL-JBr-0HJjsV9n.js","./vec2-tHZ6OaOy-xCj1obDt.js","./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js","./signal-CETehA7D-vStzfbaY.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./layerViewUtils-DURAPenP-BHbJhKE8.js","./CollectionFlattener-DkHuHn5E-D3nwGseo.js","./TileInfo-CWIRDhZl-BN68IeQv.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./UpdatingHandles-CUu3u1ms-D2fDxJPP.js","./Map-1zd11DKO-DdBAdkuj.js","./TablesMixin-C8RojhYs-DjK1Q1jj.js","./GraphicsCollection-CWTXNZOX-8-_pDOZK.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DXVwwlDm.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-D-X9O5uh.js","./imageUtils-BA2D6Uf1-BIs7TUww.js","./capabilities-agoTWNzb-CtsNgRyk.js","./ColorBackground-gVZldRLm-BDCeusMw.js","./geometryServiceUtils-nsujb7BH-D7iwbaPn.js","./project-DQKhruav-CYVbgcFi.js","./webglDeps-Bgavuh0h-C76lWx0y.js","./BufferObject-BM_7mcDb-QLZylgsX.js","./Program-DLVwTiPA-DUDrdGpa.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./ProgramTemplate-DQOm6Omy-B2krln6G.js","./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js","./mapViewDeps-CUVU8gUp-qsLwuAiC.js","./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js","./BidiEngine-Bdqv5H5j-Dyqh9XG-.js","./GeometryUtils-NHgB9gGQ-CDTp-_cE.js","./Rect-DD6XS68q-D_hsV3ag.js","./LabelMetric-BeluzH3o-Dwc7BaHL.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./BindType-9iOk18Ed-CRW1cdX4.js","./Util-BjGjeg6f-08Szkf4F.js","./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js","./constants-Bqe1QJ4u-F8oTIn7N.js","./WGLContainer-LxgEo4I_-DOcf4AGd.js","./vec3f32-BS0cezmI-B_madU1n.js","./Container-BcuL1ZEG-DH5lSN9D.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./config-nuMERBvb-MDUrh2eL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./featureConversionUtils-D6hFQ4Af-CkdezteH.js","./SDFHelper-B6k8Ig6R-KWOw5fv6.js","./floatRGBA-4pIJN00G-DwTr03sX.js","./PieChartMeshWriter-C5yLDFwp-CJPWs81O.js","./TurboLine-CIlsAy5m-BrOlSIM-.js","./enums-qHpGJ28Q-CmnLAccm.js","./GridShader-75bC4UUM-Czob75PE.js","./CircularArray-DaQg3PQl-BXS52LZy.js","./testSVGPremultipliedAlpha-DoZe_f0d-C4elE3ip.js","./AttributeStore-DjyP9U7y-BoiLAPK2.js","./timeSupport-jPViR5jn-DVbPitWZ.js","./queryUtils-Brxu6254-DDAvXp_C.js","./json-BI97KiBB-Ce5cWfI2.js","./RenderingContext-DbCVbtGZ-hbunXxQg.js","./renderState-Dap0WV9P-D4IHxyei.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./rasterizingUtils-BmlDdKBf-DQEZ-U2L.js","./utils-Dcs650Ic-BihsMOxb.js","./grouping-RwmXkHDc-CUd3AkxY.js","./MeshWriterRegistry-CIC9Yk_f-DL00Jm1o.js","./GraphicsView2D-C4wYE2ut-zRbzrMcC.js","./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js","./GraphicContainer-DuOHUciE-BvzcbTDZ.js","./AGraphicContainer-LUCT6Gle-CGns4AG2.js","./TechniqueInstance-DGTKoOL6-DTmGWHpp.js","./TileContainer-D48pXXgL-DNbVOEpu.js","./requestImageUtils-Ut4YcoNU-DS9BT3TV.js","./scaleUtils-DxsfQwK1-OKeSqBb9.js","./geodesicUtils-B8mFUfTk-CCpgrgwm.js","./TileLayerView2D-CT-Yu10P-BUH8mf5a.js","./imageUtils-Co-ELErj-CxjujewR.js","./Bitmap-CcqmzvfR-Cl_blWW9.js","./LayerView-Bish-E63-DRGspiuk.js","./HighlightGraphicContainer-Dt5r6lMq-C0o3U8Y8.js","./RefreshableLayerView-BdQpGYly-BX6IwUNP.js","./MapServiceLayerViewHelper-bw3M4B8s-BT4W8OxK.js","./languageUtils-BYxF9hRA-Dig_Awzu.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./number-eRKYXfX9-B-l8dJUS.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./drapedUtils-BZ1SGPtE-DN0L7Y_o.js","./sublayerUtils-CyM0QC5B-BB_azrTi.js","./popupUtils-nV1O8RUO-xbvi-u4x.js","./FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js","./timeSupport-ohWmWReZ-CwKm-94j.js","./HighlightCounter-DFWq7PnG-L3ompOf4.js","./BaseDynamicLayerView2D-AQ-6l0DU-Cy76IH9A.js","./BitmapContainer-BC8fvmFc-DzZ9OrT1.js","./ExportStrategy-BNE7Gp0u-CVNDsUmZ.js","./CatalogLayerView2D-DaUVeBuS-Ngx1vfNP.js","./CatalogDynamicGroupLayerView2D-Cf-H7gda-DaXR8CGJ.js","./CatalogFootprintLayerView2D-C0bBWVdF-E56VRyOl.js","./GeoRSSLayerView2D-BLTYupUX-CpOPIa_K.js","./GraphicsLayerView2D-CGXlTqHO-2KIrsS1c.js","./GroupLayerView2D-BR-kLeLa-qMUg5_Ou.js","./ImageryLayerView2D-CVDvTIGY-5bfgF9Fc.js","./RasterVFDisplayObject-CnriTVT9-DOIQa1VK.js","./dataUtils-BkPy4R3C-B2SUbyy5.js","./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js","./ImageryTileLayerView2D-nEz2YhMc-C3hXr143.js","./multidimensionalUtils-BwTugeu7-CpzGLouA.js","./rasterUtils-DqAu9qES-Bysf-lKe.js","./RawBlockCache-Cj_tmHDm-d1RSObdh.js","./KMLLayerView2D-hWgNYT5J-CetUHy5g.js","./kmlUtils-C5oIEoOy-CLmxrxRw.js","./KnowledgeGraphLayerView2D-BnEbgXue-BMJK-YHI.js","./MapImageLayerView2D-LI7T-1xm-N5aTEI2-.js","./ExportImageParameters-DxyNGQ57-DAeGZbW_.js","./MapNotesLayerView2D-EusnP8A_-DsvgmiI6.js","./MediaLayerView2D-COWFkA3m-DvWbYXdD.js","./perspectiveUtils-Bu88xlbg-Dy8WOySc.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./OverlayContainer-BEHcBpu0-D3apgE9b.js","./OGCFeatureLayerView2D-CpSy5D2s-D3QUvTvd.js","./RouteLayerView2D-Bpui7Ggx-XzTkMJjI.js","./Stop-he5xSAJJ-B5QVbzdn.js","./StreamLayerView2D-Bh_aEalU-6VUJB3H7.js","./SubtypeGroupLayerView2D-Byn0xzbb-C7M02_8L.js","./VectorTileLayerView2D-B9OYHbL4-CpvgTk0s.js","./PooledRBush-DbfAmeLn-DzJ6h3wI.js","./SourceLayerData-BT_Ywuvg-BR7vjYvJ.js","./StyleRepository-D3WuVprR-COU4Jcir.js","./VideoLayerView2D-CLcxq4ZA-BYf0Uwhu.js","./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js","./TelemetryDisplay-Bq2PXfI8-BWfBxjew.js","./WMSLayerView2D-Dz-z-fa9-DL6MC_DE.js","./ExportWMSImageParameters-CMk80WSM-CXXj-iAb.js","./WMTSLayerView2D-Bl5FUDUu-BIlJfFno.js","./calcite-button-Cm9_TJei-BWKp46iV.js","./form-CRSw616T-Cd5gFTXp.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-DrUFww1w.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-Cc9Ee-I5.js","./locale-Cn_GDVD_-CiwD7jxT.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-DJJPVpPW.js","./t9n-C_hcZMZJ-BmtPt6-4.js","./icon-BXFbBbop-O5hL8B42.js","./loader-Ch7Jr16w-ztJ2p2Gj.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-Bm5S9Lju.js"])))=>i.map(i=>d[i]); -import{v as r,S as l,i as _,aa as js,e as cn,w as V,ab as bt,ac as ka,a0 as Ea,ad as Bt,ae as ke,af as Ca,g as Vn,K as z,I as hi,ag as L,ah as w,ai as ci,aj as Ia,ak as Ft,al as st,am as Da,an as Ra,ao as On,ap as La,aq as ni,j as M,ar as Pt,as as H,C as Va,at as Oa,au as qs,av as Ee,o as C,aw as pn,ax as ct,ay as dn,az as Aa,a1 as D,aA as tt,aB as An,aC as pi,aD as za,aE as Na,aF as Ce,n as Xt,J as si,aG as Bs,aH as un,aI as mn,aJ as Ks,p as Ys,aK as Fa,h as Ha,aL as U,aM as Za,a2 as di,aN as it,l as Xs,aO as Ga,aP as $a,b as ui,aQ as Wa,aR as bi,aS as Qs,aT as Ua,aU as Js,B as ja,aV as Re,aW as ji,x as qa,aX as Ba,t as to,aY as eo,aZ as de,$ as Ot,a_ as Ka,a$ as Ya,b0 as zn,b1 as Xa,b2 as Qa,b3 as Ja,b4 as tr,b5 as Nn,b6 as er,b7 as ir,b8 as nr,O as sr,_ as b,b9 as Fn,ba as ze,L as or,bb as ar,bc as rr,bd as Hn,be as lr,bf as hr,E as Ti,bg as cr,d as io,bh as Ne,bi as pr,bj as gn,bk as dr,bl as Fe,bm as ur,bn as X}from"./main-BZaw9FpY.js";import{c as mr}from"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import{f as no}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import{F as gr,B as Zn}from"./workers-PiCjreoO-oGzLvkSt.js";import{K as Le,B as yr,_ as yn,J as _n,W as fn}from"./projection-BA9M1R7d-DoNqITCd.js";import{d as _r,V as fr}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{z as vr,H as wr,_ as mi,o as Gn,K as so,q as br,R as gi,P as B,k as vn,X as Tr,V as $n}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{i as yi}from"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import{o as Mr}from"./signal-CETehA7D-vStzfbaY.js";import xr from"./Map-1zd11DKO-DdBAdkuj.js";import{o as oo,u as Wn,s as Pr}from"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import{M as wn}from"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import{k as Sr}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{v as Mi}from"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import{h as kr}from"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import{b as Un}from"./Query-BrwMGK8U-sojFdYaD.js";import{i as Er}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{l as jn}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{o as O,e as Cr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as N,v as _i,T as ao,i as qi,j as qn,A as Ir,S as Dr,h as Bn,b as Rr,L as Tt,d as Se,f as Lr,_ as Vr}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{r as ro,n as xi}from"./common-CYWrYyJl-E8-sukrT.js";import{s as Or,t as lo,Q as Ar,U as ho,l as zr,n as co,e as bn,i as oi,V as Nr,Z as Kn,k as Fr,o as Hr}from"./Tile-D75RMC64-DprBAZDK.js";import{c as Tn,a as Zr}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{Q as Gr,R as $r,C as Yn,D as Wr,E as Ur}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Xn}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{r as jr,F as qr}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{W as Br,u as Pi}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import{s as Kr}from"./TileKey-C5IL-JBr-0HJjsV9n.js";import{L as Yr}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{e as He,u as Xr,i as Qr,t as Qn}from"./definitions-DJSdSb77-DkoRHaVx.js";import{L as Jr,D as Si,G as tl}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as el,V as il}from"./Texture-BCt2hphT-D-X9O5uh.js";import{y as nl}from"./imageUtils-BA2D6Uf1-BIs7TUww.js";import{n as sl}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{m as ol}from"./Version-CoKzbupV-BxOJQpf3.js";import al from"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";let Ht=class extends $a{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return t!=null&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"row",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"column",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"rows",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"columns",void 0),Ht=r([_("esri.CameraLayout")],Ht);const po=Ht;let at=class extends js(cn){constructor(...t){super(...t),this.position=new V([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new po}normalizeCtorArgs(t,e,i,n){if(t&&typeof t=="object"&&("x"in t||Array.isArray(t))){const s={position:t};return e!=null&&(s.heading=e),i!=null&&(s.tilt=i),n!=null&&(s.fov=n),s}return t}writePosition(t,e,i,n){const s=t.clone();s.x=bt(t.x||0),s.y=bt(t.y||0),s.z=t.hasZ?bt(t.z||0):t.z,e[i]=s.write({},n)}readPosition(t,e){const i=new V;return i.read(t,e),i.x=bt(i.x||0),i.y=bt(i.y||0),i.z=i.hasZ?bt(i.z||0):i.z,i}equals(t){return t!=null&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};r([l({type:V,json:{write:{isRequired:!0}}})],at.prototype,"position",void 0),r([ka("position")],at.prototype,"writePosition",null),r([Ea("position")],at.prototype,"readPosition",null),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>mr.normalize(bt(t)))],at.prototype,"heading",void 0),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>ke(bt(t),-180,180))],at.prototype,"tilt",void 0),r([l({type:Number,nonNullable:!0,json:{default:55,write:!0}}),Bt(t=>ke(bt(t,55),1,170))],at.prototype,"fov",void 0),r([l({type:po,nonNullable:!0,json:{read:!1,write:!1}})],at.prototype,"layout",void 0),at=r([_("esri.Camera")],at);const rl=at;var Bi;let Et=Bi=class extends cn{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new Bi({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"rotation",void 0),r([Bt("rotation")],Et.prototype,"castRotation",null),r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"scale",void 0),r([l({types:Ca,json:{read:Vn,write:!0,origins:{"web-scene":{read:Vn,write:{overridePolicy:ki}}}}})],Et.prototype,"targetGeometry",void 0),r([l({type:rl,json:{write:!0}})],Et.prototype,"camera",void 0),Et=Bi=r([_("esri.Viewpoint")],Et);const nt=Et;function ki(){return{enabled:!this.camera}}const Be={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(t){const e=t.viewSize[1],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(t){const e=t.viewSize,i=e[0],n=e[1],s=this.values;return n>=i?s.portrait:s.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Ei={xsmall:544,small:768,medium:992,large:1200};function ll(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Ei}initialize(){this.addHandles(w(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),U))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i!==this._get("breakpoints")){if(!ll(i)){const n=JSON.stringify(Ei,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n),i=Ei}this._set("breakpoints",{...i})}}_updateClassNames(){if(!this.container)return;const i=ze.acquire(),n=ze.acquire();let s,o=!1;for(s in Be){const a=this[s],h=Be[s].getValue({viewSize:this.size,breakpoints:this.breakpoints});a!==h&&(o=!0,this[s]=h,Ci(s,a).forEach(c=>n.push(c)),Ci(s,h).forEach(c=>i.push(c)))}o&&(this._applyClassNameChanges(i,n),ze.release(i),ze.release(n))}_applyClassNameChanges(i,n){const s=this.container;s&&(n.forEach(o=>s.classList.remove(o)),i.forEach(o=>s.classList.add(o)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let n;for(n in Be)Ci(n,this[n]).forEach(s=>i.classList.remove(s))}};return r([l()],e.prototype,"breakpoints",null),r([l()],e.prototype,"orientation",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),r([l()],e.prototype,"heightBreakpoint",void 0),e=r([_("esri.views.BreakpointsOwner")],e),e};let Ct=class extends M{constructor(){super(...arguments),this.items=new L,this._watchUpdatingTracking=new yi,this._callbacks=new Map,this._projector=Gn(),this._hiddenProjector=Gn()}get needsRender(){return this.items.length>0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,e=>{for(const i of e.added){const n=()=>i.render();this._callbacks.set(i,n),this._projector.append(this.surface,n)}for(const i of e.removed){const n=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(n.domNode),this._callbacks.delete(i)}})}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach(t=>this._projector.detach(t)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,i=this._hiddenProjector;let n;const s=()=>(n=t.render(),n);i.append(e,s),i.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n?.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(i.detach(s);e.firstChild;)e.removeChild(e.firstChild);return o}overlaps(t,e){const i=this.computeBoundingRect(t),n=this.computeBoundingRect(e);return Math.max(i.left,n.left)<=Math.min(i.right,n.right)&&Math.max(i.top,n.top)<=Math.min(i.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(t=>t.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(t,e){const i=!!e?.disableDecorations;if(!this.items.some(s=>s.visible&&!(i&&s.isDecoration)))return;const n=t.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{i&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};r([l({readOnly:!0})],Ct.prototype,"surface",void 0),r([l({readOnly:!0})],Ct.prototype,"items",void 0),r([l({readOnly:!0})],Ct.prototype,"needsRender",null),r([l({readOnly:!0})],Ct.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],Ct.prototype,"updating",null),Ct=r([_("esri.views.overlay.ViewOverlay")],Ct);const Jn=Ct,Ii=[0,0];function cl(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return Ii[0]=i.left+(e?.pageXOffset??0),Ii[1]=i.top+(e?.pageYOffset??0),Ii}function ts(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}function pl(t){const e=document.createElement("div");return t.appendChild(e),e}const me=16,Ze=750,dl=512,ul=2,ml=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:me,time:Ze},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([w(()=>this.cursor,n=>{const{surface:s}=this;s&&s.setAttribute("data-cursor",n)}),w(()=>this.navigating,n=>{const{surface:s}=this;s&&s.setAttribute("data-navigating",n.toString())})])}initialize(){this.addHandles([w(()=>this.ui,(i,n)=>this._handleUIChange(i,n),U),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=tt(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const n=this._get("container"),s=so(i);if(s||typeof i!="string"||D.getLogger(this).error("#container",`element with id '${i}' not found`),n===s)return;if(this._stopMeasuring(),n&&(n.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(ts(this.root),this._set("root",null)),this.userContent&&($n(this.userContent,n),ts(this.userContent),this._set("userContent",null))),!s)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);s.classList.add("esri-view");const o=document.createElement("div");o.className="esri-view-user-storage",$n(s,o),s.appendChild(o),this._set("userContent",o);const a=document.createElement("div");a.className="esri-view-root",s.insertBefore(a,s.firstChild),this._set("root",a);const h=document.createElement("div");h.className="esri-view-surface",h.setAttribute("role","application"),h.tabIndex=0,a.appendChild(h),this._set("surface",h);const c=new Jn;a.appendChild(c.surface),this._set("overlay",c),this.addHandles(w(()=>c.needsRender,p=>{p&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=de({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=st(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",s),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(i,n,s){const o=this.position;return i-=o?o[0]:0,n-=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}containerToPage(i,n,s){const o=this.position;return i+=o?o[0]:0,n+=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}_handleUIChange(i,n){this.removeHandles("ui"),n&&n!==i&&n.destroy(),i&&(i.view=this,this.addHandles(w(()=>this.root,s=>{i.container=s?pl(s):null},U),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=me,i.time=Ze,this.addHandles([or(window,"resize",()=>{i.freq=me,i.time=Ze}),de({prepare:n=>{const s=this._measure(),o=this._freqInfo;if(o.time+=n.deltaTime,s&&(o.freq=me,this._get("resizing")||this._set("resizing",!0)),o.time=dl&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,n=i?i.clientWidth:0,s=i?i.clientHeight:0;if(n===0||s===0)return this.suspended||this._set("suspended",!0),!1;const o=this.width,a=this.height;return n===o&&s===a?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",n),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:o,oldHeight:a,width:n,height:s}),!0)}_position(){const i=this.container,n=this.position,s=i&&cl(i);return!!s&&(!n||s[0]!==n[0]||s[1]!==n[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return r([l()],e.prototype,"container",null),r([l({readOnly:!0})],e.prototype,"focused",null),r([l({readOnly:!0})],e.prototype,"height",void 0),r([l()],e.prototype,"messagesCommon",void 0),r([l({type:Jn})],e.prototype,"overlay",void 0),r([l({readOnly:!0})],e.prototype,"position",void 0),r([l({readOnly:!0})],e.prototype,"resizing",void 0),r([l({readOnly:!0})],e.prototype,"root",void 0),r([l({value:null,readOnly:!0})],e.prototype,"size",null),r([l({readOnly:!0})],e.prototype,"surface",void 0),r([l({readOnly:!0})],e.prototype,"suspended",void 0),r([l()],e.prototype,"ui",void 0),r([l({readOnly:!0})],e.prototype,"userContent",void 0),r([l({readOnly:!0})],e.prototype,"width",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),e=r([_("esri.views.DOMContainer")],e),e},gl=z("mac")?"Meta":"Control",yl=new Set(["Alt","Control","Meta","Shift","Ctrl","Primary"]),_l=t=>yl.has(t);let fl=class{constructor(t,e=[]){this.eventType=t,this.keyModifiers=e}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const e=t.modifiers;for(const i of this.keyModifiers)if(!e.has(i))return!1;return!0}},A=class{constructor(t){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=t}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const t in this._incoming){const e=this._incoming[t];for(const i of e)this._incomingEventMatches.push(i.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(t=>t.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(t){this._manager||(t.setEventCallback(e=>this._handleEvent(e)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,e,i){let n;typeof e=="function"?(i=e,n=[]):n=e||[];const s=typeof t=="string"?new fl(t,n):t,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=p=>{const d=this._incoming[p.match.eventType];if(d){const m=d.indexOf(p);d.splice(m,1),o(),this._manager&&this._manager.updateDependencies()}},h=new vl(s,i,{onPause:a,onRemove:a,onResume:p=>{const d=this._incoming[p.match.eventType];d&&!d.includes(p)&&(d.push(p),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.push(h),o(),this._manager&&this._manager.updateDependencies(),h}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const e=new wl(t,{onEmit:(i,n,s,o)=>{this._manager?.emit(i.eventType,n,s,o)},onRemove:i=>{delete this._outgoing[i.eventType],this._manager?.updateDependencies()}});return this._outgoing[t]=e,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),e}startCapturingPointer(t){this._manager?.setPointerCapture(t,!0)}stopCapturingPointer(t){this._manager?.setPointerCapture(t,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager&&(this.onUninstall(),this._manager=null)}_handleEvent(t){const e=this._incoming[t.type];if(e){for(const i of e)if(i.match.matches(t)&&(i.callback?.(t),t.shouldStopPropagation()))break}}},vl=class{constructor(t,e,i){this.match=t,this._callback=e,this._handler=i}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},wl=class{constructor(t,e){this.eventType=t,this._removed=!1,this._handler=e}emit(t,e,i){this._removed||this._handler.onEmit(this,t,e,i)}remove(){this._removed=!0,this._handler.onRemove(this)}},bl=class extends A{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",e=>this._update(e.data))}_update(t){const e=t.native.pointerType==="touch"?"touch":"mouse",{x:i,y:n}=t;e===this._value&&this._x===i&&this._y===n||(this._value=e,this._x=i,this._y=n,this._onChange(e,i,n))}},Tl=class extends A{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=Mr(!1),this._onPointerAdd=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Ml=class{constructor(t,e){this._owner=e,this._properties={},this._afterDispatchHandle=null;for(const i in t){const n=t[i],s=new ar(n,void 0,void 0,2,2);this._properties[i]={pool:s,acquired:[]}}this._afterDispatchHandle=rr(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const e=this._properties[t];for(const i of e.acquired)Hn(i)||e.pool.release(i);e.pool.destroy(),e.pool=null,e.acquired=null}this._properties=null,this._owner=null}get(t){const e=this._owner._get(t),i=this._properties[t];let n=i.pool.acquire();for(i.acquired.push(n);n===e;)i.acquired.push(n),n=i.pool.acquire();return n}_release(){for(const t in this._properties){const e=this._properties[t];let i=0;for(const n of e.acquired)Hn(n)?e.acquired[i++]=n:e.pool.release(n);e.acquired.length=i}}},Q=class extends M{constructor(t){super(t),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=gl,this._latestPointerType="mouse",this._propertiesPool=new Ml({latestPointerLocation:Sl},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const t=Object.keys(this._nameToGroup);for(const e of t)this.uninstallHandlers(e);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(t=>t.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(t,e,i=At.INTERNAL){if(this._nameToGroup[t]||e.length===0)return;const n={name:t,handlers:e.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[t]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,h,c,p,d)=>{this._emitInputEvent(o.priorityIndex+1,a,h,c,d,p)},setPointerCapture:(a,h)=>{this._setPointerCapture(n,o,a,h)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(t){const e=this._nameToGroup[t];e?(e.handlers.forEach(i=>{i.removed=!0,i.uninstallCallback?.()}),delete this._nameToGroup[t],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):D.getLogger(this).error("There is no InputHandler group registered under the name `"+t+"`")}hasHandlers(t){return this._nameToGroup[t]!==void 0}isModifierKeyDown(t){return this._activeKeyModifiers.has(t)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const t=new Set,e=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const n=this._handlers[i];n.priorityIndex=i,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(t.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){t.add(o.eventType);for(const a of o.keyModifiers)_l(a)||e.add(a)}n.active=s}this._sourceEvents=t,this._keyModifiers=e,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(t,e,i){this._latestPointerType=t;const n=this._get("latestPointerLocation");if(n==null||n.x!==e||n.y!==i){const s=this._propertiesPool.get("latestPointerLocation");s.x=e,s.y=i,this._set("latestPointerLocation",s)}}_onEventReceived(t,e){if(t==="pointer-capture-lost"){const s=e;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(t,e);const i=this.test.timestamp!=null?this.test.timestamp:e.native?e.native.timestamp:void 0,n=e.native?e.native.cancelable:void 0;this._emitInputEventFromSource(t,e,i,n)}_updateKeyModifiers(t,e){if(!e)return;let i=!1;const n=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},s=(a,h)=>{h&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!h&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(t==="key-down"||t==="key-up"){const a=e.key;this._keyModifiers.has(a)&&s(a,t==="key-down")}const o=e.native;s("Alt",!!o?.altKey),s("Control",!!o?.ctrlKey),s("Ctrl",!!o?.ctrlKey),s("Shift",!!o?.shiftKey),s("Meta",!!o?.metaKey),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new bl((t,e,i)=>this._setLatestPointer(t,e,i)),this._multiTouchHandler=new Tl,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],At.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,At.INTERNAL)}_setPointerCapture(t,e,i,n){const s=t.name+"-"+e.priorityIndex,o=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(t=>!t.removed),this.updateDependencies()}_emitInputEventFromSource(t,e,i,n){this._emitInputEvent(0,t,e,i,n)}_emitInputEvent(t,e,i,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),h=s!==void 0&&s,c={event:new xl(e,i,a,o||this._activeKeyModifiers,h),priorityIndex:t};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(t){this._currentPropagation={events:new Zn,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:t.event.timestamp},this._currentPropagation.events.push(t),this._continuePropagation()}_continuePropagation(){this._paused=!1;const t=this._currentPropagation;if(t){for(;t.events.length>0;){const{event:e,priorityIndex:i}=t.events.pop(),n=e.data?.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(t.currentHandler=this._handlersPriority[i];t.currentHandler;){if(t.currentHandler.removed)t.needsHandlerGarbageCollect=!0;else{if(t.currentHandler.active&&!e.shouldStopPropagation()&&t.currentHandler.eventCallback?.(e),e.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(e.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:e,priorityIndex:t.currentHandler.priorityIndex+1})}t.currentHandler=this._handlersPriority[t.currentHandler.priorityIndex+1]}}t.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(t){const e=new Zn;e.push(t);const i=this._currentPropagation;if(i){for(;i.events.length;)e.push(i.events.pop());i.events=e,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(t,e){if(t.handler.hasSideEffects!==e.handler.hasSideEffects)return t.handler.hasSideEffects?1:-1;if(t.groupPriority!==e.groupPriority)return t.groupPriority>e.groupPriority?-1:1;for(const i of t.handler.incomingEventMatches)for(const n of e.handler.incomingEventMatches){if(i.eventType!==n.eventType)continue;const s=i.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===i.keyModifiers.length!=(s.length===n.keyModifiers.length))return i.keyModifiers.length>n.keyModifiers.length?-1:1}return t.priorityIndex>e.priorityIndex?-1:1}_sortHandlersPriority(t){const e=[];for(const i of t){let n=0;for(;n=0;)n++;e.splice(n,0,i)}return e}get debug(){const t=e=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=i};return{injectEvent:(e,i)=>{t(()=>this._onEventReceived(e,i))},disablePointerCapture:t}}};r([l({readOnly:!0})],Q.prototype,"hasPendingInputs",null),r([l({constructOnly:!0})],Q.prototype,"eventSource",void 0),r([l({constructOnly:!0})],Q.prototype,"recognizers",void 0),r([l()],Q.prototype,"_latestPointerType",void 0),r([l()],Q.prototype,"latestPointerType",null),r([l()],Q.prototype,"multiTouchActive",null),r([l({readOnly:!0})],Q.prototype,"latestPointerLocation",void 0),r([l()],Q.prototype,"_paused",void 0),r([l({readOnly:!0})],Q.prototype,"updating",null),Q=r([_("esri.views.input.InputManager")],Q);let xl=class{constructor(t,e,i,n,s){this.type=t,this.data=e,this.timestamp=i,this.modifiers=n,this.cancelable=s,this._propagationState=Vt.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Vt.STOPPED}shouldStopPropagation(){return!!(this._propagationState&Vt.STOPPED)}async(t){this._propagationState|=Vt.PAUSED;const e=(i,n)=>{this._propagationState&=~Vt.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw i;return i};return(typeof t=="function"?t():t).then(i=>e(i,!1),i=>e(i,!0))}shouldPausePropagation(t){return!!(this._propagationState&Vt.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}};var Vt;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(Vt||(Vt={}));const At={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Pl=class{};const Sl=Pl;function kt(t){return t!=null&&"open"in t&&"declaredClass"in t}function es(t){return t!=null&&"declaredClass"in t&&"dockOptions"in t}const kl=t=>{let e=class extends t{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([w(()=>[this.ui,this.popup],([i,n],s)=>{const o="popup",a="manual";if(s){const[h,c]=s;h&&kt(c)&&(c.view=null,es(c)&&h.remove(c,o))}i&&kt(n)&&(n.view=this,es(n)&&i.add(n,{key:o,position:a,internal:!0}))},U),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(kt(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),kt(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)}))},At.WIDGET)]),pn(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{b(()=>import("./Popup-DFFZHG5j-DuBwb8-M.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136]),import.meta.url)})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(kt(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void D.getLogger(this).error(new C("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){this._popupSetupTask?.abort(),kt(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,n){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(i,n),n)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!kt(this.popup))return this._popupSetupTask=dn(async i=>{const{default:n}=await b(()=>import("./Popup-DFFZHG5j-DuBwb8-M.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136]),import.meta.url);if(Ot(i),!this.popup||kt(this.popup))return;const s=this.popup;delete s.open,delete s.close,this.popup=new n(s)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:i,hits:n},s){const o=[],a=[];let h=!1;const c=lr(s,z("popup-view-fetch-timeout")??Cl),p=u=>{const g=new El(u);return a.push(g),o.push(g.promise),g},d=u=>{const g=a.at(-1);return g&&g.layerView===u&&!h?g:p(u)};for(const u of n)"graphic"in u?(d(u.layerView).graphics.push(u.graphic),h=!1):(o.push(u.layerView.fetchPopupFeaturesAtLocation(u.mapPoint,c)),h=!0);a.map(u=>u.resolve(c));const m=hr(o).then(u=>u.filter(g=>!!g).flat());return{pendingFeatures:o,allGraphicsPromise:m,location:i}}async _getPopupHits(i,n){const{hits:s,location:o}=await this.popupHitTest(i);Ot(n);const a=[];for(const h of s)if("graphic"in h){if(this._isValidPopupGraphic(h.graphic,n)){const c=this._isValidPopupGraphicsLayerView(h.layerView)?h.layerView:void 0;a.push({graphic:h.graphic,layerView:c})}}else this._isValidPopupLocationLayerView(h.layerView)&&a.push({mapPoint:h.mapPoint,layerView:h.layerView});return{hits:a,location:o}}_isValidPopupGraphic(i,n){return i&&!!i.getEffectivePopupTemplate(n?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(i){return!i||(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesFromGraphics"in i}_isValidPopupLocationLayerView(i){return(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesAtLocation"in i}};return r([l()],e.prototype,"popup",void 0),r([l()],e.prototype,"popupEnabled",void 0),e=r([_("esri.views.PopupView")],e),e};let El=class{constructor(t){this.layerView=t,this._resolver=ui(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(t){const{layerView:e,graphics:i,_resolver:n}=this;if(!e)return n.resolve(i),n.promise;let s;return e.fetchPopupFeaturesFromGraphics(i,t).catch(o=>(s=o,null)).then(o=>{o?n.resolve(o):n.reject(s)}),n.promise}};const Cl=5e3;let ai=class extends Pr{constructor(t){super(t),this.addHandles(this.on("before-add",e=>{e.item!=null&&e.item.parent===this.owner&&(D.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),e.preventDefault())}))}_own(t){t.parent=this.owner}_release(t){t.parent=null}};ai=r([_("esri.support.AnalysesCollection")],ai);let It=class extends M{constructor(t){super(t),this.view=null,this.baseLayerViews=new L,this.referenceLayerViews=new L,this._loadingHandle=w(()=>this.view?.map?.basemap,e=>{e&&e.load().catch(()=>{})},U)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const t of this.baseLayerViews)t.destroy();this.baseLayerViews.length=0;for(const t of this.referenceLayerViews)t.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view?.suspended)return!1;const t=this.view?.map?.basemap;return!!t&&!!t.loaded&&(this.baseLayerViews.some(e=>e.updating)||this.referenceLayerViews.some(e=>e.updating))}};r([l({constructOnly:!0})],It.prototype,"view",void 0),r([l({readOnly:!0})],It.prototype,"baseLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"referenceLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"suspended",null),r([l({type:Boolean,readOnly:!0})],It.prototype,"updating",null),It=r([_("esri.views.BasemapView")],It);const Il=It;function Dl(t){return"tryRecycleWith"in t}function Rl(t){return t!=null&&typeof t=="object"&&"layerViews"in t}let Ll=class{constructor(t,e,i){this.layer=t,this.view=e,this.layerViewImporter=i,this._controller=new AbortController,this._deferred=ui(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Ti(this._controller.signal,()=>{const n=new C("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(n)})}tryRecycle(t){if(!this.done||!this.layerView||!Dl(this.layerView))return null;const e=this.layer.type,i=this._controller.signal;for(let n=0;n(Ot(this._controller.signal),s.emit("layerview-destroy",{view:h,layerView:a}),h.emit("layerview-destroy",{view:h,layerView:a}),s.emit("layerview-create",{view:h,layerView:a}),h.emit("layerview-create",{view:h,layerView:a}),a)),new Promise((c,p)=>Ti(this._controller.signal,()=>p(Qs())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:t}=this;if(t){const{layer:e,view:i}=this;e.emit("layerview-destroy",{view:i,layerView:t}),i.emit("layerview-destroy",{layer:e,layerView:t})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:e,view:i}=this;this._map=i.map;try{let n,s;if(await e.load({signal:t}),e.prefetchResources&&await e.prefetchResources({signal:t}),Ol(e))n=await e.createLayerView(i,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(e))throw new C("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(e);Ot(t),n="default"in a?new a.default({layer:e,view:i}):new a({layer:e,view:i})}const o=()=>{s=st(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=Ti(t,o),Ot(t);try{await n.when()}catch(a){throw o(),a}if(!this._map?.allLayers?.includes(e))return o(),void this._deferred.reject(new C("view:no-layerview-for-layer","The layer has been removed from the map",{layer:e}));this.layerView=n,e.emit("layerview-create",{view:i,layerView:n}),i.emit("layerview-create",{layer:e,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){e.emit("layerview-create-error",{view:i,error:n}),i.emit("layerview-create-error",{layer:e,error:n}),this.done=!0,this._deferred.reject(new C("layerview:create-error","layerview creation failed",{layer:e,error:n}))}}},J=class extends M{constructor(t){super(t),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new yi,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const i of e)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=ui(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(Wa(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=new Set,n=[],s=this.view.ready,o=h=>{if(h!=null){for(const c of h)if(c){i.add(c);const p=this._layerLayerViewInfoMap.get(c);p&&s?p.start():p||this._recyclingInfoMap.has(c)||n.push(c),"layers"in c&&c.layers&&o(c.layers)}}};for(const h of this._rootCollectionNames)o(bi(this,h));for(const[h,c]of this._layerLayerViewInfoMap)if(!i.has(h)){this._layerLayerViewInfoMap.delete(c.layer);const p=c.tryRecycle(n);p?(this.notifyChange("updating"),this._recyclingInfoMap.set(c.layer,c),p.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),this._layerLayerViewInfoMap.set(c.layer,c),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy(),this._reschedule()})):c.destroy()}for(const[h,c]of this._recyclingInfoMap)i.has(h)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy());for(const h of n)this._createLayerView(h);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter(h=>!!h);i.forEach(h=>"layers"in h&&a.push(h.layers)),this.addHandles(a.map(h=>this._watchUpdatingTracking.addOnCollectionChange(()=>h,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([ci(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),w(()=>{const t=this.view,e=t?.map;return[e?.basemap,e?.ground,e?.layers,t?.ready]},()=>this._reschedule(),ct)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),Mi(this._recyclingInfoMap),Mi(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(Qs()),this._workPromise=null)}get _layersToLayerViews(){const t=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&t.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(t)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||Ua(this._layerLayerViewInfoMap,t=>!t.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let t=0;for(const e of this._layerLayerViewInfoMap.values())e.done||++t;return t}clear(){this.destroyed||(Mi(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(t){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(t)){if(this._recyclingInfoMap.has(t))return this._recyclingInfoMap.get(t).promise;throw new C("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:t})}return this._layerLayerViewInfoMap.get(t).promise}isCreatingLayerViewsForLayer(t,e){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(t);if(!i?.done)return!0;const n=i.layerView;return!(!n||!e||n.parent===e)||!!(i.done&&n&&"layers"in t&&t.layers?.length)&&t.layers.some(s=>this.isCreatingLayerViewsForLayer(s,n))}_refreshCollections(){for(const[t,e]of this._layersToLayerViews)this._populateLayerViewsOwners(bi(this,t),bi(this,e),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(t,e,i){if(!t||!e)return void(e&&e.removeAll());let n=0;for(const s of t){const o=this._layerLayerViewInfoMap.get(s);if(!o?.layerView)continue;const a=o.layerView;a.layer=s,a.parent=i,e.at(n)!==a&&e.splice(n,0,a),"layers"in s&&Rl(a)&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(t)&&this.layerViewImporter.importLayerView(t);const e=new Ll(t,this.view,this.layerViewImporter);e.promise.then(()=>this._refreshCollections(),i=>{i&&(Js(i)||i.name==="cancelled:layerview-create")||D.getLogger(this).error(`Failed to create layerview for layer title:'${t.title??"no title"}', id:'${t.id??"no id"}' of type '${t.type}'.`,{layer:t,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(t,e),this.view.ready&&e.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};r([l()],J.prototype,"_workPromise",void 0),r([l({readOnly:!0})],J.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],J.prototype,"_layersToLayerViews",null),r([l({readOnly:!0})],J.prototype,"_rootCollectionNames",null),r([l()],J.prototype,"layerViewImporter",void 0),r([l()],J.prototype,"supportsGround",void 0),r([l({readOnly:!0})],J.prototype,"updating",null),r([l({readOnly:!0})],J.prototype,"updatingRemaining",null),r([l({constructOnly:!0})],J.prototype,"view",void 0),J=r([_("esri.views.LayerViewManager")],J);const Vl=J;function Ol(t){return"createLayerView"in t&&t.createLayerView!=null}let Y=class extends M{constructor(t){super(t),this.factor=1.5,this.offset=H(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};r([l({type:Number})],Y.prototype,"factor",void 0),r([l({nonNullable:!0})],Y.prototype,"offset",void 0),r([l()],Y.prototype,"position",void 0),r([l({type:Number,range:{min:0}})],Y.prototype,"size",void 0),r([l()],Y.prototype,"maskUrl",void 0),r([l()],Y.prototype,"maskEnabled",void 0),r([l()],Y.prototype,"overlayUrl",void 0),r([l()],Y.prototype,"overlayEnabled",void 0),r([l({readOnly:!0})],Y.prototype,"version",null),r([l({type:Boolean})],Y.prototype,"visible",void 0),Y=r([_("esri.views.Magnifier")],Y);const uo=Y;function Ge(t){return!!(t!=null&&typeof t=="object"&&"createQuery"in t&&t.createQuery&&"on"in t&&t.on)}let yt=class extends hi.EventedAccessor{constructor(t){super(t),this._selectionMap=new kr,this._sources=new L,this._trashCan=[],this._layerEditHandles=new L,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([w(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),ci(()=>this.sources,"change",e=>{const i=this._selectionMap;for(const n of e.removed)i.delete(n);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const t=new L;this.view.when().then(()=>{this.view.map&&(this.view.map.allLayers.flatten(e=>"sublayers"in e&&e.sublayers?e.sublayers:null).forEach(e=>{(Ge(e)&&!Ia(e)||Ft(e))&&t.add(e)}),this.sources=t)})}destroy(){this._layerEditHandles.drain(st)}get selections(){return Array.from(this._selectionMap.entries()).map(t=>{const[e,i]=t;return{layer:e,selection:[...i.selection]}})}get count(){let t=0;for(const e of this._selectionMap.values())t+=e.selection.length;return t}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(t){Da(t,this._sources)}async getSelectedFeatures(t,e={},i="layerView"){const{view:n,selections:s}=this,o=(t!==void 0?s.filter(a=>t.includes(a.layer)):s).filter(a=>a.selection.length>0).map(async a=>{const{layer:h,selection:c}=a,p=Ft(h)?h.parent:h;if(p==null||!ns(p))return null;if(i==="layer")return ss(p,c,e);if(is(p))return null;const d=await n.whenLayerView(p).catch(()=>null);return d?ss(d,c,e):null});return(await Promise.all(o)).filter(a=>a!=null)}updateSelection(t){const e=new Map;for(const[s,o]of this._selectionMap)e.set(s,[...o.selection]);let i=!1;const n=t.current.concat(t.added);for(const s of n){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=Ra(e,o,()=>[]);h.includes(a)||(h.push(a),i=!0)}}for(const s of t.removed){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=e.get(o),c=h?.indexOf(a);c!==void 0&&c>=0&&(h?.splice(c,1),i=!0)}}if(i){const{_selectionMap:s,_trashCan:o}=this,a=[];for(const[h,c]of e){const p=s.get(h);p!==void 0&&o.push(p),s.set(h,{selection:c}),a.push({layer:h,selection:c,...On(p!==void 0?p.selection:[],c)})}this._onSelectionChange(a)}}setSelection(t,e){this._setSelection(t,e)}getSelection(t){return this._selectionMap.get(t)?.selection}appendToSelection(t,e){const i=this._selectionMap.get(t),n=i!==void 0?[...i.selection]:[];for(const s of e)n.includes(s)||n.push(s);this._setSelection(t,n)}removeFromSelection(t,e){const i=this._selectionMap.get(t);if(!i)return;const n=[];for(const s of i.selection)e.includes(s)||n.push(s);this._setSelection(t,n)}toggleInSelection(t,e){const i=this._selectionMap.get(t);if(!i||i.selection.length===0)return void this._setSelection(t,e);const n=new Set(i.selection),s=new Set(e),o=La(n,s);this._setSelection(t,Array.from(o))}clear(){const t=this._selectionMap.values();this._trashCan.push(...t);const e=[];for(const[i,n]of this._selectionMap.entries())e.push({layer:i,added:[],removed:[...n.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(e)}_onSelectionChange(t){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:t})}_refreshVisualization(){if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;)this._trashCan.pop()?.highlightHandle?.remove();const{sources:t,view:e,_selectionMap:i,showHighlight:n}=this,s=this._vizTaskId;for(const o of t){const a=i.get(o),h=Ft(o)?o.parent:o;if(h!=null&&ns(h)){if(is(h))continue;e.whenLayerView(h).then(c=>{a?.highlightHandle?.remove(),a!=null&&n&&s===this._vizTaskId&&"highlight"in c&&typeof c.highlight=="function"&&a.selection.length>0&&(a.highlightHandle=c.highlight(a.selection,"selection"))}).catch(()=>{a?.highlightHandle?.remove()})}}}_refreshListeners(){this._layerEditHandles.drain(st);for(const t of this.sources){const e=Ft(t)?t.parent:t;if(e!=null&&Ge(e)){const i=e.on("edits",n=>{this._handleEditChanges(n,t)});this._layerEditHandles.push(i)}}}_handleEditChanges(t,e){if(t.deletedFeatures!==void 0&&t.deletedFeatures.length>0&&this._selectionMap.has(e)){const i=t.deletedFeatures.filter(n=>n.error==null).map(n=>n.objectId).filter(ni);this.removeFromSelection(e,i)}}_setSelection(t,e){if(!this.sources.includes(t))throw new Error(`Cannot set selection on layer ${t.title} because it is not in 'sources'`);const i=this._selectionMap.get(t);if(i===void 0||!zl(i,{selection:e})){i!==void 0&&this._trashCan.push(i),this._selectionMap.set(t,{selection:[...e]});const n={layer:t,selection:[...e],...On(i!==void 0?i.selection:[],e)};this._onSelectionChange([n])}}};r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"selections",null),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"count",null),r([l({constructOnly:!0,nonNullable:!0})],yt.prototype,"view",void 0),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"hasSelection",null),r([l()],yt.prototype,"showHighlight",void 0),r([l()],yt.prototype,"sources",null),yt=r([_("esri.views.SelectionManager")],yt);const is=t=>Ft(t)?t.parent?.isTable===!0:t.isTable,Al=t=>t.layer!==void 0,ns=t=>t?.when!==void 0,zl=(t,e)=>{if(t==null&&e==null)return!0;if(t!=null&&e==null||t==null&&e!=null)return!1;if(t!=null&&e!=null&&t.selection!=null&&e.selection!=null){const i=[...t.selection],n=[...e.selection];if(i.length!==n.length)return!1;i.sort(),n.sort();for(let s=0;s{let n;if(Al(t)){const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:t.layer}))}else{const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:s}))}return n},Nl=yt;let ve=class extends js(M){constructor(t){super(t),this.accentColor=new Pt([255,127,0]),this.textColor=new Pt([255,255,255])}};r([l({type:Pt,nonNullable:!0})],ve.prototype,"accentColor",void 0),r([l({type:Pt,nonNullable:!0})],ve.prototype,"textColor",void 0),ve=r([_("esri.views.Theme")],ve);const Ki=ve;var os;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(os||(os={}));const mo=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],go={};function yo(t){return!!go[t]}function Fl(t){for(const e of t)if(!yo(e))return!1;return!0}mo.forEach(t=>{go[t]=!0});let Hl=class{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach(({handler:e,priority:i},n)=>this.inputManager?.installHandlers(n,[e],i))}disconnect(){this.inputManager&&this._handlers.forEach((t,e)=>this.inputManager?.uninstallHandlers(e)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,e,i,n){const s=Array.isArray(t)?t:t.split(",");if(!Fl(s))return s.some(yo)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(e)?a=e:(o=e,a=[]),typeof i=="function"?o=i:n=i,n=n??At.DEFAULT;const h=this._createUniqueGroupName(),c=new Zl(this.view,s,a,o);this._handlers.set(h,{handler:c,priority:n});for(const p of s){const d=this._handlerCounts.get(p)||0;this._handlerCounts.set(p,d+1)}return this.inputManager&&this.inputManager.installHandlers(h,[c],n),di(()=>this._removeHandler(h,s))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,e){if(this._handlers.has(t)){this._handlers.delete(t);for(const i of e){const n=this._handlerCounts.get(i);n===void 0||(n===1?this._handlerCounts.delete(i):this._handlerCounts.set(i,n-1))}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},Zl=class extends A{constructor(t,e,i,n){super(!0),this._latestDragStart=void 0,this.view=t;for(const s of e)switch(s){case"click":this.registerIncoming("click",i,o=>n(Wl(t,o)));break;case"double-click":this.registerIncoming("double-click",i,o=>n(Ul(t,o)));break;case"immediate-click":this.registerIncoming("immediate-click",i,o=>n(jl(t,o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",i,o=>n(ql(t,o)));break;case"hold":this.registerIncoming("hold",i,o=>n(Bl(t,o)));break;case"drag":this.registerIncoming("drag",i,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",i,o=>n(Kl(o)));break;case"key-up":this.registerIncoming("key-up",i,o=>n(Yl(o)));break;case"pointer-down":this.registerIncoming("pointer-down",i,o=>n(ge(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",i,o=>n(ge(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",i,o=>n(ge(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",i,o=>n(Xl(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",i,o=>n(Ql(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",i,o=>n(ge(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",i,o=>n(ge(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",i,o=>{n(Jl(o))});break;case"focus":this.registerIncoming("focus",i,o=>{n(Gl(o))});break;case"blur":this.registerIncoming("blur",i,o=>{n($l(o))})}}_wrapDrag(t){const e=t.data,{x:i,y:n}=e.center,{action:s,pointerType:o,button:a}=e;if(s==="start"&&(this._latestDragStart=e),!this._latestDragStart)return;const h=e.pointer.native,c=e.buttons,{cancelable:p,timestamp:d}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:i,y:n,origin:m,pointerType:o,button:a,buttons:c,radius:e.radius,angle:ja(e.angle),native:h,timestamp:d,cancelable:p,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}};function Gl(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function $l(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function Wl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,screenPoint:H(o,a),mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function Ul(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"double-click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function jl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function ql(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-double-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function Bl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h}=e.data,{cancelable:c,timestamp:p}=e;return{type:"hold",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:p,mapPoint:Ve(t,o,a),cancelable:c,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}function Ve(t,e,i){return t.toMap(H(e,i),{exclude:[]})}function Kl(t){const{key:e,repeat:i,native:n}=t.data,{cancelable:s,timestamp:o}=t;return{type:"key-down",key:e,repeat:i,native:n,timestamp:o,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:a=>t.async(a),preventDefault:()=>t.preventDefault()}}function Yl(t){const{key:e,native:i}=t.data,{cancelable:n,timestamp:s}=t;return{type:"key-up",key:e,native:i,timestamp:s,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}function ge(t,e){const{x:i,y:n,button:s,buttons:o,native:a,eventId:h}=t.data,c=a.pointerId,p=a.pointerType,{cancelable:d,timestamp:m}=t;return{type:e,x:i,y:n,pointerId:c,pointerType:p,button:s,buttons:o,native:a,timestamp:m,eventId:h,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}function Xl(t){const{x:e,y:i,buttons:n,native:s,eventId:o}=t.data.currentEvent,{button:a}=t.data.startEvent,h=t.data.startEvent.native.pointerId,c=t.data.startEvent.native.pointerType,p=t.data.action,d={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:m,timestamp:u}=t;return{type:"pointer-drag",x:e,y:i,pointerId:h,pointerType:c,button:a,buttons:n,action:p,origin:d,native:s,timestamp:u,eventId:o,cancelable:m,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}function Ql(t){const{cancelable:e,data:i,timestamp:n}=t,{x:s,y:o,deltaY:a,native:h}=i;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:h,timestamp:n,cancelable:e,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}function Jl(t){const{action:e,state:i,device:n}=t.data,{cancelable:s,timestamp:o}=t,{buttons:a,axes:h}=i;return{type:"gamepad",device:n,timestamp:o,action:e,buttons:a,axes:h,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}var Ie,as,rs;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(Ie||(Ie={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(as||(as={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(rs||(rs={}));function th(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return D.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function Yi(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(Ie.USER)&&t.getEditableFlag(Ie.MANAGER)}function rt(t){return H(t.x,t.y)}function _o(t,e){const i=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return i?H(e.clientX-i.left,e.clientY-i.top):H(0,0)}function fo(t,e){return e instanceof Event?_o(t,e):rt(e)}function vo(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let eh=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._externallyDragging=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const i=()=>t.stopPropagation();switch(t.type){case"pointer-move":hs(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0?this._stopDrag=!0:t.action==="start"?this._externallyDragging=!0:t.action==="end"&&(this._externallyDragging=!1),this._stopDrag&&(i(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!cs(t))break;const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(t)||!o.grabbing||o.dragging||this._releaseManipulatorBeforeDragging(o,t,e),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(t)&&!o.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:o,tool:a,start:n,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&e.activeTool==null&&(this._revertToNullActiveTool=!0,e.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:n}),i());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case"pointer-drag":{if(!cs(t))break;const n=this._grabbedManipulators.get(t.pointerId),s=n?.manipulator,o=n?.tool;if(s==null||o==null)break;const a=rt(t);a.x=ke(a.x,0,e.view.width),a.y=ke(a.y,0,e.view.height);const h=n.start,c=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?s.events.emit("drag",{action:"update",start:h,screenPoint:a}):s.events.emit("drag",{action:"start",start:h,screenPoint:a,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:o,manipulator:s,start:h}));break;case"end":s.dragging=!1,c&&s.events.emit("drag",{action:"end",start:h,screenPoint:a}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}i();break}case"immediate-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(ih(t)||e.forEachTool(c=>{if((s==null||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let p=!1;c.manipulators.forEach(({manipulator:d})=>{d.selected&&(d.selected=!1,p=!0)}),p&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const h=t.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:h,stopPropagation:i}),Di(o,i);break}case"click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s?.manipulator;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit(t.type,{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a}),i();break}case"double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),Di(o,i);break}case"immediate-double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),t.pointerType==="mouse"&&Di(o,i);break}}this._onFocusChange(e.forEachTool)}_releaseManipulatorBeforeDragging(t,e,i){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:rt(e)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===t&&this._grabbedManipulators.delete(s)}),this._afterManipulatorRelease(i.setActiveTool)}_handlePointerEnd(t,e){const i=this._grabbedManipulators.get(t.pointerId)?.manipulator;i!=null&&i.grabbing&&(i.grabbing=!1,i.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:rt(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(e.setActiveTool))}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=ls(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=ls(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const e=new Set,i=new Set;this._grabbedManipulators.forEach(({tool:n})=>{e.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{i.add(n)}),t(n=>{n.hasGrabbedManipulators=e.has(n),n.hasHoveredManipulators=i.has(n);const s=this._grabbedManipulators.values(),o=cr(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(t,{forEachTool:e,setActiveTool:i},n=!0,s){const o=(a,h)=>a===t&&(s==null||s===h);this._grabbedManipulators.forEach(({tool:a,manipulator:h,pointerType:c},p)=>{o(a,h)&&(this._grabbedManipulators.delete(p),h.grabbing=!1,h.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._draggedManipulators.delete(c),h.dragging=!1,h.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._hoveredManipulators.delete(c),h.hovering=!1)}),this._afterManipulatorRelease(i),this._onFocusChange(e)}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((e,i)=>{this._updateHoveredStateForPointerAtScreenPosition(H(e.x,e.y),i,e.pointerType,t)})}handleHoverEvent(t,e){const i=t.type;i!=="pointer-up"&&i!=="immediate-click"&&i!=="pointer-move"||!hs(t.pointerType)||(i!=="pointer-up"&&this._externallyDragging?this._clearHoveredManipulatorStates(t.pointerId):this._updateHoveredStateForPointerAtScreenPosition(rt(t),t.pointerId,t.pointerType,e))}_updateHoveredStateForPointerAtScreenPosition(t,e,i,n){let s=te(t,i,n);const o=this._hoveredManipulators.get(e)?.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(e,s)):this._hoveredManipulators.delete(e),this._onFocusChange(n))}_afterManipulatorRelease(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}_clearHoveredManipulatorStates(t){this._hoveredManipulators.forEach(({manipulator:e},i)=>{t===i&&(this._hoveredManipulators.delete(t),e.hovering=!1)})}};function ls(t){for(const{manipulator:e}of t.values())if(e!=null&&e.interactive){if(e.grabbing&&e.grabCursor)return e.grabCursor;if(e.cursor)return e.cursor}return null}function te(t,e,i){let n=null;return i(s=>{if(s.manipulators==null||!Yi(s))return!1;const o=s.manipulators.intersect(t,e);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}function hs(t){return t==="mouse"}function cs(t){return t.pointerType!=="mouse"||t.button===0}function ih(t){return!!t.native.shiftKey}function Di(t,e){t?.consumesClicks&&e()}const ps="attached",Ri="tools",nh=1e3;let lt=class extends M{constructor(t){super(t),this._updatingHandles=new yi,this._clock=Re,this._manipulatorState=new eh,this.tools=new L,this.cursor=null,this._interacting=!1,this._interactingTimeout=nh,this._interactingTimeoutHandle=null,this._forEachTool=e=>{for(const i of this.tools.items)if(e(i))return}}initialize(){this.addHandles([this.view.on(mo,t=>{this._handleInputEvent(t)},At.TOOL),...th(this.tools),this.tools.on("before-add",({item:t})=>{this._updateToolEditableFlag(t)}),this.tools.on("before-remove",({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(t=>t.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(t!=null&&!this.view.ready)return void D.getLogger(this).error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return;const e=this.activeTool;this._set("activeTool",t),e?.deactivate(),t?.activate(),this._removeIncompleteTools(t);for(const i of this.tools){this._updateToolEditableFlag(i);const n=Yi(i);this.activeTool!=null&&n||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(t=>t.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=st(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){this.view.type==="3d"?this.addHandles([w(()=>{const{state:t}=this.view;return"camera"in t&&t.camera},()=>this._forEachManipulator(t=>t.onViewChange())),this.view.elevationProvider?.on("elevation-change",t=>this._forEachManipulator(e=>e.onElevationChange(t)))],ps):this.addHandles(w(()=>this.view.extent,()=>this._forEachManipulator(t=>t.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ps),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool(e=>{e.manipulators&&e.manipulators.forEach(({manipulator:i})=>t(i,e))})}_handleInputEvent(t){let e=!1;const i={...t,stopPropagation:()=>{e=!0,t.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(n=>{!e&&n.visible&&n.handleInputEvent(i)}),!e&&t.type==="key-down"&&t.key==="Escape"&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),e||this.activeTool==null||this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor(),t.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(Ri),this._forEachTool(t=>{if(t instanceof M){const e=w(()=>[t.cursor,t.visible,t.editable],()=>{Yi(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(e,Ri)}t.manipulators&&this.addHandles([t.manipulators.on("after-remove",e=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,e.item.manipulator)}),t.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Ri)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){t.setEditableFlag?.(Ie.MANAGER,this.activeTool==null||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;t==null&&this._forEachTool(e=>!(e.cursor==null||!e.visible)&&(t=e.cursor,!0)),this._get("cursor")!==t&&this._set("cursor",t)}_removeIncompleteTools(t){this.tools.filter(e=>(t==null||e!==t)&&!e.created&&e.removeIncompleteOnCancel).forEach(e=>{this.tools.remove(e)})}get test(){}};r([l({constructOnly:!0,nonNullable:!0})],lt.prototype,"view",void 0),r([l({value:null})],lt.prototype,"activeTool",null),r([l({readOnly:!0,type:L})],lt.prototype,"tools",void 0),r([l({readOnly:!0})],lt.prototype,"cursor",void 0),r([l({readOnly:!0})],lt.prototype,"updating",null),r([l()],lt.prototype,"_interacting",void 0),r([l({readOnly:!0})],lt.prototype,"interacting",null),lt=r([_("esri.views.ToolViewManager")],lt);let se=class extends M{constructor(t){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",t.mapping==="standard"?this._detectedDeviceType="standard":sh.test(t.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=t.index}get native(){const t=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexVa.respectPrefersReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;let Dt=class extends M{constructor(t){super(t),this.enabled=!0,this.device=null,this.mode="pan",this.tiltDirection="forward-down",this.velocityFactor=1}};r([l({type:Boolean,nonNullable:!0})],Dt.prototype,"enabled",void 0),r([l({type:Mn})],Dt.prototype,"device",void 0),r([l({type:["pan","zoom"],nonNullable:!0})],Dt.prototype,"mode",void 0),r([l({type:["forward-down","forward-up"],nonNullable:!0})],Dt.prototype,"tiltDirection",void 0),r([l({type:Number,nonNullable:!0})],Dt.prototype,"velocityFactor",void 0),Dt=r([_("esri.views.navigation.gamepad.GamepadSettings")],Dt);const bo=Dt;let Zt=class extends M{constructor(t){super(t),this.browserTouchPanEnabled=!0,this.gamepad=new bo,this.momentumEnabled=!0,this.mouseWheelZoomEnabled=!0}get effectiveMomentumEnabled(){return this.momentumEnabled&&!wo()}};r([l({type:Boolean})],Zt.prototype,"browserTouchPanEnabled",void 0),r([l({type:bo,nonNullable:!0})],Zt.prototype,"gamepad",void 0),r([l({type:Boolean})],Zt.prototype,"momentumEnabled",void 0),r([l({type:Boolean})],Zt.prototype,"mouseWheelZoomEnabled",void 0),Zt=r([_("esri.views.navigation.Navigation")],Zt);const To=Zt;var ds;function lh(t){if(t.type==="integrated-mesh-3dtiles")return null;const e=t.url?Er(t.url):void 0;return!(t.spatialReference?.vcsWkid==null&&e!=null&&e.serverType==="ImageServer")&&Mo(t)&&t.heightModelInfo?t.heightModelInfo:hh(t)?wn.deriveUnitFromSR(ph,t.spatialReference):null}function Mo(t){return"heightModelInfo"in t}function xo(t){if(t.type==="unknown"||!("capabilities"in t))return!1;switch(t.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function hh(t){return xo(t)?!!(t.capabilities&&t.capabilities.data&&t.capabilities.data.supportsZ):Po(t)}function ch(t){return t.layers!=null||Po(t)||xo(t)||Mo(t)}function Po(t){switch(t.type){case"building-scene":case"elevation":case"integrated-mesh":case"integrated-mesh-3dtiles":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"catalog":case"catalog-footprint":case"catalog-dynamic-group":case"csv":case"dimension":case"geojson":case"feature":case"focusArea":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"parquet":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"viewshed":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}(function(t){t[t.Ok=0]="Ok",t[t.Units=1]="Units",t[t.HeightModel=2]="HeightModel",t[t.CRS=3]="CRS",t[t.Unsupported=4]="Unsupported"})(ds||(ds={}));const ph=new wn({heightModel:"gravity-related-height"});let Xi,Li=null;async function dh(t){Li||(Li=b(()=>import("./geometryServiceUtils-nsujb7BH-D7iwbaPn.js"),__vite__mapDeps([137,1,2,138,49,53]),import.meta.url).then(e=>Xi=e)),await Li,Ot(t)}async function So(t,e,i,n){if(!t)return null;const s=t.spatialReference;return yn()||_n(s,e)?Le(t,e):Xi?Xi.projectGeometry(t,e,i,n):(await Promise.race([dh(n),fn(n)]),So(t,e,i,n))}let P=class extends M{constructor(t){super(t),this.required={extent:!1,heightModelInfo:!1,tileInfo:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference??this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const t=this.map?.(),e=[];return this.priorityCollection!=null&&e.push(this.priorityCollection),e.push({parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers},{parent:t?.ground,layers:t?.ground?.layers},{parent:t?.basemap,layers:t?.basemap?.referenceLayers}),e}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};let t;if(this._collectLayers(this.mapCollections,i=>{const n=this._getSupportedSpatialReferences(i);if(n.length>0){const s=this._narrowDownSpatialReferenceCandidates(t,n);s!=null&&(t=s)}return t?.length===1})&&t?.length!==1)return{updating:!0};const e=this._pickSpatialReferenceCandidate(t);return{spatialReference:e?.spatialReference??null,viewingMode:e?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};const t=this.map?.(),e=this.spatialReference;if(!e)return{updating:this._spatialReferenceTask.updating};let i;const n=this._collectLayers([{parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers}],s=>!(!("tileInfo"in s)||!s.tileInfo?.spatialReference.equals(e))&&(i=s,!0),s=>"tileInfo"in s);return i?{tileInfo:i.tileInfo,updating:!1}:{updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};let t={};const e=this._collectLayers(this.mapCollections,i=>{const n=lh(i);return!!n&&(t={heightModelInfo:n,vcsWkid:i.spatialReference?.vcsWkid,latestVcsWkid:i.spatialReference?.latestVcsWkid},!0)},i=>ch(i));return{...t,updating:e}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=[],e=this._collectLayers(this.mapCollections,i=>{const n="fullExtents"in i&&i.fullExtents||(i.fullExtent!=null?[i.fullExtent]:[]),s=this.requiresExtentInSpatialReference?null:n[0],o=n.find(a=>a.spatialReference.equals(this.spatialReference))??s;if(o)return t.push({extent:o,layer:i}),!0;if(this._getSupportedSpatialReferences(i).length>0)for(const a of n)t.push({extent:a,layer:i});return!1});return{candidates:t,updating:e}}get _extentTask(){const{candidates:t,updating:e}=this._extentCandidatesTask;if(e)return{updating:e};if(t==null||t.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(t),n=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:n.clone(),task:dn(async s=>{try{const o=await So(i.extent,n,"portalItem"in i.layer?i.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(qa(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(t,e){if(t==null)return e;const i=new Array;for(const n of t)for(const s of e){if(!n.spatialReference.equals(s.spatialReference))continue;const o=mh(n.viewingMode,s.viewingMode);if(o!==!1){i.push({spatialReference:n.spatialReference,viewingMode:o});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(t){const e=this.defaultSpatialReference;return t==null||t.length<1?e?{spatialReference:e,viewingMode:null}:null:(e!=null&&t.length>1&&t.some(({spatialReference:i})=>i.equals(e))&&(t=t.filter(({spatialReference:i})=>i.equals(e))),t.length>1&&t.some(({viewingMode:i})=>i!==jn.Local)&&(t=t.filter(({viewingMode:i})=>i!==jn.Local)),t[0])}_getSupportedSpatialReferences(t){const e="supportedSpatialReferences"in t&&t.supportedSpatialReferences||(t.spatialReference?[t.spatialReference]:[]);if(e.length===0)return[];const i=[];for(const n of e){const s=this.getSpatialReferenceSupport(n,t);if(s!=null){const o=s.constraints??[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:h}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||i.push({spatialReference:a,viewingMode:h})}}return i}_pickExtentCandidate(t){const e=this.spatialReference;return t.find(({extent:i})=>e.equals(i.spatialReference))||t[0]}_collectLayers(t,e,i=()=>!0){if(this._loadMaybe(this.map?.())!=="loaded")return!0;const n=new uh(i,e);for(const s of t)if(this._collectCollection(s,n),n.done||n.preloading===this.sourcePreloadCount)break;return n.updating}_collectCollection(t,e){if(t.layers){switch(this._loadMaybe(t.parent)){case"loading":return e.updating=!0,void++e.preloading;case"failed":return}for(const i of t.layers)if(e.layerFilter(i)){switch(this._loadMaybe(i)){case"failed":continue;case"loading":e.updating=!0,++e.preloading;break;case"loaded":if(e.updating||(e.done=e.pushLayer(i)),e.done||e.preloading===this.sourcePreloadCount)break;"layers"in i&&this._collectCollection({layers:i.layers},e)}if(e.done||e.preloading===this.sourcePreloadCount)break}}}_loadMaybe(t){return t&&"loadStatus"in t&&t.loadStatus!=null?t.loadStatus==="not-loaded"?(t.load().catch(e=>{Js(e)}),"loading"):t.loadStatus:"loaded"}};r([l()],P.prototype,"required",void 0),r([l({constructOnly:!0})],P.prototype,"map",void 0),r([l({constructOnly:!0})],P.prototype,"getSpatialReferenceSupport",void 0),r([l()],P.prototype,"defaultSpatialReference",void 0),r([l()],P.prototype,"userSpatialReference",void 0),r([l()],P.prototype,"sourcePreloadCount",void 0),r([l()],P.prototype,"priorityCollection",void 0),r([l()],P.prototype,"requiresExtentInSpatialReference",void 0),r([l()],P.prototype,"suspended",void 0),r([l({readOnly:!0})],P.prototype,"ready",null),r([l({readOnly:!0})],P.prototype,"heightModelInfoReady",null),r([l({readOnly:!0})],P.prototype,"spatialReference",null),r([l({readOnly:!0})],P.prototype,"extent",null),r([l({readOnly:!0})],P.prototype,"heightModelInfo",null),r([l({readOnly:!0})],P.prototype,"vcsWkid",null),r([l({readOnly:!0})],P.prototype,"latestVcsWkid",null),r([l({readOnly:!0})],P.prototype,"viewingMode",null),r([l({readOnly:!0})],P.prototype,"tileInfo",null),r([l({readOnly:!0})],P.prototype,"mapCollections",null),r([l({readOnly:!0})],P.prototype,"_spatialReferenceTask",null),r([l({readOnly:!0})],P.prototype,"_tileInfoTask",null),r([l({readOnly:!0})],P.prototype,"_heightModelInfoTask",null),r([l({readOnly:!0})],P.prototype,"_extentCandidatesTask",null),r([l()],P.prototype,"_extentTask",null),r([l()],P.prototype,"_projectExtentTask",void 0),P=r([_("esri.views.support.DefaultsFromMap")],P);let uh=class{constructor(t,e){this.layerFilter=t,this.pushLayer=e,this.preloading=-1,this.updating=!1,this.done=!1}};function mh(t,e){return t!=null?e!=null?t===e&&t:t:e}var be;let y=be=class extends hi.EventedMixin(Oa(M)){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.handles=new qs,this.updatingHandles=new yi,this.allLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:yh}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new oo,this.analyses=new ai,this.typeSpecificPreconditionsReady=!0,this.layerViews=new L,this.magnifier=new uo,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new rh,this.navigation=new To,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Hl(this),this.persistableViewModels=new L,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(w(()=>this.preconditionsReady,e=>{const i=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,be.views.add(this)):(this._lockedSpatialReference=null,be.views.remove(this)),this.notifyChange("spatialReference"),!e&&i)this.toolViewManager?.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!i){try{this._startup()}catch(n){return void queueMicrotask(()=>{this.fatalError=new C("startup-error",null,n)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Ee))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,pn(()=>this.ready)))),this.basemapView=new Il({view:this}),this.layerViewManager=new Vl({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new lt({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new Nl({view:this}),this.addHandles([w(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},ct),w(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},Ee),w(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},ct)])}_setupSpatialReferenceLogger(){let t=null;this.addHandles([w(()=>this.defaultsFromMap?.ready,e=>{const i=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&i){if(t!=null)return;const n=di(()=>t=ji(t));t=dn(async s=>{try{await Aa(this.spatialReferenceWarningDelay,null,s)}catch{return}finally{t=null}D.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(n,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){this.destroyed||(be.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=tt(this.graphics),this.analyses=tt(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),tt(this.analysisViewManager),this.toolViewManager=tt(this.toolViewManager),this.layerViewManager=tt(this.layerViewManager),this.selectionManager=tt(this.selectionManager),this.basemapView=tt(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(t=>t.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=tt(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return D.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new P({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(t,e)=>this.getSpatialReferenceSupport(t,e),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||An.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t?.destroyed&&(D.getLogger(this).warn("#map","The provided map is already destroyed",{map:t}),t=null),An.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",t))}get spatialReference(){const t=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(t&&this.defaultsFromMap?.required?.heightModelInfo){const e=t.clone();return e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,e}return t}set spatialReference(t){const e=!pi(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(t){this._userTimeExtent=t}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??za}set timeZone(t){this._userTimeZone=t,Na(t)||D.getLogger(this).warn("#timeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Ki}whenLayerView(t){return this.layerViewManager?.whenLayerView(t)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(t){throw new C("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return this.getSpatialReferenceSupport(t)!=null}when(t,e){return this.isResolved()&&!this.ready&&D.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(t,e)}forceReadyCycle(){this.ready&&(Ce(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};y.views=new L,r([l()],y.prototype,"_userSpatialReference",void 0),r([l()],y.prototype,"activeTool",null),r([l({readOnly:!0})],y.prototype,"allLayerViews",void 0),r([l()],y.prototype,"groundView",void 0),r([l()],y.prototype,"animation",null),r([l()],y.prototype,"basemapView",void 0),r([l()],y.prototype,"center",null),r([l()],y.prototype,"defaultsFromMapSettings",null),r([l()],y.prototype,"defaultsFromMap",null),r([l()],y.prototype,"fatalError",void 0),r([l({type:Xt})],y.prototype,"extent",null),r([l(Wn(oo,"graphics"))],y.prototype,"graphics",void 0),r([l(Wn(ai,"analyses"))],y.prototype,"analyses",void 0),r([l({readOnly:!0,type:wn})],y.prototype,"heightModelInfo",null),r([l({readOnly:!0})],y.prototype,"interacting",null),r([l({readOnly:!0})],y.prototype,"navigating",null),r([l({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],y.prototype,"preconditionsReady",null),r([l({readOnly:!0})],y.prototype,"typeSpecificPreconditionsReady",void 0),r([l({type:L,readOnly:!0})],y.prototype,"layerViews",void 0),r([l()],y.prototype,"resolution",null),r([l({type:uo})],y.prototype,"magnifier",void 0),r([l({value:null,type:xr})],y.prototype,"map",null),r([l()],y.prototype,"padding",void 0),r([l({readOnly:!0})],y.prototype,"ready",void 0),r([l({type:si})],y.prototype,"spatialReference",null),r([l()],y.prototype,"spatialReferenceWarningDelay",void 0),r([l()],y.prototype,"stationary",null),r([l({readOnly:!0})],y.prototype,"supportsGround",void 0),r([l({type:Sr})],y.prototype,"timeExtent",null),r([l({type:String,nonNullable:!0})],y.prototype,"timeZone",null),r([l()],y.prototype,"tools",null),r([l()],y.prototype,"toolViewManager",void 0),r([l({readOnly:!0})],y.prototype,"type",void 0),r([l({type:Number})],y.prototype,"scale",void 0),r([l({readOnly:!0})],y.prototype,"updating",void 0),r([l({readOnly:!0})],y.prototype,"initialExtentRequired",void 0),r([l({readOnly:!0})],y.prototype,"initialExtent",null),r([l()],y.prototype,"cursor",null),r([l({readOnly:!0})],y.prototype,"input",void 0),r([l({type:To,nonNullable:!0})],y.prototype,"navigation",void 0),r([l()],y.prototype,"layerViewManager",void 0),r([l()],y.prototype,"analysisViewManager",void 0),r([l()],y.prototype,"selectionManager",void 0),r([l()],y.prototype,"width",void 0),r([l()],y.prototype,"height",void 0),r([l({readOnly:!0})],y.prototype,"resizing",void 0),r([l({value:null,readOnly:!0})],y.prototype,"size",null),r([l({readOnly:!0})],y.prototype,"suspended",void 0),r([l({readOnly:!0})],y.prototype,"viewEvents",void 0),r([l({readOnly:!0})],y.prototype,"persistableViewModels",void 0),r([l()],y.prototype,"_isValid",void 0),r([l()],y.prototype,"_readyCycleForced",void 0),r([l()],y.prototype,"_lockedSpatialReference",void 0),r([l()],y.prototype,"_userTimeZone",void 0),r([l()],y.prototype,"_lockedTimeZone",void 0),r([l()],y.prototype,"_userTimeExtent",void 0),r([l()],y.prototype,"_lockedTimeExtent",void 0),r([l({type:Ki})],y.prototype,"theme",void 0),r([l({readOnly:!0,type:Ki})],y.prototype,"effectiveTheme",null),y=be=r([_("esri.views.View")],y);const Vi=globalThis.$arcgis;Vi&&!Vi.views&&Object.defineProperty(Vi,"views",{configurable:!1,enumerable:!0,writable:!1,value:y.views});const gh=y;function yh(t){return t.layerViews}let Rt=class extends Ba{constructor(t){super(t),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=ui(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._resolver?.reject(new C("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._resolver?.resolve())}update(t,e){e||(e=to(t)?"waiting-for-target":"running"),this._set("target",t),this._set("state",e)}};r([l({readOnly:!0})],Rt.prototype,"done",null),r([l({readOnly:!0,type:String})],Rt.prototype,"state",void 0),r([l()],Rt.prototype,"target",void 0),Rt=r([_("esri.views.ViewAnimation")],Rt),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Rt||(Rt={}));const Qi=Rt;function xt(){return[1,0,0,1,0,0]}function _h(t){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function fh(t,e,i,n,s,o){return[t,e,i,n,s,o]}function vh(t,e){return new Float64Array(t,e,6)}const wh=xt();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:wh,clone:_h,create:xt,createView:vh,fromValues:fh},Symbol.toStringTag,{value:"Module"}));const ko=96,Eo=39.37,bh=180/Math.PI;function Co(t){return t.wkid?t:t.spatialReference||si.WGS84}function xn(t,e){return e.type?N(t,e.x,e.y):Se(t,e)}function Io(t){return Ys(t)}function fi(t,e,i=0){let n=t.width,s=t.height;if(i!==0){const h=gn(i),c=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));n=t.width*c+t.height*p,s=t.width*p+t.height*c}const o=Math.max(1,e[0]),a=Math.max(1,e[1]);return Math.max(n/o,s/a)*Ch(t.spatialReference)}async function Te(t,e,i,n){let s,o;if(!t||Array.isArray(t)&&!t.length)return null;if(L.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&typeof t[0]=="object"){const h=t.every(d=>"attributes"in d),c=t.some(d=>!d.geometry);let p=t;if(h&&c&&e&&e.allLayerViews){const d=new Map;for(const f of t){const T=f.layer,I=d.get(T)||[],E=f.attributes[T.objectIdField];E!=null&&I.push(E),d.set(T,I)}const m=[];d.forEach((f,T)=>{const I=e.allLayerViews.find(E=>E.layer.id===T.id);if(I&&"queryFeatures"in I){const E=T.createQuery();E.objectIds=f,E.returnGeometry=!0,m.push(I.queryFeatures(E))}});const u=await Promise.all(m),g=[];for(const f of u)if(f&&f.features&&f.features.length)for(const T of f.features)T.geometry!=null&&g.push(T.geometry);p=g}for(const d of p)n=await Te(d,e,i,n);return n}if(Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")s=new V(t);else if(t instanceof io)s=t;else if("geometry"in t){if(t.geometry)s=t.geometry;else if(t.layer){const h=t.layer,c=e.allLayerViews.find(p=>p.layer.id===h.id);if(c&&"queryFeatures"in c){const p=h.createQuery();p.objectIds=[t.attributes[h.objectIdField]],p.returnGeometry=!0,s=(await c.queryFeatures(p))?.features?.[0]?.geometry}}}if(s==null)return null;switch(s.type){case"point":o=new Xt({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":o=Zr(s);break;default:o=s.extent}if(!o)return null;yn()||_n(o.spatialReference,i)||await fn();const a=Le(o,i);if(!a)return null;if(n){const h=a.center,c=h.clone();c.x=Tn(h.x,n.center.x,i),c.x!==h.x&&a.centerAt(c),n=n.union(a)}else n=a;return n}function Th(t){if(t&&(!Array.isArray(t)||typeof t[0]!="number")&&(typeof t=="object"||Array.isArray(t)&&typeof t[0]=="object")){if("layer"in t&&t.layer?.minScale!=null&&t.layer.maxScale!=null){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every(e=>"layer"in e)){let e=0,i=0;for(const n of t){const s=n.layer;s?.minScale&&s.maxScale&&(e=s.minScalei?s.maxScale:i)}return e&&i?{min:e,max:i}:null}}}function us(t,e){const i=Co(t);return pi(i,e)||i.imageCoordinateSystem||e.imageCoordinateSystem?t:Le(t,e)}async function Mh(t,e){if(!t||!e)return new nt({targetGeometry:new V,scale:0,rotation:0});let i=e.spatialReference;const{constraints:n,padding:s,viewpoint:o,size:a}=e,h=[s?a[0]-s.left-s.right:a[0],s?a[1]-s.top-s.bottom:a[1]];let c=null;t instanceof nt?c=t:t.viewpoint?c=t.viewpoint:t.target&&t.target.declaredClass==="esri.Viewpoint"&&(c=t.target);let p=null;c?.targetGeometry?p=c.targetGeometry:t instanceof Xt?p=t:t instanceof io?p=await Te(t,e,i):t&&(p=await Te(t.center,e,i)||await Te(t.target,e,i)||await Te(t,e,i)),!p&&o?.targetGeometry?p=o.targetGeometry:!p&&e.extent&&(p=e.extent),i||(i=Co(e.spatialReference||e.extent||p)),yn()||pi(p.spatialReference,i)||_n(p.spatialReference,i)||await fn();const d=us(p,i),m="center"in d?d.center:d;e.pickClosestTarget!==!1&&m.type==="point"&&o.targetGeometry?.type==="point"&&(m.x=Tn(m.x,o.targetGeometry.x,m.spatialReference));let u=0;c?u=c.rotation:t.hasOwnProperty("rotation")?u=t.rotation:o&&(u=o.rotation);let g=0;g=c?.targetGeometry!=null&&c.targetGeometry.type==="point"?c.scale:"scale"in t&&t.scale?t.scale:"zoom"in t&&t.zoom!==-1&&n&&n.effectiveLODs?n.zoomToScale(t.zoom):Array.isArray(p)||p.type==="point"||p.type==="extent"&&p.width===0&&p.height===0?o.scale:fi(us(p.extent,i),h,u);const f=Th(t.target??t);f&&(f.min&&f.ming&&(g=f.max));let T=new nt({targetGeometry:m,scale:g,rotation:u});return n&&(T=n.fit(T),n.constrainByGeometry(T),n.rotationEnabled||(T.rotation=o.rotation)),T}function G(t,e){const i=t.targetGeometry,n=e.targetGeometry;return i.x=n.x,i.y=n.y,i.spatialReference=n.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function xh(t,e,i){return i?N(t,.5*(e[0]-i.right+i.left),.5*(e[1]-i.bottom+i.top)):_i(t,e,.5)}const Ph=function(){const t=O();return function(e,i,n){const s=i.targetGeometry;xn(t,s);const o=.5*ue(i);return e.xmin=t[0]-o*n[0],e.ymin=t[1]-o*n[1],e.xmax=t[0]+o*n[0],e.ymax=t[1]+o*n[1],e.spatialReference=s.spatialReference,e}}();function Sh(t,e,i,n,s){return Ji(t,e,i.center),t.scale=fi(i,n),s?.constraints?.constrain(t),t}function kh(t,e,i,n){return kn(t,e,i,n),ho(t,t)}const Do=function(){const t=O();return function(e,i,n){return ao(e,Ih(e,i),xh(t,i,n))}}(),Eh=function(){const t=xt(),e=O();return function(i,n,s,o){const a=ue(n),h=Pn(n);return N(e,a,a),Hr(t,e),bn(t,t,h),oi(t,t,Do(e,s,o)),oi(t,t,[0,o.top-o.bottom]),N(i,t[4],t[5])}}();function ue(t){return t.scale*Ro(t.targetGeometry?.spatialReference)}function Ro(t){return t!=null&&eo(t)?1/(Io(t)*Eo*ko):1}function Pn(t){return ro(t.rotation)||0}function Ch(t){return eo(t)?Io(t)*Eo*ko:1}function Ih(t,e){return _i(t,e,.5)}const Sn=function(){const t=O(),e=O(),i=O();return function(n,s,o,a,h,c){return Vr(t,s),_i(e,o,.5*c),N(i,1/a*c,-1/a*c),co(n,e),h&&bn(n,n,h),lo(n,n,i),oi(n,n,t),n}}(),kn=function(){const t=O();return function(e,i,n,s){const o=ue(i),a=Pn(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,a,s)}}(),Dh=function(){const t=O();return function(e,i,n,s){const o=ue(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,0,s)}}();function Lo(t){const e=Bs(t);return e?e.valid[1]-e.valid[0]:0}function Rh(t,e){return Math.round(Lo(t)/e)}const Lh=function(){const t=O(),e=O(),i=[0,0,0];return function(n,s,o){qi(t,n,s),qn(t,t),qi(e,n,o),qn(e,e),Ir(i,t,e);let a=Math.acos(Dr(t,e)/(Bn(t)*Bn(e)))*bh;return i[2]<0&&(a=-a),isNaN(a)&&(a=0),a}}(),Vh=function(){const t=O();return function(e,i,n,s){const o=e.targetGeometry;return G(e,i),Eh(t,i,n,s),o.x+=t[0],o.y+=t[1],e}}(),Ji=function(t,e,i){G(t,e);const n=t.targetGeometry;return n.x=i.x,n.y=i.y,n.spatialReference=i.spatialReference,t},Oh=function(){const t=O();return function(e,i,n,s,o){o||(o="center"),ao(t,n,s),_i(t,t,.5);const a=t[0],h=t[1];switch(o){case"center":N(t,0,0);break;case"left":N(t,-a,0);break;case"top":N(t,0,h);break;case"right":N(t,a,0);break;case"bottom":N(t,0,-h);break;case"top-left":N(t,-a,h);break;case"bottom-left":N(t,-a,-h);break;case"top-right":N(t,a,h);break;case"bottom-right":N(t,a,-h)}return vi(e,i,t),e}}();function Mu(t,e,i){return G(t,e),t.rotation+=i,t}function Ah(t,e,i){return G(t,e),t.rotation=i,t}const zh=function(){const t=O();return function(e,i,n,s,o){return G(e,i),isNaN(n)||n===0||(Oo(t,s,i,o),e.scale=i.scale*n,Ao(t,t,e,o),vi(e,e,N(t,t[0]-s[0],s[1]-t[1]))),e}}();function ms(t,e,i){return G(t,e),t.scale=i,t}const Vo=function(){const t=O();return function(e,i,n,s,o,a){return G(e,i),isNaN(n)||n===0||(Oo(t,o,i,a),e.scale=i.scale*n,e.rotation+=s,Ao(t,t,e,a),vi(e,e,N(t,t[0]-o[0],o[1]-t[1]))),e}}(),xu=function(){const t=O(),e=O();return function(i,n,s,o,a,h,c){return Do(e,h,c),Rr(t,a,e),o?Vo(i,n,s,o,t,h):zh(i,n,s,t,h)}}(),Oo=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kh(t,n,s,1))}}(),Ao=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kn(t,n,s,1))}}(),vi=function(){const t=O(),e=xt();return function(i,n,s){G(i,n);const o=ue(n),a=i.targetGeometry;return Or(e,Pn(n)),lo(e,e,Cr(o,o)),Tt(t,s,e),a.x+=t[0],a.y+=t[1],i}}();function Ye(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function Nh(t){const e=new Float32Array(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Fh(t,e,i,n,s,o,a,h,c){const p=new Float32Array(9);return p[0]=t,p[1]=e,p[2]=i,p[3]=n,p[4]=s,p[5]=o,p[6]=a,p[7]=h,p[8]=c,p}function Hh(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:Nh,create:Ye,createView:Hh,fromValues:Fh},Symbol.toStringTag,{value:"Module"}));function Zh(t){return t instanceof Float32Array&&t.length>=2}function Gh(t){return Array.isArray(t)&&t.length>=2}function Oi(t){return Zh(t)||Gh(t)}var tn;const ut=[0,0];let _t=tn=class extends cn{constructor(t){super(t),this._viewpoint2D={center:O(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Xt,this.id=0,this.inverseTransform=xt(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=xt(),this.transformNoRotation=xt(),this.displayMat3=Ye(),this.displayViewMat3=Ye(),this.viewMat3=Ye(),this.viewMat2d=zr(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,i=t.targetGeometry;e.center[0]=i.x,e.center[1]=i.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=i.spatialReference}this._update()}get visibleArea(){const[t,e]=this.size;return[this.toMap([0,0],0,0),this.toMap([0,0],0,e),this.toMap([0,0],t,e),this.toMap([0,0],t,0)]}copy(t){const e=this.size,i=this.viewpoint;return i&&e?(this.viewpoint=G(i,t.viewpoint),this._set("size",Se(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new tn({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,i){return Oi(e)?Tt(t,e,this.inverseTransform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.inverseTransform))}toScreen(t,e,i){return Oi(e)?Tt(t,e,this.transform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transform))}toScreenNoRotation(t,e,i){return Oi(e)?Tt(t,e,this.transformNoRotation):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transformNoRotation))}wrapMapCoordinate(t,e){Se(t,e);const[i]=e,[n]=this.center,{extent:s,spatialReference:o}=this;let{xmin:a,xmax:h}=s;if(o.isWrappable){const c=Lo(o)/2;a=Math.max(a,n-c),h=Math.min(h,n+c)}return(ih)&&(t[0]=Tn(i,n,o)),t}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size");return Sn(t,i,s,e,0,n),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:n}=this._viewpoint2D,s=this._get("pixelRatio")||1,o=this._get("size"),a=new nt({targetGeometry:new V(t[0],t[1],e),scale:i,rotation:n});if(this._set("viewpoint",a),!o||!e||!i)return;this.resolution=ue(a),this.rotation=n,this.scale=i,this.spatialReference=e,Se(this.center,t);const h=o[0]!==0?2/o[0]:0,c=o[1]!==0?-2/o[1]:0;Gr(this.displayMat3,h,0,0,0,c,0,-1,1,1);const p=$r(this.viewMat3),d=Xn(o[0]/2,o[1]/2),m=Xn(-o[0]/2,-o[1]/2),u=ro(n);Yn(p,p,d),Wr(p,p,u),Yn(p,p,m),Ur(this.displayViewMat3,this.displayMat3,p);const g=co(this.viewMat2d,d);return bn(g,g,u),oi(g,g,m),Ph(this.extent,a,o),kn(this.transform,a,o,s),ho(this.inverseTransform,this.transform),Dh(this.transformNoRotation,a,o,s),this.worldScreenWidth=Rh(this.spatialReference,this.resolution),this._set("id",this.id+1),this.notifyChange("visibleArea"),this}};r([l({readOnly:!0})],_t.prototype,"id",void 0),r([l({value:1,json:{write:!0}})],_t.prototype,"pixelRatio",null),r([l({json:{write:!0}})],_t.prototype,"size",null),r([l()],_t.prototype,"spatialReference",void 0),r([l({type:nt,json:{write:!0}})],_t.prototype,"viewpoint",null),r([l({readOnly:!0})],_t.prototype,"visibleArea",null),_t=tn=r([_("esri.views.2d.ViewState")],_t);const gs=_t;var en,nn;let Mt=en=class extends M{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new en({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};r([l()],Mt.prototype,"left",void 0),r([l()],Mt.prototype,"top",void 0),r([l()],Mt.prototype,"right",void 0),r([l()],Mt.prototype,"bottom",void 0),Mt=en=r([_("esri.views.2d.PaddedViewState.Padding")],Mt);let oe=nn=class extends gs{constructor(...t){super(...t),this.paddedViewState=new gs,this._updateContent=(()=>{const e=O();return()=>{const i=this._get("size"),n=this._get("padding");if(!i||!n)return;const s=this.paddedViewState;N(e,n.left+n.right,n.top+n.bottom),qi(e,i,e),Se(s.size,e);const o=s.viewpoint;o&&(this.viewpoint=o)}})(),this.addHandles(w(()=>[this.size,this.padding],()=>this._updateContent(),Ee)),this.padding=new Mt,this.size=[0,0]}set padding(t){this._set("padding",t||new Mt)}set viewpoint(t){if(t){this.paddedViewState.viewpoint=t;let e=t;const i=this._get("padding");i&&(e=Vh(t.clone(),t,this._get("size"),i));const{targetGeometry:n,rotation:s,scale:o}=e,{x:a,y:h,spatialReference:c}=n,p=this._viewpoint2D;p.center[0]=a,p.center[1]=h,p.rotation=s,p.scale=o,p.spatialReference=c,this._update()}}clone(){return new nn({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};r([l()],oe.prototype,"paddedViewState",void 0),r([l({type:Mt})],oe.prototype,"padding",null),r([l()],oe.prototype,"viewpoint",null),oe=nn=r([_("esri.views.2d.PaddedViewState")],oe);const En=oe;let ys=class{constructor(t){this._view=t,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0})}get view(){return this._view}get size(){const[t,e]=this._view.size;return Math.sqrt(t*t+e*e)}get scale(){return this.viewpoint.scale}get rotation(){return this.viewpoint.rotation}get center(){return this.viewpoint.targetGeometry}get scaleToResolutionFactor(){return Ro(this.center.spatialReference)}pixelsPerPanAtZoom(t){return 1/(t*this.scaleToResolutionFactor)}zoomAtPixelsPerPan(t){return 1/(t*this.scaleToResolutionFactor)}pixelsPerRotate(){return this.size/2}compareTo(t,e){e.pan=dr(this.center,t.center);let i=Math.abs(t.rotation-this.rotation);i=i>=180?360-i:i,e.rotate=gn(i),e.sourceZoom=this.scale,e.targetZoom=t.scale}interpolate(t,e,i){const{pan:n,rotate:s,zoom:o,zoomOffset:a}=i,{center:h}=this;h.spatialReference=t.center.spatialReference,h.x=Fe(t.center.x,e.center.x,n),h.y=Fe(t.center.y,e.center.y,n),this.viewpoint.scale=Fe(t.scale,e.scale+a,o);let c=t.rotation;const p=e.rotation;Math.abs(p-c)>=180&&(c+=360*(ct*t,$h=t=>1-zo(1-t),Wh=t=>2**(10*(t-1)),Uh=t=>1-Wh(1-t);function jh(t){const e=2*(t-Math.sqrt((t-1)*t)),i=e/2/t;return n=>ni1e-5}get hasPan(){return this.compared.pan>xi()}get hasFov(){return Math.abs(this.compared.fov)>xi()}get hasRotate(){return this.compared.rotate>xi()}},Yh=class{constructor(){this.pan=0,this.rotate=0,this.zoom=0,this.fov=0,this.zoomOffset=0}},Xh=class{constructor(){this.segments=new Array}get time(){return this.segments.reduce((t,e)=>X(t+e.time),X(0))}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),t*=this.time;let i=0,n=0;const s=this.definition,o=this.segments.reduce((a,h)=>a||h.definition.hasZoom,!1);for(let a=0;aMath.abs(p-u)?d:p;e.zoomOffset=f-g,e.zoom=(m-u)/(f-u)}else e.zoom=1;return e}t-=h.time,i+=c.compared.pan,n+=c.compared.rotate}}segmentInterpolateComponentsAt(t,e,i){t.interpolateComponentsAt(e,i)}},Ai=class{get time(){return this._time}constructor(t){t&&this.update(t)}update(t){t&&(this.definition?this.definition.copyFrom(t):this.definition=t.clone()),this._updatePrecomputedVariables(),this._updatePixelFlow()}_updatePrecomputedVariables(){const t=this.definition,e=t.compared,i=e.sourceZoom,n=e.targetZoom;this._zoomSign=i>n?1:-1,this._panPixelsAtSource=e.pan*t.source.pixelsPerPanAtZoom(i);const s=(t.source.pixelsPerRotate()+t.target.pixelsPerRotate())/2;this._rotatePixels=e.rotate*s}_updatePixelFlow(){const t=this.definition.compared.sourceZoom,e=this.definition.compared.targetZoom,{hasZoom:i,hasPan:n,hasRotate:s}=this.definition;let o=0,a=0;i&&(n&&(o=(e/t-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),s&&(a=this._zoomSign*(Math.log(t/e)/Math.LN2)*this.definition.halfWindowSize/this._rotatePixels)),this._zoomPixelFlow=0,this._panPixelFlow=0,this._rotatePixelFlow=0;const h=this.definition.desiredPixelFlow;if(i&&n&&s){const c=o+a+o*a;this._zoomPixelFlow=o*a/c*h,this._panPixelFlow=a/c*h,this._rotatePixelFlow=o/c*h}else if(i&&n){const c=1+o;this._zoomPixelFlow=o/c*h,this._panPixelFlow=1/c*h}else if(i&&s){const c=1+a;this._zoomPixelFlow=a/c*h,this._rotatePixelFlow=1/c*h}else if(n&&s){const c=this._panPixelsAtSource/this._rotatePixels,p=1+c;this._panPixelFlow=c/p*h,this._rotatePixelFlow=1/p*h}else n?this._panPixelFlow=h:i?this._zoomPixelFlow=h:s&&(this._rotatePixelFlow=h);if(this._time=X(Math.max(this.rotateTime,this.zoomTime,this.panTime)),this.fovTime>this._time){const c=this.fovTime/this._time;this._time=this.fovTime,this._zoomPixelFlow/=c,this._panPixelFlow/=c,this._rotatePixelFlow/=c}}get rotateTime(){return this.definition.hasRotate?X(this._rotatePixels/this._rotatePixelFlow):X(0)}get zoomTime(){return this.definition.hasZoom?X(this._zoomSign*(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2)*this.definition.halfWindowSize/this._zoomPixelFlow):X(0)}get fovTime(){return this.definition.hasFov?X(Math.abs(this.definition.compared.fov)/Qh):X(0)}get panTime(){if(!this.definition.hasPan)return X(0);if(this.definition.hasZoom){const t=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2,e=t*this._panPixelsAtSource;return X(Math.log(e*(this._zoomPixelFlow/this._panPixelFlow)+1)/(t*this._zoomPixelFlow))}return X(this._panPixelsAtSource/this._panPixelFlow)}_interpolateComponentsZoom(t){if(t===0||t===1)return t;if(this.definition.hasZoom){const e=this.definition.compared.sourceZoom,i=this.definition.compared.targetZoom;return(e*(e/i)**-t-e)/(i-e)}return t}_interpolateComponentsFov(t){if(t===0)return this.definition.segmentStart;if(t===1)return this.definition.segmentEnd;if(this.definition.hasFov){const{segmentStart:e,segmentEnd:i}=this.definition;return e+t*(i-e)}return this.definition.segmentStart}_interpolateComponentsPan(t){if(t===0||t===1)return t;if(this.definition.hasPan&&this.definition.hasZoom){const e=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*(this._panPixelFlow*(2**(e*t*this._time)-1))/(e*Math.LN2)}return t}_interpolateComponentsRotate(t){return t}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),e.zoom=this._interpolateComponentsZoom(t),e.pan=this._interpolateComponentsPan(t),e.rotate=this._interpolateComponentsRotate(t),e.zoomOffset=0,e.fov=this._interpolateComponentsFov(t)}};const Qh=gn(45);function Jh(t,e,i){const n=e-t.compared.sourceZoom,s=t.halfWindowPanAtZoom(n);return-t.halfWindowSize*(i.ascensionFactor*Math.LN2*t.compared.pan+s)*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2*s)}function tc(t,e,i){const n=1/e,s=Math.log(t.compared.sourceZoom*n),o=1/t.desiredPixelFlow,a=1/Math.LN2,h=e-t.compared.sourceZoom,c=1/h,p=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(h))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*o*a*c*p-t.halfWindowSize*s*o*a*c+t.halfWindowSize*s*o*a*p/(h*h)}function ec(t,e,i){const n=e-t.compared.sourceZoom,s=1/n,o=1/e,a=Math.log(t.compared.sourceZoom*o),h=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(n))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h+2*s*a+2*o-2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function ic(t,e){return-t.halfWindowSize*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2)}function nc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function sc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function oc(t,e,i){return-t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e))}function ac(t,e,i){return t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e))}function rc(t,e,i){return-2*t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e*e))}function lc(t,e,i){return t.halfWindowSize*(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*t.halfWindowPanAtZoom(-e+t.compared.targetZoom))}function hc(t,e,i){const n=Math.log(e/t.compared.targetZoom),s=1/t.desiredPixelFlow,o=1/Math.LN2,a=-e+t.compared.targetZoom,h=1/a,c=(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return-t.halfWindowSize*n*s*o*h+t.halfWindowSize*n*s*o*c/(a*a)+t.halfWindowSize*s*o*h*c/e}function cc(t,e,i){const n=e-t.compared.targetZoom,s=1/n,o=1/e,a=Math.log(e/t.compared.targetZoom),h=(t.halfWindowPanAtZoom(e)+i.descensionFactor*Math.LN2*t.compared.pan-t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h-2*s*a+2*o+2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function pc(t,e){return t.halfWindowSize*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2)}function dc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function uc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function mc(t){const e=t.compared.sourceZoom-t.compared.targetZoom;if(e===0)return t.compared.pan*t.halfWindowSize/(t.desiredPixelFlow*t.halfWindowPanAtZoom(t.compared.sourceZoom));const i=Math.LN2*t.compared.pan,n=e,s=t.halfWindowPanAtZoom(n),o=t.halfWindowSize*Math.log(t.compared.sourceZoom/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*s);return t.compared.sourceZoom<=t.compared.targetZoom?o*(i-s):o*(i+s)}function gc(t,e){let i=yc(t,e);const n={ascensionFactor:e.ascensionFactor!=null?e.ascensionFactor:.5,descensionFactor:e.descensionFactor!=null?e.descensionFactor:.5},s=n.ascensionFactor===0,o=n.descensionFactor===0,a=s?ic:Jh,h=s?nc:tc,c=s?sc:ec,p=o?pc:lc,d=o?dc:hc,m=o?uc:cc,u=x=>a(t,x,n)+oc(t,x,n)+p(t,x,n),g=x=>h(t,x,n)+ac(t,x,n)+d(t,x,n),f=x=>c(t,x,n)+rc(t,x,n)+m(t,x,n);let T=u(i);const I=mc(t);let E;const ot=e.maximumIterations||20,S=e.maximumDistance!=null?e.maximumDistance:1/0;for(E=0;Ex&&($+=x);const K=$/f(i);if(isNaN(K)||i>=S&&K<0){if(!isFinite(S))return null;i=S,T=u(i);break}if(i-=K,iI*(1-.3)||i0&&(n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.copyFrom(this.definition),n.definition.compared.sourceZoom=t,n.definition.compared.targetZoom=t,n.definition.compared.pan=this.definition.compared.pan*h,n.definition.compared.rotate=this.definition.compared.rotate*h,n.definition.segmentStart=i.definition.segmentEnd,n.definition.segmentEnd=i.definition.segmentEnd+h,n.update(),this.segments.push(n)),s.definition?s.definition.copyFrom(this.definition):s.definition=this.definition.clone(),s.definition.compared.sourceZoom=t,s.definition.compared.pan=this.definition.compared.pan*a,s.definition.compared.rotate=this.definition.compared.rotate*a,s.definition.segmentStart=o+h,s.update(),this._descensionSegment=s,this.segments.push(s)}_updateWithoutApex(){const[t]=this._preallocSegments;t.update(this.definition),this.segments.push(t)}};const fc=new Yh;let vc=class{get time(){return this._time}get isLinear(){return this.path.segments.length===1}constructor(t){this._time=it(0),this._easing=_s,this.definition=new Kh(t),this.path=new _c}update(t,e,i){this.definition.update(t,e,i),this.path.update(this.definition,i),this._time=this._applyTimeSettings(ur(isFinite(this.path.time)?this.path.time:X(0)),i),this._easing=i.easing??(this._time>=1e3?_s:Uh)}cameraAt(t,e){t=Math.min(Math.max(0,t),1),t=this._normalizedEasing(t);const i=this.path.interpolateComponentsAt(t,fc);e.interpolate(this.definition.source,this.definition.target,i)}_normalizedEasing(t){const e=this._easing(0,this._time),i=this._easing(1,this._time);return(this._easing(t,this._time)-e)/(i-e)}_applyTimeSettings(t,e){const i=e.speedFactor!=null?e.speedFactor:1,n=e.minDuration??De.minDuration/i,s=e.maxDuration??De.maxDuration/i;return t=e.duration!=null?e.duration:it(Math.min(Math.max(t/i,n),s))}};const fs=2e3,wc=64;let bc=class{constructor(t){this._view=t,this._animation=new vc(()=>new ys(this._view)),this._current=new ys(this._view)}get _source(){return this._animation.definition.source}get _target(){return this._animation.definition.target}get duration(){return this._animation.time}get animation(){return this._animation}update(t,e,i={}){G(this._current.viewpoint,t),G(this._source.viewpoint,t),G(this._target.viewpoint,e),this._animation.update(this._source,this._target,i)}applyRatio(t,e){this._animation.cameraAt(e,this._current),G(t,this._current.viewpoint)}},ae=class extends M{constructor(t){super(t),this._animation=null,this._destinationViewState=new En,this.updateFunction=null,this.easing=jr.ease,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0}),this._updateTask=de({postRender:this._postRender.bind(this)}),this._updateTask.pause(),this._transition=new bc(t.view)}destroy(){this._updateTask=st(this._updateTask)}get animation(){return this._animation}set animation(t){this._animation=t,this.view.animation=t}animate(t,e,i){this.stop();const n=this.viewpoint;G(n,e);const s=(typeof i?.easing=="string"?qr(i.easing):i?.easing)||this.easing,o=t.target;this._transition.update(this.viewpoint,o,{apex:{maximumDistance:Math.min(Math.min(e.scale,o.scale)*wc,this.view.constraints.effectiveMinScale),desiredSlope:5e-8},duration:i?.duration,maxDuration:i?.animationMode==="auto"?it(1/0):i?.maxDuration??No.maxDuration,speedFactor:i?.speedFactor,easing:typeof s=="function"?h=>s(h):void 0}),i?.animationMode==="auto"&&(this._destinationViewState.copy(this.view.state),this._destinationViewState.viewpoint=o,Tc(this._transition.animation,i,this.view.state,this._destinationViewState)||this._transition.update(this.viewpoint,o,{duration:it(0)}));const a=()=>{this.animation===t&&this._updateTask&&(t.state==="finished"&&(this._transition.applyRatio(this.viewpoint,1),this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return t.when(a,a),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinuous(t,e){this.stop(),this.updateFunction=e,this.viewpoint=t;const i=new Qi({target:t.clone()}),n=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){const e=this.animation;if(e&&e.state!==Qi.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime),this.animation?.update(this.viewpoint);else{const i=performance.now()-this._startTime,n=this._transition.duration,s=n>0?i/n:1,o=s>=1;this._transition.applyRatio(this.viewpoint,s),o&&this.animation?.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};function Tc(t,e,i,n){if(e?.duration!=null)return!0;const{time:s,isLinear:o}=t,a=e?.speedFactor||1,h=e?.maxDuration??No.maxDuration/a;if(z("esri-goto-debug")&&(console.log("speed factor:",a),console.log("adjusted duration: ",s),console.log("adjusted max duration: ",h),console.log("is linear:",o)),s>h)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: animations must be shorter than ${h/1e3}s`),!1;if(o){const c=O(),p=H(...n.toScreen(c,...i.center)),d=H(...i.toScreen(c,...n.center)),m=d!=null&&d.x>-(1.5-.5)*i.size[0]&&d.x<(1.5+.5)*i.size[0]&&d.y>-(1.5-.5)*i.size[1]&&d.y<(1.5+.5)*i.size[1],u=p!=null&&p.x>-(1.5-.5)*n.size[0]&&p.x<(1.5+.5)*n.size[0]&&p.y>-(1.5-.5)*n.size[1]&&p.y<(1.5+.5)*n.size[1];if(z("esri-goto-debug")&&(console.log(`dest is within ${1.5} screens at start view:`,m),console.log(`start is within ${1.5} screens at dest view:`,u)),s>fs/a&&!m&&!u)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: linear animations must be... - - shorter than ${fs/1e3/a}s, or - - shorter than ${h/1e3}s and the destination is close enough to the starting screen, or - - shorter than ${h/1e3}s and the start point is close enough to the destination screen`),!1}return!0}r([l()],ae.prototype,"easing",void 0),r([l()],ae.prototype,"view",void 0),r([l()],ae.prototype,"viewpoint",void 0),ae=r([_("esri.views.2d.AnimationManager")],ae);const Mc=ae;let xc=class{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=Br(),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),this.view.animation?.target==null||to(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=e=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:i,graphicsView:n,labelManager:s,state:{id:o}}=this.view;i.forEach(this._updateLayerView,this),s!=null&&(s.lastUpdateId!==o&&(s.viewChange(),s.lastUpdateId=o),s.updateRequested&&s.processUpdate(this._updateParameters)),n!=null&&(n.lastUpdateId!==o&&(n.viewChange(),n.lastUpdateId=o),n.updateRequested&&n.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=Pi.ANIMATING:this.view.interacting?this._scheduler.state=Pi.INTERACTING:this._scheduler.state=Pi.IDLE,this._scheduler.updateBudget(e)&&this._scheduler.frame()}}destroy(){this.stop(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new En,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=w(()=>t.stationary,e=>{this.stationary=e,this.requestFrame()}),this._frameTaskHandle=de(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,i=t.lastUpdateId;i!=null&&(this.stationary||t.moving)||(t.moving=!0),i!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}},Xe=class extends M{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,e){if(!t)return void D.getLogger(this).error("#goTo()","target cannot be null or undefined");const i=new Qi;this.view.animation=i,await pn(()=>this.view.ready,e);const n={...e,animate:e?.animate??!wo(),animationMode:e?.animationMode??"auto"},{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d}=this.view,m=Mh(t,{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d,pickClosestTarget:e?.pickClosestTarget??!0});return i?.update(m),this._gotoTask={},n.animate?this._gotoAnimated(m,n):this._gotoImmediate(m,n)}_gotoImmediate(t,e){const i=this._gotoTask,n=this.view.animation,s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(i,n,s,e)}_gotoAnimated(t,e){const i=this._gotoTask,n=this.view.animation;if(!n)return Promise.resolve();const s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");return n.update(o),this.view.animationManager.animate(n,this.view.viewpoint,e),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(i,n,s,e)}_cancellableGoTo(t,e,i,n){const s=()=>t===this._gotoTask;return Ka(i,n).finally(()=>{s()&&(e.done||e.stop())})}};r([l({constructOnly:!0})],Xe.prototype,"view",void 0),Xe=r([_("esri.views.2d.GoToManager")],Xe);function k(){return Promise.all([b(()=>import("./webglDeps-Bgavuh0h-C76lWx0y.js"),__vite__mapDeps([139,140,1,2,133,132,141,142,143,144]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-qsLwuAiC.js"),__vite__mapDeps([145,1,2,114,43,44,22,45,146,147,56,148,28,27,131,110,111,112,113,76,109,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,120,154,126,144,155,156,143,130,157,158,25,20,21,159,160,161,162,57,37,135,163,164,42,46,165,166,167,139,142,168,169,170,171,63,41,172,173,59,60,51,52,49,53,174,90,40,32,175,176,177,178,179,134,180,55,181,182,183,184,185,186,187,188,189,190,191,192,8,117,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,39,136]),import.meta.url)])}const ye=()=>k().then(()=>b(()=>import("./TileLayerView2D-CT-Yu10P-BUH8mf5a.js"),__vite__mapDeps([193,1,2,123,43,44,22,45,27,28,164,131,146,147,56,148,110,111,112,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,120,42,46,158,25,20,21,156,144,143,126,130,157,159,160,161,162,57,167,168,169,170,171,63,41,172,173,59,60,51,52,49,53,174,90,40,32,55,154,155,37,135,165,166,176,177,178,184,185,194,195,189,196,116,197,187,188,198,199,200,201,62,202,191,203,204,205,206,129,8,117,118,119,4,5,121,16,17,18,19,36,122,75,69,70,124,128,134,39,136]),import.meta.url)),zt=()=>k().then(()=>b(()=>import("./FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js"),__vite__mapDeps([207,1,2,36,158,25,20,21,22,162,56,57,86,11,12,13,14,208,61,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url).then(t=>t.F)),vs={"base-dynamic":()=>k().then(()=>b(()=>import("./BaseDynamicLayerView2D-AQ-6l0DU-Cy76IH9A.js"),__vite__mapDeps([210,1,2,211,156,131,150,28,133,132,141,140,151,127,144,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,212,118,119,195,198,8,117,59,60,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,129,134,135,39,136]),import.meta.url)),"base-tile":ye,"bing-maps":ye,catalog:()=>k().then(()=>b(()=>import("./CatalogLayerView2D-DaUVeBuS-Ngx1vfNP.js"),__vite__mapDeps([213,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),"catalog-dynamic-group":()=>k().then(()=>b(()=>import("./CatalogDynamicGroupLayerView2D-Cf-H7gda-DaXR8CGJ.js"),__vite__mapDeps([214,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),"catalog-footprint":()=>k().then(()=>b(()=>import("./CatalogFootprintLayerView2D-C0bBWVdF-E56VRyOl.js"),__vite__mapDeps([215,1,2,207,36,158,25,20,21,22,162,56,57,86,11,12,13,14,208,61,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url)),csv:zt,"geo-rss":()=>k().then(()=>b(()=>import("./GeoRSSLayerView2D-BLTYupUX-CpOPIa_K.js"),__vite__mapDeps([216,1,2,30,31,23,32,33,34,35,36,37,38,29,39,40,41,42,43,44,22,45,27,28,46,47,61,12,13,196,158,25,20,21,116,120,186,187,188,131,146,147,56,148,110,111,112,113,76,109,114,115,11,14,127,149,150,133,132,141,140,151,152,153,125,189,156,144,143,126,130,157,159,160,161,162,57,154,155,135,51,52,49,53,184,171,63,172,173,59,60,174,90,185,8,117,118,119,4,5,121,16,17,18,19,122,75,123,69,70,124,128,129,134,136]),import.meta.url)),feature:zt,geojson:zt,parquet:zt,graphics:()=>k().then(()=>b(()=>import("./GraphicsLayerView2D-CGXlTqHO-2KIrsS1c.js"),__vite__mapDeps([217,1,2,196,158,25,20,21,22,116,120,186,187,188,131,146,147,56,148,28,27,110,111,112,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,162,57,154,155,37,135,51,52,49,53,184,40,41,42,43,46,171,63,172,173,59,60,174,90,32,185,209,8,117,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,134,39,136]),import.meta.url)),group:()=>k().then(()=>b(()=>import("./GroupLayerView2D-BR-kLeLa-qMUg5_Ou.js"),__vite__mapDeps([218,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),imagery:()=>k().then(()=>b(()=>import("./ImageryLayerView2D-CVDvTIGY-5bfgF9Fc.js"),__vite__mapDeps([219,1,2,123,220,140,133,132,144,151,221,156,131,150,28,141,127,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,184,40,41,146,147,148,27,149,152,153,44,45,42,43,46,171,63,172,173,59,60,51,52,49,53,174,90,32,154,155,37,135,185,197,187,188,189,211,195,212,118,119,222,208,206,198,8,117,4,5,121,16,17,18,19,36,122,75,69,70,124,128,129,134,39,136]),import.meta.url)),"imagery-tile":()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-C3hXr143.js"),__vite__mapDeps([223,1,2,224,220,140,133,132,144,151,221,156,131,150,28,141,127,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,225,189,118,119,226,222,59,60,129,135,208,206,198,8,117,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,134,39,136]),import.meta.url)),kml:()=>k().then(()=>b(()=>import("./KMLLayerView2D-hWgNYT5J-CetUHy5g.js"),__vite__mapDeps([227,1,2,59,60,228,30,31,23,32,33,34,35,36,37,38,29,39,40,41,42,43,44,22,45,27,28,46,47,61,12,13,49,123,195,126,127,158,25,20,21,132,133,211,156,131,150,141,140,151,144,143,110,111,112,113,76,109,114,115,11,14,130,157,159,160,161,125,162,56,57,196,116,120,186,187,188,146,147,148,149,152,153,189,154,155,135,51,52,53,184,171,63,172,173,174,90,185,222,175,139,142,176,177,178,170,164,179,225,8,117,118,119,4,5,121,16,17,18,19,122,75,69,70,124,128,129,134,136]),import.meta.url)),"knowledge-graph":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-BMJK-YHI.js"),__vite__mapDeps([229,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),"link-chart":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-BMJK-YHI.js"),__vite__mapDeps([229,1,2,196,158,25,20,21,22,116,120,8,117,76,59,60,118,119,4,5,114,121,16,17,18,19,36,122,75,14,123,69,109,11,12,13,70,124,125,112,110,111,113,115,51,52,49,53,126,127,128,129,130,131,132,133,134,135,39,136]),import.meta.url)),"knowledge-graph-sublayer":zt,"map-image":()=>k().then(()=>b(()=>import("./MapImageLayerView2D-LI7T-1xm-N5aTEI2-.js"),__vite__mapDeps([230,1,2,123,211,156,131,150,28,133,132,141,140,151,127,144,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,184,40,41,146,147,148,27,149,152,153,44,45,42,43,46,171,63,172,173,59,60,51,52,49,53,174,90,32,154,155,37,135,185,197,187,188,189,212,118,119,195,231,191,203,205,208,198,199,200,201,62,202,204,206,8,117,4,5,121,16,17,18,19,36,122,75,69,70,124,128,129,134,39,136]),import.meta.url)),"map-notes":()=>k().then(()=>b(()=>import("./MapNotesLayerView2D-EusnP8A_-DsvgmiI6.js"),__vite__mapDeps([232,1,2,196,158,25,20,21,22,116,120,186,187,188,131,146,147,56,148,28,27,110,111,112,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,162,57,154,155,37,135,51,52,49,53,184,40,41,42,43,46,171,63,172,173,59,60,174,90,32,185,8,117,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,134,39,136]),import.meta.url)),media:()=>k().then(()=>b(()=>import("./MediaLayerView2D-COWFkA3m-DvWbYXdD.js"),__vite__mapDeps([233,1,2,31,23,32,33,34,35,36,37,38,30,29,39,40,41,42,43,44,22,45,27,28,46,47,234,59,60,185,52,126,235,112,130,164,131,146,147,56,148,110,111,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,120,158,25,20,21,156,144,143,157,159,160,161,162,57,167,168,169,170,171,63,172,173,51,49,53,174,90,55,154,155,135,165,166,176,177,178,184,181,182,236,196,116,129,8,117,118,119,4,5,121,16,17,18,19,122,75,123,69,70,124,128,134,136]),import.meta.url)),"ogc-feature":()=>k().then(()=>b(()=>import("./OGCFeatureLayerView2D-CpSy5D2s-D3QUvTvd.js"),__vite__mapDeps([237,1,2,207,36,158,25,20,21,22,162,56,57,86,11,12,13,14,208,61,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url)),"open-street-map":ye,"oriented-imagery":zt,route:()=>k().then(()=>b(()=>import("./RouteLayerView2D-Bpui7Ggx-XzTkMJjI.js"),__vite__mapDeps([238,1,2,117,239,196,158,25,20,21,22,116,120,186,187,188,131,146,147,56,148,28,27,110,111,112,113,76,109,114,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,162,57,154,155,37,135,51,52,49,53,184,40,41,42,43,46,171,63,172,173,59,60,174,90,32,185,8,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,134,39,136]),import.meta.url)),stream:()=>k().then(()=>b(()=>import("./StreamLayerView2D-Bh_aEalU-6VUJB3H7.js"),__vite__mapDeps([240,1,2,61,12,13,207,36,158,25,20,21,22,162,56,57,86,11,14,208,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url)),"subtype-group":()=>k().then(()=>b(()=>import("./SubtypeGroupLayerView2D-Byn0xzbb-C7M02_8L.js"),__vite__mapDeps([241,1,2,207,36,158,25,20,21,22,162,56,57,86,11,12,13,14,208,61,196,116,120,188,131,146,147,148,28,27,110,111,112,113,76,109,114,115,127,149,150,133,132,141,140,151,152,153,125,44,45,189,156,144,143,126,130,157,159,160,161,154,155,37,135,169,70,34,94,89,90,47,163,164,209,85,81,203,206,198,8,117,59,60,118,119,4,5,121,16,17,18,19,122,75,123,69,124,51,52,49,53,128,129,134,39,136]),import.meta.url)),tile:ye,"vector-tile":()=>k().then(()=>b(()=>import("./VectorTileLayerView2D-B9OYHbL4-CpvgTk0s.js"),__vite__mapDeps([242,1,2,32,167,76,149,132,133,55,180,164,155,111,29,110,22,112,113,109,114,115,11,12,13,14,126,148,140,144,160,156,131,150,28,141,151,127,143,130,157,158,25,20,21,159,161,125,162,56,57,118,119,189,243,244,245,43,44,45,128,196,116,120,198,129,8,117,59,60,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,134,135,39,136]),import.meta.url)),video:()=>k().then(()=>b(()=>import("./VideoLayerView2D-CLcxq4ZA-BYf0Uwhu.js"),__vite__mapDeps([246,1,2,247,123,75,14,80,81,25,20,21,22,98,67,37,248,236,126,127,157,51,52,49,53,156,131,150,28,133,132,141,140,151,144,143,110,111,112,113,76,109,114,115,11,12,13,130,158,159,160,161,125,162,56,57,154,146,147,148,27,149,152,153,44,45,120,155,135,59,60,196,116,186,187,188,189,184,40,41,42,43,46,171,63,172,173,174,90,32,185,8,117,118,119,4,5,121,16,17,18,19,36,122,69,70,124,128,129,134,39,136]),import.meta.url)),wcs:()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-C3hXr143.js"),__vite__mapDeps([223,1,2,224,220,140,133,132,144,151,221,156,131,150,28,141,127,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,225,189,118,119,226,222,59,60,129,135,208,206,198,8,117,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,134,39,136]),import.meta.url)),"web-tile":ye,wfs:zt,wms:()=>k().then(()=>b(()=>import("./WMSLayerView2D-Dz-z-fa9-DL6MC_DE.js"),__vite__mapDeps([249,1,2,211,156,131,150,28,133,132,141,140,151,127,144,143,110,22,111,112,113,76,109,114,115,11,12,13,14,126,130,157,158,25,20,21,159,160,161,125,162,56,57,196,116,120,212,118,119,195,198,250,208,8,117,59,60,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,129,134,135,39,136]),import.meta.url)),wmts:()=>k().then(()=>b(()=>import("./WMTSLayerView2D-Bl5FUDUu-BIlJfFno.js"),__vite__mapDeps([251,1,2,194,195,126,22,127,158,25,20,21,132,133,156,131,150,28,141,140,151,144,143,110,111,112,113,76,109,114,115,11,12,13,14,130,157,159,160,161,125,162,56,57,189,196,116,120,198,129,8,117,59,60,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,51,52,49,53,128,134,135,39,136]),import.meta.url)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,focusArea:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,viewshed:null,voxel:null,scene:null,unknown:null,unsupported:null};function Pc(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new C(`${i}:view-not-supported`,`${e} is not supported in 2D`)}const ws={hasLayerViewModule:t=>vs[t.type]!=null,importLayerView:t=>{const e=vs[t.type];if(e==null)throw Pc(t);return e(t)}};function Sc(t,e){const{spatialReference:i}=e,n=[e.x,e.y];let s=Number.POSITIVE_INFINITY,o=0,a=0;const h=[0,0],c=t.type==="extent"?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:t.rings;for(const p of c)for(let d=0;dd.clone()),e.sort((d,m)=>m.scale-d.scale),e.forEach((d,m)=>d.level=m);for(const d of e)!c&&i>0&&i>=d.scale&&(a=d.level,c=!0),!p&&n>0&&n>=d.scale&&(h=t?t.level:-1,p=!0),t=d;s===-1&&(s=i===0?0:a),o===-1&&(o=n===0?e.length-1:h),s=Math.max(s,0),s=Math.min(s,e.length-1),o=Math.max(o,0),o=Math.min(o,e.length-1),s>o&&([s,o]=[o,s]),i=e[s].scale,n=e[o].scale,e.splice(0,s),e.splice(o-s+1,e.length),e.forEach((d,m)=>{this._lodByScale[d.scale]=d,this._scales[m]=d.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",s),this._set("effectiveMaxZoom",o),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",n)}constrain(t,e){if(e&&t.scale===e.scale)return t;const i=this.effectiveMinScale,n=this.effectiveMaxScale,s=t.targetGeometry,o=e&&e.targetGeometry,a=n!==0&&t.scalei;if(a||h){const c=h?i:n;if(e&&o){const p=(c-e.scale)/(t.scale-e.scale);s.x=o.x+(s.x-o.x)*p,s.y=o.y+(s.y-o.y)*p}t.scale=c}return this.snapToZoom&&this.effectiveLODs&&(t.scale=this._getClosestScale(t.scale)),t}fit(t){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(t,null);const e=this.scaleToZoom(t.scale),i=Math.abs(e-Math.floor(e));return t.scale=this.zoomToScale(i>.99?Math.round(e):Math.floor(e)),t}zoomToScale(t){if(!this.effectiveLODs)return 0;t-=this.effectiveMinZoom,t=Math.max(0,t);const e=this._scales;if(t<=0)return e[0];if(t>=e.length)return e[e.length-1];const i=Math.floor(t),n=Math.ceil(t);return e[i]+(t-i)*(e[n]-e[i])}scaleToZoom(t){if(!this.effectiveLODs)return-1;const e=this._scales;let i,n;if(t>=e[0])return this.effectiveMinZoom;if(t<=e[e.length-1])return this.effectiveMaxZoom;for(let s=0;st&&nMath.abs(i-t)<=Math.abs(e-t)?i:e,this._scales[0])),this._lodByScale[t].scale}};r([l({readOnly:!0})],q.prototype,"effectiveLODs",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinScale",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxScale",void 0),r([l()],q.prototype,"lods",void 0),r([l()],q.prototype,"minZoom",void 0),r([l()],q.prototype,"maxZoom",void 0),r([l()],q.prototype,"minScale",void 0),r([l()],q.prototype,"maxScale",void 0),r([l()],q.prototype,"snapToZoom",void 0),q=an=r([_("esri.views.2d.constraints.ZoomConstraint")],q);const Zo=q,kc={base:null,key:"type",typeMap:{extent:Xt,polygon:Xs}};let R=class extends M{constructor(t){super(t),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new L}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(t){t?this._set("geometry",t):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const t=this._get("_geometry");return t&&this.geometry===t.geometry&&this.view?.constraintsInfo.spatialReference===t.spatialReference?t:new qt({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new Ho({rotationEnabled:this.rotationEnabled})}get _zoom(){const t=this._get("_zoom"),e=this.lods||this.view?.constraintsInfo.lods,i=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return t&&t.lods===e&&t.minZoom===i&&t.maxZoom===n&&t.minScale===s&&t.maxScale===o&&t.snapToZoom===a?t:new Zo({lods:e,minZoom:i,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(t){const e=this.effectiveMaxScale;return e===0||t>=e}canZoomOutTo(t){const e=this.effectiveMinScale;return e===0||t<=e}constrain(t,e){return this._zoom.constrain(t,e),this._rotation.constrain(t,e),this._geometry.constrain(t,e),this.customConstraints.forEach(i=>i.constrain(t,e)),t}constrainByGeometry(t){return this._geometry.constrain(t),this.customConstraints.forEach(e=>e.applyPanConstraint?.(t)),t}fit(t){return this._zoom.fit(t)}zoomToScale(t){return this._zoom.zoomToScale(t)}scaleToZoom(t){return this._zoom.scaleToZoom(t)}snapScale(t){return this._zoom.snapToClosestScale(t)}snapToNextScale(t){return this._zoom.snapToNextScale(t)}snapToPreviousScale(t){return this._zoom.snapToPreviousScale(t)}};r([l({readOnly:!0})],R.prototype,"effectiveLODs",null),r([l({readOnly:!0})],R.prototype,"effectiveMinScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMinZoom",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxZoom",null),r([l({types:kc,value:null})],R.prototype,"geometry",null),r([l({type:[_r]})],R.prototype,"lods",void 0),r([l()],R.prototype,"minScale",void 0),r([l()],R.prototype,"maxScale",void 0),r([l()],R.prototype,"minZoom",void 0),r([l()],R.prototype,"maxZoom",void 0),r([l()],R.prototype,"rotationEnabled",void 0),r([l()],R.prototype,"snapToZoom",void 0),r([l({type:L})],R.prototype,"customConstraints",void 0),r([l()],R.prototype,"view",void 0),r([l({readOnly:!0})],R.prototype,"version",null),r([l({type:qt,readOnly:!0})],R.prototype,"_geometry",null),r([l({type:Ho})],R.prototype,"_rotation",null),r([l({readOnly:!0,type:Zo})],R.prototype,"_zoom",null),R=r([_("esri.views.2d.MapViewConstraints")],R);const Go=R;let Z=class extends M{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([w(()=>this.constraints?.version,e=>{this.constraints&&e&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Ee)])}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:e}=this.state.paddedViewState;return this.state.commitProperty("id"),new V({x:t[0],y:t[1],spatialReference:e})}set center(t){if(t==null)return;if(!this.ready)return void this._set("center",t);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-center","could not project the value in the view's spatial reference",{input:t,error:n}))}const i=this.viewpoint;Ji(i,i,e),this.viewpoint=i}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(t){if(t==null)return;if(!t.width||!t.height)return void D.getLogger(this).error(new C("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",t),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const i=this.viewpoint;Sh(i,i,e,this.state.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const e=this.viewpoint;Ah(e,e,t),this.viewpoint=e}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",void 0);const i=this._get("extent");return void(i&&(this._set("extent",void 0),this._set("center",i.center)))}const e=this.viewpoint;ms(e,e,t),this.viewpoint=e}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(t){if(t==null)return;if(!this.ready)return this._set("viewpoint",t),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let e,i;try{e=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?i=new C("mapview:invalid-viewpoint",`invalid scale value of ${t.scale}`):t.targetGeometry==null&&(i=new C("mapview:invalid-viewpoint","geometry not defined"))}catch(s){i=new C("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(i)return void D.getLogger(this).error(i);this._scaleBeforeChangingSpatialReference=null;const n=new nt({targetGeometry:new V,scale:0,rotation:0});G(n,e),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set("viewpoint",n)}get visibleArea(){return this.ready?this.state.visibleArea:null}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get("zoom")}set zoom(t){if(!(t>=0))return;if(!this.ready){this._set("zoom",t),this._set("scale",void 0);const n=this._get("extent");return void(n&&(this._set("extent",void 0),this._set("center",n.center)))}const e=this.constraints?.zoomToScale(t)??0;if(!e)return void this._set("zoom",-1);const i=this.viewpoint;ms(i,i,e),this.viewpoint=i,this._set("zoom",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:e,constraints:i}=this,n=this._get("center"),s=this._get("extent"),o=this._get("scale"),a=this._get("rotation"),h=this._get("viewpoint"),c=this._get("zoom"),p=c!=null&&i!=null&&i.zoomToScale(c)||void 0;let d,m,u;const g=h?.rotation,f=h?.targetGeometry;f?.type==="extent"?d=f:f?.type==="point"&&(m=f,u=h?.scale);const T=s??d;return{center:n??m??T?.center,rotation:a??g,scale:(o??p??u??(T&&fi(T,[t[0]-e.left-e.right,t[1]-e.top-e.bottom])))||void 0}}startup(t,e,i,n){const s=t.targetGeometry;try{this._project(t,i)}catch(o){D.getLogger(this).warn(new zn("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:s.toJSON(),spatialReference:i,error:o})),t.targetGeometry=n||new V({x:0,y:0,spatialReference:i})}this.constraints?.fit(t),this._set("state",new En({padding:this.padding,size:e,viewpoint:t})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[t,e],spatialReference:i,rotation:n,scale:s}=this.state.paddedViewState,o=new V({x:t,y:e,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",o),this._set("zoom",-1),this._set("rotation",n),this._set("scale",s),this._set("state",null)}changeSpatialReference(t){const e=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=e.scale;else{const h=e.viewpoint.clone();h.scale=this._scaleBeforeChangingSpatialReference,e.viewpoint=h}const i=e.clone(),[n,s]=e.center;let o=null;try{o=this._project(new V({x:n,y:s,spatialReference:e.spatialReference}),t)}catch(h){Xa()||D.getLogger(this).warn(new zn("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o?.toJSON(),spatialReference:t,error:h}))}o||(o=new V({x:0,y:0,spatialReference:t}));const a=Ji(new nt({targetGeometry:new V,scale:0,rotation:0}),e.viewpoint,o);i.viewpoint=a;try{const h=[e.size[0]/2,e.size[1]/2],c=[h[0]+20,h[1]],p=e.toMap([0,0],c),{x:d,y:m}=this._project(new V({x:p[0],y:p[1],spatialReference:e.spatialReference}),t);p[0]=d,p[1]=m,i.toScreen(p,p);const u=Lh(h,p,c),g=Math.hypot(p[0]-h[0],p[1]-h[1])/20;!Number.isFinite(g)||Math.abs(g)>4?(a.rotation=0,a.targetGeometry=new V({x:0,y:0,spatialReference:t})):(a.scale*=g,a.scale>z("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(u)?u:0)}catch{}this._get("constraints")?.constrain(a,void 0),this._get("state").viewpoint=a}resize(t,e){if(!this.ready)return;const i=this.state;let n=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.slice();i.size=[t,e],Oh(n,n,s,this.state.paddedViewState.size,this.resizeAlign),n=this.constraints?.constrain(n,void 0)??n,this.state.viewpoint=n}toMap(t){if(!this.ready)return null;const e=[0,0],[i,n]=this.state.toMap(e,[t.x,t.y]),s=this.state.spatialReference;return new V({x:i,y:n,spatialReference:s})}toScreen(t,e){if(!this.ready)return null;const i=this._project(t,this.state.spatialReference),n=[i.x,i.y];return e?.pickClosestTarget===!1||this.state.paddedViewState.wrapMapCoordinate(n,n),this.state.toScreen(n,n),H(n[0],n[1])}_project(t,e){const i=t?.targetGeometry||t;if(!e)return t;if(!i)return null;if(e.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem||pi(e,i.spatialReference))return t;const n=Le(i,e);if(!n)throw new C("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:i,spatialReference:e});return Ec(t)?(t.targetGeometry=n,t):n}};function Ec(t){return t?.declaredClass==="esri.Viewpoint"}r([l({type:V})],Z.prototype,"center",null),r([l()],Z.prototype,"constraints",void 0),r([l({type:Xt})],Z.prototype,"extent",null),r([l({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],Z.prototype,"padding",null),r([l()],Z.prototype,"ready",void 0),r([l()],Z.prototype,"resizeAlign",void 0),r([l({readOnly:!0})],Z.prototype,"resolution",null),r([l({type:Number})],Z.prototype,"rotation",null),r([l({type:Number})],Z.prototype,"scale",null),r([l({readOnly:!0})],Z.prototype,"state",void 0),r([l({type:nt})],Z.prototype,"viewpoint",null),r([l({readOnly:!0})],Z.prototype,"visibleArea",null),r([l()],Z.prototype,"zoom",null),Z=r([_("esri.views.2d.ViewStateManager")],Z);function Cn(t,e){switch(e){case"primary":return t.pointerType==="touch"||t.button===0;case"secondary":return t.pointerType!=="touch"&&t.button===2;case"tertiary":return t.pointerType!=="touch"&&t.button===1}}let bs=class extends A{constructor(t,e){super(!0),this._view=t,this.registerIncoming("double-click",e,i=>this._handleDoubleClick(i,e))}_handleDoubleClick(t,e){Cn(t.data,"primary")&&(t.stopPropagation(),e?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}},Cc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerType=e,this.registerIncoming("double-tap-drag",i,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(t){const{data:e}=t,{pointerType:i}=e;if(i!==this.pointerType)return;t.stopPropagation();const{action:n,delta:s}=e,{view:o}=this,{mapViewNavigation:a}=o;switch(n){case"begin":{const{scale:h}=o;this._startScale=h,this._currentScale=h,this._previousDelta=s,a.begin();break}case"update":{if(this._previousDelta.y===s.y)return;this._previousDelta=s;const h=1.015**s.y,c=this._startScale*h,p=c/this._currentScale;a.setViewpointImmediate(p),this._currentScale=c;break}case"end":{const{constraints:h}=o,{effectiveLODs:c,snapToZoom:p}=h;if(!p||!c)return void a.end();const d=h.snapScale(this._currentScale),m=(s.y>0?Math.max(d,h.snapToPreviousScale(this._startScale)):Math.min(d,h.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(m).then(()=>{a.end()});break}}}},wi=class{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const e=t.data,i=e.pointers.size;switch(e.action){case"start":this._currentCount=i,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){this._startEvent=t,this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}},Ic=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerAction=e,this.registerIncoming("drag",i,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new wi({start:(e,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(e,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(e,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(e,i)=>e===1&&Cn(i.data,this.pointerAction)})}_handleDrag(t){const e=this.view.mapViewNavigation;e.pinch.zoomMomentum||e.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},Dc=class extends A{constructor(t,e,i){super(!0),this._view=t,this.pointerAction=e;const n=this._view.mapViewNavigation;this._dragEventSeparator=new wi({start:(s,o)=>{n.rotate.begin(this._view,o.data),o.stopPropagation()},update:(s,o)=>{n.rotate.update(this._view,o.data),o.stopPropagation()},end:(s,o)=>{n.rotate.end(),o.stopPropagation()},condition:(s,o)=>s===1&&Cn(o.data,this.pointerAction)}),this.registerIncoming("drag",i,s=>this._dragEventSeparator.handle(s))}};function et(t){let e=t*t;return t<0&&(e*=-1),e}function Rc(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function Lc(t,e,i){const n=i,s=t.state,o=t.device,a=e.tiltDirection==="forward-down"?1:-1,h=1;return o.deviceType==="standard"?(n.translation[0]=et(s.axes[0]),n.translation[1]=et(s.axes[1]),n.translation[2]=et(s.buttons[7])-et(s.buttons[6]),n.heading=et(s.axes[2]),n.tilt=et(s.axes[3])):o.deviceType==="spacemouse"&&(n.translation[0]=1.2*et(s.axes[0]),n.translation[1]=1.2*et(s.axes[1]),n.translation[2]=2*-et(s.axes[2]),n.heading=1.2*et(s.axes[5]),n.tilt=1.2*et(s.axes[3])),n.tilt*=a,Yr(n.translation,n.translation,h),n}function Vc(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let Oc=class extends A{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new qs,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",e=>this._handleGamePadEvent(e)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([w(()=>this._view.navigation.gamepad?.enabled,e=>{e?(this._handle.resume(),this._frameTask||(this._frameTask=de({update:i=>this._frameUpdate(i.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},U)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const e=this._view.navigation.gamepad.device;e&&t.data.device!==e||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Rc(this._transformation)):(this._currentDevice=t.data.device,Lc(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const e=this._transformation;if(Vc(e))return;const i=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=zc*n*t;vi(i,i,[e.translation[0]*s,-e.translation[1]*s]);const o=1+e.translation[2]*Nc*t,a=this._view.constraints.rotationEnabled?-e.heading*Ac*t:0,h=this._view.size,c=[h[0]/2,h[1]];Vo(i,i,o,a,c,h);const p=this._view.constraints.constrain(i,this._view.viewpoint);this._view.viewpoint=p}};const Ac=.06,zc=.7,Nc=6e-4;function $o(t){const e=()=>t(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),di(()=>document.removeEventListener("visibilitychange",e))}let Fc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=n=>{const s=this._keyMap[n.data.key];if(n.modifiers.has("Meta")||n.modifiers.has("Control"))return void this._stopMovement();if(s==null)return;n.stopPropagation(),n.preventDefault();const o=n.type==="key-down";if(this._pressedKeys[o?"add":"delete"](s),o){if(this._direction===s)return;this._direction=s,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const a=this._timeout===void 0,h=this._pressedKeys.size>0;a||h?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",i,this._handleKey),this.registerIncoming("key-up",i,this._handleKey),this.registerIncoming("blur",i,this._stopMovement),this._visibilityHandle=$o(n=>n?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(t){const e=this._currentDirection!=null;if(t!=null){if(e||this.view.mapViewNavigation.begin(),this._currentDirection!==t)switch(t){case"left":this.view.mapViewNavigation.continuousPanLeft();break;case"right":this.view.mapViewNavigation.continuousPanRight();break;case"up":this.view.mapViewNavigation.continuousPanUp();break;case"down":this.view.mapViewNavigation.continuousPanDown()}}else e&&this.view.mapViewNavigation.stop();this._currentDirection=t}_setTimeout(t){clearTimeout(this._timeout),this._timeout=t===void 0?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}},Hc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._pressed=!1,this._keyToDirection={[e.clockwiseOption1]:"clockwise",[e.clockwiseOption2]:"clockwise",[e.counterClockwiseOption1]:"counterClockwise",[e.counterClockwiseOption2]:"counterClockwise",[e.resetOption1]:"reset",[e.resetOption2]:"reset"},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",i,n=>this._handleKeyUp(n)),this.registerIncoming("blur",i,()=>this._handleStop()),this._visibilityHandle=$o(n=>n?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,e){const i=t.modifiers;if(i.size>0&&!i.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[t.data.key];if(this._pressed=n!=null,this._pressed){if(t.preventDefault(),e)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continuousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continuousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}};var ce;(function(t){t[t.IN=0]="IN",t[t.OUT=1]="OUT"})(ce||(ce={}));let Zc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._keysToZoomAction={},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),e.zoomIn.forEach(n=>this._keysToZoomAction[n]=ce.IN),e.zoomOut.forEach(n=>this._keysToZoomAction[n]=ce.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const e=t.modifiers;if(e.size>0&&!e.has("Shift"))return;const{key:i}=t.data;if(!(i in this._keysToZoomAction))return;const n=this._keysToZoomAction[i],{mapViewNavigation:s}=this.view;let o=null;switch(n){case ce.IN:o=s.zoomIn();break;case ce.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),t.stopPropagation()}};const Gc=.6;let $c=class extends A{constructor(t,e){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",e,i=>this._handleMouseWheel(i))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const e=this._view.mapViewNavigation,{x:i,y:n,deltaY:s}=t.data,o=1/Gc**(1/60*s),a=e.zoom(o,[i,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,e.end()}))}},Wc=class extends A{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",i=>this._handleDrag(i)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const e=this.view.mapViewNavigation;this._dragEventSeparator=new wi({start:(i,n)=>{e.pinch.begin(this.view,n.data),n.stopPropagation()},update:(i,n)=>{e.pinch.update(this.view,n.data),n.stopPropagation()},end:(i,n)=>{e.pinch.end(this.view),n.stopPropagation()},condition:i=>i>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function Ts(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value||1:0),axes:e.axes.map(i=>qc(i,t.axisThreshold))}:{buttons:[],axes:[]}}function Uc(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,h=this._inputDevices[a];h&&(this._emitGamepadEvent(o,Ts(h),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(h),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const i="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=i&&n,this.supported&&(Ms(s=>this._connectGamepad(s)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(t){this._hasEventListeners!==t&&(this._hasEventListeners=t,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(t){this._callback=t}_connectGamepad(t){const e=new Mn(t);e.deviceType!=="unknown"&&(this._inputDevices[t.index]=e,this._input.gamepad.devices.add(e)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=de({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),e=this._element.contains(document.activeElement),i=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!e;Ms(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=Ts(s),h=i||jc(a);o&&(o.timestamp===n.timestamp||!o.active&&h||Uc(o.state,a))||this._emitGamepadEvent(n,a,!h)})}_emitGamepadEvent(t,e,i){const n=this._latestUpdate[t.index],s=n&&n.active;if(!s&&!i)return;const o=!s&&i?"start":s&&i?"update":"end";this._latestUpdate[t.index]={timestamp:t.timestamp,state:e,active:i},this._callback&&this._callback({device:this._inputDevices[t.index],state:e,action:o})}};function Kc(t){if(!t||!t.connected)return!1;for(let e=0;e{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new Bc(e,this._input),this._gamepadSource.onEvent=n=>this._callback("gamepad",n)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=tt(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const i in this._active)if(!e||!e.has(i)){const n=this._active[i];this._element.removeEventListener(zi[i],n),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&zi[i]){const n=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(zi[i],n),this._active[i]=n}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,i){i?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?ee.touchNone:ee.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?ee.touchPan:ee.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(ee.touchNone),this._element.classList.remove(ee.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const n=_o(this._element,e);return Uo.test.disableSubpixelCoordinates&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),i.x=n.x,i.y=n.y,i}_handleKey(e,i){const{key:n}=i;n&&e==="key-up"&&this._keyDownState.delete(n);const s={native:i,key:n,repeat:!!n&&this._keyDownState.has(n)};n&&e==="key-down"&&this._keyDownState.add(s.key),this._callback(e,s)}_handlePointer(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(e,n)}_getDeltaFromTrackpadOrMouseWheel(e){return e.shiftKey&&z("mac")&&e.deltaY===0?e.deltaX:e.deltaY}_handleMouseWheel(e,i){let n=this._getDeltaFromTrackpadOrMouseWheel(i);switch(i.deltaMode){case 0:xs&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}xs?n*=.7:Yc||Qc?n*=.6:Xc&&(n*=1.375);const s=100,o=Math.abs(n);o>s&&(n=n/o*200/(1+Math.exp(-.02*(o-s))));const a=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:n});this._callback(e,a)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const n={native:i};i.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};Wo.test={disableSubpixelCoordinates:!1};const zi={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let Jc=class extends A{constructor(){super(!0),this.registerIncoming("context-menu",t=>t.data.native.preventDefault())}};const F={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function ri(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function tp(t,e){const i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}function ep(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:H()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[S,x]=t,[$,K]=[x.x-S.x,x.y-S.y];return e.radius=Math.sqrt($*$+K*K)/2,e.center.x=(S.x+x.x)/2,e.center.y=(S.y+x.y)/2,e}let i=0,n=0;for(let S=0;SS.x-i),o=t.map(S=>S.y-n);let a=0,h=0,c=0,p=0,d=0,m=0,u=0;for(let S=0;Sthis._dragStart(o,a),update:(o,a)=>this._dragUpdate(a),end:(o,a)=>this._dragEnd(a)}),this.registerIncoming("drag",o=>this._dragEventSeparator.handle(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(t=>{t.doubleTapTimeout=st(t.doubleTapTimeout)})}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleTapTimeout!=null)return!0;return!1}_clearPointerDown(t){const e=this._pointerState.get(t);e&&(e.doubleTapTimeout=st(e.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_dragStart(t,e){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:i,modifiers:n}=e,{center:s}=i;this._dragStartCenter=s;const o=Ni("begin",H(0,0),i);this._doubleTapDrag.emit(o,void 0,n),e.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("update",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("end",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:e}=t,i=Kt(e),n=this._pointerState.get(i),{pointerType:s}=e.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(i),ri(n.event.data,e)>o?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:e}=t,{pointerType:i}=e.native,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(n),s);this._pointerState.set(n,{event:t,doubleTapTimeout:o}),this.refreshHasPendingInputs()}};function Ni(t,e,i){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}=i;return{action:t,delta:e,button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}}let np=class extends A{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,e,i,n){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:e.buttons,timestamp:n,pointers:sp(this._activePointerMap),pointer:e,angle:i.angle,radius:i.radius,center:i.center}}_addPointer(t){const e=t.native.pointerId,i=$e(this._activePointerMap).angle,n={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(e,n);const s=Qe(n,jo(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(i)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const e=t.native.pointerId,i=this._activePointerMap.get(e);i?i.event=t:this._addPointer(t)}_removePointer(t){const e=$e(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(e)}_updatePointerAngles(t){const e=$e(this._activePointerMap);this._activePointerMap.forEach(i=>{i.initialAngle=Qe(i,e)-t,i.lastAngle=Qe(i,e)-t})}_emitEvent(t,e,i){const n=$e(this._activePointerMap);this._drag.emit(this._createPayload(t,e,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const e=t.data.native.pointerId,i=it(t.timestamp);this._activePointerMap.get(e)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,i),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(e)):(this._removePointer(e),this._emitEvent("removed",t.data,it(t.timestamp))))}_handlePointerDrag(t){const e=t.data,i=e.currentEvent,n=it(t.timestamp);switch(e.action){case"start":case"update":this._isDragging?this._activePointerMap.has(i.native.pointerId)?(this._updatePointer(i),!this._isCurrentDragSuppressed&&this._emitEvent("update",i,n)):(this._addPointer(i),this._emitEvent("added",i,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(i),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",i,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function jo(t){const e=[];return t.forEach(i=>{e.push(H(i.event.x,i.event.y))}),ep(e)}function $e(t){const e=jo(t);let i=0;return t.forEach(n=>{let s=Qe(n,e),o=s-n.lastAngle;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;s=n.lastAngle+o,n.lastAngle=s;const a=s-n.initialAngle;i+=a}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function sp(t){const e=new Map;return t.forEach((i,n)=>e.set(n,i.event)),e}function Qe(t,e){const i=t.event,n=i.x-e.center.x,s=i.y-e.center.y;return Math.atan2(s,n)}var Ss;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(Ss||(Ss={}));let op=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=Kt(e);if(!this._pointerState.has(i)){const n={downButton:e.native.button,x:e.x,y:e.y,immediateDoubleClick:null};this._pointerState.set(i,n),this.startCapturingPointer(e.native)}}_handlePointerUp(t){const e=t.data,i=Kt(e),n=this._pointerState.get(i);if(n&&n.downButton===e.native.button){const s=n.immediateDoubleClick,o=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),ri(s,t.data)>o?this._startImmediateDoubleClick(t,n):(this._immediateDoubleClick.emit(t.data,void 0,s.modifiers),this._removeState(e))):ri(n,t.data)>o?this._removeState(e):this._startImmediateDoubleClick(t,n)}}_startImmediateDoubleClick(t,e){const i=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;e.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),i)}}_removeState(t){const e=Kt(t);this._pointerState.delete(e),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}},ap=class extends A{constructor(t=F.maximumClickDelay,e=F.movementUntilMouseDrag,i=F.movementUntilPenDrag,n=F.movementUntilTouchDrag,s=F.holdDelay,o=Re){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=e,this._movementUntilPenDrag=i,this._movementUntilTouchDrag=n,this._holdDelay=s,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",a=>this._handlePointerDown(a)),this.registerIncoming("pointer-up",a=>this._handlePointerLoss(a,"pointer-up")),this.registerIncoming("pointer-capture-lost",a=>this._handlePointerLoss(a,"pointer-capture-lost")),this.registerIncoming("pointer-cancel",a=>this._handlePointerLoss(a,"pointer-cancel")),this._moveHandle=this.registerIncoming("pointer-move",a=>this._handlePointerMove(a)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=st(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=e.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(i);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,t.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const s={startEvent:e,previousEvent:e,startTimestamp:t.timestamp,isDragging:!1,downButton:e.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,s),this.startCapturingPointer(e.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_handlePointerMove(t){const e=t.data,i=e.native.pointerId,n=this._pointerState.get(i);n&&(n.isDragging?this._pointerDrag.emit(We("update",n,e),void 0,n.modifiers):tp(e,n.startEvent)>this._getDragThreshold(e.native.pointerType)&&this._startDragging(t),n.previousEvent=e)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const e=t.data,i=e.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=t.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(We("start",n,e)):this._pointerDrag.emit(We("start",n,n.previousEvent),t.timestamp))})}_handlePointerLoss(t,e){const i=t.data,n=i.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(We("end",s,e==="pointer-up"?i:s.previousEvent),void 0,s.modifiers):e==="pointer-up"&&s.downButton===i.native.button&&t.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(i),this._pointerState.delete(n),this.stopCapturingPointer(i.native),this._pointerState.size===0&&this._moveHandle.pause())}};function We(t,e,i){return{action:t,startEvent:e.startEvent,previousEvent:e.previousEvent,currentEvent:i}}let rp=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",o=>this._handleImmediateClick(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o))}onUninstall(){this._pointerState.forEach(t=>t.doubleClickTimer=st(t.doubleClickTimer))}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleClickTimer!=null)return!0;return!1}_clearDoubleClickTimer(t,e){const i=this._pointerState.get(t);i&&(i.doubleClickTimer=st(i.doubleClickTimer),e&&this._click.emit(i.event.data,void 0,i.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const e=this._pointerState.get(t);e.pointerDownCount===1&&this._click.emit(e.event.data,void 0,e.event.modifiers),e.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_handleImmediateClick(t){const e=t.data,{pointerType:i}=e.native,n=lp(e);if(!this._pointerState.has(n))return void this._startClick(t);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,h=i==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;ri(o,e)>h?(this._clearDoubleClickTimer(n,!0),this._startClick(t)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(t){const e=Kt(t.data),i=this._pointerState.get(e);i&&(i.pointerDownCount+=1)}_startClick(t){const{data:e}=t,{native:{pointerType:i}}=e,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s);this._pointerState.set(n,{event:t,doubleClickTimer:o,pointerDownCount:1}),this.refreshHasPendingInputs()}};function lp(t){const{pointerId:e,pointerType:i,button:n}=t.native;return i==="mouse"?`${e}:${n}`:`${i}`}const Ue={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let Gt=class extends M{initialize(){const t=()=>this.view?.ready;this.addHandles([Ce(()=>!t(),()=>this._disconnect()),Ce(t,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=tt(this._inputManager)}_connect(){const t=this.view.surface,e=new Wo(t,this.view.input),i=[new op,new ap,new rp,new np(this.view.navigation),new ip],n=new Q({eventSource:e,recognizers:i});n.installHandlers("prevent-context-menu",[new Jc],At.INTERNAL),n.installHandlers("navigation",[new Wc(this.view),new Oc(this.view),new $c(this.view),new bs(this.view),new bs(this.view,[Ue.counter]),new Ic(this.view,"primary"),new Fc(this.view,Ue.pan),new Zc(this.view,Ue.zoom),new Hc(this.view,Ue.rotate),new Dc(this.view,"secondary"),new Cc(this.view,"touch")],At.INTERNAL),this.view.viewEvents.connect(n),this._source=e,this._inputManager=n,w(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},U)}get test(){}};r([l()],Gt.prototype,"view",void 0),r([l()],Gt.prototype,"latestPointerType",null),r([l()],Gt.prototype,"latestPointerLocation",null),r([l()],Gt.prototype,"multiTouchActive",null),Gt=r([_("esri.views.2d.input.MapViewInputManager")],Gt);const hp=Gt,Nt={added:[],removed:[]},Fi=new Set,cp=new Kr(0,0,0,0);function pp(t,e){const i=Bs(e);if(!i)return null;const[n,s]=i.valid;return t[2]>s?[Ne([t[0],t[1],s,t[3]]),Ne([n,t[1],n+t[2]-s,t[3]])]:t[0]({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=t}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(t){return this._tiles.has(t)}get(t){return this._tiles.get(t)}getIntersectingTiles(t){if(!t||Qa(t)===0||Ja(t)===0)return[];const e=pp(t,this.tileScheme.spatialReference);return e!=null?[...new Set([...this.boundsIntersections(e[0]),...this.boundsIntersections(e[1])])]:this.boundsIntersections(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const e={added:[],removed:[]};for(const i of t.added)if(!this.has(i)){const n=new Kn(this.tileScheme,i);this._tiles.set(i,n),this._index.insert(n),e.added.push(n)}for(const i of t.removed)if(this.has(i)){const n=this.get(i);this._tiles.delete(i),this._index.remove(n),e.removed.push(n)}this.tiles.length=0,this._tiles.forEach(i=>this.tiles.push(i)),(e.added.length||e.removed.length)&&this.emit("update",e)}setViewState(t){const e=this.tileScheme.getTileCoverage(t,0);if(!e)return;const{spans:i,lodInfo:n}=e,{level:s}=n;if(i.length>0)for(const{row:o,colFrom:a,colTo:h}of i)for(let c=a;c<=h;c++){const p=cp.set(s,o,n.normalizeCol(c),n.getWorldForColumn(c)).id;if(Fi.add(p),!this.has(p)){const d=new Kn(this.tileScheme,p);this._tiles.set(p,d),this._index.insert(d),this.tiles.push(d),Nt.added.push(d)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];Fi.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Nt.removed.push(a))}(Nt.added.length||Nt.removed.length)&&this.emit("update",Nt),Fr.pool.release(e),Fi.clear(),Nt.added.length=0,Nt.removed.length=0}};const up=1,Pu=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],Su=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],_e=256,mp=new Pt("cyan"),gp=1,yp=.25;new Pt("black");const _p="default",fp="temporary",vp=new Pt("yellow");let $t=class extends M{constructor(t){super(t),this.color=mp.clone(),this.haloOpacity=gp,this.fillOpacity=yp}equals(t){return this.color.equals(t.color)&&(this.haloColor||this.color).equals(t.haloColor||t.color)&&this.haloOpacity===t.haloOpacity&&this.fillOpacity===t.fillOpacity}};r([l({type:Pt})],$t.prototype,"color",void 0),r([l({type:Pt})],$t.prototype,"haloColor",void 0),r([l()],$t.prototype,"haloOpacity",void 0),r([l()],$t.prototype,"fillOpacity",void 0),$t=r([_("esri.views.support.HighlightOptions")],$t);const wp=$t;var rn;let xe=rn=class extends wp{constructor(t){super(t),this.haloWidth=2.1,this.haloBlur=.8/this.haloWidth}equals(t){return super.equals(t)&&this.haloWidth===t.haloWidth&&this.haloBlur===t.haloBlur}get optionsKey(){return`${this.color};${this.haloColor};${this.haloOpacity};${this.fillOpacity};${this.haloWidth};${this.haloBlur}`}clone(){return new rn({color:this.color.clone(),haloColor:this.haloColor?.clone(),haloOpacity:this.haloOpacity,fillOpacity:this.fillOpacity,haloWidth:this.haloWidth,haloBlur:this.haloBlur})}};r([l()],xe.prototype,"haloWidth",void 0),r([l()],xe.prototype,"haloBlur",void 0),xe=rn=r([_("esri.views.2d.support.HighlightOptions")],xe);const Yt=xe,Hi=()=>D.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function bp(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=t.fillOpacity,e.outlineColor[3]*=t.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=(1-t.haloBlur)*t.haloWidth,e.outerHaloWidth=t.haloBlur*t.haloWidth/2,e.innerHaloWidth=t.haloBlur*t.haloWidth/2,e.outlinePosition=0}const Tp=[0,0,0,0];let qo=class{constructor(){this.type="single",this._highlightOptions=new Yt,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*_e),this._minMaxDistance=[0,0]}setHighlightOptions(t){this._highlightOptions=t}applyHighlightOptions(t,e){this._updateGradientTexture(t),t.bindTexture(this._shadeTex,Xr),e.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<h?Math.round(10*(Math.abs(n)-h))/10:0,p=Math.abs(a)>h?Math.round(10*(Math.abs(a)-h))/10:0;let d;c&&!p?Hi().error("The outer rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!c&&p?Hi().error("The inner rim of the highlight is "+p+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):c&&p&&Hi().error("The highlight is "+Math.max(c,p)+"px away from the edge of the feature; consider reducing some width values.");const m=[void 0,void 0,void 0,void 0];function u(f,T,I){m[0]=(1-I)*f[0]+I*T[0],m[1]=(1-I)*f[1]+I*T[1],m[2]=(1-I)*f[2]+I*T[2],m[3]=(1-I)*f[3]+I*T[3]}const{_texelData:g}=this;for(let f=0;f<_e;++f)d=n+f/(_e-1)*(a-n),dt.stencilRef,compare:Jr.EQUAL,mask:255,op:{fail:Si.KEEP,zFail:Si.KEEP,zPass:Si.REPLACE}}}},xp={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Pp={...Bo,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function Sp({pixelRatio:t,state:e,displayLevel:i,requiredLevel:n},s){const o=1/2**(i-s.key.level),a=1/2**(n-s.key.level);return{displayMat3:e.displayMat3,displayViewMat3:e.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:e.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:o,requiredZoomFactor:a,tileOffset:[s.x,s.y],currentScale:e.scale,currentZoom:i,metersPerSRUnit:Ys(e.spatialReference),rotation:e.rotation,pixelRatio:t}}function Ko(t){return t.passOptions?.type==="highlight"}function Yo(t){return t.passOptions?.type==="hittest"}function kp(t){if(!Yo(t))return null;const{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}}function Ep(t){if(!Ko(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function ku(t,e,i){const n={};for(const s in i)i[s]instanceof Function?n[s]=i[s](t,e):n[s]=i[s];return n}function Eu(t,e){const{attributeView:i,context:n}=t;return{storage:i.getUniforms(n),view:Sp(t,e),hittestRequest:kp(t),highlight:Ep(t)}}function Cu(t){return{inside:t.selection===li.InsideEffect,outside:t.selection===li.OutsideEffect}}function Cp(t){return Yo(t)?xp:Ko(t)&&t.passOptions.stepType==="clear"?Pp:Bo}function Iu(t){const{row:e,col:i}=t.key,n=i*Qn,s=e*Qn;return{tileOffsetFromLocalOrigin:[n%He,s%He],maxIntsToLocalOrigin:[Math.floor(n/He),Math.floor(s/He)]}}const Ip=new Fa({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function Du(t){return Ip.toJSON(t)}function Ru(t){const{bandCount:e,attributeTable:i,colormap:n,pixelType:s}=t.raster.rasterInfo;return e===1&&(i!=null||n!=null||s==="u8"||s==="s8")}function Dp(t,e){return e==null?(t?.destroy(),null):(t?.type==="single"&&Array.isArray(e)&&(t.destroy(),t=null),t?.type!=="multi"||Array.isArray(e)||(t.destroy(),t=null),t||(t=Array.isArray(e)?new Mp:new qo),Array.isArray(e)?t.type==="multi"&&t.setHighlightOptions(e):t.type==="single"&&t.setHighlightOptions(e),t)}function Lu(t,e,i,n){const{painter:s,highlightGradient:o}=t,{highlight:a}=s.effects;if(!o)return;const h=t.passOptions,c=o.getReasonsWithGradients();for(let p=0;pparseFloat(t)/100;function Rp(t,e,i){const n=typeof t.left=="string"?je(t.left)*e:t.left,s=typeof t.right=="string"?je(t.right)*e:t.right,o=typeof t.top=="string"?je(t.top)*i:t.top,a=typeof t.bottom=="string"?je(t.bottom)*i:t.bottom,h=o;return{xmin:n,xmax:Math.max(e-s,n),ymin:h,ymax:Math.max(i-a,o)}}function Xo(t,e,i,n){switch(e.type){case"rect":{const{width:s,height:o}=t,{xmin:a,xmax:h,ymin:c,ymax:p}=Rp(e,s,o),{x:d,y:m}=i;return d>a&&dc&&mt.name);function Lp(t){if(!t.highlights)return null;const e=t.highlights.findIndex(i=>i.name==="default");return e===-1?null:t.highlights.items[e].options}function Vp(t,e){if(!t.highlights){if(!e)return;t.highlights=new Qo([{name:"default",options:new Yt}])}const i=t.highlights.findIndex(n=>n.name==="default");e?t.highlights.items[i].options=e:t.highlights.removeAt(i)}async function Op(t,e,i){const n=vo(e)?fo(t,e):e;if(!t.ready||isNaN(n.x)||isNaN(n.y))return{screenPoint:n,results:[]};let s=new Set;const o=new Set;let a=!1,h=null,c=null;i?.include?As(i.include,Os(t,u=>{s.add(u),Zi(u,g=>o.add(g))},(u,g)=>{o.add(u),s.add(g)},u=>{h||(h=new Set),h.add(u)},u=>s.add(u),()=>a=!0)):(a=!0,s=new Set(t.allLayerViews),s.forEach(u=>{Zi(u,g=>o.add(g))})),i?.exclude&&As(i.exclude,Os(t,u=>{s.delete(u),Zi(u,g=>o.delete(g))},u=>o.delete(u),u=>{c||(c=new Set),c.add(u)}));const p=t.toMap(n),d=t.allLayerViews.filter(u=>!u.suspended&&s.has(u)&&u.clips.every(g=>Xo(t,g,n,p))).reverse();let m=[...a?t.graphicsView.hitTest(p).map(u=>({type:"graphic",graphic:u,layer:null,mapPoint:p})):[],...await Promise.all(d.map(u=>u.hitTest(p,n)).toArray())].filter(ni).flat().filter(ni);return m=m.filter(u=>u.type!=="graphic"||u.layer?.type!=="subtype-group"||o.has(u.graphic.layer)),h&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||h?.has(hn(u.graphic)))),c&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||!c?.has(hn(u.graphic)))),{screenPoint:n,results:m}}function Os(t,e,i,n,s,o){return a=>{if(a instanceof pr){if(a.layer===t)o?.();else{const h=t.allLayerViews.find(c=>c.layer===a.layer);h&&s?.(h)}n(hn(a))}else if(!("layer"in a&&"element"in a))if(a.type==="subtype-sublayer"){const h=t.allLayerViews.find(c=>c.layer===a.parent);h&&i(a,h)}else{const h=t.allLayerViews.find(c=>c.layer===a);h&&e(h)}}}function As(t,e){if(t)if(Nn(t))for(const i of t)if(Nn(i))for(const n of i)e(n);else e(i);else e(t)}function hn(t){const e=t.getObjectId();return e?`${t.layer?.uid??t.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${t.uid}`}function Zi({layer:t},e){t?.type==="subtype-group"&&t.sublayers.forEach(i=>{e(i)})}function ta(t,e,i){const{ctx:n,canvas:s}=ia(t,i),o=n.getImageData(0,0,t.width,t.height),a=sa(s,e);return na(s),{dataUrl:a,data:o}}function ea(t,e){const{ctx:i,canvas:n}=ia(t,e),s=i.getImageData(0,0,t.width,t.height);return na(n),s}function ia(t,e){const i=Ap();e.premultipliedAlpha&&Hp(t),i.width=t.width,i.height=t.height;const n=i.getContext("2d",{willReadFrequently:!0});return n.putImageData(t,0,0),e.flipY&&Fp(n),{ctx:n,canvas:i}}function na(t){t.width=0,t.height=0}function Ap(){return Gi==null&&(Gi=document.createElement("canvas")),Gi}let Gi=null;function sa(t,e){const i=Zp[e.format],n=e.quality/100;return t.toDataURL(i,n)}function oa(t,e){const i=Np(t),n=$p[i];return{format:i,quality:ke(e??n,0,100)}}function aa(t,e){return e/Math.max(t[0],t[1])}function zp(t,e,i,n=0,s=0,o=t.width-n,a=t.height-s,h=!1){const{data:c}=t,{width:p,height:d,data:m}=e,u=o/p,g=a/d,f=Math.ceil(u/2),T=Math.ceil(g/2),I=t.width;for(let E=0;E=1)continue;let St=2*Qt*Qt*Qt-3*Qt*Qt+1;const Jt=4*(n+Ae+(s+Oe)*I);Dn+=St*c[Jt+3],$+=St,!i&&c[Jt+3]<255&&(St=St*c[Jt+3]/255),K+=St*c[Jt],dt+=St*c[Jt+1],In+=St*c[Jt+2],x+=St}}m[S]=K/x,m[S+1]=dt/x,m[S+2]=In/x,m[S+3]=Dn/$}return e}function Np(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return Gp}}function Fp(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function Hp(t){const e=t.data,i=e.length;for(let n=0;n0){const o=255/s;e[n]=e[n]*o,e[n+1]=e[n+1]*o,e[n+2]=e[n+2]*o}}}const Zp={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},zs=98,Gp="png",$p={png:100,jpg:zs,jpeg:zs},Vu=Object.freeze(Object.defineProperty({__proto__:null,createEmptyImageData:nl,encode:ta,encodeData:ea,getFormatAndQuality:oa,getMaximumResolutionScale:aa,resampleHermite:zp,toDataUrl:sa},Symbol.toStringTag,{value:"Module"})),ra={flipY:!0,premultipliedAlpha:!0};async function Wp(t,e){const i=await la(t,e),{format:n,quality:s}=oa(e?.format,e?.quality);return ta(i,{format:n,quality:s},ra)}async function Up(t,e){const i=await la(t,e);return ea(i,ra)}function la(t,e){const i=Bp(e||{},qp(t.stage,t.size),t.size,t.padding),n=jp(e,t.allLayerViews);return t.stage.takeScreenshot(i,n,t.backgroundColor,e?.rotation)}function jp(t={},e){if(!t.layers)return;const i=[];return t.layers.forEach(n=>{const s=e.find(o=>o.layer.id===n.id);s?.container&&i.push(s.container)}),i}function qp(t,e){return Math.min(4,aa(e,Math.min(4096,t.context.parameters.maxTextureSize)))}function Bp(t,e,i,n){t.ignorePadding&&(n={left:0,right:0,top:0,bottom:0});let s=null;t.width!=null&&t.height!=null?s=[t.width,t.height]:t.width==null&&t.height!=null?s=[t.height,t.height]:t.width!=null&&t.height==null?s=[t.width,t.width]:t.width==null&&t.height==null&&(s=null);const o=i[0]-(n.left+n.right),a=i[1]-(n.top+n.bottom);let h,c,p=t.area||{x:0,y:0,width:o,height:a};if(s){const d=o/a,m=s[0]/s[1];if(m>d){const u=p.width/m;p={x:p.x,y:Math.round(p.y+(p.height-u)/2),width:p.width,height:Math.round(u)}}else{const u=p.height*m;p={x:Math.round(p.x+(p.width-u)/2),y:p.y,width:Math.round(u),height:p.height}}}else s=[p.width,p.height];return s[0]>p.width?(h=Math.min(s[0]/p.width,e),c=s[0]/p.width/h):(h=1,c=s[0]/p.width),{cropArea:{x:Math.round((p.x+n.left)*h),y:Math.round((p.y+n.top)*h),width:Math.round(p.width*h),height:Math.round(p.height*h)},outputScale:c,resolutionScale:h}}const Ns=160;let Pe=class extends M{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=Ns&&this.clear()},Ns))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};r([l()],Pe.prototype,"_timer",void 0),r([l()],Pe.prototype,"stationary",null),Pe=r([_("esri.views.2d.support.StationaryManager")],Pe);const Kp=t=>t.includes("Brush");let ha=class{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),Kp(t)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${t}.Start`))}end(t){this._names.has(t)&&!this._names.get(t)&&(this._names.set(t,!0),performance.mark(`Esri.${t}.End`))}record(t){this._names.has(t)||(this._names.set(t,!0),performance.mark(`Esri.${t}`))}};function Yp(t){const e=sl();return e.available?t==="3d"&&e.majorPerformanceCaveat?new C("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):e.supportsHighPrecisionFragment?e.supportsVertexShaderSamplers?null:new C("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new C("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new C("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function Xp(t){return t&&"nodeType"in t}function Qp(t){return t&&typeof t.render=="function"}const Fs={component:"esri-component"};let Wt=class extends M{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(t){this._set("id",t)}set node(t){const e=this._get("node");t!==e&&(t&&t.classList.add(Fs.component),e&&e.classList.remove(Fs.component),this._set("node",t))}castNode(t){return this.widget?.destroy(),t?typeof t=="string"||Xp(t)?(this._set("widget",null),so(t)):(Qp(t)&&!t.domNode&&(t.domNode=document.createElement("div")),this._set("widget",t),t.domNode):(this._set("widget",null),null)}};r([l()],Wt.prototype,"id",null),r([l()],Wt.prototype,"node",null),r([Bt("node")],Wt.prototype,"castNode",null),r([l({readOnly:!0})],Wt.prototype,"widget",void 0),Wt=r([_("esri.views.ui.Component")],Wt);const Je=Wt,Jp={left:0,top:0,bottom:0,right:0},ca={bottom:30,top:15,right:15,left:15},mt="esri-ui",j={ui:mt,corner:`${mt}-corner`,innerContainer:`${mt}-inner-container`,manualContainer:`${mt}-manual-container`,cornerContainer:`${mt}-corner-container`,topLeft:`${mt}-top-left`,topRight:`${mt}-top-right`,bottomLeft:`${mt}-bottom-left`,bottomRight:`${mt}-bottom-right`};function td(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function qe(t){return t===0?"0":`${t}px`}function $i(t){const e=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(e===null||e===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function Wi(t,{top:e,bottom:i,left:n,right:s}){t.style.top=e,t.style.bottom=i,t.style.left=n,t.style.right=s}let ht=class extends hi.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol"),this._locale=Ha(),this.view=null,this._applyViewPadding=()=>{const e=this.container;e&&Wi(e,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const e=this._innerContainer;e&&Wi(e,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([w(()=>[this.view?.padding,this.container],this._applyViewPadding,U),w(()=>this.padding,this._applyUIPadding,U),w(()=>[this.container,this._locale],([t,e])=>{t&&t.setAttribute("lang",e)},U),Za(t=>{this._locale=t})])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const e=this._get("container");t!==e&&(t&&(t.classList.add(j.ui),vr(t),this._attachContainers(t)),e&&(e.classList.remove(j.ui),Wi(e,{top:"",bottom:"",left:"",right:""}),e.textContent=""),this._set("container",t))}get height(){const t=this.view?.height??0;if(t===0)return t;const e=this._getViewPadding(),{top:i,bottom:n}=e;return Math.max(t-i-n,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return typeof t=="number"?{bottom:t,top:t,right:t,left:t}:{...ca,...t}}get width(){const t=this.view?.width??0;if(t===0)return t;const e=this._getViewPadding(),{left:i,right:n}=e;return Math.max(t-i-n,0)}add(t,e){let i,n,s;if(Array.isArray(t))return void t.forEach(a=>this.add(a,e));const o=$i(t);o&&({index:i,position:e,component:t,key:n}=o),e&&typeof e=="object"&&({index:i,key:n,position:e,internal:s}=e),!t||e&&!this._isValidPosition(e)||this._add(t,e,i,n,s)}remove(t,e){if(!t)return;if(Array.isArray(t))return t.map(n=>this.remove(n,e));const i=this._find(t);if(i){if(this._componentMap.has(i)&&this._componentMap.get(i)?.key!==e)return;const n=this._components.indexOf(i);return i.node.parentNode?.removeChild(i.node),this._componentMap.delete(i),i.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.splice(n,1)[0]}}empty(t,e={removeInternal:!1}){if(Array.isArray(t)){for(const s of t)this.empty(s,e);return}const i=this._positionNameToContainerLookup[t??"manual"],n=Array.prototype.slice.call(i.children).map(s=>this._findByNode(s)).filter(s=>s==null?!1:!(this._componentMap.get(s)?.internal??!1)||e.removeInternal);for(const s of n)this.remove(s)}move(t,e){if(Array.isArray(t)&&t.forEach(o=>this.move(o,e)),!t)return;let i;const n=$i(t)||$i(e);if(n&&(i=n.index,e=n.position,t=n.component||t),e&&!this._isValidPosition(e))return;const s=this.remove(t);s&&this.add(s,{position:e,index:i})}find(t){if(!t)return null;const e=this._findById(t);return e&&(e.widget||e.node)}getComponents(t,e={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap(i=>this._getComponentsAtPosition(i,e)):this._getComponentsAtPosition(t,e):this._components.filter(i=>e.includeInternal||!this._componentMap.get(i)?.internal).map(({widget:i,node:n})=>i??n)}getPosition(t){for(const e in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[e].contains(t))return e;return null}_add(t,e,i,n,s){t instanceof Je||(t=new Je({node:t}));const{widget:o}=t;o!=null&&o instanceof M&&o.addHandles(di(()=>{queueMicrotask(()=>this.remove(t))}),this._removeWidgetHandleKey),this._place({component:t,position:e,index:i}),this._components.push(t),this._componentMap.set(t,{key:n,internal:s})}_find(t){return t?t instanceof Je?this._findByComponent(t):typeof t=="string"?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??Jp}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(j.innerContainer,j.cornerContainer);const e=document.createElement("div");e.classList.add(j.innerContainer,j.manualContainer);const i=document.createElement("div");i.classList.add(j.topLeft,j.corner),t.appendChild(i);const n=document.createElement("div");n.classList.add(j.topRight,j.corner),t.appendChild(n);const s=document.createElement("div");s.classList.add(j.bottomLeft,j.corner),t.appendChild(s);const o=document.createElement("div");o.classList.add(j.bottomRight,j.corner),t.appendChild(o),this._innerContainer=t,this._manualContainer=e;const a=wr();this._cornerNameToContainerLookup={"top-left":i,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:i,"top-trailing":a?i:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:e,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const e=t.position??"manual",{component:i,index:n}=t,s=this._positionNameToContainerLookup[e],o=n!=null&&n>-1;if(td(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.from(s.children);if(n===0){const{firstChild:c}=s;return void(c?c.parentNode?.insertBefore(i.node,c):s.appendChild(i.node))}if(n>=a.length)return void s.appendChild(i.node);const h=a[n];h.parentNode?.insertBefore(i.node,h)}_toPixelPosition(t){return{top:qe(t.top),left:qe(t.left),right:qe(t.right),bottom:qe(t.bottom)}}_findByComponent(t){return this._components.find(e=>e===t)??null}_findById(t){return this._components.find(({id:e})=>e===t)??null}_findByNode(t){return this._components.find(({node:e})=>e===t)??null}_getComponentsAtPosition(t,e){const i=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(i.children).map(n=>this._findByNode(n)).filter(ni).filter(n=>e.includeInternal||!this._componentMap.get(n)?.internal).map(({widget:n,node:s})=>n??s)}};r([l()],ht.prototype,"_locale",void 0),r([l()],ht.prototype,"container",null),r([l()],ht.prototype,"height",null),r([l({value:ca})],ht.prototype,"padding",null),r([Bt("padding")],ht.prototype,"castPadding",null),r([l()],ht.prototype,"view",void 0),r([l()],ht.prototype,"width",null),ht=r([_("esri.views.ui.UI")],ht);const ed=ht,id=new Map;function nd(t){return id.get(t)}function Hs(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function sd(t,e){return t.length!==e.length||t.some((i,n)=>i.text!==e[n].text)}function fe(t,e,i){!i||!e||t.find(n=>n.layerView===e&&n.text===i)||t.push({text:i,layerView:e})}function od(t){return t.type==="bing-maps"}const gt=[];let re=class extends M{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new L,this.view=null,this._allLayerViewsChange=e=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const i=this.view?.allLayerViews;i&&(this.addHandles(i.map(n=>w(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),i.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),e?.removed&&e.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([ci(()=>this.view?.allLayerViews,"change",e=>this._allLayerViewsChange(e),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Ce(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews;if(gt.length=0,!t||!e)return void this._clear();e.forEach(n=>{if(n.suspended||!n.layer?.attributionVisible)return;const s=n.layer;if(Hs(s,"user"))return void fe(gt,n,s.copyright);if(s.hasAttributionData){if(this._fetchedAttributionData.has(n)){const a=this._fetchedAttributionData.get(n);return void(a?fe(gt,n,this._getDynamicAttribution(a,t,s)):Hs(s)&&fe(gt,n,s.copyright))}return void this._fetchAttributionData(n)}const o="portalItem"in s?s.portalItem?.accessInformation:void 0;fe(gt,n,o||s.copyright)});const i=e.find(n=>n.layer?.type==="integrated-mesh-3dtiles");if(this.view&&i){const n=nd(this.view);if(n){const s=n.getAttributionText();for(let o=0;o{const d=p.id,m=!c.has(d)&&h&&p.extent&&mn(p.extent,h);return m&&c.add(d),m}).sort((p,d)=>d.score-p.score||p.objectId-d.objectId).map(p=>p.attribution).join(", "):""}};r([l({readOnly:!0,type:L})],re.prototype,"items",void 0),r([l({readOnly:!0})],re.prototype,"state",null),r([l()],re.prototype,"view",void 0),re=r([_("esri.widgets.Attribution.AttributionViewModel")],re);const pa=re,pt={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function ad(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:ld(t[e])}}}function rd(t){const e=t?.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function ld(t){return function(e,...i){rd(e)?br(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}const ie="esri-attribution",ne={base:ie,poweredBy:`${ie}__powered-by`,sources:`${ie}__sources`,open:`${ie}--open`,sourcesOpen:`${ie}__sources--open`,link:`${ie}__link`};let W=class extends gi{constructor(t,e){super(t,e),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(i=>i.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.itemDelimiter=" | ",this.messages=null,this.viewModel=new pa}initialize(){this.addHandles(ci(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((t,e)=>(t.includes(e.text)||t.push(e.text),t),[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t={[ne.open]:this._isOpen};return B("div",{bind:this,class:this.classes(ne.base,pt.widget,t),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return B("div",{class:ne.poweredBy},"Powered by"," ",B("a",{class:ne.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const t=this._isOpen,e=this._isInteractive,i=e?0:void 0,{attributionText:n}=this,s={[ne.sourcesOpen]:t,[pt.interactive]:e};return B("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ne.sources,s),innerHTML:n,tabIndex:i})}_afterSourcesNodeCreate(t){this._prevSourceNodeHeight=t.clientWidth,this._resizeObserver.observe(t)}_checkSourceTextOverflow(t){let e=!1;const{clientHeight:i,clientWidth:n,scrollWidth:s}=t,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(e=!0),this._isOpen){const h=i{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:n}=this;return sr(n),this.goToOverride?this.goToOverride(n,i):n.goTo(i.target,i.options)}};return r([l()],e.prototype,"goToOverride",void 0),r([l()],e.prototype,"view",void 0),e=r([_("esri.widgets.support.GoTo")],e),e};let Ut=class extends dd(M){constructor(t){super(t),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(w(()=>this.view,this._updateRotationWatcher,U))}destroy(){this.view=null}get canShowNorth(){return pd(this.view)}get state(){return!this.view?.ready||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){this.view?.ready&&(this.view?.type==="2d"?this.callGoTo({target:{rotation:0},options:{animationMode:"always",duration:cd()}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(t){t!=null&&this._set("orientation",{z:t})}_updateForCamera(t){if(!t)return;const e=-t.heading;this._set("orientation",{x:0,y:0,z:e})}_updateRotationWatcher(t){this.removeAllHandles(),t&&this.addHandles(t.type==="2d"?w(()=>t?.rotation,this._updateForRotation,U):w(()=>t?.camera,this._updateForCamera,U))}};r([l({readOnly:!0})],Ut.prototype,"canShowNorth",null),r([l({readOnly:!0})],Ut.prototype,"orientation",void 0),r([l({readOnly:!0})],Ut.prototype,"state",null),r([l()],Ut.prototype,"view",void 0),Ut=r([_("esri.widgets.Compass.CompassViewModel")],Ut);const da=Ut,Zs="esri-compass",Gs={base:Zs,iconContainer:`${Zs}__icon-container`};let ft=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new da,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=i=>({transform:`rotateZ(${i.z}deg)`})}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-BWKp46iV.js"),__vite__mapDeps([252,4,1,2,5,253,254,255,256,257,258,259,260,261,262,263,264,265]),import.meta.url),icon:()=>b(()=>import("./calcite-icon-laqhdRBY-Bm5S9Lju.js"),__vite__mapDeps([266,263,4,1,2,5,254,261]),import.meta.url)})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get icon(){return this.viewModel.state==="rotation"?"arrow-up":"compass-needle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}reset(){return this.viewModel.reset()}render(){const{orientation:t,state:e}=this.viewModel,{messages:i}=this;return B("div",{class:this.classes(Gs.base,pt.widget)},B("calcite-button",{class:pt.widgetButton,disabled:e==="disabled",kind:"neutral",label:i.reset,onclick:this._reset,round:!0,scale:"s",title:i.reset},B("div",{"aria-hidden":"true",class:Gs.iconContainer,title:i.reset},B("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(t)}))))}};r([l()],ft.prototype,"goToOverride",null),r([l()],ft.prototype,"icon",null),r([l()],ft.prototype,"label",null),r([l(),mi("esri/widgets/Compass/t9n/Compass")],ft.prototype,"messages",void 0),r([l()],ft.prototype,"view",null),r([l({type:da})],ft.prototype,"viewModel",void 0),ft=r([_("esri.widgets.Compass")],ft);const ud=ft,$s="esri-navigation-toggle",Ws={base:$s,isLayoutHorizontal:`${$s}--horizontal`};let le=class extends M{constructor(t){super(t),this._navigationMode="pan",this.view=null}initialize(){this.addHandles(Ce(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&this.view?.type==="3d"?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(t){this._navigationMode=t,this._setNavigationMode()}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}_setNavigationMode(){const t=this.view?.inputManager;t&&(t.primaryDragAction=this._navigationMode==="pan"?"pan":"rotate")}};r([l({readOnly:!0})],le.prototype,"state",null),r([l()],le.prototype,"_navigationMode",void 0),r([l()],le.prototype,"view",void 0),le=r([_("esri.widgets.NavigationToggle.NavigationToggleViewModel")],le);const ua=le;let vt=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new ua,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const i=this.viewModel?.navigationMode==="pan"?this._rotateButton:this._panButton;Tr(i),this.toggle()}}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-BWKp46iV.js"),__vite__mapDeps([252,4,1,2,5,253,254,255,256,257,258,259,260,261,262,263,264,265]),import.meta.url)})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t=this.viewModel?.state==="disabled",e=this.viewModel?.navigationMode==="pan",i=this.messages.toggle;return B("div",{class:this.classes(Ws.base,pt.widget,{[Ws.isLayoutHorizontal]:this.layout==="horizontal"})},B("calcite-button",{afterCreate:n=>{this._panButton=n},appearance:e?"outline-fill":"solid",class:pt.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?void 0:-1,title:i}),B("calcite-button",{afterCreate:n=>{this._rotateButton=n},appearance:e?"solid":"outline-fill",class:pt.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?-1:void 0,title:i}))}};r([l()],vt.prototype,"icon",null),r([l()],vt.prototype,"label",null),r([l({value:"vertical"})],vt.prototype,"layout",null),r([l(),mi("esri/widgets/NavigationToggle/t9n/NavigationToggle")],vt.prototype,"messages",void 0),r([l()],vt.prototype,"view",null),r([l({type:ua})],vt.prototype,"viewModel",void 0),vt=r([_("esri.widgets.NavigationToggle")],vt);const md=vt;let jt=class extends M{get canZoomIn(){if(!this.view?.ready)return!1;const t=this.view?.constraints?.effectiveMaxScale;return t===0||this._scale>t}get canZoomOut(){const{view:t}=this;if(!t?.ready)return!1;const e=t.constraints?.effectiveMinScale;return e===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-BWKp46iV.js"),__vite__mapDeps([252,4,1,2,5,253,254,255,256,257,258,259,260,261,262,263,264,265]),import.meta.url)})}get icon(){return"magnifying-glass-plus"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}set view(t){this.viewModel.view=t}get view(){return this.viewModel.view}render(){const t={[Us.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:e,canZoomOut:i}=this.viewModel,{zoomIn:n,zoomOut:s}=this.messages;return B("div",{class:this.classes(Us.base,pt.widget,t)},B("calcite-button",{class:pt.widgetButton,disabled:!e,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),B("calcite-button",{class:pt.widgetButton,disabled:!i,iconStart:"minus",kind:"neutral",label:s,onclick:this.zoomOut,title:s}))}};r([l()],wt.prototype,"icon",null),r([l()],wt.prototype,"label",null),r([l({value:"vertical"})],wt.prototype,"layout",null),r([l(),mi("esri/widgets/Zoom/t9n/Zoom")],wt.prototype,"messages",void 0),r([l()],wt.prototype,"view",null),r([l({type:ma})],wt.prototype,"viewModel",void 0),wt=r([_("esri.widgets.Zoom")],wt);const _d=wt;function fd(t){return t?.view!==void 0}let ti=class extends ed{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=e=>{this.components.forEach(i=>{const n=this._find(i),s=n?.widget;fd(s)&&(s.view=e)})},this._componentsWatcher=(e,i)=>{this._removeComponents(i),this._addComponents(e),this._adjustPadding(e)}}initialize(){this.addHandles([w(()=>this.components,this._componentsWatcher,U),w(()=>this.view,this._updateViewAwareWidgets,U)])}_add(t,e,i,n,s){let o=t;if(typeof t=="string"&&this._defaultPositionLookup[t]){if(this._find(t))return;o=this._createComponent(t)}super._add(o,e,i,n,s)}_removeComponents(t){t.forEach(e=>{const i=this._find(e);i&&(this.remove(i),i.destroy())})}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:e}=this.padding;this.padding=e}}_addComponents(t){this.constructed&&t.forEach(e=>this.add(this._createComponent(e),this._defaultPositionLookup[e]))}_createComponent(t){const e=this._createWidget(t);return new Je({id:t,node:e})}_createWidget(t){const e=this.view;switch(t){case"attribution":return new hd({view:e});case"compass":return new ud({view:e});case"navigation-toggle":return new md({view:e});case"zoom":return new _d({view:e})}}};r([l()],ti.prototype,"components",void 0),ti=r([_("esri.views.ui.DefaultUI")],ti);const ga=ti;let ei=class extends ga{constructor(t){super(t),this.components=["attribution","zoom"]}};r([l()],ei.prototype,"components",void 0),ei=r([_("esri.views.ui.2d.DefaultUI2D")],ei);const ya=ei;class vd extends ol{constructor(e,i){super(e,i,"webmap")}}function Ui(t){return t!=null&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.WebMap"}new vd(2,32);let _a,fa,va,wa,ba,Ta,Ma;async function wd(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:n,MagnifierView2D:s,GridView2D:o,Stage:a}]=await Promise.all([b(()=>import("./webglDeps-Bgavuh0h-C76lWx0y.js"),__vite__mapDeps([139,140,1,2,133,132,141,142,143,144]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-qsLwuAiC.js"),__vite__mapDeps([145,1,2,114,43,44,22,45,146,147,56,148,28,27,131,110,111,112,113,76,109,115,11,12,13,14,127,149,150,133,132,141,140,151,152,153,125,120,154,126,144,155,156,143,130,157,158,25,20,21,159,160,161,162,57,37,135,163,164,42,46,165,166,167,139,142,168,169,170,171,63,41,172,173,59,60,51,52,49,53,174,90,40,32,175,176,177,178,179,134,180,55,181,182,183,184,185,186,187,188,189,190,191,192,8,117,118,119,4,5,121,16,17,18,19,36,122,75,123,69,70,124,128,129,39,136]),import.meta.url)]);fa=t,va=e,wa=i,ba=n,Ta=s,Ma=o,_a=a}let v=class extends hl(kl(ml(gh))){constructor(t){super(t),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new Xe({view:this}),this.graphicsView=null,this.stateManager=new Z({constraints:new Go({view:this})}),this.stationaryManager=new Pe,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new xc(this),this.floors=new L,this.grid=null,this.highlights=Jo(),this.inputManager=new hp({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new ha,this.type="2d",this.view2dType=null,this.ui=new ya,this.test={takeScreenshot:async e=>Up(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([w(()=>this.viewpoint,()=>this.stationaryManager.flip(),Ee),this.on("resize",e=>this.stateManager.resize(e.width,e.height))]),gr()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=tt(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new dp(this.featuresTilingScheme)}get constraintsInfo(){const t=this.defaultsFromMap?.tileInfo,e=this.spatialReference;return{lods:t?.spatialReference?.equals(e)?t.lods:null,spatialReference:e}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:t,constraints:e,center:i,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(e?.effectiveLODs||(o=-1),(!i||t===0&&o===-1)&&(n?.targetGeometry==null||n.targetGeometry.type!=="extent"&&!n.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const e=t.targetGeometry,i=this.spatialReference;return yr(e.spatialReference,i)}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get background(){return Ui(this.map)?this.map.initialViewProperties.background:null}set background(t){this._override("background",t)}get center(){return this.stateManager?.center??null}set center(t){this.stateManager.center=t}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get highlightOptions(){return Lp(this)}set highlightOptions(t){Vp(this,t)}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get scale(){return this.stateManager?.scale??0}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const t=!(!this.magnifier.visible||this.magnifier.position===null||!this._magnifierView?.updatingHandles.updating),e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(i=>!i.destroyed&&!("layerViews"in i)&&i.updating===!0)||t);if(z("esri-2d-log-updating")){const i=this.allLayerViews.reduce((n,s)=>({...n,[`${s.layer.id}(${s.layer.type})`]:!s.destroyed&&!("layerViews"in s)&&s.updating}),{});console.log(`Updating MapView: ${e} --> Null LayerViewManager: ${!this.layerViewManager} --> Null LabelManager: ${!this.labelManager} --> Null GraphicsView: ${!this.graphicsView} --> layerViewManager.updating: ${this.layerViewManager?.updating} --> labelManager.updating: ${this.labelManager?.updating} --> graphicsView.updating: ${this.graphicsView?.updating} --> allLayerViews: ${JSON.stringify(i)} --> updatingMagnifier: ${t} -`)}return e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(t){this.stateManager.viewpoint=t,this.frameTask.requestFrame()}get visibleArea(){const t=this.stateManager.visibleArea;return t&&new Xs({rings:[t.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference})}get zoom(){return this.stateManager.zoom??-1}set zoom(t){this.stateManager.zoom=t}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(t,e){return this.goToManager.goTo(t,e)}async hitTest(t,e){return Op(this,t,e)}async takeScreenshot(t){return Wp(this._getScreenshotView(t),t)}toMap(t){if(!this.ready)return null;const e=vo(t)?fo(this,t):t;return this.stateManager.toMap(e)}toScreen(t,e){return this.stateManager.toScreen(t,e)}on(t,e,i,n){return this.inputManager&&this.viewEvents.on(t,e,i,n)||super.on(t,e)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}whenLayerView(t){return super.whenLayerView(t)}graphicChanged(t){this.graphicsView&&this.graphicsView.graphicUpdateHandler(t)}whenReady(){return new Promise(t=>{this.ready?t(this):this._resolveWhenReady.push(t)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return Ui(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return Ui(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(t){return ws.hasLayerViewModule(t)}importLayerView(t){return ws.importLayerView(t)}pixelSizeAt(){return this.ready?this.resolution:(D.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(t){const e=this.toMap(t),i=await this.hitTest(t),n=this.allLayerViews.toArray().filter(c=>c.clips.every(p=>Xo(this,p,t,e))).reverse(),s=new globalThis.Map(n.map(c=>[c.layer.uid,c])),o=[];let a=0,h=0;for(;athis._updateStageChildren()),e.on("webgl-error",a=>this.fatalError=a.error),w(()=>this.stationary,a=>e.stationary=a,ct),w(()=>this.background,a=>{e.backgroundColor=a?.color,this._magnifierView.backgroundColor=a?.color},ct),w(()=>this.magnifier,a=>this._magnifierView.magnifier=a,ct),w(()=>this.grid,a=>this._gridView.grid=a,ct),w(()=>this.renderingOptions,a=>e.renderingOptions=a,ct),w(()=>this.highlights.items.map(a=>({name:a.name,options:{fillColor:a.options.color,haloColor:a.options.haloColor,fillOpacity:a.options.fillOpacity,haloOpacity:a.options.haloOpacity,haloWidth:a.options.haloWidth,haloBlur:a.options.haloBlur}})),()=>{e.highlightGradient=Dp(e.highlightGradient,this.highlights.items)},ct),w(()=>this.state.id,()=>e.state=this.state,ct)],"map-view"),this._updateStageChildren();const o=this._resolveWhenReady;this._resolveWhenReady=[],o.forEach(a=>a(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const t=this.graphicsView;this.stage.addChild(t.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const t=new Ar(fr.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",t);const e=new fa({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new va(t)});this._set("graphicsView",e)}_destroySpatialReferenceDependentProperties(){const t=this.graphicsView;this._set("graphicsView",null),t.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(t){const{allLayerViews:e,padding:i,size:n,stage:s}=this;return{allLayerViews:e,backgroundColor:t?.ignoreBackground?null:this.background?.color,padding:i,size:n,stage:s}}_spatialReferenceChanged(t){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(t),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};v.type="2d",r([l({readOnly:!0})],v.prototype,"animationManager",void 0),r([l({constructOnly:!0})],v.prototype,"deactivatedWebGLExtensions",void 0),r([l({constructOnly:!0})],v.prototype,"debugWebGLExtensions",void 0),r([l({readOnly:!0})],v.prototype,"featuresTilingScheme",void 0),r([l({readOnly:!0})],v.prototype,"fullOpacity",void 0),r([l()],v.prototype,"goToManager",void 0),r([l({readOnly:!0})],v.prototype,"graphicsTileStore",null),r([l()],v.prototype,"graphicsView",void 0),r([l()],v.prototype,"stateManager",void 0),r([l()],v.prototype,"constraintsInfo",null),r([l({readOnly:!0})],v.prototype,"state",null),r([l()],v.prototype,"initialExtentRequired",null),r([l()],v.prototype,"labelManager",void 0),r([l({readOnly:!0})],v.prototype,"mapViewNavigation",void 0),r([l({constructOnly:!0})],v.prototype,"renderCanvas",void 0),r([l()],v.prototype,"renderingOptions",void 0),r([l({constructOnly:!0})],v.prototype,"supersampleScreenshotsEnabled",void 0),r([l({readOnly:!0})],v.prototype,"supportsGround",void 0),r([l()],v.prototype,"defaultsFromMapSettings",null),r([l({readOnly:!0})],v.prototype,"typeSpecificPreconditionsReady",null),r([l()],v.prototype,"animation",null),r([l({type:al})],v.prototype,"background",null),r([l()],v.prototype,"center",null),r([l({type:Go})],v.prototype,"constraints",null),r([l()],v.prototype,"extent",null),r([l()],v.prototype,"floors",void 0),r([l()],v.prototype,"grid",void 0),r([l({type:Yt})],v.prototype,"highlightOptions",null),r([l({type:L.ofType(pe)})],v.prototype,"highlights",void 0),r([l({readOnly:!0})],v.prototype,"inputManager",void 0),r([l()],v.prototype,"map",void 0),r([l()],v.prototype,"padding",null),r([l({readOnly:!0})],v.prototype,"rendering",null),r([l()],v.prototype,"resizeAlign",null),r([l({readOnly:!0})],v.prototype,"resolution",null),r([l()],v.prototype,"rotation",null),r([l()],v.prototype,"scale",null),r([l({constructOnly:!0})],v.prototype,"spatialReferenceLocked",void 0),r([l()],v.prototype,"stationary",null),r([l({readOnly:!0})],v.prototype,"tileInfo",null),r([l({type:ha,readOnly:!0})],v.prototype,"timeline",void 0),r([l({readOnly:!0})],v.prototype,"type",void 0),r([l({readOnly:!0})],v.prototype,"updating",null),r([l({readOnly:!0})],v.prototype,"view2dType",void 0),r([l()],v.prototype,"viewpoint",null),r([l({readOnly:!0})],v.prototype,"visibleArea",null),r([l()],v.prototype,"zoom",null),r([l({readOnly:!0})],v.prototype,"navigating",null),r([l(),Bt(t=>t instanceof ga?t:Ga(ya,t))],v.prototype,"ui",void 0),v=r([_("esri.views.View2D")],v);const bd=v;let ii=class extends bd{constructor(t){super(t),this.view2dType="map"}};r([l({readOnly:!0})],ii.prototype,"view2dType",void 0),ii=r([_("esri.views.MapView")],ii);const Td=ii,Ou=Object.freeze(Object.defineProperty({__proto__:null,default:Td},Symbol.toStringTag,{value:"Module"}));export{xh as $,Ds as A,Eu as B,Cu as C,Ko as D,Es as E,Sp as F,Vo as G,Iu as H,pt as I,wo as J,dd as K,Cs as L,Cp as M,Ls as N,_h as O,gl as P,Ie as Q,li as R,Vs as S,rt as T,Vu as U,Ou as V,At as _,Dp as a,Vp as b,Nh as c,cd as d,Ye as e,nt as f,Do as g,Lu as h,pe as i,Mu as j,vi as k,Yt as l,Lo as m,xu as n,Yo as o,Lh as p,Rp as q,Lp as r,Du as s,Ru as t,xt as u,Pu as v,Su as w,up as x,ha as y,ku as z}; diff --git a/main/assets/MediaLayer-DiCs97gD-ChMe9P3l.js b/main/assets/MediaLayer-DiCs97gD-ChMe9P3l.js deleted file mode 100644 index 58c033241..000000000 --- a/main/assets/MediaLayer-DiCs97gD-ChMe9P3l.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mediaLayerUtils-CasWezAG-D0TaY3A3.js","./utils-BVWK2jiA-Ewzf326n.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./jsonContext-BA8GHqVk-BMETb6sX.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js","./resourceUtils-BmW6QqlX-Cs99W_og.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-C_sFWCPe.js"])))=>i.map(i=>d[i]); -import{v as i,i as R,S as l,w as d,bA as Ve,J as ae,o as x,a1 as W,as as w,a0 as K,ac as Z,l as ce,n as ue,aH as Ae,ag as ne,aB as Re,at as We,I as Be,ah as Ge,$ as ze,am as Ue,aC as De,gH as Je,jb as ke,bp as Fe,bP as F,ad as Ke,aP as _e,e as qe,B as Xe,jM as fe,bO as Ye,a4 as Ze,ez as ye,jD as be,jC as Qe,d8 as Ie,d7 as pe,dq as de,jN as et,f as Oe,bX as tt,Y as nt,A as ot,bZ as ge,jO as rt,_ as it}from"./main-BZaw9FpY.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as st}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as lt}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as at}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as ct}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as ut}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{K as O,M as Ee,o as pt}from"./perspectiveUtils-Bu88xlbg-Dy8WOySc.js";import{k as dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as ht,n as oe}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as N,P as z,I as ve}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as b,e as Q}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{V as q,N as mt,K as ft}from"./projection-BA9M1R7d-DoNqITCd.js";import{T as yt}from"./imageUtils-BA2D6Uf1-BIs7TUww.js";import{r as gt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{r as vt}from"./common-CYWrYyJl-E8-sukrT.js";import{e as Pt}from"./resourceExtension-CdQvIDKV-X6Zoj5Td.js";import{r as wt}from"./BoundsStore--N6o1xkF-DBAJ8yky.js";import{E as ee}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";let se=class extends _e{projectOrWarn(e,t){if(e==null)return e;const{geometry:n,pending:o}=q(e,t);return o?null:o||n?n:(W.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};se=i([R("esri.layers.support.GeoreferenceBase")],se);const X=se,re=oe(),p=b();let J=class extends qe{};i([l({type:Number,json:{write:!0}})],J.prototype,"x",void 0),i([l({type:Number,json:{write:!0}})],J.prototype,"y",void 0),J=i([R("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],J);let k=class extends _e{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};i([l()],k.prototype,"sourcePoint",void 0),i([l({type:d})],k.prototype,"mapPoint",void 0),k=i([R("esri.layers.support.ControlPointsGeoreference.ControlPoint")],k);let v=class extends Ve(X){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=ae.fromJSON(t.spatialReference),o=ht(...t.coefficients,1);return e.map(r=>(N(p,r.x,r.y),O(p,p,o),{sourcePoint:r,mapPoint:new d({x:p[0],y:p[1],spatialReference:n})}))}writeControlPoints(e,t,n,o){if(this.transform!=null)e!=null&&f(e[0])&&(t.controlPoints=e.map(r=>{const s=r.sourcePoint;return{x:s.x,y:s.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const r=new x("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:o?.layer,georeference:this});o?.messages?o.messages.push(r):W.getLogger(this).error(r.name,r.message)}}get coords(){if(this.controlPoints==null)return null;const e=this._updateTransform(re);if(e==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return It(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!f(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if((e=this.projectOrWarn(e,t))==null)return;const{width:n,height:o}=this,{rings:[[r,s,a,c]]}=e,u={sourcePoint:w(0,o),mapPoint:new d({x:r[0],y:r[1],spatialReference:t})},h={sourcePoint:w(0,0),mapPoint:new d({x:s[0],y:s[1],spatialReference:t})},y={sourcePoint:w(n,0),mapPoint:new d({x:a[0],y:a[1],spatialReference:t})},g={sourcePoint:w(n,o),mapPoint:new d({x:c[0],y:c[1],spatialReference:t})};f(u)&&f(h)&&f(y)&&f(g)&&(Pe(re,u,h,y,g),this.controlPoints=this.controlPoints.map(({sourcePoint:I})=>(N(p,I.x,I.y),O(p,p,re),{sourcePoint:I,mapPoint:new d({x:p[0],y:p[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:dt(oe(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;N(p,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return O(p,p,this.transform),new d({x:p[0],y:p[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),(e=q(e,t).geometry)==null?null:(N(p,e.x,e.y),O(p,p,this.inverseTransform),w(p[0],p[1]))}toSourceNormalized(e){const t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:o}=this;if(!(t!=null&&n>0&&o>0))return null;const[r,s,a,c]=t;if(!f(r))return null;const u=r.mapPoint.spatialReference,h=this._projectControlPoint(s,u),y=this._projectControlPoint(a,u),g=this._projectControlPoint(c,u);if(!h.valid||!y.valid||!g.valid||!f(h.controlPoint))return null;e==null&&(e=oe());let I=null;return I=f(y.controlPoint)&&f(g.controlPoint)?Pe(e,r,h.controlPoint,y.controlPoint,g.controlPoint):f(y.controlPoint)?Rt(e,r,h.controlPoint,y.controlPoint):xt(e,r,h.controlPoint),I.every(Ne=>Ne===0)?null:I}_projectControlPoint(e,t){if(!f(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:o}=e,{geometry:r,pending:s}=q(o,t);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:r}}:(W.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:o.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function f(e){return e?.sourcePoint!=null&&e.mapPoint!=null}i([l({type:[k],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[J]},coefficients:{type:[Number]},spatialReference:{type:ae}}}}})],v.prototype,"controlPoints",void 0),i([K("controlPoints")],v.prototype,"readControlPoints",null),i([Z("controlPoints")],v.prototype,"writeControlPoints",null),i([l({clonable:!1})],v.prototype,"coords",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"height",void 0),i([l({readOnly:!0})],v.prototype,"inverseTransform",null),i([l({readOnly:!0})],v.prototype,"transform",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"width",void 0),v=i([R("esri.layers.support.ControlPointsGeoreference")],v);const S=b(),E=b(),V=b(),C=b(),M=b(),L=b(),A=b(),H=b(),te=Math.PI/2;function j(e,t,n){N(e,n.sourcePoint.x,n.sourcePoint.y),N(t,n.mapPoint.x,n.mapPoint.y)}function xt(e,t,n){return j(S,M,t),j(E,L,n),z(V,E,S,te),z(C,S,E,te),z(A,L,M,-te),z(H,M,L,-te),he(e,S,E,V,C,M,L,A,H)}function Rt(e,t,n,o){return j(S,M,t),j(E,L,n),j(V,A,o),ve(C,S,E,.5),z(C,V,C,Math.PI),ve(H,M,L,.5),z(H,A,H,Math.PI),he(e,S,E,V,C,M,L,A,H)}function Pe(e,t,n,o,r){return j(S,M,t),j(E,L,n),j(V,A,o),j(C,H,r),he(e,S,E,V,C,M,L,A,H)}const _t=new Array(8).fill(0),bt=new Array(8).fill(0);function we(e,t,n,o,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=r[0],e[7]=r[1],e}function he(e,t,n,o,r,s,a,c,u){return Ee(e,we(_t,t,n,o,r),we(bt,s,a,c,u))}function It(e,t,n,o){const r=Q(0,n),s=Q(0,0),a=Q(t,0),c=Q(t,n);return O(r,r,e),O(s,s,e),O(a,a,e),O(c,c,e),new ce({rings:[[r,s,a,c,r]],spatialReference:o})}const Y=v,U=b();let T=class extends X{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:o}=this;if(e==null||t==null||n==null||o==null)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),t==null||n==null||o==null?null:new ce({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[o.x,o.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(t==null)return;const n=t.spatialReference;if((e=this.projectOrWarn(e,n))==null)return;const{rings:[[o,r,s,a]]}=e;this.bottomLeft=new d({x:o[0],y:o[1],spatialReference:n}),this.topLeft=new d({x:r[0],y:r[1],spatialReference:n}),this.topRight=new d({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new d({x:a[0],y:a[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:o,bottomLeft:r}=this;if(e==null||t==null||n==null||o==null||r==null)return null;const s=t.spatialReference;e=e.normalize();const a=q(e,s).geometry;if(a==null)return null;N(U,a.x,a.y);const c=Ee(oe(),[t.x,t.y,r.x,r.y,n.x,n.y,o.x,o.y],[0,0,0,1,1,0,1,1]);return O(U,U,c),w(U[0],U[1])}};i([l({clonable:!1})],T.prototype,"coords",null),i([l({type:d})],T.prototype,"bottomLeft",void 0),i([l({type:d})],T.prototype,"bottomRight",void 0),i([l({type:d})],T.prototype,"topLeft",void 0),i([l({type:d})],T.prototype,"topRight",void 0),T=i([R("esri.layers.support.CornersGeoreference")],T);const Ot=T;let B=class extends X{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:a,y:c}=this.extent.center,u=ie(a,c,this.rotation);s=[u(e,t),u(e,o),u(n,o),u(n,t)],s.push(s[0])}else s=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new ce({rings:[s],spatialReference:r})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),e?.extent==null)return;const{rings:[[n,o,r]],extent:{center:{x:s,y:a}}}=e,c=Xe(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=ie(s,a,-c),[h,y]=u(n[0],n[1]),[g,I]=u(r[0],r[1]);this.extent=new ue({xmin:h,ymin:y,xmax:g,ymax:I,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(e==null||t==null)return null;const{xmin:o,ymin:r,xmax:s,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const h=q(e,u).geometry;if(h==null)return null;let y=h.x,g=h.y;return n&&([y,g]=ie(c.x,c.y,-n)(y,g)),w(fe(y,o,s,0,1),fe(g,a,r,0,1))}};function ie(e,t,n){const o=vt(n),r=Math.cos(o),s=Math.sin(o);return(a,c)=>[r*(a-e)+s*(c-t)+e,r*(c-t)-s*(a-e)+t]}i([l({clonable:!1})],B.prototype,"coords",null),i([l({type:ue})],B.prototype,"extent",void 0),i([l({type:Number})],B.prototype,"rotation",void 0),B=i([R("esri.layers.support.ExtentAndRotationGeoreference")],B);const St=B;function Et(e){return e?.type==="media"}function Me(e,t){const n=Ye(t);return Et(e)&&!!e.portalItem&&n!=null&&n>F.PORTAL_ITEM}function Mt(e,t,n){if(!e||e.type==="control-points")return e;const{coords:o}=e;if(o?.rings[0]?.length!==5)return null;const[r,s,a,c]=o.rings[0],{spatialReference:u}=o;return new Y({controlPoints:[{mapPoint:new d({x:r[0],y:r[1],spatialReference:u}),sourcePoint:w(0,n)},{mapPoint:new d({x:s[0],y:s[1],spatialReference:u}),sourcePoint:w(0,0)},{mapPoint:new d({x:a[0],y:a[1],spatialReference:u}),sourcePoint:w(t,0)},{mapPoint:new d({x:c[0],y:c[1],spatialReference:u}),sourcePoint:w(t,n)}],width:t,height:n})}function Le(e,t,n){return{enabled:!Me(n?.layer,n?.origin),ignoreOrigin:!0}}const je={json:{name:"url",type:String,write:{overridePolicy:Le}}},Te={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:Le}}},Lt={types:{key:"type",base:X,typeMap:{"control-points":Y,corners:Ot,"extent-and-rotation":St}},json:{types:{key:"type",base:X,typeMap:{"control-points":Y}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};let $=class extends Ae(Se(Re)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return Y.fromJSON(e)}writeGeoreference(e,t,n,o){const r=o?.resources?.pendingOperations,s=()=>{const a=Mt(this.georeference,this.contentWidth,this.contentHeight);if(a){if(e.type!=="control-points"&&W.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),a.controlPoints?.length!==4&&o?.messages)return void o.messages.push(new x("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=a.write({},o)}};if(e.type!=="control-points"&&!this.loaded&&r)return t[n]={},void r.push(this.load().then(s));s()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:o}=this;if(e==null||t==null||n===0||o===0)return null;const r=t.toSourceNormalized(e);return r==null?null:(r.x*=n,r.y*=o,r)}};i([l(Lt)],$.prototype,"georeference",void 0),i([K("georeference")],$.prototype,"readGeoreference",null),i([Z("georeference")],$.prototype,"writeGeoreference",null),i([l({json:{read:!1,write:!1}})],$.prototype,"opacity",void 0),$=i([R("esri.layers.support.MediaElementBase")],$);const me=$;let P=class extends me{constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const e=this.image;if(typeof e=="string"){const t=yt(e).then(n=>{this._set("content",n)});this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then(()=>{this._set("content",e)});this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new x("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return Ze(t.url,n)}writeImage(e,t,n,o){if(e==null)return;const r=o?.portalItem,s=o?.resources;if(!r||!s)return void(typeof e=="string"&&(t[n]=ye(e,o)));const a=jt(e)?e:null;if(a){if(be(a)==null)return void(t[n]=a);const c=ye(a,{...o,verifyItemRelativeUrls:o?.verifyItemRelativeUrls?{writtenUrls:o.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},Qe.NO);if(r&&c&&!Ie(c))return s.toKeep.push({resource:r.resourceFromPath(c),compress:!1}),void(t[n]=c)}t[n]="",s.pendingOperations.push(Tt(e).then(c=>{const u=Ht(c,r);t[n]=u.itemRelativeUrl,s.toAdd.push({resource:u,content:{type:"blob",blob:c},compress:!1,finish:h=>{this.image=h.url}})}))}};i([l()],P.prototype,"animationOptions",void 0),i([l({readOnly:!0})],P.prototype,"content",void 0),i([l({readOnly:!0})],P.prototype,"contentWidth",null),i([l({readOnly:!0})],P.prototype,"contentHeight",null),i([l(je)],P.prototype,"image",void 0),i([K("image",["url"])],P.prototype,"readImage",null),i([Z("image")],P.prototype,"writeImage",null),i([l(Te)],P.prototype,"type",void 0),P=i([R("esri.layers.support.ImageElement")],P);const Ce=P;function jt(e){return typeof e=="string"&&!pe(e)&&!de(e)}async function Tt(e){return typeof e=="string"?pe(e)?et(e):(await Oe(e,{responseType:"blob"})).data:new Promise(t=>Ct(e).toBlob(t))}function Ct(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),r=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),o}function Ht(e,t){const n=gt(),o=`${tt("media",n)}.${Pt({type:"blob",blob:e})}`;return t.resourceFromPath(o)}let _=class extends me{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;return typeof e=="string"?this.addResolvingPromise(this._preProcessVideoUrl(e).then(t=>{const n=document.createElement("video");return n.src=t,n.crossOrigin="anonymous",n.autoplay=!0,n.muted=!0,n.loop=!0,n.playsInline=!0,this._loadVideo(n).then(()=>{this._set("content",n)})})):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new x("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):W.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,n,o){if(!e)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source is missing")));const r=$t(e)?e:null;if(!r)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source must be an absolute url")));!Ie(r)&&o?.blockedRelativeUrls&&o.blockedRelativeUrls.push(r);const s=nt(r);be(s)?o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source cannot be an item resource")):t[n]=s}async _preProcessVideoUrl(e){if(ot(e))return ge(e);try{return await Oe(e,{method:"head"}),e}catch{return ge(e,!0)}}_loadVideo(e){return new Promise((t,n)=>{const o=rt(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()});this.addHandles(o,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",de(e.src)||(e.src=e.src))})}};i([l()],_.prototype,"autoplay",void 0),i([l({readOnly:!0})],_.prototype,"content",void 0),i([l({readOnly:!0})],_.prototype,"contentWidth",null),i([l({readOnly:!0})],_.prototype,"contentHeight",null),i([l(je)],_.prototype,"video",null),i([Z("video")],_.prototype,"writeVideo",null),i([l(Te)],_.prototype,"type",void 0),_=i([R("esri.layers.support.VideoElement")],_);const He=_;function $t(e){return typeof e=="string"&&!pe(e)&&!de(e)}const Nt={key:"type",defaultKeyValue:"image",base:me,typeMap:{image:Ce,video:He}},xe=ne.ofType(Nt);let G=class extends Re.LoadableMixin(We(Be.EventedAccessor)){constructor(e){super(e),this._index=new wt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const o of t.removed){const r=this._elementViewsMap.get(o);this._elementViewsMap.delete(o),this._index.delete(r),this.removeHandles(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:n}=this;for(const o of t.added){if(this._elementViewsMap.get(o))continue;const r=new pt({spatialReference:n,element:o});this._elementViewsMap.set(o,r);const s=Ge(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.addHandles(s,r)}this._elementsIndexes.clear(),this.elements.forEach((o,r)=>this._elementsIndexes.set(o,r)),this.emit("refresh")},this.elements=new xe}async load(e){if(ze(e),!this.spatialReference){const t=this.elements.find(n=>n.georeference?.coords!=null);this._set("spatialReference",t?t.georeference.coords.spatialReference:ae.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",Ue(e,this._get("elements"),xe))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new ue({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):W.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await mt(e.spatialReference,this.spatialReference,null,t);const n=De(e.spatialReference,this.spatialReference)?e:ft(e,this.spatialReference);if(!n)return[];const o=n.normalize(),r=[];for(const s of o)this._index.forEachInBounds(Je(s),({normalizedCoords:a,element:c})=>{a!=null&&ke(s,a)&&r.push(c)});return r.sort((s,a)=>this._elementsIndexes.get(s)-this._elementsIndexes.get(a)),r}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,o=this._index.has(e),r=n!=null;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(o!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};i([l()],G.prototype,"elements",null),i([l({readOnly:!0})],G.prototype,"fullExtent",null),i([l()],G.prototype,"spatialReference",null),G=i([R("esri.layers.support.LocalMediaElementSource")],G);const D=G;function le(e){return typeof e=="object"&&e!=null&&"type"in e}function $e(e){return le(e)&&(e.type==="image"||e.type==="video")}let m=class extends lt(ut(at(ct(Se(st))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=Fe(async(t,n,o)=>{const{save:r,saveAs:s}=await it(()=>import("./mediaLayerUtils-CasWezAG-D0TaY3A3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);switch(t){case ee.SAVE:return r(this,n);case ee.SAVE_AS:return s(this,o,n)}}),this.source=new D}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new x("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const o=le(t)?new D({elements:new ne([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference),await o.load(e),this.spatialReference=o.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("source",e):W.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new D({elements:new ne(e)}):e instanceof ne?new D({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const o=this._createSource(t);return o?.read(t,n),o}writeSource(e,t,n,o){if(e&&e instanceof D){const r=e.elements.length;if(r!==1)return void(o?.messages&&o.messages.push(new x("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${r}.`)));e=e.elements.at(0)}$e(e)?e.write(t,o):o?.messages&&(e?o.messages.push(new x("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):o.messages.push(new x("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(ee.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ee.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Ce;case"video":return new He}return null}_getSourceOverride(e,t){if(le(e)&&this.originIdOf("source")===F.PORTAL_ITEM&&t&&(this.originIdOf("georeference")===F.WEB_MAP||this.originIdOf("georeference")===F.WEB_SCENE)){const n=e.toJSON(),o=this._createSource(n);return o.read({...n},{origin:"portal-item"}),o.read({georeference:t},{origin:"web-map"}),o.read({georeference:t},{origin:"web-scene"}),o}return null}};i([l({readOnly:!0})],m.prototype,"effectiveSource",void 0),i([l({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],m.prototype,"georeference",void 0),i([K("web-document","georeference")],m.prototype,"readGeoreference",null),i([l({type:String})],m.prototype,"copyright",void 0),i([l({readOnly:!0})],m.prototype,"fullExtent",null),i([l({type:["MediaLayer"]})],m.prototype,"operationalLayerType",void 0),i([l({type:["show","hide"]})],m.prototype,"listMode",void 0),i([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:Y}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Me(this,n?.origin)&&$e(e)&&!!e.georeference&&e.originIdOf("georeference")>F.PORTAL_ITEM}}}}})],m.prototype,"source",null),i([Ke("source")],m.prototype,"castSource",null),i([K("source",["url"])],m.prototype,"readSource",null),i([Z("source")],m.prototype,"writeSource",null),i([l()],m.prototype,"spatialReference",void 0),i([l({readOnly:!0})],m.prototype,"type",void 0),m=i([R("esri.layers.MediaLayer")],m);const Pn=m;export{Pn as default}; diff --git a/main/assets/MediaLayer-DiCs97gD-DwBJPZLQ.js b/main/assets/MediaLayer-DiCs97gD-DwBJPZLQ.js new file mode 100644 index 000000000..190060ded --- /dev/null +++ b/main/assets/MediaLayer-DiCs97gD-DwBJPZLQ.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mediaLayerUtils-CasWezAG-cOVi9TBz.js","./utils-BVWK2jiA-D8rVYIEJ.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./jsonContext-BA8GHqVk-DpBf0bCt.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js","./resourceUtils-BmW6QqlX-CP-OW4gT.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-Bu5Czfos.js"])))=>i.map(i=>d[i]); +import{v as i,i as R,S as l,w as d,bA as Ve,J as ae,o as x,a1 as W,as as w,a0 as K,ac as Z,l as ce,n as ue,aH as Ae,ag as ne,aB as Re,at as We,I as Be,ah as Ge,$ as ze,am as Ue,aC as De,gH as Je,jb as ke,bp as Fe,bP as F,ad as Ke,aP as _e,e as qe,B as Xe,jM as fe,bO as Ye,a4 as Ze,ez as ye,jD as be,jC as Qe,d8 as Ie,d7 as pe,dq as de,jN as et,f as Oe,bX as tt,Y as nt,A as ot,bZ as ge,jO as rt,_ as it}from"./main-C7yV2j71.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as st}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as lt}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as at}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as ct}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as ut}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{K as O,M as Ee,o as pt}from"./perspectiveUtils-Bu88xlbg-DmCqcrzQ.js";import{k as dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as ht,n as oe}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as N,P as z,I as ve}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as b,e as Q}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{V as q,N as mt,K as ft}from"./projection-BA9M1R7d-DXrPfsKU.js";import{T as yt}from"./imageUtils-BA2D6Uf1-DyozB2y5.js";import{r as gt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{r as vt}from"./common-CYWrYyJl-E8-sukrT.js";import{e as Pt}from"./resourceExtension-CdQvIDKV-BFbGjGZW.js";import{r as wt}from"./BoundsStore--N6o1xkF-mEMXylgh.js";import{E as ee}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";let se=class extends _e{projectOrWarn(e,t){if(e==null)return e;const{geometry:n,pending:o}=q(e,t);return o?null:o||n?n:(W.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};se=i([R("esri.layers.support.GeoreferenceBase")],se);const X=se,re=oe(),p=b();let J=class extends qe{};i([l({type:Number,json:{write:!0}})],J.prototype,"x",void 0),i([l({type:Number,json:{write:!0}})],J.prototype,"y",void 0),J=i([R("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],J);let k=class extends _e{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};i([l()],k.prototype,"sourcePoint",void 0),i([l({type:d})],k.prototype,"mapPoint",void 0),k=i([R("esri.layers.support.ControlPointsGeoreference.ControlPoint")],k);let v=class extends Ve(X){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=ae.fromJSON(t.spatialReference),o=ht(...t.coefficients,1);return e.map(r=>(N(p,r.x,r.y),O(p,p,o),{sourcePoint:r,mapPoint:new d({x:p[0],y:p[1],spatialReference:n})}))}writeControlPoints(e,t,n,o){if(this.transform!=null)e!=null&&f(e[0])&&(t.controlPoints=e.map(r=>{const s=r.sourcePoint;return{x:s.x,y:s.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const r=new x("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:o?.layer,georeference:this});o?.messages?o.messages.push(r):W.getLogger(this).error(r.name,r.message)}}get coords(){if(this.controlPoints==null)return null;const e=this._updateTransform(re);if(e==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return It(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!f(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if((e=this.projectOrWarn(e,t))==null)return;const{width:n,height:o}=this,{rings:[[r,s,a,c]]}=e,u={sourcePoint:w(0,o),mapPoint:new d({x:r[0],y:r[1],spatialReference:t})},h={sourcePoint:w(0,0),mapPoint:new d({x:s[0],y:s[1],spatialReference:t})},y={sourcePoint:w(n,0),mapPoint:new d({x:a[0],y:a[1],spatialReference:t})},g={sourcePoint:w(n,o),mapPoint:new d({x:c[0],y:c[1],spatialReference:t})};f(u)&&f(h)&&f(y)&&f(g)&&(Pe(re,u,h,y,g),this.controlPoints=this.controlPoints.map(({sourcePoint:I})=>(N(p,I.x,I.y),O(p,p,re),{sourcePoint:I,mapPoint:new d({x:p[0],y:p[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:dt(oe(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;N(p,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return O(p,p,this.transform),new d({x:p[0],y:p[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),(e=q(e,t).geometry)==null?null:(N(p,e.x,e.y),O(p,p,this.inverseTransform),w(p[0],p[1]))}toSourceNormalized(e){const t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:o}=this;if(!(t!=null&&n>0&&o>0))return null;const[r,s,a,c]=t;if(!f(r))return null;const u=r.mapPoint.spatialReference,h=this._projectControlPoint(s,u),y=this._projectControlPoint(a,u),g=this._projectControlPoint(c,u);if(!h.valid||!y.valid||!g.valid||!f(h.controlPoint))return null;e==null&&(e=oe());let I=null;return I=f(y.controlPoint)&&f(g.controlPoint)?Pe(e,r,h.controlPoint,y.controlPoint,g.controlPoint):f(y.controlPoint)?Rt(e,r,h.controlPoint,y.controlPoint):xt(e,r,h.controlPoint),I.every(Ne=>Ne===0)?null:I}_projectControlPoint(e,t){if(!f(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:o}=e,{geometry:r,pending:s}=q(o,t);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:r}}:(W.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:o.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function f(e){return e?.sourcePoint!=null&&e.mapPoint!=null}i([l({type:[k],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[J]},coefficients:{type:[Number]},spatialReference:{type:ae}}}}})],v.prototype,"controlPoints",void 0),i([K("controlPoints")],v.prototype,"readControlPoints",null),i([Z("controlPoints")],v.prototype,"writeControlPoints",null),i([l({clonable:!1})],v.prototype,"coords",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"height",void 0),i([l({readOnly:!0})],v.prototype,"inverseTransform",null),i([l({readOnly:!0})],v.prototype,"transform",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"width",void 0),v=i([R("esri.layers.support.ControlPointsGeoreference")],v);const S=b(),E=b(),V=b(),C=b(),M=b(),L=b(),A=b(),H=b(),te=Math.PI/2;function j(e,t,n){N(e,n.sourcePoint.x,n.sourcePoint.y),N(t,n.mapPoint.x,n.mapPoint.y)}function xt(e,t,n){return j(S,M,t),j(E,L,n),z(V,E,S,te),z(C,S,E,te),z(A,L,M,-te),z(H,M,L,-te),he(e,S,E,V,C,M,L,A,H)}function Rt(e,t,n,o){return j(S,M,t),j(E,L,n),j(V,A,o),ve(C,S,E,.5),z(C,V,C,Math.PI),ve(H,M,L,.5),z(H,A,H,Math.PI),he(e,S,E,V,C,M,L,A,H)}function Pe(e,t,n,o,r){return j(S,M,t),j(E,L,n),j(V,A,o),j(C,H,r),he(e,S,E,V,C,M,L,A,H)}const _t=new Array(8).fill(0),bt=new Array(8).fill(0);function we(e,t,n,o,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=r[0],e[7]=r[1],e}function he(e,t,n,o,r,s,a,c,u){return Ee(e,we(_t,t,n,o,r),we(bt,s,a,c,u))}function It(e,t,n,o){const r=Q(0,n),s=Q(0,0),a=Q(t,0),c=Q(t,n);return O(r,r,e),O(s,s,e),O(a,a,e),O(c,c,e),new ce({rings:[[r,s,a,c,r]],spatialReference:o})}const Y=v,U=b();let T=class extends X{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:o}=this;if(e==null||t==null||n==null||o==null)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),t==null||n==null||o==null?null:new ce({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[o.x,o.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(t==null)return;const n=t.spatialReference;if((e=this.projectOrWarn(e,n))==null)return;const{rings:[[o,r,s,a]]}=e;this.bottomLeft=new d({x:o[0],y:o[1],spatialReference:n}),this.topLeft=new d({x:r[0],y:r[1],spatialReference:n}),this.topRight=new d({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new d({x:a[0],y:a[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:o,bottomLeft:r}=this;if(e==null||t==null||n==null||o==null||r==null)return null;const s=t.spatialReference;e=e.normalize();const a=q(e,s).geometry;if(a==null)return null;N(U,a.x,a.y);const c=Ee(oe(),[t.x,t.y,r.x,r.y,n.x,n.y,o.x,o.y],[0,0,0,1,1,0,1,1]);return O(U,U,c),w(U[0],U[1])}};i([l({clonable:!1})],T.prototype,"coords",null),i([l({type:d})],T.prototype,"bottomLeft",void 0),i([l({type:d})],T.prototype,"bottomRight",void 0),i([l({type:d})],T.prototype,"topLeft",void 0),i([l({type:d})],T.prototype,"topRight",void 0),T=i([R("esri.layers.support.CornersGeoreference")],T);const Ot=T;let B=class extends X{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:a,y:c}=this.extent.center,u=ie(a,c,this.rotation);s=[u(e,t),u(e,o),u(n,o),u(n,t)],s.push(s[0])}else s=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new ce({rings:[s],spatialReference:r})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),e?.extent==null)return;const{rings:[[n,o,r]],extent:{center:{x:s,y:a}}}=e,c=Xe(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=ie(s,a,-c),[h,y]=u(n[0],n[1]),[g,I]=u(r[0],r[1]);this.extent=new ue({xmin:h,ymin:y,xmax:g,ymax:I,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(e==null||t==null)return null;const{xmin:o,ymin:r,xmax:s,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const h=q(e,u).geometry;if(h==null)return null;let y=h.x,g=h.y;return n&&([y,g]=ie(c.x,c.y,-n)(y,g)),w(fe(y,o,s,0,1),fe(g,a,r,0,1))}};function ie(e,t,n){const o=vt(n),r=Math.cos(o),s=Math.sin(o);return(a,c)=>[r*(a-e)+s*(c-t)+e,r*(c-t)-s*(a-e)+t]}i([l({clonable:!1})],B.prototype,"coords",null),i([l({type:ue})],B.prototype,"extent",void 0),i([l({type:Number})],B.prototype,"rotation",void 0),B=i([R("esri.layers.support.ExtentAndRotationGeoreference")],B);const St=B;function Et(e){return e?.type==="media"}function Me(e,t){const n=Ye(t);return Et(e)&&!!e.portalItem&&n!=null&&n>F.PORTAL_ITEM}function Mt(e,t,n){if(!e||e.type==="control-points")return e;const{coords:o}=e;if(o?.rings[0]?.length!==5)return null;const[r,s,a,c]=o.rings[0],{spatialReference:u}=o;return new Y({controlPoints:[{mapPoint:new d({x:r[0],y:r[1],spatialReference:u}),sourcePoint:w(0,n)},{mapPoint:new d({x:s[0],y:s[1],spatialReference:u}),sourcePoint:w(0,0)},{mapPoint:new d({x:a[0],y:a[1],spatialReference:u}),sourcePoint:w(t,0)},{mapPoint:new d({x:c[0],y:c[1],spatialReference:u}),sourcePoint:w(t,n)}],width:t,height:n})}function Le(e,t,n){return{enabled:!Me(n?.layer,n?.origin),ignoreOrigin:!0}}const je={json:{name:"url",type:String,write:{overridePolicy:Le}}},Te={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:Le}}},Lt={types:{key:"type",base:X,typeMap:{"control-points":Y,corners:Ot,"extent-and-rotation":St}},json:{types:{key:"type",base:X,typeMap:{"control-points":Y}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};let $=class extends Ae(Se(Re)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return Y.fromJSON(e)}writeGeoreference(e,t,n,o){const r=o?.resources?.pendingOperations,s=()=>{const a=Mt(this.georeference,this.contentWidth,this.contentHeight);if(a){if(e.type!=="control-points"&&W.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),a.controlPoints?.length!==4&&o?.messages)return void o.messages.push(new x("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=a.write({},o)}};if(e.type!=="control-points"&&!this.loaded&&r)return t[n]={},void r.push(this.load().then(s));s()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:o}=this;if(e==null||t==null||n===0||o===0)return null;const r=t.toSourceNormalized(e);return r==null?null:(r.x*=n,r.y*=o,r)}};i([l(Lt)],$.prototype,"georeference",void 0),i([K("georeference")],$.prototype,"readGeoreference",null),i([Z("georeference")],$.prototype,"writeGeoreference",null),i([l({json:{read:!1,write:!1}})],$.prototype,"opacity",void 0),$=i([R("esri.layers.support.MediaElementBase")],$);const me=$;let P=class extends me{constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const e=this.image;if(typeof e=="string"){const t=yt(e).then(n=>{this._set("content",n)});this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then(()=>{this._set("content",e)});this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new x("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return Ze(t.url,n)}writeImage(e,t,n,o){if(e==null)return;const r=o?.portalItem,s=o?.resources;if(!r||!s)return void(typeof e=="string"&&(t[n]=ye(e,o)));const a=jt(e)?e:null;if(a){if(be(a)==null)return void(t[n]=a);const c=ye(a,{...o,verifyItemRelativeUrls:o?.verifyItemRelativeUrls?{writtenUrls:o.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},Qe.NO);if(r&&c&&!Ie(c))return s.toKeep.push({resource:r.resourceFromPath(c),compress:!1}),void(t[n]=c)}t[n]="",s.pendingOperations.push(Tt(e).then(c=>{const u=Ht(c,r);t[n]=u.itemRelativeUrl,s.toAdd.push({resource:u,content:{type:"blob",blob:c},compress:!1,finish:h=>{this.image=h.url}})}))}};i([l()],P.prototype,"animationOptions",void 0),i([l({readOnly:!0})],P.prototype,"content",void 0),i([l({readOnly:!0})],P.prototype,"contentWidth",null),i([l({readOnly:!0})],P.prototype,"contentHeight",null),i([l(je)],P.prototype,"image",void 0),i([K("image",["url"])],P.prototype,"readImage",null),i([Z("image")],P.prototype,"writeImage",null),i([l(Te)],P.prototype,"type",void 0),P=i([R("esri.layers.support.ImageElement")],P);const Ce=P;function jt(e){return typeof e=="string"&&!pe(e)&&!de(e)}async function Tt(e){return typeof e=="string"?pe(e)?et(e):(await Oe(e,{responseType:"blob"})).data:new Promise(t=>Ct(e).toBlob(t))}function Ct(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),r=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),o}function Ht(e,t){const n=gt(),o=`${tt("media",n)}.${Pt({type:"blob",blob:e})}`;return t.resourceFromPath(o)}let _=class extends me{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;return typeof e=="string"?this.addResolvingPromise(this._preProcessVideoUrl(e).then(t=>{const n=document.createElement("video");return n.src=t,n.crossOrigin="anonymous",n.autoplay=!0,n.muted=!0,n.loop=!0,n.playsInline=!0,this._loadVideo(n).then(()=>{this._set("content",n)})})):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new x("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):W.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,n,o){if(!e)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source is missing")));const r=$t(e)?e:null;if(!r)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source must be an absolute url")));!Ie(r)&&o?.blockedRelativeUrls&&o.blockedRelativeUrls.push(r);const s=nt(r);be(s)?o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source cannot be an item resource")):t[n]=s}async _preProcessVideoUrl(e){if(ot(e))return ge(e);try{return await Oe(e,{method:"head"}),e}catch{return ge(e,!0)}}_loadVideo(e){return new Promise((t,n)=>{const o=rt(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()});this.addHandles(o,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",de(e.src)||(e.src=e.src))})}};i([l()],_.prototype,"autoplay",void 0),i([l({readOnly:!0})],_.prototype,"content",void 0),i([l({readOnly:!0})],_.prototype,"contentWidth",null),i([l({readOnly:!0})],_.prototype,"contentHeight",null),i([l(je)],_.prototype,"video",null),i([Z("video")],_.prototype,"writeVideo",null),i([l(Te)],_.prototype,"type",void 0),_=i([R("esri.layers.support.VideoElement")],_);const He=_;function $t(e){return typeof e=="string"&&!pe(e)&&!de(e)}const Nt={key:"type",defaultKeyValue:"image",base:me,typeMap:{image:Ce,video:He}},xe=ne.ofType(Nt);let G=class extends Re.LoadableMixin(We(Be.EventedAccessor)){constructor(e){super(e),this._index=new wt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const o of t.removed){const r=this._elementViewsMap.get(o);this._elementViewsMap.delete(o),this._index.delete(r),this.removeHandles(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:n}=this;for(const o of t.added){if(this._elementViewsMap.get(o))continue;const r=new pt({spatialReference:n,element:o});this._elementViewsMap.set(o,r);const s=Ge(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.addHandles(s,r)}this._elementsIndexes.clear(),this.elements.forEach((o,r)=>this._elementsIndexes.set(o,r)),this.emit("refresh")},this.elements=new xe}async load(e){if(ze(e),!this.spatialReference){const t=this.elements.find(n=>n.georeference?.coords!=null);this._set("spatialReference",t?t.georeference.coords.spatialReference:ae.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",Ue(e,this._get("elements"),xe))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new ue({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):W.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await mt(e.spatialReference,this.spatialReference,null,t);const n=De(e.spatialReference,this.spatialReference)?e:ft(e,this.spatialReference);if(!n)return[];const o=n.normalize(),r=[];for(const s of o)this._index.forEachInBounds(Je(s),({normalizedCoords:a,element:c})=>{a!=null&&ke(s,a)&&r.push(c)});return r.sort((s,a)=>this._elementsIndexes.get(s)-this._elementsIndexes.get(a)),r}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,o=this._index.has(e),r=n!=null;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(o!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};i([l()],G.prototype,"elements",null),i([l({readOnly:!0})],G.prototype,"fullExtent",null),i([l()],G.prototype,"spatialReference",null),G=i([R("esri.layers.support.LocalMediaElementSource")],G);const D=G;function le(e){return typeof e=="object"&&e!=null&&"type"in e}function $e(e){return le(e)&&(e.type==="image"||e.type==="video")}let m=class extends lt(ut(at(ct(Se(st))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=Fe(async(t,n,o)=>{const{save:r,saveAs:s}=await it(()=>import("./mediaLayerUtils-CasWezAG-cOVi9TBz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);switch(t){case ee.SAVE:return r(this,n);case ee.SAVE_AS:return s(this,o,n)}}),this.source=new D}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new x("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const o=le(t)?new D({elements:new ne([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference),await o.load(e),this.spatialReference=o.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("source",e):W.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new D({elements:new ne(e)}):e instanceof ne?new D({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const o=this._createSource(t);return o?.read(t,n),o}writeSource(e,t,n,o){if(e&&e instanceof D){const r=e.elements.length;if(r!==1)return void(o?.messages&&o.messages.push(new x("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${r}.`)));e=e.elements.at(0)}$e(e)?e.write(t,o):o?.messages&&(e?o.messages.push(new x("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):o.messages.push(new x("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(ee.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ee.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Ce;case"video":return new He}return null}_getSourceOverride(e,t){if(le(e)&&this.originIdOf("source")===F.PORTAL_ITEM&&t&&(this.originIdOf("georeference")===F.WEB_MAP||this.originIdOf("georeference")===F.WEB_SCENE)){const n=e.toJSON(),o=this._createSource(n);return o.read({...n},{origin:"portal-item"}),o.read({georeference:t},{origin:"web-map"}),o.read({georeference:t},{origin:"web-scene"}),o}return null}};i([l({readOnly:!0})],m.prototype,"effectiveSource",void 0),i([l({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],m.prototype,"georeference",void 0),i([K("web-document","georeference")],m.prototype,"readGeoreference",null),i([l({type:String})],m.prototype,"copyright",void 0),i([l({readOnly:!0})],m.prototype,"fullExtent",null),i([l({type:["MediaLayer"]})],m.prototype,"operationalLayerType",void 0),i([l({type:["show","hide"]})],m.prototype,"listMode",void 0),i([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:Y}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Me(this,n?.origin)&&$e(e)&&!!e.georeference&&e.originIdOf("georeference")>F.PORTAL_ITEM}}}}})],m.prototype,"source",null),i([Ke("source")],m.prototype,"castSource",null),i([K("source",["url"])],m.prototype,"readSource",null),i([Z("source")],m.prototype,"writeSource",null),i([l()],m.prototype,"spatialReference",void 0),i([l({readOnly:!0})],m.prototype,"type",void 0),m=i([R("esri.layers.MediaLayer")],m);const Pn=m;export{Pn as default}; diff --git a/main/assets/MediaLayerInteraction-BecfG-sO-By0KPQxE.js b/main/assets/MediaLayerInteraction-BecfG-sO-By0KPQxE.js deleted file mode 100644 index baa5570dc..000000000 --- a/main/assets/MediaLayerInteraction-BecfG-sO-By0KPQxE.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingTools-BZ3yVmXf-BJsElS9B.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./vec2-tHZ6OaOy-xCj1obDt.js","./common-CYWrYyJl-E8-sukrT.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./enums-CpSG_SL3-BMD3Tb1v.js","./projectVectorToVector-sIYLNlex-CXXu_lyF.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./projectPointToVector-B2UUY9SE-DeA9AEsl.js","./projection-BA9M1R7d-DoNqITCd.js","./elevationInfoUtils-mOZsPH2J-CGmjotSk.js","./ElevationInfo-yv2-9tj6-pjIBBQET.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./UpdatingHandles-CUu3u1ms-D2fDxJPP.js","./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js","./GraphicsCollection-CWTXNZOX-8-_pDOZK.js","./Layer-ChoECxvZ-C4wLrCej.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./BlendLayer-D1WkSmwP-UVXywJXM.js","./jsonUtils-wIllKWI4-DQ36DuUP.js","./parser-DyDJ-rlI-mkgQEqcN.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js","./geodesicUtils-B8mFUfTk-CCpgrgwm.js","./geometryEngine-CdPoFSE4-BRF8cFYX.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-CV-sFImk.js","./Tile-D75RMC64-DprBAZDK.js","./TileKey-C5IL-JBr-0HJjsV9n.js","./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js","./workers-PiCjreoO-oGzLvkSt.js","./ReactiveMap-CFk6jPfN-Dz1UG3IA.js","./signal-CETehA7D-vStzfbaY.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./Query-BrwMGK8U-sojFdYaD.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./MapView-BGOJJ8ch-Dom5daUl.js","./Cyclical-C_9rKUUQ-CmN6QXv-.js","./CollectionFlattener-DkHuHn5E-D3nwGseo.js","./TileInfo-CWIRDhZl-BN68IeQv.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-xQe6qdbF.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Map-1zd11DKO-DdBAdkuj.js","./Basemap-BEqqSTw9-BkQ-c4vY.js","./loadAll-e978YItg-CB-7_cng.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./writeUtils-D5qlLkwk-DIX6zS6N.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./TablesMixin-C8RojhYs-DjK1Q1jj.js","./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DXVwwlDm.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-D-X9O5uh.js","./imageUtils-BA2D6Uf1-BIs7TUww.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-BxOJQpf3.js","./ColorBackground-gVZldRLm-BDCeusMw.js","./quat-BODLR7mS-Bk09s2KF.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./ReactiveSet-QxEZenFW-Cl_EaQiS.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./plane-Dt8R0KeE-fuXvBrPY.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./sphere-BenPORjV-CgNvGf8s.js","./MeshTransform-C--IG09w-B7P01ZzU.js","./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js","./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js","./earcut-XDcq3zAf-BcwyrT7l.js","./triangle-hqU-Tc1X-DRFR6OWE.js","./lineSegment-CcqvCARM-D_SdPttv.js","./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js","./utils-SPbpQbmm-DpAlEmQT.js","./drapedUtils-BZ1SGPtE-DN0L7Y_o.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./boundedPlane-DlvE0eNx-BetNH2zh.js"])))=>i.map(i=>d[i]); -import{j as u,bp as v,a2 as a,k1 as y,aL as l,k2 as g,_ as T,v as r,S as n,i as f}from"./main-BZaw9FpY.js";import{i as w}from"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import{_ as d}from"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";const p={redo:"r",undo:"z"},m=Symbol(),h=Symbol(),c=Symbol();let i=class extends u{constructor(t){super(t),this._tool=null,this._updatingHandles=new w,this.enabled=!1,this._onPointerMove=v(async e=>{const o=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(h),o&&o!==this.selectedElement&&(this.view.cursor="pointer",this.addHandles(a(()=>this.view.cursor=null),h)))})}initialize(){this.addHandles(y(this._updatingHandles)),this._updatingHandles.add(()=>this.enabled,t=>this._setEnabled(t),l),this._updatingHandles.add(()=>this._preferredInteractionTool,()=>this._preferredInteractionToolChanged())}get _validatedSelectedElement(){const t=this.selectedElement;if(!t)return null;const{layer:{source:e}}=this;return e?"hasElement"in e?e.hasElement(t)?t:null:e===t?t:null:null}get _preferredInteractionTool(){return this.options?.tool??"transform"}get updating(){return this._updatingHandles.updating}_setEnabled(t){if(this.removeHandles(m),!t)return;const{view:e}=this;this.addHandles([e.on("immediate-click",o=>this._onClick(o),d.TOOL),e.on("pointer-move",o=>this._onPointerMove(o).catch(()=>{}),d.TOOL),e.on("key-down",o=>{o.key===p.undo&&this._tool?.canUndo()&&(this._tool.undo(),o.stopPropagation()),o.key===p.redo&&this._tool?.canRedo()&&(this._tool.redo(),o.stopPropagation())}),this._updatingHandles.add(()=>this._validatedSelectedElement,o=>this._selectedElementChanged(o),l),a(()=>{e.cursor=null,this._removeTool()})],m)}async _findElementAtScreenPoint(t){const e=(await this.view.hitTest(t,{include:[this.layer]})).results[0];return e?.type==="media"?e.element:null}async _onClick(t){await this._updatingHandles.addPromise(t.async(async()=>{const e=await this._findElementAtScreenPoint(t);this.destroyed||(e&&t.stopPropagation(),this.selectedElement=e,this.selectedElement&&(this.view.cursor=null))}))}_preferredInteractionToolChanged(){const{_tool:t}=this;t&&(this._preferredInteractionTool===t.type||this._updatingHandles.addPromise(this._recreateTool()))}async _recreateTool(){this.removeHandles(c),this._removeTool();const t=this._validatedSelectedElement;if(!t)return;const e=new AbortController;this.addHandles(g(e),c);const{TransformTool:o,ControlPointsTransformTool:_}=await T(()=>import("./editingTools-BZ3yVmXf-BJsElS9B.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95]),import.meta.url);if(e.signal.aborted)return;const{view:s}=this;switch(this._preferredInteractionTool){case"transform":this._tool=new o({target:t,view:s});break;case"reshape":this._tool=new _({mediaElement:t,view:s})}this.addHandles([a(()=>{this._tool&&(s.tools.remove(this._tool),this._tool=null)})],this._tool),s.addAndActivateTool(this._tool)}_removeTool(){this._tool&&this.removeHandles(this._tool)}async _selectedElementChanged(t){t?.georeference?await this._updatingHandles.addPromise(this._recreateTool()):this._removeTool()}};r([n()],i.prototype,"_validatedSelectedElement",null),r([n()],i.prototype,"_preferredInteractionTool",null),r([n({constructOnly:!0})],i.prototype,"view",void 0),r([n({constructOnly:!0})],i.prototype,"layer",void 0),r([n()],i.prototype,"selectedElement",void 0),r([n()],i.prototype,"enabled",void 0),r([n()],i.prototype,"options",void 0),r([n()],i.prototype,"updating",null),i=r([f("esri.views.2d.layers.support.MediaLayerInteraction")],i);export{i as MediaLayerInteraction}; diff --git a/main/assets/MediaLayerInteraction-BecfG-sO-COBbaSNg.js b/main/assets/MediaLayerInteraction-BecfG-sO-COBbaSNg.js new file mode 100644 index 000000000..cae8e29fb --- /dev/null +++ b/main/assets/MediaLayerInteraction-BecfG-sO-COBbaSNg.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingTools-BZ3yVmXf-DYT2ioOm.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./vec2-tHZ6OaOy-xCj1obDt.js","./common-CYWrYyJl-E8-sukrT.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./enums-CpSG_SL3-BMD3Tb1v.js","./projectVectorToVector-sIYLNlex-B5U5xz17.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./projectPointToVector-B2UUY9SE-BWg0qYG-.js","./projection-BA9M1R7d-DXrPfsKU.js","./elevationInfoUtils-mOZsPH2J-Bwot-813.js","./ElevationInfo-yv2-9tj6-CpVy5FM0.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js","./GraphicsLayer-DfeGaYc1-DAZy-iUY.js","./GraphicsCollection-CWTXNZOX-BB4NQ39c.js","./Layer-ChoECxvZ--vVxyMLZ.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./BlendLayer-D1WkSmwP-D_mOfOGH.js","./jsonUtils-wIllKWI4-DRJhEzZa.js","./parser-DyDJ-rlI-CV6nO3M9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js","./geodesicUtils-B8mFUfTk-BoXyQMna.js","./geometryEngine-CdPoFSE4-Bq1o6CJZ.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-wGAJYB2w.js","./Tile-D75RMC64-CM0vKD9b.js","./TileKey-C5IL-JBr-COMthbrT.js","./QueueProcessor-DbfV9fLy-DobN0ur5.js","./workers-PiCjreoO-DqI62TYf.js","./ReactiveMap-CFk6jPfN-CM49HI11.js","./signal-CETehA7D-DxK1orqE.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./Query-BrwMGK8U-DV_czrJX.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./MapView-BGOJJ8ch-CG2YDFKt.js","./Cyclical-C_9rKUUQ-DaQlxz0D.js","./CollectionFlattener-DkHuHn5E-BN4WFIND.js","./TileInfo-CWIRDhZl-CwJ-BCrJ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-J3djxNmP.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Map-1zd11DKO-Bvo5kMfb.js","./Basemap-BEqqSTw9-COwFtp-h.js","./loadAll-e978YItg-NjG3VBGi.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./writeUtils-D5qlLkwk-IaioN2Q8.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./TablesMixin-C8RojhYs-CMxVrapj.js","./HeightModelInfo-C5vFqzyF-DTZiz4z_.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-BziCzZ_c.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-CtQVMDnp.js","./imageUtils-BA2D6Uf1-DyozB2y5.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-BKAqCewj.js","./ColorBackground-gVZldRLm-BdWj-dur.js","./quat-BODLR7mS-Dbd8ftOx.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./ReactiveSet-QxEZenFW-B_-rGoLX.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./plane-Dt8R0KeE-CdQQbSdq.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./sphere-BenPORjV-CiIWUavi.js","./MeshTransform-C--IG09w-QYZk68_K.js","./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./triangle-hqU-Tc1X-0gyFMdne.js","./lineSegment-CcqvCARM-_ZNy9SM-.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js","./diffUtils-Cz3Fi8Xb-BvD0JNhD.js","./cimSymbolUtils-CKIzBgMU-D2oNADot.js","./utils-SPbpQbmm-Dl9Ps2XQ.js","./drapedUtils-BZ1SGPtE-BPt00fGU.js","./colorUtils-Cthpxcks-CXgjba3p.js","./boundedPlane-DlvE0eNx-DhJ9Zyo3.js"])))=>i.map(i=>d[i]); +import{j as u,bp as v,a2 as a,k1 as y,aL as l,k2 as g,_ as T,v as r,S as n,i as f}from"./main-C7yV2j71.js";import{i as w}from"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import{_ as d}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";const p={redo:"r",undo:"z"},m=Symbol(),h=Symbol(),c=Symbol();let i=class extends u{constructor(t){super(t),this._tool=null,this._updatingHandles=new w,this.enabled=!1,this._onPointerMove=v(async e=>{const o=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(h),o&&o!==this.selectedElement&&(this.view.cursor="pointer",this.addHandles(a(()=>this.view.cursor=null),h)))})}initialize(){this.addHandles(y(this._updatingHandles)),this._updatingHandles.add(()=>this.enabled,t=>this._setEnabled(t),l),this._updatingHandles.add(()=>this._preferredInteractionTool,()=>this._preferredInteractionToolChanged())}get _validatedSelectedElement(){const t=this.selectedElement;if(!t)return null;const{layer:{source:e}}=this;return e?"hasElement"in e?e.hasElement(t)?t:null:e===t?t:null:null}get _preferredInteractionTool(){return this.options?.tool??"transform"}get updating(){return this._updatingHandles.updating}_setEnabled(t){if(this.removeHandles(m),!t)return;const{view:e}=this;this.addHandles([e.on("immediate-click",o=>this._onClick(o),d.TOOL),e.on("pointer-move",o=>this._onPointerMove(o).catch(()=>{}),d.TOOL),e.on("key-down",o=>{o.key===p.undo&&this._tool?.canUndo()&&(this._tool.undo(),o.stopPropagation()),o.key===p.redo&&this._tool?.canRedo()&&(this._tool.redo(),o.stopPropagation())}),this._updatingHandles.add(()=>this._validatedSelectedElement,o=>this._selectedElementChanged(o),l),a(()=>{e.cursor=null,this._removeTool()})],m)}async _findElementAtScreenPoint(t){const e=(await this.view.hitTest(t,{include:[this.layer]})).results[0];return e?.type==="media"?e.element:null}async _onClick(t){await this._updatingHandles.addPromise(t.async(async()=>{const e=await this._findElementAtScreenPoint(t);this.destroyed||(e&&t.stopPropagation(),this.selectedElement=e,this.selectedElement&&(this.view.cursor=null))}))}_preferredInteractionToolChanged(){const{_tool:t}=this;t&&(this._preferredInteractionTool===t.type||this._updatingHandles.addPromise(this._recreateTool()))}async _recreateTool(){this.removeHandles(c),this._removeTool();const t=this._validatedSelectedElement;if(!t)return;const e=new AbortController;this.addHandles(g(e),c);const{TransformTool:o,ControlPointsTransformTool:_}=await T(()=>import("./editingTools-BZ3yVmXf-DYT2ioOm.js"),__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95]),import.meta.url);if(e.signal.aborted)return;const{view:s}=this;switch(this._preferredInteractionTool){case"transform":this._tool=new o({target:t,view:s});break;case"reshape":this._tool=new _({mediaElement:t,view:s})}this.addHandles([a(()=>{this._tool&&(s.tools.remove(this._tool),this._tool=null)})],this._tool),s.addAndActivateTool(this._tool)}_removeTool(){this._tool&&this.removeHandles(this._tool)}async _selectedElementChanged(t){t?.georeference?await this._updatingHandles.addPromise(this._recreateTool()):this._removeTool()}};r([n()],i.prototype,"_validatedSelectedElement",null),r([n()],i.prototype,"_preferredInteractionTool",null),r([n({constructOnly:!0})],i.prototype,"view",void 0),r([n({constructOnly:!0})],i.prototype,"layer",void 0),r([n()],i.prototype,"selectedElement",void 0),r([n()],i.prototype,"enabled",void 0),r([n()],i.prototype,"options",void 0),r([n()],i.prototype,"updating",null),i=r([f("esri.views.2d.layers.support.MediaLayerInteraction")],i);export{i as MediaLayerInteraction}; diff --git a/main/assets/MediaLayerView2D-COWFkA3m-DvWbYXdD.js b/main/assets/MediaLayerView2D-COWFkA3m-DvWbYXdD.js deleted file mode 100644 index 31f700b61..000000000 --- a/main/assets/MediaLayerView2D-COWFkA3m-DvWbYXdD.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MediaLayerInteraction-BecfG-sO-By0KPQxE.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./UpdatingHandles-CUu3u1ms-D2fDxJPP.js","./MapView-BGOJJ8ch-Dom5daUl.js","./Cyclical-C_9rKUUQ-CmN6QXv-.js","./CollectionFlattener-DkHuHn5E-D3nwGseo.js","./workers-PiCjreoO-oGzLvkSt.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./TileInfo-CWIRDhZl-BN68IeQv.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-xQe6qdbF.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./signal-CETehA7D-vStzfbaY.js","./Map-1zd11DKO-DdBAdkuj.js","./Basemap-BEqqSTw9-BkQ-c4vY.js","./loadAll-e978YItg-CB-7_cng.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./writeUtils-D5qlLkwk-DIX6zS6N.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-DjK1Q1jj.js","./Layer-ChoECxvZ-C4wLrCej.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./GraphicsCollection-CWTXNZOX-8-_pDOZK.js","./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js","./ReactiveMap-CFk6jPfN-Dz1UG3IA.js","./Query-BrwMGK8U-sojFdYaD.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-DprBAZDK.js","./TileKey-C5IL-JBr-0HJjsV9n.js","./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DXVwwlDm.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-D-X9O5uh.js","./imageUtils-BA2D6Uf1-BIs7TUww.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-BxOJQpf3.js","./ColorBackground-gVZldRLm-BDCeusMw.js"])))=>i.map(i=>d[i]); -import{v as l,S as p,i as b,ag as D,ah as h,ax as E,_ as I,ai as L,b4 as W,aU as Q,a1 as T,n as j,an as $,o as F,bh as B,jb as Z,au as Y,aL as g,hT as U,aF as N,L as R,j as X}from"./main-BZaw9FpY.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{o as G,M as J}from"./perspectiveUtils-Bu88xlbg-Dy8WOySc.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import{c as V}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import{T as K}from"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{H as ee,V as H}from"./Texture-BCt2hphT-D-X9O5uh.js";import{G as te}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-Czob75PE.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./PieChartMeshWriter-C5yLDFwp-CJPWs81O.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-C4elE3ip.js";import"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import{$ as ie,a as re}from"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import{n as se}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as oe}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{T as ae}from"./utils-Dcs650Ic-BihsMOxb.js";import{A as le}from"./OverlayContainer-BEHcBpu0-D3apgE9b.js";import{X as me,Y as pe}from"./LayerView-Bish-E63-DRGspiuk.js";import{i as he}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./TurboLine-CIlsAy5m-BrOlSIM-.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./grouping-RwmXkHDc-CUd3AkxY.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";const O=[1,1],c=se(),de={none:V.None,loop:V.Loop,oscillate:V.Oscillate};function ce(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?de[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}let ue=class extends K{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=oe(),this._handles=new Y,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([h(()=>this.elementView.element.opacity,t=>this.opacity=t,g),h(()=>[this.elementView.coords],()=>{this.requestRender()},g),h(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._handles.remove("play"),this.texture=U(this.texture),this.requestRender()},g),N(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&(this._handles.add([R(t.content,"play",()=>this.requestRender()),R(t.content,"loadeddata",()=>this.requestRender()),R(t.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in t.content?t.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([R(t.content,"seeked",()=>this.requestRender())]),this.requestRender())},g)]),e.element.load().catch(t=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=U(this.texture)}get textureSize(){return O}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,i=this.elementView.element.content;if(i!=null){const r=i instanceof HTMLImageElement,s=i instanceof HTMLVideoElement,a=r?i.naturalWidth:s?i.videoWidth:i.width,n=r?i.naturalHeight:s?i.videoHeight:i.height;if(this._updatePerspectiveTransform(a,n),this.texture)s&&(this.texture.setData(i),this.texture.generateMipmap(),"requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender());else{const o=new ee;if(o.wrapMode=te.CLAMP_TO_EDGE,o.preMultiplyAlpha=!0,o.width=a,o.height=n,"getFrame"in i){const f=d=>{this.texture?this.texture.setData(d):this.texture=new H(t,o,d),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(ae(i,ce(this.elementView.element.animationOptions),null,f),"play")}else this.texture=new H(t,o,i);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender())}}super.beforeRender(e)}_createTransforms(){return null}draw(e,t){this.isReady&&this.texture!=null?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:O,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,i,r){const{coords:s,bounds:a}=this.elementView;if(s==null||a==null)return;const[n,o,f,d]=s.rings[0],k=this._vertices,{x:_,y:v}=e;k.set([o[0]-_,o[1]-v,n[0]-_,n[1]-v,f[0]-_,f[1]-v,d[0]-_,d[1]-v]);let w=t;if(r){const[q,,C]=a,{worldWidth:S,xBounds:z}=r,[A,M]=z;qA?w=S:C>M&&q{let t=class extends e{constructor(...i){super(...i),this.layer=null,this.interactive=!1,this.interactionOptions=new x,this.selectedElement=null}};return l([p()],t.prototype,"layer",void 0),l([p()],t.prototype,"interactive",void 0),l([p()],t.prototype,"interactionOptions",void 0),l([p()],t.prototype,"selectedElement",void 0),t=l([b("esri.views.layers.MediaLayerView")],t),t};let y=class extends me(ye(pe)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new D}initialize(){this.addHandles([h(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await I(()=>import("./MediaLayerInteraction-BecfG-sO-By0KPQxE.js"),__vite__mapDeps([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,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,52,53,54,55,56]),import.meta.url);this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},E),h(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},E),h(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},E)])}attach(){this.addAttachHandles([L(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),L(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new le,this.container.addChild(this._overlayContainer),this._fetchQueue=new ie({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:he.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new re({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y];for(const{elementView:{normalizedCoords:a,element:n}}of this._elementReferences.values())a!=null&&W(a.rings,s)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new fe(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},t=>{Q(t)||T.getLogger(this).error(t)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(i==null)return[];this.view.featuresTilingScheme.getTileBounds(m,e,!0);const r=new j({xmin:m[0],ymin:m[1],xmax:m[2],ymax:m[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(this.layer.source!=null)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){$(this._elementReferences,t.uid,()=>{const i=new G({element:t,spatialReference:this.view.spatialReference}),r=new ue(i);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(s=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:t,error:s}))})),{debugGraphic:null,elementView:i,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.elementView.normalizedCoords;if(r==null)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],a=[];for(const n of this._tileStrategy.tiles){const o=P(this.view.featuresTilingScheme,n,r);t.tiles.has(n)?o||a.push(n):o&&s.push(n)}for(const n of s)this._referenceElement(n,e);for(const n of a)this._dereferenceElement(n,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new G({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(i!=null)for(const r of this._tileStrategy.tiles)P(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}};l([p()],y.prototype,"layer",void 0),l([p({readOnly:!0})],y.prototype,"elements",void 0),y=l([b("esri.views.2d.layers.MediaLayerView2D")],y);const m=B(),u={xmin:0,ymin:0,xmax:0,ymax:0};function P(e,t,i){return e.getTileBounds(m,t.key,!0),u.xmin=m[0],u.ymin=m[1],u.xmax=m[2],u.ymax=m[3],Z(u,i)}class fe{constructor(t){this.key=t,this.elements=null,this.isReady=!1,this.visible=!0}setElements(t){const i=[],r=new Set(this.elements);this.elements=t;for(const s of t)r.has(s)?r.delete(s):i.push(s);return this.isReady=!0,[i,Array.from(r)]}destroy(){}}const Gi=y;export{Gi as default}; diff --git a/main/assets/MediaLayerView2D-COWFkA3m-u82xL1PC.js b/main/assets/MediaLayerView2D-COWFkA3m-u82xL1PC.js new file mode 100644 index 000000000..d3e4029f5 --- /dev/null +++ b/main/assets/MediaLayerView2D-COWFkA3m-u82xL1PC.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MediaLayerInteraction-BecfG-sO-COBbaSNg.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js","./MapView-BGOJJ8ch-CG2YDFKt.js","./Cyclical-C_9rKUUQ-DaQlxz0D.js","./CollectionFlattener-DkHuHn5E-BN4WFIND.js","./workers-PiCjreoO-DqI62TYf.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./TileInfo-CWIRDhZl-CwJ-BCrJ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-J3djxNmP.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./signal-CETehA7D-DxK1orqE.js","./Map-1zd11DKO-Bvo5kMfb.js","./Basemap-BEqqSTw9-COwFtp-h.js","./loadAll-e978YItg-NjG3VBGi.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./writeUtils-D5qlLkwk-IaioN2Q8.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-CMxVrapj.js","./Layer-ChoECxvZ--vVxyMLZ.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./GraphicsCollection-CWTXNZOX-BB4NQ39c.js","./HeightModelInfo-C5vFqzyF-DTZiz4z_.js","./ReactiveMap-CFk6jPfN-CM49HI11.js","./Query-BrwMGK8U-DV_czrJX.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-CM0vKD9b.js","./TileKey-C5IL-JBr-COMthbrT.js","./QueueProcessor-DbfV9fLy-DobN0ur5.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-BziCzZ_c.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-CtQVMDnp.js","./imageUtils-BA2D6Uf1-DyozB2y5.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-BKAqCewj.js","./ColorBackground-gVZldRLm-BdWj-dur.js"])))=>i.map(i=>d[i]); +import{v as l,S as p,i as b,ag as D,ah as h,ax as E,_ as I,ai as L,b4 as W,aU as Q,a1 as T,n as j,an as $,o as F,bh as B,jb as Z,au as Y,aL as g,hT as U,aF as N,L as R,j as X}from"./main-C7yV2j71.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{o as G,M as J}from"./perspectiveUtils-Bu88xlbg-DmCqcrzQ.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import{c as V}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import{T as K}from"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{H as ee,V as H}from"./Texture-BCt2hphT-CtQVMDnp.js";import{G as te}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-Btv2jyXK.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./PieChartMeshWriter-C5yLDFwp-0zzyhiO2.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-n0h7HuaO.js";import"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import{$ as ie,a as re}from"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import{n as se}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as oe}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{T as ae}from"./utils-Dcs650Ic-CVi_9hJ-.js";import{A as le}from"./OverlayContainer-BEHcBpu0-Bl-u4lo3.js";import{X as me,Y as pe}from"./LayerView-Bish-E63-I2LV0oDm.js";import{i as he}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./TurboLine-CIlsAy5m-Q2LH92mI.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./grouping-RwmXkHDc-Cfuv9DrK.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";const O=[1,1],c=se(),de={none:V.None,loop:V.Loop,oscillate:V.Oscillate};function ce(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?de[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}let ue=class extends K{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=oe(),this._handles=new Y,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([h(()=>this.elementView.element.opacity,t=>this.opacity=t,g),h(()=>[this.elementView.coords],()=>{this.requestRender()},g),h(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._handles.remove("play"),this.texture=U(this.texture),this.requestRender()},g),N(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&(this._handles.add([R(t.content,"play",()=>this.requestRender()),R(t.content,"loadeddata",()=>this.requestRender()),R(t.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in t.content?t.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([R(t.content,"seeked",()=>this.requestRender())]),this.requestRender())},g)]),e.element.load().catch(t=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=U(this.texture)}get textureSize(){return O}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,i=this.elementView.element.content;if(i!=null){const r=i instanceof HTMLImageElement,s=i instanceof HTMLVideoElement,a=r?i.naturalWidth:s?i.videoWidth:i.width,n=r?i.naturalHeight:s?i.videoHeight:i.height;if(this._updatePerspectiveTransform(a,n),this.texture)s&&(this.texture.setData(i),this.texture.generateMipmap(),"requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender());else{const o=new ee;if(o.wrapMode=te.CLAMP_TO_EDGE,o.preMultiplyAlpha=!0,o.width=a,o.height=n,"getFrame"in i){const f=d=>{this.texture?this.texture.setData(d):this.texture=new H(t,o,d),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(ae(i,ce(this.elementView.element.animationOptions),null,f),"play")}else this.texture=new H(t,o,i);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender())}}super.beforeRender(e)}_createTransforms(){return null}draw(e,t){this.isReady&&this.texture!=null?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:O,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,i,r){const{coords:s,bounds:a}=this.elementView;if(s==null||a==null)return;const[n,o,f,d]=s.rings[0],k=this._vertices,{x:_,y:v}=e;k.set([o[0]-_,o[1]-v,n[0]-_,n[1]-v,f[0]-_,f[1]-v,d[0]-_,d[1]-v]);let w=t;if(r){const[q,,C]=a,{worldWidth:S,xBounds:z}=r,[A,M]=z;qA?w=S:C>M&&q{let t=class extends e{constructor(...i){super(...i),this.layer=null,this.interactive=!1,this.interactionOptions=new x,this.selectedElement=null}};return l([p()],t.prototype,"layer",void 0),l([p()],t.prototype,"interactive",void 0),l([p()],t.prototype,"interactionOptions",void 0),l([p()],t.prototype,"selectedElement",void 0),t=l([b("esri.views.layers.MediaLayerView")],t),t};let y=class extends me(ye(pe)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new D}initialize(){this.addHandles([h(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await I(()=>import("./MediaLayerInteraction-BecfG-sO-COBbaSNg.js"),__vite__mapDeps([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,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,52,53,54,55,56]),import.meta.url);this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},E),h(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},E),h(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},E)])}attach(){this.addAttachHandles([L(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),L(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new le,this.container.addChild(this._overlayContainer),this._fetchQueue=new ie({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:he.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new re({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y];for(const{elementView:{normalizedCoords:a,element:n}}of this._elementReferences.values())a!=null&&W(a.rings,s)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new fe(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},t=>{Q(t)||T.getLogger(this).error(t)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(i==null)return[];this.view.featuresTilingScheme.getTileBounds(m,e,!0);const r=new j({xmin:m[0],ymin:m[1],xmax:m[2],ymax:m[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(this.layer.source!=null)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){$(this._elementReferences,t.uid,()=>{const i=new G({element:t,spatialReference:this.view.spatialReference}),r=new ue(i);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(s=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:t,error:s}))})),{debugGraphic:null,elementView:i,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.elementView.normalizedCoords;if(r==null)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],a=[];for(const n of this._tileStrategy.tiles){const o=P(this.view.featuresTilingScheme,n,r);t.tiles.has(n)?o||a.push(n):o&&s.push(n)}for(const n of s)this._referenceElement(n,e);for(const n of a)this._dereferenceElement(n,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new G({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(i!=null)for(const r of this._tileStrategy.tiles)P(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}};l([p()],y.prototype,"layer",void 0),l([p({readOnly:!0})],y.prototype,"elements",void 0),y=l([b("esri.views.2d.layers.MediaLayerView2D")],y);const m=B(),u={xmin:0,ymin:0,xmax:0,ymax:0};function P(e,t,i){return e.getTileBounds(m,t.key,!0),u.xmin=m[0],u.ymin=m[1],u.xmax=m[2],u.ymax=m[3],Z(u,i)}class fe{constructor(t){this.key=t,this.elements=null,this.isReady=!1,this.visible=!0}setElements(t){const i=[],r=new Set(this.elements);this.elements=t;for(const s of t)r.has(s)?r.delete(s):i.push(s);return this.isReady=!0,[i,Array.from(r)]}destroy(){}}const Gi=y;export{Gi as default}; diff --git a/main/assets/MemorySourceWorker-C9E3Klf8-DKk2aI7B.js b/main/assets/MemorySourceWorker-C9E3Klf8-DKk2aI7B.js new file mode 100644 index 000000000..f599b6d8a --- /dev/null +++ b/main/assets/MemorySourceWorker-C9E3Klf8-DKk2aI7B.js @@ -0,0 +1 @@ +import{o as I,gT as Z,cX as $,cY as Q,bK as b,ft as M,cM as v}from"./main-C7yV2j71.js";import{A as O,j as A,k}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{r as C,i as P}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{I as G}from"./FeatureStore-Co2V0sVE-BoTs_3tu.js";import{f as E,h as _}from"./queryUtils-Brxu6254-T3UhaATW.js";import{Z as W}from"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import{f as z,d as H,A as L}from"./clientSideDefaults-BqqayPct-B0cLE-po.js";import{G as Y,c as g,F as T,j,x as w}from"./sourceUtils-BMeqkJ5g-C2dbTHus.js";import{o as D}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{i as U}from"./fieldType-CD2CL2hr-B1iISniv.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-mEMXylgh.js";import"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./signal-CETehA7D-DxK1orqE.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./date-Cqvy-TgA-DIf-QFLz.js";const B=M,J={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:M},K={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0}};function N(h){return v(h)?h.z!=null:!!h.hasZ}function V(h){return v(h)?h.m!=null:!!h.hasM}class Be{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const r=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),l=e.fields||[],d=e.hasM!=null?e.hasM:!!n.hasM,f=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,u=p?B:e.spatialReference||n.spatialReference,y=p?J:null,c=e.geometryType||n.geometryType,o=!c;let t=e.objectIdField||n.objectIdField,s=e.timeInfo;const m=new D(l);if(!o&&(p&&r.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!c))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(r.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const i=m.get(t);i?(t=i.name,i.type="esriFieldTypeOID",i.editable=!1,i.nullable=!1):l.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const i of l){if(i.name==null&&(i.name=i.alias),i.alias==null&&(i.alias=i.name),!i.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:i});if(i.name===t&&(i.type="esriFieldTypeOID"),!U.jsonValues.includes(i.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${i.name}"`,{field:i});i.length==null&&(i.length=Z(i))}const F={};for(const i of l)if(i.type!=="esriFieldTypeOID"&&i.type!=="esriFieldTypeGlobalID"){const q=$(i);q!==void 0&&(F[i.name]=q)}if(s){if(s.startTimeField){const i=m.get(s.startTimeField);i?(s.startTimeField=i.name,i.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const i=m.get(s.endTimeField);i?(s.endTimeField=i.name,i.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const i=m.get(s.trackIdField);i?s.trackIdField=i.name:(s.trackIdField=null,r.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.startTimeField||s.endTimeField||(r.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:s}}),s=null)}const x=m.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??Q}:null;this._createDefaultAttributes=z(F,t);const R={warnings:r,featureErrors:[],layerDefinition:{...K,drawingInfo:H(c),templates:L(F),extent:y,geometryType:c,objectIdField:t,fields:l,hasZ:f,hasM:d,timeInfo:s,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:D.fromLayerJSON({fields:l,timeInfo:s,dateFieldsTimeReference:x}),geometryType:c,hasM:d,hasZ:f,objectIdField:t,spatialReference:u,featureStore:new G({geometryType:c,hasM:d,hasZ:f}),timeInfo:s}),!a?.length)return this._nextObjectId=C,R;const S=P(t,a);return this._nextObjectId=S+1,await E(a,u),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:r,geometryType:a}=this._queryEngine;return await Promise.all([Y(r,a),E(e.adds,r),E(e.updates,r)]),this._applyEdits(e)}queryFeatures(e,r={}){return this._queryEngine.executeQuery(e,r.signal)}queryFeatureCount(e,r={}){return this._queryEngine.executeQueryForCount(e,r.signal)}queryObjectIds(e,r={}){return this._queryEngine.executeQueryForIds(e,r.signal)}queryExtent(e,r={}){return this._queryEngine.executeQueryForExtent(e,r.signal)}querySnapping(e,r={}){return this._queryEngine.executeQueryForSnapping(e,r.signal)}_inferLayerProperties(e,r){let a,n,l=null,d=null,f=null;for(const p of e){const u=p.geometry;if(u!=null&&(l||(l=b(u)),d||(d=u.spatialReference),a==null&&(a=N(u)),n==null&&(n=V(u)),l&&d&&a!=null&&n!=null))break}if(r&&r.length){let p=null;r.some(u=>{const y=u.type==="esriFieldTypeOID",c=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return p=u,y||c})&&(f=p.name)}return{geometryType:l,spatialReference:d,objectIdField:f,hasM:n,hasZ:a}}async _loadInitialFeatures(e,r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:f,featureStore:p,fieldsIndex:u}=this._queryEngine,y=[];for(const t of r){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==b(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const s=this._createDefaultAttributes(),m=T(u,s,t.attributes,!0);m?e.featureErrors.push(m):(this._assignObjectId(s,t.attributes,!0),t.attributes=s,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[d]),t.geometry!=null&&(t.geometry=_(t.geometry,t.geometry.spatialReference,f)),y.push(t))}p.addMany(O([],y,a,l,n,d));const{fullExtent:c,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,o){const{start:t,end:s}=o;e.layerDefinition.timeInfo.timeExtent=[t,s]}return e}async _applyEdits(e){const{adds:r,updates:a,deletes:n}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(r?.length&&this._applyAddEdits(l,r),a?.length&&this._applyUpdateEdits(l,a),n?.length){for(const p of n)l.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:d,timeExtent:f}=await this._queryEngine.fetchRecomputedExtents();return{extent:d,timeExtent:f,featureEditResults:l}}_applyAddEdits(e,r){const{addResults:a}=e,{geometryType:n,hasM:l,hasZ:d,objectIdField:f,spatialReference:p,featureStore:u,fieldsIndex:y}=this._queryEngine,c=[];for(const o of r){if(o.geometry&&n!==b(o.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),s=T(y,t,o.attributes);if(s)a.push(s);else{if(this._assignObjectId(t,o.attributes),o.attributes=t,o.uid!=null){const m=o.attributes[f];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??p;o.geometry=_(w(o.geometry,m),m,p)}c.push(o),a.push(j(o.attributes[f]))}}u.addMany(O([],c,n,d,l,f))}_applyUpdateEdits({updateResults:e},r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:f,featureStore:p,fieldsIndex:u}=this._queryEngine;for(const y of r){const{attributes:c,geometry:o}=y,t=c?.[d];if(t==null){e.push(g(`Identifier field ${d} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const s=A(p.getFeature(t),a,l,n);if(o!=null){if(a!==b(o)){e.push(g("Incorrect geometry type."));continue}const m=o.spatialReference??f;s.geometry=_(w(o,m),m,f)}if(c){const m=T(u,s.attributes,c);if(m){e.push(m);continue}}p.add(k(s,a,l,n,d)),e.push(j(t))}}_assignObjectId(e,r,a=!1){const n=this._queryEngine.objectIdField;a&&r&&isFinite(r[n])?e[n]=r[n]:e[n]=this._nextObjectId++}}export{Be as default}; diff --git a/main/assets/MemorySourceWorker-C9E3Klf8-DduNQ4qJ.js b/main/assets/MemorySourceWorker-C9E3Klf8-DduNQ4qJ.js deleted file mode 100644 index d70e006b9..000000000 --- a/main/assets/MemorySourceWorker-C9E3Klf8-DduNQ4qJ.js +++ /dev/null @@ -1 +0,0 @@ -import{o as I,gT as Z,cX as $,cY as Q,bK as b,ft as M,cM as v}from"./main-BZaw9FpY.js";import{A as O,j as A,k}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{r as C,i as P}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{I as G}from"./FeatureStore-Co2V0sVE-CXrTGv5U.js";import{f as E,h as _}from"./queryUtils-Brxu6254-DDAvXp_C.js";import{Z as W}from"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import{f as z,d as H,A as L}from"./clientSideDefaults-BqqayPct-BMC57bnT.js";import{G as Y,c as g,F as T,j,x as w}from"./sourceUtils-BMeqkJ5g-CD_x4f6t.js";import{o as D}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{i as U}from"./fieldType-CD2CL2hr-BAgRuESI.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-DBAJ8yky.js";import"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./signal-CETehA7D-vStzfbaY.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./date-Cqvy-TgA-DIf-QFLz.js";const B=M,J={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:M},K={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0}};function N(h){return v(h)?h.z!=null:!!h.hasZ}function V(h){return v(h)?h.m!=null:!!h.hasM}class Be{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const r=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),l=e.fields||[],d=e.hasM!=null?e.hasM:!!n.hasM,f=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,u=p?B:e.spatialReference||n.spatialReference,y=p?J:null,c=e.geometryType||n.geometryType,o=!c;let t=e.objectIdField||n.objectIdField,s=e.timeInfo;const m=new D(l);if(!o&&(p&&r.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!c))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(r.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const i=m.get(t);i?(t=i.name,i.type="esriFieldTypeOID",i.editable=!1,i.nullable=!1):l.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const i of l){if(i.name==null&&(i.name=i.alias),i.alias==null&&(i.alias=i.name),!i.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:i});if(i.name===t&&(i.type="esriFieldTypeOID"),!U.jsonValues.includes(i.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${i.name}"`,{field:i});i.length==null&&(i.length=Z(i))}const F={};for(const i of l)if(i.type!=="esriFieldTypeOID"&&i.type!=="esriFieldTypeGlobalID"){const q=$(i);q!==void 0&&(F[i.name]=q)}if(s){if(s.startTimeField){const i=m.get(s.startTimeField);i?(s.startTimeField=i.name,i.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const i=m.get(s.endTimeField);i?(s.endTimeField=i.name,i.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const i=m.get(s.trackIdField);i?s.trackIdField=i.name:(s.trackIdField=null,r.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.startTimeField||s.endTimeField||(r.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:s}}),s=null)}const x=m.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??Q}:null;this._createDefaultAttributes=z(F,t);const R={warnings:r,featureErrors:[],layerDefinition:{...K,drawingInfo:H(c),templates:L(F),extent:y,geometryType:c,objectIdField:t,fields:l,hasZ:f,hasM:d,timeInfo:s,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:D.fromLayerJSON({fields:l,timeInfo:s,dateFieldsTimeReference:x}),geometryType:c,hasM:d,hasZ:f,objectIdField:t,spatialReference:u,featureStore:new G({geometryType:c,hasM:d,hasZ:f}),timeInfo:s}),!a?.length)return this._nextObjectId=C,R;const S=P(t,a);return this._nextObjectId=S+1,await E(a,u),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:r,geometryType:a}=this._queryEngine;return await Promise.all([Y(r,a),E(e.adds,r),E(e.updates,r)]),this._applyEdits(e)}queryFeatures(e,r={}){return this._queryEngine.executeQuery(e,r.signal)}queryFeatureCount(e,r={}){return this._queryEngine.executeQueryForCount(e,r.signal)}queryObjectIds(e,r={}){return this._queryEngine.executeQueryForIds(e,r.signal)}queryExtent(e,r={}){return this._queryEngine.executeQueryForExtent(e,r.signal)}querySnapping(e,r={}){return this._queryEngine.executeQueryForSnapping(e,r.signal)}_inferLayerProperties(e,r){let a,n,l=null,d=null,f=null;for(const p of e){const u=p.geometry;if(u!=null&&(l||(l=b(u)),d||(d=u.spatialReference),a==null&&(a=N(u)),n==null&&(n=V(u)),l&&d&&a!=null&&n!=null))break}if(r&&r.length){let p=null;r.some(u=>{const y=u.type==="esriFieldTypeOID",c=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return p=u,y||c})&&(f=p.name)}return{geometryType:l,spatialReference:d,objectIdField:f,hasM:n,hasZ:a}}async _loadInitialFeatures(e,r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:f,featureStore:p,fieldsIndex:u}=this._queryEngine,y=[];for(const t of r){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==b(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const s=this._createDefaultAttributes(),m=T(u,s,t.attributes,!0);m?e.featureErrors.push(m):(this._assignObjectId(s,t.attributes,!0),t.attributes=s,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[d]),t.geometry!=null&&(t.geometry=_(t.geometry,t.geometry.spatialReference,f)),y.push(t))}p.addMany(O([],y,a,l,n,d));const{fullExtent:c,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,o){const{start:t,end:s}=o;e.layerDefinition.timeInfo.timeExtent=[t,s]}return e}async _applyEdits(e){const{adds:r,updates:a,deletes:n}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(r?.length&&this._applyAddEdits(l,r),a?.length&&this._applyUpdateEdits(l,a),n?.length){for(const p of n)l.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:d,timeExtent:f}=await this._queryEngine.fetchRecomputedExtents();return{extent:d,timeExtent:f,featureEditResults:l}}_applyAddEdits(e,r){const{addResults:a}=e,{geometryType:n,hasM:l,hasZ:d,objectIdField:f,spatialReference:p,featureStore:u,fieldsIndex:y}=this._queryEngine,c=[];for(const o of r){if(o.geometry&&n!==b(o.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),s=T(y,t,o.attributes);if(s)a.push(s);else{if(this._assignObjectId(t,o.attributes),o.attributes=t,o.uid!=null){const m=o.attributes[f];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??p;o.geometry=_(w(o.geometry,m),m,p)}c.push(o),a.push(j(o.attributes[f]))}}u.addMany(O([],c,n,d,l,f))}_applyUpdateEdits({updateResults:e},r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:f,featureStore:p,fieldsIndex:u}=this._queryEngine;for(const y of r){const{attributes:c,geometry:o}=y,t=c?.[d];if(t==null){e.push(g(`Identifier field ${d} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const s=A(p.getFeature(t),a,l,n);if(o!=null){if(a!==b(o)){e.push(g("Incorrect geometry type."));continue}const m=o.spatialReference??f;s.geometry=_(w(o,m),m,f)}if(c){const m=T(u,s.attributes,c);if(m){e.push(m);continue}}p.add(k(s,a,l,n,d)),e.push(j(t))}}_assignObjectId(e,r,a=!1){const n=this._queryEngine.objectIdField;a&&r&&isFinite(r[n])?e[n]=r[n]:e[n]=this._nextObjectId++}}export{Be as default}; diff --git a/main/assets/Mesh-DLzjDUIO-B17ONcIN.js b/main/assets/Mesh-DLzjDUIO-B17ONcIN.js new file mode 100644 index 000000000..ce1c0b490 --- /dev/null +++ b/main/assets/Mesh-DLzjDUIO-B17ONcIN.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loadGLTFMesh-C3-0Tu0H-BMXr1y1a.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js","./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./BufferView-PQoE3GL7-M6q1od-Y.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec3-BazNroeq-Cdhfm-VN.js","./vec4-DWDdg1fj-DGtcegeJ.js","./types-ChhhI6OU-Cxh6dPlX.js","./loader-CkLCe-E_-Cx46HvSP.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-BKAqCewj.js","./mat4-DX7gBViE-vewreEuZ.js","./quat-BODLR7mS-Dbd8ftOx.js","./quatf64-C16JxGFv-BKWK1F8U.js","./resourceUtils-Ds65naCv-DTjz-__I.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./DefaultMaterial_COLOR_GAMMA-D0o2czi9-zo16r_JO.js","./Indices-DEr2HrWx-Cd6y9wum.js","./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js","./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./projectPointToVector-B2UUY9SE-BWg0qYG-.js","./projection-BA9M1R7d-DXrPfsKU.js","./MeshTransform-C--IG09w-QYZk68_K.js","./imageUtils-BA2D6Uf1-DyozB2y5.js","./earcut-XDcq3zAf-BcwyrT7l.js","./plane-Dt8R0KeE-CdQQbSdq.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./deduplicate-D2d-E5Pw-eujRBTUy.js","./External-D_wl4XAw-Bzqlxz38.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./gltfexport-Dj6nF2RN-BRI_tJ3X.js"])))=>i.map(i=>d[i]); +import{v as u,S as f,du as Ut,ac as Pt,a0 as Wt,i as B,aa as Nt,ar as nt,ad as Pe,jh as Oe,aB as Bt,at as zt,ah as Ht,gU as Vt,ji as kt,jj as Se,w as O,hZ as Re,_ as Me,$ as xe,l as Gt,a_ as ot,bu as Zt,o as re,e as ve,ez as We,aO as _e,a1 as se,P as Te,jk as qt,jl as Yt,D as ae,i9 as L,dU as R,jm as Kt,jn as Ne,n as Xt,a5 as Jt,d9 as Qt,bf as er,x as tr,aS as rr,aP as nr,ag as or,ai as sr,fj as ir,h_ as we,d as ar,bj as lr,p as cr,dV as ur,hl as pr}from"./main-C7yV2j71.js";import{s as st,R as hr,V as ne,c as it,S as ue,Q as at}from"./MeshTransform-C--IG09w-QYZk68_K.js";import{g as fr}from"./imageUtils-BA2D6Uf1-DyozB2y5.js";import{u as mr,o as pe,g as dr}from"./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js";import{y as he,d as De}from"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import{m as gr,t as ie,x as fe,d as lt}from"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import{m as yr}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{w as ct}from"./Indices-DEr2HrWx-Cd6y9wum.js";import{r as xr,j as vr,Z as Le,l as wr,_ as me,Q as ut,Y as br,L as Tr}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{y as Ar,N as Sr,K as Rr}from"./plane-Dt8R0KeE-CdQQbSdq.js";import{v as Be}from"./deduplicate-D2d-E5Pw-eujRBTUy.js";import{p as I}from"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import{g as A,b as $e,Y as Mr,L as pt,a as ht,e as ft,c as mt,l as dt,o as gt,f as yt,M as P}from"./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js";import{t as be}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{J as _r}from"./projection-BA9M1R7d-DXrPfsKU.js";import{x as Ee}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import{G as xt}from"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import{n as Dr}from"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import{b as ze,P as Lr}from"./vec3-BazNroeq-Cdhfm-VN.js";import{B as He,T as $r,M as jr}from"./External-D_wl4XAw-Bzqlxz38.js";import{n as vt}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{P as Cr}from"./mat3-CC4Foazl-BWjyqE2v.js";import{t as wt,B as bt,$ as Tt,N as At,W as St,K as Fr}from"./mat4-DX7gBViE-vewreEuZ.js";import{A as Or}from"./quat-BODLR7mS-Dbd8ftOx.js";import{e as Er,n as Ir}from"./quatf64-C16JxGFv-BKWK1F8U.js";var k;const Ae=new WeakMap;let Ur=0,C=k=class extends ve{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:We(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o={type:"canvas-element",imageData:Ve(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[n]=o}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:We(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const o={type:"image-data",imageData:Ve(e)};t[n]=o}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=ke(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return ke(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this;return e instanceof HTMLCanvasElement?Ge(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?Ge(e):!(!t?.toLowerCase().endsWith(".png")&&!t?.toLocaleLowerCase().startsWith("data:image/png;"))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(n="")=>`d:${n},t:${this.transparent},w:${e}`;return this.url!=null?t(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(Ae.has(this.data)||Ae.set(this.data,++Ur),t(Ae.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=this.url!=null?this.url.length:0,this.data!=null){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new k(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}static from(e){return typeof e=="string"?new k({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new k({data:e}):_e(k,e)}};function Ve(e){let t="";for(let n=0;nMath.cos(lr(80))?L.Z:Math.abs(r[1])>Math.abs(r[0])?L.Y:L.X}function Hr(e,t,n,r){const o=(i=>!Array.isArray(i[0]))(t)?(i,a)=>t[3*i+a]:(i,a)=>t[i][a],s=r?cr(r)/ur(r):1;return Rr(e,(i,a)=>me(i,o(a,0)*s,o(a,1)*s,o(a,2)),n)}const qe=Ar();function Vr(e){const t=Gr(e.rings,e.hasZ,de.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const a of t.polygons){const c=a.count,l=a.index,h=qt(t.position,3*l,3*c),m=a.holeIndices.map(d=>d-l),p=ct(yr(h,m,3));n.push({position:h,faces:p}),r+=h.length,o+=p.length}const s=kr(n,r,o),i=Array.isArray(s.position)?Be(s.position,3,{originalIndices:s.faces}):Be(s.position.buffer,6,{originalIndices:s.faces});return s.position=Yt(new Float64Array(i.buffer)),s.faces=i.indices,s}function kr(e,t,n){if(e.length===1)return e[0];const r=Oe(t),o=new Array(n);let s=0,i=0,a=0;for(const c of e){for(let l=0;l=0;g--){const y=e[g],b=n===de.CCW_IS_HOLE&&Zr(y,t,r);if(b&&o!==1)s[l++]=y;else{let M=y.length;for(let x=0;x0&&(a[m++]={index:d,count:y.length}),d=b?le(y,y.length-1,-1,p,d,y.length,t):le(y,0,1,p,d,y.length,t);for(let x=0;x0&&(a[m++]={index:d,count:w.length}),d=le(w,0,1,p,d,w.length,t)}l=0,T.count>0&&(i[h++]=T)}}for(let g=0;g0&&(a[m++]={index:d,count:y.length}),d=le(y,0,1,p,d,y.length,t)}return i.length=h,a.length=m,{position:p,polygons:i,outlines:a}}function le(e,t,n,r,o,s,i){o*=3;for(let a=0;ase.getLogger("esri.geometry.support.meshUtils.centerAt");function qr(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,o=n?.origin??e.origin,s=Ue(oe,r,o.spatialReference,n?.geographic);ie(r)?Yr(e,t,o):s?Kr(e,t,o):Xr(e,t,o)}function Yr(e,t,n){const{vertexSpace:r}=e;if(!ie(r))return;const o=Mt,s=Rt;if(!I(t,s,e.spatialReference))return void A(oe(),t.spatialReference,e.spatialReference,P);if(!I(n,o,e.spatialReference)){const a=e.origin;return o[0]=a.x,o[1]=a.y,o[2]=a.z,void A(oe(),n.spatialReference,e.spatialReference,P)}const i=xr(Qr,s,o);r.origin=vr(R(),r.origin,i)}function Kr(e,t,n){const r=Re(n.x,n.y,n.z??0),o=$e(e,new De({origin:r}));if(!o)return;const s=Re(t.x,t.y,t.z??0),i=$e({vertexAttributes:o,spatialReference:e.spatialReference,vertexSpace:new De({origin:s})},he.absolute);if(!i)return;const{position:a,normal:c,tangent:l}=i;e.vertexAttributes.position=a,e.vertexAttributes.normal=c,e.vertexAttributes.tangent=l,e.vertexAttributesChanged()}function Xr(e,t,n){const r=Mt,o=Rt;if(I(t,o,e.spatialReference)){if(!I(n,r,e.spatialReference)){const s=e.origin;return r[0]=s.x,r[1]=s.y,r[2]=s.z,void A(oe(),n.spatialReference,e.spatialReference,P)}Jr(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else A(oe(),t.spatialReference,e.spatialReference,P)}function Jr(e,t,n){if(e)for(let r=0;rimport("./loadGLTFMesh-C3-0Tu0H-BMXr1y1a.js"),__vite__mapDeps([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,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url),n),s=await on(r,n);xe(n);const i=o(new O({x:0,y:0,z:0,spatialReference:e.spatialReference}),s.url,{resolveFile:nn(s),signal:n?.signal,expectedType:s.type,unitConversionDisabled:t.unitConversionDisabled});i.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:c}=await i;e.vertexAttributes=a,e.components=c}function nn(e){const t=Jt(e.url);return n=>{const r=Qt(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}async function on(e,t){if(Array.isArray(e)){if(!e.length)throw new re("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?an(e):ln(e,t)}return _t(e)}async function sn(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(n.length===1)return new ge(n[0].partUrl);const s=await e.toBlob(t);return xe(t),ge.fromBlob(s,Ct(o,r))}function _t(e){return ge.fromBlob(e,Ct(e.name,e.type))}function an(e){return $t(e.map(t=>({name:t.name,mimeType:t.type,source:_t(t)})))}async function ln(e,t){const n=await er(e.map(async r=>{const o=await sn(r);return xe(t),{name:r.assetName,mimeType:r.assetMimeType,source:o}}));if(tr(t))throw n.forEach(r=>r.source.dispose()),rr();return $t(n)}const Dt=/^model\/gltf\+json$/,Lt=/^model\/gltf-binary$/,Fe=/\.gltf$/i,cn=/\.glb$/i;function Ke({mimeType:e,source:t,name:n}){return Dt.test(e)||Fe.test(n)?{url:t.url,type:"gltf"}:Lt.test(e)||cn.test(n)?{url:t.url,type:"glb"}:null}function $t(e){const t=new Map;let n=null,r=null;for(const s of e){const{source:i,name:a}=s;n??=Ke(s),a==="ESRI3DO_NORM.glb"&&(r=Ke(s)),t.set(a,i.url),i.files.forEach((c,l)=>t.set(l,c))}const o=r??n;if(o==null)throw new re("mesh-load-external:missing-files","Missing files to load external mesh source");return new ge(o.url,()=>e.forEach(({source:s})=>s.dispose()),t,o.type)}let ge=class jt{constructor(t,n=()=>{},r=new Map,o){this.url=t,this.dispose=n,this.files=r,this.type=o}static fromBlob(t,n){const r=URL.createObjectURL(t);return new jt(r,()=>URL.revokeObjectURL(r),void 0,n)}};function Ct(e,t){return Dt.test(t)||Fe.test(e)?"gltf":Lt.test(t)||Fe.test(e)?"glb":void 0}let E=class extends nr{constructor(e){super(e),this.externalSources=new or,this._explicitDisplaySource=null,this.georeferenced=!1,this.addHandles(sr(()=>this.externalSources,"after-remove",({item:t})=>{t===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!He(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!$r(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>jr(t,e))}get _implicitDisplaySource(){return this.externalSources.find(He)}};u([f()],E.prototype,"externalSources",void 0),u([f()],E.prototype,"displaySource",null),u([f()],E.prototype,"_implicitDisplaySource",null),u([f()],E.prototype,"_explicitDisplaySource",void 0),u([f()],E.prototype,"georeferenced",void 0),E=u([B("esri.geometry.support.meshUtils.Metadata")],E);function un(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=vn,r=4*e.length,o=new Float64Array(3*r),s=new Float32Array(3*r),i=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let c=0,l=0,h=0,m=0;for(let p=0;p=s&&h=4,y=p===2||p===4,b=d?t-1:t;for(let M=0;M<=b;M++){const T=M/b*2*Math.PI,x=d?0:.5;v[0]=x*Math.sin(T),v[1]=x*-Math.cos(T),v[2]=p<=2?.5:-.5;for(let w=0;w<3;w++)r[a++]=v[w],o[c++]=g?w===2?p<=1?1:-1:0:w===2?0:v[w]/x;s[l++]=(M+(d?.5:0))/t,s[l++]=p<=1?1*p/3:p<=3?1*(p-2)/3+1/3:1*(p-4)/3+2/3,y||p===0||M===t||(p!==5&&(i[h++]=m,i[h++]=m+1,i[h++]=m-t),p!==1&&(i[h++]=m,i[h++]=m-t,i[h++]=m-t-1)),m++}}return{position:r,normal:o,uv:s,faces:i}}function mn(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function dn(e){const t=X.facingAxisOrderSwap[e],n=X.position,r=X.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let i=0;for(let a=0;a<4;a++){const c=i;for(let l=0;l<3;l++){const h=t[l],m=Math.abs(h)-1,p=h>=0?1:-1;o[i]=n[c+m]*p,s[i]=r[c+m]*p,i++}}return{position:o,normal:s,uv:new Float32Array(X.uv),faces:new Uint32Array(X.faces),isPlane:!0}}const z=1,H=2,V=3,X={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[V,z,H],west:[-V,-z,H],north:[-z,V,H],south:[z,-V,H],up:[z,H,V],down:[z,-H,-V]}};function ce(e,t,n){e.isPlane||gn(e),xn(e,yn(n?.size,n?.unit,t.spatialReference));const r=fe(t,n),o=t.spatialReference.isGeographic?fe(t):r,s=$e({vertexAttributes:e,vertexSpace:o,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new pe({...s,uv:e.uv}),vertexSpace:r,components:[new K({faces:e.faces,material:n?.material||null})],spatialReference:t.spatialReference}}function gn(e){for(let t=0;tse.getLogger("esri.geometry.support.meshUtils.rotate");function bn(e,t,n){if(!e.vertexAttributes?.position||t[3]===0)return;const{spatialReference:r,vertexSpace:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(W,o,r,i);lt(e)?Tn(e,t,s):a?An(e,t,s):Sn(e,t,s)}function Tn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Z;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(W(),n.spatialReference,s,P);Or(et,ue(t),it(t));const m=wt(Xe,et,we,ir,h),{localMatrix:p}=o,d=bt(Xe,m,p);o.scale=Tt(R(),d),At(d,d,ut(Z,o.scale));const g=o.rotationAxis;o.rotation=at(d),o.rotationAngle===0&&(o.rotationAxis=g),o.translation=St(R(),d)}function An(e,t,n){const r=e.spatialReference,o=Ee(r),s=Ft;if(!I(n,s,o)&&(A(W(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(W(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;xt(o,s,ye,o),Cr(Qe,ye);const p=Je;Le(ue(Je),ue(t),Qe),p[3]=t[3],ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(Y(l,p,3,s),dt(l,o,i,r)&&(a==null||h==null||(Y(h,p,3),gt(h,i,r,l,o,a)))&&(c==null||m==null||(Y(m,p,4),yt(m,i,r,l,o,c)))?e.vertexAttributesChanged():A(W(),o,r)):A(W(),r,o)}function Sn(e,t,n){const r=Ft;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(W(),n.spatialReference,e.spatialReference,P)}Y(e.vertexAttributes.position,t,3,r),Y(e.vertexAttributes.normal,t,3),Y(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}function Y(e,t,n,r=we){if(e!=null){Fr(ye,it(t),ue(t));for(let o=0;ose.getLogger("esri.geometry.support.meshUtils.scale");function Rn(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(N,r,o,i);lt(e)?Mn(e,t,s):a?_n(e,t,s):Dn(e,t,s)}function Mn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=q;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(N(),n.spatialReference,s,P);const m=me(Ln,t,t,t),p=wt(tt,Ir,we,m,h),{localMatrix:d}=o,g=bt(tt,p,d);o.scale=Tt(R(),g),At(g,g,ut(q,o.scale));const y=o.rotationAxis;o.rotation=at(g),o.rotationAngle===0&&(o.rotationAxis=y),o.translation=St(R(),g)}function _n(e,t,n){const r=e.spatialReference,o=Ee(r),s=Et;if(!I(n,s,o)&&(A(N(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(N(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(Ot(l,t,s),dt(l,o,i,r)&&(a==null||h==null||gt(h,i,r,l,o,a))&&(c==null||m==null||yt(m,i,r,l,o,c))?e.vertexAttributesChanged():A(N(),o,r)):A(N(),r,o)}function Dn(e,t,n){const r=Et;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(N(),n.spatialReference,e.spatialReference,P)}Ot(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}function Ot(e,t,n=we){if(e)for(let r=0;r{this.addHandles(Ht(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):this.metadata.displaySource?.extent!=null}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,n=this;return en({get transform(){return n.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return e.length===0||t?.length===0?Vt(kt):Se(e)}get origin(){const e=gr(this.vertexSpace,this.spatialReference);if(e!=null)return e;const{center:t,zmin:n}=this._transformedExtent;return new O({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get extent(){return this.loaded||this.metadata?.displaySource?.extent==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(K.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}j().error("removeComponent()",Nr)}}rotate(e,t,n,r){return hr(e,t,n,rt),bn(this,rt,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,s=o?.position;if(!s)return this;if(ie(r)){const[i,a,c]=r.origin;r.origin=Re(i+e,a+t,c+n)}else{for(let i=0;ia.cloneWithDeduplication(s,i))}const o={components:r,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:n?.preserveMetadata?this.metadata.clone():new E};return new D(o)}cloneShallow(){return new D({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([Me(()=>import("./gltfexport-Dj6nF2RN-BRI_tJ3X.js"),__vite__mapDeps([42,1,2,22,5,23,4,9,13,28,3,21,18,29,30,31,32,33,8,10,14,11,12,15,19,24,25,34,35,7,36,27,37,38,6,39,40,41]),import.meta.url),this.load(e)]);return xe(e),await t(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(j().error(e,Wr),!1)}static createBox(e,t){if(!(e instanceof O))return j().error(".createBox()",Q),null;const n=new D(ce(un(),e,t));return t?.imageFace&&t.imageFace!=="all"?pn(n,t.imageFace):n}static createSphere(e,t){return e instanceof O?new D(ce(hn(t?.densificationFactor||0),e,t)):(j().error(".createSphere()",Q),null)}static createCylinder(e,t){return e instanceof O?new D(ce(fn(t?.densificationFactor||0),e,t)):(j().error(".createCylinder()",Q),null)}static createPlane(e,t){if(!(e instanceof O))return j().error(".createPlane()",Q),null;const n=t?.facing??"up",r=mn(n,t?.size);return new D(ce(dn(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof Gt))return j().error(".createFromPolygon()",Br),null;const n=Vr(e);return new D({vertexAttributes:new pe({position:n.position}),components:[new K({faces:n.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new he})}static async createFromGLTF(e,t,n){if(!(e instanceof O)){const o=new Ze;throw j().error(".createfromGLTF()",o.message),o}const{loadGLTFMesh:r}=await ot(Me(()=>import("./loadGLTFMesh-C3-0Tu0H-BMXr1y1a.js"),__vite__mapDeps([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,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url),n);return new D(await r(e,t,n))}static async createFromFiles(e,t,n){Zt(j(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=o=>j().error(".createFromFiles()",o.message);if(!(e instanceof O)){const o=new Ze;throw r(o),o}if(!n?.layer)throw new re("invalid:no-layer","SceneLayer required for file to mesh conversion.");return n.layer.convertMesh(t,{location:e,...n})}static createWithExternalSource(e,t,n){const r=n?.extent??null,{spatialReference:o}=e,s=n?.transform?.clone()??new ne,i=fe(e,n),a=n?.unitConversionDisabled,c={source:t,extent:r,unitConversionDisabled:a},l=new E;return l.externalSources.push(c),new D({metadata:l,transform:s,vertexSpace:i,spatialReference:o})}static createIncomplete(e,t){const{spatialReference:n}=e,r=t?.transform?.clone()??new ne,o=fe(e,t),s=new D({transform:r,vertexSpace:o,spatialReference:n});return s.addResolvingPromise(Promise.reject(new re("mesh-incomplete","Mesh resources are not complete"))),s}};u([f({type:[K],json:{write:!0}})],S.prototype,"components",void 0),u([f({nonNullable:!0,types:$n,constructOnly:!0,json:{write:!0}})],S.prototype,"vertexSpace",void 0),u([f({type:ne,json:{write:!0}})],S.prototype,"transform",void 0),u([f({constructOnly:!0})],S.prototype,"metadata",void 0),u([f()],S.prototype,"hasExtent",null),u([f()],S.prototype,"_transformedExtent",null),u([f()],S.prototype,"_untransformedBounds",null),u([f()],S.prototype,"origin",null),u([f({readOnly:!0,json:{read:!1}})],S.prototype,"extent",null),u([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],S.prototype,"hasZ",void 0),u([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],S.prototype,"hasM",void 0),u([f({type:pe,nonNullable:!0,json:{write:!0}})],S.prototype,"vertexAttributes",void 0),S=D=u([B(It)],S);const rt=st(),ro=S;export{ro as F,ee as G,te as V,Pr as m,K as z}; diff --git a/main/assets/Mesh-DLzjDUIO-L2WFr_jE.js b/main/assets/Mesh-DLzjDUIO-L2WFr_jE.js deleted file mode 100644 index a5ddc5693..000000000 --- a/main/assets/Mesh-DLzjDUIO-L2WFr_jE.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loadGLTFMesh-C3-0Tu0H-DHHH24lq.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./MeshVertexAttributes-CbNpPur2-BzFN0z5X.js","./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js","./BufferView-PQoE3GL7-DXIpDOUe.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec3-BazNroeq-CFXHYIOm.js","./vec4-DWDdg1fj-maVOs7I3.js","./types-ChhhI6OU-Cxh6dPlX.js","./loader-CkLCe-E_-eczb4GdW.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-BxOJQpf3.js","./mat4-DX7gBViE-CQMXDC3Z.js","./quat-BODLR7mS-Bk09s2KF.js","./quatf64-C16JxGFv-BKWK1F8U.js","./resourceUtils-Ds65naCv-erCXStgB.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./DefaultMaterial_COLOR_GAMMA-D0o2czi9-CsDFFIOj.js","./Indices-DEr2HrWx-Cw8IJeSy.js","./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js","./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./projectPointToVector-B2UUY9SE-DeA9AEsl.js","./projection-BA9M1R7d-DoNqITCd.js","./MeshTransform-C--IG09w-B7P01ZzU.js","./imageUtils-BA2D6Uf1-BIs7TUww.js","./earcut-XDcq3zAf-BcwyrT7l.js","./plane-Dt8R0KeE-fuXvBrPY.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./deduplicate-D2d-E5Pw-cAmFzdIS.js","./External-D_wl4XAw-MFWeclAP.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./gltfexport-Dj6nF2RN-B5Lxo2wd.js"])))=>i.map(i=>d[i]); -import{v as u,S as f,du as Ut,ac as Pt,a0 as Wt,i as B,aa as Nt,ar as nt,ad as Pe,jh as Oe,aB as Bt,at as zt,ah as Ht,gU as Vt,ji as kt,jj as Se,w as O,hZ as Re,_ as Me,$ as xe,l as Gt,a_ as ot,bu as Zt,o as re,e as ve,ez as We,aO as _e,a1 as se,P as Te,jk as qt,jl as Yt,D as ae,i9 as L,dU as R,jm as Kt,jn as Ne,n as Xt,a5 as Jt,d9 as Qt,bf as er,x as tr,aS as rr,aP as nr,ag as or,ai as sr,fj as ir,h_ as we,d as ar,bj as lr,p as cr,dV as ur,hl as pr}from"./main-BZaw9FpY.js";import{s as st,R as hr,V as ne,c as it,S as ue,Q as at}from"./MeshTransform-C--IG09w-B7P01ZzU.js";import{g as fr}from"./imageUtils-BA2D6Uf1-BIs7TUww.js";import{u as mr,o as pe,g as dr}from"./MeshVertexAttributes-CbNpPur2-BzFN0z5X.js";import{y as he,d as De}from"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import{m as gr,t as ie,x as fe,d as lt}from"./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js";import{m as yr}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{w as ct}from"./Indices-DEr2HrWx-Cw8IJeSy.js";import{r as xr,j as vr,Z as Le,l as wr,_ as me,Q as ut,Y as br,L as Tr}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{y as Ar,N as Sr,K as Rr}from"./plane-Dt8R0KeE-fuXvBrPY.js";import{v as Be}from"./deduplicate-D2d-E5Pw-cAmFzdIS.js";import{p as I}from"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import{g as A,b as $e,Y as Mr,L as pt,a as ht,e as ft,c as mt,l as dt,o as gt,f as yt,M as P}from"./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js";import{t as be}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{J as _r}from"./projection-BA9M1R7d-DoNqITCd.js";import{x as Ee}from"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import{G as xt}from"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import{n as Dr}from"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import{b as ze,P as Lr}from"./vec3-BazNroeq-CFXHYIOm.js";import{B as He,T as $r,M as jr}from"./External-D_wl4XAw-MFWeclAP.js";import{n as vt}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{P as Cr}from"./mat3-CC4Foazl-BWjyqE2v.js";import{t as wt,B as bt,$ as Tt,N as At,W as St,K as Fr}from"./mat4-DX7gBViE-CQMXDC3Z.js";import{A as Or}from"./quat-BODLR7mS-Bk09s2KF.js";import{e as Er,n as Ir}from"./quatf64-C16JxGFv-BKWK1F8U.js";var k;const Ae=new WeakMap;let Ur=0,C=k=class extends ve{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:We(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o={type:"canvas-element",imageData:Ve(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[n]=o}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:We(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const o={type:"image-data",imageData:Ve(e)};t[n]=o}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=ke(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return ke(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this;return e instanceof HTMLCanvasElement?Ge(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?Ge(e):!(!t?.toLowerCase().endsWith(".png")&&!t?.toLocaleLowerCase().startsWith("data:image/png;"))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(n="")=>`d:${n},t:${this.transparent},w:${e}`;return this.url!=null?t(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(Ae.has(this.data)||Ae.set(this.data,++Ur),t(Ae.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=this.url!=null?this.url.length:0,this.data!=null){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new k(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}static from(e){return typeof e=="string"?new k({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new k({data:e}):_e(k,e)}};function Ve(e){let t="";for(let n=0;nMath.cos(lr(80))?L.Z:Math.abs(r[1])>Math.abs(r[0])?L.Y:L.X}function Hr(e,t,n,r){const o=(i=>!Array.isArray(i[0]))(t)?(i,a)=>t[3*i+a]:(i,a)=>t[i][a],s=r?cr(r)/ur(r):1;return Rr(e,(i,a)=>me(i,o(a,0)*s,o(a,1)*s,o(a,2)),n)}const qe=Ar();function Vr(e){const t=Gr(e.rings,e.hasZ,de.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const a of t.polygons){const c=a.count,l=a.index,h=qt(t.position,3*l,3*c),m=a.holeIndices.map(d=>d-l),p=ct(yr(h,m,3));n.push({position:h,faces:p}),r+=h.length,o+=p.length}const s=kr(n,r,o),i=Array.isArray(s.position)?Be(s.position,3,{originalIndices:s.faces}):Be(s.position.buffer,6,{originalIndices:s.faces});return s.position=Yt(new Float64Array(i.buffer)),s.faces=i.indices,s}function kr(e,t,n){if(e.length===1)return e[0];const r=Oe(t),o=new Array(n);let s=0,i=0,a=0;for(const c of e){for(let l=0;l=0;g--){const y=e[g],b=n===de.CCW_IS_HOLE&&Zr(y,t,r);if(b&&o!==1)s[l++]=y;else{let M=y.length;for(let x=0;x0&&(a[m++]={index:d,count:y.length}),d=b?le(y,y.length-1,-1,p,d,y.length,t):le(y,0,1,p,d,y.length,t);for(let x=0;x0&&(a[m++]={index:d,count:w.length}),d=le(w,0,1,p,d,w.length,t)}l=0,T.count>0&&(i[h++]=T)}}for(let g=0;g0&&(a[m++]={index:d,count:y.length}),d=le(y,0,1,p,d,y.length,t)}return i.length=h,a.length=m,{position:p,polygons:i,outlines:a}}function le(e,t,n,r,o,s,i){o*=3;for(let a=0;ase.getLogger("esri.geometry.support.meshUtils.centerAt");function qr(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,o=n?.origin??e.origin,s=Ue(oe,r,o.spatialReference,n?.geographic);ie(r)?Yr(e,t,o):s?Kr(e,t,o):Xr(e,t,o)}function Yr(e,t,n){const{vertexSpace:r}=e;if(!ie(r))return;const o=Mt,s=Rt;if(!I(t,s,e.spatialReference))return void A(oe(),t.spatialReference,e.spatialReference,P);if(!I(n,o,e.spatialReference)){const a=e.origin;return o[0]=a.x,o[1]=a.y,o[2]=a.z,void A(oe(),n.spatialReference,e.spatialReference,P)}const i=xr(Qr,s,o);r.origin=vr(R(),r.origin,i)}function Kr(e,t,n){const r=Re(n.x,n.y,n.z??0),o=$e(e,new De({origin:r}));if(!o)return;const s=Re(t.x,t.y,t.z??0),i=$e({vertexAttributes:o,spatialReference:e.spatialReference,vertexSpace:new De({origin:s})},he.absolute);if(!i)return;const{position:a,normal:c,tangent:l}=i;e.vertexAttributes.position=a,e.vertexAttributes.normal=c,e.vertexAttributes.tangent=l,e.vertexAttributesChanged()}function Xr(e,t,n){const r=Mt,o=Rt;if(I(t,o,e.spatialReference)){if(!I(n,r,e.spatialReference)){const s=e.origin;return r[0]=s.x,r[1]=s.y,r[2]=s.z,void A(oe(),n.spatialReference,e.spatialReference,P)}Jr(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else A(oe(),t.spatialReference,e.spatialReference,P)}function Jr(e,t,n){if(e)for(let r=0;rimport("./loadGLTFMesh-C3-0Tu0H-DHHH24lq.js"),__vite__mapDeps([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,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url),n),s=await on(r,n);xe(n);const i=o(new O({x:0,y:0,z:0,spatialReference:e.spatialReference}),s.url,{resolveFile:nn(s),signal:n?.signal,expectedType:s.type,unitConversionDisabled:t.unitConversionDisabled});i.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:c}=await i;e.vertexAttributes=a,e.components=c}function nn(e){const t=Jt(e.url);return n=>{const r=Qt(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}async function on(e,t){if(Array.isArray(e)){if(!e.length)throw new re("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?an(e):ln(e,t)}return _t(e)}async function sn(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(n.length===1)return new ge(n[0].partUrl);const s=await e.toBlob(t);return xe(t),ge.fromBlob(s,Ct(o,r))}function _t(e){return ge.fromBlob(e,Ct(e.name,e.type))}function an(e){return $t(e.map(t=>({name:t.name,mimeType:t.type,source:_t(t)})))}async function ln(e,t){const n=await er(e.map(async r=>{const o=await sn(r);return xe(t),{name:r.assetName,mimeType:r.assetMimeType,source:o}}));if(tr(t))throw n.forEach(r=>r.source.dispose()),rr();return $t(n)}const Dt=/^model\/gltf\+json$/,Lt=/^model\/gltf-binary$/,Fe=/\.gltf$/i,cn=/\.glb$/i;function Ke({mimeType:e,source:t,name:n}){return Dt.test(e)||Fe.test(n)?{url:t.url,type:"gltf"}:Lt.test(e)||cn.test(n)?{url:t.url,type:"glb"}:null}function $t(e){const t=new Map;let n=null,r=null;for(const s of e){const{source:i,name:a}=s;n??=Ke(s),a==="ESRI3DO_NORM.glb"&&(r=Ke(s)),t.set(a,i.url),i.files.forEach((c,l)=>t.set(l,c))}const o=r??n;if(o==null)throw new re("mesh-load-external:missing-files","Missing files to load external mesh source");return new ge(o.url,()=>e.forEach(({source:s})=>s.dispose()),t,o.type)}let ge=class jt{constructor(t,n=()=>{},r=new Map,o){this.url=t,this.dispose=n,this.files=r,this.type=o}static fromBlob(t,n){const r=URL.createObjectURL(t);return new jt(r,()=>URL.revokeObjectURL(r),void 0,n)}};function Ct(e,t){return Dt.test(t)||Fe.test(e)?"gltf":Lt.test(t)||Fe.test(e)?"glb":void 0}let E=class extends nr{constructor(e){super(e),this.externalSources=new or,this._explicitDisplaySource=null,this.georeferenced=!1,this.addHandles(sr(()=>this.externalSources,"after-remove",({item:t})=>{t===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!He(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!$r(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>jr(t,e))}get _implicitDisplaySource(){return this.externalSources.find(He)}};u([f()],E.prototype,"externalSources",void 0),u([f()],E.prototype,"displaySource",null),u([f()],E.prototype,"_implicitDisplaySource",null),u([f()],E.prototype,"_explicitDisplaySource",void 0),u([f()],E.prototype,"georeferenced",void 0),E=u([B("esri.geometry.support.meshUtils.Metadata")],E);function un(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=vn,r=4*e.length,o=new Float64Array(3*r),s=new Float32Array(3*r),i=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let c=0,l=0,h=0,m=0;for(let p=0;p=s&&h=4,y=p===2||p===4,b=d?t-1:t;for(let M=0;M<=b;M++){const T=M/b*2*Math.PI,x=d?0:.5;v[0]=x*Math.sin(T),v[1]=x*-Math.cos(T),v[2]=p<=2?.5:-.5;for(let w=0;w<3;w++)r[a++]=v[w],o[c++]=g?w===2?p<=1?1:-1:0:w===2?0:v[w]/x;s[l++]=(M+(d?.5:0))/t,s[l++]=p<=1?1*p/3:p<=3?1*(p-2)/3+1/3:1*(p-4)/3+2/3,y||p===0||M===t||(p!==5&&(i[h++]=m,i[h++]=m+1,i[h++]=m-t),p!==1&&(i[h++]=m,i[h++]=m-t,i[h++]=m-t-1)),m++}}return{position:r,normal:o,uv:s,faces:i}}function mn(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function dn(e){const t=X.facingAxisOrderSwap[e],n=X.position,r=X.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let i=0;for(let a=0;a<4;a++){const c=i;for(let l=0;l<3;l++){const h=t[l],m=Math.abs(h)-1,p=h>=0?1:-1;o[i]=n[c+m]*p,s[i]=r[c+m]*p,i++}}return{position:o,normal:s,uv:new Float32Array(X.uv),faces:new Uint32Array(X.faces),isPlane:!0}}const z=1,H=2,V=3,X={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[V,z,H],west:[-V,-z,H],north:[-z,V,H],south:[z,-V,H],up:[z,H,V],down:[z,-H,-V]}};function ce(e,t,n){e.isPlane||gn(e),xn(e,yn(n?.size,n?.unit,t.spatialReference));const r=fe(t,n),o=t.spatialReference.isGeographic?fe(t):r,s=$e({vertexAttributes:e,vertexSpace:o,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new pe({...s,uv:e.uv}),vertexSpace:r,components:[new K({faces:e.faces,material:n?.material||null})],spatialReference:t.spatialReference}}function gn(e){for(let t=0;tse.getLogger("esri.geometry.support.meshUtils.rotate");function bn(e,t,n){if(!e.vertexAttributes?.position||t[3]===0)return;const{spatialReference:r,vertexSpace:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(W,o,r,i);lt(e)?Tn(e,t,s):a?An(e,t,s):Sn(e,t,s)}function Tn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Z;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(W(),n.spatialReference,s,P);Or(et,ue(t),it(t));const m=wt(Xe,et,we,ir,h),{localMatrix:p}=o,d=bt(Xe,m,p);o.scale=Tt(R(),d),At(d,d,ut(Z,o.scale));const g=o.rotationAxis;o.rotation=at(d),o.rotationAngle===0&&(o.rotationAxis=g),o.translation=St(R(),d)}function An(e,t,n){const r=e.spatialReference,o=Ee(r),s=Ft;if(!I(n,s,o)&&(A(W(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(W(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;xt(o,s,ye,o),Cr(Qe,ye);const p=Je;Le(ue(Je),ue(t),Qe),p[3]=t[3],ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(Y(l,p,3,s),dt(l,o,i,r)&&(a==null||h==null||(Y(h,p,3),gt(h,i,r,l,o,a)))&&(c==null||m==null||(Y(m,p,4),yt(m,i,r,l,o,c)))?e.vertexAttributesChanged():A(W(),o,r)):A(W(),r,o)}function Sn(e,t,n){const r=Ft;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(W(),n.spatialReference,e.spatialReference,P)}Y(e.vertexAttributes.position,t,3,r),Y(e.vertexAttributes.normal,t,3),Y(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}function Y(e,t,n,r=we){if(e!=null){Fr(ye,it(t),ue(t));for(let o=0;ose.getLogger("esri.geometry.support.meshUtils.scale");function Rn(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(N,r,o,i);lt(e)?Mn(e,t,s):a?_n(e,t,s):Dn(e,t,s)}function Mn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=q;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(N(),n.spatialReference,s,P);const m=me(Ln,t,t,t),p=wt(tt,Ir,we,m,h),{localMatrix:d}=o,g=bt(tt,p,d);o.scale=Tt(R(),g),At(g,g,ut(q,o.scale));const y=o.rotationAxis;o.rotation=at(g),o.rotationAngle===0&&(o.rotationAxis=y),o.translation=St(R(),g)}function _n(e,t,n){const r=e.spatialReference,o=Ee(r),s=Et;if(!I(n,s,o)&&(A(N(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(N(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(Ot(l,t,s),dt(l,o,i,r)&&(a==null||h==null||gt(h,i,r,l,o,a))&&(c==null||m==null||yt(m,i,r,l,o,c))?e.vertexAttributesChanged():A(N(),o,r)):A(N(),r,o)}function Dn(e,t,n){const r=Et;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(N(),n.spatialReference,e.spatialReference,P)}Ot(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}function Ot(e,t,n=we){if(e)for(let r=0;r{this.addHandles(Ht(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):this.metadata.displaySource?.extent!=null}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,n=this;return en({get transform(){return n.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return e.length===0||t?.length===0?Vt(kt):Se(e)}get origin(){const e=gr(this.vertexSpace,this.spatialReference);if(e!=null)return e;const{center:t,zmin:n}=this._transformedExtent;return new O({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get extent(){return this.loaded||this.metadata?.displaySource?.extent==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(K.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}j().error("removeComponent()",Nr)}}rotate(e,t,n,r){return hr(e,t,n,rt),bn(this,rt,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,s=o?.position;if(!s)return this;if(ie(r)){const[i,a,c]=r.origin;r.origin=Re(i+e,a+t,c+n)}else{for(let i=0;ia.cloneWithDeduplication(s,i))}const o={components:r,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:n?.preserveMetadata?this.metadata.clone():new E};return new D(o)}cloneShallow(){return new D({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([Me(()=>import("./gltfexport-Dj6nF2RN-B5Lxo2wd.js"),__vite__mapDeps([42,1,2,22,5,23,4,9,13,28,3,21,18,29,30,31,32,33,8,10,14,11,12,15,19,24,25,34,35,7,36,27,37,38,6,39,40,41]),import.meta.url),this.load(e)]);return xe(e),await t(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(j().error(e,Wr),!1)}static createBox(e,t){if(!(e instanceof O))return j().error(".createBox()",Q),null;const n=new D(ce(un(),e,t));return t?.imageFace&&t.imageFace!=="all"?pn(n,t.imageFace):n}static createSphere(e,t){return e instanceof O?new D(ce(hn(t?.densificationFactor||0),e,t)):(j().error(".createSphere()",Q),null)}static createCylinder(e,t){return e instanceof O?new D(ce(fn(t?.densificationFactor||0),e,t)):(j().error(".createCylinder()",Q),null)}static createPlane(e,t){if(!(e instanceof O))return j().error(".createPlane()",Q),null;const n=t?.facing??"up",r=mn(n,t?.size);return new D(ce(dn(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof Gt))return j().error(".createFromPolygon()",Br),null;const n=Vr(e);return new D({vertexAttributes:new pe({position:n.position}),components:[new K({faces:n.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new he})}static async createFromGLTF(e,t,n){if(!(e instanceof O)){const o=new Ze;throw j().error(".createfromGLTF()",o.message),o}const{loadGLTFMesh:r}=await ot(Me(()=>import("./loadGLTFMesh-C3-0Tu0H-DHHH24lq.js"),__vite__mapDeps([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,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url),n);return new D(await r(e,t,n))}static async createFromFiles(e,t,n){Zt(j(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=o=>j().error(".createFromFiles()",o.message);if(!(e instanceof O)){const o=new Ze;throw r(o),o}if(!n?.layer)throw new re("invalid:no-layer","SceneLayer required for file to mesh conversion.");return n.layer.convertMesh(t,{location:e,...n})}static createWithExternalSource(e,t,n){const r=n?.extent??null,{spatialReference:o}=e,s=n?.transform?.clone()??new ne,i=fe(e,n),a=n?.unitConversionDisabled,c={source:t,extent:r,unitConversionDisabled:a},l=new E;return l.externalSources.push(c),new D({metadata:l,transform:s,vertexSpace:i,spatialReference:o})}static createIncomplete(e,t){const{spatialReference:n}=e,r=t?.transform?.clone()??new ne,o=fe(e,t),s=new D({transform:r,vertexSpace:o,spatialReference:n});return s.addResolvingPromise(Promise.reject(new re("mesh-incomplete","Mesh resources are not complete"))),s}};u([f({type:[K],json:{write:!0}})],S.prototype,"components",void 0),u([f({nonNullable:!0,types:$n,constructOnly:!0,json:{write:!0}})],S.prototype,"vertexSpace",void 0),u([f({type:ne,json:{write:!0}})],S.prototype,"transform",void 0),u([f({constructOnly:!0})],S.prototype,"metadata",void 0),u([f()],S.prototype,"hasExtent",null),u([f()],S.prototype,"_transformedExtent",null),u([f()],S.prototype,"_untransformedBounds",null),u([f()],S.prototype,"origin",null),u([f({readOnly:!0,json:{read:!1}})],S.prototype,"extent",null),u([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],S.prototype,"hasZ",void 0),u([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],S.prototype,"hasM",void 0),u([f({type:pe,nonNullable:!0,json:{write:!0}})],S.prototype,"vertexAttributes",void 0),S=D=u([B(It)],S);const rt=st(),ro=S;export{ro as F,ee as G,te as V,Pr as m,K as z}; diff --git a/main/assets/MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js b/main/assets/MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js new file mode 100644 index 000000000..135b24f80 --- /dev/null +++ b/main/assets/MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js @@ -0,0 +1 @@ +import{aa as n,v as o,bz as p,S as i,i as a,dU as c,e as l}from"./main-C7yV2j71.js";var s;let e=s=class extends n(l){constructor(t){super(t),this.type="georeferenced",this.origin=null}};e.absolute=new s,o([p({georeferenced:"georeferenced"},{readOnly:!0})],e.prototype,"type",void 0),o([i({type:[Number],nonNullable:!1,json:{write:!0}})],e.prototype,"origin",void 0),e=s=o([a("esri.geometry.support.MeshGeoreferencedVertexSpace")],e);const d=e;let r=class extends n(l){constructor(t){super(t),this.type="local",this.origin=c()}};o([p({local:"local"},{readOnly:!0})],r.prototype,"type",void 0),o([i({type:[Number],nonNullable:!0,json:{write:!0}})],r.prototype,"origin",void 0),r=o([a("esri.geometry.support.MeshLocalVertexSpace")],r);const u=r;export{u as d,d as y}; diff --git a/main/assets/MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js b/main/assets/MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js deleted file mode 100644 index 83cf3c002..000000000 --- a/main/assets/MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as n,v as o,bz as p,S as i,i as a,dU as c,e as l}from"./main-BZaw9FpY.js";var s;let e=s=class extends n(l){constructor(t){super(t),this.type="georeferenced",this.origin=null}};e.absolute=new s,o([p({georeferenced:"georeferenced"},{readOnly:!0})],e.prototype,"type",void 0),o([i({type:[Number],nonNullable:!1,json:{write:!0}})],e.prototype,"origin",void 0),e=s=o([a("esri.geometry.support.MeshGeoreferencedVertexSpace")],e);const d=e;let r=class extends n(l){constructor(t){super(t),this.type="local",this.origin=c()}};o([p({local:"local"},{readOnly:!0})],r.prototype,"type",void 0),o([i({type:[Number],nonNullable:!0,json:{write:!0}})],r.prototype,"origin",void 0),r=o([a("esri.geometry.support.MeshLocalVertexSpace")],r);const u=r;export{u as d,d as y}; diff --git a/main/assets/MeshTransform-C--IG09w-B7P01ZzU.js b/main/assets/MeshTransform-C--IG09w-B7P01ZzU.js deleted file mode 100644 index 45e232b18..000000000 --- a/main/assets/MeshTransform-C--IG09w-B7P01ZzU.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as e,i as w,e as I,dU as S,il as U,hZ as q,i8 as l,B as M,je as z,jf as B,i1 as E,bj as Q}from"./main-BZaw9FpY.js";import{o as R,z as T,u as V,s as Z}from"./mat4-DX7gBViE-CQMXDC3Z.js";import{t as x}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as p,j as N,_}from"./quat-BODLR7mS-Bk09s2KF.js";import{e as m}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{A as k}from"./vec32-D9GsKZ1t-D4J2Sth6.js";function s(t=d){return[t[0],t[1],t[2],t[3]]}function c(t,o,r=s()){return k(r,t),r[3]=o,r}function L(t,o=s()){const r=Z(a,t);return $(o,M(N(o,r))),o}function g(t,o,r=s()){return p(a,t,h(t)),p(j,o,h(o)),_(a,j,a),$(r,M(N(r,a)))}function O(t,o,r,A=s()){return c(z,t,u),c(B,o,y),c(E,r,b),g(u,y,u),g(u,b,A),A}function P(t){return t}function C(t){return t[3]}function h(t){return Q(t[3])}function $(t,o){return t[3]=o,t}const d=[0,0,1,0],a=m(),j=m();s();const u=s(),y=s(),b=s();var f;let n=f=class extends I{constructor(t){super(t),this.translation=S(),this.rotationAxis=U(d),this.rotationAngle=0,this.scale=q(1,1,1)}get rotation(){return c(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=l(t),this.rotationAngle=C(t)}get localMatrix(){const t=x();return p(v,this.rotation,h(this.rotation)),R(t,v,this.translation,this.scale),t}get localMatrixInverse(){return T(x(),this.localMatrix)}equals(t){return this===t||t!=null&&V(this.localMatrix,t.localMatrix)}clone(){const t={translation:l(this.translation),rotationAxis:l(this.rotationAxis),rotationAngle:this.rotationAngle,scale:l(this.scale)};return new f(t)}};i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"translation",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAxis",void 0),i([e({type:Number,nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAngle",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"scale",void 0),i([e()],n.prototype,"rotation",null),i([e()],n.prototype,"localMatrix",null),i([e()],n.prototype,"localMatrixInverse",null),n=f=i([w("esri.geometry.support.MeshTransform")],n);const v=m(),W=n;export{L as Q,O as R,P as S,W as V,h as c,s}; diff --git a/main/assets/MeshTransform-C--IG09w-QYZk68_K.js b/main/assets/MeshTransform-C--IG09w-QYZk68_K.js new file mode 100644 index 000000000..cf017f3df --- /dev/null +++ b/main/assets/MeshTransform-C--IG09w-QYZk68_K.js @@ -0,0 +1 @@ +import{v as i,S as e,i as w,e as I,dU as S,il as U,hZ as q,i8 as l,B as M,je as z,jf as B,i1 as E,bj as Q}from"./main-C7yV2j71.js";import{o as R,z as T,u as V,s as Z}from"./mat4-DX7gBViE-vewreEuZ.js";import{t as x}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as p,j as N,_}from"./quat-BODLR7mS-Dbd8ftOx.js";import{e as m}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{A as k}from"./vec32-D9GsKZ1t-CXe4l2D-.js";function s(t=d){return[t[0],t[1],t[2],t[3]]}function c(t,o,r=s()){return k(r,t),r[3]=o,r}function L(t,o=s()){const r=Z(a,t);return $(o,M(N(o,r))),o}function g(t,o,r=s()){return p(a,t,h(t)),p(j,o,h(o)),_(a,j,a),$(r,M(N(r,a)))}function O(t,o,r,A=s()){return c(z,t,u),c(B,o,y),c(E,r,b),g(u,y,u),g(u,b,A),A}function P(t){return t}function C(t){return t[3]}function h(t){return Q(t[3])}function $(t,o){return t[3]=o,t}const d=[0,0,1,0],a=m(),j=m();s();const u=s(),y=s(),b=s();var f;let n=f=class extends I{constructor(t){super(t),this.translation=S(),this.rotationAxis=U(d),this.rotationAngle=0,this.scale=q(1,1,1)}get rotation(){return c(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=l(t),this.rotationAngle=C(t)}get localMatrix(){const t=x();return p(v,this.rotation,h(this.rotation)),R(t,v,this.translation,this.scale),t}get localMatrixInverse(){return T(x(),this.localMatrix)}equals(t){return this===t||t!=null&&V(this.localMatrix,t.localMatrix)}clone(){const t={translation:l(this.translation),rotationAxis:l(this.rotationAxis),rotationAngle:this.rotationAngle,scale:l(this.scale)};return new f(t)}};i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"translation",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAxis",void 0),i([e({type:Number,nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAngle",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"scale",void 0),i([e()],n.prototype,"rotation",null),i([e()],n.prototype,"localMatrix",null),i([e()],n.prototype,"localMatrixInverse",null),n=f=i([w("esri.geometry.support.MeshTransform")],n);const v=m(),W=n;export{L as Q,O as R,P as S,W as V,h as c,s}; diff --git a/main/assets/MeshVertexAttributes-CbNpPur2-BzFN0z5X.js b/main/assets/MeshVertexAttributes-CbNpPur2-BzFN0z5X.js deleted file mode 100644 index 3a78ea061..000000000 --- a/main/assets/MeshVertexAttributes-CbNpPur2-BzFN0z5X.js +++ /dev/null @@ -1 +0,0 @@ -import{v as n,S as u,ad as c,i as v,e as A,a1 as l,P as i}from"./main-BZaw9FpY.js";function m(t,o,e,g){const{loggerTag:a,stride:s}=o;return t.length%s!=0?(g.error(a,`Invalid array length, expected a multiple of ${s}`),new e([])):t}function p(t,o,e,g,a){if(!t)return t;if(t instanceof o)return m(t,g,o,a);for(const s of e)if(t instanceof s)return m(new o(t),g,o,a);if(Array.isArray(t))return m(new o(t),g,o,a);{const s=e.map(d=>`'${d.name}'`);return a.error(`Failed to set property, expected one of ${s}, but got ${t.constructor.name}`),new o([])}}function h(t,o,e){o[e]=f(t)}function f(t){const o=new Array(t.length);for(let e=0;e`'${d.name}'`);return a.error(`Failed to set property, expected one of ${s}, but got ${t.constructor.name}`),new o([])}}function h(t,o,e){o[e]=f(t)}function f(t){const o=new Array(t.length);for(let e=0;e{let{pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sizeRatio:a}=n;e||(e=n.sprite.sdf?[0,0]:[n.sprite.width,n.sprite.height]),t||(t=n.sprite.sdf?[0,0]:e),i=R(i),s=R(s),r=R(r);const o=(n.sprite.sdfDecodeCoeff??1)*a;return{...n,pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sdfDecodeCoeff:o}},optionalAttributes:{zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:$,pack:({scaleInfo:n},{tileInfo:e})=>me(n,e)}},attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1,pack:Xe},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:1},offset:{type:S.FLOAT,count:2,packAlternating:{count:4,pack:n=>{const e=n.texelDimensions;return[[-.5*e[0],-.5*e[1]],[.5*e[0],-.5*e[1]],[-.5*e[0],.5*e[1]],[.5*e[0],.5*e[1]]]}}},uv:{type:S.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:n,texXmin:e,texYmax:t,texYmin:i})=>[[e,i],[n,i],[e,t],[n,t]]}},animationPointerAndBaseSizeAndReferenceSize:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:1,pack:({animations:n,baseSize:e,referenceSize:t})=>[n.dataColumn,n.dataRow,e,t]},sizing:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:n,pixelDimensions:e,baseSize:t,sprite:i,sizeRatio:s})=>{const r=Math.max(t*i.width/i.height,t),a=i.sdfDecodeCoeff*r*s;return[e[0],e[1],n,a]}},angle:{type:S.BYTE,count:1,packTessellation:({angle:n})=>n}}}}_write(n,e){const t=this.evaluatedMeshParams.sprite,{textureBinding:i}=t;n.recordStart(this.instanceId,this.attributeLayout,i);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPolygon"){const r=e.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writeQuad(n,s,a,o)}else if(e.geometryType==="esriGeometryPoint"){const r=e.readXForDisplay(),a=e.readYForDisplay();this._writeQuad(n,s,r,a)}else{const r=e.readGeometryForDisplay();if(r){const{angleToLine:a}=this.evaluatedMeshParams;if(a){let o=!0,c=null,d=null;r.forEachVertex((l,u)=>{if(c!=null&&d!=null){const h=Math.atan2(u-d,l-c)/Pe;o&&(this._writeQuad(n,s,c,d,h),o=!1),this._writeQuad(n,s,l,u,h)}c=l,d=u})}else r.forEachVertex((o,c)=>{this._writeQuad(n,s,o,c)})}}n.recordEnd()}_writeQuad(n,e,t,i,s=0){const r=this.evaluatedMeshParams.sprite,{rect:a}=r,o=a.x+2,c=a.y+2,d=a.x+a.width-2,l=a.y+a.height-2,u=n.vertexCount();n.recordBounds(t,i,64,64);const h={texXmin:o,texYmin:c,texXmax:d,texYmax:l,angle:s};for(let _=0;_<4;_++)this._writeVertex(n,e,t,i,h);n.indexEnsureSize(6),n.indexWrite(u),n.indexWrite(u+1),n.indexWrite(u+2),n.indexWrite(u+1),n.indexWrite(u+3),n.indexWrite(u+2)}};function ce(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function pe(n,e){return Math.sqrt(n*n+e*e)}function le(n){const e=pe(n[0],n[1]);n[0]/=e,n[1]/=e}function He(n,e){return pe(n[0]-e[0],n[1]-e[1])}function Je(n,e){return n[e+1]}function _e(n){return n.length-1}function Ue(n){let e=0;for(let t=0;t<_e(n);t++)e+=Ke(n,t);return e}function Ke(n,e,t=1){let[i,s]=Je(n,e);return[i,s]=[Math.round(i),Math.round(s)],Math.sqrt(i*i+s*s)*t}let et=class H{constructor(e,t,i,s,r){this._segments=e,this._index=t,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(e){return new H(e,0,0,e[0][0],e[0][1])}clone(){return new H(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(this._distance===0||e._distance===1)||e._index===this._index+1&&(this._distance===1||e._distance===0)}leq(e){return this._indexe._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let i=Math.acos(t);return e>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<_e(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){const i=this.backwardLength;if(e<=i)return this._distance=(i-e)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>e)return this._seekBackwards(e-s);s+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>e)return this.seek(e-i,t);i+=this.length}return this._distance=1,t?this:null}};function Q(n,e,t,i=!0){const s=Ue(n),r=et.create(n),a=s/2;if(!i)return r.seek(a),void(Math.abs(r.x)=0&&!(i[f+1]i[l]+d);f++){const m=d-i[f-1]+i[l],p=i[f]-i[f-1],g=i[f]-i[l]{let e=0;if(n===0)return 1/0;for(;!(n%2);)e++,n/=2;return e});class nt extends de{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,i!=null)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const r=t.readXForDisplay(),a=t.readYForDisplay();this._writePoint(e,r,a,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const r=t.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writePoint(e,a,o,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_createLineLabelMetric(e,t,i,s){const r=te(e),a=this.evaluatedMeshParams.horizontalAlignment==="right"?-1:1,o=this.evaluatedMeshParams.verticalAlignment==="bottom"?-1:1,c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;return new oe(r,t,i,a,o,c,d,s??null)}_writePoint(e,t,i,s){const r=this._getShaping();if(!r)return;const a=s.getDisplayId(),o=xe(this.evaluatedMeshParams.horizontalAlignment),c=ve(this.evaluatedMeshParams.verticalAlignment),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=te(s.getDisplayId()),h=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new oe(u,t,i,o,c,d,l,h)),this._writeGlyphs(e,a,t,i,r,0,h),e.metricBoxWrite(r.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping("middle");if(!a)return;const o=(d,l,u,h)=>this._placeSubdivGlyphs(d,l,u,h),c=(a.bounds.width+r)/(1<0&&!(!c&&!d);if(i.metricStart(this._createLineLabelMetric(s,e.x,e.y)),_){const f=Math.max(t,a[0],0),m=Math.min(N,a[1]),p=je(Z(),-e.angle),g={minZoom:f,maxZoom:m,clipAngle:u,mapAligned:!0,isLineLabel:!0},y=R(this.evaluatedMeshParams.offsetX),v=R(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const M=re(y,-1*v),[x,I]=r.shapeBackground(se(Z(),p,M));i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const M=re(y,v),[x,I]=r.shapeBackground(se(Z(),p,M));g.clipAngle=h,i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(l,t,1,u,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(l,t,0,h,!0),i.metricEnd()}_placeBack(e,t,i,s,r,a){const o=e.clone();let c=e.backwardLength+L;for(;o.prev()&&!(c>=s);)this._placeOnSegment(o,t,c,i,-1,r,a),c+=o.length+L}_placeForward(e,t,i,s,r,a){const o=e.clone();let c=e.remainingLength+L;for(;o.next()&&!(c>=s);)this._placeOnSegment(o,t,c,i,1,r,a),c+=o.length+L}_placeFirst(e,t,i,s,r=!1){const{out:a,id:o,shaping:c,zoomRange:d,referenceBounds:l}=this._current,u=c.glyphs;for(const h of u){const _=h.x>c.bounds.x?i:1-i,f=_*e.remainingLength+(1-_)*e.backwardLength,m=Math.abs(h.x+h.width/2-c.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(m/(f+L))),g=Math.max(t,r?0:p);h.maxZoom=Math.min(d[1],N),h.angle=e.angle+(1-i)*Math.PI,h.minZoom=Math.max(d[0],g),this._writeLineGlyph(a,o,e.x,e.y,c.bounds,h,s,l,!0),(i||this._current.offsetDirection)&&this._isVisible(h.minZoom,h.maxZoom)&&a.metricBoxWrite(h.bounds)}}_placeOnSegment(e,t,i,s,r,a,o){const{out:c,id:d,shaping:l,referenceBounds:u}=this._current,h=l.glyphs,_=e.dx/e.length,f=e.dy/e.length,m={x:e.x+i*-r*_,y:e.y+i*-r*f};for(const p of h){const g=p.x>l.bounds.x?a:1-a;if(!(g&&r===1||!g&&r===-1))continue;const y=Math.abs(p.x+p.width/2-l.bounds.x),v=Math.max(0,this._zoomLevel+Math.log2(y/i)-.1),M=Math.max(s,this._zoomLevel+Math.log2(y/(i+e.length+L)));v!==0&&(p.angle=e.angle+(1-a)*Math.PI,p.minZoom=M,p.maxZoom=v,this._writeLineGlyph(c,d,m.x,m.y,l.bounds,p,o,u,!0),(a||this._current.offsetDirection)&&this._isVisible(p.minZoom,p.maxZoom)&&c.metricBoxWrite(p.bounds))}}_writeLineGlyph(e,t,i,s,r,a,o,c,d){const l=i+r.x,u=s+r.y,h=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),_=Math.max(r.width,r.height)*h;e.recordStart(this.instanceId,this.attributeLayout,a.textureBinding),e.recordBounds(l,u,_,_);const{texcoords:f,offsets:m}=a,{fontSize:p,haloSize:g,outlineSize:y}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:f,offsets:m,fontSize:p,haloSize:g,outlineSize:y,color:Ce(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:c,minZoom:Math.max(this._current.zoomRange[0],a.minZoom),maxZoom:Math.min(this._current.zoomRange[1],a.maxZoom),clipAngle:o,mapAligned:d,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const i=Math.floor(this._zoomLevel*$)/$;return e<=i&&i<=t}}function he(n,e,t){const{coords:i,lengths:s}=e,r=A(),a=A(),o=A(),c=A(),d=A(),l=A(),u=2;let h=0;for(let _=0;_0?k(r,i[p],i[p+1]):k(r,0,0),k(a,i[g],i[g+1]),mw(e)).map(e=>j(e).simplify()))}function lt(n){const e=[];return e.push(n.transform),e.push(n.fromColor),e.push(n.toColor),e.push(n.colorMix),e.push(n.toOpacity),e.push(n.opacityMix),e}function ge(n){const e=[],t=[];let i=0;for(const s of n){const r=[...s.encode(),...z.ret.encode()];e.push([i+n.length,0,0,0]),t.push(...r),i+=r.length}return[...e,...t]}async function K(n,e){const t=n;let i;if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")i=t;else if(Array.isArray(t))i=await Promise.all(t.map(s=>K(s,e)));else if(typeof t=="object")if("valueExpressionInfo"in t){const{valueExpressionInfo:s}=t,{expression:r}=s;i={...t,computed:await e.createComputedField({expression:r})}}else{i={};for(const s in t)i[s]=await K(t[s],e)}return i}function w(n,e,t){function i(a){if(!("computed"in a))return a;let o=a.computed.readWithDefault(e,t,[255*a.defaultValue[0],255*a.defaultValue[1],255*a.defaultValue[2],a.defaultValue[3]]);if(typeof o=="string"){const c=Se.fromString(o);c&&(o=[c.r,c.g,c.b,c.a])}return o}const s=n;let r;if(typeof s=="number"||typeof s=="string"||typeof s=="boolean")r=s;else if(Array.isArray(s))r=s.map(a=>w(a,e,t));else if(typeof s=="object")if("type"in s&&s.type!=null&&s.type==="Process")switch(s.op){case"ArcadeColor":{const a=w(s.value,e,t);O(Array.isArray(a)&&a.length===4),r=[a[0]/255,a[1]/255,a[2]/255,a[3]]}break;case"Transparency":{const a=w(s.value,e,t);O(typeof a=="number"),r=1-a/100}break;case"Divide":{const a=w(s.left,e,t);O(typeof a=="number");const o=w(s.right,e,t);O(typeof o=="number"),r=a/o}break;case"Random":{const a=w(s.seed,e,t),o=w(s.min,e,t),c=w(s.max,e,t),d=e.getObjectId(),l=fe(d||0);r=o+qe(l,a)*(c-o)}}else if("computed"in s)r=i(s);else{r={};for(const a in s)r[a]=w(s[a],e,t)}return r}function O(n){if(!n)throw new Error("Assertion failed.")}class ht extends Ye{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,i){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}}const ut=()=>Ie.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function C(n,e,t=!1){const{defaultValue:i,valueExpressionInfo:s,value:r}=e;if(s){const{expression:a}=s,o=await n.createComputedField({expression:a},t);return o?{...e,computed:o,defaultValue:i}:null}return{...e,computed:new ht(r),defaultValue:i}}async function ue(n,e){const{valueExpressionInfo:t}=e,{expression:i}=t,s=await n.createComputedField({expression:i});return s?{...e,computed:s}:null}function ye(n){return typeof n=="object"&&n!=null&&(!(!("valueExpressionInfo"in n)||!n.valueExpressionInfo)||"type"in n&&n.type==="Process"&&"op"in n&&n.op==="Random")}function W(n){if(Array.isArray(n)){for(const e of n)if(W(e))return!0}if(typeof n=="object"){if(ye(n))return!0;for(const e in n)if(W(n[e]))return!0}return!1}class ee{static async create(e,t,i){const s={},r=new Map,a=new Map,o=new Map,c=new Map,d=new Map,l=new Map;for(const u in i){const h=i[u];if(h!=null&&typeof h=="object")if(Array.isArray(h)){if(typeof h[0]=="object")throw new Error(`InternalError: Cannot handle ${u}. Nested array params are not supported`);s[u]=h}else if("valueExpressionInfo"in h){if(h.value){s[u]=h.value;continue}const _=await ue(e,h);if(!_){s[u]=h.defaultValue;continue}r.set(u,_),s[u]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some(_=>_.overrides.length)){a.set(u,{effects:await Promise.all(h.effectInfos.map(async _=>{const f=_.overrides.map(m=>C(e,m));return{effect:_.effect,compiledOverrides:(await Promise.all(f)).filter(B)}}))});break}s[u]=h.effectInfos.map(_=>_.effect);break;case"cim-marker-placement-param":h.overrides.length&&o.set(u,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map(_=>C(e,_)))).filter(B)}),s[u]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m,h.useLegacyLabelEvaluationRules));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}if(h.resource.type==="animated"){c.set(u,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"cim-marker-transform-param":{const{params:_}=h;if(W(_)){const f={compiledMarkerInfos:[]};await Promise.all(_.map(async m=>{const p={props:{}};for(const g in m)if(ye(m[g])){const y=await ue(e,m[g]);p.compiledExpressionMap||(p.compiledExpressionMap=new Map);const v=p.compiledExpressionMap;y&&v.set(g,y)}else p.props[g]=m[g];f.compiledMarkerInfos.push(p)})),d.set(u,f)}else s[u]={type:"cim-marker-transform-info",infos:_};break}case"animation-params":{const{params:_}=h,f=lt(_);if(W(f)){const m=await Promise.all(f.map(p=>K(p,e)));l.set(u,{params:m,propertyIdToResourceId:new Map,key:u})}else{const m=ct(f),p=await t.fetchResourceImmediate({type:"animation-info",resource:m});p!=null&&p.type==="sprite"&&(s[u]={dataRow:p.rect.y,dataColumn:p.rect.x})}break}default:s[u]=h}else s[u]=h}return new ee(i,s,r,a,o,c,d,l)}constructor(e,t,i,s,r,a,o,c){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=i,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=a,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=c,this.evaluator=d=>d}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size||this._dynamicAsyncAnimations.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,i){for(const s of this._dynamicAsyncProperties.values()){const r=Me(s.rasterizationParam.resource);s.rasterizationParam.resource.type==="animated"&&s.rasterizationParam.resource.randomizeStartTime&&(r.primitiveName="__RESERVED__PRIMITIVE__NAME__",r.startGroup=fe(t.getObjectId()||0));for(const{primitiveName:o,propertyName:c,computed:d,defaultValue:l,valueExpressionInfo:u}of s.compiledOverrides)try{const h=s.rasterizationParam.resource.type==="animated"?r.primitiveName:o;Ze(r,h,c,d,t,i,l)}catch(h){ut().errorOnce(new be("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${o}', property: '${c}')`,h))}const a=e.enqueueRequest({type:"cim-rasterization-info",resource:r});s.objectIdToResourceId.set(t.getObjectId(),a)}for(const s of this._dynamicAsyncAnimations.values()){const r=s.params.map(c=>w(c,t,i)).map(j).map(c=>c.simplify()),a=ge(r),o=e.enqueueRequest({type:"animation-info",resource:a});s.propertyIdToResourceId.set(t.getObjectId()+"."+s.key,o)}}evaluateMeshParams(e,t,i){for(const[s,r]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=r.computed.readWithDefault(t,i,r.defaultValue);for(const[s,r]of this._dynamicPlacementProperties.entries())for(const{computed:a,defaultValue:o,propertyName:c}of r.compiledOverrides){const d=a.readWithDefault(t,i,o);r.placementInfo.placement[c]=d,this._resolvedMeshParams[s]=r.placementInfo.placement}for(const[s,r]of this._dynamicEffectProperties.entries())for(const a of r.effects){for(const{computed:o,defaultValue:c,propertyName:d}of a.compiledOverrides){const l=o.readWithDefault(t,i,c);a.effect[d]=l}this._resolvedMeshParams[s]=r.effects.map(o=>o.effect)}for(const[s,r]of this._dynamicTransformProperties.entries()){const a={type:"cim-marker-transform-info",infos:[]};for(const o of r.compiledMarkerInfos){const c={...o.props};if(o.compiledExpressionMap)for(const[d,l]of o.compiledExpressionMap){const u=l.computed.readWithDefault(t,i,l.defaultValue);c[d]=typeof u=="number"||typeof u=="boolean"?u:l.defaultValue}a.infos.push(c)}this._resolvedMeshParams[s]=a}for(const[s,r]of this._dynamicAsyncProperties.entries()){const a=r.objectIdToResourceId.get(t.getObjectId());if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]=o}for(const[s,r]of this._dynamicAsyncAnimations.entries()){const a=r.propertyIdToResourceId.get(t.getObjectId()+"."+s);if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]={dataRow:o.rect.y,dataColumn:o.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}class kt{async createMeshWriter(e,t,i,s){const r=this._getMeshWriter(s.techniqueType),a=await ee.create(e,t,s.inputParams),o=new r(s.id,a,s.optionalAttributes,i);return await o.loadDependencies(),o}_getMeshWriter(e){switch(e){case P.Fill:return Oe;case P.DotDensity:return Ge;case P.ComplexFill:return Fe;case P.PatternFill:return Be;case P.OutlineFill:return Te;case P.PatternOutlineFill:return Re;case P.ComplexOutlineFill:return Ee;case P.Marker:return De;case P.PieChart:return ze;case P.Text:return de;case P.Line:return Le;case P.TexturedLine:return Ae;case P.Heatmap:return ke;case P.Label:return nt;case P.AnimatedMarker:return $e;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}export{kt as d,ht as g}; diff --git a/main/assets/MeshWriterRegistry-CIC9Yk_f-I3l8mR_m.js b/main/assets/MeshWriterRegistry-CIC9Yk_f-I3l8mR_m.js new file mode 100644 index 000000000..75ef1894d --- /dev/null +++ b/main/assets/MeshWriterRegistry-CIC9Yk_f-I3l8mR_m.js @@ -0,0 +1 @@ +import{D as P,K as xe,J as ve,Z as te,u as D,G as z,_ as Pe}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import{f4 as R,aq as B,P as Me,o as be,hE as we,a1 as Ie,ar as Se}from"./main-C7yV2j71.js";import{K as $}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as ke,O as Ae,y as Le,F as de,$ as ze,Q as De,b as Ee,M as Re,k as Te,X as Be,a as Fe,m as Ge,c as Oe,R as me,J as N,g as Ce,d as We,C as E}from"./PieChartMeshWriter-C5yLDFwp-0zzyhiO2.js";import{I as S}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{s as je,l as Z,i as se}from"./Tile-D75RMC64-CM0vKD9b.js";import{m as k,T as ie,j as q,b as Ve,v as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as re}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{o as A}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{R as Ne,n as ae}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{c as Y}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{T as oe,h as Ze}from"./LabelMetric-BeluzH3o-CQPyji82.js";import{e as F}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{r as fe,i as qe}from"./grouping-RwmXkHDc-Cfuv9DrK.js";import{T as Ye}from"./AttributeStore-DjyP9U7y-Du97X0SU.js";let Qe=class extends We{};function Xe(n){const{sprite:e,isMapAligned:t,colorLocked:i,scaleSymbolsProportionally:s,isStroke:r}=n;let a=0;return t&&(a|=E(D.bitset.isMapAligned)),i&&(a|=E(D.bitset.colorLocked)),e.sdf&&(a|=E(D.bitset.isSDF)),s&&(a|=E(D.bitset.scaleSymbolsProportionally)),r&&(a|=E(D.bitset.isStroke)),a}let $e=class extends Qe{get vertexSpec(){return{createComputedParams:n=>{let{pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sizeRatio:a}=n;e||(e=n.sprite.sdf?[0,0]:[n.sprite.width,n.sprite.height]),t||(t=n.sprite.sdf?[0,0]:e),i=R(i),s=R(s),r=R(r);const o=(n.sprite.sdfDecodeCoeff??1)*a;return{...n,pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sdfDecodeCoeff:o}},optionalAttributes:{zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:$,pack:({scaleInfo:n},{tileInfo:e})=>me(n,e)}},attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1,pack:Xe},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:1},offset:{type:S.FLOAT,count:2,packAlternating:{count:4,pack:n=>{const e=n.texelDimensions;return[[-.5*e[0],-.5*e[1]],[.5*e[0],-.5*e[1]],[-.5*e[0],.5*e[1]],[.5*e[0],.5*e[1]]]}}},uv:{type:S.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:n,texXmin:e,texYmax:t,texYmin:i})=>[[e,i],[n,i],[e,t],[n,t]]}},animationPointerAndBaseSizeAndReferenceSize:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:1,pack:({animations:n,baseSize:e,referenceSize:t})=>[n.dataColumn,n.dataRow,e,t]},sizing:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:n,pixelDimensions:e,baseSize:t,sprite:i,sizeRatio:s})=>{const r=Math.max(t*i.width/i.height,t),a=i.sdfDecodeCoeff*r*s;return[e[0],e[1],n,a]}},angle:{type:S.BYTE,count:1,packTessellation:({angle:n})=>n}}}}_write(n,e){const t=this.evaluatedMeshParams.sprite,{textureBinding:i}=t;n.recordStart(this.instanceId,this.attributeLayout,i);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPolygon"){const r=e.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writeQuad(n,s,a,o)}else if(e.geometryType==="esriGeometryPoint"){const r=e.readXForDisplay(),a=e.readYForDisplay();this._writeQuad(n,s,r,a)}else{const r=e.readGeometryForDisplay();if(r){const{angleToLine:a}=this.evaluatedMeshParams;if(a){let o=!0,c=null,d=null;r.forEachVertex((l,u)=>{if(c!=null&&d!=null){const h=Math.atan2(u-d,l-c)/Pe;o&&(this._writeQuad(n,s,c,d,h),o=!1),this._writeQuad(n,s,l,u,h)}c=l,d=u})}else r.forEachVertex((o,c)=>{this._writeQuad(n,s,o,c)})}}n.recordEnd()}_writeQuad(n,e,t,i,s=0){const r=this.evaluatedMeshParams.sprite,{rect:a}=r,o=a.x+2,c=a.y+2,d=a.x+a.width-2,l=a.y+a.height-2,u=n.vertexCount();n.recordBounds(t,i,64,64);const h={texXmin:o,texYmin:c,texXmax:d,texYmax:l,angle:s};for(let _=0;_<4;_++)this._writeVertex(n,e,t,i,h);n.indexEnsureSize(6),n.indexWrite(u),n.indexWrite(u+1),n.indexWrite(u+2),n.indexWrite(u+1),n.indexWrite(u+3),n.indexWrite(u+2)}};function ce(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function pe(n,e){return Math.sqrt(n*n+e*e)}function le(n){const e=pe(n[0],n[1]);n[0]/=e,n[1]/=e}function He(n,e){return pe(n[0]-e[0],n[1]-e[1])}function Je(n,e){return n[e+1]}function _e(n){return n.length-1}function Ue(n){let e=0;for(let t=0;t<_e(n);t++)e+=Ke(n,t);return e}function Ke(n,e,t=1){let[i,s]=Je(n,e);return[i,s]=[Math.round(i),Math.round(s)],Math.sqrt(i*i+s*s)*t}let et=class H{constructor(e,t,i,s,r){this._segments=e,this._index=t,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(e){return new H(e,0,0,e[0][0],e[0][1])}clone(){return new H(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(this._distance===0||e._distance===1)||e._index===this._index+1&&(this._distance===1||e._distance===0)}leq(e){return this._indexe._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let i=Math.acos(t);return e>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<_e(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){const i=this.backwardLength;if(e<=i)return this._distance=(i-e)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>e)return this._seekBackwards(e-s);s+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>e)return this.seek(e-i,t);i+=this.length}return this._distance=1,t?this:null}};function Q(n,e,t,i=!0){const s=Ue(n),r=et.create(n),a=s/2;if(!i)return r.seek(a),void(Math.abs(r.x)=0&&!(i[f+1]i[l]+d);f++){const m=d-i[f-1]+i[l],p=i[f]-i[f-1],g=i[f]-i[l]{let e=0;if(n===0)return 1/0;for(;!(n%2);)e++,n/=2;return e});class nt extends de{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,i!=null)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const r=t.readXForDisplay(),a=t.readYForDisplay();this._writePoint(e,r,a,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const r=t.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writePoint(e,a,o,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_createLineLabelMetric(e,t,i,s){const r=te(e),a=this.evaluatedMeshParams.horizontalAlignment==="right"?-1:1,o=this.evaluatedMeshParams.verticalAlignment==="bottom"?-1:1,c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;return new oe(r,t,i,a,o,c,d,s??null)}_writePoint(e,t,i,s){const r=this._getShaping();if(!r)return;const a=s.getDisplayId(),o=xe(this.evaluatedMeshParams.horizontalAlignment),c=ve(this.evaluatedMeshParams.verticalAlignment),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=te(s.getDisplayId()),h=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new oe(u,t,i,o,c,d,l,h)),this._writeGlyphs(e,a,t,i,r,0,h),e.metricBoxWrite(r.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping("middle");if(!a)return;const o=(d,l,u,h)=>this._placeSubdivGlyphs(d,l,u,h),c=(a.bounds.width+r)/(1<0&&!(!c&&!d);if(i.metricStart(this._createLineLabelMetric(s,e.x,e.y)),_){const f=Math.max(t,a[0],0),m=Math.min(N,a[1]),p=je(Z(),-e.angle),g={minZoom:f,maxZoom:m,clipAngle:u,mapAligned:!0,isLineLabel:!0},y=R(this.evaluatedMeshParams.offsetX),v=R(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const M=re(y,-1*v),[x,I]=r.shapeBackground(se(Z(),p,M));i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const M=re(y,v),[x,I]=r.shapeBackground(se(Z(),p,M));g.clipAngle=h,i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(l,t,1,u,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(l,t,0,h,!0),i.metricEnd()}_placeBack(e,t,i,s,r,a){const o=e.clone();let c=e.backwardLength+L;for(;o.prev()&&!(c>=s);)this._placeOnSegment(o,t,c,i,-1,r,a),c+=o.length+L}_placeForward(e,t,i,s,r,a){const o=e.clone();let c=e.remainingLength+L;for(;o.next()&&!(c>=s);)this._placeOnSegment(o,t,c,i,1,r,a),c+=o.length+L}_placeFirst(e,t,i,s,r=!1){const{out:a,id:o,shaping:c,zoomRange:d,referenceBounds:l}=this._current,u=c.glyphs;for(const h of u){const _=h.x>c.bounds.x?i:1-i,f=_*e.remainingLength+(1-_)*e.backwardLength,m=Math.abs(h.x+h.width/2-c.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(m/(f+L))),g=Math.max(t,r?0:p);h.maxZoom=Math.min(d[1],N),h.angle=e.angle+(1-i)*Math.PI,h.minZoom=Math.max(d[0],g),this._writeLineGlyph(a,o,e.x,e.y,c.bounds,h,s,l,!0),(i||this._current.offsetDirection)&&this._isVisible(h.minZoom,h.maxZoom)&&a.metricBoxWrite(h.bounds)}}_placeOnSegment(e,t,i,s,r,a,o){const{out:c,id:d,shaping:l,referenceBounds:u}=this._current,h=l.glyphs,_=e.dx/e.length,f=e.dy/e.length,m={x:e.x+i*-r*_,y:e.y+i*-r*f};for(const p of h){const g=p.x>l.bounds.x?a:1-a;if(!(g&&r===1||!g&&r===-1))continue;const y=Math.abs(p.x+p.width/2-l.bounds.x),v=Math.max(0,this._zoomLevel+Math.log2(y/i)-.1),M=Math.max(s,this._zoomLevel+Math.log2(y/(i+e.length+L)));v!==0&&(p.angle=e.angle+(1-a)*Math.PI,p.minZoom=M,p.maxZoom=v,this._writeLineGlyph(c,d,m.x,m.y,l.bounds,p,o,u,!0),(a||this._current.offsetDirection)&&this._isVisible(p.minZoom,p.maxZoom)&&c.metricBoxWrite(p.bounds))}}_writeLineGlyph(e,t,i,s,r,a,o,c,d){const l=i+r.x,u=s+r.y,h=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),_=Math.max(r.width,r.height)*h;e.recordStart(this.instanceId,this.attributeLayout,a.textureBinding),e.recordBounds(l,u,_,_);const{texcoords:f,offsets:m}=a,{fontSize:p,haloSize:g,outlineSize:y}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:f,offsets:m,fontSize:p,haloSize:g,outlineSize:y,color:Ce(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:c,minZoom:Math.max(this._current.zoomRange[0],a.minZoom),maxZoom:Math.min(this._current.zoomRange[1],a.maxZoom),clipAngle:o,mapAligned:d,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const i=Math.floor(this._zoomLevel*$)/$;return e<=i&&i<=t}}function he(n,e,t){const{coords:i,lengths:s}=e,r=A(),a=A(),o=A(),c=A(),d=A(),l=A(),u=2;let h=0;for(let _=0;_0?k(r,i[p],i[p+1]):k(r,0,0),k(a,i[g],i[g+1]),mw(e)).map(e=>j(e).simplify()))}function lt(n){const e=[];return e.push(n.transform),e.push(n.fromColor),e.push(n.toColor),e.push(n.colorMix),e.push(n.toOpacity),e.push(n.opacityMix),e}function ge(n){const e=[],t=[];let i=0;for(const s of n){const r=[...s.encode(),...z.ret.encode()];e.push([i+n.length,0,0,0]),t.push(...r),i+=r.length}return[...e,...t]}async function K(n,e){const t=n;let i;if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")i=t;else if(Array.isArray(t))i=await Promise.all(t.map(s=>K(s,e)));else if(typeof t=="object")if("valueExpressionInfo"in t){const{valueExpressionInfo:s}=t,{expression:r}=s;i={...t,computed:await e.createComputedField({expression:r})}}else{i={};for(const s in t)i[s]=await K(t[s],e)}return i}function w(n,e,t){function i(a){if(!("computed"in a))return a;let o=a.computed.readWithDefault(e,t,[255*a.defaultValue[0],255*a.defaultValue[1],255*a.defaultValue[2],a.defaultValue[3]]);if(typeof o=="string"){const c=Se.fromString(o);c&&(o=[c.r,c.g,c.b,c.a])}return o}const s=n;let r;if(typeof s=="number"||typeof s=="string"||typeof s=="boolean")r=s;else if(Array.isArray(s))r=s.map(a=>w(a,e,t));else if(typeof s=="object")if("type"in s&&s.type!=null&&s.type==="Process")switch(s.op){case"ArcadeColor":{const a=w(s.value,e,t);O(Array.isArray(a)&&a.length===4),r=[a[0]/255,a[1]/255,a[2]/255,a[3]]}break;case"Transparency":{const a=w(s.value,e,t);O(typeof a=="number"),r=1-a/100}break;case"Divide":{const a=w(s.left,e,t);O(typeof a=="number");const o=w(s.right,e,t);O(typeof o=="number"),r=a/o}break;case"Random":{const a=w(s.seed,e,t),o=w(s.min,e,t),c=w(s.max,e,t),d=e.getObjectId(),l=fe(d||0);r=o+qe(l,a)*(c-o)}}else if("computed"in s)r=i(s);else{r={};for(const a in s)r[a]=w(s[a],e,t)}return r}function O(n){if(!n)throw new Error("Assertion failed.")}class ht extends Ye{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,i){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}}const ut=()=>Ie.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function C(n,e,t=!1){const{defaultValue:i,valueExpressionInfo:s,value:r}=e;if(s){const{expression:a}=s,o=await n.createComputedField({expression:a},t);return o?{...e,computed:o,defaultValue:i}:null}return{...e,computed:new ht(r),defaultValue:i}}async function ue(n,e){const{valueExpressionInfo:t}=e,{expression:i}=t,s=await n.createComputedField({expression:i});return s?{...e,computed:s}:null}function ye(n){return typeof n=="object"&&n!=null&&(!(!("valueExpressionInfo"in n)||!n.valueExpressionInfo)||"type"in n&&n.type==="Process"&&"op"in n&&n.op==="Random")}function W(n){if(Array.isArray(n)){for(const e of n)if(W(e))return!0}if(typeof n=="object"){if(ye(n))return!0;for(const e in n)if(W(n[e]))return!0}return!1}class ee{static async create(e,t,i){const s={},r=new Map,a=new Map,o=new Map,c=new Map,d=new Map,l=new Map;for(const u in i){const h=i[u];if(h!=null&&typeof h=="object")if(Array.isArray(h)){if(typeof h[0]=="object")throw new Error(`InternalError: Cannot handle ${u}. Nested array params are not supported`);s[u]=h}else if("valueExpressionInfo"in h){if(h.value){s[u]=h.value;continue}const _=await ue(e,h);if(!_){s[u]=h.defaultValue;continue}r.set(u,_),s[u]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some(_=>_.overrides.length)){a.set(u,{effects:await Promise.all(h.effectInfos.map(async _=>{const f=_.overrides.map(m=>C(e,m));return{effect:_.effect,compiledOverrides:(await Promise.all(f)).filter(B)}}))});break}s[u]=h.effectInfos.map(_=>_.effect);break;case"cim-marker-placement-param":h.overrides.length&&o.set(u,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map(_=>C(e,_)))).filter(B)}),s[u]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m,h.useLegacyLabelEvaluationRules));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}if(h.resource.type==="animated"){c.set(u,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"cim-marker-transform-param":{const{params:_}=h;if(W(_)){const f={compiledMarkerInfos:[]};await Promise.all(_.map(async m=>{const p={props:{}};for(const g in m)if(ye(m[g])){const y=await ue(e,m[g]);p.compiledExpressionMap||(p.compiledExpressionMap=new Map);const v=p.compiledExpressionMap;y&&v.set(g,y)}else p.props[g]=m[g];f.compiledMarkerInfos.push(p)})),d.set(u,f)}else s[u]={type:"cim-marker-transform-info",infos:_};break}case"animation-params":{const{params:_}=h,f=lt(_);if(W(f)){const m=await Promise.all(f.map(p=>K(p,e)));l.set(u,{params:m,propertyIdToResourceId:new Map,key:u})}else{const m=ct(f),p=await t.fetchResourceImmediate({type:"animation-info",resource:m});p!=null&&p.type==="sprite"&&(s[u]={dataRow:p.rect.y,dataColumn:p.rect.x})}break}default:s[u]=h}else s[u]=h}return new ee(i,s,r,a,o,c,d,l)}constructor(e,t,i,s,r,a,o,c){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=i,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=a,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=c,this.evaluator=d=>d}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size||this._dynamicAsyncAnimations.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,i){for(const s of this._dynamicAsyncProperties.values()){const r=Me(s.rasterizationParam.resource);s.rasterizationParam.resource.type==="animated"&&s.rasterizationParam.resource.randomizeStartTime&&(r.primitiveName="__RESERVED__PRIMITIVE__NAME__",r.startGroup=fe(t.getObjectId()||0));for(const{primitiveName:o,propertyName:c,computed:d,defaultValue:l,valueExpressionInfo:u}of s.compiledOverrides)try{const h=s.rasterizationParam.resource.type==="animated"?r.primitiveName:o;Ze(r,h,c,d,t,i,l)}catch(h){ut().errorOnce(new be("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${o}', property: '${c}')`,h))}const a=e.enqueueRequest({type:"cim-rasterization-info",resource:r});s.objectIdToResourceId.set(t.getObjectId(),a)}for(const s of this._dynamicAsyncAnimations.values()){const r=s.params.map(c=>w(c,t,i)).map(j).map(c=>c.simplify()),a=ge(r),o=e.enqueueRequest({type:"animation-info",resource:a});s.propertyIdToResourceId.set(t.getObjectId()+"."+s.key,o)}}evaluateMeshParams(e,t,i){for(const[s,r]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=r.computed.readWithDefault(t,i,r.defaultValue);for(const[s,r]of this._dynamicPlacementProperties.entries())for(const{computed:a,defaultValue:o,propertyName:c}of r.compiledOverrides){const d=a.readWithDefault(t,i,o);r.placementInfo.placement[c]=d,this._resolvedMeshParams[s]=r.placementInfo.placement}for(const[s,r]of this._dynamicEffectProperties.entries())for(const a of r.effects){for(const{computed:o,defaultValue:c,propertyName:d}of a.compiledOverrides){const l=o.readWithDefault(t,i,c);a.effect[d]=l}this._resolvedMeshParams[s]=r.effects.map(o=>o.effect)}for(const[s,r]of this._dynamicTransformProperties.entries()){const a={type:"cim-marker-transform-info",infos:[]};for(const o of r.compiledMarkerInfos){const c={...o.props};if(o.compiledExpressionMap)for(const[d,l]of o.compiledExpressionMap){const u=l.computed.readWithDefault(t,i,l.defaultValue);c[d]=typeof u=="number"||typeof u=="boolean"?u:l.defaultValue}a.infos.push(c)}this._resolvedMeshParams[s]=a}for(const[s,r]of this._dynamicAsyncProperties.entries()){const a=r.objectIdToResourceId.get(t.getObjectId());if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]=o}for(const[s,r]of this._dynamicAsyncAnimations.entries()){const a=r.propertyIdToResourceId.get(t.getObjectId()+"."+s);if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]={dataRow:o.rect.y,dataColumn:o.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}class kt{async createMeshWriter(e,t,i,s){const r=this._getMeshWriter(s.techniqueType),a=await ee.create(e,t,s.inputParams),o=new r(s.id,a,s.optionalAttributes,i);return await o.loadDependencies(),o}_getMeshWriter(e){switch(e){case P.Fill:return Oe;case P.DotDensity:return Ge;case P.ComplexFill:return Fe;case P.PatternFill:return Be;case P.OutlineFill:return Te;case P.PatternOutlineFill:return Re;case P.ComplexOutlineFill:return Ee;case P.Marker:return De;case P.PieChart:return ze;case P.Text:return de;case P.Line:return Le;case P.TexturedLine:return Ae;case P.Heatmap:return ke;case P.Label:return nt;case P.AnimatedMarker:return $e;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}export{kt as d,ht as g}; diff --git a/main/assets/MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js b/main/assets/MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js new file mode 100644 index 000000000..099769aec --- /dev/null +++ b/main/assets/MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js @@ -0,0 +1 @@ +import{v as l,i as c,bU as g,dg as N,dh as w,bO as h,bY as J,j as M,di as _,bP as u,P as d,dj as m,aR as U}from"./main-C7yV2j71.js";class f{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(_),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new f,s=this._originStores[u.DEFAULTS];s&&s.forEach((i,r)=>{t.set(r,d(i),u.DEFAULTS)});for(let i=u.SERVICE;i<_;i++){const r=this._originStores[i];r&&r.forEach((o,n)=>{e&&e.has(n)||t.set(n,d(o),i)})}return t}get(e,t){const s=t===void 0?this._values:this._originStores[t];return s?s.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,s=u.USER){let i=this._originStores[s];if(i||(i=new Map,this._originStores[s]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=s){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,s),r!==t}return!1}delete(e,t=u.USER){const s=this._originStores[t];if(!s)return;const i=s.get(e);if(s.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const o=this._originStores[r];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const s=t===void 0?this._values:this._originStores[t];return!!s&&s.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const s=this._originStores[t],i=s?.get(e),r=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),r!==i}originOf(e){return this._propertyOriginMap.get(e)||u.DEFAULTS}forEach(e){this._values.forEach(e)}}const E=a=>{let e=class extends a{constructor(...t){super(...t);const s=g(this),i=s.store,r=new f;s.store=r,N(s,i,r)}read(t,s){w(this,t,s)}getAtOrigin(t,s){const i=O(this),r=h(s);if(typeof t=="string")return i.get(t,r);const o={};return t.forEach(n=>{o[n]=i.get(n,r)}),o}originOf(t){return J(this.originIdOf(t))}originIdOf(t){return O(this).originOf(t)}revert(t,s){const i=O(this),r=h(s),o=g(this);let n;n=typeof t=="string"?t==="*"?i.keys(r):[t]:t,n.forEach(p=>{o.invalidate(p),i.revert(p,r),o.commit(p)})}};return e=l([c("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function O(a){return g(a).store}let v=class extends E(M){};v=l([c("esri.core.ReadOnlyMultiOriginJSONSupport")],v);const x=a=>{let e=class extends a{constructor(...t){super(...t)}clear(t,s="user"){return S(this).delete(t,h(s))}write(t,s){return m(this,t=t||{},s),t}setAtOrigin(t,s,i){g(this).setAtOrigin(t,s,h(i))}removeOrigin(t){const s=S(this),i=h(t),r=s.keys(i);for(const o of r)s.originOf(o)===i&&s.set(o,s.get(o,i),u.USER)}updateOrigin(t,s){const i=S(this),r=h(s),o=U(this,t);for(let n=r+1;n<_;++n)i.delete(t,n);i.set(t,o,r)}toJSON(t){return this.write({},t)}};return e=l([c("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function S(a){return g(a).store}const A=a=>{let e=class extends x(E(a)){constructor(...t){super(...t)}};return e=l([c("esri.core.MultiOriginJSONSupport")],e),e};let y=class extends A(M){};y=l([c("esri.core.MultiOriginJSONSupport")],y);export{y as _,A as m}; diff --git a/main/assets/MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js b/main/assets/MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js deleted file mode 100644 index 7998152e8..000000000 --- a/main/assets/MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js +++ /dev/null @@ -1 +0,0 @@ -import{v as l,i as c,bU as g,dg as N,dh as w,bO as h,bY as J,j as M,di as _,bP as u,P as d,dj as m,aR as U}from"./main-BZaw9FpY.js";class f{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(_),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new f,s=this._originStores[u.DEFAULTS];s&&s.forEach((i,r)=>{t.set(r,d(i),u.DEFAULTS)});for(let i=u.SERVICE;i<_;i++){const r=this._originStores[i];r&&r.forEach((o,n)=>{e&&e.has(n)||t.set(n,d(o),i)})}return t}get(e,t){const s=t===void 0?this._values:this._originStores[t];return s?s.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,s=u.USER){let i=this._originStores[s];if(i||(i=new Map,this._originStores[s]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=s){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,s),r!==t}return!1}delete(e,t=u.USER){const s=this._originStores[t];if(!s)return;const i=s.get(e);if(s.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const o=this._originStores[r];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const s=t===void 0?this._values:this._originStores[t];return!!s&&s.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const s=this._originStores[t],i=s?.get(e),r=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),r!==i}originOf(e){return this._propertyOriginMap.get(e)||u.DEFAULTS}forEach(e){this._values.forEach(e)}}const E=a=>{let e=class extends a{constructor(...t){super(...t);const s=g(this),i=s.store,r=new f;s.store=r,N(s,i,r)}read(t,s){w(this,t,s)}getAtOrigin(t,s){const i=O(this),r=h(s);if(typeof t=="string")return i.get(t,r);const o={};return t.forEach(n=>{o[n]=i.get(n,r)}),o}originOf(t){return J(this.originIdOf(t))}originIdOf(t){return O(this).originOf(t)}revert(t,s){const i=O(this),r=h(s),o=g(this);let n;n=typeof t=="string"?t==="*"?i.keys(r):[t]:t,n.forEach(p=>{o.invalidate(p),i.revert(p,r),o.commit(p)})}};return e=l([c("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function O(a){return g(a).store}let v=class extends E(M){};v=l([c("esri.core.ReadOnlyMultiOriginJSONSupport")],v);const x=a=>{let e=class extends a{constructor(...t){super(...t)}clear(t,s="user"){return S(this).delete(t,h(s))}write(t,s){return m(this,t=t||{},s),t}setAtOrigin(t,s,i){g(this).setAtOrigin(t,s,h(i))}removeOrigin(t){const s=S(this),i=h(t),r=s.keys(i);for(const o of r)s.originOf(o)===i&&s.set(o,s.get(o,i),u.USER)}updateOrigin(t,s){const i=S(this),r=h(s),o=U(this,t);for(let n=r+1;n<_;++n)i.delete(t,n);i.set(t,o,r)}toJSON(t){return this.write({},t)}};return e=l([c("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function S(a){return g(a).store}const A=a=>{let e=class extends x(E(a)){constructor(...t){super(...t)}};return e=l([c("esri.core.MultiOriginJSONSupport")],e),e};let y=class extends A(M){};y=l([c("esri.core.MultiOriginJSONSupport")],y);export{y as _,A as m}; diff --git a/main/assets/NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js b/main/assets/NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js new file mode 100644 index 000000000..61410de45 --- /dev/null +++ b/main/assets/NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js @@ -0,0 +1,11 @@ +import"./main-C7yV2j71.js";import{t as u}from"./compilerUtils-CV1QYWI8-89qN_-l3.js";import{e as n}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as a}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";var r;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(r||(r={}));var o;function N(e){return e===o.Shadow||e===o.ShadowHighlight||e===o.ShadowExcludeHighlight||e===o.ViewshedShadow}function b(e){return p(e)||e===o.Normal}function O(e){return f(e)||e===o.Normal}function d(e){return e===o.Highlight||e===o.ObjectAndLayerIdColor}function l(e){return e===o.Color}function s(e){return l(e)||g(e)}function h(e){return l(e)||d(e)}function m(e){return s(e)||d(e)}function p(e){return h(e)||c(e)}function f(e){return m(e)||c(e)}function c(e){return e===o.Depth}function g(e){return e===o.ColorEmission}(function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"})(o||(o={}));function T(e,i){switch(i.normalType){case t.Compressed:e.attributes.add(a.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(n`vec3 decompressNormal(vec2 normal) { +float z = 1.0 - abs(normal.x) - abs(normal.y); +return vec3(normal + sign(normal) * min(z, 0.0), z); +} +vec3 normalModel() { +return decompressNormal(normalCompressed); +}`);break;case t.Attribute:e.attributes.add(a.NORMAL,"vec3"),e.vertex.code.add(n`vec3 normalModel() { +return normal; +}`);break;case t.ScreenDerivative:e.fragment.code.add(n`vec3 screenDerivativeNormal(vec3 positionView) { +return normalize(cross(dFdx(positionView), dFdy(positionView))); +}`);break;default:u(i.normalType);case t.COUNT:}}var t;(function(e){e[e.Attribute=0]="Attribute",e[e.Compressed=1]="Compressed",e[e.ScreenDerivative=2]="ScreenDerivative",e[e.COUNT=3]="COUNT"})(t||(t={}));export{T as S,s as c,b as f,O as g,g as h,r as i,o,N as p,h as s,t}; diff --git a/main/assets/NormalAttribute.glsl-axtNsUxo-corrAl_5.js b/main/assets/NormalAttribute.glsl-axtNsUxo-corrAl_5.js deleted file mode 100644 index ac6eeee28..000000000 --- a/main/assets/NormalAttribute.glsl-axtNsUxo-corrAl_5.js +++ /dev/null @@ -1,11 +0,0 @@ -import"./main-BZaw9FpY.js";import{t as u}from"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import{e as n}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as a}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";var r;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(r||(r={}));var o;function N(e){return e===o.Shadow||e===o.ShadowHighlight||e===o.ShadowExcludeHighlight||e===o.ViewshedShadow}function b(e){return p(e)||e===o.Normal}function O(e){return f(e)||e===o.Normal}function d(e){return e===o.Highlight||e===o.ObjectAndLayerIdColor}function l(e){return e===o.Color}function s(e){return l(e)||g(e)}function h(e){return l(e)||d(e)}function m(e){return s(e)||d(e)}function p(e){return h(e)||c(e)}function f(e){return m(e)||c(e)}function c(e){return e===o.Depth}function g(e){return e===o.ColorEmission}(function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"})(o||(o={}));function T(e,i){switch(i.normalType){case t.Compressed:e.attributes.add(a.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(n`vec3 decompressNormal(vec2 normal) { -float z = 1.0 - abs(normal.x) - abs(normal.y); -return vec3(normal + sign(normal) * min(z, 0.0), z); -} -vec3 normalModel() { -return decompressNormal(normalCompressed); -}`);break;case t.Attribute:e.attributes.add(a.NORMAL,"vec3"),e.vertex.code.add(n`vec3 normalModel() { -return normal; -}`);break;case t.ScreenDerivative:e.fragment.code.add(n`vec3 screenDerivativeNormal(vec3 positionView) { -return normalize(cross(dFdx(positionView), dFdy(positionView))); -}`);break;default:u(i.normalType);case t.COUNT:}}var t;(function(e){e[e.Attribute=0]="Attribute",e[e.Compressed=1]="Compressed",e[e.ScreenDerivative=2]="ScreenDerivative",e[e.COUNT=3]="COUNT"})(t||(t={}));export{T as S,s as c,b as f,O as g,g as h,r as i,o,N as p,h as s,t}; diff --git a/main/assets/OGCFeatureLayer-DPXQjO1S-CmSpZQWR.js b/main/assets/OGCFeatureLayer-DPXQjO1S-CmSpZQWR.js new file mode 100644 index 000000000..87caf482c --- /dev/null +++ b/main/assets/OGCFeatureLayer-DPXQjO1S-CmSpZQWR.js @@ -0,0 +1 @@ +import{v as t,S as o,i as D,bT as w,em as L,n as H,bW as b,bL as J,J as g,aB as N,cJ as x,ek as Z,o as R}from"./main-C7yV2j71.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{m as z,u as V}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{m as k}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as U}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{T as W,y as I,j as F,I as K,h as Y,b as X,F as ee,w as te,M as re}from"./ogcFeatureUtils-Bs12bZY3-Dzw8-_6l.js";import{s as oe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{O as ie}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{n as se}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{u as pe}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{l as ae}from"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import{E as ue}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{p as de}from"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import{C as ce}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as me}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as ye}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{$ as he,Y as ge,_ as ve,X as Se,V as Ce,Z as we}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{y as be}from"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import{y as xe}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{f as Re}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{C as Ie,q as Fe}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{b as T}from"./Query-BrwMGK8U-DV_czrJX.js";import{w as Te}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./geojson-CNt_qtQf-utywq02B.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-B0cLE-po.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./sourceUtils-BMeqkJ5g-C2dbTHus.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";let d=class extends N{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:i,spatialReference:s,supportedCrs:p},layer:{apiKey:l,customParameters:a,effectiveMaxRecordCount:n}}=this;return{type:"ogc-source",collection:e,layerDefinition:i,maxRecordCount:n,queryParameters:{apiKey:l,customParameters:a},spatialReference:s,supportedCrs:p}}queryExtent(e,i={}){return null}queryFeatureCount(e,i={}){return null}queryFeatures(e,i={}){return this.queryFeaturesJSON(e,i).then(s=>ie.fromJSON(s))}queryFeaturesJSON(e,i={}){const s=this.getSource();return this.load(i).then(()=>W(s,e,i))}queryObjectIds(e,i={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,i){const s=new RegExp(`^${x(i)}$`,"i");return e.conformsTo.some(p=>s.test(p))??!1}_getCapabilities(e,i){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:i,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryBins:oe,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const i=e?.components?.parameters;return i?.limit?.schema?.maximum??i?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const i=e.storageCrs??I,s=F(i);return s==null?g.WGS84:new g({wkid:s})}_getSupportedSpatialReferences(e,i){const s="#/crs",p=e.crs??[I],l=p.includes(s)?p.filter(n=>n!==s).concat(i.crs??[]):p,a=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return l.filter(n=>!a.test(n))}async _loadOGCServices(e,i){const s=i!=null?i.signal:null,{apiKey:p,collectionId:l,customParameters:a,fields:n,geometryType:O,hasZ:j,objectIdField:P,timeInfo:_,url:E}=e,q={fields:n?.map(u=>u.toJSON()),geometryType:Z.toJSON(O),hasZ:j??!1,objectIdField:P,timeInfo:_?.toJSON()},c={apiKey:p,customParameters:a,signal:s},y=await K(E,c),[v,S]=await Promise.all([Y(y,c),X(y,c)]);if(!this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new R("ogc-feature-layer:no-geojson-support","Server does not support geojson");const m=S.collections.find(({id:u})=>u===l);if(!m)throw new R("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const Q=this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ee(y,c):null,C=await te(m,q,c),B=this._getMaxRecordCount(Q),G=this._getCapabilities(C.hasZ,B),A=this._getStorageSpatialReference(m).toJSON(),M=this._getSupportedSpatialReferences(m,S),$=new RegExp(`^${x(re)}`,"i"),f={};for(const u of M){const h=F(u);h!=null&&(f[h]||(f[h]=u.replace($,"")))}this.featureDefinition={capabilities:G,collection:m,layerDefinition:C,spatialReference:A,supportedCrs:f}}};t([o()],d.prototype,"featureDefinition",void 0),t([o({constructOnly:!0})],d.prototype,"layer",void 0),t([o()],d.prototype,"type",void 0),d=t([D("esri.layers.graphics.sources.OGCFeatureSource")],d);const De=Re();let r=class extends se(ne(le(ae(pe(de(fe(ye(ue(ce(me(k(U)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){w(e,this.fieldsIndex),this._set("renderer",e)}on(e,i){return super.on(e,i)}createPopupTemplate(e){return Te(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){let s,p=!1;const l=i?.feature?.attributes,a=this.typeIdField&&l?.[this.typeIdField];return a!=null&&this.types&&(p=this.types.some(n=>n.id==a&&(s=n.domains?.[e],s?.type==="inherited"&&(s=this._getLayerDomain(e)),!0))),p||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,i){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),i)).then(s=>(s?.features?.forEach(p=>{p.layer=p.sourceLayer=this}),s))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),w(this.renderer,this.fieldsIndex),L(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const i of this.fields)if(i.name===e&&i.domain)return i.domain;return null}};t([o({readOnly:!0,json:{origins:{service:{read:!0}}}})],r.prototype,"capabilities",void 0),t([o({type:String,json:{write:!0}})],r.prototype,"collectionId",void 0),t([o({type:String})],r.prototype,"copyright",void 0),t([o({readOnly:!0})],r.prototype,"defaultPopupTemplate",null),t([o({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],r.prototype,"description",void 0),t([o({type:String})],r.prototype,"displayField",void 0),t([o({type:Number})],r.prototype,"effectiveMaxRecordCount",null),t([o(he)],r.prototype,"elevationInfo",void 0),t([o({type:[xe],json:{origins:{service:{name:"layerDefinition.fields"}}}})],r.prototype,"fields",void 0),t([o(De.fieldsIndex)],r.prototype,"fieldsIndex",void 0),t([o({readOnly:!0,type:H,json:{origins:{service:{name:"layerDefinition.extent"}}}})],r.prototype,"fullExtent",void 0),t([o({type:b.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:b.read}}}}})],r.prototype,"geometryType",void 0),t([o({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],r.prototype,"hasZ",void 0),t([o({type:Boolean,readOnly:!0})],r.prototype,"isTable",null),t([o({type:[Ie],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Fe},write:!0}}}})],r.prototype,"labelingInfo",void 0),t([o(ge)],r.prototype,"labelsVisible",void 0),t([o(ve)],r.prototype,"legendEnabled",void 0),t([o({type:Number})],r.prototype,"maxRecordCount",void 0),t([o({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],r.prototype,"objectIdField",void 0),t([o({type:["OGCFeatureLayer"]})],r.prototype,"operationalLayerType",void 0),t([o(Se)],r.prototype,"popupEnabled",void 0),t([o({type:J,json:{name:"popupInfo",write:!0}})],r.prototype,"popupTemplate",void 0),t([o({types:z,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:V,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],r.prototype,"renderer",null),t([o(Ce)],r.prototype,"screenSizePerspectiveEnabled",void 0),t([o({readOnly:!0})],r.prototype,"source",void 0),t([o({readOnly:!0,type:g,json:{origins:{service:{read:!0}}}})],r.prototype,"spatialReference",void 0),t([o({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],r.prototype,"title",void 0),t([o({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([o({type:String,readOnly:!0})],r.prototype,"typeIdField",void 0),t([o({type:[be]})],r.prototype,"types",void 0),t([o(we)],r.prototype,"url",void 0),r=t([D("esri.layers.OGCFeatureLayer")],r);const Yt=r;export{Yt as default}; diff --git a/main/assets/OGCFeatureLayer-DPXQjO1S-rxAMv6lM.js b/main/assets/OGCFeatureLayer-DPXQjO1S-rxAMv6lM.js deleted file mode 100644 index 9fec70625..000000000 --- a/main/assets/OGCFeatureLayer-DPXQjO1S-rxAMv6lM.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as o,i as D,bT as w,em as L,n as H,bW as b,bL as J,J as g,aB as N,cJ as x,ek as Z,o as R}from"./main-BZaw9FpY.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{m as z,u as V}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as k}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as U}from"./Layer-ChoECxvZ-C4wLrCej.js";import{T as W,y as I,j as F,I as K,h as Y,b as X,F as ee,w as te,M as re}from"./ogcFeatureUtils-Bs12bZY3-DAr9GIuj.js";import{s as oe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{O as ie}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{n as se}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{u as pe}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{l as ae}from"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import{E as ue}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{p as de}from"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import{C as ce}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as me}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as ye}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{$ as he,Y as ge,_ as ve,X as Se,V as Ce,Z as we}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{y as be}from"./FeatureType-C9hJmS6_-pVJc0p7X.js";import{y as xe}from"./Field-C6hA1tZj-CbELM0zp.js";import{f as Re}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{C as Ie,q as Fe}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{b as T}from"./Query-BrwMGK8U-sojFdYaD.js";import{w as Te}from"./popupUtils-B0uZcXX0-BqljON9c.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./geojson-CNt_qtQf-BQNqVsVZ.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-BMC57bnT.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./sourceUtils-BMeqkJ5g-CD_x4f6t.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";let d=class extends N{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:i,spatialReference:s,supportedCrs:p},layer:{apiKey:l,customParameters:a,effectiveMaxRecordCount:n}}=this;return{type:"ogc-source",collection:e,layerDefinition:i,maxRecordCount:n,queryParameters:{apiKey:l,customParameters:a},spatialReference:s,supportedCrs:p}}queryExtent(e,i={}){return null}queryFeatureCount(e,i={}){return null}queryFeatures(e,i={}){return this.queryFeaturesJSON(e,i).then(s=>ie.fromJSON(s))}queryFeaturesJSON(e,i={}){const s=this.getSource();return this.load(i).then(()=>W(s,e,i))}queryObjectIds(e,i={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,i){const s=new RegExp(`^${x(i)}$`,"i");return e.conformsTo.some(p=>s.test(p))??!1}_getCapabilities(e,i){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:i,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryBins:oe,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const i=e?.components?.parameters;return i?.limit?.schema?.maximum??i?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const i=e.storageCrs??I,s=F(i);return s==null?g.WGS84:new g({wkid:s})}_getSupportedSpatialReferences(e,i){const s="#/crs",p=e.crs??[I],l=p.includes(s)?p.filter(n=>n!==s).concat(i.crs??[]):p,a=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return l.filter(n=>!a.test(n))}async _loadOGCServices(e,i){const s=i!=null?i.signal:null,{apiKey:p,collectionId:l,customParameters:a,fields:n,geometryType:O,hasZ:j,objectIdField:P,timeInfo:_,url:E}=e,q={fields:n?.map(u=>u.toJSON()),geometryType:Z.toJSON(O),hasZ:j??!1,objectIdField:P,timeInfo:_?.toJSON()},c={apiKey:p,customParameters:a,signal:s},y=await K(E,c),[v,S]=await Promise.all([Y(y,c),X(y,c)]);if(!this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new R("ogc-feature-layer:no-geojson-support","Server does not support geojson");const m=S.collections.find(({id:u})=>u===l);if(!m)throw new R("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const Q=this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ee(y,c):null,C=await te(m,q,c),B=this._getMaxRecordCount(Q),G=this._getCapabilities(C.hasZ,B),A=this._getStorageSpatialReference(m).toJSON(),M=this._getSupportedSpatialReferences(m,S),$=new RegExp(`^${x(re)}`,"i"),f={};for(const u of M){const h=F(u);h!=null&&(f[h]||(f[h]=u.replace($,"")))}this.featureDefinition={capabilities:G,collection:m,layerDefinition:C,spatialReference:A,supportedCrs:f}}};t([o()],d.prototype,"featureDefinition",void 0),t([o({constructOnly:!0})],d.prototype,"layer",void 0),t([o()],d.prototype,"type",void 0),d=t([D("esri.layers.graphics.sources.OGCFeatureSource")],d);const De=Re();let r=class extends se(ne(le(ae(pe(de(fe(ye(ue(ce(me(k(U)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){w(e,this.fieldsIndex),this._set("renderer",e)}on(e,i){return super.on(e,i)}createPopupTemplate(e){return Te(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){let s,p=!1;const l=i?.feature?.attributes,a=this.typeIdField&&l?.[this.typeIdField];return a!=null&&this.types&&(p=this.types.some(n=>n.id==a&&(s=n.domains?.[e],s?.type==="inherited"&&(s=this._getLayerDomain(e)),!0))),p||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,i){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),i)).then(s=>(s?.features?.forEach(p=>{p.layer=p.sourceLayer=this}),s))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),w(this.renderer,this.fieldsIndex),L(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const i of this.fields)if(i.name===e&&i.domain)return i.domain;return null}};t([o({readOnly:!0,json:{origins:{service:{read:!0}}}})],r.prototype,"capabilities",void 0),t([o({type:String,json:{write:!0}})],r.prototype,"collectionId",void 0),t([o({type:String})],r.prototype,"copyright",void 0),t([o({readOnly:!0})],r.prototype,"defaultPopupTemplate",null),t([o({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],r.prototype,"description",void 0),t([o({type:String})],r.prototype,"displayField",void 0),t([o({type:Number})],r.prototype,"effectiveMaxRecordCount",null),t([o(he)],r.prototype,"elevationInfo",void 0),t([o({type:[xe],json:{origins:{service:{name:"layerDefinition.fields"}}}})],r.prototype,"fields",void 0),t([o(De.fieldsIndex)],r.prototype,"fieldsIndex",void 0),t([o({readOnly:!0,type:H,json:{origins:{service:{name:"layerDefinition.extent"}}}})],r.prototype,"fullExtent",void 0),t([o({type:b.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:b.read}}}}})],r.prototype,"geometryType",void 0),t([o({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],r.prototype,"hasZ",void 0),t([o({type:Boolean,readOnly:!0})],r.prototype,"isTable",null),t([o({type:[Ie],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Fe},write:!0}}}})],r.prototype,"labelingInfo",void 0),t([o(ge)],r.prototype,"labelsVisible",void 0),t([o(ve)],r.prototype,"legendEnabled",void 0),t([o({type:Number})],r.prototype,"maxRecordCount",void 0),t([o({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],r.prototype,"objectIdField",void 0),t([o({type:["OGCFeatureLayer"]})],r.prototype,"operationalLayerType",void 0),t([o(Se)],r.prototype,"popupEnabled",void 0),t([o({type:J,json:{name:"popupInfo",write:!0}})],r.prototype,"popupTemplate",void 0),t([o({types:z,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:V,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],r.prototype,"renderer",null),t([o(Ce)],r.prototype,"screenSizePerspectiveEnabled",void 0),t([o({readOnly:!0})],r.prototype,"source",void 0),t([o({readOnly:!0,type:g,json:{origins:{service:{read:!0}}}})],r.prototype,"spatialReference",void 0),t([o({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],r.prototype,"title",void 0),t([o({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([o({type:String,readOnly:!0})],r.prototype,"typeIdField",void 0),t([o({type:[be]})],r.prototype,"types",void 0),t([o(we)],r.prototype,"url",void 0),r=t([D("esri.layers.OGCFeatureLayer")],r);const Yt=r;export{Yt as default}; diff --git a/main/assets/OGCFeatureLayerView2D-CpSy5D2s-BVehOQQd.js b/main/assets/OGCFeatureLayerView2D-CpSy5D2s-BVehOQQd.js new file mode 100644 index 000000000..aa1c630ce --- /dev/null +++ b/main/assets/OGCFeatureLayerView2D-CpSy5D2s-BVehOQQd.js @@ -0,0 +1 @@ +import{v as t,i as m,S as o}from"./main-C7yV2j71.js";import{r as a}from"./FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./LayerView-Bish-E63-I2LV0oDm.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./SDFHelper-B6k8Ig6R-C81pIMYz.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-X6GWMgRY.js";import"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";const s=i=>{let r=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return t([o()],r.prototype,"layer",void 0),t([o({readOnly:!0})],r.prototype,"availableFields",null),r=t([m("esri.views.layers.OGCFeatureLayerView")],r),r};let p=class extends s(a){supportsSpatialReference(i){return this.layer.serviceSupportsSpatialReference(i)}};p=t([m("esri.views.2d.layers.OGCFeatureLayerView2D")],p);const at=p;export{at as default}; diff --git a/main/assets/OGCFeatureLayerView2D-CpSy5D2s-D3QUvTvd.js b/main/assets/OGCFeatureLayerView2D-CpSy5D2s-D3QUvTvd.js deleted file mode 100644 index 666d1f72e..000000000 --- a/main/assets/OGCFeatureLayerView2D-CpSy5D2s-D3QUvTvd.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,i as m,S as o}from"./main-BZaw9FpY.js";import{r as a}from"./FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./timeSupport-ohWmWReZ-CwKm-94j.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./LayerView-Bish-E63-DRGspiuk.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./SDFHelper-B6k8Ig6R-KWOw5fv6.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-xbvi-u4x.js";import"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";const s=i=>{let r=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return t([o()],r.prototype,"layer",void 0),t([o({readOnly:!0})],r.prototype,"availableFields",null),r=t([m("esri.views.layers.OGCFeatureLayerView")],r),r};let p=class extends s(a){supportsSpatialReference(i){return this.layer.serviceSupportsSpatialReference(i)}};p=t([m("esri.views.2d.layers.OGCFeatureLayerView2D")],p);const at=p;export{at as default}; diff --git a/main/assets/Octree-CJNwbhg4-D0u91mrh.js b/main/assets/Octree-CJNwbhg4-D0u91mrh.js new file mode 100644 index 000000000..db61e41c2 --- /dev/null +++ b/main/assets/Octree-CJNwbhg4-D0u91mrh.js @@ -0,0 +1 @@ +import{ec as mt,dD as v,dU as F,hZ as m}from"./main-C7yV2j71.js";import{A as Z,X as Ot,_ as Rt,L as q,j as k,p as Q}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{X as ht,d as tt,C as w,l as et,a as J,G as nt,F as T,b as z}from"./sphere-BenPORjV-CiIWUavi.js";import{B as pt,z as At}from"./mat4-DX7gBViE-vewreEuZ.js";import{D as bt}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{e as M}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{y as A,j as Ft,o as Et,J as Nt,G as L}from"./plane-Dt8R0KeE-CdQQbSdq.js";import{l as at}from"./Util-BjGjeg6f-08Szkf4F.js";function lt(o){return o?{ray:tt(o.ray),c0:o.c0,c1:o.c1}:{ray:tt(),c0:0,c1:Number.MAX_VALUE}}new ht(()=>lt());function Xt(o){return o?[A(o[0]),A(o[1]),A(o[2]),A(o[3]),A(o[4]),A(o[5])]:[A(),A(),A(),A(),A(),A()]}function gt(){return[F(),F(),F(),F(),F(),F(),F(),F()]}function Vt(o,t){for(let e=0;e=t[3])return!1}return!0}var B,i;(function(o){o[o.LEFT=0]="LEFT",o[o.RIGHT=1]="RIGHT",o[o.BOTTOM=2]="BOTTOM",o[o.TOP=3]="TOP",o[o.NEAR=4]="NEAR",o[o.FAR=5]="FAR"})(B||(B={})),function(o){o[o.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",o[o.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",o[o.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",o[o.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",o[o.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",o[o.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",o[o.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",o[o.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(i||(i={})),i.FAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_LEFT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_BOTTOM_RIGHT,i.NEAR_TOP_RIGHT,i.NEAR_TOP_LEFT,i.FAR_BOTTOM_RIGHT,i.FAR_BOTTOM_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_RIGHT,i.NEAR_BOTTOM_RIGHT,i.FAR_BOTTOM_RIGHT,i.FAR_TOP_RIGHT,i.NEAR_TOP_RIGHT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_TOP_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_LEFT,i.NEAR_TOP_LEFT,i.NEAR_TOP_RIGHT,i.FAR_TOP_RIGHT;const dt=6,Bt=8,St=[M(-1,-1,-1,1),M(1,-1,-1,1),M(1,1,-1,1),M(-1,1,-1,1),M(-1,-1,1,1),M(1,-1,1,1),M(1,1,1,1),M(-1,1,1,1)];new ht(lt);const xt=gt();class I{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new l,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),l.clearPool(),U[0]=null,j.prune(),P.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=l.acquire();for(let s=0;s{if(!It(s,r))return!1;const a=r.node;return a.terminals.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),a.residents!==null&&a.residents.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,s){const r=et(t,e);x(this._root,a=>{if(!Lt(r,a,s))return!1;const u=a.node;return u.terminals.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),u.residents!==null&&u.residents.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),!0})}forEach(t){x(this._root,e=>{const n=e.node;return n.terminals.forAll(t),n.residents!==null&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,s=()=>!0,r=1/0){let a=1/0,u=1/0,h=null;const c=K(t,e),f=d=>{if(--r,!s(d))return;const O=this.objectToBoundingSphere(d);if(!C(n,O))return;const E=S(t,e,T(O)),G=E-O[3],_=E+O[3];G{if(r<=0||!C(n,d.bounds)||(q(b,c,d.halfSize),k(b,b,T(d.bounds)),S(t,e,b)>u))return!1;const O=d.node;return O.terminals.forAll(E=>f(E)),O.residents!==null&&O.residents.forAll(E=>f(E)),!0},t,e),h}forEachInDepthRange(t,e,n,s,r,a,u){let h=-1/0,c=1/0;const f={setRange:_=>{n===I.DepthOrder.FRONT_TO_BACK?(h=Math.max(h,_.near),c=Math.min(c,_.far)):(h=Math.max(h,-_.far),c=Math.min(c,-_.near))}};f.setRange(s);const d=S(e,n,t),O=K(e,n),E=K(e,-n),G=_=>{if(!u(_))return;const g=this.objectToBoundingSphere(_),H=T(g),Y=S(e,n,H)-d,Tt=Y-g[3],ft=Y+g[3];Tt>c||ft{if(!C(a,_.bounds)||(q(b,O,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-d>c)||(q(b,E,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-dG(H)),g.residents!==null&&g.residents.forAll(H=>G(H)),!0},e,n)}forEachNode(t){x(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=J(e),s=T(e),r=h=>{const c=this.objectToBoundingSphere(h),f=J(c),d=n+f;return!(Q(T(c),s)-d*d<=0)||t(h)};let a=!0;const u=h=>{a&&(a=r(h))};x(this._root,h=>{const c=J(h.bounds),f=n+c;if(Q(T(h.bounds),s)-f*f>0)return!1;const d=h.node;return d.terminals.forAll(u),a&&d.residents!==null&&d.residents.forAll(u),a}),a&&this.forEachDegenerateObject(u)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||nt(n,t)}_intersectsObjectWithOffset(t,e,n){const s=this.objectToBoundingSphere(e);return!(s[3]>0)||nt(n.applyToBoundingSphere(s),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depththis.objectToBoundingSphere(n),N),D(N[3])&&!this._fitsInsideTree(N)))if(ut(this._root.node))w(N,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const n=this._rootBoundsForRootAsSubNode(N);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(N,n):this._growRootAsSubNode(n),l.release(n)}}_rebuildTree(t,e){Z(T(V),T(e.bounds)),V[3]=e.halfSize,st([t,V],2,s=>s,W);const n=l.acquire().init(this._root);this._root.initFrom(null,W,W[3]),this._root.increaseHalfSize(1.25),x(n,s=>(this.add(s.node.terminals.data,s.node.terminals.length),s.node.residents!==null&&this.add(s.node.residents.data,s.node.residents.length),!0)),l.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return x(this._root,s=>(n=Math.max(n,s.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let s=-1/0;const r=this._root.bounds,a=this._root.halfSize;for(let h=0;h<3;h++){const c=r[h]-a-(n[h]-e),f=n[h]+e-(r[h]+a),d=Math.max(0,Math.ceil(c/(2*a))),O=Math.max(0,Math.ceil(f/(2*a)))+1,E=2**Math.ceil(Math.log(d+O)*Math.LOG2E);s=Math.max(s,E),$[h].min=d,$[h].max=O}for(let h=0;h<3;h++){let c=$[h].min,f=$[h].max;const d=(s-(c+f))/2;c+=Math.ceil(d),f+=Math.floor(d);const O=r[h]-a-c*a*2;X[h]=O+(f+c)*a}const u=s*a;return X[3]=u*_t,l.acquire().initFrom(null,X,u,0)}_growRootAsSubNode(t){const e=this._root.node;Z(T(N),T(this._root.bounds)),N[3]=this._root.halfSize,this._root.init(t),t.advanceTo(N,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(t===-1)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,s=0;for(;s=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,s=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:s}}}_nodeToJSON(t){const e=t.children.map(r=>r?this._nodeToJSON(r):null),n=t.residents?.map(r=>this.objectToBoundingSphere(r)),s=t.terminals?.map(r=>this.objectToBoundingSphere(r));return{children:e,residents:n,terminals:s}}static fromJSON(t){const e=new I(n=>n,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class l{constructor(){this.bounds=z(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,s=this.depth){return this.node=t??l.createEmptyNode(),e&&w(e,this.bounds),this.halfSize=n,this.depth=s,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*_t}advance(t){let e=this.node.children[t];e||(e=l.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=ct[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const s=this._childIndex(t);e&&e(this,s),this.advance(s)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]=0;--a){const u=it[a];s.node.children[u]&&r.push(l.acquire().init(s).advance(u))}l.release(s)}}function jt(o,t,e){j.clear();const n=e.advanceTo(t,(s,r)=>{j.push(s.node),j.push(r)})?e.node.terminals:e.node.residents;if(n.removeUnordered(o),n.length===0)for(let s=j.length-2;s>=0&&Pt(j.data[s],j.data[s+1]);s-=2);}function Pt(o,t){return t>=0&&(o.children[t]=null),!!ut(o)&&(o.residents===null&&(o.residents=new v({shrink:!0})),!0)}function It(o,t){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),at(o.origin,o.direction,R,p)}function Lt(o,t,e){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),e.applyToMinMax(R,p),at(o.origin,o.direction,R,p)}function ut(o){if(o.terminals.length!==0)return!1;if(o.residents!==null)return o.residents.length===0;for(let t=0;tn.distance-s.distance);for(let n=0;n<8;++n)e[n]=P.data[n].index}function K(o,t){let e,n=1/0;for(let s=0;s<8;++s){const r=S(o,t,rt[s]);r0}l._pool=new mt(l),function(o){var t;(t=o.DepthOrder||(o.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(I||(I={}));const ct=[m(-1,-1,-1),m(1,-1,-1),m(-1,1,-1),m(1,1,-1),m(-1,-1,1),m(1,-1,1),m(-1,1,1),m(1,1,1)],rt=[m(-1,-1,-1),m(-1,-1,1),m(-1,1,-1),m(-1,1,1),m(1,-1,-1),m(1,-1,1),m(1,1,-1),m(1,1,1)],_t=Math.sqrt(3),U=[null];function Dt(o){return U[0]=o,U}const X=z(),b=F(),R=F(),p=F(),j=new v,vt=z(),N=z(),V=z(),W=z(),$=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],P=new v,it=[0,0,0,0,0,0,0,0],Ut=I;export{Wt as B,Xt as N,Vt as S,Ut as y}; diff --git a/main/assets/Octree-CJNwbhg4-DwYbmQHL.js b/main/assets/Octree-CJNwbhg4-DwYbmQHL.js deleted file mode 100644 index b749c8814..000000000 --- a/main/assets/Octree-CJNwbhg4-DwYbmQHL.js +++ /dev/null @@ -1 +0,0 @@ -import{ec as mt,dD as v,dU as F,hZ as m}from"./main-BZaw9FpY.js";import{A as Z,X as Ot,_ as Rt,L as q,j as k,p as Q}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{X as ht,d as tt,C as w,l as et,a as J,G as nt,F as T,b as z}from"./sphere-BenPORjV-CgNvGf8s.js";import{B as pt,z as At}from"./mat4-DX7gBViE-CQMXDC3Z.js";import{D as bt}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{e as M}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{y as A,j as Ft,o as Et,J as Nt,G as L}from"./plane-Dt8R0KeE-fuXvBrPY.js";import{l as at}from"./Util-BjGjeg6f-08Szkf4F.js";function lt(o){return o?{ray:tt(o.ray),c0:o.c0,c1:o.c1}:{ray:tt(),c0:0,c1:Number.MAX_VALUE}}new ht(()=>lt());function Xt(o){return o?[A(o[0]),A(o[1]),A(o[2]),A(o[3]),A(o[4]),A(o[5])]:[A(),A(),A(),A(),A(),A()]}function gt(){return[F(),F(),F(),F(),F(),F(),F(),F()]}function Vt(o,t){for(let e=0;e=t[3])return!1}return!0}var B,i;(function(o){o[o.LEFT=0]="LEFT",o[o.RIGHT=1]="RIGHT",o[o.BOTTOM=2]="BOTTOM",o[o.TOP=3]="TOP",o[o.NEAR=4]="NEAR",o[o.FAR=5]="FAR"})(B||(B={})),function(o){o[o.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",o[o.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",o[o.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",o[o.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",o[o.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",o[o.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",o[o.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",o[o.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(i||(i={})),i.FAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_LEFT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_BOTTOM_RIGHT,i.NEAR_TOP_RIGHT,i.NEAR_TOP_LEFT,i.FAR_BOTTOM_RIGHT,i.FAR_BOTTOM_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_RIGHT,i.NEAR_BOTTOM_RIGHT,i.FAR_BOTTOM_RIGHT,i.FAR_TOP_RIGHT,i.NEAR_TOP_RIGHT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_TOP_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_LEFT,i.NEAR_TOP_LEFT,i.NEAR_TOP_RIGHT,i.FAR_TOP_RIGHT;const dt=6,Bt=8,St=[M(-1,-1,-1,1),M(1,-1,-1,1),M(1,1,-1,1),M(-1,1,-1,1),M(-1,-1,1,1),M(1,-1,1,1),M(1,1,1,1),M(-1,1,1,1)];new ht(lt);const xt=gt();class I{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new l,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),l.clearPool(),U[0]=null,j.prune(),P.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=l.acquire();for(let s=0;s{if(!It(s,r))return!1;const a=r.node;return a.terminals.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),a.residents!==null&&a.residents.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,s){const r=et(t,e);x(this._root,a=>{if(!Lt(r,a,s))return!1;const u=a.node;return u.terminals.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),u.residents!==null&&u.residents.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),!0})}forEach(t){x(this._root,e=>{const n=e.node;return n.terminals.forAll(t),n.residents!==null&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,s=()=>!0,r=1/0){let a=1/0,u=1/0,h=null;const c=K(t,e),f=d=>{if(--r,!s(d))return;const O=this.objectToBoundingSphere(d);if(!C(n,O))return;const E=S(t,e,T(O)),G=E-O[3],_=E+O[3];G{if(r<=0||!C(n,d.bounds)||(q(b,c,d.halfSize),k(b,b,T(d.bounds)),S(t,e,b)>u))return!1;const O=d.node;return O.terminals.forAll(E=>f(E)),O.residents!==null&&O.residents.forAll(E=>f(E)),!0},t,e),h}forEachInDepthRange(t,e,n,s,r,a,u){let h=-1/0,c=1/0;const f={setRange:_=>{n===I.DepthOrder.FRONT_TO_BACK?(h=Math.max(h,_.near),c=Math.min(c,_.far)):(h=Math.max(h,-_.far),c=Math.min(c,-_.near))}};f.setRange(s);const d=S(e,n,t),O=K(e,n),E=K(e,-n),G=_=>{if(!u(_))return;const g=this.objectToBoundingSphere(_),H=T(g),Y=S(e,n,H)-d,Tt=Y-g[3],ft=Y+g[3];Tt>c||ft{if(!C(a,_.bounds)||(q(b,O,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-d>c)||(q(b,E,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-dG(H)),g.residents!==null&&g.residents.forAll(H=>G(H)),!0},e,n)}forEachNode(t){x(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=J(e),s=T(e),r=h=>{const c=this.objectToBoundingSphere(h),f=J(c),d=n+f;return!(Q(T(c),s)-d*d<=0)||t(h)};let a=!0;const u=h=>{a&&(a=r(h))};x(this._root,h=>{const c=J(h.bounds),f=n+c;if(Q(T(h.bounds),s)-f*f>0)return!1;const d=h.node;return d.terminals.forAll(u),a&&d.residents!==null&&d.residents.forAll(u),a}),a&&this.forEachDegenerateObject(u)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||nt(n,t)}_intersectsObjectWithOffset(t,e,n){const s=this.objectToBoundingSphere(e);return!(s[3]>0)||nt(n.applyToBoundingSphere(s),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depththis.objectToBoundingSphere(n),N),D(N[3])&&!this._fitsInsideTree(N)))if(ut(this._root.node))w(N,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const n=this._rootBoundsForRootAsSubNode(N);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(N,n):this._growRootAsSubNode(n),l.release(n)}}_rebuildTree(t,e){Z(T(V),T(e.bounds)),V[3]=e.halfSize,st([t,V],2,s=>s,W);const n=l.acquire().init(this._root);this._root.initFrom(null,W,W[3]),this._root.increaseHalfSize(1.25),x(n,s=>(this.add(s.node.terminals.data,s.node.terminals.length),s.node.residents!==null&&this.add(s.node.residents.data,s.node.residents.length),!0)),l.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return x(this._root,s=>(n=Math.max(n,s.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let s=-1/0;const r=this._root.bounds,a=this._root.halfSize;for(let h=0;h<3;h++){const c=r[h]-a-(n[h]-e),f=n[h]+e-(r[h]+a),d=Math.max(0,Math.ceil(c/(2*a))),O=Math.max(0,Math.ceil(f/(2*a)))+1,E=2**Math.ceil(Math.log(d+O)*Math.LOG2E);s=Math.max(s,E),$[h].min=d,$[h].max=O}for(let h=0;h<3;h++){let c=$[h].min,f=$[h].max;const d=(s-(c+f))/2;c+=Math.ceil(d),f+=Math.floor(d);const O=r[h]-a-c*a*2;X[h]=O+(f+c)*a}const u=s*a;return X[3]=u*_t,l.acquire().initFrom(null,X,u,0)}_growRootAsSubNode(t){const e=this._root.node;Z(T(N),T(this._root.bounds)),N[3]=this._root.halfSize,this._root.init(t),t.advanceTo(N,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(t===-1)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,s=0;for(;s=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,s=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:s}}}_nodeToJSON(t){const e=t.children.map(r=>r?this._nodeToJSON(r):null),n=t.residents?.map(r=>this.objectToBoundingSphere(r)),s=t.terminals?.map(r=>this.objectToBoundingSphere(r));return{children:e,residents:n,terminals:s}}static fromJSON(t){const e=new I(n=>n,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class l{constructor(){this.bounds=z(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,s=this.depth){return this.node=t??l.createEmptyNode(),e&&w(e,this.bounds),this.halfSize=n,this.depth=s,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*_t}advance(t){let e=this.node.children[t];e||(e=l.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=ct[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const s=this._childIndex(t);e&&e(this,s),this.advance(s)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]=0;--a){const u=it[a];s.node.children[u]&&r.push(l.acquire().init(s).advance(u))}l.release(s)}}function jt(o,t,e){j.clear();const n=e.advanceTo(t,(s,r)=>{j.push(s.node),j.push(r)})?e.node.terminals:e.node.residents;if(n.removeUnordered(o),n.length===0)for(let s=j.length-2;s>=0&&Pt(j.data[s],j.data[s+1]);s-=2);}function Pt(o,t){return t>=0&&(o.children[t]=null),!!ut(o)&&(o.residents===null&&(o.residents=new v({shrink:!0})),!0)}function It(o,t){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),at(o.origin,o.direction,R,p)}function Lt(o,t,e){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),e.applyToMinMax(R,p),at(o.origin,o.direction,R,p)}function ut(o){if(o.terminals.length!==0)return!1;if(o.residents!==null)return o.residents.length===0;for(let t=0;tn.distance-s.distance);for(let n=0;n<8;++n)e[n]=P.data[n].index}function K(o,t){let e,n=1/0;for(let s=0;s<8;++s){const r=S(o,t,rt[s]);r0}l._pool=new mt(l),function(o){var t;(t=o.DepthOrder||(o.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(I||(I={}));const ct=[m(-1,-1,-1),m(1,-1,-1),m(-1,1,-1),m(1,1,-1),m(-1,-1,1),m(1,-1,1),m(-1,1,1),m(1,1,1)],rt=[m(-1,-1,-1),m(-1,-1,1),m(-1,1,-1),m(-1,1,1),m(1,-1,-1),m(1,-1,1),m(1,1,-1),m(1,1,1)],_t=Math.sqrt(3),U=[null];function Dt(o){return U[0]=o,U}const X=z(),b=F(),R=F(),p=F(),j=new v,vt=z(),N=z(),V=z(),W=z(),$=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],P=new v,it=[0,0,0,0,0,0,0,0],Ut=I;export{Wt as B,Xt as N,Vt as S,Ut as y}; diff --git a/main/assets/OpenStreetMapLayer-Bx4EhJij-DG5ieN6G.js b/main/assets/OpenStreetMapLayer-Bx4EhJij-DG5ieN6G.js new file mode 100644 index 000000000..7ff990cce --- /dev/null +++ b/main/assets/OpenStreetMapLayer-Bx4EhJij-DG5ieN6G.js @@ -0,0 +1 @@ +import{v as t,S as r,i as s,w as p,J as l,n as a}from"./main-C7yV2j71.js";import{I as m}from"./WebTileLayer-CUoicUjK-DGTooIUm.js";import{V as i,d as e}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import w from"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./PortalLayer-CElnYuSQ-BV63HHSL.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import"./imageBitmapUtils-DA36kg39-BPA5qQx5.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";let o=class extends m{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new i({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:l.WebMercator}),spatialReference:l.WebMercator,lods:[new e({level:0,scale:591657527591555e-6,resolution:156543.033928}),new e({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new e({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new e({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new e({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new e({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new e({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new e({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new e({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new e({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new e({level:10,scale:577790.554289,resolution:152.874056570411}),new e({level:11,scale:288895.277144,resolution:76.4370282850732}),new e({level:12,scale:144447.638572,resolution:38.2185141425366}),new e({level:13,scale:72223.819286,resolution:19.1092570712683}),new e({level:14,scale:36111.909643,resolution:9.55462853563415}),new e({level:15,scale:18055.954822,resolution:4.77731426794937}),new e({level:16,scale:9027.977411,resolution:2.38865713397468}),new e({level:17,scale:4513.988705,resolution:1.19432856685505}),new e({level:18,scale:2256.994353,resolution:.597164283559817}),new e({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new a(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,l.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};t([r({type:w,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([r({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([r({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([r({type:i,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([r({type:["show","hide"]})],o.prototype,"listMode",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([r({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([r({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([r({json:{read:!1}})],o.prototype,"type",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([s("esri.layers.OpenStreetMapLayer")],o);const A=o;export{A as default}; diff --git a/main/assets/OpenStreetMapLayer-Bx4EhJij-DzFDuY-s.js b/main/assets/OpenStreetMapLayer-Bx4EhJij-DzFDuY-s.js deleted file mode 100644 index a15b48367..000000000 --- a/main/assets/OpenStreetMapLayer-Bx4EhJij-DzFDuY-s.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as r,i as s,w as p,J as l,n as a}from"./main-BZaw9FpY.js";import{I as m}from"./WebTileLayer-CUoicUjK-CD-UQu9P.js";import{V as i,d as e}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import w from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./imageBitmapUtils-DA36kg39-CBVFUZAU.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";let o=class extends m{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new i({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:l.WebMercator}),spatialReference:l.WebMercator,lods:[new e({level:0,scale:591657527591555e-6,resolution:156543.033928}),new e({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new e({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new e({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new e({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new e({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new e({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new e({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new e({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new e({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new e({level:10,scale:577790.554289,resolution:152.874056570411}),new e({level:11,scale:288895.277144,resolution:76.4370282850732}),new e({level:12,scale:144447.638572,resolution:38.2185141425366}),new e({level:13,scale:72223.819286,resolution:19.1092570712683}),new e({level:14,scale:36111.909643,resolution:9.55462853563415}),new e({level:15,scale:18055.954822,resolution:4.77731426794937}),new e({level:16,scale:9027.977411,resolution:2.38865713397468}),new e({level:17,scale:4513.988705,resolution:1.19432856685505}),new e({level:18,scale:2256.994353,resolution:.597164283559817}),new e({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new a(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,l.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};t([r({type:w,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([r({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([r({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([r({type:i,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([r({type:["show","hide"]})],o.prototype,"listMode",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([r({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([r({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([r({json:{read:!1}})],o.prototype,"type",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([s("esri.layers.OpenStreetMapLayer")],o);const A=o;export{A as default}; diff --git a/main/assets/OperationalLayer-B5IXiMa2-B5IUcPZ-.js b/main/assets/OperationalLayer-B5IXiMa2-B5IUcPZ-.js new file mode 100644 index 000000000..7d5d6e0f9 --- /dev/null +++ b/main/assets/OperationalLayer-B5IXiMa2-B5IUcPZ-.js @@ -0,0 +1 @@ +import{v as i,S as y,a0 as S,ac as l,bB as b,dn as I,i as v,b$ as T,o as s,dp as w,dq as G}from"./main-C7yV2j71.js";import{r as A,s as c,E as h}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{k as L}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";const d={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},m={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},g={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},M={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":d,"web-map/basemap":m,"web-map/tables":g,"link-chart/operational-layers":{...d,LinkChartLayer:!0},"link-chart/basemap":m,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0}},x=u=>{let a=class extends u{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(r,e,t){return t?.portalItem?.type==="Group Layer"?void 0:r}writeListMode(r,e,t,n){(n&&n.layerContainerType==="ground"||r&&T(this,t,{},n))&&(e[t]=r)}writeOperationalLayerType(r,e,t,n){r&&n?.layerContainerType!=="tables"&&(e.layerType=r)}writeTitle(r,e){e.title=r??"Layer"}readTimeExtent(r){return r?L.fromArray(r):null}writeTimeExtent(r,e,t,n){r&&n.layerContainerType!=="tables"&&(r.isEmpty?n?.messages&&n.messages.push(new s("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):e[t]=r.toArray())}read(r,e){e&&(e.layer=this),w(this,r,t=>super.read(r,t),e)}write(r,e){if(!this.persistenceEnabled&&!e?.ignorePersistenceEnabled)return null;if(e?.origin){const o=`${e.origin}/${e.layerContainerType||"operational-layers"}`;let p=!!M[o]?.[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&o==="web-scene/operational-layers"&&(p=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&o==="web-map/operational-layers"&&(p=!1),!p)return e.messages?.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this})),null}const t=super.write(r,{...e,layer:this}),n=!!e&&!!e.messages&&!!e.messages.filter(o=>o instanceof s&&o.name==="web-document-write:property-required").length;return G(t?.url)?(e?.messages?.push(new s("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:t}beforeSave(){}};return i([y({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],a.prototype,"id",void 0),i([S("id",["id"])],a.prototype,"readId",null),i([y(A)],a.prototype,"listMode",void 0),i([l("listMode")],a.prototype,"writeListMode",null),i([y({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:c}}}}})],a.prototype,"operationalLayerType",void 0),i([l("operationalLayerType")],a.prototype,"writeOperationalLayerType",null),i([y(h)],a.prototype,"opacity",void 0),i([y({type:Boolean,readOnly:!1})],a.prototype,"persistenceEnabled",void 0),i([y({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],a.prototype,"title",void 0),i([l("title"),l(["web-scene"],"title")],a.prototype,"writeTitle",null),i([y({type:L,json:{origins:{"web-scene":{write:{layerContainerTypes:c}}}}})],a.prototype,"visibilityTimeExtent",void 0),i([S("visibilityTimeExtent")],a.prototype,"readTimeExtent",null),i([l(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[b,I]]}})],a.prototype,"writeTimeExtent",null),i([y({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:c}}},name:"visibility",write:!0}})],a.prototype,"visible",void 0),a=i([v("esri.layers.mixins.OperationalLayer")],a),a};export{x as E}; diff --git a/main/assets/OperationalLayer-B5IXiMa2-KEXCVZUA.js b/main/assets/OperationalLayer-B5IXiMa2-KEXCVZUA.js deleted file mode 100644 index b73b2fa25..000000000 --- a/main/assets/OperationalLayer-B5IXiMa2-KEXCVZUA.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as y,a0 as S,ac as l,bB as b,dn as I,i as v,b$ as T,o as s,dp as w,dq as G}from"./main-BZaw9FpY.js";import{r as A,s as c,E as h}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{k as L}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";const d={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},m={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},g={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},M={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":d,"web-map/basemap":m,"web-map/tables":g,"link-chart/operational-layers":{...d,LinkChartLayer:!0},"link-chart/basemap":m,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0}},x=u=>{let a=class extends u{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(r,e,t){return t?.portalItem?.type==="Group Layer"?void 0:r}writeListMode(r,e,t,n){(n&&n.layerContainerType==="ground"||r&&T(this,t,{},n))&&(e[t]=r)}writeOperationalLayerType(r,e,t,n){r&&n?.layerContainerType!=="tables"&&(e.layerType=r)}writeTitle(r,e){e.title=r??"Layer"}readTimeExtent(r){return r?L.fromArray(r):null}writeTimeExtent(r,e,t,n){r&&n.layerContainerType!=="tables"&&(r.isEmpty?n?.messages&&n.messages.push(new s("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):e[t]=r.toArray())}read(r,e){e&&(e.layer=this),w(this,r,t=>super.read(r,t),e)}write(r,e){if(!this.persistenceEnabled&&!e?.ignorePersistenceEnabled)return null;if(e?.origin){const o=`${e.origin}/${e.layerContainerType||"operational-layers"}`;let p=!!M[o]?.[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&o==="web-scene/operational-layers"&&(p=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&o==="web-map/operational-layers"&&(p=!1),!p)return e.messages?.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this})),null}const t=super.write(r,{...e,layer:this}),n=!!e&&!!e.messages&&!!e.messages.filter(o=>o instanceof s&&o.name==="web-document-write:property-required").length;return G(t?.url)?(e?.messages?.push(new s("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:t}beforeSave(){}};return i([y({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],a.prototype,"id",void 0),i([S("id",["id"])],a.prototype,"readId",null),i([y(A)],a.prototype,"listMode",void 0),i([l("listMode")],a.prototype,"writeListMode",null),i([y({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:c}}}}})],a.prototype,"operationalLayerType",void 0),i([l("operationalLayerType")],a.prototype,"writeOperationalLayerType",null),i([y(h)],a.prototype,"opacity",void 0),i([y({type:Boolean,readOnly:!1})],a.prototype,"persistenceEnabled",void 0),i([y({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],a.prototype,"title",void 0),i([l("title"),l(["web-scene"],"title")],a.prototype,"writeTitle",null),i([y({type:L,json:{origins:{"web-scene":{write:{layerContainerTypes:c}}}}})],a.prototype,"visibilityTimeExtent",void 0),i([S("visibilityTimeExtent")],a.prototype,"readTimeExtent",null),i([l(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[b,I]]}})],a.prototype,"writeTimeExtent",null),i([y({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:c}}},name:"visibility",write:!0}})],a.prototype,"visible",void 0),a=i([v("esri.layers.mixins.OperationalLayer")],a),a};export{x as E}; diff --git a/main/assets/OrderByInfo-GD2XnU8e-C-uyyo-i.js b/main/assets/OrderByInfo-GD2XnU8e-C-uyyo-i.js deleted file mode 100644 index 8df070ea2..000000000 --- a/main/assets/OrderByInfo-GD2XnU8e-C-uyyo-i.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as n,v as r,S as i,i as d,e as p}from"./main-BZaw9FpY.js";var t;const s=new n({asc:"ascending",desc:"descending"});let e=t=class extends p{constructor(o){super(o),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new t({field:this.field,valueExpression:this.valueExpression,order:this.order})}};r([i({type:String,json:{write:!0}})],e.prototype,"field",void 0),r([i({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"valueExpression",void 0),r([i({type:s.apiValues,json:{type:s.jsonValues,read:s.read,write:s.write}})],e.prototype,"order",void 0),e=t=r([d("esri.layers.support.OrderByInfo")],e);const l=e;export{l as p}; diff --git a/main/assets/OrderByInfo-GD2XnU8e-CsM0tB0E.js b/main/assets/OrderByInfo-GD2XnU8e-CsM0tB0E.js new file mode 100644 index 000000000..31b309654 --- /dev/null +++ b/main/assets/OrderByInfo-GD2XnU8e-CsM0tB0E.js @@ -0,0 +1 @@ +import{aK as n,v as r,S as i,i as d,e as p}from"./main-C7yV2j71.js";var t;const s=new n({asc:"ascending",desc:"descending"});let e=t=class extends p{constructor(o){super(o),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new t({field:this.field,valueExpression:this.valueExpression,order:this.order})}};r([i({type:String,json:{write:!0}})],e.prototype,"field",void 0),r([i({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"valueExpression",void 0),r([i({type:s.apiValues,json:{type:s.jsonValues,read:s.read,write:s.write}})],e.prototype,"order",void 0),e=t=r([d("esri.layers.support.OrderByInfo")],e);const l=e;export{l as p}; diff --git a/main/assets/OrderedLayer-6Qsmrd_l-CGz1PXc3.js b/main/assets/OrderedLayer-6Qsmrd_l-CGz1PXc3.js deleted file mode 100644 index 9a11615f6..000000000 --- a/main/assets/OrderedLayer-6Qsmrd_l-CGz1PXc3.js +++ /dev/null @@ -1 +0,0 @@ -import{v as s,S as l,i as a,el as f}from"./main-BZaw9FpY.js";import{p as d}from"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";function u(e,r,t){if(!e)return null;const i=e.find(o=>!!o.field);if(!i)return null;const n=new d;return n.read(i,t),[n]}function c(e,r,t,i){const n=e.find(o=>!!o.field);n&&f(t,[n.toJSON()],r)}const p={type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:u},write:{writer:c}}},w=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return s([l(p)],r.prototype,"orderBy",void 0),r=s([a("esri.layers.mixins.OrderedLayer")],r),r};export{p as d,w as p}; diff --git a/main/assets/OrderedLayer-6Qsmrd_l-sp1TyHmN.js b/main/assets/OrderedLayer-6Qsmrd_l-sp1TyHmN.js new file mode 100644 index 000000000..a2414f164 --- /dev/null +++ b/main/assets/OrderedLayer-6Qsmrd_l-sp1TyHmN.js @@ -0,0 +1 @@ +import{v as s,S as l,i as a,el as f}from"./main-C7yV2j71.js";import{p as d}from"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";function u(e,r,t){if(!e)return null;const i=e.find(o=>!!o.field);if(!i)return null;const n=new d;return n.read(i,t),[n]}function c(e,r,t,i){const n=e.find(o=>!!o.field);n&&f(t,[n.toJSON()],r)}const p={type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:u},write:{writer:c}}},w=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return s([l(p)],r.prototype,"orderBy",void 0),r=s([a("esri.layers.mixins.OrderedLayer")],r),r};export{p as d,w as p}; diff --git a/main/assets/OrientedImageryLayer-CwG5o4Di-DYTbbojC.js b/main/assets/OrientedImageryLayer-CwG5o4Di-DYTbbojC.js deleted file mode 100644 index c93fa841e..000000000 --- a/main/assets/OrientedImageryLayer-CwG5o4Di-DYTbbojC.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as i,i as S,aa as O,bA as M,aK as k,P as Q,j as X,aY as q,e as G,o as Z,el as tt}from"./main-BZaw9FpY.js";import et from"./FeatureLayer-BrRKw5Si-CHreUEJ9.js";import{m as it}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{k as ot}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{E as J}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./versionUtils-LZYZz-38-xZnsxhiL.js";import"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";let g=class extends X{set horizontalWKID(e){e?q({wkid:+e})?this._set("horizontalWKID",+e):this._set("horizontalWKID",e):this._set("horizontalWKID",null)}set verticalWKID(e){e?this._set("verticalWKID",isFinite(e)&&q({wkid:+e})?+e:null):this._set("verticalWKID",null)}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1&&!Number.isNaN(o)&&r?.length>1&&s?.length>1&&l?.length>1}};t([i({json:{write:!0}})],g.prototype,"affineTransformations",void 0),t([i({json:{write:!0}})],g.prototype,"focalLength",void 0),t([i({json:{write:!0}})],g.prototype,"principalOffsetPoint",void 0),t([i({json:{write:!0}})],g.prototype,"radialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"tangentialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"horizontalWKID",null),t([i({json:{write:!0}})],g.prototype,"verticalWKID",null),t([i({json:{write:!0}})],g.prototype,"x",void 0),t([i({json:{write:!0}})],g.prototype,"y",void 0),t([i({json:{write:!0}})],g.prototype,"z",void 0),t([i({json:{write:!0}})],g.prototype,"type",void 0),g=t([S("esri.layers.orientedImagery.core.CameraOrientation")],g);const F=g;let f=class extends O(M(F)){constructor(){super(...arguments),this.type=1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],f.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"heading",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"z",void 0),f=t([S("esri.layers.orientedImagery.core.CameraOrientationHPR")],f);const rt=f;let D=class extends O(M(F)){constructor(){super(...arguments),this.type=4}toString(){const{type:e,latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:m}=this,c=`${m}`.split("|");return c.splice(1,1),`${e}|${o}|${r}|${s}|${l}|${c.join("|")}`}};t([i({json:{write:!0}})],D.prototype,"type",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"latitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"longitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"ellipsoidRadius",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"squaredEccentricity",void 0),t([i({json:{write:!0}})],D.prototype,"properties",void 0),D=t([S("esri.layers.orientedImagery.core.CameraOrientationLTP")],D);const nt=D;let h=class extends O(M(F)){constructor(){super(...arguments),this.type=2}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],h.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"omega",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"phi",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"kappa",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([S("esri.layers.orientedImagery.core.CameraOrientationOPK")],h);const st=h;let v=class extends O(M(F)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1||!Number.isNaN(o)||r?.length>1||s?.length>1||l?.length>1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],v.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"yaw",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([S("esri.layers.orientedImagery.core.CameraOrientationYPR")],v);const at=v;var x;(function(e){e[e.HPR=1]="HPR",e[e.OPK=2]="OPK",e[e.YPR=3]="YPR",e[e.LTP=4]="LTP"})(x||(x={}));const $=new Map;$.set(`${x.OPK}`,{desc:"Using Omega Phi Kappa",constructor:st}),$.set(`${x.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:rt}),$.set(`${x.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:at}),$.set(`${x.LTP}`,{desc:"Using Local Tangent Plane",constructor:nt});let I=class extends O(G){constructor(){super(...arguments),this.url=null}};t([i({type:Number,json:{write:!0}})],I.prototype,"lod",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"rasterFunction",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"url",void 0),I=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],I);let U=class extends O(G){constructor(){super(...arguments),this.constantElevation=null}};t([i({type:Number,json:{write:!0}})],U.prototype,"constantElevation",void 0),U=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ConstantElevation")],U);const pt=e=>e!=null&&typeof e.constantElevation=="number";function lt(e,o,r){return o&&(e=`${o}${e}`),r&&(e+=`${r}`),e}function mt(e,o,r){let{url:s}=e;return s?(s=lt(s,o,r),new I({...e,url:s})):null}function yt(e,o,r){return e&&(pt(e)?new U(e):mt(e,o,r))}const V=new k({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),A=new k({Feet:"feet",Meter:"meter"}),_=new k({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),R=new Map;function ct(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}R.set(`${x.HPR}`,ut),R.set(`${x.YPR}`,dt),R.set(`${x.OPK}`,ct),R.set(`${x.LTP}`,ft);const H=e=>{const o=e.map(r=>parseFloat(r)).filter(r=>!isNaN(r));if(o.length===e.length)return o};function Y(e,o,r,s,l){const m=H(e),c=H(o),u=H(r),d=H(s);return{affineTransformations:m?.length===6?m:void 0,focalLength:m?.length===6?parseFloat(l):void 0,principalOffsetPoint:c?.length!==2?[0,0]:c,radialDistortionCoefficients:u?.length!==3?[0,0,0]:u,tangentialDistortionCoefficients:d?.length!==2?[0,0]:d}}function ut(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function dt(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function ft(e){const[o,r,s,l,m,...c]=e.slice(1),u=R.get(m),d=$.get(m)?.constructor;return!u||!d?null:{latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:new d(u([m,"",...c]))}}function ht(e){return Array.isArray(e)&&e?.length===9&&!e.some(isNaN)}const vt=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),B=(e,o)=>!vt.has(o)&&e,gt=(e,o,r)=>{const s=`orientedImageryProperties.${e}`;return{name:s,write:o?{ignoreOrigin:!0,target:s,writer:o}:{ignoreOrigin:!0},read:r?{ignoreOrigin:!0,source:s,reader:r}:{ignoreOrigin:!0}}};function wt(e){return e.json&&(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1}),e}function y(e,o,r,s){const{name:l,write:m,read:c}=gt(e,o,r),u={name:l,write:m,read:c,origins:{service:{name:`orientedImageryInfo.${l}`,write:o,read:r},"web-scene":{name:l,write:B(m,e),read:B(c,e)},"web-map":{name:l,write:m,read:c}}};return s&&u.origins&&(u.type=s,u.origins["web-map"].type=s,u.origins["web-scene"].type=s),u}let a=class extends et{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:o,demPathSuffix:r}=this;return yt(e,o,r)}async save(e){return this._debouncedSaveOperations(J.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(J.SAVE_AS,o,e)}findFirstValidLayerId(e){return e.layers?.find(o=>this.supportedSourceTypes.has(o.type))?.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new Z("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([i({type:Number,json:y("cameraHeading")})],a.prototype,"cameraHeading",void 0),t([i({type:Number,json:y("cameraHeight")})],a.prototype,"cameraHeight",void 0),t([i({type:Number,json:y("cameraPitch")})],a.prototype,"cameraPitch",void 0),t([i({type:Number,json:y("cameraRoll")})],a.prototype,"cameraRoll",void 0),t([i({type:Number,json:y("coveragePercent")})],a.prototype,"coveragePercent",void 0),t([i({type:String,json:y("demPathPrefix")})],a.prototype,"demPathPrefix",void 0),t([i({type:String,json:y("demPathSuffix")})],a.prototype,"demPathSuffix",void 0),t([i({type:String,json:y("depthImagePathPrefix")})],a.prototype,"depthImagePathPrefix",void 0),t([i({type:String,json:y("depthImagePathSuffix")})],a.prototype,"depthImagePathSuffix",void 0),t([i({type:Object,json:y("elevationSource")})],a.prototype,"elevationSource",void 0),t([i({readOnly:!0})],a.prototype,"effectiveElevationSource",null),t([i({type:Number,json:y("farDistance")})],a.prototype,"farDistance",void 0),t([i()],a.prototype,"geometryType",void 0),t([i({type:Number,json:y("horizontalFieldOfView")})],a.prototype,"horizontalFieldOfView",void 0),t([i({type:String,json:y("horizontalMeasurementUnit")})],a.prototype,"horizontalMeasurementUnit",void 0),t([i({type:String,json:y("imagePathPrefix")})],a.prototype,"imagePathPrefix",void 0),t([i({type:String,json:y("imagePathSuffix")})],a.prototype,"imagePathSuffix",void 0),t([i({type:Number,json:y("imageRotation")})],a.prototype,"imageRotation",void 0),t([i({type:Number,json:y("maximumDistance")})],a.prototype,"maximumDistance",void 0),t([i({type:Number,json:y("nearDistance")})],a.prototype,"nearDistance",void 0),t([i({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],a.prototype,"operationalLayerType",void 0),t([i({json:{...y("orientationAccuracy",(e,o,r)=>{tt(r,e.join(";"),o)},e=>{const o=e?.split(";")?.map(Number);return ht(o)?o:[0,0,0,0,0,0,0,0,0]},String)}})],a.prototype,"orientationAccuracy",void 0),t([i({json:{...y("orientedImageryType",_.write,_.read,_.jsonValues.slice(1))}})],a.prototype,"orientedImageryType",void 0),t([i({json:{read:!1},value:"oriented-imagery",readOnly:!0})],a.prototype,"type",void 0),t([i({type:V.apiValues,json:{...y("timeIntervalUnit",V.write,V.read,V.jsonValues)}})],a.prototype,"timeIntervalUnit",void 0),t([i(wt(Q(it)))],a.prototype,"useViewTime",void 0),t([i({type:Number,json:y("verticalFieldOfView")})],a.prototype,"verticalFieldOfView",void 0),t([i({type:A.apiValues,json:{...y("verticalMeasurementUnit",A.write,A.read,A.jsonValues)}})],a.prototype,"verticalMeasurementUnit",void 0),t([i({type:String,json:y("videoPathPrefix")})],a.prototype,"videoPathPrefix",void 0),t([i({type:String,json:y("videoPathSuffix")})],a.prototype,"videoPathSuffix",void 0),t([i({type:ot,json:{origins:{"web-scene":{write:!1,read:!1}}}})],a.prototype,"visibilityTimeExtent",void 0),a=t([S("esri.layers.OrientedImageryLayer")],a);const Be=a;export{Be as default}; diff --git a/main/assets/OrientedImageryLayer-CwG5o4Di-DvaUs8z-.js b/main/assets/OrientedImageryLayer-CwG5o4Di-DvaUs8z-.js new file mode 100644 index 000000000..2383fc0ae --- /dev/null +++ b/main/assets/OrientedImageryLayer-CwG5o4Di-DvaUs8z-.js @@ -0,0 +1 @@ +import{v as t,S as i,i as S,aa as O,bA as M,aK as k,P as Q,j as X,aY as q,e as G,o as Z,el as tt}from"./main-C7yV2j71.js";import et from"./FeatureLayer-BrRKw5Si-Rem12G_g.js";import{m as it}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{k as ot}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{E as J}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./editsZScale-BDsX6vv--CoeIQyxn.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import"./ArcGISService-BYA-y6X6-BtWUPppI.js";import"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./PortalLayer-CElnYuSQ-BV63HHSL.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./versionUtils-LZYZz-38-DgmFurh2.js";import"./styleUtils-ChrJTYIw-OCRItq_6.js";import"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";let g=class extends X{set horizontalWKID(e){e?q({wkid:+e})?this._set("horizontalWKID",+e):this._set("horizontalWKID",e):this._set("horizontalWKID",null)}set verticalWKID(e){e?this._set("verticalWKID",isFinite(e)&&q({wkid:+e})?+e:null):this._set("verticalWKID",null)}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1&&!Number.isNaN(o)&&r?.length>1&&s?.length>1&&l?.length>1}};t([i({json:{write:!0}})],g.prototype,"affineTransformations",void 0),t([i({json:{write:!0}})],g.prototype,"focalLength",void 0),t([i({json:{write:!0}})],g.prototype,"principalOffsetPoint",void 0),t([i({json:{write:!0}})],g.prototype,"radialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"tangentialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"horizontalWKID",null),t([i({json:{write:!0}})],g.prototype,"verticalWKID",null),t([i({json:{write:!0}})],g.prototype,"x",void 0),t([i({json:{write:!0}})],g.prototype,"y",void 0),t([i({json:{write:!0}})],g.prototype,"z",void 0),t([i({json:{write:!0}})],g.prototype,"type",void 0),g=t([S("esri.layers.orientedImagery.core.CameraOrientation")],g);const F=g;let f=class extends O(M(F)){constructor(){super(...arguments),this.type=1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],f.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"heading",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"z",void 0),f=t([S("esri.layers.orientedImagery.core.CameraOrientationHPR")],f);const rt=f;let D=class extends O(M(F)){constructor(){super(...arguments),this.type=4}toString(){const{type:e,latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:m}=this,c=`${m}`.split("|");return c.splice(1,1),`${e}|${o}|${r}|${s}|${l}|${c.join("|")}`}};t([i({json:{write:!0}})],D.prototype,"type",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"latitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"longitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"ellipsoidRadius",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"squaredEccentricity",void 0),t([i({json:{write:!0}})],D.prototype,"properties",void 0),D=t([S("esri.layers.orientedImagery.core.CameraOrientationLTP")],D);const nt=D;let h=class extends O(M(F)){constructor(){super(...arguments),this.type=2}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],h.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"omega",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"phi",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"kappa",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([S("esri.layers.orientedImagery.core.CameraOrientationOPK")],h);const st=h;let v=class extends O(M(F)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1||!Number.isNaN(o)||r?.length>1||s?.length>1||l?.length>1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],v.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"yaw",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([S("esri.layers.orientedImagery.core.CameraOrientationYPR")],v);const at=v;var x;(function(e){e[e.HPR=1]="HPR",e[e.OPK=2]="OPK",e[e.YPR=3]="YPR",e[e.LTP=4]="LTP"})(x||(x={}));const $=new Map;$.set(`${x.OPK}`,{desc:"Using Omega Phi Kappa",constructor:st}),$.set(`${x.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:rt}),$.set(`${x.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:at}),$.set(`${x.LTP}`,{desc:"Using Local Tangent Plane",constructor:nt});let I=class extends O(G){constructor(){super(...arguments),this.url=null}};t([i({type:Number,json:{write:!0}})],I.prototype,"lod",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"rasterFunction",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"url",void 0),I=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],I);let U=class extends O(G){constructor(){super(...arguments),this.constantElevation=null}};t([i({type:Number,json:{write:!0}})],U.prototype,"constantElevation",void 0),U=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ConstantElevation")],U);const pt=e=>e!=null&&typeof e.constantElevation=="number";function lt(e,o,r){return o&&(e=`${o}${e}`),r&&(e+=`${r}`),e}function mt(e,o,r){let{url:s}=e;return s?(s=lt(s,o,r),new I({...e,url:s})):null}function yt(e,o,r){return e&&(pt(e)?new U(e):mt(e,o,r))}const V=new k({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),A=new k({Feet:"feet",Meter:"meter"}),_=new k({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),R=new Map;function ct(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}R.set(`${x.HPR}`,ut),R.set(`${x.YPR}`,dt),R.set(`${x.OPK}`,ct),R.set(`${x.LTP}`,ft);const H=e=>{const o=e.map(r=>parseFloat(r)).filter(r=>!isNaN(r));if(o.length===e.length)return o};function Y(e,o,r,s,l){const m=H(e),c=H(o),u=H(r),d=H(s);return{affineTransformations:m?.length===6?m:void 0,focalLength:m?.length===6?parseFloat(l):void 0,principalOffsetPoint:c?.length!==2?[0,0]:c,radialDistortionCoefficients:u?.length!==3?[0,0,0]:u,tangentialDistortionCoefficients:d?.length!==2?[0,0]:d}}function ut(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function dt(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function ft(e){const[o,r,s,l,m,...c]=e.slice(1),u=R.get(m),d=$.get(m)?.constructor;return!u||!d?null:{latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:new d(u([m,"",...c]))}}function ht(e){return Array.isArray(e)&&e?.length===9&&!e.some(isNaN)}const vt=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),B=(e,o)=>!vt.has(o)&&e,gt=(e,o,r)=>{const s=`orientedImageryProperties.${e}`;return{name:s,write:o?{ignoreOrigin:!0,target:s,writer:o}:{ignoreOrigin:!0},read:r?{ignoreOrigin:!0,source:s,reader:r}:{ignoreOrigin:!0}}};function wt(e){return e.json&&(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1}),e}function y(e,o,r,s){const{name:l,write:m,read:c}=gt(e,o,r),u={name:l,write:m,read:c,origins:{service:{name:`orientedImageryInfo.${l}`,write:o,read:r},"web-scene":{name:l,write:B(m,e),read:B(c,e)},"web-map":{name:l,write:m,read:c}}};return s&&u.origins&&(u.type=s,u.origins["web-map"].type=s,u.origins["web-scene"].type=s),u}let a=class extends et{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:o,demPathSuffix:r}=this;return yt(e,o,r)}async save(e){return this._debouncedSaveOperations(J.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(J.SAVE_AS,o,e)}findFirstValidLayerId(e){return e.layers?.find(o=>this.supportedSourceTypes.has(o.type))?.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new Z("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([i({type:Number,json:y("cameraHeading")})],a.prototype,"cameraHeading",void 0),t([i({type:Number,json:y("cameraHeight")})],a.prototype,"cameraHeight",void 0),t([i({type:Number,json:y("cameraPitch")})],a.prototype,"cameraPitch",void 0),t([i({type:Number,json:y("cameraRoll")})],a.prototype,"cameraRoll",void 0),t([i({type:Number,json:y("coveragePercent")})],a.prototype,"coveragePercent",void 0),t([i({type:String,json:y("demPathPrefix")})],a.prototype,"demPathPrefix",void 0),t([i({type:String,json:y("demPathSuffix")})],a.prototype,"demPathSuffix",void 0),t([i({type:String,json:y("depthImagePathPrefix")})],a.prototype,"depthImagePathPrefix",void 0),t([i({type:String,json:y("depthImagePathSuffix")})],a.prototype,"depthImagePathSuffix",void 0),t([i({type:Object,json:y("elevationSource")})],a.prototype,"elevationSource",void 0),t([i({readOnly:!0})],a.prototype,"effectiveElevationSource",null),t([i({type:Number,json:y("farDistance")})],a.prototype,"farDistance",void 0),t([i()],a.prototype,"geometryType",void 0),t([i({type:Number,json:y("horizontalFieldOfView")})],a.prototype,"horizontalFieldOfView",void 0),t([i({type:String,json:y("horizontalMeasurementUnit")})],a.prototype,"horizontalMeasurementUnit",void 0),t([i({type:String,json:y("imagePathPrefix")})],a.prototype,"imagePathPrefix",void 0),t([i({type:String,json:y("imagePathSuffix")})],a.prototype,"imagePathSuffix",void 0),t([i({type:Number,json:y("imageRotation")})],a.prototype,"imageRotation",void 0),t([i({type:Number,json:y("maximumDistance")})],a.prototype,"maximumDistance",void 0),t([i({type:Number,json:y("nearDistance")})],a.prototype,"nearDistance",void 0),t([i({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],a.prototype,"operationalLayerType",void 0),t([i({json:{...y("orientationAccuracy",(e,o,r)=>{tt(r,e.join(";"),o)},e=>{const o=e?.split(";")?.map(Number);return ht(o)?o:[0,0,0,0,0,0,0,0,0]},String)}})],a.prototype,"orientationAccuracy",void 0),t([i({json:{...y("orientedImageryType",_.write,_.read,_.jsonValues.slice(1))}})],a.prototype,"orientedImageryType",void 0),t([i({json:{read:!1},value:"oriented-imagery",readOnly:!0})],a.prototype,"type",void 0),t([i({type:V.apiValues,json:{...y("timeIntervalUnit",V.write,V.read,V.jsonValues)}})],a.prototype,"timeIntervalUnit",void 0),t([i(wt(Q(it)))],a.prototype,"useViewTime",void 0),t([i({type:Number,json:y("verticalFieldOfView")})],a.prototype,"verticalFieldOfView",void 0),t([i({type:A.apiValues,json:{...y("verticalMeasurementUnit",A.write,A.read,A.jsonValues)}})],a.prototype,"verticalMeasurementUnit",void 0),t([i({type:String,json:y("videoPathPrefix")})],a.prototype,"videoPathPrefix",void 0),t([i({type:String,json:y("videoPathSuffix")})],a.prototype,"videoPathSuffix",void 0),t([i({type:ot,json:{origins:{"web-scene":{write:!1,read:!1}}}})],a.prototype,"visibilityTimeExtent",void 0),a=t([S("esri.layers.OrientedImageryLayer")],a);const Be=a;export{Be as default}; diff --git a/main/assets/OverlayContainer-BEHcBpu0-Bl-u4lo3.js b/main/assets/OverlayContainer-BEHcBpu0-Bl-u4lo3.js new file mode 100644 index 000000000..dea484f70 --- /dev/null +++ b/main/assets/OverlayContainer-BEHcBpu0-Bl-u4lo3.js @@ -0,0 +1 @@ +import{r as I}from"./common-CYWrYyJl-E8-sukrT.js";import{R as Q,E as Z,C as V,G as J,D as X}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Y,E as tt,m as et}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{e as st}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as ot}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as it}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{v as o,hF as L,aG as rt,aA as nt}from"./main-C7yV2j71.js";import{N as at}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{T as pt,s as N,P as dt}from"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import{t as F,v as p,aw as B,ax as lt,ar as y,C as W,M as ht,S as R,a_ as ct,ay as ut,aC as ft,a4 as vt,L as mt,a7 as xt,bd as yt,b9 as gt,D as wt}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import{L as _t,D,I as U,T as Mt}from"./enums-DBi1-Mm2-CUS1pvQe.js";class O extends lt{}o([F(0,y)],O.prototype,"pos",void 0),o([F(1,y)],O.prototype,"uv",void 0);class St extends yt{}class k extends W{}o([p(ht)],k.prototype,"dvs",void 0);class v extends W{}o([p(y)],v.prototype,"perspective",void 0),o([p(y)],v.prototype,"texSize",void 0),o([p(R)],v.prototype,"wrapAroundShift",void 0),o([p(R)],v.prototype,"opacity",void 0),o([p(ct)],v.prototype,"texture",void 0);class x extends ut{vertex(t){const s=t.uv.divide(this.config.texSize),e=new R(1).add(ft(s,this.config.perspective)),a=new vt(t.pos.add(new y(this.config.wrapAroundShift,0)),1),i=this.transform.dvs.multiply(a);return{uv:s,glPosition:new mt(i.xy.multiply(e),0,e)}}fragment(t){const s=xt(this.config.texture,t.uv).multiply(this.config.opacity),e=new gt;return e.glFragColor=s,e}}o([p(k)],x.prototype,"transform",void 0),o([p(v)],x.prototype,"config",void 0),o([L(0,B(O))],x.prototype,"vertex",null),o([L(0,B(St))],x.prototype,"fragment",null);let bt=class extends pt{constructor(){super(...arguments),this.type=wt.Overlay,this._mesh=null,this.shaders={overlay:new x}}render(n,t){const{context:s,painter:e}=n,a=this._getMesh(n,t);e.setPipelineState(N);const{isWrapAround:i,wrapAroundShift:d}=t.config,l={...t.config,wrapAroundShift:0},u={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:l},defines:null,optionalAttributes:null,useComputeBuffer:!1};e.setPipelineState({...N,stencil:{write:!1,test:{compare:_t.EQUAL,op:{fail:D.KEEP,zFail:D.KEEP,zPass:D.REPLACE},ref:0,mask:255}}}),e.submitDrawMeshUntyped(s,u,a),i&&(l.wrapAroundShift=d,e.submitDrawMeshUntyped(s,u,a))}shutdown(){nt(this._mesh)}_getMesh(n,t){const{context:s}=n;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.setData(t.position)}else{const e=t.index!=null?t.index.length:t.position.length/2;this._mesh=new dt(s,{vertex:{positions:t.position,uvs:t.tex},index:t.index!=null?{index:t.index}:void 0,groups:[{attributes:[{name:"pos",count:2,type:U.FLOAT,location:0,vertex:"positions",stride:8,offset:0},{name:"tex",count:2,type:U.UNSIGNED_SHORT,location:1,vertex:"uvs",stride:4,offset:0}],index:t.index!=null?"index":void 0,primitive:Mt.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}};class It extends at{constructor(){super(...arguments),this._viewStateId=-1,this._dvsMat3=Y(),this._overlayTechnique=new bt}get dvsMat3(){return this._dvsMat3}beforeRender(t){this._updateMatrices(t),this._updateOverlays(t,this.children);for(const s of this.children)s.beforeRender(t)}doRender(t){if(t.drawPhase!==tt.MAP||!this.visible)return;super.doRender(t);const s=this._overlayTechnique;for(const e of this.children)e.draw(t,s)}onDetach(){this._overlayTechnique.shutdown()}_updateMatrices(t){const{state:s}=t,{id:e,size:a,pixelRatio:i,resolution:d,rotation:l,viewpoint:u,displayMat3:M}=s;if(this._viewStateId===e)return;const g=I(l),h=i*a[0],f=i*a[1];this._localOrigin=u.targetGeometry.clone();const{x:m,y:S}=this._localOrigin,w=it(m,s.spatialReference);this._localOrigin.x=w,this._localOrigin.y=S;const b=d*h,A=d*f,r=Q(this._dvsMat3);Z(r,r,M),V(r,r,st(h/2,f/2)),J(r,r,ot(h/b,-f/A,1)),X(r,r,-g),this._viewStateId=e}_updateOverlays(t,s){const{state:e}=t,{rotation:a,spatialReference:i,worldScreenWidth:d,size:l,viewpoint:u}=e,M=this._localOrigin;let g,h=0;const f=rt(i);if(f&&i.isWrappable){const m=l[0],S=l[1],w=I(a),b=Math.abs(Math.cos(w)),A=Math.abs(Math.sin(w)),r=Math.round(m*b+S*A),[C,$]=f.valid,c=et(i),{x:z,y:q}=u.targetGeometry,K=[z,q],E=[0,0];e.toScreen(E,K);const _=[0,0];let P;P=r>d?.5*d:.5*r;const G=Math.floor((z+.5*c)/c),j=C+G*c,H=$+G*c,T=[E[0]+P,0];e.toMap(_,T),_[0]>H&&(h=c),T[0]=E[0]-P,e.toMap(_,T),_[0]d?.5*d:.5*r;const G=Math.floor((z+.5*c)/c),j=C+G*c,H=$+G*c,T=[E[0]+P,0];e.toMap(_,T),_[0]>H&&(h=c),T[0]=E[0]-P,e.toMap(_,T),_[0]G(t,e,r,s,i);case"esriGeometryPolygon":return(r,t,s,i)=>T(t,e,r,s,i);case"esriGeometryPolyline":return(r,t,s,i)=>w(t,e,r,s,i);case"esriGeometryMultipoint":return(r,t,s,i)=>P(t,e,r,s,i);default:return b.getLogger("esri.views.2d.support.arcadeOnDemand").error(new I("mapview-arcade",`Unable to handle geometryType: ${c}`)),r=>r}}const D=c=>{if(!c)return[0,0,0,0];const{r:e,g:r,b:t,a:s}=c;return[e,r,t,255*s]};class n{static findApplicableOverrides(e,r,t){if(e&&r){if(e.primitiveName){let s=!1;for(const i of t)if(i.primitiveName===e.primitiveName){s=!0;break}if(!s)for(const i of r)i.primitiveName===e.primitiveName&&t.push(i)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.symbolLayers)for(const s of e.symbolLayers)n.findApplicableOverrides(s,r,t);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.markerPlacement&&n.findApplicableOverrides(e.markerPlacement,r,t),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const s of e.markerGraphics)n.findApplicableOverrides(s,r,t),n.findApplicableOverrides(s.symbol,r,t)}else e.type==="CIMCharacterMarker"?n.findApplicableOverrides(e.symbol,r,t):e.type==="CIMHatchFill"?n.findApplicableOverrides(e.lineSymbol,r,t):e.type==="CIMPictureMarker"&&n.findApplicableOverrides(e.animatedSymbolProperties,r,t)}}}static findEffectOverrides(e,r){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&k(e),!r||!e.primitiveName)return{type:"cim-effect-param",effect:e,overrides:[]};const t=v(e),s=e.primitiveName,i=[];for(const a of r)a.primitiveName===s&&i.push(v(a));return{type:"cim-effect-param",effect:t,overrides:O(i)}}static async resolveSymbolOverrides(e,r,t,s,i,a,o){if(!e?.symbol)return null;let{symbol:p,primitiveOverrides:l}=e;const y=!!l;if(!y&&!s)return p;p=d(p),l=d(l);let u=!0;if(r||(r={attributes:{}},u=!1),y){if(u||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$feature"))),o||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$view"))),l.length>0){const f={spatialReference:t,fields:h(r.attributes),geometryType:i};await n.createRenderExpressions(l,f),n.evaluateOverrides(l,r,i??"esriGeometryPoint",a,o)}n.applyOverrides(p,l)}return s&&n.applyDictionaryTextOverrides(p,r,s,null),p}static async createRenderExpressions(e,r){const t=[];for(const s of e){const i=s.valueExpressionInfo;if(!i||n._expressionToRenderExpression.has(i.expression))continue;const a=M(i.expression,r.spatialReference,r.fields);t.push(a),a.then(o=>n._expressionToRenderExpression.set(i.expression,o))}t.length>0&&await Promise.all(t)}static evaluateOverrides(e,r,t,s,i){const a={$view:{scale:i?.scale}};for(const o of e){o.value&&typeof o.value=="object"&&x(o.value)&&(o.propertyName==="Color"||o.propertyName==="StrokeColor")&&(o.value=D(o.value));const p=o.valueExpressionInfo;if(!p)continue;const l=n._expressionToRenderExpression.get(p.expression);l&&(o.value=E(l,r,a,t,s))}}static applyDictionaryTextOverrides(e,r,t,s,i="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const a=e.symbolLayers;if(!a)return;for(const o of a)o&&o.type==="CIMVectorMarker"&&n.applyDictionaryTextOverrides(o,r,t,s,e.type==="CIMTextSymbol"?e.textCase:i)}break;case"CIMVectorMarker":{const a=e.markerGraphics;if(!a)return;for(const o of a)o&&n.applyDictionaryTextOverrides(o,r,t,s)}break;case"CIMMarkerGraphic":{const a=e.textString;if(a&&a.includes("[")){const o=S(a,t);e.textString=g(r,o,s,i)}}}}static applyOverrides(e,r,t,s){if(e.primitiveName){for(const i of r)if(i.primitiveName===e.primitiveName){const a=N(i.propertyName);if(s&&s.push({cim:e,nocapPropertyName:a,value:e[a]}),t){let o=!1;for(const p of t)p.primitiveName===e.primitiveName&&(o=!0);o||t.push(i)}i.value!=null&&(e[a]=i.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.symbolLayers)for(const i of e.symbolLayers)n.applyOverrides(i,r,t,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const i of e.markerGraphics)n.applyOverrides(i,r,t,s),n.applyOverrides(i.symbol,r,t,s)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const t of e)t.value!==void 0&&(r+=`${t.primitiveName}${t.propertyName}${JSON.stringify(t.value)}`);return r}static toValue(e,r){if(e==="DashTemplate")return r.split(" ").map(t=>Number(t));if(e==="Color"){const t=new C(r).toRgba();return t[3]*=255,t}return r}}n._expressionToRenderExpression=new Map;export{n as c}; diff --git a/main/assets/OverrideHelper-DWRbVlj1-D6dDt4cu.js b/main/assets/OverrideHelper-DWRbVlj1-D6dDt4cu.js new file mode 100644 index 000000000..49fb1d6d8 --- /dev/null +++ b/main/assets/OverrideHelper-DWRbVlj1-D6dDt4cu.js @@ -0,0 +1 @@ +import{P as d,f2 as M,ar as C,a1 as b,o as I}from"./main-C7yV2j71.js";import{x}from"./colorUtils-Cthpxcks-CXgjba3p.js";import{b as k,S as v,k as O,d as h,K as S,Z as g,x as N}from"./utils-SPbpQbmm-Dl9Ps2XQ.js";import{q as P,T as w,F as T,v as G}from"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";function E(c,e,r,t,s){if(c==null)return null;const i=c.referencesGeometry()&&s?L(e,t,s):e,a=c.repurposeFeature(i);try{return c.evaluate({...r,$feature:a},c.services)}catch(o){return b.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",o),null}}const m=new Map;function L(c,e,r){const{transform:t,hasZ:s,hasM:i}=r;m.has(e)||m.set(e,A(e));const a=m.get(e)(c.geometry,t,s,i);return{...c,geometry:a}}function A(c){const e={};switch(c){case"esriGeometryPoint":return(r,t,s,i)=>G(t,e,r,s,i);case"esriGeometryPolygon":return(r,t,s,i)=>T(t,e,r,s,i);case"esriGeometryPolyline":return(r,t,s,i)=>w(t,e,r,s,i);case"esriGeometryMultipoint":return(r,t,s,i)=>P(t,e,r,s,i);default:return b.getLogger("esri.views.2d.support.arcadeOnDemand").error(new I("mapview-arcade",`Unable to handle geometryType: ${c}`)),r=>r}}const D=c=>{if(!c)return[0,0,0,0];const{r:e,g:r,b:t,a:s}=c;return[e,r,t,255*s]};class n{static findApplicableOverrides(e,r,t){if(e&&r){if(e.primitiveName){let s=!1;for(const i of t)if(i.primitiveName===e.primitiveName){s=!0;break}if(!s)for(const i of r)i.primitiveName===e.primitiveName&&t.push(i)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.symbolLayers)for(const s of e.symbolLayers)n.findApplicableOverrides(s,r,t);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.markerPlacement&&n.findApplicableOverrides(e.markerPlacement,r,t),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const s of e.markerGraphics)n.findApplicableOverrides(s,r,t),n.findApplicableOverrides(s.symbol,r,t)}else e.type==="CIMCharacterMarker"?n.findApplicableOverrides(e.symbol,r,t):e.type==="CIMHatchFill"?n.findApplicableOverrides(e.lineSymbol,r,t):e.type==="CIMPictureMarker"&&n.findApplicableOverrides(e.animatedSymbolProperties,r,t)}}}static findEffectOverrides(e,r){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&k(e),!r||!e.primitiveName)return{type:"cim-effect-param",effect:e,overrides:[]};const t=v(e),s=e.primitiveName,i=[];for(const a of r)a.primitiveName===s&&i.push(v(a));return{type:"cim-effect-param",effect:t,overrides:O(i)}}static async resolveSymbolOverrides(e,r,t,s,i,a,o){if(!e?.symbol)return null;let{symbol:p,primitiveOverrides:l}=e;const y=!!l;if(!y&&!s)return p;p=d(p),l=d(l);let u=!0;if(r||(r={attributes:{}},u=!1),y){if(u||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$feature"))),o||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$view"))),l.length>0){const f={spatialReference:t,fields:h(r.attributes),geometryType:i};await n.createRenderExpressions(l,f),n.evaluateOverrides(l,r,i??"esriGeometryPoint",a,o)}n.applyOverrides(p,l)}return s&&n.applyDictionaryTextOverrides(p,r,s,null),p}static async createRenderExpressions(e,r){const t=[];for(const s of e){const i=s.valueExpressionInfo;if(!i||n._expressionToRenderExpression.has(i.expression))continue;const a=M(i.expression,r.spatialReference,r.fields);t.push(a),a.then(o=>n._expressionToRenderExpression.set(i.expression,o))}t.length>0&&await Promise.all(t)}static evaluateOverrides(e,r,t,s,i){const a={$view:{scale:i?.scale}};for(const o of e){o.value&&typeof o.value=="object"&&x(o.value)&&(o.propertyName==="Color"||o.propertyName==="StrokeColor")&&(o.value=D(o.value));const p=o.valueExpressionInfo;if(!p)continue;const l=n._expressionToRenderExpression.get(p.expression);l&&(o.value=E(l,r,a,t,s))}}static applyDictionaryTextOverrides(e,r,t,s,i="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const a=e.symbolLayers;if(!a)return;for(const o of a)o&&o.type==="CIMVectorMarker"&&n.applyDictionaryTextOverrides(o,r,t,s,e.type==="CIMTextSymbol"?e.textCase:i)}break;case"CIMVectorMarker":{const a=e.markerGraphics;if(!a)return;for(const o of a)o&&n.applyDictionaryTextOverrides(o,r,t,s)}break;case"CIMMarkerGraphic":{const a=e.textString;if(a&&a.includes("[")){const o=S(a,t);e.textString=g(r,o,s,i)}}}}static applyOverrides(e,r,t,s){if(e.primitiveName){for(const i of r)if(i.primitiveName===e.primitiveName){const a=N(i.propertyName);if(s&&s.push({cim:e,nocapPropertyName:a,value:e[a]}),t){let o=!1;for(const p of t)p.primitiveName===e.primitiveName&&(o=!0);o||t.push(i)}i.value!=null&&(e[a]=i.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.symbolLayers)for(const i of e.symbolLayers)n.applyOverrides(i,r,t,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const i of e.markerGraphics)n.applyOverrides(i,r,t,s),n.applyOverrides(i.symbol,r,t,s)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const t of e)t.value!==void 0&&(r+=`${t.primitiveName}${t.propertyName}${JSON.stringify(t.value)}`);return r}static toValue(e,r){if(e==="DashTemplate")return r.split(" ").map(t=>Number(t));if(e==="Color"){const t=new C(r).toRgba();return t[3]*=255,t}return r}}n._expressionToRenderExpression=new Map;export{n as c}; diff --git a/main/assets/PBFDecoderWorker-J6PBo4mo-BE6m9pP-.js b/main/assets/PBFDecoderWorker-J6PBo4mo-BE6m9pP-.js new file mode 100644 index 000000000..0f226e379 --- /dev/null +++ b/main/assets/PBFDecoderWorker-J6PBo4mo-BE6m9pP-.js @@ -0,0 +1 @@ +import{t as d}from"./compilerUtils-CV1QYWI8-89qN_-l3.js";import{J as c,hB as p}from"./main-C7yV2j71.js";import{o as f}from"./projection-BA9M1R7d-DXrPfsKU.js";import{y as m}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{D as y,n as _}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{v as g}from"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";let b=class{constructor(i,t,e){this.uid=i,this.geometry=t,this.attributes=e,this.visible=!0,this.objectId=null,this.centroid=null}};class P{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}function C(i,t,e,s){if(t?.size&&e!=null&&i)for(const r in i){if(!t.has(r))continue;const o=i[r];typeof o=="string"&&o.length>e&&(s(r),i[r]="")}}function G(i,t){return t}function l(i,t,e,s){switch(e){case 0:return h(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?h(i,t+s,1):M(i,t+s,1)}}function u(i,t,e,s){return e===2?h(i,t,2):l(i,t,e,s)}function v(i,t,e,s){return e===2?h(i,t,3):l(i,t,e,s)}function A(i,t,e,s){return e===3?h(i,t,3):u(i,t,e,s)}function h({translate:i,scale:t},e,s){return i[s]+e*t[s]}function M({translate:i,scale:t},e,s){return i[s]-e*t[s]}class T{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=G,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new P}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=f(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const s of t.features)e(s.geometry)}createSpatialReference(){return new c}addField(t,e){t.fields.push(m.fromJSON(e));const s=t.fields.map(r=>r.name);this._attributesConstructor=function(){for(const r of s)this[r]=null}}addFeature(t,e){const s=this._options.maxStringAttributeLength,r=this._options.maxStringAttributeFields;C(e.attributes,r,s,o=>{const n=e.attributes[t.objectIdFieldName];n!=null&&this._missingAttributes.push({objectId:n,attribute:o})}),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,o=y(s.clone(),s,!1,!1,this._transform),n=_(o,r,!1,!1);let a=null;switch(r){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}n.type=a,t.queryGeometryType=r,t.queryGeometry=n}prepareFeatures(t){switch(this._transform=t.transform??null,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"point":this.addCoordinate=(e,s,r)=>this.addCoordinatePoint(e,s,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,s,r)=>this._addCoordinatePolygon(e,s,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,s,r)=>this._addCoordinatePolyline(e,s,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,s,r)=>this._addCoordinateMultipoint(e,s,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:d(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new b(p(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce((e,s)=>e+s,0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,s){const r=this._transform?this._applyTransform(this._transform,e,s,0):e;if(r!=null)switch(s){case 0:t.x=r;break;case 1:t.y=r;break;case 2:t.hasZ?t.z=r:t.m=r;break;case 3:t.m=r}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,s):t}_addCoordinatePolyline(t,e,s){this._dehydratedAddPointsCoordinate(t.paths,e,s)}_addCoordinatePolygon(t,e,s){this._dehydratedAddPointsCoordinate(t.rings,e,s)}_addCoordinateMultipoint(t,e,s){s===0&&t.points.push([]);const r=this._transformPathLikeValue(e,s);t.points[t.points.length-1].push(r)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,s){s===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(e,s),o=t[t.length-1],n=this._coordinateBuffer;if(n){if(s===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;o.push(new Float64Array(n.buffer,a,this._vertexDimension))}n[this._coordinateBufferPtr++]=r}}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?A:e?u:s?v:l}}class R{_parseFeatureQuery(t){const e=new T(t.options),s=g(t.buffer,e),r={...s,spatialReference:s.spatialReference?.toJSON(),fields:s.fields?s.fields.map(o=>o.toJSON()):void 0,missingAttributes:e.missingAttributes};return Promise.resolve(r)}}function E(){return new R}export{E as default}; diff --git a/main/assets/PBFDecoderWorker-J6PBo4mo-CkrGK4sU.js b/main/assets/PBFDecoderWorker-J6PBo4mo-CkrGK4sU.js deleted file mode 100644 index b4e71a509..000000000 --- a/main/assets/PBFDecoderWorker-J6PBo4mo-CkrGK4sU.js +++ /dev/null @@ -1 +0,0 @@ -import{t as d}from"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import{J as c,hB as p}from"./main-BZaw9FpY.js";import{o as f}from"./projection-BA9M1R7d-DoNqITCd.js";import{y as m}from"./Field-C6hA1tZj-CbELM0zp.js";import{D as y,n as _}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{v as g}from"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";let b=class{constructor(i,t,e){this.uid=i,this.geometry=t,this.attributes=e,this.visible=!0,this.objectId=null,this.centroid=null}};class P{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}function C(i,t,e,s){if(t?.size&&e!=null&&i)for(const r in i){if(!t.has(r))continue;const o=i[r];typeof o=="string"&&o.length>e&&(s(r),i[r]="")}}function G(i,t){return t}function l(i,t,e,s){switch(e){case 0:return h(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?h(i,t+s,1):M(i,t+s,1)}}function u(i,t,e,s){return e===2?h(i,t,2):l(i,t,e,s)}function v(i,t,e,s){return e===2?h(i,t,3):l(i,t,e,s)}function A(i,t,e,s){return e===3?h(i,t,3):u(i,t,e,s)}function h({translate:i,scale:t},e,s){return i[s]+e*t[s]}function M({translate:i,scale:t},e,s){return i[s]-e*t[s]}class T{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=G,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new P}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=f(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const s of t.features)e(s.geometry)}createSpatialReference(){return new c}addField(t,e){t.fields.push(m.fromJSON(e));const s=t.fields.map(r=>r.name);this._attributesConstructor=function(){for(const r of s)this[r]=null}}addFeature(t,e){const s=this._options.maxStringAttributeLength,r=this._options.maxStringAttributeFields;C(e.attributes,r,s,o=>{const n=e.attributes[t.objectIdFieldName];n!=null&&this._missingAttributes.push({objectId:n,attribute:o})}),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,o=y(s.clone(),s,!1,!1,this._transform),n=_(o,r,!1,!1);let a=null;switch(r){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}n.type=a,t.queryGeometryType=r,t.queryGeometry=n}prepareFeatures(t){switch(this._transform=t.transform??null,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"point":this.addCoordinate=(e,s,r)=>this.addCoordinatePoint(e,s,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,s,r)=>this._addCoordinatePolygon(e,s,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,s,r)=>this._addCoordinatePolyline(e,s,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,s,r)=>this._addCoordinateMultipoint(e,s,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:d(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new b(p(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce((e,s)=>e+s,0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,s){const r=this._transform?this._applyTransform(this._transform,e,s,0):e;if(r!=null)switch(s){case 0:t.x=r;break;case 1:t.y=r;break;case 2:t.hasZ?t.z=r:t.m=r;break;case 3:t.m=r}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,s):t}_addCoordinatePolyline(t,e,s){this._dehydratedAddPointsCoordinate(t.paths,e,s)}_addCoordinatePolygon(t,e,s){this._dehydratedAddPointsCoordinate(t.rings,e,s)}_addCoordinateMultipoint(t,e,s){s===0&&t.points.push([]);const r=this._transformPathLikeValue(e,s);t.points[t.points.length-1].push(r)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,s){s===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(e,s),o=t[t.length-1],n=this._coordinateBuffer;if(n){if(s===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;o.push(new Float64Array(n.buffer,a,this._vertexDimension))}n[this._coordinateBufferPtr++]=r}}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?A:e?u:s?v:l}}class R{_parseFeatureQuery(t){const e=new T(t.options),s=g(t.buffer,e),r={...s,spatialReference:s.spatialReference?.toJSON(),fields:s.fields?s.fields.map(o=>o.toJSON()):void 0,missingAttributes:e.missingAttributes};return Promise.resolve(r)}}function E(){return new R}export{E as default}; diff --git a/main/assets/PieChartMeshWriter-C5yLDFwp-0zzyhiO2.js b/main/assets/PieChartMeshWriter-C5yLDFwp-0zzyhiO2.js new file mode 100644 index 000000000..3ecfd5cf4 --- /dev/null +++ b/main/assets/PieChartMeshWriter-C5yLDFwp-0zzyhiO2.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); +import{K as te,f4 as m,ar as ee,o as se,a1 as ie,hJ as re,ae as gt,_ as oe}from"./main-C7yV2j71.js";import{I as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{b as $,e as kt,c as ne,i as ae,P as ce,x as zt,d as Dt,Y as ue,W as le,X as he,U as pe,u as C,f as St,R as Pt,g as vt,E as T,h as de,j as fe}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import{O as xe,D as At,d as Yt}from"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import{t as tt,K as rt,n as R,d as me,$ as ye,_ as _e,r as ge,c as ke}from"./definitions-DJSdSb77-DkoRHaVx.js";import{D as Se,M as Pe,k as ve}from"./TurboLine-CIlsAy5m-Q2LH92mI.js";import{t as Nt,e as be,Z as we,V as Te}from"./LabelMetric-BeluzH3o-CQPyji82.js";import{I as Bt}from"./utils-SPbpQbmm-Dl9Ps2XQ.js";import{S as G,r as Lt,i as nt,R as at,t as ct}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import{c as Ee}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{l as Me,G as Ie,i as ze,e as De}from"./Tile-D75RMC64-CM0vKD9b.js";import{L as Q}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as J}from"./constants-Bqe1QJ4u-F8oTIn7N.js";const Ae=()=>ie.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),Ye=0,Ne=100;function Z(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||Ye,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||Ne]}function W(t){return 1<import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>t.g)}function Rt(t){switch(t){case h.BYTE:case h.UNSIGNED_BYTE:return 1;case h.SHORT:case h.UNSIGNED_SHORT:case h.HALF_FLOAT:return 2;case h.FLOAT:case h.INT:case h.UNSIGNED_INT:return 4}}function Oe(t){const e=[],s=[],i=[];for(const r of t){const o=Rt(r.type)*r.count;switch(o%2||o%4||4){case 4:e.push(r);continue;case 2:s.push(r);continue;case 1:i.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...s),e.push(...i),e}let Ce=class Ft{static fromVertexSpec(e,s){const{attributes:i,optionalAttributes:r}=e;let o,n,a;const c=[];for(const y in i){const _=i[y];_.pack==="position"?o={..._,name:y,offset:0}:_.pack==="id"?n={..._,name:y,offset:4}:y==="bitset"?a={..._,name:y,offset:7}:c.push({..._,name:y})}for(const y in r)if(s[y]===!0){const _=r[y];c.push({..._,name:y})}const l=Oe(c),u=[];let f=8,x=1;for(const y of l)u.push({...y,offset:f}),f+=Rt(y.type)*y.count,y.packAlternating&&(x=Math.max(y.packAlternating.count,x));const p=Uint32Array.BYTES_PER_ELEMENT,d=f%p;return new Ft(o,n,a,u,f+(d?p-d:0),x)}constructor(e,s,i,r,o,n){this.position=e,this.id=s,this.bitset=i,this.standardAttributes=r,this.stride=o,this.packVertexCount=n,r.push(i),this._attributes=[e,s,i,...r]}get attributeLayout(){if(!this._attributeLayout){const e=we(this._attributes),s=this._attributes.map(i=>({name:i.name,count:i.count,offset:i.offset,type:i.type,packPrecisionFactor:i.packPrecisionFactor,normalized:i.normalized??!1}));this._attributeLayout={attributes:s,hash:e,stride:this.stride}}return this._attributeLayout}},We=class Ot{static fromVertexSpec(e,s){const i=Ce.fromVertexSpec(e,s);return new Ot(i)}constructor(e){this._spec=e,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,s,i,r,o,n){for(let a=0;athis.vertexSpec.createComputedParams(r)}get _vertexPack(){if(!this._cachedVertexPack){const t=We.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){Ue(this._evaluator.inputMeshParams.effects?.effectInfos)&&await Fe()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(t,s,void 0,r);const n=s.readGeometryForDisplay()?.clone();if(!n)return;const a=T.fromOptimizedCIM(n,s.geometryType),c=mt();a.invertY();const l=t.id||"",u=Re.executeEffects(o,a,l,c);let f;for(;f=u.next();)f.invertY(),this._write(t,s,f,r)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(i,this._viewParams)}_writeVertex(t,e,s,i,r){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,i,o,r)}};function He(t,e,s,i,r,o,n){pt=0;const a=(i-s)*o,c=r&&r.length,l=c?(r[0]-s)*o:a;let u,f,x,p,d,y=Ct(e,s,i,0,l,o,!0);if(y&&y.next!==y.prev){if(c&&(y=qe(e,s,i,r,y,o)),a>80*o){u=x=e[0+s*o],f=p=e[1+s*o];for(let _=o;_0)for(let c=i;c=i;c-=o)a=bt(c+e*o,t[c+e*o],t[c+1+e*o],a);return a&&D(a,a.next)&&(X(a),a=a.next),a}function U(t,e=t){if(!t)return t;let s,i=t;do if(s=!1,i.steiner||!D(i,i.next)&&k(i.prev,i,i.next)!==0)i=i.next;else{if(X(i),i=e=i.prev,i===i.next)break;s=!0}while(s||i!==e);return e}function H(t,e,s,i,r,o,n,a){if(!t)return;!a&&o&&(t=Wt(t,i,r,o));let c=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ve(t,i,r,o):Xe(t))e.push(l.index/s+n),e.push(t.index/s+n),e.push(u.index/s+n),X(t),t=u.next,c=u.next;else if((t=u)===c){a?a===1?H(t=es(t,e,s,n),e,s,i,r,o,n,2):a===2&&ss(t,e,s,i,r,o,n):H(U(t),e,s,i,r,o,n,1);break}}}function Xe(t){const e=t.prev,s=t,i=t.next;if(k(e,s,i)>=0)return!1;let r=t.next.next;const o=r;let n=0;for(;r!==t.prev&&(n===0||r!==o);){if(n++,L(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&k(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ve(t,e,s,i){const r=t.prev,o=t,n=t.next;if(k(r,o,n)>=0)return!1;const a=r.xo.x?r.x>n.x?r.x:n.x:o.x>n.x?o.x:n.x,u=r.y>o.y?r.y>n.y?r.y:n.y:o.y>n.y?o.y:n.y,f=lt(a,c,e,s,i),x=lt(l,u,e,s,i);let p=t.prevZ,d=t.nextZ;for(;p&&p.z>=f&&d&&d.z<=x;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0||(p=p.prevZ,d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=x;){if(d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function bt(t,e,s,i){const r=F.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ze(t){let e=t,s=t;do(e.x=s.next.y&&s.next.y!==s.y){const x=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(x<=i&&x>n){if(n=x,x===i){if(r===s.y)return s;if(r===s.next.y)return s.next}o=s.x=s.x&&s.x>=c&&i!==s.x&&L(ro.x)&&V(s,t)&&(o=s,f=u)),s=s.next;return o}function Wt(t,e,s,i){let r;for(;r!==t;r=r.next){if(r=r||t,r.z===null&&(r.z=lt(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Wt(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,je(t)}function je(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let o=0;for(;r;){o++,i=r;let n=0;for(;n0||a>0&&i;){let c;n===0?(c=i,i=i.nextZ,a--):a!==0&&i?r.z<=i.z?(c=r,r=r.nextZ,n--):(c=i,i=i.nextZ,a--):(c=r,r=r.nextZ,n--),e?e.nextZ=c:t=c,c.prevZ=e,e=c}r=i}if(e.nextZ=null,s*=2,o<2)return t}}function k(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function Ut(t,e,s,i){return!!(D(t,e)&&D(s,i)||D(t,i)&&D(s,e))||k(t,e,s)>0!=k(t,e,i)>0&&k(s,i,t)>0!=k(s,i,e)>0}function Ke(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&Ut(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}function $e(t,e,s,i,r,o){let n=0;for(let a=i,c=r-o;a=0&&(t-n)*(i-a)-(s-n)*(e-a)>=0&&(s-n)*(o-a)-(r-n)*(i-a)>=0}function V(t,e){return k(t.prev,t,t.next)<0?k(t,e,t.next)>=0&&k(t,t.prev,e)>=0:k(t,e,t.prev)<0||k(t,t.next,e)<0}function lt(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e){return t.x-e.x}function es(t,e,s,i){let r=t;do{const o=r.prev,n=r.next.next;!D(o,n)&&Ut(o,r,r.next,n)&&V(o,n)&&V(n,o)&&(e.push(o.index/s+i),e.push(r.index/s+i),e.push(n.index/s+i),X(r),X(r.next),r=t=n),r=r.next}while(r!==t);return r}function ss(t,e,s,i,r,o,n){let a=t;do{let c=a.next.next;for(;c!==a.prev;){if(a.index!==c.index&&is(a,c)){let l=Ht(a,c);return a=U(a,a.next),l=U(l,l.next),H(a,e,s,i,r,o,n,0),void H(l,e,s,i,r,o,n,0)}c=c.next}a=a.next}while(a!==t)}function is(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!Ke(t,e)&&V(t,e)&&V(e,t)&&rs(t,e)}function rs(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do s.y>o!=s.next.y>o&&s.next.y!==s.y&&r<(s.next.x-s.x)*(o-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next;while(s!==t);return i}function Ht(t,e){const s=F.create(t.index,t.x,t.y),i=F.create(e.index,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,o.next=i,i.prev=o,i}class F{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(e,s,i){const r=pt0))break;u+=_,f.push(n+l),l+=y}const x=o.length;He(o,s,n,n+l,f,2,r);const p=as(o,s,x,o.length,r),d=Math.abs(u);if(Math.abs((p-d)/Math.max(1e-7,d))>ns)return o.length=0,!1;a=c,n+=l}return!0}function us(t){const{coords:e,lengths:s}=t,{buffer:i}=ve(e,s);return i}function ls(t,e,s){let i=0;for(let r=0;rs||cs)return!0}i+=o}return!1}function Xt(t,e){if(t==null)return null;if(!ls(t,-128,tt+128))return t;z.setPixelMargin(e),z.reset(Yt.Polygon);let s=0;for(let n=0;nr||ur){n=!0;continue}c.push({x:l,y:u})}let f=!1;for(;t.nextPoint();)if(l=t.x,u=t.y,n)s.lineTo(l,u);else{if(lr||ur){f=!0;break}c.push({x:l,y:u})}if(f)n=!0;else{if(n){const x=s.resultWithStarts();if(x)for(const p of x)o.push(p)}else o.push({line:c,start:0});a=t.nextPath(),n=!1}}return o=o.filter(c=>c.line.length>1),o.length===0?null:o}z.setExtent(tt),dt.setExtent(tt);const ps=100,ds=te("featurelayer-fast-triangulation-enabled");class Vt extends O{async loadDependencies(){await Promise.all([super.loadDependencies(),Pe()])}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);o&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,s,o),e.recordEnd())}_clip(e){if(!e)return null;const s=this.hasEffects;return Xt(e,s?256:8)}_writeGeometry(e,s,i){const r=i.maxLength>ps,o=[],n=this.createTesselationParams(s);if(!r&&ds&&cs(o,i))return void(o.length&&this._writeVertices(e,s,i.coords,n,o));const a=us(i);this._writeVertices(e,s,a,n)}_writeVertices(e,s,i,r,o){const n=s.getDisplayId(),a=e.vertexCount(),c=this.hasEffects;let l=0;if(o)for(const u of o){const f=i[2*u],x=i[2*u+1];c&&e.recordBounds(f,x,0,0),this._writeVertex(e,n,f,x,r),l++}else for(let u=0;ut,optionalAttributes:{},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:h.FLOAT,count:1,packTessellation:({inverseArea:t})=>t}}};let ri=class extends Vt{constructor(){super(...arguments),this.vertexSpec=fs}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}};const ft={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}};let Zt=class extends Vt{constructor(){super(...arguments),this.vertexSpec=ft}createTesselationParams(t){return null}};const A={createComputedParams:t=>t,optionalAttributes:ft.optionalAttributes,attributes:{...ft.attributes,tlbr:{count:4,type:h.UNSIGNED_SHORT,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},inverseRasterizationScale:{count:1,type:h.BYTE,packPrecisionFactor:16,pack:({sprite:t})=>1/t.rasterizationScale}}};let xs=class extends Zt{constructor(){super(...arguments),this.vertexSpec=A}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),t.recordEnd()}};function et(t){const{sprite:e,aspectRatio:s,scaleProportionally:i}=t,r=m(t.height),o=r>0?r:e.height;let n=r*s;return n<=0?n=e.width:i&&(n*=e.width/e.height),{width:n,height:o}}function qt(t){const{applyRandomOffset:e,sampleAlphaOnly:s}=t;return q([[ce,e],[zt,s]])}const Qt={createComputedParams:t=>t,optionalAttributes:A.optionalAttributes,attributes:{...A.attributes,bitset:{count:1,type:h.UNSIGNED_BYTE,pack:qt},width:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},height:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},offset:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),-m(e)]},scale:{count:2,type:h.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:t,scaleY:e})=>[t,e]},angle:{count:1,type:h.UNSIGNED_BYTE,pack:({angle:t})=>xe(t)}}};let oi=class extends xs{constructor(){super(...arguments),this.vertexSpec=Qt}},ms=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const Y={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:h.UNSIGNED_BYTE,count:1},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},offset:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[j(t,16),j(e,16)]},normal:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[j(t,16),j(e,16)]},halfWidth:{type:h.HALF_FLOAT,count:1,pack:({width:t})=>m(.5*t)},referenceHalfWidth:{type:h.HALF_FLOAT,count:1,pack:({referenceWidth:t})=>m(.5*t)}}};let ys=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const Tt=65535;let Jt=class extends O{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Y,this._currentWrite=new ys,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:Tt,textured:!1},this._tessParams=new ms,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);i!=null&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new Se(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const i=s??T.fromFeatureSetReaderCIM(e);i&&this._writeGeometry(t,e,i)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return hs(t,Nt(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:i,_tessellationOptions:r,evaluatedMeshParams:o}=this,{width:n,capType:a,joinType:c,miterLimit:l,hasSizeVV:u}=o,f=m(.5*n);r.halfWidth=f,r.capType=Be(a),r.joinType=Le(c),r.miterLimit=l;const x=!u;i.out=t,i.id=e.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=t.vertexCount(),i.vertexBounds=x&&ft,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}},yt={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)}}};let _t=class extends Jt{constructor(){super(...arguments),this.vertexSpec=yt}},Kt=class extends Zt{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=jt,this._lineMeshWriter=this._createOutlineWriter(t,e,s,i)}_createOutlineWriter(t,e,s,i){return new _t(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd())}_clip(t){return t?Xt(t,Nt(this.evaluatedMeshParams)):null}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const st=Qt,_s=yt,gs={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>qt(t)},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},aux3:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),m(e)]},aux4:{count:2,type:h.UNSIGNED_BYTE,pack:({scaleX:t,scaleY:e})=>[t*$,e*$]}}},ks={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,color:_s.attributes.color,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.width)},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.referenceWidth)},aux3:{count:2,type:h.HALF_FLOAT,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[t,e]},aux4:{count:2,type:h.UNSIGNED_BYTE,packTessellation:({normalX:t,normalY:e})=>[t*$+kt,e*$+kt]}}};class Ss extends _t{constructor(){super(...arguments),this.vertexSpec=ks}}let ni=class extends Kt{constructor(){super(...arguments),this.vertexSpec=gs}_createOutlineWriter(t,e,s,i){return new Ss(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const Ps={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...jt.attributes}},vs={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...yt.attributes}};class bs extends _t{constructor(){super(...arguments),this.vertexSpec=vs}}class ai extends Kt{constructor(){super(...arguments),this.vertexSpec=Ps}_createOutlineWriter(e,s,i,r){return new bs(e,s,i,r)}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);if(!o)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,s,o),this._lineMeshWriter.writeLineVertices(e,T.fromOptimizedCIM(o,"esriGeometryPolyline"),s),e.recordEnd()}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._lineMeshWriter.ensurePacked(e,s,i)}enqueueRequest(e,s,i){super.enqueueRequest(e,s,i),this._lineMeshWriter.enqueueRequest(e,s,i)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const ws={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},offset:{type:h.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};let ci=class extends O{constructor(){super(...arguments),this.vertexSpec=ws}_write(t,e){t.recordStart(this.instanceId,this.attributeLayout);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPoint"){const i=e.readXForDisplay(),r=e.readYForDisplay();this._writeQuad(t,s,i,r)}else e.geometryType==="esriGeometryMultipoint"&&e.readGeometryForDisplay()?.forEachVertex((i,r)=>{i>=0&&i<=512&&r>=0&&r<=512&&this._writeQuad(t,s,i,r)});t.recordEnd()}_writeQuad(t,e,s,i){const r=t.vertexCount();this._writeVertex(t,e,s,i),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}};class $t{static getPlacement(e,s,i,r,o,n){const a=fe(i);return a?(s===-1&&e.invertY(),a.execute(e,i,r,o,n)):null}}const Et=96;class Ts{constructor(e){const{offsetX:s,offsetY:i,postAngle:r,fontSize:o,haloSize:n,outlineSize:a,scaleFactor:c,transforms:l}=e;if(this.offsetX=s,this.offsetY=i,this.postAngle=r,this.fontSize=Math.min(o,Et),this.haloSize=n??0,this.outlineSize=a??0,this.transforms=l,l&&l.infos.length>1){const u=Bt(o,r,!1,s,i,l,!1);this.fontSize=Math.min(u.size,Et);const f=u.size/o;this.haloSize*=f,this.outlineSize*=f,this.postAngle=u.rotation,this.offsetX=u.offsetX,this.offsetY=u.offsetY}c&&(this.fontSize*=c,this.offsetX*=c,this.offsetY*=c)}}const Es=28,M=[4,4],K=[16,4],Ms={topLeft:K,topRight:K,bottomLeft:K,bottomRight:K},it=[4,2],v=[4,6],Mt={topLeft:it,topRight:it,bottomLeft:v,bottomRight:v},It={topLeft:it,topRight:v,bottomLeft:it,bottomRight:v},Is={topLeft:v,topRight:v,bottomLeft:M,bottomRight:M},zs={topLeft:M,topRight:M,bottomLeft:v,bottomRight:v},Ds={topLeft:v,topRight:M,bottomLeft:v,bottomRight:M},As={topLeft:M,topRight:v,bottomLeft:M,bottomRight:v},Ys={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:rt,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||Es]},clipAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>Ns(t||0)},referenceSymbol:{type:h.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,e)=>{const s=t.isLineLabel||!t.referenceBounds,i=ne(s?"center":e.horizontalAlignment),r=ae(s?"middle":e.verticalAlignment),{offsetX:o,offsetY:n,size:a}=s?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[m(o),-m(n),Math.round(m(a)),i+1<<2|r+1]}}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>q([[ue,t],[le,!!e]])},offset:{type:h.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>Math.round(m(t))},referenceSize:{type:h.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:e})=>Math.round(m(e??t))},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},haloColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>g(t)},outlineAndHaloSize:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:e})=>[Math.round(m(t)),Math.round(m(e))]}}};class ui extends O{constructor(){super(...arguments),this.vertexSpec=Ys,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new Ts(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,s,i){const r=this._getShaping();if(!r)return;const o=s.getDisplayId();if(this.evaluatedMeshParams.placement!=null)return this._writePlacedTextMarkers(e,s,r,i);if(i?.nextPath())return i.nextPoint(),this._writeGlyphs(e,o,i.x,i.y,r,0);if(s.geometryType==="esriGeometryPolygon"){const c=s.readCentroidForDisplay();if(!c)return;const[l,u]=c.coords;return this._writeGlyphs(e,o,l,u,r,0)}if(s.geometryType==="esriGeometryMultipoint")return void s.readGeometryForDisplay()?.forEachVertex((c,l)=>this._writeGlyphs(e,o,c,l,r,0));const n=s.readXForDisplay(),a=s.readYForDisplay();return this._writeGlyphs(e,o,n,a,r,0)}_writePlacedTextMarkers(e,s,i,r){const o=r??T.fromFeatureSetReaderCIM(s);if(!o)return;const n=-1,a=$t.getPlacement(o,n,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!a)return;const c=s.getDisplayId();let l=a.next();for(;l!=null;){const u=l.tx,f=-l.ty,x=-l.getAngle();this._writeGlyphs(e,c,u,f,i,x),l=a.next()}}_getShaping(e){const s=this._textMeshTransformProps,i=this.evaluatedMeshParams;if(!i.glyphs?.glyphs.length)return null;const r=m(s.fontSize),o=m(s.offsetX),n=m(s.offsetY),a=gt(m(i.lineWidth),_e,ye),c=ge*gt(i.lineHeightRatio,.25,4);return de(i.glyphs,{scale:r/ke,angle:s.postAngle,xOffset:o,yOffset:n,horizontalAlignment:i.horizontalAlignment,verticalAlignment:e||i.verticalAlignment,maxLineWidth:a,lineHeight:c,decoration:i.decoration,borderLineSizePx:m(i.boxBorderLineSize),hasBackground:!!i.boxBackgroundColor,useCIMAngleBehavior:i.useCIMAngleBehavior})}_writeGlyphs(e,s,i,r,o,n,a,c){const l=this.evaluatedMeshParams,u=this._textMeshTransformProps,f=m(u.fontSize),x=u.haloSize,p=u.outlineSize,d=m(u.offsetX),y=m(u.offsetY),[_,P]=Z(l.scaleInfo,this.getTileInfo());n!==0&&o.setRotation(n);const S=o.bounds,I=i+S.x+d,w=r+S.y-y,N=2*(l.minPixelBuffer?l.minPixelBuffer/f:1),b=Math.max(S.width,S.height)*N;o.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),e.recordBounds(I,w,b,b),this._writeTextBox(e,s,i,r,o.textBox,a,c),e.recordEnd());for(const E of o.glyphs){e.recordStart(this.instanceId,this.attributeLayout,E.textureBinding),e.recordBounds(I,w,b,b);const{texcoords:ot,offsets:B}=E;this._writeQuad(e,s,i,r,{texcoords:ot,offsets:B,fontSize:f,haloSize:x,outlineSize:p,color:g(l.color),isBackground:!1,referenceBounds:a,minZoom:_,maxZoom:P,...c}),e.recordEnd()}n!==0&&o.setRotation(-n)}_writeTextBox(e,s,i,r,o,n,a){const c=this.evaluatedMeshParams,{fontSize:l,haloSize:u,outlineSize:f}=this._textMeshTransformProps,{boxBackgroundColor:x,boxBorderLineColor:p}=c,d={isBackground:!0,fontSize:l,haloSize:u,outlineSize:f,referenceBounds:n,...a};x&&(this._writeQuad(e,s,i,r,{texcoords:Ms,offsets:o.main,color:g(x),...d}),p||(this._writeQuad(e,s,i,r,{texcoords:Is,offsets:o.top,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:zs,offsets:o.bot,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:Ds,offsets:o.left,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:As,offsets:o.right,color:g(x),...d}))),p&&(this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.top,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.bot,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.left,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.right,color:g(p),...d}))}_writeQuad(e,s,i,r,o){const n=e.vertexCount();this._writeVertex(e,s,i,r,o),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Ns=t=>Math.round(t*(254/360)),Bs={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:s})=>q([[zt,t],[he,e],[pe,s]])},tlbr:{type:h.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},accumulatedDistance:{type:h.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:h.HALF_FLOAT,count:1,pack:({offsetAlongLine:t})=>m(t)},capType:{type:h.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case G.Butt:case"butt":return 0;case G.Square:case"square":return 1;case G.Round:case"round":return 2;default:return 0}}}}};class li extends Jt{constructor(e,s,i,r){super(e,s,i,r),this.vertexSpec=Bs,this._tessellationOptions.textured=!0}_write(e,s,i){const r=i??T.fromFeatureSetReaderCIM(s);if(!r)return;const{sprite:o}=this.evaluatedMeshParams;this._writeGeometry(e,s,r,o?.textureBinding)}}let Ls=class xt{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:i,width:r,height:o,angle:n,alignment:a,outlineSize:c,referenceSize:l,sprite:u,overrideOutlineColor:f}=e;return s.rawWidth=m(r),s.rawHeight=m(o),s.angle=n,s.alignment=a,s.outlineSize=m(c),s.referenceSize=m(l),s.overrideOutlineColor=f,s.offsetX=m(e.offsetX),s.offsetY=m(e.offsetY),i!=="simple"||u.sdf||(s.rawWidth=u.width,s.rawHeight=u.height),s._computeSize(e,!1),s}static fromComplexMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:i,transforms:r,size:o,scaleX:n,anchorX:a,anchorY:c,angle:l,colorLocked:u,frameHeight:f,widthRatio:x,offsetX:p,offsetY:d,outlineSize:y,referenceSize:_,scaleFactor:P,sizeRatio:S,isAbsoluteAnchorPoint:I,rotateClockwise:w,scaleSymbolsProportionally:N,sprite:b}=e;if(r&&r.infos.length>0){const B=Bt(o,l,w,p,d,r);o=B.size,l=B.rotation,p=B.offsetX,d=B.offsetY,w=!1}P&&(o*=P,p*=P,d*=P);const E=n*(b.width/b.height);s.alignment=i,s.rawHeight=m(o),s.rawWidth=s.rawHeight*E,s.referenceSize=m(_),s.sizeRatio=S,s.sdfDecodeCoeff=(b.sdfDecodeCoeff??1)*S,s.angle=l,s.rotateClockwise=w,s.anchorX=a,s.anchorY=c,s.offsetX=m(p),s.offsetY=m(d),I&&o&&(b.sdf?s.anchorX=a/(o*x):s.anchorX=a/(o*E),s.anchorY=c/o);const ot=N&&f?o/f:1;return s.outlineSize=y===0||isNaN(y)?0:m(y)*ot,s.scaleSymbolsProportionally=N,s.colorLocked=u,s._computeSize(e,!0),s}constructor(e,s,i,r,o,n,a){this.sprite=e,this.color=s,this.outlineColor=i,this.minPixelBuffer=r,this.placement=o,this.scaleInfo=n,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=Lt.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,s){const{sprite:i,hasSizeVV:r}=e,o=!!i.sdf,n=i.sdfPaddingRatio??.5,{rawWidth:a,rawHeight:c,sizeRatio:l,outlineSize:u}=this,f=l*(o?1/(1-n):1),x=a*f,p=c*f;if(o&&!r){const N=s&&a>c?x:a,b=c,E=u+2*1;this.computedWidth=Math.min(N+E,x),this.computedHeight=Math.min(b+E,p)}else this.computedWidth=x,this.computedHeight=p;const d=o?Math.max(i.width,i.height)/Math.max(x,p):1,y=.5*(x-this.computedWidth)*d,_=.5*(p-this.computedHeight)*d,P=i.rect.x+R+y,S=i.rect.y+R+_,I=P+i.width-2*y,w=S+i.height-2*_;this.texXmin=Math.floor(P),this.texYmin=Math.floor(S),this.texXmax=Math.ceil(I),this.texYmax=Math.ceil(w),this.computedWidth*=(this.texXmax-this.texXmin)/(I-P),this.computedHeight*=(this.texYmax-this.texYmin)/(w-S),this.anchorX*=x/this.computedWidth,this.anchorY*=p/this.computedHeight}};const Gs=3.14159265359/180,Rs=128/Math.PI;function Fs(t,e){return t%=e,Math.abs(t>=0?t:t+e)}function Os(t){return Fs(t*Rs,256)}function Cs(t,e,s,i,r=!1){const o=Me(),n=r?1:-1;return Ie(o),(e||s)&&ze(o,o,[e,-s]),i&&De(o,o,n*Gs*-i),o}const Ws={createComputedParams:t=>Ls.from(t),optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({sprite:t,alignment:e,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let o=0;return t.sdf&&(o|=W(C.bitset.isSDF)),e===Lt.MAP&&(o|=W(C.bitset.isMapAligned)),s&&(o|=W(C.bitset.scaleSymbolsProportionally)),i&&(o|=W(C.bitset.overrideOutlineColor)),r&&(o|=W(C.bitset.colorLocked)),o}},offset:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:t,computedWidth:e,computedHeight:s,anchorX:i,anchorY:r,offsetX:o,offsetY:n,rotateClockwise:a})=>{const c=Cs(0,o,n,-t,a),l=-(.5+i)*e,u=-(.5-r)*s,f=[l,u],x=[l+e,u],p=[l,u+s],d=[l+e,u+s];return Q(f,f,c),Q(x,x,c),Q(p,p,c),Q(d,d,c),[f,x,p,d]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:t,texXmin:e,texYmax:s,texYmin:i})=>[[e,i],[t,i],[e,s],[t,s]]}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},sizing:{type:h.UNSIGNED_BYTE,count:4,pack:({rawWidth:t,rawHeight:e,outlineSize:s,referenceSize:i})=>{const r=Math.max(t,e);return[ut(r,128),ut(s,128),ut(i,128),0]}},placementAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:t})=>Os(t)},sdfDecodeCoeff:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:t})=>t}}};class hi extends O{constructor(){super(...arguments),this.vertexSpec=Ws}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,s,i){const r=this.evaluatedMeshParams.sprite?.textureBinding,o=s.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,r);const n=this.evaluatedMeshParams.minPixelBuffer,a=Math.max(this.evaluatedMeshParams.computedWidth,n),c=Math.max(this.evaluatedMeshParams.computedHeight,n),l=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,u=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,f=this.evaluatedMeshParams.offsetX+l,x=-this.evaluatedMeshParams.offsetY+u;if(this.evaluatedMeshParams.placement!=null)this._writePlacedMarkers(e,s,i,a,c);else if(i?.nextPath()){i.nextPoint();const p=i.x,d=i.y;e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else if(s.geometryType==="esriGeometryPolygon"){const p=s.readCentroidForDisplay();if(!p)return;const[d,y]=p.coords;e.recordBounds(d+f,y+x,a,c),this._writeQuad(e,o,d,y)}else if(s.geometryType==="esriGeometryPoint"){const p=s.readXForDisplay(),d=s.readYForDisplay();e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else s.readGeometryForDisplay()?.forEachVertex((p,d)=>{e.recordBounds(p+f,d+x,a,c),Math.abs(p)>J||Math.abs(d)>J||this._writeQuad(e,o,p,d)});e.recordEnd()}_writePlacedMarkers(e,s,i,r,o){const n=i??T.fromFeatureSetReaderCIM(s)?.clone();if(!n)return;const a=-1,c=$t.getPlacement(n,a,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!c)return;const l=s.getDisplayId();let u=c.next();const f=this.evaluatedMeshParams.offsetX,x=-this.evaluatedMeshParams.offsetY;for(;u!=null;){const p=u.tx,d=-u.ty;if(Math.abs(p)>J||Math.abs(d)>J){u=c.next();continue}const y=-u.getAngle();e.recordBounds(p+f,d+x,r,o),this._writeQuad(e,l,p,d,y),u=c.next()}}_writeQuad(e,s,i,r,o){const n=e.vertexCount(),a=o==null?null:{placementAngle:o};this._writeVertex(e,s,i,r,a),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Us={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},offset:{type:h.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const e=m(t),s=-e/2,i=-e/2;return[[s,i],[s+e,i],[s,i+e],[s+e,i+e]]}}},texCoords:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:h.UNSIGNED_BYTE,count:2,pack:({size:t})=>[t,t]},referenceSize:{type:h.UNSIGNED_BYTE,count:1,pack:({size:t})=>m(t)},zoomRange:{type:h.UNSIGNED_BYTE,count:2,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}}};class pi extends O{constructor(){super(...arguments),this.vertexSpec=Us}_write(e,s){const i=s.getDisplayId(),r=this.evaluatedMeshParams.minPixelBuffer,o=Math.max(m(this.evaluatedMeshParams.size),r);let n,a;if(s.geometryType==="esriGeometryPoint")n=s.readXForDisplay(),a=s.readYForDisplay();else{const l=s.readCentroidForDisplay();if(!l)return;n=l?.coords[0],a=l?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(n,a,o,o);const c=e.vertexCount();this._writeVertex(e,i,n,a),e.indexWrite(c+0),e.indexWrite(c+1),e.indexWrite(c+2),e.indexWrite(c+1),e.indexWrite(c+3),e.indexWrite(c+2),e.recordEnd()}}export{pi as $,W as C,ui as F,ci as I,Es as J,ai as M,li as O,hi as Q,Z as R,xs as X,Re as Y,oi as a,ni as b,Zt as c,O as d,g,Kt as k,ri as m,Jt as y}; diff --git a/main/assets/PieChartMeshWriter-C5yLDFwp-CJPWs81O.js b/main/assets/PieChartMeshWriter-C5yLDFwp-CJPWs81O.js deleted file mode 100644 index 38d07486d..000000000 --- a/main/assets/PieChartMeshWriter-C5yLDFwp-CJPWs81O.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{K as te,f4 as m,ar as ee,o as se,a1 as ie,hJ as re,ae as gt,_ as oe}from"./main-BZaw9FpY.js";import{I as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{b as $,e as kt,c as ne,i as ae,P as ce,x as zt,d as Dt,Y as ue,W as le,X as he,U as pe,u as C,f as St,R as Pt,g as vt,E as T,h as de,j as fe}from"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import{O as xe,D as At,d as Yt}from"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import{t as tt,K as rt,n as R,d as me,$ as ye,_ as _e,r as ge,c as ke}from"./definitions-DJSdSb77-DkoRHaVx.js";import{D as Se,M as Pe,k as ve}from"./TurboLine-CIlsAy5m-BrOlSIM-.js";import{t as Nt,e as be,Z as we,V as Te}from"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import{I as Bt}from"./utils-SPbpQbmm-DpAlEmQT.js";import{S as G,r as Lt,i as nt,R as at,t as ct}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import{c as Ee}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{l as Me,G as Ie,i as ze,e as De}from"./Tile-D75RMC64-DprBAZDK.js";import{L as Q}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as J}from"./constants-Bqe1QJ4u-F8oTIn7N.js";const Ae=()=>ie.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),Ye=0,Ne=100;function Z(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||Ye,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||Ne]}function W(t){return 1<import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>t.g)}function Rt(t){switch(t){case h.BYTE:case h.UNSIGNED_BYTE:return 1;case h.SHORT:case h.UNSIGNED_SHORT:case h.HALF_FLOAT:return 2;case h.FLOAT:case h.INT:case h.UNSIGNED_INT:return 4}}function Oe(t){const e=[],s=[],i=[];for(const r of t){const o=Rt(r.type)*r.count;switch(o%2||o%4||4){case 4:e.push(r);continue;case 2:s.push(r);continue;case 1:i.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...s),e.push(...i),e}let Ce=class Ft{static fromVertexSpec(e,s){const{attributes:i,optionalAttributes:r}=e;let o,n,a;const c=[];for(const y in i){const _=i[y];_.pack==="position"?o={..._,name:y,offset:0}:_.pack==="id"?n={..._,name:y,offset:4}:y==="bitset"?a={..._,name:y,offset:7}:c.push({..._,name:y})}for(const y in r)if(s[y]===!0){const _=r[y];c.push({..._,name:y})}const l=Oe(c),u=[];let f=8,x=1;for(const y of l)u.push({...y,offset:f}),f+=Rt(y.type)*y.count,y.packAlternating&&(x=Math.max(y.packAlternating.count,x));const p=Uint32Array.BYTES_PER_ELEMENT,d=f%p;return new Ft(o,n,a,u,f+(d?p-d:0),x)}constructor(e,s,i,r,o,n){this.position=e,this.id=s,this.bitset=i,this.standardAttributes=r,this.stride=o,this.packVertexCount=n,r.push(i),this._attributes=[e,s,i,...r]}get attributeLayout(){if(!this._attributeLayout){const e=we(this._attributes),s=this._attributes.map(i=>({name:i.name,count:i.count,offset:i.offset,type:i.type,packPrecisionFactor:i.packPrecisionFactor,normalized:i.normalized??!1}));this._attributeLayout={attributes:s,hash:e,stride:this.stride}}return this._attributeLayout}},We=class Ot{static fromVertexSpec(e,s){const i=Ce.fromVertexSpec(e,s);return new Ot(i)}constructor(e){this._spec=e,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,s,i,r,o,n){for(let a=0;athis.vertexSpec.createComputedParams(r)}get _vertexPack(){if(!this._cachedVertexPack){const t=We.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){Ue(this._evaluator.inputMeshParams.effects?.effectInfos)&&await Fe()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(t,s,void 0,r);const n=s.readGeometryForDisplay()?.clone();if(!n)return;const a=T.fromOptimizedCIM(n,s.geometryType),c=mt();a.invertY();const l=t.id||"",u=Re.executeEffects(o,a,l,c);let f;for(;f=u.next();)f.invertY(),this._write(t,s,f,r)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(i,this._viewParams)}_writeVertex(t,e,s,i,r){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,i,o,r)}};function He(t,e,s,i,r,o,n){pt=0;const a=(i-s)*o,c=r&&r.length,l=c?(r[0]-s)*o:a;let u,f,x,p,d,y=Ct(e,s,i,0,l,o,!0);if(y&&y.next!==y.prev){if(c&&(y=qe(e,s,i,r,y,o)),a>80*o){u=x=e[0+s*o],f=p=e[1+s*o];for(let _=o;_0)for(let c=i;c=i;c-=o)a=bt(c+e*o,t[c+e*o],t[c+1+e*o],a);return a&&D(a,a.next)&&(X(a),a=a.next),a}function U(t,e=t){if(!t)return t;let s,i=t;do if(s=!1,i.steiner||!D(i,i.next)&&k(i.prev,i,i.next)!==0)i=i.next;else{if(X(i),i=e=i.prev,i===i.next)break;s=!0}while(s||i!==e);return e}function H(t,e,s,i,r,o,n,a){if(!t)return;!a&&o&&(t=Wt(t,i,r,o));let c=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ve(t,i,r,o):Xe(t))e.push(l.index/s+n),e.push(t.index/s+n),e.push(u.index/s+n),X(t),t=u.next,c=u.next;else if((t=u)===c){a?a===1?H(t=es(t,e,s,n),e,s,i,r,o,n,2):a===2&&ss(t,e,s,i,r,o,n):H(U(t),e,s,i,r,o,n,1);break}}}function Xe(t){const e=t.prev,s=t,i=t.next;if(k(e,s,i)>=0)return!1;let r=t.next.next;const o=r;let n=0;for(;r!==t.prev&&(n===0||r!==o);){if(n++,L(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&k(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ve(t,e,s,i){const r=t.prev,o=t,n=t.next;if(k(r,o,n)>=0)return!1;const a=r.xo.x?r.x>n.x?r.x:n.x:o.x>n.x?o.x:n.x,u=r.y>o.y?r.y>n.y?r.y:n.y:o.y>n.y?o.y:n.y,f=lt(a,c,e,s,i),x=lt(l,u,e,s,i);let p=t.prevZ,d=t.nextZ;for(;p&&p.z>=f&&d&&d.z<=x;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0||(p=p.prevZ,d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=x;){if(d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function bt(t,e,s,i){const r=F.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ze(t){let e=t,s=t;do(e.x=s.next.y&&s.next.y!==s.y){const x=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(x<=i&&x>n){if(n=x,x===i){if(r===s.y)return s;if(r===s.next.y)return s.next}o=s.x=s.x&&s.x>=c&&i!==s.x&&L(ro.x)&&V(s,t)&&(o=s,f=u)),s=s.next;return o}function Wt(t,e,s,i){let r;for(;r!==t;r=r.next){if(r=r||t,r.z===null&&(r.z=lt(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Wt(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,je(t)}function je(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let o=0;for(;r;){o++,i=r;let n=0;for(;n0||a>0&&i;){let c;n===0?(c=i,i=i.nextZ,a--):a!==0&&i?r.z<=i.z?(c=r,r=r.nextZ,n--):(c=i,i=i.nextZ,a--):(c=r,r=r.nextZ,n--),e?e.nextZ=c:t=c,c.prevZ=e,e=c}r=i}if(e.nextZ=null,s*=2,o<2)return t}}function k(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function Ut(t,e,s,i){return!!(D(t,e)&&D(s,i)||D(t,i)&&D(s,e))||k(t,e,s)>0!=k(t,e,i)>0&&k(s,i,t)>0!=k(s,i,e)>0}function Ke(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&Ut(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}function $e(t,e,s,i,r,o){let n=0;for(let a=i,c=r-o;a=0&&(t-n)*(i-a)-(s-n)*(e-a)>=0&&(s-n)*(o-a)-(r-n)*(i-a)>=0}function V(t,e){return k(t.prev,t,t.next)<0?k(t,e,t.next)>=0&&k(t,t.prev,e)>=0:k(t,e,t.prev)<0||k(t,t.next,e)<0}function lt(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e){return t.x-e.x}function es(t,e,s,i){let r=t;do{const o=r.prev,n=r.next.next;!D(o,n)&&Ut(o,r,r.next,n)&&V(o,n)&&V(n,o)&&(e.push(o.index/s+i),e.push(r.index/s+i),e.push(n.index/s+i),X(r),X(r.next),r=t=n),r=r.next}while(r!==t);return r}function ss(t,e,s,i,r,o,n){let a=t;do{let c=a.next.next;for(;c!==a.prev;){if(a.index!==c.index&&is(a,c)){let l=Ht(a,c);return a=U(a,a.next),l=U(l,l.next),H(a,e,s,i,r,o,n,0),void H(l,e,s,i,r,o,n,0)}c=c.next}a=a.next}while(a!==t)}function is(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!Ke(t,e)&&V(t,e)&&V(e,t)&&rs(t,e)}function rs(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do s.y>o!=s.next.y>o&&s.next.y!==s.y&&r<(s.next.x-s.x)*(o-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next;while(s!==t);return i}function Ht(t,e){const s=F.create(t.index,t.x,t.y),i=F.create(e.index,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,o.next=i,i.prev=o,i}class F{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(e,s,i){const r=pt0))break;u+=_,f.push(n+l),l+=y}const x=o.length;He(o,s,n,n+l,f,2,r);const p=as(o,s,x,o.length,r),d=Math.abs(u);if(Math.abs((p-d)/Math.max(1e-7,d))>ns)return o.length=0,!1;a=c,n+=l}return!0}function us(t){const{coords:e,lengths:s}=t,{buffer:i}=ve(e,s);return i}function ls(t,e,s){let i=0;for(let r=0;rs||cs)return!0}i+=o}return!1}function Xt(t,e){if(t==null)return null;if(!ls(t,-128,tt+128))return t;z.setPixelMargin(e),z.reset(Yt.Polygon);let s=0;for(let n=0;nr||ur){n=!0;continue}c.push({x:l,y:u})}let f=!1;for(;t.nextPoint();)if(l=t.x,u=t.y,n)s.lineTo(l,u);else{if(lr||ur){f=!0;break}c.push({x:l,y:u})}if(f)n=!0;else{if(n){const x=s.resultWithStarts();if(x)for(const p of x)o.push(p)}else o.push({line:c,start:0});a=t.nextPath(),n=!1}}return o=o.filter(c=>c.line.length>1),o.length===0?null:o}z.setExtent(tt),dt.setExtent(tt);const ps=100,ds=te("featurelayer-fast-triangulation-enabled");class Vt extends O{async loadDependencies(){await Promise.all([super.loadDependencies(),Pe()])}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);o&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,s,o),e.recordEnd())}_clip(e){if(!e)return null;const s=this.hasEffects;return Xt(e,s?256:8)}_writeGeometry(e,s,i){const r=i.maxLength>ps,o=[],n=this.createTesselationParams(s);if(!r&&ds&&cs(o,i))return void(o.length&&this._writeVertices(e,s,i.coords,n,o));const a=us(i);this._writeVertices(e,s,a,n)}_writeVertices(e,s,i,r,o){const n=s.getDisplayId(),a=e.vertexCount(),c=this.hasEffects;let l=0;if(o)for(const u of o){const f=i[2*u],x=i[2*u+1];c&&e.recordBounds(f,x,0,0),this._writeVertex(e,n,f,x,r),l++}else for(let u=0;ut,optionalAttributes:{},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:h.FLOAT,count:1,packTessellation:({inverseArea:t})=>t}}};let ri=class extends Vt{constructor(){super(...arguments),this.vertexSpec=fs}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}};const ft={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}};let Zt=class extends Vt{constructor(){super(...arguments),this.vertexSpec=ft}createTesselationParams(t){return null}};const A={createComputedParams:t=>t,optionalAttributes:ft.optionalAttributes,attributes:{...ft.attributes,tlbr:{count:4,type:h.UNSIGNED_SHORT,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},inverseRasterizationScale:{count:1,type:h.BYTE,packPrecisionFactor:16,pack:({sprite:t})=>1/t.rasterizationScale}}};let xs=class extends Zt{constructor(){super(...arguments),this.vertexSpec=A}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),t.recordEnd()}};function et(t){const{sprite:e,aspectRatio:s,scaleProportionally:i}=t,r=m(t.height),o=r>0?r:e.height;let n=r*s;return n<=0?n=e.width:i&&(n*=e.width/e.height),{width:n,height:o}}function qt(t){const{applyRandomOffset:e,sampleAlphaOnly:s}=t;return q([[ce,e],[zt,s]])}const Qt={createComputedParams:t=>t,optionalAttributes:A.optionalAttributes,attributes:{...A.attributes,bitset:{count:1,type:h.UNSIGNED_BYTE,pack:qt},width:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},height:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},offset:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),-m(e)]},scale:{count:2,type:h.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:t,scaleY:e})=>[t,e]},angle:{count:1,type:h.UNSIGNED_BYTE,pack:({angle:t})=>xe(t)}}};let oi=class extends xs{constructor(){super(...arguments),this.vertexSpec=Qt}},ms=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const Y={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:h.UNSIGNED_BYTE,count:1},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},offset:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[j(t,16),j(e,16)]},normal:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[j(t,16),j(e,16)]},halfWidth:{type:h.HALF_FLOAT,count:1,pack:({width:t})=>m(.5*t)},referenceHalfWidth:{type:h.HALF_FLOAT,count:1,pack:({referenceWidth:t})=>m(.5*t)}}};let ys=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const Tt=65535;let Jt=class extends O{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Y,this._currentWrite=new ys,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:Tt,textured:!1},this._tessParams=new ms,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);i!=null&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new Se(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const i=s??T.fromFeatureSetReaderCIM(e);i&&this._writeGeometry(t,e,i)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return hs(t,Nt(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:i,_tessellationOptions:r,evaluatedMeshParams:o}=this,{width:n,capType:a,joinType:c,miterLimit:l,hasSizeVV:u}=o,f=m(.5*n);r.halfWidth=f,r.capType=Be(a),r.joinType=Le(c),r.miterLimit=l;const x=!u;i.out=t,i.id=e.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=t.vertexCount(),i.vertexBounds=x&&ft,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}},yt={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)}}};let _t=class extends Jt{constructor(){super(...arguments),this.vertexSpec=yt}},Kt=class extends Zt{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=jt,this._lineMeshWriter=this._createOutlineWriter(t,e,s,i)}_createOutlineWriter(t,e,s,i){return new _t(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd())}_clip(t){return t?Xt(t,Nt(this.evaluatedMeshParams)):null}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const st=Qt,_s=yt,gs={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>qt(t)},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},aux3:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),m(e)]},aux4:{count:2,type:h.UNSIGNED_BYTE,pack:({scaleX:t,scaleY:e})=>[t*$,e*$]}}},ks={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,color:_s.attributes.color,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.width)},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.referenceWidth)},aux3:{count:2,type:h.HALF_FLOAT,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[t,e]},aux4:{count:2,type:h.UNSIGNED_BYTE,packTessellation:({normalX:t,normalY:e})=>[t*$+kt,e*$+kt]}}};class Ss extends _t{constructor(){super(...arguments),this.vertexSpec=ks}}let ni=class extends Kt{constructor(){super(...arguments),this.vertexSpec=gs}_createOutlineWriter(t,e,s,i){return new Ss(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const Ps={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...jt.attributes}},vs={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...yt.attributes}};class bs extends _t{constructor(){super(...arguments),this.vertexSpec=vs}}class ai extends Kt{constructor(){super(...arguments),this.vertexSpec=Ps}_createOutlineWriter(e,s,i,r){return new bs(e,s,i,r)}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);if(!o)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,s,o),this._lineMeshWriter.writeLineVertices(e,T.fromOptimizedCIM(o,"esriGeometryPolyline"),s),e.recordEnd()}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._lineMeshWriter.ensurePacked(e,s,i)}enqueueRequest(e,s,i){super.enqueueRequest(e,s,i),this._lineMeshWriter.enqueueRequest(e,s,i)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const ws={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},offset:{type:h.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};let ci=class extends O{constructor(){super(...arguments),this.vertexSpec=ws}_write(t,e){t.recordStart(this.instanceId,this.attributeLayout);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPoint"){const i=e.readXForDisplay(),r=e.readYForDisplay();this._writeQuad(t,s,i,r)}else e.geometryType==="esriGeometryMultipoint"&&e.readGeometryForDisplay()?.forEachVertex((i,r)=>{i>=0&&i<=512&&r>=0&&r<=512&&this._writeQuad(t,s,i,r)});t.recordEnd()}_writeQuad(t,e,s,i){const r=t.vertexCount();this._writeVertex(t,e,s,i),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}};class $t{static getPlacement(e,s,i,r,o,n){const a=fe(i);return a?(s===-1&&e.invertY(),a.execute(e,i,r,o,n)):null}}const Et=96;class Ts{constructor(e){const{offsetX:s,offsetY:i,postAngle:r,fontSize:o,haloSize:n,outlineSize:a,scaleFactor:c,transforms:l}=e;if(this.offsetX=s,this.offsetY=i,this.postAngle=r,this.fontSize=Math.min(o,Et),this.haloSize=n??0,this.outlineSize=a??0,this.transforms=l,l&&l.infos.length>1){const u=Bt(o,r,!1,s,i,l,!1);this.fontSize=Math.min(u.size,Et);const f=u.size/o;this.haloSize*=f,this.outlineSize*=f,this.postAngle=u.rotation,this.offsetX=u.offsetX,this.offsetY=u.offsetY}c&&(this.fontSize*=c,this.offsetX*=c,this.offsetY*=c)}}const Es=28,M=[4,4],K=[16,4],Ms={topLeft:K,topRight:K,bottomLeft:K,bottomRight:K},it=[4,2],v=[4,6],Mt={topLeft:it,topRight:it,bottomLeft:v,bottomRight:v},It={topLeft:it,topRight:v,bottomLeft:it,bottomRight:v},Is={topLeft:v,topRight:v,bottomLeft:M,bottomRight:M},zs={topLeft:M,topRight:M,bottomLeft:v,bottomRight:v},Ds={topLeft:v,topRight:M,bottomLeft:v,bottomRight:M},As={topLeft:M,topRight:v,bottomLeft:M,bottomRight:v},Ys={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:rt,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||Es]},clipAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>Ns(t||0)},referenceSymbol:{type:h.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,e)=>{const s=t.isLineLabel||!t.referenceBounds,i=ne(s?"center":e.horizontalAlignment),r=ae(s?"middle":e.verticalAlignment),{offsetX:o,offsetY:n,size:a}=s?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[m(o),-m(n),Math.round(m(a)),i+1<<2|r+1]}}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>q([[ue,t],[le,!!e]])},offset:{type:h.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>Math.round(m(t))},referenceSize:{type:h.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:e})=>Math.round(m(e??t))},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},haloColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>g(t)},outlineAndHaloSize:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:e})=>[Math.round(m(t)),Math.round(m(e))]}}};class ui extends O{constructor(){super(...arguments),this.vertexSpec=Ys,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new Ts(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,s,i){const r=this._getShaping();if(!r)return;const o=s.getDisplayId();if(this.evaluatedMeshParams.placement!=null)return this._writePlacedTextMarkers(e,s,r,i);if(i?.nextPath())return i.nextPoint(),this._writeGlyphs(e,o,i.x,i.y,r,0);if(s.geometryType==="esriGeometryPolygon"){const c=s.readCentroidForDisplay();if(!c)return;const[l,u]=c.coords;return this._writeGlyphs(e,o,l,u,r,0)}if(s.geometryType==="esriGeometryMultipoint")return void s.readGeometryForDisplay()?.forEachVertex((c,l)=>this._writeGlyphs(e,o,c,l,r,0));const n=s.readXForDisplay(),a=s.readYForDisplay();return this._writeGlyphs(e,o,n,a,r,0)}_writePlacedTextMarkers(e,s,i,r){const o=r??T.fromFeatureSetReaderCIM(s);if(!o)return;const n=-1,a=$t.getPlacement(o,n,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!a)return;const c=s.getDisplayId();let l=a.next();for(;l!=null;){const u=l.tx,f=-l.ty,x=-l.getAngle();this._writeGlyphs(e,c,u,f,i,x),l=a.next()}}_getShaping(e){const s=this._textMeshTransformProps,i=this.evaluatedMeshParams;if(!i.glyphs?.glyphs.length)return null;const r=m(s.fontSize),o=m(s.offsetX),n=m(s.offsetY),a=gt(m(i.lineWidth),_e,ye),c=ge*gt(i.lineHeightRatio,.25,4);return de(i.glyphs,{scale:r/ke,angle:s.postAngle,xOffset:o,yOffset:n,horizontalAlignment:i.horizontalAlignment,verticalAlignment:e||i.verticalAlignment,maxLineWidth:a,lineHeight:c,decoration:i.decoration,borderLineSizePx:m(i.boxBorderLineSize),hasBackground:!!i.boxBackgroundColor,useCIMAngleBehavior:i.useCIMAngleBehavior})}_writeGlyphs(e,s,i,r,o,n,a,c){const l=this.evaluatedMeshParams,u=this._textMeshTransformProps,f=m(u.fontSize),x=u.haloSize,p=u.outlineSize,d=m(u.offsetX),y=m(u.offsetY),[_,P]=Z(l.scaleInfo,this.getTileInfo());n!==0&&o.setRotation(n);const S=o.bounds,I=i+S.x+d,w=r+S.y-y,N=2*(l.minPixelBuffer?l.minPixelBuffer/f:1),b=Math.max(S.width,S.height)*N;o.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),e.recordBounds(I,w,b,b),this._writeTextBox(e,s,i,r,o.textBox,a,c),e.recordEnd());for(const E of o.glyphs){e.recordStart(this.instanceId,this.attributeLayout,E.textureBinding),e.recordBounds(I,w,b,b);const{texcoords:ot,offsets:B}=E;this._writeQuad(e,s,i,r,{texcoords:ot,offsets:B,fontSize:f,haloSize:x,outlineSize:p,color:g(l.color),isBackground:!1,referenceBounds:a,minZoom:_,maxZoom:P,...c}),e.recordEnd()}n!==0&&o.setRotation(-n)}_writeTextBox(e,s,i,r,o,n,a){const c=this.evaluatedMeshParams,{fontSize:l,haloSize:u,outlineSize:f}=this._textMeshTransformProps,{boxBackgroundColor:x,boxBorderLineColor:p}=c,d={isBackground:!0,fontSize:l,haloSize:u,outlineSize:f,referenceBounds:n,...a};x&&(this._writeQuad(e,s,i,r,{texcoords:Ms,offsets:o.main,color:g(x),...d}),p||(this._writeQuad(e,s,i,r,{texcoords:Is,offsets:o.top,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:zs,offsets:o.bot,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:Ds,offsets:o.left,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:As,offsets:o.right,color:g(x),...d}))),p&&(this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.top,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.bot,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.left,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.right,color:g(p),...d}))}_writeQuad(e,s,i,r,o){const n=e.vertexCount();this._writeVertex(e,s,i,r,o),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Ns=t=>Math.round(t*(254/360)),Bs={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:s})=>q([[zt,t],[he,e],[pe,s]])},tlbr:{type:h.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},accumulatedDistance:{type:h.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:h.HALF_FLOAT,count:1,pack:({offsetAlongLine:t})=>m(t)},capType:{type:h.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case G.Butt:case"butt":return 0;case G.Square:case"square":return 1;case G.Round:case"round":return 2;default:return 0}}}}};class li extends Jt{constructor(e,s,i,r){super(e,s,i,r),this.vertexSpec=Bs,this._tessellationOptions.textured=!0}_write(e,s,i){const r=i??T.fromFeatureSetReaderCIM(s);if(!r)return;const{sprite:o}=this.evaluatedMeshParams;this._writeGeometry(e,s,r,o?.textureBinding)}}let Ls=class xt{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:i,width:r,height:o,angle:n,alignment:a,outlineSize:c,referenceSize:l,sprite:u,overrideOutlineColor:f}=e;return s.rawWidth=m(r),s.rawHeight=m(o),s.angle=n,s.alignment=a,s.outlineSize=m(c),s.referenceSize=m(l),s.overrideOutlineColor=f,s.offsetX=m(e.offsetX),s.offsetY=m(e.offsetY),i!=="simple"||u.sdf||(s.rawWidth=u.width,s.rawHeight=u.height),s._computeSize(e,!1),s}static fromComplexMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:i,transforms:r,size:o,scaleX:n,anchorX:a,anchorY:c,angle:l,colorLocked:u,frameHeight:f,widthRatio:x,offsetX:p,offsetY:d,outlineSize:y,referenceSize:_,scaleFactor:P,sizeRatio:S,isAbsoluteAnchorPoint:I,rotateClockwise:w,scaleSymbolsProportionally:N,sprite:b}=e;if(r&&r.infos.length>0){const B=Bt(o,l,w,p,d,r);o=B.size,l=B.rotation,p=B.offsetX,d=B.offsetY,w=!1}P&&(o*=P,p*=P,d*=P);const E=n*(b.width/b.height);s.alignment=i,s.rawHeight=m(o),s.rawWidth=s.rawHeight*E,s.referenceSize=m(_),s.sizeRatio=S,s.sdfDecodeCoeff=(b.sdfDecodeCoeff??1)*S,s.angle=l,s.rotateClockwise=w,s.anchorX=a,s.anchorY=c,s.offsetX=m(p),s.offsetY=m(d),I&&o&&(b.sdf?s.anchorX=a/(o*x):s.anchorX=a/(o*E),s.anchorY=c/o);const ot=N&&f?o/f:1;return s.outlineSize=y===0||isNaN(y)?0:m(y)*ot,s.scaleSymbolsProportionally=N,s.colorLocked=u,s._computeSize(e,!0),s}constructor(e,s,i,r,o,n,a){this.sprite=e,this.color=s,this.outlineColor=i,this.minPixelBuffer=r,this.placement=o,this.scaleInfo=n,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=Lt.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,s){const{sprite:i,hasSizeVV:r}=e,o=!!i.sdf,n=i.sdfPaddingRatio??.5,{rawWidth:a,rawHeight:c,sizeRatio:l,outlineSize:u}=this,f=l*(o?1/(1-n):1),x=a*f,p=c*f;if(o&&!r){const N=s&&a>c?x:a,b=c,E=u+2*1;this.computedWidth=Math.min(N+E,x),this.computedHeight=Math.min(b+E,p)}else this.computedWidth=x,this.computedHeight=p;const d=o?Math.max(i.width,i.height)/Math.max(x,p):1,y=.5*(x-this.computedWidth)*d,_=.5*(p-this.computedHeight)*d,P=i.rect.x+R+y,S=i.rect.y+R+_,I=P+i.width-2*y,w=S+i.height-2*_;this.texXmin=Math.floor(P),this.texYmin=Math.floor(S),this.texXmax=Math.ceil(I),this.texYmax=Math.ceil(w),this.computedWidth*=(this.texXmax-this.texXmin)/(I-P),this.computedHeight*=(this.texYmax-this.texYmin)/(w-S),this.anchorX*=x/this.computedWidth,this.anchorY*=p/this.computedHeight}};const Gs=3.14159265359/180,Rs=128/Math.PI;function Fs(t,e){return t%=e,Math.abs(t>=0?t:t+e)}function Os(t){return Fs(t*Rs,256)}function Cs(t,e,s,i,r=!1){const o=Me(),n=r?1:-1;return Ie(o),(e||s)&&ze(o,o,[e,-s]),i&&De(o,o,n*Gs*-i),o}const Ws={createComputedParams:t=>Ls.from(t),optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({sprite:t,alignment:e,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let o=0;return t.sdf&&(o|=W(C.bitset.isSDF)),e===Lt.MAP&&(o|=W(C.bitset.isMapAligned)),s&&(o|=W(C.bitset.scaleSymbolsProportionally)),i&&(o|=W(C.bitset.overrideOutlineColor)),r&&(o|=W(C.bitset.colorLocked)),o}},offset:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:t,computedWidth:e,computedHeight:s,anchorX:i,anchorY:r,offsetX:o,offsetY:n,rotateClockwise:a})=>{const c=Cs(0,o,n,-t,a),l=-(.5+i)*e,u=-(.5-r)*s,f=[l,u],x=[l+e,u],p=[l,u+s],d=[l+e,u+s];return Q(f,f,c),Q(x,x,c),Q(p,p,c),Q(d,d,c),[f,x,p,d]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:t,texXmin:e,texYmax:s,texYmin:i})=>[[e,i],[t,i],[e,s],[t,s]]}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},sizing:{type:h.UNSIGNED_BYTE,count:4,pack:({rawWidth:t,rawHeight:e,outlineSize:s,referenceSize:i})=>{const r=Math.max(t,e);return[ut(r,128),ut(s,128),ut(i,128),0]}},placementAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:t})=>Os(t)},sdfDecodeCoeff:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:t})=>t}}};class hi extends O{constructor(){super(...arguments),this.vertexSpec=Ws}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,s,i){const r=this.evaluatedMeshParams.sprite?.textureBinding,o=s.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,r);const n=this.evaluatedMeshParams.minPixelBuffer,a=Math.max(this.evaluatedMeshParams.computedWidth,n),c=Math.max(this.evaluatedMeshParams.computedHeight,n),l=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,u=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,f=this.evaluatedMeshParams.offsetX+l,x=-this.evaluatedMeshParams.offsetY+u;if(this.evaluatedMeshParams.placement!=null)this._writePlacedMarkers(e,s,i,a,c);else if(i?.nextPath()){i.nextPoint();const p=i.x,d=i.y;e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else if(s.geometryType==="esriGeometryPolygon"){const p=s.readCentroidForDisplay();if(!p)return;const[d,y]=p.coords;e.recordBounds(d+f,y+x,a,c),this._writeQuad(e,o,d,y)}else if(s.geometryType==="esriGeometryPoint"){const p=s.readXForDisplay(),d=s.readYForDisplay();e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else s.readGeometryForDisplay()?.forEachVertex((p,d)=>{e.recordBounds(p+f,d+x,a,c),Math.abs(p)>J||Math.abs(d)>J||this._writeQuad(e,o,p,d)});e.recordEnd()}_writePlacedMarkers(e,s,i,r,o){const n=i??T.fromFeatureSetReaderCIM(s)?.clone();if(!n)return;const a=-1,c=$t.getPlacement(n,a,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!c)return;const l=s.getDisplayId();let u=c.next();const f=this.evaluatedMeshParams.offsetX,x=-this.evaluatedMeshParams.offsetY;for(;u!=null;){const p=u.tx,d=-u.ty;if(Math.abs(p)>J||Math.abs(d)>J){u=c.next();continue}const y=-u.getAngle();e.recordBounds(p+f,d+x,r,o),this._writeQuad(e,l,p,d,y),u=c.next()}}_writeQuad(e,s,i,r,o){const n=e.vertexCount(),a=o==null?null:{placementAngle:o};this._writeVertex(e,s,i,r,a),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Us={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},offset:{type:h.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const e=m(t),s=-e/2,i=-e/2;return[[s,i],[s+e,i],[s,i+e],[s+e,i+e]]}}},texCoords:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:h.UNSIGNED_BYTE,count:2,pack:({size:t})=>[t,t]},referenceSize:{type:h.UNSIGNED_BYTE,count:1,pack:({size:t})=>m(t)},zoomRange:{type:h.UNSIGNED_BYTE,count:2,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}}};class pi extends O{constructor(){super(...arguments),this.vertexSpec=Us}_write(e,s){const i=s.getDisplayId(),r=this.evaluatedMeshParams.minPixelBuffer,o=Math.max(m(this.evaluatedMeshParams.size),r);let n,a;if(s.geometryType==="esriGeometryPoint")n=s.readXForDisplay(),a=s.readYForDisplay();else{const l=s.readCentroidForDisplay();if(!l)return;n=l?.coords[0],a=l?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(n,a,o,o);const c=e.vertexCount();this._writeVertex(e,i,n,a),e.indexWrite(c+0),e.indexWrite(c+1),e.indexWrite(c+2),e.indexWrite(c+1),e.indexWrite(c+3),e.indexWrite(c+2),e.recordEnd()}}export{pi as $,W as C,ui as F,ci as I,Es as J,ai as M,li as O,hi as Q,Z as R,xs as X,Re as Y,oi as a,ni as b,Zt as c,O as d,g,Kt as k,ri as m,Jt as y}; diff --git a/main/assets/PointCloudLayer-CkxImr5P--Ckfo6GN.js b/main/assets/PointCloudLayer-CkxImr5P--Ckfo6GN.js deleted file mode 100644 index 3b5704f83..000000000 --- a/main/assets/PointCloudLayer-CkxImr5P--Ckfo6GN.js +++ /dev/null @@ -1,11 +0,0 @@ -import{v as r,S as i,i as y,bB as C,bz as h,P as u,el as B,W as _,iC as x,o as l,bX as L,f as N,a1 as F,bL as E,a0 as V,ac as O,e as A}from"./main-BZaw9FpY.js";import{m as D}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as K}from"./Layer-ChoECxvZ-C4wLrCej.js";import{n as k}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as G}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{i as M}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as U}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as z}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{W as X,f as P}from"./SceneService-BZqGtWmG-B8Xgkv2e.js";import{X as H,$ as J,_ as Q}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{y as g}from"./Field-C6hA1tZj-CbELM0zp.js";import{f as Y}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{r as q,F as Z,U as ee,G as te}from"./PointCloudUniqueValueRenderer-C-5hwEaR-DdDCmiVd.js";import{k as T,R as re,j as ie}from"./elevationInfoUtils-mOZsPH2J-CGmjotSk.js";import{w as oe}from"./popupUtils-B0uZcXX0-BqljON9c.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./jsonContext-BA8GHqVk-BMETb6sX.js";import"./resourceUtils-BmW6QqlX-Cs99W_og.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-C_sFWCPe.js";import"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";let c=class extends A{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],c.prototype,"type",void 0),c=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],c);const v=c;var w;let p=w=class extends v{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],p.prototype,"requiredClearBits",void 0),r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],p.prototype,"requiredSetBits",void 0),r([h({pointCloudBitfieldFilter:"bitfield"})],p.prototype,"type",void 0),p=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],p);const se=p;var b;let f=b=class extends v{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new b({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"includedReturns",void 0),r([h({pointCloudReturnFilter:"return"})],f.prototype,"type",void 0),f=b=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],f);const ne=f;var I;let d=I=class extends v{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new I({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"mode",void 0),r([h({pointCloudValueFilter:"value"})],d.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"values",void 0),d=I=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],d);const ae=d,le={key:"type",base:v,typeMap:{value:ae,bitfield:se,return:ne}};var S;let m=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([h({pointCloudRGBRenderer:"point-cloud-rgb"})],m.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],m.prototype,"field",void 0),m=S=r([y("esri.renderers.PointCloudRGBRenderer")],m);const pe=m,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":Z,"point-cloud-rgb":pe,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},j=Y();let o=class extends X(G(U(z(W(D(M(k(K)))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t?.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new g;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new g({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){B("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(_).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=oe(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` - var returnValue = $feature.${t.name}; - return (returnValue % 16) + " / " + Floor(returnValue / 16); - `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const t=this.fieldsIndex.get("RGB");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` - var rgb = $feature.${t.name}; - var red = Floor(rgb / 65536, 0); - var green = Floor((rgb - (red * 65536)) / 256,0); - var blue = rgb - (red * 65536) - (green * 256); - - return "rgb(" + red + "," + green + "," + blue + ")"; - `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,t){if(await this.load(t),!this.attributeStorageInfo)throw new l("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const n=this.fieldsIndex.get(e);if(!n)throw new l("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const s of this.attributeStorageInfo)if(s.name===n.name){const a=L(this.parsedUrl?.path??"",`./statistics/${s.key}`);return N(a,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then($=>$.data)}throw new l("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(P.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(P.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="PointCloud")throw new l("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new l("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new l("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return this.attributeStorageInfo!=null&&this.attributeStorageInfo.some(t=>t.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(){const e=this.elevationInfo;T(F.getLogger(this),re("Point cloud layers","absolute-height",e)),T(F.getLogger(this),ie("Point cloud layers",e))}};r([i({type:["PointCloudLayer"]})],o.prototype,"operationalLayerType",void 0),r([i(H)],o.prototype,"popupEnabled",void 0),r([i({type:E,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),r([i({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],o.prototype,"opacity",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({types:[le],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],o.prototype,"filters",void 0),r([i({type:[g]})],o.prototype,"fields",void 0),r([i(j.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([V("service","fields",["fields","attributeStorageInfo"])],o.prototype,"readServiceFields",null),r([i(j.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),r([i(J)],o.prototype,"elevationInfo",null),r([i({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),r([i(Q)],o.prototype,"legendEnabled",void 0),r([i({types:R,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:R},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],o.prototype,"renderer",void 0),r([O("renderer")],o.prototype,"writeRenderer",null),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),o=r([y("esri.layers.PointCloudLayer")],o);const ze=o;export{ze as default}; diff --git a/main/assets/PointCloudLayer-CkxImr5P-Cr0Wmw1H.js b/main/assets/PointCloudLayer-CkxImr5P-Cr0Wmw1H.js new file mode 100644 index 000000000..fef1a4e58 --- /dev/null +++ b/main/assets/PointCloudLayer-CkxImr5P-Cr0Wmw1H.js @@ -0,0 +1,11 @@ +import{v as r,S as i,i as y,bB as C,bz as h,P as u,el as B,W as _,iC as x,o as l,bX as L,f as N,a1 as F,bL as E,a0 as V,ac as O,e as A}from"./main-C7yV2j71.js";import{m as D}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as K}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{n as k}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as G}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{i as M}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as U}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as z}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{W as X,f as P}from"./SceneService-BZqGtWmG-B9O0VJ5b.js";import{X as H,$ as J,_ as Q}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{y as g}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{f as Y}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{r as q,F as Z,U as ee,G as te}from"./PointCloudUniqueValueRenderer-C-5hwEaR-CdfgO-6L.js";import{k as T,R as re,j as ie}from"./elevationInfoUtils-mOZsPH2J-Bwot-813.js";import{w as oe}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./jsonContext-BA8GHqVk-DpBf0bCt.js";import"./resourceUtils-BmW6QqlX-CP-OW4gT.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-Bu5Czfos.js";import"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";let c=class extends A{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],c.prototype,"type",void 0),c=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],c);const v=c;var w;let p=w=class extends v{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],p.prototype,"requiredClearBits",void 0),r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],p.prototype,"requiredSetBits",void 0),r([h({pointCloudBitfieldFilter:"bitfield"})],p.prototype,"type",void 0),p=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],p);const se=p;var b;let f=b=class extends v{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new b({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"includedReturns",void 0),r([h({pointCloudReturnFilter:"return"})],f.prototype,"type",void 0),f=b=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],f);const ne=f;var I;let d=I=class extends v{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new I({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"mode",void 0),r([h({pointCloudValueFilter:"value"})],d.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"values",void 0),d=I=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],d);const ae=d,le={key:"type",base:v,typeMap:{value:ae,bitfield:se,return:ne}};var S;let m=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([h({pointCloudRGBRenderer:"point-cloud-rgb"})],m.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],m.prototype,"field",void 0),m=S=r([y("esri.renderers.PointCloudRGBRenderer")],m);const pe=m,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":Z,"point-cloud-rgb":pe,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},j=Y();let o=class extends X(G(U(z(W(D(M(k(K)))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t?.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new g;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new g({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){B("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(_).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=oe(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` + var returnValue = $feature.${t.name}; + return (returnValue % 16) + " / " + Floor(returnValue / 16); + `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const t=this.fieldsIndex.get("RGB");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` + var rgb = $feature.${t.name}; + var red = Floor(rgb / 65536, 0); + var green = Floor((rgb - (red * 65536)) / 256,0); + var blue = rgb - (red * 65536) - (green * 256); + + return "rgb(" + red + "," + green + "," + blue + ")"; + `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,t){if(await this.load(t),!this.attributeStorageInfo)throw new l("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const n=this.fieldsIndex.get(e);if(!n)throw new l("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const s of this.attributeStorageInfo)if(s.name===n.name){const a=L(this.parsedUrl?.path??"",`./statistics/${s.key}`);return N(a,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then($=>$.data)}throw new l("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(P.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(P.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="PointCloud")throw new l("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new l("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new l("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return this.attributeStorageInfo!=null&&this.attributeStorageInfo.some(t=>t.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(){const e=this.elevationInfo;T(F.getLogger(this),re("Point cloud layers","absolute-height",e)),T(F.getLogger(this),ie("Point cloud layers",e))}};r([i({type:["PointCloudLayer"]})],o.prototype,"operationalLayerType",void 0),r([i(H)],o.prototype,"popupEnabled",void 0),r([i({type:E,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),r([i({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],o.prototype,"opacity",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({types:[le],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],o.prototype,"filters",void 0),r([i({type:[g]})],o.prototype,"fields",void 0),r([i(j.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([V("service","fields",["fields","attributeStorageInfo"])],o.prototype,"readServiceFields",null),r([i(j.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),r([i(J)],o.prototype,"elevationInfo",null),r([i({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),r([i(Q)],o.prototype,"legendEnabled",void 0),r([i({types:R,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:R},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],o.prototype,"renderer",void 0),r([O("renderer")],o.prototype,"writeRenderer",null),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),o=r([y("esri.layers.PointCloudLayer")],o);const ze=o;export{ze as default}; diff --git a/main/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CdfgO-6L.js b/main/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CdfgO-6L.js new file mode 100644 index 000000000..b8b0f0ba3 --- /dev/null +++ b/main/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CdfgO-6L.js @@ -0,0 +1 @@ +import{v as e,S as t,i,aK as I,bz as f,d2 as B,ar as N,bB as O,e as m,P as o}from"./main-C7yV2j71.js";import{w as P,h as K}from"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";var T;let c=T=class extends m{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new T({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=T=e([i("esri.renderers.support.pointCloud.ColorModulation")],c);const D=c,v=new I({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends m{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([i("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([f({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([i("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const k=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([f({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([i("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":k,splat:q}},w=B()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends m{constructor(s){super(s),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:w.apiValues,readOnly:!0,nonNullable:!0,json:{type:w.jsonValues,read:!1,write:w.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:D,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([i("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new I({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const r=l;var j;let n=j=class extends m{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:N,json:{type:[O],write:!0}})],n.prototype,"color",void 0),n=j=e([i("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends r{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([f({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([i("esri.renderers.PointCloudClassBreaksRenderer")],p);const $=p;var C;let a=C=class extends r{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([f({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[K],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([i("esri.renderers.PointCloudStretchRenderer")],a);const G=a;var x;let u=x=class extends m{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new x({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:N,json:{type:[O],write:!0}})],u.prototype,"color",void 0),u=x=e([i("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var z;let d=z=class extends r{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new z({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([f({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=z=e([i("esri.renderers.PointCloudUniqueValueRenderer")],d);const E=d;export{$ as F,E as G,G as U,r}; diff --git a/main/assets/PointCloudUniqueValueRenderer-C-5hwEaR-DdDCmiVd.js b/main/assets/PointCloudUniqueValueRenderer-C-5hwEaR-DdDCmiVd.js deleted file mode 100644 index 84c94d7cb..000000000 --- a/main/assets/PointCloudUniqueValueRenderer-C-5hwEaR-DdDCmiVd.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as t,i,aK as I,bz as f,d2 as B,ar as N,bB as O,e as m,P as o}from"./main-BZaw9FpY.js";import{w as P,h as K}from"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";var T;let c=T=class extends m{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new T({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=T=e([i("esri.renderers.support.pointCloud.ColorModulation")],c);const D=c,v=new I({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends m{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([i("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([f({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([i("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const k=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([f({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([i("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":k,splat:q}},w=B()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends m{constructor(s){super(s),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:w.apiValues,readOnly:!0,nonNullable:!0,json:{type:w.jsonValues,read:!1,write:w.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:D,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([i("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new I({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const r=l;var j;let n=j=class extends m{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:N,json:{type:[O],write:!0}})],n.prototype,"color",void 0),n=j=e([i("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends r{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([f({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([i("esri.renderers.PointCloudClassBreaksRenderer")],p);const $=p;var C;let a=C=class extends r{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([f({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[K],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([i("esri.renderers.PointCloudStretchRenderer")],a);const G=a;var x;let u=x=class extends m{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new x({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:N,json:{type:[O],write:!0}})],u.prototype,"color",void 0),u=x=e([i("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var z;let d=z=class extends r{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new z({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([f({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=z=e([i("esri.renderers.PointCloudUniqueValueRenderer")],d);const E=d;export{$ as F,E as G,G as U,r}; diff --git a/main/assets/PointCloudWorker-DB5ewy0Y-BwaPG-Ro.js b/main/assets/PointCloudWorker-DB5ewy0Y-BwaPG-Ro.js deleted file mode 100644 index cc415398f..000000000 --- a/main/assets/PointCloudWorker-DB5ewy0Y-BwaPG-Ro.js +++ /dev/null @@ -1 +0,0 @@ -import{hY as F,aq as C,J as I}from"./main-BZaw9FpY.js";import{v as x}from"./quat-BODLR7mS-Bk09s2KF.js";import{e as O}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{w as k}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{u as A,o as w}from"./vec3f32-BS0cezmI-B_madU1n.js";import{n as R}from"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import{G as U,U as J,F as B}from"./PointCloudUniqueValueRenderer-C-5hwEaR-DdDCmiVd.js";import{$ as N,F as V,Y as q,G as T}from"./I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js";import{i as Y}from"./orientedBoundingBox-oHezdpWm-CdJ2bdTT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./plane-Dt8R0KeE-fuXvBrPY.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function E(u,t,a,n){const{rendererJSON:c,isRGBRenderer:m}=u;let o=null,s=null;if(t&&m)o=t;else if(t&&c?.type==="pointCloudUniqueValueRenderer"){s=U.fromJSON(c);const r=s.colorUniqueValueInfos;o=new Uint8Array(3*n);const i=g(s.fieldTransformType);for(let e=0;e=r[f].value)o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;else for(let b=1;b=r[f].minValue&&l<=r[f].maxValue){o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;break}}}else o=new Uint8Array(3*n).fill(255);if(a&&s?.colorModulation){const r=s.colorModulation.minValue,i=s.colorModulation.maxValue,e=.3;for(let l=0;l=i?1:f<=r?e:e+(1-e)*(f-r)/(i-r);o[3*l]=b*o[3*l],o[3*l+1]=b*o[3*l+1],o[3*l+2]=b*o[3*l+2]}}return o}function G(u,t){if(u.encoding==null||u.encoding===""){const a=N(t,u);if(a.vertexAttributes.position==null)return;const n=V(t,a.vertexAttributes.position),c=a.header.fields,m=[c.offsetX,c.offsetY,c.offsetZ],o=[c.scaleX,c.scaleY,c.scaleZ],s=n.length/3,r=new Float64Array(3*s);for(let i=0;i>>4&15,p=b>1,S=f===1,y=f===b;let v=!1;for(const d of e.includedReturns)if(d==="last"&&y||d==="firstOfMany"&&S&&p||d==="lastOfMany"&&y&&p||d==="single"&&!p){v=!0;break}v||(r=!1);break}}}r&&(a[o]=s,u[3*o]=u[3*s],u[3*o+1]=u[3*s+1],u[3*o+2]=u[3*s+2],t[3*o]=t[3*s],t[3*o+1]=t[3*s+1],t[3*o+2]=t[3*s+2],o++)}return o}function g(u){switch(u){default:case null:case"none":return t=>t;case"low-four-bit":return t=>15&t;case"high-four-bit":return t=>(240&t)>>4;case"absolute-value":return t=>Math.abs(t);case"modulo-ten":return t=>t%10}}function M(u){let t=0;for(const a of u||[])t|=1<0&&t.filterAttributesData!=null){const e=t.filterAttributesData.filter(C).map(l=>{const f=h(l,a,n),b={attributeInfo:l.attributeInfo,values:f};return m.push(b),b});c=new Uint32Array(n),n=j(a,r,c,t.filterInfo,e)}for(const e of t.userAttributesData){const l=h(e,a,n);m.push({attributeInfo:e.attributeInfo,values:l})}3*n=r[f].value)o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;else for(let b=1;b=r[f].minValue&&l<=r[f].maxValue){o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;break}}}else o=new Uint8Array(3*n).fill(255);if(a&&s?.colorModulation){const r=s.colorModulation.minValue,i=s.colorModulation.maxValue,e=.3;for(let l=0;l=i?1:f<=r?e:e+(1-e)*(f-r)/(i-r);o[3*l]=b*o[3*l],o[3*l+1]=b*o[3*l+1],o[3*l+2]=b*o[3*l+2]}}return o}function G(u,t){if(u.encoding==null||u.encoding===""){const a=N(t,u);if(a.vertexAttributes.position==null)return;const n=V(t,a.vertexAttributes.position),c=a.header.fields,m=[c.offsetX,c.offsetY,c.offsetZ],o=[c.scaleX,c.scaleY,c.scaleZ],s=n.length/3,r=new Float64Array(3*s);for(let i=0;i>>4&15,p=b>1,S=f===1,y=f===b;let v=!1;for(const d of e.includedReturns)if(d==="last"&&y||d==="firstOfMany"&&S&&p||d==="lastOfMany"&&y&&p||d==="single"&&!p){v=!0;break}v||(r=!1);break}}}r&&(a[o]=s,u[3*o]=u[3*s],u[3*o+1]=u[3*s+1],u[3*o+2]=u[3*s+2],t[3*o]=t[3*s],t[3*o+1]=t[3*s+1],t[3*o+2]=t[3*s+2],o++)}return o}function g(u){switch(u){default:case null:case"none":return t=>t;case"low-four-bit":return t=>15&t;case"high-four-bit":return t=>(240&t)>>4;case"absolute-value":return t=>Math.abs(t);case"modulo-ten":return t=>t%10}}function M(u){let t=0;for(const a of u||[])t|=1<0&&t.filterAttributesData!=null){const e=t.filterAttributesData.filter(C).map(l=>{const f=h(l,a,n),b={attributeInfo:l.attributeInfo,values:f};return m.push(b),b});c=new Uint32Array(n),n=j(a,r,c,t.filterInfo,e)}for(const e of t.userAttributesData){const l=h(e,a,n);m.push({attributeInfo:e.attributeInfo,values:l})}3*ni.map(i=>d[i]); +import{v as c,S as m,i as F,ad as As,aK as Q,bz as K,af as $s,g as Hs,a0 as It,ac as Lt,e as Le,P as H,i2 as Vt,o as Wt,w as ue,_ as qs,n as le,p as Ye}from"./main-C7yV2j71.js";import{l as Qe}from"./colorUtils-Cthpxcks-CXgjba3p.js";import{D as A,n as kt,g as W,e as Ts,c as oe,l as Ks,d as We,u as Ps,K as ie,i as Fs,p as Xs,s as st,j as Js,m as Ys,q as Qs,t as Zs,Y as tn,Q as Ns,L as en}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{W as sn,G as Rt,X as nn,e as rn,i as ce,f as Cs,g as Rs,h as on,k as Yt,Q as an,$ as ee,x as Is,T as ks,l as un,I as ln,Z as cn,P as ae,m as pn,o as hn,p as mn,r as _s}from"./RasterSymbolizer-BVys6HkM-BxgX8zwh.js";import{o as fn,F as dn}from"./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js";import{g as gn,v as Ss}from"./colorRamps-q0bZVhs2-DeDskCk_.js";import{y as nt}from"./Field-C6hA1tZj-C0Sp7XvY.js";let Qt=class extends Le{constructor(){super(...arguments),this.raster=void 0}};c([m({json:{write:!0}})],Qt.prototype,"raster",void 0),Qt=c([F("esri.layers.support.rasterFunctions.BaseFunctionArguments")],Qt);const D=Qt;var pe;let _t=pe=class extends D{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new pe({raster:this.raster,raster2:this.raster2,operation:this.operation})}};c([m({json:{write:!0}})],_t.prototype,"operation",void 0),c([m({json:{write:!0}})],_t.prototype,"raster2",void 0),c([m({readOnly:!0})],_t.prototype,"rasters",null),_t=pe=c([F("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],_t);const yn=_t,xn=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let E=class extends Le{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const o=[];for(let u=0;u=0;o--)e[o].isNoopProcess&&e.splice(o,1);let r=!1;for(let o=0;o1}const i=e.some(({name:o})=>xn.has(o.toLowerCase())),{rawSourceRasterInfos:a}=this;return{functions:e,hasBranches:r,hasFocalFunction:i,isSourceSingleBand:a?.[0]?.bandCount===1}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let i=0;ithis._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(a=>a.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((a,o)=>a!==o);const i=t.filter(a=>a.functionName==="ExtractBand");return i.length&&i.forEach((a,o)=>{a.isInputBandIdsSwizzled=!0,a.swizzledBandSelection=[o,o,o]}),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let i=0;ir!==i),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map(s=>this._isRasterFunctionValue(s)?s.getWebGLProcessorDefinition():typeof s=="number"?{name:"Constant",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(s=>s!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];this.functionName==="Clip"&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach(s=>{if(this._isRasterFunctionValue(s)){const r=s.getClippingGeometries();t.push(...r)}});else if(this._isRasterFunctionValue(e)){const s=e.getClippingGeometries();t.push(...s)}return t}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(e=>{e.statistics=void 0,e.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(e.length===0)return n;const r=e.map(a=>a&&typeof a=="object"&&"bind"in a&&a.rasterInfo?a.rasterInfo:typeof a=="string"&&s.includes(a)?n[s.indexOf(a)]:typeof a!="number"?n[0]:void 0),i=r.find(a=>a)??n[0];return r.forEach((a,o)=>{a===void 0&&(r[o]=i)}),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;se?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:typeof n.BAND_COUNT=="string"?String(e):e})}};c([m({json:{write:!0}})],E.prototype,"functionName",void 0),c([m({json:{write:!0}})],E.prototype,"functionArguments",void 0),c([m()],E.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}}),As(t=>t?.toLowerCase())],E.prototype,"outputPixelType",void 0),c([m({json:{write:!0}})],E.prototype,"mainPrimaryRasterId",void 0),c([m()],E.prototype,"sourceRasters",void 0),c([m({type:[sn],json:{write:!0}})],E.prototype,"sourceRasterInfos",void 0),c([m({json:{write:!0}})],E.prototype,"rasterInfo",void 0),c([m({json:{write:!0}})],E.prototype,"readingBufferSize",void 0),c([m({json:{write:!0}})],E.prototype,"id",void 0),c([m()],E.prototype,"isNoopProcess",void 0),c([m()],E.prototype,"supportsGPU",null),c([m()],E.prototype,"rawInputBandIds",void 0),c([m()],E.prototype,"rawSourceRasterInfos",void 0),c([m()],E.prototype,"isInputBandIdsSwizzled",void 0),c([m()],E.prototype,"swizzledBandSelection",void 0),c([m()],E.prototype,"isBranch",void 0),c([m({readOnly:!0})],E.prototype,"flatWebGLFunctionChain",null),c([m()],E.prototype,"_bindingResult",void 0),E=c([F("esri.layers.support.rasterFunctions.BaseRasterFunction")],E);const z=E,S={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},wn={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},$={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},J={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},vn={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},Bs={setNull:50,conditional:78},Ze={...wn,...$,...J,...vn,...Bs},js=new Map([[J.acos,{domain:[0,Math.PI],isInteger:!1}],[J.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.cos,{domain:[-1,1],isInteger:!1}],[J.sin,{domain:[-1,1],isInteger:!1}],[$.booleanAnd,{domain:[0,1],isInteger:!0}],[$.booleanNot,{domain:[0,1],isInteger:!0}],[$.booleanOr,{domain:[0,1],isInteger:!0}],[$.booleanXOr,{domain:[0,1],isInteger:!0}],[$.equalTo,{domain:[0,1],isInteger:!0}],[$.notEqual,{domain:[0,1],isInteger:!0}],[$.greaterThan,{domain:[0,1],isInteger:!0}],[$.greaterThanEqual,{domain:[0,1],isInteger:!0}],[$.lessThan,{domain:[0,1],isInteger:!0}],[$.lessThanEqual,{domain:[0,1],isInteger:!0}],[$.isNull,{domain:[0,1],isInteger:!0}]]);function ts(t){return js.get(t)}const es=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function bn(t,e=!1){const n=t.map(o=>o.mask),s=n.filter(o=>o!=null),r=t[0].pixels[0].length;if(s.length===0||e&&s.length!==n.length)return new Uint8Array(r).fill(255);const i=s[0],a=new Uint8Array(i);if(s.length===1)return a;if(!e){for(let o=1;o=1?e[u]=0:a[u]=Math.atanh(l)}return a}const o=s===J.asin?Math.asin:Math.acos;for(let u=0;u1?e[u]=0:a[u]=o(l)}return a}function _n(t,e,n,s){const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;o>r[o]);return a}function On(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;or[o]?1:0);return a}function Yn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;o=r[o]?1:0);return a}function Qn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;oh&&(u=h)}a[o]=u}return a}function os(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;op&&(u=p)}a[o]=l-u}return a}function is(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;ol?(l=u,h.length=0,h.push(p)):u===l&&h.push(p);h.length>1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function ps(t,e,n){const s=t.length;if(s<=2)return Gs(t,e,n);const r=t[0].length,i=A.createEmptyBand(n,r),a=new Map;for(let o=0;o1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function hs(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i),o=new Set;for(let u=0;u=66&&e<=75);const{outputPixelType:r="f32"}=n,i=!G.has(e)||n.processAsMultiband,a=i?t[0].pixels.length:1,o=[];for(let l=0;lg.pixels):t.map(g=>g.pixels[l]);let p,f=!0;if(e===Bs.setNull){const g=rr(h,s,r);p=g.band,s=g.mask,f=!1}else R.has(e)?p=R.get(e)(h,s,"f64"):U.has(e)?p=e===J.asin||e===J.acos||e===J.atanh?kn(h,s,"f64",e):_n(h,s,"f64",U.get(e)):se.has(e)?p=Sn(h,s,"f64",se.get(e)):G.has(e)?p=G.get(e)(h,s,"f64"):(p=h[0],f=!1);if(f&&e!==$.isNull&&!js.has(e)){const g=A.createEmptyBand(r,p.length);s||(s=new Uint8Array(p.length).fill(255)),tn(p,s),Ns(p,s,r,g),p=g}o.push(p)}const u=t[0];return new A({width:u.width,height:u.height,pixelType:r,mask:e===$.isNull?null:s,pixels:o})}function ir(t,e,n){return zs(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}let St=class extends z{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?.[0]==null||e?.[1]==null?null:ir(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=kt(n);const i=W(n);return i&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:i}}};c([m({json:{write:!0,name:"rasterFunction"}})],St.prototype,"functionName",void 0),c([m({type:yn,json:{write:!0,name:"rasterFunctionArguments"}})],St.prototype,"functionArguments",void 0),c([m()],St.prototype,"rasterArgumentNames",void 0),St=c([F("esri.layers.support.rasterFunctions.ArithmeticFunction")],St);const ar=St;var he;let me=he=class extends D{clone(){return new he({raster:this.raster})}};me=he=c([F("esri.layers.support.rasterFunctions.AspectFunctionArguments")],me);const ur=me;let lt=class extends z{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return nn(e,{resolution:i})}};c([m({json:{write:!0,name:"rasterFunction"}})],lt.prototype,"functionName",void 0),c([m({type:ur,json:{write:!0,name:"rasterFunctionArguments"}})],lt.prototype,"functionArguments",void 0),c([m()],lt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],lt.prototype,"isGCS",void 0),lt=c([F("esri.layers.support.rasterFunctions.AspectFunction")],lt);const lr=lt,cr=new Set(["+","-","*","/","(",")"]);function pr(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const n=t.split(""),s=[],r=[];let i="";for(let a=0;a-1)n>0&&(r+=e+1);else{for(let a=0;a0&&(r+=e+1)}let i=0;for(let a=0;a0;){const{numIndex:a,opIndex:o}=fr(r);if(s=hr(t,r[o],i[a],i[a+1]),r.length===1)break;r=mr(r,o),i.splice(a,2,s)}return[s]}const gr=new Q({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function yr(t,e){if(!en(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map(f=>f-1),{pixels:i,mask:a}=t;let o;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":o=fs(a,i[r[0]],i[r[1]]);break;case"ndwi":o=fs(a,i[r[1]],i[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":o=wr(a,i[r[0]],i[r[1]]);break;case"ci-g":case"ci-re":o=vr(a,i[r[0]],i[r[1]]);break;case"savi":o=br(a,i[r[0]],i[r[1]],r[2]+1);break;case"tsavi":o=Ar(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":o=Tr(a,i[r[0]],i[r[1]]);break;case"gemi":o=Pr(a,i[r[0]],i[r[1]]);break;case"pvi":o=Fr(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1);break;case"gvitm":o=Nr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]],i[r[5]]]);break;case"sultan":o=Cr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]]]);break;case"vari":o=Rr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"mtvi2":o=Ir(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"rtvi-core":o=kr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"evi":o=_r(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"wndwi":o=Sr(a,[i[r[0]],i[r[1]],i[r[2]]],r[3]?r[3]+1:.5);break;case"bai":o=Br(a,i[r[0]],i[r[1]]);break;case"custom":o=dr(a,i,n);break;default:return t}const{outputPixelType:u="f32"}=e,l=u!=null&&W(u);let h;a?(h=new Uint8Array(t.width*t.height),h.set(a)):l&&(h=new Uint8Array(t.width*t.height).fill(255)),l&&(o=o.map(f=>{const g=A.createEmptyBand(u,f.length);return Ns(f,h,u,g),g}));const p=new A({width:t.width,height:t.height,pixelType:u,pixels:o,mask:h});return p.updateStatistics(),p}function xr(t,e,n,s){const{mask:r,pixels:i,width:a,height:o}=t,u=i[n],l=i[e],h=l.length,p=s?new Uint8Array(h):new Float32Array(h),f=s?100:1,g=s?100.5:0;for(let x=0;xparseFloat(i));return yr(e,{method:n,bandIndexes:r,equation:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:i}=this.functionArguments;switch(i){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=V([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=V([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=V([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=V([e[0],e[1],0]),s="ci";break;case"savi":n=V([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=V([e[0],e[1],0]),s="msavi";break;case"gemi":n=V([e[0],e[1],0]),s="gemi";break;case"pvi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=V([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=V([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=V([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=V([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=V([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=V([e[1],e[0],0]),s="bai";break;default:n=V([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:W(this.outputPixelType)}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),n=t.length,s=e.map(a=>a>=n?n-1:a),r=Mr.has(this.functionArguments.method)?3:2,i=s.slice(0,r).map(a=>t[a]);return i.length===2&&i.push(0),i}};c([m({json:{write:!0,name:"rasterFunction"}})],Bt.prototype,"functionName",void 0),c([m({type:jr,json:{write:!0,name:"rasterFunctionArguments"}})],Bt.prototype,"functionArguments",void 0),c([m()],Bt.prototype,"rasterArgumentNames",void 0),Bt=c([F("esri.layers.support.rasterFunctions.BandArithmeticFunction")],Bt);const Gr=Bt;var de;const ds=new Q({1:"outside",2:"inside"},{useNumericKeys:!0});let Ht=de=class extends D{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new de({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};c([m({types:$s,json:{read:Hs,write:!0}})],Ht.prototype,"clippingGeometry",void 0),c([m({json:{read:ds.read,write:ds.write}})],Ht.prototype,"clippingType",void 0),Ht=de=c([F("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Ht);const zr=Ht;function Or(t,e){if(t.spatialReference.equals(e))return t;const n=Ye(t.spatialReference),s=Ye(e);if(n===s)return t;const r=n/s;return{x:t.x*r,y:t.y*r}}async function Fi(t,e,n){if(n.type==="extent")return Er(t,e,n);const{width:s,height:r}=t,i=new Uint8Array(s*r),{contains:a,intersects:o}=await qs(async()=>{const{contains:u,intersects:l}=await import("./geometryEngine-CdPoFSE4-Bq1o6CJZ.js");return{contains:u,intersects:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);return o(e,n)?n.type==="polyline"?Ur(t,e,n):a(n,e)?t:Dr(t,e,n):new A({pixelType:t.pixelType,width:s,height:r,mask:i,maskIsAlpha:!1,pixels:[...t.pixels]})}function Dr(t,e,n){if(!t)return t;const{width:s,height:r}=t,i=e.width/s,a=e.height/r,{xmin:o,ymax:u}=e;let l;if(n.type==="extent"){const d=(n.xmin-o)/i,v=(n.xmax-o)/i,w=(u-n.ymax)/a,b=(u-n.ymin)/a;l=[[[d,w],[d,b],[v,b],[v,w],[d,w]]]}else l=n.rings.map(d=>d.map(([v,w])=>[(v-o)/i,(u-w)/a]));const h=document.createElement("canvas");h.width=s,h.height=r;const p=h.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach(d=>{p.moveTo(d[0][0],d[0][1]);for(let v=0;v127?255:0);return new A({pixelType:t.pixelType,width:s,height:r,mask:x,maskIsAlpha:!1,pixels:[...t.pixels]})}function Er(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r;if(n.width/a<.5||n.height/o<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});const{xmin:u,xmax:l,ymin:h,ymax:p}=e,{xmin:f,xmax:g,ymin:y,ymax:x}=n,d=Math.max(u,f),v=Math.min(l,g),w=Math.max(h,y),b=Math.min(p,x),T=.5*a,N=.5*o;if(v-dl-T||w>p-N||b.5&&C%1<.5||O===Z&&_%1>.5&&I%1<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});if(k===0&&O===0&&B===s&&Z===r)return t;const Xe=t.mask;for(let ne=O;ne<=Z;ne++)for(let re=k;re<=B;re++){const Je=ne*s+re;i[Je]=Xe?Xe[Je]:255}return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]})}function Ur(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r,{xmin:u,ymax:l}=e,{paths:h}=n,p=t.mask;for(let f=0;fx?i*Math.round((p-x)/i):0),g=d-(gx?i*Math.round((f-x)/i):0),y=d-(yx?i*Math.floor((p-x)/i+.1):0),g=d-(gs.toLowerCase()===t.toLowerCase());return n?Rt.fromJSON(n):null}clone(){return new ge({colormap:H(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};c([m({type:[[Number]],json:{write:!0}})],Y.prototype,"colormap",void 0),c([m({type:String,json:{write:!0}})],Y.prototype,"colormapName",void 0),c([As("colormapName")],Y.prototype,"castColormapName",null),c([m({types:gn,json:{write:!0}})],Y.prototype,"colorRamp",void 0),c([It("colorRamp")],Y.prototype,"readColorRamp",null),c([m({type:Rt.apiValues,json:{type:Rt.jsonValues,write:Rt.write}})],Y.prototype,"colorRampName",void 0),c([It("colorRampName")],Y.prototype,"readColorRampName",null),Y=ge=c([F("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],Y);const $r=Y,Hr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],qr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function qe(t,e){const n=[],s=[];for(let i=0;i[s,...n]),e):null}let tt=class extends z{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)this.colorRamp=s,e=ce(s,{interpolateAlpha:!0});else if(r){const o=Cs(r);o&&(e=ce(o),this.colorRamp=Ss(o))}else n&&(e=Zr(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const i=this._getOutputPixelType(t.pixelType);this.outputPixelType=i.startsWith("f")?"s32":i;const a=t.clone();return a.pixelType=this.outputPixelType,a.colormap=e,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||W(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};c([m({json:{write:!0,name:"rasterFunction"}})],tt.prototype,"functionName",void 0),c([m({type:$r,json:{write:!0,name:"rasterFunctionArguments"}})],tt.prototype,"functionArguments",void 0),c([m()],tt.prototype,"rasterArgumentNames",void 0),c([m()],tt.prototype,"isNoopProcess",void 0),c([m({json:{write:!0}})],tt.prototype,"indexedColormap",void 0),c([m()],tt.prototype,"colorRamp",void 0),tt=c([F("esri.layers.support.rasterFunctions.ColormapFunction")],tt);const to=tt;var ye;let xe=ye=class extends D{clone(){return new ye({raster:this.raster})}};xe=ye=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunctionArguments")],xe);const eo=xe;let pt=class extends z{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=e;const n=[...t.colormap].sort((i,a)=>i[0]-a[0]),{indexedColormap:s,offset:r}=Ts({colormap:n});return s?(this.lookup={indexedColormap:s,offset:r},{success:!0,supportsGPU:Rs(s)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const n=e.pixels[0],s=e.mask??new Uint8Array(n.length).fill(255),r=new Uint8Array(n.length),i=new Uint8Array(n.length),a=new Uint8Array(n.length),{indexedColormap:o,offset:u}=this.lookup,l=o.length;for(let h=0;hl-4?s[h]=0:(r[h]=o[p++],i[h]=o[p++],a[h]=o[p++])}return e.pixels=[r,i,a],e.statistics=[new oe(0,255),new oe(0,255),new oe(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};c([m({json:{write:!0,name:"rasterFunction"}})],pt.prototype,"functionName",void 0),c([m({type:eo,json:{write:!0,name:"rasterFunctionArguments"}})],pt.prototype,"functionArguments",void 0),c([m()],pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],pt.prototype,"lookup",void 0),pt=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunction")],pt);const so=pt;var we;let qt=we=class extends D{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new we({rasters:H(this.rasters)})}};c([m({json:{write:!0}})],qt.prototype,"rasters",void 0),c([Lt("rasters")],qt.prototype,"writeRasters",null),qt=we=c([F("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],qt);const no=qt;let jt=class extends z{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map(({bandCount:r})=>r).reduce((r,i)=>r+i),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:i})=>i!=null&&r.push(...i)),n.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:i})=>i!=null&&r.push(...i)),n.histograms=r}n.multidimensionalInfo&&n.multidimensionalInfo.variables.forEach(r=>{const i=t.map(u=>u.multidimensionalInfo?.variables.find(({name:l})=>l===r.name)),a=i.map(u=>u?.statistics?.length?u.statistics:null),o=i.map(u=>u?.histograms?.length?u.histograms:null);r.statistics=a.every(u=>u!=null)?a.flat():null,r.histograms=o.every(u=>u!=null)?o.flat():null}),n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every(r=>r.keyProperties.BandProperties?.length)?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?e?.[0]==null?null:Ks(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([m({json:{write:!0,name:"rasterFunction"}})],jt.prototype,"functionName",void 0),c([m({type:no,json:{write:!0,name:"rasterFunctionArguments"}})],jt.prototype,"functionArguments",void 0),c([m()],jt.prototype,"rasterArgumentNames",void 0),jt=c([F("esri.layers.support.rasterFunctions.CompositeBandFunction")],jt);const ro=jt,oo=new Q({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),io=new Q({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});function ao(t,e,n,s){const[r,i]=t,a=W(n)&&!W(r.pixelType)&&!W(i.pixelType),o=[r.mask,i.mask].filter(y=>y),u=A.combineBandMasks(o),l=t.map(y=>y.pixels[0]),{width:h,height:p}=r,f=A.createEmptyBand(n,h*p);switch(e){case"difference":case"relative-difference":uo({bands:l,mask:u,outBand:f,isRoundingNeeded:a,isRelative:e==="relative-difference"});break;case"categorical":lo({bands:l,mask:u,outBand:f,...s});break;case"euclidean-distance":co({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"angle-difference":po({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"band-with-most-change":ho({pixels:t.map(y=>y.pixels),mask:u,outBand:f})}const g=new A({width:h,height:p,pixels:[f],pixelType:n,mask:u});return g.updateStatistics(),g}function uo(t){const{bands:[e,n],mask:s,isRelative:r,isRoundingNeeded:i,outBand:a}=t,o=e.length;for(let u=0;u0?l/h:0}a[u]=i?Math.round(l):l}}function lo(t){const{bands:[e,n],categoryIndexLookups:[s,r],classNames:[i,a],mask:o,keepMethod:u,outBand:l}=t,h=e.length,p=i.length,f=a.length,g=p*f,y=g+1,x=g+2;for(let d=0;du&&(u=p,l=h)}r[o]=l}}var ve;let ht=ve=class extends D{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new ve({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};c([K(oo)],ht.prototype,"method",void 0),c([K(io)],ht.prototype,"keepMethod",void 0),c([m({json:{write:!0}})],ht.prototype,"raster2",void 0),c([m({readOnly:!0})],ht.prototype,"rasters",null),ht=ve=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],ht);const mo=ht;let mt=class extends z{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),t==="categorical"){const n=this.sourceRasterInfos.map(i=>i.attributeTable),s=this._getFieldNames(n,"value"),r=n.map(i=>this._getClassFieldName(i));if(s[0]==null||s[1]==null||r[0]==null||r[1]==null)return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(e,s,r)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:t==="difference"||t==="relative-difference"}}_processPixels(t){const{pixelBlocks:e}=t;if(e?.[0]==null||e?.[1]==null)return null;const{method:n}=this.functionArguments;return ao(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=kt(t);const s=W(t);return s&&(e-=1e-4,n+=1e-4),{method:this.functionArguments.method,domainRange:[e,n],isOutputRounded:s}}_updateAttributeTable(t,e,n){const s=this.sourceRasterInfos.map(b=>b.attributeTable),r=s.map((b,T)=>b.features.map(N=>N.attributes[e[T]])),i=s.map((b,T)=>b.features.map(N=>N.attributes[n[T]])),a=r.map(b=>{const T=[];return b.forEach((N,P)=>T[N]=P),T}),{keepMethod:o}=this.functionArguments;this._categoryConfig={categoryIndexLookups:a,classNames:i,keepMethod:o};const u=s[0].clone();u.fields=[new nt({name:"OID",type:"oid"}),new nt({name:"Value",type:"integer"}),new nt({name:"ClassName",type:"string"}),new nt({name:"Class_From",type:"string"}),new nt({name:"Class_To",type:"string"})];const l=this._getFieldNames(s,"red"),h=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),f=[],g=l.length===2&&h.length===2&&p.length===2;g&&(f.push(...s.map((b,T)=>b.features.map(N=>[N.attributes[l[T]],N.attributes[h[T]],N.attributes[p[T]]]))),u.fields.push(new nt({name:"Red",type:"integer"}),new nt({name:"Green",type:"integer"}),new nt({name:"Blue",type:"integer"})));const y=u.features[0].clone();y.geometry=null;const x=[],[d,v]=r.map(b=>b.length);let w=1;for(let b=0;b ${P}`,Class_From:T,Class_To:P},g&&(C.attributes.Red=f[0][b][0]+f[1][N][0]>>1,C.attributes.Green=f[0][b][1]+f[1][N][1]>>1,C.attributes.Blue=f[0][b][2]+f[1][N][2]>>1),x.push(C)}}if(o==="changed"){const b=y.clone();b.attributes={OID:w++,Value:d*v+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},x.push(b)}else if(o==="unchanged"){const b=y.clone();b.attributes={OID:w++,Value:d*v+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},x.push(b)}u.features=x,t.attributeTable=u}_getFieldNames(t,e){return t.map(({fields:n})=>n.find(s=>s.name.toLowerCase()===e)?.name).filter(n=>n)}_getClassFieldName(t){return(t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().startsWith("class"))??t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??t.fields.find(e=>e.type==="string"))?.name}};c([m({json:{write:!0,name:"rasterFunction"}})],mt.prototype,"functionName",void 0),c([m({type:mo,json:{write:!0,name:"rasterFunctionArguments"}})],mt.prototype,"functionArguments",void 0),c([m()],mt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],mt.prototype,"_categoryConfig",void 0),mt=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunction")],mt);const fo=mt;var be;let Kt=be=class extends D{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new be({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([m({json:{write:!0}})],Kt.prototype,"contrastOffset",void 0),c([m({json:{write:!0}})],Kt.prototype,"brightnessOffset",void 0),Kt=be=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Kt);const go=Kt;let ft=class extends z{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();this._removeStatsHistColormapVAT(n),this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=on(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:We(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],ft.prototype,"functionName",void 0),c([m({type:go,json:{write:!0,name:"rasterFunctionArguments"}})],ft.prototype,"functionArguments",void 0),c([m()],ft.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ft.prototype,"lookup",void 0),ft=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],ft);const yo=ft;function Ke(t,e,n,s,r){const i=Math.floor(s/2);for(let o=0;os+r);return e===-1||n===0||n===1?t:t.map(s=>s/n)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(S).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==S.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const i=r.clone();i.pixelType=this.outputPixelType;const a=[S.none,S.sharpen,S.sharpen2,S.sharpening3x3,S.sharpening5x5];return(t===-1||this.outputPixelType!=="u8"&&!a.includes(t))&&(i.statistics=null,i.histograms=null),i.colormap=null,i.attributeTable=null,this.rasterInfo=i,{success:!0,supportsGPU:s.length<=ys}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null||this.functionArguments.convolutionType===S.none)return e;const{rows:n,cols:s}=this.functionArguments,{_normalizedKernel:r}=this;return Ao(e,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(ys);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],gt.prototype,"functionName",void 0),c([m({type:To,json:{write:!0,name:"rasterFunctionArguments"}})],gt.prototype,"functionArguments",void 0),c([m()],gt.prototype,"rasterArgumentNames",void 0),c([m()],gt.prototype,"_normalizedKernel",null),gt=c([F("esri.layers.support.rasterFunctions.ConvolutionFunction")],gt);const Po=gt;var Te;const Os=new Q({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let Mt=Te=class extends D{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return Os.fromJSON(e.type??e.curvatureType??0)}clone(){return new Te({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([m({json:{write:{target:"type"}}}),K(Os)],Mt.prototype,"curvatureType",void 0),c([It("curvatureType",["type","curvatureType"])],Mt.prototype,"readCurvatureType",null),c([m({type:Number,json:{write:!0}})],Mt.prototype,"zFactor",void 0),Mt=Te=c([F("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Mt);const Fo=Mt;let yt=class extends z{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:i}=t,a=i?.[0],o=a??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*Yt:n;return an(e,{zFactor:u,curvatureType:s,resolution:o})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Yt:t}}};c([m({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),c([m({type:Fo,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),c([m()],yt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],yt.prototype,"isGCS",void 0),yt=c([F("esri.layers.support.rasterFunctions.CurvatureFunction")],yt);const No=yt;var Pe;let et=Pe=class extends D{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Ps.bestMatch}clone(){return new Pe({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([m({json:{write:!0}})],et.prototype,"bandIds",void 0),c([m({json:{write:!0}})],et.prototype,"bandNames",void 0),c([m({json:{write:!0}})],et.prototype,"bandWavelengths",void 0),c([K({0:"name",1:"wavelength",2:"id"})],et.prototype,"method",void 0),c([m({json:{write:!0}})],et.prototype,"missingBandAction",void 0),c([m({json:{write:!0}})],et.prototype,"wavelengthMatchTolerance",void 0),et=Pe=c([F("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],et);const Co=et;let Gt=class extends z{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,u=r?.length&&(s==="name"||s!=="id"&&!a?.length),l=i?.length&&(s==="wavelength"||s!=="id"&&!a?.length),h=o===Ps.fail,p=u?Io(n,r):l?_o(n,i,this.functionArguments,h):ko(n,a,h);if(p==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=n.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:g,histograms:y}=f;g!=null&&g.length&&(f.statistics=p.map(d=>g[d]||g[g.length-1])),y!=null&&y.length&&(f.histograms=p.map(d=>y[d]||y[y.length-1])),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach(d=>{const{statistics:v,histograms:w}=d;v!=null&&v.length&&(d.statistics=p.map(b=>v[b]||v[v.length-1])),w!=null&&w.length&&(d.histograms=p.map(b=>w[b]||w[w.length-1]))});let x=f.keyProperties?.BandProperties;return x?.length&&(x=p.map(d=>d>=x.length?x[x.length-1]:x[d]),f.keyProperties={...f.keyProperties,BandProperties:x}),this.rasterInfo=f,{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map(r=>r>=n?n-1:r);return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:V(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(n=>n>=e?e-1:n).map(n=>t[n])}};c([m({json:{write:!0,name:"rasterFunction"}})],Gt.prototype,"functionName",void 0),c([m({type:Co,json:{write:!0,name:"rasterFunctionArguments"}})],Gt.prototype,"functionArguments",void 0),c([m()],Gt.prototype,"rasterArgumentNames",void 0),Gt=c([F("esri.layers.support.rasterFunctions.ExtractBandFunction")],Gt);const Ro=Gt;function Io(t,e){const n=t.bandInfos.map(({name:r})=>r.toLowerCase()),s=[];for(let r=0;ro.startsWith("nearinfrared_1")),a===-1&&(a=n.findIndex(o=>o.startsWith("nearinfrared")))),a===-1)return null;s.push(a)}return s}function ko(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some(r=>r<0||r>=s)?null:e}function _o(t,e,{wavelengthMatchTolerance:n},s){const{bandInfos:r}=t,i=[];for(let o=0;o=g.minWavelength&&u<=g.maxWavelength,x=Math.abs(u-(g.minWavelength+g.maxWavelength)/2);y?xy?y:Tn+s);return t.map(n=>n/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const n=t.length===3||e.bandCount===3&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:So(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};c([m({json:{write:!0,name:"rasterFunction"}})],xt.prototype,"functionName",void 0),c([m({type:Bo,json:{write:!0,name:"rasterFunctionArguments"}})],xt.prototype,"functionArguments",void 0),c([m()],xt.prototype,"rasterArgumentNames",void 0),c([m()],xt.prototype,"_normalizedWeights",null),xt=c([F("esri.layers.support.rasterFunctions.GrayscaleFunction")],xt);const jo=xt;var Ne;const Mo=new Q({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Go=new Q({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let X=Ne=class extends D{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Ne({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([m({type:Number,json:{write:!0}})],X.prototype,"altitude",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"azimuth",void 0),c([m(),K(Mo)],X.prototype,"hillshadeType",void 0),c([m({type:Number,json:{write:!0,name:"psPower"}})],X.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{write:!0,name:"psZFactor"}})],X.prototype,"pixelSizeFactor",void 0),c([m(),K(Go)],X.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"zFactor",void 0),c([m({type:Boolean,json:{write:!0}})],X.prototype,"removeEdgeEffect",void 0),X=Ne=c([F("esri.layers.support.rasterFunctions.HillshadeFunctionArguments")],X);const Ds=X;let wt=class extends z{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}),a=ee(this.functionArguments,i,this.isGCS),o=Is(e,a);return o.pixelType=this.outputPixelType,o}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",o=W(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,isOutputRounded:o}}};c([m({json:{write:!0,name:"rasterFunction"}})],wt.prototype,"functionName",void 0),c([m({type:Ds,json:{write:!0,name:"rasterFunctionArguments"}})],wt.prototype,"functionArguments",void 0),c([m()],wt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],wt.prototype,"isGCS",void 0),wt=c([F("esri.layers.support.rasterFunctions.HillshadeFunction")],wt);const zo=wt;var Ce;let vt=Ce=class extends D{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new Ce({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:H(this.rasters)})}};c([m({json:{write:!0}})],vt.prototype,"operation",void 0),c([m({json:{write:!0}})],vt.prototype,"rasters",void 0),c([Lt("rasters")],vt.prototype,"writeRasters",null),c([m({json:{write:!0}})],vt.prototype,"processAsMultiband",void 0),vt=Ce=c([F("esri.layers.support.rasterFunctions.LocalFunctionArguments")],vt);const Oo=vt;let zt=class extends z{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some(u=>u.bandCount!==n))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:i}=this.functionArguments,a=es[r];if(!(a===999||i.length===a||i.length<=1&&a===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${a}`};const o=e.clone();return o.bandCount=a!==999||s?n:1,this._removeStatsHistColormapVAT(o),this._updateStatistics(o),this._updatePixelType(o),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount===1&&a<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(n=>n==null)?null:zs(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=es[t],n=Object.keys(Ze).find(o=>Ze[o]===t)?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,i]=kt(s);const a=W(s);return a&&(r-=1e-4,i+=1e-4),{imageCount:e,operationName:n,domainRange:[r,i],isOutputRounded:a}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=ts(n)?.domain;if(s){t.statistics=[];for(let r=0;r({min:-r.max,max:-r.min,avg:r.avg!=null?-r.avg:void 0,stddev:r.stddev!=null?-r.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:i}=ts(s)??{domain:null,isInteger:!1};let a="f32";if(r&&i)a=ie(r[0],r[1]);else if(s===30){const o=e?.[0];a=o?ie(o.min,o.max):W(n)?n:"s32"}else if(s===45&&W(n)){const o=e?.map(({max:p})=>-p),u=e?.map(({min:p})=>-p),l=o?.length?Math.min(...o):null,h=u?.length?Math.min(...u):null;a=l!=null&&h!=null?ie(l,h):n.startsWith("s")?n.replace("s","u"):n==="u1"||n==="u2"||n==="u4"?"s8":n==="u8"?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};c([m({json:{write:!0,name:"rasterFunction"}})],zt.prototype,"functionName",void 0),c([m({type:Oo,json:{write:!0,name:"rasterFunctionArguments"}})],zt.prototype,"functionArguments",void 0),c([m()],zt.prototype,"rasterArgumentNames",void 0),zt=c([F("esri.layers.support.rasterFunctions.LocalFunction")],zt);const Do=zt;var Re;let bt=Re=class extends D{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Fs.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(s=>{if(typeof s=="number")return e=!0,[s];if(typeof s=="string"){const r=s.trim().split(" ").filter(i=>i.trim()!=="").map(i=>Number(i));return e=e||r.length>0,r.length===0?null:r}return null});return e?n:null}clone(){return new Re({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};c([m({json:{write:!0}})],bt.prototype,"includedRanges",void 0),c([m({json:{write:!0}})],bt.prototype,"noDataValues",void 0),c([m()],bt.prototype,"normalizedNoDataValues",null),c([m({json:{write:!0}})],bt.prototype,"noDataInterpretation",void 0),bt=Re=c([F("esri.layers.support.rasterFunctions.MaskFunctionArguments")],bt);const Eo=bt;let At=class extends z{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let a=0;aa?.length===s[0]?.length);return{success:!0,supportsGPU:(!n||n.length<=2*st)&&(!s||i&&s[0].length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:i,normalizedNoDataValues:a}=this.functionArguments,o=i===Fs.matchAll;return Js(e,{includedRanges:r,noDataValues:a,outputPixelType:n,matchAll:o,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(st);n.fill(Vt),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(st);for(let r=0;r=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const i=s.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};const[a,o,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:a,max:o,avg:u,stddev:l}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return xr(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments,s=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:V(s),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map(s=>t[s])}};c([m({json:{write:!0,name:"rasterFunction"}})],Dt.prototype,"functionName",void 0),c([m({type:Vo,json:{write:!0,name:"rasterFunctionArguments"}})],Dt.prototype,"functionArguments",void 0),c([m()],Dt.prototype,"rasterArgumentNames",void 0),Dt=c([F("esri.layers.support.rasterFunctions.NDVIFunction")],Dt);const Lo=Dt;var ke;let rt=ke=class extends D{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new ke({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([m({json:{write:!0}})],rt.prototype,"inputRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"outputValues",void 0),c([m({json:{write:!0}})],rt.prototype,"noDataRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"allowUnmatched",void 0),c([m({json:{write:!0}})],rt.prototype,"isLastInputRangeInclusive",void 0),rt=ke=c([F("esri.layers.support.rasterFunctions.RemapFunctionArguments")],rt);const Wo=rt;let Tt=class extends z{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,outputValues:r,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:o}=this.functionArguments;if(n!=null&&n.length&&r?.length)if(s){const u=Math.min.apply(null,[...r,n[0].min]),l=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:u,max:l}]}else{let u=r[0],l=u;for(let h=0;hr[h]?r[h]:u,l=l>r[h]?l:r[h];t.statistics=[{...n[0],min:u,max:l}]}return this.rasterInfo=t,this.lookup=s?null:Ys({srcPixelType:e,inputRanges:i,outputValues:r,noDataRanges:a,allowUnmatched:s,isLastInputRangeInclusive:o,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=st)&&(!a||a.length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{lookup:n,outputPixelType:s}=this;if(n){const l=We(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return l!=null&&n.mask&&(l.mask=Qs(e.pixels[0],e.mask,n.mask,n.offset,"u8")),l}const{inputRanges:r,outputValues:i,noDataRanges:a,allowUnmatched:o,isLastInputRangeInclusive:u}=this.functionArguments;return Zs(e,{inputRanges:r,outputValues:i,noDataRanges:a,outputPixelType:s,allowUnmatched:o,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*st),r=1e-5,i=this.functionArguments.inputRanges??[],a=this.functionArguments.outputValues??[],o=a.length;for(let l=0;l0&&(s[3*l]-=r),(ln.toLowerCase()===t.toLowerCase());return e?Cs(Rt.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new _e({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};c([m({json:{write:!0}})],Et.prototype,"colorRamp",void 0),c([It("colorRamp")],Et.prototype,"readColorRamp",null),c([m({type:[[Number]],json:{write:!0}})],Et.prototype,"colormap",void 0),Et=_e=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],Et);const Ho=Et;let ot=class extends z{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:n}=this.functionArguments;if(!e&&!n?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone();this._removeStatsHistColormapVAT(s),s.pixelType=this.outputPixelType,s.bandCount=3,s.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=s,this.isGCS=s.spatialReference?.isGeographic??!1,n?.length||(n=ce(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:i}=Ts({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const a=un(r);return this.lookup={indexedColormap:r,offset:i,hsvMap:a},{success:!0,supportsGPU:Rs(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let n=t.primaryPixelSizes?.[0];if(n==null){const{extent:a}=t;n=a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1}}const s=ee(this.functionArguments,n,this.isGCS),r=Is(e,s),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return ln(r,e,this.lookup.hsvMap,i),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",{indexedColormap:o,offset:u}=this.lookup,l=this.sourceRasterInfos[0].statistics?.[0],h=W(this.outputPixelType);return{...e,indexedColormap:o,offset:u,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,minValue:l?.min??0,maxValue:l?.max??8e3,isOutputRounded:h}}};c([m({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([m({type:Ho,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([m()],ot.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ot.prototype,"isGCS",void 0),c([m({json:{write:!0}})],ot.prototype,"lookup",void 0),ot=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunction")],ot);const qo=ot;var Se;const Ko=new Q({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let it=Se=class extends D{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new Se({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([K(Ko)],it.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],it.prototype,"zFactor",void 0),c([m({type:Number,json:{name:"psPower",write:!0}})],it.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{name:"psZFactor",write:!0}})],it.prototype,"pixelSizeFactor",void 0),c([m({type:Boolean,json:{write:!0}})],it.prototype,"removeEdgeEffect",void 0),it=Se=c([F("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],it);const Xo=it;let Pt=class extends z{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics=this.functionArguments.slopeType!=="percent-rise"?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i}=this.functionArguments,{isGCS:a}=this,{extent:o,primaryPixelSizes:u}=t,l=u?.[0],h=l??(o?{x:o.width/e.width,y:o.height/e.height}:{x:1,y:1});return cn(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i,isGCS:a,resolution:h})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Yt:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:W(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Pt.prototype,"functionName",void 0),c([m({type:Xo,json:{write:!0,name:"rasterFunctionArguments"}})],Pt.prototype,"functionArguments",void 0),c([m()],Pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],Pt.prototype,"isGCS",void 0),Pt=c([F("esri.layers.support.rasterFunctions.SlopeFunction")],Pt);const Jo=Pt,xs=new Q({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Yo(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:i,mask:a,outBand:o}=t;if(n&&!a)return void o.set(s);const{statisticsType:u,kernelRows:l,kernelCols:h}=e,p=u==="stddev",f=r*i,g=new Float64Array(f),y=new Float64Array(f),x=new Uint32Array(f);for(let P=0;Pw-b),a?(f[x+d]=v[Math.floor((v.length-1)/2)],g[x+d]=v.length):o[x+d]=v[Math.floor((v.length-1)/2)])}}if(a)for(let y=h;yP&&(P=N,T=C);a?(y[v+w]=T,x[v+w]=b.size):o[v+w]=T}}if(a)for(let d=h;d1&&o?.length&&(w=A.combineBandMasks(o));const b=new A({pixelType:d,width:i,height:a,pixels:p,bandMasks:o&&v.length?v:null,mask:w});return b.updateStatistics(),b}var Be;let Ft=Be=class extends D{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new Be({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:H(this.raster)})}};c([m({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],Ft.prototype,"rows",void 0),c([m({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],Ft.prototype,"cols",void 0),c([m({json:{write:!0}})],Ft.prototype,"fillNoDataOnly",void 0),c([m({json:{read:{source:["statisticsType","type"],reader:(t,e)=>xs.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),K(xs)],Ft.prototype,"statisticsType",void 0),Ft=Be=c([F("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],Ft);const si=Ft;let Ut=class extends z{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return s==="stddev"&&this._removeStatsHistColormapVAT(n),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:i}=this.functionArguments;return ei(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:i,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Ut.prototype,"functionName",void 0),c([m({type:si,json:{write:!0,name:"rasterFunctionArguments"}})],Ut.prototype,"functionArguments",void 0),c([m()],Ut.prototype,"rasterArgumentNames",void 0),Ut=c([F("esri.layers.support.rasterFunctions.StatisticsFunction")],Ut);const ni=Ut;var je;let Nt=je=class extends D{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach(s=>{const r={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};n.push(r)}),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach(r=>{const i={...r,mean:r.avg,standardDeviation:r.stddev};delete i.avg,delete i.stddev,s.push(i)}),e[n]=s}clone(){return new je({statistics:H(this.statistics),histograms:H(this.histograms)})}};c([m({json:{write:!0}})],Nt.prototype,"statistics",void 0),c([It("statistics")],Nt.prototype,"readStatistics",null),c([Lt("statistics")],Nt.prototype,"writeStatistics",null),c([m({json:{write:!0}})],Nt.prototype,"histograms",void 0),Nt=je=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],Nt);const ri=Nt;let at=class extends z{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],at.prototype,"functionName",void 0),c([m({type:ri,json:{write:!0,name:"rasterFunctionArguments"}})],at.prototype,"functionArguments",void 0),c([m()],at.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],at.prototype,"indexedColormap",void 0),c([m()],at.prototype,"isNoopProcess",void 0),at=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],at);const oi=at;var Me;const ii=new Q({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let L=Me=class extends D{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map(s=>[s.min,s.max,s.avg,s.stddev])),e[n]=t)}clone(){return new Me({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:H(this.statistics),gamma:H(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:H(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([m({type:Boolean,json:{write:!0}})],L.prototype,"computeGamma",void 0),c([m({type:Boolean,json:{name:"dra",write:!0}})],L.prototype,"dynamicRangeAdjustment",void 0),c([m({type:[Number],json:{write:!0}})],L.prototype,"gamma",void 0),c([m()],L.prototype,"histograms",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"maxPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"minPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"numberOfStandardDeviations",void 0),c([m({type:Number,json:{name:"max",write:!0}})],L.prototype,"outputMax",void 0),c([m({type:Number,json:{name:"min",write:!0}})],L.prototype,"outputMin",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"sigmoidStrengthLevel",void 0),c([m({json:{type:[[Number]],write:!0}})],L.prototype,"statistics",void 0),c([Lt("statistics")],L.prototype,"writeStatistics",null),c([K(ii)],L.prototype,"stretchType",void 0),c([m({type:Boolean,json:{write:!0}})],L.prototype,"useGamma",void 0),L=Me=c([F("esri.layers.support.rasterFunctions.StretchFunctionArguments")],L);const ai=L;let ut=class extends z{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:i}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const l=ae(n.toJSON(),{rasterInfo:t}),h=W(this.outputPixelType)?"round":"float";this.lookup=pn({pixelType:e,...l,gamma:i?r:null,rounding:h}),this.cutOffs=l}else s||(this.cutOffs=ae(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const a=t.clone();a.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(a),this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed");const{outputMin:o=0,outputMax:u=255}=this.functionArguments;a.statistics=[];for(let l=0;l=2?3:1,i=s&&n?.length?mn(r,n):[1,1,1],{minCutOff:a,maxCutOff:o}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};a.length===1&&(a[1]=a[2]=a[0],o[1]=o[2]=o[0]);const u=new Float32Array(r);let l;for(l=0;l1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,n.dataType!=="thematic"&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),c([m({type:li,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),c([m()],Ct.prototype,"rasterArgumentNames",void 0),c([m()],Ct.prototype,"isNoopProcess",void 0),Ct=c([F("esri.layers.support.rasterFunctions.TableFunction")],Ct);const ci=Ct,j=new Map;function pi(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster,n.raster2]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(e.includes(s)||e.push(s)):"rasterFunctionArguments"in s&&pi(s,e))})}function Ni(t,e){if(e=e??{},"function"in(t=H(t))&&"arguments"in t&&t.arguments){const n=Vs(t,new Map,e);if(De(n),!n.renderingRule)throw new Wt("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return Es(t=ze(t),e);throw new Wt("raster-function-helper","unsupported raster function json.")}function hi(t,e){return e[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:e.map(n=>t[n])}function ws(t){return!!(t&&typeof t=="object"&&t.rasterFunction&&t.rasterFunctionArguments)}function ze(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const r in n){let i=n[r];const a=r.toLowerCase();if(a==="rasters"&&Array.isArray(i))s.rasters=i.map(o=>ws(o)?ze(o):o);else switch(ws(i)&&(i=ze(i)),a){case"dra":s.dra=i;break;case"pspower":s.psPower=i;break;case"pszfactor":s.psZFactor=i;break;case"bandids":s.bandIds=i;break;default:s[r[0].toLowerCase()+r.slice(1)]=i}}return e!=="Local"||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Es(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,r=t.outputPixelType?.toLowerCase();if(n==null||!j.has(n))throw new Wt("raster-function-helper",`unsupported raster function: ${n}`);const i=j.get(n),a=(typeof i.ctor=="function"?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:r}),{rasterArgumentNames:o}=a,u=[],l=hi(s,o),h=o[0]==="rasters"||o.length>1,p=[];for(let f=0;f{a.functionArguments[f]=p[g]})),e){a.sourceRasters=u;const f=e.raster?.url;f&&(a.mainPrimaryRasterId=f)}return a}function Us(t,e){if(t&&e)for(const n in t){const s=t[n];s&&typeof s=="object"&&"type"in s&&(s.type==="RasterFunctionTemplate"?Us(s.arguments,e):s.type==="RasterFunctionVariable"&&e[s.name]!=null&&(s.value=e[s.name]))}}function Oe(t,e){if(!t||typeof t!="object")return t;const{value:n}=t;if(!n||typeof n!="object")return t.isDataset?"$$":n;if(Array.isArray(n))return n.length===0?[]:n.map(r=>typeof r=="object"&&r.type==="RasterFunctionVariable"?Oe(r,e):r);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&n.type!=="Scalar")return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=vs(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(vs)};break;case"ArgumentArray":if(n.elements?.length&&n.elements[0].type!=="RasterStatistics"){const r=[];for(let i=0;i{if(typeof o=="object")if(o._object_ref_id!=null){if(!n.has(o._object_ref_id))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${i} does not exist`);const l=n.get(a);l&&typeof l=="object"?Object.assign(o,l):i[u]=l}else De({renderingRule:o,templates:n})}));else{if(!n.has(a))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const o=n.get(a);r!=="_object_ref_id"?s[r]=o:o&&typeof o=="object"&&Object.assign(s,o)}}}function mi(t){t.Statistics?.length&&typeof t.Statistics=="object"&&(t.Statistics=t.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),t.NumberOfStandardDeviation!=null&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function fi(t){t.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete t.ColorRamp,t.ColormapName="Random"),t.ColorSchemeType===0&&delete t.ColorRamp}function di(t){t.ConvolutionType!=null&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function gi(t){t.NoDataValues?.length&&typeof t.NoDataValues[0]=="string"&&(t.NoDataValues=t.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}j.set("Arithmetic",{desc:"Arithmetic Function",ctor:ar,rasterArgumentNames:["rasters"]}),j.set("Aspect",{desc:"Aspect Function",ctor:lr,rasterArgumentNames:["raster"]}),j.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Gr,rasterArgumentNames:["raster"]}),j.set("Colormap",{desc:"Colormap Function",ctor:to,rasterArgumentNames:["raster"]}),j.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:so,rasterArgumentNames:["raster"]}),j.set("CompositeBand",{desc:"CompositeBand Function",ctor:ro,rasterArgumentNames:["rasters"]}),j.set("ComputeChange",{desc:"ComputeChange Function",ctor:fo,rasterArgumentNames:["rasters"]}),j.set("Convolution",{desc:"Convolution Function",ctor:Po,rasterArgumentNames:["raster"]}),j.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:yo,rasterArgumentNames:["raster"]}),j.set("ExtractBand",{desc:"ExtractBand Function",ctor:Ro,rasterArgumentNames:["raster"]}),j.set("Curvature",{desc:"Curvature Function",ctor:No,rasterArgumentNames:["raster"]}),j.set("Hillshade",{desc:"Hillshade Function",ctor:zo,rasterArgumentNames:["raster"]}),j.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:qo,rasterArgumentNames:["raster"]}),j.set("Grayscale",{desc:"Grayscale Function",ctor:jo,rasterArgumentNames:["raster"]}),j.set("Clip",{desc:"Clip Function",ctor:Wr,rasterArgumentNames:["raster"]}),j.set("Local",{desc:"Local Function",ctor:Do,rasterArgumentNames:["rasters"]}),j.set("Mask",{desc:"Mask Function",ctor:Uo,rasterArgumentNames:["raster"]}),j.set("NDVI",{desc:"NDVI Function",ctor:Lo,rasterArgumentNames:["raster"]}),j.set("Remap",{desc:"Remap Function",ctor:$o,rasterArgumentNames:["raster"]}),j.set("Slope",{desc:"Slope Function",ctor:Jo,rasterArgumentNames:["raster"]}),j.set("Statistics",{desc:"Focal Statistics Function",ctor:ni,rasterArgumentNames:["raster"]}),j.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:oi,rasterArgumentNames:["raster"]}),j.set("Stretch",{desc:"Stretch Function",ctor:ui,rasterArgumentNames:["raster"]}),j.set("Table",{desc:"Attribute Table Function",ctor:ci,rasterArgumentNames:["raster"]});let Xt=class extends Le{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};c([m()],Xt.prototype,"affectsPixelSize",null),c([m({json:{write:!0}})],Xt.prototype,"spatialReference",void 0),Xt=c([F("esri.layers.support.rasterTransforms.BaseRasterTransform")],Xt);const Ws=Xt;var Ee;let Jt=Ee=class extends Ws{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return(t=t.clone()).type==="point"?(t.x>180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return(t=t.clone()).type==="point"?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}clone(){return new Ee({tolerance:this.tolerance})}};c([K({GCSShiftXform:"gcs-shift"})],Jt.prototype,"type",void 0),c([m()],Jt.prototype,"tolerance",void 0),Jt=Ee=c([F("esri.layers.support.rasterTransforms.GCSShiftTransform")],Jt);const Ci=Jt;var Ue;function Ve(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(n===2){const f=s*s,g=r*r,y=s*r;return{x:t[0]+s*t[2]+r*t[4]+f*t[6]+y*t[8]+g*t[10],y:t[1]+s*t[3]+r*t[5]+f*t[7]+y*t[9]+g*t[11]}}const i=s*s,a=r*r,o=s*r,u=i*s,l=i*r,h=s*a,p=r*a;return{x:t[0]+s*t[2]+r*t[4]+i*t[6]+o*t[8]+a*t[10]+u*t[12]+l*t[14]+h*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+i*t[7]+o*t[9]+a*t[11]+u*t[13]+l*t[15]+h*t[17]+p*t[19]}}function bs(t,e,n){const{xmin:s,ymin:r,xmax:i,ymax:a,spatialReference:o}=e;let u=[];if(n<2)u.push({x:s,y:a}),u.push({x:i,y:a}),u.push({x:s,y:r}),u.push({x:i,y:r});else{let p=10;for(let f=0;fVe(t,p,n));const l=u.map(p=>p.x),h=u.map(p=>p.y);return new le({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}function yi(t){const[e,n,s,r,i,a]=t,o=s*a-i*r,u=i*r-s*a;return[(i*n-e*a)/o,(s*n-e*r)/u,a/o,r/u,-i/o,-s/u]}let q=Ue=class extends Ws{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let i=0;i0}forwardTransform(t){if(t.type==="point"){const e=Ve(this.forwardCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if(t.type==="point"){const e=Ve(this.inverseCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new Ue({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([m({json:{write:!0}})],q.prototype,"polynomialOrder",void 0),c([m()],q.prototype,"forwardCoefficients",void 0),c([It("forwardCoefficients",["coeffX","coeffY"])],q.prototype,"readForwardCoefficients",null),c([Lt("forwardCoefficients")],q.prototype,"writeForwardCoefficients",null),c([m({json:{write:!0}})],q.prototype,"inverseCoefficients",null),c([It("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],q.prototype,"readInverseCoefficients",null),c([Lt("inverseCoefficients")],q.prototype,"writeInverseCoefficients",null),c([m()],q.prototype,"affectsPixelSize",null),c([K({PolynomialXform:"polynomial"})],q.prototype,"type",void 0),q=Ue=c([F("esri.layers.support.rasterTransforms.PolynomialTransform")],q);const Ri=q;export{Lr as B,pi as D,Fi as E,Ni as h,Ws as q,Ri as v,Ci as x}; diff --git a/main/assets/PolynomialTransform-C3nWCu0l-Draevh5B.js b/main/assets/PolynomialTransform-C3nWCu0l-Draevh5B.js deleted file mode 100644 index 87cb98712..000000000 --- a/main/assets/PolynomialTransform-C3nWCu0l-Draevh5B.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-BRF8cFYX.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-CV-sFImk.js"])))=>i.map(i=>d[i]); -import{v as c,S as m,i as F,ad as As,aK as Q,bz as K,af as $s,g as Hs,a0 as It,ac as Lt,e as Le,P as H,i2 as Vt,o as Wt,w as ue,_ as qs,n as le,p as Ye}from"./main-BZaw9FpY.js";import{l as Qe}from"./colorUtils-Cthpxcks-BhGjp9AU.js";import{D as A,n as kt,g as W,e as Ts,c as oe,l as Ks,d as We,u as Ps,K as ie,i as Fs,p as Xs,s as st,j as Js,m as Ys,q as Qs,t as Zs,Y as tn,Q as Ns,L as en}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{W as sn,G as Rt,X as nn,e as rn,i as ce,f as Cs,g as Rs,h as on,k as Yt,Q as an,$ as ee,x as Is,T as ks,l as un,I as ln,Z as cn,P as ae,m as pn,o as hn,p as mn,r as _s}from"./RasterSymbolizer-BVys6HkM-CeBx4Ld8.js";import{o as fn,F as dn}from"./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js";import{g as gn,v as Ss}from"./colorRamps-q0bZVhs2-Bqen3nIx.js";import{y as nt}from"./Field-C6hA1tZj-CbELM0zp.js";let Qt=class extends Le{constructor(){super(...arguments),this.raster=void 0}};c([m({json:{write:!0}})],Qt.prototype,"raster",void 0),Qt=c([F("esri.layers.support.rasterFunctions.BaseFunctionArguments")],Qt);const D=Qt;var pe;let _t=pe=class extends D{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new pe({raster:this.raster,raster2:this.raster2,operation:this.operation})}};c([m({json:{write:!0}})],_t.prototype,"operation",void 0),c([m({json:{write:!0}})],_t.prototype,"raster2",void 0),c([m({readOnly:!0})],_t.prototype,"rasters",null),_t=pe=c([F("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],_t);const yn=_t,xn=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let E=class extends Le{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const o=[];for(let u=0;u=0;o--)e[o].isNoopProcess&&e.splice(o,1);let r=!1;for(let o=0;o1}const i=e.some(({name:o})=>xn.has(o.toLowerCase())),{rawSourceRasterInfos:a}=this;return{functions:e,hasBranches:r,hasFocalFunction:i,isSourceSingleBand:a?.[0]?.bandCount===1}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let i=0;ithis._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(a=>a.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((a,o)=>a!==o);const i=t.filter(a=>a.functionName==="ExtractBand");return i.length&&i.forEach((a,o)=>{a.isInputBandIdsSwizzled=!0,a.swizzledBandSelection=[o,o,o]}),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let i=0;ir!==i),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map(s=>this._isRasterFunctionValue(s)?s.getWebGLProcessorDefinition():typeof s=="number"?{name:"Constant",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(s=>s!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];this.functionName==="Clip"&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach(s=>{if(this._isRasterFunctionValue(s)){const r=s.getClippingGeometries();t.push(...r)}});else if(this._isRasterFunctionValue(e)){const s=e.getClippingGeometries();t.push(...s)}return t}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(e=>{e.statistics=void 0,e.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(e.length===0)return n;const r=e.map(a=>a&&typeof a=="object"&&"bind"in a&&a.rasterInfo?a.rasterInfo:typeof a=="string"&&s.includes(a)?n[s.indexOf(a)]:typeof a!="number"?n[0]:void 0),i=r.find(a=>a)??n[0];return r.forEach((a,o)=>{a===void 0&&(r[o]=i)}),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;se?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:typeof n.BAND_COUNT=="string"?String(e):e})}};c([m({json:{write:!0}})],E.prototype,"functionName",void 0),c([m({json:{write:!0}})],E.prototype,"functionArguments",void 0),c([m()],E.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}}),As(t=>t?.toLowerCase())],E.prototype,"outputPixelType",void 0),c([m({json:{write:!0}})],E.prototype,"mainPrimaryRasterId",void 0),c([m()],E.prototype,"sourceRasters",void 0),c([m({type:[sn],json:{write:!0}})],E.prototype,"sourceRasterInfos",void 0),c([m({json:{write:!0}})],E.prototype,"rasterInfo",void 0),c([m({json:{write:!0}})],E.prototype,"readingBufferSize",void 0),c([m({json:{write:!0}})],E.prototype,"id",void 0),c([m()],E.prototype,"isNoopProcess",void 0),c([m()],E.prototype,"supportsGPU",null),c([m()],E.prototype,"rawInputBandIds",void 0),c([m()],E.prototype,"rawSourceRasterInfos",void 0),c([m()],E.prototype,"isInputBandIdsSwizzled",void 0),c([m()],E.prototype,"swizzledBandSelection",void 0),c([m()],E.prototype,"isBranch",void 0),c([m({readOnly:!0})],E.prototype,"flatWebGLFunctionChain",null),c([m()],E.prototype,"_bindingResult",void 0),E=c([F("esri.layers.support.rasterFunctions.BaseRasterFunction")],E);const z=E,S={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},wn={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},$={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},J={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},vn={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},Bs={setNull:50,conditional:78},Ze={...wn,...$,...J,...vn,...Bs},js=new Map([[J.acos,{domain:[0,Math.PI],isInteger:!1}],[J.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.cos,{domain:[-1,1],isInteger:!1}],[J.sin,{domain:[-1,1],isInteger:!1}],[$.booleanAnd,{domain:[0,1],isInteger:!0}],[$.booleanNot,{domain:[0,1],isInteger:!0}],[$.booleanOr,{domain:[0,1],isInteger:!0}],[$.booleanXOr,{domain:[0,1],isInteger:!0}],[$.equalTo,{domain:[0,1],isInteger:!0}],[$.notEqual,{domain:[0,1],isInteger:!0}],[$.greaterThan,{domain:[0,1],isInteger:!0}],[$.greaterThanEqual,{domain:[0,1],isInteger:!0}],[$.lessThan,{domain:[0,1],isInteger:!0}],[$.lessThanEqual,{domain:[0,1],isInteger:!0}],[$.isNull,{domain:[0,1],isInteger:!0}]]);function ts(t){return js.get(t)}const es=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function bn(t,e=!1){const n=t.map(o=>o.mask),s=n.filter(o=>o!=null),r=t[0].pixels[0].length;if(s.length===0||e&&s.length!==n.length)return new Uint8Array(r).fill(255);const i=s[0],a=new Uint8Array(i);if(s.length===1)return a;if(!e){for(let o=1;o=1?e[u]=0:a[u]=Math.atanh(l)}return a}const o=s===J.asin?Math.asin:Math.acos;for(let u=0;u1?e[u]=0:a[u]=o(l)}return a}function _n(t,e,n,s){const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;o>r[o]);return a}function On(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;or[o]?1:0);return a}function Yn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;o=r[o]?1:0);return a}function Qn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;oh&&(u=h)}a[o]=u}return a}function os(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;op&&(u=p)}a[o]=l-u}return a}function is(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;ol?(l=u,h.length=0,h.push(p)):u===l&&h.push(p);h.length>1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function ps(t,e,n){const s=t.length;if(s<=2)return Gs(t,e,n);const r=t[0].length,i=A.createEmptyBand(n,r),a=new Map;for(let o=0;o1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function hs(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i),o=new Set;for(let u=0;u=66&&e<=75);const{outputPixelType:r="f32"}=n,i=!G.has(e)||n.processAsMultiband,a=i?t[0].pixels.length:1,o=[];for(let l=0;lg.pixels):t.map(g=>g.pixels[l]);let p,f=!0;if(e===Bs.setNull){const g=rr(h,s,r);p=g.band,s=g.mask,f=!1}else R.has(e)?p=R.get(e)(h,s,"f64"):U.has(e)?p=e===J.asin||e===J.acos||e===J.atanh?kn(h,s,"f64",e):_n(h,s,"f64",U.get(e)):se.has(e)?p=Sn(h,s,"f64",se.get(e)):G.has(e)?p=G.get(e)(h,s,"f64"):(p=h[0],f=!1);if(f&&e!==$.isNull&&!js.has(e)){const g=A.createEmptyBand(r,p.length);s||(s=new Uint8Array(p.length).fill(255)),tn(p,s),Ns(p,s,r,g),p=g}o.push(p)}const u=t[0];return new A({width:u.width,height:u.height,pixelType:r,mask:e===$.isNull?null:s,pixels:o})}function ir(t,e,n){return zs(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}let St=class extends z{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?.[0]==null||e?.[1]==null?null:ir(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=kt(n);const i=W(n);return i&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:i}}};c([m({json:{write:!0,name:"rasterFunction"}})],St.prototype,"functionName",void 0),c([m({type:yn,json:{write:!0,name:"rasterFunctionArguments"}})],St.prototype,"functionArguments",void 0),c([m()],St.prototype,"rasterArgumentNames",void 0),St=c([F("esri.layers.support.rasterFunctions.ArithmeticFunction")],St);const ar=St;var he;let me=he=class extends D{clone(){return new he({raster:this.raster})}};me=he=c([F("esri.layers.support.rasterFunctions.AspectFunctionArguments")],me);const ur=me;let lt=class extends z{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return nn(e,{resolution:i})}};c([m({json:{write:!0,name:"rasterFunction"}})],lt.prototype,"functionName",void 0),c([m({type:ur,json:{write:!0,name:"rasterFunctionArguments"}})],lt.prototype,"functionArguments",void 0),c([m()],lt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],lt.prototype,"isGCS",void 0),lt=c([F("esri.layers.support.rasterFunctions.AspectFunction")],lt);const lr=lt,cr=new Set(["+","-","*","/","(",")"]);function pr(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const n=t.split(""),s=[],r=[];let i="";for(let a=0;a-1)n>0&&(r+=e+1);else{for(let a=0;a0&&(r+=e+1)}let i=0;for(let a=0;a0;){const{numIndex:a,opIndex:o}=fr(r);if(s=hr(t,r[o],i[a],i[a+1]),r.length===1)break;r=mr(r,o),i.splice(a,2,s)}return[s]}const gr=new Q({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function yr(t,e){if(!en(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map(f=>f-1),{pixels:i,mask:a}=t;let o;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":o=fs(a,i[r[0]],i[r[1]]);break;case"ndwi":o=fs(a,i[r[1]],i[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":o=wr(a,i[r[0]],i[r[1]]);break;case"ci-g":case"ci-re":o=vr(a,i[r[0]],i[r[1]]);break;case"savi":o=br(a,i[r[0]],i[r[1]],r[2]+1);break;case"tsavi":o=Ar(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":o=Tr(a,i[r[0]],i[r[1]]);break;case"gemi":o=Pr(a,i[r[0]],i[r[1]]);break;case"pvi":o=Fr(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1);break;case"gvitm":o=Nr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]],i[r[5]]]);break;case"sultan":o=Cr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]]]);break;case"vari":o=Rr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"mtvi2":o=Ir(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"rtvi-core":o=kr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"evi":o=_r(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"wndwi":o=Sr(a,[i[r[0]],i[r[1]],i[r[2]]],r[3]?r[3]+1:.5);break;case"bai":o=Br(a,i[r[0]],i[r[1]]);break;case"custom":o=dr(a,i,n);break;default:return t}const{outputPixelType:u="f32"}=e,l=u!=null&&W(u);let h;a?(h=new Uint8Array(t.width*t.height),h.set(a)):l&&(h=new Uint8Array(t.width*t.height).fill(255)),l&&(o=o.map(f=>{const g=A.createEmptyBand(u,f.length);return Ns(f,h,u,g),g}));const p=new A({width:t.width,height:t.height,pixelType:u,pixels:o,mask:h});return p.updateStatistics(),p}function xr(t,e,n,s){const{mask:r,pixels:i,width:a,height:o}=t,u=i[n],l=i[e],h=l.length,p=s?new Uint8Array(h):new Float32Array(h),f=s?100:1,g=s?100.5:0;for(let x=0;xparseFloat(i));return yr(e,{method:n,bandIndexes:r,equation:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:i}=this.functionArguments;switch(i){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=V([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=V([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=V([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=V([e[0],e[1],0]),s="ci";break;case"savi":n=V([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=V([e[0],e[1],0]),s="msavi";break;case"gemi":n=V([e[0],e[1],0]),s="gemi";break;case"pvi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=V([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=V([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=V([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=V([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=V([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=V([e[1],e[0],0]),s="bai";break;default:n=V([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:W(this.outputPixelType)}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),n=t.length,s=e.map(a=>a>=n?n-1:a),r=Mr.has(this.functionArguments.method)?3:2,i=s.slice(0,r).map(a=>t[a]);return i.length===2&&i.push(0),i}};c([m({json:{write:!0,name:"rasterFunction"}})],Bt.prototype,"functionName",void 0),c([m({type:jr,json:{write:!0,name:"rasterFunctionArguments"}})],Bt.prototype,"functionArguments",void 0),c([m()],Bt.prototype,"rasterArgumentNames",void 0),Bt=c([F("esri.layers.support.rasterFunctions.BandArithmeticFunction")],Bt);const Gr=Bt;var de;const ds=new Q({1:"outside",2:"inside"},{useNumericKeys:!0});let Ht=de=class extends D{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new de({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};c([m({types:$s,json:{read:Hs,write:!0}})],Ht.prototype,"clippingGeometry",void 0),c([m({json:{read:ds.read,write:ds.write}})],Ht.prototype,"clippingType",void 0),Ht=de=c([F("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Ht);const zr=Ht;function Or(t,e){if(t.spatialReference.equals(e))return t;const n=Ye(t.spatialReference),s=Ye(e);if(n===s)return t;const r=n/s;return{x:t.x*r,y:t.y*r}}async function Fi(t,e,n){if(n.type==="extent")return Er(t,e,n);const{width:s,height:r}=t,i=new Uint8Array(s*r),{contains:a,intersects:o}=await qs(async()=>{const{contains:u,intersects:l}=await import("./geometryEngine-CdPoFSE4-BRF8cFYX.js");return{contains:u,intersects:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);return o(e,n)?n.type==="polyline"?Ur(t,e,n):a(n,e)?t:Dr(t,e,n):new A({pixelType:t.pixelType,width:s,height:r,mask:i,maskIsAlpha:!1,pixels:[...t.pixels]})}function Dr(t,e,n){if(!t)return t;const{width:s,height:r}=t,i=e.width/s,a=e.height/r,{xmin:o,ymax:u}=e;let l;if(n.type==="extent"){const d=(n.xmin-o)/i,v=(n.xmax-o)/i,w=(u-n.ymax)/a,b=(u-n.ymin)/a;l=[[[d,w],[d,b],[v,b],[v,w],[d,w]]]}else l=n.rings.map(d=>d.map(([v,w])=>[(v-o)/i,(u-w)/a]));const h=document.createElement("canvas");h.width=s,h.height=r;const p=h.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach(d=>{p.moveTo(d[0][0],d[0][1]);for(let v=0;v127?255:0);return new A({pixelType:t.pixelType,width:s,height:r,mask:x,maskIsAlpha:!1,pixels:[...t.pixels]})}function Er(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r;if(n.width/a<.5||n.height/o<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});const{xmin:u,xmax:l,ymin:h,ymax:p}=e,{xmin:f,xmax:g,ymin:y,ymax:x}=n,d=Math.max(u,f),v=Math.min(l,g),w=Math.max(h,y),b=Math.min(p,x),T=.5*a,N=.5*o;if(v-dl-T||w>p-N||b.5&&C%1<.5||O===Z&&_%1>.5&&I%1<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});if(k===0&&O===0&&B===s&&Z===r)return t;const Xe=t.mask;for(let ne=O;ne<=Z;ne++)for(let re=k;re<=B;re++){const Je=ne*s+re;i[Je]=Xe?Xe[Je]:255}return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]})}function Ur(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r,{xmin:u,ymax:l}=e,{paths:h}=n,p=t.mask;for(let f=0;fx?i*Math.round((p-x)/i):0),g=d-(gx?i*Math.round((f-x)/i):0),y=d-(yx?i*Math.floor((p-x)/i+.1):0),g=d-(gs.toLowerCase()===t.toLowerCase());return n?Rt.fromJSON(n):null}clone(){return new ge({colormap:H(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};c([m({type:[[Number]],json:{write:!0}})],Y.prototype,"colormap",void 0),c([m({type:String,json:{write:!0}})],Y.prototype,"colormapName",void 0),c([As("colormapName")],Y.prototype,"castColormapName",null),c([m({types:gn,json:{write:!0}})],Y.prototype,"colorRamp",void 0),c([It("colorRamp")],Y.prototype,"readColorRamp",null),c([m({type:Rt.apiValues,json:{type:Rt.jsonValues,write:Rt.write}})],Y.prototype,"colorRampName",void 0),c([It("colorRampName")],Y.prototype,"readColorRampName",null),Y=ge=c([F("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],Y);const $r=Y,Hr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],qr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function qe(t,e){const n=[],s=[];for(let i=0;i[s,...n]),e):null}let tt=class extends z{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)this.colorRamp=s,e=ce(s,{interpolateAlpha:!0});else if(r){const o=Cs(r);o&&(e=ce(o),this.colorRamp=Ss(o))}else n&&(e=Zr(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const i=this._getOutputPixelType(t.pixelType);this.outputPixelType=i.startsWith("f")?"s32":i;const a=t.clone();return a.pixelType=this.outputPixelType,a.colormap=e,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||W(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};c([m({json:{write:!0,name:"rasterFunction"}})],tt.prototype,"functionName",void 0),c([m({type:$r,json:{write:!0,name:"rasterFunctionArguments"}})],tt.prototype,"functionArguments",void 0),c([m()],tt.prototype,"rasterArgumentNames",void 0),c([m()],tt.prototype,"isNoopProcess",void 0),c([m({json:{write:!0}})],tt.prototype,"indexedColormap",void 0),c([m()],tt.prototype,"colorRamp",void 0),tt=c([F("esri.layers.support.rasterFunctions.ColormapFunction")],tt);const to=tt;var ye;let xe=ye=class extends D{clone(){return new ye({raster:this.raster})}};xe=ye=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunctionArguments")],xe);const eo=xe;let pt=class extends z{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=e;const n=[...t.colormap].sort((i,a)=>i[0]-a[0]),{indexedColormap:s,offset:r}=Ts({colormap:n});return s?(this.lookup={indexedColormap:s,offset:r},{success:!0,supportsGPU:Rs(s)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const n=e.pixels[0],s=e.mask??new Uint8Array(n.length).fill(255),r=new Uint8Array(n.length),i=new Uint8Array(n.length),a=new Uint8Array(n.length),{indexedColormap:o,offset:u}=this.lookup,l=o.length;for(let h=0;hl-4?s[h]=0:(r[h]=o[p++],i[h]=o[p++],a[h]=o[p++])}return e.pixels=[r,i,a],e.statistics=[new oe(0,255),new oe(0,255),new oe(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};c([m({json:{write:!0,name:"rasterFunction"}})],pt.prototype,"functionName",void 0),c([m({type:eo,json:{write:!0,name:"rasterFunctionArguments"}})],pt.prototype,"functionArguments",void 0),c([m()],pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],pt.prototype,"lookup",void 0),pt=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunction")],pt);const so=pt;var we;let qt=we=class extends D{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new we({rasters:H(this.rasters)})}};c([m({json:{write:!0}})],qt.prototype,"rasters",void 0),c([Lt("rasters")],qt.prototype,"writeRasters",null),qt=we=c([F("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],qt);const no=qt;let jt=class extends z{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map(({bandCount:r})=>r).reduce((r,i)=>r+i),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:i})=>i!=null&&r.push(...i)),n.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:i})=>i!=null&&r.push(...i)),n.histograms=r}n.multidimensionalInfo&&n.multidimensionalInfo.variables.forEach(r=>{const i=t.map(u=>u.multidimensionalInfo?.variables.find(({name:l})=>l===r.name)),a=i.map(u=>u?.statistics?.length?u.statistics:null),o=i.map(u=>u?.histograms?.length?u.histograms:null);r.statistics=a.every(u=>u!=null)?a.flat():null,r.histograms=o.every(u=>u!=null)?o.flat():null}),n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every(r=>r.keyProperties.BandProperties?.length)?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?e?.[0]==null?null:Ks(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([m({json:{write:!0,name:"rasterFunction"}})],jt.prototype,"functionName",void 0),c([m({type:no,json:{write:!0,name:"rasterFunctionArguments"}})],jt.prototype,"functionArguments",void 0),c([m()],jt.prototype,"rasterArgumentNames",void 0),jt=c([F("esri.layers.support.rasterFunctions.CompositeBandFunction")],jt);const ro=jt,oo=new Q({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),io=new Q({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});function ao(t,e,n,s){const[r,i]=t,a=W(n)&&!W(r.pixelType)&&!W(i.pixelType),o=[r.mask,i.mask].filter(y=>y),u=A.combineBandMasks(o),l=t.map(y=>y.pixels[0]),{width:h,height:p}=r,f=A.createEmptyBand(n,h*p);switch(e){case"difference":case"relative-difference":uo({bands:l,mask:u,outBand:f,isRoundingNeeded:a,isRelative:e==="relative-difference"});break;case"categorical":lo({bands:l,mask:u,outBand:f,...s});break;case"euclidean-distance":co({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"angle-difference":po({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"band-with-most-change":ho({pixels:t.map(y=>y.pixels),mask:u,outBand:f})}const g=new A({width:h,height:p,pixels:[f],pixelType:n,mask:u});return g.updateStatistics(),g}function uo(t){const{bands:[e,n],mask:s,isRelative:r,isRoundingNeeded:i,outBand:a}=t,o=e.length;for(let u=0;u0?l/h:0}a[u]=i?Math.round(l):l}}function lo(t){const{bands:[e,n],categoryIndexLookups:[s,r],classNames:[i,a],mask:o,keepMethod:u,outBand:l}=t,h=e.length,p=i.length,f=a.length,g=p*f,y=g+1,x=g+2;for(let d=0;du&&(u=p,l=h)}r[o]=l}}var ve;let ht=ve=class extends D{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new ve({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};c([K(oo)],ht.prototype,"method",void 0),c([K(io)],ht.prototype,"keepMethod",void 0),c([m({json:{write:!0}})],ht.prototype,"raster2",void 0),c([m({readOnly:!0})],ht.prototype,"rasters",null),ht=ve=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],ht);const mo=ht;let mt=class extends z{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),t==="categorical"){const n=this.sourceRasterInfos.map(i=>i.attributeTable),s=this._getFieldNames(n,"value"),r=n.map(i=>this._getClassFieldName(i));if(s[0]==null||s[1]==null||r[0]==null||r[1]==null)return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(e,s,r)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:t==="difference"||t==="relative-difference"}}_processPixels(t){const{pixelBlocks:e}=t;if(e?.[0]==null||e?.[1]==null)return null;const{method:n}=this.functionArguments;return ao(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=kt(t);const s=W(t);return s&&(e-=1e-4,n+=1e-4),{method:this.functionArguments.method,domainRange:[e,n],isOutputRounded:s}}_updateAttributeTable(t,e,n){const s=this.sourceRasterInfos.map(b=>b.attributeTable),r=s.map((b,T)=>b.features.map(N=>N.attributes[e[T]])),i=s.map((b,T)=>b.features.map(N=>N.attributes[n[T]])),a=r.map(b=>{const T=[];return b.forEach((N,P)=>T[N]=P),T}),{keepMethod:o}=this.functionArguments;this._categoryConfig={categoryIndexLookups:a,classNames:i,keepMethod:o};const u=s[0].clone();u.fields=[new nt({name:"OID",type:"oid"}),new nt({name:"Value",type:"integer"}),new nt({name:"ClassName",type:"string"}),new nt({name:"Class_From",type:"string"}),new nt({name:"Class_To",type:"string"})];const l=this._getFieldNames(s,"red"),h=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),f=[],g=l.length===2&&h.length===2&&p.length===2;g&&(f.push(...s.map((b,T)=>b.features.map(N=>[N.attributes[l[T]],N.attributes[h[T]],N.attributes[p[T]]]))),u.fields.push(new nt({name:"Red",type:"integer"}),new nt({name:"Green",type:"integer"}),new nt({name:"Blue",type:"integer"})));const y=u.features[0].clone();y.geometry=null;const x=[],[d,v]=r.map(b=>b.length);let w=1;for(let b=0;b ${P}`,Class_From:T,Class_To:P},g&&(C.attributes.Red=f[0][b][0]+f[1][N][0]>>1,C.attributes.Green=f[0][b][1]+f[1][N][1]>>1,C.attributes.Blue=f[0][b][2]+f[1][N][2]>>1),x.push(C)}}if(o==="changed"){const b=y.clone();b.attributes={OID:w++,Value:d*v+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},x.push(b)}else if(o==="unchanged"){const b=y.clone();b.attributes={OID:w++,Value:d*v+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},x.push(b)}u.features=x,t.attributeTable=u}_getFieldNames(t,e){return t.map(({fields:n})=>n.find(s=>s.name.toLowerCase()===e)?.name).filter(n=>n)}_getClassFieldName(t){return(t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().startsWith("class"))??t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??t.fields.find(e=>e.type==="string"))?.name}};c([m({json:{write:!0,name:"rasterFunction"}})],mt.prototype,"functionName",void 0),c([m({type:mo,json:{write:!0,name:"rasterFunctionArguments"}})],mt.prototype,"functionArguments",void 0),c([m()],mt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],mt.prototype,"_categoryConfig",void 0),mt=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunction")],mt);const fo=mt;var be;let Kt=be=class extends D{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new be({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([m({json:{write:!0}})],Kt.prototype,"contrastOffset",void 0),c([m({json:{write:!0}})],Kt.prototype,"brightnessOffset",void 0),Kt=be=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Kt);const go=Kt;let ft=class extends z{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();this._removeStatsHistColormapVAT(n),this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=on(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:We(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],ft.prototype,"functionName",void 0),c([m({type:go,json:{write:!0,name:"rasterFunctionArguments"}})],ft.prototype,"functionArguments",void 0),c([m()],ft.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ft.prototype,"lookup",void 0),ft=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],ft);const yo=ft;function Ke(t,e,n,s,r){const i=Math.floor(s/2);for(let o=0;os+r);return e===-1||n===0||n===1?t:t.map(s=>s/n)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(S).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==S.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const i=r.clone();i.pixelType=this.outputPixelType;const a=[S.none,S.sharpen,S.sharpen2,S.sharpening3x3,S.sharpening5x5];return(t===-1||this.outputPixelType!=="u8"&&!a.includes(t))&&(i.statistics=null,i.histograms=null),i.colormap=null,i.attributeTable=null,this.rasterInfo=i,{success:!0,supportsGPU:s.length<=ys}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null||this.functionArguments.convolutionType===S.none)return e;const{rows:n,cols:s}=this.functionArguments,{_normalizedKernel:r}=this;return Ao(e,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(ys);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],gt.prototype,"functionName",void 0),c([m({type:To,json:{write:!0,name:"rasterFunctionArguments"}})],gt.prototype,"functionArguments",void 0),c([m()],gt.prototype,"rasterArgumentNames",void 0),c([m()],gt.prototype,"_normalizedKernel",null),gt=c([F("esri.layers.support.rasterFunctions.ConvolutionFunction")],gt);const Po=gt;var Te;const Os=new Q({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let Mt=Te=class extends D{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return Os.fromJSON(e.type??e.curvatureType??0)}clone(){return new Te({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([m({json:{write:{target:"type"}}}),K(Os)],Mt.prototype,"curvatureType",void 0),c([It("curvatureType",["type","curvatureType"])],Mt.prototype,"readCurvatureType",null),c([m({type:Number,json:{write:!0}})],Mt.prototype,"zFactor",void 0),Mt=Te=c([F("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Mt);const Fo=Mt;let yt=class extends z{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:i}=t,a=i?.[0],o=a??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*Yt:n;return an(e,{zFactor:u,curvatureType:s,resolution:o})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Yt:t}}};c([m({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),c([m({type:Fo,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),c([m()],yt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],yt.prototype,"isGCS",void 0),yt=c([F("esri.layers.support.rasterFunctions.CurvatureFunction")],yt);const No=yt;var Pe;let et=Pe=class extends D{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Ps.bestMatch}clone(){return new Pe({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([m({json:{write:!0}})],et.prototype,"bandIds",void 0),c([m({json:{write:!0}})],et.prototype,"bandNames",void 0),c([m({json:{write:!0}})],et.prototype,"bandWavelengths",void 0),c([K({0:"name",1:"wavelength",2:"id"})],et.prototype,"method",void 0),c([m({json:{write:!0}})],et.prototype,"missingBandAction",void 0),c([m({json:{write:!0}})],et.prototype,"wavelengthMatchTolerance",void 0),et=Pe=c([F("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],et);const Co=et;let Gt=class extends z{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,u=r?.length&&(s==="name"||s!=="id"&&!a?.length),l=i?.length&&(s==="wavelength"||s!=="id"&&!a?.length),h=o===Ps.fail,p=u?Io(n,r):l?_o(n,i,this.functionArguments,h):ko(n,a,h);if(p==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=n.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:g,histograms:y}=f;g!=null&&g.length&&(f.statistics=p.map(d=>g[d]||g[g.length-1])),y!=null&&y.length&&(f.histograms=p.map(d=>y[d]||y[y.length-1])),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach(d=>{const{statistics:v,histograms:w}=d;v!=null&&v.length&&(d.statistics=p.map(b=>v[b]||v[v.length-1])),w!=null&&w.length&&(d.histograms=p.map(b=>w[b]||w[w.length-1]))});let x=f.keyProperties?.BandProperties;return x?.length&&(x=p.map(d=>d>=x.length?x[x.length-1]:x[d]),f.keyProperties={...f.keyProperties,BandProperties:x}),this.rasterInfo=f,{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map(r=>r>=n?n-1:r);return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:V(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(n=>n>=e?e-1:n).map(n=>t[n])}};c([m({json:{write:!0,name:"rasterFunction"}})],Gt.prototype,"functionName",void 0),c([m({type:Co,json:{write:!0,name:"rasterFunctionArguments"}})],Gt.prototype,"functionArguments",void 0),c([m()],Gt.prototype,"rasterArgumentNames",void 0),Gt=c([F("esri.layers.support.rasterFunctions.ExtractBandFunction")],Gt);const Ro=Gt;function Io(t,e){const n=t.bandInfos.map(({name:r})=>r.toLowerCase()),s=[];for(let r=0;ro.startsWith("nearinfrared_1")),a===-1&&(a=n.findIndex(o=>o.startsWith("nearinfrared")))),a===-1)return null;s.push(a)}return s}function ko(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some(r=>r<0||r>=s)?null:e}function _o(t,e,{wavelengthMatchTolerance:n},s){const{bandInfos:r}=t,i=[];for(let o=0;o=g.minWavelength&&u<=g.maxWavelength,x=Math.abs(u-(g.minWavelength+g.maxWavelength)/2);y?xy?y:Tn+s);return t.map(n=>n/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const n=t.length===3||e.bandCount===3&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:So(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};c([m({json:{write:!0,name:"rasterFunction"}})],xt.prototype,"functionName",void 0),c([m({type:Bo,json:{write:!0,name:"rasterFunctionArguments"}})],xt.prototype,"functionArguments",void 0),c([m()],xt.prototype,"rasterArgumentNames",void 0),c([m()],xt.prototype,"_normalizedWeights",null),xt=c([F("esri.layers.support.rasterFunctions.GrayscaleFunction")],xt);const jo=xt;var Ne;const Mo=new Q({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Go=new Q({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let X=Ne=class extends D{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Ne({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([m({type:Number,json:{write:!0}})],X.prototype,"altitude",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"azimuth",void 0),c([m(),K(Mo)],X.prototype,"hillshadeType",void 0),c([m({type:Number,json:{write:!0,name:"psPower"}})],X.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{write:!0,name:"psZFactor"}})],X.prototype,"pixelSizeFactor",void 0),c([m(),K(Go)],X.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"zFactor",void 0),c([m({type:Boolean,json:{write:!0}})],X.prototype,"removeEdgeEffect",void 0),X=Ne=c([F("esri.layers.support.rasterFunctions.HillshadeFunctionArguments")],X);const Ds=X;let wt=class extends z{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}),a=ee(this.functionArguments,i,this.isGCS),o=Is(e,a);return o.pixelType=this.outputPixelType,o}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",o=W(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,isOutputRounded:o}}};c([m({json:{write:!0,name:"rasterFunction"}})],wt.prototype,"functionName",void 0),c([m({type:Ds,json:{write:!0,name:"rasterFunctionArguments"}})],wt.prototype,"functionArguments",void 0),c([m()],wt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],wt.prototype,"isGCS",void 0),wt=c([F("esri.layers.support.rasterFunctions.HillshadeFunction")],wt);const zo=wt;var Ce;let vt=Ce=class extends D{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new Ce({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:H(this.rasters)})}};c([m({json:{write:!0}})],vt.prototype,"operation",void 0),c([m({json:{write:!0}})],vt.prototype,"rasters",void 0),c([Lt("rasters")],vt.prototype,"writeRasters",null),c([m({json:{write:!0}})],vt.prototype,"processAsMultiband",void 0),vt=Ce=c([F("esri.layers.support.rasterFunctions.LocalFunctionArguments")],vt);const Oo=vt;let zt=class extends z{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some(u=>u.bandCount!==n))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:i}=this.functionArguments,a=es[r];if(!(a===999||i.length===a||i.length<=1&&a===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${a}`};const o=e.clone();return o.bandCount=a!==999||s?n:1,this._removeStatsHistColormapVAT(o),this._updateStatistics(o),this._updatePixelType(o),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount===1&&a<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(n=>n==null)?null:zs(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=es[t],n=Object.keys(Ze).find(o=>Ze[o]===t)?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,i]=kt(s);const a=W(s);return a&&(r-=1e-4,i+=1e-4),{imageCount:e,operationName:n,domainRange:[r,i],isOutputRounded:a}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=ts(n)?.domain;if(s){t.statistics=[];for(let r=0;r({min:-r.max,max:-r.min,avg:r.avg!=null?-r.avg:void 0,stddev:r.stddev!=null?-r.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:i}=ts(s)??{domain:null,isInteger:!1};let a="f32";if(r&&i)a=ie(r[0],r[1]);else if(s===30){const o=e?.[0];a=o?ie(o.min,o.max):W(n)?n:"s32"}else if(s===45&&W(n)){const o=e?.map(({max:p})=>-p),u=e?.map(({min:p})=>-p),l=o?.length?Math.min(...o):null,h=u?.length?Math.min(...u):null;a=l!=null&&h!=null?ie(l,h):n.startsWith("s")?n.replace("s","u"):n==="u1"||n==="u2"||n==="u4"?"s8":n==="u8"?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};c([m({json:{write:!0,name:"rasterFunction"}})],zt.prototype,"functionName",void 0),c([m({type:Oo,json:{write:!0,name:"rasterFunctionArguments"}})],zt.prototype,"functionArguments",void 0),c([m()],zt.prototype,"rasterArgumentNames",void 0),zt=c([F("esri.layers.support.rasterFunctions.LocalFunction")],zt);const Do=zt;var Re;let bt=Re=class extends D{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Fs.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(s=>{if(typeof s=="number")return e=!0,[s];if(typeof s=="string"){const r=s.trim().split(" ").filter(i=>i.trim()!=="").map(i=>Number(i));return e=e||r.length>0,r.length===0?null:r}return null});return e?n:null}clone(){return new Re({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};c([m({json:{write:!0}})],bt.prototype,"includedRanges",void 0),c([m({json:{write:!0}})],bt.prototype,"noDataValues",void 0),c([m()],bt.prototype,"normalizedNoDataValues",null),c([m({json:{write:!0}})],bt.prototype,"noDataInterpretation",void 0),bt=Re=c([F("esri.layers.support.rasterFunctions.MaskFunctionArguments")],bt);const Eo=bt;let At=class extends z{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let a=0;aa?.length===s[0]?.length);return{success:!0,supportsGPU:(!n||n.length<=2*st)&&(!s||i&&s[0].length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:i,normalizedNoDataValues:a}=this.functionArguments,o=i===Fs.matchAll;return Js(e,{includedRanges:r,noDataValues:a,outputPixelType:n,matchAll:o,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(st);n.fill(Vt),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(st);for(let r=0;r=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const i=s.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};const[a,o,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:a,max:o,avg:u,stddev:l}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return xr(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments,s=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:V(s),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map(s=>t[s])}};c([m({json:{write:!0,name:"rasterFunction"}})],Dt.prototype,"functionName",void 0),c([m({type:Vo,json:{write:!0,name:"rasterFunctionArguments"}})],Dt.prototype,"functionArguments",void 0),c([m()],Dt.prototype,"rasterArgumentNames",void 0),Dt=c([F("esri.layers.support.rasterFunctions.NDVIFunction")],Dt);const Lo=Dt;var ke;let rt=ke=class extends D{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new ke({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([m({json:{write:!0}})],rt.prototype,"inputRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"outputValues",void 0),c([m({json:{write:!0}})],rt.prototype,"noDataRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"allowUnmatched",void 0),c([m({json:{write:!0}})],rt.prototype,"isLastInputRangeInclusive",void 0),rt=ke=c([F("esri.layers.support.rasterFunctions.RemapFunctionArguments")],rt);const Wo=rt;let Tt=class extends z{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,outputValues:r,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:o}=this.functionArguments;if(n!=null&&n.length&&r?.length)if(s){const u=Math.min.apply(null,[...r,n[0].min]),l=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:u,max:l}]}else{let u=r[0],l=u;for(let h=0;hr[h]?r[h]:u,l=l>r[h]?l:r[h];t.statistics=[{...n[0],min:u,max:l}]}return this.rasterInfo=t,this.lookup=s?null:Ys({srcPixelType:e,inputRanges:i,outputValues:r,noDataRanges:a,allowUnmatched:s,isLastInputRangeInclusive:o,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=st)&&(!a||a.length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{lookup:n,outputPixelType:s}=this;if(n){const l=We(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return l!=null&&n.mask&&(l.mask=Qs(e.pixels[0],e.mask,n.mask,n.offset,"u8")),l}const{inputRanges:r,outputValues:i,noDataRanges:a,allowUnmatched:o,isLastInputRangeInclusive:u}=this.functionArguments;return Zs(e,{inputRanges:r,outputValues:i,noDataRanges:a,outputPixelType:s,allowUnmatched:o,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*st),r=1e-5,i=this.functionArguments.inputRanges??[],a=this.functionArguments.outputValues??[],o=a.length;for(let l=0;l0&&(s[3*l]-=r),(ln.toLowerCase()===t.toLowerCase());return e?Cs(Rt.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new _e({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};c([m({json:{write:!0}})],Et.prototype,"colorRamp",void 0),c([It("colorRamp")],Et.prototype,"readColorRamp",null),c([m({type:[[Number]],json:{write:!0}})],Et.prototype,"colormap",void 0),Et=_e=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],Et);const Ho=Et;let ot=class extends z{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:n}=this.functionArguments;if(!e&&!n?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone();this._removeStatsHistColormapVAT(s),s.pixelType=this.outputPixelType,s.bandCount=3,s.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=s,this.isGCS=s.spatialReference?.isGeographic??!1,n?.length||(n=ce(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:i}=Ts({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const a=un(r);return this.lookup={indexedColormap:r,offset:i,hsvMap:a},{success:!0,supportsGPU:Rs(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let n=t.primaryPixelSizes?.[0];if(n==null){const{extent:a}=t;n=a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1}}const s=ee(this.functionArguments,n,this.isGCS),r=Is(e,s),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return ln(r,e,this.lookup.hsvMap,i),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",{indexedColormap:o,offset:u}=this.lookup,l=this.sourceRasterInfos[0].statistics?.[0],h=W(this.outputPixelType);return{...e,indexedColormap:o,offset:u,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,minValue:l?.min??0,maxValue:l?.max??8e3,isOutputRounded:h}}};c([m({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([m({type:Ho,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([m()],ot.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ot.prototype,"isGCS",void 0),c([m({json:{write:!0}})],ot.prototype,"lookup",void 0),ot=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunction")],ot);const qo=ot;var Se;const Ko=new Q({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let it=Se=class extends D{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new Se({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([K(Ko)],it.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],it.prototype,"zFactor",void 0),c([m({type:Number,json:{name:"psPower",write:!0}})],it.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{name:"psZFactor",write:!0}})],it.prototype,"pixelSizeFactor",void 0),c([m({type:Boolean,json:{write:!0}})],it.prototype,"removeEdgeEffect",void 0),it=Se=c([F("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],it);const Xo=it;let Pt=class extends z{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics=this.functionArguments.slopeType!=="percent-rise"?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i}=this.functionArguments,{isGCS:a}=this,{extent:o,primaryPixelSizes:u}=t,l=u?.[0],h=l??(o?{x:o.width/e.width,y:o.height/e.height}:{x:1,y:1});return cn(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i,isGCS:a,resolution:h})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Yt:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:W(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Pt.prototype,"functionName",void 0),c([m({type:Xo,json:{write:!0,name:"rasterFunctionArguments"}})],Pt.prototype,"functionArguments",void 0),c([m()],Pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],Pt.prototype,"isGCS",void 0),Pt=c([F("esri.layers.support.rasterFunctions.SlopeFunction")],Pt);const Jo=Pt,xs=new Q({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Yo(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:i,mask:a,outBand:o}=t;if(n&&!a)return void o.set(s);const{statisticsType:u,kernelRows:l,kernelCols:h}=e,p=u==="stddev",f=r*i,g=new Float64Array(f),y=new Float64Array(f),x=new Uint32Array(f);for(let P=0;Pw-b),a?(f[x+d]=v[Math.floor((v.length-1)/2)],g[x+d]=v.length):o[x+d]=v[Math.floor((v.length-1)/2)])}}if(a)for(let y=h;yP&&(P=N,T=C);a?(y[v+w]=T,x[v+w]=b.size):o[v+w]=T}}if(a)for(let d=h;d1&&o?.length&&(w=A.combineBandMasks(o));const b=new A({pixelType:d,width:i,height:a,pixels:p,bandMasks:o&&v.length?v:null,mask:w});return b.updateStatistics(),b}var Be;let Ft=Be=class extends D{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new Be({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:H(this.raster)})}};c([m({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],Ft.prototype,"rows",void 0),c([m({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],Ft.prototype,"cols",void 0),c([m({json:{write:!0}})],Ft.prototype,"fillNoDataOnly",void 0),c([m({json:{read:{source:["statisticsType","type"],reader:(t,e)=>xs.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),K(xs)],Ft.prototype,"statisticsType",void 0),Ft=Be=c([F("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],Ft);const si=Ft;let Ut=class extends z{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return s==="stddev"&&this._removeStatsHistColormapVAT(n),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:i}=this.functionArguments;return ei(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:i,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Ut.prototype,"functionName",void 0),c([m({type:si,json:{write:!0,name:"rasterFunctionArguments"}})],Ut.prototype,"functionArguments",void 0),c([m()],Ut.prototype,"rasterArgumentNames",void 0),Ut=c([F("esri.layers.support.rasterFunctions.StatisticsFunction")],Ut);const ni=Ut;var je;let Nt=je=class extends D{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach(s=>{const r={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};n.push(r)}),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach(r=>{const i={...r,mean:r.avg,standardDeviation:r.stddev};delete i.avg,delete i.stddev,s.push(i)}),e[n]=s}clone(){return new je({statistics:H(this.statistics),histograms:H(this.histograms)})}};c([m({json:{write:!0}})],Nt.prototype,"statistics",void 0),c([It("statistics")],Nt.prototype,"readStatistics",null),c([Lt("statistics")],Nt.prototype,"writeStatistics",null),c([m({json:{write:!0}})],Nt.prototype,"histograms",void 0),Nt=je=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],Nt);const ri=Nt;let at=class extends z{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],at.prototype,"functionName",void 0),c([m({type:ri,json:{write:!0,name:"rasterFunctionArguments"}})],at.prototype,"functionArguments",void 0),c([m()],at.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],at.prototype,"indexedColormap",void 0),c([m()],at.prototype,"isNoopProcess",void 0),at=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],at);const oi=at;var Me;const ii=new Q({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let L=Me=class extends D{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map(s=>[s.min,s.max,s.avg,s.stddev])),e[n]=t)}clone(){return new Me({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:H(this.statistics),gamma:H(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:H(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([m({type:Boolean,json:{write:!0}})],L.prototype,"computeGamma",void 0),c([m({type:Boolean,json:{name:"dra",write:!0}})],L.prototype,"dynamicRangeAdjustment",void 0),c([m({type:[Number],json:{write:!0}})],L.prototype,"gamma",void 0),c([m()],L.prototype,"histograms",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"maxPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"minPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"numberOfStandardDeviations",void 0),c([m({type:Number,json:{name:"max",write:!0}})],L.prototype,"outputMax",void 0),c([m({type:Number,json:{name:"min",write:!0}})],L.prototype,"outputMin",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"sigmoidStrengthLevel",void 0),c([m({json:{type:[[Number]],write:!0}})],L.prototype,"statistics",void 0),c([Lt("statistics")],L.prototype,"writeStatistics",null),c([K(ii)],L.prototype,"stretchType",void 0),c([m({type:Boolean,json:{write:!0}})],L.prototype,"useGamma",void 0),L=Me=c([F("esri.layers.support.rasterFunctions.StretchFunctionArguments")],L);const ai=L;let ut=class extends z{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:i}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const l=ae(n.toJSON(),{rasterInfo:t}),h=W(this.outputPixelType)?"round":"float";this.lookup=pn({pixelType:e,...l,gamma:i?r:null,rounding:h}),this.cutOffs=l}else s||(this.cutOffs=ae(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const a=t.clone();a.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(a),this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed");const{outputMin:o=0,outputMax:u=255}=this.functionArguments;a.statistics=[];for(let l=0;l=2?3:1,i=s&&n?.length?mn(r,n):[1,1,1],{minCutOff:a,maxCutOff:o}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};a.length===1&&(a[1]=a[2]=a[0],o[1]=o[2]=o[0]);const u=new Float32Array(r);let l;for(l=0;l1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,n.dataType!=="thematic"&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),c([m({type:li,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),c([m()],Ct.prototype,"rasterArgumentNames",void 0),c([m()],Ct.prototype,"isNoopProcess",void 0),Ct=c([F("esri.layers.support.rasterFunctions.TableFunction")],Ct);const ci=Ct,j=new Map;function pi(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster,n.raster2]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(e.includes(s)||e.push(s)):"rasterFunctionArguments"in s&&pi(s,e))})}function Ni(t,e){if(e=e??{},"function"in(t=H(t))&&"arguments"in t&&t.arguments){const n=Vs(t,new Map,e);if(De(n),!n.renderingRule)throw new Wt("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return Es(t=ze(t),e);throw new Wt("raster-function-helper","unsupported raster function json.")}function hi(t,e){return e[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:e.map(n=>t[n])}function ws(t){return!!(t&&typeof t=="object"&&t.rasterFunction&&t.rasterFunctionArguments)}function ze(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const r in n){let i=n[r];const a=r.toLowerCase();if(a==="rasters"&&Array.isArray(i))s.rasters=i.map(o=>ws(o)?ze(o):o);else switch(ws(i)&&(i=ze(i)),a){case"dra":s.dra=i;break;case"pspower":s.psPower=i;break;case"pszfactor":s.psZFactor=i;break;case"bandids":s.bandIds=i;break;default:s[r[0].toLowerCase()+r.slice(1)]=i}}return e!=="Local"||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Es(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,r=t.outputPixelType?.toLowerCase();if(n==null||!j.has(n))throw new Wt("raster-function-helper",`unsupported raster function: ${n}`);const i=j.get(n),a=(typeof i.ctor=="function"?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:r}),{rasterArgumentNames:o}=a,u=[],l=hi(s,o),h=o[0]==="rasters"||o.length>1,p=[];for(let f=0;f{a.functionArguments[f]=p[g]})),e){a.sourceRasters=u;const f=e.raster?.url;f&&(a.mainPrimaryRasterId=f)}return a}function Us(t,e){if(t&&e)for(const n in t){const s=t[n];s&&typeof s=="object"&&"type"in s&&(s.type==="RasterFunctionTemplate"?Us(s.arguments,e):s.type==="RasterFunctionVariable"&&e[s.name]!=null&&(s.value=e[s.name]))}}function Oe(t,e){if(!t||typeof t!="object")return t;const{value:n}=t;if(!n||typeof n!="object")return t.isDataset?"$$":n;if(Array.isArray(n))return n.length===0?[]:n.map(r=>typeof r=="object"&&r.type==="RasterFunctionVariable"?Oe(r,e):r);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&n.type!=="Scalar")return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=vs(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(vs)};break;case"ArgumentArray":if(n.elements?.length&&n.elements[0].type!=="RasterStatistics"){const r=[];for(let i=0;i{if(typeof o=="object")if(o._object_ref_id!=null){if(!n.has(o._object_ref_id))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${i} does not exist`);const l=n.get(a);l&&typeof l=="object"?Object.assign(o,l):i[u]=l}else De({renderingRule:o,templates:n})}));else{if(!n.has(a))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const o=n.get(a);r!=="_object_ref_id"?s[r]=o:o&&typeof o=="object"&&Object.assign(s,o)}}}function mi(t){t.Statistics?.length&&typeof t.Statistics=="object"&&(t.Statistics=t.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),t.NumberOfStandardDeviation!=null&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function fi(t){t.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete t.ColorRamp,t.ColormapName="Random"),t.ColorSchemeType===0&&delete t.ColorRamp}function di(t){t.ConvolutionType!=null&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function gi(t){t.NoDataValues?.length&&typeof t.NoDataValues[0]=="string"&&(t.NoDataValues=t.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}j.set("Arithmetic",{desc:"Arithmetic Function",ctor:ar,rasterArgumentNames:["rasters"]}),j.set("Aspect",{desc:"Aspect Function",ctor:lr,rasterArgumentNames:["raster"]}),j.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Gr,rasterArgumentNames:["raster"]}),j.set("Colormap",{desc:"Colormap Function",ctor:to,rasterArgumentNames:["raster"]}),j.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:so,rasterArgumentNames:["raster"]}),j.set("CompositeBand",{desc:"CompositeBand Function",ctor:ro,rasterArgumentNames:["rasters"]}),j.set("ComputeChange",{desc:"ComputeChange Function",ctor:fo,rasterArgumentNames:["rasters"]}),j.set("Convolution",{desc:"Convolution Function",ctor:Po,rasterArgumentNames:["raster"]}),j.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:yo,rasterArgumentNames:["raster"]}),j.set("ExtractBand",{desc:"ExtractBand Function",ctor:Ro,rasterArgumentNames:["raster"]}),j.set("Curvature",{desc:"Curvature Function",ctor:No,rasterArgumentNames:["raster"]}),j.set("Hillshade",{desc:"Hillshade Function",ctor:zo,rasterArgumentNames:["raster"]}),j.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:qo,rasterArgumentNames:["raster"]}),j.set("Grayscale",{desc:"Grayscale Function",ctor:jo,rasterArgumentNames:["raster"]}),j.set("Clip",{desc:"Clip Function",ctor:Wr,rasterArgumentNames:["raster"]}),j.set("Local",{desc:"Local Function",ctor:Do,rasterArgumentNames:["rasters"]}),j.set("Mask",{desc:"Mask Function",ctor:Uo,rasterArgumentNames:["raster"]}),j.set("NDVI",{desc:"NDVI Function",ctor:Lo,rasterArgumentNames:["raster"]}),j.set("Remap",{desc:"Remap Function",ctor:$o,rasterArgumentNames:["raster"]}),j.set("Slope",{desc:"Slope Function",ctor:Jo,rasterArgumentNames:["raster"]}),j.set("Statistics",{desc:"Focal Statistics Function",ctor:ni,rasterArgumentNames:["raster"]}),j.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:oi,rasterArgumentNames:["raster"]}),j.set("Stretch",{desc:"Stretch Function",ctor:ui,rasterArgumentNames:["raster"]}),j.set("Table",{desc:"Attribute Table Function",ctor:ci,rasterArgumentNames:["raster"]});let Xt=class extends Le{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};c([m()],Xt.prototype,"affectsPixelSize",null),c([m({json:{write:!0}})],Xt.prototype,"spatialReference",void 0),Xt=c([F("esri.layers.support.rasterTransforms.BaseRasterTransform")],Xt);const Ws=Xt;var Ee;let Jt=Ee=class extends Ws{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return(t=t.clone()).type==="point"?(t.x>180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return(t=t.clone()).type==="point"?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}clone(){return new Ee({tolerance:this.tolerance})}};c([K({GCSShiftXform:"gcs-shift"})],Jt.prototype,"type",void 0),c([m()],Jt.prototype,"tolerance",void 0),Jt=Ee=c([F("esri.layers.support.rasterTransforms.GCSShiftTransform")],Jt);const Ci=Jt;var Ue;function Ve(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(n===2){const f=s*s,g=r*r,y=s*r;return{x:t[0]+s*t[2]+r*t[4]+f*t[6]+y*t[8]+g*t[10],y:t[1]+s*t[3]+r*t[5]+f*t[7]+y*t[9]+g*t[11]}}const i=s*s,a=r*r,o=s*r,u=i*s,l=i*r,h=s*a,p=r*a;return{x:t[0]+s*t[2]+r*t[4]+i*t[6]+o*t[8]+a*t[10]+u*t[12]+l*t[14]+h*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+i*t[7]+o*t[9]+a*t[11]+u*t[13]+l*t[15]+h*t[17]+p*t[19]}}function bs(t,e,n){const{xmin:s,ymin:r,xmax:i,ymax:a,spatialReference:o}=e;let u=[];if(n<2)u.push({x:s,y:a}),u.push({x:i,y:a}),u.push({x:s,y:r}),u.push({x:i,y:r});else{let p=10;for(let f=0;fVe(t,p,n));const l=u.map(p=>p.x),h=u.map(p=>p.y);return new le({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}function yi(t){const[e,n,s,r,i,a]=t,o=s*a-i*r,u=i*r-s*a;return[(i*n-e*a)/o,(s*n-e*r)/u,a/o,r/u,-i/o,-s/u]}let q=Ue=class extends Ws{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let i=0;i0}forwardTransform(t){if(t.type==="point"){const e=Ve(this.forwardCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if(t.type==="point"){const e=Ve(this.inverseCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new Ue({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([m({json:{write:!0}})],q.prototype,"polynomialOrder",void 0),c([m()],q.prototype,"forwardCoefficients",void 0),c([It("forwardCoefficients",["coeffX","coeffY"])],q.prototype,"readForwardCoefficients",null),c([Lt("forwardCoefficients")],q.prototype,"writeForwardCoefficients",null),c([m({json:{write:!0}})],q.prototype,"inverseCoefficients",null),c([It("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],q.prototype,"readInverseCoefficients",null),c([Lt("inverseCoefficients")],q.prototype,"writeInverseCoefficients",null),c([m()],q.prototype,"affectsPixelSize",null),c([K({PolynomialXform:"polynomial"})],q.prototype,"type",void 0),q=Ue=c([F("esri.layers.support.rasterTransforms.PolynomialTransform")],q);const Ri=q;export{Lr as B,pi as D,Fi as E,Ni as h,Ws as q,Ri as v,Ci as x}; diff --git a/main/assets/PooledRBush-DbfAmeLn-DzJ6h3wI.js b/main/assets/PooledRBush-DbfAmeLn-DzJ6h3wI.js deleted file mode 100644 index 5d13e8844..000000000 --- a/main/assets/PooledRBush-DbfAmeLn-DzJ6h3wI.js +++ /dev/null @@ -1 +0,0 @@ -import{dD as w,gZ as D,h2 as v}from"./main-BZaw9FpY.js";import{b as J}from"./quickselect-DHTstthl-Ds_Aj0x5.js";class T{constructor(t=9,n){this._compareMinX=y,this._compareMinY=A,this._toBBox=i=>i,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),d.prune(),Y.prune(),m.prune(),X.prune()}all(t){F(this._data,t)}search(t,n){let i=this._data;const a=this._toBBox;if(M(t,i))for(d.clear();i;){for(let s=0,r=i.children.length;s0;){if(i||(i=m.pop(),a=m.data[m.length-1],s=X.pop()??0,r=!0),i.leaf&&(n=D(i.children,t,i.children.length,i.indexHint),n!==-1))return i.children.splice(n,1),m.push(i),this._condense(m),this;r||i.leaf||!b(i,h)?a?(s++,i=a.children[s],r=!1):i=null:(m.push(i),X.push(s),s=0,a=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_build(t,n,i,a){const s=i-n+1;let r=this._maxEntries;if(s<=r){const l=new B(t.slice(n,i+1));return f(l,this._toBBox),l}a||(a=Math.ceil(Math.log(s)/Math.log(r)),r=Math.ceil(s/r**(a-1)));const h=new E([]);h.height=a;const o=Math.ceil(s/r),c=o*Math.ceil(Math.sqrt(r));H(t,n,i,c,this._compareMinX);for(let l=n;l<=i;l+=c){const u=Math.min(l+c-1,i);H(t,l,u,o,this._compareMinY);for(let p=l;p<=u;p+=o){const j=Math.min(p+o-1,u);h.children.push(this._build(t,p,j,a-1))}}return f(h,this._toBBox),h}_insert(t,n,i){const a=this._toBBox,s=i?t:a(t);m.clear();const r=N(s,this._data,n,m);for(r.children.push(t),_(r,s);n>=0&&m.data[n].children.length>this._maxEntries;)this._split(m,n),n--;O(s,m,n)}_split(t,n){const i=t.data[n],a=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,a);const r=this._chooseSplitIndex(i,s,a);if(!r)return;const h=i.children.splice(r,i.children.length-r),o=i.leaf?new B(h):new E(h);o.height=i.height,f(i,this._toBBox),f(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,n){this._data=new E([t,n]),this._data.height=t.height+1,f(this._data,this._toBBox)}_chooseSplitIndex(t,n,i){let a,s,r;a=s=1/0;for(let h=n;h<=i-n;h++){const o=x(t,0,h,this._toBBox),c=x(t,h,i,this._toBBox),l=I(o,c),u=S(o)+S(c);l=n;c--){const l=t.children[c];_(h,t.leaf?s(l):l),o+=g(h)}return o}_condense(t){for(let n=t.length-1;n>=0;n--){const i=t.data[n];if(i.children.length===0)if(n>0){const a=t.data[n-1],s=a.children;s.splice(D(s,i,s.length,a.indexHint),1)}else this.clear();else f(i,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function N(e,t,n,i){for(;i.push(t),t.leaf!==!0&&i.length-1!==n;){let a,s=1/0,r=1/0;for(let h=0,o=t.children.length;h=0;i--)_(t.data[i],e)}function f(e,t){x(e,0,e.children.length,t,e)}function x(e,t,n,i,a){a||(a=new B([])),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let s,r=t;r=e.minX&&t.maxY>=e.minY}function H(e,t,n,i,a){const s=[t,n];for(;s.length;){const r=s.pop(),h=s.pop();if(r-h<=i)continue;const o=h+Math.ceil((r-h)/i/2)*i;J(e,o,h,r,a),s.push(h,o,o,r)}}const d=new w,Y=new w,m=new w,X=new w({deallocator:void 0});class Z{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class R extends Z{constructor(){super(...arguments),this.height=1,this.indexHint=new v}}class B extends R{constructor(t){super(),this.children=t,this.leaf=!0}}class E extends R{constructor(t){super(),this.children=t,this.leaf=!1}}export{T as N,Z as R}; diff --git a/main/assets/PooledRBush-DbfAmeLn-dj1fSLWj.js b/main/assets/PooledRBush-DbfAmeLn-dj1fSLWj.js new file mode 100644 index 000000000..d7b04a4eb --- /dev/null +++ b/main/assets/PooledRBush-DbfAmeLn-dj1fSLWj.js @@ -0,0 +1 @@ +import{dD as w,gZ as D,h2 as v}from"./main-C7yV2j71.js";import{b as J}from"./quickselect-DHTstthl-Ds_Aj0x5.js";class T{constructor(t=9,n){this._compareMinX=y,this._compareMinY=A,this._toBBox=i=>i,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),d.prune(),Y.prune(),m.prune(),X.prune()}all(t){F(this._data,t)}search(t,n){let i=this._data;const a=this._toBBox;if(M(t,i))for(d.clear();i;){for(let s=0,r=i.children.length;s0;){if(i||(i=m.pop(),a=m.data[m.length-1],s=X.pop()??0,r=!0),i.leaf&&(n=D(i.children,t,i.children.length,i.indexHint),n!==-1))return i.children.splice(n,1),m.push(i),this._condense(m),this;r||i.leaf||!b(i,h)?a?(s++,i=a.children[s],r=!1):i=null:(m.push(i),X.push(s),s=0,a=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_build(t,n,i,a){const s=i-n+1;let r=this._maxEntries;if(s<=r){const l=new B(t.slice(n,i+1));return f(l,this._toBBox),l}a||(a=Math.ceil(Math.log(s)/Math.log(r)),r=Math.ceil(s/r**(a-1)));const h=new E([]);h.height=a;const o=Math.ceil(s/r),c=o*Math.ceil(Math.sqrt(r));H(t,n,i,c,this._compareMinX);for(let l=n;l<=i;l+=c){const u=Math.min(l+c-1,i);H(t,l,u,o,this._compareMinY);for(let p=l;p<=u;p+=o){const j=Math.min(p+o-1,u);h.children.push(this._build(t,p,j,a-1))}}return f(h,this._toBBox),h}_insert(t,n,i){const a=this._toBBox,s=i?t:a(t);m.clear();const r=N(s,this._data,n,m);for(r.children.push(t),_(r,s);n>=0&&m.data[n].children.length>this._maxEntries;)this._split(m,n),n--;O(s,m,n)}_split(t,n){const i=t.data[n],a=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,a);const r=this._chooseSplitIndex(i,s,a);if(!r)return;const h=i.children.splice(r,i.children.length-r),o=i.leaf?new B(h):new E(h);o.height=i.height,f(i,this._toBBox),f(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,n){this._data=new E([t,n]),this._data.height=t.height+1,f(this._data,this._toBBox)}_chooseSplitIndex(t,n,i){let a,s,r;a=s=1/0;for(let h=n;h<=i-n;h++){const o=x(t,0,h,this._toBBox),c=x(t,h,i,this._toBBox),l=I(o,c),u=S(o)+S(c);l=n;c--){const l=t.children[c];_(h,t.leaf?s(l):l),o+=g(h)}return o}_condense(t){for(let n=t.length-1;n>=0;n--){const i=t.data[n];if(i.children.length===0)if(n>0){const a=t.data[n-1],s=a.children;s.splice(D(s,i,s.length,a.indexHint),1)}else this.clear();else f(i,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function N(e,t,n,i){for(;i.push(t),t.leaf!==!0&&i.length-1!==n;){let a,s=1/0,r=1/0;for(let h=0,o=t.children.length;h=0;i--)_(t.data[i],e)}function f(e,t){x(e,0,e.children.length,t,e)}function x(e,t,n,i,a){a||(a=new B([])),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let s,r=t;r=e.minX&&t.maxY>=e.minY}function H(e,t,n,i,a){const s=[t,n];for(;s.length;){const r=s.pop(),h=s.pop();if(r-h<=i)continue;const o=h+Math.ceil((r-h)/i/2)*i;J(e,o,h,r,a),s.push(h,o,o,r)}}const d=new w,Y=new w,m=new w,X=new w({deallocator:void 0});class Z{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class R extends Z{constructor(){super(...arguments),this.height=1,this.indexHint=new v}}class B extends R{constructor(t){super(),this.children=t,this.leaf=!0}}class E extends R{constructor(t){super(),this.children=t,this.leaf=!1}}export{T as N,Z as R}; diff --git a/main/assets/Popup-DFFZHG5j-CtqoPK1b.js b/main/assets/Popup-DFFZHG5j-CtqoPK1b.js new file mode 100644 index 000000000..b5e14439f --- /dev/null +++ b/main/assets/Popup-DFFZHG5j-CtqoPK1b.js @@ -0,0 +1,3 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-icon-laqhdRBY-CcSx2g4c.js","./icon-BXFbBbop-Du8Zws1L.js","./themeUtils-YjM7iIiX-J3djxNmP.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./dom-N58V0tYi-DBU3jlah.js","./observers-BigwqTsw-Du14S4xc.js","./visualVariableUtils-D3kZJRyn-5umqHW84.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./chartUtilsAm5-CtY-kHPy-BrLMKJ5b.js","./Theme-rblUnB2V-BgKdZgu2.js","./Tooltip-B0HefZ7r-CwNTZqWe.js","./DefaultTheme-Bt5OI-Ht-CMIseonm.js","./chartCommon-rWfJsTPl-CYhSSylP.js","./Button-MQvwxOnj-DFss60Dm.js","./ColorSet-DkIwOmgs-CITJ697b.js","./pieChart-qcxaoQkv-BVwfB1V3.js","./Tick-DUHqbpyB-BTe8OtHV.js","./xyChart-Ch-p5aUf-B9OitsL0.js","./arcade-CaGqU4sP-B2FrioW-.js","./TimeOnly-DSMefxKy-C21ZkqlE.js","./UnknownTimeZone-C--TOcPG-DfRfNtw8.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./FeatureLayer-BrRKw5Si-Rem12G_g.js","./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js","./RendererLegendOptions-K3md58-X-Bf90N-cx.js","./diffUtils-Cz3Fi8Xb-BvD0JNhD.js","./colorRamps-q0bZVhs2-DeDskCk_.js","./styleUtils-BtpNqZyT-CwQxANzG.js","./jsonUtils-C64Zfu7c-BqaK54UK.js","./LRUCache-C3erQTWv-DhyPlt5p.js","./Version-CoKzbupV-BKAqCewj.js","./FieldsIndex-HmzMbJQG-CzzKuIHi.js","./OverrideHelper-DWRbVlj1-D6dDt4cu.js","./colorUtils-Cthpxcks-CXgjba3p.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-Dl9Ps2XQ.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-1xSDkBxg.js","./heatmapUtils-seiMkkkR-BSMLb7yQ.js","./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js","./commonProperties-BtIqvFU_-DuUske_0.js","./ElevationInfo-yv2-9tj6-CpVy5FM0.js","./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./HeightModelInfo-C5vFqzyF-DTZiz4z_.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./featureLayerUtils-DgfQQyK4-D0OGSvJx.js","./Query-BrwMGK8U-DV_czrJX.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./RelationshipQuery-DJsz3K0U-BHNd_b19.js","./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js","./Relationship-PyhUibYK-DuMEI2S9.js","./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js","./Layer-ChoECxvZ--vVxyMLZ.js","./workers-PiCjreoO-DqI62TYf.js","./editsZScale-BDsX6vv--CoeIQyxn.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./FeatureSet-BkVNthuN-DDwR53LR.js","./APIKeyMixin-BUMSx9ny-AE1ffoPb.js","./ArcGISService-BYA-y6X6-BtWUPppI.js","./BlendLayer-D1WkSmwP-D_mOfOGH.js","./jsonUtils-wIllKWI4-DRJhEzZa.js","./parser-DyDJ-rlI-CV6nO3M9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./CustomParametersMixin-vdKsTHer-DndyRc71.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js","./FeatureEffect-CDEk9Es7-CW8HxX_m.js","./FeatureFilter-BCFHgLVU-DU6FY8I7.js","./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js","./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js","./labelingInfo-DGVNul26-ReCWpi39.js","./labelUtils-BW14kBqX-Cu1LInU4.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-B5IUcPZ-.js","./OrderedLayer-6Qsmrd_l-sp1TyHmN.js","./OrderByInfo-GD2XnU8e-CsM0tB0E.js","./PortalLayer-CElnYuSQ-BV63HHSL.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js","./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js","./TemporalLayer-CpOrN_w9-D1I2RE1l.js","./TimeInfo-w_HB2CsF-Ce-xYAJs.js","./FeatureTemplate-SPHPD45f-DdZuptIc.js","./FeatureType-C9hJmS6_-5PPiaaCJ.js","./fieldProperties-Bq26w7gt-DgCDIFFS.js","./versionUtils-LZYZz-38-DgmFurh2.js","./styleUtils-ChrJTYIw-OCRItq_6.js","./popupUtils-B0uZcXX0-B9v3xvNZ.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./calcite-loader-CtpHSU2--CSF9hYfM.js","./loader-Ch7Jr16w-BlGvYEIO.js","./guid-Dls486Er-CBh637k4.js","./locale-Cn_GDVD_-DrOI-_a9.js","./key-CZySMiwx-kmS7VeUz.js","./calcite-list-rnu1YzAl-CPviA1UK.js","./interactive-DqhNilgd-D_Gwwuwg.js","./resources4-Bi43yZeq-Ca3PT_gb.js","./utils3-BSH0zqNl-OPNf8-Bp.js","./loadable-DbNDKH4r-YgUDHAtn.js","./t9n-C_hcZMZJ-CZmw6XOE.js","./debounce-27Hmkkyg-Th7bw3mg.js","./input2-eOtqu-iO-CM6Z_r7O.js","./form-CRSw616T-2CDQhr1H.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./scrim-BscQh4v9-DBRj_VaE.js","./calcite-list-item-VYBhSMxV-CL6sUu6o.js","./action-GCQoufcz-D2daq3Sk.js","./calcite-notice-DeAGopAs-Cw8GCh9D.js","./conditionalSlot-DsCzytJ4-DxmRN7Hl.js","./openCloseComponent-BGQ6h7vg-DwGQl3jY.js","./calcite-chip-DE_c-1hr-CqMmwMwm.js","./calcite-input-BKRd7MCS-DmQD4QYo.js","./calcite-tooltip-63c9fmIw-DjinfNBS.js","./floating-ui-DKFFlLv3-B6atYKJb.js","./FloatingArrow-BG9llDYg-AyYcVK-v.js","./calcite-action-2fclGKoO-DM2fRYrF.js","./calcite-action-bar-ugh74qU5-Be9dclDf.js","./action-group-DhwU7QZv-Xo45JeJh.js","./action-menu-DTIJuZNc-BWLxzbAy.js","./calcite-action-group-qlkUfh_o-B4ny7Mme.js","./calcite-flow-item-uRuGc3ks-CdaGasS2.js","./panel-DRUEhsxp-DDDczPW_.js","./geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js","./calcite-button-Cm9_TJei-CW2FD2Xf.js","./calcite-flow-CAdorlph-BXJ9a_4b.js","./calcite-list-item-group-CuQ2MPLW-BDMj-Jdi.js"])))=>i.map(i=>d[i]); +import{ag as ce,v as r,S as a,ad as et,bi as je,i as P,iC as sn,eW as uo,ar as po,gP as ho,iD as rn,w as ai,aa as mo,bR as li,j as ge,b9 as ke,bp as Ye,ah as y,aL as $,aq as Nt,aK as di,a0 as Fi,ac as Mi,m as an,aD as fo,aU as Et,a1 as Y,iE as go,ai as dt,aw as yo,iF as qe,_ as w,I as ln,aF as at,iG as dn,iH as pt,iI as _o,K as ci,eC as cn,av as un,b7 as pn,o as N,cG as Be,bx as vo,cF as ct,gO as hn,cH as Ci,bE as mn,iJ as fn,a_ as gn,iK as yn,iL as _n,e_ as vn,iM as Ei,aA as wo,az as $t,e as bo,ex as Io,bt as wn,fd as gt,c_ as bn,bw as In,ae as An,iw as ui,cU as Fn,f as Mn,eY as Ti,iN as Tt,an as Cn}from"./main-C7yV2j71.js";import{b as pe}from"./substitute-j49H6mVR-BNTkzCQd.js";import{_ as K,k as Ae,P as u,o as En,X as Tn,R as oe,d as xi,e as ki,H as be,$ as xn,w as kn,F as Ao}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{s as Ln,t as Pn}from"./ReactiveSet-QxEZenFW-B_-rGoLX.js";import{h as Nn}from"./AttachmentInfo-D9RFO8W2-BdVN-3Ab.js";import{d as Yt,c as Li}from"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import{b as $n,N as Fo}from"./utils-DyydRFHu-DkAWn-U5.js";import{I as M,K as Rn,J as On}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import{K as Vn,C as St,I as Sn,J as Dn,x as We}from"./utils-DPtQ14k3-BW98GOs_.js";import{l as qn}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{u as Dt}from"./executeQueryJSON-CcHnccia-CB1D7q08.js";import{b as lt,m as Bn}from"./Query-BrwMGK8U-DV_czrJX.js";import{j as jn}from"./shared-D1w-26bA-CNuAEz8h.js";import Mo from"./FeatureLayer-BrRKw5Si-Rem12G_g.js";import{h as Co}from"./ReactiveMap-CFk6jPfN-CM49HI11.js";import{L as xt}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{V as Wn,K as zn,N as Hn}from"./projection-BA9M1R7d-DXrPfsKU.js";import{D as Pi}from"./Layer-ChoECxvZ--vVxyMLZ.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./Tile-D75RMC64-CM0vKD9b.js";import{a as Ni}from"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./cimSymbolUtils-CKIzBgMU-D2oNADot.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./editsZScale-BDsX6vv--CoeIQyxn.js";import"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import"./ArcGISService-BYA-y6X6-BtWUPppI.js";import"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./PortalLayer-CElnYuSQ-BV63HHSL.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import"./versionUtils-LZYZz-38-DgmFurh2.js";import"./styleUtils-ChrJTYIw-OCRItq_6.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function pi(e,t,i,o){let n=null,s=1e3;typeof t=="number"?(s=t,o=i):(n=t??null,s=i);let l,d=0;const c=()=>{d=0,e.apply(o,l)},p=(...h)=>{n&&n.apply(o,h),l=h,s?d||(d=setTimeout(c,s)):c()};return p.remove=()=>{d&&(clearTimeout(d),d=0)},p.forceUpdate=()=>{d&&(clearTimeout(d),c())},p.hasPendingUpdates=()=>!!d,p}function Kt(e){switch(e?.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}function Un(e){return e?{backgroundImage:`url(${e})`}:{}}function Zn({action:e,feature:t}){const i=t?.attributes,o="image"in e?e.image:void 0;return o&&i?pe(o,i):o??""}const Gn="esri.widgets.Feature.support.featureUtils",ei=()=>Y.getLogger(Gn),Qn=/href=(""|'')/gi,Xn=/(\{([^{\r\n]+)\})/g,Jn=/'/g,Eo=/^\s*expression\//i,Yn=/(\n)/gi,Kn=/[\u00A0-\u9999<>&]/gim,es=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ts=/^(?:mailto:|tel:)/,To="relationships/",$i=ho("short-date-short-time");function xo(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}async function kt({type:e,value:t,event:i}){try{return typeof t=="function"?t(i):await t}catch(o){return void ei().error("error",`An error occurred when calling the "${e}" function`,{error:o,graphic:i.graphic,value:t})}}function ko(e=""){if(e)return!ts.test(e.trim().toLowerCase())}function hi(e){return!!e&&Eo.test(e)}function is(e,t){if(!t||!hi(t)||!e)return;const i=t.replace(Eo,"").toLowerCase();return e.find(({name:o})=>o.toLowerCase()===i)}function Lo(e,t){const i=is(t,e?.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function os(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function ns(e){return e.replaceAll(Qn,"")}function ut(e,t){const i=mi(t,e);return i?i.name:e}function ss(e,t){return e&&e.map(i=>ut(i,t))}function mi(e,t){return e&&typeof e.getField=="function"&&t?e.getField(t)??null:null}function Po(e){return`${e}`.trim()}function Ve({attributes:e,globalAttributes:t,layer:i,text:o,expressionAttributes:n,fieldInfoMap:s}){return o?ti({formattedAttributes:t,template:ds(o,{...t,...n,...e},i),fieldInfoMap:s}):""}function ti({formattedAttributes:e,template:t,fieldInfoMap:i}){return Po(ns(ct(ct(t,o=>os(o,i)),e)))}function rs(e,t,i=!1){const o=t[e];if(typeof o=="string"){const n="%27",s=(i?encodeURIComponent(o):o).replaceAll(Jn,n);t[e]=s}}function as(e,t=!1){const i={...e};return Object.keys(i).forEach(o=>rs(o,i,t)),i}function ls(e,t,i){const o=(t=Po(t))&&t[0]!=="{";return ct(e,as(i,o||!1))}function ii(e,t){return e.replaceAll(Xn,(i,o,n)=>{const s=mi(t,n);return s?`{${s.name}}`:o})}function ds(e,t,i){const o=ii(e,i);return o&&o.replaceAll(es,(n,s,l)=>ls(n,s||l,t))}function cs(e,t){if(typeof e=="string"&&t&&t.dateFormat==null&&(t.places!=null||t.digitSeparator!=null)){const i=Number(e);if(!isNaN(i))return i}return e}function No(e){return e!=null&&typeof e=="object"&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&(e.type==="feature"||e.type==="scene"||e.type==="subtype-sublayer"||e.type==="sublayer")&&"when"in e}function us(e){return e!=null&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function ps(e){return!!(e&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"type"in e)&&(e.type==="subtype-sublayer"&&"parent"in e&&e.parent&&typeof e.parent=="object"?"globalIdField"in e.parent:"globalIdField"in e)}function $o(e){return No(e)&&us(e)}function hs(e){return No(e)&&ps(e)}function ms(e,t){const{fieldInfos:i,fieldName:o,preventPlacesFormatting:n,layer:s,timeZone:l}=t,d=Ro(i,o),c=mi(s,o);if(d&&!Ti(o)){const h=c?.type,m=d.format?.dateFormat;if(h==="date"||h==="date-only"||h==="time-only"||h==="timestamp-offset"||m)return Fo(e,{format:m,fieldType:h,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:l,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}})}const p=d?.format;return typeof e=="string"&&Ti(o)&&p?fs(e,p):typeof(e=cs(e,p))=="string"||e==null||p==null?ht(e):Be(e,n?{...Tt(p),minimumFractionDigits:0,maximumFractionDigits:20}:Tt(p))}function fs(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?qt(e,",",", ",t):e.includes(";")?qt(e,";","; ",t):e.includes(" ")?qt(e," "," ",t):Be(Number(e),Tt(t))}function qt(e,t,i,o){return e.trim().split(t).map(n=>Be(Number(n),Tt(o))).join(i)}function Ro(e,t){if(e?.length&&t)return e.find(i=>i.fieldName?.toLowerCase()===t.toLowerCase())}function gs({fieldName:e,graphic:t,layer:i}){if(Ie(e)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:o}=i;if(!o||e!==o)return null;const n=i.getFeatureType(t);return n?n.name:null}function ys({fieldName:e,value:t,graphic:i,layer:o}){if(Ie(e)||!o||typeof o.getFieldDomain!="function")return null;const n=i&&o.getFieldDomain(e,{feature:i,excludeImpliedDomains:ci("esri-widget-legacy-field-domain-calculation")});return n&&n.type==="coded-value"?n.getName(t):null}function _s(e,t,i,o){const{creatorField:n,creationDateField:s,editorField:l,editDateField:d}=e;if(!t)return;const c=hn(o&&"preferredTimeZone"in o?o.preferredTimeZone:null,!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone,i,$i,"date"),p={...$i,...c},h=t[d];if(typeof h=="number"){const f=t[l];return{type:"edit",date:Ci(h,p),user:f}}const m=t[s];if(typeof m=="number"){const f=t[n];return{type:"create",date:Ci(m,p),user:f}}return null}function vs(e,t){const i=new Map;if(!e)return i;for(const o of e){if(!o.fieldName)continue;const n=ut(o.fieldName,t);o.fieldName=n,i.set(n.toLowerCase(),o)}return i}function Ri(e){const t=[];if(!e)return t;const{fieldInfos:i,content:o}=e;return i&&t.push(...i),o&&Array.isArray(o)&&o.forEach(n=>{if(n.type==="fields"){const s=n?.fieldInfos;s&&t.push(...s)}}),t}function fi(e){return e.replaceAll(Kn,t=>`&#${t.charCodeAt(0)};`)}function ht(e){return typeof e=="string"?e.replaceAll(Yn,'
'):e}function Oo(e){const{value:t,fieldName:i,fieldInfos:o,fieldInfoMap:n,layer:s,graphic:l,timeZone:d}=e;if(t==null)return"";const c=ys({fieldName:i,value:t,graphic:l,layer:s});if(c)return c;const p=gs({fieldName:i,graphic:l,layer:s});if(p)return p;if(n.get(i.toLowerCase()))return ms(t,{fieldInfos:o||Array.from(n.values()),fieldName:i,layer:s,timeZone:d});const h=s?.fieldsIndex?.get(i);return h&&($n(h)||bn(h))?Fo(t,{fieldType:h.type,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:d,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}}):ht(t)}function Bt({fieldInfos:e,attributes:t,layer:i,graphic:o,fieldInfoMap:n,relatedInfos:s,timeZone:l}){const d={};return s?.forEach(c=>As({attributes:d,relatedInfo:c,fieldInfoMap:n,fieldInfos:e,layer:i,timeZone:l})),t&&Object.keys(t).forEach(c=>{const p=t[c];d[c]=Oo({fieldName:c,fieldInfos:e,fieldInfoMap:n,layer:i,value:p,graphic:o,timeZone:l})}),d}async function Vo(e,t){const{layer:i,graphic:o,outFields:n,objectIds:s,returnGeometry:l,spatialReference:d}=e,c=s[0];if(typeof c!="number"&&typeof c!="string"){const h="Could not query required fields for the specified feature. The feature's ID is invalid.",m={layer:i,graphic:o,objectId:c,requiredFields:n};return ei().warn(h,m),null}if(!mn(i)?.operations?.supportsQuery){const h="The specified layer cannot be queried. The following fields will not be available.",m={layer:i,graphic:o,requiredFields:n,returnGeometry:l};return ei().warn(h,m),null}const p=i.createQuery();return p.objectIds=s,p.outFields=n?.length?n:[i.objectIdField],p.returnGeometry=!!l,p.returnZ=!!l,p.returnM=!!l,p.outSpatialReference=d,(await i.queryFeatures(p,t)).features[0]}async function ws(e){if(!e.expressionInfos?.length)return!1;const t=await Io(),{arcadeUtils:{hasGeometryFunctions:i}}=t;return i(e)}async function bs({graphic:e,popupTemplate:t,layer:i,spatialReference:o},n){if(!i||!t||(typeof i.load=="function"&&await i.load(n),!e.attributes))return;const s=i.objectIdField,l=e.attributes[s];if(l==null)return;const d=[l],c=await t.getRequiredFields(i.fieldsIndex),p=fn(c,e),h=p?[]:c.includes(s)?c:[...c,s],m=t.returnGeometry||await ws(t);if(p&&!m)return;const f=await Vo({layer:i,graphic:e,outFields:h,objectIds:d,returnGeometry:m,spatialReference:o},n);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function Ie(e=""){return!!e&&e.includes(To)}function Is(e){return e?`${To}${e.layerId}/${e.fieldName}`:""}function Oi({attributes:e,graphic:t,relatedInfo:i,fieldInfos:o,fieldInfoMap:n,layer:s,timeZone:l}){e&&t&&i&&Object.keys(t.attributes).forEach(d=>{const c=Is({layerId:i.relation.id.toString(),fieldName:d}),p=t.attributes[d];e[c]=Oo({fieldName:c,fieldInfos:o,fieldInfoMap:n,layer:s,value:p,graphic:t,timeZone:l})})}function As({attributes:e,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s}){e&&t&&(t.relatedFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})),t.relatedStatsFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})))}const Vi=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},So=({layer:e,method:t,query:i,definitionExpression:o})=>{if(!e.capabilities?.query?.supportsCacheHint||t==="attachments")return;const n=i.where!=null?i.where:null,s=i.geometry!=null?i.geometry:null;Vi(o)||Vi(n)||s?.type==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Fs=({query:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},Ms=({queryPayload:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Cs(e,t,i){return e&&t&&i?t.type==="sublayer"?Xe({layers:t.layer?.sublayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:i}):Xe({layers:e.allLayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:e.allTables,map:e,relatedLayer:t,relationship:i}):null}function Si(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(i=>i.isUtilityLayer(t)):null}function Di(e,t){return e?.allTables.find(i=>i.type==="feature"&&i.layerId===t.id&&i.url===t.layer?.url)}function Xe({map:e,relationship:t,relationship:{relatedTableId:i},relatedLayer:o,layers:n}){if(!n)return null;for(const s of n){if(s.type==="map-image"){const d=Xe({layers:s.sublayers,map:e,relatedLayer:o,relationship:t})||Xe({layers:s.subtables,map:e,relatedLayer:o,relationship:t});if(d)return d;continue}if(!$o(s))continue;if(o.type==="sublayer"){if(s!==o&&s.id===i)return s.isTable?Di(e,s):s;continue}const l=o.type==="scene"&&o.associatedLayer?o.associatedLayer.url:o.url;if(!l)return null;if(s.type!=="sublayer"){if(s!==o&&s.url===l&&s.layerId===i)return s}else if(s!==o&&s.layer?.url===l&&s.id===i)return s.isTable?Di(e,s):s}return null}const qi={editing:!1,operations:{add:!0,update:!0,delete:!0}},Do=ce.ofType(Nn);let ne=class extends ge{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...qi},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new Do,this.fileInfos=new ce,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(y(()=>this.graphic,()=>this._graphicChanged(),$))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...qi,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return t?.loaded&&"capabilities"in t&&t.capabilities&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new N("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId();if(typeof i!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const o=new Li({objectIds:[i],returnMetadata:!0}),n=[],s=e.queryAttachments(o).then(d=>d[i]||n).catch(()=>n);this._getAttachmentsPromise=s,this.notifyChange("state");const l=await s;return t.destroyAll(),l.length&&t.addMany(l),this._getAttachmentsPromise=null,this.notifyChange("state"),l}async addAttachment(e,t=this.graphic){const{_attachmentLayer:i,attachmentInfos:o,capabilities:n}=this;if(!t)throw new N("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new N("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!n.operations?.add)throw new N("invalid-capabilities","addAttachment(): add capabilities are required.");if(!i||typeof i.addAttachment!="function")throw new N("invalid-layer","addAttachment(): A valid layer is required.");const s=i.addAttachment(t,e).then(d=>this._queryAttachment(d.objectId,t)),l=await s;return o.add(l),l}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:o,capabilities:n}=this;if(!e)throw new N("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!n.operations?.delete)throw new N("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new N("invalid-layer","deleteAttachment(): A valid layer is required.");if(!o)throw new N("invalid-graphic","deleteAttachment(): A graphic is required.");const s=t.deleteAttachments(o,[e.id]).then(()=>e),l=await s;return i.remove(l),l.destroy(),l}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:o,graphic:n,capabilities:s}=this;if(!e)throw new N("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new N("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!s.operations?.update)throw new N("invalid-capabilities","updateAttachment(): Update capabilities are required.");const l=o.indexOf(t);if(!i||typeof i.updateAttachment!="function")throw new N("invalid-layer","updateAttachment(): A valid layer is required.");if(!n)throw new N("invalid-graphic","updateAttachment(): A graphic is required.");const d=i.updateAttachment(n,t.id,e).then(p=>this._queryAttachment(p.objectId)),c=await d;return o.splice(l,1,c),c}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const i={file:e,form:t};return this.fileInfos.add(i),i}updateFile(e,t,i=this.activeFileInfo){if(!e||!t||!i)return null;const o=this.fileInfos.indexOf(i);return o>-1&&this.fileInfos.splice(o,1,{file:e,form:t}),this.fileInfos.items[o]}deleteFile(e){const t=this.fileInfos.find(i=>i.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:i}=this;if(!e||!i?.queryAttachments)throw new N("invalid-attachment-id","Could not query attachment.");const o=this._getObjectId(t);if(typeof o!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const n=new Li({objectIds:[o],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(n).then(s=>s[o][0])}_getObjectId(e=this.graphic){return e?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>this.attachmentInfos.destroyAll()))}_setAttachmentLayer(){const{graphic:e}=this,t=xo(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};r([a()],ne.prototype,"capabilities",void 0),r([et("capabilities")],ne.prototype,"castCapabilities",null),r([a()],ne.prototype,"activeAttachmentInfo",void 0),r([a()],ne.prototype,"activeFileInfo",void 0),r([a({readOnly:!0,type:Do})],ne.prototype,"attachmentInfos",void 0),r([a()],ne.prototype,"fileInfos",void 0),r([a({type:je})],ne.prototype,"graphic",void 0),r([a()],ne.prototype,"mode",void 0),r([a({readOnly:!0})],ne.prototype,"state",null),r([a()],ne.prototype,"filesEnabled",void 0),r([a({readOnly:!0})],ne.prototype,"supportsResizeAttachments",null),ne=r([P("esri.widgets.Attachments.AttachmentsViewModel")],ne);const gi=ne;function Bi(e){const t=e.toLowerCase();return t==="image/bmp"||t==="image/emf"||t==="image/exif"||t==="image/gif"||t==="image/x-icon"||t==="image/jpeg"||t==="image/png"||t==="image/tiff"||t==="image/x-wmf"}function Es(e){const t=In("esri/themes/base/images/files/");return e?e==="text/plain"?`${t}text-32.svg`:e==="application/pdf"?`${t}pdf-32.svg`:e==="text/csv"?`${t}csv-32.svg`:e==="application/gpx+xml"?`${t}gpx-32.svg`:e==="application/x-dwf"?`${t}cad-32.svg`:e==="application/postscript"||e==="application/json"||e==="text/xml"||e==="model/vrml"?`${t}code-32.svg`:e==="application/x-zip-compressed"||e==="application/x-7z-compressed"||e==="application/x-gzip"||e==="application/x-tar"||e==="application/x-gtar"||e==="application/x-bzip2"||e==="application/gzip"||e==="application/x-compress"||e==="application/x-apple-diskimage"||e==="application/x-rar-compressed"||e==="application/zip"?`${t}zip-32.svg`:e.includes("image/")?`${t}image-32.svg`:e.includes("audio/")?`${t}sound-32.svg`:e.includes("video/")?`${t}video-32.svg`:e.includes("msexcel")||e.includes("ms-excel")||e.includes("spreadsheetml")?`${t}excel-32.svg`:e.includes("msword")||e.includes("ms-word")||e.includes("wordprocessingml")?`${t}word-32.svg`:e.includes("powerpoint")||e.includes("presentationml")?`${t}report-32.svg`:`${t}generic-32.svg`:`${t}generic-32.svg`}const we={close:"esri-icon-close",collapse:"esri-icon-collapse",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",handleVertical:"esri-icon-handle-vertical",icon:"esri-icon",left:"esri-icon-left",locateCircled:"esri-icon-locate-circled",noticeTriangle:"esri-icon-notice-triangle",pause:"esri-icon-pause",play:"esri-icon-play",plus:"esri-icon-plus",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",search:"esri-icon-search",swap:"esri-icon-swap",table:"esri-icon-table",trash:"esri-icon-trash",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomToObject:"esri-icon-zoom-to-object"},ji={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},L="esri-attachments",A={base:L,loaderContainer:`${L}__loader-container`,loader:`${L}__loader`,fadeIn:`${L}--fade-in`,container:`${L}__container`,containerList:`${L}__container--list`,containerPreview:`${L}__container--preview`,actions:`${L}__actions`,deleteButton:`${L}__delete-button`,addAttachmentButton:`${L}__add-attachment-button`,errorMessage:`${L}__error-message`,items:`${L}__items`,item:`${L}__item`,itemButton:`${L}__item-button`,itemMask:`${L}__item-mask`,itemMaskIcon:`${L}__item-mask--icon`,itemImage:`${L}__image`,itemImageResizable:`${L}__image--resizable`,itemLabel:`${L}__label`,itemFilename:`${L}__filename`,itemChevronIcon:`${L}__item-chevron-icon`,itemLink:`${L}__item-link`,itemLinkOverlay:`${L}__item-link-overlay`,itemLinkOverlayIcon:`${L}__item-link-overlay-icon`,itemEditIcon:`${L}__item-edit-icon`,itemAddIcon:`${L}__item-add-icon`,itemAddButton:`${L}__item-add-button`,formNode:`${L}__form-node`,fileFieldset:`${L}__file-fieldset`,fileLabel:`${L}__file-label`,fileName:`${L}__file-name`,fileInput:`${L}__file-input`,metadata:`${L}__metadata`,metadataFieldset:`${L}__metadata-fieldset`,progressBar:`${L}__progress-bar`},jt=window.CSS;let X=class extends oe{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...ji},this._supportsImageOrientation=jt&&jt.supports&&jt.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e?.viewModel||(e={viewModel:new gi,...e}),e}initialize(){this.addHandles([dt(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),dt(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),y(()=>this.viewModel?.mode,()=>this._modeChanged(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-CcSx2g4c.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"attachment"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...ji,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:add-attachment",this.messages.addErrorMessage,i)),i})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:delete-attachment",this.messages.deleteErrorMessage,i)),i})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(i=>(this._set("submitting",!1),this._set("error",null),e.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:update-attachment",this.messages.updateErrorMessage,i)),i})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){const t=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo?.file);return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:i}=t;return u("div",{class:this.classes(A.base,M.widget)},e?this._renderProgressBar():null,i==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?u("div",{class:A.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:i}=this.viewModel;return t==="add"?this._renderAddForm():t==="edit"?this._renderDetailsForm(i||e):this._renderAttachmentContainer()}_renderLoading(){return u("div",{class:A.loaderContainer,key:"loader"},u("div",{class:A.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?u("div",{class:A.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,o=this.visibleElements.cancelAddButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,M.buttonSmall,M.buttonHalf,e&&M.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,n=this.visibleElements.addSubmitButton?u("button",{class:this.classes(M.button,M.buttonSecondary,M.buttonSmall,M.buttonHalf,{[M.buttonDisabled]:i}),disabled:i,type:"submit"},this.messages.add):null,s=t?u("span",{class:A.fileName,key:"file-name"},t.name):null,l=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},u("fieldset",{class:A.fileFieldset},s,u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),n,o);return u("div",{class:A.formNode,key:"add-form-container"},l)}_renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:o,submitting:n}=this,{capabilities:s}=i,l=n||!o;let d,c,p,h;o?(d=o.type,c=o.name,p=o.size):e&&"file"in e?(d=e.file.type,c=e.file.name,p=e.file.size):e&&"contentType"in e&&(d=e.contentType,c=e.name,p=e.size,h=e.url);const m=s.editing&&s.operations?.delete&&t.deleteButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,A.deleteButton,{[M.buttonDisabled]:n}),disabled:n,key:"delete-button",onclick:b=>this._submitDeleteAttachment(b,e),type:"button"},this.messages.delete):void 0,f=s.editing&&s.operations?.update&&t.updateButton?u("button",{class:this.classes(M.button,M.buttonSmall,M.buttonThird,{[M.buttonDisabled]:l}),disabled:l,key:"update-button",type:"submit"},this.messages.update):void 0,g=this.visibleElements.cancelUpdateButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,M.buttonThird,{[M.buttonDisabled]:n}),disabled:n,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,v=s.editing&&s.operations?.update?u("fieldset",{class:A.fileFieldset,key:"file"},u("span",{class:A.fileName,key:"file-name"},c),u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},this.messages.changeFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,I=u("fieldset",{class:A.metadataFieldset,key:"size"},u("label",null,Pn(this.messagesUnits,p??0))),C=u("fieldset",{class:A.metadataFieldset,key:"content-type"},u("label",null,d)),_=h!=null?u("a",{class:A.itemLink,href:h,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),u("div",{class:A.itemLinkOverlay},u("span",{class:A.itemLinkOverlayIcon},u("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),T=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:b=>this._submitUpdateAttachment(b,e)},u("div",{class:A.metadata},I,C),v,u("div",{class:A.actions},m,g,f));return u("div",{class:A.formNode,key:"edit-form-container"},_,T)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,o=Es(t),n={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMaskIcon,A.itemMask),key:o},u("img",{alt:e,class:this.classes(n,A.itemImage),src:o,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel;if(!e)return null;const{contentType:o,name:n,url:s}=e;if(!i||!Bi(o))return this._renderGenericImageMask(n,o);const l=this._getCSSTransform(e),d=l?{transform:l,"image-orientation":"none"}:{},c=`${s}${s?.includes("?")?"&":"?"}w=${t}`,p={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMask),key:c},u("img",{alt:n,class:this.classes(p,A.itemImage),src:c,styles:d,title:n}))}_renderFile(e){const{file:t}=e;return u("li",{class:A.item,key:t},u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},t.name||this.messages.noTitle),u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:o}=this,{capabilities:n,supportsResizeAttachments:s}=i,{contentType:l,name:d,url:c}=e,p=this._renderImageMask(e,t==="list"?48:400),h=n.editing?u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}):null,m=[p,o==="preview"&&s&&Bi(l)?null:u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},d||this.messages.noTitle),h)],f=n.editing?u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},m):u("a",{class:A.itemButton,href:c??void 0,key:"details-link",rel:"noreferrer",target:"_blank"},m);return u("li",{class:A.item,key:e},f)}_renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:o,capabilities:n,fileInfos:s}=t,l=!!o?.length,d=!!s?.length,c={[A.containerList]:e!=="preview",[A.containerPreview]:e==="preview"},p=n.editing&&n.operations?.add&&i.addButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,A.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},u("span",{"aria-hidden":"true",class:this.classes(A.itemAddIcon,we.plus)}),this.messages.add):void 0,h=l?u("ul",{class:A.items,key:"attachments-list"},o.toArray().map(g=>this._renderAttachmentInfo({attachmentInfo:g,displayType:e}))):void 0,m=d?u("ul",{class:A.items,key:"file-list"},s.toArray().map(g=>this._renderFile(g))):void 0,f=d||l?void 0:u("div",{class:M.empty},this.messages.noAttachments);return u("div",{class:this.classes(A.container,c),key:"attachments-container"},h,m,f,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t.files?.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};r([a()],X.prototype,"capabilities",null),r([a()],X.prototype,"displayType",void 0),r([a({readOnly:!0})],X.prototype,"effectiveDisplayType",null),r([a()],X.prototype,"graphic",null),r([a()],X.prototype,"icon",null),r([a()],X.prototype,"label",null),r([a(),K("esri/widgets/Attachments/t9n/Attachments")],X.prototype,"messages",void 0),r([a(),K("esri/core/t9n/Units")],X.prototype,"messagesUnits",void 0),r([a({readOnly:!0})],X.prototype,"selectedFile",void 0),r([a({readOnly:!0})],X.prototype,"submitting",void 0),r([a({readOnly:!0})],X.prototype,"error",void 0),r([a({type:gi})],X.prototype,"viewModel",void 0),r([a()],X.prototype,"visibleElements",void 0),r([et("visibleElements")],X.prototype,"castVisibleElements",null),X=r([P("esri.widgets.Attachments")],X);const Ts=X;let nt=class extends gi{constructor(e){super(e),this.description=null,this.title=null}};r([a()],nt.prototype,"description",void 0),r([a()],nt.prototype,"title",void 0),nt=r([P("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],nt);const yi=nt;function _i({level:e,class:t,...i},o){const n=xs(e);return u(`h${n}`,{...i,"aria-level":String(n),class:xn(M.heading,t),role:"heading"},o)}function xs(e){return An(Math.ceil(e),1,6)}const Wt="esri-feature-element-info",zt={base:Wt,title:`${Wt}__title`,description:`${Wt}__description`};let Ze=class extends oe{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return u("div",{class:zt.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?u(_i,{class:zt.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?u("div",{class:zt.description,innerHTML:e,key:"description"}):null}};r([a()],Ze.prototype,"description",void 0),r([a()],Ze.prototype,"headingLevel",void 0),r([a()],Ze.prototype,"title",void 0),Ze=r([P("esri.widgets.Feature.support.FeatureElementInfo")],Ze);const mt=Ze,ks={base:"esri-feature-attachments"};let ye=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Ts,this.headingLevel=2,this.viewModel=new yi}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,$)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return u("div",{class:ks.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};r([a({readOnly:!0})],ye.prototype,"attachmentsWidget",void 0),r([a()],ye.prototype,"description",null),r([a()],ye.prototype,"displayType",null),r([a()],ye.prototype,"graphic",null),r([a()],ye.prototype,"headingLevel",void 0),r([a()],ye.prototype,"title",null),r([a({type:yi})],ye.prototype,"viewModel",void 0),ye=r([P("esri.widgets.Feature.FeatureAttachments")],ye);const Ls=ye;let Ee=class extends ge{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(y(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},$))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&t&&(kt({type:"content",value:i,event:{graphic:t}}),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const i=kt({type:"content",value:e,event:{graphic:t}});this._loadingPromise=i,this.notifyChange("state");const o=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",o))}};r([a({readOnly:!0})],Ee.prototype,"created",void 0),r([a()],Ee.prototype,"creator",void 0),r([a()],Ee.prototype,"destroyer",void 0),r([a({type:je})],Ee.prototype,"graphic",void 0),r([a({readOnly:!0})],Ee.prototype,"state",null),Ee=r([P("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],Ee);const Lt=Ee;function qo(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,o=Array.isArray(e)?e:Ps(e);i.push(...o)}}function Ps(e){return e.split(",").map(t=>t.trim())}function Bo(e){return e&&typeof e.render=="function"}function Ns(e){return e&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}const Ht="esri-feature-content",Ut={base:Ht,loaderContainer:`${Ht}__loader-container`,loader:`${Ht}__loader`};let Ge=class extends oe{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(o=>{ko(o.href)&&!o.hasAttribute("target")&&o.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return u("div",{class:Ut.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return u("div",{class:Ut.loaderContainer,key:"loader"},u("div",{class:Ut.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,key:e}):Bo(e)?u("div",{key:e},!e.destroyed&&e.render()):u("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};r([a()],Ge.prototype,"creator",null),r([a()],Ge.prototype,"graphic",null),r([a({type:Lt})],Ge.prototype,"viewModel",void 0),Ge=r([P("esri.widgets.Feature.FeatureContent")],Ge);const bt=Ge;let ve=class extends ge{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,i=[];return t?.forEach(o=>{if(!(!o.hasOwnProperty("visible")||o.visible))return;const n=o.clone();n.label=Lo(n,e),i.push(n)}),i}};r([a()],ve.prototype,"attributes",void 0),r([a({type:[sn]})],ve.prototype,"expressionInfos",void 0),r([a()],ve.prototype,"description",void 0),r([a({type:[uo]})],ve.prototype,"fieldInfos",void 0),r([a({readOnly:!0})],ve.prototype,"formattedFieldInfos",null),r([a()],ve.prototype,"title",void 0),ve=r([P("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],ve);const Rt=ve,$s=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function Rs(e,t){if(typeof t!="string"||!t)return t;const i=$s.find(c=>c.pattern.test(t));if(!i)return t;const o=t.match(i.pattern),n=o?.[2],s=ct(ct(i.label,{messages:e,hierPart:n}),{appName:i.appName}),l=i.target?` target="${i.target}"`:"",d=i.target==="_blank"?' rel="noreferrer"':"";return t.replace(i.pattern,`${s}`)}const yt="esri-feature-fields",_t={base:yt,fieldHeader:`${yt}__field-header`,fieldData:`${yt}__field-data`,fieldDataDate:`${yt}__field-data--date`};let he=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Rt,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new mt,this.addHandles(y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{class:_t.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:i}=this.viewModel,o=e.fieldName||"",n=e.label||o,s=i?i[o]==null?"":i[o]:"",l=!!e.format?.dateFormat,d=typeof s=="number"&&!l?this._forceLTR(s):Rs(this.messagesURIUtils,s),c={[_t.fieldDataDate]:l};return u("tr",{key:`fields-element-info-row-${o}-${t}`},u("th",{class:_t.fieldHeader,innerHTML:n,key:`fields-element-info-row-header-${o}-${t}`}),u("td",{class:this.classes(_t.fieldData,c),innerHTML:d,key:`fields-element-info-row-data-${o}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?u("table",{class:M.table,summary:this.messages.fieldsSummary},u("tbody",null,e.map((t,i)=>this._renderFieldInfo(t,i)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};r([a()],he.prototype,"attributes",null),r([a()],he.prototype,"description",null),r([a()],he.prototype,"expressionInfos",null),r([a()],he.prototype,"fieldInfos",null),r([a()],he.prototype,"title",null),r([a({type:Rt,nonNullable:!0})],he.prototype,"viewModel",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],he.prototype,"messages",void 0),r([a(),K("esri/widgets/support/t9n/uriUtils")],he.prototype,"messagesURIUtils",void 0),he=r([P("esri.widgets.Feature.FeatureFields")],he);const jo=he,Os={maximumFractionDigits:20};function Vs(e){return Be(e,Os)}const Ss="<",Ds=">";function qs(e,t,i,o){let n="";return t===0?n=`${Ss} `:t===i&&(n=`${Ds} `),n+Vs(e)}const Bs=new po([64,64,64]);function js(e,t){const i=[],o=e.length-1;return e.length===5?i.push(0,2,4):i.push(0,o),e.map((n,s)=>i.includes(s)?qs(n,s,o):null)}async function Ws(e,t,i){let o=!1,n=[],s=[];if(e.stops){const p=e.stops;n=p.map(h=>h.value),o=p.some(h=>!!h.label),o&&(s=p.map(h=>h.label))}const l=n[0],d=n[n.length-1];if(l==null&&d==null)return null;const c=o?null:js(n);return(await Promise.all(n.map(async(p,h)=>({value:p,color:e.type==="opacity"?await zs(p,e):(await w(async()=>{const{getColor:m}=await import("./visualVariableUtils-D3kZJRyn-5umqHW84.js");return{getColor:m}},__vite__mapDeps([8,3,4,9,10,11]),import.meta.url)).getColor(e,p),label:o?s[h]:c?.[h]??""})))).reverse()}async function zs(e,t,i){const o=new po(Bs),n=(await w(async()=>{const{getOpacity:s}=await import("./visualVariableUtils-D3kZJRyn-5umqHW84.js");return{getOpacity:s}},__vite__mapDeps([8,3,4,9,10,11]),import.meta.url)).getOpacity(t,e);return n!=null&&(o.a=n),o}function Hs(e){if(!e.colorStops)return[];const t=[...e.colorStops].filter(o=>o.color?.a>0);let i=t.length-1;if(t&&t[0]){const o=t[i];o&&o.ratio!==1&&(t.push(new qn({ratio:1,color:o.color})),i++)}return t.map((o,n)=>{let s="";return n===0?s=e.legendOptions?.minLabel||"low":n===i&&(s=e.legendOptions?.maxLabel||"high"),{color:o.color,label:s,ratio:o.ratio}}).reverse()}ho("short-date");async function le(e,t,i){Cn(e,t,()=>[]).push(...i)}async function Us(e){const t=new Map;if(!e)return t;if("visualVariables"in e&&e.visualVariables){const i=e.visualVariables.filter(o=>o.type==="color");for(const o of i){const n=(await Ws(o)??[]).map(s=>s.color);await le(t,o.field||o.valueExpression,n)}}if(e.type==="heatmap"){const i=Hs(e).map(o=>o.color);await le(t,e.field||e.valueExpression,i)}else if(e.type==="pie-chart"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e?.othersCategory?.color,We(e.backgroundFillSymbol,null)])}else if(e.type==="dot-density"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e.backgroundColor])}else if(e.type==="unique-value")if(e.authoringInfo?.type==="predominance")for(const i of e.uniqueValueInfos??[])await le(t,i.value.toString(),[We(i.symbol,null)]);else{const i=(e.uniqueValueInfos??[]).map(d=>We(d.symbol,null)),{field:o,field2:n,field3:s,valueExpression:l}=e;(o||l)&&await le(t,o||l,i),n&&await le(t,n,i),s&&await le(t,s,i)}else if(e.type==="class-breaks"){const i=e.classBreakInfos.map(s=>We(s.symbol,null)),{field:o,valueExpression:n}=e;await le(t,o??n,i)}else e.type==="simple"&&await le(t,"default",[We(e.symbol,null)]);return"defaultSymbol"in e&&e.defaultSymbol&&await le(t,"default",[We(e.defaultSymbol,null)]),t.forEach((i,o)=>{const n=ui(i.filter(Boolean),(s,l)=>JSON.stringify(s)===JSON.stringify(l));t.set(o,n)}),t}const Zs="esri.widgets.Feature.support.relatedFeatureUtils",Wi=()=>Y.getLogger(Zs),zi=new Map;function It(e){if(!Ie(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function Gs(e,t){if(!t.relationships)return null;let i=null;const{relationships:o}=t;return o.some(n=>n.id===parseInt(e,10)&&(i=n,!0)),i}function Qs({originRelationship:e,relationships:t,layerId:i}){return t.find(({relatedTableId:o,id:n})=>`${o}`===i&&n===e?.id)??null}function Xs(e,t){const i=t.toLowerCase();for(const o in e)if(o.toLowerCase()===i)return e[o];return null}function Js(e,t){const i=Gs(e,t);if(i)return{url:`${t.url}/${i.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Ys(e,t){if(!t||!e)return;const{features:i,statsFeatures:o}=e,n=i?.value;t.relatedFeatures=n?n.features:[];const s=o?.value;t.relatedStatsFeatures=s?s.features:[]}function Ks(e,t,i,o){const n=new Yt;return n.outFields=["*"],n.relationshipId=typeof t.id=="number"?t.id:parseInt(t.id,10),n.objectIds=[e.attributes[i.objectIdField]],n.gdbVersion=i.gdbVersion??null,n.historicMoment=i.historicMoment??null,i.queryRelatedFeatures?.(n,o)??Promise.resolve({})}function er(e,t,i){let o=0;const n=[];for(;oJSON.stringify(t.toJSON())===JSON.stringify(i.toJSON())):void 0}async function or(e,t,i,o){const n=i.layerId.toString(),{layerInfo:s,relation:l,relatedFields:d,outStatistics:c,url:p,sourceSpatialReference:h}=t,m=tr(d),f=ir(c);if(!s||!l)return null;const g=Qs({originRelationship:l,relationships:s.relationships,layerId:n});if(g?.relationshipTableId&&g.keyFieldInRelationshipTable){const I=(await Ks(e,g,i,o))[e.attributes[i.objectIdField]];if(!I)return null;const C=I.features.map(_=>_.attributes[s.objectIdField]);if(f?.length&&s.supportsStatistics){const _=new lt;_.where=er(s.objectIdField,C,1e3),_.outFields=m,_.outStatistics=f,_.sourceSpatialReference=h;const T={features:Promise.resolve(I),statsFeatures:Dt(p,_)};return qe(T)}}const v=g?.keyField;if(v){const I=Fn(lr(s.fields,v)),C=Xs(e.attributes,l.keyField),_=I?`${v}=${C}`:`${v}='${C}'`,T=i.historicMoment,b=i.gdbVersion,G=Dt(p,new lt({where:_,outFields:m,sourceSpatialReference:h,historicMoment:T,gdbVersion:b}),o),W=f?.length&&s.supportsStatistics?Dt(p,new lt({where:_,outFields:m,outStatistics:f,sourceSpatialReference:h}),o):null,q={features:G};return W&&(q.statsFeatures=W),qe(q)}return null}function nr(e,t){return Mn(e,{query:{f:"json"},signal:t?.signal})}function sr({relatedInfos:e,layer:t},i){const o={};return e.forEach((n,s)=>{const{relation:l}=n;if(!l){const m=new N("relation-required","A relation is required on a layer to retrieve related records.");throw Wi().error(m),m}const{relatedTableId:d}=l;if(typeof d!="number"){const m=new N("A related table ID is required on a layer to retrieve related records.");throw Wi().error(m),m}const c=`${t.url}/${d}`,p=zi.get(c),h=p??nr(c);p||zi.set(c,h),o[s]=h}),gn(qe(o),i)}function rr({graphic:e,relatedInfos:t,layer:i},o){const n={};return t.forEach((s,l)=>{s.layerInfo&&(n[l]=or(e,s,i,o))}),qe(n)}function ar({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields?.push(t),i.statisticType){const o=new Bn({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics?.push(o)}}function lr(e,t){if(e!=null){t=t.toLowerCase();for(const i of e)if(i&&i.name.toLowerCase()===t)return i}return null}const Hi={chartAnimation:!0};let H=class extends ge{constructor(e){super(e),this.abilities={...Hi},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Hi,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){const{mediaInfos:e,layer:t}=this,i=this.attributes??{},o=this.formattedAttributes??{},n=this.expressionAttributes??{},s=this.fieldInfoMap??new Map;return e?.map(l=>{const d=l?.clone();return d?(d.title=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.title}),d.caption=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.caption}),d.altText=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.altText}),d.type==="image"?d.value?(this._setImageValue({value:d.value,formattedAttributes:o,layer:t}),d.value.sourceURL?d:void 0):void 0:d.type==="pie-chart"||d.type==="line-chart"||d.type==="column-chart"||d.type==="bar-chart"?d.value?(this._setChartValue({value:d.value,chartType:d.type,attributes:i,formattedAttributes:o,layer:t,expressionAttributes:n}),d):void 0:null):null}).filter(Nt)??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:i,formattedAttributes:o,layer:n}=e,{linkURL:s,sourceURL:l}=i;if(l){const d=ii(l,n);i.sourceURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}if(s){const d=ii(s,n);i.linkURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:o,chartType:n,layer:s,expressionAttributes:l}=e,{popupTemplate:d,relatedInfos:c}=this,{fields:p,normalizeField:h}=t,m=s;if(t.fields=ss(p,m),h&&(t.normalizeField=ut(h,m)),!p.some(g=>!!(o[g]!=null||Ie(g)&&c?.size)))return;const f=d?.fieldInfos??[];p.forEach((g,v)=>{const I=t.colors?.[v];if(Ie(g))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:f,fieldName:g,formattedAttributes:o,chartType:n,value:t,color:I})]);const C=this._getChartOption({value:t,attributes:i,chartType:n,formattedAttributes:o,expressionAttributes:l,fieldName:g,fieldInfos:f,color:I});t.series.push(C)})}_getRelatedChartInfos(e){const{fieldInfos:t,fieldName:i,formattedAttributes:o,chartType:n,value:s,color:l}=e,d=[],c=It(i),p=c&&this.relatedInfos?.get(c.layerId.toString());if(!p)return d;const{relatedFeatures:h,relation:m}=p;if(!m||!h)return d;const{cardinality:f}=m;return h.forEach(g=>{const{attributes:v}=g;v&&Object.keys(v).forEach(I=>{I===c.fieldName&&d.push(this._getChartOption({value:s,attributes:v,formattedAttributes:o,fieldName:i,chartType:n,relatedFieldName:I,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:l}))})}),f==="one-to-many"||f==="many-to-many"?d:[d[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){const{value:t,attributes:i,formattedAttributes:o,expressionAttributes:n,fieldName:s,relatedFieldName:l,fieldInfos:d,chartType:c,hasMultipleRelatedFeatures:p,color:h}=e,m=this.layer,f=this.fieldInfoMap??new Map,{normalizeField:g,tooltipField:v}=t,I=g?Ie(g)?i[It(g).fieldName]:i[g]:null,C=hi(s)&&n&&n[s]!==void 0?n[s]:l&&i[l]!==void 0?i[l]:i[s]!==void 0?i[s]:o[s],_=new yn({fieldName:s,color:h,value:C===void 0?null:C&&I?C/I:C});if(Ie(s)){const q=f.get(s.toLowerCase()),ue=v&&f.get(v.toLowerCase()),ae=q?.fieldName??s,Vt=p&&v?It(v).fieldName:ue?.fieldName??v,on=p&&Vt?i[Vt]:o[Vt]??q?.label??q?.fieldName??l,nn=p&&l?i[l]:o[ae];return _.tooltip=this._getTooltip({label:on,value:nn,chartType:c}),_}const T=Ro(d,s),b=ut(s,m),G=v&&o[v]!==void 0?o[v]:Lo(T||new uo({fieldName:b}),this.popupTemplate?.expressionInfos),W=o[b];return _.tooltip=this._getTooltip({label:G,value:W,chartType:c}),_}};r([a()],H.prototype,"abilities",void 0),r([et("abilities")],H.prototype,"castAbilities",null),r([a()],H.prototype,"activeMediaInfoIndex",void 0),r([a({readOnly:!0})],H.prototype,"activeMediaInfo",null),r([a()],H.prototype,"attributes",void 0),r([a()],H.prototype,"description",void 0),r([a()],H.prototype,"fieldInfoMap",void 0),r([a()],H.prototype,"formattedAttributes",void 0),r([a()],H.prototype,"expressionAttributes",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfos",null),r([a()],H.prototype,"isAggregate",void 0),r([a()],H.prototype,"layer",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfoCount",null),r([a()],H.prototype,"mediaInfos",void 0),r([a()],H.prototype,"popupTemplate",void 0),r([a()],H.prototype,"relatedInfos",void 0),r([a()],H.prototype,"title",void 0),H=r([P("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],H);const Se=H,z="esri-feature-media",te={base:z,mediaContainer:`${z}__container`,mediaItemContainer:`${z}__item-container`,mediaItem:`${z}__item`,mediaItemText:`${z}__item-text`,mediaItemTitle:`${z}__item-title`,mediaItemCaption:`${z}__item-caption`,mediaNavigation:`${z}__item-navigation`,mediaPagination:`${z}__pagination`,mediaPaginationText:`${z}__pagination-text`,mediaPrevious:`${z}__previous`,mediaPreviousIconLTR:`${z}__previous-icon`,mediaPreviousIconRTL:`${z}__previous-icon--rtl`,mediaNext:`${z}__next`,mediaNextIconLTR:`${z}__next-icon`,mediaNextIconRTL:`${z}__next-icon--rtl`,mediaChart:`${z}__chart`,mediaPaginationButton:`${z}__pagination-button`,mediaPaginationIcon:`${z}__pagination-icon`,mediaChartRendered:`${z}__chart--rendered`},Zt=15,Fe="category",tt="value",dr="rgba(50, 50, 50, 1)",cr=250,ur=500,pr=200;let ie=class extends oe{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Se,this.messages=null,this._disposeChart=i=>{this._chartRootMap.get(i)?.dispose(),this._chartRootMap.delete(i)},this._createChart=async i=>{const{destroyed:o,viewModel:n}=this;if(o||!n||!i)return;const{createRoot:s}=await w(()=>import("./chartUtilsAm5-CtY-kHPy-BrLMKJ5b.js"),__vite__mapDeps([12,3,4,13,14,15]),import.meta.url),l=await s(i);this._chartRootMap.set(i,l),this._renderChart({mediaInfo:n.activeMediaInfo,root:l})}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),$),y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-CcSx2g4c.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:te.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:te.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:te.mediaNavigation},i,e>1?u("div",{class:te.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:te.mediaPaginationText},pe(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:te.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:te.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:te.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:o}=this.viewModel,{value:n,refreshInterval:s,altText:l,title:d,type:c}=e,{sourceURL:p,linkURL:h}=n,m=ko(h??void 0)?"_blank":"_self",f=m==="_blank"?"noreferrer":"",g=s?t:null,v=g?g.timestamp:0,I=g?g.sourceURL:p,C=u("img",{alt:l||d,key:`media-${c}-${i}-${o}-${v}`,src:I??void 0});return(h?u("a",{href:h,rel:f,target:m,title:d},C):null)??C}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:te.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:te.mediaItemContainer,key:"media-container"},u("div",{class:te.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,o=t?"chevron-left":"chevron-right",n=t?"media-previous":"media-next",s=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:te.mediaPaginationButton,key:n,onclick:s,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:te.mediaPaginationIcon,icon:o,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await w(()=>import("./chartCommon-rWfJsTPl-CYhSSylP.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),i=new Map;return e.forEach(o=>{o.color&&i.set(o,t(o.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await w(()=>import("./chartCommon-rWfJsTPl-CYhSSylP.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),t=new Map,i=this._getRenderer(),o="default";if(!i)return t;const n=await Us(i);return n.delete(o),Array.from(n.values()).every(s=>s?.length===1)&&Array.from(n.keys()).forEach(s=>{const l=n.get(s)?.[0]?.toCss(!0);l&&t.set(s,e(l))}),t}_handleMediaKeyup(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!On()}_getChartAnimationMS(){return this._canAnimateChart()?cr:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?ur:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:o,type:n}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:l,AnimatedThemeAm5:d,ColorSetAm5:c,ThemeAm5:p,esriChartColorSet:h}=await w(async()=>{const{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}=await import("./chartCommon-rWfJsTPl-CYhSSylP.js");return{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}},__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),m=p.new(t);m.rule("ColorSet").set("colors",h),m.rule("ColorSet").set("reuse",!0);const f=[s.new(t),m];kn()&&f.push(l.new(t)),this._canAnimateChart()&&f.push(d.new(t)),t.setThemes(f);const g=await this._getRendererColors(),v=await this._getSeriesColors(o.series),I=c.new(t,{}),C=v.get(o.series[0]),_=C?{lineSettings:{stroke:C}}:void 0,T=o.series.map((b,G)=>{const W=v.get(b)||g.get(b.fieldName)||I.getIndex(G);return{[Fe]:b.tooltip,[tt]:b.value,columnSettings:{fill:W,stroke:W},..._}}).filter(b=>n!=="pie-chart"||b.value!=null&&b.value>0);n==="pie-chart"?this._createPieChart(e,T):this._createXYChart(e,T)}_getDirection(){return be(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-CYhSSylP.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url);e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(dr)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:pr})}async _createPieChart(e,t){const{TooltipAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-CYhSSylP.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),{PieChartAm5:o,PieSeriesAm5:n}=await w(async()=>{const{PieChartAm5:v,PieSeriesAm5:I}=await import("./pieChart-qcxaoQkv-BVwfB1V3.js");return{PieChartAm5:v,PieSeriesAm5:I}},__vite__mapDeps([19,3,4,20,13,18,15]),import.meta.url),{mediaInfo:s,root:l}=e,{title:d}=s,c=5,p=s?.altText||s?.title||"",h=l.container.children.push(o.new(l,{ariaLabel:p,focusable:!0,paddingBottom:c,paddingTop:c,paddingLeft:c,paddingRight:c})),m=`{category}: {valuePercentTotal.formatNumber('0.00')}% + ({value})`,f=i.new(l,{labelText:m}),g=h.series.push(n.new(l,{name:d,valueField:tt,categoryField:Fe,tooltip:f}));g.ticks.template.set("forceHidden",!0),g.labels.template.set("forceHidden",!0),g.slices.template.states.create("active",{shiftRadius:c}),this._customizeChartTooltip(f),g.slices.template.setAll({ariaLabel:m,focusable:!0,templateField:"columnSettings"}),g.data.setAll(t),g.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle(te.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-CYhSSylP.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-B9OitsL0.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([21,13,3,4,18,15,20,17]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(m,{renderer:l.new(m,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(m,{renderer:c.new(m,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:_}));this._customizeChartTooltip(_),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarX",n.new(m,{orientation:"horizontal"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-CYhSSylP.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-B9OitsL0.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([21,13,3,4,18,15,20,17]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panY",wheelY:"zoomY"});const v=e.yAxes.push(s.new(m,{renderer:c.new(m,{inversed:!0}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.xAxes.push(d.new(m,{renderer:l.new(m,{inside:!1,inversed:be(this.container)}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryY}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:I,yAxis:v,valueXField:tt,categoryYField:Fe,tooltip:_}));this._customizeChartTooltip(_,"vertical"),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarY",n.new(m,{orientation:"vertical"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-CYhSSylP.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,LineSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}=await import("./xyChart-Ch-p5aUf-B9OitsL0.js");return{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}},__vite__mapDeps([21,13,3,4,18,15,20,17]),import.meta.url),{root:h,mediaInfo:m}=t,{value:f,title:g}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(h,{renderer:l.new(h,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(h,{renderer:c.new(h,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=i[0]?.lineSettings?.stroke,T=o.new(h,{getFillFromSprite:!_,labelText:C});_&&T.get("background")?.setAll({fill:_});const b=e.series.push(p.new(h,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:T}));b.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(T,"vertical"),f.series.length>Zt&&e.set("scrollbarX",n.new(h,{orientation:"horizontal"})),v.data.setAll(i),b.data.setAll(i),b.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:o}=await w(()=>import("./xyChart-Ch-p5aUf-B9OitsL0.js"),__vite__mapDeps([21,13,3,4,18,15,20,17]),import.meta.url),{root:n,mediaInfo:s}=e,{type:l}=s,d=s?.altText||s?.title||"",c=n.container.children.push(i.new(n,{ariaLabel:d,focusable:!0,panX:!0,panY:!0}));c.set("cursor",o.new(n,{})),l==="column-chart"&&await this._createColumnChart(c,e,t),l==="bar-chart"&&await this._createBarChart(c,e,t),l==="line-chart"&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle(te.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e?.type==="image"&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,o=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const n=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},o);this._refreshTimer=n}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[o,n=""]=e.split("#");return`${o}${i}timestamp=${t}${n?"#":""}${n}`}};r([a()],ie.prototype,"_refreshIntervalInfo",void 0),r([a()],ie.prototype,"attributes",null),r([a()],ie.prototype,"activeMediaInfoIndex",null),r([a()],ie.prototype,"description",null),r([a()],ie.prototype,"fieldInfoMap",null),r([a()],ie.prototype,"layer",null),r([a()],ie.prototype,"mediaInfos",null),r([a()],ie.prototype,"popupTemplate",null),r([a()],ie.prototype,"relatedInfos",null),r([a()],ie.prototype,"title",null),r([a({type:Se})],ie.prototype,"viewModel",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],ie.prototype,"messages",void 0),ie=r([P("esri.widgets.Feature.FeatureMedia")],ie);const Wo=ie,hr="esri.widgets.Feature.support.arcadeFeatureUtils",Ui=()=>Y.getLogger(hr);function mr(e){return typeof e=="string"?ht(fi(e)):Array.isArray(e)?fr(e):e?.declaredClass==="esri.arcade.Dictionary"?gr(e):e}function fr(e){return`
    ${e.map(t=>`
  • ${typeof t=="string"?ht(fi(t)):t}
  • `).join("")}
`}function gr(e){const t=e.keys().map(i=>{const o=e.field(i);return`${i}${typeof o=="string"?ht(fi(o)):o}`}).join("");return`${t}
`}function zo(){return w(()=>import("./arcade-CaGqU4sP-B2FrioW-.js"),__vite__mapDeps([22,3,4,23,24,25,26,27,28,29,30,11,8,9,10,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,5,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101]),import.meta.url)}function yr(e){return"createQuery"in e&&"queryFeatures"in e}async function _r({graphic:e,view:t,options:i}){const{isAggregate:o,layer:n}=e;if(!o||!n||t?.type!=="2d")return[];const s=await t.whenLayerView(n);if(!yr(s))return[];const l=s.createQuery(),d=e.getObjectId();l.aggregateIds=d!=null?[d]:[];const{features:c}=await s.queryFeatures(l,i);return c}function vr({layer:e,aggregatedFeatures:t,interceptor:i}){const{fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d}=e;return new Mo({fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d,interceptor:i,...e.type==="feature"?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:t})}async function Ho({expressionInfo:e,arcade:t,interceptor:i,spatialReference:o,map:n,graphic:s,location:l,view:d,options:c}){if(!e?.expression)return null;const{isAggregate:p}=s,h=(s.sourceLayer||s.layer)??void 0,m=p?"feature-reduction-popup":"popup",f=t.createArcadeProfile(m),g=t.createArcadeExecutor(e.expression,f).catch(b=>Ui().error("arcade-executor-error",{error:b,expressionInfo:e})),[v,I]=await Promise.all([_r({graphic:s,view:d,options:c}),g]);if(!I)return null;const C=m==="feature-reduction-popup"?vr({layer:h,aggregatedFeatures:v,interceptor:i}):void 0,_={...m==="feature-reduction-popup"?{$aggregatedFeatures:C}:{$datastore:h?.url,$layer:h!=null&&jn(h)?h:h?.type==="scene"&&h.associatedLayer!=null?h.associatedLayer:void 0,$map:n,$userInput:l,$graph:h?.type==="knowledge-graph-sublayer"?h?.parentCompositeLayer?.knowledgeGraph:void 0},$feature:s},T={abortSignal:c?.signal??void 0,interceptor:i??void 0,rawOutput:!0,spatialReference:o??void 0,timeZone:d?.timeZone};return await I.executeAsync(_,T).catch(b=>Ui().error("arcade-execution-error",{error:b,graphic:s,expressionInfo:e})).finally(()=>C?.destroy())}async function wr({expressionInfos:e,spatialReference:t,graphic:i,interceptor:o,map:n,view:s,location:l,options:d}){if(!e?.length)return{};const c=await zo(),p={};for(const f of e)p[`expression/${f.name}`]=Ho({expressionInfo:f,arcade:c,interceptor:o,spatialReference:t,map:n,graphic:i,location:l,view:s,options:d});const h=await qe(p),m={};for(const f in h)m[f]=mr(h[f].value);return m}const br=1;let se=class extends ge{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const i=t==="fields"?new Rt:t==="media"?new Se:t==="text"?new Lt:null;this._set("contentElementViewModel",i)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=pi(this._compile,br,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:o,spatialReference:n,map:s,location:l,view:d,_abortController:c}=this;if(!t||!i)return void this._set("contentElement",null);const p=await zo();if(c!==this._abortController)return;const h=await Ho({arcade:p,expressionInfo:t,graphic:i,location:l,interceptor:o,map:s,spatialReference:n,view:d});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const m=await h.castAsJsonAsync(c?.signal),f=m?.type,g=f==="media"?_n.fromJSON(m):f==="text"?go.fromJSON(m):f==="fields"?vn.fromJSON(m):null;g.type==="media"&&!g.mediaInfos||g.type==="fields"&&!g.fieldInfos||g.type==="text"&&!g.text?this._set("contentElement",null):this._set("contentElement",g)},this.addHandles([y(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),$),y(()=>[this.contentElement],()=>this._createVM(),$)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery(),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:i}=this;return e?"loading":t||i?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}};r([a()],se.prototype,"_abortController",void 0),r([a({type:rn})],se.prototype,"expressionInfo",void 0),r([a({type:je})],se.prototype,"graphic",void 0),r([a({readOnly:!0})],se.prototype,"contentElement",void 0),r([a({readOnly:!0})],se.prototype,"contentElementViewModel",void 0),r([a()],se.prototype,"interceptor",void 0),r([a({type:ai})],se.prototype,"location",void 0),r([a()],se.prototype,"spatialReference",null),r([a({readOnly:!0})],se.prototype,"state",null),r([a()],se.prototype,"map",null),r([a()],se.prototype,"view",void 0),se=r([P("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],se);const vi=se,Zi="esri-feature",Gi={base:`${Zi}-expression`,loadingSpinnerContainer:`${Zi}__loading-container`};let At=class extends oe{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new vi}initialize(){this.addHandles(y(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),$))}loadDependencies(){return Ae({loader:()=>w(()=>import("./calcite-loader-CtpHSU2--CSF9hYfM.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url)})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return u("div",{class:Gi.base},e==="loading"?this._renderLoading():e==="disabled"?null:this._contentWidget?.render())}_renderLoading(){return u("div",{class:Gi.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t?.type;this._destroyContentWidget();const o=e?i==="fields"?new jo({viewModel:e}):i==="media"?new Wo({viewModel:e}):i==="text"?new bt({viewModel:e}):null:null;this._contentWidget=o,this.scheduleRender()}};r([a({type:vi})],At.prototype,"viewModel",void 0),At=r([P("esri.widgets.Feature.FeatureExpression")],At);const Ir=At;var Qi;(function(e){e.TOO_SHORT="length-validation-error::too-short",e.TOO_LONG="length-validation-error::too-long"})(Qi||(Qi={}));const Ar=e=>{const t=[];if(e.formTemplate){const{description:i,title:o}=e.formTemplate;e.fields?.forEach(n=>{const s=o&&Ei(o,n.name),l=i&&Ei(i,n.name);(s||l)&&t.push(n.name)})}return t},Gt=100;let R=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await ke(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await ke(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=Ye(this._queryController,Gt),this._queryFeatureCountDebounced=Ye(this._queryFeatureCountController,Gt),this._queryPageDebounced=Ye(this._queryPageController,Gt),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.destroyAll(),this.destroyed||i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t?.signal}))))},this.addHandles([y(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),$),y(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),y(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,o=1,n=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,o),n))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(i=>{const o=i.clone();return o.field=ut(i.field,t),o}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&this.relationshipId!=null&&this.objectId!=null&&e?.supportsCount&&e?.supportsPagination)}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new ce}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e?.loaded&&t&&i?Cs(t,e,i)??null:null}get relationship(){const{relationshipId:e,layer:t}=this;return e!=null?t?.relationships?.find(({id:i})=>i===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new ce}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:i,objectId:o,_queryFeatureCountAbortController:n,canQuery:s,supportsCacheHint:l}=this;if(await e?.load(),await t?.load(),!s||!e||!t||o==null)return void this._set("featureCount",0);const d=t.createQuery(),{historicMoment:c,gdbVersion:p}=e,h=new Yt({cacheHint:l,gdbVersion:p,historicMoment:c,relationshipId:i,returnGeometry:!1,objectIds:[o],where:d.where??void 0}),m=await e.queryRelatedFeaturesCount(h,{signal:n?.signal});this._set("featureCount",m[o]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:i}=this;return t?e:i?e.slice(0,i):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:i,_queryPageAbortController:o,featureCount:n}=this;!i||t<2||!n||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:o,displayCount:n,layer:s,relationshipId:l,featurePage:d,featureCount:c,relatedLayer:p,supportsCacheHint:h}=this,{canQuery:m,objectId:f}=this;if(!m||!s||!p||f==null)return[];const g=i?((d-1)*o+c)%c:0,v=i?o:n,I=p.objectIdField,C=[...t.map(ae=>ae.field),...Ar(p),I].filter(Nt),_=t.map(ae=>`${ae.field} ${ae.order}`),T=p.createQuery(),{historicMoment:b,gdbVersion:G}=s,W=new Yt({orderByFields:_,start:g,num:v,outFields:C,cacheHint:h,historicMoment:b,gdbVersion:G,relationshipId:l,returnGeometry:!1,objectIds:[f],where:T.where??void 0}),q=await s.queryRelatedFeatures(W,{signal:e?.signal}),ue=q[f]?.features||[];return ue.forEach(ae=>{ae.sourceLayer=p,ae.layer=p}),ue}};r([a()],R.prototype,"_loaded",void 0),r([a()],R.prototype,"_queryAbortController",void 0),r([a()],R.prototype,"_queryPageAbortController",void 0),r([a()],R.prototype,"_queryFeatureCountAbortController",void 0),r([a({value:1})],R.prototype,"featurePage",null),r([a()],R.prototype,"featuresPerPage",void 0),r([a({readOnly:!0})],R.prototype,"orderByFieldsFixedCasing",null),r([a({readOnly:!0})],R.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],R.prototype,"canLoad",null),r([a({readOnly:!0})],R.prototype,"canQuery",null),r([a()],R.prototype,"description",void 0),r([a({readOnly:!0})],R.prototype,"itemDescriptionFieldName",null),r([a({value:3})],R.prototype,"displayCount",null),r([a({type:je})],R.prototype,"graphic",void 0),r([a()],R.prototype,"layer",void 0),r([a()],R.prototype,"map",void 0),r([a({readOnly:!0})],R.prototype,"objectId",null),r([a({readOnly:!0})],R.prototype,"objectIdField",null),r([a()],R.prototype,"orderByFields",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatures",null),r([a({readOnly:!0})],R.prototype,"relatedLayer",null),r([a({readOnly:!0})],R.prototype,"relationship",null),r([a()],R.prototype,"featureCount",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatureViewModels",null),r([a()],R.prototype,"relationshipId",void 0),r([a()],R.prototype,"showAllEnabled",void 0),r([a()],R.prototype,"state",null),r([a()],R.prototype,"title",void 0),R=r([P("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],R);const wi=R;var oi;const Ft="esri-feature",it=`${Ft}-relationship`,Me={base:it,listContainer:`${it}__list`,listItem:`${it}__list-item`,listItemHidden:`${it}__list-item--hidden`,listContainerQuerying:`${it}__list--querying`,featureObserver:`${Ft}__feature-observer`,stickySpinnerContainer:`${Ft}__sticky-loading-container`,loadingSpinnerContainer:`${Ft}__loading-container`},Xi={title:!0,description:!0};let U=oi=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new wi,this.messages=null,this.messagesCommon=null,this.visibleElements={...Xi},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:o,relatedFeatures:n,featuresPerPage:s,featurePage:l}=this.viewModel;i==="ready"&&o&&n.length>=s*l&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),dt(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-CcSx2g4c.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-CPviA1UK.js"),__vite__mapDeps([107,2,3,4,5,6,108,7,109,110,111,112,105,106,113,1,114,115,116,117,103,104,118]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-CL6sUu6o.js"),__vite__mapDeps([119,2,3,4,5,6,108,105,106,7,112,111,110,109,120,104,117,1,103]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--CSF9hYfM.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-Cw8GCh9D.js"),__vite__mapDeps([121,2,3,4,5,122,7,6,111,105,106,112,123,117,1]),import.meta.url)})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=wo(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:i,state:o}=this.viewModel;return!e&&!!t&&o==="ready"&&(t>i||i===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return pe(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...Xi,...e}}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(Me.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}async _selectRecord(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:i}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:i}=this;t.showAllEnabled=!0;const o=new oi({flowItems:e,featureVisibleElements:i,visibleElements:{title:!1,description:!1},viewModel:t});e.push(o)}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:Me.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:Me.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=be(this.container)?"chevron-left":"chevron-right";return u("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,i=e.title;e.description=t&&e.formattedAttributes?.global[t];const o=e.state==="loading";return u("calcite-list-item",{class:this.classes(Me.listItem,{[Me.listItemHidden]:o}),description:e.description??"",key:e.uid,label:i,onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?u("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return u("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return u("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:Me.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return u("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return u("div",{class:this.classes(Me.listContainer,{[Me.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(i=>{this.addHandles(y(()=>[i.title,i.state],()=>this.scheduleRender(),$),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};r([a()],U.prototype,"_relatedFeatureIntersectionObserverNode",void 0),r([a({readOnly:!0})],U.prototype,"displayShowAllButton",null),r([a({readOnly:!0})],U.prototype,"displayListItems",null),r([a()],U.prototype,"description",null),r([a({readOnly:!0})],U.prototype,"featureCountDescription",null),r([a()],U.prototype,"featureVisibleElements",void 0),r([a()],U.prototype,"flowItems",void 0),r([a()],U.prototype,"flowType",void 0),r([a()],U.prototype,"headingLevel",void 0),r([a()],U.prototype,"title",null),r([a({type:wi})],U.prototype,"viewModel",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],U.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],U.prototype,"messagesCommon",void 0),r([a()],U.prototype,"visibleElements",void 0),r([et("visibleElements")],U.prototype,"castVisibleElements",null),U=oi=r([P("esri.widgets.Feature.FeatureRelationship")],U);const Fr=U;var Ji;(function(e){e[e.RTJunctionJunctionConnectivity=1]="RTJunctionJunctionConnectivity",e[e.RTAttachment=2]="RTAttachment",e[e.RTContainment=3]="RTContainment",e[e.RTJunctionEdgeConnectivity=4]="RTJunctionEdgeConnectivity",e[e.RTEdgeJunctionEdgeConnectivity=5]="RTEdgeJunctionEdgeConnectivity"})(Ji||(Ji={})),new di({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation"});const vt=new di({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionMidspanConnectivity:"junction-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"}),Mr=Array.from({length:33},(e,t)=>2*t),Cr=new Map([[1,"connectivity"],[2,"containment"],[3,"attachment"],[4,"junction-edge-from-connectivity"],[5,"junction-midspan-connectivity"],[6,"junction-edge-to-connectivity"]]);new di({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});let me=class extends bo{constructor(e){super(e),this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};r([a({type:Number,json:{write:!0}})],me.prototype,"assetGroupCode",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"assetTypeCode",void 0),r([a({type:String,json:{write:!0}})],me.prototype,"globalId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"networkSourceId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"objectId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionFrom",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionTo",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"terminalId",void 0),me=r([P("esri.rest.networks.support.NetworkElement")],me);const Ke=me;let J=class extends bo{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return new Ke({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId)}readToNetworkElement(e,t){return new Ke({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId)}};r([a({type:String,json:{write:!0}})],J.prototype,"globalId",void 0),r([a({type:vt.apiValues,json:{type:vt.jsonValues,read:vt.read,write:vt.write}})],J.prototype,"associationType",void 0),r([a({type:Ke,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId"]}}})],J.prototype,"fromNetworkElement",void 0),r([Fi("fromNetworkElement")],J.prototype,"readFromNetworkElement",null),r([Mi("fromNetworkElement")],J.prototype,"writeFromNetworkElement",null),r([a({type:Ke,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId"]}}})],J.prototype,"toNetworkElement",void 0),r([Fi("toNetworkElement")],J.prototype,"readToNetworkElement",null),r([Mi("toNetworkElement")],J.prototype,"writeToNetworkElement",null),r([a({type:an,json:{write:!0}})],J.prototype,"geometry",void 0),r([a({type:String,json:{write:!0}})],J.prototype,"errorMessage",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"percentAlong",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"errorCode",void 0),r([a({type:Boolean,json:{write:!0}})],J.prototype,"isContentVisible",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"status",void 0),J=r([P("esri.rest.networks.support.Association")],J);const Er=J,V={fromGlobalId:"fromglobalid",fromNetworkSourceId:"fromnetworksourceid",fromTerminalId:"fromterminalid",toGlobalId:"toglobalid",toNetworkSourceId:"tonetworksourceid",toTerminalId:"toterminalid",associationType:"associationtype",globalId:"globalid",status:"status",isContentVisible:"iscontentvisible",percentAlong:"percentalong",assetGroup:"assetgroup",assetType:"assettype"},Yi=100;let E=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await ke(this._query(t)),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=Ye(this._queryController,Yi),this._queryFeatureCountDebounced=Ye(this._queryFeatureCountController,Yi)}initialize(){this.associationTypes?.forEach(e=>{e.open=!1}),this.addHandles([...this.associationTypes?.map(e=>y(()=>e.open,()=>{e.open&&this._queryDebounced(e)}))??[],y(()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery],()=>this._queryFeatureCountDebounced(),$)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&typeof this.globalId=="string"}get canQuery(){const e=this.layer?.capabilities?.query;return!!this.associationTypes&&typeof this.globalId=="string"&&!!e?.supportsPagination}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:e}=this;return e?.type==="subtype-sublayer"&&e?.parent?e.parent.globalIdField??null:e?.globalIdField??null}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o&&this.featureCount!==0?"ready":"disabled"}get utilityNetwork(){const{layer:e,map:t}=this;return e?.loaded&&t?e?.type==="subtype-sublayer"&&e?.parent?Si(t,e.parent)??null:Si(t,e)??null:null}get associationsLayer(){const{utilityNetwork:e}=this;return e?.loaded?new Mo({url:e.networkSystemLayers.associationsTableUrl,gdbVersion:e.gdbVersion}):null}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new ce}get structureAssociations(){return this._get("structureAssociations")||new ce}get contentAssociations(){return this._get("contentAssociations")||new ce}get containerAssociations(){return this._get("containerAssociations")||new ce}get connectivityAssociations(){return this._get("connectivityAssociations")||new ce}get associationFeatures(){return this._get("associationFeatures")||new Co}get associationViewModels(){return this._get("associationViewModels")||new Map}refresh(){this._queryFeatureCountDebounced()}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach(e=>e.destroyAll())}_generateGlobalIdWhereClause(e,t){const{globalId:i,networkSourceIdsInUse:o}=this,{associatedNetworkSourceId:n}=e,s=t.fieldsIndex.get(V.fromGlobalId),l=t.fieldsIndex.get(V.toGlobalId),d=t.fieldsIndex.get(V.fromNetworkSourceId),c=t.fieldsIndex.get(V.toNetworkSourceId),p=n!=null,h=`(${Array.from(o.values())})`,m=p?` AND ${c.name} = ${n} AND ${c.name} IN ${h}`:"",f=p?` AND ${d.name} = ${n} AND ${d.name} IN ${h}`:"";switch(e.type){case"connectivity":return`((${s.name} = '${i}'${m}) OR (${l.name} = '${i}'${f}))`;case"attachment":case"content":return`${s.name} = '${i}'${m}`;case"container":case"structure":return`${l.name} = '${i}'${f}`;default:return""}}_generateNetworkSourceIdWhereClause(e){const{networkSourceIdsInUse:t}=this,i=`(${Array.from(t.values())})`,o=e.fieldsIndex.get(V.fromNetworkSourceId),n=e.fieldsIndex.get(V.toNetworkSourceId);return`(${o.name} IN ${i} AND ${n.name} IN ${i})`}_generateAssociationTypeWhereClause(e,t){const i=t.fieldsIndex.get(V.associationType);switch(e.type){case"attachment":case"structure":return`${i.name} = 3`;case"connectivity":return`${i.name} IN (1, 4, 5, 6)`;case"container":case"content":return`${i.name} = 2`;default:return""}}_generateWhereClause(e,t){const i=t.fieldsIndex.get(V.status),o=`(${Mr.join(",")})`,n=`${i.name} IN ${o}`;return`(${this._generateGlobalIdWhereClause(e,t)} AND ${n} AND ${this._generateAssociationTypeWhereClause(e,t)})`}async _loadUtiltyNetworks(){const e=this.map;if(!e)return;await Promise.allSettled(e.utilityNetworks?.map(async o=>{await o.load()})??[]);const t=o=>{if("layerId"in o&&i.isUtilityLayer(o)){const n=i.getSourceIdByLayerId(o.layerId);n!==null&&this.networkSourceIdsInUse.add(n)}},i=this.utilityNetwork;this._set("networkSourceIdsInUse",new Set),e.allLayers.forEach(t),e.allTables.forEach(t)}async _findLayersBySourceId(e){const{utilityNetwork:t,map:i}=this,o=c=>{const p=c;return c.url&&p.layerId===n?c.url.replace(/\/\d+$/,"")===t?.featureServiceUrl:!1};await t?.load();const n=t.getLayerIdBySourceId(e),s=i.allLayers.filter(o),l=i.allTables.filter(o),d=s.concat(l).toArray();return await Promise.allSettled(d.map(c=>c.load())),d}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach(e=>e.removeAll()),this.associationFeatures.clear()}_getAssociationsByType(e){switch(e){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}_createAssociationFromFeature(e,t){if(!e)return null;const i=Cr.get(t.attributes[e.fieldsIndex.get(V.associationType).name]);return new Er({globalId:t.attributes[e.fieldsIndex.get(V.globalId).name],fromNetworkElement:new Ke({globalId:t.attributes[e.fieldsIndex.get(V.fromGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.fromNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.fromTerminalId).name]}),toNetworkElement:new Ke({globalId:t.attributes[e.fieldsIndex.get(V.toGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.toNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.toTerminalId).name]}),associationType:i,status:t.attributes[e.fieldsIndex.get(V.status).name],isContentVisible:t.attributes[e.fieldsIndex.get(V.isContentVisible).name],percentAlong:t.attributes[e.fieldsIndex.get(V.percentAlong).name]})}async _queryLayer(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=i!=null,c=o!=null,p="("+t.map(v=>`'${v}'`).join(", ")+")",h=d?` AND ${s?.name} = ${i}`:"",m=d&&c?` AND ${l?.name} = ${o}`:"",f=`${e.globalIdField} IN ${p}`+h+m,g=new lt({outFields:["*"],cacheHint:this.supportsCacheHint,where:f});return await this._queryAll(g,e,{signal:n?.signal})}async _createAssociationFeatureObjects(e,t,i,o,n,s){if(e.length===0)return[];const l=new Map;for(const[c,p]of t){const h=await this._findLayersBySourceId(c);for(const m of h)(await this._queryLayer(m,p,o,n,s)).forEach(f=>{if(f.getEffectivePopupTemplate()&&f.layer){const g=l.get(f.attributes[m.globalIdField])??[];g.push(f),l.set(f.attributes[m.globalIdField],g)}})}const d=[];return e.toArray().forEach(c=>{const p=c.fromNetworkElement.globalId===i?c.toNetworkElement:c.fromNetworkElement;(l.get(p.globalId)??[]).forEach(h=>{const m=this.utilityNetwork?.getTerminalById(p?.terminalId)?.name;d.push({association:c,feature:h,terminalName:m})})}),d}_parseFeatureObjects(e,t){e.forEach(i=>{const o=i?.feature,n=o.layer,s=t.get(n)??new ce;s.add(i),t.set(n,s)})}async _queryAll(e,t,i){const o=[];let n=0,s=!1;e.num=t.sourceJSON?.maxRecordCount??2e3;do{e.start=n;const l=await t.queryFeatures(e,i);o.push(...l.features),s=l.exceededTransferLimit,s&&(n+=l.features.length)}while(s);return o}async _queryAssociatedFeatureCount(e){const{layer:t,globalId:i,supportsCacheHint:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d}=this;if(await Promise.allSettled([t?.load(),l?.load(),s?.load()]),this._clearAssociations(),!(d&&t&&n&&s))return;const c=s.fieldsIndex.get(V.toGlobalId).name,p=s.fieldsIndex.get(V.fromGlobalId).name,h=n.map(_=>this._generateWhereClause(_,s)),m=this._generateNetworkSourceIdWhereClause(s),f=h.join(" OR "),g=new lt({outFields:["*"],cacheHint:o,returnGeometry:!1,where:`(${f}) AND (${m})`}),v=await this._queryAll(g,s,{signal:e?.signal}),I=new Map;n.forEach(_=>{I.set(_.type,[])}),v.forEach(_=>{const T=s.fieldsIndex.get(V.associationType);switch(_.attributes[T.name]){case 1:case 4:case 5:case 6:_.attributes[p]===i?I.get("connectivity").push(_.attributes[c]):I.get("connectivity").push(_.attributes[p]),this.connectivityAssociations.add(this._createAssociationFromFeature(s,_));break;case 2:_.attributes[p]===i?(I.get("content").push(_.attributes[c]),this.contentAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("container").push(_.attributes[p]),this.containerAssociations.add(this._createAssociationFromFeature(s,_)));break;case 3:_.attributes[p]===i?(I.get("attachment").push(_.attributes[c]),this.attachmentsAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("structure").push(_.attributes[p]),this.structureAssociations.add(this._createAssociationFromFeature(s,_)))}});const C=n.map(async _=>{const{associatedNetworkSourceId:T,associatedAssetGroup:b,associatedAssetType:G}=_,W=I.get(_.type),q=b!=null?await this._countAssociatedFeatures(T,W,b,G,e):W.length;switch(_.type){case"attachment":this._set("attachmentsFeatureCount",q);break;case"structure":this._set("structureFeatureCount",q);break;case"content":this._set("contentFeatureCount",q);break;case"container":this._set("containerFeatureCount",q);break;case"connectivity":this._set("connectivityFeatureCount",q)}});await Promise.allSettled(C)}async _countAssociatedFeatureCount(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=o!=null,c="("+t.map(f=>`'${f}'`).join(", ")+")",p=` AND ${s?.name} = ${i}`,h=d?` AND ${l?.name} = ${o}`:"",m=`${e.globalIdField} IN ${c}`+p+h;return e.queryFeatureCount({where:m,outFields:["*"],returnGeometry:!1},{signal:n?.signal})}async _countAssociatedFeatures(e,t,i,o,n){if(t.length===0)return 0;const s=(await this._findLayersBySourceId(e)).map(async l=>this._countAssociatedFeatureCount(l,t,i,o,n));return(await Promise.all(s)).reduce((l,d)=>l+d,0)}async _queryAssociatedFeatures(e,t){const{layer:i,globalId:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d,associationFeatures:c}=this;if(await Promise.allSettled([i?.load(),l?.load(),s?.load()]),!(d&&i&&n&&s))return;const p=this._getAssociationsByType(e.type),{associatedAssetGroup:h,associatedAssetType:m}=e,f=new Map;p.forEach(v=>{const{networkSourceId:I,elementGlobalId:C}=v.fromNetworkElement.globalId===o?{networkSourceId:v.toNetworkElement.networkSourceId,elementGlobalId:v.toNetworkElement.globalId}:{networkSourceId:v.fromNetworkElement.networkSourceId,elementGlobalId:v.fromNetworkElement.globalId},_=f.get(I)||[];_.push(C),f.set(I,_)});const g=await this._createAssociationFeatureObjects(p,f,o,h,m,t);this._parseFeatureObjects(g,c)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:e,canQuery:t}=this;t?(await this._queryAssociatedFeatureCount(e),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(e){await this._loadUtiltyNetworks();const{_queryAbortController:t}=this;this.featureCount&&(this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this.destroyed||await this._queryAssociatedFeatures(e,{signal:t?.signal}))}};r([a()],E.prototype,"_loaded",void 0),r([a()],E.prototype,"_queryAbortController",void 0),r([a()],E.prototype,"_queryPageAbortController",void 0),r([a()],E.prototype,"_queryFeatureCountAbortController",void 0),r([a({readOnly:!0})],E.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],E.prototype,"canLoad",null),r([a({readOnly:!0})],E.prototype,"canQuery",null),r([a()],E.prototype,"networkSourceIdsInUse",void 0),r([a()],E.prototype,"description",void 0),r([a({type:je})],E.prototype,"graphic",void 0),r([a()],E.prototype,"layer",void 0),r([a()],E.prototype,"map",void 0),r([a({readOnly:!0})],E.prototype,"objectId",null),r([a({readOnly:!0})],E.prototype,"objectIdField",null),r([a({readOnly:!0})],E.prototype,"globalId",null),r([a({readOnly:!0})],E.prototype,"globalIdField",null),r([a()],E.prototype,"featureCount",void 0),r([a()],E.prototype,"associationTypes",void 0),r([a()],E.prototype,"showAllEnabled",void 0),r([a()],E.prototype,"state",null),r([a()],E.prototype,"title",void 0),r([a({readOnly:!0})],E.prototype,"utilityNetwork",null),r([a({readOnly:!0})],E.prototype,"associationsLayer",null),r([a({readOnly:!0})],E.prototype,"attachmentsFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"structureFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"attachmentsAssociations",null),r([a({readOnly:!0})],E.prototype,"structureAssociations",null),r([a({readOnly:!0})],E.prototype,"contentFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"containerFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"contentAssociations",null),r([a({readOnly:!0})],E.prototype,"containerAssociations",null),r([a({readOnly:!0})],E.prototype,"connectivityFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"connectivityAssociations",null),r([a({readOnly:!0})],E.prototype,"associationFeatures",null),r([a({readOnly:!0})],E.prototype,"associationViewModels",null),E=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],E);const ft=E;let st=class extends ge{constructor(e){super(e),this.title=!0,this.description=!0}};r([a({type:Boolean,nonNullable:!0})],st.prototype,"title",void 0),r([a({type:Boolean,nonNullable:!0})],st.prototype,"description",void 0),st=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.VisibleElements")],st);const Ot=st;var ni;const rt="esri-feature",ze=`${rt}-relationship`,He={base:ze,listContainer:`${ze}__list`,listItem:`${ze}__list-item`,listItemHidden:`${ze}__list-item--hidden`,listContainerQuerying:`${ze}__list--querying`,featureObserver:`${rt}__feature-observer`,stickySpinnerContainer:`${rt}__sticky-loading-container`,loadingSpinnerContainer:`${rt}__loading-container`,expander:`${ze}__expander`,filterContainer:`${rt}__filter-container`};let S=ni=class extends oe{constructor(e,t){super(e,t),this.flowType="feature-utility-network-association-type",this.description=null,this.headingLevel=2,this.title=null,this.viewModel=new ft,this.parentFeatureViewModel=null,this.listType=null,this.selectedLayer=null,this.flowItems=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot,this._featuresPerPage=50,this._maxNumFeatures=1e3,this._currentFeaturePage=1,this._previewDisplayCount=3,this._associatedFeatureIntersectionObserverNode=null,this._associatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._tooltipReferenceMap=new Co,this._filterText=""}initialize(){this.addHandles([y(()=>[this._associatedFeatureIntersectionObserverNode],()=>this._handleAssociatedFeatureObserverChange())])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-CqMmwMwm.js"),__vite__mapDeps([124,2,3,4,5,6,111,112,105,106,7,108,117,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-CcSx2g4c.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),input:()=>w(()=>import("./calcite-input-BKRd7MCS-DmQD4QYo.js"),__vite__mapDeps([125,114,2,3,4,5,6,115,108,106,116,117,111,105,7,112,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--CSF9hYfM.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-CPviA1UK.js"),__vite__mapDeps([107,2,3,4,5,6,108,7,109,110,111,112,105,106,113,1,114,115,116,117,103,104,118]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-CL6sUu6o.js"),__vite__mapDeps([119,2,3,4,5,6,108,105,106,7,112,111,110,109,120,104,117,1,103]),import.meta.url),tooltip:()=>w(()=>import("./calcite-tooltip-63c9fmIw-DjinfNBS.js"),__vite__mapDeps([126,2,3,4,5,6,127,113,104,123,128]),import.meta.url)})}destroy(){this._tooltipReferenceMap.clear()}get _numAssociatedFeatures(){const e=this.viewModel.associationViewModels;return this.selectedLayer?e.get(this.selectedLayer).length:0}set currentFeaturePage(e){const{_featuresPerPage:t,_numAssociatedFeatures:i}=this,o=1,n=Math.ceil(i/t)||1;this._currentFeaturePage=Math.max(Math.min(e,n),o)}get currentFeaturePage(){return this._currentFeaturePage}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:o}=this.parentFeatureViewModel??{};return u("div",{class:this.classes(He.base,M.widget)},t==="loading"||t==="querying"||o==="loading"?this._renderLoading():u("calcite-list",null,i&&this.selectedLayer?u(Ao,null,this._renderFilter(),this._renderAssociatedFeatureListPage(),this._renderFeatureObserver()):Array.from(e.keys(),n=>this._renderTypeList(n,e.get(n)))))}_renderFilter(){return u("div",{class:He.filterContainer,key:"filter"},u("calcite-input",{icon:"search",placeholder:this.messages.associationFilterPlaceholder,type:"search",onCalciteInputInput:e=>{this._filterText=e.target.value.trim().toLowerCase(),this._currentFeaturePage=1}}))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:o}=this;if(!t||!e)return;i.showAllEnabled=!0;const n=new ni({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:o,visibleElements:{title:!1,description:!1},viewModel:i});t.push(n)}_renderAssociatedFeatureListPage(){const{currentFeaturePage:e,_featuresPerPage:t,_maxNumFeatures:i,_filterText:o}=this,n=Math.min(e*t,i),s=this.viewModel.associationViewModels.get(this.selectedLayer).filter(l=>xt(l.featureViewModel).toLowerCase().includes(o)).slice(0,n);return[...this._renderTooltips(s),...this._renderAssociatedFeatureList(s)]}async _handleAssociatedFeatureObserverChange(){this._associatedFeatureIntersectionObserverNode&&this._associatedFeatureIntersectionObserver.unobserve(this._associatedFeatureIntersectionObserverNode);const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._associatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._associatedFeatureIntersectionObserver.observe(this._associatedFeatureIntersectionObserverNode)}_associatedFeatureIntersectionObserverCreated(e){this._associatedFeatureIntersectionObserverNode=e}_renderFeatureObserver(){return u("div",{afterCreate:this._associatedFeatureIntersectionObserverCreated,bind:this,class:He.featureObserver,key:"feature-observer"})}_increaseFeaturePage(){this.currentFeaturePage++}_renderLoading(){return u("div",{class:He.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}isConnectivity(e){return["connectivity","junction-junction-connectivity","junction-edge-from-connectivity","junction-midspan-connectivity","junction-edge-to-connectivity"].includes(e.association.associationType)}_getConnectivityTooltip(e){switch(e){case"connectivity":case"junction-junction-connectivity":return this.messages.associationsJunctionJunction;case"junction-edge-from-connectivity":return this.messages.associationsJunctionEdgeFrom;case"junction-midspan-connectivity":return this.messages.associationsJunctionEdgeMidspan;case"junction-edge-to-connectivity":return this.messages.associationsJunctionEdgeTo;default:return""}}_renderItemTooltip(e){const{_tooltipReferenceMap:t}=this;return this.isConnectivity(e)?u("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,referenceElement:t.get(e.featureViewModel.uid)},this._getConnectivityTooltip(e.association.associationType)):null}_renderConnectivityIcon(e,t){let i;switch(e){case"junction-edge-from-connectivity":i="connection-end-left";break;case"junction-edge-to-connectivity":i="connection-end-right";break;case"junction-midspan-connectivity":i="connection-middle";break;default:i="connection-to-connection"}return u("calcite-icon",{afterCreate:o=>this._tooltipReferenceMap.set(t,o),afterRemoved:()=>this._tooltipReferenceMap.delete(t),icon:i,scale:"s",slot:"content-start"})}_formatPercentAlong(e){return`${Be(e.association.percentAlong,{style:"percent",maximumFractionDigits:2})}`}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=xt(t),o=t.state==="loading",n=this._findFlowItem(t),s=n<0&&this._isParentFeature(t),l=s||n>=0,d=this.isConnectivity(e),c=d&&e.association.associationType==="junction-midspan-connectivity";return u("calcite-list-item",{class:this.classes(He.listItem,{[He.listItemHidden]:o}),description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(s,n,t)},d?this._renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,c?u("calcite-chip",{scale:"s",slot:"content-end",value:e.association.percentAlong},this._formatPercentAlong(e)):null,this._renderChevronIconNode(l))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(o=>{"showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const o=this.flowItems.pop();o&&("showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,o=i?.layer;let n=null;o?.type==="subtype-sublayer"&&o.parent?n=o.parent.globalIdField??null:o&&"globalIdField"in o&&(n=o.globalIdField);const s=n?i?.attributes[n]:null,l=t.graphic,d=l?.layer;let c=null;d?.type==="subtype-sublayer"&&d.parent?c=d.parent.globalIdField??null:d&&"globalIdField"in d&&(c=d.globalIdField);const p=c?l?.attributes[c]:null;return s&&p&&s===p}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if(t.flowType!=="feature")return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(t=>this._renderItemTooltip(t))}_renderAssociatedFeatureList(e){return e.toArray().map(t=>this._renderAssociatedFeature(t))}_renderChevronIconNode(e){return u("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messages:i}=this,o=t.slice(0,this._previewDisplayCount),n=o.lengththis._showAllAssociations(e)},u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};r([a()],S.prototype,"flowType",void 0),r([a()],S.prototype,"description",void 0),r([a()],S.prototype,"headingLevel",void 0),r([a()],S.prototype,"title",void 0),r([a({type:ft})],S.prototype,"viewModel",void 0),r([a()],S.prototype,"parentFeatureViewModel",void 0),r([a()],S.prototype,"listType",void 0),r([a()],S.prototype,"selectedLayer",void 0),r([a()],S.prototype,"featureVisibleElements",void 0),r([a()],S.prototype,"flowItems",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],S.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],S.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],S.prototype,"visibleElements",void 0),r([a()],S.prototype,"_featuresPerPage",void 0),r([a()],S.prototype,"_maxNumFeatures",void 0),r([a()],S.prototype,"_numAssociatedFeatures",null),r([a()],S.prototype,"_currentFeaturePage",void 0),r([a()],S.prototype,"currentFeaturePage",null),r([a()],S.prototype,"_previewDisplayCount",void 0),r([a()],S.prototype,"_associatedFeatureIntersectionObserverNode",void 0),r([a()],S.prototype,"_tooltipReferenceMap",void 0),r([a()],S.prototype,"_filterText",void 0),S=ni=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociationType")],S);const Tr=S,Mt="esri-feature",Ue=`${Mt}-relationship`,ot={base:Ue,listContainer:`${Ue}__list`,listItem:`${Ue}__list-item`,listItemHidden:`${Ue}__list-item--hidden`,listContainerQuerying:`${Ue}__list--querying`,featureObserver:`${Mt}__feature-observer`,stickySpinnerContainer:`${Mt}__sticky-loading-container`,loadingSpinnerContainer:`${Mt}__loading-container`,expander:`${Ue}__expander`};let re=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=2,this.viewModel=new ft,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-CqMmwMwm.js"),__vite__mapDeps([124,2,3,4,5,6,111,112,105,106,7,108,117,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-CcSx2g4c.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--CSF9hYfM.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-Cw8GCh9D.js"),__vite__mapDeps([121,2,3,4,5,122,7,6,111,105,106,112,123,117,1]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-CPviA1UK.js"),__vite__mapDeps([107,2,3,4,5,6,108,7,109,110,111,112,105,106,113,1,114,115,116,117,103,104,118]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-CL6sUu6o.js"),__vite__mapDeps([119,2,3,4,5,6,108,105,106,7,112,111,110,109,120,104,117,1,103]),import.meta.url)})}destroy(){this._featureElementInfo=wo(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(ot.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:ot.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:ot.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_selectAssociationType(e){const{viewModel:t,flowItems:i,parentFeatureViewModel:o}=this;if(!i)return;const{associationTypes:n}=t;n.forEach(l=>{l.type===e.type?l.open=!0:l.open=!1});const s=new Tr({viewModel:t,parentFeatureViewModel:o,listType:e,title:this._getAssociationTypeTitle(e),featureVisibleElements:this.featureVisibleElements,description:this.parentFeatureViewModel?.title,flowItems:i});i.push(s)}_renderAssociationType(e){const t=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:t,value:e.type,onCalciteListItemSelect:()=>this._selectAssociationType(e)},u("calcite-chip",{scale:"s",slot:"content-end",value:e.type},this._getFeatureCount(e.type)),u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_getFeatureCount(e){switch(e){case"attachment":return this.viewModel.attachmentsFeatureCount;case"structure":return this.viewModel.structureFeatureCount;case"content":return this.viewModel.contentFeatureCount;case"container":return this.viewModel.containerFeatureCount;case"connectivity":return this.viewModel.connectivityFeatureCount}}_renderAssociations(e){return u("div",null,this._getFeatureCount(e.type)>0?this._renderAssociationType(e):null)}_renderContent(){const{state:e,associationTypes:t}=this.viewModel;return u("div",{class:this.classes(ot.listContainer,{[ot.listContainerQuerying]:e==="querying"}),key:"list-container"},e==="ready"?u("calcite-list",null,t.map(i=>this._renderAssociations(i))):null,this._renderStickyLoading())}};r([a()],re.prototype,"flowType",void 0),r([a()],re.prototype,"flowItems",void 0),r([a()],re.prototype,"parentFeatureViewModel",void 0),r([a()],re.prototype,"featureVisibleElements",void 0),r([a()],re.prototype,"description",null),r([a()],re.prototype,"headingLevel",void 0),r([a()],re.prototype,"title",null),r([a({type:ft})],re.prototype,"viewModel",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],re.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],re.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],re.prototype,"visibleElements",void 0),re=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],re);const xr=re;let kr=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=i=>{}),this.preRequestCallback||(this.preLayerQueryCallback=i=>{})}};var Qe;const Lr=1,Ki="content-view-models",eo="relationship-view-models",Pr="association-view-models",to={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let O=Qe=class extends li(ge){constructor(e){super(e),this._error=null,this._featureAbortController=null,this._associationVMAbortController=null,this._graphicChangedThrottled=pi(this._graphicChanged,Lr,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...to},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=t=>{const{abilities:i}=this;return t.type==="attachments"&&!!i.attachmentsContent||t.type==="custom"&&!!i.customContent||t.type==="fields"&&!!i.fieldsContent||t.type==="media"&&!!i.mediaContent||t.type==="text"&&!!i.textContent||t.type==="expression"&&!!i.expressionContent||t.type==="relationship"&&!!i.relationshipContent||t.type==="utility-network-associations"&&!!i.utilityNetworkAssociationsContent},this.addHandles(y(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),$))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return vs(Ri(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return xo(this.graphic)}castAbilities(e){return{...to,...e}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._featureAbortController=new AbortController,this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){return!(!this._featureAbortController&&!this._associationVMAbortController)}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Se&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await i?.load();const o=i?.objectIdField;if(!o||!e||!i)return;const n=e?.attributes?.[o];if(n==null)return;const s=[n];if(!e.geometry){const l=await Vo({layer:i,graphic:e,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:t}),d=l?.geometry;d&&(e.geometry=d)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:e}=this;if(!e)return;const t=new AbortController;this._featureAbortController=t;try{await this._queryFeature({signal:t.signal})}catch(i){Et(i)||(this._error=i,Y.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===t&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:e}=this;e&&e.abort(),this._featureAbortController=null}_compileContentElement(e,t){return e.type==="attachments"?this._compileAttachments(e,t):e.type==="custom"?this._compileCustom(e,t):e.type==="fields"?this._compileFields(e,t):e.type==="media"?this._compileMedia(e,t):e.type==="text"?this._compileText(e,t):e.type==="expression"?this._compileExpression(e,t):e.type==="relationship"?this._compileRelationship(e,t):e.type==="utility-network-associations"?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((t,i)=>this._compileContentElement(t,i)).filter(Nt):typeof e=="string"?this._compileText(new go({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(eo),this.removeHandles(Ki),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),o=t?.getObjectId();return i!=null&&o!=null&&i===o}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:o,spatialReference:n,timeZone:s}=this;t?.filter(Boolean).forEach(l=>{e.some(d=>this._matchesFeature(d,l))||e.add(new Qe({abilities:{relationshipContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:l}))}),e.forEach(l=>{t?.find(d=>this._matchesFeature(l,d))||e.remove(l)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:o,contentElementViewModel:n}=e,s=o?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createFieldsVMParams(o,t))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createMediaVMParams(o,t))),s==="text"&&n.set(this._createTextVMParams(o)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:o,relationshipId:n,title:s,description:l}=e,{_sourceLayer:d,graphic:c,map:p}=this;if(!$o(d))return;const h=new wi({displayCount:i,graphic:c,orderByFields:o,relationshipId:n,layer:d,map:p,...this._compileTitleAndDesc({title:s,description:l})});return this.contentViewModels[t]=h,this.addHandles(dt(()=>h.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(h)),eo),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,o=t?.association.globalId;return i!=null&&o!=null&&i===o}async _setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:o,spatialReference:n,timeZone:s}=this;e.forEach((d,c)=>{const p=t.get(c);p?d.forEach(h=>{p.find(m=>this._matchesGlobalFeature(h,m))||(d.remove(h),d.length===0&&e.delete(c))}):(d.removeAll(),e.delete(c))}),t.forEach((d,c)=>{const p=e.get(c)||new ce;d?.filter(Boolean).forEach(h=>{p.some(m=>this._matchesGlobalFeature(m,h))||p.add({association:h.association,featureViewModel:new Qe({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:h.feature}),terminalName:h.terminalName})}),e.set(c,p)});const l=new AbortController;this._associationVMAbortController=l,await this._sortListObjectsByTitle(e,{signal:l.signal}),this._associationVMAbortController===l&&(this._associationVMAbortController=null)}async _sortListObjectsByTitle(e,t){for(const i of e.values()){const o=i.map(n=>yo(()=>n.featureViewModel.state==="ready",t?.signal));await Promise.all(o),i.sort(this._compareByFeatureTitle)}}_compareByFeatureTitle(e,t){const i=xt(e.featureViewModel),o=xt(t.featureViewModel);return i.localeCompare(o,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{title:i,description:o,associationTypes:n}=e,{_sourceLayer:s,graphic:l,map:d}=this;if(!hs(s))return;const c=new ft({graphic:l,associationTypes:n,layer:s,map:d,...this._compileTitleAndDesc({title:i,description:o})});return this.contentViewModels[t]=c,this.addHandles([y(()=>c.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(c.associationViewModels,c.associationFeatures,c.map))],Pr),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:o,map:n,spatialReference:s,view:l,location:d}=this,c=new vi({expressionInfo:i,graphic:o,interceptor:Qe.interceptor,map:n,spatialReference:s,view:l,location:d});return this.contentViewModels[t]=c,this.addHandles(y(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,t),$),Ki),e}_compileAttachments(e,t){const{graphic:i}=this,{description:o,title:n}=e;return this.contentViewModels[t]=new yi({graphic:i,...this._compileTitleAndDesc({title:n,description:o})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:o,destroyer:n}=e;return this.contentViewModels[t]=new Lt({graphic:i,creator:o,destroyer:n}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:o,graphic:n,formattedAttributes:s}=this,l=n?.attributes,d=this._expressionAttributes,c=s.global;return{title:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:e}),description:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,o=this.formattedAttributes,n={...o?.global,...o?.content[t]},s=e?.fieldInfos||i?.fieldInfos,l=s?.filter(({fieldName:h})=>!!h&&(hi(h)||Ie(h)||n.hasOwnProperty(h))),d=i?.expressionInfos,{description:c,title:p}=e;return{attributes:n,expressionInfos:d,fieldInfos:l,...this._compileTitleAndDesc({title:p,description:c})}}_compileFields(e,t){const i=e.clone(),o=new Rt(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=o,i.fieldInfos=o.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:o,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:l,_sourceLayer:d,_expressionAttributes:c}=this,p=this.formattedAttributes,h=o?.attributes??{},{description:m,mediaInfos:f,title:g}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:h,isAggregate:o?.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:c,mediaInfos:f,popupTemplate:s,relatedInfos:l,...this._compileTitleAndDesc({title:g,description:m})}}_compileMedia(e,t){const i=e.clone(),o=new Se(this._createMediaVMParams(e,t));return i.mediaInfos=o.formattedMediaInfos.slice(),this.contentViewModels[t]=o,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:o,_expressionAttributes:n}=this;if(e&&e.text){const s=t?.attributes??{},l=this.formattedAttributes?.global??{};e.text=Ve({attributes:s,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:o,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new Lt(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:o}=this;if(!e)return;const{lastEditInfoEnabled:n}=e,s=t?.editFieldsInfo;return n&&s?_s(s,i?.attributes,o,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:o,_expressionAttributes:n}=this,s=o?.attributes??{},l=this.formattedAttributes?.global??{};return Ve({attributes:s,fieldInfoMap:t,globalAttributes:l,expressionAttributes:n,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"content",value:e?.content,event:{graphic:t}}):null}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:o,_effectivePopupTemplate:n}=this,s=this.map,l=this.view,d=this.spatialReference,c=this.location;if(t!==this._featureAbortController||!o)return;await bs({graphic:o,popupTemplate:n,layer:i,spatialReference:d},e);const{content:{value:p},title:{value:h}}=await qe({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:m}}=await qe({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:wr({expressionInfos:n?.expressionInfos,spatialReference:d,graphic:o,map:s,interceptor:Qe.interceptor,view:l,options:e,location:c})});t===this._featureAbortController&&o&&(this._expressionAttributes=m,this._graphicExpressionAttributes={...o.attributes,...m},this._set("formattedAttributes",this._createFormattedAttributes(p)),this._set("title",this._compileTitle(h)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(p)||null))}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:o,graphic:n,relatedInfos:s,_sourceLayer:l,_fieldInfoMap:d,_graphicExpressionAttributes:c,timeZone:p}=this;i.content[t]=Bt({fieldInfos:o?.fieldInfos,graphic:n,attributes:{...c,...e.attributes},layer:l,fieldInfoMap:d,relatedInfos:s,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:o,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:l,_graphicExpressionAttributes:d,timeZone:c}=this;i.content[t]=Bt({fieldInfos:e.fieldInfos,graphic:o,attributes:{...d,...e.attributes},layer:s,fieldInfoMap:l,relatedInfos:n,timeZone:c})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:o,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:l,timeZone:d}=this,c=t?.fieldInfos,p={global:Bt({fieldInfos:c,graphic:i,attributes:l,layer:n,fieldInfoMap:s,relatedInfos:o,timeZone:d}),content:[]};return Array.isArray(e)&&e.forEach((h,m)=>{h.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p}),h.type==="media"&&this._createMediaFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,Ri(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:o,_sourceLayer:n}=this;o.clear();const s=n?.associatedLayer!=null?await n?.associatedLayer.load(i):n;if(!s||!e||!t.filter(c=>!!c.fieldName&&Ie(c.fieldName))?.length)return;t.forEach(c=>this._configureRelatedInfo(c,s));const l=await sr({relatedInfos:o,layer:s},i);Object.keys(l).forEach(c=>{const p=o.get(c.toString()),h=l[c]?.value;p&&h&&(p.layerInfo=h.data)});const d=await rr({graphic:e,relatedInfos:o,layer:s},i);Object.keys(d).forEach(c=>{Ys(d[c]?.value,o.get(c.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,o=It(e.fieldName||"");if(!o)return;const{layerId:n,fieldName:s}=o;if(!n)return;const l=i.get(n.toString())||Js(n,t);l&&(ar({relatedInfo:l,fieldName:s,fieldInfo:e}),this.relatedInfos.set(n,l))}};O.interceptor=new kr(Fs,Ms),r([a()],O.prototype,"_error",void 0),r([a()],O.prototype,"_featureAbortController",void 0),r([a()],O.prototype,"_associationVMAbortController",void 0),r([a({readOnly:!0})],O.prototype,"_effectivePopupTemplate",null),r([a({readOnly:!0})],O.prototype,"_fieldInfoMap",null),r([a({readOnly:!0})],O.prototype,"_sourceLayer",null),r([a()],O.prototype,"abilities",void 0),r([et("abilities")],O.prototype,"castAbilities",null),r([a({readOnly:!0})],O.prototype,"content",void 0),r([a({readOnly:!0})],O.prototype,"contentViewModels",void 0),r([a()],O.prototype,"description",void 0),r([a({type:Boolean})],O.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],O.prototype,"isTable",null),r([a({readOnly:!0})],O.prototype,"state",null),r([a({readOnly:!0})],O.prototype,"formattedAttributes",void 0),r([a({type:je,value:null})],O.prototype,"graphic",null),r([a({readOnly:!0})],O.prototype,"lastEditInfo",void 0),r([a({type:ai})],O.prototype,"location",void 0),r([a({readOnly:!0})],O.prototype,"relatedInfos",void 0),r([a()],O.prototype,"spatialReference",null),r([a()],O.prototype,"timeZone",null),r([a({readOnly:!0})],O.prototype,"title",void 0),r([a()],O.prototype,"map",null),r([a({readOnly:!0})],O.prototype,"waitingForContent",null),r([a()],O.prototype,"view",void 0),O=Qe=r([P("esri.widgets.Feature.FeatureViewModel")],O);const bi=O,Q="esri-feature",D={base:Q,container:`${Q}__size-container`,title:`${Q}__title`,main:`${Q}__main-container`,btn:`${Q}__button`,icon:`${Q}__icon`,content:`${Q}__content`,contentNode:`${Q}__content-node`,contentNodeText:`${Q}__content-node--text`,contentElement:`${Q}__content-element`,text:`${Q}__text`,lastEditedInfo:`${Q}__last-edited-info`,fields:`${Q}__fields`,fieldHeader:`${Q}__field-header`,fieldData:`${Q}__field-data`,fieldDataDate:`${Q}__field-data--date`,loadingSpinnerContainer:`${Q}__loading-container`},Uo=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=i=>Bo(i)&&!i.destroyed?u("div",{class:D.contentNode,key:i},i.render()):i instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:i,class:D.contentNode,key:i}):Ns(i)?u("div",{afterCreate:this._attachToNode,bind:i.domNode,class:D.contentNode,key:i}):null}_attachToNode(i){const o=this;i.appendChild(o)}};return t=r([P("esri.widgets.Feature.support.FeatureContentMixin")],t),t},io={title:!0,content:!0,lastEditedInfo:!0};let B=class extends Uo(oe){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...io},this.viewModel=new bi}initialize(){this.addHandles(y(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),$))}loadDependencies(){return Ae({notice:()=>w(()=>import("./calcite-notice-DeAGopAs-Cw8GCh9D.js"),__vite__mapDeps([121,2,3,4,5,122,7,6,111,105,106,112,123,117,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--CSF9hYfM.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url)})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...io,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=u("div",{class:D.container,key:"container"},this._renderTitle(),e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer());return u("div",{class:this.classes(D.base,M.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return u("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?u("div",{key:"error-title",slot:"title"},e.errorMessage):null,u("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return u("div",{class:D.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?u("div",{class:D.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?u(_i,{class:D.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?u("div",{class:D.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if(typeof e=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:u("div",{class:this.classes(D.contentNode,D.contentNodeText),key:`${t}-content`},i.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!i.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:o}=t.viewModel;return i==="loading"||o.length>0?u("div",{class:this.classes(D.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?u("div",{class:D.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:i}=e,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:D.contentElement,key:this._buildKey("custom-element",t)},o.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:o,user:n}=i,s=i.type==="edit"?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,l=pe(s,{date:o,user:n});return u("div",{class:this.classes(D.lastEditedInfo,D.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const i=e.text,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:this.classes(D.contentElement,D.text),key:this._buildKey("text-element",t)},o.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:i,viewModel:o}=this,n=o?.content,{contentViewModels:s}=o;if(Array.isArray(n))n.forEach((l,d)=>{if(l.type==="attachments"&&(this._contentWidgets[d]=new Ls({displayType:l.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:s[d]})),l.type==="fields"&&(this._contentWidgets[d]=new jo({viewModel:s[d]})),l.type==="media"&&(this._contentWidgets[d]=new Wo({viewModel:s[d]})),l.type==="text"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="custom"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="expression"&&(this._contentWidgets[d]=new Ir({viewModel:s[d]})),l.type==="relationship"){const c=new Fr({flowItems:i,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}if(l.type==="utility-network-associations"){const c=new xr({flowItems:i,parentFeatureViewModel:o,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}},this);else{const l=s[0];l&&!l.destroyed&&(this._contentWidgets[0]=new bt({viewModel:l}))}this.scheduleRender()}};r([a()],B.prototype,"flowType",void 0),r([a()],B.prototype,"graphic",null),r([a()],B.prototype,"defaultPopupTemplateEnabled",null),r([a()],B.prototype,"flowItems",void 0),r([a()],B.prototype,"headingLevel",void 0),r([a({readOnly:!0})],B.prototype,"isTable",null),r([a()],B.prototype,"icon",null),r([a()],B.prototype,"label",null),r([a()],B.prototype,"location",null),r([a(),K("esri/widgets/Feature/t9n/Feature")],B.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],B.prototype,"messagesCommon",void 0),r([a()],B.prototype,"spatialReference",null),r([a()],B.prototype,"timeZone",null),r([a({readOnly:!0})],B.prototype,"title",null),r([a()],B.prototype,"visibleElements",void 0),r([et("visibleElements")],B.prototype,"castVisibleElements",null),r([a()],B.prototype,"map",null),r([a()],B.prototype,"view",null),r([a({type:bi})],B.prototype,"viewModel",void 0),B=r([P("esri.widgets.Feature")],B);const Zo=B,Go=Object.freeze(Object.defineProperty({__proto__:null,default:Zo},Symbol.toStringTag,{value:"Module"}));let Pe=class extends ln.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([at(()=>{const t=this.screenLocationEnabled?this.view:null;return t?[t.size,t.type==="3d"?t.camera:t.viewpoint]:null},()=>this.notifyChange("screenLocation")),y(()=>this.screenLocation,(t,i)=>{t!=null&&i!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this,o=t?.spatialReference,n=o?Wn(e,o).geometry:null;return i&&n&&t?.ready?t.toScreen(n):null}};r([a()],Pe.prototype,"location",void 0),r([a()],Pe.prototype,"screenLocation",null),r([a()],Pe.prototype,"screenLocationEnabled",void 0),r([a()],Pe.prototype,"view",void 0),Pe=r([P("esri.widgets.support.AnchorElementViewModel")],Pe);const Qo=Pe;let Ct=class extends Qo{constructor(e){super(e),this.visible=!1}};r([a()],Ct.prototype,"visible",void 0),Ct=r([P("esri.widgets.Spinner.SpinnerViewModel")],Ct);const Xo=Ct,Qt="esri-spinner",Xt={base:Qt,spinnerStart:`${Qt}--start`,spinnerFinish:`${Qt}--finish`};let Ne=class extends oe{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Xo}initialize(){this.addHandles(y(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:i}=e??{};t&&(this.viewModel.location=t),this.visible=!0;const o=()=>this.hide();i&&i.catch(()=>{}).then(o)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,o=e&&i,n=!e&&i,s={[Xt.spinnerStart]:o,[Xt.spinnerFinish]:n},l=this._getPositionStyles();return u("div",{class:this.classes(Xt.base,s),styles:l})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=$t(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(t==null||e==null)return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};r([a()],Ne.prototype,"location",null),r([a()],Ne.prototype,"view",null),r([a({type:Xo})],Ne.prototype,"viewModel",void 0),r([a()],Ne.prototype,"visible",null),Ne=r([P("esri.widgets.Spinner")],Ne);const Nr=Ne,ee="esri-features",Z={icon:`${ee}__icon`,actionImage:`${ee}__action-image`,base:ee,container:`${ee}__container`,contentContainer:`${ee}__content-container`,contentFeature:`${ee}__content-feature`,flowItemCollapsed:`${ee}__flow-item--collapsed`,header:`${ee}__header`,footer:`${ee}__footer`,featureMenuObserver:`${ee}__feature-menu-observer`,actionExit:`${ee}__action--exit`,loader:`${ee}__loader`,featuresHeading:`${ee}__heading`,paginationActionBar:`${ee}__pagination-action-bar`,paginationPrevious:`${ee}__pagination-previous`,paginationNext:`${ee}__pagination-next`},De=ce.ofType({key:"type",defaultKeyValue:"button",base:dn,typeMap:{button:pt,toggle:_o}}),xe=new pt({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),oo=new pt({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:we.trash}),Je=new pt({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),Te=new _o({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:we.table,value:!1}),Ce=xe.clone();let $e=class extends oe{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenFeature=i=>{this.emit("open-feature",{feature:i})},this._handleZoomToFeature=i=>{this.emit("zoom-to-feature",{featureWidget:i})}}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DM2fRYrF.js"),__vite__mapDeps([129,120,2,3,4,5,6,104,108,111,105,106,7,117,112,1,103]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-Be9dclDf.js"),__vite__mapDeps([130,2,3,4,5,122,7,6,111,105,106,112,131,132,104,120,108,117,1,103,127,113,123,128]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-B4ny7Mme.js"),__vite__mapDeps([133,131,2,3,4,5,122,7,111,105,6,106,112,132,104,120,108,117,1,103,127,113,123,128]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-CdaGasS2.js"),__vite__mapDeps([134,2,3,4,5,6,108,111,105,106,7,112,135,132,104,120,117,1,103,127,113,123,128,118]),import.meta.url)})}render(){const{flowItems:e}=this,t=e?.toArray();return u(Ao,null,t?.map(i=>this._renderFlowItem(i)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e){const{messages:t,closable:i,closed:o}=this,n="graphic"in e&&!e.isTable,s=e.flowType==="feature-association",l=this._getExitMessage(e),d=t.selectFeature;return u("calcite-flow-item",{bind:this,closable:i,closed:o,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:c=>{c.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},u("calcite-action",{appearance:"transparent",bind:this,class:Z.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:l,title:l}),n?u("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,s?u("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},this._renderDefaultActions(e))):null,u("div",{class:Z.container},e.render()))}_renderDefaultActions(e){const t=this._getActionTitle(Ce);return u("calcite-action",{active:Ce.active,appearance:"solid",bind:this,"data-action-uid":Ce.uid,disabled:Ce.disabled,icon:Ce.icon??"question",indicator:Ce.indicator,key:`action-${Ce.uid}`,loading:Ce.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return i==="zoom-to-feature"?pe(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.featureCountDescription;case"feature-utility-network-association-type":return e.description??""}}};r([a()],$e.prototype,"flowItems",void 0),r([a(),K("esri/widgets/Features/t9n/Features")],$e.prototype,"messages",void 0),r([a()],$e.prototype,"closed",void 0),r([a()],$e.prototype,"closable",void 0),$e=r([P("esri.widgets.Features.FeaturesDrillIn")],$e);const $r=$e,Rr="OBJECTID";var Re;(function(e){e[e.size=22]="size",e[e.lineWidth=50]="lineWidth",e[e.maxSize=120]="maxSize",e[e.maxOutlineSize=80]="maxOutlineSize",e[e.tallSymbolWidth=20]="tallSymbolWidth"})(Re||(Re={}));const no=ci("android");ci("chrome")||no&&no>=4,En(),Re.size,Re.maxSize,Re.maxOutlineSize,Re.lineWidth,Re.tallSymbolWidth;function Jo(e){return e&&"opacity"in e?e.opacity*Jo(e.parent):1}async function so(e,t){if(!e)return;const i=e.sourceLayer,o=(t!=null&&t.useSourceLayer?i:e.layer)??i,n=Jo(o);if(e.symbol!=null&&(t==null||t.ignoreGraphicSymbol!==!0)){const b=e.symbol.type==="web-style"?await Vn(e.symbol,{...t,cache:t!=null?t.webStyleCache:null}):e.symbol.clone();return St(b,null,n),b}const s=t?.renderer??Or(o);let l=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!l)return;if(l=l.type==="web-style"?await l.fetchSymbol({...t,cache:t!=null?t.webStyleCache:null}):l.clone(),!s||!("visualVariables"in s)||!s.visualVariables?.length)return St(l,null,n),l;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&t?.arcade==null){const b={...t};b.arcade=await Io(),t=b}const{getColor:d,getOpacity:c,getAllSizes:p,getRotationAngle:h}=await w(()=>import("./visualVariableUtils-D3kZJRyn-5umqHW84.js"),__vite__mapDeps([8,3,4,9,10,11]),import.meta.url),m=[],f=[],g=[],v=[];for(const b of s.visualVariables)switch(b.type){case"color":m.push(b);break;case"opacity":f.push(b);break;case"rotation":v.push(b);break;case"size":b.target||g.push(b)}const I=!!m.length&&m[m.length-1],C=I?d(I,e,t):null,_=!!f.length&&f[f.length-1];let T=_?c(_,e,t):null;if(n!=null&&(T=T!=null?T*n:n),St(l,C,T),g.length){const b=p(g,e,t);await Sn(l,b)}for(const b of v)Dn(l,h(b,e,t),b.axis);return l}function Or(e){if(e)return"renderer"in e?e.renderer:void 0}const Vr="esri.widgets.Popup.PopupViewModel",Pt=()=>Y.getLogger(Vr),Sr=e=>{const{event:t,view:i,viewModel:o}=e,{action:n}=t;if(!n)return Promise.reject(new N("trigger-action:missing-arguments","Event has no action"));const{disabled:s,id:l}=n;if(!l)return Promise.reject(new N("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new N("trigger-action:invalid-action","Action is disabled"));if(l===xe.id)return Ko(o).catch(wn);if(l===Je.id)return qr(o);if(l===Te.id)return o.browseClusterEnabled=!o.browseClusterEnabled,o.featureMenuOpen=o.browseClusterEnabled,Promise.resolve();if(l===oo.id){o.visible=!1;const{selectedFeature:d}=o;if(!d)return Promise.reject(new N(`trigger-action:${oo.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):i?.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function Yo(e){const{selectedFeature:t,location:i,view:o}=e;return o?t??i??null:null}function Oe(e){return!!e&&e.isAggregate&&e.sourceLayer?.featureReduction?.type==="cluster"}async function Dr(e,t){if(t?.type!=="3d"||!e||e.declaredClass!=="esri.Graphic")return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let o=null;try{o=await i.whenGraphicBounds(e,{useViewElevation:!0})}catch{}return!o||!o.boundingBox||o.boundingBox[0]===o.boundingBox[3]&&o.boundingBox[1]===o.boundingBox[4]&&o.boundingBox[2]===o.boundingBox[5]}return!0}async function Ko(e,t){const{location:i,selectedFeature:o,view:n,zoomFactor:s}=e;await t?.viewModel?.updateGeometry();const l=t?.graphic,d=l?.geometry?l:Yo(e);if(!n||!d){const m=new N("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:d,view:n});throw Pt().error(m),m}const c=n.scale/s,p=l?.geometry??e.selectedFeature?.geometry??i,h=p!=null&&p.type==="point"&&await Dr(l??o,n);xe.active=!0,xe.disabled=!0;try{await e.zoomTo({target:{target:d,scale:h?c:void 0}})}catch(m){if(Et(m))return;const f=new N("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:l??o});Pt().error(f)}finally{xe.active=!1,xe.disabled=!1,e.zoomToLocation=null,h&&(e.location=p)}}async function qr(e){const{selectedFeature:t,view:i}=e;if(i?.type!=="2d"){const l=new N("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Pt().error(l),l}if(!t||!Oe(t)){const l=new N("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw Pt().error(l),l}const[o,n]=await Ii(i,t);Je.active=!0,Je.disabled=!0;const{extent:s}=await o.queryExtent(n);s&&await e.zoomTo({target:s}),Je.active=!1,Je.disabled=!1}async function Br(e){const{view:t,selectedFeature:i}=e;if(!t||!i)return;const[o,n]=await Ii(t,i),{extent:s}=await o.queryExtent(n);e.selectedClusterBoundaryFeature.geometry=s,t.graphics.add(e.selectedClusterBoundaryFeature)}async function jr(e){const{selectedFeature:t,view:i}=e;if(!i||!t)return;const[o,n]=await Ii(i,t);Te.active=!0,Te.disabled=!0;const{features:s}=await o.queryFeatures(n);Te.active=!1,Te.disabled=!1,Te.value=!0,e?.open({features:[t].concat(s),featureMenuOpen:!0})}async function Ii(e,t){const i=await e.whenLayerView(t.sourceLayer),o=i.createQuery(),n=t.getObjectId();return o.aggregateIds=n!=null?[n]:[],[i,o]}function Wr(e){Te.value=!1;const t=e.features.filter(i=>Oe(i));t.length&&(e.features=t)}const Jt="location-scale-handle",zr=()=>[xe.clone()],Hr=()=>[Je.clone(),Te.clone()];let wt=null;function Ur(e,t){return e==="building-scene"||t==="2d"&&(e==="map-image"||e==="tile"||e==="imagery"||e==="imagery-tile")}let F=class extends Rn(Qo){constructor(e){super(e),this._pendingPromises=new Ln,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new De,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new je({symbol:new cn({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=Ye(async t=>{const{spatialReference:i}=this,o=this.selectedFeature?.geometry?.type,n=this.location??t;if(o&&o!=="mesh"&&i&&n&&this.selectedFeature)if(o!=="point")try{const s=this.selectedFeature;let l=s.geometry;const d=this._getHighlightLayer(s),c=s.getObjectId();if(!d||!this.view)return;if(c){const p=this.view?.allLayerViews.find(f=>f.layer.uid===d.uid);if(!p||!("queryFeatures"in p))return;const h=p.createQuery();h.outSpatialReference=i,h.objectIds=[c],h.returnGeometry=!0;const{features:m}=await p.queryFeatures(h);l=m[0]?.geometry}if(!l||l.type==="mesh")return;if(l=zn(l,i),wt||(wt=await w(()=>import("./geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js"),__vite__mapDeps([136,3,4,61]),import.meta.url)),!await wt.intersects(l,n)){const p=(await wt.nearestCoordinate(l,n)).coordinate??n;this.selectedFeature===s&&(this.location=p)}}catch(s){Et(s)||Y.getLogger(this).error(s)}else this.location=Kt(this.selectedFeature.geometry)??n})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),y(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),y(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),y(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),y(()=>this.location,e=>this._locationChange(e)),y(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),y(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),y(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),y(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Sr({event:e,viewModel:this,view:this.view})),at(()=>!this.waitingForResult,()=>this._waitingForResultChange(),un),y(()=>[this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureVMs()),y(()=>this.view?.scale,()=>this._viewScaleChange()),at(()=>!this.visible,()=>this.browseClusterEnabled=!1),y(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new De;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:o,includeDefaultActions:n,selectedFeature:s}=this,l=n?i.concat(t):t,d=s&&(typeof s.getEffectivePopupTemplate=="function"&&s.getEffectivePopupTemplate(o)||s.popupTemplate),c=d?.actions;return(d?.overwriteActions?c:c?.concat(l)??l)?.filter(Boolean).forEach(p=>e.add(p)),e}get defaultActions(){const e=this._get("defaultActions")||new De;return e.removeAll(),e.addMany(Oe(this.selectedFeature)?Hr():zr()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:o,selectedFeatureIndex:n}=this,s=o&&t.length;s&&i&&n===-1?this.selectedFeatureIndex=0:s&&n!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator;e?.spatialReference?.isWGS84&&i&&(t=pn(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach(t=>this._pendingPromises.add(t)),e.reduce((t,i)=>t.finally(()=>i.then(o=>{this._pendingPromises.has(i)&&this._updateFeatures(o)}).finally(()=>this._pendingPromises.delete(i)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=Yo(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new N("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new N("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const o=["actionsMenuOpen","collapsed"];for(const n of o)delete t[n];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){Wr(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;e?.type==="2d"?Oe(t)?(await Br(this),await jr(this)):Y.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):Y.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(xe.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Nt);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Oe(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:o}=this;o&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:o,featureViewModels:n}=this;if(i===null)return;const s=((i-1)*o+t)%t,l=s+o;n.slice(s,l).forEach((d,c)=>{d&&(d.graphic??=e[s+c])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:o}=this;if(!e||!o)return;if(this.browseClusterEnabled)return this._selectedClusterFeature&&(o.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Oe(e)?void 0:(e.symbol=await so(e),this._selectedClusterFeature=e,void o.graphics.add(this._selectedClusterFeature));const n=e.sourceLayer?.type;if(n!=="map-image"&&n!=="imagery"&&n!=="imagery-tile"||(e.symbol=await so(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const s=o.center?.clone();s&&(this.location=s)}}else this.location=Kt(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:o,spatialReference:n,map:s,timeZone:l,location:d}=this;if(Oe(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const c=i.slice(),p=[];t.forEach((h,m)=>{if(!h)return;let f=null;if(c.some((g,v)=>(g&&g.graphic===h&&(f=g,c.splice(v,1)),!!f)),f)p[m]=f;else{const g=new bi({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n,graphic:h===e?h:null,location:d,map:s,view:o,timeZone:l});p[m]=g}}),c.forEach(h=>h&&!h.destroyed&&h.destroy()),this._set("featureViewModels",p)}async _getScreenPoint(e,t){const{spatialReference:i,view:o}=this;if(!o)return null;await o?.when();const n=e?.spatialReference;return n&&i?(await Hn(n,i,null,t),o.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:o}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:o}),{signal:o,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const o=new AbortController,{signal:n}=o;this._fetchFeaturesController=o;const s=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:n,event:i});return s.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),s}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:o}=this;this.removeHandles(Jt),this.addHandles([y(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(s=>{Et(s)||Y.getLogger(this).error(s)})),at(()=>!this.visible,()=>{this.removeHandles(Jt)},{once:!0})],Jt);const{pendingFeatures:n}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});o?.popup&&"open"in o.popup&&o.popup.open({location:t??void 0,promises:n})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:i?.type==="map-notes"||i?.type==="subtype-group"?i:t}_getHighlightTarget(e,t,i){if(Ur(t.type,i))return e;const o=e.getObjectId();if(o!=null)return o;const n=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||Rr:null,s=e.attributes;return s&&n&&s[n]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:i,activeFeature:o,visible:n}=this;if(!(o&&i&&t&&n))return;const s=this._getHighlightLayer(o);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(i,s);this._highlightActiveFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightActiveFeaturePromise===l&&this.activeFeature&&this.highlightEnabled))return;const c=d.highlight(this._getHighlightTarget(o,s,i.type));this.addHandles(c,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:i,view:o,visible:n}=this;if(!(t&&o&&i&&n))return;const s=this._getHighlightLayer(t);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(o,s);this._highlightSelectedFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightSelectedFeaturePromise===l&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=d.highlight(this._getHighlightTarget(t,s,o.type));this.addHandles(c,e)}_updateFeatures(e){const{features:t}=this,i=e.filter(o=>!t.includes(o));i?.length&&(this.features=t.concat(i))}};r([a()],F.prototype,"_fetchFeaturesController",void 0),r([a({type:De})],F.prototype,"actions",void 0),r([a({readOnly:!0})],F.prototype,"active",null),r([a()],F.prototype,"activeFeature",void 0),r([a({readOnly:!0})],F.prototype,"allActions",null),r([a()],F.prototype,"autoCloseEnabled",void 0),r([a()],F.prototype,"browseClusterEnabled",void 0),r([a()],F.prototype,"content",void 0),r([a({type:De,readOnly:!0})],F.prototype,"defaultActions",null),r([a({type:Boolean})],F.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],F.prototype,"featureCount",null),r([a()],F.prototype,"featurePage",void 0),r([a({value:[]})],F.prototype,"features",null),r([a()],F.prototype,"featuresPerPage",void 0),r([a()],F.prototype,"featureMenuOpen",void 0),r([a()],F.prototype,"featureViewModelAbilities",void 0),r([a({readOnly:!0})],F.prototype,"featureViewModels",void 0),r([a()],F.prototype,"highlightEnabled",void 0),r([a()],F.prototype,"includeDefaultActions",void 0),r([a({type:ai})],F.prototype,"location",null),r([a()],F.prototype,"map",null),r([a({readOnly:!0})],F.prototype,"pendingPromisesCount",null),r([a({readOnly:!0})],F.prototype,"promiseCount",null),r([a()],F.prototype,"promises",null),r([a({readOnly:!0})],F.prototype,"selectedClusterBoundaryFeature",void 0),r([a({value:null,readOnly:!0})],F.prototype,"selectedFeature",null),r([a({value:-1})],F.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],F.prototype,"selectedFeatureViewModel",null),r([a({readOnly:!0})],F.prototype,"state",null),r([a()],F.prototype,"timeZone",null),r([a()],F.prototype,"title",void 0),r([a()],F.prototype,"updateLocationEnabled",void 0),r([a()],F.prototype,"view",void 0),r([a()],F.prototype,"visible",void 0),r([a({readOnly:!0})],F.prototype,"waitingForContents",null),r([a({readOnly:!0})],F.prototype,"waitingForResult",null),r([a()],F.prototype,"zoomFactor",void 0),r([a()],F.prototype,"zoomToLocation",void 0),r([a()],F.prototype,"centerAtLocation",null),F=r([P("esri.widgets.Features.FeaturesViewModel")],F);const Ai=F;let fe=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],fe.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"flow",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"spinner",void 0),fe=r([P("esri.widgets.Features.FeaturesVisibleElements")],fe);const en=fe,ro="selected-index",Zr=0,ao="features-spinner";function lo(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let x=class extends Uo(oe){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([i])=>{i?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new ce,this._drillInWidget=new $r({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new De,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new Ai,this.visibleElements=new en,this._renderAction=(i,o)=>{const n=this._getActionTitle(i),{type:s,active:l,uid:d,disabled:c,indicator:p}=i;return i.visible?u("calcite-action",{active:s==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(i),indicator:p,key:`action-${o}`,loading:l,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(i)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=pi(()=>this._displaySpinner(),Zr),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,y(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),y(()=>this.viewModel?.active,i=>this._drillInWidget.closed=!i),y(()=>this.visibleElements?.closeButton,i=>this._drillInWidget.closable=i),y(()=>this.visibleElements?.spinner,i=>this._spinnerEnabledChange(i)),y(()=>this.viewModel?.view,(i,o)=>this._viewChange(i,o)),y(()=>this.viewModel?.view?.ready,(i,o)=>this._viewReadyChange(i??!1,o??!1)),y(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),y(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),y(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.title,i?.state]},()=>this._setTitleFromFeatureWidget()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.content,i?.state]},()=>this._setContentFromFeatureWidget()),y(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:i})=>this._openRelatedFeature(i)),this._drillInWidget.on("zoom-to-feature",({featureWidget:i})=>Ko(this.viewModel,i))])}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DM2fRYrF.js"),__vite__mapDeps([129,120,2,3,4,5,6,104,108,111,105,106,7,117,112,1,103]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-Be9dclDf.js"),__vite__mapDeps([130,2,3,4,5,122,7,6,111,105,106,112,131,132,104,120,108,117,1,103,127,113,123,128]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-B4ny7Mme.js"),__vite__mapDeps([133,131,2,3,4,5,122,7,111,105,6,106,112,132,104,120,108,117,1,103,127,113,123,128]),import.meta.url),button:()=>w(()=>import("./calcite-button-Cm9_TJei-CW2FD2Xf.js"),__vite__mapDeps([137,2,3,4,5,115,6,108,116,117,111,105,106,7,112,1,103,104]),import.meta.url),flow:()=>w(()=>import("./calcite-flow-CAdorlph-BXJ9a_4b.js"),__vite__mapDeps([138,2,3,4,5,7,111]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-CdaGasS2.js"),__vite__mapDeps([134,2,3,4,5,6,108,111,105,106,7,112,135,132,104,120,117,1,103,127,113,123,128,118]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-CPviA1UK.js"),__vite__mapDeps([107,2,3,4,5,6,108,7,109,110,111,112,105,106,113,1,114,115,116,117,103,104,118]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-CL6sUu6o.js"),__vite__mapDeps([119,2,3,4,5,6,108,105,106,7,112,111,110,109,120,104,117,1,103]),import.meta.url),"list-item-group":()=>w(()=>import("./calcite-list-item-group-CuQ2MPLW-BDMj-Jdi.js"),__vite__mapDeps([139,2,3,4,5,108,109]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--CSF9hYfM.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url)})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return t==="feature-association"||t==="feature-relationship"?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:n,map:s}=this,{selectedFeatureViewModel:l}=this.viewModel,d={title:!1};return l?(e?(e.viewModel=l,e.visibleElements=d):this._feature=new Zo({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:n,map:s,viewModel:l,visibleElements:d}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():Y.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):Y.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(ro);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(at(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return u("div",{bind:this,class:this.classes(Z.base,M.widget,M.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?u("div",{class:Z.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:u("div",{class:Z.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:n}=t;return u("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:pe(e.pageText,{index:Be(o+1),total:Be(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return u("calcite-action-bar",{class:Z.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},u("calcite-action-group",{scale:"s"},u("calcite-action",{appearance:"solid",class:Z.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),u("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,n=i.indexOf(e);return u("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},u("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(i=>{const o=i?.graphic;if(!o)return;const{layer:n,sourceLayer:s}=o,l=(lo(n)?n:null)||(lo(s)?s:null),d=t.get(l)??[];t.set(l,[...d,i])}),t}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel,t=this._groupResultsByLayer();return e.length?u("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(t.keys(),i=>{const o=t.get(i)?.map(s=>this._renderFeatureMenuItem(s)),n=i?i.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&n!==null?u("calcite-list-item-group",{heading:n,key:i?.uid||"map-graphics"},o):o})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?u("calcite-action",{active:e.type==="toggle"&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:n}=this,{title:s,active:l}=this.viewModel,d=t.heading&&s?s:"";return u("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[Z.contentFeature]:!0,[Z.flowItemCollapsed]:i}),closable:t.closeButton,closed:!l,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?u(_i,{class:this.classes(Z.featuresHeading,M.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:u("div",{class:this.classes(Z.container,Z.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:n,featureViewModels:s,pendingPromisesCount:l}=e;return t?u("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:pe(i.total,{total:s.length}),heading:i.selectFeature,key:"feature-menu",loading:e.waitingForContents,onCalciteFlowItemBack:d=>{d.preventDefault(),this._handleFeatureMenuBack()}},l>0?u("calcite-loader",{class:Z.loader,inline:!0,key:"feature-menu-loader",label:o.loading,slot:"header-actions-end"}):null,u("div",{class:Z.container},this._renderFeatureMenu()),u("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:Z.featureMenuObserver}),u("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},o.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?u("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=Zn({action:e,feature:this.selectedFeature}),n={[Z.icon]:!!t,[Z.actionImage]:!!o};return t&&(n[t]=!0),o||t?u("span",{"aria-hidden":"true",class:this.classes(Z.icon,n),key:"icon",styles:Un(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?u("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?u("div",{class:D.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(i==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=Kt(i);this.open({features:[t],location:o??void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await ke(vo(t));const i=e==="menu-flow-item"?this._featureMenuViewportNode:this._rootFlowItemNode;Tn(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,l=e.title??"",d=n==="zoom-to-feature"?pe(l,{messages:t}):n==="remove-selected-feature"?pe(l,{messages:o}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?pe(l,{messages:t}):e.title;return d&&s?pe(d,s):d??""}_onMainKeydown(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title=i?.state==="error"?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=y(()=>this.viewModel?.selectedFeatureIndex,(t,i)=>this._selectedFeatureIndexUpdated(t,i));this.addHandles(e,ro)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:n})=>n===i);o&&!o.disabled&&(o?.type==="toggle"&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,n=o.findIndex(l=>l.uid===i),s=o.at(n);s&&s.type==="toggle"&&(s.value=!s.value),this.viewModel.triggerAction(n)}_createSpinner(e){e&&(this._spinner=new Nr({view:e}),e.ui.add(this._spinner,{key:ao,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,ao),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};r([a()],x.prototype,"_drillInFlowItems",void 0),r([a()],x.prototype,"_hideActionText",null),r([a()],x.prototype,"_featureNavigationVisible",null),r([a()],x.prototype,"_isCollapsed",null),r([a()],x.prototype,"_collapseEnabled",null),r([a({readOnly:!0})],x.prototype,"active",null),r([a()],x.prototype,"collapsed",void 0),r([a()],x.prototype,"content",null),r([a()],x.prototype,"icon",null),r([a()],x.prototype,"featureMenuOpen",null),r([a()],x.prototype,"featureNavigationTop",void 0),r([a()],x.prototype,"features",null),r([a()],x.prototype,"goToOverride",null),r([a({type:De})],x.prototype,"headerActions",void 0),r([a()],x.prototype,"headingLevel",void 0),r([a()],x.prototype,"location",null),r([a()],x.prototype,"label",null),r([a()],x.prototype,"map",null),r([a(),K("esri/widgets/Features/t9n/Features")],x.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],x.prototype,"messagesCommon",void 0),r([a()],x.prototype,"promises",null),r([a()],x.prototype,"responsiveActionsEnabled",void 0),r([a({readOnly:!0})],x.prototype,"selectedFeature",null),r([a({readOnly:!0})],x.prototype,"selectedDrillInFeature",null),r([a()],x.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],x.prototype,"selectedFeatureWidget",null),r([a()],x.prototype,"spatialReference",null),r([a()],x.prototype,"title",null),r([a()],x.prototype,"timeZone",null),r([a()],x.prototype,"updateLocationEnabled",null),r([a()],x.prototype,"view",null),r([a({type:Ai}),qo(["triggerAction","trigger-action"])],x.prototype,"viewModel",void 0),r([a({type:en,nonNullable:!0})],x.prototype,"visibleElements",void 0),r([a()],x.prototype,"visible",null),x=r([P("esri.widgets.Features")],x);const Gr=x,de="esri-popup",Le=`${de}--is-docked`,j={base:de,baseHidden:`${de}--hidden`,main:`${de}__main-container`,shadow:`${de}--shadow`,isDocked:Le,isDockedTopLeft:`${Le}-top-left`,isDockedTopCenter:`${Le}-top-center`,isDockedTopRight:`${Le}-top-right`,isDockedBottomLeft:`${Le}-bottom-left`,isDockedBottomCenter:`${Le}-bottom-center`,isDockedBottomRight:`${Le}-bottom-right`,alignTopCenter:`${de}--aligned-top-center`,alignBottomCenter:`${de}--aligned-bottom-center`,alignTopLeft:`${de}--aligned-top-left`,alignBottomLeft:`${de}--aligned-bottom-left`,alignTopRight:`${de}--aligned-top-right`,alignBottomRight:`${de}--aligned-bottom-right`,pointer:`${de}__pointer`,pointerDirection:`${de}__pointer-direction`};let si=class extends Ai{constructor(e){super(e)}};si=r([P("esri.widgets.Popup.PopupViewModel")],si);const tn=si;let _e=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],_e.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"spinner",void 0),_e=r([P("esri.widgets.Popup.PopupVisibleElements")],_e);const ri=_e,Qr=200,co={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let k=class extends oe{constructor(e,t){super(e,t),this._dockAction=new pt({id:"popup-dock-action"}),this._featuresWidget=new Gr({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this._focusAbortController=null,this.alignment="auto",this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new tn,this.visibleElements=new ri}initialize(){this.addHandles([y(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled],()=>this._handleDockIcon(),$),y(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),$),y(()=>this.dockOptions,e=>{const{_dockAction:t}=this,i=this._featuresWidget.headerActions;i.remove(t),e.buttonEnabled&&i.add(t)},$),y(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),y(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),y(()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),y(()=>this.viewModel?.view?.size,(e,t)=>this._updateDockEnabledForViewSize(e,t)),y(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),y(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),y(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,$),y(()=>this._featureNavigationTop,e=>this._featuresWidget.featureNavigationTop=e,$),y(()=>this.headingLevel,e=>this._featuresWidget.headingLevel=e,$),y(()=>this.visibleElements.actionBar,e=>this._featuresWidget.visibleElements.actionBar=!!e,$),y(()=>this.visibleElements.closeButton,e=>this._featuresWidget.visibleElements.closeButton=!!e,$),y(()=>this.visibleElements.collapseButton,e=>this._featuresWidget.visibleElements.collapseButton=!!e,$),y(()=>this.visibleElements.heading,e=>this._featuresWidget.visibleElements.heading=!!e,$),y(()=>this.visibleElements.spinner,e=>this._featuresWidget.visibleElements.spinner=!!e,$),y(()=>this.visibleElements.featureNavigation,e=>this._featuresWidget.visibleElements.featureNavigation=!!e,$),y(()=>this.visibleElements.featureListLayerTitle,e=>this._featuresWidget.visibleElements.featureListLayerTitle=!!e,$),dt(()=>this._featuresWidget,"trigger-header-action",e=>{e.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(e){const t={...e};return e?.visibleElements!=null&&(t.visibleElements=new ri(e.visibleElements),e.collapseEnabled!=null&&(t.visibleElements.collapseButton=e.collapseEnabled),e.spinnerEnabled!=null&&(t.visibleElements.spinner=e.spinnerEnabled)),t}destroy(){this._dockAction.destroy(),this._featuresWidget?.destroy(),this._focusAbortController?.abort()}get _featureNavigationTop(){const{currentAlignment:e,currentDockPosition:t}=this;return e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right"}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}get active(){return this.viewModel.active}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get collapsed(){return this._featuresWidget.collapsed}set collapsed(e){this._featuresWidget.collapsed=e}get collapseEnabled(){return gt(Y.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(e){gt(Y.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||co}set dockOptions(e){const t={...co},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:l}=n;typeof l=="object"?n.breakpoint={...s,...l}:l&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get icon(){return"popup"}set icon(e){this._overrideIfSome("icon",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return gt(Y.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(e){gt(Y.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||Y.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||Y.getLogger(this).warn("Popup can only be focused when currently active."),this._handleFocus()}next(){return this.viewModel.next()}open(e){const t=!!e&&!!e.featureMenuOpen,i={collapsed:!!e&&!!e.collapsed,featureMenuOpen:t};this.set(i),this.viewModel.open(e),e?.shouldFocus&&this._handleFocus(!0)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i}=this,{active:o,screenLocation:n}=this.viewModel,s=o&&e,l=o&&!e,d=this.selectedFeature?.layer?.title,c=this.selectedFeature?.layer?.id,p={[j.alignTopCenter]:t==="top-center",[j.alignBottomCenter]:t==="bottom-center",[j.alignTopLeft]:t==="top-left",[j.alignBottomLeft]:t==="bottom-left",[j.alignTopRight]:t==="top-right",[j.alignBottomRight]:t==="bottom-right",[j.isDocked]:s,[j.shadow]:l,[j.isDockedTopLeft]:i==="top-left",[j.isDockedTopCenter]:i==="top-center",[j.isDockedTopRight]:i==="top-right",[j.isDockedBottomLeft]:i==="bottom-left",[j.isDockedBottomCenter]:i==="bottom-center",[j.isDockedBottomRight]:i==="bottom-right"};return u("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(j.base,p,{[j.baseHidden]:!n&&!e}),"data-layer-id":c,"data-layer-title":d,role:"presentation"},o?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:u("div",{class:j.pointer,key:"popup-pointer",role:"presentation"},u("div",{class:this.classes(j.pointerDirection,j.shadow)}))}_renderMainContainer(){const{dockEnabled:e}=this,t={[j.shadow]:e};return u("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(j.main,M.widget,t)},this._featuresWidget.render())}_getAnimationDurationMS(){const{_containerNode:e}=this;return e?1e3*parseFloat(window.getComputedStyle(e).animationDuration):Qr}async _handleFocus(e=!1){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;e&&await yo(()=>this.viewModel?.active===!0,{signal:t}),await ke(vo(t)),await ke($t(this._getAnimationDurationMS(),t)),this._featuresWidget.focus()}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const l=s.padding;return n==="right"&&o.x+i/2>s.width-l.right||n==="left"&&o.x-i/2s.height-l.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:l}=n;if(s==null||!l||!i)return"top-center";function d(b){return parseInt(b.replaceAll(/[^-\d.]/g,""),10)}const c=o?window.getComputedStyle(o,null):null,p=c?d(c.getPropertyValue("max-height")):0,h=c?d(c.getPropertyValue("height")):0,{height:m,width:f}=i.getBoundingClientRect(),g=f+t,v=Math.max(m,p,h)+t,I=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"right",view:l}),C=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"left",view:l}),_=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"top",view:l}),T=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"bottom",view:l});return C?_?"bottom-right":"top-right":I?_?"bottom-left":"top-left":_?T?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return be(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(e){if(e!=="auto")return e;const t=this.viewModel?.view,i=be(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_getDockIcon(){const e=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(e){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(e){this._mainContainerNode=e}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return t==="top-left"||t==="bottom-left"||t==="top-right"||t==="bottom-right"?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:l}=i,d=o/2,c=i.height-t,p=i.width-e;return n==="bottom-center"?{top:t+s-l.top,left:e-d-l.left}:n==="top-left"?{bottom:c+s-l.bottom,right:p+s-l.right}:n==="bottom-left"?{top:t+s-l.top,right:p+s-l.right}:n==="top-right"?{bottom:c+s-l.bottom,left:e+s-l.left}:n==="bottom-right"?{top:t+s-l.top,left:e+s-l.left}:n==="top-center"?{bottom:c+s-l.bottom,left:e-d-l.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(e==null||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:s.top!==void 0?`${s.top}px`:"auto",left:s.left!==void 0?`${s.left}px`:"auto",bottom:s.bottom!==void 0?`${s.bottom}px`:"auto",right:s.right!==void 0?`${s.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){e?this._wireUpView():t&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,l]=t,{width:d=0,height:c=0}=i??{};return o<=d&&s>d||o>d&&s<=d||n<=c&&l>c||n>c&&l<=c}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],l=[];s[0]=e[0]-o,s[1]=e[1]-n,l[0]=t[0]-o,l[1]=t[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(s,l,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n)||!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),l=t.hasOwnProperty("height")&&n<=(t.height??0);return s||l}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}};r([a({readOnly:!0})],k.prototype,"_featureNavigationTop",null),r([a()],k.prototype,"actions",null),r([a({readOnly:!0})],k.prototype,"active",null),r([a()],k.prototype,"alignment",void 0),r([a()],k.prototype,"autoCloseEnabled",null),r([a()],k.prototype,"defaultPopupTemplateEnabled",null),r([a()],k.prototype,"content",null),r([a()],k.prototype,"collapsed",null),r([a()],k.prototype,"collapseEnabled",null),r([a({readOnly:!0})],k.prototype,"currentAlignment",null),r([a({readOnly:!0})],k.prototype,"currentDockPosition",null),r([a()],k.prototype,"dockOptions",null),r([a()],k.prototype,"dockEnabled",void 0),r([a({readOnly:!0})],k.prototype,"featureCount",null),r([a()],k.prototype,"featureMenuOpen",null),r([a()],k.prototype,"features",null),r([a()],k.prototype,"goToOverride",null),r([a()],k.prototype,"headingLevel",void 0),r([a()],k.prototype,"highlightEnabled",null),r([a()],k.prototype,"icon",null),r([a()],k.prototype,"location",null),r([a()],k.prototype,"label",null),r([a(),K("esri/widgets/Popup/t9n/Popup")],k.prototype,"messages",void 0),r([a()],k.prototype,"promises",null),r([a({readOnly:!0})],k.prototype,"selectedFeature",null),r([a()],k.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],k.prototype,"selectedFeatureWidget",null),r([a()],k.prototype,"spinnerEnabled",null),r([a()],k.prototype,"title",null),r([a()],k.prototype,"updateLocationEnabled",null),r([a()],k.prototype,"view",null),r([a({type:tn}),qo(["triggerAction","trigger-action"])],k.prototype,"viewModel",void 0),r([a()],k.prototype,"visible",null),r([a({type:ri,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=r([P("esri.widgets.Popup")],k);const Fd=k;export{Fd as default}; diff --git a/main/assets/Popup-DFFZHG5j-DuBwb8-M.js b/main/assets/Popup-DFFZHG5j-DuBwb8-M.js deleted file mode 100644 index 5c0e54764..000000000 --- a/main/assets/Popup-DFFZHG5j-DuBwb8-M.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-icon-laqhdRBY-Bm5S9Lju.js","./icon-BXFbBbop-O5hL8B42.js","./themeUtils-YjM7iIiX-xQe6qdbF.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./dom-N58V0tYi-DBU3jlah.js","./observers-BigwqTsw-DJJPVpPW.js","./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./chartUtilsAm5-CtY-kHPy-Dkmz_Xm3.js","./Theme-rblUnB2V-BIrfCzYF.js","./Tooltip-B0HefZ7r-DsuX4aL4.js","./DefaultTheme-Bt5OI-Ht-D4nvY2Bb.js","./chartCommon-rWfJsTPl-B8T05uOT.js","./Button-MQvwxOnj-A6j60P2U.js","./ColorSet-DkIwOmgs-BZOv8dDH.js","./pieChart-qcxaoQkv-ulavfogw.js","./Tick-DUHqbpyB-BUwpVfeR.js","./xyChart-Ch-p5aUf-BHyHhQMG.js","./arcade-CaGqU4sP-Dk6yM-FW.js","./TimeOnly-DSMefxKy-DBJeVQCe.js","./UnknownTimeZone-C--TOcPG-hkNbcn35.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./FeatureLayer-BrRKw5Si-CHreUEJ9.js","./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js","./RendererLegendOptions-K3md58-X-B6y5tQg5.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./colorRamps-q0bZVhs2-Bqen3nIx.js","./styleUtils-BtpNqZyT-B-RFL3S3.js","./jsonUtils-C64Zfu7c-trwRB9M4.js","./LRUCache-C3erQTWv-CeYLuvL9.js","./Version-CoKzbupV-BxOJQpf3.js","./FieldsIndex-HmzMbJQG-CiA2Ur00.js","./OverrideHelper-DWRbVlj1-C2SNS5Gu.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-DpAlEmQT.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-72T4gbed.js","./heatmapUtils-seiMkkkR-D9lAE87R.js","./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js","./commonProperties-BtIqvFU_-Brj0aAM1.js","./ElevationInfo-yv2-9tj6-pjIBBQET.js","./FeatureLayerBase-vvYyZTfh-K4Z036-G.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./featureLayerUtils-DgfQQyK4-D6z7j0IK.js","./Query-BrwMGK8U-sojFdYaD.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js","./Relationship-PyhUibYK-Bz6HFiBe.js","./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js","./Layer-ChoECxvZ-C4wLrCej.js","./workers-PiCjreoO-oGzLvkSt.js","./editsZScale-BDsX6vv--CeDyYvz6.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./APIKeyMixin-BUMSx9ny-xmyEzAt4.js","./ArcGISService-BYA-y6X6-DLcDzG-r.js","./BlendLayer-D1WkSmwP-UVXywJXM.js","./jsonUtils-wIllKWI4-DQ36DuUP.js","./parser-DyDJ-rlI-mkgQEqcN.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./CustomParametersMixin-vdKsTHer-CoiI71pj.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js","./FeatureEffect-CDEk9Es7-DK_N6ZYk.js","./FeatureFilter-BCFHgLVU-BSMrX0wh.js","./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js","./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js","./labelingInfo-DGVNul26-CXiwzGiu.js","./labelUtils-BW14kBqX-8wHrIU-s.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-KEXCVZUA.js","./OrderedLayer-6Qsmrd_l-CGz1PXc3.js","./OrderByInfo-GD2XnU8e-C-uyyo-i.js","./PortalLayer-CElnYuSQ-tfjbIq8z.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js","./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js","./TemporalLayer-CpOrN_w9-kgJDrMMF.js","./TimeInfo-w_HB2CsF-wq_g9Zh1.js","./FeatureTemplate-SPHPD45f-tAS5Ccaa.js","./FeatureType-C9hJmS6_-pVJc0p7X.js","./fieldProperties-Bq26w7gt-DT6oRGMS.js","./versionUtils-LZYZz-38-xZnsxhiL.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js","./popupUtils-B0uZcXX0-BqljON9c.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./calcite-loader-CtpHSU2--Cbej2XpA.js","./loader-Ch7Jr16w-ztJ2p2Gj.js","./guid-Dls486Er-CBh637k4.js","./locale-Cn_GDVD_-CiwD7jxT.js","./key-CZySMiwx-kmS7VeUz.js","./calcite-list-rnu1YzAl-BT4YOn58.js","./interactive-DqhNilgd-DrUFww1w.js","./resources4-Bi43yZeq-Ca3PT_gb.js","./utils3-BSH0zqNl-Dva1wv1w.js","./loadable-DbNDKH4r-Cc9Ee-I5.js","./t9n-C_hcZMZJ-BmtPt6-4.js","./debounce-27Hmkkyg-Th7bw3mg.js","./input2-eOtqu-iO-CInnv9HE.js","./form-CRSw616T-Cd5gFTXp.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./scrim-BscQh4v9-uedhhKYH.js","./calcite-list-item-VYBhSMxV-DcHoxADM.js","./action-GCQoufcz-Cwgl1KRC.js","./calcite-notice-DeAGopAs-D67uezlU.js","./conditionalSlot-DsCzytJ4-Ay0m1nEb.js","./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js","./calcite-chip-DE_c-1hr-rXOunzT9.js","./calcite-input-BKRd7MCS-BjdnYfeD.js","./calcite-tooltip-63c9fmIw-C6HlFBgP.js","./floating-ui-DKFFlLv3-DZ3_fUHw.js","./FloatingArrow-BG9llDYg-B1DQ6cRb.js","./calcite-action-2fclGKoO-tJ2F9SXc.js","./calcite-action-bar-ugh74qU5-vzTzIHYF.js","./action-group-DhwU7QZv-D6TFqyAr.js","./action-menu-DTIJuZNc-DM_2ZtiL.js","./calcite-action-group-qlkUfh_o-BnjsUS6-.js","./calcite-flow-item-uRuGc3ks-LY9sq3aM.js","./panel-DRUEhsxp-DdHxn7R2.js","./geometryEngineAsync-D7oEu5dd-DTqB2IHB.js","./calcite-button-Cm9_TJei-BWKp46iV.js","./calcite-flow-CAdorlph-Cs9fueJs.js","./calcite-list-item-group-CuQ2MPLW-BznsgUiX.js"])))=>i.map(i=>d[i]); -import{ag as ce,v as r,S as a,ad as et,bi as je,i as P,iC as sn,eW as uo,ar as po,gP as ho,iD as rn,w as ai,aa as mo,bR as li,j as ge,b9 as ke,bp as Ye,ah as y,aL as $,aq as Nt,aK as di,a0 as Fi,ac as Mi,m as an,aD as fo,aU as Et,a1 as Y,iE as go,ai as dt,aw as yo,iF as qe,_ as w,I as ln,aF as at,iG as dn,iH as pt,iI as _o,K as ci,eC as cn,av as un,b7 as pn,o as N,cG as Be,bx as vo,cF as ct,gO as hn,cH as Ci,bE as mn,iJ as fn,a_ as gn,iK as yn,iL as _n,e_ as vn,iM as Ei,aA as wo,az as $t,e as bo,ex as Io,bt as wn,fd as gt,c_ as bn,bw as In,ae as An,iw as ui,cU as Fn,f as Mn,eY as Ti,iN as Tt,an as Cn}from"./main-BZaw9FpY.js";import{b as pe}from"./substitute-j49H6mVR-DelduE0n.js";import{_ as K,k as Ae,P as u,o as En,X as Tn,R as oe,d as xi,e as ki,H as be,$ as xn,w as kn,F as Ao}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{s as Ln,t as Pn}from"./ReactiveSet-QxEZenFW-Cl_EaQiS.js";import{h as Nn}from"./AttachmentInfo-D9RFO8W2-CP6YNuYr.js";import{d as Yt,c as Li}from"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import{b as $n,N as Fo}from"./utils-DyydRFHu-D-5zlVyA.js";import{I as M,K as Rn,J as On}from"./MapView-BGOJJ8ch-Dom5daUl.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import{K as Vn,C as St,I as Sn,J as Dn,x as We}from"./utils-DPtQ14k3-D1wtSpry.js";import{l as qn}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{u as Dt}from"./executeQueryJSON-CcHnccia-DVecwfbV.js";import{b as lt,m as Bn}from"./Query-BrwMGK8U-sojFdYaD.js";import{j as jn}from"./shared-D1w-26bA-Cy2KeMh-.js";import Mo from"./FeatureLayer-BrRKw5Si-CHreUEJ9.js";import{h as Co}from"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import{L as xt}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{V as Wn,K as zn,N as Hn}from"./projection-BA9M1R7d-DoNqITCd.js";import{D as Pi}from"./Layer-ChoECxvZ-C4wLrCej.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./Tile-D75RMC64-DprBAZDK.js";import{a as Ni}from"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./versionUtils-LZYZz-38-xZnsxhiL.js";import"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function pi(e,t,i,o){let n=null,s=1e3;typeof t=="number"?(s=t,o=i):(n=t??null,s=i);let l,d=0;const c=()=>{d=0,e.apply(o,l)},p=(...h)=>{n&&n.apply(o,h),l=h,s?d||(d=setTimeout(c,s)):c()};return p.remove=()=>{d&&(clearTimeout(d),d=0)},p.forceUpdate=()=>{d&&(clearTimeout(d),c())},p.hasPendingUpdates=()=>!!d,p}function Kt(e){switch(e?.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}function Un(e){return e?{backgroundImage:`url(${e})`}:{}}function Zn({action:e,feature:t}){const i=t?.attributes,o="image"in e?e.image:void 0;return o&&i?pe(o,i):o??""}const Gn="esri.widgets.Feature.support.featureUtils",ei=()=>Y.getLogger(Gn),Qn=/href=(""|'')/gi,Xn=/(\{([^{\r\n]+)\})/g,Jn=/'/g,Eo=/^\s*expression\//i,Yn=/(\n)/gi,Kn=/[\u00A0-\u9999<>&]/gim,es=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ts=/^(?:mailto:|tel:)/,To="relationships/",$i=ho("short-date-short-time");function xo(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}async function kt({type:e,value:t,event:i}){try{return typeof t=="function"?t(i):await t}catch(o){return void ei().error("error",`An error occurred when calling the "${e}" function`,{error:o,graphic:i.graphic,value:t})}}function ko(e=""){if(e)return!ts.test(e.trim().toLowerCase())}function hi(e){return!!e&&Eo.test(e)}function is(e,t){if(!t||!hi(t)||!e)return;const i=t.replace(Eo,"").toLowerCase();return e.find(({name:o})=>o.toLowerCase()===i)}function Lo(e,t){const i=is(t,e?.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function os(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function ns(e){return e.replaceAll(Qn,"")}function ut(e,t){const i=mi(t,e);return i?i.name:e}function ss(e,t){return e&&e.map(i=>ut(i,t))}function mi(e,t){return e&&typeof e.getField=="function"&&t?e.getField(t)??null:null}function Po(e){return`${e}`.trim()}function Ve({attributes:e,globalAttributes:t,layer:i,text:o,expressionAttributes:n,fieldInfoMap:s}){return o?ti({formattedAttributes:t,template:ds(o,{...t,...n,...e},i),fieldInfoMap:s}):""}function ti({formattedAttributes:e,template:t,fieldInfoMap:i}){return Po(ns(ct(ct(t,o=>os(o,i)),e)))}function rs(e,t,i=!1){const o=t[e];if(typeof o=="string"){const n="%27",s=(i?encodeURIComponent(o):o).replaceAll(Jn,n);t[e]=s}}function as(e,t=!1){const i={...e};return Object.keys(i).forEach(o=>rs(o,i,t)),i}function ls(e,t,i){const o=(t=Po(t))&&t[0]!=="{";return ct(e,as(i,o||!1))}function ii(e,t){return e.replaceAll(Xn,(i,o,n)=>{const s=mi(t,n);return s?`{${s.name}}`:o})}function ds(e,t,i){const o=ii(e,i);return o&&o.replaceAll(es,(n,s,l)=>ls(n,s||l,t))}function cs(e,t){if(typeof e=="string"&&t&&t.dateFormat==null&&(t.places!=null||t.digitSeparator!=null)){const i=Number(e);if(!isNaN(i))return i}return e}function No(e){return e!=null&&typeof e=="object"&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&(e.type==="feature"||e.type==="scene"||e.type==="subtype-sublayer"||e.type==="sublayer")&&"when"in e}function us(e){return e!=null&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function ps(e){return!!(e&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"type"in e)&&(e.type==="subtype-sublayer"&&"parent"in e&&e.parent&&typeof e.parent=="object"?"globalIdField"in e.parent:"globalIdField"in e)}function $o(e){return No(e)&&us(e)}function hs(e){return No(e)&&ps(e)}function ms(e,t){const{fieldInfos:i,fieldName:o,preventPlacesFormatting:n,layer:s,timeZone:l}=t,d=Ro(i,o),c=mi(s,o);if(d&&!Ti(o)){const h=c?.type,m=d.format?.dateFormat;if(h==="date"||h==="date-only"||h==="time-only"||h==="timestamp-offset"||m)return Fo(e,{format:m,fieldType:h,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:l,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}})}const p=d?.format;return typeof e=="string"&&Ti(o)&&p?fs(e,p):typeof(e=cs(e,p))=="string"||e==null||p==null?ht(e):Be(e,n?{...Tt(p),minimumFractionDigits:0,maximumFractionDigits:20}:Tt(p))}function fs(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?qt(e,",",", ",t):e.includes(";")?qt(e,";","; ",t):e.includes(" ")?qt(e," "," ",t):Be(Number(e),Tt(t))}function qt(e,t,i,o){return e.trim().split(t).map(n=>Be(Number(n),Tt(o))).join(i)}function Ro(e,t){if(e?.length&&t)return e.find(i=>i.fieldName?.toLowerCase()===t.toLowerCase())}function gs({fieldName:e,graphic:t,layer:i}){if(Ie(e)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:o}=i;if(!o||e!==o)return null;const n=i.getFeatureType(t);return n?n.name:null}function ys({fieldName:e,value:t,graphic:i,layer:o}){if(Ie(e)||!o||typeof o.getFieldDomain!="function")return null;const n=i&&o.getFieldDomain(e,{feature:i,excludeImpliedDomains:ci("esri-widget-legacy-field-domain-calculation")});return n&&n.type==="coded-value"?n.getName(t):null}function _s(e,t,i,o){const{creatorField:n,creationDateField:s,editorField:l,editDateField:d}=e;if(!t)return;const c=hn(o&&"preferredTimeZone"in o?o.preferredTimeZone:null,!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone,i,$i,"date"),p={...$i,...c},h=t[d];if(typeof h=="number"){const f=t[l];return{type:"edit",date:Ci(h,p),user:f}}const m=t[s];if(typeof m=="number"){const f=t[n];return{type:"create",date:Ci(m,p),user:f}}return null}function vs(e,t){const i=new Map;if(!e)return i;for(const o of e){if(!o.fieldName)continue;const n=ut(o.fieldName,t);o.fieldName=n,i.set(n.toLowerCase(),o)}return i}function Ri(e){const t=[];if(!e)return t;const{fieldInfos:i,content:o}=e;return i&&t.push(...i),o&&Array.isArray(o)&&o.forEach(n=>{if(n.type==="fields"){const s=n?.fieldInfos;s&&t.push(...s)}}),t}function fi(e){return e.replaceAll(Kn,t=>`&#${t.charCodeAt(0)};`)}function ht(e){return typeof e=="string"?e.replaceAll(Yn,'
'):e}function Oo(e){const{value:t,fieldName:i,fieldInfos:o,fieldInfoMap:n,layer:s,graphic:l,timeZone:d}=e;if(t==null)return"";const c=ys({fieldName:i,value:t,graphic:l,layer:s});if(c)return c;const p=gs({fieldName:i,graphic:l,layer:s});if(p)return p;if(n.get(i.toLowerCase()))return ms(t,{fieldInfos:o||Array.from(n.values()),fieldName:i,layer:s,timeZone:d});const h=s?.fieldsIndex?.get(i);return h&&($n(h)||bn(h))?Fo(t,{fieldType:h.type,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:d,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}}):ht(t)}function Bt({fieldInfos:e,attributes:t,layer:i,graphic:o,fieldInfoMap:n,relatedInfos:s,timeZone:l}){const d={};return s?.forEach(c=>As({attributes:d,relatedInfo:c,fieldInfoMap:n,fieldInfos:e,layer:i,timeZone:l})),t&&Object.keys(t).forEach(c=>{const p=t[c];d[c]=Oo({fieldName:c,fieldInfos:e,fieldInfoMap:n,layer:i,value:p,graphic:o,timeZone:l})}),d}async function Vo(e,t){const{layer:i,graphic:o,outFields:n,objectIds:s,returnGeometry:l,spatialReference:d}=e,c=s[0];if(typeof c!="number"&&typeof c!="string"){const h="Could not query required fields for the specified feature. The feature's ID is invalid.",m={layer:i,graphic:o,objectId:c,requiredFields:n};return ei().warn(h,m),null}if(!mn(i)?.operations?.supportsQuery){const h="The specified layer cannot be queried. The following fields will not be available.",m={layer:i,graphic:o,requiredFields:n,returnGeometry:l};return ei().warn(h,m),null}const p=i.createQuery();return p.objectIds=s,p.outFields=n?.length?n:[i.objectIdField],p.returnGeometry=!!l,p.returnZ=!!l,p.returnM=!!l,p.outSpatialReference=d,(await i.queryFeatures(p,t)).features[0]}async function ws(e){if(!e.expressionInfos?.length)return!1;const t=await Io(),{arcadeUtils:{hasGeometryFunctions:i}}=t;return i(e)}async function bs({graphic:e,popupTemplate:t,layer:i,spatialReference:o},n){if(!i||!t||(typeof i.load=="function"&&await i.load(n),!e.attributes))return;const s=i.objectIdField,l=e.attributes[s];if(l==null)return;const d=[l],c=await t.getRequiredFields(i.fieldsIndex),p=fn(c,e),h=p?[]:c.includes(s)?c:[...c,s],m=t.returnGeometry||await ws(t);if(p&&!m)return;const f=await Vo({layer:i,graphic:e,outFields:h,objectIds:d,returnGeometry:m,spatialReference:o},n);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function Ie(e=""){return!!e&&e.includes(To)}function Is(e){return e?`${To}${e.layerId}/${e.fieldName}`:""}function Oi({attributes:e,graphic:t,relatedInfo:i,fieldInfos:o,fieldInfoMap:n,layer:s,timeZone:l}){e&&t&&i&&Object.keys(t.attributes).forEach(d=>{const c=Is({layerId:i.relation.id.toString(),fieldName:d}),p=t.attributes[d];e[c]=Oo({fieldName:c,fieldInfos:o,fieldInfoMap:n,layer:s,value:p,graphic:t,timeZone:l})})}function As({attributes:e,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s}){e&&t&&(t.relatedFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})),t.relatedStatsFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})))}const Vi=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},So=({layer:e,method:t,query:i,definitionExpression:o})=>{if(!e.capabilities?.query?.supportsCacheHint||t==="attachments")return;const n=i.where!=null?i.where:null,s=i.geometry!=null?i.geometry:null;Vi(o)||Vi(n)||s?.type==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Fs=({query:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},Ms=({queryPayload:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Cs(e,t,i){return e&&t&&i?t.type==="sublayer"?Xe({layers:t.layer?.sublayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:i}):Xe({layers:e.allLayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:e.allTables,map:e,relatedLayer:t,relationship:i}):null}function Si(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(i=>i.isUtilityLayer(t)):null}function Di(e,t){return e?.allTables.find(i=>i.type==="feature"&&i.layerId===t.id&&i.url===t.layer?.url)}function Xe({map:e,relationship:t,relationship:{relatedTableId:i},relatedLayer:o,layers:n}){if(!n)return null;for(const s of n){if(s.type==="map-image"){const d=Xe({layers:s.sublayers,map:e,relatedLayer:o,relationship:t})||Xe({layers:s.subtables,map:e,relatedLayer:o,relationship:t});if(d)return d;continue}if(!$o(s))continue;if(o.type==="sublayer"){if(s!==o&&s.id===i)return s.isTable?Di(e,s):s;continue}const l=o.type==="scene"&&o.associatedLayer?o.associatedLayer.url:o.url;if(!l)return null;if(s.type!=="sublayer"){if(s!==o&&s.url===l&&s.layerId===i)return s}else if(s!==o&&s.layer?.url===l&&s.id===i)return s.isTable?Di(e,s):s}return null}const qi={editing:!1,operations:{add:!0,update:!0,delete:!0}},Do=ce.ofType(Nn);let ne=class extends ge{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...qi},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new Do,this.fileInfos=new ce,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(y(()=>this.graphic,()=>this._graphicChanged(),$))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...qi,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return t?.loaded&&"capabilities"in t&&t.capabilities&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new N("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId();if(typeof i!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const o=new Li({objectIds:[i],returnMetadata:!0}),n=[],s=e.queryAttachments(o).then(d=>d[i]||n).catch(()=>n);this._getAttachmentsPromise=s,this.notifyChange("state");const l=await s;return t.destroyAll(),l.length&&t.addMany(l),this._getAttachmentsPromise=null,this.notifyChange("state"),l}async addAttachment(e,t=this.graphic){const{_attachmentLayer:i,attachmentInfos:o,capabilities:n}=this;if(!t)throw new N("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new N("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!n.operations?.add)throw new N("invalid-capabilities","addAttachment(): add capabilities are required.");if(!i||typeof i.addAttachment!="function")throw new N("invalid-layer","addAttachment(): A valid layer is required.");const s=i.addAttachment(t,e).then(d=>this._queryAttachment(d.objectId,t)),l=await s;return o.add(l),l}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:o,capabilities:n}=this;if(!e)throw new N("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!n.operations?.delete)throw new N("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new N("invalid-layer","deleteAttachment(): A valid layer is required.");if(!o)throw new N("invalid-graphic","deleteAttachment(): A graphic is required.");const s=t.deleteAttachments(o,[e.id]).then(()=>e),l=await s;return i.remove(l),l.destroy(),l}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:o,graphic:n,capabilities:s}=this;if(!e)throw new N("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new N("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!s.operations?.update)throw new N("invalid-capabilities","updateAttachment(): Update capabilities are required.");const l=o.indexOf(t);if(!i||typeof i.updateAttachment!="function")throw new N("invalid-layer","updateAttachment(): A valid layer is required.");if(!n)throw new N("invalid-graphic","updateAttachment(): A graphic is required.");const d=i.updateAttachment(n,t.id,e).then(p=>this._queryAttachment(p.objectId)),c=await d;return o.splice(l,1,c),c}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const i={file:e,form:t};return this.fileInfos.add(i),i}updateFile(e,t,i=this.activeFileInfo){if(!e||!t||!i)return null;const o=this.fileInfos.indexOf(i);return o>-1&&this.fileInfos.splice(o,1,{file:e,form:t}),this.fileInfos.items[o]}deleteFile(e){const t=this.fileInfos.find(i=>i.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:i}=this;if(!e||!i?.queryAttachments)throw new N("invalid-attachment-id","Could not query attachment.");const o=this._getObjectId(t);if(typeof o!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const n=new Li({objectIds:[o],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(n).then(s=>s[o][0])}_getObjectId(e=this.graphic){return e?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>this.attachmentInfos.destroyAll()))}_setAttachmentLayer(){const{graphic:e}=this,t=xo(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};r([a()],ne.prototype,"capabilities",void 0),r([et("capabilities")],ne.prototype,"castCapabilities",null),r([a()],ne.prototype,"activeAttachmentInfo",void 0),r([a()],ne.prototype,"activeFileInfo",void 0),r([a({readOnly:!0,type:Do})],ne.prototype,"attachmentInfos",void 0),r([a()],ne.prototype,"fileInfos",void 0),r([a({type:je})],ne.prototype,"graphic",void 0),r([a()],ne.prototype,"mode",void 0),r([a({readOnly:!0})],ne.prototype,"state",null),r([a()],ne.prototype,"filesEnabled",void 0),r([a({readOnly:!0})],ne.prototype,"supportsResizeAttachments",null),ne=r([P("esri.widgets.Attachments.AttachmentsViewModel")],ne);const gi=ne;function Bi(e){const t=e.toLowerCase();return t==="image/bmp"||t==="image/emf"||t==="image/exif"||t==="image/gif"||t==="image/x-icon"||t==="image/jpeg"||t==="image/png"||t==="image/tiff"||t==="image/x-wmf"}function Es(e){const t=In("esri/themes/base/images/files/");return e?e==="text/plain"?`${t}text-32.svg`:e==="application/pdf"?`${t}pdf-32.svg`:e==="text/csv"?`${t}csv-32.svg`:e==="application/gpx+xml"?`${t}gpx-32.svg`:e==="application/x-dwf"?`${t}cad-32.svg`:e==="application/postscript"||e==="application/json"||e==="text/xml"||e==="model/vrml"?`${t}code-32.svg`:e==="application/x-zip-compressed"||e==="application/x-7z-compressed"||e==="application/x-gzip"||e==="application/x-tar"||e==="application/x-gtar"||e==="application/x-bzip2"||e==="application/gzip"||e==="application/x-compress"||e==="application/x-apple-diskimage"||e==="application/x-rar-compressed"||e==="application/zip"?`${t}zip-32.svg`:e.includes("image/")?`${t}image-32.svg`:e.includes("audio/")?`${t}sound-32.svg`:e.includes("video/")?`${t}video-32.svg`:e.includes("msexcel")||e.includes("ms-excel")||e.includes("spreadsheetml")?`${t}excel-32.svg`:e.includes("msword")||e.includes("ms-word")||e.includes("wordprocessingml")?`${t}word-32.svg`:e.includes("powerpoint")||e.includes("presentationml")?`${t}report-32.svg`:`${t}generic-32.svg`:`${t}generic-32.svg`}const we={close:"esri-icon-close",collapse:"esri-icon-collapse",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",handleVertical:"esri-icon-handle-vertical",icon:"esri-icon",left:"esri-icon-left",locateCircled:"esri-icon-locate-circled",noticeTriangle:"esri-icon-notice-triangle",pause:"esri-icon-pause",play:"esri-icon-play",plus:"esri-icon-plus",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",search:"esri-icon-search",swap:"esri-icon-swap",table:"esri-icon-table",trash:"esri-icon-trash",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomToObject:"esri-icon-zoom-to-object"},ji={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},L="esri-attachments",A={base:L,loaderContainer:`${L}__loader-container`,loader:`${L}__loader`,fadeIn:`${L}--fade-in`,container:`${L}__container`,containerList:`${L}__container--list`,containerPreview:`${L}__container--preview`,actions:`${L}__actions`,deleteButton:`${L}__delete-button`,addAttachmentButton:`${L}__add-attachment-button`,errorMessage:`${L}__error-message`,items:`${L}__items`,item:`${L}__item`,itemButton:`${L}__item-button`,itemMask:`${L}__item-mask`,itemMaskIcon:`${L}__item-mask--icon`,itemImage:`${L}__image`,itemImageResizable:`${L}__image--resizable`,itemLabel:`${L}__label`,itemFilename:`${L}__filename`,itemChevronIcon:`${L}__item-chevron-icon`,itemLink:`${L}__item-link`,itemLinkOverlay:`${L}__item-link-overlay`,itemLinkOverlayIcon:`${L}__item-link-overlay-icon`,itemEditIcon:`${L}__item-edit-icon`,itemAddIcon:`${L}__item-add-icon`,itemAddButton:`${L}__item-add-button`,formNode:`${L}__form-node`,fileFieldset:`${L}__file-fieldset`,fileLabel:`${L}__file-label`,fileName:`${L}__file-name`,fileInput:`${L}__file-input`,metadata:`${L}__metadata`,metadataFieldset:`${L}__metadata-fieldset`,progressBar:`${L}__progress-bar`},jt=window.CSS;let X=class extends oe{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...ji},this._supportsImageOrientation=jt&&jt.supports&&jt.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e?.viewModel||(e={viewModel:new gi,...e}),e}initialize(){this.addHandles([dt(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),dt(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),y(()=>this.viewModel?.mode,()=>this._modeChanged(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Bm5S9Lju.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"attachment"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...ji,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:add-attachment",this.messages.addErrorMessage,i)),i})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:delete-attachment",this.messages.deleteErrorMessage,i)),i})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(i=>(this._set("submitting",!1),this._set("error",null),e.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:update-attachment",this.messages.updateErrorMessage,i)),i})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){const t=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo?.file);return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:i}=t;return u("div",{class:this.classes(A.base,M.widget)},e?this._renderProgressBar():null,i==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?u("div",{class:A.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:i}=this.viewModel;return t==="add"?this._renderAddForm():t==="edit"?this._renderDetailsForm(i||e):this._renderAttachmentContainer()}_renderLoading(){return u("div",{class:A.loaderContainer,key:"loader"},u("div",{class:A.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?u("div",{class:A.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,o=this.visibleElements.cancelAddButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,M.buttonSmall,M.buttonHalf,e&&M.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,n=this.visibleElements.addSubmitButton?u("button",{class:this.classes(M.button,M.buttonSecondary,M.buttonSmall,M.buttonHalf,{[M.buttonDisabled]:i}),disabled:i,type:"submit"},this.messages.add):null,s=t?u("span",{class:A.fileName,key:"file-name"},t.name):null,l=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},u("fieldset",{class:A.fileFieldset},s,u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),n,o);return u("div",{class:A.formNode,key:"add-form-container"},l)}_renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:o,submitting:n}=this,{capabilities:s}=i,l=n||!o;let d,c,p,h;o?(d=o.type,c=o.name,p=o.size):e&&"file"in e?(d=e.file.type,c=e.file.name,p=e.file.size):e&&"contentType"in e&&(d=e.contentType,c=e.name,p=e.size,h=e.url);const m=s.editing&&s.operations?.delete&&t.deleteButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,A.deleteButton,{[M.buttonDisabled]:n}),disabled:n,key:"delete-button",onclick:b=>this._submitDeleteAttachment(b,e),type:"button"},this.messages.delete):void 0,f=s.editing&&s.operations?.update&&t.updateButton?u("button",{class:this.classes(M.button,M.buttonSmall,M.buttonThird,{[M.buttonDisabled]:l}),disabled:l,key:"update-button",type:"submit"},this.messages.update):void 0,g=this.visibleElements.cancelUpdateButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,M.buttonThird,{[M.buttonDisabled]:n}),disabled:n,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,v=s.editing&&s.operations?.update?u("fieldset",{class:A.fileFieldset,key:"file"},u("span",{class:A.fileName,key:"file-name"},c),u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},this.messages.changeFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,I=u("fieldset",{class:A.metadataFieldset,key:"size"},u("label",null,Pn(this.messagesUnits,p??0))),C=u("fieldset",{class:A.metadataFieldset,key:"content-type"},u("label",null,d)),_=h!=null?u("a",{class:A.itemLink,href:h,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),u("div",{class:A.itemLinkOverlay},u("span",{class:A.itemLinkOverlayIcon},u("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),T=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:b=>this._submitUpdateAttachment(b,e)},u("div",{class:A.metadata},I,C),v,u("div",{class:A.actions},m,g,f));return u("div",{class:A.formNode,key:"edit-form-container"},_,T)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,o=Es(t),n={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMaskIcon,A.itemMask),key:o},u("img",{alt:e,class:this.classes(n,A.itemImage),src:o,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel;if(!e)return null;const{contentType:o,name:n,url:s}=e;if(!i||!Bi(o))return this._renderGenericImageMask(n,o);const l=this._getCSSTransform(e),d=l?{transform:l,"image-orientation":"none"}:{},c=`${s}${s?.includes("?")?"&":"?"}w=${t}`,p={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMask),key:c},u("img",{alt:n,class:this.classes(p,A.itemImage),src:c,styles:d,title:n}))}_renderFile(e){const{file:t}=e;return u("li",{class:A.item,key:t},u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},t.name||this.messages.noTitle),u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:o}=this,{capabilities:n,supportsResizeAttachments:s}=i,{contentType:l,name:d,url:c}=e,p=this._renderImageMask(e,t==="list"?48:400),h=n.editing?u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}):null,m=[p,o==="preview"&&s&&Bi(l)?null:u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},d||this.messages.noTitle),h)],f=n.editing?u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},m):u("a",{class:A.itemButton,href:c??void 0,key:"details-link",rel:"noreferrer",target:"_blank"},m);return u("li",{class:A.item,key:e},f)}_renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:o,capabilities:n,fileInfos:s}=t,l=!!o?.length,d=!!s?.length,c={[A.containerList]:e!=="preview",[A.containerPreview]:e==="preview"},p=n.editing&&n.operations?.add&&i.addButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,A.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},u("span",{"aria-hidden":"true",class:this.classes(A.itemAddIcon,we.plus)}),this.messages.add):void 0,h=l?u("ul",{class:A.items,key:"attachments-list"},o.toArray().map(g=>this._renderAttachmentInfo({attachmentInfo:g,displayType:e}))):void 0,m=d?u("ul",{class:A.items,key:"file-list"},s.toArray().map(g=>this._renderFile(g))):void 0,f=d||l?void 0:u("div",{class:M.empty},this.messages.noAttachments);return u("div",{class:this.classes(A.container,c),key:"attachments-container"},h,m,f,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t.files?.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};r([a()],X.prototype,"capabilities",null),r([a()],X.prototype,"displayType",void 0),r([a({readOnly:!0})],X.prototype,"effectiveDisplayType",null),r([a()],X.prototype,"graphic",null),r([a()],X.prototype,"icon",null),r([a()],X.prototype,"label",null),r([a(),K("esri/widgets/Attachments/t9n/Attachments")],X.prototype,"messages",void 0),r([a(),K("esri/core/t9n/Units")],X.prototype,"messagesUnits",void 0),r([a({readOnly:!0})],X.prototype,"selectedFile",void 0),r([a({readOnly:!0})],X.prototype,"submitting",void 0),r([a({readOnly:!0})],X.prototype,"error",void 0),r([a({type:gi})],X.prototype,"viewModel",void 0),r([a()],X.prototype,"visibleElements",void 0),r([et("visibleElements")],X.prototype,"castVisibleElements",null),X=r([P("esri.widgets.Attachments")],X);const Ts=X;let nt=class extends gi{constructor(e){super(e),this.description=null,this.title=null}};r([a()],nt.prototype,"description",void 0),r([a()],nt.prototype,"title",void 0),nt=r([P("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],nt);const yi=nt;function _i({level:e,class:t,...i},o){const n=xs(e);return u(`h${n}`,{...i,"aria-level":String(n),class:xn(M.heading,t),role:"heading"},o)}function xs(e){return An(Math.ceil(e),1,6)}const Wt="esri-feature-element-info",zt={base:Wt,title:`${Wt}__title`,description:`${Wt}__description`};let Ze=class extends oe{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return u("div",{class:zt.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?u(_i,{class:zt.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?u("div",{class:zt.description,innerHTML:e,key:"description"}):null}};r([a()],Ze.prototype,"description",void 0),r([a()],Ze.prototype,"headingLevel",void 0),r([a()],Ze.prototype,"title",void 0),Ze=r([P("esri.widgets.Feature.support.FeatureElementInfo")],Ze);const mt=Ze,ks={base:"esri-feature-attachments"};let ye=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Ts,this.headingLevel=2,this.viewModel=new yi}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,$)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return u("div",{class:ks.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};r([a({readOnly:!0})],ye.prototype,"attachmentsWidget",void 0),r([a()],ye.prototype,"description",null),r([a()],ye.prototype,"displayType",null),r([a()],ye.prototype,"graphic",null),r([a()],ye.prototype,"headingLevel",void 0),r([a()],ye.prototype,"title",null),r([a({type:yi})],ye.prototype,"viewModel",void 0),ye=r([P("esri.widgets.Feature.FeatureAttachments")],ye);const Ls=ye;let Ee=class extends ge{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(y(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},$))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&t&&(kt({type:"content",value:i,event:{graphic:t}}),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const i=kt({type:"content",value:e,event:{graphic:t}});this._loadingPromise=i,this.notifyChange("state");const o=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",o))}};r([a({readOnly:!0})],Ee.prototype,"created",void 0),r([a()],Ee.prototype,"creator",void 0),r([a()],Ee.prototype,"destroyer",void 0),r([a({type:je})],Ee.prototype,"graphic",void 0),r([a({readOnly:!0})],Ee.prototype,"state",null),Ee=r([P("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],Ee);const Lt=Ee;function qo(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,o=Array.isArray(e)?e:Ps(e);i.push(...o)}}function Ps(e){return e.split(",").map(t=>t.trim())}function Bo(e){return e&&typeof e.render=="function"}function Ns(e){return e&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}const Ht="esri-feature-content",Ut={base:Ht,loaderContainer:`${Ht}__loader-container`,loader:`${Ht}__loader`};let Ge=class extends oe{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(o=>{ko(o.href)&&!o.hasAttribute("target")&&o.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return u("div",{class:Ut.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return u("div",{class:Ut.loaderContainer,key:"loader"},u("div",{class:Ut.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,key:e}):Bo(e)?u("div",{key:e},!e.destroyed&&e.render()):u("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};r([a()],Ge.prototype,"creator",null),r([a()],Ge.prototype,"graphic",null),r([a({type:Lt})],Ge.prototype,"viewModel",void 0),Ge=r([P("esri.widgets.Feature.FeatureContent")],Ge);const bt=Ge;let ve=class extends ge{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,i=[];return t?.forEach(o=>{if(!(!o.hasOwnProperty("visible")||o.visible))return;const n=o.clone();n.label=Lo(n,e),i.push(n)}),i}};r([a()],ve.prototype,"attributes",void 0),r([a({type:[sn]})],ve.prototype,"expressionInfos",void 0),r([a()],ve.prototype,"description",void 0),r([a({type:[uo]})],ve.prototype,"fieldInfos",void 0),r([a({readOnly:!0})],ve.prototype,"formattedFieldInfos",null),r([a()],ve.prototype,"title",void 0),ve=r([P("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],ve);const Rt=ve,$s=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function Rs(e,t){if(typeof t!="string"||!t)return t;const i=$s.find(c=>c.pattern.test(t));if(!i)return t;const o=t.match(i.pattern),n=o?.[2],s=ct(ct(i.label,{messages:e,hierPart:n}),{appName:i.appName}),l=i.target?` target="${i.target}"`:"",d=i.target==="_blank"?' rel="noreferrer"':"";return t.replace(i.pattern,`${s}`)}const yt="esri-feature-fields",_t={base:yt,fieldHeader:`${yt}__field-header`,fieldData:`${yt}__field-data`,fieldDataDate:`${yt}__field-data--date`};let he=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Rt,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new mt,this.addHandles(y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{class:_t.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:i}=this.viewModel,o=e.fieldName||"",n=e.label||o,s=i?i[o]==null?"":i[o]:"",l=!!e.format?.dateFormat,d=typeof s=="number"&&!l?this._forceLTR(s):Rs(this.messagesURIUtils,s),c={[_t.fieldDataDate]:l};return u("tr",{key:`fields-element-info-row-${o}-${t}`},u("th",{class:_t.fieldHeader,innerHTML:n,key:`fields-element-info-row-header-${o}-${t}`}),u("td",{class:this.classes(_t.fieldData,c),innerHTML:d,key:`fields-element-info-row-data-${o}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?u("table",{class:M.table,summary:this.messages.fieldsSummary},u("tbody",null,e.map((t,i)=>this._renderFieldInfo(t,i)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};r([a()],he.prototype,"attributes",null),r([a()],he.prototype,"description",null),r([a()],he.prototype,"expressionInfos",null),r([a()],he.prototype,"fieldInfos",null),r([a()],he.prototype,"title",null),r([a({type:Rt,nonNullable:!0})],he.prototype,"viewModel",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],he.prototype,"messages",void 0),r([a(),K("esri/widgets/support/t9n/uriUtils")],he.prototype,"messagesURIUtils",void 0),he=r([P("esri.widgets.Feature.FeatureFields")],he);const jo=he,Os={maximumFractionDigits:20};function Vs(e){return Be(e,Os)}const Ss="<",Ds=">";function qs(e,t,i,o){let n="";return t===0?n=`${Ss} `:t===i&&(n=`${Ds} `),n+Vs(e)}const Bs=new po([64,64,64]);function js(e,t){const i=[],o=e.length-1;return e.length===5?i.push(0,2,4):i.push(0,o),e.map((n,s)=>i.includes(s)?qs(n,s,o):null)}async function Ws(e,t,i){let o=!1,n=[],s=[];if(e.stops){const p=e.stops;n=p.map(h=>h.value),o=p.some(h=>!!h.label),o&&(s=p.map(h=>h.label))}const l=n[0],d=n[n.length-1];if(l==null&&d==null)return null;const c=o?null:js(n);return(await Promise.all(n.map(async(p,h)=>({value:p,color:e.type==="opacity"?await zs(p,e):(await w(async()=>{const{getColor:m}=await import("./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js");return{getColor:m}},__vite__mapDeps([8,3,4,9,10,11]),import.meta.url)).getColor(e,p),label:o?s[h]:c?.[h]??""})))).reverse()}async function zs(e,t,i){const o=new po(Bs),n=(await w(async()=>{const{getOpacity:s}=await import("./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js");return{getOpacity:s}},__vite__mapDeps([8,3,4,9,10,11]),import.meta.url)).getOpacity(t,e);return n!=null&&(o.a=n),o}function Hs(e){if(!e.colorStops)return[];const t=[...e.colorStops].filter(o=>o.color?.a>0);let i=t.length-1;if(t&&t[0]){const o=t[i];o&&o.ratio!==1&&(t.push(new qn({ratio:1,color:o.color})),i++)}return t.map((o,n)=>{let s="";return n===0?s=e.legendOptions?.minLabel||"low":n===i&&(s=e.legendOptions?.maxLabel||"high"),{color:o.color,label:s,ratio:o.ratio}}).reverse()}ho("short-date");async function le(e,t,i){Cn(e,t,()=>[]).push(...i)}async function Us(e){const t=new Map;if(!e)return t;if("visualVariables"in e&&e.visualVariables){const i=e.visualVariables.filter(o=>o.type==="color");for(const o of i){const n=(await Ws(o)??[]).map(s=>s.color);await le(t,o.field||o.valueExpression,n)}}if(e.type==="heatmap"){const i=Hs(e).map(o=>o.color);await le(t,e.field||e.valueExpression,i)}else if(e.type==="pie-chart"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e?.othersCategory?.color,We(e.backgroundFillSymbol,null)])}else if(e.type==="dot-density"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e.backgroundColor])}else if(e.type==="unique-value")if(e.authoringInfo?.type==="predominance")for(const i of e.uniqueValueInfos??[])await le(t,i.value.toString(),[We(i.symbol,null)]);else{const i=(e.uniqueValueInfos??[]).map(d=>We(d.symbol,null)),{field:o,field2:n,field3:s,valueExpression:l}=e;(o||l)&&await le(t,o||l,i),n&&await le(t,n,i),s&&await le(t,s,i)}else if(e.type==="class-breaks"){const i=e.classBreakInfos.map(s=>We(s.symbol,null)),{field:o,valueExpression:n}=e;await le(t,o??n,i)}else e.type==="simple"&&await le(t,"default",[We(e.symbol,null)]);return"defaultSymbol"in e&&e.defaultSymbol&&await le(t,"default",[We(e.defaultSymbol,null)]),t.forEach((i,o)=>{const n=ui(i.filter(Boolean),(s,l)=>JSON.stringify(s)===JSON.stringify(l));t.set(o,n)}),t}const Zs="esri.widgets.Feature.support.relatedFeatureUtils",Wi=()=>Y.getLogger(Zs),zi=new Map;function It(e){if(!Ie(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function Gs(e,t){if(!t.relationships)return null;let i=null;const{relationships:o}=t;return o.some(n=>n.id===parseInt(e,10)&&(i=n,!0)),i}function Qs({originRelationship:e,relationships:t,layerId:i}){return t.find(({relatedTableId:o,id:n})=>`${o}`===i&&n===e?.id)??null}function Xs(e,t){const i=t.toLowerCase();for(const o in e)if(o.toLowerCase()===i)return e[o];return null}function Js(e,t){const i=Gs(e,t);if(i)return{url:`${t.url}/${i.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Ys(e,t){if(!t||!e)return;const{features:i,statsFeatures:o}=e,n=i?.value;t.relatedFeatures=n?n.features:[];const s=o?.value;t.relatedStatsFeatures=s?s.features:[]}function Ks(e,t,i,o){const n=new Yt;return n.outFields=["*"],n.relationshipId=typeof t.id=="number"?t.id:parseInt(t.id,10),n.objectIds=[e.attributes[i.objectIdField]],n.gdbVersion=i.gdbVersion??null,n.historicMoment=i.historicMoment??null,i.queryRelatedFeatures?.(n,o)??Promise.resolve({})}function er(e,t,i){let o=0;const n=[];for(;oJSON.stringify(t.toJSON())===JSON.stringify(i.toJSON())):void 0}async function or(e,t,i,o){const n=i.layerId.toString(),{layerInfo:s,relation:l,relatedFields:d,outStatistics:c,url:p,sourceSpatialReference:h}=t,m=tr(d),f=ir(c);if(!s||!l)return null;const g=Qs({originRelationship:l,relationships:s.relationships,layerId:n});if(g?.relationshipTableId&&g.keyFieldInRelationshipTable){const I=(await Ks(e,g,i,o))[e.attributes[i.objectIdField]];if(!I)return null;const C=I.features.map(_=>_.attributes[s.objectIdField]);if(f?.length&&s.supportsStatistics){const _=new lt;_.where=er(s.objectIdField,C,1e3),_.outFields=m,_.outStatistics=f,_.sourceSpatialReference=h;const T={features:Promise.resolve(I),statsFeatures:Dt(p,_)};return qe(T)}}const v=g?.keyField;if(v){const I=Fn(lr(s.fields,v)),C=Xs(e.attributes,l.keyField),_=I?`${v}=${C}`:`${v}='${C}'`,T=i.historicMoment,b=i.gdbVersion,G=Dt(p,new lt({where:_,outFields:m,sourceSpatialReference:h,historicMoment:T,gdbVersion:b}),o),W=f?.length&&s.supportsStatistics?Dt(p,new lt({where:_,outFields:m,outStatistics:f,sourceSpatialReference:h}),o):null,q={features:G};return W&&(q.statsFeatures=W),qe(q)}return null}function nr(e,t){return Mn(e,{query:{f:"json"},signal:t?.signal})}function sr({relatedInfos:e,layer:t},i){const o={};return e.forEach((n,s)=>{const{relation:l}=n;if(!l){const m=new N("relation-required","A relation is required on a layer to retrieve related records.");throw Wi().error(m),m}const{relatedTableId:d}=l;if(typeof d!="number"){const m=new N("A related table ID is required on a layer to retrieve related records.");throw Wi().error(m),m}const c=`${t.url}/${d}`,p=zi.get(c),h=p??nr(c);p||zi.set(c,h),o[s]=h}),gn(qe(o),i)}function rr({graphic:e,relatedInfos:t,layer:i},o){const n={};return t.forEach((s,l)=>{s.layerInfo&&(n[l]=or(e,s,i,o))}),qe(n)}function ar({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields?.push(t),i.statisticType){const o=new Bn({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics?.push(o)}}function lr(e,t){if(e!=null){t=t.toLowerCase();for(const i of e)if(i&&i.name.toLowerCase()===t)return i}return null}const Hi={chartAnimation:!0};let H=class extends ge{constructor(e){super(e),this.abilities={...Hi},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Hi,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){const{mediaInfos:e,layer:t}=this,i=this.attributes??{},o=this.formattedAttributes??{},n=this.expressionAttributes??{},s=this.fieldInfoMap??new Map;return e?.map(l=>{const d=l?.clone();return d?(d.title=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.title}),d.caption=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.caption}),d.altText=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.altText}),d.type==="image"?d.value?(this._setImageValue({value:d.value,formattedAttributes:o,layer:t}),d.value.sourceURL?d:void 0):void 0:d.type==="pie-chart"||d.type==="line-chart"||d.type==="column-chart"||d.type==="bar-chart"?d.value?(this._setChartValue({value:d.value,chartType:d.type,attributes:i,formattedAttributes:o,layer:t,expressionAttributes:n}),d):void 0:null):null}).filter(Nt)??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:i,formattedAttributes:o,layer:n}=e,{linkURL:s,sourceURL:l}=i;if(l){const d=ii(l,n);i.sourceURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}if(s){const d=ii(s,n);i.linkURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:o,chartType:n,layer:s,expressionAttributes:l}=e,{popupTemplate:d,relatedInfos:c}=this,{fields:p,normalizeField:h}=t,m=s;if(t.fields=ss(p,m),h&&(t.normalizeField=ut(h,m)),!p.some(g=>!!(o[g]!=null||Ie(g)&&c?.size)))return;const f=d?.fieldInfos??[];p.forEach((g,v)=>{const I=t.colors?.[v];if(Ie(g))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:f,fieldName:g,formattedAttributes:o,chartType:n,value:t,color:I})]);const C=this._getChartOption({value:t,attributes:i,chartType:n,formattedAttributes:o,expressionAttributes:l,fieldName:g,fieldInfos:f,color:I});t.series.push(C)})}_getRelatedChartInfos(e){const{fieldInfos:t,fieldName:i,formattedAttributes:o,chartType:n,value:s,color:l}=e,d=[],c=It(i),p=c&&this.relatedInfos?.get(c.layerId.toString());if(!p)return d;const{relatedFeatures:h,relation:m}=p;if(!m||!h)return d;const{cardinality:f}=m;return h.forEach(g=>{const{attributes:v}=g;v&&Object.keys(v).forEach(I=>{I===c.fieldName&&d.push(this._getChartOption({value:s,attributes:v,formattedAttributes:o,fieldName:i,chartType:n,relatedFieldName:I,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:l}))})}),f==="one-to-many"||f==="many-to-many"?d:[d[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){const{value:t,attributes:i,formattedAttributes:o,expressionAttributes:n,fieldName:s,relatedFieldName:l,fieldInfos:d,chartType:c,hasMultipleRelatedFeatures:p,color:h}=e,m=this.layer,f=this.fieldInfoMap??new Map,{normalizeField:g,tooltipField:v}=t,I=g?Ie(g)?i[It(g).fieldName]:i[g]:null,C=hi(s)&&n&&n[s]!==void 0?n[s]:l&&i[l]!==void 0?i[l]:i[s]!==void 0?i[s]:o[s],_=new yn({fieldName:s,color:h,value:C===void 0?null:C&&I?C/I:C});if(Ie(s)){const q=f.get(s.toLowerCase()),ue=v&&f.get(v.toLowerCase()),ae=q?.fieldName??s,Vt=p&&v?It(v).fieldName:ue?.fieldName??v,on=p&&Vt?i[Vt]:o[Vt]??q?.label??q?.fieldName??l,nn=p&&l?i[l]:o[ae];return _.tooltip=this._getTooltip({label:on,value:nn,chartType:c}),_}const T=Ro(d,s),b=ut(s,m),G=v&&o[v]!==void 0?o[v]:Lo(T||new uo({fieldName:b}),this.popupTemplate?.expressionInfos),W=o[b];return _.tooltip=this._getTooltip({label:G,value:W,chartType:c}),_}};r([a()],H.prototype,"abilities",void 0),r([et("abilities")],H.prototype,"castAbilities",null),r([a()],H.prototype,"activeMediaInfoIndex",void 0),r([a({readOnly:!0})],H.prototype,"activeMediaInfo",null),r([a()],H.prototype,"attributes",void 0),r([a()],H.prototype,"description",void 0),r([a()],H.prototype,"fieldInfoMap",void 0),r([a()],H.prototype,"formattedAttributes",void 0),r([a()],H.prototype,"expressionAttributes",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfos",null),r([a()],H.prototype,"isAggregate",void 0),r([a()],H.prototype,"layer",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfoCount",null),r([a()],H.prototype,"mediaInfos",void 0),r([a()],H.prototype,"popupTemplate",void 0),r([a()],H.prototype,"relatedInfos",void 0),r([a()],H.prototype,"title",void 0),H=r([P("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],H);const Se=H,z="esri-feature-media",te={base:z,mediaContainer:`${z}__container`,mediaItemContainer:`${z}__item-container`,mediaItem:`${z}__item`,mediaItemText:`${z}__item-text`,mediaItemTitle:`${z}__item-title`,mediaItemCaption:`${z}__item-caption`,mediaNavigation:`${z}__item-navigation`,mediaPagination:`${z}__pagination`,mediaPaginationText:`${z}__pagination-text`,mediaPrevious:`${z}__previous`,mediaPreviousIconLTR:`${z}__previous-icon`,mediaPreviousIconRTL:`${z}__previous-icon--rtl`,mediaNext:`${z}__next`,mediaNextIconLTR:`${z}__next-icon`,mediaNextIconRTL:`${z}__next-icon--rtl`,mediaChart:`${z}__chart`,mediaPaginationButton:`${z}__pagination-button`,mediaPaginationIcon:`${z}__pagination-icon`,mediaChartRendered:`${z}__chart--rendered`},Zt=15,Fe="category",tt="value",dr="rgba(50, 50, 50, 1)",cr=250,ur=500,pr=200;let ie=class extends oe{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Se,this.messages=null,this._disposeChart=i=>{this._chartRootMap.get(i)?.dispose(),this._chartRootMap.delete(i)},this._createChart=async i=>{const{destroyed:o,viewModel:n}=this;if(o||!n||!i)return;const{createRoot:s}=await w(()=>import("./chartUtilsAm5-CtY-kHPy-Dkmz_Xm3.js"),__vite__mapDeps([12,3,4,13,14,15]),import.meta.url),l=await s(i);this._chartRootMap.set(i,l),this._renderChart({mediaInfo:n.activeMediaInfo,root:l})}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),$),y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Bm5S9Lju.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:te.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:te.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:te.mediaNavigation},i,e>1?u("div",{class:te.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:te.mediaPaginationText},pe(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:te.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:te.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:te.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:o}=this.viewModel,{value:n,refreshInterval:s,altText:l,title:d,type:c}=e,{sourceURL:p,linkURL:h}=n,m=ko(h??void 0)?"_blank":"_self",f=m==="_blank"?"noreferrer":"",g=s?t:null,v=g?g.timestamp:0,I=g?g.sourceURL:p,C=u("img",{alt:l||d,key:`media-${c}-${i}-${o}-${v}`,src:I??void 0});return(h?u("a",{href:h,rel:f,target:m,title:d},C):null)??C}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:te.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:te.mediaItemContainer,key:"media-container"},u("div",{class:te.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,o=t?"chevron-left":"chevron-right",n=t?"media-previous":"media-next",s=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:te.mediaPaginationButton,key:n,onclick:s,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:te.mediaPaginationIcon,icon:o,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await w(()=>import("./chartCommon-rWfJsTPl-B8T05uOT.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),i=new Map;return e.forEach(o=>{o.color&&i.set(o,t(o.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await w(()=>import("./chartCommon-rWfJsTPl-B8T05uOT.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),t=new Map,i=this._getRenderer(),o="default";if(!i)return t;const n=await Us(i);return n.delete(o),Array.from(n.values()).every(s=>s?.length===1)&&Array.from(n.keys()).forEach(s=>{const l=n.get(s)?.[0]?.toCss(!0);l&&t.set(s,e(l))}),t}_handleMediaKeyup(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!On()}_getChartAnimationMS(){return this._canAnimateChart()?cr:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?ur:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:o,type:n}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:l,AnimatedThemeAm5:d,ColorSetAm5:c,ThemeAm5:p,esriChartColorSet:h}=await w(async()=>{const{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}=await import("./chartCommon-rWfJsTPl-B8T05uOT.js");return{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}},__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),m=p.new(t);m.rule("ColorSet").set("colors",h),m.rule("ColorSet").set("reuse",!0);const f=[s.new(t),m];kn()&&f.push(l.new(t)),this._canAnimateChart()&&f.push(d.new(t)),t.setThemes(f);const g=await this._getRendererColors(),v=await this._getSeriesColors(o.series),I=c.new(t,{}),C=v.get(o.series[0]),_=C?{lineSettings:{stroke:C}}:void 0,T=o.series.map((b,G)=>{const W=v.get(b)||g.get(b.fieldName)||I.getIndex(G);return{[Fe]:b.tooltip,[tt]:b.value,columnSettings:{fill:W,stroke:W},..._}}).filter(b=>n!=="pie-chart"||b.value!=null&&b.value>0);n==="pie-chart"?this._createPieChart(e,T):this._createXYChart(e,T)}_getDirection(){return be(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-B8T05uOT.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url);e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(dr)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:pr})}async _createPieChart(e,t){const{TooltipAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-B8T05uOT.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),{PieChartAm5:o,PieSeriesAm5:n}=await w(async()=>{const{PieChartAm5:v,PieSeriesAm5:I}=await import("./pieChart-qcxaoQkv-ulavfogw.js");return{PieChartAm5:v,PieSeriesAm5:I}},__vite__mapDeps([19,3,4,20,13,18,15]),import.meta.url),{mediaInfo:s,root:l}=e,{title:d}=s,c=5,p=s?.altText||s?.title||"",h=l.container.children.push(o.new(l,{ariaLabel:p,focusable:!0,paddingBottom:c,paddingTop:c,paddingLeft:c,paddingRight:c})),m=`{category}: {valuePercentTotal.formatNumber('0.00')}% - ({value})`,f=i.new(l,{labelText:m}),g=h.series.push(n.new(l,{name:d,valueField:tt,categoryField:Fe,tooltip:f}));g.ticks.template.set("forceHidden",!0),g.labels.template.set("forceHidden",!0),g.slices.template.states.create("active",{shiftRadius:c}),this._customizeChartTooltip(f),g.slices.template.setAll({ariaLabel:m,focusable:!0,templateField:"columnSettings"}),g.data.setAll(t),g.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle(te.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-B8T05uOT.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-BHyHhQMG.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([21,13,3,4,18,15,20,17]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(m,{renderer:l.new(m,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(m,{renderer:c.new(m,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:_}));this._customizeChartTooltip(_),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarX",n.new(m,{orientation:"horizontal"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-B8T05uOT.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-BHyHhQMG.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([21,13,3,4,18,15,20,17]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panY",wheelY:"zoomY"});const v=e.yAxes.push(s.new(m,{renderer:c.new(m,{inversed:!0}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.xAxes.push(d.new(m,{renderer:l.new(m,{inside:!1,inversed:be(this.container)}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryY}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:I,yAxis:v,valueXField:tt,categoryYField:Fe,tooltip:_}));this._customizeChartTooltip(_,"vertical"),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarY",n.new(m,{orientation:"vertical"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-B8T05uOT.js"),__vite__mapDeps([16,13,3,4,17,14,18]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,LineSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}=await import("./xyChart-Ch-p5aUf-BHyHhQMG.js");return{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}},__vite__mapDeps([21,13,3,4,18,15,20,17]),import.meta.url),{root:h,mediaInfo:m}=t,{value:f,title:g}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(h,{renderer:l.new(h,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(h,{renderer:c.new(h,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=i[0]?.lineSettings?.stroke,T=o.new(h,{getFillFromSprite:!_,labelText:C});_&&T.get("background")?.setAll({fill:_});const b=e.series.push(p.new(h,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:T}));b.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(T,"vertical"),f.series.length>Zt&&e.set("scrollbarX",n.new(h,{orientation:"horizontal"})),v.data.setAll(i),b.data.setAll(i),b.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:o}=await w(()=>import("./xyChart-Ch-p5aUf-BHyHhQMG.js"),__vite__mapDeps([21,13,3,4,18,15,20,17]),import.meta.url),{root:n,mediaInfo:s}=e,{type:l}=s,d=s?.altText||s?.title||"",c=n.container.children.push(i.new(n,{ariaLabel:d,focusable:!0,panX:!0,panY:!0}));c.set("cursor",o.new(n,{})),l==="column-chart"&&await this._createColumnChart(c,e,t),l==="bar-chart"&&await this._createBarChart(c,e,t),l==="line-chart"&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle(te.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e?.type==="image"&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,o=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const n=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},o);this._refreshTimer=n}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[o,n=""]=e.split("#");return`${o}${i}timestamp=${t}${n?"#":""}${n}`}};r([a()],ie.prototype,"_refreshIntervalInfo",void 0),r([a()],ie.prototype,"attributes",null),r([a()],ie.prototype,"activeMediaInfoIndex",null),r([a()],ie.prototype,"description",null),r([a()],ie.prototype,"fieldInfoMap",null),r([a()],ie.prototype,"layer",null),r([a()],ie.prototype,"mediaInfos",null),r([a()],ie.prototype,"popupTemplate",null),r([a()],ie.prototype,"relatedInfos",null),r([a()],ie.prototype,"title",null),r([a({type:Se})],ie.prototype,"viewModel",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],ie.prototype,"messages",void 0),ie=r([P("esri.widgets.Feature.FeatureMedia")],ie);const Wo=ie,hr="esri.widgets.Feature.support.arcadeFeatureUtils",Ui=()=>Y.getLogger(hr);function mr(e){return typeof e=="string"?ht(fi(e)):Array.isArray(e)?fr(e):e?.declaredClass==="esri.arcade.Dictionary"?gr(e):e}function fr(e){return`
    ${e.map(t=>`
  • ${typeof t=="string"?ht(fi(t)):t}
  • `).join("")}
`}function gr(e){const t=e.keys().map(i=>{const o=e.field(i);return`${i}${typeof o=="string"?ht(fi(o)):o}`}).join("");return`${t}
`}function zo(){return w(()=>import("./arcade-CaGqU4sP-Dk6yM-FW.js"),__vite__mapDeps([22,3,4,23,24,25,26,27,28,29,30,11,8,9,10,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,5,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101]),import.meta.url)}function yr(e){return"createQuery"in e&&"queryFeatures"in e}async function _r({graphic:e,view:t,options:i}){const{isAggregate:o,layer:n}=e;if(!o||!n||t?.type!=="2d")return[];const s=await t.whenLayerView(n);if(!yr(s))return[];const l=s.createQuery(),d=e.getObjectId();l.aggregateIds=d!=null?[d]:[];const{features:c}=await s.queryFeatures(l,i);return c}function vr({layer:e,aggregatedFeatures:t,interceptor:i}){const{fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d}=e;return new Mo({fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d,interceptor:i,...e.type==="feature"?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:t})}async function Ho({expressionInfo:e,arcade:t,interceptor:i,spatialReference:o,map:n,graphic:s,location:l,view:d,options:c}){if(!e?.expression)return null;const{isAggregate:p}=s,h=(s.sourceLayer||s.layer)??void 0,m=p?"feature-reduction-popup":"popup",f=t.createArcadeProfile(m),g=t.createArcadeExecutor(e.expression,f).catch(b=>Ui().error("arcade-executor-error",{error:b,expressionInfo:e})),[v,I]=await Promise.all([_r({graphic:s,view:d,options:c}),g]);if(!I)return null;const C=m==="feature-reduction-popup"?vr({layer:h,aggregatedFeatures:v,interceptor:i}):void 0,_={...m==="feature-reduction-popup"?{$aggregatedFeatures:C}:{$datastore:h?.url,$layer:h!=null&&jn(h)?h:h?.type==="scene"&&h.associatedLayer!=null?h.associatedLayer:void 0,$map:n,$userInput:l,$graph:h?.type==="knowledge-graph-sublayer"?h?.parentCompositeLayer?.knowledgeGraph:void 0},$feature:s},T={abortSignal:c?.signal??void 0,interceptor:i??void 0,rawOutput:!0,spatialReference:o??void 0,timeZone:d?.timeZone};return await I.executeAsync(_,T).catch(b=>Ui().error("arcade-execution-error",{error:b,graphic:s,expressionInfo:e})).finally(()=>C?.destroy())}async function wr({expressionInfos:e,spatialReference:t,graphic:i,interceptor:o,map:n,view:s,location:l,options:d}){if(!e?.length)return{};const c=await zo(),p={};for(const f of e)p[`expression/${f.name}`]=Ho({expressionInfo:f,arcade:c,interceptor:o,spatialReference:t,map:n,graphic:i,location:l,view:s,options:d});const h=await qe(p),m={};for(const f in h)m[f]=mr(h[f].value);return m}const br=1;let se=class extends ge{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const i=t==="fields"?new Rt:t==="media"?new Se:t==="text"?new Lt:null;this._set("contentElementViewModel",i)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=pi(this._compile,br,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:o,spatialReference:n,map:s,location:l,view:d,_abortController:c}=this;if(!t||!i)return void this._set("contentElement",null);const p=await zo();if(c!==this._abortController)return;const h=await Ho({arcade:p,expressionInfo:t,graphic:i,location:l,interceptor:o,map:s,spatialReference:n,view:d});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const m=await h.castAsJsonAsync(c?.signal),f=m?.type,g=f==="media"?_n.fromJSON(m):f==="text"?go.fromJSON(m):f==="fields"?vn.fromJSON(m):null;g.type==="media"&&!g.mediaInfos||g.type==="fields"&&!g.fieldInfos||g.type==="text"&&!g.text?this._set("contentElement",null):this._set("contentElement",g)},this.addHandles([y(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),$),y(()=>[this.contentElement],()=>this._createVM(),$)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery(),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:i}=this;return e?"loading":t||i?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}};r([a()],se.prototype,"_abortController",void 0),r([a({type:rn})],se.prototype,"expressionInfo",void 0),r([a({type:je})],se.prototype,"graphic",void 0),r([a({readOnly:!0})],se.prototype,"contentElement",void 0),r([a({readOnly:!0})],se.prototype,"contentElementViewModel",void 0),r([a()],se.prototype,"interceptor",void 0),r([a({type:ai})],se.prototype,"location",void 0),r([a()],se.prototype,"spatialReference",null),r([a({readOnly:!0})],se.prototype,"state",null),r([a()],se.prototype,"map",null),r([a()],se.prototype,"view",void 0),se=r([P("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],se);const vi=se,Zi="esri-feature",Gi={base:`${Zi}-expression`,loadingSpinnerContainer:`${Zi}__loading-container`};let At=class extends oe{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new vi}initialize(){this.addHandles(y(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),$))}loadDependencies(){return Ae({loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Cbej2XpA.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url)})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return u("div",{class:Gi.base},e==="loading"?this._renderLoading():e==="disabled"?null:this._contentWidget?.render())}_renderLoading(){return u("div",{class:Gi.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t?.type;this._destroyContentWidget();const o=e?i==="fields"?new jo({viewModel:e}):i==="media"?new Wo({viewModel:e}):i==="text"?new bt({viewModel:e}):null:null;this._contentWidget=o,this.scheduleRender()}};r([a({type:vi})],At.prototype,"viewModel",void 0),At=r([P("esri.widgets.Feature.FeatureExpression")],At);const Ir=At;var Qi;(function(e){e.TOO_SHORT="length-validation-error::too-short",e.TOO_LONG="length-validation-error::too-long"})(Qi||(Qi={}));const Ar=e=>{const t=[];if(e.formTemplate){const{description:i,title:o}=e.formTemplate;e.fields?.forEach(n=>{const s=o&&Ei(o,n.name),l=i&&Ei(i,n.name);(s||l)&&t.push(n.name)})}return t},Gt=100;let R=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await ke(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await ke(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=Ye(this._queryController,Gt),this._queryFeatureCountDebounced=Ye(this._queryFeatureCountController,Gt),this._queryPageDebounced=Ye(this._queryPageController,Gt),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.destroyAll(),this.destroyed||i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t?.signal}))))},this.addHandles([y(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),$),y(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),y(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,o=1,n=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,o),n))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(i=>{const o=i.clone();return o.field=ut(i.field,t),o}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&this.relationshipId!=null&&this.objectId!=null&&e?.supportsCount&&e?.supportsPagination)}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new ce}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e?.loaded&&t&&i?Cs(t,e,i)??null:null}get relationship(){const{relationshipId:e,layer:t}=this;return e!=null?t?.relationships?.find(({id:i})=>i===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new ce}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:i,objectId:o,_queryFeatureCountAbortController:n,canQuery:s,supportsCacheHint:l}=this;if(await e?.load(),await t?.load(),!s||!e||!t||o==null)return void this._set("featureCount",0);const d=t.createQuery(),{historicMoment:c,gdbVersion:p}=e,h=new Yt({cacheHint:l,gdbVersion:p,historicMoment:c,relationshipId:i,returnGeometry:!1,objectIds:[o],where:d.where??void 0}),m=await e.queryRelatedFeaturesCount(h,{signal:n?.signal});this._set("featureCount",m[o]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:i}=this;return t?e:i?e.slice(0,i):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:i,_queryPageAbortController:o,featureCount:n}=this;!i||t<2||!n||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:o,displayCount:n,layer:s,relationshipId:l,featurePage:d,featureCount:c,relatedLayer:p,supportsCacheHint:h}=this,{canQuery:m,objectId:f}=this;if(!m||!s||!p||f==null)return[];const g=i?((d-1)*o+c)%c:0,v=i?o:n,I=p.objectIdField,C=[...t.map(ae=>ae.field),...Ar(p),I].filter(Nt),_=t.map(ae=>`${ae.field} ${ae.order}`),T=p.createQuery(),{historicMoment:b,gdbVersion:G}=s,W=new Yt({orderByFields:_,start:g,num:v,outFields:C,cacheHint:h,historicMoment:b,gdbVersion:G,relationshipId:l,returnGeometry:!1,objectIds:[f],where:T.where??void 0}),q=await s.queryRelatedFeatures(W,{signal:e?.signal}),ue=q[f]?.features||[];return ue.forEach(ae=>{ae.sourceLayer=p,ae.layer=p}),ue}};r([a()],R.prototype,"_loaded",void 0),r([a()],R.prototype,"_queryAbortController",void 0),r([a()],R.prototype,"_queryPageAbortController",void 0),r([a()],R.prototype,"_queryFeatureCountAbortController",void 0),r([a({value:1})],R.prototype,"featurePage",null),r([a()],R.prototype,"featuresPerPage",void 0),r([a({readOnly:!0})],R.prototype,"orderByFieldsFixedCasing",null),r([a({readOnly:!0})],R.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],R.prototype,"canLoad",null),r([a({readOnly:!0})],R.prototype,"canQuery",null),r([a()],R.prototype,"description",void 0),r([a({readOnly:!0})],R.prototype,"itemDescriptionFieldName",null),r([a({value:3})],R.prototype,"displayCount",null),r([a({type:je})],R.prototype,"graphic",void 0),r([a()],R.prototype,"layer",void 0),r([a()],R.prototype,"map",void 0),r([a({readOnly:!0})],R.prototype,"objectId",null),r([a({readOnly:!0})],R.prototype,"objectIdField",null),r([a()],R.prototype,"orderByFields",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatures",null),r([a({readOnly:!0})],R.prototype,"relatedLayer",null),r([a({readOnly:!0})],R.prototype,"relationship",null),r([a()],R.prototype,"featureCount",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatureViewModels",null),r([a()],R.prototype,"relationshipId",void 0),r([a()],R.prototype,"showAllEnabled",void 0),r([a()],R.prototype,"state",null),r([a()],R.prototype,"title",void 0),R=r([P("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],R);const wi=R;var oi;const Ft="esri-feature",it=`${Ft}-relationship`,Me={base:it,listContainer:`${it}__list`,listItem:`${it}__list-item`,listItemHidden:`${it}__list-item--hidden`,listContainerQuerying:`${it}__list--querying`,featureObserver:`${Ft}__feature-observer`,stickySpinnerContainer:`${Ft}__sticky-loading-container`,loadingSpinnerContainer:`${Ft}__loading-container`},Xi={title:!0,description:!0};let U=oi=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new wi,this.messages=null,this.messagesCommon=null,this.visibleElements={...Xi},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:o,relatedFeatures:n,featuresPerPage:s,featurePage:l}=this.viewModel;i==="ready"&&o&&n.length>=s*l&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),dt(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Bm5S9Lju.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-BT4YOn58.js"),__vite__mapDeps([107,2,3,4,5,6,108,7,109,110,111,112,105,106,113,1,114,115,116,117,103,104,118]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-DcHoxADM.js"),__vite__mapDeps([119,2,3,4,5,6,108,105,106,7,112,111,110,109,120,104,117,1,103]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Cbej2XpA.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-D67uezlU.js"),__vite__mapDeps([121,2,3,4,5,122,7,6,111,105,106,112,123,117,1]),import.meta.url)})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=wo(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:i,state:o}=this.viewModel;return!e&&!!t&&o==="ready"&&(t>i||i===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return pe(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...Xi,...e}}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(Me.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}async _selectRecord(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:i}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:i}=this;t.showAllEnabled=!0;const o=new oi({flowItems:e,featureVisibleElements:i,visibleElements:{title:!1,description:!1},viewModel:t});e.push(o)}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:Me.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:Me.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=be(this.container)?"chevron-left":"chevron-right";return u("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,i=e.title;e.description=t&&e.formattedAttributes?.global[t];const o=e.state==="loading";return u("calcite-list-item",{class:this.classes(Me.listItem,{[Me.listItemHidden]:o}),description:e.description??"",key:e.uid,label:i,onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?u("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return u("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return u("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:Me.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return u("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return u("div",{class:this.classes(Me.listContainer,{[Me.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(i=>{this.addHandles(y(()=>[i.title,i.state],()=>this.scheduleRender(),$),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};r([a()],U.prototype,"_relatedFeatureIntersectionObserverNode",void 0),r([a({readOnly:!0})],U.prototype,"displayShowAllButton",null),r([a({readOnly:!0})],U.prototype,"displayListItems",null),r([a()],U.prototype,"description",null),r([a({readOnly:!0})],U.prototype,"featureCountDescription",null),r([a()],U.prototype,"featureVisibleElements",void 0),r([a()],U.prototype,"flowItems",void 0),r([a()],U.prototype,"flowType",void 0),r([a()],U.prototype,"headingLevel",void 0),r([a()],U.prototype,"title",null),r([a({type:wi})],U.prototype,"viewModel",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],U.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],U.prototype,"messagesCommon",void 0),r([a()],U.prototype,"visibleElements",void 0),r([et("visibleElements")],U.prototype,"castVisibleElements",null),U=oi=r([P("esri.widgets.Feature.FeatureRelationship")],U);const Fr=U;var Ji;(function(e){e[e.RTJunctionJunctionConnectivity=1]="RTJunctionJunctionConnectivity",e[e.RTAttachment=2]="RTAttachment",e[e.RTContainment=3]="RTContainment",e[e.RTJunctionEdgeConnectivity=4]="RTJunctionEdgeConnectivity",e[e.RTEdgeJunctionEdgeConnectivity=5]="RTEdgeJunctionEdgeConnectivity"})(Ji||(Ji={})),new di({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation"});const vt=new di({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionMidspanConnectivity:"junction-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"}),Mr=Array.from({length:33},(e,t)=>2*t),Cr=new Map([[1,"connectivity"],[2,"containment"],[3,"attachment"],[4,"junction-edge-from-connectivity"],[5,"junction-midspan-connectivity"],[6,"junction-edge-to-connectivity"]]);new di({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});let me=class extends bo{constructor(e){super(e),this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};r([a({type:Number,json:{write:!0}})],me.prototype,"assetGroupCode",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"assetTypeCode",void 0),r([a({type:String,json:{write:!0}})],me.prototype,"globalId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"networkSourceId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"objectId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionFrom",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionTo",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"terminalId",void 0),me=r([P("esri.rest.networks.support.NetworkElement")],me);const Ke=me;let J=class extends bo{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return new Ke({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId)}readToNetworkElement(e,t){return new Ke({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId)}};r([a({type:String,json:{write:!0}})],J.prototype,"globalId",void 0),r([a({type:vt.apiValues,json:{type:vt.jsonValues,read:vt.read,write:vt.write}})],J.prototype,"associationType",void 0),r([a({type:Ke,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId"]}}})],J.prototype,"fromNetworkElement",void 0),r([Fi("fromNetworkElement")],J.prototype,"readFromNetworkElement",null),r([Mi("fromNetworkElement")],J.prototype,"writeFromNetworkElement",null),r([a({type:Ke,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId"]}}})],J.prototype,"toNetworkElement",void 0),r([Fi("toNetworkElement")],J.prototype,"readToNetworkElement",null),r([Mi("toNetworkElement")],J.prototype,"writeToNetworkElement",null),r([a({type:an,json:{write:!0}})],J.prototype,"geometry",void 0),r([a({type:String,json:{write:!0}})],J.prototype,"errorMessage",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"percentAlong",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"errorCode",void 0),r([a({type:Boolean,json:{write:!0}})],J.prototype,"isContentVisible",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"status",void 0),J=r([P("esri.rest.networks.support.Association")],J);const Er=J,V={fromGlobalId:"fromglobalid",fromNetworkSourceId:"fromnetworksourceid",fromTerminalId:"fromterminalid",toGlobalId:"toglobalid",toNetworkSourceId:"tonetworksourceid",toTerminalId:"toterminalid",associationType:"associationtype",globalId:"globalid",status:"status",isContentVisible:"iscontentvisible",percentAlong:"percentalong",assetGroup:"assetgroup",assetType:"assettype"},Yi=100;let E=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await ke(this._query(t)),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=Ye(this._queryController,Yi),this._queryFeatureCountDebounced=Ye(this._queryFeatureCountController,Yi)}initialize(){this.associationTypes?.forEach(e=>{e.open=!1}),this.addHandles([...this.associationTypes?.map(e=>y(()=>e.open,()=>{e.open&&this._queryDebounced(e)}))??[],y(()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery],()=>this._queryFeatureCountDebounced(),$)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&typeof this.globalId=="string"}get canQuery(){const e=this.layer?.capabilities?.query;return!!this.associationTypes&&typeof this.globalId=="string"&&!!e?.supportsPagination}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:e}=this;return e?.type==="subtype-sublayer"&&e?.parent?e.parent.globalIdField??null:e?.globalIdField??null}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o&&this.featureCount!==0?"ready":"disabled"}get utilityNetwork(){const{layer:e,map:t}=this;return e?.loaded&&t?e?.type==="subtype-sublayer"&&e?.parent?Si(t,e.parent)??null:Si(t,e)??null:null}get associationsLayer(){const{utilityNetwork:e}=this;return e?.loaded?new Mo({url:e.networkSystemLayers.associationsTableUrl,gdbVersion:e.gdbVersion}):null}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new ce}get structureAssociations(){return this._get("structureAssociations")||new ce}get contentAssociations(){return this._get("contentAssociations")||new ce}get containerAssociations(){return this._get("containerAssociations")||new ce}get connectivityAssociations(){return this._get("connectivityAssociations")||new ce}get associationFeatures(){return this._get("associationFeatures")||new Co}get associationViewModels(){return this._get("associationViewModels")||new Map}refresh(){this._queryFeatureCountDebounced()}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach(e=>e.destroyAll())}_generateGlobalIdWhereClause(e,t){const{globalId:i,networkSourceIdsInUse:o}=this,{associatedNetworkSourceId:n}=e,s=t.fieldsIndex.get(V.fromGlobalId),l=t.fieldsIndex.get(V.toGlobalId),d=t.fieldsIndex.get(V.fromNetworkSourceId),c=t.fieldsIndex.get(V.toNetworkSourceId),p=n!=null,h=`(${Array.from(o.values())})`,m=p?` AND ${c.name} = ${n} AND ${c.name} IN ${h}`:"",f=p?` AND ${d.name} = ${n} AND ${d.name} IN ${h}`:"";switch(e.type){case"connectivity":return`((${s.name} = '${i}'${m}) OR (${l.name} = '${i}'${f}))`;case"attachment":case"content":return`${s.name} = '${i}'${m}`;case"container":case"structure":return`${l.name} = '${i}'${f}`;default:return""}}_generateNetworkSourceIdWhereClause(e){const{networkSourceIdsInUse:t}=this,i=`(${Array.from(t.values())})`,o=e.fieldsIndex.get(V.fromNetworkSourceId),n=e.fieldsIndex.get(V.toNetworkSourceId);return`(${o.name} IN ${i} AND ${n.name} IN ${i})`}_generateAssociationTypeWhereClause(e,t){const i=t.fieldsIndex.get(V.associationType);switch(e.type){case"attachment":case"structure":return`${i.name} = 3`;case"connectivity":return`${i.name} IN (1, 4, 5, 6)`;case"container":case"content":return`${i.name} = 2`;default:return""}}_generateWhereClause(e,t){const i=t.fieldsIndex.get(V.status),o=`(${Mr.join(",")})`,n=`${i.name} IN ${o}`;return`(${this._generateGlobalIdWhereClause(e,t)} AND ${n} AND ${this._generateAssociationTypeWhereClause(e,t)})`}async _loadUtiltyNetworks(){const e=this.map;if(!e)return;await Promise.allSettled(e.utilityNetworks?.map(async o=>{await o.load()})??[]);const t=o=>{if("layerId"in o&&i.isUtilityLayer(o)){const n=i.getSourceIdByLayerId(o.layerId);n!==null&&this.networkSourceIdsInUse.add(n)}},i=this.utilityNetwork;this._set("networkSourceIdsInUse",new Set),e.allLayers.forEach(t),e.allTables.forEach(t)}async _findLayersBySourceId(e){const{utilityNetwork:t,map:i}=this,o=c=>{const p=c;return c.url&&p.layerId===n?c.url.replace(/\/\d+$/,"")===t?.featureServiceUrl:!1};await t?.load();const n=t.getLayerIdBySourceId(e),s=i.allLayers.filter(o),l=i.allTables.filter(o),d=s.concat(l).toArray();return await Promise.allSettled(d.map(c=>c.load())),d}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach(e=>e.removeAll()),this.associationFeatures.clear()}_getAssociationsByType(e){switch(e){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}_createAssociationFromFeature(e,t){if(!e)return null;const i=Cr.get(t.attributes[e.fieldsIndex.get(V.associationType).name]);return new Er({globalId:t.attributes[e.fieldsIndex.get(V.globalId).name],fromNetworkElement:new Ke({globalId:t.attributes[e.fieldsIndex.get(V.fromGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.fromNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.fromTerminalId).name]}),toNetworkElement:new Ke({globalId:t.attributes[e.fieldsIndex.get(V.toGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.toNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.toTerminalId).name]}),associationType:i,status:t.attributes[e.fieldsIndex.get(V.status).name],isContentVisible:t.attributes[e.fieldsIndex.get(V.isContentVisible).name],percentAlong:t.attributes[e.fieldsIndex.get(V.percentAlong).name]})}async _queryLayer(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=i!=null,c=o!=null,p="("+t.map(v=>`'${v}'`).join(", ")+")",h=d?` AND ${s?.name} = ${i}`:"",m=d&&c?` AND ${l?.name} = ${o}`:"",f=`${e.globalIdField} IN ${p}`+h+m,g=new lt({outFields:["*"],cacheHint:this.supportsCacheHint,where:f});return await this._queryAll(g,e,{signal:n?.signal})}async _createAssociationFeatureObjects(e,t,i,o,n,s){if(e.length===0)return[];const l=new Map;for(const[c,p]of t){const h=await this._findLayersBySourceId(c);for(const m of h)(await this._queryLayer(m,p,o,n,s)).forEach(f=>{if(f.getEffectivePopupTemplate()&&f.layer){const g=l.get(f.attributes[m.globalIdField])??[];g.push(f),l.set(f.attributes[m.globalIdField],g)}})}const d=[];return e.toArray().forEach(c=>{const p=c.fromNetworkElement.globalId===i?c.toNetworkElement:c.fromNetworkElement;(l.get(p.globalId)??[]).forEach(h=>{const m=this.utilityNetwork?.getTerminalById(p?.terminalId)?.name;d.push({association:c,feature:h,terminalName:m})})}),d}_parseFeatureObjects(e,t){e.forEach(i=>{const o=i?.feature,n=o.layer,s=t.get(n)??new ce;s.add(i),t.set(n,s)})}async _queryAll(e,t,i){const o=[];let n=0,s=!1;e.num=t.sourceJSON?.maxRecordCount??2e3;do{e.start=n;const l=await t.queryFeatures(e,i);o.push(...l.features),s=l.exceededTransferLimit,s&&(n+=l.features.length)}while(s);return o}async _queryAssociatedFeatureCount(e){const{layer:t,globalId:i,supportsCacheHint:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d}=this;if(await Promise.allSettled([t?.load(),l?.load(),s?.load()]),this._clearAssociations(),!(d&&t&&n&&s))return;const c=s.fieldsIndex.get(V.toGlobalId).name,p=s.fieldsIndex.get(V.fromGlobalId).name,h=n.map(_=>this._generateWhereClause(_,s)),m=this._generateNetworkSourceIdWhereClause(s),f=h.join(" OR "),g=new lt({outFields:["*"],cacheHint:o,returnGeometry:!1,where:`(${f}) AND (${m})`}),v=await this._queryAll(g,s,{signal:e?.signal}),I=new Map;n.forEach(_=>{I.set(_.type,[])}),v.forEach(_=>{const T=s.fieldsIndex.get(V.associationType);switch(_.attributes[T.name]){case 1:case 4:case 5:case 6:_.attributes[p]===i?I.get("connectivity").push(_.attributes[c]):I.get("connectivity").push(_.attributes[p]),this.connectivityAssociations.add(this._createAssociationFromFeature(s,_));break;case 2:_.attributes[p]===i?(I.get("content").push(_.attributes[c]),this.contentAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("container").push(_.attributes[p]),this.containerAssociations.add(this._createAssociationFromFeature(s,_)));break;case 3:_.attributes[p]===i?(I.get("attachment").push(_.attributes[c]),this.attachmentsAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("structure").push(_.attributes[p]),this.structureAssociations.add(this._createAssociationFromFeature(s,_)))}});const C=n.map(async _=>{const{associatedNetworkSourceId:T,associatedAssetGroup:b,associatedAssetType:G}=_,W=I.get(_.type),q=b!=null?await this._countAssociatedFeatures(T,W,b,G,e):W.length;switch(_.type){case"attachment":this._set("attachmentsFeatureCount",q);break;case"structure":this._set("structureFeatureCount",q);break;case"content":this._set("contentFeatureCount",q);break;case"container":this._set("containerFeatureCount",q);break;case"connectivity":this._set("connectivityFeatureCount",q)}});await Promise.allSettled(C)}async _countAssociatedFeatureCount(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=o!=null,c="("+t.map(f=>`'${f}'`).join(", ")+")",p=` AND ${s?.name} = ${i}`,h=d?` AND ${l?.name} = ${o}`:"",m=`${e.globalIdField} IN ${c}`+p+h;return e.queryFeatureCount({where:m,outFields:["*"],returnGeometry:!1},{signal:n?.signal})}async _countAssociatedFeatures(e,t,i,o,n){if(t.length===0)return 0;const s=(await this._findLayersBySourceId(e)).map(async l=>this._countAssociatedFeatureCount(l,t,i,o,n));return(await Promise.all(s)).reduce((l,d)=>l+d,0)}async _queryAssociatedFeatures(e,t){const{layer:i,globalId:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d,associationFeatures:c}=this;if(await Promise.allSettled([i?.load(),l?.load(),s?.load()]),!(d&&i&&n&&s))return;const p=this._getAssociationsByType(e.type),{associatedAssetGroup:h,associatedAssetType:m}=e,f=new Map;p.forEach(v=>{const{networkSourceId:I,elementGlobalId:C}=v.fromNetworkElement.globalId===o?{networkSourceId:v.toNetworkElement.networkSourceId,elementGlobalId:v.toNetworkElement.globalId}:{networkSourceId:v.fromNetworkElement.networkSourceId,elementGlobalId:v.fromNetworkElement.globalId},_=f.get(I)||[];_.push(C),f.set(I,_)});const g=await this._createAssociationFeatureObjects(p,f,o,h,m,t);this._parseFeatureObjects(g,c)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:e,canQuery:t}=this;t?(await this._queryAssociatedFeatureCount(e),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(e){await this._loadUtiltyNetworks();const{_queryAbortController:t}=this;this.featureCount&&(this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this.destroyed||await this._queryAssociatedFeatures(e,{signal:t?.signal}))}};r([a()],E.prototype,"_loaded",void 0),r([a()],E.prototype,"_queryAbortController",void 0),r([a()],E.prototype,"_queryPageAbortController",void 0),r([a()],E.prototype,"_queryFeatureCountAbortController",void 0),r([a({readOnly:!0})],E.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],E.prototype,"canLoad",null),r([a({readOnly:!0})],E.prototype,"canQuery",null),r([a()],E.prototype,"networkSourceIdsInUse",void 0),r([a()],E.prototype,"description",void 0),r([a({type:je})],E.prototype,"graphic",void 0),r([a()],E.prototype,"layer",void 0),r([a()],E.prototype,"map",void 0),r([a({readOnly:!0})],E.prototype,"objectId",null),r([a({readOnly:!0})],E.prototype,"objectIdField",null),r([a({readOnly:!0})],E.prototype,"globalId",null),r([a({readOnly:!0})],E.prototype,"globalIdField",null),r([a()],E.prototype,"featureCount",void 0),r([a()],E.prototype,"associationTypes",void 0),r([a()],E.prototype,"showAllEnabled",void 0),r([a()],E.prototype,"state",null),r([a()],E.prototype,"title",void 0),r([a({readOnly:!0})],E.prototype,"utilityNetwork",null),r([a({readOnly:!0})],E.prototype,"associationsLayer",null),r([a({readOnly:!0})],E.prototype,"attachmentsFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"structureFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"attachmentsAssociations",null),r([a({readOnly:!0})],E.prototype,"structureAssociations",null),r([a({readOnly:!0})],E.prototype,"contentFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"containerFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"contentAssociations",null),r([a({readOnly:!0})],E.prototype,"containerAssociations",null),r([a({readOnly:!0})],E.prototype,"connectivityFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"connectivityAssociations",null),r([a({readOnly:!0})],E.prototype,"associationFeatures",null),r([a({readOnly:!0})],E.prototype,"associationViewModels",null),E=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],E);const ft=E;let st=class extends ge{constructor(e){super(e),this.title=!0,this.description=!0}};r([a({type:Boolean,nonNullable:!0})],st.prototype,"title",void 0),r([a({type:Boolean,nonNullable:!0})],st.prototype,"description",void 0),st=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.VisibleElements")],st);const Ot=st;var ni;const rt="esri-feature",ze=`${rt}-relationship`,He={base:ze,listContainer:`${ze}__list`,listItem:`${ze}__list-item`,listItemHidden:`${ze}__list-item--hidden`,listContainerQuerying:`${ze}__list--querying`,featureObserver:`${rt}__feature-observer`,stickySpinnerContainer:`${rt}__sticky-loading-container`,loadingSpinnerContainer:`${rt}__loading-container`,expander:`${ze}__expander`,filterContainer:`${rt}__filter-container`};let S=ni=class extends oe{constructor(e,t){super(e,t),this.flowType="feature-utility-network-association-type",this.description=null,this.headingLevel=2,this.title=null,this.viewModel=new ft,this.parentFeatureViewModel=null,this.listType=null,this.selectedLayer=null,this.flowItems=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot,this._featuresPerPage=50,this._maxNumFeatures=1e3,this._currentFeaturePage=1,this._previewDisplayCount=3,this._associatedFeatureIntersectionObserverNode=null,this._associatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._tooltipReferenceMap=new Co,this._filterText=""}initialize(){this.addHandles([y(()=>[this._associatedFeatureIntersectionObserverNode],()=>this._handleAssociatedFeatureObserverChange())])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-rXOunzT9.js"),__vite__mapDeps([124,2,3,4,5,6,111,112,105,106,7,108,117,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Bm5S9Lju.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),input:()=>w(()=>import("./calcite-input-BKRd7MCS-BjdnYfeD.js"),__vite__mapDeps([125,114,2,3,4,5,6,115,108,106,116,117,111,105,7,112,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Cbej2XpA.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-BT4YOn58.js"),__vite__mapDeps([107,2,3,4,5,6,108,7,109,110,111,112,105,106,113,1,114,115,116,117,103,104,118]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-DcHoxADM.js"),__vite__mapDeps([119,2,3,4,5,6,108,105,106,7,112,111,110,109,120,104,117,1,103]),import.meta.url),tooltip:()=>w(()=>import("./calcite-tooltip-63c9fmIw-C6HlFBgP.js"),__vite__mapDeps([126,2,3,4,5,6,127,113,104,123,128]),import.meta.url)})}destroy(){this._tooltipReferenceMap.clear()}get _numAssociatedFeatures(){const e=this.viewModel.associationViewModels;return this.selectedLayer?e.get(this.selectedLayer).length:0}set currentFeaturePage(e){const{_featuresPerPage:t,_numAssociatedFeatures:i}=this,o=1,n=Math.ceil(i/t)||1;this._currentFeaturePage=Math.max(Math.min(e,n),o)}get currentFeaturePage(){return this._currentFeaturePage}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:o}=this.parentFeatureViewModel??{};return u("div",{class:this.classes(He.base,M.widget)},t==="loading"||t==="querying"||o==="loading"?this._renderLoading():u("calcite-list",null,i&&this.selectedLayer?u(Ao,null,this._renderFilter(),this._renderAssociatedFeatureListPage(),this._renderFeatureObserver()):Array.from(e.keys(),n=>this._renderTypeList(n,e.get(n)))))}_renderFilter(){return u("div",{class:He.filterContainer,key:"filter"},u("calcite-input",{icon:"search",placeholder:this.messages.associationFilterPlaceholder,type:"search",onCalciteInputInput:e=>{this._filterText=e.target.value.trim().toLowerCase(),this._currentFeaturePage=1}}))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:o}=this;if(!t||!e)return;i.showAllEnabled=!0;const n=new ni({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:o,visibleElements:{title:!1,description:!1},viewModel:i});t.push(n)}_renderAssociatedFeatureListPage(){const{currentFeaturePage:e,_featuresPerPage:t,_maxNumFeatures:i,_filterText:o}=this,n=Math.min(e*t,i),s=this.viewModel.associationViewModels.get(this.selectedLayer).filter(l=>xt(l.featureViewModel).toLowerCase().includes(o)).slice(0,n);return[...this._renderTooltips(s),...this._renderAssociatedFeatureList(s)]}async _handleAssociatedFeatureObserverChange(){this._associatedFeatureIntersectionObserverNode&&this._associatedFeatureIntersectionObserver.unobserve(this._associatedFeatureIntersectionObserverNode);const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._associatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._associatedFeatureIntersectionObserver.observe(this._associatedFeatureIntersectionObserverNode)}_associatedFeatureIntersectionObserverCreated(e){this._associatedFeatureIntersectionObserverNode=e}_renderFeatureObserver(){return u("div",{afterCreate:this._associatedFeatureIntersectionObserverCreated,bind:this,class:He.featureObserver,key:"feature-observer"})}_increaseFeaturePage(){this.currentFeaturePage++}_renderLoading(){return u("div",{class:He.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}isConnectivity(e){return["connectivity","junction-junction-connectivity","junction-edge-from-connectivity","junction-midspan-connectivity","junction-edge-to-connectivity"].includes(e.association.associationType)}_getConnectivityTooltip(e){switch(e){case"connectivity":case"junction-junction-connectivity":return this.messages.associationsJunctionJunction;case"junction-edge-from-connectivity":return this.messages.associationsJunctionEdgeFrom;case"junction-midspan-connectivity":return this.messages.associationsJunctionEdgeMidspan;case"junction-edge-to-connectivity":return this.messages.associationsJunctionEdgeTo;default:return""}}_renderItemTooltip(e){const{_tooltipReferenceMap:t}=this;return this.isConnectivity(e)?u("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,referenceElement:t.get(e.featureViewModel.uid)},this._getConnectivityTooltip(e.association.associationType)):null}_renderConnectivityIcon(e,t){let i;switch(e){case"junction-edge-from-connectivity":i="connection-end-left";break;case"junction-edge-to-connectivity":i="connection-end-right";break;case"junction-midspan-connectivity":i="connection-middle";break;default:i="connection-to-connection"}return u("calcite-icon",{afterCreate:o=>this._tooltipReferenceMap.set(t,o),afterRemoved:()=>this._tooltipReferenceMap.delete(t),icon:i,scale:"s",slot:"content-start"})}_formatPercentAlong(e){return`${Be(e.association.percentAlong,{style:"percent",maximumFractionDigits:2})}`}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=xt(t),o=t.state==="loading",n=this._findFlowItem(t),s=n<0&&this._isParentFeature(t),l=s||n>=0,d=this.isConnectivity(e),c=d&&e.association.associationType==="junction-midspan-connectivity";return u("calcite-list-item",{class:this.classes(He.listItem,{[He.listItemHidden]:o}),description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(s,n,t)},d?this._renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,c?u("calcite-chip",{scale:"s",slot:"content-end",value:e.association.percentAlong},this._formatPercentAlong(e)):null,this._renderChevronIconNode(l))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(o=>{"showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const o=this.flowItems.pop();o&&("showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,o=i?.layer;let n=null;o?.type==="subtype-sublayer"&&o.parent?n=o.parent.globalIdField??null:o&&"globalIdField"in o&&(n=o.globalIdField);const s=n?i?.attributes[n]:null,l=t.graphic,d=l?.layer;let c=null;d?.type==="subtype-sublayer"&&d.parent?c=d.parent.globalIdField??null:d&&"globalIdField"in d&&(c=d.globalIdField);const p=c?l?.attributes[c]:null;return s&&p&&s===p}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if(t.flowType!=="feature")return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(t=>this._renderItemTooltip(t))}_renderAssociatedFeatureList(e){return e.toArray().map(t=>this._renderAssociatedFeature(t))}_renderChevronIconNode(e){return u("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messages:i}=this,o=t.slice(0,this._previewDisplayCount),n=o.lengththis._showAllAssociations(e)},u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};r([a()],S.prototype,"flowType",void 0),r([a()],S.prototype,"description",void 0),r([a()],S.prototype,"headingLevel",void 0),r([a()],S.prototype,"title",void 0),r([a({type:ft})],S.prototype,"viewModel",void 0),r([a()],S.prototype,"parentFeatureViewModel",void 0),r([a()],S.prototype,"listType",void 0),r([a()],S.prototype,"selectedLayer",void 0),r([a()],S.prototype,"featureVisibleElements",void 0),r([a()],S.prototype,"flowItems",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],S.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],S.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],S.prototype,"visibleElements",void 0),r([a()],S.prototype,"_featuresPerPage",void 0),r([a()],S.prototype,"_maxNumFeatures",void 0),r([a()],S.prototype,"_numAssociatedFeatures",null),r([a()],S.prototype,"_currentFeaturePage",void 0),r([a()],S.prototype,"currentFeaturePage",null),r([a()],S.prototype,"_previewDisplayCount",void 0),r([a()],S.prototype,"_associatedFeatureIntersectionObserverNode",void 0),r([a()],S.prototype,"_tooltipReferenceMap",void 0),r([a()],S.prototype,"_filterText",void 0),S=ni=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociationType")],S);const Tr=S,Mt="esri-feature",Ue=`${Mt}-relationship`,ot={base:Ue,listContainer:`${Ue}__list`,listItem:`${Ue}__list-item`,listItemHidden:`${Ue}__list-item--hidden`,listContainerQuerying:`${Ue}__list--querying`,featureObserver:`${Mt}__feature-observer`,stickySpinnerContainer:`${Mt}__sticky-loading-container`,loadingSpinnerContainer:`${Mt}__loading-container`,expander:`${Ue}__expander`};let re=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=2,this.viewModel=new ft,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-rXOunzT9.js"),__vite__mapDeps([124,2,3,4,5,6,111,112,105,106,7,108,117,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Bm5S9Lju.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Cbej2XpA.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-D67uezlU.js"),__vite__mapDeps([121,2,3,4,5,122,7,6,111,105,106,112,123,117,1]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-BT4YOn58.js"),__vite__mapDeps([107,2,3,4,5,6,108,7,109,110,111,112,105,106,113,1,114,115,116,117,103,104,118]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-DcHoxADM.js"),__vite__mapDeps([119,2,3,4,5,6,108,105,106,7,112,111,110,109,120,104,117,1,103]),import.meta.url)})}destroy(){this._featureElementInfo=wo(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(ot.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:ot.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:ot.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_selectAssociationType(e){const{viewModel:t,flowItems:i,parentFeatureViewModel:o}=this;if(!i)return;const{associationTypes:n}=t;n.forEach(l=>{l.type===e.type?l.open=!0:l.open=!1});const s=new Tr({viewModel:t,parentFeatureViewModel:o,listType:e,title:this._getAssociationTypeTitle(e),featureVisibleElements:this.featureVisibleElements,description:this.parentFeatureViewModel?.title,flowItems:i});i.push(s)}_renderAssociationType(e){const t=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:t,value:e.type,onCalciteListItemSelect:()=>this._selectAssociationType(e)},u("calcite-chip",{scale:"s",slot:"content-end",value:e.type},this._getFeatureCount(e.type)),u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_getFeatureCount(e){switch(e){case"attachment":return this.viewModel.attachmentsFeatureCount;case"structure":return this.viewModel.structureFeatureCount;case"content":return this.viewModel.contentFeatureCount;case"container":return this.viewModel.containerFeatureCount;case"connectivity":return this.viewModel.connectivityFeatureCount}}_renderAssociations(e){return u("div",null,this._getFeatureCount(e.type)>0?this._renderAssociationType(e):null)}_renderContent(){const{state:e,associationTypes:t}=this.viewModel;return u("div",{class:this.classes(ot.listContainer,{[ot.listContainerQuerying]:e==="querying"}),key:"list-container"},e==="ready"?u("calcite-list",null,t.map(i=>this._renderAssociations(i))):null,this._renderStickyLoading())}};r([a()],re.prototype,"flowType",void 0),r([a()],re.prototype,"flowItems",void 0),r([a()],re.prototype,"parentFeatureViewModel",void 0),r([a()],re.prototype,"featureVisibleElements",void 0),r([a()],re.prototype,"description",null),r([a()],re.prototype,"headingLevel",void 0),r([a()],re.prototype,"title",null),r([a({type:ft})],re.prototype,"viewModel",void 0),r([a(),K("esri/widgets/Feature/t9n/Feature")],re.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],re.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],re.prototype,"visibleElements",void 0),re=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],re);const xr=re;let kr=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=i=>{}),this.preRequestCallback||(this.preLayerQueryCallback=i=>{})}};var Qe;const Lr=1,Ki="content-view-models",eo="relationship-view-models",Pr="association-view-models",to={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let O=Qe=class extends li(ge){constructor(e){super(e),this._error=null,this._featureAbortController=null,this._associationVMAbortController=null,this._graphicChangedThrottled=pi(this._graphicChanged,Lr,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...to},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=t=>{const{abilities:i}=this;return t.type==="attachments"&&!!i.attachmentsContent||t.type==="custom"&&!!i.customContent||t.type==="fields"&&!!i.fieldsContent||t.type==="media"&&!!i.mediaContent||t.type==="text"&&!!i.textContent||t.type==="expression"&&!!i.expressionContent||t.type==="relationship"&&!!i.relationshipContent||t.type==="utility-network-associations"&&!!i.utilityNetworkAssociationsContent},this.addHandles(y(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),$))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return vs(Ri(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return xo(this.graphic)}castAbilities(e){return{...to,...e}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._featureAbortController=new AbortController,this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){return!(!this._featureAbortController&&!this._associationVMAbortController)}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Se&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await i?.load();const o=i?.objectIdField;if(!o||!e||!i)return;const n=e?.attributes?.[o];if(n==null)return;const s=[n];if(!e.geometry){const l=await Vo({layer:i,graphic:e,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:t}),d=l?.geometry;d&&(e.geometry=d)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:e}=this;if(!e)return;const t=new AbortController;this._featureAbortController=t;try{await this._queryFeature({signal:t.signal})}catch(i){Et(i)||(this._error=i,Y.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===t&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:e}=this;e&&e.abort(),this._featureAbortController=null}_compileContentElement(e,t){return e.type==="attachments"?this._compileAttachments(e,t):e.type==="custom"?this._compileCustom(e,t):e.type==="fields"?this._compileFields(e,t):e.type==="media"?this._compileMedia(e,t):e.type==="text"?this._compileText(e,t):e.type==="expression"?this._compileExpression(e,t):e.type==="relationship"?this._compileRelationship(e,t):e.type==="utility-network-associations"?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((t,i)=>this._compileContentElement(t,i)).filter(Nt):typeof e=="string"?this._compileText(new go({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(eo),this.removeHandles(Ki),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),o=t?.getObjectId();return i!=null&&o!=null&&i===o}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:o,spatialReference:n,timeZone:s}=this;t?.filter(Boolean).forEach(l=>{e.some(d=>this._matchesFeature(d,l))||e.add(new Qe({abilities:{relationshipContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:l}))}),e.forEach(l=>{t?.find(d=>this._matchesFeature(l,d))||e.remove(l)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:o,contentElementViewModel:n}=e,s=o?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createFieldsVMParams(o,t))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createMediaVMParams(o,t))),s==="text"&&n.set(this._createTextVMParams(o)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:o,relationshipId:n,title:s,description:l}=e,{_sourceLayer:d,graphic:c,map:p}=this;if(!$o(d))return;const h=new wi({displayCount:i,graphic:c,orderByFields:o,relationshipId:n,layer:d,map:p,...this._compileTitleAndDesc({title:s,description:l})});return this.contentViewModels[t]=h,this.addHandles(dt(()=>h.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(h)),eo),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,o=t?.association.globalId;return i!=null&&o!=null&&i===o}async _setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:o,spatialReference:n,timeZone:s}=this;e.forEach((d,c)=>{const p=t.get(c);p?d.forEach(h=>{p.find(m=>this._matchesGlobalFeature(h,m))||(d.remove(h),d.length===0&&e.delete(c))}):(d.removeAll(),e.delete(c))}),t.forEach((d,c)=>{const p=e.get(c)||new ce;d?.filter(Boolean).forEach(h=>{p.some(m=>this._matchesGlobalFeature(m,h))||p.add({association:h.association,featureViewModel:new Qe({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:h.feature}),terminalName:h.terminalName})}),e.set(c,p)});const l=new AbortController;this._associationVMAbortController=l,await this._sortListObjectsByTitle(e,{signal:l.signal}),this._associationVMAbortController===l&&(this._associationVMAbortController=null)}async _sortListObjectsByTitle(e,t){for(const i of e.values()){const o=i.map(n=>yo(()=>n.featureViewModel.state==="ready",t?.signal));await Promise.all(o),i.sort(this._compareByFeatureTitle)}}_compareByFeatureTitle(e,t){const i=xt(e.featureViewModel),o=xt(t.featureViewModel);return i.localeCompare(o,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{title:i,description:o,associationTypes:n}=e,{_sourceLayer:s,graphic:l,map:d}=this;if(!hs(s))return;const c=new ft({graphic:l,associationTypes:n,layer:s,map:d,...this._compileTitleAndDesc({title:i,description:o})});return this.contentViewModels[t]=c,this.addHandles([y(()=>c.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(c.associationViewModels,c.associationFeatures,c.map))],Pr),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:o,map:n,spatialReference:s,view:l,location:d}=this,c=new vi({expressionInfo:i,graphic:o,interceptor:Qe.interceptor,map:n,spatialReference:s,view:l,location:d});return this.contentViewModels[t]=c,this.addHandles(y(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,t),$),Ki),e}_compileAttachments(e,t){const{graphic:i}=this,{description:o,title:n}=e;return this.contentViewModels[t]=new yi({graphic:i,...this._compileTitleAndDesc({title:n,description:o})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:o,destroyer:n}=e;return this.contentViewModels[t]=new Lt({graphic:i,creator:o,destroyer:n}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:o,graphic:n,formattedAttributes:s}=this,l=n?.attributes,d=this._expressionAttributes,c=s.global;return{title:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:e}),description:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,o=this.formattedAttributes,n={...o?.global,...o?.content[t]},s=e?.fieldInfos||i?.fieldInfos,l=s?.filter(({fieldName:h})=>!!h&&(hi(h)||Ie(h)||n.hasOwnProperty(h))),d=i?.expressionInfos,{description:c,title:p}=e;return{attributes:n,expressionInfos:d,fieldInfos:l,...this._compileTitleAndDesc({title:p,description:c})}}_compileFields(e,t){const i=e.clone(),o=new Rt(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=o,i.fieldInfos=o.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:o,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:l,_sourceLayer:d,_expressionAttributes:c}=this,p=this.formattedAttributes,h=o?.attributes??{},{description:m,mediaInfos:f,title:g}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:h,isAggregate:o?.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:c,mediaInfos:f,popupTemplate:s,relatedInfos:l,...this._compileTitleAndDesc({title:g,description:m})}}_compileMedia(e,t){const i=e.clone(),o=new Se(this._createMediaVMParams(e,t));return i.mediaInfos=o.formattedMediaInfos.slice(),this.contentViewModels[t]=o,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:o,_expressionAttributes:n}=this;if(e&&e.text){const s=t?.attributes??{},l=this.formattedAttributes?.global??{};e.text=Ve({attributes:s,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:o,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new Lt(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:o}=this;if(!e)return;const{lastEditInfoEnabled:n}=e,s=t?.editFieldsInfo;return n&&s?_s(s,i?.attributes,o,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:o,_expressionAttributes:n}=this,s=o?.attributes??{},l=this.formattedAttributes?.global??{};return Ve({attributes:s,fieldInfoMap:t,globalAttributes:l,expressionAttributes:n,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"content",value:e?.content,event:{graphic:t}}):null}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:o,_effectivePopupTemplate:n}=this,s=this.map,l=this.view,d=this.spatialReference,c=this.location;if(t!==this._featureAbortController||!o)return;await bs({graphic:o,popupTemplate:n,layer:i,spatialReference:d},e);const{content:{value:p},title:{value:h}}=await qe({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:m}}=await qe({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:wr({expressionInfos:n?.expressionInfos,spatialReference:d,graphic:o,map:s,interceptor:Qe.interceptor,view:l,options:e,location:c})});t===this._featureAbortController&&o&&(this._expressionAttributes=m,this._graphicExpressionAttributes={...o.attributes,...m},this._set("formattedAttributes",this._createFormattedAttributes(p)),this._set("title",this._compileTitle(h)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(p)||null))}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:o,graphic:n,relatedInfos:s,_sourceLayer:l,_fieldInfoMap:d,_graphicExpressionAttributes:c,timeZone:p}=this;i.content[t]=Bt({fieldInfos:o?.fieldInfos,graphic:n,attributes:{...c,...e.attributes},layer:l,fieldInfoMap:d,relatedInfos:s,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:o,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:l,_graphicExpressionAttributes:d,timeZone:c}=this;i.content[t]=Bt({fieldInfos:e.fieldInfos,graphic:o,attributes:{...d,...e.attributes},layer:s,fieldInfoMap:l,relatedInfos:n,timeZone:c})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:o,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:l,timeZone:d}=this,c=t?.fieldInfos,p={global:Bt({fieldInfos:c,graphic:i,attributes:l,layer:n,fieldInfoMap:s,relatedInfos:o,timeZone:d}),content:[]};return Array.isArray(e)&&e.forEach((h,m)=>{h.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p}),h.type==="media"&&this._createMediaFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,Ri(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:o,_sourceLayer:n}=this;o.clear();const s=n?.associatedLayer!=null?await n?.associatedLayer.load(i):n;if(!s||!e||!t.filter(c=>!!c.fieldName&&Ie(c.fieldName))?.length)return;t.forEach(c=>this._configureRelatedInfo(c,s));const l=await sr({relatedInfos:o,layer:s},i);Object.keys(l).forEach(c=>{const p=o.get(c.toString()),h=l[c]?.value;p&&h&&(p.layerInfo=h.data)});const d=await rr({graphic:e,relatedInfos:o,layer:s},i);Object.keys(d).forEach(c=>{Ys(d[c]?.value,o.get(c.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,o=It(e.fieldName||"");if(!o)return;const{layerId:n,fieldName:s}=o;if(!n)return;const l=i.get(n.toString())||Js(n,t);l&&(ar({relatedInfo:l,fieldName:s,fieldInfo:e}),this.relatedInfos.set(n,l))}};O.interceptor=new kr(Fs,Ms),r([a()],O.prototype,"_error",void 0),r([a()],O.prototype,"_featureAbortController",void 0),r([a()],O.prototype,"_associationVMAbortController",void 0),r([a({readOnly:!0})],O.prototype,"_effectivePopupTemplate",null),r([a({readOnly:!0})],O.prototype,"_fieldInfoMap",null),r([a({readOnly:!0})],O.prototype,"_sourceLayer",null),r([a()],O.prototype,"abilities",void 0),r([et("abilities")],O.prototype,"castAbilities",null),r([a({readOnly:!0})],O.prototype,"content",void 0),r([a({readOnly:!0})],O.prototype,"contentViewModels",void 0),r([a()],O.prototype,"description",void 0),r([a({type:Boolean})],O.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],O.prototype,"isTable",null),r([a({readOnly:!0})],O.prototype,"state",null),r([a({readOnly:!0})],O.prototype,"formattedAttributes",void 0),r([a({type:je,value:null})],O.prototype,"graphic",null),r([a({readOnly:!0})],O.prototype,"lastEditInfo",void 0),r([a({type:ai})],O.prototype,"location",void 0),r([a({readOnly:!0})],O.prototype,"relatedInfos",void 0),r([a()],O.prototype,"spatialReference",null),r([a()],O.prototype,"timeZone",null),r([a({readOnly:!0})],O.prototype,"title",void 0),r([a()],O.prototype,"map",null),r([a({readOnly:!0})],O.prototype,"waitingForContent",null),r([a()],O.prototype,"view",void 0),O=Qe=r([P("esri.widgets.Feature.FeatureViewModel")],O);const bi=O,Q="esri-feature",D={base:Q,container:`${Q}__size-container`,title:`${Q}__title`,main:`${Q}__main-container`,btn:`${Q}__button`,icon:`${Q}__icon`,content:`${Q}__content`,contentNode:`${Q}__content-node`,contentNodeText:`${Q}__content-node--text`,contentElement:`${Q}__content-element`,text:`${Q}__text`,lastEditedInfo:`${Q}__last-edited-info`,fields:`${Q}__fields`,fieldHeader:`${Q}__field-header`,fieldData:`${Q}__field-data`,fieldDataDate:`${Q}__field-data--date`,loadingSpinnerContainer:`${Q}__loading-container`},Uo=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=i=>Bo(i)&&!i.destroyed?u("div",{class:D.contentNode,key:i},i.render()):i instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:i,class:D.contentNode,key:i}):Ns(i)?u("div",{afterCreate:this._attachToNode,bind:i.domNode,class:D.contentNode,key:i}):null}_attachToNode(i){const o=this;i.appendChild(o)}};return t=r([P("esri.widgets.Feature.support.FeatureContentMixin")],t),t},io={title:!0,content:!0,lastEditedInfo:!0};let B=class extends Uo(oe){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...io},this.viewModel=new bi}initialize(){this.addHandles(y(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),$))}loadDependencies(){return Ae({notice:()=>w(()=>import("./calcite-notice-DeAGopAs-D67uezlU.js"),__vite__mapDeps([121,2,3,4,5,122,7,6,111,105,106,112,123,117,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Cbej2XpA.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url)})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...io,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=u("div",{class:D.container,key:"container"},this._renderTitle(),e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer());return u("div",{class:this.classes(D.base,M.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return u("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?u("div",{key:"error-title",slot:"title"},e.errorMessage):null,u("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return u("div",{class:D.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?u("div",{class:D.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?u(_i,{class:D.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?u("div",{class:D.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if(typeof e=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:u("div",{class:this.classes(D.contentNode,D.contentNodeText),key:`${t}-content`},i.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!i.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:o}=t.viewModel;return i==="loading"||o.length>0?u("div",{class:this.classes(D.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?u("div",{class:D.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:i}=e,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:D.contentElement,key:this._buildKey("custom-element",t)},o.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:o,user:n}=i,s=i.type==="edit"?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,l=pe(s,{date:o,user:n});return u("div",{class:this.classes(D.lastEditedInfo,D.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const i=e.text,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:this.classes(D.contentElement,D.text),key:this._buildKey("text-element",t)},o.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:i,viewModel:o}=this,n=o?.content,{contentViewModels:s}=o;if(Array.isArray(n))n.forEach((l,d)=>{if(l.type==="attachments"&&(this._contentWidgets[d]=new Ls({displayType:l.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:s[d]})),l.type==="fields"&&(this._contentWidgets[d]=new jo({viewModel:s[d]})),l.type==="media"&&(this._contentWidgets[d]=new Wo({viewModel:s[d]})),l.type==="text"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="custom"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="expression"&&(this._contentWidgets[d]=new Ir({viewModel:s[d]})),l.type==="relationship"){const c=new Fr({flowItems:i,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}if(l.type==="utility-network-associations"){const c=new xr({flowItems:i,parentFeatureViewModel:o,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}},this);else{const l=s[0];l&&!l.destroyed&&(this._contentWidgets[0]=new bt({viewModel:l}))}this.scheduleRender()}};r([a()],B.prototype,"flowType",void 0),r([a()],B.prototype,"graphic",null),r([a()],B.prototype,"defaultPopupTemplateEnabled",null),r([a()],B.prototype,"flowItems",void 0),r([a()],B.prototype,"headingLevel",void 0),r([a({readOnly:!0})],B.prototype,"isTable",null),r([a()],B.prototype,"icon",null),r([a()],B.prototype,"label",null),r([a()],B.prototype,"location",null),r([a(),K("esri/widgets/Feature/t9n/Feature")],B.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],B.prototype,"messagesCommon",void 0),r([a()],B.prototype,"spatialReference",null),r([a()],B.prototype,"timeZone",null),r([a({readOnly:!0})],B.prototype,"title",null),r([a()],B.prototype,"visibleElements",void 0),r([et("visibleElements")],B.prototype,"castVisibleElements",null),r([a()],B.prototype,"map",null),r([a()],B.prototype,"view",null),r([a({type:bi})],B.prototype,"viewModel",void 0),B=r([P("esri.widgets.Feature")],B);const Zo=B,Go=Object.freeze(Object.defineProperty({__proto__:null,default:Zo},Symbol.toStringTag,{value:"Module"}));let Pe=class extends ln.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([at(()=>{const t=this.screenLocationEnabled?this.view:null;return t?[t.size,t.type==="3d"?t.camera:t.viewpoint]:null},()=>this.notifyChange("screenLocation")),y(()=>this.screenLocation,(t,i)=>{t!=null&&i!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this,o=t?.spatialReference,n=o?Wn(e,o).geometry:null;return i&&n&&t?.ready?t.toScreen(n):null}};r([a()],Pe.prototype,"location",void 0),r([a()],Pe.prototype,"screenLocation",null),r([a()],Pe.prototype,"screenLocationEnabled",void 0),r([a()],Pe.prototype,"view",void 0),Pe=r([P("esri.widgets.support.AnchorElementViewModel")],Pe);const Qo=Pe;let Ct=class extends Qo{constructor(e){super(e),this.visible=!1}};r([a()],Ct.prototype,"visible",void 0),Ct=r([P("esri.widgets.Spinner.SpinnerViewModel")],Ct);const Xo=Ct,Qt="esri-spinner",Xt={base:Qt,spinnerStart:`${Qt}--start`,spinnerFinish:`${Qt}--finish`};let Ne=class extends oe{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Xo}initialize(){this.addHandles(y(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:i}=e??{};t&&(this.viewModel.location=t),this.visible=!0;const o=()=>this.hide();i&&i.catch(()=>{}).then(o)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,o=e&&i,n=!e&&i,s={[Xt.spinnerStart]:o,[Xt.spinnerFinish]:n},l=this._getPositionStyles();return u("div",{class:this.classes(Xt.base,s),styles:l})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=$t(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(t==null||e==null)return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};r([a()],Ne.prototype,"location",null),r([a()],Ne.prototype,"view",null),r([a({type:Xo})],Ne.prototype,"viewModel",void 0),r([a()],Ne.prototype,"visible",null),Ne=r([P("esri.widgets.Spinner")],Ne);const Nr=Ne,ee="esri-features",Z={icon:`${ee}__icon`,actionImage:`${ee}__action-image`,base:ee,container:`${ee}__container`,contentContainer:`${ee}__content-container`,contentFeature:`${ee}__content-feature`,flowItemCollapsed:`${ee}__flow-item--collapsed`,header:`${ee}__header`,footer:`${ee}__footer`,featureMenuObserver:`${ee}__feature-menu-observer`,actionExit:`${ee}__action--exit`,loader:`${ee}__loader`,featuresHeading:`${ee}__heading`,paginationActionBar:`${ee}__pagination-action-bar`,paginationPrevious:`${ee}__pagination-previous`,paginationNext:`${ee}__pagination-next`},De=ce.ofType({key:"type",defaultKeyValue:"button",base:dn,typeMap:{button:pt,toggle:_o}}),xe=new pt({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),oo=new pt({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:we.trash}),Je=new pt({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),Te=new _o({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:we.table,value:!1}),Ce=xe.clone();let $e=class extends oe{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenFeature=i=>{this.emit("open-feature",{feature:i})},this._handleZoomToFeature=i=>{this.emit("zoom-to-feature",{featureWidget:i})}}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-tJ2F9SXc.js"),__vite__mapDeps([129,120,2,3,4,5,6,104,108,111,105,106,7,117,112,1,103]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-vzTzIHYF.js"),__vite__mapDeps([130,2,3,4,5,122,7,6,111,105,106,112,131,132,104,120,108,117,1,103,127,113,123,128]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-BnjsUS6-.js"),__vite__mapDeps([133,131,2,3,4,5,122,7,111,105,6,106,112,132,104,120,108,117,1,103,127,113,123,128]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-LY9sq3aM.js"),__vite__mapDeps([134,2,3,4,5,6,108,111,105,106,7,112,135,132,104,120,117,1,103,127,113,123,128,118]),import.meta.url)})}render(){const{flowItems:e}=this,t=e?.toArray();return u(Ao,null,t?.map(i=>this._renderFlowItem(i)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e){const{messages:t,closable:i,closed:o}=this,n="graphic"in e&&!e.isTable,s=e.flowType==="feature-association",l=this._getExitMessage(e),d=t.selectFeature;return u("calcite-flow-item",{bind:this,closable:i,closed:o,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:c=>{c.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},u("calcite-action",{appearance:"transparent",bind:this,class:Z.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:l,title:l}),n?u("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,s?u("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},this._renderDefaultActions(e))):null,u("div",{class:Z.container},e.render()))}_renderDefaultActions(e){const t=this._getActionTitle(Ce);return u("calcite-action",{active:Ce.active,appearance:"solid",bind:this,"data-action-uid":Ce.uid,disabled:Ce.disabled,icon:Ce.icon??"question",indicator:Ce.indicator,key:`action-${Ce.uid}`,loading:Ce.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return i==="zoom-to-feature"?pe(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.featureCountDescription;case"feature-utility-network-association-type":return e.description??""}}};r([a()],$e.prototype,"flowItems",void 0),r([a(),K("esri/widgets/Features/t9n/Features")],$e.prototype,"messages",void 0),r([a()],$e.prototype,"closed",void 0),r([a()],$e.prototype,"closable",void 0),$e=r([P("esri.widgets.Features.FeaturesDrillIn")],$e);const $r=$e,Rr="OBJECTID";var Re;(function(e){e[e.size=22]="size",e[e.lineWidth=50]="lineWidth",e[e.maxSize=120]="maxSize",e[e.maxOutlineSize=80]="maxOutlineSize",e[e.tallSymbolWidth=20]="tallSymbolWidth"})(Re||(Re={}));const no=ci("android");ci("chrome")||no&&no>=4,En(),Re.size,Re.maxSize,Re.maxOutlineSize,Re.lineWidth,Re.tallSymbolWidth;function Jo(e){return e&&"opacity"in e?e.opacity*Jo(e.parent):1}async function so(e,t){if(!e)return;const i=e.sourceLayer,o=(t!=null&&t.useSourceLayer?i:e.layer)??i,n=Jo(o);if(e.symbol!=null&&(t==null||t.ignoreGraphicSymbol!==!0)){const b=e.symbol.type==="web-style"?await Vn(e.symbol,{...t,cache:t!=null?t.webStyleCache:null}):e.symbol.clone();return St(b,null,n),b}const s=t?.renderer??Or(o);let l=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!l)return;if(l=l.type==="web-style"?await l.fetchSymbol({...t,cache:t!=null?t.webStyleCache:null}):l.clone(),!s||!("visualVariables"in s)||!s.visualVariables?.length)return St(l,null,n),l;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&t?.arcade==null){const b={...t};b.arcade=await Io(),t=b}const{getColor:d,getOpacity:c,getAllSizes:p,getRotationAngle:h}=await w(()=>import("./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js"),__vite__mapDeps([8,3,4,9,10,11]),import.meta.url),m=[],f=[],g=[],v=[];for(const b of s.visualVariables)switch(b.type){case"color":m.push(b);break;case"opacity":f.push(b);break;case"rotation":v.push(b);break;case"size":b.target||g.push(b)}const I=!!m.length&&m[m.length-1],C=I?d(I,e,t):null,_=!!f.length&&f[f.length-1];let T=_?c(_,e,t):null;if(n!=null&&(T=T!=null?T*n:n),St(l,C,T),g.length){const b=p(g,e,t);await Sn(l,b)}for(const b of v)Dn(l,h(b,e,t),b.axis);return l}function Or(e){if(e)return"renderer"in e?e.renderer:void 0}const Vr="esri.widgets.Popup.PopupViewModel",Pt=()=>Y.getLogger(Vr),Sr=e=>{const{event:t,view:i,viewModel:o}=e,{action:n}=t;if(!n)return Promise.reject(new N("trigger-action:missing-arguments","Event has no action"));const{disabled:s,id:l}=n;if(!l)return Promise.reject(new N("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new N("trigger-action:invalid-action","Action is disabled"));if(l===xe.id)return Ko(o).catch(wn);if(l===Je.id)return qr(o);if(l===Te.id)return o.browseClusterEnabled=!o.browseClusterEnabled,o.featureMenuOpen=o.browseClusterEnabled,Promise.resolve();if(l===oo.id){o.visible=!1;const{selectedFeature:d}=o;if(!d)return Promise.reject(new N(`trigger-action:${oo.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):i?.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function Yo(e){const{selectedFeature:t,location:i,view:o}=e;return o?t??i??null:null}function Oe(e){return!!e&&e.isAggregate&&e.sourceLayer?.featureReduction?.type==="cluster"}async function Dr(e,t){if(t?.type!=="3d"||!e||e.declaredClass!=="esri.Graphic")return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let o=null;try{o=await i.whenGraphicBounds(e,{useViewElevation:!0})}catch{}return!o||!o.boundingBox||o.boundingBox[0]===o.boundingBox[3]&&o.boundingBox[1]===o.boundingBox[4]&&o.boundingBox[2]===o.boundingBox[5]}return!0}async function Ko(e,t){const{location:i,selectedFeature:o,view:n,zoomFactor:s}=e;await t?.viewModel?.updateGeometry();const l=t?.graphic,d=l?.geometry?l:Yo(e);if(!n||!d){const m=new N("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:d,view:n});throw Pt().error(m),m}const c=n.scale/s,p=l?.geometry??e.selectedFeature?.geometry??i,h=p!=null&&p.type==="point"&&await Dr(l??o,n);xe.active=!0,xe.disabled=!0;try{await e.zoomTo({target:{target:d,scale:h?c:void 0}})}catch(m){if(Et(m))return;const f=new N("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:l??o});Pt().error(f)}finally{xe.active=!1,xe.disabled=!1,e.zoomToLocation=null,h&&(e.location=p)}}async function qr(e){const{selectedFeature:t,view:i}=e;if(i?.type!=="2d"){const l=new N("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Pt().error(l),l}if(!t||!Oe(t)){const l=new N("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw Pt().error(l),l}const[o,n]=await Ii(i,t);Je.active=!0,Je.disabled=!0;const{extent:s}=await o.queryExtent(n);s&&await e.zoomTo({target:s}),Je.active=!1,Je.disabled=!1}async function Br(e){const{view:t,selectedFeature:i}=e;if(!t||!i)return;const[o,n]=await Ii(t,i),{extent:s}=await o.queryExtent(n);e.selectedClusterBoundaryFeature.geometry=s,t.graphics.add(e.selectedClusterBoundaryFeature)}async function jr(e){const{selectedFeature:t,view:i}=e;if(!i||!t)return;const[o,n]=await Ii(i,t);Te.active=!0,Te.disabled=!0;const{features:s}=await o.queryFeatures(n);Te.active=!1,Te.disabled=!1,Te.value=!0,e?.open({features:[t].concat(s),featureMenuOpen:!0})}async function Ii(e,t){const i=await e.whenLayerView(t.sourceLayer),o=i.createQuery(),n=t.getObjectId();return o.aggregateIds=n!=null?[n]:[],[i,o]}function Wr(e){Te.value=!1;const t=e.features.filter(i=>Oe(i));t.length&&(e.features=t)}const Jt="location-scale-handle",zr=()=>[xe.clone()],Hr=()=>[Je.clone(),Te.clone()];let wt=null;function Ur(e,t){return e==="building-scene"||t==="2d"&&(e==="map-image"||e==="tile"||e==="imagery"||e==="imagery-tile")}let F=class extends Rn(Qo){constructor(e){super(e),this._pendingPromises=new Ln,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new De,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new je({symbol:new cn({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=Ye(async t=>{const{spatialReference:i}=this,o=this.selectedFeature?.geometry?.type,n=this.location??t;if(o&&o!=="mesh"&&i&&n&&this.selectedFeature)if(o!=="point")try{const s=this.selectedFeature;let l=s.geometry;const d=this._getHighlightLayer(s),c=s.getObjectId();if(!d||!this.view)return;if(c){const p=this.view?.allLayerViews.find(f=>f.layer.uid===d.uid);if(!p||!("queryFeatures"in p))return;const h=p.createQuery();h.outSpatialReference=i,h.objectIds=[c],h.returnGeometry=!0;const{features:m}=await p.queryFeatures(h);l=m[0]?.geometry}if(!l||l.type==="mesh")return;if(l=zn(l,i),wt||(wt=await w(()=>import("./geometryEngineAsync-D7oEu5dd-DTqB2IHB.js"),__vite__mapDeps([136,3,4,61]),import.meta.url)),!await wt.intersects(l,n)){const p=(await wt.nearestCoordinate(l,n)).coordinate??n;this.selectedFeature===s&&(this.location=p)}}catch(s){Et(s)||Y.getLogger(this).error(s)}else this.location=Kt(this.selectedFeature.geometry)??n})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),y(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),y(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),y(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),y(()=>this.location,e=>this._locationChange(e)),y(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),y(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),y(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),y(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Sr({event:e,viewModel:this,view:this.view})),at(()=>!this.waitingForResult,()=>this._waitingForResultChange(),un),y(()=>[this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureVMs()),y(()=>this.view?.scale,()=>this._viewScaleChange()),at(()=>!this.visible,()=>this.browseClusterEnabled=!1),y(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new De;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:o,includeDefaultActions:n,selectedFeature:s}=this,l=n?i.concat(t):t,d=s&&(typeof s.getEffectivePopupTemplate=="function"&&s.getEffectivePopupTemplate(o)||s.popupTemplate),c=d?.actions;return(d?.overwriteActions?c:c?.concat(l)??l)?.filter(Boolean).forEach(p=>e.add(p)),e}get defaultActions(){const e=this._get("defaultActions")||new De;return e.removeAll(),e.addMany(Oe(this.selectedFeature)?Hr():zr()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:o,selectedFeatureIndex:n}=this,s=o&&t.length;s&&i&&n===-1?this.selectedFeatureIndex=0:s&&n!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator;e?.spatialReference?.isWGS84&&i&&(t=pn(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach(t=>this._pendingPromises.add(t)),e.reduce((t,i)=>t.finally(()=>i.then(o=>{this._pendingPromises.has(i)&&this._updateFeatures(o)}).finally(()=>this._pendingPromises.delete(i)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=Yo(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new N("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new N("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const o=["actionsMenuOpen","collapsed"];for(const n of o)delete t[n];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){Wr(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;e?.type==="2d"?Oe(t)?(await Br(this),await jr(this)):Y.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):Y.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(xe.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Nt);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Oe(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:o}=this;o&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:o,featureViewModels:n}=this;if(i===null)return;const s=((i-1)*o+t)%t,l=s+o;n.slice(s,l).forEach((d,c)=>{d&&(d.graphic??=e[s+c])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:o}=this;if(!e||!o)return;if(this.browseClusterEnabled)return this._selectedClusterFeature&&(o.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Oe(e)?void 0:(e.symbol=await so(e),this._selectedClusterFeature=e,void o.graphics.add(this._selectedClusterFeature));const n=e.sourceLayer?.type;if(n!=="map-image"&&n!=="imagery"&&n!=="imagery-tile"||(e.symbol=await so(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const s=o.center?.clone();s&&(this.location=s)}}else this.location=Kt(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:o,spatialReference:n,map:s,timeZone:l,location:d}=this;if(Oe(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const c=i.slice(),p=[];t.forEach((h,m)=>{if(!h)return;let f=null;if(c.some((g,v)=>(g&&g.graphic===h&&(f=g,c.splice(v,1)),!!f)),f)p[m]=f;else{const g=new bi({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n,graphic:h===e?h:null,location:d,map:s,view:o,timeZone:l});p[m]=g}}),c.forEach(h=>h&&!h.destroyed&&h.destroy()),this._set("featureViewModels",p)}async _getScreenPoint(e,t){const{spatialReference:i,view:o}=this;if(!o)return null;await o?.when();const n=e?.spatialReference;return n&&i?(await Hn(n,i,null,t),o.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:o}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:o}),{signal:o,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const o=new AbortController,{signal:n}=o;this._fetchFeaturesController=o;const s=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:n,event:i});return s.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),s}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:o}=this;this.removeHandles(Jt),this.addHandles([y(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(s=>{Et(s)||Y.getLogger(this).error(s)})),at(()=>!this.visible,()=>{this.removeHandles(Jt)},{once:!0})],Jt);const{pendingFeatures:n}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});o?.popup&&"open"in o.popup&&o.popup.open({location:t??void 0,promises:n})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:i?.type==="map-notes"||i?.type==="subtype-group"?i:t}_getHighlightTarget(e,t,i){if(Ur(t.type,i))return e;const o=e.getObjectId();if(o!=null)return o;const n=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||Rr:null,s=e.attributes;return s&&n&&s[n]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:i,activeFeature:o,visible:n}=this;if(!(o&&i&&t&&n))return;const s=this._getHighlightLayer(o);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(i,s);this._highlightActiveFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightActiveFeaturePromise===l&&this.activeFeature&&this.highlightEnabled))return;const c=d.highlight(this._getHighlightTarget(o,s,i.type));this.addHandles(c,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:i,view:o,visible:n}=this;if(!(t&&o&&i&&n))return;const s=this._getHighlightLayer(t);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(o,s);this._highlightSelectedFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightSelectedFeaturePromise===l&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=d.highlight(this._getHighlightTarget(t,s,o.type));this.addHandles(c,e)}_updateFeatures(e){const{features:t}=this,i=e.filter(o=>!t.includes(o));i?.length&&(this.features=t.concat(i))}};r([a()],F.prototype,"_fetchFeaturesController",void 0),r([a({type:De})],F.prototype,"actions",void 0),r([a({readOnly:!0})],F.prototype,"active",null),r([a()],F.prototype,"activeFeature",void 0),r([a({readOnly:!0})],F.prototype,"allActions",null),r([a()],F.prototype,"autoCloseEnabled",void 0),r([a()],F.prototype,"browseClusterEnabled",void 0),r([a()],F.prototype,"content",void 0),r([a({type:De,readOnly:!0})],F.prototype,"defaultActions",null),r([a({type:Boolean})],F.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],F.prototype,"featureCount",null),r([a()],F.prototype,"featurePage",void 0),r([a({value:[]})],F.prototype,"features",null),r([a()],F.prototype,"featuresPerPage",void 0),r([a()],F.prototype,"featureMenuOpen",void 0),r([a()],F.prototype,"featureViewModelAbilities",void 0),r([a({readOnly:!0})],F.prototype,"featureViewModels",void 0),r([a()],F.prototype,"highlightEnabled",void 0),r([a()],F.prototype,"includeDefaultActions",void 0),r([a({type:ai})],F.prototype,"location",null),r([a()],F.prototype,"map",null),r([a({readOnly:!0})],F.prototype,"pendingPromisesCount",null),r([a({readOnly:!0})],F.prototype,"promiseCount",null),r([a()],F.prototype,"promises",null),r([a({readOnly:!0})],F.prototype,"selectedClusterBoundaryFeature",void 0),r([a({value:null,readOnly:!0})],F.prototype,"selectedFeature",null),r([a({value:-1})],F.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],F.prototype,"selectedFeatureViewModel",null),r([a({readOnly:!0})],F.prototype,"state",null),r([a()],F.prototype,"timeZone",null),r([a()],F.prototype,"title",void 0),r([a()],F.prototype,"updateLocationEnabled",void 0),r([a()],F.prototype,"view",void 0),r([a()],F.prototype,"visible",void 0),r([a({readOnly:!0})],F.prototype,"waitingForContents",null),r([a({readOnly:!0})],F.prototype,"waitingForResult",null),r([a()],F.prototype,"zoomFactor",void 0),r([a()],F.prototype,"zoomToLocation",void 0),r([a()],F.prototype,"centerAtLocation",null),F=r([P("esri.widgets.Features.FeaturesViewModel")],F);const Ai=F;let fe=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],fe.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"flow",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"spinner",void 0),fe=r([P("esri.widgets.Features.FeaturesVisibleElements")],fe);const en=fe,ro="selected-index",Zr=0,ao="features-spinner";function lo(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let x=class extends Uo(oe){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([i])=>{i?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new ce,this._drillInWidget=new $r({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new De,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new Ai,this.visibleElements=new en,this._renderAction=(i,o)=>{const n=this._getActionTitle(i),{type:s,active:l,uid:d,disabled:c,indicator:p}=i;return i.visible?u("calcite-action",{active:s==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(i),indicator:p,key:`action-${o}`,loading:l,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(i)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=pi(()=>this._displaySpinner(),Zr),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,y(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),y(()=>this.viewModel?.active,i=>this._drillInWidget.closed=!i),y(()=>this.visibleElements?.closeButton,i=>this._drillInWidget.closable=i),y(()=>this.visibleElements?.spinner,i=>this._spinnerEnabledChange(i)),y(()=>this.viewModel?.view,(i,o)=>this._viewChange(i,o)),y(()=>this.viewModel?.view?.ready,(i,o)=>this._viewReadyChange(i??!1,o??!1)),y(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),y(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),y(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.title,i?.state]},()=>this._setTitleFromFeatureWidget()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.content,i?.state]},()=>this._setContentFromFeatureWidget()),y(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:i})=>this._openRelatedFeature(i)),this._drillInWidget.on("zoom-to-feature",({featureWidget:i})=>Ko(this.viewModel,i))])}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-tJ2F9SXc.js"),__vite__mapDeps([129,120,2,3,4,5,6,104,108,111,105,106,7,117,112,1,103]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-vzTzIHYF.js"),__vite__mapDeps([130,2,3,4,5,122,7,6,111,105,106,112,131,132,104,120,108,117,1,103,127,113,123,128]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-BnjsUS6-.js"),__vite__mapDeps([133,131,2,3,4,5,122,7,111,105,6,106,112,132,104,120,108,117,1,103,127,113,123,128]),import.meta.url),button:()=>w(()=>import("./calcite-button-Cm9_TJei-BWKp46iV.js"),__vite__mapDeps([137,2,3,4,5,115,6,108,116,117,111,105,106,7,112,1,103,104]),import.meta.url),flow:()=>w(()=>import("./calcite-flow-CAdorlph-Cs9fueJs.js"),__vite__mapDeps([138,2,3,4,5,7,111]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-LY9sq3aM.js"),__vite__mapDeps([134,2,3,4,5,6,108,111,105,106,7,112,135,132,104,120,117,1,103,127,113,123,128,118]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-BT4YOn58.js"),__vite__mapDeps([107,2,3,4,5,6,108,7,109,110,111,112,105,106,113,1,114,115,116,117,103,104,118]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-DcHoxADM.js"),__vite__mapDeps([119,2,3,4,5,6,108,105,106,7,112,111,110,109,120,104,117,1,103]),import.meta.url),"list-item-group":()=>w(()=>import("./calcite-list-item-group-CuQ2MPLW-BznsgUiX.js"),__vite__mapDeps([139,2,3,4,5,108,109]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Cbej2XpA.js"),__vite__mapDeps([102,103,2,3,4,5,104,105,6,106,7]),import.meta.url)})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return t==="feature-association"||t==="feature-relationship"?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:n,map:s}=this,{selectedFeatureViewModel:l}=this.viewModel,d={title:!1};return l?(e?(e.viewModel=l,e.visibleElements=d):this._feature=new Zo({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:n,map:s,viewModel:l,visibleElements:d}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():Y.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):Y.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(ro);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(at(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return u("div",{bind:this,class:this.classes(Z.base,M.widget,M.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?u("div",{class:Z.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:u("div",{class:Z.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:n}=t;return u("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:pe(e.pageText,{index:Be(o+1),total:Be(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return u("calcite-action-bar",{class:Z.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},u("calcite-action-group",{scale:"s"},u("calcite-action",{appearance:"solid",class:Z.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),u("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,n=i.indexOf(e);return u("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},u("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(i=>{const o=i?.graphic;if(!o)return;const{layer:n,sourceLayer:s}=o,l=(lo(n)?n:null)||(lo(s)?s:null),d=t.get(l)??[];t.set(l,[...d,i])}),t}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel,t=this._groupResultsByLayer();return e.length?u("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(t.keys(),i=>{const o=t.get(i)?.map(s=>this._renderFeatureMenuItem(s)),n=i?i.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&n!==null?u("calcite-list-item-group",{heading:n,key:i?.uid||"map-graphics"},o):o})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?u("calcite-action",{active:e.type==="toggle"&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:n}=this,{title:s,active:l}=this.viewModel,d=t.heading&&s?s:"";return u("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[Z.contentFeature]:!0,[Z.flowItemCollapsed]:i}),closable:t.closeButton,closed:!l,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?u(_i,{class:this.classes(Z.featuresHeading,M.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:u("div",{class:this.classes(Z.container,Z.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:n,featureViewModels:s,pendingPromisesCount:l}=e;return t?u("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:pe(i.total,{total:s.length}),heading:i.selectFeature,key:"feature-menu",loading:e.waitingForContents,onCalciteFlowItemBack:d=>{d.preventDefault(),this._handleFeatureMenuBack()}},l>0?u("calcite-loader",{class:Z.loader,inline:!0,key:"feature-menu-loader",label:o.loading,slot:"header-actions-end"}):null,u("div",{class:Z.container},this._renderFeatureMenu()),u("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:Z.featureMenuObserver}),u("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},o.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?u("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=Zn({action:e,feature:this.selectedFeature}),n={[Z.icon]:!!t,[Z.actionImage]:!!o};return t&&(n[t]=!0),o||t?u("span",{"aria-hidden":"true",class:this.classes(Z.icon,n),key:"icon",styles:Un(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?u("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?u("div",{class:D.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(i==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=Kt(i);this.open({features:[t],location:o??void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await ke(vo(t));const i=e==="menu-flow-item"?this._featureMenuViewportNode:this._rootFlowItemNode;Tn(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,l=e.title??"",d=n==="zoom-to-feature"?pe(l,{messages:t}):n==="remove-selected-feature"?pe(l,{messages:o}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?pe(l,{messages:t}):e.title;return d&&s?pe(d,s):d??""}_onMainKeydown(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title=i?.state==="error"?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=y(()=>this.viewModel?.selectedFeatureIndex,(t,i)=>this._selectedFeatureIndexUpdated(t,i));this.addHandles(e,ro)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:n})=>n===i);o&&!o.disabled&&(o?.type==="toggle"&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,n=o.findIndex(l=>l.uid===i),s=o.at(n);s&&s.type==="toggle"&&(s.value=!s.value),this.viewModel.triggerAction(n)}_createSpinner(e){e&&(this._spinner=new Nr({view:e}),e.ui.add(this._spinner,{key:ao,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,ao),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};r([a()],x.prototype,"_drillInFlowItems",void 0),r([a()],x.prototype,"_hideActionText",null),r([a()],x.prototype,"_featureNavigationVisible",null),r([a()],x.prototype,"_isCollapsed",null),r([a()],x.prototype,"_collapseEnabled",null),r([a({readOnly:!0})],x.prototype,"active",null),r([a()],x.prototype,"collapsed",void 0),r([a()],x.prototype,"content",null),r([a()],x.prototype,"icon",null),r([a()],x.prototype,"featureMenuOpen",null),r([a()],x.prototype,"featureNavigationTop",void 0),r([a()],x.prototype,"features",null),r([a()],x.prototype,"goToOverride",null),r([a({type:De})],x.prototype,"headerActions",void 0),r([a()],x.prototype,"headingLevel",void 0),r([a()],x.prototype,"location",null),r([a()],x.prototype,"label",null),r([a()],x.prototype,"map",null),r([a(),K("esri/widgets/Features/t9n/Features")],x.prototype,"messages",void 0),r([a(),K("esri/t9n/common")],x.prototype,"messagesCommon",void 0),r([a()],x.prototype,"promises",null),r([a()],x.prototype,"responsiveActionsEnabled",void 0),r([a({readOnly:!0})],x.prototype,"selectedFeature",null),r([a({readOnly:!0})],x.prototype,"selectedDrillInFeature",null),r([a()],x.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],x.prototype,"selectedFeatureWidget",null),r([a()],x.prototype,"spatialReference",null),r([a()],x.prototype,"title",null),r([a()],x.prototype,"timeZone",null),r([a()],x.prototype,"updateLocationEnabled",null),r([a()],x.prototype,"view",null),r([a({type:Ai}),qo(["triggerAction","trigger-action"])],x.prototype,"viewModel",void 0),r([a({type:en,nonNullable:!0})],x.prototype,"visibleElements",void 0),r([a()],x.prototype,"visible",null),x=r([P("esri.widgets.Features")],x);const Gr=x,de="esri-popup",Le=`${de}--is-docked`,j={base:de,baseHidden:`${de}--hidden`,main:`${de}__main-container`,shadow:`${de}--shadow`,isDocked:Le,isDockedTopLeft:`${Le}-top-left`,isDockedTopCenter:`${Le}-top-center`,isDockedTopRight:`${Le}-top-right`,isDockedBottomLeft:`${Le}-bottom-left`,isDockedBottomCenter:`${Le}-bottom-center`,isDockedBottomRight:`${Le}-bottom-right`,alignTopCenter:`${de}--aligned-top-center`,alignBottomCenter:`${de}--aligned-bottom-center`,alignTopLeft:`${de}--aligned-top-left`,alignBottomLeft:`${de}--aligned-bottom-left`,alignTopRight:`${de}--aligned-top-right`,alignBottomRight:`${de}--aligned-bottom-right`,pointer:`${de}__pointer`,pointerDirection:`${de}__pointer-direction`};let si=class extends Ai{constructor(e){super(e)}};si=r([P("esri.widgets.Popup.PopupViewModel")],si);const tn=si;let _e=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],_e.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"spinner",void 0),_e=r([P("esri.widgets.Popup.PopupVisibleElements")],_e);const ri=_e,Qr=200,co={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let k=class extends oe{constructor(e,t){super(e,t),this._dockAction=new pt({id:"popup-dock-action"}),this._featuresWidget=new Gr({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this._focusAbortController=null,this.alignment="auto",this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new tn,this.visibleElements=new ri}initialize(){this.addHandles([y(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled],()=>this._handleDockIcon(),$),y(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),$),y(()=>this.dockOptions,e=>{const{_dockAction:t}=this,i=this._featuresWidget.headerActions;i.remove(t),e.buttonEnabled&&i.add(t)},$),y(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),y(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),y(()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),y(()=>this.viewModel?.view?.size,(e,t)=>this._updateDockEnabledForViewSize(e,t)),y(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),y(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),y(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,$),y(()=>this._featureNavigationTop,e=>this._featuresWidget.featureNavigationTop=e,$),y(()=>this.headingLevel,e=>this._featuresWidget.headingLevel=e,$),y(()=>this.visibleElements.actionBar,e=>this._featuresWidget.visibleElements.actionBar=!!e,$),y(()=>this.visibleElements.closeButton,e=>this._featuresWidget.visibleElements.closeButton=!!e,$),y(()=>this.visibleElements.collapseButton,e=>this._featuresWidget.visibleElements.collapseButton=!!e,$),y(()=>this.visibleElements.heading,e=>this._featuresWidget.visibleElements.heading=!!e,$),y(()=>this.visibleElements.spinner,e=>this._featuresWidget.visibleElements.spinner=!!e,$),y(()=>this.visibleElements.featureNavigation,e=>this._featuresWidget.visibleElements.featureNavigation=!!e,$),y(()=>this.visibleElements.featureListLayerTitle,e=>this._featuresWidget.visibleElements.featureListLayerTitle=!!e,$),dt(()=>this._featuresWidget,"trigger-header-action",e=>{e.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(e){const t={...e};return e?.visibleElements!=null&&(t.visibleElements=new ri(e.visibleElements),e.collapseEnabled!=null&&(t.visibleElements.collapseButton=e.collapseEnabled),e.spinnerEnabled!=null&&(t.visibleElements.spinner=e.spinnerEnabled)),t}destroy(){this._dockAction.destroy(),this._featuresWidget?.destroy(),this._focusAbortController?.abort()}get _featureNavigationTop(){const{currentAlignment:e,currentDockPosition:t}=this;return e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right"}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}get active(){return this.viewModel.active}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get collapsed(){return this._featuresWidget.collapsed}set collapsed(e){this._featuresWidget.collapsed=e}get collapseEnabled(){return gt(Y.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(e){gt(Y.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||co}set dockOptions(e){const t={...co},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:l}=n;typeof l=="object"?n.breakpoint={...s,...l}:l&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get icon(){return"popup"}set icon(e){this._overrideIfSome("icon",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return gt(Y.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(e){gt(Y.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||Y.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||Y.getLogger(this).warn("Popup can only be focused when currently active."),this._handleFocus()}next(){return this.viewModel.next()}open(e){const t=!!e&&!!e.featureMenuOpen,i={collapsed:!!e&&!!e.collapsed,featureMenuOpen:t};this.set(i),this.viewModel.open(e),e?.shouldFocus&&this._handleFocus(!0)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i}=this,{active:o,screenLocation:n}=this.viewModel,s=o&&e,l=o&&!e,d=this.selectedFeature?.layer?.title,c=this.selectedFeature?.layer?.id,p={[j.alignTopCenter]:t==="top-center",[j.alignBottomCenter]:t==="bottom-center",[j.alignTopLeft]:t==="top-left",[j.alignBottomLeft]:t==="bottom-left",[j.alignTopRight]:t==="top-right",[j.alignBottomRight]:t==="bottom-right",[j.isDocked]:s,[j.shadow]:l,[j.isDockedTopLeft]:i==="top-left",[j.isDockedTopCenter]:i==="top-center",[j.isDockedTopRight]:i==="top-right",[j.isDockedBottomLeft]:i==="bottom-left",[j.isDockedBottomCenter]:i==="bottom-center",[j.isDockedBottomRight]:i==="bottom-right"};return u("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(j.base,p,{[j.baseHidden]:!n&&!e}),"data-layer-id":c,"data-layer-title":d,role:"presentation"},o?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:u("div",{class:j.pointer,key:"popup-pointer",role:"presentation"},u("div",{class:this.classes(j.pointerDirection,j.shadow)}))}_renderMainContainer(){const{dockEnabled:e}=this,t={[j.shadow]:e};return u("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(j.main,M.widget,t)},this._featuresWidget.render())}_getAnimationDurationMS(){const{_containerNode:e}=this;return e?1e3*parseFloat(window.getComputedStyle(e).animationDuration):Qr}async _handleFocus(e=!1){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;e&&await yo(()=>this.viewModel?.active===!0,{signal:t}),await ke(vo(t)),await ke($t(this._getAnimationDurationMS(),t)),this._featuresWidget.focus()}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const l=s.padding;return n==="right"&&o.x+i/2>s.width-l.right||n==="left"&&o.x-i/2s.height-l.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:l}=n;if(s==null||!l||!i)return"top-center";function d(b){return parseInt(b.replaceAll(/[^-\d.]/g,""),10)}const c=o?window.getComputedStyle(o,null):null,p=c?d(c.getPropertyValue("max-height")):0,h=c?d(c.getPropertyValue("height")):0,{height:m,width:f}=i.getBoundingClientRect(),g=f+t,v=Math.max(m,p,h)+t,I=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"right",view:l}),C=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"left",view:l}),_=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"top",view:l}),T=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"bottom",view:l});return C?_?"bottom-right":"top-right":I?_?"bottom-left":"top-left":_?T?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return be(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(e){if(e!=="auto")return e;const t=this.viewModel?.view,i=be(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_getDockIcon(){const e=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(e){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(e){this._mainContainerNode=e}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return t==="top-left"||t==="bottom-left"||t==="top-right"||t==="bottom-right"?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:l}=i,d=o/2,c=i.height-t,p=i.width-e;return n==="bottom-center"?{top:t+s-l.top,left:e-d-l.left}:n==="top-left"?{bottom:c+s-l.bottom,right:p+s-l.right}:n==="bottom-left"?{top:t+s-l.top,right:p+s-l.right}:n==="top-right"?{bottom:c+s-l.bottom,left:e+s-l.left}:n==="bottom-right"?{top:t+s-l.top,left:e+s-l.left}:n==="top-center"?{bottom:c+s-l.bottom,left:e-d-l.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(e==null||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:s.top!==void 0?`${s.top}px`:"auto",left:s.left!==void 0?`${s.left}px`:"auto",bottom:s.bottom!==void 0?`${s.bottom}px`:"auto",right:s.right!==void 0?`${s.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){e?this._wireUpView():t&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,l]=t,{width:d=0,height:c=0}=i??{};return o<=d&&s>d||o>d&&s<=d||n<=c&&l>c||n>c&&l<=c}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],l=[];s[0]=e[0]-o,s[1]=e[1]-n,l[0]=t[0]-o,l[1]=t[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(s,l,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n)||!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),l=t.hasOwnProperty("height")&&n<=(t.height??0);return s||l}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}};r([a({readOnly:!0})],k.prototype,"_featureNavigationTop",null),r([a()],k.prototype,"actions",null),r([a({readOnly:!0})],k.prototype,"active",null),r([a()],k.prototype,"alignment",void 0),r([a()],k.prototype,"autoCloseEnabled",null),r([a()],k.prototype,"defaultPopupTemplateEnabled",null),r([a()],k.prototype,"content",null),r([a()],k.prototype,"collapsed",null),r([a()],k.prototype,"collapseEnabled",null),r([a({readOnly:!0})],k.prototype,"currentAlignment",null),r([a({readOnly:!0})],k.prototype,"currentDockPosition",null),r([a()],k.prototype,"dockOptions",null),r([a()],k.prototype,"dockEnabled",void 0),r([a({readOnly:!0})],k.prototype,"featureCount",null),r([a()],k.prototype,"featureMenuOpen",null),r([a()],k.prototype,"features",null),r([a()],k.prototype,"goToOverride",null),r([a()],k.prototype,"headingLevel",void 0),r([a()],k.prototype,"highlightEnabled",null),r([a()],k.prototype,"icon",null),r([a()],k.prototype,"location",null),r([a()],k.prototype,"label",null),r([a(),K("esri/widgets/Popup/t9n/Popup")],k.prototype,"messages",void 0),r([a()],k.prototype,"promises",null),r([a({readOnly:!0})],k.prototype,"selectedFeature",null),r([a()],k.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],k.prototype,"selectedFeatureWidget",null),r([a()],k.prototype,"spinnerEnabled",null),r([a()],k.prototype,"title",null),r([a()],k.prototype,"updateLocationEnabled",null),r([a()],k.prototype,"view",null),r([a({type:tn}),qo(["triggerAction","trigger-action"])],k.prototype,"viewModel",void 0),r([a()],k.prototype,"visible",null),r([a({type:ri,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=r([P("esri.widgets.Popup")],k);const Fd=k;export{Fd as default}; diff --git a/main/assets/PortalItem-CctGdnxF-CHPkp6yW.js b/main/assets/PortalItem-CctGdnxF-CHPkp6yW.js new file mode 100644 index 000000000..e8db39e49 --- /dev/null +++ b/main/assets/PortalItem-CctGdnxF-CHPkp6yW.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-Bu5Czfos.js","./main-C7yV2j71.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); +import{v as a,ad as j,bA as T,aO as L,n as O,bw as _,d6 as q,r as R,P as l,o as m,d7 as C,Y as D,_ as g,M as F,S as o,a0 as N,i as b,j as U,d8 as P,a1 as E,d9 as $,aB as J}from"./main-C7yV2j71.js";let p=class extends U{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e?.portalItem&&e.path?{...e,path:x(e.path,e.portalItem)}:e}set path(e){e!=null&&P(e)?E.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return x(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.cdnUrl;if(r==null)throw new m("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey,_ts:t?.cacheBust?Date.now():null},signal:t?.signal})}async update(e,t){const{addOrUpdateResources:r}=await g(()=>import("./resourceUtils-rTM6Iemx-Bu5Czfos.js"),__vite__mapDeps([0,1,2]),import.meta.url);return await r(this.portalItem,[{resource:this,content:e,compress:t?.compress,access:t?.access}],"update",t),this}hasPath(){return this.path!=null}};function x(e,t){return e==null?e:(e=e.replace(/^\/+/,""),t!=null&&P(e)&&(e=$(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}a([o()],p.prototype,"portalItem",void 0),a([o({type:String,value:null})],p.prototype,"path",null),a([j("path")],p.prototype,"_castPath",null),a([o({type:String,readOnly:!0})],p.prototype,"url",null),a([o({type:String,readOnly:!0})],p.prototype,"cdnUrl",null),a([o({type:String,readOnly:!0})],p.prototype,"itemRelativeUrl",null),p=a([b("esri.portal.PortalItemResource")],p);const K=p;let y=class extends U{constructor(e){super(e),this.created=null,this.rating=null}};a([o()],y.prototype,"created",void 0),a([o()],y.prototype,"rating",void 0),y=a([b("esri.portal.PortalRating")],y);const f=y;var c;const M=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),A=new Set(["KML","GeoJson","CSV"]);let s=c=class extends T(J){static from(e){return L(c,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let r=e;return e==="Feature Service"||e==="Feature Collection"?r=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?r=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?r="Scene Layer":e==="Video Service"?r="Video Layer":e==="Scene Package"?r="Scene Layer Package":e==="Stream Service"?r="Feature Layer":e==="Geoprocessing Service"?r=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geoenrichment Service"?r="GeoEnrichment Service":e==="Geocoding Service"?r="Locator":e==="Microsoft Powerpoint"?r="Microsoft PowerPoint":e==="GeoJson"?r="GeoJSON":e==="Globe Service"?r="Globe Layer":e==="Vector Tile Service"?r="Tile Layer":e==="netCDF"?r="NetCDF":e==="Map Service"?r=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?r=e.replaceAll(/(add in)/gi,"Add-In"):e==="datastore catalog service"?r="Big Data File Share":e==="Compact Tile Package"?r="Tile Package (tpkx)":e==="Raster function template"?r="Raster Function Template":e==="OGCFeatureServer"?r="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")?r="Instant App":e==="Insights Page"?r="Insights Report":e==="Excalibur Imagery Project"?r="Excalibur Project":e==="3DTiles Service"?r="3D tiles layer":e==="3DTiles Package"&&(r="3D tiles package"),r}readExtent(e){return e&&e.length?new O(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",t=this.typeKeywords||[],r="esri/images/portal/",n="16";let i,u=!1,d=!1,v=!1,w=!1,h=!1,k=!1,S=!1,I=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(u=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(d=t.includes("Table"),v=t.includes("Route Layer"),w=t.includes("Markup"),h=t.includes("Spatiotemporal"),k=t.includes("UtilityNetwork"),i=h&&d?"spatiotemporaltable":d?"table":v?"routelayer":w?"markup":h?"spatiotemporal":k?"utilitynetwork":u?"featureshosted":"features"):e==="map service"||e==="wms"||e==="wmts"?(h=t.includes("Spatiotemporal"),S=t.includes("Relational"),i=h||S?"mapimages":u||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages"):i=e==="scene service"?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":e==="image service"?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":e==="stream service"?"streamlayer":e==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="video service"?t.includes("Live Stream")?"livestreamvideolayer":"videolayer":e==="geoprocessing service"?t.includes("Web Tool")?"tool":"layers":e==="geodata service"?"geodataservice":e==="3dtiles service"?t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):e==="web map"||e==="cityengine web scene"?i="maps":e==="web scene"?i=t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?i="instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?i="apps":e==="map document"||e==="map package"||e==="published map"||e==="scene document"||e==="globe document"||e==="basemap package"||e==="mobile basemap package"||e==="mobile map package"||e==="project package"||e==="project template"||e==="pro map"||e==="layout"||e==="layer"&&t.includes("ArcGIS Pro")||e==="explorer map"&&t.indexOf("Explorer Document")?i="mapsgray":e==="service definition"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="netcdf"||e==="administrative report"?i="datafiles":e==="360 vr experience"?i="360vr":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?i="appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?i="addindesktop":e==="pdf"?i="pdf":e==="microsoft word"?i="word":e==="microsoft excel"?i="excel":e==="microsoft powerpoint"?i="ppt":e==="rule package"||e==="file geodatabase"||e==="sqlite geodatabase"||e==="csv collection"||e==="kml collection"||e==="windows mobile package"||e==="map template"||e==="desktop application template"||e==="gml"||e==="arcpad package"||e==="code sample"||e==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?i="datafilesgray":e==="network analysis service"||e==="geoprocessing service"||e==="geodata service"||e==="geometry service"||e==="geoprocessing package"||e==="locator package"||e==="geoprocessing sample"||e==="workflow manager service"?i="toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?i="layersgray":e==="analysis model"?i="analysismodel":e==="scene package"?i="scenepackage":e==="3dtiles package"?i="3dtileslayerpackage":e==="3dtiles service"?i="3dtileslayer":e==="mobile scene package"?i="mobilescenepackage":e==="tile package"||e==="compact tile package"?i="tilepackage":e==="task file"?i="taskfile":e==="report template"?i="report-template":e==="statistical data collection"?i="statisticaldatacollection":e==="insights workbook"?i="workbook":e==="insights model"?i="insightsmodel":e==="insights page"?i="insightspage":e==="insights theme"?i="insightstheme":e==="hub initiative"?i="hubinitiative":e==="hub page"?i="hubpage":e==="hub site application"?i="hubsite":e==="hub event"?i="hubevent":e==="hub project"?i="hubproject":e==="relational database connection"?i="relationaldatabaseconnection":e==="big data file share"?i="datastorecollection":e==="image collection"?i="imagecollection":e==="desktop style"?i="desktopstyle":e==="style"?i=t.includes("Dictionary")?"dictionarystyle":"style":e==="dashboard"?i="dashboard":e==="raster function template"?i="rasterprocessingtemplate":e==="vector tile package"?i="vectortilepackage":e==="ortho mapping project"?i="orthomappingproject":e==="ortho mapping template"?i="orthomappingtemplate":e==="solution"?i="solutions":e==="geopackage"?i="geopackage":e==="deep learning package"?i="deeplearningpackage":e==="real time analytic"?i="realtimeanalytics":e==="reality mapping project"?i="realitymappingproject":e==="big data analytic"?i="bigdataanalytics":e==="feed"?i="feed":e==="excalibur imagery project"?i="excaliburimageryproject":e==="notebook"?i="notebook":e==="storymap"?i="storymap":e==="survey123 add in"?i="survey123addin":e==="mission"?i="mission":e==="mission report"?i="missionreport":e==="mission template"?i="missiontemplate":e==="quickcapture project"?i="quickcaptureproject":e==="pro report"?i="proreport":e==="pro report template"?i="proreporttemplate":e==="urban model"?i="urbanmodel":e==="urban project"?i="urbanproject":e==="web experience"?i="experiencebuilder":e==="web experience template"?i="webexperiencetemplate":e==="experience builder widget"?i="experiencebuilderwidget":e==="experience builder widget package"?i="experiencebuilderwidgetpackage":e==="workflow"?i="workflow":e==="kernel gateway connection"?i="kernelgatewayconnection":e==="insights script"?i="insightsscript":e==="hub initiative template"?i="hubinitiativetemplate":e==="storymap theme"?i="storymaptheme":e==="knowledge graph"?i="knowledgegraph":e==="knowledge graph layer"?i="knowledgegraphlayer":e==="knowledge studio project"?i="knowledgestudio":e==="native application"?i="nativeapp":e==="native application installer"?i="nativeappinstaller":e==="web link chart"?i="linkchart":e==="knowledge graph web investigation"?i="investigation":e==="ogcfeatureserver"?i="features":e==="pro presentation"?i="propresentation":e==="pro project"?i="proproject":e==="insights workbook package"?i="insightsworkbookpackage":e==="apache parquet"?i="apacheparquet":e==="notebook code snippet library"?i="notebookcodesnippets":e==="suitability model"?i="suitabilitymodel":e==="esri classifier definition"?i="classifierdefinition":e==="esri classification schema"?i="classificationschema":e==="insights data engineering workbook"?i="dataengineeringworkbook":e==="insights data engineering model"?i="dataengineeringmodel":e==="deep learning studio project"?i="deeplearningproject":e==="discussion"?i="discussion":e==="allsource project"?i="allsourceproject":e==="api key"?i="apikey":e==="data pipeline"?i="datapipelines":e==="group layer"?(I=t.includes("Map"),i=I?"layergroup2d":"layergroup"):i=e==="media layer"?"onlinemedialayer":e==="form"?t.includes("Survey123")?"survey":"datafilesgray":e==="csv"?"csv":e==="image"?"image":"maps",i?_(r+i+n+".png"):null}get isLayer(){return this.type!=null&&M.has(this.type)}get itemCdnUrl(){return q(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=R.getDefault()),r=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e!=null?e.signal:null,query:{token:this.apiKey}}):{}).then(n=>{this.sourceJSON=n,this.read(n)});return this.addResolvingPromise(r),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof f&&(e=e.rating),e==null||isNaN(e)||typeof e!="number"||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new f({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:l(this.applicationProxies),avgRating:this.avgRating,categories:l(this.categories),classification:l(this.classification),created:l(this.created),culture:this.culture,description:this.description,extent:l(this.extent),groupCategories:l(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:l(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:l(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new c({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const r=e[t];r&&(e[t]=JSON.stringify(r))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new f(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},c)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e?.data,r={method:"post"};r.query=this.createPostQuery();for(const n in r.query)r.query[n]===null&&(r.query[n]="");return r.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?r.query.text=t:typeof t=="object"&&(r.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,r).then(()=>this.reload())}):Promise.reject(new m("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new m("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:n,folder:i,tags:u,title:d}=e||{},v={method:"post",query:{copyPrivateResources:n==="all",folder:typeof i=="string"?i:i?.id,includeResources:!!n,tags:u?.join(","),title:d}},{itemId:w}=await t.request(`${r}/copy`,v);return new c({id:w,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,r=e.filename,n={method:"post"};if(typeof t=="string")C(t)?n.query={data:t}:n.query={url:D(t)},r!=null&&(n.query.filename=r);else{const i=new FormData;r!=null?i.append("file",t,r):i.append("file",t),n.body=i}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,n).then(()=>this.reload())}):Promise.reject(new m("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:r}=await g(()=>import("./resourceUtils-rTM6Iemx-Bu5Czfos.js"),__vite__mapDeps([0,1,2]),import.meta.url);return r(this,e,t)}async addResource(e,t,r){const{addOrUpdateResources:n}=await g(()=>import("./resourceUtils-rTM6Iemx-Bu5Czfos.js"),__vite__mapDeps([0,1,2]),import.meta.url);return e.portalItem=this,await n(this,[{resource:e,content:t,compress:r?.compress,access:r?.access}],"add",r),e}async removeResource(e,t){const{removeResource:r}=await g(()=>import("./resourceUtils-rTM6Iemx-Bu5Czfos.js"),__vite__mapDeps([0,1,2]),import.meta.url);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new m("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await g(()=>import("./resourceUtils-rTM6Iemx-Bu5Czfos.js"),__vite__mapDeps([0,1,2]),import.meta.url);return t(this,e)}resourceFromPath(e){return new K({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:l(this.categories),classification:l(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};return F(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new c({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)t==="tags"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="typeKeywords"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="extent"&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};a([o({type:["private","shared","org","public"]})],s.prototype,"access",void 0),a([o()],s.prototype,"accessInformation",void 0),a([o({type:String})],s.prototype,"apiKey",void 0),a([o({json:{read:{source:"appProxies"}}})],s.prototype,"applicationProxies",void 0),a([o()],s.prototype,"avgRating",void 0),a([o()],s.prototype,"categories",void 0),a([o()],s.prototype,"classification",void 0),a([o({type:Date})],s.prototype,"created",void 0),a([o()],s.prototype,"culture",void 0),a([o()],s.prototype,"description",void 0),a([o({readOnly:!0})],s.prototype,"displayName",null),a([o({type:O})],s.prototype,"extent",void 0),a([N("extent")],s.prototype,"readExtent",null),a([o()],s.prototype,"groupCategories",void 0),a([o({readOnly:!0})],s.prototype,"iconUrl",null),a([o()],s.prototype,"id",void 0),a([o({readOnly:!0})],s.prototype,"isLayer",null),a([o({type:Boolean,readOnly:!0})],s.prototype,"isOrgItem",void 0),a([o()],s.prototype,"itemControl",void 0),a([o({readOnly:!0})],s.prototype,"itemPageUrl",null),a([o({readOnly:!0})],s.prototype,"itemUrl",null),a([o()],s.prototype,"licenseInfo",void 0),a([o({type:Date})],s.prototype,"modified",void 0),a([o()],s.prototype,"name",void 0),a([o()],s.prototype,"numComments",void 0),a([o()],s.prototype,"numRatings",void 0),a([o()],s.prototype,"numViews",void 0),a([o()],s.prototype,"owner",void 0),a([o()],s.prototype,"ownerFolder",void 0),a([o({type:R})],s.prototype,"portal",void 0),a([o()],s.prototype,"screenshots",void 0),a([o()],s.prototype,"size",void 0),a([o()],s.prototype,"snippet",void 0),a([o()],s.prototype,"sourceJSON",void 0),a([o({type:String})],s.prototype,"sourceUrl",void 0),a([o({type:String})],s.prototype,"spatialReference",void 0),a([o()],s.prototype,"tags",void 0),a([o()],s.prototype,"thumbnail",void 0),a([o({readOnly:!0})],s.prototype,"thumbnailUrl",null),a([o()],s.prototype,"title",void 0),a([o()],s.prototype,"type",void 0),a([o()],s.prototype,"typeKeywords",void 0),a([o({type:String,json:{read(e,t){if(A.has(t.type)){const r=this.portal?.restUrl;e||=r&&this.id?`${r}/content/items/${this.id}/data`:null}return e}}})],s.prototype,"url",void 0),a([o({readOnly:!0})],s.prototype,"userItemUrl",null),s=c=a([b("esri.portal.PortalItem")],s);const G=s;export{G as default}; diff --git a/main/assets/PortalItem-CctGdnxF-DNdsi_Qx.js b/main/assets/PortalItem-CctGdnxF-DNdsi_Qx.js deleted file mode 100644 index a8114867a..000000000 --- a/main/assets/PortalItem-CctGdnxF-DNdsi_Qx.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-C_sFWCPe.js","./main-BZaw9FpY.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); -import{v as a,ad as j,bA as T,aO as L,n as O,bw as _,d6 as q,r as R,P as l,o as m,d7 as C,Y as D,_ as g,M as F,S as o,a0 as N,i as b,j as U,d8 as P,a1 as E,d9 as $,aB as J}from"./main-BZaw9FpY.js";let p=class extends U{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e?.portalItem&&e.path?{...e,path:x(e.path,e.portalItem)}:e}set path(e){e!=null&&P(e)?E.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return x(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.cdnUrl;if(r==null)throw new m("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey,_ts:t?.cacheBust?Date.now():null},signal:t?.signal})}async update(e,t){const{addOrUpdateResources:r}=await g(()=>import("./resourceUtils-rTM6Iemx-C_sFWCPe.js"),__vite__mapDeps([0,1,2]),import.meta.url);return await r(this.portalItem,[{resource:this,content:e,compress:t?.compress,access:t?.access}],"update",t),this}hasPath(){return this.path!=null}};function x(e,t){return e==null?e:(e=e.replace(/^\/+/,""),t!=null&&P(e)&&(e=$(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}a([o()],p.prototype,"portalItem",void 0),a([o({type:String,value:null})],p.prototype,"path",null),a([j("path")],p.prototype,"_castPath",null),a([o({type:String,readOnly:!0})],p.prototype,"url",null),a([o({type:String,readOnly:!0})],p.prototype,"cdnUrl",null),a([o({type:String,readOnly:!0})],p.prototype,"itemRelativeUrl",null),p=a([b("esri.portal.PortalItemResource")],p);const K=p;let y=class extends U{constructor(e){super(e),this.created=null,this.rating=null}};a([o()],y.prototype,"created",void 0),a([o()],y.prototype,"rating",void 0),y=a([b("esri.portal.PortalRating")],y);const f=y;var c;const M=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),A=new Set(["KML","GeoJson","CSV"]);let s=c=class extends T(J){static from(e){return L(c,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let r=e;return e==="Feature Service"||e==="Feature Collection"?r=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?r=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?r="Scene Layer":e==="Video Service"?r="Video Layer":e==="Scene Package"?r="Scene Layer Package":e==="Stream Service"?r="Feature Layer":e==="Geoprocessing Service"?r=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geoenrichment Service"?r="GeoEnrichment Service":e==="Geocoding Service"?r="Locator":e==="Microsoft Powerpoint"?r="Microsoft PowerPoint":e==="GeoJson"?r="GeoJSON":e==="Globe Service"?r="Globe Layer":e==="Vector Tile Service"?r="Tile Layer":e==="netCDF"?r="NetCDF":e==="Map Service"?r=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?r=e.replaceAll(/(add in)/gi,"Add-In"):e==="datastore catalog service"?r="Big Data File Share":e==="Compact Tile Package"?r="Tile Package (tpkx)":e==="Raster function template"?r="Raster Function Template":e==="OGCFeatureServer"?r="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")?r="Instant App":e==="Insights Page"?r="Insights Report":e==="Excalibur Imagery Project"?r="Excalibur Project":e==="3DTiles Service"?r="3D tiles layer":e==="3DTiles Package"&&(r="3D tiles package"),r}readExtent(e){return e&&e.length?new O(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",t=this.typeKeywords||[],r="esri/images/portal/",n="16";let i,u=!1,d=!1,v=!1,w=!1,h=!1,k=!1,S=!1,I=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(u=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(d=t.includes("Table"),v=t.includes("Route Layer"),w=t.includes("Markup"),h=t.includes("Spatiotemporal"),k=t.includes("UtilityNetwork"),i=h&&d?"spatiotemporaltable":d?"table":v?"routelayer":w?"markup":h?"spatiotemporal":k?"utilitynetwork":u?"featureshosted":"features"):e==="map service"||e==="wms"||e==="wmts"?(h=t.includes("Spatiotemporal"),S=t.includes("Relational"),i=h||S?"mapimages":u||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages"):i=e==="scene service"?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":e==="image service"?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":e==="stream service"?"streamlayer":e==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="video service"?t.includes("Live Stream")?"livestreamvideolayer":"videolayer":e==="geoprocessing service"?t.includes("Web Tool")?"tool":"layers":e==="geodata service"?"geodataservice":e==="3dtiles service"?t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):e==="web map"||e==="cityengine web scene"?i="maps":e==="web scene"?i=t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?i="instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?i="apps":e==="map document"||e==="map package"||e==="published map"||e==="scene document"||e==="globe document"||e==="basemap package"||e==="mobile basemap package"||e==="mobile map package"||e==="project package"||e==="project template"||e==="pro map"||e==="layout"||e==="layer"&&t.includes("ArcGIS Pro")||e==="explorer map"&&t.indexOf("Explorer Document")?i="mapsgray":e==="service definition"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="netcdf"||e==="administrative report"?i="datafiles":e==="360 vr experience"?i="360vr":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?i="appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?i="addindesktop":e==="pdf"?i="pdf":e==="microsoft word"?i="word":e==="microsoft excel"?i="excel":e==="microsoft powerpoint"?i="ppt":e==="rule package"||e==="file geodatabase"||e==="sqlite geodatabase"||e==="csv collection"||e==="kml collection"||e==="windows mobile package"||e==="map template"||e==="desktop application template"||e==="gml"||e==="arcpad package"||e==="code sample"||e==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?i="datafilesgray":e==="network analysis service"||e==="geoprocessing service"||e==="geodata service"||e==="geometry service"||e==="geoprocessing package"||e==="locator package"||e==="geoprocessing sample"||e==="workflow manager service"?i="toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?i="layersgray":e==="analysis model"?i="analysismodel":e==="scene package"?i="scenepackage":e==="3dtiles package"?i="3dtileslayerpackage":e==="3dtiles service"?i="3dtileslayer":e==="mobile scene package"?i="mobilescenepackage":e==="tile package"||e==="compact tile package"?i="tilepackage":e==="task file"?i="taskfile":e==="report template"?i="report-template":e==="statistical data collection"?i="statisticaldatacollection":e==="insights workbook"?i="workbook":e==="insights model"?i="insightsmodel":e==="insights page"?i="insightspage":e==="insights theme"?i="insightstheme":e==="hub initiative"?i="hubinitiative":e==="hub page"?i="hubpage":e==="hub site application"?i="hubsite":e==="hub event"?i="hubevent":e==="hub project"?i="hubproject":e==="relational database connection"?i="relationaldatabaseconnection":e==="big data file share"?i="datastorecollection":e==="image collection"?i="imagecollection":e==="desktop style"?i="desktopstyle":e==="style"?i=t.includes("Dictionary")?"dictionarystyle":"style":e==="dashboard"?i="dashboard":e==="raster function template"?i="rasterprocessingtemplate":e==="vector tile package"?i="vectortilepackage":e==="ortho mapping project"?i="orthomappingproject":e==="ortho mapping template"?i="orthomappingtemplate":e==="solution"?i="solutions":e==="geopackage"?i="geopackage":e==="deep learning package"?i="deeplearningpackage":e==="real time analytic"?i="realtimeanalytics":e==="reality mapping project"?i="realitymappingproject":e==="big data analytic"?i="bigdataanalytics":e==="feed"?i="feed":e==="excalibur imagery project"?i="excaliburimageryproject":e==="notebook"?i="notebook":e==="storymap"?i="storymap":e==="survey123 add in"?i="survey123addin":e==="mission"?i="mission":e==="mission report"?i="missionreport":e==="mission template"?i="missiontemplate":e==="quickcapture project"?i="quickcaptureproject":e==="pro report"?i="proreport":e==="pro report template"?i="proreporttemplate":e==="urban model"?i="urbanmodel":e==="urban project"?i="urbanproject":e==="web experience"?i="experiencebuilder":e==="web experience template"?i="webexperiencetemplate":e==="experience builder widget"?i="experiencebuilderwidget":e==="experience builder widget package"?i="experiencebuilderwidgetpackage":e==="workflow"?i="workflow":e==="kernel gateway connection"?i="kernelgatewayconnection":e==="insights script"?i="insightsscript":e==="hub initiative template"?i="hubinitiativetemplate":e==="storymap theme"?i="storymaptheme":e==="knowledge graph"?i="knowledgegraph":e==="knowledge graph layer"?i="knowledgegraphlayer":e==="knowledge studio project"?i="knowledgestudio":e==="native application"?i="nativeapp":e==="native application installer"?i="nativeappinstaller":e==="web link chart"?i="linkchart":e==="knowledge graph web investigation"?i="investigation":e==="ogcfeatureserver"?i="features":e==="pro presentation"?i="propresentation":e==="pro project"?i="proproject":e==="insights workbook package"?i="insightsworkbookpackage":e==="apache parquet"?i="apacheparquet":e==="notebook code snippet library"?i="notebookcodesnippets":e==="suitability model"?i="suitabilitymodel":e==="esri classifier definition"?i="classifierdefinition":e==="esri classification schema"?i="classificationschema":e==="insights data engineering workbook"?i="dataengineeringworkbook":e==="insights data engineering model"?i="dataengineeringmodel":e==="deep learning studio project"?i="deeplearningproject":e==="discussion"?i="discussion":e==="allsource project"?i="allsourceproject":e==="api key"?i="apikey":e==="data pipeline"?i="datapipelines":e==="group layer"?(I=t.includes("Map"),i=I?"layergroup2d":"layergroup"):i=e==="media layer"?"onlinemedialayer":e==="form"?t.includes("Survey123")?"survey":"datafilesgray":e==="csv"?"csv":e==="image"?"image":"maps",i?_(r+i+n+".png"):null}get isLayer(){return this.type!=null&&M.has(this.type)}get itemCdnUrl(){return q(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=R.getDefault()),r=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e!=null?e.signal:null,query:{token:this.apiKey}}):{}).then(n=>{this.sourceJSON=n,this.read(n)});return this.addResolvingPromise(r),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof f&&(e=e.rating),e==null||isNaN(e)||typeof e!="number"||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new f({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:l(this.applicationProxies),avgRating:this.avgRating,categories:l(this.categories),classification:l(this.classification),created:l(this.created),culture:this.culture,description:this.description,extent:l(this.extent),groupCategories:l(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:l(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:l(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new c({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const r=e[t];r&&(e[t]=JSON.stringify(r))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new f(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},c)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e?.data,r={method:"post"};r.query=this.createPostQuery();for(const n in r.query)r.query[n]===null&&(r.query[n]="");return r.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?r.query.text=t:typeof t=="object"&&(r.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,r).then(()=>this.reload())}):Promise.reject(new m("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new m("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:n,folder:i,tags:u,title:d}=e||{},v={method:"post",query:{copyPrivateResources:n==="all",folder:typeof i=="string"?i:i?.id,includeResources:!!n,tags:u?.join(","),title:d}},{itemId:w}=await t.request(`${r}/copy`,v);return new c({id:w,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,r=e.filename,n={method:"post"};if(typeof t=="string")C(t)?n.query={data:t}:n.query={url:D(t)},r!=null&&(n.query.filename=r);else{const i=new FormData;r!=null?i.append("file",t,r):i.append("file",t),n.body=i}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,n).then(()=>this.reload())}):Promise.reject(new m("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:r}=await g(()=>import("./resourceUtils-rTM6Iemx-C_sFWCPe.js"),__vite__mapDeps([0,1,2]),import.meta.url);return r(this,e,t)}async addResource(e,t,r){const{addOrUpdateResources:n}=await g(()=>import("./resourceUtils-rTM6Iemx-C_sFWCPe.js"),__vite__mapDeps([0,1,2]),import.meta.url);return e.portalItem=this,await n(this,[{resource:e,content:t,compress:r?.compress,access:r?.access}],"add",r),e}async removeResource(e,t){const{removeResource:r}=await g(()=>import("./resourceUtils-rTM6Iemx-C_sFWCPe.js"),__vite__mapDeps([0,1,2]),import.meta.url);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new m("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await g(()=>import("./resourceUtils-rTM6Iemx-C_sFWCPe.js"),__vite__mapDeps([0,1,2]),import.meta.url);return t(this,e)}resourceFromPath(e){return new K({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:l(this.categories),classification:l(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};return F(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new c({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)t==="tags"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="typeKeywords"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="extent"&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};a([o({type:["private","shared","org","public"]})],s.prototype,"access",void 0),a([o()],s.prototype,"accessInformation",void 0),a([o({type:String})],s.prototype,"apiKey",void 0),a([o({json:{read:{source:"appProxies"}}})],s.prototype,"applicationProxies",void 0),a([o()],s.prototype,"avgRating",void 0),a([o()],s.prototype,"categories",void 0),a([o()],s.prototype,"classification",void 0),a([o({type:Date})],s.prototype,"created",void 0),a([o()],s.prototype,"culture",void 0),a([o()],s.prototype,"description",void 0),a([o({readOnly:!0})],s.prototype,"displayName",null),a([o({type:O})],s.prototype,"extent",void 0),a([N("extent")],s.prototype,"readExtent",null),a([o()],s.prototype,"groupCategories",void 0),a([o({readOnly:!0})],s.prototype,"iconUrl",null),a([o()],s.prototype,"id",void 0),a([o({readOnly:!0})],s.prototype,"isLayer",null),a([o({type:Boolean,readOnly:!0})],s.prototype,"isOrgItem",void 0),a([o()],s.prototype,"itemControl",void 0),a([o({readOnly:!0})],s.prototype,"itemPageUrl",null),a([o({readOnly:!0})],s.prototype,"itemUrl",null),a([o()],s.prototype,"licenseInfo",void 0),a([o({type:Date})],s.prototype,"modified",void 0),a([o()],s.prototype,"name",void 0),a([o()],s.prototype,"numComments",void 0),a([o()],s.prototype,"numRatings",void 0),a([o()],s.prototype,"numViews",void 0),a([o()],s.prototype,"owner",void 0),a([o()],s.prototype,"ownerFolder",void 0),a([o({type:R})],s.prototype,"portal",void 0),a([o()],s.prototype,"screenshots",void 0),a([o()],s.prototype,"size",void 0),a([o()],s.prototype,"snippet",void 0),a([o()],s.prototype,"sourceJSON",void 0),a([o({type:String})],s.prototype,"sourceUrl",void 0),a([o({type:String})],s.prototype,"spatialReference",void 0),a([o()],s.prototype,"tags",void 0),a([o()],s.prototype,"thumbnail",void 0),a([o({readOnly:!0})],s.prototype,"thumbnailUrl",null),a([o()],s.prototype,"title",void 0),a([o()],s.prototype,"type",void 0),a([o()],s.prototype,"typeKeywords",void 0),a([o({type:String,json:{read(e,t){if(A.has(t.type)){const r=this.portal?.restUrl;e||=r&&this.id?`${r}/content/items/${this.id}/data`:null}return e}}})],s.prototype,"url",void 0),a([o({readOnly:!0})],s.prototype,"userItemUrl",null),s=c=a([b("esri.portal.PortalItem")],s);const G=s;export{G as default}; diff --git a/main/assets/PortalLayer-CElnYuSQ-BV63HHSL.js b/main/assets/PortalLayer-CElnYuSQ-BV63HHSL.js new file mode 100644 index 000000000..f6677dd71 --- /dev/null +++ b/main/assets/PortalLayer-CElnYuSQ-BV63HHSL.js @@ -0,0 +1,3 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersLoader-CYI-LpLl-Bjk1FanA.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./fetchService-DbaKmJhP-DPDp5i2e.js","./portalLayers-Bh9bAhk4-CIQyh8K9.js","./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./layersCreator-CW56kDKc-CK8sXxzK.js","./styleUtils-ChrJTYIw-OCRItq_6.js","./jsonContext-BA8GHqVk-DpBf0bCt.js"])))=>i.map(i=>d[i]); +import{v as l,S as d,a0 as w,ac as _,i as U,aA as E,_ as H,$ as b,aU as $,a1 as F,W as n,C as L,dr as T,ds as k,V as m,r as y,k as I,b6 as x,f as D,dt as O,Q as S,o as B}from"./main-C7yV2j71.js";import f from"./PortalItem-CctGdnxF-CHPkp6yW.js";import{m as v}from"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";const V=P=>{let a=class extends P{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=E(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(r){r!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",r))}readPortalItem(r,e,t){if(e.itemId)return new f({id:e.itemId,portal:t?.portal})}writePortalItem(r,e){r?.id&&(e.itemId=r.id)}async loadFromPortal(r,e){if(this.portalItem?.id)try{const{load:t}=await H(()=>import("./layersLoader-CYI-LpLl-Bjk1FanA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);return b(e),await t({instance:this,supportedTypes:r.supportedTypes,validateItem:r.validateItem,supportsData:r.supportsData,layerModuleTypeMap:r.layerModuleTypeMap},e)}catch(t){throw $(t)||F.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) + ${t}`),t}}async finishLoadEditablePortalLayer(r){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(r).catch(e=>(n(e),!0)))}async setUserPrivileges(r,e){if(!L.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:t,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(r,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(t){n(t)}}async _fetchUserPrivileges(r,e){let t=this.portalItem;if(!r||!t||!t.loaded||t.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=r===t.id;if(i&&t.portal.user)return v(t);let s,p;if(i)s=t.portal.url;else try{s=await T(this.url,e)}catch(o){n(o)}if(!s||!k(s,t.portal.url))return this._fetchFallbackUserPrivileges(e);try{const o=e!=null?e.signal:null;p=await m?.getCredential(`${s}/sharing`,{prompt:!1,signal:o})}catch(o){n(o)}const c=!0,u=!1,g=!1;if(!p)return{features:{edit:c,fullEdit:u},content:{updateItem:g}};try{if(i?await t.reload():(t=new f({id:r,portal:{url:s}}),await t.load(e)),t.portal.user)return v(t)}catch(o){n(o)}return{features:{edit:c,fullEdit:u},content:{updateItem:g}}}async _fetchFallbackUserPrivileges(r){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(r)}catch(t){n(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(r){const e=this.url?m?.findCredential(this.url):null;if(!e)return!0;const t=h.credential===e?h.user:await this._fetchEditingUser(r);return h.credential=e,h.user=t,t?.privileges==null||t.privileges.includes("features:user:edit")}async _fetchEditingUser(r){const e=this.portalItem?.portal?.user;if(e)return e;const t=m?.findServerInfo(this.url??"");if(!t?.owningSystemUrl)return null;const i=`${t.owningSystemUrl}/sharing/rest`,s=y.getDefault();if(s&&s.loaded&&I(s.restUrl)===I(i))return s.user;const p=`${i}/community/self`,c=r!=null?r.signal:null,u=await x(D(p,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?O.fromJSON(u.value.data):null}read(r,e){e&&(e.layer=this),super.read(r,e)}write(r,e){const t=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||y.getDefault());return t&&i&&!S(i.restUrl,t.restUrl)?(e.messages&&e.messages.push(new B("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(r,{...e,layer:this})}};return l([d({type:f})],a.prototype,"portalItem",null),l([w("web-document","portalItem",["itemId"])],a.prototype,"readPortalItem",null),l([_("web-document","portalItem",{itemId:{type:String}})],a.prototype,"writePortalItem",null),l([d({clonable:!1})],a.prototype,"resourceReferences",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasFullEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasUpdateItemPrivileges",void 0),a=l([U("esri.layers.mixins.PortalLayer")],a),a},h={credential:null,user:null};export{V as C}; diff --git a/main/assets/PortalLayer-CElnYuSQ-tfjbIq8z.js b/main/assets/PortalLayer-CElnYuSQ-tfjbIq8z.js deleted file mode 100644 index 26dbb3fe2..000000000 --- a/main/assets/PortalLayer-CElnYuSQ-tfjbIq8z.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersLoader-CYI-LpLl-BMluujm4.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./fetchService-DbaKmJhP-CtznRt8p.js","./portalLayers-Bh9bAhk4-BaKPDASj.js","./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./layersCreator-CW56kDKc-gpROgX1S.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js","./jsonContext-BA8GHqVk-BMETb6sX.js"])))=>i.map(i=>d[i]); -import{v as l,S as d,a0 as w,ac as _,i as U,aA as E,_ as H,$ as b,aU as $,a1 as F,W as n,C as L,dr as T,ds as k,V as m,r as y,k as I,b6 as x,f as D,dt as O,Q as S,o as B}from"./main-BZaw9FpY.js";import f from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import{m as v}from"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";const V=P=>{let a=class extends P{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=E(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(r){r!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",r))}readPortalItem(r,e,t){if(e.itemId)return new f({id:e.itemId,portal:t?.portal})}writePortalItem(r,e){r?.id&&(e.itemId=r.id)}async loadFromPortal(r,e){if(this.portalItem?.id)try{const{load:t}=await H(()=>import("./layersLoader-CYI-LpLl-BMluujm4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);return b(e),await t({instance:this,supportedTypes:r.supportedTypes,validateItem:r.validateItem,supportsData:r.supportsData,layerModuleTypeMap:r.layerModuleTypeMap},e)}catch(t){throw $(t)||F.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) - ${t}`),t}}async finishLoadEditablePortalLayer(r){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(r).catch(e=>(n(e),!0)))}async setUserPrivileges(r,e){if(!L.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:t,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(r,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(t){n(t)}}async _fetchUserPrivileges(r,e){let t=this.portalItem;if(!r||!t||!t.loaded||t.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=r===t.id;if(i&&t.portal.user)return v(t);let s,p;if(i)s=t.portal.url;else try{s=await T(this.url,e)}catch(o){n(o)}if(!s||!k(s,t.portal.url))return this._fetchFallbackUserPrivileges(e);try{const o=e!=null?e.signal:null;p=await m?.getCredential(`${s}/sharing`,{prompt:!1,signal:o})}catch(o){n(o)}const c=!0,u=!1,g=!1;if(!p)return{features:{edit:c,fullEdit:u},content:{updateItem:g}};try{if(i?await t.reload():(t=new f({id:r,portal:{url:s}}),await t.load(e)),t.portal.user)return v(t)}catch(o){n(o)}return{features:{edit:c,fullEdit:u},content:{updateItem:g}}}async _fetchFallbackUserPrivileges(r){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(r)}catch(t){n(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(r){const e=this.url?m?.findCredential(this.url):null;if(!e)return!0;const t=h.credential===e?h.user:await this._fetchEditingUser(r);return h.credential=e,h.user=t,t?.privileges==null||t.privileges.includes("features:user:edit")}async _fetchEditingUser(r){const e=this.portalItem?.portal?.user;if(e)return e;const t=m?.findServerInfo(this.url??"");if(!t?.owningSystemUrl)return null;const i=`${t.owningSystemUrl}/sharing/rest`,s=y.getDefault();if(s&&s.loaded&&I(s.restUrl)===I(i))return s.user;const p=`${i}/community/self`,c=r!=null?r.signal:null,u=await x(D(p,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?O.fromJSON(u.value.data):null}read(r,e){e&&(e.layer=this),super.read(r,e)}write(r,e){const t=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||y.getDefault());return t&&i&&!S(i.restUrl,t.restUrl)?(e.messages&&e.messages.push(new B("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(r,{...e,layer:this})}};return l([d({type:f})],a.prototype,"portalItem",null),l([w("web-document","portalItem",["itemId"])],a.prototype,"readPortalItem",null),l([_("web-document","portalItem",{itemId:{type:String}})],a.prototype,"writePortalItem",null),l([d({clonable:!1})],a.prototype,"resourceReferences",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasFullEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasUpdateItemPrivileges",void 0),a=l([U("esri.layers.mixins.PortalLayer")],a),a},h={credential:null,user:null};export{V as C}; diff --git a/main/assets/Program-DLVwTiPA-CHQtoRqS.js b/main/assets/Program-DLVwTiPA-CHQtoRqS.js new file mode 100644 index 000000000..f9801ba58 --- /dev/null +++ b/main/assets/Program-DLVwTiPA-CHQtoRqS.js @@ -0,0 +1,9 @@ +import{hT as j,a1 as J}from"./main-C7yV2j71.js";import{r as ut}from"./BufferObject-BM_7mcDb-CTo2uuE5.js";import{P as y,V as M,F as dt,t as O,X as mt}from"./Texture-BCt2hphT-CtQVMDnp.js";import{V as p,X as x,U as I,F as _t,s as X,Y as C,P as b,n as gt,S as pt,H as A,E as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";let Qt=class{constructor(i,t,e=t){this.internalFormat=i,this.width=t,this.height=e,this.multisampled=!1,this.samples=1}};function Tt(i){return i.width<=0||i.height<=0||i.internalFormat==null?0:i.width*i.height*mt(i.internalFormat)}let xt=class{constructor(i,t){this._context=i,this._descriptor=t,this.type=y.RenderBuffer,this._context.instanceCounter.increment(p.Renderbuffer,this);const e=this._context.gl;this.glName=e.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:o,multisampled:a}=t;a?e.renderbufferStorageMultisample(e.RENDERBUFFER,this.samples,o,r,n):e.renderbufferStorage(e.RENDERBUFFER,o,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const i=this._descriptor.samples,t=this._context.parameters.maxSamples;return i?Math.min(i,t):t}get usedMemory(){return Tt(this._descriptor)}resize(i,t){const e=this._descriptor;if(e.width===i&&e.height===t)return;e.width=i,e.height=t;const r=this._context.gl;this._context.bindRenderbuffer(this),e.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,e.internalFormat,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,e.internalFormat,e.width,e.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.Renderbuffer,this),this._context=null)}};const Et=()=>J.getLogger("esri.views.webgl.FramebufferObject");let bt=class F{constructor(t,e,r=null){this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.FramebufferObject,this);const n=w(e)?e:new M(this._context,e);if(this._colorAttachments.set(x.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(x.COLOR_ATTACHMENT0),r!=null)if(At(r))this._depthStencilTexture=w(r)?r:new M(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const o=St(r)?r:new xt(this._context,r);this._depthStencilBuffer=o,this._validateRenderBufferDescriptor(o.descriptor)}}dispose(){if(this._colorAttachments.size===0&&!this._glName)return;const t=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((e,r)=>this.detachColorTexture(r)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(p.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,r])=>t+r.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&w(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=x.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const r=t.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=x.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(e){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(t),e}}setColorTextureTarget(t,e=x.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);r&&this._framebufferTexture2D(r.glName,e,t)}attachDepthStencil(t){if(t)switch(t.type){case y.Texture:return this._attachDepthStencilTexture(t);case y.RenderBuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(t==null)return;const e=t.descriptor;e.pixelFormat!==I.DEPTH_STENCIL&&e.pixelFormat!==I.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==_t.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,X)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,X),this._context.bindFramebuffer(e)}return this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(t==null)return;const e=t.descriptor;if(this._validateRenderBufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(e);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,null),this._context.bindFramebuffer(e)}return this._depthStencilBuffer=null,t}copyToTexture(t,e,r,n,o,a,h){(t<0||e<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const s=h.descriptor;h.descriptor.target!==b.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(s?.width==null||s?.height==null||t+r>this.width||e+n>this.height||o+r>s.width||a+n>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,l=c.bindTexture(h,M.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(b.TEXTURE_2D,0,o,a,t,e,r,n),c.bindTexture(l,M.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,r,n,o,a,h){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,r,n,o,a,h)}async readPixelsAsync(t,e,r,n,o,a,h){const{gl:s}=this._context,c=ut.createPixelPack(this._context,gt.STREAM_READ,h.byteLength);this._context.bindBuffer(c);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),s.readPixels(t,e,r,n,o,a,0),this._context.unbindBuffer(pt.PIXEL_PACK_BUFFER),this._context.bindFramebuffer(l),await c.getSubDataAsync(h),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const r={width:t,height:e};R(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(n=>n.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(R(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=C.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const r=e.createFramebuffer();if(e.bindFramebuffer(t,r),this._colorAttachments.forEach((n,o)=>this._framebufferTexture2D(n.glName,o,z(n),t)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,n,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,z(this._depthStencilTexture),t);dt()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=x.COLOR_ATTACHMENT0,r=b.TEXTURE_2D,n=C.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(n,e,r,t,o)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(C.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=j(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=j(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==b.TEXTURE_2D&&t.target!==b.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),R(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderBufferDescriptor(t){R(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case A.DEPTH_COMPONENT16:case A.DEPTH_COMPONENT24:case A.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case A.DEPTH24_STENCIL8:case A.DEPTH32F_STENCIL8:case A.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case A.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(t){if(F._MAX_COLOR_ATTACHMENTS===-1){const{gl:r}=this._context;F._MAX_COLOR_ATTACHMENTS=r.getParameter(r.MAX_COLOR_ATTACHMENTS)}const e=t-x.COLOR_ATTACHMENT0;e+1>F._MAX_COLOR_ATTACHMENTS&&J.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${F._MAX_COLOR_ATTACHMENTS} color attachments`)}};function w(i){return i!=null&&"type"in i&&i.type===y.Texture}function St(i){return i!=null&&"type"in i&&i.type===y.RenderBuffer}function At(i){return w(i)||i!=null&&"pixelFormat"in i}function R(i,t){const e=Math.max(i.width,i.height);if(e>t){Et().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${t}`);const r=t/e;return i.width=Math.round(i.width*r),i.height=Math.round(i.height*r),!1}return!0}function z(i){return i.descriptor.target===b.TEXTURE_CUBE_MAP?b.TEXTURE_CUBE_MAP_POSITIVE_X:b.TEXTURE_2D}bt._MAX_COLOR_ATTACHMENTS=-1;const Dt=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"],Mt=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"],V=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"],Ct=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"];var g=999,G=9999,L=0,N=1,$=2,q=3,K=4,v=5,Ft=6,Ut=7,yt=8,Q=9,Rt=10,W=11,vt=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function wt(){var i,t,e,r=0,n=0,o=g,a=[],h=[],s=1,c=0,l=0,u=!1,_=!1,m="";return function(f){return h=[],f!==null?et(f.replace?f.replace(/\r\n/g,` +`):f):rt()};function d(f){f.length&&h.push({type:vt[o],data:f,position:l,line:s,column:c})}function et(f){var S;for(r=0,e=(m+=f).length;i=m[r],r0)continue;D=f.slice(0,1).join("")}return d(D),l+=D.length,(a=a.slice(D.length)).length}}function ht(){return/[^a-fA-F0-9]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function lt(){return i==="."||/[eE]/.test(i)?(a.push(i),o=v,t=i,r+1):i==="x"&&a.length===1&&a[0]==="0"?(o=W,a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ct(){return i==="f"&&(a.push(i),t=i,r+=1),/[eE]/.test(i)||i==="-"&&/[eE]/.test(t)?(a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ft(){if(/[^\d\w_]/.test(i)){var f=a.join("");return o=Mt.indexOf(f)>-1?yt:Ct.indexOf(f)>-1?Ut:Ft,d(a.join("")),o=g,r}return a.push(i),t=i,r+1}}function Pt(i){var t=wt(),e=[];return e=(e=e.concat(t(i))).concat(t(null))}function Lt(i){return Pt(i)}function Nt(i){return i.map(t=>t.type!=="eof"?t.data:"").join("")}const B=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function Bt(i,t="100",e="300 es"){const r=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of i)if(n.type==="preprocessor"){const o=r.exec(n.data);if(o){const a=o[1].replaceAll(/\s{2,}/g," ");if(a===e)return a;if(a===t)return n.data="#version "+e,t;throw new Error("unknown glsl version: "+a)}}return i.splice(0,0,{type:"preprocessor",data:"#version "+e},{type:"whitespace",data:` +`}),null}function Ot(i,t){for(let e=t-1;e>=0;e--){const r=i[e];if(r.type!=="whitespace"&&r.type!=="block-comment"){if(r.type!=="keyword")break;if(r.data==="attribute"||r.data==="in")return!0}}return!1}function U(i,t,e,r){r=r||e;for(const n of i)if(n.type==="ident"&&n.data===e)return r in t?t[r]++:t[r]=0,U(i,t,r+"_"+t[r],r);return e}function tt(i,t,e="afterVersion"){function r(s,c){for(let l=c;ls=0;--h){const s=e[h];if(s.type==="preprocessor"){const c=s.data.match(/#extension\s+(.*):/);if(c?.[1]&&B.has(c[1].trim())){const _=e[h+1];e.splice(h,_&&_.type==="whitespace"?2:1)}const l=s.data.match(/#ifdef\s+(.*)/);l?.[1]&&B.has(l[1].trim())&&(s.data="#if 1");const u=s.data.match(/#ifndef\s+(.*)/);u?.[1]&&B.has(u[1].trim())&&(s.data="#if 0")}}return It(i,Nt(e))}function It(i,t){return t}const Xt=4294967295;class Wt{constructor(t,e,r,n,o=new Map,a=[]){this._context=t,this._locations=n,this._uniformBlockBindings=o,this._transformFeedbackVaryings=a,this._refCount=1,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,t||console.error("RenderingContext isn't initialized!"),e.length===0&&console.error("Shaders source should not be empty!"),e=Y(e,T.VERTEX_SHADER),r=Y(r,T.FRAGMENT_SHADER),this._vShader=Z(this._context,T.VERTEX_SHADER,e),this._fShader=Z(this._context,T.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(p.Shader,this),O()&&(this.vertexShader=e,this.fragmentShader=r),this.usedMemory=e.length+r.length;const h=this._context.gl,s=h.createProgram();h.attachShader(s,this._vShader),h.attachShader(s,this._fShader),this._locations.forEach((c,l)=>h.bindAttribLocation(s,c,l)),this._transformFeedbackVaryings?.length&&h.transformFeedbackVaryings(s,this._transformFeedbackVaryings,h.SEPARATE_ATTRIBS),h.linkProgram(s),O()&&!h.getProgramParameter(s,h.LINK_STATUS)&&console.error(`Could not link shader +validated: ${h.getProgramParameter(s,h.VALIDATE_STATUS)}, gl error ${h.getError()}, vertex: ${h.getShaderParameter(this._vShader,h.COMPILE_STATUS)}, fragment: ${h.getShaderParameter(this._fShader,h.COMPILE_STATUS)}, info log: ${h.getProgramInfoLog(s)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(const[c,l]of this._uniformBlockBindings){const u=h.getUniformBlockIndex(s,c);u0)return;const t=this._context.gl,e=this._context.instanceCounter;this._nameToUniformLocation.forEach(r=>r&&e.decrement(p.Uniform,r)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(e.decrement(p.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),t.deleteShader(this._vShader),this._vShader=null,e.decrement(p.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,e.decrement(p.Program,this))}ref(){++this._refCount}_getUniformLocation(t){const e=this._nameToUniformLocation.get(t);if(e!==void 0)return e;if(this.glName){const r=this._context.gl.getUniformLocation(this.glName,t);return this._nameToUniformLocation.set(t,r),r&&this._context.instanceCounter.increment(p.Uniform,r),r}return null}hasUniform(t){return this._getUniformLocation(t)!=null}setUniform1i(t,e){const r=this._nameToUniform1.get(t);r!==void 0&&e===r||(this._context.gl.uniform1i(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1iv(t,e){E(this._nameToUniform1v,t,e)&&this._context.gl.uniform1iv(this._getUniformLocation(t),e)}setUniform2iv(t,e){E(this._nameToUniform2,t,e)&&this._context.gl.uniform2iv(this._getUniformLocation(t),e)}setUniform3iv(t,e){E(this._nameToUniform3,t,e)&&this._context.gl.uniform3iv(this._getUniformLocation(t),e)}setUniform4iv(t,e){E(this._nameToUniform4,t,e)&&this._context.gl.uniform4iv(this._getUniformLocation(t),e)}setUniform1f(t,e){const r=this._nameToUniform1.get(t);r!==void 0&&e===r||(this._context.gl.uniform1f(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1fv(t,e){E(this._nameToUniform1v,t,e)&&this._context.gl.uniform1fv(this._getUniformLocation(t),e)}setUniform2f(t,e,r){const n=this._nameToUniform2.get(t);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(t),e,r),this._nameToUniform2.set(t,[e,r])):e===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(t),e,r),n[0]=e,n[1]=r)}setUniform2fv(t,e){E(this._nameToUniform2,t,e)&&this._context.gl.uniform2fv(this._getUniformLocation(t),e)}setUniform3f(t,e,r,n){const o=this._nameToUniform3.get(t);o===void 0?(this._context.gl.uniform3f(this._getUniformLocation(t),e,r,n),this._nameToUniform3.set(t,[e,r,n])):e===o[0]&&r===o[1]&&n===o[2]||(this._context.gl.uniform3f(this._getUniformLocation(t),e,r,n),o[0]=e,o[1]=r,o[2]=n)}setUniform3fv(t,e){const r=this._getUniformLocation(t);r!=null&&E(this._nameToUniform3,t,e)&&this._context.gl.uniform3fv(r,e)}setUniform4f(t,e,r,n,o){const a=this._nameToUniform4.get(t);a===void 0?(this._context.gl.uniform4f(this._getUniformLocation(t),e,r,n,o),this._nameToUniform4.set(t,[e,r,n,o])):a!==void 0&&e===a[0]&&r===a[1]&&n===a[2]&&o===a[3]||(this._context.gl.uniform4f(this._getUniformLocation(t),e,r,n,o),a[0]=e,a[1]=r,a[2]=n,a[3]=o)}setUniform4fv(t,e){const r=this._getUniformLocation(t);r!=null&&E(this._nameToUniform4,t,e)&&this._context.gl.uniform4fv(r,e)}setUniformMatrix3fv(t,e,r=!1){const n=this._getUniformLocation(t);n!=null&&E(this._nameToUniformMatrix3,t,e)&&this._context.gl.uniformMatrix3fv(n,r,e)}setUniformMatrix4fv(t,e,r=!1){const n=this._getUniformLocation(t);n!=null&&E(this._nameToUniformMatrix4,t,e)&&this._context.gl.uniformMatrix4fv(n,r,e)}stop(){}}function Z(i,t,e){const r=i.gl,n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),O()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(t===T.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(zt(e))),n}function zt(i){let t=2;return i.replaceAll(` +`,()=>` +`+Vt(t++)+":")}function Vt(i){return i>=1e3?i.toString():(" "+i).slice(-3)}function E(i,t,e){const r=i.get(t);if(!r)return i.set(t,Array.from(e)),!0;const n=e.length;if(r.length!==n)return i.set(t,Array.from(e)),!0;for(let o=0;oJ.getLogger("esri.views.webgl.FramebufferObject");let bt=class F{constructor(t,e,r=null){this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.FramebufferObject,this);const n=w(e)?e:new M(this._context,e);if(this._colorAttachments.set(x.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(x.COLOR_ATTACHMENT0),r!=null)if(At(r))this._depthStencilTexture=w(r)?r:new M(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const o=St(r)?r:new xt(this._context,r);this._depthStencilBuffer=o,this._validateRenderBufferDescriptor(o.descriptor)}}dispose(){if(this._colorAttachments.size===0&&!this._glName)return;const t=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((e,r)=>this.detachColorTexture(r)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(p.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,r])=>t+r.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&w(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=x.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const r=t.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=x.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(e){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(t),e}}setColorTextureTarget(t,e=x.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);r&&this._framebufferTexture2D(r.glName,e,t)}attachDepthStencil(t){if(t)switch(t.type){case y.Texture:return this._attachDepthStencilTexture(t);case y.RenderBuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(t==null)return;const e=t.descriptor;e.pixelFormat!==I.DEPTH_STENCIL&&e.pixelFormat!==I.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==_t.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,X)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,X),this._context.bindFramebuffer(e)}return this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(t==null)return;const e=t.descriptor;if(this._validateRenderBufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(e);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,null),this._context.bindFramebuffer(e)}return this._depthStencilBuffer=null,t}copyToTexture(t,e,r,n,o,a,h){(t<0||e<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const s=h.descriptor;h.descriptor.target!==b.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(s?.width==null||s?.height==null||t+r>this.width||e+n>this.height||o+r>s.width||a+n>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,l=c.bindTexture(h,M.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(b.TEXTURE_2D,0,o,a,t,e,r,n),c.bindTexture(l,M.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,r,n,o,a,h){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,r,n,o,a,h)}async readPixelsAsync(t,e,r,n,o,a,h){const{gl:s}=this._context,c=ut.createPixelPack(this._context,gt.STREAM_READ,h.byteLength);this._context.bindBuffer(c);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),s.readPixels(t,e,r,n,o,a,0),this._context.unbindBuffer(pt.PIXEL_PACK_BUFFER),this._context.bindFramebuffer(l),await c.getSubDataAsync(h),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const r={width:t,height:e};R(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(n=>n.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(R(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=C.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const r=e.createFramebuffer();if(e.bindFramebuffer(t,r),this._colorAttachments.forEach((n,o)=>this._framebufferTexture2D(n.glName,o,z(n),t)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,n,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,z(this._depthStencilTexture),t);dt()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=x.COLOR_ATTACHMENT0,r=b.TEXTURE_2D,n=C.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(n,e,r,t,o)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(C.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=j(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=j(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==b.TEXTURE_2D&&t.target!==b.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),R(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderBufferDescriptor(t){R(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case A.DEPTH_COMPONENT16:case A.DEPTH_COMPONENT24:case A.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case A.DEPTH24_STENCIL8:case A.DEPTH32F_STENCIL8:case A.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case A.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(t){if(F._MAX_COLOR_ATTACHMENTS===-1){const{gl:r}=this._context;F._MAX_COLOR_ATTACHMENTS=r.getParameter(r.MAX_COLOR_ATTACHMENTS)}const e=t-x.COLOR_ATTACHMENT0;e+1>F._MAX_COLOR_ATTACHMENTS&&J.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${F._MAX_COLOR_ATTACHMENTS} color attachments`)}};function w(i){return i!=null&&"type"in i&&i.type===y.Texture}function St(i){return i!=null&&"type"in i&&i.type===y.RenderBuffer}function At(i){return w(i)||i!=null&&"pixelFormat"in i}function R(i,t){const e=Math.max(i.width,i.height);if(e>t){Et().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${t}`);const r=t/e;return i.width=Math.round(i.width*r),i.height=Math.round(i.height*r),!1}return!0}function z(i){return i.descriptor.target===b.TEXTURE_CUBE_MAP?b.TEXTURE_CUBE_MAP_POSITIVE_X:b.TEXTURE_2D}bt._MAX_COLOR_ATTACHMENTS=-1;const Dt=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"],Mt=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"],V=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"],Ct=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"];var g=999,G=9999,L=0,N=1,$=2,q=3,K=4,v=5,Ft=6,Ut=7,yt=8,Q=9,Rt=10,W=11,vt=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function wt(){var i,t,e,r=0,n=0,o=g,a=[],h=[],s=1,c=0,l=0,u=!1,_=!1,m="";return function(f){return h=[],f!==null?et(f.replace?f.replace(/\r\n/g,` -`):f):rt()};function d(f){f.length&&h.push({type:vt[o],data:f,position:l,line:s,column:c})}function et(f){var S;for(r=0,e=(m+=f).length;i=m[r],r0)continue;D=f.slice(0,1).join("")}return d(D),l+=D.length,(a=a.slice(D.length)).length}}function ht(){return/[^a-fA-F0-9]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function lt(){return i==="."||/[eE]/.test(i)?(a.push(i),o=v,t=i,r+1):i==="x"&&a.length===1&&a[0]==="0"?(o=W,a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ct(){return i==="f"&&(a.push(i),t=i,r+=1),/[eE]/.test(i)||i==="-"&&/[eE]/.test(t)?(a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ft(){if(/[^\d\w_]/.test(i)){var f=a.join("");return o=Mt.indexOf(f)>-1?yt:Ct.indexOf(f)>-1?Ut:Ft,d(a.join("")),o=g,r}return a.push(i),t=i,r+1}}function Pt(i){var t=wt(),e=[];return e=(e=e.concat(t(i))).concat(t(null))}function Lt(i){return Pt(i)}function Nt(i){return i.map(t=>t.type!=="eof"?t.data:"").join("")}const B=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function Bt(i,t="100",e="300 es"){const r=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of i)if(n.type==="preprocessor"){const o=r.exec(n.data);if(o){const a=o[1].replaceAll(/\s{2,}/g," ");if(a===e)return a;if(a===t)return n.data="#version "+e,t;throw new Error("unknown glsl version: "+a)}}return i.splice(0,0,{type:"preprocessor",data:"#version "+e},{type:"whitespace",data:` -`}),null}function Ot(i,t){for(let e=t-1;e>=0;e--){const r=i[e];if(r.type!=="whitespace"&&r.type!=="block-comment"){if(r.type!=="keyword")break;if(r.data==="attribute"||r.data==="in")return!0}}return!1}function U(i,t,e,r){r=r||e;for(const n of i)if(n.type==="ident"&&n.data===e)return r in t?t[r]++:t[r]=0,U(i,t,r+"_"+t[r],r);return e}function tt(i,t,e="afterVersion"){function r(s,c){for(let l=c;ls=0;--h){const s=e[h];if(s.type==="preprocessor"){const c=s.data.match(/#extension\s+(.*):/);if(c?.[1]&&B.has(c[1].trim())){const _=e[h+1];e.splice(h,_&&_.type==="whitespace"?2:1)}const l=s.data.match(/#ifdef\s+(.*)/);l?.[1]&&B.has(l[1].trim())&&(s.data="#if 1");const u=s.data.match(/#ifndef\s+(.*)/);u?.[1]&&B.has(u[1].trim())&&(s.data="#if 0")}}return It(i,Nt(e))}function It(i,t){return t}const Xt=4294967295;class Wt{constructor(t,e,r,n,o=new Map,a=[]){this._context=t,this._locations=n,this._uniformBlockBindings=o,this._transformFeedbackVaryings=a,this._refCount=1,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,t||console.error("RenderingContext isn't initialized!"),e.length===0&&console.error("Shaders source should not be empty!"),e=Y(e,T.VERTEX_SHADER),r=Y(r,T.FRAGMENT_SHADER),this._vShader=Z(this._context,T.VERTEX_SHADER,e),this._fShader=Z(this._context,T.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(p.Shader,this),O()&&(this.vertexShader=e,this.fragmentShader=r),this.usedMemory=e.length+r.length;const h=this._context.gl,s=h.createProgram();h.attachShader(s,this._vShader),h.attachShader(s,this._fShader),this._locations.forEach((c,l)=>h.bindAttribLocation(s,c,l)),this._transformFeedbackVaryings?.length&&h.transformFeedbackVaryings(s,this._transformFeedbackVaryings,h.SEPARATE_ATTRIBS),h.linkProgram(s),O()&&!h.getProgramParameter(s,h.LINK_STATUS)&&console.error(`Could not link shader -validated: ${h.getProgramParameter(s,h.VALIDATE_STATUS)}, gl error ${h.getError()}, vertex: ${h.getShaderParameter(this._vShader,h.COMPILE_STATUS)}, fragment: ${h.getShaderParameter(this._fShader,h.COMPILE_STATUS)}, info log: ${h.getProgramInfoLog(s)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(const[c,l]of this._uniformBlockBindings){const u=h.getUniformBlockIndex(s,c);u0)return;const t=this._context.gl,e=this._context.instanceCounter;this._nameToUniformLocation.forEach(r=>r&&e.decrement(p.Uniform,r)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(e.decrement(p.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),t.deleteShader(this._vShader),this._vShader=null,e.decrement(p.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,e.decrement(p.Program,this))}ref(){++this._refCount}_getUniformLocation(t){const e=this._nameToUniformLocation.get(t);if(e!==void 0)return e;if(this.glName){const r=this._context.gl.getUniformLocation(this.glName,t);return this._nameToUniformLocation.set(t,r),r&&this._context.instanceCounter.increment(p.Uniform,r),r}return null}hasUniform(t){return this._getUniformLocation(t)!=null}setUniform1i(t,e){const r=this._nameToUniform1.get(t);r!==void 0&&e===r||(this._context.gl.uniform1i(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1iv(t,e){E(this._nameToUniform1v,t,e)&&this._context.gl.uniform1iv(this._getUniformLocation(t),e)}setUniform2iv(t,e){E(this._nameToUniform2,t,e)&&this._context.gl.uniform2iv(this._getUniformLocation(t),e)}setUniform3iv(t,e){E(this._nameToUniform3,t,e)&&this._context.gl.uniform3iv(this._getUniformLocation(t),e)}setUniform4iv(t,e){E(this._nameToUniform4,t,e)&&this._context.gl.uniform4iv(this._getUniformLocation(t),e)}setUniform1f(t,e){const r=this._nameToUniform1.get(t);r!==void 0&&e===r||(this._context.gl.uniform1f(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1fv(t,e){E(this._nameToUniform1v,t,e)&&this._context.gl.uniform1fv(this._getUniformLocation(t),e)}setUniform2f(t,e,r){const n=this._nameToUniform2.get(t);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(t),e,r),this._nameToUniform2.set(t,[e,r])):e===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(t),e,r),n[0]=e,n[1]=r)}setUniform2fv(t,e){E(this._nameToUniform2,t,e)&&this._context.gl.uniform2fv(this._getUniformLocation(t),e)}setUniform3f(t,e,r,n){const o=this._nameToUniform3.get(t);o===void 0?(this._context.gl.uniform3f(this._getUniformLocation(t),e,r,n),this._nameToUniform3.set(t,[e,r,n])):e===o[0]&&r===o[1]&&n===o[2]||(this._context.gl.uniform3f(this._getUniformLocation(t),e,r,n),o[0]=e,o[1]=r,o[2]=n)}setUniform3fv(t,e){const r=this._getUniformLocation(t);r!=null&&E(this._nameToUniform3,t,e)&&this._context.gl.uniform3fv(r,e)}setUniform4f(t,e,r,n,o){const a=this._nameToUniform4.get(t);a===void 0?(this._context.gl.uniform4f(this._getUniformLocation(t),e,r,n,o),this._nameToUniform4.set(t,[e,r,n,o])):a!==void 0&&e===a[0]&&r===a[1]&&n===a[2]&&o===a[3]||(this._context.gl.uniform4f(this._getUniformLocation(t),e,r,n,o),a[0]=e,a[1]=r,a[2]=n,a[3]=o)}setUniform4fv(t,e){const r=this._getUniformLocation(t);r!=null&&E(this._nameToUniform4,t,e)&&this._context.gl.uniform4fv(r,e)}setUniformMatrix3fv(t,e,r=!1){const n=this._getUniformLocation(t);n!=null&&E(this._nameToUniformMatrix3,t,e)&&this._context.gl.uniformMatrix3fv(n,r,e)}setUniformMatrix4fv(t,e,r=!1){const n=this._getUniformLocation(t);n!=null&&E(this._nameToUniformMatrix4,t,e)&&this._context.gl.uniformMatrix4fv(n,r,e)}stop(){}}function Z(i,t,e){const r=i.gl,n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),O()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(t===T.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(zt(e))),n}function zt(i){let t=2;return i.replaceAll(` -`,()=>` -`+Vt(t++)+":")}function Vt(i){return i>=1e3?i.toString():(" "+i).slice(-3)}function E(i,t,e){const r=i.get(t);if(!r)return i.set(t,Array.from(e)),!0;const n=e.length;if(r.length!==n)return i.set(t,Array.from(e)),!0;for(let o=0;o[^\S\n]?/gm;let s=a.exec(t);const i=[];for(;s!=null;)i.push({path:s[1],start:s.index,length:s[0].length}),s=a.exec(t);let l=0,n="";return i.forEach(h=>{n+=t.slice(l,h.start),n+=r.has(h.path)?"":this._resolve(h.path,r),l=h.start+h.length}),n+=t.slice(l),r.set(e,n),n}_read(e){return this._readFile(e)}};function u(e,r,t=""){return new o(e,t+r.shaders.vertexShader,t+r.shaders.fragmentShader,r.attributes)}export{d as c,u as d}; diff --git a/main/assets/ProgramTemplate-DQOm6Omy-XULB1YWq.js b/main/assets/ProgramTemplate-DQOm6Omy-XULB1YWq.js new file mode 100644 index 000000000..ad0ec2f7c --- /dev/null +++ b/main/assets/ProgramTemplate-DQOm6Omy-XULB1YWq.js @@ -0,0 +1 @@ +import{V as o}from"./Program-DLVwTiPA-CHQtoRqS.js";let d=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,r=new Map){if(r.has(e))return r.get(e);const t=this._read(e);if(!t)throw new Error(`cannot find shader file ${e}`);const a=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=a.exec(t);const i=[];for(;s!=null;)i.push({path:s[1],start:s.index,length:s[0].length}),s=a.exec(t);let l=0,n="";return i.forEach(h=>{n+=t.slice(l,h.start),n+=r.has(h.path)?"":this._resolve(h.path,r),l=h.start+h.length}),n+=t.slice(l),r.set(e,n),n}_read(e){return this._readFile(e)}};function u(e,r,t=""){return new o(e,t+r.shaders.vertexShader,t+r.shaders.fragmentShader,r.attributes)}export{d as c,u as d}; diff --git a/main/assets/Query-BrwMGK8U-DV_czrJX.js b/main/assets/Query-BrwMGK8U-DV_czrJX.js new file mode 100644 index 000000000..bdcf4e55c --- /dev/null +++ b/main/assets/Query-BrwMGK8U-DV_czrJX.js @@ -0,0 +1 @@ +import{v as e,bz as l,S as t,bB as G,i as p,J as P,bW as z,d2 as K,a0 as L,ad as C,bG as H,aa as Q,e as u,aK as x,n as X,ac as g,af as J,g as $,w as W,d3 as A,d4 as Z,P as T,aO as Y}from"./main-C7yV2j71.js";import{y as ee}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{k as te}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./fieldType-CD2CL2hr-B1iISniv.js";var O;let b=O=class extends u{constructor(r){super(r),this.type="map-layer"}clone(){const{mapLayerId:r,gdbVersion:i}=this;return new O({mapLayerId:r,gdbVersion:i})}};e([l({mapLayer:"map-layer"})],b.prototype,"type",void 0),e([t({type:G,json:{write:!0}})],b.prototype,"mapLayerId",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),b=O=e([p("esri.layers.support.source.MapLayerSource")],b);var V;let d=V=class extends u{constructor(r){super(r),this.type="query-table"}clone(){const{workspaceId:r,query:i,oidFields:s,spatialReference:h,geometryType:c}=this,m={workspaceId:r,query:i,oidFields:s,spatialReference:h?.clone()??void 0,geometryType:c};return new V(m)}};e([l({queryTable:"query-table"})],d.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"query",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"oidFields",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"spatialReference",void 0),e([l(z)],d.prototype,"geometryType",void 0),d=V=e([p("esri.layers.support.source.QueryTableDataSource")],d);var D;let f=D=class extends u{constructor(r){super(r),this.type="raster"}clone(){const{workspaceId:r,dataSourceName:i}=this;return new D({workspaceId:r,dataSourceName:i})}};e([l({raster:"raster"})],f.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"dataSourceName",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"workspaceId",void 0),f=D=e([p("esri.layers.support.source.RasterDataSource")],f);var M;let v=M=class extends u{constructor(r){super(r),this.type="table"}clone(){const{workspaceId:r,gdbVersion:i,dataSourceName:s}=this;return new M({workspaceId:r,gdbVersion:i,dataSourceName:s})}};e([l({table:"table"})],v.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"gdbVersion",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"dataSourceName",void 0),v=M=e([p("esri.layers.support.source.TableDataSource")],v);var I,_;const re=K()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let a=I=class extends u{constructor(r){super(r),this.type="join-table"}readLeftTableSource(r,i,s){return k()(r,i,s)}castLeftTableSource(r){return A(N(),r)}readRightTableSource(r,i,s){return k()(r,i,s)}castRightTableSource(r){return A(N(),r)}clone(){const{leftTableKey:r,rightTableKey:i,leftTableSource:s,rightTableSource:h,joinType:c}=this,m={leftTableKey:r,rightTableKey:i,leftTableSource:s?.clone()??void 0,rightTableSource:h?.clone()??void 0,joinType:c};return new I(m)}};e([l({joinTable:"join-table"})],a.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],a.prototype,"leftTableSource",void 0),e([L("leftTableSource")],a.prototype,"readLeftTableSource",null),e([C("leftTableSource")],a.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],a.prototype,"rightTableSource",void 0),e([L("rightTableSource")],a.prototype,"readRightTableSource",null),e([C("rightTableSource")],a.prototype,"castRightTableSource",null),e([l(re)],a.prototype,"joinType",void 0),a=I=e([p("esri.layers.support.source.JoinTableDataSource")],a);let R=null;function k(){return R||(R=Z({types:N()})),R}let F=null;function N(){return F||(F={key:"type",base:null,typeMap:{"data-layer":y,"map-layer":b}}),F}const oe={key:"type",base:null,typeMap:{"join-table":a,"query-table":d,raster:f,table:v}};let y=_=class extends u{constructor(r){super(r),this.type="data-layer"}clone(){const{fields:r,dataSource:i}=this;return new _({fields:r,dataSource:i})}};e([l({dataLayer:"data-layer"})],y.prototype,"type",void 0),e([t({type:[ee],json:{write:!0}})],y.prototype,"fields",void 0),e([t({types:oe,json:{write:!0}})],y.prototype,"dataSource",void 0),y=_=e([p("esri.layers.support.source.DataLayerSource")],y),y.from=H(y);let w=class extends Q(u){constructor(r){super(r),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};e([t({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],w.prototype,"onFields",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"operator",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchTerm",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchType",void 0),w=e([p("esri.rest.support.FullTextSearch")],w);const ie=w;var E;const U=new x({upperLeft:"upper-left",lowerLeft:"lower-left"});let S=E=class extends u{constructor(r){super(r),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new E(T({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};e([t({type:X,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"extent",void 0),e([t({type:["view","edit"],json:{write:!0}})],S.prototype,"mode",void 0),e([t({type:String,json:{read:U.read,write:U.write}})],S.prototype,"originPosition",void 0),e([t({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"tolerance",void 0),S=E=e([p("esri.rest.support.QuantizationParameters")],S);const se=S,ae=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var B;const q=new x({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let n=B=class extends u{constructor(r){super(r),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(r,i){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(i.statisticParameters=T(r))}clone(){return new B({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:T(this.statisticParameters)})}};e([t({type:Number,json:{write:!0}})],n.prototype,"maxPointCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxRecordCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxVertexCount",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"onStatisticField",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"outStatisticFieldName",void 0),e([t({type:String,json:{read:{source:"statisticType",reader:q.read},write:{target:"statisticType",writer:q.write}}})],n.prototype,"statisticType",void 0),e([t({type:Object})],n.prototype,"statisticParameters",void 0),e([g("statisticParameters")],n.prototype,"writeStatisticParameters",null),n=B=e([p("esri.rest.support.StatisticDefinition")],n);const ne=n;var j;const le=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let o=j=class extends u{static from(r){return Y(j,r)}constructor(r){super(r),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(r){return typeof r=="number"||typeof r=="object"?r:null}writeHistoricMoment(r,i){i.historicMoment=r&&r.getTime()}writeParameterValues(r,i){if(r){const s={};for(const h in r){const c=r[h];Array.isArray(c)?s[h]=c.map(m=>m instanceof Date?m.getTime():m):c instanceof Date?s[h]=c.getTime():s[h]=c}i.parameterValues=s}}writeStart(r,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10,i.where="1=1"}writeWhere(r,i){i.where=r||"1=1"}clone(){return new j(T({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};o.MAX_MAX_RECORD_COUNT_FACTOR=5,e([t({json:{write:!0}})],o.prototype,"aggregateIds",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"compactGeometryEnabled",void 0),e([t({json:{write:!0}})],o.prototype,"datumTransformation",void 0),e([C("datumTransformation")],o.prototype,"castDatumTransformation",null),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"defaultSpatialReferenceEnabled",void 0),e([t({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],o.prototype,"distance",void 0),e([t({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"formatOf3DObjects",void 0),e([t({type:[ie],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],o.prototype,"fullText",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),e([t({types:J,json:{read:$,write:!0}})],o.prototype,"geometry",void 0),e([t({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"groupByFieldsForStatistics",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"having",void 0),e([t({type:Date})],o.prototype,"historicMoment",void 0),e([g("historicMoment")],o.prototype,"writeHistoricMoment",null),e([t({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),e([t({type:Number,cast:r=>r<1?1:r>o.MAX_MAX_RECORD_COUNT_FACTOR?o.MAX_MAX_RECORD_COUNT_FACTOR:r,json:{write:{overridePolicy:r=>({enabled:r>1})}}})],o.prototype,"maxRecordCountFactor",void 0),e([t({type:["xyFootprint"],json:{write:!0}})],o.prototype,"multipatchOption",void 0),e([t({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),e([t({json:{write:!0}})],o.prototype,"objectIds",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),e([t({type:P,json:{name:"outSR",write:!0}})],o.prototype,"outSpatialReference",void 0),e([t({type:[ne],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],o.prototype,"outStatistics",void 0),e([t({json:{write:!0}})],o.prototype,"parameterValues",void 0),e([g("parameterValues")],o.prototype,"writeParameterValues",null),e([t({type:W,json:{write:!0}})],o.prototype,"pixelSize",void 0),e([t({type:se,json:{write:!0}})],o.prototype,"quantizationParameters",void 0),e([t({type:[Object],json:{write:!0}})],o.prototype,"rangeValues",void 0),e([t({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],o.prototype,"relationParameter",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"resultType",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnCentroid",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnDistinctValues",void 0),e([t({type:Boolean,json:{default:!0,write:!0}})],o.prototype,"returnExceededLimitFeatures",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"returnGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnQueryGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],o.prototype,"returnZ",void 0),e([t({type:P,json:{write:!0}})],o.prototype,"sourceSpatialReference",void 0),e([l(ae,{ignoreUnknown:!1,name:"spatialRel"})],o.prototype,"spatialRelationship",void 0),e([t({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),e([g("start"),g("num")],o.prototype,"writeStart",null),e([t({type:String,json:{write:!0}})],o.prototype,"sqlFormat",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"text",void 0),e([t({type:te,json:{write:!0}})],o.prototype,"timeExtent",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"timeReferenceUnknownClient",void 0),e([l(le,{ignoreUnknown:!1}),t({json:{write:{overridePolicy(r){return{enabled:!!r&&this.distance!=null&&this.distance>0}}}}})],o.prototype,"units",void 0),e([t({type:String,json:{write:{overridePolicy(r){return{enabled:r!=null||this.start!=null&&this.start>0}}}}})],o.prototype,"where",void 0),e([g("where")],o.prototype,"writeWhere",null),o=j=e([p("esri.rest.support.Query")],o);const pe=o,he=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"}));export{y as K,he as Q,se as a,pe as b,b as c,ne as m,ae as s}; diff --git a/main/assets/Query-BrwMGK8U-sojFdYaD.js b/main/assets/Query-BrwMGK8U-sojFdYaD.js deleted file mode 100644 index e6513327f..000000000 --- a/main/assets/Query-BrwMGK8U-sojFdYaD.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,bz as l,S as t,bB as G,i as p,J as P,bW as z,d2 as K,a0 as L,ad as C,bG as H,aa as Q,e as u,aK as x,n as X,ac as g,af as J,g as $,w as W,d3 as A,d4 as Z,P as T,aO as Y}from"./main-BZaw9FpY.js";import{y as ee}from"./Field-C6hA1tZj-CbELM0zp.js";import{k as te}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";var O;let b=O=class extends u{constructor(r){super(r),this.type="map-layer"}clone(){const{mapLayerId:r,gdbVersion:i}=this;return new O({mapLayerId:r,gdbVersion:i})}};e([l({mapLayer:"map-layer"})],b.prototype,"type",void 0),e([t({type:G,json:{write:!0}})],b.prototype,"mapLayerId",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),b=O=e([p("esri.layers.support.source.MapLayerSource")],b);var V;let d=V=class extends u{constructor(r){super(r),this.type="query-table"}clone(){const{workspaceId:r,query:i,oidFields:s,spatialReference:h,geometryType:c}=this,m={workspaceId:r,query:i,oidFields:s,spatialReference:h?.clone()??void 0,geometryType:c};return new V(m)}};e([l({queryTable:"query-table"})],d.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"query",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"oidFields",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"spatialReference",void 0),e([l(z)],d.prototype,"geometryType",void 0),d=V=e([p("esri.layers.support.source.QueryTableDataSource")],d);var D;let f=D=class extends u{constructor(r){super(r),this.type="raster"}clone(){const{workspaceId:r,dataSourceName:i}=this;return new D({workspaceId:r,dataSourceName:i})}};e([l({raster:"raster"})],f.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"dataSourceName",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"workspaceId",void 0),f=D=e([p("esri.layers.support.source.RasterDataSource")],f);var M;let v=M=class extends u{constructor(r){super(r),this.type="table"}clone(){const{workspaceId:r,gdbVersion:i,dataSourceName:s}=this;return new M({workspaceId:r,gdbVersion:i,dataSourceName:s})}};e([l({table:"table"})],v.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"gdbVersion",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"dataSourceName",void 0),v=M=e([p("esri.layers.support.source.TableDataSource")],v);var I,_;const re=K()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let a=I=class extends u{constructor(r){super(r),this.type="join-table"}readLeftTableSource(r,i,s){return k()(r,i,s)}castLeftTableSource(r){return A(N(),r)}readRightTableSource(r,i,s){return k()(r,i,s)}castRightTableSource(r){return A(N(),r)}clone(){const{leftTableKey:r,rightTableKey:i,leftTableSource:s,rightTableSource:h,joinType:c}=this,m={leftTableKey:r,rightTableKey:i,leftTableSource:s?.clone()??void 0,rightTableSource:h?.clone()??void 0,joinType:c};return new I(m)}};e([l({joinTable:"join-table"})],a.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],a.prototype,"leftTableSource",void 0),e([L("leftTableSource")],a.prototype,"readLeftTableSource",null),e([C("leftTableSource")],a.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],a.prototype,"rightTableSource",void 0),e([L("rightTableSource")],a.prototype,"readRightTableSource",null),e([C("rightTableSource")],a.prototype,"castRightTableSource",null),e([l(re)],a.prototype,"joinType",void 0),a=I=e([p("esri.layers.support.source.JoinTableDataSource")],a);let R=null;function k(){return R||(R=Z({types:N()})),R}let F=null;function N(){return F||(F={key:"type",base:null,typeMap:{"data-layer":y,"map-layer":b}}),F}const oe={key:"type",base:null,typeMap:{"join-table":a,"query-table":d,raster:f,table:v}};let y=_=class extends u{constructor(r){super(r),this.type="data-layer"}clone(){const{fields:r,dataSource:i}=this;return new _({fields:r,dataSource:i})}};e([l({dataLayer:"data-layer"})],y.prototype,"type",void 0),e([t({type:[ee],json:{write:!0}})],y.prototype,"fields",void 0),e([t({types:oe,json:{write:!0}})],y.prototype,"dataSource",void 0),y=_=e([p("esri.layers.support.source.DataLayerSource")],y),y.from=H(y);let w=class extends Q(u){constructor(r){super(r),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};e([t({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],w.prototype,"onFields",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"operator",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchTerm",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchType",void 0),w=e([p("esri.rest.support.FullTextSearch")],w);const ie=w;var E;const U=new x({upperLeft:"upper-left",lowerLeft:"lower-left"});let S=E=class extends u{constructor(r){super(r),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new E(T({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};e([t({type:X,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"extent",void 0),e([t({type:["view","edit"],json:{write:!0}})],S.prototype,"mode",void 0),e([t({type:String,json:{read:U.read,write:U.write}})],S.prototype,"originPosition",void 0),e([t({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"tolerance",void 0),S=E=e([p("esri.rest.support.QuantizationParameters")],S);const se=S,ae=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var B;const q=new x({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let n=B=class extends u{constructor(r){super(r),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(r,i){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(i.statisticParameters=T(r))}clone(){return new B({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:T(this.statisticParameters)})}};e([t({type:Number,json:{write:!0}})],n.prototype,"maxPointCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxRecordCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxVertexCount",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"onStatisticField",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"outStatisticFieldName",void 0),e([t({type:String,json:{read:{source:"statisticType",reader:q.read},write:{target:"statisticType",writer:q.write}}})],n.prototype,"statisticType",void 0),e([t({type:Object})],n.prototype,"statisticParameters",void 0),e([g("statisticParameters")],n.prototype,"writeStatisticParameters",null),n=B=e([p("esri.rest.support.StatisticDefinition")],n);const ne=n;var j;const le=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let o=j=class extends u{static from(r){return Y(j,r)}constructor(r){super(r),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(r){return typeof r=="number"||typeof r=="object"?r:null}writeHistoricMoment(r,i){i.historicMoment=r&&r.getTime()}writeParameterValues(r,i){if(r){const s={};for(const h in r){const c=r[h];Array.isArray(c)?s[h]=c.map(m=>m instanceof Date?m.getTime():m):c instanceof Date?s[h]=c.getTime():s[h]=c}i.parameterValues=s}}writeStart(r,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10,i.where="1=1"}writeWhere(r,i){i.where=r||"1=1"}clone(){return new j(T({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};o.MAX_MAX_RECORD_COUNT_FACTOR=5,e([t({json:{write:!0}})],o.prototype,"aggregateIds",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"compactGeometryEnabled",void 0),e([t({json:{write:!0}})],o.prototype,"datumTransformation",void 0),e([C("datumTransformation")],o.prototype,"castDatumTransformation",null),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"defaultSpatialReferenceEnabled",void 0),e([t({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],o.prototype,"distance",void 0),e([t({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"formatOf3DObjects",void 0),e([t({type:[ie],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],o.prototype,"fullText",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),e([t({types:J,json:{read:$,write:!0}})],o.prototype,"geometry",void 0),e([t({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"groupByFieldsForStatistics",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"having",void 0),e([t({type:Date})],o.prototype,"historicMoment",void 0),e([g("historicMoment")],o.prototype,"writeHistoricMoment",null),e([t({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),e([t({type:Number,cast:r=>r<1?1:r>o.MAX_MAX_RECORD_COUNT_FACTOR?o.MAX_MAX_RECORD_COUNT_FACTOR:r,json:{write:{overridePolicy:r=>({enabled:r>1})}}})],o.prototype,"maxRecordCountFactor",void 0),e([t({type:["xyFootprint"],json:{write:!0}})],o.prototype,"multipatchOption",void 0),e([t({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),e([t({json:{write:!0}})],o.prototype,"objectIds",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),e([t({type:P,json:{name:"outSR",write:!0}})],o.prototype,"outSpatialReference",void 0),e([t({type:[ne],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],o.prototype,"outStatistics",void 0),e([t({json:{write:!0}})],o.prototype,"parameterValues",void 0),e([g("parameterValues")],o.prototype,"writeParameterValues",null),e([t({type:W,json:{write:!0}})],o.prototype,"pixelSize",void 0),e([t({type:se,json:{write:!0}})],o.prototype,"quantizationParameters",void 0),e([t({type:[Object],json:{write:!0}})],o.prototype,"rangeValues",void 0),e([t({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],o.prototype,"relationParameter",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"resultType",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnCentroid",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnDistinctValues",void 0),e([t({type:Boolean,json:{default:!0,write:!0}})],o.prototype,"returnExceededLimitFeatures",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"returnGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnQueryGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],o.prototype,"returnZ",void 0),e([t({type:P,json:{write:!0}})],o.prototype,"sourceSpatialReference",void 0),e([l(ae,{ignoreUnknown:!1,name:"spatialRel"})],o.prototype,"spatialRelationship",void 0),e([t({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),e([g("start"),g("num")],o.prototype,"writeStart",null),e([t({type:String,json:{write:!0}})],o.prototype,"sqlFormat",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"text",void 0),e([t({type:te,json:{write:!0}})],o.prototype,"timeExtent",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"timeReferenceUnknownClient",void 0),e([l(le,{ignoreUnknown:!1}),t({json:{write:{overridePolicy(r){return{enabled:!!r&&this.distance!=null&&this.distance>0}}}}})],o.prototype,"units",void 0),e([t({type:String,json:{write:{overridePolicy(r){return{enabled:r!=null||this.start!=null&&this.start>0}}}}})],o.prototype,"where",void 0),e([g("where")],o.prototype,"writeWhere",null),o=j=e([p("esri.rest.support.Query")],o);const pe=o,he=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"}));export{y as K,he as Q,se as a,pe as b,b as c,ne as m,ae as s}; diff --git a/main/assets/QueryEngine-CH5uUhZK-D2fBx3cq.js b/main/assets/QueryEngine-CH5uUhZK-D2fBx3cq.js deleted file mode 100644 index 8322fc073..000000000 --- a/main/assets/QueryEngine-CH5uUhZK-D2fBx3cq.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{c$ as Ze,al as ce,aA as je,by as E,P as J,aC as V,g as he,o as A,$ as $e,gW as Be,gX as ke,gU as He,gY as Le,p as W,aY as U,gZ as Je,fr as Ue,cS as de,cN as Ye,g_ as Ke,bh as We,cT as fe,gM as ie,gN as ae,eN as X,c_ as be,_ as Xe,g$ as et,fq as me,h0 as tt,h1 as st,ex as Ee,h2 as it}from"./main-BZaw9FpY.js";import{Y as at}from"./projection-BA9M1R7d-DoNqITCd.js";import{B as pe}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{z as rt}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{b as ye}from"./LRUCache-C3erQTWv-CeYLuvL9.js";import{Z as nt}from"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import{i as ge}from"./fieldType-CD2CL2hr-BAgRuESI.js";import{T as ot,r as Z,g as O,G as lt,d as Ve,a as j,e as ee,S as ze}from"./timeSupport-jPViR5jn-DVbPitWZ.js";import{p as N,v as ut,f as re,h as D,D as xe,C as ct}from"./queryUtils-Brxu6254-DDAvXp_C.js";import{t as ht}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{z as _e}from"./quantizationUtils-bJy1cRwp-72T4gbed.js";import{C as dt}from"./utils-HtkT8Fn3-DRbEu-K5.js";import{l as Fe,N as we,s as ft,c as mt,m as pt,E as yt,h as gt,V as xt,k as _t,M as Ft,x as te,f as wt,D as St}from"./utils-tNxq3jkf-ni0gpzk6.js";import{o as It}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{p as Se}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";let Tt=class{constructor(n,e){this._cache=new ye(n),this._invalidCache=new ye(e)}get(n,e){const t=`${e.uid}:${n}`,s=this._cache.get(t);if(s)return s;if(this._invalidCache.get(t)!=null)return null;try{const i=nt.create(n,{fieldsIndex:e});return this._cache.put(t,i),i}catch(i){return this._invalidCache.put(t,i),null}}getError(n,e){const t=`${e.uid}:${n}`;return this._invalidCache.get(t)??null}};const Ce=new Tt(50,500),$="unsupported-query",Me=" as ",De=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),qe=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),Rt=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...De,...qe]);function ne(n,e,t={}){const s=q(e,n);if(!s){const a=Ce.getError(e,n);throw new A($,"invalid SQL expression",{expression:e,error:a})}const i=t.expressionName||"expression";if(t.validateStandardized&&!s.isStandardized)throw new A($,`${i} is not standard`,{expression:e});if(t.validateAggregate&&!s.isAggregate)throw new A($,`${i} does not contain a valid aggregate function`,{expression:e});return s.fieldNames}function vt(n,e,t,s){if(!t)return!0;const i="where clause";return C(n,e,ne(n,t,{validateStandardized:!0,expressionName:i}),{expressionName:i,query:s}),!0}function At(n,e,t,s,i){if(!t)return!0;const a="having clause",r=ne(n,t,{validateAggregate:!0,expressionName:a});if(C(n,e,r,{expressionName:a,query:i}),!q(t,n)?.getExpressions().every(o=>{const{aggregateType:l,field:u}=o,c=n.get(u)?.name;return s.some(h=>{const{onStatisticField:d,statisticType:m}=h;return n.get(d)?.name===c&&m.toLowerCase().trim()===l})}))throw new A($,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function q(n,e){return n?Ce.get(n,e):null}function Qe(n){return/\((.*?)\)/.test(n)?n:n.split(Me)[0]}function bt(n){return n.split(Me)[1]}function C(n,e,t,s={}){const i=new Map;if(Et(i,n,e,s.allowedFieldTypes??Rt,t),i.size){const a=s.expressionName??"expression";throw new A($,`${a} contains invalid or missing fields`,{errors:Array.from(i.values()),query:s.query})}}function Et(n,e,t,s,i){const a=i.includes("*")?[...t,...i.filter(r=>r!=="*")]:i;for(const r of a)if(e.get(r))Ie(n,e,t,s,r);else try{const o=ne(e,Qe(r),{validateStandardized:!0});for(const l of o)Ie(n,e,t,s,l)}catch(o){n.set(r,{type:"expression-error",expression:r,error:o})}}function Ie(n,e,t,s,i){const a=e.get(i);a?t.has(a.name)?s!=="all"&&s?.has(a.type)===!1&&n.set(i,{type:"invalid-type",fieldName:a.name,fieldType:ge.fromJSON(a.type),allowedFieldTypes:Array.from(s,r=>ge.fromJSON(r))}):n.set(i,{type:"missing-field",fieldName:a.name}):n.set(i,{type:"invalid-field",fieldName:i})}const Vt=5;let zt=class{constructor(){this._storage=new Map,this._purgeInterval=Vt,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const n=1e3*this._purgeInterval,e=performance.now()-n;for(const[t,s]of this._storage){if(!(s.time0&&(this._timer=setTimeout(this._sweep,n)));this._storage.delete(t)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}get size(){return this._storage?.size??0}put(n,e){this._storage?.set(n,new Mt(e)),this._scheduleSweep()}get(n){if(!this._storage)return;const e=this._storage?.get(n);return e?(this._storage?.delete(n),e.time=performance.now(),this._storage?.set(n,e),e.items):void 0}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}},Ct=0;class Mt{constructor(e){this.items=e,this.time=performance.now(),this.id=Ct++}}let L=class{constructor(n,e,t){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=n.returnDistinctValues??!1,this.fieldsIndex=t,this.featureAdapter=e;const s=n.outFields;if(s&&!s.includes("*")){this.outFields=s;let i=0;for(const a of s){const r=Qe(a),o=this.fieldsIndex.get(r),l=o?null:q(r,t),u=o?o.name:bt(a)||"FIELD_EXP_"+i++;this._fieldDataCache.set(a,{alias:u,clause:l})}}}countDistinctValues(n){return this.returnDistinctValues?(n.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):n.length}getAttributes(n){const e=this._processAttributesForOutFields(n);return this._processAttributesForDistinctValues(e)}getFieldValue(n,e,t){const s=t?t.name:e;let i=null;return this._fieldDataCache.has(s)?i=this._fieldDataCache.get(s)?.clause:t||(i=q(e,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:i})),t?this.featureAdapter.getAttribute(n,s):i?.calculateValue(n,this.featureAdapter)}getDataValues(n,e,t=!0){const s=e.normalizationType,i=e.normalizationTotal,a=this.fieldsIndex.get(e.field),r=ie(a)||ae(a),o=be(a);return n.map(l=>{let u=e.field&&this.getFieldValue(l,e.field,this.fieldsIndex.get(e.field));if(e.field2?(u=`${te(u)}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field2,this.fieldsIndex.get(e.field2)))}`,e.field3&&(u=`${u}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field3,this.fieldsIndex.get(e.field3)))}`)):typeof u=="string"&&t&&(r?u=u?new Date(u).getTime():null:o&&(u=u?dt(u):null)),s&&Number.isFinite(u)){const c=s==="field"&&e.normalizationField?this.getFieldValue(l,e.normalizationField,this.fieldsIndex.get(e.normalizationField)):null;u=wt(u,s,c,i)}return u})}async getExpressionValues(n,e,t,s,i){const{arcadeUtils:a}=await Ee(),r=a.hasGeometryOperations(e);r&&await a.enableGeometryOperations();const o=a.createFunction(e),l=a.getViewInfo(t),u={fields:this.fieldsIndex.fields};return n.map(c=>{const h={attributes:this.featureAdapter.getAttributes(c),layer:u,geometry:r?{...j(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(c)),spatialReference:t?.spatialReference}:null},d=a.createExecContext(h,l,i);return a.executeFunction(o,d)})}validateItem(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testFeature(n,this.featureAdapter)??!1}validateItems(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testSet(n,this.featureAdapter)??!1}_processAttributesForOutFields(n){const e=this.outFields;if(!e?.length)return this.featureAdapter.getAttributes(n);const t={};for(const s of e){const{alias:i,clause:a}=this._fieldDataCache.get(s);t[i]=a?a.calculateValue(n,this.featureAdapter):this.featureAdapter.getAttribute(n,i)}return t}_processAttributesForDistinctValues(n){if(n==null||!this.returnDistinctValues)return n;const e=this.outFields,t=[];if(e)for(const a of e){const{alias:r}=this._fieldDataCache.get(a);t.push(n[r])}else for(const a in n)t.push(n[a]);const s=`${(e||["*"]).join(",")}=${t.join(",")}`;let i=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++i),i>1?null:n}};function Te(n,e,t){return{objectId:n,target:e,distance:t,type:"vertex"}}function Dt(n,e,t,s,i,a=!1){return{objectId:n,target:e,distance:t,type:"edge",start:s,end:i,draped:a}}class v{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new L(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query;if(!t?.length)return 1;const a=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:u}=l,c=u!=="exceedslimit"?l.onStatisticField:void 0;if(!r.has(c)){const d=[];for(const m of t){const y=this._getAttributeValues(e,m,a);d.push(y)}r.set(c,this._calculateUniqueValues(d,e.returnDistinctValues))}const h=r.get(c);for(const d in h){const{data:m,items:y}=h[d],f=m.join(",");s&&!e.validateItems(y,s)||o.add(f)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;U(this.query.outSR)&&!V(t.spatialReference,this.query.outSR)?e.queryGeometry=Z({spatialReference:this.query.outSR,...D(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=Z({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=Re(this.hasZ,this.hasM),{point:a,mode:r}=e,o=typeof e.distance=="number"?e.distance:e.distance.x,l=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(r,this.spatialReference,t),d=new ve(null,0),m=new ve(null,0),y={x:0,y:0,z:0};for(const f of this.items){const w=s.getGeometry(f);if(w==null)continue;const{coords:_,lengths:I}=w;if(d.coords=_,m.coords=_,e.returnEdge){let S=0;for(let g=0;gf.distance-w.distance),u}_getPointCreator(e,t,s){const i=s==null||V(t,s)?o=>o:o=>D(o,t,s),{hasZ:a}=this,r=0;return e==="3d"?a?({x:o,y:l,z:u})=>i({x:o,y:l,z:u}):({x:o,y:l})=>i({x:o,y:l,z:r}):({x:o,y:l})=>i({x:o,y:l})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,minValue:o,maxValue:l,scale:u,timeZone:c,outStatisticTypes:h}=e,d=this.fieldsIndex.get(t),m=fe(d)||ie(d)||ae(d),y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:u,timeZone:c}),f=St({normalizationType:a,normalizationField:i,minValue:o,maxValue:l}),w={value:.5,fieldType:d?.type},_=X(d)?Fe({values:y,supportsNullCount:f,percentileParams:w,outStatisticTypes:h}):we({values:y,minValue:o,maxValue:l,useSampleStdDev:!a,supportsNullCount:f,percentileParams:w,outStatisticTypes:h});return ft(_,h,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:r,timeZone:o}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:r,timeZone:o},!1),u=mt(l);return pt(u,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m}),f=yt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h});return gt(f,o)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m});return xt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const a=i.split(" "),r=a[0],o=this.fieldsIndex.get(r),l=!!a[1]&&a[1].toLowerCase()==="desc",u=_t(o?.type,l);e.sort((c,h)=>{const d=s(c,r,o),m=s(h,r,o);return u(d,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:m,returnM:y}=e,f=h!=null&&t.length>(d||0)+h,w=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(_=>this.fieldsIndex.get(_)));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:w,geometryType:s,hasM:i&&y,hasZ:a&&m,objectIdFieldName:r,spatialReference:Z(u||o),transform:c&&_e(c)||null}}_createFeatures(e,t){const s=new L(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:d,returnZ:m=!1,returnM:y=!1}=e,f=a&&m,w=i&&y;let _=[],I=0;const S=[...t];if(this._sortFeatures(S,r,(p,F,x)=>s.getFieldValue(p,F,x)),this.geometryType&&(l||u)){const p=_e(o)??void 0,F=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(l&&!u)for(const x of S){const T=this.featureAdapter.getGeometry(x),R={attributes:s.getAttributes(x),geometry:j(this.geometryType,this.hasZ,this.hasM,T,c,p,f,w)};F&&T&&!R.geometry&&(R.centroid=ee(this,this.featureAdapter.getCentroid(x,this),p)),_[I++]=R}else if(!l&&u)for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p)};else for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p),geometry:j(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(x),c,p,f,w)}}else for(const p of S){const F=s.getAttributes(p);F&&(_[I++]={attributes:F})}const g=h||0;if(d!=null){const p=g+d;_=_.slice(g,Math.min(_.length,p))}return _}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if(r.statisticType==="exceedslimit"){s=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,i=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,a=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>s;else if(this.items.length>i)t=!0;else{const r=Re(this.hasZ,this.hasM),o=this.featureAdapter;t=this.items.reduce((l,u)=>{const c=o.getGeometry(u);return l+(c!=null&&c.coords.length||0)},0)/r>a}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,a=new Map,r=new Map,o=new Map,l=new L(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:d,resultRecordCount:m}=e,y=c?.length,f=!!y,w=f?c[0]:null,_=f&&!this.fieldsIndex.get(w);for(const S of u??[]){const{outStatisticFieldName:g,statisticType:p}=S,F=S,x=p!=="exceedslimit"?S.onStatisticField:void 0,T=p==="percentile_disc"||p==="percentile_cont",R=p==="EnvelopeAggregate"||p==="CentroidAggregate"||p==="ConvexHullAggregate",M=f&&y===1&&(x===w||_)&&p==="count";if(f){if(!r.has(x)){const k=[];for(const K of c){const H=this._getAttributeValues(l,K,i);k.push(H)}r.set(x,this._calculateUniqueValues(k,!R&&l.returnDistinctValues))}const b=r.get(x);if(!b)continue;const Y=Object.keys(b);for(const k of Y){const{count:K,data:H,items:oe,itemPositions:Pe}=b[k],le=H.join(",");if(!h||l.validateItems(oe,h)){const Q=o.get(le)||{attributes:{}};if(R){Q.aggregateGeometries||(Q.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:G}=await this._getAggregateGeometry(F,oe);Q.aggregateGeometries[G]=z}else{let z=null;if(M)z=K;else{const G=this._getAttributeValues(l,x,i),ue=Pe.map(Oe=>G[Oe]);z=T&&"statisticParameters"in F?this._getPercentileValue(F,ue):this._getStatisticValue(F,ue,null,l.returnDistinctValues)}Q.attributes[g]=z}let Ge=0;c.forEach((z,G)=>Q.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++Ge]=H[G]),o.set(le,Q)}}}else if(R){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:b,outStatisticFieldName:Y}=await this._getAggregateGeometry(F,this.items);t.aggregateGeometries[Y]=b}else{const b=this._getAttributeValues(l,x,i);t.attributes[g]=T&&"statisticParameters"in F?this._getPercentileValue(F,b):this._getStatisticValue(F,b,a,l.returnDistinctValues)}const B=p!=="min"&&p!=="max"||!X(this.fieldsIndex.get(x))&&!this._isAnyDateField(x)?null:this.fieldsIndex.get(x)?.type;s.push({name:g,alias:g,type:B||"esriFieldTypeDouble"})}const I=f?Array.from(o.values()):[t];return this._sortFeatures(I,d,(S,g)=>S.attributes[g]),m&&(I.length=Math.min(m,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return fe(t)||ie(t)||ae(t)||be(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:i}=await Xe(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(f=>f.g),{statisticType:a,outStatisticFieldName:r}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map(f=>j(u,c,h,o.getGeometry(f))),m=s(l,d,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if(a==="EnvelopeAggregate"){const f=m?et(m):me(i(l,d));y.aggregateGeometries={...f,spatialReference:l},y.outStatisticFieldName=r||"extent"}else if(a==="CentroidAggregate"){const f=m?tt(m):st(me(i(l,d)));y.aggregateGeometries={x:f[0],y:f[1],spatialReference:l},y.outStatisticFieldName=r||"centroid"}else a==="ConvexHullAggregate"&&(y.aggregateGeometries=m,y.outStatisticFieldName=r||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:r}=e;let o=null;return o=s?.has(a)?s.get(a):X(this.fieldsIndex.get(a))||this._isAnyDateField(a)?Fe({values:t,returnDistinct:i}):we({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,o),o[r==="var"?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:r,orderBy:o}=i,l=this.fieldsIndex.get(s);return Ft(t,{value:r,orderBy:o,fieldType:l?.type,isDiscrete:a==="percentile_disc"})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),a=this.items.map(r=>e.getFieldValue(r,t,i));return s.set(t,a),a}_calculateUniqueValues(e,t){const s={},i=this.items,a=i.length;for(let r=0;rn)}function Ne(n,e,t){const{outFields:s,orderByFields:i,returnDistinctValues:a,outStatistics:r}=t,o=r?r.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(i&&i.length>0){const l=" asc",u=" desc",c=i.map(h=>{const d=h.toLowerCase();return d.includes(l)?d.split(l)[0]:d.includes(u)?d.split(u)[0]:h}).filter(h=>!o.includes(h));C(n,e,c,{expressionName:"orderByFields",query:t})}if(s&&s.length>0)C(n,e,s,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(a)throw new A(P,"outFields should be specified for returnDistinctValues",{query:t});vt(n,e,t.where,t)}const Qt=new Set([...De,...qe]);function Nt(n,e,t){const{outStatistics:s,groupByFieldsForStatistics:i,having:a}=t,r=i?.length,o=s?.length;if(a){if(!r||!o)throw new A(P,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});At(n,e,a,s,t)}if(o){if(!Ot(s))return;const l=s.map(u=>u.onStatisticField).filter(Boolean);C(n,e,l,{expressionName:"onStatisticFields",query:t}),r&&C(n,e,i,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of s){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:d}=u;if(!d)throw new A(P,"statisticParameters should be set for percentile type",{definition:u,query:t})}else n.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&C(n,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:Qt,query:t})}}}async function Pt(n,e,{fieldsIndex:t,geometryType:s,spatialReference:i,availableFields:a}){if((n.distance??0)<0||n.geometryPrecision!=null||n.multipatchOption||n.pixelSize||n.relationParam||n.text||n.outStatistics||n.groupByFieldsForStatistics||n.having||n.orderByFields)throw new A(P,"Unsupported query options",{query:n});return Ne(t,a,n),Promise.all([Gt(t,a,e,n),ze(n,s,i),re(i,n.outSR)]).then(()=>n)}async function Gt(n,e,t,s){let i=[];if(t.valueExpression){const{arcadeUtils:a}=await Ee();i=a.extractFieldNames(t.valueExpression)}if(t.field&&i.push(t.field),t.field2&&i.push(t.field2),t.field3&&i.push(t.field3),t.normalizationField&&i.push(t.normalizationField),!i.length&&!t.valueExpression)throw new A(P,"field or valueExpression is required",{params:t});C(n,e,i,{expressionName:"statistics",query:s})}function Ot(n){return n!=null&&n.every(e=>e.statisticType!=="exceedslimit")}const Zt="unsupported-query";class is{constructor(e){this._cache=new zt,this._changeHandle=null,this.capabilities={query:ht},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,this.fieldsIndex=Ze(e.fieldsIndex)?e.fieldsIndex:It.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>this.fieldsIndex.get(t)?.name).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=ce(this._frameTask),this.clearCache(),je(this._cache),this._changeHandle=ce(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=E(t);try{return await(await this._executeQuery(e,{},s)).createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=E(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(i){if(i!==N)throw i;return 0}}async executeQueryForExtent(e,t){const s=E(t),i=e.outSR;try{const a=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=a.size;return r?{count:r,extent:await this._getBounds(a.items,a.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(a){if(a===N)return{count:0,extent:null};throw a}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(s=>Array.from(s))}async executeQueryForIdSet(e,t){const s=E(t);try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),a=i.items,r=new Set;return await this._reschedule(()=>{for(const o of a)r.add(i.featureAdapter.getObjectId(o))},s),r}catch(i){if(i===N)return new Set;throw i}}async executeQueryForSnapping(e,t){const s=E(t),{point:i,distance:a,returnEdge:r,vertexMode:o}=e;if(!r&&o==="none")return{candidates:[]};let l=J(e.query);l=await this._schedule(()=>ut(l,this.definitionExpression,this.spatialReference),s),l=await this._reschedule(()=>Ae(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const u=!V(i.spatialReference,this.spatialReference);u&&await re(i.spatialReference,this.spatialReference);const c=typeof a=="number"?a:a.x,h=typeof a=="number"?a:a.y,d={xmin:i.x-c,xmax:i.x+c,ymin:i.y-h,ymax:i.y+h,spatialReference:i.spatialReference},m=u?D(d,this.spatialReference):d;if(!m)return{candidates:[]};const y=(await pe(he(i),null,{signal:s}))[0],f=(await pe(he(m),null,{signal:s}))[0];if(y==null||f==null)return{candidates:[]};const w=new v(await this._reschedule(()=>this._searchFeatures(se(f.toJSON())),s),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(w),s),await this._reschedule(()=>this._executeTimeQuery(w),s),await this._reschedule(()=>this._executeAttributesQuery(w),s),await this._reschedule(()=>this._executeGeometryQueryForSnapping(w,s),s);const _=y.toJSON(),I=u?D(_,this.spatialReference):_,S=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:a;return w.createSnappingResponse({...e,point:I,distance:S},i.spatialReference)}async executeQueryForLatestObservations(e,t){const s=E(t);if(!this.timeInfo?.trackIdField)throw new A(Zt,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},s);return await this._reschedule(()=>this._filterLatest(i),s),await i.createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=E(s),{field:a,field2:r,field3:o,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:a,field2:r,field3:o,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=E(e);this._timeExtentPromise||=ot(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return $e(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=Be(He(),ke);await this.featureStore.forEachBounds(e,o=>Le(i,o));const a={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:Z(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(a.zmin=i[2],a.zmax=i[5],a.hasZ=!0);const r=D(a,t,s);if(r.spatialReference=Z(s),r.xmax-r.xmin==0){const o=W(r.spatialReference);r.xmin-=o,r.xmax+=o}if(r.ymax-r.ymin==0){const o=W(r.spatialReference);r.ymin-=o,r.ymax+=o}if(this.hasZ&&r.zmin!=null&&r.zmax!=null&&r.zmax-r.zmin==0){const o=W(r.spatialReference);r.zmin-=o,r.zmax+=o}return r}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(Se)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(Se)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const s=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(i=>s.push(i))})().then(()=>s)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=J(e),e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Ae(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s),e={...e,...t};const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:s,returnGeometry:i,returnCentroid:a}=e,r=this.featureStore.featureSpatialReference,o=e.sceneFilter.geometry,l=r==null||V(r,o.spatialReference)?o:D(o,r);if(!l)return null;const u=i||a,c=U(s)&&!V(this.spatialReference,s)&&u?async f=>this._project(f,s):f=>f,h=this.featureAdapter,d=await this._reschedule(()=>this._searchFeatures(se(l)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!d.length)return null;const f=new Set;for(const I of d)f.add(h.getObjectId(I));const w=await this._reschedule(()=>this._getAllFeatures(),t),_=await this._reschedule(async()=>{const I=await O("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),S=p=>!f.has(h.getObjectId(p))||I(h.getGeometry(p)),g=await this._runSpatialFilter(w,S,t);return new v(g,e,this)},t);return c(_)}if(!d.length)return new v([],e,this);if(this._canExecuteSinglePass(l,e))return c(new v(d,e,this));const m=await O("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),y=await this._runSpatialFilter(d,f=>m(h.getGeometry(f)),t);return c(new v(y,e,this))}async _executeGeometryQuery(e,t,s){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:i,outSR:a,spatialRel:r,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!i||u==null||V(u,i.spatialReference)?i:D(i,u),h=o||l,d=U(a)&&!V(this.spatialReference,a),m=t==null?this._getCacheKey(e):null,y=m?this._cache.get(m):null;if(y!=null)return new v(y,e,this);const f=async g=>(d&&h&&await this._project(g,a),m&&this._cache.put(m,g.items),g);if(!c)return f(t??await this._getAllFeaturesQueryEngineResult(e));const w=this.featureAdapter;let _=await this._reschedule(()=>this._searchFeatures(se(i)),s);if(r==="esriSpatialRelDisjoint"){if(!_.length)return f(t??await this._getAllFeaturesQueryEngineResult(e));const g=new Set;for(const x of _)g.add(w.getObjectId(x));const p=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),s),F=await this._reschedule(async()=>{const x=await O(r,c,this.geometryType,this.hasZ,this.hasM),T=M=>!g.has(w.getObjectId(M))||x(w.getGeometry(M)),R=await this._runSpatialFilter(p,T,s);return new v(R,e,this)},s);return f(F)}if(t!=null){const g=new it;_=_.filter(p=>Je(t.items,p,t.items.length,g)>=0)}if(!_.length){const g=new v([],e,this);return m&&this._cache.put(m,g.items),g}if(this._canExecuteSinglePass(c,e))return f(new v(_,e,this));const I=await O(r,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(_,g=>I(w.getGeometry(g)),s);return f(new v(S,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:s}=e,{spatialRel:i}=s;if(!e?.items?.length||!s.geometry||!i)return;const a=await O(i,s.geometry,this.geometryType,this.hasZ,this.hasM),r=await this._runSpatialFilter(e.items,o=>a(o.geometry),t);e.items=r}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds?.length||this.aggregateAdapter==null)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(a=>t.add(a));const s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=lt(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=q(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(s=>t.testFeature(s,this.featureAdapter))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(this._frameTask==null)return e.filter(o=>t(o));let i=0;const a=new Array,r=async o=>{for(;ir(u),s)}};return this._reschedule(o=>r(o),s).then(()=>a)}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,a=i||s,r=new Map,o=this.featureAdapter.getAttribute;for(const l of e.items){const u=o(l,t),c=o(l,a),h=r.get(u);(!h||c>o(h,a))&&r.set(u,l)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:s,returnGeometry:i,returnCentroid:a,outSR:r,resultType:o,cacheHint:l}=e;if(o!=="tile"&&!l)return null;const u=i||a;return U(r)&&!V(this.spatialReference,r)&&u?JSON.stringify([t,s,r]):JSON.stringify([t,s])}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return Ve(e)&&(s==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(s==="esriSpatialRelIntersects"||s==="esriSpatialRelContains"))}async _project(e,t){if(!t||V(this.spatialReference,t))return e;const s=this.featureAdapter;let i;try{const r=await this._getFullExtent();i=at(this.spatialReference,t,r)}catch{}const a=await ct(e.items.map(r=>j(this.geometryType,this.hasZ,this.hasM,s.getGeometry(r))),this.spatialReference,t,i);return e.items=a.map((r,o)=>s.cloneWithGeometry(e.items[o],rt(r,this.hasZ,this.hasM))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(i=>this.featureStore.forEachInBounds(i,a=>t.add(a))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=J(e);try{e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Pt(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}catch(i){if(i!==N)throw i;return new v([],e,this)}}}function se(n){if(Ve(n)){if(Ue(n))return[de(Math.min(n.xmin,n.xmax),Math.min(n.ymin,n.ymax),Math.max(n.xmin,n.xmax),Math.max(n.ymin,n.ymax))];if(Ye(n))return n.rings.map(e=>de(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[Ke(We(),n)]}export{is as Z}; diff --git a/main/assets/QueryEngine-CH5uUhZK-DnnsKt6q.js b/main/assets/QueryEngine-CH5uUhZK-DnnsKt6q.js new file mode 100644 index 000000000..8f1312f5b --- /dev/null +++ b/main/assets/QueryEngine-CH5uUhZK-DnnsKt6q.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); +import{c$ as Ze,al as ce,aA as je,by as E,P as J,aC as V,g as he,o as A,$ as $e,gW as Be,gX as ke,gU as He,gY as Le,p as W,aY as U,gZ as Je,fr as Ue,cS as de,cN as Ye,g_ as Ke,bh as We,cT as fe,gM as ie,gN as ae,eN as X,c_ as be,_ as Xe,g$ as et,fq as me,h0 as tt,h1 as st,ex as Ee,h2 as it}from"./main-C7yV2j71.js";import{Y as at}from"./projection-BA9M1R7d-DXrPfsKU.js";import{B as pe}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{z as rt}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{b as ye}from"./LRUCache-C3erQTWv-DhyPlt5p.js";import{Z as nt}from"./WhereClause-DxwoyBMS-DCzFGfA-.js";import{i as ge}from"./fieldType-CD2CL2hr-B1iISniv.js";import{T as ot,r as Z,g as O,G as lt,d as Ve,a as j,e as ee,S as ze}from"./timeSupport-jPViR5jn-BnQYlj-C.js";import{p as N,v as ut,f as re,h as D,D as xe,C as ct}from"./queryUtils-Brxu6254-T3UhaATW.js";import{t as ht}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{z as _e}from"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import{C as dt}from"./utils-HtkT8Fn3-d1uN_zlY.js";import{l as Fe,N as we,s as ft,c as mt,m as pt,E as yt,h as gt,V as xt,k as _t,M as Ft,x as te,f as wt,D as St}from"./utils-tNxq3jkf-DW91Ot0z.js";import{o as It}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{p as Se}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";let Tt=class{constructor(n,e){this._cache=new ye(n),this._invalidCache=new ye(e)}get(n,e){const t=`${e.uid}:${n}`,s=this._cache.get(t);if(s)return s;if(this._invalidCache.get(t)!=null)return null;try{const i=nt.create(n,{fieldsIndex:e});return this._cache.put(t,i),i}catch(i){return this._invalidCache.put(t,i),null}}getError(n,e){const t=`${e.uid}:${n}`;return this._invalidCache.get(t)??null}};const Ce=new Tt(50,500),$="unsupported-query",Me=" as ",De=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),qe=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),Rt=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...De,...qe]);function ne(n,e,t={}){const s=q(e,n);if(!s){const a=Ce.getError(e,n);throw new A($,"invalid SQL expression",{expression:e,error:a})}const i=t.expressionName||"expression";if(t.validateStandardized&&!s.isStandardized)throw new A($,`${i} is not standard`,{expression:e});if(t.validateAggregate&&!s.isAggregate)throw new A($,`${i} does not contain a valid aggregate function`,{expression:e});return s.fieldNames}function vt(n,e,t,s){if(!t)return!0;const i="where clause";return C(n,e,ne(n,t,{validateStandardized:!0,expressionName:i}),{expressionName:i,query:s}),!0}function At(n,e,t,s,i){if(!t)return!0;const a="having clause",r=ne(n,t,{validateAggregate:!0,expressionName:a});if(C(n,e,r,{expressionName:a,query:i}),!q(t,n)?.getExpressions().every(o=>{const{aggregateType:l,field:u}=o,c=n.get(u)?.name;return s.some(h=>{const{onStatisticField:d,statisticType:m}=h;return n.get(d)?.name===c&&m.toLowerCase().trim()===l})}))throw new A($,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function q(n,e){return n?Ce.get(n,e):null}function Qe(n){return/\((.*?)\)/.test(n)?n:n.split(Me)[0]}function bt(n){return n.split(Me)[1]}function C(n,e,t,s={}){const i=new Map;if(Et(i,n,e,s.allowedFieldTypes??Rt,t),i.size){const a=s.expressionName??"expression";throw new A($,`${a} contains invalid or missing fields`,{errors:Array.from(i.values()),query:s.query})}}function Et(n,e,t,s,i){const a=i.includes("*")?[...t,...i.filter(r=>r!=="*")]:i;for(const r of a)if(e.get(r))Ie(n,e,t,s,r);else try{const o=ne(e,Qe(r),{validateStandardized:!0});for(const l of o)Ie(n,e,t,s,l)}catch(o){n.set(r,{type:"expression-error",expression:r,error:o})}}function Ie(n,e,t,s,i){const a=e.get(i);a?t.has(a.name)?s!=="all"&&s?.has(a.type)===!1&&n.set(i,{type:"invalid-type",fieldName:a.name,fieldType:ge.fromJSON(a.type),allowedFieldTypes:Array.from(s,r=>ge.fromJSON(r))}):n.set(i,{type:"missing-field",fieldName:a.name}):n.set(i,{type:"invalid-field",fieldName:i})}const Vt=5;let zt=class{constructor(){this._storage=new Map,this._purgeInterval=Vt,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const n=1e3*this._purgeInterval,e=performance.now()-n;for(const[t,s]of this._storage){if(!(s.time0&&(this._timer=setTimeout(this._sweep,n)));this._storage.delete(t)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}get size(){return this._storage?.size??0}put(n,e){this._storage?.set(n,new Mt(e)),this._scheduleSweep()}get(n){if(!this._storage)return;const e=this._storage?.get(n);return e?(this._storage?.delete(n),e.time=performance.now(),this._storage?.set(n,e),e.items):void 0}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}},Ct=0;class Mt{constructor(e){this.items=e,this.time=performance.now(),this.id=Ct++}}let L=class{constructor(n,e,t){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=n.returnDistinctValues??!1,this.fieldsIndex=t,this.featureAdapter=e;const s=n.outFields;if(s&&!s.includes("*")){this.outFields=s;let i=0;for(const a of s){const r=Qe(a),o=this.fieldsIndex.get(r),l=o?null:q(r,t),u=o?o.name:bt(a)||"FIELD_EXP_"+i++;this._fieldDataCache.set(a,{alias:u,clause:l})}}}countDistinctValues(n){return this.returnDistinctValues?(n.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):n.length}getAttributes(n){const e=this._processAttributesForOutFields(n);return this._processAttributesForDistinctValues(e)}getFieldValue(n,e,t){const s=t?t.name:e;let i=null;return this._fieldDataCache.has(s)?i=this._fieldDataCache.get(s)?.clause:t||(i=q(e,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:i})),t?this.featureAdapter.getAttribute(n,s):i?.calculateValue(n,this.featureAdapter)}getDataValues(n,e,t=!0){const s=e.normalizationType,i=e.normalizationTotal,a=this.fieldsIndex.get(e.field),r=ie(a)||ae(a),o=be(a);return n.map(l=>{let u=e.field&&this.getFieldValue(l,e.field,this.fieldsIndex.get(e.field));if(e.field2?(u=`${te(u)}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field2,this.fieldsIndex.get(e.field2)))}`,e.field3&&(u=`${u}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field3,this.fieldsIndex.get(e.field3)))}`)):typeof u=="string"&&t&&(r?u=u?new Date(u).getTime():null:o&&(u=u?dt(u):null)),s&&Number.isFinite(u)){const c=s==="field"&&e.normalizationField?this.getFieldValue(l,e.normalizationField,this.fieldsIndex.get(e.normalizationField)):null;u=wt(u,s,c,i)}return u})}async getExpressionValues(n,e,t,s,i){const{arcadeUtils:a}=await Ee(),r=a.hasGeometryOperations(e);r&&await a.enableGeometryOperations();const o=a.createFunction(e),l=a.getViewInfo(t),u={fields:this.fieldsIndex.fields};return n.map(c=>{const h={attributes:this.featureAdapter.getAttributes(c),layer:u,geometry:r?{...j(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(c)),spatialReference:t?.spatialReference}:null},d=a.createExecContext(h,l,i);return a.executeFunction(o,d)})}validateItem(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testFeature(n,this.featureAdapter)??!1}validateItems(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testSet(n,this.featureAdapter)??!1}_processAttributesForOutFields(n){const e=this.outFields;if(!e?.length)return this.featureAdapter.getAttributes(n);const t={};for(const s of e){const{alias:i,clause:a}=this._fieldDataCache.get(s);t[i]=a?a.calculateValue(n,this.featureAdapter):this.featureAdapter.getAttribute(n,i)}return t}_processAttributesForDistinctValues(n){if(n==null||!this.returnDistinctValues)return n;const e=this.outFields,t=[];if(e)for(const a of e){const{alias:r}=this._fieldDataCache.get(a);t.push(n[r])}else for(const a in n)t.push(n[a]);const s=`${(e||["*"]).join(",")}=${t.join(",")}`;let i=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++i),i>1?null:n}};function Te(n,e,t){return{objectId:n,target:e,distance:t,type:"vertex"}}function Dt(n,e,t,s,i,a=!1){return{objectId:n,target:e,distance:t,type:"edge",start:s,end:i,draped:a}}class v{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new L(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query;if(!t?.length)return 1;const a=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:u}=l,c=u!=="exceedslimit"?l.onStatisticField:void 0;if(!r.has(c)){const d=[];for(const m of t){const y=this._getAttributeValues(e,m,a);d.push(y)}r.set(c,this._calculateUniqueValues(d,e.returnDistinctValues))}const h=r.get(c);for(const d in h){const{data:m,items:y}=h[d],f=m.join(",");s&&!e.validateItems(y,s)||o.add(f)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;U(this.query.outSR)&&!V(t.spatialReference,this.query.outSR)?e.queryGeometry=Z({spatialReference:this.query.outSR,...D(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=Z({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=Re(this.hasZ,this.hasM),{point:a,mode:r}=e,o=typeof e.distance=="number"?e.distance:e.distance.x,l=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(r,this.spatialReference,t),d=new ve(null,0),m=new ve(null,0),y={x:0,y:0,z:0};for(const f of this.items){const w=s.getGeometry(f);if(w==null)continue;const{coords:_,lengths:I}=w;if(d.coords=_,m.coords=_,e.returnEdge){let S=0;for(let g=0;gf.distance-w.distance),u}_getPointCreator(e,t,s){const i=s==null||V(t,s)?o=>o:o=>D(o,t,s),{hasZ:a}=this,r=0;return e==="3d"?a?({x:o,y:l,z:u})=>i({x:o,y:l,z:u}):({x:o,y:l})=>i({x:o,y:l,z:r}):({x:o,y:l})=>i({x:o,y:l})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,minValue:o,maxValue:l,scale:u,timeZone:c,outStatisticTypes:h}=e,d=this.fieldsIndex.get(t),m=fe(d)||ie(d)||ae(d),y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:u,timeZone:c}),f=St({normalizationType:a,normalizationField:i,minValue:o,maxValue:l}),w={value:.5,fieldType:d?.type},_=X(d)?Fe({values:y,supportsNullCount:f,percentileParams:w,outStatisticTypes:h}):we({values:y,minValue:o,maxValue:l,useSampleStdDev:!a,supportsNullCount:f,percentileParams:w,outStatisticTypes:h});return ft(_,h,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:r,timeZone:o}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:r,timeZone:o},!1),u=mt(l);return pt(u,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m}),f=yt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h});return gt(f,o)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m});return xt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const a=i.split(" "),r=a[0],o=this.fieldsIndex.get(r),l=!!a[1]&&a[1].toLowerCase()==="desc",u=_t(o?.type,l);e.sort((c,h)=>{const d=s(c,r,o),m=s(h,r,o);return u(d,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:m,returnM:y}=e,f=h!=null&&t.length>(d||0)+h,w=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(_=>this.fieldsIndex.get(_)));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:w,geometryType:s,hasM:i&&y,hasZ:a&&m,objectIdFieldName:r,spatialReference:Z(u||o),transform:c&&_e(c)||null}}_createFeatures(e,t){const s=new L(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:d,returnZ:m=!1,returnM:y=!1}=e,f=a&&m,w=i&&y;let _=[],I=0;const S=[...t];if(this._sortFeatures(S,r,(p,F,x)=>s.getFieldValue(p,F,x)),this.geometryType&&(l||u)){const p=_e(o)??void 0,F=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(l&&!u)for(const x of S){const T=this.featureAdapter.getGeometry(x),R={attributes:s.getAttributes(x),geometry:j(this.geometryType,this.hasZ,this.hasM,T,c,p,f,w)};F&&T&&!R.geometry&&(R.centroid=ee(this,this.featureAdapter.getCentroid(x,this),p)),_[I++]=R}else if(!l&&u)for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p)};else for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p),geometry:j(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(x),c,p,f,w)}}else for(const p of S){const F=s.getAttributes(p);F&&(_[I++]={attributes:F})}const g=h||0;if(d!=null){const p=g+d;_=_.slice(g,Math.min(_.length,p))}return _}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if(r.statisticType==="exceedslimit"){s=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,i=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,a=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>s;else if(this.items.length>i)t=!0;else{const r=Re(this.hasZ,this.hasM),o=this.featureAdapter;t=this.items.reduce((l,u)=>{const c=o.getGeometry(u);return l+(c!=null&&c.coords.length||0)},0)/r>a}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,a=new Map,r=new Map,o=new Map,l=new L(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:d,resultRecordCount:m}=e,y=c?.length,f=!!y,w=f?c[0]:null,_=f&&!this.fieldsIndex.get(w);for(const S of u??[]){const{outStatisticFieldName:g,statisticType:p}=S,F=S,x=p!=="exceedslimit"?S.onStatisticField:void 0,T=p==="percentile_disc"||p==="percentile_cont",R=p==="EnvelopeAggregate"||p==="CentroidAggregate"||p==="ConvexHullAggregate",M=f&&y===1&&(x===w||_)&&p==="count";if(f){if(!r.has(x)){const k=[];for(const K of c){const H=this._getAttributeValues(l,K,i);k.push(H)}r.set(x,this._calculateUniqueValues(k,!R&&l.returnDistinctValues))}const b=r.get(x);if(!b)continue;const Y=Object.keys(b);for(const k of Y){const{count:K,data:H,items:oe,itemPositions:Pe}=b[k],le=H.join(",");if(!h||l.validateItems(oe,h)){const Q=o.get(le)||{attributes:{}};if(R){Q.aggregateGeometries||(Q.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:G}=await this._getAggregateGeometry(F,oe);Q.aggregateGeometries[G]=z}else{let z=null;if(M)z=K;else{const G=this._getAttributeValues(l,x,i),ue=Pe.map(Oe=>G[Oe]);z=T&&"statisticParameters"in F?this._getPercentileValue(F,ue):this._getStatisticValue(F,ue,null,l.returnDistinctValues)}Q.attributes[g]=z}let Ge=0;c.forEach((z,G)=>Q.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++Ge]=H[G]),o.set(le,Q)}}}else if(R){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:b,outStatisticFieldName:Y}=await this._getAggregateGeometry(F,this.items);t.aggregateGeometries[Y]=b}else{const b=this._getAttributeValues(l,x,i);t.attributes[g]=T&&"statisticParameters"in F?this._getPercentileValue(F,b):this._getStatisticValue(F,b,a,l.returnDistinctValues)}const B=p!=="min"&&p!=="max"||!X(this.fieldsIndex.get(x))&&!this._isAnyDateField(x)?null:this.fieldsIndex.get(x)?.type;s.push({name:g,alias:g,type:B||"esriFieldTypeDouble"})}const I=f?Array.from(o.values()):[t];return this._sortFeatures(I,d,(S,g)=>S.attributes[g]),m&&(I.length=Math.min(m,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return fe(t)||ie(t)||ae(t)||be(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:i}=await Xe(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(f=>f.g),{statisticType:a,outStatisticFieldName:r}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map(f=>j(u,c,h,o.getGeometry(f))),m=s(l,d,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if(a==="EnvelopeAggregate"){const f=m?et(m):me(i(l,d));y.aggregateGeometries={...f,spatialReference:l},y.outStatisticFieldName=r||"extent"}else if(a==="CentroidAggregate"){const f=m?tt(m):st(me(i(l,d)));y.aggregateGeometries={x:f[0],y:f[1],spatialReference:l},y.outStatisticFieldName=r||"centroid"}else a==="ConvexHullAggregate"&&(y.aggregateGeometries=m,y.outStatisticFieldName=r||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:r}=e;let o=null;return o=s?.has(a)?s.get(a):X(this.fieldsIndex.get(a))||this._isAnyDateField(a)?Fe({values:t,returnDistinct:i}):we({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,o),o[r==="var"?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:r,orderBy:o}=i,l=this.fieldsIndex.get(s);return Ft(t,{value:r,orderBy:o,fieldType:l?.type,isDiscrete:a==="percentile_disc"})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),a=this.items.map(r=>e.getFieldValue(r,t,i));return s.set(t,a),a}_calculateUniqueValues(e,t){const s={},i=this.items,a=i.length;for(let r=0;rn)}function Ne(n,e,t){const{outFields:s,orderByFields:i,returnDistinctValues:a,outStatistics:r}=t,o=r?r.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(i&&i.length>0){const l=" asc",u=" desc",c=i.map(h=>{const d=h.toLowerCase();return d.includes(l)?d.split(l)[0]:d.includes(u)?d.split(u)[0]:h}).filter(h=>!o.includes(h));C(n,e,c,{expressionName:"orderByFields",query:t})}if(s&&s.length>0)C(n,e,s,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(a)throw new A(P,"outFields should be specified for returnDistinctValues",{query:t});vt(n,e,t.where,t)}const Qt=new Set([...De,...qe]);function Nt(n,e,t){const{outStatistics:s,groupByFieldsForStatistics:i,having:a}=t,r=i?.length,o=s?.length;if(a){if(!r||!o)throw new A(P,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});At(n,e,a,s,t)}if(o){if(!Ot(s))return;const l=s.map(u=>u.onStatisticField).filter(Boolean);C(n,e,l,{expressionName:"onStatisticFields",query:t}),r&&C(n,e,i,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of s){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:d}=u;if(!d)throw new A(P,"statisticParameters should be set for percentile type",{definition:u,query:t})}else n.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&C(n,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:Qt,query:t})}}}async function Pt(n,e,{fieldsIndex:t,geometryType:s,spatialReference:i,availableFields:a}){if((n.distance??0)<0||n.geometryPrecision!=null||n.multipatchOption||n.pixelSize||n.relationParam||n.text||n.outStatistics||n.groupByFieldsForStatistics||n.having||n.orderByFields)throw new A(P,"Unsupported query options",{query:n});return Ne(t,a,n),Promise.all([Gt(t,a,e,n),ze(n,s,i),re(i,n.outSR)]).then(()=>n)}async function Gt(n,e,t,s){let i=[];if(t.valueExpression){const{arcadeUtils:a}=await Ee();i=a.extractFieldNames(t.valueExpression)}if(t.field&&i.push(t.field),t.field2&&i.push(t.field2),t.field3&&i.push(t.field3),t.normalizationField&&i.push(t.normalizationField),!i.length&&!t.valueExpression)throw new A(P,"field or valueExpression is required",{params:t});C(n,e,i,{expressionName:"statistics",query:s})}function Ot(n){return n!=null&&n.every(e=>e.statisticType!=="exceedslimit")}const Zt="unsupported-query";class is{constructor(e){this._cache=new zt,this._changeHandle=null,this.capabilities={query:ht},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,this.fieldsIndex=Ze(e.fieldsIndex)?e.fieldsIndex:It.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>this.fieldsIndex.get(t)?.name).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=ce(this._frameTask),this.clearCache(),je(this._cache),this._changeHandle=ce(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=E(t);try{return await(await this._executeQuery(e,{},s)).createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=E(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(i){if(i!==N)throw i;return 0}}async executeQueryForExtent(e,t){const s=E(t),i=e.outSR;try{const a=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=a.size;return r?{count:r,extent:await this._getBounds(a.items,a.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(a){if(a===N)return{count:0,extent:null};throw a}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(s=>Array.from(s))}async executeQueryForIdSet(e,t){const s=E(t);try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),a=i.items,r=new Set;return await this._reschedule(()=>{for(const o of a)r.add(i.featureAdapter.getObjectId(o))},s),r}catch(i){if(i===N)return new Set;throw i}}async executeQueryForSnapping(e,t){const s=E(t),{point:i,distance:a,returnEdge:r,vertexMode:o}=e;if(!r&&o==="none")return{candidates:[]};let l=J(e.query);l=await this._schedule(()=>ut(l,this.definitionExpression,this.spatialReference),s),l=await this._reschedule(()=>Ae(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const u=!V(i.spatialReference,this.spatialReference);u&&await re(i.spatialReference,this.spatialReference);const c=typeof a=="number"?a:a.x,h=typeof a=="number"?a:a.y,d={xmin:i.x-c,xmax:i.x+c,ymin:i.y-h,ymax:i.y+h,spatialReference:i.spatialReference},m=u?D(d,this.spatialReference):d;if(!m)return{candidates:[]};const y=(await pe(he(i),null,{signal:s}))[0],f=(await pe(he(m),null,{signal:s}))[0];if(y==null||f==null)return{candidates:[]};const w=new v(await this._reschedule(()=>this._searchFeatures(se(f.toJSON())),s),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(w),s),await this._reschedule(()=>this._executeTimeQuery(w),s),await this._reschedule(()=>this._executeAttributesQuery(w),s),await this._reschedule(()=>this._executeGeometryQueryForSnapping(w,s),s);const _=y.toJSON(),I=u?D(_,this.spatialReference):_,S=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:a;return w.createSnappingResponse({...e,point:I,distance:S},i.spatialReference)}async executeQueryForLatestObservations(e,t){const s=E(t);if(!this.timeInfo?.trackIdField)throw new A(Zt,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},s);return await this._reschedule(()=>this._filterLatest(i),s),await i.createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=E(s),{field:a,field2:r,field3:o,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:a,field2:r,field3:o,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=E(e);this._timeExtentPromise||=ot(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return $e(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=Be(He(),ke);await this.featureStore.forEachBounds(e,o=>Le(i,o));const a={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:Z(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(a.zmin=i[2],a.zmax=i[5],a.hasZ=!0);const r=D(a,t,s);if(r.spatialReference=Z(s),r.xmax-r.xmin==0){const o=W(r.spatialReference);r.xmin-=o,r.xmax+=o}if(r.ymax-r.ymin==0){const o=W(r.spatialReference);r.ymin-=o,r.ymax+=o}if(this.hasZ&&r.zmin!=null&&r.zmax!=null&&r.zmax-r.zmin==0){const o=W(r.spatialReference);r.zmin-=o,r.zmax+=o}return r}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(Se)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(Se)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const s=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(i=>s.push(i))})().then(()=>s)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=J(e),e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Ae(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s),e={...e,...t};const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:s,returnGeometry:i,returnCentroid:a}=e,r=this.featureStore.featureSpatialReference,o=e.sceneFilter.geometry,l=r==null||V(r,o.spatialReference)?o:D(o,r);if(!l)return null;const u=i||a,c=U(s)&&!V(this.spatialReference,s)&&u?async f=>this._project(f,s):f=>f,h=this.featureAdapter,d=await this._reschedule(()=>this._searchFeatures(se(l)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!d.length)return null;const f=new Set;for(const I of d)f.add(h.getObjectId(I));const w=await this._reschedule(()=>this._getAllFeatures(),t),_=await this._reschedule(async()=>{const I=await O("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),S=p=>!f.has(h.getObjectId(p))||I(h.getGeometry(p)),g=await this._runSpatialFilter(w,S,t);return new v(g,e,this)},t);return c(_)}if(!d.length)return new v([],e,this);if(this._canExecuteSinglePass(l,e))return c(new v(d,e,this));const m=await O("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),y=await this._runSpatialFilter(d,f=>m(h.getGeometry(f)),t);return c(new v(y,e,this))}async _executeGeometryQuery(e,t,s){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:i,outSR:a,spatialRel:r,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!i||u==null||V(u,i.spatialReference)?i:D(i,u),h=o||l,d=U(a)&&!V(this.spatialReference,a),m=t==null?this._getCacheKey(e):null,y=m?this._cache.get(m):null;if(y!=null)return new v(y,e,this);const f=async g=>(d&&h&&await this._project(g,a),m&&this._cache.put(m,g.items),g);if(!c)return f(t??await this._getAllFeaturesQueryEngineResult(e));const w=this.featureAdapter;let _=await this._reschedule(()=>this._searchFeatures(se(i)),s);if(r==="esriSpatialRelDisjoint"){if(!_.length)return f(t??await this._getAllFeaturesQueryEngineResult(e));const g=new Set;for(const x of _)g.add(w.getObjectId(x));const p=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),s),F=await this._reschedule(async()=>{const x=await O(r,c,this.geometryType,this.hasZ,this.hasM),T=M=>!g.has(w.getObjectId(M))||x(w.getGeometry(M)),R=await this._runSpatialFilter(p,T,s);return new v(R,e,this)},s);return f(F)}if(t!=null){const g=new it;_=_.filter(p=>Je(t.items,p,t.items.length,g)>=0)}if(!_.length){const g=new v([],e,this);return m&&this._cache.put(m,g.items),g}if(this._canExecuteSinglePass(c,e))return f(new v(_,e,this));const I=await O(r,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(_,g=>I(w.getGeometry(g)),s);return f(new v(S,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:s}=e,{spatialRel:i}=s;if(!e?.items?.length||!s.geometry||!i)return;const a=await O(i,s.geometry,this.geometryType,this.hasZ,this.hasM),r=await this._runSpatialFilter(e.items,o=>a(o.geometry),t);e.items=r}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds?.length||this.aggregateAdapter==null)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(a=>t.add(a));const s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=lt(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=q(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(s=>t.testFeature(s,this.featureAdapter))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(this._frameTask==null)return e.filter(o=>t(o));let i=0;const a=new Array,r=async o=>{for(;ir(u),s)}};return this._reschedule(o=>r(o),s).then(()=>a)}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,a=i||s,r=new Map,o=this.featureAdapter.getAttribute;for(const l of e.items){const u=o(l,t),c=o(l,a),h=r.get(u);(!h||c>o(h,a))&&r.set(u,l)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:s,returnGeometry:i,returnCentroid:a,outSR:r,resultType:o,cacheHint:l}=e;if(o!=="tile"&&!l)return null;const u=i||a;return U(r)&&!V(this.spatialReference,r)&&u?JSON.stringify([t,s,r]):JSON.stringify([t,s])}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return Ve(e)&&(s==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(s==="esriSpatialRelIntersects"||s==="esriSpatialRelContains"))}async _project(e,t){if(!t||V(this.spatialReference,t))return e;const s=this.featureAdapter;let i;try{const r=await this._getFullExtent();i=at(this.spatialReference,t,r)}catch{}const a=await ct(e.items.map(r=>j(this.geometryType,this.hasZ,this.hasM,s.getGeometry(r))),this.spatialReference,t,i);return e.items=a.map((r,o)=>s.cloneWithGeometry(e.items[o],rt(r,this.hasZ,this.hasM))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(i=>this.featureStore.forEachInBounds(i,a=>t.add(a))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=J(e);try{e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Pt(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}catch(i){if(i!==N)throw i;return new v([],e,this)}}}function se(n){if(Ve(n)){if(Ue(n))return[de(Math.min(n.xmin,n.xmax),Math.min(n.ymin,n.ymax),Math.max(n.xmin,n.xmax),Math.max(n.ymin,n.ymax))];if(Ye(n))return n.rings.map(e=>de(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[Ke(We(),n)]}export{is as Z}; diff --git a/main/assets/QueryTask-CwHwH2rS-CT1NKU1Q.js b/main/assets/QueryTask-CwHwH2rS-CT1NKU1Q.js new file mode 100644 index 000000000..56a8e7c49 --- /dev/null +++ b/main/assets/QueryTask-CwHwH2rS-CT1NKU1Q.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./meshFeatureSet-zeR2pNmE-CmdBTSo4.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./Mesh-DLzjDUIO-B17ONcIN.js","./MeshTransform-C--IG09w-QYZk68_K.js","./mat4-DX7gBViE-vewreEuZ.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Dbd8ftOx.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./vec42-D8CJyqHG-DnfLTeQH.js","./imageUtils-BA2D6Uf1-DyozB2y5.js","./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-Cd6y9wum.js","./plane-Dt8R0KeE-CdQQbSdq.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./deduplicate-D2d-E5Pw-eujRBTUy.js","./projectPointToVector-B2UUY9SE-BWg0qYG-.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js","./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js","./vec3-BazNroeq-Cdhfm-VN.js","./BufferView-PQoE3GL7-M6q1od-Y.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-DGtcegeJ.js","./External-D_wl4XAw-Bzqlxz38.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./FeatureSet-BkVNthuN-DDwR53LR.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./meshFeatureAttributes-BwKR5odo-D0ENCfZG.js","./RelationshipQuery-DJsz3K0U-BHNd_b19.js","./Query-BrwMGK8U-DV_czrJX.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./executeRelationshipQuery-BlX9_g4g-D0r3rl0-.js","./utils-9sQxfkoa-Bn_d9vXA.js","./query-DFW9-NG_-CfusC8cS.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js","./pbf-D-y3_eZO-SEvl9j6c.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./queryAttachments-Bgvu3RnK-BeoLM06C.js","./AttachmentInfo-D9RFO8W2-BdVN-3Ab.js","./executeBinsQuery-26-59HNS-C05wOd4_.js","./BinsQuery-DjwQZqB8-CUCgQbor.js","./queryUtils-Brxu6254-T3UhaATW.js","./json-BI97KiBB-Ce5cWfI2.js","./executeTopFeaturesQuery-CjTd36wS-CU_eFWMm.js","./queryTopFeatures-IbhAPJlP-JGKZFCDQ.js","./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js","./executeForTopIds-BWxBZygF-Bqc8aFlq.js","./executeForTopExtents-3NOTiZTn-DGqWdu2v.js","./executeForTopCount-Dx1gCDe1-Bd3sqrnv.js"])))=>i.map(i=>d[i]); +import{v as u,S as c,i as R,j as E,a as V,K as v,a_ as l,_ as a,o as d,aC as I}from"./main-C7yV2j71.js";import{f as T,C as w}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{K as f,b as A}from"./Query-BrwMGK8U-DV_czrJX.js";import{y as Q}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{i as j,e as P}from"./executeForIds-Z1gkLduF-BNBrXf-U.js";import{T as q,g as L}from"./executeQueryPBF-o8010HS9-E5WwNUPn.js";import{s as C}from"./executeQueryJSON-CcHnccia-CB1D7q08.js";import{O as z}from"./FeatureSet-BkVNthuN-DDwR53LR.js";let i=class extends E{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return V(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),s=e.outStatistics?.[0]!=null,n=v("featurelayer-pbf-statistics"),o=!s||n;let p;if(this.pbfSupported&&o)try{p=await q(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&o||(p=await C(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await l(a(()=>import("./meshFeatureSet-zeR2pNmE-CmdBTSo4.js"),__vite__mapDeps([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,26,27,28,29,30,31,32,33,34,35,36,37,38,39]),import.meta.url),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return j(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return L(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return P(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-BHNd_b19.js"),__vite__mapDeps([40,1,2,41,37,38,42]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-D0r3rl0-.js"),__vite__mapDeps([43,44,1,2,45,46,47,48,49,50,51,52,53,24,25,36,37,38,40,41,42]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-BHNd_b19.js"),__vite__mapDeps([40,1,2,41,37,38,42]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-D0r3rl0-.js"),__vite__mapDeps([43,44,1,2,45,46,47,48,49,50,51,52,53,24,25,36,37,38,40,41,42]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:s,processAttachmentQueryResult:n}=await l(a(()=>import("./queryAttachments-Bgvu3RnK-BeoLM06C.js"),__vite__mapDeps([54,1,2,45,46,47,44,48,49,50,51,52,53,24,25,55]),import.meta.url),t),o=Q(this.url);return n(o,await(this.queryAttachmentsSupported?r(o,e,t):s(o,e,t)))}async executeBinsQuery(e,t){const{executeBinsQuery:r}=await l(a(()=>import("./executeBinsQuery-26-59HNS-C05wOd4_.js"),__vite__mapDeps([56,44,1,2,46,47,48,45,49,50,51,52,53,24,25,57,58,59,41,37,38,42,36]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await l(a(()=>import("./executeTopFeaturesQuery-CjTd36wS-CU_eFWMm.js"),__vite__mapDeps([60,44,1,2,61,46,47,48,45,49,50,51,52,53,24,25,36,37,38,62,42]),import.meta.url),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await l(a(()=>import("./executeForTopIds-BWxBZygF-Bqc8aFlq.js"),__vite__mapDeps([63,44,1,2,61,46,47,48,45,49,50,51,52,53,24,25,62,42]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await l(a(()=>import("./executeForTopExtents-3NOTiZTn-DGqWdu2v.js"),__vite__mapDeps([64,1,2,44,61,46,47,48,45,49,50,51,52,53,24,25,62,42]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await l(a(()=>import("./executeForTopCount-Dx1gCDe1-Bd3sqrnv.js"),__vite__mapDeps([65,44,1,2,61,46,47,48,45,49,50,51,52,53,24,25,62,42]),import.meta.url),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?f.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const s=T(r),n=w(r);for(const o of r.queryFormats){if(o===s){t.formatOf3DObjects=o;break}o!==n||t.formatOf3DObjects||(t.formatOf3DObjects=o)}if(!t.formatOf3DObjects)throw new d("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!I(t.outSpatialReference,this.sourceSpatialReference))throw new d("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:o,originY:p,originZ:m,translationX:h,translationY:y,translationZ:_,scaleX:S,scaleY:D,scaleZ:F,rotationX:O,rotationY:b,rotationZ:x,rotationDeg:g}=r.transformFieldRoles;t.outFields.push(o,p,m,h,y,_,S,D,F,O,b,x,g)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};u([c({type:f})],i.prototype,"dynamicDataSource",void 0),u([c()],i.prototype,"fieldsIndex",void 0),u([c()],i.prototype,"gdbVersion",void 0),u([c()],i.prototype,"infoFor3D",void 0),u([c({readOnly:!0})],i.prototype,"parsedUrl",null),u([c()],i.prototype,"pbfSupported",void 0),u([c()],i.prototype,"queryAttachmentsSupported",void 0),u([c()],i.prototype,"sourceSpatialReference",void 0),u([c({type:String})],i.prototype,"url",void 0),i=u([R("esri.layers.graphics.sources.support.QueryTask")],i);const B=i;export{B as C}; diff --git a/main/assets/QueryTask-CwHwH2rS-CU-oJwb3.js b/main/assets/QueryTask-CwHwH2rS-CU-oJwb3.js deleted file mode 100644 index 3b0819efe..000000000 --- a/main/assets/QueryTask-CwHwH2rS-CU-oJwb3.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./meshFeatureSet-zeR2pNmE-Ct1oHJpZ.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./Mesh-DLzjDUIO-L2WFr_jE.js","./MeshTransform-C--IG09w-B7P01ZzU.js","./mat4-DX7gBViE-CQMXDC3Z.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Bk09s2KF.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./vec42-D8CJyqHG-DnfLTeQH.js","./imageUtils-BA2D6Uf1-BIs7TUww.js","./MeshVertexAttributes-CbNpPur2-BzFN0z5X.js","./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js","./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-Cw8IJeSy.js","./plane-Dt8R0KeE-fuXvBrPY.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./deduplicate-D2d-E5Pw-cAmFzdIS.js","./projectPointToVector-B2UUY9SE-DeA9AEsl.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js","./vec3-BazNroeq-CFXHYIOm.js","./BufferView-PQoE3GL7-DXIpDOUe.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-maVOs7I3.js","./External-D_wl4XAw-MFWeclAP.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./meshFeatureAttributes-BwKR5odo-DqGm5IB9.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./Query-BrwMGK8U-sojFdYaD.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./executeRelationshipQuery-BlX9_g4g-DqUK0EmM.js","./utils-9sQxfkoa-Cus_qP6M.js","./query-DFW9-NG_-1nHUNdNu.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-Bq23Xwmj-sYd6uuv5.js","./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js","./pbf-D-y3_eZO-BOjQwfR-.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./queryAttachments-Bgvu3RnK-xX-K0xXv.js","./AttachmentInfo-D9RFO8W2-CP6YNuYr.js","./executeBinsQuery-26-59HNS-B-fN88FW.js","./BinsQuery-DjwQZqB8-T-ydjXwz.js","./queryUtils-Brxu6254-DDAvXp_C.js","./json-BI97KiBB-Ce5cWfI2.js","./executeTopFeaturesQuery-CjTd36wS-CqZW1hbK.js","./queryTopFeatures-IbhAPJlP-DzgjIri_.js","./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js","./executeForTopIds-BWxBZygF-B3N-R4je.js","./executeForTopExtents-3NOTiZTn-BAEfYmuL.js","./executeForTopCount-Dx1gCDe1-Blv1ngys.js"])))=>i.map(i=>d[i]); -import{v as u,S as c,i as R,j as E,a as V,K as v,a_ as l,_ as a,o as d,aC as I}from"./main-BZaw9FpY.js";import{f as T,C as w}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{K as f,b as A}from"./Query-BrwMGK8U-sojFdYaD.js";import{y as Q}from"./utils-9sQxfkoa-Cus_qP6M.js";import{i as j,e as P}from"./executeForIds-Z1gkLduF-Daa1fnES.js";import{T as q,g as L}from"./executeQueryPBF-o8010HS9-dWp8mQx-.js";import{s as C}from"./executeQueryJSON-CcHnccia-DVecwfbV.js";import{O as z}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";let i=class extends E{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return V(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),s=e.outStatistics?.[0]!=null,n=v("featurelayer-pbf-statistics"),o=!s||n;let p;if(this.pbfSupported&&o)try{p=await q(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&o||(p=await C(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await l(a(()=>import("./meshFeatureSet-zeR2pNmE-Ct1oHJpZ.js"),__vite__mapDeps([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,26,27,28,29,30,31,32,33,34,35,36,37,38,39]),import.meta.url),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return j(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return L(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return P(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-CSUcCWzp.js"),__vite__mapDeps([40,1,2,41,37,38,42]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-DqUK0EmM.js"),__vite__mapDeps([43,44,1,2,45,46,47,48,49,50,51,52,53,24,25,36,37,38,40,41,42]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-CSUcCWzp.js"),__vite__mapDeps([40,1,2,41,37,38,42]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-DqUK0EmM.js"),__vite__mapDeps([43,44,1,2,45,46,47,48,49,50,51,52,53,24,25,36,37,38,40,41,42]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:s,processAttachmentQueryResult:n}=await l(a(()=>import("./queryAttachments-Bgvu3RnK-xX-K0xXv.js"),__vite__mapDeps([54,1,2,45,46,47,44,48,49,50,51,52,53,24,25,55]),import.meta.url),t),o=Q(this.url);return n(o,await(this.queryAttachmentsSupported?r(o,e,t):s(o,e,t)))}async executeBinsQuery(e,t){const{executeBinsQuery:r}=await l(a(()=>import("./executeBinsQuery-26-59HNS-B-fN88FW.js"),__vite__mapDeps([56,44,1,2,46,47,48,45,49,50,51,52,53,24,25,57,58,59,41,37,38,42,36]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await l(a(()=>import("./executeTopFeaturesQuery-CjTd36wS-CqZW1hbK.js"),__vite__mapDeps([60,44,1,2,61,46,47,48,45,49,50,51,52,53,24,25,36,37,38,62,42]),import.meta.url),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await l(a(()=>import("./executeForTopIds-BWxBZygF-B3N-R4je.js"),__vite__mapDeps([63,44,1,2,61,46,47,48,45,49,50,51,52,53,24,25,62,42]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await l(a(()=>import("./executeForTopExtents-3NOTiZTn-BAEfYmuL.js"),__vite__mapDeps([64,1,2,44,61,46,47,48,45,49,50,51,52,53,24,25,62,42]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await l(a(()=>import("./executeForTopCount-Dx1gCDe1-Blv1ngys.js"),__vite__mapDeps([65,44,1,2,61,46,47,48,45,49,50,51,52,53,24,25,62,42]),import.meta.url),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?f.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const s=T(r),n=w(r);for(const o of r.queryFormats){if(o===s){t.formatOf3DObjects=o;break}o!==n||t.formatOf3DObjects||(t.formatOf3DObjects=o)}if(!t.formatOf3DObjects)throw new d("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!I(t.outSpatialReference,this.sourceSpatialReference))throw new d("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:o,originY:p,originZ:m,translationX:h,translationY:y,translationZ:_,scaleX:S,scaleY:D,scaleZ:F,rotationX:O,rotationY:b,rotationZ:x,rotationDeg:g}=r.transformFieldRoles;t.outFields.push(o,p,m,h,y,_,S,D,F,O,b,x,g)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};u([c({type:f})],i.prototype,"dynamicDataSource",void 0),u([c()],i.prototype,"fieldsIndex",void 0),u([c()],i.prototype,"gdbVersion",void 0),u([c()],i.prototype,"infoFor3D",void 0),u([c({readOnly:!0})],i.prototype,"parsedUrl",null),u([c()],i.prototype,"pbfSupported",void 0),u([c()],i.prototype,"queryAttachmentsSupported",void 0),u([c()],i.prototype,"sourceSpatialReference",void 0),u([c({type:String})],i.prototype,"url",void 0),i=u([R("esri.layers.graphics.sources.support.QueryTask")],i);const B=i;export{B as C}; diff --git a/main/assets/QueueProcessor-DbfV9fLy-Bhvo6-Tg.js b/main/assets/QueueProcessor-DbfV9fLy-Bhvo6-Tg.js deleted file mode 100644 index b0e769016..000000000 --- a/main/assets/QueueProcessor-DbfV9fLy-Bhvo6-Tg.js +++ /dev/null @@ -1 +0,0 @@ -import{al as l,E as d,dy as g,b as m,aS as u,aQ as f,t as I}from"./main-BZaw9FpY.js";import{B as q}from"./workers-PiCjreoO-oGzLvkSt.js";import{h as n}from"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import{o as v}from"./signal-CETehA7D-vStzfbaY.js";class x{constructor(e,s){this.item=e,this.controller=s,this.promise=null}}class b{constructor(e){this._schedule=null,this._task=null,this._deferreds=new n,this._controllers=new n,this._processingItems=new n,this._pausedSignal=v(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new q(e.peeker),this.process=e.process;const s=e.scheduler;e.priority&&s&&(this._task=s.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=l(this._schedule),this._task=l(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const s=this._controllers.get(e);s&&s.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(s=>e.push(s)),this._controllers.clear(),e.forEach(s=>s.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((s,i)=>e(i))}get(e){const s=this._deferreds.get(e);return s?s.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,s){const i=this.get(e);if(i)return i;const t=new AbortController;let r=null;s&&(r=d(s,()=>t.abort()));const a=()=>{const c=this._processingItems.get(e);c&&c.controller.abort(),o(),h.reject(u())},o=()=>{p.remove(),r?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},p=g(t.signal,a),h=m();return this._deferreds.set(e,h),this._controllers.set(e,t),h.promise.then(o,o),this._queue.push(e),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject(u()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const s of e)this._queue.push(s.item),s.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(t,r),r=>this._processError(t,r))):this._processResult(t,s)}get test(){}}export{b as k}; diff --git a/main/assets/QueueProcessor-DbfV9fLy-DobN0ur5.js b/main/assets/QueueProcessor-DbfV9fLy-DobN0ur5.js new file mode 100644 index 000000000..4da1f737c --- /dev/null +++ b/main/assets/QueueProcessor-DbfV9fLy-DobN0ur5.js @@ -0,0 +1 @@ +import{al as l,E as d,dy as g,b as m,aS as u,aQ as f,t as I}from"./main-C7yV2j71.js";import{B as q}from"./workers-PiCjreoO-DqI62TYf.js";import{h as n}from"./ReactiveMap-CFk6jPfN-CM49HI11.js";import{o as v}from"./signal-CETehA7D-DxK1orqE.js";class x{constructor(e,s){this.item=e,this.controller=s,this.promise=null}}class b{constructor(e){this._schedule=null,this._task=null,this._deferreds=new n,this._controllers=new n,this._processingItems=new n,this._pausedSignal=v(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new q(e.peeker),this.process=e.process;const s=e.scheduler;e.priority&&s&&(this._task=s.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=l(this._schedule),this._task=l(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const s=this._controllers.get(e);s&&s.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(s=>e.push(s)),this._controllers.clear(),e.forEach(s=>s.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((s,i)=>e(i))}get(e){const s=this._deferreds.get(e);return s?s.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,s){const i=this.get(e);if(i)return i;const t=new AbortController;let r=null;s&&(r=d(s,()=>t.abort()));const a=()=>{const c=this._processingItems.get(e);c&&c.controller.abort(),o(),h.reject(u())},o=()=>{p.remove(),r?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},p=g(t.signal,a),h=m();return this._deferreds.set(e,h),this._controllers.set(e,t),h.promise.then(o,o),this._queue.push(e),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject(u()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const s of e)this._queue.push(s.item),s.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(t,r),r=>this._processError(t,r))):this._processResult(t,s)}get test(){}}export{b as k}; diff --git a/main/assets/RasterPresetRendererMixin-D6W9pUY6-BpvSTPuo.js b/main/assets/RasterPresetRendererMixin-D6W9pUY6-BpvSTPuo.js deleted file mode 100644 index a78d20452..000000000 --- a/main/assets/RasterPresetRendererMixin-D6W9pUY6-BpvSTPuo.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as le,ar as b,v as a,S as n,eo as ye,bz as J,i as v,bB as R,a0 as x,ac as ce,P as w,w as _,bi as bt,eD as vt,eB as St,fc as Ie,d2 as $,ad as jt,g as et,af as Ct,aa as Tt,e as S,fd as Nt,a1 as Lt,d as xt,n as fe,l as Bt,bK as zt,b0 as Ut,eC as Oe,f as O,J as Ht,o as j}from"./main-BZaw9FpY.js";import{g as tt}from"./multidimensionalUtils-BwTugeu7-CpzGLouA.js";import{q as kt}from"./workers-PiCjreoO-oGzLvkSt.js";import{o as k,a as Rt,w as Zt,U as Et,D as Z}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{y as Pt}from"./Field-C6hA1tZj-CbELM0zp.js";import{$ as it,h as rt,G as Ue,M as at,o as ue,t as Fe,d as He,P as _e}from"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{Y as oe,n as Vt,i as ot,q as Gt,_ as ke,y as nt,w as st,c as Jt,W as Wt,z as Ot,C as Ft,j as _t}from"./RasterSymbolizer-BVys6HkM-CeBx4Ld8.js";import{w as Kt}from"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import{g as lt,c as ct,v as ut}from"./colorRamps-q0bZVhs2-Bqen3nIx.js";import{k as Qt}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{y as Xt,n as qt,a as Yt}from"./utils-9sQxfkoa-Cus_qP6M.js";import{O as $t}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{B as ei}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{getAllSizes as ti,getRotationAngle as ii}from"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import{I as ri,J as ai}from"./utils-DPtQ14k3-D1wtSpry.js";var De;const te=new le({flow_from:"flow-from",flow_to:"flow-to"});let A=De=class extends it(S){constructor(e){super(e),this.density=.8,this.color=new b([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,smoothing:s,flowRepresentation:l,trailCap:u,background:y}=this,c=this.color.clone(),h=(this.visualVariables||[]).map(N=>N.clone()),M=this.authoringInfo?.clone(),B=this.legendOptions?.clone();return new De({density:e,color:c,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,trailCap:u,background:y,smoothing:s,flowRepresentation:l,visualVariables:h,authoringInfo:M,legendOptions:B})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};a([n({type:Number,json:{write:!0}})],A.prototype,"density",void 0),a([n({type:b,json:{write:{allowNull:!0}}})],A.prototype,"color",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"maxPathLength",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"trailWidth",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"flowSpeed",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"trailLength",void 0),a([n({type:Number,cast:ye,json:{write:!1}})],A.prototype,"smoothing",void 0),a([n({type:te.apiValues,json:{type:te.jsonValues,read:{reader:te.read},write:{writer:te.write}}})],A.prototype,"flowRepresentation",void 0),a([J({flowRenderer:"flow"})],A.prototype,"type",void 0),a([n({type:rt,json:{write:!0}})],A.prototype,"authoringInfo",void 0),a([n({type:Kt,json:{write:!0}})],A.prototype,"legendOptions",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"trailCap",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"background",void 0),A=De=a([v("esri.renderers.FlowRenderer")],A);const dt=A;let F=class extends S{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};a([n({type:Number,json:{write:!0}})],F.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],F.prototype,"label",void 0),a([n({type:b,json:{type:[R],write:!0}})],F.prototype,"color",void 0),F=a([v("esri.renderers.support.ColormapInfo")],F);const pt=F;var Q;let X=Q=class extends S{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const i=e[0].length===5,r=[...e].sort((o,s)=>o[0]-s[0]).map(o=>pt.fromJSON({value:o[0],color:i?o.slice(1,5):o.slice(1,4).concat([255]),label:t?t[o[0]]??"":o[0]}));return new Q({colormapInfos:r})}static createFromColorramp(e){const t=ot(e);return Q.createFromColormap(t)}clone(){return new Q({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};a([n({type:[pt],json:{write:!0}})],X.prototype,"colormapInfos",void 0),a([J({rasterColormap:"raster-colormap"})],X.prototype,"type",void 0),X=Q=a([v("esri.renderers.RasterColormapRenderer")],X);const Re=X;var be;let T=be=class extends S{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return ut(e)}clone(){return new be({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:w(this.colorRamp)})}};a([n({type:Number,json:{write:!0}})],T.prototype,"altitude",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"azimuth",void 0),a([n({types:lt,json:{write:!0}})],T.prototype,"colorRamp",void 0),a([x("colorRamp")],T.prototype,"readColorRamp",null),a([n({type:["traditional","multi-directional"],json:{write:!0}})],T.prototype,"hillshadeType",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizePower",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizeFactor",void 0),a([n({type:["none","adjusted"],json:{write:!0}})],T.prototype,"scalingType",void 0),a([J({rasterShadedRelief:"raster-shaded-relief"})],T.prototype,"type",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"zFactor",void 0),T=be=a([v("esri.renderers.RasterShadedReliefRenderer")],T);const Mt=T;var ve;let p=ve=class extends S{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ut(e)}get statistics(){return this._get("statistics")}set statistics(e){Nt(Lt.getLogger(this),"statistics",{replacement:"customStatistics",version:"4.31",warnOnce:!0}),this._set("statistics",e)}get customStatistics(){const e=this.statistics;return e&&Array.isArray(e[0])?e.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]})):e}set customStatistics(e){this._set("statistics",e?.map(t=>[t.min,t.max,t.avg??0,t.stddev??1]))}readCustomStatistics(e){return e?.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]}))}writeCustomStatistics(e,t,i){e?.length&&(t[i]=e.map(r=>[r.min,r.max,r.avg??0,r.stddev??1]))}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=Gt[i]),oe.read(i)}clone(){return new ve({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:w(this.statistics),customStatistics:w(this.customStatistics),gamma:w(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:w(this.colorRamp),histograms:w(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};a([n({types:lt,json:{write:!0}})],p.prototype,"colorRamp",void 0),a([x("colorRamp")],p.prototype,"readColorRamp",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"computeGamma",void 0),a([n({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],p.prototype,"dynamicRangeAdjustment",void 0),a([n({type:[Number],json:{write:!0}})],p.prototype,"gamma",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"maxPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"minPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"numberOfStandardDeviations",void 0),a([n({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],p.prototype,"outputMax",void 0),a([n({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],p.prototype,"outputMin",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"sigmoidStrengthLevel",void 0),a([n({})],p.prototype,"statistics",null),a([n()],p.prototype,"histograms",void 0),a([n({json:{type:[[Number]],name:"statistics",write:!0}})],p.prototype,"customStatistics",null),a([x("customStatistics")],p.prototype,"readCustomStatistics",null),a([ce("customStatistics")],p.prototype,"writeCustomStatistics",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"useGamma",void 0),a([n({type:oe.apiValues,json:{type:oe.jsonValues,write:oe.write}})],p.prototype,"stretchType",void 0),a([x("stretchType",["stretchType"])],p.prototype,"readStretchType",null),a([J({rasterStretch:"raster-stretch"})],p.prototype,"type",void 0),p=ve=a([v("esri.renderers.RasterStretchRenderer")],p);const Ze=p;var Se;const Ke=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),ie=new le({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),re=new le({flow_from:"flow-from",flow_to:"flow-to"});let f=Se=class extends it(S){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return Ke.has(e)?k.fromJSON(e):null}readOutputUnit(e,t){return Ke.has(e)?k.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,i=this._createStyleRenderer(e);return i.field=t,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new Ue({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new at({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new Se({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:w(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){const r=new Array,o=Rt(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,l=t?Zt(e.pixelBlock,"vector-uv",s,o):Et(e.pixelBlock,"vector-magdir",o);if(l==null)return r;const u=e.extent,y=l.mask!=null&&l.mask.length>0;let c=0;const h=(u.xmax-u.xmin)/l.width,M=(u.ymax-u.ymin)/l.height;for(let B=0;BL.intersects(d));if((!y||l.mask[c])&&!m){const L={Magnitude:l.pixels[0][c],Direction:l.pixels[1][c]},z=new bt({geometry:new _({x:d.x,y:d.y,spatialReference:u.spatialReference}),attributes:L});z.symbol=this._getVisualVariablesAppliedSymbol(z),r.push(z)}}return r}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new vt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new St({width:0}),size:20,color:e||new b([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const t=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,r=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(o=>ri(t,ti([o],e))),r&&r.length){const o=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+o,this.rotationVariables.forEach(s=>ai(t,ii(s,e),s.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new ue(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.28084;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=2.23694;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.6;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new b([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const r=this.sizeVariables[0].minDataValue,o=this.sizeVariables[0].maxDataValue;if(r&&o){const s=(o-r)/5;t=Array.from(Array(6).keys()).map(l=>r+s*l)}}const i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:Ie.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(o=>5*o),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=Ie.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),r=e.map((o,s)=>{let l;if(s!==e.length-1)if(s===0)l={minValue:o,maxValue:e[s+1],symbol:i};else{const u=Ie.fromJSON({type:"esriPMS",imageData:t[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});l={minValue:o,maxValue:e[s+1],symbol:u}}return new Fe(l)});return{defaultSymbol:i,classBreakInfos:r}}_getClassBreaks(e,t){return t.map((i,r)=>new Fe({minValue:e[r],maxValue:e[r+1],symbol:this._getDefaultSymbol(new b(i))}))}};a([n({type:["Magnitude"],json:{write:!0}})],f.prototype,"attributeField",void 0),a([n({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],f.prototype,"flowRepresentation",void 0),a([n({type:["geographic","arithmetic"],json:{write:!0}})],f.prototype,"rotationType",void 0),a([n({type:ie.apiValues,json:{type:ie.jsonValues,read:{reader:ie.read},write:{writer:ie.write}}})],f.prototype,"style",void 0),a([n({json:{write:!0}})],f.prototype,"symbolTileSize",void 0),a([n({type:k.apiValues,json:{type:k.jsonValues,write:{writer:k.write}}})],f.prototype,"inputUnit",void 0),a([x("inputUnit")],f.prototype,"readInputUnit",null),a([n({type:k.apiValues,json:{type:k.jsonValues,read:{reader:k.read},write:{writer:k.write}}})],f.prototype,"outputUnit",void 0),a([x("outputUnit")],f.prototype,"readOutputUnit",null),a([J({vectorField:"vector-field"})],f.prototype,"type",void 0),a([n({type:ue})],f.prototype,"styleRenderer",null),a([n({type:Ue})],f.prototype,"sizeVariables",null),a([n({type:at})],f.prototype,"rotationVariables",null),f=Se=a([v("esri.renderers.VectorFieldRenderer")],f);const Ee=f,je={key:"type",base:null,typeMap:{"unique-value":He,"class-breaks":ue,"raster-colormap":Re,"raster-stretch":Ze,"vector-field":Ee,"raster-shaded-relief":Mt,flow:dt}},Ce={...je,typeMap:{...je.typeMap}};delete Ce.typeMap["vector-field"],delete Ce.typeMap.flow;const oi={uniqueValue:He,classBreaks:ue,rasterStretch:Ze,rasterColormap:Re,vectorField:Ee,rasterShadedRelief:Mt,flowRenderer:dt};function ni(e){return e&&oi[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const r=e.authoringInfo||{classificationMethod:""};r.classificationMethod=e.classificationMethod,e.authoringInfo=r}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=ni(e);if(i){const r=new i;return r.read(e,t),r}return t?.messages&&e&&t.messages.push(new Ut("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}const Oi=$()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),Fi=$()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),we=$()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let E=class extends S{constructor(){super(...arguments),this.pixelType="unknown"}};a([n({type:String,json:{write:!0}})],E.prototype,"name",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"description",void 0),a([n({type:R,json:{type:R,write:!0,name:"_object_id"}})],E.prototype,"id",void 0),a([n({type:String,json:{type:we.jsonValues,read:we.read,write:we.write}})],E.prototype,"pixelType",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"type",void 0),E=a([v("esri.layers.support.RasterFunctionInfo")],E);const si=E;let H=class extends S{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};a([n({type:String,json:{write:!0}})],H.prototype,"name",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],H.prototype,"id",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isDataset",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isPublic",void 0),a([n({json:{write:!0}})],H.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],H.prototype,"type",void 0),H=a([v("esri.layers.support.RasterFunctionVariable")],H);const li=H,ae={key:"type",base:null,typeMap:{RasterFunctionVariable:li}};let V=class extends S{};a([n({types:ae,json:{types:ae,name:"MatchVariable"}})],V.prototype,"matchVariable",void 0),a([n({types:ae,json:{types:ae,name:"UnionDimension"}})],V.prototype,"unionDimension",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],V.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],V.prototype,"type",void 0),V=a([v("esri.layers.support.RasterFunctionProperties")],V);const ci=V,he=new le({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends S{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};a([n({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),a([n({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"description",void 0),a([n({type:si,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),a([n({type:he.apiValues,json:{type:[0,1,2],read:he.read,write:he.write}})],I.prototype,"functionType",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"group",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"help",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"name",void 0),a([n({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"tag",void 0),a([n({type:ci,json:{write:!0}})],I.prototype,"properties",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),a([n({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=a([v("esri.layers.support.RasterFunctionTemplate")],I);const mt=I;var Te;const ne=new Set(["raster","raster2","dem","fillraster"]),se=new Set(["rasters"]),Qe=e=>e?.rasterFunction?D.fromJSON(e):e,Ae=e=>e&&e instanceof D?e.toJSON():e,Ne=e=>e?.functionName&&!e.declaredClass,Xe=e=>Ne(e)?new D(e):e,ui=e=>{if(e==null)return null;e=w(e);const t={};for(const i of Object.keys(e))ne.has(i.toLowerCase())?t[i]=Qe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(Qe):t[i]=e[i];return t},di={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:mt}},json:{write:!0,name:"rasterFunctionDefinition"}};let D=Te=class extends S{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>ne.has(i.toLowerCase())&&Ne(e[i]))||t.some(i=>se.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(r=>Ne(r)))){e=w(e);for(const i of t)ne.has(i.toLowerCase())?e[i]=Xe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(r=>Xe(r)))}}this._set("functionArguments",e)}readFunctionArguments(e){return ui(e)}writeFunctionArguments(e,t,i){const r={};for(const o of Object.keys(e))ne.has(o.toLowerCase())?r[o]=Ae(e[o]):se.has(o.toLowerCase())&&Array.isArray(e[o])?r[o]=e[o].map(Ae):r[o]=Ae(e[o]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i?.length&&i[0].name!=="None"?i[0].name:t.rasterFunction||t.rasterFunctionDefinition?.name)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?mt.fromJSON(e):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new Te({functionName:this.functionName,functionArguments:w(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:w(this.rasterFunctionDefinition)})}};a([n({json:{type:Object,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",null),a([x("functionArguments")],D.prototype,"readFunctionArguments",null),a([ce("functionArguments")],D.prototype,"writeFunctionArguments",null),a([n({json:{type:String,write:{target:"rasterFunction"}}})],D.prototype,"functionName",void 0),a([x("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],D.prototype,"readFunctionName",null),a([J({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1,default:"unknown"})],D.prototype,"outputPixelType",void 0),a([n({type:String,json:{read:!0,write:!0}})],D.prototype,"variableName",void 0),a([n()],D.prototype,"rasterFunctionDefinition",null),a([n(di)],D.prototype,"functionDefinition",void 0),a([n()],D.prototype,"hasClipFunction",null),D=Te=a([v("esri.layers.support.RasterFunction")],D);const gt=D;var Le;const q=$()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),xe=$()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function pi(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return xe.fromJSON(t)}let g=Le=class extends S{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}readMethod(e,t){return pi(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,i){e!=null&&(e=e.filter(({variableName:r,dimensionName:o})=>r&&r!=="*"||o)).length&&(t[i]=e.map(r=>r.toJSON()))}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator?.toLowerCase(),o=i||(r?q.toJSON(r):null);return q.fromJSON(o)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Le({ascending:this.ascending,itemRasterFunction:w(this.itemRasterFunction),lockRasterIds:w(this.lockRasterIds),method:this.method,multidimensionalDefinition:w(this.multidimensionalDefinition),objectIds:w(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:w(this.viewpoint),where:this.where})}};a([n({type:Boolean,json:{write:!0}})],g.prototype,"ascending",void 0),a([x("ascending",["ascending","sortAscending"])],g.prototype,"readAscending",null),a([n({type:gt,json:{name:"itemRenderingRule",write:!0}})],g.prototype,"itemRasterFunction",void 0),a([n({type:[R],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],g.prototype,"lockRasterIds",void 0),a([n({type:String,json:{type:xe.jsonValues,write:{target:"mosaicMethod",writer:xe.write}}})],g.prototype,"method",void 0),a([x("method",["mosaicMethod","defaultMosaicMethod"])],g.prototype,"readMethod",null),a([n({type:[tt],json:{write:!0}})],g.prototype,"multidimensionalDefinition",void 0),a([ce("multidimensionalDefinition")],g.prototype,"writeMultidimensionalDefinition",null),a([n({type:[R],json:{name:"fids",write:!0}})],g.prototype,"objectIds",void 0),a([n({json:{type:q.jsonValues,read:{reader:q.read},write:{target:"mosaicOperation",writer:q.write}}})],g.prototype,"operation",void 0),a([x("operation",["mosaicOperation","mosaicOperator"])],g.prototype,"readOperation",null),a([n({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],g.prototype,"sortField",void 0),a([n({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],g.prototype,"sortValue",void 0),a([jt("sortValue")],g.prototype,"castSortValue",null),a([n({type:_,json:{write:!0}})],g.prototype,"viewpoint",void 0),a([n({type:String,json:{write:!0}})],g.prototype,"where",void 0),g=Le=a([v("esri.layers.support.MosaicRule")],g);const Mi=g;var Be;const mi={base:xt,key:"type",typeMap:{extent:fe,polygon:Bt}};let G=Be=class extends S{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(r=>{if(!r.dimensionName)return;let o,s;if(Array.isArray(r.values[0])){const l=r.values;o=l[0][0],s=l[r.values.length-1][1]}else{const l=r.values;o=l[0],s=l[r.values.length-1]}if(t.has(r.dimensionName)){const l=t.get(r.dimensionName);l[0]=Math.min(o,l[0]),l[1]=Math.max(s,l[1])}else t.set(r.dimensionName,[o,s])});const i=[];for(const r of t)i.push({name:r[0],extent:r[1]});return i}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(i=>{i.variableName&&t.add(i.variableName)}),[...t]}clone(){const e=this.subsetDefinitions?.map(i=>i.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Be({areaOfInterest:t,subsetDefinitions:e})}};a([n({types:mi,json:{read:et,write:!0}})],G.prototype,"areaOfInterest",void 0),a([n({readOnly:!0})],G.prototype,"dimensions",null),a([n({readOnly:!0})],G.prototype,"variables",null),a([n({type:[tt],json:{write:!0}})],G.prototype,"subsetDefinitions",void 0),G=Be=a([v("esri.layers.support.MultidimensionalSubset")],G);const _i=G;class Ki{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await kt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return r?new Z(r):null}computeStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},i)}async decode(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("decode",t,i);return r?new Z(r):null}async symbolize(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={extent:t.extent?.toJSON(),pixelBlock:t.pixelBlock?.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},o=await this._workerThread.invoke("symbolize",r,i);return o?new Z(o):null}async updateSymbolizer(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:r},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("process",{extent:t.extent?.toJSON(),primaryPixelSizes:t.primaryPixelSizes?.map(o=>o!=null?o.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return r?new Z(r):null}async stretch(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},o=await this._workerThread.invoke("stretch",r,i);return o?new Z(o):null}async split(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel,useBilinear:t.useBilinear},o=await this._workerThread.invoke("split",r,i);return o&&o.forEach((s,l)=>{o.set(l,s?Z.fromJSON(s):null)}),o}async clipTile(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={...t,pixelBlock:t.pixelBlock.toJSON()},o=await this._workerThread.invoke("clipTile",r,i);return o?Z.fromJSON(o):null}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",r,i)}async mosaicAndTransform(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...t,srcPixelBlocks:t.srcPixelBlocks.map(s=>s!=null?s.toJSON():null)},o=await this._workerThread.invoke("mosaicAndTransform",r,i);return{pixelBlock:o.pixelBlock?new Z(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:o,simulationSettings:s}=t,l=await this._workerThread.invoke("createFlowMesh",{meshType:o,flowData:r,simulationSettings:s},{...i,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t.datumTransformation!=null?t.datumTransformation.steps.map(l=>({wkid:l.wkid,wkt:l.wkt,isInverse:l.isInverse})):null,o=t.rasterTransform!=null?t.rasterTransform.toJSON():null,s={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:r,rasterTransform:o,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,i)}}const gi=.25,yi=ct.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),qe=ct.fromJSON(Vt[0]),yt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Qi(e){return e.presetRenderers?.find(({method:t,value:i})=>t==="raster-function-template"?i===e.rasterFunctionName:t==="variable"&&i===e.variableName)}function Xi(e,t){const{attributeTable:i,colormap:r}=e;if(ke(e)){const o=Si(e);if(o!=null)return o}if(t?.rasterFunctionColorRamp){const o=Ye(e,t);return o.colorRamp=t.rasterFunctionColorRamp,o}if(r!=null){const o=bi(e);if(o!=null)return o}if(i!=null){const o=fi(e);if(o!=null)return o}return Ye(e,t)}function qi(e,t=!1){const i=["raster-stretch"];return st(e,t)&&i.push("raster-colormap"),nt(e)&&i.push("unique-value"),Ot(e,t)&&i.push("class-breaks"),Ft(e)&&i.push("raster-shaded-relief"),ke(e)&&i.push("vector-field"),_t(e)&&i.push("flow"),i}function Yi(e){return e.datasetFormat==="Function"&&e.rasterFunction.functionName==="Colormap"?e.rasterFunction.colorRamp:void 0}function $i(e,t,i){const r=["nearest","bilinear","cubic","majority"],o=i?.toLowerCase().replace("bicubic","cubic"),s=r.find(l=>l===o);return t==="Map"?s??"bilinear":e.dataType==="standard-time"?s??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?s==="nearest"||s==="majority"?s:"nearest":s??"bilinear"}function Ye(e,t){e=Ii(e,t?.variableName);const{bandCount:i}=e;let{bandIds:r,stretchType:o}=t||{};r?.some(M=>M>=i)&&(r=null);let s=e.statistics,l=e.histograms;i>1?(r=r?.length?r:wi(e),s=s==null?null:r?.map(M=>s[M]),l=l==null?null:r?.map(M=>l[M])):r=[0],o==null&&(o=Ai(e)),t?.includeStatisticsInStretch&&(o==="percent-clip"||o==="histogram-equalization")&&e.statistics?.length&&(o="min-max");let u=!1;switch(o){case"none":u=!1;break;case"percent-clip":u=!l?.length;break;default:u=!s?.length}const{dataType:y}=e,c=r?.length===1&&yt.has(y)?yi:null,h=new Ze({stretchType:o,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return o==="percent-clip"?h.maxPercent=h.minPercent=gi:o==="standard-deviation"&&(h.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!t?.includeStatisticsInStretch||(o==="percent-clip"?h.histograms=l:o!=="min-max"&&o!=="standard-deviation"||(h.statistics=s)),h}function Ii(e,t){const{multidimensionalInfo:i}=e;if(!t||!i)return e;const r=i.variables.find(o=>o.name===t);if(!r)return e;if(e=e.clone(),r){const{statistics:o,histograms:s}=r;o?.length&&(e.statistics=o.map(l=>({min:l.min,max:l.max,avg:l.avg,stddev:l.stddev}))),s?.length&&(e.histograms=s)}return e}function wi(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:i}=e;let r;if(i.length===t){const{red:o,green:s,blue:l,nir:u}=hi(i);o!=null&&s!=null&&l!=null?r=[o,s,l]:u!=null&&o!=null&&s!=null&&(r=[u,o,s])}return!r&&t>=3&&(r=[0,1,2]),r}function hi(e){const t={};for(let i=0;i=410&&s<=480&&l>=480&&l<=540?t.blue=i:t.green==null&&s>=490&&s<=560&&l>=560&&l<=610?t.green=i:t.red==null&&s>=595&&s<=670&&l>=660&&l<=730?t.red=i:t.nir==null&&s>=700&&s<=860&&l>=800&&l<=950&&(t.nir=i)}}return t}function Ai(e){let t="percent-clip";const{pixelType:i,dataType:r,histograms:o,statistics:s,multidimensionalInfo:l}=e,u=yt.has(r)||r==="generic"&&l!=null;return i!=="u8"||r!=="processed"&&o!=null&&s!=null?i==="u8"||r==="elevation"||u?t="min-max":o!=null?t="percent-clip":s!=null&&(t="min-max"):t="none",t}function fi(e,t,i,r){if(!nt(e,t))return null;const{attributeTable:o,statistics:s}=e,l=It(o,t),u=Y(o,"red"),y=Y(o,"green"),c=Y(o,"blue"),h=new rt,M=[],B=new Set,N=!!(u&&y&&c);if(o!=null)o.features.forEach(d=>{const m=d.attributes[l.name];if(!B.has(d.attributes[l.name])&&m!=null){B.add(m);const L=N&&(u.type==="single"||u.type==="double")&&(y.type==="single"||y.type==="double")&&(c.type==="single"||c.type==="double")&&!o.features.some(W=>W.attributes[u.name]>1||W.attributes[y.name]>1||W.attributes[c.name]>1),z=L?255:1;M.push(new _e({value:d.attributes[l.name],label:d.attributes[l.name]+"",symbol:new Oe({style:"solid",outline:null,color:new b(N?[d.attributes[u.name]*z,d.attributes[y.name]*z,d.attributes[c.name]*z,1]:[0,0,0,0])})}))}});else if(s?.[0])for(let d=s[0].min;d<=s[0].max;d++)M.push(new _e({value:d,label:d.toString(),symbol:new Oe({style:"solid",outline:null,color:new b([0,0,0,0])})}));if(M.sort((d,m)=>d.value&&typeof d.value.valueOf()=="string"?0:d.value>m.value?1:-1),!N){const d=ot(qe,{numColors:M.length});M.forEach((m,L)=>m.symbol.color=new b(d[L].slice(1,4))),h.colorRamp=qe}return new He({field:l.name,uniqueValueInfos:M,authoringInfo:h})}function It(e,t,i){let r;return e!=null?(r=t?e.fields.find(o=>t.toLowerCase()===o.name.toLowerCase()):Di(e.fields),r||(i||(r=e.fields.find(o=>o.type==="string")),r||(r=Y(e,"value")))):r=new Pt({name:"value"}),r}function Di(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function bi(e){if(!st(e))return null;let t;const{attributeTable:i,colormap:r}=e;if(i!=null){const o=Y(i,"value"),s=It(i,null,!0);s.type==="string"&&(t={},i.features.forEach(l=>{const u=l.attributes;t[u[o.name]]=s?u[s.name]:u[o.name]}))}return Re.createFromColormap(r,t)}const vi=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Si(e){if(!ke(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:o,maxMagnitude:s}=ji(e.dataType,e.statistics);t=[new Ue({field:"Magnitude",minSize:10,maxSize:40,minDataValue:o,maxDataValue:s})]}const i=e.multidimensionalInfo!=null?vi.get(e.multidimensionalInfo.variables[0].unit):void 0,r=new Ee({visualVariables:t,inputUnit:i,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function $e(e){return{color:e.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function er(e){if(e.type==="uniqueValue"){const t=e.uniqueValueInfos;return t?.[0].symbol?.symbolLayers?.length&&(e.uniqueValueInfos=t?.map(i=>({value:i.value,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}if(e.type==="classBreaks"){const t=e.classBreakInfos;return t[0].symbol?.symbolLayers?.length&&(e.classBreakInfos=t.map(i=>({classMinValue:i.classMinValue,classMaxValue:i.classMaxValue,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}return e}function ji(e,t){let i,r;if(e==="vector-magdir")i=t[0].min,r=t[0].max;else{const o=t[0].min,s=t[0].max,l=t[1].min,u=t[1].max;i=0,r=Math.max(Math.abs(o),Math.abs(l),Math.abs(s),Math.abs(u))}return{minMagnitude:i,maxMagnitude:r}}var ze;let U=ze=class extends S{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){e!=null&&(t.geometryType=zt(e),t[i]=e.toJSON())}clone(){return new ze(w({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};a([n({types:Ct,json:{read:et}})],U.prototype,"geometry",void 0),a([ce("geometry")],U.prototype,"writeGeometry",null),a([n({type:Mi,json:{write:!0}})],U.prototype,"mosaicRule",void 0),a([n({type:gt,json:{write:!0,name:"renderingRule"}})],U.prototype,"rasterFunction",void 0),a([n({type:_,json:{write:!0}})],U.prototype,"pixelSize",void 0),a([n({json:{write:!0}})],U.prototype,"raster",void 0),a([n({type:Qt,json:{read:{source:"time"},write:{target:"time"}}})],U.prototype,"timeExtent",void 0),U=ze=a([v("esri.rest.support.ImageHistogramParameters")],U);const tr=U;async function wt(e,t,i){const r=Xt(e),{rasterFunction:o,sourceJSON:s}=t||{},l=o?JSON.stringify(o.rasterFunctionDefinition||o):null,u=qt({...r.query,renderingRule:l,f:"json"}),y=Yt(u,i);e=r.path;const c=s||await O(e,y).then(C=>C.data),h=c.hasRasterAttributeTable?O(`${e}/rasterAttributeTable`,y):null,M=c.hasColormap?O(`${e}/colormap`,y):null,B=c.hasHistograms?O(`${e}/histograms`,y):null,N=c.currentVersion>=10.3?O(`${e}/keyProperties`,y):null,d=c.hasMultidimensions?O(`${e}/multidimensionalInfo`,y):null,m=await Promise.allSettled([h,M,B,N,d]);let L=null;if(c.minValues&&c.minValues.length===c.bandCount){L=[];for(let C=0;C{C.statistics?.length&&C.statistics.forEach(ee=>{ee.avg=ee.mean,ee.stddev=ee.standardDeviation})});const{defaultVariable:Me,serviceDataType:me}=c;Me&&Me!==K.DefaultVariable&&(K.DefaultVariable=Me),me?.includes("esriImageServiceDataTypeVector")&&!me.includes(K.DataType)&&(K.DataType=me.replace("esriImageServiceDataType",""));let ge=c.noDataValue;c.noDataValues?.length&&c.noDataValues.some(C=>C!==ge)&&(ge=c.noDataValues);const Dt=c.transposeInfo?new Jt({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new _({x:c.extent.xmin,y:c.extent.ymax,spatialReference:de}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(W,Pe))/Math.LN2-8)),transposeInfo:c.transposeInfo}):void 0;return new Wt({width:W,height:Pe,bandCount:c.bandCount,extent:fe.fromJSON(c.extent),spatialReference:de,pixelSize:new _({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:de}),pixelType:c.pixelType.toLowerCase(),statistics:L,attributeTable:ht,colormap:At,histograms:ft,keyProperties:K,noDataValue:ge,multidimensionalInfo:pe,storageInfo:Dt})}function ir(e,t,i){return wt(e,{sourceJSON:t},i)}function rr(e,t,i){return wt(e,{rasterFunction:t},i)}function ar(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}let P=class extends Tt(S){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};a([n({type:String,json:{write:!0}})],P.prototype,"name",void 0),a([n({type:["raster-function-template","variable","none"],json:{write:!0}}),J({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],P.prototype,"method",void 0),a([n({type:String,json:{write:!0}})],P.prototype,"value",void 0),a([n({type:[R],json:{write:!0}})],P.prototype,"bandIds",void 0),a([n({types:je,json:{write:!0,origins:{"web-scene":{types:Ce,write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],P.prototype,"renderer",void 0),P=a([v("esri.renderers.support.RasterPresetRenderer")],P);const Ci=P,or=e=>{let t=class extends e{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return a([n({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],t.prototype,"activePresetRendererName",void 0),a([n({type:[Ci],json:{name:"layerDefinition.presetRenderers",write:!0}})],t.prototype,"presetRenderers",void 0),t=a([v("esri.layers.mixins.RasterPresetRendererMixin")],t),t};export{_i as A,Yi as C,ir as E,Ii as I,or as J,Mi as M,rr as P,Xi as S,$i as T,ar as V,tr as Z,Wi as a,er as b,Ce as c,Fi as d,Ki as f,qi as j,gt as k,je as l,Oi as p,we as u,Qi as v,wi as w}; diff --git a/main/assets/RasterPresetRendererMixin-D6W9pUY6-Q9Qi8PwW.js b/main/assets/RasterPresetRendererMixin-D6W9pUY6-Q9Qi8PwW.js new file mode 100644 index 000000000..8cf22e295 --- /dev/null +++ b/main/assets/RasterPresetRendererMixin-D6W9pUY6-Q9Qi8PwW.js @@ -0,0 +1 @@ +import{aK as le,ar as b,v as a,S as n,eo as ye,bz as J,i as v,bB as R,a0 as x,ac as ce,P as w,w as _,bi as bt,eD as vt,eB as St,fc as Ie,d2 as $,ad as jt,g as et,af as Ct,aa as Tt,e as S,fd as Nt,a1 as Lt,d as xt,n as fe,l as Bt,bK as zt,b0 as Ut,eC as Oe,f as O,J as Ht,o as j}from"./main-C7yV2j71.js";import{g as tt}from"./multidimensionalUtils-BwTugeu7-LevYq4ep.js";import{q as kt}from"./workers-PiCjreoO-DqI62TYf.js";import{o as k,a as Rt,w as Zt,U as Et,D as Z}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{y as Pt}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{$ as it,h as rt,G as Ue,M as at,o as ue,t as Fe,d as He,P as _e}from"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{Y as oe,n as Vt,i as ot,q as Gt,_ as ke,y as nt,w as st,c as Jt,W as Wt,z as Ot,C as Ft,j as _t}from"./RasterSymbolizer-BVys6HkM-BxgX8zwh.js";import{w as Kt}from"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import{g as lt,c as ct,v as ut}from"./colorRamps-q0bZVhs2-DeDskCk_.js";import{k as Qt}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{y as Xt,n as qt,a as Yt}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{O as $t}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{B as ei}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{getAllSizes as ti,getRotationAngle as ii}from"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import{I as ri,J as ai}from"./utils-DPtQ14k3-BW98GOs_.js";var De;const te=new le({flow_from:"flow-from",flow_to:"flow-to"});let A=De=class extends it(S){constructor(e){super(e),this.density=.8,this.color=new b([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,smoothing:s,flowRepresentation:l,trailCap:u,background:y}=this,c=this.color.clone(),h=(this.visualVariables||[]).map(N=>N.clone()),M=this.authoringInfo?.clone(),B=this.legendOptions?.clone();return new De({density:e,color:c,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,trailCap:u,background:y,smoothing:s,flowRepresentation:l,visualVariables:h,authoringInfo:M,legendOptions:B})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};a([n({type:Number,json:{write:!0}})],A.prototype,"density",void 0),a([n({type:b,json:{write:{allowNull:!0}}})],A.prototype,"color",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"maxPathLength",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"trailWidth",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"flowSpeed",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"trailLength",void 0),a([n({type:Number,cast:ye,json:{write:!1}})],A.prototype,"smoothing",void 0),a([n({type:te.apiValues,json:{type:te.jsonValues,read:{reader:te.read},write:{writer:te.write}}})],A.prototype,"flowRepresentation",void 0),a([J({flowRenderer:"flow"})],A.prototype,"type",void 0),a([n({type:rt,json:{write:!0}})],A.prototype,"authoringInfo",void 0),a([n({type:Kt,json:{write:!0}})],A.prototype,"legendOptions",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"trailCap",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"background",void 0),A=De=a([v("esri.renderers.FlowRenderer")],A);const dt=A;let F=class extends S{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};a([n({type:Number,json:{write:!0}})],F.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],F.prototype,"label",void 0),a([n({type:b,json:{type:[R],write:!0}})],F.prototype,"color",void 0),F=a([v("esri.renderers.support.ColormapInfo")],F);const pt=F;var Q;let X=Q=class extends S{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const i=e[0].length===5,r=[...e].sort((o,s)=>o[0]-s[0]).map(o=>pt.fromJSON({value:o[0],color:i?o.slice(1,5):o.slice(1,4).concat([255]),label:t?t[o[0]]??"":o[0]}));return new Q({colormapInfos:r})}static createFromColorramp(e){const t=ot(e);return Q.createFromColormap(t)}clone(){return new Q({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};a([n({type:[pt],json:{write:!0}})],X.prototype,"colormapInfos",void 0),a([J({rasterColormap:"raster-colormap"})],X.prototype,"type",void 0),X=Q=a([v("esri.renderers.RasterColormapRenderer")],X);const Re=X;var be;let T=be=class extends S{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return ut(e)}clone(){return new be({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:w(this.colorRamp)})}};a([n({type:Number,json:{write:!0}})],T.prototype,"altitude",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"azimuth",void 0),a([n({types:lt,json:{write:!0}})],T.prototype,"colorRamp",void 0),a([x("colorRamp")],T.prototype,"readColorRamp",null),a([n({type:["traditional","multi-directional"],json:{write:!0}})],T.prototype,"hillshadeType",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizePower",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizeFactor",void 0),a([n({type:["none","adjusted"],json:{write:!0}})],T.prototype,"scalingType",void 0),a([J({rasterShadedRelief:"raster-shaded-relief"})],T.prototype,"type",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"zFactor",void 0),T=be=a([v("esri.renderers.RasterShadedReliefRenderer")],T);const Mt=T;var ve;let p=ve=class extends S{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ut(e)}get statistics(){return this._get("statistics")}set statistics(e){Nt(Lt.getLogger(this),"statistics",{replacement:"customStatistics",version:"4.31",warnOnce:!0}),this._set("statistics",e)}get customStatistics(){const e=this.statistics;return e&&Array.isArray(e[0])?e.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]})):e}set customStatistics(e){this._set("statistics",e?.map(t=>[t.min,t.max,t.avg??0,t.stddev??1]))}readCustomStatistics(e){return e?.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]}))}writeCustomStatistics(e,t,i){e?.length&&(t[i]=e.map(r=>[r.min,r.max,r.avg??0,r.stddev??1]))}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=Gt[i]),oe.read(i)}clone(){return new ve({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:w(this.statistics),customStatistics:w(this.customStatistics),gamma:w(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:w(this.colorRamp),histograms:w(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};a([n({types:lt,json:{write:!0}})],p.prototype,"colorRamp",void 0),a([x("colorRamp")],p.prototype,"readColorRamp",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"computeGamma",void 0),a([n({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],p.prototype,"dynamicRangeAdjustment",void 0),a([n({type:[Number],json:{write:!0}})],p.prototype,"gamma",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"maxPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"minPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"numberOfStandardDeviations",void 0),a([n({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],p.prototype,"outputMax",void 0),a([n({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],p.prototype,"outputMin",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"sigmoidStrengthLevel",void 0),a([n({})],p.prototype,"statistics",null),a([n()],p.prototype,"histograms",void 0),a([n({json:{type:[[Number]],name:"statistics",write:!0}})],p.prototype,"customStatistics",null),a([x("customStatistics")],p.prototype,"readCustomStatistics",null),a([ce("customStatistics")],p.prototype,"writeCustomStatistics",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"useGamma",void 0),a([n({type:oe.apiValues,json:{type:oe.jsonValues,write:oe.write}})],p.prototype,"stretchType",void 0),a([x("stretchType",["stretchType"])],p.prototype,"readStretchType",null),a([J({rasterStretch:"raster-stretch"})],p.prototype,"type",void 0),p=ve=a([v("esri.renderers.RasterStretchRenderer")],p);const Ze=p;var Se;const Ke=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),ie=new le({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),re=new le({flow_from:"flow-from",flow_to:"flow-to"});let f=Se=class extends it(S){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return Ke.has(e)?k.fromJSON(e):null}readOutputUnit(e,t){return Ke.has(e)?k.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,i=this._createStyleRenderer(e);return i.field=t,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new Ue({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new at({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new Se({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:w(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){const r=new Array,o=Rt(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,l=t?Zt(e.pixelBlock,"vector-uv",s,o):Et(e.pixelBlock,"vector-magdir",o);if(l==null)return r;const u=e.extent,y=l.mask!=null&&l.mask.length>0;let c=0;const h=(u.xmax-u.xmin)/l.width,M=(u.ymax-u.ymin)/l.height;for(let B=0;BL.intersects(d));if((!y||l.mask[c])&&!m){const L={Magnitude:l.pixels[0][c],Direction:l.pixels[1][c]},z=new bt({geometry:new _({x:d.x,y:d.y,spatialReference:u.spatialReference}),attributes:L});z.symbol=this._getVisualVariablesAppliedSymbol(z),r.push(z)}}return r}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new vt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new St({width:0}),size:20,color:e||new b([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const t=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,r=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(o=>ri(t,ti([o],e))),r&&r.length){const o=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+o,this.rotationVariables.forEach(s=>ai(t,ii(s,e),s.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new ue(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.28084;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=2.23694;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.6;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new b([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const r=this.sizeVariables[0].minDataValue,o=this.sizeVariables[0].maxDataValue;if(r&&o){const s=(o-r)/5;t=Array.from(Array(6).keys()).map(l=>r+s*l)}}const i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:Ie.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(o=>5*o),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=Ie.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),r=e.map((o,s)=>{let l;if(s!==e.length-1)if(s===0)l={minValue:o,maxValue:e[s+1],symbol:i};else{const u=Ie.fromJSON({type:"esriPMS",imageData:t[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});l={minValue:o,maxValue:e[s+1],symbol:u}}return new Fe(l)});return{defaultSymbol:i,classBreakInfos:r}}_getClassBreaks(e,t){return t.map((i,r)=>new Fe({minValue:e[r],maxValue:e[r+1],symbol:this._getDefaultSymbol(new b(i))}))}};a([n({type:["Magnitude"],json:{write:!0}})],f.prototype,"attributeField",void 0),a([n({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],f.prototype,"flowRepresentation",void 0),a([n({type:["geographic","arithmetic"],json:{write:!0}})],f.prototype,"rotationType",void 0),a([n({type:ie.apiValues,json:{type:ie.jsonValues,read:{reader:ie.read},write:{writer:ie.write}}})],f.prototype,"style",void 0),a([n({json:{write:!0}})],f.prototype,"symbolTileSize",void 0),a([n({type:k.apiValues,json:{type:k.jsonValues,write:{writer:k.write}}})],f.prototype,"inputUnit",void 0),a([x("inputUnit")],f.prototype,"readInputUnit",null),a([n({type:k.apiValues,json:{type:k.jsonValues,read:{reader:k.read},write:{writer:k.write}}})],f.prototype,"outputUnit",void 0),a([x("outputUnit")],f.prototype,"readOutputUnit",null),a([J({vectorField:"vector-field"})],f.prototype,"type",void 0),a([n({type:ue})],f.prototype,"styleRenderer",null),a([n({type:Ue})],f.prototype,"sizeVariables",null),a([n({type:at})],f.prototype,"rotationVariables",null),f=Se=a([v("esri.renderers.VectorFieldRenderer")],f);const Ee=f,je={key:"type",base:null,typeMap:{"unique-value":He,"class-breaks":ue,"raster-colormap":Re,"raster-stretch":Ze,"vector-field":Ee,"raster-shaded-relief":Mt,flow:dt}},Ce={...je,typeMap:{...je.typeMap}};delete Ce.typeMap["vector-field"],delete Ce.typeMap.flow;const oi={uniqueValue:He,classBreaks:ue,rasterStretch:Ze,rasterColormap:Re,vectorField:Ee,rasterShadedRelief:Mt,flowRenderer:dt};function ni(e){return e&&oi[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const r=e.authoringInfo||{classificationMethod:""};r.classificationMethod=e.classificationMethod,e.authoringInfo=r}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=ni(e);if(i){const r=new i;return r.read(e,t),r}return t?.messages&&e&&t.messages.push(new Ut("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}const Oi=$()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),Fi=$()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),we=$()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let E=class extends S{constructor(){super(...arguments),this.pixelType="unknown"}};a([n({type:String,json:{write:!0}})],E.prototype,"name",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"description",void 0),a([n({type:R,json:{type:R,write:!0,name:"_object_id"}})],E.prototype,"id",void 0),a([n({type:String,json:{type:we.jsonValues,read:we.read,write:we.write}})],E.prototype,"pixelType",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"type",void 0),E=a([v("esri.layers.support.RasterFunctionInfo")],E);const si=E;let H=class extends S{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};a([n({type:String,json:{write:!0}})],H.prototype,"name",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],H.prototype,"id",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isDataset",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isPublic",void 0),a([n({json:{write:!0}})],H.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],H.prototype,"type",void 0),H=a([v("esri.layers.support.RasterFunctionVariable")],H);const li=H,ae={key:"type",base:null,typeMap:{RasterFunctionVariable:li}};let V=class extends S{};a([n({types:ae,json:{types:ae,name:"MatchVariable"}})],V.prototype,"matchVariable",void 0),a([n({types:ae,json:{types:ae,name:"UnionDimension"}})],V.prototype,"unionDimension",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],V.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],V.prototype,"type",void 0),V=a([v("esri.layers.support.RasterFunctionProperties")],V);const ci=V,he=new le({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends S{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};a([n({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),a([n({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"description",void 0),a([n({type:si,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),a([n({type:he.apiValues,json:{type:[0,1,2],read:he.read,write:he.write}})],I.prototype,"functionType",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"group",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"help",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"name",void 0),a([n({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"tag",void 0),a([n({type:ci,json:{write:!0}})],I.prototype,"properties",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),a([n({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=a([v("esri.layers.support.RasterFunctionTemplate")],I);const mt=I;var Te;const ne=new Set(["raster","raster2","dem","fillraster"]),se=new Set(["rasters"]),Qe=e=>e?.rasterFunction?D.fromJSON(e):e,Ae=e=>e&&e instanceof D?e.toJSON():e,Ne=e=>e?.functionName&&!e.declaredClass,Xe=e=>Ne(e)?new D(e):e,ui=e=>{if(e==null)return null;e=w(e);const t={};for(const i of Object.keys(e))ne.has(i.toLowerCase())?t[i]=Qe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(Qe):t[i]=e[i];return t},di={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:mt}},json:{write:!0,name:"rasterFunctionDefinition"}};let D=Te=class extends S{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>ne.has(i.toLowerCase())&&Ne(e[i]))||t.some(i=>se.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(r=>Ne(r)))){e=w(e);for(const i of t)ne.has(i.toLowerCase())?e[i]=Xe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(r=>Xe(r)))}}this._set("functionArguments",e)}readFunctionArguments(e){return ui(e)}writeFunctionArguments(e,t,i){const r={};for(const o of Object.keys(e))ne.has(o.toLowerCase())?r[o]=Ae(e[o]):se.has(o.toLowerCase())&&Array.isArray(e[o])?r[o]=e[o].map(Ae):r[o]=Ae(e[o]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i?.length&&i[0].name!=="None"?i[0].name:t.rasterFunction||t.rasterFunctionDefinition?.name)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?mt.fromJSON(e):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new Te({functionName:this.functionName,functionArguments:w(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:w(this.rasterFunctionDefinition)})}};a([n({json:{type:Object,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",null),a([x("functionArguments")],D.prototype,"readFunctionArguments",null),a([ce("functionArguments")],D.prototype,"writeFunctionArguments",null),a([n({json:{type:String,write:{target:"rasterFunction"}}})],D.prototype,"functionName",void 0),a([x("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],D.prototype,"readFunctionName",null),a([J({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1,default:"unknown"})],D.prototype,"outputPixelType",void 0),a([n({type:String,json:{read:!0,write:!0}})],D.prototype,"variableName",void 0),a([n()],D.prototype,"rasterFunctionDefinition",null),a([n(di)],D.prototype,"functionDefinition",void 0),a([n()],D.prototype,"hasClipFunction",null),D=Te=a([v("esri.layers.support.RasterFunction")],D);const gt=D;var Le;const q=$()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),xe=$()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function pi(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return xe.fromJSON(t)}let g=Le=class extends S{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}readMethod(e,t){return pi(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,i){e!=null&&(e=e.filter(({variableName:r,dimensionName:o})=>r&&r!=="*"||o)).length&&(t[i]=e.map(r=>r.toJSON()))}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator?.toLowerCase(),o=i||(r?q.toJSON(r):null);return q.fromJSON(o)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Le({ascending:this.ascending,itemRasterFunction:w(this.itemRasterFunction),lockRasterIds:w(this.lockRasterIds),method:this.method,multidimensionalDefinition:w(this.multidimensionalDefinition),objectIds:w(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:w(this.viewpoint),where:this.where})}};a([n({type:Boolean,json:{write:!0}})],g.prototype,"ascending",void 0),a([x("ascending",["ascending","sortAscending"])],g.prototype,"readAscending",null),a([n({type:gt,json:{name:"itemRenderingRule",write:!0}})],g.prototype,"itemRasterFunction",void 0),a([n({type:[R],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],g.prototype,"lockRasterIds",void 0),a([n({type:String,json:{type:xe.jsonValues,write:{target:"mosaicMethod",writer:xe.write}}})],g.prototype,"method",void 0),a([x("method",["mosaicMethod","defaultMosaicMethod"])],g.prototype,"readMethod",null),a([n({type:[tt],json:{write:!0}})],g.prototype,"multidimensionalDefinition",void 0),a([ce("multidimensionalDefinition")],g.prototype,"writeMultidimensionalDefinition",null),a([n({type:[R],json:{name:"fids",write:!0}})],g.prototype,"objectIds",void 0),a([n({json:{type:q.jsonValues,read:{reader:q.read},write:{target:"mosaicOperation",writer:q.write}}})],g.prototype,"operation",void 0),a([x("operation",["mosaicOperation","mosaicOperator"])],g.prototype,"readOperation",null),a([n({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],g.prototype,"sortField",void 0),a([n({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],g.prototype,"sortValue",void 0),a([jt("sortValue")],g.prototype,"castSortValue",null),a([n({type:_,json:{write:!0}})],g.prototype,"viewpoint",void 0),a([n({type:String,json:{write:!0}})],g.prototype,"where",void 0),g=Le=a([v("esri.layers.support.MosaicRule")],g);const Mi=g;var Be;const mi={base:xt,key:"type",typeMap:{extent:fe,polygon:Bt}};let G=Be=class extends S{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(r=>{if(!r.dimensionName)return;let o,s;if(Array.isArray(r.values[0])){const l=r.values;o=l[0][0],s=l[r.values.length-1][1]}else{const l=r.values;o=l[0],s=l[r.values.length-1]}if(t.has(r.dimensionName)){const l=t.get(r.dimensionName);l[0]=Math.min(o,l[0]),l[1]=Math.max(s,l[1])}else t.set(r.dimensionName,[o,s])});const i=[];for(const r of t)i.push({name:r[0],extent:r[1]});return i}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(i=>{i.variableName&&t.add(i.variableName)}),[...t]}clone(){const e=this.subsetDefinitions?.map(i=>i.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Be({areaOfInterest:t,subsetDefinitions:e})}};a([n({types:mi,json:{read:et,write:!0}})],G.prototype,"areaOfInterest",void 0),a([n({readOnly:!0})],G.prototype,"dimensions",null),a([n({readOnly:!0})],G.prototype,"variables",null),a([n({type:[tt],json:{write:!0}})],G.prototype,"subsetDefinitions",void 0),G=Be=a([v("esri.layers.support.MultidimensionalSubset")],G);const _i=G;class Ki{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await kt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return r?new Z(r):null}computeStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},i)}async decode(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("decode",t,i);return r?new Z(r):null}async symbolize(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={extent:t.extent?.toJSON(),pixelBlock:t.pixelBlock?.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},o=await this._workerThread.invoke("symbolize",r,i);return o?new Z(o):null}async updateSymbolizer(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:r},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("process",{extent:t.extent?.toJSON(),primaryPixelSizes:t.primaryPixelSizes?.map(o=>o!=null?o.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return r?new Z(r):null}async stretch(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},o=await this._workerThread.invoke("stretch",r,i);return o?new Z(o):null}async split(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel,useBilinear:t.useBilinear},o=await this._workerThread.invoke("split",r,i);return o&&o.forEach((s,l)=>{o.set(l,s?Z.fromJSON(s):null)}),o}async clipTile(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={...t,pixelBlock:t.pixelBlock.toJSON()},o=await this._workerThread.invoke("clipTile",r,i);return o?Z.fromJSON(o):null}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",r,i)}async mosaicAndTransform(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...t,srcPixelBlocks:t.srcPixelBlocks.map(s=>s!=null?s.toJSON():null)},o=await this._workerThread.invoke("mosaicAndTransform",r,i);return{pixelBlock:o.pixelBlock?new Z(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:o,simulationSettings:s}=t,l=await this._workerThread.invoke("createFlowMesh",{meshType:o,flowData:r,simulationSettings:s},{...i,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t.datumTransformation!=null?t.datumTransformation.steps.map(l=>({wkid:l.wkid,wkt:l.wkt,isInverse:l.isInverse})):null,o=t.rasterTransform!=null?t.rasterTransform.toJSON():null,s={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:r,rasterTransform:o,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,i)}}const gi=.25,yi=ct.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),qe=ct.fromJSON(Vt[0]),yt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Qi(e){return e.presetRenderers?.find(({method:t,value:i})=>t==="raster-function-template"?i===e.rasterFunctionName:t==="variable"&&i===e.variableName)}function Xi(e,t){const{attributeTable:i,colormap:r}=e;if(ke(e)){const o=Si(e);if(o!=null)return o}if(t?.rasterFunctionColorRamp){const o=Ye(e,t);return o.colorRamp=t.rasterFunctionColorRamp,o}if(r!=null){const o=bi(e);if(o!=null)return o}if(i!=null){const o=fi(e);if(o!=null)return o}return Ye(e,t)}function qi(e,t=!1){const i=["raster-stretch"];return st(e,t)&&i.push("raster-colormap"),nt(e)&&i.push("unique-value"),Ot(e,t)&&i.push("class-breaks"),Ft(e)&&i.push("raster-shaded-relief"),ke(e)&&i.push("vector-field"),_t(e)&&i.push("flow"),i}function Yi(e){return e.datasetFormat==="Function"&&e.rasterFunction.functionName==="Colormap"?e.rasterFunction.colorRamp:void 0}function $i(e,t,i){const r=["nearest","bilinear","cubic","majority"],o=i?.toLowerCase().replace("bicubic","cubic"),s=r.find(l=>l===o);return t==="Map"?s??"bilinear":e.dataType==="standard-time"?s??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?s==="nearest"||s==="majority"?s:"nearest":s??"bilinear"}function Ye(e,t){e=Ii(e,t?.variableName);const{bandCount:i}=e;let{bandIds:r,stretchType:o}=t||{};r?.some(M=>M>=i)&&(r=null);let s=e.statistics,l=e.histograms;i>1?(r=r?.length?r:wi(e),s=s==null?null:r?.map(M=>s[M]),l=l==null?null:r?.map(M=>l[M])):r=[0],o==null&&(o=Ai(e)),t?.includeStatisticsInStretch&&(o==="percent-clip"||o==="histogram-equalization")&&e.statistics?.length&&(o="min-max");let u=!1;switch(o){case"none":u=!1;break;case"percent-clip":u=!l?.length;break;default:u=!s?.length}const{dataType:y}=e,c=r?.length===1&&yt.has(y)?yi:null,h=new Ze({stretchType:o,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return o==="percent-clip"?h.maxPercent=h.minPercent=gi:o==="standard-deviation"&&(h.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!t?.includeStatisticsInStretch||(o==="percent-clip"?h.histograms=l:o!=="min-max"&&o!=="standard-deviation"||(h.statistics=s)),h}function Ii(e,t){const{multidimensionalInfo:i}=e;if(!t||!i)return e;const r=i.variables.find(o=>o.name===t);if(!r)return e;if(e=e.clone(),r){const{statistics:o,histograms:s}=r;o?.length&&(e.statistics=o.map(l=>({min:l.min,max:l.max,avg:l.avg,stddev:l.stddev}))),s?.length&&(e.histograms=s)}return e}function wi(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:i}=e;let r;if(i.length===t){const{red:o,green:s,blue:l,nir:u}=hi(i);o!=null&&s!=null&&l!=null?r=[o,s,l]:u!=null&&o!=null&&s!=null&&(r=[u,o,s])}return!r&&t>=3&&(r=[0,1,2]),r}function hi(e){const t={};for(let i=0;i=410&&s<=480&&l>=480&&l<=540?t.blue=i:t.green==null&&s>=490&&s<=560&&l>=560&&l<=610?t.green=i:t.red==null&&s>=595&&s<=670&&l>=660&&l<=730?t.red=i:t.nir==null&&s>=700&&s<=860&&l>=800&&l<=950&&(t.nir=i)}}return t}function Ai(e){let t="percent-clip";const{pixelType:i,dataType:r,histograms:o,statistics:s,multidimensionalInfo:l}=e,u=yt.has(r)||r==="generic"&&l!=null;return i!=="u8"||r!=="processed"&&o!=null&&s!=null?i==="u8"||r==="elevation"||u?t="min-max":o!=null?t="percent-clip":s!=null&&(t="min-max"):t="none",t}function fi(e,t,i,r){if(!nt(e,t))return null;const{attributeTable:o,statistics:s}=e,l=It(o,t),u=Y(o,"red"),y=Y(o,"green"),c=Y(o,"blue"),h=new rt,M=[],B=new Set,N=!!(u&&y&&c);if(o!=null)o.features.forEach(d=>{const m=d.attributes[l.name];if(!B.has(d.attributes[l.name])&&m!=null){B.add(m);const L=N&&(u.type==="single"||u.type==="double")&&(y.type==="single"||y.type==="double")&&(c.type==="single"||c.type==="double")&&!o.features.some(W=>W.attributes[u.name]>1||W.attributes[y.name]>1||W.attributes[c.name]>1),z=L?255:1;M.push(new _e({value:d.attributes[l.name],label:d.attributes[l.name]+"",symbol:new Oe({style:"solid",outline:null,color:new b(N?[d.attributes[u.name]*z,d.attributes[y.name]*z,d.attributes[c.name]*z,1]:[0,0,0,0])})}))}});else if(s?.[0])for(let d=s[0].min;d<=s[0].max;d++)M.push(new _e({value:d,label:d.toString(),symbol:new Oe({style:"solid",outline:null,color:new b([0,0,0,0])})}));if(M.sort((d,m)=>d.value&&typeof d.value.valueOf()=="string"?0:d.value>m.value?1:-1),!N){const d=ot(qe,{numColors:M.length});M.forEach((m,L)=>m.symbol.color=new b(d[L].slice(1,4))),h.colorRamp=qe}return new He({field:l.name,uniqueValueInfos:M,authoringInfo:h})}function It(e,t,i){let r;return e!=null?(r=t?e.fields.find(o=>t.toLowerCase()===o.name.toLowerCase()):Di(e.fields),r||(i||(r=e.fields.find(o=>o.type==="string")),r||(r=Y(e,"value")))):r=new Pt({name:"value"}),r}function Di(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function bi(e){if(!st(e))return null;let t;const{attributeTable:i,colormap:r}=e;if(i!=null){const o=Y(i,"value"),s=It(i,null,!0);s.type==="string"&&(t={},i.features.forEach(l=>{const u=l.attributes;t[u[o.name]]=s?u[s.name]:u[o.name]}))}return Re.createFromColormap(r,t)}const vi=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Si(e){if(!ke(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:o,maxMagnitude:s}=ji(e.dataType,e.statistics);t=[new Ue({field:"Magnitude",minSize:10,maxSize:40,minDataValue:o,maxDataValue:s})]}const i=e.multidimensionalInfo!=null?vi.get(e.multidimensionalInfo.variables[0].unit):void 0,r=new Ee({visualVariables:t,inputUnit:i,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function $e(e){return{color:e.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function er(e){if(e.type==="uniqueValue"){const t=e.uniqueValueInfos;return t?.[0].symbol?.symbolLayers?.length&&(e.uniqueValueInfos=t?.map(i=>({value:i.value,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}if(e.type==="classBreaks"){const t=e.classBreakInfos;return t[0].symbol?.symbolLayers?.length&&(e.classBreakInfos=t.map(i=>({classMinValue:i.classMinValue,classMaxValue:i.classMaxValue,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}return e}function ji(e,t){let i,r;if(e==="vector-magdir")i=t[0].min,r=t[0].max;else{const o=t[0].min,s=t[0].max,l=t[1].min,u=t[1].max;i=0,r=Math.max(Math.abs(o),Math.abs(l),Math.abs(s),Math.abs(u))}return{minMagnitude:i,maxMagnitude:r}}var ze;let U=ze=class extends S{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){e!=null&&(t.geometryType=zt(e),t[i]=e.toJSON())}clone(){return new ze(w({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};a([n({types:Ct,json:{read:et}})],U.prototype,"geometry",void 0),a([ce("geometry")],U.prototype,"writeGeometry",null),a([n({type:Mi,json:{write:!0}})],U.prototype,"mosaicRule",void 0),a([n({type:gt,json:{write:!0,name:"renderingRule"}})],U.prototype,"rasterFunction",void 0),a([n({type:_,json:{write:!0}})],U.prototype,"pixelSize",void 0),a([n({json:{write:!0}})],U.prototype,"raster",void 0),a([n({type:Qt,json:{read:{source:"time"},write:{target:"time"}}})],U.prototype,"timeExtent",void 0),U=ze=a([v("esri.rest.support.ImageHistogramParameters")],U);const tr=U;async function wt(e,t,i){const r=Xt(e),{rasterFunction:o,sourceJSON:s}=t||{},l=o?JSON.stringify(o.rasterFunctionDefinition||o):null,u=qt({...r.query,renderingRule:l,f:"json"}),y=Yt(u,i);e=r.path;const c=s||await O(e,y).then(C=>C.data),h=c.hasRasterAttributeTable?O(`${e}/rasterAttributeTable`,y):null,M=c.hasColormap?O(`${e}/colormap`,y):null,B=c.hasHistograms?O(`${e}/histograms`,y):null,N=c.currentVersion>=10.3?O(`${e}/keyProperties`,y):null,d=c.hasMultidimensions?O(`${e}/multidimensionalInfo`,y):null,m=await Promise.allSettled([h,M,B,N,d]);let L=null;if(c.minValues&&c.minValues.length===c.bandCount){L=[];for(let C=0;C{C.statistics?.length&&C.statistics.forEach(ee=>{ee.avg=ee.mean,ee.stddev=ee.standardDeviation})});const{defaultVariable:Me,serviceDataType:me}=c;Me&&Me!==K.DefaultVariable&&(K.DefaultVariable=Me),me?.includes("esriImageServiceDataTypeVector")&&!me.includes(K.DataType)&&(K.DataType=me.replace("esriImageServiceDataType",""));let ge=c.noDataValue;c.noDataValues?.length&&c.noDataValues.some(C=>C!==ge)&&(ge=c.noDataValues);const Dt=c.transposeInfo?new Jt({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new _({x:c.extent.xmin,y:c.extent.ymax,spatialReference:de}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(W,Pe))/Math.LN2-8)),transposeInfo:c.transposeInfo}):void 0;return new Wt({width:W,height:Pe,bandCount:c.bandCount,extent:fe.fromJSON(c.extent),spatialReference:de,pixelSize:new _({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:de}),pixelType:c.pixelType.toLowerCase(),statistics:L,attributeTable:ht,colormap:At,histograms:ft,keyProperties:K,noDataValue:ge,multidimensionalInfo:pe,storageInfo:Dt})}function ir(e,t,i){return wt(e,{sourceJSON:t},i)}function rr(e,t,i){return wt(e,{rasterFunction:t},i)}function ar(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}let P=class extends Tt(S){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};a([n({type:String,json:{write:!0}})],P.prototype,"name",void 0),a([n({type:["raster-function-template","variable","none"],json:{write:!0}}),J({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],P.prototype,"method",void 0),a([n({type:String,json:{write:!0}})],P.prototype,"value",void 0),a([n({type:[R],json:{write:!0}})],P.prototype,"bandIds",void 0),a([n({types:je,json:{write:!0,origins:{"web-scene":{types:Ce,write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],P.prototype,"renderer",void 0),P=a([v("esri.renderers.support.RasterPresetRenderer")],P);const Ci=P,or=e=>{let t=class extends e{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return a([n({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],t.prototype,"activePresetRendererName",void 0),a([n({type:[Ci],json:{name:"layerDefinition.presetRenderers",write:!0}})],t.prototype,"presetRenderers",void 0),t=a([v("esri.layers.mixins.RasterPresetRendererMixin")],t),t};export{_i as A,Yi as C,ir as E,Ii as I,or as J,Mi as M,rr as P,Xi as S,$i as T,ar as V,tr as Z,Wi as a,er as b,Ce as c,Fi as d,Ki as f,qi as j,gt as k,je as l,Oi as p,we as u,Qi as v,wi as w}; diff --git a/main/assets/RasterSymbolizer-BVys6HkM-BxgX8zwh.js b/main/assets/RasterSymbolizer-BVys6HkM-BxgX8zwh.js new file mode 100644 index 000000000..819f6df62 --- /dev/null +++ b/main/assets/RasterSymbolizer-BVys6HkM-BxgX8zwh.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lerc-wasm-p5Heunzu-CsUnIe3C.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{aK as _t,v as D,S as N,i as Me,a0 as cr,ac as hr,w as fr,n as vt,J as dr,e as Ge,P as oe,o as ge,O as ze,a1 as wt,c$ as pr,x as mr,aS as gr,ar as Tt,_ as yr,bw as Cr}from"./main-C7yV2j71.js";import{D as re,b as ft,n as br,L as Se,c as dt,r as Ze,h as vr,d as It,e as Oe}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{t as Wt}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{S as _e,T as St,U as xt,l as wr}from"./colorUtils-Cthpxcks-CXgjba3p.js";const Jo=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],Ht=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],Tr=new _t({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Ve(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]kt(r))),t}return kt(e)}function At(e,t){if(!e)return;const r=Ht;let o=null;return e.type==="algorithmic"?r.some(i=>{if(Ve(e.fromColor.toRgb(),i.fromColor)&&Ve(e.toColor.toRgb(),i.toColor))return o=i.id,!0}):e.type==="multipart"&&r.some(i=>{const l=e.colorRamps,f=i.colorRamps;if(l&&f&&l.length===f.length&&!f.some((a,s)=>{if(!Ve(l[s].fromColor.toRgb(),new Tt(a.fromColor).toRgb())||!Ve(l[s].toColor.toRgb(),new Tt(a.toColor).toRgb()))return!0})){if(o)return!0;o=i.id}}),o}function Sr(e,t,r=!1){if(!e)return;let o=!1,i=At(e);return i!=null||r||(o=!0,i=At(e=Ir(e))),i?{id:i,inverted:o}:void 0}function xr(e,t=!1){const r=typeof e=="string"?e:Sr(e,void 0,t)?.id;return r?Tr.toJSON(r):null}function Ko(e,t="esriCIELabAlgorithm"){const r=Ht.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function Jt(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),i=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:i,isCustomInterval:o,weights:e.weights}}function kr(e,t,r){const{numColors:o,distanceOffset:i,distanceInterval:l,isCustomInterval:f}=r,a=e.s===0,s=t.s===0;let u=e.h,n=t.h;a&&!s?u=n:s&&!a&&(t={...t,h:u},n=u);let c,h=Math.abs(n-u);const m=360;hn?h*l:-h*l);const p=(t.s-e.s)*l,y=(t.v-e.v)*l;let{s:S,v}=e,k=u;if(i){const d=i/l;k=(k+d*c+m)%m,S+=d*p,v+=d*y}const w=[];for(let d=0;dh+m);i=i.map(h=>h/c)}else{i=[];for(let c=0;c{i.unshift(l),o||i.pop()}),r}function Or(e){const t=[];for(let r=0;r{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const $o=new _t({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Dr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var ot;function we(e){return e=Number(e),isNaN(e)?void 0:e}let he=ot=class extends Ge{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new ot({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};D([N({json:{name:"BandName",write:!0}})],he.prototype,"name",void 0),D([N({json:{name:"WavelengthMin",read:{reader:we},write:!0}})],he.prototype,"minWavelength",void 0),D([N({json:{name:"WavelengthMax",read:{reader:we},write:!0}})],he.prototype,"maxWavelength",void 0),D([N({json:{name:"RadianceBias",read:{reader:we},write:!0}})],he.prototype,"radianceBias",void 0),D([N({json:{name:"RadianceGain",read:{reader:we},write:!0}})],he.prototype,"radianceGain",void 0),D([N({json:{name:"ReflectanceBias",read:{reader:we},write:!0}})],he.prototype,"reflectanceBias",void 0),D([N({json:{name:"ReflectanceGain",read:{reader:we},write:!0}})],he.prototype,"reflectanceGain",void 0),D([N({json:{name:"SolarIrradiance",read:{reader:we},write:!0}})],he.prototype,"solarIrradiance",void 0),he=ot=D([Me("esri.layers.support.RasterBandInfo")],he);const Ot=he;var nt;function De(e){return e=Number(e),isNaN(e)?void 0:e}let se=nt=class extends Ge{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(e){return new Date(e)}writeAcquisitionDate(e,t){t.AcquisitionDate=e.getTime()}clone(){return new nt({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};D([N({json:{name:"AcquisitionDate",write:!0}})],se.prototype,"acquisitionDate",void 0),D([cr("acquisitionDate")],se.prototype,"readAcquisitionDate",null),D([hr("acquisitionDate")],se.prototype,"writeAcquisitionDate",null),D([N({json:{name:"CloudCover",read:{reader:De},write:!0}})],se.prototype,"cloudCover",void 0),D([N({json:{name:"ProductName",write:!0}})],se.prototype,"productName",void 0),D([N({json:{name:"SensorName",write:!0}})],se.prototype,"sensorName",void 0),D([N({json:{name:"SensorAzimuth",read:{reader:De},write:!0}})],se.prototype,"sensorAzimuth",void 0),D([N({json:{name:"SensorElevation",read:{reader:De},write:!0}})],se.prototype,"sensorElevation",void 0),D([N({json:{name:"SunAzimuth",read:{reader:De},write:!0}})],se.prototype,"sunAzimuth",void 0),D([N({json:{name:"SunElevation",read:{reader:De},write:!0}})],se.prototype,"sunElevation",void 0),se=nt=D([Me("esri.layers.support.RasterSensorInfo")],se);const Lr=se;var it;let te=it=class extends Ge{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new it({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:oe(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:oe(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:oe(this.tileInfo),transposeInfo:oe(this.transposeInfo),blockBoundary:oe(this.blockBoundary)})}};D([N({type:Number,json:{write:!0}})],te.prototype,"blockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"blockHeight",void 0),D([N({type:String,json:{write:!0}})],te.prototype,"compression",void 0),D([N({type:fr,json:{write:!0}})],te.prototype,"origin",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"firstPyramidLevel",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"maximumPyramidLevel",void 0),D([N({json:{write:!0}})],te.prototype,"pyramidResolutions",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidScalingFactor",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockHeight",void 0),D([N({type:Boolean,json:{write:!0}})],te.prototype,"isVirtualTileInfo",void 0),D([N({json:{write:!0}})],te.prototype,"tileInfo",void 0),D([N()],te.prototype,"transposeInfo",void 0),D([N()],te.prototype,"blockBoundary",void 0),te=it=D([Me("esri.layers.support.RasterStorageInfo")],te);const Mr=te;var at;let $=at=class extends Ge{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const e=this.keyProperties.BandProperties,{bandCount:t}=this;if(!e?.length||e.lengthOt.fromJSON(o));for(let o=0;oa&&(f=a)}else{for(;!this.eof;)this.readBlock();f=this.bufferLength}return this.pos=f,this.buffer.subarray(l,f)},lookChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(i,l,f){for(var a=i+l;this.bufferLength<=a&&!this.eof;)this.readBlock();return new Stream(this.buffer,i,l,f)},skip:function(i){i||(i=1),this.pos+=i},reset:function(){this.pos=0}},o}(),(r=function(){if(!self||!self.Uint32Array)return null;var o=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),l=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),f=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],a=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function s(n){throw new Error(n)}function u(n){var c=0,h=n[c++],m=n[c++];h!=-1&&m!=-1||s("Invalid header in flate stream"),(15&h)!=8&&s("Unknown compression method in flate stream"),((h<<8)+m)%31!=0&&s("Bad FCHECK in flate stream"),32&m&&s("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=c,this.codeSize=0,this.codeBuf=0,e.call(this)}return u.prototype=Object.create(e.prototype),u.prototype.getBits=function(n){for(var c,h=this.codeSize,m=this.codeBuf,p=this.bytes,y=this.bytesPos;h>n,this.codeSize=h-=n,this.bytesPos=y,c},u.prototype.getCode=function(n){for(var c=n[0],h=n[1],m=this.codeSize,p=this.codeBuf,y=this.bytes,S=this.bytesPos;m>16,d=65535&k;return(m==0||m>w,this.codeSize=m-w,this.bytesPos=S,d},u.prototype.generateHuffmanTable=function(n){for(var c=n.length,h=0,m=0;mh&&(h=n[m]);for(var p=1<>=1;for(m=d;m0;)Y[k++]=H}var c=this.getBits(3);if(1&c&&(this.eof=!0),(c>>=1)!=0){var h,m;if(c==1)h=f,m=a;else if(c==2){for(var p=this.getBits(5)+257,y=this.getBits(5)+1,S=this.getBits(4)+4,v=Array(o.length),k=0;k=b&&(b=(O=this.ensureBuffer(x+1)).length),O[x++]=I;else{if(I==256)return void(this.bufferLength=x);var A=(I=i[I-=257])>>16;A>0&&(A=this.getBits(A)),d=(65535&I)+A,I=this.getCode(m),(A=(I=l[I])>>16)>0&&(A=this.getBits(A));var E=(65535&I)+A;x+d>=b&&(b=(O=this.ensureBuffer(x+d)).length);for(var P=0;P{let n=null;f==="jpg"&&a&&(n=Yt._getMask(t,{width:i,height:l}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),h=URL.createObjectURL(c),m=new Image;let p;m.src=h,m.onload=()=>{if(URL.revokeObjectURL(h),mr(o))return void u(gr());i=m.width,l=m.height,this._canvas&&this._ctx?(this._canvas.width===i&&this._canvas.height===l||(this._canvas.width=i,this._canvas.height=l),this._ctx.clearRect(0,0,i,l)):(this._canvas=document.createElement("canvas"),this._canvas.width=i,this._canvas.height=l,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(m,0,0);const y=this._ctx.getImageData(0,0,i,l);let S;if(p=y.data,r.renderOnCanvas){if(n)for(S=0;S{URL.revokeObjectURL(h),u("cannot load image")}})}static _getMask(t,r){let o=null;try{const i=new Uint8Array(t),l=Math.ceil(i.length/2);let f=0;const a=i.length-2;for(f=l;f=0;c--)o[u++]=s[n]>>c&1}}catch{}return o}};var Mt,Gt={exports:{}};function Br(){return Mt||(Mt=1,e=Gt,t=function(){var o=function(){function i(l){this.message="JPEG error: "+l}return i.prototype=new Error,i.prototype.name="JpegError",i.constructor=i,i}();return function(){if(!self||!self.Uint8ClampedArray)return null;var i=new Uint8Array([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]),l=4017,f=799,a=3406,s=2276,u=1567,n=3784,c=5793,h=2896;function m(){this.decodeTransform=null,this.colorTransform=-1}function p(d,g){for(var T,C,b=0,x=[],I=16;I>0&&!d[I-1];)I--;x.push({children:[],index:0});var A,E=x[0];for(T=0;T0;)E=x.pop();for(E.index++,x.push(E);x.length<=T;)x.push(A={children:[],index:0}),E.children[E.index]=A.children,E=A;b++}T+10)return B--,U>>B&1;if((U=d[g++])===255){var M=d[g++];if(M)throw new o("unexpected marker "+(U<<8|M).toString(16))}return B=7,U>>>7}function J(M){for(var K=M;;){if(typeof(K=K[L()])=="number")return K;if(typeof K!="object")throw new o("invalid huffman sequence")}}function O(M){for(var K=0;M>0;)K=K<<1|L(),M--;return K}function z(M){if(M===1)return L()===1?1:-1;var K=O(M);return K>=1<>4;if(ee!==0){var ur=i[ie+=ae];M.blockData[K+ur]=z(ee),ie++}else{if(ae<15)break;ie+=16}}}function V(M,K){var q=J(M.huffmanTableDC),Q=q===0?0:z(q)<0)_--;else for(var q=x,Q=I;q<=Q;){var ie=J(M.huffmanTableAC),ce=15&ie,ee=ie>>4;if(ce!==0){var ae=i[q+=ee];M.blockData[K+ae]=z(ce)*(1<>4,(q=15&Q)==0)ee<15?(_=O(ee)+(1<=65488&&ve<=65495))break;g+=2}return(le=w(d,g))&&le.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+le.invalid),g=le.offset),g-G}function v(d,g,T){var C,b,x,I,A,E,P,R,G,U,B,L,J,O,z,F,V,Y=d.quantizationTable,_=d.blockData;if(!Y)throw new o("missing required Quantization Table.");for(var j=0;j<64;j+=8)G=_[g+j],U=_[g+j+1],B=_[g+j+2],L=_[g+j+3],J=_[g+j+4],O=_[g+j+5],z=_[g+j+6],F=_[g+j+7],G*=Y[j],U|B|L|J|O|z|F?(U*=Y[j+1],B*=Y[j+2],L*=Y[j+3],J*=Y[j+4],O*=Y[j+5],z*=Y[j+6],F*=Y[j+7],b=(C=(C=c*G+128>>8)+(b=c*J+128>>8)+1>>1)-b,V=(x=B)*n+(I=z)*u+128>>8,x=x*u-I*n+128>>8,P=(A=(A=h*(U-F)+128>>8)+(P=O<<4)+1>>1)-P,E=(R=(R=h*(U+F)+128>>8)+(E=L<<4)+1>>1)-E,I=(C=C+(I=V)+1>>1)-I,x=(b=b+x+1>>1)-x,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,P=V,T[j]=C+R,T[j+7]=C-R,T[j+1]=b+P,T[j+6]=b-P,T[j+2]=x+E,T[j+5]=x-E,T[j+3]=I+A,T[j+4]=I-A):(V=c*G+512>>10,T[j]=V,T[j+1]=V,T[j+2]=V,T[j+3]=V,T[j+4]=V,T[j+5]=V,T[j+6]=V,T[j+7]=V);for(var H=0;H<8;++H)G=T[H],(U=T[H+8])|(B=T[H+16])|(L=T[H+24])|(J=T[H+32])|(O=T[H+40])|(z=T[H+48])|(F=T[H+56])?(b=(C=4112+((C=c*G+2048>>12)+(b=c*J+2048>>12)+1>>1))-b,V=(x=B)*n+(I=z)*u+2048>>12,x=x*u-I*n+2048>>12,I=V,P=(A=(A=h*(U-F)+2048>>12)+(P=O)+1>>1)-P,E=(R=(R=h*(U+F)+2048>>12)+(E=L)+1>>1)-E,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,G=(G=(C=C+I+1>>1)+R)<16?0:G>=4080?255:G>>4,U=(U=(b=b+x+1>>1)+(P=V))<16?0:U>=4080?255:U>>4,B=(B=(x=b-x)+E)<16?0:B>=4080?255:B>>4,L=(L=(I=C-I)+A)<16?0:L>=4080?255:L>>4,J=(J=I-A)<16?0:J>=4080?255:J>>4,O=(O=x-E)<16?0:O>=4080?255:O>>4,z=(z=b-P)<16?0:z>=4080?255:z>>4,F=(F=C-R)<16?0:F>=4080?255:F>>4,_[g+H]=G,_[g+H+8]=U,_[g+H+16]=B,_[g+H+24]=L,_[g+H+32]=J,_[g+H+40]=O,_[g+H+48]=z,_[g+H+56]=F):(V=(V=c*G+8192>>14)<-2040?0:V>=2024?255:V+2056>>4,_[g+H]=V,_[g+H+8]=V,_[g+H+16]=V,_[g+H+24]=V,_[g+H+32]=V,_[g+H+40]=V,_[g+H+48]=V,_[g+H+56]=V)}function k(d,g){for(var T=g.blocksPerLine,C=g.blocksPerColumn,b=new Int16Array(64),x=0;x=b)return null;var I=C(g);if(I>=65472&&I<=65534)return{invalid:null,marker:I,offset:g};for(var A=C(x);!(A>=65472&&A<=65534);){if(++x>=b)return null;A=C(x)}return{invalid:I.toString(16),marker:A,offset:x}}return m.prototype={parse:function(d){function g(){var M=d[I]<<8|d[I+1];return I+=2,M}function T(){var M=g(),K=I+M-2,q=w(d,K,I);q&&q.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+q.invalid),K=q.offset);var Q=d.subarray(I,K);return I+=Q.length,Q}function C(M){for(var K=Math.ceil(M.samplesPerLine/8/M.maxH),q=Math.ceil(M.scanLines/8/M.maxV),Q=0;Q>4){if(F>>4!=1)throw new o("DQT - invalid table spec");for(L=0;L<64;L++)V[i[L]]=g()}else for(L=0;L<64;L++)V[i[L]]=d[I++];P[15&F]=V}break;case 65472:case 65473:case 65474:if(b)throw new o("Only single frame JPEGs supported");g(),(b={}).extended=U===65473,b.progressive=U===65474,b.precision=d[I++],b.scanLines=g(),b.samplesPerLine=g(),b.components=[],b.componentIds={};var Y,_=d[I++],j=0,H=0;for(B=0;B<_;B++){Y=d[I];var X=d[I+1]>>4,Pe=15&d[I+1];j>4?R:G)[15&pe]=p(ue,ye)}break;case 65501:g(),x=g();break;case 65498:g();var Z,Re=d[I++],Ce=[];for(B=0;B>4],Z.huffmanTableAC=R[15&be],Ce.push(Z)}var Ne=d[I++],Be=d[I++],de=d[I++],Fe=S(d,I,b,Ce,x,Ne,Be,de>>4,15&de);I+=Fe;break;case 65535:d[I]!==255&&I--;break;default:if(d[I-3]===255&&d[I-2]>=192&&d[I-2]<=254){I-=3;break}throw new o("unknown marker "+U.toString(16))}U=g()}for(this.width=b.samplesPerLine,this.height=b.scanLines,this.jfif=A,this.eof=I,this.adobe=E,this.components=[],B=0;B>8)+_[R+1];return F},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var g,T,C,b=0,x=d.length;b4)throw new o("Unsupported color mode");var C=this._getLinearizedBlockData(d,g);if(this.numComponents===1&&T){for(var b=C.length,x=new Uint8ClampedArray(3*b),I=0,A=0;A=0;p--)c[S++]=y[h]>>p&1}catch{}if(f===1&&s.length===i*l){const y=new Uint8Array(s.buffer);n=[y,y,y]}else{for(n=[],h=0;h<3;h++)n.push(new Uint8Array(u));for(p=0,m=0;mimport("./lerc-wasm-p5Heunzu-CsUnIe3C.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>Cr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{zr(e)}),Xe)}const We={getBlobInfo:null,decode:null};function Vr(e){return 16+(e>>3<<3)}function me(e,t,r){r.set(e.slice(t,t+r.length))}function zr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:i,_lerc_decode_4D:l,asm:f}=e;let a;const s=Object.values(f).find(n=>n&&"buffer"in n&&n.buffer===e.HEAPU8.buffer),u=n=>{const c=n.map(y=>Vr(y)),h=c.reduce((y,S)=>y+S),m=t(h);a=new Uint8Array(s.buffer);let p=c[0];c[0]=m;for(let y=1;y{const c=new Uint8Array(48),h=new Uint8Array(8*3),[m,p,y]=u([n.length,c.length,h.length]);a.set(n,m),a.set(c,p),a.set(h,y);let S=o(m,n.length,p,y,12,3);if(S)throw r(m),new Error(`lerc-getBlobInfo: error code is ${S}`);a=new Uint8Array(s.buffer),me(a,p,c),me(a,y,h);const v=new Uint32Array(c.buffer),k=new Float64Array(h.buffer),[w,d,,g,T,C,b,x,I,A,E]=v,P={version:w,depthCount:A,width:g,height:T,validPixelCount:b,bandCount:C,blobSize:x,maskCount:I,dataType:d,minValue:k[0],maxValue:k[1],maxZerror:k[2],statistics:[],bandCountWithNoData:E};if(E&&A>1)return r(m),P;if(A===1&&C===1)return r(m),P.statistics.push({minValue:k[0],maxValue:k[1]}),P;const R=A*C*8,G=new Uint8Array(R),U=new Uint8Array(R);let B=m,L=0,J=0,O=!1;if(a.byteLength1){const _=z.slice(Y*A,(Y+1)*A),j=F.slice(Y*A,(Y+1)*A),H=Math.min.apply(null,_),X=Math.max.apply(null,j);V.push({minValue:H,maxValue:X,depthStats:{minValues:_,maxValues:j}})}else V.push({minValue:z[Y],maxValue:F[Y]});return r(B),O||r(L),P},We.decode=(n,c)=>{const{maskCount:h,depthCount:m,bandCount:p,width:y,height:S,dataType:v,bandCountWithNoData:k}=c,w=$t[v],d=y*S,g=new Uint8Array(d*p),T=d*m*p*w.size,C=new Uint8Array(T),b=new Uint8Array(p),x=new Uint8Array(8*p),[I,A,E,P,R]=u([n.length,g.length,C.length,b.length,x.length]);a.set(n,I),a.set(g,A),a.set(C,E),a.set(b,P),a.set(x,R);const G=l(I,n.length,h,A,m,y,S,p,v,E,P,R);if(G)throw r(I),new Error(`lerc-decode: error code is ${G}`);a=new Uint8Array(s.buffer),me(a,E,C),me(a,A,g);let U=null;if(k){me(a,P,b),me(a,R,x),U=[];const B=new Float64Array(x.buffer);for(let L=0;L1){g.set(k[0]);for(let I=1;I=T;if(m>0&&C)for(let I=0;I1?k:null,{pixelType:x}=y;return{width:s,height:u,bandCount:n,pixelType:x,depthCount:c,statistics:p,pixels:v,mask:g,bandMasks:b,noDataValues:a}}function _r(e,t,r,o=!0){if(t%4!=0||r%4!=0){const i=new ArrayBuffer(4*Math.ceil(r/4)),l=new Uint8Array(i),f=new Uint8Array(e,t,r);if(o)for(let a=0;a=l)a-=l,h=c>>>32-l,c<<=l;else{h=c>>>32-a,c=i[n++];const v=l-a;a=32-v,h=(h<>>a),c<<=v}if(h===257)break;if(h===256){l=9,f=Ut(),s=f.length,u=[];continue}const S=f[h];if(S==null){if(h>f.length)throw new Error("data integrity issue: code does not exist on code page");u.push(u[0]),f[s++]=u.slice(),Nt(y,u)}else Nt(y,S),u.push(S[0]),u.length>1&&(f[s++]=u.slice()),u=S.slice();if(xe.has(s)&&l++,a===0&&(c=i[n++],a=32),n>m||n===m&&a<=p)break}return new Uint8Array(y)}xe.add(511),xe.add(1023),xe.add(2047),xe.add(4095),xe.add(8191);const Bt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*Qt(o)))},Qt=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},Wr=(e,t)=>{if(8*e.byteLength=0;a--)o[i++]=l>>a&1;for(a=7;i>a&1,a--;return o};let Hr=class{static decode(e,t){const r=t.pixelType,o=[],i=t.width*t.height,l=Bt(e,t),{bandIds:f,format:a}=t,s=f?.length||Bt(e,t),u=e.byteLength-e.byteLength%(i*Qt(r)),n=new r(e,0,i*l);let c,h,m,p,y=null;if(a==="bip")for(c=0;c>4,i<8?i=1:i===15?(i=4,l=(7&l)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):i===14?(i=3,l=(15&l)<<12|(63&e[r++])<<6|63&e[r++]):(i=2,l=(31&l)<<6|63&e[r++]),(l!==0||t)&&(o+=String.fromCharCode(l));return o}const mt=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),Kr=(()=>{const e=mt.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),Yr=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],qr=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),$r=(e,t)=>{let r=(t||mt)[e];return r===void 0&&(r="unknown"+String(e)),r},st=new Map;st.set("EXIFIFD",Kr),st.set("GPSIFD",Yr);const Ae={tiffTags:mt,ifdTags:st,geoKeys:qr,getTagName:$r},gt=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Ft=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Zr=new Set([1,5,6,7,8,34712,34887]);function yt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function He(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function Xr(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function er(e,t){return e.get(t)?.values}function Ie(e,t){return e.get(t)?.values}function Vt(e,t){return e.get(t)?.values?.[0]}function W(e,t){return e.get(t)?.values?.[0]}function Qe(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=l===8,a=f?bt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),s=4+2*l,u=f?8:2,n=u+a*s;if(r+n>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:n};const c=r+n+4<=e.byteLength?je(new DataView(e,r+n,l===8?8:4),0,t,l===8):null,h=r+u,m=new Map;let p,y,S,v,k,w=0,d=0;for(let g=0;gXt(e,{inputOffset:t}).pixels[0];function lt(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,i=new Uint8Array(e.byteLength*o);let l=0;const f=2**t-1;for(let a=0;a>>8-t&f}return i.buffer}function ut(e,t,r){const o=new qt;o.parse(e),o.colorTransform=r===6?-1:0;const i=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(i.buffer)}function ct(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function ht(e,t,r,o,i){const l=gt===t,f=W(r,"BITSPERSAMPLE"),a=W(r,"SAMPLESPERPIXEL")??1,s=W(r,"PHOTOMETRICINTERPRETATION"),u=W(r,"SAMPLEFORMAT")??1,n=yt(u,f),c=W(r,"COMPRESSION")??1,h=He(n);let m,p,y;if(c===34887)return await Zt(),Qr(e,o);if(c===1)m=e.slice(o,o+i),p=new Uint8Array(m);else if(c===8||c===32946)p=new Uint8Array(e,o,i),p=ct(p),m=p.buffer;else if(c===6)p=new Uint8Array(e,o,i),p=ut(p,a,s),m=p.buffer;else if(c===7){const w=r.get("JPEGTABLES").values,d=w.length-2;p=new Uint8Array(d+i-2);for(let T=0;T1&&(c===5||c===8||c===32946)&&v&&k){const w=Je(r),d=new h(y.length);d.set(y),y=uo(d,k,v,u===3&&S===3,w?1:a)}return y}async function eo(e,t,r){const o=Ie(r,"TILEOFFSETS");if(o===void 0)return null;const i=Ie(r,"TILEBYTECOUNTS"),{width:l,height:f,pixelType:a,tileWidth:s,tileHeight:u}=Ct([r]),n=Je(r,t),c=W(r,"SAMPLESPERPIXEL")||t.planes,h=l*f,m=W(r,"BITSPERSAMPLE"),p=(W(r,"COMPRESSION")??1)===34887,y=He(a),S=[];for(let B=0;B1){const B=Math.round(o.length/c);for(v=0;v{const o=gt===t.littleEndian,i=Ie(r,"STRIPOFFSETS");if(i===void 0)return null;const{width:l,height:f,pixelType:a}=Ct([r]),s=W(r,"SAMPLESPERPIXEL")||t.planes,u=W(r,"PHOTOMETRICINTERPRETATION"),n=l*f,c=W(r,"BITSPERSAMPLE"),h=He(a),m=new h(n*s),p=Ie(r,"STRIPBYTECOUNTS"),y=W(r,"ROWSPERSTRIP"),S=W(r,"COMPRESSION")??1;let v,k,w,d,g,T,C,b,x;if(c%8==0)for(v=0;v{if(!(e&&e.length>0&&t&&r))return null;let o,i,l;const f=e[0].length,a=e.length,s=new Uint8Array(f);for(let u=0;ul?0:1;else for(let n=0;nl?0:1);return s},oo=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,i,l,f,a;for(let v=0;v")),f=o.indexOf("sample="),f>-1&&(a=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(i=o.slice(f+6,o.indexOf('"',f+6))),i&&(l=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),a!=null?r.has(i)?r.get(i)[a]=l:r.set(i,[l]):r.set(i,l)),a=null;const s=r.get("STATISTICS_MINIMUM"),u=r.get("STATISTICS_MAXIMUM"),n=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let h=null;if(s&&u){h=[];for(let v=0;vS&&h>(i?e.byteLength:e?e.byteLength-s+o:0))return r.offlineOffsetSize=[s,h],r.values=null,!1;if(m<=S){if(!t)if(S<=32)s>>>=32-m;else{const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);m<=32?(s=k>>>32-m,v[0]=s):(s=k*2**(32-m)+(w>>>32-m),v[0]=k,v[1]=w>>>32-m)}if(a===1&&c===S)u=[s];else if(S===64){const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);let d=k,g=32;for(y=1;y<=a;y++){const T=32-c*y%32;if(g>>32-g,b=w<<32-g>>>32-g;d=w,u.push(C+b*2**(c-g)),g-=32-(c-g)}else u.push(d<>>32-c),g-=c;g===0&&(g=32,d=w)}}else for(y=1;y<=a;y++){const k=32-c*y;u.push(s<>>32-c)}}else{s-=o,i&&(s=0);for(let k=s;kparseFloat(z)),h.some(z=>isNaN(z))&&(h=null));const m=W(t,"COMPRESSION")??1;let p;switch(m){case 1:p="NONE";break;case 2:case 3:case 4:case 32771:p="CCITT";break;case 5:p="LZW";break;case 6:case 7:p="JPEG";break;case 32773:p="PACKBITS";break;case 8:case 32946:p="DEFLATE";break;case 34712:p="JPEG2000";break;case 34887:p="LERC";break;default:p=String(m)}let y=!0,S="";Zr.has(m)||(y=!1,S+="unsupported tag compression "+m),s>3&&(y=!1,S+="unsupported tag sampleFormat "+s),f!==1&&f!==2&&f!==4&&f%8!=0&&(y=!1,S+="unsupported tag bitsPerSample "+f);const v=Vt(t,"GEOASCIIPARAMS");let k;if(v){const z=v.split("|").find(V=>V.includes("ESRI PE String = ")),F=z?z.replace("ESRI PE String = ",""):"";k=F.startsWith("COMPD_CS")||F.startsWith("PROJCS")||F.startsWith("GEOGCS")?{wkid:null,wkt:F}:null}const w=Ie(t,"GEOTIEPOINTS"),d=Ie(t,"GEOPIXELSCALE"),g=Ie(t,"GEOTRANSMATRIX"),T=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let C,b,x=!1,I=!1;if(T){x=W(T,"GTRasterTypeGeoKey")===2;const z=W(T,"GTModelTypeGeoKey");if(z===2){const F=W(T,"GeographicTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F}),k||F!==32767||(I=!0,k={wkid:4326})}else if(z===1){const F=W(T,"ProjectedCSTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F})}}if(d&&w&&w.length>=6?(C=[d[0],0,w[3]-w[0]*d[0],0,-Math.abs(d[1]),w[4]-w[1]*d[1]],x&&(C[2]-=.5*C[0]+.5*C[1],C[5]-=.5*C[3]+.5*C[4])):g&&g.length===16&&(C=x?[g[0],g[1],g[3]-.5*g[0],g[4],g[5],g[7]-.5*g[5]]:[g[0],g[1],g[3],g[4],g[5],g[7]]),C){const z=[{x:0,y:l},{x:0,y:0},{x:i,y:l},{x:i,y:0}];let F,V=Number.POSITIVE_INFINITY,Y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let H=0;HV?V:F.x,_=F.x<_?_:F.x,Y=F.y>Y?Y:F.y,j=F.y400||Math.max(Math.abs(b.xmin),Math.abs(b.xmax))>361)&&(k=null,b.spatialReference=null);const A=tr(e);let E,P,R,G,U;if(A.length>0){R=Math.round(Math.log(i/W(A[0],"IMAGEWIDTH"))/Math.LN2);const z=A[A.length-1];G=A.length,E=W(z,"TILEWIDTH"),P=W(z,"TILELENGTH")}E=G!=null&&G>0?E||r:null,P=G!=null&&G>0?P||o:null,r&&(U=[{maxCol:Math.ceil(i/r)-1,maxRow:Math.ceil(l/o)-1,minRow:0,minCol:0}],A.forEach(z=>{U.push({maxCol:Math.ceil(W(z,"IMAGEWIDTH")/W(z,"TILEWIDTH"))-1,maxRow:Math.ceil(W(z,"IMAGELENGTH")/W(z,"TILELENGTH"))-1,minRow:0,minCol:0})}));const B=Vt(e[0],"GDAL_METADATA"),L=oo(B);S+=" "+or({width:i,height:l,tileWidth:r,tileHeight:o,planes:a,ifds:e});const J=rr(e).length===A.length+1,O=A?.length?A.map(z=>({x:i/W(z,"IMAGEWIDTH"),y:l/W(z,"IMAGELENGTH")})):void 0;return{width:i,height:l,tileWidth:r,tileHeight:o,planes:a,isBSQ:n,pixelType:u,compression:p,noData:h,hasMaskBand:J,isSupported:y,pyramidResolutions:O,message:S,extent:b,isPseudoGeographic:I,affine:d?null:C,firstPyramidLevel:R,maximumPyramidLevel:G,pyramidBlockWidth:E,pyramidBlockHeight:P,tileBoundary:U,metadata:L}}function Je(e,t){const r=er(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function tr(e){return e.filter(t=>W(t,"NEWSUBFILETYPE")===1)}function rr(e){return e.filter(t=>{const r=!(4&~(W(t,"NEWSUBFILETYPE")??0)),o=W(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function io(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=so(e);let i=o;const l=[];do{const f=lo(e,t,i,0,Ae.tiffTags,r?8:4);if(!f.success)break;l.push(f.ifd),i=f.nextIFD}while(i>0);return{...Ct(l),littleEndian:t,isBigTiff:r,ifds:l,pyramidIFDs:tr(l),maskIFDs:rr(l)}}function bt(e,t,r){const o=e.getUint32(t,r),i=e.getUint32(t+4,r);return r?i*Ee+o:o*Ee+i}function ao(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),i=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const l=(r?o:i)>=0?1:-1;return r?o*=l:i*=l,l*(r?i*Ee+o:o*Ee+i)}function je(e,t,r,o){return o?bt(e,t,r):e.getUint32(t,r)}function so(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const i=t.getUint16(2,o);if(i!==42&&i!==43)throw new Error("unexpected tiff identifier");let l=4;const f=i===43;if(f){const a=t.getUint16(l,o);if(l+=2,a!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(l,o)!==0)throw new Error("unsupported bigtiff version");l+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:je(t,l,o,f)}}function lo(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=Qe(e,t,r,o,i,l);let a;const s=f.ifd;if(s){if(Ae.ifdTags.forEach((u,n)=>{s.has(n)&&(a=s.get(n),a.data=Qe(e,t,a.valueOffset-o,o,u).ifd)}),s.has("GEOKEYDIRECTORY")){a=s.get("GEOKEYDIRECTORY");const u=a.values;if(u&&u.length>4){const n=u[0]+"."+u[1]+"."+u[2];a.data=Qe(e,t,a.valueOffset+6-o,o,Ae.geoKeys,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(s.has("XMP")){a=s.get("XMP");const u=a.values;typeof u[0]=="number"&&a.type===7&&(a.values=[Jr(new Uint8Array(u))])}}return f}function or(e){const{width:t,height:r,tileHeight:o,tileWidth:i}=e,l=e.planes,f=i?i*o:t*r,a=W(e.ifds[0],"BITSPERSAMPLE");let s="";return f*l>2**30/(a>8?a/8:1)&&(s=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function uo(e,t,r,o,i){const l=o?4:1,f=r*l*i;o&&(e=new Uint8Array(e.buffer));for(let u=0;ux.min):null,C=g?g.map(x=>x.max):null,b={pixelType:u,width:h,height:m,pixels:v,noDataValue:d};return d!=null?ft(b,d):T&&C&&t.applyMinMaxConstraint&&(b.mask=ro(v,T,C)),b}async function ho(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||io(e),{ifds:i,noData:l}=o;if(i.length===0)throw new Error("no valid image file directory");const f=or(o);if(f)throw f;let a=null;const s=r===-1?i[i.length-1]:i[r],u=l??t.noDataValue;return a=o.tileWidth?await eo(e,o,s):to(e,o,s),a&&(u!=null&&ft(a,u),a)}var fo=function(e){var t,r,o,i,l,f;function a(s){var u,n,c,h,m,p,y,S,v,k,w,d,g;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},m=null;;){switch(u=this.readUInt32(),S=function(){var T,C;for(C=[],T=0;T<4;++T)C.push(String.fromCharCode(this.data[this.pos++]));return C}.call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(u);break;case"fcTL":m&&this.animation.frames.push(m),this.pos+=4,m={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),c=this.readUInt16()||100,m.delay=1e3*h/c,m.disposeOp=this.data[this.pos++],m.blendOp=this.data[this.pos++],m.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,u-=4),s=m?.data||this.imgData,w=0;0<=u?wu;0<=u?++w:--w)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(u),(v=255-this.transparency.indexed.length)>0)for(d=0;0<=v?dv;0<=v?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(u)[0];break;case 2:this.transparency.rgb=this.read(u)}break;case"tEXt":p=(k=this.read(u)).indexOf(0),y=String.fromCharCode.apply(String,k.slice(0,p)),this.text[y]=String.fromCharCode.apply(String,k.slice(p+1));break;case"IEND":return m&&this.animation.frames.push(m),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(g=this.colorType)===4||g===6,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=u}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(s,u,n){var c;return typeof u=="function"&&(n=u),(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="arraybuffer",c.onload=function(){var h;return h=new a(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof u?.getContext=="function"&&h.render(u),typeof n=="function"?n(h):void 0},c.send(null)},r=1,o=2,t=0,a.prototype.read=function(s){var u,n;for(n=[],u=0;0<=s?us;0<=s?++u:--u)n.push(this.data[this.pos++]);return n},a.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.decodePixels=function(s){var u,n,c,h,m,p,y,S,v,k,w,d,g,T,C,b,x,I,A,E,P,R,G;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Ue(s)).getBytes(),b=(d=this.pixelBitlength/8)*this.width,g=new Uint8Array(b*this.height),p=s.length,C=0,T=0,n=0;T1&&n/hnew dt(m,p)),bandMasks:u,depthCount:a,noDataValues:s});return f?.length||h.updateStatistics(),h}async function go(e,t){const r=await ho(e,{...t,noDataValue:null});ze(r);const o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,bandMasks:r.bandMasks,statistics:null});return o.updateStatistics(),o}async function yo(e,t){const r=await co(e,t.customOptions),o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return o.updateStatistics(),o}function nr(e,t){const r=t.pixelType||"u8",o=re.getPixelArrayConstructor(r),i=r==="u8"?e:new o(e.buffer),l=[],f=t.planes||1;if(f===1)l.push(i);else for(let s=0;svo(r,o,e);break;case"tiff":t=go;break;case"deflate":t=Co;break;case"lzw":t=bo;break;case"error":t=()=>{throw new ge("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new ge("rasterCodec:decode","unsupported raster format")}}return t}function xo(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function ko(e,t=1){if(!e)return;const{pixels:r,width:o,height:i,mask:l}=e;if(!r||r.length===0)return;const f=r.length,a=o-1,s=i-1,u=[];let n,c,h,m,p,y,S=null;const v=re.getPixelArrayConstructor(e.pixelType);if(t===0){for(n=0;n1){const a=f.map((n,c)=>i(e.slice(n,f[c+1]),t)),s=await Promise.all(a);l=s[0],l.pixels=s.map(n=>n.pixels[0]);const u=s.map(n=>n.mask);s.some(n=>n!=null)&&(u.forEach((n,c)=>{n==null&&(u[c]=new Uint8Array(l.width*l.height).fill(255))}),l.bandMasks=u,l.mask=re.combineBandMasks(u)),l.updateStatistics()}else l=await i(e,{...t,offset:f?.[0]??t.offset});return o!=="jpg"&&t.noDataValue!=null&&l.depthCount===1&&ft(l,t.noDataValue,{customFloatTolerance:t.tolerance}),t.isPoint&&ko(l),l}function Ao(e){return["u8","s8"].includes(e.pixelType)&&e.statistics?.[0]?.min!=null&&e.statistics[0]?.max!=null&&e.bandCount===1}function Eo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Ao(e)?!0:!(r==null||o>1||t&&r.fields.find(i=>i.name.toLowerCase()===t.toLowerCase())==null)}function Po(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Ro(e,t=!1){const{bandCount:r,colormap:o,pixelType:i}=e;return r===1&&(!!o?.length||!t&&i==="u8")}function Qo(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function en(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function tn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function et(e){return!!e?.length&&e.length<=16384}const tt=1;function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,i=new Uint8Array(r),l=o.reduce((n,c)=>n+c/t,0);let f=0,a=0,s=0,u=l;for(let n=0;n=s){const g=sr(s,o);for(u=0;u1&&(w-=(1/y)**(S*g[u])),kt[u]){const T=w*y*S**(1/o[u])+f;d[n]=l==="floor"?Math.floor(T):l==="round"?Math.round(T):T}else k>=r[u]?d[n]=a:d[n]=f;else d[n]=f;v[u]=d}}else for(u=0;u=r[u])d[n]=a;else{const g=(k-t[u])*m[u]+f;d[n]=l==="floor"?Math.floor(g):l==="round"?Math.round(g):g}v[u]=d}if(e.contrastOffset!=null){const g=Oo(e.contrastOffset,e.brightnessOffset);for(u=0;u0&&r<100?a=(200*f-100*i+2*i*o)/(2*(100-r))+l:r<=0&&r>-100?a=(200*f-100*i+2*i*o)*(100+r)/2e4+l:r===100?(a=200*f-100*i+(i+1)*(100-r)+2*i*o,a=a>0?i:0):r===-100&&(a=l),s[f]=a>i?i:a<0?0:a;return s}function Do(e,t,r){const o=[];for(let i=0;i=255)return tt;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,i=Math.log(e/r),l=Math.log(o/r);if(l===0)return tt;const f=i/l;return isNaN(f)?tt:Math.min(9.9,Math.max(.01,f))}function Mo(e,t,r,o){let i=1/0,l=-1/0,f=0,a=0,s=0,u=0;const n=e.length,c=new Map,h=[];for(let C=0;Cu&&(u=x,s=b),i=bl?b:l,f+=b,a++}}if(a===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const m=f/a;let p=0;for(let C=0;CC).length:n,S=y<=1?0:Math.sqrt(p/(y-1));h.sort((C,b)=>C-b);const v=a>>>1,k={min:i,max:l,avg:m,stddev:S,mode:s,median:a%2?h[Math.floor(v)]:(h[v-1]+h[v])/2};if(["u8","s8","u4","u2","u1"].includes(r)){const C=l-i+1,b=new Uint32Array(C);for(let x=0;xMo(f,i?.[a]??r,o));return{statistics:l.map(({statistics:f})=>f),histograms:l.map(({histogram:f})=>f)}}function Go(e){if(!e?.pixels?.length)return null;const{pixels:t,mask:r,bandMasks:o,pixelType:i}=e,l=e.width*e.height,f=t.length,a=[],s=[],u=256;let n,c,h,m;for(let p=0;pc?E:c,h[E]++}}else for(let A=0;Ac?E:c,h[E]++}h=h.slice(n,c+1)}else{let A=!1;e.statistics||(e.updateStatistics(),A=!0);const E=e.statistics;n=E[p].minValue,c=E[p].maxValue;const P=(c-n)/u;if(P===0){!E||e.validPixelCount||A||e.updateStatistics();const R=(e.validPixelCount||e.width*e.height)/u;for(let G=0;G[I.minValue,I.maxValue,0,0]);else{const I=Go(r);f=I!=null?I.statistics:null,a=I!=null?I.histograms:null}else f=e.statistics?.length?e.statistics:l.statistics,a="histograms"in e?e.histograms:void 0,a||(a=l.histograms);s!=="percentClip"&&s!=="histogramEqualization"||a?.length||(s="minMax");const u=f?.length||a?.length||l.bandCount,n=[],c=[];let h,m,p,y,S,v,k,w,d;f&&!Array.isArray(f[0])&&(f=f.map(I=>[I.min,I.max,I.avg,I.stddev]));const[g,T]=br(l.pixelType);if(!f?.length){for(f=[],w=0;wA[1]&&(c[w]=A[1])}}break;case"histogramEqualization":for(ze(a),w=0;w=20&&(y[0]=y[1]=y[2]=y[y.length-1]=y[y.length-2]=0),p=0,m=(h.max-h.min)/h.size,k=h.min===-.5&&m===1?.5:0,d=0;dv){n[w]=h.min+m*(d+k);break}for(v=(1-(e.maxPercent||0)/100)*p,c[w]=h.max+k,d=h.size-2;d>=0;d--)if(S[d]ar(I)))):(b=e.max||255,C=e.min||0),Uo({minCutOff:n,maxCutOff:c,outMax:b,outMin:C,histogramLut:x},o)}function Uo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:i,outMin:l,outMax:f,histogramLut:a}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(s=>o[s]),maxCutOff:t.map(s=>i[s]),histogramLut:a?t.map(s=>a[s]):null,outMin:l,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function rt(e,t){if(!e?.pixels?.length)return e;const{mask:r,bandMasks:o,width:i,height:l,pixels:f}=e,{minCutOff:a,maxCutOff:s,gamma:u}=t,n=t.outMin||0,c=t.outMax||255,h=i*l,m=t.outputPixelType||"u8",p=e.pixels.map(()=>re.createEmptyBand(m,h)),y=p.length,S=c-n,v=[],k=[];for(let C=0;C=y,g=!!t.isRenderer;if(d){const C=sr(y,u);for(let b=0;b1&&(P-=(1/S)**(E*C[b])),Aa[b]){const R=P*S*E**(1/u[b])+n;p[b][I]=g?Math.floor(R):w?Math.round(R):R}else A>=s[b]?p[b][I]=c:p[b][I]=n}}}else for(let C=0;Ca[C]){const A=(I-a[C])*v[C]+n;p[C][x]=g?Math.floor(A):w?Math.round(A):A}else I>=s[C]?p[C][x]=c:p[C][x]=n}}const T=new re({width:i,height:l,mask:r,bandMasks:o,pixels:p,pixelType:m});return T.updateStatistics(),T}const ne=1,ke=1/111e3;function lr(e){let{altitude:t,azimuth:r}=e;const{hillshadeType:o,pixelSizePower:i=1,pixelSizeFactor:l=1,scalingType:f,isGCS:a,resolution:s}=e,u=o==="multi-directional"?2*e.zFactor:e.zFactor,{x:n,y:c}=s;let h=u/(8*n),m=u/(8*c);if(a&&u>.001&&(h/=ke,m/=ke),f==="adjusted")if(a){const E=n*ke,P=c*ke;h=(u+E**i*l)/(8*E),m=(u+P**i*l)/(8*P)}else h=(u+n**i*l)/(8*n),m=(u+c**i*l)/(8*c);let p=(90-t)*Math.PI/180,y=Math.cos(p),S=(360-r+90)*Math.PI/180,v=Math.sin(p)*Math.cos(S),k=Math.sin(p)*Math.sin(S);const w=[315,270,225,360,180,0],d=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),T=g.reduce((E,P)=>E+P),C=g.map(E=>E/T),b=o==="multi-directional"?w.length:1,x=new Float32Array(6),I=new Float32Array(6),A=new Float32Array(6);if(o==="multi-directional")for(let E=0;Ep?p:S],w=f[y],d=w*k,g=d*(1-Math.abs(v%2-1)),T=w-d;switch(Math.floor(v)){case 0:c[y]=d+T,h[y]=g+T,m[y]=T;break;case 1:c[y]=g+T,h[y]=d+T,m[y]=T;break;case 2:c[y]=T,h[y]=d+T,m[y]=g+T;break;case 3:c[y]=T,h[y]=g+T,m[y]=d+T;break;case 4:c[y]=g+T,h[y]=T,m[y]=d+T;break;case 5:case 6:c[y]=d+T,h[y]=T,m[y]=g+T}}e.pixels=[c,h,m],e.updateStatistics()}function nn(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,i=t.pixelSizeFactor??1,l=t.slopeType,f=t.isGCS,{x:a,y:s}=t.resolution;let u=r/(8*a),n=r/(8*s);f&&Math.abs(r-1)<1e-4&&(u/=ke,n/=ke),l==="adjusted"&&(u=(r+a**o*i)/(8*a),n=(r+s**o*i)/(8*s));const{dzxs:c,dzys:h,outMask:m}=Ke(e),{width:p,height:y}=e,S=new Float32Array(p*y);for(let k=ne;k360&&(v%=360)),n[h+m]=v}}}return Ye(n,s,u),new re({width:s,height:u,pixels:[n],mask:a,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[new dt(-1,360)]})}function sn(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=Ke(e,t),{width:i,height:l}=e;Ye(r,i,l);const f=new re({width:i,height:l,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}function ln(e,t,r){const{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizeFactor:a,pixelSizePower:s,slopeType:u}=e;return{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizePower:s,pixelSizeFactor:a,scalingType:u==="scaled"?"adjusted":"none",resolution:t,isGCS:r}}let Te=class extends Ge{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!jt(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const o=e.extent,i=o.spatialReference.isGeographic,l={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:i,resolution:l});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!jt(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),rt(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:a}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:a,isClassBreaks:this.rendererJSON.type==="classBreaks",type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:i}=e,{rendererJSON:l}=this;return l.type==="rasterStretch"?this._generateStretchWebGLParams(t,l,i):l.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(l,r,o??void 0):l.type==="vectorField"?this._generateVectorFieldWebGLParams(l):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:Ze(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?Ze(e,this.lookup.colormapLut):vr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:o,bandCount:i}=r,l=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let a,s;const{dra:u}=l,{gamma:n}=this.lookup;if(l.stretchType==="histogramEqualization"){const c=u?null:this.lookup?.histogramLut,h=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!c}),m=rt(e,{...h,gamma:n,isRenderer:!0});s=It(m,{lut:u?h.histogramLut:c,offset:0})}else if(f){if(u){const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});a=zt({pixelType:o,...c,gamma:n,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;i>1&&t!=null&&t.length===e?.pixels.length&&a?.lut.length===i&&(a={lut:t.map(c=>a.lut[c]),offset:a.offset}),s=It(e,a)}else{const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});s=rt(e,{...c,gamma:n,isRenderer:!0})}if(l.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;s=Ze(s,this.lookup?.colormapLut)}return s}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,o={...r,...t},i=No(e,o);if(!r.colorRamp)return i;let l;if(this._isLUTChanged(!0)){if(!this.bind().success)return i;l=this.lookup?this.lookup.hsvMap:null}else l=this.lookup?this.lookup.hsvMap:null;if(!l)return i;const f=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return Bo(i,e,l,f),i}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,i=e.field1;if(!i)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const l=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Eo(this.rasterInfo,i)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const a=[];if(r!=null){const u=r.fields.find(n=>n.name.toLowerCase()==="value");if(!u)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(n=>{const c=e.uniqueValueInfos?.find(m=>String(m.value)===String(n.attributes[i])),h=c?.symbol?.color;h?a.push([n.attributes[u.name]].concat(h)):l&&a.push([n.attributes[u.name]].concat(l.color))})}else{if(i.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};e.uniqueValueInfos?.forEach(u=>{const n=u?.symbol?.color;n?a.push([parseInt(""+u.value,10)].concat(n)):l&&a.push([parseInt(""+u.value,10)].concat(l?.color))})}if(a.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Oe({colormap:a});return this.lookup={rendererJSON:e,colormapLut:s},this.canRenderInWebGL=et(s?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Ro(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,i)=>o[0]-i[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Oe({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=et(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Po(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=Et(e.colorRamp,{interpolateAlpha:!0}),r=Oe({colormap:t}),o=Or(r.indexedColormap);this.lookup={rendererJSON:e,colormapLut:r,hsvMap:o}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,o=t!=null?t.fields.find(f=>f.name.toLowerCase()==="value"):null,i=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,l=o!=null&&i!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||l,tableValueField:o,tableBreakField:i}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:i}=this._analyzeClassBreaks(e),l=e.classBreakInfos;if(!l?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=l.sort((c,h)=>c.classMaxValue-h.classMaxValue),a=f[f.length-1];let s=e.minValue;if(!r){const c=[];for(let h=0;hw>v);k&&u.push([S].concat(k.symbol.color))}}else{s=Math.floor(e.minValue);for(let c=0;car(c));this.lookup={rendererJSON:e,histogramLut:n}}else if(u){const n=Le(e,{rasterInfo:this.rasterInfo}),c=zt({pixelType:s,...n,gamma:l?a:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:c}}if(f&&!zo(f)){const n=Et(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Oe({colormap:n}),this.lookup.rendererJSON=e}return this.lookup.gamma=l&&a?.length?a:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let o=null,i=null;const l=this.lookup?.colormapLut;t.colorRamp&&l&&(o=l.indexedColormap,i=l.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,a=!(!t.useGamma||!f?.some(w=>w!==1)),{minCutOff:s,maxCutOff:u,outMin:n,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let h=0;e!=null&&(h=e.getPlaneCount(),h===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,p=Math.min(3,r?.length||h||m,m),y=new Float32Array(p),S=o||a?1:255;let v;for(v=0;v1?f[v]>2?k[v]=6.5+(f[v]-2)**2.5:k[v]=6.5+100*(2-f[v])**4:k[v]=1;return{bandCount:p,outMin:n/S,outMax:c/S,minCutOff:s,maxCutOff:u,factor:y,useGamma:a,gamma:a?f:[1,1,1],gammaCorrection:a?k:[1,1,1],colormap:o,colormapOffset:i,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let o=null,i=null;const l=this.lookup?.colormapLut;e.colorRamp&&l&&(o=l.indexedColormap,i=l.offset);const f={...e,isGCS:t,resolution:r},a=lr(f),s=this.rasterInfo.statistics?.[0];return{...a,minValue:s?.min??0,maxValue:s?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:i}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:o,visualVariables:i,symbolTileSize:l,flowRepresentation:f}=e;let a;const s=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,n=i?.find(v=>v.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*l,minDataValue:s,minSize:.2*l},c=n.minDataValue??s,h=n.maxDataValue??u,m=n.maxSize!=null&&n.minSize!=null?[n.minSize/l,n.maxSize/l]:[.2,.8];if(t==="wind_speed"){const v=(m[0]+m[1])/2;m[0]=m[1]=v}const p=c!=null&&h!=null?[c,h]:null;if(t==="classified_arrow")if(c!=null&&h!=null&&n!=null){a=[];const v=(n.maxDataValue-n.minDataValue)/5;for(let k=0;k<6;k++)a.push(n.minDataValue+v*k)}else a=[0,1e-6,3.5,7,10.5,14];const y=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=i?.find(v=>v.type==="rotationInfo");return{breakValues:a,dataRange:p,inputUnit:r,outputUnit:o,symbolTileSize:l,symbolPercentRange:m,style:t||"single_arrow",rotation:y,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":S?.rotationType||e.rotationType,type:"vectorField"}}};D([N({json:{write:!0}})],Te.prototype,"rendererJSON",void 0),D([N({type:Gr,json:{write:!0}})],Te.prototype,"rasterInfo",void 0),D([N({json:{write:!0}})],Te.prototype,"lookup",void 0),D([N()],Te.prototype,"canRenderInWebGL",void 0),Te=D([Me("esri.renderers.support.RasterSymbolizer")],Te);const un=Te;function Fo(e){return e==="percentClip"||e==="histogramEqualization"}function Vo(e){return e!=null&&e.length>0&&e[0].min!=null&&e[0].max!=null}function jt(e){return Se(e)&&e.validPixelCount!==0}function zo(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}export{ln as $,tr as A,xr as B,Po as C,rr as D,Ae as E,lo as F,Tr as G,no as H,Bo as I,Ct as J,Yo as K,Jr as L,Je as N,Le as P,sn as Q,Go as S,lr as T,Xo as V,Gr as W,an as X,$o as Y,nn as Z,en as _,qo as a,Zo as b,Mr as c,rn as d,Jo as e,Ko as f,et as g,Oo as h,Et as i,tn as j,ke as k,Or as l,zt as m,Ht as n,rt as o,sr as p,Dr as q,Rr as r,on as s,un as t,gt as u,so as v,Ro as w,No as x,Eo as y,Qo as z}; diff --git a/main/assets/RasterSymbolizer-BVys6HkM-CeBx4Ld8.js b/main/assets/RasterSymbolizer-BVys6HkM-CeBx4Ld8.js deleted file mode 100644 index 2d5182643..000000000 --- a/main/assets/RasterSymbolizer-BVys6HkM-CeBx4Ld8.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lerc-wasm-p5Heunzu-CsUnIe3C.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{aK as _t,v as D,S as N,i as Me,a0 as cr,ac as hr,w as fr,n as vt,J as dr,e as Ge,P as oe,o as ge,O as ze,a1 as wt,c$ as pr,x as mr,aS as gr,ar as Tt,_ as yr,bw as Cr}from"./main-BZaw9FpY.js";import{D as re,b as ft,n as br,L as Se,c as dt,r as Ze,h as vr,d as It,e as Oe}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{t as Wt}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{S as _e,T as St,U as xt,l as wr}from"./colorUtils-Cthpxcks-BhGjp9AU.js";const Jo=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],Ht=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],Tr=new _t({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Ve(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]kt(r))),t}return kt(e)}function At(e,t){if(!e)return;const r=Ht;let o=null;return e.type==="algorithmic"?r.some(i=>{if(Ve(e.fromColor.toRgb(),i.fromColor)&&Ve(e.toColor.toRgb(),i.toColor))return o=i.id,!0}):e.type==="multipart"&&r.some(i=>{const l=e.colorRamps,f=i.colorRamps;if(l&&f&&l.length===f.length&&!f.some((a,s)=>{if(!Ve(l[s].fromColor.toRgb(),new Tt(a.fromColor).toRgb())||!Ve(l[s].toColor.toRgb(),new Tt(a.toColor).toRgb()))return!0})){if(o)return!0;o=i.id}}),o}function Sr(e,t,r=!1){if(!e)return;let o=!1,i=At(e);return i!=null||r||(o=!0,i=At(e=Ir(e))),i?{id:i,inverted:o}:void 0}function xr(e,t=!1){const r=typeof e=="string"?e:Sr(e,void 0,t)?.id;return r?Tr.toJSON(r):null}function Ko(e,t="esriCIELabAlgorithm"){const r=Ht.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function Jt(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),i=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:i,isCustomInterval:o,weights:e.weights}}function kr(e,t,r){const{numColors:o,distanceOffset:i,distanceInterval:l,isCustomInterval:f}=r,a=e.s===0,s=t.s===0;let u=e.h,n=t.h;a&&!s?u=n:s&&!a&&(t={...t,h:u},n=u);let c,h=Math.abs(n-u);const m=360;hn?h*l:-h*l);const p=(t.s-e.s)*l,y=(t.v-e.v)*l;let{s:S,v}=e,k=u;if(i){const d=i/l;k=(k+d*c+m)%m,S+=d*p,v+=d*y}const w=[];for(let d=0;dh+m);i=i.map(h=>h/c)}else{i=[];for(let c=0;c{i.unshift(l),o||i.pop()}),r}function Or(e){const t=[];for(let r=0;r{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const $o=new _t({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Dr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var ot;function we(e){return e=Number(e),isNaN(e)?void 0:e}let he=ot=class extends Ge{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new ot({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};D([N({json:{name:"BandName",write:!0}})],he.prototype,"name",void 0),D([N({json:{name:"WavelengthMin",read:{reader:we},write:!0}})],he.prototype,"minWavelength",void 0),D([N({json:{name:"WavelengthMax",read:{reader:we},write:!0}})],he.prototype,"maxWavelength",void 0),D([N({json:{name:"RadianceBias",read:{reader:we},write:!0}})],he.prototype,"radianceBias",void 0),D([N({json:{name:"RadianceGain",read:{reader:we},write:!0}})],he.prototype,"radianceGain",void 0),D([N({json:{name:"ReflectanceBias",read:{reader:we},write:!0}})],he.prototype,"reflectanceBias",void 0),D([N({json:{name:"ReflectanceGain",read:{reader:we},write:!0}})],he.prototype,"reflectanceGain",void 0),D([N({json:{name:"SolarIrradiance",read:{reader:we},write:!0}})],he.prototype,"solarIrradiance",void 0),he=ot=D([Me("esri.layers.support.RasterBandInfo")],he);const Ot=he;var nt;function De(e){return e=Number(e),isNaN(e)?void 0:e}let se=nt=class extends Ge{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(e){return new Date(e)}writeAcquisitionDate(e,t){t.AcquisitionDate=e.getTime()}clone(){return new nt({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};D([N({json:{name:"AcquisitionDate",write:!0}})],se.prototype,"acquisitionDate",void 0),D([cr("acquisitionDate")],se.prototype,"readAcquisitionDate",null),D([hr("acquisitionDate")],se.prototype,"writeAcquisitionDate",null),D([N({json:{name:"CloudCover",read:{reader:De},write:!0}})],se.prototype,"cloudCover",void 0),D([N({json:{name:"ProductName",write:!0}})],se.prototype,"productName",void 0),D([N({json:{name:"SensorName",write:!0}})],se.prototype,"sensorName",void 0),D([N({json:{name:"SensorAzimuth",read:{reader:De},write:!0}})],se.prototype,"sensorAzimuth",void 0),D([N({json:{name:"SensorElevation",read:{reader:De},write:!0}})],se.prototype,"sensorElevation",void 0),D([N({json:{name:"SunAzimuth",read:{reader:De},write:!0}})],se.prototype,"sunAzimuth",void 0),D([N({json:{name:"SunElevation",read:{reader:De},write:!0}})],se.prototype,"sunElevation",void 0),se=nt=D([Me("esri.layers.support.RasterSensorInfo")],se);const Lr=se;var it;let te=it=class extends Ge{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new it({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:oe(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:oe(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:oe(this.tileInfo),transposeInfo:oe(this.transposeInfo),blockBoundary:oe(this.blockBoundary)})}};D([N({type:Number,json:{write:!0}})],te.prototype,"blockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"blockHeight",void 0),D([N({type:String,json:{write:!0}})],te.prototype,"compression",void 0),D([N({type:fr,json:{write:!0}})],te.prototype,"origin",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"firstPyramidLevel",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"maximumPyramidLevel",void 0),D([N({json:{write:!0}})],te.prototype,"pyramidResolutions",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidScalingFactor",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockHeight",void 0),D([N({type:Boolean,json:{write:!0}})],te.prototype,"isVirtualTileInfo",void 0),D([N({json:{write:!0}})],te.prototype,"tileInfo",void 0),D([N()],te.prototype,"transposeInfo",void 0),D([N()],te.prototype,"blockBoundary",void 0),te=it=D([Me("esri.layers.support.RasterStorageInfo")],te);const Mr=te;var at;let $=at=class extends Ge{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const e=this.keyProperties.BandProperties,{bandCount:t}=this;if(!e?.length||e.lengthOt.fromJSON(o));for(let o=0;oa&&(f=a)}else{for(;!this.eof;)this.readBlock();f=this.bufferLength}return this.pos=f,this.buffer.subarray(l,f)},lookChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(i,l,f){for(var a=i+l;this.bufferLength<=a&&!this.eof;)this.readBlock();return new Stream(this.buffer,i,l,f)},skip:function(i){i||(i=1),this.pos+=i},reset:function(){this.pos=0}},o}(),(r=function(){if(!self||!self.Uint32Array)return null;var o=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),l=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),f=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],a=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function s(n){throw new Error(n)}function u(n){var c=0,h=n[c++],m=n[c++];h!=-1&&m!=-1||s("Invalid header in flate stream"),(15&h)!=8&&s("Unknown compression method in flate stream"),((h<<8)+m)%31!=0&&s("Bad FCHECK in flate stream"),32&m&&s("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=c,this.codeSize=0,this.codeBuf=0,e.call(this)}return u.prototype=Object.create(e.prototype),u.prototype.getBits=function(n){for(var c,h=this.codeSize,m=this.codeBuf,p=this.bytes,y=this.bytesPos;h>n,this.codeSize=h-=n,this.bytesPos=y,c},u.prototype.getCode=function(n){for(var c=n[0],h=n[1],m=this.codeSize,p=this.codeBuf,y=this.bytes,S=this.bytesPos;m>16,d=65535&k;return(m==0||m>w,this.codeSize=m-w,this.bytesPos=S,d},u.prototype.generateHuffmanTable=function(n){for(var c=n.length,h=0,m=0;mh&&(h=n[m]);for(var p=1<>=1;for(m=d;m0;)Y[k++]=H}var c=this.getBits(3);if(1&c&&(this.eof=!0),(c>>=1)!=0){var h,m;if(c==1)h=f,m=a;else if(c==2){for(var p=this.getBits(5)+257,y=this.getBits(5)+1,S=this.getBits(4)+4,v=Array(o.length),k=0;k=b&&(b=(O=this.ensureBuffer(x+1)).length),O[x++]=I;else{if(I==256)return void(this.bufferLength=x);var A=(I=i[I-=257])>>16;A>0&&(A=this.getBits(A)),d=(65535&I)+A,I=this.getCode(m),(A=(I=l[I])>>16)>0&&(A=this.getBits(A));var E=(65535&I)+A;x+d>=b&&(b=(O=this.ensureBuffer(x+d)).length);for(var P=0;P{let n=null;f==="jpg"&&a&&(n=Yt._getMask(t,{width:i,height:l}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),h=URL.createObjectURL(c),m=new Image;let p;m.src=h,m.onload=()=>{if(URL.revokeObjectURL(h),mr(o))return void u(gr());i=m.width,l=m.height,this._canvas&&this._ctx?(this._canvas.width===i&&this._canvas.height===l||(this._canvas.width=i,this._canvas.height=l),this._ctx.clearRect(0,0,i,l)):(this._canvas=document.createElement("canvas"),this._canvas.width=i,this._canvas.height=l,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(m,0,0);const y=this._ctx.getImageData(0,0,i,l);let S;if(p=y.data,r.renderOnCanvas){if(n)for(S=0;S{URL.revokeObjectURL(h),u("cannot load image")}})}static _getMask(t,r){let o=null;try{const i=new Uint8Array(t),l=Math.ceil(i.length/2);let f=0;const a=i.length-2;for(f=l;f=0;c--)o[u++]=s[n]>>c&1}}catch{}return o}};var Mt,Gt={exports:{}};function Br(){return Mt||(Mt=1,e=Gt,t=function(){var o=function(){function i(l){this.message="JPEG error: "+l}return i.prototype=new Error,i.prototype.name="JpegError",i.constructor=i,i}();return function(){if(!self||!self.Uint8ClampedArray)return null;var i=new Uint8Array([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]),l=4017,f=799,a=3406,s=2276,u=1567,n=3784,c=5793,h=2896;function m(){this.decodeTransform=null,this.colorTransform=-1}function p(d,g){for(var T,C,b=0,x=[],I=16;I>0&&!d[I-1];)I--;x.push({children:[],index:0});var A,E=x[0];for(T=0;T0;)E=x.pop();for(E.index++,x.push(E);x.length<=T;)x.push(A={children:[],index:0}),E.children[E.index]=A.children,E=A;b++}T+10)return B--,U>>B&1;if((U=d[g++])===255){var M=d[g++];if(M)throw new o("unexpected marker "+(U<<8|M).toString(16))}return B=7,U>>>7}function J(M){for(var K=M;;){if(typeof(K=K[L()])=="number")return K;if(typeof K!="object")throw new o("invalid huffman sequence")}}function O(M){for(var K=0;M>0;)K=K<<1|L(),M--;return K}function z(M){if(M===1)return L()===1?1:-1;var K=O(M);return K>=1<>4;if(ee!==0){var ur=i[ie+=ae];M.blockData[K+ur]=z(ee),ie++}else{if(ae<15)break;ie+=16}}}function V(M,K){var q=J(M.huffmanTableDC),Q=q===0?0:z(q)<0)_--;else for(var q=x,Q=I;q<=Q;){var ie=J(M.huffmanTableAC),ce=15&ie,ee=ie>>4;if(ce!==0){var ae=i[q+=ee];M.blockData[K+ae]=z(ce)*(1<>4,(q=15&Q)==0)ee<15?(_=O(ee)+(1<=65488&&ve<=65495))break;g+=2}return(le=w(d,g))&&le.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+le.invalid),g=le.offset),g-G}function v(d,g,T){var C,b,x,I,A,E,P,R,G,U,B,L,J,O,z,F,V,Y=d.quantizationTable,_=d.blockData;if(!Y)throw new o("missing required Quantization Table.");for(var j=0;j<64;j+=8)G=_[g+j],U=_[g+j+1],B=_[g+j+2],L=_[g+j+3],J=_[g+j+4],O=_[g+j+5],z=_[g+j+6],F=_[g+j+7],G*=Y[j],U|B|L|J|O|z|F?(U*=Y[j+1],B*=Y[j+2],L*=Y[j+3],J*=Y[j+4],O*=Y[j+5],z*=Y[j+6],F*=Y[j+7],b=(C=(C=c*G+128>>8)+(b=c*J+128>>8)+1>>1)-b,V=(x=B)*n+(I=z)*u+128>>8,x=x*u-I*n+128>>8,P=(A=(A=h*(U-F)+128>>8)+(P=O<<4)+1>>1)-P,E=(R=(R=h*(U+F)+128>>8)+(E=L<<4)+1>>1)-E,I=(C=C+(I=V)+1>>1)-I,x=(b=b+x+1>>1)-x,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,P=V,T[j]=C+R,T[j+7]=C-R,T[j+1]=b+P,T[j+6]=b-P,T[j+2]=x+E,T[j+5]=x-E,T[j+3]=I+A,T[j+4]=I-A):(V=c*G+512>>10,T[j]=V,T[j+1]=V,T[j+2]=V,T[j+3]=V,T[j+4]=V,T[j+5]=V,T[j+6]=V,T[j+7]=V);for(var H=0;H<8;++H)G=T[H],(U=T[H+8])|(B=T[H+16])|(L=T[H+24])|(J=T[H+32])|(O=T[H+40])|(z=T[H+48])|(F=T[H+56])?(b=(C=4112+((C=c*G+2048>>12)+(b=c*J+2048>>12)+1>>1))-b,V=(x=B)*n+(I=z)*u+2048>>12,x=x*u-I*n+2048>>12,I=V,P=(A=(A=h*(U-F)+2048>>12)+(P=O)+1>>1)-P,E=(R=(R=h*(U+F)+2048>>12)+(E=L)+1>>1)-E,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,G=(G=(C=C+I+1>>1)+R)<16?0:G>=4080?255:G>>4,U=(U=(b=b+x+1>>1)+(P=V))<16?0:U>=4080?255:U>>4,B=(B=(x=b-x)+E)<16?0:B>=4080?255:B>>4,L=(L=(I=C-I)+A)<16?0:L>=4080?255:L>>4,J=(J=I-A)<16?0:J>=4080?255:J>>4,O=(O=x-E)<16?0:O>=4080?255:O>>4,z=(z=b-P)<16?0:z>=4080?255:z>>4,F=(F=C-R)<16?0:F>=4080?255:F>>4,_[g+H]=G,_[g+H+8]=U,_[g+H+16]=B,_[g+H+24]=L,_[g+H+32]=J,_[g+H+40]=O,_[g+H+48]=z,_[g+H+56]=F):(V=(V=c*G+8192>>14)<-2040?0:V>=2024?255:V+2056>>4,_[g+H]=V,_[g+H+8]=V,_[g+H+16]=V,_[g+H+24]=V,_[g+H+32]=V,_[g+H+40]=V,_[g+H+48]=V,_[g+H+56]=V)}function k(d,g){for(var T=g.blocksPerLine,C=g.blocksPerColumn,b=new Int16Array(64),x=0;x=b)return null;var I=C(g);if(I>=65472&&I<=65534)return{invalid:null,marker:I,offset:g};for(var A=C(x);!(A>=65472&&A<=65534);){if(++x>=b)return null;A=C(x)}return{invalid:I.toString(16),marker:A,offset:x}}return m.prototype={parse:function(d){function g(){var M=d[I]<<8|d[I+1];return I+=2,M}function T(){var M=g(),K=I+M-2,q=w(d,K,I);q&&q.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+q.invalid),K=q.offset);var Q=d.subarray(I,K);return I+=Q.length,Q}function C(M){for(var K=Math.ceil(M.samplesPerLine/8/M.maxH),q=Math.ceil(M.scanLines/8/M.maxV),Q=0;Q>4){if(F>>4!=1)throw new o("DQT - invalid table spec");for(L=0;L<64;L++)V[i[L]]=g()}else for(L=0;L<64;L++)V[i[L]]=d[I++];P[15&F]=V}break;case 65472:case 65473:case 65474:if(b)throw new o("Only single frame JPEGs supported");g(),(b={}).extended=U===65473,b.progressive=U===65474,b.precision=d[I++],b.scanLines=g(),b.samplesPerLine=g(),b.components=[],b.componentIds={};var Y,_=d[I++],j=0,H=0;for(B=0;B<_;B++){Y=d[I];var X=d[I+1]>>4,Pe=15&d[I+1];j>4?R:G)[15&pe]=p(ue,ye)}break;case 65501:g(),x=g();break;case 65498:g();var Z,Re=d[I++],Ce=[];for(B=0;B>4],Z.huffmanTableAC=R[15&be],Ce.push(Z)}var Ne=d[I++],Be=d[I++],de=d[I++],Fe=S(d,I,b,Ce,x,Ne,Be,de>>4,15&de);I+=Fe;break;case 65535:d[I]!==255&&I--;break;default:if(d[I-3]===255&&d[I-2]>=192&&d[I-2]<=254){I-=3;break}throw new o("unknown marker "+U.toString(16))}U=g()}for(this.width=b.samplesPerLine,this.height=b.scanLines,this.jfif=A,this.eof=I,this.adobe=E,this.components=[],B=0;B>8)+_[R+1];return F},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var g,T,C,b=0,x=d.length;b4)throw new o("Unsupported color mode");var C=this._getLinearizedBlockData(d,g);if(this.numComponents===1&&T){for(var b=C.length,x=new Uint8ClampedArray(3*b),I=0,A=0;A=0;p--)c[S++]=y[h]>>p&1}catch{}if(f===1&&s.length===i*l){const y=new Uint8Array(s.buffer);n=[y,y,y]}else{for(n=[],h=0;h<3;h++)n.push(new Uint8Array(u));for(p=0,m=0;mimport("./lerc-wasm-p5Heunzu-CsUnIe3C.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>Cr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{zr(e)}),Xe)}const We={getBlobInfo:null,decode:null};function Vr(e){return 16+(e>>3<<3)}function me(e,t,r){r.set(e.slice(t,t+r.length))}function zr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:i,_lerc_decode_4D:l,asm:f}=e;let a;const s=Object.values(f).find(n=>n&&"buffer"in n&&n.buffer===e.HEAPU8.buffer),u=n=>{const c=n.map(y=>Vr(y)),h=c.reduce((y,S)=>y+S),m=t(h);a=new Uint8Array(s.buffer);let p=c[0];c[0]=m;for(let y=1;y{const c=new Uint8Array(48),h=new Uint8Array(8*3),[m,p,y]=u([n.length,c.length,h.length]);a.set(n,m),a.set(c,p),a.set(h,y);let S=o(m,n.length,p,y,12,3);if(S)throw r(m),new Error(`lerc-getBlobInfo: error code is ${S}`);a=new Uint8Array(s.buffer),me(a,p,c),me(a,y,h);const v=new Uint32Array(c.buffer),k=new Float64Array(h.buffer),[w,d,,g,T,C,b,x,I,A,E]=v,P={version:w,depthCount:A,width:g,height:T,validPixelCount:b,bandCount:C,blobSize:x,maskCount:I,dataType:d,minValue:k[0],maxValue:k[1],maxZerror:k[2],statistics:[],bandCountWithNoData:E};if(E&&A>1)return r(m),P;if(A===1&&C===1)return r(m),P.statistics.push({minValue:k[0],maxValue:k[1]}),P;const R=A*C*8,G=new Uint8Array(R),U=new Uint8Array(R);let B=m,L=0,J=0,O=!1;if(a.byteLength1){const _=z.slice(Y*A,(Y+1)*A),j=F.slice(Y*A,(Y+1)*A),H=Math.min.apply(null,_),X=Math.max.apply(null,j);V.push({minValue:H,maxValue:X,depthStats:{minValues:_,maxValues:j}})}else V.push({minValue:z[Y],maxValue:F[Y]});return r(B),O||r(L),P},We.decode=(n,c)=>{const{maskCount:h,depthCount:m,bandCount:p,width:y,height:S,dataType:v,bandCountWithNoData:k}=c,w=$t[v],d=y*S,g=new Uint8Array(d*p),T=d*m*p*w.size,C=new Uint8Array(T),b=new Uint8Array(p),x=new Uint8Array(8*p),[I,A,E,P,R]=u([n.length,g.length,C.length,b.length,x.length]);a.set(n,I),a.set(g,A),a.set(C,E),a.set(b,P),a.set(x,R);const G=l(I,n.length,h,A,m,y,S,p,v,E,P,R);if(G)throw r(I),new Error(`lerc-decode: error code is ${G}`);a=new Uint8Array(s.buffer),me(a,E,C),me(a,A,g);let U=null;if(k){me(a,P,b),me(a,R,x),U=[];const B=new Float64Array(x.buffer);for(let L=0;L1){g.set(k[0]);for(let I=1;I=T;if(m>0&&C)for(let I=0;I1?k:null,{pixelType:x}=y;return{width:s,height:u,bandCount:n,pixelType:x,depthCount:c,statistics:p,pixels:v,mask:g,bandMasks:b,noDataValues:a}}function _r(e,t,r,o=!0){if(t%4!=0||r%4!=0){const i=new ArrayBuffer(4*Math.ceil(r/4)),l=new Uint8Array(i),f=new Uint8Array(e,t,r);if(o)for(let a=0;a=l)a-=l,h=c>>>32-l,c<<=l;else{h=c>>>32-a,c=i[n++];const v=l-a;a=32-v,h=(h<>>a),c<<=v}if(h===257)break;if(h===256){l=9,f=Ut(),s=f.length,u=[];continue}const S=f[h];if(S==null){if(h>f.length)throw new Error("data integrity issue: code does not exist on code page");u.push(u[0]),f[s++]=u.slice(),Nt(y,u)}else Nt(y,S),u.push(S[0]),u.length>1&&(f[s++]=u.slice()),u=S.slice();if(xe.has(s)&&l++,a===0&&(c=i[n++],a=32),n>m||n===m&&a<=p)break}return new Uint8Array(y)}xe.add(511),xe.add(1023),xe.add(2047),xe.add(4095),xe.add(8191);const Bt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*Qt(o)))},Qt=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},Wr=(e,t)=>{if(8*e.byteLength=0;a--)o[i++]=l>>a&1;for(a=7;i>a&1,a--;return o};let Hr=class{static decode(e,t){const r=t.pixelType,o=[],i=t.width*t.height,l=Bt(e,t),{bandIds:f,format:a}=t,s=f?.length||Bt(e,t),u=e.byteLength-e.byteLength%(i*Qt(r)),n=new r(e,0,i*l);let c,h,m,p,y=null;if(a==="bip")for(c=0;c>4,i<8?i=1:i===15?(i=4,l=(7&l)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):i===14?(i=3,l=(15&l)<<12|(63&e[r++])<<6|63&e[r++]):(i=2,l=(31&l)<<6|63&e[r++]),(l!==0||t)&&(o+=String.fromCharCode(l));return o}const mt=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),Kr=(()=>{const e=mt.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),Yr=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],qr=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),$r=(e,t)=>{let r=(t||mt)[e];return r===void 0&&(r="unknown"+String(e)),r},st=new Map;st.set("EXIFIFD",Kr),st.set("GPSIFD",Yr);const Ae={tiffTags:mt,ifdTags:st,geoKeys:qr,getTagName:$r},gt=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Ft=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Zr=new Set([1,5,6,7,8,34712,34887]);function yt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function He(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function Xr(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function er(e,t){return e.get(t)?.values}function Ie(e,t){return e.get(t)?.values}function Vt(e,t){return e.get(t)?.values?.[0]}function W(e,t){return e.get(t)?.values?.[0]}function Qe(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=l===8,a=f?bt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),s=4+2*l,u=f?8:2,n=u+a*s;if(r+n>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:n};const c=r+n+4<=e.byteLength?je(new DataView(e,r+n,l===8?8:4),0,t,l===8):null,h=r+u,m=new Map;let p,y,S,v,k,w=0,d=0;for(let g=0;gXt(e,{inputOffset:t}).pixels[0];function lt(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,i=new Uint8Array(e.byteLength*o);let l=0;const f=2**t-1;for(let a=0;a>>8-t&f}return i.buffer}function ut(e,t,r){const o=new qt;o.parse(e),o.colorTransform=r===6?-1:0;const i=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(i.buffer)}function ct(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function ht(e,t,r,o,i){const l=gt===t,f=W(r,"BITSPERSAMPLE"),a=W(r,"SAMPLESPERPIXEL")??1,s=W(r,"PHOTOMETRICINTERPRETATION"),u=W(r,"SAMPLEFORMAT")??1,n=yt(u,f),c=W(r,"COMPRESSION")??1,h=He(n);let m,p,y;if(c===34887)return await Zt(),Qr(e,o);if(c===1)m=e.slice(o,o+i),p=new Uint8Array(m);else if(c===8||c===32946)p=new Uint8Array(e,o,i),p=ct(p),m=p.buffer;else if(c===6)p=new Uint8Array(e,o,i),p=ut(p,a,s),m=p.buffer;else if(c===7){const w=r.get("JPEGTABLES").values,d=w.length-2;p=new Uint8Array(d+i-2);for(let T=0;T1&&(c===5||c===8||c===32946)&&v&&k){const w=Je(r),d=new h(y.length);d.set(y),y=uo(d,k,v,u===3&&S===3,w?1:a)}return y}async function eo(e,t,r){const o=Ie(r,"TILEOFFSETS");if(o===void 0)return null;const i=Ie(r,"TILEBYTECOUNTS"),{width:l,height:f,pixelType:a,tileWidth:s,tileHeight:u}=Ct([r]),n=Je(r,t),c=W(r,"SAMPLESPERPIXEL")||t.planes,h=l*f,m=W(r,"BITSPERSAMPLE"),p=(W(r,"COMPRESSION")??1)===34887,y=He(a),S=[];for(let B=0;B1){const B=Math.round(o.length/c);for(v=0;v{const o=gt===t.littleEndian,i=Ie(r,"STRIPOFFSETS");if(i===void 0)return null;const{width:l,height:f,pixelType:a}=Ct([r]),s=W(r,"SAMPLESPERPIXEL")||t.planes,u=W(r,"PHOTOMETRICINTERPRETATION"),n=l*f,c=W(r,"BITSPERSAMPLE"),h=He(a),m=new h(n*s),p=Ie(r,"STRIPBYTECOUNTS"),y=W(r,"ROWSPERSTRIP"),S=W(r,"COMPRESSION")??1;let v,k,w,d,g,T,C,b,x;if(c%8==0)for(v=0;v{if(!(e&&e.length>0&&t&&r))return null;let o,i,l;const f=e[0].length,a=e.length,s=new Uint8Array(f);for(let u=0;ul?0:1;else for(let n=0;nl?0:1);return s},oo=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,i,l,f,a;for(let v=0;v")),f=o.indexOf("sample="),f>-1&&(a=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(i=o.slice(f+6,o.indexOf('"',f+6))),i&&(l=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),a!=null?r.has(i)?r.get(i)[a]=l:r.set(i,[l]):r.set(i,l)),a=null;const s=r.get("STATISTICS_MINIMUM"),u=r.get("STATISTICS_MAXIMUM"),n=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let h=null;if(s&&u){h=[];for(let v=0;vS&&h>(i?e.byteLength:e?e.byteLength-s+o:0))return r.offlineOffsetSize=[s,h],r.values=null,!1;if(m<=S){if(!t)if(S<=32)s>>>=32-m;else{const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);m<=32?(s=k>>>32-m,v[0]=s):(s=k*2**(32-m)+(w>>>32-m),v[0]=k,v[1]=w>>>32-m)}if(a===1&&c===S)u=[s];else if(S===64){const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);let d=k,g=32;for(y=1;y<=a;y++){const T=32-c*y%32;if(g>>32-g,b=w<<32-g>>>32-g;d=w,u.push(C+b*2**(c-g)),g-=32-(c-g)}else u.push(d<>>32-c),g-=c;g===0&&(g=32,d=w)}}else for(y=1;y<=a;y++){const k=32-c*y;u.push(s<>>32-c)}}else{s-=o,i&&(s=0);for(let k=s;kparseFloat(z)),h.some(z=>isNaN(z))&&(h=null));const m=W(t,"COMPRESSION")??1;let p;switch(m){case 1:p="NONE";break;case 2:case 3:case 4:case 32771:p="CCITT";break;case 5:p="LZW";break;case 6:case 7:p="JPEG";break;case 32773:p="PACKBITS";break;case 8:case 32946:p="DEFLATE";break;case 34712:p="JPEG2000";break;case 34887:p="LERC";break;default:p=String(m)}let y=!0,S="";Zr.has(m)||(y=!1,S+="unsupported tag compression "+m),s>3&&(y=!1,S+="unsupported tag sampleFormat "+s),f!==1&&f!==2&&f!==4&&f%8!=0&&(y=!1,S+="unsupported tag bitsPerSample "+f);const v=Vt(t,"GEOASCIIPARAMS");let k;if(v){const z=v.split("|").find(V=>V.includes("ESRI PE String = ")),F=z?z.replace("ESRI PE String = ",""):"";k=F.startsWith("COMPD_CS")||F.startsWith("PROJCS")||F.startsWith("GEOGCS")?{wkid:null,wkt:F}:null}const w=Ie(t,"GEOTIEPOINTS"),d=Ie(t,"GEOPIXELSCALE"),g=Ie(t,"GEOTRANSMATRIX"),T=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let C,b,x=!1,I=!1;if(T){x=W(T,"GTRasterTypeGeoKey")===2;const z=W(T,"GTModelTypeGeoKey");if(z===2){const F=W(T,"GeographicTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F}),k||F!==32767||(I=!0,k={wkid:4326})}else if(z===1){const F=W(T,"ProjectedCSTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F})}}if(d&&w&&w.length>=6?(C=[d[0],0,w[3]-w[0]*d[0],0,-Math.abs(d[1]),w[4]-w[1]*d[1]],x&&(C[2]-=.5*C[0]+.5*C[1],C[5]-=.5*C[3]+.5*C[4])):g&&g.length===16&&(C=x?[g[0],g[1],g[3]-.5*g[0],g[4],g[5],g[7]-.5*g[5]]:[g[0],g[1],g[3],g[4],g[5],g[7]]),C){const z=[{x:0,y:l},{x:0,y:0},{x:i,y:l},{x:i,y:0}];let F,V=Number.POSITIVE_INFINITY,Y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let H=0;HV?V:F.x,_=F.x<_?_:F.x,Y=F.y>Y?Y:F.y,j=F.y400||Math.max(Math.abs(b.xmin),Math.abs(b.xmax))>361)&&(k=null,b.spatialReference=null);const A=tr(e);let E,P,R,G,U;if(A.length>0){R=Math.round(Math.log(i/W(A[0],"IMAGEWIDTH"))/Math.LN2);const z=A[A.length-1];G=A.length,E=W(z,"TILEWIDTH"),P=W(z,"TILELENGTH")}E=G!=null&&G>0?E||r:null,P=G!=null&&G>0?P||o:null,r&&(U=[{maxCol:Math.ceil(i/r)-1,maxRow:Math.ceil(l/o)-1,minRow:0,minCol:0}],A.forEach(z=>{U.push({maxCol:Math.ceil(W(z,"IMAGEWIDTH")/W(z,"TILEWIDTH"))-1,maxRow:Math.ceil(W(z,"IMAGELENGTH")/W(z,"TILELENGTH"))-1,minRow:0,minCol:0})}));const B=Vt(e[0],"GDAL_METADATA"),L=oo(B);S+=" "+or({width:i,height:l,tileWidth:r,tileHeight:o,planes:a,ifds:e});const J=rr(e).length===A.length+1,O=A?.length?A.map(z=>({x:i/W(z,"IMAGEWIDTH"),y:l/W(z,"IMAGELENGTH")})):void 0;return{width:i,height:l,tileWidth:r,tileHeight:o,planes:a,isBSQ:n,pixelType:u,compression:p,noData:h,hasMaskBand:J,isSupported:y,pyramidResolutions:O,message:S,extent:b,isPseudoGeographic:I,affine:d?null:C,firstPyramidLevel:R,maximumPyramidLevel:G,pyramidBlockWidth:E,pyramidBlockHeight:P,tileBoundary:U,metadata:L}}function Je(e,t){const r=er(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function tr(e){return e.filter(t=>W(t,"NEWSUBFILETYPE")===1)}function rr(e){return e.filter(t=>{const r=!(4&~(W(t,"NEWSUBFILETYPE")??0)),o=W(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function io(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=so(e);let i=o;const l=[];do{const f=lo(e,t,i,0,Ae.tiffTags,r?8:4);if(!f.success)break;l.push(f.ifd),i=f.nextIFD}while(i>0);return{...Ct(l),littleEndian:t,isBigTiff:r,ifds:l,pyramidIFDs:tr(l),maskIFDs:rr(l)}}function bt(e,t,r){const o=e.getUint32(t,r),i=e.getUint32(t+4,r);return r?i*Ee+o:o*Ee+i}function ao(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),i=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const l=(r?o:i)>=0?1:-1;return r?o*=l:i*=l,l*(r?i*Ee+o:o*Ee+i)}function je(e,t,r,o){return o?bt(e,t,r):e.getUint32(t,r)}function so(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const i=t.getUint16(2,o);if(i!==42&&i!==43)throw new Error("unexpected tiff identifier");let l=4;const f=i===43;if(f){const a=t.getUint16(l,o);if(l+=2,a!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(l,o)!==0)throw new Error("unsupported bigtiff version");l+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:je(t,l,o,f)}}function lo(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=Qe(e,t,r,o,i,l);let a;const s=f.ifd;if(s){if(Ae.ifdTags.forEach((u,n)=>{s.has(n)&&(a=s.get(n),a.data=Qe(e,t,a.valueOffset-o,o,u).ifd)}),s.has("GEOKEYDIRECTORY")){a=s.get("GEOKEYDIRECTORY");const u=a.values;if(u&&u.length>4){const n=u[0]+"."+u[1]+"."+u[2];a.data=Qe(e,t,a.valueOffset+6-o,o,Ae.geoKeys,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(s.has("XMP")){a=s.get("XMP");const u=a.values;typeof u[0]=="number"&&a.type===7&&(a.values=[Jr(new Uint8Array(u))])}}return f}function or(e){const{width:t,height:r,tileHeight:o,tileWidth:i}=e,l=e.planes,f=i?i*o:t*r,a=W(e.ifds[0],"BITSPERSAMPLE");let s="";return f*l>2**30/(a>8?a/8:1)&&(s=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function uo(e,t,r,o,i){const l=o?4:1,f=r*l*i;o&&(e=new Uint8Array(e.buffer));for(let u=0;ux.min):null,C=g?g.map(x=>x.max):null,b={pixelType:u,width:h,height:m,pixels:v,noDataValue:d};return d!=null?ft(b,d):T&&C&&t.applyMinMaxConstraint&&(b.mask=ro(v,T,C)),b}async function ho(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||io(e),{ifds:i,noData:l}=o;if(i.length===0)throw new Error("no valid image file directory");const f=or(o);if(f)throw f;let a=null;const s=r===-1?i[i.length-1]:i[r],u=l??t.noDataValue;return a=o.tileWidth?await eo(e,o,s):to(e,o,s),a&&(u!=null&&ft(a,u),a)}var fo=function(e){var t,r,o,i,l,f;function a(s){var u,n,c,h,m,p,y,S,v,k,w,d,g;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},m=null;;){switch(u=this.readUInt32(),S=function(){var T,C;for(C=[],T=0;T<4;++T)C.push(String.fromCharCode(this.data[this.pos++]));return C}.call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(u);break;case"fcTL":m&&this.animation.frames.push(m),this.pos+=4,m={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),c=this.readUInt16()||100,m.delay=1e3*h/c,m.disposeOp=this.data[this.pos++],m.blendOp=this.data[this.pos++],m.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,u-=4),s=m?.data||this.imgData,w=0;0<=u?wu;0<=u?++w:--w)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(u),(v=255-this.transparency.indexed.length)>0)for(d=0;0<=v?dv;0<=v?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(u)[0];break;case 2:this.transparency.rgb=this.read(u)}break;case"tEXt":p=(k=this.read(u)).indexOf(0),y=String.fromCharCode.apply(String,k.slice(0,p)),this.text[y]=String.fromCharCode.apply(String,k.slice(p+1));break;case"IEND":return m&&this.animation.frames.push(m),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(g=this.colorType)===4||g===6,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=u}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(s,u,n){var c;return typeof u=="function"&&(n=u),(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="arraybuffer",c.onload=function(){var h;return h=new a(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof u?.getContext=="function"&&h.render(u),typeof n=="function"?n(h):void 0},c.send(null)},r=1,o=2,t=0,a.prototype.read=function(s){var u,n;for(n=[],u=0;0<=s?us;0<=s?++u:--u)n.push(this.data[this.pos++]);return n},a.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.decodePixels=function(s){var u,n,c,h,m,p,y,S,v,k,w,d,g,T,C,b,x,I,A,E,P,R,G;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Ue(s)).getBytes(),b=(d=this.pixelBitlength/8)*this.width,g=new Uint8Array(b*this.height),p=s.length,C=0,T=0,n=0;T1&&n/hnew dt(m,p)),bandMasks:u,depthCount:a,noDataValues:s});return f?.length||h.updateStatistics(),h}async function go(e,t){const r=await ho(e,{...t,noDataValue:null});ze(r);const o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,bandMasks:r.bandMasks,statistics:null});return o.updateStatistics(),o}async function yo(e,t){const r=await co(e,t.customOptions),o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return o.updateStatistics(),o}function nr(e,t){const r=t.pixelType||"u8",o=re.getPixelArrayConstructor(r),i=r==="u8"?e:new o(e.buffer),l=[],f=t.planes||1;if(f===1)l.push(i);else for(let s=0;svo(r,o,e);break;case"tiff":t=go;break;case"deflate":t=Co;break;case"lzw":t=bo;break;case"error":t=()=>{throw new ge("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new ge("rasterCodec:decode","unsupported raster format")}}return t}function xo(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function ko(e,t=1){if(!e)return;const{pixels:r,width:o,height:i,mask:l}=e;if(!r||r.length===0)return;const f=r.length,a=o-1,s=i-1,u=[];let n,c,h,m,p,y,S=null;const v=re.getPixelArrayConstructor(e.pixelType);if(t===0){for(n=0;n1){const a=f.map((n,c)=>i(e.slice(n,f[c+1]),t)),s=await Promise.all(a);l=s[0],l.pixels=s.map(n=>n.pixels[0]);const u=s.map(n=>n.mask);s.some(n=>n!=null)&&(u.forEach((n,c)=>{n==null&&(u[c]=new Uint8Array(l.width*l.height).fill(255))}),l.bandMasks=u,l.mask=re.combineBandMasks(u)),l.updateStatistics()}else l=await i(e,{...t,offset:f?.[0]??t.offset});return o!=="jpg"&&t.noDataValue!=null&&l.depthCount===1&&ft(l,t.noDataValue,{customFloatTolerance:t.tolerance}),t.isPoint&&ko(l),l}function Ao(e){return["u8","s8"].includes(e.pixelType)&&e.statistics?.[0]?.min!=null&&e.statistics[0]?.max!=null&&e.bandCount===1}function Eo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Ao(e)?!0:!(r==null||o>1||t&&r.fields.find(i=>i.name.toLowerCase()===t.toLowerCase())==null)}function Po(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Ro(e,t=!1){const{bandCount:r,colormap:o,pixelType:i}=e;return r===1&&(!!o?.length||!t&&i==="u8")}function Qo(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function en(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function tn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function et(e){return!!e?.length&&e.length<=16384}const tt=1;function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,i=new Uint8Array(r),l=o.reduce((n,c)=>n+c/t,0);let f=0,a=0,s=0,u=l;for(let n=0;n=s){const g=sr(s,o);for(u=0;u1&&(w-=(1/y)**(S*g[u])),kt[u]){const T=w*y*S**(1/o[u])+f;d[n]=l==="floor"?Math.floor(T):l==="round"?Math.round(T):T}else k>=r[u]?d[n]=a:d[n]=f;else d[n]=f;v[u]=d}}else for(u=0;u=r[u])d[n]=a;else{const g=(k-t[u])*m[u]+f;d[n]=l==="floor"?Math.floor(g):l==="round"?Math.round(g):g}v[u]=d}if(e.contrastOffset!=null){const g=Oo(e.contrastOffset,e.brightnessOffset);for(u=0;u0&&r<100?a=(200*f-100*i+2*i*o)/(2*(100-r))+l:r<=0&&r>-100?a=(200*f-100*i+2*i*o)*(100+r)/2e4+l:r===100?(a=200*f-100*i+(i+1)*(100-r)+2*i*o,a=a>0?i:0):r===-100&&(a=l),s[f]=a>i?i:a<0?0:a;return s}function Do(e,t,r){const o=[];for(let i=0;i=255)return tt;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,i=Math.log(e/r),l=Math.log(o/r);if(l===0)return tt;const f=i/l;return isNaN(f)?tt:Math.min(9.9,Math.max(.01,f))}function Mo(e,t,r,o){let i=1/0,l=-1/0,f=0,a=0,s=0,u=0;const n=e.length,c=new Map,h=[];for(let C=0;Cu&&(u=x,s=b),i=bl?b:l,f+=b,a++}}if(a===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const m=f/a;let p=0;for(let C=0;CC).length:n,S=y<=1?0:Math.sqrt(p/(y-1));h.sort((C,b)=>C-b);const v=a>>>1,k={min:i,max:l,avg:m,stddev:S,mode:s,median:a%2?h[Math.floor(v)]:(h[v-1]+h[v])/2};if(["u8","s8","u4","u2","u1"].includes(r)){const C=l-i+1,b=new Uint32Array(C);for(let x=0;xMo(f,i?.[a]??r,o));return{statistics:l.map(({statistics:f})=>f),histograms:l.map(({histogram:f})=>f)}}function Go(e){if(!e?.pixels?.length)return null;const{pixels:t,mask:r,bandMasks:o,pixelType:i}=e,l=e.width*e.height,f=t.length,a=[],s=[],u=256;let n,c,h,m;for(let p=0;pc?E:c,h[E]++}}else for(let A=0;Ac?E:c,h[E]++}h=h.slice(n,c+1)}else{let A=!1;e.statistics||(e.updateStatistics(),A=!0);const E=e.statistics;n=E[p].minValue,c=E[p].maxValue;const P=(c-n)/u;if(P===0){!E||e.validPixelCount||A||e.updateStatistics();const R=(e.validPixelCount||e.width*e.height)/u;for(let G=0;G[I.minValue,I.maxValue,0,0]);else{const I=Go(r);f=I!=null?I.statistics:null,a=I!=null?I.histograms:null}else f=e.statistics?.length?e.statistics:l.statistics,a="histograms"in e?e.histograms:void 0,a||(a=l.histograms);s!=="percentClip"&&s!=="histogramEqualization"||a?.length||(s="minMax");const u=f?.length||a?.length||l.bandCount,n=[],c=[];let h,m,p,y,S,v,k,w,d;f&&!Array.isArray(f[0])&&(f=f.map(I=>[I.min,I.max,I.avg,I.stddev]));const[g,T]=br(l.pixelType);if(!f?.length){for(f=[],w=0;wA[1]&&(c[w]=A[1])}}break;case"histogramEqualization":for(ze(a),w=0;w=20&&(y[0]=y[1]=y[2]=y[y.length-1]=y[y.length-2]=0),p=0,m=(h.max-h.min)/h.size,k=h.min===-.5&&m===1?.5:0,d=0;dv){n[w]=h.min+m*(d+k);break}for(v=(1-(e.maxPercent||0)/100)*p,c[w]=h.max+k,d=h.size-2;d>=0;d--)if(S[d]ar(I)))):(b=e.max||255,C=e.min||0),Uo({minCutOff:n,maxCutOff:c,outMax:b,outMin:C,histogramLut:x},o)}function Uo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:i,outMin:l,outMax:f,histogramLut:a}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(s=>o[s]),maxCutOff:t.map(s=>i[s]),histogramLut:a?t.map(s=>a[s]):null,outMin:l,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function rt(e,t){if(!e?.pixels?.length)return e;const{mask:r,bandMasks:o,width:i,height:l,pixels:f}=e,{minCutOff:a,maxCutOff:s,gamma:u}=t,n=t.outMin||0,c=t.outMax||255,h=i*l,m=t.outputPixelType||"u8",p=e.pixels.map(()=>re.createEmptyBand(m,h)),y=p.length,S=c-n,v=[],k=[];for(let C=0;C=y,g=!!t.isRenderer;if(d){const C=sr(y,u);for(let b=0;b1&&(P-=(1/S)**(E*C[b])),Aa[b]){const R=P*S*E**(1/u[b])+n;p[b][I]=g?Math.floor(R):w?Math.round(R):R}else A>=s[b]?p[b][I]=c:p[b][I]=n}}}else for(let C=0;Ca[C]){const A=(I-a[C])*v[C]+n;p[C][x]=g?Math.floor(A):w?Math.round(A):A}else I>=s[C]?p[C][x]=c:p[C][x]=n}}const T=new re({width:i,height:l,mask:r,bandMasks:o,pixels:p,pixelType:m});return T.updateStatistics(),T}const ne=1,ke=1/111e3;function lr(e){let{altitude:t,azimuth:r}=e;const{hillshadeType:o,pixelSizePower:i=1,pixelSizeFactor:l=1,scalingType:f,isGCS:a,resolution:s}=e,u=o==="multi-directional"?2*e.zFactor:e.zFactor,{x:n,y:c}=s;let h=u/(8*n),m=u/(8*c);if(a&&u>.001&&(h/=ke,m/=ke),f==="adjusted")if(a){const E=n*ke,P=c*ke;h=(u+E**i*l)/(8*E),m=(u+P**i*l)/(8*P)}else h=(u+n**i*l)/(8*n),m=(u+c**i*l)/(8*c);let p=(90-t)*Math.PI/180,y=Math.cos(p),S=(360-r+90)*Math.PI/180,v=Math.sin(p)*Math.cos(S),k=Math.sin(p)*Math.sin(S);const w=[315,270,225,360,180,0],d=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),T=g.reduce((E,P)=>E+P),C=g.map(E=>E/T),b=o==="multi-directional"?w.length:1,x=new Float32Array(6),I=new Float32Array(6),A=new Float32Array(6);if(o==="multi-directional")for(let E=0;Ep?p:S],w=f[y],d=w*k,g=d*(1-Math.abs(v%2-1)),T=w-d;switch(Math.floor(v)){case 0:c[y]=d+T,h[y]=g+T,m[y]=T;break;case 1:c[y]=g+T,h[y]=d+T,m[y]=T;break;case 2:c[y]=T,h[y]=d+T,m[y]=g+T;break;case 3:c[y]=T,h[y]=g+T,m[y]=d+T;break;case 4:c[y]=g+T,h[y]=T,m[y]=d+T;break;case 5:case 6:c[y]=d+T,h[y]=T,m[y]=g+T}}e.pixels=[c,h,m],e.updateStatistics()}function nn(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,i=t.pixelSizeFactor??1,l=t.slopeType,f=t.isGCS,{x:a,y:s}=t.resolution;let u=r/(8*a),n=r/(8*s);f&&Math.abs(r-1)<1e-4&&(u/=ke,n/=ke),l==="adjusted"&&(u=(r+a**o*i)/(8*a),n=(r+s**o*i)/(8*s));const{dzxs:c,dzys:h,outMask:m}=Ke(e),{width:p,height:y}=e,S=new Float32Array(p*y);for(let k=ne;k360&&(v%=360)),n[h+m]=v}}}return Ye(n,s,u),new re({width:s,height:u,pixels:[n],mask:a,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[new dt(-1,360)]})}function sn(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=Ke(e,t),{width:i,height:l}=e;Ye(r,i,l);const f=new re({width:i,height:l,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}function ln(e,t,r){const{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizeFactor:a,pixelSizePower:s,slopeType:u}=e;return{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizePower:s,pixelSizeFactor:a,scalingType:u==="scaled"?"adjusted":"none",resolution:t,isGCS:r}}let Te=class extends Ge{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!jt(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const o=e.extent,i=o.spatialReference.isGeographic,l={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:i,resolution:l});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!jt(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),rt(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:a}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:a,isClassBreaks:this.rendererJSON.type==="classBreaks",type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:i}=e,{rendererJSON:l}=this;return l.type==="rasterStretch"?this._generateStretchWebGLParams(t,l,i):l.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(l,r,o??void 0):l.type==="vectorField"?this._generateVectorFieldWebGLParams(l):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:Ze(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?Ze(e,this.lookup.colormapLut):vr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:o,bandCount:i}=r,l=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let a,s;const{dra:u}=l,{gamma:n}=this.lookup;if(l.stretchType==="histogramEqualization"){const c=u?null:this.lookup?.histogramLut,h=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!c}),m=rt(e,{...h,gamma:n,isRenderer:!0});s=It(m,{lut:u?h.histogramLut:c,offset:0})}else if(f){if(u){const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});a=zt({pixelType:o,...c,gamma:n,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;i>1&&t!=null&&t.length===e?.pixels.length&&a?.lut.length===i&&(a={lut:t.map(c=>a.lut[c]),offset:a.offset}),s=It(e,a)}else{const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});s=rt(e,{...c,gamma:n,isRenderer:!0})}if(l.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;s=Ze(s,this.lookup?.colormapLut)}return s}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,o={...r,...t},i=No(e,o);if(!r.colorRamp)return i;let l;if(this._isLUTChanged(!0)){if(!this.bind().success)return i;l=this.lookup?this.lookup.hsvMap:null}else l=this.lookup?this.lookup.hsvMap:null;if(!l)return i;const f=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return Bo(i,e,l,f),i}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,i=e.field1;if(!i)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const l=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Eo(this.rasterInfo,i)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const a=[];if(r!=null){const u=r.fields.find(n=>n.name.toLowerCase()==="value");if(!u)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(n=>{const c=e.uniqueValueInfos?.find(m=>String(m.value)===String(n.attributes[i])),h=c?.symbol?.color;h?a.push([n.attributes[u.name]].concat(h)):l&&a.push([n.attributes[u.name]].concat(l.color))})}else{if(i.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};e.uniqueValueInfos?.forEach(u=>{const n=u?.symbol?.color;n?a.push([parseInt(""+u.value,10)].concat(n)):l&&a.push([parseInt(""+u.value,10)].concat(l?.color))})}if(a.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Oe({colormap:a});return this.lookup={rendererJSON:e,colormapLut:s},this.canRenderInWebGL=et(s?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Ro(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,i)=>o[0]-i[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Oe({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=et(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Po(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=Et(e.colorRamp,{interpolateAlpha:!0}),r=Oe({colormap:t}),o=Or(r.indexedColormap);this.lookup={rendererJSON:e,colormapLut:r,hsvMap:o}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,o=t!=null?t.fields.find(f=>f.name.toLowerCase()==="value"):null,i=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,l=o!=null&&i!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||l,tableValueField:o,tableBreakField:i}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:i}=this._analyzeClassBreaks(e),l=e.classBreakInfos;if(!l?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=l.sort((c,h)=>c.classMaxValue-h.classMaxValue),a=f[f.length-1];let s=e.minValue;if(!r){const c=[];for(let h=0;hw>v);k&&u.push([S].concat(k.symbol.color))}}else{s=Math.floor(e.minValue);for(let c=0;car(c));this.lookup={rendererJSON:e,histogramLut:n}}else if(u){const n=Le(e,{rasterInfo:this.rasterInfo}),c=zt({pixelType:s,...n,gamma:l?a:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:c}}if(f&&!zo(f)){const n=Et(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Oe({colormap:n}),this.lookup.rendererJSON=e}return this.lookup.gamma=l&&a?.length?a:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let o=null,i=null;const l=this.lookup?.colormapLut;t.colorRamp&&l&&(o=l.indexedColormap,i=l.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,a=!(!t.useGamma||!f?.some(w=>w!==1)),{minCutOff:s,maxCutOff:u,outMin:n,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let h=0;e!=null&&(h=e.getPlaneCount(),h===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,p=Math.min(3,r?.length||h||m,m),y=new Float32Array(p),S=o||a?1:255;let v;for(v=0;v1?f[v]>2?k[v]=6.5+(f[v]-2)**2.5:k[v]=6.5+100*(2-f[v])**4:k[v]=1;return{bandCount:p,outMin:n/S,outMax:c/S,minCutOff:s,maxCutOff:u,factor:y,useGamma:a,gamma:a?f:[1,1,1],gammaCorrection:a?k:[1,1,1],colormap:o,colormapOffset:i,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let o=null,i=null;const l=this.lookup?.colormapLut;e.colorRamp&&l&&(o=l.indexedColormap,i=l.offset);const f={...e,isGCS:t,resolution:r},a=lr(f),s=this.rasterInfo.statistics?.[0];return{...a,minValue:s?.min??0,maxValue:s?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:i}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:o,visualVariables:i,symbolTileSize:l,flowRepresentation:f}=e;let a;const s=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,n=i?.find(v=>v.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*l,minDataValue:s,minSize:.2*l},c=n.minDataValue??s,h=n.maxDataValue??u,m=n.maxSize!=null&&n.minSize!=null?[n.minSize/l,n.maxSize/l]:[.2,.8];if(t==="wind_speed"){const v=(m[0]+m[1])/2;m[0]=m[1]=v}const p=c!=null&&h!=null?[c,h]:null;if(t==="classified_arrow")if(c!=null&&h!=null&&n!=null){a=[];const v=(n.maxDataValue-n.minDataValue)/5;for(let k=0;k<6;k++)a.push(n.minDataValue+v*k)}else a=[0,1e-6,3.5,7,10.5,14];const y=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=i?.find(v=>v.type==="rotationInfo");return{breakValues:a,dataRange:p,inputUnit:r,outputUnit:o,symbolTileSize:l,symbolPercentRange:m,style:t||"single_arrow",rotation:y,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":S?.rotationType||e.rotationType,type:"vectorField"}}};D([N({json:{write:!0}})],Te.prototype,"rendererJSON",void 0),D([N({type:Gr,json:{write:!0}})],Te.prototype,"rasterInfo",void 0),D([N({json:{write:!0}})],Te.prototype,"lookup",void 0),D([N()],Te.prototype,"canRenderInWebGL",void 0),Te=D([Me("esri.renderers.support.RasterSymbolizer")],Te);const un=Te;function Fo(e){return e==="percentClip"||e==="histogramEqualization"}function Vo(e){return e!=null&&e.length>0&&e[0].min!=null&&e[0].max!=null}function jt(e){return Se(e)&&e.validPixelCount!==0}function zo(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}export{ln as $,tr as A,xr as B,Po as C,rr as D,Ae as E,lo as F,Tr as G,no as H,Bo as I,Ct as J,Yo as K,Jr as L,Je as N,Le as P,sn as Q,Go as S,lr as T,Xo as V,Gr as W,an as X,$o as Y,nn as Z,en as _,qo as a,Zo as b,Mr as c,rn as d,Jo as e,Ko as f,et as g,Oo as h,Et as i,tn as j,ke as k,Or as l,zt as m,Ht as n,rt as o,sr as p,Dr as q,Rr as r,on as s,un as t,gt as u,so as v,Ro as w,No as x,Eo as y,Qo as z}; diff --git a/main/assets/RasterVFDisplayObject-CnriTVT9-7AFXrs58.js b/main/assets/RasterVFDisplayObject-CnriTVT9-7AFXrs58.js new file mode 100644 index 000000000..6a763ffab --- /dev/null +++ b/main/assets/RasterVFDisplayObject-CnriTVT9-7AFXrs58.js @@ -0,0 +1 @@ +import{v as _,S as g,i as tt,j as et,aU as mt,a1 as at,w as pt,n as ft,ah as I,bi as _t,bj as H,f4 as V,$ as W}from"./main-C7yV2j71.js";import{r as D}from"./BufferObject-BM_7mcDb-CTo2uuE5.js";import{I as m,n as M,A as w,T as U,L as st,D as $,U as yt,G as gt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as vt,V as wt}from"./Texture-BCt2hphT-CtQVMDnp.js";import{c as N}from"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import{n as x}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{$ as B,_ as Z,C as J}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{E as xt,e as k}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{N as St,k as it}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{I as At,G as K,C,D as rt,R as bt,H as Dt,E as Mt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{T as ot}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{e as O}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{G as Rt}from"./LabelMetric-BeluzH3o-CQPyji82.js";function Tt(a){const t=nt(q(a)),e=t,s=!0,i=Math.max(t/2,5),r=Math.round(V(a.maxPathLength)/i)+1,o=10,{density:n}=a;return{smoothing:V(a.smoothing),interpolate:!0,velocityScale:a.flowRepresentation==="flow-from"?1:-1,verticesPerLine:r,minSpeedThreshold:.001,segmentLength:i,maxTurnAngle:1,collisions:s,lineCollisionWidth:e,lineSpacing:o,density:n}}function nt(a){return a.kind==="constant"?a.value[0]:a.values[a.values.length-1]}function Q(a){const t=a.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function Vt(a){return{kind:"constant",value:[.1,.1,.1,1]}}function q(a){if(!a.hasVisualVariables("size"))return{kind:"constant",value:[V(a.trailWidth)]};const t=a.getVisualVariablesForType("size")[0],e=[],s=[];let i;if(t.stops){for(const r of t.stops)e.push(r.value),s.push(V(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),s.push(V(t.minSize),V(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:s,count:i}}function zt(a){if(!a.hasVisualVariables("color"))return{kind:"constant",value:Q(a.color)};const t=a.getVisualVariablesForType("color")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),Array.prototype.push.apply(s,Q(i.color));return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function Pt(a){if(!a.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=a.getVisualVariablesForType("opacity")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),s.push(i.opacity);return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function G(a,t,e,s){switch(t){case"int":a.setUniform1iv(e,s);break;case"float":a.setUniform1fv(e,s);break;case"vec2":a.setUniform2fv(e,s);break;case"vec3":a.setUniform3fv(e,s);break;case"vec4":a.setUniform4fv(e,s)}}function A(a,t,e,s){s.kind==="constant"?G(a,e,`u_${t}`,s.value):(G(a,"float",`u_${t}_stops`,s.stops),G(a,e,`u_${t}_values`,s.values),a.setUniform1i(`u_${t}_count`,s.count))}function Et(a,t){let e=!0;return e=e&&a.collisions===t.collisions,e=e&&a.density===t.density,e=e&&a.interpolate===t.interpolate,e=e&&a.lineCollisionWidth===t.lineCollisionWidth,e=e&&a.lineSpacing===t.lineSpacing,e=e&&a.maxTurnAngle===t.maxTurnAngle,e=e&&a.minSpeedThreshold===t.minSpeedThreshold,e=e&&a.segmentLength===t.segmentLength,e=e&&a.smoothing===t.smoothing,e=e&&a.velocityScale===t.velocityScale,e=e&&a.verticesPerLine===t.verticesPerLine,e}function lt(a,t){return a===t||a!=null&&t!=null&&a.equals(t)}function ct(a,t){if(!Et(a.simulationSettings,t.simulationSettings)||!lt(a.timeExtent,t.timeExtent))return!1;let e=!0;return e=e&&a.loadImagery===t.loadImagery,e=e&&a.createFlowMesh===t.createFlowMesh,e=e&&a.color.kind===t.color.kind,e=e&&a.opacity.kind===t.opacity.kind,e=e&&a.size.kind===t.size.kind,e}let Ut=class ht{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof ht)||!lt(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e);return new Ft(r,{color:this._params.color,opacity:this._params.opacity})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),i.bindTexture(s.texture,0),r.setUniform1i("u_texture",0),r.setUniform1f("u_Min",s.min),r.setUniform1f("u_Max",s.max),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),i.bindVAO(s.vertexArray),i.drawArrays(U.TRIANGLE_STRIP,0,4)}};const L=new Map;L.set("a_position",0),L.set("a_texcoord",1);const It=new Map([["geometry",[new x("a_position",2,m.UNSIGNED_SHORT,0,8),new x("a_texcoord",2,m.UNSIGNED_SHORT,4,8)]]]),Ot={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:L};class Ft{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:s,height:i}=this._flowData,r=D.createVertex(e,M.STATIC_DRAW,new Uint16Array([0,0,0,1,s,0,1,1,0,i,0,0,s,i,1,0])),o=new Map([["geometry",r]]),n=new N(e,L,It,o),l=[];this._values.color.kind==="ramp"&&l.push("vvColor"),this._values.opacity.kind==="ramp"&&l.push("vvOpacity");const u=t.painter.materialManager.getProgram(Ot,l);let p=1e6,c=-1e6;for(let h=0;h0}isCompatible(t){return t instanceof dt&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,r,e);return new Nt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}};const z=new Map;z.set("a_xyts0",0),z.set("a_xyts1",1),z.set("a_typeIdDurationSeed",2),z.set("a_extrudeInfo",3);const kt=new Map([["geometry",[new x("a_xyts0",4,m.FLOAT,0,64),new x("a_xyts1",4,m.FLOAT,16,64),new x("a_typeIdDurationSeed",4,m.FLOAT,32,64),new x("a_extrudeInfo",4,m.FLOAT,48,64)]]]),Lt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:z};let Nt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,z,kt,i,s),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=a.painter.materialManager.getProgram(Lt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}},$t=class ut{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof ut)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let s=0;si.load(t,e)));return new Gt(s)}render(t,e,s){for(let i=0;ia&&t.ready,!0)}};class j{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof j&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,r,e);return new Wt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}}const P=new Map;P.set("a_positionAndSide",0),P.set("a_timeInfo",1),P.set("a_extrude",2),P.set("a_speed",3);const Ht=new Map([["geometry",[new x("a_positionAndSide",3,m.FLOAT,0,36),new x("a_timeInfo",3,m.FLOAT,12,36),new x("a_extrude",2,m.FLOAT,24,36),new x("a_speed",1,m.FLOAT,32,36)]]]),qt={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:P};let Wt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,P,Ht,i,s),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=a.painter.materialManager.getProgram(qt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}};const jt=4,Bt=1,Zt=.5,Jt=!0,Kt=!0,Qt=2.3;function Xt(a,t){const{flowSpeed:e,trailLength:s}=a,i=Tt(a);let r=null;const o={opacity:Pt(a),size:q(a)};let n=zt(a);if(a.background==="none")o.color=n;else{n.kind==="constant"&&(n={kind:"ramp",stops:[0,1],values:[0,0,0,1,n.value[0],n.value[1],n.value[2],n.value[3]],count:2});const p={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new Ut(p),o.color=Vt()}const l={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:s,flowSpeed:e,featheringSize:Bt,featheringOffset:Zt,introFade:Jt,fadeToZero:Kt,decayRate:Qt,color:o.color,opacity:o.opacity,size:o.size},u=a.trailCap==="butt"||nt(q(a))<=jt?new j(l):new Ct(l);return r!=null?new $t([r,u]):u}class Yt extends it{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:k(),displayViewMat3:k()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(st.EQUAL,0,255)}draw(t,e){const{requestRender:s,allowDelayedRender:i}=t,{displayData:r}=e;if(r==null||(r.state.name==="loaded"&&r.attach(t),r.state.name!=="attached"))return;const o=r.state.resources;!i||o.ready||s==null?(this._visualState.time=t.time/1e3,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render(t,this._visualState,o),r.flowStyle.animated&&s!=null&&s()):s()}}class te extends St{constructor(){super(...arguments),this.flowStyle=null}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Yt],target:()=>this.children,drawPhase:xt.MAP});return[...super.prepareRenderPasses(t),e]}}class ee{constructor(t,e,s,i){this.state={name:"created"},this.flowStyle=t,this.extent=e,this.size=s,this.pixelRatio=i}async load(){const t=new AbortController;this.state={name:"loading",abortController:t};const e={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},s=await this.flowStyle.load(e,t.signal);this.state={name:"loaded",resources:s}}attach(t){if(this.state.name!=="loaded")return void at.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const e=this.state.resources;e.attach(t),this.state={name:"attached",resources:e}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(t){return this.flowStyle.isCompatible(t.flowStyle)?!(!this.extent.equals(t.extent)||this.size[0]!==t.size[0]||this.size[1]!==t.size[1]||this.pixelRatio!==t.pixelRatio)&&(this.flowStyle=t.flowStyle,!0):!1}}class ae extends ot{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(e==null)return;const s=e.extent.xmin,i=e.extent.ymax,r=[0,0];t.toScreen(r,[s,i]);const o=(e.extent.xmax-e.extent.xmin)/e.size[0]/t.resolution,n=H(t.rotation),{displayViewScreenMat3:l}=this.transforms;At(l,[-1,1,0]),K(l,l,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),C(l,l,[r[0],r[1],0]),rt(l,l,n),K(l,l,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:k()}}}const se=1.15;let T=class extends et{constructor(a){super(a),this._flowDisplayObject=new ae,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(a){const{flowStyle:t}=this.flowContainer;if(t==null)return void this._clear();const{extent:e,rotation:s,resolution:i,pixelRatio:r}=a.state,o=re(e,s);o.expand(se);const n=[Math.round((o.xmax-o.xmin)/i),Math.round((o.ymax-o.ymin)/i)],l=new ee(t,o,n,r);if(this._loading!=null){if(this._loading.update(l))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},u=>{mt(u)||(at.getLogger(this).error("A resource failed to load.",u),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};_([g()],T.prototype,"_loading",void 0),_([g()],T.prototype,"flowContainer",void 0),_([g()],T.prototype,"updating",null),T=_([tt("esri.views.2d.engine.flow.FlowStrategy")],T);const ie=T;function re(a,t){const e=new pt({x:(a.xmax+a.xmin)/2,y:(a.ymax+a.ymin)/2,spatialReference:a.spatialReference}),s=a.xmax-a.xmin,i=a.ymax-a.ymin,r=Math.abs(Math.cos(H(t))),o=Math.abs(Math.sin(H(t))),n=r*s+o*i,l=o*s+r*i,u=new ft({xmin:e.x-n/2,ymin:e.y-l/2,xmax:e.x+n/2,ymax:e.y+l/2,spatialReference:a.spatialReference});return u.centerAt(e),u}let y=class extends et{constructor(){super(...arguments),this._loadImagery=(a,t,e,s,i)=>B(this.layer,a,t,e,s,i),this._createFlowMesh=(a,t,e,s)=>this.layer.createFlowMesh({meshType:a,flowData:e,simulationSettings:t},{signal:s}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:a}=this,t=()=>{this._loadImagery=(e,s,i,r,o)=>B(a,e,s,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in a?this.addHandles(I(()=>a.multidimensionalDefinition,t)):this.addHandles([I(()=>a.mosaicRule,t),I(()=>a.rasterFunction,t),I(()=>a.definitionExpression,t)]),this.container=new te,this._strategy=new ie({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(a){a.stationary?this._strategy.update(a):this.layerView.requestUpdate()}hitTest(a){return new _t({attributes:{},geometry:a.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const a=this.layer.renderer;if(a==null||a.type!=="flow")return;const t=Xt(a,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};_([g()],y.prototype,"_strategy",void 0),_([g()],y.prototype,"attached",void 0),_([g()],y.prototype,"container",void 0),_([g()],y.prototype,"layer",void 0),_([g()],y.prototype,"layerView",void 0),_([g()],y.prototype,"type",void 0),_([g()],y.prototype,"updating",null),_([g()],y.prototype,"timeExtent",void 0),y=_([tt("esri.views.2d.engine.flow.FlowView2D")],y);const we=y,F=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),X=new Float32Array([0,92/255,230/255,1]),oe={beaufort_ft:F,beaufort_m:F,beaufort_km:F,beaufort_mi:F,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:X,single_arrow:X,wind_speed:new Float32Array([0,0,0,1])},Y=[0,20];class xe extends it{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!0),t.setStencilOp($.KEEP,$.KEEP,$.REPLACE)}draw(t,e){if(e.source==null||e.source.validPixelCount===0)return;const{context:s,timeline:i}=t;if(i.begin(this.name),s.setStencilFunction(st.EQUAL,e.stencilRef,255),e.updateVectorFieldVAO(t),t.renderPass==="scalar"){const r=e.vaoData.scalar;r&&this._drawScalars(t,e,r.vao,r.elementCount)}else{const r=e.vaoData.magdir;r&&this._drawTriangles(t,e,r.vao,r.elementCount)}i.end(this.name)}_drawTriangles(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=u.dataRange?["dataRange"]:[];u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.magdir,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{style:h,dataRange:d,rotation:S,symbolPercentRange:b}=u;c.setUniform4fv("u_colors",oe[h]),c.setUniform2fv("u_dataRange",d||Y),c.setUniform1f("u_rotation",S),c.setUniform2fv("u_symbolPercentRange",b);const R=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",R),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_drawScalars(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=[];u.style==="wind_speed"?p.push("innerCircle"):u.dataRange&&p.push("dataRange"),u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.scalar,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{dataRange:h,symbolPercentRange:d}=u;c.setUniform2fv("u_dataRange",h||Y),c.setUniform2fv("u_symbolPercentRange",d);const S=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",S),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_getSymbolSize(t,e){const s=e.key?2**(t.displayLevel-e.key.level):e.resolution/t.state.resolution,{symbolTileSize:i}=e.symbolizerParameters;return[i/(Math.round((e.width-e.offset[0])/i)*i)/s,i/(Math.round((e.height-e.offset[1])/i)*i)/s]}}class Se extends ot{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){this.vaoData!=null&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||this.vaoData==null||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:i}}break;case"simple_scalar":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={scalar:i}}break;case"wind_speed":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s),r=J(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:k()}}setTransform(t){const e=bt(this.transforms.displayViewScreenMat3),[s,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),r=this.resolution/this.pixelRatio/t.resolution,o=r*this.width,n=r*this.height,l=Math.PI*this.rotation/180;C(e,e,O(s,i)),C(e,e,O(o/2,n/2)),rt(e,e,-l),C(e,e,O(-o/2,-n/2)),Dt(e,e,O(o,n)),Mt(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:i}=e,r=D.createVertex(t,M.STATIC_DRAW,new Float32Array(s)),o=D.createIndex(t,M.STATIC_DRAW,new Uint32Array(i)),n=Rt("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:m.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:m.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:m.FLOAT,normalized:!1}]});return{vao:new N(t,n.attributes,n.bufferLayouts,new Map([["geometry",r]]),o),elementCount:i.length}}}export{Se as c,xe as l,we as o}; diff --git a/main/assets/RasterVFDisplayObject-CnriTVT9-DOIQa1VK.js b/main/assets/RasterVFDisplayObject-CnriTVT9-DOIQa1VK.js deleted file mode 100644 index 8abc2e540..000000000 --- a/main/assets/RasterVFDisplayObject-CnriTVT9-DOIQa1VK.js +++ /dev/null @@ -1 +0,0 @@ -import{v as _,S as g,i as tt,j as et,aU as mt,a1 as at,w as pt,n as ft,ah as I,bi as _t,bj as H,f4 as V,$ as W}from"./main-BZaw9FpY.js";import{r as D}from"./BufferObject-BM_7mcDb-QLZylgsX.js";import{I as m,n as M,A as w,T as U,L as st,D as $,U as yt,G as gt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as vt,V as wt}from"./Texture-BCt2hphT-D-X9O5uh.js";import{c as N}from"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import{n as x}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{$ as B,_ as Z,C as J}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{E as xt,e as k}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{N as St,k as it}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{I as At,G as K,C,D as rt,R as bt,H as Dt,E as Mt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{T as ot}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{e as O}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{G as Rt}from"./LabelMetric-BeluzH3o-Dwc7BaHL.js";function Tt(a){const t=nt(q(a)),e=t,s=!0,i=Math.max(t/2,5),r=Math.round(V(a.maxPathLength)/i)+1,o=10,{density:n}=a;return{smoothing:V(a.smoothing),interpolate:!0,velocityScale:a.flowRepresentation==="flow-from"?1:-1,verticesPerLine:r,minSpeedThreshold:.001,segmentLength:i,maxTurnAngle:1,collisions:s,lineCollisionWidth:e,lineSpacing:o,density:n}}function nt(a){return a.kind==="constant"?a.value[0]:a.values[a.values.length-1]}function Q(a){const t=a.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function Vt(a){return{kind:"constant",value:[.1,.1,.1,1]}}function q(a){if(!a.hasVisualVariables("size"))return{kind:"constant",value:[V(a.trailWidth)]};const t=a.getVisualVariablesForType("size")[0],e=[],s=[];let i;if(t.stops){for(const r of t.stops)e.push(r.value),s.push(V(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),s.push(V(t.minSize),V(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:s,count:i}}function zt(a){if(!a.hasVisualVariables("color"))return{kind:"constant",value:Q(a.color)};const t=a.getVisualVariablesForType("color")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),Array.prototype.push.apply(s,Q(i.color));return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function Pt(a){if(!a.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=a.getVisualVariablesForType("opacity")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),s.push(i.opacity);return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function G(a,t,e,s){switch(t){case"int":a.setUniform1iv(e,s);break;case"float":a.setUniform1fv(e,s);break;case"vec2":a.setUniform2fv(e,s);break;case"vec3":a.setUniform3fv(e,s);break;case"vec4":a.setUniform4fv(e,s)}}function A(a,t,e,s){s.kind==="constant"?G(a,e,`u_${t}`,s.value):(G(a,"float",`u_${t}_stops`,s.stops),G(a,e,`u_${t}_values`,s.values),a.setUniform1i(`u_${t}_count`,s.count))}function Et(a,t){let e=!0;return e=e&&a.collisions===t.collisions,e=e&&a.density===t.density,e=e&&a.interpolate===t.interpolate,e=e&&a.lineCollisionWidth===t.lineCollisionWidth,e=e&&a.lineSpacing===t.lineSpacing,e=e&&a.maxTurnAngle===t.maxTurnAngle,e=e&&a.minSpeedThreshold===t.minSpeedThreshold,e=e&&a.segmentLength===t.segmentLength,e=e&&a.smoothing===t.smoothing,e=e&&a.velocityScale===t.velocityScale,e=e&&a.verticesPerLine===t.verticesPerLine,e}function lt(a,t){return a===t||a!=null&&t!=null&&a.equals(t)}function ct(a,t){if(!Et(a.simulationSettings,t.simulationSettings)||!lt(a.timeExtent,t.timeExtent))return!1;let e=!0;return e=e&&a.loadImagery===t.loadImagery,e=e&&a.createFlowMesh===t.createFlowMesh,e=e&&a.color.kind===t.color.kind,e=e&&a.opacity.kind===t.opacity.kind,e=e&&a.size.kind===t.size.kind,e}let Ut=class ht{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof ht)||!lt(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e);return new Ft(r,{color:this._params.color,opacity:this._params.opacity})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),i.bindTexture(s.texture,0),r.setUniform1i("u_texture",0),r.setUniform1f("u_Min",s.min),r.setUniform1f("u_Max",s.max),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),i.bindVAO(s.vertexArray),i.drawArrays(U.TRIANGLE_STRIP,0,4)}};const L=new Map;L.set("a_position",0),L.set("a_texcoord",1);const It=new Map([["geometry",[new x("a_position",2,m.UNSIGNED_SHORT,0,8),new x("a_texcoord",2,m.UNSIGNED_SHORT,4,8)]]]),Ot={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:L};class Ft{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:s,height:i}=this._flowData,r=D.createVertex(e,M.STATIC_DRAW,new Uint16Array([0,0,0,1,s,0,1,1,0,i,0,0,s,i,1,0])),o=new Map([["geometry",r]]),n=new N(e,L,It,o),l=[];this._values.color.kind==="ramp"&&l.push("vvColor"),this._values.opacity.kind==="ramp"&&l.push("vvOpacity");const u=t.painter.materialManager.getProgram(Ot,l);let p=1e6,c=-1e6;for(let h=0;h0}isCompatible(t){return t instanceof dt&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,r,e);return new Nt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}};const z=new Map;z.set("a_xyts0",0),z.set("a_xyts1",1),z.set("a_typeIdDurationSeed",2),z.set("a_extrudeInfo",3);const kt=new Map([["geometry",[new x("a_xyts0",4,m.FLOAT,0,64),new x("a_xyts1",4,m.FLOAT,16,64),new x("a_typeIdDurationSeed",4,m.FLOAT,32,64),new x("a_extrudeInfo",4,m.FLOAT,48,64)]]]),Lt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:z};let Nt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,z,kt,i,s),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=a.painter.materialManager.getProgram(Lt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}},$t=class ut{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof ut)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let s=0;si.load(t,e)));return new Gt(s)}render(t,e,s){for(let i=0;ia&&t.ready,!0)}};class j{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof j&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,r,e);return new Wt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}}const P=new Map;P.set("a_positionAndSide",0),P.set("a_timeInfo",1),P.set("a_extrude",2),P.set("a_speed",3);const Ht=new Map([["geometry",[new x("a_positionAndSide",3,m.FLOAT,0,36),new x("a_timeInfo",3,m.FLOAT,12,36),new x("a_extrude",2,m.FLOAT,24,36),new x("a_speed",1,m.FLOAT,32,36)]]]),qt={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:P};let Wt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,P,Ht,i,s),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=a.painter.materialManager.getProgram(qt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}};const jt=4,Bt=1,Zt=.5,Jt=!0,Kt=!0,Qt=2.3;function Xt(a,t){const{flowSpeed:e,trailLength:s}=a,i=Tt(a);let r=null;const o={opacity:Pt(a),size:q(a)};let n=zt(a);if(a.background==="none")o.color=n;else{n.kind==="constant"&&(n={kind:"ramp",stops:[0,1],values:[0,0,0,1,n.value[0],n.value[1],n.value[2],n.value[3]],count:2});const p={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new Ut(p),o.color=Vt()}const l={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:s,flowSpeed:e,featheringSize:Bt,featheringOffset:Zt,introFade:Jt,fadeToZero:Kt,decayRate:Qt,color:o.color,opacity:o.opacity,size:o.size},u=a.trailCap==="butt"||nt(q(a))<=jt?new j(l):new Ct(l);return r!=null?new $t([r,u]):u}class Yt extends it{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:k(),displayViewMat3:k()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(st.EQUAL,0,255)}draw(t,e){const{requestRender:s,allowDelayedRender:i}=t,{displayData:r}=e;if(r==null||(r.state.name==="loaded"&&r.attach(t),r.state.name!=="attached"))return;const o=r.state.resources;!i||o.ready||s==null?(this._visualState.time=t.time/1e3,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render(t,this._visualState,o),r.flowStyle.animated&&s!=null&&s()):s()}}class te extends St{constructor(){super(...arguments),this.flowStyle=null}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Yt],target:()=>this.children,drawPhase:xt.MAP});return[...super.prepareRenderPasses(t),e]}}class ee{constructor(t,e,s,i){this.state={name:"created"},this.flowStyle=t,this.extent=e,this.size=s,this.pixelRatio=i}async load(){const t=new AbortController;this.state={name:"loading",abortController:t};const e={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},s=await this.flowStyle.load(e,t.signal);this.state={name:"loaded",resources:s}}attach(t){if(this.state.name!=="loaded")return void at.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const e=this.state.resources;e.attach(t),this.state={name:"attached",resources:e}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(t){return this.flowStyle.isCompatible(t.flowStyle)?!(!this.extent.equals(t.extent)||this.size[0]!==t.size[0]||this.size[1]!==t.size[1]||this.pixelRatio!==t.pixelRatio)&&(this.flowStyle=t.flowStyle,!0):!1}}class ae extends ot{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(e==null)return;const s=e.extent.xmin,i=e.extent.ymax,r=[0,0];t.toScreen(r,[s,i]);const o=(e.extent.xmax-e.extent.xmin)/e.size[0]/t.resolution,n=H(t.rotation),{displayViewScreenMat3:l}=this.transforms;At(l,[-1,1,0]),K(l,l,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),C(l,l,[r[0],r[1],0]),rt(l,l,n),K(l,l,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:k()}}}const se=1.15;let T=class extends et{constructor(a){super(a),this._flowDisplayObject=new ae,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(a){const{flowStyle:t}=this.flowContainer;if(t==null)return void this._clear();const{extent:e,rotation:s,resolution:i,pixelRatio:r}=a.state,o=re(e,s);o.expand(se);const n=[Math.round((o.xmax-o.xmin)/i),Math.round((o.ymax-o.ymin)/i)],l=new ee(t,o,n,r);if(this._loading!=null){if(this._loading.update(l))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},u=>{mt(u)||(at.getLogger(this).error("A resource failed to load.",u),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};_([g()],T.prototype,"_loading",void 0),_([g()],T.prototype,"flowContainer",void 0),_([g()],T.prototype,"updating",null),T=_([tt("esri.views.2d.engine.flow.FlowStrategy")],T);const ie=T;function re(a,t){const e=new pt({x:(a.xmax+a.xmin)/2,y:(a.ymax+a.ymin)/2,spatialReference:a.spatialReference}),s=a.xmax-a.xmin,i=a.ymax-a.ymin,r=Math.abs(Math.cos(H(t))),o=Math.abs(Math.sin(H(t))),n=r*s+o*i,l=o*s+r*i,u=new ft({xmin:e.x-n/2,ymin:e.y-l/2,xmax:e.x+n/2,ymax:e.y+l/2,spatialReference:a.spatialReference});return u.centerAt(e),u}let y=class extends et{constructor(){super(...arguments),this._loadImagery=(a,t,e,s,i)=>B(this.layer,a,t,e,s,i),this._createFlowMesh=(a,t,e,s)=>this.layer.createFlowMesh({meshType:a,flowData:e,simulationSettings:t},{signal:s}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:a}=this,t=()=>{this._loadImagery=(e,s,i,r,o)=>B(a,e,s,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in a?this.addHandles(I(()=>a.multidimensionalDefinition,t)):this.addHandles([I(()=>a.mosaicRule,t),I(()=>a.rasterFunction,t),I(()=>a.definitionExpression,t)]),this.container=new te,this._strategy=new ie({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(a){a.stationary?this._strategy.update(a):this.layerView.requestUpdate()}hitTest(a){return new _t({attributes:{},geometry:a.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const a=this.layer.renderer;if(a==null||a.type!=="flow")return;const t=Xt(a,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};_([g()],y.prototype,"_strategy",void 0),_([g()],y.prototype,"attached",void 0),_([g()],y.prototype,"container",void 0),_([g()],y.prototype,"layer",void 0),_([g()],y.prototype,"layerView",void 0),_([g()],y.prototype,"type",void 0),_([g()],y.prototype,"updating",null),_([g()],y.prototype,"timeExtent",void 0),y=_([tt("esri.views.2d.engine.flow.FlowView2D")],y);const we=y,F=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),X=new Float32Array([0,92/255,230/255,1]),oe={beaufort_ft:F,beaufort_m:F,beaufort_km:F,beaufort_mi:F,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:X,single_arrow:X,wind_speed:new Float32Array([0,0,0,1])},Y=[0,20];class xe extends it{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!0),t.setStencilOp($.KEEP,$.KEEP,$.REPLACE)}draw(t,e){if(e.source==null||e.source.validPixelCount===0)return;const{context:s,timeline:i}=t;if(i.begin(this.name),s.setStencilFunction(st.EQUAL,e.stencilRef,255),e.updateVectorFieldVAO(t),t.renderPass==="scalar"){const r=e.vaoData.scalar;r&&this._drawScalars(t,e,r.vao,r.elementCount)}else{const r=e.vaoData.magdir;r&&this._drawTriangles(t,e,r.vao,r.elementCount)}i.end(this.name)}_drawTriangles(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=u.dataRange?["dataRange"]:[];u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.magdir,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{style:h,dataRange:d,rotation:S,symbolPercentRange:b}=u;c.setUniform4fv("u_colors",oe[h]),c.setUniform2fv("u_dataRange",d||Y),c.setUniform1f("u_rotation",S),c.setUniform2fv("u_symbolPercentRange",b);const R=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",R),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_drawScalars(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=[];u.style==="wind_speed"?p.push("innerCircle"):u.dataRange&&p.push("dataRange"),u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.scalar,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{dataRange:h,symbolPercentRange:d}=u;c.setUniform2fv("u_dataRange",h||Y),c.setUniform2fv("u_symbolPercentRange",d);const S=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",S),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_getSymbolSize(t,e){const s=e.key?2**(t.displayLevel-e.key.level):e.resolution/t.state.resolution,{symbolTileSize:i}=e.symbolizerParameters;return[i/(Math.round((e.width-e.offset[0])/i)*i)/s,i/(Math.round((e.height-e.offset[1])/i)*i)/s]}}class Se extends ot{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){this.vaoData!=null&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||this.vaoData==null||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:i}}break;case"simple_scalar":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={scalar:i}}break;case"wind_speed":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s),r=J(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:k()}}setTransform(t){const e=bt(this.transforms.displayViewScreenMat3),[s,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),r=this.resolution/this.pixelRatio/t.resolution,o=r*this.width,n=r*this.height,l=Math.PI*this.rotation/180;C(e,e,O(s,i)),C(e,e,O(o/2,n/2)),rt(e,e,-l),C(e,e,O(-o/2,-n/2)),Dt(e,e,O(o,n)),Mt(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:i}=e,r=D.createVertex(t,M.STATIC_DRAW,new Float32Array(s)),o=D.createIndex(t,M.STATIC_DRAW,new Uint32Array(i)),n=Rt("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:m.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:m.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:m.FLOAT,normalized:!1}]});return{vao:new N(t,n.attributes,n.bufferLayouts,new Map([["geometry",r]]),o),elementCount:i.length}}}export{Se as c,xe as l,we as o}; diff --git a/main/assets/RasterWorker-CzIELPA8-BNcqNUtI.js b/main/assets/RasterWorker-CzIELPA8-BNcqNUtI.js deleted file mode 100644 index 9e1d1a0fb..000000000 --- a/main/assets/RasterWorker-CzIELPA8-BNcqNUtI.js +++ /dev/null @@ -1 +0,0 @@ -import{v as f,bz as p,i as u,n as a,w as S}from"./main-BZaw9FpY.js";import{s as d}from"./projection-BA9M1R7d-DoNqITCd.js";import{D as i,w as y,y as x,k as h,f as O,A as N,M as J,v,R as w}from"./dataUtils-BkPy4R3C-B2SUbyy5.js";import{d as k,V as B,t as P,S as b}from"./RasterSymbolizer-BVys6HkM-CeBx4Ld8.js";import{h as g,q as z,x as D,v as T}from"./PolynomialTransform-C3nWCu0l-Draevh5B.js";import{$ as R,L as F,K as G}from"./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";var m;let l=m=class extends z{constructor(){super(...arguments),this.type="identity"}clone(){return new m}};f([p({IdentityXform:"identity"})],l.prototype,"type",void 0),l=m=f([u("esri.layers.support.rasterTransforms.IdentityTransform")],l);const I=l,A={GCSShiftXform:D,IdentityXform:I,PolynomialXform:T};function j(n){if(!n?.type)return null;const r=A[n?.type];if(r){const t=new r;return t.read(n),t}return null}class _{convertVectorFieldData(r){const t=i.fromJSON(r.pixelBlock),s=y(t,r.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(r){const t=i.fromJSON(r.pixelBlock),s=k(t);return Promise.resolve(s)}async decode(r){const t=await B(r.data,r.options);return t&&t.toJSON()}symbolize(r){r.pixelBlock=i.fromJSON(r.pixelBlock),r.extent=r.extent?a.fromJSON(r.extent):null;const t=this.symbolizer.symbolize(r);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(r){this.symbolizer=P.fromJSON(r.symbolizerJSON),r.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=r.histograms)}async updateRasterFunction(r){this.rasterFunction=g(r.rasterFunctionJSON)}async process(r){const t=this.rasterFunction.process({extent:a.fromJSON(r.extent),primaryPixelBlocks:r.primaryPixelBlocks.map(s=>s!=null?i.fromJSON(s):null),primaryPixelSizes:r.primaryPixelSizes?.map(s=>s!=null?S.fromJSON(s):null),primaryRasterIds:r.primaryRasterIds});return t!=null?t.toJSON():null}stretch(r){const t=this.symbolizer.simpleStretch(i.fromJSON(r.srcPixelBlock),r.stretchParams);return Promise.resolve(t?.toJSON())}estimateStatisticsHistograms(r){const t=b(i.fromJSON(r.srcPixelBlock));return Promise.resolve(t)}split(r){const t=x(i.fromJSON(r.srcPixelBlock),r.tileSize,r.maximumPyramidLevel??0,r.useBilinear===!1);return t&&t.forEach((s,e)=>{t.set(e,s?.toJSON())}),Promise.resolve(t)}clipTile(r){const t=i.fromJSON(r.pixelBlock),s=h({...r,pixelBlock:t});return Promise.resolve(s?.toJSON())}async mosaicAndTransform(r){const t=r.srcPixelBlocks.map(c=>c?new i(c):null),s=O(t,r.srcMosaicSize,{blockWidths:r.blockWidths,alignmentInfo:r.alignmentInfo,clipOffset:r.clipOffset,clipSize:r.clipSize});let e,o=s;return r.coefs&&(o=N(s,r.destDimension,r.coefs,r.sampleSpacing,r.interpolation)),r.projectDirections&&r.gcsGrid&&(e=J(r.destDimension,r.gcsGrid),o=v(o,r.isUV?"vector-uv":"vector-magdir",e)),{pixelBlock:o?.toJSON(),localNorthDirections:e}}async createFlowMesh(r,t){const s={data:new Float32Array(r.flowData.buffer),mask:new Uint8Array(r.flowData.maskBuffer),width:r.flowData.width,height:r.flowData.height},{vertexData:e,indexData:o}=await w(r.meshType,r.simulationSettings,s,t.signal);return{result:{vertexBuffer:e.buffer,indexBuffer:o.buffer},transferList:[e.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const t=a.fromJSON(r.projectedExtent),s=a.fromJSON(r.srcBufferExtent);let e=null;r.datumTransformationSteps&&(e=new d({steps:r.datumTransformationSteps})),(r.includeGCSGrid||R(t.spatialReference,s.spatialReference,e))&&await F();const o=r.rasterTransform?j(r.rasterTransform):null;return G({...r,projectedExtent:t,srcBufferExtent:s,datumTransformation:e,rasterTransform:o})}}export{_ as default}; diff --git a/main/assets/RasterWorker-CzIELPA8-CY9c6HUf.js b/main/assets/RasterWorker-CzIELPA8-CY9c6HUf.js new file mode 100644 index 000000000..aa0561788 --- /dev/null +++ b/main/assets/RasterWorker-CzIELPA8-CY9c6HUf.js @@ -0,0 +1 @@ +import{v as f,bz as p,i as u,n as a,w as S}from"./main-C7yV2j71.js";import{s as d}from"./projection-BA9M1R7d-DXrPfsKU.js";import{D as i,w as y,y as x,k as h,f as O,A as N,M as J,v,R as w}from"./dataUtils-BkPy4R3C-D8T8_whC.js";import{d as k,V as B,t as P,S as b}from"./RasterSymbolizer-BVys6HkM-BxgX8zwh.js";import{h as g,q as z,x as D,v as T}from"./PolynomialTransform-C3nWCu0l-DmoNKYd3.js";import{$ as R,L as F,K as G}from"./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";var m;let l=m=class extends z{constructor(){super(...arguments),this.type="identity"}clone(){return new m}};f([p({IdentityXform:"identity"})],l.prototype,"type",void 0),l=m=f([u("esri.layers.support.rasterTransforms.IdentityTransform")],l);const I=l,A={GCSShiftXform:D,IdentityXform:I,PolynomialXform:T};function j(n){if(!n?.type)return null;const r=A[n?.type];if(r){const t=new r;return t.read(n),t}return null}class _{convertVectorFieldData(r){const t=i.fromJSON(r.pixelBlock),s=y(t,r.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(r){const t=i.fromJSON(r.pixelBlock),s=k(t);return Promise.resolve(s)}async decode(r){const t=await B(r.data,r.options);return t&&t.toJSON()}symbolize(r){r.pixelBlock=i.fromJSON(r.pixelBlock),r.extent=r.extent?a.fromJSON(r.extent):null;const t=this.symbolizer.symbolize(r);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(r){this.symbolizer=P.fromJSON(r.symbolizerJSON),r.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=r.histograms)}async updateRasterFunction(r){this.rasterFunction=g(r.rasterFunctionJSON)}async process(r){const t=this.rasterFunction.process({extent:a.fromJSON(r.extent),primaryPixelBlocks:r.primaryPixelBlocks.map(s=>s!=null?i.fromJSON(s):null),primaryPixelSizes:r.primaryPixelSizes?.map(s=>s!=null?S.fromJSON(s):null),primaryRasterIds:r.primaryRasterIds});return t!=null?t.toJSON():null}stretch(r){const t=this.symbolizer.simpleStretch(i.fromJSON(r.srcPixelBlock),r.stretchParams);return Promise.resolve(t?.toJSON())}estimateStatisticsHistograms(r){const t=b(i.fromJSON(r.srcPixelBlock));return Promise.resolve(t)}split(r){const t=x(i.fromJSON(r.srcPixelBlock),r.tileSize,r.maximumPyramidLevel??0,r.useBilinear===!1);return t&&t.forEach((s,e)=>{t.set(e,s?.toJSON())}),Promise.resolve(t)}clipTile(r){const t=i.fromJSON(r.pixelBlock),s=h({...r,pixelBlock:t});return Promise.resolve(s?.toJSON())}async mosaicAndTransform(r){const t=r.srcPixelBlocks.map(c=>c?new i(c):null),s=O(t,r.srcMosaicSize,{blockWidths:r.blockWidths,alignmentInfo:r.alignmentInfo,clipOffset:r.clipOffset,clipSize:r.clipSize});let e,o=s;return r.coefs&&(o=N(s,r.destDimension,r.coefs,r.sampleSpacing,r.interpolation)),r.projectDirections&&r.gcsGrid&&(e=J(r.destDimension,r.gcsGrid),o=v(o,r.isUV?"vector-uv":"vector-magdir",e)),{pixelBlock:o?.toJSON(),localNorthDirections:e}}async createFlowMesh(r,t){const s={data:new Float32Array(r.flowData.buffer),mask:new Uint8Array(r.flowData.maskBuffer),width:r.flowData.width,height:r.flowData.height},{vertexData:e,indexData:o}=await w(r.meshType,r.simulationSettings,s,t.signal);return{result:{vertexBuffer:e.buffer,indexBuffer:o.buffer},transferList:[e.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const t=a.fromJSON(r.projectedExtent),s=a.fromJSON(r.srcBufferExtent);let e=null;r.datumTransformationSteps&&(e=new d({steps:r.datumTransformationSteps})),(r.includeGCSGrid||R(t.spatialReference,s.spatialReference,e))&&await F();const o=r.rasterTransform?j(r.rasterTransform):null;return G({...r,projectedExtent:t,srcBufferExtent:s,datumTransformation:e,rasterTransform:o})}}export{_ as default}; diff --git a/main/assets/RawBlockCache-Cj_tmHDm-CYD33Wpe.js b/main/assets/RawBlockCache-Cj_tmHDm-CYD33Wpe.js new file mode 100644 index 000000000..b5d891486 --- /dev/null +++ b/main/assets/RawBlockCache-Cj_tmHDm-CYD33Wpe.js @@ -0,0 +1 @@ +import{w as Q}from"./main-C7yV2j71.js";import{o as E,W as G,Q as K}from"./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js";class L{constructor(n=15e3,e=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,e)}decreaseRefCount(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.refCount--,l.refCount<=0&&(r.delete(t),l.controller&&l.controller.abort()),l.refCount}return 0}getBlock(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.ts=Date.now(),l.refCount++,r.delete(t),r.set(t,l),l.block}return null}putBlock(n,e,t,r){const l=this._cachedBlocks,c=n+"/"+e;if(l.has(c)){const i=l.get(c);i.ts=Date.now(),i.refCount++}else l.set(c,{block:t,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,e){const t=this._cachedBlocks,r=n+"/"+e;t.has(r)&&t.delete(r)}updateMaxSize(n){this._size=n,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const n=this._cachedBlocks;this._timer=setInterval(()=>{const e=Array.from(n),t=Date.now();for(let r=0;r=n.size)return;const e=Array.from(n);for(let t=0;tt!=null)||u.delete(o))}function Z(o,n,e){const t=u.get(o);if(!t)return n==null?h.decreaseRefCount(o,e):0;if(n==null||t[n]==null)return h.decreaseRefCount(o,e);const r=t[n]?.cache,l=r?.get(e);if(r&&l){if(l.refCount--,l.refCount===0){r.delete(e);for(let c=0;cc.isResolved=!0).catch(()=>c.isRejected=!0),l[n]?.cache.set(e,c)}function J(o,n,e){const t=u.get(o);t?n!=null&&t[n]!=null?t[n]?.cache.delete(e):h.deleteBlock(o,e):n==null&&h.deleteBlock(o,e)}function O(o,n){const e=u.get(o);return e?e[n]??null:null}function N(o,n,e,t,r,l,c=null){const i=O(o,n);if(!i)return;const f=i.extent,{cache:k,rasterInfo:y}=i;if(f&&f.xmin===e.xmin&&f.xmax===e.xmax&&f.ymin===e.ymin&&f.ymax===e.ymax)return;t=t??0;const M=e.clone().normalize(),{spatialReference:R,transform:v}=y,w=new Set;for(let d=0;d0?m.pyramidBlockWidth:m.blockWidth,I=p>0?m.pyramidBlockHeight:m.blockHeight,g=1,j=Math.max(0,Math.floor(_.x/b)-g),S=Math.max(0,Math.floor(_.y/I)-g),A=Math.floor((_.x+D-1)/b)+g,H=Math.floor((_.y+W-1)/I)+g;for(let B=S;B<=H;B++)for(let C=j;C<=A;C++)w.add(`${p}/${B}/${C}`)}k.forEach((d,a)=>{if(!w.has(a)){const s=k.get(a);(s==null||s.isResolved||s.isRejected)&&k.delete(a)}}),i.extent={xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax}}export{V as K,X as O,Y as P,Z as Q,q as U,F as V,J as X,N as Z}; diff --git a/main/assets/RawBlockCache-Cj_tmHDm-d1RSObdh.js b/main/assets/RawBlockCache-Cj_tmHDm-d1RSObdh.js deleted file mode 100644 index b9784d0ae..000000000 --- a/main/assets/RawBlockCache-Cj_tmHDm-d1RSObdh.js +++ /dev/null @@ -1 +0,0 @@ -import{w as Q}from"./main-BZaw9FpY.js";import{o as E,W as G,Q as K}from"./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js";class L{constructor(n=15e3,e=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,e)}decreaseRefCount(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.refCount--,l.refCount<=0&&(r.delete(t),l.controller&&l.controller.abort()),l.refCount}return 0}getBlock(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.ts=Date.now(),l.refCount++,r.delete(t),r.set(t,l),l.block}return null}putBlock(n,e,t,r){const l=this._cachedBlocks,c=n+"/"+e;if(l.has(c)){const i=l.get(c);i.ts=Date.now(),i.refCount++}else l.set(c,{block:t,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,e){const t=this._cachedBlocks,r=n+"/"+e;t.has(r)&&t.delete(r)}updateMaxSize(n){this._size=n,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const n=this._cachedBlocks;this._timer=setInterval(()=>{const e=Array.from(n),t=Date.now();for(let r=0;r=n.size)return;const e=Array.from(n);for(let t=0;tt!=null)||u.delete(o))}function Z(o,n,e){const t=u.get(o);if(!t)return n==null?h.decreaseRefCount(o,e):0;if(n==null||t[n]==null)return h.decreaseRefCount(o,e);const r=t[n]?.cache,l=r?.get(e);if(r&&l){if(l.refCount--,l.refCount===0){r.delete(e);for(let c=0;cc.isResolved=!0).catch(()=>c.isRejected=!0),l[n]?.cache.set(e,c)}function J(o,n,e){const t=u.get(o);t?n!=null&&t[n]!=null?t[n]?.cache.delete(e):h.deleteBlock(o,e):n==null&&h.deleteBlock(o,e)}function O(o,n){const e=u.get(o);return e?e[n]??null:null}function N(o,n,e,t,r,l,c=null){const i=O(o,n);if(!i)return;const f=i.extent,{cache:k,rasterInfo:y}=i;if(f&&f.xmin===e.xmin&&f.xmax===e.xmax&&f.ymin===e.ymin&&f.ymax===e.ymax)return;t=t??0;const M=e.clone().normalize(),{spatialReference:R,transform:v}=y,w=new Set;for(let d=0;d0?m.pyramidBlockWidth:m.blockWidth,I=p>0?m.pyramidBlockHeight:m.blockHeight,g=1,j=Math.max(0,Math.floor(_.x/b)-g),S=Math.max(0,Math.floor(_.y/I)-g),A=Math.floor((_.x+D-1)/b)+g,H=Math.floor((_.y+W-1)/I)+g;for(let B=S;B<=H;B++)for(let C=j;C<=A;C++)w.add(`${p}/${B}/${C}`)}k.forEach((d,a)=>{if(!w.has(a)){const s=k.get(a);(s==null||s.isResolved||s.isRejected)&&k.delete(a)}}),i.extent={xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax}}export{V as K,X as O,Y as P,Z as Q,q as U,F as V,J as X,N as Z}; diff --git a/main/assets/ReactiveMap-CFk6jPfN-CM49HI11.js b/main/assets/ReactiveMap-CFk6jPfN-CM49HI11.js new file mode 100644 index 000000000..aa6e0c91c --- /dev/null +++ b/main/assets/ReactiveMap-CFk6jPfN-CM49HI11.js @@ -0,0 +1 @@ +import{dw as i,dx as e}from"./main-C7yV2j71.js";class b{constructor(t){this._observable=new i,this._map=new Map(t)}get size(){return e(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const s=this._map.delete(t);return s&&this._observable.notify(),s}entries(){return e(this._observable),this._map.entries()}forEach(t,s){e(this._observable),this._map.forEach((r,a)=>t.call(s,r,a,this),s)}get(t){return e(this._observable),this._map.get(t)}has(t){return e(this._observable),this._map.has(t)}keys(){return e(this._observable),this._map.keys()}set(t,s){return this._map.set(t,s),this._observable.notify(),this}values(){return e(this._observable),this._map.values()}[Symbol.iterator](){return e(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}export{b as h}; diff --git a/main/assets/ReactiveMap-CFk6jPfN-Dz1UG3IA.js b/main/assets/ReactiveMap-CFk6jPfN-Dz1UG3IA.js deleted file mode 100644 index c0d406e3b..000000000 --- a/main/assets/ReactiveMap-CFk6jPfN-Dz1UG3IA.js +++ /dev/null @@ -1 +0,0 @@ -import{dw as i,dx as e}from"./main-BZaw9FpY.js";class b{constructor(t){this._observable=new i,this._map=new Map(t)}get size(){return e(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const s=this._map.delete(t);return s&&this._observable.notify(),s}entries(){return e(this._observable),this._map.entries()}forEach(t,s){e(this._observable),this._map.forEach((r,a)=>t.call(s,r,a,this),s)}get(t){return e(this._observable),this._map.get(t)}has(t){return e(this._observable),this._map.has(t)}keys(){return e(this._observable),this._map.keys()}set(t,s){return this._map.set(t,s),this._observable.notify(),this}values(){return e(this._observable),this._map.values()}[Symbol.iterator](){return e(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}export{b as h}; diff --git a/main/assets/ReactiveSet-QxEZenFW-B_-rGoLX.js b/main/assets/ReactiveSet-QxEZenFW-B_-rGoLX.js new file mode 100644 index 000000000..36e897324 --- /dev/null +++ b/main/assets/ReactiveSet-QxEZenFW-B_-rGoLX.js @@ -0,0 +1 @@ +import{G as g}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{c as x}from"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import{iO as b,dw as T,dx as a,dW as o,cG as l,cF as z,ae as B,iP as p,iQ as v,iR as d,iS as S,iT as w,iU as M}from"./main-C7yV2j71.js";function V(r,t){return{type:b(t),value:r,unit:t}}function q(r){return{value:r}}function $(r,t){return{type:b(t),value:r,unit:t}}function G(r,t){return{type:b(t),value:r,unit:t}}function h(r,t,e="arithmetic"){return{type:b(t),value:r,unit:t,rotationType:e}}function K(r,t){const e=N(r,t);return r.type==="angle"?h(e,t,r.rotationType):V(e,t)}function N(r,t){return o(r.value,r.unit,t)}function O(r,t,e){if(t===e)return r;switch(e){case"arithmetic":case"geographic":return 90-r}}const P=$(0,"meters"),U=G(0,"square-meters");h(0,"radians");const Y=h(0,"degrees"),J=h(0,"degrees","geographic");function D(r,t,e){return r.units[t][e]}function u(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"})} ${D(r,e,s)}`}function m(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:"exceptZero"})} ${D(r,e,s)}`}function Q(r,t,e,n=2,s="abbr"){const i=p(t,e);return u(r,o(t,e,i),i,n,s)}function R(r,t,e,n=2,s="abbr"){const i=p(t,e);return m(r,o(t,e,i),i,n,s)}function W(r,t,e,n=2,s="abbr"){const i=v(t,e);return u(r,o(t,e,i),i,n,s)}function X(r,t,e,n=2,s="abbr"){const i=v(t,e);return m(r,o(t,e,i),i,n,s)}function j(r,t,e,n=2,s="abbr"){const i=d(t,e);return u(r,o(t,e,i),i,n,s)}function A(r,t,e,n=2,s="abbr"){const i=d(t,e);return m(r,o(t,e,i),i,n,s)}function C(r,t,e,n=2,s="abbr"){const i=S(t,e);return u(r,o(t,e,i),i,n,s)}function H(r,t,e,n=2,s="abbr"){const i=S(t,e);return m(r,o(t,e,i),i,n,s)}function tt(r,t,e,n=2,s="abbr"){const i=w(t,e);return u(r,o(t,e,i),i,n,s)}function et(r,t,e,n=2,s="abbr"){const i=M(t,e);return u(r,o(t,e,i),i,n,s)}const k=(r,t)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:t,minimumFractionDigits:t,signDisplay:r>0?"never":"exceptZero"});function rt(r,t,e,n,s,i=x,F=!0){let c=i.normalize(O(o(r,t,"degrees"),e,n),0,F);const f=k(c,s??2);return c=E(c,f),l(c,f)}const _=new Map;function E(r,t){const e=JSON.stringify(t);let n=_.get(e);return n||(n=new Intl.NumberFormat("en-US",t),_.set(e,n)),/^[-+]?360\.?0*°?$/.test(n.format(r))?0:r}const y=["B","kB","MB","GB","TB"];function nt(r,t){let e=(t=Math.round(t))===0?0:Math.floor(Math.log(t)/Math.log(g.KILOBYTES));e=B(e,0,y.length-1);const n=l(t/g.KILOBYTES**e,{maximumFractionDigits:2});return z(r.units.bytes[y[e]],{fileSize:n})}class it{constructor(t){this._observable=new T,this._set=new Set(t)}get size(){return a(this._observable),this._set.size}add(t){const e=this._set.size;return this._set.add(t),this._set.size!==e&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(t){const e=this._set.delete(t);return e&&this._observable.notify(),e}entries(){return a(this._observable),this._set.entries()}forEach(t,e){a(this._observable),this._set.forEach((n,s)=>t.call(e,n,s,this),e)}has(t){return a(this._observable),this._set.has(t)}keys(){return a(this._observable),this._set.keys()}values(){return a(this._observable),this._set.values()}[Symbol.iterator](){return a(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}export{C as A,H as C,$ as D,O as F,tt as G,et as H,j as J,K,P as L,U as N,Y as P,J as Q,Q as R,G as S,q as U,rt as W,R as Y,W as Z,m as b,h as c,A as j,D as m,X as q,it as s,nt as t,u,N as x}; diff --git a/main/assets/ReactiveSet-QxEZenFW-Cl_EaQiS.js b/main/assets/ReactiveSet-QxEZenFW-Cl_EaQiS.js deleted file mode 100644 index a7e8998b4..000000000 --- a/main/assets/ReactiveSet-QxEZenFW-Cl_EaQiS.js +++ /dev/null @@ -1 +0,0 @@ -import{G as g}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{c as x}from"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import{iO as b,dw as T,dx as a,dW as o,cG as l,cF as z,ae as B,iP as p,iQ as v,iR as d,iS as S,iT as w,iU as M}from"./main-BZaw9FpY.js";function V(r,t){return{type:b(t),value:r,unit:t}}function q(r){return{value:r}}function $(r,t){return{type:b(t),value:r,unit:t}}function G(r,t){return{type:b(t),value:r,unit:t}}function h(r,t,e="arithmetic"){return{type:b(t),value:r,unit:t,rotationType:e}}function K(r,t){const e=N(r,t);return r.type==="angle"?h(e,t,r.rotationType):V(e,t)}function N(r,t){return o(r.value,r.unit,t)}function O(r,t,e){if(t===e)return r;switch(e){case"arithmetic":case"geographic":return 90-r}}const P=$(0,"meters"),U=G(0,"square-meters");h(0,"radians");const Y=h(0,"degrees"),J=h(0,"degrees","geographic");function D(r,t,e){return r.units[t][e]}function u(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"})} ${D(r,e,s)}`}function m(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:"exceptZero"})} ${D(r,e,s)}`}function Q(r,t,e,n=2,s="abbr"){const i=p(t,e);return u(r,o(t,e,i),i,n,s)}function R(r,t,e,n=2,s="abbr"){const i=p(t,e);return m(r,o(t,e,i),i,n,s)}function W(r,t,e,n=2,s="abbr"){const i=v(t,e);return u(r,o(t,e,i),i,n,s)}function X(r,t,e,n=2,s="abbr"){const i=v(t,e);return m(r,o(t,e,i),i,n,s)}function j(r,t,e,n=2,s="abbr"){const i=d(t,e);return u(r,o(t,e,i),i,n,s)}function A(r,t,e,n=2,s="abbr"){const i=d(t,e);return m(r,o(t,e,i),i,n,s)}function C(r,t,e,n=2,s="abbr"){const i=S(t,e);return u(r,o(t,e,i),i,n,s)}function H(r,t,e,n=2,s="abbr"){const i=S(t,e);return m(r,o(t,e,i),i,n,s)}function tt(r,t,e,n=2,s="abbr"){const i=w(t,e);return u(r,o(t,e,i),i,n,s)}function et(r,t,e,n=2,s="abbr"){const i=M(t,e);return u(r,o(t,e,i),i,n,s)}const k=(r,t)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:t,minimumFractionDigits:t,signDisplay:r>0?"never":"exceptZero"});function rt(r,t,e,n,s,i=x,F=!0){let c=i.normalize(O(o(r,t,"degrees"),e,n),0,F);const f=k(c,s??2);return c=E(c,f),l(c,f)}const _=new Map;function E(r,t){const e=JSON.stringify(t);let n=_.get(e);return n||(n=new Intl.NumberFormat("en-US",t),_.set(e,n)),/^[-+]?360\.?0*°?$/.test(n.format(r))?0:r}const y=["B","kB","MB","GB","TB"];function nt(r,t){let e=(t=Math.round(t))===0?0:Math.floor(Math.log(t)/Math.log(g.KILOBYTES));e=B(e,0,y.length-1);const n=l(t/g.KILOBYTES**e,{maximumFractionDigits:2});return z(r.units.bytes[y[e]],{fileSize:n})}class it{constructor(t){this._observable=new T,this._set=new Set(t)}get size(){return a(this._observable),this._set.size}add(t){const e=this._set.size;return this._set.add(t),this._set.size!==e&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(t){const e=this._set.delete(t);return e&&this._observable.notify(),e}entries(){return a(this._observable),this._set.entries()}forEach(t,e){a(this._observable),this._set.forEach((n,s)=>t.call(e,n,s,this),e)}has(t){return a(this._observable),this._set.has(t)}keys(){return a(this._observable),this._set.keys()}values(){return a(this._observable),this._set.values()}[Symbol.iterator](){return a(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}export{C as A,H as C,$ as D,O as F,tt as G,et as H,j as J,K,P as L,U as N,Y as P,J as Q,Q as R,G as S,q as U,rt as W,R as Y,W as Z,m as b,h as c,A as j,D as m,X as q,it as s,nt as t,u,N as x}; diff --git a/main/assets/RefreshableLayer-a8BQ58Xh-BbEtxkCL.js b/main/assets/RefreshableLayer-a8BQ58Xh-BbEtxkCL.js deleted file mode 100644 index 5b7e5a939..000000000 --- a/main/assets/RefreshableLayer-a8BQ58Xh-BbEtxkCL.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as u,e8 as c,v as a,S as h,ad as p,i as m,av as v,bp as g,b9 as y,a1 as b}from"./main-BZaw9FpY.js";import{s as I}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";const n=new u,o=new WeakMap;function w(t){D(t)&&n.push(new WeakRef(t))}function C(t){const e=n.find(s=>s.deref()===t);e&&n.remove(e)}function D(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function d(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:d(e,t%e):0}let f=0,i=0;function R(){const t=Date.now();let e=!1;for(const s of n){const r=s.deref();r?r.refreshInterval&&t-(o.get(r)??0)+5>=6e4*r.refreshInterval&&(o.set(r,t),r.refresh(t)):e=!0}if(e)for(let s=n.length-1;s>=0;s--)n.at(s).deref()||n.removeAt(s)}c(()=>{const t=Date.now();let e=0;for(const s of n){const r=s.deref();r&&(e=d(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?o.get(r)||o.set(r,t):o.delete(r))}if(e!==i){if(i=e,clearInterval(f),i===0)return void(f=0);f=setInterval(R,i)}},v);const l=.1,_=t=>{let e=class extends t{constructor(...s){super(...s),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=g(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||w(this)},()=>{})}destroy(){C(this)}castRefreshInterval(s){return s>=l?s:s<=0?0:l}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(s=Date.now()){y(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",s),this.emit("refresh",{dataChanged:r})},r=>{b.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){}};return a([h({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:I}}}}})],e.prototype,"refreshInterval",void 0),a([p("refreshInterval")],e.prototype,"castRefreshInterval",null),a([h({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),a([h({readOnly:!0})],e.prototype,"refreshParameters",null),e=a([m("esri.layers.mixins.RefreshableLayer")],e),e};export{_ as T}; diff --git a/main/assets/RefreshableLayer-a8BQ58Xh-DVxzH3dc.js b/main/assets/RefreshableLayer-a8BQ58Xh-DVxzH3dc.js new file mode 100644 index 000000000..e8efea04e --- /dev/null +++ b/main/assets/RefreshableLayer-a8BQ58Xh-DVxzH3dc.js @@ -0,0 +1 @@ +import{ag as u,e8 as c,v as a,S as h,ad as p,i as m,av as v,bp as g,b9 as y,a1 as b}from"./main-C7yV2j71.js";import{s as I}from"./commonProperties-BtIqvFU_-DuUske_0.js";const n=new u,o=new WeakMap;function w(t){D(t)&&n.push(new WeakRef(t))}function C(t){const e=n.find(s=>s.deref()===t);e&&n.remove(e)}function D(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function d(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:d(e,t%e):0}let f=0,i=0;function R(){const t=Date.now();let e=!1;for(const s of n){const r=s.deref();r?r.refreshInterval&&t-(o.get(r)??0)+5>=6e4*r.refreshInterval&&(o.set(r,t),r.refresh(t)):e=!0}if(e)for(let s=n.length-1;s>=0;s--)n.at(s).deref()||n.removeAt(s)}c(()=>{const t=Date.now();let e=0;for(const s of n){const r=s.deref();r&&(e=d(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?o.get(r)||o.set(r,t):o.delete(r))}if(e!==i){if(i=e,clearInterval(f),i===0)return void(f=0);f=setInterval(R,i)}},v);const l=.1,_=t=>{let e=class extends t{constructor(...s){super(...s),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=g(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||w(this)},()=>{})}destroy(){C(this)}castRefreshInterval(s){return s>=l?s:s<=0?0:l}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(s=Date.now()){y(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",s),this.emit("refresh",{dataChanged:r})},r=>{b.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){}};return a([h({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:I}}}}})],e.prototype,"refreshInterval",void 0),a([p("refreshInterval")],e.prototype,"castRefreshInterval",null),a([h({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),a([h({readOnly:!0})],e.prototype,"refreshParameters",null),e=a([m("esri.layers.mixins.RefreshableLayer")],e),e};export{_ as T}; diff --git a/main/assets/RefreshableLayerView-BdQpGYly-BX6IwUNP.js b/main/assets/RefreshableLayerView-BdQpGYly-BX6IwUNP.js deleted file mode 100644 index a0b8ffd8b..000000000 --- a/main/assets/RefreshableLayerView-BdQpGYly-BX6IwUNP.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,i as t,ai as h,aU as l,a1 as d}from"./main-BZaw9FpY.js";const o=r=>{let e=class extends r{initialize(){this.addHandles(h(()=>this.layer,"refresh",s=>{this.doRefresh(s.dataChanged).catch(a=>{l(a)||d.getLogger(this).error(a)})}),"RefreshableLayerView")}};return e=i([t("esri.views.layers.RefreshableLayerView")],e),e};export{o as n}; diff --git a/main/assets/RefreshableLayerView-BdQpGYly-DhXYwWWM.js b/main/assets/RefreshableLayerView-BdQpGYly-DhXYwWWM.js new file mode 100644 index 000000000..e7f19cc99 --- /dev/null +++ b/main/assets/RefreshableLayerView-BdQpGYly-DhXYwWWM.js @@ -0,0 +1 @@ +import{v as i,i as t,ai as h,aU as l,a1 as d}from"./main-C7yV2j71.js";const o=r=>{let e=class extends r{initialize(){this.addHandles(h(()=>this.layer,"refresh",s=>{this.doRefresh(s.dataChanged).catch(a=>{l(a)||d.getLogger(this).error(a)})}),"RefreshableLayerView")}};return e=i([t("esri.views.layers.RefreshableLayerView")],e),e};export{o as n}; diff --git a/main/assets/Relationship-Db9GUmYx-DPu3VSRE.js b/main/assets/Relationship-Db9GUmYx-DPu3VSRE.js deleted file mode 100644 index 609d842da..000000000 --- a/main/assets/Relationship-Db9GUmYx-DPu3VSRE.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as r,i as s,w as m,m as v,e as y,j as w}from"./main-BZaw9FpY.js";let p=class extends y{constructor(e){super(e),this.properties=null}};t([r({json:{write:!0}})],p.prototype,"properties",void 0),p=t([s("esri.rest.knowledgeGraph.GraphObject")],p);const c=p;let i=class extends c{constructor(e){super(e),this.typeName=null,this.id=null}};t([r({type:String,json:{write:!0}})],i.prototype,"typeName",void 0),t([r({type:String,json:{write:!0}})],i.prototype,"id",void 0),i=t([s("esri.rest.knowledgeGraph.GraphNamedObject")],i);const h=i;let a=class extends h{constructor(e){super(e),this.layoutGeometry=null}};t([r({type:m,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=t([s("esri.rest.knowledgeGraph.Entity")],a);const j=a;let l=class extends w{constructor(e){super(e),this.openCypherQuery=""}};t([r()],l.prototype,"openCypherQuery",void 0),l=t([s("esri.rest.knowledgeGraph.GraphQuery")],l);const G=l;let o=class extends G{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null,this.provenanceBehavior=null}};t([r()],o.prototype,"bindParameters",void 0),t([r()],o.prototype,"bindGeometryQuantizationParameters",void 0),t([r()],o.prototype,"outputQuantizationParameters",void 0),t([r()],o.prototype,"outputSpatialReference",void 0),t([r()],o.prototype,"provenanceBehavior",void 0),o=t([s("esri.rest.knowledgeGraph.GraphQueryStreaming")],o);const x=o;let d=class extends c{constructor(e){super(e)}};d=t([s("esri.rest.knowledgeGraph.ObjectValue")],d);const k=d;let u=class extends y{constructor(e){super(e),this.path=null}};t([r({type:[c],json:{write:!0}})],u.prototype,"path",void 0),u=t([s("esri.rest.knowledgeGraph.Path")],u);const b=u;let n=class extends h{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};t([r({type:String,json:{write:!0}})],n.prototype,"originId",void 0),t([r({type:String,json:{write:!0}})],n.prototype,"destinationId",void 0),t([r({type:v,json:{write:!0}})],n.prototype,"layoutGeometry",void 0),n=t([s("esri.rest.knowledgeGraph.Relationship")],n);const Q=n;export{Q as b,x as j,b as k,j as w,k as x}; diff --git a/main/assets/Relationship-Db9GUmYx-DnaxtAbX.js b/main/assets/Relationship-Db9GUmYx-DnaxtAbX.js new file mode 100644 index 000000000..762fd804f --- /dev/null +++ b/main/assets/Relationship-Db9GUmYx-DnaxtAbX.js @@ -0,0 +1 @@ +import{v as t,S as r,i as s,w as m,m as v,e as y,j as w}from"./main-C7yV2j71.js";let p=class extends y{constructor(e){super(e),this.properties=null}};t([r({json:{write:!0}})],p.prototype,"properties",void 0),p=t([s("esri.rest.knowledgeGraph.GraphObject")],p);const c=p;let i=class extends c{constructor(e){super(e),this.typeName=null,this.id=null}};t([r({type:String,json:{write:!0}})],i.prototype,"typeName",void 0),t([r({type:String,json:{write:!0}})],i.prototype,"id",void 0),i=t([s("esri.rest.knowledgeGraph.GraphNamedObject")],i);const h=i;let a=class extends h{constructor(e){super(e),this.layoutGeometry=null}};t([r({type:m,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=t([s("esri.rest.knowledgeGraph.Entity")],a);const j=a;let l=class extends w{constructor(e){super(e),this.openCypherQuery=""}};t([r()],l.prototype,"openCypherQuery",void 0),l=t([s("esri.rest.knowledgeGraph.GraphQuery")],l);const G=l;let o=class extends G{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null,this.provenanceBehavior=null}};t([r()],o.prototype,"bindParameters",void 0),t([r()],o.prototype,"bindGeometryQuantizationParameters",void 0),t([r()],o.prototype,"outputQuantizationParameters",void 0),t([r()],o.prototype,"outputSpatialReference",void 0),t([r()],o.prototype,"provenanceBehavior",void 0),o=t([s("esri.rest.knowledgeGraph.GraphQueryStreaming")],o);const x=o;let d=class extends c{constructor(e){super(e)}};d=t([s("esri.rest.knowledgeGraph.ObjectValue")],d);const k=d;let u=class extends y{constructor(e){super(e),this.path=null}};t([r({type:[c],json:{write:!0}})],u.prototype,"path",void 0),u=t([s("esri.rest.knowledgeGraph.Path")],u);const b=u;let n=class extends h{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};t([r({type:String,json:{write:!0}})],n.prototype,"originId",void 0),t([r({type:String,json:{write:!0}})],n.prototype,"destinationId",void 0),t([r({type:v,json:{write:!0}})],n.prototype,"layoutGeometry",void 0),n=t([s("esri.rest.knowledgeGraph.Relationship")],n);const Q=n;export{Q as b,x as j,b as k,j as w,k as x}; diff --git a/main/assets/Relationship-PyhUibYK-Bz6HFiBe.js b/main/assets/Relationship-PyhUibYK-Bz6HFiBe.js deleted file mode 100644 index 1b2526747..000000000 --- a/main/assets/Relationship-PyhUibYK-Bz6HFiBe.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as n,aa as l,e as s,v as i,S as o,i as d}from"./main-BZaw9FpY.js";const t=new n({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),r=new n({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let e=class extends l(s){constructor(a){super(a),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};i([o({json:{read:t.read,write:t.write}})],e.prototype,"cardinality",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"composite",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"id",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyField",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyFieldInRelationshipTable",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"name",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relatedTableId",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relationshipTableId",void 0),i([o({json:{read:r.read,write:r.write}})],e.prototype,"role",void 0),e=i([d("esri.layers.support.Relationship")],e);const y=e;export{y as p}; diff --git a/main/assets/Relationship-PyhUibYK-DuMEI2S9.js b/main/assets/Relationship-PyhUibYK-DuMEI2S9.js new file mode 100644 index 000000000..e1fd46647 --- /dev/null +++ b/main/assets/Relationship-PyhUibYK-DuMEI2S9.js @@ -0,0 +1 @@ +import{aK as n,aa as l,e as s,v as i,S as o,i as d}from"./main-C7yV2j71.js";const t=new n({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),r=new n({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let e=class extends l(s){constructor(a){super(a),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};i([o({json:{read:t.read,write:t.write}})],e.prototype,"cardinality",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"composite",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"id",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyField",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyFieldInRelationshipTable",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"name",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relatedTableId",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relationshipTableId",void 0),i([o({json:{read:r.read,write:r.write}})],e.prototype,"role",void 0),e=i([d("esri.layers.support.Relationship")],e);const y=e;export{y as p}; diff --git a/main/assets/RelationshipQuery-DJsz3K0U-BHNd_b19.js b/main/assets/RelationshipQuery-DJsz3K0U-BHNd_b19.js new file mode 100644 index 000000000..61776c9d0 --- /dev/null +++ b/main/assets/RelationshipQuery-DJsz3K0U-BHNd_b19.js @@ -0,0 +1 @@ +import{v as t,S as e,ac as n,i as d,bG as h,J as c,e as l,P as u}from"./main-C7yV2j71.js";import{K as y}from"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";var a;let r=a=class extends l{constructor(i){super(i),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10}clone(){return new a(u({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([e({type:[String],json:{write:!0}})],r.prototype,"attachmentTypes",void 0),t([e({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],r.prototype,"attachmentsWhere",void 0),t([e({type:Boolean,json:{write:!0}})],r.prototype,"cacheHint",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"keywords",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"globalIds",void 0),t([e({json:{write:!0}})],r.prototype,"name",void 0),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],r.prototype,"num",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"objectIds",void 0),t([e({type:Boolean,json:{default:!1,write:!0}})],r.prototype,"returnMetadata",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"size",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],r.prototype,"start",void 0),t([n("start"),n("num")],r.prototype,"writeStart",null),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],r.prototype,"where",void 0),r=a=t([d("esri.rest.support.AttachmentQuery")],r),r.from=h(r);const g=r;var p;let o=p=class extends l{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,s){s.historicMoment=i&&i.getTime()}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(s.definitionExpression="1=1")}clone(){return new p(u({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};t([e({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),t([e({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),t([e({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),t([e({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),t([e({type:Date})],o.prototype,"historicMoment",void 0),t([n("historicMoment")],o.prototype,"_writeHistoricMoment",null),t([e({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),t([e({json:{write:!0}})],o.prototype,"objectIds",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),t([e({type:c,json:{read:{source:"outSR"},write:{target:"outSR"}}})],o.prototype,"outSpatialReference",void 0),t([e({json:{write:!0}})],o.prototype,"relationshipId",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),t([n("start"),n("num")],o.prototype,"writeStart",null),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),t([e({json:{write:!0}})],o.prototype,"returnGeometry",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnM",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnZ",void 0),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],o.prototype,"where",void 0),o=p=t([d("esri.rest.support.RelationshipQuery")],o),o.from=h(o);const m=o,S=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"}));export{S as R,g as c,m as d}; diff --git a/main/assets/RelationshipQuery-DJsz3K0U-CSUcCWzp.js b/main/assets/RelationshipQuery-DJsz3K0U-CSUcCWzp.js deleted file mode 100644 index 100bc8544..000000000 --- a/main/assets/RelationshipQuery-DJsz3K0U-CSUcCWzp.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as e,ac as n,i as d,bG as h,J as c,e as l,P as u}from"./main-BZaw9FpY.js";import{K as y}from"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";var a;let r=a=class extends l{constructor(i){super(i),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10}clone(){return new a(u({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([e({type:[String],json:{write:!0}})],r.prototype,"attachmentTypes",void 0),t([e({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],r.prototype,"attachmentsWhere",void 0),t([e({type:Boolean,json:{write:!0}})],r.prototype,"cacheHint",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"keywords",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"globalIds",void 0),t([e({json:{write:!0}})],r.prototype,"name",void 0),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],r.prototype,"num",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"objectIds",void 0),t([e({type:Boolean,json:{default:!1,write:!0}})],r.prototype,"returnMetadata",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"size",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],r.prototype,"start",void 0),t([n("start"),n("num")],r.prototype,"writeStart",null),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],r.prototype,"where",void 0),r=a=t([d("esri.rest.support.AttachmentQuery")],r),r.from=h(r);const g=r;var p;let o=p=class extends l{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,s){s.historicMoment=i&&i.getTime()}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(s.definitionExpression="1=1")}clone(){return new p(u({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};t([e({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),t([e({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),t([e({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),t([e({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),t([e({type:Date})],o.prototype,"historicMoment",void 0),t([n("historicMoment")],o.prototype,"_writeHistoricMoment",null),t([e({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),t([e({json:{write:!0}})],o.prototype,"objectIds",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),t([e({type:c,json:{read:{source:"outSR"},write:{target:"outSR"}}})],o.prototype,"outSpatialReference",void 0),t([e({json:{write:!0}})],o.prototype,"relationshipId",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),t([n("start"),n("num")],o.prototype,"writeStart",null),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),t([e({json:{write:!0}})],o.prototype,"returnGeometry",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnM",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnZ",void 0),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],o.prototype,"where",void 0),o=p=t([d("esri.rest.support.RelationshipQuery")],o),o.from=h(o);const m=o,S=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"}));export{S as R,g as c,m as d}; diff --git a/main/assets/RendererLegendOptions-K3md58-X-B6y5tQg5.js b/main/assets/RendererLegendOptions-K3md58-X-B6y5tQg5.js deleted file mode 100644 index 6411ce2cd..000000000 --- a/main/assets/RendererLegendOptions-K3md58-X-B6y5tQg5.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as o,ar as p,bB as c,ac as d,i as n,d2 as v,aa as y,e as i,bz as h}from"./main-BZaw9FpY.js";var l;let t=l=class extends i{constructor(r){super(r),this.color=null,this.label=null,this.value=null}writeValue(r,a,u){a[u]=r??0}clone(){return new l({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};e([o({type:p,json:{type:[c],write:!0}})],t.prototype,"color",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"label",void 0),e([o({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],t.prototype,"value",void 0),e([d("value")],t.prototype,"writeValue",null),t=l=e([n("esri.renderers.visualVariables.support.ColorStop")],t);const g=t,w=v()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let s=class extends y(i){constructor(r){super(r),this.title=null,this.order=null}};e([o({type:String,json:{write:!0}})],s.prototype,"title",void 0),e([h(w)],s.prototype,"order",void 0),s=e([n("esri.renderers.support.RendererLegendOptions")],s);const V=s;export{g as h,V as w}; diff --git a/main/assets/RendererLegendOptions-K3md58-X-Bf90N-cx.js b/main/assets/RendererLegendOptions-K3md58-X-Bf90N-cx.js new file mode 100644 index 000000000..82b923506 --- /dev/null +++ b/main/assets/RendererLegendOptions-K3md58-X-Bf90N-cx.js @@ -0,0 +1 @@ +import{v as e,S as o,ar as p,bB as c,ac as d,i as n,d2 as v,aa as y,e as i,bz as h}from"./main-C7yV2j71.js";var l;let t=l=class extends i{constructor(r){super(r),this.color=null,this.label=null,this.value=null}writeValue(r,a,u){a[u]=r??0}clone(){return new l({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};e([o({type:p,json:{type:[c],write:!0}})],t.prototype,"color",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"label",void 0),e([o({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],t.prototype,"value",void 0),e([d("value")],t.prototype,"writeValue",null),t=l=e([n("esri.renderers.visualVariables.support.ColorStop")],t);const g=t,w=v()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let s=class extends y(i){constructor(r){super(r),this.title=null,this.order=null}};e([o({type:String,json:{write:!0}})],s.prototype,"title",void 0),e([h(w)],s.prototype,"order",void 0),s=e([n("esri.renderers.support.RendererLegendOptions")],s);const V=s;export{g as h,V as w}; diff --git a/main/assets/RenderingContext-DbCVbtGZ-C1oa6nV0.js b/main/assets/RenderingContext-DbCVbtGZ-C1oa6nV0.js new file mode 100644 index 000000000..e434c0f43 --- /dev/null +++ b/main/assets/RenderingContext-DbCVbtGZ-C1oa6nV0.js @@ -0,0 +1,137 @@ +import{o as W}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{ProgramCache as te,glslifyDefineMap as se}from"./webglDeps-Bgavuh0h-8J_tuBZH.js";import{hT as w,az as ie,aN as re,K as N,hZ as V}from"./main-C7yV2j71.js";import{V as ae,F as p,N as U,y as ne,H as I}from"./Texture-BCt2hphT-CtQVMDnp.js";import{f as g,X as M,S as a,C as F,r as v,R as b,Y as d,M as C,a as le,V as R,o as z,A as m,N as D,O as j,L as x,D as B,P as A,T as E,G as y,n as S,I as O,U as Z,F as k,B as oe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{t as he,K as fe,A as ue}from"./renderState-Dap0WV9P-D4IHxyei.js";import{e as K}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{r as P}from"./BufferObject-BM_7mcDb-CTo2uuE5.js";import{G}from"./Program-DLVwTiPA-CHQtoRqS.js";import{L as _e,b as ce,c as L}from"./testSVGPremultipliedAlpha-DoZe_f0d-n0h7HuaO.js";import{f as de}from"./floatRGBA-4pIJN00G-ClP9XgP7.js";import{f as Y}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{c as Q}from"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import{n as J}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";const Ee=e=>{let s="";s+=e[0].toUpperCase();for(let t=1;t{const s={};for(const t in e)s[Ee(t)]=e[t];return se(s)},Ke=(e,s,t,i)=>{const r=e+e.slice(Math.max(0,e.lastIndexOf("/"))),n=s+s.slice(Math.max(0,s.lastIndexOf("/"))),l=ge(i);return{attributes:t,shaders:{vertexShader:l+W(`${r}.vert`),fragmentShader:l+W(`${n}.frag`)}}};class q{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:m.ONE,dstRGB:m.ZERO,srcAlpha:m.ONE,dstAlpha:m.ZERO},this.blendEquation={mode:D.ADD,modeAlpha:D.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=F.BACK,this.frontFace=j.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=x.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:F.FRONT_AND_BACK,func:x.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:F.FRONT_AND_BACK,fail:B.KEEP,zFail:B.KEEP,zPass:B.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.drawBuffers={defaultFramebuffer:[g.BACK],fbos:new WeakMap},this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}}let pe=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengthe+(t0){e+=`Live objects: +`;for(let s=0;s0&&(e+=`${R[s]}: ${t} +`)}}return e+=this._allocations?.resetLog(),e}},be=class{constructor(e,s,t){const i=s.textureFilterAnisotropic,r=t.maxAnisotropy??1/0;this.versionString=e.getParameter(e.VERSION),this.maxVertexTextureImageUnits=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=i?Math.min(e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY),r):1,this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=e.getParameter(e.MAX_SAMPLES),this.maxDrawBuffers=e.getParameter(e.MAX_DRAW_BUFFERS)}};class X{constructor(s){this._rctx=s,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:`#version 300 es + precision highp float; + + void main(void) { + gl_Position = vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0); + }`,fragment:`#version 300 es + precision highp float; + + out vec4 fragColor; + + void main(void) { + fragColor = vec4(0.0, 0.0, 0.0, 1.0); + }`}}_createHelperProgram(){const s=X.getShaderSources();return this._rctx.programCache.acquire(s.vertex,s.fragment,new Map([]))}_createIndexbuffer(){return P.createIndex(this._rctx,S.STATIC_DRAW,new Uint32Array([0]))}run(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,a.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(E.POINTS,1,O.UNSIGNED_INT,0))}dispose(){this._program.dispose(),this._indexBuffer.dispose()}get test(){}}class Fe extends L{constructor(s){super(),this._rctx=s,this._helperProgram=null,N("mac")&&N("chrome")&&(this._program=this._prepareProgram(),this._helperProgram=this._prepareHelperProgram())}dispose(){super.dispose(),this._helperProgram?.dispose(),this._helperProgram=null}_test(s){const t=this._rctx,i=t.getBoundFramebufferObject(),{x:r,y:n,width:l,height:u}=t.getViewport();t.resetState();const o=new I(1);o.wrapMode=y.CLAMP_TO_EDGE,o.samplingMode=C.NEAREST;const h=new G(t,o),_=P.createIndex(this._rctx,S.STATIC_DRAW,new Uint8Array([0]));t.bindFramebuffer(h),t.setViewport(0,0,1,1),t.useProgram(this._helperProgram),t.bindBuffer(_,a.ELEMENT_ARRAY_BUFFER),t.drawElements(E.POINTS,1,O.UNSIGNED_BYTE,0),t.useProgram(s),t.bindVAO(null),t.drawArrays(E.TRIANGLES,0,258);const c=new Uint8Array(4);return h.readPixels(0,0,1,1,Z.RGBA,k.UNSIGNED_BYTE,c),t.setViewport(r,n,l,u),t.bindFramebuffer(i),h.dispose(),_.dispose(),c[0]===255}_prepareProgram(){const s=`#version 300 es + precision highp float; + + out float triangleId; + + const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0)); + + void main(void) { + triangleId = floor(float(gl_VertexID)/3.0); + + vec3 position = triangleVertices[gl_VertexID % 3]; + float offset = triangleId / ${K.float(85)}; + position.z = 0.5 - offset; + + gl_Position = vec4(position, 1.0); + } + `,t=`#version 300 es + precision highp float; + + in float triangleId; + + out vec4 fragColor; + + void main(void) { + fragColor = triangleId == ${K.float(85)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); + } + `;return this._rctx.programCache.acquire(s,t,new Map([]))}_prepareHelperProgram(){const s=X.getShaderSources();return this._rctx.programCache.acquire(s.vertex,s.fragment,new Map([]))}}let Re=class extends L{constructor(e){super(),this._rctx=e,this._program=H(this._rctx,!1),this._obfuscated=H(this._rctx,!0)}dispose(){super.dispose(),this._obfuscated=w(this._obfuscated)}_test(e){if(N("force-double-precision-obfuscation"))return!0;if(this._obfuscated==null)return!1;const s=this._rctx,t=s.getBoundFramebufferObject(),{x:i,y:r,width:n,height:l}=s.getViewport(),u=this._runProgram(e),o=this._runProgram(this._obfuscated);return s.setViewport(i,r,n,l),s.bindFramebuffer(t),u!==0&&(o===0||u/o>5)}_runProgram(e){const s=this._rctx;s.resetState();const t=new I(1);t.wrapMode=y.CLAMP_TO_EDGE,t.samplingMode=C.NEAREST;const i=new G(s,t),r=P.createVertex(s,S.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),n=new Q(s,new Map([["position",0]]),new Map([["geometry",[new J("position",2,O.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",r]])),l=V(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),u=V(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),o=new Float32Array(6);Y(l,o,3);const h=new Float32Array(6);Y(u,h,3),s.useProgram(e),e.setUniform3f("u_highA",o[0],o[2],o[4]),e.setUniform3f("u_lowA",o[1],o[3],o[5]),e.setUniform3f("u_highB",h[0],h[2],h[4]),e.setUniform3f("u_lowB",h[1],h[3],h[5]),s.bindFramebuffer(i),s.setViewport(0,0,1,1),s.bindVAO(n),s.drawArrays(E.TRIANGLE_STRIP,0,4);const _=new Uint8Array(4);i.readPixels(0,0,1,1,Z.RGBA,k.UNSIGNED_BYTE,_),n.dispose(),i.dispose();const c=(l[2]-u[2])/25,T=de(_);return Math.abs(c-T)}};function H(e,s){const t=` + + precision highp float; + + attribute vec2 position; + + uniform vec3 u_highA; + uniform vec3 u_lowA; + uniform vec3 u_highB; + uniform vec3 u_lowB; + + varying vec4 v_color; + + ${s?"#define DOUBLE_PRECISION_REQUIRES_OBFUSCATION":""} + + #ifdef DOUBLE_PRECISION_REQUIRES_OBFUSCATION + + vec3 dpPlusFrc(vec3 a, vec3 b) { + return mix(a, a + b, vec3(notEqual(b, vec3(0)))); + } + + vec3 dpMinusFrc(vec3 a, vec3 b) { + return mix(vec3(0), a - b, vec3(notEqual(a, b))); + } + + vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { + vec3 t1 = dpPlusFrc(hiA, hiB); + vec3 e = dpMinusFrc(t1, hiA); + vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; + return t1 + t2; + } + + #else + + vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { + vec3 t1 = hiA + hiB; + vec3 e = t1 - hiA; + vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; + return t1 + t2; + } + + #endif + + const float MAX_RGBA_FLOAT = + 255.0 / 256.0 + + 255.0 / 256.0 / 256.0 + + 255.0 / 256.0 / 256.0 / 256.0 + + 255.0 / 256.0 / 256.0 / 256.0 / 256.0; + + const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); + + vec4 float2rgba(const float value) { + // Make sure value is in the domain we can represent + float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); + + // Decompose value in 32bit fixed point parts represented as + // uint8 rgba components. Decomposition uses the fractional part after multiplying + // by a power of 256 (this removes the bits that are represented in the previous + // component) and then converts the fractional part to 8bits. + vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); + + // Convert uint8 values (from 0 to 255) to floating point representation for + // the shader + const float toU8AsFloat = 1.0 / 255.0; + + return fixedPointU8 * toU8AsFloat; + } + + void main() { + vec3 val = dpAdd(u_highA, u_lowA, -u_highB, -u_lowB); + + v_color = float2rgba(val.z / 25.0); + + gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0); + } + `;return e.programCache.acquire(t,` + precision highp float; + + varying vec4 v_color; + + void main() { + gl_FragColor = v_color; + } + `,new Map([["position",0]]))}class me extends L{constructor(s){if(super(),this._rctx=s,!s.gl||!(s.capabilities.colorBufferFloat?.textureFloat&&s.capabilities.colorBufferFloat?.floatBlend))return;const t=` + precision highp float; + attribute vec2 a_pos; + + void main() { + gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); + } + `,i=` + precision highp float; + + void main() { + gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5); + } + `;this._program=s.programCache.acquire(t,i,new Map([["a_pos",0]]))}_test(s){const t=this._rctx,i=new I(1);i.wrapMode=y.CLAMP_TO_EDGE,i.dataType=k.FLOAT,i.internalFormat=oe.RGBA32F,i.samplingMode=C.NEAREST;const r=new G(t,i),n=P.createVertex(t,S.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),l=new Q(t,new Map([["a_pos",0]]),new Map([["geometry",[new J("a_pos",2,O.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",n]]));t.gl.getError(),t.useProgram(s);const u=t.getBoundFramebufferObject(),{x:o,y:h,width:_,height:c}=t.getViewport();t.bindFramebuffer(r),t.setViewport(0,0,1,1),t.bindVAO(l),t.drawArrays(E.TRIANGLE_STRIP,0,4);const T=fe({blending:ue});t.setPipelineState(T),t.drawArrays(E.TRIANGLE_STRIP,0,4);const ee=t.gl.getError();return t.setViewport(o,h,_,c),t.bindFramebuffer(u),l.dispose(),r.dispose(),ee!==t.gl.INVALID_OPERATION||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}}class Be{constructor(s){this.rctx=s,this.floatBufferBlend=new me(s),this.svgPremultipliesAlpha=new _e(s),this.doublePrecisionRequiresObfuscation=new Re(s),this.drawArraysRequiresIndicesTypeReset=new Fe(s)}dispose(){this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}}function Te(e,s){if(s.compressedTextureETC)return null;const t=e.getExtension("WEBGL_compressed_texture_etc");return t?{COMPRESSED_R11_EAC:t.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:t.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:t.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:t.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:t.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:t.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:t.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function Ae(e,s){if(s.compressedTextureS3TC)return null;const t=e.getExtension("WEBGL_compressed_texture_s3tc");return t?{COMPRESSED_RGB_S3TC_DXT1:t.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:t.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:t.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:t.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function xe(e,s){if(s.textureFilterAnisotropic)return null;const t=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return t?{MAX_TEXTURE_MAX_ANISOTROPY:t.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:t.TEXTURE_MAX_ANISOTROPY_EXT}:null}function Ce(e,s){const t=!s.colorBufferHalfFloat&&e.getExtension("EXT_color_buffer_half_float")||!s.colorBufferFloat&&e.getExtension("EXT_color_buffer_float"),i=!s.colorBufferFloat&&e.getExtension("EXT_color_buffer_float"),r=!s.floatBlend&&!s.colorBufferFloat&&e.getExtension("EXT_float_blend");return t||i||r?{textureFloat:!!i,textureHalfFloat:!!t,floatBlend:!!r,R16F:e.R16F,RG16F:e.RG16F,RGBA16F:e.RGBA16F,R32F:e.R32F,RG32F:e.RG32F,RGBA32F:e.RGBA32F,R11F_G11F_B10F:e.R11F_G11F_B10F,RGB16F:e.RGB16F}:null}function Se(e,s,t,i,r){if(s[t])return!1;for(const n of r)if(e.getExtension(n))return!0;return!1}function Oe(e,s){if(s.textureNorm16)return null;const t=e.getExtension("EXT_texture_norm16");return t?{R16:t.R16_EXT,RG16:t.RG16_EXT,RGB16:t.RGB16_EXT,RGBA16:t.RGBA16_EXT,R16_SNORM:t.R16_SNORM_EXT,RG16_SNORM:t.RG16_SNORM_EXT,RGB16_SNORM:t.RGB16_SNORM_EXT,RGBA16_SNORM:t.RGBA16_SNORM_EXT}:null}function Pe(e,s){const t=s.loseContext&&e.getExtension("WEBGL_lose_context");return t?{loseRenderingContext:()=>t.loseContext()}:null}class Ue{constructor(s,t){this._gl=s,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._colorBufferFloat=null,this._loseContext=null,this._textureNorm16=null,this._textureFloatLinear=null,this._disabledExtensions=t.disabledExtensions||{},this._debugWebGLExtensions=t.debugWebGLExtensions||{}}get compressedTextureETC(){return this._compressedTextureETC??=Te(this._gl,this._disabledExtensions),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC??=Ae(this._gl,this._disabledExtensions),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic??=xe(this._gl,this._disabledExtensions),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery??=ce(this._gl,this._disabledExtensions),this._disjointTimerQuery}get colorBufferFloat(){return this._colorBufferFloat??=Ce(this._gl,this._disabledExtensions),this._colorBufferFloat}get loseContext(){return this._loseContext??=Pe(this._gl,this._debugWebGLExtensions),this._loseContext}get textureNorm16(){return this._textureNorm16??=Oe(this._gl,this._disabledExtensions),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear??=Se(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"]),this._textureFloatLinear}enable(s){return this[s]}}let Ye=class{constructor(e,s){this.gl=e,this.instanceCounter=new pe,this.programCache=new te(this),this._transformFeedbackRequestInfo=null,this._state=new q,this._numOfDrawCalls=0,this._numOfTriangles=0,this._loadExtensions(),this.configure(s)}configure(e){this._capabilities=new Ue(this.gl,e),this._parameters=new be(this.gl,this._capabilities,e),ae.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new q,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new he({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const i=t.color;this.setBlendColor(i.r,i.g,i.b,i.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const i=t.function;this.setStencilFunction(i.func,i.ref,i.mask);const r=t.operation;this.setStencilOp(r.fail,r.zFail,r.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:i}=this._state;i===null?this.setDrawBuffers([g.BACK]):i.colorAttachments.length===0?this.setDrawBuffers([g.NONE]):this.setDrawBuffers([M.COLOR_ATTACHMENT0])}}}),this.enforceState(),w(this._driverTest),this._driverTest=new Be(this)}dispose(){w(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(a.ARRAY_BUFFER),this.unbindBuffer(a.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(a.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(a.PIXEL_PACK_BUFFER),this.unbindBuffer(a.PIXEL_UNPACK_BUFFER),this.unbindBuffer(a.COPY_READ_BUFFER),this.unbindBuffer(a.COPY_WRITE_BUFFER),this._state.textureUnitMap.length=0,p()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(e){this._stateTracker.setPipeline(e)}setBlendingEnabled(e){this._state.blend!==e&&(e===!0?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=e,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(e,s){for(let t=0;t=0&&(this._state.activeTexture=s)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(e,s,t,i){e===this._state.blendColor.r&&s===this._state.blendColor.g&&t===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(e,s,t,i),this._state.blendColor.r=e,this._state.blendColor.g=s,this._state.blendColor.b=t,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(e,s){e===this._state.blendFunction.srcRGB&&s===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,s),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=s,this._state.blendFunction.dstAlpha=s,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,s,t,i){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===t&&this._state.blendFunction.dstRGB===s&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(e,s,t,i),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=s,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(e){this._state.blendEquation.mode!==e&&(this.gl.blendEquation(e),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(e,s){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===s||(this.gl.blendEquationSeparate(e,s),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=s,this._stateTracker.invalidateBlending())}setColorMask(e,s,t,i){this._state.colorMask.r===e&&this._state.colorMask.g===s&&this._state.colorMask.b===t&&this._state.colorMask.a===i||(this.gl.colorMask(e,s,t,i),this._state.colorMask.r=e,this._state.colorMask.g=s,this._state.colorMask.b=t,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(e,s,t,i){this._state.clearColor.r===e&&this._state.clearColor.g===s&&this._state.clearColor.b===t&&this._state.clearColor.a===i||(this.gl.clearColor(e,s,t,i),this._state.clearColor.r=e,this._state.clearColor.g=s,this._state.clearColor.b=t,this._state.clearColor.a=i)}setFaceCullingEnabled(e){this._state.faceCulling!==e&&(e===!0?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=e,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(e){this._state.polygonOffsetFill!==e&&(e===!0?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=e,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(e,s){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===s||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=s,this.gl.polygonOffset(e,s),this._stateTracker.invalidatePolygonOffset())}setCullFace(e){this._state.cullFace!==e&&(this.gl.cullFace(e),this._state.cullFace=e,this._stateTracker.invalidateCulling())}setFrontFace(e){this._state.frontFace!==e&&(this.gl.frontFace(e),this._state.frontFace=e,this._stateTracker.invalidateCulling())}setScissorTestEnabled(e){this._state.scissorTest!==e&&(e===!0?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=e)}setScissorRect(e,s,t,i){this._state.scissorRect.x===e&&this._state.scissorRect.y===s&&this._state.scissorRect.width===t&&this._state.scissorRect.height===i||(this.gl.scissor(e,s,t,i),this._state.scissorRect.x=e,this._state.scissorRect.y=s,this._state.scissorRect.width=t,this._state.scissorRect.height=i)}setDepthTestEnabled(e){this._state.depthTest!==e&&(e===!0?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=e,this._stateTracker.invalidateDepthTest())}setClearDepth(e){this._state.clearDepth!==e&&(this.gl.clearDepth(e),this._state.clearDepth=e)}setDepthFunction(e){this._state.depthFunction!==e&&(this.gl.depthFunc(e),this._state.depthFunction=e,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(e){this._state.depthWrite!==e&&(this.gl.depthMask(e),this._state.depthWrite=e,this._stateTracker.invalidateDepthWrite())}setDepthRange(e,s){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===s||(this.gl.depthRange(e,s),this._state.depthRange.zNear=e,this._state.depthRange.zFar=s,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(e){this._state.stencilTest!==e&&(e===!0?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=e,this._stateTracker.invalidateStencilTest())}setClearStencil(e){e!==this._state.clearStencil&&(this.gl.clearStencil(e),this._state.clearStencil=e)}setStencilFunction(e,s,t){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===t||(this.gl.stencilFunc(e,s,t),this._state.stencilFunction.face=F.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=t,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,s,t,i){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===s&&this._state.stencilFunction.ref===t&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(e,s,t,i),this._state.stencilFunction.face=e,this._state.stencilFunction.func=s,this._state.stencilFunction.ref=t,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(e){this._state.stencilWriteMask!==e&&(this.gl.stencilMask(e),this._state.stencilWriteMask=e,this._stateTracker.invalidateStencilWrite())}setStencilOp(e,s,t){this._state.stencilOperation.face===F.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===t||(this.gl.stencilOp(e,s,t),this._state.stencilOperation.face=F.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=t,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,s,t,i){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===s&&this._state.stencilOperation.zFail===t&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(e,s,t,i),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=s,this._state.stencilOperation.zFail=t,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,s=!1){const t=this._state.activeTexture;return e>=0&&(s||e!==this._state.activeTexture)&&(this.gl.activeTexture(v+e),this._state.activeTexture=e),t}setDrawBuffers(e){const{drawFramebuffer:s}=this._state,t=s===null,i=t?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(s);if(i?.length!==e.length||!i.every((r,n)=>r===e[n]))if(e.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(t){if(e.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(e[0]!==g.BACK&&e[0]!==g.NONE)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}t||!e.includes(g.BACK)?(this.gl.drawBuffers(e),t?this._state.drawBuffers.defaultFramebuffer=e:this._state.drawBuffers.fbos.set(s,e),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(e,s=255){if(e){if(e&b.COLOR){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}e&b.DEPTH&&this.setDepthWriteEnabled(!0),e&b.STENCIL&&this.setStencilWriteMask(s),this.gl.clear(e)}}clearFramebuffer(e,s=!1,t=!1){let i=0;if(e){const r=Math.max(1e-13,e[3]);this.setClearColor(e[0],e[1],e[2],r),i|=b.COLOR}s&&(i|=b.DEPTH),t===!1?t=0:(t===!0&&(t=255),i|=b.STENCIL),i&&this.clear(i,t)}drawArrays(e,s,t){if(this._transformFeedbackRequestInfo){if(e!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(this._state.program?.hasTransformFeedbackVaryings==null)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(p()){this._numOfDrawCalls++,this._numOfTriangles+=$(e,t);const i=this._state.textureUnitMap;for(let r=0;r=this.parameters.maxTextureImageUnits||s<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[s];return e?.glName==null?(i!=null&&(this.setActiveTexture(s,t),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[s]=null,i):t||i!==e?(this.setActiveTexture(s,t),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[s]=e,i):(e.isDirty&&(this.setActiveTexture(s,t),e.applyChanges()),i)}unbindTexture(e){if(e!=null)for(let s=0;s=this.parameters.maxUniformBufferBindings||s<0)return console.error("Uniform buffer binding point is out of range!"),null;const t=e===a.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=t[s];return i==null&&(i={buffer:null,offset:0,size:0},t[s]=i),i}bindBufferBase(e,s,t){const i=this._getBufferBinding(e,s);i!=null&&(i.buffer===t&&i.offset===0&&i.size===0||(this.gl.bindBufferBase(e,s,t?t.glName:null),i.buffer=t,i.offset=0,i.size=0))}bindBufferRange(e,s,t,i,r){const n=this._getBufferBinding(e,s);n!=null&&(n.buffer===t&&n.offset===i&&n.size===r||(i%this._parameters.uniformBufferOffsetAlignment==0?(this.gl.bindBufferRange(e,s,t.glName,i,r),n.buffer=t,n.offset=i,n.size=r):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(e,s,t,i){s!=null?(p()&&(i??s.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),s.initialize(),t!==void 0&&i!==void 0?this.bindBufferRange(a.UNIFORM_BUFFER,e,s.buffer,t,i):this.bindBufferBase(a.UNIFORM_BUFFER,e,s.buffer)):this.bindBufferBase(a.UNIFORM_BUFFER,e,null)}unbindUBO(e){for(let s=0,t=this._state.uniformBufferBindingPoints.length;s{let s="";s+=e[0].toUpperCase();for(let t=1;t{const s={};for(const t in e)s[Ee(t)]=e[t];return se(s)},Ke=(e,s,t,i)=>{const r=e+e.slice(Math.max(0,e.lastIndexOf("/"))),n=s+s.slice(Math.max(0,s.lastIndexOf("/"))),l=ge(i);return{attributes:t,shaders:{vertexShader:l+W(`${r}.vert`),fragmentShader:l+W(`${n}.frag`)}}};class q{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:m.ONE,dstRGB:m.ZERO,srcAlpha:m.ONE,dstAlpha:m.ZERO},this.blendEquation={mode:D.ADD,modeAlpha:D.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=F.BACK,this.frontFace=j.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=x.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:F.FRONT_AND_BACK,func:x.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:F.FRONT_AND_BACK,fail:B.KEEP,zFail:B.KEEP,zPass:B.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.drawBuffers={defaultFramebuffer:[g.BACK],fbos:new WeakMap},this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}}let pe=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengthe+(t0){e+=`Live objects: -`;for(let s=0;s0&&(e+=`${R[s]}: ${t} -`)}}return e+=this._allocations?.resetLog(),e}},be=class{constructor(e,s,t){const i=s.textureFilterAnisotropic,r=t.maxAnisotropy??1/0;this.versionString=e.getParameter(e.VERSION),this.maxVertexTextureImageUnits=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=i?Math.min(e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY),r):1,this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=e.getParameter(e.MAX_SAMPLES),this.maxDrawBuffers=e.getParameter(e.MAX_DRAW_BUFFERS)}};class X{constructor(s){this._rctx=s,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:`#version 300 es - precision highp float; - - void main(void) { - gl_Position = vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0); - }`,fragment:`#version 300 es - precision highp float; - - out vec4 fragColor; - - void main(void) { - fragColor = vec4(0.0, 0.0, 0.0, 1.0); - }`}}_createHelperProgram(){const s=X.getShaderSources();return this._rctx.programCache.acquire(s.vertex,s.fragment,new Map([]))}_createIndexbuffer(){return P.createIndex(this._rctx,S.STATIC_DRAW,new Uint32Array([0]))}run(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,a.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(E.POINTS,1,O.UNSIGNED_INT,0))}dispose(){this._program.dispose(),this._indexBuffer.dispose()}get test(){}}class Fe extends L{constructor(s){super(),this._rctx=s,this._helperProgram=null,N("mac")&&N("chrome")&&(this._program=this._prepareProgram(),this._helperProgram=this._prepareHelperProgram())}dispose(){super.dispose(),this._helperProgram?.dispose(),this._helperProgram=null}_test(s){const t=this._rctx,i=t.getBoundFramebufferObject(),{x:r,y:n,width:l,height:u}=t.getViewport();t.resetState();const o=new I(1);o.wrapMode=y.CLAMP_TO_EDGE,o.samplingMode=C.NEAREST;const h=new G(t,o),_=P.createIndex(this._rctx,S.STATIC_DRAW,new Uint8Array([0]));t.bindFramebuffer(h),t.setViewport(0,0,1,1),t.useProgram(this._helperProgram),t.bindBuffer(_,a.ELEMENT_ARRAY_BUFFER),t.drawElements(E.POINTS,1,O.UNSIGNED_BYTE,0),t.useProgram(s),t.bindVAO(null),t.drawArrays(E.TRIANGLES,0,258);const c=new Uint8Array(4);return h.readPixels(0,0,1,1,Z.RGBA,k.UNSIGNED_BYTE,c),t.setViewport(r,n,l,u),t.bindFramebuffer(i),h.dispose(),_.dispose(),c[0]===255}_prepareProgram(){const s=`#version 300 es - precision highp float; - - out float triangleId; - - const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0)); - - void main(void) { - triangleId = floor(float(gl_VertexID)/3.0); - - vec3 position = triangleVertices[gl_VertexID % 3]; - float offset = triangleId / ${K.float(85)}; - position.z = 0.5 - offset; - - gl_Position = vec4(position, 1.0); - } - `,t=`#version 300 es - precision highp float; - - in float triangleId; - - out vec4 fragColor; - - void main(void) { - fragColor = triangleId == ${K.float(85)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); - } - `;return this._rctx.programCache.acquire(s,t,new Map([]))}_prepareHelperProgram(){const s=X.getShaderSources();return this._rctx.programCache.acquire(s.vertex,s.fragment,new Map([]))}}let Re=class extends L{constructor(e){super(),this._rctx=e,this._program=H(this._rctx,!1),this._obfuscated=H(this._rctx,!0)}dispose(){super.dispose(),this._obfuscated=w(this._obfuscated)}_test(e){if(N("force-double-precision-obfuscation"))return!0;if(this._obfuscated==null)return!1;const s=this._rctx,t=s.getBoundFramebufferObject(),{x:i,y:r,width:n,height:l}=s.getViewport(),u=this._runProgram(e),o=this._runProgram(this._obfuscated);return s.setViewport(i,r,n,l),s.bindFramebuffer(t),u!==0&&(o===0||u/o>5)}_runProgram(e){const s=this._rctx;s.resetState();const t=new I(1);t.wrapMode=y.CLAMP_TO_EDGE,t.samplingMode=C.NEAREST;const i=new G(s,t),r=P.createVertex(s,S.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),n=new Q(s,new Map([["position",0]]),new Map([["geometry",[new J("position",2,O.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",r]])),l=V(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),u=V(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),o=new Float32Array(6);Y(l,o,3);const h=new Float32Array(6);Y(u,h,3),s.useProgram(e),e.setUniform3f("u_highA",o[0],o[2],o[4]),e.setUniform3f("u_lowA",o[1],o[3],o[5]),e.setUniform3f("u_highB",h[0],h[2],h[4]),e.setUniform3f("u_lowB",h[1],h[3],h[5]),s.bindFramebuffer(i),s.setViewport(0,0,1,1),s.bindVAO(n),s.drawArrays(E.TRIANGLE_STRIP,0,4);const _=new Uint8Array(4);i.readPixels(0,0,1,1,Z.RGBA,k.UNSIGNED_BYTE,_),n.dispose(),i.dispose();const c=(l[2]-u[2])/25,T=de(_);return Math.abs(c-T)}};function H(e,s){const t=` - - precision highp float; - - attribute vec2 position; - - uniform vec3 u_highA; - uniform vec3 u_lowA; - uniform vec3 u_highB; - uniform vec3 u_lowB; - - varying vec4 v_color; - - ${s?"#define DOUBLE_PRECISION_REQUIRES_OBFUSCATION":""} - - #ifdef DOUBLE_PRECISION_REQUIRES_OBFUSCATION - - vec3 dpPlusFrc(vec3 a, vec3 b) { - return mix(a, a + b, vec3(notEqual(b, vec3(0)))); - } - - vec3 dpMinusFrc(vec3 a, vec3 b) { - return mix(vec3(0), a - b, vec3(notEqual(a, b))); - } - - vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { - vec3 t1 = dpPlusFrc(hiA, hiB); - vec3 e = dpMinusFrc(t1, hiA); - vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; - return t1 + t2; - } - - #else - - vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { - vec3 t1 = hiA + hiB; - vec3 e = t1 - hiA; - vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; - return t1 + t2; - } - - #endif - - const float MAX_RGBA_FLOAT = - 255.0 / 256.0 + - 255.0 / 256.0 / 256.0 + - 255.0 / 256.0 / 256.0 / 256.0 + - 255.0 / 256.0 / 256.0 / 256.0 / 256.0; - - const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); - - vec4 float2rgba(const float value) { - // Make sure value is in the domain we can represent - float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); - - // Decompose value in 32bit fixed point parts represented as - // uint8 rgba components. Decomposition uses the fractional part after multiplying - // by a power of 256 (this removes the bits that are represented in the previous - // component) and then converts the fractional part to 8bits. - vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); - - // Convert uint8 values (from 0 to 255) to floating point representation for - // the shader - const float toU8AsFloat = 1.0 / 255.0; - - return fixedPointU8 * toU8AsFloat; - } - - void main() { - vec3 val = dpAdd(u_highA, u_lowA, -u_highB, -u_lowB); - - v_color = float2rgba(val.z / 25.0); - - gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0); - } - `;return e.programCache.acquire(t,` - precision highp float; - - varying vec4 v_color; - - void main() { - gl_FragColor = v_color; - } - `,new Map([["position",0]]))}class me extends L{constructor(s){if(super(),this._rctx=s,!s.gl||!(s.capabilities.colorBufferFloat?.textureFloat&&s.capabilities.colorBufferFloat?.floatBlend))return;const t=` - precision highp float; - attribute vec2 a_pos; - - void main() { - gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); - } - `,i=` - precision highp float; - - void main() { - gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5); - } - `;this._program=s.programCache.acquire(t,i,new Map([["a_pos",0]]))}_test(s){const t=this._rctx,i=new I(1);i.wrapMode=y.CLAMP_TO_EDGE,i.dataType=k.FLOAT,i.internalFormat=oe.RGBA32F,i.samplingMode=C.NEAREST;const r=new G(t,i),n=P.createVertex(t,S.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),l=new Q(t,new Map([["a_pos",0]]),new Map([["geometry",[new J("a_pos",2,O.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",n]]));t.gl.getError(),t.useProgram(s);const u=t.getBoundFramebufferObject(),{x:o,y:h,width:_,height:c}=t.getViewport();t.bindFramebuffer(r),t.setViewport(0,0,1,1),t.bindVAO(l),t.drawArrays(E.TRIANGLE_STRIP,0,4);const T=fe({blending:ue});t.setPipelineState(T),t.drawArrays(E.TRIANGLE_STRIP,0,4);const ee=t.gl.getError();return t.setViewport(o,h,_,c),t.bindFramebuffer(u),l.dispose(),r.dispose(),ee!==t.gl.INVALID_OPERATION||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}}class Be{constructor(s){this.rctx=s,this.floatBufferBlend=new me(s),this.svgPremultipliesAlpha=new _e(s),this.doublePrecisionRequiresObfuscation=new Re(s),this.drawArraysRequiresIndicesTypeReset=new Fe(s)}dispose(){this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}}function Te(e,s){if(s.compressedTextureETC)return null;const t=e.getExtension("WEBGL_compressed_texture_etc");return t?{COMPRESSED_R11_EAC:t.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:t.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:t.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:t.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:t.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:t.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:t.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function Ae(e,s){if(s.compressedTextureS3TC)return null;const t=e.getExtension("WEBGL_compressed_texture_s3tc");return t?{COMPRESSED_RGB_S3TC_DXT1:t.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:t.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:t.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:t.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function xe(e,s){if(s.textureFilterAnisotropic)return null;const t=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return t?{MAX_TEXTURE_MAX_ANISOTROPY:t.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:t.TEXTURE_MAX_ANISOTROPY_EXT}:null}function Ce(e,s){const t=!s.colorBufferHalfFloat&&e.getExtension("EXT_color_buffer_half_float")||!s.colorBufferFloat&&e.getExtension("EXT_color_buffer_float"),i=!s.colorBufferFloat&&e.getExtension("EXT_color_buffer_float"),r=!s.floatBlend&&!s.colorBufferFloat&&e.getExtension("EXT_float_blend");return t||i||r?{textureFloat:!!i,textureHalfFloat:!!t,floatBlend:!!r,R16F:e.R16F,RG16F:e.RG16F,RGBA16F:e.RGBA16F,R32F:e.R32F,RG32F:e.RG32F,RGBA32F:e.RGBA32F,R11F_G11F_B10F:e.R11F_G11F_B10F,RGB16F:e.RGB16F}:null}function Se(e,s,t,i,r){if(s[t])return!1;for(const n of r)if(e.getExtension(n))return!0;return!1}function Oe(e,s){if(s.textureNorm16)return null;const t=e.getExtension("EXT_texture_norm16");return t?{R16:t.R16_EXT,RG16:t.RG16_EXT,RGB16:t.RGB16_EXT,RGBA16:t.RGBA16_EXT,R16_SNORM:t.R16_SNORM_EXT,RG16_SNORM:t.RG16_SNORM_EXT,RGB16_SNORM:t.RGB16_SNORM_EXT,RGBA16_SNORM:t.RGBA16_SNORM_EXT}:null}function Pe(e,s){const t=s.loseContext&&e.getExtension("WEBGL_lose_context");return t?{loseRenderingContext:()=>t.loseContext()}:null}class Ue{constructor(s,t){this._gl=s,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._colorBufferFloat=null,this._loseContext=null,this._textureNorm16=null,this._textureFloatLinear=null,this._disabledExtensions=t.disabledExtensions||{},this._debugWebGLExtensions=t.debugWebGLExtensions||{}}get compressedTextureETC(){return this._compressedTextureETC??=Te(this._gl,this._disabledExtensions),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC??=Ae(this._gl,this._disabledExtensions),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic??=xe(this._gl,this._disabledExtensions),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery??=ce(this._gl,this._disabledExtensions),this._disjointTimerQuery}get colorBufferFloat(){return this._colorBufferFloat??=Ce(this._gl,this._disabledExtensions),this._colorBufferFloat}get loseContext(){return this._loseContext??=Pe(this._gl,this._debugWebGLExtensions),this._loseContext}get textureNorm16(){return this._textureNorm16??=Oe(this._gl,this._disabledExtensions),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear??=Se(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"]),this._textureFloatLinear}enable(s){return this[s]}}let Ye=class{constructor(e,s){this.gl=e,this.instanceCounter=new pe,this.programCache=new te(this),this._transformFeedbackRequestInfo=null,this._state=new q,this._numOfDrawCalls=0,this._numOfTriangles=0,this._loadExtensions(),this.configure(s)}configure(e){this._capabilities=new Ue(this.gl,e),this._parameters=new be(this.gl,this._capabilities,e),ae.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new q,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new he({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const i=t.color;this.setBlendColor(i.r,i.g,i.b,i.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const i=t.function;this.setStencilFunction(i.func,i.ref,i.mask);const r=t.operation;this.setStencilOp(r.fail,r.zFail,r.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:i}=this._state;i===null?this.setDrawBuffers([g.BACK]):i.colorAttachments.length===0?this.setDrawBuffers([g.NONE]):this.setDrawBuffers([M.COLOR_ATTACHMENT0])}}}),this.enforceState(),w(this._driverTest),this._driverTest=new Be(this)}dispose(){w(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(a.ARRAY_BUFFER),this.unbindBuffer(a.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(a.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(a.PIXEL_PACK_BUFFER),this.unbindBuffer(a.PIXEL_UNPACK_BUFFER),this.unbindBuffer(a.COPY_READ_BUFFER),this.unbindBuffer(a.COPY_WRITE_BUFFER),this._state.textureUnitMap.length=0,p()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(e){this._stateTracker.setPipeline(e)}setBlendingEnabled(e){this._state.blend!==e&&(e===!0?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=e,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(e,s){for(let t=0;t=0&&(this._state.activeTexture=s)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(e,s,t,i){e===this._state.blendColor.r&&s===this._state.blendColor.g&&t===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(e,s,t,i),this._state.blendColor.r=e,this._state.blendColor.g=s,this._state.blendColor.b=t,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(e,s){e===this._state.blendFunction.srcRGB&&s===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,s),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=s,this._state.blendFunction.dstAlpha=s,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,s,t,i){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===t&&this._state.blendFunction.dstRGB===s&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(e,s,t,i),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=s,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(e){this._state.blendEquation.mode!==e&&(this.gl.blendEquation(e),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(e,s){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===s||(this.gl.blendEquationSeparate(e,s),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=s,this._stateTracker.invalidateBlending())}setColorMask(e,s,t,i){this._state.colorMask.r===e&&this._state.colorMask.g===s&&this._state.colorMask.b===t&&this._state.colorMask.a===i||(this.gl.colorMask(e,s,t,i),this._state.colorMask.r=e,this._state.colorMask.g=s,this._state.colorMask.b=t,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(e,s,t,i){this._state.clearColor.r===e&&this._state.clearColor.g===s&&this._state.clearColor.b===t&&this._state.clearColor.a===i||(this.gl.clearColor(e,s,t,i),this._state.clearColor.r=e,this._state.clearColor.g=s,this._state.clearColor.b=t,this._state.clearColor.a=i)}setFaceCullingEnabled(e){this._state.faceCulling!==e&&(e===!0?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=e,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(e){this._state.polygonOffsetFill!==e&&(e===!0?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=e,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(e,s){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===s||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=s,this.gl.polygonOffset(e,s),this._stateTracker.invalidatePolygonOffset())}setCullFace(e){this._state.cullFace!==e&&(this.gl.cullFace(e),this._state.cullFace=e,this._stateTracker.invalidateCulling())}setFrontFace(e){this._state.frontFace!==e&&(this.gl.frontFace(e),this._state.frontFace=e,this._stateTracker.invalidateCulling())}setScissorTestEnabled(e){this._state.scissorTest!==e&&(e===!0?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=e)}setScissorRect(e,s,t,i){this._state.scissorRect.x===e&&this._state.scissorRect.y===s&&this._state.scissorRect.width===t&&this._state.scissorRect.height===i||(this.gl.scissor(e,s,t,i),this._state.scissorRect.x=e,this._state.scissorRect.y=s,this._state.scissorRect.width=t,this._state.scissorRect.height=i)}setDepthTestEnabled(e){this._state.depthTest!==e&&(e===!0?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=e,this._stateTracker.invalidateDepthTest())}setClearDepth(e){this._state.clearDepth!==e&&(this.gl.clearDepth(e),this._state.clearDepth=e)}setDepthFunction(e){this._state.depthFunction!==e&&(this.gl.depthFunc(e),this._state.depthFunction=e,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(e){this._state.depthWrite!==e&&(this.gl.depthMask(e),this._state.depthWrite=e,this._stateTracker.invalidateDepthWrite())}setDepthRange(e,s){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===s||(this.gl.depthRange(e,s),this._state.depthRange.zNear=e,this._state.depthRange.zFar=s,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(e){this._state.stencilTest!==e&&(e===!0?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=e,this._stateTracker.invalidateStencilTest())}setClearStencil(e){e!==this._state.clearStencil&&(this.gl.clearStencil(e),this._state.clearStencil=e)}setStencilFunction(e,s,t){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===t||(this.gl.stencilFunc(e,s,t),this._state.stencilFunction.face=F.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=t,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,s,t,i){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===s&&this._state.stencilFunction.ref===t&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(e,s,t,i),this._state.stencilFunction.face=e,this._state.stencilFunction.func=s,this._state.stencilFunction.ref=t,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(e){this._state.stencilWriteMask!==e&&(this.gl.stencilMask(e),this._state.stencilWriteMask=e,this._stateTracker.invalidateStencilWrite())}setStencilOp(e,s,t){this._state.stencilOperation.face===F.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===t||(this.gl.stencilOp(e,s,t),this._state.stencilOperation.face=F.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=t,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,s,t,i){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===s&&this._state.stencilOperation.zFail===t&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(e,s,t,i),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=s,this._state.stencilOperation.zFail=t,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,s=!1){const t=this._state.activeTexture;return e>=0&&(s||e!==this._state.activeTexture)&&(this.gl.activeTexture(v+e),this._state.activeTexture=e),t}setDrawBuffers(e){const{drawFramebuffer:s}=this._state,t=s===null,i=t?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(s);if(i?.length!==e.length||!i.every((r,n)=>r===e[n]))if(e.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(t){if(e.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(e[0]!==g.BACK&&e[0]!==g.NONE)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}t||!e.includes(g.BACK)?(this.gl.drawBuffers(e),t?this._state.drawBuffers.defaultFramebuffer=e:this._state.drawBuffers.fbos.set(s,e),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(e,s=255){if(e){if(e&b.COLOR){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}e&b.DEPTH&&this.setDepthWriteEnabled(!0),e&b.STENCIL&&this.setStencilWriteMask(s),this.gl.clear(e)}}clearFramebuffer(e,s=!1,t=!1){let i=0;if(e){const r=Math.max(1e-13,e[3]);this.setClearColor(e[0],e[1],e[2],r),i|=b.COLOR}s&&(i|=b.DEPTH),t===!1?t=0:(t===!0&&(t=255),i|=b.STENCIL),i&&this.clear(i,t)}drawArrays(e,s,t){if(this._transformFeedbackRequestInfo){if(e!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(this._state.program?.hasTransformFeedbackVaryings==null)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(p()){this._numOfDrawCalls++,this._numOfTriangles+=$(e,t);const i=this._state.textureUnitMap;for(let r=0;r=this.parameters.maxTextureImageUnits||s<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[s];return e?.glName==null?(i!=null&&(this.setActiveTexture(s,t),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[s]=null,i):t||i!==e?(this.setActiveTexture(s,t),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[s]=e,i):(e.isDirty&&(this.setActiveTexture(s,t),e.applyChanges()),i)}unbindTexture(e){if(e!=null)for(let s=0;s=this.parameters.maxUniformBufferBindings||s<0)return console.error("Uniform buffer binding point is out of range!"),null;const t=e===a.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=t[s];return i==null&&(i={buffer:null,offset:0,size:0},t[s]=i),i}bindBufferBase(e,s,t){const i=this._getBufferBinding(e,s);i!=null&&(i.buffer===t&&i.offset===0&&i.size===0||(this.gl.bindBufferBase(e,s,t?t.glName:null),i.buffer=t,i.offset=0,i.size=0))}bindBufferRange(e,s,t,i,r){const n=this._getBufferBinding(e,s);n!=null&&(n.buffer===t&&n.offset===i&&n.size===r||(i%this._parameters.uniformBufferOffsetAlignment==0?(this.gl.bindBufferRange(e,s,t.glName,i,r),n.buffer=t,n.offset=i,n.size=r):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(e,s,t,i){s!=null?(p()&&(i??s.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),s.initialize(),t!==void 0&&i!==void 0?this.bindBufferRange(a.UNIFORM_BUFFER,e,s.buffer,t,i):this.bindBufferBase(a.UNIFORM_BUFFER,e,s.buffer)):this.bindBufferBase(a.UNIFORM_BUFFER,e,null)}unbindUBO(e){for(let s=0,t=this._state.uniformBufferBindingPoints.length;sH.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(e,r){const o=r.supportedTravelModes?.find(({id:s})=>s===r.defaultTravelMode)??r.supportedTravelModes?.find(({itemId:s})=>s===r.defaultTravelMode);return o?Oe.fromJSON(o):null}};t([i()],R.prototype,"accumulateAttributeNames",void 0),t([N("accumulateAttributeNames")],R.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributeNames")],R.prototype,"writeAccumulateAttributes",null),t([i()],R.prototype,"attributeParameterValues",void 0),t([i()],R.prototype,"capabilities",null),t([i()],R.prototype,"currentVersion",void 0),t([i()],R.prototype,"defaultTravelMode",void 0),t([N("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],R.prototype,"readDefaultTravelMode",null),t([i()],R.prototype,"directionsLanguage",void 0),t([A(Ze)],R.prototype,"directionsLengthUnits",void 0),t([i()],R.prototype,"directionsSupportedLanguages",void 0),t([A(Ae,{ignoreUnknown:!1})],R.prototype,"directionsTimeAttribute",void 0),t([i()],R.prototype,"hasZ",void 0),t([A(H,{ignoreUnknown:!1})],R.prototype,"impedance",void 0),t([i({type:$t})],R.prototype,"networkDataset",void 0),t([i({type:[Oe]})],R.prototype,"supportedTravelModes",void 0),R=t([O("esri.rest.support.NetworkServiceDescription")],R);const Wt=R,qt=()=>We.getLogger("esri.rest.networkService");function ne(e,r,o,s){s[o]=[r.length,r.length+e.length],e.forEach(a=>{r.push(a.geometry)})}function Zt(e,r){for(let o=0;o=10.4?Kt(e,r,o):zt(e,o),{defaultTravelMode:u,supportedTravelModes:d}=await y;return a.defaultTravelMode=u,a.supportedTravelModes=d,Wt.fromJSON(a)}async function zt(e,r){const o=fe({f:"json"},r),{data:s}=await Y(e.replace(/\/rest\/.*$/i,"/info"),o);if(!s?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:a}=s,y=Be(a)+"/sharing/rest/portals/self",{data:u}=await Y(y,o),d=ct("helperServices.routingUtilities.url",u);if(!d)return{supportedTravelModes:[],defaultTravelMode:null};const g=qe(a),h=/\/solve$/i.test(g.path)?"Route":/\/solveclosestfacility$/i.test(g.path)?"ClosestFacility":"ServiceAreas",n=fe({f:"json",serviceName:h},r),b=Be(d)+"/GetTravelModes/execute",P=await Y(b,n),B=[];let m=null;if(P?.data?.results?.length){const f=P.data.results;for(const w of f)if(w.paramName==="supportedTravelModes"){if(w.value?.features){for(const{attributes:l}of w.value.features)if(l){const T=JSON.parse(l.TravelMode);B.push(T)}}}else w.paramName==="defaultTravelMode"&&(m=w.value)}return{supportedTravelModes:B,defaultTravelMode:m}}async function Kt(e,r,o){try{const s=fe({f:"json",token:r},o),a=Be(e)+"/retrieveTravelModes",{data:{supportedTravelModes:y,defaultTravelMode:u}}=await Y(a,s);return{supportedTravelModes:y,defaultTravelMode:u}}catch(s){throw new M("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:s})}}const Ce=new Fe({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let X=class extends D{constructor(e){super(e),this.description=null,this.type=null}};t([i({type:String,json:{write:!0}})],X.prototype,"description",void 0),t([i({type:String,json:{read:Ce.read,write:Ce.write}})],X.prototype,"type",void 0),X=t([O("esri.rest.support.GPMessage")],X);const Qt=X,Me=new Fe({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let ce=class extends Qt{constructor(e){super(e),this.type=null}};t([i({type:String,json:{read:Me.read,write:Me.write}})],ce.prototype,"type",void 0),ce=t([O("esri.rest.support.NAMessage")],ce);const Ht=ce;let ee=class extends D{constructor(e){super(e)}};t([i({json:{read:{source:"string"}}})],ee.prototype,"text",void 0),t([A(jt,{name:"stringType"})],ee.prototype,"type",void 0),ee=t([O("esri.rest.support.DirectionsString")],ee);const Qe=ee;let U=class extends D{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,r){return xt(r.ETA,r.arriveTimeUTC)}readGeometry(e,r){return Ge.fromJSON(r.point)}};t([i({type:Date,json:{read:{source:"arriveTimeUTC"}}})],U.prototype,"arriveTime",void 0),t([i()],U.prototype,"arriveTimeOffset",void 0),t([N("arriveTimeOffset",["arriveTimeUTC","ETA"])],U.prototype,"readArriveTimeOffset",null),t([i({type:Ge})],U.prototype,"geometry",void 0),t([N("geometry",["point"])],U.prototype,"readGeometry",null),t([i({type:[Qe]})],U.prototype,"strings",void 0),U=t([O("esri.rest.support.DirectionsEvent")],U);const Yt=U;function Xt(e){if(e==null||e==="")return null;let r=0,o=0,s=0,a=0;const y=[];let u,d,g,h,n,b,P,B,m=0,f=0,w=0;if(n=e.match(/((\+|-)[^+\-|]+|\|)/g),n||(n=[]),parseInt(n[m],32)===0){m=2;const l=parseInt(n[m],32);m++,b=parseInt(n[m],32),m++,1&l&&(f=n.indexOf("|")+1,P=parseInt(n[f],32),f++),2&l&&(w=n.indexOf("|",f)+1,B=parseInt(n[w],32),w++)}else b=parseInt(n[m],32),m++;for(;m0,hasM:w>0}}let K=class extends Q{constructor(e){super(e),this.events=null,this.geometry=null,this.strings=null}readGeometry(e,r){const o=Xt(r.compressedGeometry);return o!=null?me.fromJSON(o):null}};t([i({type:[Yt]})],K.prototype,"events",void 0),t([i({type:me})],K.prototype,"geometry",void 0),t([N("geometry",["compressedGeometry"])],K.prototype,"readGeometry",null),t([i({type:[Qe]})],K.prototype,"strings",void 0),K=t([O("esri.rest.support.DirectionsFeature")],K);const er=K;function tr(e,r){if(e.length===0)return new me({spatialReference:r});const o=[];for(const u of e)for(const d of u.paths)o.push(...d);const s=[];o.forEach((u,d)=>{d!==0&&u[0]===o[d-1][0]&&u[1]===o[d-1][1]||s.push(u)});const{hasM:a,hasZ:y}=e[0];return new me({hasM:a,hasZ:y,paths:[s],spatialReference:r})}let I=class extends E{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,r){if(!e)return[];const o=r.summary.envelope.spatialReference??r.spatialReference,s=o&&W.fromJSON(o);return e.map(a=>{const y=er.fromJSON(a);if(y.geometry!=null&&(y.geometry.spatialReference=s),y.events!=null)for(const u of y.events)u.geometry!=null&&(u.geometry.spatialReference=s);return y})}get mergedGeometry(){return this.features?tr(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:e})=>e).filter($e)}};t([i({type:Ue,json:{read:{source:"summary.envelope"}}})],I.prototype,"extent",void 0),t([i({nonNullable:!0})],I.prototype,"features",void 0),t([N("features")],I.prototype,"readFeatures",null),t([i()],I.prototype,"geometryType",void 0),t([i({readOnly:!0})],I.prototype,"mergedGeometry",null),t([i()],I.prototype,"routeId",void 0),t([i()],I.prototype,"routeName",void 0),t([i({value:null,readOnly:!0})],I.prototype,"strings",null),t([i({json:{read:{source:"summary.totalDriveTime"}}})],I.prototype,"totalDriveTime",void 0),t([i({json:{read:{source:"summary.totalLength"}}})],I.prototype,"totalLength",void 0),t([i({json:{read:{source:"summary.totalTime"}}})],I.prototype,"totalTime",void 0),I=t([O("esri.rest.support.DirectionsFeatureSet")],I);const rr=I;let C=class extends D{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};t([i({type:E,json:{write:!0}})],C.prototype,"directionLines",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"directionPoints",void 0),t([i({type:rr,json:{write:!0}})],C.prototype,"directions",void 0),t([i({type:Q,json:{write:!0}})],C.prototype,"route",void 0),t([i({type:String,json:{write:!0}})],C.prototype,"routeName",void 0),t([i({type:[Q],json:{write:!0}})],C.prototype,"stops",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedEdges",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedJunctions",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedTurns",void 0),C=t([O("esri.rest.support.RouteResult")],C);const or=C;function ge(e){return e?E.fromJSON(e).features.filter($e):[]}let _=class extends D{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,r){return ge(r.barriers)}readPolylineBarriers(e){return ge(e)}readPolygonBarriers(e){return ge(e)}};t([i({type:[Ht]})],_.prototype,"messages",void 0),t([i({type:[Q]})],_.prototype,"pointBarriers",void 0),t([N("pointBarriers",["barriers"])],_.prototype,"readPointBarriers",null),t([i({type:[Q]})],_.prototype,"polylineBarriers",void 0),t([N("polylineBarriers")],_.prototype,"readPolylineBarriers",null),t([i({type:[Q]})],_.prototype,"polygonBarriers",void 0),t([N("polygonBarriers")],_.prototype,"readPolygonBarriers",null),t([i({type:[or]})],_.prototype,"routeResults",void 0),_=t([O("esri.rest.support.RouteSolveResult")],_);const ir=_;function ae(e){return e instanceof E}async function sr(e,r,o){const s=[],a=[],y={},u={},d=qe(e),{path:g}=d;ae(r.stops)&&ne(r.stops.features,a,"stops.features",y),ae(r.pointBarriers)&&ne(r.pointBarriers.features,a,"pointBarriers.features",y),ae(r.polylineBarriers)&&ne(r.polylineBarriers.features,a,"polylineBarriers.features",y),ae(r.polygonBarriers)&&ne(r.polygonBarriers.features,a,"polygonBarriers.features",y);const h=await Gt(a);for(const B in y){const m=y[B];s.push(B),u[B]=h.slice(m[0],m[1])}if(Vt(u,s)){let B=null;try{B=await Ke(g,r.apiKey,o)}catch{}B&&!B.hasZ&&Zt(u,s)}for(const B in u)u[B].forEach((m,f)=>{dt(r,B)[f].geometry=m});const n={...o,query:{...d.query,...Et(r),f:"json"}},b=g.endsWith("/solve")?g:`${g}/solve`,{data:P}=await Y(b,n);return nr(P)}function nr(e){const{barriers:r,directionLines:o,directionPoints:s,directions:a,messages:y,polygonBarriers:u,polylineBarriers:d,routes:g,stops:h,traversedEdges:n,traversedJunctions:b,traversedTurns:P}=e,B=l=>{const T=f.find(j=>j.routeName===l);if(T!=null)return T;const S={routeId:f.length+1,routeName:l};return f.push(S),S},m=l=>{const T=f.find(j=>j.routeId===l);if(T!=null)return T;const S={routeId:l,routeName:null};return f.push(S),S},f=[];g?.features.forEach((l,T)=>{l.geometry.spatialReference=g.spatialReference??void 0;const S=l.attributes.Name,j=T+1;f.push({routeId:j,routeName:S,route:l})}),a?.forEach(l=>{const{routeName:T}=l;B(T).directions=l});const w=(h?.features.every(l=>l.attributes.RouteName==null)??!1)&&f.length>0?f[0].routeName:null;return h?.features.forEach(l=>{l.geometry&&(l.geometry.spatialReference??=h.spatialReference??void 0);const T=w??l.attributes.RouteName,S=B(T);S.stops??=[],S.stops.push(l)}),o?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=o;S.directionLines??={features:[],geometryType:j,spatialReference:F},S.directionLines.features.push(l)}),s?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=s;S.directionPoints??={features:[],geometryType:j,spatialReference:F},S.directionPoints.features.push(l)}),n?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=n;S.traversedEdges??={features:[],geometryType:j,spatialReference:F},S.traversedEdges.features.push(l)}),b?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=b;S.traversedJunctions??={features:[],geometryType:j,spatialReference:F},S.traversedJunctions.features.push(l)}),P?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T);S.traversedTurns??={features:[]},S.traversedTurns.features.push(l)}),ir.fromJSON({routeResults:f,barriers:r,polygonBarriers:u,polylineBarriers:d,messages:y})}const ar={type:String,json:{read:{source:"token"},write:{target:"token"}}};let x=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};t([i({type:Boolean,json:{write:!0}})],x.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({types:tt,json:{read:rt,write:!0}})],x.prototype,"geometry",void 0),t([A(It)],x.prototype,"geometryType",void 0),t([i({type:String,json:{name:"layerName",write:!0}})],x.prototype,"name",void 0),t([A(Dt,{name:"spatialRel"})],x.prototype,"spatialRelationship",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"where",void 0),x=t([O("esri.rest.support.DataLayer")],x);const lr=x;var Te;let de=Te=class extends E{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Te({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};t([i({type:Boolean,json:{write:!0}})],de.prototype,"doNotLocateOnRestrictedElements",void 0),de=Te=t([O("esri.rest.support.NetworkFeatureSet")],de);const ur=de;let te=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};t([i({type:Boolean,json:{write:!0}})],te.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({type:String,json:{write:!0}})],te.prototype,"url",void 0),te=t([O("esri.rest.support.NetworkUrl")],te);const pr=te;var Ne;let p=Ne=class extends Re(D){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return ot(Ne,e)}readAccumulateAttributes(e){return e==null?null:e.map(r=>H.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}writePointBarriers(e,r,o){le(e,r,o)}writePolygonBarrier(e,r,o){le(e,r,o)}writePolylineBarrier(e,r,o){le(e,r,o)}readRestrictionAttributes(e){return e==null?null:e.map(r=>De.fromJSON(r))}writeRestrictionAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>De.toJSON(s)))}readStartTime(e,r){const{startTime:o}=r;return o==null?null:o==="now"?"now":new Date(o)}writeStartTime(e,r){e!=null&&(r.startTime=e==="now"?"now":e.getTime())}readStops(e,r){return hr(r.stops)}writeStops(e,r,o){le(e,r,o)}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],p.prototype,"accumulateAttributes",void 0),t([N("accumulateAttributes")],p.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributes")],p.prototype,"writeAccumulateAttributes",null),t([i(ar)],p.prototype,"apiKey",void 0),t([i({json:{write:!0}})],p.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"directionsLanguage",void 0),t([A(Ze)],p.prototype,"directionsLengthUnits",void 0),t([A(Ct)],p.prototype,"directionsOutputType",void 0),t([A(Mt)],p.prototype,"directionsStyleName",void 0),t([A(Ae,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],p.prototype,"directionsTimeAttribute",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"findBestSequence",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionM",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionZ",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"ignoreInvalidLocations",void 0),t([A(H,{name:"impedanceAttributeName",ignoreUnknown:!1})],p.prototype,"impedanceAttribute",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"outputGeometryPrecision",void 0),t([A(Jt)],p.prototype,"outputGeometryPrecisionUnits",void 0),t([A(_t)],p.prototype,"outputLines",void 0),t([i({type:W,json:{name:"outSR",write:!0}})],p.prototype,"outSpatialReference",void 0),t([i({json:{write:!0}})],p.prototype,"overrides",void 0),t([i({json:{name:"barriers",write:!0}})],p.prototype,"pointBarriers",void 0),t([$("pointBarriers")],p.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],p.prototype,"polygonBarriers",void 0),t([$("polygonBarriers")],p.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],p.prototype,"polylineBarriers",void 0),t([$("polylineBarriers")],p.prototype,"writePolylineBarrier",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveObjectID",void 0),t([i({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],p.prototype,"restrictionAttributes",void 0),t([N("restrictionAttributes")],p.prototype,"readRestrictionAttributes",null),t([$("restrictionAttributes")],p.prototype,"writeRestrictionAttributes",null),t([A(kt)],p.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnDirections",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolygonBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolylineBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnRoutes",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnStops",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedEdges",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedJunctions",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnZ",void 0),t([i({json:{write:!0}})],p.prototype,"startTime",void 0),t([N("startTime")],p.prototype,"readStartTime",null),t([$("startTime")],p.prototype,"writeStartTime",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"startTimeIsUTC",void 0),t([i({json:{write:!0}})],p.prototype,"stops",void 0),t([N("stops")],p.prototype,"readStops",null),t([$("stops")],p.prototype,"writeStops",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"timeWindowsAreUTC",void 0),t([i({type:Oe,json:{write:!0}})],p.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useHierarchy",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useTimeWindows",void 0),p=Ne=t([O("esri.rest.support.RouteParameters")],p);const yr=p;function cr(e){return e&&"type"in e}function dr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function mr(e){return e&&"url"in e}function fr(e){return e&&"features"in e}function hr(e){return cr(e)?lr.fromJSON(e):mr(e)?pr.fromJSON(e):dr(e)?ur.fromJSON(e):fr(e)?E.fromJSON(e):null}function le(e,r,o){e!=null&&(r[o]=L.isCollection(e)?{features:e.toArray().map(s=>s.toJSON())}:e.toJSON())}function Se(e){return e.length?e:null}function Pe(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Pe("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Pe("esriGeometryPolyline")}}}function ue(e){return"layers"in e}function vr(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function wr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function gr(e,r,o){const s=r.networkDataset?.networkAttributes,a=s?.filter(({usageType:c})=>c==="cost")??[],y=o.travelMode??r.defaultTravelMode;if(y==null)return void Ye().warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:u,distanceAttributeName:d}=y,g=a.find(({name:c})=>c===u),h=a.find(({name:c})=>c===d),n=o.travelMode?.impedanceAttributeName??o.impedanceAttribute??r.impedance,b=g?.units,P=h?.units;if(!b||!P)throw new M("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const B=o.directionsLanguage??r.directionsLanguage,m=o.accumulateAttributes??r.accumulateAttributeNames??[],f=new Set(a.filter(({name:c})=>c===u||c===d||c===n||c!=null&&m.includes(c)).map(({name:c})=>c)),w=c=>{for(const Le in c)f.has(Le)||delete c[Le]};for(const c of e.pointBarriers)c.costs!=null&&(c.addedCost=c.costs[n]??0,w(c.costs));for(const c of e.polygonBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));for(const c of e.polylineBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));const{routeInfo:l}=e,{findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe}=o;l.analysisSettings=new Ft({accumulateAttributes:m,directionsLanguage:B,findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe,travelMode:y}),l.totalDuration=z(l.totalCosts?.[u]??0,b),l.totalDistance=be(l.totalCosts?.[d]??0,P),l.totalLateDuration=z(l.totalViolations?.[u]??0,b),l.totalWaitDuration=z(l.totalWait?.[u]??0,b),l.totalCosts!=null&&w(l.totalCosts),l.totalViolations!=null&&w(l.totalViolations),l.totalWait!=null&&w(l.totalWait);for(const c of e.stops)c.serviceCosts!=null&&(c.serviceDuration=z(c.serviceCosts[u]??0,b),c.serviceDistance=be(c.serviceCosts[d]??0,P),w(c.serviceCosts)),c.cumulativeCosts!=null&&(c.cumulativeDuration=z(c.cumulativeCosts[u]??0,b),c.cumulativeDistance=be(c.cumulativeCosts[d]??0,P),w(c.cumulativeCosts)),c.violations!=null&&(c.lateDuration=z(c.violations[u]??0,b),w(c.violations)),c.wait!=null&&(c.waitDuration=z(c.wait[u]??0,b),w(c.wait))}async function Je(e){const r=W.WGS84;return await wt(e.spatialReference,r),gt(e,r)}function z(e,r){switch(r){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function be(e,r){return r==="decimal-degrees"||r==="points"||r==="unknown"?e:mt(e,r,"meters")}function Sr(e){const{attributes:r,geometry:o,popupTemplate:s,symbol:a}=e.toGraphic().toJSON();return{attributes:r,geometry:o,popupInfo:s,symbol:a}}const br=L.ofType(pe),Br=L.ofType(ye),_e=L.ofType(re),ke=L.ofType(oe),xe=L.ofType(ie),Ee=L.ofType(se),He="esri.layers.RouteLayer",Ye=()=>We.getLogger(He);let v=class extends bt(Nt(Bt(Tt(ht(St))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new ze,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new _e,this.polygonBarriers=new ke,this.polylineBarriers=new xe,this.routeInfo=null,this.spatialReference=W.WGS84,this.stops=new Ee,this.type="route";const r=()=>{this._setStopSymbol(this.stops)};this.addHandles(it(()=>this.stops,"change",r,{sync:!0,onListenerAdd:r}))}writeFeatureCollectionWebmap(e,r,o,s){const a=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(d=>!!d),y=a.map((d,g)=>g),u=s.origin==="web-map"?"featureCollection.layers":"layers";st(u,a,r),r.opacity=this.opacity,r.visibility=this.visible,r.visibleLayers=y}readDirectionLines(e,r){return this._getNetworkFeatures(r,"DirectionLines",o=>pe.fromGraphic(o))}readDirectionPoints(e,r){return this._getNetworkFeatures(r,"DirectionPoints",o=>ye.fromGraphic(o))}get fullExtent(){const e=new Ue({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:W.WGS84});if(this.routeInfo?.geometry!=null)return this.routeInfo.geometry.extent??e;if(this.stops==null)return e;const r=this.stops.filter(a=>a.geometry!=null);if(r.length<2)return e;const{spatialReference:o}=r.at(0).geometry;if(o==null)return e;const s=r.toArray().map(a=>{const y=a.geometry;return[y.x,y.y]});return new nt({points:s,spatialReference:o}).extent}readMaxScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.maxScale!=null)?.layerDefinition.maxScale??0}readMinScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.minScale!=null)?.layerDefinition.minScale??0}readPointBarriers(e,r){return this._getNetworkFeatures(r,"Barriers",o=>re.fromGraphic(o))}readPolygonBarriers(e,r){return this._getNetworkFeatures(r,"PolygonBarriers",o=>oe.fromGraphic(o))}readPolylineBarriers(e,r){return this._getNetworkFeatures(r,"PolylineBarriers",o=>ie.fromGraphic(o))}readRouteInfo(e,r){return this._getNetworkFeatures(r,"RouteInfo",o=>we.fromGraphic(o)).at(0)??null}readSpatialReference(e,r){const o=ue(r)?r.layers:r.featureCollection?.layers;if(!o?.length)return W.WGS84;const{layerDefinition:s,featureSet:a}=o[0],y=a.features[0],u=y?.geometry?.spatialReference??a.spatialReference??s.spatialReference??s.extent.spatialReference??je;return W.fromJSON(u)}readStops(e,r){return this._getNetworkFeatures(r,"Stops",o=>se.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return Ie.routeServiceUrl}set url(e){e!=null?this._set("url",Pt(e,Ye())):this._set("url",Ie.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){this.directionLines!=null&&(this.directionLines.removeAll(),this._set("directionLines",null)),this.directionPoints!=null&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),this.routeInfo!=null&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:r}=this;if(!r)throw new M("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!r.id)throw new M("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(r.type!=="Feature Collection")throw new M("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(this.routeInfo==null)throw new M("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=r;await o.signIn(),o.user||await r.reload();const{itemUrl:s,itemControl:a}=r;if(a!=="admin"&&a!=="update")throw new M("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const y={messages:[],origin:"portal-item",portal:o,url:s?at(s):void 0,writtenProperties:[]},u=this.write(void 0,y);return r.extent=await Je(e),r.title=this.title,await r.update({data:u}),r}async saveAs(e,r={}){if(await this.load(),this.routeInfo==null)throw new M("routelayer:route-unsolved","saveAs() requires a solved route");const o=Rt.from(e).clone();o.extent??=await Je(this.fullExtent),o.id=null,o.portal??=lt.getDefault(),o.title??=this.title,o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",At.MULTI_LAYER,"Route Layer"];const{portal:s}=o,a={messages:[],origin:"portal-item",portal:s,url:null,writtenProperties:[]};await s.signIn();const y=r?.folder,u=this.write(void 0,a);return await s.user.addItem({item:o,folder:y,data:u}),this.portalItem=o,vt(a),a.portalItem=o,o}async solve(e,r){const o=e?.stops??this.stops,s=e?.pointBarriers??Se(this.pointBarriers),a=e?.polylineBarriers??Se(this.polylineBarriers),y=e?.polygonBarriers??Se(this.polygonBarriers);if(o==null)throw new M("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((vr(o)||wr(o))&&o.features.length<2||L.isCollection(o)&&o.length<2)throw new M("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(L.isCollection(o))for(const f of o)f.routeName=null;const u=e?.apiKey,d=this.url,g=await this._getServiceDescription(d,u,r),h=e?.travelMode??g.defaultTravelMode,n=e?.accumulateAttributes??[];h!=null&&(n.push(h.distanceAttributeName),h.timeAttributeName&&n.push(h.timeAttributeName));const b={accumulateAttributes:n,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:s,polylineBarriers:a,polygonBarriers:y,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!s,returnDirections:!0,returnPolygonBarriers:!!y,returnPolylineBarriers:!!a,returnRoutes:!0,returnStops:!0,stops:o},P=yr.from(e??{});let B;P.set(b);try{B=await sr(d,P,r)}catch(f){throw ut(f)?f:new M("routelayer:failed-route-request","the routing request failed",{error:f})}const m=this._toRouteLayerSolution(B);return this._isOverridden("title")||(this.title=m.routeInfo.name??"Route"),gr(m,g,P),m}update(e){const{stops:r,directionLines:o,directionPoints:s,pointBarriers:a,polylineBarriers:y,polygonBarriers:u,routeInfo:d}=e;this.set({stops:r,pointBarriers:a,polylineBarriers:y,polygonBarriers:u}),this._set("directionLines",o),this._set("directionPoints",s),this._set("routeInfo",d),d.geometry!=null&&(this.spatialReference=d.geometry.spatialReference)}_getNetworkFeatures(e,r,o,s){const a=ue(e)?e.layers:e.featureCollection?.layers,y=a?.find(f=>f.layerDefinition.name===r);if(y==null)return new L;const{layerDefinition:u,popupInfo:d,featureSet:g}=y,h=u.drawingInfo.renderer,{features:n}=g,b=g.spatialReference??u.spatialReference??u.extent.spatialReference??je,P=h&&ft(h),B=W.fromJSON(b),m=n.map(f=>{const w=Q.fromJSON(f);w.geometry!=null&&f.geometry!=null&&f.geometry.spatialReference==null&&(w.geometry.spatialReference=B);const l=o(w);return l.symbol??=P?.getSymbol(w)??this._getNetworkSymbol(r),l.popupTemplate??=d&&pt.fromJSON(d),l});return s&&m.some(({symbol:f})=>!f)&&s(m),new L(m)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,r,o){if(this._cachedServiceDescription!=null&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const s=await Ke(e,r,o);return this._cachedServiceDescription={serviceDescription:s,url:e},s}_setStopSymbol(e){if(!e||e.length===0||this.defaultSymbols.stops==null||e.every(({symbol:n})=>n!=null))return;const{first:r,last:o,middle:s,unlocated:a,waypoint:y,break:u}=this.defaultSymbols.stops;if(this.routeInfo==null||e.length===1)return void e.forEach((n,b)=>{switch(b){case 0:n.symbol=r;break;case e.length-1:n.symbol=o;break;default:n.symbol=s}});const d=e.map(({sequence:n})=>n).filter(n=>n!=null),g=Math.min(...d),h=Math.max(...d);for(const n of e)n.sequence!==g?n.sequence!==h?n.status==="ok"||n.status==="not-located-on-closest"?n.locationType!=="waypoint"?n.locationType!=="break"?n.symbol=s:n.symbol=u:n.symbol=y:n.symbol=a:n.symbol=o:n.symbol=r}_toRouteLayerSolution(e){const r=e.routeResults[0].stops?.map(h=>se.fromJSON(h.toJSON()));this._setStopSymbol(r);const o=new Ee(r),s=new ke(e.polygonBarriers?.map(h=>{const n=oe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polygonBarriers,n})),a=new xe(e.polylineBarriers?.map(h=>{const n=ie.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polylineBarriers,n})),y=new _e(e.pointBarriers?.map(h=>{const n=re.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.pointBarriers,n})),u=e.routeResults[0].route?.toJSON(),d=we.fromJSON(u);d.symbol=this.defaultSymbols.routeInfo;const g=new Br(e.routeResults[0].directionPoints?.features.map(h=>{const n=ye.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionPoints,n}));return{directionLines:new br(e.routeResults[0].directionLines?.features.map(h=>{const n=pe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionLines,n})),directionPoints:g,pointBarriers:y,polygonBarriers:s,polylineBarriers:a,routeInfo:d,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",pe.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",ye.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,r,o,s,a,y){if(!e?.length)return null;const u=this.spatialReference.toJSON(),{fullExtent:d,maxScale:g,minScale:h}=this;return{featureSet:{features:e.toArray().map(n=>Sr(n)),geometryType:o,spatialReference:u},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:r!=null?r.toJSON():Pe(o)}},extent:d.toJSON(),fields:s,geometryType:o,hasM:!1,hasZ:!1,maxScale:g,minScale:h,name:a,objectIdField:"ObjectID",spatialReference:u,title:y,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",re.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",oe.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ie.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(this.routeInfo!=null?new L([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",we.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",se.fields,"Stops","Stops");if(e==null)return null;const{stops:r}=this.defaultSymbols,o=r?.first?.toJSON(),s=r?.middle?.toJSON(),a=r?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:s,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:a,label:"Last Stop"}]},e}};t([i({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],v.prototype,"_featureCollection",void 0),t([$(["web-map","portal-item"],"_featureCollection")],v.prototype,"writeFeatureCollectionWebmap",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],v.prototype,"_type",void 0),t([i({nonNullable:!0,type:ze})],v.prototype,"defaultSymbols",void 0),t([i({readOnly:!0})],v.prototype,"directionLines",void 0),t([N(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],v.prototype,"readDirectionLines",null),t([i({readOnly:!0})],v.prototype,"directionPoints",void 0),t([N(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],v.prototype,"readDirectionPoints",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],v.prototype,"featureCollectionType",void 0),t([i({readOnly:!0})],v.prototype,"fullExtent",null),t([i({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],v.prototype,"legendEnabled",void 0),t([i({type:["show","hide"]})],v.prototype,"listMode",void 0),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"maxScale",void 0),t([N(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],v.prototype,"readMaxScale",null),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"minScale",void 0),t([N(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],v.prototype,"readMinScale",null),t([i({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],v.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0,type:L.ofType(re)})],v.prototype,"pointBarriers",void 0),t([N(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],v.prototype,"readPointBarriers",null),t([i({nonNullable:!0,type:L.ofType(oe)})],v.prototype,"polygonBarriers",void 0),t([N(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolygonBarriers",null),t([i({nonNullable:!0,type:L.ofType(ie)})],v.prototype,"polylineBarriers",void 0),t([N(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolylineBarriers",null),t([i({readOnly:!0})],v.prototype,"routeInfo",void 0),t([N(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],v.prototype,"readRouteInfo",null),t([i({type:W})],v.prototype,"spatialReference",void 0),t([N(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],v.prototype,"readSpatialReference",null),t([i({nonNullable:!0,type:L.ofType(se)})],v.prototype,"stops",void 0),t([N(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],v.prototype,"readStops",null),t([i()],v.prototype,"title",null),t([i({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),t([i()],v.prototype,"url",null),v=t([O(He)],v);const Bo=v;export{Bo as default}; diff --git a/main/assets/RouteLayer-BQQ6WxtH-CfUqYUOq.js b/main/assets/RouteLayer-BQQ6WxtH-CfUqYUOq.js deleted file mode 100644 index d70292bad..000000000 --- a/main/assets/RouteLayer-BQQ6WxtH-CfUqYUOq.js +++ /dev/null @@ -1,2 +0,0 @@ -import{v as t,S as i,jP as Z,i as O,jQ as he,jR as et,bz as A,a0 as N,ac as $,aK as Fe,w as Ge,m as me,n as Ue,bi as Q,aa as Re,af as tt,g as rt,aO as ot,J as W,ag as L,ai as it,el as st,G as nt,ft as je,C as Ie,o as M,a as at,r as lt,aU as ut,bL as pt,e as D,eD as V,eB as ve,eC as yt,f as Y,dI as Be,N as ct,aq as $e,aR as dt,dW as mt,a1 as We}from"./main-BZaw9FpY.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{o as ft}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as ht}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{n as vt}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{N as wt,K as gt}from"./projection-BA9M1R7d-DoNqITCd.js";import{D as St}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as bt}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as Bt}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as Tt}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as Nt}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{j as Pt}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import Rt from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import{E as At}from"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import{a as fe,y as qe}from"./utils-9sQxfkoa-Cus_qP6M.js";import{A as H,Q as Ae,a as Ot,c as Lt,s as Ze,e as Oe,y as jt,m as It,d as Dt,V as De,o as Ct,u as Mt,Z as Jt,n as _t,$ as kt,T as pe,b as ye,v as re,f as oe,S as ie,N as se,g as we,W as xt,h as Et,t as Ft}from"./Stop-he5xSAJJ-B5QVbzdn.js";import{B as Gt}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{O as E}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";let G=class extends D{constructor(e){super(e),this.break=new V({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new V({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new V({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new V({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new V({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new V({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};t([i({types:Z})],G.prototype,"break",void 0),t([i({types:Z})],G.prototype,"first",void 0),t([i({types:Z})],G.prototype,"unlocated",void 0),t([i({types:Z})],G.prototype,"last",void 0),t([i({types:Z})],G.prototype,"middle",void 0),t([i({types:Z})],G.prototype,"waypoint",void 0),G=t([O("esri.layers.support.RouteStopSymbols")],G);const Ve=G;let k=class extends D{constructor(e){super(e),this.directionLines=new ve({color:[0,122,194],width:6}),this.directionPoints=new V({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new V({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new yt({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new ve({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new ve({width:8,color:[20,89,127]}),this.stops=new Ve}};t([i({types:he})],k.prototype,"directionLines",void 0),t([i({types:Z})],k.prototype,"directionPoints",void 0),t([i({types:Z})],k.prototype,"pointBarriers",void 0),t([i({types:et})],k.prototype,"polygonBarriers",void 0),t([i({types:he})],k.prototype,"polylineBarriers",void 0),t([i({types:he})],k.prototype,"routeInfo",void 0),t([i({type:Ve})],k.prototype,"stops",void 0),k=t([O("esri.layers.support.RouteSymbols")],k);const ze=k;let J=class extends D{constructor(e){super(e),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};t([i({type:String})],J.prototype,"dataType",void 0),t([A(H,{ignoreUnknown:!1})],J.prototype,"name",void 0),t([i({type:[String]})],J.prototype,"parameterNames",void 0),t([i({type:String})],J.prototype,"restrictionUsageParameterName",void 0),t([A(Ae,{ignoreUnknown:!1})],J.prototype,"timeNeutralAttributeName",void 0),t([i({type:String})],J.prototype,"trafficSupport",void 0),t([A(Ot)],J.prototype,"units",void 0),t([A(Lt)],J.prototype,"usageType",void 0),J=t([O("esri.rest.support.NetworkAttribute")],J);const Ut=J;let q=class extends D{constructor(e){super(e),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};t([i({type:Number})],q.prototype,"buildTime",void 0),t([i({type:String})],q.prototype,"name",void 0),t([i({type:[Ut]})],q.prototype,"networkAttributes",void 0),t([i()],q.prototype,"networkSources",void 0),t([i({type:String})],q.prototype,"state",void 0),q=t([O("esri.rest.support.NetworkDataset")],q);const $t=q;let R=class extends D{constructor(e){super(e),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(e){return e==null?null:e.map(r=>H.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(e,r){const o=r.supportedTravelModes?.find(({id:s})=>s===r.defaultTravelMode)??r.supportedTravelModes?.find(({itemId:s})=>s===r.defaultTravelMode);return o?Oe.fromJSON(o):null}};t([i()],R.prototype,"accumulateAttributeNames",void 0),t([N("accumulateAttributeNames")],R.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributeNames")],R.prototype,"writeAccumulateAttributes",null),t([i()],R.prototype,"attributeParameterValues",void 0),t([i()],R.prototype,"capabilities",null),t([i()],R.prototype,"currentVersion",void 0),t([i()],R.prototype,"defaultTravelMode",void 0),t([N("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],R.prototype,"readDefaultTravelMode",null),t([i()],R.prototype,"directionsLanguage",void 0),t([A(Ze)],R.prototype,"directionsLengthUnits",void 0),t([i()],R.prototype,"directionsSupportedLanguages",void 0),t([A(Ae,{ignoreUnknown:!1})],R.prototype,"directionsTimeAttribute",void 0),t([i()],R.prototype,"hasZ",void 0),t([A(H,{ignoreUnknown:!1})],R.prototype,"impedance",void 0),t([i({type:$t})],R.prototype,"networkDataset",void 0),t([i({type:[Oe]})],R.prototype,"supportedTravelModes",void 0),R=t([O("esri.rest.support.NetworkServiceDescription")],R);const Wt=R,qt=()=>We.getLogger("esri.rest.networkService");function ne(e,r,o,s){s[o]=[r.length,r.length+e.length],e.forEach(a=>{r.push(a.geometry)})}function Zt(e,r){for(let o=0;o=10.4?Kt(e,r,o):zt(e,o),{defaultTravelMode:u,supportedTravelModes:d}=await y;return a.defaultTravelMode=u,a.supportedTravelModes=d,Wt.fromJSON(a)}async function zt(e,r){const o=fe({f:"json"},r),{data:s}=await Y(e.replace(/\/rest\/.*$/i,"/info"),o);if(!s?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:a}=s,y=Be(a)+"/sharing/rest/portals/self",{data:u}=await Y(y,o),d=ct("helperServices.routingUtilities.url",u);if(!d)return{supportedTravelModes:[],defaultTravelMode:null};const g=qe(a),h=/\/solve$/i.test(g.path)?"Route":/\/solveclosestfacility$/i.test(g.path)?"ClosestFacility":"ServiceAreas",n=fe({f:"json",serviceName:h},r),b=Be(d)+"/GetTravelModes/execute",P=await Y(b,n),B=[];let m=null;if(P?.data?.results?.length){const f=P.data.results;for(const w of f)if(w.paramName==="supportedTravelModes"){if(w.value?.features){for(const{attributes:l}of w.value.features)if(l){const T=JSON.parse(l.TravelMode);B.push(T)}}}else w.paramName==="defaultTravelMode"&&(m=w.value)}return{supportedTravelModes:B,defaultTravelMode:m}}async function Kt(e,r,o){try{const s=fe({f:"json",token:r},o),a=Be(e)+"/retrieveTravelModes",{data:{supportedTravelModes:y,defaultTravelMode:u}}=await Y(a,s);return{supportedTravelModes:y,defaultTravelMode:u}}catch(s){throw new M("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:s})}}const Ce=new Fe({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let X=class extends D{constructor(e){super(e),this.description=null,this.type=null}};t([i({type:String,json:{write:!0}})],X.prototype,"description",void 0),t([i({type:String,json:{read:Ce.read,write:Ce.write}})],X.prototype,"type",void 0),X=t([O("esri.rest.support.GPMessage")],X);const Qt=X,Me=new Fe({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let ce=class extends Qt{constructor(e){super(e),this.type=null}};t([i({type:String,json:{read:Me.read,write:Me.write}})],ce.prototype,"type",void 0),ce=t([O("esri.rest.support.NAMessage")],ce);const Ht=ce;let ee=class extends D{constructor(e){super(e)}};t([i({json:{read:{source:"string"}}})],ee.prototype,"text",void 0),t([A(jt,{name:"stringType"})],ee.prototype,"type",void 0),ee=t([O("esri.rest.support.DirectionsString")],ee);const Qe=ee;let U=class extends D{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,r){return xt(r.ETA,r.arriveTimeUTC)}readGeometry(e,r){return Ge.fromJSON(r.point)}};t([i({type:Date,json:{read:{source:"arriveTimeUTC"}}})],U.prototype,"arriveTime",void 0),t([i()],U.prototype,"arriveTimeOffset",void 0),t([N("arriveTimeOffset",["arriveTimeUTC","ETA"])],U.prototype,"readArriveTimeOffset",null),t([i({type:Ge})],U.prototype,"geometry",void 0),t([N("geometry",["point"])],U.prototype,"readGeometry",null),t([i({type:[Qe]})],U.prototype,"strings",void 0),U=t([O("esri.rest.support.DirectionsEvent")],U);const Yt=U;function Xt(e){if(e==null||e==="")return null;let r=0,o=0,s=0,a=0;const y=[];let u,d,g,h,n,b,P,B,m=0,f=0,w=0;if(n=e.match(/((\+|-)[^+\-|]+|\|)/g),n||(n=[]),parseInt(n[m],32)===0){m=2;const l=parseInt(n[m],32);m++,b=parseInt(n[m],32),m++,1&l&&(f=n.indexOf("|")+1,P=parseInt(n[f],32),f++),2&l&&(w=n.indexOf("|",f)+1,B=parseInt(n[w],32),w++)}else b=parseInt(n[m],32),m++;for(;m0,hasM:w>0}}let K=class extends Q{constructor(e){super(e),this.events=null,this.geometry=null,this.strings=null}readGeometry(e,r){const o=Xt(r.compressedGeometry);return o!=null?me.fromJSON(o):null}};t([i({type:[Yt]})],K.prototype,"events",void 0),t([i({type:me})],K.prototype,"geometry",void 0),t([N("geometry",["compressedGeometry"])],K.prototype,"readGeometry",null),t([i({type:[Qe]})],K.prototype,"strings",void 0),K=t([O("esri.rest.support.DirectionsFeature")],K);const er=K;function tr(e,r){if(e.length===0)return new me({spatialReference:r});const o=[];for(const u of e)for(const d of u.paths)o.push(...d);const s=[];o.forEach((u,d)=>{d!==0&&u[0]===o[d-1][0]&&u[1]===o[d-1][1]||s.push(u)});const{hasM:a,hasZ:y}=e[0];return new me({hasM:a,hasZ:y,paths:[s],spatialReference:r})}let I=class extends E{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,r){if(!e)return[];const o=r.summary.envelope.spatialReference??r.spatialReference,s=o&&W.fromJSON(o);return e.map(a=>{const y=er.fromJSON(a);if(y.geometry!=null&&(y.geometry.spatialReference=s),y.events!=null)for(const u of y.events)u.geometry!=null&&(u.geometry.spatialReference=s);return y})}get mergedGeometry(){return this.features?tr(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:e})=>e).filter($e)}};t([i({type:Ue,json:{read:{source:"summary.envelope"}}})],I.prototype,"extent",void 0),t([i({nonNullable:!0})],I.prototype,"features",void 0),t([N("features")],I.prototype,"readFeatures",null),t([i()],I.prototype,"geometryType",void 0),t([i({readOnly:!0})],I.prototype,"mergedGeometry",null),t([i()],I.prototype,"routeId",void 0),t([i()],I.prototype,"routeName",void 0),t([i({value:null,readOnly:!0})],I.prototype,"strings",null),t([i({json:{read:{source:"summary.totalDriveTime"}}})],I.prototype,"totalDriveTime",void 0),t([i({json:{read:{source:"summary.totalLength"}}})],I.prototype,"totalLength",void 0),t([i({json:{read:{source:"summary.totalTime"}}})],I.prototype,"totalTime",void 0),I=t([O("esri.rest.support.DirectionsFeatureSet")],I);const rr=I;let C=class extends D{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};t([i({type:E,json:{write:!0}})],C.prototype,"directionLines",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"directionPoints",void 0),t([i({type:rr,json:{write:!0}})],C.prototype,"directions",void 0),t([i({type:Q,json:{write:!0}})],C.prototype,"route",void 0),t([i({type:String,json:{write:!0}})],C.prototype,"routeName",void 0),t([i({type:[Q],json:{write:!0}})],C.prototype,"stops",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedEdges",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedJunctions",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedTurns",void 0),C=t([O("esri.rest.support.RouteResult")],C);const or=C;function ge(e){return e?E.fromJSON(e).features.filter($e):[]}let _=class extends D{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,r){return ge(r.barriers)}readPolylineBarriers(e){return ge(e)}readPolygonBarriers(e){return ge(e)}};t([i({type:[Ht]})],_.prototype,"messages",void 0),t([i({type:[Q]})],_.prototype,"pointBarriers",void 0),t([N("pointBarriers",["barriers"])],_.prototype,"readPointBarriers",null),t([i({type:[Q]})],_.prototype,"polylineBarriers",void 0),t([N("polylineBarriers")],_.prototype,"readPolylineBarriers",null),t([i({type:[Q]})],_.prototype,"polygonBarriers",void 0),t([N("polygonBarriers")],_.prototype,"readPolygonBarriers",null),t([i({type:[or]})],_.prototype,"routeResults",void 0),_=t([O("esri.rest.support.RouteSolveResult")],_);const ir=_;function ae(e){return e instanceof E}async function sr(e,r,o){const s=[],a=[],y={},u={},d=qe(e),{path:g}=d;ae(r.stops)&&ne(r.stops.features,a,"stops.features",y),ae(r.pointBarriers)&&ne(r.pointBarriers.features,a,"pointBarriers.features",y),ae(r.polylineBarriers)&&ne(r.polylineBarriers.features,a,"polylineBarriers.features",y),ae(r.polygonBarriers)&&ne(r.polygonBarriers.features,a,"polygonBarriers.features",y);const h=await Gt(a);for(const B in y){const m=y[B];s.push(B),u[B]=h.slice(m[0],m[1])}if(Vt(u,s)){let B=null;try{B=await Ke(g,r.apiKey,o)}catch{}B&&!B.hasZ&&Zt(u,s)}for(const B in u)u[B].forEach((m,f)=>{dt(r,B)[f].geometry=m});const n={...o,query:{...d.query,...Et(r),f:"json"}},b=g.endsWith("/solve")?g:`${g}/solve`,{data:P}=await Y(b,n);return nr(P)}function nr(e){const{barriers:r,directionLines:o,directionPoints:s,directions:a,messages:y,polygonBarriers:u,polylineBarriers:d,routes:g,stops:h,traversedEdges:n,traversedJunctions:b,traversedTurns:P}=e,B=l=>{const T=f.find(j=>j.routeName===l);if(T!=null)return T;const S={routeId:f.length+1,routeName:l};return f.push(S),S},m=l=>{const T=f.find(j=>j.routeId===l);if(T!=null)return T;const S={routeId:l,routeName:null};return f.push(S),S},f=[];g?.features.forEach((l,T)=>{l.geometry.spatialReference=g.spatialReference??void 0;const S=l.attributes.Name,j=T+1;f.push({routeId:j,routeName:S,route:l})}),a?.forEach(l=>{const{routeName:T}=l;B(T).directions=l});const w=(h?.features.every(l=>l.attributes.RouteName==null)??!1)&&f.length>0?f[0].routeName:null;return h?.features.forEach(l=>{l.geometry&&(l.geometry.spatialReference??=h.spatialReference??void 0);const T=w??l.attributes.RouteName,S=B(T);S.stops??=[],S.stops.push(l)}),o?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=o;S.directionLines??={features:[],geometryType:j,spatialReference:F},S.directionLines.features.push(l)}),s?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=s;S.directionPoints??={features:[],geometryType:j,spatialReference:F},S.directionPoints.features.push(l)}),n?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=n;S.traversedEdges??={features:[],geometryType:j,spatialReference:F},S.traversedEdges.features.push(l)}),b?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=b;S.traversedJunctions??={features:[],geometryType:j,spatialReference:F},S.traversedJunctions.features.push(l)}),P?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T);S.traversedTurns??={features:[]},S.traversedTurns.features.push(l)}),ir.fromJSON({routeResults:f,barriers:r,polygonBarriers:u,polylineBarriers:d,messages:y})}const ar={type:String,json:{read:{source:"token"},write:{target:"token"}}};let x=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};t([i({type:Boolean,json:{write:!0}})],x.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({types:tt,json:{read:rt,write:!0}})],x.prototype,"geometry",void 0),t([A(It)],x.prototype,"geometryType",void 0),t([i({type:String,json:{name:"layerName",write:!0}})],x.prototype,"name",void 0),t([A(Dt,{name:"spatialRel"})],x.prototype,"spatialRelationship",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"where",void 0),x=t([O("esri.rest.support.DataLayer")],x);const lr=x;var Te;let de=Te=class extends E{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Te({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};t([i({type:Boolean,json:{write:!0}})],de.prototype,"doNotLocateOnRestrictedElements",void 0),de=Te=t([O("esri.rest.support.NetworkFeatureSet")],de);const ur=de;let te=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};t([i({type:Boolean,json:{write:!0}})],te.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({type:String,json:{write:!0}})],te.prototype,"url",void 0),te=t([O("esri.rest.support.NetworkUrl")],te);const pr=te;var Ne;let p=Ne=class extends Re(D){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return ot(Ne,e)}readAccumulateAttributes(e){return e==null?null:e.map(r=>H.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}writePointBarriers(e,r,o){le(e,r,o)}writePolygonBarrier(e,r,o){le(e,r,o)}writePolylineBarrier(e,r,o){le(e,r,o)}readRestrictionAttributes(e){return e==null?null:e.map(r=>De.fromJSON(r))}writeRestrictionAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>De.toJSON(s)))}readStartTime(e,r){const{startTime:o}=r;return o==null?null:o==="now"?"now":new Date(o)}writeStartTime(e,r){e!=null&&(r.startTime=e==="now"?"now":e.getTime())}readStops(e,r){return hr(r.stops)}writeStops(e,r,o){le(e,r,o)}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],p.prototype,"accumulateAttributes",void 0),t([N("accumulateAttributes")],p.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributes")],p.prototype,"writeAccumulateAttributes",null),t([i(ar)],p.prototype,"apiKey",void 0),t([i({json:{write:!0}})],p.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"directionsLanguage",void 0),t([A(Ze)],p.prototype,"directionsLengthUnits",void 0),t([A(Ct)],p.prototype,"directionsOutputType",void 0),t([A(Mt)],p.prototype,"directionsStyleName",void 0),t([A(Ae,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],p.prototype,"directionsTimeAttribute",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"findBestSequence",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionM",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionZ",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"ignoreInvalidLocations",void 0),t([A(H,{name:"impedanceAttributeName",ignoreUnknown:!1})],p.prototype,"impedanceAttribute",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"outputGeometryPrecision",void 0),t([A(Jt)],p.prototype,"outputGeometryPrecisionUnits",void 0),t([A(_t)],p.prototype,"outputLines",void 0),t([i({type:W,json:{name:"outSR",write:!0}})],p.prototype,"outSpatialReference",void 0),t([i({json:{write:!0}})],p.prototype,"overrides",void 0),t([i({json:{name:"barriers",write:!0}})],p.prototype,"pointBarriers",void 0),t([$("pointBarriers")],p.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],p.prototype,"polygonBarriers",void 0),t([$("polygonBarriers")],p.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],p.prototype,"polylineBarriers",void 0),t([$("polylineBarriers")],p.prototype,"writePolylineBarrier",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveObjectID",void 0),t([i({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],p.prototype,"restrictionAttributes",void 0),t([N("restrictionAttributes")],p.prototype,"readRestrictionAttributes",null),t([$("restrictionAttributes")],p.prototype,"writeRestrictionAttributes",null),t([A(kt)],p.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnDirections",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolygonBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolylineBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnRoutes",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnStops",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedEdges",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedJunctions",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnZ",void 0),t([i({json:{write:!0}})],p.prototype,"startTime",void 0),t([N("startTime")],p.prototype,"readStartTime",null),t([$("startTime")],p.prototype,"writeStartTime",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"startTimeIsUTC",void 0),t([i({json:{write:!0}})],p.prototype,"stops",void 0),t([N("stops")],p.prototype,"readStops",null),t([$("stops")],p.prototype,"writeStops",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"timeWindowsAreUTC",void 0),t([i({type:Oe,json:{write:!0}})],p.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useHierarchy",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useTimeWindows",void 0),p=Ne=t([O("esri.rest.support.RouteParameters")],p);const yr=p;function cr(e){return e&&"type"in e}function dr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function mr(e){return e&&"url"in e}function fr(e){return e&&"features"in e}function hr(e){return cr(e)?lr.fromJSON(e):mr(e)?pr.fromJSON(e):dr(e)?ur.fromJSON(e):fr(e)?E.fromJSON(e):null}function le(e,r,o){e!=null&&(r[o]=L.isCollection(e)?{features:e.toArray().map(s=>s.toJSON())}:e.toJSON())}function Se(e){return e.length?e:null}function Pe(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Pe("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Pe("esriGeometryPolyline")}}}function ue(e){return"layers"in e}function vr(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function wr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function gr(e,r,o){const s=r.networkDataset?.networkAttributes,a=s?.filter(({usageType:c})=>c==="cost")??[],y=o.travelMode??r.defaultTravelMode;if(y==null)return void Ye().warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:u,distanceAttributeName:d}=y,g=a.find(({name:c})=>c===u),h=a.find(({name:c})=>c===d),n=o.travelMode?.impedanceAttributeName??o.impedanceAttribute??r.impedance,b=g?.units,P=h?.units;if(!b||!P)throw new M("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const B=o.directionsLanguage??r.directionsLanguage,m=o.accumulateAttributes??r.accumulateAttributeNames??[],f=new Set(a.filter(({name:c})=>c===u||c===d||c===n||c!=null&&m.includes(c)).map(({name:c})=>c)),w=c=>{for(const Le in c)f.has(Le)||delete c[Le]};for(const c of e.pointBarriers)c.costs!=null&&(c.addedCost=c.costs[n]??0,w(c.costs));for(const c of e.polygonBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));for(const c of e.polylineBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));const{routeInfo:l}=e,{findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe}=o;l.analysisSettings=new Ft({accumulateAttributes:m,directionsLanguage:B,findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe,travelMode:y}),l.totalDuration=z(l.totalCosts?.[u]??0,b),l.totalDistance=be(l.totalCosts?.[d]??0,P),l.totalLateDuration=z(l.totalViolations?.[u]??0,b),l.totalWaitDuration=z(l.totalWait?.[u]??0,b),l.totalCosts!=null&&w(l.totalCosts),l.totalViolations!=null&&w(l.totalViolations),l.totalWait!=null&&w(l.totalWait);for(const c of e.stops)c.serviceCosts!=null&&(c.serviceDuration=z(c.serviceCosts[u]??0,b),c.serviceDistance=be(c.serviceCosts[d]??0,P),w(c.serviceCosts)),c.cumulativeCosts!=null&&(c.cumulativeDuration=z(c.cumulativeCosts[u]??0,b),c.cumulativeDistance=be(c.cumulativeCosts[d]??0,P),w(c.cumulativeCosts)),c.violations!=null&&(c.lateDuration=z(c.violations[u]??0,b),w(c.violations)),c.wait!=null&&(c.waitDuration=z(c.wait[u]??0,b),w(c.wait))}async function Je(e){const r=W.WGS84;return await wt(e.spatialReference,r),gt(e,r)}function z(e,r){switch(r){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function be(e,r){return r==="decimal-degrees"||r==="points"||r==="unknown"?e:mt(e,r,"meters")}function Sr(e){const{attributes:r,geometry:o,popupTemplate:s,symbol:a}=e.toGraphic().toJSON();return{attributes:r,geometry:o,popupInfo:s,symbol:a}}const br=L.ofType(pe),Br=L.ofType(ye),_e=L.ofType(re),ke=L.ofType(oe),xe=L.ofType(ie),Ee=L.ofType(se),He="esri.layers.RouteLayer",Ye=()=>We.getLogger(He);let v=class extends bt(Nt(Bt(Tt(ht(St))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new ze,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new _e,this.polygonBarriers=new ke,this.polylineBarriers=new xe,this.routeInfo=null,this.spatialReference=W.WGS84,this.stops=new Ee,this.type="route";const r=()=>{this._setStopSymbol(this.stops)};this.addHandles(it(()=>this.stops,"change",r,{sync:!0,onListenerAdd:r}))}writeFeatureCollectionWebmap(e,r,o,s){const a=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(d=>!!d),y=a.map((d,g)=>g),u=s.origin==="web-map"?"featureCollection.layers":"layers";st(u,a,r),r.opacity=this.opacity,r.visibility=this.visible,r.visibleLayers=y}readDirectionLines(e,r){return this._getNetworkFeatures(r,"DirectionLines",o=>pe.fromGraphic(o))}readDirectionPoints(e,r){return this._getNetworkFeatures(r,"DirectionPoints",o=>ye.fromGraphic(o))}get fullExtent(){const e=new Ue({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:W.WGS84});if(this.routeInfo?.geometry!=null)return this.routeInfo.geometry.extent??e;if(this.stops==null)return e;const r=this.stops.filter(a=>a.geometry!=null);if(r.length<2)return e;const{spatialReference:o}=r.at(0).geometry;if(o==null)return e;const s=r.toArray().map(a=>{const y=a.geometry;return[y.x,y.y]});return new nt({points:s,spatialReference:o}).extent}readMaxScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.maxScale!=null)?.layerDefinition.maxScale??0}readMinScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.minScale!=null)?.layerDefinition.minScale??0}readPointBarriers(e,r){return this._getNetworkFeatures(r,"Barriers",o=>re.fromGraphic(o))}readPolygonBarriers(e,r){return this._getNetworkFeatures(r,"PolygonBarriers",o=>oe.fromGraphic(o))}readPolylineBarriers(e,r){return this._getNetworkFeatures(r,"PolylineBarriers",o=>ie.fromGraphic(o))}readRouteInfo(e,r){return this._getNetworkFeatures(r,"RouteInfo",o=>we.fromGraphic(o)).at(0)??null}readSpatialReference(e,r){const o=ue(r)?r.layers:r.featureCollection?.layers;if(!o?.length)return W.WGS84;const{layerDefinition:s,featureSet:a}=o[0],y=a.features[0],u=y?.geometry?.spatialReference??a.spatialReference??s.spatialReference??s.extent.spatialReference??je;return W.fromJSON(u)}readStops(e,r){return this._getNetworkFeatures(r,"Stops",o=>se.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return Ie.routeServiceUrl}set url(e){e!=null?this._set("url",Pt(e,Ye())):this._set("url",Ie.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){this.directionLines!=null&&(this.directionLines.removeAll(),this._set("directionLines",null)),this.directionPoints!=null&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),this.routeInfo!=null&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:r}=this;if(!r)throw new M("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!r.id)throw new M("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(r.type!=="Feature Collection")throw new M("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(this.routeInfo==null)throw new M("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=r;await o.signIn(),o.user||await r.reload();const{itemUrl:s,itemControl:a}=r;if(a!=="admin"&&a!=="update")throw new M("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const y={messages:[],origin:"portal-item",portal:o,url:s?at(s):void 0,writtenProperties:[]},u=this.write(void 0,y);return r.extent=await Je(e),r.title=this.title,await r.update({data:u}),r}async saveAs(e,r={}){if(await this.load(),this.routeInfo==null)throw new M("routelayer:route-unsolved","saveAs() requires a solved route");const o=Rt.from(e).clone();o.extent??=await Je(this.fullExtent),o.id=null,o.portal??=lt.getDefault(),o.title??=this.title,o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",At.MULTI_LAYER,"Route Layer"];const{portal:s}=o,a={messages:[],origin:"portal-item",portal:s,url:null,writtenProperties:[]};await s.signIn();const y=r?.folder,u=this.write(void 0,a);return await s.user.addItem({item:o,folder:y,data:u}),this.portalItem=o,vt(a),a.portalItem=o,o}async solve(e,r){const o=e?.stops??this.stops,s=e?.pointBarriers??Se(this.pointBarriers),a=e?.polylineBarriers??Se(this.polylineBarriers),y=e?.polygonBarriers??Se(this.polygonBarriers);if(o==null)throw new M("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((vr(o)||wr(o))&&o.features.length<2||L.isCollection(o)&&o.length<2)throw new M("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(L.isCollection(o))for(const f of o)f.routeName=null;const u=e?.apiKey,d=this.url,g=await this._getServiceDescription(d,u,r),h=e?.travelMode??g.defaultTravelMode,n=e?.accumulateAttributes??[];h!=null&&(n.push(h.distanceAttributeName),h.timeAttributeName&&n.push(h.timeAttributeName));const b={accumulateAttributes:n,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:s,polylineBarriers:a,polygonBarriers:y,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!s,returnDirections:!0,returnPolygonBarriers:!!y,returnPolylineBarriers:!!a,returnRoutes:!0,returnStops:!0,stops:o},P=yr.from(e??{});let B;P.set(b);try{B=await sr(d,P,r)}catch(f){throw ut(f)?f:new M("routelayer:failed-route-request","the routing request failed",{error:f})}const m=this._toRouteLayerSolution(B);return this._isOverridden("title")||(this.title=m.routeInfo.name??"Route"),gr(m,g,P),m}update(e){const{stops:r,directionLines:o,directionPoints:s,pointBarriers:a,polylineBarriers:y,polygonBarriers:u,routeInfo:d}=e;this.set({stops:r,pointBarriers:a,polylineBarriers:y,polygonBarriers:u}),this._set("directionLines",o),this._set("directionPoints",s),this._set("routeInfo",d),d.geometry!=null&&(this.spatialReference=d.geometry.spatialReference)}_getNetworkFeatures(e,r,o,s){const a=ue(e)?e.layers:e.featureCollection?.layers,y=a?.find(f=>f.layerDefinition.name===r);if(y==null)return new L;const{layerDefinition:u,popupInfo:d,featureSet:g}=y,h=u.drawingInfo.renderer,{features:n}=g,b=g.spatialReference??u.spatialReference??u.extent.spatialReference??je,P=h&&ft(h),B=W.fromJSON(b),m=n.map(f=>{const w=Q.fromJSON(f);w.geometry!=null&&f.geometry!=null&&f.geometry.spatialReference==null&&(w.geometry.spatialReference=B);const l=o(w);return l.symbol??=P?.getSymbol(w)??this._getNetworkSymbol(r),l.popupTemplate??=d&&pt.fromJSON(d),l});return s&&m.some(({symbol:f})=>!f)&&s(m),new L(m)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,r,o){if(this._cachedServiceDescription!=null&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const s=await Ke(e,r,o);return this._cachedServiceDescription={serviceDescription:s,url:e},s}_setStopSymbol(e){if(!e||e.length===0||this.defaultSymbols.stops==null||e.every(({symbol:n})=>n!=null))return;const{first:r,last:o,middle:s,unlocated:a,waypoint:y,break:u}=this.defaultSymbols.stops;if(this.routeInfo==null||e.length===1)return void e.forEach((n,b)=>{switch(b){case 0:n.symbol=r;break;case e.length-1:n.symbol=o;break;default:n.symbol=s}});const d=e.map(({sequence:n})=>n).filter(n=>n!=null),g=Math.min(...d),h=Math.max(...d);for(const n of e)n.sequence!==g?n.sequence!==h?n.status==="ok"||n.status==="not-located-on-closest"?n.locationType!=="waypoint"?n.locationType!=="break"?n.symbol=s:n.symbol=u:n.symbol=y:n.symbol=a:n.symbol=o:n.symbol=r}_toRouteLayerSolution(e){const r=e.routeResults[0].stops?.map(h=>se.fromJSON(h.toJSON()));this._setStopSymbol(r);const o=new Ee(r),s=new ke(e.polygonBarriers?.map(h=>{const n=oe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polygonBarriers,n})),a=new xe(e.polylineBarriers?.map(h=>{const n=ie.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polylineBarriers,n})),y=new _e(e.pointBarriers?.map(h=>{const n=re.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.pointBarriers,n})),u=e.routeResults[0].route?.toJSON(),d=we.fromJSON(u);d.symbol=this.defaultSymbols.routeInfo;const g=new Br(e.routeResults[0].directionPoints?.features.map(h=>{const n=ye.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionPoints,n}));return{directionLines:new br(e.routeResults[0].directionLines?.features.map(h=>{const n=pe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionLines,n})),directionPoints:g,pointBarriers:y,polygonBarriers:s,polylineBarriers:a,routeInfo:d,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",pe.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",ye.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,r,o,s,a,y){if(!e?.length)return null;const u=this.spatialReference.toJSON(),{fullExtent:d,maxScale:g,minScale:h}=this;return{featureSet:{features:e.toArray().map(n=>Sr(n)),geometryType:o,spatialReference:u},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:r!=null?r.toJSON():Pe(o)}},extent:d.toJSON(),fields:s,geometryType:o,hasM:!1,hasZ:!1,maxScale:g,minScale:h,name:a,objectIdField:"ObjectID",spatialReference:u,title:y,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",re.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",oe.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ie.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(this.routeInfo!=null?new L([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",we.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",se.fields,"Stops","Stops");if(e==null)return null;const{stops:r}=this.defaultSymbols,o=r?.first?.toJSON(),s=r?.middle?.toJSON(),a=r?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:s,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:a,label:"Last Stop"}]},e}};t([i({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],v.prototype,"_featureCollection",void 0),t([$(["web-map","portal-item"],"_featureCollection")],v.prototype,"writeFeatureCollectionWebmap",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],v.prototype,"_type",void 0),t([i({nonNullable:!0,type:ze})],v.prototype,"defaultSymbols",void 0),t([i({readOnly:!0})],v.prototype,"directionLines",void 0),t([N(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],v.prototype,"readDirectionLines",null),t([i({readOnly:!0})],v.prototype,"directionPoints",void 0),t([N(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],v.prototype,"readDirectionPoints",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],v.prototype,"featureCollectionType",void 0),t([i({readOnly:!0})],v.prototype,"fullExtent",null),t([i({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],v.prototype,"legendEnabled",void 0),t([i({type:["show","hide"]})],v.prototype,"listMode",void 0),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"maxScale",void 0),t([N(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],v.prototype,"readMaxScale",null),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"minScale",void 0),t([N(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],v.prototype,"readMinScale",null),t([i({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],v.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0,type:L.ofType(re)})],v.prototype,"pointBarriers",void 0),t([N(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],v.prototype,"readPointBarriers",null),t([i({nonNullable:!0,type:L.ofType(oe)})],v.prototype,"polygonBarriers",void 0),t([N(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolygonBarriers",null),t([i({nonNullable:!0,type:L.ofType(ie)})],v.prototype,"polylineBarriers",void 0),t([N(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolylineBarriers",null),t([i({readOnly:!0})],v.prototype,"routeInfo",void 0),t([N(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],v.prototype,"readRouteInfo",null),t([i({type:W})],v.prototype,"spatialReference",void 0),t([N(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],v.prototype,"readSpatialReference",null),t([i({nonNullable:!0,type:L.ofType(se)})],v.prototype,"stops",void 0),t([N(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],v.prototype,"readStops",null),t([i()],v.prototype,"title",null),t([i({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),t([i()],v.prototype,"url",null),v=t([O(He)],v);const Bo=v;export{Bo as default}; diff --git a/main/assets/RouteLayerView2D-Bpui7Ggx-CzB7Q2o2.js b/main/assets/RouteLayerView2D-Bpui7Ggx-CzB7Q2o2.js new file mode 100644 index 000000000..2628557fb --- /dev/null +++ b/main/assets/RouteLayerView2D-Bpui7Ggx-CzB7Q2o2.js @@ -0,0 +1 @@ +import{ag as m,aL as u,aq as h,a2 as g,ah as c,v as n,S as d,i as _}from"./main-C7yV2j71.js";import{f as w}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import{T as f,b as y,v as k,f as M,S as v,g as I,N as V}from"./Stop-he5xSAJJ-2gQ-bcQc.js";import{X as F,Y as G}from"./LayerView-Bish-E63-I2LV0oDm.js";import{d as H}from"./GraphicContainer-DuOHUciE-dHT2kH0f.js";import{X as b}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";const C=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],s={graphic:null,property:null,oldValue:null,newValue:null};function l(t){return t instanceof f||t instanceof y||t instanceof k||t instanceof M||t instanceof v||t instanceof I||t instanceof V}function U(t){return m.isCollection(t)&&t.length&&l(t.at(0))}function A(t){return Array.isArray(t)&&t.length>0&&l(t[0])}const T=new Set(["default"]);let p=class extends F(G){constructor(){super(...arguments),this._graphics=new m,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new w({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new m([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),u)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,i){return this._graphicsView.hitTest(t).filter(({popupTemplate:r})=>!!r)}highlight(t){let i;i=l(t)?[this._getNetworkFeatureUid(t)]:A(t)?t.map(e=>this._getNetworkFeatureUid(e)):U(t)?t.map(e=>this._getNetworkFeatureUid(e)).toArray():[t.uid];const r=i.filter(h);return r.length?(this._addHighlight(r),g(()=>this._removeHighlight(r))):g()}async hitTest(t,i){if(this.suspended)return null;const r=this._graphicsView.hitTest(t).filter(h).map(o=>this._networkGraphicMap.get(o));if(!r.length)return null;const{layer:e}=this;return r.reverse().map(o=>({type:"route",layer:e,mapPoint:t,networkFeature:o}))}isUpdating(){return this._graphicsView.updating}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_createGraphic(t){const i=t.toGraphic();return i.layer=this.layer,i.sourceLayer=this.layer,i}_createGraphicsView(){const t=this.view,i=()=>this.requestUpdate(),r=new H(t.featuresTilingScheme);this._graphicsView=new b({container:r,graphics:this._graphics,requestUpdateCallback:i,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const i=this._networkGraphicMap.get(t);return C.indexOf(i.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(i=>{const r=this._networkFeatureMap.get(i);return this._networkFeatureMap.delete(i),this._networkGraphicMap.delete(r),r}));for(const i of t.removed)this.removeHandles(i)}if(t.added.length){this._graphics.addMany(t.added.map(i=>{const r=this._createGraphic(i);return r.symbol==null?null:(this._networkFeatureMap.set(i,r),this._networkGraphicMap.set(r,i),r)}).filter(h));for(const i of t.added)this.addHandles([c(()=>i.geometry,(r,e)=>{this._updateGraphic(i,"geometry",r,e)}),c(()=>i.symbol,(r,e)=>{this._updateGraphic(i,"symbol",r,e)})],i);this._graphics.sort((i,r)=>this._getDrawOrder(i)-this._getDrawOrder(r))}}_updateGraphic(t,i,r,e){if(!this._networkFeatureMap.has(t)){const a=this._createGraphic(t);return this._networkFeatureMap.set(t,a),this._networkGraphicMap.set(a,t),void this._graphics.add(a)}const o=this._networkFeatureMap.get(t);o[i]=r,s.graphic=o,s.property=i,s.oldValue=e,s.newValue=r,this._graphicsView.graphicUpdateHandler(s)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),i=this._getHighlightBits(T);this._graphicsView.setHighlight(t.map(r=>({objectId:r,highlightFlags:i})))}};n([d()],p.prototype,"_graphics",void 0),n([d()],p.prototype,"_routeItems",null),p=n([_("esri.views.2d.layers.RouteLayerView2D")],p);const Ui=p;export{Ui as default}; diff --git a/main/assets/RouteLayerView2D-Bpui7Ggx-XzTkMJjI.js b/main/assets/RouteLayerView2D-Bpui7Ggx-XzTkMJjI.js deleted file mode 100644 index c36b38d35..000000000 --- a/main/assets/RouteLayerView2D-Bpui7Ggx-XzTkMJjI.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as m,aL as u,aq as h,a2 as g,ah as c,v as n,S as d,i as _}from"./main-BZaw9FpY.js";import{f as w}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import{T as f,b as y,v as k,f as M,S as v,g as I,N as V}from"./Stop-he5xSAJJ-B5QVbzdn.js";import{X as F,Y as G}from"./LayerView-Bish-E63-DRGspiuk.js";import{d as H}from"./GraphicContainer-DuOHUciE-BvzcbTDZ.js";import{X as b}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";const C=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],s={graphic:null,property:null,oldValue:null,newValue:null};function l(t){return t instanceof f||t instanceof y||t instanceof k||t instanceof M||t instanceof v||t instanceof I||t instanceof V}function U(t){return m.isCollection(t)&&t.length&&l(t.at(0))}function A(t){return Array.isArray(t)&&t.length>0&&l(t[0])}const T=new Set(["default"]);let p=class extends F(G){constructor(){super(...arguments),this._graphics=new m,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new w({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new m([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),u)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,i){return this._graphicsView.hitTest(t).filter(({popupTemplate:r})=>!!r)}highlight(t){let i;i=l(t)?[this._getNetworkFeatureUid(t)]:A(t)?t.map(e=>this._getNetworkFeatureUid(e)):U(t)?t.map(e=>this._getNetworkFeatureUid(e)).toArray():[t.uid];const r=i.filter(h);return r.length?(this._addHighlight(r),g(()=>this._removeHighlight(r))):g()}async hitTest(t,i){if(this.suspended)return null;const r=this._graphicsView.hitTest(t).filter(h).map(o=>this._networkGraphicMap.get(o));if(!r.length)return null;const{layer:e}=this;return r.reverse().map(o=>({type:"route",layer:e,mapPoint:t,networkFeature:o}))}isUpdating(){return this._graphicsView.updating}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_createGraphic(t){const i=t.toGraphic();return i.layer=this.layer,i.sourceLayer=this.layer,i}_createGraphicsView(){const t=this.view,i=()=>this.requestUpdate(),r=new H(t.featuresTilingScheme);this._graphicsView=new b({container:r,graphics:this._graphics,requestUpdateCallback:i,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const i=this._networkGraphicMap.get(t);return C.indexOf(i.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(i=>{const r=this._networkFeatureMap.get(i);return this._networkFeatureMap.delete(i),this._networkGraphicMap.delete(r),r}));for(const i of t.removed)this.removeHandles(i)}if(t.added.length){this._graphics.addMany(t.added.map(i=>{const r=this._createGraphic(i);return r.symbol==null?null:(this._networkFeatureMap.set(i,r),this._networkGraphicMap.set(r,i),r)}).filter(h));for(const i of t.added)this.addHandles([c(()=>i.geometry,(r,e)=>{this._updateGraphic(i,"geometry",r,e)}),c(()=>i.symbol,(r,e)=>{this._updateGraphic(i,"symbol",r,e)})],i);this._graphics.sort((i,r)=>this._getDrawOrder(i)-this._getDrawOrder(r))}}_updateGraphic(t,i,r,e){if(!this._networkFeatureMap.has(t)){const a=this._createGraphic(t);return this._networkFeatureMap.set(t,a),this._networkGraphicMap.set(a,t),void this._graphics.add(a)}const o=this._networkFeatureMap.get(t);o[i]=r,s.graphic=o,s.property=i,s.oldValue=e,s.newValue=r,this._graphicsView.graphicUpdateHandler(s)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),i=this._getHighlightBits(T);this._graphicsView.setHighlight(t.map(r=>({objectId:r,highlightFlags:i})))}};n([d()],p.prototype,"_graphics",void 0),n([d()],p.prototype,"_routeItems",null),p=n([_("esri.views.2d.layers.RouteLayerView2D")],p);const Ui=p;export{Ui as default}; diff --git a/main/assets/SDFHelper-B6k8Ig6R-C81pIMYz.js b/main/assets/SDFHelper-B6k8Ig6R-C81pIMYz.js new file mode 100644 index 000000000..697ed220f --- /dev/null +++ b/main/assets/SDFHelper-B6k8Ig6R-C81pIMYz.js @@ -0,0 +1 @@ +import{l as V}from"./floatRGBA-4pIJN00G-ClP9XgP7.js";import{fr as X}from"./main-C7yV2j71.js";import{o as U}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import{C as D,n as Y}from"./definitions-DJSdSb77-DkoRHaVx.js";const _=.45;function j(n,t=.5){switch(n.type){case"CIMPointSymbol":{const r=n.symbolLayers;if(!r||r.length!==1)return null;const o=r[0];return o.type!=="CIMVectorMarker"?null:j(o)}case"CIMVectorMarker":{const r=n.markerGraphics;if(!r||r.length!==1)return null;const o=r[0];if(!o)return null;const e=o.geometry;if(!e)return null;const i=o.symbol;return!i||i.type!=="CIMPolygonSymbol"&&i.type!=="CIMLineSymbol"||i.symbolLayers?.some(l=>!!l.effects)?null:{type:"sdf",geom:e,sdfPaddingRatio:t,asFill:i.type==="CIMPolygonSymbol"}}}}function q(n){return n?n.rings?n.rings:n.paths?n.paths:n.xmin!==void 0&&n.ymin!==void 0&&n.xmax!==void 0&&n.ymax!==void 0?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]:null:null}function B(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return new U(t,o,r-t,e-o)}function L(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return[t,o,r,e]}function E(n){return n?n.rings?L(n.rings):n.paths?L(n.paths):X(n)?[n.xmin,n.ymin,n.xmax,n.ymax]:null:null}function O(n,t){const[r,o,e,i]=E(n),l=e-r,a=i-o,m=D,c=Y,s=Math.floor(.5*(m*t-c)),f=(m-2*(s+c))/Math.max(l,a),d=Math.round(l*f),h=Math.round(a*f);return{pixelDimensions:[l,a],texelDimensions:[Math.round((d+2*s)/f),Math.round((h+2*s)/f)]}}function Q(n,t,r,o,e,i,l){const[a,m,c,s]=n;if(c_&&b<1&&(u=Math.min(b+.1,.99))}const x=D,M=Y,p=Math.floor(.5*(x*u-M)),g=(x-2*(p+M))/h,I=Math.round(f*g)+2*p,w=Math.round(d*g)+2*p;let y=1;t&&(y=w*(1-u)/((t.ymax-t.ymin)*g));let P=0,R=0,C=1;o&&(e?t&&r&&t.ymax-t.ymin>0&&(C=(t.xmax-t.xmin)/(t.ymax-t.ymin),P=o.x/(r*C),R=o.y/r):(P=o.x,R=o.y)),t&&(P=.5*(t.xmax+t.xmin)+P*(t.xmax-t.xmin),R=.5*(t.ymax+t.ymin)+R*(t.ymax-t.ymin)),P-=a,R-=m,P*=g,R*=g,P+=p,R+=p;let S=P/I-.5,v=R/w-.5;return e&&r&&(S*=r*C,v*=r),{frameSizeRatio:y,anchorX:S,anchorY:v,widthRatio:C,sdfPaddingRatio:u}}function T(n){const t=q(n.geom),r=B(t),o=D,e=Y,i=Math.floor(.5*(o*n.sdfPaddingRatio-e)),l=o-2*(i+e),a=l/Math.max(r.width,r.height),m=Math.round(r.width*a)+2*i,c=Math.round(r.height*a)+2*i,s=[];for(const d of t)if(d&&d.length>1){const h=[];for(const u of d){let[x,M]=u;x-=r.x,M-=r.y,x*=a,M*=a,x+=i-.5,M+=i-.5,n.asFill?h.push([x,M]):h.push([Math.round(x),Math.round(M)])}if(n.asFill){const u=h.length-1;h[0][0]===h[u][0]&&h[0][1]===h[u][1]||h.push(h[0])}s.push(h)}const f=G(s,m,c,i);return n.asFill&&H(s,m,c,i,f),{data:K(f,i),width:m,height:c,sdfPaddingRatio:n.sdfPaddingRatio,sdfDecodeCoeff:2*i/l}}function G(n,t,r,o){const e=t*r,i=new Array(e),l=o*o+1;for(let a=0;at&&(p=t),g<0&&(g=0),I>r&&(I=r);const w=f[0]-s[0],y=f[1]-s[1],P=w*w+y*y;for(let R=M;RP?(b=f[0],F=f[1]):(z/=P,b=s[0]+z*w,F=s[1]+z*y);const k=(S-b)*(S-b)+(v-F)*(v-F),A=(r-C-1)*t+R;kt-o&&(x=t-o),Mr-o&&(p=r-o);for(let g=M;gg==c[1]>g)continue;const I=g+.5,w=(r-g-1)*t;for(let y=u;y!!l.effects)?null:{type:"sdf",geom:e,sdfPaddingRatio:t,asFill:i.type==="CIMPolygonSymbol"}}}}function q(n){return n?n.rings?n.rings:n.paths?n.paths:n.xmin!==void 0&&n.ymin!==void 0&&n.xmax!==void 0&&n.ymax!==void 0?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]:null:null}function B(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return new U(t,o,r-t,e-o)}function L(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return[t,o,r,e]}function E(n){return n?n.rings?L(n.rings):n.paths?L(n.paths):X(n)?[n.xmin,n.ymin,n.xmax,n.ymax]:null:null}function O(n,t){const[r,o,e,i]=E(n),l=e-r,a=i-o,m=D,c=Y,s=Math.floor(.5*(m*t-c)),f=(m-2*(s+c))/Math.max(l,a),d=Math.round(l*f),h=Math.round(a*f);return{pixelDimensions:[l,a],texelDimensions:[Math.round((d+2*s)/f),Math.round((h+2*s)/f)]}}function Q(n,t,r,o,e,i,l){const[a,m,c,s]=n;if(c_&&b<1&&(u=Math.min(b+.1,.99))}const x=D,M=Y,p=Math.floor(.5*(x*u-M)),g=(x-2*(p+M))/h,I=Math.round(f*g)+2*p,w=Math.round(d*g)+2*p;let y=1;t&&(y=w*(1-u)/((t.ymax-t.ymin)*g));let P=0,R=0,C=1;o&&(e?t&&r&&t.ymax-t.ymin>0&&(C=(t.xmax-t.xmin)/(t.ymax-t.ymin),P=o.x/(r*C),R=o.y/r):(P=o.x,R=o.y)),t&&(P=.5*(t.xmax+t.xmin)+P*(t.xmax-t.xmin),R=.5*(t.ymax+t.ymin)+R*(t.ymax-t.ymin)),P-=a,R-=m,P*=g,R*=g,P+=p,R+=p;let S=P/I-.5,v=R/w-.5;return e&&r&&(S*=r*C,v*=r),{frameSizeRatio:y,anchorX:S,anchorY:v,widthRatio:C,sdfPaddingRatio:u}}function T(n){const t=q(n.geom),r=B(t),o=D,e=Y,i=Math.floor(.5*(o*n.sdfPaddingRatio-e)),l=o-2*(i+e),a=l/Math.max(r.width,r.height),m=Math.round(r.width*a)+2*i,c=Math.round(r.height*a)+2*i,s=[];for(const d of t)if(d&&d.length>1){const h=[];for(const u of d){let[x,M]=u;x-=r.x,M-=r.y,x*=a,M*=a,x+=i-.5,M+=i-.5,n.asFill?h.push([x,M]):h.push([Math.round(x),Math.round(M)])}if(n.asFill){const u=h.length-1;h[0][0]===h[u][0]&&h[0][1]===h[u][1]||h.push(h[0])}s.push(h)}const f=G(s,m,c,i);return n.asFill&&H(s,m,c,i,f),{data:K(f,i),width:m,height:c,sdfPaddingRatio:n.sdfPaddingRatio,sdfDecodeCoeff:2*i/l}}function G(n,t,r,o){const e=t*r,i=new Array(e),l=o*o+1;for(let a=0;at&&(p=t),g<0&&(g=0),I>r&&(I=r);const w=f[0]-s[0],y=f[1]-s[1],P=w*w+y*y;for(let R=M;RP?(b=f[0],F=f[1]):(z/=P,b=s[0]+z*w,F=s[1]+z*y);const k=(S-b)*(S-b)+(v-F)*(v-F),A=(r-C-1)*t+R;kt-o&&(x=t-o),Mr-o&&(p=r-o);for(let g=M;gg==c[1]>g)continue;const I=g+.5,w=(r-g-1)*t;for(let y=u;y{let e=class extends a{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const c={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&m(c,t.effectiveScaleRange);const l=this._get("effectiveScaleRange");return l&&l.minScale===c.minScale&&l.maxScale===c.maxScale?l:c}};return n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),n([i({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=n([S("esri.layers.mixins.ScaleRangeLayer")],e),e};function m(a,e){return a.minScale=a.minScale>0?e.minScale>0?Math.min(a.minScale,e.minScale):a.minScale:e.minScale,a.maxScale=a.maxScale>0?e.maxScale>0?Math.max(a.maxScale,e.maxScale):a.maxScale:e.maxScale,a}export{s as S}; diff --git a/main/assets/ScaleRangeLayer-Bz0DcnvM-s-boYtri.js b/main/assets/ScaleRangeLayer-Bz0DcnvM-s-boYtri.js new file mode 100644 index 000000000..fa9a0da16 --- /dev/null +++ b/main/assets/ScaleRangeLayer-Bz0DcnvM-s-boYtri.js @@ -0,0 +1 @@ +import{v as n,S as i,i as S}from"./main-C7yV2j71.js";const s=a=>{let e=class extends a{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const c={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&m(c,t.effectiveScaleRange);const l=this._get("effectiveScaleRange");return l&&l.minScale===c.minScale&&l.maxScale===c.maxScale?l:c}};return n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),n([i({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=n([S("esri.layers.mixins.ScaleRangeLayer")],e),e};function m(a,e){return a.minScale=a.minScale>0?e.minScale>0?Math.min(a.minScale,e.minScale):a.minScale:e.minScale,a.maxScale=a.maxScale>0?e.maxScale>0?Math.max(a.maxScale,e.maxScale):a.maxScale:e.maxScale,a}export{s as S}; diff --git a/main/assets/SceneLayer-DOh9PmQy-BaxV7T2s.js b/main/assets/SceneLayer-DOh9PmQy-BaxV7T2s.js deleted file mode 100644 index cecce72de..000000000 --- a/main/assets/SceneLayer-DOh9PmQy-BaxV7T2s.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-Bz3XNCt8.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{v as i,S as s,i as b,bA as te,ag as $,l as A,b0 as q,a0 as v,aa as re,aA as ie,bT as C,a1 as f,W as se,o as d,j3 as oe,bi as ae,_ as M,w as ne,bU as N,bP as P,aU as le,aw as pe,bC as de,bL as ue,e as U,ai as ye,av as ce,a4 as me,f as Y,P as he,bX as fe,em as G}from"./main-BZaw9FpY.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{u as ge}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as ve}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{F as we}from"./Mesh-DLzjDUIO-L2WFr_jE.js";import{D as be}from"./Layer-ChoECxvZ-C4wLrCej.js";import{b as Ie,v as Le,g as Fe}from"./meshSpatialReferenceScaleUtils-B1zR72Os-DiWGnc4E.js";import{n as Se}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as _e}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{i as Te}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{C as Ee}from"./EditBusLayer-Df29OyJh-C36maE2j.js";import{E as Oe}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as xe}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{W as Ae,f as V}from"./SceneService-BZqGtWmG-B8Xgkv2e.js";import{m as Pe}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{w as k,r as Re}from"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import{k as Q}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{L as z}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{b as De}from"./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js";import{t as $e}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{$ as Ue,Y as qe,_ as Ce,X as Ne,V as Ge}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{l as Ve,A as ke}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{e as Qe,c as ze}from"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import{f as We}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{o as Je}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{y as Z,o as Ke,d as He,m as Me}from"./I3SLayerDefinitions-CwLXCKtU-DIMh5lHL.js";import{w as Ye,F as Ze}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{C as Be,q as W}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{v as Xe}from"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import{p as et}from"./fetchService-DbaKmJhP-CtznRt8p.js";import{C as tt}from"./persistable-C6RBwzJi-B2W1QdS_.js";import{J as rt,a as it}from"./projection-BA9M1R7d-DoNqITCd.js";import{g as st}from"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import{b as ot}from"./Query-BrwMGK8U-sojFdYaD.js";import{k as J,z as at,j as nt}from"./elevationInfoUtils-mOZsPH2J-CGmjotSk.js";import{w as lt}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{_ as pt}from"./I3SUtil-Bq8KpP2j-B88-rKNw.js";import{h as dt,m as ut}from"./popupUtils-nV1O8RUO-xbvi-u4x.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./MeshTransform-C--IG09w-B7P01ZzU.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Bk09s2KF.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./MeshVertexAttributes-CbNpPur2-BzFN0z5X.js";import"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import"./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Cw8IJeSy.js";import"./plane-Dt8R0KeE-fuXvBrPY.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-cAmFzdIS.js";import"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import"./vec3-BazNroeq-CFXHYIOm.js";import"./BufferView-PQoE3GL7-DXIpDOUe.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-maVOs7I3.js";import"./External-D_wl4XAw-MFWeclAP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./jsonContext-BA8GHqVk-BMETb6sX.js";import"./resourceUtils-BmW6QqlX-Cs99W_og.js";import"./resourceUtils-rTM6Iemx-C_sFWCPe.js";import"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-X6Zoj5Td.js";import"./projectVectorToVector-sIYLNlex-CXXu_lyF.js";import"./sphere-BenPORjV-CgNvGf8s.js";import"./I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./NormalAttribute.glsl-axtNsUxo-corrAl_5.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-CdJ2bdTT.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function B({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,a=e?.serverGens,n=r!=null,l=t!=null,p=n&&l&&t.lastUpdate!==r.getTime();return n&&(p||!l&&a?.minServerGen!==a?.serverGen)}const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const r=this.associatedLayer?.timeInfo;if(r==null)return null;const a=r.clone();return G(a,this.fieldsIndex),a}set timeInfo(r){G(r,this.fieldsIndex),this._override("timeInfo",r)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(r){this._override("timeExtent",r)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(r){this._override("timeOffset",r)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(r){this._override("datesInUnknownTimezone",r)}async loadTimeInfoFromService(r){const{serviceTimeInfo:a}=this;if(a==null)return;const{startTimeField:n,endTimeField:l}=a;if(n==null&&l==null||B({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const p=async y=>{let m=null;try{m=(await this.fetchStatistics?.(y,r))?.stats}catch{}if(m==null)return null;const{minTimeStr:I,min:E,maxTimeStr:O,max:x}=m,F=y===n?I??E:O??x;return F!=null?new Date(F):null},[u,c]=await Promise.all([p(n),p(l)]);if(n!=null&&u==null||l!=null&&c==null)return;const h=new Q({start:u,end:c});this.setAtOrigin("timeInfo",new k({endField:l,startField:n,fullTimeExtent:h}),"service")}};return i([s({type:k,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),i([s({type:Q,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),i([s({type:Re,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),i([s({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),i([s({type:L,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=i([b("esri.layers.mixins.TemporalSceneLayer")],t),t};let L=class extends U{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};i([s({type:String})],L.prototype,"endTimeField",void 0),i([s({type:String})],L.prototype,"startTimeField",void 0),L=i([b("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],L);let g=class extends U{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"name",void 0),i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"field",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"currentRangeExtent",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"fullRangeExtent",void 0),i([s({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=i([b("esri.layers.support.RangeInfo")],g);var _;let R=_=class extends te($.ofType(A)){constructor(e){super(e)}clone(){return new _(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map(r=>{if(!t.equals(r.spatialReference)){if(!rt(r.spatialReference,t))return e?.messages?.push(new q("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const n=new A;it(r,n,t),r=n}const a=r.toJSON(e);return delete a.spatialReference,a}).filter(r=>r!=null):(e?.messages?.push(new q("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(r=>r.toJSON(e)))}static fromJSON(e,t){const r=new _;return e.forEach(a=>r.add(A.fromJSON(a,t))),r}};R=_=i([b("esri.layers.support.PolygonCollection")],R);const T=R;var D;let w=D=class extends U{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new T,this._geometriesSource=null}initialize(){this.addHandles(ye(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,ce))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=T.fromJSON(e,r):this._geometriesSource={url:me(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:a}=this._geometriesSource,n=await Y(r,{responseType:"json",signal:t?.signal}),l=e.toJSON(),p=n.data.map(u=>({...u,spatialReference:l}));this.geometries=T.fromJSON(p,a),this._geometriesSource=null}clone(){const e=new D({geometries:he(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};i([s({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],w.prototype,"spatialRelationship",void 0),i([s({type:T,nonNullable:!0,json:{write:!0}}),tt({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],w.prototype,"geometries",void 0),i([v(["web-scene","portal-item"],"geometries")],w.prototype,"readGeometries",null),w=D=i([b("esri.layers.support.SceneFilter")],w);const ct=w;async function mt({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:a,path:n,customParameters:l,apiKey:p,signal:u}){if(t==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const c=a.get(e);if(c==null)throw new d(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const h=t.find(I=>I.name===c.name);if(h==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const y=fe(n,h.href),{data:m}=await Y(y,{query:{f:"json",...l,token:p},responseType:"json",signal:u});return m}async function ht(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(ft(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function ft(e){const{BlobReader:t,ZipReader:r,BlobWriter:a}=await M(()=>import("./zipjs-wrapper-DlcHxyCX-BFxi6l53.js"),[],import.meta.url),n=[];return(await new r(new t(e)).getEntries()).forEach(l=>{if(l.directory||/^__MACOS/i.test(l.filename))return;const p=new a,u=l.getData?.(p).then(c=>new File([c],l.filename));u&&n.push(u)}),Promise.all(n)}const gt=new Set(["3DObject","Point"]),K=We();let o=class extends yt(Ee(Ae(_e(Oe(xe(je(ve(Te(Se(re(be))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new $,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=ie(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&r.type!=="inherited"?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new Je(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Ve(this.associatedLayer)}get geometryType(){return vt[this.profile]||"mesh"}set renderer(e){C(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=e??$e;const{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsRollbackOnFailure:n,supportsUploadWithItemId:l,supportsGeometryUpdate:p,supportsReturnServiceEditsInSourceSpatialReference:u},data:{supportsZ:c,supportsM:h,isVersioned:y,supportsAttachment:m},operations:{supportsEditing:I,supportsAdd:E,supportsUpdate:O,supportsDelete:x,supportsQuery:F,supportsQueryAttachments:X,supportsAsyncConvert3D:ee}}=e,S=e.operations.supportsChangeTracking,j=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsReturnServiceEditsInSourceSpatialReference:u,supportsRollbackOnFailure:n,supportsGeometryUpdate:j&&p,supportsUploadWithItemId:l},data:{supportsAttachment:m,supportsZ:c,supportsM:h,isVersioned:y},operations:{supportsQuery:F,supportsQueryAttachments:X,supportsEditing:I&&S,supportsAdd:j&&E&&S,supportsDelete:j&&x&&S,supportsUpdate:O&&S,supportsAsyncConvert3D:ee}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return r!=null&&H[r]?H[r]:(f.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(se),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await st(this,{origin:"service"},t),C(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){f.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ot;return this.geometryType==="mesh"?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r?.features)for(const a of r.features)a.layer=this,a.sourceLayer=this;return r})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=oe(this.fieldsIndex,await dt(this,ut(this)));return pt(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new ae;return a.attributes=r[0],a.layer=this,a.sourceLayer=this,a}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(f.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return lt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(V.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(V.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await M(()=>import("./editingSupport-gUqP9iyf-Bz3XNCt8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);let a=t;await this.load();const n=this.associatedLayer;if(!n)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:l}=n,p=!!n.infoFor3D,u=a?.globalIdUsed??!0;if(p&&l==null)throw new d(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(p&&!u)throw new d(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return z(n.url)&&p&&e.deleteFeatures!=null&&l!=null&&(a={...a,globalIdToObjectId:await ke(n,e.deleteFeatures,l)}),r(this,n.source,e,a)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=y=>{throw f.getLogger(this).error(".convertMesh()",y.message),y};await this.load(),this.infoFor3D||r(new d("invalid:layer","SceneLayer has no capability for mesh conversion"));const a=await this.extractAndFilterFiles(e),n=a.reduce((y,m)=>Ye(this.infoFor3D,m)?y+1:y,0);n===0&&r(new Ie),n>1&&r(new Le);const l=this.spatialReference,p=t.location??new ne({x:0,y:0,z:0,spatialReference:l}),u=p.spatialReference.isGeographic?"local":"georeferenced",c=we.createWithExternalSource(p,a,{vertexSpace:u,transform:Fe(p.spatialReference),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!t.location});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await ht(e)).filter(r=>Ze(t,r)):e}validateLayer(e){if(e.layerType&&!gt.has(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(r,a){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=a&&a.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(n=>n.name===e.name),r=!!this.associatedLayer?.fields?.some(n=>n&&e.name===n.name),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=N(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?f.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):f.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&J(f.getLogger(this),at("Mesh scene layers","relative-to-scene",e)),J(f.getLogger(this),nt("Scene layers",e))}async fetchStatistics(e,t){return await mt({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};i([s({types:{key:"type",base:Qe,typeMap:{selection:ze}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],o.prototype,"featureReduction",void 0),i([s({type:[g],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],o.prototype,"rangeInfos",void 0),i([s({json:{read:!1}})],o.prototype,"associatedLayer",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["ArcGISSceneServiceLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({...K.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"fields",void 0),i([s()],o.prototype,"types",null),i([s()],o.prototype,"typeIdField",null),i([s()],o.prototype,"templates",null),i([s()],o.prototype,"formTemplate",null),i([s()],o.prototype,"attributeTableTemplate",null),i([s({readOnly:!0,clonable:!1})],o.prototype,"fieldsIndex",null),i([s({type:Xe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],o.prototype,"floorInfo",void 0),i([s(K.outFields)],o.prototype,"outFields",void 0),i([s({type:Z,readOnly:!0,json:{read:!1}})],o.prototype,"nodePages",void 0),i([v("service","nodePages",["nodePages","pointNodePages"])],o.prototype,"readNodePages",null),i([s({type:[Ke],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[He],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[Me],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),i([s({readOnly:!0})],o.prototype,"statisticsInfo",void 0),i([s({type:$.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],o.prototype,"excludeObjectIds",void 0),i([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([s({type:ct,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],o.prototype,"filter",void 0),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),i([s(Ue)],o.prototype,"elevationInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"effectiveCapabilities",null),i([s({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),i([s({type:String})],o.prototype,"geometryType",null),i([s(qe)],o.prototype,"labelsVisible",void 0),i([s({type:[Be],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:W},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:W},write:!0}})],o.prototype,"labelingInfo",void 0),i([s(Ce)],o.prototype,"legendEnabled",void 0),i([s({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if(typeof e=="number"&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return r!==void 0?de(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],o.prototype,"opacity",void 0),i([s({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"priority",void 0),i([s({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"semantic",void 0),i([s({types:ge,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],o.prototype,"renderer",null),i([s({json:{read:!1}})],o.prototype,"cachedDrawingInfo",void 0),i([v("service","cachedDrawingInfo")],o.prototype,"readCachedDrawingInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),i([s({type:Boolean,json:{read:!1}})],o.prototype,"editingEnabled",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"infoFor3D",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"relationships",null),i([s(Ne)],o.prototype,"popupEnabled",void 0),i([s({type:ue,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),i([s({type:String,json:{read:!1}})],o.prototype,"objectIdField",void 0),i([v("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdField",null),i([s({type:String,json:{read:!1}})],o.prototype,"globalIdField",void 0),i([v("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdField",null),i([s({readOnly:!0,type:String,json:{read:!1}})],o.prototype,"displayField",null),i([s({type:String,json:{read:!1}})],o.prototype,"profile",void 0),i([v("service","profile",["store.profile"])],o.prototype,"readProfile",null),i([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],o.prototype,"normalReferenceFrame",void 0),i([s(Ge)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([s({json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),i([s(Pe)],o.prototype,"useViewTime",null),o=i([b("esri.layers.SceneLayer")],o);const H={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},vt={"mesh-pyramids":"mesh",points:"point"},Si=o;export{Si as default}; diff --git a/main/assets/SceneLayer-DOh9PmQy-Dj9ChnIg.js b/main/assets/SceneLayer-DOh9PmQy-Dj9ChnIg.js new file mode 100644 index 000000000..ead2cf3f6 --- /dev/null +++ b/main/assets/SceneLayer-DOh9PmQy-Dj9ChnIg.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-3W9GNLNT.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{v as i,S as s,i as b,bA as te,ag as $,l as A,b0 as q,a0 as v,aa as re,aA as ie,bT as C,a1 as f,W as se,o as d,j3 as oe,bi as ae,_ as M,w as ne,bU as N,bP as P,aU as le,aw as pe,bC as de,bL as ue,e as U,ai as ye,av as ce,a4 as me,f as Y,P as he,bX as fe,em as G}from"./main-C7yV2j71.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{u as ge}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{m as ve}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{F as we}from"./Mesh-DLzjDUIO-B17ONcIN.js";import{D as be}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{b as Ie,v as Le,g as Fe}from"./meshSpatialReferenceScaleUtils-B1zR72Os-BsiWm3Am.js";import{n as Se}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as _e}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{i as Te}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{C as Ee}from"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import{E as Oe}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as xe}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{W as Ae,f as V}from"./SceneService-BZqGtWmG-B9O0VJ5b.js";import{m as Pe}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{w as k,r as Re}from"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import{k as Q}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{L as z}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{b as De}from"./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js";import{t as $e}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{$ as Ue,Y as qe,_ as Ce,X as Ne,V as Ge}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{l as Ve,A as ke}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{e as Qe,c as ze}from"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import{f as We}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{o as Je}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{y as Z,o as Ke,d as He,m as Me}from"./I3SLayerDefinitions-CwLXCKtU-DliEVqX4.js";import{w as Ye,F as Ze}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{C as Be,q as W}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{v as Xe}from"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import{p as et}from"./fetchService-DbaKmJhP-DPDp5i2e.js";import{C as tt}from"./persistable-C6RBwzJi-DoQq7vOT.js";import{J as rt,a as it}from"./projection-BA9M1R7d-DXrPfsKU.js";import{g as st}from"./styleUtils-ChrJTYIw-OCRItq_6.js";import{b as ot}from"./Query-BrwMGK8U-DV_czrJX.js";import{k as J,z as at,j as nt}from"./elevationInfoUtils-mOZsPH2J-Bwot-813.js";import{w as lt}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{_ as pt}from"./I3SUtil-Bq8KpP2j-DfTxNx-1.js";import{h as dt,m as ut}from"./popupUtils-nV1O8RUO-X6GWMgRY.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./MeshTransform-C--IG09w-QYZk68_K.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Dbd8ftOx.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js";import"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Cd6y9wum.js";import"./plane-Dt8R0KeE-CdQQbSdq.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-eujRBTUy.js";import"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import"./vec3-BazNroeq-Cdhfm-VN.js";import"./BufferView-PQoE3GL7-M6q1od-Y.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-DGtcegeJ.js";import"./External-D_wl4XAw-Bzqlxz38.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./jsonContext-BA8GHqVk-DpBf0bCt.js";import"./resourceUtils-BmW6QqlX-CP-OW4gT.js";import"./resourceUtils-rTM6Iemx-Bu5Czfos.js";import"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-BFbGjGZW.js";import"./projectVectorToVector-sIYLNlex-B5U5xz17.js";import"./sphere-BenPORjV-CiIWUavi.js";import"./I3SBinaryReader-DEbI3cKZ-D9EuM1ww.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BA8RF5F7.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function B({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,a=e?.serverGens,n=r!=null,l=t!=null,p=n&&l&&t.lastUpdate!==r.getTime();return n&&(p||!l&&a?.minServerGen!==a?.serverGen)}const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const r=this.associatedLayer?.timeInfo;if(r==null)return null;const a=r.clone();return G(a,this.fieldsIndex),a}set timeInfo(r){G(r,this.fieldsIndex),this._override("timeInfo",r)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(r){this._override("timeExtent",r)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(r){this._override("timeOffset",r)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(r){this._override("datesInUnknownTimezone",r)}async loadTimeInfoFromService(r){const{serviceTimeInfo:a}=this;if(a==null)return;const{startTimeField:n,endTimeField:l}=a;if(n==null&&l==null||B({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const p=async y=>{let m=null;try{m=(await this.fetchStatistics?.(y,r))?.stats}catch{}if(m==null)return null;const{minTimeStr:I,min:E,maxTimeStr:O,max:x}=m,F=y===n?I??E:O??x;return F!=null?new Date(F):null},[u,c]=await Promise.all([p(n),p(l)]);if(n!=null&&u==null||l!=null&&c==null)return;const h=new Q({start:u,end:c});this.setAtOrigin("timeInfo",new k({endField:l,startField:n,fullTimeExtent:h}),"service")}};return i([s({type:k,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),i([s({type:Q,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),i([s({type:Re,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),i([s({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),i([s({type:L,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=i([b("esri.layers.mixins.TemporalSceneLayer")],t),t};let L=class extends U{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};i([s({type:String})],L.prototype,"endTimeField",void 0),i([s({type:String})],L.prototype,"startTimeField",void 0),L=i([b("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],L);let g=class extends U{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"name",void 0),i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"field",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"currentRangeExtent",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"fullRangeExtent",void 0),i([s({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=i([b("esri.layers.support.RangeInfo")],g);var _;let R=_=class extends te($.ofType(A)){constructor(e){super(e)}clone(){return new _(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map(r=>{if(!t.equals(r.spatialReference)){if(!rt(r.spatialReference,t))return e?.messages?.push(new q("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const n=new A;it(r,n,t),r=n}const a=r.toJSON(e);return delete a.spatialReference,a}).filter(r=>r!=null):(e?.messages?.push(new q("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(r=>r.toJSON(e)))}static fromJSON(e,t){const r=new _;return e.forEach(a=>r.add(A.fromJSON(a,t))),r}};R=_=i([b("esri.layers.support.PolygonCollection")],R);const T=R;var D;let w=D=class extends U{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new T,this._geometriesSource=null}initialize(){this.addHandles(ye(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,ce))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=T.fromJSON(e,r):this._geometriesSource={url:me(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:a}=this._geometriesSource,n=await Y(r,{responseType:"json",signal:t?.signal}),l=e.toJSON(),p=n.data.map(u=>({...u,spatialReference:l}));this.geometries=T.fromJSON(p,a),this._geometriesSource=null}clone(){const e=new D({geometries:he(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};i([s({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],w.prototype,"spatialRelationship",void 0),i([s({type:T,nonNullable:!0,json:{write:!0}}),tt({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],w.prototype,"geometries",void 0),i([v(["web-scene","portal-item"],"geometries")],w.prototype,"readGeometries",null),w=D=i([b("esri.layers.support.SceneFilter")],w);const ct=w;async function mt({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:a,path:n,customParameters:l,apiKey:p,signal:u}){if(t==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const c=a.get(e);if(c==null)throw new d(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const h=t.find(I=>I.name===c.name);if(h==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const y=fe(n,h.href),{data:m}=await Y(y,{query:{f:"json",...l,token:p},responseType:"json",signal:u});return m}async function ht(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(ft(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function ft(e){const{BlobReader:t,ZipReader:r,BlobWriter:a}=await M(()=>import("./zipjs-wrapper-DlcHxyCX-BFxi6l53.js"),[],import.meta.url),n=[];return(await new r(new t(e)).getEntries()).forEach(l=>{if(l.directory||/^__MACOS/i.test(l.filename))return;const p=new a,u=l.getData?.(p).then(c=>new File([c],l.filename));u&&n.push(u)}),Promise.all(n)}const gt=new Set(["3DObject","Point"]),K=We();let o=class extends yt(Ee(Ae(_e(Oe(xe(je(ve(Te(Se(re(be))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new $,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=ie(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&r.type!=="inherited"?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new Je(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Ve(this.associatedLayer)}get geometryType(){return vt[this.profile]||"mesh"}set renderer(e){C(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=e??$e;const{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsRollbackOnFailure:n,supportsUploadWithItemId:l,supportsGeometryUpdate:p,supportsReturnServiceEditsInSourceSpatialReference:u},data:{supportsZ:c,supportsM:h,isVersioned:y,supportsAttachment:m},operations:{supportsEditing:I,supportsAdd:E,supportsUpdate:O,supportsDelete:x,supportsQuery:F,supportsQueryAttachments:X,supportsAsyncConvert3D:ee}}=e,S=e.operations.supportsChangeTracking,j=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsReturnServiceEditsInSourceSpatialReference:u,supportsRollbackOnFailure:n,supportsGeometryUpdate:j&&p,supportsUploadWithItemId:l},data:{supportsAttachment:m,supportsZ:c,supportsM:h,isVersioned:y},operations:{supportsQuery:F,supportsQueryAttachments:X,supportsEditing:I&&S,supportsAdd:j&&E&&S,supportsDelete:j&&x&&S,supportsUpdate:O&&S,supportsAsyncConvert3D:ee}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return r!=null&&H[r]?H[r]:(f.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(se),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await st(this,{origin:"service"},t),C(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){f.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ot;return this.geometryType==="mesh"?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r?.features)for(const a of r.features)a.layer=this,a.sourceLayer=this;return r})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=oe(this.fieldsIndex,await dt(this,ut(this)));return pt(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new ae;return a.attributes=r[0],a.layer=this,a.sourceLayer=this,a}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(f.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return lt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(V.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(V.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await M(()=>import("./editingSupport-gUqP9iyf-3W9GNLNT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);let a=t;await this.load();const n=this.associatedLayer;if(!n)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:l}=n,p=!!n.infoFor3D,u=a?.globalIdUsed??!0;if(p&&l==null)throw new d(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(p&&!u)throw new d(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return z(n.url)&&p&&e.deleteFeatures!=null&&l!=null&&(a={...a,globalIdToObjectId:await ke(n,e.deleteFeatures,l)}),r(this,n.source,e,a)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=y=>{throw f.getLogger(this).error(".convertMesh()",y.message),y};await this.load(),this.infoFor3D||r(new d("invalid:layer","SceneLayer has no capability for mesh conversion"));const a=await this.extractAndFilterFiles(e),n=a.reduce((y,m)=>Ye(this.infoFor3D,m)?y+1:y,0);n===0&&r(new Ie),n>1&&r(new Le);const l=this.spatialReference,p=t.location??new ne({x:0,y:0,z:0,spatialReference:l}),u=p.spatialReference.isGeographic?"local":"georeferenced",c=we.createWithExternalSource(p,a,{vertexSpace:u,transform:Fe(p.spatialReference),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!t.location});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await ht(e)).filter(r=>Ze(t,r)):e}validateLayer(e){if(e.layerType&&!gt.has(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(r,a){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=a&&a.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(n=>n.name===e.name),r=!!this.associatedLayer?.fields?.some(n=>n&&e.name===n.name),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=N(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?f.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):f.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&J(f.getLogger(this),at("Mesh scene layers","relative-to-scene",e)),J(f.getLogger(this),nt("Scene layers",e))}async fetchStatistics(e,t){return await mt({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};i([s({types:{key:"type",base:Qe,typeMap:{selection:ze}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],o.prototype,"featureReduction",void 0),i([s({type:[g],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],o.prototype,"rangeInfos",void 0),i([s({json:{read:!1}})],o.prototype,"associatedLayer",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["ArcGISSceneServiceLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({...K.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"fields",void 0),i([s()],o.prototype,"types",null),i([s()],o.prototype,"typeIdField",null),i([s()],o.prototype,"templates",null),i([s()],o.prototype,"formTemplate",null),i([s()],o.prototype,"attributeTableTemplate",null),i([s({readOnly:!0,clonable:!1})],o.prototype,"fieldsIndex",null),i([s({type:Xe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],o.prototype,"floorInfo",void 0),i([s(K.outFields)],o.prototype,"outFields",void 0),i([s({type:Z,readOnly:!0,json:{read:!1}})],o.prototype,"nodePages",void 0),i([v("service","nodePages",["nodePages","pointNodePages"])],o.prototype,"readNodePages",null),i([s({type:[Ke],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[He],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[Me],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),i([s({readOnly:!0})],o.prototype,"statisticsInfo",void 0),i([s({type:$.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],o.prototype,"excludeObjectIds",void 0),i([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([s({type:ct,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],o.prototype,"filter",void 0),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),i([s(Ue)],o.prototype,"elevationInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"effectiveCapabilities",null),i([s({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),i([s({type:String})],o.prototype,"geometryType",null),i([s(qe)],o.prototype,"labelsVisible",void 0),i([s({type:[Be],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:W},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:W},write:!0}})],o.prototype,"labelingInfo",void 0),i([s(Ce)],o.prototype,"legendEnabled",void 0),i([s({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if(typeof e=="number"&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return r!==void 0?de(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],o.prototype,"opacity",void 0),i([s({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"priority",void 0),i([s({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"semantic",void 0),i([s({types:ge,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],o.prototype,"renderer",null),i([s({json:{read:!1}})],o.prototype,"cachedDrawingInfo",void 0),i([v("service","cachedDrawingInfo")],o.prototype,"readCachedDrawingInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),i([s({type:Boolean,json:{read:!1}})],o.prototype,"editingEnabled",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"infoFor3D",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"relationships",null),i([s(Ne)],o.prototype,"popupEnabled",void 0),i([s({type:ue,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),i([s({type:String,json:{read:!1}})],o.prototype,"objectIdField",void 0),i([v("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdField",null),i([s({type:String,json:{read:!1}})],o.prototype,"globalIdField",void 0),i([v("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdField",null),i([s({readOnly:!0,type:String,json:{read:!1}})],o.prototype,"displayField",null),i([s({type:String,json:{read:!1}})],o.prototype,"profile",void 0),i([v("service","profile",["store.profile"])],o.prototype,"readProfile",null),i([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],o.prototype,"normalReferenceFrame",void 0),i([s(Ge)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([s({json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),i([s(Pe)],o.prototype,"useViewTime",null),o=i([b("esri.layers.SceneLayer")],o);const H={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},vt={"mesh-pyramids":"mesh",points:"point"},Si=o;export{Si as default}; diff --git a/main/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo--bzg75HX.js b/main/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo--bzg75HX.js deleted file mode 100644 index 0e029cd6f..000000000 --- a/main/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo--bzg75HX.js +++ /dev/null @@ -1 +0,0 @@ -import{v as C,i as v,dU as p,$ as x,i8 as m}from"./main-BZaw9FpY.js";import{j as h,g as f,N as l}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{u as L,q as P,y as S}from"./lineSegment-CcqvCARM-D_SdPttv.js";import{F as _,t as w,b as V}from"./sphere-BenPORjV-CgNvGf8s.js";import{y as b}from"./Octree-CJNwbhg4-DwYbmQHL.js";import{k as j}from"./edgeProcessing-CALv8P-b-Cef3g_Hy.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./plane-Dt8R0KeE-fuXvBrPY.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./deduplicate-D2d-E5Pw-cAmFzdIS.js";import"./Indices-DEr2HrWx-Cw8IJeSy.js";import"./InterleavedLayout-DXzw3B2n-BD8s1eQP.js";import"./BufferView-PQoE3GL7-DXIpDOUe.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";const I=1e3;function T(t,o,e){const i=V(),n=_(i);return l(n,n,t,.5),l(n,n,o,.5),i[3]=f(n,t),h(n,n,e),i}let g=class{constructor(){this._idToComponent=new Map,this._components=new b(t=>t.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=L(),this._tmpP1=p(),this._tmpP2=p(),this._tmpP3=p(),this.remoteClient=null}async fetchCandidates(t,o){await Promise.resolve(),x(o),await this._ensureEdgeLocations(t,o);const e=[];return this._edges.forEachNeighbor(i=>(this._addCandidates(t,i,e),e.length{if(s.info==null){const{id:c,uid:r}=s;e.push({id:c,uid:r})}return!0},t.bounds),!e.length)return;const i={components:e},n=await this.remoteClient.invoke("fetchAllEdgeLocations",i,o??{});for(const s of n.components)this._setFetchEdgeLocations(s)}async add(t){const o=new u(t.id,t.bounds);return this._idToComponent.set(o.id,o),this._components.add([o]),{result:{}}}async remove(t){const o=this._idToComponent.get(t.id);if(o){const e=[];this._edges.forEachNeighbor(i=>(i.component===o&&e.push(i),!0),o.bounds),this._edges.remove(e),this._components.remove([o]),this._idToComponent.delete(o.id)}return{result:{}}}_setFetchEdgeLocations(t){const o=this._idToComponent.get(t.id);if(o==null||t.uid!==o.uid)return;const e=j.createView(t.locations),i=new Array(e.count),n=p(),s=p();for(let d=0;dt.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=L(),this._tmpP1=p(),this._tmpP2=p(),this._tmpP3=p(),this.remoteClient=null}async fetchCandidates(t,o){await Promise.resolve(),x(o),await this._ensureEdgeLocations(t,o);const e=[];return this._edges.forEachNeighbor(i=>(this._addCandidates(t,i,e),e.length{if(s.info==null){const{id:c,uid:r}=s;e.push({id:c,uid:r})}return!0},t.bounds),!e.length)return;const i={components:e},n=await this.remoteClient.invoke("fetchAllEdgeLocations",i,o??{});for(const s of n.components)this._setFetchEdgeLocations(s)}async add(t){const o=new u(t.id,t.bounds);return this._idToComponent.set(o.id,o),this._components.add([o]),{result:{}}}async remove(t){const o=this._idToComponent.get(t.id);if(o){const e=[];this._edges.forEachNeighbor(i=>(i.component===o&&e.push(i),!0),o.bounds),this._edges.remove(e),this._components.remove([o]),this._idToComponent.delete(o.id)}return{result:{}}}_setFetchEdgeLocations(t){const o=this._idToComponent.get(t.id);if(o==null||t.uid!==o.uid)return;const e=j.createView(t.locations),i=new Array(e.count),n=p(),s=p();for(let d=0;di.map(i=>d[i]); -import{J as C,_ as P,hf as K,bw as Q}from"./main-BZaw9FpY.js";import{y as W,d as X}from"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import{z as Z,O as ee}from"./vec3-BazNroeq-CFXHYIOm.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./sphere-BenPORjV-CgNvGf8s.js";import"./I3SUtil-Bq8KpP2j-B88-rKNw.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-fuXvBrPY.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./projectVectorToVector-sIYLNlex-CXXu_lyF.js";import"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./NormalAttribute.glsl-axtNsUxo-corrAl_5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-CdJ2bdTT.js";import"./quat-BODLR7mS-Bk09s2KF.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";var N,j;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(N||(N={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(j||(j={}));function te(){return v||(v=new Promise(e=>P(()=>import("./i3s-BX0wo_Kt-c1D9OuB8.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:re,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),v}function re(e){return Q(`esri/libs/i3s/${e}`)}let v;var B,b,V,k,H;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(B||(B={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(b||(b={})),function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"}(V||(V={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(k||(k={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(H||(H={}));async function ke(e){n=await g();const t=[e.geometryBuffer];return{result:z(n,e,t),transferList:t}}async function He(e){n=await g();const t=[e.geometryBuffer],{geometryBuffer:r}=e,a=r.byteLength,i=n._malloc(a),l=new Uint8Array(n.HEAPU8.buffer,i,a);l.set(new Uint8Array(r));const s=n.dracoDecompressPointCloudData(i,l.byteLength);if(n._free(i),s.error.length>0)throw new Error(`i3s.wasm: ${s.error}`);const f=s.featureIds?.length>0?s.featureIds.slice():null,m=s.positions.slice();return f&&t.push(f.buffer),t.push(m.buffer),{result:{positions:m,featureIds:f},transferList:t}}async function ze(e){await g(),ne(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function Je(e){await g(),oe(e)}async function Ye(e){n=await g(),n.setLegacySchema(e.context,e.jsonSchema)}async function $e(e){const{localMatrix:t,origin:r,positions:a,vertexSpace:i}=e,l=C.fromJSON(e.inSpatialReference),s=C.fromJSON(e.outSpatialReference);let f;const[{projectBuffer:m},{initializeProjection:R}]=await Promise.all([P(()=>import("./projectBuffer-CvCBvJ6W-BLRWD7oY.js"),__vite__mapDeps([2,3,4]),import.meta.url).then(c=>c.p),P(()=>import("./projection-BA9M1R7d-DoNqITCd.js"),__vite__mapDeps([5,3,4,2]),import.meta.url).then(c=>c.p)]);await R(l,s);const w=[0,0,0];if(!m(r,l,0,w,s,0))throw new Error("Failed to project");if(i.type==="georeferenced"&&i.origin==null){if(f=new Float64Array(a.length),!m(a,l,0,f,s,0,f.length/3))throw new Error("Failed to project")}else{const c=i.type==="georeferenced"?W.fromJSON(i):X.fromJSON(i),{projectMeshVertexPositions:u}=await P(async()=>{const{projectMeshVertexPositions:p}=await import("./projectMeshVertexPositions-CFs_XMKX-CVDhZfgD.js");return{projectMeshVertexPositions:p}},__vite__mapDeps([6,2,3,4,7,8,9,10,11,12,13,14,15,16,17,5,18,19,20,21,22,23]),import.meta.url),d=u({vertexAttributes:{position:a},transform:t?{localMatrix:t}:void 0,vertexSpace:c,spatialReference:l},s);if(!d)throw new Error("Failed to project");f=d}const O=f.length,[E,I,_]=w;for(let c=0;ch.some(y=>y.name==="color")),normal:t.needNormals&&t.layouts.some(h=>h.some(y=>y.name==="normalCompressed")),uv0:t.layouts.some(h=>h.some(y=>y.name==="uv0")),uvRegion:t.layouts.some(h=>h.some(y=>y.name==="uvRegion")),featureIndex:F.featureIndex},o=e.process(a,!!t.obbData,E,c.byteLength,F,Y,_,f,w,O,t.normalReferenceFrame);if(e._free(_),e._free(E),o.error.length>0)throw new Error(`i3s.wasm: ${o.error}`);if(o.discarded)return null;const S=o.componentOffsets.length>0?o.componentOffsets.slice():null,U=o.featureIds.length>0?o.featureIds.slice():null,$=o.anchorIds.length>0?Array.from(o.anchorIds):null,G=o.anchors.length>0?Array.from(o.anchors):null,M=o.interleavedVertedData.slice().buffer,x=o.indicesType===N.Int16?new Uint16Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/2).slice():new Uint32Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/4).slice(),D=o.positions.slice(),T=o.positionIndicesType===N.Int16?new Uint16Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/2).slice():new Uint32Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:M,indices:x,hasColors:o.hasColors,hasModifications:o.hasModifications,positionData:{data:D,indices:T}};return U&&r.push(U.buffer),S&&r.push(S.buffer),r.push(M),r.push(x.buffer),r.push(D.buffer),r.push(T.buffer),{componentOffsets:S,featureIds:U,anchorIds:$,anchors:G,transformedGeometry:q,obb:o.obb,globalTrafo:i}}function Ke(e){return e===0?b.Unmodified:e===1?b.PotentiallyModified:e===2?b.Culled:b.Unknown}function ne(e){if(!n)return;const{context:t,buffer:r}=e,a=n._malloc(r.byteLength),i=r.byteLength/Float64Array.BYTES_PER_ELEMENT,l=new Float64Array(n.HEAPU8.buffer,a,i),s=new Float64Array(r);l.set(s),n.filterOBBs(t,a,i),s.set(l),n._free(a)}function J(e){n&&n.destroy(e)===0&&(n=null)}function L(e,t){for(let r=0;r(n=e,A=null,n))),A)}const We={transform:(e,t)=>n&&z(n,e,t),destroy:J};export{qe as destroyContext,He as dracoDecompressPointCloudData,ze as filterObbsForModifications,ne as filterObbsForModificationsSync,Qe as initialize,Ke as interpretObbModificationResults,ke as process,$e as project,Ye as setLegacySchema,Je as setModifications,oe as setModificationsSync,We as test,Ge as transformNormals}; diff --git a/main/assets/SceneLayerWorker-BC8rXiXB-OjMr9iXH.js b/main/assets/SceneLayerWorker-BC8rXiXB-OjMr9iXH.js new file mode 100644 index 000000000..1fcf38b1f --- /dev/null +++ b/main/assets/SceneLayerWorker-BC8rXiXB-OjMr9iXH.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./i3s-BX0wo_Kt-c1D9OuB8.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./projection-BA9M1R7d-DXrPfsKU.js","./projectMeshVertexPositions-CFs_XMKX-D3clZlUI.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./mat4-DX7gBViE-vewreEuZ.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js","./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js","./projectPointToVector-B2UUY9SE-BWg0qYG-.js","./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js","./vec3-BazNroeq-Cdhfm-VN.js","./BufferView-PQoE3GL7-M6q1od-Y.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4-DWDdg1fj-DGtcegeJ.js"])))=>i.map(i=>d[i]); +import{J as C,_ as P,hf as K,bw as Q}from"./main-C7yV2j71.js";import{y as W,d as X}from"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import{z as Z,O as ee}from"./vec3-BazNroeq-Cdhfm-VN.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./sphere-BenPORjV-CiIWUavi.js";import"./I3SUtil-Bq8KpP2j-DfTxNx-1.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CdQQbSdq.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./projectVectorToVector-sIYLNlex-B5U5xz17.js";import"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./I3SBinaryReader-DEbI3cKZ-D9EuM1ww.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BA8RF5F7.js";import"./quat-BODLR7mS-Dbd8ftOx.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";var N,j;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(N||(N={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(j||(j={}));function te(){return v||(v=new Promise(e=>P(()=>import("./i3s-BX0wo_Kt-c1D9OuB8.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:re,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),v}function re(e){return Q(`esri/libs/i3s/${e}`)}let v;var B,b,V,k,H;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(B||(B={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(b||(b={})),function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"}(V||(V={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(k||(k={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(H||(H={}));async function ke(e){n=await g();const t=[e.geometryBuffer];return{result:z(n,e,t),transferList:t}}async function He(e){n=await g();const t=[e.geometryBuffer],{geometryBuffer:r}=e,a=r.byteLength,i=n._malloc(a),l=new Uint8Array(n.HEAPU8.buffer,i,a);l.set(new Uint8Array(r));const s=n.dracoDecompressPointCloudData(i,l.byteLength);if(n._free(i),s.error.length>0)throw new Error(`i3s.wasm: ${s.error}`);const f=s.featureIds?.length>0?s.featureIds.slice():null,m=s.positions.slice();return f&&t.push(f.buffer),t.push(m.buffer),{result:{positions:m,featureIds:f},transferList:t}}async function ze(e){await g(),ne(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function Je(e){await g(),oe(e)}async function Ye(e){n=await g(),n.setLegacySchema(e.context,e.jsonSchema)}async function $e(e){const{localMatrix:t,origin:r,positions:a,vertexSpace:i}=e,l=C.fromJSON(e.inSpatialReference),s=C.fromJSON(e.outSpatialReference);let f;const[{projectBuffer:m},{initializeProjection:R}]=await Promise.all([P(()=>import("./projectBuffer-CvCBvJ6W-D_Mlrmjj.js"),__vite__mapDeps([2,3,4]),import.meta.url).then(c=>c.p),P(()=>import("./projection-BA9M1R7d-DXrPfsKU.js"),__vite__mapDeps([5,3,4,2]),import.meta.url).then(c=>c.p)]);await R(l,s);const w=[0,0,0];if(!m(r,l,0,w,s,0))throw new Error("Failed to project");if(i.type==="georeferenced"&&i.origin==null){if(f=new Float64Array(a.length),!m(a,l,0,f,s,0,f.length/3))throw new Error("Failed to project")}else{const c=i.type==="georeferenced"?W.fromJSON(i):X.fromJSON(i),{projectMeshVertexPositions:u}=await P(async()=>{const{projectMeshVertexPositions:p}=await import("./projectMeshVertexPositions-CFs_XMKX-D3clZlUI.js");return{projectMeshVertexPositions:p}},__vite__mapDeps([6,2,3,4,7,8,9,10,11,12,13,14,15,16,17,5,18,19,20,21,22,23]),import.meta.url),d=u({vertexAttributes:{position:a},transform:t?{localMatrix:t}:void 0,vertexSpace:c,spatialReference:l},s);if(!d)throw new Error("Failed to project");f=d}const O=f.length,[E,I,_]=w;for(let c=0;ch.some(y=>y.name==="color")),normal:t.needNormals&&t.layouts.some(h=>h.some(y=>y.name==="normalCompressed")),uv0:t.layouts.some(h=>h.some(y=>y.name==="uv0")),uvRegion:t.layouts.some(h=>h.some(y=>y.name==="uvRegion")),featureIndex:F.featureIndex},o=e.process(a,!!t.obbData,E,c.byteLength,F,Y,_,f,w,O,t.normalReferenceFrame);if(e._free(_),e._free(E),o.error.length>0)throw new Error(`i3s.wasm: ${o.error}`);if(o.discarded)return null;const S=o.componentOffsets.length>0?o.componentOffsets.slice():null,U=o.featureIds.length>0?o.featureIds.slice():null,$=o.anchorIds.length>0?Array.from(o.anchorIds):null,G=o.anchors.length>0?Array.from(o.anchors):null,M=o.interleavedVertedData.slice().buffer,x=o.indicesType===N.Int16?new Uint16Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/2).slice():new Uint32Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/4).slice(),D=o.positions.slice(),T=o.positionIndicesType===N.Int16?new Uint16Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/2).slice():new Uint32Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:M,indices:x,hasColors:o.hasColors,hasModifications:o.hasModifications,positionData:{data:D,indices:T}};return U&&r.push(U.buffer),S&&r.push(S.buffer),r.push(M),r.push(x.buffer),r.push(D.buffer),r.push(T.buffer),{componentOffsets:S,featureIds:U,anchorIds:$,anchors:G,transformedGeometry:q,obb:o.obb,globalTrafo:i}}function Ke(e){return e===0?b.Unmodified:e===1?b.PotentiallyModified:e===2?b.Culled:b.Unknown}function ne(e){if(!n)return;const{context:t,buffer:r}=e,a=n._malloc(r.byteLength),i=r.byteLength/Float64Array.BYTES_PER_ELEMENT,l=new Float64Array(n.HEAPU8.buffer,a,i),s=new Float64Array(r);l.set(s),n.filterOBBs(t,a,i),s.set(l),n._free(a)}function J(e){n&&n.destroy(e)===0&&(n=null)}function L(e,t){for(let r=0;r(n=e,A=null,n))),A)}const We={transform:(e,t)=>n&&z(n,e,t),destroy:J};export{qe as destroyContext,He as dracoDecompressPointCloudData,ze as filterObbsForModifications,ne as filterObbsForModificationsSync,Qe as initialize,Ke as interpretObbModificationResults,ke as process,$e as project,Ye as setLegacySchema,Je as setModifications,oe as setModificationsSync,We as test,Ge as transformNormals}; diff --git a/main/assets/SceneService-BZqGtWmG-B8Xgkv2e.js b/main/assets/SceneService-BZqGtWmG-B8Xgkv2e.js deleted file mode 100644 index 7cf00945b..000000000 --- a/main/assets/SceneService-BZqGtWmG-B8Xgkv2e.js +++ /dev/null @@ -1,3 +0,0 @@ -import{f as y,o as c,v as o,S as p,J as _,a0 as h,n as S,ac as P,i as L,bp as O,a1 as w,a as U,r as K}from"./main-BZaw9FpY.js";import{n as T}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{M as $}from"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import{I as V,i as M,o as C,x as q,T as z}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{e as F,Z as k}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import J from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import{i as A}from"./jsonContext-BA8GHqVk-BMETb6sX.js";import{T as B,F as D}from"./resourceUtils-BmW6QqlX-Cs99W_og.js";import{d as Z}from"./saveUtils-CIYk-dsQ-BCXbqzbn.js";async function G(s,a,t,e,i,r,n){let l=null;if(t!=null){const u=`${s}/nodepages/`,N=u+Math.floor(t.rootIndex/t.nodesPerPage);try{return{type:"page",rootPage:(await y(N,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,rootIndex:t.rootIndex,pageSize:t.nodesPerPage,lodMetric:t.lodSelectionMetricType,urlPrefix:u}}catch(E){r?.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",N,E),l=E}}if(!a)return null;const d=a?.split("/").pop(),f=`${s}/nodes/`,v=f+d;try{return{type:"node",rootNode:(await y(v,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,urlPrefix:f}}catch(u){throw new c("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:u,url:v})}}let H=null;function Q(){return H}const ne=s=>{let a=class extends s{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=O(async(t,e,i)=>{switch(t){case g.SAVE:return this._save(e);case g.SAVE_AS:return this._saveAs(i,e)}})}readSpatialReference(t,e){return I(e)}readFullExtent(t,e,i){if(t!=null&&typeof t=="object"){const l=t.spatialReference==null?{...t,spatialReference:I(e)}:t;return S.fromJSON(l,i)}const r=e.store,n=I(e);return n==null||r?.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(e.major=parseInt(i[0],10),e.minor=parseInt(i[1],10)),e}readVersion(t,e){const i=e.store,r=i.version!=null?i.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(t){return this.sublayerTitleMode!=="item-title"?void 0:t}readTitleService(t,e){const i=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?V(this.url,e.name):e.name;let r=e.name;if(!r&&this.url){const n=M(this.url);n!=null&&(r=n.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&i&&(r=i+" - "+r),C(r)}set url(t){if(t==null)return void this._set("url",t);const e=q({layer:this,url:t,nonStandardUrlAllowed:!1,logger:w.getLogger(this)});this._set("url",e.url),e.layerId!=null&&this._set("layerId",e.layerId)}writeUrl(t,e,i,r){z(this,t,"layers",e,r)}get parsedUrl(){const t=this._get("url"),e=U(t);return e&&this.layerId!=null&&(e.path=`${e.path}/layers/${this.layerId}`),e}async _fetchIndexAndUpdateExtent(t,e){this.indexInfo=G(this.parsedUrl?.path??"",this.rootNode,t,this.customParameters,this.apiKey,w.getLogger(this),e),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(t){if(t?.type==="page"){const e=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[e];if(i?.obb?.center==null||i.obb.halfSize==null)throw new c("sceneservice:invalid-node-page","Invalid node page.");if(i.obb.center[0]0)return e.data.layers[0].id}async _fetchServiceLayer(t){const e=await y(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t});e.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(e.data.layerType&&e.data.layerType==="Voxel"&&(i=!0),i)return this._fetchVoxelServiceLayer();const r=e.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(t){const e=(await y(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t})).data;this.read(e,this._getServiceContext()),this.validateLayer(e)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(t){}async _saveAs(t,e){const i={...R,...e};let r=J.from(t);if(!r)throw new c("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");r.id&&(r=r.clone(),r.id=null);const n=r.portal||K.getDefault();await this._ensureLoadBeforeSave(),r.type=b,r.portal=n;const l=A(r,"portal-item",!0),d={layers:[this.write({},l)]};return await Promise.all(l.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(d,l,i),this.url&&(r.url=this.url),r.title||(r.title=this.title),j(r,i,m.newItem),await n.signIn(),await n.user.addItem({item:r,folder:i?.folder,data:d}),await B(this.resourceReferences,l),this.portalItem=r,T(l),l.portalItem=r,r}async _save(t){const e={...R,...t};if(!this.portalItem)throw new c("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==b)throw new c("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${b}"`);await this._ensureLoadBeforeSave();const i=A(this.portalItem,"portal-item",!0),r={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,i,e),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),j(this.portalItem,e,m.existingItem),await D(this.portalItem,r,this.resourceReferences,i),T(i),this.portalItem}async _validateAgainstJSONSchema(t,e,i){const r=i?.validationOptions;Z(e,{errorName:"sceneservice:save"},{ignoreUnsupported:r?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const n=r?.enabled,l=Q();if(n&&l){const d=(await l()).validate(t,i.portalItemLayerType);if(!d.length)return;const f=`Layer item did not validate: -${d.join(` -`)}`;if(w.getLogger(this).error(`_validateAgainstJSONSchema(): ${f}`),r.failPolicy==="throw"){const v=d.map(u=>new c("sceneservice:schema-validation",u));throw new c("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:v})}}}};return o([p(F)],a.prototype,"id",void 0),o([p({type:_})],a.prototype,"spatialReference",void 0),o([h("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readSpatialReference",null),o([p({type:S})],a.prototype,"fullExtent",void 0),o([h("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readFullExtent",null),o([p({readOnly:!0,type:$})],a.prototype,"heightModelInfo",void 0),o([p({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],a.prototype,"minScale",void 0),o([p({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],a.prototype,"maxScale",void 0),o([p({readOnly:!0})],a.prototype,"version",void 0),o([h("version",["store.version"])],a.prototype,"readVersion",null),o([p({type:String,json:{read:{source:"copyrightText"}}})],a.prototype,"copyright",void 0),o([p({type:String,json:{read:!1}})],a.prototype,"sublayerTitleMode",void 0),o([p({type:String})],a.prototype,"title",void 0),o([h("portal-item","title")],a.prototype,"readTitlePortalItem",null),o([h("service","title",["name"])],a.prototype,"readTitleService",null),o([p({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],a.prototype,"layerId",void 0),o([p(k)],a.prototype,"url",null),o([P("url")],a.prototype,"writeUrl",null),o([p()],a.prototype,"parsedUrl",null),o([p({readOnly:!0})],a.prototype,"store",void 0),o([p({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],a.prototype,"rootNode",void 0),a=o([L("esri.layers.mixins.SceneService")],a),a},x=-1e38;function I(s){if(s.spatialReference!=null)return _.fromJSON(s.spatialReference);const a=s.store,t=a.indexCRS||a.geographicCRS,e=t&&parseInt(t.slice(t.lastIndexOf("/")+1),10);return e!=null?new _(e):null}function j(s,a,t){s.typeKeywords||(s.typeKeywords=[]);const e=a.getTypeKeywords();for(const i of e)s.typeKeywords.push(i);s.typeKeywords&&(s.typeKeywords=s.typeKeywords.filter((i,r,n)=>n.indexOf(i)===r),t===m.newItem&&(s.typeKeywords=s.typeKeywords.filter(i=>i!=="Hosted Service")))}var m;(function(s){s[s.existingItem=0]="existingItem",s[s.newItem=1]="newItem"})(m||(m={}));const b="Scene Service",R={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var g;(function(s){s[s.SAVE=0]="SAVE",s[s.SAVE_AS=1]="SAVE_AS"})(g||(g={}));export{G as T,ne as W,g as f}; diff --git a/main/assets/SceneService-BZqGtWmG-B9O0VJ5b.js b/main/assets/SceneService-BZqGtWmG-B9O0VJ5b.js new file mode 100644 index 000000000..276ec5c80 --- /dev/null +++ b/main/assets/SceneService-BZqGtWmG-B9O0VJ5b.js @@ -0,0 +1,3 @@ +import{f as y,o as c,v as o,S as p,J as _,a0 as h,n as S,ac as P,i as L,bp as O,a1 as w,a as U,r as K}from"./main-C7yV2j71.js";import{n as T}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{M as $}from"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import{I as V,i as M,o as C,x as q,T as z}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{e as F,Z as k}from"./commonProperties-BtIqvFU_-DuUske_0.js";import J from"./PortalItem-CctGdnxF-CHPkp6yW.js";import{i as A}from"./jsonContext-BA8GHqVk-DpBf0bCt.js";import{T as B,F as D}from"./resourceUtils-BmW6QqlX-CP-OW4gT.js";import{d as Z}from"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";async function G(s,a,t,e,i,r,n){let l=null;if(t!=null){const u=`${s}/nodepages/`,N=u+Math.floor(t.rootIndex/t.nodesPerPage);try{return{type:"page",rootPage:(await y(N,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,rootIndex:t.rootIndex,pageSize:t.nodesPerPage,lodMetric:t.lodSelectionMetricType,urlPrefix:u}}catch(E){r?.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",N,E),l=E}}if(!a)return null;const d=a?.split("/").pop(),f=`${s}/nodes/`,v=f+d;try{return{type:"node",rootNode:(await y(v,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,urlPrefix:f}}catch(u){throw new c("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:u,url:v})}}let H=null;function Q(){return H}const ne=s=>{let a=class extends s{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=O(async(t,e,i)=>{switch(t){case g.SAVE:return this._save(e);case g.SAVE_AS:return this._saveAs(i,e)}})}readSpatialReference(t,e){return I(e)}readFullExtent(t,e,i){if(t!=null&&typeof t=="object"){const l=t.spatialReference==null?{...t,spatialReference:I(e)}:t;return S.fromJSON(l,i)}const r=e.store,n=I(e);return n==null||r?.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(e.major=parseInt(i[0],10),e.minor=parseInt(i[1],10)),e}readVersion(t,e){const i=e.store,r=i.version!=null?i.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(t){return this.sublayerTitleMode!=="item-title"?void 0:t}readTitleService(t,e){const i=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?V(this.url,e.name):e.name;let r=e.name;if(!r&&this.url){const n=M(this.url);n!=null&&(r=n.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&i&&(r=i+" - "+r),C(r)}set url(t){if(t==null)return void this._set("url",t);const e=q({layer:this,url:t,nonStandardUrlAllowed:!1,logger:w.getLogger(this)});this._set("url",e.url),e.layerId!=null&&this._set("layerId",e.layerId)}writeUrl(t,e,i,r){z(this,t,"layers",e,r)}get parsedUrl(){const t=this._get("url"),e=U(t);return e&&this.layerId!=null&&(e.path=`${e.path}/layers/${this.layerId}`),e}async _fetchIndexAndUpdateExtent(t,e){this.indexInfo=G(this.parsedUrl?.path??"",this.rootNode,t,this.customParameters,this.apiKey,w.getLogger(this),e),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(t){if(t?.type==="page"){const e=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[e];if(i?.obb?.center==null||i.obb.halfSize==null)throw new c("sceneservice:invalid-node-page","Invalid node page.");if(i.obb.center[0]0)return e.data.layers[0].id}async _fetchServiceLayer(t){const e=await y(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t});e.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(e.data.layerType&&e.data.layerType==="Voxel"&&(i=!0),i)return this._fetchVoxelServiceLayer();const r=e.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(t){const e=(await y(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t})).data;this.read(e,this._getServiceContext()),this.validateLayer(e)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(t){}async _saveAs(t,e){const i={...R,...e};let r=J.from(t);if(!r)throw new c("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");r.id&&(r=r.clone(),r.id=null);const n=r.portal||K.getDefault();await this._ensureLoadBeforeSave(),r.type=b,r.portal=n;const l=A(r,"portal-item",!0),d={layers:[this.write({},l)]};return await Promise.all(l.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(d,l,i),this.url&&(r.url=this.url),r.title||(r.title=this.title),j(r,i,m.newItem),await n.signIn(),await n.user.addItem({item:r,folder:i?.folder,data:d}),await B(this.resourceReferences,l),this.portalItem=r,T(l),l.portalItem=r,r}async _save(t){const e={...R,...t};if(!this.portalItem)throw new c("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==b)throw new c("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${b}"`);await this._ensureLoadBeforeSave();const i=A(this.portalItem,"portal-item",!0),r={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,i,e),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),j(this.portalItem,e,m.existingItem),await D(this.portalItem,r,this.resourceReferences,i),T(i),this.portalItem}async _validateAgainstJSONSchema(t,e,i){const r=i?.validationOptions;Z(e,{errorName:"sceneservice:save"},{ignoreUnsupported:r?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const n=r?.enabled,l=Q();if(n&&l){const d=(await l()).validate(t,i.portalItemLayerType);if(!d.length)return;const f=`Layer item did not validate: +${d.join(` +`)}`;if(w.getLogger(this).error(`_validateAgainstJSONSchema(): ${f}`),r.failPolicy==="throw"){const v=d.map(u=>new c("sceneservice:schema-validation",u));throw new c("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:v})}}}};return o([p(F)],a.prototype,"id",void 0),o([p({type:_})],a.prototype,"spatialReference",void 0),o([h("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readSpatialReference",null),o([p({type:S})],a.prototype,"fullExtent",void 0),o([h("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readFullExtent",null),o([p({readOnly:!0,type:$})],a.prototype,"heightModelInfo",void 0),o([p({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],a.prototype,"minScale",void 0),o([p({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],a.prototype,"maxScale",void 0),o([p({readOnly:!0})],a.prototype,"version",void 0),o([h("version",["store.version"])],a.prototype,"readVersion",null),o([p({type:String,json:{read:{source:"copyrightText"}}})],a.prototype,"copyright",void 0),o([p({type:String,json:{read:!1}})],a.prototype,"sublayerTitleMode",void 0),o([p({type:String})],a.prototype,"title",void 0),o([h("portal-item","title")],a.prototype,"readTitlePortalItem",null),o([h("service","title",["name"])],a.prototype,"readTitleService",null),o([p({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],a.prototype,"layerId",void 0),o([p(k)],a.prototype,"url",null),o([P("url")],a.prototype,"writeUrl",null),o([p()],a.prototype,"parsedUrl",null),o([p({readOnly:!0})],a.prototype,"store",void 0),o([p({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],a.prototype,"rootNode",void 0),a=o([L("esri.layers.mixins.SceneService")],a),a},x=-1e38;function I(s){if(s.spatialReference!=null)return _.fromJSON(s.spatialReference);const a=s.store,t=a.indexCRS||a.geographicCRS,e=t&&parseInt(t.slice(t.lastIndexOf("/")+1),10);return e!=null?new _(e):null}function j(s,a,t){s.typeKeywords||(s.typeKeywords=[]);const e=a.getTypeKeywords();for(const i of e)s.typeKeywords.push(i);s.typeKeywords&&(s.typeKeywords=s.typeKeywords.filter((i,r,n)=>n.indexOf(i)===r),t===m.newItem&&(s.typeKeywords=s.typeKeywords.filter(i=>i!=="Hosted Service")))}var m;(function(s){s[s.existingItem=0]="existingItem",s[s.newItem=1]="newItem"})(m||(m={}));const b="Scene Service",R={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var g;(function(s){s[s.SAVE=0]="SAVE",s[s.SAVE_AS=1]="SAVE_AS"})(g||(g={}));export{G as T,ne as W,g as f}; diff --git a/main/assets/Scheduler-B7UX7Wr5-BziCzZ_c.js b/main/assets/Scheduler-B7UX7Wr5-BziCzZ_c.js new file mode 100644 index 000000000..5223d214c --- /dev/null +++ b/main/assets/Scheduler-B7UX7Wr5-BziCzZ_c.js @@ -0,0 +1 @@ +import{v as m,S as p,i as F,j as D,ef as R,dD as A,ah as y,aL as v,al as w,aN as d,a1 as G,au as M,aF as Q,x as C,aS as I,t as V,eg as Y}from"./main-C7yV2j71.js";import{o as L}from"./signal-CETehA7D-DxK1orqE.js";var o;(function(s){s[s.ANIMATING=0]="ANIMATING",s[s.INTERACTING=1]="INTERACTING",s[s.IDLE=2]="IDLE"})(o||(o={}));const U=Symbol("Yield");class H{constructor(){this._tasks=new Array,this._runningTasks=L(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(n){if(this.length===0)return U;for(;!n.done&&this._process(n);)n.madeProgress()}push(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.push(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}unshift(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.unshift(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}_process(n){if(this._tasks.length===0)return!1;const a=this._tasks.shift();try{const _=C(a.signal);if(_&&!a.abortCallback)a.reject(I());else{const h=_?a.abortCallback?.(I()):a.callback(n);V(h)?h.then(a.resolve,a.reject):a.resolve(h)}}catch(_){a.reject(_)}return!0}cancelAll(){const n=I();for(const a of this._tasks)if(a.abortCallback){const _=a.abortCallback(n);a.resolve(_)}else a.reject(n);this._tasks.length=0}}class f{constructor(n,a,_,h=void 0,e=void 0){this.resolve=n,this.reject=a,this.callback=_,this.signal=h,this.abortCallback=e}}let c=class extends D{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};m([p()],c.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),m([p()],c.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),c=m([F("esri.views.support.debugFlags")],c);const B=new c;function z(){return new g.Scheduler}var i;(function(s){s.RESOURCE_CONTROLLER_IMMEDIATE="immediate",s.RESOURCE_CONTROLLER="schedule",s.SLIDE="slide",s.STREAM_DATA_LOADER="stream loader",s.ELEVATION_QUERY="elevation query",s.TERRAIN_SURFACE="terrain",s.SURFACE_GEOMETRY_UPDATES="surface geometry updates",s.LOD_RENDERER="LoD renderer",s.GRAPHICS_CORE="Graphics3D",s.I3S_CONTROLLER="I3S",s.POINT_CLOUD_LAYER="point cloud",s.FEATURE_TILE_FETCHER="feature fetcher",s.OVERLAY="overlay",s.STAGE="stage",s.GRAPHICS_DECONFLICTOR="graphics deconflictor",s.FILTER_VISIBILITY="Graphics3D filter visibility",s.SCALE_VISIBILITY="Graphics3D scale visibility",s.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",s.POINT_OF_INTEREST_FREQUENT="POI frequent",s.POINT_OF_INTEREST_INFREQUENT="POI infrequent",s.LABELER="labeler",s.FEATURE_QUERY_ENGINE="feature query",s.FEATURE_TILE_TREE="feature tile tree",s.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",s.ELEVATION_ALIGNMENT="elevation alignment",s.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",s.TEXT_TEXTURE_ATLAS="text texture atlas",s.TEXTURE_UNLOAD="texture unload",s.LINE_OF_SIGHT_TOOL="line of sight tool",s.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",s.ELEVATION_PROFILE="elevation profile",s.SNAPPING="snapping",s.SHADOW_ACCUMULATOR="shadow accumulator",s.CLOUDS_GENERATOR="clouds generator",s.MAPVIEW_FETCH_QUEUE="mapview fetch queue",s.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",s.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",s[s.NONE=0]="NONE",s[s.TEST_PRIO=1]="TEST_PRIO"})(i||(i={}));const E=0,S=new Map([[i.RESOURCE_CONTROLLER_IMMEDIATE,E],[i.RESOURCE_CONTROLLER,4],[i.SLIDE,E],[i.STREAM_DATA_LOADER,E],[i.ELEVATION_QUERY,E],[i.TERRAIN_SURFACE,1],[i.SURFACE_GEOMETRY_UPDATES,1],[i.LOD_RENDERER,2],[i.GRAPHICS_CORE,2],[i.I3S_CONTROLLER,2],[i.POINT_CLOUD_LAYER,2],[i.FEATURE_TILE_FETCHER,2],[i.CLOUDS_GENERATOR,2],[i.OVERLAY,4],[i.STAGE,4],[i.GRAPHICS_DECONFLICTOR,4],[i.FILTER_VISIBILITY,4],[i.SCALE_VISIBILITY,4],[i.FRUSTUM_VISIBILITY,4],[i.POINT_OF_INTEREST_FREQUENT,6],[i.POINT_OF_INTEREST_INFREQUENT,30],[i.LABELER,8],[i.FEATURE_QUERY_ENGINE,8],[i.FEATURE_TILE_TREE,16],[i.FEATURE_TILE_TREE_ACTIVE,E],[i.ELEVATION_ALIGNMENT,12],[i.ELEVATION_ALIGNMENT_SCENE,14],[i.TEXT_TEXTURE_ATLAS,12],[i.TEXTURE_UNLOAD,12],[i.LINE_OF_SIGHT_TOOL,16],[i.LINE_OF_SIGHT_TOOL_INTERACTIVE,E],[i.SNAPPING,E],[i.SHADOW_ACCUMULATOR,30],[i.MAPVIEW_FETCH_QUEUE,E],[i.MAPVIEW_LAYERVIEW_UPDATE,2],[i.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,E]]);function N(s){return S.has(s)?S.get(s):typeof s=="number"?s:1}const W=d(6.5),k=d(1),x=d(30),q=d(1e3/30),j=d(100),b=.9;var g,l;(function(s){class n{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=L(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new R("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new _,this._state=o.INTERACTING,this._tasks=new A,this._runQueue=new A,this._load=0,this._idleStateCallbacks=new A,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=y(()=>B.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,v);for(const e of Object.keys(i))this.performanceInfo.tasks.set(i[e],new R(i[e]))}destroy(){this._tasks.toArray().forEach(e=>e.remove()),this._tasks.clear(),w(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(e,r){const t=new a(this,e,r);return this._tasks.push(t),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new R(e)),t}registerIdleStateCallbacks(e,r){const t={idleBegin:e,idleEnd:r};this._idleStateCallbacks.push(t),this.state===o.IDLE&&this._idleUpdatesStartFired&&t.idleBegin();const u=this;return{remove:()=>this._removeIdleStateCallbacks(t),set idleBegin(T){u._idleUpdatesStartFired&&(t.idleEnd(),u._state===o.IDLE&&T()),t.idleBegin=T},set idleEnd(T){t.idleEnd=T}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==o.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(r=>r.idleEnd())))}get state(){return this._state}updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let r=W,t=e.frameDuration,u=k;switch(this.state){case o.IDLE:r=d(0),t=d(Math.max(j,e.frameDuration)),u=x;break;case o.INTERACTING:t=d(Math.max(q,e.frameDuration));case o.ANIMATING:}return t=d(t-e.elapsedFrameTime-r),this.state!==o.IDLE&&te.idleBegin())),this._runIdle();break;case o.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(d(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll(r=>{r.name===e&&r.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return l.SCHEDULED;let r=l.IDLE;return this._tasks.forAll(t=>{t.name===e&&t.needsUpdate&&(t.schedulePriority<=1?r=l.READY:r!==l.READY&&(r=l.WAITING))}),r}_getRuntime(e){let r=0;return this._tasks.forAll(t=>{t.name===e&&(r+=t.runtime)}),r}_resetRuntimes(){this._tasks.forAll(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forAll(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),e.size===0)return null;let r="";return e.forEach((t,u)=>{r+=t>1?` ${t}x ${u}`:` ${u}`}),r}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce((r,t)=>t.needsUpdate?++r:r,0);this._load=this._load*b+e*(1-b)}_schedule(){for(this._runQueue.filterInPlace(e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forAll(e=>{e.basePriority===E&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});this._runQueue.length===0;){let e=!1,r=0;if(this._tasks.forAll(t=>{t.needsUpdate&&t.schedulePriority!==0&&t.basePriority!==E&&t.blockFrame!==this._frameNumber&&(e=!0,r=Math.max(r,t.basePriority),t.schedulePriority===1?(t.schedulePriority=0,this._runQueue.push(t)):--t.schedulePriority)}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const r=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===U&&(t.blockFrame=this._frameNumber)}catch(T){G.getLogger("esri.views.support.Scheduler").error(`Exception in task "${t.name}"`,T),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,i.I3S_CONTROLLER,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;const u=this._budget.now()-r;if(t.runtime+=u,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+u),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(i))this._frameTaskTimes.set(i[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((r,t)=>this.performanceInfo.tasks.get(t).push(r)),this.performanceInfo.total.push(e)}get test(){return this._test}}s.Scheduler=n;class a{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,r,t){this._scheduler=e,this.name=r,this.blockFrame=0,this.runtime=0,this._queue=new H,this._handles=new M,this._basePriority=N(r),this.schedulePriority=this._basePriority,this._task=L(t??this._queue),this._handles.add(Q(()=>this.task.running,u=>e.taskRunningChanged(u)))}remove(){this.processQueue(P),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const r=N(e);this._basePriority!==E&&this.schedulePriority===0||(this.schedulePriority=r),this._basePriority=r}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,r,t){return this._queue.push(e,r,t)}reschedule(e,r,t){return this._queue.unshift(e,r,t)}processQueue(e){return this._queue.runTask(e)}}class _{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=o.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(e()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,r){this._begin=this.now(),this._budget=e,this._state=r,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}s.Budget=_})(g||(g={})),function(s){s.SCHEDULED="s",s.READY="r",s.WAITING="w",s.IDLE="i"}(l||(l={}));const P=(()=>{const s=new g.Budget;return s.enabled=!1,s})();class X{remove(){}processQueue(){}schedule(n,a,_){try{if(C(a)){const h=I();return _?Promise.resolve(_(h)):Promise.reject(h)}return Y(n(P))}catch(h){return Promise.reject(h)}}reschedule(n,a,_){return this.schedule(n,a,_)}}const O=new X;export{z as W,O as f,i,P as p,o as u}; diff --git a/main/assets/Scheduler-B7UX7Wr5-DXVwwlDm.js b/main/assets/Scheduler-B7UX7Wr5-DXVwwlDm.js deleted file mode 100644 index 6c052b067..000000000 --- a/main/assets/Scheduler-B7UX7Wr5-DXVwwlDm.js +++ /dev/null @@ -1 +0,0 @@ -import{v as m,S as p,i as F,j as D,ef as R,dD as A,ah as y,aL as v,al as w,aN as d,a1 as G,au as M,aF as Q,x as C,aS as I,t as V,eg as Y}from"./main-BZaw9FpY.js";import{o as L}from"./signal-CETehA7D-vStzfbaY.js";var o;(function(s){s[s.ANIMATING=0]="ANIMATING",s[s.INTERACTING=1]="INTERACTING",s[s.IDLE=2]="IDLE"})(o||(o={}));const U=Symbol("Yield");class H{constructor(){this._tasks=new Array,this._runningTasks=L(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(n){if(this.length===0)return U;for(;!n.done&&this._process(n);)n.madeProgress()}push(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.push(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}unshift(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.unshift(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}_process(n){if(this._tasks.length===0)return!1;const a=this._tasks.shift();try{const _=C(a.signal);if(_&&!a.abortCallback)a.reject(I());else{const h=_?a.abortCallback?.(I()):a.callback(n);V(h)?h.then(a.resolve,a.reject):a.resolve(h)}}catch(_){a.reject(_)}return!0}cancelAll(){const n=I();for(const a of this._tasks)if(a.abortCallback){const _=a.abortCallback(n);a.resolve(_)}else a.reject(n);this._tasks.length=0}}class f{constructor(n,a,_,h=void 0,e=void 0){this.resolve=n,this.reject=a,this.callback=_,this.signal=h,this.abortCallback=e}}let c=class extends D{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};m([p()],c.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),m([p()],c.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),c=m([F("esri.views.support.debugFlags")],c);const B=new c;function z(){return new g.Scheduler}var i;(function(s){s.RESOURCE_CONTROLLER_IMMEDIATE="immediate",s.RESOURCE_CONTROLLER="schedule",s.SLIDE="slide",s.STREAM_DATA_LOADER="stream loader",s.ELEVATION_QUERY="elevation query",s.TERRAIN_SURFACE="terrain",s.SURFACE_GEOMETRY_UPDATES="surface geometry updates",s.LOD_RENDERER="LoD renderer",s.GRAPHICS_CORE="Graphics3D",s.I3S_CONTROLLER="I3S",s.POINT_CLOUD_LAYER="point cloud",s.FEATURE_TILE_FETCHER="feature fetcher",s.OVERLAY="overlay",s.STAGE="stage",s.GRAPHICS_DECONFLICTOR="graphics deconflictor",s.FILTER_VISIBILITY="Graphics3D filter visibility",s.SCALE_VISIBILITY="Graphics3D scale visibility",s.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",s.POINT_OF_INTEREST_FREQUENT="POI frequent",s.POINT_OF_INTEREST_INFREQUENT="POI infrequent",s.LABELER="labeler",s.FEATURE_QUERY_ENGINE="feature query",s.FEATURE_TILE_TREE="feature tile tree",s.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",s.ELEVATION_ALIGNMENT="elevation alignment",s.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",s.TEXT_TEXTURE_ATLAS="text texture atlas",s.TEXTURE_UNLOAD="texture unload",s.LINE_OF_SIGHT_TOOL="line of sight tool",s.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",s.ELEVATION_PROFILE="elevation profile",s.SNAPPING="snapping",s.SHADOW_ACCUMULATOR="shadow accumulator",s.CLOUDS_GENERATOR="clouds generator",s.MAPVIEW_FETCH_QUEUE="mapview fetch queue",s.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",s.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",s[s.NONE=0]="NONE",s[s.TEST_PRIO=1]="TEST_PRIO"})(i||(i={}));const E=0,S=new Map([[i.RESOURCE_CONTROLLER_IMMEDIATE,E],[i.RESOURCE_CONTROLLER,4],[i.SLIDE,E],[i.STREAM_DATA_LOADER,E],[i.ELEVATION_QUERY,E],[i.TERRAIN_SURFACE,1],[i.SURFACE_GEOMETRY_UPDATES,1],[i.LOD_RENDERER,2],[i.GRAPHICS_CORE,2],[i.I3S_CONTROLLER,2],[i.POINT_CLOUD_LAYER,2],[i.FEATURE_TILE_FETCHER,2],[i.CLOUDS_GENERATOR,2],[i.OVERLAY,4],[i.STAGE,4],[i.GRAPHICS_DECONFLICTOR,4],[i.FILTER_VISIBILITY,4],[i.SCALE_VISIBILITY,4],[i.FRUSTUM_VISIBILITY,4],[i.POINT_OF_INTEREST_FREQUENT,6],[i.POINT_OF_INTEREST_INFREQUENT,30],[i.LABELER,8],[i.FEATURE_QUERY_ENGINE,8],[i.FEATURE_TILE_TREE,16],[i.FEATURE_TILE_TREE_ACTIVE,E],[i.ELEVATION_ALIGNMENT,12],[i.ELEVATION_ALIGNMENT_SCENE,14],[i.TEXT_TEXTURE_ATLAS,12],[i.TEXTURE_UNLOAD,12],[i.LINE_OF_SIGHT_TOOL,16],[i.LINE_OF_SIGHT_TOOL_INTERACTIVE,E],[i.SNAPPING,E],[i.SHADOW_ACCUMULATOR,30],[i.MAPVIEW_FETCH_QUEUE,E],[i.MAPVIEW_LAYERVIEW_UPDATE,2],[i.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,E]]);function N(s){return S.has(s)?S.get(s):typeof s=="number"?s:1}const W=d(6.5),k=d(1),x=d(30),q=d(1e3/30),j=d(100),b=.9;var g,l;(function(s){class n{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=L(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new R("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new _,this._state=o.INTERACTING,this._tasks=new A,this._runQueue=new A,this._load=0,this._idleStateCallbacks=new A,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=y(()=>B.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,v);for(const e of Object.keys(i))this.performanceInfo.tasks.set(i[e],new R(i[e]))}destroy(){this._tasks.toArray().forEach(e=>e.remove()),this._tasks.clear(),w(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(e,r){const t=new a(this,e,r);return this._tasks.push(t),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new R(e)),t}registerIdleStateCallbacks(e,r){const t={idleBegin:e,idleEnd:r};this._idleStateCallbacks.push(t),this.state===o.IDLE&&this._idleUpdatesStartFired&&t.idleBegin();const u=this;return{remove:()=>this._removeIdleStateCallbacks(t),set idleBegin(T){u._idleUpdatesStartFired&&(t.idleEnd(),u._state===o.IDLE&&T()),t.idleBegin=T},set idleEnd(T){t.idleEnd=T}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==o.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(r=>r.idleEnd())))}get state(){return this._state}updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let r=W,t=e.frameDuration,u=k;switch(this.state){case o.IDLE:r=d(0),t=d(Math.max(j,e.frameDuration)),u=x;break;case o.INTERACTING:t=d(Math.max(q,e.frameDuration));case o.ANIMATING:}return t=d(t-e.elapsedFrameTime-r),this.state!==o.IDLE&&te.idleBegin())),this._runIdle();break;case o.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(d(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll(r=>{r.name===e&&r.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return l.SCHEDULED;let r=l.IDLE;return this._tasks.forAll(t=>{t.name===e&&t.needsUpdate&&(t.schedulePriority<=1?r=l.READY:r!==l.READY&&(r=l.WAITING))}),r}_getRuntime(e){let r=0;return this._tasks.forAll(t=>{t.name===e&&(r+=t.runtime)}),r}_resetRuntimes(){this._tasks.forAll(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forAll(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),e.size===0)return null;let r="";return e.forEach((t,u)=>{r+=t>1?` ${t}x ${u}`:` ${u}`}),r}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce((r,t)=>t.needsUpdate?++r:r,0);this._load=this._load*b+e*(1-b)}_schedule(){for(this._runQueue.filterInPlace(e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forAll(e=>{e.basePriority===E&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});this._runQueue.length===0;){let e=!1,r=0;if(this._tasks.forAll(t=>{t.needsUpdate&&t.schedulePriority!==0&&t.basePriority!==E&&t.blockFrame!==this._frameNumber&&(e=!0,r=Math.max(r,t.basePriority),t.schedulePriority===1?(t.schedulePriority=0,this._runQueue.push(t)):--t.schedulePriority)}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const r=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===U&&(t.blockFrame=this._frameNumber)}catch(T){G.getLogger("esri.views.support.Scheduler").error(`Exception in task "${t.name}"`,T),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,i.I3S_CONTROLLER,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;const u=this._budget.now()-r;if(t.runtime+=u,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+u),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(i))this._frameTaskTimes.set(i[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((r,t)=>this.performanceInfo.tasks.get(t).push(r)),this.performanceInfo.total.push(e)}get test(){return this._test}}s.Scheduler=n;class a{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,r,t){this._scheduler=e,this.name=r,this.blockFrame=0,this.runtime=0,this._queue=new H,this._handles=new M,this._basePriority=N(r),this.schedulePriority=this._basePriority,this._task=L(t??this._queue),this._handles.add(Q(()=>this.task.running,u=>e.taskRunningChanged(u)))}remove(){this.processQueue(P),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const r=N(e);this._basePriority!==E&&this.schedulePriority===0||(this.schedulePriority=r),this._basePriority=r}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,r,t){return this._queue.push(e,r,t)}reschedule(e,r,t){return this._queue.unshift(e,r,t)}processQueue(e){return this._queue.runTask(e)}}class _{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=o.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(e()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,r){this._begin=this.now(),this._budget=e,this._state=r,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}s.Budget=_})(g||(g={})),function(s){s.SCHEDULED="s",s.READY="r",s.WAITING="w",s.IDLE="i"}(l||(l={}));const P=(()=>{const s=new g.Budget;return s.enabled=!1,s})();class X{remove(){}processQueue(){}schedule(n,a,_){try{if(C(a)){const h=I();return _?Promise.resolve(_(h)):Promise.reject(h)}return Y(n(P))}catch(h){return Promise.reject(h)}}reschedule(n,a,_){return this.schedule(n,a,_)}}const O=new X;export{z as W,O as f,i,P as p,o as u}; diff --git a/main/assets/SourceLayerData-BT_Ywuvg-BFtXgEqx.js b/main/assets/SourceLayerData-BT_Ywuvg-BFtXgEqx.js new file mode 100644 index 000000000..16e81ce2b --- /dev/null +++ b/main/assets/SourceLayerData-BT_Ywuvg-BFtXgEqx.js @@ -0,0 +1 @@ +import{g as l}from"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";var g;(function(c){c[c.moveTo=1]="moveTo",c[c.lineTo=2]="lineTo",c[c.close=7]="close"})(g||(g={}));class m{constructor(e,t,o=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=o;const s=t.keys,u=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const i=r.getMessage().asUnsafe(),a=this.values;for(;!i.empty();){const n=i.getUInt32(),h=i.getUInt32();a[s[n]]=u[h]}i.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let o,s;this._pbfGeometry=null,e?e.reset(this.type):o=[];let u,r=g.moveTo,i=0,a=0,n=0;for(;!t.empty();){if(i===0){const h=t.getUInt32();r=7&h,i=h>>3}switch(i--,r){case g.moveTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.moveTo(a,n):o&&(s&&o.push(s),s=[],s.push(new l(a,n)));break;case g.lineTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.lineTo(a,n):s&&s.push(new l(a,n));break;case g.close:e?e.close():s&&!s[0].equals(a,n)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?u=e.result():o&&(s&&o.push(s),u=o),t.release(),this._geometry=u,u}}class p{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(p._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}export{m as f,p as g}; diff --git a/main/assets/SourceLayerData-BT_Ywuvg-BR7vjYvJ.js b/main/assets/SourceLayerData-BT_Ywuvg-BR7vjYvJ.js deleted file mode 100644 index 13dd89f3a..000000000 --- a/main/assets/SourceLayerData-BT_Ywuvg-BR7vjYvJ.js +++ /dev/null @@ -1 +0,0 @@ -import{g as l}from"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";var g;(function(c){c[c.moveTo=1]="moveTo",c[c.lineTo=2]="lineTo",c[c.close=7]="close"})(g||(g={}));class m{constructor(e,t,o=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=o;const s=t.keys,u=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const i=r.getMessage().asUnsafe(),a=this.values;for(;!i.empty();){const n=i.getUInt32(),h=i.getUInt32();a[s[n]]=u[h]}i.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let o,s;this._pbfGeometry=null,e?e.reset(this.type):o=[];let u,r=g.moveTo,i=0,a=0,n=0;for(;!t.empty();){if(i===0){const h=t.getUInt32();r=7&h,i=h>>3}switch(i--,r){case g.moveTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.moveTo(a,n):o&&(s&&o.push(s),s=[],s.push(new l(a,n)));break;case g.lineTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.lineTo(a,n):s&&s.push(new l(a,n));break;case g.close:e?e.close():s&&!s[0].equals(a,n)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?u=e.result():o&&(s&&o.push(s),u=o),t.release(),this._geometry=u,u}}class p{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(p._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}export{m as f,p as g}; diff --git a/main/assets/SpatialFilter-BlQBFhwz-DNDU1J87.js b/main/assets/SpatialFilter-BlQBFhwz-DNDU1J87.js new file mode 100644 index 000000000..56c51cfc3 --- /dev/null +++ b/main/assets/SpatialFilter-BlQBFhwz-DNDU1J87.js @@ -0,0 +1 @@ +import{cF as X,F as $,J as ee,t as M}from"./main-C7yV2j71.js";import{D as te}from"./arcadeUtils-DpP0k7IY-BXKRfMc2.js";import{a as c,D as C,N as x,w as P,P as k,x as L,L as ne,y as F,k as re,E as se,b as G,h as B,J as Z}from"./shared-D1w-26bA-CNuAEz8h.js";import{m as O,r as ae,O as j}from"./TimeOnly-DSMefxKy-C21ZkqlE.js";import{Z as T,n as g,a as m,r as W}from"./WhereClause-DxwoyBMS-DCzFGfA-.js";import{union as ie,geodesicArea as le,planarArea as oe,geodesicLength as ue,planarLength as ce,relate as he,crosses as de,touches as pe,within as fe,overlaps as _e,contains as ge,intersects as H}from"./geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js";import{o as me}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";var f;(function(s){s.NeverReach="NeverReach",s.NotImplemented="NotImplemented",s.Cancelled="Cancelled",s.InvalidStatResponse="InvalidStatResponse",s.InvalidRequest="InvalidRequest",s.RequestFailed="RequestFailed",s.MissingFeatures="MissingFeatures",s.AggregationFieldNotFound="AggregationFieldNotFound",s.DataElementsNotFound="DataElementsNotFound"})(f||(f={}));const ye={[f.Cancelled]:"Cancelled",[f.InvalidStatResponse]:"Invalid statistics response from service",[f.InvalidRequest]:"Invalid request",[f.RequestFailed]:"Request failed - {reason}",[f.MissingFeatures]:"Missing features",[f.AggregationFieldNotFound]:"Aggregation field not found",[f.DataElementsNotFound]:"Data elements not found on service",[f.NeverReach]:"Encountered unreachable logic",[f.NotImplemented]:"Not implemented"};class y extends Error{constructor(e,t){super(X(ye[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,y)}}class A{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){this._databaseTypeMetaData[e]===void 0&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return e==="MUSTBESET"||this._databaseTypeMetaData[e]===void 0?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return this._layerInfo[e]===void 0?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){this._layerInfo[e]!==void 0&&delete this._layerInfo[e]}}A.applicationCache=null;class Se{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}async nextBatchAsArcadeFeatures(e,t){const n=await this.nextBatch(e);return n===null?n:n.map(r=>te.createFromGraphicLikeObject(r.geometry,r.attributes,this._parent,t))}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(r=>this.nextBatch(e),r=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((r,a)=>{this._parent._getSet(this._progress).then(i=>{const l=i._known;let u=l.length-1;if(l[l.length-1]==="GETPAGES"&&(u-=1),this._lastId+e>u&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)});const o=i._candidates;if(u>=this._lastId+e||o.length===0){for(let d=0;d=l.length)break;n[d]=l[_]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,r(d)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,a(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(r=>{const a=r._known;this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(r,a[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):r._candidates.length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},r=>{e.hasset=!0,this._parent._mainSetInUse=null,n(r)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class E{constructor(e,t,n,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}function q(s,e){return h(s?.parseTree,e,s?.parameters)}function qe(s,e,t){return h(s,e,t)}function Ye(s,e,t,n){const r=h(s.parseTree,c.Standardised,s.parameters,e,t);return T.create(r,{fieldsIndex:n,timeZone:s.timeZone,currentUser:s.currentUser})}function Qe(s,e,t="AND"){return T.create("(("+q(s,c.Standardised)+")"+t+"("+q(e,c.Standardised)+"))",{fieldsIndex:s.fieldsIndex,timeZone:s.timeZone,currentUser:s.currentUser})}function we(s){return s.delimited===!0?`"${s.column.split('"').join('""')}"`:s.column}function h(s,e,t,n=null,r=null){let a,i,l,u;switch(s.type){case"interval":return Ee(h(s.value,e,t,n,r),s.qualifier,s.op);case"case-expression":{let o=" CASE ";s.format==="simple"&&(o+=h(s.operand,e,t,n,r));for(let d=0;d":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+h(s.left,e,t,n,r)+" "+s.operator+" "+h(s.right,e,t,n,r)+") ";case"||":return" ("+h(s.left,e,t,n,r)+" "+(e===c.SqlServer?"+":s.operator)+" "+h(s.right,e,t,n,r)+") "}throw new g(m.UnsupportedOperator,{operator:s.operator});case"null":return"null";case"boolean":return s.value===!0?"1":"0";case"string":return"'"+s.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${s.value}'`;case"date":return`date '${s.value}'`;case"time":return`time '${s.value}'`;case"number":return s.value.toString();case"current-time":return Ie(s.mode,e);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===s.column.toLowerCase()?"("+r+")":we(s);case"data-type":return s.value;case"function":{const o=h(s.args,e,t,n,r);return Te(s.name,o,e)}}throw new g(m.UnsupportedSyntax,{node:s.type})}function Te(s,e,t){switch(s.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"ceiling"});switch(t){case c.Standardised:case c.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]},${e[1]})`;case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new g(m.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new g(m.InvalidFunctionParameters,{function:"truncate"});return t===c.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"char_length"});switch(t){case c.SqlServer:return"LEN("+e[0]+")";case c.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase()});let n=s.toUpperCase().trim()+"(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new g(m.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return R([S(s,e.left,t,n),S(s,e.right,t,n)]);case"||":return"string";default:throw new g(m.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return e.mode==="time"?"time-only":"date";case"current-user":return"string";case"column-reference":{const a=s[e.column.toLowerCase()];return a===void 0?"":a}case"function":switch(e.name.toLowerCase()){case"cast":switch(e.args?.value[1]?.value.type??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return e.args?.value[1]?.value?.withtimezone===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(r=S(s,e.args,t,n),Array.isArray(r)){if(r.length<=0)return"double";r=r[0]}return r;case"sign":return"integer";case"ceiling":case"floor":case"abs":return r=S(s,e.args,t,n),Array.isArray(r)&&(r=R(r)),r==="integer"||r==="double"?r:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return r=S(s,e.args,t,n),Array.isArray(r)?r.length>0?r[0]:"":r}return""}throw new g(m.UnsupportedSyntax,{node:e.type})}const K={boolean:1,string:2,integer:3,double:4,date:5};function R(s){if(s){let e="";for(const t of s)t!==""&&(e=e===""||K[e]{setTimeout(o,0)}));const u=e?.calculateValue(l);u===null?n===!1&&(a[a.length]=u):a[a.length]=u instanceof j||u instanceof O?u.toNumber():u instanceof W?u.toMilliseconds():u,l=await r.next()}return a}async function Le(s,e,t=1e3,n=null){const r=s.iterator(n),a=[],i={},l={ticker:0};let u=await r.next();for(;u!==null;){if(l.ticker++,n?.aborted)throw new y(f.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(_=>{setTimeout(_,0)}));const o=e?.calculateValue(u);let d=o;if(o instanceof j?d="!!DATEONLY!!-"+o.toString():o instanceof W?d="!!TSOFFSETONLY!!-"+o.toString():o instanceof O?d="!!TIMEONLY!!-"+o.toString():o instanceof Date&&(d="!!DATE!!-"+o.toString()),o!=null&&i[d]===void 0&&(a.push(o),i[d]=1),a.length>=t&&t!==-1)return a;u=await r.next()}return a}class p{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=c.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=Object.create(null),this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e?.lrucache&&(this.recentlyUsedQueries=e.lrucache),e?.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return this._parent?.loaded===!0?(this._initialiseFeatureSet(),this):(await this._parent?.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new ee({wkid:4326}),this.geometryType=ne.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(r=>(r&&r.name.toLowerCase()===e&&(n=r),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=me.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new y(f.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,a){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,r,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===c.NotEvaluated){if(A.applicationCache!==null){const e=A.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),A.applicationCache!==null&&A.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw A.applicationCache!==null&&A.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:c.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:c.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:c.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return c.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new y(f.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new y(f.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new y(f.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new E([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const a of e)this._featureFromCache(a)!==void 0&&r.push(this._featureFromCache(a));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,a){throw new y(f.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let a=r-e._candidates.length;if(e._candidates.length===0||a>=t)return e;if(await this._refineIfParentKnown(e,t-a,n),this._checkCancelled(n),this._refineKnowns(e,t-a),a=r-e._candidates.length,a0){const i=t-a,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-a),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}r!==null&&a.push(r);for(let i=a.length-1;i>=0;i--)e._candidates.splice(a[i].start,a[i].end-a[i].start+1)}_refineIfParentKnown(e,t,n){const r=new E([],[],e._ordered,null);return r._candidates=e._candidates.slice(),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=e._lastFetchedIndex;r=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=0;r=t)break}return!1}async _expandPagedSet(e,t,n,r,a){if(this._parent===null)throw new y(f.NotImplemented);return this._parent._expandPagedSet(e,t,n,r,a)}async _expandPagedSetFeatureSet(e,t,n,r,a){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(r=1),r===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(r=2),r===0)return"finished";const i=await this._getPage(e,r,a);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){r.length=r.length-1;let a=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],a++;e.pagesDefinition.resultOffset+=a;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&r.push("GETPAGES"),a}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let a=await this._stat(e,t,"",null,null,n,r);return a.calculated===!1&&(a=await this._manualStat(e,t,n,r)),a.result}async _manualStat(e,t,n,r){let a=null;switch(e.toLowerCase()){case"count":return a=await ke(this,r),{calculated:!0,result:a};case"distinct":return a=await Le(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await Ne(this,t,r),{calculated:!0,result:a};case"stdev":return a=await xe(this,t,r),{calculated:!0,result:a};case"variance":return a=await Ce(this,t,r),{calculated:!0,result:a};case"sum":return a=await Pe(this,t,r),{calculated:!0,result:a};case"min":return a=await ve(this,t,r),{calculated:!0,result:a};case"max":return a=await Re(this,t,r),{calculated:!0,result:a};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,a,i,l){const u=await this._parent._stat(e,t,n,r,a,i,l);return u.calculated===!1?a===null&&n===""&&r===null?this._manualStat(e,t,i,l):{calculated:!1}:u}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((r,a)=>{this._unionShapeInBatches(n,t,r,a)})}_unionAllGeom(e){return new Promise((t,n)=>{const r=this.iterator(this._defaultTracker(e)),a=[];this._unionShapeInBatches(a,r,t,n)})}_unionShapeInBatches(e,t,n,r){t.next().then(a=>{try{a!==null&&a.geometry!==null&&e.push(a.geometry),e.length>30||a===null&&e.length>1?ie(e).then(i=>{try{a===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,r))}catch(l){r(l)}},r):a===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(i){r(i)}},r)}iterator(e){return new Se(this,e)}intersection(e,t=!1){return p._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return p._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return p._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return p._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return p._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return p._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return p._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return p._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return p._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return p._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return p._featuresetFunctions.relate.bind(this)(e,t)}within(e){return p._featuresetFunctions.within.bind(this)(e)}touches(e){return p._featuresetFunctions.touches.bind(this)(e)}top(e){return p._featuresetFunctions.top.bind(this)(e)}crosses(e){return p._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return p._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return p._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return p._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return p._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return p._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((r,a)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,a,0)})}_reduceImpl(e,t,n,r,a,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,r,a,i,l)});e.next().then(u=>{try{if(u===null)a(n);else{const o=t(n,u,r,this);M(o)?o.then(d=>{this._reduceImpl(e,t,d,r+1,a,i,l)},i):this._reduceImpl(e,t,o,r+1,a,i,l)}}catch(o){i(o)}},i)}catch(u){i(u)}}removeField(e){return p._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return p._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=re(e);return this.reduce((a,i)=>i.geometry===null?0:t?le(i.geometry,r).then(l=>a+l):oe(i.geometry,r).then(l=>a+l),0,n)}sumLength(e,t=!1,n){const r=se(e);return this.reduce((a,i)=>i.geometry===null?0:t?ue(i.geometry,r).then(l=>a+l):ce(i.geometry,r).then(l=>a+l),0,n)}async distinct(e,t=1e3,n=null,r){await this.load();const a=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)})}_forEachImpl(e,t,n,r,a,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,r,a,i)},0);e.next().then(l=>{try{if(l===null)r(n);else{const u=t(l);u==null?this._forEachImpl(e,t,n,r,a,i):M(u)?u.then(()=>{try{this._forEachImpl(e,t,n,r,a,i)}catch(o){a(o)}},a):this._forEachImpl(e,t,n,r,a,i)}}catch(u){a(u)}},a)}catch(l){a(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{const a={geometry:r.geometry?.toJSON(),attributes:{}};for(const i in r.attributes)a.attributes[i]=r.attributes[i];return t.featureSet.features.push(a),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,r,a){return this._parent.queryAttachments(e,t,n,r,a)}serviceUrl(){return this._parent.serviceUrl()}subtypeMetaData(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const r=this.schema();return r.features=n,r.spatialReference=this.spatialReference.toJSON(),JSON.stringify(r)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return e?.featureset==="keeptype"?this:e?.featureset==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if(t?.featureset==="keeptype")return this;if(t?.featureset==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if(t?.featureset==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?t?.keepGeometryType===!0?i.geometry:i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&t?.keepGeometryType!==!0&&delete l.geometry.spatialReference,n.push(l),1},0,e);const r=this.schema();return r.features=n,r.spatialReference=t?.keepGeometryType===!0?this.spatialReference:this.spatialReference?.toJSON(),r}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){return this.fsetInfo??await this._parent?.getFeatureSetInfo()??null}}function D(s,e){if(e!==null){const t={};for(const n in e)t[n.toLowerCase()]=e[n];s.parameters=t}}p._featuresetFunctions={};class b extends p{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new E([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=c.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new y(f.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new y(f.NeverReach)}async _getFilteredSet(){return new E([],[],!1,null)}_stat(e,t,n,r,a,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends p{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new E(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return H(Z(this._relationGeom),Z(e.geometry));case"esriSpatialRelIntersects":return H(this._relationGeom,e.geometry);case"esriSpatialRelContains":return ge(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return _e(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return fe(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return pe(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return de(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return he(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){const r=new E([],e,!1,null),a=Math.min(t,e.length);await this._parent?._getFeatures(r,-1,a,n),this._checkCancelled(n);const i=[];for(let l=0;lte.createFromGraphicLikeObject(r.geometry,r.attributes,this._parent,t))}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(r=>this.nextBatch(e),r=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((r,a)=>{this._parent._getSet(this._progress).then(i=>{const l=i._known;let u=l.length-1;if(l[l.length-1]==="GETPAGES"&&(u-=1),this._lastId+e>u&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)});const o=i._candidates;if(u>=this._lastId+e||o.length===0){for(let d=0;d=l.length)break;n[d]=l[_]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,r(d)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,a(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(r=>{const a=r._known;this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(r,a[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):r._candidates.length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},r=>{e.hasset=!0,this._parent._mainSetInUse=null,n(r)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class E{constructor(e,t,n,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}function q(s,e){return h(s?.parseTree,e,s?.parameters)}function qe(s,e,t){return h(s,e,t)}function Ye(s,e,t,n){const r=h(s.parseTree,c.Standardised,s.parameters,e,t);return T.create(r,{fieldsIndex:n,timeZone:s.timeZone,currentUser:s.currentUser})}function Qe(s,e,t="AND"){return T.create("(("+q(s,c.Standardised)+")"+t+"("+q(e,c.Standardised)+"))",{fieldsIndex:s.fieldsIndex,timeZone:s.timeZone,currentUser:s.currentUser})}function we(s){return s.delimited===!0?`"${s.column.split('"').join('""')}"`:s.column}function h(s,e,t,n=null,r=null){let a,i,l,u;switch(s.type){case"interval":return Ee(h(s.value,e,t,n,r),s.qualifier,s.op);case"case-expression":{let o=" CASE ";s.format==="simple"&&(o+=h(s.operand,e,t,n,r));for(let d=0;d":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+h(s.left,e,t,n,r)+" "+s.operator+" "+h(s.right,e,t,n,r)+") ";case"||":return" ("+h(s.left,e,t,n,r)+" "+(e===c.SqlServer?"+":s.operator)+" "+h(s.right,e,t,n,r)+") "}throw new g(m.UnsupportedOperator,{operator:s.operator});case"null":return"null";case"boolean":return s.value===!0?"1":"0";case"string":return"'"+s.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${s.value}'`;case"date":return`date '${s.value}'`;case"time":return`time '${s.value}'`;case"number":return s.value.toString();case"current-time":return Ie(s.mode,e);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===s.column.toLowerCase()?"("+r+")":we(s);case"data-type":return s.value;case"function":{const o=h(s.args,e,t,n,r);return Te(s.name,o,e)}}throw new g(m.UnsupportedSyntax,{node:s.type})}function Te(s,e,t){switch(s.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"ceiling"});switch(t){case c.Standardised:case c.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]},${e[1]})`;case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new g(m.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new g(m.InvalidFunctionParameters,{function:"truncate"});return t===c.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"char_length"});switch(t){case c.SqlServer:return"LEN("+e[0]+")";case c.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase()});let n=s.toUpperCase().trim()+"(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new g(m.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return R([S(s,e.left,t,n),S(s,e.right,t,n)]);case"||":return"string";default:throw new g(m.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return e.mode==="time"?"time-only":"date";case"current-user":return"string";case"column-reference":{const a=s[e.column.toLowerCase()];return a===void 0?"":a}case"function":switch(e.name.toLowerCase()){case"cast":switch(e.args?.value[1]?.value.type??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return e.args?.value[1]?.value?.withtimezone===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(r=S(s,e.args,t,n),Array.isArray(r)){if(r.length<=0)return"double";r=r[0]}return r;case"sign":return"integer";case"ceiling":case"floor":case"abs":return r=S(s,e.args,t,n),Array.isArray(r)&&(r=R(r)),r==="integer"||r==="double"?r:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return r=S(s,e.args,t,n),Array.isArray(r)?r.length>0?r[0]:"":r}return""}throw new g(m.UnsupportedSyntax,{node:e.type})}const K={boolean:1,string:2,integer:3,double:4,date:5};function R(s){if(s){let e="";for(const t of s)t!==""&&(e=e===""||K[e]{setTimeout(o,0)}));const u=e?.calculateValue(l);u===null?n===!1&&(a[a.length]=u):a[a.length]=u instanceof j||u instanceof O?u.toNumber():u instanceof W?u.toMilliseconds():u,l=await r.next()}return a}async function Le(s,e,t=1e3,n=null){const r=s.iterator(n),a=[],i={},l={ticker:0};let u=await r.next();for(;u!==null;){if(l.ticker++,n?.aborted)throw new y(f.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(_=>{setTimeout(_,0)}));const o=e?.calculateValue(u);let d=o;if(o instanceof j?d="!!DATEONLY!!-"+o.toString():o instanceof W?d="!!TSOFFSETONLY!!-"+o.toString():o instanceof O?d="!!TIMEONLY!!-"+o.toString():o instanceof Date&&(d="!!DATE!!-"+o.toString()),o!=null&&i[d]===void 0&&(a.push(o),i[d]=1),a.length>=t&&t!==-1)return a;u=await r.next()}return a}class p{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=c.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=Object.create(null),this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e?.lrucache&&(this.recentlyUsedQueries=e.lrucache),e?.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return this._parent?.loaded===!0?(this._initialiseFeatureSet(),this):(await this._parent?.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new ee({wkid:4326}),this.geometryType=ne.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(r=>(r&&r.name.toLowerCase()===e&&(n=r),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=me.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new y(f.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,a){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,r,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===c.NotEvaluated){if(A.applicationCache!==null){const e=A.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),A.applicationCache!==null&&A.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw A.applicationCache!==null&&A.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:c.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:c.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:c.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return c.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new y(f.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new y(f.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new y(f.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new E([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const a of e)this._featureFromCache(a)!==void 0&&r.push(this._featureFromCache(a));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,a){throw new y(f.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let a=r-e._candidates.length;if(e._candidates.length===0||a>=t)return e;if(await this._refineIfParentKnown(e,t-a,n),this._checkCancelled(n),this._refineKnowns(e,t-a),a=r-e._candidates.length,a0){const i=t-a,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-a),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}r!==null&&a.push(r);for(let i=a.length-1;i>=0;i--)e._candidates.splice(a[i].start,a[i].end-a[i].start+1)}_refineIfParentKnown(e,t,n){const r=new E([],[],e._ordered,null);return r._candidates=e._candidates.slice(),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=e._lastFetchedIndex;r=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=0;r=t)break}return!1}async _expandPagedSet(e,t,n,r,a){if(this._parent===null)throw new y(f.NotImplemented);return this._parent._expandPagedSet(e,t,n,r,a)}async _expandPagedSetFeatureSet(e,t,n,r,a){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(r=1),r===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(r=2),r===0)return"finished";const i=await this._getPage(e,r,a);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){r.length=r.length-1;let a=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],a++;e.pagesDefinition.resultOffset+=a;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&r.push("GETPAGES"),a}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let a=await this._stat(e,t,"",null,null,n,r);return a.calculated===!1&&(a=await this._manualStat(e,t,n,r)),a.result}async _manualStat(e,t,n,r){let a=null;switch(e.toLowerCase()){case"count":return a=await ke(this,r),{calculated:!0,result:a};case"distinct":return a=await Le(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await Ne(this,t,r),{calculated:!0,result:a};case"stdev":return a=await xe(this,t,r),{calculated:!0,result:a};case"variance":return a=await Ce(this,t,r),{calculated:!0,result:a};case"sum":return a=await Pe(this,t,r),{calculated:!0,result:a};case"min":return a=await ve(this,t,r),{calculated:!0,result:a};case"max":return a=await Re(this,t,r),{calculated:!0,result:a};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,a,i,l){const u=await this._parent._stat(e,t,n,r,a,i,l);return u.calculated===!1?a===null&&n===""&&r===null?this._manualStat(e,t,i,l):{calculated:!1}:u}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((r,a)=>{this._unionShapeInBatches(n,t,r,a)})}_unionAllGeom(e){return new Promise((t,n)=>{const r=this.iterator(this._defaultTracker(e)),a=[];this._unionShapeInBatches(a,r,t,n)})}_unionShapeInBatches(e,t,n,r){t.next().then(a=>{try{a!==null&&a.geometry!==null&&e.push(a.geometry),e.length>30||a===null&&e.length>1?ie(e).then(i=>{try{a===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,r))}catch(l){r(l)}},r):a===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(i){r(i)}},r)}iterator(e){return new Se(this,e)}intersection(e,t=!1){return p._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return p._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return p._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return p._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return p._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return p._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return p._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return p._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return p._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return p._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return p._featuresetFunctions.relate.bind(this)(e,t)}within(e){return p._featuresetFunctions.within.bind(this)(e)}touches(e){return p._featuresetFunctions.touches.bind(this)(e)}top(e){return p._featuresetFunctions.top.bind(this)(e)}crosses(e){return p._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return p._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return p._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return p._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return p._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return p._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((r,a)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,a,0)})}_reduceImpl(e,t,n,r,a,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,r,a,i,l)});e.next().then(u=>{try{if(u===null)a(n);else{const o=t(n,u,r,this);M(o)?o.then(d=>{this._reduceImpl(e,t,d,r+1,a,i,l)},i):this._reduceImpl(e,t,o,r+1,a,i,l)}}catch(o){i(o)}},i)}catch(u){i(u)}}removeField(e){return p._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return p._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=re(e);return this.reduce((a,i)=>i.geometry===null?0:t?le(i.geometry,r).then(l=>a+l):oe(i.geometry,r).then(l=>a+l),0,n)}sumLength(e,t=!1,n){const r=se(e);return this.reduce((a,i)=>i.geometry===null?0:t?ue(i.geometry,r).then(l=>a+l):ce(i.geometry,r).then(l=>a+l),0,n)}async distinct(e,t=1e3,n=null,r){await this.load();const a=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)})}_forEachImpl(e,t,n,r,a,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,r,a,i)},0);e.next().then(l=>{try{if(l===null)r(n);else{const u=t(l);u==null?this._forEachImpl(e,t,n,r,a,i):M(u)?u.then(()=>{try{this._forEachImpl(e,t,n,r,a,i)}catch(o){a(o)}},a):this._forEachImpl(e,t,n,r,a,i)}}catch(u){a(u)}},a)}catch(l){a(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{const a={geometry:r.geometry?.toJSON(),attributes:{}};for(const i in r.attributes)a.attributes[i]=r.attributes[i];return t.featureSet.features.push(a),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,r,a){return this._parent.queryAttachments(e,t,n,r,a)}serviceUrl(){return this._parent.serviceUrl()}subtypeMetaData(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const r=this.schema();return r.features=n,r.spatialReference=this.spatialReference.toJSON(),JSON.stringify(r)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return e?.featureset==="keeptype"?this:e?.featureset==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if(t?.featureset==="keeptype")return this;if(t?.featureset==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if(t?.featureset==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?t?.keepGeometryType===!0?i.geometry:i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&t?.keepGeometryType!==!0&&delete l.geometry.spatialReference,n.push(l),1},0,e);const r=this.schema();return r.features=n,r.spatialReference=t?.keepGeometryType===!0?this.spatialReference:this.spatialReference?.toJSON(),r}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){return this.fsetInfo??await this._parent?.getFeatureSetInfo()??null}}function D(s,e){if(e!==null){const t={};for(const n in e)t[n.toLowerCase()]=e[n];s.parameters=t}}p._featuresetFunctions={};class b extends p{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new E([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=c.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new y(f.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new y(f.NeverReach)}async _getFilteredSet(){return new E([],[],!1,null)}_stat(e,t,n,r,a,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends p{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new E(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return H(Z(this._relationGeom),Z(e.geometry));case"esriSpatialRelIntersects":return H(this._relationGeom,e.geometry);case"esriSpatialRelContains":return ge(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return _e(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return fe(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return pe(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return de(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return he(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){const r=new E([],e,!1,null),a=Math.min(t,e.length);await this._parent?._getFeatures(r,-1,a,n),this._checkCancelled(n);const i=[];for(let l=0;lY.fromJSON(T))}writeRestrictionAttributes(e,r,n){e!=null&&(r[n]=e.map(T=>Y.toJSON(T)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([j(ie,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([j(O,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([A("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([j(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([j(re,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([j(te)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([j(ee)],d.prototype,"uturnAtJunctions",void 0),d=t([S("esri.rest.support.TravelMode")],d);const se=d;let v=class extends g{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(r=>O.fromJSON(r))}writeAccumulateAttributes(e,r,n){e?.length&&(r[n]=e.map(T=>O.toJSON(T)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([A("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:se,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([S("esri.rest.support.RouteSettings")],v);const ae=v;var _;let a=_=class extends D(g){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,r){return r.attributes.EndTimeUTC!=null?new Date(r.attributes.EndTimeUTC):null}readEndTimeOffset(e,r){return B(r.attributes.EndTime,r.attributes.EndTimeUTC)}readStartTime(e,r){return r.attributes.StartTimeUTC!=null?new Date(r.attributes.StartTimeUTC):null}readStartTimeOffset(e,r){return B(r.attributes.StartTime,r.attributes.StartTimeUTC)}readTotalCosts(e,r){return f(r.attributes,"Total_")}readTotalViolations(e,r){return f(r.attributes,"TotalViolation_")}readTotalWait(e,r){return f(r.attributes,"TotalWait_")}static fromGraphic(e){return new _({analysisSettings:e.attributes.AnalysisSettings!=null?ae.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?F(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(U(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};a.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}],t([i()],a.prototype,"analysisSettings",void 0),t([i()],a.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],a.prototype,"readEndTime",null),t([i()],a.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],a.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],a.prototype,"firstStopId",void 0),t([i({type:K})],a.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],a.prototype,"lastStopId",void 0),t([i()],a.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],a.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],a.prototype,"objectId",void 0),t([i({type:C})],a.prototype,"popupTemplate",void 0),t([i()],a.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],a.prototype,"readStartTime",null),t([i()],a.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],a.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],a.prototype,"stopCount",void 0),t([i({types:I})],a.prototype,"symbol",void 0),t([i()],a.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],a.prototype,"readTotalCosts",null),t([i()],a.prototype,"totalDistance",void 0),t([i()],a.prototype,"totalDuration",void 0),t([i()],a.prototype,"totalLateDuration",void 0),t([i()],a.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],a.prototype,"readTotalViolations",null),t([i()],a.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],a.prototype,"readTotalWait",null),t([i()],a.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),t([i()],a.prototype,"version",void 0),a=_=t([S("esri.rest.support.RouteInfo")],a);const Ne=a;var G;let s=G=class extends D(g){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,r){return B(r.attributes.ArriveTime,r.attributes.ArriveTimeUTC)}readCumulativeCosts(e,r){return f(r.attributes,"Cumul_")}readDepartTimeOffset(e,r){return B(r.attributes.DepartTime,r.attributes.DepartTimeUTC)}readServiceCosts(e,r){return f(r.attributes,"Attr_")}writeServiceCosts(e,r){H(e,r,"Attr_")}writeTimeWindowEnd(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowStart=e.getTime())}readViolations(e,r){return f(r.attributes,"Violation_")}readWait(e,r){return f(r.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?m.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?F(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?m.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?E.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?F(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?m.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(U(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?m.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?E.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(U(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?N.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};s.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}],t([i({type:m.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:m.read}}})],s.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],s.prototype,"arriveTime",void 0),t([i()],s.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],s.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],s.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],s.prototype,"bearingTol",void 0),t([i()],s.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],s.prototype,"readCumulativeCosts",null),t([i()],s.prototype,"cumulativeDistance",void 0),t([i()],s.prototype,"cumulativeDuration",void 0),t([i({type:m.apiValues,json:{name:"attributes.CurbApproach",read:{reader:m.read},write:{writer:m.write}}})],s.prototype,"curbApproach",void 0),t([i({type:m.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:m.read}}})],s.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],s.prototype,"departTime",void 0),t([i()],s.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],s.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],s.prototype,"distanceToNetworkInMeters",void 0),t([i({type:z,json:{write:!0}})],s.prototype,"geometry",void 0),t([i()],s.prototype,"lateDuration",void 0),t([i({type:E.apiValues,json:{name:"attributes.LocationType",read:{reader:E.read},write:{writer:E.write}}})],s.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],s.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],s.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],s.prototype,"objectId",void 0),t([i({type:C})],s.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],s.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],s.prototype,"routeName",void 0),t([i()],s.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],s.prototype,"readServiceCosts",null),t([A("serviceCosts")],s.prototype,"writeServiceCosts",null),t([i()],s.prototype,"serviceDistance",void 0),t([i()],s.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],s.prototype,"sequence",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],s.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],s.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],s.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],s.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],s.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],s.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],s.prototype,"status",void 0),t([i({types:I})],s.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],s.prototype,"timeWindowEnd",void 0),t([A("timeWindowEnd")],s.prototype,"writeTimeWindowEnd",null),t([i()],s.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],s.prototype,"timeWindowStart",void 0),t([A("timeWindowStart")],s.prototype,"writeTimeWindowStart",null),t([i()],s.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"type",void 0),t([i()],s.prototype,"violations",void 0),t([p("violations",["attributes"])],s.prototype,"readViolations",null),t([i()],s.prototype,"waitDuration",void 0),t([i()],s.prototype,"wait",void 0),t([p("wait",["attributes"])],s.prototype,"readWait",null),s=G=t([S("esri.rest.support.Stop")],s);const De=s;export{ee as $,O as A,De as N,re as Q,ge as S,be as T,Y as V,B as W,Q as Z,le as a,he as b,ye as c,me as d,se as e,Se as f,Ne as g,ve as h,ce as m,pe as n,ue as o,ne as s,ae as t,de as u,fe as v,Te as y}; diff --git a/main/assets/Stop-he5xSAJJ-B5QVbzdn.js b/main/assets/Stop-he5xSAJJ-B5QVbzdn.js deleted file mode 100644 index 0650cff77..000000000 --- a/main/assets/Stop-he5xSAJJ-B5QVbzdn.js +++ /dev/null @@ -1 +0,0 @@ -import{d2 as o,aa as D,bi as w,v as t,S as i,m as K,bL as C,en as I,i as S,a0 as p,w as z,ac as A,l as Z,bz as j,e as g}from"./main-BZaw9FpY.js";const $={esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriUnknownUnits:"unknown",esriYards:"yards"},Q=o()($);o()({...$,esriIntFeet:"international-feet",esriIntInches:"international-inches",esriIntMiles:"international-miles",esriIntNauticalMiles:"international-nautical-miles",esriIntYards:"international-yards"}),o()({esriAcres:"international-acres",esriAcresUS:"us-acres",esriAres:"ares",esriHectares:"hectares",esriSquareCentimeters:"square-centimeters",esriSquareDecimeters:"square-decimeters",esriSquareFeet:"square-international-feet",esriSquareFeetUS:"square-us-feet",esriSquareInches:"square-international-inches",esriSquareInchesUS:"square-us-inches",esriSquareKilometers:"square-kilometers",esriSquareMeters:"square-meters",esriSquareMiles:"square-international-miles",esriSquareMilesUS:"square-us-miles",esriSquareMillimeters:"square-millimeters",esriSquareYards:"square-international-yards",esriSquareYardsUS:"square-us-yards",esriUnknownAreaUnits:"unknown"});const ne=o()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards"});o()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"});const le=o()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards",esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds",esriNAUKilometersPerHour:"kilometers-per-hour",esriNAUMilesPerHour:"miles-per-hour",esriNAUUnknown:"unknown"}),ue=o()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),pe=o()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});o()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const ee=o()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});o()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"}),o()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const te=o()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),m=o()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),E=o()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),N=o()({0:"ok",1:"not-located",2:"network-element-not-located",3:"element-not-traversable",4:"invalid-field-values",5:"not-reached",6:"time-window-violation",7:"not-located-on-closest"},{useNumericKeys:!0}),k=o()({1:"right",2:"left"},{useNumericKeys:!0}),h=o()({0:"restriction",1:"scaled-cost",2:"added-cost"},{useNumericKeys:!0}),W=o()({0:"permit",1:"restrict"},{useNumericKeys:!0}),L=o()({1:"header",50:"arrive",51:"depart",52:"straight",100:"on-ferry",101:"off-ferry",102:"central-fork",103:"roundabout",104:"u-turn",150:"door",151:"stairs",152:"elevator",153:"escalator",154:"pedestrian-ramp",200:"left-fork",201:"left-ramp",202:"clockwise-roundabout",203:"left-handed-u-turn",204:"bear-left",205:"left-turn",206:"sharp-left",207:"left-turn-and-immediate-left-turn",208:"left-turn-and-immediate-right-turn",300:"right-fork",301:"right-ramp",302:"counter-clockwise-roundabout",303:"right-handed-u-turn",304:"bear-right",305:"right-turn",306:"sharp-right",307:"right-turn-and-immediate-left-turn",308:"right-turn-and-immediate-right-turn",400:"up-elevator",401:"up-escalator",402:"up-stairs",500:"down-elevator",501:"down-escalator",502:"down-stairs",1e3:"general-event",1001:"landmark",1002:"time-zone-change",1003:"traffic-event",1004:"scaled-cost-barrier-event",1005:"boundary-crossing",1006:"restriction-violation",1007:"lane"},{useNumericKeys:!0}),J=o()({0:"unknown",1:"segment",2:"maneuver-segment",3:"restriction-violation",4:"scaled-cost-barrier",5:"heavy-traffic",6:"slow-traffic",7:"moderate-traffic"},{useNumericKeys:!0}),de=o()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),ie=o()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),re=o()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),O=o()({Kilometers:"kilometers",Miles:"miles",Meters:"meters",Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),Y=o()({"Any Hazmat Prohibited":"any-hazmat-prohibited","Avoid Carpool Roads":"avoid-carpool-roads","Avoid Express Lanes":"avoid-express-lanes","Avoid Ferries":"avoid-ferries","Avoid Gates":"avoid-gates","Avoid Limited Access Roads":"avoid-limited-access-roads","Avoid Private Roads":"avoid-private-roads","Avoid Roads Unsuitable for Pedestrians":"avoid-roads-unsuitable-for-pedestrians","Avoid Stairways":"avoid-stairways","Avoid Toll Roads":"avoid-toll-roads","Avoid Toll Roads for Trucks":"avoid-toll-roads-for-trucks","Avoid Truck Restricted Roads":"avoid-truck-restricted-roads","Avoid Unpaved Roads":"avoid-unpaved-roads","Axle Count Restriction":"axle-count-restriction","Driving a Bus":"driving-a-bus","Driving a Taxi":"driving-a-taxi","Driving a Truck":"driving-a-truck","Driving an Automobile":"driving-an-automobile","Driving an Emergency Vehicle":"driving-an-emergency-vehicle","Height Restriction":"height-restriction","Kingpin to Rear Axle Length Restriction":"kingpin-to-rear-axle-length-restriction","Length Restriction":"length-restriction","Preferred for Pedestrians":"preferred-for-pedestrians","Riding a Motorcycle":"riding-a-motorcycle","Roads Under Construction Prohibited":"roads-under-construction-prohibited","Semi or Tractor with One or More Trailers Prohibited":"semi-or-tractor-with-one-or-more-trailers-prohibited","Single Axle Vehicles Prohibited":"single-axle-vehicles-prohibited","Tandem Axle Vehicles Prohibited":"tandem-axle-vehicles-prohibited","Through Traffic Prohibited":"through-traffic-prohibited","Truck with Trailers Restriction":"truck-with-trailers-restriction","Use Preferred Hazmat Routes":"use-preferred-hazmat-routes","Use Preferred Truck Routes":"use-preferred-truck-routes",Walking:"walking","Weight Restriction":"weight-restriction"},{ignoreUnknown:!1}),me=o()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),ce=o()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),ye=o()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),Te=o()({esriDSTAltName:"alt-name",esriDSTArrive:"arrive",esriDSTBranch:"branch",esriDSTCrossStreet:"cross-street",esriDSTCumulativeLength:"cumulative-length",esriDSTDepart:"depart",esriDSTEstimatedArrivalTime:"estimated-arrival-time",esriDSTExit:"exit",esriDSTGeneral:"general",esriDSTLength:"length",esriDSTServiceTime:"service-time",esriDSTStreetName:"street-name",esriDSTSummary:"summary",esriDSTTime:"time",esriDSTTimeWindow:"time-window",esriDSTToward:"toward",esriDSTViolationTime:"violation-time",esriDSTWaitTime:"wait-time"});var P;let c=P=class extends D(g){constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static fromGraphic(e){return new P({directionLineType:J.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:this.directionLineType!=null?J.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return this.fromLevel!=null&&(e.FromLevel=this.fromLevel),this.toLevel!=null&&(e.ToLevel=this.toLevel),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};c.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger"},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger"},{name:"FromLevel",alias:"From Level",type:"esriFieldTypeInteger"},{name:"Meters",alias:"Meters",type:"esriFieldTypeDouble"},{name:"Minutes",alias:"Minutes",type:"esriFieldTypeDouble"},{name:"ToLevel",alias:"To Level",type:"esriFieldTypeInteger"}],t([i({type:J.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:J.read}}})],c.prototype,"directionLineType",void 0),t([i({json:{read:{source:"attributes.DirectionPointID"}}})],c.prototype,"directionPointId",void 0),t([i({json:{read:{source:"attributes.Meters"}}})],c.prototype,"distance",void 0),t([i({json:{read:{source:"attributes.Minutes"}}})],c.prototype,"duration",void 0),t([i({json:{read:{source:"attributes.FromLevel"}}})],c.prototype,"fromLevel",void 0),t([i({type:K})],c.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],c.prototype,"objectId",void 0),t([i({type:C})],c.prototype,"popupTemplate",void 0),t([i({types:I})],c.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.ToLevel"}}})],c.prototype,"toLevel",void 0),t([i({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0),c=P=t([S("esri.rest.support.DirectionLine")],c);const be=c;var R;let l=R=class extends D(g){constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(e,r){return r.attributes.ArrivalTime!=null?new Date(r.attributes.ArrivalTime):null}static fromGraphic(e){return new R({alternateName:e.attributes.AlternateName??null,arrivalTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:e.attributes.ArrivalUTCOffset??null,azimuth:e.attributes.Azimuth??null,branchName:e.attributes.BranchName??null,directionPointType:L.fromJSON(e.attributes.DirectionPointType),displayText:e.attributes.DisplayText??null,exitName:e.attributes.ExitName??null,geometry:e.geometry,intersectingName:e.attributes.IntersectingName??null,level:e.attributes.Level??null,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:e.attributes.ShortVoiceInstruction??null,stopId:e.attributes.StopID??null,symbol:e.symbol,towardName:e.attributes.TowardName??null,voiceInstruction:e.attributes.VoiceInstruction??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionPointType:this.directionPointType!=null?L.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return this.alternateName!=null&&(e.AlternateName=this.alternateName),this.arrivalTime!=null&&(e.ArrivalTime=this.arrivalTime.getTime()),this.arrivalTimeOffset!=null&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),this.azimuth!=null&&(e.Azimuth=this.azimuth),this.branchName!=null&&(e.BranchName=this.branchName),this.displayText!=null&&(e.DisplayText=this.displayText),this.exitName!=null&&(e.ExitName=this.exitName),this.intersectingName!=null&&(e.IntersectingName=this.intersectingName),this.level!=null&&(e.Level=this.level),this.name!=null&&(e.Name=this.name),this.shortVoiceInstruction!=null&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),this.towardName!=null&&(e.TowardName=this.towardName),this.voiceInstruction!=null&&(e.VoiceInstruction=this.voiceInstruction),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};l.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AlternateName",alias:"Alternative Name",type:"esriFieldTypeString"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time Offset",type:"esriFieldTypeInteger"},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble"},{name:"BranchName",alias:"Branch Name",type:"esriFieldTypeString"},{name:"DirectionPointType",alias:"Directions Point Type",type:"esriFieldTypeInteger"},{name:"DisplayText",alias:"Display Text",type:"esriFieldTypeString"},{name:"ExitName",alias:"Exit Name",type:"esriFieldTypeString"},{name:"IntersectingName",alias:"Intersecting Name",type:"esriFieldTypeString"},{name:"Level",alias:"Level",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ShortVoiceInstruction",alias:"Short Voice Instruction",type:"esriFieldTypeString"},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger"},{name:"TowardName",alias:"Toward Name",type:"esriFieldTypeString"},{name:"VoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString"}],t([i({json:{read:{source:"attributes.AlternateName"}}})],l.prototype,"alternateName",void 0),t([i()],l.prototype,"arrivalTime",void 0),t([p("arrivalTime",["attributes.ArrivalTime"])],l.prototype,"readArrivalTime",null),t([i({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],l.prototype,"arrivalTimeOffset",void 0),t([i({json:{read:{source:"attributes.Azimuth"}}})],l.prototype,"azimuth",void 0),t([i({json:{read:{source:"attributes.BranchName"}}})],l.prototype,"branchName",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:L.read}}})],l.prototype,"directionPointType",void 0),t([i({json:{read:{source:"attributes.DisplayText"}}})],l.prototype,"displayText",void 0),t([i({json:{read:{source:"attributes.ExitName"}}})],l.prototype,"exitName",void 0),t([i({type:z})],l.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.IntersectingName"}}})],l.prototype,"intersectingName",void 0),t([i({json:{read:{source:"attributes.Level"}}})],l.prototype,"level",void 0),t([i({json:{read:{source:"attributes.Name"}}})],l.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],l.prototype,"objectId",void 0),t([i({type:C})],l.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.Sequence"}}})],l.prototype,"sequence",void 0),t([i({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],l.prototype,"shortVoiceInstruction",void 0),t([i({json:{read:{source:"attributes.StopID"}}})],l.prototype,"stopId",void 0),t([i({types:I})],l.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.TowardName"}}})],l.prototype,"towardName",void 0),t([i({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),t([i({json:{read:{source:"attributes.VoiceInstruction"}}})],l.prototype,"voiceInstruction",void 0),l=R=t([S("esri.rest.support.DirectionPoint")],l);const he=l;function f(e,r){if(e==null)return null;const n={},T=new RegExp(`^${r}`,"i");for(const M of Object.keys(e))if(T.test(M)){const X=M.slice(r.length);n[O.fromJSON(X)]=e[M]}return n}function H(e,r,n){if(e!=null){r.attributes||(r.attributes={});for(const T in e){const M=O.toJSON(T);r.attributes[`${n}${M}`]=e[T]}}}function F(e){const r={};for(const n of Object.keys(e)){const T=n;r[O.fromJSON(T)]=e[n]}return r}function U(e){const r={};for(const n of Object.keys(e)){const T=n;r[O.toJSON(T)]=e[n]}return r}function B(e,r){return e==null||r==null?null:Math.round((e-r)/6e4)}function ve(e){const r=e.toJSON(),n=r;return n.accumulateAttributeNames&&=r.accumulateAttributeNames?.join(),n.attributeParameterValues&&=JSON.stringify(r.attributeParameterValues),n.barriers&&=JSON.stringify(r.barriers),n.outSR&&=r.outSR?.wkid,n.overrides&&=JSON.stringify(r.overrides),n.polygonBarriers&&=JSON.stringify(r.polygonBarriers),n.polylineBarriers&&=JSON.stringify(r.polylineBarriers),n.restrictionAttributeNames&&=r.restrictionAttributeNames?.join(),n.stops&&=JSON.stringify(r.stops),n.travelMode&&=JSON.stringify(r.travelMode),n}var V;let u=V=class extends D(g){constructor(e){super(e),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(e,r){return f(r.attributes,"Attr_")}writeCosts(e,r){H(e,r,"Attr_")}static fromGraphic(e){return new V({addedCost:e.attributes.AddedCost??null,barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,fullEdge:e.attributes.FullEdge!=null?W.fromJSON(e.attributes.FullEdge):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,FullEdge:this.fullEdge!=null?W.toJSON(this.fullEdge):null,Name:this.name,Status:this.status!=null?N.toJSON(this.status):null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};u.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"}],t([i()],u.prototype,"addedCost",void 0),t([i({type:h.apiValues,json:{name:"attributes.BarrierType",read:{reader:h.read},write:{writer:h.write}}})],u.prototype,"barrierType",void 0),t([i()],u.prototype,"costs",void 0),t([p("costs",["attributes"])],u.prototype,"readCosts",null),t([A("costs")],u.prototype,"writeCosts",null),t([i({constructOnly:!0,type:m.apiValues,json:{read:{source:"attributes.CurbApproach",reader:m.read}}})],u.prototype,"curbApproach",void 0),t([i({type:W.apiValues,json:{name:"attributes.FullEdge",read:{reader:W.read},write:{writer:W.write}}})],u.prototype,"fullEdge",void 0),t([i({type:z,json:{write:!0}})],u.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],u.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],u.prototype,"objectId",void 0),t([i({type:C})],u.prototype,"popupTemplate",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],u.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],u.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],u.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],u.prototype,"status",void 0),t([i({types:I})],u.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],u.prototype,"type",void 0),u=V=t([S("esri.rest.support.PointBarrier")],u);const fe=u;var x;let y=x=class extends D(g){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(e,r){return f(r.attributes,"Attr_")}writeCosts(e,r){H(e,r,"Attr_")}static fromGraphic(e){return new x({barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};y.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}],t([i({type:h.apiValues,json:{name:"attributes.BarrierType",read:{reader:h.read},write:{writer:h.write}}})],y.prototype,"barrierType",void 0),t([i()],y.prototype,"costs",void 0),t([p("costs",["attributes"])],y.prototype,"readCosts",null),t([A("costs")],y.prototype,"writeCosts",null),t([i({type:Z,json:{write:!0}})],y.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],y.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],y.prototype,"objectId",void 0),t([i({type:C})],y.prototype,"popupTemplate",void 0),t([i()],y.prototype,"scaleFactor",void 0),t([i({types:I})],y.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],y.prototype,"type",void 0),y=x=t([S("esri.rest.support.PolygonBarrier")],y);const Se=y;var q;let b=q=class extends D(g){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(e,r){return f(r.attributes,"Attr_")}static fromGraphic(e){return new q({barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};b.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}],t([i({type:h.apiValues,json:{read:{source:"attributes.BarrierType",reader:h.read}}})],b.prototype,"barrierType",void 0),t([i()],b.prototype,"costs",void 0),t([p("costs",["attributes"])],b.prototype,"readCosts",null),t([i({type:K,json:{write:!0}})],b.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],b.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],b.prototype,"objectId",void 0),t([i({type:C})],b.prototype,"popupTemplate",void 0),t([i()],b.prototype,"scaleFactor",void 0),t([i({types:I})],b.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),b=q=t([S("esri.rest.support.PolylineBarrier")],b);const ge=b;let d=class extends D(g){constructor(e){super(e),this.attributeParameterValues=null,this.description=null,this.distanceAttributeName=null,this.id=null,this.impedanceAttributeName=null,this.name=null,this.restrictionAttributeNames=null,this.simplificationTolerance=null,this.simplificationToleranceUnits=null,this.timeAttributeName=null,this.type=null,this.useHierarchy=null,this.uturnAtJunctions=null}readId(e,r){return r.id??r.itemId??null}readRestrictionAttributes(e,r){const{restrictionAttributeNames:n}=r;return n==null?null:n.map(T=>Y.fromJSON(T))}writeRestrictionAttributes(e,r,n){e!=null&&(r[n]=e.map(T=>Y.toJSON(T)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([j(ie,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([j(O,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([A("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([j(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([j(re,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([j(te)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([j(ee)],d.prototype,"uturnAtJunctions",void 0),d=t([S("esri.rest.support.TravelMode")],d);const se=d;let v=class extends g{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(r=>O.fromJSON(r))}writeAccumulateAttributes(e,r,n){e?.length&&(r[n]=e.map(T=>O.toJSON(T)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([A("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:se,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([S("esri.rest.support.RouteSettings")],v);const ae=v;var _;let a=_=class extends D(g){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,r){return r.attributes.EndTimeUTC!=null?new Date(r.attributes.EndTimeUTC):null}readEndTimeOffset(e,r){return B(r.attributes.EndTime,r.attributes.EndTimeUTC)}readStartTime(e,r){return r.attributes.StartTimeUTC!=null?new Date(r.attributes.StartTimeUTC):null}readStartTimeOffset(e,r){return B(r.attributes.StartTime,r.attributes.StartTimeUTC)}readTotalCosts(e,r){return f(r.attributes,"Total_")}readTotalViolations(e,r){return f(r.attributes,"TotalViolation_")}readTotalWait(e,r){return f(r.attributes,"TotalWait_")}static fromGraphic(e){return new _({analysisSettings:e.attributes.AnalysisSettings!=null?ae.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?F(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(U(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};a.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}],t([i()],a.prototype,"analysisSettings",void 0),t([i()],a.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],a.prototype,"readEndTime",null),t([i()],a.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],a.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],a.prototype,"firstStopId",void 0),t([i({type:K})],a.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],a.prototype,"lastStopId",void 0),t([i()],a.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],a.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],a.prototype,"objectId",void 0),t([i({type:C})],a.prototype,"popupTemplate",void 0),t([i()],a.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],a.prototype,"readStartTime",null),t([i()],a.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],a.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],a.prototype,"stopCount",void 0),t([i({types:I})],a.prototype,"symbol",void 0),t([i()],a.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],a.prototype,"readTotalCosts",null),t([i()],a.prototype,"totalDistance",void 0),t([i()],a.prototype,"totalDuration",void 0),t([i()],a.prototype,"totalLateDuration",void 0),t([i()],a.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],a.prototype,"readTotalViolations",null),t([i()],a.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],a.prototype,"readTotalWait",null),t([i()],a.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),t([i()],a.prototype,"version",void 0),a=_=t([S("esri.rest.support.RouteInfo")],a);const Ne=a;var G;let s=G=class extends D(g){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,r){return B(r.attributes.ArriveTime,r.attributes.ArriveTimeUTC)}readCumulativeCosts(e,r){return f(r.attributes,"Cumul_")}readDepartTimeOffset(e,r){return B(r.attributes.DepartTime,r.attributes.DepartTimeUTC)}readServiceCosts(e,r){return f(r.attributes,"Attr_")}writeServiceCosts(e,r){H(e,r,"Attr_")}writeTimeWindowEnd(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowStart=e.getTime())}readViolations(e,r){return f(r.attributes,"Violation_")}readWait(e,r){return f(r.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?m.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?F(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?m.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?E.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?F(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?m.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(U(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?m.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?E.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(U(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?N.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};s.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}],t([i({type:m.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:m.read}}})],s.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],s.prototype,"arriveTime",void 0),t([i()],s.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],s.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],s.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],s.prototype,"bearingTol",void 0),t([i()],s.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],s.prototype,"readCumulativeCosts",null),t([i()],s.prototype,"cumulativeDistance",void 0),t([i()],s.prototype,"cumulativeDuration",void 0),t([i({type:m.apiValues,json:{name:"attributes.CurbApproach",read:{reader:m.read},write:{writer:m.write}}})],s.prototype,"curbApproach",void 0),t([i({type:m.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:m.read}}})],s.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],s.prototype,"departTime",void 0),t([i()],s.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],s.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],s.prototype,"distanceToNetworkInMeters",void 0),t([i({type:z,json:{write:!0}})],s.prototype,"geometry",void 0),t([i()],s.prototype,"lateDuration",void 0),t([i({type:E.apiValues,json:{name:"attributes.LocationType",read:{reader:E.read},write:{writer:E.write}}})],s.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],s.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],s.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],s.prototype,"objectId",void 0),t([i({type:C})],s.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],s.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],s.prototype,"routeName",void 0),t([i()],s.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],s.prototype,"readServiceCosts",null),t([A("serviceCosts")],s.prototype,"writeServiceCosts",null),t([i()],s.prototype,"serviceDistance",void 0),t([i()],s.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],s.prototype,"sequence",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],s.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],s.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],s.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],s.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],s.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],s.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],s.prototype,"status",void 0),t([i({types:I})],s.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],s.prototype,"timeWindowEnd",void 0),t([A("timeWindowEnd")],s.prototype,"writeTimeWindowEnd",null),t([i()],s.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],s.prototype,"timeWindowStart",void 0),t([A("timeWindowStart")],s.prototype,"writeTimeWindowStart",null),t([i()],s.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"type",void 0),t([i()],s.prototype,"violations",void 0),t([p("violations",["attributes"])],s.prototype,"readViolations",null),t([i()],s.prototype,"waitDuration",void 0),t([i()],s.prototype,"wait",void 0),t([p("wait",["attributes"])],s.prototype,"readWait",null),s=G=t([S("esri.rest.support.Stop")],s);const De=s;export{ee as $,O as A,De as N,re as Q,ge as S,be as T,Y as V,B as W,Q as Z,le as a,he as b,ye as c,me as d,se as e,Se as f,Ne as g,ve as h,ce as m,pe as n,ue as o,ne as s,ae as t,de as u,fe as v,Te as y}; diff --git a/main/assets/StreamLayer-Bqnt-d3H-D6cxPEIX.js b/main/assets/StreamLayer-Bqnt-d3H-D6cxPEIX.js deleted file mode 100644 index 03c80c276..000000000 --- a/main/assets/StreamLayer-Bqnt-d3H-D6cxPEIX.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./streamLayerUtils-CLc_16nt-ChUYwAu8.js","./utils-BVWK2jiA-Ewzf326n.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./jsonContext-BA8GHqVk-BMETb6sX.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js","./createConnection-CrkuTLXs-CU9LZMAw.js","./query-DFW9-NG_-1nHUNdNu.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js","./pbf-D-y3_eZO-BOjQwfR-.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./Query-BrwMGK8U-sojFdYaD.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js"])))=>i.map(i=>d[i]); -import{v as t,S as r,i as I,aa as F,J as x,bp as P,o as l,W as D,bT as f,a1 as O,_ as v,bW as h,bo as A,f as k,em as $,n as C,bB as g,bL as L,a0 as w,P as U,e as N}from"./main-BZaw9FpY.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{o as V,m as G,u as J}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as M}from"./Layer-ChoECxvZ-C4wLrCej.js";import{a as W}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as z}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as Y}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{l as H}from"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import{v as Q}from"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import{E as B}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as K}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as X}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as Z}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as ee}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{Y as te,_ as ie,n as re,t as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{p as pe}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{y as le}from"./Field-C6hA1tZj-CbELM0zp.js";import{f as de}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{C as me,q as ce}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{g as ue}from"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import{b as he}from"./Query-BrwMGK8U-sojFdYaD.js";import{w as ye}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{q as fe}from"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import{E as m}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";var y;let a=y=class extends N{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new y({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],a.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"maxObservations",void 0),a=y=t([I("esri.layers.support.PurgeOptions")],a);const R=a,b=de();function S(e,o){return new l("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends Q(H(z(ee(Z(X(W(B(K(q(Y(F(M)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new R,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=x.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=P(async(o,s,n)=>{const{save:p,saveAs:c}=await v(()=>import("./streamLayerUtils-CLc_16nt-ChUYwAu8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);switch(o){case m.SAVE:return p(this,s);case m.SAVE_AS:return c(this,n,s)}})}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new l("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(D).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){f(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){o=o.layerDefinition||o;const n=o.drawingInfo?.renderer;if(n){const p=V(n,o,s)||void 0;return p||O.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),p}return pe(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([v(()=>import("./createConnection-CrkuTLXs-CU9LZMAw.js"),__vite__mapDeps([12,2,3,9,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26]),import.meta.url),this.load()]),s=this.geometryType?h.toJSON(this.geometryType):null,{customParameters:n=null,definitionExpression:p=null,geometryDefinition:c=null,maxReconnectionAttempts:j=0,maxReconnectionInterval:T=20,spatialReference:_=this.spatialReference}=e||this.createConnectionParameters(),d=o(this.parsedUrl,this.spatialReference,_,s,p,c,j,T,n??void 0),E=A([this.on("send-message-to-socket",u=>d.sendMessageToSocket(u)),this.on("send-message-to-client",u=>d.sendMessageToClient(u))]);return d.once("destroy",E.remove),d}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return ye(this,e)}createQuery(){const e=new he;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(n=>(n.name===e&&(s=n.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(m.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(m.SAVE_AS,o,e)}write(e,o){const s=o?.messages;return this.webSocketUrl?(s?.push(S(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s?.push(S(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:o}=await k(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=o}}else{if(!this.timeInfo?.trackIdField)throw new l("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const o=this.fields.find(s=>s.type==="oid")?.name;if(!o)throw new l("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=o}if(!this.fields)throw new l("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(o=>o.name===this.objectIdField)||this.fields.push(new le({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new l("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),f(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),ue(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:fe})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(b.fields)],i.prototype,"fields",void 0),t([r(b.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:C,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:h.apiValues,json:{read:{reader:h.read}}})],i.prototype,"geometryType",void 0),t([r(te)],i.prototype,"labelsVisible",void 0),t([r({type:[me],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ce},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(ie)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([r({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([r(re)],i.prototype,"maxScale",void 0),t([r(oe)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r({readOnly:!0})],i.prototype,"outFields",void 0),t([r(se)],i.prototype,"popupEnabled",void 0),t([r({type:L,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:R})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:G,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:J,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r((()=>{const e=U(ne);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:x,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(ae)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([I("esri.layers.StreamLayer")],i);const Et=i;export{Et as default}; diff --git a/main/assets/StreamLayer-Bqnt-d3H-ZHpoIWVk.js b/main/assets/StreamLayer-Bqnt-d3H-ZHpoIWVk.js new file mode 100644 index 000000000..2f9791468 --- /dev/null +++ b/main/assets/StreamLayer-Bqnt-d3H-ZHpoIWVk.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./streamLayerUtils-CLc_16nt-Iuch08zD.js","./utils-BVWK2jiA-D8rVYIEJ.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./jsonContext-BA8GHqVk-DpBf0bCt.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js","./createConnection-CrkuTLXs-BPFNVKMW.js","./query-DFW9-NG_-CfusC8cS.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js","./pbf-D-y3_eZO-SEvl9j6c.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./Query-BrwMGK8U-DV_czrJX.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js"])))=>i.map(i=>d[i]); +import{v as t,S as r,i as I,aa as F,J as x,bp as P,o as l,W as D,bT as f,a1 as O,_ as v,bW as h,bo as A,f as k,em as $,n as C,bB as g,bL as L,a0 as w,P as U,e as N}from"./main-C7yV2j71.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{o as V,m as G,u as J}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as M}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{a as W}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as z}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as Y}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{l as H}from"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import{v as Q}from"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import{E as B}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as K}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as X}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as Z}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as ee}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{Y as te,_ as ie,n as re,t as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{p as pe}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{y as le}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{f as de}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{C as me,q as ce}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{g as ue}from"./styleUtils-ChrJTYIw-OCRItq_6.js";import{b as he}from"./Query-BrwMGK8U-DV_czrJX.js";import{w as ye}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{q as fe}from"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import{E as m}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";var y;let a=y=class extends N{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new y({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],a.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"maxObservations",void 0),a=y=t([I("esri.layers.support.PurgeOptions")],a);const R=a,b=de();function S(e,o){return new l("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends Q(H(z(ee(Z(X(W(B(K(q(Y(F(M)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new R,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=x.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=P(async(o,s,n)=>{const{save:p,saveAs:c}=await v(()=>import("./streamLayerUtils-CLc_16nt-Iuch08zD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);switch(o){case m.SAVE:return p(this,s);case m.SAVE_AS:return c(this,n,s)}})}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new l("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(D).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){f(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){o=o.layerDefinition||o;const n=o.drawingInfo?.renderer;if(n){const p=V(n,o,s)||void 0;return p||O.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),p}return pe(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([v(()=>import("./createConnection-CrkuTLXs-BPFNVKMW.js"),__vite__mapDeps([12,2,3,9,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26]),import.meta.url),this.load()]),s=this.geometryType?h.toJSON(this.geometryType):null,{customParameters:n=null,definitionExpression:p=null,geometryDefinition:c=null,maxReconnectionAttempts:j=0,maxReconnectionInterval:T=20,spatialReference:_=this.spatialReference}=e||this.createConnectionParameters(),d=o(this.parsedUrl,this.spatialReference,_,s,p,c,j,T,n??void 0),E=A([this.on("send-message-to-socket",u=>d.sendMessageToSocket(u)),this.on("send-message-to-client",u=>d.sendMessageToClient(u))]);return d.once("destroy",E.remove),d}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return ye(this,e)}createQuery(){const e=new he;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(n=>(n.name===e&&(s=n.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(m.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(m.SAVE_AS,o,e)}write(e,o){const s=o?.messages;return this.webSocketUrl?(s?.push(S(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s?.push(S(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:o}=await k(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=o}}else{if(!this.timeInfo?.trackIdField)throw new l("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const o=this.fields.find(s=>s.type==="oid")?.name;if(!o)throw new l("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=o}if(!this.fields)throw new l("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(o=>o.name===this.objectIdField)||this.fields.push(new le({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new l("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),f(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),ue(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:fe})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(b.fields)],i.prototype,"fields",void 0),t([r(b.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:C,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:h.apiValues,json:{read:{reader:h.read}}})],i.prototype,"geometryType",void 0),t([r(te)],i.prototype,"labelsVisible",void 0),t([r({type:[me],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ce},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(ie)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([r({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([r(re)],i.prototype,"maxScale",void 0),t([r(oe)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r({readOnly:!0})],i.prototype,"outFields",void 0),t([r(se)],i.prototype,"popupEnabled",void 0),t([r({type:L,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:R})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:G,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:J,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r((()=>{const e=U(ne);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:x,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(ae)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([I("esri.layers.StreamLayer")],i);const Et=i;export{Et as default}; diff --git a/main/assets/StreamLayerView2D-Bh_aEalU-6VUJB3H7.js b/main/assets/StreamLayerView2D-Bh_aEalU-6VUJB3H7.js deleted file mode 100644 index 6d818f03b..000000000 --- a/main/assets/StreamLayerView2D-Bh_aEalU-6VUJB3H7.js +++ /dev/null @@ -1 +0,0 @@ -import{ah as m,o as h,bo as l,a2 as d,v as i,S as n,i as u}from"./main-BZaw9FpY.js";import{O as c}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{n as y,r as _}from"./FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js";import g from"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./timeSupport-ohWmWReZ-CwKm-94j.js";import"./LayerView-Bish-E63-DRGspiuk.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./SDFHelper-B6k8Ig6R-KWOw5fv6.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-xbvi-u4x.js";import"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";const f=t=>{let e=class extends t{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...r){super(...r),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(r){r?this._doPause():this._isUserPaused||this._doResume()}};return i([n()],e.prototype,"_isUserPaused",void 0),i([n({readOnly:!0})],e.prototype,"connectionStatus",null),i([n({type:g})],e.prototype,"filter",void 0),e=i([u("esri.views.layers.StreamLayerView")],e),e};let s=class extends f(_){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([m(()=>this.layer.customParameters,async t=>{(await this.getWorker()).streamMessenger.updateCustomParameters(t)}),this.layer.on("send-message-to-socket",async t=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(t)}),this.layer.on("send-message-to-client",async t=>{(await this.getWorker()).streamMessenger.sendMessageToClient(t),this._isUserPaused&&"type"in t&&t.type==="clear"&&this.incrementSourceRefreshVersion()}),m(()=>this.layer.purgeOptions,()=>this._update()),m(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new h("stream-controller",this.pipelineErrorString):null}on(t,e){if(Array.isArray(t))return l(t.map(o=>this.on(o,e)));const r=["data-received","message-received"].includes(t);r&&this.getWorker().then(o=>o.streamMessenger.enableEvent(t,!0));const a=super.on(t,e),p=this;return d(()=>{a.remove(),r&&(p._workerProxy.closed||p.hasEventListener(t)||p.getWorker().then(o=>o.streamMessenger.enableEvent(t,!1)))})}async queryLatestObservations(t,e){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new h("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const r=await this.getWorker();return y(r.features.executeQueryForLatestObservations(this._cleanUpQuery(t),e).then(a=>{const p=c.fromJSON(a);return p.features.forEach(o=>{o.layer=this.layer,o.sourceLayer=this.layer}),p}),new c({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this.getWorker().then(t=>t.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(t=>t.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(t=>t.streamMessenger.clear()),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const t=super._createClientOptions(),e=this;return{...t,get container(){return e.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};i([n()],s.prototype,"pipelineConnectionStatus",void 0),i([n()],s.prototype,"pipelineErrorString",void 0),i([n({readOnly:!0})],s.prototype,"connectionError",null),i([n({readOnly:!0})],s.prototype,"_streamConnectionStatus",null),s=i([u("esri.views.2d.layers.StreamLayerView2D")],s);const ge=s;export{ge as default}; diff --git a/main/assets/StreamLayerView2D-Bh_aEalU-BnZnyCg1.js b/main/assets/StreamLayerView2D-Bh_aEalU-BnZnyCg1.js new file mode 100644 index 000000000..24e12d35c --- /dev/null +++ b/main/assets/StreamLayerView2D-Bh_aEalU-BnZnyCg1.js @@ -0,0 +1 @@ +import{ah as m,o as h,bo as l,a2 as d,v as i,S as n,i as u}from"./main-C7yV2j71.js";import{O as c}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{n as y,r as _}from"./FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js";import g from"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import"./LayerView-Bish-E63-I2LV0oDm.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./SDFHelper-B6k8Ig6R-C81pIMYz.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-X6GWMgRY.js";import"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";const f=t=>{let e=class extends t{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...r){super(...r),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(r){r?this._doPause():this._isUserPaused||this._doResume()}};return i([n()],e.prototype,"_isUserPaused",void 0),i([n({readOnly:!0})],e.prototype,"connectionStatus",null),i([n({type:g})],e.prototype,"filter",void 0),e=i([u("esri.views.layers.StreamLayerView")],e),e};let s=class extends f(_){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([m(()=>this.layer.customParameters,async t=>{(await this.getWorker()).streamMessenger.updateCustomParameters(t)}),this.layer.on("send-message-to-socket",async t=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(t)}),this.layer.on("send-message-to-client",async t=>{(await this.getWorker()).streamMessenger.sendMessageToClient(t),this._isUserPaused&&"type"in t&&t.type==="clear"&&this.incrementSourceRefreshVersion()}),m(()=>this.layer.purgeOptions,()=>this._update()),m(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new h("stream-controller",this.pipelineErrorString):null}on(t,e){if(Array.isArray(t))return l(t.map(o=>this.on(o,e)));const r=["data-received","message-received"].includes(t);r&&this.getWorker().then(o=>o.streamMessenger.enableEvent(t,!0));const a=super.on(t,e),p=this;return d(()=>{a.remove(),r&&(p._workerProxy.closed||p.hasEventListener(t)||p.getWorker().then(o=>o.streamMessenger.enableEvent(t,!1)))})}async queryLatestObservations(t,e){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new h("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const r=await this.getWorker();return y(r.features.executeQueryForLatestObservations(this._cleanUpQuery(t),e).then(a=>{const p=c.fromJSON(a);return p.features.forEach(o=>{o.layer=this.layer,o.sourceLayer=this.layer}),p}),new c({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this.getWorker().then(t=>t.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(t=>t.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(t=>t.streamMessenger.clear()),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const t=super._createClientOptions(),e=this;return{...t,get container(){return e.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};i([n()],s.prototype,"pipelineConnectionStatus",void 0),i([n()],s.prototype,"pipelineErrorString",void 0),i([n({readOnly:!0})],s.prototype,"connectionError",null),i([n({readOnly:!0})],s.prototype,"_streamConnectionStatus",null),s=i([u("esri.views.2d.layers.StreamLayerView2D")],s);const ge=s;export{ge as default}; diff --git a/main/assets/StyleRepository-D3WuVprR-COU4Jcir.js b/main/assets/StyleRepository-D3WuVprR-COU4Jcir.js deleted file mode 100644 index cd1a9f380..000000000 --- a/main/assets/StyleRepository-D3WuVprR-COU4Jcir.js +++ /dev/null @@ -1,9 +0,0 @@ -import{p as T,t as F,n as Z}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{cS as me,ar as b}from"./main-BZaw9FpY.js";import{N as W}from"./enums-qHpGJ28Q-CmnLAccm.js";import{Z as xt,G as we,K as re,X as Ee,F as N,d as vt}from"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import{I as g}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{n as v}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{U as Kt,l as qt,T as Wt}from"./colorUtils-Cthpxcks-BhGjp9AU.js";import{u as Te}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{d as be}from"./definitions-DJSdSb77-DkoRHaVx.js";let Ie=class{constructor(n){this._array=[],this._stride=n}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(n,t){return 65535&n|t<<16}static i8888to32(n,t,e,r){return 255&n|(255&t)<<8|(255&e)<<16|r<<24}static i8816to32(n,t,e){return 255&n|(255&t)<<8|e<<16}};var c,K;(function(n){n[n.R8_SIGNED=0]="R8_SIGNED",n[n.R8_UNSIGNED=1]="R8_UNSIGNED",n[n.R16_SIGNED=2]="R16_SIGNED",n[n.R16_UNSIGNED=3]="R16_UNSIGNED",n[n.R8G8_SIGNED=4]="R8G8_SIGNED",n[n.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",n[n.R16G16_SIGNED=6]="R16G16_SIGNED",n[n.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",n[n.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",n[n.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",n[n.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",n[n.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",n[n.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(c||(c={})),function(n){n[n.UNIFORM=0]="UNIFORM",n[n.DATA_DRIVEN=1]="DATA_DRIVEN",n[n.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",n[n.UNUSED=3]="UNUSED"}(K||(K={}));let j=class Dt{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layout||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layout||this._buildAttributesInfo(),this._layout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,r,i,a){const o=this.getUniforms();for(const s of o){const{name:l,type:u,getValue:h}=s,p=h(r,e,i,a);if(p!==null)switch(u){case"float":t.setUniform1f(l,p);break;case"vec2":t.setUniform2fv(l,p);break;case"vec4":t.setUniform4fv(l,p)}}}encodeAttributes(t,e,r,i){const a=this.attributesInfo(),o=this.getEncodingInfos(),s=[];let l=0,u=0;for(const h of Object.keys(o)){const p=o[h],{type:f,precisionFactor:d,isLayout:S}=a[h],M=S?r.getLayoutProperty(h):r.getPaintProperty(h),z=M.interpolator?.getInterpolationRange(e);let $=0;for(const I of p){const{offset:_,bufferElementsToAdd:U}=I;if(U>0){for(let H=0;H4)i++,R={dataIndex:i,count:0,offset:0},_!==4&&(r[H]=R),t.push({location:-1,name:"a_data_"+i,count:_,type:$,normalized:U}),O=Math.ceil(Math.max(E/4,1));else{const B=t[R.dataIndex];B.count+=_,O=Math.ceil(Math.max(B.count*I/4,1))-Math.ceil(Math.max(R.offset/4,1))}S.push({dataIndex:R.dataIndex,offset:R.offset,bufferElementsToAdd:O}),R.offset+=E,R.count+=_}}for(const p of t)switch(p.type){case g.BYTE:case g.UNSIGNED_BYTE:p.count=4;break;case g.SHORT:case g.UNSIGNED_SHORT:p.count+=p.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layout.get("geometry");for(const p of u)this._locations.set(p.name,l++);const h=this._layout.get("opacity");if(h)for(const p of h)this._locations.set(p.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,r=this.geometryInfo();let i=r[0].stride;if(t.length===0)e.set("geometry",r);else{const o=[];let s=i;for(const l of t)i+=Xt(l.type)*l.count;for(const l of r)o.push(new v(l.name,l.count,l.type,l.offset,i,l.normalized));for(const l of t)o.push(new v(l.name,l.count,l.type,s,i,l.normalized)),s+=Xt(l.type)*l.count;e.set("geometry",o)}const a=this.opacityInfo();a&&e.set("opacity",a),this._layout=e,this._stride=i}_buildShaderInfo(t,e){let r=` -`,i=` -`;const a=[];for(const u of t)r+=`attribute ${this._getType(u.count)} ${u.name}; -`;const o=this.attributes(),s=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:h,type:p,precisionFactor:f,isLayout:d}=s[u],S=f&&f!==1?" * "+1/f:"",{bytesPerElement:M,count:z}=Dt._encodingInfo[p],$=I=>`a_data_${I.dataIndex}${ve(z,I.offset,M)}`;switch(this.getAtributeState(l)){case K.UNIFORM:{const I=this._getType(z),_=`u_${h}`;a.push({name:_,type:I,getValue:(U,E,H,R)=>{const O=d?U.getLayoutValue(u,E):U.getPaintValue(u,E);if(p===c.R16G16B16A16_DASHARRAY){const B=U.getDashKey(O,U.getLayoutValue("line-cap",E)),nt=R.getMosaicItemPosition(B,!1);if(nt==null)return null;const{tl:st,br:jt}=nt;return[st[0],jt[1],jt[0],st[1]]}if(p===c.R16G16B16A16_PATTERN){const B=R.getMosaicItemPosition(O,!u.includes("line-"));if(B==null)return null;const{tl:nt,br:st}=B;return[nt[0],st[1],st[0],nt[1]]}if(p===c.R8G8B8A8_COLOR){const B=O[3];return[B*O[0],B*O[1],B*O[2],B]}return O}}),r+=`uniform ${I} ${_}; -`,i+=`${I} ${h} = ${_}; -`}break;case K.DATA_DRIVEN:{const I=$(e[u][0]);i+=`${this._getType(z)} ${h} = ${I}${S}; -`}break;case K.INTERPOLATED_DATA_DRIVEN:{const I=`u_t_${h}`;a.push({name:I,type:"float",getValue:(E,H,R,O)=>(d?E.getLayoutProperty(u):E.getPaintProperty(u)).interpolator.interpolationUniformValue(R,H)}),r+=`uniform float ${I}; -`;const _=$(e[u][0]),U=$(e[u][1]);i+=`${this._getType(z)} ${h} = mix(${_}${S}, ${U}${S}, ${I}); -`}}}this._shaderHeader=r,this._shaderMain=i,this._uniforms=a}_bit(t){return(this._key&1<>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(t){const e=255*t[3];return Ie.i8888to32(t[0]*e,t[1]*e,t[2]*e,e)}_encodePattern(t,e,r){if(!r?.rect)return;const i=2,a=r.rect,o=r.width,s=r.height;e[t]=this._encodeShort(a.x+i,0),e[t]|=this._encodeShort(a.y+i+s,16),e[t+1]=this._encodeShort(a.x+i+o,0),e[t+1]|=this._encodeShort(a.y+i,16)}_encodeByte(t,e){return(255&t)<{switch(n){case g.FLOAT:case g.INT:case g.UNSIGNED_INT:return 4;case g.SHORT:case g.UNSIGNED_SHORT:case g.HALF_FLOAT:return 2;case g.BYTE:case g.UNSIGNED_BYTE:return 1}},ve=(n,t,e)=>{const r=t/e;if(n===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(n===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(n===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let J=class yt extends j{constructor(t){super(t)}geometryInfo(){return yt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return yt.ATTRIBUTES}attributesInfo(){return yt.ATTRIBUTES_INFO}};J.ATTRIBUTES=[],J.GEOMETRY_LAYOUT=[new v("a_pos",2,g.BYTE,0,2)],J.ATTRIBUTES_INFO={};let Q=class ft extends j{constructor(t){super(t)}geometryInfo(){return ft.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return ft.ATTRIBUTES}attributesInfo(){return ft.ATTRIBUTES_INFO}};Q.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],Q.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,4)],Q.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:c.R8_UNSIGNED},"circle-color":{name:"color",type:c.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:c.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:c.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:32}};let tt=class gt extends j{constructor(t){super(t)}geometryInfo(){return gt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return gt.ATTRIBUTES}attributesInfo(){return gt.ATTRIBUTES_INFO}};tt.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],tt.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,4)],tt.ATTRIBUTES_INFO={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0}};let V=class X extends j{constructor(t,e){super(t),this._usefillColor=e}geometryInfo(){return X.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?X.ATTRIBUTES_FILL:X.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?X.ATTRIBUTES_INFO_FILL:X.ATTRIBUTES_INFO_OUTLINE}};V.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],V.ATTRIBUTES_FILL=["fill-color","fill-opacity"],V.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,8),new v("a_offset",2,g.BYTE,4,8),new v("a_xnormal",2,g.BYTE,6,8)],V.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}},V.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}};let et=class dt extends j{constructor(t){super(t)}geometryInfo(){return dt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return dt.ATTRIBUTES}attributesInfo(){return dt.ATTRIBUTES_INFO}};et.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],et.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,16),new v("a_extrude_offset",4,g.BYTE,4,16),new v("a_dir_normal",4,g.BYTE,8,16),new v("a_accumulatedDistance",2,g.UNSIGNED_SHORT,12,16)],et.ATTRIBUTES_INFO={"line-width":{name:"width",type:c.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:c.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:c.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:c.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:c.R16G16B16A16_DASHARRAY,isOptional:!0}};const ie=[new v("a_pos",2,g.SHORT,0,16),new v("a_vertexOffset",2,g.SHORT,4,16),new v("a_texAngleRange",4,g.UNSIGNED_BYTE,8,16),new v("a_levelInfo",4,g.UNSIGNED_BYTE,12,16)],ae=[new v("a_opacityInfo",1,g.UNSIGNED_BYTE,0,1)];let lt=class Rt extends j{constructor(t){super(t)}geometryInfo(){return ie}opacityInfo(){return ae}attributes(){return Rt.ATTRIBUTES}attributesInfo(){return Rt.ATTRIBUTES_INFO}};lt.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],lt.ATTRIBUTES_INFO={"icon-color":{name:"color",type:c.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:c.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let ut=class Nt extends j{constructor(t){super(t)}geometryInfo(){return ie}opacityInfo(){return ae}attributes(){return Nt.ATTRIBUTES}attributesInfo(){return Nt.ATTRIBUTES_INFO}};ut.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],ut.ATTRIBUTES_INFO={"text-color":{name:"color",type:c.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:c.R8_UNSIGNED,isLayout:!0}};const ne={kind:"null"},w={kind:"number"},L={kind:"string"},D={kind:"boolean"},Y={kind:"color"},bt={kind:"object"},C={kind:"value"};function ht(n,t){return{kind:"array",itemType:n,n:t}}const De=[ne,w,L,D,Y,bt,ht(C)];function rt(n){if(n.kind==="array"){const t=rt(n.itemType);return typeof n.n=="number"?`array<${t}, ${n.n}>`:n.itemType.kind==="value"?"array":`array<${t}>`}return n.kind}function It(n){if(n===null)return ne;if(typeof n=="string")return L;if(typeof n=="boolean")return D;if(typeof n=="number")return w;if(n instanceof b)return Y;if(Array.isArray(n)){let t;for(const e of n){const r=It(e);if(t){if(t!==r){t=C;break}}else t=r}return ht(t||C,n.length)}return typeof n=="object"?bt:C}function At(n,t){if(t.kind==="array")return n.kind==="array"&&(n.n===0&&n.itemType.kind==="value"||At(n.itemType,t.itemType))&&(typeof t.n!="number"||t.n===n.n);if(t.kind==="value"){for(const e of De)if(At(n,e))return!0}return t.kind===n.kind}function Pt(n){if(n===null)return"";const t=typeof n;return t==="string"?n:t==="number"||t==="boolean"?String(n):n instanceof b?n.toString():JSON.stringify(n)}let Re=class{constructor(n){this._parent=n,this._vars={}}add(n,t){this._vars[n]=t}get(n){return this._vars[n]?this._vars[n]:this._parent?this._parent.get(n):null}},Ne=class se{constructor(){this.type=C}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new se}evaluate(t,e){return t?.id}};class St{constructor(){this.type=L}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new St}evaluate(t,e){if(!t)return null;switch(t.type){case vt.Point:return"Point";case vt.LineString:return"LineString";case vt.Polygon:return"Polygon";default:return null}}}let Ae=class oe{constructor(){this.type=bt}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new oe}evaluate(t,e){return t?.values}},le=class ue{constructor(){this.type=w}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new ue}evaluate(t,e){return e}};class x{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=D}static parse(t,e,r){if(t.length!==3&&t.length!==4)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(t.length===4)throw new Error(`"${t[0]}" collator not supported`);return new x(y(t[1],e),y(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class Pe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r===i)}}class xe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r!==i)}}class Se extends x{static parse(t,e){return x.parse(t,e,(r,i)=>re<=r)}};class Ue extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r>i)}}class Oe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r>=i)}}class Lt{constructor(t){this._arg=t,this.type=D}static parse(t,e){if(t.length!==2)throw new Error('"!" expects 1 argument');return new Lt(y(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class Ut{constructor(t){this._args=t,this.type=D}static parse(t,e){const r=[];for(let i=1;i1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${a[0]}"`)}if(t.length%2!=1)throw new Error(`"${i}" expects an even number of arguments`);const o=y(t[2],e,w);let s;i==="interpolate-hcl"||i==="interpolate-lab"?s=Y:r&&r.kind!=="value"&&(s=r);const l=[];for(let u=3;u=h)throw new Error(`"${i}" requires strictly ascending stop inputs`);const p=y(t[u+1],e,s);s||(s=p.type),l.push([h,p])}if(s&&s!==Y&&s!==w&&(s.kind!=="array"||s.itemType!==w))throw new Error(`"${i}" cannot interpolate type ${rt(s)}`);return new k(i,s,a,o,l)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const i=this.input.evaluate(t,e);if(i<=r[0][0])return r[0][1].evaluate(t,e);if(i>=r[r.length-1][0])return r[r.length-1][1].evaluate(t,e);let a=0;for(;++aN(p,h[f],l));if(this.type.kind==="color"&&u instanceof b&&h instanceof b){const p=new b(u),f=new b(h);return new b([N(p.r,f.r,l),N(p.g,f.g,l),N(p.b,f.b,l),N(p.a,f.a,l)])}if(this.type.kind==="number"&&typeof u=="number"&&typeof h=="number")return N(u,h,l);throw new Error(`"${this._operator}" cannot interpolate type ${rt(this.type)}`)}if(this._operator==="interpolate-hcl"){const p=Kt(u),f=Kt(h),d=f.h-p.h,S=qt({h:p.h+l*(d>180||d<-180?d-360*Math.round(d/360):d),c:N(p.c,f.c,l),l:N(p.l,f.l,l)});return new b({a:N(u.a,h.a,l),...S})}if(this._operator==="interpolate-lab"){const p=Wt(u),f=Wt(h),d=qt({l:N(p.l,f.l,l),a:N(p.a,f.a,l),b:N(p.b,f.b,l)});return new b({a:N(u.a,h.a,l),...d})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(r.length===1||t>=r[r.length-1][0])return 0;let i=0;for(;++i=r)return[r,r];let i=0;for(;++i1&&(a=1),a}static _exponentialInterpolationRatio(t,e,r,i){const a=i-r;if(a===0)return 0;const o=t-r;return e===1?o/a:(e**o-1)/(e**a-1)}}class Bt{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=y(t[1],e,w);let i;const a=[];a.push([-1/0,y(t[2],e)]);for(let o=3;o=s)throw new Error('"step" requires strictly ascending stop inputs');const l=y(t[o+1],e);i||(i=l.type),a.push([s,l])}return new Bt(i,r,a)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const i=this._input.evaluate(t,e);let a=0;for(;++a=i.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return i[r]}};class _t{constructor(t,e){this._key=t,this._obj=e,this.type=C}static parse(t,e){let r,i;switch(t.length){case 2:return r=y(t[1],e),new _t(r);case 3:return r=y(t[1],e),i=y(t[2],e),new _t(r,i);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?this._obj.evaluate(t,e)[r]:t?.values[r]}}class mt{constructor(t,e){this._key=t,this._obj=e,this.type=D}static parse(t,e){let r,i;switch(t.length){case 2:return r=y(t[1],e),new mt(r);case 3:return r=y(t[1],e),i=y(t[2],e),new mt(r,i);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?r in this._obj.evaluate(t,e):!!t?.values[r]}}let Me=class de{constructor(t,e){this._key=t,this._vals=e,this.type=D}static parse(t,e){if(t.length!==3)throw new Error('"in" expects 2 arguments');return new de(y(t[1],e),y(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}};class wt{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=w}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=y(t[1],e),i=y(t[2],e);if(t.length===4){const a=y(t[3],e,w);return new wt(r,i,a)}return new wt(r,i)}evaluate(t,e){const r=this._item.evaluate(t,e),i=this._array.evaluate(t,e);if(this._from){const a=this._from.evaluate(t,e);if(a!==Math.floor(a))throw new Error('"index-of" index must be an integer');return i.indexOf(r,a)}return i.indexOf(r)}}class kt{constructor(t){this._arg=t,this.type=w}static parse(t,e){if(t.length!==2)throw new Error('"length" expects 2 arguments');const r=y(t[1],e);return new kt(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class Et{constructor(t,e,r,i){this.type=t,this._array=e,this._from=r,this._to=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=y(t[1],e),i=y(t[2],e,w);if(i.type!==w)throw new Error('"slice" index must return a number');if(t.length===4){const a=y(t[3],e,w);if(a.type!==w)throw new Error('"slice" index must return a number');return new Et(r.type,r,i,a)}return new Et(r.type,r,i)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&typeof r!="string")throw new Error('"slice" input must be an array or a string');const i=this._from.evaluate(t,e);if(i<0||i>=r.length)throw new Error('"slice" index out of bounds');if(i!==Math.floor(i))throw new Error('"slice" index must be an integer');if(this._to){const a=this._to.evaluate(t,e);if(a<0||a>=r.length)throw new Error('"slice" index out of bounds');if(a!==Math.floor(a))throw new Error('"slice" index must be an integer');return r.slice(i,a)}return r.slice(i)}}class zt{constructor(){this.type=D}static parse(t){if(t.length!==1)throw new Error('"has-id" expects no arguments');return new zt}evaluate(t,e){return t?.id!==void 0}}class A{constructor(t,e){this._args=t,this._calculate=e,this.type=w}static parse(t,e,r){const i=t.slice(1).map(a=>y(a,e));return new A(i,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(i=>i.evaluate(t,e))),this._calculate(r)}}class $e extends A{static parse(t,e){switch(t.length){case 2:return A.parse(t,e,r=>-r[0]);case 3:return A.parse(t,e,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class Ce extends A{static parse(t,e){return A.parse(t,e,r=>{let i=1;for(const a of r)i*=a;return i})}}class Ye extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}}class He extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}}class je extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}}class Ke extends A{static parse(t,e){return A.parse(t,e,r=>{let i=0;for(const a of r)i+=a;return i})}}class m{constructor(t,e){this._args=t,this._calculate=e,this.type=w}static parse(t,e){const r=t.slice(1).map(i=>y(i,e));return new m(r,m.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(i=>i.evaluate(t,e))),this._calculate(r)}}m.ops={abs:n=>Math.abs(n[0]),acos:n=>Math.acos(n[0]),asin:n=>Math.asin(n[0]),atan:n=>Math.atan(n[0]),ceil:n=>Math.ceil(n[0]),cos:n=>Math.cos(n[0]),e:()=>Math.E,floor:n=>Math.floor(n[0]),ln:n=>Math.log(n[0]),ln2:()=>Math.LN2,log10:n=>Math.log(n[0])/Math.LN10,log2:n=>Math.log(n[0])/Math.LN2,max:n=>Math.max(...n),min:n=>Math.min(...n),pi:()=>Math.PI,round:n=>Math.round(n[0]),sin:n=>Math.sin(n[0]),sqrt:n=>Math.sqrt(n[0]),tan:n=>Math.tan(n[0])};class Ft{constructor(t){this._args=t,this.type=L}static parse(t,e){return new Ft(t.slice(1).map(r=>y(r,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class it{constructor(t,e){this._arg=t,this._calculate=e,this.type=L}static parse(t,e){if(t.length!==2)throw new Error(`${t[0]} expects 1 argument`);const r=y(t[1],e);return new it(r,it.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}it.ops={downcase:n=>n.toLowerCase(),upcase:n=>n.toUpperCase()};class Vt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==4)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(i=>y(i,e));return new Vt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e));return new b({r,g:i,b:a})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class Mt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==5)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(i=>y(i,e));return new Mt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e)),o=this._validateAlpha(this._args[3].evaluate(t,e));return new b({r,g:i,b:a,a:o})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if(typeof t!="number"||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class $t{constructor(t){this._color=t,this.type=ht(w,4)}static parse(t,e){if(t.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=y(t[1],e);return new $t(r)}evaluate(t,e){return new b(this._color.evaluate(t,e)).toRgba()}}class q{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let i,a=1;if(r==="array"){if(t.length>2){switch(t[1]){case"string":i=L;break;case"number":i=w;break;case"boolean":i=D;break;default:throw new Error('"array" type argument must be string, number or boolean')}a++}else i=C;let s;if(t.length>3){if(s=t[2],s!==null&&(typeof s!="number"||s<0||s!==Math.floor(s)))throw new Error('"array" length argument must be a positive integer literal');a++}i=ht(i,s)}else switch(r){case"string":i=L;break;case"number":i=w;break;case"boolean":i=D;break;case"object":i=bt}const o=[];for(;a":Ue,">=":Oe,all:Ut,any:Be,case:Ge,coalesce:ke,match:ze,within:null,interpolate:k,"interpolate-hcl":k,"interpolate-lab":k,step:Bt,let:Gt,var:Fe,concat:Ft,downcase:it,"is-supported-script":null,"resolved-locale":null,upcase:it,rgb:Vt,rgba:Mt,"to-rgba":$t,"-":$e,"*":Ce,"/":Ye,"%":He,"^":je,"+":Ke,abs:m,acos:m,asin:m,atan:m,ceil:m,cos:m,e:m,floor:m,ln:m,ln2:m,log10:m,log2:m,max:m,min:m,pi:m,round:m,sin:m,sqrt:m,tan:m,zoom:le,"heatmap-density":null,"has-id":zt,none:Ot};class P{constructor(t){this._expression=t}filter(t,e){if(!this._expression)return!0;try{return this._expression.evaluate(t,e)}catch(r){return console.log(r.message),!0}}static createFilter(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{const e=y(t,null,D);return new P(e)}catch(e){return console.log(e.message),null}}static isLegacyFilter(t){if(!Array.isArray(t)||t.length===0)return!0;switch(t[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return t.length===3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"in":return t.length>=3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let e=1;e":case"<":case">=":case"<=":return P.convertComparison(e,t[1],t[2]);case"in":return P.convertIn(t[1],t.slice(2));case"!in":return P.negate(P.convertIn(t[1],t.slice(2)));case"any":case"all":case"none":return P.convertCombining(e,t.slice(1));case"has":return P.convertHas(t[1]);case"!has":return P.negate(P.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(t,e,r){switch(e){case"$type":return[t,["geometry-type"],r];case"$id":return[t,["id"],r];default:return[t,["get",e],r]}}static convertIn(t,e){switch(t){case"$type":return["in",["geometry-type"],["literal",e]];case"$id":return["in",["id"],["literal",e]];default:return["in",["get",t],["literal",e]]}}static convertHas(t){switch(t){case"$type":return!0;case"$id":return["has-id"];default:return["has",t]}}static convertCombining(t,e){return[t].concat(e.map(this.convertLegacyFilter))}static negate(t){return["!",t]}}class Tt{constructor(t,e){let r;switch(this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":r=!0;break;case"array":r=t.value==="number";break;default:r=!1}if(e==null&&(e=t.default),Array.isArray(e)&&e.length>0&&_e[e[0]]){const a={number:w,color:Y,string:L,boolean:D,enum:L};try{const o=t.type==="array"?ht(a[t.value]||C,t.length):a[t.type],s=y(e,null,o);this.getValue=this._buildExpression(s,t),this.isDataDriven=!0,s instanceof k&&s.input instanceof le&&(this.interpolator=s)}catch(o){console.log(o.message),this.getValue=this._buildSimple(t.default)}return}r&&e.type==="interval"&&(r=!1);const i=e?.stops&&e.stops.length>0;if(i)for(const a of e.stops)a[1]=this._validate(a[1],t);if(this.isDataDriven=!!e&&!!e.property,this.isDataDriven)if(e.default!==void 0&&(e.default=this._validate(e.default,t)),i)switch(e.type){case"identity":this.getValue=this._buildIdentity(e,t);break;case"categorical":this.getValue=this._buildCategorical(e,t);break;default:this.getValue=r?this._buildInterpolate(e,t):this._buildInterval(e,t)}else this.getValue=this._buildIdentity(e,t);else i?this.getValue=r?this._buildZoomInterpolate(e):this._buildZoomInterval(e):(e=this._validate(e,t),this.getValue=this._buildSimple(e))}_validate(t,e){if(e.type==="number"){if(e.minimum!=null&&te.maximum)return e.maximum}else e.type==="color"?t=Tt._parseColor(t):e.type==="enum"?typeof t=="string"&&(t=e.values.indexOf(t)):e.type==="array"&&e.value==="enum"?t=t.map(r=>typeof r=="string"?e.values.indexOf(r):r):e.type==="string"&&(t=Pt(t));return t}_buildSimple(t){return()=>t}_buildExpression(t,e){return(r,i)=>{try{const a=t.evaluate(i,r);return a===void 0?e.default:this._validate(a,e)}catch(a){return console.log(a.message),e.default}}}_buildIdentity(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a!==void 0&&(a=this._validate(a,e)),a??(t.default!==void 0?t.default:e.default)}}_buildCategorical(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a=this._categorical(a,t.stops),a!==void 0?a:t.default!==void 0?t.default:e.default}}_buildInterval(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),typeof a=="number"?this._interval(a,t.stops):t.default!==void 0?t.default:e.default}}_buildInterpolate(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),typeof a=="number"?this._interpolate(a,t.stops,t.base||1):t.default!==void 0?t.default:e.default}}_buildZoomInterpolate(t){return e=>this._interpolate(e,t.stops,t.base||1)}_buildZoomInterval(t){return e=>this._interval(e,t.stops)}_categorical(t,e){const r=e.length;for(let i=0;ithis._create(e,r,i)).filter(e=>!!e),this.layers)for(let e=0;e=this.layers.length?null:this.layers[t].id}getStyleLayerByUID(t){return this._uidToLayer.get(t)??null}getStyleLayerIndex(t){const e=this._layerByName[t];return e?this.layers.indexOf(e):-1}setStyleLayer(t,e){if(!t?.id)return;const r=this._style;e!=null&&e>=this.layers.length&&(e=this.layers.length-1);let i,a=!0;const o=this._layerByName[t.id];if(o){const s=this.layers.indexOf(o);e||(e=s),e===s?(a=!1,i=ot._recreateLayer(t,o),this.layers[e]=i,r.layers[e]=t):(this.layers.splice(s,1),r.layers.splice(s,1),i=this._create(t,e,this.layers),this.layers.splice(e,0,i),r.layers.splice(e,0,t))}else i=this._create(t,e,this.layers),!e||e>=this.layers.length?(this.layers.push(i),r.layers.push(t)):(this.layers.splice(e,0,i),r.layers.splice(e,0,t));this._layerByName[t.id]=i,this._uidToLayer.set(i.uid,i),a&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(t){const e=this._layerByName[t];return e?{type:e.typeName,id:e.id,source:e.source,"source-layer":e.sourceLayer,minzoom:e.minzoom,maxzoom:e.maxzoom,filter:e.filter,layout:e.layout,paint:e.paint}:null}deleteStyleLayer(t){const e=this._layerByName[t];if(e){delete this._layerByName[t],this._uidToLayer.delete(e.uid);const r=this.layers.indexOf(e);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(t){return this._layerByName[t]}getLayoutProperties(t){const e=this._layerByName[t];return e?e.layout:null}getPaintProperties(t){const e=this._layerByName[t];return e?e.paint:null}setPaintProperties(t,e){const r=this._layerByName[t];if(!r)return;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:e},a=ot._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=a,this._style.layers[o].paint=e,this._layerByName[r.id]=a,this._uidToLayer.set(r.uid,a)}setLayoutProperties(t,e){const r=this._layerByName[t];if(!r)return;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:e,paint:r.paint},a=ot._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=a,this._style.layers[o].layout=e,this._layerByName[r.id]=a,this._uidToLayer.set(r.uid,a)}setStyleLayerVisibility(t,e){const r=this._layerByName[t];if(!r)return;const i=r.layout||{};i.visibility=e;const a={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:i,paint:r.paint},o=ot._recreateLayer(a,r),s=this.layers.indexOf(r);this.layers[s]=o,this._style.layers[s].layout=i,this._layerByName[r.id]=o,this._uidToLayer.set(r.uid,o)}getStyleLayerVisibility(t){const e=this._layerByName[t];return e?e.layout?.visibility??"visible":"none"}_recomputeZValues(){const t=this.layers,e=1/(t.length+1);for(let r=0;ra.keyo.key?1:0);const i=t.length;for(let a=0;a0){for(let H=0;H4)i++,R={dataIndex:i,count:0,offset:0},_!==4&&(r[H]=R),t.push({location:-1,name:"a_data_"+i,count:_,type:$,normalized:U}),O=Math.ceil(Math.max(E/4,1));else{const B=t[R.dataIndex];B.count+=_,O=Math.ceil(Math.max(B.count*I/4,1))-Math.ceil(Math.max(R.offset/4,1))}S.push({dataIndex:R.dataIndex,offset:R.offset,bufferElementsToAdd:O}),R.offset+=E,R.count+=_}}for(const p of t)switch(p.type){case g.BYTE:case g.UNSIGNED_BYTE:p.count=4;break;case g.SHORT:case g.UNSIGNED_SHORT:p.count+=p.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layout.get("geometry");for(const p of u)this._locations.set(p.name,l++);const h=this._layout.get("opacity");if(h)for(const p of h)this._locations.set(p.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,r=this.geometryInfo();let i=r[0].stride;if(t.length===0)e.set("geometry",r);else{const o=[];let s=i;for(const l of t)i+=Xt(l.type)*l.count;for(const l of r)o.push(new v(l.name,l.count,l.type,l.offset,i,l.normalized));for(const l of t)o.push(new v(l.name,l.count,l.type,s,i,l.normalized)),s+=Xt(l.type)*l.count;e.set("geometry",o)}const a=this.opacityInfo();a&&e.set("opacity",a),this._layout=e,this._stride=i}_buildShaderInfo(t,e){let r=` +`,i=` +`;const a=[];for(const u of t)r+=`attribute ${this._getType(u.count)} ${u.name}; +`;const o=this.attributes(),s=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:h,type:p,precisionFactor:f,isLayout:d}=s[u],S=f&&f!==1?" * "+1/f:"",{bytesPerElement:M,count:z}=Dt._encodingInfo[p],$=I=>`a_data_${I.dataIndex}${ve(z,I.offset,M)}`;switch(this.getAtributeState(l)){case K.UNIFORM:{const I=this._getType(z),_=`u_${h}`;a.push({name:_,type:I,getValue:(U,E,H,R)=>{const O=d?U.getLayoutValue(u,E):U.getPaintValue(u,E);if(p===c.R16G16B16A16_DASHARRAY){const B=U.getDashKey(O,U.getLayoutValue("line-cap",E)),nt=R.getMosaicItemPosition(B,!1);if(nt==null)return null;const{tl:st,br:jt}=nt;return[st[0],jt[1],jt[0],st[1]]}if(p===c.R16G16B16A16_PATTERN){const B=R.getMosaicItemPosition(O,!u.includes("line-"));if(B==null)return null;const{tl:nt,br:st}=B;return[nt[0],st[1],st[0],nt[1]]}if(p===c.R8G8B8A8_COLOR){const B=O[3];return[B*O[0],B*O[1],B*O[2],B]}return O}}),r+=`uniform ${I} ${_}; +`,i+=`${I} ${h} = ${_}; +`}break;case K.DATA_DRIVEN:{const I=$(e[u][0]);i+=`${this._getType(z)} ${h} = ${I}${S}; +`}break;case K.INTERPOLATED_DATA_DRIVEN:{const I=`u_t_${h}`;a.push({name:I,type:"float",getValue:(E,H,R,O)=>(d?E.getLayoutProperty(u):E.getPaintProperty(u)).interpolator.interpolationUniformValue(R,H)}),r+=`uniform float ${I}; +`;const _=$(e[u][0]),U=$(e[u][1]);i+=`${this._getType(z)} ${h} = mix(${_}${S}, ${U}${S}, ${I}); +`}}}this._shaderHeader=r,this._shaderMain=i,this._uniforms=a}_bit(t){return(this._key&1<>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(t){const e=255*t[3];return Ie.i8888to32(t[0]*e,t[1]*e,t[2]*e,e)}_encodePattern(t,e,r){if(!r?.rect)return;const i=2,a=r.rect,o=r.width,s=r.height;e[t]=this._encodeShort(a.x+i,0),e[t]|=this._encodeShort(a.y+i+s,16),e[t+1]=this._encodeShort(a.x+i+o,0),e[t+1]|=this._encodeShort(a.y+i,16)}_encodeByte(t,e){return(255&t)<{switch(n){case g.FLOAT:case g.INT:case g.UNSIGNED_INT:return 4;case g.SHORT:case g.UNSIGNED_SHORT:case g.HALF_FLOAT:return 2;case g.BYTE:case g.UNSIGNED_BYTE:return 1}},ve=(n,t,e)=>{const r=t/e;if(n===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(n===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(n===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let J=class yt extends j{constructor(t){super(t)}geometryInfo(){return yt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return yt.ATTRIBUTES}attributesInfo(){return yt.ATTRIBUTES_INFO}};J.ATTRIBUTES=[],J.GEOMETRY_LAYOUT=[new v("a_pos",2,g.BYTE,0,2)],J.ATTRIBUTES_INFO={};let Q=class ft extends j{constructor(t){super(t)}geometryInfo(){return ft.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return ft.ATTRIBUTES}attributesInfo(){return ft.ATTRIBUTES_INFO}};Q.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],Q.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,4)],Q.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:c.R8_UNSIGNED},"circle-color":{name:"color",type:c.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:c.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:c.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:32}};let tt=class gt extends j{constructor(t){super(t)}geometryInfo(){return gt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return gt.ATTRIBUTES}attributesInfo(){return gt.ATTRIBUTES_INFO}};tt.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],tt.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,4)],tt.ATTRIBUTES_INFO={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0}};let V=class X extends j{constructor(t,e){super(t),this._usefillColor=e}geometryInfo(){return X.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?X.ATTRIBUTES_FILL:X.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?X.ATTRIBUTES_INFO_FILL:X.ATTRIBUTES_INFO_OUTLINE}};V.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],V.ATTRIBUTES_FILL=["fill-color","fill-opacity"],V.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,8),new v("a_offset",2,g.BYTE,4,8),new v("a_xnormal",2,g.BYTE,6,8)],V.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}},V.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}};let et=class dt extends j{constructor(t){super(t)}geometryInfo(){return dt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return dt.ATTRIBUTES}attributesInfo(){return dt.ATTRIBUTES_INFO}};et.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],et.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,16),new v("a_extrude_offset",4,g.BYTE,4,16),new v("a_dir_normal",4,g.BYTE,8,16),new v("a_accumulatedDistance",2,g.UNSIGNED_SHORT,12,16)],et.ATTRIBUTES_INFO={"line-width":{name:"width",type:c.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:c.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:c.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:c.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:c.R16G16B16A16_DASHARRAY,isOptional:!0}};const ie=[new v("a_pos",2,g.SHORT,0,16),new v("a_vertexOffset",2,g.SHORT,4,16),new v("a_texAngleRange",4,g.UNSIGNED_BYTE,8,16),new v("a_levelInfo",4,g.UNSIGNED_BYTE,12,16)],ae=[new v("a_opacityInfo",1,g.UNSIGNED_BYTE,0,1)];let lt=class Rt extends j{constructor(t){super(t)}geometryInfo(){return ie}opacityInfo(){return ae}attributes(){return Rt.ATTRIBUTES}attributesInfo(){return Rt.ATTRIBUTES_INFO}};lt.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],lt.ATTRIBUTES_INFO={"icon-color":{name:"color",type:c.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:c.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let ut=class Nt extends j{constructor(t){super(t)}geometryInfo(){return ie}opacityInfo(){return ae}attributes(){return Nt.ATTRIBUTES}attributesInfo(){return Nt.ATTRIBUTES_INFO}};ut.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],ut.ATTRIBUTES_INFO={"text-color":{name:"color",type:c.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:c.R8_UNSIGNED,isLayout:!0}};const ne={kind:"null"},w={kind:"number"},L={kind:"string"},D={kind:"boolean"},Y={kind:"color"},bt={kind:"object"},C={kind:"value"};function ht(n,t){return{kind:"array",itemType:n,n:t}}const De=[ne,w,L,D,Y,bt,ht(C)];function rt(n){if(n.kind==="array"){const t=rt(n.itemType);return typeof n.n=="number"?`array<${t}, ${n.n}>`:n.itemType.kind==="value"?"array":`array<${t}>`}return n.kind}function It(n){if(n===null)return ne;if(typeof n=="string")return L;if(typeof n=="boolean")return D;if(typeof n=="number")return w;if(n instanceof b)return Y;if(Array.isArray(n)){let t;for(const e of n){const r=It(e);if(t){if(t!==r){t=C;break}}else t=r}return ht(t||C,n.length)}return typeof n=="object"?bt:C}function At(n,t){if(t.kind==="array")return n.kind==="array"&&(n.n===0&&n.itemType.kind==="value"||At(n.itemType,t.itemType))&&(typeof t.n!="number"||t.n===n.n);if(t.kind==="value"){for(const e of De)if(At(n,e))return!0}return t.kind===n.kind}function Pt(n){if(n===null)return"";const t=typeof n;return t==="string"?n:t==="number"||t==="boolean"?String(n):n instanceof b?n.toString():JSON.stringify(n)}let Re=class{constructor(n){this._parent=n,this._vars={}}add(n,t){this._vars[n]=t}get(n){return this._vars[n]?this._vars[n]:this._parent?this._parent.get(n):null}},Ne=class se{constructor(){this.type=C}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new se}evaluate(t,e){return t?.id}};class St{constructor(){this.type=L}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new St}evaluate(t,e){if(!t)return null;switch(t.type){case vt.Point:return"Point";case vt.LineString:return"LineString";case vt.Polygon:return"Polygon";default:return null}}}let Ae=class oe{constructor(){this.type=bt}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new oe}evaluate(t,e){return t?.values}},le=class ue{constructor(){this.type=w}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new ue}evaluate(t,e){return e}};class x{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=D}static parse(t,e,r){if(t.length!==3&&t.length!==4)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(t.length===4)throw new Error(`"${t[0]}" collator not supported`);return new x(y(t[1],e),y(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class Pe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r===i)}}class xe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r!==i)}}class Se extends x{static parse(t,e){return x.parse(t,e,(r,i)=>re<=r)}};class Ue extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r>i)}}class Oe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r>=i)}}class Lt{constructor(t){this._arg=t,this.type=D}static parse(t,e){if(t.length!==2)throw new Error('"!" expects 1 argument');return new Lt(y(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class Ut{constructor(t){this._args=t,this.type=D}static parse(t,e){const r=[];for(let i=1;i1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${a[0]}"`)}if(t.length%2!=1)throw new Error(`"${i}" expects an even number of arguments`);const o=y(t[2],e,w);let s;i==="interpolate-hcl"||i==="interpolate-lab"?s=Y:r&&r.kind!=="value"&&(s=r);const l=[];for(let u=3;u=h)throw new Error(`"${i}" requires strictly ascending stop inputs`);const p=y(t[u+1],e,s);s||(s=p.type),l.push([h,p])}if(s&&s!==Y&&s!==w&&(s.kind!=="array"||s.itemType!==w))throw new Error(`"${i}" cannot interpolate type ${rt(s)}`);return new k(i,s,a,o,l)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const i=this.input.evaluate(t,e);if(i<=r[0][0])return r[0][1].evaluate(t,e);if(i>=r[r.length-1][0])return r[r.length-1][1].evaluate(t,e);let a=0;for(;++aN(p,h[f],l));if(this.type.kind==="color"&&u instanceof b&&h instanceof b){const p=new b(u),f=new b(h);return new b([N(p.r,f.r,l),N(p.g,f.g,l),N(p.b,f.b,l),N(p.a,f.a,l)])}if(this.type.kind==="number"&&typeof u=="number"&&typeof h=="number")return N(u,h,l);throw new Error(`"${this._operator}" cannot interpolate type ${rt(this.type)}`)}if(this._operator==="interpolate-hcl"){const p=Kt(u),f=Kt(h),d=f.h-p.h,S=qt({h:p.h+l*(d>180||d<-180?d-360*Math.round(d/360):d),c:N(p.c,f.c,l),l:N(p.l,f.l,l)});return new b({a:N(u.a,h.a,l),...S})}if(this._operator==="interpolate-lab"){const p=Wt(u),f=Wt(h),d=qt({l:N(p.l,f.l,l),a:N(p.a,f.a,l),b:N(p.b,f.b,l)});return new b({a:N(u.a,h.a,l),...d})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(r.length===1||t>=r[r.length-1][0])return 0;let i=0;for(;++i=r)return[r,r];let i=0;for(;++i1&&(a=1),a}static _exponentialInterpolationRatio(t,e,r,i){const a=i-r;if(a===0)return 0;const o=t-r;return e===1?o/a:(e**o-1)/(e**a-1)}}class Bt{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=y(t[1],e,w);let i;const a=[];a.push([-1/0,y(t[2],e)]);for(let o=3;o=s)throw new Error('"step" requires strictly ascending stop inputs');const l=y(t[o+1],e);i||(i=l.type),a.push([s,l])}return new Bt(i,r,a)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const i=this._input.evaluate(t,e);let a=0;for(;++a=i.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return i[r]}};class _t{constructor(t,e){this._key=t,this._obj=e,this.type=C}static parse(t,e){let r,i;switch(t.length){case 2:return r=y(t[1],e),new _t(r);case 3:return r=y(t[1],e),i=y(t[2],e),new _t(r,i);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?this._obj.evaluate(t,e)[r]:t?.values[r]}}class mt{constructor(t,e){this._key=t,this._obj=e,this.type=D}static parse(t,e){let r,i;switch(t.length){case 2:return r=y(t[1],e),new mt(r);case 3:return r=y(t[1],e),i=y(t[2],e),new mt(r,i);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?r in this._obj.evaluate(t,e):!!t?.values[r]}}let Me=class de{constructor(t,e){this._key=t,this._vals=e,this.type=D}static parse(t,e){if(t.length!==3)throw new Error('"in" expects 2 arguments');return new de(y(t[1],e),y(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}};class wt{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=w}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=y(t[1],e),i=y(t[2],e);if(t.length===4){const a=y(t[3],e,w);return new wt(r,i,a)}return new wt(r,i)}evaluate(t,e){const r=this._item.evaluate(t,e),i=this._array.evaluate(t,e);if(this._from){const a=this._from.evaluate(t,e);if(a!==Math.floor(a))throw new Error('"index-of" index must be an integer');return i.indexOf(r,a)}return i.indexOf(r)}}class kt{constructor(t){this._arg=t,this.type=w}static parse(t,e){if(t.length!==2)throw new Error('"length" expects 2 arguments');const r=y(t[1],e);return new kt(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class Et{constructor(t,e,r,i){this.type=t,this._array=e,this._from=r,this._to=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=y(t[1],e),i=y(t[2],e,w);if(i.type!==w)throw new Error('"slice" index must return a number');if(t.length===4){const a=y(t[3],e,w);if(a.type!==w)throw new Error('"slice" index must return a number');return new Et(r.type,r,i,a)}return new Et(r.type,r,i)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&typeof r!="string")throw new Error('"slice" input must be an array or a string');const i=this._from.evaluate(t,e);if(i<0||i>=r.length)throw new Error('"slice" index out of bounds');if(i!==Math.floor(i))throw new Error('"slice" index must be an integer');if(this._to){const a=this._to.evaluate(t,e);if(a<0||a>=r.length)throw new Error('"slice" index out of bounds');if(a!==Math.floor(a))throw new Error('"slice" index must be an integer');return r.slice(i,a)}return r.slice(i)}}class zt{constructor(){this.type=D}static parse(t){if(t.length!==1)throw new Error('"has-id" expects no arguments');return new zt}evaluate(t,e){return t?.id!==void 0}}class A{constructor(t,e){this._args=t,this._calculate=e,this.type=w}static parse(t,e,r){const i=t.slice(1).map(a=>y(a,e));return new A(i,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(i=>i.evaluate(t,e))),this._calculate(r)}}class $e extends A{static parse(t,e){switch(t.length){case 2:return A.parse(t,e,r=>-r[0]);case 3:return A.parse(t,e,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class Ce extends A{static parse(t,e){return A.parse(t,e,r=>{let i=1;for(const a of r)i*=a;return i})}}class Ye extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}}class He extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}}class je extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}}class Ke extends A{static parse(t,e){return A.parse(t,e,r=>{let i=0;for(const a of r)i+=a;return i})}}class m{constructor(t,e){this._args=t,this._calculate=e,this.type=w}static parse(t,e){const r=t.slice(1).map(i=>y(i,e));return new m(r,m.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(i=>i.evaluate(t,e))),this._calculate(r)}}m.ops={abs:n=>Math.abs(n[0]),acos:n=>Math.acos(n[0]),asin:n=>Math.asin(n[0]),atan:n=>Math.atan(n[0]),ceil:n=>Math.ceil(n[0]),cos:n=>Math.cos(n[0]),e:()=>Math.E,floor:n=>Math.floor(n[0]),ln:n=>Math.log(n[0]),ln2:()=>Math.LN2,log10:n=>Math.log(n[0])/Math.LN10,log2:n=>Math.log(n[0])/Math.LN2,max:n=>Math.max(...n),min:n=>Math.min(...n),pi:()=>Math.PI,round:n=>Math.round(n[0]),sin:n=>Math.sin(n[0]),sqrt:n=>Math.sqrt(n[0]),tan:n=>Math.tan(n[0])};class Ft{constructor(t){this._args=t,this.type=L}static parse(t,e){return new Ft(t.slice(1).map(r=>y(r,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class it{constructor(t,e){this._arg=t,this._calculate=e,this.type=L}static parse(t,e){if(t.length!==2)throw new Error(`${t[0]} expects 1 argument`);const r=y(t[1],e);return new it(r,it.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}it.ops={downcase:n=>n.toLowerCase(),upcase:n=>n.toUpperCase()};class Vt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==4)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(i=>y(i,e));return new Vt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e));return new b({r,g:i,b:a})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class Mt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==5)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(i=>y(i,e));return new Mt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e)),o=this._validateAlpha(this._args[3].evaluate(t,e));return new b({r,g:i,b:a,a:o})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if(typeof t!="number"||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class $t{constructor(t){this._color=t,this.type=ht(w,4)}static parse(t,e){if(t.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=y(t[1],e);return new $t(r)}evaluate(t,e){return new b(this._color.evaluate(t,e)).toRgba()}}class q{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let i,a=1;if(r==="array"){if(t.length>2){switch(t[1]){case"string":i=L;break;case"number":i=w;break;case"boolean":i=D;break;default:throw new Error('"array" type argument must be string, number or boolean')}a++}else i=C;let s;if(t.length>3){if(s=t[2],s!==null&&(typeof s!="number"||s<0||s!==Math.floor(s)))throw new Error('"array" length argument must be a positive integer literal');a++}i=ht(i,s)}else switch(r){case"string":i=L;break;case"number":i=w;break;case"boolean":i=D;break;case"object":i=bt}const o=[];for(;a":Ue,">=":Oe,all:Ut,any:Be,case:Ge,coalesce:ke,match:ze,within:null,interpolate:k,"interpolate-hcl":k,"interpolate-lab":k,step:Bt,let:Gt,var:Fe,concat:Ft,downcase:it,"is-supported-script":null,"resolved-locale":null,upcase:it,rgb:Vt,rgba:Mt,"to-rgba":$t,"-":$e,"*":Ce,"/":Ye,"%":He,"^":je,"+":Ke,abs:m,acos:m,asin:m,atan:m,ceil:m,cos:m,e:m,floor:m,ln:m,ln2:m,log10:m,log2:m,max:m,min:m,pi:m,round:m,sin:m,sqrt:m,tan:m,zoom:le,"heatmap-density":null,"has-id":zt,none:Ot};class P{constructor(t){this._expression=t}filter(t,e){if(!this._expression)return!0;try{return this._expression.evaluate(t,e)}catch(r){return console.log(r.message),!0}}static createFilter(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{const e=y(t,null,D);return new P(e)}catch(e){return console.log(e.message),null}}static isLegacyFilter(t){if(!Array.isArray(t)||t.length===0)return!0;switch(t[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return t.length===3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"in":return t.length>=3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let e=1;e":case"<":case">=":case"<=":return P.convertComparison(e,t[1],t[2]);case"in":return P.convertIn(t[1],t.slice(2));case"!in":return P.negate(P.convertIn(t[1],t.slice(2)));case"any":case"all":case"none":return P.convertCombining(e,t.slice(1));case"has":return P.convertHas(t[1]);case"!has":return P.negate(P.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(t,e,r){switch(e){case"$type":return[t,["geometry-type"],r];case"$id":return[t,["id"],r];default:return[t,["get",e],r]}}static convertIn(t,e){switch(t){case"$type":return["in",["geometry-type"],["literal",e]];case"$id":return["in",["id"],["literal",e]];default:return["in",["get",t],["literal",e]]}}static convertHas(t){switch(t){case"$type":return!0;case"$id":return["has-id"];default:return["has",t]}}static convertCombining(t,e){return[t].concat(e.map(this.convertLegacyFilter))}static negate(t){return["!",t]}}class Tt{constructor(t,e){let r;switch(this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":r=!0;break;case"array":r=t.value==="number";break;default:r=!1}if(e==null&&(e=t.default),Array.isArray(e)&&e.length>0&&_e[e[0]]){const a={number:w,color:Y,string:L,boolean:D,enum:L};try{const o=t.type==="array"?ht(a[t.value]||C,t.length):a[t.type],s=y(e,null,o);this.getValue=this._buildExpression(s,t),this.isDataDriven=!0,s instanceof k&&s.input instanceof le&&(this.interpolator=s)}catch(o){console.log(o.message),this.getValue=this._buildSimple(t.default)}return}r&&e.type==="interval"&&(r=!1);const i=e?.stops&&e.stops.length>0;if(i)for(const a of e.stops)a[1]=this._validate(a[1],t);if(this.isDataDriven=!!e&&!!e.property,this.isDataDriven)if(e.default!==void 0&&(e.default=this._validate(e.default,t)),i)switch(e.type){case"identity":this.getValue=this._buildIdentity(e,t);break;case"categorical":this.getValue=this._buildCategorical(e,t);break;default:this.getValue=r?this._buildInterpolate(e,t):this._buildInterval(e,t)}else this.getValue=this._buildIdentity(e,t);else i?this.getValue=r?this._buildZoomInterpolate(e):this._buildZoomInterval(e):(e=this._validate(e,t),this.getValue=this._buildSimple(e))}_validate(t,e){if(e.type==="number"){if(e.minimum!=null&&te.maximum)return e.maximum}else e.type==="color"?t=Tt._parseColor(t):e.type==="enum"?typeof t=="string"&&(t=e.values.indexOf(t)):e.type==="array"&&e.value==="enum"?t=t.map(r=>typeof r=="string"?e.values.indexOf(r):r):e.type==="string"&&(t=Pt(t));return t}_buildSimple(t){return()=>t}_buildExpression(t,e){return(r,i)=>{try{const a=t.evaluate(i,r);return a===void 0?e.default:this._validate(a,e)}catch(a){return console.log(a.message),e.default}}}_buildIdentity(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a!==void 0&&(a=this._validate(a,e)),a??(t.default!==void 0?t.default:e.default)}}_buildCategorical(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a=this._categorical(a,t.stops),a!==void 0?a:t.default!==void 0?t.default:e.default}}_buildInterval(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),typeof a=="number"?this._interval(a,t.stops):t.default!==void 0?t.default:e.default}}_buildInterpolate(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),typeof a=="number"?this._interpolate(a,t.stops,t.base||1):t.default!==void 0?t.default:e.default}}_buildZoomInterpolate(t){return e=>this._interpolate(e,t.stops,t.base||1)}_buildZoomInterval(t){return e=>this._interval(e,t.stops)}_categorical(t,e){const r=e.length;for(let i=0;ithis._create(e,r,i)).filter(e=>!!e),this.layers)for(let e=0;e=this.layers.length?null:this.layers[t].id}getStyleLayerByUID(t){return this._uidToLayer.get(t)??null}getStyleLayerIndex(t){const e=this._layerByName[t];return e?this.layers.indexOf(e):-1}setStyleLayer(t,e){if(!t?.id)return;const r=this._style;e!=null&&e>=this.layers.length&&(e=this.layers.length-1);let i,a=!0;const o=this._layerByName[t.id];if(o){const s=this.layers.indexOf(o);e||(e=s),e===s?(a=!1,i=ot._recreateLayer(t,o),this.layers[e]=i,r.layers[e]=t):(this.layers.splice(s,1),r.layers.splice(s,1),i=this._create(t,e,this.layers),this.layers.splice(e,0,i),r.layers.splice(e,0,t))}else i=this._create(t,e,this.layers),!e||e>=this.layers.length?(this.layers.push(i),r.layers.push(t)):(this.layers.splice(e,0,i),r.layers.splice(e,0,t));this._layerByName[t.id]=i,this._uidToLayer.set(i.uid,i),a&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(t){const e=this._layerByName[t];return e?{type:e.typeName,id:e.id,source:e.source,"source-layer":e.sourceLayer,minzoom:e.minzoom,maxzoom:e.maxzoom,filter:e.filter,layout:e.layout,paint:e.paint}:null}deleteStyleLayer(t){const e=this._layerByName[t];if(e){delete this._layerByName[t],this._uidToLayer.delete(e.uid);const r=this.layers.indexOf(e);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(t){return this._layerByName[t]}getLayoutProperties(t){const e=this._layerByName[t];return e?e.layout:null}getPaintProperties(t){const e=this._layerByName[t];return e?e.paint:null}setPaintProperties(t,e){const r=this._layerByName[t];if(!r)return;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:e},a=ot._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=a,this._style.layers[o].paint=e,this._layerByName[r.id]=a,this._uidToLayer.set(r.uid,a)}setLayoutProperties(t,e){const r=this._layerByName[t];if(!r)return;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:e,paint:r.paint},a=ot._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=a,this._style.layers[o].layout=e,this._layerByName[r.id]=a,this._uidToLayer.set(r.uid,a)}setStyleLayerVisibility(t,e){const r=this._layerByName[t];if(!r)return;const i=r.layout||{};i.visibility=e;const a={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:i,paint:r.paint},o=ot._recreateLayer(a,r),s=this.layers.indexOf(r);this.layers[s]=o,this._style.layers[s].layout=i,this._layerByName[r.id]=o,this._uidToLayer.set(r.uid,o)}getStyleLayerVisibility(t){const e=this._layerByName[t];return e?e.layout?.visibility??"visible":"none"}_recomputeZValues(){const t=this.layers,e=1/(t.length+1);for(let r=0;ra.keyo.key?1:0);const i=t.length;for(let a=0;ai.map(i=>d[i]); -import{bR as te,aB as re,o as c,f as M,bS as ie,K as se,bT as ae,a7 as oe,a1 as E,bG as le,ag as k,X as ne,bU as D,_ as pe,bP as y,P as T,bV as ye,bW as V,v as a,S as l,a0 as m,n as Y,bB as q,ac as v,bL as ue,aO as U,J as z,ad as de,i as Q,bO as L,$,bX as J,an as ce,ah as K,av as H,bY as he}from"./main-BZaw9FpY.js";import{m as fe}from"./Version-CoKzbupV-BxOJQpf3.js";import{i as W}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{e as be,X as me}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{I as G}from"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import{f as ge}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{m as Se,u as Ie}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as we}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{C as ve}from"./QueryTask-CwHwH2rS-CU-oJwb3.js";import{f as Ee}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{y as Le}from"./FeatureType-C9hJmS6_-pVJc0p7X.js";import{y as xe}from"./Field-C6hA1tZj-CbELM0zp.js";import{o as Oe}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{Q as Fe,C as Te}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{v as Pe}from"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import{p as _e}from"./Relationship-PyhUibYK-Bz6HFiBe.js";import{x as De}from"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import{c as N,b as Ae,K as X}from"./Query-BrwMGK8U-sojFdYaD.js";import{y as qe}from"./utils-9sQxfkoa-Cus_qP6M.js";import{c as Ce}from"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import{w as Re}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{c as je}from"./sublayerUtils-CyM0QC5B-BB_azrTi.js";const pt=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(r,i){const s=i.capabilities&&i.capabilities.split(",").map(ee=>ee.toLowerCase().trim());if(!s)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const n=this.type,p=n!=="tile"&&!!i.supportsDynamicLayers,u=s.includes("query"),h=s.includes("map"),g=!!i.exportTilesAllowed,S=s.includes("tilemap"),w=s.includes("data"),I=n!=="tile"&&(!i.tileInfo||p),x=n!=="tile"&&(!i.tileInfo||p),d=n!=="tile",f=i.cimVersion?fe.parse(i.cimVersion):null,O=f?.greaterEqual(1,4)??!1,F=f?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:h,supportsExportTiles:g,supportsIdentify:u,supportsQuery:w,supportsTileMap:S},exportMap:h?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:d,supportsDynamicLayers:p,supportsSublayerVisibility:I,supportsSublayerDefinitionExpression:x,supportsCIMSymbols:F}:null,exportTiles:g?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(r,i){let s=i.currentVersion;return s||(s=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),s}async fetchRelatedService(r){const i=this.portalItem;if(!i||!G(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},r).then(n=>n.find(p=>p.type==="Feature Service")??null,()=>null));const s=await this._relatedFeatureServicePromise;return $(r),s?{itemId:s.id,url:s.url}:null}async fetchSublayerInfo(r,i){const{source:s}=r;if(this?.portalItem&&this.type==="tile"&&s?.type==="map-layer"&&G(this.portalItem)&&r.originIdOf("url")y.SERVICE)try{const u=await this._fetchAllLayersAndTablesFromService(n),h=W(n)?.sublayer??s.mapLayerId;p=u.get(h)}catch{}else{let u=r.id;s?.type==="map-layer"&&(u=s.mapLayerId);try{p=(await this.fetchAllLayersAndTables(i)).get(u)}catch{}}return p}async fetchAllLayersAndTables(r){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,r)}async _fetchAllLayersAndTablesFromService(r,i){await this.load(i),this._allLayersAndTablesMap||=new Map;const s=W(r),n=ce(this._allLayersAndTablesMap,s?.url.path,()=>M(J(s?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(u=>{const h=new Map,{layers:g,tables:S}=u.data,w=[...g??[],...S??[]];for(const I of w)h.set(I.id,I);return{result:h}},u=>({error:u}))),p=await n;if($(i),"result"in p)return p.result;throw p.error}};return a([l({readOnly:!0})],t.prototype,"capabilities",void 0),a([m("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),a([l({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),a([l({type:Y})],t.prototype,"fullExtent",void 0),a([l(be)],t.prototype,"id",void 0),a([l({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),a([l(me)],t.prototype,"popupEnabled",void 0),a([l({type:z})],t.prototype,"spatialReference",void 0),a([l({readOnly:!0})],t.prototype,"version",void 0),a([m("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=a([Q("esri.layers.mixins.ArcGISMapService")],t),t};var A;function C(e){return e?.type==="esriSMS"}function R(e,t,r){const i=this.originIdOf(t)>=L(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&r.layer?.type==="map-image"&&(r.writeSublayerStructure||i)}}function j(e,t,r){return{enabled:!!r&&r.layer?.type==="tile"&&(r.origin&&this.originIdOf(t)>=L(r.origin)||this._isOverridden(t))}}function b(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function P(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=L(r.origin))}}let Me=0;const Ve=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let o=A=class extends we(te(re)){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new c("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await M(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:t,url:qe(r)}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},data:{supportsAttachment:u},queryRelated:h}=De(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:u},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},queryRelated:h}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:(t=t.layerDefinition||t).minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new Oe(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields){for(const r of t.fields)if(r.type==="esriFieldTypeGlobalID")return r.name}}get id(){return this._get("id")??Me++}set id(e){this._get("id")!==e&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,t){return t.type==="Table"}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map(s=>s.write({},i))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach(t=>t.layer=e)}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){return(t=t.layerDefinition||t).objectIdField?t.objectIdField:t.fields?.find(r=>r.type==="esriFieldTypeOID")?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const{layerDefinition:r}=t;return 1-.01*(r?.transparency??r?.drawingInfo?.transparency??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=ie(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:t,layer:r,url:i}=this,{spatialReference:s}=r,n="gdbVersion"in r?r.gdbVersion:void 0,p=se("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new ve({fieldsIndex:t,gdbVersion:n,pbfSupported:p,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,url:i})}set renderer(e){if(ae(e,this.fieldsIndex),e){for(const t of e.getSymbols())if(oe(t)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return le(k.ofType(A),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map(i=>i.id).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(s=>s.name.toLowerCase()===r);i&&(r=i.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,t?.type==="map-layer")return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${ne(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=D(this),t=new A;return D(t).store=e.clone(Ve),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return Re(this,e)}createQuery(){return new Ae({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await pe(async()=>{const{default:s}=await import("./FeatureLayer-BrRKw5Si-CHreUEJ9.js");return{default:s}},__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83]),import.meta.url)).default,{layer:t,url:r}=this;let i;if(r&&this.originIdOf("url")>y.SERVICE)i=new e({url:r});else{if(!t?.parsedUrl)throw new c("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const s=t.parsedUrl;i=new e({url:s.path}),s&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return t?.refreshInterval!=null&&(i.refreshInterval=t.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=T(this.floorInfo)),this.originIdOf("labelingInfo")>y.SERVICE&&(i.labelingInfo=T(this.labelingInfo)),this.originIdOf("labelsVisible")>y.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>y.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>y.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>y.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>y.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>y.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>y.DEFAULTS&&(i.popupTemplate=T(this.popupTemplate)),this.originIdOf("renderer")>y.SERVICE&&(i.renderer=T(this.renderer)),this.source?.type==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>y.DEFAULTS&&(i.title=this.title),t?.type==="map-image"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),t?.type==="tile"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return Ee(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const s=i.domains&&i.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=Ce.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new c("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:n,num:p,size:u,start:h,where:g}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||n?.length>0||u?.length>0||p||h||g))throw new c("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||n?.length||g))throw new c("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatureCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const i of r.features)i.sourceLayer=this;return r}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryObjectIds:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryRelatedFeatures:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new c("queryRelatedFeaturesCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=ye(e,this.definitionExpression);r!=null&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,n)=>(s[n]=this.originIdOf(n),s),{});if(Object.keys(i).some(s=>i[s]>y.SERVICE)){const s=t.drawingInfo={};if(i.renderer>y.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>y.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>y.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some(p=>!p.labelPlacement)&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let n=this.labelingInfo;this.geometryType!=null&&(n=Fe(this.labelingInfo,V.toJSON(this.geometryType))),s.showLabels=!0,s.labelingInfo=n.filter(p=>p.labelPlacement).map(p=>p.toJSON({origin:"service",layer:this.layer}))}else s.showLabels=!1;i.opacity>y.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,t=>{t.color||t.style!=="esriSMSX"&&t.style!=="esriSMSCross"||(t.outline?.color?t.color=t.outline.color:t.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const i of r)C(i.symbol)&&t(i.symbol);"symbol"in e&&C(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&C(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,n;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",n="supportsModification"}const p=D(this).getDefaultOrigin();if(p!=="service"){if(s&&this.layer?.capabilities?.exportMap?.[s]===!1)return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&this.capabilities?.exportMap[n]===!1)return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${n}'`)}e!=="source"||this.loadStatus==="not-loaded"?(this._set(e,t),p!=="service"&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null,r.layer=null}),this.removeAllHandles()),e&&(e.forEach(r=>{r.parent=this,r.layer=this.layer}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,r.layer=this.layer}),e.on("after-remove",({item:r})=>{r.parent=null,r.layer=null}),e.on("before-changes",r=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(E.getLogger(this).error(new c("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),r.preventDefault())})]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;E.getLogger(i).error(new c("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};o.test={isMapImageLayerOverridePolicy:e=>e===b||e===R,isTileImageLayerOverridePolicy:e=>e===j},a([l({readOnly:!0})],o.prototype,"capabilities",void 0),a([m("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),a([l()],o.prototype,"defaultPopupTemplate",null),a([l({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:R}}})],o.prototype,"definitionExpression",null),a([l({readOnly:!0})],o.prototype,"effectiveScaleRange",null),a([m("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),a([l({type:[xe],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),a([l({readOnly:!0})],o.prototype,"fieldsIndex",null),a([l({type:Pe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:R},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),a([l({type:Y,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),a([l({type:V.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:V.read}}}}})],o.prototype,"geometryType",void 0),a([l({type:String})],o.prototype,"globalIdField",void 0),a([m("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),a([l({type:q,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),a([l({readOnly:!0})],o.prototype,"isTable",void 0),a([m("service","isTable",["type"])],o.prototype,"readIsTable",null),a([l({value:null,type:[Te],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:b}}})],o.prototype,"labelingInfo",null),a([v("labelingInfo")],o.prototype,"writeLabelingInfo",null),a([l({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:b}}})],o.prototype,"labelsVisible",null),a([l({value:null})],o.prototype,"layer",null),a([l({type:String,json:{write:{overridePolicy:j}}})],o.prototype,"layerItemId",void 0),a([l({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:P}}})],o.prototype,"legendEnabled",void 0),a([l({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"minScale",null),a([m("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"maxScale",null),a([m("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),a([l()],o.prototype,"objectIdField",void 0),a([m("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),a([l({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:b}}})],o.prototype,"opacity",null),a([m("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),a([v("opacity")],o.prototype,"writeOpacity",null),a([l({json:{type:q,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:b}}})],o.prototype,"parent",void 0),a([v("parent")],o.prototype,"writeParent",null),a([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:P,writer(e,t,r){t[r]=!e}}}})],o.prototype,"popupEnabled",void 0),a([l({type:ue,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:P}}})],o.prototype,"popupTemplate",void 0),a([l({readOnly:!0})],o.prototype,"queryTask",null),a([l({type:[_e],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],o.prototype,"relationships",void 0),a([l({types:Se,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b},origins:{"web-scene":{types:Ie,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b}}}}})],o.prototype,"renderer",null),a([l({types:{key:"type",base:null,typeMap:{"data-layer":X,"map-layer":N}},cast(e){if(e){if("mapLayerId"in e)return U(N,e);if("dataSource"in e)return U(X,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:b}}})],o.prototype,"source",null),a([l()],o.prototype,"sourceJSON",void 0),a([l({type:z,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),a([l({value:null,json:{type:[q],write:{target:"subLayerIds",allowNull:!0,overridePolicy:b}}})],o.prototype,"sublayers",null),a([de("sublayers")],o.prototype,"castSublayers",null),a([v("sublayers")],o.prototype,"writeSublayers",null),a([l({type:String,json:{name:"name",write:{overridePolicy:P}}})],o.prototype,"title",void 0),a([m("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),a([l({type:String})],o.prototype,"typeIdField",void 0),a([l({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),a([m("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),a([l({type:[Le],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),a([l({type:String,json:{name:"layerUrl",write:{overridePolicy:j}}})],o.prototype,"url",null),a([l({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:b}}})],o.prototype,"visible",null),a([v("visible")],o.prototype,"writeVisible",null),o=A=a([Q("esri.layers.support.Sublayer")],o);const B=o;function Ne(e,t){const r=[],i={};return e&&e.forEach(s=>{const n=new B;if(n.read(s,t),i[n.id]=n,s.parentLayerId!=null&&s.parentLayerId!==-1){const p=i[s.parentLayerId];p.sublayers||(p.sublayers=[]),p.sublayers.unshift(n)}else r.unshift(n)}),r}const _=k.ofType(B);function Z(e,t){e&&e.forEach(r=>{t(r),r.sublayers&&r.sublayers.length&&Z(r.sublayers,t)})}const yt=e=>{let t=class extends e{constructor(...r){super(...r),this.allSublayers=new ge({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.subtables=null,this.addHandles([K(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),H),K(()=>this.subtables,(i,s)=>this._handleSublayersChange(i,s),H)])}destroy(){this.allSublayers.destroy()}readSublayers(r,i){if(!i||!r)return;const{sublayersSourceJSON:s}=this,n=L(i.origin);if(ny.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:p,origin:u}=this.createSublayersForOrigin("web-document"),h=D(this);h.setDefaultOrigin(u),this._set("sublayers",new _(p)),h.setDefaultOrigin("user")}findSublayerById(r){return this.allSublayers.find(i=>i.id===r)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(r){const i=L(r==="web-document"?"web-map":r);let s=y.SERVICE,n=this.sublayersSourceJSON[y.SERVICE].layers,p=this.sublayersSourceJSON[y.SERVICE].context,u=null;const h=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d<=i);for(const d of h){const f=this.sublayersSourceJSON[d];je(f.layers)&&(s=d,n=f.layers,p=f.context,f.visibleLayers&&(u={visibleLayers:f.visibleLayers,context:f.context}))}const g=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d>s&&d<=i);let S=null;for(const d of g){const{layers:f,visibleLayers:O,context:F}=this.sublayersSourceJSON[d];f&&(S={layers:f,context:F}),O&&(u={visibleLayers:O,context:F})}const w=Ne(n,p),I=new Map,x=new Set;if(S)for(const d of S.layers)I.set(d.id,d);if(u?.visibleLayers)for(const d of u.visibleLayers)x.add(d);return Z(w,d=>{S&&d.read(I.get(d.id),S.context),u&&d.read({defaultVisibility:x.has(d.id)},u.context)}),{origin:he(s),sublayers:new _({items:w})}}read(r,i){super.read(r,i),this.readSublayers(r,i)}_handleSublayersChange(r,i){i&&(i.forEach(s=>{s.parent=null,s.layer=null}),this.removeHandles("sublayers-owner")),r&&(r.forEach(s=>{s.parent=this,s.layer=this}),this.addHandles([r.on("after-add",({item:s})=>{s.parent=this,s.layer=this}),r.on("after-remove",({item:s})=>{s.parent=null,s.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(r.on("before-changes",s=>{E.getLogger("esri.layers.TileLayer").error(new c("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),s.preventDefault()}),"sublayers-owner"))}};return a([l({readOnly:!0})],t.prototype,"allSublayers",void 0),a([l({readOnly:!0,type:k.ofType(B)})],t.prototype,"serviceSublayers",void 0),a([l({value:null,type:_,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),a([l({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),a([l({type:_,json:{read:{source:"tables"}}})],t.prototype,"subtables",void 0),t=a([Q("esri.layers.mixins.SublayersOwner")],t),t};export{B as A,pt as M,yt as k}; diff --git a/main/assets/SublayersOwner-DfTaMJ5V-DBe6p6TL.js b/main/assets/SublayersOwner-DfTaMJ5V-DBe6p6TL.js new file mode 100644 index 000000000..8beaa723a --- /dev/null +++ b/main/assets/SublayersOwner-DfTaMJ5V-DBe6p6TL.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-Rem12G_g.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js","./RendererLegendOptions-K3md58-X-Bf90N-cx.js","./diffUtils-Cz3Fi8Xb-BvD0JNhD.js","./colorRamps-q0bZVhs2-DeDskCk_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-5umqHW84.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./styleUtils-BtpNqZyT-CwQxANzG.js","./jsonUtils-C64Zfu7c-BqaK54UK.js","./LRUCache-C3erQTWv-DhyPlt5p.js","./Version-CoKzbupV-BKAqCewj.js","./FieldsIndex-HmzMbJQG-CzzKuIHi.js","./UnknownTimeZone-C--TOcPG-DfRfNtw8.js","./OverrideHelper-DWRbVlj1-D6dDt4cu.js","./colorUtils-Cthpxcks-CXgjba3p.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-Dl9Ps2XQ.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-1xSDkBxg.js","./heatmapUtils-seiMkkkR-BSMLb7yQ.js","./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js","./commonProperties-BtIqvFU_-DuUske_0.js","./ElevationInfo-yv2-9tj6-CpVy5FM0.js","./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./HeightModelInfo-C5vFqzyF-DTZiz4z_.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./featureLayerUtils-DgfQQyK4-D0OGSvJx.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-DV_czrJX.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./RelationshipQuery-DJsz3K0U-BHNd_b19.js","./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js","./Relationship-PyhUibYK-DuMEI2S9.js","./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js","./Layer-ChoECxvZ--vVxyMLZ.js","./workers-PiCjreoO-DqI62TYf.js","./editsZScale-BDsX6vv--CoeIQyxn.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./FeatureSet-BkVNthuN-DDwR53LR.js","./APIKeyMixin-BUMSx9ny-AE1ffoPb.js","./ArcGISService-BYA-y6X6-BtWUPppI.js","./BlendLayer-D1WkSmwP-D_mOfOGH.js","./jsonUtils-wIllKWI4-DRJhEzZa.js","./parser-DyDJ-rlI-CV6nO3M9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./CustomParametersMixin-vdKsTHer-DndyRc71.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js","./FeatureEffect-CDEk9Es7-CW8HxX_m.js","./FeatureFilter-BCFHgLVU-DU6FY8I7.js","./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js","./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js","./labelingInfo-DGVNul26-ReCWpi39.js","./labelUtils-BW14kBqX-Cu1LInU4.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-B5IUcPZ-.js","./OrderedLayer-6Qsmrd_l-sp1TyHmN.js","./OrderByInfo-GD2XnU8e-CsM0tB0E.js","./PortalLayer-CElnYuSQ-BV63HHSL.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js","./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js","./TemporalLayer-CpOrN_w9-D1I2RE1l.js","./TimeInfo-w_HB2CsF-Ce-xYAJs.js","./FeatureTemplate-SPHPD45f-DdZuptIc.js","./FeatureType-C9hJmS6_-5PPiaaCJ.js","./fieldProperties-Bq26w7gt-DgCDIFFS.js","./versionUtils-LZYZz-38-DgmFurh2.js","./styleUtils-ChrJTYIw-OCRItq_6.js","./popupUtils-B0uZcXX0-B9v3xvNZ.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); +import{bR as te,aB as re,o as c,f as M,bS as ie,K as se,bT as ae,a7 as oe,a1 as E,bG as le,ag as k,X as ne,bU as D,_ as pe,bP as y,P as T,bV as ye,bW as V,v as a,S as l,a0 as m,n as Y,bB as q,ac as v,bL as ue,aO as U,J as z,ad as de,i as Q,bO as L,$,bX as J,an as ce,ah as K,av as H,bY as he}from"./main-C7yV2j71.js";import{m as fe}from"./Version-CoKzbupV-BKAqCewj.js";import{i as W}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{e as be,X as me}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{I as G}from"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import{f as ge}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{m as Se,u as Ie}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{m as we}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{C as ve}from"./QueryTask-CwHwH2rS-CT1NKU1Q.js";import{f as Ee}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{y as Le}from"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import{y as xe}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{o as Oe}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{Q as Fe,C as Te}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{v as Pe}from"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import{p as _e}from"./Relationship-PyhUibYK-DuMEI2S9.js";import{x as De}from"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import{c as N,b as Ae,K as X}from"./Query-BrwMGK8U-DV_czrJX.js";import{y as qe}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{c as Ce}from"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import{w as Re}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{c as je}from"./sublayerUtils-CyM0QC5B-BQ17aSXL.js";const pt=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(r,i){const s=i.capabilities&&i.capabilities.split(",").map(ee=>ee.toLowerCase().trim());if(!s)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const n=this.type,p=n!=="tile"&&!!i.supportsDynamicLayers,u=s.includes("query"),h=s.includes("map"),g=!!i.exportTilesAllowed,S=s.includes("tilemap"),w=s.includes("data"),I=n!=="tile"&&(!i.tileInfo||p),x=n!=="tile"&&(!i.tileInfo||p),d=n!=="tile",f=i.cimVersion?fe.parse(i.cimVersion):null,O=f?.greaterEqual(1,4)??!1,F=f?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:h,supportsExportTiles:g,supportsIdentify:u,supportsQuery:w,supportsTileMap:S},exportMap:h?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:d,supportsDynamicLayers:p,supportsSublayerVisibility:I,supportsSublayerDefinitionExpression:x,supportsCIMSymbols:F}:null,exportTiles:g?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(r,i){let s=i.currentVersion;return s||(s=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),s}async fetchRelatedService(r){const i=this.portalItem;if(!i||!G(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},r).then(n=>n.find(p=>p.type==="Feature Service")??null,()=>null));const s=await this._relatedFeatureServicePromise;return $(r),s?{itemId:s.id,url:s.url}:null}async fetchSublayerInfo(r,i){const{source:s}=r;if(this?.portalItem&&this.type==="tile"&&s?.type==="map-layer"&&G(this.portalItem)&&r.originIdOf("url")y.SERVICE)try{const u=await this._fetchAllLayersAndTablesFromService(n),h=W(n)?.sublayer??s.mapLayerId;p=u.get(h)}catch{}else{let u=r.id;s?.type==="map-layer"&&(u=s.mapLayerId);try{p=(await this.fetchAllLayersAndTables(i)).get(u)}catch{}}return p}async fetchAllLayersAndTables(r){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,r)}async _fetchAllLayersAndTablesFromService(r,i){await this.load(i),this._allLayersAndTablesMap||=new Map;const s=W(r),n=ce(this._allLayersAndTablesMap,s?.url.path,()=>M(J(s?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(u=>{const h=new Map,{layers:g,tables:S}=u.data,w=[...g??[],...S??[]];for(const I of w)h.set(I.id,I);return{result:h}},u=>({error:u}))),p=await n;if($(i),"result"in p)return p.result;throw p.error}};return a([l({readOnly:!0})],t.prototype,"capabilities",void 0),a([m("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),a([l({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),a([l({type:Y})],t.prototype,"fullExtent",void 0),a([l(be)],t.prototype,"id",void 0),a([l({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),a([l(me)],t.prototype,"popupEnabled",void 0),a([l({type:z})],t.prototype,"spatialReference",void 0),a([l({readOnly:!0})],t.prototype,"version",void 0),a([m("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=a([Q("esri.layers.mixins.ArcGISMapService")],t),t};var A;function C(e){return e?.type==="esriSMS"}function R(e,t,r){const i=this.originIdOf(t)>=L(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&r.layer?.type==="map-image"&&(r.writeSublayerStructure||i)}}function j(e,t,r){return{enabled:!!r&&r.layer?.type==="tile"&&(r.origin&&this.originIdOf(t)>=L(r.origin)||this._isOverridden(t))}}function b(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function P(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=L(r.origin))}}let Me=0;const Ve=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let o=A=class extends we(te(re)){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new c("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await M(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:t,url:qe(r)}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},data:{supportsAttachment:u},queryRelated:h}=De(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:u},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},queryRelated:h}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:(t=t.layerDefinition||t).minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new Oe(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields){for(const r of t.fields)if(r.type==="esriFieldTypeGlobalID")return r.name}}get id(){return this._get("id")??Me++}set id(e){this._get("id")!==e&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,t){return t.type==="Table"}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map(s=>s.write({},i))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach(t=>t.layer=e)}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){return(t=t.layerDefinition||t).objectIdField?t.objectIdField:t.fields?.find(r=>r.type==="esriFieldTypeOID")?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const{layerDefinition:r}=t;return 1-.01*(r?.transparency??r?.drawingInfo?.transparency??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=ie(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:t,layer:r,url:i}=this,{spatialReference:s}=r,n="gdbVersion"in r?r.gdbVersion:void 0,p=se("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new ve({fieldsIndex:t,gdbVersion:n,pbfSupported:p,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,url:i})}set renderer(e){if(ae(e,this.fieldsIndex),e){for(const t of e.getSymbols())if(oe(t)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return le(k.ofType(A),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map(i=>i.id).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(s=>s.name.toLowerCase()===r);i&&(r=i.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,t?.type==="map-layer")return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${ne(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=D(this),t=new A;return D(t).store=e.clone(Ve),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return Re(this,e)}createQuery(){return new Ae({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await pe(async()=>{const{default:s}=await import("./FeatureLayer-BrRKw5Si-Rem12G_g.js");return{default:s}},__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83]),import.meta.url)).default,{layer:t,url:r}=this;let i;if(r&&this.originIdOf("url")>y.SERVICE)i=new e({url:r});else{if(!t?.parsedUrl)throw new c("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const s=t.parsedUrl;i=new e({url:s.path}),s&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return t?.refreshInterval!=null&&(i.refreshInterval=t.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=T(this.floorInfo)),this.originIdOf("labelingInfo")>y.SERVICE&&(i.labelingInfo=T(this.labelingInfo)),this.originIdOf("labelsVisible")>y.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>y.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>y.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>y.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>y.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>y.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>y.DEFAULTS&&(i.popupTemplate=T(this.popupTemplate)),this.originIdOf("renderer")>y.SERVICE&&(i.renderer=T(this.renderer)),this.source?.type==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>y.DEFAULTS&&(i.title=this.title),t?.type==="map-image"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),t?.type==="tile"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return Ee(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const s=i.domains&&i.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=Ce.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new c("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:n,num:p,size:u,start:h,where:g}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||n?.length>0||u?.length>0||p||h||g))throw new c("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||n?.length||g))throw new c("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatureCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const i of r.features)i.sourceLayer=this;return r}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryObjectIds:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryRelatedFeatures:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new c("queryRelatedFeaturesCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=ye(e,this.definitionExpression);r!=null&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,n)=>(s[n]=this.originIdOf(n),s),{});if(Object.keys(i).some(s=>i[s]>y.SERVICE)){const s=t.drawingInfo={};if(i.renderer>y.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>y.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>y.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some(p=>!p.labelPlacement)&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let n=this.labelingInfo;this.geometryType!=null&&(n=Fe(this.labelingInfo,V.toJSON(this.geometryType))),s.showLabels=!0,s.labelingInfo=n.filter(p=>p.labelPlacement).map(p=>p.toJSON({origin:"service",layer:this.layer}))}else s.showLabels=!1;i.opacity>y.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,t=>{t.color||t.style!=="esriSMSX"&&t.style!=="esriSMSCross"||(t.outline?.color?t.color=t.outline.color:t.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const i of r)C(i.symbol)&&t(i.symbol);"symbol"in e&&C(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&C(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,n;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",n="supportsModification"}const p=D(this).getDefaultOrigin();if(p!=="service"){if(s&&this.layer?.capabilities?.exportMap?.[s]===!1)return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&this.capabilities?.exportMap[n]===!1)return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${n}'`)}e!=="source"||this.loadStatus==="not-loaded"?(this._set(e,t),p!=="service"&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null,r.layer=null}),this.removeAllHandles()),e&&(e.forEach(r=>{r.parent=this,r.layer=this.layer}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,r.layer=this.layer}),e.on("after-remove",({item:r})=>{r.parent=null,r.layer=null}),e.on("before-changes",r=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(E.getLogger(this).error(new c("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),r.preventDefault())})]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;E.getLogger(i).error(new c("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};o.test={isMapImageLayerOverridePolicy:e=>e===b||e===R,isTileImageLayerOverridePolicy:e=>e===j},a([l({readOnly:!0})],o.prototype,"capabilities",void 0),a([m("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),a([l()],o.prototype,"defaultPopupTemplate",null),a([l({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:R}}})],o.prototype,"definitionExpression",null),a([l({readOnly:!0})],o.prototype,"effectiveScaleRange",null),a([m("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),a([l({type:[xe],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),a([l({readOnly:!0})],o.prototype,"fieldsIndex",null),a([l({type:Pe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:R},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),a([l({type:Y,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),a([l({type:V.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:V.read}}}}})],o.prototype,"geometryType",void 0),a([l({type:String})],o.prototype,"globalIdField",void 0),a([m("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),a([l({type:q,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),a([l({readOnly:!0})],o.prototype,"isTable",void 0),a([m("service","isTable",["type"])],o.prototype,"readIsTable",null),a([l({value:null,type:[Te],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:b}}})],o.prototype,"labelingInfo",null),a([v("labelingInfo")],o.prototype,"writeLabelingInfo",null),a([l({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:b}}})],o.prototype,"labelsVisible",null),a([l({value:null})],o.prototype,"layer",null),a([l({type:String,json:{write:{overridePolicy:j}}})],o.prototype,"layerItemId",void 0),a([l({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:P}}})],o.prototype,"legendEnabled",void 0),a([l({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"minScale",null),a([m("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"maxScale",null),a([m("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),a([l()],o.prototype,"objectIdField",void 0),a([m("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),a([l({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:b}}})],o.prototype,"opacity",null),a([m("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),a([v("opacity")],o.prototype,"writeOpacity",null),a([l({json:{type:q,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:b}}})],o.prototype,"parent",void 0),a([v("parent")],o.prototype,"writeParent",null),a([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:P,writer(e,t,r){t[r]=!e}}}})],o.prototype,"popupEnabled",void 0),a([l({type:ue,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:P}}})],o.prototype,"popupTemplate",void 0),a([l({readOnly:!0})],o.prototype,"queryTask",null),a([l({type:[_e],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],o.prototype,"relationships",void 0),a([l({types:Se,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b},origins:{"web-scene":{types:Ie,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b}}}}})],o.prototype,"renderer",null),a([l({types:{key:"type",base:null,typeMap:{"data-layer":X,"map-layer":N}},cast(e){if(e){if("mapLayerId"in e)return U(N,e);if("dataSource"in e)return U(X,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:b}}})],o.prototype,"source",null),a([l()],o.prototype,"sourceJSON",void 0),a([l({type:z,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),a([l({value:null,json:{type:[q],write:{target:"subLayerIds",allowNull:!0,overridePolicy:b}}})],o.prototype,"sublayers",null),a([de("sublayers")],o.prototype,"castSublayers",null),a([v("sublayers")],o.prototype,"writeSublayers",null),a([l({type:String,json:{name:"name",write:{overridePolicy:P}}})],o.prototype,"title",void 0),a([m("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),a([l({type:String})],o.prototype,"typeIdField",void 0),a([l({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),a([m("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),a([l({type:[Le],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),a([l({type:String,json:{name:"layerUrl",write:{overridePolicy:j}}})],o.prototype,"url",null),a([l({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:b}}})],o.prototype,"visible",null),a([v("visible")],o.prototype,"writeVisible",null),o=A=a([Q("esri.layers.support.Sublayer")],o);const B=o;function Ne(e,t){const r=[],i={};return e&&e.forEach(s=>{const n=new B;if(n.read(s,t),i[n.id]=n,s.parentLayerId!=null&&s.parentLayerId!==-1){const p=i[s.parentLayerId];p.sublayers||(p.sublayers=[]),p.sublayers.unshift(n)}else r.unshift(n)}),r}const _=k.ofType(B);function Z(e,t){e&&e.forEach(r=>{t(r),r.sublayers&&r.sublayers.length&&Z(r.sublayers,t)})}const yt=e=>{let t=class extends e{constructor(...r){super(...r),this.allSublayers=new ge({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.subtables=null,this.addHandles([K(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),H),K(()=>this.subtables,(i,s)=>this._handleSublayersChange(i,s),H)])}destroy(){this.allSublayers.destroy()}readSublayers(r,i){if(!i||!r)return;const{sublayersSourceJSON:s}=this,n=L(i.origin);if(ny.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:p,origin:u}=this.createSublayersForOrigin("web-document"),h=D(this);h.setDefaultOrigin(u),this._set("sublayers",new _(p)),h.setDefaultOrigin("user")}findSublayerById(r){return this.allSublayers.find(i=>i.id===r)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(r){const i=L(r==="web-document"?"web-map":r);let s=y.SERVICE,n=this.sublayersSourceJSON[y.SERVICE].layers,p=this.sublayersSourceJSON[y.SERVICE].context,u=null;const h=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d<=i);for(const d of h){const f=this.sublayersSourceJSON[d];je(f.layers)&&(s=d,n=f.layers,p=f.context,f.visibleLayers&&(u={visibleLayers:f.visibleLayers,context:f.context}))}const g=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d>s&&d<=i);let S=null;for(const d of g){const{layers:f,visibleLayers:O,context:F}=this.sublayersSourceJSON[d];f&&(S={layers:f,context:F}),O&&(u={visibleLayers:O,context:F})}const w=Ne(n,p),I=new Map,x=new Set;if(S)for(const d of S.layers)I.set(d.id,d);if(u?.visibleLayers)for(const d of u.visibleLayers)x.add(d);return Z(w,d=>{S&&d.read(I.get(d.id),S.context),u&&d.read({defaultVisibility:x.has(d.id)},u.context)}),{origin:he(s),sublayers:new _({items:w})}}read(r,i){super.read(r,i),this.readSublayers(r,i)}_handleSublayersChange(r,i){i&&(i.forEach(s=>{s.parent=null,s.layer=null}),this.removeHandles("sublayers-owner")),r&&(r.forEach(s=>{s.parent=this,s.layer=this}),this.addHandles([r.on("after-add",({item:s})=>{s.parent=this,s.layer=this}),r.on("after-remove",({item:s})=>{s.parent=null,s.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(r.on("before-changes",s=>{E.getLogger("esri.layers.TileLayer").error(new c("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),s.preventDefault()}),"sublayers-owner"))}};return a([l({readOnly:!0})],t.prototype,"allSublayers",void 0),a([l({readOnly:!0,type:k.ofType(B)})],t.prototype,"serviceSublayers",void 0),a([l({value:null,type:_,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),a([l({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),a([l({type:_,json:{read:{source:"tables"}}})],t.prototype,"subtables",void 0),t=a([Q("esri.layers.mixins.SublayersOwner")],t),t};export{B as A,pt as M,yt as k}; diff --git a/main/assets/SubtypeGroupLayer-D1vAbwEU-BGQuWZvd.js b/main/assets/SubtypeGroupLayer-D1vAbwEU-BGQuWZvd.js new file mode 100644 index 000000000..d456fc776 --- /dev/null +++ b/main/assets/SubtypeGroupLayer-D1vAbwEU-BGQuWZvd.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-DOSVCD4F.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./utils-BVWK2jiA-D8rVYIEJ.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./jsonContext-BA8GHqVk-DpBf0bCt.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./fetchService-DbaKmJhP-DPDp5i2e.js","./FeatureLayerSource-k4WMYop1-z-zJ1lao.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-Bzqlxz38.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-QYZk68_K.js","./mat4-DX7gBViE-vewreEuZ.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Dbd8ftOx.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-3W9GNLNT.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./clientSideDefaults-BqqayPct-B0cLE-po.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-CT1NKU1Q.js","./Query-BrwMGK8U-DV_czrJX.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./executeForIds-Z1gkLduF-BNBrXf-U.js","./query-DFW9-NG_-CfusC8cS.js","./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js","./pbf-D-y3_eZO-SEvl9j6c.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./executeQueryPBF-o8010HS9-E5WwNUPn.js","./featureConversionUtils-D6hFQ4Af-sYSorBK9.js","./FeatureSet-BkVNthuN-DDwR53LR.js","./executeQueryJSON-CcHnccia-CB1D7q08.js","./featureLayerUtils-DgfQQyK4-D0OGSvJx.js","./jsonUtils-C64Zfu7c-BqaK54UK.js","./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js","./RendererLegendOptions-K3md58-X-Bf90N-cx.js","./diffUtils-Cz3Fi8Xb-BvD0JNhD.js","./colorRamps-q0bZVhs2-DeDskCk_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-5umqHW84.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./styleUtils-BtpNqZyT-CwQxANzG.js","./LRUCache-C3erQTWv-DhyPlt5p.js","./Version-CoKzbupV-BKAqCewj.js","./FieldsIndex-HmzMbJQG-CzzKuIHi.js","./UnknownTimeZone-C--TOcPG-DfRfNtw8.js","./OverrideHelper-DWRbVlj1-D6dDt4cu.js","./colorUtils-Cthpxcks-CXgjba3p.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-Dl9Ps2XQ.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-1xSDkBxg.js","./heatmapUtils-seiMkkkR-BSMLb7yQ.js","./RelationshipQuery-DJsz3K0U-BHNd_b19.js","./editsZScale-BDsX6vv--CoeIQyxn.js"])))=>i.map(i=>d[i]); +import{d4 as W,aa as V,bR as K,bT as P,P as v,el as Z,a1 as ee,J as te,o as b,bV as q,v as i,S as o,ac as re,bL as ie,a0 as I,i as H,ag as L,bp as se,ah as oe,av as ne,W as ae,a as le,bX as pe,a_ as ue,_ as D,em as de,jS as ye,hG as ce,jT as he,aB as me}from"./main-C7yV2j71.js";import{y as fe}from"./loadAll-e978YItg-NjG3VBGi.js";import{m as Q}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as be}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as ve}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as we}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as Fe}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{C as Se}from"./EditBusLayer-Df29OyJh-DJOAJb6r.js";import{H as Ie,$ as Oe}from"./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as Te}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as $e}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as Ce}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{I as _e}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{J as xe,Y as Le,_ as Ae,t as qe,n as Pe,X as De,e as Re}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{t as N,s as U,c as Ge,l as Ve,Q as He,$ as Qe,U as Ne,_ as Ue,z as ke,o as Me,B as Be,H as Je,K as Xe,X as Ye,W as ze,Y as We,e as Ke}from"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import{f as k}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{E as Ze,d as et,o as tt}from"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{p as $}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{X as rt}from"./colorUtils-Cthpxcks-CXgjba3p.js";import{u as it}from"./cimSymbolUtils-CKIzBgMU-D2oNADot.js";import{x as st,C as ot}from"./utils-DPtQ14k3-BW98GOs_.js";import{p as M}from"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import{C as nt,q as at}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{b as B}from"./Query-BrwMGK8U-DV_czrJX.js";import{w as lt}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import{w as pt}from"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import{a as ut}from"./versionUtils-LZYZz-38-DgmFurh2.js";import{E}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";const J={key:"type",base:Ze,errorContext:"renderer",typeMap:{simple:$,"unique-value":et,"class-breaks":tt}},A=W({types:J});function dt(e,t){const r=e.drawingInfo?.renderer,s=r?A(r,e,t):null;if(s?.type==="simple")return st(s.symbol,null)?s.symbol.clone():null}const yt=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];function ct(e,t){return rt(yt,e,{offset:!0,shuffle:!0}).reverse().map(r=>{const s=t.clone();return s.type==="cim"?it(s,r):ot(s,r),new $({symbol:s})})}const R=k();let ht=0;function S(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function mt(e){return new $({symbol:ft(e)})}function ft(e){switch(e){case"point":case"multipoint":return he.clone();case"polyline":return ce.clone();case"polygon":case"multipatch":return ye.clone();default:return null}}function bt(e,t){return!!t&&e?.type==="unique-value"&&e.field!=null&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function X(e,t){return e==null?null:t.subtypes?.find(r=>r.code===e)}function gt(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const s={},l=X(e,t);if(l!=null){const{defaultValues:a}=l;for(const u in a)s[u]=a[u]}return s[t.subtypeField]=e,new M({name:"New Feature",drawingTool:r,prototype:{attributes:s}})}let n=class extends Q(V(K(me))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ht++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return P(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:s,parent:l}=this;let a;if(s){a=[];let u=0;s.forEach(({name:d,alias:y,editable:w,visible:F})=>{if(!F)return;const c=l?.fields?.find(j=>j.name===d);if(!c)return;const f={name:d};let g=!1;y!==c.alias&&(f.alias=y,g=!0),w!==c.editable&&(f.editable=w,g=!0),a.push(f),g&&u++}),u===0&&a.length===s.length&&(a=null)}else a=v(e);a?.length&&Z(r,a,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,s=e?.fields;if(!e||!s?.length)return null;const{subtypes:l,subtypeField:a}=e,u=l?.find(F=>F.code===r),d=u?.defaultValues,y=u?.domains,w=[];for(const F of s){const c=F.clone(),{name:f}=c,g=t?.find(O=>O.name===f);if(c.visible=!t||!!g,g){const{alias:O,editable:z}=g;O&&(c.alias=O),z===!1&&(c.editable=!1)}const j=d?.[f]??null;c.defaultValue=f===a?r:j;const C=y?.[f]??null;c.domain=f===a?null:C?C.type==="inherited"?c.domain:C.clone():null,w.push(c)}return w}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||ee.getLogger(this).error(h("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){P(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?mt(e.geometryType):null}readRendererFromService(e,t,r){if(t.type==="Table")return null;const s=t.drawingInfo?.renderer,l=A(s,t,r);let a;const{subtypeCode:u}=this;if(u!=null&&bt(l,t.subtypeField)){const d=l.uniqueValueInfos?.find(({value:y})=>(y=typeof y=="number"?String(y):y)===String(u));d&&(a=new $({symbol:d.symbol}))}else l?.type!=="simple"||l.visualVariables?.length||(a=l);return a}readRenderer(e,t,r){const s=t?.layerDefinition?.drawingInfo?.renderer;return s?s.visualVariables?.some(l=>l.type!=="rotationInfo")?void 0:A(s,t,r)||void 0:void 0}get spatialReference(){return this.parent?.spatialReference??te.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[gt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=X(this.subtypeCode,t);return r!=null?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw h("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:s}=this;if(!s)throw h("updateAttachment");if(e.getAttribute(s.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return s.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw h("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw h("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:s,title:l}=this;if(r){const{displayField:a,editFieldsInfo:u,objectIdField:d}=r;t={displayField:a,editFieldsInfo:u,fields:s,objectIdField:d,title:l}}return lt(t,e)}createQuery(){if(!this.parent)throw h("createQuery");const e=N(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=q(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const r=U(this.parent,e);if(r)return r}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw h("queryAttachments");const s=e.clone();return s.where=Y(s.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatureCount");return r.parent.queryFeatureCount(_(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatures");return r.parent.queryFeatures(_(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw h("queryObjectIds");return r.parent.queryObjectIds(_(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([o({type:xe,json:{name:"attributeTableInfo",write:{ignoreOrigin:!0}}})],n.prototype,"attributeTableTemplate",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"capabilities",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"effectiveCapabilities",null),i([o({json:{write:{ignoreOrigin:!0}}})],n.prototype,"charts",void 0),i([o({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],n.prototype,"editingEnabled",void 0),i([o({type:Boolean,readOnly:!0})],n.prototype,"effectiveEditingEnabled",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"elevationInfo",null),i([o({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],n.prototype,"fieldOverrides",void 0),i([re("fieldOverrides")],n.prototype,"writeFieldOverrides",null),i([o({...R.fields,readOnly:!0,json:{read:!1}})],n.prototype,"fields",null),i([o(R.fieldsIndex)],n.prototype,"fieldsIndex",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"floorInfo",null),i([o({type:Ie,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],n.prototype,"formTemplate",void 0),i([o({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"id",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"geometryType",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),i([o(S(v(Le)))],n.prototype,"labelsVisible",void 0),i([o({type:[nt],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:at},write:{ignoreOrigin:!0}}})],n.prototype,"labelingInfo",void 0),i([o({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],n.prototype,"layerType",void 0),i([o(S(v(Ae)))],n.prototype,"legendEnabled",void 0),i([o({type:["show","hide"]})],n.prototype,"listMode",void 0),i([o((()=>{const e=v(qe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"minScale",void 0),i([o((()=>{const e=v(Pe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"maxScale",void 0),i([o({readOnly:!0})],n.prototype,"effectiveScaleRange",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"objectIdField",null),i([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],n.prototype,"opacity",void 0),i([o({clonable:!1})],n.prototype,"parent",void 0),i([o(S(v(De)))],n.prototype,"popupEnabled",void 0),i([o({type:ie,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],n.prototype,"popupTemplate",void 0),i([o({readOnly:!0})],n.prototype,"defaultPopupTemplate",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"relationships",null),i([o({types:J,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],n.prototype,"renderer",null),i([I("service","renderer",["drawingInfo.renderer","subtypeField","type"])],n.prototype,"readRendererFromService",null),i([I("renderer",["layerDefinition.drawingInfo.renderer"])],n.prototype,"readRenderer",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"spatialReference",null),i([o({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"subtypeCode",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"subtypeField",null),i([o({type:[M],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],n.prototype,"templates",void 0),i([I("service","templates",["geometryType","subtypeField","subtypes","type"])],n.prototype,"readTemplatesFromService",null),i([o({type:String,json:{write:{ignoreOrigin:!0}}})],n.prototype,"title",void 0),i([I("service","title",["subtypes"])],n.prototype,"readTitleFromService",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"url",null),i([o({readOnly:!0})],n.prototype,"userHasUpdateItemPrivileges",null),i([o({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],n.prototype,"visible",void 0),n=i([H("esri.layers.support.SubtypeSublayer")],n);const _=(e,t,r)=>{if(!r)return t.createQuery();const s=B.from(r);return s.where=Y(s.where,e.subtypeField,t.subtypeCode),s},Y=(e,t,r)=>{const s=new RegExp(`${t}\\s*=\\s*\\d+`),l=`${t}=${r}`,a=e??"";return s.test(a)?a.replace(s,l):q(l,a)},h=e=>new b(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=n,m="SubtypeGroupLayer",vt="esri.layers.SubtypeGroupLayer";function G(e,t){return new b("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const x=k();let p=class extends Oe(Se(we(Ce(je($e(ve(Ee(Te(Q(Fe(ge(V(be))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(L.ofType(T)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=se(async(t,r,s)=>{const{save:l,saveAs:a}=await D(()=>import("./featureLayerUtils-BlPdhYbm-DOSVCD4F.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(t){case E.SAVE:return l(this,r);case E.SAVE_AS:return a(this,s,r)}}),this.addHandles(oe(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ae).then(async()=>{if(!this.url)throw new b("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new b("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ge(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Ve(this)}get parsedUrl(){const e=le(this.url);return e!=null&&this.layerId!=null&&(e.path=pe(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?_e(this.url,t):t}async addAttachment(e,t){const r=await He(this,e,t,m);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await Qe(this,e,t,r,m);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await ue(D(()=>import("./FeatureLayerSource-k4WMYop1-z-zJ1lao.js"),__vite__mapDeps([14,1,2,15,16,17,18,19,20,21,9,10,22,23,24,25,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,52,53,12,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=N(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=q(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await Ue(this,e,t,m);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ke(this,e,m)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const s=U(this,e);if(s)return s}const r=Me(this,t?.feature);if(r){const s=r.domains?.[e];return s?.type==="inherited"?this._getLayerDomain(e):s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return fe(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Be(this,e,t,m)}async queryFeatures(e,t){const r=await this.load(),s=B.from(e)??r.createQuery(),l=s.outFields??[];l.includes(this.subtypeField)||(l.push(this.subtypeField),s.outFields=l);const a=await r.source.queryFeatures(s,t);if(a?.features)for(const u of a.features)u.layer=u.sourceLayer=this.findSublayerForFeature(u);return a}async queryObjectIds(e,t){return Je(this,e,t,m)}async queryFeatureCount(e,t){return Xe(this,e,t,m)}async queryExtent(e,t){return Ye(this,e,t,m)}async queryRelatedFeatures(e,t){return ze(this,e,t,m)}async queryRelatedFeaturesCount(e,t){return We(this,e,t,m)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:s,messages:l}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&s!=="tables")return l?.push(G(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&s==="tables")return l?.push(G(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(l?.push(new b("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&ut(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new b("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),de(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return Ke(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)})],"sublayers-owner"))}};i([o({readOnly:!0})],p.prototype,"createQueryVersion",null),i([o({readOnly:!0})],p.prototype,"editingEnabled",null),i([o({readOnly:!0})],p.prototype,"effectiveEditingEnabled",null),i([o({...x.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],p.prototype,"fields",void 0),i([o(x.fieldsIndex)],p.prototype,"fieldsIndex",void 0),i([o(Re)],p.prototype,"id",void 0),i([o({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],p.prototype,"listMode",void 0),i([o({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],p.prototype,"operationalLayerType",void 0),i([o(x.outFields)],p.prototype,"outFields",void 0),i([o({readOnly:!0})],p.prototype,"parsedUrl",null),i([o({clonable:!1})],p.prototype,"source",null),i([o({type:L.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let s=null;if(this.useUniqueColorsForSublayers){const a=dt(t,r);s=a?ct(e.length,a):null}const l=e.map(({code:a},u)=>{const d=new T({subtypeCode:a});d.read(t,r);const y=s?.[u];return y&&d.read({drawingInfo:{renderer:y.toJSON()}},r),d});return new(L.ofType(T))(l)}}}},name:"layers",write:{ignoreOrigin:!0}}})],p.prototype,"sublayers",void 0),i([o()],p.prototype,"useUniqueColorsForSublayers",void 0),i([o({type:pt})],p.prototype,"timeInfo",void 0),i([o({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],p.prototype,"title",void 0),i([I("service","title",["name"])],p.prototype,"readTitleFromService",null),i([o({json:{read:!1}})],p.prototype,"type",void 0),p=i([H(vt)],p);const Dr=p;export{Dr as default}; diff --git a/main/assets/SubtypeGroupLayer-D1vAbwEU-CoAWt7WI.js b/main/assets/SubtypeGroupLayer-D1vAbwEU-CoAWt7WI.js deleted file mode 100644 index ce071bb89..000000000 --- a/main/assets/SubtypeGroupLayer-D1vAbwEU-CoAWt7WI.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-DR3CjbQa.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./utils-BVWK2jiA-Ewzf326n.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./jsonContext-BA8GHqVk-BMETb6sX.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./fetchService-DbaKmJhP-CtznRt8p.js","./FeatureLayerSource-k4WMYop1-BFDYORV0.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js","./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-MFWeclAP.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-B7P01ZzU.js","./mat4-DX7gBViE-CQMXDC3Z.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Bk09s2KF.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-Bz3XNCt8.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./clientSideDefaults-BqqayPct-BMC57bnT.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-CU-oJwb3.js","./Query-BrwMGK8U-sojFdYaD.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./executeForIds-Z1gkLduF-Daa1fnES.js","./query-DFW9-NG_-1nHUNdNu.js","./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js","./pbf-D-y3_eZO-BOjQwfR-.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./executeQueryPBF-o8010HS9-dWp8mQx-.js","./featureConversionUtils-D6hFQ4Af-CkdezteH.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./executeQueryJSON-CcHnccia-DVecwfbV.js","./featureLayerUtils-DgfQQyK4-D6z7j0IK.js","./jsonUtils-C64Zfu7c-trwRB9M4.js","./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js","./RendererLegendOptions-K3md58-X-B6y5tQg5.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./colorRamps-q0bZVhs2-Bqen3nIx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./styleUtils-BtpNqZyT-B-RFL3S3.js","./LRUCache-C3erQTWv-CeYLuvL9.js","./Version-CoKzbupV-BxOJQpf3.js","./FieldsIndex-HmzMbJQG-CiA2Ur00.js","./UnknownTimeZone-C--TOcPG-hkNbcn35.js","./OverrideHelper-DWRbVlj1-C2SNS5Gu.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-DpAlEmQT.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-72T4gbed.js","./heatmapUtils-seiMkkkR-D9lAE87R.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./editsZScale-BDsX6vv--CeDyYvz6.js"])))=>i.map(i=>d[i]); -import{d4 as W,aa as V,bR as K,bT as P,P as v,el as Z,a1 as ee,J as te,o as b,bV as q,v as i,S as o,ac as re,bL as ie,a0 as I,i as H,ag as L,bp as se,ah as oe,av as ne,W as ae,a as le,bX as pe,a_ as ue,_ as D,em as de,jS as ye,hG as ce,jT as he,aB as me}from"./main-BZaw9FpY.js";import{y as fe}from"./loadAll-e978YItg-CB-7_cng.js";import{m as Q}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as be}from"./Layer-ChoECxvZ-C4wLrCej.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as ve}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as we}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as Fe}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{C as Se}from"./EditBusLayer-Df29OyJh-C36maE2j.js";import{H as Ie,$ as Oe}from"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as Te}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as $e}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as Ce}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{I as _e}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{J as xe,Y as Le,_ as Ae,t as qe,n as Pe,X as De,e as Re}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{t as N,s as U,c as Ge,l as Ve,Q as He,$ as Qe,U as Ne,_ as Ue,z as ke,o as Me,B as Be,H as Je,K as Xe,X as Ye,W as ze,Y as We,e as Ke}from"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import{f as k}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{E as Ze,d as et,o as tt}from"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{p as $}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{X as rt}from"./colorUtils-Cthpxcks-BhGjp9AU.js";import{u as it}from"./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js";import{x as st,C as ot}from"./utils-DPtQ14k3-D1wtSpry.js";import{p as M}from"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import{C as nt,q as at}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{b as B}from"./Query-BrwMGK8U-sojFdYaD.js";import{w as lt}from"./popupUtils-B0uZcXX0-BqljON9c.js";import{w as pt}from"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import{a as ut}from"./versionUtils-LZYZz-38-xZnsxhiL.js";import{E}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";const J={key:"type",base:Ze,errorContext:"renderer",typeMap:{simple:$,"unique-value":et,"class-breaks":tt}},A=W({types:J});function dt(e,t){const r=e.drawingInfo?.renderer,s=r?A(r,e,t):null;if(s?.type==="simple")return st(s.symbol,null)?s.symbol.clone():null}const yt=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];function ct(e,t){return rt(yt,e,{offset:!0,shuffle:!0}).reverse().map(r=>{const s=t.clone();return s.type==="cim"?it(s,r):ot(s,r),new $({symbol:s})})}const R=k();let ht=0;function S(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function mt(e){return new $({symbol:ft(e)})}function ft(e){switch(e){case"point":case"multipoint":return he.clone();case"polyline":return ce.clone();case"polygon":case"multipatch":return ye.clone();default:return null}}function bt(e,t){return!!t&&e?.type==="unique-value"&&e.field!=null&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function X(e,t){return e==null?null:t.subtypes?.find(r=>r.code===e)}function gt(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const s={},l=X(e,t);if(l!=null){const{defaultValues:a}=l;for(const u in a)s[u]=a[u]}return s[t.subtypeField]=e,new M({name:"New Feature",drawingTool:r,prototype:{attributes:s}})}let n=class extends Q(V(K(me))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ht++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return P(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:s,parent:l}=this;let a;if(s){a=[];let u=0;s.forEach(({name:d,alias:y,editable:w,visible:F})=>{if(!F)return;const c=l?.fields?.find(j=>j.name===d);if(!c)return;const f={name:d};let g=!1;y!==c.alias&&(f.alias=y,g=!0),w!==c.editable&&(f.editable=w,g=!0),a.push(f),g&&u++}),u===0&&a.length===s.length&&(a=null)}else a=v(e);a?.length&&Z(r,a,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,s=e?.fields;if(!e||!s?.length)return null;const{subtypes:l,subtypeField:a}=e,u=l?.find(F=>F.code===r),d=u?.defaultValues,y=u?.domains,w=[];for(const F of s){const c=F.clone(),{name:f}=c,g=t?.find(O=>O.name===f);if(c.visible=!t||!!g,g){const{alias:O,editable:z}=g;O&&(c.alias=O),z===!1&&(c.editable=!1)}const j=d?.[f]??null;c.defaultValue=f===a?r:j;const C=y?.[f]??null;c.domain=f===a?null:C?C.type==="inherited"?c.domain:C.clone():null,w.push(c)}return w}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||ee.getLogger(this).error(h("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){P(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?mt(e.geometryType):null}readRendererFromService(e,t,r){if(t.type==="Table")return null;const s=t.drawingInfo?.renderer,l=A(s,t,r);let a;const{subtypeCode:u}=this;if(u!=null&&bt(l,t.subtypeField)){const d=l.uniqueValueInfos?.find(({value:y})=>(y=typeof y=="number"?String(y):y)===String(u));d&&(a=new $({symbol:d.symbol}))}else l?.type!=="simple"||l.visualVariables?.length||(a=l);return a}readRenderer(e,t,r){const s=t?.layerDefinition?.drawingInfo?.renderer;return s?s.visualVariables?.some(l=>l.type!=="rotationInfo")?void 0:A(s,t,r)||void 0:void 0}get spatialReference(){return this.parent?.spatialReference??te.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[gt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=X(this.subtypeCode,t);return r!=null?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw h("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:s}=this;if(!s)throw h("updateAttachment");if(e.getAttribute(s.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return s.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw h("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw h("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:s,title:l}=this;if(r){const{displayField:a,editFieldsInfo:u,objectIdField:d}=r;t={displayField:a,editFieldsInfo:u,fields:s,objectIdField:d,title:l}}return lt(t,e)}createQuery(){if(!this.parent)throw h("createQuery");const e=N(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=q(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const r=U(this.parent,e);if(r)return r}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw h("queryAttachments");const s=e.clone();return s.where=Y(s.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatureCount");return r.parent.queryFeatureCount(_(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatures");return r.parent.queryFeatures(_(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw h("queryObjectIds");return r.parent.queryObjectIds(_(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([o({type:xe,json:{name:"attributeTableInfo",write:{ignoreOrigin:!0}}})],n.prototype,"attributeTableTemplate",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"capabilities",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"effectiveCapabilities",null),i([o({json:{write:{ignoreOrigin:!0}}})],n.prototype,"charts",void 0),i([o({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],n.prototype,"editingEnabled",void 0),i([o({type:Boolean,readOnly:!0})],n.prototype,"effectiveEditingEnabled",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"elevationInfo",null),i([o({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],n.prototype,"fieldOverrides",void 0),i([re("fieldOverrides")],n.prototype,"writeFieldOverrides",null),i([o({...R.fields,readOnly:!0,json:{read:!1}})],n.prototype,"fields",null),i([o(R.fieldsIndex)],n.prototype,"fieldsIndex",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"floorInfo",null),i([o({type:Ie,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],n.prototype,"formTemplate",void 0),i([o({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"id",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"geometryType",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),i([o(S(v(Le)))],n.prototype,"labelsVisible",void 0),i([o({type:[nt],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:at},write:{ignoreOrigin:!0}}})],n.prototype,"labelingInfo",void 0),i([o({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],n.prototype,"layerType",void 0),i([o(S(v(Ae)))],n.prototype,"legendEnabled",void 0),i([o({type:["show","hide"]})],n.prototype,"listMode",void 0),i([o((()=>{const e=v(qe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"minScale",void 0),i([o((()=>{const e=v(Pe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"maxScale",void 0),i([o({readOnly:!0})],n.prototype,"effectiveScaleRange",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"objectIdField",null),i([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],n.prototype,"opacity",void 0),i([o({clonable:!1})],n.prototype,"parent",void 0),i([o(S(v(De)))],n.prototype,"popupEnabled",void 0),i([o({type:ie,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],n.prototype,"popupTemplate",void 0),i([o({readOnly:!0})],n.prototype,"defaultPopupTemplate",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"relationships",null),i([o({types:J,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],n.prototype,"renderer",null),i([I("service","renderer",["drawingInfo.renderer","subtypeField","type"])],n.prototype,"readRendererFromService",null),i([I("renderer",["layerDefinition.drawingInfo.renderer"])],n.prototype,"readRenderer",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"spatialReference",null),i([o({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"subtypeCode",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"subtypeField",null),i([o({type:[M],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],n.prototype,"templates",void 0),i([I("service","templates",["geometryType","subtypeField","subtypes","type"])],n.prototype,"readTemplatesFromService",null),i([o({type:String,json:{write:{ignoreOrigin:!0}}})],n.prototype,"title",void 0),i([I("service","title",["subtypes"])],n.prototype,"readTitleFromService",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"url",null),i([o({readOnly:!0})],n.prototype,"userHasUpdateItemPrivileges",null),i([o({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],n.prototype,"visible",void 0),n=i([H("esri.layers.support.SubtypeSublayer")],n);const _=(e,t,r)=>{if(!r)return t.createQuery();const s=B.from(r);return s.where=Y(s.where,e.subtypeField,t.subtypeCode),s},Y=(e,t,r)=>{const s=new RegExp(`${t}\\s*=\\s*\\d+`),l=`${t}=${r}`,a=e??"";return s.test(a)?a.replace(s,l):q(l,a)},h=e=>new b(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=n,m="SubtypeGroupLayer",vt="esri.layers.SubtypeGroupLayer";function G(e,t){return new b("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const x=k();let p=class extends Oe(Se(we(Ce(je($e(ve(Ee(Te(Q(Fe(ge(V(be))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(L.ofType(T)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=se(async(t,r,s)=>{const{save:l,saveAs:a}=await D(()=>import("./featureLayerUtils-BlPdhYbm-DR3CjbQa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(t){case E.SAVE:return l(this,r);case E.SAVE_AS:return a(this,s,r)}}),this.addHandles(oe(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ae).then(async()=>{if(!this.url)throw new b("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new b("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ge(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Ve(this)}get parsedUrl(){const e=le(this.url);return e!=null&&this.layerId!=null&&(e.path=pe(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?_e(this.url,t):t}async addAttachment(e,t){const r=await He(this,e,t,m);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await Qe(this,e,t,r,m);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await ue(D(()=>import("./FeatureLayerSource-k4WMYop1-BFDYORV0.js"),__vite__mapDeps([14,1,2,15,16,17,18,19,20,21,9,10,22,23,24,25,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,52,53,12,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=N(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=q(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await Ue(this,e,t,m);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ke(this,e,m)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const s=U(this,e);if(s)return s}const r=Me(this,t?.feature);if(r){const s=r.domains?.[e];return s?.type==="inherited"?this._getLayerDomain(e):s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return fe(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Be(this,e,t,m)}async queryFeatures(e,t){const r=await this.load(),s=B.from(e)??r.createQuery(),l=s.outFields??[];l.includes(this.subtypeField)||(l.push(this.subtypeField),s.outFields=l);const a=await r.source.queryFeatures(s,t);if(a?.features)for(const u of a.features)u.layer=u.sourceLayer=this.findSublayerForFeature(u);return a}async queryObjectIds(e,t){return Je(this,e,t,m)}async queryFeatureCount(e,t){return Xe(this,e,t,m)}async queryExtent(e,t){return Ye(this,e,t,m)}async queryRelatedFeatures(e,t){return ze(this,e,t,m)}async queryRelatedFeaturesCount(e,t){return We(this,e,t,m)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:s,messages:l}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&s!=="tables")return l?.push(G(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&s==="tables")return l?.push(G(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(l?.push(new b("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&ut(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new b("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),de(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return Ke(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)})],"sublayers-owner"))}};i([o({readOnly:!0})],p.prototype,"createQueryVersion",null),i([o({readOnly:!0})],p.prototype,"editingEnabled",null),i([o({readOnly:!0})],p.prototype,"effectiveEditingEnabled",null),i([o({...x.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],p.prototype,"fields",void 0),i([o(x.fieldsIndex)],p.prototype,"fieldsIndex",void 0),i([o(Re)],p.prototype,"id",void 0),i([o({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],p.prototype,"listMode",void 0),i([o({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],p.prototype,"operationalLayerType",void 0),i([o(x.outFields)],p.prototype,"outFields",void 0),i([o({readOnly:!0})],p.prototype,"parsedUrl",null),i([o({clonable:!1})],p.prototype,"source",null),i([o({type:L.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let s=null;if(this.useUniqueColorsForSublayers){const a=dt(t,r);s=a?ct(e.length,a):null}const l=e.map(({code:a},u)=>{const d=new T({subtypeCode:a});d.read(t,r);const y=s?.[u];return y&&d.read({drawingInfo:{renderer:y.toJSON()}},r),d});return new(L.ofType(T))(l)}}}},name:"layers",write:{ignoreOrigin:!0}}})],p.prototype,"sublayers",void 0),i([o()],p.prototype,"useUniqueColorsForSublayers",void 0),i([o({type:pt})],p.prototype,"timeInfo",void 0),i([o({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],p.prototype,"title",void 0),i([I("service","title",["name"])],p.prototype,"readTitleFromService",null),i([o({json:{read:!1}})],p.prototype,"type",void 0),p=i([H(vt)],p);const Dr=p;export{Dr as default}; diff --git a/main/assets/SubtypeGroupLayerView2D-Byn0xzbb-BzLYGxjv.js b/main/assets/SubtypeGroupLayerView2D-Byn0xzbb-BzLYGxjv.js new file mode 100644 index 000000000..9c7660ca2 --- /dev/null +++ b/main/assets/SubtypeGroupLayerView2D-Byn0xzbb-BzLYGxjv.js @@ -0,0 +1,7 @@ +import{v as s,i as d,ah as n,aL as u,K as l}from"./main-C7yV2j71.js";import{r as g}from"./FeatureLayerView2D-NmRd_IhT-y-h-pDhr.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./LayerView-Bish-E63-I2LV0oDm.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./SDFHelper-B6k8Ig6R-C81pIMYz.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-X6GWMgRY.js";import"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";let i=class extends g{initialize(){this.addHandles([n(()=>this.view.scale,()=>this._update(),u)],"constructor")}isUpdating(){const t=this.layer.sublayers.some(a=>a.renderer!=null),r=this._commandsQueue.updateTracking.updating,o=this._updatingRequiredFieldsPromise!=null,p=!this._workerProxy,m=this.dataUpdating,e=t&&(r||o||p||m);return l("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${e} + -> hasRenderer ${t} + -> hasPendingCommand ${r} + -> updatingRequiredFields ${o} + -> updatingProxy ${p} + -> updatingPipeline ${m} +`),e}};i=s([d("esri.views.2d.layers.SubtypeGroupLayerView2D")],i);const lt=i;export{lt as default}; diff --git a/main/assets/SubtypeGroupLayerView2D-Byn0xzbb-C7M02_8L.js b/main/assets/SubtypeGroupLayerView2D-Byn0xzbb-C7M02_8L.js deleted file mode 100644 index 4d3abbd60..000000000 --- a/main/assets/SubtypeGroupLayerView2D-Byn0xzbb-C7M02_8L.js +++ /dev/null @@ -1,7 +0,0 @@ -import{v as s,i as d,ah as n,aL as u,K as l}from"./main-BZaw9FpY.js";import{r as g}from"./FeatureLayerView2D-NmRd_IhT-DgaiegpQ.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./timeSupport-ohWmWReZ-CwKm-94j.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./LayerView-Bish-E63-DRGspiuk.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./SDFHelper-B6k8Ig6R-KWOw5fv6.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-xbvi-u4x.js";import"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";let i=class extends g{initialize(){this.addHandles([n(()=>this.view.scale,()=>this._update(),u)],"constructor")}isUpdating(){const t=this.layer.sublayers.some(a=>a.renderer!=null),r=this._commandsQueue.updateTracking.updating,o=this._updatingRequiredFieldsPromise!=null,p=!this._workerProxy,m=this.dataUpdating,e=t&&(r||o||p||m);return l("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${e} - -> hasRenderer ${t} - -> hasPendingCommand ${r} - -> updatingRequiredFields ${o} - -> updatingProxy ${p} - -> updatingPipeline ${m} -`),e}};i=s([d("esri.views.2d.layers.SubtypeGroupLayerView2D")],i);const lt=i;export{lt as default}; diff --git a/main/assets/TablesMixin-C8RojhYs-CMxVrapj.js b/main/assets/TablesMixin-C8RojhYs-CMxVrapj.js new file mode 100644 index 000000000..48e18070e --- /dev/null +++ b/main/assets/TablesMixin-C8RojhYs-CMxVrapj.js @@ -0,0 +1 @@ +import{f as c}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import{v as l,S as h,i as p,ag as u,a1 as i,am as f,t as m}from"./main-C7yV2j71.js";import{D as b}from"./Layer-ChoECxvZ--vVxyMLZ.js";function x(o){return new c({getCollections:()=>[o.tables,o.layers],getChildrenFunction:s=>{const e=[];return"tables"in s&&e.push(s.tables),"layers"in s&&e.push(s.layers),e},itemFilterFunction:s=>{const e=s.parent;return!!e&&"tables"in e&&e.tables.includes(s)}})}function $(o){for(const s of o.values())s?.destroy();o.clear()}function d(o,s,e){let r,a;if(o)for(let n=0,t=o.length;n{let s=class extends o{constructor(...e){super(...e),this.layers=new u;const r=t=>{t.parent&&"remove"in t.parent&&t.parent.remove(t)},a=t=>{t.parent=this,this.layerAdded(t),t.type!=="elevation"&&t.type!=="base-elevation"||i.getLogger(this).error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as an operational layer and will therefore be ignored.`)},n=t=>{t.parent=null,this.layerRemoved(t)};this.addHandles([this.layers.on("before-add",t=>{if(t.item===this)return t.preventDefault(),void i.getLogger(this).error("#add()","Cannot add layer to itself.");r(t.item)}),this.layers.on("after-add",t=>a(t.item)),this.layers.on("after-remove",t=>n(t.item))])}destroy(){const e=this.layers.toArray();for(const r of e)r.destroy();this.layers.destroy()}set layers(e){this._set("layers",f(e,this._get("layers")))}add(e,r){const a=this.layers;if(r=a.getNextIndex(r),e instanceof b){const n=e;n.parent===this?this.reorder(n,r):a.add(n,r)}else m(e)?e.then(n=>{this.destroyed||this.add(n,r)}):i.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,r){const a=this.layers;let n=a.getNextIndex(r);e.slice().forEach(t=>{t.parent!==this?(a.add(t,n),n+=1):this.reorder(t,n)})}findLayerById(e){return d(this.layers,"id",e)}findLayerByUid(e){return d(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,r){return this.layers.reorder(e,r)}layerAdded(e){}layerRemoved(e){}};return l([h()],s.prototype,"layers",null),s=l([p("esri.support.LayersMixin")],s),s};function y(o,s,e){if(o)for(let r=0,a=o.length;r{let s=class extends o{constructor(...e){super(...e),this.tables=new u,this.addHandles([this.tables.on("after-add",r=>{const a=r.item;a.parent&&a.parent!==this&&"tables"in a.parent&&a.parent.tables.remove(a),a.parent=this,a.type!=="feature"&&i.getLogger(this).error(`Layer 'title:${a.title}, id:${a.id}' of type '${a.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const e=this.tables.toArray();for(const r of e)r.destroy();this.tables.destroy()}set tables(e){this._set("tables",f(e,this._get("tables")))}findTableById(e){return y(this.tables,"id",e)}findTableByUid(e){return y(this.tables,"uid",e)}};return l([h()],s.prototype,"tables",null),s=l([p("esri.support.TablesMixin")],s),s};export{A as L,x as g,$ as v,w as x}; diff --git a/main/assets/TablesMixin-C8RojhYs-DjK1Q1jj.js b/main/assets/TablesMixin-C8RojhYs-DjK1Q1jj.js deleted file mode 100644 index 4454a556e..000000000 --- a/main/assets/TablesMixin-C8RojhYs-DjK1Q1jj.js +++ /dev/null @@ -1 +0,0 @@ -import{f as c}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import{v as l,S as h,i as p,ag as u,a1 as i,am as f,t as m}from"./main-BZaw9FpY.js";import{D as b}from"./Layer-ChoECxvZ-C4wLrCej.js";function x(o){return new c({getCollections:()=>[o.tables,o.layers],getChildrenFunction:s=>{const e=[];return"tables"in s&&e.push(s.tables),"layers"in s&&e.push(s.layers),e},itemFilterFunction:s=>{const e=s.parent;return!!e&&"tables"in e&&e.tables.includes(s)}})}function $(o){for(const s of o.values())s?.destroy();o.clear()}function d(o,s,e){let r,a;if(o)for(let n=0,t=o.length;n{let s=class extends o{constructor(...e){super(...e),this.layers=new u;const r=t=>{t.parent&&"remove"in t.parent&&t.parent.remove(t)},a=t=>{t.parent=this,this.layerAdded(t),t.type!=="elevation"&&t.type!=="base-elevation"||i.getLogger(this).error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as an operational layer and will therefore be ignored.`)},n=t=>{t.parent=null,this.layerRemoved(t)};this.addHandles([this.layers.on("before-add",t=>{if(t.item===this)return t.preventDefault(),void i.getLogger(this).error("#add()","Cannot add layer to itself.");r(t.item)}),this.layers.on("after-add",t=>a(t.item)),this.layers.on("after-remove",t=>n(t.item))])}destroy(){const e=this.layers.toArray();for(const r of e)r.destroy();this.layers.destroy()}set layers(e){this._set("layers",f(e,this._get("layers")))}add(e,r){const a=this.layers;if(r=a.getNextIndex(r),e instanceof b){const n=e;n.parent===this?this.reorder(n,r):a.add(n,r)}else m(e)?e.then(n=>{this.destroyed||this.add(n,r)}):i.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,r){const a=this.layers;let n=a.getNextIndex(r);e.slice().forEach(t=>{t.parent!==this?(a.add(t,n),n+=1):this.reorder(t,n)})}findLayerById(e){return d(this.layers,"id",e)}findLayerByUid(e){return d(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,r){return this.layers.reorder(e,r)}layerAdded(e){}layerRemoved(e){}};return l([h()],s.prototype,"layers",null),s=l([p("esri.support.LayersMixin")],s),s};function y(o,s,e){if(o)for(let r=0,a=o.length;r{let s=class extends o{constructor(...e){super(...e),this.tables=new u,this.addHandles([this.tables.on("after-add",r=>{const a=r.item;a.parent&&a.parent!==this&&"tables"in a.parent&&a.parent.tables.remove(a),a.parent=this,a.type!=="feature"&&i.getLogger(this).error(`Layer 'title:${a.title}, id:${a.id}' of type '${a.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const e=this.tables.toArray();for(const r of e)r.destroy();this.tables.destroy()}set tables(e){this._set("tables",f(e,this._get("tables")))}findTableById(e){return y(this.tables,"id",e)}findTableByUid(e){return y(this.tables,"uid",e)}};return l([h()],s.prototype,"tables",null),s=l([p("esri.support.TablesMixin")],s),s};export{A as L,x as g,$ as v,w as x}; diff --git a/main/assets/TechniqueInstance-DGTKoOL6-C7NzYd8c.js b/main/assets/TechniqueInstance-DGTKoOL6-C7NzYd8c.js new file mode 100644 index 000000000..92f977ae2 --- /dev/null +++ b/main/assets/TechniqueInstance-DGTKoOL6-C7NzYd8c.js @@ -0,0 +1 @@ +import{K as c,o as E,a1 as S}from"./main-C7yV2j71.js";import{a as h,P as v,V as F,U,f as M,A as L,L as O,O as k,T as R}from"./definitions-DJSdSb77-DkoRHaVx.js";import{Z as T}from"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import{v as x,C as B}from"./LabelMetric-BeluzH3o-CQPyji82.js";import{G as w,M as A}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as $}from"./Program-DLVwTiPA-CHQtoRqS.js";import{H as D,V as z}from"./Texture-BCt2hphT-CtQVMDnp.js";import{h as P}from"./TileContainer-D48pXXgL-DSah9A2g.js";const G=()=>S.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:n,textureOnly:o}=t,a=x(n);this.blockIndex=i,this.pixelType=n,this.size=e,this.textureOnly=o,o||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&(t==="0"&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new D;return t.wrapMode=w.CLAMP_TO_EDGE,t.samplingMode=A.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=T(t),n=this.data,o=s*this.texelSize+e;!n||o>=n.length||(n[o]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(this.data==null)return null;const i=T(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new $(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;c("esri-2d-update-debug")&&console.debug(`Version[${e}] AttributeStoreView.updateTexture`,{start:i,end:s,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,o=this.getTexture(t),a=4,u=(i-i%this.size)/this.size,d=(s-s%this.size)/this.size,l=u,f=this.size,p=d,_=u*this.size*a,g=(f+p*this.size)*a-_,b=x(this.pixelType),I=new b(n,_*b.BYTES_PER_ELEMENT,g),V=this.size,y=p-l+1;if(y>this.size)return void G().error(new E("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,l,V,y,I)}catch{}}update(t){const{data:e,start:i,end:s}=t;if(e!=null&&this.data!=null){const n=this.data,o=i*this.texelSize;for(let a=0;ai!=null?new m(i,this.size,s):null);else for(let i=0;ir.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(r){r.context.capabilities.enable("textureFloatLinear"),super.doRender(r)}get hasAnimations(){for(const r of this.children)if(r.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),this.attributeView.size!==0))for(const r of this._entityIndex.values())r.dirty&&(this.attributeView.setData(r.displayId,h.LocalTimeOrigin,0,r.firstIndexed),r.dirty=!1)}restartAnimation(r){const t=this._entityIndex.get(r);if(!t)return;const e=performance.now()/1e3;t.firstIndexed=e,t.dirty=!0}restartAllAnimations(){const r=performance.now()/1e3;for(const[t,e]of this._entityIndex)e.firstIndexed=r,e.dirty=!0}_reindexFeatures(){const r=performance.now()/1e3;for(const t of this.children)for(const e of t.entityIds){const{objectId:i}=e;let s=this._entityIndex.get(i);s||(s={objectId:i,displayId:0,firstIndexed:r,lastIndexed:0,dirty:!0},this._entityIndex.set(i,s)),s.lastIndexed=r,s.displayId=e.displayId}for(const[t,e]of this._entityIndex)r-e.lastIndexed>q&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update(),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(r){const t=super.createRenderParams(r);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}};function X(r){return r}class tt{constructor(t,e,i){this._instanceId=t,this.techniqueRef=e,this._input=i}get instanceId(){return this._instanceId}createMeshInfo(t){return{id:this._instanceId,techniqueType:this.techniqueRef.type,inputParams:t,optionalAttributes:this._input.optionalAttributes}}getInput(){return this._input}setInput(t){this._input=t}}export{X as G,tt as Z,W as j}; diff --git a/main/assets/TechniqueInstance-DGTKoOL6-DTmGWHpp.js b/main/assets/TechniqueInstance-DGTKoOL6-DTmGWHpp.js deleted file mode 100644 index 2ee9f222c..000000000 --- a/main/assets/TechniqueInstance-DGTKoOL6-DTmGWHpp.js +++ /dev/null @@ -1 +0,0 @@ -import{K as c,o as E,a1 as S}from"./main-BZaw9FpY.js";import{a as h,P as v,V as F,U,f as M,A as L,L as O,O as k,T as R}from"./definitions-DJSdSb77-DkoRHaVx.js";import{Z as T}from"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import{v as x,C as B}from"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import{G as w,M as A}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as $}from"./Program-DLVwTiPA-DUDrdGpa.js";import{H as D,V as z}from"./Texture-BCt2hphT-D-X9O5uh.js";import{h as P}from"./TileContainer-D48pXXgL-DNbVOEpu.js";const G=()=>S.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:n,textureOnly:o}=t,a=x(n);this.blockIndex=i,this.pixelType=n,this.size=e,this.textureOnly=o,o||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&(t==="0"&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new D;return t.wrapMode=w.CLAMP_TO_EDGE,t.samplingMode=A.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=T(t),n=this.data,o=s*this.texelSize+e;!n||o>=n.length||(n[o]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(this.data==null)return null;const i=T(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new $(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;c("esri-2d-update-debug")&&console.debug(`Version[${e}] AttributeStoreView.updateTexture`,{start:i,end:s,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,o=this.getTexture(t),a=4,u=(i-i%this.size)/this.size,d=(s-s%this.size)/this.size,l=u,f=this.size,p=d,_=u*this.size*a,g=(f+p*this.size)*a-_,b=x(this.pixelType),I=new b(n,_*b.BYTES_PER_ELEMENT,g),V=this.size,y=p-l+1;if(y>this.size)return void G().error(new E("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,l,V,y,I)}catch{}}update(t){const{data:e,start:i,end:s}=t;if(e!=null&&this.data!=null){const n=this.data,o=i*this.texelSize;for(let a=0;ai!=null?new m(i,this.size,s):null);else for(let i=0;ir.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(r){r.context.capabilities.enable("textureFloatLinear"),super.doRender(r)}get hasAnimations(){for(const r of this.children)if(r.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),this.attributeView.size!==0))for(const r of this._entityIndex.values())r.dirty&&(this.attributeView.setData(r.displayId,h.LocalTimeOrigin,0,r.firstIndexed),r.dirty=!1)}restartAnimation(r){const t=this._entityIndex.get(r);if(!t)return;const e=performance.now()/1e3;t.firstIndexed=e,t.dirty=!0}restartAllAnimations(){const r=performance.now()/1e3;for(const[t,e]of this._entityIndex)e.firstIndexed=r,e.dirty=!0}_reindexFeatures(){const r=performance.now()/1e3;for(const t of this.children)for(const e of t.entityIds){const{objectId:i}=e;let s=this._entityIndex.get(i);s||(s={objectId:i,displayId:0,firstIndexed:r,lastIndexed:0,dirty:!0},this._entityIndex.set(i,s)),s.lastIndexed=r,s.displayId=e.displayId}for(const[t,e]of this._entityIndex)r-e.lastIndexed>q&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update(),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(r){const t=super.createRenderParams(r);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}};function X(r){return r}class tt{constructor(t,e,i){this._instanceId=t,this.techniqueRef=e,this._input=i}get instanceId(){return this._instanceId}createMeshInfo(t){return{id:this._instanceId,techniqueType:this.techniqueRef.type,inputParams:t,optionalAttributes:this._input.optionalAttributes}}getInput(){return this._input}setInput(t){this._input=t}}export{X as G,tt as Z,W as j}; diff --git a/main/assets/TelemetryDisplay-Bq2PXfI8-8bnvuClQ.js b/main/assets/TelemetryDisplay-Bq2PXfI8-8bnvuClQ.js new file mode 100644 index 000000000..715c93832 --- /dev/null +++ b/main/assets/TelemetryDisplay-Bq2PXfI8-8bnvuClQ.js @@ -0,0 +1 @@ +import{aa as l,v as o,S as t,i as s,e as i}from"./main-C7yV2j71.js";let e=class extends l(i){constructor(r){super(r),this.frame=null,this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};o([t({type:Boolean})],e.prototype,"frame",void 0),o([t({type:Boolean})],e.prototype,"frameCenter",void 0),o([t({type:Boolean})],e.prototype,"frameOutline",void 0),o([t({type:Boolean})],e.prototype,"lineOfSight",void 0),o([t({type:Boolean})],e.prototype,"sensorLocation",void 0),o([t({type:Boolean})],e.prototype,"sensorTrail",void 0),e=o([s("esri.layers.support.TelemetryDisplay")],e);const a=e;export{a}; diff --git a/main/assets/TelemetryDisplay-Bq2PXfI8-BWfBxjew.js b/main/assets/TelemetryDisplay-Bq2PXfI8-BWfBxjew.js deleted file mode 100644 index 7617e5bd0..000000000 --- a/main/assets/TelemetryDisplay-Bq2PXfI8-BWfBxjew.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as l,v as o,S as t,i as s,e as i}from"./main-BZaw9FpY.js";let e=class extends l(i){constructor(r){super(r),this.frame=null,this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};o([t({type:Boolean})],e.prototype,"frame",void 0),o([t({type:Boolean})],e.prototype,"frameCenter",void 0),o([t({type:Boolean})],e.prototype,"frameOutline",void 0),o([t({type:Boolean})],e.prototype,"lineOfSight",void 0),o([t({type:Boolean})],e.prototype,"sensorLocation",void 0),o([t({type:Boolean})],e.prototype,"sensorTrail",void 0),e=o([s("esri.layers.support.TelemetryDisplay")],e);const a=e;export{a}; diff --git a/main/assets/TemporalLayer-CpOrN_w9-D1I2RE1l.js b/main/assets/TemporalLayer-CpOrN_w9-D1I2RE1l.js new file mode 100644 index 000000000..94f8b341c --- /dev/null +++ b/main/assets/TemporalLayer-CpOrN_w9-D1I2RE1l.js @@ -0,0 +1 @@ +import{v as t,S as i,a0 as a,i as l,em as u}from"./main-C7yV2j71.js";import{s as y}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{r as m,w as d,v as w}from"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import{k as x}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";const O={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:y}}},T=p=>{let e=class extends p{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(o,f){const r=f.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,s=w.fromJSON(r.timeOffsetUnits);return n&&s?new m({value:n,unit:s}):null}set timeInfo(o){u(o,this.fieldsIndex),this._set("timeInfo",o)}};return t([i({type:x,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([i({type:m})],e.prototype,"timeOffset",void 0),t([a("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([i({value:null,type:d,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([i(O)],e.prototype,"useViewTime",void 0),e=t([l("esri.layers.mixins.TemporalLayer")],e),e};export{O as m,T as x}; diff --git a/main/assets/TemporalLayer-CpOrN_w9-kgJDrMMF.js b/main/assets/TemporalLayer-CpOrN_w9-kgJDrMMF.js deleted file mode 100644 index 71e960d47..000000000 --- a/main/assets/TemporalLayer-CpOrN_w9-kgJDrMMF.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as i,a0 as a,i as l,em as u}from"./main-BZaw9FpY.js";import{s as y}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{r as m,w as d,v as w}from"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import{k as x}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";const O={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:y}}},T=p=>{let e=class extends p{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(o,f){const r=f.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,s=w.fromJSON(r.timeOffsetUnits);return n&&s?new m({value:n,unit:s}):null}set timeInfo(o){u(o,this.fieldsIndex),this._set("timeInfo",o)}};return t([i({type:x,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([i({type:m})],e.prototype,"timeOffset",void 0),t([a("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([i({value:null,type:d,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([i(O)],e.prototype,"useViewTime",void 0),e=t([l("esri.layers.mixins.TemporalLayer")],e),e};export{O as m,T as x}; diff --git a/main/assets/Texture-BCt2hphT-CtQVMDnp.js b/main/assets/Texture-BCt2hphT-CtQVMDnp.js new file mode 100644 index 000000000..5385c9b0f --- /dev/null +++ b/main/assets/Texture-BCt2hphT-CtQVMDnp.js @@ -0,0 +1 @@ +import{K as $,o as p,a1 as Y}from"./main-C7yV2j71.js";import{P as I,U as d,F as G,M as E,G as z,V as B,B as a,t as T,I as M,H as x,S as k}from"./enums-DBi1-Mm2-CUS1pvQe.js";const K=()=>Y.getLogger("esri.views.webgl.checkWebGLError");function q(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const X=!!$("enable-feature:webgl-debug");function H(){return X}function ce(){return X}function N(t){if(H()){const e=t.getError();if(e){const r=q(t,e),o=new Error().stack;K().error(new p("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}var O;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(O||(O={}));function j(t){switch(t){case M.BYTE:case M.UNSIGNED_BYTE:return 1;case M.SHORT:case M.UNSIGNED_SHORT:case M.HALF_FLOAT:return 2;case M.FLOAT:case M.INT:case M.UNSIGNED_INT:return 4}}function Q(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function le(t,e,r,o,s=0){const n=t.gl;t.bindBuffer(r);for(const i of o){const c=e.get(i.name);if(c==null){console.warn(`There is no location for vertex attribute '${i.name}' defined.`);continue}const _=s*i.stride;if(i.count<=4)n.vertexAttribPointer(c,i.count,i.type,i.normalized,i.stride,i.offset+_),n.enableVertexAttribArray(c),i.divisor>0&&t.gl.vertexAttribDivisor(c,i.divisor);else if(i.count===9)for(let l=0;l<3;l++)n.vertexAttribPointer(c+l,3,i.type,i.normalized,i.stride,i.offset+12*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl.vertexAttribDivisor(c+l,i.divisor);else if(i.count===16)for(let l=0;l<4;l++)n.vertexAttribPointer(c+l,4,i.type,i.normalized,i.stride,i.offset+16*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl?.vertexAttribDivisor(c+l,i.divisor);else console.error("Unsupported vertex attribute element count: "+i.count);if(H()){const l=Q(t),h=j(i.type),u=i.offset,m=Math.round(h/u)!==h/u?`. Offset not a multiple of stride. DataType requires ${h} bytes, but descriptor has an offset of ${u}`:"";l&&console.error(`Unable to bind vertex attribute "${i.name}" with baseInstanceOffset ${_}${m}:`,l,i)}}}function _e(t,e,r,o){const s=t.gl;t.bindBuffer(r);for(const n of o){const i=e.get(n.name);if(n.count<=4)s.disableVertexAttribArray(i),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i,0);else if(n.count===9)for(let c=0;c<3;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else if(n.count===16)for(let c=0;c<4;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else console.error("Unsupported vertex attribute element count: "+n.count)}t.unbindBuffer(k.ARRAY_BUFFER)}function Z(t){switch(t){case d.ALPHA:case d.LUMINANCE:case d.RED:case d.RED_INTEGER:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case x.STENCIL_INDEX8:return 1;case d.LUMINANCE_ALPHA:case d.RG:case d.RG_INTEGER:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case x.DEPTH_COMPONENT16:return 2;case d.DEPTH_COMPONENT:case d.RGB:case d.RGB_INTEGER:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case x.DEPTH_COMPONENT24:return 3;case d.DEPTH_STENCIL:case d.DEPTH24_STENCIL8:case d.RGBA:case d.RGBA_INTEGER:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case x.DEPTH_STENCIL:case x.DEPTH_COMPONENT32F:case x.DEPTH24_STENCIL8:return 4;case x.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case T.COMPRESSED_RGB_S3TC_DXT1_EXT:case T.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case T.COMPRESSED_RGBA_S3TC_DXT3_EXT:case T.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case T.COMPRESSED_R11_EAC:case T.COMPRESSED_SIGNED_R11_EAC:case T.COMPRESSED_RGB8_ETC2:case T.COMPRESSED_SRGB8_ETC2:case T.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case T.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case T.COMPRESSED_RG11_EAC:case T.COMPRESSED_SIGNED_RG11_EAC:case T.COMPRESSED_RGBA8_ETC2_EAC:case T.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let J=class{constructor(t=0,e=t){this.width=t,this.height=e,this.target=I.TEXTURE_2D,this.pixelFormat=d.RGBA,this.dataType=G.UNSIGNED_BYTE,this.samplingMode=E.LINEAR,this.wrapMode=z.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function ee(t){return t.width<=0||t.height<=0?0:Math.round(t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:Z(t.internalFormat))*(t.target===I.TEXTURE_CUBE_MAP?6:1))}class F extends J{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case a.R16F:case a.R16I:case a.R16UI:case a.R32F:case a.R32I:case a.R32UI:case a.R8_SNORM:case a.R8:case a.R8I:case a.R8UI:this.pixelFormat=d.RED}}static validate(e,r){return new F(e,r)}}let te=class g{constructor(e,r=null,o=null){if(this.type=O.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,o=r;else{const s=F.validate(e,r);if(!s)throw new p("Texture descriptor invalid");this._descriptor=s}this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(o):this.setData(o)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return ee(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(B.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,r){const o=this._descriptor;if(o.width!==e||o.height!==r){if(this._wasImmutablyAllocated)throw new p("Immutable textures can't be resized!");o.width=e,o.height=r,this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=I.TEXTURE_CUBE_MAP_POSITIVE_X;r<=I.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){const o=this._descriptor.context?.gl;if(!o)return;N(o),this._glName||(this._glName=o.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(B.Texture,this));const s=this._descriptor,n=r??s.target,i=S(n),c=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),P(s),this._configurePixelStorage(),N(o);const _=this._deriveInternalFormat();if(v(e)){let l="width"in e?e.width:e.codedWidth,h="height"in e?e.height:e.codedHeight;const u=1;e instanceof HTMLVideoElement&&(l=e.videoWidth,h=e.videoHeight),s.width&&s.height,i&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&(this.generateMipmap(),N(o)),s.width||(s.width=l),s.height||(s.height=h),i&&!s.depth&&(s.depth=u)}else{const{width:l,height:h,depth:u}=s;if(l==null||h==null)throw new p("Width and height must be specified!");if(i&&u==null)throw new p("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),U(e)){const m=e.levels,R=y(n,l,h,u),D=Math.min(R-1,m.length-1);o.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,D);const f=_;if(!se(f))throw new p("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((A,b,w,V)=>{const W=m[Math.min(A,m.length-1)];this._compressedTexImage(n,A,f,b,w,V,W)},D)}else this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&this.generateMipmap()}C(o,this._descriptor),L(o,this._descriptor),re(this._descriptor.context,this._descriptor),N(o),this._descriptor.context.bindTexture(c,g.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,o,s,n,i,c=0){i||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const _=this._descriptor,l=this._deriveInternalFormat(),{context:h,pixelFormat:u,dataType:m,target:R,isImmutable:D}=_;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");const f=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+s>_.width||o+n>_.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=h;c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,c),v(i)?A.texSubImage2D(R,e,r,o,s,n,u,m,i):U(i)?A.compressedTexSubImage2D(R,e,r,o,s,n,l,i.levels[e]):A.texSubImage2D(R,e,r,o,s,n,u,m,i),c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,0),h.bindTexture(f,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,o,s,n,i,c,_){_||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,h=this._deriveInternalFormat(),{context:u,pixelFormat:m,dataType:R,isImmutable:D,target:f}=l;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");S(f)||console.warn("Attempting to set 3D texture data on a non-3D texture");const A=u.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||s<0||r+n>l.width||o+i>l.height||s+c>l.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(U(_))_=_.levels[e],b.compressedTexSubImage3D(f,e,r,o,s,n,i,c,h,_);else{const w=_;b.texSubImage3D(f,e,r,o,s,n,i,c,m,R,w)}u.bindTexture(A,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR_MIPMAP_NEAREST):e.samplingMode===E.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR):e.samplingMode===E.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,P(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,r=e.context.gl;this._samplingModeDirty&&(C(r,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(L(r,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===d.DEPTH_STENCIL&&(this._descriptor.internalFormat=d.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case G.FLOAT:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA32F;case d.RGB:return this._descriptor.internalFormat=a.RGB32F;default:throw new p("Unable to derive format")}case G.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA8;case d.RGB:return this._descriptor.internalFormat=a.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===d.DEPTH_STENCIL?d.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:o,preMultiplyAlpha:s}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s?1:0)}_texStorage(e,r,o,s,n,i){const{gl:c}=this._descriptor.context;if(!ie(r))throw new p("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const _=o?y(e,s,n,i):1;if(S(e)){if(i==null)throw new p("Missing depth dimension for 3D texture upload");c.texStorage3D(e,_,r,s,n,i)}else c.texStorage2D(e,_,r,s,n);this._wasImmutablyAllocated=!0}_texImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e),{isImmutable:h,pixelFormat:u,dataType:m}=this._descriptor;if(h){if(c!=null){const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texSubImage3D(e,r,0,0,0,s,n,i,u,m,R)}else _.texSubImage2D(e,r,0,0,s,n,u,m,R)}}else{const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texImage3D(e,r,o,s,n,i,0,u,m,R)}else _.texImage2D(e,r,o,s,n,0,u,m,R)}}_compressedTexImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e);if(this._descriptor.isImmutable){if(c!=null)if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexSubImage3D(e,r,0,0,0,s,n,i,o,c)}else _.compressedTexSubImage2D(e,r,0,0,s,n,o,c)}else if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexImage3D(e,r,o,s,n,i,0,c)}else _.compressedTexImage2D(e,r,o,s,n,0,c)}_forEachMipmapLevel(e,r=1/0){let{width:o,height:s,depth:n,hasMipmap:i,target:c}=this._descriptor;const _=c===I.TEXTURE_3D;if(o==null||s==null||_&&n==null)throw new p("Missing texture dimensions for mipmap calculation");for(let l=0;e(l,o,s,n),i&&(o!==1||s!==1||_&&n!==1)&&!(l>=r);++l)o=Math.max(1,o>>1),s=Math.max(1,s>>1),_&&(n=Math.max(1,n>>1))}};function P(t){(t.width!=null&&t.width<0||t.height!=null&&t.height<0||t.depth!=null&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function C(t,e){let r=e.samplingMode,o=e.samplingMode;r===E.LINEAR_MIPMAP_NEAREST||r===E.LINEAR_MIPMAP_LINEAR?(r=E.LINEAR,e.hasMipmap||(o=E.LINEAR)):r!==E.NEAREST_MIPMAP_NEAREST&&r!==E.NEAREST_MIPMAP_LINEAR||(r=E.NEAREST,e.hasMipmap||(o=E.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,o)}function L(t,e){typeof e.wrapMode=="number"?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}function re(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function ie(t){return t in a}function se(t){return t in T}function U(t){return t!=null&&"type"in t&&t.type==="compressed"}function ae(t){return t!=null&&"byteLength"in t}function v(t){return t!=null&&!U(t)&&!ae(t)}function S(t){return t===I.TEXTURE_3D||t===I.TEXTURE_2D_ARRAY}function y(t,e,r,o=1){let s=Math.max(e,r);return t===I.TEXTURE_3D&&(s=Math.max(s,o)),Math.round(Math.log(s)/Math.LN2)+1}te.TEXTURE_UNIT_FOR_UPDATES=0;export{H as F,F as G,J as H,N,O as P,te as V,Z as X,_e as i,le as r,ce as t,j as v,Q as y}; diff --git a/main/assets/Texture-BCt2hphT-D-X9O5uh.js b/main/assets/Texture-BCt2hphT-D-X9O5uh.js deleted file mode 100644 index 4c37ff94c..000000000 --- a/main/assets/Texture-BCt2hphT-D-X9O5uh.js +++ /dev/null @@ -1 +0,0 @@ -import{K as $,o as p,a1 as Y}from"./main-BZaw9FpY.js";import{P as I,U as d,F as G,M as E,G as z,V as B,B as a,t as T,I as M,H as x,S as k}from"./enums-DBi1-Mm2-CUS1pvQe.js";const K=()=>Y.getLogger("esri.views.webgl.checkWebGLError");function q(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const X=!!$("enable-feature:webgl-debug");function H(){return X}function ce(){return X}function N(t){if(H()){const e=t.getError();if(e){const r=q(t,e),o=new Error().stack;K().error(new p("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}var O;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(O||(O={}));function j(t){switch(t){case M.BYTE:case M.UNSIGNED_BYTE:return 1;case M.SHORT:case M.UNSIGNED_SHORT:case M.HALF_FLOAT:return 2;case M.FLOAT:case M.INT:case M.UNSIGNED_INT:return 4}}function Q(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function le(t,e,r,o,s=0){const n=t.gl;t.bindBuffer(r);for(const i of o){const c=e.get(i.name);if(c==null){console.warn(`There is no location for vertex attribute '${i.name}' defined.`);continue}const _=s*i.stride;if(i.count<=4)n.vertexAttribPointer(c,i.count,i.type,i.normalized,i.stride,i.offset+_),n.enableVertexAttribArray(c),i.divisor>0&&t.gl.vertexAttribDivisor(c,i.divisor);else if(i.count===9)for(let l=0;l<3;l++)n.vertexAttribPointer(c+l,3,i.type,i.normalized,i.stride,i.offset+12*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl.vertexAttribDivisor(c+l,i.divisor);else if(i.count===16)for(let l=0;l<4;l++)n.vertexAttribPointer(c+l,4,i.type,i.normalized,i.stride,i.offset+16*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl?.vertexAttribDivisor(c+l,i.divisor);else console.error("Unsupported vertex attribute element count: "+i.count);if(H()){const l=Q(t),h=j(i.type),u=i.offset,m=Math.round(h/u)!==h/u?`. Offset not a multiple of stride. DataType requires ${h} bytes, but descriptor has an offset of ${u}`:"";l&&console.error(`Unable to bind vertex attribute "${i.name}" with baseInstanceOffset ${_}${m}:`,l,i)}}}function _e(t,e,r,o){const s=t.gl;t.bindBuffer(r);for(const n of o){const i=e.get(n.name);if(n.count<=4)s.disableVertexAttribArray(i),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i,0);else if(n.count===9)for(let c=0;c<3;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else if(n.count===16)for(let c=0;c<4;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else console.error("Unsupported vertex attribute element count: "+n.count)}t.unbindBuffer(k.ARRAY_BUFFER)}function Z(t){switch(t){case d.ALPHA:case d.LUMINANCE:case d.RED:case d.RED_INTEGER:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case x.STENCIL_INDEX8:return 1;case d.LUMINANCE_ALPHA:case d.RG:case d.RG_INTEGER:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case x.DEPTH_COMPONENT16:return 2;case d.DEPTH_COMPONENT:case d.RGB:case d.RGB_INTEGER:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case x.DEPTH_COMPONENT24:return 3;case d.DEPTH_STENCIL:case d.DEPTH24_STENCIL8:case d.RGBA:case d.RGBA_INTEGER:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case x.DEPTH_STENCIL:case x.DEPTH_COMPONENT32F:case x.DEPTH24_STENCIL8:return 4;case x.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case T.COMPRESSED_RGB_S3TC_DXT1_EXT:case T.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case T.COMPRESSED_RGBA_S3TC_DXT3_EXT:case T.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case T.COMPRESSED_R11_EAC:case T.COMPRESSED_SIGNED_R11_EAC:case T.COMPRESSED_RGB8_ETC2:case T.COMPRESSED_SRGB8_ETC2:case T.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case T.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case T.COMPRESSED_RG11_EAC:case T.COMPRESSED_SIGNED_RG11_EAC:case T.COMPRESSED_RGBA8_ETC2_EAC:case T.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let J=class{constructor(t=0,e=t){this.width=t,this.height=e,this.target=I.TEXTURE_2D,this.pixelFormat=d.RGBA,this.dataType=G.UNSIGNED_BYTE,this.samplingMode=E.LINEAR,this.wrapMode=z.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function ee(t){return t.width<=0||t.height<=0?0:Math.round(t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:Z(t.internalFormat))*(t.target===I.TEXTURE_CUBE_MAP?6:1))}class F extends J{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case a.R16F:case a.R16I:case a.R16UI:case a.R32F:case a.R32I:case a.R32UI:case a.R8_SNORM:case a.R8:case a.R8I:case a.R8UI:this.pixelFormat=d.RED}}static validate(e,r){return new F(e,r)}}let te=class g{constructor(e,r=null,o=null){if(this.type=O.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,o=r;else{const s=F.validate(e,r);if(!s)throw new p("Texture descriptor invalid");this._descriptor=s}this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(o):this.setData(o)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return ee(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(B.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,r){const o=this._descriptor;if(o.width!==e||o.height!==r){if(this._wasImmutablyAllocated)throw new p("Immutable textures can't be resized!");o.width=e,o.height=r,this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=I.TEXTURE_CUBE_MAP_POSITIVE_X;r<=I.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){const o=this._descriptor.context?.gl;if(!o)return;N(o),this._glName||(this._glName=o.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(B.Texture,this));const s=this._descriptor,n=r??s.target,i=S(n),c=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),P(s),this._configurePixelStorage(),N(o);const _=this._deriveInternalFormat();if(v(e)){let l="width"in e?e.width:e.codedWidth,h="height"in e?e.height:e.codedHeight;const u=1;e instanceof HTMLVideoElement&&(l=e.videoWidth,h=e.videoHeight),s.width&&s.height,i&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&(this.generateMipmap(),N(o)),s.width||(s.width=l),s.height||(s.height=h),i&&!s.depth&&(s.depth=u)}else{const{width:l,height:h,depth:u}=s;if(l==null||h==null)throw new p("Width and height must be specified!");if(i&&u==null)throw new p("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),U(e)){const m=e.levels,R=y(n,l,h,u),D=Math.min(R-1,m.length-1);o.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,D);const f=_;if(!se(f))throw new p("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((A,b,w,V)=>{const W=m[Math.min(A,m.length-1)];this._compressedTexImage(n,A,f,b,w,V,W)},D)}else this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&this.generateMipmap()}C(o,this._descriptor),L(o,this._descriptor),re(this._descriptor.context,this._descriptor),N(o),this._descriptor.context.bindTexture(c,g.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,o,s,n,i,c=0){i||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const _=this._descriptor,l=this._deriveInternalFormat(),{context:h,pixelFormat:u,dataType:m,target:R,isImmutable:D}=_;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");const f=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+s>_.width||o+n>_.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=h;c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,c),v(i)?A.texSubImage2D(R,e,r,o,s,n,u,m,i):U(i)?A.compressedTexSubImage2D(R,e,r,o,s,n,l,i.levels[e]):A.texSubImage2D(R,e,r,o,s,n,u,m,i),c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,0),h.bindTexture(f,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,o,s,n,i,c,_){_||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,h=this._deriveInternalFormat(),{context:u,pixelFormat:m,dataType:R,isImmutable:D,target:f}=l;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");S(f)||console.warn("Attempting to set 3D texture data on a non-3D texture");const A=u.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||s<0||r+n>l.width||o+i>l.height||s+c>l.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(U(_))_=_.levels[e],b.compressedTexSubImage3D(f,e,r,o,s,n,i,c,h,_);else{const w=_;b.texSubImage3D(f,e,r,o,s,n,i,c,m,R,w)}u.bindTexture(A,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR_MIPMAP_NEAREST):e.samplingMode===E.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR):e.samplingMode===E.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,P(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,r=e.context.gl;this._samplingModeDirty&&(C(r,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(L(r,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===d.DEPTH_STENCIL&&(this._descriptor.internalFormat=d.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case G.FLOAT:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA32F;case d.RGB:return this._descriptor.internalFormat=a.RGB32F;default:throw new p("Unable to derive format")}case G.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA8;case d.RGB:return this._descriptor.internalFormat=a.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===d.DEPTH_STENCIL?d.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:o,preMultiplyAlpha:s}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s?1:0)}_texStorage(e,r,o,s,n,i){const{gl:c}=this._descriptor.context;if(!ie(r))throw new p("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const _=o?y(e,s,n,i):1;if(S(e)){if(i==null)throw new p("Missing depth dimension for 3D texture upload");c.texStorage3D(e,_,r,s,n,i)}else c.texStorage2D(e,_,r,s,n);this._wasImmutablyAllocated=!0}_texImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e),{isImmutable:h,pixelFormat:u,dataType:m}=this._descriptor;if(h){if(c!=null){const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texSubImage3D(e,r,0,0,0,s,n,i,u,m,R)}else _.texSubImage2D(e,r,0,0,s,n,u,m,R)}}else{const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texImage3D(e,r,o,s,n,i,0,u,m,R)}else _.texImage2D(e,r,o,s,n,0,u,m,R)}}_compressedTexImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e);if(this._descriptor.isImmutable){if(c!=null)if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexSubImage3D(e,r,0,0,0,s,n,i,o,c)}else _.compressedTexSubImage2D(e,r,0,0,s,n,o,c)}else if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexImage3D(e,r,o,s,n,i,0,c)}else _.compressedTexImage2D(e,r,o,s,n,0,c)}_forEachMipmapLevel(e,r=1/0){let{width:o,height:s,depth:n,hasMipmap:i,target:c}=this._descriptor;const _=c===I.TEXTURE_3D;if(o==null||s==null||_&&n==null)throw new p("Missing texture dimensions for mipmap calculation");for(let l=0;e(l,o,s,n),i&&(o!==1||s!==1||_&&n!==1)&&!(l>=r);++l)o=Math.max(1,o>>1),s=Math.max(1,s>>1),_&&(n=Math.max(1,n>>1))}};function P(t){(t.width!=null&&t.width<0||t.height!=null&&t.height<0||t.depth!=null&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function C(t,e){let r=e.samplingMode,o=e.samplingMode;r===E.LINEAR_MIPMAP_NEAREST||r===E.LINEAR_MIPMAP_LINEAR?(r=E.LINEAR,e.hasMipmap||(o=E.LINEAR)):r!==E.NEAREST_MIPMAP_NEAREST&&r!==E.NEAREST_MIPMAP_LINEAR||(r=E.NEAREST,e.hasMipmap||(o=E.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,o)}function L(t,e){typeof e.wrapMode=="number"?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}function re(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function ie(t){return t in a}function se(t){return t in T}function U(t){return t!=null&&"type"in t&&t.type==="compressed"}function ae(t){return t!=null&&"byteLength"in t}function v(t){return t!=null&&!U(t)&&!ae(t)}function S(t){return t===I.TEXTURE_3D||t===I.TEXTURE_2D_ARRAY}function y(t,e,r,o=1){let s=Math.max(e,r);return t===I.TEXTURE_3D&&(s=Math.max(s,o)),Math.round(Math.log(s)/Math.LN2)+1}te.TEXTURE_UNIT_FOR_UPDATES=0;export{H as F,F as G,J as H,N,O as P,te as V,Z as X,_e as i,le as r,ce as t,j as v,Q as y}; diff --git a/main/assets/Theme-rblUnB2V-BIrfCzYF.js b/main/assets/Theme-rblUnB2V-BIrfCzYF.js deleted file mode 100644 index adff15155..000000000 --- a/main/assets/Theme-rblUnB2V-BIrfCzYF.js +++ /dev/null @@ -1 +0,0 @@ -import{k0 as tt}from"./main-BZaw9FpY.js";class f{constructor(t){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,s){return t instanceof f?t:new f(e===s?0:100*Math.min(Math.max(1/(s-e)*(t-e),0),1))}}function Ot(i){return new f(i)}Ot(0);const qt=Ot(100),te=Ot(50);function Ue(i){return i instanceof f}function Tt(i){return Number(i)!==i}function ee(i){return{}.toString.call(i)}function mt(i){if(i!=null&&!g(i)){let t=Number(i);return Tt(t)&&Ft(i)&&i!=""?mt(i.replace(/[^0-9.\-]+/g,"")):t}return i}function ie(i){if(ft(i))return new Date(i);if(g(i))return new Date(i);{let t=Number(i);return g(t)?new Date(t):new Date(i)}}function Ve(i){if(Tt(i))return"NaN";if(i===1/0)return"Infinity";if(i===-1/0)return"-Infinity";if(i===0&&1/i==-1/0)return"-0";let t=i<0;i=Math.abs(i);let e,s=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+i),r=s[1],n=s[2]||"";if(s[3]===void 0)e=n===""?r:r+"."+n;else{let a=+s[3];if(i<1)e="0."+Ct("0",a-1)+r+n;else{let o=a-n.length;e=o===0?r+n:o<0?r+n.slice(0,o)+"."+n.slice(o):r+n+Ct("0",o)}}return t?"-"+e:e}function Ct(i,t){return new Array(t+1).join(i)}function ft(i){return ee(i)==="[object Date]"}function Ft(i){return typeof i=="string"}function g(i){return typeof i=="number"&&Number(i)==i}function St(i){return typeof i=="object"&&i!==null}const Mt="__§§§__",Ke="__§§§§__";function st(i,t){const e=i.length;for(let s=0;s0;)--e,t(i[e],e)}function ze(i,t){const e=i.length;for(let s=0;s0;)if(--e,t(i[e],e))return e;return-1}function ne(i,t){const e=Ut(i,t);if(e!==-1)return i[e]}function ae(i,t){const e=re(i,t);if(e!==-1)return i[e]}function oe(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:a===0?(r=!0,e=n+1):s=n}return{found:r,index:r?e-1:e}}function he(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:(a===0&&(r=!0),s=n)}return{found:r,index:e}}function $e(i,t){let e=i.length;for(;e>0;)--e,t(i[e])||i.splice(e,1)}function T(i){return Object.keys(i)}function le(i,t){return T(i).sort(t)}function Ze(i){return Object.assign({},i)}function v(i,t){T(i).forEach(e=>{t(e,i[e])})}function Je(i,t){for(let e in i)if(de(i,e)&&!t(e,i[e]))break}function de(i,t){return{}.hasOwnProperty.call(i,t)}class Vt{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class D{constructor(t){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Qe extends Vt{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){c(this._disposers,t=>{t.dispose()})}}class O extends Vt{constructor(t){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){c(this._disposers,t=>{t.dispose()})}get disposers(){return this._disposers}}class ue extends D{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new D(()=>{--this._counter,this._counter===0&&this.dispose()})}}function qe(i){i.parentNode&&i.parentNode.removeChild(i)}function Kt(i,t,e,s){return i.addEventListener(t,e,s||!1),new D(()=>{i.removeEventListener(t,e,s||!1)})}function ti(i){return Kt(window,"resize",t=>{i()})}function ut(i){switch(i){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function pt(i){return i.pointerId||0}function ei(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let i=document.createElement("button");i.style.position="fixed",i.style.top="0px",i.style.left="-10000px",document.body.appendChild(i),i.focus(),i.blur(),document.body.removeChild(i)}}function ii(i){i&&i.focus()}function si(i){if(ut("pointerevents"))return i;if(ut("touchevents"))switch(i){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(ut("mouseevents"))switch(i){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return i}function Bt(i){if(typeof Touch<"u"&&i instanceof Touch)return!0;if(typeof PointerEvent<"u"&&i instanceof PointerEvent&&i.pointerType!=null)switch(i.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(i instanceof MouseEvent)}else if(i.type!=null&&i.type.match(/^mouse/))return!1;return!0}function ri(i,t,e){i.style[t]=e}function ni(i,t){return i.style[t]}function ai(i){if(i.composedPath){const t=i.composedPath();return t.length===0?null:t[0]}return i.target}function pe(i,t){let e=t;for(;;){if(i===e)return!0;if(e.parentNode===null){if(e.host==null)return!1;e=e.host}else e=e.parentNode}}function ce(i,t){return i.target&&pe(t.root.dom,i.target)}function oi(i,t){i.style.pointerEvents=t?"auto":"none"}function hi(i){if(i.key!==void 0)return i.key;switch(i.keyCode){case 9:return"Tab";case 13:return"Enter";case 16:return"Shift";case 17:return"Control";case 27:return"Escape";case 32:return" ";case 37:return"ArrowLeft";case 38:return"ArrowUp";case 39:return"ArrowRight";case 40:return"ArrowDown";case 46:return"Delete"}return""+i.keyCode}function ge(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function li(){return ge()?1:void 0}function M(i,t){return g(i)?i:i!=null&&g(i.value)&&g(t)?t*i.value:0}function di(i){let t=(""+i).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function ct(i,t=0,e="0"){return typeof i!="string"&&(i=i.toString()),t>i.length?Array(t-i.length+1).join(e)+i:i}function _e(i){return i.replace(/^[\s]*/,"")}function me(i){return i.replace(/[\s]*$/,"")}function vt(i){return _e(me(i))}function fe(i,t,e=!1,s="..."){if(i.length>t){let r=t-1;for(;r>=0&&i.charAt(r).match(/\w/);)r--;return r>=0&&e==0?i.substring(0,r+1)+"...":i.substring(0,t)+s}return i}function ui(i){return i.replace(/\/(date|number|duration)$/i,"")}function pi(i){return i&&i.replace(/<[^>]*>/g,"")}function ci(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function gi(i){const t=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,e=/([^اأدذرزو]*[اأدذرزو])/gi;let s=i.split(/(\s+)/),r=[];return s.forEach(n=>{if(n.match(/^\s+$/))(n=" ")&&(n=" "),r.push(n);else if(t.test(n)){let a=n.split(e).filter(o=>o!=="");r=r.concat(a)}else r=r.concat([...n])}),r}function _i(i,t=!1){const e=new Date(i.getFullYear(),0,0),s=i.getTime()-e.getTime()+60*(e.getTimezoneOffset()-i.getTimezoneOffset())*1e3;return Math.floor(s/864e5)}function Ht(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+4-s);const r=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-r.getTime())/864e5+1)/7)}function mi(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;return e.setUTCDate(e.getUTCDate()+4-s),new Date(Date.UTC(e.getUTCFullYear(),0,1)).getFullYear()}function fi(i,t=!1){const e=Ht(new Date(i.getFullYear(),i.getMonth(),1),t);let s=Ht(i,t);return s==1&&(s=53),s-e+1}function bi(i,t,e=1,s=!1){let r=new Date(t,0,4,0,0,0,0);return s&&r.setUTCFullYear(t),7*i+e-((r.getDay()||7)+3)}function vi(i,t){return i>12?i-=12:i===0&&(i=12),t!=null?i+(t-1):i}function yi(i,t=!1,e=!1,s=!1,r){if(s)return t?"Coordinated Universal Time":"UTC";if(r){const o=i.toLocaleString("en-US",{timeZone:r});return vt(i.toLocaleString("en-US",{timeZone:r,timeZoneName:t?"long":"short"}).substr(o.length))}let n=i.toLocaleString("UTC"),a=i.toLocaleString("UTC",{timeZoneName:t?"long":"short"}).substr(n.length);return e===!1&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),vt(a)}function wi(i){const t=new Date(Date.UTC(2012,0,1,0,0,0,0)),e=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:i})).getTime()-e.getTime())/6e4*-1}function Pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Gt(i){let t,e,s,r=i.h,n=i.s,a=i.l;if(n==0)t=e=s=a;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=a<.5?a*(1+n):a+n-a*n,l=2*a-h;t=o(l,h,r+1/3),e=o(l,h,r),s=o(l,h,r-1/3)}return{r:Math.round(255*t),g:Math.round(255*e),b:Math.round(255*s)}}function zt(i){let t=i.r/255,e=i.g/255,s=i.b/255,r=Math.max(t,e,s),n=Math.min(t,e,s),a=0,o=0,h=(r+n)/2;if(r===n)a=o=0;else{let l=r-n;switch(o=h>.5?l/(2-r-n):l/(r+n),r){case t:a=(e-s)/l+(e0?255-i:i;return Math.round(e*t)}function ve(i,t){if(i){let e=et(Math.min(Math.max(i.r,i.g,i.b),230),t);return{r:Math.max(0,Math.min(255,Math.round(i.r+e))),g:Math.max(0,Math.min(255,Math.round(i.g+e))),b:Math.max(0,Math.min(255,Math.round(i.b+e))),a:i.a}}return i}function It(i){return(299*i.r+587*i.g+114*i.b)/1e3>=128}function ye(i,t){if(i===void 0||t==1)return i;let e=zt(i);return e.s=t,Gt(e)}function we(i,t={r:255,g:255,b:255},e={r:255,g:255,b:255}){let s=t,r=e;return It(e)&&(s=e,r=t),It(i)?r:s}function Di(i,t){return i||(i=[]),[...i,...t].filter((e,s,r)=>r.indexOf(e)===s)}function xi(i,t){return!!t&&i.left==t.left&&i.right==t.right&&i.top==t.top&&i.bottom==t.bottom}function Yt(i){return i[0]==="#"&&(i=i.substr(1)),i.length==3&&(i=i[0].repeat(2)+i[1].repeat(2)+i[2].repeat(2)),parseInt(i,16)}function Pe(i){let t=(i=i.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(t)t.push("1");else if(t=i.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!t)return 0;let e="";for(let s=1;s<=3;s++){let r=parseInt(t[s]).toString(16);r.length==1&&(r="0"+r),e+=r}return Yt(e)}function ki(i){return y.fromAny(i)}class y{constructor(t){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+t+")"}toCSSHex(){return"#"+ct(this.r.toString(16),2)+ct(this.g.toString(16),2)+ct(this.b.toString(16),2)}toHSL(t=1){return zt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,s){const r=Gt({h:t,s:e,l:s});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(t){return new y(t)}static fromRGB(t,e,s){return new y((0|s)+(e<<8)+(t<<16))}static fromString(t){return new y(Yt(t))}static fromCSS(t){return new y(Pe(t))}static fromAny(t){if(Ft(t)){if(t[0]=="#")return y.fromString(t);if(t.substr(0,3)=="rgb")return y.fromCSS(t)}else{if(g(t))return y.fromHex(t);if(t instanceof y)return y.fromHex(t.hex)}throw new Error("Unknown color syntax: "+t)}static alternative(t,e,s){const r=we({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,s?{r:s.r,g:s.g,b:s.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(t,e,s,r="rgb"){if(r=="hsl"){const n=e.toHSL(),a=s.toHSL();return y.fromHSL(A(t,n.h,a.h),A(t,n.s,a.s),A(t,n.l,a.l))}return y.fromRGB(A(t,e.r,s.r),A(t,e.g,s.g),A(t,e.b,s.b))}static lighten(t,e){const s=be({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static brighten(t,e){const s=ve({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static saturate(t,e){const s=ye({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}}class Q{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{c(t,e=>{e.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(t){return se(this._listeners,e=>(e.type===null||e.type===t)&&!e.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(this._iterating===0){const e=this._listeners.indexOf(t);if(e===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,s,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(n=>{n.once!==t||n.type!==e||s!==void 0&&n.callback!==s||n.context!==r||n.disposer.dispose()})}isEnabled(t){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&this._disabled[t]===void 0}removeType(t){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(e=>{e.type===t&&e.disposer.dispose()})}has(t,e,s){return Ut(this._listeners,r=>r.once!==!0&&r.type===t&&(e===void 0||r.callback===e)&&r.context===s)!==-1}_shouldDispatch(t){if(this._disposed)throw new Error("EventDispatcher is disposed");const e=this._disabled[t];return g(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{c(this._listeners,t)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(c(this._killed,e=>{this._removeListener(e)}),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener(s=>{s.killed||s.type!==null&&s.type!==t||s.dispatch(t,e)})}_on(t,e,s,r,n,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(t,e,s,r);const o={type:e,callback:s,context:r,shouldClone:n,dispatch:a,killed:!1,once:t,disposer:new D(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(t,e,s=!0){return this._on(!1,null,t,e,s,(r,n)=>t.call(e,n)).disposer}on(t,e,s,r=!0){return this._on(!1,t,e,s,r,(n,a)=>e.call(s,a)).disposer}once(t,e,s,r=!0){const n=this._on(!0,t,e,s,r,(a,o)=>{n.disposer.dispose(),e.call(s,o)});return n.disposer}off(t,e,s){this._removeExistingListener(!1,t,e,s)}copyFrom(t){if(this._disposed)throw new Error("EventDispatcher is disposed");if(t===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const e=[];return c(t._listeners,s=>{!s.killed&&s.shouldClone&&(s.type===null?e.push(this.onAll(s.callback,s.context)):s.once?e.push(this.once(s.type,s.callback,s.context)):e.push(this.on(s.type,s.callback,s.context)))}),new O(e)}}function Lt(i){return tt(this,void 0,void 0,function*(){if(i!==void 0){const t=[];v(i,(e,s)=>{t.push(s.waitForStop())}),yield Promise.all(t)}})}function A(i,t,e){return t+i*(e-t)}function De(i,t,e){return i>=1?e:t}function xe(i,t,e){return new f(A(i,t.percent,e.percent))}function ke(i,t,e){return y.interpolate(i,t,e)}function Oe(i,t){return typeof i=="number"&&typeof t=="number"?A:i instanceof f&&t instanceof f?xe:i instanceof y&&t instanceof y?ke:De}var U;function F(i,t){if(!(i>=0&&i=0&&t{this.push(e)})}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),c(t,s=>{this._values.push(s),this._onPush(s)})}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e{e.dispose()}),super._onClear(t)}_dispose(){this.autoDispose&&c(this._values,t=>{t.dispose()})}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Oi extends Te{constructor(t,e){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}_dispose(){super._dispose(),this.autoDispose&&this.template.dispose()}}class Se extends Xt{constructor(t){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll(e=>{if(e.type==="clear")c(e.oldValues,s=>{this._onRemoved(s)});else if(e.type==="push")this._onInserted(e.newValue);else if(e.type==="setIndex")this._onRemoved(e.oldValue),this._onInserted(e.newValue,e.index);else if(e.type==="insertIndex")this._onInserted(e.newValue,e.index);else if(e.type==="removeIndex")this._onRemoved(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(e.value),this._onInserted(e.value,e.newIndex)}})}_onInserted(t,e){t._setParent(this._container,!0);const s=this._container._childrenDisplay;e===void 0?s.addChild(t._display):s.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),c(this.values,t=>{t.dispose()}))}}const $t=Math.PI,Zt=$t/180,Ti=180/$t;function Si(i,t,e){if(!g(t)||t<=0)return Math.round(i);{let s=Math.pow(10,t);return Math.round(i*s)/s}}function ji(i,t){if(!g(t)||t<=0)return Math.ceil(i);{let e=Math.pow(10,t);return Math.ceil(i*e)/e}}function Nt(i,t,e){return Math.min(Math.max(i,t),e)}function yt(i){return Math.sin(Zt*i)}function wt(i){return Math.cos(Zt*i)}function Ei(i){return(i%=360)<0&&(i+=360),i}function Ci(i,t,e,s,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(gt(r,e)),l.push(gt(r,s));let d=Math.min(90*Math.floor(e/90),90*Math.floor(s/90)),p=Math.max(90*Math.ceil(e/90),90*Math.ceil(s/90));for(let u=d;u<=p;u+=90)u>=e&&u<=s&&l.push(gt(r,u));for(let u=0;uo&&(o=_.x),_.y>h&&(h=_.y)}return{left:i+n,top:t+a,right:i+o,bottom:t+h}}function gt(i,t){return{x:i*wt(t),y:i*yt(t)}}function Mi(i){const t=i.length;if(t>0){let e=i[0],s=e.left,r=e.top,n=e.right,a=e.bottom;if(t>1)for(let o=1;o=t.left&&i.y>=t.top&&i.x<=t.right&&i.y<=t.bottom}function Rt(i){return i}function Ee(i){return i*i*i}function Ai(i){return function(t){return 1-i(1-t)}}class Ce{constructor(t,e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t,this._settings=e,v(e,s=>{this._userSettings[s]=!0})}get(t,e){const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){T(t).forEach(e=>{this.set(e,t[e])})}_eachSetting(t){v(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup("default");this._eachSetting((s,r)=>{t[s]||(t[s]=!0,this!==e&&(s in e._settings||(e._settings[s]=this._entity.get(s))),this._entity.set(s,r))})}applyAnimate(t){t==null&&(t=this._settings.stateAnimationDuration),t==null&&(t=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let e=this._settings.stateAnimationEasing;e==null&&(e=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Ee)));const s=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},n={};return this._eachSetting((a,o)=>{if(!r[a]){r[a]=!0,this!=s&&(a in s._settings||(s._settings[a]=this._entity.get(a)));const h=this._entity.animate({key:a,to:o,duration:t,easing:e});h&&(n[a]=h)}}),n}}class Me{constructor(t){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Ce(this._entity,e);return this._states[t]=r,r}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let s;const r=this._states[t];return r&&(s=r.applyAnimate(e)),this._entity._applyStateAnimated(t,e),s}}class Ae{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.10.7"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const N=new Ae;function Bi(i){N.licenses.push(i)}function R(i,t){return i===t?0:i{P(s,e)&&this._entity._markDirtyKey(t)})}remove(t){const e=this._callbacks[t];e!==void 0&&(delete this._callbacks[t],e.length!==0&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const s=this._callbacks[t];if(s!==void 0)for(let r=0,n=s.length;r{if(this._stopped)t();else{const s=()=>{r.dispose(),t()},r=this.events.on("stopped",s)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){this._oldTime!==null&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let He=0;class Ie{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++He}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"enableDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._settings=t}_checkDirty(){T(this._settings).forEach(t=>{this._userProperties[t]=!0,this._markDirtyKey(t)})}resetUserSettings(){this._userProperties={}}_runAnimation(t){let e=U.Stopped;if(!this.isDisposed()){let s=!1,r=!1;v(this._animatingSettings,(n,a)=>{if(a.stopped)this._stopAnimation(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.set(n,a._value(1)):(s=!0,a._reset(t),this._set(n,a._value(1))):(s=!0,this._set(n,a._value(o)))}else r=!0}),v(this._animatingPrivateSettings,(n,a)=>{if(a.stopped)this._stopAnimationPrivate(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.setPrivate(n,a._value(1)):(s=!0,a._reset(t),this._setPrivate(n,a._value(1))):(s=!0,this._setPrivate(n,a._value(o)))}else r=!0}),s?e=U.Playing:r&&(e=U.Paused)}return e}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}off(t,e){let s=this._settingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._settingEvents[t]}onPrivate(t,e){let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}offPrivate(t,e){let s=this._privateSettingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._privateSettingEvents[t]}getRaw(t,e){const s=this._settings[t];return s!==void 0?s:e}has(t){return t in this._settings}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const s=this._settingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_sendPrivateKeyEvent(t,e){const s=this._privateSettingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_setRaw(t,e,s){this._prevSettings[t]=e,this._sendKeyEvent(t,s)}setRaw(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&this._setRaw(t,s,e)}_set(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&(this._setRaw(t,s,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){c(T(this._settings),t=>{this.remove(t)})}getPrivate(t,e){const s=this._privateSettings[t];return s!==void 0?s:e}_setPrivateRaw(t,e,s){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,s)}setPrivateRaw(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&this._setPrivateRaw(t,s,e)}_setPrivate(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&(this._setPrivateRaw(t,s,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){v(t,(e,s)=>{this.set(e,s)})}animate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.get(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.set(e,s);else{if(a!==void 0&&a!==s){this.set(e,a);const l=this._animatingSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.set(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}animatePrivate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.getPrivate(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.setPrivate(e,s);else{if(a!==void 0&&a!==s){this.setPrivate(e,a);const l=this._animatingPrivateSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.setPrivate(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this.enableDispose&&!this._disposed&&(this._disposed=!0,this._dispose())}}let B=class extends Ie{constructor(i,t,e,s=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Be(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=i,this._internalTemplates=s,t.id&&this._registerId(t.id)}static new(i,t,e){const s=new this(i,t,!0);return s._template=e,s._afterNew(),s}static _new(i,t,e=[]){const s=new this(i,t,!0,e);return s._afterNew(),s}_afterNew(){this._checkDirty();let i=!1;const t=this._template;t&&(i=!0,t._setObjectTemplate(this)),c(this._internalTemplates,e=>{i=!0,e._setObjectTemplate(this)}),i&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const i=this._template;i&&i._setObjectTemplate(this),c(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new Q}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefaultFn(i,t){const e=this.get(i);if(e)return e;{const s=t();return this.set(i,s),s}}_setDefault(i,t){this.has(i)||super.set(i,t)}_setRawDefault(i,t){this.has(i)||super.setRaw(i,t)}_clearDirty(){T(this._dirty).forEach(i=>{this._dirty[i]=!1}),T(this._dirtyPrivate).forEach(i=>{this._dirtyPrivate[i]=!1})}isDirty(i){return!!this._dirty[i]}isPrivateDirty(i){return!!this._dirtyPrivate[i]}_markDirtyKey(i){this._dirty[i]=!0,super._markDirtyKey(i)}_markDirtyPrivateKey(i){this._dirtyPrivate[i]=!0,super._markDirtyKey(i)}isType(i){return this.classNames.indexOf(i)!==-1}_pushPropertyDisposer(i,t){let e=this._disposerProperties[i];return e===void 0&&(e=this._disposerProperties[i]=[]),e.push(t),t}_disposeProperty(i){const t=this._disposerProperties[i];t!==void 0&&(c(t,e=>{e.dispose()}),delete this._disposerProperties[i])}set template(i){const t=this._template;t!==i&&(this._template=i,t&&t._removeObjectTemplate(this),i&&i._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(i){}_applyStateAnimated(i,t){}get(i,t){const e=this.adapters.fold(i,this._settings[i]);return e!==void 0?e:t}isUserSetting(i){return this._userProperties[i]||!1}set(i,t){return this._userProperties[i]=!0,super.set(i,t)}setRaw(i,t){this._userProperties[i]=!0,super.setRaw(i,t)}_setSoft(i,t){return this._userProperties[i]?t:super.set(i,t)}remove(i){delete this._userProperties[i],this._removeTemplateProperty(i)}setPrivate(i,t){return this._userPrivateProperties[i]=!0,super.setPrivate(i,t)}setPrivateRaw(i,t){this._userPrivateProperties[i]=!0,super.setPrivateRaw(i,t)}removePrivate(i){delete this._userPrivateProperties[i],this._removeTemplatePrivateProperty(i)}_setTemplateProperty(i,t,e){this._userProperties[t]||i===this._findTemplateByKey(t)&&super.set(t,e)}_setTemplatePrivateProperty(i,t,e){this._userPrivateProperties[t]||i===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,e)}_removeTemplateProperty(i){if(!this._userProperties[i]){const t=this._findTemplateByKey(i);t?super.set(i,t._settings[i]):super.remove(i)}}_removeTemplatePrivateProperty(i){if(!this._userPrivateProperties[i]){const t=this._findTemplateByPrivateKey(i);t?super.setPrivate(i,t._privateSettings[i]):super.removePrivate(i)}}_walkParents(i){i(this._root._rootContainer),i(this)}_applyStateByKey(i){const t=this.states.create(i,{}),e={};this._eachTemplate(s=>{const r=s.states.lookup(i);r&&r._apply(t,e)}),v(t._settings,s=>{e[s]||t._userSettings[s]||t.remove(s)})}_applyTemplate(i,t){this._templateDisposers.push(i._apply(this,t)),v(i._settings,(e,s)=>{t.settings[e]||this._userProperties[e]||(t.settings[e]=!0,super.set(e,s))}),v(i._privateSettings,(e,s)=>{t.privateSettings[e]||this._userPrivateProperties[e]||(t.privateSettings[e]=!0,super.setPrivate(e,s))}),this._runSetup&&i.setup&&(this._runSetup=!1,i.setup(this))}_findStaticTemplate(i){if(this._template&&i(this._template))return this._template}_eachTemplate(i){this._findStaticTemplate(t=>(i(t),!1)),W(this._internalTemplates,i),c(this._templates,i)}_applyTemplates(i=!0){i&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(e=>{this._applyTemplate(e,t)}),i&&(v(this._settings,e=>{this._userProperties[e]||t.settings[e]||super.remove(e)}),v(this._privateSettings,e=>{this._userPrivateProperties[e]||t.privateSettings[e]||super.removePrivate(e)}))}_findTemplate(i){const t=this._findStaticTemplate(i);if(t===void 0){const e=ae(this._internalTemplates,i);return e===void 0?ne(this._templates,i):e}return t}_findTemplateByKey(i){return this._findTemplate(t=>i in t._settings)}_findTemplateByPrivateKey(i){return this._findTemplate(t=>i in t._privateSettings)}_disposeTemplates(){c(this._templateDisposers,i=>{i.dispose()}),this._templateDisposers.length=0}_removeTemplates(){c(this._templates,i=>{i._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(i=!1){let t=!1;const e=[];let s=[];const r=new Set,n=this.get("themeTagsSelf");return n&&c(n,a=>{r.add(a)}),this._walkParents(a=>{a===this._root._rootContainer&&(t=!0),a._defaultThemes.length>0&&e.push(a._defaultThemes);const o=a.get("themes");o&&s.push(o);const h=a.get("themeTags");h&&c(h,l=>{r.add(l)})}),s=e.concat(s),this._removeTemplates(),(t||i)&&W(this.classNames,a=>{const o=[];c(s,h=>{c(h,l=>{const d=l._lookupRules(a);d&&W(d,p=>{if(p.tags.every(u=>r.has(u))){const u=he(o,_=>{const m=R(p.tags.length,_.tags.length);return m===0?Jt(p.tags,_.tags,R):m});o.splice(u.index,0,p)}})})}),c(o,h=>{this._templates.push(h.template),h.template._setObjectTemplate(this)})}),this._applyTemplates(),(t||i)&&(this._runSetup=!1),t||i}_changed(){}_beforeChanged(){if(this.isDirty("id")){const i=this.get("id");i&&this._registerId(i);const t=this._prevSettings.id;t&&delete N.entitiesById[t]}}_registerId(i){if(N.entitiesById[i]&&N.entitiesById[i]!==this)throw new Error('An entity with id "'+i+'" already exists.');N.entitiesById[i]=this}_afterChanged(){}addDisposer(i){return this._disposers.push(i),i}_dispose(){super._dispose();const i=this._template;i&&i._removeObjectTemplate(this),c(this._internalTemplates,e=>{e._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(e=>{e.dispose()}),v(this._disposerProperties,(e,s)=>{c(s,r=>{r.dispose()})});const t=this.get("id");t&&delete N.entitiesById[t]}setTimeout(i,t){const e=setTimeout(()=>{this.removeDispose(s),i()},t),s=new D(()=>{clearTimeout(e)});return this._disposers.push(s),s}removeDispose(i){if(!this.isDisposed()){let t=st(this._disposers,i);t>-1&&this._disposers.splice(t,1)}i.dispose()}hasTag(i){return st(this.get("themeTags",[]),i)!==-1}addTag(i){if(!this.hasTag(i)){const t=this.get("themeTags",[]);t.push(i),this.set("themeTags",t)}}removeTag(i){if(this.hasTag(i)){const t=this.get("themeTags",[]);Wt(t,i),this.set("themeTags",t)}}_t(i,t,...e){return this._root.language.translate(i,t,...e)}get root(){return this._root}};function Pt(i){v(i,(t,e)=>{St(e)&&typeof e.dispose=="function"&&(e.enableDispose=!0,e.dispose())})}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Le{constructor(t,e,s){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=s}_dispose(){Pt(this._settings)}get(t,e){const s=this._settings[t];return s!==void 0?s:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){T(t).forEach(e=>{this._settings[e]=t[e]}),this._template._stateChanged(this._name)}_apply(t,e){v(this._settings,(s,r)=>{e[s]||t._userSettings[s]||(e[s]=!0,t.setRaw(s,r))})}}class Ne{constructor(t){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}_dispose(){v(this._states,(t,e)=>{e._dispose()})}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Le(t,this._template,e);return this._states[t]=r,this._template._stateChanged(t),r}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){v(this._states,(s,r)=>{let n=e.states[s];n==null&&(n=e.states[s]={});const a=t.states.create(s,{});r._apply(a,n)})}}class Re{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let s=this._callbacks[t];return s===void 0&&(s=this._callbacks[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._callbacks[t]})}remove(t){this._callbacks[t]!==void 0&&delete this._callbacks[t]}_apply(t){const e=[];return v(this._callbacks,(s,r)=>{c(r,n=>{e.push(t.adapters.add(s,n))})}),new O(e)}}class J{constructor(t,e){if(Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ne(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Re}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Q}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=t}static new(t){return new J(t,!0)}_dispose(){Pt(this._settings),Pt(this._privateSettings)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}_checkDisposed(){if(this._disposed)throw new Error("Template is disposed")}get entities(){return this._entities}get(t,e){this._checkDisposed();const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._checkDisposed(),this._settings[t]=e}set(t,e){this._checkDisposed(),this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach(s=>{s._setTemplateProperty(this,t,e)}))}remove(t){this._checkDisposed(),t in this._settings&&(delete this._settings[t],this._entities.forEach(e=>{e._removeTemplateProperty(t)}))}removeAll(){this._checkDisposed(),v(this._settings,(t,e)=>{this.remove(t)})}getPrivate(t,e){this._checkDisposed();const s=this._privateSettings[t];return s!==void 0?s:e}setPrivateRaw(t,e){return this._checkDisposed(),this._privateSettings[t]=e,e}setPrivate(t,e){return this._checkDisposed(),this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach(s=>{s._setTemplatePrivateProperty(this,t,e)})),e}removePrivate(t){this._checkDisposed(),t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach(e=>{e._removeTemplatePrivateProperty(t)}))}setAll(t){this._checkDisposed(),v(t,(e,s)=>{this.set(e,s)})}on(t,e){this._checkDisposed();let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}onPrivate(t,e){this._checkDisposed();let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}_apply(t,e){this._checkDisposed();const s=[];return v(this._settingEvents,(r,n)=>{c(n,a=>{s.push(t.on(r,a))})}),v(this._privateSettingEvents,(r,n)=>{c(n,a=>{s.push(t.onPrivate(r,a))})}),this.states._apply(t,e),s.push(this.adapters._apply(t)),s.push(t.events.copyFrom(this.events)),new O(s)}_setObjectTemplate(t){this._checkDisposed(),this._entities.push(t)}_removeObjectTemplate(t){Wt(this._entities,t)}_stateChanged(t){this._checkDisposed(),this._entities.forEach(e=>{e._applyStateByKey(t)})}}class nt extends Q{constructor(t){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let s=this._rendererDisposers[t];if(s===void 0){const r=this._sprite._display.on(t,n=>{e.call(this,n)});s=this._rendererDisposers[t]=new ue(()=>{delete this._rendererDisposers[t],r.dispose()})}return s.increment()}_on(t,e,s,r,n,a){const o=super._on(t,e,s,r,n,a),h=nt.RENDERER_EVENTS[e];return h!==void 0&&(o.disposer=new O([o.disposer,this._onRenderer(e,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const s=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=s}}}Object.defineProperty(nt,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(i){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",i))&&this.dispatch("click",this._makePointerEvent("click",i))},rightclick:function(i){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",i))},middleclick:function(i){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",i))},dblclick:function(i){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",i))},pointerover:function(i){const t=this._sprite;let e=!0;if(t.getPrivate("trustBounds")){t._getBounds();const s=t.globalBounds();if(t.isType("Graphics")){const r=t.get("strokeWidth",1)/2;r>=1&&(s.left-=r,s.right+=r,s.top-=r,s.bottom+=r)}je(i.point,s)||(e=!1,t._root._renderer.removeHovering(t._display))}e&&this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",i))},pointerout:function(i){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",i))},pointerdown:function(i){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",i))},pointerup:function(i){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",i))},globalpointerup:function(i){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",i))},globalpointermove:function(i){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",i))},wheel:function(i){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:i.event,point:i.point})}}});class k extends B{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}markDirtyKey(t){this._markDirtyKey(t)}_markDirtyKey(t){super._markDirtyKey(t),t!="x"&&t!="y"&&t!="dx"&&t!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),t!="x"&&t!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new nt(this)}_processTemplateField(){let t;const e=this.get("templateField");if(e){const s=this.dataItem;if(s){const r=s.dataContext;r&&(t=r[e],t instanceof J||!t||(t=J.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const s="dataitemchanged";t!=e&&this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get("width")instanceof f||this.get("height")instanceof f?At(t._percentageSizeChildren,this):P(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get("x")instanceof f||this.get("y")instanceof f?At(t._percentagePositionChildren,this):P(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get("centerX");e!=null&&(this._display.pivot.x=t.left+M(e,t.right-t.left));const s=this.get("centerY");s!=null&&(this._display.pivot.y=t.top+M(s,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})),this._tooltipPointerDp=new O([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})}),this.events.on("pointerout",()=>{const s=this._tooltipMoveDp;s&&(s.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty("draggable")){const r=this.get("draggable");r?(this.set("interactive",!0),this._dragDp=new O([e.on("pointerdown",n=>{this.dragStart(n)}),e.on("globalpointermove",n=>{this.dragMove(n)}),e.on("globalpointerup",n=>{this.dragStop(n)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!r}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const r=this.get("tooltipText"),n=this.get("tooltipHTML"),a=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(r||n)&&(a=="click"?(this._tooltipDp=new O([e.on("click",()=>{this.setTimeout(()=>{const o=this.getTooltip();o&&!o.isHidden()&&o.get("tooltipTarget")===this?this.hideTooltip():this.showTooltip()},10)}),Kt(document,"click",o=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):a=="always"||(this._tooltipDp=new O([e.on("pointerover",()=>{this.showTooltip()}),e.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let r=this.get("toggleKey");r&&r!="none"?this._toggleDp=e.on("click",()=>{this._isDragging||this.set(r,!this.get(r))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(t.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("rotation")&&(this.markDirtyBounds(),t.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),t.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const r=this.parent;r&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(r.markDirty(),r._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight")||this.isDirty("marginLeft")||this.isDirty("marginTop")||this.isDirty("marginRight")||this.isDirty("marginBottom"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const r=this.get("wheelable");r&&this.set("interactive",!0),t.wheelable=!!r}(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(t.filter=this.get("filter"));let s=this.get("filter","");if(this.isDirty("blur")){const r=this.get("blur",0);r!=0&&(s+=" blur("+r+"px)")}if(this.isDirty("saturate")){const r=this.get("saturate",1);r!=1&&(s+=" saturate("+r+")")}if(this.isDirty("brightness")){const r=this.get("brightness",1);r!=1&&(s+=" brightness("+r+")")}if(this.isDirty("contrast")){const r=this.get("contrast",1);r!=1&&(s+=" contrast("+r+")")}if(this.isDirty("sepia")){const r=this.get("sepia",0);r!=0&&(s+=" sepia("+r+")")}if(this.isDirty("hue")){const r=this.get("hue",0);r!=0&&(s+=" hue-rotate("+r+"deg)")}if(this.isDirty("invert")){const r=this.get("invert",0);r!=0&&(s+=" invert("+r+")")}if(s&&(t.filter=s),this.isDirty("cursorOverStyle")&&(t.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new O([e.on("focus",()=>{this.showTooltip()}),e.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility(),this._disposers.push(e.on("blur",()=>{this.setPrivateRaw("touchHovering",!1)}))),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(t.exportable=this.get("exportable")),this.isDirty("interactive")){const r=this.events;this.get("interactive")&&!r.isDisposed()?this._hoverDp=new O([r.on("click",n=>{Bt(n.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})},10))}),r.on("globalpointerup",n=>{Bt(n.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})),this._isDown&&this._handleUp(n)}),r.on("pointerover",()=>{this._handleOver()}),r.on("pointerout",()=>{this._handleOut()}),r.on("pointerdown",n=>{this._handleDown(n)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e="dragstop";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(t){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const e=pt(t.originalEvent);delete this._downPoints[e],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(t){const e=pt(t.originalEvent),s=this._downPoints[e];if(s){const r=Math.abs(s.x-t.point.x),n=Math.abs(s.y-t.point.y);return r>5||n>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get("draggable")&&e._handleDown(t),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const s=pt(t.originalEvent);this._downPoints[s]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let s=0,r=this.parent,n=1;for(;r!=null;)s+=r.get("rotation",0),r=r.parent,r&&(n*=r.get("scale",1));let a=(t.point.x-e.point.x)/n,o=(t.point.y-e.point.y)/n;const h=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+a*wt(s)+o*yt(s)),this.set("y",l.y+o*wt(s)-a*yt(s));const d="dragged";h.isEnabled(d)&&h.dispatch(d,{type:d,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(a,o)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&this.get("position")!="absolute"&&(e.get("width")==null||e.get("height")==null||e.get("layout"))&&e.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const s="boundschanged";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds()),this.getPrivate("showingTooltip")&&this.showTooltip()}}_fixMinBounds(t){let e=this.get("minWidth",this.getPrivate("minWidth")),s=this.get("minHeight",this.getPrivate("minHeight"));g(e)&&t.right-t.left0?t.right=t.left+r:t.left=t.right+r),g(n)&&(n>0?t.bottom=t.top+n:t.top=t.bottom+n)}_removeParent(t){t&&(t.children.removeValue(this),P(t._percentageSizeChildren,this),P(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.isDisposed()||(this.showTooltip(),this._handleOver())}unhover(){this.isDisposed()||(this.hideTooltip(),this._handleOut())}showTooltip(t){if(!this.isDisposed()){const e=this.getTooltip(),s=this.get("tooltipText"),r=this.get("tooltipHTML");if((s||r)&&e){const n=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);n!="fixed"&&t||(this._display._setMatrix(),t=this.toGlobal(a._getTooltipPoint())),e.set("pointTo",t),e.set("tooltipTarget",a),e.get("x")||e.set("x",t.x),e.get("y")||e.set("y",t.y),s&&e.label.set("text",s),r&&e.label.set("html",r);const o=this.dataItem;if(o&&e.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const h=e.show();return this.setPrivateRaw("showingTooltip",!0),h}}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==t)){let e=t.get("keepTargetHover")&&t.get("stateAnimationDuration",0)==0?400:void 0;const s=t.hide(e);return this.setPrivateRaw("showingTooltip",!1),s}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,s=0;return this.get("isMeasured")?(e=t.left+M(this.get("tooltipX",0),t.right-t.left),s=t.top+M(this.get("tooltipY",0),t.bottom-t.top)):(e=M(this.get("tooltipX",0),this.width()),s=M(this.get("tooltipY",0),this.height())),{x:e,y:s}}return{x:0,y:0}}getTooltip(){let t=this.get("tooltip");if(t)return t;{let e=this.parent;if(e)return e.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get("dx",0),s=this.get("dy",0),r=this.get("x"),n=this.getPrivate("x"),a=0,o=0;const h=this.get("position");r instanceof f&&(r=t?t.innerWidth()*r.value+t.get("paddingLeft",0):0),g(r)?a=r+e:n!=null?a=n:t&&h=="relative"&&(a=t.get("paddingLeft",0)+e);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=t?t.innerHeight()*l.value+t.get("paddingTop",0):0),g(l)?o=l+s:d!=null?o=d:t&&h=="relative"&&(o=t.get("paddingTop",0)+s);const p=this._display;if(p.x!=a||p.y!=o){p.invalidateBounds(),p.x=a,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let t=this.get("x"),e=this.getPrivate("x");const s=this.parent;return s?t instanceof f?M(t,s.innerWidth())+s.get("paddingLeft",0):g(t)?t:e??s.get("paddingLeft",this._display.x):this._display.x}y(){let t=this.getPrivate("y");if(t!=null)return t;let e=this.get("y");const s=this.parent;return s?e instanceof f?M(e,s.innerHeight())+s.get("paddingTop",0):g(e)?e:t??s.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get("tooltip");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),s=this.y();return{left:t.left+e,right:t.right+e,top:t.top+s,bottom:t.bottom+s}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),s=this.toGlobal({x:t.right,y:t.top}),r=this.toGlobal({x:t.right,y:t.bottom}),n=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,s.x,r.x,n.x),top:Math.min(e.y,s.y,r.y,n.y),right:Math.max(e.x,s.x,r.x,n.x),bottom:Math.max(e.y,s.y,r.y,n.y)}}_onShow(t){}_onHide(t){}appear(t,e){return tt(this,void 0,void 0,function*(){return yield this.hide(0),e?new Promise((s,r)=>{this.setTimeout(()=>{s(this.show(t))},e)}):this.show(t)})}show(t){return tt(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(t);const e=this.states.applyAnimate("default",t);yield Lt(e),this._isShowing=!1}})}hide(t){return tt(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let e=this.states.lookup("hidden");e||(e=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(t);const s=this.states.applyAnimate("hidden",t);yield Lt(s),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*t:t}compositeScale(){const t=this.get("scale",1);return this._parent?this._parent.compositeScale()*t:t}compositeRotation(){const t=this.get("rotation",0);return this._parent?this._parent.compositeRotation()+t:t}width(){let t=this.get("width"),e=this.get("maxWidth",this.getPrivate("maxWidth")),s=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof f){const a=this.parent;n=a?a.innerWidth()*t.value:this._root.width()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}maxWidth(){let t=this.get("maxWidth",this.getPrivate("maxWidth"));if(g(t))return t;{let s=this.get("width");if(g(s))return s}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get("maxHeight",this.getPrivate("maxHeight"));if(g(t))return t;{let s=this.get("height");if(g(s))return s}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get("height"),e=this.get("maxHeight",this.getPrivate("maxHeight")),s=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof f){const a=this.parent;n=a?a.innerHeight()*t.value:this._root.height()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const s=this._parent;t!==s&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(s),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return le(this._downPoints,(t,e)=>t>e?1:t0&&(a.beginFill(r,n),a.drawRect(0,0,e,s),a.endFill()),o.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(o,a,t,e,s)}this._clear=!1}}Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([V.className])});class K extends V{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load();const t=this.get("canvas");t&&(this.set("width",t.width),this.set("height",t.height))}_draw(){super._draw();const t=this._image;if(t){const s=this.get("width",100),r=this.get("height",100),n=this.get("fit","image");let a=0,o=0;n=="pattern"?(a=s,o=r):(a=t.width,o=t.height,n=="image"&&(this.set("width",a),this.set("height",o)));let h=0,l=0;this.get("centered",!0)&&(h=s/2-a/2,l=r/2-o/2),this._display.image(t,a,o,h,l)}const e=this.get("canvas");e&&this._display.image(e,e.width,e.height,0,0)}_load(){const t=this.get("src");if(t){const e=new Image;e.src=t,e.decode().then(()=>{this._image=e,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(s=>{})}}}var Dt;Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([K.className])}),function(i){i.ADD="lighter",i.COLOR="color",i.COLOR_BURN="color-burn",i.COLOR_DODGE="color-dodge",i.DARKEN="darken",i.DIFFERENCE="difference",i.DST_OVER="destination-over",i.EXCLUSION="exclusion",i.HARD_LIGHT="hard-light",i.HUE="hue",i.LIGHTEN="lighten",i.LUMINOSITY="luminosity",i.MULTIPLY="multiply",i.NORMAL="source-over",i.OVERLAY="overlay",i.SATURATION="saturation",i.SCREEN="screen",i.SOFT_LIGHT="soft-light",i.SRC_ATOP="source-atop",i.XOR="xor"}(Dt||(Dt={}));const Ii=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset","shadowBlur","shadowColor","shadowOpacity","shadowOffsetX","shadowOffsetY","blur","sepia","invert","brightness","hue","contrast","saturate"];class G extends k{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const t=this.get("fillGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const t=this.get("strokeGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get("strokeDasharray");g(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get("strokeDashoffset");e&&this._display.setLineDashOffset(e);const s=this.get("blendMode",Dt.NORMAL);this._display.blendMode=s;const r=this.get("draw");r&&typeof r=="function"&&r(this._display,this);const n=this.get("svgPath");n!=null&&this._display.svgPath(n)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get("fill"),e=this.get("fillGradient"),s=this.get("fillPattern"),r=this.get("fillOpacity"),n=this.get("stroke"),a=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),t&&!e&&(this._display.beginFill(t,r),this._display.endFill()),e){if(t){const m=e.get("stops",[]);m.length&&c(m,b=>{b.color&&!b.colorInherited||!t||(b.color=t,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const _=e.getFill(this);_&&(this._display.beginFill(_,r),this._display.endFill())}if(s){const _=s.pattern;_&&(this._display.beginFill(_,r),this._display.endFill(),s instanceof K&&s.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}if(n||a||o){const _=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(n&&!a&&(this._display.lineStyle(m,n,_,b),this._display.endStroke()),a){const S=a.get("stops",[]);S.length&&c(S,w=>{w.color&&!w.colorInherited||!n||(w.color=n,w.colorInherited=!0),(w.opacity==null||w.opacityInherited)&&(w.opacity=_,w.opacityInherited=!0)});const H=a.getFill(this);H&&(this._display.lineStyle(m,H,_,b),this._display.endStroke())}if(o){let S=o.pattern;S&&(this._display.lineStyle(m,S,_,b),this._display.endStroke(),o instanceof K&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([G.className])});class z extends G{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(i,t){i.get("reverseChildren",!1)?i.children.eachReverse(t):i.children.each(t)}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([z.className])});class E extends B{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([E.className])});class Y extends E{updateContainer(t){let e=t.get("paddingLeft",0),s=t.innerWidth(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minWidth",a.getPrivate("minWidth",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.width()),s-=o+a.get("marginLeft",0)+a.get("marginRight",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){let h=s*o.value/r-a.get("marginLeft",0)-a.get("marginRight",0),l=a.get("minWidth",a.getPrivate("minWidth",-1/0)),d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("width",h)}else a._prevSettings.width instanceof f&&a.setPrivate("width",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginLeft",0),l=a.get("marginRight",0),d=a.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let _=n+h-p;a.setPrivate("x",_),n=_+u+l}else a.setPrivate("x",void 0)})}}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Y.className])});class X extends E{updateContainer(t){let e=t.get("paddingTop",0),s=t.innerHeight(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minHeight",a.getPrivate("minHeight",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.height()),s-=o+a.get("marginTop",0)+a.get("marginBottom",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){let h=s*o.value/r-a.get("marginTop",0)-a.get("marginBottom",0),l=a.get("minHeight",a.getPrivate("minHeight",-1/0)),d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("height",h)}else a._prevSettings.height instanceof f&&a.setPrivate("height",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginTop",0),l=o.top,d=o.bottom,p=a.get("maxHeight");p&&d-l>p&&(d=l+p);let u=a.get("marginBottom",0),_=n+h-l;a.setPrivate("y",_),n=_+d+u}else a.setPrivate("y",void 0)})}}Object.defineProperty(X,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(X,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([X.className])});class $ extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get("paddingLeft",0),s=t.get("paddingRight",0),r=t.get("paddingTop",0),n=t.maxWidth()-e-s,a=n,o=1;j(t,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),a=Nt(a,1,n),o=Nt(o,1,n);let h=1;h=this.get("fixedWidthGrid")?n/o:n/a,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(t,h,o,n),d=r,p=0,u=0;h=l.length;let _=e;j(t,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let H=m.adjustedLocalBounds(),w=m.get("marginLeft",0),C=m.get("marginRight",0),x=_+w-H.left,L=d+b-H.top;m.setPrivate("x",x),m.setPrivate("y",L),_+=l[p]+C,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,_=e,d+=u)}})}getColumnWidths(t,e,s,r){let n=0,a=[],o=0;return j(t,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?a[o]=s:a[o]=Math.max(0|a[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{n+=h}),n>r?e>2?(e-=1,this.getColumnWidths(t,e,s,r)):[r]:a}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([$.className])});class xt{static escape(t){return t.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(t){return t.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(t){return t.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(t,e=!1,s=!1){let r=[];t=this.escape(t);let n=e?t.split("'"):[t];for(let a=0;a{t.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(t=>{t.removePrivate("x"),t.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(t=>{t.markDirtyPosition()}),this.isDirty("maskContent")){const t=this._childrenDisplay;let e=this._contentMask;this.get("maskContent")?e||(e=z.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),c(this._percentageSizeChildren,t=>{t._updateSize()}),c(this._percentagePositionChildren,t=>{t.markDirtyPosition(),t._updateSize()}),this.updateBackground()}updateBackground(){const t=this.get("background");let e=this._localBounds;if(e&&!this.isHidden()){let s=e.left,r=e.top,n=e.right-s,a=e.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&a>h&&(a=h),o&&n>o&&(n=o);let l=this.width(),d=this.height();t&&(t.setAll({width:n,height:a,x:s,y:r}),this._display.interactive&&(t._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const _=u.get("background");_&&_.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(t=!1){return!!super._applyThemes(t)&&(this.eachChildren(e=>{e._applyThemes(t)}),!0)}_applyState(t){super._applyState(t),this.get("setStateOnChildren")&&this.eachChildren(e=>{e.states.apply(t)})}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get("setStateOnChildren")&&this.eachChildren(s=>{s.states.applyAnimate(t,e)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){if(this.get("html")){let t=this._localBounds;t&&(this._contentWidth=t.right-t.left,this._contentHeight=t.bottom-t.top)}else{let t=this.get("width"),e=this.get("height"),s=this.getPrivate("width"),r=this.getPrivate("height"),n={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),o=!1,h=!1;if((a instanceof Y||a instanceof $)&&(o=!0),a instanceof X&&(h=!0),t==null&&s==null||e==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,_=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),H=this.get("paddingBottom",0);this.children.each(x=>{if(x.get("position")!="absolute"&&x.get("isMeasured")){let L=x.adjustedLocalBounds(),jt=x.x(),Et=x.y(),at=jt+L.left,ot=jt+L.right,ht=Et+L.top,lt=Et+L.bottom;o&&(at-=x.get("marginLeft",0),ot+=x.get("marginRight",0)),h&&(ht-=x.get("marginTop",0),lt+=x.get("marginBottom",0)),atp&&(p=ot),ht_&&(_=lt)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),_==-l&&(_=0),n.left=d-m,n.top=u-b,n.right=p+S,n.bottom=_+H;const w=this.get("minWidth");g(w)&&w>0&&n.right-n.left=w?n.left=n.right-w:n.right=n.left+w);const C=this.get("minHeight");g(C)&&C>0&&n.bottom-n.top=C?n.top=n.bottom-C:n.bottom=n.top+C)}this._contentWidth=n.right-n.left,this._contentHeight=n.bottom-n.top,g(t)&&(n.left=0,n.right=t),g(s)&&(n.left=0,n.right=s),g(e)&&(n.top=0,n.bottom=e),g(r)&&(n.top=0,n.bottom=r),this._localBounds=n}}_updateBounds(){const t=this.get("layout");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let s=this.get("layout"),r=!1,n=!1;s&&((s instanceof Y||s instanceof $)&&(r=!0),s instanceof X&&(n=!0)),c(this._percentageSizeChildren,a=>{if(!r){let o=a.get("width");o instanceof f&&a.setPrivate("width",o.value*t)}if(!n){let o=a.get("height");o instanceof f&&a.setPrivate("height",o.value*e)}}),c(this._percentagePositionChildren,a=>{a.markDirtyPosition(),a.markDirtyBounds()}),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateHTMLContent(){const t=this.get("html");t&&t!==""?this._root._setHTMLContent(this,rt(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}scrollToChild(t){const e=this.get("verticalScrollbar");if(e){let s=t.y(),r=this.innerHeight(),n=t.height(),a=this._contentHeight,o=1-(r-n/2)/a;if(s+.7*n+this._childrenDisplay.y>r||s-.3*n+this._childrenDisplay.y<0){let h=Math.max(0,Math.min(o,(s-n/2)/a));e.animate({key:"start",to:h,duration:e.get("animationDuration",0),easing:e.get("animationEasing")})}}}_updateChildren(){if(this.isDirty("html")&&this._updateHTMLContent(),this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.startGrip.setPrivate("visible",!1),t.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let e=this.get("background");e||(e=this.set("background",z.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",s=>{const r=s.originalEvent;if(!ce(r,this))return;r.preventDefault();let n=r.deltaY/5e3;const a=t.get("start",0),o=t.get("end",1);a+n<=0&&(n=-a),o+n>=1&&(n=1-o),a+n>=0&&o+n<=1&&(t.set("start",a+n),t.set("end",o+n))}),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",()=>{let s=this._contentHeight;const r=this._childrenDisplay,n=this._contentMask;r.y=-t.get("start",0)*s,r.markDirtyLayer(),n&&(n._display.y=-r.y,r.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const e=this._prevSettings.verticalScrollbar;e&&(this._display.removeChild(e._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get("background");e instanceof k&&(e.set("isMeasured",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const s=t.parent;s&&s.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(t=>{t._processTemplateField()})}walkChildren(t){this.children.each(e=>{e instanceof Qt&&e.walkChildren(t),t(e)})}eachChildren(t){const e=this.get("background");e&&t(e);const s=this.get("verticalScrollbar");s&&t(s);const r=this.get("mask");r&&t(r),this.children.values.forEach(n=>{t(n)})}allChildren(){const t=[];return this.eachChildren(e=>{t.push(e)}),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const s=this.get("html","");s&&s!==""&&e&&this._root._setHTMLContent(this,rt(this,s))}};Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([Z.className])});class it extends k{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","maxChars"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text")){super._updateBounds();let t=this.get("fillGradient");t&&(this._display.style.fill=t.getFill(this))}else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty("opacity")){let e=this.get("opacity",1);this._display.alpha=e}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new D(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(t.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(t.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(t.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(t.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(t.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")||this.isDirty("fillGradient")){const e=this.get("fill"),s=this.get("fillGradient"),r=this.get("fillOpacity");if(s){if(e){const n=s.get("stops",[]);n.length&&c(n,a=>{a.color&&!a.colorInherited||!e||(a.color=e,a.colorInherited=!0),(a.opacity==null||a.opacityInherited)&&(a.opacity=r,a.opacityInherited=!0)})}t.fill=s.getFill(this)}else e&&(t.fill=e)}if(this.isDirty("fillOpacity")){let e=this.get("fillOpacity",1);e&&(t.fillOpacity=e)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(t.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(t.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),c(this._textStyles,e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())}),t.fontSize=this.get("fontSize"),t.fontFamily=this.get("fontFamily"),this._display.style=t,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){let t=this.get("text","");return this.get("maxChars")&&(t=fe(t,this.get("maxChars",1e8),this.get("breakWords"),this.get("ellipsis"))),this.get("populateText")?rt(this,t):t}_getAccessibleText(){const t=this.get("ariaLabel");return t!==void 0?this.get("populateText")?rt(this,t):t:this._getText()}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(it,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(it,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([it.className])});class _t extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillGradient","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting","maxChars","ariaLabel"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),c(this._textKeys,t=>{const e=this.get(t);e!=null&&this._text.set(t,e)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(it.new(this._root,{}))}_updateChildren(){super._updateChildren();const t=this._text;if(c(this._textKeys,s=>{this._text.set(s,this.get(s))}),(this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("rotation"))&&this._setMaxDimentions(),this.get("html","")!==""?t.set("text",""):(t.set("text",this.get("text")),this._maybeUpdateHTMLColor()),(this.isDirty("fill")||this.isDirty("fillGradient"))&&this._maybeUpdateHTMLColor(),this.isDirty("textAlign")||this.isDirty("width")){const s=this.get("textAlign");let r;this.get("width")!=null?r=s=="right"?qt:s=="center"?te:0:s=="left"||s=="start"?r=this.get("paddingLeft",0):s!="right"&&s!="end"||(r=-this.get("paddingRight",0)),t.set("x",r)}const e=this.get("background");e&&e.setPrivate("visible",t._display.textVisible)}_maybeUpdateHTMLColor(){const t=this.getPrivate("htmlElement");t&&this.get("fill")&&(t.style.color=this.get("fill").toCSSHex())}_setMaxDimentions(){const t=this.get("rotation"),e=t==90||t==270||t==-90,s=this._text,r=this.get("maxWidth",this.getPrivate("maxWidth",1/0));g(r)?s.set(e?"maxHeight":"maxWidth",r-this.get("paddingLeft",0)-this.get("paddingRight",0)):s.set(e?"maxHeight":"maxWidth",void 0);const n=this.get("maxHeight",this.getPrivate("maxHeight",1/0));g(n)?s.set(e?"maxWidth":"maxHeight",n-this.get("paddingTop",0)-this.get("paddingBottom",0)):s.set(e?"maxWidth":"maxHeight",void 0),this.root.events.once("frameended",()=>{s.markDirtyBounds()})}_setDataItem(t){super._setDataItem(t),this._markDirtyKey("text");const e=this._text;e.get("populateText")&&e.markDirtyText();const s=this.get("html");s&&s!==""&&this._updateHTMLContent()}getText(){return this._text._getText()}getAccessibleText(){return this._text._getAccessibleText()}}Object.defineProperty(_t,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(_t,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([_t.className])});class Li{constructor(t,e){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let s=this._rules[t];s||(s=this._rules[t]=[]),e.sort(R);const{index:r,found:n}=oe(s,a=>{const o=R(a.tags.length,e.length);return o===0?Jt(a.tags,e,R):o});if(n)return s[r].template;{const a=J.new({});return s.splice(r,0,{tags:e,template:a}),a}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ht as $,Ve as A,g as B,wi as C,D,B as E,di as F,Y as G,Z as H,oi as I,ct as J,z as K,N as L,vi as M,R as N,Bi as O,P,yi as Q,li as R,ti as S,qe as T,qt as U,G as V,Q as W,_i as X,$ as Y,fi as Z,xt as _,Kt as a,mi as a0,bi as a1,mt as a2,ci as a3,Je as a4,Ge as a5,Qe as a6,st as a7,y as a8,ri as a9,wt as aA,yt as aB,Zt as aC,Ii as aD,Ie as aE,Xt as aF,ne as aG,xe as aH,Te as aI,Ye as aJ,Si as aK,Hi as aL,Bt as aM,xi as aN,Tt as aO,Pi as aP,ji as aQ,ue as aa,O as ab,si as ac,ai as ad,U as ae,Xe as af,Dt as ag,vt as ah,Ei as ai,gi as aj,ni as ak,Vt as al,Ci as am,Ti as an,Di as ao,_t as ap,Nt as aq,Li as ar,Ai as as,te as at,Ee as au,ce as av,M as aw,Mi as ax,Oi as ay,J as az,hi as b,c,ii as d,Wt as e,pi as f,At as g,ze as h,Ft as i,ei as j,T as k,ki as l,it as m,f as n,ut as o,Ue as p,St as q,ui as r,Ot as s,rt as t,Ze as u,v,$e as w,Mt as x,Ke as y,X as z}; diff --git a/main/assets/Theme-rblUnB2V-BgKdZgu2.js b/main/assets/Theme-rblUnB2V-BgKdZgu2.js new file mode 100644 index 000000000..64a6c5186 --- /dev/null +++ b/main/assets/Theme-rblUnB2V-BgKdZgu2.js @@ -0,0 +1 @@ +import{k0 as tt}from"./main-C7yV2j71.js";class f{constructor(t){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,s){return t instanceof f?t:new f(e===s?0:100*Math.min(Math.max(1/(s-e)*(t-e),0),1))}}function Ot(i){return new f(i)}Ot(0);const qt=Ot(100),te=Ot(50);function Ue(i){return i instanceof f}function Tt(i){return Number(i)!==i}function ee(i){return{}.toString.call(i)}function mt(i){if(i!=null&&!g(i)){let t=Number(i);return Tt(t)&&Ft(i)&&i!=""?mt(i.replace(/[^0-9.\-]+/g,"")):t}return i}function ie(i){if(ft(i))return new Date(i);if(g(i))return new Date(i);{let t=Number(i);return g(t)?new Date(t):new Date(i)}}function Ve(i){if(Tt(i))return"NaN";if(i===1/0)return"Infinity";if(i===-1/0)return"-Infinity";if(i===0&&1/i==-1/0)return"-0";let t=i<0;i=Math.abs(i);let e,s=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+i),r=s[1],n=s[2]||"";if(s[3]===void 0)e=n===""?r:r+"."+n;else{let a=+s[3];if(i<1)e="0."+Ct("0",a-1)+r+n;else{let o=a-n.length;e=o===0?r+n:o<0?r+n.slice(0,o)+"."+n.slice(o):r+n+Ct("0",o)}}return t?"-"+e:e}function Ct(i,t){return new Array(t+1).join(i)}function ft(i){return ee(i)==="[object Date]"}function Ft(i){return typeof i=="string"}function g(i){return typeof i=="number"&&Number(i)==i}function St(i){return typeof i=="object"&&i!==null}const Mt="__§§§__",Ke="__§§§§__";function st(i,t){const e=i.length;for(let s=0;s0;)--e,t(i[e],e)}function ze(i,t){const e=i.length;for(let s=0;s0;)if(--e,t(i[e],e))return e;return-1}function ne(i,t){const e=Ut(i,t);if(e!==-1)return i[e]}function ae(i,t){const e=re(i,t);if(e!==-1)return i[e]}function oe(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:a===0?(r=!0,e=n+1):s=n}return{found:r,index:r?e-1:e}}function he(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:(a===0&&(r=!0),s=n)}return{found:r,index:e}}function $e(i,t){let e=i.length;for(;e>0;)--e,t(i[e])||i.splice(e,1)}function T(i){return Object.keys(i)}function le(i,t){return T(i).sort(t)}function Ze(i){return Object.assign({},i)}function v(i,t){T(i).forEach(e=>{t(e,i[e])})}function Je(i,t){for(let e in i)if(de(i,e)&&!t(e,i[e]))break}function de(i,t){return{}.hasOwnProperty.call(i,t)}class Vt{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class D{constructor(t){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Qe extends Vt{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){c(this._disposers,t=>{t.dispose()})}}class O extends Vt{constructor(t){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){c(this._disposers,t=>{t.dispose()})}get disposers(){return this._disposers}}class ue extends D{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new D(()=>{--this._counter,this._counter===0&&this.dispose()})}}function qe(i){i.parentNode&&i.parentNode.removeChild(i)}function Kt(i,t,e,s){return i.addEventListener(t,e,s||!1),new D(()=>{i.removeEventListener(t,e,s||!1)})}function ti(i){return Kt(window,"resize",t=>{i()})}function ut(i){switch(i){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function pt(i){return i.pointerId||0}function ei(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let i=document.createElement("button");i.style.position="fixed",i.style.top="0px",i.style.left="-10000px",document.body.appendChild(i),i.focus(),i.blur(),document.body.removeChild(i)}}function ii(i){i&&i.focus()}function si(i){if(ut("pointerevents"))return i;if(ut("touchevents"))switch(i){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(ut("mouseevents"))switch(i){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return i}function Bt(i){if(typeof Touch<"u"&&i instanceof Touch)return!0;if(typeof PointerEvent<"u"&&i instanceof PointerEvent&&i.pointerType!=null)switch(i.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(i instanceof MouseEvent)}else if(i.type!=null&&i.type.match(/^mouse/))return!1;return!0}function ri(i,t,e){i.style[t]=e}function ni(i,t){return i.style[t]}function ai(i){if(i.composedPath){const t=i.composedPath();return t.length===0?null:t[0]}return i.target}function pe(i,t){let e=t;for(;;){if(i===e)return!0;if(e.parentNode===null){if(e.host==null)return!1;e=e.host}else e=e.parentNode}}function ce(i,t){return i.target&&pe(t.root.dom,i.target)}function oi(i,t){i.style.pointerEvents=t?"auto":"none"}function hi(i){if(i.key!==void 0)return i.key;switch(i.keyCode){case 9:return"Tab";case 13:return"Enter";case 16:return"Shift";case 17:return"Control";case 27:return"Escape";case 32:return" ";case 37:return"ArrowLeft";case 38:return"ArrowUp";case 39:return"ArrowRight";case 40:return"ArrowDown";case 46:return"Delete"}return""+i.keyCode}function ge(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function li(){return ge()?1:void 0}function M(i,t){return g(i)?i:i!=null&&g(i.value)&&g(t)?t*i.value:0}function di(i){let t=(""+i).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function ct(i,t=0,e="0"){return typeof i!="string"&&(i=i.toString()),t>i.length?Array(t-i.length+1).join(e)+i:i}function _e(i){return i.replace(/^[\s]*/,"")}function me(i){return i.replace(/[\s]*$/,"")}function vt(i){return _e(me(i))}function fe(i,t,e=!1,s="..."){if(i.length>t){let r=t-1;for(;r>=0&&i.charAt(r).match(/\w/);)r--;return r>=0&&e==0?i.substring(0,r+1)+"...":i.substring(0,t)+s}return i}function ui(i){return i.replace(/\/(date|number|duration)$/i,"")}function pi(i){return i&&i.replace(/<[^>]*>/g,"")}function ci(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function gi(i){const t=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,e=/([^اأدذرزو]*[اأدذرزو])/gi;let s=i.split(/(\s+)/),r=[];return s.forEach(n=>{if(n.match(/^\s+$/))(n=" ")&&(n=" "),r.push(n);else if(t.test(n)){let a=n.split(e).filter(o=>o!=="");r=r.concat(a)}else r=r.concat([...n])}),r}function _i(i,t=!1){const e=new Date(i.getFullYear(),0,0),s=i.getTime()-e.getTime()+60*(e.getTimezoneOffset()-i.getTimezoneOffset())*1e3;return Math.floor(s/864e5)}function Ht(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+4-s);const r=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-r.getTime())/864e5+1)/7)}function mi(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;return e.setUTCDate(e.getUTCDate()+4-s),new Date(Date.UTC(e.getUTCFullYear(),0,1)).getFullYear()}function fi(i,t=!1){const e=Ht(new Date(i.getFullYear(),i.getMonth(),1),t);let s=Ht(i,t);return s==1&&(s=53),s-e+1}function bi(i,t,e=1,s=!1){let r=new Date(t,0,4,0,0,0,0);return s&&r.setUTCFullYear(t),7*i+e-((r.getDay()||7)+3)}function vi(i,t){return i>12?i-=12:i===0&&(i=12),t!=null?i+(t-1):i}function yi(i,t=!1,e=!1,s=!1,r){if(s)return t?"Coordinated Universal Time":"UTC";if(r){const o=i.toLocaleString("en-US",{timeZone:r});return vt(i.toLocaleString("en-US",{timeZone:r,timeZoneName:t?"long":"short"}).substr(o.length))}let n=i.toLocaleString("UTC"),a=i.toLocaleString("UTC",{timeZoneName:t?"long":"short"}).substr(n.length);return e===!1&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),vt(a)}function wi(i){const t=new Date(Date.UTC(2012,0,1,0,0,0,0)),e=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:i})).getTime()-e.getTime())/6e4*-1}function Pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Gt(i){let t,e,s,r=i.h,n=i.s,a=i.l;if(n==0)t=e=s=a;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=a<.5?a*(1+n):a+n-a*n,l=2*a-h;t=o(l,h,r+1/3),e=o(l,h,r),s=o(l,h,r-1/3)}return{r:Math.round(255*t),g:Math.round(255*e),b:Math.round(255*s)}}function zt(i){let t=i.r/255,e=i.g/255,s=i.b/255,r=Math.max(t,e,s),n=Math.min(t,e,s),a=0,o=0,h=(r+n)/2;if(r===n)a=o=0;else{let l=r-n;switch(o=h>.5?l/(2-r-n):l/(r+n),r){case t:a=(e-s)/l+(e0?255-i:i;return Math.round(e*t)}function ve(i,t){if(i){let e=et(Math.min(Math.max(i.r,i.g,i.b),230),t);return{r:Math.max(0,Math.min(255,Math.round(i.r+e))),g:Math.max(0,Math.min(255,Math.round(i.g+e))),b:Math.max(0,Math.min(255,Math.round(i.b+e))),a:i.a}}return i}function It(i){return(299*i.r+587*i.g+114*i.b)/1e3>=128}function ye(i,t){if(i===void 0||t==1)return i;let e=zt(i);return e.s=t,Gt(e)}function we(i,t={r:255,g:255,b:255},e={r:255,g:255,b:255}){let s=t,r=e;return It(e)&&(s=e,r=t),It(i)?r:s}function Di(i,t){return i||(i=[]),[...i,...t].filter((e,s,r)=>r.indexOf(e)===s)}function xi(i,t){return!!t&&i.left==t.left&&i.right==t.right&&i.top==t.top&&i.bottom==t.bottom}function Yt(i){return i[0]==="#"&&(i=i.substr(1)),i.length==3&&(i=i[0].repeat(2)+i[1].repeat(2)+i[2].repeat(2)),parseInt(i,16)}function Pe(i){let t=(i=i.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(t)t.push("1");else if(t=i.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!t)return 0;let e="";for(let s=1;s<=3;s++){let r=parseInt(t[s]).toString(16);r.length==1&&(r="0"+r),e+=r}return Yt(e)}function ki(i){return y.fromAny(i)}class y{constructor(t){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+t+")"}toCSSHex(){return"#"+ct(this.r.toString(16),2)+ct(this.g.toString(16),2)+ct(this.b.toString(16),2)}toHSL(t=1){return zt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,s){const r=Gt({h:t,s:e,l:s});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(t){return new y(t)}static fromRGB(t,e,s){return new y((0|s)+(e<<8)+(t<<16))}static fromString(t){return new y(Yt(t))}static fromCSS(t){return new y(Pe(t))}static fromAny(t){if(Ft(t)){if(t[0]=="#")return y.fromString(t);if(t.substr(0,3)=="rgb")return y.fromCSS(t)}else{if(g(t))return y.fromHex(t);if(t instanceof y)return y.fromHex(t.hex)}throw new Error("Unknown color syntax: "+t)}static alternative(t,e,s){const r=we({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,s?{r:s.r,g:s.g,b:s.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(t,e,s,r="rgb"){if(r=="hsl"){const n=e.toHSL(),a=s.toHSL();return y.fromHSL(A(t,n.h,a.h),A(t,n.s,a.s),A(t,n.l,a.l))}return y.fromRGB(A(t,e.r,s.r),A(t,e.g,s.g),A(t,e.b,s.b))}static lighten(t,e){const s=be({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static brighten(t,e){const s=ve({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static saturate(t,e){const s=ye({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}}class Q{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{c(t,e=>{e.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(t){return se(this._listeners,e=>(e.type===null||e.type===t)&&!e.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(this._iterating===0){const e=this._listeners.indexOf(t);if(e===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,s,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(n=>{n.once!==t||n.type!==e||s!==void 0&&n.callback!==s||n.context!==r||n.disposer.dispose()})}isEnabled(t){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&this._disabled[t]===void 0}removeType(t){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(e=>{e.type===t&&e.disposer.dispose()})}has(t,e,s){return Ut(this._listeners,r=>r.once!==!0&&r.type===t&&(e===void 0||r.callback===e)&&r.context===s)!==-1}_shouldDispatch(t){if(this._disposed)throw new Error("EventDispatcher is disposed");const e=this._disabled[t];return g(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{c(this._listeners,t)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(c(this._killed,e=>{this._removeListener(e)}),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener(s=>{s.killed||s.type!==null&&s.type!==t||s.dispatch(t,e)})}_on(t,e,s,r,n,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(t,e,s,r);const o={type:e,callback:s,context:r,shouldClone:n,dispatch:a,killed:!1,once:t,disposer:new D(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(t,e,s=!0){return this._on(!1,null,t,e,s,(r,n)=>t.call(e,n)).disposer}on(t,e,s,r=!0){return this._on(!1,t,e,s,r,(n,a)=>e.call(s,a)).disposer}once(t,e,s,r=!0){const n=this._on(!0,t,e,s,r,(a,o)=>{n.disposer.dispose(),e.call(s,o)});return n.disposer}off(t,e,s){this._removeExistingListener(!1,t,e,s)}copyFrom(t){if(this._disposed)throw new Error("EventDispatcher is disposed");if(t===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const e=[];return c(t._listeners,s=>{!s.killed&&s.shouldClone&&(s.type===null?e.push(this.onAll(s.callback,s.context)):s.once?e.push(this.once(s.type,s.callback,s.context)):e.push(this.on(s.type,s.callback,s.context)))}),new O(e)}}function Lt(i){return tt(this,void 0,void 0,function*(){if(i!==void 0){const t=[];v(i,(e,s)=>{t.push(s.waitForStop())}),yield Promise.all(t)}})}function A(i,t,e){return t+i*(e-t)}function De(i,t,e){return i>=1?e:t}function xe(i,t,e){return new f(A(i,t.percent,e.percent))}function ke(i,t,e){return y.interpolate(i,t,e)}function Oe(i,t){return typeof i=="number"&&typeof t=="number"?A:i instanceof f&&t instanceof f?xe:i instanceof y&&t instanceof y?ke:De}var U;function F(i,t){if(!(i>=0&&i=0&&t{this.push(e)})}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),c(t,s=>{this._values.push(s),this._onPush(s)})}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e{e.dispose()}),super._onClear(t)}_dispose(){this.autoDispose&&c(this._values,t=>{t.dispose()})}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Oi extends Te{constructor(t,e){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}_dispose(){super._dispose(),this.autoDispose&&this.template.dispose()}}class Se extends Xt{constructor(t){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll(e=>{if(e.type==="clear")c(e.oldValues,s=>{this._onRemoved(s)});else if(e.type==="push")this._onInserted(e.newValue);else if(e.type==="setIndex")this._onRemoved(e.oldValue),this._onInserted(e.newValue,e.index);else if(e.type==="insertIndex")this._onInserted(e.newValue,e.index);else if(e.type==="removeIndex")this._onRemoved(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(e.value),this._onInserted(e.value,e.newIndex)}})}_onInserted(t,e){t._setParent(this._container,!0);const s=this._container._childrenDisplay;e===void 0?s.addChild(t._display):s.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),c(this.values,t=>{t.dispose()}))}}const $t=Math.PI,Zt=$t/180,Ti=180/$t;function Si(i,t,e){if(!g(t)||t<=0)return Math.round(i);{let s=Math.pow(10,t);return Math.round(i*s)/s}}function ji(i,t){if(!g(t)||t<=0)return Math.ceil(i);{let e=Math.pow(10,t);return Math.ceil(i*e)/e}}function Nt(i,t,e){return Math.min(Math.max(i,t),e)}function yt(i){return Math.sin(Zt*i)}function wt(i){return Math.cos(Zt*i)}function Ei(i){return(i%=360)<0&&(i+=360),i}function Ci(i,t,e,s,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(gt(r,e)),l.push(gt(r,s));let d=Math.min(90*Math.floor(e/90),90*Math.floor(s/90)),p=Math.max(90*Math.ceil(e/90),90*Math.ceil(s/90));for(let u=d;u<=p;u+=90)u>=e&&u<=s&&l.push(gt(r,u));for(let u=0;uo&&(o=_.x),_.y>h&&(h=_.y)}return{left:i+n,top:t+a,right:i+o,bottom:t+h}}function gt(i,t){return{x:i*wt(t),y:i*yt(t)}}function Mi(i){const t=i.length;if(t>0){let e=i[0],s=e.left,r=e.top,n=e.right,a=e.bottom;if(t>1)for(let o=1;o=t.left&&i.y>=t.top&&i.x<=t.right&&i.y<=t.bottom}function Rt(i){return i}function Ee(i){return i*i*i}function Ai(i){return function(t){return 1-i(1-t)}}class Ce{constructor(t,e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t,this._settings=e,v(e,s=>{this._userSettings[s]=!0})}get(t,e){const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){T(t).forEach(e=>{this.set(e,t[e])})}_eachSetting(t){v(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup("default");this._eachSetting((s,r)=>{t[s]||(t[s]=!0,this!==e&&(s in e._settings||(e._settings[s]=this._entity.get(s))),this._entity.set(s,r))})}applyAnimate(t){t==null&&(t=this._settings.stateAnimationDuration),t==null&&(t=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let e=this._settings.stateAnimationEasing;e==null&&(e=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Ee)));const s=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},n={};return this._eachSetting((a,o)=>{if(!r[a]){r[a]=!0,this!=s&&(a in s._settings||(s._settings[a]=this._entity.get(a)));const h=this._entity.animate({key:a,to:o,duration:t,easing:e});h&&(n[a]=h)}}),n}}class Me{constructor(t){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Ce(this._entity,e);return this._states[t]=r,r}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let s;const r=this._states[t];return r&&(s=r.applyAnimate(e)),this._entity._applyStateAnimated(t,e),s}}class Ae{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.10.7"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const N=new Ae;function Bi(i){N.licenses.push(i)}function R(i,t){return i===t?0:i{P(s,e)&&this._entity._markDirtyKey(t)})}remove(t){const e=this._callbacks[t];e!==void 0&&(delete this._callbacks[t],e.length!==0&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const s=this._callbacks[t];if(s!==void 0)for(let r=0,n=s.length;r{if(this._stopped)t();else{const s=()=>{r.dispose(),t()},r=this.events.on("stopped",s)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){this._oldTime!==null&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let He=0;class Ie{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++He}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"enableDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._settings=t}_checkDirty(){T(this._settings).forEach(t=>{this._userProperties[t]=!0,this._markDirtyKey(t)})}resetUserSettings(){this._userProperties={}}_runAnimation(t){let e=U.Stopped;if(!this.isDisposed()){let s=!1,r=!1;v(this._animatingSettings,(n,a)=>{if(a.stopped)this._stopAnimation(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.set(n,a._value(1)):(s=!0,a._reset(t),this._set(n,a._value(1))):(s=!0,this._set(n,a._value(o)))}else r=!0}),v(this._animatingPrivateSettings,(n,a)=>{if(a.stopped)this._stopAnimationPrivate(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.setPrivate(n,a._value(1)):(s=!0,a._reset(t),this._setPrivate(n,a._value(1))):(s=!0,this._setPrivate(n,a._value(o)))}else r=!0}),s?e=U.Playing:r&&(e=U.Paused)}return e}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}off(t,e){let s=this._settingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._settingEvents[t]}onPrivate(t,e){let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}offPrivate(t,e){let s=this._privateSettingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._privateSettingEvents[t]}getRaw(t,e){const s=this._settings[t];return s!==void 0?s:e}has(t){return t in this._settings}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const s=this._settingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_sendPrivateKeyEvent(t,e){const s=this._privateSettingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_setRaw(t,e,s){this._prevSettings[t]=e,this._sendKeyEvent(t,s)}setRaw(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&this._setRaw(t,s,e)}_set(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&(this._setRaw(t,s,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){c(T(this._settings),t=>{this.remove(t)})}getPrivate(t,e){const s=this._privateSettings[t];return s!==void 0?s:e}_setPrivateRaw(t,e,s){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,s)}setPrivateRaw(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&this._setPrivateRaw(t,s,e)}_setPrivate(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&(this._setPrivateRaw(t,s,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){v(t,(e,s)=>{this.set(e,s)})}animate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.get(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.set(e,s);else{if(a!==void 0&&a!==s){this.set(e,a);const l=this._animatingSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.set(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}animatePrivate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.getPrivate(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.setPrivate(e,s);else{if(a!==void 0&&a!==s){this.setPrivate(e,a);const l=this._animatingPrivateSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.setPrivate(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this.enableDispose&&!this._disposed&&(this._disposed=!0,this._dispose())}}let B=class extends Ie{constructor(i,t,e,s=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Be(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=i,this._internalTemplates=s,t.id&&this._registerId(t.id)}static new(i,t,e){const s=new this(i,t,!0);return s._template=e,s._afterNew(),s}static _new(i,t,e=[]){const s=new this(i,t,!0,e);return s._afterNew(),s}_afterNew(){this._checkDirty();let i=!1;const t=this._template;t&&(i=!0,t._setObjectTemplate(this)),c(this._internalTemplates,e=>{i=!0,e._setObjectTemplate(this)}),i&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const i=this._template;i&&i._setObjectTemplate(this),c(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new Q}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefaultFn(i,t){const e=this.get(i);if(e)return e;{const s=t();return this.set(i,s),s}}_setDefault(i,t){this.has(i)||super.set(i,t)}_setRawDefault(i,t){this.has(i)||super.setRaw(i,t)}_clearDirty(){T(this._dirty).forEach(i=>{this._dirty[i]=!1}),T(this._dirtyPrivate).forEach(i=>{this._dirtyPrivate[i]=!1})}isDirty(i){return!!this._dirty[i]}isPrivateDirty(i){return!!this._dirtyPrivate[i]}_markDirtyKey(i){this._dirty[i]=!0,super._markDirtyKey(i)}_markDirtyPrivateKey(i){this._dirtyPrivate[i]=!0,super._markDirtyKey(i)}isType(i){return this.classNames.indexOf(i)!==-1}_pushPropertyDisposer(i,t){let e=this._disposerProperties[i];return e===void 0&&(e=this._disposerProperties[i]=[]),e.push(t),t}_disposeProperty(i){const t=this._disposerProperties[i];t!==void 0&&(c(t,e=>{e.dispose()}),delete this._disposerProperties[i])}set template(i){const t=this._template;t!==i&&(this._template=i,t&&t._removeObjectTemplate(this),i&&i._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(i){}_applyStateAnimated(i,t){}get(i,t){const e=this.adapters.fold(i,this._settings[i]);return e!==void 0?e:t}isUserSetting(i){return this._userProperties[i]||!1}set(i,t){return this._userProperties[i]=!0,super.set(i,t)}setRaw(i,t){this._userProperties[i]=!0,super.setRaw(i,t)}_setSoft(i,t){return this._userProperties[i]?t:super.set(i,t)}remove(i){delete this._userProperties[i],this._removeTemplateProperty(i)}setPrivate(i,t){return this._userPrivateProperties[i]=!0,super.setPrivate(i,t)}setPrivateRaw(i,t){this._userPrivateProperties[i]=!0,super.setPrivateRaw(i,t)}removePrivate(i){delete this._userPrivateProperties[i],this._removeTemplatePrivateProperty(i)}_setTemplateProperty(i,t,e){this._userProperties[t]||i===this._findTemplateByKey(t)&&super.set(t,e)}_setTemplatePrivateProperty(i,t,e){this._userPrivateProperties[t]||i===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,e)}_removeTemplateProperty(i){if(!this._userProperties[i]){const t=this._findTemplateByKey(i);t?super.set(i,t._settings[i]):super.remove(i)}}_removeTemplatePrivateProperty(i){if(!this._userPrivateProperties[i]){const t=this._findTemplateByPrivateKey(i);t?super.setPrivate(i,t._privateSettings[i]):super.removePrivate(i)}}_walkParents(i){i(this._root._rootContainer),i(this)}_applyStateByKey(i){const t=this.states.create(i,{}),e={};this._eachTemplate(s=>{const r=s.states.lookup(i);r&&r._apply(t,e)}),v(t._settings,s=>{e[s]||t._userSettings[s]||t.remove(s)})}_applyTemplate(i,t){this._templateDisposers.push(i._apply(this,t)),v(i._settings,(e,s)=>{t.settings[e]||this._userProperties[e]||(t.settings[e]=!0,super.set(e,s))}),v(i._privateSettings,(e,s)=>{t.privateSettings[e]||this._userPrivateProperties[e]||(t.privateSettings[e]=!0,super.setPrivate(e,s))}),this._runSetup&&i.setup&&(this._runSetup=!1,i.setup(this))}_findStaticTemplate(i){if(this._template&&i(this._template))return this._template}_eachTemplate(i){this._findStaticTemplate(t=>(i(t),!1)),W(this._internalTemplates,i),c(this._templates,i)}_applyTemplates(i=!0){i&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(e=>{this._applyTemplate(e,t)}),i&&(v(this._settings,e=>{this._userProperties[e]||t.settings[e]||super.remove(e)}),v(this._privateSettings,e=>{this._userPrivateProperties[e]||t.privateSettings[e]||super.removePrivate(e)}))}_findTemplate(i){const t=this._findStaticTemplate(i);if(t===void 0){const e=ae(this._internalTemplates,i);return e===void 0?ne(this._templates,i):e}return t}_findTemplateByKey(i){return this._findTemplate(t=>i in t._settings)}_findTemplateByPrivateKey(i){return this._findTemplate(t=>i in t._privateSettings)}_disposeTemplates(){c(this._templateDisposers,i=>{i.dispose()}),this._templateDisposers.length=0}_removeTemplates(){c(this._templates,i=>{i._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(i=!1){let t=!1;const e=[];let s=[];const r=new Set,n=this.get("themeTagsSelf");return n&&c(n,a=>{r.add(a)}),this._walkParents(a=>{a===this._root._rootContainer&&(t=!0),a._defaultThemes.length>0&&e.push(a._defaultThemes);const o=a.get("themes");o&&s.push(o);const h=a.get("themeTags");h&&c(h,l=>{r.add(l)})}),s=e.concat(s),this._removeTemplates(),(t||i)&&W(this.classNames,a=>{const o=[];c(s,h=>{c(h,l=>{const d=l._lookupRules(a);d&&W(d,p=>{if(p.tags.every(u=>r.has(u))){const u=he(o,_=>{const m=R(p.tags.length,_.tags.length);return m===0?Jt(p.tags,_.tags,R):m});o.splice(u.index,0,p)}})})}),c(o,h=>{this._templates.push(h.template),h.template._setObjectTemplate(this)})}),this._applyTemplates(),(t||i)&&(this._runSetup=!1),t||i}_changed(){}_beforeChanged(){if(this.isDirty("id")){const i=this.get("id");i&&this._registerId(i);const t=this._prevSettings.id;t&&delete N.entitiesById[t]}}_registerId(i){if(N.entitiesById[i]&&N.entitiesById[i]!==this)throw new Error('An entity with id "'+i+'" already exists.');N.entitiesById[i]=this}_afterChanged(){}addDisposer(i){return this._disposers.push(i),i}_dispose(){super._dispose();const i=this._template;i&&i._removeObjectTemplate(this),c(this._internalTemplates,e=>{e._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(e=>{e.dispose()}),v(this._disposerProperties,(e,s)=>{c(s,r=>{r.dispose()})});const t=this.get("id");t&&delete N.entitiesById[t]}setTimeout(i,t){const e=setTimeout(()=>{this.removeDispose(s),i()},t),s=new D(()=>{clearTimeout(e)});return this._disposers.push(s),s}removeDispose(i){if(!this.isDisposed()){let t=st(this._disposers,i);t>-1&&this._disposers.splice(t,1)}i.dispose()}hasTag(i){return st(this.get("themeTags",[]),i)!==-1}addTag(i){if(!this.hasTag(i)){const t=this.get("themeTags",[]);t.push(i),this.set("themeTags",t)}}removeTag(i){if(this.hasTag(i)){const t=this.get("themeTags",[]);Wt(t,i),this.set("themeTags",t)}}_t(i,t,...e){return this._root.language.translate(i,t,...e)}get root(){return this._root}};function Pt(i){v(i,(t,e)=>{St(e)&&typeof e.dispose=="function"&&(e.enableDispose=!0,e.dispose())})}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Le{constructor(t,e,s){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=s}_dispose(){Pt(this._settings)}get(t,e){const s=this._settings[t];return s!==void 0?s:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){T(t).forEach(e=>{this._settings[e]=t[e]}),this._template._stateChanged(this._name)}_apply(t,e){v(this._settings,(s,r)=>{e[s]||t._userSettings[s]||(e[s]=!0,t.setRaw(s,r))})}}class Ne{constructor(t){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}_dispose(){v(this._states,(t,e)=>{e._dispose()})}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Le(t,this._template,e);return this._states[t]=r,this._template._stateChanged(t),r}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){v(this._states,(s,r)=>{let n=e.states[s];n==null&&(n=e.states[s]={});const a=t.states.create(s,{});r._apply(a,n)})}}class Re{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let s=this._callbacks[t];return s===void 0&&(s=this._callbacks[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._callbacks[t]})}remove(t){this._callbacks[t]!==void 0&&delete this._callbacks[t]}_apply(t){const e=[];return v(this._callbacks,(s,r)=>{c(r,n=>{e.push(t.adapters.add(s,n))})}),new O(e)}}class J{constructor(t,e){if(Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ne(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Re}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Q}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=t}static new(t){return new J(t,!0)}_dispose(){Pt(this._settings),Pt(this._privateSettings)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}_checkDisposed(){if(this._disposed)throw new Error("Template is disposed")}get entities(){return this._entities}get(t,e){this._checkDisposed();const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._checkDisposed(),this._settings[t]=e}set(t,e){this._checkDisposed(),this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach(s=>{s._setTemplateProperty(this,t,e)}))}remove(t){this._checkDisposed(),t in this._settings&&(delete this._settings[t],this._entities.forEach(e=>{e._removeTemplateProperty(t)}))}removeAll(){this._checkDisposed(),v(this._settings,(t,e)=>{this.remove(t)})}getPrivate(t,e){this._checkDisposed();const s=this._privateSettings[t];return s!==void 0?s:e}setPrivateRaw(t,e){return this._checkDisposed(),this._privateSettings[t]=e,e}setPrivate(t,e){return this._checkDisposed(),this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach(s=>{s._setTemplatePrivateProperty(this,t,e)})),e}removePrivate(t){this._checkDisposed(),t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach(e=>{e._removeTemplatePrivateProperty(t)}))}setAll(t){this._checkDisposed(),v(t,(e,s)=>{this.set(e,s)})}on(t,e){this._checkDisposed();let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}onPrivate(t,e){this._checkDisposed();let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}_apply(t,e){this._checkDisposed();const s=[];return v(this._settingEvents,(r,n)=>{c(n,a=>{s.push(t.on(r,a))})}),v(this._privateSettingEvents,(r,n)=>{c(n,a=>{s.push(t.onPrivate(r,a))})}),this.states._apply(t,e),s.push(this.adapters._apply(t)),s.push(t.events.copyFrom(this.events)),new O(s)}_setObjectTemplate(t){this._checkDisposed(),this._entities.push(t)}_removeObjectTemplate(t){Wt(this._entities,t)}_stateChanged(t){this._checkDisposed(),this._entities.forEach(e=>{e._applyStateByKey(t)})}}class nt extends Q{constructor(t){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let s=this._rendererDisposers[t];if(s===void 0){const r=this._sprite._display.on(t,n=>{e.call(this,n)});s=this._rendererDisposers[t]=new ue(()=>{delete this._rendererDisposers[t],r.dispose()})}return s.increment()}_on(t,e,s,r,n,a){const o=super._on(t,e,s,r,n,a),h=nt.RENDERER_EVENTS[e];return h!==void 0&&(o.disposer=new O([o.disposer,this._onRenderer(e,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const s=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=s}}}Object.defineProperty(nt,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(i){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",i))&&this.dispatch("click",this._makePointerEvent("click",i))},rightclick:function(i){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",i))},middleclick:function(i){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",i))},dblclick:function(i){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",i))},pointerover:function(i){const t=this._sprite;let e=!0;if(t.getPrivate("trustBounds")){t._getBounds();const s=t.globalBounds();if(t.isType("Graphics")){const r=t.get("strokeWidth",1)/2;r>=1&&(s.left-=r,s.right+=r,s.top-=r,s.bottom+=r)}je(i.point,s)||(e=!1,t._root._renderer.removeHovering(t._display))}e&&this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",i))},pointerout:function(i){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",i))},pointerdown:function(i){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",i))},pointerup:function(i){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",i))},globalpointerup:function(i){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",i))},globalpointermove:function(i){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",i))},wheel:function(i){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:i.event,point:i.point})}}});class k extends B{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}markDirtyKey(t){this._markDirtyKey(t)}_markDirtyKey(t){super._markDirtyKey(t),t!="x"&&t!="y"&&t!="dx"&&t!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),t!="x"&&t!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new nt(this)}_processTemplateField(){let t;const e=this.get("templateField");if(e){const s=this.dataItem;if(s){const r=s.dataContext;r&&(t=r[e],t instanceof J||!t||(t=J.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const s="dataitemchanged";t!=e&&this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get("width")instanceof f||this.get("height")instanceof f?At(t._percentageSizeChildren,this):P(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get("x")instanceof f||this.get("y")instanceof f?At(t._percentagePositionChildren,this):P(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get("centerX");e!=null&&(this._display.pivot.x=t.left+M(e,t.right-t.left));const s=this.get("centerY");s!=null&&(this._display.pivot.y=t.top+M(s,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})),this._tooltipPointerDp=new O([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})}),this.events.on("pointerout",()=>{const s=this._tooltipMoveDp;s&&(s.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty("draggable")){const r=this.get("draggable");r?(this.set("interactive",!0),this._dragDp=new O([e.on("pointerdown",n=>{this.dragStart(n)}),e.on("globalpointermove",n=>{this.dragMove(n)}),e.on("globalpointerup",n=>{this.dragStop(n)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!r}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const r=this.get("tooltipText"),n=this.get("tooltipHTML"),a=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(r||n)&&(a=="click"?(this._tooltipDp=new O([e.on("click",()=>{this.setTimeout(()=>{const o=this.getTooltip();o&&!o.isHidden()&&o.get("tooltipTarget")===this?this.hideTooltip():this.showTooltip()},10)}),Kt(document,"click",o=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):a=="always"||(this._tooltipDp=new O([e.on("pointerover",()=>{this.showTooltip()}),e.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let r=this.get("toggleKey");r&&r!="none"?this._toggleDp=e.on("click",()=>{this._isDragging||this.set(r,!this.get(r))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(t.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("rotation")&&(this.markDirtyBounds(),t.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),t.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const r=this.parent;r&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(r.markDirty(),r._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight")||this.isDirty("marginLeft")||this.isDirty("marginTop")||this.isDirty("marginRight")||this.isDirty("marginBottom"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const r=this.get("wheelable");r&&this.set("interactive",!0),t.wheelable=!!r}(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(t.filter=this.get("filter"));let s=this.get("filter","");if(this.isDirty("blur")){const r=this.get("blur",0);r!=0&&(s+=" blur("+r+"px)")}if(this.isDirty("saturate")){const r=this.get("saturate",1);r!=1&&(s+=" saturate("+r+")")}if(this.isDirty("brightness")){const r=this.get("brightness",1);r!=1&&(s+=" brightness("+r+")")}if(this.isDirty("contrast")){const r=this.get("contrast",1);r!=1&&(s+=" contrast("+r+")")}if(this.isDirty("sepia")){const r=this.get("sepia",0);r!=0&&(s+=" sepia("+r+")")}if(this.isDirty("hue")){const r=this.get("hue",0);r!=0&&(s+=" hue-rotate("+r+"deg)")}if(this.isDirty("invert")){const r=this.get("invert",0);r!=0&&(s+=" invert("+r+")")}if(s&&(t.filter=s),this.isDirty("cursorOverStyle")&&(t.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new O([e.on("focus",()=>{this.showTooltip()}),e.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility(),this._disposers.push(e.on("blur",()=>{this.setPrivateRaw("touchHovering",!1)}))),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(t.exportable=this.get("exportable")),this.isDirty("interactive")){const r=this.events;this.get("interactive")&&!r.isDisposed()?this._hoverDp=new O([r.on("click",n=>{Bt(n.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})},10))}),r.on("globalpointerup",n=>{Bt(n.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})),this._isDown&&this._handleUp(n)}),r.on("pointerover",()=>{this._handleOver()}),r.on("pointerout",()=>{this._handleOut()}),r.on("pointerdown",n=>{this._handleDown(n)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e="dragstop";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(t){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const e=pt(t.originalEvent);delete this._downPoints[e],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(t){const e=pt(t.originalEvent),s=this._downPoints[e];if(s){const r=Math.abs(s.x-t.point.x),n=Math.abs(s.y-t.point.y);return r>5||n>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get("draggable")&&e._handleDown(t),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const s=pt(t.originalEvent);this._downPoints[s]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let s=0,r=this.parent,n=1;for(;r!=null;)s+=r.get("rotation",0),r=r.parent,r&&(n*=r.get("scale",1));let a=(t.point.x-e.point.x)/n,o=(t.point.y-e.point.y)/n;const h=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+a*wt(s)+o*yt(s)),this.set("y",l.y+o*wt(s)-a*yt(s));const d="dragged";h.isEnabled(d)&&h.dispatch(d,{type:d,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(a,o)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&this.get("position")!="absolute"&&(e.get("width")==null||e.get("height")==null||e.get("layout"))&&e.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const s="boundschanged";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds()),this.getPrivate("showingTooltip")&&this.showTooltip()}}_fixMinBounds(t){let e=this.get("minWidth",this.getPrivate("minWidth")),s=this.get("minHeight",this.getPrivate("minHeight"));g(e)&&t.right-t.left0?t.right=t.left+r:t.left=t.right+r),g(n)&&(n>0?t.bottom=t.top+n:t.top=t.bottom+n)}_removeParent(t){t&&(t.children.removeValue(this),P(t._percentageSizeChildren,this),P(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.isDisposed()||(this.showTooltip(),this._handleOver())}unhover(){this.isDisposed()||(this.hideTooltip(),this._handleOut())}showTooltip(t){if(!this.isDisposed()){const e=this.getTooltip(),s=this.get("tooltipText"),r=this.get("tooltipHTML");if((s||r)&&e){const n=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);n!="fixed"&&t||(this._display._setMatrix(),t=this.toGlobal(a._getTooltipPoint())),e.set("pointTo",t),e.set("tooltipTarget",a),e.get("x")||e.set("x",t.x),e.get("y")||e.set("y",t.y),s&&e.label.set("text",s),r&&e.label.set("html",r);const o=this.dataItem;if(o&&e.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const h=e.show();return this.setPrivateRaw("showingTooltip",!0),h}}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==t)){let e=t.get("keepTargetHover")&&t.get("stateAnimationDuration",0)==0?400:void 0;const s=t.hide(e);return this.setPrivateRaw("showingTooltip",!1),s}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,s=0;return this.get("isMeasured")?(e=t.left+M(this.get("tooltipX",0),t.right-t.left),s=t.top+M(this.get("tooltipY",0),t.bottom-t.top)):(e=M(this.get("tooltipX",0),this.width()),s=M(this.get("tooltipY",0),this.height())),{x:e,y:s}}return{x:0,y:0}}getTooltip(){let t=this.get("tooltip");if(t)return t;{let e=this.parent;if(e)return e.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get("dx",0),s=this.get("dy",0),r=this.get("x"),n=this.getPrivate("x"),a=0,o=0;const h=this.get("position");r instanceof f&&(r=t?t.innerWidth()*r.value+t.get("paddingLeft",0):0),g(r)?a=r+e:n!=null?a=n:t&&h=="relative"&&(a=t.get("paddingLeft",0)+e);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=t?t.innerHeight()*l.value+t.get("paddingTop",0):0),g(l)?o=l+s:d!=null?o=d:t&&h=="relative"&&(o=t.get("paddingTop",0)+s);const p=this._display;if(p.x!=a||p.y!=o){p.invalidateBounds(),p.x=a,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let t=this.get("x"),e=this.getPrivate("x");const s=this.parent;return s?t instanceof f?M(t,s.innerWidth())+s.get("paddingLeft",0):g(t)?t:e??s.get("paddingLeft",this._display.x):this._display.x}y(){let t=this.getPrivate("y");if(t!=null)return t;let e=this.get("y");const s=this.parent;return s?e instanceof f?M(e,s.innerHeight())+s.get("paddingTop",0):g(e)?e:t??s.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get("tooltip");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),s=this.y();return{left:t.left+e,right:t.right+e,top:t.top+s,bottom:t.bottom+s}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),s=this.toGlobal({x:t.right,y:t.top}),r=this.toGlobal({x:t.right,y:t.bottom}),n=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,s.x,r.x,n.x),top:Math.min(e.y,s.y,r.y,n.y),right:Math.max(e.x,s.x,r.x,n.x),bottom:Math.max(e.y,s.y,r.y,n.y)}}_onShow(t){}_onHide(t){}appear(t,e){return tt(this,void 0,void 0,function*(){return yield this.hide(0),e?new Promise((s,r)=>{this.setTimeout(()=>{s(this.show(t))},e)}):this.show(t)})}show(t){return tt(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(t);const e=this.states.applyAnimate("default",t);yield Lt(e),this._isShowing=!1}})}hide(t){return tt(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let e=this.states.lookup("hidden");e||(e=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(t);const s=this.states.applyAnimate("hidden",t);yield Lt(s),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*t:t}compositeScale(){const t=this.get("scale",1);return this._parent?this._parent.compositeScale()*t:t}compositeRotation(){const t=this.get("rotation",0);return this._parent?this._parent.compositeRotation()+t:t}width(){let t=this.get("width"),e=this.get("maxWidth",this.getPrivate("maxWidth")),s=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof f){const a=this.parent;n=a?a.innerWidth()*t.value:this._root.width()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}maxWidth(){let t=this.get("maxWidth",this.getPrivate("maxWidth"));if(g(t))return t;{let s=this.get("width");if(g(s))return s}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get("maxHeight",this.getPrivate("maxHeight"));if(g(t))return t;{let s=this.get("height");if(g(s))return s}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get("height"),e=this.get("maxHeight",this.getPrivate("maxHeight")),s=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof f){const a=this.parent;n=a?a.innerHeight()*t.value:this._root.height()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const s=this._parent;t!==s&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(s),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return le(this._downPoints,(t,e)=>t>e?1:t0&&(a.beginFill(r,n),a.drawRect(0,0,e,s),a.endFill()),o.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(o,a,t,e,s)}this._clear=!1}}Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([V.className])});class K extends V{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load();const t=this.get("canvas");t&&(this.set("width",t.width),this.set("height",t.height))}_draw(){super._draw();const t=this._image;if(t){const s=this.get("width",100),r=this.get("height",100),n=this.get("fit","image");let a=0,o=0;n=="pattern"?(a=s,o=r):(a=t.width,o=t.height,n=="image"&&(this.set("width",a),this.set("height",o)));let h=0,l=0;this.get("centered",!0)&&(h=s/2-a/2,l=r/2-o/2),this._display.image(t,a,o,h,l)}const e=this.get("canvas");e&&this._display.image(e,e.width,e.height,0,0)}_load(){const t=this.get("src");if(t){const e=new Image;e.src=t,e.decode().then(()=>{this._image=e,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(s=>{})}}}var Dt;Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([K.className])}),function(i){i.ADD="lighter",i.COLOR="color",i.COLOR_BURN="color-burn",i.COLOR_DODGE="color-dodge",i.DARKEN="darken",i.DIFFERENCE="difference",i.DST_OVER="destination-over",i.EXCLUSION="exclusion",i.HARD_LIGHT="hard-light",i.HUE="hue",i.LIGHTEN="lighten",i.LUMINOSITY="luminosity",i.MULTIPLY="multiply",i.NORMAL="source-over",i.OVERLAY="overlay",i.SATURATION="saturation",i.SCREEN="screen",i.SOFT_LIGHT="soft-light",i.SRC_ATOP="source-atop",i.XOR="xor"}(Dt||(Dt={}));const Ii=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset","shadowBlur","shadowColor","shadowOpacity","shadowOffsetX","shadowOffsetY","blur","sepia","invert","brightness","hue","contrast","saturate"];class G extends k{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const t=this.get("fillGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const t=this.get("strokeGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get("strokeDasharray");g(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get("strokeDashoffset");e&&this._display.setLineDashOffset(e);const s=this.get("blendMode",Dt.NORMAL);this._display.blendMode=s;const r=this.get("draw");r&&typeof r=="function"&&r(this._display,this);const n=this.get("svgPath");n!=null&&this._display.svgPath(n)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get("fill"),e=this.get("fillGradient"),s=this.get("fillPattern"),r=this.get("fillOpacity"),n=this.get("stroke"),a=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),t&&!e&&(this._display.beginFill(t,r),this._display.endFill()),e){if(t){const m=e.get("stops",[]);m.length&&c(m,b=>{b.color&&!b.colorInherited||!t||(b.color=t,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const _=e.getFill(this);_&&(this._display.beginFill(_,r),this._display.endFill())}if(s){const _=s.pattern;_&&(this._display.beginFill(_,r),this._display.endFill(),s instanceof K&&s.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}if(n||a||o){const _=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(n&&!a&&(this._display.lineStyle(m,n,_,b),this._display.endStroke()),a){const S=a.get("stops",[]);S.length&&c(S,w=>{w.color&&!w.colorInherited||!n||(w.color=n,w.colorInherited=!0),(w.opacity==null||w.opacityInherited)&&(w.opacity=_,w.opacityInherited=!0)});const H=a.getFill(this);H&&(this._display.lineStyle(m,H,_,b),this._display.endStroke())}if(o){let S=o.pattern;S&&(this._display.lineStyle(m,S,_,b),this._display.endStroke(),o instanceof K&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([G.className])});class z extends G{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(i,t){i.get("reverseChildren",!1)?i.children.eachReverse(t):i.children.each(t)}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([z.className])});class E extends B{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([E.className])});class Y extends E{updateContainer(t){let e=t.get("paddingLeft",0),s=t.innerWidth(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minWidth",a.getPrivate("minWidth",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.width()),s-=o+a.get("marginLeft",0)+a.get("marginRight",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){let h=s*o.value/r-a.get("marginLeft",0)-a.get("marginRight",0),l=a.get("minWidth",a.getPrivate("minWidth",-1/0)),d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("width",h)}else a._prevSettings.width instanceof f&&a.setPrivate("width",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginLeft",0),l=a.get("marginRight",0),d=a.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let _=n+h-p;a.setPrivate("x",_),n=_+u+l}else a.setPrivate("x",void 0)})}}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Y.className])});class X extends E{updateContainer(t){let e=t.get("paddingTop",0),s=t.innerHeight(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minHeight",a.getPrivate("minHeight",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.height()),s-=o+a.get("marginTop",0)+a.get("marginBottom",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){let h=s*o.value/r-a.get("marginTop",0)-a.get("marginBottom",0),l=a.get("minHeight",a.getPrivate("minHeight",-1/0)),d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("height",h)}else a._prevSettings.height instanceof f&&a.setPrivate("height",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginTop",0),l=o.top,d=o.bottom,p=a.get("maxHeight");p&&d-l>p&&(d=l+p);let u=a.get("marginBottom",0),_=n+h-l;a.setPrivate("y",_),n=_+d+u}else a.setPrivate("y",void 0)})}}Object.defineProperty(X,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(X,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([X.className])});class $ extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get("paddingLeft",0),s=t.get("paddingRight",0),r=t.get("paddingTop",0),n=t.maxWidth()-e-s,a=n,o=1;j(t,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),a=Nt(a,1,n),o=Nt(o,1,n);let h=1;h=this.get("fixedWidthGrid")?n/o:n/a,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(t,h,o,n),d=r,p=0,u=0;h=l.length;let _=e;j(t,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let H=m.adjustedLocalBounds(),w=m.get("marginLeft",0),C=m.get("marginRight",0),x=_+w-H.left,L=d+b-H.top;m.setPrivate("x",x),m.setPrivate("y",L),_+=l[p]+C,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,_=e,d+=u)}})}getColumnWidths(t,e,s,r){let n=0,a=[],o=0;return j(t,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?a[o]=s:a[o]=Math.max(0|a[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{n+=h}),n>r?e>2?(e-=1,this.getColumnWidths(t,e,s,r)):[r]:a}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([$.className])});class xt{static escape(t){return t.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(t){return t.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(t){return t.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(t,e=!1,s=!1){let r=[];t=this.escape(t);let n=e?t.split("'"):[t];for(let a=0;a{t.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(t=>{t.removePrivate("x"),t.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(t=>{t.markDirtyPosition()}),this.isDirty("maskContent")){const t=this._childrenDisplay;let e=this._contentMask;this.get("maskContent")?e||(e=z.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),c(this._percentageSizeChildren,t=>{t._updateSize()}),c(this._percentagePositionChildren,t=>{t.markDirtyPosition(),t._updateSize()}),this.updateBackground()}updateBackground(){const t=this.get("background");let e=this._localBounds;if(e&&!this.isHidden()){let s=e.left,r=e.top,n=e.right-s,a=e.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&a>h&&(a=h),o&&n>o&&(n=o);let l=this.width(),d=this.height();t&&(t.setAll({width:n,height:a,x:s,y:r}),this._display.interactive&&(t._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const _=u.get("background");_&&_.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(t=!1){return!!super._applyThemes(t)&&(this.eachChildren(e=>{e._applyThemes(t)}),!0)}_applyState(t){super._applyState(t),this.get("setStateOnChildren")&&this.eachChildren(e=>{e.states.apply(t)})}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get("setStateOnChildren")&&this.eachChildren(s=>{s.states.applyAnimate(t,e)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){if(this.get("html")){let t=this._localBounds;t&&(this._contentWidth=t.right-t.left,this._contentHeight=t.bottom-t.top)}else{let t=this.get("width"),e=this.get("height"),s=this.getPrivate("width"),r=this.getPrivate("height"),n={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),o=!1,h=!1;if((a instanceof Y||a instanceof $)&&(o=!0),a instanceof X&&(h=!0),t==null&&s==null||e==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,_=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),H=this.get("paddingBottom",0);this.children.each(x=>{if(x.get("position")!="absolute"&&x.get("isMeasured")){let L=x.adjustedLocalBounds(),jt=x.x(),Et=x.y(),at=jt+L.left,ot=jt+L.right,ht=Et+L.top,lt=Et+L.bottom;o&&(at-=x.get("marginLeft",0),ot+=x.get("marginRight",0)),h&&(ht-=x.get("marginTop",0),lt+=x.get("marginBottom",0)),atp&&(p=ot),ht_&&(_=lt)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),_==-l&&(_=0),n.left=d-m,n.top=u-b,n.right=p+S,n.bottom=_+H;const w=this.get("minWidth");g(w)&&w>0&&n.right-n.left=w?n.left=n.right-w:n.right=n.left+w);const C=this.get("minHeight");g(C)&&C>0&&n.bottom-n.top=C?n.top=n.bottom-C:n.bottom=n.top+C)}this._contentWidth=n.right-n.left,this._contentHeight=n.bottom-n.top,g(t)&&(n.left=0,n.right=t),g(s)&&(n.left=0,n.right=s),g(e)&&(n.top=0,n.bottom=e),g(r)&&(n.top=0,n.bottom=r),this._localBounds=n}}_updateBounds(){const t=this.get("layout");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let s=this.get("layout"),r=!1,n=!1;s&&((s instanceof Y||s instanceof $)&&(r=!0),s instanceof X&&(n=!0)),c(this._percentageSizeChildren,a=>{if(!r){let o=a.get("width");o instanceof f&&a.setPrivate("width",o.value*t)}if(!n){let o=a.get("height");o instanceof f&&a.setPrivate("height",o.value*e)}}),c(this._percentagePositionChildren,a=>{a.markDirtyPosition(),a.markDirtyBounds()}),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateHTMLContent(){const t=this.get("html");t&&t!==""?this._root._setHTMLContent(this,rt(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}scrollToChild(t){const e=this.get("verticalScrollbar");if(e){let s=t.y(),r=this.innerHeight(),n=t.height(),a=this._contentHeight,o=1-(r-n/2)/a;if(s+.7*n+this._childrenDisplay.y>r||s-.3*n+this._childrenDisplay.y<0){let h=Math.max(0,Math.min(o,(s-n/2)/a));e.animate({key:"start",to:h,duration:e.get("animationDuration",0),easing:e.get("animationEasing")})}}}_updateChildren(){if(this.isDirty("html")&&this._updateHTMLContent(),this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.startGrip.setPrivate("visible",!1),t.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let e=this.get("background");e||(e=this.set("background",z.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",s=>{const r=s.originalEvent;if(!ce(r,this))return;r.preventDefault();let n=r.deltaY/5e3;const a=t.get("start",0),o=t.get("end",1);a+n<=0&&(n=-a),o+n>=1&&(n=1-o),a+n>=0&&o+n<=1&&(t.set("start",a+n),t.set("end",o+n))}),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",()=>{let s=this._contentHeight;const r=this._childrenDisplay,n=this._contentMask;r.y=-t.get("start",0)*s,r.markDirtyLayer(),n&&(n._display.y=-r.y,r.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const e=this._prevSettings.verticalScrollbar;e&&(this._display.removeChild(e._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get("background");e instanceof k&&(e.set("isMeasured",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const s=t.parent;s&&s.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(t=>{t._processTemplateField()})}walkChildren(t){this.children.each(e=>{e instanceof Qt&&e.walkChildren(t),t(e)})}eachChildren(t){const e=this.get("background");e&&t(e);const s=this.get("verticalScrollbar");s&&t(s);const r=this.get("mask");r&&t(r),this.children.values.forEach(n=>{t(n)})}allChildren(){const t=[];return this.eachChildren(e=>{t.push(e)}),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const s=this.get("html","");s&&s!==""&&e&&this._root._setHTMLContent(this,rt(this,s))}};Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([Z.className])});class it extends k{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","maxChars"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text")){super._updateBounds();let t=this.get("fillGradient");t&&(this._display.style.fill=t.getFill(this))}else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty("opacity")){let e=this.get("opacity",1);this._display.alpha=e}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new D(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(t.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(t.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(t.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(t.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(t.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")||this.isDirty("fillGradient")){const e=this.get("fill"),s=this.get("fillGradient"),r=this.get("fillOpacity");if(s){if(e){const n=s.get("stops",[]);n.length&&c(n,a=>{a.color&&!a.colorInherited||!e||(a.color=e,a.colorInherited=!0),(a.opacity==null||a.opacityInherited)&&(a.opacity=r,a.opacityInherited=!0)})}t.fill=s.getFill(this)}else e&&(t.fill=e)}if(this.isDirty("fillOpacity")){let e=this.get("fillOpacity",1);e&&(t.fillOpacity=e)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(t.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(t.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),c(this._textStyles,e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())}),t.fontSize=this.get("fontSize"),t.fontFamily=this.get("fontFamily"),this._display.style=t,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){let t=this.get("text","");return this.get("maxChars")&&(t=fe(t,this.get("maxChars",1e8),this.get("breakWords"),this.get("ellipsis"))),this.get("populateText")?rt(this,t):t}_getAccessibleText(){const t=this.get("ariaLabel");return t!==void 0?this.get("populateText")?rt(this,t):t:this._getText()}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(it,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(it,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([it.className])});class _t extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillGradient","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting","maxChars","ariaLabel"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),c(this._textKeys,t=>{const e=this.get(t);e!=null&&this._text.set(t,e)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(it.new(this._root,{}))}_updateChildren(){super._updateChildren();const t=this._text;if(c(this._textKeys,s=>{this._text.set(s,this.get(s))}),(this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("rotation"))&&this._setMaxDimentions(),this.get("html","")!==""?t.set("text",""):(t.set("text",this.get("text")),this._maybeUpdateHTMLColor()),(this.isDirty("fill")||this.isDirty("fillGradient"))&&this._maybeUpdateHTMLColor(),this.isDirty("textAlign")||this.isDirty("width")){const s=this.get("textAlign");let r;this.get("width")!=null?r=s=="right"?qt:s=="center"?te:0:s=="left"||s=="start"?r=this.get("paddingLeft",0):s!="right"&&s!="end"||(r=-this.get("paddingRight",0)),t.set("x",r)}const e=this.get("background");e&&e.setPrivate("visible",t._display.textVisible)}_maybeUpdateHTMLColor(){const t=this.getPrivate("htmlElement");t&&this.get("fill")&&(t.style.color=this.get("fill").toCSSHex())}_setMaxDimentions(){const t=this.get("rotation"),e=t==90||t==270||t==-90,s=this._text,r=this.get("maxWidth",this.getPrivate("maxWidth",1/0));g(r)?s.set(e?"maxHeight":"maxWidth",r-this.get("paddingLeft",0)-this.get("paddingRight",0)):s.set(e?"maxHeight":"maxWidth",void 0);const n=this.get("maxHeight",this.getPrivate("maxHeight",1/0));g(n)?s.set(e?"maxWidth":"maxHeight",n-this.get("paddingTop",0)-this.get("paddingBottom",0)):s.set(e?"maxWidth":"maxHeight",void 0),this.root.events.once("frameended",()=>{s.markDirtyBounds()})}_setDataItem(t){super._setDataItem(t),this._markDirtyKey("text");const e=this._text;e.get("populateText")&&e.markDirtyText();const s=this.get("html");s&&s!==""&&this._updateHTMLContent()}getText(){return this._text._getText()}getAccessibleText(){return this._text._getAccessibleText()}}Object.defineProperty(_t,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(_t,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([_t.className])});class Li{constructor(t,e){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let s=this._rules[t];s||(s=this._rules[t]=[]),e.sort(R);const{index:r,found:n}=oe(s,a=>{const o=R(a.tags.length,e.length);return o===0?Jt(a.tags,e,R):o});if(n)return s[r].template;{const a=J.new({});return s.splice(r,0,{tags:e,template:a}),a}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ht as $,Ve as A,g as B,wi as C,D,B as E,di as F,Y as G,Z as H,oi as I,ct as J,z as K,N as L,vi as M,R as N,Bi as O,P,yi as Q,li as R,ti as S,qe as T,qt as U,G as V,Q as W,_i as X,$ as Y,fi as Z,xt as _,Kt as a,mi as a0,bi as a1,mt as a2,ci as a3,Je as a4,Ge as a5,Qe as a6,st as a7,y as a8,ri as a9,wt as aA,yt as aB,Zt as aC,Ii as aD,Ie as aE,Xt as aF,ne as aG,xe as aH,Te as aI,Ye as aJ,Si as aK,Hi as aL,Bt as aM,xi as aN,Tt as aO,Pi as aP,ji as aQ,ue as aa,O as ab,si as ac,ai as ad,U as ae,Xe as af,Dt as ag,vt as ah,Ei as ai,gi as aj,ni as ak,Vt as al,Ci as am,Ti as an,Di as ao,_t as ap,Nt as aq,Li as ar,Ai as as,te as at,Ee as au,ce as av,M as aw,Mi as ax,Oi as ay,J as az,hi as b,c,ii as d,Wt as e,pi as f,At as g,ze as h,Ft as i,ei as j,T as k,ki as l,it as m,f as n,ut as o,Ue as p,St as q,ui as r,Ot as s,rt as t,Ze as u,v,$e as w,Mt as x,Ke as y,X as z}; diff --git a/main/assets/Tick-DUHqbpyB-BTe8OtHV.js b/main/assets/Tick-DUHqbpyB-BTe8OtHV.js new file mode 100644 index 000000000..6cecb928e --- /dev/null +++ b/main/assets/Tick-DUHqbpyB-BTe8OtHV.js @@ -0,0 +1 @@ +import{k0 as O}from"./main-C7yV2j71.js";import{H as C,V as K,aE as Q,c as w,k as Z,aF as X,U as k,aG as W,B as $,a8 as H,n as J,aH as ee,ap as z,aI as te,a5 as G}from"./Theme-rblUnB2V-BgKdZgu2.js";class se extends X{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,s){this.processor&&this.processor.processRow(s),super._onSetIndex(e,t,s)}}class R extends Q{constructor(e,t,s){super(s),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class j extends C{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new se}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")w(t,s=>{s.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.push(s),this.processDataItem(s)}else if(e.type==="setIndex"){const s=t[e.index],i=this._makeDataItem(e.newValue);s.bullets&&s.bullets.length==0&&(s.bullets=void 0),Z(i).forEach(r=>{s.animate({key:r,to:i[r],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),s.dataContext=e.newValue}else if(e.type==="insertIndex"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,s),this.processDataItem(s)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const s=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,s)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},w(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},w(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&w(this._valueFields,s=>{const i=this.get(this._valueFieldsF[s].fieldKey);t[s]=e[i],t[this._valueFieldsF[s].workingKey]=t[s]}),this._fields&&w(this._fields,s=>{const i=this.get(this._fieldsF[s]);t[s]=e[i]}),t}makeDataItem(e,t){let s=new R(this,t,e);return this.processDataItem(s),s}pushDataItem(e,t){const s=this.makeDataItem(e,t);return this._mainDataItems.push(s),s}disposeDataItem(e){}showDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function ie(l){return new Promise((e,t)=>{setTimeout(e,l)})}Object.defineProperty(j,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(j,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([j.className])});let ae={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function P(l,e){return e==null&&(e=1),ae[l]*e}function U(l,e,t,s,i,r,o){if(!o||i){let h=0;switch(i||e=="millisecond"||(h=l.getTimezoneOffset(),l.setUTCMinutes(l.getUTCMinutes()-h)),e){case"day":let d=l.getUTCDate();if(t>1){if(r){r=U(r,"day",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("day")/t),x=P("day",b*t);l.setTime(r.getTime()+x-h*P("minute"))}}else l.setUTCDate(d);l.setUTCHours(0,0,0,0);break;case"second":let n=l.getUTCSeconds();t>1&&(n=Math.floor(n/t)*t),l.setUTCSeconds(n,0);break;case"millisecond":if(t==1)return l;let m=l.getUTCMilliseconds();m=Math.floor(m/t)*t,l.setUTCMilliseconds(m);break;case"hour":let f=l.getUTCHours();t>1&&(f=Math.floor(f/t)*t),l.setUTCHours(f,0,0,0);break;case"minute":let u=l.getUTCMinutes();t>1&&(u=Math.floor(u/t)*t),l.setUTCMinutes(u,0,0);break;case"month":let a=l.getUTCMonth();t>1&&(a=Math.floor(a/t)*t),l.setUTCMonth(a,1),l.setUTCHours(0,0,0,0);break;case"year":let g=l.getUTCFullYear();t>1&&(g=Math.floor(g/t)*t),l.setUTCFullYear(g,0,1),l.setUTCHours(0,0,0,0);break;case"week":if(t>1&&r){r=U(r,"week",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("week")/t),x=P("week",b*t);l.setTime(r.getTime()+x-h*P("minute"))}let y=l.getUTCDate(),_=l.getUTCDay();$(s)||(s=1),y=_>=s?y-_+s:y-(7+_)+s,l.setUTCDate(y),l.setUTCHours(0,0,0,0)}if(!i&&e!="millisecond"&&(l.setUTCMinutes(l.getUTCMinutes()+h),e=="day"||e=="week"||e=="month"||e=="year")){let d=l.getTimezoneOffset();if(d!=h){let n=d-h;l.setUTCMinutes(l.getUTCMinutes()+n)}}return l}{if(isNaN(l.getTime()))return l;let h=o.offsetUTC(l),d=l.getTimezoneOffset(),n=o.parseDate(l),m=n.year,f=n.month,u=n.day,a=n.hour,g=n.minute,y=n.second,_=n.millisecond,D=n.weekday,b=h-d;switch(e){case"day":if(t>1&&r){r=U(r,"day",1,s,i,void 0,o);let T=l.getTime()-r.getTime(),V=Math.floor(T/P("day")/t),I=P("day",V*t);l.setTime(r.getTime()+I),n=o.parseDate(l),m=n.year,f=n.month,u=n.day}a=0,g=b,y=0,_=0;break;case"second":g+=b,t>1&&(y=Math.floor(y/t)*t),_=0;break;case"millisecond":g+=b,t>1&&(_=Math.floor(_/t)*t);break;case"hour":t>1&&(a=Math.floor(a/t)*t),g=b,y=0,_=0;break;case"minute":t>1&&(g=Math.floor(g/t)*t),g+=b,y=0,_=0;break;case"month":t>1&&(f=Math.floor(f/t)*t),u=1,a=0,g=b,y=0,_=0;break;case"year":t>1&&(m=Math.floor(m/t)*t),f=0,u=1,a=0,g=b,y=0,_=0;break;case"week":$(s)||(s=1),u=D>=s?u-D+s:u-(7+D)+s,a=0,g=b,y=0,_=0}let x=(l=new Date(m,f,u,a,g,y,_)).getTimezoneOffset(),c=o.offsetUTC(l)-x;return c!=b&&l.setTime(l.getTime()+6e4*(c-b)),l}}class B extends j{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,position:"absolute"})})}_afterNew(){this.valueFields.push("value","customValue"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){w(e,t=>{const s=t.bullets;s&&(w(s,i=>{i.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return W(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,s){const i=t(this._root,this,e);return i&&(i._index=s,this._makeBulletReal(e,i)),i}_makeBulletReal(e,t){let s=t.get("sprite");s&&(s._setDataItem(e),s.setRaw("position","absolute"),this.bulletsContainer.children.push(s)),t.series=this,e.bullets.push(t)}addBullet(e,t){e.bullets||(e.bullets=[]),t&&this._makeBulletReal(e,t)}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("name")&&this.updateLegendValue(),this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const s=this.getPrivate("baseValueSeries");s&&this._disposers.push(s.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0,e!=0&&(this._psi=void 0))),this._psi==e&&this._pei==t&&!this.isPrivateDirty("adjustedStartIndex")||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let s=this.get("tooltip");s&&(s.hide(0),s.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let s;const i=this.get("legendDataItem");if(i&&(s=i.get("markerRectangle"),s&&this.isVisible())){if(this.isDirty("stroke")){let r=this.get("stroke");s.set("stroke",r)}if(this.isDirty("fill")){let r=this.get("fill");s.set("fill",r)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let s=this.startIndex(),i=this.endIndex();i{i[a]=0,r[a]=0,o[a]=0}),w(s,a=>{let g=a+"Change",y=a+"ChangePercent",_=a+"ChangePrevious",D=a+"ChangePreviousPercent",b=a+"ChangeSelection",x=a+"ChangeSelectionPercent",c="valueY";a!="valueX"&&a!="openValueX"&&a!="lowValueX"&&a!="highValueX"||(c="valueX");const T=this.getPrivate("baseValueSeries"),V=this.getPrivate("adjustedStartIndex",e);for(let I=V;Ip||h[a]==null)&&(h[a]=p),(d[a]0&&e--,delete u[a];for(let I=e;I{this.setPrivate(a+"AverageSelection",f[a]),this.setPrivate(a+"CountSelection",o[a]),this.setPrivate(a+"SumSelection",i[a]),this.setPrivate(a+"AbsoluteSumSelection",r[a]),this.setPrivate(a+"LowSelection",h[a]),this.setPrivate(a+"HighSelection",d[a]),this.setPrivate(a+"OpenSelection",n[a]),this.setPrivate(a+"CloseSelection",m[a])}),e===0&&t===this.dataItems.length&&w(s,a=>{this.setPrivate(a+"Average",f[a]),this.setPrivate(a+"Count",o[a]),this.setPrivate(a+"Sum",i[a]),this.setPrivate(a+"AbsoluteSum",r[a]),this.setPrivate(a+"Low",h[a]),this.setPrivate(a+"High",d[a]),this.setPrivate(a+"Open",n[a]),this.setPrivate(a+"Close",m[a])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&w(e,t=>{const s=t.minValue||this.getPrivate(t.dataField+"Low")||0,i=t.maxValue||this.getPrivate(t.dataField+"High")||0;w(t.target._entities,r=>{const o=r.dataItem.get(t.dataField);if(!$(o)){t.neutral&&r.set(t.key,t.neutral);const h=r.states;if(h){const d=h.lookup("default");d&&t.neutral&&d.set(t.key,t.neutral)}if(!t.customFunction)return}if(t.customFunction)t.customFunction.call(this,r,s,i,o);else{let h,d;h=t.logarithmic?(Math.log(o)*Math.LOG10E-Math.log(s)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(s)*Math.LOG10E):(o-s)/(i-s),!$(o)||$(h)&&Math.abs(h)!=1/0||(h=.5),$(t.min)?d=t.min+(t.max-t.min)*h:t.min instanceof H?d=H.interpolate(h,t.min,t.max):t.min instanceof J&&(d=ee(h,t.min,t.max)),r.set(t.key,d);const n=r.states;if(n){const m=n.lookup("default");m&&m.set(t.key,d)}}})}),this.get("visible")){let t=this.dataItems.length,s=this.startIndex(),i=this.endIndex();i0&&s--;for(let r=0;r{this._positionBullet(t);const s=t.get("sprite");t.get("dynamic")&&(s&&(s._markDirtyKey("fill"),s.markDirtySize()),s instanceof C&&s.walkChildren(i=>{i._markDirtyKey("fill"),i.markDirtySize(),i instanceof z&&i.text.markDirtyText()})),s instanceof z&&s.get("populateText")&&s.text.markDirtyText()})}_hideBullets(e){e.bullets&&w(e.bullets,t=>{let s=t.get("sprite");s&&s.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&w(t,s=>{s.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return O(this,void 0,void 0,function*(){const i=[s.showDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.show(t))}),yield Promise.all(i)})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return O(this,void 0,void 0,function*(){const i=[s.hideDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.hide(t))}),yield Promise.all(i)})}_sequencedShowHide(e,t){return O(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if($(t)||(t=this.get("interpolationDuration",0)),t>0){const s=this.startIndex(),i=this.endIndex();yield Promise.all(G(this.dataItems,(r,o)=>O(this,void 0,void 0,function*(){let h=t||0;(oi+10)&&(h=0);let d=this.get("sequencedDelay",0)+h/(i-s);yield ie(d*(o-s)),e?yield this.showDataItem(r,h):yield this.hideDataItem(r,h)})))}else yield Promise.all(G(this.dataItems,s=>e?this.showDataItem(s,0):this.hideDataItem(s,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const s=t.get("valueLabel");if(s){const r=s.text;let o="";s._setDataItem(e),o=this.get("legendValueText",r.get("text","")),s.set("text",o),r.markDirtyText()}const i=t.get("label");if(i){const r=i.text;let o="";i._setDataItem(e),o=this.get("legendLabelText",r.get("text","")),i.set("text",o),r.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function q(l,e){for(let t=0,s=e.length;t0){let r=i[0];if(r.length>0){let o=r[0];l.moveTo(o.x,o.y);for(let h=0,d=i.length;h0){let s=e[0];this._display.moveTo(s.x,s.y),q(this._display,[[e]])}else if(t)q(this._display,t);else if(!this.get("draw")){let s=this.width(),i=this.height();this._display.moveTo(0,0),this._display.lineTo(s,i)}}}}function de(l){return function(){return l}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([S.className])});const L=Math.PI,E=2*L,M=1e-6,le=E-M;function Y(l){this._+=l[0];for(let e=1,t=l.length;e=0))throw new Error(`invalid digits: ${l}`);if(e>15)return Y;const t=10**e;return function(s){this._+=s[0];for(let i=1,r=s.length;iM)if(Math.abs(f*d-n*m)>M&&r){let a=s-o,g=i-h,y=d*d+n*n,_=a*a+g*g,D=Math.sqrt(y),b=Math.sqrt(u),x=r*Math.tan((L-Math.acos((y+u-_)/(2*D*b)))/2),c=x/b,T=x/D;Math.abs(c-1)>M&&this._append`L${e+c*m},${t+c*f}`,this._append`A${r},${r},0,0,${+(f*a>m*g)},${this._x1=e+T*d},${this._y1=t+T*n}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,s,i,r,o){if(e=+e,t=+t,o=!!o,(s=+s)<0)throw new Error(`negative radius: ${s}`);let h=s*Math.cos(i),d=s*Math.sin(i),n=e+h,m=t+d,f=1^o,u=o?i-r:r-i;this._x1===null?this._append`M${n},${m}`:(Math.abs(this._x1-n)>M||Math.abs(this._y1-m)>M)&&this._append`L${n},${m}`,s&&(u<0&&(u=u%E+E),u>le?this._append`A${s},${s},0,1,${f},${e-h},${t-d}A${s},${s},0,1,${f},${this._x1=n},${this._y1=m}`:u>M&&this._append`A${s},${s},0,${+(u>=L)},${f},${this._x1=e+s*Math.cos(r)},${this._y1=t+s*Math.sin(r)}`)}rect(e,t,s,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${s=+s}v${+i}h${-s}Z`}toString(){return this._}}function ce(l){let e=3;return l.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const s=Math.floor(t);if(!(s>=0))throw new RangeError(`invalid digits: ${t}`);e=s}return l},()=>new oe(e)}class F extends C{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(C.new(this._root,{width:k,height:k,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:k,height:k})})}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([F.className])});class N extends F{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new te})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){w(t.oldValues,r=>{this._removeSeries(r)});const s=this.get("colors");s&&s.reset();const i=this.get("patterns");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(N,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(N,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([N.className])});class A extends S{}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([A.className])});export{A,N as B,U as N,R,B as U,j,de as n,ce as u}; diff --git a/main/assets/Tick-DUHqbpyB-BUwpVfeR.js b/main/assets/Tick-DUHqbpyB-BUwpVfeR.js deleted file mode 100644 index 7dd2a0516..000000000 --- a/main/assets/Tick-DUHqbpyB-BUwpVfeR.js +++ /dev/null @@ -1 +0,0 @@ -import{k0 as O}from"./main-BZaw9FpY.js";import{H as C,V as K,aE as Q,c as w,k as Z,aF as X,U as k,aG as W,B as $,a8 as H,n as J,aH as ee,ap as z,aI as te,a5 as G}from"./Theme-rblUnB2V-BIrfCzYF.js";class se extends X{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,s){this.processor&&this.processor.processRow(s),super._onSetIndex(e,t,s)}}class R extends Q{constructor(e,t,s){super(s),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class j extends C{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new se}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")w(t,s=>{s.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.push(s),this.processDataItem(s)}else if(e.type==="setIndex"){const s=t[e.index],i=this._makeDataItem(e.newValue);s.bullets&&s.bullets.length==0&&(s.bullets=void 0),Z(i).forEach(r=>{s.animate({key:r,to:i[r],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),s.dataContext=e.newValue}else if(e.type==="insertIndex"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,s),this.processDataItem(s)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const s=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,s)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},w(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},w(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&w(this._valueFields,s=>{const i=this.get(this._valueFieldsF[s].fieldKey);t[s]=e[i],t[this._valueFieldsF[s].workingKey]=t[s]}),this._fields&&w(this._fields,s=>{const i=this.get(this._fieldsF[s]);t[s]=e[i]}),t}makeDataItem(e,t){let s=new R(this,t,e);return this.processDataItem(s),s}pushDataItem(e,t){const s=this.makeDataItem(e,t);return this._mainDataItems.push(s),s}disposeDataItem(e){}showDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function ie(l){return new Promise((e,t)=>{setTimeout(e,l)})}Object.defineProperty(j,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(j,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([j.className])});let ae={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function P(l,e){return e==null&&(e=1),ae[l]*e}function U(l,e,t,s,i,r,o){if(!o||i){let h=0;switch(i||e=="millisecond"||(h=l.getTimezoneOffset(),l.setUTCMinutes(l.getUTCMinutes()-h)),e){case"day":let d=l.getUTCDate();if(t>1){if(r){r=U(r,"day",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("day")/t),x=P("day",b*t);l.setTime(r.getTime()+x-h*P("minute"))}}else l.setUTCDate(d);l.setUTCHours(0,0,0,0);break;case"second":let n=l.getUTCSeconds();t>1&&(n=Math.floor(n/t)*t),l.setUTCSeconds(n,0);break;case"millisecond":if(t==1)return l;let m=l.getUTCMilliseconds();m=Math.floor(m/t)*t,l.setUTCMilliseconds(m);break;case"hour":let f=l.getUTCHours();t>1&&(f=Math.floor(f/t)*t),l.setUTCHours(f,0,0,0);break;case"minute":let u=l.getUTCMinutes();t>1&&(u=Math.floor(u/t)*t),l.setUTCMinutes(u,0,0);break;case"month":let a=l.getUTCMonth();t>1&&(a=Math.floor(a/t)*t),l.setUTCMonth(a,1),l.setUTCHours(0,0,0,0);break;case"year":let g=l.getUTCFullYear();t>1&&(g=Math.floor(g/t)*t),l.setUTCFullYear(g,0,1),l.setUTCHours(0,0,0,0);break;case"week":if(t>1&&r){r=U(r,"week",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("week")/t),x=P("week",b*t);l.setTime(r.getTime()+x-h*P("minute"))}let y=l.getUTCDate(),_=l.getUTCDay();$(s)||(s=1),y=_>=s?y-_+s:y-(7+_)+s,l.setUTCDate(y),l.setUTCHours(0,0,0,0)}if(!i&&e!="millisecond"&&(l.setUTCMinutes(l.getUTCMinutes()+h),e=="day"||e=="week"||e=="month"||e=="year")){let d=l.getTimezoneOffset();if(d!=h){let n=d-h;l.setUTCMinutes(l.getUTCMinutes()+n)}}return l}{if(isNaN(l.getTime()))return l;let h=o.offsetUTC(l),d=l.getTimezoneOffset(),n=o.parseDate(l),m=n.year,f=n.month,u=n.day,a=n.hour,g=n.minute,y=n.second,_=n.millisecond,D=n.weekday,b=h-d;switch(e){case"day":if(t>1&&r){r=U(r,"day",1,s,i,void 0,o);let T=l.getTime()-r.getTime(),V=Math.floor(T/P("day")/t),I=P("day",V*t);l.setTime(r.getTime()+I),n=o.parseDate(l),m=n.year,f=n.month,u=n.day}a=0,g=b,y=0,_=0;break;case"second":g+=b,t>1&&(y=Math.floor(y/t)*t),_=0;break;case"millisecond":g+=b,t>1&&(_=Math.floor(_/t)*t);break;case"hour":t>1&&(a=Math.floor(a/t)*t),g=b,y=0,_=0;break;case"minute":t>1&&(g=Math.floor(g/t)*t),g+=b,y=0,_=0;break;case"month":t>1&&(f=Math.floor(f/t)*t),u=1,a=0,g=b,y=0,_=0;break;case"year":t>1&&(m=Math.floor(m/t)*t),f=0,u=1,a=0,g=b,y=0,_=0;break;case"week":$(s)||(s=1),u=D>=s?u-D+s:u-(7+D)+s,a=0,g=b,y=0,_=0}let x=(l=new Date(m,f,u,a,g,y,_)).getTimezoneOffset(),c=o.offsetUTC(l)-x;return c!=b&&l.setTime(l.getTime()+6e4*(c-b)),l}}class B extends j{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,position:"absolute"})})}_afterNew(){this.valueFields.push("value","customValue"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){w(e,t=>{const s=t.bullets;s&&(w(s,i=>{i.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return W(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,s){const i=t(this._root,this,e);return i&&(i._index=s,this._makeBulletReal(e,i)),i}_makeBulletReal(e,t){let s=t.get("sprite");s&&(s._setDataItem(e),s.setRaw("position","absolute"),this.bulletsContainer.children.push(s)),t.series=this,e.bullets.push(t)}addBullet(e,t){e.bullets||(e.bullets=[]),t&&this._makeBulletReal(e,t)}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("name")&&this.updateLegendValue(),this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const s=this.getPrivate("baseValueSeries");s&&this._disposers.push(s.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0,e!=0&&(this._psi=void 0))),this._psi==e&&this._pei==t&&!this.isPrivateDirty("adjustedStartIndex")||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let s=this.get("tooltip");s&&(s.hide(0),s.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let s;const i=this.get("legendDataItem");if(i&&(s=i.get("markerRectangle"),s&&this.isVisible())){if(this.isDirty("stroke")){let r=this.get("stroke");s.set("stroke",r)}if(this.isDirty("fill")){let r=this.get("fill");s.set("fill",r)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let s=this.startIndex(),i=this.endIndex();i{i[a]=0,r[a]=0,o[a]=0}),w(s,a=>{let g=a+"Change",y=a+"ChangePercent",_=a+"ChangePrevious",D=a+"ChangePreviousPercent",b=a+"ChangeSelection",x=a+"ChangeSelectionPercent",c="valueY";a!="valueX"&&a!="openValueX"&&a!="lowValueX"&&a!="highValueX"||(c="valueX");const T=this.getPrivate("baseValueSeries"),V=this.getPrivate("adjustedStartIndex",e);for(let I=V;Ip||h[a]==null)&&(h[a]=p),(d[a]0&&e--,delete u[a];for(let I=e;I{this.setPrivate(a+"AverageSelection",f[a]),this.setPrivate(a+"CountSelection",o[a]),this.setPrivate(a+"SumSelection",i[a]),this.setPrivate(a+"AbsoluteSumSelection",r[a]),this.setPrivate(a+"LowSelection",h[a]),this.setPrivate(a+"HighSelection",d[a]),this.setPrivate(a+"OpenSelection",n[a]),this.setPrivate(a+"CloseSelection",m[a])}),e===0&&t===this.dataItems.length&&w(s,a=>{this.setPrivate(a+"Average",f[a]),this.setPrivate(a+"Count",o[a]),this.setPrivate(a+"Sum",i[a]),this.setPrivate(a+"AbsoluteSum",r[a]),this.setPrivate(a+"Low",h[a]),this.setPrivate(a+"High",d[a]),this.setPrivate(a+"Open",n[a]),this.setPrivate(a+"Close",m[a])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&w(e,t=>{const s=t.minValue||this.getPrivate(t.dataField+"Low")||0,i=t.maxValue||this.getPrivate(t.dataField+"High")||0;w(t.target._entities,r=>{const o=r.dataItem.get(t.dataField);if(!$(o)){t.neutral&&r.set(t.key,t.neutral);const h=r.states;if(h){const d=h.lookup("default");d&&t.neutral&&d.set(t.key,t.neutral)}if(!t.customFunction)return}if(t.customFunction)t.customFunction.call(this,r,s,i,o);else{let h,d;h=t.logarithmic?(Math.log(o)*Math.LOG10E-Math.log(s)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(s)*Math.LOG10E):(o-s)/(i-s),!$(o)||$(h)&&Math.abs(h)!=1/0||(h=.5),$(t.min)?d=t.min+(t.max-t.min)*h:t.min instanceof H?d=H.interpolate(h,t.min,t.max):t.min instanceof J&&(d=ee(h,t.min,t.max)),r.set(t.key,d);const n=r.states;if(n){const m=n.lookup("default");m&&m.set(t.key,d)}}})}),this.get("visible")){let t=this.dataItems.length,s=this.startIndex(),i=this.endIndex();i0&&s--;for(let r=0;r{this._positionBullet(t);const s=t.get("sprite");t.get("dynamic")&&(s&&(s._markDirtyKey("fill"),s.markDirtySize()),s instanceof C&&s.walkChildren(i=>{i._markDirtyKey("fill"),i.markDirtySize(),i instanceof z&&i.text.markDirtyText()})),s instanceof z&&s.get("populateText")&&s.text.markDirtyText()})}_hideBullets(e){e.bullets&&w(e.bullets,t=>{let s=t.get("sprite");s&&s.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&w(t,s=>{s.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return O(this,void 0,void 0,function*(){const i=[s.showDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.show(t))}),yield Promise.all(i)})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return O(this,void 0,void 0,function*(){const i=[s.hideDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.hide(t))}),yield Promise.all(i)})}_sequencedShowHide(e,t){return O(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if($(t)||(t=this.get("interpolationDuration",0)),t>0){const s=this.startIndex(),i=this.endIndex();yield Promise.all(G(this.dataItems,(r,o)=>O(this,void 0,void 0,function*(){let h=t||0;(oi+10)&&(h=0);let d=this.get("sequencedDelay",0)+h/(i-s);yield ie(d*(o-s)),e?yield this.showDataItem(r,h):yield this.hideDataItem(r,h)})))}else yield Promise.all(G(this.dataItems,s=>e?this.showDataItem(s,0):this.hideDataItem(s,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const s=t.get("valueLabel");if(s){const r=s.text;let o="";s._setDataItem(e),o=this.get("legendValueText",r.get("text","")),s.set("text",o),r.markDirtyText()}const i=t.get("label");if(i){const r=i.text;let o="";i._setDataItem(e),o=this.get("legendLabelText",r.get("text","")),i.set("text",o),r.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function q(l,e){for(let t=0,s=e.length;t0){let r=i[0];if(r.length>0){let o=r[0];l.moveTo(o.x,o.y);for(let h=0,d=i.length;h0){let s=e[0];this._display.moveTo(s.x,s.y),q(this._display,[[e]])}else if(t)q(this._display,t);else if(!this.get("draw")){let s=this.width(),i=this.height();this._display.moveTo(0,0),this._display.lineTo(s,i)}}}}function de(l){return function(){return l}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([S.className])});const L=Math.PI,E=2*L,M=1e-6,le=E-M;function Y(l){this._+=l[0];for(let e=1,t=l.length;e=0))throw new Error(`invalid digits: ${l}`);if(e>15)return Y;const t=10**e;return function(s){this._+=s[0];for(let i=1,r=s.length;iM)if(Math.abs(f*d-n*m)>M&&r){let a=s-o,g=i-h,y=d*d+n*n,_=a*a+g*g,D=Math.sqrt(y),b=Math.sqrt(u),x=r*Math.tan((L-Math.acos((y+u-_)/(2*D*b)))/2),c=x/b,T=x/D;Math.abs(c-1)>M&&this._append`L${e+c*m},${t+c*f}`,this._append`A${r},${r},0,0,${+(f*a>m*g)},${this._x1=e+T*d},${this._y1=t+T*n}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,s,i,r,o){if(e=+e,t=+t,o=!!o,(s=+s)<0)throw new Error(`negative radius: ${s}`);let h=s*Math.cos(i),d=s*Math.sin(i),n=e+h,m=t+d,f=1^o,u=o?i-r:r-i;this._x1===null?this._append`M${n},${m}`:(Math.abs(this._x1-n)>M||Math.abs(this._y1-m)>M)&&this._append`L${n},${m}`,s&&(u<0&&(u=u%E+E),u>le?this._append`A${s},${s},0,1,${f},${e-h},${t-d}A${s},${s},0,1,${f},${this._x1=n},${this._y1=m}`:u>M&&this._append`A${s},${s},0,${+(u>=L)},${f},${this._x1=e+s*Math.cos(r)},${this._y1=t+s*Math.sin(r)}`)}rect(e,t,s,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${s=+s}v${+i}h${-s}Z`}toString(){return this._}}function ce(l){let e=3;return l.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const s=Math.floor(t);if(!(s>=0))throw new RangeError(`invalid digits: ${t}`);e=s}return l},()=>new oe(e)}class F extends C{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(C.new(this._root,{width:k,height:k,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:k,height:k})})}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([F.className])});class N extends F{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new te})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){w(t.oldValues,r=>{this._removeSeries(r)});const s=this.get("colors");s&&s.reset();const i=this.get("patterns");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(N,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(N,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([N.className])});class A extends S{}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([A.className])});export{A,N as B,U as N,R,B as U,j,de as n,ce as u}; diff --git a/main/assets/Tile-D75RMC64-CM0vKD9b.js b/main/assets/Tile-D75RMC64-CM0vKD9b.js new file mode 100644 index 000000000..474165745 --- /dev/null +++ b/main/assets/Tile-D75RMC64-CM0vKD9b.js @@ -0,0 +1 @@ +import{n as rt}from"./common-CYWrYyJl-E8-sukrT.js";import{ec as lt,v as b,S as F,i as at,aG as H,j as ht,aA as ct,an as ut,ed as ft,bh as W,n as mt,ba as dt,ee as pt}from"./main-C7yV2j71.js";import{s as L}from"./TileKey-C5IL-JBr-COMthbrT.js";import{f as gt,M as $}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{k as _t}from"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import{b as yt}from"./quickselect-DHTstthl-Ds_Aj0x5.js";import{a as xt}from"./Query-BrwMGK8U-DV_czrJX.js";function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Mt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function wt(t,e,i,s,o,n,r){return t[0]=e,t[1]=i,t[2]=s,t[3]=o,t[4]=n,t[5]=r,t}function It(t,e){const i=e[0],s=e[1],o=e[2],n=e[3],r=e[4],l=e[5];let a=i*n-s*o;return a?(a=1/a,t[0]=n*a,t[1]=-s*a,t[2]=-o*a,t[3]=i*a,t[4]=(o*l-n*r)*a,t[5]=(s*r-i*l)*a,t):null}function St(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1],f=i[2],m=i[3],_=i[4],d=i[5];return t[0]=s*h+n*c,t[1]=o*h+r*c,t[2]=s*f+n*m,t[3]=o*f+r*m,t[4]=s*_+n*d+l,t[5]=o*_+r*d+a,t}function Bt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=Math.sin(i),c=Math.cos(i);return t[0]=s*c+n*h,t[1]=o*c+r*h,t[2]=s*-h+n*c,t[3]=o*-h+r*c,t[4]=l,t[5]=a,t}function bt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1];return t[0]=s*h,t[1]=o*h,t[2]=n*c,t[3]=r*c,t[4]=l,t[5]=a,t}function Tt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1];return t[0]=s,t[1]=o,t[2]=n,t[3]=r,t[4]=s*h+n*c+l,t[5]=o*h+r*c+a,t}function Ct(t,e){const i=Math.sin(e),s=Math.cos(e);return t[0]=s,t[1]=i,t[2]=-i,t[3]=s,t[4]=0,t[5]=0,t}function Ft(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function zt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function Yt(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Xt(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)}function Pt(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t}function et(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t}function kt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t}function Rt(t,e,i,s){return t[0]=e[0]+i[0]*s,t[1]=e[1]+i[1]*s,t[2]=e[2]+i[2]*s,t[3]=e[3]+i[3]*s,t[4]=e[4]+i[4]*s,t[5]=e[5]+i[5]*s,t}function Lt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function At(t,e){const i=t[0],s=t[1],o=t[2],n=t[3],r=t[4],l=t[5],a=e[0],h=e[1],c=e[2],f=e[3],m=e[4],_=e[5],d=rt();return Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-c)<=d*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-m)<=d*Math.max(1,Math.abs(r),Math.abs(m))&&Math.abs(l-_)<=d*Math.max(1,Math.abs(l),Math.abs(_))}const Ot=tt,Vt=et;Object.freeze(Object.defineProperty({__proto__:null,add:Pt,copy:vt,determinant:St,equals:At,exactEquals:Lt,frob:Xt,fromRotation:Ct,fromScaling:Ft,fromTranslation:zt,identity:Mt,invert:It,mul:Ot,multiply:tt,multiplyScalar:kt,multiplyScalarAndAdd:Rt,rotate:Bt,scale:bt,set:wt,str:Yt,sub:Vt,subtract:et,translate:Tt},Symbol.toStringTag,{value:"Module"}));function qt(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function Et(t){const e=new Float32Array(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function jt(t,e,i,s,o,n){const r=new Float32Array(6);return r[0]=t,r[1]=e,r[2]=i,r[3]=s,r[4]=o,r[5]=n,r}function Nt(t,e){return new Float32Array(t,e,6)}function it(t,e,i,s){const o=e[s],n=e[s+1];t[s]=i[0]*o+i[2]*n+i[4],t[s+1]=i[1]*o+i[3]*n+i[5]}function Kt(t,e,i,s=0,o=0,n=2){const r=o||e.length/n;for(let l=s;l=i&&(e.col=s-i,e.world+=1)}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const i=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,o=this._spatialReferenceValid;return this.wrap&&s&&o?i===s[0]?o[0]:this.origin[0]===s[0]&&e===this.worldSize[0]?o[1]:i:i}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world),n=v.row;return Wt(e,this.getXForColumn(o),this.getYForRow(n+1),this.getXForColumn(o+1),this.getYForRow(n)),e}getTileCoords(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world);return Array.isArray(e)?T(e,this.getXForColumn(o),this.getYForRow(v.row)):(e.x=this.getXForColumn(o),e.y=this.getYForRow(v.row)),e}},q=class{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:e,colFrom:i,colTo:s}of this.spans)for(let o=i;o<=s;o++){const n=t.getWorldForColumn(o);yield new L(t.level,e,t.normalizeCol(o),n)}}forEach(t,e){const{spans:i,lodInfo:s}=this,{level:o}=s;if(i.length!==0)for(const{row:n,colFrom:r,colTo:l}of i)for(let a=r;a<=l;a++)t.call(e,o,n,s.normalizeCol(a),s.getWorldForColumn(a))}};q.pool=new lt(q);let E=class{constructor(t,e,i){this.row=t,this.colFrom=e,this.colTo=i}};const g=new L("0/0/0/0");let $t=class ot{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[s,o]=e,[n,r]=i,l=n-s,a=r-o,h=a!==0?l/a:0,c=(Math.ceil(o)-o)*h,f=(Math.floor(o)-o)*h;return new ot(s,Math.floor(o),Math.ceil(r),h,l<0?c:f,l<0?f:c,l<0?n:s,l<0?s:n)}constructor(e,i,s,o,n,r,l,a){this.x=e,this.ymin=i,this.ymax=s,this.invM=o,this.leftAdjust=n,this.rightAdjust=r,this.leftBound=l,this.rightBound=a}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const x=[[0,0],[0,0],[0,0],[0,0]],Jt=1e-6;let re=class{constructor(t,e=null,i=t.lods[0].level,s=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=e,this.scales=[],this._infoByScale={},this._infoByLevel={};const o=t.lods.filter(r=>r.level>=i&&r.level<=s);this.minScale=o[0].scale,this.maxScale=o[o.length-1].scale;const n=this._lodInfos=o.map(r=>Dt.create(t,r,e));o.forEach((r,l)=>{this._infoByLevel[r.level]=n[l],this._infoByScale[r.scale]=n[l],this.scales[l]=r.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileBounds(t,g,i):t}getTileCoords(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileCoords(t,g,i):t}getTileCoverage(t,e=192,i=!0,s="closest"){if(!i&&(t.scale>this.minScale||t.scale100)return null;let y=[];for(l=c;l=0;u--){const p=y[u];a=Math.min(a,p.getLeftCol()),h=Math.max(h,p.getRightCol())}if(a=Math.floor(a),h=Math.floor(h),l>=o.first[1]&&l<=o.last[1])if(r)if(o.size[0]o.last[0]||h=0;u--){const p=y[u];p.ymax>=l?p.incrRow():y.splice(u,1)}}return n}getTileParentId(t){g.set(t);const e=this._infoByLevel[g.level],i=this._lodInfos.indexOf(e)-1;return i<0?null:(this._getTileIdAtLOD(g,this._lodInfos[i],g),g.id)}getTileResolution(t){const e=this._infoByLevel[typeof t=="object"?t.level:t];return e?e.resolution:-1}getTileScale(t){const e=this._infoByLevel[t.level];return e?e.scale:-1}intersects(t,e){g.set(e);const i=this._infoByLevel[g.level],s=t.lodInfo;if(s.resolution>i.resolution){this._getTileIdAtLOD(g,s,g);const n=s.denormalizeCol(g.col,g.world);for(const r of t.spans)if(r.row===g.row&&r.colFrom<=n&&r.colTo>=n)return!0}if(s.resolution(d[0]=Math.min(d[0],y.row),d[1]=Math.max(d[1],y.row),d[2]=Math.min(d[2],y.colFrom),d[3]=Math.max(d[3],y.colTo),d),[1/0,-1/0,1/0,-1/0]),h=i.denormalizeCol(g.col,g.world),c=s.getColumnForX(i.getXForColumn(h)),f=s.getRowForY(i.getYForRow(g.row)),m=s.getColumnForX(i.getXForColumn(h+1))-1,_=s.getRowForY(i.getYForRow(g.row+1))-1;return!(c>a||mr||_n.row===g.row&&n.colFrom<=o&&n.colTo>=o)}normalizeBounds(t,e,i){if(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._wrap){const s=H(this.tileInfo.spatialReference),o=-i*(s.valid[1]-s.valid[0]);t[0]+=o,t[2]+=o}return t}getSmallestInfoForScale(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>e[0])return this._infoByScale[e[0]];for(let i=1;ie[i]+Jt)return this._infoByScale[e[i-1]];return this._infoByScale[e[e.length-1]]}getClosestInfoForScale(t){const e=this.scales;return this._infoByScale[t]||(t=e.reduce((i,s)=>Math.abs(s-t)=0;i--)if(t{const r=this._keyToItem.get(o);return e(r,{signal:n})},peeker:o=>this._peek(o)})}destroy(){this.clear(),this._queue=ct(this._queue)}get length(){return this._queue?this._queue.length:0}abort(t){const e=typeof t=="string"?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const i=this._queue.push(e),s=this.tileInfoView.getTileScale(t.key),o=ut(this._tilesByScale,s,()=>new Set),n=()=>{o.delete(t.key),o.size===0&&this._tilesByScale.delete(s),this._keyToItem.delete(e)};return o.add(t.key),this._keyToItem.set(e,t),i.then(n,n),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(t){if(!this.state)return t.values().next().value;const e=new Set;for(const n of t)e.add(this._keyToItem.get(n).key);const i=this.state.scale;let s,o=Number.POSITIVE_INFINITY;for(const[n,r]of this._tilesByScale)if(ft(r,l=>e.has(l))){const l=Math.abs(n-i);lthis.maxSize&&n>=0;)n!==e&&(o=this._pruneAroundCenterTile(o,i,s,n)),n--;o>this.maxSize&&(o=this._pruneAroundCenterTile(o,i,s,e))}_pruneAroundCenterTile(e,i,s,o){const n=this._tileKeysPerLevel[o];if(!n||n.length===0)return e;const{size:r,origin:l}=this._tileInfoView.tileInfo,a=s*r[0],h=s*r[1],c=[0,0],f=[0,0];for(n.sort((m,_)=>(c[0]=l.x+a*(m.col+.5),c[1]=l.y-h*(m.row+.5),f[0]=l.x+a*(_.col+.5),f[1]=l.y-h*(_.row+.5),$(c,i)-$(f,i)));n.length>0;){const m=n.pop();if(this._removeTile(m.id),--e===this.maxSize)break}return e}_removeTile(e){const i=this._tilePerId.get(e);this._removedFunc&&i&&this._removedFunc(i),Z(this._tilePerId,e)}}function Z(t,e){t.delete(e)}const C=new L(0,0,0,0),I=new Map,P=[],j=[];let ae=class{constructor(t){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,t.resampling!=null&&(this.resampling=t.resampling),t.cachePolicy&&(this.cachePolicy=t.cachePolicy),t.coveragePolicy&&(this.coveragePolicy=t.coveragePolicy),t.buffer!=null&&(this.buffer=t.buffer),t.cacheSize&&(this._tileCache=new Zt(t.cacheSize,this.tileInfoView,e=>{this.releaseTile(e)}))}destroy(){this.tileIndex.clear()}update(t){const{resampling:e,tileIndex:i}=this,{scale:s,center:o,resolution:n}=t.state,{minScale:r,maxScale:l}=this.tileInfoView,a=!t.stationary&&s>this._previousScale;if(this._previousScale=s,!e&&(s>r||su.visible=!0);let _=0,d=0;if(c.length>0)for(const{row:u,colFrom:p,colTo:A}of c)for(let B=p;B<=A;B++){_++;const M=C.set(m,u,f.normalizeCol(B),f.getWorldForColumn(B)).id;let w=i.get(M);if(w)w.isReady?(I.set(M,w),d++):a||this._addParentTile(M,I);else{if(this._tileCache?.has(M)){if(w=this._tileCache.pop(M),this.tileIndex.set(M,w),w.isReady){I.set(M,w),d++;continue}}else w=this.acquireTile(C),this.tileIndex.set(M,w);a||this._addParentTile(M,I)}}const y=d===_;for(const[u,p]of i){if(I.has(u))continue;C.set(u);const A=this.tileInfoView.intersects(h,C),B=this.cachePolicy==="purge"?C.level!==m:C.level>m;!A||!a&&y?!B&&A||P.push(p):p.isReady?B&&this.cachePolicy==="purge"&&this._hasReadyAncestor(C,m)?P.push(p):j.push(p):B&&P.push(p)}for(const u of j)u.isReady&&I.set(u.key.id,u);for(const u of P)this._tileCache?this._tileCache.add(u):this.releaseTile(u),i.delete(u.key.id);for(const u of I.values())this.tiles.push(u);for(const u of i.values())I.has(u.key.id)||(u.visible=!1);this._tileCache?.prune(m,o,n),q.pool.release(h),j.length=0,P.length=0,I.clear()}clear(){const{tileIndex:t}=this;for(const e of t.values())this.releaseTile(e);t.clear()}refresh(t){for(const e of this.tileIndex.values())t(e);this._tileCache?.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,e){let i=t,s=null;for(;i=this.tileInfoView.getTileParentId(i),i;)if(this.tileIndex.has(i)){if(s=this.tileIndex.get(i),s?.isReady){e.has(s.key.id)||e.set(s.key.id,s);break}}else if(this._tileCache?.has(i)&&(s=this._tileCache.pop(i),this.tileIndex.set(i,s),s?.isReady)){e.has(s.key.id)||e.set(s.key.id,s);break}}_hasReadyAncestor(t,e){const i=W();this.tileInfoView.getTileBounds(i,t,!0);for(const s of this.tileIndex.values())if(s.isReady&&s.key.level>=e&&s.key.level=t.minX&&e.maxY>=t.minY}function X(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function U(t,e,i,s,o){for(var n,r=[e,i];r.length;)(i=r.pop())-(e=r.pop())<=s||(n=e+Math.ceil((i-e)/s/2)*s,yt(t,n,e,i,o),r.push(e,n,n,i))}D.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!V(t,e))return i;for(var o,n,r,l,a=[];e;){for(o=0,n=e.children.length;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,s);var n=this._chooseSplitIndex(i,o,s),r=X(i.children.splice(n,i.children.length-n));r.height=i.height,r.leaf=i.leaf,Y(i,this.toBBox),Y(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(i,r)},_splitRoot:function(t,e){this.data=X([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Y(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,o,n,r,l,a,h,c;for(a=h=1/0,s=e;s<=i-e;s++)r=Ut(o=k(t,0,s,this.toBBox),n=k(t,s,i,this.toBBox)),l=N(o)+N(n),r=e;o--)n=t.children[o],R(a,t.leaf?r(n):n),h+=O(a);return h},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)R(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)t[i].children.length===0?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Y(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};class nt{constructor(e,i){this.key=new L(0,0,0,0),this.bounds=W(),this.objectIds=new Set,this.key.set(i);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return mt.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const e=this.key.getChildKeys(),i=dt.acquire();for(let s=0;s=i&&(e.col=s-i,e.world+=1)}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const i=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,o=this._spatialReferenceValid;return this.wrap&&s&&o?i===s[0]?o[0]:this.origin[0]===s[0]&&e===this.worldSize[0]?o[1]:i:i}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world),n=v.row;return Wt(e,this.getXForColumn(o),this.getYForRow(n+1),this.getXForColumn(o+1),this.getYForRow(n)),e}getTileCoords(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world);return Array.isArray(e)?T(e,this.getXForColumn(o),this.getYForRow(v.row)):(e.x=this.getXForColumn(o),e.y=this.getYForRow(v.row)),e}},q=class{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:e,colFrom:i,colTo:s}of this.spans)for(let o=i;o<=s;o++){const n=t.getWorldForColumn(o);yield new L(t.level,e,t.normalizeCol(o),n)}}forEach(t,e){const{spans:i,lodInfo:s}=this,{level:o}=s;if(i.length!==0)for(const{row:n,colFrom:r,colTo:l}of i)for(let a=r;a<=l;a++)t.call(e,o,n,s.normalizeCol(a),s.getWorldForColumn(a))}};q.pool=new lt(q);let E=class{constructor(t,e,i){this.row=t,this.colFrom=e,this.colTo=i}};const g=new L("0/0/0/0");let $t=class ot{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[s,o]=e,[n,r]=i,l=n-s,a=r-o,h=a!==0?l/a:0,c=(Math.ceil(o)-o)*h,f=(Math.floor(o)-o)*h;return new ot(s,Math.floor(o),Math.ceil(r),h,l<0?c:f,l<0?f:c,l<0?n:s,l<0?s:n)}constructor(e,i,s,o,n,r,l,a){this.x=e,this.ymin=i,this.ymax=s,this.invM=o,this.leftAdjust=n,this.rightAdjust=r,this.leftBound=l,this.rightBound=a}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const x=[[0,0],[0,0],[0,0],[0,0]],Jt=1e-6;let re=class{constructor(t,e=null,i=t.lods[0].level,s=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=e,this.scales=[],this._infoByScale={},this._infoByLevel={};const o=t.lods.filter(r=>r.level>=i&&r.level<=s);this.minScale=o[0].scale,this.maxScale=o[o.length-1].scale;const n=this._lodInfos=o.map(r=>Dt.create(t,r,e));o.forEach((r,l)=>{this._infoByLevel[r.level]=n[l],this._infoByScale[r.scale]=n[l],this.scales[l]=r.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileBounds(t,g,i):t}getTileCoords(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileCoords(t,g,i):t}getTileCoverage(t,e=192,i=!0,s="closest"){if(!i&&(t.scale>this.minScale||t.scale100)return null;let y=[];for(l=c;l=0;u--){const p=y[u];a=Math.min(a,p.getLeftCol()),h=Math.max(h,p.getRightCol())}if(a=Math.floor(a),h=Math.floor(h),l>=o.first[1]&&l<=o.last[1])if(r)if(o.size[0]o.last[0]||h=0;u--){const p=y[u];p.ymax>=l?p.incrRow():y.splice(u,1)}}return n}getTileParentId(t){g.set(t);const e=this._infoByLevel[g.level],i=this._lodInfos.indexOf(e)-1;return i<0?null:(this._getTileIdAtLOD(g,this._lodInfos[i],g),g.id)}getTileResolution(t){const e=this._infoByLevel[typeof t=="object"?t.level:t];return e?e.resolution:-1}getTileScale(t){const e=this._infoByLevel[t.level];return e?e.scale:-1}intersects(t,e){g.set(e);const i=this._infoByLevel[g.level],s=t.lodInfo;if(s.resolution>i.resolution){this._getTileIdAtLOD(g,s,g);const n=s.denormalizeCol(g.col,g.world);for(const r of t.spans)if(r.row===g.row&&r.colFrom<=n&&r.colTo>=n)return!0}if(s.resolution(d[0]=Math.min(d[0],y.row),d[1]=Math.max(d[1],y.row),d[2]=Math.min(d[2],y.colFrom),d[3]=Math.max(d[3],y.colTo),d),[1/0,-1/0,1/0,-1/0]),h=i.denormalizeCol(g.col,g.world),c=s.getColumnForX(i.getXForColumn(h)),f=s.getRowForY(i.getYForRow(g.row)),m=s.getColumnForX(i.getXForColumn(h+1))-1,_=s.getRowForY(i.getYForRow(g.row+1))-1;return!(c>a||mr||_n.row===g.row&&n.colFrom<=o&&n.colTo>=o)}normalizeBounds(t,e,i){if(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._wrap){const s=H(this.tileInfo.spatialReference),o=-i*(s.valid[1]-s.valid[0]);t[0]+=o,t[2]+=o}return t}getSmallestInfoForScale(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>e[0])return this._infoByScale[e[0]];for(let i=1;ie[i]+Jt)return this._infoByScale[e[i-1]];return this._infoByScale[e[e.length-1]]}getClosestInfoForScale(t){const e=this.scales;return this._infoByScale[t]||(t=e.reduce((i,s)=>Math.abs(s-t)=0;i--)if(t{const r=this._keyToItem.get(o);return e(r,{signal:n})},peeker:o=>this._peek(o)})}destroy(){this.clear(),this._queue=ct(this._queue)}get length(){return this._queue?this._queue.length:0}abort(t){const e=typeof t=="string"?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const i=this._queue.push(e),s=this.tileInfoView.getTileScale(t.key),o=ut(this._tilesByScale,s,()=>new Set),n=()=>{o.delete(t.key),o.size===0&&this._tilesByScale.delete(s),this._keyToItem.delete(e)};return o.add(t.key),this._keyToItem.set(e,t),i.then(n,n),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(t){if(!this.state)return t.values().next().value;const e=new Set;for(const n of t)e.add(this._keyToItem.get(n).key);const i=this.state.scale;let s,o=Number.POSITIVE_INFINITY;for(const[n,r]of this._tilesByScale)if(ft(r,l=>e.has(l))){const l=Math.abs(n-i);lthis.maxSize&&n>=0;)n!==e&&(o=this._pruneAroundCenterTile(o,i,s,n)),n--;o>this.maxSize&&(o=this._pruneAroundCenterTile(o,i,s,e))}_pruneAroundCenterTile(e,i,s,o){const n=this._tileKeysPerLevel[o];if(!n||n.length===0)return e;const{size:r,origin:l}=this._tileInfoView.tileInfo,a=s*r[0],h=s*r[1],c=[0,0],f=[0,0];for(n.sort((m,_)=>(c[0]=l.x+a*(m.col+.5),c[1]=l.y-h*(m.row+.5),f[0]=l.x+a*(_.col+.5),f[1]=l.y-h*(_.row+.5),$(c,i)-$(f,i)));n.length>0;){const m=n.pop();if(this._removeTile(m.id),--e===this.maxSize)break}return e}_removeTile(e){const i=this._tilePerId.get(e);this._removedFunc&&i&&this._removedFunc(i),Z(this._tilePerId,e)}}function Z(t,e){t.delete(e)}const C=new L(0,0,0,0),I=new Map,P=[],j=[];let ae=class{constructor(t){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,t.resampling!=null&&(this.resampling=t.resampling),t.cachePolicy&&(this.cachePolicy=t.cachePolicy),t.coveragePolicy&&(this.coveragePolicy=t.coveragePolicy),t.buffer!=null&&(this.buffer=t.buffer),t.cacheSize&&(this._tileCache=new Zt(t.cacheSize,this.tileInfoView,e=>{this.releaseTile(e)}))}destroy(){this.tileIndex.clear()}update(t){const{resampling:e,tileIndex:i}=this,{scale:s,center:o,resolution:n}=t.state,{minScale:r,maxScale:l}=this.tileInfoView,a=!t.stationary&&s>this._previousScale;if(this._previousScale=s,!e&&(s>r||su.visible=!0);let _=0,d=0;if(c.length>0)for(const{row:u,colFrom:p,colTo:A}of c)for(let B=p;B<=A;B++){_++;const M=C.set(m,u,f.normalizeCol(B),f.getWorldForColumn(B)).id;let w=i.get(M);if(w)w.isReady?(I.set(M,w),d++):a||this._addParentTile(M,I);else{if(this._tileCache?.has(M)){if(w=this._tileCache.pop(M),this.tileIndex.set(M,w),w.isReady){I.set(M,w),d++;continue}}else w=this.acquireTile(C),this.tileIndex.set(M,w);a||this._addParentTile(M,I)}}const y=d===_;for(const[u,p]of i){if(I.has(u))continue;C.set(u);const A=this.tileInfoView.intersects(h,C),B=this.cachePolicy==="purge"?C.level!==m:C.level>m;!A||!a&&y?!B&&A||P.push(p):p.isReady?B&&this.cachePolicy==="purge"&&this._hasReadyAncestor(C,m)?P.push(p):j.push(p):B&&P.push(p)}for(const u of j)u.isReady&&I.set(u.key.id,u);for(const u of P)this._tileCache?this._tileCache.add(u):this.releaseTile(u),i.delete(u.key.id);for(const u of I.values())this.tiles.push(u);for(const u of i.values())I.has(u.key.id)||(u.visible=!1);this._tileCache?.prune(m,o,n),q.pool.release(h),j.length=0,P.length=0,I.clear()}clear(){const{tileIndex:t}=this;for(const e of t.values())this.releaseTile(e);t.clear()}refresh(t){for(const e of this.tileIndex.values())t(e);this._tileCache?.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,e){let i=t,s=null;for(;i=this.tileInfoView.getTileParentId(i),i;)if(this.tileIndex.has(i)){if(s=this.tileIndex.get(i),s?.isReady){e.has(s.key.id)||e.set(s.key.id,s);break}}else if(this._tileCache?.has(i)&&(s=this._tileCache.pop(i),this.tileIndex.set(i,s),s?.isReady)){e.has(s.key.id)||e.set(s.key.id,s);break}}_hasReadyAncestor(t,e){const i=W();this.tileInfoView.getTileBounds(i,t,!0);for(const s of this.tileIndex.values())if(s.isReady&&s.key.level>=e&&s.key.level=t.minX&&e.maxY>=t.minY}function X(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function U(t,e,i,s,o){for(var n,r=[e,i];r.length;)(i=r.pop())-(e=r.pop())<=s||(n=e+Math.ceil((i-e)/s/2)*s,yt(t,n,e,i,o),r.push(e,n,n,i))}D.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!V(t,e))return i;for(var o,n,r,l,a=[];e;){for(o=0,n=e.children.length;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,s);var n=this._chooseSplitIndex(i,o,s),r=X(i.children.splice(n,i.children.length-n));r.height=i.height,r.leaf=i.leaf,Y(i,this.toBBox),Y(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(i,r)},_splitRoot:function(t,e){this.data=X([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Y(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,o,n,r,l,a,h,c;for(a=h=1/0,s=e;s<=i-e;s++)r=Ut(o=k(t,0,s,this.toBBox),n=k(t,s,i,this.toBBox)),l=N(o)+N(n),r=e;o--)n=t.children[o],R(a,t.leaf?r(n):n),h+=O(a);return h},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)R(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)t[i].children.length===0?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Y(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};class nt{constructor(e,i){this.key=new L(0,0,0,0),this.bounds=W(),this.objectIds=new Set,this.key.set(i);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return mt.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const e=this.key.getChildKeys(),i=dt.acquire();for(let s=0;st.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;class p extends l{constructor(e){super(),this.tileInfoView=e,this.sortFunction=c}renderChildren(e){this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,s=super.createRenderParams(e);return s.requiredLevel=this.tileInfoView.getClosestInfoForScale(r.scale).level,s.displayLevel=this.tileInfoView.tileInfo.scaleToZoom(r.scale),s}prepareRenderPasses(e){const r=super.prepareRenderPasses(e);return r.push(e.registerRenderPass({name:"stencil",brushes:[a],drawPhase:n.DEBUG|n.MAP|n.HIGHLIGHT|n.LABEL,target:()=>this.getStencilTarget()})),i("esri-tiles-debug")&&r.push(e.registerRenderPass({name:"tileInfo",brushes:[o],drawPhase:n.DEBUG,target:()=>this.children})),r}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const s of this.children)s.stencilRef=r++}}export{p as h}; diff --git a/main/assets/TileContainer-D48pXXgL-DSah9A2g.js b/main/assets/TileContainer-D48pXXgL-DSah9A2g.js new file mode 100644 index 000000000..47b285716 --- /dev/null +++ b/main/assets/TileContainer-D48pXXgL-DSah9A2g.js @@ -0,0 +1 @@ +import{K as i}from"./main-C7yV2j71.js";import{E as n}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{N as l,Z as a,r as o}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";const c=(t,e)=>t.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;class p extends l{constructor(e){super(),this.tileInfoView=e,this.sortFunction=c}renderChildren(e){this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,s=super.createRenderParams(e);return s.requiredLevel=this.tileInfoView.getClosestInfoForScale(r.scale).level,s.displayLevel=this.tileInfoView.tileInfo.scaleToZoom(r.scale),s}prepareRenderPasses(e){const r=super.prepareRenderPasses(e);return r.push(e.registerRenderPass({name:"stencil",brushes:[a],drawPhase:n.DEBUG|n.MAP|n.HIGHLIGHT|n.LABEL,target:()=>this.getStencilTarget()})),i("esri-tiles-debug")&&r.push(e.registerRenderPass({name:"tileInfo",brushes:[o],drawPhase:n.DEBUG,target:()=>this.children})),r}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const s of this.children)s.stencilRef=r++}}export{p as h}; diff --git a/main/assets/TileInfo-CWIRDhZl-BN68IeQv.js b/main/assets/TileInfo-CWIRDhZl-BN68IeQv.js deleted file mode 100644 index cafe8116b..000000000 --- a/main/assets/TileInfo-CWIRDhZl-BN68IeQv.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as a,aK as S,a0 as R,ac as G,e as N,bB as O,i as L,J as T,aY as I,w as y,aG as _,p as P,dB as W,aC as F,b8 as A,bh as j}from"./main-BZaw9FpY.js";import{e as D}from"./TileKey-B_6qmYK--BtZdR-Xy.js";var b;let f=b=class extends N{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new b({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"cols",void 0),r([a({type:O,json:{write:!0}})],f.prototype,"level",void 0),r([a({type:String,json:{write:!0}})],f.prototype,"levelValue",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"origin",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"resolution",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"rows",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"scale",void 0),f=b=r([L("esri.layers.support.LOD")],f);const v=f;var d;const E=new S({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let n=d=class extends N{static create(e={}){const{resolutionFactor:t=1,scales:s,size:i=256,spatialReference:o=T.WebMercator,numLODs:l=24}=e;if(!I(o)){const c=[];if(s)for(let u=0;u=0;h--)c.unshift(new v({level:h,scale:u,resolution:u})),u*=2}return new d({dpi:96,lods:c,origin:new y(0,0,o),size:[i,i],spatialReference:o})}const p=_(o),g=e.origin?new y({x:e.origin.x,y:e.origin.y,spatialReference:o}):new y(p?{x:p.origin[0],y:p.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),m=96,w=1/(P(o)*39.37*m),x=[];if(s)for(let c=0;c{i.push(l.scale),t=l.scale>t?l.scale:t,s=l.scale=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;ie&&l=0?this.lods[l]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new v({level:o,scale:p,resolution:g}))}return new d({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;sArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],n.prototype,"size",void 0),r([R("size",["rows","cols"])],n.prototype,"readSize",null),r([G("size",{cols:{type:O},rows:{type:O}})],n.prototype,"writeSize",null),r([a({type:T,json:{write:!0}})],n.prototype,"spatialReference",void 0),n=d=r([L("esri.layers.support.TileInfo")],n),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(n||(n={}));const J=n;export{J as V,v as d}; diff --git a/main/assets/TileInfo-CWIRDhZl-CwJ-BCrJ.js b/main/assets/TileInfo-CWIRDhZl-CwJ-BCrJ.js new file mode 100644 index 000000000..5cf1fc658 --- /dev/null +++ b/main/assets/TileInfo-CWIRDhZl-CwJ-BCrJ.js @@ -0,0 +1 @@ +import{v as r,S as a,aK as S,a0 as R,ac as G,e as N,bB as O,i as L,J as T,aY as I,w as y,aG as _,p as P,dB as W,aC as F,b8 as A,bh as j}from"./main-C7yV2j71.js";import{e as D}from"./TileKey-B_6qmYK--BtZdR-Xy.js";var b;let f=b=class extends N{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new b({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"cols",void 0),r([a({type:O,json:{write:!0}})],f.prototype,"level",void 0),r([a({type:String,json:{write:!0}})],f.prototype,"levelValue",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"origin",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"resolution",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"rows",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"scale",void 0),f=b=r([L("esri.layers.support.LOD")],f);const v=f;var d;const E=new S({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let n=d=class extends N{static create(e={}){const{resolutionFactor:t=1,scales:s,size:i=256,spatialReference:o=T.WebMercator,numLODs:l=24}=e;if(!I(o)){const c=[];if(s)for(let u=0;u=0;h--)c.unshift(new v({level:h,scale:u,resolution:u})),u*=2}return new d({dpi:96,lods:c,origin:new y(0,0,o),size:[i,i],spatialReference:o})}const p=_(o),g=e.origin?new y({x:e.origin.x,y:e.origin.y,spatialReference:o}):new y(p?{x:p.origin[0],y:p.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),m=96,w=1/(P(o)*39.37*m),x=[];if(s)for(let c=0;c{i.push(l.scale),t=l.scale>t?l.scale:t,s=l.scale=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;ie&&l=0?this.lods[l]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new v({level:o,scale:p,resolution:g}))}return new d({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;sArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],n.prototype,"size",void 0),r([R("size",["rows","cols"])],n.prototype,"readSize",null),r([G("size",{cols:{type:O},rows:{type:O}})],n.prototype,"writeSize",null),r([a({type:T,json:{write:!0}})],n.prototype,"spatialReference",void 0),n=d=r([L("esri.layers.support.TileInfo")],n),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(n||(n={}));const J=n;export{J as V,v as d}; diff --git a/main/assets/TileInfoTilemapCache-D1SExPij-6JuHkhwl.js b/main/assets/TileInfoTilemapCache-D1SExPij-6JuHkhwl.js new file mode 100644 index 000000000..55e731027 --- /dev/null +++ b/main/assets/TileInfoTilemapCache-D1SExPij-6JuHkhwl.js @@ -0,0 +1 @@ +import{dC as n,o as h,aU as r}from"./main-C7yV2j71.js";class f{constructor(i,e=0,t=i.lods[i.lods.length-1].level){this.tileInfo=i,this.minLOD=e,this.maxLOD=t,i.lodAt(e)||(this.minLOD=i.lods[0].level),i.lodAt(t)||(this.maxLOD=i.lods[i.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(i,e,t){const l=this.tileInfo?.lodAt(i);return!l||ithis.maxLOD?"unavailable":l.cols&&l.rows?t>=l.cols[0]&&t<=l.cols[1]&&e>=l.rows[0]&&e<=l.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,t,l){await n(l);const a=this.getAvailability(i,e,t);if(a==="unavailable")throw new h("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t});return a}async fetchAvailabilityUpsample(i,e,t,l,a){await n(a),l.level=i,l.row=e,l.col=t;const s=this.tileInfo;return s.updateTileInfo(l),this.fetchAvailability(i,e,t,a).catch(o=>{if(r(o))throw o;if(s.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l,a);throw o})}}export{f as c}; diff --git a/main/assets/TileInfoTilemapCache-D1SExPij-UDulH8vT.js b/main/assets/TileInfoTilemapCache-D1SExPij-UDulH8vT.js deleted file mode 100644 index a219d9f34..000000000 --- a/main/assets/TileInfoTilemapCache-D1SExPij-UDulH8vT.js +++ /dev/null @@ -1 +0,0 @@ -import{dC as n,o as h,aU as r}from"./main-BZaw9FpY.js";class f{constructor(i,e=0,t=i.lods[i.lods.length-1].level){this.tileInfo=i,this.minLOD=e,this.maxLOD=t,i.lodAt(e)||(this.minLOD=i.lods[0].level),i.lodAt(t)||(this.maxLOD=i.lods[i.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(i,e,t){const l=this.tileInfo?.lodAt(i);return!l||ithis.maxLOD?"unavailable":l.cols&&l.rows?t>=l.cols[0]&&t<=l.cols[1]&&e>=l.rows[0]&&e<=l.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,t,l){await n(l);const a=this.getAvailability(i,e,t);if(a==="unavailable")throw new h("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t});return a}async fetchAvailabilityUpsample(i,e,t,l,a){await n(a),l.level=i,l.row=e,l.col=t;const s=this.tileInfo;return s.updateTileInfo(l),this.fetchAvailability(i,e,t,a).catch(o=>{if(r(o))throw o;if(s.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l,a);throw o})}}export{f as c}; diff --git a/main/assets/TileKey-C5IL-JBr-0HJjsV9n.js b/main/assets/TileKey-C5IL-JBr-0HJjsV9n.js deleted file mode 100644 index da665fbab..000000000 --- a/main/assets/TileKey-C5IL-JBr-0HJjsV9n.js +++ /dev/null @@ -1 +0,0 @@ -import{ec as c}from"./main-BZaw9FpY.js";let r=class s{static getId(e,l,t,o){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${l}/${t}/${o}`}constructor(e,l,t,o){this.set(e,l,t,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,l=4095&this.col,t=63&this.level;return(3&this.world)<<30|l<<22|e<<8|t}acquire(e,l,t,o){this.set(e,l,t,o)}contains(e){const l=e.level-this.level;return l>=0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}containsChild(e){const l=e.level-this.level;return l>0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,l,t,o){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[i,h,w,n]=e.split("/");this.level=parseFloat(i),this.row=parseFloat(h),this.col=parseFloat(w),this.world=parseFloat(n)}else this.level=+e,this.row=+l,this.col=+t,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,l,t){const o=this.clone();return o.col+=e,o.row+=l,t.normalizeKey(o),o}getChildKeys(){const e=this.level+1,l=this.row<<1,t=this.col<<1,o=this.world;return[new s(e,l,t,o),new s(e,l,t+1,o),new s(e,l+1,t,o),new s(e,l+1,t+1,o)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};r.pool=new c(r,null,null,25,50);export{r as s}; diff --git a/main/assets/TileKey-C5IL-JBr-COMthbrT.js b/main/assets/TileKey-C5IL-JBr-COMthbrT.js new file mode 100644 index 000000000..638b0b448 --- /dev/null +++ b/main/assets/TileKey-C5IL-JBr-COMthbrT.js @@ -0,0 +1 @@ +import{ec as c}from"./main-C7yV2j71.js";let r=class s{static getId(e,l,t,o){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${l}/${t}/${o}`}constructor(e,l,t,o){this.set(e,l,t,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,l=4095&this.col,t=63&this.level;return(3&this.world)<<30|l<<22|e<<8|t}acquire(e,l,t,o){this.set(e,l,t,o)}contains(e){const l=e.level-this.level;return l>=0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}containsChild(e){const l=e.level-this.level;return l>0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,l,t,o){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[i,h,w,n]=e.split("/");this.level=parseFloat(i),this.row=parseFloat(h),this.col=parseFloat(w),this.world=parseFloat(n)}else this.level=+e,this.row=+l,this.col=+t,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,l,t){const o=this.clone();return o.col+=e,o.row+=l,t.normalizeKey(o),o}getChildKeys(){const e=this.level+1,l=this.row<<1,t=this.col<<1,o=this.world;return[new s(e,l,t,o),new s(e,l,t+1,o),new s(e,l+1,t,o),new s(e,l+1,t+1,o)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};r.pool=new c(r,null,null,25,50);export{r as s}; diff --git a/main/assets/TileLayer-Be5tWeN5-CfDmVQKc.js b/main/assets/TileLayer-Be5tWeN5-CfDmVQKc.js deleted file mode 100644 index 6552f938f..000000000 --- a/main/assets/TileLayer-Be5tWeN5-CfDmVQKc.js +++ /dev/null @@ -1 +0,0 @@ -import{W as _,J as v,a as S,f as c,X as T,o as u,Y as b,v as s,S as a,a0 as w,ac as O,ad as R,i as U}from"./main-BZaw9FpY.js";import{y as W}from"./loadAll-e978YItg-CB-7_cng.js";import{m as $}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as L}from"./Layer-ChoECxvZ-C4wLrCej.js";import{n as M}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{O as P}from"./ArcGISCachedService-C64Ko1TY-YBzt3RaL.js";import{k as A,M as j,A as k}from"./SublayersOwner-DfTaMJ5V-CcYzSRLx.js";import{a as C}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as D}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as B}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as N}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as I}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as J}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{i as G,L as E,b as K}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{Z as V}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{u as y}from"./imageBitmapUtils-DA36kg39-CBVFUZAU.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-UDulH8vT.js";import"./TilemapCache-CRRxws77-B5V8seF0.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./QueryTask-CwHwH2rS-CU-oJwb3.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./executeForIds-Z1gkLduF-Daa1fnES.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./executeQueryPBF-o8010HS9-dWp8mQx-.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./executeQueryJSON-CcHnccia-DVecwfbV.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./sublayerUtils-CyM0QC5B-BB_azrTi.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";var d;const f=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let i=d=class extends D(q(A(P(j(N(I(C($(J(M(B(L)))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(_).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&v.fromJSON(e)}writeSublayers(e,r,t,o){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:n})=>n&&n.toArray().reverse()).toArray(),l=[],m={writeSublayerStructure:!1,...o};p.forEach(n=>{const h=n.write({},m);l.push(h)}),l.some(n=>Object.keys(n).length>1)&&(r.layers=l)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>S(r).path):null}fetchTile(e,r,t,o={}){const{signal:p}=o,l=this.getTileUrl(e,r,t),m={responseType:"image",signal:p,query:{...this.refreshParameters}};return c(l,m).then(n=>n.data)}async fetchImageBitmapTile(e,r,t,o={}){const{signal:p}=o;if(this.fetchTile!==d.prototype.fetchTile){const h=await this.fetchTile(e,r,t,o);return y(h,e,r,t,p)}const l=this.getTileUrl(e,r,t),m={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:n}=await c(l,m);return y(n,e,r,t,p)}getTileUrl(e,r,t){const o=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=T({...this.parsedUrl?.query,blankTile:!o&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[r%l.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return W(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new u("tile-layer:undefined-url","layer's url is not defined");const o=G(this.parsedUrl.path);if(o!=null&&o.serverType==="ImageServer")throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");c(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!E(t))return this._fetchServerVersion(t,e).then(o=>{this.read({currentVersion:o})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!K(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return c(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(o=>{if(o.data&&o.data.currentVersion)return o.data.currentVersion;throw new u("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,o=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),s([a({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([a({type:Boolean})],i.prototype,"resampling",void 0),s([a()],i.prototype,"sourceJSON",void 0),s([a({type:v})],i.prototype,"spatialReference",void 0),s([w("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),s([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),s([a({readOnly:!0})],i.prototype,"sublayers",void 0),s([O("sublayers",{layers:{type:[k]}})],i.prototype,"writeSublayers",null),s([a({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([a()],i.prototype,"tileServers",null),s([R("tileServers")],i.prototype,"castTileServers",null),s([a({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),s([a(V)],i.prototype,"url",void 0),i=d=s([U("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const Ur=i;export{Ur as default}; diff --git a/main/assets/TileLayer-Be5tWeN5-DkNCDOOT.js b/main/assets/TileLayer-Be5tWeN5-DkNCDOOT.js new file mode 100644 index 000000000..404b1e948 --- /dev/null +++ b/main/assets/TileLayer-Be5tWeN5-DkNCDOOT.js @@ -0,0 +1 @@ +import{W as _,J as v,a as S,f as c,X as T,o as u,Y as b,v as s,S as a,a0 as w,ac as O,ad as R,i as U}from"./main-C7yV2j71.js";import{y as W}from"./loadAll-e978YItg-NjG3VBGi.js";import{m as $}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as L}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{n as M}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{O as P}from"./ArcGISCachedService-C64Ko1TY-C2ql8te1.js";import{k as A,M as j,A as k}from"./SublayersOwner-DfTaMJ5V-DBe6p6TL.js";import{a as C}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as D}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as B}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as N}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as I}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as J}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{i as G,L as E,b as K}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{Z as V}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{u as y}from"./imageBitmapUtils-DA36kg39-BPA5qQx5.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-6JuHkhwl.js";import"./TilemapCache-CRRxws77-Cj_Hxxs_.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./jsonUtils-C64Zfu7c-BqaK54UK.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./QueryTask-CwHwH2rS-CT1NKU1Q.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./executeForIds-Z1gkLduF-BNBrXf-U.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./executeQueryPBF-o8010HS9-E5WwNUPn.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./executeQueryJSON-CcHnccia-CB1D7q08.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./FeatureType-C9hJmS6_-5PPiaaCJ.js";import"./FeatureTemplate-SPHPD45f-DdZuptIc.js";import"./labelingInfo-DGVNul26-ReCWpi39.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js";import"./Relationship-PyhUibYK-DuMEI2S9.js";import"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./sublayerUtils-CyM0QC5B-BQ17aSXL.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";var d;const f=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let i=d=class extends D(q(A(P(j(N(I(C($(J(M(B(L)))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(_).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&v.fromJSON(e)}writeSublayers(e,r,t,o){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:n})=>n&&n.toArray().reverse()).toArray(),l=[],m={writeSublayerStructure:!1,...o};p.forEach(n=>{const h=n.write({},m);l.push(h)}),l.some(n=>Object.keys(n).length>1)&&(r.layers=l)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>S(r).path):null}fetchTile(e,r,t,o={}){const{signal:p}=o,l=this.getTileUrl(e,r,t),m={responseType:"image",signal:p,query:{...this.refreshParameters}};return c(l,m).then(n=>n.data)}async fetchImageBitmapTile(e,r,t,o={}){const{signal:p}=o;if(this.fetchTile!==d.prototype.fetchTile){const h=await this.fetchTile(e,r,t,o);return y(h,e,r,t,p)}const l=this.getTileUrl(e,r,t),m={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:n}=await c(l,m);return y(n,e,r,t,p)}getTileUrl(e,r,t){const o=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=T({...this.parsedUrl?.query,blankTile:!o&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[r%l.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return W(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new u("tile-layer:undefined-url","layer's url is not defined");const o=G(this.parsedUrl.path);if(o!=null&&o.serverType==="ImageServer")throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");c(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!E(t))return this._fetchServerVersion(t,e).then(o=>{this.read({currentVersion:o})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!K(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return c(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(o=>{if(o.data&&o.data.currentVersion)return o.data.currentVersion;throw new u("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,o=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),s([a({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([a({type:Boolean})],i.prototype,"resampling",void 0),s([a()],i.prototype,"sourceJSON",void 0),s([a({type:v})],i.prototype,"spatialReference",void 0),s([w("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),s([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),s([a({readOnly:!0})],i.prototype,"sublayers",void 0),s([O("sublayers",{layers:{type:[k]}})],i.prototype,"writeSublayers",null),s([a({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([a()],i.prototype,"tileServers",null),s([R("tileServers")],i.prototype,"castTileServers",null),s([a({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),s([a(V)],i.prototype,"url",void 0),i=d=s([U("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const Ur=i;export{Ur as default}; diff --git a/main/assets/TileLayerView2D-CT-Yu10P-BUH8mf5a.js b/main/assets/TileLayerView2D-CT-Yu10P-BUH8mf5a.js deleted file mode 100644 index 6b7b4ec99..000000000 --- a/main/assets/TileLayerView2D-CT-Yu10P-BUH8mf5a.js +++ /dev/null @@ -1 +0,0 @@ -import{a2 as w,aC as y,aU as l,a1 as I,v as m,S as g,i as V}from"./main-BZaw9FpY.js";import{o as H}from"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-Czob75PE.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./PieChartMeshWriter-C5yLDFwp-CJPWs81O.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-C4elE3ip.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import{L as T,p as n,D as f}from"./imageUtils-Co-ELErj-CxjujewR.js";import{X as U,Y as q}from"./LayerView-Bish-E63-DRGspiuk.js";import{l as C}from"./HighlightGraphicContainer-Dt5r6lMq-C0o3U8Y8.js";import{Q,$ as S,a as b}from"./Tile-D75RMC64-DprBAZDK.js";import{s as d}from"./TileKey-C5IL-JBr-0HJjsV9n.js";import{n as L}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import{_ as P,O as F}from"./MapServiceLayerViewHelper-bw3M4B8s-BT4W8OxK.js";import{x as k}from"./drapedUtils-BZ1SGPtE-DN0L7Y_o.js";import{i as z}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./TurboLine-CIlsAy5m-BrOlSIM-.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";import"./Bitmap-CcqmzvfR-Cl_blWW9.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./languageUtils-BYxF9hRA-Dig_Awzu.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-Cy2KeMh-.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./scaleUtils-DxsfQwK1-OKeSqBb9.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-BB_azrTi.js";import"./popupUtils-nV1O8RUO-xbvi-u4x.js";const A=[0,0];let h=class extends L(T(U(q))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new H,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume(),this._highlightView?.processUpdate(t)}attach(){const t="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new Q(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new S({tileInfoView:this._tileInfoView,concurrency:t&&10*t.length||10,process:(e,r)=>this.fetchTile(e,r),scheduler:this.scheduler,priority:z.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new b({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),P(this,this.layer)){const e=this._highlightView=new v({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new C(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new F({createFetchPopupFeaturesQueryGeometry:(r,p)=>k(r,p,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(r,p)=>{e.graphicUpdateHandler({graphic:r,property:p})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i):[]}highlight(t){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(t):w()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return y(this.layer.tileInfo?.spatialReference,t)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const i=this._bitmapView.createTile(t),e=i.bitmap;return[e.x,e.y]=this._tileInfoView.getTileCoords(A,i.key),e.resolution=this._tileInfoView.getTileResolution(i.key),[e.width,e.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,i={}){const e=this.tilemapCache,{signal:r,resamplingLevel:p=0}=i;if(!e)try{return await this._fetchImage(t,r)}catch(o){if(!l(o)&&!this.resampling)return n(this._tileInfoView.tileInfo.size);if(p<3){const u=this._tileInfoView.getTileParentId(t.id);if(u){const c=new d(u),_=await this.fetchTile(c,{...i,resamplingLevel:p+1});return f(this._tileInfoView,_,c,t)}}throw o}const s=new d(0,0,0,0);let a;try{if(await e.fetchAvailabilityUpsample(t.level,t.row,t.col,s,{signal:r}),!this.resampling&&s.level!==t.level)return n(this._tileInfoView.tileInfo.size);a=await this._fetchImage(s,r)}catch(o){if(l(o))throw o;return n(this._tileInfoView.tileInfo.size)}return this.resampling?f(this._tileInfoView,a,s,t):a}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const i=await this._fetchQueue.push(t.key);t.bitmap.source=i,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(i){l(i)||I.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(t,i){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:i})}};m([g()],h.prototype,"resampling",null),m([g()],h.prototype,"tilemapCache",null),h=m([V("esri.views.2d.layers.TileLayerView2D")],h);const re=h;export{re as default}; diff --git a/main/assets/TileLayerView2D-CT-Yu10P-D652aaoE.js b/main/assets/TileLayerView2D-CT-Yu10P-D652aaoE.js new file mode 100644 index 000000000..474833709 --- /dev/null +++ b/main/assets/TileLayerView2D-CT-Yu10P-D652aaoE.js @@ -0,0 +1 @@ +import{a2 as w,aC as y,aU as l,a1 as I,v as m,S as g,i as V}from"./main-C7yV2j71.js";import{o as H}from"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-Btv2jyXK.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./PieChartMeshWriter-C5yLDFwp-0zzyhiO2.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-n0h7HuaO.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import{L as T,p as n,D as f}from"./imageUtils-Co-ELErj-Cnx9scTS.js";import{X as U,Y as q}from"./LayerView-Bish-E63-I2LV0oDm.js";import{l as C}from"./HighlightGraphicContainer-Dt5r6lMq-BNbDeHiI.js";import{Q,$ as S,a as b}from"./Tile-D75RMC64-CM0vKD9b.js";import{s as d}from"./TileKey-C5IL-JBr-COMthbrT.js";import{n as L}from"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";import{_ as P,O as F}from"./MapServiceLayerViewHelper-bw3M4B8s-B5cli8RL.js";import{x as k}from"./drapedUtils-BZ1SGPtE-BPt00fGU.js";import{i as z}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./TurboLine-CIlsAy5m-Q2LH92mI.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";import"./Bitmap-CcqmzvfR-C92VuEM3.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./languageUtils-BYxF9hRA-BLoYMqdU.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-CNuAEz8h.js";import"./number-eRKYXfX9-C213qXfW.js";import"./scaleUtils-DxsfQwK1-B4OFXqEO.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-BQ17aSXL.js";import"./popupUtils-nV1O8RUO-X6GWMgRY.js";const A=[0,0];let h=class extends L(T(U(q))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new H,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume(),this._highlightView?.processUpdate(t)}attach(){const t="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new Q(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new S({tileInfoView:this._tileInfoView,concurrency:t&&10*t.length||10,process:(e,r)=>this.fetchTile(e,r),scheduler:this.scheduler,priority:z.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new b({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),P(this,this.layer)){const e=this._highlightView=new v({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new C(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new F({createFetchPopupFeaturesQueryGeometry:(r,p)=>k(r,p,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(r,p)=>{e.graphicUpdateHandler({graphic:r,property:p})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i):[]}highlight(t){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(t):w()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return y(this.layer.tileInfo?.spatialReference,t)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const i=this._bitmapView.createTile(t),e=i.bitmap;return[e.x,e.y]=this._tileInfoView.getTileCoords(A,i.key),e.resolution=this._tileInfoView.getTileResolution(i.key),[e.width,e.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,i={}){const e=this.tilemapCache,{signal:r,resamplingLevel:p=0}=i;if(!e)try{return await this._fetchImage(t,r)}catch(o){if(!l(o)&&!this.resampling)return n(this._tileInfoView.tileInfo.size);if(p<3){const u=this._tileInfoView.getTileParentId(t.id);if(u){const c=new d(u),_=await this.fetchTile(c,{...i,resamplingLevel:p+1});return f(this._tileInfoView,_,c,t)}}throw o}const s=new d(0,0,0,0);let a;try{if(await e.fetchAvailabilityUpsample(t.level,t.row,t.col,s,{signal:r}),!this.resampling&&s.level!==t.level)return n(this._tileInfoView.tileInfo.size);a=await this._fetchImage(s,r)}catch(o){if(l(o))throw o;return n(this._tileInfoView.tileInfo.size)}return this.resampling?f(this._tileInfoView,a,s,t):a}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const i=await this._fetchQueue.push(t.key);t.bitmap.source=i,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(i){l(i)||I.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(t,i){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:i})}};m([g()],h.prototype,"resampling",null),m([g()],h.prototype,"tilemapCache",null),h=m([V("esri.views.2d.layers.TileLayerView2D")],h);const re=h;export{re as default}; diff --git a/main/assets/TilemapCache-CRRxws77-B5V8seF0.js b/main/assets/TilemapCache-CRRxws77-B5V8seF0.js deleted file mode 100644 index ec98e50dd..000000000 --- a/main/assets/TilemapCache-CRRxws77-B5V8seF0.js +++ /dev/null @@ -1 +0,0 @@ -import{dD as T,v as d,S as y,j as z,f as A,ah as S,aL as q,aU as _,dE as L,x,o as u,E as P,X as I,i as M,P as U,dF as C,a2 as j,aS as k,dG as E}from"./main-BZaw9FpY.js";import{G as F}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{b as R}from"./LRUCache-C3erQTWv-CeYLuvL9.js";import{e as H}from"./TileKey-B_6qmYK--BtZdR-Xy.js";function G(e,t=!1){return e<=E?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}class w{constructor(t){K(t);const{location:a,data:i}=t;this.location=Object.freeze(U(a));const l=this.location.width,n=this.location.height;let o=!0,r=!0;const c=Math.ceil(l*n/32),s=G(c);let h=0;for(let f=0;f>5,o=this._availability;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s?.details?.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:new Array(o*r).fill(0)};throw s}).then(s=>{if(s.location&&(s.location.top!==l||s.location.left!==n||s.location.width!==o||s.location.height!==r))throw new u("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return w.fromJSON(s)})}static fromJSON(t){return Object.freeze(new w(t))}}function D(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function J(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const a=e.service.query;return a&&(t=`${t}?${a}`),t}function K(e){if(!e?.location)throw new u("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new u("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new u("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new u("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new u("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}var v;function $(e,t,a){return new u("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:a})}let p=v=class extends z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new R(2*F.MEGABYTES),this.addHandles(S(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),q))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,a){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return"unavailable";const i=this._tilemapFromCache(e,t,a,this._tmpTilemapDefinition);return i?i.getAvailability(t,a):"unknown"}fetchAvailability(e,t,a,i){return!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD?Promise.reject($(e,t,a)):this._fetchTilemap(e,t,a,i).catch(l=>l).then(l=>{if(l instanceof w){const n=l.getAvailability(t,a);if(n==="unavailable")throw $(e,t,a);return n}if(_(l))throw l;return"unknown"})}fetchAvailabilityUpsample(e,t,a,i,l){i.level=e,i.row=t,i.col=a;const n=this.layer.tileInfo;n.updateTileInfo(i);const o=this.fetchAvailability(e,t,a,l).catch(r=>{if(_(r))throw r;if(n.upsampleTile(i))return this.fetchAvailabilityUpsample(i.level,i.row,i.col,i,l);throw r});return this._fetchAvailabilityUpsamplePrefetch(i.id,e,t,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,a,i,l,n){if(!this._prefetchingEnabled||e==null)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let c=!1;const s=j(()=>{c||(c=!0,r.abort())});if(this.addHandles(s,o),await L(10,r.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),x(r))return;const h=new H(e,t,a,i),f={...l,signal:r.signal},m=this.layer.tileInfo;for(let O=0;v._prefetches.length{v._prefetches.removeUnordered(b)};b.then(g,g)}}_fetchTilemap(e,t,a,i){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return Promise.reject(new u("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,a,l);if(n)return Promise.resolve(n);const o=i?.signal;return i={...i,signal:null},new Promise((r,c)=>{P(o,()=>c(k()));const s=D(l);let h=this._pendingTilemapRequests[s];if(!h){h=w.fromDefinition(l,i).then(m=>(this._tilemapCache.put(s,m,m.byteSize),m));const f=()=>{delete this._pendingTilemapRequests[s]};this._pendingTilemapRequests[s]=h,h.then(f,f)}h.then(r,c)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:I({...e.query,...a,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,a,i){i.level=e,i.row=t-t%this.size,i.col=a-a%this.size;const l=D(i);return this._tilemapCache.get(l)}get test(){}};p._maxPrefetch=4,p._prefetches=new T({initialSize:v._maxPrefetch}),d([y({constructOnly:!0})],p.prototype,"layer",void 0),d([y({constructOnly:!0})],p.prototype,"minLOD",void 0),d([y({constructOnly:!0})],p.prototype,"maxLOD",void 0),d([y({constructOnly:!0})],p.prototype,"request",void 0),d([y({constructOnly:!0})],p.prototype,"size",void 0),p=v=d([M("esri.layers.support.TilemapCache")],p);export{p as f}; diff --git a/main/assets/TilemapCache-CRRxws77-Cj_Hxxs_.js b/main/assets/TilemapCache-CRRxws77-Cj_Hxxs_.js new file mode 100644 index 000000000..571ee578e --- /dev/null +++ b/main/assets/TilemapCache-CRRxws77-Cj_Hxxs_.js @@ -0,0 +1 @@ +import{dD as T,v as d,S as y,j as z,f as A,ah as S,aL as q,aU as _,dE as L,x,o as u,E as P,X as I,i as M,P as U,dF as C,a2 as j,aS as k,dG as E}from"./main-C7yV2j71.js";import{G as F}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{b as R}from"./LRUCache-C3erQTWv-DhyPlt5p.js";import{e as H}from"./TileKey-B_6qmYK--BtZdR-Xy.js";function G(e,t=!1){return e<=E?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}class w{constructor(t){K(t);const{location:a,data:i}=t;this.location=Object.freeze(U(a));const l=this.location.width,n=this.location.height;let o=!0,r=!0;const c=Math.ceil(l*n/32),s=G(c);let h=0;for(let f=0;f>5,o=this._availability;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s?.details?.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:new Array(o*r).fill(0)};throw s}).then(s=>{if(s.location&&(s.location.top!==l||s.location.left!==n||s.location.width!==o||s.location.height!==r))throw new u("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return w.fromJSON(s)})}static fromJSON(t){return Object.freeze(new w(t))}}function D(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function J(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const a=e.service.query;return a&&(t=`${t}?${a}`),t}function K(e){if(!e?.location)throw new u("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new u("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new u("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new u("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new u("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}var v;function $(e,t,a){return new u("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:a})}let p=v=class extends z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new R(2*F.MEGABYTES),this.addHandles(S(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),q))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,a){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return"unavailable";const i=this._tilemapFromCache(e,t,a,this._tmpTilemapDefinition);return i?i.getAvailability(t,a):"unknown"}fetchAvailability(e,t,a,i){return!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD?Promise.reject($(e,t,a)):this._fetchTilemap(e,t,a,i).catch(l=>l).then(l=>{if(l instanceof w){const n=l.getAvailability(t,a);if(n==="unavailable")throw $(e,t,a);return n}if(_(l))throw l;return"unknown"})}fetchAvailabilityUpsample(e,t,a,i,l){i.level=e,i.row=t,i.col=a;const n=this.layer.tileInfo;n.updateTileInfo(i);const o=this.fetchAvailability(e,t,a,l).catch(r=>{if(_(r))throw r;if(n.upsampleTile(i))return this.fetchAvailabilityUpsample(i.level,i.row,i.col,i,l);throw r});return this._fetchAvailabilityUpsamplePrefetch(i.id,e,t,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,a,i,l,n){if(!this._prefetchingEnabled||e==null)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let c=!1;const s=j(()=>{c||(c=!0,r.abort())});if(this.addHandles(s,o),await L(10,r.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),x(r))return;const h=new H(e,t,a,i),f={...l,signal:r.signal},m=this.layer.tileInfo;for(let O=0;v._prefetches.length{v._prefetches.removeUnordered(b)};b.then(g,g)}}_fetchTilemap(e,t,a,i){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return Promise.reject(new u("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,a,l);if(n)return Promise.resolve(n);const o=i?.signal;return i={...i,signal:null},new Promise((r,c)=>{P(o,()=>c(k()));const s=D(l);let h=this._pendingTilemapRequests[s];if(!h){h=w.fromDefinition(l,i).then(m=>(this._tilemapCache.put(s,m,m.byteSize),m));const f=()=>{delete this._pendingTilemapRequests[s]};this._pendingTilemapRequests[s]=h,h.then(f,f)}h.then(r,c)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:I({...e.query,...a,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,a,i){i.level=e,i.row=t-t%this.size,i.col=a-a%this.size;const l=D(i);return this._tilemapCache.get(l)}get test(){}};p._maxPrefetch=4,p._prefetches=new T({initialSize:v._maxPrefetch}),d([y({constructOnly:!0})],p.prototype,"layer",void 0),d([y({constructOnly:!0})],p.prototype,"minLOD",void 0),d([y({constructOnly:!0})],p.prototype,"maxLOD",void 0),d([y({constructOnly:!0})],p.prototype,"request",void 0),d([y({constructOnly:!0})],p.prototype,"size",void 0),p=v=d([M("esri.layers.support.TilemapCache")],p);export{p as f}; diff --git a/main/assets/TimeExtent-Cn0Jofqr-5JsvQYX6.js b/main/assets/TimeExtent-Cn0Jofqr-5JsvQYX6.js new file mode 100644 index 000000000..7108aa95e --- /dev/null +++ b/main/assets/TimeExtent-Cn0Jofqr-5JsvQYX6.js @@ -0,0 +1 @@ +import{v as o,S as d,a0 as p,ac as y,e as v,aD as c,i as J,cK as g,d5 as D,F as E}from"./main-C7yV2j71.js";const T={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function m(e,t,n,s=c){const r=new g(D(s)),i=E.fromJSDate(e,{zone:r}),u=n==="decades"||n==="centuries"?"year":S(n);return n==="decades"&&(t*=10),n==="centuries"&&(t*=100),i.plus({[u]:t}).toJSDate()}function k(e,t,n="milliseconds"){const s=e.getTime(),r=N(t,n,"milliseconds");return new Date(s+r)}function w(e,t,n=c){const s=new g(D(n)),r=E.fromJSDate(e,{zone:s});if(t==="decades"||t==="centuries"){const u=r.startOf("year"),{year:h}=u,A=h-h%(t==="decades"?10:100);return u.set({year:A}).toJSDate()}const i=S(t);return r.startOf(i).toJSDate()}function N(e,t,n){return e===0?0:e*T[t]/T[n]}function S(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var a;let l=a=class extends v{static get allTime(){return f}static get empty(){return j}static fromArray(e){return new a({start:e[0]!=null?new Date(e[0]):e[0],end:e[1]!=null?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(a.allTime)}get isEmpty(){return this.equals(a.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new a({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,r=e.end?.getTime()??e.end;return t===s&&n===r}expandTo(e,t=c){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=w(n,e,t));let s=this.end;if(s){const r=w(s,e,t);s=s.getTime()===r.getTime()?r:m(r,1,e,t)}return new a({start:n,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return a.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let i,u;return s>=t&&s<=n?i=s:t>=s&&t<=r&&(i=t),n>=s&&n<=r?u=n:r>=t&&r<=n&&(u=r),i==null||u==null||isNaN(i)||isNaN(u)?a.empty:new a({start:i===-1/0?null:new Date(i),end:u===1/0?null:new Date(u)})}offset(e,t,n=c){if(this.isEmpty||this.isAllTime)return this.clone();const s=new a,{start:r,end:i}=this;return r!=null&&(s.start=m(r,e,t,n)),i!=null&&(s.end=m(i,e,t,n)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=this.start!=null&&e.start!=null?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=this.end!=null&&e.end!=null?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new a({start:t,end:n})}};o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"end",void 0),o([p("end")],l.prototype,"readEnd",null),o([y("end")],l.prototype,"writeEnd",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isAllTime",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isEmpty",null),o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"start",void 0),o([p("start")],l.prototype,"readStart",null),o([y("start")],l.prototype,"writeStart",null),l=a=o([J("esri.time.TimeExtent")],l);const O=l,f=new l,j=new l({start:void 0,end:void 0});export{N as E,m as c,T as h,k as j,O as k}; diff --git a/main/assets/TimeExtent-Cn0Jofqr-tHuvEXRa.js b/main/assets/TimeExtent-Cn0Jofqr-tHuvEXRa.js deleted file mode 100644 index 833cf939e..000000000 --- a/main/assets/TimeExtent-Cn0Jofqr-tHuvEXRa.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as d,a0 as p,ac as y,e as v,aD as c,i as J,cK as g,d5 as D,F as E}from"./main-BZaw9FpY.js";const T={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function m(e,t,n,s=c){const r=new g(D(s)),i=E.fromJSDate(e,{zone:r}),u=n==="decades"||n==="centuries"?"year":S(n);return n==="decades"&&(t*=10),n==="centuries"&&(t*=100),i.plus({[u]:t}).toJSDate()}function k(e,t,n="milliseconds"){const s=e.getTime(),r=N(t,n,"milliseconds");return new Date(s+r)}function w(e,t,n=c){const s=new g(D(n)),r=E.fromJSDate(e,{zone:s});if(t==="decades"||t==="centuries"){const u=r.startOf("year"),{year:h}=u,A=h-h%(t==="decades"?10:100);return u.set({year:A}).toJSDate()}const i=S(t);return r.startOf(i).toJSDate()}function N(e,t,n){return e===0?0:e*T[t]/T[n]}function S(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var a;let l=a=class extends v{static get allTime(){return f}static get empty(){return j}static fromArray(e){return new a({start:e[0]!=null?new Date(e[0]):e[0],end:e[1]!=null?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(a.allTime)}get isEmpty(){return this.equals(a.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new a({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,r=e.end?.getTime()??e.end;return t===s&&n===r}expandTo(e,t=c){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=w(n,e,t));let s=this.end;if(s){const r=w(s,e,t);s=s.getTime()===r.getTime()?r:m(r,1,e,t)}return new a({start:n,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return a.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let i,u;return s>=t&&s<=n?i=s:t>=s&&t<=r&&(i=t),n>=s&&n<=r?u=n:r>=t&&r<=n&&(u=r),i==null||u==null||isNaN(i)||isNaN(u)?a.empty:new a({start:i===-1/0?null:new Date(i),end:u===1/0?null:new Date(u)})}offset(e,t,n=c){if(this.isEmpty||this.isAllTime)return this.clone();const s=new a,{start:r,end:i}=this;return r!=null&&(s.start=m(r,e,t,n)),i!=null&&(s.end=m(i,e,t,n)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=this.start!=null&&e.start!=null?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=this.end!=null&&e.end!=null?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new a({start:t,end:n})}};o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"end",void 0),o([p("end")],l.prototype,"readEnd",null),o([y("end")],l.prototype,"writeEnd",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isAllTime",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isEmpty",null),o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"start",void 0),o([p("start")],l.prototype,"readStart",null),o([y("start")],l.prototype,"writeStart",null),l=a=o([J("esri.time.TimeExtent")],l);const O=l,f=new l,j=new l({start:void 0,end:void 0});export{N as E,m as c,T as h,k as j,O as k}; diff --git a/main/assets/TimeInfo-w_HB2CsF-Ce-xYAJs.js b/main/assets/TimeInfo-w_HB2CsF-Ce-xYAJs.js new file mode 100644 index 000000000..a0d36b5b1 --- /dev/null +++ b/main/assets/TimeInfo-w_HB2CsF-Ce-xYAJs.js @@ -0,0 +1 @@ +import{d2 as y,aa as u,e as m,v as t,bz as T,S as l,i as d,a0 as r,ac as o,bQ as c}from"./main-C7yV2j71.js";import{E as I,k as p}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";const w=y()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let s=class extends u(m){constructor(n){super(n),this.unit="milliseconds",this.value=0}toMilliseconds(){return I(this.value,this.unit,"milliseconds")}};t([T(w,{nonNullable:!0})],s.prototype,"unit",void 0),t([l({type:Number,json:{write:!0},nonNullable:!0})],s.prototype,"value",void 0),s=t([d("esri.time.TimeInterval")],s);const v=s;function a(n,e){return v.fromJSON({value:n,unit:e})}let i=class extends u(m){constructor(n){super(n),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(n,e){return e.timeExtent&&Array.isArray(e.timeExtent)&&e.timeExtent.length===2?p.fromArray(e.timeExtent):null}writeFullTimeExtent(n,e){n?.start!=null&&n.end!=null?e.timeExtent=n.toArray():e.timeExtent=null}readInterval(n,e){return e.timeInterval&&e.timeIntervalUnits?a(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?a(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(n,e){e.timeInterval=n?.toJSON().value??null,e.timeIntervalUnits=n?.toJSON().unit??null}};t([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],i.prototype,"cumulative",void 0),t([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"endField",void 0),t([l({type:p,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"fullTimeExtent",void 0),t([r("fullTimeExtent",["timeExtent"])],i.prototype,"readFullTimeExtent",null),t([o("fullTimeExtent")],i.prototype,"writeFullTimeExtent",null),t([l({type:Boolean,json:{write:!0}})],i.prototype,"hasLiveData",void 0),t([l({type:v,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"interval",void 0),t([r("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],i.prototype,"readInterval",null),t([o("interval")],i.prototype,"writeInterval",null),t([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"startField",void 0),t([l(c("timeReference",!0))],i.prototype,"timeZone",void 0),t([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"trackIdField",void 0),t([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],i.prototype,"useTime",void 0),t([l({type:[Date],json:{read:!1}})],i.prototype,"stops",void 0),i=t([d("esri.layers.support.TimeInfo")],i);const U=i;export{v as r,w as v,U as w}; diff --git a/main/assets/TimeInfo-w_HB2CsF-wq_g9Zh1.js b/main/assets/TimeInfo-w_HB2CsF-wq_g9Zh1.js deleted file mode 100644 index a3033d8c1..000000000 --- a/main/assets/TimeInfo-w_HB2CsF-wq_g9Zh1.js +++ /dev/null @@ -1 +0,0 @@ -import{d2 as y,aa as u,e as m,v as t,bz as T,S as l,i as d,a0 as r,ac as o,bQ as c}from"./main-BZaw9FpY.js";import{E as I,k as p}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";const w=y()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let s=class extends u(m){constructor(n){super(n),this.unit="milliseconds",this.value=0}toMilliseconds(){return I(this.value,this.unit,"milliseconds")}};t([T(w,{nonNullable:!0})],s.prototype,"unit",void 0),t([l({type:Number,json:{write:!0},nonNullable:!0})],s.prototype,"value",void 0),s=t([d("esri.time.TimeInterval")],s);const v=s;function a(n,e){return v.fromJSON({value:n,unit:e})}let i=class extends u(m){constructor(n){super(n),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(n,e){return e.timeExtent&&Array.isArray(e.timeExtent)&&e.timeExtent.length===2?p.fromArray(e.timeExtent):null}writeFullTimeExtent(n,e){n?.start!=null&&n.end!=null?e.timeExtent=n.toArray():e.timeExtent=null}readInterval(n,e){return e.timeInterval&&e.timeIntervalUnits?a(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?a(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(n,e){e.timeInterval=n?.toJSON().value??null,e.timeIntervalUnits=n?.toJSON().unit??null}};t([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],i.prototype,"cumulative",void 0),t([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"endField",void 0),t([l({type:p,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"fullTimeExtent",void 0),t([r("fullTimeExtent",["timeExtent"])],i.prototype,"readFullTimeExtent",null),t([o("fullTimeExtent")],i.prototype,"writeFullTimeExtent",null),t([l({type:Boolean,json:{write:!0}})],i.prototype,"hasLiveData",void 0),t([l({type:v,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"interval",void 0),t([r("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],i.prototype,"readInterval",null),t([o("interval")],i.prototype,"writeInterval",null),t([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"startField",void 0),t([l(c("timeReference",!0))],i.prototype,"timeZone",void 0),t([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"trackIdField",void 0),t([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],i.prototype,"useTime",void 0),t([l({type:[Date],json:{read:!1}})],i.prototype,"stops",void 0),i=t([d("esri.layers.support.TimeInfo")],i);const U=i;export{v as r,w as v,U as w}; diff --git a/main/assets/TimeOnly-DSMefxKy-C21ZkqlE.js b/main/assets/TimeOnly-DSMefxKy-C21ZkqlE.js new file mode 100644 index 000000000..02c8769af --- /dev/null +++ b/main/assets/TimeOnly-DSMefxKy-C21ZkqlE.js @@ -0,0 +1 @@ +import{F as a,cI as M,b_ as g,cK as Z,h as U,cF as q,n as b}from"./main-C7yV2j71.js";import{t as l}from"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";var y;(function(r){r.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const N={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class w extends Error{constructor(e,t){super(q(N[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,w)}}function h(r,e,t){return rt?r-t:0}function d(r,e,t){return rt?t:r}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,i=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(i)||isNaN(o)||isNaN(T)||isNaN(S))return null;const p=a.local(e,t).daysInMonth;let D=a.fromObject({day:d(s,1,p),year:e,month:d(t,1,12),hour:d(i,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(s,1,p),hours:h(i,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=m(t);return e.isUnknownTimeZone||s===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e._date.setZone(s))}static dateJSToArcadeDate(e){return new n(a.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new n(a.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(a.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=m(t);return e.zone===l.instance||s===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e.setZone(s))}static nowToArcadeDate(e){const t=m(e);return new n(a.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(a.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=a.fromISO(e,{setZone:!0});return new n(t)}}function m(r,e=!0){if(r instanceof M)return r;if(r.toLowerCase()==="system")return"system";if(r.toLowerCase()==="utc")return"UTC";if(r.toLowerCase()==="unknown")return l.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(r)){const s=g.parseSpecifier("UTC"+(r.startsWith("+")||r.startsWith("-")?"":"+")+r);if(s)return s}const t=Z.create(r);if(!t.isValid){if(e)throw new w(y.TimeZoneNotRecognized);return null}return t}function k(r){r=r.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const s of r.match(t)||[])switch(s){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=s;break;default:s.length>=2&&s.slice(0,1)==="["&&s.slice(-1)==="]"?e+=`'${s.slice(1,-1)}'`:e+=`'${s}'`}return e}let Y=class c{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=k(e)),!e)return"";const s=this.toDateTime("unknown");return n.dateTimeToArcadeDate(s).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return a.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=a.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=a.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const i=new c(e,t,s);return i.isValid===!1?null:i}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];if(t)(t=k(t))&&s.push(t);else if(t===null||t===""){const i=a.fromISO(e,{setZone:!0});return i.isValid?c.fromParts(i.year,i.month,i.day):null}for(const i of s){const o=a.fromFormat(e,t??i);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=a.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function z(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function I(r){if(r==null)return null;switch(r.type){case"polygon":case"multipoint":case"polyline":return r.extent;case"point":return new b({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference});case"extent":return r}return null}function _(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function H(r){if(r==null)return null;const e=r.clone();return r.cache._geVersion!==void 0&&(e.cache._geVersion=r.cache._geVersion),e}function f(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function C(r){if(!r)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const s of r.match(e)||[])switch(s){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=s;break;case"A":case"a":t+="a";break;default:t+=`'${s}'`}return t}class u{constructor(e,t,s,i){this._hour=e,this._minute=t,this._second=s,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?a.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,i){const o=new u(e,t,s,i);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),i=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(i,s,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];t?(t=C(t))&&s.push(t):t!==null&&t!==""||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const i of s){const o=a.fromFormat(e,i);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return a.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{z as A,H as I,Y as O,I as Y,u as m,n as r,m as u,_ as z}; diff --git a/main/assets/TimeOnly-DSMefxKy-DBJeVQCe.js b/main/assets/TimeOnly-DSMefxKy-DBJeVQCe.js deleted file mode 100644 index 89828e156..000000000 --- a/main/assets/TimeOnly-DSMefxKy-DBJeVQCe.js +++ /dev/null @@ -1 +0,0 @@ -import{F as a,cI as M,b_ as g,cK as Z,h as U,cF as q,n as b}from"./main-BZaw9FpY.js";import{t as l}from"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";var y;(function(r){r.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const N={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class w extends Error{constructor(e,t){super(q(N[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,w)}}function h(r,e,t){return rt?r-t:0}function d(r,e,t){return rt?t:r}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,i=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(i)||isNaN(o)||isNaN(T)||isNaN(S))return null;const p=a.local(e,t).daysInMonth;let D=a.fromObject({day:d(s,1,p),year:e,month:d(t,1,12),hour:d(i,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(s,1,p),hours:h(i,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=m(t);return e.isUnknownTimeZone||s===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e._date.setZone(s))}static dateJSToArcadeDate(e){return new n(a.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new n(a.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(a.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=m(t);return e.zone===l.instance||s===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e.setZone(s))}static nowToArcadeDate(e){const t=m(e);return new n(a.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(a.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=a.fromISO(e,{setZone:!0});return new n(t)}}function m(r,e=!0){if(r instanceof M)return r;if(r.toLowerCase()==="system")return"system";if(r.toLowerCase()==="utc")return"UTC";if(r.toLowerCase()==="unknown")return l.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(r)){const s=g.parseSpecifier("UTC"+(r.startsWith("+")||r.startsWith("-")?"":"+")+r);if(s)return s}const t=Z.create(r);if(!t.isValid){if(e)throw new w(y.TimeZoneNotRecognized);return null}return t}function k(r){r=r.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const s of r.match(t)||[])switch(s){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=s;break;default:s.length>=2&&s.slice(0,1)==="["&&s.slice(-1)==="]"?e+=`'${s.slice(1,-1)}'`:e+=`'${s}'`}return e}let Y=class c{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=k(e)),!e)return"";const s=this.toDateTime("unknown");return n.dateTimeToArcadeDate(s).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return a.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=a.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=a.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const i=new c(e,t,s);return i.isValid===!1?null:i}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];if(t)(t=k(t))&&s.push(t);else if(t===null||t===""){const i=a.fromISO(e,{setZone:!0});return i.isValid?c.fromParts(i.year,i.month,i.day):null}for(const i of s){const o=a.fromFormat(e,t??i);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=a.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function z(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function I(r){if(r==null)return null;switch(r.type){case"polygon":case"multipoint":case"polyline":return r.extent;case"point":return new b({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference});case"extent":return r}return null}function _(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function H(r){if(r==null)return null;const e=r.clone();return r.cache._geVersion!==void 0&&(e.cache._geVersion=r.cache._geVersion),e}function f(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function C(r){if(!r)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const s of r.match(e)||[])switch(s){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=s;break;case"A":case"a":t+="a";break;default:t+=`'${s}'`}return t}class u{constructor(e,t,s,i){this._hour=e,this._minute=t,this._second=s,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?a.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,i){const o=new u(e,t,s,i);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),i=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(i,s,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];t?(t=C(t))&&s.push(t):t!==null&&t!==""||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const i of s){const o=a.fromFormat(e,i);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return a.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{z as A,H as I,Y as O,I as Y,u as m,n as r,m as u,_ as z}; diff --git a/main/assets/Tooltip-B0HefZ7r-CwNTZqWe.js b/main/assets/Tooltip-B0HefZ7r-CwNTZqWe.js new file mode 100644 index 000000000..2feb4c2b6 --- /dev/null +++ b/main/assets/Tooltip-B0HefZ7r-CwNTZqWe.js @@ -0,0 +1 @@ +import{V as M,H as N,ao as E,ap as F,a as x,e as R,ab as S,a8 as j,n as B,aq as u}from"./Theme-rblUnB2V-BgKdZgu2.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let r=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,b=(r-T)*(i-_)-(o-_)*(t-T),n=(r-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),b>0&&n>0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(l-a,0),s.lineTo(r,o),s.lineTo(l+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),b>0&&n<0){let l=Math.round(u(o,e+a,i-a-e));r=u(r,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(l-a,e)),s.lineTo(r,o),s.lineTo(t,l+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),b<0&&n<0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(l+a,i),s.lineTo(r,o),s.lineTo(l-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),b<0&&n>0){let l=Math.round(u(o,e+a,i-e-a));r=u(r,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,l+a),s.lineTo(r,o),s.lineTo(0,Math.max(l-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,r=[]){super(t,i,e,r),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this._setDefaultFn("background",()=>D.new(this._root,{})).set("themeTags",["tooltip","background"]),this._label=this.children.push(F.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(this._disposers.push(x(t,"pointerover",i=>{this._htmlContentHovered=!0})),this._disposers.push(x(t,"pointerout",i=>{this._htmlContentHovered=!1})))})),this.on("visible",t=>{this._handleReaderAnnouncement()}),this.label.events.on("dataitemchanged",t=>{this._handleReaderAnnouncement()}),this._root._tooltips.push(this)}_handleReaderAnnouncement(){this.get("readerAnnounce")&&this.isVisibleDeep()&&this._root.readerAlert(this.label.getAccessibleText())}get label(){return this._label}_dispose(){super._dispose(),R(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML")),this.get("labelAriaLabel")!=null&&this.label.set("ariaLabel",this.get("labelAriaLabel"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new S([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const r=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:r.event,point:r.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,r;t&&i&&(e=t.get("fill"),r=t.get("stroke"),e==null&&(e=r),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,r=this.get("centerX");r instanceof B&&(i=r.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,b=0;if(_){f=_.x(),b=_.y();const g=_.get("layerMargin");g&&(f+=g.left||0,b+=g.top||0,a+=(g.left||0)+(g.right||0),T+=(g.top||0)+(g.bottom||0))}const n=this.get("bounds",{left:-f,top:-b,right:a-f,bottom:T-b});this._updateBounds();let s=this.width(),l=this.height();s===0&&(s=this._w),l===0&&(l=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,m=this.get("pointerOrientation"),c=this.get("background"),d=0,v=0,y=0;c instanceof D&&(d=c.get("pointerLength",0),v=c.get("strokeWidth",0)/2,y=v,c.set("width",s),c.set("height",l));let C=0,H=0,O=n.right-n.left,L=n.bottom-n.top;m=="horizontal"||m=="left"||m=="right"?(v=0,m=="horizontal"?h>n.left+O/2?(h-=s*(1-i)+d,y*=-1):h+=s*i+d:m=="left"?h+=s*(1-i)+d:(h-=s*i+d,y*=-1)):(y=0,m=="vertical"?p>n.top+l/2+d?p-=l*(1-e)+d:(p+=l*e+d,v*=-1):m=="down"?p-=l*(1-e)+d:(p+=l*e+d,v*=-1)),h=u(h,n.left+s*i,n.left+O-s*(1-i))+y,p=u(p,n.top+l*e,n.top+L-l*(1-e))-v,C=k.x-h+s*i+y,H=k.y-p+l*e-v,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const g=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:g}),this.animate({key:"y",to:p,duration:w,easing:g})}else this.set("x",h),this.set("y",p);c instanceof D&&(c.set("pointerX",C),c.set("pointerY",H)),s>0&&(this._w=s),l>0&&(this._h=l)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as w}; diff --git a/main/assets/Tooltip-B0HefZ7r-DsuX4aL4.js b/main/assets/Tooltip-B0HefZ7r-DsuX4aL4.js deleted file mode 100644 index ddc04552a..000000000 --- a/main/assets/Tooltip-B0HefZ7r-DsuX4aL4.js +++ /dev/null @@ -1 +0,0 @@ -import{V as M,H as N,ao as E,ap as F,a as x,e as R,ab as S,a8 as j,n as B,aq as u}from"./Theme-rblUnB2V-BIrfCzYF.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let r=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,b=(r-T)*(i-_)-(o-_)*(t-T),n=(r-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),b>0&&n>0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(l-a,0),s.lineTo(r,o),s.lineTo(l+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),b>0&&n<0){let l=Math.round(u(o,e+a,i-a-e));r=u(r,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(l-a,e)),s.lineTo(r,o),s.lineTo(t,l+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),b<0&&n<0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(l+a,i),s.lineTo(r,o),s.lineTo(l-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),b<0&&n>0){let l=Math.round(u(o,e+a,i-e-a));r=u(r,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,l+a),s.lineTo(r,o),s.lineTo(0,Math.max(l-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,r=[]){super(t,i,e,r),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this._setDefaultFn("background",()=>D.new(this._root,{})).set("themeTags",["tooltip","background"]),this._label=this.children.push(F.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(this._disposers.push(x(t,"pointerover",i=>{this._htmlContentHovered=!0})),this._disposers.push(x(t,"pointerout",i=>{this._htmlContentHovered=!1})))})),this.on("visible",t=>{this._handleReaderAnnouncement()}),this.label.events.on("dataitemchanged",t=>{this._handleReaderAnnouncement()}),this._root._tooltips.push(this)}_handleReaderAnnouncement(){this.get("readerAnnounce")&&this.isVisibleDeep()&&this._root.readerAlert(this.label.getAccessibleText())}get label(){return this._label}_dispose(){super._dispose(),R(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML")),this.get("labelAriaLabel")!=null&&this.label.set("ariaLabel",this.get("labelAriaLabel"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new S([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const r=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:r.event,point:r.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,r;t&&i&&(e=t.get("fill"),r=t.get("stroke"),e==null&&(e=r),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,r=this.get("centerX");r instanceof B&&(i=r.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,b=0;if(_){f=_.x(),b=_.y();const g=_.get("layerMargin");g&&(f+=g.left||0,b+=g.top||0,a+=(g.left||0)+(g.right||0),T+=(g.top||0)+(g.bottom||0))}const n=this.get("bounds",{left:-f,top:-b,right:a-f,bottom:T-b});this._updateBounds();let s=this.width(),l=this.height();s===0&&(s=this._w),l===0&&(l=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,m=this.get("pointerOrientation"),c=this.get("background"),d=0,v=0,y=0;c instanceof D&&(d=c.get("pointerLength",0),v=c.get("strokeWidth",0)/2,y=v,c.set("width",s),c.set("height",l));let C=0,H=0,O=n.right-n.left,L=n.bottom-n.top;m=="horizontal"||m=="left"||m=="right"?(v=0,m=="horizontal"?h>n.left+O/2?(h-=s*(1-i)+d,y*=-1):h+=s*i+d:m=="left"?h+=s*(1-i)+d:(h-=s*i+d,y*=-1)):(y=0,m=="vertical"?p>n.top+l/2+d?p-=l*(1-e)+d:(p+=l*e+d,v*=-1):m=="down"?p-=l*(1-e)+d:(p+=l*e+d,v*=-1)),h=u(h,n.left+s*i,n.left+O-s*(1-i))+y,p=u(p,n.top+l*e,n.top+L-l*(1-e))-v,C=k.x-h+s*i+y,H=k.y-p+l*e-v,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const g=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:g}),this.animate({key:"y",to:p,duration:w,easing:g})}else this.set("x",h),this.set("y",p);c instanceof D&&(c.set("pointerX",C),c.set("pointerY",H)),s>0&&(this._w=s),l>0&&(this._h=l)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as w}; diff --git a/main/assets/TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js b/main/assets/TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js deleted file mode 100644 index e8e922e9d..000000000 --- a/main/assets/TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as i,i as u,aK as y,af as c,g as v,J as m,ac as p,bG as w,e as h,P as S}from"./main-BZaw9FpY.js";import{k as j}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";var s;let o=s=class extends h{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new s({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};e([i({type:[String],json:{write:!0}})],o.prototype,"groupByFields",void 0),e([i({type:Number,json:{write:!0}})],o.prototype,"topCount",void 0),e([i({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),o=s=e([u("esri.rest.support.TopFilter")],o);const R=o;var n;const a=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let t=n=class extends h{constructor(r){super(r),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(S({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};e([i({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],t.prototype,"distance",void 0),e([i({types:c,json:{read:v,write:!0}})],t.prototype,"geometry",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([i({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([i({json:{write:!0}})],t.prototype,"objectIds",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"resultType",void 0),e([i({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnM",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnZ",void 0),e([i({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([p("start"),p("num")],t.prototype,"writeStart",null),e([i({type:String,json:{read:{source:"spatialRel",reader:a.read},write:{target:"spatialRel",writer:a.write}}})],t.prototype,"spatialRelationship",void 0),e([i({type:j,json:{write:!0}})],t.prototype,"timeExtent",void 0),e([i({type:R,json:{write:!0}})],t.prototype,"topFilter",void 0),e([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],t.prototype,"units",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"where",void 0),t=n=e([u("esri.rest.support.TopFeaturesQuery")],t),t.from=w(t);const f=t;export{f as default}; diff --git a/main/assets/TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js b/main/assets/TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js new file mode 100644 index 000000000..94e69d49b --- /dev/null +++ b/main/assets/TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js @@ -0,0 +1 @@ +import{v as e,S as i,i as u,aK as y,af as c,g as v,J as m,ac as p,bG as w,e as h,P as S}from"./main-C7yV2j71.js";import{k as j}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";var s;let o=s=class extends h{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new s({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};e([i({type:[String],json:{write:!0}})],o.prototype,"groupByFields",void 0),e([i({type:Number,json:{write:!0}})],o.prototype,"topCount",void 0),e([i({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),o=s=e([u("esri.rest.support.TopFilter")],o);const R=o;var n;const a=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let t=n=class extends h{constructor(r){super(r),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(S({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};e([i({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],t.prototype,"distance",void 0),e([i({types:c,json:{read:v,write:!0}})],t.prototype,"geometry",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([i({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([i({json:{write:!0}})],t.prototype,"objectIds",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"resultType",void 0),e([i({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnM",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnZ",void 0),e([i({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([p("start"),p("num")],t.prototype,"writeStart",null),e([i({type:String,json:{read:{source:"spatialRel",reader:a.read},write:{target:"spatialRel",writer:a.write}}})],t.prototype,"spatialRelationship",void 0),e([i({type:j,json:{write:!0}})],t.prototype,"timeExtent",void 0),e([i({type:R,json:{write:!0}})],t.prototype,"topFilter",void 0),e([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],t.prototype,"units",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"where",void 0),t=n=e([u("esri.rest.support.TopFeaturesQuery")],t),t.from=w(t);const f=t;export{f as default}; diff --git a/main/assets/TurboLine-CIlsAy5m-BrOlSIM-.js b/main/assets/TurboLine-CIlsAy5m-BrOlSIM-.js deleted file mode 100644 index 59962b14c..000000000 --- a/main/assets/TurboLine-CIlsAy5m-BrOlSIM-.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./libtess-asm-CEhQARv_-C8K5Bmv1.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./libtess-DHRgJTgB-4cw3_oA4.js"])))=>i.map(i=>d[i]); -import{K as bt,_ as wt,bw as pt}from"./main-BZaw9FpY.js";import{i as S,t as D}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{d as Rt}from"./definitions-DJSdSb77-DkoRHaVx.js";const Mt=128e3;let dt=null,gt=null;async function Ot(){return dt||(dt=Ut()),dt}async function Ut(){gt=await(bt("esri-csp-restrictions")?await wt(()=>import("./libtess-asm-CEhQARv_-C8K5Bmv1.js"),__vite__mapDeps([0,1]),import.meta.url).then(x=>x.l):await wt(()=>import("./libtess-DHRgJTgB-4cw3_oA4.js"),__vite__mapDeps([2,1]),import.meta.url).then(x=>x.l)).default({locateFile:x=>pt(`esri/core/libs/libtess/${x}`)})}function It(x,i){const r=Math.max(x.length,Mt);return gt.triangulate(x,i,r)}function Vt(x,i){return x.x===i.x&&x.y===i.y}function kt(x){if(!x)return;const i=x.length;if(i<=1)return;let r=0;for(let v=1;vv){W=!0;const t=(v-E)/T;T=v-E,q=(1-t)*z+t*q,Q=(1-t)*F+t*Q,--j}const o=this._writeVertex(z,F,0,0,b,f,f,-b,0,-1,E),n=this._writeVertex(z,F,0,0,b,f,-f,b,0,1,E);E+=T;const G=this._writeVertex(q,Q,0,0,b,f,f,-b,0,-1,E),e=this._writeVertex(q,Q,0,0,b,f,-f,b,0,1,E);this._writeTriangle(o,n,G),this._writeTriangle(n,G,e),z=q,F=Q}}_tessellate(i,r){const v=i[0],E=i[i.length-1],W=Vt(v,E),z=W?3:2;if(i.length{const O=Nt(o,n,_,c,H,g,R,yt,L,A,h);return u>=0&&l>=0&&O>=0&&Et(u,l,O),u=l,l=O,O};W&&(T=i[i.length-2],t.x=E.x-T.x,t.y=E.y-T.y,C=ft(t),t.x/=C,t.y/=C);let Z=!1;for(let R=0;R_t&&(Z=!0)),Z){const s=(_t-h)/Y;Y=_t-h,T={x:(1-s)*T.x+s*i[R].x,y:(1-s)*T.y+s*i[R].y},--R}else T=i[R];o=T.x,n=T.y;const yt=R<=0&&!Z,H=R===i.length-1;if(yt||(h+=Y),G=H?W?i[1]:null:i[R+1],G?(t.x=G.x-o,t.y=G.y-n,C=ft(t),t.x/=C,t.y/=C):(t.x=void 0,t.y=void 0),!W){if(yt){p(y,t),_=y.x,c=y.y,B===S.SQUARE&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,0,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,0,1)),B===S.ROUND&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,-1,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,-1,1)),B!==S.ROUND&&B!==S.BUTT||(d(-t.y,t.x,t.x,t.y,0,-1),d(t.y,-t.x,t.x,t.y,0,1));continue}if(H){k(y,e),_=y.x,c=y.y,B!==S.ROUND&&B!==S.BUTT||(d(e.y,-e.x,-e.x,-e.y,0,-1),d(-e.y,e.x,-e.x,-e.y,0,1)),B===S.SQUARE&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),B===S.ROUND&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let g,L,A=-Bt(e,t);if(Math.abs(A)<.01)mt(e,t)>0?(y.x=e.x,y.y=e.y,A=1,g=Number.MAX_VALUE,L=!0):(p(y,t),A=1,g=1,L=!1);else{y.x=(e.x+t.x)/A,y.y=(e.y+t.y)/A,g=ft(y);const s=(g-1)*b*F;L=g>4||s>Y&&s>C}_=y.x,c=y.y;let O=j;switch(j){case D.BEVEL:g<1.05&&(O=D.MITER);break;case D.ROUND:gq&&(O=D.BEVEL)}switch(O){case D.MITER:if(d(y.x,y.y,-e.x,-e.y,0,-1),d(-y.x,-y.y,-e.x,-e.y,0,1),H)break;if(f){const s=Z?0:h;u=this._writeVertex(o,n,_,c,t.x,t.y,y.x,y.y,0,-1,s),l=this._writeVertex(o,n,_,c,t.x,t.y,-y.x,-y.y,0,1,s)}break;case D.BEVEL:{const s=A<0;let m,V,K,M;if(s){const a=u;u=l,l=a,m=rt,V=st}else m=st,V=rt;if(L)K=s?p(this._innerPrev,e):k(this._innerPrev,e),M=s?k(this._innerNext,t):p(this._innerNext,t);else{const a=s?vt(this._inner,y):Tt(this._inner,y);K=a,M=a}const U=s?k(this._bevelStart,e):p(this._bevelStart,e);d(K.x,K.y,-e.x,-e.y,m.x,m.y);const nt=d(U.x,U.y,-e.x,-e.y,V.x,V.y);if(H)break;const I=s?p(this._bevelEnd,t):k(this._bevelEnd,t);if(L){const a=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);u=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h),this._writeTriangle(nt,a,l)}else{if(f){const a=this._bevelMiddle;a.x=(U.x+I.x)/2,a.y=(U.y+I.y)/2,et(w,a,-e.x,-e.y),d(a.x,a.y,-e.x,-e.y,w.x,w.y),et(w,a,t.x,t.y),u=this._writeVertex(o,n,_,c,t.x,t.y,a.x,a.y,w.x,w.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h)}else{const a=u;u=l,l=a}d(I.x,I.y,t.x,t.y,V.x,V.y)}if(s){const a=u;u=l,l=a}break}case D.ROUND:{const s=A<0;let m,V;if(s){const N=u;u=l,l=N,m=rt,V=st}else m=st,V=rt;const K=s?vt(this._inner,y):Tt(this._inner,y);let M,U;L?(M=s?p(this._innerPrev,e):k(this._innerPrev,e),U=s?k(this._innerNext,t):p(this._innerNext,t)):(M=K,U=K);const nt=s?k(this._roundStart,e):p(this._roundStart,e),I=s?p(this._roundEnd,t):k(this._roundEnd,t),a=d(M.x,M.y,-e.x,-e.y,m.x,m.y),ot=d(nt.x,nt.y,-e.x,-e.y,V.x,V.y);if(H)break;const X=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);L||this._writeTriangle(u,l,X);const P=vt(this._outer,K),J=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h);let $,tt;const lt=g>2;if(lt){let N;g!==Number.MAX_VALUE?(P.x/=g,P.y/=g,N=mt(e,P),N=(g*(N*N-1)+1)/N):N=-1,$=s?k(this._startBreak,e):p(this._startBreak,e),$.x+=e.x*N,$.y+=e.y*N,tt=s?p(this._endBreak,t):k(this._endBreak,t),tt.x+=t.x*N,tt.y+=t.y*N}et(w,P,-e.x,-e.y);const ht=this._writeVertex(o,n,_,c,-e.x,-e.y,P.x,P.y,w.x,w.y,h);et(w,P,t.x,t.y);const ct=f?this._writeVertex(o,n,_,c,t.x,t.y,P.x,P.y,w.x,w.y,h):ht,ut=X,at=f?this._writeVertex(o,n,_,c,t.x,t.y,0,0,0,0,h):X;let it=-1,xt=-1;if(lt&&(et(w,$,-e.x,-e.y),it=this._writeVertex(o,n,_,c,-e.x,-e.y,$.x,$.y,w.x,w.y,h),et(w,tt,t.x,t.y),xt=this._writeVertex(o,n,_,c,t.x,t.y,tt.x,tt.y,w.x,w.y,h)),f?lt?(this._writeTriangle(ut,ot,it),this._writeTriangle(ut,it,ht),this._writeTriangle(at,ct,xt),this._writeTriangle(at,xt,J)):(this._writeTriangle(ut,ot,ht),this._writeTriangle(at,ct,J)):lt?(this._writeTriangle(X,ot,it),this._writeTriangle(X,it,xt),this._writeTriangle(X,xt,J)):(this._writeTriangle(X,ot,ht),this._writeTriangle(X,ct,J)),L?(u=this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h),l=J):(u=f?this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h):a,this._writeTriangle(u,at,J),l=J),s){const N=u;u=l,l=N}break}}}}}export{Pt as D,Ot as M,It as k}; diff --git a/main/assets/TurboLine-CIlsAy5m-Q2LH92mI.js b/main/assets/TurboLine-CIlsAy5m-Q2LH92mI.js new file mode 100644 index 000000000..46b827197 --- /dev/null +++ b/main/assets/TurboLine-CIlsAy5m-Q2LH92mI.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./libtess-asm-CEhQARv_-C8K5Bmv1.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./libtess-DHRgJTgB-4cw3_oA4.js"])))=>i.map(i=>d[i]); +import{K as bt,_ as wt,bw as pt}from"./main-C7yV2j71.js";import{i as S,t as D}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{d as Rt}from"./definitions-DJSdSb77-DkoRHaVx.js";const Mt=128e3;let dt=null,gt=null;async function Ot(){return dt||(dt=Ut()),dt}async function Ut(){gt=await(bt("esri-csp-restrictions")?await wt(()=>import("./libtess-asm-CEhQARv_-C8K5Bmv1.js"),__vite__mapDeps([0,1]),import.meta.url).then(x=>x.l):await wt(()=>import("./libtess-DHRgJTgB-4cw3_oA4.js"),__vite__mapDeps([2,1]),import.meta.url).then(x=>x.l)).default({locateFile:x=>pt(`esri/core/libs/libtess/${x}`)})}function It(x,i){const r=Math.max(x.length,Mt);return gt.triangulate(x,i,r)}function Vt(x,i){return x.x===i.x&&x.y===i.y}function kt(x){if(!x)return;const i=x.length;if(i<=1)return;let r=0;for(let v=1;vv){W=!0;const t=(v-E)/T;T=v-E,q=(1-t)*z+t*q,Q=(1-t)*F+t*Q,--j}const o=this._writeVertex(z,F,0,0,b,f,f,-b,0,-1,E),n=this._writeVertex(z,F,0,0,b,f,-f,b,0,1,E);E+=T;const G=this._writeVertex(q,Q,0,0,b,f,f,-b,0,-1,E),e=this._writeVertex(q,Q,0,0,b,f,-f,b,0,1,E);this._writeTriangle(o,n,G),this._writeTriangle(n,G,e),z=q,F=Q}}_tessellate(i,r){const v=i[0],E=i[i.length-1],W=Vt(v,E),z=W?3:2;if(i.length{const O=Nt(o,n,_,c,H,g,R,yt,L,A,h);return u>=0&&l>=0&&O>=0&&Et(u,l,O),u=l,l=O,O};W&&(T=i[i.length-2],t.x=E.x-T.x,t.y=E.y-T.y,C=ft(t),t.x/=C,t.y/=C);let Z=!1;for(let R=0;R_t&&(Z=!0)),Z){const s=(_t-h)/Y;Y=_t-h,T={x:(1-s)*T.x+s*i[R].x,y:(1-s)*T.y+s*i[R].y},--R}else T=i[R];o=T.x,n=T.y;const yt=R<=0&&!Z,H=R===i.length-1;if(yt||(h+=Y),G=H?W?i[1]:null:i[R+1],G?(t.x=G.x-o,t.y=G.y-n,C=ft(t),t.x/=C,t.y/=C):(t.x=void 0,t.y=void 0),!W){if(yt){p(y,t),_=y.x,c=y.y,B===S.SQUARE&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,0,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,0,1)),B===S.ROUND&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,-1,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,-1,1)),B!==S.ROUND&&B!==S.BUTT||(d(-t.y,t.x,t.x,t.y,0,-1),d(t.y,-t.x,t.x,t.y,0,1));continue}if(H){k(y,e),_=y.x,c=y.y,B!==S.ROUND&&B!==S.BUTT||(d(e.y,-e.x,-e.x,-e.y,0,-1),d(-e.y,e.x,-e.x,-e.y,0,1)),B===S.SQUARE&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),B===S.ROUND&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let g,L,A=-Bt(e,t);if(Math.abs(A)<.01)mt(e,t)>0?(y.x=e.x,y.y=e.y,A=1,g=Number.MAX_VALUE,L=!0):(p(y,t),A=1,g=1,L=!1);else{y.x=(e.x+t.x)/A,y.y=(e.y+t.y)/A,g=ft(y);const s=(g-1)*b*F;L=g>4||s>Y&&s>C}_=y.x,c=y.y;let O=j;switch(j){case D.BEVEL:g<1.05&&(O=D.MITER);break;case D.ROUND:gq&&(O=D.BEVEL)}switch(O){case D.MITER:if(d(y.x,y.y,-e.x,-e.y,0,-1),d(-y.x,-y.y,-e.x,-e.y,0,1),H)break;if(f){const s=Z?0:h;u=this._writeVertex(o,n,_,c,t.x,t.y,y.x,y.y,0,-1,s),l=this._writeVertex(o,n,_,c,t.x,t.y,-y.x,-y.y,0,1,s)}break;case D.BEVEL:{const s=A<0;let m,V,K,M;if(s){const a=u;u=l,l=a,m=rt,V=st}else m=st,V=rt;if(L)K=s?p(this._innerPrev,e):k(this._innerPrev,e),M=s?k(this._innerNext,t):p(this._innerNext,t);else{const a=s?vt(this._inner,y):Tt(this._inner,y);K=a,M=a}const U=s?k(this._bevelStart,e):p(this._bevelStart,e);d(K.x,K.y,-e.x,-e.y,m.x,m.y);const nt=d(U.x,U.y,-e.x,-e.y,V.x,V.y);if(H)break;const I=s?p(this._bevelEnd,t):k(this._bevelEnd,t);if(L){const a=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);u=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h),this._writeTriangle(nt,a,l)}else{if(f){const a=this._bevelMiddle;a.x=(U.x+I.x)/2,a.y=(U.y+I.y)/2,et(w,a,-e.x,-e.y),d(a.x,a.y,-e.x,-e.y,w.x,w.y),et(w,a,t.x,t.y),u=this._writeVertex(o,n,_,c,t.x,t.y,a.x,a.y,w.x,w.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h)}else{const a=u;u=l,l=a}d(I.x,I.y,t.x,t.y,V.x,V.y)}if(s){const a=u;u=l,l=a}break}case D.ROUND:{const s=A<0;let m,V;if(s){const N=u;u=l,l=N,m=rt,V=st}else m=st,V=rt;const K=s?vt(this._inner,y):Tt(this._inner,y);let M,U;L?(M=s?p(this._innerPrev,e):k(this._innerPrev,e),U=s?k(this._innerNext,t):p(this._innerNext,t)):(M=K,U=K);const nt=s?k(this._roundStart,e):p(this._roundStart,e),I=s?p(this._roundEnd,t):k(this._roundEnd,t),a=d(M.x,M.y,-e.x,-e.y,m.x,m.y),ot=d(nt.x,nt.y,-e.x,-e.y,V.x,V.y);if(H)break;const X=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);L||this._writeTriangle(u,l,X);const P=vt(this._outer,K),J=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h);let $,tt;const lt=g>2;if(lt){let N;g!==Number.MAX_VALUE?(P.x/=g,P.y/=g,N=mt(e,P),N=(g*(N*N-1)+1)/N):N=-1,$=s?k(this._startBreak,e):p(this._startBreak,e),$.x+=e.x*N,$.y+=e.y*N,tt=s?p(this._endBreak,t):k(this._endBreak,t),tt.x+=t.x*N,tt.y+=t.y*N}et(w,P,-e.x,-e.y);const ht=this._writeVertex(o,n,_,c,-e.x,-e.y,P.x,P.y,w.x,w.y,h);et(w,P,t.x,t.y);const ct=f?this._writeVertex(o,n,_,c,t.x,t.y,P.x,P.y,w.x,w.y,h):ht,ut=X,at=f?this._writeVertex(o,n,_,c,t.x,t.y,0,0,0,0,h):X;let it=-1,xt=-1;if(lt&&(et(w,$,-e.x,-e.y),it=this._writeVertex(o,n,_,c,-e.x,-e.y,$.x,$.y,w.x,w.y,h),et(w,tt,t.x,t.y),xt=this._writeVertex(o,n,_,c,t.x,t.y,tt.x,tt.y,w.x,w.y,h)),f?lt?(this._writeTriangle(ut,ot,it),this._writeTriangle(ut,it,ht),this._writeTriangle(at,ct,xt),this._writeTriangle(at,xt,J)):(this._writeTriangle(ut,ot,ht),this._writeTriangle(at,ct,J)):lt?(this._writeTriangle(X,ot,it),this._writeTriangle(X,it,xt),this._writeTriangle(X,xt,J)):(this._writeTriangle(X,ot,ht),this._writeTriangle(X,ct,J)),L?(u=this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h),l=J):(u=f?this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h):a,this._writeTriangle(u,at,J),l=J),s){const N=u;u=l,l=N}break}}}}}export{Pt as D,Ot as M,It as k}; diff --git a/main/assets/UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js b/main/assets/UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js new file mode 100644 index 000000000..f0237f4e6 --- /dev/null +++ b/main/assets/UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js @@ -0,0 +1 @@ +import{v as s,S as l,i as h,aK as x,ad as U,a0 as z,bB as et,aa as be,e as g,ac as H,eo as tt,ep as St,eq as me,er as Ae,d4 as xt,es as st,et as zt,en as le,eu as It,bG as it,a1 as V,ev as Ce,ew as lt,P as f,ex as fe,dL as Re,ey as T,bz as rt,aq as _t,o as at,r as xe,a4 as jt,ez as Ft,eA as qt,ah as we,bC as Et,bD as kt,j as Ot,b0 as Tt}from"./main-C7yV2j71.js";import{h as Ut,w as nt}from"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import{P as Bt}from"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import{g as Mt,v as Dt}from"./colorRamps-q0bZVhs2-DeDskCk_.js";import{r as W,a as Nt,u as $t,i as Ge}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{viewScaleRE as Ct}from"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import{g as Rt}from"./styleUtils-BtpNqZyT-CwQxANzG.js";var ze;let K=ze=class extends g{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new ze({minValue:this.minValue,maxValue:this.maxValue})}};s([l({type:Number,json:{write:!0}})],K.prototype,"minValue",void 0),s([l({type:Number,json:{write:!0}})],K.prototype,"maxValue",void 0),K=ze=s([h("esri.renderers.support.AuthoringInfoClassBreakInfo")],K);var Ie;let O=Ie=class extends g{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=new Array}clone(){return new Ie({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:f(this.classBreakInfos)})}};s([l({type:String,json:{write:!0}})],O.prototype,"field",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"normalizationField",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"label",void 0),s([l({type:[K],json:{write:!0}})],O.prototype,"classBreakInfos",void 0),O=Ie=s([h("esri.renderers.support.AuthoringInfoFieldInfo")],O);var _e;let A=_e=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new _e({label:this.label,value:this.value,size:this.size})}};s([l({type:String,json:{write:!0}})],A.prototype,"label",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"value",void 0),A=_e=s([h("esri.renderers.support.AuthoringInfoSizeStop")],A);const At=A;var je;const re=new x({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),ae=new x({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Le={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},He=["high-to-low","above-and-below","centered-on","extremes"],Pe=[...new Set(["high-to-low","above-and-below","centered-on","extremes","above","below","high-to-low","above-and-below","above","below","reference-size"])],Je=["seconds","minutes","hours","days","months","years"],Gt=["circle","diamond","hexagon-flat","hexagon-pointy","square"];let v=je=class extends g{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return typeof e=="string"||typeof e=="number"?e:null}get normalizationField(){return this.theme==="reference-size"?this._get("normalizationField"):null}set normalizationField(e){this._set("normalizationField",e)}get referenceSizeScale(){return this.theme==="reference-size"?this._get("referenceSizeScale"):null}set referenceSizeScale(e){this._set("referenceSizeScale",e)}get referenceSizeSymbolStyle(){return this.theme==="reference-size"?this._get("referenceSizeSymbolStyle"):null}set referenceSizeSymbolStyle(e){this._set("referenceSizeSymbolStyle",e)}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get sizeStops(){return this.theme==="reference-size"?this._get("sizeStops"):null}set sizeStops(e){this._set("sizeStops",e)}get style(){return this.type==="color"?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new je({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,normalizationField:this.normalizationField,referenceSizeScale:this.referenceSizeScale,referenceSizeSymbolStyle:this.referenceSizeSymbolStyle,sizeStops:f(this.sizeStops),startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};s([l({types:Le,json:{write:!0}})],v.prototype,"endTime",void 0),s([U("endTime")],v.prototype,"castEndTime",null),s([l({type:String,json:{write:!0}})],v.prototype,"field",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"minSliderValue",void 0),s([l({type:String,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"normalizationField",null),s([l({type:Number,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeScale",null),s([l({type:Gt,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeSymbolStyle",null),s([l({types:Le,json:{write:!0}})],v.prototype,"startTime",void 0),s([U("startTime")],v.prototype,"castStartTime",null),s([l({type:[At],json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"sizeStops",null),s([l({type:re.apiValues,value:null,json:{type:re.jsonValues,read:re.read,write:re.write}})],v.prototype,"style",null),s([l({type:Pe,value:null,json:{type:Pe,origins:{"web-scene":{type:He,write:{writer:(e,t)=>{He.includes(e)&&(t.theme=e)}}}},write:!0}})],v.prototype,"theme",null),s([l({type:ae.apiValues,json:{type:ae.jsonValues,read:ae.read,write:ae.write}})],v.prototype,"type",void 0),s([l({type:Je,json:{type:Je,write:!0}})],v.prototype,"units",void 0),v=je=s([h("esri.renderers.support.AuthoringInfoVisualVariable")],v);const Lt=v;var Fe;const B=new x({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),ne=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Ze=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),We=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers"],Ht=["high-to-low","above-and-below","above","below"],Pt=["flow-line","wave-front"],Jt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let d=Fe=class extends g{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&t!=="relationship"?t==="class-breaks-size"||t==="class-breaks-color"?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?Dt(e):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&e!=="relationship"&&e!=="class-breaks-size"&&e!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;e==="classed-size"?t="class-breaks-size":e==="classed-color"&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){return new Fe({classificationMethod:this.classificationMethod,colorRamp:f(this.colorRamp),fadeRatio:f(this.fadeRatio),fields:this.fields?.slice(),field1:f(this.field1),field2:f(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(e=>e.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};s([l({type:B.apiValues,value:null,json:{type:B.jsonValues,read:B.read,write:B.write,origins:{"web-document":{default:"manual",type:B.jsonValues,read:B.read,write:B.write}}}})],d.prototype,"classificationMethod",null),s([l({types:Mt,json:{write:!0}})],d.prototype,"colorRamp",void 0),s([z("colorRamp")],d.prototype,"readColorRamp",null),s([l({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"fadeRatio",void 0),s([l({type:[String],value:null,json:{write:!0}})],d.prototype,"fields",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field1",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field2",null),s([l({type:Pt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"flowTheme",null),s([l({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],d.prototype,"focus",null),s([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],d.prototype,"isAutoGenerated",void 0),s([l({type:Number,value:null,json:{type:et,write:!0}})],d.prototype,"numClasses",null),s([l({type:We,json:{type:We,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],d.prototype,"lengthUnit",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"minSliderValue",void 0),s([l({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"statistics",null),s([l({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],d.prototype,"standardDeviationInterval",null),s([l({type:ne.apiValues,value:null,json:{type:ne.jsonValues,read:ne.read,write:ne.write,origins:{"web-scene":{type:Ze.jsonValues,write:{writer:Ze.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],d.prototype,"type",null),s([l({type:[Lt],json:{write:!0}})],d.prototype,"visualVariables",void 0),s([l({type:Jt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateSymbolStyle",null),s([l({type:Ht,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateTheme",null),d=Fe=s([h("esri.renderers.support.AuthoringInfo")],d);const Zt=d,Ve=new x({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let Q=class extends g{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};s([l({type:Zt,json:{write:!0}})],Q.prototype,"authoringInfo",void 0),s([l({type:Ve.apiValues,readOnly:!0,json:{type:Ve.jsonValues,read:!1,write:{writer:Ve.write,ignoreOrigin:!0}}})],Q.prototype,"type",void 0),Q=s([h("esri.renderers.Renderer")],Q);const ot=Q;function Wt(e){return e.match(Kt)?.[1]?.replace(/\\'/g,"'")??null}const Kt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;let X=class extends be(g){constructor(){super(...arguments),this.showLegend=null,this.title=null}};s([l({type:Boolean,json:{write:!0}})],X.prototype,"showLegend",void 0),s([l({type:String,json:{write:!0}})],X.prototype,"title",void 0),X=s([h("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],X);const ut=X,Se=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let S=class extends g{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};s([l()],S.prototype,"index",void 0),s([l({type:Se.apiValues,readOnly:!0,json:{read:Se.read,write:Se.write}})],S.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"field",void 0),s([U("field")],S.prototype,"castField",null),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpression",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpressionTitle",void 0),s([l({readOnly:!0})],S.prototype,"arcadeRequired",null),s([l({type:ut,json:{write:!0}})],S.prototype,"legendOptions",void 0),S=s([h("esri.renderers.visualVariables.VisualVariable")],S);const se=S;var qe;let M=qe=class extends se{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new qe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],M.prototype,"cache",null),s([l({type:["color"],json:{type:["colorInfo"]}})],M.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],M.prototype,"normalizationField",void 0),s([l({type:[Ut],json:{write:!0}})],M.prototype,"stops",null),M=qe=s([h("esri.renderers.visualVariables.ColorVariable")],M);const pt=M;var Ee;let F=Ee=class extends g{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return Et(t.transparency)}writeOpacity(e,t,i){t[i]=kt(e)}clone(){return new Ee({label:this.label,opacity:this.opacity,value:this.value})}};s([l({type:String,json:{write:!0}})],F.prototype,"label",void 0),s([l({type:Number,json:{type:et,write:{target:"transparency"}}})],F.prototype,"opacity",void 0),s([z("opacity",["transparency"])],F.prototype,"readOpacity",null),s([H("opacity")],F.prototype,"writeOpacity",null),s([l({type:Number,json:{write:!0}})],F.prototype,"value",void 0),F=Ee=s([h("esri.renderers.visualVariables.support.OpacityStop")],F);const Qt=F;var ke;let D=ke=class extends se{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new ke({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],D.prototype,"cache",null),s([l({type:["opacity"],json:{type:["transparencyInfo"]}})],D.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],D.prototype,"normalizationField",void 0),s([l({type:[Qt],json:{write:!0}})],D.prototype,"stops",null),D=ke=s([h("esri.renderers.visualVariables.OpacityVariable")],D);const ht=D;var Oe;let N=Oe=class extends se{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic"}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}clone(){return new Oe({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};s([l({readOnly:!0})],N.prototype,"cache",null),s([l({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],N.prototype,"axis",void 0),s([l({type:["rotation"],json:{type:["rotationInfo"]}})],N.prototype,"type",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],N.prototype,"rotationType",void 0),N=Oe=s([h("esri.renderers.visualVariables.RotationVariable")],N);const dt=N;function Xt(e){return tt(e)}var Te;let q=Te=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new Te({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};s([l({type:String,json:{write:!0}})],q.prototype,"label",void 0),s([l({type:Number,cast:tt,json:{write:!0}})],q.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],q.prototype,"value",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMinValue",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMaxValue",void 0),q=Te=s([h("esri.renderers.visualVariables.support.SizeStop")],q);const Yt=q;let pe=class extends ut{constructor(){super(...arguments),this.customValues=null}};s([l({type:[Number],json:{write:!0}})],pe.prototype,"customValues",void 0),pe=s([h("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],pe);const es=pe;var Ue;const oe=new x({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),Be=new x({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function Ke(e){if(e!=null)return typeof e=="string"||typeof e=="number"?Xt(e):e.type==="size"?W(e)?e:(delete(e={...e}).type,new o(e)):void 0}function Qe(e,t,i){if(typeof e!="object")return e;const r=new o;return r.read(e,i),r}let o=Ue=class extends se{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&Ct.test(this.valueExpression)}}set index(e){W(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),W(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return Nt(this)}set maxDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return Ke(e)}readMaxSize(e,t,i){return Qe(e,t,i)}set minDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return Ke(e)}readMinSize(e,t,i){return Qe(e,t,i)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(e){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value):e&&(V.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return $t(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,r){if(e==="$view.scale"){if(r?.messages){const a=this.index,n=typeof a=="string"?a:`visualVariables[${a}]`;r.messages.push(new at("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpression",context:r}))}}else t[i]=e}readValueUnit(e){return e?Be.read(e):null}clone(){return new Ue({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:W(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:W(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===Ge.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===Ge.Stops){const e=this.stops;if(!e)return this;const t=e.map(r=>r.size).reverse(),i=e.length;for(let r=0;re.value||0)}};s([l({readOnly:!0})],o.prototype,"cache",null),s([l({type:oe.apiValues,json:{type:oe.jsonValues,origins:{"web-map":{read:!1}},read:oe.read,write:oe.write}})],o.prototype,"axis",void 0),s([l()],o.prototype,"index",null),s([l({type:String,readOnly:!0})],o.prototype,"inputValueType",null),s([l({type:es,json:{write:!0}})],o.prototype,"legendOptions",void 0),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxSize",null),s([U("maxSize")],o.prototype,"castMaxSize",null),s([z("maxSize")],o.prototype,"readMaxSize",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minSize",null),s([U("minSize")],o.prototype,"castMinSize",null),s([z("minSize")],o.prototype,"readMinSize",null),s([l({type:String,json:{write:!0}})],o.prototype,"normalizationField",void 0),s([l({readOnly:!0})],o.prototype,"arcadeRequired",null),s([l({type:String})],o.prototype,"scaleBy",void 0),s([l({type:[Yt],value:null,json:{write:!0}})],o.prototype,"stops",null),s([l({type:["outline"],json:{write:!0}})],o.prototype,"target",void 0),s([l({type:String,readOnly:!0})],o.prototype,"transformationType",null),s([l({type:["size"],json:{type:["sizeInfo"]}})],o.prototype,"type",void 0),s([l({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],o.prototype,"useSymbolValue",void 0),s([l({type:String,json:{write:!0}})],o.prototype,"valueExpression",void 0),s([z("valueExpression",["valueExpression","expression"])],o.prototype,"readValueExpression",null),s([H("web-scene","valueExpression")],o.prototype,"writeValueExpressionWebScene",null),s([l({type:["radius","diameter","area","width","distance"],json:{write:!0}})],o.prototype,"valueRepresentation",void 0),s([l({type:Be.apiValues,json:{write:Be.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],o.prototype,"valueUnit",void 0),s([z("valueUnit")],o.prototype,"readValueUnit",null),o=Ue=s([h("esri.renderers.visualVariables.SizeVariable")],o);const ct=o,ts={color:pt,size:ct,opacity:ht,rotation:dt},ss=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),is=/^\[([^\]]+)\]$/i;let he=class extends Ot{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),e=e?.filter(t=>!!t),e?.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some(t=>!!t.target)&&e.sort((t,i)=>{let r=null;return r=t.target===i.target?0:t.target?1:-1,r});for(let t=0;t{const c=ss.read(y.type),b=ts[c];b||(V.getLogger(this).warn(`Unknown variable type: ${c}`),i?.messages&&i.messages.push(new Tt("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:y,context:i})));const w=new b;return w.read(y,i),w})}writeVariables(e,t){const i=[];for(const r of e){const a=r.toJSON(t);a&&i.push(a)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};s([l()],he.prototype,"visualVariables",null),he=s([h("esri.renderers.visualVariables.VisualVariableFactory")],he);const ls=he,rs={base:se,key:"type",typeMap:{opacity:ht,color:pt,rotation:dt,size:ct}},yt=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new ls}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,a){return this._vvFactory.readVariables(i,r,a)}writeVisualVariables(i,r,a,n){r[a]=this._vvFactory.writeVariables(i,n)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,r){return i?this.getVisualVariablesForType(i,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(i,r){const a=this.visualVariables;return a?a.filter(n=>n.type===i&&(typeof r=="string"?n.target===r:r!==!1||!n.target)):[]}async collectVVRequiredFields(i,r){let a=[];this.visualVariables&&(a=a.concat(this.visualVariables));for(const n of a)n&&(n.field&&T(i,r,n.field),n.normalizationField&&T(i,r,n.normalizationField),n.valueExpression&&(as(n.valueExpression,i,r)||await Re(i,r,n.valueExpression)))}};return s([l({types:[rs],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),s([z("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),s([H("visualVariables")],t.prototype,"writeVisualVariables",null),t=s([h("esri.renderers.mixins.VisualVariablesMixin")],t),t};function as(e,t,i){const r=Wt(e);return r!=null&&(T(t,i,r),!0)}const ge={types:St,json:{write:{writer:me},origins:{"web-scene":{types:Ae,write:{writer:me},read:{reader:xt({types:Ae})}}}}},mt=st({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},ge),ft={types:{base:zt,key:"type",typeMap:{"simple-fill":le.typeMap["simple-fill"],"picture-fill":le.typeMap["picture-fill"],"polygon-3d":le.typeMap["polygon-3d"],cim:le.typeMap.cim}},json:{write:{writer:me},origins:{"web-scene":{type:It,write:{writer:me}}}}},de={cast:e=>e==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e?.toString()}}}};var Me;let E=Me=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Me({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};s([l({type:String,json:{write:!0}})],E.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],E.prototype,"label",void 0),s([l({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],E.prototype,"minValue",void 0),s([l({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],E.prototype,"maxValue",void 0),s([l(mt)],E.prototype,"symbol",void 0),E=Me=s([h("esri.renderers.support.ClassBreakInfo")],E);const ve=E;var De;const vt="log",ce="percent-of-total",ye="field",ue=new x({esriNormalizeByLog:vt,esriNormalizeByPercentOfTotal:ce,esriNormalizeByField:ye}),ns=it(ve);let m=De=class extends yt(ot){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,i){if(!Array.isArray(e))return;let r=t.minValue;return e.map(a=>{const n=new ve;return n.read(a,i),n.minValue==null&&(n.minValue=r),n.maxValue==null&&(n.maxValue=n.minValue),r=n.maxValue,n})}writeClassBreakInfos(e,t,i,r){const a=e.map(n=>n.write({},r));this._areClassBreaksConsecutive()&&a.forEach(n=>delete n.classMinValue),t[i]=a}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=this.normalizationTotal!=null;return t||i?(e=t&&ye||i&&ce||null,t&&i&&V.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==ye&&e!==ce||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let r=null;r=typeof e=="number"?new ve({minValue:e,maxValue:t,symbol:lt(i)}):ns(f(e)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&t?.arcade==null){const a=await fe(),{arcadeUtils:n}=a;n.hasGeometryOperations(this.valueExpression)&&await n.enableGeometryOperations(),i={...i,arcade:a}}const r=this.getBreakIndex(e,i);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(t=>{t.symbol&&e.push(t.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce((r,a)=>r+a.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new De({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:f(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo)})}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{},{valueExpression:y}=this;let c=this._compiledValueExpression.valueExpression===y?this._compiledValueExpression.compiledFunction:null;const b=n.arcadeUtils;if(!c){const I=b.createSyntaxTree(y);c=b.createFunction(I),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=y;const w=b.executeFunction(c,b.createExecContext(e,b.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._getBreakIndexfromInfos(w)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,r=this.normalizationType;let a=parseFloat(i[t]);if(r){const n=this.normalizationTotal,u=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===vt)a=Math.log(a)*Math.LOG10E;else if(r!==ce||n==null||isNaN(n)){if(r===ye&&!isNaN(u)){if(isNaN(a)||isNaN(u))return-1;a/=u}}else a=a/n*100}return this._getBreakIndexfromInfos(a)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let i=0;inew L({value:i})):t==="object"?e[0]instanceof L?e:e.map(i=>new L(i)):null}};s([l({type:String,json:{write:!0}})],k.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],k.prototype,"label",void 0),s([l(ge)],k.prototype,"symbol",void 0),s([l({type:[L],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new L({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const i=[];for(const r of e){const a=[r.value,r.value2,r.value3].filter(_t).map(n=>n.toString());i.push(a)}t.values=i}}}})],k.prototype,"values",void 0),s([U("values")],k.prototype,"castValues",null),k=s([h("esri.renderers.support.UniqueValueClass")],k);const bt=k;let Y=class extends be(g){constructor(e){super(e),this.heading=null,this.classes=null}};s([l({type:String,json:{write:!0}})],Y.prototype,"heading",void 0),s([l({type:[bt],json:{write:!0}})],Y.prototype,"classes",void 0),Y=s([h("esri.renderers.support.UniqueValueGroup")],Y);const Ne=Y;var $e;let $=$e=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new $e({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${e}`}};s([l({type:String,json:{write:!0}})],$.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],$.prototype,"label",void 0),s([l(mt)],$.prototype,"symbol",void 0),s([l(de)],$.prototype,"value",void 0),$=$e=s([h("esri.renderers.support.UniqueValueInfo")],$);const te=$;var ee;const gt="esri.renderers.UniqueValueRenderer",j=()=>V.getLogger(gt),Xe="uvInfos-watcher",Ye="uvGroups-watcher",os=",",us=it(te);function ps(e){const{field1:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueInfos:n,valueExpression:u}=e,y=!(!t||!i);return[{classes:(n??[]).map(c=>{const{symbol:b,label:w,value:I,description:C}=c,[P,J,Z]=y?I?.toString()?.split(a||"")||[]:[I],_=[];return(t||u)&&_.push(P),i&&_.push(J),r&&_.push(Z),{symbol:b,label:w,values:[_],description:C}})}]}function R(e){return e!=null&&e!==""&&(typeof e!="string"||e.trim()!==""&&e.toLowerCase()!=="")||(e=null),e+""}let p=ee=class extends yt(ot){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(t,i){if(!t&&!i)return;if(!t||!i)return{type:"complete",oldValue:t,newValue:i};let r=!1;const a={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let n=0;ny.value===i[n].value);u?Bt(u,i[n])?(a.changed.push({type:"complete",oldValue:u,newValue:i[n]}),r=!0):a.unchanged.push({oldValue:u,newValue:i[n]}):(a.added.push(i[n]),r=!0)}for(let n=0;nu.value===t[n].value)||(a.removed.push(t[n]),r=!0);return r?a:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:Ce(e)}writeField(e,t,i,r){typeof e=="string"?t[i]=e:r?.messages?r.messages.push(new at("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):j().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,i){return i.portal||xe.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const r=jt(t.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(e,t,i,r){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Ft(e.styleUrl,r))}set uniqueValueGroups(e){this.styleOrigin?j().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?j().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){if(this.styleOrigin)return void j().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof e=="object"?us(e):new te({value:e,symbol:lt(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[R(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void j().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let i=0;ie+t.getAttributeHash(),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce((r,a)=>r+a.getMeshHash(),"");return`${e}.${t}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new ee({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:f(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo),backgroundFillSymbol:f(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=f(this.uniqueValueInfos),i=f(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(f(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.field2),T(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return Rt(this.styleOrigin,{portal:this.portal}).then(e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach(i=>{const r=new qt({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const a=new te({value:i.name,symbol:r});t.push(a),this._valueInfoMap[R(i.name)]=a}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",os)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[R(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(Xe);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push(we(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,a)=>{r!==a&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,Xe)}}_watchUniqueValueGroups(){this.removeHandles(Ye);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push(we(()=>({classes:i.classes}),(r,a)=>{r!==a&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])t.push(we(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(a,n)=>{a!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,Ye)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueGroups:n,valueExpression:u}=this;if(!t&&!u)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const y=!(!t||!i);for(const c of n)for(const b of c.classes??[]){const{symbol:w,label:I,values:C,description:P}=b;for(const J of C??[]){const{value:Z,value2:_,value3:wt}=J,ie=[Z];i&&ie.push(_),r&&ie.push(wt);const Vt=y?ie.join(a||""):ie[0]??void 0;e.push(new te({symbol:w,label:I,value:Vt,description:P}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:i,valueExpression:r,fieldDelimiter:a,uniqueValueInfos:n}=this;if(!t&&!r||!n.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const u=!(!t||!i),y=n.map(b=>{const{symbol:w,label:I,value:C,description:P}=b,[J,Z,_]=u?C?.toString()?.split(a||"")||[]:[C];return new bt({symbol:w,label:I,description:P,values:[new L({value:J,value2:Z,value3:_})]})}),c=[new Ne({classes:y})];e&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{};let y=this._cache.compiledFunc;const c=n.arcadeUtils;if(!y){const w=c.createSyntaxTree(this.valueExpression);y=c.createFunction(w),this._cache.compiledFunc=y}const b=c.executeFunction(y,c.createExecContext(e,c.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._valueInfoMap[R(b)]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let r;if(this.field2){const a=this.field2,n=this.field3,u=[];t&&u.push(i[t]),a&&u.push(i[a]),n&&u.push(i[n]),r=u.join(this.fieldDelimiter||"")}else t&&(r=i[t]);return this._valueInfoMap[R(r)]}static fromPortalStyle(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||xe.getDefault());const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",a)}),r}static fromStyleUrl(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",a)}),r}};s([l({readOnly:!0})],p.prototype,"_cache",null),s([rt({uniqueValue:"unique-value"})],p.prototype,"type",void 0),s([l(ft)],p.prototype,"backgroundFillSymbol",void 0),s([l({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],p.prototype,"field",null),s([U("field")],p.prototype,"castField",null),s([H("field")],p.prototype,"writeField",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field2",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field3",null),s([l({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"orderByClassesEnabled",void 0),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"valueExpression",null),s([l({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),s([l({type:nt,json:{write:!0}})],p.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),s([l(st({...ge},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],p.prototype,"defaultSymbol",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"fieldDelimiter",null),s([l({type:xe,readOnly:!0})],p.prototype,"portal",void 0),s([z("portal",["styleName"])],p.prototype,"readPortal",null),s([l({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],p.prototype,"styleOrigin",void 0),s([z("styleOrigin",["styleName","styleUrl"])],p.prototype,"readStyleOrigin",null),s([H("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],p.prototype,"writeStyleOrigin",null),s([l({type:[Ne],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||ps(t)).map(r=>Ne.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueGroups",null),s([l({type:[te],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueInfos",null),p=ee=s([h(gt)],p);const gs=p;export{yt as $,mt as A,ht as B,ot as E,ct as G,ft as L,dt as M,te as P,se as a,gs as d,Zt as h,bs as o,ve as t,Yt as y}; diff --git a/main/assets/UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js b/main/assets/UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js deleted file mode 100644 index f6a067ae9..000000000 --- a/main/assets/UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js +++ /dev/null @@ -1 +0,0 @@ -import{v as s,S as l,i as h,aK as x,ad as U,a0 as z,bB as et,aa as be,e as g,ac as H,eo as tt,ep as St,eq as me,er as Ae,d4 as xt,es as st,et as zt,en as le,eu as It,bG as it,a1 as V,ev as Ce,ew as lt,P as f,ex as fe,dL as Re,ey as T,bz as rt,aq as _t,o as at,r as xe,a4 as jt,ez as Ft,eA as qt,ah as we,bC as Et,bD as kt,j as Ot,b0 as Tt}from"./main-BZaw9FpY.js";import{h as Ut,w as nt}from"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import{P as Bt}from"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import{g as Mt,v as Dt}from"./colorRamps-q0bZVhs2-Bqen3nIx.js";import{r as W,a as Nt,u as $t,i as Ge}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{viewScaleRE as Ct}from"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import{g as Rt}from"./styleUtils-BtpNqZyT-B-RFL3S3.js";var ze;let K=ze=class extends g{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new ze({minValue:this.minValue,maxValue:this.maxValue})}};s([l({type:Number,json:{write:!0}})],K.prototype,"minValue",void 0),s([l({type:Number,json:{write:!0}})],K.prototype,"maxValue",void 0),K=ze=s([h("esri.renderers.support.AuthoringInfoClassBreakInfo")],K);var Ie;let O=Ie=class extends g{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=new Array}clone(){return new Ie({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:f(this.classBreakInfos)})}};s([l({type:String,json:{write:!0}})],O.prototype,"field",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"normalizationField",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"label",void 0),s([l({type:[K],json:{write:!0}})],O.prototype,"classBreakInfos",void 0),O=Ie=s([h("esri.renderers.support.AuthoringInfoFieldInfo")],O);var _e;let A=_e=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new _e({label:this.label,value:this.value,size:this.size})}};s([l({type:String,json:{write:!0}})],A.prototype,"label",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"value",void 0),A=_e=s([h("esri.renderers.support.AuthoringInfoSizeStop")],A);const At=A;var je;const re=new x({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),ae=new x({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Le={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},He=["high-to-low","above-and-below","centered-on","extremes"],Pe=[...new Set(["high-to-low","above-and-below","centered-on","extremes","above","below","high-to-low","above-and-below","above","below","reference-size"])],Je=["seconds","minutes","hours","days","months","years"],Gt=["circle","diamond","hexagon-flat","hexagon-pointy","square"];let v=je=class extends g{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return typeof e=="string"||typeof e=="number"?e:null}get normalizationField(){return this.theme==="reference-size"?this._get("normalizationField"):null}set normalizationField(e){this._set("normalizationField",e)}get referenceSizeScale(){return this.theme==="reference-size"?this._get("referenceSizeScale"):null}set referenceSizeScale(e){this._set("referenceSizeScale",e)}get referenceSizeSymbolStyle(){return this.theme==="reference-size"?this._get("referenceSizeSymbolStyle"):null}set referenceSizeSymbolStyle(e){this._set("referenceSizeSymbolStyle",e)}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get sizeStops(){return this.theme==="reference-size"?this._get("sizeStops"):null}set sizeStops(e){this._set("sizeStops",e)}get style(){return this.type==="color"?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new je({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,normalizationField:this.normalizationField,referenceSizeScale:this.referenceSizeScale,referenceSizeSymbolStyle:this.referenceSizeSymbolStyle,sizeStops:f(this.sizeStops),startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};s([l({types:Le,json:{write:!0}})],v.prototype,"endTime",void 0),s([U("endTime")],v.prototype,"castEndTime",null),s([l({type:String,json:{write:!0}})],v.prototype,"field",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"minSliderValue",void 0),s([l({type:String,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"normalizationField",null),s([l({type:Number,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeScale",null),s([l({type:Gt,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeSymbolStyle",null),s([l({types:Le,json:{write:!0}})],v.prototype,"startTime",void 0),s([U("startTime")],v.prototype,"castStartTime",null),s([l({type:[At],json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"sizeStops",null),s([l({type:re.apiValues,value:null,json:{type:re.jsonValues,read:re.read,write:re.write}})],v.prototype,"style",null),s([l({type:Pe,value:null,json:{type:Pe,origins:{"web-scene":{type:He,write:{writer:(e,t)=>{He.includes(e)&&(t.theme=e)}}}},write:!0}})],v.prototype,"theme",null),s([l({type:ae.apiValues,json:{type:ae.jsonValues,read:ae.read,write:ae.write}})],v.prototype,"type",void 0),s([l({type:Je,json:{type:Je,write:!0}})],v.prototype,"units",void 0),v=je=s([h("esri.renderers.support.AuthoringInfoVisualVariable")],v);const Lt=v;var Fe;const B=new x({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),ne=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Ze=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),We=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers"],Ht=["high-to-low","above-and-below","above","below"],Pt=["flow-line","wave-front"],Jt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let d=Fe=class extends g{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&t!=="relationship"?t==="class-breaks-size"||t==="class-breaks-color"?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?Dt(e):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&e!=="relationship"&&e!=="class-breaks-size"&&e!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;e==="classed-size"?t="class-breaks-size":e==="classed-color"&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){return new Fe({classificationMethod:this.classificationMethod,colorRamp:f(this.colorRamp),fadeRatio:f(this.fadeRatio),fields:this.fields?.slice(),field1:f(this.field1),field2:f(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(e=>e.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};s([l({type:B.apiValues,value:null,json:{type:B.jsonValues,read:B.read,write:B.write,origins:{"web-document":{default:"manual",type:B.jsonValues,read:B.read,write:B.write}}}})],d.prototype,"classificationMethod",null),s([l({types:Mt,json:{write:!0}})],d.prototype,"colorRamp",void 0),s([z("colorRamp")],d.prototype,"readColorRamp",null),s([l({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"fadeRatio",void 0),s([l({type:[String],value:null,json:{write:!0}})],d.prototype,"fields",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field1",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field2",null),s([l({type:Pt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"flowTheme",null),s([l({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],d.prototype,"focus",null),s([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],d.prototype,"isAutoGenerated",void 0),s([l({type:Number,value:null,json:{type:et,write:!0}})],d.prototype,"numClasses",null),s([l({type:We,json:{type:We,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],d.prototype,"lengthUnit",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"minSliderValue",void 0),s([l({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"statistics",null),s([l({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],d.prototype,"standardDeviationInterval",null),s([l({type:ne.apiValues,value:null,json:{type:ne.jsonValues,read:ne.read,write:ne.write,origins:{"web-scene":{type:Ze.jsonValues,write:{writer:Ze.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],d.prototype,"type",null),s([l({type:[Lt],json:{write:!0}})],d.prototype,"visualVariables",void 0),s([l({type:Jt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateSymbolStyle",null),s([l({type:Ht,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateTheme",null),d=Fe=s([h("esri.renderers.support.AuthoringInfo")],d);const Zt=d,Ve=new x({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let Q=class extends g{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};s([l({type:Zt,json:{write:!0}})],Q.prototype,"authoringInfo",void 0),s([l({type:Ve.apiValues,readOnly:!0,json:{type:Ve.jsonValues,read:!1,write:{writer:Ve.write,ignoreOrigin:!0}}})],Q.prototype,"type",void 0),Q=s([h("esri.renderers.Renderer")],Q);const ot=Q;function Wt(e){return e.match(Kt)?.[1]?.replace(/\\'/g,"'")??null}const Kt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;let X=class extends be(g){constructor(){super(...arguments),this.showLegend=null,this.title=null}};s([l({type:Boolean,json:{write:!0}})],X.prototype,"showLegend",void 0),s([l({type:String,json:{write:!0}})],X.prototype,"title",void 0),X=s([h("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],X);const ut=X,Se=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let S=class extends g{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};s([l()],S.prototype,"index",void 0),s([l({type:Se.apiValues,readOnly:!0,json:{read:Se.read,write:Se.write}})],S.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"field",void 0),s([U("field")],S.prototype,"castField",null),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpression",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpressionTitle",void 0),s([l({readOnly:!0})],S.prototype,"arcadeRequired",null),s([l({type:ut,json:{write:!0}})],S.prototype,"legendOptions",void 0),S=s([h("esri.renderers.visualVariables.VisualVariable")],S);const se=S;var qe;let M=qe=class extends se{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new qe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],M.prototype,"cache",null),s([l({type:["color"],json:{type:["colorInfo"]}})],M.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],M.prototype,"normalizationField",void 0),s([l({type:[Ut],json:{write:!0}})],M.prototype,"stops",null),M=qe=s([h("esri.renderers.visualVariables.ColorVariable")],M);const pt=M;var Ee;let F=Ee=class extends g{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return Et(t.transparency)}writeOpacity(e,t,i){t[i]=kt(e)}clone(){return new Ee({label:this.label,opacity:this.opacity,value:this.value})}};s([l({type:String,json:{write:!0}})],F.prototype,"label",void 0),s([l({type:Number,json:{type:et,write:{target:"transparency"}}})],F.prototype,"opacity",void 0),s([z("opacity",["transparency"])],F.prototype,"readOpacity",null),s([H("opacity")],F.prototype,"writeOpacity",null),s([l({type:Number,json:{write:!0}})],F.prototype,"value",void 0),F=Ee=s([h("esri.renderers.visualVariables.support.OpacityStop")],F);const Qt=F;var ke;let D=ke=class extends se{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new ke({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],D.prototype,"cache",null),s([l({type:["opacity"],json:{type:["transparencyInfo"]}})],D.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],D.prototype,"normalizationField",void 0),s([l({type:[Qt],json:{write:!0}})],D.prototype,"stops",null),D=ke=s([h("esri.renderers.visualVariables.OpacityVariable")],D);const ht=D;var Oe;let N=Oe=class extends se{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic"}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}clone(){return new Oe({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};s([l({readOnly:!0})],N.prototype,"cache",null),s([l({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],N.prototype,"axis",void 0),s([l({type:["rotation"],json:{type:["rotationInfo"]}})],N.prototype,"type",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],N.prototype,"rotationType",void 0),N=Oe=s([h("esri.renderers.visualVariables.RotationVariable")],N);const dt=N;function Xt(e){return tt(e)}var Te;let q=Te=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new Te({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};s([l({type:String,json:{write:!0}})],q.prototype,"label",void 0),s([l({type:Number,cast:tt,json:{write:!0}})],q.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],q.prototype,"value",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMinValue",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMaxValue",void 0),q=Te=s([h("esri.renderers.visualVariables.support.SizeStop")],q);const Yt=q;let pe=class extends ut{constructor(){super(...arguments),this.customValues=null}};s([l({type:[Number],json:{write:!0}})],pe.prototype,"customValues",void 0),pe=s([h("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],pe);const es=pe;var Ue;const oe=new x({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),Be=new x({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function Ke(e){if(e!=null)return typeof e=="string"||typeof e=="number"?Xt(e):e.type==="size"?W(e)?e:(delete(e={...e}).type,new o(e)):void 0}function Qe(e,t,i){if(typeof e!="object")return e;const r=new o;return r.read(e,i),r}let o=Ue=class extends se{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&Ct.test(this.valueExpression)}}set index(e){W(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),W(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return Nt(this)}set maxDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return Ke(e)}readMaxSize(e,t,i){return Qe(e,t,i)}set minDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return Ke(e)}readMinSize(e,t,i){return Qe(e,t,i)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(e){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value):e&&(V.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return $t(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,r){if(e==="$view.scale"){if(r?.messages){const a=this.index,n=typeof a=="string"?a:`visualVariables[${a}]`;r.messages.push(new at("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpression",context:r}))}}else t[i]=e}readValueUnit(e){return e?Be.read(e):null}clone(){return new Ue({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:W(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:W(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===Ge.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===Ge.Stops){const e=this.stops;if(!e)return this;const t=e.map(r=>r.size).reverse(),i=e.length;for(let r=0;re.value||0)}};s([l({readOnly:!0})],o.prototype,"cache",null),s([l({type:oe.apiValues,json:{type:oe.jsonValues,origins:{"web-map":{read:!1}},read:oe.read,write:oe.write}})],o.prototype,"axis",void 0),s([l()],o.prototype,"index",null),s([l({type:String,readOnly:!0})],o.prototype,"inputValueType",null),s([l({type:es,json:{write:!0}})],o.prototype,"legendOptions",void 0),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxSize",null),s([U("maxSize")],o.prototype,"castMaxSize",null),s([z("maxSize")],o.prototype,"readMaxSize",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minSize",null),s([U("minSize")],o.prototype,"castMinSize",null),s([z("minSize")],o.prototype,"readMinSize",null),s([l({type:String,json:{write:!0}})],o.prototype,"normalizationField",void 0),s([l({readOnly:!0})],o.prototype,"arcadeRequired",null),s([l({type:String})],o.prototype,"scaleBy",void 0),s([l({type:[Yt],value:null,json:{write:!0}})],o.prototype,"stops",null),s([l({type:["outline"],json:{write:!0}})],o.prototype,"target",void 0),s([l({type:String,readOnly:!0})],o.prototype,"transformationType",null),s([l({type:["size"],json:{type:["sizeInfo"]}})],o.prototype,"type",void 0),s([l({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],o.prototype,"useSymbolValue",void 0),s([l({type:String,json:{write:!0}})],o.prototype,"valueExpression",void 0),s([z("valueExpression",["valueExpression","expression"])],o.prototype,"readValueExpression",null),s([H("web-scene","valueExpression")],o.prototype,"writeValueExpressionWebScene",null),s([l({type:["radius","diameter","area","width","distance"],json:{write:!0}})],o.prototype,"valueRepresentation",void 0),s([l({type:Be.apiValues,json:{write:Be.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],o.prototype,"valueUnit",void 0),s([z("valueUnit")],o.prototype,"readValueUnit",null),o=Ue=s([h("esri.renderers.visualVariables.SizeVariable")],o);const ct=o,ts={color:pt,size:ct,opacity:ht,rotation:dt},ss=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),is=/^\[([^\]]+)\]$/i;let he=class extends Ot{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),e=e?.filter(t=>!!t),e?.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some(t=>!!t.target)&&e.sort((t,i)=>{let r=null;return r=t.target===i.target?0:t.target?1:-1,r});for(let t=0;t{const c=ss.read(y.type),b=ts[c];b||(V.getLogger(this).warn(`Unknown variable type: ${c}`),i?.messages&&i.messages.push(new Tt("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:y,context:i})));const w=new b;return w.read(y,i),w})}writeVariables(e,t){const i=[];for(const r of e){const a=r.toJSON(t);a&&i.push(a)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};s([l()],he.prototype,"visualVariables",null),he=s([h("esri.renderers.visualVariables.VisualVariableFactory")],he);const ls=he,rs={base:se,key:"type",typeMap:{opacity:ht,color:pt,rotation:dt,size:ct}},yt=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new ls}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,a){return this._vvFactory.readVariables(i,r,a)}writeVisualVariables(i,r,a,n){r[a]=this._vvFactory.writeVariables(i,n)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,r){return i?this.getVisualVariablesForType(i,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(i,r){const a=this.visualVariables;return a?a.filter(n=>n.type===i&&(typeof r=="string"?n.target===r:r!==!1||!n.target)):[]}async collectVVRequiredFields(i,r){let a=[];this.visualVariables&&(a=a.concat(this.visualVariables));for(const n of a)n&&(n.field&&T(i,r,n.field),n.normalizationField&&T(i,r,n.normalizationField),n.valueExpression&&(as(n.valueExpression,i,r)||await Re(i,r,n.valueExpression)))}};return s([l({types:[rs],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),s([z("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),s([H("visualVariables")],t.prototype,"writeVisualVariables",null),t=s([h("esri.renderers.mixins.VisualVariablesMixin")],t),t};function as(e,t,i){const r=Wt(e);return r!=null&&(T(t,i,r),!0)}const ge={types:St,json:{write:{writer:me},origins:{"web-scene":{types:Ae,write:{writer:me},read:{reader:xt({types:Ae})}}}}},mt=st({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},ge),ft={types:{base:zt,key:"type",typeMap:{"simple-fill":le.typeMap["simple-fill"],"picture-fill":le.typeMap["picture-fill"],"polygon-3d":le.typeMap["polygon-3d"],cim:le.typeMap.cim}},json:{write:{writer:me},origins:{"web-scene":{type:It,write:{writer:me}}}}},de={cast:e=>e==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e?.toString()}}}};var Me;let E=Me=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Me({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};s([l({type:String,json:{write:!0}})],E.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],E.prototype,"label",void 0),s([l({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],E.prototype,"minValue",void 0),s([l({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],E.prototype,"maxValue",void 0),s([l(mt)],E.prototype,"symbol",void 0),E=Me=s([h("esri.renderers.support.ClassBreakInfo")],E);const ve=E;var De;const vt="log",ce="percent-of-total",ye="field",ue=new x({esriNormalizeByLog:vt,esriNormalizeByPercentOfTotal:ce,esriNormalizeByField:ye}),ns=it(ve);let m=De=class extends yt(ot){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,i){if(!Array.isArray(e))return;let r=t.minValue;return e.map(a=>{const n=new ve;return n.read(a,i),n.minValue==null&&(n.minValue=r),n.maxValue==null&&(n.maxValue=n.minValue),r=n.maxValue,n})}writeClassBreakInfos(e,t,i,r){const a=e.map(n=>n.write({},r));this._areClassBreaksConsecutive()&&a.forEach(n=>delete n.classMinValue),t[i]=a}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=this.normalizationTotal!=null;return t||i?(e=t&&ye||i&&ce||null,t&&i&&V.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==ye&&e!==ce||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let r=null;r=typeof e=="number"?new ve({minValue:e,maxValue:t,symbol:lt(i)}):ns(f(e)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&t?.arcade==null){const a=await fe(),{arcadeUtils:n}=a;n.hasGeometryOperations(this.valueExpression)&&await n.enableGeometryOperations(),i={...i,arcade:a}}const r=this.getBreakIndex(e,i);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(t=>{t.symbol&&e.push(t.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce((r,a)=>r+a.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new De({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:f(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo)})}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{},{valueExpression:y}=this;let c=this._compiledValueExpression.valueExpression===y?this._compiledValueExpression.compiledFunction:null;const b=n.arcadeUtils;if(!c){const I=b.createSyntaxTree(y);c=b.createFunction(I),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=y;const w=b.executeFunction(c,b.createExecContext(e,b.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._getBreakIndexfromInfos(w)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,r=this.normalizationType;let a=parseFloat(i[t]);if(r){const n=this.normalizationTotal,u=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===vt)a=Math.log(a)*Math.LOG10E;else if(r!==ce||n==null||isNaN(n)){if(r===ye&&!isNaN(u)){if(isNaN(a)||isNaN(u))return-1;a/=u}}else a=a/n*100}return this._getBreakIndexfromInfos(a)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let i=0;inew L({value:i})):t==="object"?e[0]instanceof L?e:e.map(i=>new L(i)):null}};s([l({type:String,json:{write:!0}})],k.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],k.prototype,"label",void 0),s([l(ge)],k.prototype,"symbol",void 0),s([l({type:[L],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new L({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const i=[];for(const r of e){const a=[r.value,r.value2,r.value3].filter(_t).map(n=>n.toString());i.push(a)}t.values=i}}}})],k.prototype,"values",void 0),s([U("values")],k.prototype,"castValues",null),k=s([h("esri.renderers.support.UniqueValueClass")],k);const bt=k;let Y=class extends be(g){constructor(e){super(e),this.heading=null,this.classes=null}};s([l({type:String,json:{write:!0}})],Y.prototype,"heading",void 0),s([l({type:[bt],json:{write:!0}})],Y.prototype,"classes",void 0),Y=s([h("esri.renderers.support.UniqueValueGroup")],Y);const Ne=Y;var $e;let $=$e=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new $e({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${e}`}};s([l({type:String,json:{write:!0}})],$.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],$.prototype,"label",void 0),s([l(mt)],$.prototype,"symbol",void 0),s([l(de)],$.prototype,"value",void 0),$=$e=s([h("esri.renderers.support.UniqueValueInfo")],$);const te=$;var ee;const gt="esri.renderers.UniqueValueRenderer",j=()=>V.getLogger(gt),Xe="uvInfos-watcher",Ye="uvGroups-watcher",os=",",us=it(te);function ps(e){const{field1:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueInfos:n,valueExpression:u}=e,y=!(!t||!i);return[{classes:(n??[]).map(c=>{const{symbol:b,label:w,value:I,description:C}=c,[P,J,Z]=y?I?.toString()?.split(a||"")||[]:[I],_=[];return(t||u)&&_.push(P),i&&_.push(J),r&&_.push(Z),{symbol:b,label:w,values:[_],description:C}})}]}function R(e){return e!=null&&e!==""&&(typeof e!="string"||e.trim()!==""&&e.toLowerCase()!=="")||(e=null),e+""}let p=ee=class extends yt(ot){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(t,i){if(!t&&!i)return;if(!t||!i)return{type:"complete",oldValue:t,newValue:i};let r=!1;const a={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let n=0;ny.value===i[n].value);u?Bt(u,i[n])?(a.changed.push({type:"complete",oldValue:u,newValue:i[n]}),r=!0):a.unchanged.push({oldValue:u,newValue:i[n]}):(a.added.push(i[n]),r=!0)}for(let n=0;nu.value===t[n].value)||(a.removed.push(t[n]),r=!0);return r?a:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:Ce(e)}writeField(e,t,i,r){typeof e=="string"?t[i]=e:r?.messages?r.messages.push(new at("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):j().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,i){return i.portal||xe.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const r=jt(t.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(e,t,i,r){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Ft(e.styleUrl,r))}set uniqueValueGroups(e){this.styleOrigin?j().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?j().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){if(this.styleOrigin)return void j().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof e=="object"?us(e):new te({value:e,symbol:lt(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[R(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void j().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let i=0;ie+t.getAttributeHash(),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce((r,a)=>r+a.getMeshHash(),"");return`${e}.${t}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new ee({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:f(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo),backgroundFillSymbol:f(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=f(this.uniqueValueInfos),i=f(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(f(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.field2),T(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return Rt(this.styleOrigin,{portal:this.portal}).then(e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach(i=>{const r=new qt({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const a=new te({value:i.name,symbol:r});t.push(a),this._valueInfoMap[R(i.name)]=a}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",os)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[R(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(Xe);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push(we(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,a)=>{r!==a&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,Xe)}}_watchUniqueValueGroups(){this.removeHandles(Ye);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push(we(()=>({classes:i.classes}),(r,a)=>{r!==a&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])t.push(we(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(a,n)=>{a!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,Ye)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueGroups:n,valueExpression:u}=this;if(!t&&!u)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const y=!(!t||!i);for(const c of n)for(const b of c.classes??[]){const{symbol:w,label:I,values:C,description:P}=b;for(const J of C??[]){const{value:Z,value2:_,value3:wt}=J,ie=[Z];i&&ie.push(_),r&&ie.push(wt);const Vt=y?ie.join(a||""):ie[0]??void 0;e.push(new te({symbol:w,label:I,value:Vt,description:P}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:i,valueExpression:r,fieldDelimiter:a,uniqueValueInfos:n}=this;if(!t&&!r||!n.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const u=!(!t||!i),y=n.map(b=>{const{symbol:w,label:I,value:C,description:P}=b,[J,Z,_]=u?C?.toString()?.split(a||"")||[]:[C];return new bt({symbol:w,label:I,description:P,values:[new L({value:J,value2:Z,value3:_})]})}),c=[new Ne({classes:y})];e&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{};let y=this._cache.compiledFunc;const c=n.arcadeUtils;if(!y){const w=c.createSyntaxTree(this.valueExpression);y=c.createFunction(w),this._cache.compiledFunc=y}const b=c.executeFunction(y,c.createExecContext(e,c.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._valueInfoMap[R(b)]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let r;if(this.field2){const a=this.field2,n=this.field3,u=[];t&&u.push(i[t]),a&&u.push(i[a]),n&&u.push(i[n]),r=u.join(this.fieldDelimiter||"")}else t&&(r=i[t]);return this._valueInfoMap[R(r)]}static fromPortalStyle(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||xe.getDefault());const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",a)}),r}static fromStyleUrl(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",a)}),r}};s([l({readOnly:!0})],p.prototype,"_cache",null),s([rt({uniqueValue:"unique-value"})],p.prototype,"type",void 0),s([l(ft)],p.prototype,"backgroundFillSymbol",void 0),s([l({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],p.prototype,"field",null),s([U("field")],p.prototype,"castField",null),s([H("field")],p.prototype,"writeField",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field2",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field3",null),s([l({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"orderByClassesEnabled",void 0),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"valueExpression",null),s([l({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),s([l({type:nt,json:{write:!0}})],p.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),s([l(st({...ge},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],p.prototype,"defaultSymbol",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"fieldDelimiter",null),s([l({type:xe,readOnly:!0})],p.prototype,"portal",void 0),s([z("portal",["styleName"])],p.prototype,"readPortal",null),s([l({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],p.prototype,"styleOrigin",void 0),s([z("styleOrigin",["styleName","styleUrl"])],p.prototype,"readStyleOrigin",null),s([H("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],p.prototype,"writeStyleOrigin",null),s([l({type:[Ne],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||ps(t)).map(r=>Ne.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueGroups",null),s([l({type:[te],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueInfos",null),p=ee=s([h(gt)],p);const gs=p;export{yt as $,mt as A,ht as B,ot as E,ct as G,ft as L,dt as M,te as P,se as a,gs as d,Zt as h,bs as o,ve as t,Yt as y}; diff --git a/main/assets/UnknownLayer-DwWK383_-B85_VjP3.js b/main/assets/UnknownLayer-DwWK383_-B85_VjP3.js deleted file mode 100644 index 3750b7568..000000000 --- a/main/assets/UnknownLayer-DwWK383_-B85_VjP3.js +++ /dev/null @@ -1 +0,0 @@ -import{aQ as p,v as t,S as s,i as a,o as l}from"./main-BZaw9FpY.js";import{m as y}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as m}from"./Layer-ChoECxvZ-C4wLrCej.js";import{C as u}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";let e=class extends u(y(m)){constructor(o){super(o),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((o,r)=>{p(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let i="Unknown layer type";n&&(i+=" "+n),r(new l("layer:unknown-layer-type",i,{layerType:n}))})}))}read(o,r){super.read({resourceInfo:o},r)}write(o,r){return null}};t([s({readOnly:!0})],e.prototype,"resourceInfo",void 0),t([s({type:["show","hide"]})],e.prototype,"listMode",void 0),t([s({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=t([a("esri.layers.UnknownLayer")],e);const O=e;export{O as default}; diff --git a/main/assets/UnknownLayer-DwWK383_-B9F_y5SB.js b/main/assets/UnknownLayer-DwWK383_-B9F_y5SB.js new file mode 100644 index 000000000..01ff75261 --- /dev/null +++ b/main/assets/UnknownLayer-DwWK383_-B9F_y5SB.js @@ -0,0 +1 @@ +import{aQ as p,v as t,S as s,i as a,o as l}from"./main-C7yV2j71.js";import{m as y}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as m}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{C as u}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";let e=class extends u(y(m)){constructor(o){super(o),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((o,r)=>{p(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let i="Unknown layer type";n&&(i+=" "+n),r(new l("layer:unknown-layer-type",i,{layerType:n}))})}))}read(o,r){super.read({resourceInfo:o},r)}write(o,r){return null}};t([s({readOnly:!0})],e.prototype,"resourceInfo",void 0),t([s({type:["show","hide"]})],e.prototype,"listMode",void 0),t([s({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=t([a("esri.layers.UnknownLayer")],e);const O=e;export{O as default}; diff --git a/main/assets/UnknownTimeZone-C--TOcPG-DfRfNtw8.js b/main/assets/UnknownTimeZone-C--TOcPG-DfRfNtw8.js new file mode 100644 index 000000000..af029e143 --- /dev/null +++ b/main/assets/UnknownTimeZone-C--TOcPG-DfRfNtw8.js @@ -0,0 +1 @@ +import{cK as o,cI as c}from"./main-C7yV2j71.js";class t{}function e(n){return n instanceof c?n===t.instance:n?.toString().toLowerCase()==="unknown"}function a(n){return e(n)?t.instance:n}t.instance=new o("Etc/UTC");export{e as a,a as r,t}; diff --git a/main/assets/UnknownTimeZone-C--TOcPG-hkNbcn35.js b/main/assets/UnknownTimeZone-C--TOcPG-hkNbcn35.js deleted file mode 100644 index 8a16b8231..000000000 --- a/main/assets/UnknownTimeZone-C--TOcPG-hkNbcn35.js +++ /dev/null @@ -1 +0,0 @@ -import{cK as o,cI as c}from"./main-BZaw9FpY.js";class t{}function e(n){return n instanceof c?n===t.instance:n?.toString().toLowerCase()==="unknown"}function a(n){return e(n)?t.instance:n}t.instance=new o("Etc/UTC");export{e as a,a as r,t}; diff --git a/main/assets/UnsupportedLayer-CCUtmZ2i-C4THy2jL.js b/main/assets/UnsupportedLayer-CCUtmZ2i-C4THy2jL.js deleted file mode 100644 index 4a8f2103c..000000000 --- a/main/assets/UnsupportedLayer-CCUtmZ2i-C4THy2jL.js +++ /dev/null @@ -1 +0,0 @@ -import{aQ as n,v as o,S as i,i as l,o as a}from"./main-BZaw9FpY.js";import{m as d}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as u}from"./Layer-ChoECxvZ-C4wLrCej.js";import{C as y}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";let t=class extends y(d(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,s)=>{n(()=>{const r=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let p="Unsupported layer type";r&&(p+=" "+r),s(new a("layer:unsupported-layer-type",p,{layerType:r}))})}))}read(e,s){const r={resourceInfo:e};e.id!=null&&(r.id=e.id),e.title!=null&&(r.title=e.title),super.read(r,s)}write(e,s){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};o([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),o([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=o([l("esri.layers.UnsupportedLayer")],t);const g=t;export{g as default}; diff --git a/main/assets/UnsupportedLayer-CCUtmZ2i-x2JJvhEj.js b/main/assets/UnsupportedLayer-CCUtmZ2i-x2JJvhEj.js new file mode 100644 index 000000000..ace9964f1 --- /dev/null +++ b/main/assets/UnsupportedLayer-CCUtmZ2i-x2JJvhEj.js @@ -0,0 +1 @@ +import{aQ as n,v as o,S as i,i as l,o as a}from"./main-C7yV2j71.js";import{m as d}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as u}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{C as y}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";let t=class extends y(d(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,s)=>{n(()=>{const r=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let p="Unsupported layer type";r&&(p+=" "+r),s(new a("layer:unsupported-layer-type",p,{layerType:r}))})}))}read(e,s){const r={resourceInfo:e};e.id!=null&&(r.id=e.id),e.title!=null&&(r.title=e.title),super.read(r,s)}write(e,s){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};o([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),o([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=o([l("esri.layers.UnsupportedLayer")],t);const g=t;export{g as default}; diff --git a/main/assets/UpdateTracking2D-Du_WIf4G-BtTSzMGH.js b/main/assets/UpdateTracking2D-Du_WIf4G-BtTSzMGH.js new file mode 100644 index 000000000..53bbd1bb1 --- /dev/null +++ b/main/assets/UpdateTracking2D-Du_WIf4G-BtTSzMGH.js @@ -0,0 +1,62 @@ +import{d as No}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import{v as g,hF as $,S as kr,i as $o,P as pe,hG as Ro,hH as Do,ff as un,K as li,j as Go,ah as Vo,cS as Ho,cN as rt,cO as gt,fr as ht,bh as Qt,g_ as lr,cP as Ds,f3 as bt,f4 as fe,a1 as ge,hI as xs,hm as Bo,hJ as ci,cM as ki,l as Xo,ec as Uo,h0 as Yo,N as Wo,hK as Jt,J as cr,hL as qo,hM as ui,hN as Ko,hO as jo,hP as Jo,R as Zo,C as Qo,hQ as ta,o as pn,hR as ea}from"./main-C7yV2j71.js";import{c as si}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{E as bs,d as Tr,D as sa}from"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import{f as Gs,M as Ps,S as lt,R as kt,o as Rt,d as ia,a as ra,l as na,u as oa,m as aa,N as zr,E as ha,n as la,P as W,C as Kt,g as I,p as Se,T as ws,h as Pt,B as xi,L as Me,O as vs}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as C,w as Tt,M as dn,m as fn,o as ca,g as ua,p as se,y as pa,C as da,A as bi,G as Lr,E as Ar,f as fa,u as ma,s as _a,c as ga,b as ya}from"./utils-SPbpQbmm-Dl9Ps2XQ.js";import{i as mn,c as _n,r as gn,k as xa,q as ba,M as Pa,_ as wa,$ as va}from"./definitions-DJSdSb77-DkoRHaVx.js";import{l as rs,s as yn,K as Ti,h as Sa,i as Pi,e as Or}from"./Tile-D75RMC64-CM0vKD9b.js";import{L as ce,m as Ss}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Er}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{a as Ma}from"./Rect-DD6XS68q-D_hsV3ag.js";import{K as Ca,l as Ee}from"./LabelMetric-BeluzH3o-CQPyji82.js";import{a as Ms}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{h as Ia}from"./Util-BjGjeg6f-08Szkf4F.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import{V as ka}from"./Program-DLVwTiPA-CHQtoRqS.js";import{h as Ta}from"./ReactiveMap-CFk6jPfN-CM49HI11.js";import{i as za}from"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";var Fr;(function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.Blend=1]="Blend",e[e.ComplexFill=2]="ComplexFill",e[e.ComplexOutlineFill=3]="ComplexOutlineFill",e[e.DotDensity=4]="DotDensity",e[e.Fill=5]="Fill",e[e.Grid=6]="Grid",e[e.Heatmap=7]="Heatmap",e[e.Label=8]="Label",e[e.Line=9]="Line",e[e.Magnifier=10]="Magnifier",e[e.Marker=11]="Marker",e[e.OutlineFill=12]="OutlineFill",e[e.Overlay=13]="Overlay",e[e.PatternFill=14]="PatternFill",e[e.PatternOutlineFill=15]="PatternOutlineFill",e[e.PieChart=16]="PieChart",e[e.Test=17]="Test",e[e.Text=18]="Text",e[e.TexturedLine=19]="TexturedLine"})(Fr||(Fr={}));const Yc={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2,overrideOutlineColor:3,colorLocked:4,isStroke:5}};let N=class{static fromOptimized(e,t,s=!1,i=!1,n=1){return new zi().initialize(e,t,s,i,n)}static fromJSON(e,t=!1,s=!1){const[i,n]=Nr(e);return new Ai().initialize(i,n,t,s,1)}static fromOptimizedCIM(e,t,s=!1,i=!1,n=1){return new $r().initialize(e,t,s,i,n)}static fromJSONCIM(e,t=!1,s=!1,i=1){const[n,r]=Nr(e);return new Rr().initialize(n,r,t,s,i)}static fromFeatureSetReader(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimized(t,s):null}static fromFeatureSetReaderCIM(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimizedCIM(t,s):null}static createEmptyOptimized(e,t=!1,s=!1,i=1){return new zi().initialize(new si,e,t,s,i)}static createEmptyJSON(e,t=!1,s=!1){return new Ai().initialize([],e,t,s,1)}static createEmptyOptimizedCIM(e,t=!1,s=!1,i=1){return new $r().initialize(new si,e,t,s,i)}static createEmptyJSONCIM(e,t=!1,s=!1,i=1){return new Rr().initialize([],e,t,s,i)}asJSON(){const e=ci(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:e[0][0][0],ymin:e[0][0][1],xmax:e[0][2][0],ymax:e[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:e.flat()}:this.geometryType==="esriGeometryPoint"?{x:e[0][0][0],y:e[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:e}:{paths:e}}getCurrentRingArea(){if(this.pathSize<3)return 0;let e,t,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;e=this.x,t=this.y;const i=e,n=t;for(;this.nextPoint();)s+=(e-this.x)*(t+this.y),e=this.x,t=this.y;return s+=(e-i)*(t+n),-.5*s}invertY(){this.yFactor*=-1}},zi=class Li extends N{constructor(){super(...arguments),this._end=-1}initialize(t,s,i,n,r){return this.hasZ=i,this.hasM=n,this.geometryType=s,this._stride=2+Number(i)+Number(n),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=r,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const s=this._pathOffset+t*this._stride;return s>=0&&s=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}getCurrentPath(){const t=this._end,s=this._geometry.coords,i=this._pathOffset;return new Li().initialize(new si([this.pathSize],s.slice(i,t)),this.geometryType,this.hasZ,this.hasM,this.yFactor)}pathLength(){const t=this._end,s=this._stride,i=this._geometry.coords;let n=0;for(let r=this._pathOffset+s;rt+s)}get pathSize(){const{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function La(e){const t=[e.x,e.y];return e.z&&t.push(e.z),e.m&&t.push(e.m),t}function Nr(e){return rt(e)?[e.rings,"esriGeometryPolygon"]:gt(e)?[e.paths,"esriGeometryPolyline"]:Ds(e)?[[e.points],"esriGeometryMultipoint"]:ht(e)?[[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],"esriGeometryEnvelope"]:ki(e)?[[[La(e)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let Ai=class Oi extends N{initialize(t,s,i,n,r){return this._paths=t,this.geometryType=s,this.hasZ=i,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=r,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,s=this._currentPath;let i=0;for(let n=1;nt.length).reduce((t,s)=>t+s)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const Cs=4,Is=1;let $r=class xn extends zi{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new xn().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},Rr=class bn extends Ai{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r)}clone(){return new bn().initialize(pe(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Cs]=Is}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Cs]===Is}setControlPointAt(t){this._paths[this.pathIndex][t][Cs]=Is}getControlPointAt(t){return this._paths[this.pathIndex][t][Cs]===Is}};const Aa=512;let wt,Oa=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function ur(e,t){wt||(wt=new sa(0,0,0,1));const s=e.geometryType==="esriGeometryPolygon",i=s?Tr.Polygon:Tr.LineString,n=s?3:2;let r,o;for(wt.reset(i),wt.setPixelMargin(t+1),wt.setExtent(Aa);e.nextPath();)if(!(e.pathSize1&&y>0&&h>0&&(o*m+a*_)/y/h<=this._maxCosAngle&&e.setControlPointAt(p-1),p===1&&(l=m,c=_,u=y),y>0&&(i=d,n=f,o=m,a=_,h=y)}this._isClosed&&h>0&&u>0&&(o*l+a*c)/u/h<=this._maxCosAngle&&e.setControlPointAt(0)}}},ye=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}};function Ce(e,t){e[4]=t}let fs=class{constructor(e,t=!0,s=!0,i=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&e.geometryType==="esriGeometryPolygon"||!s&&e.geometryType==="esriGeometryPolyline"?null:e,this.geomUnitsPerPoint=i,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new ye}next(){if(!this.geometryCursor)return null;const e=this.processMultiPath(this.geometryCursor);return this.iterateMultiPath&&e||(this.geometryCursor=null),e}processMultiPath(e){for(;this.iteratePath||e.pathIndex0?[r/a,o/a]:[1,0]}getSegAngleCS(e,t){const[[s,i],[n,r]]=e;return this.getAngleCS(s,i,n,r,t)}cut(e,t,s,i,n,r){return[n<=0?[e,t]:this.getCoord2D(e,t,s,i,n),r>=1?[s,i]:this.getCoord2D(e,t,s,i,r)]}getSubCurve(e,t,s){const i=N.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(i,e,t,s)?i:null}appendSubCurve(e,t,s,i){e.startPath(),t.seekPathStart();let n=0,r=!0;if(!t.nextPoint())return!1;let o=t.x,a=t.y;for(;t.nextPoint();){const h=this.getLength(o,a,t.x,t.y);if(h!==0){if(r){if(n+h>s){const l=(s-n)/h;let c=1,u=!1;n+h>=i&&(c=(i-n)/h,u=!0);const p=this.cut(o,a,t.x,t.y,l,c);if(p&&e.pushPoints(p),u)break;r=!1}}else{if(n+h>i){const l=this.cut(o,a,t.x,t.y,0,(i-n)/h);l&&e.pushPoint(l[1]);break}e.pushXY(t.x,t.y)}n+=h,o=t.x,a=t.y}else o=t.x,a=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let s,i,n,r,o=0;for(s=e.x,i=e.y;e.nextPoint();s=n,i=r){n=e.x,r=e.y;const a=this.getLength(s,i,n,r);if(a!==0){if(o+a>t){const h=(t-o)/a;return this.getCoord2D(s,i,n,r,h)}o+=a}}return null}offset(e,t,s,i,n){if(!e||e.length<2)return null;let r=0,o=e[r++],a=r;for(;r=0==t<=0){if(_<1){const y=[d[0]-f[0],d[1]-f[1]];this.normalize(y);const b=Math.sqrt((1+_)/2);if(b>1/i){const P=-Math.abs(t)/b;l.push([c[0]-y[0]*P,c[1]-y[1]*P])}}}else switch(s){case Kt.Mitered:{const y=Math.sqrt((1+_)/2);if(y>0&&1/y0){const b=1/y;let P=b;for(let w=1;w0){const n=N.createEmptyOptimizedCIM(e.geometryType),r=ci(e)[0],o=this._curveHelper.offset(r,this._size,Kt.Rounded,4,this._offsetFlattenError);if(o)return n.pushPath(o),n}else if(this._size<0){const n=e.asJSON();if(Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._size>0)return N.fromJSONCIM({xmin:n.xmin-this._size,xmax:n.xmax+this._size,ymin:n.ymin-this._size,ymax:n.ymax+this._size})}}const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e;if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),this._size,1);return i?N.fromJSONCIM(i):null}return null}},Sn=class Re{static local(){return Re.instance===null&&(Re.instance=new Re),Re.instance}execute(t,s,i,n,r){return new Da(t,s,i)}};Sn.instance=null;let Da=class{constructor(e,t,s){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=s,this._rule=t.rule??I.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom(ci(e));if(t?.length)return N.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,s,i){return[e[0]*t+s[0]*i,e[1]*t+s[1]*i]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,s){return[e[0]+t,e[1]+s]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const s=t/this._norm(e);e[0]*=s,e[1]*=s}_leftPerpendicular(e){const t=-e[1],s=e[0];e[0]=t,e[1]=s}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],s=-e[0];e[0]=t,e[1]=s}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,s){const i=e[0]*t-e[1]*s,n=e[0]*s+e[1]*t;e[0]=i,e[1]=n}_makeCtrlPt(e){const t=[e[0],e[1]];return Ce(t,1),t}_addAngledTicks(e,t,s,i){const n=this._sub(s,t);this._normalize(n);const r=this._crossProduct(n,this._sub(i,t));let o;o=r>0?this._rightPerp(n):this._leftPerp(n);const a=Math.abs(r)/2,h=[];h.push([t[0]+(o[0]-n[0])*a,t[1]+(o[1]-n[1])*a]),h.push(t),h.push(s),h.push([s[0]+(o[0]+n[0])*a,s[1]+(o[1]+n[1])*a]),e.push(h)}_addBezier2(e,t,s,i,n){if(n--==0)return void e.push(i);const r=this._mid(t,s),o=this._mid(s,i),a=this._mid(r,o);this._addBezier2(e,t,r,a,n),this._addBezier2(e,a,o,i,n)}_addBezier3(e,t,s,i,n,r){if(r--==0)return void e.push(n);const o=this._mid(t,s),a=this._mid(s,i),h=this._mid(i,n),l=this._mid(o,a),c=this._mid(a,h),u=this._mid(l,c);this._addBezier3(e,t,o,l,u,r),this._addBezier3(e,u,c,h,n,r)}_add90DegArc(e,t,s,i,n){const r=n??this._crossProduct(this._sub(s,t),this._sub(i,t))>0,o=this._mid(t,s),a=this._sub(o,t);r?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(e,t,s){const i=t[0],n=t[1],r=t[t.length-1],o=this._sub(i,n),a=this._norm(o);this._normalize(o);const h=Math.abs(this._crossProduct(o,this._sub(r,n)));let l=this._dotProduct(o,this._sub(r,n));l<.05*a?l=.05*a:l>.95*a&&(l=.95*a);const c=.5*h,u=this._leftPerp(o),p=[n[0]+o[0]*l,n[1]+o[1]*l],d=t.length-1,f=[];f.push(s?[-u[0],-u[1]]:u);let m=[-o[0],-o[1]];for(let _=1;_0;_--)e.push([t[_][0]+f[_][0]*c,t[_][1]+f[_][1]*c]);e.push([p[0]+f[0][0]*c,p[1]+f[0][1]*c]),e.push([p[0]+f[0][0]*h,p[1]+f[0][1]*h]),e.push(i),e.push([p[0]-f[0][0]*h,p[1]-f[0][1]*h]),e.push([p[0]-f[0][0]*c,p[1]-f[0][1]*c]);for(let _=1;_=2?e[1]:this._add2(e[0],t*this._defaultSize,s*this._defaultSize)}_cp3(e,t,s,i){if(e.length>=3)return e[2];const n=this._mix(e[0],1-s,t,s),r=this._sub(t,e[0]);return this._normalize(r),this._rightPerpendicular(r),[n[0]+r[0]*i*this._defaultSize,n[1]+r[1]*i*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],s=this._cp2(e,-4,0),i=this._sub(t,s);this._normalize(i);const n=this._rightPerp(i);return[t,s,[t[0]+(n[0]-i[0])*this._defaultSize,t[1]+(n[1]-i[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],s=this._cp2(e,-4,0);let i;if(e.length>=3)i=e[e.length-1];else{const n=this._sub(t,s);this._normalize(n);const r=this._rightPerp(n);i=[t[0]+(r[0]-n[0])*this._defaultSize,t[1]+(r[1]-n[1])*this._defaultSize]}return[s,i]}_processGeom(e){if(!e)return null;const t=[];for(const s of e){const i=s.length>1&&qo(s)0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([o[0]+(l[0]-h[0])/3,o[1]+(l[1]-h[1])/3]),c.push(o),c.push(a),c.push([a[0]+(l[0]+h[0])/3,a[1]+(l[1]+h[1])/3]),t.push(c);break}case I.DoublePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push(r),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),t.push(u);const p=[];p.push([a[0]-l[0]*c,a[1]-l[1]*c]),p.push(o),t.push(p);break}case I.OppositeToFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c,a[1]+l[1]*c]),u.push([a[0]-l[0]*c,a[1]-l[1]*c]),t.push(u);break}case I.TriplePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c*.8,a[1]+l[1]*c*.8]),u.push([h[0]+.8*(r[0]-h[0]),h[1]+.8*(r[1]-h[1])]),t.push(u),t.push([a,h]);const p=[];p.push([a[0]-l[0]*c*.8,a[1]-l[1]*c*.8]),p.push([h[0]+.8*(o[0]-h[0]),h[1]+.8*(o[1]-h[1])]),t.push(p);break}case I.HalfCircleFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o);let l=this._sub(o,r);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),p=Math.sqrt((1+c)/2),d=Math.sqrt((1-c)/2),f=[];let m;this._crossProduct(l,this._sub(a,r))>0?(f.push(r),l=this._sub(r,h),m=o):(f.push(o),l=this._sub(o,h),m=r),this._rotateDirect(l,p,d),l[0]/=p,l[1]/=p;for(let _=1;_<=18;_++)f.push(this._add(h,l)),this._rotateDirect(l,c,u);f.push(m),t.push(f);break}case I.HalfCircleSecondSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,1,-1);let h=this._sub(r,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o))/2;this._leftPerpendicular(h);const c=[o[0]+h[0]*l,o[1]+h[1]*l];h=this._sub(o,c);const u=Math.cos(Math.PI/18);let p=Math.sin(Math.PI/18);l>0&&(p=-p);const d=[o];for(let f=1;f<=18;f++)this._rotateDirect(h,u,p),d.push(this._add(c,h));t.push(d);break}case I.HalfCircleExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-1);let h;if(n>=4)h=s[3];else{const f=this._sub(r,o);h=this._add(a,f)}const l=this._dist(o,a)/2/.75,c=this._sub(o,r);this._normalize(c,l);const u=this._sub(a,h);this._normalize(u,l);const p=[h,a];t.push(p);const d=[this._clone(a)];this._addBezier3(d,a,this._add(a,u),this._add(o,c),o,4),d.push(r),t.push(d);break}case I.OpenCircle:{const o=this._cp2(s,-2,0),a=this._sub(o,r),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[o];for(let u=1;u<=33;u++)this._rotateDirect(a,h,l),c.push(this._add(r,a));t.push(c);break}case I.CoverageEdgesWithTicks:{const o=this._cp2(s,0,-1);let a,h;if(n>=3)a=s[2];else{const p=this._sub(o,r),d=this._leftPerp(p);a=[r[0]+d[0]-.25*p[0],r[1]+d[1]-.25*p[1]]}if(n>=4)h=s[3];else{const p=this._mid(r,o),d=this._sub(r,o);this._normalize(d),this._leftPerpendicular(d);const f=this._crossProduct(d,this._sub(a,p));this._rightPerpendicular(d),h=[a[0]+d[0]*f*2,a[1]+d[1]*f*2]}const l=this._sub(o,r);let c,u;c=this._crossProduct(l,this._sub(a,r))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(a),u.push(r),u.push([r[0]+(c[0]-l[0])/3,r[1]+(c[1]-l[1])/3]),t.push(u),c=this._crossProduct(l,this._sub(h,o))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push([o[0]+(c[0]+l[0])/3,o[1]+(c[1]+l[1])/3]),u.push(o),u.push(h),t.push(u);break}case I.GapExtentWithDoubleTicks:{const o=this._cp2(s,0,2),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const l=this._sub(o,r);h=this._add(a,l)}this._addAngledTicks(t,r,o,this._mid(a,h)),this._addAngledTicks(t,a,h,this._mid(r,o));break}case I.GapExtentMidline:{const o=this._cp2(s,2,0),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const c=this._sub(o,r);h=this._add(a,c)}const l=[];l.push(this._mid(r,a)),l.push(this._mid(o,h)),t.push(l);break}case I.Chevron:{const o=this._cp2(s,-1,-1);let a;if(n>=3)a=s[2];else{const h=this._sub(o,r);this._leftPerpendicular(h),a=this._add(r,h)}t.push([o,this._makeCtrlPt(r),a]);break}case I.PerpendicularWithArc:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,.5,-1),h=this._sub(o,r),l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(a,r));let u=this._dotProduct(h,this._sub(a,r));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[r[0]+h[0]*u,r[1]+h[1]*u];let d=this._leftPerp(h),f=[];if(f.push([p[0]-d[0]*c,p[1]-d[1]*c]),f.push([p[0]+d[0]*c,p[1]+d[1]*c]),t.push(f),n>=4){const b=s[3];let P=this._dotProduct(h,this._sub(b,r));P<.1*l?P=.1*l:P>.9*l&&(P=.9*l);const w=[r[0]+h[0]*P,r[1]+h[1]*P],S=this._crossProduct(h,this._sub(b,r)),L=[];L.push([w[0]-d[0]*S,w[1]-d[1]*S]),L.push([w[0]+d[0]*S,w[1]+d[1]*S]),t.push(L)}const m=[o[0]+d[0]*c,o[1]+d[1]*c];d=this._sub(o,m);const _=Math.cos(Math.PI/18);let y=Math.sin(Math.PI/18);c<0&&(y=-y),f=[r,o];for(let b=1;b<=9;b++)this._rotateDirect(d,_,y),f.push(this._add(m,d));t.push(f);break}case I.ClosedHalfCircle:{const o=this._cp2(s,2,0),a=this._mid(r,o),h=this._sub(o,a),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[r,o];for(let p=1;p<=18;p++)this._rotateDirect(h,l,c),u.push(this._add(a,h));t.push(u);break}case I.TripleParallelExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-2),h=this._mid(r,o),l=this._sub(a,o);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,o)))/2,u=this._dist(o,a),p=[o,r];p.push([r[0]+l[0]*u*.5,r[1]+l[1]*u*.5]),t.push(p);const d=[];d.push([h[0]-l[0]*c,h[1]-l[1]*c]),d.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),Ce(d[d.length-1],1),d.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),t.push(d);const f=[o,a];t.push(f);break}case I.ParallelWithTicks:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(a,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),this._addAngledTicks(t,r,o,a),this._addAngledTicks(t,this._mix(r,1,h,l),this._mix(o,1,h,l),this._mid(r,o));break}case I.Parallel:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(a,r));let u=[r,o];t.push(u),u=[],u.push([r[0]+l[0]*c,r[1]+l[1]*c]),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),t.push(u);break}case I.PerpendicularToFirstSegment:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._mid(r,o),l=this._sub(o,r);this._normalize(l);const c=this._crossProduct(l,this._sub(a,r));this._leftPerpendicular(l);const u=[];u.push([h[0]-l[0]*c*.25,h[1]-l[1]*c*.25]),u.push([h[0]+l[0]*c*1.25,h[1]+l[1]*c*1.25]),t.push(u);break}case I.ParallelOffset:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);const u=[];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(u);break}case I.OffsetOpposite:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);break}case I.OffsetSame:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]+h[0]*l,r[1]+h[1]*l]),c.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(c);break}case I.CircleWithArc:{let o=this._cp2(s,3,0);const a=this._cp3(s,o,.5,-1);let h,l;if(n>=4)h=s[3],l=this._crossProduct(this._sub(h,o),this._sub(a,o))>0;else{h=o,l=this._crossProduct(this._sub(h,r),this._sub(a,r))>0;const f=24*this._geomUnitsPerPoint,m=this._sub(h,r);this._normalize(m,f);const _=Math.sqrt(2)/2;this._rotateDirect(m,_,l?_:-_),o=this._add(r,m)}const c=this._sub(o,r),u=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),d=[o];for(let f=1;f<=36;f++)this._rotateDirect(c,u,p),d.push(this._add(r,c));this._add90DegArc(d,o,h,a,l),Ce(d[d.length-8],1),t.push(d);break}case I.DoubleJog:{let o,a=this._cp2(s,-3,1),h=this._cp3(s,a,-1,-.5);if(n>=4)o=s[3];else{const y=r;r=a,o=h;const b=this._dist(r,y),P=this._dist(o,y);let w=30*this._geomUnitsPerPoint;.5*b0?this._rotateDirect(m,f,-f):this._rotateDirect(m,f,f);let _=[];_.push(a),_.push(this._add(l,m)),_.push(this._sub(l,m)),_.push(r),t.push(_),m=this._sub(o,h),this._normalize(m,d),this._crossProduct(m,this._sub(r,h))<0?this._rotateDirect(m,f,f):this._rotateDirect(m,f,-f),_=[],_.push(h),_.push(this._add(c,m)),_.push(this._sub(c,m)),_.push(o),t.push(_);break}case I.PerpendicularOffset:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l);t.push([c,r]);break}case I.LineExcludingLastSegment:{const o=this._arrowPath(s),a=[];let h=o.length-2;for(;h--;)a.push(o[h]);t.push(a);break}case I.MultivertexArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!1),t.push(a);break}case I.CrossedArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!0),t.push(a);break}case I.ChevronArrow:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));let p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=[o[0]+l[0]*p,o[1]+l[1]*p],f=this._leftPerp(l),m=[];m.push([d[0]+f[0]*u+l[0]*h,d[1]+f[1]*u+l[1]*h]),m.push(r),m.push([d[0]-f[0]*u+l[0]*h,d[1]-f[1]*u+l[1]*h]),t.push(m);break}case I.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(a,o));let u=this._dotProduct(h,this._sub(a,o));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[o[0]+h[0]*u,o[1]+h[1]*u];this._leftPerpendicular(h);const d=[];d.push([p[0]+h[0]*c*.5,p[1]+h[1]*c*.5]),d.push(this._mid(p,r)),d.push([p[0]-h[0]*c*.5,p[1]-h[1]*c*.5]),t.push(d);break}case I.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(a,o));c<.05*l?c=.05*l:c>.95*l&&(c=.95*l);const u=[o[0]+h[0]*c,o[1]+h[1]*c];t.push([o,u]);break}case I.Arch:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=this._sub(r,o),l=this._mix(a,1,h,.55),c=this._mix(a,1,h,-.55),u=[r];this._addBezier2(u,r,l,a,4),this._addBezier2(u,a,c,o,4),t.push(u);break}case I.CurvedParallelTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l),u=this._sub(this._mix(o,.75,a,.25),l),p=this._sub(this._mix(o,.25,a,.75),l),d=[o];this._addBezier2(d,o,u,c,3),this._addBezier2(d,c,p,a,3),t.push(d);for(let f=0;f<8;f++){const m=d[2*f+1],_=[this._clone(m)];_.push(this._add(m,[h[0]/4,h[1]/4])),t.push(_)}break}case I.Arc90Degrees:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=[o];this._add90DegArc(h,o,r,a),t.push(h);break}case I.TipWithPerpendicularAndTicks:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);let u=this._crossProduct(l,this._sub(a,o)),p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=this._leftPerp(l),f=[r[0]-l[0]*h,r[1]-l[1]*h],m=.5*Math.max(c-p-h,h);u=Math.abs(u);const _=[];_.push([f[0]+d[0]*(u+m)-l[0]*m,f[1]+d[1]*(u+m)-l[1]*m]),_.push([f[0]+d[0]*u,f[1]+d[1]*u]),_.push([f[0]-d[0]*u,f[1]-d[1]*u]),_.push([f[0]-d[0]*(u+m)-l[0]*m,f[1]-d[1]*(u+m)-l[1]*m]),t.push(_),t.push([f,r]);break}case I.ConcentricCircles:{const o=this._cp2(s,1,0),a=this._cp3(s,o,2,0),h=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18);let c=this._dist(o,r),u=[c,0],p=[];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);if(t.push(p),n>=4){p=[];const d=s[3];c=this._dist(d,r),u=[c,0];for(let f=0;f<=36;f++)p.push(this._add(r,u)),f===0&&(p.push(this._add(r,u)),Ce(p[1],1)),this._rotateDirect(u,h,l);t.push(p)}p=[],c=this._dist(a,r),u=[c,0];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);t.push(p);break}case I.DoubleJogArrow:{r=this._arrowPath(s)[0];const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(a,r)));let u=Math.abs(this._dotProduct(h,this._sub(a,r)));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=Math.max(c,u),d=this._leftPerp(h);let f=[];const m=[r[0]-h[0]*u*.5+d[0]*c*.5,r[1]-h[1]*u*.5+d[1]*c*.5];f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),m[0]-=d[0]*p*.25,m[1]-=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),t.push(f),f=[],m[0]=r[0]-h[0]*u*.5-d[0]*c*.5,m[1]=r[1]-h[1]*u*.5-d[1]*c*.5,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),m[0]+=d[0]*p*.25,m[1]+=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),t.push(f);break}case I.LinkedChevrons:{const o=this._cp2(s,-5,0),a=this._cp3(s,o,-.2,1),h=this._sub(r,o);this._normalize(h);const l=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(a,o)));t.push([o,r]);const u=[];u.push([r[0]-h[0]*c+l[0]*c,r[1]-h[1]*c+l[1]*c]),u.push(r),u.push([r[0]-h[0]*c-l[0]*c,r[1]-h[1]*c-l[1]*c]),t.push(u),this._addDash(t,o,[-h[0]*c+l[0]*c,-h[1]*c+l[1]*c]),this._addDash(t,o,[-h[0]*c-l[0]*c,-h[1]*c-l[1]*c]);break}case I.SegmentThenHalfCircle:{const o=this._cp2(s,2,0),a=this._cp3(s,o,1.5,0);let h;h=n>=4?s[3]:this._cp3(s,o,1.25,-.5);const l=this._sub(o,r);this._normalize(l);const c=.5*this._dist(o,a),u=this._crossProduct(l,this._sub(h,r))>0,p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);u&&(d=-d);const f=[r,o];l[0]*=c,l[1]*=c;const m=this._add(o,l);l[0]=-l[0],l[1]=-l[1];for(let _=1;_<=18;_++)this._rotateDirect(l,p,d),f.push(this._add(m,l));t.push(f);break}case I.LineWithStraightTicks:{const o=this._cp2(s,-2,1),a=this._cp3(s,o,-1,-.5),h=this._sub(a,o);this._normalize(h);const l=this._dotProduct(h,this._sub(o,r)),c=this._dotProduct(h,this._sub(a,r));let u=[r];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push(o),t.push(u),u=[r],u.push([r[0]+h[0]*c,r[1]+h[1]*c]),u.push(a),t.push(u);break}case I.DoubleCurve:{const o=this._cp2(s,-5,-1),a=this._cp3(s,o,2,0),h=Math.atan2(1,5),l=Math.cos(h),c=Math.sin(h),u=this._sub(o,r),p=this._dist(r,o);this._normalize(u),this._rotateDirect(u,l,-c);const d=[r];d.push([r[0]+u[0]*p*.5,r[1]+u[1]*p*.5]),Ce(d[1],1),d.push([r[0]+u[0]*p*.8,r[1]+u[1]*p*.8]),this._addBezier2(d,d[2],[r[0]+u[0]*p,r[1]+u[1]*p],o,3);const f=this._sub(a,o),m=this._dist(o,a);this._normalize(f),this._rotateDirect(f,l,-c),this._addBezier2(d,o,[a[0]-f[0]*m,a[1]-f[1]*m],[a[0]-f[0]*m*.8,a[1]-f[1]*m*.8],3),d.push(a),t.push(d);break}case I.ParallelWithTicksByWidth:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),l>0?(this._addAngledTicks(t,r,[r[0]+h[0]*l,r[1]+h[1]*l],o),this._addAngledTicks(t,o,[o[0]+h[0]*l,o[1]+h[1]*l],r)):(this._addAngledTicks(t,[r[0]+h[0]*l,r[1]+h[1]*l],r,o),this._addAngledTicks(t,[o[0]+h[0]*l,o[1]+h[1]*l],r,o));break}case I.EnclosingRoundedRectangle:{const o=this._cp2(s,3,-2),a=[Math.min(r[0],o[0]),Math.max(r[1],o[1])],h=[Math.max(r[0],o[0]),Math.min(r[1],o[1])],l=h[0]-a[0],c=a[1]-h[1],u=Math.min(l,c)/10,p=[];p.push([a[0]+u+.75*(l-2*u),a[1]]),p.push([h[0]-u,a[1]]),this._add90DegArc(p,[h[0]-u,a[1]],[h[0],a[1]-u],[h[0],a[1]]),p.push([h[0],h[1]+u]),this._add90DegArc(p,[h[0],h[1]+u],[h[0]-u,h[1]],h),p.push([a[0]+u,h[1]]),this._add90DegArc(p,[a[0]+u,h[1]],[a[0],h[1]+u],[a[0],h[1]]),p.push([a[0],a[1]-u]),this._add90DegArc(p,[a[0],a[1]-u],[a[0]+u,a[1]],a),p.push([a[0]+u+.75*(l-2*u),a[1]]);break}case I.FullGeometry:default:t.push(s)}}return t}},Mn=class De{static local(){return De.instance===null&&(De.instance=new De),De.instance}execute(t,s,i,n,r){return new Ga(t,s,i)}};Mn.instance=null;let Ga=class extends pi{constructor(e,t,s){super(e,!0,!0),this._curveHelper=new Lt,this._beginCut=(t.beginCut!==void 0?t.beginCut:1)*s,this._endCut=(t.endCut!==void 0?t.endCut:1)*s,this._middleCut=(t.middleCut!==void 0?t.middleCut:0)*s,this._invert=t.invert!==void 0&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:s,_middleCut:i}=this,n=e.pathLength(),r=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(t!==0||s!==0||i!==0)if(t+s+i>=n)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(r,e,0,t),this._curveHelper.appendSubCurve(r,e,.5*(n-i),.5*(n+i)),this._curveHelper.appendSubCurve(r,e,n-s,s)}else if(t===0&&s===0&&i===0)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else t+s+i0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(s){if(s.pathSize===0)if(n===0){const o=t.segment[0];s.pushXY(o[0],o[1])}else s.pushPoint(this.getSegCoord2D(t.segment,n));const r=t.segment[1];s.pushXY(r[0],r[1])}if(n=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==$t.FAIL&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,i===$t.END?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,s){s.pathSize===0&&(n===0?s.pushPoint(t.segment[0]):s.pushPoint(this.getSegCoord2D(t.segment,n)));const r=t.abscissa/t.segmentLength;r===1?s.pushPoint(t.segment[1]):s.pushPoint(this.getSegCoord2D(t.segment,r))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let r=Math.round((this._partLength-(i+n))/this._patternLength);r<=0&&(r=i+n>0?0:1),this._partLengthRatio=this._partLength/(i+n+r*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=t;)i-=t,t=this._pattern.nextValue(),r=!r;t-=i,r?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}let s=this._walker.nextCurve(t);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else t=this._pattern.nextValue(),!this._walker.nextPosition(t)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s?.reset(),s}},In=class Ve{static local(){return Ve.instance===null&&(Ve.instance=new Ve),Ve.instance}execute(t,s,i,n,r,o){return new Ha(t,s,i,n,r,o)}};In.instance=null;let Ha=class{constructor(e,t,s,i,n,r){switch(this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._maxInflateSize=r*s,this._width=(t.width!==void 0?t.width:2)*s,t.method){case Se.Mitered:case Se.Bevelled:case Se.Rounded:case Se.TrueBuffer:case Se.Square:}this._option=t.option}next(){let e;for(;e=this._inputGeometries.next();){if(e.geometryType==="esriGeometryEnvelope"&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:N.fromJSONCIM({paths:[[[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if(e.geometryType==="esriGeometryPolygon"){if(this._width===0)return e.clone();const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),-this._width,1);if(i){for(const n of i.rings)if(n){s.startPath();for(const r of n.reverse())s.pushXY(r[0],s.yFactor*r[1])}}return s}}return null}},kn=class He{static local(){return He.instance===null&&(He.instance=new He),He.instance}execute(t,s,i,n,r){return new Ba(t,s,i)}};kn.instance=null;let Ba=class extends pi{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._length=(t.length!==void 0?t.length:20)*s,this._angle=t.angle!==void 0?t.angle:225,this._position=t.position!==void 0?t.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(e){const t=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const s=e.x,i=e.y;e.seekInPath(e.pathSize-1);const n=e.x,r=e.y,o=[n-s,r-i];this._curveHelper.normalize(o);const a=s+(n-s)*this._position/100,h=i+(r-i)*this._position/100,l=Math.cos((90-this._angle)/180*Math.PI);let c=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(c=-c),this._mirror=!this._mirror;const u=[a-this._length/2*l,h-this._length/2*c],p=[a+this._length/2*l,h+this._length/2*c];return t.pushPath([[s,i],u,p,[n,r]]),t}},Tn=class Be{static local(){return Be.instance===null&&(Be.instance=new Be),Be.instance}execute(t,s,i,n,r){return new Xa(t,s,i)}};Tn.instance=null;let Xa=class{constructor(e,t,s){this._inputGeometries=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+s;return e.reset(),e}};const Ua=10;let zn=class Xe{static local(){return Xe.instance===null&&(Xe.instance=new Xe),Xe.instance}execute(t,s,i,n,r,o){return new Ya(t,s,i,n,r,o)}};zn.instance=null;let Ya=class{constructor(e,t,s,i,n,r){this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._curveHelper=new Lt,this._offset=(t.offset??1)*s,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(r*s),Ua),this._option=t.option,this._offsetFlattenError=cs*s}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e.clone();if(e.geometryType==="esriGeometryEnvelope"){if(this._method===Kt.Rounded&&this._offset>0){const r=Jt(e),o=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(o){const a=N.createEmptyOptimizedCIM(e.geometryType);return a.pushPath(o),a}return null}const n=e.asJSON();if(ht(n)&&Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._offset>0)return N.fromJSONCIM({xmin:n.xmin-this._offset,xmax:n.xmax+this._offset,ymin:n.ymin-this._offset,ymax:n.ymax+this._offset})}const t=this._geometryEngine;if(t==null)continue;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.offset(cr.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return i?N.fromJSONCIM(i):null}return null}},Ln=class Ue{static local(){return Ue.instance===null&&(Ue.instance=new Ue),Ue.instance}execute(t,s,i,n,r){return new Wa(t,s,i)}};Ln.instance=null;let Wa=class{constructor(e,t,s){this._inputGeometries=e,this._reverse=t.reverse===void 0||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(e.geometryType==="esriGeometryPolyline")return qa(e.clone());e=this._inputGeometries.next()}return null}};function qa(e){for(;e.nextPath();)for(let t=0;t0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),s,i)}e=this._inputGeometries.next()}return null}_rotate(e,t,s){const i=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const r=e.x-t,o=e.y-s;e.x=t+r*i-o*n,e.y=s+r*n+o*i}return e.reset(),e}},On=class We{static local(){return We.instance===null&&(We.instance=new We),We.instance}execute(t,s,i,n,r){return new ja(t,s,i)}};On.instance=null;let ja=class{constructor(e,t,s){this._inputGeometries=e,this._xFactor=t.xScaleFactor!==void 0?t.xScaleFactor:1.15,this._yFactor=t.yScaleFactor!==void 0?t.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(this._xFactor===1&&this._yFactor===1||e.geometryType==="esriGeometryPoint")return e;if(e.totalSize>0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,i)}}return null}_scaleCursor(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=s+(e.y-s)*this._yFactor;return e.reset(),e}},En=class qe{static local(){return qe.instance===null&&(qe.instance=new qe),qe.instance}execute(t,s,i,n,r){return new Ja(t,s,i)}};En.instance=null;let Ja=class{constructor(e,t,s){this._inputGeometries=e,this._height=(t.amplitude!==void 0?t.amplitude:2)*s,this._period=(t.period!==void 0?t.period:3)*s,this._style=t.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new di,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new fi,this._walker.updateTolerance(s)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=N.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const s=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case ws.Sinus:default:this._constructCurve(t,s,!1);break;case ws.Square:this._constructSquare(t,s);break;case ws.Triangle:this._constructTriangle(t,s);break;case ws.Random:this._constructCurve(t,s,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,s){let i=Math.round(t/this._period);i===0&&(i=1);const n=i*16+1,r=t/i,o=this._period/16,a=1/n,h=2*Math.PI*t/r,l=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),p=.75-Math.random()/2,d=.75-Math.random()/2,f=new Mt;this._walker.curPointAndAngle(f),e.pushPoint(f.pt);let m=0;for(;;){if(!this._walker.nextPointAndAngle(o,f)){e.pushPoint(this._walker.getPathEnd());break}{const _=m;let y;if(m+=a,s){const b=this._height/2*(1+.3*Math.sin(p*h*_+l));y=b*Math.sin(h*_+c),y+=b*Math.sin(d*h*_+u),y/=2}else y=.5*this._height*Math.sin(.5*h*_);e.pushXY(f.pt[0]-y*f.sa,f.pt[1]+y*f.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period/2,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(this._walker.nextPosition(this._period/2)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca)),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}},Fn=class Ke{static local(){return Ke.instance===null&&(Ke.instance=new Ke),Ke.instance}execute(t,s,i,n,r){return new Za(t,s,i)}};Fn.instance=null;let Za=class extends fs{constructor(e,t,s){super(e),this._geometryWalker=new fi,this._geometryWalker.updateTolerance(s),this._angleToLine=t.angleToLine??!0,this._offset=(t.offset?t.offset:0)*s,this._originalEndings=t.endings,this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*s,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*s,this._pattern=new di,this._pattern.init(t.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===Pt.WithFullGap&&this.isClosed?this._endings=Pt.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let i,n=!0;switch(this._endings){case Pt.NoConstraint:i=-this._position,i=this._adjustPosition(i),n=!1;break;case Pt.WithHalfGap:default:i=-this._pattern.lastValue()/2;break;case Pt.WithFullGap:i=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Pt.WithMarkers:i=0;break;case Pt.Custom:i=-this._position,i=this._adjustPosition(i),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,n))return null;this._pattern.reset();let r=0;for(;i>r;)i-=r,r=this._pattern.nextValue();r-=i,t=r,this.iteratePath=!0}const s=new Mt;return this._geometryWalker.nextPointAndAngle(t,s)?this._endings===Pt.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Pt.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}},Nn=class je{static local(){return je.instance===null&&(je.instance=new je),je.instance}execute(t,s,i,n,r){return new Qa(t,s,i)}};Nn.instance=null;let Qa=class extends fs{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._placePerPart=t.placePerPart??!1,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._type=t.extremityPlacement,this._position=t.offsetAlongLine!==void 0?t.offsetAlongLine*s:0,this._beginProcessed=!1}processMultiPath(e){return this._placePerPart?super.processMultiPath(e):this.processPath(e)}processPath(e){let t;switch(this._type){case Rt.Both:default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case Rt.JustBegin:t=this._atExtremities(e,this._position,!0);break;case Rt.JustEnd:t=this._atExtremities(e,this._position,!1);case Rt.None:}return t}_atExtremities(e,t,s){if(this._placePerPart||(s?e.seekPath(0):e.seekPath(e.totalSize-1)),s||e.seekPathEnd(),s?e.nextPoint():e.prevPoint()){let i=0,[n,r]=[0,0],[o,a]=[e.x,e.y];for(;s?e.nextPoint():e.prevPoint();){n=o,r=a,o=e.x,a=e.y;const h=this._curveHelper.getLength(n,r,o,a);if(i+h>t){const l=(t-i)/h,[c,u]=this._curveHelper.getAngleCS(n,r,o,a,l),p=this._curveHelper.getCoord2D(n,r,o,a,l);return this.internalPlacement.setTranslate(p[0]-this._offset*u,p[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(-c,-u),this.internalPlacement}i+=h}}return null}},$n=class Je{static local(){return Je.instance===null&&(Je.instance=new Je),Je.instance}execute(t,s,i,n,r){return new th(t,s,i)}};$n.instance=null;let th=class extends fs{constructor(e,t,s){super(e),this._walker=new fi,this._walker.updateTolerance(s),this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._beginGap=t.beginPosition!==void 0?t.beginPosition*s:0,this._endGap=t.endPosition!==void 0?t.endPosition*s:0,this._flipFirst=t.flipFirst===void 0||t.flipFirst,this._pattern=new di,this._pattern.init(t.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}const s=new Mt;if(!this._walker.nextPointAndAngle(t,s,$t.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const i=this._isFirst&&this._flipFirst;let n,r;return this._angleToLine?(n=s.ca,r=s.sa):(n=1,r=0),i&&(n=-n,r=-r),this.internalPlacement.setRotateCS(n,r),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const Et=512,eh=10,ut=24,ii=1e-6;let Rn=class Ze{static local(){return Ze.instance===null&&(Ze.instance=new Ze),Ze.instance}execute(t,s,i,n,r){return new sh(t,s,i,n,r)}};Rn.instance=null;let sh=class Ht{constructor(t,s,i,n,r){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(s.stepX??16)*i,this._stepY=Math.abs(s.stepY??16)*i,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=s.gridType??xi.Fixed,this._gridType===xi.Random){const o=s.seed??13,a=1;this._randomLCG=new un(o*a),this._randomness=(s.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=s.gridAngle??0,this._shiftOddRows=s.shiftOddRows??!1,this._offsetX=(s.offsetX??0)*i,this._offsetY=(s.offsetY??0)*i,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[o,a,h,l]=n.split("/"),c=parseFloat(o),u=parseFloat(a),p=parseFloat(h),d=parseFloat(l);this._graphicOriginX=-(d*2**c+p)*Et,this._graphicOriginY=u*Et,this._testInsidePolygon=!0}this._internalPlacement=new ye,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!Ht._randValues){Ht._randValues=[];for(let t=0;t=b,this._polygonMin=this._verticalSubdivision?p:f,this._testInsidePolygon){let P=0-this._graphicOriginX-this._offsetX-this._stepX,w=Et-this._graphicOriginX-this._offsetX+this._stepX,S=-Et-this._graphicOriginY-this._offsetY-this._stepY,L=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const V=[[P,S],[P,L],[w,S],[w,L]];P=S=Number.MAX_VALUE,w=L=-Number.MAX_VALUE;for(const U of V){const z=this._cosAngle*U[0]-this._sinAngle*U[1],O=this._sinAngle*U[0]+this._cosAngle*U[1];P=Math.min(P,z),w=Math.max(w,z),S=Math.min(S,O),L=Math.max(L,O)}}h=h!==Number.MAX_VALUE?Math.max(h,P):P,l=l!==Number.MAX_VALUE?Math.max(l,S):S,c=c!==-Number.MAX_VALUE?Math.min(c,w):w,u=u!==-Number.MAX_VALUE?Math.min(u,L):L}this._xMin=Math.round(h/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,f,m,p,d)}_buildAccelerationMap(t,s,i,n,r){t.reset();const o=new Map,a=this._verticalSubdivision,h=a?r-n:i-s;let l=Math.ceil(h/eh);if(l<=1)return;const c=Math.floor(h/l);let u,p,d,f,m,_,y,b,P,w,S;for(l++,this._delta=c,a?(P=-Et-2*this._stepY,w=2*this._stepY,S=n):(P=-2*this._stepX,w=Et+2*this._stepX,S=s);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,p=t.y;t.nextPoint();u=d,p=f){if(d=t.x,f=t.y,a){if(p===f||pw&&f>w)continue;m=Math.min(p,f),_=Math.max(p,f)}else{if(u===d||uw&&d>w)continue;m=Math.min(u,d),_=Math.max(u,d)}for(;m<_;)y=Math.floor((m-S)/c),Gr(y,u,p,d,f,o),m+=c;b=Math.floor((_-S)/c),b>y&&Gr(b,u,p,d,f,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const s=this._currentY*this._stepY+this._offsetY;let i,n;if(this._currentX++,this._gridType===xi.Random){const r=(this._currentX%ut+ut)%ut,o=(this._currentY%ut+ut)%ut;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-Ht._randValues[o*ut+r])*2/3,n=this._graphicOriginY+s+this._stepY*this._randomness*(.5-Ht._randValues[o*ut+r+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*s,n=this._graphicOriginY-this._sinAngle*t+this._cosAngle*s;if(!this._testInsidePolygon||this._isInsidePolygon(i,n,this._geometryCursor))return this._internalPlacement.setTranslate(i,n),this._internalPlacement}}_isInsidePolygon(t,s,i){if(this._accelerationMap==null)return ih(t,s,i);t+=ii,s+=ii;const n=this._verticalSubdivision,r=n?s:t,o=Math.floor((r-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let h,l,c,u=0;for(const p of a){if(h=p[0],l=p[1],n){if(h[1]>s==l[1]>s)continue;c=(l[0]-h[0])*(s-h[1])-(l[1]-h[1])*(t-h[0])}else{if(h[0]>t==l[0]>t)continue;c=(l[1]-h[1])*(t-h[0])-(l[0]-h[0])*(s-h[1])}c>0?u++:u--}return u!==0}};function ih(e,t,s){let i,n,r,o,a=0;for(e+=ii,t+=ii,s.reset();s.nextPath();)if(s.nextPoint())for(i=s.x,n=s.y;s.nextPoint();i=r,n=o)r=s.x,o=s.y,n>t!=o>t&&((r-i)*(t-n)-(o-n)*(e-i)>0?a++:a--);return a!==0}function Gr(e,t,s,i,n,r){let o=r.get(e);o||(o=[],r.set(e,o)),o.push([[t,s],[i,n]])}const rh=.001;let Dn=class Qe{static local(){return Qe.instance===null&&(Qe.instance=new Qe),Qe.instance}execute(t,s,i,n,r){return new nh(t,s,i)}};Dn.instance=null;let nh=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._relativeTo=t.relativeTo,this._position=t.startPointOffset!==void 0?t.startPointOffset*s:0,this._epsilon=rh*s}processPath(e){const t=this._position;if(this._relativeTo===Me.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[i,n]=[e.x,e.y],[r,o]=[0,0];for(;e.nextPoint();){r=e.x,o=e.y;const a=this._curveHelper.getLength(i,n,r,o);if(ai){const u=(i-r)/c,[p,d]=this._curveHelper.getAngleCS(o,a,h,l,u),f=this._curveHelper.getCoord2D(o,a,h,l,u),m=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-m*d,f[1]+m*p),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-p,-d):this.internalPlacement.setRotateCS(p,d)),this.internalPlacement}o=h,a=l,r+=c}}return null}};const oh=1e-15;let Gn=class ts{static local(){return ts.instance===null&&(ts.instance=new ts),ts.instance}execute(t,s,i,n,r){return new ah(t,s,i)}};Gn.instance=null;let ah=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._endPoints=t.placeOnEndPoints===void 0||t.placeOnEndPoints,this._controlPoints=t.placeOnControlPoints===void 0||t.placeOnControlPoints,this._regularVertices=t.placeOnRegularVertices===void 0||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let s=t[0],i=t[1];if(this._offset!==0){const n=Math.cos(t[2]),r=Math.sin(t[2]);s-=this._offset*r,i+=this._offset*n}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let s=0,i=!1,n=0,r=0;if(e.seekPathStart(),e.nextPoint()){let o=e.x,a=e.y,h=e.getControlPoint(),l=!0,c=e.nextPoint();for(;c;){const u=e.x,p=e.y,d=e.getControlPoint();(this._angleToLine||this._offset!==0)&&(n=this._curveHelper.getAngle(o,a,u,p,0)),l?(l=!1,t?(s=n,i=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,n])):h?this._controlPoints&&this._tags.push([o,a,Ts(r,n)]):this._regularVertices&&this._tags.push([o,a,Ts(r,n)]),(this._angleToLine||this._offset!==0)&&(r=this._curveHelper.getAngle(o,a,u,p,1)),c=e.nextPoint(),c||(t?d||i?this._controlPoints&&this._tags.push([u,p,Ts(r,s)]):this._regularVertices&&this._tags.push([u,p,Ts(r,s)]):(this._endPoints||this._controlPoints&&d)&&this._tags.push([u,p,r])),o=u,a=p,h=d}}this._tagIterator=0}};function Ts(e,t){const s=Math.PI;for(;Math.abs(t-e)>s+2*oh;)t-e>s?t-=2*s:t+=2*s;return(e+t)/2}const hh=100*222045e-21;function lh(e){if(e.totalSize===0)return null;const t=ui(e);if(!t)return null;const s=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*hh;let i=0,n=0;e.reset();for(let z=0;e.nextPath();z++){const O=e.getCurrentRingArea();O>n&&(n=O,i=z)}if(e.seekPath(i),e.pathSize===0)return null;e.seekPathStart();const r=Ko(e);if(Math.abs(n)<=2*s*s)return[(r[0]+r[2])/2,(r[1]+r[3])/2];e.seekPathStart();const o=jo(e,Qt());if(o===null)return null;if(e.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=Ie(o,e,!0);u.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ie(o,e,!1)),h[0]=u.distance,l[0]=0;const p=[NaN,NaN];let d=!1,f=.25,m=-1,_=NaN;do if(_=NaN,a[1]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ie(a[1],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[1],e))d=!0,h[1]=_,l[1]=Bt(a[1],o);else if(!isNaN(_)&&_>m&&(m=_,p[0]=a[1][0],p[1]=a[1][1]),f-=.01,f<.1){if(!(m>=0))break;d=!0,h[1]=m,a[1][0]=p[0],a[1][1]=p[1],l[1]=Bt(a[1],o)}while(!d);d=!1,f=.5,m=-1;let y=.01,b=1;do if(_=NaN,a[2]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ie(a[2],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[2],e))d=!0,h[2]=_,l[2]=Bt(a[2],o);else if(!isNaN(_)&&_>m)m=_,p[0]=a[2][0],p[1]=a[2][1];else if(_>m&&(m=_,p[0]=a[2][0],p[1]=a[2][1]),f=.5+y*b,y+=.01,b*=-1,f<.3||f>.7){if(!(m>=0))break;d=!0,h[2]=m,a[2][0]=p[0],a[2][1]=p[1],l[2]=Bt(a[2],o)}while(!d);d=!1,f=.75,m=-1;do if(_=NaN,a[3]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ie(a[3],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[3],e))d=!0,h[3]=_,l[3]=Bt(a[3],o);else if(_>m&&(m=_,p[0]=a[3][0],p[1]=a[3][1]),f+=.01,f>.9){if(!(m>=0))break;d=!0,h[3]=m,a[3][0]=p[0],a[3][1]=p[1],l[3]=Bt(a[3],o)}while(!d);const P=[0,1,2,3],w=c?0:1;let S;for(let z=w;z<4;z++)for(let O=w;O<3;O++){const ot=l[O],Z=l[O+1];ph(ot,Z)>0&&(S=P[O],P[O]=P[O+1],P[O+1]=S,l[O]=Z,l[O+1]=ot)}let L=w,V=0,U=0;for(let z=w;z<4;z++){switch(z){case 0:U=2*h[P[z]];break;case 1:U=1.66666666*h[P[z]];break;case 2:U=1.33333333*h[P[z]];break;case 3:U=h[P[z]]}U>V&&(V=U,L=P[z])}return a[L]}function Vs(e,t){let s,i,n,r,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(s=t.x,i=t.y;t.nextPoint();s=n,i=r)n=t.x,r=t.y,i>e[1]!=r>e[1]&&((n-s)*(e[1]-i)-(r-i)*(e[0]-s)>0?o++:o--);return o!==0}function Ie(e,t,s){if(s&&Vs(e,t))return{coord:e,distance:0};let i=1/0,n=0,r=0,o=[0,0],a=[0,0];const h=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=a){a=[t.x,t.y],Jo(h,e,o,a);const l=Bt(e,h);lo?mu)i&Vr?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):n&Vr?(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)):i?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e));else if(i&Hr?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):n&Hr?(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e)):i?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)),i&n)return 0}while(i|n);return l}function pt(e,t){return(e[0]t[2]?1:0)<<1|(e[1]t[3]?1:0)<<3}function Si(e,t,s){return e+(t-e)*s}function Bt(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}function ph(e,t){if(et)return 1;if(e===t)return 0;const s=isNaN(e),i=isNaN(t);return si?1:0}let Vn=class es{static local(){return es.instance===null&&(es.instance=new es),es.instance}execute(t,s,i,n,r){return new dh(t,s,i)}};Vn.instance=null;let dh=class{constructor(e,t,s){this._geometryCursor=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0,this._method=t.method!==void 0?t.method:vs.OnPolygon,this._placementPerPart=t.placePerPart!==void 0&&t.placePerPart,this._internalPlacement=new ye}next(){const e=this._geometryCursor;if(!e)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(e);for(;e.nextPath();)if(!(e.getCurrentRingArea()<0))return this._polygonCenter(e.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(e){let t=!1;switch(this._method){case vs.CenterOfMass:{const s=ea(e);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}break;case vs.BoundingBoxCenter:{const s=ui(e);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),t=!0)}break;case vs.OnPolygon:default:{const s=lh(e);s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}};function fh(e){if(!e)return null;switch(e.type){case"CIMGeometricEffectAddControlPoints":return Pn.local();case"CIMGeometricEffectArrow":return wn.local();case"CIMGeometricEffectBuffer":return vn.local();case"CIMGeometricEffectControlMeasureLine":return Sn.local();case"CIMGeometricEffectCut":return Mn.local();case"CIMGeometricEffectDashes":return Cn.local();case"CIMGeometricEffectDonut":return In.local();case"CIMGeometricEffectJog":return kn.local();case"CIMGeometricEffectMove":return Tn.local();case"CIMGeometricEffectOffset":return zn.local();case"CIMGeometricEffectReverse":return Ln.local();case"CIMGeometricEffectRotate":return An.local();case"CIMGeometricEffectScale":return On.local();case"CIMGeometricEffectWave":return En.local()}return null}function mh(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return Fn.local();case"CIMMarkerPlacementAtExtremities":return Nn.local();case"CIMMarkerPlacementAtRatioPositions":return $n.local();case"CIMMarkerPlacementInsidePolygon":return Rn.local();case"CIMMarkerPlacementOnLine":return Dn.local();case"CIMMarkerPlacementOnVertices":return Gn.local();case"CIMMarkerPlacementPolygonCenter":return Vn.local()}return null}const Mi=new No;function _h(e){if(e==null)return["",!1];if(!Mi.hasBidiChar(e))return[e,!1];let t;return t=Mi.checkContextual(e)==="rtl"?"IDNNN":"ICNNN",[Mi.bidiTransform(e,t,"VLYSN"),!0]}const pr="arial-unicode-ms",Br="woff2",Xr=new Map,gh=new Set;let yh=class{constructor(e,t){this.fontFace=e,this.promise=t}};async function Wc(e){const t=Ph(e),s=bh(e),i=Xr.get(t);if(i)return i.promise;const n=new FontFace(e.family,`url('${Qo.fontsUrl}/woff2/${s}.${Br}') format('${Br}')`,{style:e.style,weight:e.weight}),r=document.fonts;if(r.has(n)&&n.status==="loading")return n.loaded;const o=n.load().then(()=>(r.add(n),n));return Xr.set(t,new yh(n,o)),gh.add(n),o}function xh(e){if(!e)return pr;const t=e.toLowerCase().split(" ").join("-");switch(t){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return t}}function bh(e){const t=Hn(e)+Bn(e);return xh(e.family)+(t.length>0?t:"-regular")}function Ph(e){const t=Hn(e)+Bn(e);return(e.family||pr)+(t.length>0?t:"-regular")}function Hn(e){if(!e.weight)return"";switch(e.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Bn(e){if(!e.style)return"";switch(e.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let wh=class{applyColorSubstitution(e,t){if(!t)return e;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=e,n=this._rasterizationCanvas,r=n.getContext("2d",{willReadFrequently:!0});e!==n&&(n.width=s,n.height=i,r.drawImage(e,0,0,s,i));const o=r.getImageData(0,0,s,i).data;if(t){for(const h of t)if(h&&h.oldColor&&h.oldColor.length===4&&h.newColor&&h.newColor.length===4){const[l,c,u,p]=h.oldColor,[d,f,m,_]=h.newColor;if(l===d&&c===f&&u===m&&p===_)continue;for(let y=0;y0;let w=this._lineThroughWidthOffset,S=0;if(o){i.save();const Z=t.backgroundColor??[0,0,0,0],at=t.borderLine?.color??[0,0,0,0],Fo=2*(t.borderLine?.size??0);i.fillStyle=As(Z),i.strokeStyle=As(at),i.lineWidth=Fo,i.fillRect(0,0,s.width,s.height),i.strokeRect(0,0,s.width,s.height),i.restore()}P&&this._renderHalo(i,y,b,w,S,t),f>0&&this._renderOutline(i,y,b,w,S,t),S+=b,w+=y;for(const Z of this._textLines)P?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(Z,w,S),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(Z,w,S)):(i.fillStyle=this._fillStyle,i.fillText(Z,w,S)),n&&n!=="none"&&this._renderDecoration(i,w,S,n,r),S+=d;i.restore();const L=this._renderedWidth+2*this._lineThroughWidthOffset,V=this._renderedHeight,U=i.getImageData(0,0,L,V),z=new Uint8Array(U.data);if(t.premultiplyColors){let Z;for(let at=0;at600)&&(s+=.3*e.measureText("w").width),s+=2*fe(this._parameters.halo.size),Math.round(s)}_computeLineHeightBase(){return 1.275*this._parameters.size}_computeLineHeight(){let e=this._computeLineHeightBase();const t=this._parameters.font.decoration;return t&&t==="underline"&&(e*=1.3),Math.round(e+2*fe(this._parameters.halo.size))}_renderDecoration(e,t,s,i,n,r){let o=.9*this._lineHeight;const a=n==="bold"?.06:n==="bolder"?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const h=e.textBaseline;if(i==="underline")switch(o=.9*this._computeLineHeightBase(),h){case"top":s+=o;break;case"middle":s+=o/2}else if(i==="line-through")switch(h){case"top":s+=o/1.5;break;case"middle":s+=o/3}const l=r?1.5*r:Math.ceil(o*a);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=l,e.moveTo(t-this._lineThroughWidthOffset,s),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,s),e.stroke(),e.restore()}};function ke(e,t){const s=Math.max(t.size,.5),i=t.font,n=`${i.style} ${i.weight} ${fe(s).toFixed(1)}px ${i.family}, sans-serif`;let r;switch(e.font=n,e.textBaseline="top",t.horizontalAlignment){case"left":default:r="left";break;case"right":r="right";break;case"center":r="center"}e.textAlign=r}function Mh(e,t,s){return e==="center"?.5*t:e==="right"?t-s:s}function Yn(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ch(){const e=Yn("svg");return e.setAttribute("style","position: absolute;"),e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("role","presentation"),document.body.appendChild(e),e}function Ih(e){return e!=null&&document.body.removeChild(e),null}const kh=()=>ge.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var yt,nt;function Th(e){if(!e)return yt.Center;switch(e){case"Left":case"left":return yt.Left;case"Right":case"right":return yt.Right;case"Justify":return kh().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),yt.Center;case"Center":case"center":return yt.Center}}function zh(e){if(!e)return nt.Center;switch(e){case"Top":case"top":return nt.Top;case"Center":case"middle":return nt.Center;case"Baseline":case"baseline":return nt.Baseline;case"Bottom":case"bottom":return nt.Bottom}}function qc(e){switch(e){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${e}`),["center","middle"]}}function Kc(e){switch(e){case yt.Right:case"right":return-1;case yt.Center:case"center":return 0;case yt.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${e}`),0}}function jc(e){switch(e){case nt.Top:case"top":return 1;case nt.Center:case"middle":return 0;case nt.Bottom:case nt.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${e}`),0}}(function(e){e[e.Left=-1]="Left",e[e.Center=0]="Center",e[e.Right=1]="Right"})(yt||(yt={})),function(e){e[e.Top=1]="Top",e[e.Center=0]="Center",e[e.Bottom=-1]="Bottom",e[e.Baseline=2]="Baseline"}(nt||(nt={}));const dr=22,Wn=4,Lh=dr+Wn,Ah=dr-6,Ur=3,Oh=Math.PI/180,Ft=8,Eh=1.5;let qn=class{constructor(e,t,s,i){this._rotationT=rs(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,r=new Float32Array(8);e*=i,t*=i;const o=s.code?n.width*i:s.metrics.width,a=s.code?n.height*i:s.metrics.height;this.width=o,this.height=a,r[0]=e,r[1]=t,r[2]=e+o,r[3]=t,r[4]=e,r[5]=t+a,r[6]=e+o,r[7]=t+a,this._data=r,this._setTextureCoords(n),this._scale=i,this._mosaic=s,this.x=e,this.y=t,this.maxOffset=Math.max(e+o,t+a)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,yn(this._rotationT,-e),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:e,width:t}=this._mosaic.metrics,s=t*this._scale,i=Math.abs(e)*this._scale,n=new Float32Array(8);n[0]=this.x,n[1]=this.y,n[2]=this.x+s,n[3]=this.y,n[4]=this.x,n[5]=this.y+i,n[6]=this.x+s,n[7]=this.y+i;const r=Ti(rs(),this._rotationT,this._transform);Sa(n,n,r);let o=1/0,a=1/0,h=-1/0,l=-1/0;for(let f=0;f<4;f++){const m=n[2*f],_=n[2*f+1];o=Math.min(o,m),a=Math.min(a,_),h=Math.max(h,m),l=Math.max(l,_)}const c=h-o,u=l-a,p=o+c/2,d=a+u/2;this._bounds=new Ee(p,d,c,u)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const e=Ti(rs(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],ce(this._offsets.topLeft,this._offsets.topLeft,e),ce(this._offsets.topRight,this._offsets.topRight,e),ce(this._offsets.bottomLeft,this._offsets.bottomLeft,e),ce(this._offsets.bottomRight,this._offsets.bottomRight,e)}_setTextureCoords({x:e,y:t,width:s,height:i}){this._texcoords={topLeft:[e,t],topRight:[e+s,t],bottomLeft:[e,t+i],bottomRight:[e+s,t+i]}}};const Fh=(e,t)=>({code:0,page:0,sdf:!0,rect:new Ma(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:e,left:0,top:0}});function Te(e,t){return e.forEach(s=>ce(s,s,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}let Nh=class{constructor(e,t,s){this._rotation=0,this._decorate(e,t,s),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const i of e)i.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;const t=this._transform,s=yn(rs(),e);Ti(t,s,t);for(const i of this.glyphs)i.setTransform(this._transform)}_decorate(e,t,s){if(!s.decoration||s.decoration==="none"||!e.length)return;const i=s.scale,n=s.decoration==="underline"?Lh:Ah,r=e[0].textureBinding;for(const o of t){const a=o.startX*i,h=o.startY*i,l=(o.width+o.glyphWidthEnd)*i;e.push(new qn(a,h+n*i,Fh(l,r),1))}}shapeBackground(e){const t=this._borderLineSizePx||0,s=(Eh+t)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:r,xmax:o,ymax:a,x:h,y:l,width:c,height:u}=this.bounds,p=[n-Ft,r-Ft],d=[o+Ft,r-Ft],f=[n-Ft,a+Ft],m=[o+Ft,a+Ft],_=Te([[p[0]-s,p[1]-s],[d[0]+s,d[1]-s],[p[0]+i,p[1]+i],[d[0]-i,d[1]+i]],e),y=Te([[f[0]+i,f[1]-i],[m[0]-i,m[1]-i],[f[0]-s,f[1]+s],[m[0]+s,m[1]+s]],e),b=Te([[p[0]-s,p[1]-s],[p[0]+i,p[1]+i],[f[0]-s,f[1]+s],[f[0]+i,f[1]-i]],e),P=Te([[d[0]-i,d[1]+i],[d[0]+s,d[1]-s],[m[0]-i,m[1]-i],[m[0]+s,m[1]+s]],e),w={main:Te([p,d,f,m],e),top:_,bot:y,left:b,right:P};return[new Ee(h,l,c+2*s,u+2*s),w]}get boundsT(){const e=this.bounds,t=Ss(Er(),e.x,e.y);if(ce(t,t,this._transform),this._hasRotation){const s=Math.max(e.width,e.height);return new Ee(t[0],t[1],s,s)}return new Ee(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,s=1/0,i=0,n=0;for(const a of e)t=Math.min(t,a.xTopLeft),s=Math.min(s,a.yTopLeft),i=Math.max(i,a.xBottomRight),n=Math.max(n,a.yBottomRight);const r=i-t,o=n-s;return new Ee(t+r/2,s+o/2,r,o)}_createGlyphTransform(e,t){const s=Oh*t.angle,i=rs(),n=Er();return Pi(i,i,Ss(n,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?Or(i,i,s):(Pi(i,i,Ss(n,e.x,e.y)),Or(i,i,s),Pi(i,i,Ss(n,-e.x,-e.y))),i}},Os=class{constructor(e,t,s,i,n,r){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,s)),this.end=Math.max(0,Math.max(t,s)),this.ende===10,Yr=e=>e===32;function $h(e,t,s){const i=new Array,n=1/s.scale,r=s.maxLineWidth*n,o=t?e.length-1:0,a=t?-1:e.length,h=t?-1:1;let l=o,c=0,u=0,p=l,d=p,f=0,m=1/0,_=0;for(;l!==a;){const{code:b,metrics:P}=e[l],w=Math.abs(P.top);if(Ei(b)||Yr(b)||(m=Math.min(m,w),_=Math.max(_,w+P.height)),Ei(b))l!==o&&(i.push(new Os(e,p,l-h,c,m===1/0?0:m,_)),m=1/0,_=0),c=0,p=l+h,d=l+h,u=0;else if(Yr(b))d=l+h,u=0,f=P.advance,c+=P.advance;else if(c>r){if(d!==p){const S=d-2*h;c-=f,i.push(new Os(e,p,S,c-u,m,_)),m=1/0,_=0,p=d,c=u}else i.push(new Os(e,p,l-h,c,m,_)),m=1/0,_=0,p=l,d=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const y=new Os(e,p,l-h,c,m,_);return y.start>=0&&y.endge.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let Xt=class dt{constructor(t){this._t=t}static createIdentity(){return new dt([1,0,0,0,1,0])}clone(){const t=this._t;return new dt(t.slice())}transform(t){const s=this._t;return[s[0]*t[0]+s[1]*t[1]+s[2],s[3]*t[0]+s[4]*t[1]+s[5]]}static createScale(t,s){return new dt([t,0,0,0,s,0])}scale(t,s){const i=this._t;return i[0]*=t,i[1]*=t,i[2]*=t,i[3]*=s,i[4]*=s,i[5]*=s,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,s){return new dt([0,0,t,0,0,s])}translate(t,s){const i=this._t;return i[2]+=t,i[5]+=s,this}static createRotate(t){const s=Math.cos(t),i=Math.sin(t);return new dt([s,-i,0,i,s,0])}rotate(t){return dt.multiply(this,dt.createRotate(t),this)}angle(){const t=this._t[0],s=this._t[3],i=Math.sqrt(t*t+s*s);return[t/i,s/i]}static multiply(t,s,i){const n=t._t,r=s._t,o=n[0]*r[0]+n[3]*r[1],a=n[1]*r[0]+n[4]*r[1],h=n[2]*r[0]+n[5]*r[1]+r[2],l=n[0]*r[3]+n[3]*r[4],c=n[1]*r[3]+n[4]*r[4],u=n[2]*r[3]+n[5]*r[4]+r[5],p=i._t;return p[0]=o,p[1]=a,p[2]=h,p[3]=l,p[4]=c,p[5]=u,i}invert(){const t=this._t;let s=t[0]*t[4]-t[1]*t[3];if(s===0)return new dt([0,0,0,0,0,0]);s=1/s;const i=(t[1]*t[5]-t[2]*t[4])*s,n=(t[2]*t[3]-t[0]*t[5])*s,r=t[4]*s,o=-t[1]*s,a=-t[3]*s,h=t[0]*s;return new dt([r,o,i,a,h,n])}};class fr{constructor(t,s){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Uo(ye,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(s||Xt.createIdentity()),this._sizeTransfos.push(s?s.scaleRatio():1)}setTransform(t,s){this._transfos=[t||Xt.createIdentity()],this._sizeTransfos=[s||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,s){const i=s?t.scaleRatio():1;Xt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*i)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,s,i){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,s);break;case"CIMTextSymbol":this.drawTextSymbol(t,s,i)}}drawMultiLayerSymbol(t,s){if(!t||!s)return;const i=t.symbolLayers;if(!i)return;const n=t.effects;if(n&&n.length>0){const r=this.executeEffects(n,s);if(r){let o=r.next();for(;o;)this.drawSymbolLayers(i,o.asJSON()),o=r.next()}}else this.drawSymbolLayers(i,s)}executeEffects(t,s){const i=this._resourceManager.geometryEngine;let n=new Oa(N.fromJSONCIM(s));for(const r of t){const o=fh(r);o&&(n=o.execute(n,r,this.geomUnitsPerPoint(),null,i))}return n}drawSymbolLayers(t,s){let i=t.length;for(;i--;){const n=t[i];if(!n||n.enable===!1)continue;const r=n.effects;if(r&&r.length>0){const o=this.executeEffects(r,s);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,s);if(this._earlyReturn)return}}drawSymbolLayer(t,s){switch(t.type){case"CIMSolidFill":this.drawSolidFill(s,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(s,t);break;case"CIMPictureFill":this.drawPictureFill(s,t);break;case"CIMGradientFill":this.drawGradientFill(s,t);break;case"CIMSolidStroke":this.drawSolidStroke(s,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(s,t);break;case"CIMGradientStroke":this.drawGradientStroke(s,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,s)}}drawHatchFill(t,s){const i=Hh(s,t,this.geomUnitsPerPoint());i&&(this.pushClipPath(t),this.drawMultiLayerSymbol(s.lineSymbol,i),this.popClipPath())}drawPictureFill(t,s){}drawGradientFill(t,s){}drawPictureStroke(t,s){}drawGradientStroke(t,s){}drawMarkerLayer(t,s){const i=t.markerPlacement;if(i){const n=mh(i);if(n){const r=i.type==="CIMMarkerPlacementInsidePolygon"||i.type==="CIMMarkerPlacementPolygonCenter"&&i.clipAtBoundary;r&&this.pushClipPath(s);const o=n.execute(N.fromJSONCIM(s),i,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(t,a),!this._earlyReturn););}r&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(ki(s))n.tx=s.x,n.ty=s.y,this.drawMarker(t,n);else if(rt(s)){const r=Yo(s);r&&([n.tx,n.ty]=r,this.drawMarker(t,n))}else for(const r of s.points)if(n.tx=r[0],n.ty=r[1],this.drawMarker(t,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(t,s){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,s);break;case"CIMVectorMarker":this.drawVectorMarker(t,s)}}drawPictureMarker(t,s){if(!t)return;const i=this._resourceManager.getResource(t.url),n=C(t.size,Tt.CIMPictureMarker.size);if(i==null||n<=0)return;const r=i.width,o=i.height;if(!r||!o)return;const a=r/o,h=C(t.scaleX,1),l=Xt.createIdentity(),c=t.anchorPoint;if(c){let _=c.x,y=c.y;t.anchorPointUnits!=="Absolute"&&(_*=n*a*h,y*=n),l.translate(-_,-y)}let u=C(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Wt);let p=C(t.offsetX),d=C(t.offsetY);if(p||d){if(this._mapRotation){const _=Wt*this._mapRotation,y=Math.cos(_),b=Math.sin(_),P=p*b+d*y;p=p*y-d*b,d=P}l.translate(p,d)}const f=this.geomUnitsPerPoint();f!==1&&l.scale(f,f);const m=s.getAngle();m&&l.rotate(m),l.translate(s.tx,s.ty),this.push(l,!1),this.drawImage(t,n),this.pop()}drawVectorMarker(t,s){if(!t)return;const i=t.markerGraphics;if(!i)return;const n=C(t.size,Tt.CIMVectorMarker.size),r=t.frame,o=r?r.ymax-r.ymin:0,a=n&&o?n/o:1,h=Xt.createIdentity();r&&h.translate(.5*-(r.xmax+r.xmin),.5*-(r.ymax+r.ymin));const l=t.anchorPoint;if(l){let m=l.x,_=l.y;t.anchorPointUnits!=="Absolute"?r&&(m*=r.xmax-r.xmin,_*=r.ymax-r.ymin):(m/=a,_/=a),h.translate(-m,-_)}a!==1&&h.scale(a,a);let c=C(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*Wt);let u=C(t.offsetX),p=C(t.offsetY);if(u||p){if(this._mapRotation){const m=Wt*this._mapRotation,_=Math.cos(m),y=Math.sin(m),b=u*y+p*_;u=u*_-p*y,p=b}h.translate(u,p)}const d=this.geomUnitsPerPoint();d!==1&&h.scale(d,d);const f=s.getAngle();f&&h.rotate(f),h.translate(s.tx,s.ty),this.push(h,t.scaleSymbolsProportionally);for(const m of i){m?.symbol&&m.geometry||Dh().error("Invalid marker graphic",m);let _=m.textString;if(typeof _=="number"&&(_=_.toString()),this.drawSymbol(m.symbol,m.geometry,_),this._earlyReturn)break}this.pop()}drawTextSymbol(t,s,i){if(!t||!ki(s)||C(t.height,Tt.CIMTextSymbol.height)<=0)return;const n=Xt.createIdentity();let r=C(t.angle);r=-r,r&&n.rotate(r*Wt);const o=C(t.offsetX),a=C(t.offsetY);(o||a)&&n.translate(o,a);const h=this.geomUnitsPerPoint();h!==1&&n.scale(h,h),n.translate(s.x,s.y),this.push(n,!1),this.drawText(t,i),this.pop()}}let Gh=class extends fr{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new vh(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return Ho(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(e&&!(this._clipCount>0))if(rt(e))this._processPath(e.rings,0);else if(gt(e))this._processPath(e.paths,0);else if(ht(e)){const t=qt(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,t,s){if(!e||this._clipCount>0||s==null||s<=0)return;const i=Math.max(.5*this.transformSize(C(s,Tt.CIMSolidStroke.width)),.5*Zn);if(rt(e))this._processPath(e.rings,i);else if(gt(e))this._processPath(e.paths,i);else if(ht(e)){const n=qt(e);n&&this._processPath(n.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,t){rt(t)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){const{url:s}=e,i=C(e.scaleX,1);let n=i*t,r=t;const o=this._resourceManager.getResource(s);if(o!=null){const a=o.height/o.width;n=i*(t?a>1?t:t/a:o.width),r=t?a>1?t*a:t:o.height}this._merge(this.transformPt([-n/2,-r/2]),0),this._merge(this.transformPt([-n/2,r/2]),0),this._merge(this.transformPt([n/2,-r/2]),0),this._merge(this.transformPt([n/2,r/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const s=to(e);let[i,n]=this._textRasterizer.computeTextSize(t,s);i=bt(i),n=bt(n);const r=this.transformSize(1)*this.reverseTransformScalar(1);i*=r,n*=r;let o=0;switch(e.horizontalAlignment){case"Left":o=i/2;break;case"Right":o=-i/2}let a=0;switch(e.verticalAlignment){case"Bottom":a=n/2;break;case"Top":a=-n/2;break;case"Baseline":a=n/6}this._merge(this.transformPt([-i/2+o,-n/2+a]),0),this._merge(this.transformPt([-i/2+o,n/2+a]),0),this._merge(this.transformPt([i/2+o,-n/2+a]),0),this._merge(this.transformPt([i/2+o,n/2+a]),0)}_processPath(e,t){if(e)for(const s of e){const i=s?s.length:0;if(i>1){this._merge(this.transformPt(s[0]),t);for(let n=1;nthis._xmax&&(this._xmax=e[0]+t),e[1]-tthis._ymax&&(this._ymax=e[1]+t)}},Qc=class extends fr{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Ih(this._svg),this._path=null,this._canvas=null}hitTest(e,t,s,i,n,r){const o=r*fe(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/o,this._textInfo=i;const a=t&&(t.type==="CIMPointSymbol"&&t.angleAlignment!=="Map"||t.type==="CIMTextSymbol");if(this._mapRotation=a?n:0,!li("esri-mobile")){const h=bt(xa*window.devicePixelRatio),l=bt(ba);!((t?.type==="CIMLineSymbol"||t?.type==="CIMPolygonSymbol")&&t.symbolLayers?.some(ca))&&t?.type!=="CIMMeshSymbol"&&(ua(t)??0)d.xTopLeft&&u-d.yBottomRight&&p<-d.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let t=null;if(ht(e)){const i=e;t=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))t=e.rings;else{if(!gt(e))return;t=e.paths}const s=this.reverseTransformPt(this._searchPoint);Bh(s,t)&&(this._earlyReturn=!0),!this._earlyReturn&&Wr(s,t,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}_getSvgPath(){return this._svg!=null&&this._path!=null||(this._svg??=Ch(),this._path??=Yn("path"),this._svg.appendChild(this._path)),this._path}_getCanvas(){return this._canvas??=document.createElement("canvas"),this._canvas}_hittestSvgPath(e,t,s,i){const n=Qt();lr(n,e);const r={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},o=this._getSvgPath();o.setAttribute("d",t);const a=o.getBBox(),h=a.width/r.width,l=a.height/r.height,c=this._getCanvas();c.width=a.width,c.height=a.height;const u=c.getContext("2d",{willReadFrequently:!0});u.setTransform(1,0,0,1,a.x,-a.y);const p=new Path2D(t);s?u.fill(p):(u.lineWidth=i*h,u.stroke(p));const d=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),f=this.reverseTransformPt(this._searchPoint),m=(f[0]-r.x-d)*h,_=(r.height-(f[1]-r.y)-d)*l,y=2*d*h,b=2*d*l,P=u.getImageData(m,_,y,b).data;for(let w=3;w127.5)return void(this._earlyReturn=!0)}_hitTestStroke(e,t){let s=null;if(ht(e)){const i=e;s=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))s=e.rings;else{if(!gt(e))return;s=e.paths}Wr(this.reverseTransformPt(this._searchPoint),s,C(t,Tt.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}};class Vh extends fr{constructor(t,s,i,n){super(s,i),this._applyAdditionalRenderProps=n,this._colorSubstitutionHelper=new wh,this._ctx=t}drawSolidFill(t,s){if(!t)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const i=this._ctx;i.fillStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",i.fill("evenodd")}drawSolidStroke(t,s,i,n,r,o){if(!t||!s||i===0)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!1);else{if(!ht(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(qt(t).rings,!0)}const a=this._ctx;a.strokeStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",a.lineWidth=Math.max(this.transformSize(i),Zn),this._setCapStyle(n),this._setJoinStyle(r),a.miterLimit=o,a.stroke()}pushClipPath(t){if(this._ctx.save(),rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else{if(!ht(t))return;this._buildPath(qt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,s){const{colorSubstitutions:i,url:n,tintColor:r}=t,o=C(t.scaleX,1),a=this._resourceManager.getResource(n);if(a==null)return;let h=s*(a.width/a.height),l=s;s||(h=a.width,l=a.height);const c=se(n)||"src"in a&&se(a.src);let u="getFrame"in a?Ci(a):a;i&&(u=this._colorSubstitutionHelper.applyColorSubstitution(u,i)),this._applyAdditionalRenderProps&&!c&&r&&(u=this._colorSubstitutionHelper.tintImageData(u,r));const p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=this.transformSize(1),_=this._ctx;_.save(),_.setTransform({m11:o*m*d,m12:o*m*f,m21:-m*f,m22:m*d,m41:p[0],m42:p[1]}),_.drawImage(u,-h/2,-l/2,h,l),_.restore()}drawText(t,s){if(!s||s.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const i=to(t,this.transformSize(bt(1))),n=this._textRasterizer.rasterizeText(s,i);if(!n)return;const{size:r,anchorX:o,anchorY:a,canvas:h}=n,l=r[0]*(o+.5),c=r[1]*(a-.5),u=this._ctx,p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=1;u.save(),u.setTransform({m11:m*d,m12:m*f,m21:-m*f,m22:m*d,m41:p[0]-m*l,m42:p[1]+m*c}),u.drawImage(h,0,0),u.restore()}drawPictureFill(t,s){if(!t)return;let{colorSubstitutions:i,height:n,offsetX:r,offsetY:o,rotation:a,scaleX:h,tintColor:l,url:c}=s;const u=this._resourceManager.getResource(c);if(u==null)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const p=this._ctx,d=se(c)||"src"in u&&se(u.src);let f,m="getFrame"in u?Ci(u):u;if(i&&(m=this._colorSubstitutionHelper.applyColorSubstitution(m,i)),this._applyAdditionalRenderProps){d||l&&(m=this._colorSubstitutionHelper.tintImageData(m,l)),f=p.createPattern(m,"repeat");const _=this.transformSize(1);a||(a=0),r?r*=_:r=0,o?o*=_:o=0,n&&(n*=_);const y=n?n/u.height:1,b=h&&n?h*n/u.width:1;if(a!==0||y!==1||b!==1||r!==0||o!==0){const P=new DOMMatrix;P.rotateSelf(0,0,-a).translateSelf(r,o).scaleSelf(b,y,1),f.setTransform(P)}}else f=p.createPattern(m,"repeat");p.save(),p.fillStyle=f,p.fill("evenodd"),p.restore()}drawPictureStroke(t,s){if(!t)return;let{colorSubstitutions:i,capStyle:n,joinStyle:r,miterLimit:o,tintColor:a,url:h,width:l}=s;const c=this._resourceManager.getResource(h);if(c==null)return;let u;if(rt(t))u=t.rings;else if(gt(t))u=t.paths;else{if(!ht(t))return Ds(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;u=qt(t).rings}l||(l=c.width);const p=se(h)||"src"in c&&se(c.src);let d="getFrame"in c?Ci(c):c;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(p||a&&(d=this._colorSubstitutionHelper.tintImageData(d,a)));const f=Math.max(this.transformSize(fe(l)),.5),m=f/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let b,P;_.save(),this._setCapStyle(n),this._setJoinStyle(r),o!==void 0&&(_.miterLimit=o),_.lineWidth=f;for(let w of u)if(w=pe(w),Yh(w),w&&!(w.length<=1)){b=this.transformPt(w[0]);for(let S=1;S1){let o=this.transformPt(n[0]);i.moveTo(o[0],o[1]);for(let a=1;ao;)r-=i;for(;r<-o;)r+=i;const a=Qt();lr(a,t),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const l=Math.cos(n*Wt),c=Math.sin(n*Wt),u=-i*c,p=i*l;let d,f,m,_;r=C(e.offsetX)*s*c-C(e.offsetY)*s*l,d=m=Number.MAX_VALUE,f=_=-Number.MAX_VALUE;for(const V of h){const U=V[0],z=V[1],O=l*U+c*z,ot=-c*U+l*z;d=Math.min(d,O),m=Math.min(m,ot),f=Math.max(f,O),_=Math.max(_,ot)}m=Math.floor(m/i)*i;let y=l*d-c*m-u*r/i,b=c*d+l*m-p*r/i,P=l*f-c*m-u*r/i,w=c*f+l*m-p*r/i;const S=1+Math.round((_-m)/i),L=[];for(let V=0;Ve[1]!=a[1]>e[1]&&((a[0]-o[0])*(e[1]-o[1])-(a[1]-o[1])*(e[0]-o[0])>0?s++:s--)}}return s!==0}function Wr(e,t,s){for(const i of t){const n=i.length;for(let r=1;r-s&&ce?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null,Qn=(e,t,s)=>{switch(e){case"ExtraLeading":return 1+t/s;case"Multiple":return t;case"Exact":return t/s}};function to(e,t=1){const s=fn(e),i=dn(e.fontStyleName),n=e.fontFamilyName??pr,{weight:r,style:o}=i,a=t*(e.height||5),h=pa(e.horizontalAlignment),l=da(e.verticalAlignment),c=bi(e),u=bi(e.haloSymbol),p=u!=null?t*(e.haloSize??0):0,d=Lr(e.symbol),f=t*(Ar(e.symbol)||0),m=e.callout?.type==="CIMBackgroundCallout"?e.callout.backgroundSymbol:null,_=bi(m),y=Ar(m),b=Lr(m);return{color:c,size:a,horizontalAlignment:h,verticalAlignment:l,font:{family:n,style:fa(o),weight:ma(r),decoration:s},outline:{size:f||0,color:d},halo:{size:p||0,color:u,style:o},backgroundColor:_,borderLine:y!=null&&b!=null?{size:y,color:b}:null,pixelRatio:1,premultiplyColors:!0}}const Uh=1e-4;function Yh(e){let t,s,i,n,r,o=e[0],a=1;for(;age.getLogger("esri.symbols.cim.CIMSymbolHelper");function tu(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const s=re.fromSimpleMarker(e);if(!s)throw new Error("InternalError: Cannot convert symbol to CIM");t=s;break}case"picture-marker":t=re.fromPictureMarker(e);break;case"simple-line":t=re.fromSimpleLineSymbol(e);break;case"simple-fill":t=re.fromSimpleFillSymbol(e);break;case"picture-fill":t=re.fromPictureFillSymbol(e);break;case"text":t=re.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function Hs(e,t,s){switch(t.type){case"CIMSymbolReference":return Hs(e,t.symbol,s);case"CIMPointSymbol":s==null&&(s={x:0,y:0}),e.drawSymbol(t,s);break;case"CIMLineSymbol":s==null&&(s={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,s);break;case"CIMPolygonSymbol":s==null&&(s={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,s);break;case"CIMTextSymbol":{const i={x:0,y:0};e.drawSymbol(t,i);break}case"CIMVectorMarker":{const i=new ye;e.drawMarker(t,i);break}}return e.envelope()}function Kh(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function jh(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(C(e.offsetX)),Math.abs(C(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function jr(e){if(!e)return 0;let t=0;for(const s of e)t+=jh(s);return t}let eu=class{static getSymbolInflateSize(e,t,s,i,n){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,s,i,n):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),s=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+s*s)}static _vectorMarkerBounds(e,t,s,i){let n=!0;const r=Qt();if(t?.markerGraphics)for(const o of t.markerGraphics){const a=[0,0,0,0];o.geometry&&(lr(r,o.geometry),a[0]=0,a[1]=0,a[2]=0,a[3]=0,this.getSymbolInflateSize(a,o.symbol,s,0,i),r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],r[3]+=a[3],n?(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],n=!1):(e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[2]),e[3]=Math.max(e[3],r[3])))}return e}static _getInflateSize(e,t,s,i,n){if(sl(t)){const r=this._getLayersInflateSize(e,t.symbolLayers,s,i,n),o=jr(t.effects);return o>0&&(r[0]-=o,r[1]-=o,r[2]+=o,r[3]+=o),r}return this._getTextInflatedSize(e,t,n)}static _getLayersInflateSize(e,t,s,i,n){let r=!0;if(!t)return e;for(const o of t){if(!o)continue;let a=[0,0,0,0];switch(o.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const l=o;let c=l.width;c!=null&&(l.capStyle===lt.Square||l.joinStyle===kt.Miter?c/=qh:c/=2,a[0]=-c,a[1]=-c,a[2]=c,a[3]=c);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const l=o;if(o.type==="CIMVectorMarker"){const f=o;if(a=this._vectorMarkerBounds(a,f,s,n),f.frame){const m=(f.frame.xmin+f.frame.xmax)/2,_=(f.frame.ymin+f.frame.ymax)/2;if(a[0]-=m,a[1]-=_,a[2]-=m,a[3]-=_,f.size!=null){const y=f.size/(f.frame.ymax-f.frame.ymin);a[0]*=y,a[1]*=y,a[2]*=y,a[3]*=y}}}else if(o.type==="CIMPictureMarker"){const f=o,m=s.getResource(f.url);let _=1;if(m!=null&&m.height&&(_=m.width/m.height),l.size!=null){const y=l.size/2,b=l.size*_*f.scaleX/2;a=[-b,-y,b,y]}}else if(l.size!=null){const f=l.size/2;a=[-f,-f,f,f]}if(l.anchorPoint){let f,m;l.anchorPointUnits==="Absolute"?(f=l.anchorPoint.x,m=l.anchorPoint.y):(f=l.anchorPoint.x*(a[2]-a[0]),m=l.anchorPoint.y*(a[3]-a[1]));const _=1.25*Math.sqrt(f*f+m*m);a[0]-=_,a[1]-=_,a[2]+=_,a[3]+=_}let c=C(l.rotation);if(l.rotateClockwise&&(c=-c),i&&(c-=i),c){const f=qr*c,m=Math.cos(f),_=Math.sin(f),y=Qt([bs,bs,-bs,-bs]);xs(y,[a[0]*m-a[1]*_,a[0]*_+a[1]*m]),xs(y,[a[0]*m-a[3]*_,a[0]*_+a[3]*m]),xs(y,[a[2]*m-a[1]*_,a[2]*_+a[1]*m]),xs(y,[a[2]*m-a[3]*_,a[2]*_+a[3]*m]),a=y}let u=C(l.offsetX),p=C(l.offsetY);if(i){const f=qr*i,m=Math.cos(f),_=Math.sin(f),y=u*_+p*m;u=u*m-p*_,p=y}a[0]+=u,a[1]+=p,a[2]+=u,a[3]+=p;const d=Kh(l.markerPlacement);d>0&&(a[0]-=d,a[1]-=d,a[2]+=d,a[3]+=d);break}}const h=jr(o.effects);h>0&&(a[0]-=h,a[1]-=h,a[2]+=h,a[3]+=h),r?(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],r=!1):(e[0]=Math.min(e[0],a[0]),e[1]=Math.min(e[1],a[1]),e[2]=Math.max(e[2],a[2]),e[3]=Math.max(e[3],a[3]))}return e}static _getTextInflatedSize(e,t,s){const i=jn(t.height??Tt.CIMTextSymbol.height);if(e[0]=-i/2,e[1]=-i/2,e[2]=i/2,e[3]=i/2,!s)return e;const n=s.get(t);if(!n||!n.glyphMosaicItems.glyphs.length)return e;const{lineGapType:r,lineGap:o}=t,a=r?Qn(r,o??0,i):0,h=t.callout?.type==="CIMBackgroundCallout",l=Kn(n.glyphMosaicItems,{scale:i/_n,angle:C(t.angle),xOffset:C(t.offsetX),yOffset:C(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:Jn(t.lineWidth),lineHeight:gn*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:h}).boundsT,c=Math.sqrt(l.width*l.width+l.height*l.height);return e[0]-=l.x+c,e[1]-=l.y-c,e[2]+=l.x+c,e[3]+=-l.y+c,e}},re=class Bs{static getEnvelope(t,s,i){if(!t)return null;const n=new Gh(i);if(Array.isArray(t)){let r;for(const o of t)r?r.union(Hs(n,o,s)):r=Hs(n,o,s);return r}return Hs(n,t,s)}static getTextureAnchor(t,s){const i=this.getEnvelope(t,null,s);if(!i)return[0,0,0];const n=(i.x+.5*i.width)*ie,r=(i.y+.5*i.height)*ie,o=i.width*ie+2,a=i.height*ie+2;return[-n/o,-r/a,a]}static rasterize(t,s,i,n,r=!0,o){const a=i||this.getEnvelope(s,null,n);if(!a)return[null,0,0,0,0];const h=Math.max(a.width,a.height)*ie;let l=o!=null?Math.max(o/h,1):1;l*=ie;const c=(a.x+.5*a.width)*l,u=(a.y+.5*a.height)*l;t.width=a.width*l,t.height=a.height*l,i||(t.width+=2,t.height+=2);const p=t.getContext("2d",{willReadFrequently:!0}),d=Xt.createScale(l,-l);d.translate(.5*t.width-c,.5*t.height+u);const f=new Vh(p,n,d);switch(s.type){case"CIMPointSymbol":{const y={type:"point",x:0,y:0};f.drawSymbol(s,y);break}case"CIMVectorMarker":{const y=new ye;f.drawMarker(s,y);break}}const m=p.getImageData(0,0,t.width,t.height),_=new Uint8Array(m.data);if(r){let y;for(let b=0;b<_.length;b+=4)y=_[b+3]/255,_[b]=_[b]*y,_[b+1]=_[b+1]*y,_[b+2]=_[b+2]*y}return[_,t.width,t.height,-c/t.width,-u/t.height]}static fromTextSymbol(t){const{text:s}=t;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:Bs.createCIMTextSymbolfromTextSymbol(t),textString:s}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:s,outline:i,width:n,xoffset:r,xscale:o,yoffset:a,yscale:h}=t,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(i){const m=Jr(i);m&&l.push(m)}let u=t.url;t.type==="esriPFS"&&t.imageData&&(u=t.imageData);const p="angle"in t?t.angle??0:0,d=(n??0)*(o||1),f=(s??0)*(h||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:u,height:f,width:d,offsetX:C(r),offsetY:C(a),rotation:C(-p),colorSubstitutions:null}),c}static fromSimpleFillSymbol(t){const{color:s,style:i,outline:n}=t,r=[],o={type:"CIMPolygonSymbol",symbolLayers:r};if(n){const a=Jr(n);a&&r.push(a)}if(i&&i!=="solid"&&i!=="none"&&i!=="esriSFSSolid"&&i!=="esriSFSNull"){const a={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:Q(s),capStyle:lt.Butt,joinStyle:kt.Miter,width:.75}]};let h=0;const l=bt(il(i)?8:10);switch(i){case"vertical":case"esriSFSVertical":h=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":h=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":h=45;break;case"cross":case"esriSFSCross":h=0}r.push({type:"CIMHatchFill",lineSymbol:a,offsetX:0,offsetY:0,rotation:h,separation:l}),i==="cross"||i==="esriSFSCross"?r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:90,separation:l}):i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"||r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:45,separation:l})}else!i||i!=="solid"&&i!=="esriSFSSolid"||r.push({type:"CIMSolidFill",enable:!0,color:Q(s)});return o}static fromSimpleLineSymbol(t){const{cap:s,color:i,join:n,marker:r,miterLimit:o,style:a,width:h}=t;let l=null;a!=="solid"&&a!=="none"&&a!=="esriSLSSolid"&&a!=="esriSLSNull"&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(a,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(r){let u;switch(r.placement){case"begin-end":u=Rt.Both;break;case"begin":u=Rt.JustBegin;break;case"end":u=Rt.JustEnd;break;default:u=Rt.None}const p=Bs.fromSimpleMarker(r,h,i).symbolLayers[0];p.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,offset:0,extremityPlacement:u,offsetAlongLine:0},c.push(p)}return c.push({type:"CIMSolidStroke",color:a!=="none"&&a!=="esriSLSNull"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:o,width:h,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t;let a=t.url;return t.type==="esriPMS"&&t.imageData&&(a=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:s,color:i,font:n,haloColor:r,haloSize:o,horizontalAlignment:a,kerning:h,lineWidth:l,text:c,verticalAlignment:u,xoffset:p,yoffset:d,backgroundColor:f,borderLineColor:m,borderLineSize:_}=t;let y,b,P,w,S,L;n&&(y=n.family,b=n.style,P=n.weight,w=n.size,S=n.decoration);let V=!1;return c&&(V=_h(c)[1]),(f||_)&&(L={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:Q(f)},{type:"CIMSolidStroke",color:Q(m),width:_}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:s,blockProgression:ia.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:ra.Normal,fontEncoding:na.Unicode,fontFamilyName:y||"Arial",fontStyleName:Qh(b,P),fontType:oa.Unspecified,haloSize:o,height:w,hinting:aa.Default,horizontalAlignment:Jh(a??"center"),kerning:h,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:l,offsetX:C(p),offsetY:C(d),strikethrough:S==="line-through",underline:S==="underline",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(i)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(r)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:V?zr.RTL:zr.LTR,verticalAlignment:Zh(u??"baseline"),verticalGlyphOrientation:ha.Right,wordSpacing:100,billboardMode3D:la.FaceNearPlane,callout:L}}static createPictureMarkerRasterizationParam(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t,a=t.url??t.source?.url??t.source?.imageData;return a?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}}:null}static createPictureFillRasterizationParam(t){const{width:s,height:i,xoffset:n,yoffset:r,url:o}=t;return o?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:o,width:s,height:i,offsetX:C(n),offsetY:C(r),rotation:0}}:null}static fromSimpleMarker(t,s,i){const{style:n}=t,r=t.color??i;if(n==="path"||n==="esriSMSPath"){const u=[];if("outline"in t&&t.outline){const f=t.outline;u.push({type:"CIMSolidStroke",enable:!0,width:f.width,color:Q(f.color),path:t.path})}u.push({type:"CIMSolidFill",enable:!0,color:Q(r),path:t.path});const[p,d]=ze("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-C(t.angle),size:C(t.size||6),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:p,markerGraphics:[{type:"CIMMarkerGraphic",geometry:d,symbol:{type:"CIMPolygonSymbol",symbolLayers:u}}]}]}}const o=[];let a,h,l=t.size;if("outline"in t&&t.outline&&t.outline.style!=="none"&&t.outline.style!=="esriSLSNull"){const u=t.outline,p=u.style!=="solid"&&u.style!=="esriSLSSolid";[a,h]=p?ze(n,t.size):ze(n);const d=u.width??Ro.width;if(p){const _=d/t.size,y=(a.xmax-a.xmin)*_/2,b=(a.ymax-a.ymin)*_/2;a.xmin-=y,a.xmax+=y,a.ymin-=b,a.ymax+=b,l&&(l+=d)}const f=t.style!=="cross"&&t.style!=="x"||t?.outline.style==="dot"||t?.outline.style==="short-dot"?W.HalfGap:W.FullPattern,m=p?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Fi(u.style,null).map(_=>u.width&&u.width>0?_*u.width:_),lineDashEnding:f,controlPointEnding:W.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:p?lt.Round:lt.Butt,enable:!0,width:d,color:Q(u.color),effects:m})}else!s||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[a,h]=ze(n):([a,h]=ze(n),o.push({type:"CIMSolidStroke",enable:!0,width:s,color:Q(r)}));o.push({type:"CIMSolidFill",enable:!0,color:Q(r)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:C(-t.angle),size:C(l||6*s),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:h,symbol:c}]}]}}static fromCIMHatchFill(t,s){const i=s*(t.separation??Tt.CIMHatchFill.separation),n=i/2,r=pe(t.lineSymbol);r.symbolLayers?.forEach(h=>{switch(h.type){case"CIMSolidStroke":h.width!=null&&(h.width*=s),h.effects?.forEach(l=>{if(l.type==="CIMGeometricEffectDashes"){const c=l.dashTemplate;l.dashTemplate=c?.map(u=>u*s)}});break;case"CIMVectorMarker":{h.size!=null&&(h.size*=s);const l=h.markerPlacement;l!=null&&"placementTemplate"in l&&(l.placementTemplate=l.placementTemplate.map(c=>c*s));break}}});let o=this._getLineSymbolPeriod(r)||Kr;for(;o{rl(r,s,i),"url"in r&&r.url&&i.push(s.fetchResource(r.url,{signal:n}))}),i}static fetchFonts(t,s,i){if(t&&s){if("symbolLayers"in t&&t.symbolLayers){for(const n of t.symbolLayers)if(n.type==="CIMVectorMarker"&&n.markerGraphics)for(const r of n.markerGraphics)r?.symbol&&Bs.fetchFonts(r.symbol,s,i)}else if(t.type==="CIMTextSymbol"){const{fontFamilyName:n,fontStyleName:r}=t;if(!n||n.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=dn(r),h=fn(t),l=new Do({family:n,style:o,weight:a,decoration:h});i.push(s.loadFont(l).catch(()=>{ri().error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const s=this._getEffectsRepeat(t.effects);if(s)return s;if(t.symbolLayers){for(const i of t.symbolLayers)if(i){const n=this._getEffectsRepeat(i.effects);if(n)return n;switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const r=this._getPlacementRepeat(i.markerPlacement);if(r)return r}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const s of t)if(s)switch(s.type){case"CIMGeometricEffectDashes":{const i=s.dashTemplate;if(i&&i.length){let n=0;for(const r of i)n+=r;return 1&i.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return s.period;default:ri().error(`unsupported geometric effect type ${s.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const s=t.placementTemplate;if(s&&s.length){let i=0;for(const n of s)i+=+n;return 1&s.length&&(i*=2),i}break}}return 0}static fromCIMInsidePolygon(t){const s=t.markerPlacement,i={...t};i.markerPlacement=null,i.anchorPoint=null;const n=Math.abs(s.stepX),r=Math.abs(s.stepY),o=(s.randomness??100)/100;let a,h,l,c;if(s.gridType==="Random"){const u=bt(Pa),p=Math.max(Math.floor(u/n),1),d=Math.max(Math.floor(u/r),1);a=p*n/2,h=d*r/2,l=2*h;const f=new un(s.seed),m=o*n/1.5,_=o*r/1.5;c=[];for(let y=0;y({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[i]}})),size:l}}};function so(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const s=e.symbolLayers;if(!s)return;for(const i of s)if(t(i),i.type==="CIMVectorMarker"){const n=i.markerGraphics;if(!n)continue;for(const r of n)if(r){const o=r.symbol;o&&so(o,t)}}break}}}const io=e=>{if(!e)return lt.Butt;switch(e){case"butt":return lt.Butt;case"square":return lt.Square;case"round":return lt.Round}},ro=e=>{if(!e)return kt.Miter;switch(e){case"miter":return kt.Miter;case"round":return kt.Round;case"bevel":return kt.Bevel}},Jh=e=>{if(e==null)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Zh=e=>{if(e==null)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Q=e=>{if(!e)return[0,0,0,0];const{r:t,g:s,b:i,a:n}=e;return[t,s,i,255*n]},Qh=(e,t)=>{const s=tl(t),i=el(e);return s&&i?`${s}-${i}`:`${s}${i}`},tl=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},el=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Fi=(e,t)=>{const s=li("safari")?.001:0,i=t==="butt";switch(e){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,s,4];case"dot":case"esriSLSDot":return i?[1,3]:[s,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,s,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,s,4,s,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,s,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,s,2,s,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[s,2];case"solid":case"esriSLSSolid":case"none":return ri().error("Unexpected: style does not require rasterization"),[0,0];default:return ri().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function sl(e){return e.symbolLayers!==void 0}const ze=(e,t=100)=>{const s=t/2;let i,n;const r=e;if(r==="circle"||r==="esriSMSCircle"){let o=Math.acos(1-.25/s),a=Math.ceil(eo/o/4);a===0&&(a=1),o=Wh/a,a*=4;const h=[];h.push([s,0]);for(let l=1;le==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function rl(e,t,s){if(!(!e.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void s.push(t.geometryEnginePromise);_a(e.effects)&&(t.geometryEnginePromise=ga(),s.push(t.geometryEnginePromise),t.geometryEnginePromise.then(i=>t.geometryEngine=i))}}function Jr(e){if(!e)return null;let t=null;const{cap:s,color:i,join:n,miterLimit:r,style:o,width:a}=e;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(o,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:r,width:a,effects:t}}var Zr;(function(e){e[e.Geographic=0]="Geographic",e[e.Arithmatic=1]="Arithmatic"})(Zr||(Zr={}));const su=3.14159265359/180,nl=3.14159265359/128,iu=1,ol=1.1,al=1,ru=24,nu=8,hl=1e-5,Qr=.05,ll=1e-30,cl=4,ul=0,pl=2,ou=2,au=3,hu=0,lu=3,dl=16777216,cu=1.1,fl=()=>ge.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let no=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},ml=class extends no{constructor(){super(...arguments),this.vertex=new tn,this.fragment=new tn,this.attributes=new yl,this.varyings=new xl,this.extensions=new Ni,this.constants=new oo}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!0){const s=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),r=e==="vertex"?this.vertex:this.fragment,o=r.uniforms.generateSource(),a=r.code.generateSource(),h=e==="vertex"?Pl:bl(),l=this.constants.generateSource().concat(r.constants.generateSource());return`${t?"#version 300 es":""} +${s.join(` +`)} +${h} +${l.join(` +`)} +${o.join(` +`)} +${i.join(` +`)} +${n.join(` +`)} +${a.join(` +`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Pass];r&&t.set(n.name,r)}),this.fragment.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Pass];r&&t.set(n.name,r)});const s=Array.from(t.values()),i=s.length;return(n,r)=>{for(let o=0;o{const r=n.bind[Ms.Draw];r&&t.set(n.name,r)}),this.fragment.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Draw];r&&t.set(n.name,r)});const s=Array.from(t.values()),i=s.length;return(n,r,o)=>{for(let a=0;ae.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},gl=class{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}},tn=class extends no{constructor(){super(...arguments),this.uniforms=new _l,this.code=new gl,this.constants=new oo}get builder(){return this}},yl=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},xl=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&Ia(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((s,i)=>t.push(e==="vertex"?`out ${s} ${i};`:`in ${s} ${i};`)),t}},Ni=class $i{constructor(){this._entries=new Set}add(t){this._entries.add(t)}generateSource(t){const s=t==="vertex"?$i.ALLOWLIST_VERTEX:$i.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>s.includes(i)).map(i=>`#extension ${i} : enable`)}};Ni.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],Ni.ALLOWLIST_VERTEX=[];let oo=class E{constructor(){this._entries=new Set}add(t,s,i){let n="ERROR_CONSTRUCTOR_STRING";switch(s){case"float":n=E._numberToFloatStr(i);break;case"int":n=E._numberToIntStr(i);break;case"bool":n=i.toString();break;case"vec2":n=`vec2(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])})`;break;case"vec3":n=`vec3(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])}, ${E._numberToFloatStr(i[2])})`;break;case"vec4":n=`vec4(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])}, ${E._numberToFloatStr(i[2])}, ${E._numberToFloatStr(i[3])})`;break;case"ivec2":n=`ivec2(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])})`;break;case"ivec3":n=`ivec3(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])}, ${E._numberToIntStr(i[2])})`;break;case"ivec4":n=`ivec4(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])}, ${E._numberToIntStr(i[2])}, ${E._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${s}(${Array.prototype.map.call(i,r=>E._numberToFloatStr(r)).join(", ")})`}return this._entries.add(`const ${s} ${t} = ${n};`),this}static _numberToIntStr(t){return t.toFixed(0)}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}};function bl(){return`#ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + precision highp sampler2D; +#else + precision mediump float; + precision mediump sampler2D; +#endif +`}const Pl=`precision highp float; +precision highp sampler2D;`;function wl(e){return e.split(" ").map((t,s)=>s>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("")}function vl(e,t){const s=[];for(s.push(t);s.length;){const i=s.pop();if(typeof i=="object"&&!e.has(i.uid)){e.add(i.uid);for(const n of i.children)s.push(n)}}}let ee=class Ri{constructor(){this.uid=Ri.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(t){return t=wl(t),this._debugName=t,this.isImplicit&&this.children[0]instanceof Ri&&this.children[0].setDebugName(t),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}};function v(e){return typeof e=="object"?e.clone():e}ee.NodeCount=0;let D=class extends ee{constructor(){super(...arguments),this.shaderType="primitive-node"}},Sl=class ao extends ee{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new ao(v(this.child));return this.cloneInto(t),t}},Ml=class ho extends ee{constructor(t,s,i){super(),this.property=t,this.target=s,this.returnType=i,this.shaderType="property-access-node"}get children(){const t=[this.target];return typeof this.property!="string"&&t.push(this.property),t}clone(){const t=new ho(this.property,v(this.target),this.returnType);return this.cloneInto(t),t}},Cl=class lo extends ee{constructor(t,s,i){super(),this.condition=t,this.ifTrue=s,this.ifFalse=i,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const t=v(this.ifTrue),s=this.ifFalse?v(this.ifFalse):null,i=new lo(this.condition,t,s);return this.cloneInto(i),i}},Il=class co extends ee{constructor(t,s,i,n){super(),this.captureList=t,this.returnType=s,this.generator=n,this.shaderType="block-node",i&&(this.subgraph=new Sl(i))}get children(){return Object.keys(this.captureList).map(t=>this.captureList[t]).concat(this.subgraph??[])}clone(){const t={};for(const i in this.captureList)t[i]=v(this.captureList[i]);const s=new co(t,this.returnType,this.subgraph?v(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(s),s}},jt=class uo extends ee{constructor(t,s,i,n,r,o=!1){super(),this.token=t,this._children=s,this.isInfix=i,this.isPropertyAccess=n,this.returnType=r,this.isTernary=o,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new uo(this.token,this._children.map(v),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}};var ss,Di,Gi,Vi,Hi,Bi,Xi,Ui,Yi,Wi,qi,Ki,ji,Ji;function kl(e){const t=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const s of t)if(s.includes(e))return s.map(i=>Al[i]);throw new Error("Unable to find type family")}function po(e){return new Proxy(e,{get(t,s){if(s==="constructor")return new Proxy(t.constructor,{construct:(i,n,r)=>po(new i(...n))});if(s in t)return t[s];if(typeof s=="string"){const i=kl(e.type);return tt(e,s,i[s.length-1])}}})}function st(e){return new Proxy(e,{construct:(t,s,i)=>po(new t(...s))})}function Tl(e){return new Proxy(e,{get(t,s){if(s in t)return t[s];if(typeof s=="string"){const i=parseInt(s,10);if(!isNaN(i))return tt(e,`[${i}]`,e.elementType.constructor)}}})}function zl(e){return new Proxy(e,{construct:(t,s,i)=>Tl(new t(...s))})}let Zi=class extends Error{},ct=ss=class extends D{constructor(e,t){super(),this.elementType=e,this.size=t,this.children=[],this.type="array"}clone(){const e=new ss(this.elementType,this.size);return super.cloneInto(e),e}get(e){if(typeof e=="number"){const t=new Gt(e);return t.isImplicit=!0,tt(this,t,this.elementType.constructor)}return tt(this,e,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(e,t,s){return Fl(this,e,t,s)}glslFindIndex(e,t,s){return Nl(this,e,t,s)}static ofType(e,t){const s={construct:(i,n)=>new ss(new e,t)};return new Proxy(ss,s)}};ct.type="array",ct=ss=g([zl],ct);let mt=class fo extends D{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}clone(){const t=new fo;return t.children=this.children.map(v),super.cloneInto(t),t}};mt.type="sampler2D";let x=class he extends D{constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new he(v(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ot(this,typeof t=="number"?G(t,he):t)}divide(t){return _s(this,typeof t=="number"?G(t,he):t)}add(t){return xe(this,typeof t=="number"?G(t,he):t)}subtract(t){return gs(this,typeof t=="number"?G(t,he):t)}};x.type="float";let T=Di=class extends D{constructor(e,t){super(),this.type="vec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Di(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){throw new Zi}get 3(){throw new Zi}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};T.type="vec2",T=Di=g([st],T);let H=Gi=class extends D{constructor(e,t,s){super(),this.type="vec3",this.children=[e,t,s].filter(i=>i!=null)}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){return tt(this,"[2]",x)}get 3(){throw new Zi}clone(){const e=new Gi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};H.type="vec3",H=Gi=g([st],H);let A=Vi=class extends D{constructor(e,t,s,i){super(),this.type="vec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Vi(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){return tt(this,"[2]",x)}get 3(){return tt(this,"[3]",x)}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};A.type="vec4",A=Vi=g([st],A);let Xs=Hi=class extends D{constructor(e){super(),this.type="uint",this.children=[e]}clone(){const e=new Hi(v(this.children[0]));return super.cloneInto(e),e}};Xs.type="uint",Xs=Hi=g([st],Xs);let Us=Bi=class extends D{constructor(e,t){super(),this.type="uvec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Bi(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};Us.type="uvec2",Us=Bi=g([st],Us);let Ys=Xi=class extends D{constructor(e,t,s){super(),this.type="uvec3",this.children=[e,t,s].filter(i=>i!=null)}clone(){const e=new Xi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};Ys.type="uvec3",Ys=Xi=g([st],Ys);let Ws=Ui=class extends D{constructor(e,t,s,i){super(),this.type="uvec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Ui(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};Ws.type="uvec4",Ws=Ui=g([st],Ws);class j extends D{constructor(t){super(),this.type="bool",this.children=[t]}and(t){return tr(this,t)}or(t){return go(this,t)}clone(){const t=new j(v(this.children[0]));return super.cloneInto(t),t}}j.type="bool";let qs=Yi=class extends D{constructor(e,t){super(),this.type="bvec2",this.children=[e,t].filter(s=>s!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new Yi(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};qs.type="bvec2",qs=Yi=g([st],qs);let Ks=Wi=class extends D{constructor(e,t,s){super(),this.type="bvec3",this.children=[e,t,s].filter(i=>i!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new Wi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};function G(e,t){return typeof e=="number"?new t(e):e}Ks.type="bvec3",Ks=Wi=g([st],Ks);let js=qi=class extends D{constructor(e,t,s,i){super(),this.type="bvec4",this.children=[e,t,s,i].filter(n=>n!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new qi(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};js.type="bvec4",js=qi=g([st],js);let Gt=class le extends D{constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Ot(this,G(t,le))}add(t){return xe(this,G(t,le))}subtract(t){return gs(this,G(t,le))}divide(t){return _s(this,G(t,le))}clone(){const t=new le(v(this.children[0]));return super.cloneInto(t),t}};Gt.type="int";let Js=Ki=class extends D{constructor(e,t){super(),this.type="ivec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Ki(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};Js.type="ivec2",Js=Ki=g([st],Js);let Zs=ji=class extends D{constructor(e,t,s){super(),this.type="ivec3",this.children=[e,t,s].filter(i=>i!=null)}clone(){const e=new ji(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};Zs.type="ivec3",Zs=ji=g([st],Zs);let Qs=Ji=class extends D{constructor(e,t,s,i){super(),this.type="ivec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Ji(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};Qs.type="ivec4",Qs=Ji=g([st],Qs);let Ll=class mo extends D{constructor(t,s,i,n){super(),this.type="mat2",this.children=[t,s,i,n]}clone(){const t=new mo(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(t),t}multiply(t){return Ot(this,t)}};Ll.type="mat2";let xt=class ti extends D{static identity(){return new ti(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const s=Pr(t),i=yo(t);return new ti(i,s,0,ni(s),i,0,0,0,1)}constructor(t,s,i,n,r,o,a,h,l){super(),this.type="mat3",this.children=[t,s,i,n,r,o,a,h,l]}add(t){return xe(this,t)}multiply(t){return Ot(this,t)}clone(){const t=new ti(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]),v(this.children[4]),v(this.children[5]),v(this.children[6]),v(this.children[7]),v(this.children[8]));return super.cloneInto(t),t}};xt.type="mat3";class ns extends D{static identity(){return new ns(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,s,i,n,r,o,a,h,l,c,u,p,d,f,m,_){super(),this.type="mat4",this.children=[t,s,i,n,r,o,a,h,l,c,u,p,d,f,m,_]}static fromColumns(t,s,i,n){return new ns(t.x,t.y,t.z,t.w,s.x,s.y,s.z,s.w,i.x,i.y,i.z,i.w,n.x,n.y,n.z,n.w)}multiply(t){return Ot(this,t)}clone(){const t=new ns(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]),v(this.children[4]),v(this.children[5]),v(this.children[6]),v(this.children[7]),v(this.children[8]),v(this.children[9]),v(this.children[10]),v(this.children[11]),v(this.children[12]),v(this.children[13]),v(this.children[14]),v(this.children[15]));return super.cloneInto(t),t}}ns.type="mat4";const Al={float:x,vec2:T,vec3:H,vec4:A,int:Gt,ivec2:Js,ivec3:Zs,ivec4:Qs,uint:Xs,uvec2:Us,uvec3:Ys,uvec4:Ws,bool:j,bvec2:qs,bvec3:Ks,bvec4:js},ne=(...e)=>new Gt(...e),F=(...e)=>new x(...e),Qi=(...e)=>new T(...e),Ol=(...e)=>new H(...e),El=(...e)=>new A(...e),en=(...e)=>new xt(...e);function tt(e,t,s){const i=new s(new Ml(t,e,s));return i.isImplicit=!0,i}function J(e,t,s,i=null){if(i){const r=new i,o=new i(new jt(e,[t,s],!0,!1,r));return o.isImplicit=!0,o}if(t.type==="float"||t.type==="int"){const r=new s.constructor(new jt(e,[t,s],!0,!1,s.constructor));return r.isImplicit=!0,r}if((t.type==="mat2"||t.type==="mat3"||t.type==="mat4")&&s.type!=="float"){const r=new s.constructor(new jt(e,[t,s],!0,!1,s.constructor));return r.isImplicit=!0,r}const n=new t.constructor(new jt(e,[t,s],!0,!1,t.constructor));return n.isImplicit=!0,n}function q(e,t,s=t.constructor){const i=new s(new jt(e,[t],!1,!1,s));return i.isImplicit=!0,i}function At(e,t,s,i=t.constructor){const n=new i(new jt(e,[t,s],!1,!1,i));return n.isImplicit=!0,n}function mr(e,t,s,i,n=t.constructor){const r=new n(new jt(e,[t,s,i],!1,!1,n));return r.isImplicit=!0,r}function ni(e){return Ot(e,F(-1))}function _o(e,t,s,i){return new t(new Il(e,t,s,i))}function Fl(e,t,s=0,i=e.size){const n=new Gt(s).setMutable().setDebugName("FindIndexIterator"),r=t(e.get(n)).setDebugName("FindIndexPredicate");return _o({iter:n},Gt,r,({out:o,iter:a,subgraph:h})=>` +${o} = -1; + +for (; ${a} < ${i}; ${a}++) { + +${h.body} + + if (${h.varName}) { + ${o} = ${a}; + break; + } + +} +`).setDebugName("FindIndexBlock")}function Nl(e,t,s=0,i=e.size){return _o({array:e},Gt,null,({out:n,array:r})=>` +${n} = -1; +for (int i = ${s}; i < ${i}; i++) { + bool condition; + ${t({array:r,i:"i",out:"condition"})} + if (condition) { + ${n} = i; + break; + } +} +`).setDebugName("GlslFindIndexBlock")}function B(e,t,s){const i=typeof t=="function"?t():t,n=typeof s=="function"?s():s,r=new i.constructor(new Cl(e,i,n));return r.isImplicit=!0,r}function ms(...e){const t=e.map(([a,h])=>typeof h=="function"?[a,h()]:[a,h]),s=t[0][1].constructor,i=t.findIndex(a=>a[0]===!0);if(i===-1)throw new Error("A cond must have a fallthrough case with `true`/; ");const n=t.slice(0,i),r=t[i][1],o=new s(n.reduceRight((a,h)=>B(h[0],h[1],a),r));return o.isImplicit=!0,o}function Ot(e,t){return J("*",e,t)}function _s(e,t){return J("/",e,t)}function xe(e,t){return J("+",e,t)}function gs(e,t){return J("-",e,t)}function uu(e,t){return J("%",e,t)}function pu(e,t){return J(">>",e,t)}function du(e,t){return J("&",e,t)}function _r(e,t){return J("==",e,t,j)}function $l(e,t){return J("<",e,t,j)}function mi(e,t){return J("<=",e,t,j)}function et(e,t){return J(">",e,t,j)}function _i(e,t){return J(">=",e,t,j)}function go(...e){return e.length<=1?e[0]:e.slice(1).reduce((t,s)=>Rl(t,s),e[0])}function Rl(e,t){return J("||",e,t,j)}function tr(...e){return e.length<=1?e[0]:e.slice(1).reduce((t,s)=>Dl(t,s),e[0])}function Dl(e,t){return J("&&",e,t,j)}function Gl(e){return q("abs",e)}function gr(e){return q("all",e,j)}function yr(e){return q("any",e,j)}function fu(e,t){return t==null?q("atan",e):At("atan",e,t,e.constructor)}function Vl(e){return q("ceil",e)}function xr(e,t,s){return mr("clamp",e,t,s,e.constructor)}function yo(e){return q("cos",e)}function xo(e,t){return At("distance",e,t,x)}function br(e,t){return At("dot",e,t,x)}function Hl(e){return q("floor",e)}function bo(e){return q("fract",e)}function Po(e){return q("length",e,x)}function de(e,t){return At("max",e,t)}function er(e,t){return At("min",e,t)}function be(e,t,s){return mr("mix",e,t,s)}function Pe(e,t){return At("mod",e,t)}function Bl(e){return q("normalize",e)}function Xl(e){return e.type==="bool"?q("!",e):q("not",e)}function mu(e,t){return At("pow",e,t)}function _u(e){return q("round",e)}function Pr(e){return q("sin",e)}function gu(e,t,s){return mr("smoothstep",e,t,s)}function yu(e){return q("sqrt",e)}function Dt(e,t){return At("step",e,t,t.constructor)}function _t(e,t){return At("texture",e,t,A)}const Le=5;function X(e,t,s){const i=t.split(` +`);for(const n of i)if(n.trim().length){{let r="";s!=null&&(r+=`/*id:${s??"000"}*/ `),e.body+=r.padEnd(14)}e.body+=" ".repeat(e.indent)+n+` +`}}let sn=class{write(e){for(const t of e.rootOutputNodes())e.shouldPruneOutputNode(t)||(t.variableName=this._write(e,t.node));return e}_createVarName(e,t){let s="";return typeof t!="boolean"&&typeof t!="number"&&t.debugInfo.name&&(s=`${t.debugInfo.name}_`),`${s}v${e.varCount++}`}_write(e,t,s=!1){if(typeof t=="number"||typeof t=="boolean")return t.toString();let i=e.getEmit(t);if(i)return i;switch(t.shaderType){case"scope-node":i=this._writeScopeNode(e,t);break;case"primitive-node":i=this._writePrimitiveNode(e,t,s);break;case"function-node":i=this._writeFunctionNode(e,t);break;case"property-access-node":i=this._writePropertyAccessNode(e,t);break;case"text-node":i=t.text;break;case"block-node":i=this._writeBlockNode(e,t);break;case"condition-node":i=this._writeConditionNode(e,t)}return e.setEmit(t,i),i}_writeScopeNode(e,t){const s=new t.child.constructor;s.setDebugName(t.debugInfo.name);const i=this._write(e,s,!0);return X(e,`{ /*ScopeStart: ${t.uid} ${t.debugInfo.name}*/`),e.indent+=2,X(e,`${i} = ${this._write(e,t.child)};`),e.indent-=2,X(e,`} /*ScopeEnd: ${t.uid} ${t.debugInfo.name}*/`),i}_writeConditionNode(e,t){const s=new t.ifTrue.constructor,i=this._write(e,s,!0);X(e,`if (${this._write(e,t.condition)}) {`),e.indent+=2;const n=e.createSubgraphContext(),r=this._write(n,t.ifTrue);if(e.body+=n.body,r&&X(e,`${i} = ${r};`),e.indent-=2,X(e,"}"),t.ifFalse){X(e,"else {"),e.indent+=2;const o=e.createSubgraphContext(),a=this._write(o,t.ifFalse);e.body+=o.body,a&&X(e,`${i} = ${a};`),e.indent-=2,X(e,"}")}return i}_writeBlockNode(e,t){const{captureList:s,generator:i,returnType:n}=t,r={};for(const l in s){if(!s[l])continue;const c=this._write(e,s[l]);r[l]=c}const o=new n,a=this._write(e,o,!0);if(r.out=a,t.subgraph){const l=e.createSubgraphContext(),c=this._write(l,t.subgraph.child),u=l.body;r.subgraph={varName:c,body:u}}const h=i(r);return X(e,`{ +`),e.indent+=2,X(e,h),e.indent-=2,X(e,`} +`),a}_writePropertyAccessNode(e,t){const s=this._write(e,t.target);return typeof t.property=="string"&&t.property.includes("[")?`${s}${t.property}`:typeof t.property!="string"?`${s}[${this._write(e,t.property)}]`:`${s}.${t.property}`}_writeFunctionNode(e,t){const s=t.returnType.type;if(t.isInfix){const[r,o]=t.children.map(h=>this._write(e,h)),a=this._createVarName(e,t);return X(e,`${s.padEnd(Le)} ${a} = ${r} ${t.token} ${o};`,t.uid),a}const i=t.children.map(r=>this._write(e,r)).join(", "),n=this._createVarName(e,t);return X(e,`${s.padEnd(Le)} ${n} = ${t.token}(${i});`,t.uid),n}_writePrimitiveNode(e,t,s=!1){const i=e.getInput(t);if(i)return i.isUsed=!0,i.variableName;const n=t.children.length===1&&t.children[0]?.type===t.type;if(t.isImplicit||n)return this._write(e,t.children[0]);const r=this._createVarName(e,t);if(s)return X(e,`${t.type.padEnd(Le)} ${r};`,t.uid),r;const o=!t.debugInfo.name&&!t.isMutable;if(o&&t.type==="float"&&typeof t.children[0]=="number")return Number.isInteger(t.children[0])?t.children[0].toFixed(1):t.children[0].toString();if(o&&t.type==="int"&&typeof t.children[0]=="number"&&Number.isInteger(t.children[0]))return t.children[0].toString();const a=t.children.map(h=>this._write(e,h)).join(", ");return t.type==="array"?(X(e,`${t.type.padEnd(Le)} ${r} = [${a}];`,t.uid),r):o?`${t.type}(${a})`:(X(e,`${t.type.padEnd(Le)} ${r} = ${t.type}(${a});`,t.uid),r)}},oe=class wo{constructor(t,s,i){this.variableName=t,this.variableInputType=s,this.node=i,this.type="shader-input",this.isUsed=!1}clone(){return new wo(this.variableName,this.variableInputType,v(this.node))}},ae=class vo{constructor(t,s,i){this.outVariableName=t,this.outVariableType=s,this.node=i,this.type="shader-output"}clone(){const t=new vo(this.outVariableName,this.outVariableType,v(this.node));return t.variableName=this.variableName,t}},rn=class ei{static createVertex(t,s,i,n,r,o){const a=[];for(const l in t){const c=t[l],u=i.get(l);u?a.push(new oe(u,"builtin",c)):a.push(new oe("a_"+l,"in",c))}for(const l of n){const c=l.uniformHydrated;a.push(new oe(l.uniformName,"uniform",c))}const h=[];for(const l in s){const c=s[l];l==="glPosition"?h.push(new ae("gl_Position","builtin",c)):l==="glPointSize"?h.push(new ae("gl_PointSize","builtin",c)):h.push(new ae("v_"+l,"out",c))}return new ei(a,h,r,o)}static createFragment(t,s,i,n,r,o){const a=[],h=Array.from(r.rootOutputNodes());for(const c in t){const u=t[c],p=i.get(c);if(p){a.push(new oe(p,"builtin",u));continue}const d=h.find(f=>f.node===u);d&&a.push(new oe(d.outVariableName,"in",u))}for(const c of n){const u=c.uniformHydrated;a.push(new oe(c.uniformName,"uniform",u))}const l=[];for(const c in s){const u=s[c],p=i.get(c);c==="discard"?l.push(new ae(null,"discard",u)):p?l.push(new ae(p,"builtin",u)):l.push(new ae(c,"out",u))}return new ei(a,l,o)}constructor(t,s,i,n){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of t)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=s,this._transformFeedbackBindings=i,this._transformFeedbackNames=new Set(i.map(r=>"v_"+r.propertyKey)),this._usedInFragmentShader=n}shouldPruneOutputNode(t){return!!this._usedInFragmentShader&&t.outVariableType!=="builtin"&&!this._transformFeedbackNames.has(t.outVariableName)&&!this._usedInFragmentShader.has(t.node.uid)}setEmit(t,s){this._nodeEmitMap.set(t.uid,s)}getEmit(t){return this._nodeEmitMap.get(t.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(t){return this._inputShaderTypesByNodeUid.get(t.uid)}*rootOutputNodes(){for(const t of this._outputShaderTypes)yield t}*nodes(){const t=[];for(const s of this._outputShaderTypes.values())t.push(s.node);for(;t.length;){const s=t.pop();typeof s!="number"&&typeof s!="boolean"&&t.push(...s.children.filter(Boolean)),yield s}}*nodesOfTypeOrFunction(){for(const t of this.nodes())typeof t!="number"&&typeof t!="boolean"&&(yield t)}createSubgraphContext(){const t=this.clone();return t.body="",t.indent=this.indent+2,t._nodeEmitMap=new Map(this._nodeEmitMap),t}clone(){const t=new ei([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return t._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,t.indent=this.indent,t.body=this.body,t.varCount=this.varCount,t._nodeEmitMap=this._nodeEmitMap,t}insertVertexShader(t){t.vertex.code.add(""),this._insertInputs(t,"vertex"),t.vertex.code.add(""),t.vertex.code.add("// OUTPUTS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const s of this.rootOutputNodes()){const i=s.outVariableType==="builtin";this.shouldPruneOutputNode(s)||(i?t.vertex.code.add(`// ${s.outVariableType.padEnd(7)} ${s.node.type.padEnd(9)} ${s.outVariableName};`):t.vertex.code.add(`${s.outVariableType.padEnd(10)} ${s.node.type.padEnd(9)} ${s.outVariableName};`))}t.vertex.code.add(""),t.vertex.code.add("void main() {"),t.vertex.code.add(" "+this.body.split(` +`).join(` + `));for(const s of this.rootOutputNodes())this.shouldPruneOutputNode(s)||t.vertex.code.add(` ${s.outVariableName} = ${s.variableName};`);t.vertex.code.add("}")}insertFragmentShader(t){this._insertInputs(t,"fragment"),t.fragment.code.add(""),t.fragment.code.add("// OUTPUTS: "),t.fragment.code.add("// --------------------------------------------------------- ");for(const s of this.rootOutputNodes())s.outVariableType==="builtin"?t.fragment.code.add(`// ${s.outVariableType.padEnd(7)} ${s.node.type.padEnd(9)} ${s.outVariableName};`):t.fragment.code.add(`${s.outVariableType.padEnd(10)} ${s.node.type.padEnd(9)} ${s.outVariableName};`);t.fragment.code.add(""),t.fragment.code.add("void main() {"),t.fragment.code.add(" "+this.body.split(` +`).join(` + `));for(const s of this.rootOutputNodes())s.outVariableType==="discard"?(t.fragment.code.add(" // TODO: Should ensure codegen for discard appears first in fragment shader"),t.fragment.code.add(` if (${s.variableName}) {`),t.fragment.code.add(" discard;"),t.fragment.code.add(" }"),t.fragment.code.add(" ")):t.fragment.code.add(` ${s.outVariableName} = ${s.variableName};`);t.fragment.code.add("}")}_insertInputs(t,s){t[s].code.add("// INPUTS: "),t[s].code.add("// --------------------------------------------------------- ");for(const i of this.inputs())i.isUsed&&i.variableInputType!=="builtin"&&(i.node.type==="array"?t[s].code.add(`${i.variableInputType.padEnd(10)} ${i.node.elementType.type.padEnd(9)} ${i.variableName}[${i.node.size}];`):t[s].code.add(`${i.variableInputType.padEnd(10)} ${i.node.type.padEnd(9)} ${i.variableName};`))}};const Ul=()=>ge.getLogger("esri.views.2d.engine.webgl.shaderGraph.typed.TypedShaderProgram");function Ae(e,t,s){const i=t.length;if(i!==s){const n=new pn("Invalid Uniform",`Invalid length, expected ${s} but got ${i}`,{uniformName:e,values:t});Ul().errorOnce(n)}}let nn=class{constructor(e,t,s,i,n,r){this._program=null,this._vao=null,this._temporaryTextures=[],this.vertexShader=e,this.fragmentShader=t,this._locations=s,this._locationInfo=i,this._uniformBindings=n,this._transformFeedbackBindings=r}destroy(){this._program&&this._program.dispose(),this.cleanupTemporaryTextures()}get locations(){return this._locations}get locationInfo(){return this._locationInfo}setUniforms(e){this._uniforms=e}cleanupTemporaryTextures(){for(const e of this._temporaryTextures)e.dispose();this._temporaryTextures=[]}bind(e){const t=this._uniforms;if(!this._program){const i=new Map;for(const[r,o]of this._locations)i.set(r,o);const n=[];for(const r of this._transformFeedbackBindings??[]){const{index:o,propertyKey:a}=r;n[o]=`v_${a}`}this._program=new ka(e,this.vertexShader,this.fragmentShader,i,new Map,n)}const s=this._program;e.useProgram(s);for(const i of this._uniformBindings){const{shaderModulePath:n,uniformName:r,uniformType:o,uniformArrayLength:a}=i,h=Wo(n,t);if(h==null){if(o==="sampler2D")continue;throw new Error(`Failed to find uniform value for ${n}`)}switch(o==="array"?i.uniformArrayElementType:o){case"sampler2D":{const{unit:l,texture:c}=h;if(s.setUniform1i(r,l),"type"in c)e.bindTexture(c,l);else{const u=Ca(e,c.descriptor,c.data);e.bindTexture(u,l)}break}case"int":if(!a){s.setUniform1i(r,h);break}Ae(i.uniformName,h,a),s.setUniform1iv(r,h);break;case"float":if(!a){s.setUniform1f(r,h);break}Ae(i.uniformName,h,a),s.setUniform1fv(r,h);break;case"vec2":if(!a){s.setUniform2f(r,h[0],h[1]);break}Ae(i.uniformName,h,a),s.setUniform2fv(r,h.flat());break;case"vec3":if(!a){s.setUniform3f(r,h[0],h[1],h[2]);break}Ae(i.uniformName,h,a),s.setUniform3fv(r,h.flat());break;case"vec4":if(!a){s.setUniform4f(r,h[0],h[1],h[2],h[3]);break}Ae(i.uniformName,h,a),s.setUniform4fv(r,h.flat());break;case"mat3":s.setUniformMatrix3fv(r,h);break;case"mat4":s.setUniformMatrix4fv(r,h);break;default:throw new Error(`Unable to set uniform for type ${o}`)}}}};function Oe(e){return new e}function ys(e,t,s){const i=e.constructor[t]??[];e.constructor.hasOwnProperty(t)||Object.defineProperty(e.constructor,t,{value:i.slice()}),e.constructor[t].push(s)}function k(e,t){return(s,i)=>{ys(s,"locations",{typeCtor:t,propertyKey:i,parameterIndex:null,index:e})}}const R=e=>(t,s,i)=>{ys(t,"inputs",{inputCtor:e,propertyKey:s,parameterIndex:i})},M=e=>(t,s)=>{ys(t,"uniforms",{typeCtor:e,propertyKey:s})},Y=e=>(t,s)=>{ys(t,"options",{typeCtor:e,propertyKey:s})},on=(e,t)=>{ys(e,"defines",{propertyKey:t})},sr=(e,t)=>(s,i)=>{s.constructor.builtins.push({builtin:e,propertyKey:i,typeCtor:t})};class ir{}ir.builtins=[],g([sr("gl_VertexID",Gt)],ir.prototype,"glVertexID",void 0);let Yl=class{},os=class{};os.builtins=[],g([sr("gl_FragCoord",A)],os.prototype,"glFragCoord",void 0),g([sr("gl_PointCoord",T)],os.prototype,"glPointCoord",void 0);let Wl=class{},it=class{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}},ql=class{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const e=this._shaderModuleClass.inputs.findLast(t=>t.propertyKey==="vertex"&&t.parameterIndex===0);if(!e)throw new Error("Unable to find vertex input parameter");return e}get computeInput(){return this._shaderModuleClass.inputs.findLast(e=>e.propertyKey==="vertex"&&e.parameterIndex===1)}get fragmentInput(){const e=this._shaderModuleClass.inputs.findLast(t=>t.propertyKey==="fragment");if(!e)throw new Error("Unable to find fragment input parameter");return e}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const e=new Map,t=new Set;for(const s of this.locations)t.has(s.index)?ge.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${s.propertyKey} to ${s.index}. Index already in use`,{locationsMap:e}):(e.set(s.propertyKey,s.index),t.add(s.index));return e}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([n,r])=>`${n}.${r}`).join("."),s=Bo(t),i=this.computeAttributes;this._locationInfo={hash:s,locations:e,computeAttributeMap:i}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const t of this.locations)e.set("a_"+t.propertyKey,t.index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set;for(const t of this._options)e.add(t.propertyKey);this._optionPropertyKeys=e}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(e,t,s,i){try{const{vertex:n,fragment:r,uniformBindings:o}=this._generateShaders(e,t,s,i);return new nn(n,r,this.renamedLocationsMap,this.locationInfo,o,this.transformFeedbackBindings)}catch{return new nn("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(e){const t=this._options.find(i=>i.propertyKey===e);if(t)return{type:"option",className:t.typeCtor};const s=this._uniforms.find(i=>i.propertyKey===e);if(!s)throw new Error(`Unable to find uniform class type for property: ${e}`);return{type:"required",className:s.typeCtor}}getShaderKey(e,t,s,i){const n=Object.keys(e).map(h=>`${h}.${e[h]}`).join("."),r=Object.keys(s).map(h=>`${h}.${s[h]}`).join("."),o=Object.keys(i).map(h=>`${h}.${i[h]}`).join("."),a=Object.keys(t).filter(h=>this.optionPropertyKeys.has(h)&&t[h]).join(".");return`${this.constructor.name}.${n}.${r}.${o}.${a}`}_generateShaders(e,t,s,i){const n=[];this._setDefines(s),this._setOptionalUniforms(n,t),this._setRequiredUniforms(n);const r=this._hydrateVertexInput(i),o=this._injectPackPrecisionFactor(r,e),a=this._hydrateComputeInput(),h=a&&this._injectComputePackPrecisionFactor(a,e),l=this.vertex(o,h),c=this._hydrateFragmentInput(l),u=this.fragment(c),p=new Set;for(const w in u){const S=u[w];vl(p,S)}const d=this._getVertexInputBuiltins(),f=rn.createVertex({...r,...a},l,d,n,this.transformFeedbackBindings,p);new sn().write(f);const m=this._getFragmentInputBuiltins(u);m.set("glPointCoord","gl_PointCoord");const _=rn.createFragment(c,u,m,n,f,this.transformFeedbackBindings);new sn().write(_);const y=this._createShaderBuilder(f,_),b=y.generate("vertex",!0),P=y.generate("fragment",!0);return this.logShader&&(console.log(b),console.log(P)),{vertex:b,fragment:P,uniformBindings:n}}_setDefines(e){for(const t in e)this[t]=e[t]}_setOptionalUniforms(e,t){for(const s of this._options)t[s.propertyKey]?this[s.propertyKey]=this._hydrateUniformGroup(e,s):this[s.propertyKey]=null}_setRequiredUniforms(e){for(const t of this._uniforms)this[t.propertyKey]=this._hydrateUniformGroup(e,t)}_hydrateUniformGroup(e,t){const s=new t.typeCtor;for(const i of s._uniforms??[]){const n=Oe(i.typeCtor),r=`u_${t.propertyKey}_${i.propertyKey}`,o=n.type,a=[t.propertyKey,i.propertyKey].join(".");if("type"in i.typeCtor&&i.typeCtor.type==="array"){const h=n;e.push({shaderModulePath:a,uniformName:r,uniformType:o,uniformArrayLength:h.size,uniformArrayElementType:h.elementType.type,uniformHydrated:n})}else e.push({shaderModulePath:a,uniformName:r,uniformType:o,uniformHydrated:n});s[i.propertyKey]=n}return s}_hydrateVertexInput(e){const t=this.vertexInput.inputCtor,s=t.locations.reduce((i,n)=>e[n.propertyKey]===!1?i:{...i,[n.propertyKey]:Oe(n.typeCtor)},{});for(const{propertyKey:i,typeCtor:n}of t.builtins){const r=Oe(n);s[i]=r}return s}_hydrateComputeInput(){return this.computeInput==null?null:this.computeInput.inputCtor.locations.reduce((e,t)=>({...e,[t.propertyKey]:Oe(t.typeCtor)}),{})}_injectPackPrecisionFactor(e,t){const s={};for(const i in e){const n=e[i],r=t[i];if(r){if(n.type!=="float"&&n.type!=="vec2"&&n.type!=="vec3"&&n.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${n.type}`);s[i]=n.divide(new x(r))}else s[i]=n}return s}_injectComputePackPrecisionFactor(e,t){const s={},i=new Map;for(const n in this.computeAttributes)for(const r of this.computeAttributes[n]??[])i.set(r,n);for(const n in e){const r=e[n],o=i.get(n);if(!o)continue;const a=t[o];if(a){if(r.type!=="float"&&r.type!=="vec2"&&r.type!=="vec3"&&r.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${r.type}`);s[n]=r.divide(new x(a))}else s[n]=r}return s}_hydrateFragmentInput(e){const t={};for(const s in e)t[s]=e[s];for(const{propertyKey:s,typeCtor:i}of os.builtins){const n=Oe(i);t[s]=n}return t}_getVertexInputBuiltins(){const e=this.vertexInput.inputCtor,t=new Map;for(const{builtin:s,propertyKey:i}of e.builtins)t.set(i,s);return t}_getFragmentInputBuiltins(e){const t=e.constructor,s=new Map;for(const i of t.builtins??[])s.set(i.propertyKey,i.builtin);return s}_createShaderBuilder(e,t){const s=new ml;return this._insertDebugInfo(s),e.insertVertexShader(s),t.insertFragmentShader(s),s}_insertDebugInfo(e){e.vertex.code.add("// DEFINES: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._defines)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`);e.vertex.code.add(""),e.vertex.code.add("// OPTIONS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._options)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`)}};function an(e){const t=F(12.9898),s=F(78.233),i=F(43758.5453),n=br(e,Qi(t,s)),r=Pe(n,F(3.14));return bo(Pr(r).multiply(i))}function te(e){return _r(e,F(ll))}function Kl(e,t){return e.x.multiply(t.y).subtract(t.x.multiply(e.y))}function jl(e){return e.multiply(2).subtract(1)}function Vt(e,t){const s=F(2**t);return Pe(Hl(e.divide(s)),F(2))}function xu(e,t){return et(Vt(e,t),F(.5))}function Ii(e,t){return Vt(e,t+mn)}function Jl(e,t){return Vt(e,t)}function Zl(e){const t=Vt(e.z,7),s=F(1).subtract(t),i=e.xyz.subtract(Ol(0,0,F(128)));return s.multiply(e).add(t.multiply(i))}function Ql(e){const t=El(.99609375,.0038909912109375,1519918441772461e-20,59371814131736755e-24);return br(e,t)}function bu(e){return de(de(de(e.x,e.y),e.z),e.w)}function Pu(e){return new x(1).subtract(e)}function wu(e){return e.subtract(new x(1))}function vu(e,t){return e.subtract(new x(t))}let ft=class extends it{getVisualVariableData(e){if(!this._vvData){const t=this.getAttributeDataCoords(e);this._vvData=_t(this.visualVariableData,t).setDebugName("storage2")}return this._vvData}getAttributeDataCoords(e){if(!this._uv){const t=Zl(e),s=this.size,i=ne(t.x),n=ne(t.y).multiply(ne(256)),r=ne(t.z).multiply(ne(256)).multiply(ne(256)),o=F(i.add(n).add(r)),a=Pe(o,s),h=o.subtract(a).divide(s);this._uv=new T(a,h).add(.5).divide(s)}return this._uv}getFilterData(e){const t=this.getAttributeDataCoords(e);return _t(this.filterFlags,t).setDebugName("storage0")}getAnimationData(e){const t=this.getAttributeDataCoords(e);return _t(this.animation,t).setDebugName("storage1")}getVVData(e){return this.getVisualVariableData(e)}getDataDrivenData0(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven0,t).setDebugName("storage30")}getDataDrivenData1(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven1,t).setDebugName("storage31")}getDataDrivenData2(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven2,t).setDebugName("storage32")}getGPGPUData(e){const t=this.getAttributeDataCoords(e);return _t(this.gpgpu,t).setDebugName("storage4")}getLocalTimeOrigin(e){const t=this.getAttributeDataCoords(e);return _t(this.localTimeOrigin,t).x.setDebugName("storage5")}getFilterFlags(e){return li("webgl-ignores-sampler-precision")?Vl(this.getFilterData(e).x.multiply(F(255))):this.getFilterData(e).x.multiply(F(255))}getLabelVisibility(e){const t=this.getFilterData(e).y.multiply(255);return new x(1).subtract(t)}getAnimationValue(e){return this.getAnimationData(e).x}getSizeValue(e){return this.getVisualVariableData(e).x}getColorValue(e){return this.getVisualVariableData(e).y}getOpacityValue(e){return this.getVisualVariableData(e).z}getRotationValue(e){return this.getVisualVariableData(e).w}};g([M(mt)],ft.prototype,"filterFlags",void 0),g([M(mt)],ft.prototype,"animation",void 0),g([M(mt)],ft.prototype,"gpgpu",void 0),g([M(mt)],ft.prototype,"localTimeOrigin",void 0),g([M(mt)],ft.prototype,"visualVariableData",void 0),g([M(mt)],ft.prototype,"dataDriven0",void 0),g([M(mt)],ft.prototype,"dataDriven1",void 0),g([M(mt)],ft.prototype,"dataDriven2",void 0),g([M(x)],ft.prototype,"size",void 0);let rr=class extends it{};g([M(x)],rr.prototype,"activeReasons",void 0),g([M(x)],rr.prototype,"highlightAll",void 0);let is=class extends it{};g([M(T)],is.prototype,"position",void 0),g([M(x)],is.prototype,"distance",void 0),g([M(x)],is.prototype,"smallSymbolDistance",void 0),g([M(x)],is.prototype,"smallSymbolSizeThreshold",void 0);let K=class extends it{};g([M(xt)],K.prototype,"displayViewScreenMat3",void 0),g([M(xt)],K.prototype,"displayViewMat3",void 0),g([M(xt)],K.prototype,"displayMat3",void 0),g([M(xt)],K.prototype,"viewMat3",void 0),g([M(xt)],K.prototype,"tileMat3",void 0),g([M(x)],K.prototype,"displayZoomFactor",void 0),g([M(x)],K.prototype,"requiredZoomFactor",void 0),g([M(T)],K.prototype,"tileOffset",void 0),g([M(x)],K.prototype,"currentScale",void 0),g([M(x)],K.prototype,"currentZoom",void 0),g([M(x)],K.prototype,"metersPerSRUnit",void 0),g([M(x)],K.prototype,"rotation",void 0),g([M(x)],K.prototype,"pixelRatio",void 0);let Zt=class extends ir{};g([k(0,H)],Zt.prototype,"id",void 0),g([k(1,x)],Zt.prototype,"bitset",void 0),g([k(2,T)],Zt.prototype,"pos",void 0);let zt=class extends Yl{};g([k(14,T)],zt.prototype,"nextPos1",void 0),g([k(15,T)],zt.prototype,"nextPos2",void 0);let gi=class extends os{},It=class extends ql{clip(e,t){let s=new x(0);const i=this.storage.getFilterFlags(e);if(s=s.add(F(2).multiply(F(1).subtract(Ii(i,0)))),this.inside?s=s.add(F(2).multiply(F(1).subtract(Ii(i,1)))):this.outside?s=s.add(F(2).multiply(Ii(i,1))):this.highlight&&(s=s.add(F(2).multiply(F(1).subtract(this._checkHighlight(i))))),t!=null){const n=new x(1).subtract(Dt(t.x,this.view.currentZoom)),r=Dt(t.y,this.view.currentZoom);s=s.add(new x(2).multiply(n.add(r)))}return s}getFragmentOutput(e,t,s=new x(1/255)){const i=new Wl;return i.glFragColor=this._maybeWriteHittest(t)??this._maybeHighlight(e,s)??e,i}_maybeHighlight(e,t){return this.highlight?new A(e.rgb,Dt(t,e.a)):null}_checkHighlight(e){let t=this._checkHighlightBit(e,0);for(let s=1;s{const h=as(e,t,s),l=as(e,s,i),c=as(e,i,t);return er(er(h,l),c)}])}function So(e){return e.distance.add(1)}function wr(e,t,s){const{viewMat3:i,tileMat3:n}=e.view,r=i.multiply(n),o=r.multiply(new H(t.pos,1)),a=r.multiply(new H(s.nextPos1,1)),h=r.multiply(new H(s.nextPos2,1));return rc(e.hittestRequest.position,o.xy,a.xy,h.xy)}function Su(e,t,s){return xo(e,s).subtract(t)}let us=class extends it{getColor(e,t,s){return ms([go(te(e),s),t],[mi(e,this.values.first()),this.colors.first()],[_i(e,this.values.last()),this.colors.last()],[!0,()=>{const i=this.values.findIndex(h=>et(h,e)),n=this.values.get(i),r=i.subtract(1),o=this.values.get(r),a=e.subtract(o).divide(n.subtract(o));return be(this.colors.get(r),this.colors.get(i),a)}])}};g([M(ct.ofType(A,8))],us.prototype,"colors",void 0),g([M(ct.ofType(x,8))],us.prototype,"values",void 0);let ps=class extends it{getOpacity(e){return ms([te(e),new x(1)],[mi(e,this.opacityValues.first()),this.opacities.first()],[_i(e,this.opacityValues.last()),this.opacities.last()],[!0,()=>{const t=this.opacityValues.findIndex(o=>et(o,e)),s=this.opacityValues.get(t),i=t.subtract(1),n=this.opacityValues.get(i),r=e.subtract(n).divide(s.subtract(n));return be(this.opacities.get(i),this.opacities.get(t),r)}])}};g([M(ct.ofType(x,8))],ps.prototype,"opacities",void 0),g([M(ct.ofType(x,8))],ps.prototype,"opacityValues",void 0);function Mo(e){return e.visualVariableSizeMinMaxValue!=null||e.visualVariableSizeScaleStops!=null||e.visualVariableSizeStops!=null||e.visualVariableSizeUnitValue!=null}function nc(e,t,s){if(Mo(e)){const i=e.storage.getSizeValue(t);return e.visualVariableSizeMinMaxValue?.getSize(i,s)??e.visualVariableSizeScaleStops?.getSizeForViewScale(e.view.currentScale)??e.visualVariableSizeStops?.getSize(i,s)??e.visualVariableSizeUnitValue?.getSize(i,s)}return s}function vr(e,t,s,i=new j(!1)){if(e.visualVariableColor==null)return s;const n=e.storage.getColorValue(t);return e.visualVariableColor.getColor(n,s,i)}function Sr(e,t){if(e.visualVariableOpacity==null)return new x(1);const s=e.storage.getOpacityValue(t);return e.visualVariableOpacity.getOpacity(s)}function Mu(e,t){if(e.visualVariableRotation==null)return xt.identity();const s=e.storage.getRotationValue(t);return e.visualVariableRotation.getVVRotationMat3(s)}function Cu(e,t){if(e.visualVariableRotation==null)return new x(0);const s=e.storage.getRotationValue(t);return e.visualVariableRotation.getNormalizedAngle(s)}let ds=class extends Zt{};g([k(3,A)],ds.prototype,"color",void 0),g([k(4,T)],ds.prototype,"zoomRange",void 0);let ue=class extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(e,t){const s=Sr(this,e.id),i=vr(this,e.id,e.color).multiply(s),n=this.view.displayViewScreenMat3.multiply(new H(e.pos.xy,1)),r=this.clip(e.id,e.zoomRange);return{glPosition:new A(n.xy,r,1),color:i,...this.maybeRunHittest(e,t,null)}}fragment(e){return this.getFragmentOutput(e.color,e,new x(0))}hittest(e,t){return wr(this,e,t)}};g([Y(us)],ue.prototype,"visualVariableColor",void 0),g([Y(ps)],ue.prototype,"visualVariableOpacity",void 0),g([$(0,R(ds)),$(1,R(zt))],ue.prototype,"vertex",null),g([$(0,R(gi))],ue.prototype,"fragment",null);let me=class extends it{getPatternOffsetAtTileOrigin(e,t=new x(0),s=new x(1)){const i=new T(dl).divide(e);let n=e.multiply(bo(this.maxIntsToLocalOrigin.multiply(i))).add(this.tileOffsetFromLocalOrigin).subtract(new x(.5).multiply(e));return n=new T(n.x.multiply(s).subtract(n.y.multiply(t)),n.x.multiply(t).add(n.y.multiply(s))),Pe(n,e)}};g([M(T)],me.prototype,"tileOffsetFromLocalOrigin",void 0),g([M(T)],me.prototype,"maxIntsToLocalOrigin",void 0);let _e=class extends it{};g([M(T)],_e.prototype,"size",void 0),g([M(mt)],_e.prototype,"texture",void 0);let Ut=class extends ds{};g([k(5,A)],Ut.prototype,"tlbr",void 0),g([k(6,x)],Ut.prototype,"width",void 0),g([k(7,x)],Ut.prototype,"height",void 0),g([k(8,T)],Ut.prototype,"offset",void 0),g([k(9,T)],Ut.prototype,"scale",void 0),g([k(10,x)],Ut.prototype,"angle",void 0);let oc=class extends gi{};function ac(e,t,s,i,n){const r=_r(Vt(n,pl),F(1)),o=Ql(new A(e,0));return B(r,en(i.divide(t.x),s.divide(t.y),0,ni(s.divide(t.x)),i.divide(t.y),0,an(Qi(o,0)),an(Qi(0,o)),1),en(i.divide(t.x),s.divide(t.y),0,ni(s.divide(t.x)),i.divide(t.y),0,0,0,1))}function Co(e,t){const s=e.view.requiredZoomFactor,i=new T(t.width,t.height),n=i.multiply(t.scale).multiply(s),r=t.angle.multiply(nl),o=Pr(r),a=yo(r),h=ac(t.id,n,o,a,t.bitset),l=e.localTileOffset.getPatternOffsetAtTileOrigin(i,o,a),c=s.multiply(t.scale).multiply(t.offset.subtract(l)).divide(n),u=new H(t.pos,1),p=h.multiply(u).xy.subtract(c),d=t.tlbr.divide(e.mosaicInfo.size.xyxy);let f=Vt(t.bitset,cl);return e.visualVariableColor!=null&&(f=B(te(e.storage.getColorValue(t.id)),new x(0),f)),{tileTextureCoord:p,tlbr:d,sampleAlphaOnly:f}}function Io(e,t){const s=Pe(t.tileTextureCoord,new x(1)),i=be(t.tlbr.xy,t.tlbr.zw,s);let n=_t(e.mosaicInfo.texture,i);return n=B(et(t.sampleAlphaOnly,new x(.5)),n.aaaa,n),t.color.multiply(n)}let Es=class extends ue{vertex(e,t){return{...super.vertex(e,t),...Co(this,e)}}fragment(e){const t=Io(this,e);return this.getFragmentOutput(t,e,new x(0))}};g([M(_e)],Es.prototype,"mosaicInfo",void 0),g([M(me)],Es.prototype,"localTileOffset",void 0),g([$(0,R(Ut)),$(1,R(zt))],Es.prototype,"vertex",null),g([$(0,R(oc))],Es.prototype,"fragment",null);let Mr=class extends it{getSize(e,t){const s=this.minMaxValueAndSize.xy,i=this.minMaxValueAndSize.zw;return B(te(e),t,()=>{const n=e.subtract(s.x).divide(s.y.subtract(s.x)),r=xr(n,new x(0),new x(1));return i.x.add(r.multiply(i.y.subtract(i.x)))})}};g([M(A)],Mr.prototype,"minMaxValueAndSize",void 0);let oi=class extends it{getSizeForViewScale(e){return ms([mi(e,this.values.first()),this.sizes.first()],[_i(e,this.values.last()),this.sizes.last()],[!0,()=>{const t=this.values.findIndex(o=>et(o,e)),s=this.values.get(t),i=t.subtract(1),n=this.values.get(i),r=e.subtract(n).divide(s.subtract(n));return be(this.sizes.get(i),this.sizes.get(t),r)}])}};g([M(ct.ofType(x,8))],oi.prototype,"sizes",void 0),g([M(ct.ofType(x,8))],oi.prototype,"values",void 0);let ai=class extends it{getSize(e,t){const s=ms([te(e),t],[mi(e,this.values.first()),this.sizes.first()],[_i(e,this.values.last()),this.sizes.last()],[!0,()=>{const i=this.values.findIndex(h=>et(h,e)),n=this.values.get(i),r=i.subtract(1),o=this.values.get(r),a=e.subtract(o).divide(n.subtract(o));return be(this.sizes.get(r),this.sizes.get(i),a)}]);return B(te(s),t,s)}};g([M(ct.ofType(x,8))],ai.prototype,"sizes",void 0),g([M(ct.ofType(x,8))],ai.prototype,"values",void 0);let Cr=class extends it{getSize(e,t){return B(te(e),t,e.multiply(this.unitValueToPixelsRatio))}};g([M(x)],Cr.prototype,"unitValueToPixelsRatio",void 0);class Yt extends Zt{}g([k(3,A)],Yt.prototype,"color",void 0),g([k(4,T)],Yt.prototype,"offset",void 0),g([k(5,T)],Yt.prototype,"normal",void 0),g([k(6,x)],Yt.prototype,"halfWidth",void 0),g([k(7,x)],Yt.prototype,"referenceHalfWidth",void 0),g([k(8,T)],Yt.prototype,"zoomRange",void 0);let ko=class extends gi{},hi=class extends it{};function To(e){return de(new x(ol).multiply(Dt(e,new x(al))),new x(1))}function hc(e,t){const{halfWidth:s,normal:i}=e,n=To(s),r=Po(i).multiply(s);return xr(n.multiply(s.subtract(r)).divide(t.add(n).subtract(new x(1))),new x(0),new x(1))}function lc(e,t){const{id:s,halfWidth:i,referenceHalfWidth:n}=t;if(Mo(e)){const r=new x(2).multiply(n),o=nc(e,s,r);return new x(.5).multiply(i.divide(de(n,new x(hl)))).multiply(o)}return i}function zo(e,t){const{id:s,offset:i,pos:n,normal:r,zoomRange:o}=t,{displayViewScreenMat3:a,displayViewMat3:h}=e.view,l=vr(e,s,t.color),c=Sr(e,s),u=lc(e,t),p=new x(.5).multiply(e.antialiasingControls.antialiasing),d=de(u.add(p),new x(.45)).add(new x(.1).multiply(p)),f=To(d).multiply(d).multiply(i),m=h.multiply(new H(f,new x(0))),_=a.multiply(new H(n,new x(1))).add(m),y=new x(2).multiply(Dt(u,new x(0))).add(e.clip(s,o)),b=new A(_.xy,y,1);return{color:l,opacity:c,halfWidth:d,normal:r,scaledOffset:f,scaledHalfWidth:u,glPosition:new A(b.xy,y,1)}}function yi(e,t){const{opacity:s,color:i}=e,n=hc(e,t);return s.multiply(i).multiply(n)}g([M(x)],hi.prototype,"antialiasing",void 0),g([M(x)],hi.prototype,"blur",void 0);class vt extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,s){const i=zo(this,t);return{...i,...this.maybeRunHittest(t,s,i.halfWidth)}}fragment(t){const s=yi(t,this.antialiasingControls.blur);return this.getFragmentOutput(s,t)}hittest(t,s,i){const{viewMat3:n,tileMat3:r}=this.view,o=n.multiply(r),a=o.multiply(new H(t.pos,1)),h=o.multiply(new H(s.nextPos1,1)),l=o.multiply(new H(s.nextPos2,1)),{distance:c,smallSymbolDistance:u,smallSymbolSizeThreshold:p}=this.hittestRequest,d=Dt(i,p.multiply(.5)).multiply(c.subtract(u)),f=this.hittestRequest.position;return er(as(f,a.xy,h.xy),as(f,a.xy,l.xy)).subtract(i).add(d)}}g([M(hi)],vt.prototype,"antialiasingControls",void 0),g([Y(us)],vt.prototype,"visualVariableColor",void 0),g([Y(ps)],vt.prototype,"visualVariableOpacity",void 0),g([Y(Mr)],vt.prototype,"visualVariableSizeMinMaxValue",void 0),g([Y(oi)],vt.prototype,"visualVariableSizeScaleStops",void 0),g([Y(ai)],vt.prototype,"visualVariableSizeStops",void 0),g([Y(Cr)],vt.prototype,"visualVariableSizeUnitValue",void 0),g([$(0,R(Yt)),$(1,R(zt))],vt.prototype,"vertex",null),g([$(0,R(ko))],vt.prototype,"fragment",null);class Nt extends Zt{}g([k(3,T)],Nt.prototype,"offset",void 0),g([k(4,A)],Nt.prototype,"color",void 0),g([k(5,T)],Nt.prototype,"normal",void 0),g([k(6,x)],Nt.prototype,"halfWidth",void 0),g([k(7,x)],Nt.prototype,"referenceHalfWidth",void 0),g([k(8,T)],Nt.prototype,"zoomRange",void 0);let Lo=class extends ko{};function Ir(e,t,s){const{id:i,bitset:n}=t,r=Vt(n,ul),o=et(r,new x(.5)),a=zo(e,t),h=B(o,a.halfWidth,new x(0)),l=Sr(e,i),c=vr(e,i,t.color),u=B(o,t.color,c.multiply(l)),p=e.view.displayViewScreenMat3.multiply(new H(t.pos.xy,1)),d=e.clip(t.id),f=new A(p.xy,d,1),m=B(o,a.glPosition,f),_=s&&e.maybeRunHittest(t,s,o);return{isOutline:r,color:u,opacity:new x(1),halfWidth:h,normal:a.normal,glPosition:m,..._}}let Ct=class extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}};g([M(hi)],Ct.prototype,"antialiasingControls",void 0),g([Y(us)],Ct.prototype,"visualVariableColor",void 0),g([Y(ps)],Ct.prototype,"visualVariableOpacity",void 0),g([Y(Mr)],Ct.prototype,"visualVariableSizeMinMaxValue",void 0),g([Y(oi)],Ct.prototype,"visualVariableSizeScaleStops",void 0),g([Y(ai)],Ct.prototype,"visualVariableSizeStops",void 0),g([Y(Cr)],Ct.prototype,"visualVariableSizeUnitValue",void 0);class nr extends Ct{vertex(t,s){return Ir(this,t,s)}fragment(t){const{color:s,isOutline:i}=t,n=et(i,new x(.5)),r=yi(t,this.antialiasingControls.blur),o=B(n,r,s),a=B(n,new x(1/255),new x(0));return this.getFragmentOutput(o,t,a)}hittest(t,s,i){return B(i,So(this.hittestRequest),wr(this,t,s))}}g([$(0,R(Nt)),$(1,R(zt))],nr.prototype,"vertex",null),g([$(0,R(Lo))],nr.prototype,"fragment",null);let or=class extends ds{};g([k(5,A)],or.prototype,"tlbr",void 0),g([k(6,x)],or.prototype,"inverseRasterizationScale",void 0);class cc extends gi{}function uc(e){const t=new x(1),s=new x(0);return new xt(t.divide(e.x),s.divide(e.y),0,ni(s.divide(e.x)),t.divide(e.y),0,0,0,1)}function Ao(e,t){const s=t.tlbr.xy,i=t.tlbr.zw,n=i.x.subtract(s.x),r=s.y.subtract(i.y),o=new T(n,r).multiply(t.inverseRasterizationScale),a=o.multiply(e.view.requiredZoomFactor),h=uc(a),l=e.localTileOffset.getPatternOffsetAtTileOrigin(o).divide(a),c=new H(t.pos,1);return{tileTextureCoord:h.multiply(c).xy.subtract(l),tlbr:t.tlbr.divide(e.mosaicInfo.size.xyxy)}}function Oo(e,t){const s=Pe(e.tileTextureCoord,new x(1)),i=be(e.tlbr.xy,e.tlbr.zw,s),n=_t(t.texture,i);return e.color.multiply(n)}class Fs extends ue{vertex(t,s){return{...super.vertex(t,s),...Ao(this,t)}}fragment(t){const s=Oo(t,this.mosaicInfo);return this.getFragmentOutput(s,t,new x(0))}}g([M(_e)],Fs.prototype,"mosaicInfo",void 0),g([M(me)],Fs.prototype,"localTileOffset",void 0),g([$(0,R(or)),$(1,R(zt))],Fs.prototype,"vertex",null),g([$(0,R(cc))],Fs.prototype,"fragment",null);let ar=class extends Nt{};g([k(9,A)],ar.prototype,"tlbr",void 0),g([k(10,x)],ar.prototype,"inverseRasterizationScale",void 0);let Eo=class extends Lo{},Ns=class extends nr{vertex(e,t){return{...Ir(this,e,t),...Ao(this,e)}}fragment(e){const{isOutline:t}=e,s=et(t,new x(.5)),i=yi(e,this.antialiasingControls.blur),n=Oo(e,this.mosaicInfo),r=B(s,i,n),o=B(s,new x(1/255),new x(0));return this.getFragmentOutput(r,e,o)}};g([M(_e)],Ns.prototype,"mosaicInfo",void 0),g([M(me)],Ns.prototype,"localTileOffset",void 0),g([$(0,R(ar)),$(1,R(zt))],Ns.prototype,"vertex",null),g([$(0,R(Eo))],Ns.prototype,"fragment",null);const pc=16,hn=1/pc,dc=128;class St extends Zt{}g([k(3,A)],St.prototype,"color",void 0),g([k(4,A)],St.prototype,"tlbr",void 0),g([k(5,x)],St.prototype,"angle",void 0),g([k(6,x)],St.prototype,"aux1",void 0),g([k(7,x)],St.prototype,"aux2",void 0),g([k(8,T)],St.prototype,"aux3",void 0),g([k(9,T)],St.prototype,"aux4",void 0),g([k(10,T)],St.prototype,"zoomRange",void 0);class fc extends Eo{}class $s extends Ct{vertex(t,s){const{aux1:i,aux2:n,aux3:r,aux4:o}=t,a={...t,width:i,height:n,offset:r,scale:o.multiply(hn)},h={...t,halfWidth:i,referenceHalfWidth:n,offset:r,normal:o.subtract(dc).multiply(hn)},l=Ir(this,h),c=Co(this,a),u=et(l.isOutline,new x(.5));return{...l,...c,...this.maybeRunHittest(t,s,u)}}fragment(t){const{isOutline:s}=t,i=et(s,new x(.5)),n=yi(t,this.antialiasingControls.blur),r=Io(this,t),o=B(i,n,r),a=B(i,new x(1/255),new x(0));return this.getFragmentOutput(o,t,a)}hittest(t,s,i){return B(i,So(this.hittestRequest),wr(this,t,s))}}g([M(_e)],$s.prototype,"mosaicInfo",void 0),g([M(me)],$s.prototype,"localTileOffset",void 0),g([$(0,R(St)),$(1,R(zt))],$s.prototype,"vertex",null),g([$(0,R(fc))],$s.prototype,"fragment",null);const mc=8388607,_c=8388608,Iu=e=>e&mc;function ku(e,t){return((t?_c:0)|e)>>>0}var ln;(function(e){e.Local="Local",e.Global="Global"})(ln||(ln={}));class we{generateSource(t){const s=[];for(let n=1;n= ${hr}) { top = ${hr-1}; }`);return s}}let ve=128;class gc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}class yc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}}class xc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}}class bc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}}function hs(e){return[`float duration = clamp(${e.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${e.startTimeOffset};`,`float repeatDelay = ${e.repeatDelay};`,`float timeOriginSelector = ${e.timeOriginSelector};`,`float repeatType = ${e.repeatType};`,`float easing = ${e.easing};`,`float playAnimation = ${e.playAnimation} * (1.0 - step(0.0, -${e.duration}));`,`float reverseAnimation = ${e.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${e.out} = oscillate ? 1.0 - of : of;`]}const Pc={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},wc={Loop:1,None:2,Oscillate:3},vc={Local:1,Global:2};function ls(e){const t=Pc[e.easing],s=wc[e.repeatType],i=vc[e.timeOriginSelector];return[[e.duration,e.startTimeOffset,e.repeatDelay,i],[s,t,e.playAnimation,e.reverseAnimation]]}class Sc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...hs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...hs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...hs({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;",` + vec2 translation = vec2( + cos1 * s1 * x2 - sin1 * s1 * y2 + x1, + sin1 * s1 * x2 + cos1 * s1 * y2 + y1 + ); + `,"out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...ls(t.translation.timing),...ls(t.rotation.timing),...ls(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,0,0]]}}class Mc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...hs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...hs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...ls(t.color.timing),...ls(t.opacity.timing)]}}const cn={scalar:new yc,vector3:new xc,vector4:new bc,animatedTransform:new Sc,animatedColor:new Mc,ret:new gc},Cc=40,hr=4;function Tu(e){const t=[];t.push(`float globalTime = ${e.globalTime};`),t.push(`float localTimeOrigin = ${e.localTimeOrigin};`),t.push(`vec2 pointer = ${e.animationPointer};`),t.push(`vec2 size = ${e.animationTextureSize};`),t.push("int top = 0;"),t.push(`vec4 stack[${hr}];`),t.push(`for (int counter = 0; counter < ${Cc}; counter++) {`),t.push(`vec4 atom0 = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push("pointer.x += 1.0;"),t.push(`vec2 pixelDimensions = ${e.pixelDimensions};`),t.push("if (false) {");for(const s in cn){const i=cn[s];t.push(`} else if (int(atom0.x) == ${i.opcode}) {`);for(const n of i.generateSource(e))t.push(n)}return t.push("} // End if-else."),t.push("} // End for."),t.push(`${e.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),t.join(` +`)}let Rs=class extends Go{constructor(e){super(e),this.debugName="",this._updatingHandles=new za,this._idToUpdatingState=new Ta}get updating(){const e=this._updatingHandles.updating||Array.from(this._idToUpdatingState.values()).some(t=>t);if(li("esri-2d-log-updating")){const t=Array.from(this._idToUpdatingState.entries()).map(([s,i])=>`-> ${s}: ${i}`).join(` +`);console.log(`${this.debugName}: Updating: ${e} +-> Handles: ${this._updatingHandles.updating} +${t}`)}return e}addUpdateTracking(e,t){const s=Vo(()=>t.updating,i=>this._idToUpdatingState.set(e,i),{sync:!0});this.addHandles(s)}addPromise(e){return this._updatingHandles.addPromise(e)}};g([kr({constructOnly:!0})],Rs.prototype,"debugName",void 0),g([kr({readOnly:!0})],Rs.prototype,"updating",null),Rs=g([$o("esri.views.2d.layers.support.UpdateTracking2D")],Rs);export{te as $,on as A,xh as B,it as C,Fr as D,N as E,B as F,cn as G,bh as H,ns as I,zh as J,Th as K,A as L,xt as M,_r as N,lh as O,pl as P,ku as Q,fh as R,x as S,Zr as T,au as U,Zt as V,lu as W,ou as X,hu as Y,Iu as Z,nl as _,Rs as a,su as a$,It as a0,Cu as a1,Pr as a2,yo as a3,H as a4,mi as a5,ms as a6,_t as a7,Ql as a8,iu as a9,Po as aA,gu as aB,br as aC,bu as aD,ue as aE,Es as aF,$s as aG,nr as aH,Fs as aI,Ns as aJ,Su as aK,er as aL,Hl as aM,ru as aN,Mu as aO,nu as aP,Gt as aQ,pu as aR,du as aS,vt as aT,Yt as aU,bo as aV,yu as aW,mu as aX,zo as aY,hc as aZ,mt as a_,xr as aa,Gl as ab,Yl as ac,Vt as ad,Ll as ae,nc as af,vr as ag,go as ah,j as ai,xu as aj,be as ak,Sr as al,$l as am,xo as an,rc as ao,et as ap,sc as aq,T as ar,ni as as,ec as at,Dt as au,So as av,R as aw,ir as ax,ql as ay,de as az,pc as b,_o as b0,Tu as b1,_e as b2,us as b3,ps as b4,Mr as b5,oi as b6,ai as b7,Cr as b8,Wl as b9,K as ba,gi as bb,zt as bc,os as bd,nn as be,jl as bf,Pu as bg,wu as bh,vu as bi,_u as bj,uu as bk,Ot as bl,fu as bm,cu as bn,tu as bo,Qc as bp,Jc as bq,eu as br,Zc as bs,qc as bt,Fi as bu,Kc as c,ul as d,dc as e,jr as f,Oa as g,Kn as h,jc as i,mh as j,re as k,ln as l,_h as m,Wc as n,vh as o,Ih as p,Ch as q,Yn as r,mc as s,k as t,Yc as u,M as v,Y as w,cl as x,ll as y,ct as z}; diff --git a/main/assets/UpdateTracking2D-Du_WIf4G-lOu4AoIx.js b/main/assets/UpdateTracking2D-Du_WIf4G-lOu4AoIx.js deleted file mode 100644 index fc804e6a0..000000000 --- a/main/assets/UpdateTracking2D-Du_WIf4G-lOu4AoIx.js +++ /dev/null @@ -1,62 +0,0 @@ -import{d as No}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import{v as g,hF as $,S as kr,i as $o,P as pe,hG as Ro,hH as Do,ff as un,K as li,j as Go,ah as Vo,cS as Ho,cN as rt,cO as gt,fr as ht,bh as Qt,g_ as lr,cP as Ds,f3 as bt,f4 as fe,a1 as ge,hI as xs,hm as Bo,hJ as ci,cM as ki,l as Xo,ec as Uo,h0 as Yo,N as Wo,hK as Jt,J as cr,hL as qo,hM as ui,hN as Ko,hO as jo,hP as Jo,R as Zo,C as Qo,hQ as ta,o as pn,hR as ea}from"./main-BZaw9FpY.js";import{c as si}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{E as bs,d as Tr,D as sa}from"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import{f as Gs,M as Ps,S as lt,R as kt,o as Rt,d as ia,a as ra,l as na,u as oa,m as aa,N as zr,E as ha,n as la,P as W,C as Kt,g as I,p as Se,T as ws,h as Pt,B as xi,L as Me,O as vs}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as C,w as Tt,M as dn,m as fn,o as ca,g as ua,p as se,y as pa,C as da,A as bi,G as Lr,E as Ar,f as fa,u as ma,s as _a,c as ga,b as ya}from"./utils-SPbpQbmm-DpAlEmQT.js";import{i as mn,c as _n,r as gn,k as xa,q as ba,M as Pa,_ as wa,$ as va}from"./definitions-DJSdSb77-DkoRHaVx.js";import{l as rs,s as yn,K as Ti,h as Sa,i as Pi,e as Or}from"./Tile-D75RMC64-DprBAZDK.js";import{L as ce,m as Ss}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Er}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{a as Ma}from"./Rect-DD6XS68q-D_hsV3ag.js";import{K as Ca,l as Ee}from"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import{a as Ms}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{h as Ia}from"./Util-BjGjeg6f-08Szkf4F.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import{V as ka}from"./Program-DLVwTiPA-DUDrdGpa.js";import{h as Ta}from"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import{i as za}from"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";var Fr;(function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.Blend=1]="Blend",e[e.ComplexFill=2]="ComplexFill",e[e.ComplexOutlineFill=3]="ComplexOutlineFill",e[e.DotDensity=4]="DotDensity",e[e.Fill=5]="Fill",e[e.Grid=6]="Grid",e[e.Heatmap=7]="Heatmap",e[e.Label=8]="Label",e[e.Line=9]="Line",e[e.Magnifier=10]="Magnifier",e[e.Marker=11]="Marker",e[e.OutlineFill=12]="OutlineFill",e[e.Overlay=13]="Overlay",e[e.PatternFill=14]="PatternFill",e[e.PatternOutlineFill=15]="PatternOutlineFill",e[e.PieChart=16]="PieChart",e[e.Test=17]="Test",e[e.Text=18]="Text",e[e.TexturedLine=19]="TexturedLine"})(Fr||(Fr={}));const Yc={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2,overrideOutlineColor:3,colorLocked:4,isStroke:5}};let N=class{static fromOptimized(e,t,s=!1,i=!1,n=1){return new zi().initialize(e,t,s,i,n)}static fromJSON(e,t=!1,s=!1){const[i,n]=Nr(e);return new Ai().initialize(i,n,t,s,1)}static fromOptimizedCIM(e,t,s=!1,i=!1,n=1){return new $r().initialize(e,t,s,i,n)}static fromJSONCIM(e,t=!1,s=!1,i=1){const[n,r]=Nr(e);return new Rr().initialize(n,r,t,s,i)}static fromFeatureSetReader(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimized(t,s):null}static fromFeatureSetReaderCIM(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimizedCIM(t,s):null}static createEmptyOptimized(e,t=!1,s=!1,i=1){return new zi().initialize(new si,e,t,s,i)}static createEmptyJSON(e,t=!1,s=!1){return new Ai().initialize([],e,t,s,1)}static createEmptyOptimizedCIM(e,t=!1,s=!1,i=1){return new $r().initialize(new si,e,t,s,i)}static createEmptyJSONCIM(e,t=!1,s=!1,i=1){return new Rr().initialize([],e,t,s,i)}asJSON(){const e=ci(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:e[0][0][0],ymin:e[0][0][1],xmax:e[0][2][0],ymax:e[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:e.flat()}:this.geometryType==="esriGeometryPoint"?{x:e[0][0][0],y:e[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:e}:{paths:e}}getCurrentRingArea(){if(this.pathSize<3)return 0;let e,t,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;e=this.x,t=this.y;const i=e,n=t;for(;this.nextPoint();)s+=(e-this.x)*(t+this.y),e=this.x,t=this.y;return s+=(e-i)*(t+n),-.5*s}invertY(){this.yFactor*=-1}},zi=class Li extends N{constructor(){super(...arguments),this._end=-1}initialize(t,s,i,n,r){return this.hasZ=i,this.hasM=n,this.geometryType=s,this._stride=2+Number(i)+Number(n),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=r,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const s=this._pathOffset+t*this._stride;return s>=0&&s=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}getCurrentPath(){const t=this._end,s=this._geometry.coords,i=this._pathOffset;return new Li().initialize(new si([this.pathSize],s.slice(i,t)),this.geometryType,this.hasZ,this.hasM,this.yFactor)}pathLength(){const t=this._end,s=this._stride,i=this._geometry.coords;let n=0;for(let r=this._pathOffset+s;rt+s)}get pathSize(){const{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function La(e){const t=[e.x,e.y];return e.z&&t.push(e.z),e.m&&t.push(e.m),t}function Nr(e){return rt(e)?[e.rings,"esriGeometryPolygon"]:gt(e)?[e.paths,"esriGeometryPolyline"]:Ds(e)?[[e.points],"esriGeometryMultipoint"]:ht(e)?[[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],"esriGeometryEnvelope"]:ki(e)?[[[La(e)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let Ai=class Oi extends N{initialize(t,s,i,n,r){return this._paths=t,this.geometryType=s,this.hasZ=i,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=r,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,s=this._currentPath;let i=0;for(let n=1;nt.length).reduce((t,s)=>t+s)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const Cs=4,Is=1;let $r=class xn extends zi{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new xn().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},Rr=class bn extends Ai{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r)}clone(){return new bn().initialize(pe(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Cs]=Is}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Cs]===Is}setControlPointAt(t){this._paths[this.pathIndex][t][Cs]=Is}getControlPointAt(t){return this._paths[this.pathIndex][t][Cs]===Is}};const Aa=512;let wt,Oa=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function ur(e,t){wt||(wt=new sa(0,0,0,1));const s=e.geometryType==="esriGeometryPolygon",i=s?Tr.Polygon:Tr.LineString,n=s?3:2;let r,o;for(wt.reset(i),wt.setPixelMargin(t+1),wt.setExtent(Aa);e.nextPath();)if(!(e.pathSize1&&y>0&&h>0&&(o*m+a*_)/y/h<=this._maxCosAngle&&e.setControlPointAt(p-1),p===1&&(l=m,c=_,u=y),y>0&&(i=d,n=f,o=m,a=_,h=y)}this._isClosed&&h>0&&u>0&&(o*l+a*c)/u/h<=this._maxCosAngle&&e.setControlPointAt(0)}}},ye=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}};function Ce(e,t){e[4]=t}let fs=class{constructor(e,t=!0,s=!0,i=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&e.geometryType==="esriGeometryPolygon"||!s&&e.geometryType==="esriGeometryPolyline"?null:e,this.geomUnitsPerPoint=i,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new ye}next(){if(!this.geometryCursor)return null;const e=this.processMultiPath(this.geometryCursor);return this.iterateMultiPath&&e||(this.geometryCursor=null),e}processMultiPath(e){for(;this.iteratePath||e.pathIndex0?[r/a,o/a]:[1,0]}getSegAngleCS(e,t){const[[s,i],[n,r]]=e;return this.getAngleCS(s,i,n,r,t)}cut(e,t,s,i,n,r){return[n<=0?[e,t]:this.getCoord2D(e,t,s,i,n),r>=1?[s,i]:this.getCoord2D(e,t,s,i,r)]}getSubCurve(e,t,s){const i=N.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(i,e,t,s)?i:null}appendSubCurve(e,t,s,i){e.startPath(),t.seekPathStart();let n=0,r=!0;if(!t.nextPoint())return!1;let o=t.x,a=t.y;for(;t.nextPoint();){const h=this.getLength(o,a,t.x,t.y);if(h!==0){if(r){if(n+h>s){const l=(s-n)/h;let c=1,u=!1;n+h>=i&&(c=(i-n)/h,u=!0);const p=this.cut(o,a,t.x,t.y,l,c);if(p&&e.pushPoints(p),u)break;r=!1}}else{if(n+h>i){const l=this.cut(o,a,t.x,t.y,0,(i-n)/h);l&&e.pushPoint(l[1]);break}e.pushXY(t.x,t.y)}n+=h,o=t.x,a=t.y}else o=t.x,a=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let s,i,n,r,o=0;for(s=e.x,i=e.y;e.nextPoint();s=n,i=r){n=e.x,r=e.y;const a=this.getLength(s,i,n,r);if(a!==0){if(o+a>t){const h=(t-o)/a;return this.getCoord2D(s,i,n,r,h)}o+=a}}return null}offset(e,t,s,i,n){if(!e||e.length<2)return null;let r=0,o=e[r++],a=r;for(;r=0==t<=0){if(_<1){const y=[d[0]-f[0],d[1]-f[1]];this.normalize(y);const b=Math.sqrt((1+_)/2);if(b>1/i){const P=-Math.abs(t)/b;l.push([c[0]-y[0]*P,c[1]-y[1]*P])}}}else switch(s){case Kt.Mitered:{const y=Math.sqrt((1+_)/2);if(y>0&&1/y0){const b=1/y;let P=b;for(let w=1;w0){const n=N.createEmptyOptimizedCIM(e.geometryType),r=ci(e)[0],o=this._curveHelper.offset(r,this._size,Kt.Rounded,4,this._offsetFlattenError);if(o)return n.pushPath(o),n}else if(this._size<0){const n=e.asJSON();if(Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._size>0)return N.fromJSONCIM({xmin:n.xmin-this._size,xmax:n.xmax+this._size,ymin:n.ymin-this._size,ymax:n.ymax+this._size})}}const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e;if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),this._size,1);return i?N.fromJSONCIM(i):null}return null}},Sn=class Re{static local(){return Re.instance===null&&(Re.instance=new Re),Re.instance}execute(t,s,i,n,r){return new Da(t,s,i)}};Sn.instance=null;let Da=class{constructor(e,t,s){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=s,this._rule=t.rule??I.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom(ci(e));if(t?.length)return N.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,s,i){return[e[0]*t+s[0]*i,e[1]*t+s[1]*i]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,s){return[e[0]+t,e[1]+s]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const s=t/this._norm(e);e[0]*=s,e[1]*=s}_leftPerpendicular(e){const t=-e[1],s=e[0];e[0]=t,e[1]=s}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],s=-e[0];e[0]=t,e[1]=s}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,s){const i=e[0]*t-e[1]*s,n=e[0]*s+e[1]*t;e[0]=i,e[1]=n}_makeCtrlPt(e){const t=[e[0],e[1]];return Ce(t,1),t}_addAngledTicks(e,t,s,i){const n=this._sub(s,t);this._normalize(n);const r=this._crossProduct(n,this._sub(i,t));let o;o=r>0?this._rightPerp(n):this._leftPerp(n);const a=Math.abs(r)/2,h=[];h.push([t[0]+(o[0]-n[0])*a,t[1]+(o[1]-n[1])*a]),h.push(t),h.push(s),h.push([s[0]+(o[0]+n[0])*a,s[1]+(o[1]+n[1])*a]),e.push(h)}_addBezier2(e,t,s,i,n){if(n--==0)return void e.push(i);const r=this._mid(t,s),o=this._mid(s,i),a=this._mid(r,o);this._addBezier2(e,t,r,a,n),this._addBezier2(e,a,o,i,n)}_addBezier3(e,t,s,i,n,r){if(r--==0)return void e.push(n);const o=this._mid(t,s),a=this._mid(s,i),h=this._mid(i,n),l=this._mid(o,a),c=this._mid(a,h),u=this._mid(l,c);this._addBezier3(e,t,o,l,u,r),this._addBezier3(e,u,c,h,n,r)}_add90DegArc(e,t,s,i,n){const r=n??this._crossProduct(this._sub(s,t),this._sub(i,t))>0,o=this._mid(t,s),a=this._sub(o,t);r?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(e,t,s){const i=t[0],n=t[1],r=t[t.length-1],o=this._sub(i,n),a=this._norm(o);this._normalize(o);const h=Math.abs(this._crossProduct(o,this._sub(r,n)));let l=this._dotProduct(o,this._sub(r,n));l<.05*a?l=.05*a:l>.95*a&&(l=.95*a);const c=.5*h,u=this._leftPerp(o),p=[n[0]+o[0]*l,n[1]+o[1]*l],d=t.length-1,f=[];f.push(s?[-u[0],-u[1]]:u);let m=[-o[0],-o[1]];for(let _=1;_0;_--)e.push([t[_][0]+f[_][0]*c,t[_][1]+f[_][1]*c]);e.push([p[0]+f[0][0]*c,p[1]+f[0][1]*c]),e.push([p[0]+f[0][0]*h,p[1]+f[0][1]*h]),e.push(i),e.push([p[0]-f[0][0]*h,p[1]-f[0][1]*h]),e.push([p[0]-f[0][0]*c,p[1]-f[0][1]*c]);for(let _=1;_=2?e[1]:this._add2(e[0],t*this._defaultSize,s*this._defaultSize)}_cp3(e,t,s,i){if(e.length>=3)return e[2];const n=this._mix(e[0],1-s,t,s),r=this._sub(t,e[0]);return this._normalize(r),this._rightPerpendicular(r),[n[0]+r[0]*i*this._defaultSize,n[1]+r[1]*i*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],s=this._cp2(e,-4,0),i=this._sub(t,s);this._normalize(i);const n=this._rightPerp(i);return[t,s,[t[0]+(n[0]-i[0])*this._defaultSize,t[1]+(n[1]-i[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],s=this._cp2(e,-4,0);let i;if(e.length>=3)i=e[e.length-1];else{const n=this._sub(t,s);this._normalize(n);const r=this._rightPerp(n);i=[t[0]+(r[0]-n[0])*this._defaultSize,t[1]+(r[1]-n[1])*this._defaultSize]}return[s,i]}_processGeom(e){if(!e)return null;const t=[];for(const s of e){const i=s.length>1&&qo(s)0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([o[0]+(l[0]-h[0])/3,o[1]+(l[1]-h[1])/3]),c.push(o),c.push(a),c.push([a[0]+(l[0]+h[0])/3,a[1]+(l[1]+h[1])/3]),t.push(c);break}case I.DoublePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push(r),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),t.push(u);const p=[];p.push([a[0]-l[0]*c,a[1]-l[1]*c]),p.push(o),t.push(p);break}case I.OppositeToFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c,a[1]+l[1]*c]),u.push([a[0]-l[0]*c,a[1]-l[1]*c]),t.push(u);break}case I.TriplePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c*.8,a[1]+l[1]*c*.8]),u.push([h[0]+.8*(r[0]-h[0]),h[1]+.8*(r[1]-h[1])]),t.push(u),t.push([a,h]);const p=[];p.push([a[0]-l[0]*c*.8,a[1]-l[1]*c*.8]),p.push([h[0]+.8*(o[0]-h[0]),h[1]+.8*(o[1]-h[1])]),t.push(p);break}case I.HalfCircleFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o);let l=this._sub(o,r);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),p=Math.sqrt((1+c)/2),d=Math.sqrt((1-c)/2),f=[];let m;this._crossProduct(l,this._sub(a,r))>0?(f.push(r),l=this._sub(r,h),m=o):(f.push(o),l=this._sub(o,h),m=r),this._rotateDirect(l,p,d),l[0]/=p,l[1]/=p;for(let _=1;_<=18;_++)f.push(this._add(h,l)),this._rotateDirect(l,c,u);f.push(m),t.push(f);break}case I.HalfCircleSecondSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,1,-1);let h=this._sub(r,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o))/2;this._leftPerpendicular(h);const c=[o[0]+h[0]*l,o[1]+h[1]*l];h=this._sub(o,c);const u=Math.cos(Math.PI/18);let p=Math.sin(Math.PI/18);l>0&&(p=-p);const d=[o];for(let f=1;f<=18;f++)this._rotateDirect(h,u,p),d.push(this._add(c,h));t.push(d);break}case I.HalfCircleExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-1);let h;if(n>=4)h=s[3];else{const f=this._sub(r,o);h=this._add(a,f)}const l=this._dist(o,a)/2/.75,c=this._sub(o,r);this._normalize(c,l);const u=this._sub(a,h);this._normalize(u,l);const p=[h,a];t.push(p);const d=[this._clone(a)];this._addBezier3(d,a,this._add(a,u),this._add(o,c),o,4),d.push(r),t.push(d);break}case I.OpenCircle:{const o=this._cp2(s,-2,0),a=this._sub(o,r),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[o];for(let u=1;u<=33;u++)this._rotateDirect(a,h,l),c.push(this._add(r,a));t.push(c);break}case I.CoverageEdgesWithTicks:{const o=this._cp2(s,0,-1);let a,h;if(n>=3)a=s[2];else{const p=this._sub(o,r),d=this._leftPerp(p);a=[r[0]+d[0]-.25*p[0],r[1]+d[1]-.25*p[1]]}if(n>=4)h=s[3];else{const p=this._mid(r,o),d=this._sub(r,o);this._normalize(d),this._leftPerpendicular(d);const f=this._crossProduct(d,this._sub(a,p));this._rightPerpendicular(d),h=[a[0]+d[0]*f*2,a[1]+d[1]*f*2]}const l=this._sub(o,r);let c,u;c=this._crossProduct(l,this._sub(a,r))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(a),u.push(r),u.push([r[0]+(c[0]-l[0])/3,r[1]+(c[1]-l[1])/3]),t.push(u),c=this._crossProduct(l,this._sub(h,o))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push([o[0]+(c[0]+l[0])/3,o[1]+(c[1]+l[1])/3]),u.push(o),u.push(h),t.push(u);break}case I.GapExtentWithDoubleTicks:{const o=this._cp2(s,0,2),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const l=this._sub(o,r);h=this._add(a,l)}this._addAngledTicks(t,r,o,this._mid(a,h)),this._addAngledTicks(t,a,h,this._mid(r,o));break}case I.GapExtentMidline:{const o=this._cp2(s,2,0),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const c=this._sub(o,r);h=this._add(a,c)}const l=[];l.push(this._mid(r,a)),l.push(this._mid(o,h)),t.push(l);break}case I.Chevron:{const o=this._cp2(s,-1,-1);let a;if(n>=3)a=s[2];else{const h=this._sub(o,r);this._leftPerpendicular(h),a=this._add(r,h)}t.push([o,this._makeCtrlPt(r),a]);break}case I.PerpendicularWithArc:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,.5,-1),h=this._sub(o,r),l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(a,r));let u=this._dotProduct(h,this._sub(a,r));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[r[0]+h[0]*u,r[1]+h[1]*u];let d=this._leftPerp(h),f=[];if(f.push([p[0]-d[0]*c,p[1]-d[1]*c]),f.push([p[0]+d[0]*c,p[1]+d[1]*c]),t.push(f),n>=4){const b=s[3];let P=this._dotProduct(h,this._sub(b,r));P<.1*l?P=.1*l:P>.9*l&&(P=.9*l);const w=[r[0]+h[0]*P,r[1]+h[1]*P],S=this._crossProduct(h,this._sub(b,r)),L=[];L.push([w[0]-d[0]*S,w[1]-d[1]*S]),L.push([w[0]+d[0]*S,w[1]+d[1]*S]),t.push(L)}const m=[o[0]+d[0]*c,o[1]+d[1]*c];d=this._sub(o,m);const _=Math.cos(Math.PI/18);let y=Math.sin(Math.PI/18);c<0&&(y=-y),f=[r,o];for(let b=1;b<=9;b++)this._rotateDirect(d,_,y),f.push(this._add(m,d));t.push(f);break}case I.ClosedHalfCircle:{const o=this._cp2(s,2,0),a=this._mid(r,o),h=this._sub(o,a),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[r,o];for(let p=1;p<=18;p++)this._rotateDirect(h,l,c),u.push(this._add(a,h));t.push(u);break}case I.TripleParallelExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-2),h=this._mid(r,o),l=this._sub(a,o);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,o)))/2,u=this._dist(o,a),p=[o,r];p.push([r[0]+l[0]*u*.5,r[1]+l[1]*u*.5]),t.push(p);const d=[];d.push([h[0]-l[0]*c,h[1]-l[1]*c]),d.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),Ce(d[d.length-1],1),d.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),t.push(d);const f=[o,a];t.push(f);break}case I.ParallelWithTicks:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(a,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),this._addAngledTicks(t,r,o,a),this._addAngledTicks(t,this._mix(r,1,h,l),this._mix(o,1,h,l),this._mid(r,o));break}case I.Parallel:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(a,r));let u=[r,o];t.push(u),u=[],u.push([r[0]+l[0]*c,r[1]+l[1]*c]),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),t.push(u);break}case I.PerpendicularToFirstSegment:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._mid(r,o),l=this._sub(o,r);this._normalize(l);const c=this._crossProduct(l,this._sub(a,r));this._leftPerpendicular(l);const u=[];u.push([h[0]-l[0]*c*.25,h[1]-l[1]*c*.25]),u.push([h[0]+l[0]*c*1.25,h[1]+l[1]*c*1.25]),t.push(u);break}case I.ParallelOffset:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);const u=[];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(u);break}case I.OffsetOpposite:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);break}case I.OffsetSame:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]+h[0]*l,r[1]+h[1]*l]),c.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(c);break}case I.CircleWithArc:{let o=this._cp2(s,3,0);const a=this._cp3(s,o,.5,-1);let h,l;if(n>=4)h=s[3],l=this._crossProduct(this._sub(h,o),this._sub(a,o))>0;else{h=o,l=this._crossProduct(this._sub(h,r),this._sub(a,r))>0;const f=24*this._geomUnitsPerPoint,m=this._sub(h,r);this._normalize(m,f);const _=Math.sqrt(2)/2;this._rotateDirect(m,_,l?_:-_),o=this._add(r,m)}const c=this._sub(o,r),u=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),d=[o];for(let f=1;f<=36;f++)this._rotateDirect(c,u,p),d.push(this._add(r,c));this._add90DegArc(d,o,h,a,l),Ce(d[d.length-8],1),t.push(d);break}case I.DoubleJog:{let o,a=this._cp2(s,-3,1),h=this._cp3(s,a,-1,-.5);if(n>=4)o=s[3];else{const y=r;r=a,o=h;const b=this._dist(r,y),P=this._dist(o,y);let w=30*this._geomUnitsPerPoint;.5*b0?this._rotateDirect(m,f,-f):this._rotateDirect(m,f,f);let _=[];_.push(a),_.push(this._add(l,m)),_.push(this._sub(l,m)),_.push(r),t.push(_),m=this._sub(o,h),this._normalize(m,d),this._crossProduct(m,this._sub(r,h))<0?this._rotateDirect(m,f,f):this._rotateDirect(m,f,-f),_=[],_.push(h),_.push(this._add(c,m)),_.push(this._sub(c,m)),_.push(o),t.push(_);break}case I.PerpendicularOffset:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l);t.push([c,r]);break}case I.LineExcludingLastSegment:{const o=this._arrowPath(s),a=[];let h=o.length-2;for(;h--;)a.push(o[h]);t.push(a);break}case I.MultivertexArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!1),t.push(a);break}case I.CrossedArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!0),t.push(a);break}case I.ChevronArrow:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));let p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=[o[0]+l[0]*p,o[1]+l[1]*p],f=this._leftPerp(l),m=[];m.push([d[0]+f[0]*u+l[0]*h,d[1]+f[1]*u+l[1]*h]),m.push(r),m.push([d[0]-f[0]*u+l[0]*h,d[1]-f[1]*u+l[1]*h]),t.push(m);break}case I.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(a,o));let u=this._dotProduct(h,this._sub(a,o));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[o[0]+h[0]*u,o[1]+h[1]*u];this._leftPerpendicular(h);const d=[];d.push([p[0]+h[0]*c*.5,p[1]+h[1]*c*.5]),d.push(this._mid(p,r)),d.push([p[0]-h[0]*c*.5,p[1]-h[1]*c*.5]),t.push(d);break}case I.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(a,o));c<.05*l?c=.05*l:c>.95*l&&(c=.95*l);const u=[o[0]+h[0]*c,o[1]+h[1]*c];t.push([o,u]);break}case I.Arch:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=this._sub(r,o),l=this._mix(a,1,h,.55),c=this._mix(a,1,h,-.55),u=[r];this._addBezier2(u,r,l,a,4),this._addBezier2(u,a,c,o,4),t.push(u);break}case I.CurvedParallelTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l),u=this._sub(this._mix(o,.75,a,.25),l),p=this._sub(this._mix(o,.25,a,.75),l),d=[o];this._addBezier2(d,o,u,c,3),this._addBezier2(d,c,p,a,3),t.push(d);for(let f=0;f<8;f++){const m=d[2*f+1],_=[this._clone(m)];_.push(this._add(m,[h[0]/4,h[1]/4])),t.push(_)}break}case I.Arc90Degrees:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=[o];this._add90DegArc(h,o,r,a),t.push(h);break}case I.TipWithPerpendicularAndTicks:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);let u=this._crossProduct(l,this._sub(a,o)),p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=this._leftPerp(l),f=[r[0]-l[0]*h,r[1]-l[1]*h],m=.5*Math.max(c-p-h,h);u=Math.abs(u);const _=[];_.push([f[0]+d[0]*(u+m)-l[0]*m,f[1]+d[1]*(u+m)-l[1]*m]),_.push([f[0]+d[0]*u,f[1]+d[1]*u]),_.push([f[0]-d[0]*u,f[1]-d[1]*u]),_.push([f[0]-d[0]*(u+m)-l[0]*m,f[1]-d[1]*(u+m)-l[1]*m]),t.push(_),t.push([f,r]);break}case I.ConcentricCircles:{const o=this._cp2(s,1,0),a=this._cp3(s,o,2,0),h=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18);let c=this._dist(o,r),u=[c,0],p=[];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);if(t.push(p),n>=4){p=[];const d=s[3];c=this._dist(d,r),u=[c,0];for(let f=0;f<=36;f++)p.push(this._add(r,u)),f===0&&(p.push(this._add(r,u)),Ce(p[1],1)),this._rotateDirect(u,h,l);t.push(p)}p=[],c=this._dist(a,r),u=[c,0];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);t.push(p);break}case I.DoubleJogArrow:{r=this._arrowPath(s)[0];const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(a,r)));let u=Math.abs(this._dotProduct(h,this._sub(a,r)));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=Math.max(c,u),d=this._leftPerp(h);let f=[];const m=[r[0]-h[0]*u*.5+d[0]*c*.5,r[1]-h[1]*u*.5+d[1]*c*.5];f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),m[0]-=d[0]*p*.25,m[1]-=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),t.push(f),f=[],m[0]=r[0]-h[0]*u*.5-d[0]*c*.5,m[1]=r[1]-h[1]*u*.5-d[1]*c*.5,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),m[0]+=d[0]*p*.25,m[1]+=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),t.push(f);break}case I.LinkedChevrons:{const o=this._cp2(s,-5,0),a=this._cp3(s,o,-.2,1),h=this._sub(r,o);this._normalize(h);const l=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(a,o)));t.push([o,r]);const u=[];u.push([r[0]-h[0]*c+l[0]*c,r[1]-h[1]*c+l[1]*c]),u.push(r),u.push([r[0]-h[0]*c-l[0]*c,r[1]-h[1]*c-l[1]*c]),t.push(u),this._addDash(t,o,[-h[0]*c+l[0]*c,-h[1]*c+l[1]*c]),this._addDash(t,o,[-h[0]*c-l[0]*c,-h[1]*c-l[1]*c]);break}case I.SegmentThenHalfCircle:{const o=this._cp2(s,2,0),a=this._cp3(s,o,1.5,0);let h;h=n>=4?s[3]:this._cp3(s,o,1.25,-.5);const l=this._sub(o,r);this._normalize(l);const c=.5*this._dist(o,a),u=this._crossProduct(l,this._sub(h,r))>0,p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);u&&(d=-d);const f=[r,o];l[0]*=c,l[1]*=c;const m=this._add(o,l);l[0]=-l[0],l[1]=-l[1];for(let _=1;_<=18;_++)this._rotateDirect(l,p,d),f.push(this._add(m,l));t.push(f);break}case I.LineWithStraightTicks:{const o=this._cp2(s,-2,1),a=this._cp3(s,o,-1,-.5),h=this._sub(a,o);this._normalize(h);const l=this._dotProduct(h,this._sub(o,r)),c=this._dotProduct(h,this._sub(a,r));let u=[r];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push(o),t.push(u),u=[r],u.push([r[0]+h[0]*c,r[1]+h[1]*c]),u.push(a),t.push(u);break}case I.DoubleCurve:{const o=this._cp2(s,-5,-1),a=this._cp3(s,o,2,0),h=Math.atan2(1,5),l=Math.cos(h),c=Math.sin(h),u=this._sub(o,r),p=this._dist(r,o);this._normalize(u),this._rotateDirect(u,l,-c);const d=[r];d.push([r[0]+u[0]*p*.5,r[1]+u[1]*p*.5]),Ce(d[1],1),d.push([r[0]+u[0]*p*.8,r[1]+u[1]*p*.8]),this._addBezier2(d,d[2],[r[0]+u[0]*p,r[1]+u[1]*p],o,3);const f=this._sub(a,o),m=this._dist(o,a);this._normalize(f),this._rotateDirect(f,l,-c),this._addBezier2(d,o,[a[0]-f[0]*m,a[1]-f[1]*m],[a[0]-f[0]*m*.8,a[1]-f[1]*m*.8],3),d.push(a),t.push(d);break}case I.ParallelWithTicksByWidth:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),l>0?(this._addAngledTicks(t,r,[r[0]+h[0]*l,r[1]+h[1]*l],o),this._addAngledTicks(t,o,[o[0]+h[0]*l,o[1]+h[1]*l],r)):(this._addAngledTicks(t,[r[0]+h[0]*l,r[1]+h[1]*l],r,o),this._addAngledTicks(t,[o[0]+h[0]*l,o[1]+h[1]*l],r,o));break}case I.EnclosingRoundedRectangle:{const o=this._cp2(s,3,-2),a=[Math.min(r[0],o[0]),Math.max(r[1],o[1])],h=[Math.max(r[0],o[0]),Math.min(r[1],o[1])],l=h[0]-a[0],c=a[1]-h[1],u=Math.min(l,c)/10,p=[];p.push([a[0]+u+.75*(l-2*u),a[1]]),p.push([h[0]-u,a[1]]),this._add90DegArc(p,[h[0]-u,a[1]],[h[0],a[1]-u],[h[0],a[1]]),p.push([h[0],h[1]+u]),this._add90DegArc(p,[h[0],h[1]+u],[h[0]-u,h[1]],h),p.push([a[0]+u,h[1]]),this._add90DegArc(p,[a[0]+u,h[1]],[a[0],h[1]+u],[a[0],h[1]]),p.push([a[0],a[1]-u]),this._add90DegArc(p,[a[0],a[1]-u],[a[0]+u,a[1]],a),p.push([a[0]+u+.75*(l-2*u),a[1]]);break}case I.FullGeometry:default:t.push(s)}}return t}},Mn=class De{static local(){return De.instance===null&&(De.instance=new De),De.instance}execute(t,s,i,n,r){return new Ga(t,s,i)}};Mn.instance=null;let Ga=class extends pi{constructor(e,t,s){super(e,!0,!0),this._curveHelper=new Lt,this._beginCut=(t.beginCut!==void 0?t.beginCut:1)*s,this._endCut=(t.endCut!==void 0?t.endCut:1)*s,this._middleCut=(t.middleCut!==void 0?t.middleCut:0)*s,this._invert=t.invert!==void 0&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:s,_middleCut:i}=this,n=e.pathLength(),r=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(t!==0||s!==0||i!==0)if(t+s+i>=n)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(r,e,0,t),this._curveHelper.appendSubCurve(r,e,.5*(n-i),.5*(n+i)),this._curveHelper.appendSubCurve(r,e,n-s,s)}else if(t===0&&s===0&&i===0)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else t+s+i0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(s){if(s.pathSize===0)if(n===0){const o=t.segment[0];s.pushXY(o[0],o[1])}else s.pushPoint(this.getSegCoord2D(t.segment,n));const r=t.segment[1];s.pushXY(r[0],r[1])}if(n=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==$t.FAIL&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,i===$t.END?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,s){s.pathSize===0&&(n===0?s.pushPoint(t.segment[0]):s.pushPoint(this.getSegCoord2D(t.segment,n)));const r=t.abscissa/t.segmentLength;r===1?s.pushPoint(t.segment[1]):s.pushPoint(this.getSegCoord2D(t.segment,r))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let r=Math.round((this._partLength-(i+n))/this._patternLength);r<=0&&(r=i+n>0?0:1),this._partLengthRatio=this._partLength/(i+n+r*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=t;)i-=t,t=this._pattern.nextValue(),r=!r;t-=i,r?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}let s=this._walker.nextCurve(t);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else t=this._pattern.nextValue(),!this._walker.nextPosition(t)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s?.reset(),s}},In=class Ve{static local(){return Ve.instance===null&&(Ve.instance=new Ve),Ve.instance}execute(t,s,i,n,r,o){return new Ha(t,s,i,n,r,o)}};In.instance=null;let Ha=class{constructor(e,t,s,i,n,r){switch(this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._maxInflateSize=r*s,this._width=(t.width!==void 0?t.width:2)*s,t.method){case Se.Mitered:case Se.Bevelled:case Se.Rounded:case Se.TrueBuffer:case Se.Square:}this._option=t.option}next(){let e;for(;e=this._inputGeometries.next();){if(e.geometryType==="esriGeometryEnvelope"&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:N.fromJSONCIM({paths:[[[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if(e.geometryType==="esriGeometryPolygon"){if(this._width===0)return e.clone();const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),-this._width,1);if(i){for(const n of i.rings)if(n){s.startPath();for(const r of n.reverse())s.pushXY(r[0],s.yFactor*r[1])}}return s}}return null}},kn=class He{static local(){return He.instance===null&&(He.instance=new He),He.instance}execute(t,s,i,n,r){return new Ba(t,s,i)}};kn.instance=null;let Ba=class extends pi{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._length=(t.length!==void 0?t.length:20)*s,this._angle=t.angle!==void 0?t.angle:225,this._position=t.position!==void 0?t.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(e){const t=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const s=e.x,i=e.y;e.seekInPath(e.pathSize-1);const n=e.x,r=e.y,o=[n-s,r-i];this._curveHelper.normalize(o);const a=s+(n-s)*this._position/100,h=i+(r-i)*this._position/100,l=Math.cos((90-this._angle)/180*Math.PI);let c=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(c=-c),this._mirror=!this._mirror;const u=[a-this._length/2*l,h-this._length/2*c],p=[a+this._length/2*l,h+this._length/2*c];return t.pushPath([[s,i],u,p,[n,r]]),t}},Tn=class Be{static local(){return Be.instance===null&&(Be.instance=new Be),Be.instance}execute(t,s,i,n,r){return new Xa(t,s,i)}};Tn.instance=null;let Xa=class{constructor(e,t,s){this._inputGeometries=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+s;return e.reset(),e}};const Ua=10;let zn=class Xe{static local(){return Xe.instance===null&&(Xe.instance=new Xe),Xe.instance}execute(t,s,i,n,r,o){return new Ya(t,s,i,n,r,o)}};zn.instance=null;let Ya=class{constructor(e,t,s,i,n,r){this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._curveHelper=new Lt,this._offset=(t.offset??1)*s,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(r*s),Ua),this._option=t.option,this._offsetFlattenError=cs*s}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e.clone();if(e.geometryType==="esriGeometryEnvelope"){if(this._method===Kt.Rounded&&this._offset>0){const r=Jt(e),o=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(o){const a=N.createEmptyOptimizedCIM(e.geometryType);return a.pushPath(o),a}return null}const n=e.asJSON();if(ht(n)&&Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._offset>0)return N.fromJSONCIM({xmin:n.xmin-this._offset,xmax:n.xmax+this._offset,ymin:n.ymin-this._offset,ymax:n.ymax+this._offset})}const t=this._geometryEngine;if(t==null)continue;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.offset(cr.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return i?N.fromJSONCIM(i):null}return null}},Ln=class Ue{static local(){return Ue.instance===null&&(Ue.instance=new Ue),Ue.instance}execute(t,s,i,n,r){return new Wa(t,s,i)}};Ln.instance=null;let Wa=class{constructor(e,t,s){this._inputGeometries=e,this._reverse=t.reverse===void 0||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(e.geometryType==="esriGeometryPolyline")return qa(e.clone());e=this._inputGeometries.next()}return null}};function qa(e){for(;e.nextPath();)for(let t=0;t0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),s,i)}e=this._inputGeometries.next()}return null}_rotate(e,t,s){const i=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const r=e.x-t,o=e.y-s;e.x=t+r*i-o*n,e.y=s+r*n+o*i}return e.reset(),e}},On=class We{static local(){return We.instance===null&&(We.instance=new We),We.instance}execute(t,s,i,n,r){return new ja(t,s,i)}};On.instance=null;let ja=class{constructor(e,t,s){this._inputGeometries=e,this._xFactor=t.xScaleFactor!==void 0?t.xScaleFactor:1.15,this._yFactor=t.yScaleFactor!==void 0?t.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(this._xFactor===1&&this._yFactor===1||e.geometryType==="esriGeometryPoint")return e;if(e.totalSize>0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,i)}}return null}_scaleCursor(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=s+(e.y-s)*this._yFactor;return e.reset(),e}},En=class qe{static local(){return qe.instance===null&&(qe.instance=new qe),qe.instance}execute(t,s,i,n,r){return new Ja(t,s,i)}};En.instance=null;let Ja=class{constructor(e,t,s){this._inputGeometries=e,this._height=(t.amplitude!==void 0?t.amplitude:2)*s,this._period=(t.period!==void 0?t.period:3)*s,this._style=t.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new di,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new fi,this._walker.updateTolerance(s)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=N.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const s=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case ws.Sinus:default:this._constructCurve(t,s,!1);break;case ws.Square:this._constructSquare(t,s);break;case ws.Triangle:this._constructTriangle(t,s);break;case ws.Random:this._constructCurve(t,s,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,s){let i=Math.round(t/this._period);i===0&&(i=1);const n=i*16+1,r=t/i,o=this._period/16,a=1/n,h=2*Math.PI*t/r,l=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),p=.75-Math.random()/2,d=.75-Math.random()/2,f=new Mt;this._walker.curPointAndAngle(f),e.pushPoint(f.pt);let m=0;for(;;){if(!this._walker.nextPointAndAngle(o,f)){e.pushPoint(this._walker.getPathEnd());break}{const _=m;let y;if(m+=a,s){const b=this._height/2*(1+.3*Math.sin(p*h*_+l));y=b*Math.sin(h*_+c),y+=b*Math.sin(d*h*_+u),y/=2}else y=.5*this._height*Math.sin(.5*h*_);e.pushXY(f.pt[0]-y*f.sa,f.pt[1]+y*f.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period/2,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(this._walker.nextPosition(this._period/2)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca)),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}},Fn=class Ke{static local(){return Ke.instance===null&&(Ke.instance=new Ke),Ke.instance}execute(t,s,i,n,r){return new Za(t,s,i)}};Fn.instance=null;let Za=class extends fs{constructor(e,t,s){super(e),this._geometryWalker=new fi,this._geometryWalker.updateTolerance(s),this._angleToLine=t.angleToLine??!0,this._offset=(t.offset?t.offset:0)*s,this._originalEndings=t.endings,this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*s,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*s,this._pattern=new di,this._pattern.init(t.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===Pt.WithFullGap&&this.isClosed?this._endings=Pt.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let i,n=!0;switch(this._endings){case Pt.NoConstraint:i=-this._position,i=this._adjustPosition(i),n=!1;break;case Pt.WithHalfGap:default:i=-this._pattern.lastValue()/2;break;case Pt.WithFullGap:i=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Pt.WithMarkers:i=0;break;case Pt.Custom:i=-this._position,i=this._adjustPosition(i),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,n))return null;this._pattern.reset();let r=0;for(;i>r;)i-=r,r=this._pattern.nextValue();r-=i,t=r,this.iteratePath=!0}const s=new Mt;return this._geometryWalker.nextPointAndAngle(t,s)?this._endings===Pt.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Pt.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}},Nn=class je{static local(){return je.instance===null&&(je.instance=new je),je.instance}execute(t,s,i,n,r){return new Qa(t,s,i)}};Nn.instance=null;let Qa=class extends fs{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._placePerPart=t.placePerPart??!1,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._type=t.extremityPlacement,this._position=t.offsetAlongLine!==void 0?t.offsetAlongLine*s:0,this._beginProcessed=!1}processMultiPath(e){return this._placePerPart?super.processMultiPath(e):this.processPath(e)}processPath(e){let t;switch(this._type){case Rt.Both:default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case Rt.JustBegin:t=this._atExtremities(e,this._position,!0);break;case Rt.JustEnd:t=this._atExtremities(e,this._position,!1);case Rt.None:}return t}_atExtremities(e,t,s){if(this._placePerPart||(s?e.seekPath(0):e.seekPath(e.totalSize-1)),s||e.seekPathEnd(),s?e.nextPoint():e.prevPoint()){let i=0,[n,r]=[0,0],[o,a]=[e.x,e.y];for(;s?e.nextPoint():e.prevPoint();){n=o,r=a,o=e.x,a=e.y;const h=this._curveHelper.getLength(n,r,o,a);if(i+h>t){const l=(t-i)/h,[c,u]=this._curveHelper.getAngleCS(n,r,o,a,l),p=this._curveHelper.getCoord2D(n,r,o,a,l);return this.internalPlacement.setTranslate(p[0]-this._offset*u,p[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(-c,-u),this.internalPlacement}i+=h}}return null}},$n=class Je{static local(){return Je.instance===null&&(Je.instance=new Je),Je.instance}execute(t,s,i,n,r){return new th(t,s,i)}};$n.instance=null;let th=class extends fs{constructor(e,t,s){super(e),this._walker=new fi,this._walker.updateTolerance(s),this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._beginGap=t.beginPosition!==void 0?t.beginPosition*s:0,this._endGap=t.endPosition!==void 0?t.endPosition*s:0,this._flipFirst=t.flipFirst===void 0||t.flipFirst,this._pattern=new di,this._pattern.init(t.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}const s=new Mt;if(!this._walker.nextPointAndAngle(t,s,$t.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const i=this._isFirst&&this._flipFirst;let n,r;return this._angleToLine?(n=s.ca,r=s.sa):(n=1,r=0),i&&(n=-n,r=-r),this.internalPlacement.setRotateCS(n,r),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const Et=512,eh=10,ut=24,ii=1e-6;let Rn=class Ze{static local(){return Ze.instance===null&&(Ze.instance=new Ze),Ze.instance}execute(t,s,i,n,r){return new sh(t,s,i,n,r)}};Rn.instance=null;let sh=class Ht{constructor(t,s,i,n,r){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(s.stepX??16)*i,this._stepY=Math.abs(s.stepY??16)*i,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=s.gridType??xi.Fixed,this._gridType===xi.Random){const o=s.seed??13,a=1;this._randomLCG=new un(o*a),this._randomness=(s.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=s.gridAngle??0,this._shiftOddRows=s.shiftOddRows??!1,this._offsetX=(s.offsetX??0)*i,this._offsetY=(s.offsetY??0)*i,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[o,a,h,l]=n.split("/"),c=parseFloat(o),u=parseFloat(a),p=parseFloat(h),d=parseFloat(l);this._graphicOriginX=-(d*2**c+p)*Et,this._graphicOriginY=u*Et,this._testInsidePolygon=!0}this._internalPlacement=new ye,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!Ht._randValues){Ht._randValues=[];for(let t=0;t=b,this._polygonMin=this._verticalSubdivision?p:f,this._testInsidePolygon){let P=0-this._graphicOriginX-this._offsetX-this._stepX,w=Et-this._graphicOriginX-this._offsetX+this._stepX,S=-Et-this._graphicOriginY-this._offsetY-this._stepY,L=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const V=[[P,S],[P,L],[w,S],[w,L]];P=S=Number.MAX_VALUE,w=L=-Number.MAX_VALUE;for(const U of V){const z=this._cosAngle*U[0]-this._sinAngle*U[1],O=this._sinAngle*U[0]+this._cosAngle*U[1];P=Math.min(P,z),w=Math.max(w,z),S=Math.min(S,O),L=Math.max(L,O)}}h=h!==Number.MAX_VALUE?Math.max(h,P):P,l=l!==Number.MAX_VALUE?Math.max(l,S):S,c=c!==-Number.MAX_VALUE?Math.min(c,w):w,u=u!==-Number.MAX_VALUE?Math.min(u,L):L}this._xMin=Math.round(h/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,f,m,p,d)}_buildAccelerationMap(t,s,i,n,r){t.reset();const o=new Map,a=this._verticalSubdivision,h=a?r-n:i-s;let l=Math.ceil(h/eh);if(l<=1)return;const c=Math.floor(h/l);let u,p,d,f,m,_,y,b,P,w,S;for(l++,this._delta=c,a?(P=-Et-2*this._stepY,w=2*this._stepY,S=n):(P=-2*this._stepX,w=Et+2*this._stepX,S=s);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,p=t.y;t.nextPoint();u=d,p=f){if(d=t.x,f=t.y,a){if(p===f||pw&&f>w)continue;m=Math.min(p,f),_=Math.max(p,f)}else{if(u===d||uw&&d>w)continue;m=Math.min(u,d),_=Math.max(u,d)}for(;m<_;)y=Math.floor((m-S)/c),Gr(y,u,p,d,f,o),m+=c;b=Math.floor((_-S)/c),b>y&&Gr(b,u,p,d,f,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const s=this._currentY*this._stepY+this._offsetY;let i,n;if(this._currentX++,this._gridType===xi.Random){const r=(this._currentX%ut+ut)%ut,o=(this._currentY%ut+ut)%ut;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-Ht._randValues[o*ut+r])*2/3,n=this._graphicOriginY+s+this._stepY*this._randomness*(.5-Ht._randValues[o*ut+r+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*s,n=this._graphicOriginY-this._sinAngle*t+this._cosAngle*s;if(!this._testInsidePolygon||this._isInsidePolygon(i,n,this._geometryCursor))return this._internalPlacement.setTranslate(i,n),this._internalPlacement}}_isInsidePolygon(t,s,i){if(this._accelerationMap==null)return ih(t,s,i);t+=ii,s+=ii;const n=this._verticalSubdivision,r=n?s:t,o=Math.floor((r-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let h,l,c,u=0;for(const p of a){if(h=p[0],l=p[1],n){if(h[1]>s==l[1]>s)continue;c=(l[0]-h[0])*(s-h[1])-(l[1]-h[1])*(t-h[0])}else{if(h[0]>t==l[0]>t)continue;c=(l[1]-h[1])*(t-h[0])-(l[0]-h[0])*(s-h[1])}c>0?u++:u--}return u!==0}};function ih(e,t,s){let i,n,r,o,a=0;for(e+=ii,t+=ii,s.reset();s.nextPath();)if(s.nextPoint())for(i=s.x,n=s.y;s.nextPoint();i=r,n=o)r=s.x,o=s.y,n>t!=o>t&&((r-i)*(t-n)-(o-n)*(e-i)>0?a++:a--);return a!==0}function Gr(e,t,s,i,n,r){let o=r.get(e);o||(o=[],r.set(e,o)),o.push([[t,s],[i,n]])}const rh=.001;let Dn=class Qe{static local(){return Qe.instance===null&&(Qe.instance=new Qe),Qe.instance}execute(t,s,i,n,r){return new nh(t,s,i)}};Dn.instance=null;let nh=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._relativeTo=t.relativeTo,this._position=t.startPointOffset!==void 0?t.startPointOffset*s:0,this._epsilon=rh*s}processPath(e){const t=this._position;if(this._relativeTo===Me.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[i,n]=[e.x,e.y],[r,o]=[0,0];for(;e.nextPoint();){r=e.x,o=e.y;const a=this._curveHelper.getLength(i,n,r,o);if(ai){const u=(i-r)/c,[p,d]=this._curveHelper.getAngleCS(o,a,h,l,u),f=this._curveHelper.getCoord2D(o,a,h,l,u),m=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-m*d,f[1]+m*p),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-p,-d):this.internalPlacement.setRotateCS(p,d)),this.internalPlacement}o=h,a=l,r+=c}}return null}};const oh=1e-15;let Gn=class ts{static local(){return ts.instance===null&&(ts.instance=new ts),ts.instance}execute(t,s,i,n,r){return new ah(t,s,i)}};Gn.instance=null;let ah=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._endPoints=t.placeOnEndPoints===void 0||t.placeOnEndPoints,this._controlPoints=t.placeOnControlPoints===void 0||t.placeOnControlPoints,this._regularVertices=t.placeOnRegularVertices===void 0||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let s=t[0],i=t[1];if(this._offset!==0){const n=Math.cos(t[2]),r=Math.sin(t[2]);s-=this._offset*r,i+=this._offset*n}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let s=0,i=!1,n=0,r=0;if(e.seekPathStart(),e.nextPoint()){let o=e.x,a=e.y,h=e.getControlPoint(),l=!0,c=e.nextPoint();for(;c;){const u=e.x,p=e.y,d=e.getControlPoint();(this._angleToLine||this._offset!==0)&&(n=this._curveHelper.getAngle(o,a,u,p,0)),l?(l=!1,t?(s=n,i=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,n])):h?this._controlPoints&&this._tags.push([o,a,Ts(r,n)]):this._regularVertices&&this._tags.push([o,a,Ts(r,n)]),(this._angleToLine||this._offset!==0)&&(r=this._curveHelper.getAngle(o,a,u,p,1)),c=e.nextPoint(),c||(t?d||i?this._controlPoints&&this._tags.push([u,p,Ts(r,s)]):this._regularVertices&&this._tags.push([u,p,Ts(r,s)]):(this._endPoints||this._controlPoints&&d)&&this._tags.push([u,p,r])),o=u,a=p,h=d}}this._tagIterator=0}};function Ts(e,t){const s=Math.PI;for(;Math.abs(t-e)>s+2*oh;)t-e>s?t-=2*s:t+=2*s;return(e+t)/2}const hh=100*222045e-21;function lh(e){if(e.totalSize===0)return null;const t=ui(e);if(!t)return null;const s=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*hh;let i=0,n=0;e.reset();for(let z=0;e.nextPath();z++){const O=e.getCurrentRingArea();O>n&&(n=O,i=z)}if(e.seekPath(i),e.pathSize===0)return null;e.seekPathStart();const r=Ko(e);if(Math.abs(n)<=2*s*s)return[(r[0]+r[2])/2,(r[1]+r[3])/2];e.seekPathStart();const o=jo(e,Qt());if(o===null)return null;if(e.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=Ie(o,e,!0);u.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ie(o,e,!1)),h[0]=u.distance,l[0]=0;const p=[NaN,NaN];let d=!1,f=.25,m=-1,_=NaN;do if(_=NaN,a[1]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ie(a[1],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[1],e))d=!0,h[1]=_,l[1]=Bt(a[1],o);else if(!isNaN(_)&&_>m&&(m=_,p[0]=a[1][0],p[1]=a[1][1]),f-=.01,f<.1){if(!(m>=0))break;d=!0,h[1]=m,a[1][0]=p[0],a[1][1]=p[1],l[1]=Bt(a[1],o)}while(!d);d=!1,f=.5,m=-1;let y=.01,b=1;do if(_=NaN,a[2]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ie(a[2],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[2],e))d=!0,h[2]=_,l[2]=Bt(a[2],o);else if(!isNaN(_)&&_>m)m=_,p[0]=a[2][0],p[1]=a[2][1];else if(_>m&&(m=_,p[0]=a[2][0],p[1]=a[2][1]),f=.5+y*b,y+=.01,b*=-1,f<.3||f>.7){if(!(m>=0))break;d=!0,h[2]=m,a[2][0]=p[0],a[2][1]=p[1],l[2]=Bt(a[2],o)}while(!d);d=!1,f=.75,m=-1;do if(_=NaN,a[3]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ie(a[3],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[3],e))d=!0,h[3]=_,l[3]=Bt(a[3],o);else if(_>m&&(m=_,p[0]=a[3][0],p[1]=a[3][1]),f+=.01,f>.9){if(!(m>=0))break;d=!0,h[3]=m,a[3][0]=p[0],a[3][1]=p[1],l[3]=Bt(a[3],o)}while(!d);const P=[0,1,2,3],w=c?0:1;let S;for(let z=w;z<4;z++)for(let O=w;O<3;O++){const ot=l[O],Z=l[O+1];ph(ot,Z)>0&&(S=P[O],P[O]=P[O+1],P[O+1]=S,l[O]=Z,l[O+1]=ot)}let L=w,V=0,U=0;for(let z=w;z<4;z++){switch(z){case 0:U=2*h[P[z]];break;case 1:U=1.66666666*h[P[z]];break;case 2:U=1.33333333*h[P[z]];break;case 3:U=h[P[z]]}U>V&&(V=U,L=P[z])}return a[L]}function Vs(e,t){let s,i,n,r,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(s=t.x,i=t.y;t.nextPoint();s=n,i=r)n=t.x,r=t.y,i>e[1]!=r>e[1]&&((n-s)*(e[1]-i)-(r-i)*(e[0]-s)>0?o++:o--);return o!==0}function Ie(e,t,s){if(s&&Vs(e,t))return{coord:e,distance:0};let i=1/0,n=0,r=0,o=[0,0],a=[0,0];const h=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=a){a=[t.x,t.y],Jo(h,e,o,a);const l=Bt(e,h);lo?mu)i&Vr?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):n&Vr?(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)):i?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e));else if(i&Hr?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):n&Hr?(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e)):i?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)),i&n)return 0}while(i|n);return l}function pt(e,t){return(e[0]t[2]?1:0)<<1|(e[1]t[3]?1:0)<<3}function Si(e,t,s){return e+(t-e)*s}function Bt(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}function ph(e,t){if(et)return 1;if(e===t)return 0;const s=isNaN(e),i=isNaN(t);return si?1:0}let Vn=class es{static local(){return es.instance===null&&(es.instance=new es),es.instance}execute(t,s,i,n,r){return new dh(t,s,i)}};Vn.instance=null;let dh=class{constructor(e,t,s){this._geometryCursor=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0,this._method=t.method!==void 0?t.method:vs.OnPolygon,this._placementPerPart=t.placePerPart!==void 0&&t.placePerPart,this._internalPlacement=new ye}next(){const e=this._geometryCursor;if(!e)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(e);for(;e.nextPath();)if(!(e.getCurrentRingArea()<0))return this._polygonCenter(e.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(e){let t=!1;switch(this._method){case vs.CenterOfMass:{const s=ea(e);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}break;case vs.BoundingBoxCenter:{const s=ui(e);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),t=!0)}break;case vs.OnPolygon:default:{const s=lh(e);s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}};function fh(e){if(!e)return null;switch(e.type){case"CIMGeometricEffectAddControlPoints":return Pn.local();case"CIMGeometricEffectArrow":return wn.local();case"CIMGeometricEffectBuffer":return vn.local();case"CIMGeometricEffectControlMeasureLine":return Sn.local();case"CIMGeometricEffectCut":return Mn.local();case"CIMGeometricEffectDashes":return Cn.local();case"CIMGeometricEffectDonut":return In.local();case"CIMGeometricEffectJog":return kn.local();case"CIMGeometricEffectMove":return Tn.local();case"CIMGeometricEffectOffset":return zn.local();case"CIMGeometricEffectReverse":return Ln.local();case"CIMGeometricEffectRotate":return An.local();case"CIMGeometricEffectScale":return On.local();case"CIMGeometricEffectWave":return En.local()}return null}function mh(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return Fn.local();case"CIMMarkerPlacementAtExtremities":return Nn.local();case"CIMMarkerPlacementAtRatioPositions":return $n.local();case"CIMMarkerPlacementInsidePolygon":return Rn.local();case"CIMMarkerPlacementOnLine":return Dn.local();case"CIMMarkerPlacementOnVertices":return Gn.local();case"CIMMarkerPlacementPolygonCenter":return Vn.local()}return null}const Mi=new No;function _h(e){if(e==null)return["",!1];if(!Mi.hasBidiChar(e))return[e,!1];let t;return t=Mi.checkContextual(e)==="rtl"?"IDNNN":"ICNNN",[Mi.bidiTransform(e,t,"VLYSN"),!0]}const pr="arial-unicode-ms",Br="woff2",Xr=new Map,gh=new Set;let yh=class{constructor(e,t){this.fontFace=e,this.promise=t}};async function Wc(e){const t=Ph(e),s=bh(e),i=Xr.get(t);if(i)return i.promise;const n=new FontFace(e.family,`url('${Qo.fontsUrl}/woff2/${s}.${Br}') format('${Br}')`,{style:e.style,weight:e.weight}),r=document.fonts;if(r.has(n)&&n.status==="loading")return n.loaded;const o=n.load().then(()=>(r.add(n),n));return Xr.set(t,new yh(n,o)),gh.add(n),o}function xh(e){if(!e)return pr;const t=e.toLowerCase().split(" ").join("-");switch(t){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return t}}function bh(e){const t=Hn(e)+Bn(e);return xh(e.family)+(t.length>0?t:"-regular")}function Ph(e){const t=Hn(e)+Bn(e);return(e.family||pr)+(t.length>0?t:"-regular")}function Hn(e){if(!e.weight)return"";switch(e.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Bn(e){if(!e.style)return"";switch(e.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let wh=class{applyColorSubstitution(e,t){if(!t)return e;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=e,n=this._rasterizationCanvas,r=n.getContext("2d",{willReadFrequently:!0});e!==n&&(n.width=s,n.height=i,r.drawImage(e,0,0,s,i));const o=r.getImageData(0,0,s,i).data;if(t){for(const h of t)if(h&&h.oldColor&&h.oldColor.length===4&&h.newColor&&h.newColor.length===4){const[l,c,u,p]=h.oldColor,[d,f,m,_]=h.newColor;if(l===d&&c===f&&u===m&&p===_)continue;for(let y=0;y0;let w=this._lineThroughWidthOffset,S=0;if(o){i.save();const Z=t.backgroundColor??[0,0,0,0],at=t.borderLine?.color??[0,0,0,0],Fo=2*(t.borderLine?.size??0);i.fillStyle=As(Z),i.strokeStyle=As(at),i.lineWidth=Fo,i.fillRect(0,0,s.width,s.height),i.strokeRect(0,0,s.width,s.height),i.restore()}P&&this._renderHalo(i,y,b,w,S,t),f>0&&this._renderOutline(i,y,b,w,S,t),S+=b,w+=y;for(const Z of this._textLines)P?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(Z,w,S),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(Z,w,S)):(i.fillStyle=this._fillStyle,i.fillText(Z,w,S)),n&&n!=="none"&&this._renderDecoration(i,w,S,n,r),S+=d;i.restore();const L=this._renderedWidth+2*this._lineThroughWidthOffset,V=this._renderedHeight,U=i.getImageData(0,0,L,V),z=new Uint8Array(U.data);if(t.premultiplyColors){let Z;for(let at=0;at600)&&(s+=.3*e.measureText("w").width),s+=2*fe(this._parameters.halo.size),Math.round(s)}_computeLineHeightBase(){return 1.275*this._parameters.size}_computeLineHeight(){let e=this._computeLineHeightBase();const t=this._parameters.font.decoration;return t&&t==="underline"&&(e*=1.3),Math.round(e+2*fe(this._parameters.halo.size))}_renderDecoration(e,t,s,i,n,r){let o=.9*this._lineHeight;const a=n==="bold"?.06:n==="bolder"?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const h=e.textBaseline;if(i==="underline")switch(o=.9*this._computeLineHeightBase(),h){case"top":s+=o;break;case"middle":s+=o/2}else if(i==="line-through")switch(h){case"top":s+=o/1.5;break;case"middle":s+=o/3}const l=r?1.5*r:Math.ceil(o*a);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=l,e.moveTo(t-this._lineThroughWidthOffset,s),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,s),e.stroke(),e.restore()}};function ke(e,t){const s=Math.max(t.size,.5),i=t.font,n=`${i.style} ${i.weight} ${fe(s).toFixed(1)}px ${i.family}, sans-serif`;let r;switch(e.font=n,e.textBaseline="top",t.horizontalAlignment){case"left":default:r="left";break;case"right":r="right";break;case"center":r="center"}e.textAlign=r}function Mh(e,t,s){return e==="center"?.5*t:e==="right"?t-s:s}function Yn(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ch(){const e=Yn("svg");return e.setAttribute("style","position: absolute;"),e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("role","presentation"),document.body.appendChild(e),e}function Ih(e){return e!=null&&document.body.removeChild(e),null}const kh=()=>ge.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var yt,nt;function Th(e){if(!e)return yt.Center;switch(e){case"Left":case"left":return yt.Left;case"Right":case"right":return yt.Right;case"Justify":return kh().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),yt.Center;case"Center":case"center":return yt.Center}}function zh(e){if(!e)return nt.Center;switch(e){case"Top":case"top":return nt.Top;case"Center":case"middle":return nt.Center;case"Baseline":case"baseline":return nt.Baseline;case"Bottom":case"bottom":return nt.Bottom}}function qc(e){switch(e){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${e}`),["center","middle"]}}function Kc(e){switch(e){case yt.Right:case"right":return-1;case yt.Center:case"center":return 0;case yt.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${e}`),0}}function jc(e){switch(e){case nt.Top:case"top":return 1;case nt.Center:case"middle":return 0;case nt.Bottom:case nt.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${e}`),0}}(function(e){e[e.Left=-1]="Left",e[e.Center=0]="Center",e[e.Right=1]="Right"})(yt||(yt={})),function(e){e[e.Top=1]="Top",e[e.Center=0]="Center",e[e.Bottom=-1]="Bottom",e[e.Baseline=2]="Baseline"}(nt||(nt={}));const dr=22,Wn=4,Lh=dr+Wn,Ah=dr-6,Ur=3,Oh=Math.PI/180,Ft=8,Eh=1.5;let qn=class{constructor(e,t,s,i){this._rotationT=rs(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,r=new Float32Array(8);e*=i,t*=i;const o=s.code?n.width*i:s.metrics.width,a=s.code?n.height*i:s.metrics.height;this.width=o,this.height=a,r[0]=e,r[1]=t,r[2]=e+o,r[3]=t,r[4]=e,r[5]=t+a,r[6]=e+o,r[7]=t+a,this._data=r,this._setTextureCoords(n),this._scale=i,this._mosaic=s,this.x=e,this.y=t,this.maxOffset=Math.max(e+o,t+a)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,yn(this._rotationT,-e),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:e,width:t}=this._mosaic.metrics,s=t*this._scale,i=Math.abs(e)*this._scale,n=new Float32Array(8);n[0]=this.x,n[1]=this.y,n[2]=this.x+s,n[3]=this.y,n[4]=this.x,n[5]=this.y+i,n[6]=this.x+s,n[7]=this.y+i;const r=Ti(rs(),this._rotationT,this._transform);Sa(n,n,r);let o=1/0,a=1/0,h=-1/0,l=-1/0;for(let f=0;f<4;f++){const m=n[2*f],_=n[2*f+1];o=Math.min(o,m),a=Math.min(a,_),h=Math.max(h,m),l=Math.max(l,_)}const c=h-o,u=l-a,p=o+c/2,d=a+u/2;this._bounds=new Ee(p,d,c,u)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const e=Ti(rs(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],ce(this._offsets.topLeft,this._offsets.topLeft,e),ce(this._offsets.topRight,this._offsets.topRight,e),ce(this._offsets.bottomLeft,this._offsets.bottomLeft,e),ce(this._offsets.bottomRight,this._offsets.bottomRight,e)}_setTextureCoords({x:e,y:t,width:s,height:i}){this._texcoords={topLeft:[e,t],topRight:[e+s,t],bottomLeft:[e,t+i],bottomRight:[e+s,t+i]}}};const Fh=(e,t)=>({code:0,page:0,sdf:!0,rect:new Ma(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:e,left:0,top:0}});function Te(e,t){return e.forEach(s=>ce(s,s,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}let Nh=class{constructor(e,t,s){this._rotation=0,this._decorate(e,t,s),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const i of e)i.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;const t=this._transform,s=yn(rs(),e);Ti(t,s,t);for(const i of this.glyphs)i.setTransform(this._transform)}_decorate(e,t,s){if(!s.decoration||s.decoration==="none"||!e.length)return;const i=s.scale,n=s.decoration==="underline"?Lh:Ah,r=e[0].textureBinding;for(const o of t){const a=o.startX*i,h=o.startY*i,l=(o.width+o.glyphWidthEnd)*i;e.push(new qn(a,h+n*i,Fh(l,r),1))}}shapeBackground(e){const t=this._borderLineSizePx||0,s=(Eh+t)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:r,xmax:o,ymax:a,x:h,y:l,width:c,height:u}=this.bounds,p=[n-Ft,r-Ft],d=[o+Ft,r-Ft],f=[n-Ft,a+Ft],m=[o+Ft,a+Ft],_=Te([[p[0]-s,p[1]-s],[d[0]+s,d[1]-s],[p[0]+i,p[1]+i],[d[0]-i,d[1]+i]],e),y=Te([[f[0]+i,f[1]-i],[m[0]-i,m[1]-i],[f[0]-s,f[1]+s],[m[0]+s,m[1]+s]],e),b=Te([[p[0]-s,p[1]-s],[p[0]+i,p[1]+i],[f[0]-s,f[1]+s],[f[0]+i,f[1]-i]],e),P=Te([[d[0]-i,d[1]+i],[d[0]+s,d[1]-s],[m[0]-i,m[1]-i],[m[0]+s,m[1]+s]],e),w={main:Te([p,d,f,m],e),top:_,bot:y,left:b,right:P};return[new Ee(h,l,c+2*s,u+2*s),w]}get boundsT(){const e=this.bounds,t=Ss(Er(),e.x,e.y);if(ce(t,t,this._transform),this._hasRotation){const s=Math.max(e.width,e.height);return new Ee(t[0],t[1],s,s)}return new Ee(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,s=1/0,i=0,n=0;for(const a of e)t=Math.min(t,a.xTopLeft),s=Math.min(s,a.yTopLeft),i=Math.max(i,a.xBottomRight),n=Math.max(n,a.yBottomRight);const r=i-t,o=n-s;return new Ee(t+r/2,s+o/2,r,o)}_createGlyphTransform(e,t){const s=Oh*t.angle,i=rs(),n=Er();return Pi(i,i,Ss(n,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?Or(i,i,s):(Pi(i,i,Ss(n,e.x,e.y)),Or(i,i,s),Pi(i,i,Ss(n,-e.x,-e.y))),i}},Os=class{constructor(e,t,s,i,n,r){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,s)),this.end=Math.max(0,Math.max(t,s)),this.ende===10,Yr=e=>e===32;function $h(e,t,s){const i=new Array,n=1/s.scale,r=s.maxLineWidth*n,o=t?e.length-1:0,a=t?-1:e.length,h=t?-1:1;let l=o,c=0,u=0,p=l,d=p,f=0,m=1/0,_=0;for(;l!==a;){const{code:b,metrics:P}=e[l],w=Math.abs(P.top);if(Ei(b)||Yr(b)||(m=Math.min(m,w),_=Math.max(_,w+P.height)),Ei(b))l!==o&&(i.push(new Os(e,p,l-h,c,m===1/0?0:m,_)),m=1/0,_=0),c=0,p=l+h,d=l+h,u=0;else if(Yr(b))d=l+h,u=0,f=P.advance,c+=P.advance;else if(c>r){if(d!==p){const S=d-2*h;c-=f,i.push(new Os(e,p,S,c-u,m,_)),m=1/0,_=0,p=d,c=u}else i.push(new Os(e,p,l-h,c,m,_)),m=1/0,_=0,p=l,d=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const y=new Os(e,p,l-h,c,m,_);return y.start>=0&&y.endge.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let Xt=class dt{constructor(t){this._t=t}static createIdentity(){return new dt([1,0,0,0,1,0])}clone(){const t=this._t;return new dt(t.slice())}transform(t){const s=this._t;return[s[0]*t[0]+s[1]*t[1]+s[2],s[3]*t[0]+s[4]*t[1]+s[5]]}static createScale(t,s){return new dt([t,0,0,0,s,0])}scale(t,s){const i=this._t;return i[0]*=t,i[1]*=t,i[2]*=t,i[3]*=s,i[4]*=s,i[5]*=s,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,s){return new dt([0,0,t,0,0,s])}translate(t,s){const i=this._t;return i[2]+=t,i[5]+=s,this}static createRotate(t){const s=Math.cos(t),i=Math.sin(t);return new dt([s,-i,0,i,s,0])}rotate(t){return dt.multiply(this,dt.createRotate(t),this)}angle(){const t=this._t[0],s=this._t[3],i=Math.sqrt(t*t+s*s);return[t/i,s/i]}static multiply(t,s,i){const n=t._t,r=s._t,o=n[0]*r[0]+n[3]*r[1],a=n[1]*r[0]+n[4]*r[1],h=n[2]*r[0]+n[5]*r[1]+r[2],l=n[0]*r[3]+n[3]*r[4],c=n[1]*r[3]+n[4]*r[4],u=n[2]*r[3]+n[5]*r[4]+r[5],p=i._t;return p[0]=o,p[1]=a,p[2]=h,p[3]=l,p[4]=c,p[5]=u,i}invert(){const t=this._t;let s=t[0]*t[4]-t[1]*t[3];if(s===0)return new dt([0,0,0,0,0,0]);s=1/s;const i=(t[1]*t[5]-t[2]*t[4])*s,n=(t[2]*t[3]-t[0]*t[5])*s,r=t[4]*s,o=-t[1]*s,a=-t[3]*s,h=t[0]*s;return new dt([r,o,i,a,h,n])}};class fr{constructor(t,s){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Uo(ye,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(s||Xt.createIdentity()),this._sizeTransfos.push(s?s.scaleRatio():1)}setTransform(t,s){this._transfos=[t||Xt.createIdentity()],this._sizeTransfos=[s||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,s){const i=s?t.scaleRatio():1;Xt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*i)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,s,i){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,s);break;case"CIMTextSymbol":this.drawTextSymbol(t,s,i)}}drawMultiLayerSymbol(t,s){if(!t||!s)return;const i=t.symbolLayers;if(!i)return;const n=t.effects;if(n&&n.length>0){const r=this.executeEffects(n,s);if(r){let o=r.next();for(;o;)this.drawSymbolLayers(i,o.asJSON()),o=r.next()}}else this.drawSymbolLayers(i,s)}executeEffects(t,s){const i=this._resourceManager.geometryEngine;let n=new Oa(N.fromJSONCIM(s));for(const r of t){const o=fh(r);o&&(n=o.execute(n,r,this.geomUnitsPerPoint(),null,i))}return n}drawSymbolLayers(t,s){let i=t.length;for(;i--;){const n=t[i];if(!n||n.enable===!1)continue;const r=n.effects;if(r&&r.length>0){const o=this.executeEffects(r,s);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,s);if(this._earlyReturn)return}}drawSymbolLayer(t,s){switch(t.type){case"CIMSolidFill":this.drawSolidFill(s,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(s,t);break;case"CIMPictureFill":this.drawPictureFill(s,t);break;case"CIMGradientFill":this.drawGradientFill(s,t);break;case"CIMSolidStroke":this.drawSolidStroke(s,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(s,t);break;case"CIMGradientStroke":this.drawGradientStroke(s,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,s)}}drawHatchFill(t,s){const i=Hh(s,t,this.geomUnitsPerPoint());i&&(this.pushClipPath(t),this.drawMultiLayerSymbol(s.lineSymbol,i),this.popClipPath())}drawPictureFill(t,s){}drawGradientFill(t,s){}drawPictureStroke(t,s){}drawGradientStroke(t,s){}drawMarkerLayer(t,s){const i=t.markerPlacement;if(i){const n=mh(i);if(n){const r=i.type==="CIMMarkerPlacementInsidePolygon"||i.type==="CIMMarkerPlacementPolygonCenter"&&i.clipAtBoundary;r&&this.pushClipPath(s);const o=n.execute(N.fromJSONCIM(s),i,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(t,a),!this._earlyReturn););}r&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(ki(s))n.tx=s.x,n.ty=s.y,this.drawMarker(t,n);else if(rt(s)){const r=Yo(s);r&&([n.tx,n.ty]=r,this.drawMarker(t,n))}else for(const r of s.points)if(n.tx=r[0],n.ty=r[1],this.drawMarker(t,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(t,s){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,s);break;case"CIMVectorMarker":this.drawVectorMarker(t,s)}}drawPictureMarker(t,s){if(!t)return;const i=this._resourceManager.getResource(t.url),n=C(t.size,Tt.CIMPictureMarker.size);if(i==null||n<=0)return;const r=i.width,o=i.height;if(!r||!o)return;const a=r/o,h=C(t.scaleX,1),l=Xt.createIdentity(),c=t.anchorPoint;if(c){let _=c.x,y=c.y;t.anchorPointUnits!=="Absolute"&&(_*=n*a*h,y*=n),l.translate(-_,-y)}let u=C(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Wt);let p=C(t.offsetX),d=C(t.offsetY);if(p||d){if(this._mapRotation){const _=Wt*this._mapRotation,y=Math.cos(_),b=Math.sin(_),P=p*b+d*y;p=p*y-d*b,d=P}l.translate(p,d)}const f=this.geomUnitsPerPoint();f!==1&&l.scale(f,f);const m=s.getAngle();m&&l.rotate(m),l.translate(s.tx,s.ty),this.push(l,!1),this.drawImage(t,n),this.pop()}drawVectorMarker(t,s){if(!t)return;const i=t.markerGraphics;if(!i)return;const n=C(t.size,Tt.CIMVectorMarker.size),r=t.frame,o=r?r.ymax-r.ymin:0,a=n&&o?n/o:1,h=Xt.createIdentity();r&&h.translate(.5*-(r.xmax+r.xmin),.5*-(r.ymax+r.ymin));const l=t.anchorPoint;if(l){let m=l.x,_=l.y;t.anchorPointUnits!=="Absolute"?r&&(m*=r.xmax-r.xmin,_*=r.ymax-r.ymin):(m/=a,_/=a),h.translate(-m,-_)}a!==1&&h.scale(a,a);let c=C(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*Wt);let u=C(t.offsetX),p=C(t.offsetY);if(u||p){if(this._mapRotation){const m=Wt*this._mapRotation,_=Math.cos(m),y=Math.sin(m),b=u*y+p*_;u=u*_-p*y,p=b}h.translate(u,p)}const d=this.geomUnitsPerPoint();d!==1&&h.scale(d,d);const f=s.getAngle();f&&h.rotate(f),h.translate(s.tx,s.ty),this.push(h,t.scaleSymbolsProportionally);for(const m of i){m?.symbol&&m.geometry||Dh().error("Invalid marker graphic",m);let _=m.textString;if(typeof _=="number"&&(_=_.toString()),this.drawSymbol(m.symbol,m.geometry,_),this._earlyReturn)break}this.pop()}drawTextSymbol(t,s,i){if(!t||!ki(s)||C(t.height,Tt.CIMTextSymbol.height)<=0)return;const n=Xt.createIdentity();let r=C(t.angle);r=-r,r&&n.rotate(r*Wt);const o=C(t.offsetX),a=C(t.offsetY);(o||a)&&n.translate(o,a);const h=this.geomUnitsPerPoint();h!==1&&n.scale(h,h),n.translate(s.x,s.y),this.push(n,!1),this.drawText(t,i),this.pop()}}let Gh=class extends fr{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new vh(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return Ho(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(e&&!(this._clipCount>0))if(rt(e))this._processPath(e.rings,0);else if(gt(e))this._processPath(e.paths,0);else if(ht(e)){const t=qt(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,t,s){if(!e||this._clipCount>0||s==null||s<=0)return;const i=Math.max(.5*this.transformSize(C(s,Tt.CIMSolidStroke.width)),.5*Zn);if(rt(e))this._processPath(e.rings,i);else if(gt(e))this._processPath(e.paths,i);else if(ht(e)){const n=qt(e);n&&this._processPath(n.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,t){rt(t)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){const{url:s}=e,i=C(e.scaleX,1);let n=i*t,r=t;const o=this._resourceManager.getResource(s);if(o!=null){const a=o.height/o.width;n=i*(t?a>1?t:t/a:o.width),r=t?a>1?t*a:t:o.height}this._merge(this.transformPt([-n/2,-r/2]),0),this._merge(this.transformPt([-n/2,r/2]),0),this._merge(this.transformPt([n/2,-r/2]),0),this._merge(this.transformPt([n/2,r/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const s=to(e);let[i,n]=this._textRasterizer.computeTextSize(t,s);i=bt(i),n=bt(n);const r=this.transformSize(1)*this.reverseTransformScalar(1);i*=r,n*=r;let o=0;switch(e.horizontalAlignment){case"Left":o=i/2;break;case"Right":o=-i/2}let a=0;switch(e.verticalAlignment){case"Bottom":a=n/2;break;case"Top":a=-n/2;break;case"Baseline":a=n/6}this._merge(this.transformPt([-i/2+o,-n/2+a]),0),this._merge(this.transformPt([-i/2+o,n/2+a]),0),this._merge(this.transformPt([i/2+o,-n/2+a]),0),this._merge(this.transformPt([i/2+o,n/2+a]),0)}_processPath(e,t){if(e)for(const s of e){const i=s?s.length:0;if(i>1){this._merge(this.transformPt(s[0]),t);for(let n=1;nthis._xmax&&(this._xmax=e[0]+t),e[1]-tthis._ymax&&(this._ymax=e[1]+t)}},Qc=class extends fr{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Ih(this._svg),this._path=null,this._canvas=null}hitTest(e,t,s,i,n,r){const o=r*fe(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/o,this._textInfo=i;const a=t&&(t.type==="CIMPointSymbol"&&t.angleAlignment!=="Map"||t.type==="CIMTextSymbol");if(this._mapRotation=a?n:0,!li("esri-mobile")){const h=bt(xa*window.devicePixelRatio),l=bt(ba);!((t?.type==="CIMLineSymbol"||t?.type==="CIMPolygonSymbol")&&t.symbolLayers?.some(ca))&&t?.type!=="CIMMeshSymbol"&&(ua(t)??0)d.xTopLeft&&u-d.yBottomRight&&p<-d.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let t=null;if(ht(e)){const i=e;t=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))t=e.rings;else{if(!gt(e))return;t=e.paths}const s=this.reverseTransformPt(this._searchPoint);Bh(s,t)&&(this._earlyReturn=!0),!this._earlyReturn&&Wr(s,t,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}_getSvgPath(){return this._svg!=null&&this._path!=null||(this._svg??=Ch(),this._path??=Yn("path"),this._svg.appendChild(this._path)),this._path}_getCanvas(){return this._canvas??=document.createElement("canvas"),this._canvas}_hittestSvgPath(e,t,s,i){const n=Qt();lr(n,e);const r={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},o=this._getSvgPath();o.setAttribute("d",t);const a=o.getBBox(),h=a.width/r.width,l=a.height/r.height,c=this._getCanvas();c.width=a.width,c.height=a.height;const u=c.getContext("2d",{willReadFrequently:!0});u.setTransform(1,0,0,1,a.x,-a.y);const p=new Path2D(t);s?u.fill(p):(u.lineWidth=i*h,u.stroke(p));const d=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),f=this.reverseTransformPt(this._searchPoint),m=(f[0]-r.x-d)*h,_=(r.height-(f[1]-r.y)-d)*l,y=2*d*h,b=2*d*l,P=u.getImageData(m,_,y,b).data;for(let w=3;w127.5)return void(this._earlyReturn=!0)}_hitTestStroke(e,t){let s=null;if(ht(e)){const i=e;s=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))s=e.rings;else{if(!gt(e))return;s=e.paths}Wr(this.reverseTransformPt(this._searchPoint),s,C(t,Tt.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}};class Vh extends fr{constructor(t,s,i,n){super(s,i),this._applyAdditionalRenderProps=n,this._colorSubstitutionHelper=new wh,this._ctx=t}drawSolidFill(t,s){if(!t)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const i=this._ctx;i.fillStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",i.fill("evenodd")}drawSolidStroke(t,s,i,n,r,o){if(!t||!s||i===0)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!1);else{if(!ht(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(qt(t).rings,!0)}const a=this._ctx;a.strokeStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",a.lineWidth=Math.max(this.transformSize(i),Zn),this._setCapStyle(n),this._setJoinStyle(r),a.miterLimit=o,a.stroke()}pushClipPath(t){if(this._ctx.save(),rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else{if(!ht(t))return;this._buildPath(qt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,s){const{colorSubstitutions:i,url:n,tintColor:r}=t,o=C(t.scaleX,1),a=this._resourceManager.getResource(n);if(a==null)return;let h=s*(a.width/a.height),l=s;s||(h=a.width,l=a.height);const c=se(n)||"src"in a&&se(a.src);let u="getFrame"in a?Ci(a):a;i&&(u=this._colorSubstitutionHelper.applyColorSubstitution(u,i)),this._applyAdditionalRenderProps&&!c&&r&&(u=this._colorSubstitutionHelper.tintImageData(u,r));const p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=this.transformSize(1),_=this._ctx;_.save(),_.setTransform({m11:o*m*d,m12:o*m*f,m21:-m*f,m22:m*d,m41:p[0],m42:p[1]}),_.drawImage(u,-h/2,-l/2,h,l),_.restore()}drawText(t,s){if(!s||s.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const i=to(t,this.transformSize(bt(1))),n=this._textRasterizer.rasterizeText(s,i);if(!n)return;const{size:r,anchorX:o,anchorY:a,canvas:h}=n,l=r[0]*(o+.5),c=r[1]*(a-.5),u=this._ctx,p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=1;u.save(),u.setTransform({m11:m*d,m12:m*f,m21:-m*f,m22:m*d,m41:p[0]-m*l,m42:p[1]+m*c}),u.drawImage(h,0,0),u.restore()}drawPictureFill(t,s){if(!t)return;let{colorSubstitutions:i,height:n,offsetX:r,offsetY:o,rotation:a,scaleX:h,tintColor:l,url:c}=s;const u=this._resourceManager.getResource(c);if(u==null)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const p=this._ctx,d=se(c)||"src"in u&&se(u.src);let f,m="getFrame"in u?Ci(u):u;if(i&&(m=this._colorSubstitutionHelper.applyColorSubstitution(m,i)),this._applyAdditionalRenderProps){d||l&&(m=this._colorSubstitutionHelper.tintImageData(m,l)),f=p.createPattern(m,"repeat");const _=this.transformSize(1);a||(a=0),r?r*=_:r=0,o?o*=_:o=0,n&&(n*=_);const y=n?n/u.height:1,b=h&&n?h*n/u.width:1;if(a!==0||y!==1||b!==1||r!==0||o!==0){const P=new DOMMatrix;P.rotateSelf(0,0,-a).translateSelf(r,o).scaleSelf(b,y,1),f.setTransform(P)}}else f=p.createPattern(m,"repeat");p.save(),p.fillStyle=f,p.fill("evenodd"),p.restore()}drawPictureStroke(t,s){if(!t)return;let{colorSubstitutions:i,capStyle:n,joinStyle:r,miterLimit:o,tintColor:a,url:h,width:l}=s;const c=this._resourceManager.getResource(h);if(c==null)return;let u;if(rt(t))u=t.rings;else if(gt(t))u=t.paths;else{if(!ht(t))return Ds(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;u=qt(t).rings}l||(l=c.width);const p=se(h)||"src"in c&&se(c.src);let d="getFrame"in c?Ci(c):c;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(p||a&&(d=this._colorSubstitutionHelper.tintImageData(d,a)));const f=Math.max(this.transformSize(fe(l)),.5),m=f/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let b,P;_.save(),this._setCapStyle(n),this._setJoinStyle(r),o!==void 0&&(_.miterLimit=o),_.lineWidth=f;for(let w of u)if(w=pe(w),Yh(w),w&&!(w.length<=1)){b=this.transformPt(w[0]);for(let S=1;S1){let o=this.transformPt(n[0]);i.moveTo(o[0],o[1]);for(let a=1;ao;)r-=i;for(;r<-o;)r+=i;const a=Qt();lr(a,t),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const l=Math.cos(n*Wt),c=Math.sin(n*Wt),u=-i*c,p=i*l;let d,f,m,_;r=C(e.offsetX)*s*c-C(e.offsetY)*s*l,d=m=Number.MAX_VALUE,f=_=-Number.MAX_VALUE;for(const V of h){const U=V[0],z=V[1],O=l*U+c*z,ot=-c*U+l*z;d=Math.min(d,O),m=Math.min(m,ot),f=Math.max(f,O),_=Math.max(_,ot)}m=Math.floor(m/i)*i;let y=l*d-c*m-u*r/i,b=c*d+l*m-p*r/i,P=l*f-c*m-u*r/i,w=c*f+l*m-p*r/i;const S=1+Math.round((_-m)/i),L=[];for(let V=0;Ve[1]!=a[1]>e[1]&&((a[0]-o[0])*(e[1]-o[1])-(a[1]-o[1])*(e[0]-o[0])>0?s++:s--)}}return s!==0}function Wr(e,t,s){for(const i of t){const n=i.length;for(let r=1;r-s&&ce?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null,Qn=(e,t,s)=>{switch(e){case"ExtraLeading":return 1+t/s;case"Multiple":return t;case"Exact":return t/s}};function to(e,t=1){const s=fn(e),i=dn(e.fontStyleName),n=e.fontFamilyName??pr,{weight:r,style:o}=i,a=t*(e.height||5),h=pa(e.horizontalAlignment),l=da(e.verticalAlignment),c=bi(e),u=bi(e.haloSymbol),p=u!=null?t*(e.haloSize??0):0,d=Lr(e.symbol),f=t*(Ar(e.symbol)||0),m=e.callout?.type==="CIMBackgroundCallout"?e.callout.backgroundSymbol:null,_=bi(m),y=Ar(m),b=Lr(m);return{color:c,size:a,horizontalAlignment:h,verticalAlignment:l,font:{family:n,style:fa(o),weight:ma(r),decoration:s},outline:{size:f||0,color:d},halo:{size:p||0,color:u,style:o},backgroundColor:_,borderLine:y!=null&&b!=null?{size:y,color:b}:null,pixelRatio:1,premultiplyColors:!0}}const Uh=1e-4;function Yh(e){let t,s,i,n,r,o=e[0],a=1;for(;age.getLogger("esri.symbols.cim.CIMSymbolHelper");function tu(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const s=re.fromSimpleMarker(e);if(!s)throw new Error("InternalError: Cannot convert symbol to CIM");t=s;break}case"picture-marker":t=re.fromPictureMarker(e);break;case"simple-line":t=re.fromSimpleLineSymbol(e);break;case"simple-fill":t=re.fromSimpleFillSymbol(e);break;case"picture-fill":t=re.fromPictureFillSymbol(e);break;case"text":t=re.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function Hs(e,t,s){switch(t.type){case"CIMSymbolReference":return Hs(e,t.symbol,s);case"CIMPointSymbol":s==null&&(s={x:0,y:0}),e.drawSymbol(t,s);break;case"CIMLineSymbol":s==null&&(s={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,s);break;case"CIMPolygonSymbol":s==null&&(s={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,s);break;case"CIMTextSymbol":{const i={x:0,y:0};e.drawSymbol(t,i);break}case"CIMVectorMarker":{const i=new ye;e.drawMarker(t,i);break}}return e.envelope()}function Kh(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function jh(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(C(e.offsetX)),Math.abs(C(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function jr(e){if(!e)return 0;let t=0;for(const s of e)t+=jh(s);return t}let eu=class{static getSymbolInflateSize(e,t,s,i,n){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,s,i,n):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),s=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+s*s)}static _vectorMarkerBounds(e,t,s,i){let n=!0;const r=Qt();if(t?.markerGraphics)for(const o of t.markerGraphics){const a=[0,0,0,0];o.geometry&&(lr(r,o.geometry),a[0]=0,a[1]=0,a[2]=0,a[3]=0,this.getSymbolInflateSize(a,o.symbol,s,0,i),r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],r[3]+=a[3],n?(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],n=!1):(e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[2]),e[3]=Math.max(e[3],r[3])))}return e}static _getInflateSize(e,t,s,i,n){if(sl(t)){const r=this._getLayersInflateSize(e,t.symbolLayers,s,i,n),o=jr(t.effects);return o>0&&(r[0]-=o,r[1]-=o,r[2]+=o,r[3]+=o),r}return this._getTextInflatedSize(e,t,n)}static _getLayersInflateSize(e,t,s,i,n){let r=!0;if(!t)return e;for(const o of t){if(!o)continue;let a=[0,0,0,0];switch(o.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const l=o;let c=l.width;c!=null&&(l.capStyle===lt.Square||l.joinStyle===kt.Miter?c/=qh:c/=2,a[0]=-c,a[1]=-c,a[2]=c,a[3]=c);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const l=o;if(o.type==="CIMVectorMarker"){const f=o;if(a=this._vectorMarkerBounds(a,f,s,n),f.frame){const m=(f.frame.xmin+f.frame.xmax)/2,_=(f.frame.ymin+f.frame.ymax)/2;if(a[0]-=m,a[1]-=_,a[2]-=m,a[3]-=_,f.size!=null){const y=f.size/(f.frame.ymax-f.frame.ymin);a[0]*=y,a[1]*=y,a[2]*=y,a[3]*=y}}}else if(o.type==="CIMPictureMarker"){const f=o,m=s.getResource(f.url);let _=1;if(m!=null&&m.height&&(_=m.width/m.height),l.size!=null){const y=l.size/2,b=l.size*_*f.scaleX/2;a=[-b,-y,b,y]}}else if(l.size!=null){const f=l.size/2;a=[-f,-f,f,f]}if(l.anchorPoint){let f,m;l.anchorPointUnits==="Absolute"?(f=l.anchorPoint.x,m=l.anchorPoint.y):(f=l.anchorPoint.x*(a[2]-a[0]),m=l.anchorPoint.y*(a[3]-a[1]));const _=1.25*Math.sqrt(f*f+m*m);a[0]-=_,a[1]-=_,a[2]+=_,a[3]+=_}let c=C(l.rotation);if(l.rotateClockwise&&(c=-c),i&&(c-=i),c){const f=qr*c,m=Math.cos(f),_=Math.sin(f),y=Qt([bs,bs,-bs,-bs]);xs(y,[a[0]*m-a[1]*_,a[0]*_+a[1]*m]),xs(y,[a[0]*m-a[3]*_,a[0]*_+a[3]*m]),xs(y,[a[2]*m-a[1]*_,a[2]*_+a[1]*m]),xs(y,[a[2]*m-a[3]*_,a[2]*_+a[3]*m]),a=y}let u=C(l.offsetX),p=C(l.offsetY);if(i){const f=qr*i,m=Math.cos(f),_=Math.sin(f),y=u*_+p*m;u=u*m-p*_,p=y}a[0]+=u,a[1]+=p,a[2]+=u,a[3]+=p;const d=Kh(l.markerPlacement);d>0&&(a[0]-=d,a[1]-=d,a[2]+=d,a[3]+=d);break}}const h=jr(o.effects);h>0&&(a[0]-=h,a[1]-=h,a[2]+=h,a[3]+=h),r?(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],r=!1):(e[0]=Math.min(e[0],a[0]),e[1]=Math.min(e[1],a[1]),e[2]=Math.max(e[2],a[2]),e[3]=Math.max(e[3],a[3]))}return e}static _getTextInflatedSize(e,t,s){const i=jn(t.height??Tt.CIMTextSymbol.height);if(e[0]=-i/2,e[1]=-i/2,e[2]=i/2,e[3]=i/2,!s)return e;const n=s.get(t);if(!n||!n.glyphMosaicItems.glyphs.length)return e;const{lineGapType:r,lineGap:o}=t,a=r?Qn(r,o??0,i):0,h=t.callout?.type==="CIMBackgroundCallout",l=Kn(n.glyphMosaicItems,{scale:i/_n,angle:C(t.angle),xOffset:C(t.offsetX),yOffset:C(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:Jn(t.lineWidth),lineHeight:gn*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:h}).boundsT,c=Math.sqrt(l.width*l.width+l.height*l.height);return e[0]-=l.x+c,e[1]-=l.y-c,e[2]+=l.x+c,e[3]+=-l.y+c,e}},re=class Bs{static getEnvelope(t,s,i){if(!t)return null;const n=new Gh(i);if(Array.isArray(t)){let r;for(const o of t)r?r.union(Hs(n,o,s)):r=Hs(n,o,s);return r}return Hs(n,t,s)}static getTextureAnchor(t,s){const i=this.getEnvelope(t,null,s);if(!i)return[0,0,0];const n=(i.x+.5*i.width)*ie,r=(i.y+.5*i.height)*ie,o=i.width*ie+2,a=i.height*ie+2;return[-n/o,-r/a,a]}static rasterize(t,s,i,n,r=!0,o){const a=i||this.getEnvelope(s,null,n);if(!a)return[null,0,0,0,0];const h=Math.max(a.width,a.height)*ie;let l=o!=null?Math.max(o/h,1):1;l*=ie;const c=(a.x+.5*a.width)*l,u=(a.y+.5*a.height)*l;t.width=a.width*l,t.height=a.height*l,i||(t.width+=2,t.height+=2);const p=t.getContext("2d",{willReadFrequently:!0}),d=Xt.createScale(l,-l);d.translate(.5*t.width-c,.5*t.height+u);const f=new Vh(p,n,d);switch(s.type){case"CIMPointSymbol":{const y={type:"point",x:0,y:0};f.drawSymbol(s,y);break}case"CIMVectorMarker":{const y=new ye;f.drawMarker(s,y);break}}const m=p.getImageData(0,0,t.width,t.height),_=new Uint8Array(m.data);if(r){let y;for(let b=0;b<_.length;b+=4)y=_[b+3]/255,_[b]=_[b]*y,_[b+1]=_[b+1]*y,_[b+2]=_[b+2]*y}return[_,t.width,t.height,-c/t.width,-u/t.height]}static fromTextSymbol(t){const{text:s}=t;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:Bs.createCIMTextSymbolfromTextSymbol(t),textString:s}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:s,outline:i,width:n,xoffset:r,xscale:o,yoffset:a,yscale:h}=t,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(i){const m=Jr(i);m&&l.push(m)}let u=t.url;t.type==="esriPFS"&&t.imageData&&(u=t.imageData);const p="angle"in t?t.angle??0:0,d=(n??0)*(o||1),f=(s??0)*(h||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:u,height:f,width:d,offsetX:C(r),offsetY:C(a),rotation:C(-p),colorSubstitutions:null}),c}static fromSimpleFillSymbol(t){const{color:s,style:i,outline:n}=t,r=[],o={type:"CIMPolygonSymbol",symbolLayers:r};if(n){const a=Jr(n);a&&r.push(a)}if(i&&i!=="solid"&&i!=="none"&&i!=="esriSFSSolid"&&i!=="esriSFSNull"){const a={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:Q(s),capStyle:lt.Butt,joinStyle:kt.Miter,width:.75}]};let h=0;const l=bt(il(i)?8:10);switch(i){case"vertical":case"esriSFSVertical":h=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":h=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":h=45;break;case"cross":case"esriSFSCross":h=0}r.push({type:"CIMHatchFill",lineSymbol:a,offsetX:0,offsetY:0,rotation:h,separation:l}),i==="cross"||i==="esriSFSCross"?r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:90,separation:l}):i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"||r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:45,separation:l})}else!i||i!=="solid"&&i!=="esriSFSSolid"||r.push({type:"CIMSolidFill",enable:!0,color:Q(s)});return o}static fromSimpleLineSymbol(t){const{cap:s,color:i,join:n,marker:r,miterLimit:o,style:a,width:h}=t;let l=null;a!=="solid"&&a!=="none"&&a!=="esriSLSSolid"&&a!=="esriSLSNull"&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(a,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(r){let u;switch(r.placement){case"begin-end":u=Rt.Both;break;case"begin":u=Rt.JustBegin;break;case"end":u=Rt.JustEnd;break;default:u=Rt.None}const p=Bs.fromSimpleMarker(r,h,i).symbolLayers[0];p.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,offset:0,extremityPlacement:u,offsetAlongLine:0},c.push(p)}return c.push({type:"CIMSolidStroke",color:a!=="none"&&a!=="esriSLSNull"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:o,width:h,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t;let a=t.url;return t.type==="esriPMS"&&t.imageData&&(a=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:s,color:i,font:n,haloColor:r,haloSize:o,horizontalAlignment:a,kerning:h,lineWidth:l,text:c,verticalAlignment:u,xoffset:p,yoffset:d,backgroundColor:f,borderLineColor:m,borderLineSize:_}=t;let y,b,P,w,S,L;n&&(y=n.family,b=n.style,P=n.weight,w=n.size,S=n.decoration);let V=!1;return c&&(V=_h(c)[1]),(f||_)&&(L={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:Q(f)},{type:"CIMSolidStroke",color:Q(m),width:_}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:s,blockProgression:ia.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:ra.Normal,fontEncoding:na.Unicode,fontFamilyName:y||"Arial",fontStyleName:Qh(b,P),fontType:oa.Unspecified,haloSize:o,height:w,hinting:aa.Default,horizontalAlignment:Jh(a??"center"),kerning:h,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:l,offsetX:C(p),offsetY:C(d),strikethrough:S==="line-through",underline:S==="underline",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(i)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(r)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:V?zr.RTL:zr.LTR,verticalAlignment:Zh(u??"baseline"),verticalGlyphOrientation:ha.Right,wordSpacing:100,billboardMode3D:la.FaceNearPlane,callout:L}}static createPictureMarkerRasterizationParam(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t,a=t.url??t.source?.url??t.source?.imageData;return a?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}}:null}static createPictureFillRasterizationParam(t){const{width:s,height:i,xoffset:n,yoffset:r,url:o}=t;return o?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:o,width:s,height:i,offsetX:C(n),offsetY:C(r),rotation:0}}:null}static fromSimpleMarker(t,s,i){const{style:n}=t,r=t.color??i;if(n==="path"||n==="esriSMSPath"){const u=[];if("outline"in t&&t.outline){const f=t.outline;u.push({type:"CIMSolidStroke",enable:!0,width:f.width,color:Q(f.color),path:t.path})}u.push({type:"CIMSolidFill",enable:!0,color:Q(r),path:t.path});const[p,d]=ze("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-C(t.angle),size:C(t.size||6),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:p,markerGraphics:[{type:"CIMMarkerGraphic",geometry:d,symbol:{type:"CIMPolygonSymbol",symbolLayers:u}}]}]}}const o=[];let a,h,l=t.size;if("outline"in t&&t.outline&&t.outline.style!=="none"&&t.outline.style!=="esriSLSNull"){const u=t.outline,p=u.style!=="solid"&&u.style!=="esriSLSSolid";[a,h]=p?ze(n,t.size):ze(n);const d=u.width??Ro.width;if(p){const _=d/t.size,y=(a.xmax-a.xmin)*_/2,b=(a.ymax-a.ymin)*_/2;a.xmin-=y,a.xmax+=y,a.ymin-=b,a.ymax+=b,l&&(l+=d)}const f=t.style!=="cross"&&t.style!=="x"||t?.outline.style==="dot"||t?.outline.style==="short-dot"?W.HalfGap:W.FullPattern,m=p?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Fi(u.style,null).map(_=>u.width&&u.width>0?_*u.width:_),lineDashEnding:f,controlPointEnding:W.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:p?lt.Round:lt.Butt,enable:!0,width:d,color:Q(u.color),effects:m})}else!s||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[a,h]=ze(n):([a,h]=ze(n),o.push({type:"CIMSolidStroke",enable:!0,width:s,color:Q(r)}));o.push({type:"CIMSolidFill",enable:!0,color:Q(r)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:C(-t.angle),size:C(l||6*s),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:h,symbol:c}]}]}}static fromCIMHatchFill(t,s){const i=s*(t.separation??Tt.CIMHatchFill.separation),n=i/2,r=pe(t.lineSymbol);r.symbolLayers?.forEach(h=>{switch(h.type){case"CIMSolidStroke":h.width!=null&&(h.width*=s),h.effects?.forEach(l=>{if(l.type==="CIMGeometricEffectDashes"){const c=l.dashTemplate;l.dashTemplate=c?.map(u=>u*s)}});break;case"CIMVectorMarker":{h.size!=null&&(h.size*=s);const l=h.markerPlacement;l!=null&&"placementTemplate"in l&&(l.placementTemplate=l.placementTemplate.map(c=>c*s));break}}});let o=this._getLineSymbolPeriod(r)||Kr;for(;o{rl(r,s,i),"url"in r&&r.url&&i.push(s.fetchResource(r.url,{signal:n}))}),i}static fetchFonts(t,s,i){if(t&&s){if("symbolLayers"in t&&t.symbolLayers){for(const n of t.symbolLayers)if(n.type==="CIMVectorMarker"&&n.markerGraphics)for(const r of n.markerGraphics)r?.symbol&&Bs.fetchFonts(r.symbol,s,i)}else if(t.type==="CIMTextSymbol"){const{fontFamilyName:n,fontStyleName:r}=t;if(!n||n.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=dn(r),h=fn(t),l=new Do({family:n,style:o,weight:a,decoration:h});i.push(s.loadFont(l).catch(()=>{ri().error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const s=this._getEffectsRepeat(t.effects);if(s)return s;if(t.symbolLayers){for(const i of t.symbolLayers)if(i){const n=this._getEffectsRepeat(i.effects);if(n)return n;switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const r=this._getPlacementRepeat(i.markerPlacement);if(r)return r}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const s of t)if(s)switch(s.type){case"CIMGeometricEffectDashes":{const i=s.dashTemplate;if(i&&i.length){let n=0;for(const r of i)n+=r;return 1&i.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return s.period;default:ri().error(`unsupported geometric effect type ${s.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const s=t.placementTemplate;if(s&&s.length){let i=0;for(const n of s)i+=+n;return 1&s.length&&(i*=2),i}break}}return 0}static fromCIMInsidePolygon(t){const s=t.markerPlacement,i={...t};i.markerPlacement=null,i.anchorPoint=null;const n=Math.abs(s.stepX),r=Math.abs(s.stepY),o=(s.randomness??100)/100;let a,h,l,c;if(s.gridType==="Random"){const u=bt(Pa),p=Math.max(Math.floor(u/n),1),d=Math.max(Math.floor(u/r),1);a=p*n/2,h=d*r/2,l=2*h;const f=new un(s.seed),m=o*n/1.5,_=o*r/1.5;c=[];for(let y=0;y({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[i]}})),size:l}}};function so(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const s=e.symbolLayers;if(!s)return;for(const i of s)if(t(i),i.type==="CIMVectorMarker"){const n=i.markerGraphics;if(!n)continue;for(const r of n)if(r){const o=r.symbol;o&&so(o,t)}}break}}}const io=e=>{if(!e)return lt.Butt;switch(e){case"butt":return lt.Butt;case"square":return lt.Square;case"round":return lt.Round}},ro=e=>{if(!e)return kt.Miter;switch(e){case"miter":return kt.Miter;case"round":return kt.Round;case"bevel":return kt.Bevel}},Jh=e=>{if(e==null)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Zh=e=>{if(e==null)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Q=e=>{if(!e)return[0,0,0,0];const{r:t,g:s,b:i,a:n}=e;return[t,s,i,255*n]},Qh=(e,t)=>{const s=tl(t),i=el(e);return s&&i?`${s}-${i}`:`${s}${i}`},tl=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},el=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Fi=(e,t)=>{const s=li("safari")?.001:0,i=t==="butt";switch(e){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,s,4];case"dot":case"esriSLSDot":return i?[1,3]:[s,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,s,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,s,4,s,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,s,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,s,2,s,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[s,2];case"solid":case"esriSLSSolid":case"none":return ri().error("Unexpected: style does not require rasterization"),[0,0];default:return ri().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function sl(e){return e.symbolLayers!==void 0}const ze=(e,t=100)=>{const s=t/2;let i,n;const r=e;if(r==="circle"||r==="esriSMSCircle"){let o=Math.acos(1-.25/s),a=Math.ceil(eo/o/4);a===0&&(a=1),o=Wh/a,a*=4;const h=[];h.push([s,0]);for(let l=1;le==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function rl(e,t,s){if(!(!e.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void s.push(t.geometryEnginePromise);_a(e.effects)&&(t.geometryEnginePromise=ga(),s.push(t.geometryEnginePromise),t.geometryEnginePromise.then(i=>t.geometryEngine=i))}}function Jr(e){if(!e)return null;let t=null;const{cap:s,color:i,join:n,miterLimit:r,style:o,width:a}=e;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(o,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:r,width:a,effects:t}}var Zr;(function(e){e[e.Geographic=0]="Geographic",e[e.Arithmatic=1]="Arithmatic"})(Zr||(Zr={}));const su=3.14159265359/180,nl=3.14159265359/128,iu=1,ol=1.1,al=1,ru=24,nu=8,hl=1e-5,Qr=.05,ll=1e-30,cl=4,ul=0,pl=2,ou=2,au=3,hu=0,lu=3,dl=16777216,cu=1.1,fl=()=>ge.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let no=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},ml=class extends no{constructor(){super(...arguments),this.vertex=new tn,this.fragment=new tn,this.attributes=new yl,this.varyings=new xl,this.extensions=new Ni,this.constants=new oo}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!0){const s=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),r=e==="vertex"?this.vertex:this.fragment,o=r.uniforms.generateSource(),a=r.code.generateSource(),h=e==="vertex"?Pl:bl(),l=this.constants.generateSource().concat(r.constants.generateSource());return`${t?"#version 300 es":""} -${s.join(` -`)} -${h} -${l.join(` -`)} -${o.join(` -`)} -${i.join(` -`)} -${n.join(` -`)} -${a.join(` -`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Pass];r&&t.set(n.name,r)}),this.fragment.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Pass];r&&t.set(n.name,r)});const s=Array.from(t.values()),i=s.length;return(n,r)=>{for(let o=0;o{const r=n.bind[Ms.Draw];r&&t.set(n.name,r)}),this.fragment.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Draw];r&&t.set(n.name,r)});const s=Array.from(t.values()),i=s.length;return(n,r,o)=>{for(let a=0;ae.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},gl=class{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}},tn=class extends no{constructor(){super(...arguments),this.uniforms=new _l,this.code=new gl,this.constants=new oo}get builder(){return this}},yl=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},xl=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&Ia(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((s,i)=>t.push(e==="vertex"?`out ${s} ${i};`:`in ${s} ${i};`)),t}},Ni=class $i{constructor(){this._entries=new Set}add(t){this._entries.add(t)}generateSource(t){const s=t==="vertex"?$i.ALLOWLIST_VERTEX:$i.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>s.includes(i)).map(i=>`#extension ${i} : enable`)}};Ni.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],Ni.ALLOWLIST_VERTEX=[];let oo=class E{constructor(){this._entries=new Set}add(t,s,i){let n="ERROR_CONSTRUCTOR_STRING";switch(s){case"float":n=E._numberToFloatStr(i);break;case"int":n=E._numberToIntStr(i);break;case"bool":n=i.toString();break;case"vec2":n=`vec2(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])})`;break;case"vec3":n=`vec3(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])}, ${E._numberToFloatStr(i[2])})`;break;case"vec4":n=`vec4(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])}, ${E._numberToFloatStr(i[2])}, ${E._numberToFloatStr(i[3])})`;break;case"ivec2":n=`ivec2(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])})`;break;case"ivec3":n=`ivec3(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])}, ${E._numberToIntStr(i[2])})`;break;case"ivec4":n=`ivec4(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])}, ${E._numberToIntStr(i[2])}, ${E._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${s}(${Array.prototype.map.call(i,r=>E._numberToFloatStr(r)).join(", ")})`}return this._entries.add(`const ${s} ${t} = ${n};`),this}static _numberToIntStr(t){return t.toFixed(0)}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}};function bl(){return`#ifdef GL_FRAGMENT_PRECISION_HIGH - precision highp float; - precision highp sampler2D; -#else - precision mediump float; - precision mediump sampler2D; -#endif -`}const Pl=`precision highp float; -precision highp sampler2D;`;function wl(e){return e.split(" ").map((t,s)=>s>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("")}function vl(e,t){const s=[];for(s.push(t);s.length;){const i=s.pop();if(typeof i=="object"&&!e.has(i.uid)){e.add(i.uid);for(const n of i.children)s.push(n)}}}let ee=class Ri{constructor(){this.uid=Ri.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(t){return t=wl(t),this._debugName=t,this.isImplicit&&this.children[0]instanceof Ri&&this.children[0].setDebugName(t),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}};function v(e){return typeof e=="object"?e.clone():e}ee.NodeCount=0;let D=class extends ee{constructor(){super(...arguments),this.shaderType="primitive-node"}},Sl=class ao extends ee{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new ao(v(this.child));return this.cloneInto(t),t}},Ml=class ho extends ee{constructor(t,s,i){super(),this.property=t,this.target=s,this.returnType=i,this.shaderType="property-access-node"}get children(){const t=[this.target];return typeof this.property!="string"&&t.push(this.property),t}clone(){const t=new ho(this.property,v(this.target),this.returnType);return this.cloneInto(t),t}},Cl=class lo extends ee{constructor(t,s,i){super(),this.condition=t,this.ifTrue=s,this.ifFalse=i,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const t=v(this.ifTrue),s=this.ifFalse?v(this.ifFalse):null,i=new lo(this.condition,t,s);return this.cloneInto(i),i}},Il=class co extends ee{constructor(t,s,i,n){super(),this.captureList=t,this.returnType=s,this.generator=n,this.shaderType="block-node",i&&(this.subgraph=new Sl(i))}get children(){return Object.keys(this.captureList).map(t=>this.captureList[t]).concat(this.subgraph??[])}clone(){const t={};for(const i in this.captureList)t[i]=v(this.captureList[i]);const s=new co(t,this.returnType,this.subgraph?v(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(s),s}},jt=class uo extends ee{constructor(t,s,i,n,r,o=!1){super(),this.token=t,this._children=s,this.isInfix=i,this.isPropertyAccess=n,this.returnType=r,this.isTernary=o,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new uo(this.token,this._children.map(v),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}};var ss,Di,Gi,Vi,Hi,Bi,Xi,Ui,Yi,Wi,qi,Ki,ji,Ji;function kl(e){const t=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const s of t)if(s.includes(e))return s.map(i=>Al[i]);throw new Error("Unable to find type family")}function po(e){return new Proxy(e,{get(t,s){if(s==="constructor")return new Proxy(t.constructor,{construct:(i,n,r)=>po(new i(...n))});if(s in t)return t[s];if(typeof s=="string"){const i=kl(e.type);return tt(e,s,i[s.length-1])}}})}function st(e){return new Proxy(e,{construct:(t,s,i)=>po(new t(...s))})}function Tl(e){return new Proxy(e,{get(t,s){if(s in t)return t[s];if(typeof s=="string"){const i=parseInt(s,10);if(!isNaN(i))return tt(e,`[${i}]`,e.elementType.constructor)}}})}function zl(e){return new Proxy(e,{construct:(t,s,i)=>Tl(new t(...s))})}let Zi=class extends Error{},ct=ss=class extends D{constructor(e,t){super(),this.elementType=e,this.size=t,this.children=[],this.type="array"}clone(){const e=new ss(this.elementType,this.size);return super.cloneInto(e),e}get(e){if(typeof e=="number"){const t=new Gt(e);return t.isImplicit=!0,tt(this,t,this.elementType.constructor)}return tt(this,e,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(e,t,s){return Fl(this,e,t,s)}glslFindIndex(e,t,s){return Nl(this,e,t,s)}static ofType(e,t){const s={construct:(i,n)=>new ss(new e,t)};return new Proxy(ss,s)}};ct.type="array",ct=ss=g([zl],ct);let mt=class fo extends D{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}clone(){const t=new fo;return t.children=this.children.map(v),super.cloneInto(t),t}};mt.type="sampler2D";let x=class he extends D{constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new he(v(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ot(this,typeof t=="number"?G(t,he):t)}divide(t){return _s(this,typeof t=="number"?G(t,he):t)}add(t){return xe(this,typeof t=="number"?G(t,he):t)}subtract(t){return gs(this,typeof t=="number"?G(t,he):t)}};x.type="float";let T=Di=class extends D{constructor(e,t){super(),this.type="vec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Di(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){throw new Zi}get 3(){throw new Zi}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};T.type="vec2",T=Di=g([st],T);let H=Gi=class extends D{constructor(e,t,s){super(),this.type="vec3",this.children=[e,t,s].filter(i=>i!=null)}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){return tt(this,"[2]",x)}get 3(){throw new Zi}clone(){const e=new Gi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};H.type="vec3",H=Gi=g([st],H);let A=Vi=class extends D{constructor(e,t,s,i){super(),this.type="vec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Vi(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){return tt(this,"[2]",x)}get 3(){return tt(this,"[3]",x)}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};A.type="vec4",A=Vi=g([st],A);let Xs=Hi=class extends D{constructor(e){super(),this.type="uint",this.children=[e]}clone(){const e=new Hi(v(this.children[0]));return super.cloneInto(e),e}};Xs.type="uint",Xs=Hi=g([st],Xs);let Us=Bi=class extends D{constructor(e,t){super(),this.type="uvec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Bi(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};Us.type="uvec2",Us=Bi=g([st],Us);let Ys=Xi=class extends D{constructor(e,t,s){super(),this.type="uvec3",this.children=[e,t,s].filter(i=>i!=null)}clone(){const e=new Xi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};Ys.type="uvec3",Ys=Xi=g([st],Ys);let Ws=Ui=class extends D{constructor(e,t,s,i){super(),this.type="uvec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Ui(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};Ws.type="uvec4",Ws=Ui=g([st],Ws);class j extends D{constructor(t){super(),this.type="bool",this.children=[t]}and(t){return tr(this,t)}or(t){return go(this,t)}clone(){const t=new j(v(this.children[0]));return super.cloneInto(t),t}}j.type="bool";let qs=Yi=class extends D{constructor(e,t){super(),this.type="bvec2",this.children=[e,t].filter(s=>s!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new Yi(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};qs.type="bvec2",qs=Yi=g([st],qs);let Ks=Wi=class extends D{constructor(e,t,s){super(),this.type="bvec3",this.children=[e,t,s].filter(i=>i!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new Wi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};function G(e,t){return typeof e=="number"?new t(e):e}Ks.type="bvec3",Ks=Wi=g([st],Ks);let js=qi=class extends D{constructor(e,t,s,i){super(),this.type="bvec4",this.children=[e,t,s,i].filter(n=>n!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new qi(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};js.type="bvec4",js=qi=g([st],js);let Gt=class le extends D{constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Ot(this,G(t,le))}add(t){return xe(this,G(t,le))}subtract(t){return gs(this,G(t,le))}divide(t){return _s(this,G(t,le))}clone(){const t=new le(v(this.children[0]));return super.cloneInto(t),t}};Gt.type="int";let Js=Ki=class extends D{constructor(e,t){super(),this.type="ivec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Ki(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};Js.type="ivec2",Js=Ki=g([st],Js);let Zs=ji=class extends D{constructor(e,t,s){super(),this.type="ivec3",this.children=[e,t,s].filter(i=>i!=null)}clone(){const e=new ji(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};Zs.type="ivec3",Zs=ji=g([st],Zs);let Qs=Ji=class extends D{constructor(e,t,s,i){super(),this.type="ivec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Ji(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};Qs.type="ivec4",Qs=Ji=g([st],Qs);let Ll=class mo extends D{constructor(t,s,i,n){super(),this.type="mat2",this.children=[t,s,i,n]}clone(){const t=new mo(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(t),t}multiply(t){return Ot(this,t)}};Ll.type="mat2";let xt=class ti extends D{static identity(){return new ti(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const s=Pr(t),i=yo(t);return new ti(i,s,0,ni(s),i,0,0,0,1)}constructor(t,s,i,n,r,o,a,h,l){super(),this.type="mat3",this.children=[t,s,i,n,r,o,a,h,l]}add(t){return xe(this,t)}multiply(t){return Ot(this,t)}clone(){const t=new ti(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]),v(this.children[4]),v(this.children[5]),v(this.children[6]),v(this.children[7]),v(this.children[8]));return super.cloneInto(t),t}};xt.type="mat3";class ns extends D{static identity(){return new ns(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,s,i,n,r,o,a,h,l,c,u,p,d,f,m,_){super(),this.type="mat4",this.children=[t,s,i,n,r,o,a,h,l,c,u,p,d,f,m,_]}static fromColumns(t,s,i,n){return new ns(t.x,t.y,t.z,t.w,s.x,s.y,s.z,s.w,i.x,i.y,i.z,i.w,n.x,n.y,n.z,n.w)}multiply(t){return Ot(this,t)}clone(){const t=new ns(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]),v(this.children[4]),v(this.children[5]),v(this.children[6]),v(this.children[7]),v(this.children[8]),v(this.children[9]),v(this.children[10]),v(this.children[11]),v(this.children[12]),v(this.children[13]),v(this.children[14]),v(this.children[15]));return super.cloneInto(t),t}}ns.type="mat4";const Al={float:x,vec2:T,vec3:H,vec4:A,int:Gt,ivec2:Js,ivec3:Zs,ivec4:Qs,uint:Xs,uvec2:Us,uvec3:Ys,uvec4:Ws,bool:j,bvec2:qs,bvec3:Ks,bvec4:js},ne=(...e)=>new Gt(...e),F=(...e)=>new x(...e),Qi=(...e)=>new T(...e),Ol=(...e)=>new H(...e),El=(...e)=>new A(...e),en=(...e)=>new xt(...e);function tt(e,t,s){const i=new s(new Ml(t,e,s));return i.isImplicit=!0,i}function J(e,t,s,i=null){if(i){const r=new i,o=new i(new jt(e,[t,s],!0,!1,r));return o.isImplicit=!0,o}if(t.type==="float"||t.type==="int"){const r=new s.constructor(new jt(e,[t,s],!0,!1,s.constructor));return r.isImplicit=!0,r}if((t.type==="mat2"||t.type==="mat3"||t.type==="mat4")&&s.type!=="float"){const r=new s.constructor(new jt(e,[t,s],!0,!1,s.constructor));return r.isImplicit=!0,r}const n=new t.constructor(new jt(e,[t,s],!0,!1,t.constructor));return n.isImplicit=!0,n}function q(e,t,s=t.constructor){const i=new s(new jt(e,[t],!1,!1,s));return i.isImplicit=!0,i}function At(e,t,s,i=t.constructor){const n=new i(new jt(e,[t,s],!1,!1,i));return n.isImplicit=!0,n}function mr(e,t,s,i,n=t.constructor){const r=new n(new jt(e,[t,s,i],!1,!1,n));return r.isImplicit=!0,r}function ni(e){return Ot(e,F(-1))}function _o(e,t,s,i){return new t(new Il(e,t,s,i))}function Fl(e,t,s=0,i=e.size){const n=new Gt(s).setMutable().setDebugName("FindIndexIterator"),r=t(e.get(n)).setDebugName("FindIndexPredicate");return _o({iter:n},Gt,r,({out:o,iter:a,subgraph:h})=>` -${o} = -1; - -for (; ${a} < ${i}; ${a}++) { - -${h.body} - - if (${h.varName}) { - ${o} = ${a}; - break; - } - -} -`).setDebugName("FindIndexBlock")}function Nl(e,t,s=0,i=e.size){return _o({array:e},Gt,null,({out:n,array:r})=>` -${n} = -1; -for (int i = ${s}; i < ${i}; i++) { - bool condition; - ${t({array:r,i:"i",out:"condition"})} - if (condition) { - ${n} = i; - break; - } -} -`).setDebugName("GlslFindIndexBlock")}function B(e,t,s){const i=typeof t=="function"?t():t,n=typeof s=="function"?s():s,r=new i.constructor(new Cl(e,i,n));return r.isImplicit=!0,r}function ms(...e){const t=e.map(([a,h])=>typeof h=="function"?[a,h()]:[a,h]),s=t[0][1].constructor,i=t.findIndex(a=>a[0]===!0);if(i===-1)throw new Error("A cond must have a fallthrough case with `true`/; ");const n=t.slice(0,i),r=t[i][1],o=new s(n.reduceRight((a,h)=>B(h[0],h[1],a),r));return o.isImplicit=!0,o}function Ot(e,t){return J("*",e,t)}function _s(e,t){return J("/",e,t)}function xe(e,t){return J("+",e,t)}function gs(e,t){return J("-",e,t)}function uu(e,t){return J("%",e,t)}function pu(e,t){return J(">>",e,t)}function du(e,t){return J("&",e,t)}function _r(e,t){return J("==",e,t,j)}function $l(e,t){return J("<",e,t,j)}function mi(e,t){return J("<=",e,t,j)}function et(e,t){return J(">",e,t,j)}function _i(e,t){return J(">=",e,t,j)}function go(...e){return e.length<=1?e[0]:e.slice(1).reduce((t,s)=>Rl(t,s),e[0])}function Rl(e,t){return J("||",e,t,j)}function tr(...e){return e.length<=1?e[0]:e.slice(1).reduce((t,s)=>Dl(t,s),e[0])}function Dl(e,t){return J("&&",e,t,j)}function Gl(e){return q("abs",e)}function gr(e){return q("all",e,j)}function yr(e){return q("any",e,j)}function fu(e,t){return t==null?q("atan",e):At("atan",e,t,e.constructor)}function Vl(e){return q("ceil",e)}function xr(e,t,s){return mr("clamp",e,t,s,e.constructor)}function yo(e){return q("cos",e)}function xo(e,t){return At("distance",e,t,x)}function br(e,t){return At("dot",e,t,x)}function Hl(e){return q("floor",e)}function bo(e){return q("fract",e)}function Po(e){return q("length",e,x)}function de(e,t){return At("max",e,t)}function er(e,t){return At("min",e,t)}function be(e,t,s){return mr("mix",e,t,s)}function Pe(e,t){return At("mod",e,t)}function Bl(e){return q("normalize",e)}function Xl(e){return e.type==="bool"?q("!",e):q("not",e)}function mu(e,t){return At("pow",e,t)}function _u(e){return q("round",e)}function Pr(e){return q("sin",e)}function gu(e,t,s){return mr("smoothstep",e,t,s)}function yu(e){return q("sqrt",e)}function Dt(e,t){return At("step",e,t,t.constructor)}function _t(e,t){return At("texture",e,t,A)}const Le=5;function X(e,t,s){const i=t.split(` -`);for(const n of i)if(n.trim().length){{let r="";s!=null&&(r+=`/*id:${s??"000"}*/ `),e.body+=r.padEnd(14)}e.body+=" ".repeat(e.indent)+n+` -`}}let sn=class{write(e){for(const t of e.rootOutputNodes())e.shouldPruneOutputNode(t)||(t.variableName=this._write(e,t.node));return e}_createVarName(e,t){let s="";return typeof t!="boolean"&&typeof t!="number"&&t.debugInfo.name&&(s=`${t.debugInfo.name}_`),`${s}v${e.varCount++}`}_write(e,t,s=!1){if(typeof t=="number"||typeof t=="boolean")return t.toString();let i=e.getEmit(t);if(i)return i;switch(t.shaderType){case"scope-node":i=this._writeScopeNode(e,t);break;case"primitive-node":i=this._writePrimitiveNode(e,t,s);break;case"function-node":i=this._writeFunctionNode(e,t);break;case"property-access-node":i=this._writePropertyAccessNode(e,t);break;case"text-node":i=t.text;break;case"block-node":i=this._writeBlockNode(e,t);break;case"condition-node":i=this._writeConditionNode(e,t)}return e.setEmit(t,i),i}_writeScopeNode(e,t){const s=new t.child.constructor;s.setDebugName(t.debugInfo.name);const i=this._write(e,s,!0);return X(e,`{ /*ScopeStart: ${t.uid} ${t.debugInfo.name}*/`),e.indent+=2,X(e,`${i} = ${this._write(e,t.child)};`),e.indent-=2,X(e,`} /*ScopeEnd: ${t.uid} ${t.debugInfo.name}*/`),i}_writeConditionNode(e,t){const s=new t.ifTrue.constructor,i=this._write(e,s,!0);X(e,`if (${this._write(e,t.condition)}) {`),e.indent+=2;const n=e.createSubgraphContext(),r=this._write(n,t.ifTrue);if(e.body+=n.body,r&&X(e,`${i} = ${r};`),e.indent-=2,X(e,"}"),t.ifFalse){X(e,"else {"),e.indent+=2;const o=e.createSubgraphContext(),a=this._write(o,t.ifFalse);e.body+=o.body,a&&X(e,`${i} = ${a};`),e.indent-=2,X(e,"}")}return i}_writeBlockNode(e,t){const{captureList:s,generator:i,returnType:n}=t,r={};for(const l in s){if(!s[l])continue;const c=this._write(e,s[l]);r[l]=c}const o=new n,a=this._write(e,o,!0);if(r.out=a,t.subgraph){const l=e.createSubgraphContext(),c=this._write(l,t.subgraph.child),u=l.body;r.subgraph={varName:c,body:u}}const h=i(r);return X(e,`{ -`),e.indent+=2,X(e,h),e.indent-=2,X(e,`} -`),a}_writePropertyAccessNode(e,t){const s=this._write(e,t.target);return typeof t.property=="string"&&t.property.includes("[")?`${s}${t.property}`:typeof t.property!="string"?`${s}[${this._write(e,t.property)}]`:`${s}.${t.property}`}_writeFunctionNode(e,t){const s=t.returnType.type;if(t.isInfix){const[r,o]=t.children.map(h=>this._write(e,h)),a=this._createVarName(e,t);return X(e,`${s.padEnd(Le)} ${a} = ${r} ${t.token} ${o};`,t.uid),a}const i=t.children.map(r=>this._write(e,r)).join(", "),n=this._createVarName(e,t);return X(e,`${s.padEnd(Le)} ${n} = ${t.token}(${i});`,t.uid),n}_writePrimitiveNode(e,t,s=!1){const i=e.getInput(t);if(i)return i.isUsed=!0,i.variableName;const n=t.children.length===1&&t.children[0]?.type===t.type;if(t.isImplicit||n)return this._write(e,t.children[0]);const r=this._createVarName(e,t);if(s)return X(e,`${t.type.padEnd(Le)} ${r};`,t.uid),r;const o=!t.debugInfo.name&&!t.isMutable;if(o&&t.type==="float"&&typeof t.children[0]=="number")return Number.isInteger(t.children[0])?t.children[0].toFixed(1):t.children[0].toString();if(o&&t.type==="int"&&typeof t.children[0]=="number"&&Number.isInteger(t.children[0]))return t.children[0].toString();const a=t.children.map(h=>this._write(e,h)).join(", ");return t.type==="array"?(X(e,`${t.type.padEnd(Le)} ${r} = [${a}];`,t.uid),r):o?`${t.type}(${a})`:(X(e,`${t.type.padEnd(Le)} ${r} = ${t.type}(${a});`,t.uid),r)}},oe=class wo{constructor(t,s,i){this.variableName=t,this.variableInputType=s,this.node=i,this.type="shader-input",this.isUsed=!1}clone(){return new wo(this.variableName,this.variableInputType,v(this.node))}},ae=class vo{constructor(t,s,i){this.outVariableName=t,this.outVariableType=s,this.node=i,this.type="shader-output"}clone(){const t=new vo(this.outVariableName,this.outVariableType,v(this.node));return t.variableName=this.variableName,t}},rn=class ei{static createVertex(t,s,i,n,r,o){const a=[];for(const l in t){const c=t[l],u=i.get(l);u?a.push(new oe(u,"builtin",c)):a.push(new oe("a_"+l,"in",c))}for(const l of n){const c=l.uniformHydrated;a.push(new oe(l.uniformName,"uniform",c))}const h=[];for(const l in s){const c=s[l];l==="glPosition"?h.push(new ae("gl_Position","builtin",c)):l==="glPointSize"?h.push(new ae("gl_PointSize","builtin",c)):h.push(new ae("v_"+l,"out",c))}return new ei(a,h,r,o)}static createFragment(t,s,i,n,r,o){const a=[],h=Array.from(r.rootOutputNodes());for(const c in t){const u=t[c],p=i.get(c);if(p){a.push(new oe(p,"builtin",u));continue}const d=h.find(f=>f.node===u);d&&a.push(new oe(d.outVariableName,"in",u))}for(const c of n){const u=c.uniformHydrated;a.push(new oe(c.uniformName,"uniform",u))}const l=[];for(const c in s){const u=s[c],p=i.get(c);c==="discard"?l.push(new ae(null,"discard",u)):p?l.push(new ae(p,"builtin",u)):l.push(new ae(c,"out",u))}return new ei(a,l,o)}constructor(t,s,i,n){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of t)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=s,this._transformFeedbackBindings=i,this._transformFeedbackNames=new Set(i.map(r=>"v_"+r.propertyKey)),this._usedInFragmentShader=n}shouldPruneOutputNode(t){return!!this._usedInFragmentShader&&t.outVariableType!=="builtin"&&!this._transformFeedbackNames.has(t.outVariableName)&&!this._usedInFragmentShader.has(t.node.uid)}setEmit(t,s){this._nodeEmitMap.set(t.uid,s)}getEmit(t){return this._nodeEmitMap.get(t.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(t){return this._inputShaderTypesByNodeUid.get(t.uid)}*rootOutputNodes(){for(const t of this._outputShaderTypes)yield t}*nodes(){const t=[];for(const s of this._outputShaderTypes.values())t.push(s.node);for(;t.length;){const s=t.pop();typeof s!="number"&&typeof s!="boolean"&&t.push(...s.children.filter(Boolean)),yield s}}*nodesOfTypeOrFunction(){for(const t of this.nodes())typeof t!="number"&&typeof t!="boolean"&&(yield t)}createSubgraphContext(){const t=this.clone();return t.body="",t.indent=this.indent+2,t._nodeEmitMap=new Map(this._nodeEmitMap),t}clone(){const t=new ei([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return t._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,t.indent=this.indent,t.body=this.body,t.varCount=this.varCount,t._nodeEmitMap=this._nodeEmitMap,t}insertVertexShader(t){t.vertex.code.add(""),this._insertInputs(t,"vertex"),t.vertex.code.add(""),t.vertex.code.add("// OUTPUTS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const s of this.rootOutputNodes()){const i=s.outVariableType==="builtin";this.shouldPruneOutputNode(s)||(i?t.vertex.code.add(`// ${s.outVariableType.padEnd(7)} ${s.node.type.padEnd(9)} ${s.outVariableName};`):t.vertex.code.add(`${s.outVariableType.padEnd(10)} ${s.node.type.padEnd(9)} ${s.outVariableName};`))}t.vertex.code.add(""),t.vertex.code.add("void main() {"),t.vertex.code.add(" "+this.body.split(` -`).join(` - `));for(const s of this.rootOutputNodes())this.shouldPruneOutputNode(s)||t.vertex.code.add(` ${s.outVariableName} = ${s.variableName};`);t.vertex.code.add("}")}insertFragmentShader(t){this._insertInputs(t,"fragment"),t.fragment.code.add(""),t.fragment.code.add("// OUTPUTS: "),t.fragment.code.add("// --------------------------------------------------------- ");for(const s of this.rootOutputNodes())s.outVariableType==="builtin"?t.fragment.code.add(`// ${s.outVariableType.padEnd(7)} ${s.node.type.padEnd(9)} ${s.outVariableName};`):t.fragment.code.add(`${s.outVariableType.padEnd(10)} ${s.node.type.padEnd(9)} ${s.outVariableName};`);t.fragment.code.add(""),t.fragment.code.add("void main() {"),t.fragment.code.add(" "+this.body.split(` -`).join(` - `));for(const s of this.rootOutputNodes())s.outVariableType==="discard"?(t.fragment.code.add(" // TODO: Should ensure codegen for discard appears first in fragment shader"),t.fragment.code.add(` if (${s.variableName}) {`),t.fragment.code.add(" discard;"),t.fragment.code.add(" }"),t.fragment.code.add(" ")):t.fragment.code.add(` ${s.outVariableName} = ${s.variableName};`);t.fragment.code.add("}")}_insertInputs(t,s){t[s].code.add("// INPUTS: "),t[s].code.add("// --------------------------------------------------------- ");for(const i of this.inputs())i.isUsed&&i.variableInputType!=="builtin"&&(i.node.type==="array"?t[s].code.add(`${i.variableInputType.padEnd(10)} ${i.node.elementType.type.padEnd(9)} ${i.variableName}[${i.node.size}];`):t[s].code.add(`${i.variableInputType.padEnd(10)} ${i.node.type.padEnd(9)} ${i.variableName};`))}};const Ul=()=>ge.getLogger("esri.views.2d.engine.webgl.shaderGraph.typed.TypedShaderProgram");function Ae(e,t,s){const i=t.length;if(i!==s){const n=new pn("Invalid Uniform",`Invalid length, expected ${s} but got ${i}`,{uniformName:e,values:t});Ul().errorOnce(n)}}let nn=class{constructor(e,t,s,i,n,r){this._program=null,this._vao=null,this._temporaryTextures=[],this.vertexShader=e,this.fragmentShader=t,this._locations=s,this._locationInfo=i,this._uniformBindings=n,this._transformFeedbackBindings=r}destroy(){this._program&&this._program.dispose(),this.cleanupTemporaryTextures()}get locations(){return this._locations}get locationInfo(){return this._locationInfo}setUniforms(e){this._uniforms=e}cleanupTemporaryTextures(){for(const e of this._temporaryTextures)e.dispose();this._temporaryTextures=[]}bind(e){const t=this._uniforms;if(!this._program){const i=new Map;for(const[r,o]of this._locations)i.set(r,o);const n=[];for(const r of this._transformFeedbackBindings??[]){const{index:o,propertyKey:a}=r;n[o]=`v_${a}`}this._program=new ka(e,this.vertexShader,this.fragmentShader,i,new Map,n)}const s=this._program;e.useProgram(s);for(const i of this._uniformBindings){const{shaderModulePath:n,uniformName:r,uniformType:o,uniformArrayLength:a}=i,h=Wo(n,t);if(h==null){if(o==="sampler2D")continue;throw new Error(`Failed to find uniform value for ${n}`)}switch(o==="array"?i.uniformArrayElementType:o){case"sampler2D":{const{unit:l,texture:c}=h;if(s.setUniform1i(r,l),"type"in c)e.bindTexture(c,l);else{const u=Ca(e,c.descriptor,c.data);e.bindTexture(u,l)}break}case"int":if(!a){s.setUniform1i(r,h);break}Ae(i.uniformName,h,a),s.setUniform1iv(r,h);break;case"float":if(!a){s.setUniform1f(r,h);break}Ae(i.uniformName,h,a),s.setUniform1fv(r,h);break;case"vec2":if(!a){s.setUniform2f(r,h[0],h[1]);break}Ae(i.uniformName,h,a),s.setUniform2fv(r,h.flat());break;case"vec3":if(!a){s.setUniform3f(r,h[0],h[1],h[2]);break}Ae(i.uniformName,h,a),s.setUniform3fv(r,h.flat());break;case"vec4":if(!a){s.setUniform4f(r,h[0],h[1],h[2],h[3]);break}Ae(i.uniformName,h,a),s.setUniform4fv(r,h.flat());break;case"mat3":s.setUniformMatrix3fv(r,h);break;case"mat4":s.setUniformMatrix4fv(r,h);break;default:throw new Error(`Unable to set uniform for type ${o}`)}}}};function Oe(e){return new e}function ys(e,t,s){const i=e.constructor[t]??[];e.constructor.hasOwnProperty(t)||Object.defineProperty(e.constructor,t,{value:i.slice()}),e.constructor[t].push(s)}function k(e,t){return(s,i)=>{ys(s,"locations",{typeCtor:t,propertyKey:i,parameterIndex:null,index:e})}}const R=e=>(t,s,i)=>{ys(t,"inputs",{inputCtor:e,propertyKey:s,parameterIndex:i})},M=e=>(t,s)=>{ys(t,"uniforms",{typeCtor:e,propertyKey:s})},Y=e=>(t,s)=>{ys(t,"options",{typeCtor:e,propertyKey:s})},on=(e,t)=>{ys(e,"defines",{propertyKey:t})},sr=(e,t)=>(s,i)=>{s.constructor.builtins.push({builtin:e,propertyKey:i,typeCtor:t})};class ir{}ir.builtins=[],g([sr("gl_VertexID",Gt)],ir.prototype,"glVertexID",void 0);let Yl=class{},os=class{};os.builtins=[],g([sr("gl_FragCoord",A)],os.prototype,"glFragCoord",void 0),g([sr("gl_PointCoord",T)],os.prototype,"glPointCoord",void 0);let Wl=class{},it=class{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}},ql=class{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const e=this._shaderModuleClass.inputs.findLast(t=>t.propertyKey==="vertex"&&t.parameterIndex===0);if(!e)throw new Error("Unable to find vertex input parameter");return e}get computeInput(){return this._shaderModuleClass.inputs.findLast(e=>e.propertyKey==="vertex"&&e.parameterIndex===1)}get fragmentInput(){const e=this._shaderModuleClass.inputs.findLast(t=>t.propertyKey==="fragment");if(!e)throw new Error("Unable to find fragment input parameter");return e}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const e=new Map,t=new Set;for(const s of this.locations)t.has(s.index)?ge.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${s.propertyKey} to ${s.index}. Index already in use`,{locationsMap:e}):(e.set(s.propertyKey,s.index),t.add(s.index));return e}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([n,r])=>`${n}.${r}`).join("."),s=Bo(t),i=this.computeAttributes;this._locationInfo={hash:s,locations:e,computeAttributeMap:i}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const t of this.locations)e.set("a_"+t.propertyKey,t.index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set;for(const t of this._options)e.add(t.propertyKey);this._optionPropertyKeys=e}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(e,t,s,i){try{const{vertex:n,fragment:r,uniformBindings:o}=this._generateShaders(e,t,s,i);return new nn(n,r,this.renamedLocationsMap,this.locationInfo,o,this.transformFeedbackBindings)}catch{return new nn("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(e){const t=this._options.find(i=>i.propertyKey===e);if(t)return{type:"option",className:t.typeCtor};const s=this._uniforms.find(i=>i.propertyKey===e);if(!s)throw new Error(`Unable to find uniform class type for property: ${e}`);return{type:"required",className:s.typeCtor}}getShaderKey(e,t,s,i){const n=Object.keys(e).map(h=>`${h}.${e[h]}`).join("."),r=Object.keys(s).map(h=>`${h}.${s[h]}`).join("."),o=Object.keys(i).map(h=>`${h}.${i[h]}`).join("."),a=Object.keys(t).filter(h=>this.optionPropertyKeys.has(h)&&t[h]).join(".");return`${this.constructor.name}.${n}.${r}.${o}.${a}`}_generateShaders(e,t,s,i){const n=[];this._setDefines(s),this._setOptionalUniforms(n,t),this._setRequiredUniforms(n);const r=this._hydrateVertexInput(i),o=this._injectPackPrecisionFactor(r,e),a=this._hydrateComputeInput(),h=a&&this._injectComputePackPrecisionFactor(a,e),l=this.vertex(o,h),c=this._hydrateFragmentInput(l),u=this.fragment(c),p=new Set;for(const w in u){const S=u[w];vl(p,S)}const d=this._getVertexInputBuiltins(),f=rn.createVertex({...r,...a},l,d,n,this.transformFeedbackBindings,p);new sn().write(f);const m=this._getFragmentInputBuiltins(u);m.set("glPointCoord","gl_PointCoord");const _=rn.createFragment(c,u,m,n,f,this.transformFeedbackBindings);new sn().write(_);const y=this._createShaderBuilder(f,_),b=y.generate("vertex",!0),P=y.generate("fragment",!0);return this.logShader&&(console.log(b),console.log(P)),{vertex:b,fragment:P,uniformBindings:n}}_setDefines(e){for(const t in e)this[t]=e[t]}_setOptionalUniforms(e,t){for(const s of this._options)t[s.propertyKey]?this[s.propertyKey]=this._hydrateUniformGroup(e,s):this[s.propertyKey]=null}_setRequiredUniforms(e){for(const t of this._uniforms)this[t.propertyKey]=this._hydrateUniformGroup(e,t)}_hydrateUniformGroup(e,t){const s=new t.typeCtor;for(const i of s._uniforms??[]){const n=Oe(i.typeCtor),r=`u_${t.propertyKey}_${i.propertyKey}`,o=n.type,a=[t.propertyKey,i.propertyKey].join(".");if("type"in i.typeCtor&&i.typeCtor.type==="array"){const h=n;e.push({shaderModulePath:a,uniformName:r,uniformType:o,uniformArrayLength:h.size,uniformArrayElementType:h.elementType.type,uniformHydrated:n})}else e.push({shaderModulePath:a,uniformName:r,uniformType:o,uniformHydrated:n});s[i.propertyKey]=n}return s}_hydrateVertexInput(e){const t=this.vertexInput.inputCtor,s=t.locations.reduce((i,n)=>e[n.propertyKey]===!1?i:{...i,[n.propertyKey]:Oe(n.typeCtor)},{});for(const{propertyKey:i,typeCtor:n}of t.builtins){const r=Oe(n);s[i]=r}return s}_hydrateComputeInput(){return this.computeInput==null?null:this.computeInput.inputCtor.locations.reduce((e,t)=>({...e,[t.propertyKey]:Oe(t.typeCtor)}),{})}_injectPackPrecisionFactor(e,t){const s={};for(const i in e){const n=e[i],r=t[i];if(r){if(n.type!=="float"&&n.type!=="vec2"&&n.type!=="vec3"&&n.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${n.type}`);s[i]=n.divide(new x(r))}else s[i]=n}return s}_injectComputePackPrecisionFactor(e,t){const s={},i=new Map;for(const n in this.computeAttributes)for(const r of this.computeAttributes[n]??[])i.set(r,n);for(const n in e){const r=e[n],o=i.get(n);if(!o)continue;const a=t[o];if(a){if(r.type!=="float"&&r.type!=="vec2"&&r.type!=="vec3"&&r.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${r.type}`);s[n]=r.divide(new x(a))}else s[n]=r}return s}_hydrateFragmentInput(e){const t={};for(const s in e)t[s]=e[s];for(const{propertyKey:s,typeCtor:i}of os.builtins){const n=Oe(i);t[s]=n}return t}_getVertexInputBuiltins(){const e=this.vertexInput.inputCtor,t=new Map;for(const{builtin:s,propertyKey:i}of e.builtins)t.set(i,s);return t}_getFragmentInputBuiltins(e){const t=e.constructor,s=new Map;for(const i of t.builtins??[])s.set(i.propertyKey,i.builtin);return s}_createShaderBuilder(e,t){const s=new ml;return this._insertDebugInfo(s),e.insertVertexShader(s),t.insertFragmentShader(s),s}_insertDebugInfo(e){e.vertex.code.add("// DEFINES: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._defines)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`);e.vertex.code.add(""),e.vertex.code.add("// OPTIONS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._options)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`)}};function an(e){const t=F(12.9898),s=F(78.233),i=F(43758.5453),n=br(e,Qi(t,s)),r=Pe(n,F(3.14));return bo(Pr(r).multiply(i))}function te(e){return _r(e,F(ll))}function Kl(e,t){return e.x.multiply(t.y).subtract(t.x.multiply(e.y))}function jl(e){return e.multiply(2).subtract(1)}function Vt(e,t){const s=F(2**t);return Pe(Hl(e.divide(s)),F(2))}function xu(e,t){return et(Vt(e,t),F(.5))}function Ii(e,t){return Vt(e,t+mn)}function Jl(e,t){return Vt(e,t)}function Zl(e){const t=Vt(e.z,7),s=F(1).subtract(t),i=e.xyz.subtract(Ol(0,0,F(128)));return s.multiply(e).add(t.multiply(i))}function Ql(e){const t=El(.99609375,.0038909912109375,1519918441772461e-20,59371814131736755e-24);return br(e,t)}function bu(e){return de(de(de(e.x,e.y),e.z),e.w)}function Pu(e){return new x(1).subtract(e)}function wu(e){return e.subtract(new x(1))}function vu(e,t){return e.subtract(new x(t))}let ft=class extends it{getVisualVariableData(e){if(!this._vvData){const t=this.getAttributeDataCoords(e);this._vvData=_t(this.visualVariableData,t).setDebugName("storage2")}return this._vvData}getAttributeDataCoords(e){if(!this._uv){const t=Zl(e),s=this.size,i=ne(t.x),n=ne(t.y).multiply(ne(256)),r=ne(t.z).multiply(ne(256)).multiply(ne(256)),o=F(i.add(n).add(r)),a=Pe(o,s),h=o.subtract(a).divide(s);this._uv=new T(a,h).add(.5).divide(s)}return this._uv}getFilterData(e){const t=this.getAttributeDataCoords(e);return _t(this.filterFlags,t).setDebugName("storage0")}getAnimationData(e){const t=this.getAttributeDataCoords(e);return _t(this.animation,t).setDebugName("storage1")}getVVData(e){return this.getVisualVariableData(e)}getDataDrivenData0(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven0,t).setDebugName("storage30")}getDataDrivenData1(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven1,t).setDebugName("storage31")}getDataDrivenData2(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven2,t).setDebugName("storage32")}getGPGPUData(e){const t=this.getAttributeDataCoords(e);return _t(this.gpgpu,t).setDebugName("storage4")}getLocalTimeOrigin(e){const t=this.getAttributeDataCoords(e);return _t(this.localTimeOrigin,t).x.setDebugName("storage5")}getFilterFlags(e){return li("webgl-ignores-sampler-precision")?Vl(this.getFilterData(e).x.multiply(F(255))):this.getFilterData(e).x.multiply(F(255))}getLabelVisibility(e){const t=this.getFilterData(e).y.multiply(255);return new x(1).subtract(t)}getAnimationValue(e){return this.getAnimationData(e).x}getSizeValue(e){return this.getVisualVariableData(e).x}getColorValue(e){return this.getVisualVariableData(e).y}getOpacityValue(e){return this.getVisualVariableData(e).z}getRotationValue(e){return this.getVisualVariableData(e).w}};g([M(mt)],ft.prototype,"filterFlags",void 0),g([M(mt)],ft.prototype,"animation",void 0),g([M(mt)],ft.prototype,"gpgpu",void 0),g([M(mt)],ft.prototype,"localTimeOrigin",void 0),g([M(mt)],ft.prototype,"visualVariableData",void 0),g([M(mt)],ft.prototype,"dataDriven0",void 0),g([M(mt)],ft.prototype,"dataDriven1",void 0),g([M(mt)],ft.prototype,"dataDriven2",void 0),g([M(x)],ft.prototype,"size",void 0);let rr=class extends it{};g([M(x)],rr.prototype,"activeReasons",void 0),g([M(x)],rr.prototype,"highlightAll",void 0);let is=class extends it{};g([M(T)],is.prototype,"position",void 0),g([M(x)],is.prototype,"distance",void 0),g([M(x)],is.prototype,"smallSymbolDistance",void 0),g([M(x)],is.prototype,"smallSymbolSizeThreshold",void 0);let K=class extends it{};g([M(xt)],K.prototype,"displayViewScreenMat3",void 0),g([M(xt)],K.prototype,"displayViewMat3",void 0),g([M(xt)],K.prototype,"displayMat3",void 0),g([M(xt)],K.prototype,"viewMat3",void 0),g([M(xt)],K.prototype,"tileMat3",void 0),g([M(x)],K.prototype,"displayZoomFactor",void 0),g([M(x)],K.prototype,"requiredZoomFactor",void 0),g([M(T)],K.prototype,"tileOffset",void 0),g([M(x)],K.prototype,"currentScale",void 0),g([M(x)],K.prototype,"currentZoom",void 0),g([M(x)],K.prototype,"metersPerSRUnit",void 0),g([M(x)],K.prototype,"rotation",void 0),g([M(x)],K.prototype,"pixelRatio",void 0);let Zt=class extends ir{};g([k(0,H)],Zt.prototype,"id",void 0),g([k(1,x)],Zt.prototype,"bitset",void 0),g([k(2,T)],Zt.prototype,"pos",void 0);let zt=class extends Yl{};g([k(14,T)],zt.prototype,"nextPos1",void 0),g([k(15,T)],zt.prototype,"nextPos2",void 0);let gi=class extends os{},It=class extends ql{clip(e,t){let s=new x(0);const i=this.storage.getFilterFlags(e);if(s=s.add(F(2).multiply(F(1).subtract(Ii(i,0)))),this.inside?s=s.add(F(2).multiply(F(1).subtract(Ii(i,1)))):this.outside?s=s.add(F(2).multiply(Ii(i,1))):this.highlight&&(s=s.add(F(2).multiply(F(1).subtract(this._checkHighlight(i))))),t!=null){const n=new x(1).subtract(Dt(t.x,this.view.currentZoom)),r=Dt(t.y,this.view.currentZoom);s=s.add(new x(2).multiply(n.add(r)))}return s}getFragmentOutput(e,t,s=new x(1/255)){const i=new Wl;return i.glFragColor=this._maybeWriteHittest(t)??this._maybeHighlight(e,s)??e,i}_maybeHighlight(e,t){return this.highlight?new A(e.rgb,Dt(t,e.a)):null}_checkHighlight(e){let t=this._checkHighlightBit(e,0);for(let s=1;s{const h=as(e,t,s),l=as(e,s,i),c=as(e,i,t);return er(er(h,l),c)}])}function So(e){return e.distance.add(1)}function wr(e,t,s){const{viewMat3:i,tileMat3:n}=e.view,r=i.multiply(n),o=r.multiply(new H(t.pos,1)),a=r.multiply(new H(s.nextPos1,1)),h=r.multiply(new H(s.nextPos2,1));return rc(e.hittestRequest.position,o.xy,a.xy,h.xy)}function Su(e,t,s){return xo(e,s).subtract(t)}let us=class extends it{getColor(e,t,s){return ms([go(te(e),s),t],[mi(e,this.values.first()),this.colors.first()],[_i(e,this.values.last()),this.colors.last()],[!0,()=>{const i=this.values.findIndex(h=>et(h,e)),n=this.values.get(i),r=i.subtract(1),o=this.values.get(r),a=e.subtract(o).divide(n.subtract(o));return be(this.colors.get(r),this.colors.get(i),a)}])}};g([M(ct.ofType(A,8))],us.prototype,"colors",void 0),g([M(ct.ofType(x,8))],us.prototype,"values",void 0);let ps=class extends it{getOpacity(e){return ms([te(e),new x(1)],[mi(e,this.opacityValues.first()),this.opacities.first()],[_i(e,this.opacityValues.last()),this.opacities.last()],[!0,()=>{const t=this.opacityValues.findIndex(o=>et(o,e)),s=this.opacityValues.get(t),i=t.subtract(1),n=this.opacityValues.get(i),r=e.subtract(n).divide(s.subtract(n));return be(this.opacities.get(i),this.opacities.get(t),r)}])}};g([M(ct.ofType(x,8))],ps.prototype,"opacities",void 0),g([M(ct.ofType(x,8))],ps.prototype,"opacityValues",void 0);function Mo(e){return e.visualVariableSizeMinMaxValue!=null||e.visualVariableSizeScaleStops!=null||e.visualVariableSizeStops!=null||e.visualVariableSizeUnitValue!=null}function nc(e,t,s){if(Mo(e)){const i=e.storage.getSizeValue(t);return e.visualVariableSizeMinMaxValue?.getSize(i,s)??e.visualVariableSizeScaleStops?.getSizeForViewScale(e.view.currentScale)??e.visualVariableSizeStops?.getSize(i,s)??e.visualVariableSizeUnitValue?.getSize(i,s)}return s}function vr(e,t,s,i=new j(!1)){if(e.visualVariableColor==null)return s;const n=e.storage.getColorValue(t);return e.visualVariableColor.getColor(n,s,i)}function Sr(e,t){if(e.visualVariableOpacity==null)return new x(1);const s=e.storage.getOpacityValue(t);return e.visualVariableOpacity.getOpacity(s)}function Mu(e,t){if(e.visualVariableRotation==null)return xt.identity();const s=e.storage.getRotationValue(t);return e.visualVariableRotation.getVVRotationMat3(s)}function Cu(e,t){if(e.visualVariableRotation==null)return new x(0);const s=e.storage.getRotationValue(t);return e.visualVariableRotation.getNormalizedAngle(s)}let ds=class extends Zt{};g([k(3,A)],ds.prototype,"color",void 0),g([k(4,T)],ds.prototype,"zoomRange",void 0);let ue=class extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(e,t){const s=Sr(this,e.id),i=vr(this,e.id,e.color).multiply(s),n=this.view.displayViewScreenMat3.multiply(new H(e.pos.xy,1)),r=this.clip(e.id,e.zoomRange);return{glPosition:new A(n.xy,r,1),color:i,...this.maybeRunHittest(e,t,null)}}fragment(e){return this.getFragmentOutput(e.color,e,new x(0))}hittest(e,t){return wr(this,e,t)}};g([Y(us)],ue.prototype,"visualVariableColor",void 0),g([Y(ps)],ue.prototype,"visualVariableOpacity",void 0),g([$(0,R(ds)),$(1,R(zt))],ue.prototype,"vertex",null),g([$(0,R(gi))],ue.prototype,"fragment",null);let me=class extends it{getPatternOffsetAtTileOrigin(e,t=new x(0),s=new x(1)){const i=new T(dl).divide(e);let n=e.multiply(bo(this.maxIntsToLocalOrigin.multiply(i))).add(this.tileOffsetFromLocalOrigin).subtract(new x(.5).multiply(e));return n=new T(n.x.multiply(s).subtract(n.y.multiply(t)),n.x.multiply(t).add(n.y.multiply(s))),Pe(n,e)}};g([M(T)],me.prototype,"tileOffsetFromLocalOrigin",void 0),g([M(T)],me.prototype,"maxIntsToLocalOrigin",void 0);let _e=class extends it{};g([M(T)],_e.prototype,"size",void 0),g([M(mt)],_e.prototype,"texture",void 0);let Ut=class extends ds{};g([k(5,A)],Ut.prototype,"tlbr",void 0),g([k(6,x)],Ut.prototype,"width",void 0),g([k(7,x)],Ut.prototype,"height",void 0),g([k(8,T)],Ut.prototype,"offset",void 0),g([k(9,T)],Ut.prototype,"scale",void 0),g([k(10,x)],Ut.prototype,"angle",void 0);let oc=class extends gi{};function ac(e,t,s,i,n){const r=_r(Vt(n,pl),F(1)),o=Ql(new A(e,0));return B(r,en(i.divide(t.x),s.divide(t.y),0,ni(s.divide(t.x)),i.divide(t.y),0,an(Qi(o,0)),an(Qi(0,o)),1),en(i.divide(t.x),s.divide(t.y),0,ni(s.divide(t.x)),i.divide(t.y),0,0,0,1))}function Co(e,t){const s=e.view.requiredZoomFactor,i=new T(t.width,t.height),n=i.multiply(t.scale).multiply(s),r=t.angle.multiply(nl),o=Pr(r),a=yo(r),h=ac(t.id,n,o,a,t.bitset),l=e.localTileOffset.getPatternOffsetAtTileOrigin(i,o,a),c=s.multiply(t.scale).multiply(t.offset.subtract(l)).divide(n),u=new H(t.pos,1),p=h.multiply(u).xy.subtract(c),d=t.tlbr.divide(e.mosaicInfo.size.xyxy);let f=Vt(t.bitset,cl);return e.visualVariableColor!=null&&(f=B(te(e.storage.getColorValue(t.id)),new x(0),f)),{tileTextureCoord:p,tlbr:d,sampleAlphaOnly:f}}function Io(e,t){const s=Pe(t.tileTextureCoord,new x(1)),i=be(t.tlbr.xy,t.tlbr.zw,s);let n=_t(e.mosaicInfo.texture,i);return n=B(et(t.sampleAlphaOnly,new x(.5)),n.aaaa,n),t.color.multiply(n)}let Es=class extends ue{vertex(e,t){return{...super.vertex(e,t),...Co(this,e)}}fragment(e){const t=Io(this,e);return this.getFragmentOutput(t,e,new x(0))}};g([M(_e)],Es.prototype,"mosaicInfo",void 0),g([M(me)],Es.prototype,"localTileOffset",void 0),g([$(0,R(Ut)),$(1,R(zt))],Es.prototype,"vertex",null),g([$(0,R(oc))],Es.prototype,"fragment",null);let Mr=class extends it{getSize(e,t){const s=this.minMaxValueAndSize.xy,i=this.minMaxValueAndSize.zw;return B(te(e),t,()=>{const n=e.subtract(s.x).divide(s.y.subtract(s.x)),r=xr(n,new x(0),new x(1));return i.x.add(r.multiply(i.y.subtract(i.x)))})}};g([M(A)],Mr.prototype,"minMaxValueAndSize",void 0);let oi=class extends it{getSizeForViewScale(e){return ms([mi(e,this.values.first()),this.sizes.first()],[_i(e,this.values.last()),this.sizes.last()],[!0,()=>{const t=this.values.findIndex(o=>et(o,e)),s=this.values.get(t),i=t.subtract(1),n=this.values.get(i),r=e.subtract(n).divide(s.subtract(n));return be(this.sizes.get(i),this.sizes.get(t),r)}])}};g([M(ct.ofType(x,8))],oi.prototype,"sizes",void 0),g([M(ct.ofType(x,8))],oi.prototype,"values",void 0);let ai=class extends it{getSize(e,t){const s=ms([te(e),t],[mi(e,this.values.first()),this.sizes.first()],[_i(e,this.values.last()),this.sizes.last()],[!0,()=>{const i=this.values.findIndex(h=>et(h,e)),n=this.values.get(i),r=i.subtract(1),o=this.values.get(r),a=e.subtract(o).divide(n.subtract(o));return be(this.sizes.get(r),this.sizes.get(i),a)}]);return B(te(s),t,s)}};g([M(ct.ofType(x,8))],ai.prototype,"sizes",void 0),g([M(ct.ofType(x,8))],ai.prototype,"values",void 0);let Cr=class extends it{getSize(e,t){return B(te(e),t,e.multiply(this.unitValueToPixelsRatio))}};g([M(x)],Cr.prototype,"unitValueToPixelsRatio",void 0);class Yt extends Zt{}g([k(3,A)],Yt.prototype,"color",void 0),g([k(4,T)],Yt.prototype,"offset",void 0),g([k(5,T)],Yt.prototype,"normal",void 0),g([k(6,x)],Yt.prototype,"halfWidth",void 0),g([k(7,x)],Yt.prototype,"referenceHalfWidth",void 0),g([k(8,T)],Yt.prototype,"zoomRange",void 0);let ko=class extends gi{},hi=class extends it{};function To(e){return de(new x(ol).multiply(Dt(e,new x(al))),new x(1))}function hc(e,t){const{halfWidth:s,normal:i}=e,n=To(s),r=Po(i).multiply(s);return xr(n.multiply(s.subtract(r)).divide(t.add(n).subtract(new x(1))),new x(0),new x(1))}function lc(e,t){const{id:s,halfWidth:i,referenceHalfWidth:n}=t;if(Mo(e)){const r=new x(2).multiply(n),o=nc(e,s,r);return new x(.5).multiply(i.divide(de(n,new x(hl)))).multiply(o)}return i}function zo(e,t){const{id:s,offset:i,pos:n,normal:r,zoomRange:o}=t,{displayViewScreenMat3:a,displayViewMat3:h}=e.view,l=vr(e,s,t.color),c=Sr(e,s),u=lc(e,t),p=new x(.5).multiply(e.antialiasingControls.antialiasing),d=de(u.add(p),new x(.45)).add(new x(.1).multiply(p)),f=To(d).multiply(d).multiply(i),m=h.multiply(new H(f,new x(0))),_=a.multiply(new H(n,new x(1))).add(m),y=new x(2).multiply(Dt(u,new x(0))).add(e.clip(s,o)),b=new A(_.xy,y,1);return{color:l,opacity:c,halfWidth:d,normal:r,scaledOffset:f,scaledHalfWidth:u,glPosition:new A(b.xy,y,1)}}function yi(e,t){const{opacity:s,color:i}=e,n=hc(e,t);return s.multiply(i).multiply(n)}g([M(x)],hi.prototype,"antialiasing",void 0),g([M(x)],hi.prototype,"blur",void 0);class vt extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,s){const i=zo(this,t);return{...i,...this.maybeRunHittest(t,s,i.halfWidth)}}fragment(t){const s=yi(t,this.antialiasingControls.blur);return this.getFragmentOutput(s,t)}hittest(t,s,i){const{viewMat3:n,tileMat3:r}=this.view,o=n.multiply(r),a=o.multiply(new H(t.pos,1)),h=o.multiply(new H(s.nextPos1,1)),l=o.multiply(new H(s.nextPos2,1)),{distance:c,smallSymbolDistance:u,smallSymbolSizeThreshold:p}=this.hittestRequest,d=Dt(i,p.multiply(.5)).multiply(c.subtract(u)),f=this.hittestRequest.position;return er(as(f,a.xy,h.xy),as(f,a.xy,l.xy)).subtract(i).add(d)}}g([M(hi)],vt.prototype,"antialiasingControls",void 0),g([Y(us)],vt.prototype,"visualVariableColor",void 0),g([Y(ps)],vt.prototype,"visualVariableOpacity",void 0),g([Y(Mr)],vt.prototype,"visualVariableSizeMinMaxValue",void 0),g([Y(oi)],vt.prototype,"visualVariableSizeScaleStops",void 0),g([Y(ai)],vt.prototype,"visualVariableSizeStops",void 0),g([Y(Cr)],vt.prototype,"visualVariableSizeUnitValue",void 0),g([$(0,R(Yt)),$(1,R(zt))],vt.prototype,"vertex",null),g([$(0,R(ko))],vt.prototype,"fragment",null);class Nt extends Zt{}g([k(3,T)],Nt.prototype,"offset",void 0),g([k(4,A)],Nt.prototype,"color",void 0),g([k(5,T)],Nt.prototype,"normal",void 0),g([k(6,x)],Nt.prototype,"halfWidth",void 0),g([k(7,x)],Nt.prototype,"referenceHalfWidth",void 0),g([k(8,T)],Nt.prototype,"zoomRange",void 0);let Lo=class extends ko{};function Ir(e,t,s){const{id:i,bitset:n}=t,r=Vt(n,ul),o=et(r,new x(.5)),a=zo(e,t),h=B(o,a.halfWidth,new x(0)),l=Sr(e,i),c=vr(e,i,t.color),u=B(o,t.color,c.multiply(l)),p=e.view.displayViewScreenMat3.multiply(new H(t.pos.xy,1)),d=e.clip(t.id),f=new A(p.xy,d,1),m=B(o,a.glPosition,f),_=s&&e.maybeRunHittest(t,s,o);return{isOutline:r,color:u,opacity:new x(1),halfWidth:h,normal:a.normal,glPosition:m,..._}}let Ct=class extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}};g([M(hi)],Ct.prototype,"antialiasingControls",void 0),g([Y(us)],Ct.prototype,"visualVariableColor",void 0),g([Y(ps)],Ct.prototype,"visualVariableOpacity",void 0),g([Y(Mr)],Ct.prototype,"visualVariableSizeMinMaxValue",void 0),g([Y(oi)],Ct.prototype,"visualVariableSizeScaleStops",void 0),g([Y(ai)],Ct.prototype,"visualVariableSizeStops",void 0),g([Y(Cr)],Ct.prototype,"visualVariableSizeUnitValue",void 0);class nr extends Ct{vertex(t,s){return Ir(this,t,s)}fragment(t){const{color:s,isOutline:i}=t,n=et(i,new x(.5)),r=yi(t,this.antialiasingControls.blur),o=B(n,r,s),a=B(n,new x(1/255),new x(0));return this.getFragmentOutput(o,t,a)}hittest(t,s,i){return B(i,So(this.hittestRequest),wr(this,t,s))}}g([$(0,R(Nt)),$(1,R(zt))],nr.prototype,"vertex",null),g([$(0,R(Lo))],nr.prototype,"fragment",null);let or=class extends ds{};g([k(5,A)],or.prototype,"tlbr",void 0),g([k(6,x)],or.prototype,"inverseRasterizationScale",void 0);class cc extends gi{}function uc(e){const t=new x(1),s=new x(0);return new xt(t.divide(e.x),s.divide(e.y),0,ni(s.divide(e.x)),t.divide(e.y),0,0,0,1)}function Ao(e,t){const s=t.tlbr.xy,i=t.tlbr.zw,n=i.x.subtract(s.x),r=s.y.subtract(i.y),o=new T(n,r).multiply(t.inverseRasterizationScale),a=o.multiply(e.view.requiredZoomFactor),h=uc(a),l=e.localTileOffset.getPatternOffsetAtTileOrigin(o).divide(a),c=new H(t.pos,1);return{tileTextureCoord:h.multiply(c).xy.subtract(l),tlbr:t.tlbr.divide(e.mosaicInfo.size.xyxy)}}function Oo(e,t){const s=Pe(e.tileTextureCoord,new x(1)),i=be(e.tlbr.xy,e.tlbr.zw,s),n=_t(t.texture,i);return e.color.multiply(n)}class Fs extends ue{vertex(t,s){return{...super.vertex(t,s),...Ao(this,t)}}fragment(t){const s=Oo(t,this.mosaicInfo);return this.getFragmentOutput(s,t,new x(0))}}g([M(_e)],Fs.prototype,"mosaicInfo",void 0),g([M(me)],Fs.prototype,"localTileOffset",void 0),g([$(0,R(or)),$(1,R(zt))],Fs.prototype,"vertex",null),g([$(0,R(cc))],Fs.prototype,"fragment",null);let ar=class extends Nt{};g([k(9,A)],ar.prototype,"tlbr",void 0),g([k(10,x)],ar.prototype,"inverseRasterizationScale",void 0);let Eo=class extends Lo{},Ns=class extends nr{vertex(e,t){return{...Ir(this,e,t),...Ao(this,e)}}fragment(e){const{isOutline:t}=e,s=et(t,new x(.5)),i=yi(e,this.antialiasingControls.blur),n=Oo(e,this.mosaicInfo),r=B(s,i,n),o=B(s,new x(1/255),new x(0));return this.getFragmentOutput(r,e,o)}};g([M(_e)],Ns.prototype,"mosaicInfo",void 0),g([M(me)],Ns.prototype,"localTileOffset",void 0),g([$(0,R(ar)),$(1,R(zt))],Ns.prototype,"vertex",null),g([$(0,R(Eo))],Ns.prototype,"fragment",null);const pc=16,hn=1/pc,dc=128;class St extends Zt{}g([k(3,A)],St.prototype,"color",void 0),g([k(4,A)],St.prototype,"tlbr",void 0),g([k(5,x)],St.prototype,"angle",void 0),g([k(6,x)],St.prototype,"aux1",void 0),g([k(7,x)],St.prototype,"aux2",void 0),g([k(8,T)],St.prototype,"aux3",void 0),g([k(9,T)],St.prototype,"aux4",void 0),g([k(10,T)],St.prototype,"zoomRange",void 0);class fc extends Eo{}class $s extends Ct{vertex(t,s){const{aux1:i,aux2:n,aux3:r,aux4:o}=t,a={...t,width:i,height:n,offset:r,scale:o.multiply(hn)},h={...t,halfWidth:i,referenceHalfWidth:n,offset:r,normal:o.subtract(dc).multiply(hn)},l=Ir(this,h),c=Co(this,a),u=et(l.isOutline,new x(.5));return{...l,...c,...this.maybeRunHittest(t,s,u)}}fragment(t){const{isOutline:s}=t,i=et(s,new x(.5)),n=yi(t,this.antialiasingControls.blur),r=Io(this,t),o=B(i,n,r),a=B(i,new x(1/255),new x(0));return this.getFragmentOutput(o,t,a)}hittest(t,s,i){return B(i,So(this.hittestRequest),wr(this,t,s))}}g([M(_e)],$s.prototype,"mosaicInfo",void 0),g([M(me)],$s.prototype,"localTileOffset",void 0),g([$(0,R(St)),$(1,R(zt))],$s.prototype,"vertex",null),g([$(0,R(fc))],$s.prototype,"fragment",null);const mc=8388607,_c=8388608,Iu=e=>e&mc;function ku(e,t){return((t?_c:0)|e)>>>0}var ln;(function(e){e.Local="Local",e.Global="Global"})(ln||(ln={}));class we{generateSource(t){const s=[];for(let n=1;n= ${hr}) { top = ${hr-1}; }`);return s}}let ve=128;class gc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}class yc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}}class xc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}}class bc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}}function hs(e){return[`float duration = clamp(${e.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${e.startTimeOffset};`,`float repeatDelay = ${e.repeatDelay};`,`float timeOriginSelector = ${e.timeOriginSelector};`,`float repeatType = ${e.repeatType};`,`float easing = ${e.easing};`,`float playAnimation = ${e.playAnimation} * (1.0 - step(0.0, -${e.duration}));`,`float reverseAnimation = ${e.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${e.out} = oscillate ? 1.0 - of : of;`]}const Pc={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},wc={Loop:1,None:2,Oscillate:3},vc={Local:1,Global:2};function ls(e){const t=Pc[e.easing],s=wc[e.repeatType],i=vc[e.timeOriginSelector];return[[e.duration,e.startTimeOffset,e.repeatDelay,i],[s,t,e.playAnimation,e.reverseAnimation]]}class Sc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...hs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...hs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...hs({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;",` - vec2 translation = vec2( - cos1 * s1 * x2 - sin1 * s1 * y2 + x1, - sin1 * s1 * x2 + cos1 * s1 * y2 + y1 - ); - `,"out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...ls(t.translation.timing),...ls(t.rotation.timing),...ls(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,0,0]]}}class Mc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...hs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...hs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...ls(t.color.timing),...ls(t.opacity.timing)]}}const cn={scalar:new yc,vector3:new xc,vector4:new bc,animatedTransform:new Sc,animatedColor:new Mc,ret:new gc},Cc=40,hr=4;function Tu(e){const t=[];t.push(`float globalTime = ${e.globalTime};`),t.push(`float localTimeOrigin = ${e.localTimeOrigin};`),t.push(`vec2 pointer = ${e.animationPointer};`),t.push(`vec2 size = ${e.animationTextureSize};`),t.push("int top = 0;"),t.push(`vec4 stack[${hr}];`),t.push(`for (int counter = 0; counter < ${Cc}; counter++) {`),t.push(`vec4 atom0 = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push("pointer.x += 1.0;"),t.push(`vec2 pixelDimensions = ${e.pixelDimensions};`),t.push("if (false) {");for(const s in cn){const i=cn[s];t.push(`} else if (int(atom0.x) == ${i.opcode}) {`);for(const n of i.generateSource(e))t.push(n)}return t.push("} // End if-else."),t.push("} // End for."),t.push(`${e.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),t.join(` -`)}let Rs=class extends Go{constructor(e){super(e),this.debugName="",this._updatingHandles=new za,this._idToUpdatingState=new Ta}get updating(){const e=this._updatingHandles.updating||Array.from(this._idToUpdatingState.values()).some(t=>t);if(li("esri-2d-log-updating")){const t=Array.from(this._idToUpdatingState.entries()).map(([s,i])=>`-> ${s}: ${i}`).join(` -`);console.log(`${this.debugName}: Updating: ${e} --> Handles: ${this._updatingHandles.updating} -${t}`)}return e}addUpdateTracking(e,t){const s=Vo(()=>t.updating,i=>this._idToUpdatingState.set(e,i),{sync:!0});this.addHandles(s)}addPromise(e){return this._updatingHandles.addPromise(e)}};g([kr({constructOnly:!0})],Rs.prototype,"debugName",void 0),g([kr({readOnly:!0})],Rs.prototype,"updating",null),Rs=g([$o("esri.views.2d.layers.support.UpdateTracking2D")],Rs);export{te as $,on as A,xh as B,it as C,Fr as D,N as E,B as F,cn as G,bh as H,ns as I,zh as J,Th as K,A as L,xt as M,_r as N,lh as O,pl as P,ku as Q,fh as R,x as S,Zr as T,au as U,Zt as V,lu as W,ou as X,hu as Y,Iu as Z,nl as _,Rs as a,su as a$,It as a0,Cu as a1,Pr as a2,yo as a3,H as a4,mi as a5,ms as a6,_t as a7,Ql as a8,iu as a9,Po as aA,gu as aB,br as aC,bu as aD,ue as aE,Es as aF,$s as aG,nr as aH,Fs as aI,Ns as aJ,Su as aK,er as aL,Hl as aM,ru as aN,Mu as aO,nu as aP,Gt as aQ,pu as aR,du as aS,vt as aT,Yt as aU,bo as aV,yu as aW,mu as aX,zo as aY,hc as aZ,mt as a_,xr as aa,Gl as ab,Yl as ac,Vt as ad,Ll as ae,nc as af,vr as ag,go as ah,j as ai,xu as aj,be as ak,Sr as al,$l as am,xo as an,rc as ao,et as ap,sc as aq,T as ar,ni as as,ec as at,Dt as au,So as av,R as aw,ir as ax,ql as ay,de as az,pc as b,_o as b0,Tu as b1,_e as b2,us as b3,ps as b4,Mr as b5,oi as b6,ai as b7,Cr as b8,Wl as b9,K as ba,gi as bb,zt as bc,os as bd,nn as be,jl as bf,Pu as bg,wu as bh,vu as bi,_u as bj,uu as bk,Ot as bl,fu as bm,cu as bn,tu as bo,Qc as bp,Jc as bq,eu as br,Zc as bs,qc as bt,Fi as bu,Kc as c,ul as d,dc as e,jr as f,Oa as g,Kn as h,jc as i,mh as j,re as k,ln as l,_h as m,Wc as n,vh as o,Ih as p,Ch as q,Yn as r,mc as s,k as t,Yc as u,M as v,Y as w,cl as x,ll as y,ct as z}; diff --git a/main/assets/UpdatingHandles-CUu3u1ms-D2fDxJPP.js b/main/assets/UpdatingHandles-CUu3u1ms-D2fDxJPP.js deleted file mode 100644 index 04f681787..000000000 --- a/main/assets/UpdatingHandles-CUu3u1ms-D2fDxJPP.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as _,i as p,j as u,ah as o,aF as g,ai as c,av as m,a2 as h,aQ as H}from"./main-BZaw9FpY.js";let l=class extends u{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o)}addWhen(e,t,s={}){return this._installWatch(e,t,s,g)}addOnCollectionChange(e,t,{initial:s=!1,final:n=!1}={}){const a=++this._handleId;return this.addHandles([c(e,"after-changes",this._createSyncUpdatingCallback(),m),c(e,"change",t,{onListenerAdd:s?d=>t({added:d.toArray(),removed:[]}):void 0,onListenerRemove:n?d=>t({added:[],removed:d.toArray()}):void 0})],a),h(()=>this.removeHandles(a))}addPromise(e){if(e==null)return e;const t=++this._handleId;this.addHandles(h(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(i)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},n){const a=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,a);const d=n(e,t,s);return this.addHandles(d,a),h(()=>this.removeHandles(a))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),n=o(e,s,{sync:!0,equals:()=>!1});return this.addHandles(n,t),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(i),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(H(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(i))}),i)}}};r([_({readOnly:!0})],l.prototype,"updating",void 0),l=r([p("esri.core.support.UpdatingHandles")],l);const i=-42;export{l as i}; diff --git a/main/assets/UpdatingHandles-CUu3u1ms-m6cYzEJ6.js b/main/assets/UpdatingHandles-CUu3u1ms-m6cYzEJ6.js new file mode 100644 index 000000000..5069b70dd --- /dev/null +++ b/main/assets/UpdatingHandles-CUu3u1ms-m6cYzEJ6.js @@ -0,0 +1 @@ +import{v as r,S as _,i as p,j as u,ah as o,aF as g,ai as c,av as m,a2 as h,aQ as H}from"./main-C7yV2j71.js";let l=class extends u{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o)}addWhen(e,t,s={}){return this._installWatch(e,t,s,g)}addOnCollectionChange(e,t,{initial:s=!1,final:n=!1}={}){const a=++this._handleId;return this.addHandles([c(e,"after-changes",this._createSyncUpdatingCallback(),m),c(e,"change",t,{onListenerAdd:s?d=>t({added:d.toArray(),removed:[]}):void 0,onListenerRemove:n?d=>t({added:[],removed:d.toArray()}):void 0})],a),h(()=>this.removeHandles(a))}addPromise(e){if(e==null)return e;const t=++this._handleId;this.addHandles(h(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(i)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},n){const a=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,a);const d=n(e,t,s);return this.addHandles(d,a),h(()=>this.removeHandles(a))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),n=o(e,s,{sync:!0,equals:()=>!1});return this.addHandles(n,t),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(i),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(H(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(i))}),i)}}};r([_({readOnly:!0})],l.prototype,"updating",void 0),l=r([p("esri.core.support.UpdatingHandles")],l);const i=-42;export{l as i}; diff --git a/main/assets/VectorTileLayer-DruyQukp-DM5uhmkp.js b/main/assets/VectorTileLayer-DruyQukp-DM5uhmkp.js deleted file mode 100644 index 21fbaeb00..000000000 --- a/main/assets/VectorTileLayer-DruyQukp-DM5uhmkp.js +++ /dev/null @@ -1 +0,0 @@ -import{W as T,f as w,a as x,y as S,db as Q,jU as Z,jV as ee,ay as te,P as g,o as I,k as F,v as c,S as h,n as U,J as re,ac as ie,a0 as E,i as se,a1 as oe,hY as le,jW as ae,X as ne,d8 as W,bX as O,dI as J,$ as K,a5 as ue,jX as z,b7 as D,ft as j,jY as B,w as pe,aA as ce,aU as he,an as ye,x as M,E as de}from"./main-BZaw9FpY.js";import{m as me}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as fe}from"./Layer-ChoECxvZ-C4wLrCej.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{O as Ae}from"./ArcGISCachedService-C64Ko1TY-YBzt3RaL.js";import{a as Se}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{u as we}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as xe}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as ve}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as _e}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as be}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as Ie}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{V as R,d as Ue}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{f as G}from"./TilemapCache-CRRxws77-B5V8seF0.js";import{s as X}from"./TileKey-C5IL-JBr-0HJjsV9n.js";import{a as Re}from"./jsonContext-BA8GHqVk-BMETb6sX.js";import{a as Te}from"./StyleRepository-D3WuVprR-COU4Jcir.js";import{n as C}from"./capabilities-agoTWNzb-CtsNgRyk.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./TileInfoTilemapCache-D1SExPij-UDulH8vT.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";let _=null;function Oe(e){if(_)return _;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return _=new Promise(r=>{const i=new Image;i.onload=()=>{i.onload=i.onerror=null,r(i.width>0&&i.height>0)},i.onerror=()=>{i.onload=i.onerror=null,r(!1)},i.src="data:image/webp;base64,"+t[e]}),_}const k=1.15;class N{constructor(t,r){this._spriteSource=t,this._maxTextureSize=r,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const r in this._spritesData)t.push(r);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>k;const{width:r,height:i,data:s,json:l}=await this._getSpriteData(this._spriteSource,t),o=Object.keys(l);if(!o||o.length===0||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=l,this.width=r,this.height=i;const u=Math.max(this._maxTextureSize,4096);if(r>u||i>u){const a=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${u} pixels}`;throw oe.getLogger("esri.layers.support.SpriteSource").error(a),new I("SpriteSource",a)}let n;for(let a=0;ae.data.index)),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return K(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;i.level!==0;)i=new X(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,l,o=e,u=r.pop();if(o===1)return u;for(;r.length;)if(s=r.pop(),l=(1&s.col)+((1&s.row)<<1),o){if(o[l]===0){u=null;break}if(o[l]===1){u=s;break}u=s,o=o[l]}return u}},Le=class{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=ce(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=w(this._tileIndexUrl,{query:{...e?.query}}).then(t=>t.data.index)),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,l=new X(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,l,t).then(()=>(l.world=e.world,l)).catch(o=>{if(he(o))throw o;return null})}};class Ee{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){(this._promise==null||M(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const r=this._abortOptions;return r.push(t),de(t,()=>{r.every(i=>M(i))&&this._abortController.abort()}),this._promise.then(i=>g(i))}async _makeRequest(t){this._abortController=new AbortController;const{data:r}=await w(t,{responseType:"array-buffer",signal:this._abortController.signal});return r}}const q=new Map;function De(e,t,r,i,s){const l=x(e),o=l.query;if(o)for(const[n,a]of Object.entries(o))switch(a){case"{x}":o[n]=i.toString();break;case"{y}":o[n]=r.toString();break;case"{z}":o[n]=t.toString()}const u=l.path;return je(S(u.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...l.query}),s)}function je(e,t){return ye(q,e,()=>new Ee(e)).getData(t).finally(()=>q.delete(e))}class Be{constructor(t,r,i){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=r;const s=x(this.sourceUrl),l=g(i),o=l.tiles;if(s)for(let f=0;ff.toLowerCase().trim()),n=i?.exportTilesAllowed===!0,a=u?.includes("tilemap")===!0,y=n&&i.hasOwnProperty("maxExportTilesCount")?i.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:n,supportsTileMap:a},exportTiles:n?{maxExportTilesCount:+y}:null},this.tileInfo=R.fromJSON(l.tileInfo);const d=i.tileMap?S(O(s.path,i.tileMap),s.query??{}):null;a?(this.type="vector-tile",this.tilemap=new Le(new G({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:l.minLOD??this.tileInfo.lods[0].level,maxLOD:l.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),d)):d&&(this.tilemap=new Pe(d)),this.fullExtent=U.fromJSON(i.fullExtent),this.initialExtent=U.fromJSON(i.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(t,r){return this.tilemap?this.tilemap.dataKey(t,r):t}requestTile(t,r,i,s){const l=this.tileServers[r%this.tileServers.length];return De(l,t,r,i,s)}isCompatibleWith(t){const r=this.tileInfo,i=t.tileInfo;if(!r.spatialReference.equals(i.spatialReference)||!r.origin.equals(i.origin)||Math.round(r.dpi)!==Math.round(i.dpi))return!1;const s=r.lods,l=i.lods,o=Math.min(s.length,l.length);for(let u=0;u=b||Math.abs(r.y-i.y)>=b)return!1;let s,l;e.lods[0].scale>t.lods[0].scale?(s=e,l=t):(l=e,s=t);for(let o=s.lods[0].scale;o>=l.lods[l.lods.length-1].scale-b;o/=2)if(Math.abs(o-l.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],n=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],a=u.scale,y=u.resolution,d=n.scale,f=[];let m=a,P=y,L=0;for(;m>d;)f.push(new Ue({level:L,resolution:P,scale:m})),L++,m/=2,P/=2;return new R({size:[r,r],dpi:s,format:i||"pbf",origin:l,lods:f,spatialReference:o})}let p=class extends we(Ie(be(Ae(Se(ve(_e(xe(ge(me(fe)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(T).then(async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await w(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},Re(this.portalItem,"portal-item"))}).catch(T).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&x(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?S(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?x(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&Q(e)&&(e=`https:${e}`);const r=Z(e);t.styleUrl=ee(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:i})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return g(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return g(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return g(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new I("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await Me(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await Oe("lossy")||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),typeof e=="string"?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new Te(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const l of r)if(l.toLowerCase().includes(i))return F(`//static.arcgis.com/attribution/Vector${s}/${l}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};c([h({readOnly:!0})],p.prototype,"attributionDataUrl",null),c([h({type:["show","hide"]})],p.prototype,"listMode",void 0),c([h({json:{read:!0,write:!0}})],p.prototype,"blendMode",void 0),c([h({readOnly:!0,json:{read:!1}})],p.prototype,"capabilities",null),c([h({readOnly:!0})],p.prototype,"currentStyleInfo",void 0),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"fullExtent",null),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"initialExtent",null),c([h({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],p.prototype,"isReference",void 0),c([h({type:["VectorTileLayer"]})],p.prototype,"operationalLayerType",void 0),c([h({readOnly:!0})],p.prototype,"parsedUrl",null),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),c([h({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"refreshInterval",void 0),c([h()],p.prototype,"style",void 0),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:re,readOnly:!0})],p.prototype,"spatialReference",null),c([h({readOnly:!0})],p.prototype,"styleRepository",void 0),c([h({readOnly:!0})],p.prototype,"sourceNameToSource",void 0),c([h({readOnly:!0})],p.prototype,"primarySource",void 0),c([h({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null),c([ie(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],p.prototype,"tileInfo",null),c([h()],p.prototype,"tilemapCache",void 0),c([E("service","tilemapCache",["capabilities","tileInfo"])],p.prototype,"readTilemapCache",null),c([h({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0),c([h({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0),c([h({readOnly:!0})],p.prototype,"version",void 0),c([E("version",["version","currentVersion"])],p.prototype,"readVersion",null),p=c([se("esri.layers.VectorTileLayer")],p);const Mt=p;export{Mt as default}; diff --git a/main/assets/VectorTileLayer-DruyQukp-Dv3Jeiv4.js b/main/assets/VectorTileLayer-DruyQukp-Dv3Jeiv4.js new file mode 100644 index 000000000..d5bc3122f --- /dev/null +++ b/main/assets/VectorTileLayer-DruyQukp-Dv3Jeiv4.js @@ -0,0 +1 @@ +import{W as T,f as w,a as x,y as S,db as Q,jU as Z,jV as ee,ay as te,P as g,o as I,k as F,v as c,S as h,n as U,J as re,ac as ie,a0 as E,i as se,a1 as oe,hY as le,jW as ae,X as ne,d8 as W,bX as O,dI as J,$ as K,a5 as ue,jX as z,b7 as D,ft as j,jY as B,w as pe,aA as ce,aU as he,an as ye,x as M,E as de}from"./main-C7yV2j71.js";import{m as me}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as fe}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{O as Ae}from"./ArcGISCachedService-C64Ko1TY-C2ql8te1.js";import{a as Se}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{u as we}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as xe}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as ve}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as _e}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as be}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as Ie}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{V as R,d as Ue}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{f as G}from"./TilemapCache-CRRxws77-Cj_Hxxs_.js";import{s as X}from"./TileKey-C5IL-JBr-COMthbrT.js";import{a as Re}from"./jsonContext-BA8GHqVk-DpBf0bCt.js";import{a as Te}from"./StyleRepository-D3WuVprR-DfGaR0vd.js";import{n as C}from"./capabilities-agoTWNzb-CtsNgRyk.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./TileInfoTilemapCache-D1SExPij-6JuHkhwl.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";let _=null;function Oe(e){if(_)return _;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return _=new Promise(r=>{const i=new Image;i.onload=()=>{i.onload=i.onerror=null,r(i.width>0&&i.height>0)},i.onerror=()=>{i.onload=i.onerror=null,r(!1)},i.src="data:image/webp;base64,"+t[e]}),_}const k=1.15;class N{constructor(t,r){this._spriteSource=t,this._maxTextureSize=r,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const r in this._spritesData)t.push(r);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>k;const{width:r,height:i,data:s,json:l}=await this._getSpriteData(this._spriteSource,t),o=Object.keys(l);if(!o||o.length===0||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=l,this.width=r,this.height=i;const u=Math.max(this._maxTextureSize,4096);if(r>u||i>u){const a=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${u} pixels}`;throw oe.getLogger("esri.layers.support.SpriteSource").error(a),new I("SpriteSource",a)}let n;for(let a=0;ae.data.index)),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return K(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;i.level!==0;)i=new X(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,l,o=e,u=r.pop();if(o===1)return u;for(;r.length;)if(s=r.pop(),l=(1&s.col)+((1&s.row)<<1),o){if(o[l]===0){u=null;break}if(o[l]===1){u=s;break}u=s,o=o[l]}return u}},Le=class{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=ce(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=w(this._tileIndexUrl,{query:{...e?.query}}).then(t=>t.data.index)),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,l=new X(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,l,t).then(()=>(l.world=e.world,l)).catch(o=>{if(he(o))throw o;return null})}};class Ee{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){(this._promise==null||M(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const r=this._abortOptions;return r.push(t),de(t,()=>{r.every(i=>M(i))&&this._abortController.abort()}),this._promise.then(i=>g(i))}async _makeRequest(t){this._abortController=new AbortController;const{data:r}=await w(t,{responseType:"array-buffer",signal:this._abortController.signal});return r}}const q=new Map;function De(e,t,r,i,s){const l=x(e),o=l.query;if(o)for(const[n,a]of Object.entries(o))switch(a){case"{x}":o[n]=i.toString();break;case"{y}":o[n]=r.toString();break;case"{z}":o[n]=t.toString()}const u=l.path;return je(S(u.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...l.query}),s)}function je(e,t){return ye(q,e,()=>new Ee(e)).getData(t).finally(()=>q.delete(e))}class Be{constructor(t,r,i){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=r;const s=x(this.sourceUrl),l=g(i),o=l.tiles;if(s)for(let f=0;ff.toLowerCase().trim()),n=i?.exportTilesAllowed===!0,a=u?.includes("tilemap")===!0,y=n&&i.hasOwnProperty("maxExportTilesCount")?i.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:n,supportsTileMap:a},exportTiles:n?{maxExportTilesCount:+y}:null},this.tileInfo=R.fromJSON(l.tileInfo);const d=i.tileMap?S(O(s.path,i.tileMap),s.query??{}):null;a?(this.type="vector-tile",this.tilemap=new Le(new G({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:l.minLOD??this.tileInfo.lods[0].level,maxLOD:l.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),d)):d&&(this.tilemap=new Pe(d)),this.fullExtent=U.fromJSON(i.fullExtent),this.initialExtent=U.fromJSON(i.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(t,r){return this.tilemap?this.tilemap.dataKey(t,r):t}requestTile(t,r,i,s){const l=this.tileServers[r%this.tileServers.length];return De(l,t,r,i,s)}isCompatibleWith(t){const r=this.tileInfo,i=t.tileInfo;if(!r.spatialReference.equals(i.spatialReference)||!r.origin.equals(i.origin)||Math.round(r.dpi)!==Math.round(i.dpi))return!1;const s=r.lods,l=i.lods,o=Math.min(s.length,l.length);for(let u=0;u=b||Math.abs(r.y-i.y)>=b)return!1;let s,l;e.lods[0].scale>t.lods[0].scale?(s=e,l=t):(l=e,s=t);for(let o=s.lods[0].scale;o>=l.lods[l.lods.length-1].scale-b;o/=2)if(Math.abs(o-l.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],n=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],a=u.scale,y=u.resolution,d=n.scale,f=[];let m=a,P=y,L=0;for(;m>d;)f.push(new Ue({level:L,resolution:P,scale:m})),L++,m/=2,P/=2;return new R({size:[r,r],dpi:s,format:i||"pbf",origin:l,lods:f,spatialReference:o})}let p=class extends we(Ie(be(Ae(Se(ve(_e(xe(ge(me(fe)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(T).then(async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await w(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},Re(this.portalItem,"portal-item"))}).catch(T).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&x(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?S(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?x(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&Q(e)&&(e=`https:${e}`);const r=Z(e);t.styleUrl=ee(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:i})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return g(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return g(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return g(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new I("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await Me(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await Oe("lossy")||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),typeof e=="string"?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new Te(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const l of r)if(l.toLowerCase().includes(i))return F(`//static.arcgis.com/attribution/Vector${s}/${l}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};c([h({readOnly:!0})],p.prototype,"attributionDataUrl",null),c([h({type:["show","hide"]})],p.prototype,"listMode",void 0),c([h({json:{read:!0,write:!0}})],p.prototype,"blendMode",void 0),c([h({readOnly:!0,json:{read:!1}})],p.prototype,"capabilities",null),c([h({readOnly:!0})],p.prototype,"currentStyleInfo",void 0),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"fullExtent",null),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"initialExtent",null),c([h({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],p.prototype,"isReference",void 0),c([h({type:["VectorTileLayer"]})],p.prototype,"operationalLayerType",void 0),c([h({readOnly:!0})],p.prototype,"parsedUrl",null),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),c([h({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"refreshInterval",void 0),c([h()],p.prototype,"style",void 0),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:re,readOnly:!0})],p.prototype,"spatialReference",null),c([h({readOnly:!0})],p.prototype,"styleRepository",void 0),c([h({readOnly:!0})],p.prototype,"sourceNameToSource",void 0),c([h({readOnly:!0})],p.prototype,"primarySource",void 0),c([h({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null),c([ie(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],p.prototype,"tileInfo",null),c([h()],p.prototype,"tilemapCache",void 0),c([E("service","tilemapCache",["capabilities","tileInfo"])],p.prototype,"readTilemapCache",null),c([h({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0),c([h({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0),c([h({readOnly:!0})],p.prototype,"version",void 0),c([E("version",["version","currentVersion"])],p.prototype,"readVersion",null),p=c([se("esri.layers.VectorTileLayer")],p);const Mt=p;export{Mt as default}; diff --git a/main/assets/VectorTileLayerView2D-B9OYHbL4-CP_gGifv.js b/main/assets/VectorTileLayerView2D-B9OYHbL4-CP_gGifv.js new file mode 100644 index 000000000..3d6a84c5b --- /dev/null +++ b/main/assets/VectorTileLayerView2D-B9OYHbL4-CP_gGifv.js @@ -0,0 +1 @@ +import{aA as V,aC as Ve,aU as j,a1 as K,P as ze,bh as H,w as Fe,v as oe,S as He,i as qe,aW as Be,y as ne,bt as Ne,W as Qe,iF as ae,cS as We,ht as $e,bi as le,an as Je,f as Ke,hT as k,dF as he}from"./main-C7yV2j71.js";import{P as Ge,g as Ye}from"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import{C as I,I as R}from"./enums-qHpGJ28Q-CmnLAccm.js";import{q as je}from"./workers-PiCjreoO-DqI62TYf.js";import{a as P}from"./Rect-DD6XS68q-D_hsV3ag.js";import{D as O,L as ce,A as B,U as Xe,G as Me,n as D}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as Re,V as Pe}from"./Texture-BCt2hphT-CtQVMDnp.js";import{o as X}from"./pbf-D-y3_eZO-SEvl9j6c.js";import{k as Ze}from"./rasterizingUtils-BmlDdKBf-KXJpDIVD.js";import{s as A}from"./TileKey-C5IL-JBr-COMthbrT.js";import{b as et}from"./LRUCache-C3erQTWv-DhyPlt5p.js";import{$ as ue,k as Ae,Q as tt}from"./Tile-D75RMC64-CM0vKD9b.js";import{R as st,C as it,D as rt,G as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as z,E as N,c as nt}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{j as at,Q as lt}from"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import{r as M}from"./BufferObject-BM_7mcDb-CTo2uuE5.js";import{c as U}from"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import{e as W,c as ht,t as ct}from"./config-nuMERBvb-MDUrh2eL.js";import{K as Le}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{V as Oe}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{o as ut}from"./signal-CETehA7D-DxK1orqE.js";import{p as C,a as Z,u as yt,n as L,i as dt}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{h as _t}from"./TileContainer-D48pXXgL-DSah9A2g.js";import{N as pt}from"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import{g as ye,f as de}from"./SourceLayerData-BT_Ywuvg-BFtXgEqx.js";import{a as _e,K as ft}from"./StyleRepository-D3WuVprR-DfGaR0vd.js";import{X as gt,Y as mt}from"./LayerView-Bish-E63-I2LV0oDm.js";import{n as bt}from"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";import{i as pe}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./floatRGBA-4pIJN00G-ClP9XgP7.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";let F=class{constructor(i,e){this._width=0,this._height=0,this._free=[],this._width=i,this._height=e,this._free.push(new P(0,0,i,e))}get width(){return this._width}get height(){return this._height}allocate(i,e){if(i>this._width||e>this._height)return new P;let t=null,s=-1;for(let r=0;ri&&this._free.push(new P(t.x+i,t.y,t.width-i,e)),t.height>e&&this._free.push(new P(t.x,t.y+e,t.width,t.height-e))):(t.width>i&&this._free.push(new P(t.x+i,t.y,t.width-i,t.height)),t.height>e&&this._free.push(new P(t.x,t.y+e,i,t.height-e))),new P(t.x,t.y,i,e))}release(i){for(let e=0;e{const l=i+a;if(this._rangePromises.has(l))n.push(this._rangePromises.get(l));else{const h=s.getRange(i,a).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,h),n.push(h)}}),Promise.all(n).then(()=>{let a=this._glyphIndex[i];a||(a={},this._glyphIndex[i]=a);for(const l of e){const h=a[l];if(h){t[l]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:l};continue}const y=s.getGlyph(i,l);if(!y?.metrics)continue;const u=y.metrics;let d;if(u.width===0)d=new P(0,0,0,0);else{const c=u.width+6,_=u.height+2*3;let p=c%4?4-c%4:4,f=_%4?4-_%4:4;p===1&&(p=5),f===1&&(f=5),d=this._binPack.allocate(c+p,_+f),d.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new F(this.width-4,this.height-4),d=this._binPack.allocate(c+p,_+f));const g=this._glyphData[this._currentPage],m=y.bitmap;let b,x;if(m)for(let S=0;S<_;S++){b=c*S,x=this.width*(d.y+S+1)+d.x;for(let w=0;w{t.addRange(e,new G(new X(new Uint8Array(n.data),new DataView(n.data))))}).catch(()=>{t.addRange(e,new G)})}return t.addRange(e,new G),Promise.resolve()}getGlyph(i,e){const t=this._getFontStack(i);if(!t)return;const s=Math.floor(e/256),r=t.getRange(s);return r?{metrics:r.getMetrics(e),bitmap:r.getBitmap(e)}:void 0}_getFontStack(i){let e=this._glyphInfo[i];return e||(e=this._glyphInfo[i]=new wt),e}},St=class{constructor(i,e,t){this._array=i,this._start=e,this.length=t}at(i){return 0<=i&&i0&&(this._maxItemSize=s),this._binPack=new F(e-4,t-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new F(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight),r=new Uint32Array(t*s);this._mosaicsData[0]=r,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let s,r,o=this._mosaicRects[e];if(o)return o;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(xt)?([s,r]=this._rasterizeDash(e),t=!0):s=this._sprites.getSpriteInfo(e),!s?.width||!s.height||s.width<0||s.height<0))return null;const n=s.width,a=s.height,[l,h,y]=this._allocateImage(n,a);return l.width<=0?null:(this._copy(l,s,h,y,t,r),o={type:"sprite",rect:l,width:n,height:a,sdf:s.sdf,simplePattern:!1,rasterizationScale:s.pixelRatio,page:h},this._mosaicRects[e]=o,o)}getSpriteItems(e){const t={};for(const s of e)t[s.name]=this.getSpriteItem(s.name,s.repeat);return t}getMosaicItemPosition(e,t){const s=this.getSpriteItem(e,t),r=s?.rect;if(!r)return null;r.width=s.width,r.height=s.height;const o=s.width,n=s.height,a=2;return{tl:[r.x+a,r.y+a],br:[r.x+a+o,r.y+a+n],page:s.page}}bind(e,t,s=0,r=0){if(s>=this._size.length||s>=this._mosaicsData.length)return;if(!this._textures[s]){const n=new Re;n.wrapMode=Me.CLAMP_TO_EDGE,n.width=this._size[s][0],n.height=this._size[s][1],this._textures[s]=new Pe(e,n,new Uint8Array(this._mosaicsData[s].buffer))}const o=this._textures[s];o.setSamplingMode(t),this._dirties[s]&&o.setData(new Uint8Array(this._mosaicsData[s].buffer)),e.bindTexture(o,r),this._dirties[s]=!1}static _copyBits(e,t,s,r,o,n,a,l,h,y,u){let d=r*t+s,c=l*n+a;if(u){c-=n;for(let _=-1;_<=y;_++,d=((_+y)%y+r)*t+s,c+=n)for(let p=-1;p<=h;p++)o[c+p]=e[d+(p+h)%h]}else for(let _=0;_=this._mosaicsData.length)return;const a=new Uint32Array(n?n.buffer:this._sprites.image.buffer),l=this._mosaicsData[s],h=2,y=n?t.width:this._sprites.width;ke._copyBits(a,y,t.x,t.y,l,r[0],e.x+h,e.y+h,t.width,t.height,o),this._dirties[s]=!0}_allocateImage(e,t){e+=2,t+=2;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(i){this._requestSprite(i);const e=this._layer.currentStyleInfo.glyphsUrl,t=new ge(e?ne(e,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new fe(1024,1024,t),this._broadcastPromise=je("WorkerTileHandler",{client:this,schedule:i.schedule,signal:i.signal}).then(s=>{if(this._layer&&(this._connection?.close(),this._connection=s,this._layer&&!this._connection.closed)){const r=s.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},i);Promise.all(r).catch(o=>Ne(o))}})}_requestSprite(i){this._spriteSourceAbortController?.abort();const e=new AbortController;this._spriteSourceAbortController=e;const t=i?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=Tt(e),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:s}=e,r={...i,signal:s};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,r),this._spriteSourcePromise.then(o=>{Qe(s),this._spriteMosaic=new me(1024,1024,250),this._spriteMosaic.setSpriteSource(o)})}async updateStyle(i){const e=[];for(const t of i)t.type===I.SPRITES_CHANGED?e.push({type:I.SPRITES_CHANGED,data:{spriteSource:null}}):e.push(t);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(i){const e=new me(1024,1024,250);return e.setSpriteSource(i),this._spriteMosaic=e,this._spriteSourcePromise=Promise.resolve(i),this._spriteSourceAbortController=null,e}async setStyle(i,e,t){await this._broadcastPromise,this._styleRepository=i,this._sourceDataMaxLOD=t,this._requestSprite();const s=new ge(this._layer.currentStyleInfo.glyphsUrl?ne(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new fe(1024,1024,s),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:e,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(i,e){const t=await this._getRefKeys(i,e);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),t,e)}async fetchTilePBFs(i){const e=Object.keys(this._layer.sourceNameToSource),t={},s=await this._getRefKeys(i,t),r=[],o=[];for(let n=0;n{r.push({...h,key:a})}),o.push(l)}return Promise.all(o).then(()=>r)}async parseTileData(i,e){const t=i&&i.data;if(!t)return null;const{sourceName2DataAndRefKey:s,transferList:r}=t;return Object.keys(s).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:i.key.id,sourceName2DataAndRefKey:s,styleLayerUIDs:i.styleLayerUIDs},{...e,transferList:r}))}async getSprites(i){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(i)}getGlyphs(i){return this._glyphMosaic.getGlyphItems(i.font,i.codePoints)}async _getTilePayload(i,e,t){const s=A.pool.acquire(i.id),r=this._layer.sourceNameToSource[e],{level:o,row:n,col:a}=s;A.pool.release(s);try{return{protobuff:await r.requestTile(o,n,a,t),sourceName:e}}catch(l){if(j(l))throw l;return{protobuff:null,sourceName:e}}}async _getRefKeys(i,e){const t=this._layer.sourceNameToSource,s=new Array;for(const r in t){const o=t[r].getRefKey(i,e);s.push(o)}return ae(s)}_getSourcesData(i,e,t){const s=[];for(let r=0;r{const o={},n=[];for(let a=0;a0){const h=e[a].value.id;o[l.sourceName]={refKey:h,protobuff:l.protobuff},n.push(l.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:n}})}};function Tt(i){return()=>i.abort()}const be=512,vt=1e-6,Ct=(i,e)=>i+1/(1<<2*e);let we=class{constructor(i,e){this._tiles=new Map,this._tileCache=new et(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=i.acquireTile,this.releaseTile=i.releaseTile,this.tileInfoView=i.tileInfoView,this._container=e}destroy(){for(const i of this._tiles.values())i.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(i){this._updateCacheSize(i);const e=this.tileInfoView,t=e.getTileCoverage(i.state,0,!0,"smallest");if(!t)return!0;const{spans:s,lodInfo:r}=t,{level:o}=r,n=this._tiles,a=new Set,l=new Set;for(const{row:y,colFrom:u,colTo:d}of s)for(let c=u;c<=d;c++){const _=A.getId(o,y,r.normalizeCol(c),r.getWorldForColumn(c)),p=this._getOrAcquireTile(_);a.add(_),p.processed()?this._addToContainer(p):l.add(new A(_))}for(const[y,u]of n)u.isCoverage=a.has(y);for(const y of l)this._findPlaceholdersForMissingTiles(y,a);let h=!1;for(const[y,u]of n)u.neededForCoverage=a.has(y),u.neededForCoverage||u.isHoldingForFade&&e.intersects(t,u.key)&&a.add(y),u.isFading&&(h=!0);for(const y of this._tiles.keys())a.has(y)||this._releaseTile(y);return Ae.pool.release(t),!h}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(i,e,t,s,r){const o=[0,0],n=[0,0];s.toMap(o,i-t,e+t),s.toMap(n,i+t,e-t);const a=Math.min(o[0],n[0]),l=Math.min(o[1],n[1]),h=Math.max(o[0],n[0]),y=Math.max(o[1],n[1]),u=We(a,l,h,y),d=H(),c=[];for(const _ of this._visibleTiles.values())this.tileInfoView.getTileBounds(d,_.key),$e(u,d)&&c.push(_);if(r!=null&&r.length>0){const _=new Set(c.map(f=>f.id)),p=r.filter(f=>!_.has(f.tileKey.id)).map(f=>this._visibleTiles.get(f.tileKey.id)).filter(f=>f!==void 0);c.push(...p)}return c}_findPlaceholdersForMissingTiles(i,e){const t=[];for(const r of this._tiles.values())this._addPlaceholderChild(t,r,i,e);const s=t.reduce(Ct,0);Math.abs(1-s)0;){if(s--,r>>=1,o>>=1,t.level===s&&t.row===r&&t.col===o&&t.world===n)return!0;if(a.has(`${s}/${r}/${o}/${n}`))return!1}return!1}_updateCacheSize(i){const e=i.state.size;if(e[0]===this._viewSize[0]&&e[1]===this._viewSize[1])return;const t=Math.ceil(e[0]/be)+1,s=Math.ceil(e[1]/be)+1;this._viewSize[0]=e[0],this._viewSize[1]=e[1],this._tileCache.maxSize=5*t*s}};function Dt(i){const[e,t,s,r]=i.split("/"),o=parseInt(e,10);return o===0?null:`${o-1}/${parseInt(t,10)>>1}/${parseInt(s,10)>>1}/${parseInt(r,10)}`}function Mt(i,e){const t=e.level-i.level;return i.row===e.row>>t&&i.col===e.col>>t&&i.world===e.world}let Rt=class{constructor(i,e){this.sourceTile=e,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=i}};class Pt{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}}function Se(i,e,t,s,r,o){const n=t-r;if(n>=0)return(e>>n)+(s-(o<>n);const a=-n;return e-(o-(s<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.lineMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}};class Et extends J{constructor(e,t){super(e,t),this.type=R.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const s=new Uint32Array(e);let r=this.bufferDataOffset;this.fillIndexStart=s[r++],this.fillIndexCount=s[r++],this.outlineIndexStart=s[r++],this.outlineIndexCount=s[r++];const o=s[r++];if(o>0){this.patternMap=new Map;for(let n=0;n0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=k(this.fillVAO),this.outlineVAO=k(this.outlineVAO)}doPrepareForRendering(e,t,s){const r=new Uint32Array(t),o=new Int32Array(r.buffer),n=r[s++],a=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,n));s+=n;const l=r[s++],h=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,l));s+=l;const y=r[s++],u=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,y));s+=y;const d=r[s++],c=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,d));s+=d;const _=this.layer,p=_.fillMaterial,f=_.outlineMaterial;this.fillVAO=new U(e,p.getAttributeLocations(),p.getLayoutInfo(),new Map([["geometry",a]]),h),this.outlineVAO=new U(e,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",u]]),c)}}let Vt=class extends J{constructor(i,e,t){super(i,e),this.type=R.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const s=new Uint32Array(i),r=new Int32Array(i),o=new Float32Array(i);let n=this.bufferDataOffset;this.isIconSDF=!!s[n++];const a=s[n++],l=s[n++],h=s[n++],y=new A(a,l,h,0),u=s[n++];for(let p=0;p0||this.glyphPerPageElementsMap.size>0}triangleCount(){let i=0;for(const e of this.iconPerPageElementsMap.values())i+=e[1];for(const e of this.glyphPerPageElementsMap.values())i+=e[1];return i/3}doDestroy(){this.iconVAO=k(this.iconVAO),this.textVAO=k(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const i=this.iconOpacity,e=this.iconVAO.vertexBuffers.get("opacity");i.length>0&&i.byteLength===e.usedMemory&&e.setSubData(i,0,0,i.length);const t=this.textOpacity,s=this.textVAO.vertexBuffers.get("opacity");t.length>0&&t.byteLength===s.usedMemory&&s.setSubData(t,0,0,t.length)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=s[t++],y=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,h));t+=h;const u=s[t++],d=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,u));t+=u;const c=M.createVertex(i,D.STATIC_DRAW,this.iconOpacity.buffer),_=M.createVertex(i,D.STATIC_DRAW,this.textOpacity.buffer),p=this.layer,f=p.iconMaterial,g=p.textMaterial;this.iconVAO=new U(i,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",n],["opacity",c]]),l),this.textVAO=new U(i,g.getAttributeLocations(),g.getLayoutInfo(),new Map([["geometry",y],["opacity",_]]),d)}},zt=class extends J{constructor(i,e){super(i,e),this.type=R.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(i);let s=this.bufferDataOffset;this.circleIndexStart=t[s++],this.circleIndexCount=t[s++],this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.circleMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}},Ft=class Ee extends Le{constructor(e,t,s,r,o,n,a,l=null){super(e,t,s,r,o,n,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){this.status!=="unloaded"&&(Ee._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){--this._referenced==0&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,o=this._createRenderBuckets(s);if(r&&r.byteLength>0){const n=new Uint32Array(r);for(const a of n)this._deleteLayerData(a)}for(const[n,a]of o)this._deleteLayerData(n),a.type===R.SYMBOL&&(this.symbols.set(n,a.symbols),t=!0),this._usedMemory+=a.usedMemory,this.layerData.set(n,a);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===R.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(t){t.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),s=this.width/this.rangeX*t,r=this.height/this.rangeY*t,o=[0,0];e.toScreen(o,[this.x,this.y]);const n=this.transforms.tileUnitsToPixels;st(n),it(n,n,o),rt(n,n,Math.PI*e.rotation/180),ot(n,n,[s,r,1])}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z(),tileUnitsToPixels:z()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const o=this._deserializeBucket(r,s);for(const n of o.layerUIDs)t.set(n,o)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case R.FILL:s=new Et(e,this.styleRepository);break;case R.LINE:s=new Ut(e,this.styleRepository);break;case R.SYMBOL:s=new Vt(e,this.styleRepository,this);break;case R.CIRCLE:s=new zt(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}};function Ht(i,e,t,s,r,o){const{iconRotationAlignment:n,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:h,textTranslate:y,textTranslateAnchor:u}=s;let d=0;for(const c of i.colliders){const[_,p]=c.partIndex===0?l:y,f=c.partIndex===0?h:u,g=c.minLod<=o&&o<=c.maxLod;d+=g?0:1,c.enabled=g,c.xScreen=c.xTile*r[0]+c.yTile*r[3]+r[6],c.yScreen=c.xTile*r[1]+c.yTile*r[4]+r[7],f===dt.MAP?(c.xScreen+=t*_-e*p,c.yScreen+=e*_+t*p):(c.xScreen+=_,c.yScreen+=p),L.VIEWPORT===(c.partIndex===0?n:a)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=t*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+t*(c.dyPixels+c.height/2)-c.height/2)}i.colliders.length>0&&d===i.colliders.length&&(i.unique.show=!1)}class qt{constructor(e,t,s,r,o,n){this._symbols=e,this._styleRepository=r,this._zoom=o,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new Ue(t,s,ct),this._si=Math.sin(Math.PI*n/180),this._co=Math.cos(Math.PI*n/180);for(const a of e)for(const l of a.symbols)this._allNeededMatrices.has(l.tile)||this._allNeededMatrices.set(l.tile,nt(l.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function s(o){const n=o.xScreen+o.dxScreen,a=o.yScreen+o.dyScreen,l=n+o.width,h=a+o.height,[y,u,d,c]=t.getCellSpan(n,a,l,h);for(let _=u;_<=c;_++)for(let p=y;p<=d;p++){const f=t.cells[_][p];for(const g of f){const m=g.xScreen+g.dxScreen,b=g.yScreen+g.dyScreen,x=m+g.width,S=b+g.height;if(!(lx||hS))return!0}}return!1}const r=performance.now();for(;this._currentLayerCursore)return!1;const a=o.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Ht(a,this._si,this._co,n,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:h,iconIgnorePlacement:y,textAllowOverlap:u,textIgnorePlacement:d}=n;for(const c of a.colliders){if(!c.enabled)continue;const _=l.parts[c.partIndex];_.show&&!(c.partIndex?u:h)&&s(c)&&(c.hard?l.show=!1:_.show=!1)}if(l.show)for(const c of a.colliders){if(!c.enabled||(c.partIndex?d:y)||!l.parts[c.partIndex].show)continue;const _=c.xScreen+c.dxScreen,p=c.yScreen+c.dyScreen,f=_+c.width,g=p+c.height,[m,b,x,S]=this._gridIndex.getCellSpan(_,p,f,g);for(let w=b;w<=S;w++)for(let T=m;T<=x;T++)this._gridIndex.cells[w][T].push(c)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const s=this._zoom,r=this._styleRepository.getStyleLayerByUID(e),o=r.getLayoutValue("symbol-placement",s)!==yt.POINT;let n=r.getLayoutValue("icon-rotation-alignment",s);n===L.AUTO&&(n=o?L.MAP:L.VIEWPORT);let a=r.getLayoutValue("text-rotation-alignment",s);a===L.AUTO&&(a=o?L.MAP:L.VIEWPORT);const l=r.getPaintValue("icon-translate",s),h=r.getPaintValue("icon-translate-anchor",s),y=r.getPaintValue("text-translate",s),u=r.getPaintValue("text-translate-anchor",s),d={iconAllowOverlap:r.getLayoutValue("icon-allow-overlap",s),iconIgnorePlacement:r.getLayoutValue("icon-ignore-placement",s),textAllowOverlap:r.getLayoutValue("text-allow-overlap",s),textIgnorePlacement:r.getLayoutValue("text-ignore-placement",s),iconRotationAlignment:n,textRotationAlignment:a,iconTranslateAnchor:h,iconTranslate:l,textTranslateAnchor:u,textTranslate:y};return this._styleProps.set(e,d),d}}function Bt(i,e){if(i.priority-e.priority)return i.priority-e.priority;const t=i.tile.key,s=e.tile.key;return t.world-s.world?t.world-s.world:t.level-s.level?t.level-s.level:t.row-s.row?t.row-s.row:t.col-s.col?t.col-s.col:i.xTile-e.xTile?i.xTile-e.xTile:i.yTile-e.yTile}let Nt=class{get running(){return this._running}constructor(i,e,t,s,r,o){this._visibleTiles=i,this._symbolRepository=e,this._createCollisionJob=t,this._assignTileSymbolsOpacity=s,this._symbolLayerSorter=r,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(i,e){this._screenWidth===i&&this._screenHeight===e||this.restart(),this._screenWidth=i,this._screenHeight=e}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(i){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const e=performance.now();if(!this._selectionJob.work(i)||(this._selectionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const e=performance.now();if(!this._collisionJob.work(i)||(this._collisionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const e=performance.now();if(!this._opacityJob.work(i)||(this._opacityJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const i=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let c=null,_=!1,p=!1;for(const f of l.tileSymbols)if(!p||!_){const g=f.tile;(!c||g.isCoverage||g.neededForCoverage&&!_)&&(c=f,(g.neededForCoverage||g.isCoverage)&&(p=!0),g.isCoverage&&(_=!0))}if(c.selectedForRendering=!0,p){d.symbols.push(c),l.show=!0;for(const f of l.parts)f.show=!0}else l.show=!1}}for(const y of e)y.symbols.sort(Bt);return!0}const n=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return e.sort(n)}}}_createOpacityJob(){const i=this._assignTileSymbolsOpacity,e=this._visibleTiles;let t=0;function s(r,o){for(const n of r.symbols.values())Qt(n,o);i(r,o);for(const n of r.childrenTiles)s(n,o)}return{work(r){const o=performance.now();for(;tr)return!1;const n=e[t];n.parentTile==null&&s(n,performance.now())}return!0}}}};function Qt(i,e){for(const t of i){const s=t.unique;for(const r of s.parts){const o=r.targetOpacity>.5?1:-1;r.startOpacity+=o*((e-r.startTime)/W),r.startOpacity=Math.min(Math.max(r.startOpacity,0),1),r.startTime=e,r.targetOpacity=s.show&&r.show?1:0}}}const Wt=32,$t=8,Jt=64,Kt=20;class Gt{constructor(e,t,s){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=s,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,t){this._uniqueSymbolLayerArray=null;let s=this._tiles.get(e.id);s||(s={symbols:new Map},this._tiles.set(e.id,s));const r=new Map;if(t)for(const a of t)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));else for(const[a,l]of e.layerData)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));this._removeSymbols(r);const o=e.symbols,n=new Map;for(const[a,l]of o){let h=l.length;if(h>=Wt){let y=this.tileCoordRange;do y/=2,h/=4;while(h>$t&&y>Jt);const u=new Ue(this.tileCoordRange,this.tileCoordRange,y);n.set(a,{flat:l,index:u}),s.symbols.set(a,{flat:l,index:u});for(const d of l)u.getCell(d.xTile,d.yTile).push(d)}else n.set(a,{flat:l}),s.symbols.set(a,{flat:l})}this._addSymbols(e.key,o)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,s]of this._tiles){const r=new Map;for(const o of e)s.symbols.has(o)&&(r.set(o,s.symbols.get(o)),s.symbols.delete(o));this._removeSymbols(r),s.symbols.size===0&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const s=new Map;for(const[r,o]of e.symbols)t.symbols.has(r)&&(s.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(s),t.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,t,s,r){const o=[],n=this.uniqueSymbols;for(const a of n){const l=a.styleLayerUID,h=a.uniqueSymbols;for(const y of h){const u=y.tileSymbols.find(d=>d.selectedForRendering);u&&kt(u,e,t*(window.devicePixelRatio||1),s)&&o.push({vtlSymbol:u,styleLayerUID:l,tileKey:u.tile.key})}}return o}_removeSymbols(e){for(const[t,{flat:s}]of e)for(const r of s){const o=r.unique,n=o.tileSymbols,a=n.length-1;for(let l=0;lt.level){const o=e.key.level-t.level;if(e.key.row>>o!==t.row||e.key.col>>o!==t.col)return}if(t.level>e.key.level){const o=t.level-e.key.level;if(t.row>>o!==e.key.row||t.col>>o!==e.key.col)return}if(t.equals(e.key)){for(const o of e.childrenTiles)this._matchSymbols(o,t,s);return}const r=new Map;for(const[o,n]of s){const a=[];for(const u of n){const d=Se(this.tileCoordRange,u.xTile,t.level,t.col,e.key.level,e.key.col),c=Se(this.tileCoordRange,u.yTile,t.level,t.row,e.key.level,e.key.row);d>=0&&d=0&&c0&&r.set(o,l)}for(const o of e.childrenTiles)this._matchSymbols(o,t,r)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let s,r=0;for(const[o,n]of e){const a=new Array(n.size);s=0;for(const l of n)a[s++]=l;t[r]={styleLayerUID:o,uniqueSymbols:a},r++}return t}}const Yt=.5,xe=1e-6;class jt{constructor(e,t){this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=ut(!1),this._symbolRepository=new Gt(4096,t,()=>new Pt),this._symbolDeclutterer=new Nt(t,this._symbolRepository,(s,r,o)=>this._createCollisionJob(s,r,o),(s,r)=>{s.allSymbolsFadingOut=!0,s.lastOpacityUpdate=r,Lt(s,r,!0),s.decluttered=!0,s.requestRender()},(s,r)=>this.styleRepository.getStyleLayerByUID(s.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(r.styleLayerUID).z,s=>{const r=this.styleRepository.getStyleLayerByUID(s);if(this._zoom+xe=r.maxzoom)return!1;const o=r.getLayoutProperty("visibility");return!o||o.getValue()!==Z.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,t,s){return this.updateDecluttererViewState(),new qt(e,t,s,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]};const s=[0,0];t.toScreen(s,t.center);const r=[0,0];return t.toScreen(r,this._declutterViewState.center),this._offsetFromScreenCenter[0]=s[0]-r[0],this._offsetFromScreenCenter[1]=s[1]-r[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(ht),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+Yt)*W)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}let Xt=class extends Le{_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}};const $=1e-6;function Ie(i,e){if(i){const t=i.getLayoutProperty("visibility");if(!t||t.getValue()!==Z.NONE&&(i.minzoom===void 0||i.minzoom=e-$))return!0}return!1}let Zt=class extends _t{constructor(i){super(i),this._backgroundTiles=[],this._computeDisplayInfoView(i)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(i,e,t,s){this._spriteMosaic=i,this._glyphMosaic=e,this._styleRepository=t,this.tileInfoView=s,this._computeDisplayInfoView(s),this._symbolFader==null&&(this._symbolFader=new jt(this._styleRepository,this.children)),this._symbolFader.styleRepository=t}setSpriteMosaic(i){this._spriteMosaic?.dispose(),this._spriteMosaic=i}deleteStyleLayers(i){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(i)}createRenderParams(i){return{...super.createRenderParams(i),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(i){!this.visible||i.drawPhase!==N.MAP&&i.drawPhase!==N.DEBUG||this._spriteMosaic===void 0||super.doRender(i)}addChild(i){return super.addChild(i),this._symbolFader!=null?this._symbolFader.addTile(i):i.decluttered=!0,this.requestRender(),i}removeChild(i){return this._symbolFader!=null&&this._symbolFader.removeTile(i),this.requestRender(),super.removeChild(i)}renderChildren(i){const{drawPhase:e}=i;e!==N.DEBUG?this._doRender(i):super.renderChildren(i)}removeAllChildren(){for(let i=0;ii.neededForCoverage&&i.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(i){const{context:e,state:t}=i,s=this._styleRepository;if(!s)return;const r=s.layers,o=this._displayInfo.scaleToZoom(t.scale);s.backgroundBucketIds.length>0&&(i.renderPass="background",this._renderBackgroundLayers(i,s.backgroundBucketIds,o)),super.renderChildren(i),i.drawPhase===N.MAP&&this._fade(o,t);const n=this.children.filter(a=>a.visible&&a.hasData());if(!n||n.length===0)return e.bindVAO(),e.setStencilTestEnabled(!0),void e.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;e.setStencilWriteMask(0),e.setColorMask(!0,!0,!0,!0),e.setStencilOp(O.KEEP,O.KEEP,O.REPLACE),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setDepthTestEnabled(!0),e.setDepthWriteEnabled(!0),e.setDepthFunction(ce.LEQUAL),e.setClearDepth(1),e.clear(e.gl.DEPTH_BUFFER_BIT),i.renderPass="opaque";for(let a=r.length-1;a>=0;a--)this._renderStyleLayer(r[a],i,n);e.setDepthWriteEnabled(!1),e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),i.renderPass="translucent";for(let a=0;ah.decluttered):t.filter(h=>h.neededForCoverage),a!=="vtlSymbol"&&(t.length===0||i.minzoom!==void 0&&i.minzoom>=s+$||i.maxzoom!==void 0&&i.maxzoom{const t=i.vtlSymbol.sourceTile,s=e.vtlSymbol.sourceTile;return t.level!==s.level?t.level-s.level:t.row!==s.row?t.row-s.row:t.col!==s.col?t.col-s.col:i.styleLayerUID-e.styleLayerUID};class ee{constructor(e,t,s,r,o){this.tileKey=e,this._tileLayerData=t,this._styleRepository=s,this._tileHandler=r,this._parentLayer=o,this._index=null,this._tileKeyToPBF=new Map}static create(e,t,s,r,o){return new ee(e,t,s,r,o)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,s,r,o){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new pt(100,is),await this._indexLayers());const n=[];return this._queryIndex(n,e,t,s,this.tileKey.level,r),o&&o?.length>0&&await this._getSymbolsAttributes(n,o),n}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,s=await this._getTilePayload(e);for(const[r,o]of this._tileLayerData){const n=t[r],a=s.find(y=>y.sourceName===n.source);if(!a)continue;const{protobuff:l,key:h}=a;if(o.type!==R.SYMBOL){const y=1<=10*y||re&&re<=10*h)continue;const v=e.getFeatureInflatedBounds(q,h,_.extent,S);v==null||v[0]>b||v[1]>x||v[2]u.sourceName===a.source),l&&this._addSymbolsAttributes(e,t.slice(h.from,h.to).map(u=>u.vtlSymbol),r,l)}return e}_addSymbolsAttributes(e,t,s,r){const o=this._styleRepository.layers,n=r.key,a=this.tileKey,l=1<{const{attributes:d,tilePoint:c}=u;e.push({layerId:o[s].id,layerIndex:s,graphic:new le({attributes:d,origin:{type:"vector-tile",layerId:o[s].id,layerIndex:s,layer:this._parentLayer}}),tilePoint:c})})}_getSymbolAttributes(e,t,s,r,o,n){const a=[],l=this._styleRepository.layers;let h=0;t.sort((u,d)=>u.featureIndex-d.featureIndex);const y=new X(new Uint8Array(e),new DataView(e));for(;y.next();)switch(y.tag()){case 3:{const u=y.getMessage(),d=new ye(u);if(u.release(),d.name!==l[s].sourceLayer)continue;const c=d.getData(),_=d.extent/r,p=Te/_,f=_*n,g=_*o;let m=0;for(;c.nextTag(2);){const b=c.getMessage();if(m++===t[h].featureIndex){const x=new de(b,d),S=x.values,w=x.getGeometry(),T=w!=null?[p*(w[0][0].x-f),p*(w[0][0].y-g)]:null;a.push({attributes:S,tilePoint:T}),h++}if(b.release(),h===t.length)return a}break}default:y.skip()}return a}_queryIndex(e,t,s,r,o,n){const a=es*r*(window.devicePixelRatio||1);return this._index?.search({minX:t-a,minY:s-a,maxX:t+a,maxY:s+a},l=>{const{layer:h,feature:y}=l;h.isIntersectingFeature(t,s,r,y,o,n,l)&&e.push({layerId:h.id,layerIndex:h.uid,tilePoint:null,graphic:new le({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return Je(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(t=>t)}}const is=i=>({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]});class ve extends tt{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const t=A.pool.acquire(e),s=t.level===0?null:A.getId(t.level-1,t.row>>1,t.col>>1,t.world);return A.pool.release(t),s}getTileCoverage(e,t,s=!0,r){const o=super.getTileCoverage(e,t,s,r);if(!o)return o;const n=1<a.row>=0&&a.rowt[0].scale)return t[0].level;let s,r;for(let o=0;or.scale)return s=t[o],s.level+(s.scale-e)/(s.scale-r.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(e[0].level===0)t=e.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}));else{const s=this.tileInfo.size[0],r=this.tileInfo.spatialReference;t=Oe.create({size:s,spatialReference:r}).lods.map(o=>({level:o.level,resolution:o.resolution,scale:o.scale}))}for(let s=0;su.tileKey.id===y.id)));return await Promise.all(l),h}update(i){if(this._tileHandlerPromise&&this._isTileHandlerReady)return i.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=i.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=i.state,this._parseQueue.state=i.state,this._tileManager.update(i)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:i}=this.layer.currentStyleInfo;this._styleRepository=new _e(i),this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Zt(this._tileInfoView),this._tileHandler=new It(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:I.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;const r=s.type===C.SYMBOL;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;this._styeChanged=!0;const r=Ge(s.layout,e.layout);if(r!=null){if(Ye(r,"visibility")&&rs(r)===1)return t.setLayoutProperties(e.layer,e.layout),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:I.LAYOUT_CHANGED,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);s&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:I.LAYER_CHANGED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:I.LAYER_REMOVED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:I.SPRITES_CHANGED,data:e});const t=this._styleRepository.layers;for(const s of t)switch(s.type){case C.SYMBOL:s.getLayoutProperty("icon-image")&&this._styleChanges.push({type:I.LAYOUT_CHANGED,data:{layer:s.id,layout:s.layout}});break;case C.LINE:s.getPaintProperty("line-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}});break;case C.FILL:s.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=V(this._vectorTileContainer),this._tileHandler=V(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(i){return Ve(this.layer.tileInfo?.spatialReference,i)}canResume(){let i=super.canResume();const{currentStyleInfo:e}=this.layer;if(i&&e?.layerDefinition){const t=this.view.scale,{minScale:s,maxScale:r}=e.layerDefinition;e?.layerDefinition&&(s&&st&&(i=!1))}return i}isUpdating(){return this.fading}acquireTile(i){const e=this._createVectorTile(i);return this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>this._parseQueue.push({key:e.key,data:t})).then(t=>{e.once("attach",()=>this.requestUpdate()),e.setData(t),this.requestUpdate()}).catch(t=>{j(t)||K.getLogger(this).error(t)})),e}releaseTile(i){const e=i.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const i=this._vectorTileContainer.children,e=[];try{for(const t of i){const s=this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(r=>this._parseQueue.push({key:t.key,data:r})).then(r=>t.setData(r)).finally(()=>t.featureIndex=null));e.push(s)}await Promise.all(e)}catch(t){K.getLogger(this).error("error refreshing vector-tiles layer-view",t),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new we({acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const i=new AbortController,e=this._tileHandler.start({signal:i.signal}).then(()=>{this._fetchQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._getTileData(t,s),concurrency:15,scheduler:this.scheduler,priority:pe.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._parseTileData(t,s),concurrency:8,scheduler:this.scheduler,priority:pe.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(t=>{this._vectorTileContainer.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=i,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const i=this._tileHandlerAbortController;i&&i.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=V(this._fetchQueue),this._parseQueue=V(this._parseQueue),this._tileManager=V(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(i,e){return this._tileHandler.fetchTileData(i,e)}async _parseTileData(i,e){return this._tileHandler.parseTileData(i,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const i=this._styleChanges;try{await this._tileHandler.updateStyle(i)}catch(o){K.getLogger(this).error("error applying vector-tiles style update",o.message),this._resumeQueues(),this._isTileHandlerReady=!0}const e=this._styleRepository,t=new Set;i.forEach(o=>{if(o.type!==I.LAYER_REMOVED)return;const n=o.data,a=e.getLayerById(n.layer);a&&t.add(a.uid)});const s=new Set;i.forEach(o=>{let n;switch(o.type){case I.PAINTER_CHANGED:e.setPaintProperties(o.data.layer,o.data.paint),n=o.data.layer;break;case I.LAYOUT_CHANGED:e.setLayoutProperties(o.data.layer,o.data.layout),n=o.data.layer;break;case I.LAYER_REMOVED:return void e.deleteStyleLayer(o.data.layer);case I.LAYER_CHANGED:e.setStyleLayer(o.data.layer,o.data.index),n=o.data.layer.id;break;case I.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(o.data.spriteSource))}if(n){const a=e.getLayerById(n);a&&s.add(a.uid)}});const r=this._vectorTileContainer.children;if(t.size>0){const o=Array.from(t);this._vectorTileContainer.deleteStyleLayers(o);for(const n of r)n.deleteLayerData(o)}if(this._resumeQueues(),s.size>0){const o=Array.from(s),n=[];for(const a of r){const l=this._updatingHandles.addPromise(this._fetchQueue.push(a.key).then(h=>this._parseQueue.push({key:a.key,data:h,styleLayerUIDs:o})).then(h=>a.setData(h)).finally(()=>a.featureIndex=null));n.push(l)}await Promise.all(n)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:i}=this.layer.currentStyleInfo,e=ze(i);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new _e(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:t}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(o){if(!j(o))throw o}if(t.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const s=await this._tileHandler.spriteMosaic,r=this._vectorTileContainer;this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),r.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new we({acquireTile:o=>this.acquireTile(o),releaseTile:o=>this.releaseTile(o),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(i){const e=this._tileInfoView.getTileBounds(H(),i),t=this._tileInfoView.getTileResolution(i.level);return new Ft(i,t,e[0],e[3],512,512,this._styleRepository)}async _queryTile(i,e,t,s,r,o){if(r.layerData.size===0)return;const n=this._ensureTileIndex(r),a=this._tileInfoView.getTileBounds(H(),r.key,!0),l=Ce*De*((e.x-a[0])/(a[2]-a[0])),h=Ce*De*(1-(e.y-a[1])/(a[3]-a[1])),y=await n.queryAttributes(l,h,t,s,o);for(const u of y)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),i.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:e.clone()});i.sort((u,d)=>d.graphic.origin.layerIndex-u.graphic.origin.layerIndex)}_tileToMapPoint(i,e){if(!i)return null;const t=i[0]*e[0]+i[1]*e[3]+e[6],s=i[0]*e[1]+i[1]*e[4]+e[7],r=this.view.state,o=[0,0];return r.toMap(o,[t,s]),new Fe({x:o[0],y:o[1],spatialReference:r.spatialReference})}_ensureTileIndex(i){let e=i.featureIndex;return e||(e=ee.create(i.key,i.layerData,this._styleRepository,this._tileHandler,this.layer),i.featureIndex=e),e}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function rs(i){if(i==null)return 0;switch(i.type){case"partial":return Object.keys(i.diff).length;case"complete":return Math.max(Object.keys(i.oldValue).length,Object.keys(i.newValue).length);case"collection":return Object.keys(i.added).length+Object.keys(i.changed).length+Object.keys(i.removed).length}}oe([He()],Q.prototype,"_isTileHandlerReady",void 0),Q=oe([qe("esri.views.2d.layers.VectorTileLayerView2D")],Q);const Bi=Q;export{Bi as default}; diff --git a/main/assets/VectorTileLayerView2D-B9OYHbL4-CpvgTk0s.js b/main/assets/VectorTileLayerView2D-B9OYHbL4-CpvgTk0s.js deleted file mode 100644 index 3c5462f2e..000000000 --- a/main/assets/VectorTileLayerView2D-B9OYHbL4-CpvgTk0s.js +++ /dev/null @@ -1 +0,0 @@ -import{aA as V,aC as Ve,aU as j,a1 as K,P as ze,bh as H,w as Fe,v as oe,S as He,i as qe,aW as Be,y as ne,bt as Ne,W as Qe,iF as ae,cS as We,ht as $e,bi as le,an as Je,f as Ke,hT as k,dF as he}from"./main-BZaw9FpY.js";import{P as Ge,g as Ye}from"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import{C as I,I as R}from"./enums-qHpGJ28Q-CmnLAccm.js";import{q as je}from"./workers-PiCjreoO-oGzLvkSt.js";import{a as P}from"./Rect-DD6XS68q-D_hsV3ag.js";import{D as O,L as ce,A as B,U as Xe,G as Me,n as D}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as Re,V as Pe}from"./Texture-BCt2hphT-D-X9O5uh.js";import{o as X}from"./pbf-D-y3_eZO-BOjQwfR-.js";import{k as Ze}from"./rasterizingUtils-BmlDdKBf-DQEZ-U2L.js";import{s as A}from"./TileKey-C5IL-JBr-0HJjsV9n.js";import{b as et}from"./LRUCache-C3erQTWv-CeYLuvL9.js";import{$ as ue,k as Ae,Q as tt}from"./Tile-D75RMC64-DprBAZDK.js";import{R as st,C as it,D as rt,G as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as z,E as N,c as nt}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{j as at,Q as lt}from"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import{r as M}from"./BufferObject-BM_7mcDb-QLZylgsX.js";import{c as U}from"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import{e as W,c as ht,t as ct}from"./config-nuMERBvb-MDUrh2eL.js";import{K as Le}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{V as Oe}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{o as ut}from"./signal-CETehA7D-vStzfbaY.js";import{p as C,a as Z,u as yt,n as L,i as dt}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{h as _t}from"./TileContainer-D48pXXgL-DNbVOEpu.js";import{N as pt}from"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import{g as ye,f as de}from"./SourceLayerData-BT_Ywuvg-BR7vjYvJ.js";import{a as _e,K as ft}from"./StyleRepository-D3WuVprR-COU4Jcir.js";import{X as gt,Y as mt}from"./LayerView-Bish-E63-DRGspiuk.js";import{n as bt}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import{i as pe}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./floatRGBA-4pIJN00G-DwTr03sX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";let F=class{constructor(i,e){this._width=0,this._height=0,this._free=[],this._width=i,this._height=e,this._free.push(new P(0,0,i,e))}get width(){return this._width}get height(){return this._height}allocate(i,e){if(i>this._width||e>this._height)return new P;let t=null,s=-1;for(let r=0;ri&&this._free.push(new P(t.x+i,t.y,t.width-i,e)),t.height>e&&this._free.push(new P(t.x,t.y+e,t.width,t.height-e))):(t.width>i&&this._free.push(new P(t.x+i,t.y,t.width-i,t.height)),t.height>e&&this._free.push(new P(t.x,t.y+e,i,t.height-e))),new P(t.x,t.y,i,e))}release(i){for(let e=0;e{const l=i+a;if(this._rangePromises.has(l))n.push(this._rangePromises.get(l));else{const h=s.getRange(i,a).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,h),n.push(h)}}),Promise.all(n).then(()=>{let a=this._glyphIndex[i];a||(a={},this._glyphIndex[i]=a);for(const l of e){const h=a[l];if(h){t[l]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:l};continue}const y=s.getGlyph(i,l);if(!y?.metrics)continue;const u=y.metrics;let d;if(u.width===0)d=new P(0,0,0,0);else{const c=u.width+6,_=u.height+2*3;let p=c%4?4-c%4:4,f=_%4?4-_%4:4;p===1&&(p=5),f===1&&(f=5),d=this._binPack.allocate(c+p,_+f),d.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new F(this.width-4,this.height-4),d=this._binPack.allocate(c+p,_+f));const g=this._glyphData[this._currentPage],m=y.bitmap;let b,x;if(m)for(let S=0;S<_;S++){b=c*S,x=this.width*(d.y+S+1)+d.x;for(let w=0;w{t.addRange(e,new G(new X(new Uint8Array(n.data),new DataView(n.data))))}).catch(()=>{t.addRange(e,new G)})}return t.addRange(e,new G),Promise.resolve()}getGlyph(i,e){const t=this._getFontStack(i);if(!t)return;const s=Math.floor(e/256),r=t.getRange(s);return r?{metrics:r.getMetrics(e),bitmap:r.getBitmap(e)}:void 0}_getFontStack(i){let e=this._glyphInfo[i];return e||(e=this._glyphInfo[i]=new wt),e}},St=class{constructor(i,e,t){this._array=i,this._start=e,this.length=t}at(i){return 0<=i&&i0&&(this._maxItemSize=s),this._binPack=new F(e-4,t-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new F(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight),r=new Uint32Array(t*s);this._mosaicsData[0]=r,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let s,r,o=this._mosaicRects[e];if(o)return o;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(xt)?([s,r]=this._rasterizeDash(e),t=!0):s=this._sprites.getSpriteInfo(e),!s?.width||!s.height||s.width<0||s.height<0))return null;const n=s.width,a=s.height,[l,h,y]=this._allocateImage(n,a);return l.width<=0?null:(this._copy(l,s,h,y,t,r),o={type:"sprite",rect:l,width:n,height:a,sdf:s.sdf,simplePattern:!1,rasterizationScale:s.pixelRatio,page:h},this._mosaicRects[e]=o,o)}getSpriteItems(e){const t={};for(const s of e)t[s.name]=this.getSpriteItem(s.name,s.repeat);return t}getMosaicItemPosition(e,t){const s=this.getSpriteItem(e,t),r=s?.rect;if(!r)return null;r.width=s.width,r.height=s.height;const o=s.width,n=s.height,a=2;return{tl:[r.x+a,r.y+a],br:[r.x+a+o,r.y+a+n],page:s.page}}bind(e,t,s=0,r=0){if(s>=this._size.length||s>=this._mosaicsData.length)return;if(!this._textures[s]){const n=new Re;n.wrapMode=Me.CLAMP_TO_EDGE,n.width=this._size[s][0],n.height=this._size[s][1],this._textures[s]=new Pe(e,n,new Uint8Array(this._mosaicsData[s].buffer))}const o=this._textures[s];o.setSamplingMode(t),this._dirties[s]&&o.setData(new Uint8Array(this._mosaicsData[s].buffer)),e.bindTexture(o,r),this._dirties[s]=!1}static _copyBits(e,t,s,r,o,n,a,l,h,y,u){let d=r*t+s,c=l*n+a;if(u){c-=n;for(let _=-1;_<=y;_++,d=((_+y)%y+r)*t+s,c+=n)for(let p=-1;p<=h;p++)o[c+p]=e[d+(p+h)%h]}else for(let _=0;_=this._mosaicsData.length)return;const a=new Uint32Array(n?n.buffer:this._sprites.image.buffer),l=this._mosaicsData[s],h=2,y=n?t.width:this._sprites.width;ke._copyBits(a,y,t.x,t.y,l,r[0],e.x+h,e.y+h,t.width,t.height,o),this._dirties[s]=!0}_allocateImage(e,t){e+=2,t+=2;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(i){this._requestSprite(i);const e=this._layer.currentStyleInfo.glyphsUrl,t=new ge(e?ne(e,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new fe(1024,1024,t),this._broadcastPromise=je("WorkerTileHandler",{client:this,schedule:i.schedule,signal:i.signal}).then(s=>{if(this._layer&&(this._connection?.close(),this._connection=s,this._layer&&!this._connection.closed)){const r=s.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},i);Promise.all(r).catch(o=>Ne(o))}})}_requestSprite(i){this._spriteSourceAbortController?.abort();const e=new AbortController;this._spriteSourceAbortController=e;const t=i?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=Tt(e),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:s}=e,r={...i,signal:s};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,r),this._spriteSourcePromise.then(o=>{Qe(s),this._spriteMosaic=new me(1024,1024,250),this._spriteMosaic.setSpriteSource(o)})}async updateStyle(i){const e=[];for(const t of i)t.type===I.SPRITES_CHANGED?e.push({type:I.SPRITES_CHANGED,data:{spriteSource:null}}):e.push(t);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(i){const e=new me(1024,1024,250);return e.setSpriteSource(i),this._spriteMosaic=e,this._spriteSourcePromise=Promise.resolve(i),this._spriteSourceAbortController=null,e}async setStyle(i,e,t){await this._broadcastPromise,this._styleRepository=i,this._sourceDataMaxLOD=t,this._requestSprite();const s=new ge(this._layer.currentStyleInfo.glyphsUrl?ne(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new fe(1024,1024,s),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:e,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(i,e){const t=await this._getRefKeys(i,e);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),t,e)}async fetchTilePBFs(i){const e=Object.keys(this._layer.sourceNameToSource),t={},s=await this._getRefKeys(i,t),r=[],o=[];for(let n=0;n{r.push({...h,key:a})}),o.push(l)}return Promise.all(o).then(()=>r)}async parseTileData(i,e){const t=i&&i.data;if(!t)return null;const{sourceName2DataAndRefKey:s,transferList:r}=t;return Object.keys(s).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:i.key.id,sourceName2DataAndRefKey:s,styleLayerUIDs:i.styleLayerUIDs},{...e,transferList:r}))}async getSprites(i){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(i)}getGlyphs(i){return this._glyphMosaic.getGlyphItems(i.font,i.codePoints)}async _getTilePayload(i,e,t){const s=A.pool.acquire(i.id),r=this._layer.sourceNameToSource[e],{level:o,row:n,col:a}=s;A.pool.release(s);try{return{protobuff:await r.requestTile(o,n,a,t),sourceName:e}}catch(l){if(j(l))throw l;return{protobuff:null,sourceName:e}}}async _getRefKeys(i,e){const t=this._layer.sourceNameToSource,s=new Array;for(const r in t){const o=t[r].getRefKey(i,e);s.push(o)}return ae(s)}_getSourcesData(i,e,t){const s=[];for(let r=0;r{const o={},n=[];for(let a=0;a0){const h=e[a].value.id;o[l.sourceName]={refKey:h,protobuff:l.protobuff},n.push(l.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:n}})}};function Tt(i){return()=>i.abort()}const be=512,vt=1e-6,Ct=(i,e)=>i+1/(1<<2*e);let we=class{constructor(i,e){this._tiles=new Map,this._tileCache=new et(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=i.acquireTile,this.releaseTile=i.releaseTile,this.tileInfoView=i.tileInfoView,this._container=e}destroy(){for(const i of this._tiles.values())i.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(i){this._updateCacheSize(i);const e=this.tileInfoView,t=e.getTileCoverage(i.state,0,!0,"smallest");if(!t)return!0;const{spans:s,lodInfo:r}=t,{level:o}=r,n=this._tiles,a=new Set,l=new Set;for(const{row:y,colFrom:u,colTo:d}of s)for(let c=u;c<=d;c++){const _=A.getId(o,y,r.normalizeCol(c),r.getWorldForColumn(c)),p=this._getOrAcquireTile(_);a.add(_),p.processed()?this._addToContainer(p):l.add(new A(_))}for(const[y,u]of n)u.isCoverage=a.has(y);for(const y of l)this._findPlaceholdersForMissingTiles(y,a);let h=!1;for(const[y,u]of n)u.neededForCoverage=a.has(y),u.neededForCoverage||u.isHoldingForFade&&e.intersects(t,u.key)&&a.add(y),u.isFading&&(h=!0);for(const y of this._tiles.keys())a.has(y)||this._releaseTile(y);return Ae.pool.release(t),!h}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(i,e,t,s,r){const o=[0,0],n=[0,0];s.toMap(o,i-t,e+t),s.toMap(n,i+t,e-t);const a=Math.min(o[0],n[0]),l=Math.min(o[1],n[1]),h=Math.max(o[0],n[0]),y=Math.max(o[1],n[1]),u=We(a,l,h,y),d=H(),c=[];for(const _ of this._visibleTiles.values())this.tileInfoView.getTileBounds(d,_.key),$e(u,d)&&c.push(_);if(r!=null&&r.length>0){const _=new Set(c.map(f=>f.id)),p=r.filter(f=>!_.has(f.tileKey.id)).map(f=>this._visibleTiles.get(f.tileKey.id)).filter(f=>f!==void 0);c.push(...p)}return c}_findPlaceholdersForMissingTiles(i,e){const t=[];for(const r of this._tiles.values())this._addPlaceholderChild(t,r,i,e);const s=t.reduce(Ct,0);Math.abs(1-s)0;){if(s--,r>>=1,o>>=1,t.level===s&&t.row===r&&t.col===o&&t.world===n)return!0;if(a.has(`${s}/${r}/${o}/${n}`))return!1}return!1}_updateCacheSize(i){const e=i.state.size;if(e[0]===this._viewSize[0]&&e[1]===this._viewSize[1])return;const t=Math.ceil(e[0]/be)+1,s=Math.ceil(e[1]/be)+1;this._viewSize[0]=e[0],this._viewSize[1]=e[1],this._tileCache.maxSize=5*t*s}};function Dt(i){const[e,t,s,r]=i.split("/"),o=parseInt(e,10);return o===0?null:`${o-1}/${parseInt(t,10)>>1}/${parseInt(s,10)>>1}/${parseInt(r,10)}`}function Mt(i,e){const t=e.level-i.level;return i.row===e.row>>t&&i.col===e.col>>t&&i.world===e.world}let Rt=class{constructor(i,e){this.sourceTile=e,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=i}};class Pt{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}}function Se(i,e,t,s,r,o){const n=t-r;if(n>=0)return(e>>n)+(s-(o<>n);const a=-n;return e-(o-(s<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.lineMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}};class Et extends J{constructor(e,t){super(e,t),this.type=R.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const s=new Uint32Array(e);let r=this.bufferDataOffset;this.fillIndexStart=s[r++],this.fillIndexCount=s[r++],this.outlineIndexStart=s[r++],this.outlineIndexCount=s[r++];const o=s[r++];if(o>0){this.patternMap=new Map;for(let n=0;n0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=k(this.fillVAO),this.outlineVAO=k(this.outlineVAO)}doPrepareForRendering(e,t,s){const r=new Uint32Array(t),o=new Int32Array(r.buffer),n=r[s++],a=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,n));s+=n;const l=r[s++],h=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,l));s+=l;const y=r[s++],u=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,y));s+=y;const d=r[s++],c=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,d));s+=d;const _=this.layer,p=_.fillMaterial,f=_.outlineMaterial;this.fillVAO=new U(e,p.getAttributeLocations(),p.getLayoutInfo(),new Map([["geometry",a]]),h),this.outlineVAO=new U(e,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",u]]),c)}}let Vt=class extends J{constructor(i,e,t){super(i,e),this.type=R.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const s=new Uint32Array(i),r=new Int32Array(i),o=new Float32Array(i);let n=this.bufferDataOffset;this.isIconSDF=!!s[n++];const a=s[n++],l=s[n++],h=s[n++],y=new A(a,l,h,0),u=s[n++];for(let p=0;p0||this.glyphPerPageElementsMap.size>0}triangleCount(){let i=0;for(const e of this.iconPerPageElementsMap.values())i+=e[1];for(const e of this.glyphPerPageElementsMap.values())i+=e[1];return i/3}doDestroy(){this.iconVAO=k(this.iconVAO),this.textVAO=k(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const i=this.iconOpacity,e=this.iconVAO.vertexBuffers.get("opacity");i.length>0&&i.byteLength===e.usedMemory&&e.setSubData(i,0,0,i.length);const t=this.textOpacity,s=this.textVAO.vertexBuffers.get("opacity");t.length>0&&t.byteLength===s.usedMemory&&s.setSubData(t,0,0,t.length)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=s[t++],y=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,h));t+=h;const u=s[t++],d=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,u));t+=u;const c=M.createVertex(i,D.STATIC_DRAW,this.iconOpacity.buffer),_=M.createVertex(i,D.STATIC_DRAW,this.textOpacity.buffer),p=this.layer,f=p.iconMaterial,g=p.textMaterial;this.iconVAO=new U(i,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",n],["opacity",c]]),l),this.textVAO=new U(i,g.getAttributeLocations(),g.getLayoutInfo(),new Map([["geometry",y],["opacity",_]]),d)}},zt=class extends J{constructor(i,e){super(i,e),this.type=R.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(i);let s=this.bufferDataOffset;this.circleIndexStart=t[s++],this.circleIndexCount=t[s++],this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.circleMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}},Ft=class Ee extends Le{constructor(e,t,s,r,o,n,a,l=null){super(e,t,s,r,o,n,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){this.status!=="unloaded"&&(Ee._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){--this._referenced==0&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,o=this._createRenderBuckets(s);if(r&&r.byteLength>0){const n=new Uint32Array(r);for(const a of n)this._deleteLayerData(a)}for(const[n,a]of o)this._deleteLayerData(n),a.type===R.SYMBOL&&(this.symbols.set(n,a.symbols),t=!0),this._usedMemory+=a.usedMemory,this.layerData.set(n,a);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===R.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(t){t.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),s=this.width/this.rangeX*t,r=this.height/this.rangeY*t,o=[0,0];e.toScreen(o,[this.x,this.y]);const n=this.transforms.tileUnitsToPixels;st(n),it(n,n,o),rt(n,n,Math.PI*e.rotation/180),ot(n,n,[s,r,1])}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z(),tileUnitsToPixels:z()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const o=this._deserializeBucket(r,s);for(const n of o.layerUIDs)t.set(n,o)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case R.FILL:s=new Et(e,this.styleRepository);break;case R.LINE:s=new Ut(e,this.styleRepository);break;case R.SYMBOL:s=new Vt(e,this.styleRepository,this);break;case R.CIRCLE:s=new zt(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}};function Ht(i,e,t,s,r,o){const{iconRotationAlignment:n,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:h,textTranslate:y,textTranslateAnchor:u}=s;let d=0;for(const c of i.colliders){const[_,p]=c.partIndex===0?l:y,f=c.partIndex===0?h:u,g=c.minLod<=o&&o<=c.maxLod;d+=g?0:1,c.enabled=g,c.xScreen=c.xTile*r[0]+c.yTile*r[3]+r[6],c.yScreen=c.xTile*r[1]+c.yTile*r[4]+r[7],f===dt.MAP?(c.xScreen+=t*_-e*p,c.yScreen+=e*_+t*p):(c.xScreen+=_,c.yScreen+=p),L.VIEWPORT===(c.partIndex===0?n:a)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=t*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+t*(c.dyPixels+c.height/2)-c.height/2)}i.colliders.length>0&&d===i.colliders.length&&(i.unique.show=!1)}class qt{constructor(e,t,s,r,o,n){this._symbols=e,this._styleRepository=r,this._zoom=o,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new Ue(t,s,ct),this._si=Math.sin(Math.PI*n/180),this._co=Math.cos(Math.PI*n/180);for(const a of e)for(const l of a.symbols)this._allNeededMatrices.has(l.tile)||this._allNeededMatrices.set(l.tile,nt(l.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function s(o){const n=o.xScreen+o.dxScreen,a=o.yScreen+o.dyScreen,l=n+o.width,h=a+o.height,[y,u,d,c]=t.getCellSpan(n,a,l,h);for(let _=u;_<=c;_++)for(let p=y;p<=d;p++){const f=t.cells[_][p];for(const g of f){const m=g.xScreen+g.dxScreen,b=g.yScreen+g.dyScreen,x=m+g.width,S=b+g.height;if(!(lx||hS))return!0}}return!1}const r=performance.now();for(;this._currentLayerCursore)return!1;const a=o.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Ht(a,this._si,this._co,n,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:h,iconIgnorePlacement:y,textAllowOverlap:u,textIgnorePlacement:d}=n;for(const c of a.colliders){if(!c.enabled)continue;const _=l.parts[c.partIndex];_.show&&!(c.partIndex?u:h)&&s(c)&&(c.hard?l.show=!1:_.show=!1)}if(l.show)for(const c of a.colliders){if(!c.enabled||(c.partIndex?d:y)||!l.parts[c.partIndex].show)continue;const _=c.xScreen+c.dxScreen,p=c.yScreen+c.dyScreen,f=_+c.width,g=p+c.height,[m,b,x,S]=this._gridIndex.getCellSpan(_,p,f,g);for(let w=b;w<=S;w++)for(let T=m;T<=x;T++)this._gridIndex.cells[w][T].push(c)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const s=this._zoom,r=this._styleRepository.getStyleLayerByUID(e),o=r.getLayoutValue("symbol-placement",s)!==yt.POINT;let n=r.getLayoutValue("icon-rotation-alignment",s);n===L.AUTO&&(n=o?L.MAP:L.VIEWPORT);let a=r.getLayoutValue("text-rotation-alignment",s);a===L.AUTO&&(a=o?L.MAP:L.VIEWPORT);const l=r.getPaintValue("icon-translate",s),h=r.getPaintValue("icon-translate-anchor",s),y=r.getPaintValue("text-translate",s),u=r.getPaintValue("text-translate-anchor",s),d={iconAllowOverlap:r.getLayoutValue("icon-allow-overlap",s),iconIgnorePlacement:r.getLayoutValue("icon-ignore-placement",s),textAllowOverlap:r.getLayoutValue("text-allow-overlap",s),textIgnorePlacement:r.getLayoutValue("text-ignore-placement",s),iconRotationAlignment:n,textRotationAlignment:a,iconTranslateAnchor:h,iconTranslate:l,textTranslateAnchor:u,textTranslate:y};return this._styleProps.set(e,d),d}}function Bt(i,e){if(i.priority-e.priority)return i.priority-e.priority;const t=i.tile.key,s=e.tile.key;return t.world-s.world?t.world-s.world:t.level-s.level?t.level-s.level:t.row-s.row?t.row-s.row:t.col-s.col?t.col-s.col:i.xTile-e.xTile?i.xTile-e.xTile:i.yTile-e.yTile}let Nt=class{get running(){return this._running}constructor(i,e,t,s,r,o){this._visibleTiles=i,this._symbolRepository=e,this._createCollisionJob=t,this._assignTileSymbolsOpacity=s,this._symbolLayerSorter=r,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(i,e){this._screenWidth===i&&this._screenHeight===e||this.restart(),this._screenWidth=i,this._screenHeight=e}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(i){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const e=performance.now();if(!this._selectionJob.work(i)||(this._selectionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const e=performance.now();if(!this._collisionJob.work(i)||(this._collisionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const e=performance.now();if(!this._opacityJob.work(i)||(this._opacityJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const i=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let c=null,_=!1,p=!1;for(const f of l.tileSymbols)if(!p||!_){const g=f.tile;(!c||g.isCoverage||g.neededForCoverage&&!_)&&(c=f,(g.neededForCoverage||g.isCoverage)&&(p=!0),g.isCoverage&&(_=!0))}if(c.selectedForRendering=!0,p){d.symbols.push(c),l.show=!0;for(const f of l.parts)f.show=!0}else l.show=!1}}for(const y of e)y.symbols.sort(Bt);return!0}const n=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return e.sort(n)}}}_createOpacityJob(){const i=this._assignTileSymbolsOpacity,e=this._visibleTiles;let t=0;function s(r,o){for(const n of r.symbols.values())Qt(n,o);i(r,o);for(const n of r.childrenTiles)s(n,o)}return{work(r){const o=performance.now();for(;tr)return!1;const n=e[t];n.parentTile==null&&s(n,performance.now())}return!0}}}};function Qt(i,e){for(const t of i){const s=t.unique;for(const r of s.parts){const o=r.targetOpacity>.5?1:-1;r.startOpacity+=o*((e-r.startTime)/W),r.startOpacity=Math.min(Math.max(r.startOpacity,0),1),r.startTime=e,r.targetOpacity=s.show&&r.show?1:0}}}const Wt=32,$t=8,Jt=64,Kt=20;class Gt{constructor(e,t,s){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=s,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,t){this._uniqueSymbolLayerArray=null;let s=this._tiles.get(e.id);s||(s={symbols:new Map},this._tiles.set(e.id,s));const r=new Map;if(t)for(const a of t)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));else for(const[a,l]of e.layerData)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));this._removeSymbols(r);const o=e.symbols,n=new Map;for(const[a,l]of o){let h=l.length;if(h>=Wt){let y=this.tileCoordRange;do y/=2,h/=4;while(h>$t&&y>Jt);const u=new Ue(this.tileCoordRange,this.tileCoordRange,y);n.set(a,{flat:l,index:u}),s.symbols.set(a,{flat:l,index:u});for(const d of l)u.getCell(d.xTile,d.yTile).push(d)}else n.set(a,{flat:l}),s.symbols.set(a,{flat:l})}this._addSymbols(e.key,o)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,s]of this._tiles){const r=new Map;for(const o of e)s.symbols.has(o)&&(r.set(o,s.symbols.get(o)),s.symbols.delete(o));this._removeSymbols(r),s.symbols.size===0&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const s=new Map;for(const[r,o]of e.symbols)t.symbols.has(r)&&(s.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(s),t.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,t,s,r){const o=[],n=this.uniqueSymbols;for(const a of n){const l=a.styleLayerUID,h=a.uniqueSymbols;for(const y of h){const u=y.tileSymbols.find(d=>d.selectedForRendering);u&&kt(u,e,t*(window.devicePixelRatio||1),s)&&o.push({vtlSymbol:u,styleLayerUID:l,tileKey:u.tile.key})}}return o}_removeSymbols(e){for(const[t,{flat:s}]of e)for(const r of s){const o=r.unique,n=o.tileSymbols,a=n.length-1;for(let l=0;lt.level){const o=e.key.level-t.level;if(e.key.row>>o!==t.row||e.key.col>>o!==t.col)return}if(t.level>e.key.level){const o=t.level-e.key.level;if(t.row>>o!==e.key.row||t.col>>o!==e.key.col)return}if(t.equals(e.key)){for(const o of e.childrenTiles)this._matchSymbols(o,t,s);return}const r=new Map;for(const[o,n]of s){const a=[];for(const u of n){const d=Se(this.tileCoordRange,u.xTile,t.level,t.col,e.key.level,e.key.col),c=Se(this.tileCoordRange,u.yTile,t.level,t.row,e.key.level,e.key.row);d>=0&&d=0&&c0&&r.set(o,l)}for(const o of e.childrenTiles)this._matchSymbols(o,t,r)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let s,r=0;for(const[o,n]of e){const a=new Array(n.size);s=0;for(const l of n)a[s++]=l;t[r]={styleLayerUID:o,uniqueSymbols:a},r++}return t}}const Yt=.5,xe=1e-6;class jt{constructor(e,t){this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=ut(!1),this._symbolRepository=new Gt(4096,t,()=>new Pt),this._symbolDeclutterer=new Nt(t,this._symbolRepository,(s,r,o)=>this._createCollisionJob(s,r,o),(s,r)=>{s.allSymbolsFadingOut=!0,s.lastOpacityUpdate=r,Lt(s,r,!0),s.decluttered=!0,s.requestRender()},(s,r)=>this.styleRepository.getStyleLayerByUID(s.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(r.styleLayerUID).z,s=>{const r=this.styleRepository.getStyleLayerByUID(s);if(this._zoom+xe=r.maxzoom)return!1;const o=r.getLayoutProperty("visibility");return!o||o.getValue()!==Z.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,t,s){return this.updateDecluttererViewState(),new qt(e,t,s,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]};const s=[0,0];t.toScreen(s,t.center);const r=[0,0];return t.toScreen(r,this._declutterViewState.center),this._offsetFromScreenCenter[0]=s[0]-r[0],this._offsetFromScreenCenter[1]=s[1]-r[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(ht),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+Yt)*W)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}let Xt=class extends Le{_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}};const $=1e-6;function Ie(i,e){if(i){const t=i.getLayoutProperty("visibility");if(!t||t.getValue()!==Z.NONE&&(i.minzoom===void 0||i.minzoom=e-$))return!0}return!1}let Zt=class extends _t{constructor(i){super(i),this._backgroundTiles=[],this._computeDisplayInfoView(i)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(i,e,t,s){this._spriteMosaic=i,this._glyphMosaic=e,this._styleRepository=t,this.tileInfoView=s,this._computeDisplayInfoView(s),this._symbolFader==null&&(this._symbolFader=new jt(this._styleRepository,this.children)),this._symbolFader.styleRepository=t}setSpriteMosaic(i){this._spriteMosaic?.dispose(),this._spriteMosaic=i}deleteStyleLayers(i){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(i)}createRenderParams(i){return{...super.createRenderParams(i),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(i){!this.visible||i.drawPhase!==N.MAP&&i.drawPhase!==N.DEBUG||this._spriteMosaic===void 0||super.doRender(i)}addChild(i){return super.addChild(i),this._symbolFader!=null?this._symbolFader.addTile(i):i.decluttered=!0,this.requestRender(),i}removeChild(i){return this._symbolFader!=null&&this._symbolFader.removeTile(i),this.requestRender(),super.removeChild(i)}renderChildren(i){const{drawPhase:e}=i;e!==N.DEBUG?this._doRender(i):super.renderChildren(i)}removeAllChildren(){for(let i=0;ii.neededForCoverage&&i.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(i){const{context:e,state:t}=i,s=this._styleRepository;if(!s)return;const r=s.layers,o=this._displayInfo.scaleToZoom(t.scale);s.backgroundBucketIds.length>0&&(i.renderPass="background",this._renderBackgroundLayers(i,s.backgroundBucketIds,o)),super.renderChildren(i),i.drawPhase===N.MAP&&this._fade(o,t);const n=this.children.filter(a=>a.visible&&a.hasData());if(!n||n.length===0)return e.bindVAO(),e.setStencilTestEnabled(!0),void e.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;e.setStencilWriteMask(0),e.setColorMask(!0,!0,!0,!0),e.setStencilOp(O.KEEP,O.KEEP,O.REPLACE),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setDepthTestEnabled(!0),e.setDepthWriteEnabled(!0),e.setDepthFunction(ce.LEQUAL),e.setClearDepth(1),e.clear(e.gl.DEPTH_BUFFER_BIT),i.renderPass="opaque";for(let a=r.length-1;a>=0;a--)this._renderStyleLayer(r[a],i,n);e.setDepthWriteEnabled(!1),e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),i.renderPass="translucent";for(let a=0;ah.decluttered):t.filter(h=>h.neededForCoverage),a!=="vtlSymbol"&&(t.length===0||i.minzoom!==void 0&&i.minzoom>=s+$||i.maxzoom!==void 0&&i.maxzoom{const t=i.vtlSymbol.sourceTile,s=e.vtlSymbol.sourceTile;return t.level!==s.level?t.level-s.level:t.row!==s.row?t.row-s.row:t.col!==s.col?t.col-s.col:i.styleLayerUID-e.styleLayerUID};class ee{constructor(e,t,s,r,o){this.tileKey=e,this._tileLayerData=t,this._styleRepository=s,this._tileHandler=r,this._parentLayer=o,this._index=null,this._tileKeyToPBF=new Map}static create(e,t,s,r,o){return new ee(e,t,s,r,o)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,s,r,o){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new pt(100,is),await this._indexLayers());const n=[];return this._queryIndex(n,e,t,s,this.tileKey.level,r),o&&o?.length>0&&await this._getSymbolsAttributes(n,o),n}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,s=await this._getTilePayload(e);for(const[r,o]of this._tileLayerData){const n=t[r],a=s.find(y=>y.sourceName===n.source);if(!a)continue;const{protobuff:l,key:h}=a;if(o.type!==R.SYMBOL){const y=1<=10*y||re&&re<=10*h)continue;const v=e.getFeatureInflatedBounds(q,h,_.extent,S);v==null||v[0]>b||v[1]>x||v[2]u.sourceName===a.source),l&&this._addSymbolsAttributes(e,t.slice(h.from,h.to).map(u=>u.vtlSymbol),r,l)}return e}_addSymbolsAttributes(e,t,s,r){const o=this._styleRepository.layers,n=r.key,a=this.tileKey,l=1<{const{attributes:d,tilePoint:c}=u;e.push({layerId:o[s].id,layerIndex:s,graphic:new le({attributes:d,origin:{type:"vector-tile",layerId:o[s].id,layerIndex:s,layer:this._parentLayer}}),tilePoint:c})})}_getSymbolAttributes(e,t,s,r,o,n){const a=[],l=this._styleRepository.layers;let h=0;t.sort((u,d)=>u.featureIndex-d.featureIndex);const y=new X(new Uint8Array(e),new DataView(e));for(;y.next();)switch(y.tag()){case 3:{const u=y.getMessage(),d=new ye(u);if(u.release(),d.name!==l[s].sourceLayer)continue;const c=d.getData(),_=d.extent/r,p=Te/_,f=_*n,g=_*o;let m=0;for(;c.nextTag(2);){const b=c.getMessage();if(m++===t[h].featureIndex){const x=new de(b,d),S=x.values,w=x.getGeometry(),T=w!=null?[p*(w[0][0].x-f),p*(w[0][0].y-g)]:null;a.push({attributes:S,tilePoint:T}),h++}if(b.release(),h===t.length)return a}break}default:y.skip()}return a}_queryIndex(e,t,s,r,o,n){const a=es*r*(window.devicePixelRatio||1);return this._index?.search({minX:t-a,minY:s-a,maxX:t+a,maxY:s+a},l=>{const{layer:h,feature:y}=l;h.isIntersectingFeature(t,s,r,y,o,n,l)&&e.push({layerId:h.id,layerIndex:h.uid,tilePoint:null,graphic:new le({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return Je(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(t=>t)}}const is=i=>({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]});class ve extends tt{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const t=A.pool.acquire(e),s=t.level===0?null:A.getId(t.level-1,t.row>>1,t.col>>1,t.world);return A.pool.release(t),s}getTileCoverage(e,t,s=!0,r){const o=super.getTileCoverage(e,t,s,r);if(!o)return o;const n=1<a.row>=0&&a.rowt[0].scale)return t[0].level;let s,r;for(let o=0;or.scale)return s=t[o],s.level+(s.scale-e)/(s.scale-r.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(e[0].level===0)t=e.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}));else{const s=this.tileInfo.size[0],r=this.tileInfo.spatialReference;t=Oe.create({size:s,spatialReference:r}).lods.map(o=>({level:o.level,resolution:o.resolution,scale:o.scale}))}for(let s=0;su.tileKey.id===y.id)));return await Promise.all(l),h}update(i){if(this._tileHandlerPromise&&this._isTileHandlerReady)return i.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=i.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=i.state,this._parseQueue.state=i.state,this._tileManager.update(i)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:i}=this.layer.currentStyleInfo;this._styleRepository=new _e(i),this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Zt(this._tileInfoView),this._tileHandler=new It(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:I.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;const r=s.type===C.SYMBOL;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;this._styeChanged=!0;const r=Ge(s.layout,e.layout);if(r!=null){if(Ye(r,"visibility")&&rs(r)===1)return t.setLayoutProperties(e.layer,e.layout),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:I.LAYOUT_CHANGED,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);s&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:I.LAYER_CHANGED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:I.LAYER_REMOVED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:I.SPRITES_CHANGED,data:e});const t=this._styleRepository.layers;for(const s of t)switch(s.type){case C.SYMBOL:s.getLayoutProperty("icon-image")&&this._styleChanges.push({type:I.LAYOUT_CHANGED,data:{layer:s.id,layout:s.layout}});break;case C.LINE:s.getPaintProperty("line-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}});break;case C.FILL:s.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=V(this._vectorTileContainer),this._tileHandler=V(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(i){return Ve(this.layer.tileInfo?.spatialReference,i)}canResume(){let i=super.canResume();const{currentStyleInfo:e}=this.layer;if(i&&e?.layerDefinition){const t=this.view.scale,{minScale:s,maxScale:r}=e.layerDefinition;e?.layerDefinition&&(s&&st&&(i=!1))}return i}isUpdating(){return this.fading}acquireTile(i){const e=this._createVectorTile(i);return this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>this._parseQueue.push({key:e.key,data:t})).then(t=>{e.once("attach",()=>this.requestUpdate()),e.setData(t),this.requestUpdate()}).catch(t=>{j(t)||K.getLogger(this).error(t)})),e}releaseTile(i){const e=i.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const i=this._vectorTileContainer.children,e=[];try{for(const t of i){const s=this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(r=>this._parseQueue.push({key:t.key,data:r})).then(r=>t.setData(r)).finally(()=>t.featureIndex=null));e.push(s)}await Promise.all(e)}catch(t){K.getLogger(this).error("error refreshing vector-tiles layer-view",t),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new we({acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const i=new AbortController,e=this._tileHandler.start({signal:i.signal}).then(()=>{this._fetchQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._getTileData(t,s),concurrency:15,scheduler:this.scheduler,priority:pe.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._parseTileData(t,s),concurrency:8,scheduler:this.scheduler,priority:pe.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(t=>{this._vectorTileContainer.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=i,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const i=this._tileHandlerAbortController;i&&i.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=V(this._fetchQueue),this._parseQueue=V(this._parseQueue),this._tileManager=V(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(i,e){return this._tileHandler.fetchTileData(i,e)}async _parseTileData(i,e){return this._tileHandler.parseTileData(i,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const i=this._styleChanges;try{await this._tileHandler.updateStyle(i)}catch(o){K.getLogger(this).error("error applying vector-tiles style update",o.message),this._resumeQueues(),this._isTileHandlerReady=!0}const e=this._styleRepository,t=new Set;i.forEach(o=>{if(o.type!==I.LAYER_REMOVED)return;const n=o.data,a=e.getLayerById(n.layer);a&&t.add(a.uid)});const s=new Set;i.forEach(o=>{let n;switch(o.type){case I.PAINTER_CHANGED:e.setPaintProperties(o.data.layer,o.data.paint),n=o.data.layer;break;case I.LAYOUT_CHANGED:e.setLayoutProperties(o.data.layer,o.data.layout),n=o.data.layer;break;case I.LAYER_REMOVED:return void e.deleteStyleLayer(o.data.layer);case I.LAYER_CHANGED:e.setStyleLayer(o.data.layer,o.data.index),n=o.data.layer.id;break;case I.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(o.data.spriteSource))}if(n){const a=e.getLayerById(n);a&&s.add(a.uid)}});const r=this._vectorTileContainer.children;if(t.size>0){const o=Array.from(t);this._vectorTileContainer.deleteStyleLayers(o);for(const n of r)n.deleteLayerData(o)}if(this._resumeQueues(),s.size>0){const o=Array.from(s),n=[];for(const a of r){const l=this._updatingHandles.addPromise(this._fetchQueue.push(a.key).then(h=>this._parseQueue.push({key:a.key,data:h,styleLayerUIDs:o})).then(h=>a.setData(h)).finally(()=>a.featureIndex=null));n.push(l)}await Promise.all(n)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:i}=this.layer.currentStyleInfo,e=ze(i);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new _e(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:t}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(o){if(!j(o))throw o}if(t.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const s=await this._tileHandler.spriteMosaic,r=this._vectorTileContainer;this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),r.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new we({acquireTile:o=>this.acquireTile(o),releaseTile:o=>this.releaseTile(o),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(i){const e=this._tileInfoView.getTileBounds(H(),i),t=this._tileInfoView.getTileResolution(i.level);return new Ft(i,t,e[0],e[3],512,512,this._styleRepository)}async _queryTile(i,e,t,s,r,o){if(r.layerData.size===0)return;const n=this._ensureTileIndex(r),a=this._tileInfoView.getTileBounds(H(),r.key,!0),l=Ce*De*((e.x-a[0])/(a[2]-a[0])),h=Ce*De*(1-(e.y-a[1])/(a[3]-a[1])),y=await n.queryAttributes(l,h,t,s,o);for(const u of y)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),i.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:e.clone()});i.sort((u,d)=>d.graphic.origin.layerIndex-u.graphic.origin.layerIndex)}_tileToMapPoint(i,e){if(!i)return null;const t=i[0]*e[0]+i[1]*e[3]+e[6],s=i[0]*e[1]+i[1]*e[4]+e[7],r=this.view.state,o=[0,0];return r.toMap(o,[t,s]),new Fe({x:o[0],y:o[1],spatialReference:r.spatialReference})}_ensureTileIndex(i){let e=i.featureIndex;return e||(e=ee.create(i.key,i.layerData,this._styleRepository,this._tileHandler,this.layer),i.featureIndex=e),e}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function rs(i){if(i==null)return 0;switch(i.type){case"partial":return Object.keys(i.diff).length;case"complete":return Math.max(Object.keys(i.oldValue).length,Object.keys(i.newValue).length);case"collection":return Object.keys(i.added).length+Object.keys(i.changed).length+Object.keys(i.removed).length}}oe([He()],Q.prototype,"_isTileHandlerReady",void 0),Q=oe([qe("esri.views.2d.layers.VectorTileLayerView2D")],Q);const Bi=Q;export{Bi as default}; diff --git a/main/assets/Version-CoKzbupV-BKAqCewj.js b/main/assets/Version-CoKzbupV-BKAqCewj.js new file mode 100644 index 000000000..ca641117d --- /dev/null +++ b/main/assets/Version-CoKzbupV-BKAqCewj.js @@ -0,0 +1 @@ +import{o as i}from"./main-C7yV2j71.js";let c=class n{constructor(t,e,o=""){this.major=t,this.minor=e,this._context=o}lessThan(t,e){return this.major_.getLogger("esri.views.webgl.VertexArrayObject");let g=class{constructor(t,e,i,r,s=null){this._context=t,this._locations=e,this._layout=i,this._buffers=r,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*u}dispose(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=a(this._indexBuffer),this.disposeVAOOnly()):(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&n().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(h.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:t}=this._context,e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e,this._context.instanceCounter.increment(h.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:i}=this;t||n().error("Vertex buffer dictionary is empty!");const r=this._context.gl;this._buffers.forEach((s,l)=>{const o=e.get(l);o?f(this._context,this._locations,s,o):n().error("Vertex element descriptor is empty!")}),i!=null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};export{g as c}; diff --git a/main/assets/VertexArrayObject-M4iRGGoi-DLhbl4qv.js b/main/assets/VertexArrayObject-M4iRGGoi-DLhbl4qv.js new file mode 100644 index 000000000..65e5a7683 --- /dev/null +++ b/main/assets/VertexArrayObject-M4iRGGoi-DLhbl4qv.js @@ -0,0 +1 @@ +import{iB as u,hT as a,a1 as _}from"./main-C7yV2j71.js";import{V as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as f}from"./Texture-BCt2hphT-CtQVMDnp.js";const n=()=>_.getLogger("esri.views.webgl.VertexArrayObject");let g=class{constructor(t,e,i,r,s=null){this._context=t,this._locations=e,this._layout=i,this._buffers=r,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*u}dispose(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=a(this._indexBuffer),this.disposeVAOOnly()):(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&n().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(h.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:t}=this._context,e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e,this._context.instanceCounter.increment(h.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:i}=this;t||n().error("Vertex buffer dictionary is empty!");const r=this._context.gl;this._buffers.forEach((s,l)=>{const o=e.get(l);o?f(this._context,this._locations,s,o):n().error("Vertex element descriptor is empty!")}),i!=null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};export{g as c}; diff --git a/main/assets/VideoLayer-Dxs-NJSn-DBh0bJWU.js b/main/assets/VideoLayer-Dxs-NJSn-DBh0bJWU.js new file mode 100644 index 000000000..0e7df7786 --- /dev/null +++ b/main/assets/VideoLayer-Dxs-NJSn-DBh0bJWU.js @@ -0,0 +1,204 @@ +import{aa as Ln,v as K,S as Z,i as Ds,w as Jt,l as On,m as rn,a0 as gi,ac as io,J as Zr,ah as nn,aL as xd,ae as kd,o as Vl,f as ro,n as zl,e as Nn,j as Lo,jZ as eg,dY as Wl,hZ as ni,a1 as tg,ai as sg,dU as ga}from"./main-C7yV2j71.js";import{m as ig}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as rg}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as ng}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as ag}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{S as og}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{i as lg}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{Z as ug}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{q as hg}from"./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js";import{a as Dd}from"./TelemetryDisplay-Bq2PXfI8-8bnvuClQ.js";import{o as dg,n as Gl}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{E as cg,V as pg}from"./mat3-CC4Foazl-BWjyqE2v.js";import{y as fa,N as mg,r as gg,Z as Xl}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{m as ya}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import{n as Yl}from"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import{t as vr,l as an}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";let Es=class extends Ln(Nn){constructor(s){super(s),this.framerate=null,this.containerFormat=null,this.gop=null,this.aspectRatio=null,this.klv=null}};K([Z({type:String})],Es.prototype,"framerate",void 0),K([Z({type:String})],Es.prototype,"containerFormat",void 0),K([Z({type:Number})],Es.prototype,"gop",void 0),K([Z({type:String})],Es.prototype,"aspectRatio",void 0),K([Z({type:Object})],Es.prototype,"klv",void 0),Es=K([Ds("esri.layers.support.PlaybackInfo")],Es);const fg=Es;let Cs=class extends Ln(Nn){constructor(s){super(s),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};K([Z({type:Jt})],Cs.prototype,"frameCenter",void 0),K([Z({type:On})],Cs.prototype,"frameOutline",void 0),K([Z({type:rn})],Cs.prototype,"lineOfSight",void 0),K([Z({type:Jt})],Cs.prototype,"sensorLocation",void 0),K([Z({type:rn})],Cs.prototype,"sensorTrail",void 0),Cs=K([Ds("esri.layers.support.TelemetryData")],Cs);const no=Cs;let rr=class extends Lo{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};function yg(s){return s?.sourcePoint!=null&&s.mapPoint!=null}K([Z()],rr.prototype,"sourcePoint",void 0),K([Z({type:Jt})],rr.prototype,"mapPoint",void 0),rr=K([Ds("esri.layers.support.VideoFrame.ControlPoint")],rr);let Fs=class extends Ln(Nn){constructor(s){super(s),this.frame=null,this.controlPoints=null}readControlPoints(s){return s.map(e=>({sourcePoint:{x:e.frameX,y:e.frameY},mapPoint:new Jt(e.point)}))}writeControlPoints(s,e){s!=null&&yg(s[0])&&(e.controlPoints=s.map(t=>{const i=t.sourcePoint,r=t.mapPoint;return{frameX:i.x,frameY:i.y,point:r.toJSON()}}))}};K([Z({type:String})],Fs.prototype,"frame",void 0),K([Z({type:[rr],json:{write:{allowNull:!1,isRequired:!0}}})],Fs.prototype,"controlPoints",void 0),K([gi("controlPoints")],Fs.prototype,"readControlPoints",null),K([io("controlPoints")],Fs.prototype,"writeControlPoints",null),Fs=K([Ds("esri.layers.support.VideoFrame")],Fs);const _g=Fs;let ui=class extends EventTarget{constructor(){super(...arguments),this._readyState=0,this._responseType="",this.timeout=0,this._withCredentials=!1,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.onreadystatechange=null,this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this._abortController=null,this._error=null,this._options={},this._response=null,this._sendFlag=!1,this._url=""}get readyState(){return this._readyState}get response(){return this.responseType===""||this.responseType==="text"?this.responseText:this.readyState!==this.DONE||this._error||!this._response?null:this._response.data}get responseText(){return this.responseType!==""&&this.responseType!=="text"&&this._throwDOMException(),this.readyState!==this.DONE?"":this._response?this._response.data:this._error?.raw!=null?typeof this._error.raw=="string"?this._error.raw:JSON.stringify(this._error.raw):""}get responseType(){return this._responseType}set responseType(s){(s!=="document"||globalThis instanceof Window)&&(this.readyState!==this.LOADING&&this.readyState!==this.DONE||this._throwDOMException(),this._responseType=s)}get responseURL(){return(this._response||this._error)?.url??""}get responseXML(){return this.responseType!==""&&this.responseType!=="document"&&this._throwDOMException(),this.readyState!==this.DONE?null:this._response?.data??null}get status(){return(this._response||this._error)?.httpStatus??0}get statusText(){return""}get upload(){return console.warn("upload not implemented"),null}get withCredentials(){return this._withCredentials}set withCredentials(s){this.readyState!==this.UNSENT&&this.readyState!==this.OPENED&&this._throwDOMException(),this._withCredentials=s}abort(){this.readyState===this.OPENED&&this._sendFlag||this.readyState===this.HEADERS_RECEIVED||this.readyState===this.LOADING?(this._sendFlag=!1,this._error=null,this._response=null,this._abortController?.abort(),this._updateReadyState(this.DONE),this._dispatchProgressEvent("abort"),this._dispatchProgressEvent("loadend")):this.readyState===this.DONE&&this._updateReadyState(this.UNSENT)}getAllResponseHeaders(){let s="";const e=(this._response||this._error)?.getAllHeaders?.();if(e)for(const[t,i]of e)s+=`${t}: ${i}\r +`;return s}getResponseHeader(s){return(this._response||this._error)?.getHeader?.(s)??null}open(s,e){switch(this._sendFlag=!1,this._options={},s){case"GET":this._options.method="auto";break;case"POST":this._options.method="post";break;case"HEAD":this._options.method="head";break;case"DELETE":this._options.method="delete";break;case"PUT":this._options.method="put"}this._url=e,this._error=null,this._response=null,this._abortController=new AbortController,this._updateReadyState(this.OPENED)}overrideMimeType(s){throw new Error("overrideMimeType not implemented")}send(s){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._sendFlag=!0,this._updateReadyState(this.LOADING),this._dispatchProgressEvent("loadstart");const e=this._options;s instanceof URLSearchParams?e.body=s.toString():e.body=s,e.responseType=this.responseType===""?"text":this.responseType==="arraybuffer"?"array-buffer":this.responseType,e.signal=this._abortController?.signal,this.timeout&&(e.timeout=this.timeout),this.withCredentials&&(e.withCredentials=!0),ro(this._url,e).then(t=>{this._response=t,this._updateReadyState(this.DONE),this._dispatchProgressEvent("load")}).catch(t=>{this._sendFlag&&(this._error=t.details,this._updateReadyState(this.DONE),eg(t)?this._dispatchProgressEvent("timeout"):t.name==="AbortError"?this._dispatchProgressEvent("abort"):this._dispatchProgressEvent("error"))}).finally(()=>{this._sendFlag&&this._dispatchProgressEvent("loadend")})}setRequestHeader(s,e){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._options.headers??={},this._options.headers[s]=e}_dispatchProgressEvent(s){const e=new ProgressEvent(s,{loaded:0,total:0});this.dispatchEvent(e),this[`on${s}`]?.(e)}_throwDOMException(){throw new DOMException("","InvalidStateError")}_updateReadyState(s){if(this._readyState!==s&&(this._readyState=s,s!==this.UNSENT)){const e=new Event("readystatechange");this.dispatchEvent(e),this.onreadystatechange?.(e)}}};ui.UNSENT=0,ui.OPENED=1,ui.HEADERS_RECEIVED=2,ui.LOADING=3,ui.DONE=4;let Bt=class extends Ln(Nn){constructor(s){super(s),this.duration=null,this.end=null,this.start=null,this.timezone="UTC"}readEnd(s,e){return e.end!=null?new Date(e.end):null}writeEnd(s,e){e.end=s?s.getTime():null}readStart(s,e){return e.start!=null?new Date(e.start):null}writeStart(s,e){e.start=s?s.getTime():null}};K([Z({type:Number,json:{write:{allowNull:!0}}})],Bt.prototype,"duration",void 0),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"end",void 0),K([gi("end")],Bt.prototype,"readEnd",null),K([io("end")],Bt.prototype,"writeEnd",null),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"start",void 0),K([gi("start")],Bt.prototype,"readStart",null),K([io("start")],Bt.prototype,"writeStart",null),K([Z({type:String})],Bt.prototype,"timezone",void 0),Bt=K([Ds("esri.layers.support.VideoTimeExtent")],Bt);const vg=Bt,_a="application/x-mpegURL",bg="video/mp4",ne={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function Tg(s){const{duration:e,end:t,start:i,timezone:r="UTC"}=s||{};return typeof e!="number"?null:new vg({duration:e||null,end:typeof t=="number"?new Date(t):null,start:typeof i=="number"?new Date(i):null,timezone:r})}function Sg(s,e){const t=[...e],i=t.findIndex(r=>r.equals(s));return i>-1&&t.splice(i),t.push(s),t}function Eg(s){if(!s?.size)return new no;const e=Rg(s),t=Ag(s),i=Pg(s),r=Ng(e,t);return new no({frameCenter:t,frameOutline:i,lineOfSight:r,sensorLocation:e})}function Cg(s){return s?.size?s.get(ne.EsriGroundControlPoints)?.value??null??null:null}function wg(s){return s?.size?s.get(ne.EsriHorizonPixelPack)?.value??null:null}function Ag(s){return Dg(s)??Ig(s)}function xg(s){if(!s)return _a;let e="";const t=new RegExp(/\.(\w{3,4})(?:$|\?)/i),i=s?s.match(t):[];return i?.length?(e=i[0],e.toLowerCase().replaceAll(".","")==="mp4"?bg:_a):_a}function kg(s){const e=s?.layers;return e?.length?e.map(t=>({layerId:t.id,posterUrl:t.poster,sourceType:t.serviceType,title:t.name,type:t.type||"Video Layer"})):[]}function Dg(s){return s&&s.has(ne.EsriFrameCenterLatitude)&&s.has(ne.EsriFrameCenterLongitude)?new Jt({x:s.get(ne.EsriFrameCenterLongitude).value,y:s.get(ne.EsriFrameCenterLatitude).value,z:s.get(ne.FrameCenterElevation).value}):null}function Ig(s){return s&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)?new Jt({x:s.get(ne.FrameCenterLongitude)?.value,y:s.get(ne.FrameCenterLatitude)?.value,z:s.get(ne.FrameCenterElevation)?.value}):null}function Pg(s){if(!s)return null;const e=s.get(ne.EsriFrameOutline)?.value;return e?On.fromJSON(e.geometry):Lg(s)??Og(s)}function Lg(s){if(!(s.has(ne.EsriCornerLatitudePt1)&&s.has(ne.EsriCornerLongitudePt1)&&s.has(ne.EsriCornerLatitudePt2)&&s.has(ne.EsriCornerLongitudePt2)&&s.has(ne.EsriCornerLatitudePt3)&&s.has(ne.EsriCornerLongitudePt3)&&s.has(ne.EsriCornerLatitudePt4)&&s.has(ne.EsriCornerLongitudePt4)))return null;const e=[s.get(ne.EsriCornerLongitudePt1)?.value,s.get(ne.EsriCornerLatitudePt1)?.value],t=[s.get(ne.EsriCornerLongitudePt2)?.value,s.get(ne.EsriCornerLatitudePt2)?.value],i=[s.get(ne.EsriCornerLongitudePt3)?.value,s.get(ne.EsriCornerLatitudePt3)?.value],r=[s.get(ne.EsriCornerLongitudePt4)?.value,s.get(ne.EsriCornerLatitudePt4)?.value];return new On({rings:[[e,t,i,r]]})}function Og(s){if(!(s.has(ne.OffsetCorner1Latitude)&&s.has(ne.OffsetCorner1Longitude)&&s.has(ne.OffsetCorner2Latitude)&&s.has(ne.OffsetCorner2Longitude)&&s.has(ne.OffsetCorner3Latitude)&&s.has(ne.OffsetCorner3Longitude)&&s.has(ne.OffsetCorner4Latitude)&&s.has(ne.OffsetCorner4Longitude)&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)))return null;const e=s.get(ne.FrameCenterLatitude)?.value,t=s.get(ne.FrameCenterLongitude)?.value,i=e+s.get(ne.OffsetCorner1Latitude)?.value,r=t+s.get(ne.OffsetCorner1Longitude)?.value,n=e+s.get(ne.OffsetCorner2Latitude)?.value,a=t+s.get(ne.OffsetCorner2Longitude)?.value,l=e+s.get(ne.OffsetCorner3Latitude)?.value,h=t+s.get(ne.OffsetCorner3Longitude)?.value,p=e+s.get(ne.OffsetCorner4Latitude)?.value,g=t+s.get(ne.OffsetCorner4Longitude)?.value;return new On({rings:[[[r,i],[a,n],[h,l],[g,p]]]})}function Ng(s,e){if(!s||!e)return null;const t=[s.x,s.y,s.z??0],i=[e.x,e.y,e.z??0];return new rn({paths:[[t,i]]})}function Rg(s){if(!s?.size)return null;if(s.has(ne.EsriSensorPosition)){const e=s.get(ne.EsriSensorPosition)?.value;if(e)return Jt.fromJSON(e.geometry)}return s.has(ne.SensorLongitude)&&s.has(ne.SensorLatitude)&&s.has(ne.SensorTrueAltitude)?new Jt({x:s.get(ne.SensorLongitude)?.value,y:s.get(ne.SensorLatitude)?.value,z:s.get(ne.SensorTrueAltitude)?.value}):null}const ft=Math.PI/180;let Qe=class extends Lo{constructor(s){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const i=t[0],r=t[1],n=t[2];return dg(i[0],r[0],n[0],i[1],r[1],n[1],i[2],r[2],n[2])},this._multiplyMat3=(t,i)=>{const r=Gl();return cg(r,t,i),r},this._transposeMat3=t=>{const i=Gl();return pg(i,t),i},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*ft),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*ft)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*ft,this.sensorPitchAngle*ft,this.sensorRollAngle*ft),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*ft),i=Math.cos(this.sensorLatitude*ft),r=Math.sin(this.sensorLongitude*ft),n=Math.cos(this.sensorLongitude*ft);return this._createMat3FromValues([[-t*n,-r,-i*n],[-t*r,n,-i*r],[i,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*ft,this.platformPitchAngle*ft,this.platformRollAngle*ft),this._extractValues=t=>{this.imageWidth=t.get(ne.EsriVideoWidth)?.value,this.imageHeight=t.get(ne.EsriVideoHeight)?.value;const i=t.get(ne.SensorEllipsoidHeight)?.value;this.sensorAltitude=i??t.get(ne.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(ne.SensorLatitude)?.value,this.sensorLongitude=t.get(ne.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(ne.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(ne.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(ne.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(ne.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(ne.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(ne.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(ne.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(ne.PlatformRollAngle)?.value,this.averageElevation=t.get(ne.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,i,r)=>{const n=Math.cos(t),a=Math.sin(t),l=Math.cos(i),h=Math.sin(i),p=Math.cos(r),g=Math.sin(r);return this._createMat3FromValues([[n*l,n*h*g-p*a,a*g+n*p*h],[l*a,n*p+a*h*g,p*a*h-n*g],[-h,l*g,l*p]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),i=this._calculateCameraFovReverse(),r=this._calculateCameraLook(),n=this._calculateImageDimensionsForward(),a=this._calculateImageDimensionsReverse(),l=this._calculatePlatformPositionMatrix(),h=this._calculatePlatformOrientation(),p=this._multiplyMat3(this._multiplyMat3(l,h),r);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(p,t),n);const g=this._multiplyMat3(a,i);this._earthToImageTransform=this._multiplyMat3(g,this._transposeMat3(p)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const i=t.get(ne.EsriVideoWidth)?.value??0,r=t.get(ne.EsriVideoHeight)?.value??0;if(i<=0||r<=0)return!1;const n=t.get(ne.SensorEllipsoidHeight)?.value,a=t.get(ne.SensorTrueAltitude)?.value,l=t.get(ne.SensorLatitude)?.value,h=t.get(ne.SensorLongitude)?.value;if(n==null&&a==null||l==null||h==null)return!1;const p=t.get(ne.PlatformHeadingAngle)?.value,g=t.get(ne.PlatformPitchAngle)?.value,y=t.get(ne.PlatformRollAngle)?.value;if(p==null||g==null||y==null)return!1;const w=t.get(ne.SensorHorizontalFOV)?.value,E=t.get(ne.SensorVerticalFOV)?.value;if(w==null||E==null)return!1;const I=t.get(ne.SensorAzimuthAngle)?.value,v=t.get(ne.SensorElevationAngle)?.value,L=t.get(ne.SensorRollAngle)?.value;return I!=null&&v!=null&&L!=null},this._projectPointToECEF=(t,i,r)=>{const n=[];return Yl([t,i,r],Zr.WGS84,0,n,ya,0),new Jt({x:n[0],y:n[1],z:n[2],spatialReference:ya})},this._projectImageVectorToEllipsoid=(t,i)=>{const r=Wl.semiMajorAxis+i,n=Wl.semiMinorAxis+i,a=n/r,l=r/n,{x:h,y:p,z:g}=this._platformPositionEcef,y=g??this.averageElevation,w=ni(h,p,l*y),E=fa(t,t),I=fa(t,w),v=fa(w,w)-r*r,L=(-I-Math.sqrt(I*I-E*v))/E;if(L<0)return[NaN,NaN,NaN];const R=ga();return mg(R,w,t,L),R[2]=R[2]*a,R};const e=s?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(s,e,t){const i=this._platformPositionEcef;if(!i)return[0,0];const{x:r,y:n,z:a}=i,l=ni(r,n,a),h=this._projectPointToECEF(s,e,t||this.averageElevation),p=ga(),g=ni(h.x,h.y,h.z);gg(p,g,l),Xl(p,p,this._earthToImageTransform);const y=p[0],w=p[1],E=p[2];let I=ni(NaN,NaN,NaN);return isNaN(E)||(I=ni(y/E,w/E,E/E)),[I[0],I[1]]}transformImageToGeo(s,e){const t=ni(s,e,1),i=ga();Xl(i,t,this._imageToEarthTransform);const r=this._projectImageVectorToEllipsoid(i,this.averageElevation);let n;if(!isNaN(r[0])){const a=[];Yl([r[0],r[1],r[2]],ya,0,a,Zr.WGS84,0),n=new Jt({x:a[0],y:a[1],z:a[2],spatialReference:Zr.WGS84})}return n}};K([Z()],Qe.prototype,"averageElevation",void 0),K([Z()],Qe.prototype,"imageHeight",void 0),K([Z()],Qe.prototype,"imageWidth",void 0),K([Z({readOnly:!0})],Qe.prototype,"metadataSupportsTransforms",void 0),K([Z()],Qe.prototype,"platformHeadingAngle",void 0),K([Z()],Qe.prototype,"platformPitchAngle",void 0),K([Z()],Qe.prototype,"platformRollAngle",void 0),K([Z()],Qe.prototype,"sensorHeadingAngle",void 0),K([Z()],Qe.prototype,"sensorAltitude",void 0),K([Z()],Qe.prototype,"sensorHorizontalFieldOfView",void 0),K([Z()],Qe.prototype,"sensorLatitude",void 0),K([Z()],Qe.prototype,"sensorLongitude",void 0),K([Z()],Qe.prototype,"sensorPitchAngle",void 0),K([Z()],Qe.prototype,"sensorRollAngle",void 0),K([Z()],Qe.prototype,"sensorVerticalFieldOfView",void 0),K([Z()],Qe.prototype,"vttMetadata",void 0),Qe=K([Ds("esri.layers.video.VideoCameraSensorModel")],Qe);const Mg=Qe;var Kl,Ql;function Rn(){return Ql?Kl:(Ql=1,s=typeof window<"u"?window:an!==void 0?an:typeof self<"u"?self:{},Kl=s);var s}const k=vr(Rn());var Jl,Zl,va,eu,ba,tu,su,iu,ru,nu,au,ou,lu,uu,Ta,hu,Sa,du,Ea,cu,Ca,pu,mu,gu,fu,yu;function Id(){if(Zl)return Jl;Zl=1;var s=Array.prototype.slice;function e(t,i){for(("length"in t)||(t=[t]),t=s.call(t);t.length;){var r=t.shift(),n=i(r);if(n)return n;r.childNodes&&r.childNodes.length&&(t=s.call(r.childNodes).concat(t))}}return Jl=e}function Bg(){if(eu)return va;function s(e,t){if(!(this instanceof s))return new s(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}return eu=1,va=s,s.prototype.nodeType=8,s.prototype.nodeName="#comment",s.prototype.toString=function(){return"[object Comment]"},va}function Fg(){if(tu)return ba;function s(e,t){if(!(this instanceof s))return new s(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}return tu=1,ba=s,s.prototype.type="DOMTextNode",s.prototype.nodeType=3,s.prototype.nodeName="#text",s.prototype.toString=function(){return this.data},s.prototype.replaceData=function(e,t,i){var r=this.data,n=r.substring(0,e),a=r.substring(e+t,r.length);this.data=n+i+a,this.length=this.data.length},ba}function Pd(){if(iu)return su;function s(e){var t=this,i=e.type;e.target||(e.target=t),t.listeners||(t.listeners={});var r=t.listeners[i];if(r)return r.forEach(function(n){e.currentTarget=t,typeof n=="function"?n(e):n.handleEvent(e)});t.parentNode&&t.parentNode.dispatchEvent(e)}return iu=1,su=s}function Ld(){if(nu)return ru;function s(e,t){var i=this;i.listeners||(i.listeners={}),i.listeners[e]||(i.listeners[e]=[]),i.listeners[e].indexOf(t)===-1&&i.listeners[e].push(t)}return nu=1,ru=s}function Od(){if(ou)return au;function s(e,t){var i=this;if(i.listeners&&i.listeners[e]){var r=i.listeners[e],n=r.indexOf(t);n!==-1&&r.splice(n,1)}}return ou=1,au=s}function Ug(){if(uu)return lu;uu=1;var s=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function e(g){switch(g.nodeType){case 3:return h(g.data);case 8:return"";default:return t(g)}}function t(g){var y=[],w=g.tagName;return g.namespaceURI==="http://www.w3.org/1999/xhtml"&&(w=w.toLowerCase()),y.push("<"+w+l(g)+n(g)),s.indexOf(w)>-1?y.push(" />"):(y.push(">"),g.childNodes.length?y.push.apply(y,g.childNodes.map(e)):g.textContent||g.innerText?y.push(h(g.textContent||g.innerText)):g.innerHTML&&y.push(g.innerHTML),y.push("")),y.join("")}function i(g,y){var w=typeof g[y];return y==="style"&&Object.keys(g.style).length>0||g.hasOwnProperty(y)&&(w==="string"||w==="boolean"||w==="number")&&y!=="nodeName"&&y!=="className"&&y!=="tagName"&&y!=="textContent"&&y!=="innerText"&&y!=="namespaceURI"&&y!=="innerHTML"}function r(g){if(typeof g=="string")return g;var y="";return Object.keys(g).forEach(function(w){var E=g[w];w=w.replace(/[A-Z]/g,function(I){return"-"+I.toLowerCase()}),y+=w+":"+E+";"}),y}function n(g){var y=g.dataset,w=[];for(var E in y)w.push({name:"data-"+E,value:y[E]});return w.length?a(w):""}function a(g){var y=[];return g.forEach(function(w){var E=w.name,I=w.value;E==="style"&&(I=r(I)),y.push(E+'="'+p(I)+'"')}),y.length?" "+y.join(" "):""}function l(g){var y=[];for(var w in g)i(g,w)&&y.push({name:w,value:g[w]});for(var E in g._attributes)for(var I in g._attributes[E]){var v=g._attributes[E][I],L=(v.prefix?v.prefix+":":"")+I;y.push({name:L,value:v.value})}return g.className&&y.push({name:"class",value:g.className}),y.length?a(y):""}function h(g){var y="";return typeof g=="string"?y=g:g&&(y=g.toString()),y.replace(/&/g,"&").replace(//g,">")}function p(g){return h(g).replace(/"/g,""")}return lu=e}function Nd(){if(hu)return Ta;hu=1;var s=Id(),e=Pd(),t=Ld(),i=Od(),r=Ug(),n="http://www.w3.org/1999/xhtml";function a(l,h,p){if(!(this instanceof a))return new a(l);var g=p===void 0?n:p||null;this.tagName=g===n?String(l).toUpperCase():l,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=h||null,this.namespaceURI=g,this._attributes={},this.tagName==="INPUT"&&(this.type="text")}return Ta=a,a.prototype.type="DOMElement",a.prototype.nodeType=1,a.prototype.appendChild=function(l){return l.parentNode&&l.parentNode.removeChild(l),this.childNodes.push(l),l.parentNode=this,l},a.prototype.replaceChild=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=this.childNodes.indexOf(h);return h.parentNode=null,this.childNodes[p]=l,l.parentNode=this,h},a.prototype.removeChild=function(l){var h=this.childNodes.indexOf(l);return this.childNodes.splice(h,1),l.parentNode=null,l},a.prototype.insertBefore=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=h==null?-1:this.childNodes.indexOf(h);return p>-1?this.childNodes.splice(p,0,l):this.childNodes.push(l),l.parentNode=this,l},a.prototype.setAttributeNS=function(l,h,p){var g=null,y=h,w=h.indexOf(":");w>-1&&(g=h.substr(0,w),y=h.substr(w+1)),this.tagName==="INPUT"&&h==="type"?this.type=p:(this._attributes[l]||(this._attributes[l]={}))[y]={value:p,prefix:g}},a.prototype.getAttributeNS=function(l,h){var p=this._attributes[l],g=p&&p[h]&&p[h].value;return this.tagName==="INPUT"&&h==="type"?this.type:typeof g!="string"?null:g},a.prototype.removeAttributeNS=function(l,h){var p=this._attributes[l];p&&delete p[h]},a.prototype.hasAttributeNS=function(l,h){var p=this._attributes[l];return!!p&&h in p},a.prototype.setAttribute=function(l,h){return this.setAttributeNS(null,l,h)},a.prototype.getAttribute=function(l){return this.getAttributeNS(null,l)},a.prototype.removeAttribute=function(l){return this.removeAttributeNS(null,l)},a.prototype.hasAttribute=function(l){return this.hasAttributeNS(null,l)},a.prototype.removeEventListener=i,a.prototype.addEventListener=t,a.prototype.dispatchEvent=e,a.prototype.focus=function(){},a.prototype.toString=function(){return r(this)},a.prototype.getElementsByClassName=function(l){var h=l.split(" "),p=[];return s(this,function(g){if(g.nodeType===1){var y=(g.className||"").split(" ");h.every(function(w){return y.indexOf(w)!==-1})&&p.push(g)}}),p},a.prototype.getElementsByTagName=function(l){l=l.toLowerCase();var h=[];return s(this.childNodes,function(p){p.nodeType!==1||l!=="*"&&p.tagName.toLowerCase()!==l||h.push(p)}),h},a.prototype.contains=function(l){return s(this,function(h){return l===h})||!1},Ta}function qg(){if(du)return Sa;du=1;var s=Nd();function e(t){if(!(this instanceof e))return new e;this.childNodes=[],this.parentNode=null,this.ownerDocument=t||null}return Sa=e,e.prototype.type="DocumentFragment",e.prototype.nodeType=11,e.prototype.nodeName="#document-fragment",e.prototype.appendChild=s.prototype.appendChild,e.prototype.replaceChild=s.prototype.replaceChild,e.prototype.removeChild=s.prototype.removeChild,e.prototype.toString=function(){return this.childNodes.map(function(t){return String(t)}).join("")},Sa}function jg(){if(cu)return Ea;function s(e){}return cu=1,Ea=s,s.prototype.initEvent=function(e,t,i){this.type=e,this.bubbles=t,this.cancelable=i},s.prototype.preventDefault=function(){},Ea}function Hg(){if(pu)return Ca;pu=1;var s=Id(),e=Bg(),t=Fg(),i=Nd(),r=qg(),n=jg(),a=Pd(),l=Ld(),h=Od();function p(){if(!(this instanceof p))return new p;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}Ca=p;var g=p.prototype;return g.createTextNode=function(y){return new t(y,this)},g.createElementNS=function(y,w){var E=y===null?null:String(y);return new i(w,this,E)},g.createElement=function(y){return new i(y,this)},g.createDocumentFragment=function(){return new r(this)},g.createEvent=function(y){return new n(y)},g.createComment=function(y){return new e(y,this)},g.getElementById=function(y){return y=String(y),s(this.childNodes,function(w){if(String(w.id)===y)return w})||null},g.getElementsByClassName=i.prototype.getElementsByClassName,g.getElementsByTagName=i.prototype.getElementsByTagName,g.contains=i.prototype.contains,g.removeEventListener=h,g.addEventListener=l,g.dispatchEvent=a,Ca}function $g(){if(gu)return mu;gu=1;var s=Hg();return mu=new s}function Rd(){if(yu)return fu;yu=1;var s,e=an!==void 0?an:typeof window<"u"?window:{},t=$g();return typeof document<"u"?s=document:(s=e["__GLOBAL_DOCUMENT_CACHE@4"])||(s=e["__GLOBAL_DOCUMENT_CACHE@4"]=t),fu=s}const re=vr(Rd());var _u,wa,vu,bu,Tu,Su,Eu,Cu,wu,Au,$r={exports:{}},xu={exports:{}};function Vg(){return _u||(_u=1,function(s){function e(){return s.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i=i.length?{done:!0}:{done:!1,value:i[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(i,r){if(i){if(typeof i=="string")return t(i,r);var n=Object.prototype.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(i,r):void 0}}function t(i,r){(r==null||r>i.length)&&(r=i.length);for(var n=0,a=new Array(r);n=400&&n.statusCode<=599){var l=a;if(i)if(s.TextDecoder){var h=e(n.headers&&n.headers["content-type"]);try{l=new TextDecoder(h).decode(a)}catch{}}else l=String.fromCharCode.apply(null,new Uint8Array(a));t({cause:l})}else t(null,a)}}}function Yg(){if(Au)return $r.exports;Au=1;var s=Rn(),e=Vg(),t=zg(),i=Wg(),r=Gg();p.httpHandler=Xg(),p.requestInterceptorsStorage=new i,p.responseInterceptorsStorage=new i,p.retryManager=new r;var n=function(E){var I={};return E&&E.trim().split(` +`).forEach(function(v){var L=v.indexOf(":"),R=v.slice(0,L).trim().toLowerCase(),M=v.slice(L+1).trim();I[R]===void 0?I[R]=M:Array.isArray(I[R])?I[R].push(M):I[R]=[I[R],M]}),I};function a(E,I){for(var v=0;v0&&(S=setTimeout(function(){if(!U){U=!0,H.abort("timeout");var Q=new Error("XMLHttpRequest timeout");Q.code="ETIMEDOUT",G(Q)}},E.timeout)),H.setRequestHeader)for(z in W)W.hasOwnProperty(z)&&H.setRequestHeader(z,W[z]);else if(E.headers&&!l(E.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in E&&(H.responseType=E.responseType),"beforeSend"in E&&typeof E.beforeSend=="function"&&E.beforeSend(H),H.send($||null),H}function y(E){try{if(E.responseType==="document")return E.responseXML;var I=E.responseXML&&E.responseXML.documentElement.nodeName==="parsererror";if(E.responseType===""&&!I)return E.responseXML}catch{}return null}function w(){}return $r.exports=p,$r.exports.default=p,p.XMLHttpRequest=s.XMLHttpRequest||w,p.XDomainRequest="withCredentials"in new p.XMLHttpRequest?p.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(E){p[E==="delete"?"del":E]=function(I,v,L){return(v=h(I,v,L)).method=E.toUpperCase(),g(v)}}),$r.exports}const Md=vr(Yg());var ku,Du,Iu,Pu,Lu,Ou,Nu,Aa={exports:{}};function Kg(){if(Du)return ku;Du=1;var s=Rd(),e=Object.create||function(){function S(){}return function(A){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return S.prototype=A,new S}}();function t(S,A){this.name="ParsingError",this.code=S.code,this.message=A||S.message}function i(S){function A($,W,te,J){return 3600*(0|$)+60*(0|W)+(0|te)+(0|J)/1e3}var B=S.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return B?B[3]?A(B[1],B[2],B[3].replace(":",""),B[4]):B[1]>59?A(B[1],B[2],0,B[4]):A(0,B[1],B[2],B[4]):null}function r(){this.values=e(null)}function n(S,A,B,$){var W=$?S.split($):[S];for(var te in W)if(typeof W[te]=="string"){var J=W[te].split(B);J.length===2&&A(J[0].trim(),J[1].trim())}}function a(S,A,B){var $=S;function W(){var oe=i(S);if(oe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+$);return S=S.replace(/^[^\sa-zA-Z-]+/,""),oe}function te(oe,Q){var Y=new r;n(oe,function(ie,se){switch(ie){case"region":for(var ee=B.length-1;ee>=0;ee--)if(B[ee].id===se){Y.set(ie,B[ee].region);break}break;case"vertical":Y.alt(ie,se,["rl","lr"]);break;case"line":var ye=se.split(","),_e=ye[0];Y.integer(ie,_e),Y.percent(ie,_e)&&Y.set("snapToLines",!1),Y.alt(ie,_e,["auto"]),ye.length===2&&Y.alt("lineAlign",ye[1],["start","center","end"]);break;case"position":ye=se.split(","),Y.percent(ie,ye[0]),ye.length===2&&Y.alt("positionAlign",ye[1],["start","center","end"]);break;case"size":Y.percent(ie,se);break;case"align":Y.alt(ie,se,["start","center","end","left","right"])}},/:/,/\s/),Q.region=Y.get("region",null),Q.vertical=Y.get("vertical","");try{Q.line=Y.get("line","auto")}catch{}Q.lineAlign=Y.get("lineAlign","start"),Q.snapToLines=Y.get("snapToLines",!0),Q.size=Y.get("size",100);try{Q.align=Y.get("align","center")}catch{Q.align=Y.get("align","middle")}try{Q.position=Y.get("position","auto")}catch{Q.position=Y.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},Q.align)}Q.positionAlign=Y.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},Q.align)}function J(){S=S.replace(/^\s+/,"")}if(J(),A.startTime=W(),J(),S.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+$);S=S.substr(3),J(),A.endTime=W(),J(),te(S,A)}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.prototype={set:function(S,A){this.get(S)||A===""||(this.values[S]=A)},get:function(S,A,B){return B?this.has(S)?this.values[S]:A[B]:this.has(S)?this.values[S]:A},has:function(S){return S in this.values},alt:function(S,A,B){for(var $=0;$=0&&A<=100)&&(this.set(S,A),!0)}};var l=s.createElement&&s.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},p={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},g={v:"title",lang:"lang"},y={rt:"ruby"};function w(S,A){function B(){if(!A)return null;function _e(me){return A=A.substr(me.length),me}var ve=A.match(/^([^<]*)(<[^>]*>?)?/);return _e(ve[1]?ve[1]:ve[2])}function $(_e){return l.innerHTML=_e,_e=l.textContent,l.textContent="",_e}function W(_e,ve){return!y[ve.localName]||y[ve.localName]===_e.localName}function te(_e,ve){var me=h[_e];if(!me)return null;var Fe=S.document.createElement(me),et=g[_e];return et&&ve&&(Fe[et]=ve.trim()),Fe}for(var J,oe=S.document.createElement("div"),Q=oe,Y=[];(J=B())!==null;)if(J[0]!=="<")Q.appendChild(S.document.createTextNode($(J)));else{if(J[1]==="/"){Y.length&&Y[Y.length-1]===J.substr(2).replace(">","")&&(Y.pop(),Q=Q.parentNode);continue}var ie,se=i(J.substr(1,J.length-2));if(se){ie=S.document.createProcessingInstruction("timestamp",se),Q.appendChild(ie);continue}var ee=J.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ee||!(ie=te(ee[1],ee[3]))||!W(Q,ie))continue;if(ee[2]){var ye=ee[2].split(".");ye.forEach(function(_e){var ve=/^bg_/.test(_e),me=ve?_e.slice(3):_e;if(p.hasOwnProperty(me)){var Fe=ve?"background-color":"color",et=p[me];ie.style[Fe]=et}}),ie.className=ye.join(" ")}Y.push(ee[1]),Q.appendChild(ie),Q=ie}return oe}var E=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function I(S){for(var A=0;A=B[0]&&S<=B[1])return!0}return!1}function v(S){var A=[],B="";if(!S||!S.childNodes)return"ltr";function $(J,oe){for(var Q=oe.childNodes.length-1;Q>=0;Q--)J.push(oe.childNodes[Q])}function W(J){if(!J||!J.length)return null;var oe=J.pop(),Q=oe.textContent||oe.innerText;if(Q){var Y=Q.match(/^.*(\n|\r)/);return Y?(J.length=0,Y[0]):Q}return oe.tagName==="ruby"?W(J):oe.childNodes?($(J,oe),W(J)):void 0}for($(A,S);B=W(A);)for(var te=0;te=0&&S.line<=100))return S.line;if(!S.track||!S.track.textTrackList||!S.track.textTrackList.mediaElement)return-1;for(var A=S.track,B=A.textTrackList,$=0,W=0;WYe&&(et=new O(me),We=Ye),me=new O(Pe)}return et||Pe}var te=new O(A),J=A.cue,oe=L(J),Q=[];if(J.snapToLines){var Y;switch(J.vertical){case"":Q=["+y","-y"],Y="height";break;case"rl":Q=["+x","-x"],Y="width";break;case"lr":Q=["-x","+x"],Y="width"}var ie=te.lineHeight,se=ie*Math.round(oe),ee=B[Y]+ie,ye=Q[0];Math.abs(se)>ee&&(se=se<0?-1:1,se*=Math.ceil(ee/ie)*ie),oe<0&&(se+=J.vertical===""?B.height:B.width,Q=Q.reverse()),te.move(ye,se)}else{var _e=te.lineHeight/B.height*100;switch(J.lineAlign){case"center":oe-=_e/2;break;case"end":oe-=_e}switch(J.vertical){case"":A.applyStyles({top:A.formatStyle(oe,"%")});break;case"rl":A.applyStyles({left:A.formatStyle(oe,"%")});break;case"lr":A.applyStyles({right:A.formatStyle(oe,"%")})}Q=["+y","-x","+x","-y"],te=new O(A)}var ve=W(te,Q);A.move(ve.toCSSCompatValues(B))}function N(){}R.prototype.applyStyles=function(S,A){for(var B in A=A||this.div,S)S.hasOwnProperty(B)&&(A.style[B]=S[B])},R.prototype.formatStyle=function(S,A){return S===0?0:S+A},M.prototype=e(R.prototype),M.prototype.constructor=M,O.prototype.move=function(S,A){switch(A=A!==void 0?A:this.lineHeight,S){case"+x":this.left+=A,this.right+=A;break;case"-x":this.left-=A,this.right-=A;break;case"+y":this.top+=A,this.bottom+=A;break;case"-y":this.top-=A,this.bottom-=A}},O.prototype.overlaps=function(S){return this.leftS.left&&this.topS.top},O.prototype.overlapsAny=function(S){for(var A=0;A=S.top&&this.bottom<=S.bottom&&this.left>=S.left&&this.right<=S.right},O.prototype.overlapsOppositeAxis=function(S,A){switch(A){case"+x":return this.leftS.right;case"+y":return this.topS.bottom}},O.prototype.intersectPercentage=function(S){return Math.max(0,Math.min(this.right,S.right)-Math.max(this.left,S.left))*Math.max(0,Math.min(this.bottom,S.bottom)-Math.max(this.top,S.top))/(this.height*this.width)},O.prototype.toCSSCompatValues=function(S){return{top:this.top-S.top,bottom:S.bottom-this.bottom,left:this.left-S.left,right:S.right-this.right,height:this.height,width:this.width}},O.getSimpleBoxPosition=function(S){var A=S.div?S.div.offsetHeight:S.tagName?S.offsetHeight:0,B=S.div?S.div.offsetWidth:S.tagName?S.offsetWidth:0,$=S.div?S.div.offsetTop:S.tagName?S.offsetTop:0;return{left:(S=S.div?S.div.getBoundingClientRect():S.tagName?S.getBoundingClientRect():S).left,right:S.right,top:S.top||$,height:S.height||A,bottom:S.bottom||$+(S.height||A),width:S.width||B}},N.StringDecoder=function(){return{decode:function(S){if(!S)return"";if(typeof S!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(S))}}},N.convertCueToDOMTree=function(S,A){return S&&A?w(S,A):null};var z=.05,U="sans-serif",H="1.5%";return N.processCues=function(S,A,B){if(!S||!A||!B)return null;for(;B.firstChild;)B.removeChild(B.firstChild);var $=S.document.createElement("div");function W(Y){for(var ie=0;ie")===-1){A.cue.id=J;continue}case"CUE":try{a(J,A.cue,A.regionList)}catch(ie){A.reportOrThrowError(ie),A.cue=null,A.state="BADCUE";continue}A.state="CUETEXT";continue;case"CUETEXT":var Y=J.indexOf("-->")!==-1;if(!J||Y&&(Q=!0)){A.oncue&&A.oncue(A.cue),A.cue=null,A.state="ID";continue}A.cue.text&&(A.cue.text+=` +`),A.cue.text+=J.replace(/\u2028/g,` +`).replace(/u2029/g,` +`);continue;case"BADCUE":J||(A.state="ID");continue}}}catch(ie){A.reportOrThrowError(ie),A.state==="CUETEXT"&&A.cue&&A.oncue&&A.oncue(A.cue),A.cue=null,A.state=A.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var S=this;try{if(S.buffer+=S.decoder.decode(),(S.cue||S.state==="HEADER")&&(S.buffer+=` + +`,S.parse()),S.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(A){S.reportOrThrowError(A)}return S.onflush&&S.onflush(),this}},ku=N}function Qg(){if(Pu)return Iu;Pu=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){return typeof a=="string"&&!!e[a.toLowerCase()]&&a.toLowerCase()}function r(a){return typeof a=="string"&&!!t[a.toLowerCase()]&&a.toLowerCase()}function n(a,l,h){this.hasBeenReset=!1;var p="",g=!1,y=a,w=l,E=h,I=null,v="",L=!0,R="auto",M="start",O="auto",G="auto",N=100,z="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return p},set:function(U){p=""+U}},pauseOnExit:{enumerable:!0,get:function(){return g},set:function(U){g=!!U}},startTime:{enumerable:!0,get:function(){return y},set:function(U){if(typeof U!="number")throw new TypeError("Start time must be set to a number.");y=U,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return w},set:function(U){if(typeof U!="number")throw new TypeError("End time must be set to a number.");w=U,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return E},set:function(U){E=""+U,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return I},set:function(U){I=U,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return v},set:function(U){var H=i(U);if(H===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");v=H,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return L},set:function(U){L=!!U,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return R},set:function(U){if(typeof U!="number"&&U!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");R=U,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return M},set:function(U){var H=r(U);H?(M=H,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return O},set:function(U){if(U<0||U>100)throw new Error("Position must be between 0 and 100.");O=U,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return G},set:function(U){var H=r(U);H?(G=H,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return N},set:function(U){if(U<0||U>100)throw new Error("Size must be between 0 and 100.");N=U,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return z},set:function(U){var H=r(U);if(!H)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");z=H,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Iu=n}function Jg(){if(Ou)return Lu;Ou=1;var s={"":!0,up:!0};function e(r){return typeof r=="string"&&!!s[r.toLowerCase()]&&r.toLowerCase()}function t(r){return typeof r=="number"&&r>=0&&r<=100}function i(){var r=100,n=3,a=0,l=100,h=0,p=100,g="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(y){if(!t(y))throw new Error("Width must be between 0 and 100.");r=y}},lines:{enumerable:!0,get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");n=y}},regionAnchorY:{enumerable:!0,get:function(){return l},set:function(y){if(!t(y))throw new Error("RegionAnchorX must be between 0 and 100.");l=y}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(y){if(!t(y))throw new Error("RegionAnchorY must be between 0 and 100.");a=y}},viewportAnchorY:{enumerable:!0,get:function(){return p},set:function(y){if(!t(y))throw new Error("ViewportAnchorY must be between 0 and 100.");p=y}},viewportAnchorX:{enumerable:!0,get:function(){return h},set:function(y){if(!t(y))throw new Error("ViewportAnchorX must be between 0 and 100.");h=y}},scroll:{enumerable:!0,get:function(){return g},set:function(y){var w=e(y);w===!1?console.warn("Scroll: an invalid or illegal string was specified."):g=w}}})}return Lu=i}function Zg(){if(Nu)return Aa.exports;Nu=1;var s=Rn(),e=Aa.exports={WebVTT:Kg(),VTTCue:Qg(),VTTRegion:Jg()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,r=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=i},e.restore=function(){s.VTTCue=r,s.VTTRegion=n},s.VTTCue||e.shim(),Aa.exports}const Ru=vr(Zg());function ze(){return ze=Object.assign?Object.assign.bind():function(s){for(var e=1;e-1},e.trigger=function(t){var i=this.listeners[t];if(i)if(arguments.length===2)for(var r=i.length,n=0;n-1;t=this.buffer.indexOf(` +`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const sf=" ",xa=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},rf=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},ht=function(s){const e={};if(!s)return e;const t=s.split(rf());let i,r=t.length;for(;r--;)t[r]!==""&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),e[i[0]]=i[1]);return e},Bu=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class nf extends Oo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if((e=e.trim()).length!==0){if(e[0]!=="#")return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((r,n)=>{const a=n(e);return a===e?r:r.concat([a])},[e]).forEach(r=>{for(let n=0;nn),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const i=r=>e.test(r)?t(r):r;this.tagMappers.push(i)}}const af=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),bs=function(s){const e={};return Object.keys(s).forEach(function(t){e[af(t)]=s[t]}),e},ka=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&3*t,h=i&&2*i;t&&!e.hasOwnProperty(n)&&(e[n]=l,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${l}).`})),l&&e[n]{a.uri||!a.parts&&!a.preloadHints||(!a.map&&r&&(a.map=r),!a.key&&n&&(a.key=n),a.timeline||typeof y!="number"||(a.timeline=y),this.manifest.preloadSegment=a)}),this.parseStream.on("data",function(v){let L,R;if(t.manifest.definitions){for(const M in t.manifest.definitions)if(v.uri&&(v.uri=v.uri.replace(`{$${M}}`,t.manifest.definitions[M])),v.attributes)for(const O in v.attributes)typeof v.attributes[O]=="string"&&(v.attributes[O]=v.attributes[O].replace(`{$${M}}`,t.manifest.definitions[M]))}({tag(){({version(){v.version&&(this.manifest.version=v.version)},"allow-cache"(){this.manifest.allowCache=v.allowed,"allowed"in v||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const M={};"length"in v&&(a.byterange=M,M.length=v.length,"offset"in v||(v.offset=w)),"offset"in v&&(a.byterange=M,M.offset=v.offset),w=M.offset+M.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),v.title&&(a.title=v.title),v.duration>0&&(a.duration=v.duration),v.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(v.attributes)if(v.attributes.METHOD!=="NONE")if(v.attributes.URI){if(v.attributes.KEYFORMAT==="com.apple.streamingkeydelivery")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:v.attributes});if(v.attributes.KEYFORMAT==="com.microsoft.playready")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:v.attributes.URI});if(v.attributes.KEYFORMAT===g)return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(v.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(v.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),v.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):v.attributes.KEYID&&v.attributes.KEYID.substring(0,2)==="0x"?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:v.attributes.KEYFORMAT,keyId:v.attributes.KEYID.substring(2)},pssh:Bd(v.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));v.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:v.attributes.METHOD||"AES-128",uri:v.attributes.URI},v.attributes.IV!==void 0&&(n.iv=v.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(v.number)?this.manifest.mediaSequence=v.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+v.number})},"discontinuity-sequence"(){isFinite(v.number)?(this.manifest.discontinuitySequence=v.number,y=v.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+v.number})},"playlist-type"(){/VOD|EVENT/.test(v.playlistType)?this.manifest.playlistType=v.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+v.playlist})},map(){r={},v.uri&&(r.uri=v.uri),v.byterange&&(r.byterange=v.byterange),n&&(r.key=n)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||p,v.attributes?(a.attributes||(a.attributes={}),ze(a.attributes,v.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(v.attributes&&v.attributes.TYPE&&v.attributes["GROUP-ID"]&&v.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const M=this.manifest.mediaGroups[v.attributes.TYPE];M[v.attributes["GROUP-ID"]]=M[v.attributes["GROUP-ID"]]||{},L=M[v.attributes["GROUP-ID"]],R={default:/yes/i.test(v.attributes.DEFAULT)},R.default?R.autoselect=!0:R.autoselect=/yes/i.test(v.attributes.AUTOSELECT),v.attributes.LANGUAGE&&(R.language=v.attributes.LANGUAGE),v.attributes.URI&&(R.uri=v.attributes.URI),v.attributes["INSTREAM-ID"]&&(R.instreamId=v.attributes["INSTREAM-ID"]),v.attributes.CHARACTERISTICS&&(R.characteristics=v.attributes.CHARACTERISTICS),v.attributes.FORCED&&(R.forced=/yes/i.test(v.attributes.FORCED)),L[v.attributes.NAME]=R},discontinuity(){y+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=v.dateTimeString,this.manifest.dateTimeObject=v.dateTimeObject),a.dateTimeString=v.dateTimeString,a.dateTimeObject=v.dateTimeObject;const{lastProgramDateTime:M}=this;this.lastProgramDateTime=new Date(v.dateTimeString).getTime(),M===null&&this.manifest.segments.reduceRight((O,G)=>(G.programDateTime=O-1e3*G.duration,G.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(v.duration)||v.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+v.duration}):(this.manifest.targetDuration=v.duration,ka.call(this,this.manifest))},start(){v.attributes&&!isNaN(v.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:v.attributes["TIME-OFFSET"],precise:v.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){a.cueOut=v.data},"cue-out-cont"(){a.cueOutCont=v.data},"cue-in"(){a.cueIn=v.data},skip(){this.manifest.skip=bs(v.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",v.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const M=this.manifest.segments.length,O=bs(v.attributes);a.parts=a.parts||[],a.parts.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=E),E=O.byterange.offset+O.byterange.length);const G=a.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${G} for segment #${M}`,v.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((N,z)=>{N.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${z} lacks required attribute(s): LAST-PART`})})},"server-control"(){const M=this.manifest.serverControl=bs(v.attributes);M.hasOwnProperty("canBlockReload")||(M.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ka.call(this,this.manifest),M.canSkipDateranges&&!M.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const M=this.manifest.segments.length,O=bs(v.attributes),G=O.type&&O.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=G?E:0,G&&(E=O.byterange.offset+O.byterange.length)));const N=a.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${N} for segment #${M}`,v.attributes,["TYPE","URI"]),O.type)for(let z=0;zz.id===O.id);this.manifest.dateRanges[N]=ze(this.manifest.dateRanges[N],O),I[O.id]=ze(I[O.id],O),this.manifest.dateRanges.pop()}else I[O.id]=O},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=bs(v.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",v.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const M=(O,G)=>{O in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${O}`}):this.manifest.definitions[O]=G};if("QUERYPARAM"in v.attributes){if("NAME"in v.attributes||"IMPORT"in v.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const O=this.params.get(v.attributes.QUERYPARAM);return O?void M(v.attributes.QUERYPARAM,decodeURIComponent(O)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${v.attributes.QUERYPARAM}`})}return"NAME"in v.attributes?"IMPORT"in v.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in v.attributes&&typeof v.attributes.VALUE=="string"?void M(v.attributes.NAME,v.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${v.attributes.NAME}`}):"IMPORT"in v.attributes?this.mainDefinitions[v.attributes.IMPORT]?void M(v.attributes.IMPORT,this.mainDefinitions[v.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${v.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:v.attributes,uri:v.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",v.attributes,["BANDWIDTH","URI"])}}[v.tagType]||h).call(t)},uri(){a.uri=v.uri,i.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),n&&(a.key=n),a.timeline=y,r&&(a.map=r),E=0,this.lastProgramDateTime!==null&&(a.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*a.duration),a={}},comment(){},custom(){v.segment?(a.custom=a.custom||{},a.custom[v.customType]=v.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[v.customType]=v.data)}})[v.type].call(t)})}requiredCompatibilityversion(e,t){(ep&&(h-=p,h-=p,h-=it(2))}return Number(h)},_f=function(s,e){var t={}.le,i=t!==void 0&&t;(typeof s!="bigint"&&typeof s!="number"||typeof s=="number"&&s!=s)&&(s=0),s=it(s);for(var r=gf(s),n=new Uint8Array(new ArrayBuffer(r)),a=0;a=e.length&&h.call(e,function(p,g){return p===(l[g]?l[g]&s[n+g]:s[n+g])})},bf=function(s,e,t){e.forEach(function(i){for(var r in s.mediaGroups[i])for(var n in s.mediaGroups[i][r]){var a=s.mediaGroups[i][r][n];t(a,i,r,n)}})},Zi={},os={},Ms={};function Bn(){if(ju)return Ms;function s(n,a,l){if(l===void 0&&(l=Array.prototype),n&&typeof l.find=="function")return l.find.call(n,a);for(var h=0;h=0))throw new $(A,new Error(_.tagName+"@"+P));for(var ae=T.length-1;q"&&">")||_=="&"&&"&"||_=='"'&&"""||"&#"+_.charCodeAt()+";"}function _e(_,T){if(T(_))return!0;if(_=_.firstChild)do if(_e(_,T))return!0;while(_=_.nextSibling)}function ve(){this.ownerDocument=this}function me(_,T,P){_&&_._inc++,P.namespaceURI===t.XMLNS&&(T._nsMap[P.prefix?P.localName:""]=P.value)}function Fe(_,T,P,q){_&&_._inc++,P.namespaceURI===t.XMLNS&&delete T._nsMap[P.prefix?P.localName:""]}function et(_,T,P){if(_&&_._inc){_._inc++;var q=T.childNodes;if(P)q[q.length++]=P;else{for(var ae=T.firstChild,le=0;ae;)q[le++]=ae,ae=ae.nextSibling;q.length=le,delete q[q.length]}}}function Pe(_,T){var P=T.previousSibling,q=T.nextSibling;return P?P.nextSibling=q:_.firstChild=q,q?q.previousSibling=P:_.lastChild=P,T.parentNode=null,T.previousSibling=null,T.nextSibling=null,et(_.ownerDocument,_),T}function We(_){return _&&(_.nodeType===ee.DOCUMENT_NODE||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.ELEMENT_NODE)}function Ge(_){return _&&(rt(_)||Ut(_)||Ye(_)||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.COMMENT_NODE||_.nodeType===ee.PROCESSING_INSTRUCTION_NODE)}function Ye(_){return _&&_.nodeType===ee.DOCUMENT_TYPE_NODE}function rt(_){return _&&_.nodeType===ee.ELEMENT_NODE}function Ut(_){return _&&_.nodeType===ee.TEXT_NODE}function Ke(_,T){var P=_.childNodes||[];if(e(P,rt)||Ye(T))return!1;var q=e(P,Ye);return!(T&&q&&P.indexOf(q)>P.indexOf(T))}function ts(_,T){var P=_.childNodes||[];function q(le){return rt(le)&&le!==T}if(e(P,q))return!1;var ae=e(P,Ye);return!(T&&ae&&P.indexOf(ae)>P.indexOf(T))}function Ps(_,T,P){if(!We(_))throw new $(S,"Unexpected parent node type "+_.nodeType);if(P&&P.parentNode!==_)throw new $(A,"child not in parent");if(!Ge(T)||Ye(T)&&_.nodeType!==ee.DOCUMENT_NODE)throw new $(S,"Unexpected node type "+T.nodeType+" for parent node type "+_.nodeType)}function Ys(_,T,P){var q=_.childNodes||[],ae=T.childNodes||[];if(T.nodeType===ee.DOCUMENT_FRAGMENT_NODE){var le=ae.filter(rt);if(le.length>1||e(ae,Ut))throw new $(S,"More than one element or text in fragment");if(le.length===1&&!Ke(_,P))throw new $(S,"Element in fragment can not be inserted before doctype")}if(rt(T)&&!Ke(_,P))throw new $(S,"Only one element can be added and only after doctype");if(Ye(T)){if(e(q,Ye))throw new $(S,"Only one doctype is allowed");var De=e(q,rt);if(P&&q.indexOf(De)1||e(ae,Ut))throw new $(S,"More than one element or text in fragment");if(le.length===1&&!ts(_,P))throw new $(S,"Element in fragment can not be inserted before doctype")}if(rt(T)&&!ts(_,P))throw new $(S,"Only one element can be added and only after doctype");if(Ye(T)){if(e(q,function(Ee){return Ye(Ee)&&Ee!==P}))throw new $(S,"Only one doctype is allowed");var De=e(q,rt);if(P&&q.indexOf(De)=0;jt--)if((Pt=ae[jt]).prefix===""&&Pt.namespace===_.namespaceURI){st=Pt.namespace;break}}if(st!==_.namespaceURI)for(jt=ae.length-1;jt>=0;jt--){var Pt;if((Pt=ae[jt]).namespace===_.namespaceURI){Pt.prefix&&(qt=Pt.prefix+":"+wt);break}}}T.push("<",qt);for(var ns=0;ns"),P&&/^script$/i.test(wt))for(;Ee;)Ee.data?T.push(Ee.data):rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;else for(;Ee;)rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;T.push("")}else T.push("/>");return;case O:case N:for(Ee=_.firstChild;Ee;)rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;return;case w:return Hi(T,_.name,_.value);case E:return T.push(_.data.replace(/[<&>]/g,ye));case I:return T.push("");case M:return T.push("");case G:var Js=_.publicId,Ht=_.systemId;if(T.push("");else if(Ht&&Ht!=".")T.push(" SYSTEM ",Ht,">");else{var Zs=_.internalSubset;Zs&&T.push(" [",Zs,"]"),T.push(">")}return;case R:return T.push("");case v:return T.push("&",_.nodeName,";");default:T.push("??",_.nodeName)}}function Qs(_,T,P){var q;switch(T.nodeType){case y:(q=T.cloneNode(!1)).ownerDocument=_;case N:break;case w:P=!0}if(q||(q=T.cloneNode(!1)),q.ownerDocument=_,q.parentNode=null,P)for(var ae=T.firstChild;ae;)q.appendChild(Qs(_,ae,P)),ae=ae.nextSibling;return q}function ys(_,T,P){var q=new T.constructor;for(var ae in T)if(Object.prototype.hasOwnProperty.call(T,ae)){var le=T[ae];typeof le!="object"&&le!=q[ae]&&(q[ae]=le)}switch(T.childNodes&&(q.childNodes=new W),q.ownerDocument=_,q.nodeType){case y:var De=T.attributes,Ee=q.attributes=new oe,wt=De.length;Ee._ownerElement=q;for(var qt=0;qt=0&&_0},lookupPrefix:function(_){for(var T=this;T;){var P=T._nsMap;if(P){for(var q in P)if(Object.prototype.hasOwnProperty.call(P,q)&&P[q]===_)return q}T=T.nodeType==w?T.ownerDocument:T.parentNode}return null},lookupNamespaceURI:function(_){for(var T=this;T;){var P=T._nsMap;if(P&&Object.prototype.hasOwnProperty.call(P,_))return P[_];T=T.nodeType==w?T.ownerDocument:T.parentNode}return null},isDefaultNamespace:function(_){return this.lookupPrefix(_)==null}},h(g,ee),h(g,ee.prototype),ve.prototype={nodeName:"#document",nodeType:O,doctype:null,documentElement:null,_inc:1,insertBefore:function(_,T){if(_.nodeType==N){for(var P=_.firstChild;P;){var q=P.nextSibling;this.insertBefore(P,T),P=q}return _}return ss(this,_,T),_.ownerDocument=this,this.documentElement===null&&_.nodeType===y&&(this.documentElement=_),_},removeChild:function(_){return this.documentElement==_&&(this.documentElement=null),Pe(this,_)},replaceChild:function(_,T){ss(this,_,T,ms),_.ownerDocument=this,T&&this.removeChild(T),rt(_)&&(this.documentElement=_)},importNode:function(_,T){return Qs(this,_,T)},getElementById:function(_){var T=null;return _e(this.documentElement,function(P){if(P.nodeType==y&&P.getAttribute("id")==_)return T=P,!0}),T},getElementsByClassName:function(_){var T=a(_);return new te(this,function(P){var q=[];return T.length>0&&_e(P.documentElement,function(ae){if(ae!==P&&ae.nodeType===y){var le=ae.getAttribute("class");if(le){var De=_===le;if(!De){var Ee=a(le);De=T.every(l(Ee))}De&&q.push(ae)}}}),q})},createElement:function(_){var T=new je;return T.ownerDocument=this,T.nodeName=_,T.tagName=_,T.localName=_,T.childNodes=new W,(T.attributes=new oe)._ownerElement=T,T},createDocumentFragment:function(){var _=new Ks;return _.ownerDocument=this,_.childNodes=new W,_},createTextNode:function(_){var T=new Se;return T.ownerDocument=this,T.appendData(_),T},createComment:function(_){var T=new Fi;return T.ownerDocument=this,T.appendData(_),T},createCDATASection:function(_){var T=new Ui;return T.ownerDocument=this,T.appendData(_),T},createProcessingInstruction:function(_,T){var P=new qi;return P.ownerDocument=this,P.tagName=P.nodeName=P.target=_,P.nodeValue=P.data=T,P},createAttribute:function(_){var T=new lt;return T.ownerDocument=this,T.name=_,T.nodeName=_,T.localName=_,T.specified=!0,T},createEntityReference:function(_){var T=new fs;return T.ownerDocument=this,T.nodeName=_,T},createElementNS:function(_,T){var P=new je,q=T.split(":"),ae=P.attributes=new oe;return P.childNodes=new W,P.ownerDocument=this,P.nodeName=T,P.tagName=T,P.namespaceURI=_,q.length==2?(P.prefix=q[0],P.localName=q[1]):P.localName=T,ae._ownerElement=P,P},createAttributeNS:function(_,T){var P=new lt,q=T.split(":");return P.ownerDocument=this,P.nodeName=T,P.name=T,P.namespaceURI=_,P.specified=!0,q.length==2?(P.prefix=q[0],P.localName=q[1]):P.localName=T,P}},p(ve,ee),je.prototype={nodeType:y,hasAttribute:function(_){return this.getAttributeNode(_)!=null},getAttribute:function(_){var T=this.getAttributeNode(_);return T&&T.value||""},getAttributeNode:function(_){return this.attributes.getNamedItem(_)},setAttribute:function(_,T){var P=this.ownerDocument.createAttribute(_);P.value=P.nodeValue=""+T,this.setAttributeNode(P)},removeAttribute:function(_){var T=this.getAttributeNode(_);T&&this.removeAttributeNode(T)},appendChild:function(_){return _.nodeType===N?this.insertBefore(_,null):Oe(this,_)},setAttributeNode:function(_){return this.attributes.setNamedItem(_)},setAttributeNodeNS:function(_){return this.attributes.setNamedItemNS(_)},removeAttributeNode:function(_){return this.attributes.removeNamedItem(_.nodeName)},removeAttributeNS:function(_,T){var P=this.getAttributeNodeNS(_,T);P&&this.removeAttributeNode(P)},hasAttributeNS:function(_,T){return this.getAttributeNodeNS(_,T)!=null},getAttributeNS:function(_,T){var P=this.getAttributeNodeNS(_,T);return P&&P.value||""},setAttributeNS:function(_,T,P){var q=this.ownerDocument.createAttributeNS(_,T);q.value=q.nodeValue=""+P,this.setAttributeNode(q)},getAttributeNodeNS:function(_,T){return this.attributes.getNamedItemNS(_,T)},getElementsByTagName:function(_){return new te(this,function(T){var P=[];return _e(T,function(q){q===T||q.nodeType!=y||_!=="*"&&q.tagName!=_||P.push(q)}),P})},getElementsByTagNameNS:function(_,T){return new te(this,function(P){var q=[];return _e(P,function(ae){ae===P||ae.nodeType!==y||_!=="*"&&ae.namespaceURI!==_||T!=="*"&&ae.localName!=T||q.push(ae)}),q})}},ve.prototype.getElementsByTagName=je.prototype.getElementsByTagName,ve.prototype.getElementsByTagNameNS=je.prototype.getElementsByTagNameNS,p(je,ee),lt.prototype.nodeType=w,p(lt,ee),is.prototype={data:"",substringData:function(_,T){return this.data.substring(_,_+T)},appendData:function(_){_=this.data+_,this.nodeValue=this.data=_,this.length=_.length},insertData:function(_,T){this.replaceData(_,0,T)},appendChild:function(_){throw new Error(H[S])},deleteData:function(_,T){this.replaceData(_,T,"")},replaceData:function(_,T,P){P=this.data.substring(0,_)+P+this.data.substring(_+T),this.nodeValue=this.data=P,this.length=P.length}},p(is,ee),Se.prototype={nodeName:"#text",nodeType:E,splitText:function(_){var T=this.data,P=T.substring(_);T=T.substring(0,_),this.data=this.nodeValue=T,this.length=T.length;var q=this.ownerDocument.createTextNode(P);return this.parentNode&&this.parentNode.insertBefore(q,this.nextSibling),q}},p(Se,is),Fi.prototype={nodeName:"#comment",nodeType:M},p(Fi,is),Ui.prototype={nodeName:"#cdata-section",nodeType:I},p(Ui,is),gs.prototype.nodeType=G,p(gs,ee),ke.prototype.nodeType=z,p(ke,ee),Ar.prototype.nodeType=L,p(Ar,ee),fs.prototype.nodeType=v,p(fs,ee),Ks.prototype.nodeName="#document-fragment",Ks.prototype.nodeType=N,p(Ks,ee),qi.prototype.nodeType=R,p(qi,ee),xr.prototype.serializeToString=function(_,T,P){return kr.call(_,T,P)},ee.prototype.toString=kr;try{if(Object.defineProperty){let _=function(T){switch(T.nodeType){case y:case N:var P=[];for(T=T.firstChild;T;)T.nodeType!==7&&T.nodeType!==8&&P.push(_(T)),T=T.nextSibling;return P.join("");default:return T.nodeValue}};Object.defineProperty(te.prototype,"length",{get:function(){return J(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return _(this)},set:function(T){switch(this.nodeType){case y:case N:for(;this.firstChild;)this.removeChild(this.firstChild);(T||String(T))&&this.appendChild(this.ownerDocument.createTextNode(T));break;default:this.data=T,this.value=T,this.nodeValue=T}}}),tt=function(T,P,q){T["$$"+P]=q}}}catch{}return os.DocumentType=gs,os.DOMException=$,os.DOMImplementation=se,os.Element=je,os.Node=ee,os.NodeList=W,os.XMLSerializer=xr,os}var $u,er={},Vu={};function Tf(){return $u||($u=1,s=Vu,e=Bn().freeze,s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` +`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),s.entityMap=s.HTML_ENTITIES),Vu;var s,e}var zu,Wu,Gu,zr={};function Sf(){if(zu)return zr;zu=1;var s=Bn().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,a=2,l=3,h=4,p=5,g=6,y=7;function w(S,A){this.message=S,this.locator=A,Error.captureStackTrace&&Error.captureStackTrace(this,w)}function E(){}function I(S,A,B,$,W){function te(Oe){if(Oe>65535){var je=55296+((Oe-=65536)>>10),lt=56320+(1023&Oe);return String.fromCharCode(je,lt)}return String.fromCharCode(Oe)}function J(Oe){var je=Oe.slice(1,-1);return Object.hasOwnProperty.call(B,je)?B[je]:je.charAt(0)==="#"?te(parseInt(je.substr(1).replace("x","0x"))):(W.error("entity not found:"+Oe),Oe)}function oe(Oe){if(Oe>ve){var je=S.substring(ve,Oe).replace(/&#?\w+;/g,J);ee&&Q(ve),$.characters(je,0,Oe-ve),ve=Oe}}function Q(Oe,je){for(;Oe>=ie&&(je=se.exec(S));)Y=je.index,ie=Y+je[0].length,ee.lineNumber++;ee.columnNumber=Oe-Y+1}for(var Y=0,ie=0,se=/.*(?:\r\n?|\n)|.*$/g,ee=$.locator,ye=[{currentNSMap:A}],_e={},ve=0;;){try{var me=S.indexOf("<",ve);if(me<0){if(!S.substr(ve).match(/^\s*$/)){var Fe=$.doc,et=Fe.createTextNode(S.substr(ve));Fe.appendChild(et),$.currentElement=et}return}switch(me>ve&&oe(me),S.charAt(me+1)){case"/":var Pe=S.indexOf(">",me+3),We=S.substring(me+2,Pe).replace(/[ \t\n\r]+$/g,""),Ge=ye.pop();Pe<0?(We=S.substring(me+2).replace(/[\s<].*/,""),W.error("end tag name: "+We+" is not complete:"+Ge.tagName),Pe=me+1+We.length):We.match(/\sve?ve=Pe:oe(Math.max(me,ve)+1)}}function v(S,A){return A.lineNumber=S.lineNumber,A.columnNumber=S.columnNumber,A}function L(S,A,B,$,W,te){function J(ee,ye,_e){B.attributeNames.hasOwnProperty(ee)&&te.fatalError("Attribute "+ee+" redefined"),B.addValue(ee,ye.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,W),_e)}for(var oe,Q=++A,Y=r;;){var ie=S.charAt(Q);switch(ie){case"=":if(Y===n)oe=S.slice(A,Q),Y=l;else{if(Y!==a)throw new Error("attribute equal must after attrName");Y=l}break;case"'":case'"':if(Y===l||Y===n){if(Y===n&&(te.warning('attribute value must after "="'),oe=S.slice(A,Q)),A=Q+1,!((Q=S.indexOf(ie,A))>0))throw new Error("attribute value no end '"+ie+"' match");J(oe,se=S.slice(A,Q),A-1),Y=p}else{if(Y!=h)throw new Error('attribute value must after "="');J(oe,se=S.slice(A,Q),A),te.warning('attribute "'+oe+'" missed start quot('+ie+")!!"),A=Q+1,Y=p}break;case"/":switch(Y){case r:B.setTagName(S.slice(A,Q));case p:case g:case y:Y=y,B.closed=!0;case h:case n:break;case a:B.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return te.error("unexpected end of input"),Y==r&&B.setTagName(S.slice(A,Q)),Q;case">":switch(Y){case r:B.setTagName(S.slice(A,Q));case p:case g:case y:break;case h:case n:(se=S.slice(A,Q)).slice(-1)==="/"&&(B.closed=!0,se=se.slice(0,-1));case a:Y===a&&(se=oe),Y==h?(te.warning('attribute "'+se+'" missed quot(")!'),J(oe,se,A)):(s.isHTML($[""])&&se.match(/^(?:disabled|checked|selected)$/i)||te.warning('attribute "'+se+'" missed value!! "'+se+'" instead!!'),J(se,se,A));break;case l:throw new Error("attribute value missed!!")}return Q;case"€":ie=" ";default:if(ie<=" ")switch(Y){case r:B.setTagName(S.slice(A,Q)),Y=g;break;case n:oe=S.slice(A,Q),Y=a;break;case h:var se=S.slice(A,Q);te.warning('attribute "'+se+'" missed quot(")!!'),J(oe,se,A);case p:Y=g}else switch(Y){case a:B.tagName,s.isHTML($[""])&&oe.match(/^(?:disabled|checked|selected)$/i)||te.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead2!!'),J(oe,oe,A),A=Q,Y=n;break;case p:te.warning('attribute space is required"'+oe+'"!!');case g:Y=n,A=Q;break;case l:Y=h,A=Q;break;case y:throw new Error("elements closed character '/' and '>' must be connected to")}}Q++}}function R(S,A,B){for(var $=S.tagName,W=null,te=S.length;te--;){var J=S[te],oe=J.qName,Q=J.value;if((ee=oe.indexOf(":"))>0)var Y=J.prefix=oe.slice(0,ee),ie=oe.slice(ee+1),se=Y==="xmlns"&&ie;else ie=oe,Y=null,se=oe==="xmlns"&&"";J.localName=ie,se!==!1&&(W==null&&(W={},G(B,B={})),B[se]=W[se]=Q,J.uri=s.XMLNS,A.startPrefixMapping(se,Q))}for(te=S.length;te--;)(Y=(J=S[te]).prefix)&&(Y==="xml"&&(J.uri=s.XML),Y!=="xmlns"&&(J.uri=B[Y||""]));var ee;(ee=$.indexOf(":"))>0?(Y=S.prefix=$.slice(0,ee),ie=S.localName=$.slice(ee+1)):(Y=null,ie=S.localName=$);var ye=S.uri=B[Y||""];if(A.startElement(ye,ie,$,S),!S.closed)return S.currentNSMap=B,S.localNSMap=W,!0;if(A.endElement(ye,ie,$),W)for(Y in W)Object.prototype.hasOwnProperty.call(W,Y)&&A.endPrefixMapping(Y)}function M(S,A,B,$,W){if(/^(?:script|textarea)$/i.test(B)){var te=S.indexOf("",A),J=S.substring(A+1,te);if(/[&<]/.test(J))return/^script$/i.test(B)?(W.characters(J,0,J.length),te):(J=J.replace(/&#?\w+;/g,$),W.characters(J,0,J.length),te)}return A+1}function O(S,A,B,$){var W=$[B];return W==null&&((W=S.lastIndexOf(""))",A+4))>A?(B.comment(S,A+4,W-A-4),W+3):($.error("Unclosed comment"),-1):-1;if(S.substr(A+3,6)=="CDATA["){var W=S.indexOf("]]>",A+9);return B.startCDATA(),B.characters(S,A+9,W-A-9),B.endCDATA(),W+3}var te=H(S,A),J=te.length;if(J>1&&/!doctype/i.test(te[0][0])){var oe=te[1][0],Q=!1,Y=!1;J>3&&(/^public$/i.test(te[2][0])?(Q=te[3][0],Y=J>4&&te[4][0]):/^system$/i.test(te[2][0])&&(Y=te[3][0]));var ie=te[J-1];return B.startDTD(oe,Q,Y),B.endDTD(),ie.index+ie[0].length}return-1}function z(S,A,B){var $=S.indexOf("?>",A);if($){var W=S.substring(A,$).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return W?(W[0].length,B.processingInstruction(W[1],W[2]),$+2):-1}return-1}function U(){this.attributeNames={}}function H(S,A){var B,$=[],W=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(W.lastIndex=A,W.exec(S);B=W.exec(S);)if($.push(B),B[1])return $}return w.prototype=new Error,w.prototype.name=w.name,E.prototype={parse:function(S,A,B){var $=this.domBuilder;$.startDocument(),G(A,A={}),I(S,A,B,$,this.errorHandler),$.endDocument()}},U.prototype={setTagName:function(S){if(!i.test(S))throw new Error("invalid tagName:"+S);this.tagName=S},addValue:function(S,A,B){if(!i.test(S))throw new Error("invalid attribute:"+S);this.attributeNames[S]=this.length,this[this.length++]={qName:S,value:A,offset:B}},length:0,getLocalName:function(S){return this[S].localName},getLocator:function(S){return this[S].locator},getQName:function(S){return this[S].qName},getURI:function(S){return this[S].uri},getValue:function(S){return this[S].value}},zr.XMLReader=E,zr.ParseError=w,zr}function Ef(){if(Wu)return er;Wu=1;var s=Bn(),e=$d(),t=Tf(),i=Sf(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,l=i.XMLReader;function h(L){return L.replace(/\r[\n\u0085]/g,` +`).replace(/[\r\u0085\u2028]/g,` +`)}function p(L){this.options=L||{locator:{}}}function g(L,R,M){if(!L){if(R instanceof y)return R;L=R}var O={},G=L instanceof Function;function N(z){var U=L[z];!U&&G&&(U=L.length==2?function(H){L(z,H)}:L),O[z]=U&&function(H){U("[xmldom "+z+"] "+H+E(M))}||function(){}}return M=M||{},N("warning"),N("error"),N("fatalError"),O}function y(){this.cdata=!1}function w(L,R){R.lineNumber=L.lineNumber,R.columnNumber=L.columnNumber}function E(L){if(L)return` +@`+(L.systemId||"")+"#[line:"+L.lineNumber+",col:"+L.columnNumber+"]"}function I(L,R,M){return typeof L=="string"?L.substr(R,M):L.length>=R+M||R?new java.lang.String(L,R,M)+"":L}function v(L,R){L.currentElement?L.currentElement.appendChild(R):L.doc.appendChild(R)}return p.prototype.parseFromString=function(L,R){var M=this.options,O=new l,G=M.domBuilder||new y,N=M.errorHandler,z=M.locator,U=M.xmlns||{},H=/\/x?html?$/.test(R),S=H?t.HTML_ENTITIES:t.XML_ENTITIES;z&&G.setDocumentLocator(z),O.errorHandler=g(N,G,z),O.domBuilder=M.domBuilder||G,H&&(U[""]=n.HTML),U.xml=U.xml||n.XML;var A=M.normalizeLineEndings||h;return L&&typeof L=="string"?O.parse(A(L),U,S):O.errorHandler.error("invalid doc source"),G.doc},y.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(L,R,M,O){var G=this.doc,N=G.createElementNS(L,M||R),z=O.length;v(this,N),this.currentElement=N,this.locator&&w(this.locator,N);for(var U=0;U!!s&&typeof s=="object",Ze=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):Xu(e[i])&&Xu(t[i])?e[i]=Ze(e[i],t[i]):e[i]=t[i]}),e),{}),Vd=s=>Object.keys(s).map(e=>s[e]),Af=(s,e)=>{const t=[];for(let i=s;is.reduce((e,t)=>e.concat(t),[]),zd=s=>{if(!s.length)return[];const e=[];for(let t=0;ts.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),kf=(s,e)=>Vd(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var wi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const gr=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:Mn(s||"",e)};if(t||i){const n=(t||i).split("-");let a,l=k.BigInt?k.BigInt(n[0]):parseInt(n[0],10),h=k.BigInt?k.BigInt(n[1]):parseInt(n[1],10);l{let e;return e=typeof s.offset=="bigint"||typeof s.length=="bigint"?k.BigInt(s.offset)+k.BigInt(s.length)-k.BigInt(1):s.offset+s.length-1,`${s.offset}-${e}`},Yu=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),If={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=Yu(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:i/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:h=1/0}=s,p=Yu(s.endNumber),g=(e+t)/1e3,y=i+a,w=g+l-y,E=Math.ceil(w*r/n),I=Math.floor((g-y-h)*r/n),v=Math.floor((g-y)*r/n);return{start:Math.max(0,I),end:typeof p=="number"?p:Math.min(E,v)}}},Pf=s=>e=>{const{duration:t,timescale:i=1,periodStart:r,startNumber:n=1}=s;return{number:n+e,duration:t/i,timeline:r,time:e*t}},No=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:l}=If[e](s),h=Af(a,l).map(Pf(s));if(e==="static"){const p=h.length-1,g=typeof r=="number"?r:n;h[p].duration=g-t/i*p}return h},Wd=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:l=0,duration:h}=s;if(!e)throw new Error(wi.NO_BASE_URL);const p=gr({baseUrl:e,source:t.sourceURL,range:t.range}),g=gr({baseUrl:e,source:e,indexRange:r});if(g.map=p,h){const y=No(s);y.length&&(g.duration=y[0].duration,g.timeline=y[0].timeline)}else i&&(g.duration=i,g.timeline=n);return g.presentationTime=a||n,g.number=l,[g]},Ro=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,l=a.offset+a.length,h=e.timescale,p=e.references.filter(L=>L.referenceType!==1),g=[],y=s.endList?"static":"dynamic",w=s.sidx.timeline;let E,I=w,v=s.mediaSequence||0;E=typeof e.firstOffset=="bigint"?k.BigInt(l)+e.firstOffset:l+e.firstOffset;for(let L=0;Lkf(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Nf=(s,e)=>{for(let t=0;t{let e=[];return bf(s,Lf,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},Qu=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},Rf=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:l}){return l===i.timeline});const r=Nf(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--);r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),Qu({playlist:i,mediaSequence:r.segments[a].number})})},Mf=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(Ku(s)),i=e.playlists.concat(Ku(e));return e.timelineStarts=Gd([s.timelineStarts,e.timelineStarts]),Rf({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Fn=s=>s&&s.uri+"-"+Df(s.byterange),Ia=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=Vd(i.reduce((n,a)=>{const l=a.attributes.id+(a.attributes.lang||"");return n[l]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[l].segments.push(...a.segments)),a.attributes.contentProtection&&(n[l].attributes.contentProtection=a.attributes.contentProtection)):(n[l]=a,n[l].attributes.timelineStarts=[]),n[l].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(i=>(i.discontinuityStarts=xf(i.segments||[],"discontinuity"),i))},Mo=(s,e)=>{const t=Fn(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&Ro(s,i,s.sidx.resolvedUri),s},Bf=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Mo(s[t],e);return s},Ff=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const l={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:i,segments:e};return s.contentProtection&&(l.contentProtection=s.contentProtection),s.serviceLocation&&(l.attributes.serviceLocation=s.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},Uf=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:r})=>{e===void 0&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},qf=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const l=a.attributes.role&&a.attributes.role.value||"",h=a.attributes.lang||"";let p=a.attributes.label||"main";if(h&&!a.attributes.label){const y=l?` (${l})`:"";p=`${a.attributes.lang}${y}`}n[p]||(n[p]={language:h,autoselect:!0,default:l==="main",playlists:[],uri:""});const g=Mo(Ff(a,t),e);return n[p].playlists.push(g),i===void 0&&l==="main"&&(i=a,i.default=!0),n},{});return i||(r[Object.keys(r)[0]].default=!0),r},jf=(s,e={})=>s.reduce((t,i)=>{const r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Mo(Uf(i),e)),t},{}),Hf=s=>s.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:r,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),$f=({attributes:s,segments:e,sidx:t,discontinuityStarts:i})=>{const r={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:i,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(r.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},Vf=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",zf=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",Wf=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",Gf=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,r)=>{i.number=r})})},Ju=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],Xf=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:l,suggestedPresentationDelay:h,minimumUpdatePeriod:p}=s[0].attributes,g=Ia(s.filter(Vf)).map($f),y=Ia(s.filter(zf)),w=Ia(s.filter(Wf)),E=s.map(G=>G.attributes.captionServices).filter(Boolean),I={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Bf(g,i)};p>=0&&(I.minimumUpdatePeriod=1e3*p),e&&(I.locations=e),t&&(I.contentSteering=t),l==="dynamic"&&(I.suggestedPresentationDelay=h),n&&n.length>0&&(I.eventStream=n);const v=I.playlists.length===0,L=y.length?qf(y,i,v):null,R=w.length?jf(w,i):null,M=g.concat(Ju(L),Ju(R)),O=M.map(({timelineStarts:G})=>G);return I.timelineStarts=Gd(O),Gf(M,I.timelineStarts),L&&(I.mediaGroups.AUDIO.audio=L),R&&(I.mediaGroups.SUBTITLES.subs=R),E.length&&(I.mediaGroups["CLOSED-CAPTIONS"].cc=Hf(E)),r?Mf({oldManifest:r,newManifest:I}):I},Yf=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:h=0}=s,p=(i+r)/1e3+h-(n+l);return Math.ceil((p*a-e)/t)},Xd=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:l=1,periodStart:h}=s,p=[];let g=-1;for(let y=0;yg&&(g=v),I<0){const O=y+1;L=O===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?Yf(s,g,E):(n*a-g)/E:(e[O].t-g)/E}else L=I+1;const R=l+p.length+L;let M=l+p.length;for(;M(e,t,i,r)=>{if(e==="$$")return"$";if(s[t]===void 0)return e;const n=""+s[t];return t==="RepresentationID"?n:(r=i?parseInt(r,10):1,n.length>=r?n:`${new Array(r-n.length+1).join("0")}${n}`)},Zu=(s,e)=>s.replace(Kf,Qf(e)),Jf=(s,e)=>s.duration||e?s.duration?No(s):Xd(s,e):[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}],Zf=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=gr({baseUrl:s.baseUrl,source:Zu(i.sourceURL,t),range:i.range});return Jf(s,e).map(n=>{t.Number=n.number,t.Time=n.time;const a=Zu(s.media||"",t),l=s.timescale||1,h=s.presentationTimeOffset||0,p=s.periodStart+(n.time-h)/l;return{uri:a,timeline:n.timeline,duration:n.duration,resolvedUri:Mn(s.baseUrl||"",a),map:r,number:n.number,presentationTime:p}})},ey=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=gr({baseUrl:t,source:i.sourceURL,range:i.range}),n=gr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},ty=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(wi.SEGMENT_TIME_UNSPECIFIED);const n=i.map(l=>ey(s,l));let a;return t&&(a=No(s)),e&&(a=Xd(s,e)),a.map((l,h)=>{if(n[h]){const p=n[h],g=s.timescale||1,y=s.presentationTimeOffset||0;return p.timeline=l.timeline,p.duration=l.duration,p.number=l.number,p.presentationTime=r+(l.time-y)/g,p}}).filter(l=>l)},sy=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=Zf,t=Ze(s,e.template)):e.base?(i=Wd,t=Ze(s,e.base)):e.list&&(i=ty,t=Ze(s,e.list));const r={attributes:s};if(!i)return r;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:l=1}=t;t.duration=a/l}else n.length?t.duration=n.reduce((a,l)=>Math.max(a,Math.ceil(l.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},iy=s=>s.map(sy),Be=(s,e)=>zd(s.childNodes).filter(({tagName:t})=>t===e),br=s=>s.textContent.trim(),ry=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),ai=s=>{const e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!e)return 0;const[t,i,r,n,a,l]=e.slice(1);return parseFloat(t||0)*31536e3+parseFloat(i||0)*2592e3+parseFloat(r||0)*86400+parseFloat(n||0)*3600+parseFloat(a||0)*60+parseFloat(l||0)},ny=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),eh={mediaPresentationDuration:s=>ai(s),availabilityStartTime:s=>ny(s)/1e3,minimumUpdatePeriod:s=>ai(s),suggestedPresentationDelay:s=>ai(s),type:s=>s,timeShiftBufferDepth:s=>ai(s),start:s=>ai(s),width:s=>parseInt(s,10),height:s=>parseInt(s,10),bandwidth:s=>parseInt(s,10),frameRate:s=>ry(s),startNumber:s=>parseInt(s,10),timescale:s=>parseInt(s,10),presentationTimeOffset:s=>parseInt(s,10),duration(s){const e=parseInt(s,10);return isNaN(e)?ai(s):e},d:s=>parseInt(s,10),t:s=>parseInt(s,10),r:s=>parseInt(s,10),presentationTime:s=>parseInt(s,10),DEFAULT:s=>s},Xe=s=>s&&s.attributes?zd(s.attributes).reduce((e,t)=>{const i=eh[t.name]||eh.DEFAULT;return e[t.name]=i(t.value),e},{}):{},ay={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Un=(s,e)=>e.length?Ci(s.map(function(t){return e.map(function(i){const r=br(i),n=Mn(t.baseUrl,r),a=Ze(Xe(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,Bo=s=>{const e=Be(s,"SegmentTemplate")[0],t=Be(s,"SegmentList")[0],i=t&&Be(t,"SegmentURL").map(y=>Ze({tag:"SegmentURL"},Xe(y))),r=Be(s,"SegmentBase")[0],n=t||e,a=n&&Be(n,"SegmentTimeline")[0],l=t||r||e,h=l&&Be(l,"Initialization")[0],p=e&&Xe(e);p&&h?p.initialization=h&&Xe(h):p&&p.initialization&&(p.initialization={sourceURL:p.initialization});const g={template:p,segmentTimeline:a&&Be(a,"S").map(y=>Xe(y)),list:t&&Ze(Xe(t),{segmentUrls:i,initialization:Xe(h)}),base:r&&Ze(Xe(r),{initialization:Xe(h)})};return Object.keys(g).forEach(y=>{g[y]||delete g[y]}),g},oy=(s,e,t)=>i=>{const r=Be(i,"BaseURL"),n=Un(e,r),a=Ze(s,Xe(i)),l=Bo(i);return n.map(h=>({segmentInfo:Ze(t,l),attributes:Ze(a,h)}))},ly=s=>s.reduce((e,t)=>{const i=Xe(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=ay[i.schemeIdUri];if(r){e[r]={attributes:i};const n=Be(t,"cenc:pssh")[0];if(n){const a=br(n);e[r].pssh=a&&Bd(a)}}return e},{}),uy=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,r=""]=e.split("=");t.channel=i,t.language=e,r.split(",").forEach(n=>{const[a,l]=n.split(":");a==="lang"?t.language=l:a==="er"?t.easyReader=Number(l):a==="war"?t.aspectRatio=Number(l):a==="3D"&&(t["3D"]=Number(l))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})},hy=s=>Ci(Be(s.node,"EventStream").map(e=>{const t=Xe(e),i=t.schemeIdUri;return Be(e,"Event").map(r=>{const n=Xe(r),a=n.presentationTime||0,l=t.timescale||1,h=n.duration||0,p=a/l+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:p,end:p+h/l,messageData:br(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),dy=(s,e,t)=>i=>{const r=Xe(i),n=Un(e,Be(i,"BaseURL")),a=Be(i,"Role")[0],l={role:Xe(a)};let h=Ze(s,r,l);const p=Be(i,"Accessibility")[0],g=uy(Xe(p));g&&(h=Ze(h,{captionServices:g}));const y=Be(i,"Label")[0];if(y&&y.childNodes.length){const L=y.childNodes[0].nodeValue.trim();h=Ze(h,{label:L})}const w=ly(Be(i,"ContentProtection"));Object.keys(w).length&&(h=Ze(h,{contentProtection:w}));const E=Bo(i),I=Be(i,"Representation"),v=Ze(t,E);return Ci(I.map(oy(h,n,v)))},cy=(s,e)=>(t,i)=>{const r=Un(e,Be(t.node,"BaseURL")),n=Ze(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Be(t.node,"AdaptationSet"),l=Bo(t.node);return Ci(a.map(dy(n,r,l)))},py=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=Ze({serverURL:br(s[0])},Xe(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},my=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:e||t!=="static"?null:0,gy=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Be(s,"Period");if(!a.length)throw new Error(wi.INVALID_NUMBER_OF_PERIOD);const l=Be(s,"Location"),h=Xe(s),p=Un([{baseUrl:t}],Be(s,"BaseURL")),g=Be(s,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=i,h.clientOffset=r,l.length&&(h.locations=l.map(br));const y=[];return a.forEach((w,E)=>{const I=Xe(w),v=y[E-1];I.start=my({attributes:I,priorPeriodAttributes:v?v.attributes:null,mpdType:h.type}),y.push({node:w,attributes:I})}),{locations:h.locations,contentSteeringInfo:py(g,n),representationInfo:Ci(y.map(cy(h,p))),eventStream:Ci(y.map(hy))}},Yd=s=>{if(s==="")throw new Error(wi.DASH_EMPTY_MANIFEST);const e=new wf.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(wi.DASH_INVALID_XML);return i},fy=s=>{const e=Be(s,"UTCTiming")[0];if(!e)return null;const t=Xe(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(wi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},yy=(s,e={})=>{const t=gy(Yd(s),e),i=iy(t.representationInfo);return Xf({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},_y=s=>fy(Yd(s));var th,sh,ih,rh;function vy(){if(sh)return th;sh=1;var s=Math.pow(2,32);return th={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))0;r+=12,n--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return i}}const Ty=vr(by());var Sy=ce([73,68,51]),Ey=function(s,e){e===void 0&&(e=0);var t=(s=ce(s))[e+5],i=s[e+6]<<21|s[e+7]<<14|s[e+8]<<7|s[e+9];return(16&t)>>4?i+20:i+10},nr=function s(e,t){return t===void 0&&(t=0),(e=ce(e)).length-t<10||!Me(e,Sy,{offset:t})?t:s(e,t+=Ey(e,t))},nh=function(s){return typeof s=="string"?Hd(s):s},Cy=function(s){return Array.isArray(s)?s.map(function(e){return nh(e)}):[nh(s)]},wy=function s(e,t,i){i===void 0&&(i=!1),t=Cy(t),e=ce(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,l=e.subarray(n+4,n+8);if(a===0)break;var h=n+a;if(h>e.length){if(i)break;h=e.length}var p=e.subarray(n+8,h);Me(l,t[0])&&(t.length===1?r.push(p):r.push.apply(r,s(p,t.slice(1),i))),n=h}return r},Wr={EBML:ce([26,69,223,163]),DocType:ce([66,130]),Segment:ce([24,83,128,103]),SegmentInfo:ce([21,73,169,102]),Tracks:ce([22,84,174,107]),Track:ce([174]),TrackNumber:ce([215]),DefaultDuration:ce([35,227,131]),TrackEntry:ce([174]),TrackType:ce([131]),FlagDefault:ce([136]),CodecID:ce([134]),CodecPrivate:ce([99,162]),VideoTrack:ce([224]),AudioTrack:ce([225]),Cluster:ce([31,67,182,117]),Timestamp:ce([231]),TimestampScale:ce([42,215,177]),BlockGroup:ce([160]),BlockDuration:ce([155]),Block:ce([161]),SimpleBlock:ce([163])},oo=[128,64,32,16,8,4,2,1],Ay=function(s){for(var e=1,t=0;t=t.length)return t.length;var r=on(t,i,!1);if(Me(e.bytes,r.bytes))return i;var n=on(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},oh=function s(e,t){t=xy(t),e=ce(e);var i=[];if(!t.length)return i;for(var r=0;re.length?e.length:l+a.value,p=e.subarray(l,h);Me(t[0],n.bytes)&&(t.length===1?i.push(p):i=i.concat(s(p,t.slice(1)))),r+=n.length+a.length+p.length}return i},Dy=ce([0,0,0,1]),Iy=ce([0,0,1]),Py=ce([0,0,3]),Ly=function(s){for(var e=[],t=1;t>1&63),t.indexOf(h)!==-1&&(r=n+l),n+=l+(e==="h264"?1:2)}else n++}return s.subarray(0,0)},Oy=function(s,e,t){return Kd(s,"h264",e,t)},Ny=function(s,e,t){return Kd(s,"h265",e,t)},dt={webm:ce([119,101,98,109]),matroska:ce([109,97,116,114,111,115,107,97]),flac:ce([102,76,97,67]),ogg:ce([79,103,103,83]),ac3:ce([11,119]),riff:ce([82,73,70,70]),avi:ce([65,86,73]),wav:ce([87,65,86,69]),"3gp":ce([102,116,121,112,51,103]),mp4:ce([102,116,121,112]),fmp4:ce([115,116,121,112]),mov:ce([102,116,121,112,113,116]),moov:ce([109,111,111,118]),moof:ce([109,111,111,102])},Ai={aac:function(s){var e=nr(s);return Me(s,[255,16],{offset:e,mask:[255,22]})},mp3:function(s){var e=nr(s);return Me(s,[255,2],{offset:e,mask:[255,6]})},webm:function(s){var e=oh(s,[Wr.EBML,Wr.DocType])[0];return Me(e,dt.webm)},mkv:function(s){var e=oh(s,[Wr.EBML,Wr.DocType])[0];return Me(e,dt.matroska)},mp4:function(s){return!Ai["3gp"](s)&&!Ai.mov(s)&&(!(!Me(s,dt.mp4,{offset:4})&&!Me(s,dt.fmp4,{offset:4}))||!(!Me(s,dt.moof,{offset:4})&&!Me(s,dt.moov,{offset:4}))||void 0)},mov:function(s){return Me(s,dt.mov,{offset:4})},"3gp":function(s){return Me(s,dt["3gp"],{offset:4})},ac3:function(s){var e=nr(s);return Me(s,dt.ac3,{offset:e})},ts:function(s){if(s.length<189&&s.length>=1)return s[0]===71;for(var e=0;e+1880};function By(){if(uh)return lh;uh=1;var s,e,t,i,r,n,a,l=9e4;return r=function(h,p){return s(i(h,p))},n=function(h,p){return e(t(h),p)},a=function(h,p,g){return t(g?h:h-p)},lh={ONE_SECOND_IN_TS:l,secondsToVideoTs:s=function(h){return h*l},secondsToAudioTs:e=function(h,p){return h*p},videoTsToSeconds:t=function(h){return h/l},audioTsToSeconds:i=function(h,p){return h/p},audioTsToVideoTs:r,videoTsToAudioTs:n,metadataTsToSeconds:a}}var js=By(),uo="8.18.1";const hs={},xs=function(s,e){return hs[s]=hs[s]||[],e&&(hs[s]=hs[s].concat(e)),hs[s]},Fy=function(s,e){xs(s,e)},Qd=function(s,e){const t=xs(s).indexOf(e);return!(t<=-1)&&(hs[s]=hs[s].slice(),hs[s].splice(t,1),!0)},Uy=function(s,e){xs(s,[].concat(e).map(t=>{const i=(...r)=>(Qd(s,i),t(...r));return i}))},ln={prefixed:!0},en=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],hh=en[0];let ar;for(let s=0;s(i,r,n)=>{const a=e.levels[r],l=new RegExp(`^(${a})$`);let h=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(h=`%c${s}`,n.unshift(t)),n.unshift(h+":"),yt){yt.push([].concat(n));const g=yt.length-1e3;yt.splice(0,g>0?g:0)}if(!k.console)return;let p=k.console[i];p||i!=="debug"||(p=k.console.info||k.console.log),p&&a&&l.test(i)&&p[Array.isArray(n)?"apply":"call"](k.console,n)};function ho(s,e=":",t=""){let i,r="info";function n(...a){i("log",r,a)}return i=qy(s,n,t),n.createLogger=(a,l,h)=>{const p=l!==void 0?l:e;return ho(`${s} ${p} ${a}`,p,h!==void 0?h:t)},n.createNewLogger=(a,l,h)=>ho(a,l,h),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);r=a}return r},n.history=()=>yt?[].concat(yt):[],n.history.filter=a=>(yt||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{yt&&(yt.length=0)},n.history.disable=()=>{yt!==null&&(yt.length=0,yt=null)},n.history.enable=()=>{yt===null&&(yt=[])},n.error=(...a)=>i("error",r,a),n.warn=(...a)=>i("warn",r,a),n.debug=(...a)=>i("debug",r,a),n}const Te=ho("VIDEOJS"),Jd=Te.createLogger,jy=Object.prototype.toString,Zd=function(s){return Zt(s)?Object.keys(s):[]};function fi(s,e){Zd(s).forEach(t=>e(s[t],t))}function ec(s,e,t=0){return Zd(s).reduce((i,r)=>e(i,s[r],r),t)}function Zt(s){return!!s&&typeof s=="object"}function xi(s){return Zt(s)&&jy.call(s)==="[object Object]"&&s.constructor===Object}function Ie(...s){const e={};return s.forEach(t=>{t&&fi(t,(i,r)=>{xi(i)?(xi(e[r])||(e[r]={}),e[r]=Ie(e[r],i)):e[r]=i})}),e}function tc(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function un(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var Hy=Object.freeze({__proto__:null,each:fi,reduce:ec,isObject:Zt,isPlain:xi,merge:Ie,values:tc,defineLazyProperty:un});let sc,Uo=!1,ic=null,Kt=!1,rc=!1,hi=!1,di=!1,Qt=!1,co=null,hn=null;const $y=!!(k.cast&&k.cast.framework&&k.cast.framework.CastReceiverContext);let nc=null,dn=!1,cn=!1,pn=!1,qn=!1,mn=!1,gn=!1,fn=!1;const fr=!!(Oi()&&("ontouchstart"in k||k.navigator.maxTouchPoints||k.DocumentTouch&&k.document instanceof k.DocumentTouch)),Ts=k.navigator&&k.navigator.userAgentData;if(Ts&&Ts.platform&&Ts.brands&&(Kt=Ts.platform==="Android",hi=!!Ts.brands.find(s=>s.brand==="Microsoft Edge"),di=!!Ts.brands.find(s=>s.brand==="Chromium"),Qt=!hi&&di,co=hn=(Ts.brands.find(s=>s.brand==="Chromium")||{}).version||null,cn=Ts.platform==="Windows"),!di){const s=k.navigator&&k.navigator.userAgent||"";Uo=/iPod/i.test(s),ic=function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Kt=/Android/i.test(s),sc=function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),rc=/Firefox/i.test(s),hi=/Edg/i.test(s),di=/Chrome/i.test(s)||/CriOS/i.test(s),Qt=!hi&&di,co=hn=function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),nc=function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t}(),mn=/Tizen/i.test(s),gn=/Web0S/i.test(s),fn=mn||gn,dn=/Safari/i.test(s)&&!Qt&&!Kt&&!hi&&!fn,cn=/Windows/i.test(s),pn=/iPad/i.test(s)||dn&&fr&&!/iPhone/i.test(s),qn=/iPhone/i.test(s)&&!pn}const mt=qn||pn||Uo,jn=(dn||mt)&&!Qt;var ac=Object.freeze({__proto__:null,get IS_IPOD(){return Uo},get IOS_VERSION(){return ic},get IS_ANDROID(){return Kt},get ANDROID_VERSION(){return sc},get IS_FIREFOX(){return rc},get IS_EDGE(){return hi},get IS_CHROMIUM(){return di},get IS_CHROME(){return Qt},get CHROMIUM_VERSION(){return co},get CHROME_VERSION(){return hn},IS_CHROMECAST_RECEIVER:$y,get IE_VERSION(){return nc},get IS_SAFARI(){return dn},get IS_WINDOWS(){return cn},get IS_IPAD(){return pn},get IS_IPHONE(){return qn},get IS_TIZEN(){return mn},get IS_WEBOS(){return gn},get IS_SMART_TV(){return fn},TOUCH_ENABLED:fr,IS_IOS:mt,IS_ANY_SAFARI:jn});function dh(s){return typeof s=="string"&&!!s.trim()}function Vy(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Oi(){return re===k.document}function Ni(s){return Zt(s)&&s.nodeType===1}function oc(){try{return k.parent!==k.self}catch{return!0}}function lc(s){return function(e,t){if(!dh(e))return re[s](null);dh(t)&&(t=re.querySelector(t));const i=Ni(t)?t:re;return i[s]&&i[s](e)}}function ge(s="div",e={},t={},i){const r=re.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Is(r,a):r[n]===a&&n!=="tabIndex"||(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&qo(r,i),r}function Is(s,e){return s.textContent===void 0?s.innerText=e:s.textContent=e,s}function po(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function ur(s,e){return Vy(e),s.classList.contains(e)}function Vs(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Hn(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(Te.warn("removeClass was called with an element that doesn't exist"),null)}function uc(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>s.classList.toggle(i,t)),s}function hc(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i==null||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function ws(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let r=i.length-1;r>=0;r--){const n=i[r].name;let a=i[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function dc(s,e){return s.getAttribute(e)}function ki(s,e,t){s.setAttribute(e,t)}function $n(s,e){s.removeAttribute(e)}function cc(){re.body.focus(),re.onselectstart=function(){return!1}}function pc(){re.onselectstart=function(){return!0}}function Di(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(Ii(s,"height"))),t.width||(t.width=parseFloat(Ii(s,"width"))),t}}function yr(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,r=0;for(;s.offsetParent&&s!==re[ln.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Vn(s,e){const t={x:0,y:0};if(mt){let g=s;for(;g&&g.nodeName.toLowerCase()!=="html";){const y=Ii(g,"transform");if(/^matrix/.test(y)){const w=y.slice(7,-1).split(/,\s/).map(Number);t.x+=w[4],t.y+=w[5]}else if(/^matrix3d/.test(y)){const w=y.slice(9,-1).split(/,\s/).map(Number);t.x+=w[12],t.y+=w[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&k.WebKitCSSMatrix){const w=k.getComputedStyle(g.assignedSlot.parentElement).transform,E=new k.WebKitCSSMatrix(w);t.x+=E.m41,t.y+=E.m42}g=g.parentNode||g.host}}const i={},r=yr(e.target),n=yr(s),a=n.width,l=n.height;let h=e.offsetY-(n.top-r.top),p=e.offsetX-(n.left-r.left);return e.changedTouches&&(p=e.changedTouches[0].pageX-n.left,h=e.changedTouches[0].pageY+n.top,mt&&(p-=t.x,h-=t.y)),i.y=1-Math.max(0,Math.min(1,h/l)),i.x=Math.max(0,Math.min(1,p/a)),i}function mc(s){return Zt(s)&&s.nodeType===3}function zn(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function gc(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>(typeof e=="function"&&(e=e()),Ni(e)||mc(e)?e:typeof e=="string"&&/\S/.test(e)?re.createTextNode(e):void 0)).filter(e=>e)}function qo(s,e){return gc(e).forEach(t=>s.appendChild(t)),s}function fc(s,e){return qo(zn(s),e)}function _r(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0||s.button===0&&s.buttons===1}const ks=lc("querySelector"),yc=lc("querySelectorAll");function Ii(s,e){if(!s||!e)return"";if(typeof k.getComputedStyle=="function"){let t;try{t=k.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function _c(s){[...re.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=re.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const t=re.createElement("link");t.rel="stylesheet",t.type=e.type,t.media=e.media.mediaText,t.href=e.href,s.document.head.appendChild(t)}})}var ch=Object.freeze({__proto__:null,isReal:Oi,isEl:Ni,isInFrame:oc,createEl:ge,textContent:Is,prependTo:po,hasClass:ur,addClass:Vs,removeClass:Hn,toggleClass:uc,setAttributes:hc,getAttributes:ws,getAttribute:dc,setAttribute:ki,removeAttribute:$n,blockTextSelection:cc,unblockTextSelection:pc,getBoundingClientRect:Di,findPosition:yr,getPointerPosition:Vn,isTextNode:mc,emptyEl:zn,normalizeContent:gc,appendContent:qo,insertContent:fc,isSingleLeftClick:_r,$:ks,$$:yc,computedStyle:Ii,copyStyleSheetsToWindow:_c});let mo,vc=!1;const zy=function(){if(mo.options.autoSetup===!1)return;const s=Array.prototype.slice.call(re.getElementsByTagName("video")),e=Array.prototype.slice.call(re.getElementsByTagName("audio")),t=Array.prototype.slice.call(re.getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let r=0,n=i.length;r-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function at(s,e,t){if(!pt.has(s))return;const i=pt.get(s);if(!i.handlers)return;if(Array.isArray(e))return jo(at,s,e,t);const r=function(a,l){i.handlers[l]=[],ph(a,l)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(s,a);return}const n=i.handlers[e];if(n)if(t){if(t.guid)for(let a=0;a=e&&(s(...i),t=r)}},Sc=function(s,e,t,i=k){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const l=this,h=arguments;let p=function(){r=null,p=null,t||s.apply(l,h)};!r&&t&&s.apply(l,h),i.clearTimeout(r),r=i.setTimeout(p,e)};return a.cancel=n,a};var Ky=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Dt,bind_:Le,throttle:es,debounce:Sc});let tr;class Et{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ct(this,e,t),this.addEventListener=i}off(e,t){at(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Gn(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ho(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Wn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ri(this,e)}queueTrigger(e){tr||(tr=new Map);const t=e.type||e;let i=tr.get(this);i||(i=new Map,tr.set(this,i));const r=i.get(t);i.delete(t),k.clearTimeout(r);const n=k.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,tr.delete(this)),this.trigger(e)},0);i.set(t,n)}}Et.prototype.allowedEvents_={},Et.prototype.addEventListener=Et.prototype.on,Et.prototype.removeEventListener=Et.prototype.off,Et.prototype.dispatchEvent=Et.prototype.trigger;const Xn=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,ps=s=>s instanceof Et||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),Qy=(s,e)=>{ps(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},yo=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,yn=(s,e,t)=>{if(!s||!s.nodeName&&!ps(s))throw new Error(`Invalid target for ${Xn(e)}#${t}; must be a DOM node or evented object.`)},Ec=(s,e,t)=>{if(!yo(s))throw new Error(`Invalid event type for ${Xn(e)}#${t}; must be a non-empty string or array.`)},Cc=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Xn(e)}#${t}; must be a function.`)},Pa=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let r,n,a;return i?(r=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),yn(r,s,t),Ec(n,s,t),Cc(a,s,t),a=Le(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Bs=(s,e,t,i)=>{yn(s,s,e),s.nodeName?Yy[e](s,t,i):s[e](t,i)},Jy={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"on");if(Bs(t,"on",i,r),!e){const n=()=>this.off(t,i,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,Bs(this,"on","dispose",n),Bs(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"one");if(e)Bs(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Bs(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"any");if(e)Bs(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Bs(t,"any",i,n)}},off(s,e,t){if(!s||yo(s))at(this.eventBusEl_,s,e);else{const i=s,r=e;yn(i,this,"off"),Ec(r,this,"off"),Cc(t,this,"off"),t=Le(this,t),this.off("dispose",t),i.nodeName?(at(i,r,t),at(i,"dispose",t)):ps(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){yn(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!yo(t))throw new Error(`Invalid event type for ${Xn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ri(this.eventBusEl_,s,e)}};function $o(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=ge("span",{className:"vjs-event-bus"});return Object.assign(s,Jy),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&pt.has(i)&&pt.delete(i)}),k.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const Zy={state:{},setState(s){let e;return typeof s=="function"&&(s=s()),fi(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&ps(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function wc(s,e){return Object.assign(s,Zy),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&ps(s)&&s.on("statechanged",s.handleStateChanged),s}const hr=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},He=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},Ac=function(s,e){return He(s)===He(e)};var e_=Object.freeze({__proto__:null,toLowerCase:hr,toTitleCase:He,titleCaseEquals:Ac});class V{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ie({},this.options_),t=this.options_=Ie(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${kt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&($o(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),wc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Ie(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ge(e,t,i)}localize(e,t,i=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],l=r&&r.split("-")[0],h=n&&n[l];let p=i;return a&&a[e]?p=a[e]:h&&h[e]&&(p=h[e]),t&&(p=p.replace(/\{(\d+)\}/g,function(g,y){const w=t[y-1];let E=w;return w===void 0&&(E=g),E})),p}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,r)=>i.concat(r),[]);let t=this;for(let i=0;i=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[He(e.name())]=null,this.childNameIndex_[hr(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const l=a.name;let h=a.opts;if(t[l]!==void 0&&(h=t[l]),h===!1)return;h===!0&&(h={}),h.playerOptions=this.options_.playerOptions;const p=this.addChild(l,h);p&&(this[l]=p)};let r;const n=V.getComponent("Tech");r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(l){return typeof l=="string"?a===l:a===l.name})})).map(a=>{let l,h;return typeof a=="string"?(l=a,h=e[l]||this.options_[l]||{}):(l=a.name,h=a),{name:l,opts:h}}).filter(a=>{const l=V.getComponent(a.opts.componentClass||He(a.name));return l&&!n.isTech(l)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ks(e,t||this.contentEl())}$$(e,t){return yc(e,t||this.contentEl())}hasClass(e){return ur(this.el_,e)}addClass(...e){Vs(this.el_,...e)}removeClass(...e){Hn(this.el_,...e)}toggleClass(e,t){uc(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return dc(this.el_,e)}setAttribute(e,t){ki(this.el_,e,t)}removeAttribute(e){$n(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0)return t!==null&&t==t||(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:this.el_.style[e]=t==="auto"?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+He(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Ii(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${He(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key==="Tab"||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,r=200;let n;this.on("touchstart",function(l){l.touches.length===1&&(t={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=k.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){const h=l.touches[0].pageX-t.pageX,p=l.touches[0].pageY-t.pageY;Math.sqrt(h*h+p*p)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&k.performance.now()-e{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),k.clearTimeout(e)),e}setInterval(e,t){e=Le(this,e),this.clearTimersOnDispose_();const i=k.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),k.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=Le(this,e),t=k.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Le(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),k.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=k.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function i(n){return!!t(n.parentElement)&&!(!t(n)||n.style.opacity==="0"||k.getComputedStyle(n).height==="0px"||k.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(re.documentElement.clientWidth||k.innerWidth)||a.y<0||a.y>(re.documentElement.clientHeight||k.innerHeight))return!1;let l=re.elementFromPoint(a.x,a.y);for(;l;){if(l===n)return!0;if(!l.parentNode)return!1;l=l.parentNode}}return e||(e=this.el()),!(!r(e)||!i(e)||e.parentElement&&!(e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=V.getComponent("Tech"),r=i&&i.isTech(t),n=V===t||V.prototype.isPrototypeOf(t.prototype);if(r||!n){let l;throw l=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${l}.`)}e=He(e),V.components_||(V.components_={});const a=V.getComponent("Player");if(e==="Player"&&a&&a.players){const l=a.players,h=Object.keys(l);if(l&&h.length>0&&h.map(p=>l[p]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return V.components_[e]=t,V.components_[hr(e)]=t,t}static getComponent(e){if(e&&V.components_)return V.components_[e]}}function t_(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function mh(s,e,t,i){return t_(s,i,t.length-1),t[i][e]}function La(s){let e;return e=s===void 0||s.length===0?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:s.length,start:mh.bind(null,"start",0,s),end:mh.bind(null,"end",1,s)},k.Symbol&&k.Symbol.iterator&&(e[k.Symbol.iterator]=()=>(s||[]).values()),e}function Ft(s,e){return Array.isArray(s)?La(s):s===void 0||e===void 0?La():La([[s,e]])}V.registerComponent("Component",V);const xc=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t};let Vo=xc;function kc(s){Vo=s}function Dc(){Vo=xc}function Xs(s,e=s){return Vo(s,e)}var s_=Object.freeze({__proto__:null,createTimeRanges:Ft,createTimeRange:Ft,setFormatTime:kc,resetFormatTime:Dc,formatTime:Xs});function Ic(s,e){let t,i,r=0;if(!e)return 0;s&&s.length||(s=Ft(0,0));for(let n=0;ne&&(i=e),r+=i-t;return r/e}function Ue(s){if(s instanceof Ue)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Zt(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Ue.defaultMessages[this.code]||"")}function dr(s){return s!=null&&typeof s.then=="function"}function Wt(s){dr(s)&&s.then(null,e=>{})}Ue.prototype.code=0,Ue.prototype.message="",Ue.prototype.status=null,Ue.prototype.metadata=null,Ue.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Ue.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Ue.MEDIA_ERR_CUSTOM=0,Ue.prototype.MEDIA_ERR_CUSTOM=0,Ue.MEDIA_ERR_ABORTED=1,Ue.prototype.MEDIA_ERR_ABORTED=1,Ue.MEDIA_ERR_NETWORK=2,Ue.prototype.MEDIA_ERR_NETWORK=2,Ue.MEDIA_ERR_DECODE=3,Ue.prototype.MEDIA_ERR_DECODE=3,Ue.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ue.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ue.MEDIA_ERR_ENCRYPTED=5,Ue.prototype.MEDIA_ERR_ENCRYPTED=5;const Oa=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>(s[t]&&(e[t]=s[t]),e),{cues:s.cues&&Array.prototype.map.call(s.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var gh={textTracksToJson:function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,i=>i.track);return Array.prototype.map.call(e,function(i){const r=Oa(i.track);return i.src&&(r.src=i.src),r}).concat(Array.prototype.filter.call(s.textTracks(),function(i){return t.indexOf(i)===-1}).map(Oa))},jsonToTextTracks:function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>i.addCue(r))}),e.textTracks()},trackToJson_:Oa};const Na="vjs-modal-dialog";class Pi extends V{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ge("div",{className:`${Na}-content`},{role:"document"}),this.descEl_=ge("p",{className:`${Na}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Is(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Na} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),fc(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),zn(this.contentEl()),this.trigger("modalempty")}content(e){return e!==void 0&&(this.content_=e),this.content_}conditionalFocus_(){const e=re.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable())return e.preventDefault(),void this.close();if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof k.HTMLAnchorElement||t instanceof k.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof k.HTMLInputElement||t instanceof k.HTMLSelectElement||t instanceof k.HTMLTextAreaElement||t instanceof k.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof k.HTMLIFrameElement||t instanceof k.HTMLObjectElement||t instanceof k.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}Pi.prototype.options_={pauseOnOpen:!0,temporary:!0},V.registerComponent("ModalDialog",Pi);class Li extends Et{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},ps(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i=0;t--)if(e[t].enabled){Ra(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ra(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ra(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Ma=function(s,e){for(let t=0;t=0;t--)if(e[t].selected){Ma(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,Ma(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Pc extends Li{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class n_{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;tt[r],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(r){r!==i&&(i=r,this.trigger("labelchange"))}})}}const Wo=function(s){return new URL(s,re.baseURI)},Lc=function(s){return new URL(s,re.baseURI).href},Go=function(s){if(typeof s=="string"){const e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(e)return e.pop().toLowerCase()}return""},Yn=function(s,e=k.location){return Wo(s).origin!==e.origin};var u_=Object.freeze({__proto__:null,parseUrl:Wo,getAbsoluteURL:Lc,getFileExtension:Go,isCrossOrigin:Yn});const yh=function(s,e){const t=new k.WebVTT.Parser(k,k.vttjs,k.WebVTT.StringDecoder()),i=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){i.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>0&&(k.console&&k.console.groupCollapsed&&k.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>Te.error(r)),k.console&&k.console.groupEnd&&k.console.groupEnd()),t.flush()},_h=function(s,e){const t={uri:s},i=Yn(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Md(t,Le(this,function(n,a,l){if(n)return Te.error(n,a);e.loaded_=!0,typeof k.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],h=>{if(h.type!=="vttjserror")return yh(l,e);Te.error(`vttjs failed to load, stopping trying to process ${e.src}`)}):yh(l,e)}))};class Tr extends zo{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ie(e,{kind:l_[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=fh[t.mode]||"disabled";const r=t.default;t.kind!=="metadata"&&t.kind!=="chapters"||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new _n(this.cues_),a=new _n(this.activeCues_);let l=!1;this.timeupdateHandler=Le(this,function(p={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))});const h=()=>{this.stopTracking()};this.tech_.one("dispose",h),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>i,set(p){fh[p]&&i!==p&&(i=p,this.preload_||i==="disabled"||this.cues.length!==0||_h(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const p=this.tech_.currentTime(),g=[];for(let y=0,w=this.cues.length;y=p&&g.push(E)}if(l=!1,g.length!==this.activeCues_.length)l=!0;else for(let y=0;yi,set(r){typeof r=="boolean"&&r!==i&&(i=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Nc extends zo{constructor(e={}){const t=Ie(e,{kind:a_[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(r){typeof r=="boolean"&&r!==i&&(i=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class ds extends Et{constructor(e={}){let t;super();const i=new Tr(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=ds.NONE,i.addEventListener("loadeddata",()=>{t=ds.LOADED,this.trigger({type:"load",target:this})})}}ds.prototype.allowedEvents_={load:"load"},ds.NONE=0,ds.LOADING=1,ds.LOADED=2,ds.ERROR=3;const xt={audio:{ListClass:i_,TrackClass:Oc,capitalName:"Audio"},video:{ListClass:r_,TrackClass:Nc,capitalName:"Video"},text:{ListClass:Pc,TrackClass:Tr,capitalName:"Text"}};Object.keys(xt).forEach(function(s){xt[s].getterName=`${s}Tracks`,xt[s].privateName=`${s}Tracks_`});const yi={remoteText:{ListClass:Pc,TrackClass:Tr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:n_,TrackClass:ds,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ct=Object.assign({},xt,yi);function h_(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new ct.text.TrackClass(r);return n.addTrack(a),a}yi.names=Object.keys(yi),xt.names=Object.keys(xt),ct.names=[].concat(yi.names).concat(xt.names);class fe extends V{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ct.names.forEach(i=>{const r=ct[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:e.nativeCaptions!==!0&&e.nativeTextTracks!==!0||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ct.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Le(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ft(0,0)}bufferedPercent(){return Ic(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(xt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(t=>{const i=this[`${t}Tracks`]()||[];let r=i.length;for(;r--;){const n=i[r];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Ue(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ft(0,0):Ft()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){xt.names.forEach(e=>{const t=xt[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!k.WebVTT)if(re.body.contains(this.el())){if(!this.options_["vtt.js"]&&xi(Ru)&&Object.keys(Ru).length>0)return void this.trigger("vttjsloaded");const e=re.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),k.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=l=>e.addTrack(l.track),r=l=>e.removeTrack(l.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;lthis.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=kt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return fe.canPlayType(e.type)}static isTech(e){return e.prototype instanceof fe||e instanceof fe||e===fe}static registerTech(e,t){if(fe.techs_||(fe.techs_={}),!fe.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!fe.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!fe.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=He(e),fe.techs_[e]=t,fe.techs_[hr(e)]=t,e!=="Tech"&&fe.defaultTechOrder_.push(e),t}static getTech(e){if(e)return fe.techs_&&fe.techs_[e]?fe.techs_[e]:(e=He(e),k&&k.videojs&&k.videojs[e]?(Te.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),k.videojs[e]):void 0)}}ct.names.forEach(function(s){const e=ct[s];fe.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),fe.prototype.featuresVolumeControl=!0,fe.prototype.featuresMuteControl=!0,fe.prototype.featuresFullscreenResize=!1,fe.prototype.featuresPlaybackRate=!1,fe.prototype.featuresProgressEvents=!1,fe.prototype.featuresSourceset=!1,fe.prototype.featuresTimeupdateEvents=!1,fe.prototype.featuresNativeTextTracks=!1,fe.prototype.featuresVideoFrameCallback=!1,fe.withSourceHandlers=function(s){s.registerSourceHandler=function(e,t){let i=s.sourceHandlers;i||(i=s.sourceHandlers=[]),t===void 0&&(t=i.length),i.splice(t,0,e)},s.canPlayType=function(e){const t=s.sourceHandlers||[];let i;for(let r=0;rUs(e,zs[e.type],t,s),1)}function p_(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function m_(s,e,t){return s.reduceRight(Xo(t),e[t]())}function g_(s,e,t,i){return e[t](s.reduce(Xo(t),i))}function vh(s,e,t,i=null){const r="call"+He(t),n=s.reduce(Xo(r),i),a=n===bn,l=a?null:e[t](n);return __(s,t,l,a),l}const f_={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},y_={setCurrentTime:1,setMuted:1,setVolume:1},bh={play:1,pause:1};function Xo(s){return(e,t)=>e===bn?bn:t[s]?t[s](e):e}function __(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function v_(s){vn.hasOwnProperty(s.id())&&delete vn[s.id()]}function b_(s,e){const t=vn[s.id()];let i=null;if(t==null)return i=e(s),vn[s.id()]=[[e,i]],i;for(let r=0;r{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let r=0;r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`;const Sh=mn?10009:gn?461:8,oi={codes:{play:415,pause:19,ff:417,rw:412,back:Sh},names:{415:"play",19:"pause",417:"ff",412:"rw",[Sh]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!(!this.names[s.keyCode]||this.names[s.keyCode]!==e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},Eh=5;class C_ extends Et{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(oi.isEventKey(t,"play")||oi.isEventKey(t,"pause")||oi.isEventKey(t,"ff")||oi.isEventKey(t,"rw")){t.preventDefault();const i=oi.getEventName(t);this.performMediaAction_(i)}else oi.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+Eh);break;case"rw":this.userSeek_(this.player_.currentTime()-Eh)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||i)&&t||(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_")){if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el()))return void t.push(r);r.hasOwnProperty("children_")&&r.children_.length>0?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(r.items):this.findSuitableDOMChild(r)&&t.push(r)}if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((a,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>a,getPositions:()=>{const h=a.getBoundingClientRect();return{boundingClientRect:{x:h.x,y:h.y,width:h.width,height:h.height,top:h.top,right:h.right,bottom:h.bottom,left:h.left},center:{x:h.left+h.width/2,y:h.top+h.height/2,width:0,height:0,top:h.top+h.height/2,right:h.left+h.width/2,bottom:h.top+h.height/2,left:h.left+h.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:h=>!0,focus:()=>a.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const l=a.getPositions().center,h=this.calculateDistance_(e,l,i);h=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Te.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const r=ge(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ge("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,Is(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),this.tabIndex_!==void 0&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),this.tabIndex_!==void 0&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}V.registerComponent("ClickableComponent",Kn);class Ba extends Kn{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ge("div",{className:"vjs-poster"})}crossOrigin(e){if(e===void 0)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;e===null||e==="anonymous"||e==="use-credentials"?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(ge("picture",{className:"vjs-poster",tabIndex:-1},{},ge("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Wt(this.player_.play()):this.player_.pause())}}Ba.prototype.crossorigin=Ba.prototype.crossOrigin,V.registerComponent("PosterImage",Ba);const At="#222",Ch="#ccc",A_={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Fa(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else{if(s.length!==7)throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");t=s.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function ls(s,e,t){try{s.style[e]=t}catch{return}}function wh(s){return s?`${s}px`:""}class x_ extends V{constructor(e,t,i){super(e,t,i);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Le(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",n),e.on("playerresize",n);const a=k.screen.orientation||k,l=k.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));const h=this.options_.playerOptions.tracks||[];for(let p=0;p0&&l.forEach(g=>{if(g.style.inset){const y=g.style.inset.split(" ");y.length===3&&Object.assign(g.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!k.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),ls(this.el_,"insetInline",wh(n)),ls(this.el_,"insetBlock",wh(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&ls(a.firstChild,"color",Fa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&ls(a.firstChild,"backgroundColor",Fa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?ls(a,"backgroundColor",Fa(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${At}, 2px 2px 4px ${At}, 2px 2px 5px ${At}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${At}, 2px 2px ${At}, 3px 3px ${At}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Ch}, 0 1px ${Ch}, -1px -1px ${At}, 0 -1px ${At}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}`)),t.fontPercent&&t.fontPercent!==1){const l=k.parseFloat(a.style.fontSize);a.style.fontSize=l*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=A_[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof k.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;ithis.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return Wt(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();const n=()=>r.focus();dr(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Ah.prototype.controlText_="Play Video",V.registerComponent("BigPlayButton",Ah);class D_ extends ot{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}V.registerComponent("CloseButton",D_);class xh extends ot{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Wt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}xh.prototype.controlText_="Play",V.registerComponent("PlayToggle",xh);class _i extends V{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ge("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ge("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||e.type!=="seeking")&&this.updateContent(e)}updateTextNode_(e=0){e=Xs(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Te.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=re.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}_i.prototype.labelText_="Time",_i.prototype.controlText_="Time",V.registerComponent("TimeDisplay",_i);class Ua extends _i{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Ua.prototype.labelText_="Current Time",Ua.prototype.controlText_="Current Time",V.registerComponent("CurrentTimeDisplay",Ua);class qa extends _i{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}qa.prototype.labelText_="Duration",qa.prototype.controlText_="Duration",V.registerComponent("DurationDisplay",qa);class I_ extends V{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}V.registerComponent("TimeDivider",I_);class ja extends _i{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(ge("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}ja.prototype.labelText_="Remaining Time",ja.prototype.controlText_="Remaining Time",V.registerComponent("RemainingTimeDisplay",ja);class P_ extends V{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ge("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ge("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(re.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}V.registerComponent("LiveDisplay",P_);class kh extends ot{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ge("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Sr(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}kh.prototype.controlText_="Seek to live, currently playing live",V.registerComponent("SeekToLive",kh);var L_=Object.freeze({__proto__:null,clamp:Sr});class Yo extends V{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type!=="touchstart"||Qt||e.preventDefault(),cc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;pc(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(Sr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Vn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}V.registerComponent("Slider",Yo);const Ha=(s,e)=>Sr(s/e*100,0,100).toFixed(2)+"%";class O_ extends V{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ge("span",{className:"vjs-control-text"}),i=ge("span",{textContent:this.localize("Loaded")}),r=re.createTextNode(": ");return this.percentageEl_=ge("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=Ha(n,r);this.percent_!==l&&(this.el_.style.width=l,Is(this.percentageEl_,l),this.percent_=l);for(let h=0;hi.length;h--)this.el_.removeChild(a[h-1]);a.length=i.length})}}V.registerComponent("LoadProgressBar",O_);class N_ extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=yr(this.el_),n=Di(this.player_.el()),a=e.width*t;if(!n||!r)return;let l=e.left-n.left+a,h=e.width-a+(n.right-e.right);h||(h=e.width-a,l=a);let p=r.width/2;lr.width&&(p=r.width),p=Math.round(p),this.el_.style.right=`-${p}px`,this.write(i)}write(e){Is(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const l=this.player_.liveTracker.liveWindow(),h=l-t*l;n=(h<1?"":"-")+Xs(h,l)}else n=Xs(i,a);this.update(e,t,n),r&&r()})}}V.registerComponent("TimeTooltip",N_);class $a extends V{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,r)}}$a.prototype.options_={children:[]},mt||Kt||$a.prototype.options_.children.push("timeTooltip"),V.registerComponent("PlayProgressBar",$a);class Dh extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}Dh.prototype.options_={children:["timeTooltip"]},V.registerComponent("MouseTimeDisplay",Dh);const Xr=5,Ih=12;class Va extends Yo{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Le(this,this.update),this.update=es(this.update_,Dt),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.on(re,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){re.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Dt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(re.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===i&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Xs(i,n),Xs(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(Di(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){_r(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!_r(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const r=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(r>=.99)return void n.seekToLiveEdge();const a=n.seekableStart(),l=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=l&&(i=l),i<=a&&(i=a+.1),i===1/0)return}else i=r*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Wt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Xr)}stepBack(){this.userSeek_(this.player_.currentTime()-Xr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Xr*Ih)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Xr*Ih)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.off(re,"visibilitychange",this.toggleVisibility_),super.dispose()}}Va.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},mt||Kt||Va.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),V.registerComponent("SeekBar",Va);class Ph extends V{constructor(e,t){super(e,t),this.handleMouseMove=es(Le(this,this.handleMouseMove),Dt),this.throttledHandleMouseSeek=es(Le(this,this.handleMouseSeek),Dt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;const n=t.el(),a=yr(n);let l=Vn(n,e).x;l=Sr(l,0,1),r&&r.update(a,l),i&&i.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Wt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Ph.prototype.options_={children:["seekBar"]},V.registerComponent("ProgressControl",Ph);class Lh extends ot{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){re.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in k?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof re.exitPictureInPicture=="function"&&super.show()}}Lh.prototype.controlText_="Picture-in-Picture",V.registerComponent("PictureInPictureToggle",Lh);class Oh extends ot{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),re[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Oh.prototype.controlText_="Fullscreen",V.registerComponent("FullscreenToggle",Oh);const R_=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class M_ extends V{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}V.registerComponent("VolumeLevel",M_);class B_ extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=Di(this.el_),a=Di(this.player_.el()),l=e.width*t;if(!a||!n)return;const h=e.left-a.left+l,p=e.width-l+(a.right-e.right);let g=n.width/2;hn.width&&(g=n.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){Is(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}}V.registerComponent("VolumeLevelTooltip",B_);class Nh extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}Nh.prototype.options_={children:["volumeLevelTooltip"]},V.registerComponent("MouseVolumeLevelDisplay",Nh);class Yr extends Yo{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){_r(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=Di(i),n=this.vertical();let a=Vn(i,e);a=n?a.y:a.x,a=Sr(a,0,1),t.update(r,a,n)}_r(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Yr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},mt||Kt||Yr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Yr.prototype.playerEvent="volumechange",V.registerComponent("VolumeBar",Yr);class Rh extends V{constructor(e,t={}){t.vertical=t.vertical||!1,(t.volumeBar===void 0||xi(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),R_(this,e),this.throttledHandleMouseMove=es(Le(this,this.handleMouseMove),Dt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Rh.prototype.options_={children:["volumeBar"]},V.registerComponent("VolumeControl",Rh);const F_=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class Mh extends ot{constructor(e,t){super(e,t),F_(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),mt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Hn(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Vs(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}Mh.prototype.controlText_="Mute",V.registerComponent("MuteToggle",Mh);class Bh extends V{constructor(e,t={}){t.inline!==void 0?t.inline=t.inline:t.inline=!0,(t.volumeControl===void 0||xi(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Ct(re,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),at(re,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Bh.prototype.options_={children:["muteToggle","volumeControl"]},V.registerComponent("VolumePanel",Bh);class Fh extends ot{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Fh.prototype.controlText_="Skip Forward",V.registerComponent("SkipForward",Fh);class Uh extends ot{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();let n;n=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Uh.prototype.controlText_="Skip Backward",V.registerComponent("SkipBackward",Uh);class Mc extends V{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof V&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof V&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ge(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Ct(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||re.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(r=>r.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):e.key!=="ArrowRight"&&e.key!=="ArrowUp"||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}V.registerComponent("Menu",Mc);class Ko extends V{constructor(e,t={}){super(e,t),this.menuButton_=new ot(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=ot.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Ct(re,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Mc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ge("li",{className:"vjs-menu-title",textContent:He(this.options_.title),tabIndex:-1}),i=new V(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t{this.handleTracksChange.apply(this,l)},a=(...l)=>{this.handleSelectedLanguageChange.apply(this,l)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let l;this.on(["tap","click"],function(){if(typeof k.Event!="object")try{l=new k.Event("change")}catch{}l||(l=re.createEvent("Event"),l.initEvent("change",!0,!0)),r.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let r=0;r-1&&a.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}V.registerComponent("OffTextTrackMenuItem",Bc);class Mi extends Qo{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Cr){let i;this.label_&&(i=`${this.label_} off`),e.push(new Bc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const l=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass(`vjs-${a.kind}-menu-item`),e.push(l)}}return e}}V.registerComponent("TextTrackButton",Mi);class Fc extends Er{constructor(e,t){const i=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(He(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(He(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Jo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Uc),e}}Ya.prototype.kinds_=["captions","subtitles"],Ya.prototype.controlText_="Subtitles",V.registerComponent("SubsCapsButton",Ya);class qc extends Er{constructor(e,t){const i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ge("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;ithis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}_o.prototype.contentElType="button",V.registerComponent("PlaybackRateMenuItem",_o);class jh extends Ko{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ge("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new _o(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}jh.prototype.controlText_="Playback Rate",V.registerComponent("PlaybackRateMenuButton",jh);class jc extends V{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}V.registerComponent("Spacer",jc);class U_ extends jc{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}V.registerComponent("CustomControlSpacer",U_);class Hh extends V{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Hh.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},V.registerComponent("ControlBar",Hh);class $h extends Pi{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}$h.prototype.options_=Object.assign({},Pi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),V.registerComponent("ErrorDisplay",$h);class Hc extends V{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ge("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${kt()}`)+"-"+e[1].replace(/\W+/g,""),i=ge("option",{id:t,value:this.localize(e[0]),textContent:e[1]});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}V.registerComponent("TextTrackSelect",Hc);class Ws extends V{constructor(e,t={}){super(e,t);const i=ge("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],l=a.className,h=a.id.replace("%s",this.options_.id_);let p=null;const g=`vjs_select_${kt()}`;if(this.options_.type==="colors"){p=ge("span",{className:l});const w=ge("label",{id:h,className:"vjs-label",textContent:a.label});w.setAttribute("for",g),p.appendChild(w)}const y=new Hc(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:h});this.addChild(y),this.options_.type==="colors"&&(p.appendChild(y.el()),this.el().appendChild(p))}}createEl(){return ge("fieldset",{className:this.options_.className})}}V.registerComponent("TextTrackFieldset",Ws);class $c extends V{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ws(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Ws(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Ws(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-colors"})}}V.registerComponent("TextTrackSettingsColors",$c);class Vc extends V{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ws(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Ws(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Ws(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-font"})}}V.registerComponent("TextTrackSettingsFont",Vc);class zc extends V{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),r=new ot(e,{controlText:i,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new ot(e,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return ge("div",{className:"vjs-track-settings-controls"})}}V.registerComponent("TrackSettingsControls",zc);const Ka="vjs-text-track-settings",Vh=["#000","Black"],zh=["#00F","Blue"],Wh=["#0FF","Cyan"],Gh=["#0F0","Green"],Xh=["#F0F","Magenta"],Yh=["#F00","Red"],Kh=["#FFF","White"],Qh=["#FF0","Yellow"],Qa=["1","Opaque"],Ja=["0.5","Semi-Transparent"],Jh=["0","Transparent"],As={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Vh,Kh,Yh,Gh,zh,Qh,Xh,Wh],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Qa,Ja,Jh],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Kh,Vh,Yh,Gh,zh,Qh,Xh,Wh],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Qa,Ja],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Jh,Ja,Qa],className:"vjs-window-opacity vjs-opacity"}};function Wc(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function q_(s,e){return Wc(s.options[s.options.selectedIndex].value,e)}function j_(s,e,t){if(e){for(let i=0;i{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),fi(As,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return ec(As,(e,t,i)=>{const r=q_(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){fi(As,(t,i)=>{j_(this.$(t.selector),e[i],t.parser)})}setDefaults(){fi(As,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(k.localStorage.getItem(Ka))}catch(t){Te.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?k.localStorage.setItem(Ka,JSON.stringify(e)):k.localStorage.removeItem(Ka)}catch(t){Te.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}V.registerComponent("TextTrackSettings",H_);class $_ extends V{constructor(e,t){let i=t.ResizeObserver||k.ResizeObserver;t.ResizeObserver===null&&(i=!1),super(e,Ie({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||k.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Sc(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const r=this.debouncedHandler_;let n=this.unloadListener_=function(){at(this,"resize",r),at(this,"unload",n),n=null};Ct(this.el_.contentWindow,"unload",n),Ct(this.el_.contentWindow,"resize",r)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}V.registerComponent("ResizeManager",$_);const V_={trackingThreshold:20,liveTolerance:15};class z_ extends V{constructor(e,t){super(e,Ie(V_,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=i=>this.handlePlay(i),this.handleFirstTimeupdate_=i=>this.handleFirstTimeupdate(i),this.handleSeeked_=i=>this.handleSeeked(i),this.seekToLiveEdge_=i=>this.seekToLiveEdge(i),this.reset_(),this.on(this.player_,"durationchange",i=>this.handleDurationchange(i)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(k.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Dt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}V.registerComponent("LiveTracker",z_);class W_ extends V{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ge("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${kt()}`}),description:ge("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${kt()}`})},ge("div",{className:"vjs-title-bar"},{},tc(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],l=i[r];zn(a),n&&Is(a,n),t&&(t.removeAttribute(l),n&&t.setAttribute(l,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}V.registerComponent("TitleBar",W_);const G_={initialDisplay:4e3,position:[],takeFocus:!1};class X_ extends ot{constructor(e,t){super(e,t=Ie(G_,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ge("button",{},{type:"button",class:this.buildCSSClass()},ge("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}V.registerComponent("TransientButton",X_);const vo=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let i=0;iGc([s.el(),k.HTMLMediaElement.prototype,k.Element.prototype,Y_],"innerHTML"),Zh=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=K_(s),r=n=>(...a)=>{const l=n.apply(e,a);return vo(s),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Ie(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},Q_=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Lc(k.Element.prototype.getAttribute.call(this,"src")):""},set(s){return k.Element.prototype.setAttribute.call(this,"src",s),s}}),J_=s=>Gc([s.el(),k.HTMLMediaElement.prototype,Q_],"src"),Z_=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=J_(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Ie(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const l=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),l},e.load=()=>{const n=r.call(e);return vo(s)||(s.triggerSourceset(""),Zh(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):vo(s)||Zh(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class he extends fe{constructor(e,t){super(e,t);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const l=[];for(;a--;){const h=n[a];h.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(h),this.remoteTextTracks().addTrack(h.track),this.textTracks().addTrack(h.track),r||this.el_.hasAttribute("crossorigin")||!Yn(h.src)||(r=!0)):l.push(h))}for(let h=0;h{t=[];for(let n=0;ne.removeEventListener("change",i));const r=()=>{for(let n=0;n{e.removeEventListener("change",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=xt[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:l=>{const h={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(h),e==="text"&&this[yi.remoteText.getterName]().trigger(h)},addtrack(l){r.addTrack(l.track)},removetrack(l){r.removeTrack(l.track)}},a=function(){const l=[];for(let h=0;h{const h=n[l];i.addEventListener(l,h),this.on("dispose",p=>i.removeEventListener(l,h))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){xt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),he.disposeMediaElement(e),e=i}else{e=re.createElement("video");const i=Ie({},this.options_.tag&&ws(this.options_.tag));fr&&this.options_.nativeControlsForTouch===!0||delete i.controls,hc(e,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}this.options_.preload!==void 0&&ki(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&jn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Te(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Kt&&Qt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Wt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){he.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=re.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),k.performance&&(e.creationTime=k.performance.now()),e}}un(he,"TEST_VID",function(){if(!Oi())return;const s=re.createElement("video"),e=re.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}),he.isSupported=function(){try{he.TEST_VID.volume=.5}catch{return!1}return!(!he.TEST_VID||!he.TEST_VID.canPlayType)},he.canPlayType=function(s){return he.TEST_VID.canPlayType(s)},he.canPlaySource=function(s,e){return he.canPlayType(s.type)},he.canControlVolume=function(){try{const s=he.TEST_VID.volume;he.TEST_VID.volume=s/2+.1;const e=s!==he.TEST_VID.volume;return e&&mt?(k.setTimeout(()=>{he&&he.prototype&&(he.prototype.featuresVolumeControl=s!==he.TEST_VID.volume)}),!1):e}catch{return!1}},he.canMuteVolume=function(){try{const s=he.TEST_VID.muted;return he.TEST_VID.muted=!s,he.TEST_VID.muted?ki(he.TEST_VID,"muted","muted"):$n(he.TEST_VID,"muted","muted"),s!==he.TEST_VID.muted}catch{return!1}},he.canControlPlaybackRate=function(){if(Kt&&Qt&&hn<58)return!1;try{const s=he.TEST_VID.playbackRate;return he.TEST_VID.playbackRate=s/2+.1,s!==he.TEST_VID.playbackRate}catch{return!1}},he.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(re.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(re.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(re.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(re.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0},he.supportsNativeTextTracks=function(){return jn||mt&&Qt},he.supportsNativeVideoTracks=function(){return!(!he.TEST_VID||!he.TEST_VID.videoTracks)},he.supportsNativeAudioTracks=function(){return!(!he.TEST_VID||!he.TEST_VID.audioTracks)},he.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([s,e]){un(he.prototype,s,()=>he[e](),!0)}),he.prototype.featuresVolumeControl=he.canControlVolume(),he.prototype.movingMediaElementInDOM=!mt,he.prototype.featuresFullscreenResize=!0,he.prototype.featuresProgressEvents=!0,he.prototype.featuresTimeupdateEvents=!0,he.prototype.featuresVideoFrameCallback=!(!he.TEST_VID||!he.TEST_VID.requestVideoFrameCallback),he.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}},he.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){he.prototype["set"+He(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){he.prototype["set"+He(s)]=function(e){this.el_[s]=e}}),["pause","load","play"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]()}}),fe.withSourceHandlers(he),he.nativeSourceHandler={},he.nativeSourceHandler.canPlayType=function(s){try{return he.TEST_VID.canPlayType(s)}catch{return""}},he.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return he.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Go(s.src);return he.nativeSourceHandler.canPlayType(`video/${t}`)}return""},he.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)},he.nativeSourceHandler.dispose=function(){},he.registerSourceHandler(he.nativeSourceHandler),fe.registerTech("Html5",he);const Xc=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Za={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},bo=["tiny","xsmall","small","medium","large","xlarge","huge"],tn={};bo.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;tn[s]=`vjs-layout-${e}`});const e0={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Ne extends V{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${kt()}`,(t=Object.assign(Ne.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Jd(this.id_),this.fsApi_=ln,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ws(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(l){a[l.toLowerCase()]=t.languages[l]}),this.languages_=a}else this.languages_=Ne.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),$o(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Ct(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Ie(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const a=new k.DOMParser().parseFromString(E_,"image/svg+xml");if(a.querySelector("parsererror"))Te.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const l=a.documentElement;l.style.display="none",this.el_.appendChild(l),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new C_(this),this.addClass("vjs-spatial-navigation-enabled")),fr&&this.addClass("vjs-touch-enabled"),mt||this.addClass("vjs-workinghover"),Ne.players[this.id_]=this;const n=uo.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),at(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),at(re,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ne.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),v_(this),ct.names.forEach(e=>{const t=this[ct[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));const n=ws(t);if(r){for(e=this.el_=t,t=this.tag=re.createElement("video");e.children.length;)t.appendChild(e.firstChild);ur(e,"video-js")||Vs(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(h=>{try{t[h]=e[h]}catch{}})}t.setAttribute("tabindex","-1"),n.tabindex="-1",Qt&&cn&&(t.setAttribute("role","application"),n.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(h){r&&h==="class"||e.setAttribute(h,n[h]),r&&t.setAttribute(h,n[h])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(h=>ac[h]).map(h=>"vjs-device-"+h.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),k.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=bc("vjs-styles-dimensions");const h=ks(".vjs-styles-defaults"),p=ks("head");p.insertBefore(this.styleEl_,h?h.nextSibling:p.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const l=t.getElementsByTagName("a");for(let h=0;h{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(k.VIDEOJS_NO_DYNAMIC_STYLE===!0){const l=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,p=this.tech_&&this.tech_.el();return void(p&&(l>=0&&(p.width=l),h>=0&&(p.height=h)))}let e,t,i,r;i=this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const n=i.split(":"),a=n[1]/n[0];e=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/a:this.videoWidth()||300,t=this.height_!==void 0?this.height_:e*a,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),Tc(this.styleEl_,` + .${r} { + width: ${e}px; + height: ${t}px; + } + + .${r}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${100*a}%; + } + `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=He(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(fe.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ct.names.forEach(h=>{const p=ct[h];a[p.getterName]=this[p.privateName]}),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const l=fe.getTech(e);if(!l)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(Le(this,this.handleTechReady_),!0),gh.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Xc.forEach(h=>{this.on(this.tech_,h,p=>this[`handleTech${He(h)}_`](p))}),Object.keys(Za).forEach(h=>{this.on(this.tech_,h,p=>{this.tech_.playbackRate()===0&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Za[h]}_`].bind(this),event:p}):this[`handleTech${Za[h]}_`](p)})}),this.on(this.tech_,"loadstart",h=>this.handleTechLoadStart_(h)),this.on(this.tech_,"sourceset",h=>this.handleTechSourceset_(h)),this.on(this.tech_,"waiting",h=>this.handleTechWaiting_(h)),this.on(this.tech_,"ended",h=>this.handleTechEnded_(h)),this.on(this.tech_,"seeking",h=>this.handleTechSeeking_(h)),this.on(this.tech_,"play",h=>this.handleTechPlay_(h)),this.on(this.tech_,"pause",h=>this.handleTechPause_(h)),this.on(this.tech_,"durationchange",h=>this.handleTechDurationChange_(h)),this.on(this.tech_,"fullscreenchange",(h,p)=>this.handleTechFullscreenChange_(h,p)),this.on(this.tech_,"fullscreenerror",(h,p)=>this.handleTechFullscreenError_(h,p)),this.on(this.tech_,"enterpictureinpicture",h=>this.handleTechEnterPictureInPicture_(h)),this.on(this.tech_,"leavepictureinpicture",h=>this.handleTechLeavePictureInPicture_(h)),this.on(this.tech_,"error",h=>this.handleTechError_(h)),this.on(this.tech_,"posterchange",h=>this.handleTechPosterChange_(h)),this.on(this.tech_,"textdata",h=>this.handleTechTextData_(h)),this.on(this.tech_,"ratechange",h=>this.handleTechRateChange_(h)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||i==="Html5"&&this.tag||po(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ct.names.forEach(e=>{const t=ct[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=gh.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Te.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. +See https://github.com/videojs/video.js/issues/2617 for more info. +`),this.tech_}version(){return{"video.js":uo}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(dr(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})};let i;return e!=="any"||this.muted()?i=e!=="muted"||this.muted()?this.play():t():(i=this.play(),dr(i)&&(i=i.catch(t))),dr(i)?i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=S_(this,t)),this.cache_.source=Ie({},e,{src:t,type:i});const r=this.cache_.sources.filter(h=>h.src&&h.src===t),n=[],a=this.$$("source"),l=[];for(let h=0;hthis.updateSourceCaches_(n);const i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.click!==void 0&&this.options_.userActions.click===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Wt(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.doubleClick!==void 0&&this.options_.userActions.doubleClick===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let r=re[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in y_)return g_(this.middleware_,this.tech_,e,t);if(e in bh)return vh(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw Te(i),i}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in f_)return m_(this.middleware_,this.tech_,e);if(e in bh)return vh(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Te(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Te(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Te(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Wt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(jn||mt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=n=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Ft(0,0)}scrubbing(e){if(e===void 0)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return e===void 0?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Ft(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Ft(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Ic(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return e!==void 0?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(e===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e===void 0||e===0)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;return this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,r)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),i()}function l(p,g){n(),r(g)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);const h=t.requestFullscreenHelper_(e);h&&(h.then(n,n),h.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(h,p){r(),i(p)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const l=e.exitFullscreenHelper_();l&&(l.then(r,r),l.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=re[this.fsApi_.exitFullscreen]();return e&&Wt(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=re.documentElement.style.overflow,Ct(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow="hidden",Vs(re.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,at(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow=this.docOrigOverflow,Hn(re.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return e!==void 0?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&k.documentPictureInPicture){const e=re.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ge("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),k.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(_c(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in re&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return k.documentPictureInPicture&&k.documentPictureInPicture.window?(k.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in re?re.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(i=>{const r=i.tagName.toLowerCase();return i.isContentEditable?!0:r==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(i.type)===-1:["textarea"].indexOf(r)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=V.getComponent("FullscreenToggle");re[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),V.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),V.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i[l,fe.getTech(l)]).filter(([l,h])=>h?h.isSupported():(Te.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(l,h,p){let g;return l.some(y=>h.some(w=>{if(g=p(y,w),g)return!0})),g};let r;const n=l=>(h,p)=>l(p,h),a=([l,h],p)=>{if(h.canPlaySource(p,this.options_[l.toLowerCase()]))return{source:p,tech:l}};return r=this.options_.sourceOrder?i(e,t,n(a)):i(t,e,a),r||!1}handleSrc_(e,t){if(e===void 0)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Rc(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),c_(this,i[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());p_(n,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Ac(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Wt(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),ps(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return e!==void 0?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):this.options_.autoplay=!!e,t=t===void 0?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return e!==void 0?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(xs("beforeerror").forEach(t=>{const i=t(this,e);Zt(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(e===null)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Ue(e),this.addClass("vjs-error"),Te.error(`(CODE:${this.error_.code} ${Ue.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),xs("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const r=Le(this,this.reportUserActivity),n=function(y){y.screenX===t&&y.screenY===i||(t=y.screenX,i=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},l=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);const h=this.getChild("controlBar");let p;!h||mt||Kt||(h.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(p);const y=this.options_.inactivityTimeout;y<=0||(p=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(g,250)}playbackRate(e){if(e===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e===void 0)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ps(this)&&this.trigger("languagechange"))}languages(){return Ie(Ne.prototype.options_.languages,this.languages_)}toJSON(){const e=Ie(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;ithis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:g,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),i=>({kind:i.kind,label:i.label,language:i.language,src:i.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Tn(t.poster)}]),t}return Ie(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=ws(e),r=i["data-setup"];if(ur(e,"vjs-fill")&&(i.fill=!0),ur(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){Te.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,l=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}ct.names.forEach(function(s){const e=ct[s];Ne.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Ne.prototype.crossorigin=Ne.prototype.crossOrigin,Ne.players={};const sr=k.navigator;Ne.prototype.options_={techOrder:fe.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:sr&&(sr.languages&&sr.languages[0]||sr.userLanguage||sr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1},Xc.forEach(function(s){Ne.prototype[`handleTech${He(s)}_`]=function(){return this.trigger(s)}}),V.registerComponent("Player",Ne);const Sn="plugin",vi="activePlugins_",ci={},En=s=>ci.hasOwnProperty(s),sn=s=>En(s)?ci[s]:void 0,Yc=(s,e)=>{s[vi]=s[vi]||{},s[vi][e]=!0},Cn=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},t0=function(s,e){const t=function(){Cn(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return Yc(this,s),Cn(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},ed=(s,e)=>(e.prototype.name=s,function(...t){Cn(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,Cn(this,i.getEventHash()),i});class _t{constructor(e){if(this.constructor===_t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),$o(this),delete this.trigger,wc(this,this.constructor.defaultState),Yc(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Ri(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[vi][e]=!1,this.player=this.state=null,t[e]=ed(e,ci[e])}static isBasic(e){const t=typeof e=="string"?sn(e):e;return typeof t=="function"&&!_t.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(En(e))Te.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ne.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ci[e]=t,e!==Sn&&(_t.isBasic(t)?Ne.prototype[e]=t0(e,t):Ne.prototype[e]=ed(e,t)),t}static deregisterPlugin(e){if(e===Sn)throw new Error("Cannot de-register base plugin.");En(e)&&(delete ci[e],delete Ne.prototype[e])}static getPlugins(e=Object.keys(ci)){let t;return e.forEach(i=>{const r=sn(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=sn(e);return t&&t.VERSION||""}}function s0(s,e){let t=!1;return function(...i){return t||Te.warn(s),t=!0,e.apply(this,i)}}function Mt(s,e,t,i){return s0(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}_t.getPlugin=sn,_t.BASE_PLUGIN_NAME=Sn,_t.registerPlugin(Sn,_t),Ne.prototype.usingPlugin=function(s){return!!this[vi]&&this[vi][s]===!0},Ne.prototype.hasPlugin=function(s){return!!En(s)};var i0={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Kc=s=>s.indexOf("#")===0?s.slice(1):s;function F(s,e,t){let i=F.getPlayer(s);if(i)return e&&Te.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?ks("#"+Kc(s)):s;if(!Ni(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const n="getRootNode"in r&&r.getRootNode()instanceof k.ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&n.contains(r)||Te.warn("The element supplied is not included in the DOM"),(e=e||{}).restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),xs("beforesetup").forEach(l=>{const h=l(r,Ie(e));Zt(h)&&!Array.isArray(h)?e=Ie(e,h):Te.error("please return an object in beforesetup hooks")});const a=V.getComponent("Player");return i=new a(r,e,t),xs("setup").forEach(l=>l(i)),i}if(F.hooks_=hs,F.hooks=xs,F.hook=Fy,F.hookOnce=Uy,F.removeHook=Qd,k.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Oi()){let s=ks(".vjs-styles-defaults");if(!s){s=bc("vjs-styles-defaults");const e=ks("head");e&&e.insertBefore(s,e.firstChild),Tc(s,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}go(1,F),F.VERSION=uo,F.options=Ne.prototype.options_,F.getPlayers=()=>Ne.players,F.getPlayer=s=>{const e=Ne.players;let t;if(typeof s=="string"){const i=Kc(s),r=e[i];if(r)return r;t=ks("#"+i)}else t=s;if(Ni(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}},F.getAllPlayers=()=>Object.keys(Ne.players).map(s=>Ne.players[s]).filter(Boolean),F.players=Ne.players,F.getComponent=V.getComponent,F.registerComponent=(s,e)=>(fe.isTech(e)&&Te.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),V.registerComponent.call(V,s,e)),F.getTech=fe.getTech,F.registerTech=fe.registerTech,F.use=d_,Object.defineProperty(F,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(F.middleware,"TERMINATOR",{value:bn,writeable:!1,enumerable:!0}),F.browser=ac,F.obj=Hy,F.mergeOptions=Mt(9,"videojs.mergeOptions","videojs.obj.merge",Ie),F.defineLazyProperty=Mt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",un),F.bind=Mt(9,"videojs.bind","native Function.prototype.bind",Le),F.registerPlugin=_t.registerPlugin,F.deregisterPlugin=_t.deregisterPlugin,F.plugin=(s,e)=>(Te.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),_t.registerPlugin(s,e)),F.getPlugins=_t.getPlugins,F.getPlugin=_t.getPlugin,F.getPluginVersion=_t.getPluginVersion,F.addLanguage=function(s,e){return s=(""+s).toLowerCase(),F.options.languages=Ie(F.options.languages,{[s]:e}),F.options.languages[s]},F.log=Te,F.createLogger=Jd,F.time=s_,F.createTimeRange=Mt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ft),F.createTimeRanges=Mt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ft),F.formatTime=Mt(9,"videojs.formatTime","videojs.time.formatTime",Xs),F.setFormatTime=Mt(9,"videojs.setFormatTime","videojs.time.setFormatTime",kc),F.resetFormatTime=Mt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Dc),F.parseUrl=Mt(9,"videojs.parseUrl","videojs.url.parseUrl",Wo),F.isCrossOrigin=Mt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Yn),F.EventTarget=Et,F.any=Ho,F.on=Ct,F.one=Gn,F.off=at,F.trigger=Ri,F.xhr=Md,F.TextTrack=Tr,F.AudioTrack=Oc,F.VideoTrack=Nc,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{F[s]=function(){return Te.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),ch[s].apply(null,arguments)}}),F.computedStyle=Mt(9,"videojs.computedStyle","videojs.dom.computedStyle",Ii),F.dom=ch,F.fn=Ky,F.num=L_,F.str=e_,F.url=u_,F.Error=i0;class r0{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(i){t.enabled_(i)}}),t}}class wn extends F.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new r0(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;ii&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;ti,s.qualityLevels.VERSION=Qc,i},td=function(s){return n0(this,F.obj.merge({},s))};F.registerPlugin("qualityLevels",td),td.VERSION=Qc;const vt=Mn,An=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,It=s=>F.log.debug?F.log.debug.bind(F,"VHS:",`${s} >`):function(){};function we(...s){const e=F.obj||F;return(e.merge||e.mergeOptions).apply(e,s)}function gt(...s){const e=F.time||F;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function a0(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: +`;for(let t=0;t ${r}. Duration (${r-i}) +`}return e}const Gt=1/30,Xt=3*Gt,Jc=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i=e})},Kr=function(s,e){return Jc(s,function(t){return t-Gt>=e})},o0=function(s){if(s.length<2)return gt();const e=[];for(let t=1;t{const e=[];if(!s||!s.length)return"";for(let t=0;t "+s.end(t));return e.join(", ")},u0=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Hs=s=>{const e=[];for(let t=0;tn||(t+=e>r&&e<=n?n-e:n-r)}return t},el=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},To=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),ep=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},tp=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},sp=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=ep(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?3*e.partTargetDuration:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?3*e.targetDuration:0},d0=function(s,e){let t=0,i=e-s.mediaSequence,r=s.segments[i];if(r){if(r.start!==void 0)return{result:r.start,precise:!0};if(r.end!==void 0)return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=s.segments[i],r.end!==void 0)return{result:t+r.end,precise:!0};if(t+=el(s,r),r.start!==void 0)return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},c0=function(s,e){let t,i=0,r=e-s.mediaSequence;for(;ri&&([t,i]=[i,t]),t<0){for(let n=t;nDate.now()},tl=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Qn=function(s){const e=np(s);return!s.disabled&&!e},ap=function(s,e){return e.attributes&&e.attributes[s]},p0=function(s,e,t,i=0){return ap("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-8*i)/e:NaN},So=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>!!Qn(i)&&(i.attributes.BANDWIDTH||0)!(!s&&!e||!s&&e||s&&!e)&&(s===e||!(!s.id||!e.id||s.id!==e.id)||!(!s.resolvedUri||!e.resolvedUri||s.resolvedUri!==e.resolvedUri)||!(!s.uri||!e.uri||s.uri!==e.uri)),id=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const r in t){for(const n in t[r])if(i=e(t[r][n]),i)break;if(i)break}return!!i},wr=s=>{if(!s||!s.playlists||!s.playlists.length)return id(s,e=>e.playlists&&e.playlists.length||e.uri);for(let e=0;eUd(r)))&&!id(s,r=>sl(t,r)))return!1}return!0};var bt={liveEdgeDelay:sp,duration:rp,seekable:function(s,e,t){const i=e||0;let r=sd(s,e,!0,t);return r===null?gt():(r0)for(let p=h-1;p>=0;p--){const g=l[p];if(a+=g.duration,n){if(a<0)continue}else if(a+Gt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-cr({defaultDuration:s.targetDuration,durationList:l,startIndex:h,endIndex:p})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(h<0){for(let p=h;p<0;p++)if(a-=s.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};h=0}for(let p=h;pGt;if(a!==0&&!(y&&a+Gt>=0)||p===l.length-1){if(n){if(a>0)continue}else if(a-Gt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+cr({defaultDuration:s.targetDuration,durationList:l,startIndex:h,endIndex:p})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},isEnabled:Qn,isDisabled:function(s){return s.disabled},isExcluded:np,isIncompatible:tl,playlistEnd:sd,isAes:function(s){for(let e=0;e`${s}-${e}`,lp=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,m0=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new of;s&&a.on("warn",s),e&&a.on("info",e),i.forEach(p=>a.addParser(p)),r.forEach(p=>a.addTagMapper(p)),a.push(t),a.end();const l=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(p){l.hasOwnProperty(p)&&delete l[p]}),l.segments&&l.segments.forEach(function(p){["parts","preloadHints"].forEach(function(g){p.hasOwnProperty(g)&&delete p[g]})})),!l.targetDuration){let p=10;l.segments&&l.segments.length&&(p=l.segments.reduce((g,y)=>Math.max(g,y.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${p}`}),l.targetDuration=p}const h=ep(l);if(h.length&&!l.partTargetDuration){const p=h.reduce((g,y)=>Math.max(g,y.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${p}`}),op.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),l.partTargetDuration=p}return l},Bi=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const r in s.mediaGroups[t][i]){const n=s.mediaGroups[t][i][r];e(n,t,i,r)}})},up=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},g0=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];up({playlist:t,id:bi(e,t.uri)}),t.resolvedUri=vt(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||op.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},f0=s=>{Bi(s,e=>{e.uri&&(e.resolvedUri=vt(s.uri,e.uri))})},y0=(s,e)=>{const t=bi(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:k.location.href,resolvedUri:k.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},hp=(s,e,t=lp)=>{s.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let h=0;h(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime(){const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},l=r&&!n||i;if(t&&n)a.error=ze({},t),a.errorType=F.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=F.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=F.Error.NetworkRequestTimeout;else if(l){const h=i?F.Error.NetworkBodyParserFailed:F.Error.NetworkBadStatus;a.errorType=h,a.status=e.status,a.headers=e.headers}return a},{EventTarget:_0}=F,v0=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=tp(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new k.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&i.searchParams.set(r,t[r])}),s=i.toString()}return s},b0=(s,e)=>{if(!s)return e;const t=we(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let l=0;l{!s.resolvedUri&&s.uri&&(s.resolvedUri=vt(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=vt(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=vt(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=vt(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))})},pp=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;is===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,Eo=(s,e,t=mp)=>{const i=we(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=pp(e);const n=we(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{cp(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let g=0;g{const t=s.segments||[],i=t[t.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],n=r&&r.duration||i&&i.duration;return e&&n?1e3*n:500*(s.partTargetDuration||s.targetDuration||10)},nd=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:i}};class mi extends _0{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=It("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new rd,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=vt(this.main.uri,e.uri);this.llhls&&(t=v0(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request)return i?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:r,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Gs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return m0({onwarn:({message:i})=>this.logger_(`m3u8-parser warn for ${e}: ${i}`),oninfo:({message:i})=>this.logger_(`m3u8-parser info for ${e}: ${i}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(i){this.error=i,this.error.metadata={errorType:F.Error.StreamingHlsPlaylistParserError,error:i}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),up({playlist:a,uri:i,id:r});const l=Eo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,l?(this.main=l,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!l)),n.parsedPlaylist=nd(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new rd,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(k.clearTimeout(this.finalRenditionTimeout),t){const l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=k.setTimeout(this.media.bind(this,e,!1),l))}const i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Co(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(l,h)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=An(e.resolvedUri,h),l)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:h.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=k.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object")return this.src.uri||(this.src.uri=k.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Gs({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=An(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=nd(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,hp(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=pp(i),i.segments.forEach(r=>{cp(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||k.location.href;this.main=y0(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,r=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const l=a.resolvedUri,h=a.id;if(t){const p=this.createCloneURI_(a.resolvedUri,e),g=bi(r,p),y=this.createCloneAttributes_(r,a.attributes),w=this.createClonePlaylist_(a,g,e,y);i.playlists[n]=w,i.playlists[g]=w,i.playlists[p]=w}else i.playlists.splice(n,1);delete i.playlists[h],delete i.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(i.mediaGroups[n]&&i.mediaGroups[n][r]){for(const a in i.mediaGroups[n])if(a===r){for(const l in i.mediaGroups[n][a])i.mediaGroups[n][a][l].playlists.forEach((h,p)=>{const g=i.playlists[h.id],y=g.id,w=g.resolvedUri;delete i.playlists[y],delete i.playlists[w]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=bi(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),h=this.createClonePlaylist_(t,a,e,l);i.playlists[r]=h,i.playlists[a]=h,i.playlists[n]=h,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(r.mediaGroups[n]&&!r.mediaGroups[n][t]){for(const a in r.mediaGroups[n])if(a===i){r.mediaGroups[n][t]={};for(const l in r.mediaGroups[n][a]){const h=r.mediaGroups[n][a][l];r.mediaGroups[n][t][l]=ze({},h);const p=r.mediaGroups[n][t][l],g=this.createCloneURI_(h.resolvedUri,e);p.resolvedUri=g,p.uri=g,p.playlists=[],h.playlists.forEach((y,w)=>{const E=r.playlists[y.id],I=lp(n,t,l),v=bi(t,I);if(E&&!r.playlists[v]){const L=this.createClonePlaylist_(E,v,e),R=L.resolvedUri;r.playlists[v]=L,r.playlists[R]=L}p.playlists[w]=this.createClonePlaylist_(y,v,e)})}}}})}createClonePlaylist_(e,t,i,r){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),we(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const wo=function(s,e,t,i){const r=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&r&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=r.byteLength||r.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),e||s.aborted||t.statusCode===200||t.statusCode===206||t.statusCode===0||(e=new Error("XHR Failed with a response of: "+(s&&(r||s.responseText)))),i(e,s)},S0=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},E0=(s,e,t,i)=>{s&&s.size&&s.forEach(r=>{r(e,t,i)})},gp=function(){const s=function e(t,i){t=we({timeout:45e3},t);const r=e.beforeRequest||F.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||F.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||F.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(F.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const l=F.Vhs.xhr.original===!0?F.xhr:F.Vhs.xhr,h=S0(n,t);n.delete(r);const p=l(h||t,function(y,w){return E0(a,p,y,w),wo(p,y,w,i)}),g=p.abort;return p.abort=function(){return p.aborted=!0,g.apply(p,arguments)},p.uri=t.uri,p.requestType=t.requestType,p.requestTime=Date.now(),p};return s.original=!0,s},C0=function(s){let e;const t=s.offset;return e=typeof s.offset=="bigint"||typeof s.length=="bigint"?k.BigInt(s.offset)+k.BigInt(s.length)-k.BigInt(1):s.offset+s.length-1,"bytes="+t+"-"+e},Ao=function(s){const e={};return s.byterange&&(e.Range=C0(s.byterange)),e},w0=function(s,e){return s.start(e)+"-"+s.end(e)},A0=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},x0=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},fp=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];jd(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},xn=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},yp=function(s){return s.resolvedUri},_p=s=>{const e=Array.prototype.slice.call(s),t=16;let i,r,n="";for(let a=0;a_p(s),D0=s=>{let e,t="";for(e=0;e{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,i=s-(e.videoTimingInfo.transmuxedPresentationStart+t);return new Date(e.dateTimeObject.getTime()+1e3*i)},L0=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,O0=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(tnew Date(n.getTime()+1e3*a)?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:bt.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},N0=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t,i=0;for(let n=0;ni){if(s>i+r.duration*vp)return null;t=r}return{segment:t,estimatedStart:t.videoTimingInfo?t.videoTimingInfo.transmuxedPresentationStart:i-t.duration,type:t.videoTimingInfo?"accurate":"estimate"}},R0=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},M0=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=N0(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},n=P0(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},bp=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(s===void 0||!e||!i)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!M0(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const l=O0(s,e);if(!l)return a({message:`${s} was not found in the stream`});const h=l.segment,p=R0(h.dateTimeObject,s);if(l.type==="estimate")return t===0?a({message:`${s} is not buffered yet. Try again`}):(i(l.estimatedStart+p),void n.one("seeked",()=>{bp({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})}));const g=h.start+p,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),i(g)},ad=(s,e)=>{if(s.readyState===4)return e()},F0=(s,e,t,i)=>{let r,n=[],a=!1;const l=function(y,w,E,I){return w.abort(),a=!0,t(y,w,E,I)},h=function(y,w){if(a)return;if(y)return y.metadata=Gs({requestType:i,request:w,error:y}),l(y,w,"",n);const E=w.responseText.substring(n&&n.byteLength||0,w.responseText.length);if(n=vf(n,Hd(E,!0)),r=r||nr(n),n.length<10||r&&n.lengthl(y,w,"",n));const I=Fo(n);return I==="ts"&&n.length<188||!I&&n.length<376?ad(w,()=>l(y,w,"",n)):l(null,w,I,n)},p={uri:s,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:w,loaded:E}){return wo(y,null,{statusCode:y.status},h)})}},g=e(p,function(y,w){return wo(g,y,w,h)});return g},{EventTarget:U0}=F,od=function(s,e){if(!mp(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length)||!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t`placeholder-uri-${s}-${e}-${i.attributes.NAME||t}`,j0=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=yy(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return hp(n,e,q0),n},H0=(s,e)=>{Bi(s,(t,i,r,n)=>{e.mediaGroups[i][r]&&n in e.mediaGroups[i][r]||delete s.mediaGroups[i][r][n]})},$0=(s,e,t)=>{let i=!0,r=we(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const p=n.playlists[0].id,g=Eo(r,n.playlists[0],od);g&&(r=g,h in r.mediaGroups[a][l]||(r.mediaGroups[a][l][h]=n),r.mediaGroups[a][l][h].playlists[0]=r.playlists[p],i=!1)}}),H0(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},V0=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,ld=(s,e)=>{const t={};for(const i in s){const r=s[i].sidx;if(r){const n=Fn(r);if(!e[n])break;const a=e[n].sidxInfo;V0(a,r)&&(t[n]=e[n])}}return t},z0=(s,e)=>{let t=ld(s.playlists,e);return Bi(s,(i,r,n,a)=>{if(i.playlists&&i.playlists.length){const l=i.playlists;t=we(t,ld(l,e))}}),t};class xo extends U0{constructor(e,t,i={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=It("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error=typeof e!="object"||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const r=e.sidx&&Fn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=k.setTimeout(()=>i(!1),0));const n=An(e.sidx.resolvedUri),a=(h,p)=>{if(this.requestErrored_(h,p,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=p;let w;try{w=Ty(ce(p.response).subarray(8))}catch(E){return E.metadata=Gs({requestType:y,request:p,parseFailure:!0}),void this.requestErrored_(E,p,t)}return g[r]={sidxInfo:e.sidx,sidx:w},Ro(e,w,e.sidx.resolvedUri),i(!0)},l="dash-sidx";this.request=F0(n,this.vhs_.xhr,(h,p,g,y)=>{if(h)return a(h,p);if(!g||g!=="mp4"){const I=g||"unknown";return a({status:p.status,message:`Unsupported ${I} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},p)}const{offset:w,length:E}=e.sidx.byterange;if(y.length>=E+w)return a(h,{response:y.subarray(w,w+E),status:p.status,uri:p.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Ao({byterange:e.sidx.byterange})},a)},l)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},k.clearTimeout(this.minimumUpdatePeriodTimeout_),k.clearTimeout(this.mediaRequest_),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(k.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(()=>this.load(),i)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=k.setTimeout(()=>this.haveMain_(),0)}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){const{requestType:a}=r;i.metadata=Gs({requestType:a,request:r,error:i})}if(this.requestErrored_(i,r))return void(this.state==="HAVE_NOTHING"&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=An(this.mainPlaylistLoader_.srcUrl,r),n?(this.handleMain_(),void this.syncClientServerClock_(()=>e(r,n))):e(r,n)})}syncClientServerClock_(e){const t=_y(this.mainPlaylistLoader_.mainXml_);return t===null?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):t.method==="DIRECT"?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:vt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:a}=r;return this.error.metadata=Gs({requestType:a,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;n=t.method==="HEAD"?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:t});try{i=j0({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:F.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=$0(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,l=[];i.playlists.forEach(p=>{l.push({id:p.id,bandwidth:p.attributes.BANDWIDTH,resolution:p.attributes.RESOLUTION,codecs:p.attributes.CODECS})});const h={duration:n,isLive:!a,renditions:l};t.parsedManifest=h,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(k.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;t===0&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=k.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=z0(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=k.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Co(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Je={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const W0=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t-1)},this.trigger=function(u){var c,d,m,f;if(c=o[u])if(arguments.length===2)for(m=c.length,d=0;d>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},L=function(o){return t(U.hdlr,W[o])},v=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,255&o.duration,85,196,0,0]);return o.samplerate&&(u[12]=o.samplerate>>>24&255,u[13]=o.samplerate>>>16&255,u[14]=o.samplerate>>>8&255,u[15]=255&o.samplerate),t(U.mdhd,u)},I=function(o){return t(U.mdia,v(o),L(o.type),l(o))},a=function(o){return t(U.mfhd,new Uint8Array([0,0,0,0,(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o]))},l=function(o){return t(U.minf,o.type==="video"?t(U.vmhd,te):t(U.smhd,J),i(),M(o))},h=function(o,u){for(var c=[],d=u.length;d--;)c[d]=G(u[d]);return t.apply(null,[U.moof,a(o)].concat(c))},p=function(o){for(var u=o.length,c=[];u--;)c[u]=w(o[u]);return t.apply(null,[U.moov,y(4294967295)].concat(c).concat(g(o)))},g=function(o){for(var u=o.length,c=[];u--;)c[u]=N(o[u]);return t.apply(null,[U.mvex].concat(c))},y=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(U.mvhd,u)},R=function(o){var u,c,d=o.samples||[],m=new Uint8Array(4+d.length);for(c=0;c>>8),f.push(255&d[u].byteLength),f=f.concat(Array.prototype.slice.call(d[u]));for(u=0;u>>8),b.push(255&m[u].byteLength),b=b.concat(Array.prototype.slice.call(m[u]));if(c=[U.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&o.width)>>8,255&o.width,(65280&o.height)>>8,255&o.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(U.avcC,new Uint8Array([1,o.profileIdc,o.profileCompatibility,o.levelIdc,255].concat([d.length],f,[m.length],b))),t(U.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],o.sarRatio){var x=o.sarRatio[0],C=o.sarRatio[1];c.push(t(U.pasp,new Uint8Array([(4278190080&x)>>24,(16711680&x)>>16,(65280&x)>>8,255&x,(4278190080&C)>>24,(16711680&C)>>16,(65280&C)>>8,255&C])))}return t.apply(null,c)},ye=function(o){return t(U.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&o.channelcount)>>8,255&o.channelcount,(65280&o.samplesize)>>8,255&o.samplesize,0,0,0,0,(65280&o.samplerate)>>8,255&o.samplerate,0,0]),r(o))},E=function(o){var u=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,0,(4278190080&o.duration)>>24,(16711680&o.duration)>>16,(65280&o.duration)>>8,255&o.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&o.width)>>8,255&o.width,0,0,(65280&o.height)>>8,255&o.height,0,0]);return t(U.tkhd,u)},G=function(o){var u,c,d,m,f,b,x;return u=t(U.tfhd,new Uint8Array([0,0,0,58,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),b=Math.floor(o.baseMediaDecodeTime/We),x=Math.floor(o.baseMediaDecodeTime%We),c=t(U.tfdt,new Uint8Array([1,0,0,0,b>>>24&255,b>>>16&255,b>>>8&255,255&b,x>>>24&255,x>>>16&255,x>>>8&255,255&x])),f=92,o.type==="audio"?(d=z(o,f),t(U.traf,u,c,d)):(m=R(o),d=z(o,m.length+f),t(U.traf,u,c,d,m))},w=function(o){return o.duration=o.duration||4294967295,t(U.trak,E(o),I(o))},N=function(o){var u=new Uint8Array([0,0,0,0,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(u[u.length-1]=0),t(U.trex,u)},me=function(o,u){var c=0,d=0,m=0,f=0;return o.length&&(o[0].duration!==void 0&&(c=1),o[0].size!==void 0&&(d=2),o[0].flags!==void 0&&(m=4),o[0].compositionTimeOffset!==void 0&&(f=8)),[0,0,c|d|m|f,1,(4278190080&o.length)>>>24,(16711680&o.length)>>>16,(65280&o.length)>>>8,255&o.length,(4278190080&u)>>>24,(16711680&u)>>>16,(65280&u)>>>8,255&u]},ve=function(o,u){var c,d,m,f,b,x;for(u+=20+16*(f=o.samples||[]).length,m=me(f,u),(d=new Uint8Array(m.length+16*f.length)).set(m),c=m.length,x=0;x>>24,d[c++]=(16711680&b.duration)>>>16,d[c++]=(65280&b.duration)>>>8,d[c++]=255&b.duration,d[c++]=(4278190080&b.size)>>>24,d[c++]=(16711680&b.size)>>>16,d[c++]=(65280&b.size)>>>8,d[c++]=255&b.size,d[c++]=b.flags.isLeading<<2|b.flags.dependsOn,d[c++]=b.flags.isDependedOn<<6|b.flags.hasRedundancy<<4|b.flags.paddingValue<<1|b.flags.isNonSyncSample,d[c++]=61440&b.flags.degradationPriority,d[c++]=15&b.flags.degradationPriority,d[c++]=(4278190080&b.compositionTimeOffset)>>>24,d[c++]=(16711680&b.compositionTimeOffset)>>>16,d[c++]=(65280&b.compositionTimeOffset)>>>8,d[c++]=255&b.compositionTimeOffset;return t(U.trun,d)},_e=function(o,u){var c,d,m,f,b,x;for(u+=20+8*(f=o.samples||[]).length,m=me(f,u),(c=new Uint8Array(m.length+8*f.length)).set(m),d=m.length,x=0;x>>24,c[d++]=(16711680&b.duration)>>>16,c[d++]=(65280&b.duration)>>>8,c[d++]=255&b.duration,c[d++]=(4278190080&b.size)>>>24,c[d++]=(16711680&b.size)>>>16,c[d++]=(65280&b.size)>>>8,c[d++]=255&b.size;return t(U.trun,c)},z=function(o,u){return o.type==="audio"?_e(o,u):ve(o,u)};var Ge,Ye,rt,Ut,Ke,ts,Ps,Ys,ms={ftyp:n=function(){return t(U.ftyp,H,S,H,A)},mdat:function(o){return t(U.mdat,o)},moof:h,moov:p,initSegment:function(o){var u,c=n(),d=p(o);return(u=new Uint8Array(c.byteLength+d.byteLength)).set(c),u.set(d,c.byteLength),u}},ss=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Oe=function(o,u){var c=ss();return c.dataOffset=u,c.compositionTimeOffset=o.pts-o.dts,c.duration=o.duration,c.size=4*o.length,c.size+=o.byteLength,o.keyFrame&&(c.flags.dependsOn=2,c.flags.isNonSyncSample=0),c},je={groupNalsIntoFrames:function(o){var u,c,d=[],m=[];for(m.byteLength=0,m.nalCount=0,m.duration=0,d.byteLength=0,u=0;u1&&(u=o.shift(),o.byteLength-=u.byteLength,o.nalCount-=u.nalCount,o[0][0].dts=u.dts,o[0][0].pts=u.pts,o[0][0].duration+=u.duration),o},generateSampleTable:function(o,u){var c,d,m,f,b,x=u||0,C=[];for(c=0;cfs.ONE_SECOND_IN_TS/2))){for((f=Ar()[o.samplerate])||(f=u[0].data),b=0;b=c?o:(u.minSegmentDts=1/0,o.filter(function(d){return d.dts>=c&&(u.minSegmentDts=Math.min(u.minSegmentDts,d.dts),u.minSegmentPts=u.minSegmentDts,!0)}))},generateSampleTable:function(o){var u,c,d=[];for(u=0;u=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},q.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===""},q.prototype.addText=function(o){this.rows[this.rowIdx]+=o},q.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var ae=function(o,u,c){this.serviceNum=o,this.text="",this.currentWindow=new q(-1),this.windows=[],this.stream=c,typeof u=="string"&&this.createTextDecoder(u)};ae.prototype.init=function(o,u){this.startPts=o;for(var c=0;c<8;c++)this.windows[c]=new q(c),typeof u=="function"&&(this.windows[c].beforeRowOverflow=u)},ae.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},ae.prototype.createTextDecoder=function(o){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(o)}catch(u){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+u})}};var le=function(o){o=o||{},le.prototype.init.call(this);var u,c=this,d=o.captionServices||{},m={};Object.keys(d).forEach(f=>{u=d[f],/^SERVICE/.test(f)&&(m[f]=u.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(f){f.type===3?(c.new708Packet(),c.add708Bytes(f)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(f))}};le.prototype=new Qs,le.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},le.prototype.add708Bytes=function(o){var u=o.ccData,c=u>>>8,d=255&u;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(c),this.current708Packet.data.push(d)},le.prototype.push708Packet=function(){var o=this.current708Packet,u=o.data,c=null,d=null,m=0,f=u[m++];for(o.seq=f>>6,o.sizeCode=63&f;m>5)===7&&d>0&&(c=f=u[m++]),this.pushServiceBlock(c,m,d),d>0&&(m+=d-1)},le.prototype.pushServiceBlock=function(o,u,c){var d,m=u,f=this.current708Packet.data,b=this.services[o];for(b||(b=this.initService(o,m));m("0"+(255&be).toString(16)).slice(-2)).join("")}if(b?(m=[D,j],o++):m=[D],u.textDecoder_&&!f)d=u.textDecoder_.decode(new Uint8Array(m));else if(b){const de=ue(m);d=String.fromCharCode(parseInt(de,16))}else d=T(C|D);return X.pendingNewLine&&!X.isEmpty()&&X.newLine(this.getPts(o)),X.pendingNewLine=!1,X.addText(d),o},le.prototype.multiByteCharacter=function(o,u){var c=this.current708Packet.data,d=c[o+1],m=c[o+2];return P(d)&&P(m)&&(o=this.handleText(++o,u,{isMultiByte:!0})),o},le.prototype.setCurrentWindow=function(o,u){var c=7&this.current708Packet.data[o];return u.setCurrentWindow(c),o},le.prototype.defineWindow=function(o,u){var c=this.current708Packet.data,d=c[o],m=7&d;u.setCurrentWindow(m);var f=u.currentWindow;return d=c[++o],f.visible=(32&d)>>5,f.rowLock=(16&d)>>4,f.columnLock=(8&d)>>3,f.priority=7&d,d=c[++o],f.relativePositioning=(128&d)>>7,f.anchorVertical=127&d,d=c[++o],f.anchorHorizontal=d,d=c[++o],f.anchorPoint=(240&d)>>4,f.rowCount=15&d,d=c[++o],f.columnCount=63&d,d=c[++o],f.windowStyle=(56&d)>>3,f.penStyle=7&d,f.virtualRowCount=f.rowCount+1,o},le.prototype.setWindowAttributes=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.winAttr;return d=c[++o],m.fillOpacity=(192&d)>>6,m.fillRed=(48&d)>>4,m.fillGreen=(12&d)>>2,m.fillBlue=3&d,d=c[++o],m.borderType=(192&d)>>6,m.borderRed=(48&d)>>4,m.borderGreen=(12&d)>>2,m.borderBlue=3&d,d=c[++o],m.borderType+=(128&d)>>5,m.wordWrap=(64&d)>>6,m.printDirection=(48&d)>>4,m.scrollDirection=(12&d)>>2,m.justify=3&d,d=c[++o],m.effectSpeed=(240&d)>>4,m.effectDirection=(12&d)>>2,m.displayEffect=3&d,o},le.prototype.flushDisplayed=function(o,u){for(var c=[],d=0;d<8;d++)u.windows[d].visible&&!u.windows[d].isEmpty()&&c.push(u.windows[d].getText());u.endPts=o,u.text=c.join(` + +`),this.pushCaption(u),u.startPts=o},le.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},le.prototype.displayWindows=function(o,u){var c=this.current708Packet.data[++o],d=this.getPts(o);this.flushDisplayed(d,u);for(var m=0;m<8;m++)c&1<>4,m.offset=(12&d)>>2,m.penSize=3&d,d=c[++o],m.italics=(128&d)>>7,m.underline=(64&d)>>6,m.edgeType=(56&d)>>3,m.fontStyle=7&d,o},le.prototype.setPenColor=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.penColor;return d=c[++o],m.fgOpacity=(192&d)>>6,m.fgRed=(48&d)>>4,m.fgGreen=(12&d)>>2,m.fgBlue=3&d,d=c[++o],m.bgOpacity=(192&d)>>6,m.bgRed=(48&d)>>4,m.bgGreen=(12&d)>>2,m.bgBlue=3&d,d=c[++o],m.edgeRed=(48&d)>>4,m.edgeGreen=(12&d)>>2,m.edgeBlue=3&d,o},le.prototype.setPenLocation=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.penLoc;return u.currentWindow.pendingNewLine=!0,d=c[++o],m.row=15&d,d=c[++o],m.column=63&d,o},le.prototype.reset=function(o,u){var c=this.getPts(o);return this.flushDisplayed(c,u),this.initService(u.serviceNum,o)};var De={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ee=function(o){return o===null?"":(o=De[o]||o,String.fromCharCode(o))},wt=14,qt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],st=function(){for(var o=[],u=wt+1;u--;)o.push({text:"",indent:0,offset:0});return o},Ae=function(o,u){Ae.prototype.init.call(this),this.field_=o||0,this.dataChannel_=u||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(c){var d,m,f,b,x;if((d=32639&c.ccData)!==this.lastControlCode_){if((61440&d)==4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),f=d>>>8,b=255&d,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(c.pts),this.flushDisplayed(c.pts),m=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=m,this.startPts_=c.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(c.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(c.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(c.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(c.pts),this.flushDisplayed(c.pts),this.shiftRowsUp_(),this.startPts_=c.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(c.pts),this.displayed_=st();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=st();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(c.pts),this.displayed_=st()),this.mode_="paintOn",this.startPts_=c.pts;else if(this.isSpecialCharacter(f,b))x=Ee((f=(3&f)<<8)|b),this[this.mode_](c.pts,x),this.column_++;else if(this.isExtCharacter(f,b))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),x=Ee((f=(3&f)<<8)|b),this[this.mode_](c.pts,x),this.column_++;else if(this.isMidRowCode(f,b))this.clearFormatting(c.pts),this[this.mode_](c.pts," "),this.column_++,14&~b||this.addFormatting(c.pts,["i"]),1&~b||this.addFormatting(c.pts,["u"]);else if(this.isOffsetControlCode(f,b)){const D=3&b;this.nonDisplayed_[this.row_].offset=D,this.column_+=D}else if(this.isPAC(f,b)){var C=qt.indexOf(7968&d);if(this.mode_==="rollUp"&&(C-this.rollUpRows_+1<0&&(C=this.rollUpRows_-1),this.setRollUp(c.pts,C)),C!==this.row_&&C>=0&&C<=14&&(this.clearFormatting(c.pts),this.row_=C),1&b&&this.formatting_.indexOf("u")===-1&&this.addFormatting(c.pts,["u"]),!(16&~d)){const D=(14&d)>>1;this.column_=4*D,this.nonDisplayed_[this.row_].indent+=D}this.isColorPAC(b)&&(14&~b||this.addFormatting(c.pts,["i"]))}else this.isNormalChar(f)&&(b===0&&(b=null),x=Ee(f),x+=Ee(b),this[this.mode_](c.pts,x),this.column_+=x.length)}else this.lastControlCode_=null}};Ae.prototype=new Qs,Ae.prototype.flushDisplayed=function(o){const u=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},c=[];this.displayed_.forEach((d,m)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{u(m)}d.text.length&&c.push({text:d.text,line:m+1,position:10+Math.min(70,10*d.indent)+2.5*d.offset})}else d==null&&u(m)}),c.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:c,stream:this.name_})},Ae.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=st(),this.nonDisplayed_=st(),this.lastControlCode_=null,this.column_=0,this.row_=wt,this.rollUpRows_=2,this.formatting_=[]},Ae.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ae.prototype.isSpecialCharacter=function(o,u){return o===this.EXT_&&u>=48&&u<=63},Ae.prototype.isExtCharacter=function(o,u){return(o===this.EXT_+1||o===this.EXT_+2)&&u>=32&&u<=63},Ae.prototype.isMidRowCode=function(o,u){return o===this.EXT_&&u>=32&&u<=47},Ae.prototype.isOffsetControlCode=function(o,u){return o===this.OFFSET_&&u>=33&&u<=35},Ae.prototype.isPAC=function(o,u){return o>=this.BASE_&&o=64&&u<=127},Ae.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Ae.prototype.isNormalChar=function(o){return o>=32&&o<=127},Ae.prototype.setRollUp=function(o,u){if(this.mode_!=="rollUp"&&(this.row_=wt,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=st(),this.displayed_=st()),u!==void 0&&u!==this.row_)for(var c=0;c"},"");this[this.mode_](o,c)},Ae.prototype.clearFormatting=function(o){if(this.formatting_.length){var u=this.formatting_.reverse().reduce(function(c,d){return c+""},"");this.formatting_=[],this[this.mode_](o,u)}},Ae.prototype.popOn=function(o,u){var c=this.nonDisplayed_[this.row_].text;c+=u,this.nonDisplayed_[this.row_].text=c},Ae.prototype.rollUp=function(o,u){var c=this.displayed_[this.row_].text;c+=u,this.displayed_[this.row_].text=c},Ae.prototype.shiftRowsUp_=function(){var o;for(o=0;ou&&(c=-1);Math.abs(u-o)>_s;)o+=c*Lt;return o},Ht=function(o){var u,c;Ht.prototype.init.call(this),this.type_=o||Ls,this.push=function(d){d.type!=="metadata"?this.type_!==Ls&&d.type!==this.type_||(c===void 0&&(c=d.dts),d.dts=Js(d.dts,c),d.pts=Js(d.pts,c),u=d.dts,this.trigger("data",d)):this.trigger("data",d)},this.flush=function(){c=u,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){c=void 0,u=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ht.prototype=new ns;var Zs,nl={TimestampRolloverStream:Ht,handleRollover:Js},Qp=(o,u,c)=>{if(!o)return-1;for(var d=c;d";o.data[0]===Ir.Utf8&&((u=Dr(o.data,0,d))<0||(o.mimeType=Vi(o.data,d,u),d=u+1,o.pictureType=o.data[d],d++,(c=Dr(o.data,0,d))<0||(o.description=$i(o.data,d,c),d=c+1,o.mimeType===m?o.url=Vi(o.data,d,o.data.length):o.pictureData=o.data.subarray(d,o.data.length))))},"T*":function(o){o.data[0]===Ir.Utf8&&(o.value=$i(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var u;o.data[0]===Ir.Utf8&&(u=Dr(o.data,0,1))!==-1&&(o.description=$i(o.data,1,u),o.value=$i(o.data,u+1,o.data.length).replace(/\0*$/,""),o.data=o.value)},"W*":function(o){o.url=Vi(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var u;o.data[0]===Ir.Utf8&&(u=Dr(o.data,0,1))!==-1&&(o.description=$i(o.data,1,u),o.url=Vi(o.data,u+1,o.data.length).replace(/\0.*$/,""))},PRIV:function(o){var u;for(u=0;u>>2;de*=4,de+=3&ue[7],j.timeStamp=de,x.pts===void 0&&x.dts===void 0&&(x.pts=j.timeStamp,x.dts=j.timeStamp),this.trigger("timestamp",j)}x.frames.push(j),C+=10,C+=D}while(C>>4>1&&(b+=m[b]+1),f.pid===0)f.type="pat",o(m.subarray(b),f),this.trigger("data",f);else if(f.pid===this.pmtPid)for(f.type="pmt",o(m.subarray(b),f),this.trigger("data",f);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([m,b,f]):this.processPes_(m,b,f)},this.processPes_=function(m,f,b){b.pid===this.programMapTable.video?b.streamType=Ot.H264_STREAM_TYPE:b.pid===this.programMapTable.audio?b.streamType=Ot.ADTS_STREAM_TYPE:b.streamType=this.programMapTable["timed-metadata"][b.pid],b.type="pes",b.data=m.subarray(f),this.trigger("data",b)}},Gi.prototype=new Zn,Gi.STREAM_TYPES={h264:27,adts:15},Pr=function(){var o,u=this,c=!1,d={data:[],size:0},m={data:[],size:0},f={data:[],size:0},b=function(C,D){var j;const X=C[0]<<16|C[1]<<8|C[2];D.data=new Uint8Array,X===1&&(D.packetLength=6+(C[4]<<8|C[5]),D.dataAlignmentIndicator=!!(4&C[6]),192&(j=C[7])&&(D.pts=(14&C[9])<<27|(255&C[10])<<20|(254&C[11])<<12|(255&C[12])<<5|(254&C[13])>>>3,D.pts*=4,D.pts+=(6&C[13])>>>1,D.dts=D.pts,64&j&&(D.dts=(14&C[14])<<27|(255&C[15])<<20|(254&C[16])<<12|(255&C[17])<<5|(254&C[18])>>>3,D.dts*=4,D.dts+=(6&C[18])>>>1)),D.data=C.subarray(9+C[8]))},x=function(C,D,j){var X,ue=new Uint8Array(C.size),de={type:D},be=0,Ce=0,nt=!1;if(C.data.length&&!(C.size<9)){for(de.trackId=C.data[0].pid,be=0;be>5,C=(x=1024*(1+(3&u[D+6])))*im/ul[(60&u[D+2])>>>2],u.byteLength-D>>6&3),channelcount:(1&u[D+2])<<2|(192&u[D+3])>>>6,samplerate:ul[(60&u[D+2])>>>2],samplingfrequencyindex:(60&u[D+2])>>>2,samplesize:16,data:u.subarray(D+7+f,D+m)}),c++,D+=m}else typeof j!="number"&&(j=D),D++;typeof j=="number"&&(this.skipWarn_(j,D),j=null),u=u.subarray(D)}},this.flush=function(){c=0,this.trigger("done")},this.reset=function(){u=void 0,this.trigger("reset")},this.endTimeline=function(){u=void 0,this.trigger("endedtimeline")}}).prototype=new sm;var Lr,Or,hl,rm=ia,dl=Fe,nm=function(o){var u=o.byteLength,c=0,d=0;this.length=function(){return 8*u},this.bitsAvailable=function(){return 8*u+d},this.loadWord=function(){var m=o.byteLength-u,f=new Uint8Array(4),b=Math.min(4,u);if(b===0)throw new Error("no bytes available");f.set(o.subarray(m,m+b)),c=new DataView(f.buffer).getUint32(0),d=8*b,u-=b},this.skipBits=function(m){var f;d>m?(c<<=m,d-=m):(m-=d,m-=8*(f=Math.floor(m/8)),u-=f,this.loadWord(),c<<=m,d-=m)},this.readBits=function(m){var f=Math.min(d,m),b=c>>>32-f;return(d-=f)>0?c<<=f:u>0&&this.loadWord(),(f=m-f)>0?b<>>m)return c<<=m,d-=m,m;return this.loadWord(),m+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var m=this.skipLeadingZeros();return this.readBits(m+1)-1},this.readExpGolomb=function(){var m=this.readUnsignedExpGolomb();return 1&m?1+m>>>1:-1*(m>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(Or=function(){var o,u,c=0;Or.prototype.init.call(this),this.push=function(d){var m;u?((m=new Uint8Array(u.byteLength+d.data.byteLength)).set(u),m.set(d.data,u.byteLength),u=m):u=d.data;for(var f=u.byteLength;c3&&this.trigger("data",u.subarray(c+3)),u=null,c=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new dl,hl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Lr=function(){var o,u,c,d,m,f,b,x=new Or;Lr.prototype.init.call(this),o=this,this.push=function(C){C.type==="video"&&(u=C.trackId,c=C.pts,d=C.dts,x.push(C))},x.on("data",function(C){var D={trackId:u,pts:c,dts:d,data:C,nalUnitTypeCode:31&C[0]};switch(D.nalUnitTypeCode){case 5:D.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:D.nalUnitType="sei_rbsp",D.escapedRBSP=m(C.subarray(1));break;case 7:D.nalUnitType="seq_parameter_set_rbsp",D.escapedRBSP=m(C.subarray(1)),D.config=f(D.escapedRBSP);break;case 8:D.nalUnitType="pic_parameter_set_rbsp";break;case 9:D.nalUnitType="access_unit_delimiter_rbsp"}o.trigger("data",D)}),x.on("done",function(){o.trigger("done")}),x.on("partialdone",function(){o.trigger("partialdone")}),x.on("reset",function(){o.trigger("reset")}),x.on("endedtimeline",function(){o.trigger("endedtimeline")}),this.flush=function(){x.flush()},this.partialFlush=function(){x.partialFlush()},this.reset=function(){x.reset()},this.endTimeline=function(){x.endTimeline()},b=function(C,D){var j,X=8,ue=8;for(j=0;j=0?c:0,(16&o[u+5])>>4?c+20:c+10},pl=function(o,u){return o.length-u<10||o[u]!==73||o[u+1]!==68||o[u+2]!==51?u:(u+=cl(o,u),pl(o,u))},ml=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},lm=function(o,u,c){var d,m="";for(d=u;d=u+2&&!(255&~o[u])&&!(240&~o[u+1])&&(22&o[u+1])==16},parseId3TagSize:cl,parseAdtsSize:function(o,u){var c=(224&o[u+5])>>5,d=o[u+4]<<3;return 6144&o[u+3]|d|c},parseType:function(o,u){return o[u]===73&&o[u+1]===68&&o[u+2]===51?"timed-metadata":!0&o[u]&&!(240&~o[u+1])?"audio":null},parseSampleRate:function(o){for(var u=0;u+5>>2];u++}return null},parseAacTimestamp:function(o){var u,c,d;u=10,64&o[5]&&(u+=4,u+=ml(o.subarray(10,14)));do{if((c=ml(o.subarray(u+4,u+8)))<1)return null;if(String.fromCharCode(o[u],o[u+1],o[u+2],o[u+3])==="PRIV"){d=o.subarray(u+10,u+c+10);for(var m=0;m>>2;return b*=4,b+=3&f[7]}break}}u+=10,u+=c}while(u=3;)if(o[C]!==73||o[C+1]!==68||o[C+2]!==51)if(255&~o[C]||240&~o[C+1])C++;else{if(o.length-C<7||C+(x=gl.parseAdtsSize(o,C))>o.length)break;f={type:"audio",data:o.subarray(C,C+x),pts:u,dts:u},this.trigger("data",f),C+=x}else{if(o.length-C<10||C+(x=gl.parseId3TagSize(o,C))>o.length)break;m={type:"timed-metadata",data:o.subarray(C,C+x)},this.trigger("data",m),C+=x}d=o.length-C,o=d>0?o.subarray(C):new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Fe;var Xi,ti,Nr,Os,hm=ra,dm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],cm=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Rr=Fe,Yi=ms,Ki=je,Mr=qi,Nt=kr,as=tm,Br=ke,fl=rm,pm=am.H264Stream,mm=hm,gm=na.isLikelyAacData,fm=ke.ONE_SECOND_IN_TS,aa=dm,oa=cm,ym=function(o,u){u.stream=o,this.trigger("log",u)},yl=function(o,u){for(var c=Object.keys(u),d=0;d=-be&&C<=de&&(!D||Ce>C)&&(D=X,Ce=C));return D?D.gop:null},this.alignGopsAtStart_=function(x){var C,D,j,X,ue,de,be,Ce;for(ue=x.byteLength,de=x.nalCount,be=x.duration,C=D=0;Cj.pts?C++:(D++,ue-=X.byteLength,de-=X.nalCount,be-=X.duration);return D===0?x:D===x.length?null:((Ce=x.slice(D)).byteLength=ue,Ce.duration=be,Ce.nalCount=de,Ce.pts=Ce[0].pts,Ce.dts=Ce[0].dts,Ce)},this.alignGopsAtEnd_=function(x){var C,D,j,X,ue,de,be;for(C=b.length-1,D=x.length-1,ue=null,de=!1;C>=0&&D>=0;){if(j=b[C],X=x[D],j.pts===X.pts){de=!0;break}j.pts>X.pts?C--:(C===b.length-1&&(ue=D),D--)}if(!de&&ue===null)return null;if((be=de?D:ue)===0)return x;var Ce=x.slice(be),nt=Ce.reduce(function(Rt,ri){return Rt.byteLength+=ri.byteLength,Rt.duration+=ri.duration,Rt.nalCount+=ri.nalCount,Rt},{byteLength:0,duration:0,nalCount:0});return Ce.byteLength=nt.byteLength,Ce.duration=nt.duration,Ce.nalCount=nt.nalCount,Ce.pts=Ce[0].pts,Ce.dts=Ce[0].dts,Ce},this.alignGopsWith=function(x){b=x}},Xi.prototype=new Rr,Os=function(o,u){this.numberOfTracks=0,this.metadataStream=u,(o=o||{}).remux!==void 0?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Os.prototype.init.call(this),this.push=function(c){return c.content||c.text?this.pendingCaptions.push(c):c.frames?this.pendingMetadata.push(c):(this.pendingTracks.push(c.track),this.pendingBytes+=c.boxes.byteLength,c.track.type==="video"&&(this.videoTrack=c.track,this.pendingBoxes.push(c.boxes)),void(c.track.type==="audio"&&(this.audioTrack=c.track,this.pendingBoxes.unshift(c.boxes))))}},Os.prototype=new Rr,Os.prototype.flush=function(o){var u,c,d,m,f=0,b={captions:[],captionStreams:{},metadata:[],info:{}},x=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(x=this.videoTrack.timelineStartInfo.pts,oa.forEach(function(C){b.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(x=this.audioTrack.timelineStartInfo.pts,aa.forEach(function(C){b.info[C]=this.audioTrack[C]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?b.type=this.pendingTracks[0].type:b.type="combined",this.emittedTracks+=this.pendingTracks.length,d=Yi.initSegment(this.pendingTracks),b.initSegment=new Uint8Array(d.byteLength),b.initSegment.set(d),b.data=new Uint8Array(this.pendingBytes),m=0;m=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Os.prototype.setRemux=function(o){this.remuxTracks=o},Nr=function(o){var u,c,d=this,m=!0;Nr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var f={};this.transmuxPipeline_=f,f.type="aac",f.metadataStream=new as.MetadataStream,f.aacStream=new mm,f.audioTimestampRolloverStream=new as.TimestampRolloverStream("audio"),f.timedMetadataTimestampRolloverStream=new as.TimestampRolloverStream("timed-metadata"),f.adtsStream=new fl,f.coalesceStream=new Os(o,f.metadataStream),f.headOfPipeline=f.aacStream,f.aacStream.pipe(f.audioTimestampRolloverStream).pipe(f.adtsStream),f.aacStream.pipe(f.timedMetadataTimestampRolloverStream).pipe(f.metadataStream).pipe(f.coalesceStream),f.metadataStream.on("timestamp",function(b){f.aacStream.setTimestamp(b.timeStamp)}),f.aacStream.on("data",function(b){b.type!=="timed-metadata"&&b.type!=="audio"||f.audioSegmentStream||(c=c||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},f.coalesceStream.numberOfTracks++,f.audioSegmentStream=new ti(c,o),f.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),f.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),f.adtsStream.pipe(f.audioSegmentStream).pipe(f.coalesceStream),d.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!u}))}),f.coalesceStream.on("data",this.trigger.bind(this,"data")),f.coalesceStream.on("done",this.trigger.bind(this,"done")),yl(this,f)},this.setupTsPipeline=function(){var f={};this.transmuxPipeline_=f,f.type="ts",f.metadataStream=new as.MetadataStream,f.packetStream=new as.TransportPacketStream,f.parseStream=new as.TransportParseStream,f.elementaryStream=new as.ElementaryStream,f.timestampRolloverStream=new as.TimestampRolloverStream,f.adtsStream=new fl,f.h264Stream=new pm,f.captionStream=new as.CaptionStream(o),f.coalesceStream=new Os(o,f.metadataStream),f.headOfPipeline=f.packetStream,f.packetStream.pipe(f.parseStream).pipe(f.elementaryStream).pipe(f.timestampRolloverStream),f.timestampRolloverStream.pipe(f.h264Stream),f.timestampRolloverStream.pipe(f.adtsStream),f.timestampRolloverStream.pipe(f.metadataStream).pipe(f.coalesceStream),f.h264Stream.pipe(f.captionStream).pipe(f.coalesceStream),f.elementaryStream.on("data",function(b){var x;if(b.type==="metadata"){for(x=b.tracks.length;x--;)u||b.tracks[x].type!=="video"?c||b.tracks[x].type!=="audio"||((c=b.tracks[x]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):(u=b.tracks[x]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime;u&&!f.videoSegmentStream&&(f.coalesceStream.numberOfTracks++,f.videoSegmentStream=new Xi(u,o),f.videoSegmentStream.on("log",d.getLogTrigger_("videoSegmentStream")),f.videoSegmentStream.on("timelineStartInfo",function(C){c&&!o.keepOriginalTimestamps&&(c.timelineStartInfo=C,f.audioSegmentStream.setEarliestDts(C.dts-d.baseMediaDecodeTime))}),f.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),f.videoSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"videoSegmentTimingInfo")),f.videoSegmentStream.on("baseMediaDecodeTime",function(C){c&&f.audioSegmentStream.setVideoBaseMediaDecodeTime(C)}),f.videoSegmentStream.on("timingInfo",d.trigger.bind(d,"videoTimingInfo")),f.h264Stream.pipe(f.videoSegmentStream).pipe(f.coalesceStream)),c&&!f.audioSegmentStream&&(f.coalesceStream.numberOfTracks++,f.audioSegmentStream=new ti(c,o),f.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),f.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),f.audioSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"audioSegmentTimingInfo")),f.adtsStream.pipe(f.audioSegmentStream).pipe(f.coalesceStream)),d.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!u})}}),f.coalesceStream.on("data",this.trigger.bind(this,"data")),f.coalesceStream.on("id3Frame",function(b){b.dispatchType=f.metadataStream.dispatchType,d.trigger("id3Frame",b)}),f.coalesceStream.on("caption",this.trigger.bind(this,"caption")),f.coalesceStream.on("done",this.trigger.bind(this,"done")),yl(this,f)},this.setBaseMediaDecodeTime=function(f){var b=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=f),c&&(c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(c),b.audioTimestampRolloverStream&&b.audioTimestampRolloverStream.discontinuity()),u&&(b.videoSegmentStream&&(b.videoSegmentStream.gopCache_=[]),u.timelineStartInfo.dts=void 0,u.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(u),b.captionStream.reset()),b.timestampRolloverStream&&b.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(f){c&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(f)},this.setRemux=function(f){var b=this.transmuxPipeline_;o.remux=f,b&&b.coalesceStream&&b.coalesceStream.setRemux(f)},this.alignGopsWith=function(f){u&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(f)},this.getLogTrigger_=function(f){var b=this;return function(x){x.stream=f,b.trigger("log",x)}},this.push=function(f){if(m){var b=gm(f);b&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():b||this.transmuxPipeline_.type==="ts"||this.setupTsPipeline(),m=!1}this.transmuxPipeline_.headOfPipeline.push(f)},this.flush=function(){m=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Nr.prototype=new Rr;var vl,bl,Tl,Sl,El,ua,Cl,_m={Transmuxer:Nr,VideoSegmentStream:Xi,AudioSegmentStream:ti,AUDIO_PROPERTIES:aa,VIDEO_PROPERTIES:oa,generateSegmentTimingInfo:la},Fr={toUnsigned:function(o){return o>>>0},toHexString:function(o){return("00"+o.toString(16)).slice(-2)}},wl=function(o){var u="";return u+=String.fromCharCode(o[0]),u+=String.fromCharCode(o[1]),u+=String.fromCharCode(o[2]),u+=String.fromCharCode(o[3])},vm=Fr.toUnsigned,bm=wl,Al=function(o,u){var c,d,m,f,b,x=[];if(!u.length)return null;for(c=0;c1?c+d:o.byteLength,m===u[0]&&(u.length===1?x.push(o.subarray(c+8,f)):(b=Al(o.subarray(c+8,f),u.slice(1))).length&&(x=x.concat(b))),c=f;return x},xl=Al,Tm=Fr.toUnsigned,Sm=Pe.getUint64,kl=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return u.version===1?u.baseMediaDecodeTime=Sm(o.subarray(4)):u.baseMediaDecodeTime=Tm(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),u},Dl=function(o){return{isLeading:(12&o[0])>>>2,dependsOn:3&o[0],isDependedOn:(192&o[1])>>>6,hasRedundancy:(48&o[1])>>>4,paddingValue:(14&o[1])>>>1,isNonSyncSample:1&o[1],degradationPriority:o[2]<<8|o[3]}},Il=function(o){var u,c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},d=new DataView(o.buffer,o.byteOffset,o.byteLength),m=1&c.flags[2],f=4&c.flags[2],b=1&c.flags[1],x=2&c.flags[1],C=4&c.flags[1],D=8&c.flags[1],j=d.getUint32(4),X=8;for(m&&(c.dataOffset=d.getInt32(X),X+=4),f&&j&&(u={flags:Dl(o.subarray(X,X+4))},X+=4,b&&(u.duration=d.getUint32(X),X+=4),x&&(u.size=d.getUint32(X),X+=4),D&&(c.version===1?u.compositionTimeOffset=d.getInt32(X):u.compositionTimeOffset=d.getUint32(X),X+=4),c.samples.push(u),j--);j--;)u={},b&&(u.duration=d.getUint32(X),X+=4),x&&(u.size=d.getUint32(X),X+=4),C&&(u.flags=Dl(o.subarray(X,X+4)),X+=4),D&&(c.version===1?u.compositionTimeOffset=d.getInt32(X):u.compositionTimeOffset=d.getUint32(X),X+=4),c.samples.push(u);return c},Pl=function(o){var u,c=new DataView(o.buffer,o.byteOffset,o.byteLength),d={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:c.getUint32(4)},m=1&d.flags[2],f=2&d.flags[2],b=8&d.flags[2],x=16&d.flags[2],C=32&d.flags[2],D=65536&d.flags[0],j=131072&d.flags[0];return u=8,m&&(u+=4,d.baseDataOffset=c.getUint32(12),u+=4),f&&(d.sampleDescriptionIndex=c.getUint32(u),u+=4),b&&(d.defaultSampleDuration=c.getUint32(u),u+=4),x&&(d.defaultSampleSize=c.getUint32(u),u+=4),C&&(d.defaultSampleFlags=c.getUint32(u)),D&&(d.durationIsEmpty=!0),!m&&j&&(d.baseDataOffsetIsMoof=!0),d},Ll=typeof window<"u"?window:s!==void 0?s:typeof self<"u"?self:{},Em=rs.discardEmulationPreventionBytes,Cm=jt.CaptionStream,Qi=xl,wm=kl,Am=Il,xm=Pl,Ol=Ll,km=function(o,u){for(var c=o,d=0;d0?wm(be[0]).baseMediaDecodeTime:0,nt=Qi(j,["trun"]);u===de&&nt.length>0&&(x=Im(nt,Ce,ue),C=Dm(D,x,de),m[de]||(m[de]={seiNals:[],logs:[]}),m[de].seiNals=m[de].seiNals.concat(C.seiNals),m[de].logs=m[de].logs.concat(C.logs))}),m},Lm=function(o,u,c){if(u===null)return null;var d=Pm(o,u)[u]||{};return{seiNals:d.seiNals,logs:d.logs,timescale:c}},Om=function(){var o,u,c,d,m,f,b=!1;this.isInitialized=function(){return b},this.init=function(x){o=new Cm,b=!0,f=!!x&&x.isPartial,o.on("data",function(C){C.startTime=C.startPts/d,C.endTime=C.endPts/d,m.captions.push(C),m.captionStreams[C.stream]=!0}),o.on("log",function(C){m.logs.push(C)})},this.isNewInit=function(x,C){return!(x&&x.length===0||C&&typeof C=="object"&&Object.keys(C).length===0)&&(c!==x[0]||d!==C[c])},this.parse=function(x,C,D){var j;if(!this.isInitialized()||!C||!D)return null;if(this.isNewInit(C,D))c=C[0],d=D[c];else if(c===null||!d)return u.push(x),null;for(;u.length>0;){var X=u.shift();this.parse(X,C,D)}return(j=Lm(x,c,d))&&j.logs&&(m.logs=m.logs.concat(j.logs)),j!==null&&j.seiNals?(this.pushNals(j.seiNals),this.flushStream(),m):m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(x){if(!this.isInitialized()||!x||x.length===0)return null;x.forEach(function(C){o.push(C)})},this.flushStream=function(){if(!this.isInitialized())return null;f?o.partialFlush():o.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;o.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){u=[],c=null,d=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Nm=Om,Ur=function(o){for(var u=0,c=String.fromCharCode(o[u]),d="";c!=="\0";)d+=c,u++,c=String.fromCharCode(o[u]);return d+=c},Rm=Pe.getUint64,Mm=function(o){var u,c,d,m,f,b,x,C=4,D=o[0];if(D===0)C+=(u=Ur(o.subarray(C))).length,C+=(c=Ur(o.subarray(C))).length,d=(j=new DataView(o.buffer)).getUint32(C),C+=4,f=j.getUint32(C),C+=4,b=j.getUint32(C),C+=4,x=j.getUint32(C),C+=4;else if(D===1){var j;d=(j=new DataView(o.buffer)).getUint32(C),C+=4,m=Rm(o.subarray(C)),C+=8,b=j.getUint32(C),C+=4,x=j.getUint32(C),C+=4,C+=(u=Ur(o.subarray(C))).length,C+=(c=Ur(o.subarray(C))).length}var X={scheme_id_uri:u,value:c,timescale:d||1,presentation_time:m,presentation_time_delta:f,event_duration:b,id:x,message_data:new Uint8Array(o.subarray(C,o.byteLength))};return Fm(D,X)?X:void 0},Bm=function(o,u,c,d){return o||o===0?o/u:d+c/u},Fm=function(o,u){var c=u.scheme_id_uri!=="\0",d=o===0&&Nl(u.presentation_time_delta)&&c,m=o===1&&Nl(u.presentation_time)&&c;return!(o>1)&&d||m},Nl=function(o){return o!==void 0||o!==null},Um={parseEmsgBox:Mm,scaleTime:Bm},qr=Fr.toUnsigned,Ji=Fr.toHexString,$e=xl,si=wl,ha=Um,qm=Pl,jm=Il,Hm=kl,$m=Pe.getUint64,da=Ll,Vm=ol.parseId3Frames;vl=function(o){var u={};return $e(o,["moov","trak"]).reduce(function(c,d){var m,f,b,x,C;return(m=$e(d,["tkhd"])[0])?(f=m[0],x=qr(m[b=f===0?12:20]<<24|m[b+1]<<16|m[b+2]<<8|m[b+3]),(C=$e(d,["mdia","mdhd"])[0])?(b=(f=C[0])===0?12:20,c[x]=qr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),c):null):null},u)},bl=function(o,u){var c=$e(u,["moof","traf"]).reduce(function(d,m){var f,b=$e(m,["tfhd"])[0],x=qr(b[4]<<24|b[5]<<16|b[6]<<8|b[7]),C=o[x]||9e4,D=$e(m,["tfdt"])[0],j=new DataView(D.buffer,D.byteOffset,D.byteLength);let X;return typeof(f=D[0]===1?$m(D.subarray(4,12)):j.getUint32(4))=="bigint"?X=f/da.BigInt(C):typeof f!="number"||isNaN(f)||(X=f/C),X11?(b.codec+=".",b.codec+=Ji(ue[9]),b.codec+=Ji(ue[10]),b.codec+=Ji(ue[11])):b.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(b.codec)?(ue=de.subarray(28),si(ue.subarray(4,8))==="esds"&&ue.length>20&&ue[19]!==0?(b.codec+="."+Ji(ue[19]),b.codec+="."+Ji(ue[20]>>>2&63).replace(/^0/,"")):b.codec="mp4a.40.2"):b.codec=b.codec.toLowerCase())}var be=$e(d,["mdia","mdhd"])[0];be&&(b.timescale=ua(be)),c.push(b)}),c},Cl=function(o,u=0){return $e(o,["emsg"]).map(c=>{var d=ha.parseEmsgBox(new Uint8Array(c)),m=Vm(d.message_data);return{cueTime:ha.scaleTime(d.presentation_time,d.timescale,d.presentation_time_delta,u),duration:ha.scaleTime(d.event_duration,d.timescale),frames:m}})};var ca={findBox:$e,parseType:si,timescale:vl,startTime:bl,compositionStartTime:Tl,videoTrackIds:Sl,tracks:El,getTimescaleFromMediaHeader:ua,getEmsgID3:Cl},pa=Pt,Rl=function(o){var u=31&o[1];return u<<=8,u|=o[2]},jr=function(o){return!!(64&o[1])},Hr=function(o){var u=0;return(48&o[3])>>>4>1&&(u+=o[4]+1),u},zm=function(o){if(!jr(o))return null;var u=4+Hr(o);if(u>=o.byteLength)return null;var c,d=null;return 192&(c=o[u+7])&&((d={}).pts=(14&o[u+9])<<27|(255&o[u+10])<<20|(254&o[u+11])<<12|(255&o[u+12])<<5|(254&o[u+13])>>>3,d.pts*=4,d.pts+=(6&o[u+13])>>>1,d.dts=d.pts,64&c&&(d.dts=(14&o[u+14])<<27|(255&o[u+15])<<20|(254&o[u+16])<<12|(255&o[u+17])<<5|(254&o[u+18])>>>3,d.dts*=4,d.dts+=(6&o[u+18])>>>1)),d},ma=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Wm={parseType:function(o,u){var c=Rl(o);return c===0?"pat":c===u?"pmt":u?"pes":null},parsePat:function(o){var u=jr(o),c=4+Hr(o);return u&&(c+=o[c]+1),(31&o[c+10])<<8|o[c+11]},parsePmt:function(o){var u={},c=jr(o),d=4+Hr(o);if(c&&(d+=o[d]+1),1&o[d+5]){var m;m=3+((15&o[d+1])<<8|o[d+2])-4;for(var f=12+((15&o[d+10])<<8|o[d+11]);f3&&ma(31&c[m+3])==="slice_layer_without_partitioning_rbsp_idr"&&(f=!0),f}},Ml=Pt,ii=nl.handleRollover,xe={};xe.ts=Wm,xe.aac=na;var Ns=ke.ONE_SECOND_IN_TS,ut=188,$t=71,Gm=function(o,u){for(var c,d=0,m=ut;m=0;)if(o[x]!==$t||o[C]!==$t&&C!==o.byteLength)x--,C--;else{if(d=o.subarray(x,C),xe.ts.parseType(d,u.pid)==="pes"&&(m=xe.ts.parsePesType(d,u.table),f=xe.ts.parsePayloadUnitStartIndicator(d),m==="audio"&&f&&(b=xe.ts.parsePesTime(d))&&(b.type="audio",c.audio.push(b),D=!0)),D)break;x-=ut,C-=ut}},Xm=function(o,u,c){for(var d,m,f,b,x,C,D,j=0,X=ut,ue=!1,de={data:[],size:0};X=0;)if(o[j]!==$t||o[X]!==$t)j--,X--;else{if(d=o.subarray(j,X),xe.ts.parseType(d,u.pid)==="pes"&&(m=xe.ts.parsePesType(d,u.table),f=xe.ts.parsePayloadUnitStartIndicator(d),m==="video"&&f&&(b=xe.ts.parsePesTime(d))&&(b.type="video",c.video.push(b),ue=!0)),ue)break;j-=ut,X-=ut}},Ym=function(o,u){if(o.audio&&o.audio.length){var c=u;(c===void 0||isNaN(c))&&(c=o.audio[0].dts),o.audio.forEach(function(f){f.dts=ii(f.dts,c),f.pts=ii(f.pts,c),f.dtsTime=f.dts/Ns,f.ptsTime=f.pts/Ns})}if(o.video&&o.video.length){var d=u;if((d===void 0||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(f){f.dts=ii(f.dts,d),f.pts=ii(f.pts,d),f.dtsTime=f.dts/Ns,f.ptsTime=f.pts/Ns}),o.firstKeyFrame){var m=o.firstKeyFrame;m.dts=ii(m.dts,d),m.pts=ii(m.pts,d),m.dtsTime=m.dts/Ns,m.ptsTime=m.pts/Ns}}},Km=function(o){for(var u,c=!1,d=0,m=null,f=null,b=0,x=0;o.length-x>=3;){switch(xe.aac.parseType(o,x)){case"timed-metadata":if(o.length-x<10){c=!0;break}if((b=xe.aac.parseId3TagSize(o,x))>o.length){c=!0;break}f===null&&(u=o.subarray(x,x+b),f=xe.aac.parseAacTimestamp(u)),x+=b;break;case"audio":if(o.length-x<7){c=!0;break}if((b=xe.aac.parseAdtsSize(o,x))>o.length){c=!0;break}m===null&&(u=o.subarray(x,x+b),m=xe.aac.parseSampleRate(u)),d++,x+=b;break;default:x++}if(c)return null}if(m===null||f===null)return null;var C=Ns/m;return{audio:[{type:"audio",dts:f,pts:f},{type:"audio",dts:f+1024*d*C,pts:f+1024*d*C}]}},Qm=function(o){var u={pid:null,table:null},c={};for(var d in Gm(o,u),u.table)if(u.table.hasOwnProperty(d))switch(u.table[d]){case Ml.H264_STREAM_TYPE:c.video=[],Xm(o,u,c),c.video.length===0&&delete c.video;break;case Ml.ADTS_STREAM_TYPE:c.audio=[],Bl(o,u,c),c.audio.length===0&&delete c.audio}return c},Jm={inspect:function(o,u){var c;return(c=xe.aac.isLikelyAacData(o)?Km(o):Qm(o))&&(c.audio||c.video)?(Ym(c,u),c):null},parseAudioPes_:Bl};const Zm=function(o,u){u.on("data",function(c){const d=c.initSegment;c.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const m=c.data;c.data=m.buffer,o.postMessage({action:"data",segment:c,byteOffset:m.byteOffset,byteLength:m.byteLength},[c.data])}),u.on("done",function(c){o.postMessage({action:"done"})}),u.on("gopInfo",function(c){o.postMessage({action:"gopInfo",gopInfo:c})}),u.on("videoSegmentTimingInfo",function(c){const d={start:{decode:ke.videoTsToSeconds(c.start.dts),presentation:ke.videoTsToSeconds(c.start.pts)},end:{decode:ke.videoTsToSeconds(c.end.dts),presentation:ke.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ke.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ke.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),u.on("audioSegmentTimingInfo",function(c){const d={start:{decode:ke.videoTsToSeconds(c.start.dts),presentation:ke.videoTsToSeconds(c.start.pts)},end:{decode:ke.videoTsToSeconds(c.end.dts),presentation:ke.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ke.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ke.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),u.on("id3Frame",function(c){o.postMessage({action:"id3Frame",id3Frame:c})}),u.on("caption",function(c){o.postMessage({action:"caption",caption:c})}),u.on("trackinfo",function(c){o.postMessage({action:"trackinfo",trackInfo:c})}),u.on("audioTimingInfo",function(c){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ke.videoTsToSeconds(c.start),end:ke.videoTsToSeconds(c.end)}})}),u.on("videoTimingInfo",function(c){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ke.videoTsToSeconds(c.start),end:ke.videoTsToSeconds(c.end)}})}),u.on("log",function(c){o.postMessage({action:"log",log:c})})};class Fl{constructor(u,c){this.options=c||{},this.self=u,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new _m.Transmuxer(this.options),Zm(this.self,this.transmuxer)}pushMp4Captions(u){this.captionParser||(this.captionParser=new Nm,this.captionParser.init());const c=new Uint8Array(u.data,u.byteOffset,u.byteLength),d=this.captionParser.parse(c,u.trackIds,u.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:c.buffer},[c.buffer])}probeMp4StartTime({timescales:u,data:c}){const d=ca.startTime(u,c);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:c},[c.buffer])}probeMp4Tracks({data:u}){const c=ca.tracks(u);this.self.postMessage({action:"probeMp4Tracks",tracks:c,data:u},[u.buffer])}probeEmsgID3({data:u,offset:c}){const d=ca.getEmsgID3(u,c);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:u},[u.buffer])}probeTs({data:u,baseStartTime:c}){const d=typeof c!="number"||isNaN(c)?void 0:c*ke.ONE_SECOND_IN_TS,m=Jm.inspect(u,d);let f=null;m&&(f={hasVideo:m.video&&m.video.length===2||!1,hasAudio:m.audio&&m.audio.length===2||!1},f.hasVideo&&(f.videoStart=m.video[0].ptsTime),f.hasAudio&&(f.audioStart=m.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:f,data:u},[u.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(u){const c=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.transmuxer.push(c)}reset(){this.transmuxer.reset()}setTimestampOffset(u){const c=u.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ke.secondsToVideoTs(c)))}setAudioAppendStart(u){this.transmuxer.setAudioAppendStart(Math.ceil(ke.secondsToVideoTs(u.appendStart)))}setRemux(u){this.transmuxer.setRemux(u.remux)}flush(u){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(u){this.transmuxer.alignGopsWith(u.gopsToAlignWith.slice())}}self.onmessage=function(o){o.data.action==="init"&&o.data.options?this.messageHandlers=new Fl(self,o.data.options):(this.messageHandlers||(this.messageHandlers=new Fl(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data))}}));var Y0=Sp(X0);const K0=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:h,videoFramePtsTime:p}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});const g=s.data.segment.boxes||{data:s.data.segment.data},y={type:i,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};h!==void 0&&(y.videoFrameDtsTime=h),p!==void 0&&(y.videoFramePtsTime=p),t(y)},Q0=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},J0=(s,e)=>{e.gopInfo=s.data.gopInfo},wp=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:h,onVideoTimingInfo:p,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:y,onId3:w,onCaptions:E,onDone:I,onEndedTimeline:v,onTransmuxerLog:L,isEndOfTimeline:R,segment:M,triggerSegmentEventFn:O}=s,G={buffer:[]};let N=R;const z=H=>{e.currentTransmux===s&&(H.data.action==="data"&&K0(H,G,a),H.data.action==="trackinfo"&&l(H.data.trackInfo),H.data.action==="gopInfo"&&J0(H,G),H.data.action==="audioTimingInfo"&&h(H.data.audioTimingInfo),H.data.action==="videoTimingInfo"&&p(H.data.videoTimingInfo),H.data.action==="videoSegmentTimingInfo"&&g(H.data.videoSegmentTimingInfo),H.data.action==="audioSegmentTimingInfo"&&y(H.data.audioSegmentTimingInfo),H.data.action==="id3Frame"&&w([H.data.id3Frame],H.data.id3Frame.dispatchType),H.data.action==="caption"&&E(H.data.caption),H.data.action==="endedtimeline"&&(N=!1,v()),H.data.action==="log"&&L(H.data.log),H.data.type==="transmuxed"&&(N||(e.onmessage=null,Q0({transmuxedData:G,callback:I}),Ap(e))))},U=()=>{const H={message:"Received an error message from the transmuxer worker",metadata:{errorType:F.Error.StreamingFailedToTransmuxSegment,segmentInfo:qs({segment:M})}};I(null,H)};if(e.onmessage=z,e.onerror=U,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),n!==void 0&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const H=t instanceof ArrayBuffer?t:t.buffer,S=t instanceof ArrayBuffer?0:t.byteOffset;O({type:"segmenttransmuxingstart",segment:M}),e.postMessage({action:"push",data:H,byteOffset:S,byteLength:t.byteLength},[H])}R&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Ap=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():wp(s.currentTransmux))},ud=(s,e)=>{s.postMessage({action:e}),Ap(s)},hd=(s,e)=>{if(!e.currentTransmux)return e.currentTransmux=s,void ud(e,s);e.transmuxQueue.push(ud.bind(null,e,s))},xp=s=>{if(!s.transmuxer.currentTransmux)return s.transmuxer.currentTransmux=s,void wp(s);s.transmuxer.transmuxQueue.push(s)};var to={reset:s=>{hd("reset",s)},endTimeline:s=>{hd("endTimeline",s)},transmux:xp,createTransmuxer:s=>{const e=new Y0;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e}};const pr=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=ze({},s,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;r.byteOffset=a?0:s.data.byteOffset,r.byteLength=s.data.byteLength;const l=[a?s.data:s.data.buffer];e.postMessage(r,l)}else e.postMessage(r)},Yt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ko=s=>{s.forEach(e=>{e.abort()})},Z0=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),e1=s=>{const e=s.target,t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return t.bytesReceived=s.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3),t},il=(s,e)=>{const{requestType:t}=e,i=Gs({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Yt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Yt.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:null},dd=(s,e,t,i)=>(r,n)=>{const a=n.response,l=il(r,n);if(l)return t(l,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Yt.FAILURE,xhr:n},s);const h=new DataView(a),p=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let y=0;y{const t=Fo(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:Yt.FAILURE,metadata:{mediaType:r}})}pr({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>(s.map.bytes=r,i.forEach(function(n){s.map.tracks=s.map.tracks||{},s.map.tracks[n.type]||(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale))}),e(null))})},t1=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=il(i,r);if(n)return e(n,s);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,kp(s,function(l){if(l)return l.xhr=r,l.status=r.status,e(l,s);e(null,s)})},s1=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=il(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const l=t!=="arraybuffer"&&n.responseText?W0(n.responseText.substring(s.lastReachedChar||0)):n.response;return s.stats=Z0(n),s.key?s.encryptedBytes=new Uint8Array(l):s.bytes=new Uint8Array(l),e(null,s)},i1=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{const I=s.map&&s.map.tracks||{},v=!!(I.audio&&I.video);let L=i.bind(null,s,"audio","start");const R=i.bind(null,s,"audio","end");let M=i.bind(null,s,"video","start");const O=i.bind(null,s,"video","end"),G=()=>xp({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:v,onData:N=>{N.type=N.type==="combined"?"video":N.type,g(s,N)},onTrackInfo:N=>{t&&(v&&(N.isMuxed=!0),t(s,N))},onAudioTimingInfo:N=>{L&&N.start!==void 0&&(L(N.start),L=null),R&&N.end!==void 0&&R(N.end)},onVideoTimingInfo:N=>{M&&N.start!==void 0&&(M(N.start),M=null),O&&N.end!==void 0&&O(N.end)},onVideoSegmentTimingInfo:N=>{const z={pts:{start:N.start.presentation,end:N.end.presentation},dts:{start:N.start.decode,end:N.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:z}),r(N)},onAudioSegmentTimingInfo:N=>{const z={pts:{start:N.start.pts,end:N.end.pts},dts:{start:N.start.dts,end:N.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:z}),n(N)},onId3:(N,z)=>{a(s,N,z)},onCaptions:N=>{l(s,[N])},isEndOfTimeline:h,onEndedTimeline:()=>{p()},onTransmuxerLog:w,onDone:(N,z)=>{y&&(N.type=N.type==="combined"?"video":N.type,E({type:"segmenttransmuxingcomplete",segment:s}),y(z,s,N))},segment:s,triggerSegmentEventFn:E});pr({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:N=>{s.bytes=e=N.data;const z=N.result;z&&(t(s,{hasAudio:z.hasAudio,hasVideo:z.hasVideo,isMuxed:v}),t=null),G()}})},Dp=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{let I=new Uint8Array(e);if(My(I)){s.isFmp4=!0;const{tracks:v}=s.map,L={isFmp4:!0,hasVideo:!!v.video,hasAudio:!!v.audio};v.audio&&v.audio.codec&&v.audio.codec!=="enca"&&(L.audioCodec=v.audio.codec),v.video&&v.video.codec&&v.video.codec!=="encv"&&(L.videoCodec=v.video.codec),v.video&&v.audio&&(L.isMuxed=!0),t(s,L);const R=(M,O)=>{g(s,{data:I,type:L.hasAudio&&!L.isMuxed?"audio":"video"}),O&&O.length&&a(s,O),M&&M.length&&l(s,M),y(null,s,{})};pr({action:"probeMp4StartTime",timescales:s.map.timescales,data:I,transmuxer:s.transmuxer,callback:({data:M,startTime:O})=>{e=M.buffer,s.bytes=I=M,L.hasAudio&&!L.isMuxed&&i(s,"audio","start",O),L.hasVideo&&i(s,"video","start",O),pr({action:"probeEmsgID3",data:I,transmuxer:s.transmuxer,offset:O,callback:({emsgData:G,id3Frames:N})=>{e=G.buffer,s.bytes=I=G,v.video&&G.byteLength&&s.transmuxer?pr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:I,timescales:s.map.timescales,trackIds:[v.video.id],callback:z=>{e=z.data.buffer,s.bytes=I=z.data,z.logs.forEach(function(U){w(we(U,{stream:"mp4CaptionParser"}))}),R(z.captions,N)}}):R(void 0,N)}})}})}else if(s.transmuxer){if(s.container===void 0&&(s.container=Fo(I)),s.container!=="ts"&&s.container!=="aac")return t(s,{hasAudio:!1,hasVideo:!1}),void y(null,s,{});i1({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})}else y(null,s,{})},Ip=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const l=p=>{if(p.data.source===s){i.removeEventListener("message",l);const g=p.data.decrypted;a(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};let h;i.onerror=()=>{const p="An error occurred in the decryption worker",g=qs({segment:r}),y={message:p,metadata:{error:new Error(p),errorType:F.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},i.addEventListener("message",l),h=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(fp({source:s,encrypted:t,key:h,iv:e.iv}),[t.buffer,h.buffer])},r1=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),Ip({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:y},I=>{e.bytes=I,E({type:"segmentdecryptioncomplete",segment:e}),Dp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})})},n1=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{let I=0,v=!1;return(L,R)=>{if(!v){if(L)return v=!0,ko(s),y(L,R);if(I+=1,I===s.length){const M=function(){if(R.encryptedBytes)return r1({decryptionWorker:e,segment:R,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E});Dp({segment:R,bytes:R.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})};if(R.endOfAllRequests=Date.now(),R.map&&R.map.encryptedBytes&&!R.map.bytes)return E({type:"segmentdecryptionstart",segment:R}),Ip({decryptionWorker:e,id:R.requestId+"-init",encryptedBytes:R.map.encryptedBytes,key:R.map.key,segment:R,doneFn:y},O=>{R.map.bytes=O,E({type:"segmentdecryptioncomplete",segment:R}),kp(R,G=>{if(G)return ko(s),y(G,R);M()})});M()}}}},a1=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},o1=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g})=>y=>{if(!y.target.aborted)return s.stats=we(s.stats,e1(y)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(y,s)},l1=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I,doneFn:v,onTransmuxerLog:L,triggerSegmentEventFn:R})=>{const M=[],O=n1({activeXhrs:M,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I,doneFn:v,onTransmuxerLog:L,triggerSegmentEventFn:R});if(i.key&&!i.key.bytes){const H=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&H.push(i.map.key);const S=we(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),A=dd(i,H,O,R);R({type:"segmentkeyloadstart",segment:i,keyInfo:{uri:i.key.resolvedUri}});const B=s(S,A);M.push(B)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const B=we(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),$=dd(i,[i.map.key],O,R);R({type:"segmentkeyloadstart",segment:i,keyInfo:{uri:i.map.key.resolvedUri}});const W=s(B,$);M.push(W)}const H=we(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Ao(i.map),requestType:"segment-media-initialization"}),S=t1({segment:i,finishProcessingFn:O,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:i});const A=s(H,S);M.push(A)}const G=we(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Ao(i),requestType:"segment"}),N=s1({segment:i,finishProcessingFn:O,responseType:G.responseType,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:i});const z=s(G,N);z.addEventListener("progress",o1({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I})),M.push(z);const U={};return M.forEach(H=>{H.addEventListener("loadend",a1({loadendState:U,abortFn:r}))}),()=>ko(M)},u1=It("CodecUtils"),h1=function(s){const e=s.attributes||{};if(e.CODECS)return Vt(e.CODECS)},Pp=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},d1=(s,e)=>{if(!Pp(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},kn=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(Fd(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1)return u1(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(e[t]=null);e[t]=e[t][0]}),e},cd=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},mr=function(s,e){const t=e.attributes||{},i=kn(h1(e)||[]);if(Pp(s,e)&&!i.audio&&!d1(s,e)){const r=kn(uf(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},Qr=It("PlaylistSelector"),pd=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},Dn=function(s,e){if(!s)return"";const t=k.getComputedStyle(s);return t?t[e]:""},Ti=function(s,e){const t=s.slice();s.sort(function(i,r){const n=e(i,r);return n===0?t.indexOf(i)-t.indexOf(r):n})},rl=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||k.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||k.Number.MAX_VALUE,t-i},c1=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||k.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||k.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let Lp=function(s,e,t,i,r,n){if(!s)return;const a={bandwidth:e,width:t,height:i,limitRenditionByPlayerDimensions:r};let l=s.playlists;bt.isAudioOnly(s)&&(l=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let h=l.map(N=>{let z;const U=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.width,H=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.height;return z=N.attributes&&N.attributes.BANDWIDTH,z=z||k.Number.MAX_VALUE,{bandwidth:z,width:U,height:H,playlist:N}});Ti(h,(N,z)=>N.bandwidth-z.bandwidth),h=h.filter(N=>!bt.isIncompatible(N.playlist));let p=h.filter(N=>bt.isEnabled(N.playlist));p.length||(p=h.filter(N=>!bt.isDisabled(N.playlist)));const g=p.filter(N=>N.bandwidth*Je.BANDWIDTH_VARIANCEN.bandwidth===y.bandwidth)[0];if(r===!1){const N=w||p[0]||h[0];if(N&&N.playlist){let z="sortedPlaylistReps";return w&&(z="bandwidthBestRep"),p[0]&&(z="enabledPlaylistReps"),Qr(`choosing ${pd(N)} using ${z} with options`,a),N.playlist}return Qr("could not choose a playlist with options",a),null}const E=g.filter(N=>N.width&&N.height);Ti(E,(N,z)=>N.width-z.width);const I=E.filter(N=>N.width===t&&N.height===i);y=I[I.length-1];const v=I.filter(N=>N.bandwidth===y.bandwidth)[0];let L,R,M,O;if(v||(L=E.filter(N=>N.width>t||N.height>i),R=L.filter(N=>N.width===L[0].width&&N.height===L[0].height),y=R[R.length-1],M=R.filter(N=>N.bandwidth===y.bandwidth)[0]),n.leastPixelDiffSelector){const N=E.map(z=>(z.pixelDiff=Math.abs(z.width-t)+Math.abs(z.height-i),z));Ti(N,(z,U)=>z.pixelDiff===U.pixelDiff?U.bandwidth-z.bandwidth:z.pixelDiff-U.pixelDiff),O=N[0]}const G=O||M||v||w||p[0]||h[0];if(G&&G.playlist){let N="sortedPlaylistReps";return O?N="leastPixelDiffRep":M?N="resolutionPlusOneRep":v?N="resolutionBestRep":w?N="bandwidthBestRep":p[0]&&(N="enabledPlaylistReps"),Qr(`choosing ${pd(G)} using ${N} with options`,a),G.playlist}return Qr("could not choose a playlist with options",a),null};const md=function(){let s=this.useDevicePixelRatio&&k.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),Lp(this.playlists.main,this.systemBandwidth,parseInt(Dn(this.tech_.el(),"width"),10)*s,parseInt(Dn(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},p1=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&k.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),Lp(this.playlists.main,e,parseInt(Dn(this.tech_.el(),"width"),10)*i,parseInt(Dn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},m1=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:h}=s,p=e.playlists.filter(E=>!bt.isIncompatible(E));let g=p.filter(bt.isEnabled);g.length||(g=p.filter(E=>!bt.isDisabled(E)));const y=g.filter(bt.hasAttribute.bind(null,"BANDWIDTH")).map(E=>{const I=h.getSyncPoint(E,r,l,t)?1:2;return{playlist:E,rebufferingImpact:bt.estimateSegmentRequestTime(n,i,E)*I-a}}),w=y.filter(E=>E.rebufferingImpact<=0);return Ti(w,(E,I)=>rl(I.playlist,E.playlist)),w.length?w[0]:(Ti(y,(E,I)=>E.rebufferingImpact-I.rebufferingImpact),y[0]||null)},g1=function(){const s=this.playlists.main.playlists.filter(bt.isEnabled);return Ti(s,(e,t)=>rl(e,t)),s.filter(e=>!!mr(this.playlists.main,e).video)[0]||null},f1=s=>{let e,t=0;return s.bytes&&(e=new Uint8Array(s.bytes),s.segments.forEach(i=>{e.set(i,t),t+=i.byteLength})),e};function Op(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const y1=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)s[t]=r;else{let n=t,a=t,l=!1;const h=(e.options_.vhs&&e.options_.vhs.captionServices||{})[i];h&&(n=h.label,a=h.language,l=h.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:l,label:n,language:a},!1).track}}},_1=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=k.WebKitDataCue||k.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const l=new i(r.startTime+t,r.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",s[n].addCue(l)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},v1=function(s){Object.defineProperties(s.frame,{id:{get:()=>(F.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key)},value:{get:()=>(F.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data)},privateData:{get:()=>(F.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data)}})},b1=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=k.WebKitDataCue||k.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(g=>{const y=g.cueTime+t;!(typeof y!="number"||k.isNaN(y)||y<0)&&y<1/0&&g.frames&&g.frames.length&&g.frames.forEach(w=>{const E=new r(y,y,w.value||w.url||w.data||"");E.frame=w,E.value=w,v1(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,l=[];for(let g=0;g{const w=g[y.startTime]||[];return w.push(y),g[y.startTime]=w,g},{}),p=Object.keys(h).sort((g,y)=>Number(g)-Number(y));p.forEach((g,y)=>{const w=h[g],E=isFinite(i)?i:g,I=Number(p[y+1])||E;w.forEach(v=>{v.endTime=I})})},T1={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},S1=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),E1=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=k.WebKitDataCue||k.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(S1.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:T1[n],data:r[n]},n!=="scte35Out"&&n!=="scte35In"||(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},gd=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,F.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},or=function(s,e,t){let i,r;if(t&&t.cues)for(i=t.cues.length;i--;)r=t.cues[i],r.startTime>=s&&r.endTime<=e&&t.removeCue(r)},C1=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const r=e[i],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?s.removeCue(r):t[n]=r}},w1=(s,e,t)=>{if(e==null||!s.length)return[];const i=Math.ceil((e-t+3)*js.ONE_SECOND_IN_TS);let r;for(r=0;ri);r++);return s.slice(r)},A1=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let r=0;for(;r=i);r++);return s.slice(0,r).concat(e)},x1=(s,e,t,i)=>{const r=Math.ceil((e-i)*js.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*js.ONE_SECOND_IN_TS),a=s.slice();let l=s.length;for(;l--&&!(s[l].pts<=n););if(l===-1)return a;let h=l+1;for(;h--&&!(s[h].pts<=r););return h=Math.max(h,0),a.splice(h,l-h+1),a},k1=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let r=0;rt))return n}return i.length===0?0:i[i.length-1]},ir=1,I1=500,fd=s=>typeof s=="number"&&isFinite(s),Jr=1/60,P1=(s,e,t)=>s==="main"&&e&&t?t.hasAudio||t.hasVideo?e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null,L1=(s,e,t)=>{let i=e-Je.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},li=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:h,partIndex:p,timeline:g}=s,y=l.length-1;let w="mediaIndex/partIndex increment";s.getMediaInfoForTime?w=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(w="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(w+=` with independent ${s.independent}`);const E=typeof p=="number",I=s.segment.uri?"segment":"pre-segment",v=E?tp({preloadSegment:i})-1:0;return`${I} [${n+h}/${n+y}]`+(E?` part [${p}/${v}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${w}] playlist [${a}]`},yd=s=>`${s}TimingInfo`,O1=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:r})=>r||s!==e?s{if(e===t)return!1;if(i==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&r){const n=s.pendingTimelineChange({type:"audio"});return!n||n.to!==t}return!1},N1=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,r=i&&e.to!==t.to;return!(!i||e.from===-1||t.from===-1||!r)},R1=s=>{s&&(s.pause(),s.resetEverything(),s.load())},M1=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to{const e=s.pendingSegment_;if(e&&Do({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&N1(s.timelineChangeController_)){if(M1(s))return void s.timelineChangeController_.trigger("audioTimelineBehind");R1(s)}},B1=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:r,end:n}=i;let a;typeof r=="bigint"||typeof n=="bigint"?a=k.BigInt(n)-k.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),a!==void 0&&a>e&&(e=a)}),typeof e=="bigint"&&e!!s&&Math.round(s)>e+Gt,F1=(s,e)=>{if(e!=="hls")return null;const t=B1({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=_d({segmentDuration:t,maxDuration:2*i}),n=_d({segmentDuration:t,maxDuration:i}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},qs=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class Io extends F.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=It(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(ze({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(ze({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Ss(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return to.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,k.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state!=="APPENDING"||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return e!==void 0&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&to.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return gt();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const i=yp(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return this.state==="INIT"&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: +currentTime: ${this.currentTime_()} +bufferedEnd: ${eo(this.buffered_())} +`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const a=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const l=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!l.parts||!l.parts.length||!l.parts[this.partIndex])){const h=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=h}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&to.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1;const a=()=>{n--,n===0&&i()};!r&&this.audioDisabled_||(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=x1(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const l in this.inbandTextTracks_)or(e,t,this.inbandTextTracks_[l]);or(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),I1)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:qs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||i+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=eo(e)||0,i=Zo(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const l={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(l.isSyncRequest)l.mediaIndex=D1(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${l.mediaIndex}`);else if(this.mediaIndex!==null){const w=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=w.end?w.end:t,w.parts&&w.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let w,E,I;const v=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: +For TargetTime: ${v}. +CurrentTime: ${this.currentTime_()} +BufferedEnd: ${t} +Fetch At Buffer: ${this.fetchAtBuffer_} +`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const L=this.getSyncInfoFromMediaSequenceSync_(v);if(!L){const R="No sync info found while using media sequence sync";return this.error({message:R,metadata:{errorType:F.Error.StreamingFailedToSelectNextSegment,error:new Error(R)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${L.start} --> ${L.end})`),w=L.segmentIndex,E=L.partIndex,I=L.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const L=bt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:v,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});w=L.segmentIndex,E=L.partIndex,I=L.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${v}`:`currentTime ${v}`,l.mediaIndex=w,l.startOfSegment=I,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}const h=a[l.mediaIndex];let p=h&&typeof l.partIndex=="number"&&h.parts&&h.parts[l.partIndex];if(!h||typeof l.partIndex=="number"&&!p)return null;typeof l.partIndex!="number"&&h.parts&&(l.partIndex=0,p=h.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&p&&!g&&!p.independent)if(l.partIndex===0){const w=a[l.mediaIndex-1],E=w.parts&&w.parts.length&&w.parts[w.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=w.parts.length-1,l.independent="previous segment")}else h.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,l.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(l))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:h,getMediaInfoForTime:p}=e,g=i.segments[r],y=typeof l=="number"&&g.parts[l],w={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:y?l:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:p,independent:t},E=h!==void 0?h:this.isPendingTimestampOffset_;w.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const I=eo(this.sourceUpdater_.audioBuffered());return typeof I=="number"&&(w.audioAppendStart=I-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(w.gopsToAlignWith=w1(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),w}timestampOffsetForSegment_(e){return O1(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=bt.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=u0(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const l=m1({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;const h=n-a-l.rebufferingImpact;let p=.5;a<=Gt&&(p=1),!l.playlist||l.playlist.uri===this.playlist_.uri||h{r[n.stream]=r[n.stream]||{startTime:1/0,captions:[],endTime:0};const a=r[n.stream];a.startTime=Math.min(a.startTime,n.startTime+i),a.endTime=Math.max(a.endTime,n.endTime+i),a.captions.push(n)}),Object.keys(r).forEach(n=>{const{startTime:a,endTime:l,captions:h}=r[n],p=this.inbandTextTracks_;this.logger_(`adding cues from ${a} -> ${l} for ${n}`),y1(p,this.vhs_.tech_,n),or(a,l,p[n]),_1({captionArray:h,inbandTextTracks:p,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo)&&!(i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo)&&!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Ss(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[yd(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_!=="main"||typeof e.timestampOffset!="number"||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){const n=xn(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Hs(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Hs(a).join(", "));const l=n.length?n.start(0):0,h=n.length?n.end(n.length-1):0,p=a.length?a.start(0):0,g=a.length?a.end(a.length-1):0;if(h-l<=ir&&g-p<=ir)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Hs(n).join(", ")}, video buffer: ${Hs(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const y=this.currentTime_()-ir;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${y}`),this.remove(0,y,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${ir}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=k.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3*ir)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){r&&(r.code!==dp?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:F.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const l=[r];let h=r.byteLength;i&&(l.unshift(i),h+=i.byteLength),n=f1({bytes:h,segments:l})}const a={segmentInfo:qs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return Ss(this),void this.loadQueue_.push(()=>{const t=ze({},e,{forceTimestampOffset:!0});ze(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||r&&n;this.logger_(`Requesting +${Op(e.uri)} +${li(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=l1({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:l,level:h,stream:p})=>{this.logger_(`${li(e)} logged from transmuxer stream ${p} as a ${h}: ${l}`)},triggerSegmentEventFn:({type:l,segment:h,keyInfo:p,trackInfo:g,timingInfo:y})=>{const w={segmentInfo:qs({segment:h})};p&&(w.keyInfo=p),g&&(w.trackInfo=g),y&&(w.timingInfo=y),this.trigger({type:l,metadata:w})}})}trimBackBuffer_(e){const t=L1(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===t.timeline&&(l.videoTimingInfo?a.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(a.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),t.key){const h=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=h}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e3*e.playlist.targetDuration,a=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(n||a)return this.logger_(`bad ${n?"segment":"part"} ${li(e)}`),void this.resetEverything();this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},U1=["video","audio"],Po=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},q1=(s,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type!=="mediaSource"){if(s!=="mediaSource"&&e.ready()&&e.mediaSource.readyState!=="closed"&&!Po(s,e)){if(i.type!==s){if(t=q1(s,e.queue),t===null)return;i=e.queue[t]}return e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),i.doneFn?void 0:(e.queuePending[s]=null,void Si(s,e))}}else e.updating()||e.mediaSource.readyState==="closed"||(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),Si("audio",e),Si("video",e))},Rp=(s,e)=>{const t=e[`${s}Buffer`],i=Np(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},zt=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Tt={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(zt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{n.appendBuffer(s)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===dp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,t(a)}}},remove:(s,e)=>(t,i)=>{const r=i[`${t}Buffer`];if(zt(i.mediaSource,r)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{r.remove(s,e)}catch{i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];zt(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){F.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){F.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(zt(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){F.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=Np(s),r=Ei(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(Rp(s,e),zt(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){F.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=Ei(s);if(!zt(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(h){l.errorType=F.Error.StreamingCodecsChangeError,l.error=h,h.metadata=l,t.error_=h,t.trigger("error"),F.log.warn(`Failed to changeType on ${e}Buffer`,h)}}},St=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),Si(s,e)},vd=(s,e)=>t=>{const i=a0(e[`${s}Buffered`]());if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,i),e.queuePending[s]){const r=e.queuePending[s].doneFn;e.queuePending[s]=null,r&&r(e[`${s}Error_`])}Si(s,e)};class Mp extends F.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Si("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=It("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=vd("video",this),this.onAudioUpdateEnd_=vd("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){St({type:"mediaSource",sourceUpdater:this,action:Tt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){St({type:e,sourceUpdater:this,action:Tt.abort(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?St({type:"mediaSource",sourceUpdater:this,action:Tt.removeSourceBuffer(e),name:"removeSourceBuffer"}):F.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!F.browser.IS_FIREFOX&&k.MediaSource&&k.MediaSource.prototype&&typeof k.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return k.SourceBuffer&&k.SourceBuffer.prototype&&typeof k.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?St({type:e,sourceUpdater:this,action:Tt.changeType(t),name:"changeType"}):F.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${n.length} until video append`);const a=t;if(St({type:r,sourceUpdater:this,action:Tt.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const l=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${l.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,l.forEach(h=>{this.appendBuffer.apply(this,h)})}}audioBuffered(){return zt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:gt()}videoBuffered(){return zt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:gt()}buffered(){const e=zt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=zt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():l0(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=cs){St({type:"mediaSource",sourceUpdater:this,action:Tt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=cs){typeof e!="string"&&(e=void 0),St({type:"mediaSource",sourceUpdater:this,action:Tt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=cs){this.audioBuffered().length&&this.audioBuffered().end(0)!==0?St({type:"audio",sourceUpdater:this,action:Tt.remove(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=cs){this.videoBuffered().length&&this.videoBuffered().end(0)!==0?St({type:"video",sourceUpdater:this,action:Tt.remove(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Po("audio",this)&&!Po("video",this))}audioTimestampOffset(e){return e!==void 0&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(St({type:"audio",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return e!==void 0&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(St({type:"video",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&St({type:"audio",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&St({type:"video",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),U1.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Rp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const bd=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),j1=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Td=new Uint8Array(` + +`.split("").map(s=>s.charCodeAt(0)));class H1 extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class $1 extends Io{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return gt();const e=this.subtitlesTrack_.cues;return gt([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=Td.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Td,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return e===void 0||(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){or(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",t),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Yt.TIMEOUT&&this.handleTimeout_(),e.code===Yt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof k.WebVTT!="function"&&typeof this.loadVttJs=="function")return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));n.requested=!0;try{this.parseVTTCues_(r)}catch(a){return void this.stopForError({message:a.message,metadata:{errorType:F.Error.StreamingVttParserError,error:a}})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new k.VTTCue(a.startTime,a.endTime,a.text):a)}),C1(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if(typeof k.WebVTT!="function")throw new H1;typeof k.TextDecoder=="function"?t=new k.TextDecoder("utf8"):(t=k.WebVTT.StringDecoder(),i=!0);const r=new k.WebVTT.Parser(k,k.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{F.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=bd(a)),r.parse(a)}let n=e.bytes;i&&(n=bd(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/js.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(h=>{const p=h.endTime-h.startTime,g=this.handleRollover_(h.startTime+l,t.time);h.startTime=Math.max(g,0),h.endTime=Math.max(g+p,0)}),!i.syncInfo){const h=e.cues[0].startTime,p=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(h,p-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*js.ONE_SECOND_IN_TS;const r=t*js.ONE_SECOND_IN_TS;let n;for(n=r4294967296;)i+=n;return i/js.ONE_SECOND_IN_TS}}const V1=function(s,e){const t=s.cues;for(let i=0;i=r.adStartTime&&e<=r.adEndTime)return r}return null},z1=function(s,e,t=0){if(!s.segments)return;let i,r=t;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Bp{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const r=new Map;let n=` +`,a=i,l=t;this.start_=a,e.forEach((h,p)=>{const g=this.storage_.get(l),y=a,w=y+h.duration,E=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),I=new Sd({start:y,end:w,appended:E,segmentIndex:p});h.syncInfo=I;let v=a;const L=(h.parts||[]).map((R,M)=>{const O=v,G=v+R.duration,N=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[M]&&g.partsSyncInfo[M].isAppended),z=new Sd({start:O,end:G,appended:N,segmentIndex:p,partIndex:M});return v=G,n+=`Media Sequence: ${l}.${M} | Range: ${O} --> ${G} | Appended: ${N} +`,R.syncInfo=z,z});r.set(l,new W1(I,L)),n+=`${Op(h.resolvedUri)} | Media Sequence: ${l} | Range: ${y} --> ${w} | Appended: ${E} +`,l++,a=w}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Ed extends Bp{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(e);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const G1=86400,so=[{name:"VOD",run:(s,e,t,i,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,r,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const l=a.getSyncInfoForTime(r);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const l=To(e);r=r||0;for(let h=0;h{let n=null,a=null;r=r||0;const l=To(e);for(let h=0;h=w)&&(a=w,n={time:y,segmentIndex:p.segmentIndex,partIndex:p.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,i,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let l=0;l=y)&&(a=y,n={time:g.time,segmentIndex:h,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class X1 extends F.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Bp,i=new Ed(t),r=new Ed(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=It("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return so.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const l of a){const{syncPoint:h,strategy:p}=l,{segmentIndex:g,time:y}=h;if(g<0)continue;const w=y,E=w+e.segments[g].duration;if(this.logger_(`Strategy: ${p}. Current time: ${r}. selected segment: ${g}. Time: [${w} -> ${E}]}`),r>=w&&r0&&(r.time*=-1),Math.abs(r.time+cr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let l=0;lG1)F.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let r=i-1;r>=0;r--){const n=e.segments[r];if(n&&n.start!==void 0){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-n.getTime()/1e3)}timestampOffsetForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].time}mappingForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,n=e.part;let a,l,h=this.timelines[e.timeline];if(typeof e.timestampOffset=="number")h={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=h,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${h.time}] [mapping: ${h.mapping}]`)),a=e.startOfSegment,l=t.end+h.mapping;else{if(!h)return!1;a=t.start+h.mapping,l=t.end+h.mapping}return n&&(n.start=a,n.end=l),(!r.start||ah){let p;p=l<0?i.start-cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:p,accuracy:h}}}}dispose(){this.trigger("dispose"),this.off()}}class Y1 extends F.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const K1=Ep(Cp(function(){var s=function(){function I(){this.listeners={}}var v=I.prototype;return v.on=function(L,R){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push(R)},v.off=function(L,R){if(!this.listeners[L])return!1;var M=this.listeners[L].indexOf(R);return this.listeners[L]=this.listeners[L].slice(0),this.listeners[L].splice(M,1),M>-1},v.trigger=function(L){var R=this.listeners[L];if(R)if(arguments.length===2)for(var M=R.length,O=0;O>7))^O]=O;for(G=N=0;!R[G];G^=H||1,N=U[N]||1)for(B=N^N<<1^N<<2^N<<3^N<<4,B=B>>8^255&B^99,R[G]=B,M[B]=G,A=z[S=z[H=z[G]]],W=16843009*A^65537*S^257*H^16843008*G,$=257*z[B]^16843008*B,O=0;O<4;O++)v[O][G]=$=$<<24^$>>>8,L[O][B]=W=W<<24^W>>>8;for(O=0;O<5;O++)v[O]=v[O].slice(0),L[O]=L[O].slice(0);return I};let i=null;class r{constructor(v){let L,R,M;i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];const O=this._tables[0][4],G=this._tables[1],N=v.length;let z=1;if(N!==4&&N!==6&&N!==8)throw new Error("Invalid aes key size");const U=v.slice(0),H=[];for(this._key=[U,H],L=N;L<4*N+28;L++)M=U[L-1],(L%N==0||N===8&&L%N==4)&&(M=O[M>>>24]<<24^O[M>>16&255]<<16^O[M>>8&255]<<8^O[255&M],L%N==0&&(M=M<<8^M>>>24^z<<24,z=z<<1^283*(z>>7))),U[L]=U[L-N]^M;for(R=0;L;R++,L--)M=U[3&R?L:L-4],H[R]=L<=4||R<4?M:G[0][O[M>>>24]]^G[1][O[M>>16&255]]^G[2][O[M>>8&255]]^G[3][O[255&M]]}decrypt(v,L,R,M,O,G){const N=this._key[1];let z,U,H,S=v^N[0],A=M^N[1],B=R^N[2],$=L^N[3];const W=N.length/4-2;let te,J=4;const oe=this._tables[1],Q=oe[0],Y=oe[1],ie=oe[2],se=oe[3],ee=oe[4];for(te=0;te>>24]^Y[A>>16&255]^ie[B>>8&255]^se[255&$]^N[J],U=Q[A>>>24]^Y[B>>16&255]^ie[$>>8&255]^se[255&S]^N[J+1],H=Q[B>>>24]^Y[$>>16&255]^ie[S>>8&255]^se[255&A]^N[J+2],$=Q[$>>>24]^Y[S>>16&255]^ie[A>>8&255]^se[255&B]^N[J+3],J+=4,S=z,A=U,B=H;for(te=0;te<4;te++)O[(3&-te)+G]=ee[S>>>24]<<24^ee[A>>16&255]<<16^ee[B>>8&255]<<8^ee[255&$]^N[J++],z=S,S=A,A=B,B=$,$=z}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(v){this.jobs.push(v),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(I){return I<<24|(65280&I)<<8|(16711680&I)>>8|I>>>24},l=function(I,v,L){const R=new Int32Array(I.buffer,I.byteOffset,I.byteLength>>2),M=new r(Array.prototype.slice.call(v)),O=new Uint8Array(I.byteLength),G=new Int32Array(O.buffer);let N,z,U,H,S,A,B,$,W;for(N=L[0],z=L[1],U=L[2],H=L[3],W=0;W{const R=I[L];y(R)?v[L]={bytes:R.buffer,byteOffset:R.byteOffset,byteLength:R.byteLength}:v[L]=R}),v};self.onmessage=function(I){const v=I.data,L=new Uint8Array(v.encrypted.bytes,v.encrypted.byteOffset,v.encrypted.byteLength),R=new Uint32Array(v.key.bytes,v.key.byteOffset,v.key.byteLength/4),M=new Uint32Array(v.iv.bytes,v.iv.byteOffset,v.iv.byteLength/4);new h(L,R,M,function(O,G){self.postMessage(E({source:v.source,decrypted:G}),[G.buffer])})}}));var Q1=Sp(K1);const J1=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Fp=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Up=(s,e)=>{e.activePlaylistLoader=s,s.load()},Z1=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),l=r.activePlaylistLoader,h=r.lastGroup_;a&&h&&a.id===h.id||(r.lastGroup_=a,r.lastTrack_=n,Fp(t,r),a&&!a.isMainPlaylist&&(a.playlistLoader?(t.resyncLoader(),Up(a.playlistLoader,r)):l&&i.resetEverything()))},e2=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},t2=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),h=n.activePlaylistLoader,p=n.lastTrack_;if((!p||!a||p.id!==a.id)&&(n.lastGroup_=l,n.lastTrack_=a,Fp(i,n),l)){if(l.isMainPlaylist){if(!a||!p||a.id===p.id)return;const g=e.vhs.playlistController_,y=g.selectPlaylist();return g.media()===y?void 0:(n.logger_(`track change. Switching main audio from ${p.id} to ${a.id}`),t.pause(),r.resetEverything(),void g.fastQualityChange_(y))}if(s==="AUDIO"){if(!l.playlistLoader)return r.setAudio(!0),void r.resetEverything();i.setAudio(!0),r.setAudio(!1)}h!==l.playlistLoader&&(i.track&&i.track(a),i.resetEverything()),Up(l.playlistLoader,n)}},In={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(h=>h.default)[0]||n[0]).id,l=t.tracks[a];if(r!==l){F.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const h in t.tracks)t.tracks[h].enabled=t.tracks[h]===l;t.onTrackChanged()}else i({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;F.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},Cd={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",In[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const l=e.media();n.playlist(l,r),n.track(a.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",In[s](s,t))}},s2={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:l,tracks:h,logger_:p}},mainPlaylistLoader:g}=e,y=wr(g.main);a[s]&&Object.keys(a[s]).length!==0||(a[s]={main:{default:{default:!0}}},y&&(a[s].main.default.playlists=g.main.playlists));for(const w in a[s]){l[w]||(l[w]=[]);for(const E in a[s][w]){let I,v=a[s][w][E];if(y?(p(`AUDIO group '${w}' label '${E}' is a main playlist`),v.isMainPlaylist=!0,I=null):I=i==="vhs-json"&&v.playlists?new mi(v.playlists[0],t,n):v.resolvedUri?new mi(v.resolvedUri,t,n):v.playlists&&i==="dash"?new xo(v.playlists[0],t,n,g):null,v=we({id:E,playlistLoader:I},v),Cd[s](s,v.playlistLoader,e),l[w].push(v),h[E]===void 0){const L=new F.AudioTrack({id:E,kind:J1(v),enabled:!1,language:v.language,default:v.default,label:E});h[E]=L}}}r.on("error",In[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[s]:{groups:h,tracks:p}},mainPlaylistLoader:g}=e;for(const y in l[s]){h[y]||(h[y]=[]);for(const w in l[s][y]){if(!i.options_.useForcedSubtitles&&l[s][y][w].forced)continue;let E,I=l[s][y][w];if(r==="hls")E=new mi(I.resolvedUri,i,a);else if(r==="dash"){if(!I.playlists.filter(v=>v.excludeUntil!==1/0).length)return;E=new xo(I.playlists[0],i,a,g)}else r==="vhs-json"&&(E=new mi(I.playlists?I.playlists[0]:I.resolvedUri,i,a));if(I=we({id:w,playlistLoader:E},I),Cd[s](s,I.playlistLoader,e),h[y].push(I),p[w]===void 0){const v=t.addRemoteTextTrack({id:w,kind:"subtitles",default:I.default&&I.autoselect,language:I.language,label:w},!1).track;p[w]=v}}}n.on("error",In[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:r,tracks:n}}}=e;for(const a in i[s]){r[a]||(r[a]=[]);for(const l in i[s][a]){const h=i[s][a][l];if(!/^(?:CC|SERVICE)/.test(h.instreamId))continue;const p=t.options_.vhs&&t.options_.vhs.captionServices||{};let g={label:l,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(p[g.instreamId]&&(g=we(g,p[g.instreamId])),g.default===void 0&&delete g.default,r[a].push(we({id:l},h)),n[l]===void 0){const y=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[l]=y}}}}},qp=(s,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:r}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[s]&&(a=r[n.attributes[s]]);const l=Object.keys(r);if(!a)if(s==="AUDIO"&&l.length>1&&wr(e.main))for(let h=0;hh.id===t.id)[0]||null},r2={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},n2=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},a2=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(p=>{s2[p](p,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:r,segmentLoaders:{AUDIO:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(p=>{e[p].activeGroup=i2(p,s),e[p].activeTrack=r2[p](p,s),e[p].onGroupChanged=Z1(p,s),e[p].onGroupChanging=e2(p,s),e[p].onTrackChanged=t2(p,s),e[p].getActiveGroup=n2(p,s)});const l=e.AUDIO.activeGroup();if(l){const p=(l.filter(g=>g.default)[0]||l[0]).id;e.AUDIO.tracks[p].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanging())});const h=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",h),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",h),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const p in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[p])},o2=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:cs,activeTrack:cs,getActiveGroup:cs,onGroupChanged:cs,onTrackChanged:cs,lastTrack_:null,logger_:It(`MediaGroups[${e}]`)}}),s};class wd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=vt(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class l2 extends F.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new wd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=It("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=vt(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410)return this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(a.status===429){const p=a.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${p} seconds.`),void this.startTTLTimeout_(parseInt(p,10))}return this.logger_(`manifest failed to load ${n}.`),void this.startTTLTimeout_()}let l;this.trigger({type:"contentsteeringloadcomplete",metadata:r});try{l=JSON.parse(this.request_.responseText)}catch(p){const g={errorType:F.Error.StreamingContentSteeringParserError,error:p};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(l);const h={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:h}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new k.URL(e),i=new k.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(k.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new k.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(i=>{for(const r of i)if(this.availablePathways_.has(r))return r;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=k.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){k.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new wd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(vt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const u2=10;let us;const h2=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],d2=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},c2=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:h}){if(!i)return F.log.warn("We received no playlist to switch to. Please check your stream."),!1;const p=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return h(`${p} as current playlist is not set`),!0;if(i.id===s.id)return!1;const g=!!pi(e,t).length;if(!s.endList)return g||typeof s.partTargetDuration!="number"?(h(`${p} as current playlist is live`),!0):(h(`not ${p} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const y=Zo(e,t),w=l?Je.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Je.MAX_BUFFER_LOW_WATER_LINE;if(aI)&&y>=r){let v=`${p} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return l&&(v+=` and next bandwidth > current bandwidth (${E} > ${I})`),h(v),!0}return h(`not ${p} as no switching criteria met`),!1};class p2 extends F.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:h,enableLowInitialPlaylist:p,sourceType:g,cacheEncryptionKeys:y,bufferBasedABR:w,leastPixelDiffSelector:E,captionServices:I,experimentalUseMMS:v}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:L}=e;L==null&&(L=1/0),us=a,this.bufferBasedABR=!!w,this.leastPixelDiffSelector=!!E,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=l,this.playlistExclusionDuration=h,this.maxPlaylistRetries=L,this.enableLowInitialPlaylist=p,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:L,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=o2(),v&&k.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new k.ManagedMediaSource,F.log("Using ManagedMediaSource")):k.MediaSource&&(this.mediaSource=new k.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=gt(),this.hasPlayed_=!1,this.syncController_=new X1(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Q1,this.sourceUpdater_=new Mp(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Y1,this.keyStatusMap_=new Map;const R={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:I,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new xo(t,this.vhs_,we(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new mi(t,this.vhs_,we(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Io(we(R,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Io(we(R,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new $1(we(R,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((G,N)=>{function z(){r.off("vttjserror",U),G()}function U(){r.off("vttjsloaded",z),N()}r.one("vttjsloaded",z),r.one("vttjserror",U),r.addWebVttScript_()})}),e);const M=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new l2(this.vhs_.xhr,M),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),h2.forEach(G=>{this[G+"_"]=d2.bind(this,G)}),this.logger_=It("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const O=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(O,()=>{const G=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-G,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const l={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const n=(i.length?i[0].playlists:i.playlists).filter(a=>a.attributes.serviceLocation===r);n.length&&this.mediaTypes_[e].activePlaylistLoader.media(n[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=k.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(k.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const l=i.main||r.length&&i[r[0]];for(const h in l)if(l[h].default){n={label:h};break}}if(!n)return t;const a=[];for(const l in i)if(i[l][n.label]){const h=i[l][n.label];if(h.playlists&&h.playlists.length)a.push.apply(a,h.playlists);else if(h.uri)a.push(h);else if(e.playlists.length)for(let p=0;p{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),a2({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!=="playlist-unchanged"&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,t=>{this.player_.trigger(ze({},t))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const l in i.AUDIO[a])i.AUDIO[a][l].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),us.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return c2({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const t=this.audioSegmentLoader_.pendingSegment_;if(!t||!t.segment||!t.segment.syncInfo)return;const i=t.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.mainSegmentLoader_.on("earlyabort",t=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:u2}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(t=>{this.mainSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))}),this.audioSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))}),this.subtitleSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(t===null)return!1;const i=us.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-r<=Xt;const a=n.end(n.length-1);return a-r<=Xt&&i-a<=Xt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void(this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Qn),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return F.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const I=this.pathwayAttribute_(e),v=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(I),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(I)},v)}let E=!1;r.forEach(I=>{if(I===e)return;const v=I.excludeUntil;v!==void 0&&v!==1/0&&(E=!0,delete I.excludeUntil)}),E&&(F.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;l=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const h=this.selectPlaylist();if(!h)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const p=t.internal?this.logger_:F.log.warn,g=t.message?" "+t.message:"";p(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${h.id}.`),h.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=h.targetDuration/2*1e3||5e3,w=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=y;return this.switchMedia_(h,"exclude",a||w)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r=e==="all";(r||e==="main")&&i.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const l=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;l&&i.push(l)}),["main","audio","subtitle"].forEach(a=>{const l=this[`${a}SegmentLoader_`];!l||e!==a&&e!=="all"||i.push(l)}),i.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){const t=pi(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:us.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(i===null)return;const r=this.mainPlaylistLoader_.main,n=us.Playlist.seekable(t,i,us.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),i===null||(e=us.Playlist.seekable(t,i,us.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,l;if(this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),l=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=gt([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=mr(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||df),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||qu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||qu,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const a=(p,g)=>p?lr(g):Da(g),l={};let h;if(["video","audio"].forEach(function(p){if(r.hasOwnProperty(p)&&!a(e[p].isFmp4,r[p])){const g=e[p].isFmp4?"browser":"muxer";l[g]=l[g]||[],l[g].push(r[p]),p==="audio"&&(h=g)}}),n&&h&&t.attributes.AUDIO){const p=t.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===p&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${p} as ${h} does not support codec(s): "${r.audio}"`)}if(!Object.keys(l).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const p=[];if(["video","audio"].forEach(g=>{const y=(Vt(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,w=(Vt(r[g]||"")[0]||{}).type;y&&w&&y.toLowerCase()!==w.toLowerCase()&&p.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),p.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${p.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}{const p=Object.keys(l).reduce((g,y)=>(g&&(g+=", "),g+=`${y} does not support codec(s): "${l[y].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:p},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=mr(this.main,r),a=[];!n.audio||Da(n.audio)||lr(n.audio)||a.push(`audio codec ${n.audio}`),!n.video||Da(n.video)||lr(n.video)||a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=kn(Vt(e)),n=cd(r),a=r.video&&Vt(r.video)[0]||null,l=r.audio&&Vt(r.audio)[0]||null;Object.keys(i).forEach(h=>{const p=i[h];if(t.indexOf(p.id)!==-1||p.excludeUntil===1/0)return;t.push(p.id);const g=[],y=mr(this.mainPlaylistLoader_.main,p),w=cd(y);if(y.audio||y.video){if(w!==n&&g.push(`codec count "${w}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&Vt(y.video)[0]||null,I=y.audio&&Vt(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${E.type}" !== "${a.type}"`),I&&l&&I.type.toLowerCase()!==l.type.toLowerCase()&&g.push(`audio codec "${I.type}" !== "${l.type}"`)}g.length&&(p.excludeUntil=1/0,this.logger_(`excluding ${p.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),z1(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Je.GOAL_BUFFER_LENGTH,i=Je.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Je.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Je.BUFFER_LOW_WATER_LINE,i=Je.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Je.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Je.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Je.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){gd(this.inbandTextTracks_,"com.apple.streaming",this.tech_),E1({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();gd(this.inbandTextTracks_,e,this.tech_),b1({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,t=>{this.trigger(ze({},t))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const r of e.playlists){const n=r.attributes.serviceLocation;if(n&&(i.push(n),!t.has(n)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let r=!1;Object.keys(t).forEach(n=>{const a=t[n],l=this.pathwayAttribute_(a),h=l&&e!==l;a.excludeUntil===1/0&&a.lastExcludeReason_==="content-steering"&&!h&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);const p=!a.excludeUntil&&a.excludeUntil!==1/0;!i.has(a.id)&&h&&p&&(i.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_="content-steering",this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(n=>{const a=this.mediaTypes_[n];if(a.activePlaylistLoader){const l=a.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[r,n]of t.entries())i.get(r)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(r));for(const[r,n]of i.entries()){const a=t.get(r);a?this.equalPathwayClones_(a,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter(l=>l.attributes["PATHWAY-ID"]===n["BASE-ID"]).forEach(l=>{this.mainPlaylistLoader_.addClonePathway(n,l)}),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==r[n])return!1;for(const n in r)if(i[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);r&&r.size&&r.forEach(n=>{const a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,h=i.lastExcludeReason_===t&&i.excludeUntil===1/0;l?l&&h&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;r&&n&&(delete i.excludeUntil,F.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const i=(typeof e=="string"?e:j1(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const m2=(s,e,t)=>i=>{const r=s.main.playlists[e],n=tl(r),a=Qn(r);if(i===void 0)return a;i?delete r.disabled:r.disabled=!0;const l={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return i===a||n||(t(r),i?s.trigger({type:"renditionenabled",metadata:l}):s.trigger({type:"renditiondisabled",metadata:l})),i};class g2{constructor(e,t,i){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=mr(r.main(),t),this.playlist=t,this.id=i,this.enabled=m2(e.playlists,t.id,n)}}const f2=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=wr(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!tl(i)).map((i,r)=>new g2(s,i,i.id)):[]}},Ad=["seeking","seeked","pause","playing","error"];class y2 extends F.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=It("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],h={};l.forEach(g=>{h[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},a[`${g}SegmentLoader_`].on("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].on("playlistupdate",h[g].reset),this.tech_.on(["seeked","seeking"],h[g].reset)});const p=g=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),p("off"))},this.clearSeekingAppendCheck_=()=>p("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),p("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Ad,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Ad,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(g=>{a[`${g}SegmentLoader_`].off("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].off("playlistupdate",h[g].reset),this.tech_.off(["seeked","seeking"],h[g].reset)}),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=k.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=h0(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};return t.trigger({type:"bufferedrangeschanged",metadata:a}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Hs(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Xt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(gt([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const w=e.start(0);i=w+(w===e.end(0)?0:Xt)}if(i!==void 0)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Zc(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const r=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),a=r.audioBuffer?r.audioBuffered():null,l=r.videoBuffer?r.videoBuffered():null,h=this.media(),p=h.partTargetDuration?h.partTargetDuration:2*(h.targetDuration-Gt),g=[a,l];for(let w=0;w ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const a=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${a}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(a),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=Kr(r,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Xt;const a=!i.endList,l=typeof i.partTargetDuration=="number";return a&&(l||r)&&(n=e.end(e.length-1)+3*i.targetDuration),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const _2={errorInterval:30,getSource(s){return s(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},jp=function(s,e){let t=0,i=0;const r=we(_2,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(g){g!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(g),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},l=function(){if(Date.now()-t<1e3*r.errorInterval)s.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(r.getSource&&typeof r.getSource=="function")return t=Date.now(),r.getSource.call(s,a);F.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},h=function(){s.off("loadedmetadata",n),s.off("error",l),s.off("dispose",h)},p=function(g){h(),jp(s,g)};s.on("error",l),s.on("dispose",h),s.reloadSourceOnError=p},v2=function(s){jp(this,s)};var Hp="3.14.2",b2="7.0.3",T2="1.3.0",S2="7.2.0",E2="4.0.2";const qe={PlaylistLoader:mi,Playlist:bt,utils:I0,STANDARD_PLAYLIST_SELECTOR:md,INITIAL_PLAYLIST_SELECTOR:g1,lastBandwidthSelector:md,movingAverageBandwidthSelector:p1,comparePlaylistBandwidth:rl,comparePlaylistResolution:c1,xhr:gp()};Object.keys(Je).forEach(s=>{Object.defineProperty(qe,s,{get:()=>(F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),Je[s]),set(e){F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0?F.log.warn(`value of Vhs.${s} must be greater than or equal to 0`):Je[s]=e}})});const $p="videojs-vhs",Vp=function(s,e){const t=e.media();let i=-1;for(let r=0;r{s.addQualityLevel(t)}),Vp(s,e.playlists)};qe.canPlaySource=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const w2=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=kn(Vt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=Ei(i.video),n=Ei(i.audio),a={};for(const l in s)a[l]={},n&&(a[l].audioContentType=n),r&&(a[l].videoContentType=r),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(a[l].pssh=e.contentProtection[l].pssh),typeof s[l]=="string"&&(a[l].url=s[l]);return we(s,a)},A2=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const l=i.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),x2=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=A2(r,Object.keys(e)),a=[],l=[];return n.forEach(h=>{l.push(new Promise((p,g)=>{s.tech_.one("keysessioncreated",p)})),a.push(new Promise((p,g)=>{s.eme.initializeMediaKeys({keySystems:h},y=>{y?g(y):p()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},k2=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=w2(e,t,i);return!!r&&(s.currentSource().keySystems=r,!(r&&!s.eme)||(F.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},zp=()=>{if(!k.localStorage)return null;const s=k.localStorage.getItem($p);if(!s)return null;try{return JSON.parse(s)}catch{return null}},D2=s=>{if(!k.localStorage)return!1;let e=zp();e=e?we(e,s):s;try{k.localStorage.setItem($p,JSON.stringify(e))}catch{return!1}return e},I2=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,Wp=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},Gp=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},Xp=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},Yp=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};qe.supportsNativeHls=function(){if(!re||!re.createElement)return!1;const s=re.createElement("video");return F.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(s.canPlayType(e))}):!1}(),qe.supportsNativeDash=!!(re&&re.createElement&&F.getTech("Html5").isSupported())&&/maybe|probably/i.test(re.createElement("video").canPlayType("application/dash+xml")),qe.supportsTypeNatively=s=>s==="hls"?qe.supportsNativeHls:s==="dash"&&qe.supportsNativeDash,qe.isSupported=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},qe.xhr.onRequest=function(s){Wp(qe.xhr,s)},qe.xhr.onResponse=function(s){Gp(qe.xhr,s)},qe.xhr.offRequest=function(s){Xp(qe.xhr,s)},qe.xhr.offResponse=function(s){Yp(qe.xhr,s)};const P2=F.getComponent("Component");class Kp extends P2{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=It("VhsHandler"),t.options_&&t.options_.playerId){const r=F.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(re,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=re.fullscreenElement||re.webkitFullscreenElement||re.mozFullScreenElement||re.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=we(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=this.source_.useBandwidthFromLocalStorage!==void 0?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=zp();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Je.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Je.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{this.source_[i]!==void 0&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=I2(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=qe,this.options_.sourceType=qd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new p2(this.options_);const i=we({liveRangeSafeTimeDelta:Xt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new y2(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=F.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a!="object"||a.code?typeof a=="string"&&(a={message:a,code:3}):a.code=3,n.error(a)});const r=this.options_.bufferBasedABR?qe.movingAverageBandwidthSelector(.55):qe.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=qe.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){const h=1e3*a.downlink*1e3;n=h>=l&&n>=l?Math.max(n,h):h}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return a=this.throughput>0?1/this.throughput:0,Math.floor(1/(n+a))},set(){F.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Hs(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Hs(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&D2({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{f2(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=k.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),x2({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=k2({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=F.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{C2(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Vp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Hp,"mux.js":b2,"mpd-parser":T2,"m3u8-parser":S2,"aes-decrypter":E2}}version(){return this.constructor.version()}canChangeType(){return Mp.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&k.URL.revokeObjectURL&&(k.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return B0({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return bp({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Wp(this.xhr,e)},this.xhr.onResponse=e=>{Gp(this.xhr,e)},this.xhr.offRequest=e=>{Xp(this.xhr,e)},this.xhr.offResponse=e=>{Yp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["gapjumped","playedrangeschanged"];["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.playlistController_.on(t,i=>{this.player_.trigger(ze({},i))})}),e.forEach(t=>{this.playbackWatcher_.on(t,i=>{this.player_.trigger(ze({},i))})})}}const Pn={name:"videojs-http-streaming",VERSION:Hp,canHandleSource(s,e={}){const t=we(F.options,e);return!(!t.vhs.experimentalUseMMS&&!lr("avc1.4d400d,mp4a.40.2",!1))&&Pn.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=we(F.options,t);return e.vhs=new Kp(s,e,i),e.vhs.xhr=gp(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=qd(s);if(!t)return"";const i=Pn.getOverrideNative(e);return!qe.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS),{overrideNative:i=t}=e;return i}};lr("avc1.4d400d,mp4a.40.2",!0)&&F.getTech("Html5").registerSourceHandler(Pn,0),F.VhsHandler=Kp,F.VhsSourceHandler=Pn,F.Vhs=qe,F.use||F.registerComponent("Vhs",qe),F.options.vhs=F.options.vhs||{},F.getPlugin&&F.getPlugin("reloadSourceOnError")||F.registerPlugin("reloadSourceOnError",v2);let Re=class extends Lo{constructor(){super(),this._defaultConfigs={autoplay:!1,fluid:!1,fullscreen:!1,loop:!1,muted:!1,preload:"auto",responsive:!1,startTime:0},this._prevPlayingState=!1,this.currentMetadata=null,this.element=null,this.mimeType=null,this.sensorModel=null,this.state="not-ready",this.waitingTimestamp=null,this._initController=()=>{!this._controller&&this.playerUrl&&(this.element=document.createElement("video"),F.log.level("error"),this._controller=F(this.element,this._defaultConfigs),this._controller.muted(this.muted),this._controller.loop(this.loop),this._controller.playbackRate(this.rate),this._controller.ready(this._handleReady),this._controller.on("canplay",this._handleCanPlay),this._controller.on("durationchange",this._handleDurationChange),this._controller.on("ended",this._handleEnded),this._controller.on("error",this._handleError),this._controller.on("loadeddata",this._handleDataLoaded),this._controller.on("loadedmetadata",this._handleLoadedMetadata),this._controller.on("loadstart",this._handleLoadStart),this._controller.on("play",this._handlePlay),this._controller.on("timeupdate",this._handleTimeUpdate),this._controller.on("waiting",this._handleWaiting),this._controller.on("xhr-hooks-ready",this._handleXHRhooksReady))},this._handleReady=()=>{this.state="ready"},this._handleCanPlay=()=>{this._prevPlayingState=this.state==="playing",this.state="can-play"},this._handleCueChange=()=>{if(!this.subtitleTrack?.activeCues?.length)return;const s=this.subtitleTrack?.activeCues[0],e=s.text?JSON.parse(s.text):null;if(!e?.data?.length)return;const t=e.data[0]?.value??[],i=new Map;for(const r of t)Array.isArray(r.value)?r.tagId===90064?i.set(r.tagId,r):r.value.forEach(n=>{i.set(n.tagId,n)}):i.set(r.tagId,r);i.set(ne.EsriVideoWidth,{name:"Video Width",tagId:ne.EsriVideoWidth,value:this._controller?.videoWidth()}),i.set(ne.EsriVideoHeight,{name:"Video Height",tagId:ne.EsriVideoHeight,value:this._controller?.videoHeight()}),this.currentMetadata=new Map(i),this.sensorModel=new Mg({videoMetadata:this.currentMetadata})},this._handleDataLoaded=()=>{this.state="data-loaded",this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleDurationChange=()=>this.notifyChange("duration"),this._handleEnded=()=>{if(!this.loop)return this._set("ended",!0),this.notifyChange("buffered"),this.notifyChange("currentTime"),this.notifyChange("duration"),this.notifyChange("waiting"),void(this.state="can-play");this.setCurrentTime(0),this.play()},this._handleError=()=>{tg.getLogger(this).error("video stream error ::",this._controller?.error())},this._handleLoadStart=()=>{this.state="can-play"},this._handleLoadedMetadata=()=>{this.notifyChange("subtitleTrack"),this.notifyChange("buffered")},this._handlePlay=()=>this.notifyChange("ended"),this._handleTimeUpdate=()=>{this.notifyChange("currentTime"),this.notifyChange("buffered"),this.notifyChange("bufferedPercent"),this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleWaiting=()=>{this.waitingTimestamp=this._controller?.currentTime()},this._handleXHRhooksReady=()=>{const s=e=>(e.xhr=new ui,e);this._controller?.tech(!0)?.vhs.xhr.onRequest(s)}}initialize(){this.addHandles([nn(()=>this.playerUrl,s=>{s&&(this._initController(),this.mimeType=xg(s),this._controller?.src({type:this.mimeType,src:this.playerUrl}))},xd),nn(()=>this.subtitleTrack,()=>{this.subtitleTrack&&(this.subtitleTrack.mode="showing")})]),this.addHandles(sg(()=>this.subtitleTrack,"cuechange",this._handleCueChange))}destroy(){this._controller?.dispose()}get buffered(){return this._controller?.bufferedEnd()??0}get bufferedPercent(){return this._controller?.bufferedPercent()??0}get currentTime(){return this._controller?.currentTime()??0}get duration(){return this._controller?.duration()??0}get ended(){return this._controller?.ended()??this._get("ended")??!0}set ended(s){this._controller?.ended(s),this._set("ended",s)}get loop(){return this._controller?.loop()??this._get("loop")??!1}set loop(s){this._controller?.loop(s),this._set("loop",s)}get muted(){return this._controller?.muted()??this._get("muted")??!1}set muted(s){this._controller?.muted(s),this._set("muted",s)}get playerUrl(){return this._controller?.src()||""}set playerUrl(s){this._set("playerUrl",s)}get playing(){return!this.ended&&(this.state==="can-play"?this._prevPlayingState:this.state==="playing")}get rate(){return this._controller?.playbackRate()??this._get("rate")??1}set rate(s){this._controller?.playbackRate(s),this._set("rate",s)}get started(){return this._controller?.hasStarted()||!1}get subtitleTrack(){const s=this._controller?.textTracks();return s?.length?Array.from(s).find(e=>e.kind==="subtitles"):null}get waiting(){return!this.waitingTimestamp&&(this.waitingTimestamp===this.currentTime||(this.waitingTimestamp=null,!1))}pause(){this._controller?.pause(),this.state="paused"}play(){this._controller?.play(),this.state="playing"}reset(){this._controller&&(this.pause(),this.setCurrentTime(0),this._set("ended",!0))}setCurrentTime(s){const e=kd(s,0,this.duration);this._controller?.currentTime(e),this.notifyChange("currentTime")}};K([Z()],Re.prototype,"buffered",null),K([Z()],Re.prototype,"bufferedPercent",null),K([Z({readOnly:!0})],Re.prototype,"currentTime",null),K([Z()],Re.prototype,"currentMetadata",void 0),K([Z({readOnly:!0})],Re.prototype,"duration",null),K([Z()],Re.prototype,"element",void 0),K([Z({readOnly:!0})],Re.prototype,"ended",null),K([Z()],Re.prototype,"loop",null),K([Z()],Re.prototype,"mimeType",void 0),K([Z()],Re.prototype,"muted",null),K([Z()],Re.prototype,"playerUrl",null),K([Z({readOnly:!0})],Re.prototype,"playing",null),K([Z()],Re.prototype,"rate",null),K([Z()],Re.prototype,"sensorModel",void 0),K([Z({readOnly:!0})],Re.prototype,"started",null),K([Z()],Re.prototype,"state",void 0),K([Z()],Re.prototype,"subtitleTrack",null),K([Z({readOnly:!0})],Re.prototype,"videoHeight",void 0),K([Z({readOnly:!0})],Re.prototype,"videoWidth",void 0),K([Z({readOnly:!0})],Re.prototype,"waiting",null),K([Z()],Re.prototype,"waitingTimestamp",void 0),Re=K([Ds("esri.layers.video.VideoController")],Re);const L2=Re;let pe=class extends ng(og(ig(ag(rg)))){constructor(s){super(s),this._trailPoints=[],this.capabilities=null,this.connectionInfo=null,this.controller=new L2,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCount=null,this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=Zr.WGS84,this.telemetryDisplay=null,this.title=null,this.type="video",this.url=null,this.videoLayersInfo=null,this.videoTimeExtent=null}initialize(){this.telemetryDisplay=new Dd({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([nn(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),nn(()=>this.telemetry?.sensorLocation,s=>this._setSensorTrail(s),xd)])}load(s){const e=s!=null?s.signal:null;return this.addResolvingPromise(this._fetchService(e)),Promise.resolve(this)}get buffered(){return this.controller.buffered}readCapabilitiesFromService(s,e){return hg(e)}readConnectionInfo(s,e){const t=Object.values(e.connectionUrl);return t?.length&&(this.controller.playerUrl=t[0]),e.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return wg(this.metadata)}get groundControlPoints(){return Cg(this.metadata)}get loop(){return this.controller.loop}set loop(s){this.controller.loop=s}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(s){this.controller.muted=s}get playbackRate(){return this.controller.rate}set playbackRate(s){this.controller.rate=s}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get state(){return this.controller.state}get telemetry(){return Eg(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(s,e){return kg(e)}get videoWidth(){return this.controller?.videoWidth}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(s){if(!this.duration)return;const e=kd(s,0,this.duration);this.controller.setCurrentTime(e)}toGround(s,e){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(s,e):null}toVideo(s){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const e=this.controller.sensorModel.transformGeoToImage(s.x,s.y,s.z);return{x:e[0],y:e[1]}}async _fetchService(s){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const e=lg(this.parsedUrl?.path);if(e==null)throw new Vl("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let t=null;const{data:i,ssl:r}=await ro(e.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:s}),n=i;if(this.url=e.url.path,r&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let a=e?.sublayer;if(a==null&&n.layers?.length&&(a=n.layers[0].id),a==null)throw new Vl("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${e.url.path}/${a}`,t=await ro(this.url,{query:{f:"json",...this.customParameters},signal:s});const l={...n,...t.data};this.sourceJSON=l,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(s){if(!s)return;const e=Sg(s,this._trailPoints);this._trailPoints=[...e];const t=this._trailPoints.map(r=>r.toArray()),i=new rn({hasZ:s.hasZ,paths:[t]});this.telemetry.sensorTrail=i.clone()}};K([Z({readOnly:!0})],pe.prototype,"buffered",null),K([Z({readOnly:!0,json:{read:!1}})],pe.prototype,"capabilities",void 0),K([gi("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsUpdate"])],pe.prototype,"readCapabilitiesFromService",null),K([Z({readOnly:!0})],pe.prototype,"connectionInfo",void 0),K([gi("connectionInfo",["connectionUrl"])],pe.prototype,"readConnectionInfo",null),K([Z()],pe.prototype,"controller",void 0),K([Z({type:String})],pe.prototype,"copyright",void 0),K([Z({readOnly:!0,type:Date})],pe.prototype,"created",void 0),K([Z({type:Number})],pe.prototype,"currentTime",null),K([Z({type:String})],pe.prototype,"description",void 0),K([Z({type:Number})],pe.prototype,"duration",null),K([Z({readOnly:!0})],pe.prototype,"elevationSource",void 0),K([Z({type:Boolean})],pe.prototype,"ended",null),K([Z({type:_g})],pe.prototype,"frame",void 0),K([Z({readOnly:!0,type:Number})],pe.prototype,"frameCount",void 0),K([Z({type:zl})],pe.prototype,"fullExtent",void 0),K([Z({readOnly:!0})],pe.prototype,"frameHorizonPoints",null),K([Z({readOnly:!0})],pe.prototype,"groundControlPoints",null),K([Z({type:zl})],pe.prototype,"initialExtent",void 0),K([Z({readOnly:!0,json:{read:{source:"id"}}})],pe.prototype,"layerId",void 0),K([Z({type:Boolean})],pe.prototype,"loop",null),K([Z({readOnly:!0})],pe.prototype,"metadata",null),K([Z({readOnly:!0})],pe.prototype,"mimeType",null),K([Z({type:Boolean})],pe.prototype,"muted",null),K([Z({type:fg})],pe.prototype,"playbackInfo",void 0),K([Z({type:Number})],pe.prototype,"playbackRate",null),K([Z({type:String})],pe.prototype,"playerUrl",null),K([Z({readOnly:!0})],pe.prototype,"playing",null),K([Z({readOnly:!0,json:{read:{source:"poster"}}})],pe.prototype,"posterUrl",void 0),K([Z({readOnly:!0})],pe.prototype,"qualities",void 0),K([Z({readOnly:!0})],pe.prototype,"serviceItemId",void 0),K([Z()],pe.prototype,"sourceJSON",void 0),K([Z({readOnly:!0})],pe.prototype,"sourceQuality",void 0),K([Z({readOnly:!0,json:{name:"serviceType"}})],pe.prototype,"sourceType",void 0),K([Z()],pe.prototype,"spatialReference",void 0),K([Z({readOnly:!0,type:String})],pe.prototype,"state",null),K([Z({readOnly:!0,type:no})],pe.prototype,"telemetry",null),K([Z({type:Dd})],pe.prototype,"telemetryDisplay",void 0),K([Z({readOnly:!1,json:{read:{source:"name"}}})],pe.prototype,"title",void 0),K([Z({readOnly:!0})],pe.prototype,"type",void 0),K([Z(ug)],pe.prototype,"url",void 0),K([Z({readOnly:!0})],pe.prototype,"videoElement",null),K([Z({readOnly:!0})],pe.prototype,"videoHeight",null),K([Z({readOnly:!0,json:{read:!1}})],pe.prototype,"videoLayersInfo",void 0),K([gi("service","videoLayersInfo",["id","name","poster","serviceType","type"])],pe.prototype,"readLayerInfosFromService",null),K([Z({readOnly:!0,nonNullable:!1,json:{read:{reader:Tg,source:"time"}}})],pe.prototype,"videoTimeExtent",void 0),K([Z({readOnly:!0})],pe.prototype,"videoWidth",null),K([Z({readOnly:!0})],pe.prototype,"waiting",null),pe=K([Ds("esri.layers.VideoLayer")],pe);const iv=pe;export{iv as default}; diff --git a/main/assets/VideoLayer-Dxs-NJSn-DOPIz0CI.js b/main/assets/VideoLayer-Dxs-NJSn-DOPIz0CI.js deleted file mode 100644 index d01091ca1..000000000 --- a/main/assets/VideoLayer-Dxs-NJSn-DOPIz0CI.js +++ /dev/null @@ -1,204 +0,0 @@ -import{aa as Ln,v as K,S as Z,i as Ds,w as Jt,l as On,m as rn,a0 as gi,ac as io,J as Zr,ah as nn,aL as xd,ae as kd,o as Vl,f as ro,n as zl,e as Nn,j as Lo,jZ as eg,dY as Wl,hZ as ni,a1 as tg,ai as sg,dU as ga}from"./main-BZaw9FpY.js";import{m as ig}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as rg}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as ng}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as ag}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{S as og}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{i as lg}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{Z as ug}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{q as hg}from"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import{a as Dd}from"./TelemetryDisplay-Bq2PXfI8-BWfBxjew.js";import{o as dg,n as Gl}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{E as cg,V as pg}from"./mat3-CC4Foazl-BWjyqE2v.js";import{y as fa,N as mg,r as gg,Z as Xl}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{m as ya}from"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import{n as Yl}from"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import{t as vr,l as an}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";let Es=class extends Ln(Nn){constructor(s){super(s),this.framerate=null,this.containerFormat=null,this.gop=null,this.aspectRatio=null,this.klv=null}};K([Z({type:String})],Es.prototype,"framerate",void 0),K([Z({type:String})],Es.prototype,"containerFormat",void 0),K([Z({type:Number})],Es.prototype,"gop",void 0),K([Z({type:String})],Es.prototype,"aspectRatio",void 0),K([Z({type:Object})],Es.prototype,"klv",void 0),Es=K([Ds("esri.layers.support.PlaybackInfo")],Es);const fg=Es;let Cs=class extends Ln(Nn){constructor(s){super(s),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};K([Z({type:Jt})],Cs.prototype,"frameCenter",void 0),K([Z({type:On})],Cs.prototype,"frameOutline",void 0),K([Z({type:rn})],Cs.prototype,"lineOfSight",void 0),K([Z({type:Jt})],Cs.prototype,"sensorLocation",void 0),K([Z({type:rn})],Cs.prototype,"sensorTrail",void 0),Cs=K([Ds("esri.layers.support.TelemetryData")],Cs);const no=Cs;let rr=class extends Lo{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};function yg(s){return s?.sourcePoint!=null&&s.mapPoint!=null}K([Z()],rr.prototype,"sourcePoint",void 0),K([Z({type:Jt})],rr.prototype,"mapPoint",void 0),rr=K([Ds("esri.layers.support.VideoFrame.ControlPoint")],rr);let Fs=class extends Ln(Nn){constructor(s){super(s),this.frame=null,this.controlPoints=null}readControlPoints(s){return s.map(e=>({sourcePoint:{x:e.frameX,y:e.frameY},mapPoint:new Jt(e.point)}))}writeControlPoints(s,e){s!=null&&yg(s[0])&&(e.controlPoints=s.map(t=>{const i=t.sourcePoint,r=t.mapPoint;return{frameX:i.x,frameY:i.y,point:r.toJSON()}}))}};K([Z({type:String})],Fs.prototype,"frame",void 0),K([Z({type:[rr],json:{write:{allowNull:!1,isRequired:!0}}})],Fs.prototype,"controlPoints",void 0),K([gi("controlPoints")],Fs.prototype,"readControlPoints",null),K([io("controlPoints")],Fs.prototype,"writeControlPoints",null),Fs=K([Ds("esri.layers.support.VideoFrame")],Fs);const _g=Fs;let ui=class extends EventTarget{constructor(){super(...arguments),this._readyState=0,this._responseType="",this.timeout=0,this._withCredentials=!1,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.onreadystatechange=null,this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this._abortController=null,this._error=null,this._options={},this._response=null,this._sendFlag=!1,this._url=""}get readyState(){return this._readyState}get response(){return this.responseType===""||this.responseType==="text"?this.responseText:this.readyState!==this.DONE||this._error||!this._response?null:this._response.data}get responseText(){return this.responseType!==""&&this.responseType!=="text"&&this._throwDOMException(),this.readyState!==this.DONE?"":this._response?this._response.data:this._error?.raw!=null?typeof this._error.raw=="string"?this._error.raw:JSON.stringify(this._error.raw):""}get responseType(){return this._responseType}set responseType(s){(s!=="document"||globalThis instanceof Window)&&(this.readyState!==this.LOADING&&this.readyState!==this.DONE||this._throwDOMException(),this._responseType=s)}get responseURL(){return(this._response||this._error)?.url??""}get responseXML(){return this.responseType!==""&&this.responseType!=="document"&&this._throwDOMException(),this.readyState!==this.DONE?null:this._response?.data??null}get status(){return(this._response||this._error)?.httpStatus??0}get statusText(){return""}get upload(){return console.warn("upload not implemented"),null}get withCredentials(){return this._withCredentials}set withCredentials(s){this.readyState!==this.UNSENT&&this.readyState!==this.OPENED&&this._throwDOMException(),this._withCredentials=s}abort(){this.readyState===this.OPENED&&this._sendFlag||this.readyState===this.HEADERS_RECEIVED||this.readyState===this.LOADING?(this._sendFlag=!1,this._error=null,this._response=null,this._abortController?.abort(),this._updateReadyState(this.DONE),this._dispatchProgressEvent("abort"),this._dispatchProgressEvent("loadend")):this.readyState===this.DONE&&this._updateReadyState(this.UNSENT)}getAllResponseHeaders(){let s="";const e=(this._response||this._error)?.getAllHeaders?.();if(e)for(const[t,i]of e)s+=`${t}: ${i}\r -`;return s}getResponseHeader(s){return(this._response||this._error)?.getHeader?.(s)??null}open(s,e){switch(this._sendFlag=!1,this._options={},s){case"GET":this._options.method="auto";break;case"POST":this._options.method="post";break;case"HEAD":this._options.method="head";break;case"DELETE":this._options.method="delete";break;case"PUT":this._options.method="put"}this._url=e,this._error=null,this._response=null,this._abortController=new AbortController,this._updateReadyState(this.OPENED)}overrideMimeType(s){throw new Error("overrideMimeType not implemented")}send(s){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._sendFlag=!0,this._updateReadyState(this.LOADING),this._dispatchProgressEvent("loadstart");const e=this._options;s instanceof URLSearchParams?e.body=s.toString():e.body=s,e.responseType=this.responseType===""?"text":this.responseType==="arraybuffer"?"array-buffer":this.responseType,e.signal=this._abortController?.signal,this.timeout&&(e.timeout=this.timeout),this.withCredentials&&(e.withCredentials=!0),ro(this._url,e).then(t=>{this._response=t,this._updateReadyState(this.DONE),this._dispatchProgressEvent("load")}).catch(t=>{this._sendFlag&&(this._error=t.details,this._updateReadyState(this.DONE),eg(t)?this._dispatchProgressEvent("timeout"):t.name==="AbortError"?this._dispatchProgressEvent("abort"):this._dispatchProgressEvent("error"))}).finally(()=>{this._sendFlag&&this._dispatchProgressEvent("loadend")})}setRequestHeader(s,e){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._options.headers??={},this._options.headers[s]=e}_dispatchProgressEvent(s){const e=new ProgressEvent(s,{loaded:0,total:0});this.dispatchEvent(e),this[`on${s}`]?.(e)}_throwDOMException(){throw new DOMException("","InvalidStateError")}_updateReadyState(s){if(this._readyState!==s&&(this._readyState=s,s!==this.UNSENT)){const e=new Event("readystatechange");this.dispatchEvent(e),this.onreadystatechange?.(e)}}};ui.UNSENT=0,ui.OPENED=1,ui.HEADERS_RECEIVED=2,ui.LOADING=3,ui.DONE=4;let Bt=class extends Ln(Nn){constructor(s){super(s),this.duration=null,this.end=null,this.start=null,this.timezone="UTC"}readEnd(s,e){return e.end!=null?new Date(e.end):null}writeEnd(s,e){e.end=s?s.getTime():null}readStart(s,e){return e.start!=null?new Date(e.start):null}writeStart(s,e){e.start=s?s.getTime():null}};K([Z({type:Number,json:{write:{allowNull:!0}}})],Bt.prototype,"duration",void 0),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"end",void 0),K([gi("end")],Bt.prototype,"readEnd",null),K([io("end")],Bt.prototype,"writeEnd",null),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"start",void 0),K([gi("start")],Bt.prototype,"readStart",null),K([io("start")],Bt.prototype,"writeStart",null),K([Z({type:String})],Bt.prototype,"timezone",void 0),Bt=K([Ds("esri.layers.support.VideoTimeExtent")],Bt);const vg=Bt,_a="application/x-mpegURL",bg="video/mp4",ne={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function Tg(s){const{duration:e,end:t,start:i,timezone:r="UTC"}=s||{};return typeof e!="number"?null:new vg({duration:e||null,end:typeof t=="number"?new Date(t):null,start:typeof i=="number"?new Date(i):null,timezone:r})}function Sg(s,e){const t=[...e],i=t.findIndex(r=>r.equals(s));return i>-1&&t.splice(i),t.push(s),t}function Eg(s){if(!s?.size)return new no;const e=Rg(s),t=Ag(s),i=Pg(s),r=Ng(e,t);return new no({frameCenter:t,frameOutline:i,lineOfSight:r,sensorLocation:e})}function Cg(s){return s?.size?s.get(ne.EsriGroundControlPoints)?.value??null??null:null}function wg(s){return s?.size?s.get(ne.EsriHorizonPixelPack)?.value??null:null}function Ag(s){return Dg(s)??Ig(s)}function xg(s){if(!s)return _a;let e="";const t=new RegExp(/\.(\w{3,4})(?:$|\?)/i),i=s?s.match(t):[];return i?.length?(e=i[0],e.toLowerCase().replaceAll(".","")==="mp4"?bg:_a):_a}function kg(s){const e=s?.layers;return e?.length?e.map(t=>({layerId:t.id,posterUrl:t.poster,sourceType:t.serviceType,title:t.name,type:t.type||"Video Layer"})):[]}function Dg(s){return s&&s.has(ne.EsriFrameCenterLatitude)&&s.has(ne.EsriFrameCenterLongitude)?new Jt({x:s.get(ne.EsriFrameCenterLongitude).value,y:s.get(ne.EsriFrameCenterLatitude).value,z:s.get(ne.FrameCenterElevation).value}):null}function Ig(s){return s&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)?new Jt({x:s.get(ne.FrameCenterLongitude)?.value,y:s.get(ne.FrameCenterLatitude)?.value,z:s.get(ne.FrameCenterElevation)?.value}):null}function Pg(s){if(!s)return null;const e=s.get(ne.EsriFrameOutline)?.value;return e?On.fromJSON(e.geometry):Lg(s)??Og(s)}function Lg(s){if(!(s.has(ne.EsriCornerLatitudePt1)&&s.has(ne.EsriCornerLongitudePt1)&&s.has(ne.EsriCornerLatitudePt2)&&s.has(ne.EsriCornerLongitudePt2)&&s.has(ne.EsriCornerLatitudePt3)&&s.has(ne.EsriCornerLongitudePt3)&&s.has(ne.EsriCornerLatitudePt4)&&s.has(ne.EsriCornerLongitudePt4)))return null;const e=[s.get(ne.EsriCornerLongitudePt1)?.value,s.get(ne.EsriCornerLatitudePt1)?.value],t=[s.get(ne.EsriCornerLongitudePt2)?.value,s.get(ne.EsriCornerLatitudePt2)?.value],i=[s.get(ne.EsriCornerLongitudePt3)?.value,s.get(ne.EsriCornerLatitudePt3)?.value],r=[s.get(ne.EsriCornerLongitudePt4)?.value,s.get(ne.EsriCornerLatitudePt4)?.value];return new On({rings:[[e,t,i,r]]})}function Og(s){if(!(s.has(ne.OffsetCorner1Latitude)&&s.has(ne.OffsetCorner1Longitude)&&s.has(ne.OffsetCorner2Latitude)&&s.has(ne.OffsetCorner2Longitude)&&s.has(ne.OffsetCorner3Latitude)&&s.has(ne.OffsetCorner3Longitude)&&s.has(ne.OffsetCorner4Latitude)&&s.has(ne.OffsetCorner4Longitude)&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)))return null;const e=s.get(ne.FrameCenterLatitude)?.value,t=s.get(ne.FrameCenterLongitude)?.value,i=e+s.get(ne.OffsetCorner1Latitude)?.value,r=t+s.get(ne.OffsetCorner1Longitude)?.value,n=e+s.get(ne.OffsetCorner2Latitude)?.value,a=t+s.get(ne.OffsetCorner2Longitude)?.value,l=e+s.get(ne.OffsetCorner3Latitude)?.value,h=t+s.get(ne.OffsetCorner3Longitude)?.value,p=e+s.get(ne.OffsetCorner4Latitude)?.value,g=t+s.get(ne.OffsetCorner4Longitude)?.value;return new On({rings:[[[r,i],[a,n],[h,l],[g,p]]]})}function Ng(s,e){if(!s||!e)return null;const t=[s.x,s.y,s.z??0],i=[e.x,e.y,e.z??0];return new rn({paths:[[t,i]]})}function Rg(s){if(!s?.size)return null;if(s.has(ne.EsriSensorPosition)){const e=s.get(ne.EsriSensorPosition)?.value;if(e)return Jt.fromJSON(e.geometry)}return s.has(ne.SensorLongitude)&&s.has(ne.SensorLatitude)&&s.has(ne.SensorTrueAltitude)?new Jt({x:s.get(ne.SensorLongitude)?.value,y:s.get(ne.SensorLatitude)?.value,z:s.get(ne.SensorTrueAltitude)?.value}):null}const ft=Math.PI/180;let Qe=class extends Lo{constructor(s){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const i=t[0],r=t[1],n=t[2];return dg(i[0],r[0],n[0],i[1],r[1],n[1],i[2],r[2],n[2])},this._multiplyMat3=(t,i)=>{const r=Gl();return cg(r,t,i),r},this._transposeMat3=t=>{const i=Gl();return pg(i,t),i},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*ft),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*ft)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*ft,this.sensorPitchAngle*ft,this.sensorRollAngle*ft),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*ft),i=Math.cos(this.sensorLatitude*ft),r=Math.sin(this.sensorLongitude*ft),n=Math.cos(this.sensorLongitude*ft);return this._createMat3FromValues([[-t*n,-r,-i*n],[-t*r,n,-i*r],[i,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*ft,this.platformPitchAngle*ft,this.platformRollAngle*ft),this._extractValues=t=>{this.imageWidth=t.get(ne.EsriVideoWidth)?.value,this.imageHeight=t.get(ne.EsriVideoHeight)?.value;const i=t.get(ne.SensorEllipsoidHeight)?.value;this.sensorAltitude=i??t.get(ne.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(ne.SensorLatitude)?.value,this.sensorLongitude=t.get(ne.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(ne.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(ne.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(ne.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(ne.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(ne.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(ne.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(ne.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(ne.PlatformRollAngle)?.value,this.averageElevation=t.get(ne.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,i,r)=>{const n=Math.cos(t),a=Math.sin(t),l=Math.cos(i),h=Math.sin(i),p=Math.cos(r),g=Math.sin(r);return this._createMat3FromValues([[n*l,n*h*g-p*a,a*g+n*p*h],[l*a,n*p+a*h*g,p*a*h-n*g],[-h,l*g,l*p]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),i=this._calculateCameraFovReverse(),r=this._calculateCameraLook(),n=this._calculateImageDimensionsForward(),a=this._calculateImageDimensionsReverse(),l=this._calculatePlatformPositionMatrix(),h=this._calculatePlatformOrientation(),p=this._multiplyMat3(this._multiplyMat3(l,h),r);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(p,t),n);const g=this._multiplyMat3(a,i);this._earthToImageTransform=this._multiplyMat3(g,this._transposeMat3(p)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const i=t.get(ne.EsriVideoWidth)?.value??0,r=t.get(ne.EsriVideoHeight)?.value??0;if(i<=0||r<=0)return!1;const n=t.get(ne.SensorEllipsoidHeight)?.value,a=t.get(ne.SensorTrueAltitude)?.value,l=t.get(ne.SensorLatitude)?.value,h=t.get(ne.SensorLongitude)?.value;if(n==null&&a==null||l==null||h==null)return!1;const p=t.get(ne.PlatformHeadingAngle)?.value,g=t.get(ne.PlatformPitchAngle)?.value,y=t.get(ne.PlatformRollAngle)?.value;if(p==null||g==null||y==null)return!1;const w=t.get(ne.SensorHorizontalFOV)?.value,E=t.get(ne.SensorVerticalFOV)?.value;if(w==null||E==null)return!1;const I=t.get(ne.SensorAzimuthAngle)?.value,v=t.get(ne.SensorElevationAngle)?.value,L=t.get(ne.SensorRollAngle)?.value;return I!=null&&v!=null&&L!=null},this._projectPointToECEF=(t,i,r)=>{const n=[];return Yl([t,i,r],Zr.WGS84,0,n,ya,0),new Jt({x:n[0],y:n[1],z:n[2],spatialReference:ya})},this._projectImageVectorToEllipsoid=(t,i)=>{const r=Wl.semiMajorAxis+i,n=Wl.semiMinorAxis+i,a=n/r,l=r/n,{x:h,y:p,z:g}=this._platformPositionEcef,y=g??this.averageElevation,w=ni(h,p,l*y),E=fa(t,t),I=fa(t,w),v=fa(w,w)-r*r,L=(-I-Math.sqrt(I*I-E*v))/E;if(L<0)return[NaN,NaN,NaN];const R=ga();return mg(R,w,t,L),R[2]=R[2]*a,R};const e=s?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(s,e,t){const i=this._platformPositionEcef;if(!i)return[0,0];const{x:r,y:n,z:a}=i,l=ni(r,n,a),h=this._projectPointToECEF(s,e,t||this.averageElevation),p=ga(),g=ni(h.x,h.y,h.z);gg(p,g,l),Xl(p,p,this._earthToImageTransform);const y=p[0],w=p[1],E=p[2];let I=ni(NaN,NaN,NaN);return isNaN(E)||(I=ni(y/E,w/E,E/E)),[I[0],I[1]]}transformImageToGeo(s,e){const t=ni(s,e,1),i=ga();Xl(i,t,this._imageToEarthTransform);const r=this._projectImageVectorToEllipsoid(i,this.averageElevation);let n;if(!isNaN(r[0])){const a=[];Yl([r[0],r[1],r[2]],ya,0,a,Zr.WGS84,0),n=new Jt({x:a[0],y:a[1],z:a[2],spatialReference:Zr.WGS84})}return n}};K([Z()],Qe.prototype,"averageElevation",void 0),K([Z()],Qe.prototype,"imageHeight",void 0),K([Z()],Qe.prototype,"imageWidth",void 0),K([Z({readOnly:!0})],Qe.prototype,"metadataSupportsTransforms",void 0),K([Z()],Qe.prototype,"platformHeadingAngle",void 0),K([Z()],Qe.prototype,"platformPitchAngle",void 0),K([Z()],Qe.prototype,"platformRollAngle",void 0),K([Z()],Qe.prototype,"sensorHeadingAngle",void 0),K([Z()],Qe.prototype,"sensorAltitude",void 0),K([Z()],Qe.prototype,"sensorHorizontalFieldOfView",void 0),K([Z()],Qe.prototype,"sensorLatitude",void 0),K([Z()],Qe.prototype,"sensorLongitude",void 0),K([Z()],Qe.prototype,"sensorPitchAngle",void 0),K([Z()],Qe.prototype,"sensorRollAngle",void 0),K([Z()],Qe.prototype,"sensorVerticalFieldOfView",void 0),K([Z()],Qe.prototype,"vttMetadata",void 0),Qe=K([Ds("esri.layers.video.VideoCameraSensorModel")],Qe);const Mg=Qe;var Kl,Ql;function Rn(){return Ql?Kl:(Ql=1,s=typeof window<"u"?window:an!==void 0?an:typeof self<"u"?self:{},Kl=s);var s}const k=vr(Rn());var Jl,Zl,va,eu,ba,tu,su,iu,ru,nu,au,ou,lu,uu,Ta,hu,Sa,du,Ea,cu,Ca,pu,mu,gu,fu,yu;function Id(){if(Zl)return Jl;Zl=1;var s=Array.prototype.slice;function e(t,i){for(("length"in t)||(t=[t]),t=s.call(t);t.length;){var r=t.shift(),n=i(r);if(n)return n;r.childNodes&&r.childNodes.length&&(t=s.call(r.childNodes).concat(t))}}return Jl=e}function Bg(){if(eu)return va;function s(e,t){if(!(this instanceof s))return new s(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}return eu=1,va=s,s.prototype.nodeType=8,s.prototype.nodeName="#comment",s.prototype.toString=function(){return"[object Comment]"},va}function Fg(){if(tu)return ba;function s(e,t){if(!(this instanceof s))return new s(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}return tu=1,ba=s,s.prototype.type="DOMTextNode",s.prototype.nodeType=3,s.prototype.nodeName="#text",s.prototype.toString=function(){return this.data},s.prototype.replaceData=function(e,t,i){var r=this.data,n=r.substring(0,e),a=r.substring(e+t,r.length);this.data=n+i+a,this.length=this.data.length},ba}function Pd(){if(iu)return su;function s(e){var t=this,i=e.type;e.target||(e.target=t),t.listeners||(t.listeners={});var r=t.listeners[i];if(r)return r.forEach(function(n){e.currentTarget=t,typeof n=="function"?n(e):n.handleEvent(e)});t.parentNode&&t.parentNode.dispatchEvent(e)}return iu=1,su=s}function Ld(){if(nu)return ru;function s(e,t){var i=this;i.listeners||(i.listeners={}),i.listeners[e]||(i.listeners[e]=[]),i.listeners[e].indexOf(t)===-1&&i.listeners[e].push(t)}return nu=1,ru=s}function Od(){if(ou)return au;function s(e,t){var i=this;if(i.listeners&&i.listeners[e]){var r=i.listeners[e],n=r.indexOf(t);n!==-1&&r.splice(n,1)}}return ou=1,au=s}function Ug(){if(uu)return lu;uu=1;var s=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function e(g){switch(g.nodeType){case 3:return h(g.data);case 8:return"";default:return t(g)}}function t(g){var y=[],w=g.tagName;return g.namespaceURI==="http://www.w3.org/1999/xhtml"&&(w=w.toLowerCase()),y.push("<"+w+l(g)+n(g)),s.indexOf(w)>-1?y.push(" />"):(y.push(">"),g.childNodes.length?y.push.apply(y,g.childNodes.map(e)):g.textContent||g.innerText?y.push(h(g.textContent||g.innerText)):g.innerHTML&&y.push(g.innerHTML),y.push("")),y.join("")}function i(g,y){var w=typeof g[y];return y==="style"&&Object.keys(g.style).length>0||g.hasOwnProperty(y)&&(w==="string"||w==="boolean"||w==="number")&&y!=="nodeName"&&y!=="className"&&y!=="tagName"&&y!=="textContent"&&y!=="innerText"&&y!=="namespaceURI"&&y!=="innerHTML"}function r(g){if(typeof g=="string")return g;var y="";return Object.keys(g).forEach(function(w){var E=g[w];w=w.replace(/[A-Z]/g,function(I){return"-"+I.toLowerCase()}),y+=w+":"+E+";"}),y}function n(g){var y=g.dataset,w=[];for(var E in y)w.push({name:"data-"+E,value:y[E]});return w.length?a(w):""}function a(g){var y=[];return g.forEach(function(w){var E=w.name,I=w.value;E==="style"&&(I=r(I)),y.push(E+'="'+p(I)+'"')}),y.length?" "+y.join(" "):""}function l(g){var y=[];for(var w in g)i(g,w)&&y.push({name:w,value:g[w]});for(var E in g._attributes)for(var I in g._attributes[E]){var v=g._attributes[E][I],L=(v.prefix?v.prefix+":":"")+I;y.push({name:L,value:v.value})}return g.className&&y.push({name:"class",value:g.className}),y.length?a(y):""}function h(g){var y="";return typeof g=="string"?y=g:g&&(y=g.toString()),y.replace(/&/g,"&").replace(//g,">")}function p(g){return h(g).replace(/"/g,""")}return lu=e}function Nd(){if(hu)return Ta;hu=1;var s=Id(),e=Pd(),t=Ld(),i=Od(),r=Ug(),n="http://www.w3.org/1999/xhtml";function a(l,h,p){if(!(this instanceof a))return new a(l);var g=p===void 0?n:p||null;this.tagName=g===n?String(l).toUpperCase():l,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=h||null,this.namespaceURI=g,this._attributes={},this.tagName==="INPUT"&&(this.type="text")}return Ta=a,a.prototype.type="DOMElement",a.prototype.nodeType=1,a.prototype.appendChild=function(l){return l.parentNode&&l.parentNode.removeChild(l),this.childNodes.push(l),l.parentNode=this,l},a.prototype.replaceChild=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=this.childNodes.indexOf(h);return h.parentNode=null,this.childNodes[p]=l,l.parentNode=this,h},a.prototype.removeChild=function(l){var h=this.childNodes.indexOf(l);return this.childNodes.splice(h,1),l.parentNode=null,l},a.prototype.insertBefore=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=h==null?-1:this.childNodes.indexOf(h);return p>-1?this.childNodes.splice(p,0,l):this.childNodes.push(l),l.parentNode=this,l},a.prototype.setAttributeNS=function(l,h,p){var g=null,y=h,w=h.indexOf(":");w>-1&&(g=h.substr(0,w),y=h.substr(w+1)),this.tagName==="INPUT"&&h==="type"?this.type=p:(this._attributes[l]||(this._attributes[l]={}))[y]={value:p,prefix:g}},a.prototype.getAttributeNS=function(l,h){var p=this._attributes[l],g=p&&p[h]&&p[h].value;return this.tagName==="INPUT"&&h==="type"?this.type:typeof g!="string"?null:g},a.prototype.removeAttributeNS=function(l,h){var p=this._attributes[l];p&&delete p[h]},a.prototype.hasAttributeNS=function(l,h){var p=this._attributes[l];return!!p&&h in p},a.prototype.setAttribute=function(l,h){return this.setAttributeNS(null,l,h)},a.prototype.getAttribute=function(l){return this.getAttributeNS(null,l)},a.prototype.removeAttribute=function(l){return this.removeAttributeNS(null,l)},a.prototype.hasAttribute=function(l){return this.hasAttributeNS(null,l)},a.prototype.removeEventListener=i,a.prototype.addEventListener=t,a.prototype.dispatchEvent=e,a.prototype.focus=function(){},a.prototype.toString=function(){return r(this)},a.prototype.getElementsByClassName=function(l){var h=l.split(" "),p=[];return s(this,function(g){if(g.nodeType===1){var y=(g.className||"").split(" ");h.every(function(w){return y.indexOf(w)!==-1})&&p.push(g)}}),p},a.prototype.getElementsByTagName=function(l){l=l.toLowerCase();var h=[];return s(this.childNodes,function(p){p.nodeType!==1||l!=="*"&&p.tagName.toLowerCase()!==l||h.push(p)}),h},a.prototype.contains=function(l){return s(this,function(h){return l===h})||!1},Ta}function qg(){if(du)return Sa;du=1;var s=Nd();function e(t){if(!(this instanceof e))return new e;this.childNodes=[],this.parentNode=null,this.ownerDocument=t||null}return Sa=e,e.prototype.type="DocumentFragment",e.prototype.nodeType=11,e.prototype.nodeName="#document-fragment",e.prototype.appendChild=s.prototype.appendChild,e.prototype.replaceChild=s.prototype.replaceChild,e.prototype.removeChild=s.prototype.removeChild,e.prototype.toString=function(){return this.childNodes.map(function(t){return String(t)}).join("")},Sa}function jg(){if(cu)return Ea;function s(e){}return cu=1,Ea=s,s.prototype.initEvent=function(e,t,i){this.type=e,this.bubbles=t,this.cancelable=i},s.prototype.preventDefault=function(){},Ea}function Hg(){if(pu)return Ca;pu=1;var s=Id(),e=Bg(),t=Fg(),i=Nd(),r=qg(),n=jg(),a=Pd(),l=Ld(),h=Od();function p(){if(!(this instanceof p))return new p;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}Ca=p;var g=p.prototype;return g.createTextNode=function(y){return new t(y,this)},g.createElementNS=function(y,w){var E=y===null?null:String(y);return new i(w,this,E)},g.createElement=function(y){return new i(y,this)},g.createDocumentFragment=function(){return new r(this)},g.createEvent=function(y){return new n(y)},g.createComment=function(y){return new e(y,this)},g.getElementById=function(y){return y=String(y),s(this.childNodes,function(w){if(String(w.id)===y)return w})||null},g.getElementsByClassName=i.prototype.getElementsByClassName,g.getElementsByTagName=i.prototype.getElementsByTagName,g.contains=i.prototype.contains,g.removeEventListener=h,g.addEventListener=l,g.dispatchEvent=a,Ca}function $g(){if(gu)return mu;gu=1;var s=Hg();return mu=new s}function Rd(){if(yu)return fu;yu=1;var s,e=an!==void 0?an:typeof window<"u"?window:{},t=$g();return typeof document<"u"?s=document:(s=e["__GLOBAL_DOCUMENT_CACHE@4"])||(s=e["__GLOBAL_DOCUMENT_CACHE@4"]=t),fu=s}const re=vr(Rd());var _u,wa,vu,bu,Tu,Su,Eu,Cu,wu,Au,$r={exports:{}},xu={exports:{}};function Vg(){return _u||(_u=1,function(s){function e(){return s.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i=i.length?{done:!0}:{done:!1,value:i[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(i,r){if(i){if(typeof i=="string")return t(i,r);var n=Object.prototype.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(i,r):void 0}}function t(i,r){(r==null||r>i.length)&&(r=i.length);for(var n=0,a=new Array(r);n=400&&n.statusCode<=599){var l=a;if(i)if(s.TextDecoder){var h=e(n.headers&&n.headers["content-type"]);try{l=new TextDecoder(h).decode(a)}catch{}}else l=String.fromCharCode.apply(null,new Uint8Array(a));t({cause:l})}else t(null,a)}}}function Yg(){if(Au)return $r.exports;Au=1;var s=Rn(),e=Vg(),t=zg(),i=Wg(),r=Gg();p.httpHandler=Xg(),p.requestInterceptorsStorage=new i,p.responseInterceptorsStorage=new i,p.retryManager=new r;var n=function(E){var I={};return E&&E.trim().split(` -`).forEach(function(v){var L=v.indexOf(":"),R=v.slice(0,L).trim().toLowerCase(),M=v.slice(L+1).trim();I[R]===void 0?I[R]=M:Array.isArray(I[R])?I[R].push(M):I[R]=[I[R],M]}),I};function a(E,I){for(var v=0;v0&&(S=setTimeout(function(){if(!U){U=!0,H.abort("timeout");var Q=new Error("XMLHttpRequest timeout");Q.code="ETIMEDOUT",G(Q)}},E.timeout)),H.setRequestHeader)for(z in W)W.hasOwnProperty(z)&&H.setRequestHeader(z,W[z]);else if(E.headers&&!l(E.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in E&&(H.responseType=E.responseType),"beforeSend"in E&&typeof E.beforeSend=="function"&&E.beforeSend(H),H.send($||null),H}function y(E){try{if(E.responseType==="document")return E.responseXML;var I=E.responseXML&&E.responseXML.documentElement.nodeName==="parsererror";if(E.responseType===""&&!I)return E.responseXML}catch{}return null}function w(){}return $r.exports=p,$r.exports.default=p,p.XMLHttpRequest=s.XMLHttpRequest||w,p.XDomainRequest="withCredentials"in new p.XMLHttpRequest?p.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(E){p[E==="delete"?"del":E]=function(I,v,L){return(v=h(I,v,L)).method=E.toUpperCase(),g(v)}}),$r.exports}const Md=vr(Yg());var ku,Du,Iu,Pu,Lu,Ou,Nu,Aa={exports:{}};function Kg(){if(Du)return ku;Du=1;var s=Rd(),e=Object.create||function(){function S(){}return function(A){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return S.prototype=A,new S}}();function t(S,A){this.name="ParsingError",this.code=S.code,this.message=A||S.message}function i(S){function A($,W,te,J){return 3600*(0|$)+60*(0|W)+(0|te)+(0|J)/1e3}var B=S.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return B?B[3]?A(B[1],B[2],B[3].replace(":",""),B[4]):B[1]>59?A(B[1],B[2],0,B[4]):A(0,B[1],B[2],B[4]):null}function r(){this.values=e(null)}function n(S,A,B,$){var W=$?S.split($):[S];for(var te in W)if(typeof W[te]=="string"){var J=W[te].split(B);J.length===2&&A(J[0].trim(),J[1].trim())}}function a(S,A,B){var $=S;function W(){var oe=i(S);if(oe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+$);return S=S.replace(/^[^\sa-zA-Z-]+/,""),oe}function te(oe,Q){var Y=new r;n(oe,function(ie,se){switch(ie){case"region":for(var ee=B.length-1;ee>=0;ee--)if(B[ee].id===se){Y.set(ie,B[ee].region);break}break;case"vertical":Y.alt(ie,se,["rl","lr"]);break;case"line":var ye=se.split(","),_e=ye[0];Y.integer(ie,_e),Y.percent(ie,_e)&&Y.set("snapToLines",!1),Y.alt(ie,_e,["auto"]),ye.length===2&&Y.alt("lineAlign",ye[1],["start","center","end"]);break;case"position":ye=se.split(","),Y.percent(ie,ye[0]),ye.length===2&&Y.alt("positionAlign",ye[1],["start","center","end"]);break;case"size":Y.percent(ie,se);break;case"align":Y.alt(ie,se,["start","center","end","left","right"])}},/:/,/\s/),Q.region=Y.get("region",null),Q.vertical=Y.get("vertical","");try{Q.line=Y.get("line","auto")}catch{}Q.lineAlign=Y.get("lineAlign","start"),Q.snapToLines=Y.get("snapToLines",!0),Q.size=Y.get("size",100);try{Q.align=Y.get("align","center")}catch{Q.align=Y.get("align","middle")}try{Q.position=Y.get("position","auto")}catch{Q.position=Y.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},Q.align)}Q.positionAlign=Y.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},Q.align)}function J(){S=S.replace(/^\s+/,"")}if(J(),A.startTime=W(),J(),S.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+$);S=S.substr(3),J(),A.endTime=W(),J(),te(S,A)}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.prototype={set:function(S,A){this.get(S)||A===""||(this.values[S]=A)},get:function(S,A,B){return B?this.has(S)?this.values[S]:A[B]:this.has(S)?this.values[S]:A},has:function(S){return S in this.values},alt:function(S,A,B){for(var $=0;$=0&&A<=100)&&(this.set(S,A),!0)}};var l=s.createElement&&s.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},p={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},g={v:"title",lang:"lang"},y={rt:"ruby"};function w(S,A){function B(){if(!A)return null;function _e(me){return A=A.substr(me.length),me}var ve=A.match(/^([^<]*)(<[^>]*>?)?/);return _e(ve[1]?ve[1]:ve[2])}function $(_e){return l.innerHTML=_e,_e=l.textContent,l.textContent="",_e}function W(_e,ve){return!y[ve.localName]||y[ve.localName]===_e.localName}function te(_e,ve){var me=h[_e];if(!me)return null;var Fe=S.document.createElement(me),et=g[_e];return et&&ve&&(Fe[et]=ve.trim()),Fe}for(var J,oe=S.document.createElement("div"),Q=oe,Y=[];(J=B())!==null;)if(J[0]!=="<")Q.appendChild(S.document.createTextNode($(J)));else{if(J[1]==="/"){Y.length&&Y[Y.length-1]===J.substr(2).replace(">","")&&(Y.pop(),Q=Q.parentNode);continue}var ie,se=i(J.substr(1,J.length-2));if(se){ie=S.document.createProcessingInstruction("timestamp",se),Q.appendChild(ie);continue}var ee=J.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ee||!(ie=te(ee[1],ee[3]))||!W(Q,ie))continue;if(ee[2]){var ye=ee[2].split(".");ye.forEach(function(_e){var ve=/^bg_/.test(_e),me=ve?_e.slice(3):_e;if(p.hasOwnProperty(me)){var Fe=ve?"background-color":"color",et=p[me];ie.style[Fe]=et}}),ie.className=ye.join(" ")}Y.push(ee[1]),Q.appendChild(ie),Q=ie}return oe}var E=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function I(S){for(var A=0;A=B[0]&&S<=B[1])return!0}return!1}function v(S){var A=[],B="";if(!S||!S.childNodes)return"ltr";function $(J,oe){for(var Q=oe.childNodes.length-1;Q>=0;Q--)J.push(oe.childNodes[Q])}function W(J){if(!J||!J.length)return null;var oe=J.pop(),Q=oe.textContent||oe.innerText;if(Q){var Y=Q.match(/^.*(\n|\r)/);return Y?(J.length=0,Y[0]):Q}return oe.tagName==="ruby"?W(J):oe.childNodes?($(J,oe),W(J)):void 0}for($(A,S);B=W(A);)for(var te=0;te=0&&S.line<=100))return S.line;if(!S.track||!S.track.textTrackList||!S.track.textTrackList.mediaElement)return-1;for(var A=S.track,B=A.textTrackList,$=0,W=0;WYe&&(et=new O(me),We=Ye),me=new O(Pe)}return et||Pe}var te=new O(A),J=A.cue,oe=L(J),Q=[];if(J.snapToLines){var Y;switch(J.vertical){case"":Q=["+y","-y"],Y="height";break;case"rl":Q=["+x","-x"],Y="width";break;case"lr":Q=["-x","+x"],Y="width"}var ie=te.lineHeight,se=ie*Math.round(oe),ee=B[Y]+ie,ye=Q[0];Math.abs(se)>ee&&(se=se<0?-1:1,se*=Math.ceil(ee/ie)*ie),oe<0&&(se+=J.vertical===""?B.height:B.width,Q=Q.reverse()),te.move(ye,se)}else{var _e=te.lineHeight/B.height*100;switch(J.lineAlign){case"center":oe-=_e/2;break;case"end":oe-=_e}switch(J.vertical){case"":A.applyStyles({top:A.formatStyle(oe,"%")});break;case"rl":A.applyStyles({left:A.formatStyle(oe,"%")});break;case"lr":A.applyStyles({right:A.formatStyle(oe,"%")})}Q=["+y","-x","+x","-y"],te=new O(A)}var ve=W(te,Q);A.move(ve.toCSSCompatValues(B))}function N(){}R.prototype.applyStyles=function(S,A){for(var B in A=A||this.div,S)S.hasOwnProperty(B)&&(A.style[B]=S[B])},R.prototype.formatStyle=function(S,A){return S===0?0:S+A},M.prototype=e(R.prototype),M.prototype.constructor=M,O.prototype.move=function(S,A){switch(A=A!==void 0?A:this.lineHeight,S){case"+x":this.left+=A,this.right+=A;break;case"-x":this.left-=A,this.right-=A;break;case"+y":this.top+=A,this.bottom+=A;break;case"-y":this.top-=A,this.bottom-=A}},O.prototype.overlaps=function(S){return this.leftS.left&&this.topS.top},O.prototype.overlapsAny=function(S){for(var A=0;A=S.top&&this.bottom<=S.bottom&&this.left>=S.left&&this.right<=S.right},O.prototype.overlapsOppositeAxis=function(S,A){switch(A){case"+x":return this.leftS.right;case"+y":return this.topS.bottom}},O.prototype.intersectPercentage=function(S){return Math.max(0,Math.min(this.right,S.right)-Math.max(this.left,S.left))*Math.max(0,Math.min(this.bottom,S.bottom)-Math.max(this.top,S.top))/(this.height*this.width)},O.prototype.toCSSCompatValues=function(S){return{top:this.top-S.top,bottom:S.bottom-this.bottom,left:this.left-S.left,right:S.right-this.right,height:this.height,width:this.width}},O.getSimpleBoxPosition=function(S){var A=S.div?S.div.offsetHeight:S.tagName?S.offsetHeight:0,B=S.div?S.div.offsetWidth:S.tagName?S.offsetWidth:0,$=S.div?S.div.offsetTop:S.tagName?S.offsetTop:0;return{left:(S=S.div?S.div.getBoundingClientRect():S.tagName?S.getBoundingClientRect():S).left,right:S.right,top:S.top||$,height:S.height||A,bottom:S.bottom||$+(S.height||A),width:S.width||B}},N.StringDecoder=function(){return{decode:function(S){if(!S)return"";if(typeof S!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(S))}}},N.convertCueToDOMTree=function(S,A){return S&&A?w(S,A):null};var z=.05,U="sans-serif",H="1.5%";return N.processCues=function(S,A,B){if(!S||!A||!B)return null;for(;B.firstChild;)B.removeChild(B.firstChild);var $=S.document.createElement("div");function W(Y){for(var ie=0;ie")===-1){A.cue.id=J;continue}case"CUE":try{a(J,A.cue,A.regionList)}catch(ie){A.reportOrThrowError(ie),A.cue=null,A.state="BADCUE";continue}A.state="CUETEXT";continue;case"CUETEXT":var Y=J.indexOf("-->")!==-1;if(!J||Y&&(Q=!0)){A.oncue&&A.oncue(A.cue),A.cue=null,A.state="ID";continue}A.cue.text&&(A.cue.text+=` -`),A.cue.text+=J.replace(/\u2028/g,` -`).replace(/u2029/g,` -`);continue;case"BADCUE":J||(A.state="ID");continue}}}catch(ie){A.reportOrThrowError(ie),A.state==="CUETEXT"&&A.cue&&A.oncue&&A.oncue(A.cue),A.cue=null,A.state=A.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var S=this;try{if(S.buffer+=S.decoder.decode(),(S.cue||S.state==="HEADER")&&(S.buffer+=` - -`,S.parse()),S.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(A){S.reportOrThrowError(A)}return S.onflush&&S.onflush(),this}},ku=N}function Qg(){if(Pu)return Iu;Pu=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){return typeof a=="string"&&!!e[a.toLowerCase()]&&a.toLowerCase()}function r(a){return typeof a=="string"&&!!t[a.toLowerCase()]&&a.toLowerCase()}function n(a,l,h){this.hasBeenReset=!1;var p="",g=!1,y=a,w=l,E=h,I=null,v="",L=!0,R="auto",M="start",O="auto",G="auto",N=100,z="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return p},set:function(U){p=""+U}},pauseOnExit:{enumerable:!0,get:function(){return g},set:function(U){g=!!U}},startTime:{enumerable:!0,get:function(){return y},set:function(U){if(typeof U!="number")throw new TypeError("Start time must be set to a number.");y=U,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return w},set:function(U){if(typeof U!="number")throw new TypeError("End time must be set to a number.");w=U,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return E},set:function(U){E=""+U,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return I},set:function(U){I=U,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return v},set:function(U){var H=i(U);if(H===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");v=H,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return L},set:function(U){L=!!U,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return R},set:function(U){if(typeof U!="number"&&U!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");R=U,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return M},set:function(U){var H=r(U);H?(M=H,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return O},set:function(U){if(U<0||U>100)throw new Error("Position must be between 0 and 100.");O=U,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return G},set:function(U){var H=r(U);H?(G=H,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return N},set:function(U){if(U<0||U>100)throw new Error("Size must be between 0 and 100.");N=U,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return z},set:function(U){var H=r(U);if(!H)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");z=H,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Iu=n}function Jg(){if(Ou)return Lu;Ou=1;var s={"":!0,up:!0};function e(r){return typeof r=="string"&&!!s[r.toLowerCase()]&&r.toLowerCase()}function t(r){return typeof r=="number"&&r>=0&&r<=100}function i(){var r=100,n=3,a=0,l=100,h=0,p=100,g="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(y){if(!t(y))throw new Error("Width must be between 0 and 100.");r=y}},lines:{enumerable:!0,get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");n=y}},regionAnchorY:{enumerable:!0,get:function(){return l},set:function(y){if(!t(y))throw new Error("RegionAnchorX must be between 0 and 100.");l=y}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(y){if(!t(y))throw new Error("RegionAnchorY must be between 0 and 100.");a=y}},viewportAnchorY:{enumerable:!0,get:function(){return p},set:function(y){if(!t(y))throw new Error("ViewportAnchorY must be between 0 and 100.");p=y}},viewportAnchorX:{enumerable:!0,get:function(){return h},set:function(y){if(!t(y))throw new Error("ViewportAnchorX must be between 0 and 100.");h=y}},scroll:{enumerable:!0,get:function(){return g},set:function(y){var w=e(y);w===!1?console.warn("Scroll: an invalid or illegal string was specified."):g=w}}})}return Lu=i}function Zg(){if(Nu)return Aa.exports;Nu=1;var s=Rn(),e=Aa.exports={WebVTT:Kg(),VTTCue:Qg(),VTTRegion:Jg()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,r=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=i},e.restore=function(){s.VTTCue=r,s.VTTRegion=n},s.VTTCue||e.shim(),Aa.exports}const Ru=vr(Zg());function ze(){return ze=Object.assign?Object.assign.bind():function(s){for(var e=1;e-1},e.trigger=function(t){var i=this.listeners[t];if(i)if(arguments.length===2)for(var r=i.length,n=0;n-1;t=this.buffer.indexOf(` -`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const sf=" ",xa=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},rf=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},ht=function(s){const e={};if(!s)return e;const t=s.split(rf());let i,r=t.length;for(;r--;)t[r]!==""&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),e[i[0]]=i[1]);return e},Bu=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class nf extends Oo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if((e=e.trim()).length!==0){if(e[0]!=="#")return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((r,n)=>{const a=n(e);return a===e?r:r.concat([a])},[e]).forEach(r=>{for(let n=0;nn),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const i=r=>e.test(r)?t(r):r;this.tagMappers.push(i)}}const af=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),bs=function(s){const e={};return Object.keys(s).forEach(function(t){e[af(t)]=s[t]}),e},ka=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&3*t,h=i&&2*i;t&&!e.hasOwnProperty(n)&&(e[n]=l,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${l}).`})),l&&e[n]{a.uri||!a.parts&&!a.preloadHints||(!a.map&&r&&(a.map=r),!a.key&&n&&(a.key=n),a.timeline||typeof y!="number"||(a.timeline=y),this.manifest.preloadSegment=a)}),this.parseStream.on("data",function(v){let L,R;if(t.manifest.definitions){for(const M in t.manifest.definitions)if(v.uri&&(v.uri=v.uri.replace(`{$${M}}`,t.manifest.definitions[M])),v.attributes)for(const O in v.attributes)typeof v.attributes[O]=="string"&&(v.attributes[O]=v.attributes[O].replace(`{$${M}}`,t.manifest.definitions[M]))}({tag(){({version(){v.version&&(this.manifest.version=v.version)},"allow-cache"(){this.manifest.allowCache=v.allowed,"allowed"in v||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const M={};"length"in v&&(a.byterange=M,M.length=v.length,"offset"in v||(v.offset=w)),"offset"in v&&(a.byterange=M,M.offset=v.offset),w=M.offset+M.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),v.title&&(a.title=v.title),v.duration>0&&(a.duration=v.duration),v.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(v.attributes)if(v.attributes.METHOD!=="NONE")if(v.attributes.URI){if(v.attributes.KEYFORMAT==="com.apple.streamingkeydelivery")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:v.attributes});if(v.attributes.KEYFORMAT==="com.microsoft.playready")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:v.attributes.URI});if(v.attributes.KEYFORMAT===g)return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(v.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(v.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),v.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):v.attributes.KEYID&&v.attributes.KEYID.substring(0,2)==="0x"?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:v.attributes.KEYFORMAT,keyId:v.attributes.KEYID.substring(2)},pssh:Bd(v.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));v.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:v.attributes.METHOD||"AES-128",uri:v.attributes.URI},v.attributes.IV!==void 0&&(n.iv=v.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(v.number)?this.manifest.mediaSequence=v.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+v.number})},"discontinuity-sequence"(){isFinite(v.number)?(this.manifest.discontinuitySequence=v.number,y=v.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+v.number})},"playlist-type"(){/VOD|EVENT/.test(v.playlistType)?this.manifest.playlistType=v.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+v.playlist})},map(){r={},v.uri&&(r.uri=v.uri),v.byterange&&(r.byterange=v.byterange),n&&(r.key=n)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||p,v.attributes?(a.attributes||(a.attributes={}),ze(a.attributes,v.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(v.attributes&&v.attributes.TYPE&&v.attributes["GROUP-ID"]&&v.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const M=this.manifest.mediaGroups[v.attributes.TYPE];M[v.attributes["GROUP-ID"]]=M[v.attributes["GROUP-ID"]]||{},L=M[v.attributes["GROUP-ID"]],R={default:/yes/i.test(v.attributes.DEFAULT)},R.default?R.autoselect=!0:R.autoselect=/yes/i.test(v.attributes.AUTOSELECT),v.attributes.LANGUAGE&&(R.language=v.attributes.LANGUAGE),v.attributes.URI&&(R.uri=v.attributes.URI),v.attributes["INSTREAM-ID"]&&(R.instreamId=v.attributes["INSTREAM-ID"]),v.attributes.CHARACTERISTICS&&(R.characteristics=v.attributes.CHARACTERISTICS),v.attributes.FORCED&&(R.forced=/yes/i.test(v.attributes.FORCED)),L[v.attributes.NAME]=R},discontinuity(){y+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=v.dateTimeString,this.manifest.dateTimeObject=v.dateTimeObject),a.dateTimeString=v.dateTimeString,a.dateTimeObject=v.dateTimeObject;const{lastProgramDateTime:M}=this;this.lastProgramDateTime=new Date(v.dateTimeString).getTime(),M===null&&this.manifest.segments.reduceRight((O,G)=>(G.programDateTime=O-1e3*G.duration,G.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(v.duration)||v.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+v.duration}):(this.manifest.targetDuration=v.duration,ka.call(this,this.manifest))},start(){v.attributes&&!isNaN(v.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:v.attributes["TIME-OFFSET"],precise:v.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){a.cueOut=v.data},"cue-out-cont"(){a.cueOutCont=v.data},"cue-in"(){a.cueIn=v.data},skip(){this.manifest.skip=bs(v.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",v.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const M=this.manifest.segments.length,O=bs(v.attributes);a.parts=a.parts||[],a.parts.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=E),E=O.byterange.offset+O.byterange.length);const G=a.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${G} for segment #${M}`,v.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((N,z)=>{N.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${z} lacks required attribute(s): LAST-PART`})})},"server-control"(){const M=this.manifest.serverControl=bs(v.attributes);M.hasOwnProperty("canBlockReload")||(M.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ka.call(this,this.manifest),M.canSkipDateranges&&!M.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const M=this.manifest.segments.length,O=bs(v.attributes),G=O.type&&O.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=G?E:0,G&&(E=O.byterange.offset+O.byterange.length)));const N=a.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${N} for segment #${M}`,v.attributes,["TYPE","URI"]),O.type)for(let z=0;zz.id===O.id);this.manifest.dateRanges[N]=ze(this.manifest.dateRanges[N],O),I[O.id]=ze(I[O.id],O),this.manifest.dateRanges.pop()}else I[O.id]=O},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=bs(v.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",v.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const M=(O,G)=>{O in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${O}`}):this.manifest.definitions[O]=G};if("QUERYPARAM"in v.attributes){if("NAME"in v.attributes||"IMPORT"in v.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const O=this.params.get(v.attributes.QUERYPARAM);return O?void M(v.attributes.QUERYPARAM,decodeURIComponent(O)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${v.attributes.QUERYPARAM}`})}return"NAME"in v.attributes?"IMPORT"in v.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in v.attributes&&typeof v.attributes.VALUE=="string"?void M(v.attributes.NAME,v.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${v.attributes.NAME}`}):"IMPORT"in v.attributes?this.mainDefinitions[v.attributes.IMPORT]?void M(v.attributes.IMPORT,this.mainDefinitions[v.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${v.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:v.attributes,uri:v.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",v.attributes,["BANDWIDTH","URI"])}}[v.tagType]||h).call(t)},uri(){a.uri=v.uri,i.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),n&&(a.key=n),a.timeline=y,r&&(a.map=r),E=0,this.lastProgramDateTime!==null&&(a.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*a.duration),a={}},comment(){},custom(){v.segment?(a.custom=a.custom||{},a.custom[v.customType]=v.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[v.customType]=v.data)}})[v.type].call(t)})}requiredCompatibilityversion(e,t){(ep&&(h-=p,h-=p,h-=it(2))}return Number(h)},_f=function(s,e){var t={}.le,i=t!==void 0&&t;(typeof s!="bigint"&&typeof s!="number"||typeof s=="number"&&s!=s)&&(s=0),s=it(s);for(var r=gf(s),n=new Uint8Array(new ArrayBuffer(r)),a=0;a=e.length&&h.call(e,function(p,g){return p===(l[g]?l[g]&s[n+g]:s[n+g])})},bf=function(s,e,t){e.forEach(function(i){for(var r in s.mediaGroups[i])for(var n in s.mediaGroups[i][r]){var a=s.mediaGroups[i][r][n];t(a,i,r,n)}})},Zi={},os={},Ms={};function Bn(){if(ju)return Ms;function s(n,a,l){if(l===void 0&&(l=Array.prototype),n&&typeof l.find=="function")return l.find.call(n,a);for(var h=0;h=0))throw new $(A,new Error(_.tagName+"@"+P));for(var ae=T.length-1;q"&&">")||_=="&"&&"&"||_=='"'&&"""||"&#"+_.charCodeAt()+";"}function _e(_,T){if(T(_))return!0;if(_=_.firstChild)do if(_e(_,T))return!0;while(_=_.nextSibling)}function ve(){this.ownerDocument=this}function me(_,T,P){_&&_._inc++,P.namespaceURI===t.XMLNS&&(T._nsMap[P.prefix?P.localName:""]=P.value)}function Fe(_,T,P,q){_&&_._inc++,P.namespaceURI===t.XMLNS&&delete T._nsMap[P.prefix?P.localName:""]}function et(_,T,P){if(_&&_._inc){_._inc++;var q=T.childNodes;if(P)q[q.length++]=P;else{for(var ae=T.firstChild,le=0;ae;)q[le++]=ae,ae=ae.nextSibling;q.length=le,delete q[q.length]}}}function Pe(_,T){var P=T.previousSibling,q=T.nextSibling;return P?P.nextSibling=q:_.firstChild=q,q?q.previousSibling=P:_.lastChild=P,T.parentNode=null,T.previousSibling=null,T.nextSibling=null,et(_.ownerDocument,_),T}function We(_){return _&&(_.nodeType===ee.DOCUMENT_NODE||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.ELEMENT_NODE)}function Ge(_){return _&&(rt(_)||Ut(_)||Ye(_)||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.COMMENT_NODE||_.nodeType===ee.PROCESSING_INSTRUCTION_NODE)}function Ye(_){return _&&_.nodeType===ee.DOCUMENT_TYPE_NODE}function rt(_){return _&&_.nodeType===ee.ELEMENT_NODE}function Ut(_){return _&&_.nodeType===ee.TEXT_NODE}function Ke(_,T){var P=_.childNodes||[];if(e(P,rt)||Ye(T))return!1;var q=e(P,Ye);return!(T&&q&&P.indexOf(q)>P.indexOf(T))}function ts(_,T){var P=_.childNodes||[];function q(le){return rt(le)&&le!==T}if(e(P,q))return!1;var ae=e(P,Ye);return!(T&&ae&&P.indexOf(ae)>P.indexOf(T))}function Ps(_,T,P){if(!We(_))throw new $(S,"Unexpected parent node type "+_.nodeType);if(P&&P.parentNode!==_)throw new $(A,"child not in parent");if(!Ge(T)||Ye(T)&&_.nodeType!==ee.DOCUMENT_NODE)throw new $(S,"Unexpected node type "+T.nodeType+" for parent node type "+_.nodeType)}function Ys(_,T,P){var q=_.childNodes||[],ae=T.childNodes||[];if(T.nodeType===ee.DOCUMENT_FRAGMENT_NODE){var le=ae.filter(rt);if(le.length>1||e(ae,Ut))throw new $(S,"More than one element or text in fragment");if(le.length===1&&!Ke(_,P))throw new $(S,"Element in fragment can not be inserted before doctype")}if(rt(T)&&!Ke(_,P))throw new $(S,"Only one element can be added and only after doctype");if(Ye(T)){if(e(q,Ye))throw new $(S,"Only one doctype is allowed");var De=e(q,rt);if(P&&q.indexOf(De)1||e(ae,Ut))throw new $(S,"More than one element or text in fragment");if(le.length===1&&!ts(_,P))throw new $(S,"Element in fragment can not be inserted before doctype")}if(rt(T)&&!ts(_,P))throw new $(S,"Only one element can be added and only after doctype");if(Ye(T)){if(e(q,function(Ee){return Ye(Ee)&&Ee!==P}))throw new $(S,"Only one doctype is allowed");var De=e(q,rt);if(P&&q.indexOf(De)=0;jt--)if((Pt=ae[jt]).prefix===""&&Pt.namespace===_.namespaceURI){st=Pt.namespace;break}}if(st!==_.namespaceURI)for(jt=ae.length-1;jt>=0;jt--){var Pt;if((Pt=ae[jt]).namespace===_.namespaceURI){Pt.prefix&&(qt=Pt.prefix+":"+wt);break}}}T.push("<",qt);for(var ns=0;ns"),P&&/^script$/i.test(wt))for(;Ee;)Ee.data?T.push(Ee.data):rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;else for(;Ee;)rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;T.push("")}else T.push("/>");return;case O:case N:for(Ee=_.firstChild;Ee;)rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;return;case w:return Hi(T,_.name,_.value);case E:return T.push(_.data.replace(/[<&>]/g,ye));case I:return T.push("");case M:return T.push("");case G:var Js=_.publicId,Ht=_.systemId;if(T.push("");else if(Ht&&Ht!=".")T.push(" SYSTEM ",Ht,">");else{var Zs=_.internalSubset;Zs&&T.push(" [",Zs,"]"),T.push(">")}return;case R:return T.push("");case v:return T.push("&",_.nodeName,";");default:T.push("??",_.nodeName)}}function Qs(_,T,P){var q;switch(T.nodeType){case y:(q=T.cloneNode(!1)).ownerDocument=_;case N:break;case w:P=!0}if(q||(q=T.cloneNode(!1)),q.ownerDocument=_,q.parentNode=null,P)for(var ae=T.firstChild;ae;)q.appendChild(Qs(_,ae,P)),ae=ae.nextSibling;return q}function ys(_,T,P){var q=new T.constructor;for(var ae in T)if(Object.prototype.hasOwnProperty.call(T,ae)){var le=T[ae];typeof le!="object"&&le!=q[ae]&&(q[ae]=le)}switch(T.childNodes&&(q.childNodes=new W),q.ownerDocument=_,q.nodeType){case y:var De=T.attributes,Ee=q.attributes=new oe,wt=De.length;Ee._ownerElement=q;for(var qt=0;qt=0&&_0},lookupPrefix:function(_){for(var T=this;T;){var P=T._nsMap;if(P){for(var q in P)if(Object.prototype.hasOwnProperty.call(P,q)&&P[q]===_)return q}T=T.nodeType==w?T.ownerDocument:T.parentNode}return null},lookupNamespaceURI:function(_){for(var T=this;T;){var P=T._nsMap;if(P&&Object.prototype.hasOwnProperty.call(P,_))return P[_];T=T.nodeType==w?T.ownerDocument:T.parentNode}return null},isDefaultNamespace:function(_){return this.lookupPrefix(_)==null}},h(g,ee),h(g,ee.prototype),ve.prototype={nodeName:"#document",nodeType:O,doctype:null,documentElement:null,_inc:1,insertBefore:function(_,T){if(_.nodeType==N){for(var P=_.firstChild;P;){var q=P.nextSibling;this.insertBefore(P,T),P=q}return _}return ss(this,_,T),_.ownerDocument=this,this.documentElement===null&&_.nodeType===y&&(this.documentElement=_),_},removeChild:function(_){return this.documentElement==_&&(this.documentElement=null),Pe(this,_)},replaceChild:function(_,T){ss(this,_,T,ms),_.ownerDocument=this,T&&this.removeChild(T),rt(_)&&(this.documentElement=_)},importNode:function(_,T){return Qs(this,_,T)},getElementById:function(_){var T=null;return _e(this.documentElement,function(P){if(P.nodeType==y&&P.getAttribute("id")==_)return T=P,!0}),T},getElementsByClassName:function(_){var T=a(_);return new te(this,function(P){var q=[];return T.length>0&&_e(P.documentElement,function(ae){if(ae!==P&&ae.nodeType===y){var le=ae.getAttribute("class");if(le){var De=_===le;if(!De){var Ee=a(le);De=T.every(l(Ee))}De&&q.push(ae)}}}),q})},createElement:function(_){var T=new je;return T.ownerDocument=this,T.nodeName=_,T.tagName=_,T.localName=_,T.childNodes=new W,(T.attributes=new oe)._ownerElement=T,T},createDocumentFragment:function(){var _=new Ks;return _.ownerDocument=this,_.childNodes=new W,_},createTextNode:function(_){var T=new Se;return T.ownerDocument=this,T.appendData(_),T},createComment:function(_){var T=new Fi;return T.ownerDocument=this,T.appendData(_),T},createCDATASection:function(_){var T=new Ui;return T.ownerDocument=this,T.appendData(_),T},createProcessingInstruction:function(_,T){var P=new qi;return P.ownerDocument=this,P.tagName=P.nodeName=P.target=_,P.nodeValue=P.data=T,P},createAttribute:function(_){var T=new lt;return T.ownerDocument=this,T.name=_,T.nodeName=_,T.localName=_,T.specified=!0,T},createEntityReference:function(_){var T=new fs;return T.ownerDocument=this,T.nodeName=_,T},createElementNS:function(_,T){var P=new je,q=T.split(":"),ae=P.attributes=new oe;return P.childNodes=new W,P.ownerDocument=this,P.nodeName=T,P.tagName=T,P.namespaceURI=_,q.length==2?(P.prefix=q[0],P.localName=q[1]):P.localName=T,ae._ownerElement=P,P},createAttributeNS:function(_,T){var P=new lt,q=T.split(":");return P.ownerDocument=this,P.nodeName=T,P.name=T,P.namespaceURI=_,P.specified=!0,q.length==2?(P.prefix=q[0],P.localName=q[1]):P.localName=T,P}},p(ve,ee),je.prototype={nodeType:y,hasAttribute:function(_){return this.getAttributeNode(_)!=null},getAttribute:function(_){var T=this.getAttributeNode(_);return T&&T.value||""},getAttributeNode:function(_){return this.attributes.getNamedItem(_)},setAttribute:function(_,T){var P=this.ownerDocument.createAttribute(_);P.value=P.nodeValue=""+T,this.setAttributeNode(P)},removeAttribute:function(_){var T=this.getAttributeNode(_);T&&this.removeAttributeNode(T)},appendChild:function(_){return _.nodeType===N?this.insertBefore(_,null):Oe(this,_)},setAttributeNode:function(_){return this.attributes.setNamedItem(_)},setAttributeNodeNS:function(_){return this.attributes.setNamedItemNS(_)},removeAttributeNode:function(_){return this.attributes.removeNamedItem(_.nodeName)},removeAttributeNS:function(_,T){var P=this.getAttributeNodeNS(_,T);P&&this.removeAttributeNode(P)},hasAttributeNS:function(_,T){return this.getAttributeNodeNS(_,T)!=null},getAttributeNS:function(_,T){var P=this.getAttributeNodeNS(_,T);return P&&P.value||""},setAttributeNS:function(_,T,P){var q=this.ownerDocument.createAttributeNS(_,T);q.value=q.nodeValue=""+P,this.setAttributeNode(q)},getAttributeNodeNS:function(_,T){return this.attributes.getNamedItemNS(_,T)},getElementsByTagName:function(_){return new te(this,function(T){var P=[];return _e(T,function(q){q===T||q.nodeType!=y||_!=="*"&&q.tagName!=_||P.push(q)}),P})},getElementsByTagNameNS:function(_,T){return new te(this,function(P){var q=[];return _e(P,function(ae){ae===P||ae.nodeType!==y||_!=="*"&&ae.namespaceURI!==_||T!=="*"&&ae.localName!=T||q.push(ae)}),q})}},ve.prototype.getElementsByTagName=je.prototype.getElementsByTagName,ve.prototype.getElementsByTagNameNS=je.prototype.getElementsByTagNameNS,p(je,ee),lt.prototype.nodeType=w,p(lt,ee),is.prototype={data:"",substringData:function(_,T){return this.data.substring(_,_+T)},appendData:function(_){_=this.data+_,this.nodeValue=this.data=_,this.length=_.length},insertData:function(_,T){this.replaceData(_,0,T)},appendChild:function(_){throw new Error(H[S])},deleteData:function(_,T){this.replaceData(_,T,"")},replaceData:function(_,T,P){P=this.data.substring(0,_)+P+this.data.substring(_+T),this.nodeValue=this.data=P,this.length=P.length}},p(is,ee),Se.prototype={nodeName:"#text",nodeType:E,splitText:function(_){var T=this.data,P=T.substring(_);T=T.substring(0,_),this.data=this.nodeValue=T,this.length=T.length;var q=this.ownerDocument.createTextNode(P);return this.parentNode&&this.parentNode.insertBefore(q,this.nextSibling),q}},p(Se,is),Fi.prototype={nodeName:"#comment",nodeType:M},p(Fi,is),Ui.prototype={nodeName:"#cdata-section",nodeType:I},p(Ui,is),gs.prototype.nodeType=G,p(gs,ee),ke.prototype.nodeType=z,p(ke,ee),Ar.prototype.nodeType=L,p(Ar,ee),fs.prototype.nodeType=v,p(fs,ee),Ks.prototype.nodeName="#document-fragment",Ks.prototype.nodeType=N,p(Ks,ee),qi.prototype.nodeType=R,p(qi,ee),xr.prototype.serializeToString=function(_,T,P){return kr.call(_,T,P)},ee.prototype.toString=kr;try{if(Object.defineProperty){let _=function(T){switch(T.nodeType){case y:case N:var P=[];for(T=T.firstChild;T;)T.nodeType!==7&&T.nodeType!==8&&P.push(_(T)),T=T.nextSibling;return P.join("");default:return T.nodeValue}};Object.defineProperty(te.prototype,"length",{get:function(){return J(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return _(this)},set:function(T){switch(this.nodeType){case y:case N:for(;this.firstChild;)this.removeChild(this.firstChild);(T||String(T))&&this.appendChild(this.ownerDocument.createTextNode(T));break;default:this.data=T,this.value=T,this.nodeValue=T}}}),tt=function(T,P,q){T["$$"+P]=q}}}catch{}return os.DocumentType=gs,os.DOMException=$,os.DOMImplementation=se,os.Element=je,os.Node=ee,os.NodeList=W,os.XMLSerializer=xr,os}var $u,er={},Vu={};function Tf(){return $u||($u=1,s=Vu,e=Bn().freeze,s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` -`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),s.entityMap=s.HTML_ENTITIES),Vu;var s,e}var zu,Wu,Gu,zr={};function Sf(){if(zu)return zr;zu=1;var s=Bn().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,a=2,l=3,h=4,p=5,g=6,y=7;function w(S,A){this.message=S,this.locator=A,Error.captureStackTrace&&Error.captureStackTrace(this,w)}function E(){}function I(S,A,B,$,W){function te(Oe){if(Oe>65535){var je=55296+((Oe-=65536)>>10),lt=56320+(1023&Oe);return String.fromCharCode(je,lt)}return String.fromCharCode(Oe)}function J(Oe){var je=Oe.slice(1,-1);return Object.hasOwnProperty.call(B,je)?B[je]:je.charAt(0)==="#"?te(parseInt(je.substr(1).replace("x","0x"))):(W.error("entity not found:"+Oe),Oe)}function oe(Oe){if(Oe>ve){var je=S.substring(ve,Oe).replace(/&#?\w+;/g,J);ee&&Q(ve),$.characters(je,0,Oe-ve),ve=Oe}}function Q(Oe,je){for(;Oe>=ie&&(je=se.exec(S));)Y=je.index,ie=Y+je[0].length,ee.lineNumber++;ee.columnNumber=Oe-Y+1}for(var Y=0,ie=0,se=/.*(?:\r\n?|\n)|.*$/g,ee=$.locator,ye=[{currentNSMap:A}],_e={},ve=0;;){try{var me=S.indexOf("<",ve);if(me<0){if(!S.substr(ve).match(/^\s*$/)){var Fe=$.doc,et=Fe.createTextNode(S.substr(ve));Fe.appendChild(et),$.currentElement=et}return}switch(me>ve&&oe(me),S.charAt(me+1)){case"/":var Pe=S.indexOf(">",me+3),We=S.substring(me+2,Pe).replace(/[ \t\n\r]+$/g,""),Ge=ye.pop();Pe<0?(We=S.substring(me+2).replace(/[\s<].*/,""),W.error("end tag name: "+We+" is not complete:"+Ge.tagName),Pe=me+1+We.length):We.match(/\sve?ve=Pe:oe(Math.max(me,ve)+1)}}function v(S,A){return A.lineNumber=S.lineNumber,A.columnNumber=S.columnNumber,A}function L(S,A,B,$,W,te){function J(ee,ye,_e){B.attributeNames.hasOwnProperty(ee)&&te.fatalError("Attribute "+ee+" redefined"),B.addValue(ee,ye.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,W),_e)}for(var oe,Q=++A,Y=r;;){var ie=S.charAt(Q);switch(ie){case"=":if(Y===n)oe=S.slice(A,Q),Y=l;else{if(Y!==a)throw new Error("attribute equal must after attrName");Y=l}break;case"'":case'"':if(Y===l||Y===n){if(Y===n&&(te.warning('attribute value must after "="'),oe=S.slice(A,Q)),A=Q+1,!((Q=S.indexOf(ie,A))>0))throw new Error("attribute value no end '"+ie+"' match");J(oe,se=S.slice(A,Q),A-1),Y=p}else{if(Y!=h)throw new Error('attribute value must after "="');J(oe,se=S.slice(A,Q),A),te.warning('attribute "'+oe+'" missed start quot('+ie+")!!"),A=Q+1,Y=p}break;case"/":switch(Y){case r:B.setTagName(S.slice(A,Q));case p:case g:case y:Y=y,B.closed=!0;case h:case n:break;case a:B.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return te.error("unexpected end of input"),Y==r&&B.setTagName(S.slice(A,Q)),Q;case">":switch(Y){case r:B.setTagName(S.slice(A,Q));case p:case g:case y:break;case h:case n:(se=S.slice(A,Q)).slice(-1)==="/"&&(B.closed=!0,se=se.slice(0,-1));case a:Y===a&&(se=oe),Y==h?(te.warning('attribute "'+se+'" missed quot(")!'),J(oe,se,A)):(s.isHTML($[""])&&se.match(/^(?:disabled|checked|selected)$/i)||te.warning('attribute "'+se+'" missed value!! "'+se+'" instead!!'),J(se,se,A));break;case l:throw new Error("attribute value missed!!")}return Q;case"€":ie=" ";default:if(ie<=" ")switch(Y){case r:B.setTagName(S.slice(A,Q)),Y=g;break;case n:oe=S.slice(A,Q),Y=a;break;case h:var se=S.slice(A,Q);te.warning('attribute "'+se+'" missed quot(")!!'),J(oe,se,A);case p:Y=g}else switch(Y){case a:B.tagName,s.isHTML($[""])&&oe.match(/^(?:disabled|checked|selected)$/i)||te.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead2!!'),J(oe,oe,A),A=Q,Y=n;break;case p:te.warning('attribute space is required"'+oe+'"!!');case g:Y=n,A=Q;break;case l:Y=h,A=Q;break;case y:throw new Error("elements closed character '/' and '>' must be connected to")}}Q++}}function R(S,A,B){for(var $=S.tagName,W=null,te=S.length;te--;){var J=S[te],oe=J.qName,Q=J.value;if((ee=oe.indexOf(":"))>0)var Y=J.prefix=oe.slice(0,ee),ie=oe.slice(ee+1),se=Y==="xmlns"&&ie;else ie=oe,Y=null,se=oe==="xmlns"&&"";J.localName=ie,se!==!1&&(W==null&&(W={},G(B,B={})),B[se]=W[se]=Q,J.uri=s.XMLNS,A.startPrefixMapping(se,Q))}for(te=S.length;te--;)(Y=(J=S[te]).prefix)&&(Y==="xml"&&(J.uri=s.XML),Y!=="xmlns"&&(J.uri=B[Y||""]));var ee;(ee=$.indexOf(":"))>0?(Y=S.prefix=$.slice(0,ee),ie=S.localName=$.slice(ee+1)):(Y=null,ie=S.localName=$);var ye=S.uri=B[Y||""];if(A.startElement(ye,ie,$,S),!S.closed)return S.currentNSMap=B,S.localNSMap=W,!0;if(A.endElement(ye,ie,$),W)for(Y in W)Object.prototype.hasOwnProperty.call(W,Y)&&A.endPrefixMapping(Y)}function M(S,A,B,$,W){if(/^(?:script|textarea)$/i.test(B)){var te=S.indexOf("",A),J=S.substring(A+1,te);if(/[&<]/.test(J))return/^script$/i.test(B)?(W.characters(J,0,J.length),te):(J=J.replace(/&#?\w+;/g,$),W.characters(J,0,J.length),te)}return A+1}function O(S,A,B,$){var W=$[B];return W==null&&((W=S.lastIndexOf(""))",A+4))>A?(B.comment(S,A+4,W-A-4),W+3):($.error("Unclosed comment"),-1):-1;if(S.substr(A+3,6)=="CDATA["){var W=S.indexOf("]]>",A+9);return B.startCDATA(),B.characters(S,A+9,W-A-9),B.endCDATA(),W+3}var te=H(S,A),J=te.length;if(J>1&&/!doctype/i.test(te[0][0])){var oe=te[1][0],Q=!1,Y=!1;J>3&&(/^public$/i.test(te[2][0])?(Q=te[3][0],Y=J>4&&te[4][0]):/^system$/i.test(te[2][0])&&(Y=te[3][0]));var ie=te[J-1];return B.startDTD(oe,Q,Y),B.endDTD(),ie.index+ie[0].length}return-1}function z(S,A,B){var $=S.indexOf("?>",A);if($){var W=S.substring(A,$).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return W?(W[0].length,B.processingInstruction(W[1],W[2]),$+2):-1}return-1}function U(){this.attributeNames={}}function H(S,A){var B,$=[],W=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(W.lastIndex=A,W.exec(S);B=W.exec(S);)if($.push(B),B[1])return $}return w.prototype=new Error,w.prototype.name=w.name,E.prototype={parse:function(S,A,B){var $=this.domBuilder;$.startDocument(),G(A,A={}),I(S,A,B,$,this.errorHandler),$.endDocument()}},U.prototype={setTagName:function(S){if(!i.test(S))throw new Error("invalid tagName:"+S);this.tagName=S},addValue:function(S,A,B){if(!i.test(S))throw new Error("invalid attribute:"+S);this.attributeNames[S]=this.length,this[this.length++]={qName:S,value:A,offset:B}},length:0,getLocalName:function(S){return this[S].localName},getLocator:function(S){return this[S].locator},getQName:function(S){return this[S].qName},getURI:function(S){return this[S].uri},getValue:function(S){return this[S].value}},zr.XMLReader=E,zr.ParseError=w,zr}function Ef(){if(Wu)return er;Wu=1;var s=Bn(),e=$d(),t=Tf(),i=Sf(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,l=i.XMLReader;function h(L){return L.replace(/\r[\n\u0085]/g,` -`).replace(/[\r\u0085\u2028]/g,` -`)}function p(L){this.options=L||{locator:{}}}function g(L,R,M){if(!L){if(R instanceof y)return R;L=R}var O={},G=L instanceof Function;function N(z){var U=L[z];!U&&G&&(U=L.length==2?function(H){L(z,H)}:L),O[z]=U&&function(H){U("[xmldom "+z+"] "+H+E(M))}||function(){}}return M=M||{},N("warning"),N("error"),N("fatalError"),O}function y(){this.cdata=!1}function w(L,R){R.lineNumber=L.lineNumber,R.columnNumber=L.columnNumber}function E(L){if(L)return` -@`+(L.systemId||"")+"#[line:"+L.lineNumber+",col:"+L.columnNumber+"]"}function I(L,R,M){return typeof L=="string"?L.substr(R,M):L.length>=R+M||R?new java.lang.String(L,R,M)+"":L}function v(L,R){L.currentElement?L.currentElement.appendChild(R):L.doc.appendChild(R)}return p.prototype.parseFromString=function(L,R){var M=this.options,O=new l,G=M.domBuilder||new y,N=M.errorHandler,z=M.locator,U=M.xmlns||{},H=/\/x?html?$/.test(R),S=H?t.HTML_ENTITIES:t.XML_ENTITIES;z&&G.setDocumentLocator(z),O.errorHandler=g(N,G,z),O.domBuilder=M.domBuilder||G,H&&(U[""]=n.HTML),U.xml=U.xml||n.XML;var A=M.normalizeLineEndings||h;return L&&typeof L=="string"?O.parse(A(L),U,S):O.errorHandler.error("invalid doc source"),G.doc},y.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(L,R,M,O){var G=this.doc,N=G.createElementNS(L,M||R),z=O.length;v(this,N),this.currentElement=N,this.locator&&w(this.locator,N);for(var U=0;U!!s&&typeof s=="object",Ze=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):Xu(e[i])&&Xu(t[i])?e[i]=Ze(e[i],t[i]):e[i]=t[i]}),e),{}),Vd=s=>Object.keys(s).map(e=>s[e]),Af=(s,e)=>{const t=[];for(let i=s;is.reduce((e,t)=>e.concat(t),[]),zd=s=>{if(!s.length)return[];const e=[];for(let t=0;ts.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),kf=(s,e)=>Vd(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var wi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const gr=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:Mn(s||"",e)};if(t||i){const n=(t||i).split("-");let a,l=k.BigInt?k.BigInt(n[0]):parseInt(n[0],10),h=k.BigInt?k.BigInt(n[1]):parseInt(n[1],10);l{let e;return e=typeof s.offset=="bigint"||typeof s.length=="bigint"?k.BigInt(s.offset)+k.BigInt(s.length)-k.BigInt(1):s.offset+s.length-1,`${s.offset}-${e}`},Yu=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),If={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=Yu(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:i/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:h=1/0}=s,p=Yu(s.endNumber),g=(e+t)/1e3,y=i+a,w=g+l-y,E=Math.ceil(w*r/n),I=Math.floor((g-y-h)*r/n),v=Math.floor((g-y)*r/n);return{start:Math.max(0,I),end:typeof p=="number"?p:Math.min(E,v)}}},Pf=s=>e=>{const{duration:t,timescale:i=1,periodStart:r,startNumber:n=1}=s;return{number:n+e,duration:t/i,timeline:r,time:e*t}},No=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:l}=If[e](s),h=Af(a,l).map(Pf(s));if(e==="static"){const p=h.length-1,g=typeof r=="number"?r:n;h[p].duration=g-t/i*p}return h},Wd=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:l=0,duration:h}=s;if(!e)throw new Error(wi.NO_BASE_URL);const p=gr({baseUrl:e,source:t.sourceURL,range:t.range}),g=gr({baseUrl:e,source:e,indexRange:r});if(g.map=p,h){const y=No(s);y.length&&(g.duration=y[0].duration,g.timeline=y[0].timeline)}else i&&(g.duration=i,g.timeline=n);return g.presentationTime=a||n,g.number=l,[g]},Ro=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,l=a.offset+a.length,h=e.timescale,p=e.references.filter(L=>L.referenceType!==1),g=[],y=s.endList?"static":"dynamic",w=s.sidx.timeline;let E,I=w,v=s.mediaSequence||0;E=typeof e.firstOffset=="bigint"?k.BigInt(l)+e.firstOffset:l+e.firstOffset;for(let L=0;Lkf(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Nf=(s,e)=>{for(let t=0;t{let e=[];return bf(s,Lf,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},Qu=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},Rf=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:l}){return l===i.timeline});const r=Nf(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--);r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),Qu({playlist:i,mediaSequence:r.segments[a].number})})},Mf=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(Ku(s)),i=e.playlists.concat(Ku(e));return e.timelineStarts=Gd([s.timelineStarts,e.timelineStarts]),Rf({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Fn=s=>s&&s.uri+"-"+Df(s.byterange),Ia=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=Vd(i.reduce((n,a)=>{const l=a.attributes.id+(a.attributes.lang||"");return n[l]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[l].segments.push(...a.segments)),a.attributes.contentProtection&&(n[l].attributes.contentProtection=a.attributes.contentProtection)):(n[l]=a,n[l].attributes.timelineStarts=[]),n[l].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(i=>(i.discontinuityStarts=xf(i.segments||[],"discontinuity"),i))},Mo=(s,e)=>{const t=Fn(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&Ro(s,i,s.sidx.resolvedUri),s},Bf=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Mo(s[t],e);return s},Ff=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const l={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:i,segments:e};return s.contentProtection&&(l.contentProtection=s.contentProtection),s.serviceLocation&&(l.attributes.serviceLocation=s.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},Uf=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:r})=>{e===void 0&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},qf=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const l=a.attributes.role&&a.attributes.role.value||"",h=a.attributes.lang||"";let p=a.attributes.label||"main";if(h&&!a.attributes.label){const y=l?` (${l})`:"";p=`${a.attributes.lang}${y}`}n[p]||(n[p]={language:h,autoselect:!0,default:l==="main",playlists:[],uri:""});const g=Mo(Ff(a,t),e);return n[p].playlists.push(g),i===void 0&&l==="main"&&(i=a,i.default=!0),n},{});return i||(r[Object.keys(r)[0]].default=!0),r},jf=(s,e={})=>s.reduce((t,i)=>{const r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Mo(Uf(i),e)),t},{}),Hf=s=>s.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:r,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),$f=({attributes:s,segments:e,sidx:t,discontinuityStarts:i})=>{const r={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:i,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(r.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},Vf=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",zf=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",Wf=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",Gf=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,r)=>{i.number=r})})},Ju=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],Xf=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:l,suggestedPresentationDelay:h,minimumUpdatePeriod:p}=s[0].attributes,g=Ia(s.filter(Vf)).map($f),y=Ia(s.filter(zf)),w=Ia(s.filter(Wf)),E=s.map(G=>G.attributes.captionServices).filter(Boolean),I={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Bf(g,i)};p>=0&&(I.minimumUpdatePeriod=1e3*p),e&&(I.locations=e),t&&(I.contentSteering=t),l==="dynamic"&&(I.suggestedPresentationDelay=h),n&&n.length>0&&(I.eventStream=n);const v=I.playlists.length===0,L=y.length?qf(y,i,v):null,R=w.length?jf(w,i):null,M=g.concat(Ju(L),Ju(R)),O=M.map(({timelineStarts:G})=>G);return I.timelineStarts=Gd(O),Gf(M,I.timelineStarts),L&&(I.mediaGroups.AUDIO.audio=L),R&&(I.mediaGroups.SUBTITLES.subs=R),E.length&&(I.mediaGroups["CLOSED-CAPTIONS"].cc=Hf(E)),r?Mf({oldManifest:r,newManifest:I}):I},Yf=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:h=0}=s,p=(i+r)/1e3+h-(n+l);return Math.ceil((p*a-e)/t)},Xd=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:l=1,periodStart:h}=s,p=[];let g=-1;for(let y=0;yg&&(g=v),I<0){const O=y+1;L=O===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?Yf(s,g,E):(n*a-g)/E:(e[O].t-g)/E}else L=I+1;const R=l+p.length+L;let M=l+p.length;for(;M(e,t,i,r)=>{if(e==="$$")return"$";if(s[t]===void 0)return e;const n=""+s[t];return t==="RepresentationID"?n:(r=i?parseInt(r,10):1,n.length>=r?n:`${new Array(r-n.length+1).join("0")}${n}`)},Zu=(s,e)=>s.replace(Kf,Qf(e)),Jf=(s,e)=>s.duration||e?s.duration?No(s):Xd(s,e):[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}],Zf=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=gr({baseUrl:s.baseUrl,source:Zu(i.sourceURL,t),range:i.range});return Jf(s,e).map(n=>{t.Number=n.number,t.Time=n.time;const a=Zu(s.media||"",t),l=s.timescale||1,h=s.presentationTimeOffset||0,p=s.periodStart+(n.time-h)/l;return{uri:a,timeline:n.timeline,duration:n.duration,resolvedUri:Mn(s.baseUrl||"",a),map:r,number:n.number,presentationTime:p}})},ey=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=gr({baseUrl:t,source:i.sourceURL,range:i.range}),n=gr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},ty=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(wi.SEGMENT_TIME_UNSPECIFIED);const n=i.map(l=>ey(s,l));let a;return t&&(a=No(s)),e&&(a=Xd(s,e)),a.map((l,h)=>{if(n[h]){const p=n[h],g=s.timescale||1,y=s.presentationTimeOffset||0;return p.timeline=l.timeline,p.duration=l.duration,p.number=l.number,p.presentationTime=r+(l.time-y)/g,p}}).filter(l=>l)},sy=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=Zf,t=Ze(s,e.template)):e.base?(i=Wd,t=Ze(s,e.base)):e.list&&(i=ty,t=Ze(s,e.list));const r={attributes:s};if(!i)return r;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:l=1}=t;t.duration=a/l}else n.length?t.duration=n.reduce((a,l)=>Math.max(a,Math.ceil(l.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},iy=s=>s.map(sy),Be=(s,e)=>zd(s.childNodes).filter(({tagName:t})=>t===e),br=s=>s.textContent.trim(),ry=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),ai=s=>{const e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!e)return 0;const[t,i,r,n,a,l]=e.slice(1);return parseFloat(t||0)*31536e3+parseFloat(i||0)*2592e3+parseFloat(r||0)*86400+parseFloat(n||0)*3600+parseFloat(a||0)*60+parseFloat(l||0)},ny=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),eh={mediaPresentationDuration:s=>ai(s),availabilityStartTime:s=>ny(s)/1e3,minimumUpdatePeriod:s=>ai(s),suggestedPresentationDelay:s=>ai(s),type:s=>s,timeShiftBufferDepth:s=>ai(s),start:s=>ai(s),width:s=>parseInt(s,10),height:s=>parseInt(s,10),bandwidth:s=>parseInt(s,10),frameRate:s=>ry(s),startNumber:s=>parseInt(s,10),timescale:s=>parseInt(s,10),presentationTimeOffset:s=>parseInt(s,10),duration(s){const e=parseInt(s,10);return isNaN(e)?ai(s):e},d:s=>parseInt(s,10),t:s=>parseInt(s,10),r:s=>parseInt(s,10),presentationTime:s=>parseInt(s,10),DEFAULT:s=>s},Xe=s=>s&&s.attributes?zd(s.attributes).reduce((e,t)=>{const i=eh[t.name]||eh.DEFAULT;return e[t.name]=i(t.value),e},{}):{},ay={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Un=(s,e)=>e.length?Ci(s.map(function(t){return e.map(function(i){const r=br(i),n=Mn(t.baseUrl,r),a=Ze(Xe(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,Bo=s=>{const e=Be(s,"SegmentTemplate")[0],t=Be(s,"SegmentList")[0],i=t&&Be(t,"SegmentURL").map(y=>Ze({tag:"SegmentURL"},Xe(y))),r=Be(s,"SegmentBase")[0],n=t||e,a=n&&Be(n,"SegmentTimeline")[0],l=t||r||e,h=l&&Be(l,"Initialization")[0],p=e&&Xe(e);p&&h?p.initialization=h&&Xe(h):p&&p.initialization&&(p.initialization={sourceURL:p.initialization});const g={template:p,segmentTimeline:a&&Be(a,"S").map(y=>Xe(y)),list:t&&Ze(Xe(t),{segmentUrls:i,initialization:Xe(h)}),base:r&&Ze(Xe(r),{initialization:Xe(h)})};return Object.keys(g).forEach(y=>{g[y]||delete g[y]}),g},oy=(s,e,t)=>i=>{const r=Be(i,"BaseURL"),n=Un(e,r),a=Ze(s,Xe(i)),l=Bo(i);return n.map(h=>({segmentInfo:Ze(t,l),attributes:Ze(a,h)}))},ly=s=>s.reduce((e,t)=>{const i=Xe(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=ay[i.schemeIdUri];if(r){e[r]={attributes:i};const n=Be(t,"cenc:pssh")[0];if(n){const a=br(n);e[r].pssh=a&&Bd(a)}}return e},{}),uy=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,r=""]=e.split("=");t.channel=i,t.language=e,r.split(",").forEach(n=>{const[a,l]=n.split(":");a==="lang"?t.language=l:a==="er"?t.easyReader=Number(l):a==="war"?t.aspectRatio=Number(l):a==="3D"&&(t["3D"]=Number(l))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})},hy=s=>Ci(Be(s.node,"EventStream").map(e=>{const t=Xe(e),i=t.schemeIdUri;return Be(e,"Event").map(r=>{const n=Xe(r),a=n.presentationTime||0,l=t.timescale||1,h=n.duration||0,p=a/l+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:p,end:p+h/l,messageData:br(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),dy=(s,e,t)=>i=>{const r=Xe(i),n=Un(e,Be(i,"BaseURL")),a=Be(i,"Role")[0],l={role:Xe(a)};let h=Ze(s,r,l);const p=Be(i,"Accessibility")[0],g=uy(Xe(p));g&&(h=Ze(h,{captionServices:g}));const y=Be(i,"Label")[0];if(y&&y.childNodes.length){const L=y.childNodes[0].nodeValue.trim();h=Ze(h,{label:L})}const w=ly(Be(i,"ContentProtection"));Object.keys(w).length&&(h=Ze(h,{contentProtection:w}));const E=Bo(i),I=Be(i,"Representation"),v=Ze(t,E);return Ci(I.map(oy(h,n,v)))},cy=(s,e)=>(t,i)=>{const r=Un(e,Be(t.node,"BaseURL")),n=Ze(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Be(t.node,"AdaptationSet"),l=Bo(t.node);return Ci(a.map(dy(n,r,l)))},py=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=Ze({serverURL:br(s[0])},Xe(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},my=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:e||t!=="static"?null:0,gy=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Be(s,"Period");if(!a.length)throw new Error(wi.INVALID_NUMBER_OF_PERIOD);const l=Be(s,"Location"),h=Xe(s),p=Un([{baseUrl:t}],Be(s,"BaseURL")),g=Be(s,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=i,h.clientOffset=r,l.length&&(h.locations=l.map(br));const y=[];return a.forEach((w,E)=>{const I=Xe(w),v=y[E-1];I.start=my({attributes:I,priorPeriodAttributes:v?v.attributes:null,mpdType:h.type}),y.push({node:w,attributes:I})}),{locations:h.locations,contentSteeringInfo:py(g,n),representationInfo:Ci(y.map(cy(h,p))),eventStream:Ci(y.map(hy))}},Yd=s=>{if(s==="")throw new Error(wi.DASH_EMPTY_MANIFEST);const e=new wf.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(wi.DASH_INVALID_XML);return i},fy=s=>{const e=Be(s,"UTCTiming")[0];if(!e)return null;const t=Xe(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(wi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},yy=(s,e={})=>{const t=gy(Yd(s),e),i=iy(t.representationInfo);return Xf({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},_y=s=>fy(Yd(s));var th,sh,ih,rh;function vy(){if(sh)return th;sh=1;var s=Math.pow(2,32);return th={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))0;r+=12,n--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return i}}const Ty=vr(by());var Sy=ce([73,68,51]),Ey=function(s,e){e===void 0&&(e=0);var t=(s=ce(s))[e+5],i=s[e+6]<<21|s[e+7]<<14|s[e+8]<<7|s[e+9];return(16&t)>>4?i+20:i+10},nr=function s(e,t){return t===void 0&&(t=0),(e=ce(e)).length-t<10||!Me(e,Sy,{offset:t})?t:s(e,t+=Ey(e,t))},nh=function(s){return typeof s=="string"?Hd(s):s},Cy=function(s){return Array.isArray(s)?s.map(function(e){return nh(e)}):[nh(s)]},wy=function s(e,t,i){i===void 0&&(i=!1),t=Cy(t),e=ce(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,l=e.subarray(n+4,n+8);if(a===0)break;var h=n+a;if(h>e.length){if(i)break;h=e.length}var p=e.subarray(n+8,h);Me(l,t[0])&&(t.length===1?r.push(p):r.push.apply(r,s(p,t.slice(1),i))),n=h}return r},Wr={EBML:ce([26,69,223,163]),DocType:ce([66,130]),Segment:ce([24,83,128,103]),SegmentInfo:ce([21,73,169,102]),Tracks:ce([22,84,174,107]),Track:ce([174]),TrackNumber:ce([215]),DefaultDuration:ce([35,227,131]),TrackEntry:ce([174]),TrackType:ce([131]),FlagDefault:ce([136]),CodecID:ce([134]),CodecPrivate:ce([99,162]),VideoTrack:ce([224]),AudioTrack:ce([225]),Cluster:ce([31,67,182,117]),Timestamp:ce([231]),TimestampScale:ce([42,215,177]),BlockGroup:ce([160]),BlockDuration:ce([155]),Block:ce([161]),SimpleBlock:ce([163])},oo=[128,64,32,16,8,4,2,1],Ay=function(s){for(var e=1,t=0;t=t.length)return t.length;var r=on(t,i,!1);if(Me(e.bytes,r.bytes))return i;var n=on(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},oh=function s(e,t){t=xy(t),e=ce(e);var i=[];if(!t.length)return i;for(var r=0;re.length?e.length:l+a.value,p=e.subarray(l,h);Me(t[0],n.bytes)&&(t.length===1?i.push(p):i=i.concat(s(p,t.slice(1)))),r+=n.length+a.length+p.length}return i},Dy=ce([0,0,0,1]),Iy=ce([0,0,1]),Py=ce([0,0,3]),Ly=function(s){for(var e=[],t=1;t>1&63),t.indexOf(h)!==-1&&(r=n+l),n+=l+(e==="h264"?1:2)}else n++}return s.subarray(0,0)},Oy=function(s,e,t){return Kd(s,"h264",e,t)},Ny=function(s,e,t){return Kd(s,"h265",e,t)},dt={webm:ce([119,101,98,109]),matroska:ce([109,97,116,114,111,115,107,97]),flac:ce([102,76,97,67]),ogg:ce([79,103,103,83]),ac3:ce([11,119]),riff:ce([82,73,70,70]),avi:ce([65,86,73]),wav:ce([87,65,86,69]),"3gp":ce([102,116,121,112,51,103]),mp4:ce([102,116,121,112]),fmp4:ce([115,116,121,112]),mov:ce([102,116,121,112,113,116]),moov:ce([109,111,111,118]),moof:ce([109,111,111,102])},Ai={aac:function(s){var e=nr(s);return Me(s,[255,16],{offset:e,mask:[255,22]})},mp3:function(s){var e=nr(s);return Me(s,[255,2],{offset:e,mask:[255,6]})},webm:function(s){var e=oh(s,[Wr.EBML,Wr.DocType])[0];return Me(e,dt.webm)},mkv:function(s){var e=oh(s,[Wr.EBML,Wr.DocType])[0];return Me(e,dt.matroska)},mp4:function(s){return!Ai["3gp"](s)&&!Ai.mov(s)&&(!(!Me(s,dt.mp4,{offset:4})&&!Me(s,dt.fmp4,{offset:4}))||!(!Me(s,dt.moof,{offset:4})&&!Me(s,dt.moov,{offset:4}))||void 0)},mov:function(s){return Me(s,dt.mov,{offset:4})},"3gp":function(s){return Me(s,dt["3gp"],{offset:4})},ac3:function(s){var e=nr(s);return Me(s,dt.ac3,{offset:e})},ts:function(s){if(s.length<189&&s.length>=1)return s[0]===71;for(var e=0;e+1880};function By(){if(uh)return lh;uh=1;var s,e,t,i,r,n,a,l=9e4;return r=function(h,p){return s(i(h,p))},n=function(h,p){return e(t(h),p)},a=function(h,p,g){return t(g?h:h-p)},lh={ONE_SECOND_IN_TS:l,secondsToVideoTs:s=function(h){return h*l},secondsToAudioTs:e=function(h,p){return h*p},videoTsToSeconds:t=function(h){return h/l},audioTsToSeconds:i=function(h,p){return h/p},audioTsToVideoTs:r,videoTsToAudioTs:n,metadataTsToSeconds:a}}var js=By(),uo="8.18.1";const hs={},xs=function(s,e){return hs[s]=hs[s]||[],e&&(hs[s]=hs[s].concat(e)),hs[s]},Fy=function(s,e){xs(s,e)},Qd=function(s,e){const t=xs(s).indexOf(e);return!(t<=-1)&&(hs[s]=hs[s].slice(),hs[s].splice(t,1),!0)},Uy=function(s,e){xs(s,[].concat(e).map(t=>{const i=(...r)=>(Qd(s,i),t(...r));return i}))},ln={prefixed:!0},en=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],hh=en[0];let ar;for(let s=0;s(i,r,n)=>{const a=e.levels[r],l=new RegExp(`^(${a})$`);let h=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(h=`%c${s}`,n.unshift(t)),n.unshift(h+":"),yt){yt.push([].concat(n));const g=yt.length-1e3;yt.splice(0,g>0?g:0)}if(!k.console)return;let p=k.console[i];p||i!=="debug"||(p=k.console.info||k.console.log),p&&a&&l.test(i)&&p[Array.isArray(n)?"apply":"call"](k.console,n)};function ho(s,e=":",t=""){let i,r="info";function n(...a){i("log",r,a)}return i=qy(s,n,t),n.createLogger=(a,l,h)=>{const p=l!==void 0?l:e;return ho(`${s} ${p} ${a}`,p,h!==void 0?h:t)},n.createNewLogger=(a,l,h)=>ho(a,l,h),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);r=a}return r},n.history=()=>yt?[].concat(yt):[],n.history.filter=a=>(yt||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{yt&&(yt.length=0)},n.history.disable=()=>{yt!==null&&(yt.length=0,yt=null)},n.history.enable=()=>{yt===null&&(yt=[])},n.error=(...a)=>i("error",r,a),n.warn=(...a)=>i("warn",r,a),n.debug=(...a)=>i("debug",r,a),n}const Te=ho("VIDEOJS"),Jd=Te.createLogger,jy=Object.prototype.toString,Zd=function(s){return Zt(s)?Object.keys(s):[]};function fi(s,e){Zd(s).forEach(t=>e(s[t],t))}function ec(s,e,t=0){return Zd(s).reduce((i,r)=>e(i,s[r],r),t)}function Zt(s){return!!s&&typeof s=="object"}function xi(s){return Zt(s)&&jy.call(s)==="[object Object]"&&s.constructor===Object}function Ie(...s){const e={};return s.forEach(t=>{t&&fi(t,(i,r)=>{xi(i)?(xi(e[r])||(e[r]={}),e[r]=Ie(e[r],i)):e[r]=i})}),e}function tc(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function un(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var Hy=Object.freeze({__proto__:null,each:fi,reduce:ec,isObject:Zt,isPlain:xi,merge:Ie,values:tc,defineLazyProperty:un});let sc,Uo=!1,ic=null,Kt=!1,rc=!1,hi=!1,di=!1,Qt=!1,co=null,hn=null;const $y=!!(k.cast&&k.cast.framework&&k.cast.framework.CastReceiverContext);let nc=null,dn=!1,cn=!1,pn=!1,qn=!1,mn=!1,gn=!1,fn=!1;const fr=!!(Oi()&&("ontouchstart"in k||k.navigator.maxTouchPoints||k.DocumentTouch&&k.document instanceof k.DocumentTouch)),Ts=k.navigator&&k.navigator.userAgentData;if(Ts&&Ts.platform&&Ts.brands&&(Kt=Ts.platform==="Android",hi=!!Ts.brands.find(s=>s.brand==="Microsoft Edge"),di=!!Ts.brands.find(s=>s.brand==="Chromium"),Qt=!hi&&di,co=hn=(Ts.brands.find(s=>s.brand==="Chromium")||{}).version||null,cn=Ts.platform==="Windows"),!di){const s=k.navigator&&k.navigator.userAgent||"";Uo=/iPod/i.test(s),ic=function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Kt=/Android/i.test(s),sc=function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),rc=/Firefox/i.test(s),hi=/Edg/i.test(s),di=/Chrome/i.test(s)||/CriOS/i.test(s),Qt=!hi&&di,co=hn=function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),nc=function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t}(),mn=/Tizen/i.test(s),gn=/Web0S/i.test(s),fn=mn||gn,dn=/Safari/i.test(s)&&!Qt&&!Kt&&!hi&&!fn,cn=/Windows/i.test(s),pn=/iPad/i.test(s)||dn&&fr&&!/iPhone/i.test(s),qn=/iPhone/i.test(s)&&!pn}const mt=qn||pn||Uo,jn=(dn||mt)&&!Qt;var ac=Object.freeze({__proto__:null,get IS_IPOD(){return Uo},get IOS_VERSION(){return ic},get IS_ANDROID(){return Kt},get ANDROID_VERSION(){return sc},get IS_FIREFOX(){return rc},get IS_EDGE(){return hi},get IS_CHROMIUM(){return di},get IS_CHROME(){return Qt},get CHROMIUM_VERSION(){return co},get CHROME_VERSION(){return hn},IS_CHROMECAST_RECEIVER:$y,get IE_VERSION(){return nc},get IS_SAFARI(){return dn},get IS_WINDOWS(){return cn},get IS_IPAD(){return pn},get IS_IPHONE(){return qn},get IS_TIZEN(){return mn},get IS_WEBOS(){return gn},get IS_SMART_TV(){return fn},TOUCH_ENABLED:fr,IS_IOS:mt,IS_ANY_SAFARI:jn});function dh(s){return typeof s=="string"&&!!s.trim()}function Vy(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Oi(){return re===k.document}function Ni(s){return Zt(s)&&s.nodeType===1}function oc(){try{return k.parent!==k.self}catch{return!0}}function lc(s){return function(e,t){if(!dh(e))return re[s](null);dh(t)&&(t=re.querySelector(t));const i=Ni(t)?t:re;return i[s]&&i[s](e)}}function ge(s="div",e={},t={},i){const r=re.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Is(r,a):r[n]===a&&n!=="tabIndex"||(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&qo(r,i),r}function Is(s,e){return s.textContent===void 0?s.innerText=e:s.textContent=e,s}function po(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function ur(s,e){return Vy(e),s.classList.contains(e)}function Vs(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Hn(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(Te.warn("removeClass was called with an element that doesn't exist"),null)}function uc(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>s.classList.toggle(i,t)),s}function hc(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i==null||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function ws(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let r=i.length-1;r>=0;r--){const n=i[r].name;let a=i[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function dc(s,e){return s.getAttribute(e)}function ki(s,e,t){s.setAttribute(e,t)}function $n(s,e){s.removeAttribute(e)}function cc(){re.body.focus(),re.onselectstart=function(){return!1}}function pc(){re.onselectstart=function(){return!0}}function Di(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(Ii(s,"height"))),t.width||(t.width=parseFloat(Ii(s,"width"))),t}}function yr(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,r=0;for(;s.offsetParent&&s!==re[ln.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Vn(s,e){const t={x:0,y:0};if(mt){let g=s;for(;g&&g.nodeName.toLowerCase()!=="html";){const y=Ii(g,"transform");if(/^matrix/.test(y)){const w=y.slice(7,-1).split(/,\s/).map(Number);t.x+=w[4],t.y+=w[5]}else if(/^matrix3d/.test(y)){const w=y.slice(9,-1).split(/,\s/).map(Number);t.x+=w[12],t.y+=w[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&k.WebKitCSSMatrix){const w=k.getComputedStyle(g.assignedSlot.parentElement).transform,E=new k.WebKitCSSMatrix(w);t.x+=E.m41,t.y+=E.m42}g=g.parentNode||g.host}}const i={},r=yr(e.target),n=yr(s),a=n.width,l=n.height;let h=e.offsetY-(n.top-r.top),p=e.offsetX-(n.left-r.left);return e.changedTouches&&(p=e.changedTouches[0].pageX-n.left,h=e.changedTouches[0].pageY+n.top,mt&&(p-=t.x,h-=t.y)),i.y=1-Math.max(0,Math.min(1,h/l)),i.x=Math.max(0,Math.min(1,p/a)),i}function mc(s){return Zt(s)&&s.nodeType===3}function zn(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function gc(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>(typeof e=="function"&&(e=e()),Ni(e)||mc(e)?e:typeof e=="string"&&/\S/.test(e)?re.createTextNode(e):void 0)).filter(e=>e)}function qo(s,e){return gc(e).forEach(t=>s.appendChild(t)),s}function fc(s,e){return qo(zn(s),e)}function _r(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0||s.button===0&&s.buttons===1}const ks=lc("querySelector"),yc=lc("querySelectorAll");function Ii(s,e){if(!s||!e)return"";if(typeof k.getComputedStyle=="function"){let t;try{t=k.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function _c(s){[...re.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=re.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const t=re.createElement("link");t.rel="stylesheet",t.type=e.type,t.media=e.media.mediaText,t.href=e.href,s.document.head.appendChild(t)}})}var ch=Object.freeze({__proto__:null,isReal:Oi,isEl:Ni,isInFrame:oc,createEl:ge,textContent:Is,prependTo:po,hasClass:ur,addClass:Vs,removeClass:Hn,toggleClass:uc,setAttributes:hc,getAttributes:ws,getAttribute:dc,setAttribute:ki,removeAttribute:$n,blockTextSelection:cc,unblockTextSelection:pc,getBoundingClientRect:Di,findPosition:yr,getPointerPosition:Vn,isTextNode:mc,emptyEl:zn,normalizeContent:gc,appendContent:qo,insertContent:fc,isSingleLeftClick:_r,$:ks,$$:yc,computedStyle:Ii,copyStyleSheetsToWindow:_c});let mo,vc=!1;const zy=function(){if(mo.options.autoSetup===!1)return;const s=Array.prototype.slice.call(re.getElementsByTagName("video")),e=Array.prototype.slice.call(re.getElementsByTagName("audio")),t=Array.prototype.slice.call(re.getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let r=0,n=i.length;r-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function at(s,e,t){if(!pt.has(s))return;const i=pt.get(s);if(!i.handlers)return;if(Array.isArray(e))return jo(at,s,e,t);const r=function(a,l){i.handlers[l]=[],ph(a,l)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(s,a);return}const n=i.handlers[e];if(n)if(t){if(t.guid)for(let a=0;a=e&&(s(...i),t=r)}},Sc=function(s,e,t,i=k){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const l=this,h=arguments;let p=function(){r=null,p=null,t||s.apply(l,h)};!r&&t&&s.apply(l,h),i.clearTimeout(r),r=i.setTimeout(p,e)};return a.cancel=n,a};var Ky=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Dt,bind_:Le,throttle:es,debounce:Sc});let tr;class Et{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ct(this,e,t),this.addEventListener=i}off(e,t){at(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Gn(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ho(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Wn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ri(this,e)}queueTrigger(e){tr||(tr=new Map);const t=e.type||e;let i=tr.get(this);i||(i=new Map,tr.set(this,i));const r=i.get(t);i.delete(t),k.clearTimeout(r);const n=k.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,tr.delete(this)),this.trigger(e)},0);i.set(t,n)}}Et.prototype.allowedEvents_={},Et.prototype.addEventListener=Et.prototype.on,Et.prototype.removeEventListener=Et.prototype.off,Et.prototype.dispatchEvent=Et.prototype.trigger;const Xn=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,ps=s=>s instanceof Et||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),Qy=(s,e)=>{ps(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},yo=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,yn=(s,e,t)=>{if(!s||!s.nodeName&&!ps(s))throw new Error(`Invalid target for ${Xn(e)}#${t}; must be a DOM node or evented object.`)},Ec=(s,e,t)=>{if(!yo(s))throw new Error(`Invalid event type for ${Xn(e)}#${t}; must be a non-empty string or array.`)},Cc=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Xn(e)}#${t}; must be a function.`)},Pa=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let r,n,a;return i?(r=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),yn(r,s,t),Ec(n,s,t),Cc(a,s,t),a=Le(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Bs=(s,e,t,i)=>{yn(s,s,e),s.nodeName?Yy[e](s,t,i):s[e](t,i)},Jy={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"on");if(Bs(t,"on",i,r),!e){const n=()=>this.off(t,i,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,Bs(this,"on","dispose",n),Bs(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"one");if(e)Bs(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Bs(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"any");if(e)Bs(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Bs(t,"any",i,n)}},off(s,e,t){if(!s||yo(s))at(this.eventBusEl_,s,e);else{const i=s,r=e;yn(i,this,"off"),Ec(r,this,"off"),Cc(t,this,"off"),t=Le(this,t),this.off("dispose",t),i.nodeName?(at(i,r,t),at(i,"dispose",t)):ps(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){yn(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!yo(t))throw new Error(`Invalid event type for ${Xn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ri(this.eventBusEl_,s,e)}};function $o(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=ge("span",{className:"vjs-event-bus"});return Object.assign(s,Jy),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&pt.has(i)&&pt.delete(i)}),k.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const Zy={state:{},setState(s){let e;return typeof s=="function"&&(s=s()),fi(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&ps(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function wc(s,e){return Object.assign(s,Zy),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&ps(s)&&s.on("statechanged",s.handleStateChanged),s}const hr=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},He=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},Ac=function(s,e){return He(s)===He(e)};var e_=Object.freeze({__proto__:null,toLowerCase:hr,toTitleCase:He,titleCaseEquals:Ac});class V{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ie({},this.options_),t=this.options_=Ie(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${kt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&($o(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),wc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Ie(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ge(e,t,i)}localize(e,t,i=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],l=r&&r.split("-")[0],h=n&&n[l];let p=i;return a&&a[e]?p=a[e]:h&&h[e]&&(p=h[e]),t&&(p=p.replace(/\{(\d+)\}/g,function(g,y){const w=t[y-1];let E=w;return w===void 0&&(E=g),E})),p}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,r)=>i.concat(r),[]);let t=this;for(let i=0;i=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[He(e.name())]=null,this.childNameIndex_[hr(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const l=a.name;let h=a.opts;if(t[l]!==void 0&&(h=t[l]),h===!1)return;h===!0&&(h={}),h.playerOptions=this.options_.playerOptions;const p=this.addChild(l,h);p&&(this[l]=p)};let r;const n=V.getComponent("Tech");r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(l){return typeof l=="string"?a===l:a===l.name})})).map(a=>{let l,h;return typeof a=="string"?(l=a,h=e[l]||this.options_[l]||{}):(l=a.name,h=a),{name:l,opts:h}}).filter(a=>{const l=V.getComponent(a.opts.componentClass||He(a.name));return l&&!n.isTech(l)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ks(e,t||this.contentEl())}$$(e,t){return yc(e,t||this.contentEl())}hasClass(e){return ur(this.el_,e)}addClass(...e){Vs(this.el_,...e)}removeClass(...e){Hn(this.el_,...e)}toggleClass(e,t){uc(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return dc(this.el_,e)}setAttribute(e,t){ki(this.el_,e,t)}removeAttribute(e){$n(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0)return t!==null&&t==t||(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:this.el_.style[e]=t==="auto"?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+He(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Ii(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${He(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key==="Tab"||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,r=200;let n;this.on("touchstart",function(l){l.touches.length===1&&(t={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=k.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){const h=l.touches[0].pageX-t.pageX,p=l.touches[0].pageY-t.pageY;Math.sqrt(h*h+p*p)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&k.performance.now()-e{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),k.clearTimeout(e)),e}setInterval(e,t){e=Le(this,e),this.clearTimersOnDispose_();const i=k.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),k.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=Le(this,e),t=k.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Le(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),k.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=k.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function i(n){return!!t(n.parentElement)&&!(!t(n)||n.style.opacity==="0"||k.getComputedStyle(n).height==="0px"||k.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(re.documentElement.clientWidth||k.innerWidth)||a.y<0||a.y>(re.documentElement.clientHeight||k.innerHeight))return!1;let l=re.elementFromPoint(a.x,a.y);for(;l;){if(l===n)return!0;if(!l.parentNode)return!1;l=l.parentNode}}return e||(e=this.el()),!(!r(e)||!i(e)||e.parentElement&&!(e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=V.getComponent("Tech"),r=i&&i.isTech(t),n=V===t||V.prototype.isPrototypeOf(t.prototype);if(r||!n){let l;throw l=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${l}.`)}e=He(e),V.components_||(V.components_={});const a=V.getComponent("Player");if(e==="Player"&&a&&a.players){const l=a.players,h=Object.keys(l);if(l&&h.length>0&&h.map(p=>l[p]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return V.components_[e]=t,V.components_[hr(e)]=t,t}static getComponent(e){if(e&&V.components_)return V.components_[e]}}function t_(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function mh(s,e,t,i){return t_(s,i,t.length-1),t[i][e]}function La(s){let e;return e=s===void 0||s.length===0?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:s.length,start:mh.bind(null,"start",0,s),end:mh.bind(null,"end",1,s)},k.Symbol&&k.Symbol.iterator&&(e[k.Symbol.iterator]=()=>(s||[]).values()),e}function Ft(s,e){return Array.isArray(s)?La(s):s===void 0||e===void 0?La():La([[s,e]])}V.registerComponent("Component",V);const xc=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t};let Vo=xc;function kc(s){Vo=s}function Dc(){Vo=xc}function Xs(s,e=s){return Vo(s,e)}var s_=Object.freeze({__proto__:null,createTimeRanges:Ft,createTimeRange:Ft,setFormatTime:kc,resetFormatTime:Dc,formatTime:Xs});function Ic(s,e){let t,i,r=0;if(!e)return 0;s&&s.length||(s=Ft(0,0));for(let n=0;ne&&(i=e),r+=i-t;return r/e}function Ue(s){if(s instanceof Ue)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Zt(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Ue.defaultMessages[this.code]||"")}function dr(s){return s!=null&&typeof s.then=="function"}function Wt(s){dr(s)&&s.then(null,e=>{})}Ue.prototype.code=0,Ue.prototype.message="",Ue.prototype.status=null,Ue.prototype.metadata=null,Ue.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Ue.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Ue.MEDIA_ERR_CUSTOM=0,Ue.prototype.MEDIA_ERR_CUSTOM=0,Ue.MEDIA_ERR_ABORTED=1,Ue.prototype.MEDIA_ERR_ABORTED=1,Ue.MEDIA_ERR_NETWORK=2,Ue.prototype.MEDIA_ERR_NETWORK=2,Ue.MEDIA_ERR_DECODE=3,Ue.prototype.MEDIA_ERR_DECODE=3,Ue.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ue.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ue.MEDIA_ERR_ENCRYPTED=5,Ue.prototype.MEDIA_ERR_ENCRYPTED=5;const Oa=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>(s[t]&&(e[t]=s[t]),e),{cues:s.cues&&Array.prototype.map.call(s.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var gh={textTracksToJson:function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,i=>i.track);return Array.prototype.map.call(e,function(i){const r=Oa(i.track);return i.src&&(r.src=i.src),r}).concat(Array.prototype.filter.call(s.textTracks(),function(i){return t.indexOf(i)===-1}).map(Oa))},jsonToTextTracks:function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>i.addCue(r))}),e.textTracks()},trackToJson_:Oa};const Na="vjs-modal-dialog";class Pi extends V{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ge("div",{className:`${Na}-content`},{role:"document"}),this.descEl_=ge("p",{className:`${Na}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Is(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Na} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),fc(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),zn(this.contentEl()),this.trigger("modalempty")}content(e){return e!==void 0&&(this.content_=e),this.content_}conditionalFocus_(){const e=re.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable())return e.preventDefault(),void this.close();if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof k.HTMLAnchorElement||t instanceof k.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof k.HTMLInputElement||t instanceof k.HTMLSelectElement||t instanceof k.HTMLTextAreaElement||t instanceof k.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof k.HTMLIFrameElement||t instanceof k.HTMLObjectElement||t instanceof k.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}Pi.prototype.options_={pauseOnOpen:!0,temporary:!0},V.registerComponent("ModalDialog",Pi);class Li extends Et{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},ps(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i=0;t--)if(e[t].enabled){Ra(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ra(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ra(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Ma=function(s,e){for(let t=0;t=0;t--)if(e[t].selected){Ma(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,Ma(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Pc extends Li{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class n_{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;tt[r],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(r){r!==i&&(i=r,this.trigger("labelchange"))}})}}const Wo=function(s){return new URL(s,re.baseURI)},Lc=function(s){return new URL(s,re.baseURI).href},Go=function(s){if(typeof s=="string"){const e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(e)return e.pop().toLowerCase()}return""},Yn=function(s,e=k.location){return Wo(s).origin!==e.origin};var u_=Object.freeze({__proto__:null,parseUrl:Wo,getAbsoluteURL:Lc,getFileExtension:Go,isCrossOrigin:Yn});const yh=function(s,e){const t=new k.WebVTT.Parser(k,k.vttjs,k.WebVTT.StringDecoder()),i=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){i.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>0&&(k.console&&k.console.groupCollapsed&&k.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>Te.error(r)),k.console&&k.console.groupEnd&&k.console.groupEnd()),t.flush()},_h=function(s,e){const t={uri:s},i=Yn(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Md(t,Le(this,function(n,a,l){if(n)return Te.error(n,a);e.loaded_=!0,typeof k.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],h=>{if(h.type!=="vttjserror")return yh(l,e);Te.error(`vttjs failed to load, stopping trying to process ${e.src}`)}):yh(l,e)}))};class Tr extends zo{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ie(e,{kind:l_[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=fh[t.mode]||"disabled";const r=t.default;t.kind!=="metadata"&&t.kind!=="chapters"||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new _n(this.cues_),a=new _n(this.activeCues_);let l=!1;this.timeupdateHandler=Le(this,function(p={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))});const h=()=>{this.stopTracking()};this.tech_.one("dispose",h),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>i,set(p){fh[p]&&i!==p&&(i=p,this.preload_||i==="disabled"||this.cues.length!==0||_h(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const p=this.tech_.currentTime(),g=[];for(let y=0,w=this.cues.length;y=p&&g.push(E)}if(l=!1,g.length!==this.activeCues_.length)l=!0;else for(let y=0;yi,set(r){typeof r=="boolean"&&r!==i&&(i=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Nc extends zo{constructor(e={}){const t=Ie(e,{kind:a_[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(r){typeof r=="boolean"&&r!==i&&(i=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class ds extends Et{constructor(e={}){let t;super();const i=new Tr(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=ds.NONE,i.addEventListener("loadeddata",()=>{t=ds.LOADED,this.trigger({type:"load",target:this})})}}ds.prototype.allowedEvents_={load:"load"},ds.NONE=0,ds.LOADING=1,ds.LOADED=2,ds.ERROR=3;const xt={audio:{ListClass:i_,TrackClass:Oc,capitalName:"Audio"},video:{ListClass:r_,TrackClass:Nc,capitalName:"Video"},text:{ListClass:Pc,TrackClass:Tr,capitalName:"Text"}};Object.keys(xt).forEach(function(s){xt[s].getterName=`${s}Tracks`,xt[s].privateName=`${s}Tracks_`});const yi={remoteText:{ListClass:Pc,TrackClass:Tr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:n_,TrackClass:ds,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ct=Object.assign({},xt,yi);function h_(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new ct.text.TrackClass(r);return n.addTrack(a),a}yi.names=Object.keys(yi),xt.names=Object.keys(xt),ct.names=[].concat(yi.names).concat(xt.names);class fe extends V{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ct.names.forEach(i=>{const r=ct[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:e.nativeCaptions!==!0&&e.nativeTextTracks!==!0||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ct.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Le(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ft(0,0)}bufferedPercent(){return Ic(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(xt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(t=>{const i=this[`${t}Tracks`]()||[];let r=i.length;for(;r--;){const n=i[r];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Ue(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ft(0,0):Ft()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){xt.names.forEach(e=>{const t=xt[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!k.WebVTT)if(re.body.contains(this.el())){if(!this.options_["vtt.js"]&&xi(Ru)&&Object.keys(Ru).length>0)return void this.trigger("vttjsloaded");const e=re.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),k.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=l=>e.addTrack(l.track),r=l=>e.removeTrack(l.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;lthis.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=kt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return fe.canPlayType(e.type)}static isTech(e){return e.prototype instanceof fe||e instanceof fe||e===fe}static registerTech(e,t){if(fe.techs_||(fe.techs_={}),!fe.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!fe.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!fe.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=He(e),fe.techs_[e]=t,fe.techs_[hr(e)]=t,e!=="Tech"&&fe.defaultTechOrder_.push(e),t}static getTech(e){if(e)return fe.techs_&&fe.techs_[e]?fe.techs_[e]:(e=He(e),k&&k.videojs&&k.videojs[e]?(Te.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),k.videojs[e]):void 0)}}ct.names.forEach(function(s){const e=ct[s];fe.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),fe.prototype.featuresVolumeControl=!0,fe.prototype.featuresMuteControl=!0,fe.prototype.featuresFullscreenResize=!1,fe.prototype.featuresPlaybackRate=!1,fe.prototype.featuresProgressEvents=!1,fe.prototype.featuresSourceset=!1,fe.prototype.featuresTimeupdateEvents=!1,fe.prototype.featuresNativeTextTracks=!1,fe.prototype.featuresVideoFrameCallback=!1,fe.withSourceHandlers=function(s){s.registerSourceHandler=function(e,t){let i=s.sourceHandlers;i||(i=s.sourceHandlers=[]),t===void 0&&(t=i.length),i.splice(t,0,e)},s.canPlayType=function(e){const t=s.sourceHandlers||[];let i;for(let r=0;rUs(e,zs[e.type],t,s),1)}function p_(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function m_(s,e,t){return s.reduceRight(Xo(t),e[t]())}function g_(s,e,t,i){return e[t](s.reduce(Xo(t),i))}function vh(s,e,t,i=null){const r="call"+He(t),n=s.reduce(Xo(r),i),a=n===bn,l=a?null:e[t](n);return __(s,t,l,a),l}const f_={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},y_={setCurrentTime:1,setMuted:1,setVolume:1},bh={play:1,pause:1};function Xo(s){return(e,t)=>e===bn?bn:t[s]?t[s](e):e}function __(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function v_(s){vn.hasOwnProperty(s.id())&&delete vn[s.id()]}function b_(s,e){const t=vn[s.id()];let i=null;if(t==null)return i=e(s),vn[s.id()]=[[e,i]],i;for(let r=0;r{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let r=0;r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`;const Sh=mn?10009:gn?461:8,oi={codes:{play:415,pause:19,ff:417,rw:412,back:Sh},names:{415:"play",19:"pause",417:"ff",412:"rw",[Sh]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!(!this.names[s.keyCode]||this.names[s.keyCode]!==e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},Eh=5;class C_ extends Et{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(oi.isEventKey(t,"play")||oi.isEventKey(t,"pause")||oi.isEventKey(t,"ff")||oi.isEventKey(t,"rw")){t.preventDefault();const i=oi.getEventName(t);this.performMediaAction_(i)}else oi.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+Eh);break;case"rw":this.userSeek_(this.player_.currentTime()-Eh)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||i)&&t||(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_")){if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el()))return void t.push(r);r.hasOwnProperty("children_")&&r.children_.length>0?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(r.items):this.findSuitableDOMChild(r)&&t.push(r)}if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((a,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>a,getPositions:()=>{const h=a.getBoundingClientRect();return{boundingClientRect:{x:h.x,y:h.y,width:h.width,height:h.height,top:h.top,right:h.right,bottom:h.bottom,left:h.left},center:{x:h.left+h.width/2,y:h.top+h.height/2,width:0,height:0,top:h.top+h.height/2,right:h.left+h.width/2,bottom:h.top+h.height/2,left:h.left+h.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:h=>!0,focus:()=>a.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const l=a.getPositions().center,h=this.calculateDistance_(e,l,i);h=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Te.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const r=ge(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ge("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,Is(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),this.tabIndex_!==void 0&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),this.tabIndex_!==void 0&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}V.registerComponent("ClickableComponent",Kn);class Ba extends Kn{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ge("div",{className:"vjs-poster"})}crossOrigin(e){if(e===void 0)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;e===null||e==="anonymous"||e==="use-credentials"?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(ge("picture",{className:"vjs-poster",tabIndex:-1},{},ge("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Wt(this.player_.play()):this.player_.pause())}}Ba.prototype.crossorigin=Ba.prototype.crossOrigin,V.registerComponent("PosterImage",Ba);const At="#222",Ch="#ccc",A_={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Fa(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else{if(s.length!==7)throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");t=s.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function ls(s,e,t){try{s.style[e]=t}catch{return}}function wh(s){return s?`${s}px`:""}class x_ extends V{constructor(e,t,i){super(e,t,i);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Le(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",n),e.on("playerresize",n);const a=k.screen.orientation||k,l=k.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));const h=this.options_.playerOptions.tracks||[];for(let p=0;p0&&l.forEach(g=>{if(g.style.inset){const y=g.style.inset.split(" ");y.length===3&&Object.assign(g.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!k.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),ls(this.el_,"insetInline",wh(n)),ls(this.el_,"insetBlock",wh(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&ls(a.firstChild,"color",Fa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&ls(a.firstChild,"backgroundColor",Fa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?ls(a,"backgroundColor",Fa(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${At}, 2px 2px 4px ${At}, 2px 2px 5px ${At}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${At}, 2px 2px ${At}, 3px 3px ${At}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Ch}, 0 1px ${Ch}, -1px -1px ${At}, 0 -1px ${At}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}`)),t.fontPercent&&t.fontPercent!==1){const l=k.parseFloat(a.style.fontSize);a.style.fontSize=l*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=A_[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof k.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;ithis.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return Wt(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();const n=()=>r.focus();dr(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Ah.prototype.controlText_="Play Video",V.registerComponent("BigPlayButton",Ah);class D_ extends ot{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}V.registerComponent("CloseButton",D_);class xh extends ot{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Wt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}xh.prototype.controlText_="Play",V.registerComponent("PlayToggle",xh);class _i extends V{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ge("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ge("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||e.type!=="seeking")&&this.updateContent(e)}updateTextNode_(e=0){e=Xs(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Te.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=re.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}_i.prototype.labelText_="Time",_i.prototype.controlText_="Time",V.registerComponent("TimeDisplay",_i);class Ua extends _i{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Ua.prototype.labelText_="Current Time",Ua.prototype.controlText_="Current Time",V.registerComponent("CurrentTimeDisplay",Ua);class qa extends _i{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}qa.prototype.labelText_="Duration",qa.prototype.controlText_="Duration",V.registerComponent("DurationDisplay",qa);class I_ extends V{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}V.registerComponent("TimeDivider",I_);class ja extends _i{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(ge("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}ja.prototype.labelText_="Remaining Time",ja.prototype.controlText_="Remaining Time",V.registerComponent("RemainingTimeDisplay",ja);class P_ extends V{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ge("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ge("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(re.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}V.registerComponent("LiveDisplay",P_);class kh extends ot{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ge("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Sr(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}kh.prototype.controlText_="Seek to live, currently playing live",V.registerComponent("SeekToLive",kh);var L_=Object.freeze({__proto__:null,clamp:Sr});class Yo extends V{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type!=="touchstart"||Qt||e.preventDefault(),cc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;pc(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(Sr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Vn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}V.registerComponent("Slider",Yo);const Ha=(s,e)=>Sr(s/e*100,0,100).toFixed(2)+"%";class O_ extends V{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ge("span",{className:"vjs-control-text"}),i=ge("span",{textContent:this.localize("Loaded")}),r=re.createTextNode(": ");return this.percentageEl_=ge("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=Ha(n,r);this.percent_!==l&&(this.el_.style.width=l,Is(this.percentageEl_,l),this.percent_=l);for(let h=0;hi.length;h--)this.el_.removeChild(a[h-1]);a.length=i.length})}}V.registerComponent("LoadProgressBar",O_);class N_ extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=yr(this.el_),n=Di(this.player_.el()),a=e.width*t;if(!n||!r)return;let l=e.left-n.left+a,h=e.width-a+(n.right-e.right);h||(h=e.width-a,l=a);let p=r.width/2;lr.width&&(p=r.width),p=Math.round(p),this.el_.style.right=`-${p}px`,this.write(i)}write(e){Is(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const l=this.player_.liveTracker.liveWindow(),h=l-t*l;n=(h<1?"":"-")+Xs(h,l)}else n=Xs(i,a);this.update(e,t,n),r&&r()})}}V.registerComponent("TimeTooltip",N_);class $a extends V{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,r)}}$a.prototype.options_={children:[]},mt||Kt||$a.prototype.options_.children.push("timeTooltip"),V.registerComponent("PlayProgressBar",$a);class Dh extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}Dh.prototype.options_={children:["timeTooltip"]},V.registerComponent("MouseTimeDisplay",Dh);const Xr=5,Ih=12;class Va extends Yo{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Le(this,this.update),this.update=es(this.update_,Dt),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.on(re,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){re.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Dt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(re.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===i&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Xs(i,n),Xs(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(Di(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){_r(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!_r(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const r=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(r>=.99)return void n.seekToLiveEdge();const a=n.seekableStart(),l=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=l&&(i=l),i<=a&&(i=a+.1),i===1/0)return}else i=r*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Wt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Xr)}stepBack(){this.userSeek_(this.player_.currentTime()-Xr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Xr*Ih)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Xr*Ih)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.off(re,"visibilitychange",this.toggleVisibility_),super.dispose()}}Va.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},mt||Kt||Va.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),V.registerComponent("SeekBar",Va);class Ph extends V{constructor(e,t){super(e,t),this.handleMouseMove=es(Le(this,this.handleMouseMove),Dt),this.throttledHandleMouseSeek=es(Le(this,this.handleMouseSeek),Dt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;const n=t.el(),a=yr(n);let l=Vn(n,e).x;l=Sr(l,0,1),r&&r.update(a,l),i&&i.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Wt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Ph.prototype.options_={children:["seekBar"]},V.registerComponent("ProgressControl",Ph);class Lh extends ot{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){re.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in k?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof re.exitPictureInPicture=="function"&&super.show()}}Lh.prototype.controlText_="Picture-in-Picture",V.registerComponent("PictureInPictureToggle",Lh);class Oh extends ot{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),re[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Oh.prototype.controlText_="Fullscreen",V.registerComponent("FullscreenToggle",Oh);const R_=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class M_ extends V{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}V.registerComponent("VolumeLevel",M_);class B_ extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=Di(this.el_),a=Di(this.player_.el()),l=e.width*t;if(!a||!n)return;const h=e.left-a.left+l,p=e.width-l+(a.right-e.right);let g=n.width/2;hn.width&&(g=n.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){Is(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}}V.registerComponent("VolumeLevelTooltip",B_);class Nh extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}Nh.prototype.options_={children:["volumeLevelTooltip"]},V.registerComponent("MouseVolumeLevelDisplay",Nh);class Yr extends Yo{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){_r(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=Di(i),n=this.vertical();let a=Vn(i,e);a=n?a.y:a.x,a=Sr(a,0,1),t.update(r,a,n)}_r(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Yr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},mt||Kt||Yr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Yr.prototype.playerEvent="volumechange",V.registerComponent("VolumeBar",Yr);class Rh extends V{constructor(e,t={}){t.vertical=t.vertical||!1,(t.volumeBar===void 0||xi(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),R_(this,e),this.throttledHandleMouseMove=es(Le(this,this.handleMouseMove),Dt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Rh.prototype.options_={children:["volumeBar"]},V.registerComponent("VolumeControl",Rh);const F_=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class Mh extends ot{constructor(e,t){super(e,t),F_(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),mt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Hn(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Vs(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}Mh.prototype.controlText_="Mute",V.registerComponent("MuteToggle",Mh);class Bh extends V{constructor(e,t={}){t.inline!==void 0?t.inline=t.inline:t.inline=!0,(t.volumeControl===void 0||xi(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Ct(re,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),at(re,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Bh.prototype.options_={children:["muteToggle","volumeControl"]},V.registerComponent("VolumePanel",Bh);class Fh extends ot{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Fh.prototype.controlText_="Skip Forward",V.registerComponent("SkipForward",Fh);class Uh extends ot{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();let n;n=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Uh.prototype.controlText_="Skip Backward",V.registerComponent("SkipBackward",Uh);class Mc extends V{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof V&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof V&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ge(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Ct(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||re.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(r=>r.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):e.key!=="ArrowRight"&&e.key!=="ArrowUp"||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}V.registerComponent("Menu",Mc);class Ko extends V{constructor(e,t={}){super(e,t),this.menuButton_=new ot(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=ot.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Ct(re,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Mc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ge("li",{className:"vjs-menu-title",textContent:He(this.options_.title),tabIndex:-1}),i=new V(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t{this.handleTracksChange.apply(this,l)},a=(...l)=>{this.handleSelectedLanguageChange.apply(this,l)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let l;this.on(["tap","click"],function(){if(typeof k.Event!="object")try{l=new k.Event("change")}catch{}l||(l=re.createEvent("Event"),l.initEvent("change",!0,!0)),r.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let r=0;r-1&&a.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}V.registerComponent("OffTextTrackMenuItem",Bc);class Mi extends Qo{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Cr){let i;this.label_&&(i=`${this.label_} off`),e.push(new Bc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const l=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass(`vjs-${a.kind}-menu-item`),e.push(l)}}return e}}V.registerComponent("TextTrackButton",Mi);class Fc extends Er{constructor(e,t){const i=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(He(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(He(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Jo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Uc),e}}Ya.prototype.kinds_=["captions","subtitles"],Ya.prototype.controlText_="Subtitles",V.registerComponent("SubsCapsButton",Ya);class qc extends Er{constructor(e,t){const i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ge("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;ithis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}_o.prototype.contentElType="button",V.registerComponent("PlaybackRateMenuItem",_o);class jh extends Ko{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ge("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new _o(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}jh.prototype.controlText_="Playback Rate",V.registerComponent("PlaybackRateMenuButton",jh);class jc extends V{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}V.registerComponent("Spacer",jc);class U_ extends jc{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}V.registerComponent("CustomControlSpacer",U_);class Hh extends V{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Hh.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},V.registerComponent("ControlBar",Hh);class $h extends Pi{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}$h.prototype.options_=Object.assign({},Pi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),V.registerComponent("ErrorDisplay",$h);class Hc extends V{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ge("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${kt()}`)+"-"+e[1].replace(/\W+/g,""),i=ge("option",{id:t,value:this.localize(e[0]),textContent:e[1]});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}V.registerComponent("TextTrackSelect",Hc);class Ws extends V{constructor(e,t={}){super(e,t);const i=ge("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],l=a.className,h=a.id.replace("%s",this.options_.id_);let p=null;const g=`vjs_select_${kt()}`;if(this.options_.type==="colors"){p=ge("span",{className:l});const w=ge("label",{id:h,className:"vjs-label",textContent:a.label});w.setAttribute("for",g),p.appendChild(w)}const y=new Hc(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:h});this.addChild(y),this.options_.type==="colors"&&(p.appendChild(y.el()),this.el().appendChild(p))}}createEl(){return ge("fieldset",{className:this.options_.className})}}V.registerComponent("TextTrackFieldset",Ws);class $c extends V{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ws(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Ws(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Ws(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-colors"})}}V.registerComponent("TextTrackSettingsColors",$c);class Vc extends V{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ws(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Ws(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Ws(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-font"})}}V.registerComponent("TextTrackSettingsFont",Vc);class zc extends V{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),r=new ot(e,{controlText:i,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new ot(e,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return ge("div",{className:"vjs-track-settings-controls"})}}V.registerComponent("TrackSettingsControls",zc);const Ka="vjs-text-track-settings",Vh=["#000","Black"],zh=["#00F","Blue"],Wh=["#0FF","Cyan"],Gh=["#0F0","Green"],Xh=["#F0F","Magenta"],Yh=["#F00","Red"],Kh=["#FFF","White"],Qh=["#FF0","Yellow"],Qa=["1","Opaque"],Ja=["0.5","Semi-Transparent"],Jh=["0","Transparent"],As={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Vh,Kh,Yh,Gh,zh,Qh,Xh,Wh],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Qa,Ja,Jh],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Kh,Vh,Yh,Gh,zh,Qh,Xh,Wh],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Qa,Ja],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Jh,Ja,Qa],className:"vjs-window-opacity vjs-opacity"}};function Wc(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function q_(s,e){return Wc(s.options[s.options.selectedIndex].value,e)}function j_(s,e,t){if(e){for(let i=0;i{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),fi(As,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return ec(As,(e,t,i)=>{const r=q_(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){fi(As,(t,i)=>{j_(this.$(t.selector),e[i],t.parser)})}setDefaults(){fi(As,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(k.localStorage.getItem(Ka))}catch(t){Te.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?k.localStorage.setItem(Ka,JSON.stringify(e)):k.localStorage.removeItem(Ka)}catch(t){Te.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}V.registerComponent("TextTrackSettings",H_);class $_ extends V{constructor(e,t){let i=t.ResizeObserver||k.ResizeObserver;t.ResizeObserver===null&&(i=!1),super(e,Ie({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||k.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Sc(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const r=this.debouncedHandler_;let n=this.unloadListener_=function(){at(this,"resize",r),at(this,"unload",n),n=null};Ct(this.el_.contentWindow,"unload",n),Ct(this.el_.contentWindow,"resize",r)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}V.registerComponent("ResizeManager",$_);const V_={trackingThreshold:20,liveTolerance:15};class z_ extends V{constructor(e,t){super(e,Ie(V_,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=i=>this.handlePlay(i),this.handleFirstTimeupdate_=i=>this.handleFirstTimeupdate(i),this.handleSeeked_=i=>this.handleSeeked(i),this.seekToLiveEdge_=i=>this.seekToLiveEdge(i),this.reset_(),this.on(this.player_,"durationchange",i=>this.handleDurationchange(i)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(k.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Dt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}V.registerComponent("LiveTracker",z_);class W_ extends V{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ge("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${kt()}`}),description:ge("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${kt()}`})},ge("div",{className:"vjs-title-bar"},{},tc(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],l=i[r];zn(a),n&&Is(a,n),t&&(t.removeAttribute(l),n&&t.setAttribute(l,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}V.registerComponent("TitleBar",W_);const G_={initialDisplay:4e3,position:[],takeFocus:!1};class X_ extends ot{constructor(e,t){super(e,t=Ie(G_,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ge("button",{},{type:"button",class:this.buildCSSClass()},ge("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}V.registerComponent("TransientButton",X_);const vo=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let i=0;iGc([s.el(),k.HTMLMediaElement.prototype,k.Element.prototype,Y_],"innerHTML"),Zh=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=K_(s),r=n=>(...a)=>{const l=n.apply(e,a);return vo(s),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Ie(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},Q_=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Lc(k.Element.prototype.getAttribute.call(this,"src")):""},set(s){return k.Element.prototype.setAttribute.call(this,"src",s),s}}),J_=s=>Gc([s.el(),k.HTMLMediaElement.prototype,Q_],"src"),Z_=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=J_(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Ie(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const l=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),l},e.load=()=>{const n=r.call(e);return vo(s)||(s.triggerSourceset(""),Zh(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):vo(s)||Zh(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class he extends fe{constructor(e,t){super(e,t);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const l=[];for(;a--;){const h=n[a];h.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(h),this.remoteTextTracks().addTrack(h.track),this.textTracks().addTrack(h.track),r||this.el_.hasAttribute("crossorigin")||!Yn(h.src)||(r=!0)):l.push(h))}for(let h=0;h{t=[];for(let n=0;ne.removeEventListener("change",i));const r=()=>{for(let n=0;n{e.removeEventListener("change",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=xt[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:l=>{const h={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(h),e==="text"&&this[yi.remoteText.getterName]().trigger(h)},addtrack(l){r.addTrack(l.track)},removetrack(l){r.removeTrack(l.track)}},a=function(){const l=[];for(let h=0;h{const h=n[l];i.addEventListener(l,h),this.on("dispose",p=>i.removeEventListener(l,h))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){xt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),he.disposeMediaElement(e),e=i}else{e=re.createElement("video");const i=Ie({},this.options_.tag&&ws(this.options_.tag));fr&&this.options_.nativeControlsForTouch===!0||delete i.controls,hc(e,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}this.options_.preload!==void 0&&ki(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&jn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Te(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Kt&&Qt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Wt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){he.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=re.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),k.performance&&(e.creationTime=k.performance.now()),e}}un(he,"TEST_VID",function(){if(!Oi())return;const s=re.createElement("video"),e=re.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}),he.isSupported=function(){try{he.TEST_VID.volume=.5}catch{return!1}return!(!he.TEST_VID||!he.TEST_VID.canPlayType)},he.canPlayType=function(s){return he.TEST_VID.canPlayType(s)},he.canPlaySource=function(s,e){return he.canPlayType(s.type)},he.canControlVolume=function(){try{const s=he.TEST_VID.volume;he.TEST_VID.volume=s/2+.1;const e=s!==he.TEST_VID.volume;return e&&mt?(k.setTimeout(()=>{he&&he.prototype&&(he.prototype.featuresVolumeControl=s!==he.TEST_VID.volume)}),!1):e}catch{return!1}},he.canMuteVolume=function(){try{const s=he.TEST_VID.muted;return he.TEST_VID.muted=!s,he.TEST_VID.muted?ki(he.TEST_VID,"muted","muted"):$n(he.TEST_VID,"muted","muted"),s!==he.TEST_VID.muted}catch{return!1}},he.canControlPlaybackRate=function(){if(Kt&&Qt&&hn<58)return!1;try{const s=he.TEST_VID.playbackRate;return he.TEST_VID.playbackRate=s/2+.1,s!==he.TEST_VID.playbackRate}catch{return!1}},he.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(re.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(re.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(re.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(re.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0},he.supportsNativeTextTracks=function(){return jn||mt&&Qt},he.supportsNativeVideoTracks=function(){return!(!he.TEST_VID||!he.TEST_VID.videoTracks)},he.supportsNativeAudioTracks=function(){return!(!he.TEST_VID||!he.TEST_VID.audioTracks)},he.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([s,e]){un(he.prototype,s,()=>he[e](),!0)}),he.prototype.featuresVolumeControl=he.canControlVolume(),he.prototype.movingMediaElementInDOM=!mt,he.prototype.featuresFullscreenResize=!0,he.prototype.featuresProgressEvents=!0,he.prototype.featuresTimeupdateEvents=!0,he.prototype.featuresVideoFrameCallback=!(!he.TEST_VID||!he.TEST_VID.requestVideoFrameCallback),he.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}},he.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){he.prototype["set"+He(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){he.prototype["set"+He(s)]=function(e){this.el_[s]=e}}),["pause","load","play"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]()}}),fe.withSourceHandlers(he),he.nativeSourceHandler={},he.nativeSourceHandler.canPlayType=function(s){try{return he.TEST_VID.canPlayType(s)}catch{return""}},he.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return he.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Go(s.src);return he.nativeSourceHandler.canPlayType(`video/${t}`)}return""},he.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)},he.nativeSourceHandler.dispose=function(){},he.registerSourceHandler(he.nativeSourceHandler),fe.registerTech("Html5",he);const Xc=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Za={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},bo=["tiny","xsmall","small","medium","large","xlarge","huge"],tn={};bo.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;tn[s]=`vjs-layout-${e}`});const e0={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Ne extends V{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${kt()}`,(t=Object.assign(Ne.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Jd(this.id_),this.fsApi_=ln,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ws(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(l){a[l.toLowerCase()]=t.languages[l]}),this.languages_=a}else this.languages_=Ne.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),$o(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Ct(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Ie(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const a=new k.DOMParser().parseFromString(E_,"image/svg+xml");if(a.querySelector("parsererror"))Te.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const l=a.documentElement;l.style.display="none",this.el_.appendChild(l),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new C_(this),this.addClass("vjs-spatial-navigation-enabled")),fr&&this.addClass("vjs-touch-enabled"),mt||this.addClass("vjs-workinghover"),Ne.players[this.id_]=this;const n=uo.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),at(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),at(re,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ne.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),v_(this),ct.names.forEach(e=>{const t=this[ct[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));const n=ws(t);if(r){for(e=this.el_=t,t=this.tag=re.createElement("video");e.children.length;)t.appendChild(e.firstChild);ur(e,"video-js")||Vs(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(h=>{try{t[h]=e[h]}catch{}})}t.setAttribute("tabindex","-1"),n.tabindex="-1",Qt&&cn&&(t.setAttribute("role","application"),n.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(h){r&&h==="class"||e.setAttribute(h,n[h]),r&&t.setAttribute(h,n[h])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(h=>ac[h]).map(h=>"vjs-device-"+h.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),k.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=bc("vjs-styles-dimensions");const h=ks(".vjs-styles-defaults"),p=ks("head");p.insertBefore(this.styleEl_,h?h.nextSibling:p.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const l=t.getElementsByTagName("a");for(let h=0;h{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(k.VIDEOJS_NO_DYNAMIC_STYLE===!0){const l=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,p=this.tech_&&this.tech_.el();return void(p&&(l>=0&&(p.width=l),h>=0&&(p.height=h)))}let e,t,i,r;i=this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const n=i.split(":"),a=n[1]/n[0];e=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/a:this.videoWidth()||300,t=this.height_!==void 0?this.height_:e*a,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),Tc(this.styleEl_,` - .${r} { - width: ${e}px; - height: ${t}px; - } - - .${r}.vjs-fluid:not(.vjs-audio-only-mode) { - padding-top: ${100*a}%; - } - `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=He(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(fe.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ct.names.forEach(h=>{const p=ct[h];a[p.getterName]=this[p.privateName]}),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const l=fe.getTech(e);if(!l)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(Le(this,this.handleTechReady_),!0),gh.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Xc.forEach(h=>{this.on(this.tech_,h,p=>this[`handleTech${He(h)}_`](p))}),Object.keys(Za).forEach(h=>{this.on(this.tech_,h,p=>{this.tech_.playbackRate()===0&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Za[h]}_`].bind(this),event:p}):this[`handleTech${Za[h]}_`](p)})}),this.on(this.tech_,"loadstart",h=>this.handleTechLoadStart_(h)),this.on(this.tech_,"sourceset",h=>this.handleTechSourceset_(h)),this.on(this.tech_,"waiting",h=>this.handleTechWaiting_(h)),this.on(this.tech_,"ended",h=>this.handleTechEnded_(h)),this.on(this.tech_,"seeking",h=>this.handleTechSeeking_(h)),this.on(this.tech_,"play",h=>this.handleTechPlay_(h)),this.on(this.tech_,"pause",h=>this.handleTechPause_(h)),this.on(this.tech_,"durationchange",h=>this.handleTechDurationChange_(h)),this.on(this.tech_,"fullscreenchange",(h,p)=>this.handleTechFullscreenChange_(h,p)),this.on(this.tech_,"fullscreenerror",(h,p)=>this.handleTechFullscreenError_(h,p)),this.on(this.tech_,"enterpictureinpicture",h=>this.handleTechEnterPictureInPicture_(h)),this.on(this.tech_,"leavepictureinpicture",h=>this.handleTechLeavePictureInPicture_(h)),this.on(this.tech_,"error",h=>this.handleTechError_(h)),this.on(this.tech_,"posterchange",h=>this.handleTechPosterChange_(h)),this.on(this.tech_,"textdata",h=>this.handleTechTextData_(h)),this.on(this.tech_,"ratechange",h=>this.handleTechRateChange_(h)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||i==="Html5"&&this.tag||po(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ct.names.forEach(e=>{const t=ct[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=gh.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Te.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. -See https://github.com/videojs/video.js/issues/2617 for more info. -`),this.tech_}version(){return{"video.js":uo}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(dr(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})};let i;return e!=="any"||this.muted()?i=e!=="muted"||this.muted()?this.play():t():(i=this.play(),dr(i)&&(i=i.catch(t))),dr(i)?i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=S_(this,t)),this.cache_.source=Ie({},e,{src:t,type:i});const r=this.cache_.sources.filter(h=>h.src&&h.src===t),n=[],a=this.$$("source"),l=[];for(let h=0;hthis.updateSourceCaches_(n);const i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.click!==void 0&&this.options_.userActions.click===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Wt(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.doubleClick!==void 0&&this.options_.userActions.doubleClick===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let r=re[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in y_)return g_(this.middleware_,this.tech_,e,t);if(e in bh)return vh(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw Te(i),i}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in f_)return m_(this.middleware_,this.tech_,e);if(e in bh)return vh(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Te(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Te(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Te(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Wt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(jn||mt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=n=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Ft(0,0)}scrubbing(e){if(e===void 0)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return e===void 0?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Ft(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Ft(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Ic(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return e!==void 0?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(e===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e===void 0||e===0)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;return this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,r)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),i()}function l(p,g){n(),r(g)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);const h=t.requestFullscreenHelper_(e);h&&(h.then(n,n),h.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(h,p){r(),i(p)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const l=e.exitFullscreenHelper_();l&&(l.then(r,r),l.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=re[this.fsApi_.exitFullscreen]();return e&&Wt(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=re.documentElement.style.overflow,Ct(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow="hidden",Vs(re.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,at(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow=this.docOrigOverflow,Hn(re.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return e!==void 0?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&k.documentPictureInPicture){const e=re.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ge("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),k.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(_c(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in re&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return k.documentPictureInPicture&&k.documentPictureInPicture.window?(k.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in re?re.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(i=>{const r=i.tagName.toLowerCase();return i.isContentEditable?!0:r==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(i.type)===-1:["textarea"].indexOf(r)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=V.getComponent("FullscreenToggle");re[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),V.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),V.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i[l,fe.getTech(l)]).filter(([l,h])=>h?h.isSupported():(Te.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(l,h,p){let g;return l.some(y=>h.some(w=>{if(g=p(y,w),g)return!0})),g};let r;const n=l=>(h,p)=>l(p,h),a=([l,h],p)=>{if(h.canPlaySource(p,this.options_[l.toLowerCase()]))return{source:p,tech:l}};return r=this.options_.sourceOrder?i(e,t,n(a)):i(t,e,a),r||!1}handleSrc_(e,t){if(e===void 0)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Rc(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),c_(this,i[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());p_(n,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Ac(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Wt(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),ps(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return e!==void 0?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):this.options_.autoplay=!!e,t=t===void 0?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return e!==void 0?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(xs("beforeerror").forEach(t=>{const i=t(this,e);Zt(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(e===null)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Ue(e),this.addClass("vjs-error"),Te.error(`(CODE:${this.error_.code} ${Ue.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),xs("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const r=Le(this,this.reportUserActivity),n=function(y){y.screenX===t&&y.screenY===i||(t=y.screenX,i=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},l=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);const h=this.getChild("controlBar");let p;!h||mt||Kt||(h.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(p);const y=this.options_.inactivityTimeout;y<=0||(p=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(g,250)}playbackRate(e){if(e===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e===void 0)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ps(this)&&this.trigger("languagechange"))}languages(){return Ie(Ne.prototype.options_.languages,this.languages_)}toJSON(){const e=Ie(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;ithis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:g,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),i=>({kind:i.kind,label:i.label,language:i.language,src:i.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Tn(t.poster)}]),t}return Ie(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=ws(e),r=i["data-setup"];if(ur(e,"vjs-fill")&&(i.fill=!0),ur(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){Te.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,l=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}ct.names.forEach(function(s){const e=ct[s];Ne.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Ne.prototype.crossorigin=Ne.prototype.crossOrigin,Ne.players={};const sr=k.navigator;Ne.prototype.options_={techOrder:fe.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:sr&&(sr.languages&&sr.languages[0]||sr.userLanguage||sr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1},Xc.forEach(function(s){Ne.prototype[`handleTech${He(s)}_`]=function(){return this.trigger(s)}}),V.registerComponent("Player",Ne);const Sn="plugin",vi="activePlugins_",ci={},En=s=>ci.hasOwnProperty(s),sn=s=>En(s)?ci[s]:void 0,Yc=(s,e)=>{s[vi]=s[vi]||{},s[vi][e]=!0},Cn=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},t0=function(s,e){const t=function(){Cn(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return Yc(this,s),Cn(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},ed=(s,e)=>(e.prototype.name=s,function(...t){Cn(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,Cn(this,i.getEventHash()),i});class _t{constructor(e){if(this.constructor===_t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),$o(this),delete this.trigger,wc(this,this.constructor.defaultState),Yc(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Ri(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[vi][e]=!1,this.player=this.state=null,t[e]=ed(e,ci[e])}static isBasic(e){const t=typeof e=="string"?sn(e):e;return typeof t=="function"&&!_t.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(En(e))Te.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ne.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ci[e]=t,e!==Sn&&(_t.isBasic(t)?Ne.prototype[e]=t0(e,t):Ne.prototype[e]=ed(e,t)),t}static deregisterPlugin(e){if(e===Sn)throw new Error("Cannot de-register base plugin.");En(e)&&(delete ci[e],delete Ne.prototype[e])}static getPlugins(e=Object.keys(ci)){let t;return e.forEach(i=>{const r=sn(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=sn(e);return t&&t.VERSION||""}}function s0(s,e){let t=!1;return function(...i){return t||Te.warn(s),t=!0,e.apply(this,i)}}function Mt(s,e,t,i){return s0(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}_t.getPlugin=sn,_t.BASE_PLUGIN_NAME=Sn,_t.registerPlugin(Sn,_t),Ne.prototype.usingPlugin=function(s){return!!this[vi]&&this[vi][s]===!0},Ne.prototype.hasPlugin=function(s){return!!En(s)};var i0={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Kc=s=>s.indexOf("#")===0?s.slice(1):s;function F(s,e,t){let i=F.getPlayer(s);if(i)return e&&Te.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?ks("#"+Kc(s)):s;if(!Ni(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const n="getRootNode"in r&&r.getRootNode()instanceof k.ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&n.contains(r)||Te.warn("The element supplied is not included in the DOM"),(e=e||{}).restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),xs("beforesetup").forEach(l=>{const h=l(r,Ie(e));Zt(h)&&!Array.isArray(h)?e=Ie(e,h):Te.error("please return an object in beforesetup hooks")});const a=V.getComponent("Player");return i=new a(r,e,t),xs("setup").forEach(l=>l(i)),i}if(F.hooks_=hs,F.hooks=xs,F.hook=Fy,F.hookOnce=Uy,F.removeHook=Qd,k.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Oi()){let s=ks(".vjs-styles-defaults");if(!s){s=bc("vjs-styles-defaults");const e=ks("head");e&&e.insertBefore(s,e.firstChild),Tc(s,` - .video-js { - width: 300px; - height: 150px; - } - - .vjs-fluid:not(.vjs-audio-only-mode) { - padding-top: 56.25% - } - `)}}go(1,F),F.VERSION=uo,F.options=Ne.prototype.options_,F.getPlayers=()=>Ne.players,F.getPlayer=s=>{const e=Ne.players;let t;if(typeof s=="string"){const i=Kc(s),r=e[i];if(r)return r;t=ks("#"+i)}else t=s;if(Ni(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}},F.getAllPlayers=()=>Object.keys(Ne.players).map(s=>Ne.players[s]).filter(Boolean),F.players=Ne.players,F.getComponent=V.getComponent,F.registerComponent=(s,e)=>(fe.isTech(e)&&Te.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),V.registerComponent.call(V,s,e)),F.getTech=fe.getTech,F.registerTech=fe.registerTech,F.use=d_,Object.defineProperty(F,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(F.middleware,"TERMINATOR",{value:bn,writeable:!1,enumerable:!0}),F.browser=ac,F.obj=Hy,F.mergeOptions=Mt(9,"videojs.mergeOptions","videojs.obj.merge",Ie),F.defineLazyProperty=Mt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",un),F.bind=Mt(9,"videojs.bind","native Function.prototype.bind",Le),F.registerPlugin=_t.registerPlugin,F.deregisterPlugin=_t.deregisterPlugin,F.plugin=(s,e)=>(Te.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),_t.registerPlugin(s,e)),F.getPlugins=_t.getPlugins,F.getPlugin=_t.getPlugin,F.getPluginVersion=_t.getPluginVersion,F.addLanguage=function(s,e){return s=(""+s).toLowerCase(),F.options.languages=Ie(F.options.languages,{[s]:e}),F.options.languages[s]},F.log=Te,F.createLogger=Jd,F.time=s_,F.createTimeRange=Mt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ft),F.createTimeRanges=Mt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ft),F.formatTime=Mt(9,"videojs.formatTime","videojs.time.formatTime",Xs),F.setFormatTime=Mt(9,"videojs.setFormatTime","videojs.time.setFormatTime",kc),F.resetFormatTime=Mt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Dc),F.parseUrl=Mt(9,"videojs.parseUrl","videojs.url.parseUrl",Wo),F.isCrossOrigin=Mt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Yn),F.EventTarget=Et,F.any=Ho,F.on=Ct,F.one=Gn,F.off=at,F.trigger=Ri,F.xhr=Md,F.TextTrack=Tr,F.AudioTrack=Oc,F.VideoTrack=Nc,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{F[s]=function(){return Te.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),ch[s].apply(null,arguments)}}),F.computedStyle=Mt(9,"videojs.computedStyle","videojs.dom.computedStyle",Ii),F.dom=ch,F.fn=Ky,F.num=L_,F.str=e_,F.url=u_,F.Error=i0;class r0{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(i){t.enabled_(i)}}),t}}class wn extends F.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new r0(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;ii&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;ti,s.qualityLevels.VERSION=Qc,i},td=function(s){return n0(this,F.obj.merge({},s))};F.registerPlugin("qualityLevels",td),td.VERSION=Qc;const vt=Mn,An=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,It=s=>F.log.debug?F.log.debug.bind(F,"VHS:",`${s} >`):function(){};function we(...s){const e=F.obj||F;return(e.merge||e.mergeOptions).apply(e,s)}function gt(...s){const e=F.time||F;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function a0(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: -`;for(let t=0;t ${r}. Duration (${r-i}) -`}return e}const Gt=1/30,Xt=3*Gt,Jc=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i=e})},Kr=function(s,e){return Jc(s,function(t){return t-Gt>=e})},o0=function(s){if(s.length<2)return gt();const e=[];for(let t=1;t{const e=[];if(!s||!s.length)return"";for(let t=0;t "+s.end(t));return e.join(", ")},u0=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Hs=s=>{const e=[];for(let t=0;tn||(t+=e>r&&e<=n?n-e:n-r)}return t},el=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},To=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),ep=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},tp=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},sp=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=ep(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?3*e.partTargetDuration:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?3*e.targetDuration:0},d0=function(s,e){let t=0,i=e-s.mediaSequence,r=s.segments[i];if(r){if(r.start!==void 0)return{result:r.start,precise:!0};if(r.end!==void 0)return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=s.segments[i],r.end!==void 0)return{result:t+r.end,precise:!0};if(t+=el(s,r),r.start!==void 0)return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},c0=function(s,e){let t,i=0,r=e-s.mediaSequence;for(;ri&&([t,i]=[i,t]),t<0){for(let n=t;nDate.now()},tl=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Qn=function(s){const e=np(s);return!s.disabled&&!e},ap=function(s,e){return e.attributes&&e.attributes[s]},p0=function(s,e,t,i=0){return ap("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-8*i)/e:NaN},So=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>!!Qn(i)&&(i.attributes.BANDWIDTH||0)!(!s&&!e||!s&&e||s&&!e)&&(s===e||!(!s.id||!e.id||s.id!==e.id)||!(!s.resolvedUri||!e.resolvedUri||s.resolvedUri!==e.resolvedUri)||!(!s.uri||!e.uri||s.uri!==e.uri)),id=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const r in t){for(const n in t[r])if(i=e(t[r][n]),i)break;if(i)break}return!!i},wr=s=>{if(!s||!s.playlists||!s.playlists.length)return id(s,e=>e.playlists&&e.playlists.length||e.uri);for(let e=0;eUd(r)))&&!id(s,r=>sl(t,r)))return!1}return!0};var bt={liveEdgeDelay:sp,duration:rp,seekable:function(s,e,t){const i=e||0;let r=sd(s,e,!0,t);return r===null?gt():(r0)for(let p=h-1;p>=0;p--){const g=l[p];if(a+=g.duration,n){if(a<0)continue}else if(a+Gt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-cr({defaultDuration:s.targetDuration,durationList:l,startIndex:h,endIndex:p})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(h<0){for(let p=h;p<0;p++)if(a-=s.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};h=0}for(let p=h;pGt;if(a!==0&&!(y&&a+Gt>=0)||p===l.length-1){if(n){if(a>0)continue}else if(a-Gt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+cr({defaultDuration:s.targetDuration,durationList:l,startIndex:h,endIndex:p})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},isEnabled:Qn,isDisabled:function(s){return s.disabled},isExcluded:np,isIncompatible:tl,playlistEnd:sd,isAes:function(s){for(let e=0;e`${s}-${e}`,lp=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,m0=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new of;s&&a.on("warn",s),e&&a.on("info",e),i.forEach(p=>a.addParser(p)),r.forEach(p=>a.addTagMapper(p)),a.push(t),a.end();const l=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(p){l.hasOwnProperty(p)&&delete l[p]}),l.segments&&l.segments.forEach(function(p){["parts","preloadHints"].forEach(function(g){p.hasOwnProperty(g)&&delete p[g]})})),!l.targetDuration){let p=10;l.segments&&l.segments.length&&(p=l.segments.reduce((g,y)=>Math.max(g,y.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${p}`}),l.targetDuration=p}const h=ep(l);if(h.length&&!l.partTargetDuration){const p=h.reduce((g,y)=>Math.max(g,y.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${p}`}),op.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),l.partTargetDuration=p}return l},Bi=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const r in s.mediaGroups[t][i]){const n=s.mediaGroups[t][i][r];e(n,t,i,r)}})},up=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},g0=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];up({playlist:t,id:bi(e,t.uri)}),t.resolvedUri=vt(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||op.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},f0=s=>{Bi(s,e=>{e.uri&&(e.resolvedUri=vt(s.uri,e.uri))})},y0=(s,e)=>{const t=bi(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:k.location.href,resolvedUri:k.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},hp=(s,e,t=lp)=>{s.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let h=0;h(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime(){const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},l=r&&!n||i;if(t&&n)a.error=ze({},t),a.errorType=F.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=F.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=F.Error.NetworkRequestTimeout;else if(l){const h=i?F.Error.NetworkBodyParserFailed:F.Error.NetworkBadStatus;a.errorType=h,a.status=e.status,a.headers=e.headers}return a},{EventTarget:_0}=F,v0=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=tp(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new k.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&i.searchParams.set(r,t[r])}),s=i.toString()}return s},b0=(s,e)=>{if(!s)return e;const t=we(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let l=0;l{!s.resolvedUri&&s.uri&&(s.resolvedUri=vt(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=vt(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=vt(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=vt(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))})},pp=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;is===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,Eo=(s,e,t=mp)=>{const i=we(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=pp(e);const n=we(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{cp(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let g=0;g{const t=s.segments||[],i=t[t.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],n=r&&r.duration||i&&i.duration;return e&&n?1e3*n:500*(s.partTargetDuration||s.targetDuration||10)},nd=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:i}};class mi extends _0{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=It("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new rd,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=vt(this.main.uri,e.uri);this.llhls&&(t=v0(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request)return i?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:r,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Gs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return m0({onwarn:({message:i})=>this.logger_(`m3u8-parser warn for ${e}: ${i}`),oninfo:({message:i})=>this.logger_(`m3u8-parser info for ${e}: ${i}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(i){this.error=i,this.error.metadata={errorType:F.Error.StreamingHlsPlaylistParserError,error:i}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),up({playlist:a,uri:i,id:r});const l=Eo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,l?(this.main=l,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!l)),n.parsedPlaylist=nd(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new rd,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(k.clearTimeout(this.finalRenditionTimeout),t){const l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=k.setTimeout(this.media.bind(this,e,!1),l))}const i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Co(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(l,h)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=An(e.resolvedUri,h),l)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:h.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=k.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object")return this.src.uri||(this.src.uri=k.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Gs({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=An(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=nd(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,hp(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=pp(i),i.segments.forEach(r=>{cp(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||k.location.href;this.main=y0(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,r=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const l=a.resolvedUri,h=a.id;if(t){const p=this.createCloneURI_(a.resolvedUri,e),g=bi(r,p),y=this.createCloneAttributes_(r,a.attributes),w=this.createClonePlaylist_(a,g,e,y);i.playlists[n]=w,i.playlists[g]=w,i.playlists[p]=w}else i.playlists.splice(n,1);delete i.playlists[h],delete i.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(i.mediaGroups[n]&&i.mediaGroups[n][r]){for(const a in i.mediaGroups[n])if(a===r){for(const l in i.mediaGroups[n][a])i.mediaGroups[n][a][l].playlists.forEach((h,p)=>{const g=i.playlists[h.id],y=g.id,w=g.resolvedUri;delete i.playlists[y],delete i.playlists[w]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=bi(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),h=this.createClonePlaylist_(t,a,e,l);i.playlists[r]=h,i.playlists[a]=h,i.playlists[n]=h,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(r.mediaGroups[n]&&!r.mediaGroups[n][t]){for(const a in r.mediaGroups[n])if(a===i){r.mediaGroups[n][t]={};for(const l in r.mediaGroups[n][a]){const h=r.mediaGroups[n][a][l];r.mediaGroups[n][t][l]=ze({},h);const p=r.mediaGroups[n][t][l],g=this.createCloneURI_(h.resolvedUri,e);p.resolvedUri=g,p.uri=g,p.playlists=[],h.playlists.forEach((y,w)=>{const E=r.playlists[y.id],I=lp(n,t,l),v=bi(t,I);if(E&&!r.playlists[v]){const L=this.createClonePlaylist_(E,v,e),R=L.resolvedUri;r.playlists[v]=L,r.playlists[R]=L}p.playlists[w]=this.createClonePlaylist_(y,v,e)})}}}})}createClonePlaylist_(e,t,i,r){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),we(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const wo=function(s,e,t,i){const r=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&r&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=r.byteLength||r.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),e||s.aborted||t.statusCode===200||t.statusCode===206||t.statusCode===0||(e=new Error("XHR Failed with a response of: "+(s&&(r||s.responseText)))),i(e,s)},S0=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},E0=(s,e,t,i)=>{s&&s.size&&s.forEach(r=>{r(e,t,i)})},gp=function(){const s=function e(t,i){t=we({timeout:45e3},t);const r=e.beforeRequest||F.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||F.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||F.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(F.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const l=F.Vhs.xhr.original===!0?F.xhr:F.Vhs.xhr,h=S0(n,t);n.delete(r);const p=l(h||t,function(y,w){return E0(a,p,y,w),wo(p,y,w,i)}),g=p.abort;return p.abort=function(){return p.aborted=!0,g.apply(p,arguments)},p.uri=t.uri,p.requestType=t.requestType,p.requestTime=Date.now(),p};return s.original=!0,s},C0=function(s){let e;const t=s.offset;return e=typeof s.offset=="bigint"||typeof s.length=="bigint"?k.BigInt(s.offset)+k.BigInt(s.length)-k.BigInt(1):s.offset+s.length-1,"bytes="+t+"-"+e},Ao=function(s){const e={};return s.byterange&&(e.Range=C0(s.byterange)),e},w0=function(s,e){return s.start(e)+"-"+s.end(e)},A0=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},x0=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},fp=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];jd(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},xn=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},yp=function(s){return s.resolvedUri},_p=s=>{const e=Array.prototype.slice.call(s),t=16;let i,r,n="";for(let a=0;a_p(s),D0=s=>{let e,t="";for(e=0;e{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,i=s-(e.videoTimingInfo.transmuxedPresentationStart+t);return new Date(e.dateTimeObject.getTime()+1e3*i)},L0=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,O0=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(tnew Date(n.getTime()+1e3*a)?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:bt.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},N0=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t,i=0;for(let n=0;ni){if(s>i+r.duration*vp)return null;t=r}return{segment:t,estimatedStart:t.videoTimingInfo?t.videoTimingInfo.transmuxedPresentationStart:i-t.duration,type:t.videoTimingInfo?"accurate":"estimate"}},R0=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},M0=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=N0(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},n=P0(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},bp=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(s===void 0||!e||!i)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!M0(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const l=O0(s,e);if(!l)return a({message:`${s} was not found in the stream`});const h=l.segment,p=R0(h.dateTimeObject,s);if(l.type==="estimate")return t===0?a({message:`${s} is not buffered yet. Try again`}):(i(l.estimatedStart+p),void n.one("seeked",()=>{bp({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})}));const g=h.start+p,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),i(g)},ad=(s,e)=>{if(s.readyState===4)return e()},F0=(s,e,t,i)=>{let r,n=[],a=!1;const l=function(y,w,E,I){return w.abort(),a=!0,t(y,w,E,I)},h=function(y,w){if(a)return;if(y)return y.metadata=Gs({requestType:i,request:w,error:y}),l(y,w,"",n);const E=w.responseText.substring(n&&n.byteLength||0,w.responseText.length);if(n=vf(n,Hd(E,!0)),r=r||nr(n),n.length<10||r&&n.lengthl(y,w,"",n));const I=Fo(n);return I==="ts"&&n.length<188||!I&&n.length<376?ad(w,()=>l(y,w,"",n)):l(null,w,I,n)},p={uri:s,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:w,loaded:E}){return wo(y,null,{statusCode:y.status},h)})}},g=e(p,function(y,w){return wo(g,y,w,h)});return g},{EventTarget:U0}=F,od=function(s,e){if(!mp(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length)||!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t`placeholder-uri-${s}-${e}-${i.attributes.NAME||t}`,j0=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=yy(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return hp(n,e,q0),n},H0=(s,e)=>{Bi(s,(t,i,r,n)=>{e.mediaGroups[i][r]&&n in e.mediaGroups[i][r]||delete s.mediaGroups[i][r][n]})},$0=(s,e,t)=>{let i=!0,r=we(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const p=n.playlists[0].id,g=Eo(r,n.playlists[0],od);g&&(r=g,h in r.mediaGroups[a][l]||(r.mediaGroups[a][l][h]=n),r.mediaGroups[a][l][h].playlists[0]=r.playlists[p],i=!1)}}),H0(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},V0=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,ld=(s,e)=>{const t={};for(const i in s){const r=s[i].sidx;if(r){const n=Fn(r);if(!e[n])break;const a=e[n].sidxInfo;V0(a,r)&&(t[n]=e[n])}}return t},z0=(s,e)=>{let t=ld(s.playlists,e);return Bi(s,(i,r,n,a)=>{if(i.playlists&&i.playlists.length){const l=i.playlists;t=we(t,ld(l,e))}}),t};class xo extends U0{constructor(e,t,i={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=It("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error=typeof e!="object"||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const r=e.sidx&&Fn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=k.setTimeout(()=>i(!1),0));const n=An(e.sidx.resolvedUri),a=(h,p)=>{if(this.requestErrored_(h,p,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=p;let w;try{w=Ty(ce(p.response).subarray(8))}catch(E){return E.metadata=Gs({requestType:y,request:p,parseFailure:!0}),void this.requestErrored_(E,p,t)}return g[r]={sidxInfo:e.sidx,sidx:w},Ro(e,w,e.sidx.resolvedUri),i(!0)},l="dash-sidx";this.request=F0(n,this.vhs_.xhr,(h,p,g,y)=>{if(h)return a(h,p);if(!g||g!=="mp4"){const I=g||"unknown";return a({status:p.status,message:`Unsupported ${I} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},p)}const{offset:w,length:E}=e.sidx.byterange;if(y.length>=E+w)return a(h,{response:y.subarray(w,w+E),status:p.status,uri:p.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Ao({byterange:e.sidx.byterange})},a)},l)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},k.clearTimeout(this.minimumUpdatePeriodTimeout_),k.clearTimeout(this.mediaRequest_),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(k.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(()=>this.load(),i)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=k.setTimeout(()=>this.haveMain_(),0)}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){const{requestType:a}=r;i.metadata=Gs({requestType:a,request:r,error:i})}if(this.requestErrored_(i,r))return void(this.state==="HAVE_NOTHING"&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=An(this.mainPlaylistLoader_.srcUrl,r),n?(this.handleMain_(),void this.syncClientServerClock_(()=>e(r,n))):e(r,n)})}syncClientServerClock_(e){const t=_y(this.mainPlaylistLoader_.mainXml_);return t===null?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):t.method==="DIRECT"?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:vt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:a}=r;return this.error.metadata=Gs({requestType:a,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;n=t.method==="HEAD"?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:t});try{i=j0({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:F.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=$0(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,l=[];i.playlists.forEach(p=>{l.push({id:p.id,bandwidth:p.attributes.BANDWIDTH,resolution:p.attributes.RESOLUTION,codecs:p.attributes.CODECS})});const h={duration:n,isLive:!a,renditions:l};t.parsedManifest=h,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(k.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;t===0&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=k.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=z0(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=k.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Co(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Je={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const W0=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t-1)},this.trigger=function(u){var c,d,m,f;if(c=o[u])if(arguments.length===2)for(m=c.length,d=0;d>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},L=function(o){return t(U.hdlr,W[o])},v=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,255&o.duration,85,196,0,0]);return o.samplerate&&(u[12]=o.samplerate>>>24&255,u[13]=o.samplerate>>>16&255,u[14]=o.samplerate>>>8&255,u[15]=255&o.samplerate),t(U.mdhd,u)},I=function(o){return t(U.mdia,v(o),L(o.type),l(o))},a=function(o){return t(U.mfhd,new Uint8Array([0,0,0,0,(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o]))},l=function(o){return t(U.minf,o.type==="video"?t(U.vmhd,te):t(U.smhd,J),i(),M(o))},h=function(o,u){for(var c=[],d=u.length;d--;)c[d]=G(u[d]);return t.apply(null,[U.moof,a(o)].concat(c))},p=function(o){for(var u=o.length,c=[];u--;)c[u]=w(o[u]);return t.apply(null,[U.moov,y(4294967295)].concat(c).concat(g(o)))},g=function(o){for(var u=o.length,c=[];u--;)c[u]=N(o[u]);return t.apply(null,[U.mvex].concat(c))},y=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(U.mvhd,u)},R=function(o){var u,c,d=o.samples||[],m=new Uint8Array(4+d.length);for(c=0;c>>8),f.push(255&d[u].byteLength),f=f.concat(Array.prototype.slice.call(d[u]));for(u=0;u>>8),b.push(255&m[u].byteLength),b=b.concat(Array.prototype.slice.call(m[u]));if(c=[U.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&o.width)>>8,255&o.width,(65280&o.height)>>8,255&o.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(U.avcC,new Uint8Array([1,o.profileIdc,o.profileCompatibility,o.levelIdc,255].concat([d.length],f,[m.length],b))),t(U.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],o.sarRatio){var x=o.sarRatio[0],C=o.sarRatio[1];c.push(t(U.pasp,new Uint8Array([(4278190080&x)>>24,(16711680&x)>>16,(65280&x)>>8,255&x,(4278190080&C)>>24,(16711680&C)>>16,(65280&C)>>8,255&C])))}return t.apply(null,c)},ye=function(o){return t(U.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&o.channelcount)>>8,255&o.channelcount,(65280&o.samplesize)>>8,255&o.samplesize,0,0,0,0,(65280&o.samplerate)>>8,255&o.samplerate,0,0]),r(o))},E=function(o){var u=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,0,(4278190080&o.duration)>>24,(16711680&o.duration)>>16,(65280&o.duration)>>8,255&o.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&o.width)>>8,255&o.width,0,0,(65280&o.height)>>8,255&o.height,0,0]);return t(U.tkhd,u)},G=function(o){var u,c,d,m,f,b,x;return u=t(U.tfhd,new Uint8Array([0,0,0,58,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),b=Math.floor(o.baseMediaDecodeTime/We),x=Math.floor(o.baseMediaDecodeTime%We),c=t(U.tfdt,new Uint8Array([1,0,0,0,b>>>24&255,b>>>16&255,b>>>8&255,255&b,x>>>24&255,x>>>16&255,x>>>8&255,255&x])),f=92,o.type==="audio"?(d=z(o,f),t(U.traf,u,c,d)):(m=R(o),d=z(o,m.length+f),t(U.traf,u,c,d,m))},w=function(o){return o.duration=o.duration||4294967295,t(U.trak,E(o),I(o))},N=function(o){var u=new Uint8Array([0,0,0,0,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(u[u.length-1]=0),t(U.trex,u)},me=function(o,u){var c=0,d=0,m=0,f=0;return o.length&&(o[0].duration!==void 0&&(c=1),o[0].size!==void 0&&(d=2),o[0].flags!==void 0&&(m=4),o[0].compositionTimeOffset!==void 0&&(f=8)),[0,0,c|d|m|f,1,(4278190080&o.length)>>>24,(16711680&o.length)>>>16,(65280&o.length)>>>8,255&o.length,(4278190080&u)>>>24,(16711680&u)>>>16,(65280&u)>>>8,255&u]},ve=function(o,u){var c,d,m,f,b,x;for(u+=20+16*(f=o.samples||[]).length,m=me(f,u),(d=new Uint8Array(m.length+16*f.length)).set(m),c=m.length,x=0;x>>24,d[c++]=(16711680&b.duration)>>>16,d[c++]=(65280&b.duration)>>>8,d[c++]=255&b.duration,d[c++]=(4278190080&b.size)>>>24,d[c++]=(16711680&b.size)>>>16,d[c++]=(65280&b.size)>>>8,d[c++]=255&b.size,d[c++]=b.flags.isLeading<<2|b.flags.dependsOn,d[c++]=b.flags.isDependedOn<<6|b.flags.hasRedundancy<<4|b.flags.paddingValue<<1|b.flags.isNonSyncSample,d[c++]=61440&b.flags.degradationPriority,d[c++]=15&b.flags.degradationPriority,d[c++]=(4278190080&b.compositionTimeOffset)>>>24,d[c++]=(16711680&b.compositionTimeOffset)>>>16,d[c++]=(65280&b.compositionTimeOffset)>>>8,d[c++]=255&b.compositionTimeOffset;return t(U.trun,d)},_e=function(o,u){var c,d,m,f,b,x;for(u+=20+8*(f=o.samples||[]).length,m=me(f,u),(c=new Uint8Array(m.length+8*f.length)).set(m),d=m.length,x=0;x>>24,c[d++]=(16711680&b.duration)>>>16,c[d++]=(65280&b.duration)>>>8,c[d++]=255&b.duration,c[d++]=(4278190080&b.size)>>>24,c[d++]=(16711680&b.size)>>>16,c[d++]=(65280&b.size)>>>8,c[d++]=255&b.size;return t(U.trun,c)},z=function(o,u){return o.type==="audio"?_e(o,u):ve(o,u)};var Ge,Ye,rt,Ut,Ke,ts,Ps,Ys,ms={ftyp:n=function(){return t(U.ftyp,H,S,H,A)},mdat:function(o){return t(U.mdat,o)},moof:h,moov:p,initSegment:function(o){var u,c=n(),d=p(o);return(u=new Uint8Array(c.byteLength+d.byteLength)).set(c),u.set(d,c.byteLength),u}},ss=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Oe=function(o,u){var c=ss();return c.dataOffset=u,c.compositionTimeOffset=o.pts-o.dts,c.duration=o.duration,c.size=4*o.length,c.size+=o.byteLength,o.keyFrame&&(c.flags.dependsOn=2,c.flags.isNonSyncSample=0),c},je={groupNalsIntoFrames:function(o){var u,c,d=[],m=[];for(m.byteLength=0,m.nalCount=0,m.duration=0,d.byteLength=0,u=0;u1&&(u=o.shift(),o.byteLength-=u.byteLength,o.nalCount-=u.nalCount,o[0][0].dts=u.dts,o[0][0].pts=u.pts,o[0][0].duration+=u.duration),o},generateSampleTable:function(o,u){var c,d,m,f,b,x=u||0,C=[];for(c=0;cfs.ONE_SECOND_IN_TS/2))){for((f=Ar()[o.samplerate])||(f=u[0].data),b=0;b=c?o:(u.minSegmentDts=1/0,o.filter(function(d){return d.dts>=c&&(u.minSegmentDts=Math.min(u.minSegmentDts,d.dts),u.minSegmentPts=u.minSegmentDts,!0)}))},generateSampleTable:function(o){var u,c,d=[];for(u=0;u=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},q.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===""},q.prototype.addText=function(o){this.rows[this.rowIdx]+=o},q.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var ae=function(o,u,c){this.serviceNum=o,this.text="",this.currentWindow=new q(-1),this.windows=[],this.stream=c,typeof u=="string"&&this.createTextDecoder(u)};ae.prototype.init=function(o,u){this.startPts=o;for(var c=0;c<8;c++)this.windows[c]=new q(c),typeof u=="function"&&(this.windows[c].beforeRowOverflow=u)},ae.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},ae.prototype.createTextDecoder=function(o){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(o)}catch(u){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+u})}};var le=function(o){o=o||{},le.prototype.init.call(this);var u,c=this,d=o.captionServices||{},m={};Object.keys(d).forEach(f=>{u=d[f],/^SERVICE/.test(f)&&(m[f]=u.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(f){f.type===3?(c.new708Packet(),c.add708Bytes(f)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(f))}};le.prototype=new Qs,le.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},le.prototype.add708Bytes=function(o){var u=o.ccData,c=u>>>8,d=255&u;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(c),this.current708Packet.data.push(d)},le.prototype.push708Packet=function(){var o=this.current708Packet,u=o.data,c=null,d=null,m=0,f=u[m++];for(o.seq=f>>6,o.sizeCode=63&f;m>5)===7&&d>0&&(c=f=u[m++]),this.pushServiceBlock(c,m,d),d>0&&(m+=d-1)},le.prototype.pushServiceBlock=function(o,u,c){var d,m=u,f=this.current708Packet.data,b=this.services[o];for(b||(b=this.initService(o,m));m("0"+(255&be).toString(16)).slice(-2)).join("")}if(b?(m=[D,j],o++):m=[D],u.textDecoder_&&!f)d=u.textDecoder_.decode(new Uint8Array(m));else if(b){const de=ue(m);d=String.fromCharCode(parseInt(de,16))}else d=T(C|D);return X.pendingNewLine&&!X.isEmpty()&&X.newLine(this.getPts(o)),X.pendingNewLine=!1,X.addText(d),o},le.prototype.multiByteCharacter=function(o,u){var c=this.current708Packet.data,d=c[o+1],m=c[o+2];return P(d)&&P(m)&&(o=this.handleText(++o,u,{isMultiByte:!0})),o},le.prototype.setCurrentWindow=function(o,u){var c=7&this.current708Packet.data[o];return u.setCurrentWindow(c),o},le.prototype.defineWindow=function(o,u){var c=this.current708Packet.data,d=c[o],m=7&d;u.setCurrentWindow(m);var f=u.currentWindow;return d=c[++o],f.visible=(32&d)>>5,f.rowLock=(16&d)>>4,f.columnLock=(8&d)>>3,f.priority=7&d,d=c[++o],f.relativePositioning=(128&d)>>7,f.anchorVertical=127&d,d=c[++o],f.anchorHorizontal=d,d=c[++o],f.anchorPoint=(240&d)>>4,f.rowCount=15&d,d=c[++o],f.columnCount=63&d,d=c[++o],f.windowStyle=(56&d)>>3,f.penStyle=7&d,f.virtualRowCount=f.rowCount+1,o},le.prototype.setWindowAttributes=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.winAttr;return d=c[++o],m.fillOpacity=(192&d)>>6,m.fillRed=(48&d)>>4,m.fillGreen=(12&d)>>2,m.fillBlue=3&d,d=c[++o],m.borderType=(192&d)>>6,m.borderRed=(48&d)>>4,m.borderGreen=(12&d)>>2,m.borderBlue=3&d,d=c[++o],m.borderType+=(128&d)>>5,m.wordWrap=(64&d)>>6,m.printDirection=(48&d)>>4,m.scrollDirection=(12&d)>>2,m.justify=3&d,d=c[++o],m.effectSpeed=(240&d)>>4,m.effectDirection=(12&d)>>2,m.displayEffect=3&d,o},le.prototype.flushDisplayed=function(o,u){for(var c=[],d=0;d<8;d++)u.windows[d].visible&&!u.windows[d].isEmpty()&&c.push(u.windows[d].getText());u.endPts=o,u.text=c.join(` - -`),this.pushCaption(u),u.startPts=o},le.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},le.prototype.displayWindows=function(o,u){var c=this.current708Packet.data[++o],d=this.getPts(o);this.flushDisplayed(d,u);for(var m=0;m<8;m++)c&1<>4,m.offset=(12&d)>>2,m.penSize=3&d,d=c[++o],m.italics=(128&d)>>7,m.underline=(64&d)>>6,m.edgeType=(56&d)>>3,m.fontStyle=7&d,o},le.prototype.setPenColor=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.penColor;return d=c[++o],m.fgOpacity=(192&d)>>6,m.fgRed=(48&d)>>4,m.fgGreen=(12&d)>>2,m.fgBlue=3&d,d=c[++o],m.bgOpacity=(192&d)>>6,m.bgRed=(48&d)>>4,m.bgGreen=(12&d)>>2,m.bgBlue=3&d,d=c[++o],m.edgeRed=(48&d)>>4,m.edgeGreen=(12&d)>>2,m.edgeBlue=3&d,o},le.prototype.setPenLocation=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.penLoc;return u.currentWindow.pendingNewLine=!0,d=c[++o],m.row=15&d,d=c[++o],m.column=63&d,o},le.prototype.reset=function(o,u){var c=this.getPts(o);return this.flushDisplayed(c,u),this.initService(u.serviceNum,o)};var De={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ee=function(o){return o===null?"":(o=De[o]||o,String.fromCharCode(o))},wt=14,qt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],st=function(){for(var o=[],u=wt+1;u--;)o.push({text:"",indent:0,offset:0});return o},Ae=function(o,u){Ae.prototype.init.call(this),this.field_=o||0,this.dataChannel_=u||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(c){var d,m,f,b,x;if((d=32639&c.ccData)!==this.lastControlCode_){if((61440&d)==4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),f=d>>>8,b=255&d,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(c.pts),this.flushDisplayed(c.pts),m=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=m,this.startPts_=c.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(c.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(c.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(c.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(c.pts),this.flushDisplayed(c.pts),this.shiftRowsUp_(),this.startPts_=c.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(c.pts),this.displayed_=st();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=st();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(c.pts),this.displayed_=st()),this.mode_="paintOn",this.startPts_=c.pts;else if(this.isSpecialCharacter(f,b))x=Ee((f=(3&f)<<8)|b),this[this.mode_](c.pts,x),this.column_++;else if(this.isExtCharacter(f,b))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),x=Ee((f=(3&f)<<8)|b),this[this.mode_](c.pts,x),this.column_++;else if(this.isMidRowCode(f,b))this.clearFormatting(c.pts),this[this.mode_](c.pts," "),this.column_++,14&~b||this.addFormatting(c.pts,["i"]),1&~b||this.addFormatting(c.pts,["u"]);else if(this.isOffsetControlCode(f,b)){const D=3&b;this.nonDisplayed_[this.row_].offset=D,this.column_+=D}else if(this.isPAC(f,b)){var C=qt.indexOf(7968&d);if(this.mode_==="rollUp"&&(C-this.rollUpRows_+1<0&&(C=this.rollUpRows_-1),this.setRollUp(c.pts,C)),C!==this.row_&&C>=0&&C<=14&&(this.clearFormatting(c.pts),this.row_=C),1&b&&this.formatting_.indexOf("u")===-1&&this.addFormatting(c.pts,["u"]),!(16&~d)){const D=(14&d)>>1;this.column_=4*D,this.nonDisplayed_[this.row_].indent+=D}this.isColorPAC(b)&&(14&~b||this.addFormatting(c.pts,["i"]))}else this.isNormalChar(f)&&(b===0&&(b=null),x=Ee(f),x+=Ee(b),this[this.mode_](c.pts,x),this.column_+=x.length)}else this.lastControlCode_=null}};Ae.prototype=new Qs,Ae.prototype.flushDisplayed=function(o){const u=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},c=[];this.displayed_.forEach((d,m)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{u(m)}d.text.length&&c.push({text:d.text,line:m+1,position:10+Math.min(70,10*d.indent)+2.5*d.offset})}else d==null&&u(m)}),c.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:c,stream:this.name_})},Ae.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=st(),this.nonDisplayed_=st(),this.lastControlCode_=null,this.column_=0,this.row_=wt,this.rollUpRows_=2,this.formatting_=[]},Ae.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ae.prototype.isSpecialCharacter=function(o,u){return o===this.EXT_&&u>=48&&u<=63},Ae.prototype.isExtCharacter=function(o,u){return(o===this.EXT_+1||o===this.EXT_+2)&&u>=32&&u<=63},Ae.prototype.isMidRowCode=function(o,u){return o===this.EXT_&&u>=32&&u<=47},Ae.prototype.isOffsetControlCode=function(o,u){return o===this.OFFSET_&&u>=33&&u<=35},Ae.prototype.isPAC=function(o,u){return o>=this.BASE_&&o=64&&u<=127},Ae.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Ae.prototype.isNormalChar=function(o){return o>=32&&o<=127},Ae.prototype.setRollUp=function(o,u){if(this.mode_!=="rollUp"&&(this.row_=wt,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=st(),this.displayed_=st()),u!==void 0&&u!==this.row_)for(var c=0;c"},"");this[this.mode_](o,c)},Ae.prototype.clearFormatting=function(o){if(this.formatting_.length){var u=this.formatting_.reverse().reduce(function(c,d){return c+""},"");this.formatting_=[],this[this.mode_](o,u)}},Ae.prototype.popOn=function(o,u){var c=this.nonDisplayed_[this.row_].text;c+=u,this.nonDisplayed_[this.row_].text=c},Ae.prototype.rollUp=function(o,u){var c=this.displayed_[this.row_].text;c+=u,this.displayed_[this.row_].text=c},Ae.prototype.shiftRowsUp_=function(){var o;for(o=0;ou&&(c=-1);Math.abs(u-o)>_s;)o+=c*Lt;return o},Ht=function(o){var u,c;Ht.prototype.init.call(this),this.type_=o||Ls,this.push=function(d){d.type!=="metadata"?this.type_!==Ls&&d.type!==this.type_||(c===void 0&&(c=d.dts),d.dts=Js(d.dts,c),d.pts=Js(d.pts,c),u=d.dts,this.trigger("data",d)):this.trigger("data",d)},this.flush=function(){c=u,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){c=void 0,u=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ht.prototype=new ns;var Zs,nl={TimestampRolloverStream:Ht,handleRollover:Js},Qp=(o,u,c)=>{if(!o)return-1;for(var d=c;d";o.data[0]===Ir.Utf8&&((u=Dr(o.data,0,d))<0||(o.mimeType=Vi(o.data,d,u),d=u+1,o.pictureType=o.data[d],d++,(c=Dr(o.data,0,d))<0||(o.description=$i(o.data,d,c),d=c+1,o.mimeType===m?o.url=Vi(o.data,d,o.data.length):o.pictureData=o.data.subarray(d,o.data.length))))},"T*":function(o){o.data[0]===Ir.Utf8&&(o.value=$i(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var u;o.data[0]===Ir.Utf8&&(u=Dr(o.data,0,1))!==-1&&(o.description=$i(o.data,1,u),o.value=$i(o.data,u+1,o.data.length).replace(/\0*$/,""),o.data=o.value)},"W*":function(o){o.url=Vi(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var u;o.data[0]===Ir.Utf8&&(u=Dr(o.data,0,1))!==-1&&(o.description=$i(o.data,1,u),o.url=Vi(o.data,u+1,o.data.length).replace(/\0.*$/,""))},PRIV:function(o){var u;for(u=0;u>>2;de*=4,de+=3&ue[7],j.timeStamp=de,x.pts===void 0&&x.dts===void 0&&(x.pts=j.timeStamp,x.dts=j.timeStamp),this.trigger("timestamp",j)}x.frames.push(j),C+=10,C+=D}while(C>>4>1&&(b+=m[b]+1),f.pid===0)f.type="pat",o(m.subarray(b),f),this.trigger("data",f);else if(f.pid===this.pmtPid)for(f.type="pmt",o(m.subarray(b),f),this.trigger("data",f);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([m,b,f]):this.processPes_(m,b,f)},this.processPes_=function(m,f,b){b.pid===this.programMapTable.video?b.streamType=Ot.H264_STREAM_TYPE:b.pid===this.programMapTable.audio?b.streamType=Ot.ADTS_STREAM_TYPE:b.streamType=this.programMapTable["timed-metadata"][b.pid],b.type="pes",b.data=m.subarray(f),this.trigger("data",b)}},Gi.prototype=new Zn,Gi.STREAM_TYPES={h264:27,adts:15},Pr=function(){var o,u=this,c=!1,d={data:[],size:0},m={data:[],size:0},f={data:[],size:0},b=function(C,D){var j;const X=C[0]<<16|C[1]<<8|C[2];D.data=new Uint8Array,X===1&&(D.packetLength=6+(C[4]<<8|C[5]),D.dataAlignmentIndicator=!!(4&C[6]),192&(j=C[7])&&(D.pts=(14&C[9])<<27|(255&C[10])<<20|(254&C[11])<<12|(255&C[12])<<5|(254&C[13])>>>3,D.pts*=4,D.pts+=(6&C[13])>>>1,D.dts=D.pts,64&j&&(D.dts=(14&C[14])<<27|(255&C[15])<<20|(254&C[16])<<12|(255&C[17])<<5|(254&C[18])>>>3,D.dts*=4,D.dts+=(6&C[18])>>>1)),D.data=C.subarray(9+C[8]))},x=function(C,D,j){var X,ue=new Uint8Array(C.size),de={type:D},be=0,Ce=0,nt=!1;if(C.data.length&&!(C.size<9)){for(de.trackId=C.data[0].pid,be=0;be>5,C=(x=1024*(1+(3&u[D+6])))*im/ul[(60&u[D+2])>>>2],u.byteLength-D>>6&3),channelcount:(1&u[D+2])<<2|(192&u[D+3])>>>6,samplerate:ul[(60&u[D+2])>>>2],samplingfrequencyindex:(60&u[D+2])>>>2,samplesize:16,data:u.subarray(D+7+f,D+m)}),c++,D+=m}else typeof j!="number"&&(j=D),D++;typeof j=="number"&&(this.skipWarn_(j,D),j=null),u=u.subarray(D)}},this.flush=function(){c=0,this.trigger("done")},this.reset=function(){u=void 0,this.trigger("reset")},this.endTimeline=function(){u=void 0,this.trigger("endedtimeline")}}).prototype=new sm;var Lr,Or,hl,rm=ia,dl=Fe,nm=function(o){var u=o.byteLength,c=0,d=0;this.length=function(){return 8*u},this.bitsAvailable=function(){return 8*u+d},this.loadWord=function(){var m=o.byteLength-u,f=new Uint8Array(4),b=Math.min(4,u);if(b===0)throw new Error("no bytes available");f.set(o.subarray(m,m+b)),c=new DataView(f.buffer).getUint32(0),d=8*b,u-=b},this.skipBits=function(m){var f;d>m?(c<<=m,d-=m):(m-=d,m-=8*(f=Math.floor(m/8)),u-=f,this.loadWord(),c<<=m,d-=m)},this.readBits=function(m){var f=Math.min(d,m),b=c>>>32-f;return(d-=f)>0?c<<=f:u>0&&this.loadWord(),(f=m-f)>0?b<>>m)return c<<=m,d-=m,m;return this.loadWord(),m+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var m=this.skipLeadingZeros();return this.readBits(m+1)-1},this.readExpGolomb=function(){var m=this.readUnsignedExpGolomb();return 1&m?1+m>>>1:-1*(m>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(Or=function(){var o,u,c=0;Or.prototype.init.call(this),this.push=function(d){var m;u?((m=new Uint8Array(u.byteLength+d.data.byteLength)).set(u),m.set(d.data,u.byteLength),u=m):u=d.data;for(var f=u.byteLength;c3&&this.trigger("data",u.subarray(c+3)),u=null,c=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new dl,hl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Lr=function(){var o,u,c,d,m,f,b,x=new Or;Lr.prototype.init.call(this),o=this,this.push=function(C){C.type==="video"&&(u=C.trackId,c=C.pts,d=C.dts,x.push(C))},x.on("data",function(C){var D={trackId:u,pts:c,dts:d,data:C,nalUnitTypeCode:31&C[0]};switch(D.nalUnitTypeCode){case 5:D.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:D.nalUnitType="sei_rbsp",D.escapedRBSP=m(C.subarray(1));break;case 7:D.nalUnitType="seq_parameter_set_rbsp",D.escapedRBSP=m(C.subarray(1)),D.config=f(D.escapedRBSP);break;case 8:D.nalUnitType="pic_parameter_set_rbsp";break;case 9:D.nalUnitType="access_unit_delimiter_rbsp"}o.trigger("data",D)}),x.on("done",function(){o.trigger("done")}),x.on("partialdone",function(){o.trigger("partialdone")}),x.on("reset",function(){o.trigger("reset")}),x.on("endedtimeline",function(){o.trigger("endedtimeline")}),this.flush=function(){x.flush()},this.partialFlush=function(){x.partialFlush()},this.reset=function(){x.reset()},this.endTimeline=function(){x.endTimeline()},b=function(C,D){var j,X=8,ue=8;for(j=0;j=0?c:0,(16&o[u+5])>>4?c+20:c+10},pl=function(o,u){return o.length-u<10||o[u]!==73||o[u+1]!==68||o[u+2]!==51?u:(u+=cl(o,u),pl(o,u))},ml=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},lm=function(o,u,c){var d,m="";for(d=u;d=u+2&&!(255&~o[u])&&!(240&~o[u+1])&&(22&o[u+1])==16},parseId3TagSize:cl,parseAdtsSize:function(o,u){var c=(224&o[u+5])>>5,d=o[u+4]<<3;return 6144&o[u+3]|d|c},parseType:function(o,u){return o[u]===73&&o[u+1]===68&&o[u+2]===51?"timed-metadata":!0&o[u]&&!(240&~o[u+1])?"audio":null},parseSampleRate:function(o){for(var u=0;u+5>>2];u++}return null},parseAacTimestamp:function(o){var u,c,d;u=10,64&o[5]&&(u+=4,u+=ml(o.subarray(10,14)));do{if((c=ml(o.subarray(u+4,u+8)))<1)return null;if(String.fromCharCode(o[u],o[u+1],o[u+2],o[u+3])==="PRIV"){d=o.subarray(u+10,u+c+10);for(var m=0;m>>2;return b*=4,b+=3&f[7]}break}}u+=10,u+=c}while(u=3;)if(o[C]!==73||o[C+1]!==68||o[C+2]!==51)if(255&~o[C]||240&~o[C+1])C++;else{if(o.length-C<7||C+(x=gl.parseAdtsSize(o,C))>o.length)break;f={type:"audio",data:o.subarray(C,C+x),pts:u,dts:u},this.trigger("data",f),C+=x}else{if(o.length-C<10||C+(x=gl.parseId3TagSize(o,C))>o.length)break;m={type:"timed-metadata",data:o.subarray(C,C+x)},this.trigger("data",m),C+=x}d=o.length-C,o=d>0?o.subarray(C):new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Fe;var Xi,ti,Nr,Os,hm=ra,dm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],cm=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Rr=Fe,Yi=ms,Ki=je,Mr=qi,Nt=kr,as=tm,Br=ke,fl=rm,pm=am.H264Stream,mm=hm,gm=na.isLikelyAacData,fm=ke.ONE_SECOND_IN_TS,aa=dm,oa=cm,ym=function(o,u){u.stream=o,this.trigger("log",u)},yl=function(o,u){for(var c=Object.keys(u),d=0;d=-be&&C<=de&&(!D||Ce>C)&&(D=X,Ce=C));return D?D.gop:null},this.alignGopsAtStart_=function(x){var C,D,j,X,ue,de,be,Ce;for(ue=x.byteLength,de=x.nalCount,be=x.duration,C=D=0;Cj.pts?C++:(D++,ue-=X.byteLength,de-=X.nalCount,be-=X.duration);return D===0?x:D===x.length?null:((Ce=x.slice(D)).byteLength=ue,Ce.duration=be,Ce.nalCount=de,Ce.pts=Ce[0].pts,Ce.dts=Ce[0].dts,Ce)},this.alignGopsAtEnd_=function(x){var C,D,j,X,ue,de,be;for(C=b.length-1,D=x.length-1,ue=null,de=!1;C>=0&&D>=0;){if(j=b[C],X=x[D],j.pts===X.pts){de=!0;break}j.pts>X.pts?C--:(C===b.length-1&&(ue=D),D--)}if(!de&&ue===null)return null;if((be=de?D:ue)===0)return x;var Ce=x.slice(be),nt=Ce.reduce(function(Rt,ri){return Rt.byteLength+=ri.byteLength,Rt.duration+=ri.duration,Rt.nalCount+=ri.nalCount,Rt},{byteLength:0,duration:0,nalCount:0});return Ce.byteLength=nt.byteLength,Ce.duration=nt.duration,Ce.nalCount=nt.nalCount,Ce.pts=Ce[0].pts,Ce.dts=Ce[0].dts,Ce},this.alignGopsWith=function(x){b=x}},Xi.prototype=new Rr,Os=function(o,u){this.numberOfTracks=0,this.metadataStream=u,(o=o||{}).remux!==void 0?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Os.prototype.init.call(this),this.push=function(c){return c.content||c.text?this.pendingCaptions.push(c):c.frames?this.pendingMetadata.push(c):(this.pendingTracks.push(c.track),this.pendingBytes+=c.boxes.byteLength,c.track.type==="video"&&(this.videoTrack=c.track,this.pendingBoxes.push(c.boxes)),void(c.track.type==="audio"&&(this.audioTrack=c.track,this.pendingBoxes.unshift(c.boxes))))}},Os.prototype=new Rr,Os.prototype.flush=function(o){var u,c,d,m,f=0,b={captions:[],captionStreams:{},metadata:[],info:{}},x=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(x=this.videoTrack.timelineStartInfo.pts,oa.forEach(function(C){b.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(x=this.audioTrack.timelineStartInfo.pts,aa.forEach(function(C){b.info[C]=this.audioTrack[C]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?b.type=this.pendingTracks[0].type:b.type="combined",this.emittedTracks+=this.pendingTracks.length,d=Yi.initSegment(this.pendingTracks),b.initSegment=new Uint8Array(d.byteLength),b.initSegment.set(d),b.data=new Uint8Array(this.pendingBytes),m=0;m=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Os.prototype.setRemux=function(o){this.remuxTracks=o},Nr=function(o){var u,c,d=this,m=!0;Nr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var f={};this.transmuxPipeline_=f,f.type="aac",f.metadataStream=new as.MetadataStream,f.aacStream=new mm,f.audioTimestampRolloverStream=new as.TimestampRolloverStream("audio"),f.timedMetadataTimestampRolloverStream=new as.TimestampRolloverStream("timed-metadata"),f.adtsStream=new fl,f.coalesceStream=new Os(o,f.metadataStream),f.headOfPipeline=f.aacStream,f.aacStream.pipe(f.audioTimestampRolloverStream).pipe(f.adtsStream),f.aacStream.pipe(f.timedMetadataTimestampRolloverStream).pipe(f.metadataStream).pipe(f.coalesceStream),f.metadataStream.on("timestamp",function(b){f.aacStream.setTimestamp(b.timeStamp)}),f.aacStream.on("data",function(b){b.type!=="timed-metadata"&&b.type!=="audio"||f.audioSegmentStream||(c=c||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},f.coalesceStream.numberOfTracks++,f.audioSegmentStream=new ti(c,o),f.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),f.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),f.adtsStream.pipe(f.audioSegmentStream).pipe(f.coalesceStream),d.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!u}))}),f.coalesceStream.on("data",this.trigger.bind(this,"data")),f.coalesceStream.on("done",this.trigger.bind(this,"done")),yl(this,f)},this.setupTsPipeline=function(){var f={};this.transmuxPipeline_=f,f.type="ts",f.metadataStream=new as.MetadataStream,f.packetStream=new as.TransportPacketStream,f.parseStream=new as.TransportParseStream,f.elementaryStream=new as.ElementaryStream,f.timestampRolloverStream=new as.TimestampRolloverStream,f.adtsStream=new fl,f.h264Stream=new pm,f.captionStream=new as.CaptionStream(o),f.coalesceStream=new Os(o,f.metadataStream),f.headOfPipeline=f.packetStream,f.packetStream.pipe(f.parseStream).pipe(f.elementaryStream).pipe(f.timestampRolloverStream),f.timestampRolloverStream.pipe(f.h264Stream),f.timestampRolloverStream.pipe(f.adtsStream),f.timestampRolloverStream.pipe(f.metadataStream).pipe(f.coalesceStream),f.h264Stream.pipe(f.captionStream).pipe(f.coalesceStream),f.elementaryStream.on("data",function(b){var x;if(b.type==="metadata"){for(x=b.tracks.length;x--;)u||b.tracks[x].type!=="video"?c||b.tracks[x].type!=="audio"||((c=b.tracks[x]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):(u=b.tracks[x]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime;u&&!f.videoSegmentStream&&(f.coalesceStream.numberOfTracks++,f.videoSegmentStream=new Xi(u,o),f.videoSegmentStream.on("log",d.getLogTrigger_("videoSegmentStream")),f.videoSegmentStream.on("timelineStartInfo",function(C){c&&!o.keepOriginalTimestamps&&(c.timelineStartInfo=C,f.audioSegmentStream.setEarliestDts(C.dts-d.baseMediaDecodeTime))}),f.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),f.videoSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"videoSegmentTimingInfo")),f.videoSegmentStream.on("baseMediaDecodeTime",function(C){c&&f.audioSegmentStream.setVideoBaseMediaDecodeTime(C)}),f.videoSegmentStream.on("timingInfo",d.trigger.bind(d,"videoTimingInfo")),f.h264Stream.pipe(f.videoSegmentStream).pipe(f.coalesceStream)),c&&!f.audioSegmentStream&&(f.coalesceStream.numberOfTracks++,f.audioSegmentStream=new ti(c,o),f.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),f.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),f.audioSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"audioSegmentTimingInfo")),f.adtsStream.pipe(f.audioSegmentStream).pipe(f.coalesceStream)),d.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!u})}}),f.coalesceStream.on("data",this.trigger.bind(this,"data")),f.coalesceStream.on("id3Frame",function(b){b.dispatchType=f.metadataStream.dispatchType,d.trigger("id3Frame",b)}),f.coalesceStream.on("caption",this.trigger.bind(this,"caption")),f.coalesceStream.on("done",this.trigger.bind(this,"done")),yl(this,f)},this.setBaseMediaDecodeTime=function(f){var b=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=f),c&&(c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(c),b.audioTimestampRolloverStream&&b.audioTimestampRolloverStream.discontinuity()),u&&(b.videoSegmentStream&&(b.videoSegmentStream.gopCache_=[]),u.timelineStartInfo.dts=void 0,u.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(u),b.captionStream.reset()),b.timestampRolloverStream&&b.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(f){c&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(f)},this.setRemux=function(f){var b=this.transmuxPipeline_;o.remux=f,b&&b.coalesceStream&&b.coalesceStream.setRemux(f)},this.alignGopsWith=function(f){u&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(f)},this.getLogTrigger_=function(f){var b=this;return function(x){x.stream=f,b.trigger("log",x)}},this.push=function(f){if(m){var b=gm(f);b&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():b||this.transmuxPipeline_.type==="ts"||this.setupTsPipeline(),m=!1}this.transmuxPipeline_.headOfPipeline.push(f)},this.flush=function(){m=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Nr.prototype=new Rr;var vl,bl,Tl,Sl,El,ua,Cl,_m={Transmuxer:Nr,VideoSegmentStream:Xi,AudioSegmentStream:ti,AUDIO_PROPERTIES:aa,VIDEO_PROPERTIES:oa,generateSegmentTimingInfo:la},Fr={toUnsigned:function(o){return o>>>0},toHexString:function(o){return("00"+o.toString(16)).slice(-2)}},wl=function(o){var u="";return u+=String.fromCharCode(o[0]),u+=String.fromCharCode(o[1]),u+=String.fromCharCode(o[2]),u+=String.fromCharCode(o[3])},vm=Fr.toUnsigned,bm=wl,Al=function(o,u){var c,d,m,f,b,x=[];if(!u.length)return null;for(c=0;c1?c+d:o.byteLength,m===u[0]&&(u.length===1?x.push(o.subarray(c+8,f)):(b=Al(o.subarray(c+8,f),u.slice(1))).length&&(x=x.concat(b))),c=f;return x},xl=Al,Tm=Fr.toUnsigned,Sm=Pe.getUint64,kl=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return u.version===1?u.baseMediaDecodeTime=Sm(o.subarray(4)):u.baseMediaDecodeTime=Tm(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),u},Dl=function(o){return{isLeading:(12&o[0])>>>2,dependsOn:3&o[0],isDependedOn:(192&o[1])>>>6,hasRedundancy:(48&o[1])>>>4,paddingValue:(14&o[1])>>>1,isNonSyncSample:1&o[1],degradationPriority:o[2]<<8|o[3]}},Il=function(o){var u,c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},d=new DataView(o.buffer,o.byteOffset,o.byteLength),m=1&c.flags[2],f=4&c.flags[2],b=1&c.flags[1],x=2&c.flags[1],C=4&c.flags[1],D=8&c.flags[1],j=d.getUint32(4),X=8;for(m&&(c.dataOffset=d.getInt32(X),X+=4),f&&j&&(u={flags:Dl(o.subarray(X,X+4))},X+=4,b&&(u.duration=d.getUint32(X),X+=4),x&&(u.size=d.getUint32(X),X+=4),D&&(c.version===1?u.compositionTimeOffset=d.getInt32(X):u.compositionTimeOffset=d.getUint32(X),X+=4),c.samples.push(u),j--);j--;)u={},b&&(u.duration=d.getUint32(X),X+=4),x&&(u.size=d.getUint32(X),X+=4),C&&(u.flags=Dl(o.subarray(X,X+4)),X+=4),D&&(c.version===1?u.compositionTimeOffset=d.getInt32(X):u.compositionTimeOffset=d.getUint32(X),X+=4),c.samples.push(u);return c},Pl=function(o){var u,c=new DataView(o.buffer,o.byteOffset,o.byteLength),d={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:c.getUint32(4)},m=1&d.flags[2],f=2&d.flags[2],b=8&d.flags[2],x=16&d.flags[2],C=32&d.flags[2],D=65536&d.flags[0],j=131072&d.flags[0];return u=8,m&&(u+=4,d.baseDataOffset=c.getUint32(12),u+=4),f&&(d.sampleDescriptionIndex=c.getUint32(u),u+=4),b&&(d.defaultSampleDuration=c.getUint32(u),u+=4),x&&(d.defaultSampleSize=c.getUint32(u),u+=4),C&&(d.defaultSampleFlags=c.getUint32(u)),D&&(d.durationIsEmpty=!0),!m&&j&&(d.baseDataOffsetIsMoof=!0),d},Ll=typeof window<"u"?window:s!==void 0?s:typeof self<"u"?self:{},Em=rs.discardEmulationPreventionBytes,Cm=jt.CaptionStream,Qi=xl,wm=kl,Am=Il,xm=Pl,Ol=Ll,km=function(o,u){for(var c=o,d=0;d0?wm(be[0]).baseMediaDecodeTime:0,nt=Qi(j,["trun"]);u===de&&nt.length>0&&(x=Im(nt,Ce,ue),C=Dm(D,x,de),m[de]||(m[de]={seiNals:[],logs:[]}),m[de].seiNals=m[de].seiNals.concat(C.seiNals),m[de].logs=m[de].logs.concat(C.logs))}),m},Lm=function(o,u,c){if(u===null)return null;var d=Pm(o,u)[u]||{};return{seiNals:d.seiNals,logs:d.logs,timescale:c}},Om=function(){var o,u,c,d,m,f,b=!1;this.isInitialized=function(){return b},this.init=function(x){o=new Cm,b=!0,f=!!x&&x.isPartial,o.on("data",function(C){C.startTime=C.startPts/d,C.endTime=C.endPts/d,m.captions.push(C),m.captionStreams[C.stream]=!0}),o.on("log",function(C){m.logs.push(C)})},this.isNewInit=function(x,C){return!(x&&x.length===0||C&&typeof C=="object"&&Object.keys(C).length===0)&&(c!==x[0]||d!==C[c])},this.parse=function(x,C,D){var j;if(!this.isInitialized()||!C||!D)return null;if(this.isNewInit(C,D))c=C[0],d=D[c];else if(c===null||!d)return u.push(x),null;for(;u.length>0;){var X=u.shift();this.parse(X,C,D)}return(j=Lm(x,c,d))&&j.logs&&(m.logs=m.logs.concat(j.logs)),j!==null&&j.seiNals?(this.pushNals(j.seiNals),this.flushStream(),m):m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(x){if(!this.isInitialized()||!x||x.length===0)return null;x.forEach(function(C){o.push(C)})},this.flushStream=function(){if(!this.isInitialized())return null;f?o.partialFlush():o.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;o.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){u=[],c=null,d=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Nm=Om,Ur=function(o){for(var u=0,c=String.fromCharCode(o[u]),d="";c!=="\0";)d+=c,u++,c=String.fromCharCode(o[u]);return d+=c},Rm=Pe.getUint64,Mm=function(o){var u,c,d,m,f,b,x,C=4,D=o[0];if(D===0)C+=(u=Ur(o.subarray(C))).length,C+=(c=Ur(o.subarray(C))).length,d=(j=new DataView(o.buffer)).getUint32(C),C+=4,f=j.getUint32(C),C+=4,b=j.getUint32(C),C+=4,x=j.getUint32(C),C+=4;else if(D===1){var j;d=(j=new DataView(o.buffer)).getUint32(C),C+=4,m=Rm(o.subarray(C)),C+=8,b=j.getUint32(C),C+=4,x=j.getUint32(C),C+=4,C+=(u=Ur(o.subarray(C))).length,C+=(c=Ur(o.subarray(C))).length}var X={scheme_id_uri:u,value:c,timescale:d||1,presentation_time:m,presentation_time_delta:f,event_duration:b,id:x,message_data:new Uint8Array(o.subarray(C,o.byteLength))};return Fm(D,X)?X:void 0},Bm=function(o,u,c,d){return o||o===0?o/u:d+c/u},Fm=function(o,u){var c=u.scheme_id_uri!=="\0",d=o===0&&Nl(u.presentation_time_delta)&&c,m=o===1&&Nl(u.presentation_time)&&c;return!(o>1)&&d||m},Nl=function(o){return o!==void 0||o!==null},Um={parseEmsgBox:Mm,scaleTime:Bm},qr=Fr.toUnsigned,Ji=Fr.toHexString,$e=xl,si=wl,ha=Um,qm=Pl,jm=Il,Hm=kl,$m=Pe.getUint64,da=Ll,Vm=ol.parseId3Frames;vl=function(o){var u={};return $e(o,["moov","trak"]).reduce(function(c,d){var m,f,b,x,C;return(m=$e(d,["tkhd"])[0])?(f=m[0],x=qr(m[b=f===0?12:20]<<24|m[b+1]<<16|m[b+2]<<8|m[b+3]),(C=$e(d,["mdia","mdhd"])[0])?(b=(f=C[0])===0?12:20,c[x]=qr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),c):null):null},u)},bl=function(o,u){var c=$e(u,["moof","traf"]).reduce(function(d,m){var f,b=$e(m,["tfhd"])[0],x=qr(b[4]<<24|b[5]<<16|b[6]<<8|b[7]),C=o[x]||9e4,D=$e(m,["tfdt"])[0],j=new DataView(D.buffer,D.byteOffset,D.byteLength);let X;return typeof(f=D[0]===1?$m(D.subarray(4,12)):j.getUint32(4))=="bigint"?X=f/da.BigInt(C):typeof f!="number"||isNaN(f)||(X=f/C),X11?(b.codec+=".",b.codec+=Ji(ue[9]),b.codec+=Ji(ue[10]),b.codec+=Ji(ue[11])):b.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(b.codec)?(ue=de.subarray(28),si(ue.subarray(4,8))==="esds"&&ue.length>20&&ue[19]!==0?(b.codec+="."+Ji(ue[19]),b.codec+="."+Ji(ue[20]>>>2&63).replace(/^0/,"")):b.codec="mp4a.40.2"):b.codec=b.codec.toLowerCase())}var be=$e(d,["mdia","mdhd"])[0];be&&(b.timescale=ua(be)),c.push(b)}),c},Cl=function(o,u=0){return $e(o,["emsg"]).map(c=>{var d=ha.parseEmsgBox(new Uint8Array(c)),m=Vm(d.message_data);return{cueTime:ha.scaleTime(d.presentation_time,d.timescale,d.presentation_time_delta,u),duration:ha.scaleTime(d.event_duration,d.timescale),frames:m}})};var ca={findBox:$e,parseType:si,timescale:vl,startTime:bl,compositionStartTime:Tl,videoTrackIds:Sl,tracks:El,getTimescaleFromMediaHeader:ua,getEmsgID3:Cl},pa=Pt,Rl=function(o){var u=31&o[1];return u<<=8,u|=o[2]},jr=function(o){return!!(64&o[1])},Hr=function(o){var u=0;return(48&o[3])>>>4>1&&(u+=o[4]+1),u},zm=function(o){if(!jr(o))return null;var u=4+Hr(o);if(u>=o.byteLength)return null;var c,d=null;return 192&(c=o[u+7])&&((d={}).pts=(14&o[u+9])<<27|(255&o[u+10])<<20|(254&o[u+11])<<12|(255&o[u+12])<<5|(254&o[u+13])>>>3,d.pts*=4,d.pts+=(6&o[u+13])>>>1,d.dts=d.pts,64&c&&(d.dts=(14&o[u+14])<<27|(255&o[u+15])<<20|(254&o[u+16])<<12|(255&o[u+17])<<5|(254&o[u+18])>>>3,d.dts*=4,d.dts+=(6&o[u+18])>>>1)),d},ma=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Wm={parseType:function(o,u){var c=Rl(o);return c===0?"pat":c===u?"pmt":u?"pes":null},parsePat:function(o){var u=jr(o),c=4+Hr(o);return u&&(c+=o[c]+1),(31&o[c+10])<<8|o[c+11]},parsePmt:function(o){var u={},c=jr(o),d=4+Hr(o);if(c&&(d+=o[d]+1),1&o[d+5]){var m;m=3+((15&o[d+1])<<8|o[d+2])-4;for(var f=12+((15&o[d+10])<<8|o[d+11]);f3&&ma(31&c[m+3])==="slice_layer_without_partitioning_rbsp_idr"&&(f=!0),f}},Ml=Pt,ii=nl.handleRollover,xe={};xe.ts=Wm,xe.aac=na;var Ns=ke.ONE_SECOND_IN_TS,ut=188,$t=71,Gm=function(o,u){for(var c,d=0,m=ut;m=0;)if(o[x]!==$t||o[C]!==$t&&C!==o.byteLength)x--,C--;else{if(d=o.subarray(x,C),xe.ts.parseType(d,u.pid)==="pes"&&(m=xe.ts.parsePesType(d,u.table),f=xe.ts.parsePayloadUnitStartIndicator(d),m==="audio"&&f&&(b=xe.ts.parsePesTime(d))&&(b.type="audio",c.audio.push(b),D=!0)),D)break;x-=ut,C-=ut}},Xm=function(o,u,c){for(var d,m,f,b,x,C,D,j=0,X=ut,ue=!1,de={data:[],size:0};X=0;)if(o[j]!==$t||o[X]!==$t)j--,X--;else{if(d=o.subarray(j,X),xe.ts.parseType(d,u.pid)==="pes"&&(m=xe.ts.parsePesType(d,u.table),f=xe.ts.parsePayloadUnitStartIndicator(d),m==="video"&&f&&(b=xe.ts.parsePesTime(d))&&(b.type="video",c.video.push(b),ue=!0)),ue)break;j-=ut,X-=ut}},Ym=function(o,u){if(o.audio&&o.audio.length){var c=u;(c===void 0||isNaN(c))&&(c=o.audio[0].dts),o.audio.forEach(function(f){f.dts=ii(f.dts,c),f.pts=ii(f.pts,c),f.dtsTime=f.dts/Ns,f.ptsTime=f.pts/Ns})}if(o.video&&o.video.length){var d=u;if((d===void 0||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(f){f.dts=ii(f.dts,d),f.pts=ii(f.pts,d),f.dtsTime=f.dts/Ns,f.ptsTime=f.pts/Ns}),o.firstKeyFrame){var m=o.firstKeyFrame;m.dts=ii(m.dts,d),m.pts=ii(m.pts,d),m.dtsTime=m.dts/Ns,m.ptsTime=m.pts/Ns}}},Km=function(o){for(var u,c=!1,d=0,m=null,f=null,b=0,x=0;o.length-x>=3;){switch(xe.aac.parseType(o,x)){case"timed-metadata":if(o.length-x<10){c=!0;break}if((b=xe.aac.parseId3TagSize(o,x))>o.length){c=!0;break}f===null&&(u=o.subarray(x,x+b),f=xe.aac.parseAacTimestamp(u)),x+=b;break;case"audio":if(o.length-x<7){c=!0;break}if((b=xe.aac.parseAdtsSize(o,x))>o.length){c=!0;break}m===null&&(u=o.subarray(x,x+b),m=xe.aac.parseSampleRate(u)),d++,x+=b;break;default:x++}if(c)return null}if(m===null||f===null)return null;var C=Ns/m;return{audio:[{type:"audio",dts:f,pts:f},{type:"audio",dts:f+1024*d*C,pts:f+1024*d*C}]}},Qm=function(o){var u={pid:null,table:null},c={};for(var d in Gm(o,u),u.table)if(u.table.hasOwnProperty(d))switch(u.table[d]){case Ml.H264_STREAM_TYPE:c.video=[],Xm(o,u,c),c.video.length===0&&delete c.video;break;case Ml.ADTS_STREAM_TYPE:c.audio=[],Bl(o,u,c),c.audio.length===0&&delete c.audio}return c},Jm={inspect:function(o,u){var c;return(c=xe.aac.isLikelyAacData(o)?Km(o):Qm(o))&&(c.audio||c.video)?(Ym(c,u),c):null},parseAudioPes_:Bl};const Zm=function(o,u){u.on("data",function(c){const d=c.initSegment;c.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const m=c.data;c.data=m.buffer,o.postMessage({action:"data",segment:c,byteOffset:m.byteOffset,byteLength:m.byteLength},[c.data])}),u.on("done",function(c){o.postMessage({action:"done"})}),u.on("gopInfo",function(c){o.postMessage({action:"gopInfo",gopInfo:c})}),u.on("videoSegmentTimingInfo",function(c){const d={start:{decode:ke.videoTsToSeconds(c.start.dts),presentation:ke.videoTsToSeconds(c.start.pts)},end:{decode:ke.videoTsToSeconds(c.end.dts),presentation:ke.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ke.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ke.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),u.on("audioSegmentTimingInfo",function(c){const d={start:{decode:ke.videoTsToSeconds(c.start.dts),presentation:ke.videoTsToSeconds(c.start.pts)},end:{decode:ke.videoTsToSeconds(c.end.dts),presentation:ke.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ke.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ke.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),u.on("id3Frame",function(c){o.postMessage({action:"id3Frame",id3Frame:c})}),u.on("caption",function(c){o.postMessage({action:"caption",caption:c})}),u.on("trackinfo",function(c){o.postMessage({action:"trackinfo",trackInfo:c})}),u.on("audioTimingInfo",function(c){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ke.videoTsToSeconds(c.start),end:ke.videoTsToSeconds(c.end)}})}),u.on("videoTimingInfo",function(c){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ke.videoTsToSeconds(c.start),end:ke.videoTsToSeconds(c.end)}})}),u.on("log",function(c){o.postMessage({action:"log",log:c})})};class Fl{constructor(u,c){this.options=c||{},this.self=u,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new _m.Transmuxer(this.options),Zm(this.self,this.transmuxer)}pushMp4Captions(u){this.captionParser||(this.captionParser=new Nm,this.captionParser.init());const c=new Uint8Array(u.data,u.byteOffset,u.byteLength),d=this.captionParser.parse(c,u.trackIds,u.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:c.buffer},[c.buffer])}probeMp4StartTime({timescales:u,data:c}){const d=ca.startTime(u,c);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:c},[c.buffer])}probeMp4Tracks({data:u}){const c=ca.tracks(u);this.self.postMessage({action:"probeMp4Tracks",tracks:c,data:u},[u.buffer])}probeEmsgID3({data:u,offset:c}){const d=ca.getEmsgID3(u,c);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:u},[u.buffer])}probeTs({data:u,baseStartTime:c}){const d=typeof c!="number"||isNaN(c)?void 0:c*ke.ONE_SECOND_IN_TS,m=Jm.inspect(u,d);let f=null;m&&(f={hasVideo:m.video&&m.video.length===2||!1,hasAudio:m.audio&&m.audio.length===2||!1},f.hasVideo&&(f.videoStart=m.video[0].ptsTime),f.hasAudio&&(f.audioStart=m.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:f,data:u},[u.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(u){const c=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.transmuxer.push(c)}reset(){this.transmuxer.reset()}setTimestampOffset(u){const c=u.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ke.secondsToVideoTs(c)))}setAudioAppendStart(u){this.transmuxer.setAudioAppendStart(Math.ceil(ke.secondsToVideoTs(u.appendStart)))}setRemux(u){this.transmuxer.setRemux(u.remux)}flush(u){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(u){this.transmuxer.alignGopsWith(u.gopsToAlignWith.slice())}}self.onmessage=function(o){o.data.action==="init"&&o.data.options?this.messageHandlers=new Fl(self,o.data.options):(this.messageHandlers||(this.messageHandlers=new Fl(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data))}}));var Y0=Sp(X0);const K0=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:h,videoFramePtsTime:p}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});const g=s.data.segment.boxes||{data:s.data.segment.data},y={type:i,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};h!==void 0&&(y.videoFrameDtsTime=h),p!==void 0&&(y.videoFramePtsTime=p),t(y)},Q0=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},J0=(s,e)=>{e.gopInfo=s.data.gopInfo},wp=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:h,onVideoTimingInfo:p,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:y,onId3:w,onCaptions:E,onDone:I,onEndedTimeline:v,onTransmuxerLog:L,isEndOfTimeline:R,segment:M,triggerSegmentEventFn:O}=s,G={buffer:[]};let N=R;const z=H=>{e.currentTransmux===s&&(H.data.action==="data"&&K0(H,G,a),H.data.action==="trackinfo"&&l(H.data.trackInfo),H.data.action==="gopInfo"&&J0(H,G),H.data.action==="audioTimingInfo"&&h(H.data.audioTimingInfo),H.data.action==="videoTimingInfo"&&p(H.data.videoTimingInfo),H.data.action==="videoSegmentTimingInfo"&&g(H.data.videoSegmentTimingInfo),H.data.action==="audioSegmentTimingInfo"&&y(H.data.audioSegmentTimingInfo),H.data.action==="id3Frame"&&w([H.data.id3Frame],H.data.id3Frame.dispatchType),H.data.action==="caption"&&E(H.data.caption),H.data.action==="endedtimeline"&&(N=!1,v()),H.data.action==="log"&&L(H.data.log),H.data.type==="transmuxed"&&(N||(e.onmessage=null,Q0({transmuxedData:G,callback:I}),Ap(e))))},U=()=>{const H={message:"Received an error message from the transmuxer worker",metadata:{errorType:F.Error.StreamingFailedToTransmuxSegment,segmentInfo:qs({segment:M})}};I(null,H)};if(e.onmessage=z,e.onerror=U,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),n!==void 0&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const H=t instanceof ArrayBuffer?t:t.buffer,S=t instanceof ArrayBuffer?0:t.byteOffset;O({type:"segmenttransmuxingstart",segment:M}),e.postMessage({action:"push",data:H,byteOffset:S,byteLength:t.byteLength},[H])}R&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Ap=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():wp(s.currentTransmux))},ud=(s,e)=>{s.postMessage({action:e}),Ap(s)},hd=(s,e)=>{if(!e.currentTransmux)return e.currentTransmux=s,void ud(e,s);e.transmuxQueue.push(ud.bind(null,e,s))},xp=s=>{if(!s.transmuxer.currentTransmux)return s.transmuxer.currentTransmux=s,void wp(s);s.transmuxer.transmuxQueue.push(s)};var to={reset:s=>{hd("reset",s)},endTimeline:s=>{hd("endTimeline",s)},transmux:xp,createTransmuxer:s=>{const e=new Y0;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e}};const pr=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=ze({},s,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;r.byteOffset=a?0:s.data.byteOffset,r.byteLength=s.data.byteLength;const l=[a?s.data:s.data.buffer];e.postMessage(r,l)}else e.postMessage(r)},Yt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ko=s=>{s.forEach(e=>{e.abort()})},Z0=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),e1=s=>{const e=s.target,t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return t.bytesReceived=s.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3),t},il=(s,e)=>{const{requestType:t}=e,i=Gs({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Yt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Yt.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:null},dd=(s,e,t,i)=>(r,n)=>{const a=n.response,l=il(r,n);if(l)return t(l,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Yt.FAILURE,xhr:n},s);const h=new DataView(a),p=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let y=0;y{const t=Fo(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:Yt.FAILURE,metadata:{mediaType:r}})}pr({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>(s.map.bytes=r,i.forEach(function(n){s.map.tracks=s.map.tracks||{},s.map.tracks[n.type]||(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale))}),e(null))})},t1=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=il(i,r);if(n)return e(n,s);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,kp(s,function(l){if(l)return l.xhr=r,l.status=r.status,e(l,s);e(null,s)})},s1=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=il(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const l=t!=="arraybuffer"&&n.responseText?W0(n.responseText.substring(s.lastReachedChar||0)):n.response;return s.stats=Z0(n),s.key?s.encryptedBytes=new Uint8Array(l):s.bytes=new Uint8Array(l),e(null,s)},i1=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{const I=s.map&&s.map.tracks||{},v=!!(I.audio&&I.video);let L=i.bind(null,s,"audio","start");const R=i.bind(null,s,"audio","end");let M=i.bind(null,s,"video","start");const O=i.bind(null,s,"video","end"),G=()=>xp({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:v,onData:N=>{N.type=N.type==="combined"?"video":N.type,g(s,N)},onTrackInfo:N=>{t&&(v&&(N.isMuxed=!0),t(s,N))},onAudioTimingInfo:N=>{L&&N.start!==void 0&&(L(N.start),L=null),R&&N.end!==void 0&&R(N.end)},onVideoTimingInfo:N=>{M&&N.start!==void 0&&(M(N.start),M=null),O&&N.end!==void 0&&O(N.end)},onVideoSegmentTimingInfo:N=>{const z={pts:{start:N.start.presentation,end:N.end.presentation},dts:{start:N.start.decode,end:N.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:z}),r(N)},onAudioSegmentTimingInfo:N=>{const z={pts:{start:N.start.pts,end:N.end.pts},dts:{start:N.start.dts,end:N.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:z}),n(N)},onId3:(N,z)=>{a(s,N,z)},onCaptions:N=>{l(s,[N])},isEndOfTimeline:h,onEndedTimeline:()=>{p()},onTransmuxerLog:w,onDone:(N,z)=>{y&&(N.type=N.type==="combined"?"video":N.type,E({type:"segmenttransmuxingcomplete",segment:s}),y(z,s,N))},segment:s,triggerSegmentEventFn:E});pr({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:N=>{s.bytes=e=N.data;const z=N.result;z&&(t(s,{hasAudio:z.hasAudio,hasVideo:z.hasVideo,isMuxed:v}),t=null),G()}})},Dp=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{let I=new Uint8Array(e);if(My(I)){s.isFmp4=!0;const{tracks:v}=s.map,L={isFmp4:!0,hasVideo:!!v.video,hasAudio:!!v.audio};v.audio&&v.audio.codec&&v.audio.codec!=="enca"&&(L.audioCodec=v.audio.codec),v.video&&v.video.codec&&v.video.codec!=="encv"&&(L.videoCodec=v.video.codec),v.video&&v.audio&&(L.isMuxed=!0),t(s,L);const R=(M,O)=>{g(s,{data:I,type:L.hasAudio&&!L.isMuxed?"audio":"video"}),O&&O.length&&a(s,O),M&&M.length&&l(s,M),y(null,s,{})};pr({action:"probeMp4StartTime",timescales:s.map.timescales,data:I,transmuxer:s.transmuxer,callback:({data:M,startTime:O})=>{e=M.buffer,s.bytes=I=M,L.hasAudio&&!L.isMuxed&&i(s,"audio","start",O),L.hasVideo&&i(s,"video","start",O),pr({action:"probeEmsgID3",data:I,transmuxer:s.transmuxer,offset:O,callback:({emsgData:G,id3Frames:N})=>{e=G.buffer,s.bytes=I=G,v.video&&G.byteLength&&s.transmuxer?pr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:I,timescales:s.map.timescales,trackIds:[v.video.id],callback:z=>{e=z.data.buffer,s.bytes=I=z.data,z.logs.forEach(function(U){w(we(U,{stream:"mp4CaptionParser"}))}),R(z.captions,N)}}):R(void 0,N)}})}})}else if(s.transmuxer){if(s.container===void 0&&(s.container=Fo(I)),s.container!=="ts"&&s.container!=="aac")return t(s,{hasAudio:!1,hasVideo:!1}),void y(null,s,{});i1({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})}else y(null,s,{})},Ip=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const l=p=>{if(p.data.source===s){i.removeEventListener("message",l);const g=p.data.decrypted;a(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};let h;i.onerror=()=>{const p="An error occurred in the decryption worker",g=qs({segment:r}),y={message:p,metadata:{error:new Error(p),errorType:F.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},i.addEventListener("message",l),h=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(fp({source:s,encrypted:t,key:h,iv:e.iv}),[t.buffer,h.buffer])},r1=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),Ip({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:y},I=>{e.bytes=I,E({type:"segmentdecryptioncomplete",segment:e}),Dp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})})},n1=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{let I=0,v=!1;return(L,R)=>{if(!v){if(L)return v=!0,ko(s),y(L,R);if(I+=1,I===s.length){const M=function(){if(R.encryptedBytes)return r1({decryptionWorker:e,segment:R,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E});Dp({segment:R,bytes:R.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})};if(R.endOfAllRequests=Date.now(),R.map&&R.map.encryptedBytes&&!R.map.bytes)return E({type:"segmentdecryptionstart",segment:R}),Ip({decryptionWorker:e,id:R.requestId+"-init",encryptedBytes:R.map.encryptedBytes,key:R.map.key,segment:R,doneFn:y},O=>{R.map.bytes=O,E({type:"segmentdecryptioncomplete",segment:R}),kp(R,G=>{if(G)return ko(s),y(G,R);M()})});M()}}}},a1=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},o1=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g})=>y=>{if(!y.target.aborted)return s.stats=we(s.stats,e1(y)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(y,s)},l1=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I,doneFn:v,onTransmuxerLog:L,triggerSegmentEventFn:R})=>{const M=[],O=n1({activeXhrs:M,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I,doneFn:v,onTransmuxerLog:L,triggerSegmentEventFn:R});if(i.key&&!i.key.bytes){const H=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&H.push(i.map.key);const S=we(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),A=dd(i,H,O,R);R({type:"segmentkeyloadstart",segment:i,keyInfo:{uri:i.key.resolvedUri}});const B=s(S,A);M.push(B)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const B=we(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),$=dd(i,[i.map.key],O,R);R({type:"segmentkeyloadstart",segment:i,keyInfo:{uri:i.map.key.resolvedUri}});const W=s(B,$);M.push(W)}const H=we(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Ao(i.map),requestType:"segment-media-initialization"}),S=t1({segment:i,finishProcessingFn:O,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:i});const A=s(H,S);M.push(A)}const G=we(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Ao(i),requestType:"segment"}),N=s1({segment:i,finishProcessingFn:O,responseType:G.responseType,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:i});const z=s(G,N);z.addEventListener("progress",o1({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I})),M.push(z);const U={};return M.forEach(H=>{H.addEventListener("loadend",a1({loadendState:U,abortFn:r}))}),()=>ko(M)},u1=It("CodecUtils"),h1=function(s){const e=s.attributes||{};if(e.CODECS)return Vt(e.CODECS)},Pp=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},d1=(s,e)=>{if(!Pp(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},kn=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(Fd(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1)return u1(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(e[t]=null);e[t]=e[t][0]}),e},cd=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},mr=function(s,e){const t=e.attributes||{},i=kn(h1(e)||[]);if(Pp(s,e)&&!i.audio&&!d1(s,e)){const r=kn(uf(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},Qr=It("PlaylistSelector"),pd=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},Dn=function(s,e){if(!s)return"";const t=k.getComputedStyle(s);return t?t[e]:""},Ti=function(s,e){const t=s.slice();s.sort(function(i,r){const n=e(i,r);return n===0?t.indexOf(i)-t.indexOf(r):n})},rl=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||k.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||k.Number.MAX_VALUE,t-i},c1=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||k.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||k.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let Lp=function(s,e,t,i,r,n){if(!s)return;const a={bandwidth:e,width:t,height:i,limitRenditionByPlayerDimensions:r};let l=s.playlists;bt.isAudioOnly(s)&&(l=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let h=l.map(N=>{let z;const U=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.width,H=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.height;return z=N.attributes&&N.attributes.BANDWIDTH,z=z||k.Number.MAX_VALUE,{bandwidth:z,width:U,height:H,playlist:N}});Ti(h,(N,z)=>N.bandwidth-z.bandwidth),h=h.filter(N=>!bt.isIncompatible(N.playlist));let p=h.filter(N=>bt.isEnabled(N.playlist));p.length||(p=h.filter(N=>!bt.isDisabled(N.playlist)));const g=p.filter(N=>N.bandwidth*Je.BANDWIDTH_VARIANCEN.bandwidth===y.bandwidth)[0];if(r===!1){const N=w||p[0]||h[0];if(N&&N.playlist){let z="sortedPlaylistReps";return w&&(z="bandwidthBestRep"),p[0]&&(z="enabledPlaylistReps"),Qr(`choosing ${pd(N)} using ${z} with options`,a),N.playlist}return Qr("could not choose a playlist with options",a),null}const E=g.filter(N=>N.width&&N.height);Ti(E,(N,z)=>N.width-z.width);const I=E.filter(N=>N.width===t&&N.height===i);y=I[I.length-1];const v=I.filter(N=>N.bandwidth===y.bandwidth)[0];let L,R,M,O;if(v||(L=E.filter(N=>N.width>t||N.height>i),R=L.filter(N=>N.width===L[0].width&&N.height===L[0].height),y=R[R.length-1],M=R.filter(N=>N.bandwidth===y.bandwidth)[0]),n.leastPixelDiffSelector){const N=E.map(z=>(z.pixelDiff=Math.abs(z.width-t)+Math.abs(z.height-i),z));Ti(N,(z,U)=>z.pixelDiff===U.pixelDiff?U.bandwidth-z.bandwidth:z.pixelDiff-U.pixelDiff),O=N[0]}const G=O||M||v||w||p[0]||h[0];if(G&&G.playlist){let N="sortedPlaylistReps";return O?N="leastPixelDiffRep":M?N="resolutionPlusOneRep":v?N="resolutionBestRep":w?N="bandwidthBestRep":p[0]&&(N="enabledPlaylistReps"),Qr(`choosing ${pd(G)} using ${N} with options`,a),G.playlist}return Qr("could not choose a playlist with options",a),null};const md=function(){let s=this.useDevicePixelRatio&&k.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),Lp(this.playlists.main,this.systemBandwidth,parseInt(Dn(this.tech_.el(),"width"),10)*s,parseInt(Dn(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},p1=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&k.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),Lp(this.playlists.main,e,parseInt(Dn(this.tech_.el(),"width"),10)*i,parseInt(Dn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},m1=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:h}=s,p=e.playlists.filter(E=>!bt.isIncompatible(E));let g=p.filter(bt.isEnabled);g.length||(g=p.filter(E=>!bt.isDisabled(E)));const y=g.filter(bt.hasAttribute.bind(null,"BANDWIDTH")).map(E=>{const I=h.getSyncPoint(E,r,l,t)?1:2;return{playlist:E,rebufferingImpact:bt.estimateSegmentRequestTime(n,i,E)*I-a}}),w=y.filter(E=>E.rebufferingImpact<=0);return Ti(w,(E,I)=>rl(I.playlist,E.playlist)),w.length?w[0]:(Ti(y,(E,I)=>E.rebufferingImpact-I.rebufferingImpact),y[0]||null)},g1=function(){const s=this.playlists.main.playlists.filter(bt.isEnabled);return Ti(s,(e,t)=>rl(e,t)),s.filter(e=>!!mr(this.playlists.main,e).video)[0]||null},f1=s=>{let e,t=0;return s.bytes&&(e=new Uint8Array(s.bytes),s.segments.forEach(i=>{e.set(i,t),t+=i.byteLength})),e};function Op(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const y1=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)s[t]=r;else{let n=t,a=t,l=!1;const h=(e.options_.vhs&&e.options_.vhs.captionServices||{})[i];h&&(n=h.label,a=h.language,l=h.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:l,label:n,language:a},!1).track}}},_1=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=k.WebKitDataCue||k.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const l=new i(r.startTime+t,r.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",s[n].addCue(l)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},v1=function(s){Object.defineProperties(s.frame,{id:{get:()=>(F.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key)},value:{get:()=>(F.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data)},privateData:{get:()=>(F.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data)}})},b1=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=k.WebKitDataCue||k.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(g=>{const y=g.cueTime+t;!(typeof y!="number"||k.isNaN(y)||y<0)&&y<1/0&&g.frames&&g.frames.length&&g.frames.forEach(w=>{const E=new r(y,y,w.value||w.url||w.data||"");E.frame=w,E.value=w,v1(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,l=[];for(let g=0;g{const w=g[y.startTime]||[];return w.push(y),g[y.startTime]=w,g},{}),p=Object.keys(h).sort((g,y)=>Number(g)-Number(y));p.forEach((g,y)=>{const w=h[g],E=isFinite(i)?i:g,I=Number(p[y+1])||E;w.forEach(v=>{v.endTime=I})})},T1={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},S1=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),E1=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=k.WebKitDataCue||k.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(S1.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:T1[n],data:r[n]},n!=="scte35Out"&&n!=="scte35In"||(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},gd=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,F.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},or=function(s,e,t){let i,r;if(t&&t.cues)for(i=t.cues.length;i--;)r=t.cues[i],r.startTime>=s&&r.endTime<=e&&t.removeCue(r)},C1=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const r=e[i],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?s.removeCue(r):t[n]=r}},w1=(s,e,t)=>{if(e==null||!s.length)return[];const i=Math.ceil((e-t+3)*js.ONE_SECOND_IN_TS);let r;for(r=0;ri);r++);return s.slice(r)},A1=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let r=0;for(;r=i);r++);return s.slice(0,r).concat(e)},x1=(s,e,t,i)=>{const r=Math.ceil((e-i)*js.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*js.ONE_SECOND_IN_TS),a=s.slice();let l=s.length;for(;l--&&!(s[l].pts<=n););if(l===-1)return a;let h=l+1;for(;h--&&!(s[h].pts<=r););return h=Math.max(h,0),a.splice(h,l-h+1),a},k1=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let r=0;rt))return n}return i.length===0?0:i[i.length-1]},ir=1,I1=500,fd=s=>typeof s=="number"&&isFinite(s),Jr=1/60,P1=(s,e,t)=>s==="main"&&e&&t?t.hasAudio||t.hasVideo?e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null,L1=(s,e,t)=>{let i=e-Je.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},li=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:h,partIndex:p,timeline:g}=s,y=l.length-1;let w="mediaIndex/partIndex increment";s.getMediaInfoForTime?w=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(w="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(w+=` with independent ${s.independent}`);const E=typeof p=="number",I=s.segment.uri?"segment":"pre-segment",v=E?tp({preloadSegment:i})-1:0;return`${I} [${n+h}/${n+y}]`+(E?` part [${p}/${v}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${w}] playlist [${a}]`},yd=s=>`${s}TimingInfo`,O1=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:r})=>r||s!==e?s{if(e===t)return!1;if(i==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&r){const n=s.pendingTimelineChange({type:"audio"});return!n||n.to!==t}return!1},N1=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,r=i&&e.to!==t.to;return!(!i||e.from===-1||t.from===-1||!r)},R1=s=>{s&&(s.pause(),s.resetEverything(),s.load())},M1=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to{const e=s.pendingSegment_;if(e&&Do({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&N1(s.timelineChangeController_)){if(M1(s))return void s.timelineChangeController_.trigger("audioTimelineBehind");R1(s)}},B1=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:r,end:n}=i;let a;typeof r=="bigint"||typeof n=="bigint"?a=k.BigInt(n)-k.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),a!==void 0&&a>e&&(e=a)}),typeof e=="bigint"&&e!!s&&Math.round(s)>e+Gt,F1=(s,e)=>{if(e!=="hls")return null;const t=B1({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=_d({segmentDuration:t,maxDuration:2*i}),n=_d({segmentDuration:t,maxDuration:i}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},qs=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class Io extends F.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=It(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(ze({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(ze({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Ss(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return to.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,k.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state!=="APPENDING"||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return e!==void 0&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&to.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return gt();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const i=yp(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return this.state==="INIT"&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: -currentTime: ${this.currentTime_()} -bufferedEnd: ${eo(this.buffered_())} -`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const a=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const l=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!l.parts||!l.parts.length||!l.parts[this.partIndex])){const h=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=h}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&to.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1;const a=()=>{n--,n===0&&i()};!r&&this.audioDisabled_||(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=x1(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const l in this.inbandTextTracks_)or(e,t,this.inbandTextTracks_[l]);or(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),I1)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:qs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||i+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=eo(e)||0,i=Zo(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const l={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(l.isSyncRequest)l.mediaIndex=D1(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${l.mediaIndex}`);else if(this.mediaIndex!==null){const w=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=w.end?w.end:t,w.parts&&w.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let w,E,I;const v=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: -For TargetTime: ${v}. -CurrentTime: ${this.currentTime_()} -BufferedEnd: ${t} -Fetch At Buffer: ${this.fetchAtBuffer_} -`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const L=this.getSyncInfoFromMediaSequenceSync_(v);if(!L){const R="No sync info found while using media sequence sync";return this.error({message:R,metadata:{errorType:F.Error.StreamingFailedToSelectNextSegment,error:new Error(R)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${L.start} --> ${L.end})`),w=L.segmentIndex,E=L.partIndex,I=L.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const L=bt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:v,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});w=L.segmentIndex,E=L.partIndex,I=L.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${v}`:`currentTime ${v}`,l.mediaIndex=w,l.startOfSegment=I,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}const h=a[l.mediaIndex];let p=h&&typeof l.partIndex=="number"&&h.parts&&h.parts[l.partIndex];if(!h||typeof l.partIndex=="number"&&!p)return null;typeof l.partIndex!="number"&&h.parts&&(l.partIndex=0,p=h.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&p&&!g&&!p.independent)if(l.partIndex===0){const w=a[l.mediaIndex-1],E=w.parts&&w.parts.length&&w.parts[w.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=w.parts.length-1,l.independent="previous segment")}else h.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,l.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(l))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:h,getMediaInfoForTime:p}=e,g=i.segments[r],y=typeof l=="number"&&g.parts[l],w={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:y?l:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:p,independent:t},E=h!==void 0?h:this.isPendingTimestampOffset_;w.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const I=eo(this.sourceUpdater_.audioBuffered());return typeof I=="number"&&(w.audioAppendStart=I-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(w.gopsToAlignWith=w1(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),w}timestampOffsetForSegment_(e){return O1(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=bt.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=u0(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const l=m1({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;const h=n-a-l.rebufferingImpact;let p=.5;a<=Gt&&(p=1),!l.playlist||l.playlist.uri===this.playlist_.uri||h{r[n.stream]=r[n.stream]||{startTime:1/0,captions:[],endTime:0};const a=r[n.stream];a.startTime=Math.min(a.startTime,n.startTime+i),a.endTime=Math.max(a.endTime,n.endTime+i),a.captions.push(n)}),Object.keys(r).forEach(n=>{const{startTime:a,endTime:l,captions:h}=r[n],p=this.inbandTextTracks_;this.logger_(`adding cues from ${a} -> ${l} for ${n}`),y1(p,this.vhs_.tech_,n),or(a,l,p[n]),_1({captionArray:h,inbandTextTracks:p,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo)&&!(i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo)&&!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Ss(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[yd(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_!=="main"||typeof e.timestampOffset!="number"||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){const n=xn(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Hs(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Hs(a).join(", "));const l=n.length?n.start(0):0,h=n.length?n.end(n.length-1):0,p=a.length?a.start(0):0,g=a.length?a.end(a.length-1):0;if(h-l<=ir&&g-p<=ir)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Hs(n).join(", ")}, video buffer: ${Hs(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const y=this.currentTime_()-ir;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${y}`),this.remove(0,y,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${ir}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=k.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3*ir)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){r&&(r.code!==dp?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:F.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const l=[r];let h=r.byteLength;i&&(l.unshift(i),h+=i.byteLength),n=f1({bytes:h,segments:l})}const a={segmentInfo:qs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return Ss(this),void this.loadQueue_.push(()=>{const t=ze({},e,{forceTimestampOffset:!0});ze(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||r&&n;this.logger_(`Requesting -${Op(e.uri)} -${li(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=l1({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:l,level:h,stream:p})=>{this.logger_(`${li(e)} logged from transmuxer stream ${p} as a ${h}: ${l}`)},triggerSegmentEventFn:({type:l,segment:h,keyInfo:p,trackInfo:g,timingInfo:y})=>{const w={segmentInfo:qs({segment:h})};p&&(w.keyInfo=p),g&&(w.trackInfo=g),y&&(w.timingInfo=y),this.trigger({type:l,metadata:w})}})}trimBackBuffer_(e){const t=L1(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===t.timeline&&(l.videoTimingInfo?a.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(a.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),t.key){const h=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=h}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e3*e.playlist.targetDuration,a=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(n||a)return this.logger_(`bad ${n?"segment":"part"} ${li(e)}`),void this.resetEverything();this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},U1=["video","audio"],Po=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},q1=(s,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type!=="mediaSource"){if(s!=="mediaSource"&&e.ready()&&e.mediaSource.readyState!=="closed"&&!Po(s,e)){if(i.type!==s){if(t=q1(s,e.queue),t===null)return;i=e.queue[t]}return e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),i.doneFn?void 0:(e.queuePending[s]=null,void Si(s,e))}}else e.updating()||e.mediaSource.readyState==="closed"||(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),Si("audio",e),Si("video",e))},Rp=(s,e)=>{const t=e[`${s}Buffer`],i=Np(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},zt=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Tt={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(zt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{n.appendBuffer(s)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===dp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,t(a)}}},remove:(s,e)=>(t,i)=>{const r=i[`${t}Buffer`];if(zt(i.mediaSource,r)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{r.remove(s,e)}catch{i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];zt(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){F.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){F.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(zt(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){F.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=Np(s),r=Ei(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(Rp(s,e),zt(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){F.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=Ei(s);if(!zt(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(h){l.errorType=F.Error.StreamingCodecsChangeError,l.error=h,h.metadata=l,t.error_=h,t.trigger("error"),F.log.warn(`Failed to changeType on ${e}Buffer`,h)}}},St=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),Si(s,e)},vd=(s,e)=>t=>{const i=a0(e[`${s}Buffered`]());if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,i),e.queuePending[s]){const r=e.queuePending[s].doneFn;e.queuePending[s]=null,r&&r(e[`${s}Error_`])}Si(s,e)};class Mp extends F.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Si("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=It("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=vd("video",this),this.onAudioUpdateEnd_=vd("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){St({type:"mediaSource",sourceUpdater:this,action:Tt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){St({type:e,sourceUpdater:this,action:Tt.abort(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?St({type:"mediaSource",sourceUpdater:this,action:Tt.removeSourceBuffer(e),name:"removeSourceBuffer"}):F.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!F.browser.IS_FIREFOX&&k.MediaSource&&k.MediaSource.prototype&&typeof k.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return k.SourceBuffer&&k.SourceBuffer.prototype&&typeof k.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?St({type:e,sourceUpdater:this,action:Tt.changeType(t),name:"changeType"}):F.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${n.length} until video append`);const a=t;if(St({type:r,sourceUpdater:this,action:Tt.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const l=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${l.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,l.forEach(h=>{this.appendBuffer.apply(this,h)})}}audioBuffered(){return zt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:gt()}videoBuffered(){return zt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:gt()}buffered(){const e=zt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=zt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():l0(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=cs){St({type:"mediaSource",sourceUpdater:this,action:Tt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=cs){typeof e!="string"&&(e=void 0),St({type:"mediaSource",sourceUpdater:this,action:Tt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=cs){this.audioBuffered().length&&this.audioBuffered().end(0)!==0?St({type:"audio",sourceUpdater:this,action:Tt.remove(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=cs){this.videoBuffered().length&&this.videoBuffered().end(0)!==0?St({type:"video",sourceUpdater:this,action:Tt.remove(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Po("audio",this)&&!Po("video",this))}audioTimestampOffset(e){return e!==void 0&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(St({type:"audio",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return e!==void 0&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(St({type:"video",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&St({type:"audio",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&St({type:"video",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),U1.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Rp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const bd=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),j1=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Td=new Uint8Array(` - -`.split("").map(s=>s.charCodeAt(0)));class H1 extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class $1 extends Io{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return gt();const e=this.subtitlesTrack_.cues;return gt([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=Td.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Td,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return e===void 0||(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){or(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",t),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Yt.TIMEOUT&&this.handleTimeout_(),e.code===Yt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof k.WebVTT!="function"&&typeof this.loadVttJs=="function")return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));n.requested=!0;try{this.parseVTTCues_(r)}catch(a){return void this.stopForError({message:a.message,metadata:{errorType:F.Error.StreamingVttParserError,error:a}})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new k.VTTCue(a.startTime,a.endTime,a.text):a)}),C1(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if(typeof k.WebVTT!="function")throw new H1;typeof k.TextDecoder=="function"?t=new k.TextDecoder("utf8"):(t=k.WebVTT.StringDecoder(),i=!0);const r=new k.WebVTT.Parser(k,k.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{F.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=bd(a)),r.parse(a)}let n=e.bytes;i&&(n=bd(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/js.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(h=>{const p=h.endTime-h.startTime,g=this.handleRollover_(h.startTime+l,t.time);h.startTime=Math.max(g,0),h.endTime=Math.max(g+p,0)}),!i.syncInfo){const h=e.cues[0].startTime,p=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(h,p-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*js.ONE_SECOND_IN_TS;const r=t*js.ONE_SECOND_IN_TS;let n;for(n=r4294967296;)i+=n;return i/js.ONE_SECOND_IN_TS}}const V1=function(s,e){const t=s.cues;for(let i=0;i=r.adStartTime&&e<=r.adEndTime)return r}return null},z1=function(s,e,t=0){if(!s.segments)return;let i,r=t;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Bp{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const r=new Map;let n=` -`,a=i,l=t;this.start_=a,e.forEach((h,p)=>{const g=this.storage_.get(l),y=a,w=y+h.duration,E=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),I=new Sd({start:y,end:w,appended:E,segmentIndex:p});h.syncInfo=I;let v=a;const L=(h.parts||[]).map((R,M)=>{const O=v,G=v+R.duration,N=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[M]&&g.partsSyncInfo[M].isAppended),z=new Sd({start:O,end:G,appended:N,segmentIndex:p,partIndex:M});return v=G,n+=`Media Sequence: ${l}.${M} | Range: ${O} --> ${G} | Appended: ${N} -`,R.syncInfo=z,z});r.set(l,new W1(I,L)),n+=`${Op(h.resolvedUri)} | Media Sequence: ${l} | Range: ${y} --> ${w} | Appended: ${E} -`,l++,a=w}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Ed extends Bp{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(e);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const G1=86400,so=[{name:"VOD",run:(s,e,t,i,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,r,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const l=a.getSyncInfoForTime(r);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const l=To(e);r=r||0;for(let h=0;h{let n=null,a=null;r=r||0;const l=To(e);for(let h=0;h=w)&&(a=w,n={time:y,segmentIndex:p.segmentIndex,partIndex:p.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,i,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let l=0;l=y)&&(a=y,n={time:g.time,segmentIndex:h,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class X1 extends F.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Bp,i=new Ed(t),r=new Ed(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=It("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return so.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const l of a){const{syncPoint:h,strategy:p}=l,{segmentIndex:g,time:y}=h;if(g<0)continue;const w=y,E=w+e.segments[g].duration;if(this.logger_(`Strategy: ${p}. Current time: ${r}. selected segment: ${g}. Time: [${w} -> ${E}]}`),r>=w&&r0&&(r.time*=-1),Math.abs(r.time+cr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let l=0;lG1)F.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let r=i-1;r>=0;r--){const n=e.segments[r];if(n&&n.start!==void 0){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-n.getTime()/1e3)}timestampOffsetForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].time}mappingForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,n=e.part;let a,l,h=this.timelines[e.timeline];if(typeof e.timestampOffset=="number")h={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=h,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${h.time}] [mapping: ${h.mapping}]`)),a=e.startOfSegment,l=t.end+h.mapping;else{if(!h)return!1;a=t.start+h.mapping,l=t.end+h.mapping}return n&&(n.start=a,n.end=l),(!r.start||ah){let p;p=l<0?i.start-cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:p,accuracy:h}}}}dispose(){this.trigger("dispose"),this.off()}}class Y1 extends F.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const K1=Ep(Cp(function(){var s=function(){function I(){this.listeners={}}var v=I.prototype;return v.on=function(L,R){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push(R)},v.off=function(L,R){if(!this.listeners[L])return!1;var M=this.listeners[L].indexOf(R);return this.listeners[L]=this.listeners[L].slice(0),this.listeners[L].splice(M,1),M>-1},v.trigger=function(L){var R=this.listeners[L];if(R)if(arguments.length===2)for(var M=R.length,O=0;O>7))^O]=O;for(G=N=0;!R[G];G^=H||1,N=U[N]||1)for(B=N^N<<1^N<<2^N<<3^N<<4,B=B>>8^255&B^99,R[G]=B,M[B]=G,A=z[S=z[H=z[G]]],W=16843009*A^65537*S^257*H^16843008*G,$=257*z[B]^16843008*B,O=0;O<4;O++)v[O][G]=$=$<<24^$>>>8,L[O][B]=W=W<<24^W>>>8;for(O=0;O<5;O++)v[O]=v[O].slice(0),L[O]=L[O].slice(0);return I};let i=null;class r{constructor(v){let L,R,M;i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];const O=this._tables[0][4],G=this._tables[1],N=v.length;let z=1;if(N!==4&&N!==6&&N!==8)throw new Error("Invalid aes key size");const U=v.slice(0),H=[];for(this._key=[U,H],L=N;L<4*N+28;L++)M=U[L-1],(L%N==0||N===8&&L%N==4)&&(M=O[M>>>24]<<24^O[M>>16&255]<<16^O[M>>8&255]<<8^O[255&M],L%N==0&&(M=M<<8^M>>>24^z<<24,z=z<<1^283*(z>>7))),U[L]=U[L-N]^M;for(R=0;L;R++,L--)M=U[3&R?L:L-4],H[R]=L<=4||R<4?M:G[0][O[M>>>24]]^G[1][O[M>>16&255]]^G[2][O[M>>8&255]]^G[3][O[255&M]]}decrypt(v,L,R,M,O,G){const N=this._key[1];let z,U,H,S=v^N[0],A=M^N[1],B=R^N[2],$=L^N[3];const W=N.length/4-2;let te,J=4;const oe=this._tables[1],Q=oe[0],Y=oe[1],ie=oe[2],se=oe[3],ee=oe[4];for(te=0;te>>24]^Y[A>>16&255]^ie[B>>8&255]^se[255&$]^N[J],U=Q[A>>>24]^Y[B>>16&255]^ie[$>>8&255]^se[255&S]^N[J+1],H=Q[B>>>24]^Y[$>>16&255]^ie[S>>8&255]^se[255&A]^N[J+2],$=Q[$>>>24]^Y[S>>16&255]^ie[A>>8&255]^se[255&B]^N[J+3],J+=4,S=z,A=U,B=H;for(te=0;te<4;te++)O[(3&-te)+G]=ee[S>>>24]<<24^ee[A>>16&255]<<16^ee[B>>8&255]<<8^ee[255&$]^N[J++],z=S,S=A,A=B,B=$,$=z}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(v){this.jobs.push(v),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(I){return I<<24|(65280&I)<<8|(16711680&I)>>8|I>>>24},l=function(I,v,L){const R=new Int32Array(I.buffer,I.byteOffset,I.byteLength>>2),M=new r(Array.prototype.slice.call(v)),O=new Uint8Array(I.byteLength),G=new Int32Array(O.buffer);let N,z,U,H,S,A,B,$,W;for(N=L[0],z=L[1],U=L[2],H=L[3],W=0;W{const R=I[L];y(R)?v[L]={bytes:R.buffer,byteOffset:R.byteOffset,byteLength:R.byteLength}:v[L]=R}),v};self.onmessage=function(I){const v=I.data,L=new Uint8Array(v.encrypted.bytes,v.encrypted.byteOffset,v.encrypted.byteLength),R=new Uint32Array(v.key.bytes,v.key.byteOffset,v.key.byteLength/4),M=new Uint32Array(v.iv.bytes,v.iv.byteOffset,v.iv.byteLength/4);new h(L,R,M,function(O,G){self.postMessage(E({source:v.source,decrypted:G}),[G.buffer])})}}));var Q1=Sp(K1);const J1=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Fp=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Up=(s,e)=>{e.activePlaylistLoader=s,s.load()},Z1=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),l=r.activePlaylistLoader,h=r.lastGroup_;a&&h&&a.id===h.id||(r.lastGroup_=a,r.lastTrack_=n,Fp(t,r),a&&!a.isMainPlaylist&&(a.playlistLoader?(t.resyncLoader(),Up(a.playlistLoader,r)):l&&i.resetEverything()))},e2=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},t2=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),h=n.activePlaylistLoader,p=n.lastTrack_;if((!p||!a||p.id!==a.id)&&(n.lastGroup_=l,n.lastTrack_=a,Fp(i,n),l)){if(l.isMainPlaylist){if(!a||!p||a.id===p.id)return;const g=e.vhs.playlistController_,y=g.selectPlaylist();return g.media()===y?void 0:(n.logger_(`track change. Switching main audio from ${p.id} to ${a.id}`),t.pause(),r.resetEverything(),void g.fastQualityChange_(y))}if(s==="AUDIO"){if(!l.playlistLoader)return r.setAudio(!0),void r.resetEverything();i.setAudio(!0),r.setAudio(!1)}h!==l.playlistLoader&&(i.track&&i.track(a),i.resetEverything()),Up(l.playlistLoader,n)}},In={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(h=>h.default)[0]||n[0]).id,l=t.tracks[a];if(r!==l){F.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const h in t.tracks)t.tracks[h].enabled=t.tracks[h]===l;t.onTrackChanged()}else i({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;F.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},Cd={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",In[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const l=e.media();n.playlist(l,r),n.track(a.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",In[s](s,t))}},s2={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:l,tracks:h,logger_:p}},mainPlaylistLoader:g}=e,y=wr(g.main);a[s]&&Object.keys(a[s]).length!==0||(a[s]={main:{default:{default:!0}}},y&&(a[s].main.default.playlists=g.main.playlists));for(const w in a[s]){l[w]||(l[w]=[]);for(const E in a[s][w]){let I,v=a[s][w][E];if(y?(p(`AUDIO group '${w}' label '${E}' is a main playlist`),v.isMainPlaylist=!0,I=null):I=i==="vhs-json"&&v.playlists?new mi(v.playlists[0],t,n):v.resolvedUri?new mi(v.resolvedUri,t,n):v.playlists&&i==="dash"?new xo(v.playlists[0],t,n,g):null,v=we({id:E,playlistLoader:I},v),Cd[s](s,v.playlistLoader,e),l[w].push(v),h[E]===void 0){const L=new F.AudioTrack({id:E,kind:J1(v),enabled:!1,language:v.language,default:v.default,label:E});h[E]=L}}}r.on("error",In[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[s]:{groups:h,tracks:p}},mainPlaylistLoader:g}=e;for(const y in l[s]){h[y]||(h[y]=[]);for(const w in l[s][y]){if(!i.options_.useForcedSubtitles&&l[s][y][w].forced)continue;let E,I=l[s][y][w];if(r==="hls")E=new mi(I.resolvedUri,i,a);else if(r==="dash"){if(!I.playlists.filter(v=>v.excludeUntil!==1/0).length)return;E=new xo(I.playlists[0],i,a,g)}else r==="vhs-json"&&(E=new mi(I.playlists?I.playlists[0]:I.resolvedUri,i,a));if(I=we({id:w,playlistLoader:E},I),Cd[s](s,I.playlistLoader,e),h[y].push(I),p[w]===void 0){const v=t.addRemoteTextTrack({id:w,kind:"subtitles",default:I.default&&I.autoselect,language:I.language,label:w},!1).track;p[w]=v}}}n.on("error",In[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:r,tracks:n}}}=e;for(const a in i[s]){r[a]||(r[a]=[]);for(const l in i[s][a]){const h=i[s][a][l];if(!/^(?:CC|SERVICE)/.test(h.instreamId))continue;const p=t.options_.vhs&&t.options_.vhs.captionServices||{};let g={label:l,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(p[g.instreamId]&&(g=we(g,p[g.instreamId])),g.default===void 0&&delete g.default,r[a].push(we({id:l},h)),n[l]===void 0){const y=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[l]=y}}}}},qp=(s,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:r}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[s]&&(a=r[n.attributes[s]]);const l=Object.keys(r);if(!a)if(s==="AUDIO"&&l.length>1&&wr(e.main))for(let h=0;hh.id===t.id)[0]||null},r2={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},n2=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},a2=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(p=>{s2[p](p,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:r,segmentLoaders:{AUDIO:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(p=>{e[p].activeGroup=i2(p,s),e[p].activeTrack=r2[p](p,s),e[p].onGroupChanged=Z1(p,s),e[p].onGroupChanging=e2(p,s),e[p].onTrackChanged=t2(p,s),e[p].getActiveGroup=n2(p,s)});const l=e.AUDIO.activeGroup();if(l){const p=(l.filter(g=>g.default)[0]||l[0]).id;e.AUDIO.tracks[p].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanging())});const h=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",h),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",h),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const p in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[p])},o2=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:cs,activeTrack:cs,getActiveGroup:cs,onGroupChanged:cs,onTrackChanged:cs,lastTrack_:null,logger_:It(`MediaGroups[${e}]`)}}),s};class wd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=vt(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class l2 extends F.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new wd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=It("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=vt(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410)return this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(a.status===429){const p=a.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${p} seconds.`),void this.startTTLTimeout_(parseInt(p,10))}return this.logger_(`manifest failed to load ${n}.`),void this.startTTLTimeout_()}let l;this.trigger({type:"contentsteeringloadcomplete",metadata:r});try{l=JSON.parse(this.request_.responseText)}catch(p){const g={errorType:F.Error.StreamingContentSteeringParserError,error:p};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(l);const h={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:h}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new k.URL(e),i=new k.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(k.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new k.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(i=>{for(const r of i)if(this.availablePathways_.has(r))return r;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=k.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){k.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new wd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(vt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const u2=10;let us;const h2=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],d2=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},c2=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:h}){if(!i)return F.log.warn("We received no playlist to switch to. Please check your stream."),!1;const p=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return h(`${p} as current playlist is not set`),!0;if(i.id===s.id)return!1;const g=!!pi(e,t).length;if(!s.endList)return g||typeof s.partTargetDuration!="number"?(h(`${p} as current playlist is live`),!0):(h(`not ${p} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const y=Zo(e,t),w=l?Je.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Je.MAX_BUFFER_LOW_WATER_LINE;if(aI)&&y>=r){let v=`${p} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return l&&(v+=` and next bandwidth > current bandwidth (${E} > ${I})`),h(v),!0}return h(`not ${p} as no switching criteria met`),!1};class p2 extends F.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:h,enableLowInitialPlaylist:p,sourceType:g,cacheEncryptionKeys:y,bufferBasedABR:w,leastPixelDiffSelector:E,captionServices:I,experimentalUseMMS:v}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:L}=e;L==null&&(L=1/0),us=a,this.bufferBasedABR=!!w,this.leastPixelDiffSelector=!!E,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=l,this.playlistExclusionDuration=h,this.maxPlaylistRetries=L,this.enableLowInitialPlaylist=p,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:L,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=o2(),v&&k.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new k.ManagedMediaSource,F.log("Using ManagedMediaSource")):k.MediaSource&&(this.mediaSource=new k.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=gt(),this.hasPlayed_=!1,this.syncController_=new X1(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Q1,this.sourceUpdater_=new Mp(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Y1,this.keyStatusMap_=new Map;const R={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:I,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new xo(t,this.vhs_,we(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new mi(t,this.vhs_,we(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Io(we(R,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Io(we(R,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new $1(we(R,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((G,N)=>{function z(){r.off("vttjserror",U),G()}function U(){r.off("vttjsloaded",z),N()}r.one("vttjsloaded",z),r.one("vttjserror",U),r.addWebVttScript_()})}),e);const M=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new l2(this.vhs_.xhr,M),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),h2.forEach(G=>{this[G+"_"]=d2.bind(this,G)}),this.logger_=It("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const O=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(O,()=>{const G=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-G,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const l={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const n=(i.length?i[0].playlists:i.playlists).filter(a=>a.attributes.serviceLocation===r);n.length&&this.mediaTypes_[e].activePlaylistLoader.media(n[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=k.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(k.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const l=i.main||r.length&&i[r[0]];for(const h in l)if(l[h].default){n={label:h};break}}if(!n)return t;const a=[];for(const l in i)if(i[l][n.label]){const h=i[l][n.label];if(h.playlists&&h.playlists.length)a.push.apply(a,h.playlists);else if(h.uri)a.push(h);else if(e.playlists.length)for(let p=0;p{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),a2({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!=="playlist-unchanged"&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,t=>{this.player_.trigger(ze({},t))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const l in i.AUDIO[a])i.AUDIO[a][l].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),us.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return c2({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const t=this.audioSegmentLoader_.pendingSegment_;if(!t||!t.segment||!t.segment.syncInfo)return;const i=t.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.mainSegmentLoader_.on("earlyabort",t=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:u2}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(t=>{this.mainSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))}),this.audioSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))}),this.subtitleSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(t===null)return!1;const i=us.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-r<=Xt;const a=n.end(n.length-1);return a-r<=Xt&&i-a<=Xt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void(this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Qn),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return F.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const I=this.pathwayAttribute_(e),v=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(I),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(I)},v)}let E=!1;r.forEach(I=>{if(I===e)return;const v=I.excludeUntil;v!==void 0&&v!==1/0&&(E=!0,delete I.excludeUntil)}),E&&(F.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;l=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const h=this.selectPlaylist();if(!h)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const p=t.internal?this.logger_:F.log.warn,g=t.message?" "+t.message:"";p(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${h.id}.`),h.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=h.targetDuration/2*1e3||5e3,w=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=y;return this.switchMedia_(h,"exclude",a||w)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r=e==="all";(r||e==="main")&&i.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const l=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;l&&i.push(l)}),["main","audio","subtitle"].forEach(a=>{const l=this[`${a}SegmentLoader_`];!l||e!==a&&e!=="all"||i.push(l)}),i.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){const t=pi(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:us.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(i===null)return;const r=this.mainPlaylistLoader_.main,n=us.Playlist.seekable(t,i,us.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),i===null||(e=us.Playlist.seekable(t,i,us.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,l;if(this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),l=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=gt([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=mr(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||df),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||qu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||qu,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const a=(p,g)=>p?lr(g):Da(g),l={};let h;if(["video","audio"].forEach(function(p){if(r.hasOwnProperty(p)&&!a(e[p].isFmp4,r[p])){const g=e[p].isFmp4?"browser":"muxer";l[g]=l[g]||[],l[g].push(r[p]),p==="audio"&&(h=g)}}),n&&h&&t.attributes.AUDIO){const p=t.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===p&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${p} as ${h} does not support codec(s): "${r.audio}"`)}if(!Object.keys(l).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const p=[];if(["video","audio"].forEach(g=>{const y=(Vt(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,w=(Vt(r[g]||"")[0]||{}).type;y&&w&&y.toLowerCase()!==w.toLowerCase()&&p.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),p.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${p.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}{const p=Object.keys(l).reduce((g,y)=>(g&&(g+=", "),g+=`${y} does not support codec(s): "${l[y].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:p},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=mr(this.main,r),a=[];!n.audio||Da(n.audio)||lr(n.audio)||a.push(`audio codec ${n.audio}`),!n.video||Da(n.video)||lr(n.video)||a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=kn(Vt(e)),n=cd(r),a=r.video&&Vt(r.video)[0]||null,l=r.audio&&Vt(r.audio)[0]||null;Object.keys(i).forEach(h=>{const p=i[h];if(t.indexOf(p.id)!==-1||p.excludeUntil===1/0)return;t.push(p.id);const g=[],y=mr(this.mainPlaylistLoader_.main,p),w=cd(y);if(y.audio||y.video){if(w!==n&&g.push(`codec count "${w}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&Vt(y.video)[0]||null,I=y.audio&&Vt(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${E.type}" !== "${a.type}"`),I&&l&&I.type.toLowerCase()!==l.type.toLowerCase()&&g.push(`audio codec "${I.type}" !== "${l.type}"`)}g.length&&(p.excludeUntil=1/0,this.logger_(`excluding ${p.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),z1(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Je.GOAL_BUFFER_LENGTH,i=Je.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Je.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Je.BUFFER_LOW_WATER_LINE,i=Je.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Je.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Je.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Je.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){gd(this.inbandTextTracks_,"com.apple.streaming",this.tech_),E1({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();gd(this.inbandTextTracks_,e,this.tech_),b1({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,t=>{this.trigger(ze({},t))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const r of e.playlists){const n=r.attributes.serviceLocation;if(n&&(i.push(n),!t.has(n)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let r=!1;Object.keys(t).forEach(n=>{const a=t[n],l=this.pathwayAttribute_(a),h=l&&e!==l;a.excludeUntil===1/0&&a.lastExcludeReason_==="content-steering"&&!h&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);const p=!a.excludeUntil&&a.excludeUntil!==1/0;!i.has(a.id)&&h&&p&&(i.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_="content-steering",this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(n=>{const a=this.mediaTypes_[n];if(a.activePlaylistLoader){const l=a.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[r,n]of t.entries())i.get(r)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(r));for(const[r,n]of i.entries()){const a=t.get(r);a?this.equalPathwayClones_(a,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter(l=>l.attributes["PATHWAY-ID"]===n["BASE-ID"]).forEach(l=>{this.mainPlaylistLoader_.addClonePathway(n,l)}),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==r[n])return!1;for(const n in r)if(i[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);r&&r.size&&r.forEach(n=>{const a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,h=i.lastExcludeReason_===t&&i.excludeUntil===1/0;l?l&&h&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;r&&n&&(delete i.excludeUntil,F.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const i=(typeof e=="string"?e:j1(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const m2=(s,e,t)=>i=>{const r=s.main.playlists[e],n=tl(r),a=Qn(r);if(i===void 0)return a;i?delete r.disabled:r.disabled=!0;const l={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return i===a||n||(t(r),i?s.trigger({type:"renditionenabled",metadata:l}):s.trigger({type:"renditiondisabled",metadata:l})),i};class g2{constructor(e,t,i){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=mr(r.main(),t),this.playlist=t,this.id=i,this.enabled=m2(e.playlists,t.id,n)}}const f2=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=wr(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!tl(i)).map((i,r)=>new g2(s,i,i.id)):[]}},Ad=["seeking","seeked","pause","playing","error"];class y2 extends F.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=It("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],h={};l.forEach(g=>{h[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},a[`${g}SegmentLoader_`].on("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].on("playlistupdate",h[g].reset),this.tech_.on(["seeked","seeking"],h[g].reset)});const p=g=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),p("off"))},this.clearSeekingAppendCheck_=()=>p("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),p("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Ad,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Ad,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(g=>{a[`${g}SegmentLoader_`].off("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].off("playlistupdate",h[g].reset),this.tech_.off(["seeked","seeking"],h[g].reset)}),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=k.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=h0(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};return t.trigger({type:"bufferedrangeschanged",metadata:a}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Hs(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Xt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(gt([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const w=e.start(0);i=w+(w===e.end(0)?0:Xt)}if(i!==void 0)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Zc(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const r=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),a=r.audioBuffer?r.audioBuffered():null,l=r.videoBuffer?r.videoBuffered():null,h=this.media(),p=h.partTargetDuration?h.partTargetDuration:2*(h.targetDuration-Gt),g=[a,l];for(let w=0;w ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const a=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${a}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(a),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=Kr(r,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Xt;const a=!i.endList,l=typeof i.partTargetDuration=="number";return a&&(l||r)&&(n=e.end(e.length-1)+3*i.targetDuration),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const _2={errorInterval:30,getSource(s){return s(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},jp=function(s,e){let t=0,i=0;const r=we(_2,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(g){g!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(g),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},l=function(){if(Date.now()-t<1e3*r.errorInterval)s.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(r.getSource&&typeof r.getSource=="function")return t=Date.now(),r.getSource.call(s,a);F.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},h=function(){s.off("loadedmetadata",n),s.off("error",l),s.off("dispose",h)},p=function(g){h(),jp(s,g)};s.on("error",l),s.on("dispose",h),s.reloadSourceOnError=p},v2=function(s){jp(this,s)};var Hp="3.14.2",b2="7.0.3",T2="1.3.0",S2="7.2.0",E2="4.0.2";const qe={PlaylistLoader:mi,Playlist:bt,utils:I0,STANDARD_PLAYLIST_SELECTOR:md,INITIAL_PLAYLIST_SELECTOR:g1,lastBandwidthSelector:md,movingAverageBandwidthSelector:p1,comparePlaylistBandwidth:rl,comparePlaylistResolution:c1,xhr:gp()};Object.keys(Je).forEach(s=>{Object.defineProperty(qe,s,{get:()=>(F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),Je[s]),set(e){F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0?F.log.warn(`value of Vhs.${s} must be greater than or equal to 0`):Je[s]=e}})});const $p="videojs-vhs",Vp=function(s,e){const t=e.media();let i=-1;for(let r=0;r{s.addQualityLevel(t)}),Vp(s,e.playlists)};qe.canPlaySource=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const w2=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=kn(Vt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=Ei(i.video),n=Ei(i.audio),a={};for(const l in s)a[l]={},n&&(a[l].audioContentType=n),r&&(a[l].videoContentType=r),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(a[l].pssh=e.contentProtection[l].pssh),typeof s[l]=="string"&&(a[l].url=s[l]);return we(s,a)},A2=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const l=i.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),x2=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=A2(r,Object.keys(e)),a=[],l=[];return n.forEach(h=>{l.push(new Promise((p,g)=>{s.tech_.one("keysessioncreated",p)})),a.push(new Promise((p,g)=>{s.eme.initializeMediaKeys({keySystems:h},y=>{y?g(y):p()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},k2=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=w2(e,t,i);return!!r&&(s.currentSource().keySystems=r,!(r&&!s.eme)||(F.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},zp=()=>{if(!k.localStorage)return null;const s=k.localStorage.getItem($p);if(!s)return null;try{return JSON.parse(s)}catch{return null}},D2=s=>{if(!k.localStorage)return!1;let e=zp();e=e?we(e,s):s;try{k.localStorage.setItem($p,JSON.stringify(e))}catch{return!1}return e},I2=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,Wp=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},Gp=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},Xp=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},Yp=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};qe.supportsNativeHls=function(){if(!re||!re.createElement)return!1;const s=re.createElement("video");return F.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(s.canPlayType(e))}):!1}(),qe.supportsNativeDash=!!(re&&re.createElement&&F.getTech("Html5").isSupported())&&/maybe|probably/i.test(re.createElement("video").canPlayType("application/dash+xml")),qe.supportsTypeNatively=s=>s==="hls"?qe.supportsNativeHls:s==="dash"&&qe.supportsNativeDash,qe.isSupported=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},qe.xhr.onRequest=function(s){Wp(qe.xhr,s)},qe.xhr.onResponse=function(s){Gp(qe.xhr,s)},qe.xhr.offRequest=function(s){Xp(qe.xhr,s)},qe.xhr.offResponse=function(s){Yp(qe.xhr,s)};const P2=F.getComponent("Component");class Kp extends P2{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=It("VhsHandler"),t.options_&&t.options_.playerId){const r=F.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(re,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=re.fullscreenElement||re.webkitFullscreenElement||re.mozFullScreenElement||re.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=we(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=this.source_.useBandwidthFromLocalStorage!==void 0?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=zp();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Je.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Je.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{this.source_[i]!==void 0&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=I2(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=qe,this.options_.sourceType=qd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new p2(this.options_);const i=we({liveRangeSafeTimeDelta:Xt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new y2(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=F.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a!="object"||a.code?typeof a=="string"&&(a={message:a,code:3}):a.code=3,n.error(a)});const r=this.options_.bufferBasedABR?qe.movingAverageBandwidthSelector(.55):qe.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=qe.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){const h=1e3*a.downlink*1e3;n=h>=l&&n>=l?Math.max(n,h):h}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return a=this.throughput>0?1/this.throughput:0,Math.floor(1/(n+a))},set(){F.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Hs(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Hs(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&D2({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{f2(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=k.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),x2({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=k2({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=F.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{C2(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Vp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Hp,"mux.js":b2,"mpd-parser":T2,"m3u8-parser":S2,"aes-decrypter":E2}}version(){return this.constructor.version()}canChangeType(){return Mp.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&k.URL.revokeObjectURL&&(k.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return B0({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return bp({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Wp(this.xhr,e)},this.xhr.onResponse=e=>{Gp(this.xhr,e)},this.xhr.offRequest=e=>{Xp(this.xhr,e)},this.xhr.offResponse=e=>{Yp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["gapjumped","playedrangeschanged"];["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.playlistController_.on(t,i=>{this.player_.trigger(ze({},i))})}),e.forEach(t=>{this.playbackWatcher_.on(t,i=>{this.player_.trigger(ze({},i))})})}}const Pn={name:"videojs-http-streaming",VERSION:Hp,canHandleSource(s,e={}){const t=we(F.options,e);return!(!t.vhs.experimentalUseMMS&&!lr("avc1.4d400d,mp4a.40.2",!1))&&Pn.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=we(F.options,t);return e.vhs=new Kp(s,e,i),e.vhs.xhr=gp(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=qd(s);if(!t)return"";const i=Pn.getOverrideNative(e);return!qe.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS),{overrideNative:i=t}=e;return i}};lr("avc1.4d400d,mp4a.40.2",!0)&&F.getTech("Html5").registerSourceHandler(Pn,0),F.VhsHandler=Kp,F.VhsSourceHandler=Pn,F.Vhs=qe,F.use||F.registerComponent("Vhs",qe),F.options.vhs=F.options.vhs||{},F.getPlugin&&F.getPlugin("reloadSourceOnError")||F.registerPlugin("reloadSourceOnError",v2);let Re=class extends Lo{constructor(){super(),this._defaultConfigs={autoplay:!1,fluid:!1,fullscreen:!1,loop:!1,muted:!1,preload:"auto",responsive:!1,startTime:0},this._prevPlayingState=!1,this.currentMetadata=null,this.element=null,this.mimeType=null,this.sensorModel=null,this.state="not-ready",this.waitingTimestamp=null,this._initController=()=>{!this._controller&&this.playerUrl&&(this.element=document.createElement("video"),F.log.level("error"),this._controller=F(this.element,this._defaultConfigs),this._controller.muted(this.muted),this._controller.loop(this.loop),this._controller.playbackRate(this.rate),this._controller.ready(this._handleReady),this._controller.on("canplay",this._handleCanPlay),this._controller.on("durationchange",this._handleDurationChange),this._controller.on("ended",this._handleEnded),this._controller.on("error",this._handleError),this._controller.on("loadeddata",this._handleDataLoaded),this._controller.on("loadedmetadata",this._handleLoadedMetadata),this._controller.on("loadstart",this._handleLoadStart),this._controller.on("play",this._handlePlay),this._controller.on("timeupdate",this._handleTimeUpdate),this._controller.on("waiting",this._handleWaiting),this._controller.on("xhr-hooks-ready",this._handleXHRhooksReady))},this._handleReady=()=>{this.state="ready"},this._handleCanPlay=()=>{this._prevPlayingState=this.state==="playing",this.state="can-play"},this._handleCueChange=()=>{if(!this.subtitleTrack?.activeCues?.length)return;const s=this.subtitleTrack?.activeCues[0],e=s.text?JSON.parse(s.text):null;if(!e?.data?.length)return;const t=e.data[0]?.value??[],i=new Map;for(const r of t)Array.isArray(r.value)?r.tagId===90064?i.set(r.tagId,r):r.value.forEach(n=>{i.set(n.tagId,n)}):i.set(r.tagId,r);i.set(ne.EsriVideoWidth,{name:"Video Width",tagId:ne.EsriVideoWidth,value:this._controller?.videoWidth()}),i.set(ne.EsriVideoHeight,{name:"Video Height",tagId:ne.EsriVideoHeight,value:this._controller?.videoHeight()}),this.currentMetadata=new Map(i),this.sensorModel=new Mg({videoMetadata:this.currentMetadata})},this._handleDataLoaded=()=>{this.state="data-loaded",this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleDurationChange=()=>this.notifyChange("duration"),this._handleEnded=()=>{if(!this.loop)return this._set("ended",!0),this.notifyChange("buffered"),this.notifyChange("currentTime"),this.notifyChange("duration"),this.notifyChange("waiting"),void(this.state="can-play");this.setCurrentTime(0),this.play()},this._handleError=()=>{tg.getLogger(this).error("video stream error ::",this._controller?.error())},this._handleLoadStart=()=>{this.state="can-play"},this._handleLoadedMetadata=()=>{this.notifyChange("subtitleTrack"),this.notifyChange("buffered")},this._handlePlay=()=>this.notifyChange("ended"),this._handleTimeUpdate=()=>{this.notifyChange("currentTime"),this.notifyChange("buffered"),this.notifyChange("bufferedPercent"),this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleWaiting=()=>{this.waitingTimestamp=this._controller?.currentTime()},this._handleXHRhooksReady=()=>{const s=e=>(e.xhr=new ui,e);this._controller?.tech(!0)?.vhs.xhr.onRequest(s)}}initialize(){this.addHandles([nn(()=>this.playerUrl,s=>{s&&(this._initController(),this.mimeType=xg(s),this._controller?.src({type:this.mimeType,src:this.playerUrl}))},xd),nn(()=>this.subtitleTrack,()=>{this.subtitleTrack&&(this.subtitleTrack.mode="showing")})]),this.addHandles(sg(()=>this.subtitleTrack,"cuechange",this._handleCueChange))}destroy(){this._controller?.dispose()}get buffered(){return this._controller?.bufferedEnd()??0}get bufferedPercent(){return this._controller?.bufferedPercent()??0}get currentTime(){return this._controller?.currentTime()??0}get duration(){return this._controller?.duration()??0}get ended(){return this._controller?.ended()??this._get("ended")??!0}set ended(s){this._controller?.ended(s),this._set("ended",s)}get loop(){return this._controller?.loop()??this._get("loop")??!1}set loop(s){this._controller?.loop(s),this._set("loop",s)}get muted(){return this._controller?.muted()??this._get("muted")??!1}set muted(s){this._controller?.muted(s),this._set("muted",s)}get playerUrl(){return this._controller?.src()||""}set playerUrl(s){this._set("playerUrl",s)}get playing(){return!this.ended&&(this.state==="can-play"?this._prevPlayingState:this.state==="playing")}get rate(){return this._controller?.playbackRate()??this._get("rate")??1}set rate(s){this._controller?.playbackRate(s),this._set("rate",s)}get started(){return this._controller?.hasStarted()||!1}get subtitleTrack(){const s=this._controller?.textTracks();return s?.length?Array.from(s).find(e=>e.kind==="subtitles"):null}get waiting(){return!this.waitingTimestamp&&(this.waitingTimestamp===this.currentTime||(this.waitingTimestamp=null,!1))}pause(){this._controller?.pause(),this.state="paused"}play(){this._controller?.play(),this.state="playing"}reset(){this._controller&&(this.pause(),this.setCurrentTime(0),this._set("ended",!0))}setCurrentTime(s){const e=kd(s,0,this.duration);this._controller?.currentTime(e),this.notifyChange("currentTime")}};K([Z()],Re.prototype,"buffered",null),K([Z()],Re.prototype,"bufferedPercent",null),K([Z({readOnly:!0})],Re.prototype,"currentTime",null),K([Z()],Re.prototype,"currentMetadata",void 0),K([Z({readOnly:!0})],Re.prototype,"duration",null),K([Z()],Re.prototype,"element",void 0),K([Z({readOnly:!0})],Re.prototype,"ended",null),K([Z()],Re.prototype,"loop",null),K([Z()],Re.prototype,"mimeType",void 0),K([Z()],Re.prototype,"muted",null),K([Z()],Re.prototype,"playerUrl",null),K([Z({readOnly:!0})],Re.prototype,"playing",null),K([Z()],Re.prototype,"rate",null),K([Z()],Re.prototype,"sensorModel",void 0),K([Z({readOnly:!0})],Re.prototype,"started",null),K([Z()],Re.prototype,"state",void 0),K([Z()],Re.prototype,"subtitleTrack",null),K([Z({readOnly:!0})],Re.prototype,"videoHeight",void 0),K([Z({readOnly:!0})],Re.prototype,"videoWidth",void 0),K([Z({readOnly:!0})],Re.prototype,"waiting",null),K([Z()],Re.prototype,"waitingTimestamp",void 0),Re=K([Ds("esri.layers.video.VideoController")],Re);const L2=Re;let pe=class extends ng(og(ig(ag(rg)))){constructor(s){super(s),this._trailPoints=[],this.capabilities=null,this.connectionInfo=null,this.controller=new L2,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCount=null,this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=Zr.WGS84,this.telemetryDisplay=null,this.title=null,this.type="video",this.url=null,this.videoLayersInfo=null,this.videoTimeExtent=null}initialize(){this.telemetryDisplay=new Dd({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([nn(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),nn(()=>this.telemetry?.sensorLocation,s=>this._setSensorTrail(s),xd)])}load(s){const e=s!=null?s.signal:null;return this.addResolvingPromise(this._fetchService(e)),Promise.resolve(this)}get buffered(){return this.controller.buffered}readCapabilitiesFromService(s,e){return hg(e)}readConnectionInfo(s,e){const t=Object.values(e.connectionUrl);return t?.length&&(this.controller.playerUrl=t[0]),e.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return wg(this.metadata)}get groundControlPoints(){return Cg(this.metadata)}get loop(){return this.controller.loop}set loop(s){this.controller.loop=s}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(s){this.controller.muted=s}get playbackRate(){return this.controller.rate}set playbackRate(s){this.controller.rate=s}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get state(){return this.controller.state}get telemetry(){return Eg(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(s,e){return kg(e)}get videoWidth(){return this.controller?.videoWidth}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(s){if(!this.duration)return;const e=kd(s,0,this.duration);this.controller.setCurrentTime(e)}toGround(s,e){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(s,e):null}toVideo(s){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const e=this.controller.sensorModel.transformGeoToImage(s.x,s.y,s.z);return{x:e[0],y:e[1]}}async _fetchService(s){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const e=lg(this.parsedUrl?.path);if(e==null)throw new Vl("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let t=null;const{data:i,ssl:r}=await ro(e.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:s}),n=i;if(this.url=e.url.path,r&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let a=e?.sublayer;if(a==null&&n.layers?.length&&(a=n.layers[0].id),a==null)throw new Vl("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${e.url.path}/${a}`,t=await ro(this.url,{query:{f:"json",...this.customParameters},signal:s});const l={...n,...t.data};this.sourceJSON=l,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(s){if(!s)return;const e=Sg(s,this._trailPoints);this._trailPoints=[...e];const t=this._trailPoints.map(r=>r.toArray()),i=new rn({hasZ:s.hasZ,paths:[t]});this.telemetry.sensorTrail=i.clone()}};K([Z({readOnly:!0})],pe.prototype,"buffered",null),K([Z({readOnly:!0,json:{read:!1}})],pe.prototype,"capabilities",void 0),K([gi("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsUpdate"])],pe.prototype,"readCapabilitiesFromService",null),K([Z({readOnly:!0})],pe.prototype,"connectionInfo",void 0),K([gi("connectionInfo",["connectionUrl"])],pe.prototype,"readConnectionInfo",null),K([Z()],pe.prototype,"controller",void 0),K([Z({type:String})],pe.prototype,"copyright",void 0),K([Z({readOnly:!0,type:Date})],pe.prototype,"created",void 0),K([Z({type:Number})],pe.prototype,"currentTime",null),K([Z({type:String})],pe.prototype,"description",void 0),K([Z({type:Number})],pe.prototype,"duration",null),K([Z({readOnly:!0})],pe.prototype,"elevationSource",void 0),K([Z({type:Boolean})],pe.prototype,"ended",null),K([Z({type:_g})],pe.prototype,"frame",void 0),K([Z({readOnly:!0,type:Number})],pe.prototype,"frameCount",void 0),K([Z({type:zl})],pe.prototype,"fullExtent",void 0),K([Z({readOnly:!0})],pe.prototype,"frameHorizonPoints",null),K([Z({readOnly:!0})],pe.prototype,"groundControlPoints",null),K([Z({type:zl})],pe.prototype,"initialExtent",void 0),K([Z({readOnly:!0,json:{read:{source:"id"}}})],pe.prototype,"layerId",void 0),K([Z({type:Boolean})],pe.prototype,"loop",null),K([Z({readOnly:!0})],pe.prototype,"metadata",null),K([Z({readOnly:!0})],pe.prototype,"mimeType",null),K([Z({type:Boolean})],pe.prototype,"muted",null),K([Z({type:fg})],pe.prototype,"playbackInfo",void 0),K([Z({type:Number})],pe.prototype,"playbackRate",null),K([Z({type:String})],pe.prototype,"playerUrl",null),K([Z({readOnly:!0})],pe.prototype,"playing",null),K([Z({readOnly:!0,json:{read:{source:"poster"}}})],pe.prototype,"posterUrl",void 0),K([Z({readOnly:!0})],pe.prototype,"qualities",void 0),K([Z({readOnly:!0})],pe.prototype,"serviceItemId",void 0),K([Z()],pe.prototype,"sourceJSON",void 0),K([Z({readOnly:!0})],pe.prototype,"sourceQuality",void 0),K([Z({readOnly:!0,json:{name:"serviceType"}})],pe.prototype,"sourceType",void 0),K([Z()],pe.prototype,"spatialReference",void 0),K([Z({readOnly:!0,type:String})],pe.prototype,"state",null),K([Z({readOnly:!0,type:no})],pe.prototype,"telemetry",null),K([Z({type:Dd})],pe.prototype,"telemetryDisplay",void 0),K([Z({readOnly:!1,json:{read:{source:"name"}}})],pe.prototype,"title",void 0),K([Z({readOnly:!0})],pe.prototype,"type",void 0),K([Z(ug)],pe.prototype,"url",void 0),K([Z({readOnly:!0})],pe.prototype,"videoElement",null),K([Z({readOnly:!0})],pe.prototype,"videoHeight",null),K([Z({readOnly:!0,json:{read:!1}})],pe.prototype,"videoLayersInfo",void 0),K([gi("service","videoLayersInfo",["id","name","poster","serviceType","type"])],pe.prototype,"readLayerInfosFromService",null),K([Z({readOnly:!0,nonNullable:!1,json:{read:{reader:Tg,source:"time"}}})],pe.prototype,"videoTimeExtent",void 0),K([Z({readOnly:!0})],pe.prototype,"videoWidth",null),K([Z({readOnly:!0})],pe.prototype,"waiting",null),pe=K([Ds("esri.layers.VideoLayer")],pe);const iv=pe;export{iv as default}; diff --git a/main/assets/VideoLayerView2D-CLcxq4ZA-BYf0Uwhu.js b/main/assets/VideoLayerView2D-CLcxq4ZA-BYf0Uwhu.js deleted file mode 100644 index 20b6c6e98..000000000 --- a/main/assets/VideoLayerView2D-CLcxq4ZA-BYf0Uwhu.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as I,bi as v,eC as k,eB as q,eD as U,aA as F,ah as M,aL as b,v as C,S as V,i as B,au as $,aF as j,L as J,hT as K,l as N,as as z,w as R}from"./main-BZaw9FpY.js";import Z from"./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js";import{a as W}from"./TelemetryDisplay-Bq2PXfI8-BWfBxjew.js";import{A as Q}from"./OverlayContainer-BEHcBpu0-D3apgE9b.js";import{o as tt}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{K as g}from"./projection-BA9M1R7d-DoNqITCd.js";import{T as et}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{X as it,A as rt,Y as st}from"./LayerView-Bish-E63-DRGspiuk.js";import{G as ot}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as nt,V as at}from"./Texture-BCt2hphT-D-X9O5uh.js";import{d as lt}from"./GraphicContainer-DuOHUciE-BvzcbTDZ.js";import{X as mt}from"./GraphicsView2D-C4wYE2ut-zRbzrMcC.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-R53oZrzO.js";import"./UpdateTracking2D-Du_WIf4G-lOu4AoIx.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./AGraphicContainer-LUCT6Gle-CGns4AG2.js";import"./TechniqueInstance-DGTKoOL6-DTmGWHpp.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./AttributeStore-DjyP9U7y-BoiLAPK2.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js";const x=2;class ht extends et{constructor(t){super(),this.element=t,this._handles=new $,this.isWrapAround=!1,this.perspectiveTransform=tt(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(j(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(J(e,"play",()=>this.requestRender()))},b))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=K(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(e==null)return;const{context:s}=t,{videoWidth:a,videoHeight:r}=e;if(a!==0&&r!==0){if(this.texture)e.paused||this.texture.setData(e);else{const i=new nt;i.wrapMode=ot.CLAMP_TO_EDGE,i.preMultiplyAlpha=!0,i.width=a,i.height=r,this.texture=new at(s,i,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,s,a){const r=this.element,i=this._getFrameInfo();if(!r||!i)return;this._initializeData(t,i,s);const{controlPoints:l,horizon:h}=i,m=Math.sqrt(l.length),p=m,{x:o,y}=t,u=this._vertices,T=l[0],G=l[m-1],X=l[(p-1)*m],Y=l[(p-1)*m+m-1],O=g(h?h[0].mapPoint:T.mapPoint,s),P=g(h?h[1].mapPoint:G.mapPoint,s),f=g(X.mapPoint,s),L=g(Y.mapPoint,s);this.clipGeometry=h?new rt({geometry:N.fromJSON({rings:[[[f.x,f.y],[L.x,L.y],[P.x,P.y],[O.x,O.y],[f.x,f.y]]],spatialReference:s})}):null;for(let c=0;cw?D=S:E>H&&ci)),r=this.element.videoWidth/a;for(let i=0;ithis.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},b)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new W({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new Q,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new mt({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new lt(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([M(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),b),M(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),b)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=F(this.graphicsView)}supportsSpatialReference(n){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(n){this.graphicsView.processUpdate(n)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:n}=this.layer,{visibleTelemetryElements:t}=this;n&&t&&(t.frameOutline&&n.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&n.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&n.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&n.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&n.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const n=new ht(this.layer.videoElement);this.addAttachHandles([M(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints],()=>{const{visibleTelemetryElements:t}=this;t?.frame?(n.frameHorizonPoints=this.layer.frameHorizonPoints,n.groundControlPoints=this.layer.groundControlPoints,n.opacity=1):n.opacity=0},b)]),this._overlayContainer.addChild(n),this.view.stage.requestRender()}};C([V()],d.prototype,"graphicsView",void 0),C([V()],d.prototype,"layer",void 0),C([V()],d.prototype,"symbolColor",void 0),C([V({type:W})],d.prototype,"visibleTelemetryElements",void 0),d=C([B("esri.views.2d.layers.VideoLayerView2D")],d);const di=d;export{di as default}; diff --git a/main/assets/VideoLayerView2D-CLcxq4ZA-DOxIETBk.js b/main/assets/VideoLayerView2D-CLcxq4ZA-DOxIETBk.js new file mode 100644 index 000000000..a8510d8b1 --- /dev/null +++ b/main/assets/VideoLayerView2D-CLcxq4ZA-DOxIETBk.js @@ -0,0 +1 @@ +import{ar as I,bi as v,eC as k,eB as q,eD as U,aA as F,ah as M,aL as b,v as C,S as V,i as B,au as $,aF as j,L as J,hT as K,l as N,as as z,w as R}from"./main-C7yV2j71.js";import Z from"./GraphicsLayer-DfeGaYc1-DAZy-iUY.js";import{a as W}from"./TelemetryDisplay-Bq2PXfI8-8bnvuClQ.js";import{A as Q}from"./OverlayContainer-BEHcBpu0-Bl-u4lo3.js";import{o as tt}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{K as g}from"./projection-BA9M1R7d-DXrPfsKU.js";import{T as et}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{X as it,A as rt,Y as st}from"./LayerView-Bish-E63-I2LV0oDm.js";import{G as ot}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as nt,V as at}from"./Texture-BCt2hphT-CtQVMDnp.js";import{d as lt}from"./GraphicContainer-DuOHUciE-dHT2kH0f.js";import{X as mt}from"./GraphicsView2D-C4wYE2ut-Vnl9UY_2.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-iLonUkVX.js";import"./UpdateTracking2D-Du_WIf4G-BtTSzMGH.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-B3_wQtO7.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./AGraphicContainer-LUCT6Gle-DajlweKQ.js";import"./TechniqueInstance-DGTKoOL6-C7NzYd8c.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./AttributeStore-DjyP9U7y-Du97X0SU.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js";const x=2;class ht extends et{constructor(t){super(),this.element=t,this._handles=new $,this.isWrapAround=!1,this.perspectiveTransform=tt(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(j(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(J(e,"play",()=>this.requestRender()))},b))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=K(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(e==null)return;const{context:s}=t,{videoWidth:a,videoHeight:r}=e;if(a!==0&&r!==0){if(this.texture)e.paused||this.texture.setData(e);else{const i=new nt;i.wrapMode=ot.CLAMP_TO_EDGE,i.preMultiplyAlpha=!0,i.width=a,i.height=r,this.texture=new at(s,i,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,s,a){const r=this.element,i=this._getFrameInfo();if(!r||!i)return;this._initializeData(t,i,s);const{controlPoints:l,horizon:h}=i,m=Math.sqrt(l.length),p=m,{x:o,y}=t,u=this._vertices,T=l[0],G=l[m-1],X=l[(p-1)*m],Y=l[(p-1)*m+m-1],O=g(h?h[0].mapPoint:T.mapPoint,s),P=g(h?h[1].mapPoint:G.mapPoint,s),f=g(X.mapPoint,s),L=g(Y.mapPoint,s);this.clipGeometry=h?new rt({geometry:N.fromJSON({rings:[[[f.x,f.y],[L.x,L.y],[P.x,P.y],[O.x,O.y],[f.x,f.y]]],spatialReference:s})}):null;for(let c=0;cw?D=S:E>H&&ci)),r=this.element.videoWidth/a;for(let i=0;ithis.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},b)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new W({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new Q,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new mt({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new lt(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([M(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),b),M(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),b)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=F(this.graphicsView)}supportsSpatialReference(n){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(n){this.graphicsView.processUpdate(n)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:n}=this.layer,{visibleTelemetryElements:t}=this;n&&t&&(t.frameOutline&&n.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&n.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&n.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&n.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&n.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const n=new ht(this.layer.videoElement);this.addAttachHandles([M(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints],()=>{const{visibleTelemetryElements:t}=this;t?.frame?(n.frameHorizonPoints=this.layer.frameHorizonPoints,n.groundControlPoints=this.layer.groundControlPoints,n.opacity=1):n.opacity=0},b)]),this._overlayContainer.addChild(n),this.view.stage.requestRender()}};C([V()],d.prototype,"graphicsView",void 0),C([V()],d.prototype,"layer",void 0),C([V()],d.prototype,"symbolColor",void 0),C([V({type:W})],d.prototype,"visibleTelemetryElements",void 0),d=C([B("esri.views.2d.layers.VideoLayerView2D")],d);const di=d;export{di as default}; diff --git a/main/assets/ViewshedLayer-BYX-h7eL-BtdySDnr.js b/main/assets/ViewshedLayer-BYX-h7eL-BtdySDnr.js new file mode 100644 index 000000000..7f1d4d41f --- /dev/null +++ b/main/assets/ViewshedLayer-BYX-h7eL-BtdySDnr.js @@ -0,0 +1 @@ +import{bA as C,dM as H,v as t,S as i,w as J,ad as K,ab as U,i as F,ag as A,eb as X,ah as L,ax as P,ac as Y,aP as G,am as Z,n as k,bj as N,ae as q}from"./main-C7yV2j71.js";import{n as B,u as I}from"./featureReferenceUtils-Ct4KY5u7-Cgw_hpcQ.js";import{c as g}from"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import{y as Q}from"./Analysis-BPgJ-FCw-Bdup4FTz.js";import{X as W}from"./projection-BA9M1R7d-DXrPfsKU.js";import{m as ee}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as te}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-CiIWUavi.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CdQQbSdq.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-DhJ9Zyo3.js";import"./lineSegment-CcqvCARM-_ZNy9SM-.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";let o=class extends C(G){constructor(e){super(e),this.observer=null,this.farDistance=1e3,this.heading=0,this.tilt=90,this.horizontalFieldOfView=45,this.verticalFieldOfView=45,this.feature=null}isValid(){return this.observer!=null&&this.farDistance>0}equals(e){return H(this.observer,e.observer)&&this.farDistance===e.farDistance&&this.heading===e.heading&&this.tilt===e.tilt&&this.horizontalFieldOfView===e.horizontalFieldOfView&&this.verticalFieldOfView===e.verticalFieldOfView&&B(this.feature,e.feature)}};t([i({type:J,json:{write:!0}})],o.prototype,"observer",void 0),t([i({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],o.prototype,"farDistance",void 0),t([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),K(e=>g.normalize(U(e),void 0,!0))],o.prototype,"heading",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"tilt",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}})],o.prototype,"horizontalFieldOfView",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"verticalFieldOfView",void 0),t([i(I)],o.prototype,"feature",void 0),t([i({json:{read:!1}})],o.prototype,"isValid",null),o=t([F("esri.analysis.Viewshed")],o);const T=o,E=A.ofType(T);let p=class extends Q{constructor(e){super(e),this.type="viewshed",this._extent=null}initialize(){this.addHandles(L(()=>this._computeExtent(),e=>{e.pending==null&&(this._extent=e.extent)},P))}get viewsheds(){return this._get("viewsheds")||new E}set viewsheds(e){this._set("viewsheds",Z(e,this.viewsheds,E))}get spatialReference(){for(const e of this.viewsheds)if(e.observer!=null)return e.observer.spatialReference;return null}get extent(){return this._extent}get requiredPropertiesForEditing(){return this.viewsheds.items.map(({observer:e})=>e)}async waitComputeExtent(){const e=this._computeExtent();e.pending!=null&&await e.pending}_computeExtent(){const{spatialReference:e}=this;if(e==null)return{pending:null,extent:null};const s=this.viewsheds.filter(r=>r.observer!=null),c=s.map(r=>r.observer).toArray(),l=W(c,e);return l.pending!=null?{pending:l.pending,extent:null}:{pending:null,extent:l.geometries.map((r,u)=>{const x=s.at(u);return r!=null&&x!=null?this._computeViewshedExtent(this.viewsheds.at(u),r):null}).filter(r=>r!=null).reduce((r,u)=>re(r,u),null)}}_computeViewshedExtent(e,s){const{farDistance:c,heading:l,tilt:r,horizontalFieldOfView:u,verticalFieldOfView:x}=e,{spatialReference:j}=s,b=u/2,V=x/2,O=c/j.metersPerUnit,$=[g.normalize(l-b),l,g.normalize(l+b)],d=k.fromPoint(s),f=w=>{const h=$.map(a=>g.normalize(a-w));if(h[0]>h[2]||u===360)return O;const m=h.map(a=>Math.abs(a>180?360-a:a)).reduce((a,v)=>a>v?v:a);return m>90?0:O*Math.cos(N(m))};d.xmax+=f(90),d.xmin-=f(-90),d.ymax+=f(0),d.ymin-=f(180);const y=s.z;if(y!=null){let w=y,h=y;const m=r-90,a=q(m+V,-90,90),v=q(m-V,-90,90),z=j?.isGeographic?c:O;w+=z*R(a),h+=z*R(v);const S=M(V)*z,_=R(m)*S*(1-M(b));r<90&&(w-=_),r>90&&(h-=_),d.zmax=Math.max(w,y),d.zmin=Math.min(h,y)}return d}clear(){this.viewsheds.removeAll()}};function re(e,s){return e==null?s:s==null?e:e.union(s)}function M(e){return Math.cos(N(e))}function R(e){return Math.sin(N(e))}t([i({type:["viewshed"]})],p.prototype,"type",void 0),t([i({cast:X,type:E,nonNullable:!0})],p.prototype,"viewsheds",null),t([i({readOnly:!0})],p.prototype,"spatialReference",null),t([i()],p.prototype,"_extent",void 0),t([i({readOnly:!0})],p.prototype,"extent",null),t([i({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([F("esri.analysis.ViewshedAnalysis")],p);const D=p;let n=class extends ie(ee(te)){constructor(e){super(e),this.type="viewshed",this.operationalLayerType="ViewshedLayer",this.source=new D,this.opacity=1}initialize(){this.addHandles(L(()=>this.source,(e,s)=>{s!=null&&s.parent===this&&(s.parent=null),e!=null&&(e.parent=this)},P))}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new D)}get analysis(){return this.source}set analysis(e){this.source=e}get viewsheds(){return this.source.viewsheds}set viewsheds(e){this.source.viewsheds=e}writeViewsheds(e,s,c,l){s.viewsheds=e.filter(r=>r.isValid()).map(r=>r.toJSON(l)).toJSON()}};t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i({type:["ViewshedLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0})],n.prototype,"source",void 0),t([i({readOnly:!0})],n.prototype,"spatialReference",null),t([i({readOnly:!0})],n.prototype,"fullExtent",null),t([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],n.prototype,"opacity",void 0),t([i({type:["show","hide"]})],n.prototype,"listMode",void 0),t([i({type:A.ofType(T),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],n.prototype,"viewsheds",null),t([Y("web-scene","viewsheds")],n.prototype,"writeViewsheds",null),n=t([F("esri.layers.ViewshedLayer")],n);const Me=n;export{Me as default}; diff --git a/main/assets/ViewshedLayer-BYX-h7eL-CBz4CWxL.js b/main/assets/ViewshedLayer-BYX-h7eL-CBz4CWxL.js deleted file mode 100644 index 880dac1ca..000000000 --- a/main/assets/ViewshedLayer-BYX-h7eL-CBz4CWxL.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as C,dM as H,v as t,S as i,w as J,ad as K,ab as U,i as F,ag as A,eb as X,ah as L,ax as P,ac as Y,aP as G,am as Z,n as k,bj as N,ae as q}from"./main-BZaw9FpY.js";import{n as B,u as I}from"./featureReferenceUtils-Ct4KY5u7-ByRyweVx.js";import{c as g}from"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import{y as Q}from"./Analysis-BPgJ-FCw-72MMAaCQ.js";import{X as W}from"./projection-BA9M1R7d-DoNqITCd.js";import{m as ee}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as te}from"./Layer-ChoECxvZ-C4wLrCej.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-CgNvGf8s.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-fuXvBrPY.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-BetNH2zh.js";import"./lineSegment-CcqvCARM-D_SdPttv.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";let o=class extends C(G){constructor(e){super(e),this.observer=null,this.farDistance=1e3,this.heading=0,this.tilt=90,this.horizontalFieldOfView=45,this.verticalFieldOfView=45,this.feature=null}isValid(){return this.observer!=null&&this.farDistance>0}equals(e){return H(this.observer,e.observer)&&this.farDistance===e.farDistance&&this.heading===e.heading&&this.tilt===e.tilt&&this.horizontalFieldOfView===e.horizontalFieldOfView&&this.verticalFieldOfView===e.verticalFieldOfView&&B(this.feature,e.feature)}};t([i({type:J,json:{write:!0}})],o.prototype,"observer",void 0),t([i({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],o.prototype,"farDistance",void 0),t([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),K(e=>g.normalize(U(e),void 0,!0))],o.prototype,"heading",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"tilt",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}})],o.prototype,"horizontalFieldOfView",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"verticalFieldOfView",void 0),t([i(I)],o.prototype,"feature",void 0),t([i({json:{read:!1}})],o.prototype,"isValid",null),o=t([F("esri.analysis.Viewshed")],o);const T=o,E=A.ofType(T);let p=class extends Q{constructor(e){super(e),this.type="viewshed",this._extent=null}initialize(){this.addHandles(L(()=>this._computeExtent(),e=>{e.pending==null&&(this._extent=e.extent)},P))}get viewsheds(){return this._get("viewsheds")||new E}set viewsheds(e){this._set("viewsheds",Z(e,this.viewsheds,E))}get spatialReference(){for(const e of this.viewsheds)if(e.observer!=null)return e.observer.spatialReference;return null}get extent(){return this._extent}get requiredPropertiesForEditing(){return this.viewsheds.items.map(({observer:e})=>e)}async waitComputeExtent(){const e=this._computeExtent();e.pending!=null&&await e.pending}_computeExtent(){const{spatialReference:e}=this;if(e==null)return{pending:null,extent:null};const s=this.viewsheds.filter(r=>r.observer!=null),c=s.map(r=>r.observer).toArray(),l=W(c,e);return l.pending!=null?{pending:l.pending,extent:null}:{pending:null,extent:l.geometries.map((r,u)=>{const x=s.at(u);return r!=null&&x!=null?this._computeViewshedExtent(this.viewsheds.at(u),r):null}).filter(r=>r!=null).reduce((r,u)=>re(r,u),null)}}_computeViewshedExtent(e,s){const{farDistance:c,heading:l,tilt:r,horizontalFieldOfView:u,verticalFieldOfView:x}=e,{spatialReference:j}=s,b=u/2,V=x/2,O=c/j.metersPerUnit,$=[g.normalize(l-b),l,g.normalize(l+b)],d=k.fromPoint(s),f=w=>{const h=$.map(a=>g.normalize(a-w));if(h[0]>h[2]||u===360)return O;const m=h.map(a=>Math.abs(a>180?360-a:a)).reduce((a,v)=>a>v?v:a);return m>90?0:O*Math.cos(N(m))};d.xmax+=f(90),d.xmin-=f(-90),d.ymax+=f(0),d.ymin-=f(180);const y=s.z;if(y!=null){let w=y,h=y;const m=r-90,a=q(m+V,-90,90),v=q(m-V,-90,90),z=j?.isGeographic?c:O;w+=z*R(a),h+=z*R(v);const S=M(V)*z,_=R(m)*S*(1-M(b));r<90&&(w-=_),r>90&&(h-=_),d.zmax=Math.max(w,y),d.zmin=Math.min(h,y)}return d}clear(){this.viewsheds.removeAll()}};function re(e,s){return e==null?s:s==null?e:e.union(s)}function M(e){return Math.cos(N(e))}function R(e){return Math.sin(N(e))}t([i({type:["viewshed"]})],p.prototype,"type",void 0),t([i({cast:X,type:E,nonNullable:!0})],p.prototype,"viewsheds",null),t([i({readOnly:!0})],p.prototype,"spatialReference",null),t([i()],p.prototype,"_extent",void 0),t([i({readOnly:!0})],p.prototype,"extent",null),t([i({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([F("esri.analysis.ViewshedAnalysis")],p);const D=p;let n=class extends ie(ee(te)){constructor(e){super(e),this.type="viewshed",this.operationalLayerType="ViewshedLayer",this.source=new D,this.opacity=1}initialize(){this.addHandles(L(()=>this.source,(e,s)=>{s!=null&&s.parent===this&&(s.parent=null),e!=null&&(e.parent=this)},P))}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new D)}get analysis(){return this.source}set analysis(e){this.source=e}get viewsheds(){return this.source.viewsheds}set viewsheds(e){this.source.viewsheds=e}writeViewsheds(e,s,c,l){s.viewsheds=e.filter(r=>r.isValid()).map(r=>r.toJSON(l)).toJSON()}};t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i({type:["ViewshedLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0})],n.prototype,"source",void 0),t([i({readOnly:!0})],n.prototype,"spatialReference",null),t([i({readOnly:!0})],n.prototype,"fullExtent",null),t([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],n.prototype,"opacity",void 0),t([i({type:["show","hide"]})],n.prototype,"listMode",void 0),t([i({type:A.ofType(T),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],n.prototype,"viewsheds",null),t([Y("web-scene","viewsheds")],n.prototype,"writeViewsheds",null),n=t([F("esri.layers.ViewshedLayer")],n);const Me=n;export{Me as default}; diff --git a/main/assets/VoxelLayer-KL84GttA-BXyDxf1k.js b/main/assets/VoxelLayer-KL84GttA-BXyDxf1k.js new file mode 100644 index 000000000..f6be88bf2 --- /dev/null +++ b/main/assets/VoxelLayer-KL84GttA-BXyDxf1k.js @@ -0,0 +1 @@ +import{aa as L,ab as N,v as t,S as o,ad as ce,i as m,jy as ot,bB as j,ar as k,ag as c,am as de,ae as le,bl as ae,J as Me,a1 as q,W as rt,o as fe,n as Oe,hZ as ie,a0 as Te,bL as st,e as g,P as te,aC as nt,w as be,il as lt,dU as at}from"./main-C7yV2j71.js";import{m as pt}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{l as Re,A as Ce,w as Be,r as ut,x as ct,q as dt,j as yt}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{D as ht}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{n as mt}from"./APIKeyMixin-BUMSx9ny-AE1ffoPb.js";import{a as gt}from"./ArcGISService-BYA-y6X6-BtWUPppI.js";import{i as vt}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{E as ft}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as bt}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{S as St}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{W as xt}from"./SceneService-BZqGtWmG-B9O0VJ5b.js";import{j as wt}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{_ as Vt,Z as jt}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{y as W}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{o as Nt}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{w as Ee,r as zt}from"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import{c as z}from"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import{C as It}from"./persistable-C6RBwzJi-DoQq7vOT.js";import{A as Se,_ as Rt}from"./quat-BODLR7mS-Dbd8ftOx.js";import{e as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{u as Ae,r as De}from"./common-CYWrYyJl-E8-sukrT.js";import{k as ke,j as Pe}from"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import{w as Tt}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./jsonContext-BA8GHqVk-DpBf0bCt.js";import"./resourceUtils-BmW6QqlX-CP-OW4gT.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-Bu5Czfos.js";import"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-BFbGjGZW.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";const v=at(),qe=me(),Le=me(),$e=me(),Ue=ie(0,0,1),At=ie(0,1,0),Dt=ie(1,0,0);function J(e){Ce(v,e),Re(v,v);const i=Math.atan2(v[1],v[0]),r=Se(me(),Ue,-i);Be(v,v,r);const s=-1*Math.atan2(v[2],v[0]);return[Ae(i)+270,Ae(s)+90]}function ye(e,i){return Se(Le,Ue,De(e-270)),Se($e,At,De(i-90)),Rt(qe,Le,$e),Ce(v,Dt),Be(v,v,qe),Re(v,v),[v[0],v[1],v[2]]}let R=class extends L(g){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(e),0,!0)}set orientation(e){const i=ye(e,this.tilt);this._set("normal",i),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(i),0,!0)}set tilt(e){const i=ye(this.orientation,e);this._set("normal",i),this._set("tilt",e)}};t([o({type:Boolean,json:{write:!0}})],R.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"label",void 0),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],R.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],R.prototype,"point",void 0),R=t([m("esri.layers.voxel.VoxelSlice")],R);const he=R;let b=class extends L(g){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(i),0,!0)}};t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"enabled",void 0),t([o({type:String,json:{origins:{service:{read:ot}},write:{enabled:!0,isRequired:!0}}}),It({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],b.prototype,"href",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"label",void 0),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"orientation",null),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"tilt",null),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"normal",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"point",void 0),t([o({type:[j],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"sizeInPixel",void 0),t([o({type:[he],json:{write:!0}})],b.prototype,"slices",void 0),t([o({type:j,json:{default:0,write:!0}})],b.prototype,"timeId",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"variableId",void 0),b=t([m("esri.layers.voxel.VoxelSection")],b);const xe=b;let H=class extends g{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"diffuseFactor",void 0),t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"specularFactor",void 0),H=t([m("esri.layers.voxel.VoxelSimpleShading")],H);const We=H;let T=class extends g{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};t([o({type:["discrete","continuous"],json:{write:!0}})],T.prototype,"continuity",void 0),t([o({type:Boolean,json:{write:!0}})],T.prototype,"hasNoData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"noData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"offset",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"scale",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"type",void 0),T=t([m("esri.layers.voxel.VoxelFormat")],T);const Fe=T;let V=class extends g{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"name",void 0),t([o({type:Fe,json:{write:!0}})],V.prototype,"originalFormat",void 0),t([o({type:Fe,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"renderingFormat",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"unit",void 0),t([o({type:Number,json:{write:!0}})],V.prototype,"volumeId",void 0),t([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],V.prototype,"type",void 0),V=t([m("esri.layers.voxel.VoxelVariable")],V);const Pt=V;let _=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],_.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],_.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],_.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],_.prototype,"label",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],_.prototype,"colorLocked",void 0),_=t([m("esri.layers.voxel.VoxelIsosurface")],_);const Je=_;let X=class extends L(g){constructor(){super(...arguments),this.color=null,this.position=0}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],X.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"position",void 0),X=t([m("esri.layers.voxel.VoxelColorStop")],X);const we=X;let Y=class extends L(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};t([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],Y.prototype,"opacity",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Y.prototype,"position",void 0),Y=t([m("esri.layers.voxel.VoxelOpacityStop")],Y);const Ve=Y;let Q=class extends L(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};t([o({type:Boolean,json:{default:!1,write:!0}})],Q.prototype,"enabled",void 0),t([o({type:[Number],json:{write:!0}})],Q.prototype,"range",void 0),Q=t([m("esri.layers.voxel.VoxelRangeFilter")],Q);const qt=Q;var w;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(w||(w={}));let A=class extends L(g){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(we)),this.opacityStops=new(c.ofType(Ve))}set colorStops(e){this._set("colorStops",de(e,this._get("colorStops"),c.ofType(we)))}set opacityStops(e){this._set("opacityStops",de(e,this._get("opacityStops"),c.ofType(Ve)))}getPreviousNext(e,i,r){let s=e;for(;--s>0&&i[s].type!==r&&i[s].type!==w.Both;);let n=e;const a=i.length;for(;++nu.position{d.color[F]=Math.round(ae($[F],oe[F],y))})}else h!==-1?pe.forEach(y=>{d.color[y]=r[h].color[y]}):pe.forEach(y=>{d.color[y]=r[f].color[y]})}}for(const u of r)i.push({color:u.color,position:u.position})}i[0].position=0,i[i.length-1].position=1;let n=0,a=1;for(let p=0;pi[a].position;)n=a++;const d=(u-i[n].position)/(i[a].position-i[n].position),h=i[n].color,f=i[a].color,y=new k;pe.forEach($=>{y[$]=Math.round(ae(h[$],f[$],d))}),y.a=le(1-ae(h.a,f.a,d)/255,0,1),e.push(y)}return e}getColorForContinuousDataValue(e,i){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let s=this.stretchRange[0],n=this.stretchRange[1];if(s>n){const p=s;s=n,n=p}e=le(e,s,n);const a=r[Math.round((e-s)/(n-s)*(this._colorMapSize-1))].clone();return i||(a.a=1),a}};t([o({type:["linear","nearest"],json:{write:!0}})],A.prototype,"interpolation",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],A.prototype,"stretchRange",void 0),t([o({type:c.ofType(we),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],A.prototype,"colorStops",null),t([o({type:c.ofType(Ve),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],A.prototype,"opacityStops",null),t([o({type:qt,json:{write:!0}})],A.prototype,"rangeFilter",void 0),t([o({type:[k],clonable:!1,json:{read:!1}})],A.prototype,"rasterizedTransferFunction",null),A=t([m("esri.layers.voxel.VoxelTransferFunctionStyle")],A);const Lt=A,pe=["r","g","b"];let B=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],B.prototype,"color",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],B.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],B.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],B.prototype,"label",void 0),B=t([m("esri.layers.voxel.VoxelUniqueValue")],B);const Ze=B;var je;let M=je=class extends g{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(Ze)),this.isosurfaces=new(c.ofType(Je))}clone(){return new je({variableId:this.variableId,label:this.label,transferFunction:te(this.transferFunction),uniqueValues:te(this.uniqueValues),isosurfaces:te(this.isosurfaces)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"variableId",void 0),t([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),t([o({type:Lt,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],M.prototype,"transferFunction",void 0),t([o({type:c.ofType(Ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],M.prototype,"uniqueValues",void 0),t([o({type:c.ofType(Je),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&i}}}}})],M.prototype,"isosurfaces",void 0),M=je=t([m("esri.layers.voxel.VoxelVariableStyle")],M);const Ke=M;function _e(e){const i=/^(days?|hours?|minutes?|seconds?|d|h|m|s) since (\d{1,4})-(\d{1,2})-(\d{1,2})[ |T](\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[\s|Z]?(([+|\-|\s?])(\d{1,2}):(\d{1,2}))?$/i.exec(e);if(i==null)return{didParse:!1};const[,r,s,n,a,p,u,d,h,f,y,$,oe]=i;let F="seconds";const ge=r.charAt(0).toLowerCase();ge==="d"?F="days":ge==="h"?F="hours":ge==="m"&&(F="minutes");const Z=parseInt(s,10);if(Number.isNaN(Z))return{didParse:!1};const I=parseInt(n,10);if(Number.isNaN(I)||I<1||I>12)return{didParse:!1};const O=parseInt(a,10);if(Number.isNaN(O)||O<1||O>31)return{didParse:!1};if(I===2){const G=Z%4==0&&(Z%100!=0||Z%400==0);if(G&&O>29||!G&&O>28)return{didParse:!1}}else if((I===4||I===6||I===9||I===11)&&O>30)return{didParse:!1};const re=parseInt(p,10);if(Number.isNaN(re)||re<0||re>23)return{didParse:!1};const se=parseInt(u,10);if(Number.isNaN(se)||se<0||se>59)return{didParse:!1};const ne=parseInt(d,10);if(Number.isNaN(ne)||ne<0||ne>59)return{didParse:!1};let ve=1,C=0,U=0;if(y&&(ve=y==="-"?-1:1),$){if(C=parseInt($,10),Number.isNaN(C)||C<0)return{didParse:!1};if(C!==0){const G=ve*C;if(G<-12||G>14)return{didParse:!1}}}if(oe&&(U=parseInt(oe,10),Number.isNaN(U)||U<0||U>59))return{didParse:!1};const Xe=`${Z}`.padStart(4,"0"),Ye=`${I}`.padStart(2,"0"),Qe=`${O}`.padStart(2,"0"),et=`${re}`.padStart(2,"0"),tt=`${se}`.padStart(2,"0"),it=`${ne}`.padStart(2,"0");let K="Z";return C===0&&U===0||(K=ve>0?"+":"-",K+=`${C}`.padStart(2,"0"),K+=":",K+=`${U}`.padStart(2,"0")),{didParse:!0,unit:F,reference:new Date(`${Xe}-${Ye}-${Qe}T${et}:${tt}:${it}.000${K}`)}}let ue=class extends g{constructor(){super(...arguments),this.values=null}};t([o({type:[Number],json:{write:!0}})],ue.prototype,"values",void 0),ue=t([m("esri.layers.voxel.VoxelIrregularSpacing")],ue);const $t=ue;let ee=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};t([o({type:Number,json:{write:!0}})],ee.prototype,"scale",void 0),t([o({type:Number,json:{write:!0}})],ee.prototype,"offset",void 0),ee=t([m("esri.layers.voxel.VoxelRegularSpacing")],ee);const Ft=ee;let S=class extends g{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};t([o({type:$t,json:{write:!0}})],S.prototype,"irregularSpacing",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isPositiveUp",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isWrappedDateLine",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"quantity",void 0),t([o({type:Ft,json:{write:!0}})],S.prototype,"regularSpacing",void 0),t([o({type:Number,json:{write:!0}})],S.prototype,"size",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"unit",void 0),t([o({type:Boolean,json:{read:!1}})],S.prototype,"isRegular",null),S=t([m("esri.layers.voxel.VoxelDimension")],S);const _t=S;let x=class extends g{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=Me.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size];return[e[0],i[0],s[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size],n=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let a=0;a<3;++a)n[a]<2?n[a]=1:n[a]-=1;return r.isRegular&&!r.isPositiveUp&&(n[2]*=-1),[(e[1]-e[0])/n[0],(i[1]-i[0])/n[1],(s[1]-s[0])/n[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0;let i=this.dimensions[3].size>0;if(i){const r=this.dimensions[3];i=r.quantity==="time",i&&r.unit!==null&&(i=_e(r.unit).didParse)}if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}get timeStops(){if(this.volumeType!=="xyzt")return[];const e=this.dimensions[3],i=[],r=_e(e.unit);if(r.didParse){if(e.isRegular){const s=e.regularSpacing?.offset??0,n=e.regularSpacing?.scale||1;for(let a=0;a0)for(let s=0;s1){const s=e.z??0,n=r.irregularSpacing.values,a=r.isPositiveUp?1:-1,p=n.reduce((u,d)=>Math.abs(a*d-s)z.normalize(N(e),0,!0))],D.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],D.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],D.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],D.prototype,"point",void 0),D=t([m("esri.layers.voxel.VoxelDynamicSection")],D);const ze=D;var Ie;let P=Ie=class extends g{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(he)),this.dynamicSections=new(c.ofType(ze))}set slices(e){this._set("slices",de(e,this._get("slices"),c.ofType(he)))}set dynamicSections(e){this._set("dynamicSections",de(e,this._get("dynamicSections"),c.ofType(ze)))}clone(){return new Ie({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:te(this.slices),dynamicSections:te(this.dynamicSections)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"volumeId",void 0),t([o({type:Number,json:{default:1,write:!0}})],P.prototype,"verticalExaggeration",void 0),t([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],P.prototype,"exaggerationMode",void 0),t([o({type:Number,json:{default:0,write:!0}})],P.prototype,"verticalOffset",void 0),t([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],P.prototype,"slices",null),t([o({type:c.ofType(ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],P.prototype,"dynamicSections",null),P=Ie=t([m("esri.layers.voxel.VoxelVolumeStyle")],P);const He=P;let l=class extends xt(gt(ft(bt(St(pt(vt(mt(ht)))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new We,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(c.ofType(He)),this.variableStyles=new(c.ofType(Ke)),this.sections=new(c.ofType(xe))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",wt(e,q.getLogger(this)))}load(e){const i=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(rt).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(r),Promise.resolve(this)}read(e,i){super.read(e,i),i?.origin==="service"&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");for(const r of this.volumes)r.spatialReference=this.spatialReference}readVersion(e,i){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new fe("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new fe("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new fe("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,i,r){if(e!=null&&typeof e=="object"){const s=Oe.fromJSON(e,r);if(s.zmin===0&&s.zmax===0&&Array.isArray(i.volumes)){const n=Ge.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const a=n.dimensions[2];if(a.isRegular){let p=a.regularSpacing.offset,u=a.regularSpacing.offset+a.regularSpacing.scale*(a.size-1);if(p>u){const d=p;p=u,u=d}s.zmin=p,s.zmax=u}}}return s}return null}get fields(){const e=[new W({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new W({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const r of this.variables){const s=new W({name:r.name,alias:r.description,domain:null,editable:!1,length:128,type:r.renderingFormat.continuity==="discrete"?"string":"double"});e.push(s)}const i=this.getVolume(null);if(i!=null){if(i.volumeType==="xyzt"||i.volumeType==="xyt"){const r=new W({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(r);const s=new W({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(s)}if(i.volumeType!=="xyt"){const r=new W({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(r)}}return e}get fieldsIndex(){return this.loaded?new Nt(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const i=this.fields;return Tt({fields:i,title:"{Voxel.Position}"},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let i=-1;if(i=e??this.currentVariableId,!this.variableStyles||i===-1)return null;const r=this.variableStyles.findIndex(s=>s.variableId===i);return r<0?null:this.variableStyles.at(r)}getVariable(e){let i=-1;if(i=e??this.currentVariableId,!this.variables||i===-1)return null;const r=this.variables.findIndex(s=>s.id===i);return r<0?null:this.variables.at(r)}getVolume(e){const i=this.getVariable(e);return i!=null?this.volumes.find(({id:r})=>r===i.volumeId):null}get timeInfo(){const e=this.getVolume(null);if(e?.volumeType!=="xyzt")return null;const i=e.timeStops;if(!i?.length)return null;const r=new ke({start:i[0],end:i.at(-1)});return new Ee({fullTimeExtent:r,stops:i})}getVolumeStyle(e){const i=this.getVariable(e);return i!=null?this.volumeStyles.find(({volumeId:r})=>r===i.volumeId):null}getColorForContinuousDataValue(e,i,r){const s=this.getVariable(e);if(s==null||s.renderingFormat?.continuity!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===e);if(n<0)return null;const a=this.variableStyles.at(n);return a?.transferFunction?a.transferFunction.getColorForContinuousDataValue(i,r):null}getSections(){const e=[];for(const i of this.sections)e.push(new xe({enabled:i.enabled,href:i.href,id:i.id,label:i.label,normal:i.normal,point:i.point,sizeInPixel:i.sizeInPixel,slices:i.slices,timeId:i.timeId,variableId:i.variableId}));return e}getVariableStyles(){const e=[];for(const i of this.variableStyles){const r=this._getVariable(i);if(r!=null){const s=i.clone();s.isosurfaces.length>4&&(s.isosurfaces=s.isosurfaces.slice(0,3),q.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of s.isosurfaces)if(!n.colorLocked){const a=this.getColorForContinuousDataValue(s.variableId,n.value,!1);a===null||a.equals(n.color)||(n.color=a)}if(r.renderingFormat.continuity==="continuous")(s.transferFunction===null||s.transferFunction.colorStops.length<2)&&q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),s.transferFunction!==null&&(Array.isArray(s.transferFunction.stretchRange)&&s.transferFunction.stretchRange.length===2||(q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),s.transferFunction.stretchRange=[0,1],s.transferFunction.colorStops.removeAll()));else if(r.renderingFormat.continuity==="discrete")if(i.uniqueValues.length===0)q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of i.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());e.push(s)}else q.getLogger(this).error(`VoxelVariable ID=${i.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const i of this.volumeStyles){const r=this._getVolumeFromVolumeId(i.volumeId);if(r!=null){const s=i.clone();for(const n of s.slices)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of s.dynamicSections)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");e.push(s)}else q.getLogger(this).error(`VoxelVolume ID=${i.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const i=e.variableId;for(const r of this.variables)if(r.id===i)return r;return null}_getVolumeFromVolumeId(e){for(const i of this.volumes)if(i.id===e)return i;return null}_isPlaneValid(e,i,r){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;const s=ie(e.normal[0],e.normal[1],e.normal[2]);return Re(s,s),!(Math.abs(s[0])+Math.abs(s[1])+Math.abs(s[2])<1e-6)&&(e.normal[0]=s[0],e.normal[1]=s[1],e.normal[2]=s[2],!0)}};t([o({type:["Voxel"]})],l.prototype,"operationalLayerType",void 0),t([o(Vt)],l.prototype,"legendEnabled",void 0),t([o({json:{write:!0}})],l.prototype,"title",void 0),t([o(jt)],l.prototype,"url",null),t([o({type:c.ofType(xe),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],l.prototype,"sections",void 0),t([o({type:j,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],l.prototype,"currentVariableId",void 0),t([o({type:c.ofType(He),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],l.prototype,"volumeStyles",void 0),t([o({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],l.prototype,"renderMode",void 0),t([o({type:c.ofType(Ke),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],l.prototype,"variableStyles",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],l.prototype,"enableSlices",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],l.prototype,"enableSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],l.prototype,"enableDynamicSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],l.prototype,"enableIsosurfaces",void 0),t([o({type:We,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],l.prototype,"shading",void 0),t([o({type:["show","hide"]})],l.prototype,"listMode",void 0),t([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"opacity",void 0),t([o({type:c.ofType(Pt)})],l.prototype,"variables",void 0),t([o({type:c.ofType(Ge)})],l.prototype,"volumes",void 0),t([o({type:Mt})],l.prototype,"index",void 0),t([o({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"minScale",void 0),t([o({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"maxScale",void 0),t([o({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([o({readOnly:!0,json:{name:"serviceVersion"}})],l.prototype,"version",void 0),t([Te("service","version")],l.prototype,"readVersion",null),t([o({type:Oe})],l.prototype,"fullExtent",void 0),t([Te("service","fullExtent",["fullExtent"])],l.prototype,"readFullExtent",null),t([o({readOnly:!0,clonable:!1,json:{read:!1}})],l.prototype,"fields",null),t([o({readOnly:!0})],l.prototype,"fieldsIndex",null),t([o({type:Boolean,json:{name:"disablePopup",read:{reader:(e,i)=>!i.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,i,r){i[r]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],l.prototype,"popupEnabled",void 0),t([o({type:st,json:{name:"popupInfo",write:!0}})],l.prototype,"popupTemplate",void 0),t([o({readOnly:!0,json:{read:!1}})],l.prototype,"defaultPopupTemplate",null),t([o({type:Ee,readOnly:!0,json:{read:!1}})],l.prototype,"timeInfo",null),t([o({type:ke,json:{read:!1}})],l.prototype,"timeExtent",void 0),t([o({type:zt,json:{read:!1}})],l.prototype,"timeOffset",void 0),t([o({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],l.prototype,"useViewTime",void 0),l=t([m("esri.layers.VoxelLayer")],l);const Ri=l;export{Ri as default}; diff --git a/main/assets/VoxelLayer-KL84GttA-D57b8TA4.js b/main/assets/VoxelLayer-KL84GttA-D57b8TA4.js deleted file mode 100644 index dab5c7415..000000000 --- a/main/assets/VoxelLayer-KL84GttA-D57b8TA4.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as L,ab as N,v as t,S as o,ad as ce,i as m,jy as ot,bB as j,ar as k,ag as c,am as de,ae as le,bl as ae,J as Me,a1 as q,W as rt,o as fe,n as Oe,hZ as ie,a0 as Te,bL as st,e as g,P as te,aC as nt,w as be,il as lt,dU as at}from"./main-BZaw9FpY.js";import{m as pt}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{l as Re,A as Ce,w as Be,r as ut,x as ct,q as dt,j as yt}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{D as ht}from"./Layer-ChoECxvZ-C4wLrCej.js";import{n as mt}from"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import{a as gt}from"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import{i as vt}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{E as ft}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as bt}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{S as St}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{W as xt}from"./SceneService-BZqGtWmG-B8Xgkv2e.js";import{j as wt}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{_ as Vt,Z as jt}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{y as W}from"./Field-C6hA1tZj-CbELM0zp.js";import{o as Nt}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{w as Ee,r as zt}from"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import{c as z}from"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import{C as It}from"./persistable-C6RBwzJi-B2W1QdS_.js";import{A as Se,_ as Rt}from"./quat-BODLR7mS-Bk09s2KF.js";import{e as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{u as Ae,r as De}from"./common-CYWrYyJl-E8-sukrT.js";import{k as ke,j as Pe}from"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import{w as Tt}from"./popupUtils-B0uZcXX0-BqljON9c.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./jsonContext-BA8GHqVk-BMETb6sX.js";import"./resourceUtils-BmW6QqlX-Cs99W_og.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-C_sFWCPe.js";import"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-X6Zoj5Td.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";const v=at(),qe=me(),Le=me(),$e=me(),Ue=ie(0,0,1),At=ie(0,1,0),Dt=ie(1,0,0);function J(e){Ce(v,e),Re(v,v);const i=Math.atan2(v[1],v[0]),r=Se(me(),Ue,-i);Be(v,v,r);const s=-1*Math.atan2(v[2],v[0]);return[Ae(i)+270,Ae(s)+90]}function ye(e,i){return Se(Le,Ue,De(e-270)),Se($e,At,De(i-90)),Rt(qe,Le,$e),Ce(v,Dt),Be(v,v,qe),Re(v,v),[v[0],v[1],v[2]]}let R=class extends L(g){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(e),0,!0)}set orientation(e){const i=ye(e,this.tilt);this._set("normal",i),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(i),0,!0)}set tilt(e){const i=ye(this.orientation,e);this._set("normal",i),this._set("tilt",e)}};t([o({type:Boolean,json:{write:!0}})],R.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"label",void 0),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],R.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],R.prototype,"point",void 0),R=t([m("esri.layers.voxel.VoxelSlice")],R);const he=R;let b=class extends L(g){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(i),0,!0)}};t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"enabled",void 0),t([o({type:String,json:{origins:{service:{read:ot}},write:{enabled:!0,isRequired:!0}}}),It({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],b.prototype,"href",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"label",void 0),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"orientation",null),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"tilt",null),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"normal",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"point",void 0),t([o({type:[j],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"sizeInPixel",void 0),t([o({type:[he],json:{write:!0}})],b.prototype,"slices",void 0),t([o({type:j,json:{default:0,write:!0}})],b.prototype,"timeId",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"variableId",void 0),b=t([m("esri.layers.voxel.VoxelSection")],b);const xe=b;let H=class extends g{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"diffuseFactor",void 0),t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"specularFactor",void 0),H=t([m("esri.layers.voxel.VoxelSimpleShading")],H);const We=H;let T=class extends g{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};t([o({type:["discrete","continuous"],json:{write:!0}})],T.prototype,"continuity",void 0),t([o({type:Boolean,json:{write:!0}})],T.prototype,"hasNoData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"noData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"offset",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"scale",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"type",void 0),T=t([m("esri.layers.voxel.VoxelFormat")],T);const Fe=T;let V=class extends g{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"name",void 0),t([o({type:Fe,json:{write:!0}})],V.prototype,"originalFormat",void 0),t([o({type:Fe,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"renderingFormat",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"unit",void 0),t([o({type:Number,json:{write:!0}})],V.prototype,"volumeId",void 0),t([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],V.prototype,"type",void 0),V=t([m("esri.layers.voxel.VoxelVariable")],V);const Pt=V;let _=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],_.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],_.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],_.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],_.prototype,"label",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],_.prototype,"colorLocked",void 0),_=t([m("esri.layers.voxel.VoxelIsosurface")],_);const Je=_;let X=class extends L(g){constructor(){super(...arguments),this.color=null,this.position=0}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],X.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"position",void 0),X=t([m("esri.layers.voxel.VoxelColorStop")],X);const we=X;let Y=class extends L(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};t([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],Y.prototype,"opacity",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Y.prototype,"position",void 0),Y=t([m("esri.layers.voxel.VoxelOpacityStop")],Y);const Ve=Y;let Q=class extends L(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};t([o({type:Boolean,json:{default:!1,write:!0}})],Q.prototype,"enabled",void 0),t([o({type:[Number],json:{write:!0}})],Q.prototype,"range",void 0),Q=t([m("esri.layers.voxel.VoxelRangeFilter")],Q);const qt=Q;var w;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(w||(w={}));let A=class extends L(g){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(we)),this.opacityStops=new(c.ofType(Ve))}set colorStops(e){this._set("colorStops",de(e,this._get("colorStops"),c.ofType(we)))}set opacityStops(e){this._set("opacityStops",de(e,this._get("opacityStops"),c.ofType(Ve)))}getPreviousNext(e,i,r){let s=e;for(;--s>0&&i[s].type!==r&&i[s].type!==w.Both;);let n=e;const a=i.length;for(;++nu.position{d.color[F]=Math.round(ae($[F],oe[F],y))})}else h!==-1?pe.forEach(y=>{d.color[y]=r[h].color[y]}):pe.forEach(y=>{d.color[y]=r[f].color[y]})}}for(const u of r)i.push({color:u.color,position:u.position})}i[0].position=0,i[i.length-1].position=1;let n=0,a=1;for(let p=0;pi[a].position;)n=a++;const d=(u-i[n].position)/(i[a].position-i[n].position),h=i[n].color,f=i[a].color,y=new k;pe.forEach($=>{y[$]=Math.round(ae(h[$],f[$],d))}),y.a=le(1-ae(h.a,f.a,d)/255,0,1),e.push(y)}return e}getColorForContinuousDataValue(e,i){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let s=this.stretchRange[0],n=this.stretchRange[1];if(s>n){const p=s;s=n,n=p}e=le(e,s,n);const a=r[Math.round((e-s)/(n-s)*(this._colorMapSize-1))].clone();return i||(a.a=1),a}};t([o({type:["linear","nearest"],json:{write:!0}})],A.prototype,"interpolation",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],A.prototype,"stretchRange",void 0),t([o({type:c.ofType(we),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],A.prototype,"colorStops",null),t([o({type:c.ofType(Ve),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],A.prototype,"opacityStops",null),t([o({type:qt,json:{write:!0}})],A.prototype,"rangeFilter",void 0),t([o({type:[k],clonable:!1,json:{read:!1}})],A.prototype,"rasterizedTransferFunction",null),A=t([m("esri.layers.voxel.VoxelTransferFunctionStyle")],A);const Lt=A,pe=["r","g","b"];let B=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],B.prototype,"color",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],B.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],B.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],B.prototype,"label",void 0),B=t([m("esri.layers.voxel.VoxelUniqueValue")],B);const Ze=B;var je;let M=je=class extends g{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(Ze)),this.isosurfaces=new(c.ofType(Je))}clone(){return new je({variableId:this.variableId,label:this.label,transferFunction:te(this.transferFunction),uniqueValues:te(this.uniqueValues),isosurfaces:te(this.isosurfaces)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"variableId",void 0),t([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),t([o({type:Lt,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],M.prototype,"transferFunction",void 0),t([o({type:c.ofType(Ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],M.prototype,"uniqueValues",void 0),t([o({type:c.ofType(Je),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&i}}}}})],M.prototype,"isosurfaces",void 0),M=je=t([m("esri.layers.voxel.VoxelVariableStyle")],M);const Ke=M;function _e(e){const i=/^(days?|hours?|minutes?|seconds?|d|h|m|s) since (\d{1,4})-(\d{1,2})-(\d{1,2})[ |T](\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[\s|Z]?(([+|\-|\s?])(\d{1,2}):(\d{1,2}))?$/i.exec(e);if(i==null)return{didParse:!1};const[,r,s,n,a,p,u,d,h,f,y,$,oe]=i;let F="seconds";const ge=r.charAt(0).toLowerCase();ge==="d"?F="days":ge==="h"?F="hours":ge==="m"&&(F="minutes");const Z=parseInt(s,10);if(Number.isNaN(Z))return{didParse:!1};const I=parseInt(n,10);if(Number.isNaN(I)||I<1||I>12)return{didParse:!1};const O=parseInt(a,10);if(Number.isNaN(O)||O<1||O>31)return{didParse:!1};if(I===2){const G=Z%4==0&&(Z%100!=0||Z%400==0);if(G&&O>29||!G&&O>28)return{didParse:!1}}else if((I===4||I===6||I===9||I===11)&&O>30)return{didParse:!1};const re=parseInt(p,10);if(Number.isNaN(re)||re<0||re>23)return{didParse:!1};const se=parseInt(u,10);if(Number.isNaN(se)||se<0||se>59)return{didParse:!1};const ne=parseInt(d,10);if(Number.isNaN(ne)||ne<0||ne>59)return{didParse:!1};let ve=1,C=0,U=0;if(y&&(ve=y==="-"?-1:1),$){if(C=parseInt($,10),Number.isNaN(C)||C<0)return{didParse:!1};if(C!==0){const G=ve*C;if(G<-12||G>14)return{didParse:!1}}}if(oe&&(U=parseInt(oe,10),Number.isNaN(U)||U<0||U>59))return{didParse:!1};const Xe=`${Z}`.padStart(4,"0"),Ye=`${I}`.padStart(2,"0"),Qe=`${O}`.padStart(2,"0"),et=`${re}`.padStart(2,"0"),tt=`${se}`.padStart(2,"0"),it=`${ne}`.padStart(2,"0");let K="Z";return C===0&&U===0||(K=ve>0?"+":"-",K+=`${C}`.padStart(2,"0"),K+=":",K+=`${U}`.padStart(2,"0")),{didParse:!0,unit:F,reference:new Date(`${Xe}-${Ye}-${Qe}T${et}:${tt}:${it}.000${K}`)}}let ue=class extends g{constructor(){super(...arguments),this.values=null}};t([o({type:[Number],json:{write:!0}})],ue.prototype,"values",void 0),ue=t([m("esri.layers.voxel.VoxelIrregularSpacing")],ue);const $t=ue;let ee=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};t([o({type:Number,json:{write:!0}})],ee.prototype,"scale",void 0),t([o({type:Number,json:{write:!0}})],ee.prototype,"offset",void 0),ee=t([m("esri.layers.voxel.VoxelRegularSpacing")],ee);const Ft=ee;let S=class extends g{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};t([o({type:$t,json:{write:!0}})],S.prototype,"irregularSpacing",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isPositiveUp",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isWrappedDateLine",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"quantity",void 0),t([o({type:Ft,json:{write:!0}})],S.prototype,"regularSpacing",void 0),t([o({type:Number,json:{write:!0}})],S.prototype,"size",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"unit",void 0),t([o({type:Boolean,json:{read:!1}})],S.prototype,"isRegular",null),S=t([m("esri.layers.voxel.VoxelDimension")],S);const _t=S;let x=class extends g{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=Me.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size];return[e[0],i[0],s[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size],n=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let a=0;a<3;++a)n[a]<2?n[a]=1:n[a]-=1;return r.isRegular&&!r.isPositiveUp&&(n[2]*=-1),[(e[1]-e[0])/n[0],(i[1]-i[0])/n[1],(s[1]-s[0])/n[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0;let i=this.dimensions[3].size>0;if(i){const r=this.dimensions[3];i=r.quantity==="time",i&&r.unit!==null&&(i=_e(r.unit).didParse)}if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}get timeStops(){if(this.volumeType!=="xyzt")return[];const e=this.dimensions[3],i=[],r=_e(e.unit);if(r.didParse){if(e.isRegular){const s=e.regularSpacing?.offset??0,n=e.regularSpacing?.scale||1;for(let a=0;a0)for(let s=0;s1){const s=e.z??0,n=r.irregularSpacing.values,a=r.isPositiveUp?1:-1,p=n.reduce((u,d)=>Math.abs(a*d-s)z.normalize(N(e),0,!0))],D.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],D.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],D.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],D.prototype,"point",void 0),D=t([m("esri.layers.voxel.VoxelDynamicSection")],D);const ze=D;var Ie;let P=Ie=class extends g{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(he)),this.dynamicSections=new(c.ofType(ze))}set slices(e){this._set("slices",de(e,this._get("slices"),c.ofType(he)))}set dynamicSections(e){this._set("dynamicSections",de(e,this._get("dynamicSections"),c.ofType(ze)))}clone(){return new Ie({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:te(this.slices),dynamicSections:te(this.dynamicSections)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"volumeId",void 0),t([o({type:Number,json:{default:1,write:!0}})],P.prototype,"verticalExaggeration",void 0),t([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],P.prototype,"exaggerationMode",void 0),t([o({type:Number,json:{default:0,write:!0}})],P.prototype,"verticalOffset",void 0),t([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],P.prototype,"slices",null),t([o({type:c.ofType(ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],P.prototype,"dynamicSections",null),P=Ie=t([m("esri.layers.voxel.VoxelVolumeStyle")],P);const He=P;let l=class extends xt(gt(ft(bt(St(pt(vt(mt(ht)))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new We,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(c.ofType(He)),this.variableStyles=new(c.ofType(Ke)),this.sections=new(c.ofType(xe))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",wt(e,q.getLogger(this)))}load(e){const i=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(rt).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(r),Promise.resolve(this)}read(e,i){super.read(e,i),i?.origin==="service"&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");for(const r of this.volumes)r.spatialReference=this.spatialReference}readVersion(e,i){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new fe("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new fe("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new fe("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,i,r){if(e!=null&&typeof e=="object"){const s=Oe.fromJSON(e,r);if(s.zmin===0&&s.zmax===0&&Array.isArray(i.volumes)){const n=Ge.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const a=n.dimensions[2];if(a.isRegular){let p=a.regularSpacing.offset,u=a.regularSpacing.offset+a.regularSpacing.scale*(a.size-1);if(p>u){const d=p;p=u,u=d}s.zmin=p,s.zmax=u}}}return s}return null}get fields(){const e=[new W({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new W({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const r of this.variables){const s=new W({name:r.name,alias:r.description,domain:null,editable:!1,length:128,type:r.renderingFormat.continuity==="discrete"?"string":"double"});e.push(s)}const i=this.getVolume(null);if(i!=null){if(i.volumeType==="xyzt"||i.volumeType==="xyt"){const r=new W({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(r);const s=new W({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(s)}if(i.volumeType!=="xyt"){const r=new W({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(r)}}return e}get fieldsIndex(){return this.loaded?new Nt(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const i=this.fields;return Tt({fields:i,title:"{Voxel.Position}"},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let i=-1;if(i=e??this.currentVariableId,!this.variableStyles||i===-1)return null;const r=this.variableStyles.findIndex(s=>s.variableId===i);return r<0?null:this.variableStyles.at(r)}getVariable(e){let i=-1;if(i=e??this.currentVariableId,!this.variables||i===-1)return null;const r=this.variables.findIndex(s=>s.id===i);return r<0?null:this.variables.at(r)}getVolume(e){const i=this.getVariable(e);return i!=null?this.volumes.find(({id:r})=>r===i.volumeId):null}get timeInfo(){const e=this.getVolume(null);if(e?.volumeType!=="xyzt")return null;const i=e.timeStops;if(!i?.length)return null;const r=new ke({start:i[0],end:i.at(-1)});return new Ee({fullTimeExtent:r,stops:i})}getVolumeStyle(e){const i=this.getVariable(e);return i!=null?this.volumeStyles.find(({volumeId:r})=>r===i.volumeId):null}getColorForContinuousDataValue(e,i,r){const s=this.getVariable(e);if(s==null||s.renderingFormat?.continuity!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===e);if(n<0)return null;const a=this.variableStyles.at(n);return a?.transferFunction?a.transferFunction.getColorForContinuousDataValue(i,r):null}getSections(){const e=[];for(const i of this.sections)e.push(new xe({enabled:i.enabled,href:i.href,id:i.id,label:i.label,normal:i.normal,point:i.point,sizeInPixel:i.sizeInPixel,slices:i.slices,timeId:i.timeId,variableId:i.variableId}));return e}getVariableStyles(){const e=[];for(const i of this.variableStyles){const r=this._getVariable(i);if(r!=null){const s=i.clone();s.isosurfaces.length>4&&(s.isosurfaces=s.isosurfaces.slice(0,3),q.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of s.isosurfaces)if(!n.colorLocked){const a=this.getColorForContinuousDataValue(s.variableId,n.value,!1);a===null||a.equals(n.color)||(n.color=a)}if(r.renderingFormat.continuity==="continuous")(s.transferFunction===null||s.transferFunction.colorStops.length<2)&&q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),s.transferFunction!==null&&(Array.isArray(s.transferFunction.stretchRange)&&s.transferFunction.stretchRange.length===2||(q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),s.transferFunction.stretchRange=[0,1],s.transferFunction.colorStops.removeAll()));else if(r.renderingFormat.continuity==="discrete")if(i.uniqueValues.length===0)q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of i.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());e.push(s)}else q.getLogger(this).error(`VoxelVariable ID=${i.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const i of this.volumeStyles){const r=this._getVolumeFromVolumeId(i.volumeId);if(r!=null){const s=i.clone();for(const n of s.slices)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of s.dynamicSections)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");e.push(s)}else q.getLogger(this).error(`VoxelVolume ID=${i.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const i=e.variableId;for(const r of this.variables)if(r.id===i)return r;return null}_getVolumeFromVolumeId(e){for(const i of this.volumes)if(i.id===e)return i;return null}_isPlaneValid(e,i,r){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;const s=ie(e.normal[0],e.normal[1],e.normal[2]);return Re(s,s),!(Math.abs(s[0])+Math.abs(s[1])+Math.abs(s[2])<1e-6)&&(e.normal[0]=s[0],e.normal[1]=s[1],e.normal[2]=s[2],!0)}};t([o({type:["Voxel"]})],l.prototype,"operationalLayerType",void 0),t([o(Vt)],l.prototype,"legendEnabled",void 0),t([o({json:{write:!0}})],l.prototype,"title",void 0),t([o(jt)],l.prototype,"url",null),t([o({type:c.ofType(xe),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],l.prototype,"sections",void 0),t([o({type:j,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],l.prototype,"currentVariableId",void 0),t([o({type:c.ofType(He),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],l.prototype,"volumeStyles",void 0),t([o({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],l.prototype,"renderMode",void 0),t([o({type:c.ofType(Ke),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],l.prototype,"variableStyles",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],l.prototype,"enableSlices",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],l.prototype,"enableSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],l.prototype,"enableDynamicSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],l.prototype,"enableIsosurfaces",void 0),t([o({type:We,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],l.prototype,"shading",void 0),t([o({type:["show","hide"]})],l.prototype,"listMode",void 0),t([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"opacity",void 0),t([o({type:c.ofType(Pt)})],l.prototype,"variables",void 0),t([o({type:c.ofType(Ge)})],l.prototype,"volumes",void 0),t([o({type:Mt})],l.prototype,"index",void 0),t([o({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"minScale",void 0),t([o({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"maxScale",void 0),t([o({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([o({readOnly:!0,json:{name:"serviceVersion"}})],l.prototype,"version",void 0),t([Te("service","version")],l.prototype,"readVersion",null),t([o({type:Oe})],l.prototype,"fullExtent",void 0),t([Te("service","fullExtent",["fullExtent"])],l.prototype,"readFullExtent",null),t([o({readOnly:!0,clonable:!1,json:{read:!1}})],l.prototype,"fields",null),t([o({readOnly:!0})],l.prototype,"fieldsIndex",null),t([o({type:Boolean,json:{name:"disablePopup",read:{reader:(e,i)=>!i.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,i,r){i[r]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],l.prototype,"popupEnabled",void 0),t([o({type:st,json:{name:"popupInfo",write:!0}})],l.prototype,"popupTemplate",void 0),t([o({readOnly:!0,json:{read:!1}})],l.prototype,"defaultPopupTemplate",null),t([o({type:Ee,readOnly:!0,json:{read:!1}})],l.prototype,"timeInfo",null),t([o({type:ke,json:{read:!1}})],l.prototype,"timeExtent",void 0),t([o({type:zt,json:{read:!1}})],l.prototype,"timeOffset",void 0),t([o({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],l.prototype,"useViewTime",void 0),l=t([m("esri.layers.VoxelLayer")],l);const Ri=l;export{Ri as default}; diff --git a/main/assets/WFSLayer-DKnx5V8b-CGzBCYUj.js b/main/assets/WFSLayer-DKnx5V8b-CGzBCYUj.js new file mode 100644 index 000000000..b8da47581 --- /dev/null +++ b/main/assets/WFSLayer-DKnx5V8b-CGzBCYUj.js @@ -0,0 +1 @@ +import{v as t,S as r,i as R,J as C,bT as O,em as E,el as U,a as J,bQ as $,ac as k,n as I,bW as h,bB as f,bL as Y,aB as D,bp as W,o as X,iF as L,K as H,a1 as Q,cY as G}from"./main-C7yV2j71.js";import"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{m as V,u as Z}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{m as B}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as K}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{q as z}from"./workers-PiCjreoO-DqI62TYf.js";import{$ as A,d as M}from"./clientSideDefaults-BqqayPct-B0cLE-po.js";import{x as ee,r as te,c as re,G as ie,v as oe}from"./wfsUtils-DoLaqXsj-CcouY8qc.js";import{O as se}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{u as ae}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-DndyRc71.js";import{l as pe}from"./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js";import{E as de}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{p as me}from"./OrderedLayer-6Qsmrd_l-sp1TyHmN.js";import{C as ue}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as ye}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as ce}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{$ as he,Y as ge,_ as we,K as ve,X as Fe,V as be,Z as xe}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{y as T}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{f as Oe}from"./fieldProperties-Bq26w7gt-DgCDIFFS.js";import{C as Se,q as Re}from"./labelingInfo-DGVNul26-ReCWpi39.js";import{b as y}from"./Query-BrwMGK8U-DV_czrJX.js";import{w as Ce}from"./popupUtils-B0uZcXX0-B9v3xvNZ.js";import"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./geojson-CNt_qtQf-utywq02B.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./FeatureEffect-CDEk9Es7-CW8HxX_m.js";import"./FeatureFilter-BCFHgLVU-DU6FY8I7.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js";import"./featureLayerUtils-DgfQQyK4-D0OGSvJx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-CsM0tB0E.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./labelUtils-BW14kBqX-Cu1LInU4.js";let d=class extends D{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=A(!1,!1),this.type="wfs",this.refresh=W(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:o}=await this._workerHandler.refresh(e);return o&&(this.sourceJSON.extent=o),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const o=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:o})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,o={}){const s=await this.queryFeaturesJSON(e,o);return se.fromJSON(s)}async queryFeaturesJSON(e,o={}){return await this.load(o),this._workerHandler.queryFeatures(e?e.toJSON():void 0,o)}async queryFeatureCount(e,o={}){return await this.load(o),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,o)}async queryObjectIds(e,o={}){return await this.load(o),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,o)}async queryExtent(e,o={}){await this.load(o);const s=await this._workerHandler.queryExtent(e?e.toJSON():void 0,o);return{count:s.count,extent:I.fromJSON(s.extent)}}async querySnapping(e,o={}){return await this.load(o),this._workerHandler.querySnapping(e,o)}async _createLoadOptions(e){const{url:o,customParameters:s,name:n,namespaceUri:p,fields:a,geometryType:m,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,swapXY:v}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!o)throw new X("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await te(o,{customParameters:s,...e}));const P=["fields","geometryType","name","namespaceUri","swapXY"].some(F=>this.layer[F]==null),l=P?await re(this.wfsCapabilities,n,p,{spatialReference:c,customParameters:s,signal:e?.signal}):{...ie(a??[]),geometryType:m,name:n,namespaceUri:p,spatialReference:c,swapXY:v},q=oe(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),j=h.toJSON(l.geometryType),{operations:x}=this.wfsCapabilities,_=x.GetFeature.url,N=x.GetFeature.outputFormat;return{customParameters:s,featureType:q,fields:l.fields?.map(F=>F.toJSON())??[],geometryField:l.geometryField,geometryType:j,getFeatureUrl:_,getFeatureOutputFormat:N,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,objectIdField:l.objectIdField,spatialReference:l.spatialReference?.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[o,s]=await L([this._createLoadOptions(e),z("WFSSourceWorker",{...e,strategy:H("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=o.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=o.value;this._connection=s.value,this._workerHandler=this._connection.createInvokeProxy();const m=await this._workerHandler.load(a,e);for(const u of m.warnings)Q.getLogger(this.layer).warn("#load()",`${u.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:u});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:G},extent:m.extent,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:M(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:a.maxRecordCount,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};t([r()],d.prototype,"capabilities",void 0),t([r({constructOnly:!0})],d.prototype,"layer",void 0),t([r()],d.prototype,"sourceJSON",void 0),t([r()],d.prototype,"type",void 0),t([r()],d.prototype,"wfsCapabilities",void 0),d=t([R("esri.layers.graphics.sources.WFSSource")],d);var b;const S=Oe();let i=b=class extends me(ne(le(pe(ae(fe(ye(ce(de(ue(B(K))))))))))){static fromWFSLayerInfo(e){const{customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c}=e;return new b({customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=C.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),O(this.renderer,this.fieldsIndex),E(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,o,s){const n=e.filter(p=>p.name!==ee);this.geometryField&&n.unshift(new T({name:this.geometryField,alias:this.geometryField,type:"geometry"})),U(s,n.map(p=>p.toJSON()),o)}get parsedUrl(){return J(this.url)}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return Ce(this,e)}createQuery(){const e=new y({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:o,timeExtent:s}=this;return e.timeExtent=o!=null&&s!=null?s.offset(-o.value,o.unit):s||null,e}getFieldDomain(e,o){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,o){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),o)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,o){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),o))}queryFeatureCount(e,o){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),o))}queryExtent(e,o){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),o))}async hasDataChanged(){try{const{dataChanged:e,updates:o}=await this.source.refresh();return o!=null&&this.read(o,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};t([r({readOnly:!0})],i.prototype,"capabilities",null),t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"createQueryVersion",null),t([r({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],i.prototype,"customParameters",void 0),t([r($("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r(he)],i.prototype,"elevationInfo",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"featureUrl",void 0),t([r({type:[T],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],i.prototype,"fields",void 0),t([k("fields")],i.prototype,"writeFields",null),t([r(S.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:I,json:{name:"extent"}})],i.prototype,"fullExtent",void 0),t([r()],i.prototype,"geometryField",void 0),t([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:h.read},write:{target:"layerDefinition.geometryType",writer:h.write,ignoreOrigin:!0},origins:{service:{read:h.read}}}})],i.prototype,"geometryType",void 0),t([r({type:String})],i.prototype,"id",void 0),t([r(ge)],i.prototype,"labelsVisible",void 0),t([r({type:[Se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Re},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(we)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"]})],i.prototype,"listMode",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({type:["WFS"]})],i.prototype,"operationalLayerType",void 0),t([r({type:f,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"maxRecordCount",void 0),t([r({type:f})],i.prototype,"maxPageCount",void 0),t([r({type:f})],i.prototype,"maxTotalRecordCount",void 0),t([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],i.prototype,"mode",void 0),t([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"name",void 0),t([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"namespaceUri",void 0),t([r(ve)],i.prototype,"opacity",void 0),t([r(S.outFields)],i.prototype,"outFields",void 0),t([r({readOnly:!0})],i.prototype,"parsedUrl",null),t([r(Fe)],i.prototype,"popupEnabled",void 0),t([r({type:Y,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({types:V,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:Z,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],i.prototype,"renderer",null),t([r(be)],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r({readOnly:!0})],i.prototype,"source",void 0),t([r({type:C,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],i.prototype,"spatialReference",void 0),t([r({readOnly:!0,type:[f],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"spatialReferences",void 0),t([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"swapXY",void 0),t([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],i.prototype,"title",void 0),t([r({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([r(xe)],i.prototype,"url",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"version",void 0),t([r()],i.prototype,"wfsCapabilities",null),i=b=t([R("esri.layers.WFSLayer")],i);const Vt=i;export{Vt as default}; diff --git a/main/assets/WFSLayer-DKnx5V8b-hsBbBIQ2.js b/main/assets/WFSLayer-DKnx5V8b-hsBbBIQ2.js deleted file mode 100644 index 95a780459..000000000 --- a/main/assets/WFSLayer-DKnx5V8b-hsBbBIQ2.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as r,i as R,J as C,bT as O,em as E,el as U,a as J,bQ as $,ac as k,n as I,bW as h,bB as f,bL as Y,aB as D,bp as W,o as X,iF as L,K as H,a1 as Q,cY as G}from"./main-BZaw9FpY.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{m as V,u as Z}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{m as B}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as K}from"./Layer-ChoECxvZ-C4wLrCej.js";import{q as z}from"./workers-PiCjreoO-oGzLvkSt.js";import{$ as A,d as M}from"./clientSideDefaults-BqqayPct-BMC57bnT.js";import{x as ee,r as te,c as re,G as ie,v as oe}from"./wfsUtils-DoLaqXsj-BVPAm0Zv.js";import{O as se}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{u as ae}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import{l as pe}from"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import{E as de}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{p as me}from"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import{C as ue}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as ye}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as ce}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{$ as he,Y as ge,_ as we,K as ve,X as Fe,V as be,Z as xe}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{y as T}from"./Field-C6hA1tZj-CbELM0zp.js";import{f as Oe}from"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import{C as Se,q as Re}from"./labelingInfo-DGVNul26-CXiwzGiu.js";import{b as y}from"./Query-BrwMGK8U-sojFdYaD.js";import{w as Ce}from"./popupUtils-B0uZcXX0-BqljON9c.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./geojson-CNt_qtQf-BQNqVsVZ.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";let d=class extends D{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=A(!1,!1),this.type="wfs",this.refresh=W(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:o}=await this._workerHandler.refresh(e);return o&&(this.sourceJSON.extent=o),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const o=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:o})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,o={}){const s=await this.queryFeaturesJSON(e,o);return se.fromJSON(s)}async queryFeaturesJSON(e,o={}){return await this.load(o),this._workerHandler.queryFeatures(e?e.toJSON():void 0,o)}async queryFeatureCount(e,o={}){return await this.load(o),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,o)}async queryObjectIds(e,o={}){return await this.load(o),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,o)}async queryExtent(e,o={}){await this.load(o);const s=await this._workerHandler.queryExtent(e?e.toJSON():void 0,o);return{count:s.count,extent:I.fromJSON(s.extent)}}async querySnapping(e,o={}){return await this.load(o),this._workerHandler.querySnapping(e,o)}async _createLoadOptions(e){const{url:o,customParameters:s,name:n,namespaceUri:p,fields:a,geometryType:m,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,swapXY:v}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!o)throw new X("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await te(o,{customParameters:s,...e}));const P=["fields","geometryType","name","namespaceUri","swapXY"].some(F=>this.layer[F]==null),l=P?await re(this.wfsCapabilities,n,p,{spatialReference:c,customParameters:s,signal:e?.signal}):{...ie(a??[]),geometryType:m,name:n,namespaceUri:p,spatialReference:c,swapXY:v},q=oe(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),j=h.toJSON(l.geometryType),{operations:x}=this.wfsCapabilities,_=x.GetFeature.url,N=x.GetFeature.outputFormat;return{customParameters:s,featureType:q,fields:l.fields?.map(F=>F.toJSON())??[],geometryField:l.geometryField,geometryType:j,getFeatureUrl:_,getFeatureOutputFormat:N,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,objectIdField:l.objectIdField,spatialReference:l.spatialReference?.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[o,s]=await L([this._createLoadOptions(e),z("WFSSourceWorker",{...e,strategy:H("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=o.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=o.value;this._connection=s.value,this._workerHandler=this._connection.createInvokeProxy();const m=await this._workerHandler.load(a,e);for(const u of m.warnings)Q.getLogger(this.layer).warn("#load()",`${u.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:u});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:G},extent:m.extent,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:M(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:a.maxRecordCount,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};t([r()],d.prototype,"capabilities",void 0),t([r({constructOnly:!0})],d.prototype,"layer",void 0),t([r()],d.prototype,"sourceJSON",void 0),t([r()],d.prototype,"type",void 0),t([r()],d.prototype,"wfsCapabilities",void 0),d=t([R("esri.layers.graphics.sources.WFSSource")],d);var b;const S=Oe();let i=b=class extends me(ne(le(pe(ae(fe(ye(ce(de(ue(B(K))))))))))){static fromWFSLayerInfo(e){const{customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c}=e;return new b({customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=C.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),O(this.renderer,this.fieldsIndex),E(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,o,s){const n=e.filter(p=>p.name!==ee);this.geometryField&&n.unshift(new T({name:this.geometryField,alias:this.geometryField,type:"geometry"})),U(s,n.map(p=>p.toJSON()),o)}get parsedUrl(){return J(this.url)}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return Ce(this,e)}createQuery(){const e=new y({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:o,timeExtent:s}=this;return e.timeExtent=o!=null&&s!=null?s.offset(-o.value,o.unit):s||null,e}getFieldDomain(e,o){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,o){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),o)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,o){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),o))}queryFeatureCount(e,o){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),o))}queryExtent(e,o){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),o))}async hasDataChanged(){try{const{dataChanged:e,updates:o}=await this.source.refresh();return o!=null&&this.read(o,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};t([r({readOnly:!0})],i.prototype,"capabilities",null),t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"createQueryVersion",null),t([r({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],i.prototype,"customParameters",void 0),t([r($("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r(he)],i.prototype,"elevationInfo",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"featureUrl",void 0),t([r({type:[T],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],i.prototype,"fields",void 0),t([k("fields")],i.prototype,"writeFields",null),t([r(S.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:I,json:{name:"extent"}})],i.prototype,"fullExtent",void 0),t([r()],i.prototype,"geometryField",void 0),t([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:h.read},write:{target:"layerDefinition.geometryType",writer:h.write,ignoreOrigin:!0},origins:{service:{read:h.read}}}})],i.prototype,"geometryType",void 0),t([r({type:String})],i.prototype,"id",void 0),t([r(ge)],i.prototype,"labelsVisible",void 0),t([r({type:[Se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Re},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(we)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"]})],i.prototype,"listMode",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({type:["WFS"]})],i.prototype,"operationalLayerType",void 0),t([r({type:f,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"maxRecordCount",void 0),t([r({type:f})],i.prototype,"maxPageCount",void 0),t([r({type:f})],i.prototype,"maxTotalRecordCount",void 0),t([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],i.prototype,"mode",void 0),t([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"name",void 0),t([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"namespaceUri",void 0),t([r(ve)],i.prototype,"opacity",void 0),t([r(S.outFields)],i.prototype,"outFields",void 0),t([r({readOnly:!0})],i.prototype,"parsedUrl",null),t([r(Fe)],i.prototype,"popupEnabled",void 0),t([r({type:Y,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({types:V,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:Z,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],i.prototype,"renderer",null),t([r(be)],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r({readOnly:!0})],i.prototype,"source",void 0),t([r({type:C,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],i.prototype,"spatialReference",void 0),t([r({readOnly:!0,type:[f],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"spatialReferences",void 0),t([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"swapXY",void 0),t([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],i.prototype,"title",void 0),t([r({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([r(xe)],i.prototype,"url",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"version",void 0),t([r()],i.prototype,"wfsCapabilities",null),i=b=t([R("esri.layers.WFSLayer")],i);const Vt=i;export{Vt as default}; diff --git a/main/assets/WFSSourceWorker-CI7-tY7M-CH9AAWT2.js b/main/assets/WFSSourceWorker-CI7-tY7M-CH9AAWT2.js deleted file mode 100644 index 7309df4b2..000000000 --- a/main/assets/WFSSourceWorker-CI7-tY7M-CH9AAWT2.js +++ /dev/null @@ -1 +0,0 @@ -import{o as y,$ as c,cY as T,ay as E,a1 as g,b0 as _,aU as w,aC as I}from"./main-BZaw9FpY.js";import{z as P,n as q}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{I as b}from"./FeatureStore-Co2V0sVE-CXrTGv5U.js";import{f as j,h as $}from"./queryUtils-Brxu6254-DDAvXp_C.js";import{Z as O}from"./QueryEngine-CH5uUhZK-D2fBx3cq.js";import{X as Q,_ as M}from"./geojson-CNt_qtQf-BQNqVsVZ.js";import{F as N}from"./sourceUtils-BMeqkJ5g-CD_x4f6t.js";import{V as k,b as L,I as f}from"./wfsUtils-DoLaqXsj-BVPAm0Zv.js";import{o as Z}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-DBAJ8yky.js";import"./PooledRBush-DbfAmeLn-DzJ6h3wI.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-DVbPitWZ.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./utils-HtkT8Fn3-DRbEu-K5.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-D-5zlVyA.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./utils-tNxq3jkf-ni0gpzk6.js";import"./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./signal-CETehA7D-vStzfbaY.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./Field-C6hA1tZj-CbELM0zp.js";const x="esri.layers.WFSLayer";class Zt{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:a,getFeatureOutputFormat:s,fields:n,geometryType:u,featureType:o,maxRecordCount:i,maxTotalRecordCount:h,maxPageCount:R,objectIdField:d,customParameters:F}=e,{spatialReference:p,getFeatureSpatialReference:l}=k(a,o,e.spatialReference);try{await j(l,p)}catch{throw new y("unsupported-projection","Projection not supported",{inSpatialReference:l,outSpatialReference:p})}c(t),this._customParameters=F,this._featureType=o,this._fieldsIndex=Z.fromLayerJSON({fields:n,dateFieldsTimeReference:n.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:T}:null}),this._geometryType=u,this._getFeatureUrl=a,this._getFeatureOutputFormat=s,this._getFeatureSpatialReference=l,this._maxRecordCount=i,this._maxTotalRecordCount=h,this._maxPageCount=R,this._objectIdField=d,this._spatialReference=p;let m=await this._snapshotFeatures(t);if(m.errors.length>0&&(this._supportsPagination=!1,m=await this._snapshotFeatures(t),m.errors.length>0))throw m.errors[0];return this._queryEngine=new O({fieldsIndex:this._fieldsIndex,geometryType:u,hasM:!1,hasZ:!1,objectIdField:d,spatialReference:p,timeInfo:null,featureStore:new b({geometryType:u,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(m.features),{warnings:C(m),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new y("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=E(t=>this._snapshotFeatures({signal:t})),this._snapshotTask.promise.then(t=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(t.features);for(const a of C(t))g.getLogger(x).warn(new _("wfs-layer:refresh-warning",a.message,a.details));t.errors?.length&&g.getLogger(x).warn(new _("wfs-layer:refresh-error","Refresh completed with errors",{errors:t.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,a=this._maxTotalRecordCount,s=this._maxPageCount,n=this._supportsPagination?await L(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let u=[];const o=[];if(n==null)try{u=await this._singleQuery(t)}catch(i){w(i)||o.push(i)}else{const i=Math.min(n,a),h=U(this,Math.max(1,Math.min(Math.ceil(i/this._maxRecordCount),s)),t);await Promise.allSettled(Array.from({length:10}).map(()=>J(h,u,o)))}return c(t),{features:u,totalRecordCount:n,maxTotalRecordCount:a,maxPageCount:s,errors:o}}async _singleQuery(e){const t=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const a=e*this._maxRecordCount,s=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:a,count:this._maxRecordCount,signal:t});return this._processGeoJSON(s,{startIndex:a,signal:t})}_processGeoJSON(e,t){Q(e,this._getFeatureSpatialReference.wkid);const{startIndex:a,signal:s}=t;c(s);const n=M(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!I(this._spatialReference,this._getFeatureSpatialReference))for(const o of n)o.geometry!=null&&(o.geometry=P($(q(o.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let u=a??1;for(const o of n){const i={};N(this._fieldsIndex,i,o.attributes,!0),o.attributes=i,i[this._objectIdField]==null&&(o.objectId=i[this._objectIdField]=u++)}return n}}function*U(r,e,t){for(let a=0;ar.maxTotalRecordCount&&e.push({name:"wfs-layer:large-dataset",message:`The number of ${r.totalRecordCount} features exceeds the maximum allowed of ${r.maxTotalRecordCount}.`,details:{recordCount:r.features.length,totalRecordCount:r.totalRecordCount,maxTotalRecordCount:r.maxTotalRecordCount}})),e}export{Zt as default}; diff --git a/main/assets/WFSSourceWorker-CI7-tY7M-DYcjFTzR.js b/main/assets/WFSSourceWorker-CI7-tY7M-DYcjFTzR.js new file mode 100644 index 000000000..5b8229852 --- /dev/null +++ b/main/assets/WFSSourceWorker-CI7-tY7M-DYcjFTzR.js @@ -0,0 +1 @@ +import{o as y,$ as c,cY as T,ay as E,a1 as g,b0 as _,aU as w,aC as I}from"./main-C7yV2j71.js";import{z as P,n as q}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{I as b}from"./FeatureStore-Co2V0sVE-BoTs_3tu.js";import{f as j,h as $}from"./queryUtils-Brxu6254-T3UhaATW.js";import{Z as O}from"./QueryEngine-CH5uUhZK-DnnsKt6q.js";import{X as Q,_ as M}from"./geojson-CNt_qtQf-utywq02B.js";import{F as N}from"./sourceUtils-BMeqkJ5g-C2dbTHus.js";import{V as k,b as L,I as f}from"./wfsUtils-DoLaqXsj-CcouY8qc.js";import{o as Z}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-mEMXylgh.js";import"./PooledRBush-DbfAmeLn-dj1fSLWj.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BnQYlj-C.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-DhyPlt5p.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./utils-HtkT8Fn3-d1uN_zlY.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-DkAWn-U5.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./utils-tNxq3jkf-DW91Ot0z.js";import"./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./signal-CETehA7D-DxK1orqE.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";const x="esri.layers.WFSLayer";class Zt{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:a,getFeatureOutputFormat:s,fields:n,geometryType:u,featureType:o,maxRecordCount:i,maxTotalRecordCount:h,maxPageCount:R,objectIdField:d,customParameters:F}=e,{spatialReference:p,getFeatureSpatialReference:l}=k(a,o,e.spatialReference);try{await j(l,p)}catch{throw new y("unsupported-projection","Projection not supported",{inSpatialReference:l,outSpatialReference:p})}c(t),this._customParameters=F,this._featureType=o,this._fieldsIndex=Z.fromLayerJSON({fields:n,dateFieldsTimeReference:n.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:T}:null}),this._geometryType=u,this._getFeatureUrl=a,this._getFeatureOutputFormat=s,this._getFeatureSpatialReference=l,this._maxRecordCount=i,this._maxTotalRecordCount=h,this._maxPageCount=R,this._objectIdField=d,this._spatialReference=p;let m=await this._snapshotFeatures(t);if(m.errors.length>0&&(this._supportsPagination=!1,m=await this._snapshotFeatures(t),m.errors.length>0))throw m.errors[0];return this._queryEngine=new O({fieldsIndex:this._fieldsIndex,geometryType:u,hasM:!1,hasZ:!1,objectIdField:d,spatialReference:p,timeInfo:null,featureStore:new b({geometryType:u,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(m.features),{warnings:C(m),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new y("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=E(t=>this._snapshotFeatures({signal:t})),this._snapshotTask.promise.then(t=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(t.features);for(const a of C(t))g.getLogger(x).warn(new _("wfs-layer:refresh-warning",a.message,a.details));t.errors?.length&&g.getLogger(x).warn(new _("wfs-layer:refresh-error","Refresh completed with errors",{errors:t.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,a=this._maxTotalRecordCount,s=this._maxPageCount,n=this._supportsPagination?await L(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let u=[];const o=[];if(n==null)try{u=await this._singleQuery(t)}catch(i){w(i)||o.push(i)}else{const i=Math.min(n,a),h=U(this,Math.max(1,Math.min(Math.ceil(i/this._maxRecordCount),s)),t);await Promise.allSettled(Array.from({length:10}).map(()=>J(h,u,o)))}return c(t),{features:u,totalRecordCount:n,maxTotalRecordCount:a,maxPageCount:s,errors:o}}async _singleQuery(e){const t=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const a=e*this._maxRecordCount,s=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:a,count:this._maxRecordCount,signal:t});return this._processGeoJSON(s,{startIndex:a,signal:t})}_processGeoJSON(e,t){Q(e,this._getFeatureSpatialReference.wkid);const{startIndex:a,signal:s}=t;c(s);const n=M(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!I(this._spatialReference,this._getFeatureSpatialReference))for(const o of n)o.geometry!=null&&(o.geometry=P($(q(o.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let u=a??1;for(const o of n){const i={};N(this._fieldsIndex,i,o.attributes,!0),o.attributes=i,i[this._objectIdField]==null&&(o.objectId=i[this._objectIdField]=u++)}return n}}function*U(r,e,t){for(let a=0;ar.maxTotalRecordCount&&e.push({name:"wfs-layer:large-dataset",message:`The number of ${r.totalRecordCount} features exceeds the maximum allowed of ${r.maxTotalRecordCount}.`,details:{recordCount:r.features.length,totalRecordCount:r.totalRecordCount,maxTotalRecordCount:r.maxTotalRecordCount}})),e}export{Zt as default}; diff --git a/main/assets/WGLContainer-LxgEo4I_-BLj3WxOd.js b/main/assets/WGLContainer-LxgEo4I_-BLj3WxOd.js new file mode 100644 index 000000000..c673288e6 --- /dev/null +++ b/main/assets/WGLContainer-LxgEo4I_-BLj3WxOd.js @@ -0,0 +1,3619 @@ +import{K as j,O as ve,aA as Ee,a1 as Se,ah as ft,o as Te,iW as Oe}from"./main-C7yV2j71.js";import{S as dt,W as _t,X as mt,Y as vt,t as ue,G as Ae,w as F,z as Pe,B as Ze}from"./definitions-DJSdSb77-DkoRHaVx.js";import{p as le,M as ne,s as Ke,T as pt,Z as gt,V as R,G as ht}from"./LabelMetric-BeluzH3o-CQPyji82.js";import{r as k}from"./BufferObject-BM_7mcDb-CTo2uuE5.js";import{M as B,I as P,T as A,n as W,A as N,L as U,D as Q,C as xt,G as yt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as K}from"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import{n as ie}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{c as St,d as ce}from"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import{l as pe,H as Tt,K as bt}from"./Tile-D75RMC64-CM0vKD9b.js";import{Q as qe,E as ge,k as It}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as oe,N as he,S as Ce,E as ee,o as Et,q as Ot}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{_ as At,Z as Pt}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{o as Ct}from"./vec3f32-BS0cezmI-B_madU1n.js";import{T as $e,x as Dt}from"./Container-BcuL1ZEG-DU-CDj3E.js";import{s as Rt}from"./TileKey-C5IL-JBr-COMthbrT.js";import{H as Lt,V as Mt}from"./Texture-BCt2hphT-CtQVMDnp.js";import{i as J,n as G,u as De}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as zt,e as Vt}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{e as Re}from"./config-nuMERBvb-MDUrh2eL.js";import{m as Nt}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{m as wt}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Le}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as Ft,O as Bt}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{c as Me}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";let Ut=class{constructor(i,e){this._rctx=i,this._attributes=[{name:"position",offset:0,type:P.SHORT,count:2}],this.layout={hash:gt(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=k.createVertex(i,W.STATIC_DRAW,new Uint16Array(e)),this._vao=new K(i,new Map([["a_position",0]]),new Map([["geometry",[new ie("a_position",2,P.SHORT,0,4)]]]),new Map([["geometry",this._vertexBuffer]])),this._count=e.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(A.TRIANGLE_STRIP,0,this._count)}},Z=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(i,e){}draw(i,e,t){}drawMany(i,e,t){for(const o of e)o.visible&&this.draw(i,o,t)}};const de={nearest:{defines:[],samplingMode:B.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:B.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:B.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:B.LINEAR_MIPMAP_LINEAR,mips:!0}},Gt=(i,e,t)=>{if(t.samplingMode==="dynamic"){const{state:o}=i,a=e.resolution/e.pixelRatio/o.resolution,r=Math.round(i.pixelRatio)!==i.pixelRatio,l=a>1.05||a<.95;return o.rotation||l||r||e.isSourceScaled||e.rotation?de.bilinear:de.nearest}return de[t.samplingMode]};let Yt=class extends Z{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:i}){i.setBlendingEnabled(!0),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!0)}draw(i,e){const{context:t,renderingOptions:o,painter:a,requestRender:r,allowDelayedRender:l}=i;if(!e.source||!e.isReady)return;const n=Gt(i,e,o),s=a.materialManager.getProgram(this._desc,n.defines);if(l&&r!=null&&!s.compiled)return void r();i.timeline.begin(this.name),e.blendFunction==="additive"?t.setBlendFunctionSeparate(N.ONE,N.ONE,N.ONE,N.ONE):t.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),t.setStencilFunction(U.EQUAL,e.stencilRef,255),this._quad||(this._quad=new Ut(t,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:u,transforms:f}=e;e.setSamplingProfile(n),e.bind(i.context,Ae),t.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",f.displayViewScreenMat3),s.setUniform1i("u_texture",Ae),s.setUniform2fv("u_coordScale",c),s.setUniform1f("u_opacity",u),this._quad.draw(),i.timeline.end(this.name)}};function je(){return new Float32Array(4)}function kt(i){const e=new Float32Array(4);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e}function H(i,e,t,o){const a=new Float32Array(4);return a[0]=i,a[1]=e,a[2]=t,a[3]=o,a}function Ht(i,e){return new Float32Array(i,e,4)}function Xe(){return je()}function Qe(){return H(1,1,1,1)}function Je(){return H(1,0,0,0)}function et(){return H(0,1,0,0)}function tt(){return H(0,0,1,0)}function it(){return H(0,0,0,1)}const Wt=Xe(),Zt=Qe(),Kt=Je(),qt=et(),$t=tt(),jt=it();Object.freeze(Object.defineProperty({__proto__:null,ONES:Zt,UNIT_W:jt,UNIT_X:Kt,UNIT_Y:qt,UNIT_Z:$t,ZEROS:Wt,clone:kt,create:je,createView:Ht,fromValues:H,ones:Qe,unitW:it,unitX:Je,unitY:et,unitZ:tt,zeros:Xe},Symbol.toStringTag,{value:"Module"}));const Xt={background:{"background.frag":`uniform lowp vec4 u_color; +void main() { +gl_FragColor = u_color; +}`,"background.vert":`attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform mediump vec2 u_coord_range; +uniform mediump float u_depth; +void main() { +vec3 v_pos = u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0); +gl_Position = vec4(v_pos.xy, 0.0, 1.0); +}`},bitBlit:{"bitBlit.frag":`uniform lowp sampler2D u_tex; +uniform lowp float u_opacity; +varying mediump vec2 v_uv; +void main() { +lowp vec4 color = texture2D(u_tex, v_uv); +gl_FragColor = color * u_opacity; +}`,"bitBlit.vert":`attribute vec2 a_pos; +attribute vec2 a_tex; +varying mediump vec2 v_uv; +void main(void) { +gl_Position = vec4(a_pos , 0.0, 1.0); +v_uv = a_tex; +}`},debug:{overlay:{"overlay.frag":`precision mediump float; +varying vec4 v_color; +void main(void) { +gl_FragColor = v_color; +}`,"overlay.vert":`attribute vec3 a_PositionAndFlags; +uniform mat3 u_dvsMat3; +uniform vec4 u_colors[4]; +uniform float u_opacities[4]; +varying vec4 v_color; +void main(void) { +vec2 position = a_PositionAndFlags.xy; +float flags = a_PositionAndFlags.z; +int colorIndex = int(mod(flags, 4.0)); +vec4 color; +for (int i = 0; i < 4; i++) { +color = u_colors[i]; +if (i == colorIndex) { +break; +} +} +int opacityIndex = int(mod(floor(flags / 4.0), 4.0)); +float opacity; +for (int i = 0; i < 4; i++) { +opacity = u_opacities[i]; +if (i == opacityIndex) { +break; +} +} +v_color = color * opacity; +gl_Position = vec4((u_dvsMat3 * vec3(position, 1.0)).xy, 0.0, 1.0); +}`}},dot:{dot:{"dot.frag":`precision mediump float; +varying vec4 v_color; +varying float v_dotRatio; +varying float v_invEdgeRatio; +uniform highp float u_tileZoomFactor; +void main() +{ +float dist = length(gl_PointCoord - vec2(.5, .5)) * 2.; +float alpha = smoothstep(0., 1., v_invEdgeRatio * (dist - v_dotRatio) + 1.); +gl_FragColor = v_color * alpha; +}`,"dot.vert":`precision highp float; +attribute vec2 a_pos; +uniform sampler2D u_texture; +uniform highp mat3 u_dvsMat3; +uniform highp float u_tileZoomFactor; +uniform highp float u_dotSize; +uniform highp float u_pixelRatio; +varying vec2 v_pos; +varying vec4 v_color; +varying float v_dotRatio; +varying float v_invEdgeRatio; +const float EPSILON = 0.000001; +void main() +{ +mat3 tileToTileTexture = mat3( 1., 0., 0., +0., -1., 0., +0., 1., 1. ); +vec3 texCoords = tileToTileTexture * vec3(a_pos.xy / 512., 1.); +v_color = texture2D(u_texture, texCoords.xy); +float smoothEdgeWidth = max(u_dotSize / 2., 1.) ; +float z = 0.; +z += 2.0 * step(v_color.a, EPSILON); +gl_PointSize = (smoothEdgeWidth + u_dotSize); +gl_Position = vec4((u_dvsMat3 * vec3(a_pos + .5, 1.)).xy, z, 1.); +v_dotRatio = u_dotSize / gl_PointSize; +v_invEdgeRatio = -1. / ( smoothEdgeWidth / gl_PointSize ); +gl_PointSize *= (u_pixelRatio * u_tileZoomFactor); +}`}},filtering:{"bicubic.glsl":`vec4 computeWeights(float v) { +float b = 1.0 / 6.0; +float v2 = v * v; +float v3 = v2 * v; +float w0 = b * (-v3 + 3.0 * v2 - 3.0 * v + 1.0); +float w1 = b * (3.0 * v3 - 6.0 * v2 + 4.0); +float w2 = b * (-3.0 * v3 + 3.0 * v2 + 3.0 * v + 1.0); +float w3 = b * v3; +return vec4(w0, w1, w2, w3); +} +vec4 bicubicOffsetsAndWeights(float v) { +vec4 w = computeWeights(v); +float g0 = w.x + w.y; +float g1 = w.z + w.w; +float h0 = 1.0 - (w.y / g0) + v; +float h1 = 1.0 + (w.w / g1) - v; +return vec4(h0, h1, g0, g1); +} +vec4 sampleBicubicBSpline(sampler2D sampler, vec2 coords, vec2 texSize) { +vec2 eX = vec2(1.0 / texSize.x, 0.0); +vec2 eY = vec2(0.0, 1.0 / texSize.y); +vec2 texel = coords * texSize - 0.5; +vec3 hgX = bicubicOffsetsAndWeights(fract(texel).x).xyz; +vec3 hgY = bicubicOffsetsAndWeights(fract(texel).y).xyz; +vec2 coords10 = coords + hgX.x * eX; +vec2 coords00 = coords - hgX.y * eX; +vec2 coords11 = coords10 + hgY.x * eY; +vec2 coords01 = coords00 + hgY.x * eY; +coords10 = coords10 - hgY.y * eY; +coords00 = coords00 - hgY.y * eY; +vec4 color00 = texture2D(sampler, coords00); +vec4 color10 = texture2D(sampler, coords10); +vec4 color01 = texture2D(sampler, coords01); +vec4 color11 = texture2D(sampler, coords11); +color00 = mix(color00, color01, hgY.z); +color10 = mix(color10, color11, hgY.z); +color00 = mix(color00, color10, hgX.z); +return color00; +}`,"bilinear.glsl":`vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) { +vec2 texelStart = floor(coords * texSize); +vec2 coord0 = texelStart / texSize; +vec2 coord1 = (texelStart + vec2(1.0, 0.0)) / texSize; +vec2 coord2 = (texelStart + vec2(0.0, 1.0)) / texSize; +vec2 coord3 = (texelStart + vec2(1.0, 1.0)) / texSize; +vec4 color0 = texture2D(sampler, coord0); +vec4 color1 = texture2D(sampler, coord1); +vec4 color2 = texture2D(sampler, coord2); +vec4 color3 = texture2D(sampler, coord3); +vec2 blend = fract(coords * texSize); +vec4 color01 = mix(color0, color1, blend.x); +vec4 color23 = mix(color2, color3, blend.x); +vec4 color = mix(color01, color23, blend.y); +#ifdef NNEDGE +float alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5); +color = color * alpha + (1.0 - alpha) * texture2D(sampler, coords); +#endif +return color; +}`,"epx.glsl":`vec4 sampleEPX(sampler2D sampler, float size, vec2 coords, vec2 texSize) { +vec2 invSize = 1.0 / texSize; +vec2 texel = coords * texSize; +vec2 texel_i = floor(texel); +vec2 texel_frac = fract(texel); +vec4 colorP = texture2D(sampler, texel_i * invSize); +vec4 colorP1 = vec4(colorP); +vec4 colorP2 = vec4(colorP); +vec4 colorP3 = vec4(colorP); +vec4 colorP4 = vec4(colorP); +vec4 colorA = texture2D(sampler, (texel_i - vec2(0.0, 1.0)) * invSize); +vec4 colorB = texture2D(sampler, (texel_i + vec2(1.0, 0.0)) * invSize); +vec4 colorC = texture2D(sampler, (texel_i - vec2(1.0, 0.0)) * invSize); +vec4 colorD = texture2D(sampler, (texel_i + vec2(0.0, 1.0)) * invSize); +if (colorC == colorA && colorC != colorD && colorA != colorB) { +colorP1 = colorA; +} +if (colorA == colorB && colorA != colorC && colorB != colorD) { +colorP2 = colorB; +} +if (colorD == colorC && colorD != colorB && colorC != colorA) { +colorP3 = colorC; +} +if (colorB == colorD && colorB != colorA && colorD != colorC) { +colorP4 = colorD; +} +vec4 colorP12 = mix(colorP1, colorP2, texel_frac.x); +vec4 colorP34 = mix(colorP1, colorP2, texel_frac.x); +return mix(colorP12, colorP34, texel_frac.y); +}`},heatmap:{heatmapResolve:{"heatmapResolve.frag":`precision highp float; +#ifdef HEATMAP_PRECISION_HALF_FLOAT +#define COMPRESSION_FACTOR 4.0 +#else +#define COMPRESSION_FACTOR 1.0 +#endif +uniform sampler2D u_texture; +uniform sampler2D u_gradient; +uniform vec2 u_densityMinAndInvRange; +uniform float u_densityNormalization; +varying vec2 v_uv; +void main() { +vec4 data = texture2D(u_texture, v_uv); +float density = data.r * COMPRESSION_FACTOR; +density *= u_densityNormalization; +density = (density - u_densityMinAndInvRange.x) * u_densityMinAndInvRange.y; +vec4 color = texture2D(u_gradient, vec2(density, 0.5)); +gl_FragColor = vec4(color.rgb * color.a, color.a); +}`,"heatmapResolve.vert":`precision highp float; +attribute vec2 a_pos; +varying vec2 v_uv; +void main() { +v_uv = a_pos; +gl_Position = vec4(a_pos * 2.0 - 1.0, 1., 1.); +}`}},highlight:{"blur.frag":`varying mediump vec2 v_texcoord; +uniform mediump vec4 u_direction; +uniform mediump mat4 u_channelSelector; +uniform mediump float u_sigma; +uniform sampler2D u_texture; +mediump float gauss1(mediump vec2 dir) { +return exp(-dot(dir, dir) / (2.0 * u_sigma * u_sigma)); +} +mediump vec4 selectChannel(mediump vec4 sample) { +return u_channelSelector * sample; +} +void accumGauss1(mediump float i, inout mediump float tot, inout mediump float weight) { +mediump float w = gauss1(i * u_direction.xy); +tot += selectChannel(texture2D(u_texture, v_texcoord + i * u_direction.zw))[3] * w; +weight += w; +} +void main(void) { +mediump float tot = 0.0; +mediump float weight = 0.0; +accumGauss1(-5.0, tot, weight); +accumGauss1(-4.0, tot, weight); +accumGauss1(-3.0, tot, weight); +accumGauss1(-2.0, tot, weight); +accumGauss1(-1.0, tot, weight); +accumGauss1(0.0, tot, weight); +accumGauss1(1.0, tot, weight); +accumGauss1(2.0, tot, weight); +accumGauss1(3.0, tot, weight); +accumGauss1(4.0, tot, weight); +accumGauss1(5.0, tot, weight); +gl_FragColor = vec4(0.0, 0.0, 0.0, tot / weight); +}`,"highlight.frag":`varying mediump vec2 v_texcoord; +uniform sampler2D u_texture; +uniform mediump float u_sigma; +uniform sampler2D u_shade; +uniform mediump vec2 u_minMaxDistance; +mediump float estimateDistance() { +mediump float y = texture2D(u_texture, v_texcoord)[3]; +const mediump float y0 = 0.5; +mediump float m0 = 1.0 / (sqrt(2.0 * 3.1415) * u_sigma); +mediump float d = (y - y0) / m0; +return d; +} +mediump vec4 shade(mediump float d) { +mediump float mappedDistance = (d - u_minMaxDistance.x) / (u_minMaxDistance.y - u_minMaxDistance.x); +mappedDistance = clamp(mappedDistance, 0.0, 1.0); +return texture2D(u_shade, vec2(mappedDistance, 0.5)); +} +void main(void) { +mediump float d = estimateDistance(); +gl_FragColor = shade(d); +}`,"textured.vert":`attribute mediump vec2 a_position; +attribute mediump vec2 a_texcoord; +varying mediump vec2 v_texcoord; +void main(void) { +gl_Position = vec4(a_position, 0.0, 1.0); +v_texcoord = a_texcoord; +}`},materials:{"attributeData.glsl":`uniform highp sampler2D filterFlags; +uniform highp sampler2D animation; +uniform highp sampler2D gpgpu; +uniform highp sampler2D visualVariableData; +uniform highp sampler2D dataDriven0; +uniform highp sampler2D dataDriven1; +uniform highp sampler2D dataDriven2; +uniform float size; +highp vec2 getAttributeDataCoords(in highp vec3 id) { +highp vec3 texel = unpackDisplayIdTexel(id); +highp float u32 = float(int(texel.r) + int(texel.g) * 256 + int(texel.b) * 256 * 256); +highp float col = mod(u32, size); +highp float row = (u32 - col) / size; +highp float u = col / size; +highp float v = row / size; +return vec2(u, v); +} +highp vec2 getAttributeDataTextureCoords(in highp vec3 id) { +return (getAttributeDataCoords(id) * 2.0) - 1.0 + (.5 / vec2(size)); +} +highp vec4 getFilterData(in highp vec3 id) { +vec2 coords = getAttributeDataCoords(id); +return texture2D(filterFlags, coords); +} +highp vec4 getAnimation(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(animation, coords); +} +highp vec4 getVisualVariableData(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(visualVariableData, coords); +} +highp vec4 getDataDriven0(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(dataDriven0, coords); +} +highp vec4 getDataDriven1(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(dataDriven1, coords); +} +highp vec4 getGPGPU(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(gpgpu, coords); +} +highp vec4 getDataDriven2(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(dataDriven2, coords); +} +float u88VVToFloat(in vec2 v) { +bool isMagic = v.x == 255.0 && v.y == 255.0; +if (isMagic) { +return NAN_MAGIC_NUMBER; +} +return (v.x + v.y * float(0x100)) - 32768.0; +}`,"barycentric.glsl":`float inTriangle(vec3 bary) { +vec3 absBary = abs(bary); +return step((absBary.x + absBary.y + absBary.z), 1.05); +} +vec3 xyToBarycentric(in vec2 pos, in vec2 v0, in vec2 v1, in vec2 v2) { +mat3 xyToBarycentricMat3 = mat3( +v1.x * v2.y - v2.x * v1.y, v2.x * v0.y - v0.x * v2.y, v0.x * v1.y - v1.x * v0.y, +v1.y - v2.y, v2.y - v0.y, v0.y - v1.y, +v2.x - v1.x, v0.x - v2.x, v1.x - v0.x +); +float A2 = v0.x * (v1.y - v2.y) + v1.x * (v2.y - v0.y) + v2.x * (v0.y - v1.y); +return (1. / A2) * xyToBarycentricMat3 * vec3(1., pos); +}`,"constants.glsl":`const float C_DEG_TO_RAD = 3.14159265359 / 180.0; +const float C_256_TO_RAD = 3.14159265359 / 128.0; +const float C_RAD_TO_DEG = 180.0 / 3.141592654; +const float POSITION_PRECISION = 1.0 / 8.0; +const float FILL_POSITION_PRECISION = 1.0 / 1.0; +const float SOFT_EDGE_RATIO = 1.0; +const float THIN_LINE_WIDTH_FACTOR = 1.1; +const float THIN_LINE_HALF_WIDTH = 1.0; +const float EXTRUDE_SCALE_PLACEMENT_PADDING = 1.0 / 4.0; +const float OFFSET_PRECISION = 1.0 / 8.0; +const float OUTLINE_SCALE = 1.0 / 5.0; +const float SDF_FONT_SIZE = 24.0; +const float MAX_SDF_DISTANCE = 8.0; +const float PLACEMENT_PADDING = 8.0; +const float EPSILON = 0.00001; +const float EPSILON_HITTEST = 0.05; +const int MAX_FILTER_COUNT = 2; +const int ATTR_VV_SIZE = 0; +const int ATTR_VV_COLOR = 1; +const int ATTR_VV_OPACITY = 2; +const int ATTR_VV_ROTATION = 3; +const highp float NAN_MAGIC_NUMBER = 1e-30; +const int BITSET_GENERIC_LOCK_COLOR = 1; +const int BITSET_GENERIC_CONSIDER_ALPHA_ONLY = 4; +const int BITSET_MARKER_ALIGNMENT_MAP = 0; +const int BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE = 2; +const int BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY = 3; +const int BITSET_TYPE_FILL_OUTLINE = 0; +const int BITSET_FILL_RANDOM_PATTERN_OFFSET = 2; +const int BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR = 3; +const int BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR = 5; +const int BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR = 6; +const int BITSET_LINE_SCALE_DASH = 2;`,fill:{"common.glsl":`#include +#ifdef PATTERN +uniform mediump vec2 u_mosaicSize; +varying mediump float v_sampleAlphaOnly; +#endif +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +uniform lowp vec4 u_isActive[ 2 ]; +uniform highp float u_dotValue; +uniform highp float u_tileDotsOverArea; +uniform highp float u_dotTextureDotCount; +uniform mediump float u_tileZoomFactor; +#endif +varying highp vec3 v_id; +varying lowp vec4 v_color; +varying lowp float v_opacity; +varying mediump vec4 v_aux1; +#ifdef PATTERN +varying mediump vec2 v_tileTextureCoord; +#endif +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +varying lowp float v_isOutline; +#endif +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +varying highp vec2 v_dotTextureCoords; +varying highp vec4 v_dotThresholds[ 2 ]; +#endif`,"fill.frag":`precision highp float; +#include +#include +#include +#ifdef PATTERN +uniform lowp sampler2D u_texture; +#endif +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +uniform mediump mat4 u_dotColors[ 2 ]; +uniform sampler2D u_dotTextures[ 2 ]; +uniform vec4 u_dotBackgroundColor; +#endif +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#include +#include +lowp vec4 drawLine() { +float v_lineWidth = v_aux1.x; +vec2 v_normal = v_aux1.yz; +LineData inputs = LineData( +v_color, +v_normal, +v_lineWidth, +v_opacity, +v_id +); +return shadeLine(inputs); +} +#endif +lowp vec4 drawFill() { +lowp vec4 out_color = vec4(0.); +#ifdef HITTEST +out_color = v_color; +#elif defined(PATTERN) +mediump vec4 v_tlbr = v_aux1; +mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0); +mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); +lowp vec4 color = texture2D(u_texture, samplePos); +if (v_sampleAlphaOnly > 0.5) { +color.rgb = vec3(color.a); +} +out_color = v_opacity * v_color * color; +#elif SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY && !defined(HIGHLIGHT) +vec4 textureThresholds0 = texture2D(u_dotTextures[0], v_dotTextureCoords); +vec4 textureThresholds1 = texture2D(u_dotTextures[1], v_dotTextureCoords); +vec4 difference0 = v_dotThresholds[0] - textureThresholds0; +vec4 difference1 = v_dotThresholds[1] - textureThresholds1; +#ifdef DD_DOT_BLENDING +vec4 isPositive0 = step(0.0, difference0); +vec4 isPositive1 = step(0.0, difference1); +float weightSum = dot(isPositive0, difference0) + dot(isPositive1, difference1); +float lessThanEqZero = step(weightSum, 0.0); +float greaterThanZero = 1.0 - lessThanEqZero ; +float divisor = (weightSum + lessThanEqZero); +vec4 weights0 = difference0 * isPositive0 / divisor; +vec4 weights1 = difference1 * isPositive1 / divisor; +vec4 dotColor = u_dotColors[0] * weights0 + u_dotColors[1] * weights1; +vec4 preEffectColor = greaterThanZero * dotColor + lessThanEqZero * u_dotBackgroundColor; +#else +float diffMax = max(max4(difference0), max4(difference1)); +float lessThanZero = step(diffMax, 0.0); +float greaterOrEqZero = 1.0 - lessThanZero; +vec4 isMax0 = step(diffMax, difference0); +vec4 isMax1 = step(diffMax, difference1); +vec4 dotColor = u_dotColors[0] * isMax0 + u_dotColors[1] * isMax1; +vec4 preEffectColor = greaterOrEqZero * dotColor + lessThanZero * u_dotBackgroundColor; +#endif +out_color = preEffectColor; +#else +out_color = v_opacity * v_color; +#endif +#ifdef HIGHLIGHT +out_color.a = 1.0; +#endif +return out_color; +} +void main() { +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +if (v_isOutline > 0.5) { +gl_FragColor = drawLine(); +} else { +gl_FragColor = drawFill(); +} +#else +gl_FragColor = drawFill(); +#endif +}`,"fill.vert":`#include +#define PACKED_LINE +precision highp float; +attribute float a_bitset; +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +attribute float a_inverseArea; +vec4 a_color = vec4(0.0, 0.0, 0.0, 1.0); +vec2 a_zoomRange = vec2(0.0, 10000.0); +#else +attribute vec4 a_color; +attribute vec4 a_aux2; +attribute vec4 a_aux3; +#ifndef SYMBOLOGY_TYPE_IS_SIMPLE_LIKE +attribute vec4 a_aux1; +attribute vec2 a_zoomRange; +#else +vec2 a_zoomRange = vec2(0.0, 10000.0); +#endif +#endif +uniform vec2 u_tileOffset; +uniform vec2 u_maxIntNumOfCrossing; +#include +#include +#include +#include +const float INV_SCALE_COMPRESSION_FACTOR = 1.0 / 128.0; +const float MAX_REPRESENTABLE_INT = 16777216.0; +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +vec4 dotThreshold(vec4 featureAttrOverFeatureArea, float dotValue, float tileDotsOverArea) { +return featureAttrOverFeatureArea * (1.0 / dotValue) * (1.0 / tileDotsOverArea); +} +#endif +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#include +#include +void drawLine(out lowp vec4 out_color, out highp vec3 out_pos) { +LineData outputs = buildLine( +out_pos, +a_id, +a_pos, +a_color, +(a_aux3.xy - 128.) / 16., +(a_aux3.zw - 128.) / 16., +0., +a_aux2.z / 16., +a_bitset, +vec4(0.), +vec2(0.), +a_aux2.w / 16. +); +v_id = outputs.id; +v_opacity = outputs.opacity; +v_aux1 = vec4(outputs.lineHalfWidth, outputs.normal, 0.); +out_color = outputs.color; +} +#endif +void drawFill(out lowp vec4 out_color, out highp vec3 out_pos) { +float a_bitSet = a_bitset; +out_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR); +v_opacity = getOpacity(); +v_id = norm(a_id); +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +mat3 tileToTileNormalized = mat3( 2. / 512., 0., 0., +0., -2. / 512., 0., +-1., 1., 1. ); +out_pos = tileToTileNormalized * vec3((a_pos * FILL_POSITION_PRECISION), 1.); +#else +out_pos = u_dvsMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.); +#endif +#ifdef PATTERN +vec4 a_tlbr = a_aux1; +float a_width = a_aux2.x; +float a_height = a_aux2.y; +vec2 a_offset = a_aux2.zw; +vec2 a_scale = a_aux3.xy; +float a_angle = a_aux3.z; +if (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR) > 0.5) { +a_width *= INV_SCALE_COMPRESSION_FACTOR; +} +if (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR) > 0.5) { +a_height *= INV_SCALE_COMPRESSION_FACTOR; +} +vec2 scale = INV_SCALE_COMPRESSION_FACTOR * a_scale; +float width = u_zoomFactor * a_width * scale.x; +float height = u_zoomFactor * a_height * scale.y; +float angle = C_256_TO_RAD * a_angle; +float sinA = sin(angle); +float cosA = cos(angle); +float dx = 0.0; +float dy = 0.0; +if (getBit(a_bitset, BITSET_FILL_RANDOM_PATTERN_OFFSET) > 0.5) { +float id = rgba2float(vec4(a_id, 0.0)); +dx = rand(vec2(id, 0.0)); +dy = rand(vec2(0.0, id)); +} +mat3 patternMatrix = mat3(cosA / width, sinA / height, 0, +-sinA / width, cosA / height, 0, +dx, dy, 1); +vec2 patternSize = vec2(a_width, a_height); +vec2 numPatternsPerMaxInt = vec2(MAX_REPRESENTABLE_INT) / patternSize; +vec2 maxIntCrossingOffsetCorrection = patternSize * fract(u_maxIntNumOfCrossing * numPatternsPerMaxInt); +vec2 tileOffset = u_tileOffset + maxIntCrossingOffsetCorrection - 0.5 * patternSize; +tileOffset = vec2(tileOffset.x * cosA - tileOffset.y * sinA, tileOffset.x * sinA + tileOffset.y * cosA); +tileOffset = mod(tileOffset, patternSize); +vec2 symbolOffset = u_zoomFactor * scale * vec2(a_offset - tileOffset) / vec2(width, height); +v_tileTextureCoord = (patternMatrix * vec3(a_pos * FILL_POSITION_PRECISION, 1.0)).xy - symbolOffset; +v_aux1 = a_tlbr / u_mosaicSize.xyxy; +v_sampleAlphaOnly = getBit(a_bitset, BITSET_GENERIC_CONSIDER_ALPHA_ONLY); +if (getBit(a_bitSet, BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR) > 0.5) { +#ifdef VV_COLOR +v_sampleAlphaOnly *= (1.0 - float(isNan(VV_ADATA[ATTR_VV_COLOR]))) * (1.0 - getBit(a_bitSet, BITSET_GENERIC_LOCK_COLOR)); +#else +v_sampleAlphaOnly = 0.0; +#endif +} +#elif SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +vec4 ddAttributeData0 = getAttributeData2(a_id) * u_isActive[0] * a_inverseArea; +vec4 ddAttributeData1 = getAttributeData3(a_id) * u_isActive[1] * a_inverseArea; +float size = u_tileZoomFactor * 512.0 * 1.0 / u_pixelRatio; +v_dotThresholds[0] = dotThreshold(ddAttributeData0, u_dotValue, u_tileDotsOverArea); +v_dotThresholds[1] = dotThreshold(ddAttributeData1, u_dotValue, u_tileDotsOverArea); +v_dotTextureCoords = (a_pos * FILL_POSITION_PRECISION + 0.5) / size; +#endif +} +#ifdef HITTEST +void draw(out lowp vec4 out_color, out highp vec3 out_pos) { +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +if (getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE) > 0.5) { +out_pos = vec3(0., 0., 2.); +return; +} +#endif +hittestFill(out_color, out_pos); +gl_PointSize = 1.0; +} +#elif defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) +void draw(out lowp vec4 out_color, out highp vec3 out_pos) { +v_isOutline = getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE); +if (v_isOutline > 0.5) { +drawLine(out_color, out_pos); +} else { +drawFill(out_color, out_pos); +} +} +#else +#define draw drawFill +#endif +void main() +{ +INIT; +highp vec3 pos = vec3(0.); +highp vec4 color = vec4(0.); +draw(color, pos); +v_color = color; +gl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0); +}`,"hittest.glsl":`#ifdef HITTEST +#include +attribute vec2 a_pos1; +attribute vec2 a_pos2; +void hittestFill( +out lowp vec4 out_color, +out highp vec3 out_pos +) { +vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.); +vec3 pos1 = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * FILL_POSITION_PRECISION, 1.); +vec3 pos2 = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * FILL_POSITION_PRECISION, 1.); +float hittestDist = u_hittestDist; +float dist = distPointTriangle(u_hittestPos, pos.xy, pos1.xy, pos2.xy); +out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); +if (dist < 0. || dist >= hittestDist) { +out_pos.z += 2.0; +} +out_color = vec4(1. / 255., 0, 0, dist == 0. ? (1. / 255.) : 0.); +} +#endif`},hittest:{"common.glsl":`#ifdef HITTEST +uniform float hittestDist; +uniform highp vec2 hittestPos; +float projectScalar(vec2 a, vec2 b) { +return dot(a, normalize(b)); +} +float distPointSegment(vec2 p0, vec2 p1, vec2 p2) { +vec2 L = p2 - p1; +vec2 A = p0 - p1; +float projAL = projectScalar(A, L); +float t = clamp(projAL / length(L), 0., 1.); +return distance(p0, p1 + t * (p2 - p1)); +} +void hittestMarker(out lowp vec4 out_color, out highp vec3 out_pos, in highp vec3 pos, float size) { +float dist = distance(pos, vec3(hittestPos, 1.)); +out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); +if ((dist - size) > hittestDist) { +out_pos.z += 2.0; +} +out_color = vec4(1. / 255., 0, 0, (dist - size) < 0. ? (1. / 255.) : 0.); +} +float intersectPointTriangleBary(vec2 p, vec2 a, vec2 b, vec2 c) { +return inTriangle(xyToBarycentric(p, a, b, c)); +} +float distPointTriangle(vec2 p, vec2 a, vec2 b, vec2 c) { +vec2 ba = b - a; +vec2 ca = c - a; +float crossProduct = ba.x * ca.y - ca.x * ba.y; +bool isParallel = crossProduct < EPSILON_HITTEST && crossProduct > -EPSILON_HITTEST; +if (isParallel) { +return -1.; +} +if (intersectPointTriangleBary(p.xy, a, b, c) == 1.) { +return 0.; +} +float distAB = distPointSegment(p, a, b); +float distBC = distPointSegment(p, b, c); +float distCA = distPointSegment(p, c, a); +return min(min(distAB, distBC), distCA); +} +#endif`},icon:{"common.glsl":`#include +uniform lowp vec2 u_mosaicSize; +varying lowp vec4 v_color; +varying highp vec3 v_id; +varying highp vec4 v_sizeTex; +varying mediump vec3 v_pos; +varying lowp float v_opacity; +uniform lowp sampler2D u_texture; +#ifdef SDF +varying lowp vec4 v_outlineColor; +varying mediump float v_outlineWidth; +varying mediump float v_distRatio; +varying mediump float v_overridingOutlineColor; +varying mediump float v_isThin; +#endif +#ifdef SDF +vec4 getColor(vec2 v_size, vec2 v_tex) { +#ifdef HITTEST +lowp vec4 fillPixelColor = vec4(1.0); +#else +lowp vec4 fillPixelColor = v_color; +#endif +float d = 0.5 - rgba2float(texture2D(u_texture, v_tex)); +float size = max(v_size.x, v_size.y); +float dist = d * size * SOFT_EDGE_RATIO * v_distRatio; +fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0); +float outlineWidth = v_outlineWidth; +#ifdef HIGHLIGHT +outlineWidth = max(outlineWidth, 4.0 * v_isThin); +#endif +if (outlineWidth > 0.25) { +lowp vec4 outlinePixelColor = v_overridingOutlineColor * v_color + (1.0 - v_overridingOutlineColor) * v_outlineColor; +float clampedOutlineSize = min(outlineWidth, size); +outlinePixelColor *= clamp(0.5 - abs(dist) + clampedOutlineSize * 0.5, 0.0, 1.0); +return v_opacity * ((1.0 - outlinePixelColor.a) * fillPixelColor + outlinePixelColor); +} +return v_opacity * fillPixelColor; +} +#else +vec4 getColor(vec2 _v_size, vec2 v_tex) { +lowp vec4 texColor = texture2D(u_texture, v_tex); +return v_opacity * texColor * v_color; +} +#endif`,heatmapAccumulate:{"common.glsl":`varying lowp vec4 v_hittestResult; +varying mediump vec2 v_offsetFromCenter; +varying highp float v_fieldValue;`,"heatmapAccumulate.frag":`precision mediump float; +#include +#ifdef HEATMAP_PRECISION_HALF_FLOAT +#define COMPRESSION_FACTOR 0.25 +#else +#define COMPRESSION_FACTOR 1.0 +#endif +uniform lowp sampler2D u_texture; +void main() { +#ifdef HITTEST +gl_FragColor = v_hittestResult; +#else +float radius = length(v_offsetFromCenter); +float shapeWeight = step(radius, 1.0); +float oneMinusRadiusSquared = 1.0 - radius * radius; +float kernelWeight = oneMinusRadiusSquared * oneMinusRadiusSquared; +gl_FragColor = vec4(shapeWeight * kernelWeight * v_fieldValue * COMPRESSION_FACTOR); +#endif +}`,"heatmapAccumulate.vert":`precision highp float; +attribute vec2 a_vertexOffset; +vec4 a_color = vec4(0.0); +vec2 a_zoomRange = vec2(0.0, 10000.0); +uniform float u_radius; +uniform float u_isFieldActive; +#include +#include +#include +void main() { +float filterFlags = getFilterFlags(); +#ifdef HITTEST +highp vec4 out_hittestResult = vec4(0.); +highp vec3 out_pos = vec3(0.); +vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0); +hittestMarker(out_hittestResult, out_pos, pos, u_radius); +v_hittestResult = out_hittestResult; +gl_PointSize = 1.; +gl_Position = vec4(clip(a_color, out_pos, filterFlags, a_zoomRange), 1.0); +#else +v_offsetFromCenter = sign(a_vertexOffset); +v_fieldValue = getAttributeData2(a_id).x * u_isFieldActive + 1.0 - u_isFieldActive; +vec3 centerPos = u_dvsMat3 * vec3(a_pos * POSITION_PRECISION, 1.0); +vec3 vertexPos = centerPos + u_displayViewMat3 * vec3(v_offsetFromCenter, 0.0) * u_radius; +gl_Position = vec4(clip(a_color, vertexPos, filterFlags, a_zoomRange), 1.0); +#endif +}`},"hittest.glsl":`#ifdef HITTEST +#include +attribute vec2 a_vertexOffset1; +attribute vec2 a_vertexOffset2; +attribute vec2 a_texCoords1; +attribute vec2 a_texCoords2; +vec2 getTextureCoords(in vec3 bary, in vec2 texCoords0, in vec2 texCoords1, in vec2 texCoords2) { +return texCoords0 * bary.x + texCoords1 * bary.y + texCoords2 * bary.z; +} +void hittestIcon( +inout lowp vec4 out_color, +out highp vec3 out_pos, +in vec3 pos, +in vec3 offset, +in vec2 size, +in float scaleFactor, +in float isMapAligned +) { +out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); +vec3 posBase = u_viewMat3 * u_tileMat3 * pos; +vec3 offset1 = scaleFactor * vec3(a_vertexOffset1 / 16.0, 0.); +vec3 offset2 = scaleFactor * vec3(a_vertexOffset2 / 16.0, 0.); +vec2 pos0 = (posBase + getMatrixNoDisplay(isMapAligned) * offset).xy; +vec2 pos1 = (posBase + getMatrixNoDisplay(isMapAligned) * offset1).xy; +vec2 pos2 = (posBase + getMatrixNoDisplay(isMapAligned) * offset2).xy; +vec3 bary0 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, -u_hittestDist), pos0, pos1, pos2); +vec3 bary1 = xyToBarycentric(u_hittestPos + vec2(0., -u_hittestDist), pos0, pos1, pos2); +vec3 bary2 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, -u_hittestDist), pos0, pos1, pos2); +vec3 bary3 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, 0.), pos0, pos1, pos2); +vec3 bary4 = xyToBarycentric(u_hittestPos, pos0, pos1, pos2); +vec3 bary5 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, 0.), pos0, pos1, pos2); +vec3 bary6 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, u_hittestDist), pos0, pos1, pos2); +vec3 bary7 = xyToBarycentric(u_hittestPos + vec2(0., u_hittestDist), pos0, pos1, pos2); +vec3 bary8 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, u_hittestDist), pos0, pos1, pos2); +vec2 tex0 = a_texCoords / u_mosaicSize; +vec2 tex1 = a_texCoords1 / u_mosaicSize; +vec2 tex2 = a_texCoords2 / u_mosaicSize; +float alphaSum = 0.; +alphaSum += inTriangle(bary0) * getColor(size, getTextureCoords(bary0, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary1) * getColor(size, getTextureCoords(bary1, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary2) * getColor(size, getTextureCoords(bary2, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary3) * getColor(size, getTextureCoords(bary3, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary4) * getColor(size, getTextureCoords(bary4, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary5) * getColor(size, getTextureCoords(bary5, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary6) * getColor(size, getTextureCoords(bary6, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary7) * getColor(size, getTextureCoords(bary7, tex0, tex1, tex2)).a; +out_pos.z += step(alphaSum, .05) * 2.0; +out_color = vec4(1. / 255., 0., 0., alphaSum / 255.); +} +#endif`,"icon.frag":`precision mediump float; +#include +#include +#include +void main() +{ +#ifdef HITTEST +vec4 color = v_color; +#else +vec4 color = getColor(v_sizeTex.xy, v_sizeTex.zw); +#endif +#ifdef HIGHLIGHT +color.a = step(1.0 / 255.0, color.a); +#endif +gl_FragColor = color; +}`,"icon.vert":`precision highp float; +attribute vec4 a_color; +attribute vec4 a_outlineColor; +attribute vec4 a_sizeAndOutlineWidth; +attribute vec2 a_vertexOffset; +attribute vec2 a_texCoords; +attribute vec2 a_bitSetAndDistRatio; +attribute vec2 a_zoomRange; +#include +#include +#include +float getMarkerScaleFactor(inout vec2 size, in float referenceSize) { +#ifdef VV_SIZE +float f = getSize(size.y) / size.y; +float sizeFactor = size.y / referenceSize; +return getSize(referenceSize) / referenceSize; +#else +return 1.; +#endif +} +void main() +{ +INIT; +float a_bitSet = a_bitSetAndDistRatio.x; +vec3 pos = vec3(a_pos * POSITION_PRECISION, 1.0); +vec2 size = a_sizeAndOutlineWidth.xy * a_sizeAndOutlineWidth.xy / 128.0; +vec3 offset = vec3(a_vertexOffset / 16.0, 0.); +float outlineSize = a_sizeAndOutlineWidth.z * a_sizeAndOutlineWidth.z / 128.0; +float isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP); +float referenceSize = a_sizeAndOutlineWidth.w * a_sizeAndOutlineWidth.w / 128.0; +float scaleSymbolProportionally = getBit(a_bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY); +float scaleFactor = getMarkerScaleFactor(size, referenceSize); +size.xy *= scaleFactor; +offset.xy *= scaleFactor; +outlineSize *= scaleSymbolProportionally * (scaleFactor - 1.0) + 1.0; +vec2 v_tex = a_texCoords / u_mosaicSize; +float filterFlags = getFilterFlags(); +v_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR); +v_opacity = getOpacity(); +v_id = norm(a_id); +v_pos = u_dvsMat3 * pos + getMatrix(isMapAligned) * getRotation() * offset; +v_sizeTex = vec4(size.xy, v_tex.xy); +#ifdef SDF +v_isThin = getBit(a_bitSet, BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE); +#ifdef VV_COLOR +v_overridingOutlineColor = v_isThin; +#else +v_overridingOutlineColor = 0.0; +#endif +v_outlineWidth = min(outlineSize, max(max(size.x, size.y) - 0.99, 0.0)); +v_outlineColor = a_outlineColor; +v_distRatio = a_bitSetAndDistRatio.y / 128.0; +#endif +#ifdef HITTEST +highp vec4 out_color = vec4(0.); +highp vec3 out_pos = vec3(0.); +hittestIcon(out_color, out_pos, pos, offset, size, scaleFactor, isMapAligned); +v_color = out_color; +gl_PointSize = 1.; +gl_Position = vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0); +#else +gl_Position = vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0); +#endif +}`},label:{"common.glsl":`uniform mediump float u_zoomLevel; +uniform mediump float u_mapRotation; +uniform mediump float u_mapAligned; +uniform mediump vec2 u_mosaicSize; +varying mediump float v_antialiasingWidth; +varying mediump float v_edgeDistanceOffset; +varying mediump vec2 v_tex; +varying mediump vec4 v_color; +varying lowp vec4 v_animation;`,"label.frag":"#include ","label.vert":`precision highp float; +#include +#include +attribute vec4 a_color; +attribute vec4 a_haloColor; +attribute vec4 a_texAndSize; +attribute vec4 a_refSymbolAndPlacementOffset; +attribute vec4 a_glyphData; +attribute vec2 a_vertexOffset; +attribute vec2 a_texCoords; +uniform float u_isHaloPass; +uniform float u_isBackgroundPass; +uniform float u_mapRotation; +uniform float u_mapAligned; +float getZ(in float minZoom, in float maxZoom, in float angle) { +float glyphAngle = angle * 360.0 / 254.0; +float mapAngle = u_mapRotation * 360.0 / 254.0; +float diffAngle = min(360.0 - abs(mapAngle - glyphAngle), abs(mapAngle - glyphAngle)); +float z = 0.0; +z += u_mapAligned * (2.0 * (1.0 - step(minZoom, u_currentZoom))); +z += u_mapAligned * 2.0 * step(90.0, diffAngle); +z += 2.0 * (1.0 - step(u_currentZoom, maxZoom)); +return z; +} +void main() +{ +INIT; +float groupMinZoom = getMinZoom(); +float glyphMinZoom = a_glyphData.x; +float glyphMaxZoom = a_glyphData.y; +float glyphAngle = a_glyphData.z; +float a_isBackground = a_glyphData.w; +float a_minZoom = max(groupMinZoom, glyphMinZoom); +float a_placementPadding = a_refSymbolAndPlacementOffset.x * EXTRUDE_SCALE_PLACEMENT_PADDING; +vec2 a_placementDir = unpack_u8_nf32(a_refSymbolAndPlacementOffset.zw); +float a_refSymbolSize = a_refSymbolAndPlacementOffset.y; +float fontSize = a_texAndSize.z; +float haloSize = a_texAndSize.w * OUTLINE_SCALE; +vec2 vertexOffset = a_vertexOffset * OFFSET_PRECISION; +vec3 pos = vec3(a_pos * POSITION_PRECISION, 1.0); +float z = getZ(a_minZoom, glyphMaxZoom, glyphAngle); +float fontScale = fontSize / SDF_FONT_SIZE; +float halfSize = getSize(a_refSymbolSize) / 2.0; +float animation = pow(getAnimationState(), vec4(2.0)).r; +float isText = 1.0 - a_isBackground; +float isBackground = u_isBackgroundPass * a_isBackground; +vec4 nonHaloColor = (isBackground + isText) * a_color; +v_color = animation * ((1.0 - u_isHaloPass) * nonHaloColor + (u_isHaloPass * a_haloColor)); +v_opacity = 1.0; +v_tex = a_texCoords / u_mosaicSize; +v_edgeDistanceOffset = u_isHaloPass * haloSize / fontScale / MAX_SDF_DISTANCE; +v_antialiasingWidth = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio; +vec2 placementOffset = a_placementDir * (halfSize + a_placementPadding); +vec3 glyphOffset = u_displayMat3 * vec3(vertexOffset + placementOffset, 0.0); +vec3 v_pos = vec3((u_dvsMat3 * pos + glyphOffset).xy, z); +float isHidden = u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground; +v_pos.z += 2.0 * isHidden; +gl_Position = vec4(v_pos, 1.0); +#ifdef DEBUG +v_color = vec4(a_color.rgb, z == 0.0 ? 1.0 : 0.645); +#endif +}`},line:{"common.glsl":`varying lowp vec4 v_color; +varying highp vec3 v_id; +varying mediump vec2 v_normal; +varying mediump float v_lineHalfWidth; +varying lowp float v_opacity; +#ifdef PATTERN +varying mediump vec4 v_tlbr; +varying mediump vec2 v_patternSize; +#endif +#if defined(PATTERN) || defined(SDF) +varying highp float v_accumulatedDistance; +#endif +#ifdef SDF +varying mediump float v_lineWidthRatio; +#endif`,"hittest.glsl":`#include +#ifdef HITTEST +attribute vec2 a_pos1; +attribute vec2 a_pos2; +void hittestLine(out lowp vec4 out_color, out highp vec3 out_pos, float halfWidth) { +vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.); +vec3 pos1 = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * POSITION_PRECISION, 1.); +vec3 pos2 = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * POSITION_PRECISION, 1.); +vec3 outTextureCoords = vec3(getAttributeDataTextureCoords(a_id), 0.0); +float dist = min(distPointSegment(u_hittestPos, pos.xy, pos1.xy), +distPointSegment(u_hittestPos, pos.xy, pos2.xy)) - halfWidth; +out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); +if (dist >= u_hittestDist) { +out_pos.z += 2.0; +} +out_color = vec4(1. / 255., 0, 0, dist <= 0. ? (1. / 255.) : 0.); +} +#endif`,"line.frag":`precision lowp float; +#include +#include +#include +#include +#include +#include +#ifdef HITTEST +void main() { +gl_FragColor = v_color; +} +#else +void main() { +LineData inputs = LineData( +v_color, +v_normal, +v_lineHalfWidth, +v_opacity, +#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#ifdef PATTERN +v_tlbr, +v_patternSize, +#endif +#ifdef SDF +v_lineWidthRatio, +#endif +#if defined(PATTERN) || defined(SDF) +v_accumulatedDistance, +#endif +#endif +v_id +); +gl_FragColor = shadeLine(inputs); +} +#endif`,"line.vert":`precision highp float; +attribute vec4 a_color; +attribute vec4 a_offsetAndNormal; +attribute vec2 a_accumulatedDistanceAndHalfWidth; +attribute vec4 a_tlbr; +attribute vec4 a_segmentDirection; +attribute vec2 a_aux; +attribute vec2 a_zoomRange; +#include +#include +#include +#include +#include +#include +#ifdef HITTEST +void draw() { +float aa = 0.5 * u_antialiasing; +float a_halfWidth = a_accumulatedDistanceAndHalfWidth.y / 16.; +float a_cimHalfWidth = a_aux.x / 16. ; +vec2 a_offset = a_offsetAndNormal.xy / 16.; +float baseWidth = getBaseLineHalfWidth(a_halfWidth, a_cimHalfWidth); +float halfWidth = getLineHalfWidth(baseWidth, aa); +highp vec3 pos = vec3(0.); +v_color = vec4(0.); +hittestLine(v_color, pos, halfWidth); +gl_PointSize = 1.; +gl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0); +} +#else +void draw() +{ +highp vec3 pos = vec3(0.); +LineData outputs = buildLine( +pos, +a_id, +a_pos, +a_color, +a_offsetAndNormal.xy / 16., +a_offsetAndNormal.zw / 16., +a_accumulatedDistanceAndHalfWidth.x, +a_accumulatedDistanceAndHalfWidth.y / 16., +a_segmentDirection.w, +a_tlbr, +a_segmentDirection.xy / 16., +a_aux.x / 16. +); +v_id = outputs.id; +v_color = outputs.color; +v_normal = outputs.normal; +v_lineHalfWidth = outputs.lineHalfWidth; +v_opacity = outputs.opacity; +#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#ifdef PATTERN +v_tlbr = outputs.tlbr; +v_patternSize = outputs.patternSize; +#endif +#ifdef SDF +v_lineWidthRatio = outputs.lineWidthRatio; +#endif +#if defined(PATTERN) || defined(SDF) +v_accumulatedDistance = outputs.accumulatedDistance; +#endif +#endif +gl_Position = vec4(clip(outputs.color, pos, getFilterFlags(), a_zoomRange), 1.0); +} +#endif +void main() { +INIT; +draw(); +}`},pie:{"pie.common.glsl":`uniform float outlineWidth; +uniform mediump float sectorThreshold; +varying vec3 v_id; +varying vec3 v_pos; +varying vec2 v_offset; +varying vec4 v_color; +varying float v_size; +varying float v_numOfEntries; +varying float v_maxSectorAngle; +varying vec2 v_filteredSectorToColorId[numberOfFields]; +varying vec2 v_texCoords; +varying float v_outlineWidth; +varying float v_opacity; +struct FilteredChartInfo { +float endSectorAngle; +int colorId; +};`,"pie.frag":`precision highp float; +#include +#include +#include +#include +uniform lowp vec4 colors[numberOfFields]; +uniform lowp vec4 defaultColor; +uniform lowp vec4 othersColor; +uniform lowp vec4 outlineColor; +uniform float donutRatio; +lowp vec4 getSectorColor(in int index, in vec2 filteredSectorToColorId[numberOfFields]) { +mediump int colorIndex = int(filteredSectorToColorId[index].y); +return colors[colorIndex]; +} +const int OTHER_SECTOR_ID = 255; +#ifdef HITTEST +vec4 getColor() { +float distanceSize = length(v_offset) * v_size; +float donutSize = donutRatio * v_size; +float alpha = step(donutSize, distanceSize) * (1.0 - step(v_size, distanceSize)); +return v_color; +} +#else +vec4 getColor() { +float angle = 90.0 - C_RAD_TO_DEG * atan2(v_offset.y, v_offset.x); +if (angle < 0.0) { +angle += 360.0; +} else if (angle > 360.0) { +angle = mod(angle, 360.0); +} +int numOfEntries = int(v_numOfEntries); +float maxSectorAngle = v_maxSectorAngle; +lowp vec4 fillColor = (maxSectorAngle > 0.0 || sectorThreshold > 0.0) ? othersColor : defaultColor; +lowp vec4 prevColor = vec4(0.0); +lowp vec4 nextColor = vec4(0.0); +float startSectorAngle = 0.0; +float endSectorAngle = 0.0; +if (angle < maxSectorAngle) { +for (int index = 0; index < numberOfFields; ++index) { +startSectorAngle = endSectorAngle; +endSectorAngle = v_filteredSectorToColorId[index].x; +if (endSectorAngle > angle) { +fillColor = getSectorColor(index, v_filteredSectorToColorId); +prevColor = sectorThreshold != 0.0 && index == 0 && abs(360.0 - maxSectorAngle) < EPSILON ? othersColor : +getSectorColor(index > 0 ? index - 1 : numOfEntries - 1, v_filteredSectorToColorId); +nextColor = sectorThreshold != 0.0 && abs(endSectorAngle - maxSectorAngle) < EPSILON ? othersColor : +getSectorColor(index < numOfEntries - 1 ? index + 1 : 0, v_filteredSectorToColorId); +break; +} +if (index == numOfEntries - 1) { +break; +} +} +} else { +prevColor = getSectorColor(numOfEntries - 1, v_filteredSectorToColorId); +nextColor = getSectorColor(0, v_filteredSectorToColorId); +startSectorAngle = maxSectorAngle; +endSectorAngle = 360.0; +} +lowp vec4 outlineColor = outlineColor; +float offset = length(v_offset); +float distanceSize = offset * v_size; +if (startSectorAngle != 0.0 || endSectorAngle != 360.0) { +float distanceToStartSector = (angle - startSectorAngle); +float distanceToEndSector = (endSectorAngle - angle); +float sectorThreshold = 0.6; +float beginSectorAlpha = smoothstep(0.0, sectorThreshold, distanceToStartSector * offset); +float endSectorAlpha = smoothstep(0.0, sectorThreshold, distanceToEndSector * offset); +if (endSectorAlpha > 0.0) { +fillColor = mix(nextColor, fillColor, endSectorAlpha); +} else if (beginSectorAlpha > 0.0) { +fillColor = mix(prevColor, fillColor, beginSectorAlpha); +} +} +float donutSize = donutRatio * (v_size - v_outlineWidth); +float endOfDonut = donutSize - v_outlineWidth; +float aaThreshold = 0.75; +float innerCircleAlpha = endOfDonut - aaThreshold > 0.0 ? smoothstep(endOfDonut - aaThreshold, endOfDonut + aaThreshold, distanceSize) : 1.0; +float outerCircleAlpha = 1.0 - smoothstep(v_size - aaThreshold, v_size + aaThreshold , distanceSize); +float circleAlpha = innerCircleAlpha * outerCircleAlpha; +float startOfOutline = v_size - v_outlineWidth; +if (startOfOutline > 0.0 && v_outlineWidth > 0.25) { +float outlineFactor = smoothstep(startOfOutline - aaThreshold, startOfOutline + aaThreshold, distanceSize); +float innerLineFactor = donutSize - aaThreshold > 0.0 ? 1.0 - smoothstep(donutSize - aaThreshold, donutSize + aaThreshold , distanceSize) : 0.0; +fillColor = mix(fillColor, outlineColor, innerLineFactor + outlineFactor); +} +return v_opacity * circleAlpha * fillColor; +} +#endif +void main() +{ +vec4 color = getColor(); +#ifdef highlight +color.a = step(1.0 / 255.0, color.a); +#endif +gl_FragColor = color; +}`,"pie.vert":`#include +#include +#include +#include +#include +#include +#include +#include +attribute float a_bitSet; +attribute vec2 a_offset; +attribute vec2 a_texCoords; +attribute vec2 a_size; +attribute float a_referenceSize; +attribute vec2 a_zoomRange; +int filterValue(in float sectorAngle, +in int currentIndex, +inout FilteredChartInfo filteredInfo, +inout vec2 filteredSectorToColorId[numberOfFields]) { +if (sectorAngle > sectorThreshold * 360.0) { +filteredInfo.endSectorAngle += sectorAngle; +filteredSectorToColorId[filteredInfo.colorId] = vec2(filteredInfo.endSectorAngle, currentIndex); +++filteredInfo.colorId; +} +return 0; +} +int filterValues(inout vec2 filteredSectorToColorId[numberOfFields], +inout FilteredChartInfo filteredInfo, +in float sectorAngles[numberOfFields]) { +for (int index = 0; index < numberOfFields; ++index) { +float sectorValue = sectorAngles[index]; +filterValue(sectorValue, index, filteredInfo, filteredSectorToColorId); +} +return filteredInfo.colorId; +} +vec2 getMarkerSize(inout vec2 offset, inout vec2 baseSize, inout float outlineSize, in float a_referenceSize, in float bitSet) { +vec2 outSize = baseSize; +#ifdef VV_SIZE +float r = getSize(a_referenceSize, currentScale) / a_referenceSize; +outSize.xy *= r; +offset.xy *= r; +float scaleSymbolProportionally = getBit(bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY); +outlineSize *= scaleSymbolProportionally * (r - 1.0) + 1.0; +#endif +return outSize; +} +vec3 getOffset(in vec2 in_offset, float a_bitSet) { +float isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP); +vec3 offset = vec3(in_offset, 0.0); +return getMatrix(isMapAligned) * offset; +} +float filterNaNValues(in float value) { +return value != NAN_MAGIC_NUMBER && value > 0.0 ? value : 0.0; +} +void main() +{ +INIT; +vec2 a_size = a_size; +vec2 a_offset = a_offset / 16.0; +float outlineSize = outlineWidth; +float a_bitSet = a_bitSet; +float a_referenceSize = a_referenceSize; +vec2 a_texCoords = a_texCoords / 4.0; +vec2 markerSize = getMarkerSize(a_offset, a_size, outlineSize, a_referenceSize, a_bitSet); +float filterFlags = getFilterFlags(); +vec3 pos = vec3(a_pos / 10.0, 1.0); +v_opacity = getOpacity(); +v_id = norm(a_id); +v_pos = displayViewScreenMat3 * pos + getOffset(a_offset, a_bitSet); +v_offset = sign(a_texCoords - 0.5); +v_size = max(markerSize.x, markerSize.y); +v_outlineWidth = outlineSize; +float attributeData[10]; +vec4 attributeData3 = getDataDriven0(a_id); +attributeData[0] = filterNaNValues(attributeData3.x); +attributeData[1] = filterNaNValues(attributeData3.y); +attributeData[2] = filterNaNValues(attributeData3.z); +attributeData[3] = filterNaNValues(attributeData3.w); +#if (numberOfFields > 4) +vec4 attributeData4 = getDataDriven1(a_id); +attributeData[4] = filterNaNValues(attributeData4.x); +attributeData[5] = filterNaNValues(attributeData4.y); +attributeData[6] = filterNaNValues(attributeData4.z); +attributeData[7] = filterNaNValues(attributeData4.w); +#endif +#if (numberOfFields > 8) +vec4 attributeData5 = getDataDriven2(a_id); +attributeData[8] = filterNaNValues(attributeData5.x); +attributeData[9] = filterNaNValues(attributeData5.y); +#endif +float sum = 0.0; +for (int i = 0; i < numberOfFields; ++i) { +sum += attributeData[i]; +} +float sectorAngles[numberOfFields]; +for (int i = 0; i < numberOfFields; ++i) { +sectorAngles[i] = 360.0 * attributeData[i] / sum; +} +vec2 filteredSectorToColorId[numberOfFields]; +FilteredChartInfo filteredInfo = FilteredChartInfo(0.0, 0); +int numOfEntries = filterValues(filteredSectorToColorId, filteredInfo, sectorAngles); +v_numOfEntries = float(numOfEntries); +v_maxSectorAngle = filteredInfo.endSectorAngle; +v_filteredSectorToColorId = filteredSectorToColorId; +#ifdef HITTEST +highp vec3 out_pos = vec3(0.0); +v_color = vec4(0.0); +hittestMarker(v_color, out_pos, viewMat3 * tileMat3 * pos, v_size); +gl_PointSize = 1.0; +gl_Position = vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0); +#else +gl_Position = vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0); +#endif +}`},shared:{line:{"common.glsl":`#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && defined(PATTERN) +uniform mediump vec2 u_mosaicSize; +varying mediump float v_sampleAlphaOnly; +#endif +struct LineData { +lowp vec4 color; +mediump vec2 normal; +mediump float lineHalfWidth; +lowp float opacity; +#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#ifdef PATTERN +mediump vec4 tlbr; +mediump vec2 patternSize; +#endif +#ifdef SDF +mediump float lineWidthRatio; +#endif +#if defined(PATTERN) || defined(SDF) +highp float accumulatedDistance; +#endif +#endif +highp vec3 id; +};`,"line.frag":`uniform lowp float u_blur; +#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && !defined(HIGHLIGHT) +#if defined(PATTERN) || defined(SDF) +uniform sampler2D u_texture; +uniform highp float u_pixelRatio; +#endif +#endif +#if defined(SDF) && !defined(HIGHLIGHT) && !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) +lowp vec4 getLineColor(LineData line) { +mediump float adjustedPatternWidth = line.patternSize.x * 2.0 * line.lineWidthRatio; +mediump float relativeTexX = fract(line.accumulatedDistance / adjustedPatternWidth); +mediump float relativeTexY = 0.5 + 0.25 * line.normal.y; +mediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY)); +mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5; +float dist = d * line.lineHalfWidth; +return line.opacity * clamp(0.5 - dist, 0.0, 1.0) * line.color; +} +#elif defined(PATTERN) && !defined(HIGHLIGHT) && !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) +lowp vec4 getLineColor(LineData line) { +mediump float lineHalfWidth = line.lineHalfWidth; +mediump float adjustedPatternHeight = line.patternSize.y * 2.0 * lineHalfWidth / line.patternSize.x; +mediump float relativeTexY = fract(line.accumulatedDistance / adjustedPatternHeight); +mediump float relativeTexX = 0.5 + 0.5 * line.normal.y; +mediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY)); +lowp vec4 color = texture2D(u_texture, texCoord); +#ifdef VV_COLOR +if (v_sampleAlphaOnly > 0.5) { +color.rgb = vec3(color.a); +} +#endif +return line.opacity * line.color * color; +} +#else +lowp vec4 getLineColor(LineData line) { +return line.opacity * line.color; +} +#endif +vec4 shadeLine(LineData line) +{ +mediump float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(line.lineHalfWidth, THIN_LINE_HALF_WIDTH), 1.0); +mediump float fragDist = length(line.normal) * line.lineHalfWidth; +lowp float alpha = clamp(thinLineFactor * (line.lineHalfWidth - fragDist) / (u_blur + thinLineFactor - 1.0), 0.0, 1.0); +lowp vec4 out_color = getLineColor(line) * alpha; +#ifdef HIGHLIGHT +out_color.a = step(1.0 / 255.0, out_color.a); +#endif +#ifdef ID +if (out_color.a < 1.0 / 255.0) { +discard; +} +out_color = vec4(line.id, 0.0); +#endif +return out_color; +}`,"line.vert":`float getBaseLineHalfWidth(in float lineHalfWidth, in float referenceHalfWidth) { +#ifdef VV_SIZE +float refLineWidth = 2.0 * referenceHalfWidth; +return 0.5 * (lineHalfWidth / max(referenceHalfWidth, EPSILON)) * getSize(refLineWidth); +#else +return lineHalfWidth; +#endif +} +float getLineHalfWidth(in float baseWidth, in float aa) { +float halfWidth = max(baseWidth + aa, 0.45) + 0.1 * aa; +#ifdef HIGHLIGHT +halfWidth = max(halfWidth, 2.0); +#endif +return halfWidth; +} +vec2 getDist(in vec2 offset, in float halfWidth) { +float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(halfWidth, THIN_LINE_HALF_WIDTH), 1.0); +return thinLineFactor * halfWidth * offset; +} +LineData buildLine( +out vec3 out_pos, +in vec3 in_id, +in vec2 in_pos, +in vec4 in_color, +in vec2 in_offset, +in vec2 in_normal, +in float in_accumulatedDist, +in float in_lineHalfWidth, +in float in_bitSet, +in vec4 in_tlbr, +in vec2 in_segmentDirection, +in float in_referenceHalfWidth +) +{ +float aa = 0.5 * u_antialiasing; +float baseWidth = getBaseLineHalfWidth(in_lineHalfWidth, in_referenceHalfWidth); +float halfWidth = getLineHalfWidth(baseWidth, aa); +float z = 2.0 * step(baseWidth, 0.0); +vec2 dist = getDist(in_offset, halfWidth); +vec3 offset = u_displayViewMat3 * vec3(dist, 0.0); +vec3 pos = u_dvsMat3 * vec3(in_pos * POSITION_PRECISION, 1.0) + offset; +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +vec4 color = in_color; +float opacity = 1.0; +#else +vec4 color = getColor(in_color, in_bitSet, BITSET_GENERIC_LOCK_COLOR); +float opacity = getOpacity(); +#ifdef SDF +const float SDF_PATTERN_HALF_WIDTH = 15.5; +float scaleDash = getBit(in_bitSet, BITSET_LINE_SCALE_DASH); +float lineWidthRatio = (scaleDash * max(halfWidth - 0.55 * u_antialiasing, 0.25) + (1.0 - scaleDash)) / SDF_PATTERN_HALF_WIDTH; +#endif +#endif +#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && defined(PATTERN) +v_sampleAlphaOnly = getBit(in_bitSet, BITSET_GENERIC_CONSIDER_ALPHA_ONLY); +#endif +out_pos = vec3(pos.xy, z); +return LineData( +color, +in_normal, +halfWidth, +opacity, +#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#ifdef PATTERN +in_tlbr / u_mosaicSize.xyxy, +vec2(in_tlbr.z - in_tlbr.x, in_tlbr.w - in_tlbr.y), +#endif +#ifdef SDF +lineWidthRatio, +#endif +#if defined(PATTERN) || defined(SDF) +in_accumulatedDist * u_zoomFactor + dot(in_segmentDirection, dist), +#endif +#endif +norm(in_id) +); +}`}},"symbologyTypeUtils.glsl":`#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL || SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE +#define SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#endif +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_SIMPLE || SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE +#define SYMBOLOGY_TYPE_IS_SIMPLE_LIKE +#endif`,text:{"common.glsl":`uniform highp vec2 u_mosaicSize; +varying highp vec3 v_id; +varying mediump vec3 v_pos; +varying lowp float v_opacity; +varying lowp vec4 v_color; +varying highp vec2 v_tex; +varying mediump float v_antialiasingWidth; +varying mediump float v_edgeDistanceOffset; +varying lowp float v_transparency;`,"hittest.glsl":"#include ","text.frag":`precision mediump float; +#include +uniform lowp sampler2D u_texture; +#ifdef HITTEST +vec4 getColor() { +return v_color; +} +#else +vec4 getColor() +{ +float SDF_CUTOFF = (2.0 / 8.0); +float SDF_BASE_EDGE_DIST = 1.0 - SDF_CUTOFF; +lowp float dist = texture2D(u_texture, v_tex).a; +mediump float edge = SDF_BASE_EDGE_DIST - v_edgeDistanceOffset; +#ifdef HIGHLIGHT +edge /= 2.0; +#endif +lowp float aa = v_antialiasingWidth; +lowp float alpha = smoothstep(edge - aa, edge + aa, dist); +return alpha * v_color * v_opacity; +} +#endif +void main() +{ +gl_FragColor = getColor(); +}`,"text.vert":`precision highp float; +#include +#include +#include +#include +attribute vec4 a_color; +attribute vec4 a_haloColor; +attribute vec4 a_texFontSize; +attribute vec4 a_aux; +attribute vec2 a_zoomRange; +attribute vec2 a_vertexOffset; +attribute vec2 a_texCoords; +uniform float u_isHaloPass; +uniform float u_isBackgroundPass; +float getTextSize(inout vec2 offset, inout float baseSize, in float referenceSize) { +#ifdef VV_SIZE +float r = getSize(referenceSize) / referenceSize; +baseSize *= r; +offset.xy *= r; +return baseSize; +#endif +return baseSize; +} +void main() +{ +INIT; +float a_isBackground = a_aux.y; +float a_referenceSize = a_aux.z * a_aux.z / 256.0; +float a_bitSet = a_aux.w; +float a_fontSize = a_texFontSize.z; +vec2 a_offset = a_vertexOffset * OFFSET_PRECISION; +vec3 in_pos = vec3(a_pos * POSITION_PRECISION, 1.0); +float fontSize = getTextSize(a_offset, a_fontSize, a_referenceSize); +float fontScale = fontSize / SDF_FONT_SIZE; +vec3 offset = getRotation() * vec3(a_offset, 0.0); +mat3 extrudeMatrix = getBit(a_bitSet, 0) == 1.0 ? u_displayViewMat3 : u_displayMat3; +float isText = 1.0 - a_isBackground; +float isBackground = u_isBackgroundPass * a_isBackground; +vec4 nonHaloColor = (isBackground * a_color) + (isText * getColor(a_color, a_bitSet, 1)); +v_color = u_isHaloPass * a_haloColor + (1.0 - u_isHaloPass) * nonHaloColor; +v_opacity = getOpacity(); +v_id = norm(a_id); +v_tex = a_texCoords / u_mosaicSize; +v_pos = u_dvsMat3 * in_pos + extrudeMatrix * offset; +float isHidden = u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground; +v_pos.z += 2.0 * isHidden; +v_edgeDistanceOffset = u_isHaloPass * OUTLINE_SCALE * a_texFontSize.w / fontScale / MAX_SDF_DISTANCE; +v_antialiasingWidth = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio; +#ifdef HITTEST +highp vec3 out_pos = vec3(0.); +v_color = vec4(0.); +hittestMarker(v_color, out_pos, u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0) ++ u_tileMat3 * offset, fontSize / 2.); +gl_PointSize = 1.; +gl_Position = vec4(clip(v_color, out_pos, getFilterFlags(), a_zoomRange), 1.0); +#else +gl_Position = vec4(clip(v_color, v_pos, getFilterFlags(), a_zoomRange), 1.0); +#endif +}`},"utils.glsl":`float rshift(in float u32, in int amount) { +return floor(u32 / pow(2.0, float(amount))); +} +float getBit(in float bitset, in int bitIndex) { +float offset = pow(2.0, float(bitIndex)); +return mod(floor(bitset / offset), 2.0); +} +const int maxHighlightReasons = 6; +float getFilterBit(in float bitset, in int bitIndex) { +return getBit(bitset, bitIndex + maxHighlightReasons); +} +float getHighlightBit(in float bitset, in int bitIndex) { +return getBit(bitset, bitIndex); +} +highp vec3 unpackDisplayIdTexel(in highp vec3 bitset) { +float isAggregate = getBit(bitset.b, 7); +return (1.0 - isAggregate) * bitset + isAggregate * (vec3(bitset.rgb) - vec3(0.0, 0.0, float(0x80))); +} +vec4 unpack(in float u32) { +float r = mod(rshift(u32, 0), 255.0); +float g = mod(rshift(u32, 8), 255.0); +float b = mod(rshift(u32, 16), 255.0); +float a = mod(rshift(u32, 24), 255.0); +return vec4(r, g, b, a); +} +vec3 norm(in vec3 v) { +return v /= 255.0; +} +vec4 norm(in vec4 v) { +return v /= 255.0; +} +float max4(vec4 target) { +return max(max(max(target.x, target.y), target.z), target.w); +} +vec2 unpack_u8_nf32(vec2 bytes) { +return (bytes - 127.0) / 127.0; +} +highp float rand(in vec2 co) { +highp float a = 12.9898; +highp float b = 78.233; +highp float c = 43758.5453; +highp float dt = dot(co, vec2(a,b)); +highp float sn = mod(dt, 3.14); +return fract(sin(sn) * c); +}`,"vcommon.glsl":`#include +#include +#include +#include +#include +attribute vec2 a_pos; +attribute highp vec3 a_id; +uniform highp mat3 displayViewScreenMat3; +uniform highp mat3 displayViewMat3; +uniform highp mat3 displayMat3; +uniform highp mat3 tileMat3; +uniform highp mat3 viewMat3; +uniform highp float pixelRatio; +uniform mediump float zoomFactor; +uniform mediump float antialiasing; +uniform mediump float currentScale; +uniform mediump float currentZoom; +uniform mediump float metersPerSRUnit; +vec4 VV_ADATA = vec4(0.0); +void loadVisualVariableData(inout vec4 target) { +target.rgba = getVisualVariableData(a_id); +} +#ifdef VV +#define INIT loadVisualVariableData(VV_ADATA) +#else +#define INIT +#endif +vec4 getColor(in vec4 a_color, in float a_bitSet, int index) { +#ifdef VV_COLOR +float isColorLocked = getBit(a_bitSet, index); +return getVVColor(VV_ADATA[ATTR_VV_COLOR], a_color, isColorLocked); +#else +return a_color; +#endif +} +float getOpacity() { +#ifdef VV_OPACITY +return getVVOpacity(VV_ADATA[ATTR_VV_OPACITY]); +#else +return 1.0; +#endif +} +float getSize(in float in_size, in float currentScale) { +#ifdef VV_SIZE +return getVVSize(in_size, VV_ADATA[ATTR_VV_SIZE], currentScale); +#else +return in_size; +#endif +} +mat3 getRotation() { +#ifdef VV_ROTATION +return getVVRotationMat3(mod(VV_ADATA[ATTR_VV_ROTATION], 360.0)); +#else +return mat3(1.0); +#endif +} +float getFilterFlags() { +#ifdef IGNORES_SAMPLER_PRECISION +return ceil(getFilterData(a_id).x * 255.0); +#else +return getFilterData(a_id).x * 255.0; +#endif +} +vec4 getAnimationState() { +return getAnimation(a_id); +} +float getMinZoom() { +vec4 data0 = getFilterData(a_id) * 255.0; +return data0.g; +} +mat3 getMatrixNoDisplay(float isMapAligned) { +return isMapAligned * viewMat3 * tileMat3 + (1.0 - isMapAligned) * tileMat3; +} +mat3 getMatrix(float isMapAligned) { +return isMapAligned * displayViewMat3 + (1.0 - isMapAligned) * displayMat3; +} +float checkHighlightBit(float filterFlags, int index) { +return getHighlightBit(filterFlags, index); +} +float checkHighlight(float filterFlags) { +float result = checkHighlightBit(filterFlags, 0); +for (int i = 1; i < maxHighlightReasons; i++) { +result = result + checkHighlightBit(filterFlags, i); +} +return step(0.1, result); +} +vec3 clip(inout vec4 color, inout vec3 pos, in float filterFlags, in vec2 minMaxZoom) { +pos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 0)); +#ifdef inside +pos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 1)); +#elif defined(outside) +pos.z += 2.0 * getFilterBit(filterFlags, 1); +#elif defined(highlight) +#if !defined(highlight_all) +pos.z += 2.0 * (1.0 - checkHighlight(filterFlags)); +#endif +#endif +pos.z += 2.0 * (step(minMaxZoom.y, currentZoom) + (1.0 - step(minMaxZoom.x, currentZoom))); +return pos; +}`,"vv.glsl":`#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE) +#define VV_SIZE +#endif +#if defined(VV_COLOR) || defined(VV_SIZE) || defined(VV_OPACITY) || defined(VV_ROTATION) +#define VV +#endif +#ifdef VV_COLOR +uniform highp float colorValues[8]; +uniform vec4 colors[8]; +#endif +#ifdef VV_SIZE_MIN_MAX_VALUE +uniform highp vec4 minMaxValueAndSize; +#endif +#ifdef VV_SIZE_SCALE_STOPS +uniform highp float values[8]; +uniform float sizes[8]; +#endif +#ifdef VV_SIZE_FIELD_STOPS +uniform highp float values[8]; +uniform float sizes[8]; +#endif +#ifdef VV_SIZE_UNIT_VALUE +uniform highp float unitMeterRatio; +#endif +#ifdef VV_OPACITY +uniform highp float opacityValues[8]; +uniform float opacities[8]; +#endif +#ifdef VV_ROTATION +uniform lowp float rotationType; +#endif +bool isNan(float val) { +return (val == NAN_MAGIC_NUMBER); +} +#ifdef VV_SIZE_MIN_MAX_VALUE +float getVVMinMaxSize(float sizeValue, float fallback) { +if (isNan(sizeValue)) { +return fallback; +} +float interpolationRatio = (sizeValue - minMaxValueAndSize.x) / (minMaxValueAndSize.y - minMaxValueAndSize.x); +interpolationRatio = clamp(interpolationRatio, 0.0, 1.0); +return minMaxValueAndSize.z + interpolationRatio * (minMaxValueAndSize.w - minMaxValueAndSize.z); +} +#endif +#ifdef VV_SIZE_SCALE_STOPS +float getVVScaleStopsSize(float currentScale) { +float outSize; +if (currentScale <= values[0]) { +outSize = sizes[0]; +} else { +if (currentScale >= values[7]) { +outSize = sizes[7]; +} else { +int index; +index = -1; +for (int i = 0; i < 8; i++) { +if (values[i] > currentScale) { +index = i; +break; +} +} +int prevIndex = index - 1; +float a = currentScale - values[prevIndex]; +float b = values[index] - values[prevIndex]; +outSize = mix(sizes[prevIndex], sizes[index], a / b); +} +} +return outSize; +} +#endif +#ifdef VV_SIZE_FIELD_STOPS +const int VV_SIZE_N = 8; +float getVVStopsSize(float sizeValue, float fallback) { +if (isNan(sizeValue)) { +return fallback; +} +if (sizeValue <= values[0]) { +return sizes[0]; +} +if (sizeValue >= values[VV_SIZE_N - 1]) { +return sizes[VV_SIZE_N - 1]; +} +for (int i = 1; i < VV_SIZE_N; ++i) { +if (values[i] >= sizeValue) { +float f = (sizeValue - values[i-1]) / (values[i] - values[i-1]); +return mix(sizes[i-1], sizes[i], f); +} +} +return sizes[VV_SIZE_N - 1]; +} +#endif +#ifdef VV_SIZE_UNIT_VALUE +float getVVUnitValue(float sizeValue, float fallback) { +if (isNan(sizeValue)) { +return fallback; +} +return sizeValue * (metersPerSRUnit / unitMeterRatio); +} +#endif +#ifdef VV_OPACITY +const int VV_OPACITY_N = 8; +float getVVOpacity(float opacityValue) { +if (isNan(opacityValue)) { +return 1.0; +} +if (opacityValue <= opacityValues[0]) { +return opacities[0]; +} +for (int i = 1; i < VV_OPACITY_N; ++i) { +if (opacityValues[i] >= opacityValue) { +float f = (opacityValue - opacityValues[i-1]) / (opacityValues[i] - opacityValues[i-1]); +return mix(opacities[i-1], opacities[i], f); +} +} +return opacities[VV_OPACITY_N - 1]; +} +#endif +#ifdef VV_ROTATION +mat4 getVVRotation(float rotationValue) { +if (isNan(rotationValue)) { +return mat4(1, 0, 0, 0, +0, 1, 0, 0, +0, 0, 1, 0, +0, 0, 0, 1); +} +float rotation = rotationValue; +if (rotationType == 1.0) { +rotation = 90.0 - rotation; +} +float angle = C_DEG_TO_RAD * rotation; +float sinA = sin(angle); +float cosA = cos(angle); +return mat4(cosA, sinA, 0, 0, +-sinA, cosA, 0, 0, +0, 0, 1, 0, +0, 0, 0, 1); +} +mat3 getVVRotationMat3(float rotationValue) { +if (isNan(rotationValue)) { +return mat3(1, 0, 0, +0, 1, 0, +0, 0, 1); +} +float rotation = rotationValue; +if (rotationType == 1.0) { +rotation = 90.0 - rotation; +} +float angle = C_DEG_TO_RAD * -rotation; +float sinA = sin(angle); +float cosA = cos(angle); +return mat3(cosA, -sinA, 0, +sinA, cosA, 0, +0, 0, 1); +} +#endif +#ifdef VV_COLOR +const int VV_COLOR_N = 8; +vec4 getVVColor(float colorValue, vec4 fallback, float isColorLocked) { +if (isNan(colorValue) || isColorLocked == 1.0) { +return fallback; +} +if (colorValue <= colorValues[0]) { +return colors[0]; +} +for (int i = 1; i < VV_COLOR_N; ++i) { +if (colorValues[i] >= colorValue) { +float f = (colorValue - colorValues[i-1]) / (colorValues[i] - colorValues[i-1]); +return mix(colors[i-1], colors[i], f); +} +} +return colors[VV_COLOR_N - 1]; +} +#endif +float getVVSize(in float size, in float vvSize, in float currentScale) { +#ifdef VV_SIZE_MIN_MAX_VALUE +return getVVMinMaxSize(vvSize, size); +#elif defined(VV_SIZE_SCALE_STOPS) +float outSize = getVVScaleStopsSize(currentScale); +return isNan(outSize) ? size : outSize; +#elif defined(VV_SIZE_FIELD_STOPS) +float outSize = getVVStopsSize(vvSize, size); +return isNan(outSize) ? size : outSize; +#elif defined(VV_SIZE_UNIT_VALUE) +return getVVUnitValue(vvSize, size); +#else +return size; +#endif +}`},"post-processing":{blit:{"blit.frag":`precision mediump float; +uniform sampler2D u_texture; +varying vec2 v_uv; +void main() { +gl_FragColor = texture2D(u_texture, v_uv); +}`},bloom:{composite:{"composite.frag":`precision mediump float; +varying vec2 v_uv; +uniform sampler2D u_blurTexture1; +uniform sampler2D u_blurTexture2; +uniform sampler2D u_blurTexture3; +uniform sampler2D u_blurTexture4; +uniform sampler2D u_blurTexture5; +uniform float u_bloomStrength; +uniform float u_bloomRadius; +uniform float u_bloomFactors[NUMMIPS]; +uniform vec3 u_bloomTintColors[NUMMIPS]; +float lerpBloomFactor(const in float factor) { +float mirrorFactor = 1.2 - factor; +return mix(factor, mirrorFactor, u_bloomRadius); +} +void main() { +vec4 color = u_bloomStrength * ( +lerpBloomFactor(u_bloomFactors[0]) * vec4(u_bloomTintColors[0], 1.0) * texture2D(u_blurTexture1, v_uv) + +lerpBloomFactor(u_bloomFactors[1]) * vec4(u_bloomTintColors[1], 1.0) * texture2D(u_blurTexture2, v_uv) + +lerpBloomFactor(u_bloomFactors[2]) * vec4(u_bloomTintColors[2], 1.0) * texture2D(u_blurTexture3, v_uv) + +lerpBloomFactor(u_bloomFactors[3]) * vec4(u_bloomTintColors[3], 1.0) * texture2D(u_blurTexture4, v_uv) + +lerpBloomFactor(u_bloomFactors[4]) * vec4(u_bloomTintColors[4], 1.0) * texture2D(u_blurTexture5, v_uv) +); +gl_FragColor = clamp(color, 0.0, 1.0); +}`},gaussianBlur:{"gaussianBlur.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +uniform vec2 u_texSize; +uniform vec2 u_direction; +varying vec2 v_uv; +#define KERNEL_RADIUS RADIUS +#define SIGMA RADIUS +float gaussianPdf(in float x, in float sigma) { +return 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma; +} +void main() { +vec2 invSize = 1.0 / u_texSize; +float fSigma = float(SIGMA); +float weightSum = gaussianPdf(0.0, fSigma); +vec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum; +for (int i = 1; i < KERNEL_RADIUS; i ++) { +float x = float(i); +float w = gaussianPdf(x, fSigma); +vec2 uvOffset = u_direction * invSize * x; +vec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset); +vec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset); +pixelColorSum += (sample1 + sample2) * w; +weightSum += 2.0 * w; +} +gl_FragColor = pixelColorSum /weightSum; +}`},luminosityHighPass:{"luminosityHighPass.frag":`precision mediump float; +uniform sampler2D u_texture; +uniform vec3 u_defaultColor; +uniform float u_defaultOpacity; +uniform float u_luminosityThreshold; +uniform float u_smoothWidth; +varying vec2 v_uv; +void main() { +vec4 texel = texture2D(u_texture, v_uv); +vec3 luma = vec3(0.299, 0.587, 0.114); +float v = dot(texel.xyz, luma); +vec4 outputColor = vec4(u_defaultColor.rgb, u_defaultOpacity); +float alpha = smoothstep(u_luminosityThreshold, u_luminosityThreshold + u_smoothWidth, v); +gl_FragColor = mix(outputColor, texel, alpha); +}`}},blur:{gaussianBlur:{"gaussianBlur.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +uniform vec2 u_texSize; +uniform vec2 u_direction; +uniform float u_sigma; +varying vec2 v_uv; +#define KERNEL_RADIUS RADIUS +float gaussianPdf(in float x, in float sigma) { +return 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma; +} +void main() { +vec2 invSize = 1.0 / u_texSize; +float fSigma = u_sigma; +float weightSum = gaussianPdf(0.0, fSigma); +vec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum; +for (int i = 1; i < KERNEL_RADIUS; i ++) { +float x = float(i); +float w = gaussianPdf(x, fSigma); +vec2 uvOffset = u_direction * invSize * x; +vec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset); +vec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset); +pixelColorSum += (sample1 + sample2) * w; +weightSum += 2.0 * w; +} +gl_FragColor = pixelColorSum /weightSum; +}`},"radial-blur":{"radial-blur.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +varying vec2 v_uv; +const float sampleDist = 1.0; +const float sampleStrength = 2.2; +void main(void) { +float samples[10]; +samples[0] = -0.08; +samples[1] = -0.05; +samples[2] = -0.03; +samples[3] = -0.02; +samples[4] = -0.01; +samples[5] = 0.01; +samples[6] = 0.02; +samples[7] = 0.03; +samples[8] = 0.05; +samples[9] = 0.08; +vec2 dir = 0.5 - v_uv; +float dist = sqrt(dir.x * dir.x + dir.y * dir.y); +dir = dir / dist; +vec4 color = texture2D(u_colorTexture,v_uv); +vec4 sum = color; +for (int i = 0; i < 10; i++) { +sum += texture2D(u_colorTexture, v_uv + dir * samples[i] * sampleDist); +} +sum *= 1.0 / 11.0; +float t = dist * sampleStrength; +t = clamp(t, 0.0, 1.0); +gl_FragColor = mix(color, sum, t); +}`}},dra:{"dra.frag":`precision mediump float; +uniform sampler2D u_minColor; +uniform sampler2D u_maxColor; +uniform sampler2D u_texture; +varying vec2 v_uv; +void main() { +vec4 minColor = texture2D(u_minColor, vec2(0.5)); +vec4 maxColor = texture2D(u_maxColor, vec2(0.5)); +vec4 color = texture2D(u_texture, v_uv); +vec3 minColorUnpremultiply = minColor.rgb / minColor.a; +vec3 maxColorUnpremultiply = maxColor.rgb / maxColor.a; +vec3 colorUnpremultiply = color.rgb / color.a; +vec3 range = maxColorUnpremultiply - minColorUnpremultiply; +gl_FragColor = vec4(color.a * (colorUnpremultiply - minColorUnpremultiply) / range, color.a); +}`,"min-max":{"min-max.frag":`#extension GL_EXT_draw_buffers : require +precision mediump float; +#define CELL_SIZE 2 +uniform sampler2D u_minTexture; +uniform sampler2D u_maxTexture; +uniform vec2 u_srcResolution; +uniform vec2 u_dstResolution; +varying vec2 v_uv; +void main() { +vec2 srcPixel = floor(gl_FragCoord.xy) * float(CELL_SIZE); +vec2 onePixel = vec2(1.0) / u_srcResolution; +vec2 uv = (srcPixel + 0.5) / u_srcResolution; +vec4 minColor = vec4(1.0); +vec4 maxColor = vec4(0.0); +for (int y = 0; y < CELL_SIZE; ++y) { +for (int x = 0; x < CELL_SIZE; ++x) { +vec2 offset = uv + vec2(x, y) * onePixel; +minColor = min(minColor, texture2D(u_minTexture, offset)); +maxColor = max(maxColor, texture2D(u_maxTexture, offset)); +} +} +gl_FragData[0] = minColor; +gl_FragData[1] = maxColor; +}`}},"drop-shadow":{composite:{"composite.frag":`precision mediump float; +uniform sampler2D u_layerFBOTexture; +uniform sampler2D u_blurTexture; +uniform vec4 u_shadowColor; +uniform vec2 u_shadowOffset; +uniform highp mat3 u_displayViewMat3; +varying vec2 v_uv; +void main() { +vec3 offset = u_displayViewMat3 * vec3(u_shadowOffset, 0.0); +vec4 layerColor = texture2D(u_layerFBOTexture, v_uv); +vec4 blurColor = texture2D(u_blurTexture, v_uv - offset.xy / 2.0); +gl_FragColor = ((1.0 - layerColor.a) * blurColor.a * u_shadowColor + layerColor); +}`}},"edge-detect":{"frei-chen":{"frei-chen.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +uniform vec2 u_texSize; +varying vec2 v_uv; +vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); +mat3 G[9]; +const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 ); +const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 ); +const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 ); +const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 ); +const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 ); +const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 ); +const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 ); +const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 ); +const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 ); +void main() { +G[0] = g0, +G[1] = g1, +G[2] = g2, +G[3] = g3, +G[4] = g4, +G[5] = g5, +G[6] = g6, +G[7] = g7, +G[8] = g8; +mat3 I; +float cnv[9]; +vec3 sample; +for (float i = 0.0; i < 3.0; i++) { +for (float j = 0.0; j < 3.0; j++) { +sample = texture2D(u_colorTexture, v_uv + texel * vec2(i - 1.0,j - 1.0)).rgb; +I[int(i)][int(j)] = length(sample); +} +} +for (int i = 0; i < 9; i++) { +float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); +cnv[i] = dp3 * dp3; +} +float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]); +float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M); +gl_FragColor = vec4(vec3(sqrt(M / S)), texture2D(u_colorTexture, v_uv).a); +}`},sobel:{"sobel.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +varying vec2 v_uv; +uniform vec2 u_texSize; +vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); +mat3 G[2]; +const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 ); +const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 ); +void main() { +mat3 I; +float cnv[2]; +vec3 sample; +G[0] = g0; +G[1] = g1; +for (float i = 0.0; i < 3.0; i++) { +for (float j = 0.0; j < 3.0; j++) { +sample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb; +I[int(i)][int(j)] = length(sample); +} +} +for (int i = 0; i < 2; i++) { +float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); +cnv[i] = dp3 * dp3; +} +gl_FragColor = vec4(vec3(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1])), texture2D(u_colorTexture, v_uv).a); +}`}},"edge-enhance":{"edge-enhance.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +varying vec2 v_uv; +uniform vec2 u_texSize; +vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); +mat3 G[2]; +const mat3 g0 = mat3( 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0 ); +const mat3 g1 = mat3( 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -1.0, -1.0, -1.0 ); +void main() { +mat3 I; +float cnv[2]; +vec3 sample; +G[0] = g0; +G[1] = g1; +for (float i = 0.0; i < 3.0; i++) { +for (float j = 0.0; j < 3.0; j++) { +sample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb; +I[int(i)][int(j)] = length(sample); +} +} +for (int i = 0; i < 2; i++) { +float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); +cnv[i] = dp3 * dp3; +} +vec4 color = texture2D(u_colorTexture, v_uv); +gl_FragColor = vec4(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1]) * color); +}`},filterEffect:{"filterEffect.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +uniform mat4 u_coefficients; +varying vec2 v_uv; +void main() { +vec4 color = texture2D(u_colorTexture, v_uv); +vec4 rgbw = u_coefficients * vec4(color.a > 0.0 ? color.rgb / color.a : vec3(0.0), 1.0); +float a = color.a; +gl_FragColor = vec4(a * rgbw.rgb, a); +}`},pp:{"pp.vert":`precision mediump float; +attribute vec2 a_position; +varying vec2 v_uv; +void main() { +gl_Position = vec4(a_position, 0.0, 1.0); +v_uv = (a_position + 1.0) / 2.0; +}`}},raster:{bitmap:{"bitmap.frag":`precision mediump float; +varying highp vec2 v_texcoord; +uniform sampler2D u_texture; +uniform highp vec2 u_coordScale; +uniform lowp float u_opacity; +#include +void main() { +#ifdef BICUBIC +vec4 color = sampleBicubicBSpline(u_texture, v_texcoord, u_coordScale); +#else +vec4 color = texture2D(u_texture, v_texcoord); +#endif +gl_FragColor = vec4(color.rgb * u_opacity, color.a * u_opacity); +}`,"bitmap.vert":`precision mediump float; +attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +varying highp vec2 v_texcoord; +void main() +{ +v_texcoord = a_pos; +gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); +}`},common:{"common.glsl":`uniform sampler2D u_image; +uniform int u_bandCount; +uniform bool u_flipY; +uniform float u_opacity; +uniform int u_resampling; +uniform vec2 u_srcImageSize; +#ifdef APPLY_PROJECTION +#include +#endif +#ifdef BICUBIC +#include +#endif +#ifdef BILINEAR +#include +#endif +vec2 getPixelLocation(vec2 coords) { +vec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords; +#ifdef APPLY_PROJECTION +targetLocation = projectPixelLocation(targetLocation); +#endif +return targetLocation; +} +bool isOutside(vec2 coords){ +if (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) { +return true; +} else { +return false; +} +} +vec4 getPixel(vec2 pixelLocation) { +#ifdef BICUBIC +vec4 color = sampleBicubicBSpline(u_image, pixelLocation, u_srcImageSize); +#elif defined(BILINEAR) +vec4 color = sampleBilinear(u_image, pixelLocation, u_srcImageSize); +#else +vec4 color = texture2D(u_image, pixelLocation); +#endif +return color; +}`,"common.vert":`precision mediump float; +attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +uniform highp float u_scale; +uniform highp vec2 u_offset; +varying highp vec2 v_texcoord; +void main() +{ +v_texcoord = a_pos * u_scale + u_offset; +gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); +}`,"contrastBrightness.glsl":`uniform float u_contrastOffset; +uniform float u_brightnessOffset; +vec4 adjustContrastBrightness(vec4 currentPixel, bool isFloat) { +vec4 pixelValue = isFloat ? currentPixel * 255.0 : currentPixel; +float maxI = 255.0; +float mid = 128.0; +float c = u_contrastOffset; +float b = u_brightnessOffset; +vec4 v; +if (c > 0.0 && c < 100.0) { +v = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid; +} else if (c <= 0.0 && c > -100.0) { +v = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid; +} else if (c == 100.0) { +v = (200.0 * pixelValue - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b); +v = (sign(v) + 1.0) / 2.0; +} else if (c == -100.0) { +v = vec4(mid, mid, mid, currentPixel.a); +} +vec3 rgb = clamp(v.rgb / 255.0, 0.0, 1.0); +return vec4(rgb, currentPixel.a); +}`,"getSurfaceValues.glsl":`#include +void getSurfaceValues(sampler2D imageTexture, vec2 texCoord, vec2 srcImageSize, inout float values[10]) { +vec2 onePixel = 1.0 / srcImageSize; +vec4 va = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, -1.0))); +vec4 vb = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, -1.0))); +vec4 vc = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, -1.0))); +vec4 vd = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 0.0))); +vec4 ve = texture2D(imageTexture, mirror(texCoord)); +vec4 vf = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 0.0))); +vec4 vg = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 1.0))); +vec4 vh = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, 1.0))); +vec4 vi = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 1.0))); +float alpha = va.a * vb.a * vc.a * vd.a * ve.a * vf.a * vg.a * vh.a * vi.a; +values[0] = va.r; +values[1] = vb.r; +values[2] = vc.r; +values[3] = vd.r; +values[4] = ve.r; +values[5] = vf.r; +values[6] = vg.r; +values[7] = vh.r; +values[8] = vi.r; +values[9] = alpha; +}`,"inverse.glsl":`float invertValue(float value) { +float s = sign(value); +return (s * s) / (value + abs(s) - 1.0); +}`,"mirror.glsl":`vec2 mirror(vec2 pos) { +vec2 pos1 = abs(pos); +return step(pos1, vec2(1.0, 1.0)) * pos1 + step(1.0, pos1) * (2.0 - pos1); +}`,"projection.glsl":`uniform sampler2D u_transformGrid; +uniform vec2 u_transformSpacing; +uniform vec2 u_transformGridSize; +uniform vec2 u_targetImageSize; +vec2 projectPixelLocation(vec2 coords) { +#ifdef LOOKUP_PROJECTION +vec4 pv = texture2D(u_transformGrid, coords); +return vec2(pv.r, pv.g); +#endif +vec2 index_image = floor(coords * u_targetImageSize); +vec2 oneTransformPixel = vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t); +vec2 index_transform = floor(index_image / u_transformSpacing) / u_transformGridSize; +vec2 pos = fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing); +vec2 srcLocation; +vec2 transform_location = index_transform + oneTransformPixel * 0.5; +if (pos.s <= pos.t) { +vec4 ll_abc = texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t)); +vec4 ll_def = texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t)); +srcLocation.s = dot(ll_abc.rgb, vec3(pos, 1.0)); +srcLocation.t = dot(ll_def.rgb, vec3(pos, 1.0)); +} else { +vec4 ur_abc = texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t)); +vec4 ur_def = texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t)); +srcLocation.s = dot(ur_abc.rgb, vec3(pos, 1.0)); +srcLocation.t = dot(ur_def.rgb, vec3(pos, 1.0)); +} +return srcLocation; +}`},flow:{"getFadeOpacity.glsl":`uniform float u_decayRate; +uniform float u_fadeToZero; +float getFadeOpacity(float x) { +float cutOff = mix(0.0, exp(-u_decayRate), u_fadeToZero); +return (exp(-u_decayRate * x) - cutOff) / (1.0 - cutOff); +}`,"getFragmentColor.glsl":`vec4 getFragmentColor(vec4 color, float dist, float size, float featheringSize) { +float featheringStart = clamp(0.5 - featheringSize / size, 0.0, 0.5); +if (dist > featheringStart) { +color *= 1.0 - (dist - featheringStart) / (0.5 - featheringStart); +} +return color; +}`,imagery:{"imagery.frag":`precision highp float; +varying vec2 v_texcoord; +uniform sampler2D u_texture; +uniform float u_Min; +uniform float u_Max; +uniform float u_featheringSize; +#include +float getIntensity(float v) { +return u_Min + v * (u_Max - u_Min); +} +void main(void) { +vec4 sampled = texture2D(u_texture, v_texcoord); +float intensity = getIntensity(sampled.r); +gl_FragColor = getColor(intensity); +gl_FragColor.a *= getOpacity(sampled.r); +gl_FragColor.a *= sampled.a; +gl_FragColor.rgb *= gl_FragColor.a; +}`,"imagery.vert":`attribute vec2 a_position; +attribute vec2 a_texcoord; +uniform mat3 u_dvsMat3; +varying vec2 v_texcoord; +void main(void) { +vec2 xy = (u_dvsMat3 * vec3(a_position, 1.0)).xy; +gl_Position = vec4(xy, 0.0, 1.0); +v_texcoord = a_texcoord; +}`},particles:{"particles.frag":`precision highp float; +varying vec4 v_color; +varying vec2 v_texcoord; +varying float v_size; +uniform float u_featheringSize; +#include +void main(void) { +gl_FragColor = getFragmentColor(v_color, length(v_texcoord - 0.5), v_size, u_featheringSize); +}`,"particles.vert":`attribute vec4 a_xyts0; +attribute vec4 a_xyts1; +attribute vec4 a_typeIdDurationSeed; +attribute vec4 a_extrudeInfo; +uniform mat3 u_dvsMat3; +uniform mat3 u_displayViewMat3; +uniform float u_time; +uniform float u_trailLength; +uniform float u_flowSpeed; +varying vec4 v_color; +varying vec2 v_texcoord; +varying float v_size; +uniform float u_featheringSize; +uniform float u_introFade; +#include +#include +void main(void) { +vec2 position0 = a_xyts0.xy; +float t0 = a_xyts0.z; +float speed0 = a_xyts0.w; +vec2 position1 = a_xyts1.xy; +float t1 = a_xyts1.z; +float speed1 = a_xyts1.w; +float type = a_typeIdDurationSeed.x; +float id = a_typeIdDurationSeed.y; +float duration = a_typeIdDurationSeed.z; +float seed = a_typeIdDurationSeed.w; +vec2 e0 = a_extrudeInfo.xy; +vec2 e1 = a_extrudeInfo.zw; +float animationPeriod = duration + u_trailLength; +float scaledTime = u_time * u_flowSpeed; +float randomizedTime = scaledTime + seed * animationPeriod; +float t = mod(randomizedTime, animationPeriod); +float fUnclamped = (t - t0) / (t1 - t0); +float f = clamp(fUnclamped, 0.0, 1.0); +float clampedTime = mix(t0, t1, f); +float speed = mix(speed0, speed1, f); +vec2 extrude; +vec2 position; +float fadeOpacity; +float introOpacity; +if (type == 2.0) { +if (fUnclamped < 0.0 || (fUnclamped > 1.0 && t1 != duration)) { +gl_Position = vec4(0.0, 0.0, -2.0, 1.0); +return; +} +vec2 ortho = mix(e0, e1, f); +vec2 parallel; +parallel = normalize(position1 - position0) * 0.5; +if (id == 1.0) { +extrude = ortho; +v_texcoord = vec2(0.5, 0.0); +} else if (id == 2.0) { +extrude = -ortho; +v_texcoord = vec2(0.5, 1.0); +} else if (id == 3.0) { +extrude = ortho + parallel; +v_texcoord = vec2(1.0, 0.0); +} else if (id == 4.0) { +extrude = -ortho + parallel; +v_texcoord = vec2(1.0, 1.0); +} +fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); +introOpacity = 1.0 - exp(-clampedTime); +v_size = getSize(speed); +v_color = getColor(speed); +v_color.a *= getOpacity(speed); +position = mix(position0, position1, f); +} else { +if (fUnclamped < 0.0) { +gl_Position = vec4(0.0, 0.0, -2.0, 1.0); +return; +} +if (id == 1.0) { +extrude = e0; +v_texcoord = vec2(0.5, 0.0); +fadeOpacity = getFadeOpacity((t - t0) / u_trailLength); +introOpacity = 1.0 - exp(-t0); +v_size = getSize(speed0); +v_color = getColor(speed0); +v_color.a *= getOpacity(speed0); +position = position0; +} else if (id == 2.0) { +extrude = -e0; +v_texcoord = vec2(0.5, 1.0); +fadeOpacity = getFadeOpacity((t - t0) / u_trailLength); +introOpacity = 1.0 - exp(-t0); +v_size = getSize(speed0); +v_color = getColor(speed0); +v_color.a *= getOpacity(speed0); +position = position0; +} else if (id == 3.0) { +extrude = mix(e0, e1, f); +v_texcoord = vec2(0.5, 0.0); +fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); +introOpacity = 1.0 - exp(-clampedTime); +v_size = getSize(speed); +v_color = getColor(speed); +v_color.a *= getOpacity(speed); +position = mix(position0, position1, f); +} else if (id == 4.0) { +extrude = -mix(e0, e1, f); +v_texcoord = vec2(0.5, 1.0); +fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); +introOpacity = 1.0 - exp(-clampedTime); +v_size = getSize(speed); +v_color = getColor(speed); +v_color.a *= getOpacity(speed); +position = mix(position0, position1, f); +} +} +vec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(extrude * v_size, 0.0)).xy; +gl_Position = vec4(xy, 0.0, 1.0); +v_color.a *= fadeOpacity; +v_color.a *= mix(1.0, introOpacity, u_introFade); +v_color.rgb *= v_color.a; +}`},streamlines:{"streamlines.frag":`precision highp float; +varying float v_side; +varying float v_time; +varying float v_totalTime; +varying float v_timeSeed; +varying vec4 v_color; +varying float v_size; +uniform float u_time; +uniform float u_trailLength; +uniform float u_flowSpeed; +uniform float u_featheringSize; +uniform float u_introFade; +#include +#include +void main(void) { +float t = mod(v_timeSeed * (v_totalTime + u_trailLength) + u_time * u_flowSpeed, v_totalTime + u_trailLength) - v_time; +vec4 color = v_color * step(0.0, t) * getFadeOpacity(t / u_trailLength); +color *= mix(1.0, 1.0 - exp(-v_time), u_introFade); +gl_FragColor = getFragmentColor(color, length((v_side + 1.0) / 2.0 - 0.5), v_size, u_featheringSize); +}`,"streamlines.vert":`attribute vec3 a_positionAndSide; +attribute vec3 a_timeInfo; +attribute vec2 a_extrude; +attribute float a_speed; +uniform mat3 u_dvsMat3; +uniform mat3 u_displayViewMat3; +varying float v_time; +varying float v_totalTime; +varying float v_timeSeed; +varying vec4 v_color; +varying float v_side; +varying float v_size; +uniform float u_featheringSize; +#include +void main(void) { +vec4 lineColor = getColor(a_speed); +float lineOpacity = getOpacity(a_speed); +float lineSize = getSize(a_speed); +vec2 position = a_positionAndSide.xy; +v_side = a_positionAndSide.z; +vec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(a_extrude * lineSize, 0.0)).xy; +gl_Position = vec4(xy, 0.0, 1.0); +v_time = a_timeInfo.x; +v_totalTime = a_timeInfo.y; +v_timeSeed = a_timeInfo.z; +v_color = lineColor; +v_color.a *= lineOpacity; +v_color.rgb *= v_color.a; +v_size = lineSize; +}`},"vv.glsl":`#define MAX_STOPS 8 +#ifdef VV_COLOR +uniform float u_color_stops[MAX_STOPS]; +uniform vec4 u_color_values[MAX_STOPS]; +uniform int u_color_count; +#else +uniform vec4 u_color; +#endif +#ifdef VV_OPACITY +uniform float u_opacity_stops[MAX_STOPS]; +uniform float u_opacity_values[MAX_STOPS]; +uniform int u_opacity_count; +#else +uniform float u_opacity; +#endif +#ifdef VV_SIZE +uniform float u_size_stops[MAX_STOPS]; +uniform float u_size_values[MAX_STOPS]; +uniform int u_size_count; +#else +uniform float u_size; +#endif +uniform float u_featheringOffset; +vec4 getColor(float x) { +#ifdef VV_COLOR +vec4 color = u_color_values[0]; +{ +for (int i = 1; i < MAX_STOPS; i++) { +if (i >= u_color_count) { +break; +} +float x1 = u_color_stops[i - 1]; +if (x < x1) { +break; +} +float x2 = u_color_stops[i]; +vec4 y2 = u_color_values[i]; +if (x < x2) { +vec4 y1 = u_color_values[i - 1]; +color = y1 + (y2 - y1) * (x - x1) / (x2 - x1); +} else { +color = y2; +} +} +} +#else +vec4 color = u_color; +#endif +return color; +} +float getOpacity(float x) { +#ifdef VV_OPACITY +float opacity = u_opacity_values[0]; +{ +for (int i = 1; i < MAX_STOPS; i++) { +if (i >= u_opacity_count) { +break; +} +float x1 = u_opacity_stops[i - 1]; +if (x < x1) { +break; +} +float x2 = u_opacity_stops[i]; +float y2 = u_opacity_values[i]; +if (x < x2) { +float y1 = u_opacity_values[i - 1]; +opacity = y1 + (y2 - y1) * (x - x1) / (x2 - x1); +} else { +opacity = y2; +} +} +} +#else +float opacity = u_opacity; +#endif +return opacity; +} +float getSize(float x) { +#ifdef VV_SIZE +float size = u_size_values[0]; +{ +for (int i = 1; i < MAX_STOPS; i++) { +if (i >= u_size_count) { +break; +} +float x1 = u_size_stops[i - 1]; +if (x < x1) { +break; +} +float x2 = u_size_stops[i]; +float y2 = u_size_values[i]; +if (x < x2) { +float y1 = u_size_values[i - 1]; +size = y1 + (y2 - y1) * (x - x1) / (x2 - x1); +} else { +size = y2; +} +} +} +#else +float size = u_size; +#endif +return size + 2.0 * u_featheringSize * u_featheringOffset; +}`},hillshade:{"hillshade.frag":`precision mediump float; +varying highp vec2 v_texcoord; +#include +uniform int u_hillshadeType; +uniform float u_sinZcosAs[6]; +uniform float u_sinZsinAs[6]; +uniform float u_cosZs[6]; +uniform float u_weights[6]; +uniform vec2 u_factor; +uniform float u_minValue; +uniform float u_maxValue; +uniform float u_scaling; +#include +#include +vec3 rgb2hsv(vec3 c) { +vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); +vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); +float d = q.x - min(q.w, q.y); +float e = 1.0e-10; +return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); +} +vec3 hsv2rgb(vec3 c) { +vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); +return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} +vec4 overlay(float val, float minValue, float maxValue, float hillshade) { +val = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0); +vec4 rgb = colorize(vec4(val, val, val, 1.0), 255.0); +vec3 hsv = rgb2hsv(rgb.xyz); +hsv.z = hillshade; +return vec4(hsv2rgb(hsv) * u_scaling, 1.0) * rgb.a; +} +void main() { +vec2 pixelLocation = getPixelLocation(v_texcoord); +if (isOutside(pixelLocation)) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +if (currentPixel.a == 0.0) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +return; +} +float pv[10]; +getSurfaceValues(u_image, pixelLocation, u_srcImageSize, pv); +float alpha = pv[9]; +float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * u_factor.s; +float dzy = (pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * u_factor.t; +float dzd = sqrt(1.0 + dzx * dzx + dzy * dzy); +float hillshade = 0.0; +if (u_hillshadeType == 0){ +float cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx; +float z = (u_cosZs[0] + cosDelta) / dzd; +if (z < 0.0) z = 0.0; +hillshade = z; +} else { +for (int k = 0; k < 6; k++) { +float cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx; +float z = (u_cosZs[k] + cosDelta) / dzd; +if (z < 0.0) z = 0.0; +hillshade = hillshade + z * u_weights[k]; +if (k == 5) break; +} +} +#ifdef APPLY_COLORMAP +vec4 result = overlay(pv[4], u_minValue, u_maxValue, hillshade) * alpha * u_opacity; +#else +hillshade *= u_scaling; +vec4 result = vec4(hillshade, hillshade, hillshade, 1.0) * alpha * u_opacity; +#endif +#ifdef ROUND_OUTPUT +result = vec4(floor(result.xyz + 0.5), result.a); +#endif +gl_FragColor = result; +}`},lut:{"colorize.glsl":`uniform sampler2D u_colormap; +uniform float u_colormapOffset; +uniform float u_colormapMaxIndex; +vec4 colorize(vec4 currentPixel, float scaleFactor) { +float clrIndex = clamp(currentPixel.r * scaleFactor - u_colormapOffset, 0.0, u_colormapMaxIndex); +vec2 clrPosition = vec2((clrIndex + 0.5) / (u_colormapMaxIndex + 1.0), 0.0); +vec4 color = texture2D(u_colormap, clrPosition); +vec4 result = vec4(color.rgb, color.a * currentPixel.a); +return result; +} +vec4 colorizeNoClamp(vec4 currentPixel, float scaleFactor) { +float value = currentPixel.r * scaleFactor - u_colormapOffset; +vec4 result = colorize(currentPixel, scaleFactor); +return result * step(0.0, value) * step(value, u_colormapMaxIndex); +}`,"lut.frag":`precision mediump float; +varying highp vec2 v_texcoord; +#include +#include +void main() { +vec2 pixelLocation = getPixelLocation(v_texcoord); +if (isOutside(pixelLocation)) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +vec4 result = colorizeNoClamp(currentPixel, 1.0); +gl_FragColor = vec4(result.xyz, 1.0) * result.a * u_opacity; +}`},magdir:{"magdir.frag":`precision mediump float; +varying vec4 v_color; +uniform lowp float u_opacity; +void main() { +gl_FragColor = v_color * u_opacity; +}`,"magdir.vert":`precision mediump float; +attribute vec2 a_pos; +attribute vec2 a_offset; +attribute vec2 a_vv; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +uniform vec2 u_symbolSize; +uniform vec2 u_symbolPercentRange; +uniform vec2 u_dataRange; +uniform float u_rotation; +uniform vec4 u_colors[12]; +varying vec4 v_color; +void main() +{ +float angle = a_offset.y + u_rotation; +#ifndef ROTATION_GEOGRAPHIC +angle = 3.14159265359 * 2.0 - angle - 3.14159265359 / 2.0; +#endif +vec2 offset = vec2(cos(angle), sin(angle)) * a_offset.x; +#ifdef DATA_RANGE +float valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0); +float sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x); +float sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y); +#else +float sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0; +#endif +vec2 pos = a_pos + offset * sizePercentage * u_symbolSize; +v_color = u_colors[int(a_vv.x)]; +gl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0); +}`},reproject:{"reproject.frag":`precision mediump float; +varying vec2 v_texcoord; +#include +void main() { +vec2 pixelLocation = getPixelLocation(v_texcoord); +if (isOutside(pixelLocation)) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +gl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity; +}`,"reproject.vert":`precision mediump float; +attribute vec2 a_position; +varying highp vec2 v_texcoord; +void main() +{ +v_texcoord = a_position; +gl_Position = vec4(2.0 * (a_position - 0.5), 0.0, 1.0); +}`},rfx:{aspect:{"aspect.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec2 u_cellSize; +uniform vec2 u_srcImageSize; +#include +const float pi = 3.14159265359; +void main() { +float pv[10]; +getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); +float alpha = pv[9]; +float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) / (8.0 * u_cellSize[0]); +float dzy = -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) / (8.0 * u_cellSize[1]); +alpha *= sign(abs(dzx) + abs(dzy)); +float aspect_rad = (dzx == 0.0) ? (step(0.0, dzy) * 0.5 * pi + step(dzy, 0.0) * 1.5 * pi) : mod((2.5 * pi + atan(dzy, -dzx)), 2.0 * pi); +float aspect = aspect_rad * 180.0 / pi; +gl_FragColor = vec4(aspect, aspect, aspect, 1.0) * alpha; +}`},bandarithmetic:{"bandarithmetic.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform mediump mat3 u_bandIndexMat3; +uniform float u_adjustments[3]; +#include +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec3 pv2 = u_bandIndexMat3 * pv.rgb; +float nir = pv2.r; +float red = pv2.g; +float index; +#ifdef NDXI +index = (nir - red) * invertValue(nir + red); +#elif defined(SR) +index = nir * invertValue(red); +#elif defined(CI) +index = nir * invertValue(red) - 1.0; +#elif defined(SAVI) +index = (nir - red) * invertValue(nir + red + u_adjustments[0]) * (1.0 + u_adjustments[0]); +#elif defined(TSAVI) +float s = u_adjustments[0]; +float a = u_adjustments[1]; +float x = u_adjustments[2]; +float y = -a * s + x * (1.0 + s * s); +index = (s * (nir - s * red - a)) * invertValue(a * nir + red + y); +#elif defined(MSAVI) +float nir2 = 2.0 * nir + 1.0; +index = 0.5 * (nir2 - sqrt(nir2 * nir2 - 8.0 * (nir - red))); +#elif defined(GEMI) +float eta = (2.0 * (nir * nir - red * red) + 1.5 * nir + 0.5 * red) * invertValue(nir + red + 0.5); +index = eta * (1.0 - 0.25 * eta) - (red - 0.125) * invertValue(1.0 - red); +#elif defined(PVI) +float a = u_adjustments[0]; +float b = u_adjustments[1]; +float y = sqrt(1.0 + a * a); +index = (nir - a * red - b) * invertValue(y); +#elif defined(VARI) +index = (pv2.g - pv2.r) * invertValue(pv2.g + pv2.r - pv2.b); +#elif defined(MTVI) +float green = pv2.b; +float v = sqrt(pow((2.0 * nir + 1.0), 2.0) - (6.0 * nir - 5.0 * sqrt(red)) - 0.5); +index = 1.5 * (1.2 * (nir - green) - 2.5 * (red - green)) * invertValue(v); +#elif defined(RTVICORE) +float green = pv2.b; +index = 100.0 * (nir - red) - 10.0 * (nir - green); +#elif defined(EVI) +float blue = pv2.b; +float denom = nir + 6.0 * red - 7.5 * blue + 1.0; +index = (2.5 * (nir - red)) * invertValue(denom); +#elif defined(WNDWI) +float g = pv2.r; +float n = pv2.g; +float s = pv2.b; +float a = u_adjustments[0]; +float denom = g + a * n + (1.0 - a) * s; +index = (g - a * n - (1.0 - a) * s) * invertValue(denom); +#elif defined(BAI) +index = invertValue(pow((0.1 - red), 2.0) + pow((0.06 - nir), 2.0)); +#else +gl_FragColor = pv; +return; +#endif +#ifdef ROUND_OUTPUT +index = floor(index + 0.5); +#endif +gl_FragColor = vec4(index, index, index, pv.a); +}`},colormap2rgb:{"colormap2rgb.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +#include +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec4 result = colorizeNoClamp(vec4(pv.r, pv.r, pv.r, 1.0), 1.0); +gl_FragColor = vec4(result.xyz * 255.0, 1.0) * result.a * pv.a; +}`},compositeband:{"compositeband.frag":`precision mediump float; +uniform sampler2D u_image; +uniform sampler2D u_image1; +uniform sampler2D u_image2; +#ifdef ONE_CONSTANT +uniform float u_image1Const; +#ifdef TWO_CONSTANT +uniform float u_image2Const; +#endif +uniform mat3 u_imageSwap; +#endif +varying vec2 v_texcoord; +void main() { +vec4 pv0 = texture2D(u_image, v_texcoord); +float a = pv0.r; +float alpha = pv0.a; +#ifdef TWO_CONSTANT +float b = u_image1Const; +float c = u_image2Const; +vec3 abc = u_imageSwap * vec3(a, b, c); +a = abc.s; +b = abc.t; +c = abc.p; +#elif defined(ONE_CONSTANT) +vec4 pv1 = texture2D(u_image1, v_texcoord); +float b = pv1.r; +float c = u_image1Const; +vec3 abc = u_imageSwap * vec3(a, b, c); +a = abc.s; +b = abc.t; +c = abc.p; +alpha *= pv1.a; +#else +vec4 pv1 = texture2D(u_image1, v_texcoord); +vec4 pv2 = texture2D(u_image2, v_texcoord); +float b = pv1.r; +float c = pv2.r; +alpha = alpha * pv1.a * pv2.a; +#endif +gl_FragColor = vec4(a, b, c, alpha); +}`},computechange:{"computechange.frag":`precision mediump float; +uniform sampler2D u_image; +uniform sampler2D u_image1; +#ifdef ONE_CONSTANT +uniform float u_image1Const; +uniform mat3 u_imageSwap; +#endif +varying vec2 v_texcoord; +uniform vec2 u_domainRange; +#include +void main() { +vec4 pv0 = texture2D(u_image, v_texcoord); +float a = pv0.r; +#ifdef ONE_CONSTANT +float b = u_image1Const; +vec3 abc = u_imageSwap * vec3(a, b, 0); +a = abc.s; +b = abc.t; +#else +vec4 pv1 = texture2D(u_image1, v_texcoord); +float b = pv1.r; +#endif +float result = a; +float alpha = pv0.a; +#ifdef DIFFERENCE +result = a - b; +#elif defined(RELATIVE) +result = (a - b) * invertValue(max(abs(a), abs(b))); +#endif +bool isInvalid = result < u_domainRange.s || result > u_domainRange.t; +result = isInvalid ? 0.0 : result; +alpha *= float(!isInvalid); +#ifdef ROUND_OUTPUT +result = floor(result + 0.5); +#endif +gl_FragColor = vec4(result, result, result, alpha); +}`},contrast:{"contrast.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +#include +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec4 result = adjustContrastBrightness(pv, false); +gl_FragColor = vec4(floor(result.rgb * 255.0 + 0.5), result.a); +}`},convolution:{"convolution.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec2 u_srcImageSize; +#define KERNEL_SIZE_ROWS ROWS +#define KERNEL_SIZE_COLS COLS +uniform vec2 u_clampRange; +uniform float u_kernel[25]; +#include +void main() { +vec3 rgb = vec3(0.0, 0.0, 0.0); +vec2 resolution = 1.0 / u_srcImageSize; +float rowOffset = -float(floor(float(KERNEL_SIZE_ROWS) / 2.0)); +float colOffset = -float(floor(float(KERNEL_SIZE_COLS) / 2.0)); +float alpha = 1.0; +for (int row = 0; row < KERNEL_SIZE_ROWS; row++) { +float pos_row = rowOffset + float(row); +for (int col = 0; col < KERNEL_SIZE_COLS; col++) { +vec2 pos = v_texcoord + vec2(colOffset + float(col), pos_row) * resolution; +vec4 pv = texture2D(u_image, mirror(pos)); +rgb += pv.rgb * u_kernel[row * KERNEL_SIZE_COLS + col]; +alpha *= pv.a; +} +} +rgb = clamp(rgb, u_clampRange.s, u_clampRange.t); +gl_FragColor = vec4(rgb * alpha, alpha); +}`},curvature:{"curvature.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform float u_zlFactor; +uniform vec2 u_srcImageSize; +#include +void main() { +float pv[10]; +getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); +float alpha = pv[9]; +float d = ((pv[3] + pv[5]) * 0.5 - pv[4]); +float e = ((pv[1] + pv[7]) * 0.5 - pv[4]); +float curvature = 0.0; +#ifdef STANDARD +curvature = -u_zlFactor * (d + e); +gl_FragColor = vec4(curvature, curvature, curvature, alpha); +#else +float f = (-pv[0] + pv[2] + pv[6] - pv[8]) / 4.0; +float g = (-pv[3] + pv[5]) / 2.0; +float h = (pv[1] - pv[7]) / 2.0; +float g2 = g * g; +float h2 = h * h; +#ifdef PROFILE +curvature = (u_zlFactor * (d * g2 + e * h2 + f * g * h)) / (g2 + h2); +#else +curvature = (-u_zlFactor * (d * h2 + e * g2 - f * g * h)) / (g2 + h2); +#endif +#endif +gl_FragColor = vec4(curvature, curvature, curvature, alpha); +}`},extractband:{"extractband.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform mediump mat3 u_bandIndexMat3; +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec3 pv2 = u_bandIndexMat3 * pv.rgb; +gl_FragColor = vec4(pv2, pv.a); +}`},focalstatistics:{"focalstatistics.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec2 u_srcImageSize; +#define KERNEL_SIZE_ROWS ROWS +#define KERNEL_SIZE_COLS COLS +uniform vec2 u_clampRange; +#include +#include +void main() { +vec2 resolution = 1.0 / u_srcImageSize; +float rowOffset = -float(floor(float(KERNEL_SIZE_ROWS) / 2.0)); +float colOffset = -float(floor(float(KERNEL_SIZE_COLS) / 2.0)); +float count = 0.0; +#ifdef STDDEV +vec3 sum = vec3(0.0, 0.0, 0.0); +vec3 sum2 = vec3(0.0, 0.0, 0.0); +#endif +vec4 currentPixel = texture2D(u_image, v_texcoord); +vec3 rgb = currentPixel.rgb; +for (int row = 0; row < KERNEL_SIZE_ROWS; row++) { +float pos_row = rowOffset + float(row); +for (int col = 0; col < KERNEL_SIZE_COLS; col++) { +vec2 pos = v_texcoord + vec2(colOffset + float(col), pos_row) * resolution; +vec4 pv = texture2D(u_image, mirror(pos)); +count += pv.a; +#ifdef MIN +rgb = min(rgb, pv.rgb); +#elif defined(MAX) +rgb = max(rgb, pv.rgb); +#elif defined(MEAN) +rgb += pv.rgb; +#elif defined(STDDEV) +sum += pv.rgb; +sum2 += (pv.rgb * pv.rgb); +#endif +} +} +#ifdef MEAN +rgb *= invertValue(count); +#elif defined(STDDEV) +rgb = sqrt((sum2 - sum * sum * invertValue(count)) * invertValue(count)); +#endif +float alpha = step(0.9999, count); +rgb = clamp(rgb, u_clampRange.s, u_clampRange.t); +#ifdef FILL +rgb = (1.0 - currentPixel.a) * rgb + currentPixel.a * currentPixel.rgb; +#endif +gl_FragColor = vec4(rgb * alpha, alpha); +}`},grayscale:{"grayscale.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec3 u_weights; +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +float value = dot(u_weights, pv.rgb); +gl_FragColor = vec4(value, value, value, pv.a); +}`},local:{"local.frag":`precision highp float; +uniform sampler2D u_image; +uniform sampler2D u_image1; +#ifdef ONE_CONSTANT +uniform float u_image1Const; +#ifdef TWO_CONSTANT +uniform float u_image2Const; +#endif +uniform mat3 u_imageSwap; +#endif +varying vec2 v_texcoord; +uniform vec2 u_domainRange; +#include +void main() { +vec4 pv0 = texture2D(u_image, v_texcoord); +float a = pv0.r; +#ifdef TWO_IMAGES +#ifdef ONE_CONSTANT +float b = u_image1Const; +vec3 abc = u_imageSwap * vec3(a, b, 0); +a = abc.s; +b = abc.t; +#else +vec4 pv1 = texture2D(u_image1, v_texcoord); +float b = pv1.r; +#endif +#elif defined(CONDITIONAL) +#ifdef TWO_CONSTANT +float b = u_image1Const; +float c = u_image2Const; +vec3 abc = u_imageSwap * vec3(a, b, c); +a = abc.s; +b = abc.t; +c = abc.p; +#elif defined(ONE_CONSTANT) +vec4 pv1 = texture2D(u_image1, v_texcoord); +float b = pv1.r; +float c = u_image1Const; +vec3 abc = u_imageSwap * vec3(a, b, c); +a = abc.s; +b = abc.t; +c = abc.p; +#else +vec4 pv1 = texture2D(u_image1, v_texcoord); +vec4 pv2 = texture2D(u_image2, v_texcoord); +float b = pv1.r; +float c = pv2.r; +#endif +#endif +float result = a; +float alpha = pv0.a; +#ifdef PLUS +result = a + b; +#elif defined(MINUS) +result = a - b; +#elif defined(TIMES) +result = a * b; +#elif defined(DIVIDE) +result = a * invertValue(b); +alpha *= float(abs(sign(b))); +#elif defined(FLOATDIVIDE) +result = a * invertValue(b); +alpha *= float(abs(sign(b))); +#elif defined(FLOORDIVIDE) +result = floor(a * invertValue(b)); +alpha *= float(abs(sign(b))); +#elif defined(SQUARE) +result = a * a; +#elif defined(SQRT) +result = sqrt(a); +#elif defined(POWER) +result = pow(a, b); +#elif defined(LN) +result = a <= 0.0 ? 0.0: log(a); +alpha *= float(a > 0.0); +#elif defined(LOG_1_0) +result = a <= 0.0 ? 0.0: log2(a) * invertValue(log2(10.0)); +alpha *= float(a > 0.0); +#elif defined(LOG_2) +result = a <= 0.0 ? 0.0: log2(a); +alpha *= float(a > 0.0); +#elif defined(EXP) +result = exp(a); +#elif defined(EXP_1_0) +result = pow(10.0, a); +#elif defined(EXP_2) +result = pow(2.0, a); +#elif defined(ROUNDDOWN) +result = floor(a); +#elif defined(ROUNDUP) +result = ceil(a); +#elif defined(INT) +result = float(sign(a)) * floor(abs(a)); +#elif defined(MOD) +result = mod(a, b); +#elif defined(NEGATE) +result = -a; +#elif defined(ABS) +result = abs(a); +#elif defined(ACOS) +result = abs(a) > 1.0 ? 0.0: acos(a); +alpha *= step(abs(a), 1.00001); +#elif defined(ACOSH) +result = acosh(a); +#elif defined(ASIN) +result = abs(a) > 1.0 ? 0.0: asin(a); +alpha *= step(abs(a), 1.00001); +#elif defined(ASINH) +result = asinh(a); +#elif defined(ATAN) +result = atan(a); +#elif defined(ATANH) +result = abs(a) > 1.0 ? 0.0: atanh(a); +alpha *= step(abs(a), 1.0); +#elif defined(ATAN_2) +result = atan(a, b); +#elif defined(COS) +result = cos(a); +#elif defined(COSH) +result = cosh(a); +#elif defined(SIN) +result = sin(a); +#elif defined(SINH) +result = sinh(a); +#elif defined(TAN) +result = tan(a); +#elif defined(TANH) +result = tanh(a); +#elif defined(BITWISEAND) +result = float(int(a) & int(b)); +#elif defined(BITWISEOR) +result = float(int(a) | int(b)); +#elif defined(BITWISELEFTSHIFT) +result = float(int(a) << int(b)); +#elif defined(BITWISERIGHTSHIFT) +result = float(int(a) >> int(b)); +#elif defined(BITWISENOT) +result = float(~(int(a))); +#elif defined(BITWISEXOR) +result = float(int(a) ^ int(b)); +#elif defined(BOOLEANAND) +result = float((a != 0.0) && (b != 0.0)); +#elif defined(BOOLEANNOT) +result = float(a == 0.0); +#elif defined(BOOLEANOR) +result = float((a != 0.0) || (b != 0.0)); +#elif defined(BOOLEANXOR) +result = float((a != 0.0) ^^ (b != 0.0)); +#elif defined(GREATERTHAN) +result = float(a > b); +#elif defined(GREATERTHANEQUAL) +result = float(a >= b); +#elif defined(LESSTHAN) +result = float(a < b); +#elif defined(LESSTHANEQUAL) +result = float(a <= b); +#elif defined(EQUALTO) +result = float(a == b); +#elif defined(NOTEQUAL) +result = float(a != b); +#elif defined(ISNULL) +result = float(alpha == 0.0); +alpha = 1.0; +#elif defined(SETNULL) +float maskValue = float(a == 0.0); +result = maskValue * b; +alpha *= maskValue; +#elif defined(CONDITIONAL) +float weight = float(abs(sign(a))); +result = weight * b + (1.0 - weight) * c; +#endif +float rangeFactor = step(u_domainRange.s, result) * step(result, u_domainRange.t); +result *= rangeFactor; +alpha *= rangeFactor; +#ifdef ROUND_OUTPUT +result = floor(result + 0.5); +#endif +gl_FragColor = vec4(result, result, result, alpha); +}`},mask:{"mask.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +#define LEN_INCLUDED_RANGES 6 +#define LEN_NODATA_VALUES 6 +uniform highp float u_includedRanges[6]; +uniform highp float u_noDataValues[6]; +float maskFactor(float bandValue, float fromValue, float to) { +float factor = 1.0; +for (int i = 0; i < LEN_NODATA_VALUES; i++) { +factor *= float(u_noDataValues[i] != bandValue); +} +factor *= step(fromValue, bandValue) * step(bandValue, to); +return factor; +} +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +float redFactor = maskFactor(pv.r, u_includedRanges[0], u_includedRanges[1]); +#ifdef MULTI_BAND +float greenFactor = maskFactor(pv.g, u_includedRanges[2], u_includedRanges[3]); +float blueFactor = maskFactor(pv.b, u_includedRanges[4], u_includedRanges[5]); +float maskFactor = redFactor * greenFactor * blueFactor; +gl_FragColor = pv * maskFactor; +#else +gl_FragColor = pv * redFactor; +#endif +}`},ndvi:{"ndvi.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform mediump mat3 u_bandIndexMat3; +#include +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec3 pv2 = u_bandIndexMat3 * pv.rgb; +float nir = pv2.r; +float red = pv2.g; +float index = (nir - red) * invertValue(nir + red); +#ifdef SCALED +index = floor((index + 1.0) * 100.0 + 0.5); +#endif +gl_FragColor = vec4(index, index, index, pv.a); +}`},remap:{"remap.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +#define LEN_REMAP_RANGES 18 +#define LEN_NODATA_RANGES 12 +uniform highp float u_rangeMaps[18]; +uniform highp float u_noDataRanges[12]; +uniform highp float u_unmatchMask; +uniform vec2 u_clampRange; +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +float factor = 1.0; +float bandValue = pv.r; +for (int i = 0; i < LEN_NODATA_RANGES; i+=2) { +float inside = 1.0 - step(u_noDataRanges[i], bandValue) * step(bandValue, u_noDataRanges[i+1]); +factor *= inside; +} +float mapValue = 0.0; +float includeMask = 0.0; +for (int i = 0; i < LEN_REMAP_RANGES; i+=3) { +float stepMask = step(u_rangeMaps[i], bandValue) * step(bandValue, u_rangeMaps[i+1]); +includeMask = (1.0 - stepMask) * includeMask + stepMask; +mapValue = (1.0 - stepMask) * mapValue + stepMask * u_rangeMaps[i+2]; +} +bandValue = factor * (mapValue + (1.0 - includeMask) * u_unmatchMask * pv.r); +float bandMask = factor * max(u_unmatchMask, includeMask); +bandValue = clamp(bandValue, u_clampRange.s, u_clampRange.t); +gl_FragColor = vec4(bandValue, bandValue, bandValue, bandMask * pv.a); +}`},slope:{"slope.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec2 u_cellSize; +uniform float u_zFactor; +uniform vec2 u_srcImageSize; +uniform float u_pixelSizePower; +uniform float u_pixelSizeFactor; +#include +void main() { +float pv[10]; +getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); +float alpha = pv[9]; +float xf = (u_zFactor + pow(u_cellSize[0], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[0]); +float yf = (u_zFactor + pow(u_cellSize[1], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[1]); +float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * xf; +float dzy = -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * yf; +float rise2run = sqrt(dzx * dzx + dzy * dzy); +#ifdef PERCENT_RISE +float result = rise2run * 100.0; +#else +float result = atan(rise2run) * 57.2957795; +#endif +#ifdef ROUND_OUTPUT +result = floor(result + 0.5); +#endif +gl_FragColor = vec4(result, result, result, alpha); +}`},stretch:{"stretch.frag":`precision mediump float; +uniform sampler2D u_image; +varying highp vec2 v_texcoord; +uniform float u_minCutOff[3]; +uniform float u_maxCutOff[3]; +uniform float u_minOutput; +uniform float u_maxOutput; +uniform float u_factor[3]; +uniform float u_gamma[3]; +uniform float u_gammaCorrection[3]; +float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, float gamma, float gammaCorrection) { +val = clamp(val, minCutOff, maxCutOff); +float stretchedVal; +#ifdef USE_GAMMA +float tempf = 1.0; +float outRange = maxOutput - minOutput; +float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); +tempf -= step(1.0, gamma) * sign(gamma - 1.0) * pow(1.0 / outRange, relativeVal * gammaCorrection); +stretchedVal = tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput; +stretchedVal = clamp(stretchedVal, minOutput, maxOutput); +#else +stretchedVal = minOutput + (val - minCutOff) * factor; +#endif +#ifdef ROUND_OUTPUT +stretchedVal = floor(stretchedVal + 0.5); +#endif +return stretchedVal; +} +void main() { +vec4 currentPixel = texture2D(u_image, v_texcoord); +float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_gamma[0], u_gammaCorrection[0]); +#ifdef MULTI_BAND +float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_gamma[1], u_gammaCorrection[1]); +float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_gamma[2], u_gammaCorrection[2]); +gl_FragColor = vec4(redVal, greenVal, blueVal, currentPixel.a); +#else +gl_FragColor = vec4(redVal, redVal, redVal, currentPixel.a); +#endif +}`},vs:{"vs.vert":`precision mediump float; +attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +varying highp vec2 v_texcoord; +void main() +{ +v_texcoord = a_pos; +gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); +}`}},scalar:{"scalar.frag":`precision mediump float; +uniform lowp float u_opacity; +varying vec2 v_pos; +const vec4 outlineColor = vec4(0.2, 0.2, 0.2, 1.0); +const float outlineSize = 0.02; +const float innerRadius = 0.25; +const float outerRadius = 0.42; +const float innerSquareLength = 0.15; +void main() { +mediump float dist = length(v_pos); +mediump float fillalpha1 = smoothstep(outerRadius, outerRadius + outlineSize, dist); +fillalpha1 *= (1.0-smoothstep(outerRadius + outlineSize, outerRadius + 0.1 + outlineSize, dist)); +#ifdef INNER_CIRCLE +mediump float fillalpha2 = smoothstep(innerRadius, innerRadius + outlineSize, dist); +fillalpha2 *= (1.0-smoothstep(innerRadius + outlineSize, innerRadius + 0.1 + outlineSize, dist)); +#else +mediump float fillalpha2 = (abs(v_pos.x) < innerSquareLength ? 1.0 : 0.0) * (abs(v_pos.y) < innerSquareLength ? 1.0 : 0.0); +#endif +gl_FragColor = (fillalpha2 + fillalpha1) * outlineColor * u_opacity; +}`,"scalar.vert":`precision mediump float; +attribute vec2 a_pos; +attribute vec2 a_offset; +attribute vec2 a_vv; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +uniform vec2 u_symbolSize; +uniform vec2 u_symbolPercentRange; +uniform vec2 u_dataRange; +varying vec2 v_pos; +void main() +{ +#ifdef DATA_RANGE +float valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0); +float sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x); +float sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y); +#else +float sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0; +#endif +vec2 size = u_symbolSize * sizePercentage; +vec2 pos = a_pos + a_offset * size; +v_pos = a_offset; +gl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0); +}`},stretch:{"stretch.frag":`precision mediump float; +varying highp vec2 v_texcoord; +#include +uniform float u_minCutOff[3]; +uniform float u_maxCutOff[3]; +uniform float u_minOutput; +uniform float u_maxOutput; +uniform float u_factor[3]; +uniform bool u_useGamma; +uniform float u_gamma[3]; +uniform float u_gammaCorrection[3]; +#include +float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) { +if (val >= maxCutOff) { +return maxOutput; +} else if (val <= minCutOff) { +return minOutput; +} +float stretchedVal; +if (useGamma) { +float tempf = 1.0; +float outRange = maxOutput - minOutput; +float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); +if (gamma > 1.0) { +tempf -= pow(1.0 / outRange, relativeVal * gammaCorrection); +} +stretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0; +} else { +stretchedVal = minOutput + (val - minCutOff) * factor; +} +#ifdef ROUND_OUTPUT +stretchedVal = floor(stretchedVal + 0.5); +#endif +return stretchedVal; +} +void main() { +vec2 pixelLocation = getPixelLocation(v_texcoord); +if (isOutside(pixelLocation)) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +#ifdef NOOP +gl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity; +return; +#endif +if (u_bandCount == 1) { +float grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); +#ifdef APPLY_COLORMAP +vec4 result = colorize(vec4(grayVal, grayVal, grayVal, 1.0), u_useGamma ? 255.0 : 1.0); +gl_FragColor = vec4(result.xyz, 1.0) * result.a * currentPixel.a * u_opacity; +#else +gl_FragColor = vec4(grayVal, grayVal, grayVal, 1.0) * currentPixel.a * u_opacity; +#endif +} else { +float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); +float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]); +float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]); +gl_FragColor = vec4(redVal, greenVal, blueVal, 1.0) * currentPixel.a * u_opacity; +} +}`}},stencil:{"stencil.frag":`void main() { +gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); +}`,"stencil.vert":`attribute vec2 a_pos; +uniform mat3 u_worldExtent; +void main() { +gl_Position = vec4(u_worldExtent * vec3(a_pos, 1.0), 1.0); +}`},test:{"TestShader.common.glsl":`#ifndef RETURN_RED +varying vec4 v_color; +#endif +varying vec2 v_offset;`,"TestShader.frag":`precision highp float; +#include +void main() { +if (v_offset.x > -.5 && v_offset.y > -.5 && v_offset.x < .5 && v_offset.y < .5) { +discard; +} +#ifdef RETURN_RED +gl_FragColor = vec4(1., 0., 0., 1.); +#else +gl_FragColor = v_color; +#endif +}`,"TestShader.vert":`const float POS_PRECISION_FACTOR = 10.; +const float OFFSET_PRECISION_FACTOR = 10.; +const float SIZE_PRECISION_FACTOR = 10.; +attribute vec2 a_pos_packed; +attribute vec2 a_offset_packed; +attribute float a_size_packed; +#ifdef DATA_DRIVEN_COLOR +const float u_dataDrivenColor_validValues[4] = float[4](0., 0., 1., 0.); +uniform vec4 u_dataDrivenColor_colorFallback; +uniform vec4 u_dataDrivenColor_color; +#endif +uniform float u_view_zoomLevel; +#include +#ifdef DATA_DRIVEN_COLOR +vec4 getColor(float value) { +int index = -1; +for (int i = 0; i < 4; i++) { +if (u_dataDrivenColor_validValues[i] == value) { +index = i; +break; +} +} +if (index == -1) { +return u_dataDrivenColor_colorFallback; +} +return u_dataDrivenColor_color; +} +#endif +void main() { +vec2 a_pos = a_pos_packed / POS_PRECISION_FACTOR; +vec2 a_offset = a_offset_packed / OFFSET_PRECISION_FACTOR; +float a_size = a_size_packed / SIZE_PRECISION_FACTOR; +vec4 color = vec4(1., 0., 0., 1.); +#ifdef DATA_DRIVEN_COLOR +color = getColor(1.); +#endif +vec2 offsetScaled = a_offset * a_size; +vec4 pos = vec4(a_pos.xy + offsetScaled, 0., 1.); +gl_Position = pos; +#ifndef RETURN_RED +v_color = color; +#endif +v_offset = a_offset; +}`},tileInfo:{"tileInfo.frag":`uniform mediump sampler2D u_texture; +varying mediump vec2 v_tex; +void main(void) { +lowp vec4 color = texture2D(u_texture, v_tex); +color.rgb *= color.a; +gl_FragColor = color; +}`,"tileInfo.vert":`attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform mediump float u_depth; +uniform mediump vec2 u_coord_ratio; +uniform mediump vec2 u_delta; +uniform mediump vec2 u_dimensions; +varying mediump vec2 v_tex; +void main() { +mediump vec2 offset = u_coord_ratio * vec2(u_delta + a_pos * u_dimensions); +vec3 v_pos = u_dvsMat3 * vec3(offset, 1.0); +gl_Position = vec4(v_pos.xy, 0.0, 1.0); +v_tex = a_pos; +}`},util:{"atan2.glsl":`float atan2(in float y, in float x) { +float t0, t1, t2, t3, t4; +t3 = abs(x); +t1 = abs(y); +t0 = max(t3, t1); +t1 = min(t3, t1); +t3 = 1.0 / t0; +t3 = t1 * t3; +t4 = t3 * t3; +t0 = - 0.013480470; +t0 = t0 * t4 + 0.057477314; +t0 = t0 * t4 - 0.121239071; +t0 = t0 * t4 + 0.195635925; +t0 = t0 * t4 - 0.332994597; +t0 = t0 * t4 + 0.999995630; +t3 = t0 * t3; +t3 = (abs(y) > abs(x)) ? 1.570796327 - t3 : t3; +t3 = x < 0.0 ? 3.141592654 - t3 : t3; +t3 = y < 0.0 ? -t3 : t3; +return t3; +}`,"encoding.glsl":`const vec4 rgba2float_factors = vec4( +255.0 / (256.0), +255.0 / (256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0 * 256.0) +); +float rgba2float(vec4 rgba) { +return dot(rgba, rgba2float_factors); +}`}};function Qt(i){return function(e){let t=i;return e.split("/").forEach(o=>{t&&(t=t[o])}),t}}const Jt=new St(Qt(Xt));function fe(i){return Jt.resolveIncludes(i)}const ae={shaders:{vertexShader:fe("background/background.vert"),fragmentShader:fe("background/background.frag")},attributes:new Map([["a_pos",0]])},ei=()=>ht("clip",{geometry:[{location:0,name:"a_pos",count:2,type:P.SHORT}]});let ti=class extends Z{constructor(){super(...arguments),this._color=H(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:i}){i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setFaceCullingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(Q.KEEP,Q.KEEP,Q.REPLACE),i.setStencilWriteMask(255),i.setStencilFunction(U.ALWAYS,0,255)}draw(i,e){const{context:t,state:o,requestRender:a,allowDelayedRender:r}=i,l=ei(),n=e.getVAO(t,o,l.attributes,l.bufferLayouts);n.indexBuffer!=null&&(this._program||(this._program=ce(t,ae)),!r||a==null||this._program.compiled?(t.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",o.displayMat3),t.bindVAO(n),t.drawElements(A.TRIANGLES,n.indexBuffer.size,P.UNSIGNED_INT,0),t.bindVAO()):a())}};const xe=new Map([["geometry",[new ie("a_pos",2,P.BYTE,0,2)]]]),io=new Map([["geometry",[new ie("a_pos",2,P.BYTE,0,4),new ie("a_tex",2,P.BYTE,2,4)]]]),oo=new Map([["geometry",[new ie("a_pos",2,P.UNSIGNED_SHORT,0,4)]]]);let ii=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:i}){i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(Q.KEEP,Q.KEEP,Q.REPLACE),i.setStencilWriteMask(255)}draw(i,e){const{context:t,requestRender:o,allowDelayedRender:a}=i;this._initialized||this._initialize(t),!a||o==null||this._solidProgram.compiled?(t.setStencilFunctionSeparate(xt.FRONT_AND_BACK,U.GREATER,e.stencilRef,255),t.bindVAO(this._solidVertexArrayObject),t.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._solidProgram.setUniform2fv("u_coord_range",[e.rangeX,e.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),t.drawArrays(A.TRIANGLE_STRIP,0,4),t.bindVAO()):o()}_initialize(i){if(this._initialized)return!0;const e=ce(i,ae);if(!e)return!1;const t=new Int8Array([0,0,1,0,0,1,1,1]),o=k.createVertex(i,W.STATIC_DRAW,t),a=new K(i,ae.attributes,xe,new Map([["geometry",o]]));return this._solidProgram=e,this._solidVertexArrayObject=a,this._initialized=!0,!0}},oi=class extends $e{constructor(i,e,t,o,a,r,l=a,n=r){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new Rt(i),this.resolution=e,this.x=t,this.y=o,this.width=a,this.height=r,this.rangeX=l,this.rangeY=n}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let i=this;for(;i.parent!==this._stage;){if(!i.parent)return 0;i=i.parent}return this._stage.children.indexOf(i)}setTransform(i){const e=this.resolution/(i.resolution*i.pixelRatio),t=this.transforms.tileMat3,[o,a]=i.toScreenNoRotation([0,0],[this.x,this.y]),r=this.width/this.rangeX*e,l=this.height/this.rangeY*e;qe(t,r,0,0,0,l,0,o,a,1),ge(this.transforms.displayViewScreenMat3,i.displayViewMat3,t)}get destroyed(){return this._destroyed}};const ze=oe(),_e=Ct();let ai=class extends oi{constructor(i,e,t,o){super(i,e,t,o,ue,ue)}destroy(){super.destroy()}setTransform(i){const e=this.resolution/i.resolution,t=this.transforms.tileMat3,[o,a]=i.toScreenNoRotation([0,0],[this.x,this.y]),r=this.width/this.rangeX*e,l=this.height/this.rangeY*e;qe(t,r,0,0,0,l,0,o,a,1),ge(this.transforms.displayViewScreenMat3,i.displayViewMat3,t);const n=Tt(pe(),r,0,0,l,o,a);bt(this.transforms.labelMat2d,i.viewMat2d,n)}_createTransforms(){return{labelMat2d:pe(),tileMat3:oe(),displayViewScreenMat3:oe()}}containsScreenPoint(i,e,t){const o=ge(ze,i.viewMat3,this.transforms.tileMat3),a=It(ze,o);if(a==null)return!0;At(_e,...e,1);const r=Pt(_e,_e,a),l=t*(this.resolution/i.resolution);return r[0]>=-l&&r[0]=-l&&r[1]{const t=e.end-e.start;i=Math.max(i,t)}),i}firstFit(i){if(this._head==null)return null;let e=null,t=this._head;for(;t;){const o=t.data.end-t.data.start;if(o===i)return e?e.next=t.next:this._head=t.next,t.data.start;if(o>i){const a=t.data.start;return t.data.start+=i,a}e=t,t=t.next}return null}free(i,e){const t=i+e;if(this._head==null){const l=new Y({start:i,end:t});return void(this._head=l)}if(t<=this._head.data.start){if(t===this._head.data.start)return void(this._head.data.start-=e);const l=new Y({start:i,end:t});return l.next=this._head,void(this._head=l)}let o=this._head,a=o.next;for(;a;){if(a.data.start>=t){if(o.data.end===i){if(o.data.end+=e,o.data.end===a.data.start){const n=a.data.end-a.data.start;return o.data.end+=n,void(o.next=a.next)}return}if(a.data.start===t)return void(a.data.start-=e);const l=new Y({start:i,end:t});return l.next=o.next,void(o.next=l)}o=a,a=a.next}if(i===o.data.end)return void(o.data.end+=e);const r=new Y({start:i,end:t});o.next=r}clear(){this._head=null}};function ri(i,e){return i<<16|255&e}function li(i){return 255&i}let te=class{constructor(i,e,t,o,a){this.instance=i,this.materialKey=e,this.target=t,this.start=o,this.count=a}get textureKey(){return li(this.materialKey)}get indexEnd(){return this.start+this.count}extend(i){this.count+=i}render(i){this.instance.techniqueRef.render(i,this)}getStencilReference(){return this.target.stencilRef}getAttributePrecisionPackFactors(){const i=this.instance.instanceId;return this.target.getMesh(i).getAttributePrecisionPackFactors()}draw(i,e){Et(i)?this.drawCompute(i.context,e):this.drawGeometry(i.context,e)}drawCompute(i,e){const t=this.instance.instanceId,o=this.target.getMesh(t).getComputeVAO(i,e),a=this.start*Uint32Array.BYTES_PER_ELEMENT/3;i.bindVAO(o),i.drawElements(A.POINTS,this.count/3,P.UNSIGNED_INT,a),i.bindVAO(null)}drawGeometry(i,e){const t=this.instance.instanceId,o=this.target.getMesh(t).getGeometryVAO(i,e),a=this.start*Uint32Array.BYTES_PER_ELEMENT;i.bindVAO(o),i.drawElements(A.TRIANGLES,this.count,P.UNSIGNED_INT,a),i.bindVAO(null)}},ni=class rt{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(e,t,o,a){const r=new rt;for(const l of e.values())for(const n of l.records){const s=o.getInstance(n.instanceId),c=ri(s.instanceId,n.textureKey);r.addRecord(s,c,n.indexStart,n.indexCount,n.vertexStart,n.vertexCount,t,a)}return r}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}render(e,t){const{drawPhase:o}=e;for(const a of this.infos()){const r=a.instance.techniqueRef;r.drawPhase&o&&(t==null||r.type===t)&&a.render(e)}}addRecord(e,t,o,a,r,l,n,s){let c=o,u=a;if(u||(c=r,u=l),!u)return;if(this._head==null){const g=new te(e,t,n,c,u);return this._head=new Y(g),this._tail=this._head,this._length++,void this._minOrderedLength++}if(s===he.STRICT_ORDER)return this._insert(e,t,n,c,u,this._tail,null);let f=null,d=this._head;const _=e.instanceId,x=e.techniqueRef.symbologyPlane;if(s===he.STRICT_MARKERS_AND_TEXT&&(x===Ce.MARKER||x===Ce.TEXT))return this._insert(e,t,n,c,u,this._tail,null);for(;d;){const g=d.data.instance,b=g.instanceId,O=g.techniqueRef.symbologyPlane,S=f?.data.instance.instanceId;if(x=1){const o=this.index.operations[this.index.operations.length-1];o.srcFrom+o.count===i.indexStart&&(o.count+=i.indexCount,t=!0)}t||this.index.operations.push({srcFrom:i.indexStart,dstFrom:this.index.count,count:i.indexCount,mutate:e}),i.indexStart=this.index.count,this.index.count+=i.indexCount}};const Ve=j("esri-2d-log-allocations");let Ne=class lt{static create(e,t){const o=t.acquireUint32Array(e);return new lt(o,t)}constructor(e,t){this._array=e,this._pool=t}get array(){return this._array}get length(){return this._array.length}getUint32View(e,t){return new Uint32Array(this._array.buffer,e+this._array.byteOffset,t)}expand(e){if(e<=this._array.byteLength)return;const t=this._pool.acquireUint32Array(e);t.set(this._array),this._pool.releaseUint32Array(this._array),this._array=t}destroy(){this._pool.releaseUint32Array(this._array)}},me=class nt{constructor(){this._data=new ArrayBuffer(nt.BYTE_LENGTH),this._freeList=new at({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 16e6}get buffer(){return this._data}acquireUint32Array(e){const t=this._freeList.firstFit(e);return t==null?null:new Uint32Array(this._data,t,e/Uint32Array.BYTES_PER_ELEMENT)}releaseUint32Array(e){this._freeList.free(e.byteOffset,e.byteLength)}};class ao{constructor(){this._pages=[],this._pagesByBuffer=new Map,this._bytesAllocated=0}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*me.BYTE_LENGTH}acquireUint32Array(e){if(this._bytesAllocated+=e,Ve&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>=me.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const o of this._pages){const a=o.acquireUint32Array(e);if(a!=null)return a}const t=this._addPage().acquireUint32Array(e);return ve(t,"Expected to allocate page"),t}releaseUint32Array(e){this._bytesAllocated-=e.byteLength,Ve&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const t=this._pagesByBuffer.get(e.buffer);t&&t.releaseUint32Array(e)}_addPage(){const e=new me;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}}const ui=1.25,we=32767,ci=we<<16|we;let Fe=class{constructor(i,e,t,o){this._pool=o;const a=Ne.create(e*t*Uint32Array.BYTES_PER_ELEMENT,this._pool);this.size=e,this.strideInt=t,this.bufferType=i,this.dirty={start:1/0,end:0},this.memoryStats={bytesUsed:0,bytesReserved:e*t*Uint32Array.BYTES_PER_ELEMENT},this._gpu=null,this._cpu=a,this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get intSize(){return this.fillPointer*this.strideInt}get byteSize(){return this.intSize*Uint32Array.BYTES_PER_ELEMENT}get invalidated(){return this.bufferSize>0&&!this._gpu}get invalidatedComputeBuffer(){return this.bufferSize>0&&!this._gpuComputeTriangles}invalidate(){this._invalidateTriangleBuffer(),this._gpu?.dispose(),this._gpu=null}_invalidateTriangleBuffer(){this._gpuComputeTriangles?.dispose(),this._gpuComputeTriangles=null}destroy(){this._gpu?.dispose(),this._gpuComputeTriangles?.dispose(),this._cpu?.destroy()}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new at({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(i){if(!(this.maxAvailableSpace()>=i)&&i*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const e=this._cpu.length/this.strideInt,t=Math.round((e+i)*ui),o=t*this.strideInt;this._cpu.expand(o*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(e,t-e),this.memoryStats.bytesReserved+=(t-e)*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}}set(i,e){this._cpu.array[i]!==e&&(this._cpu.array[i]=e,this.dirty.start=Math.min(i,this.dirty.start),this.dirty.end=Math.max(i+1,this.dirty.end))}getGPUBuffer(i,e=!1){if(!this.bufferSize)return null;if(e){if(this.bufferType!=="index")throw new Error("Tired to get triangle buffer, but target is not an index buffer");return this._gpuComputeTriangles==null&&(this._gpuComputeTriangles=this._createComputeBuffer(i)),this._gpuComputeTriangles}return this._gpu==null&&(this._gpu=this._createBuffer(i)),this._gpu}getView(i,e){return this._cpu.getUint32View(i,e/Uint32Array.BYTES_PER_ELEMENT)}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(i,e,t,o){const a=t*this.strideInt;if(!a)return 0;const r=e*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,l=new Uint32Array(i,r,a),n=this.freeList.firstFit(t);ve(n,"First fit region must be defined");const s=n*this.strideInt,c=a;if(this._cpu.array.set(l,s),o!==0)for(let u=0;uo,r=this._cpu,l=Ne.create(o,this._pool);a||l.array.set(this._cpu.getUint32View(0,this.intSize));for(const n of e)if(a||n.srcFrom!==n.dstFrom||n.mutate!==0){this.dirty.start=Math.min(this.dirty.start,n.dstFrom*this.strideInt),this.dirty.end=Math.max(this.dirty.end,(n.dstFrom+n.count)*this.strideInt);for(let s=0;se.locations.has(o.name)).map(o=>({name:o.name,type:o.type,count:o.count,divisor:0,normalized:o.normalized??!1,offset:o.offset,stride:i.stride}));return new Map([["geometry",t]])}function di(i,e){const t=[],o=i.attributes.filter(a=>e.locations.has(a.name));for(const a of o){t.push({name:a.name,type:a.type,count:a.count,divisor:0,normalized:a.normalized??!1,offset:a.offset,stride:i.stride});const r=e.computeAttributeMap[a.name];r!=null&&r.length===2&&(t.push({name:r[0],count:a.count,divisor:0,type:a.type,normalized:a.normalized??!1,offset:a.offset+i.stride,stride:i.stride}),t.push({name:r[1],count:a.count,divisor:0,type:a.type,normalized:a.normalized??!1,offset:a.offset+2*i.stride,stride:i.stride}))}return new Map([["geometry",t]])}let _i=class{constructor(i,e){if(this._bufferPool=i,this._layout=e,this._invalidatedGeometry=!1,this._invalidatedCompute=!1,this._position=this._layout.attributes.find(t=>t.name==="pos"||t.name==="position"),!this._position)throw new Error("InternalError: Unable to find position attribute")}destroy(){this._indexBuffer=Ee(this._indexBuffer),this._vertexBuffer=Ee(this._vertexBuffer),this._computeVAO?.disposeVAOOnly(),this._geometryVAO?.disposeVAOOnly()}get layout(){return this._layout}getDrawArgs(i,e,t,o){return o?{primitive:A.POINTS,count:e/3,offset:t/3}:{primitive:i,count:e,offset:t}}getAttributePrecisionPackFactors(){const i={};for(const e of this.layout.attributes)e.packPrecisionFactor&&(i[e.name]=e.packPrecisionFactor);return i}getDebugVertexInfo(i=!1,e){if(!this._vertexBuffer)return null;const t=this._layout,o=t.stride,a=this._vertexBuffer.getView(0,this._vertexBuffer.byteSize),r=[];if(i)if(e==null)console.log("must provide location info to see compute attributes");else for(const f of t.attributes){const d=e.computeAttributeMap[f.name];d!=null&&d.length===2&&(r.push({...f,name:d[0],offset:f.offset+o}),r.push({...f,name:d[1],offset:f.offset+2*o}))}const l=new DataView(a.slice().buffer);let n=a.byteLength/o;i&&(n=this._indexBuffer.fillPointer/3);const s=this._indexBuffer.getView(0,this._indexBuffer.byteSize);let c=0;const u=[];for(let f=0;fSe.getLogger("esri.views.2d.engine.webgl.FeatureTile");let pi=0,gi=class extends ai{constructor(i,e,t,o,a=!1){super(i,e,t,o),this._meshes=new Map,this._entities=[],this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=pi++,this._metrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this._objectIdMap=null,this.visible=!0,this.transforms.labelMat2d=pe(),this.enableDeferredUploads=a}destroy(){super.destroy(),this.clear()}clear(){for(const i of this._meshes.values())i.destroy();this._meshes.clear(),this._entities=[],this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(i){super.beforeRender(i),this._needsReshuffle&&i.reshuffleManager.schedule(this)}tryReady(i){const e=this._invalidated&&!this._uploadAllowed;return!(this.isReady||e||!this._encounteredEnd||!(i>=this._attributeEpoch))&&(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${i}]`),this.ready(),this.requestRender(),!0)}get labelMetrics(){return this._metrics}get hasData(){return!!this._meshes.size}get hasAnimations(){return!!this._objectIdMap}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}upload(){this._nextUploadAllowed=!0}getDisplayList(i,e){if(this._uploadAllowed&&this._invalidated){this._entities.sort((t,o)=>{const a=o.sortKey,r=t.sortKey;return r===a?t.id-o.id:r-a}),e===he.BATCHING&&this.reshuffle(!0),this._displayList=ni.fromDisplayEntities(this._entities,this,i,e);for(const t of this._meshes.values())t.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(i){if(!this._meshes.has(i))throw new Error(`InternalError: Unable to find VAO for instance: ${i}`);return this._meshes.get(i)}getSortKeys(i){const e=new Map;for(const{id:t,sortKey:o}of this._entities)if(i.has(t)&&e.set(t,o),e.size===i.size)break;return e}onMessage(i){if(i.objectIdMap)for(const e in i.objectIdMap)this._objectIdMap||(this._objectIdMap={}),this._objectIdMap[e]=i.objectIdMap[e];switch(i.type){case"append":this._onAppendMessage(i);break;case"update":this._onUpdateMessage(i)}if(this._aggregateMemoryStats(),this.requestRender(),i.end){if(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${i.attributeEpoch}]`),!i.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=i.attributeEpoch,this._encounteredEnd=!0}}_onAppendMessage(i){if(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:Ue(i?.append)}),i.clear&&this.clear(),!i.append)return;const e=le(new se(i.append.entities),ne);this._insert(e,i.append.data,!1)}_onUpdateMessage(i){j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:i.isPixelBuffer,modify:Ue(i.modify),remove:i.remove});const e=le(new se(i.modify.entities),ne),t=e.map(r=>r.id),o=i.isPixelBuffer??!1,a=[...i.remove,...t];o?this._removeByIdsFromBuffer(a):this._removeByIds(a),this._insert(e,i.modify.data,o)}reshuffle(i=!1){if(this.destroyed)return;const e=new Map;for(const t of this._entities)for(const o of t.records){const a=this._meshes.get(o.instanceId);let r=e.get(a);r||(r=new si(i),e.set(a,r)),r.copyRecord(o)}for(const[t,o]of e)t.reshuffle(o);this._invalidated=!0,this._aggregateMemoryStats(),j("esri-2d-update-debug")&&vi().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(i,e,t,o){const a=t*ue,r=o*ue;for(const l of i._entities){let n=null;for(const s of l.records)if(s.overlaps&e){const c=i.getMesh(s.instanceId),u=this._ensureMesh(s.instanceId,c.layout).copyRecordFrom(c,s,a,r);n||(n=new ne(l.id,l.sortKey),this._entityIdsFromBuffer.add(l.id),this._entities.push(n)),n.records.push(u)}}this._invalidated=!0}_ensureMesh(i,e){return this._meshes.has(i)||this._meshes.set(i,new _i(this._stage.bufferPool,e)),this._meshes.get(i)}_insert(i,e,t){if(!i.length)return;this._removeDuplicatedBufferedEntites(i);const o=this._insertVertexData(e);for(const a of i){for(const r of a.records)r.updateBaseOffsets(o.get(r.instanceId));t?this._tryInsertBufferedEntity(a):this._insertEntity(a)}this._invalidated=!0}_insertVertexData(i){const e=new Map;for(const t of i){const{instanceId:o,layout:a}=t,r=this._ensureMesh(o,a).append(t);if(t.metrics){const l=le(new se(t.metrics),pt)??[];this._metrics.push(...l)}e.set(o,r)}return e}_insertEntity(i){j("esri-2d-update-debug")&&this._entityIds.has(i.id)&&console.error(`Tile ${this.key.id} insertEnitty: Already have entityId ${i.id}`),this._entityIds.add(i.id),this._entities.push(i)}_tryInsertBufferedEntity(i){this._entityIds.has(i.id)?this._removeRecordsFromMesh(i.records):(this._entityIdsFromBuffer.add(i.id),this._entities.push(i))}_removeDuplicatedBufferedEntites(i){if(!this._entityIdsFromBuffer.size)return;const e=[];for(const t of i)this._entityIdsFromBuffer.has(t.id)&&e.push(t.id);this._removeByIds(e)}_removeByIdsFromBuffer(i){this._removeByIds(i.filter(e=>this._entityIdsFromBuffer.has(e)))}_removeByIds(i){if(i.length===0)return;const e=new Set(i),t=[];for(const o of this._entities)e.has(o.id)?this._remove(o):t.push(o);this._entities=t,this._invalidated=!0}_remove(i){this._removeRecordsFromMesh(i.records),this._entityIds.delete(i.id),this._entityIdsFromBuffer.delete(i.id);for(let e=this._metrics.length-1;e>=0;e--)this._metrics[e].entityTexel===i.id&&this._metrics.splice(e,1)}_removeRecordsFromMesh(i){for(const e of i){const{instanceId:t,indexStart:o,indexCount:a,vertexStart:r,vertexCount:l}=e;this._meshes.get(t)?.remove(o,a,r,l)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const i of this._meshes.values())this.debugInfo.memory.bytesUsed+=i.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=i.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:i,bytesReserved:e}=this.debugInfo.memory,t=i/e,{minOrderedLength:o,length:a}=this.debugInfo.display;return e>dt&&t<_t||a>mt&&o/a({objectId:this._objectIdMap[i],displayId:i})):[]}};const Ge={shaders:{vertexShader:fe("tileInfo/tileInfo.vert"),fragmentShader:fe("tileInfo/tileInfo.frag")},attributes:new Map([["a_pos",0]])},Ye=512,ye=512,$=16,M=8,hi=(ye-2*M)/5;let xi=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._ctx=null}prepareState({context:i}){i.setBlendingEnabled(!0),i.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!1)}draw(i,e){const{context:t,requestRender:o,allowDelayedRender:a}=i;if(!e.isReady&&e instanceof gi&&e.hasData)return;if(this._loadWGLResources(t),a&&o!=null&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void o();t.bindVAO(this._outlineVertexArrayObject),t.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._outlineProgram.setUniform2f("u_coord_range",e.rangeX,e.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),t.drawArrays(A.LINE_STRIP,0,4);const r=this._getTexture(t,e);r&&(t.bindVAO(this._tileInfoVertexArrayObject),t.useProgram(this._tileInfoProgram),t.bindTexture(r,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",e.rangeX/e.width,e.rangeY/e.height),this._tileInfoProgram.setUniform2f("u_delta",0,0),this._tileInfoProgram.setUniform2f("u_dimensions",r.descriptor.width,r.descriptor.height),t.drawArrays(A.TRIANGLE_STRIP,0,4)),t.bindVAO()}_loadWGLResources(i){if(this._outlineProgram&&this._tileInfoProgram)return;const e=ce(i,ae),t=ce(i,Ge),o=new Int8Array([0,0,1,0,1,1,0,1]),a=k.createVertex(i,W.STATIC_DRAW,o),r=new K(i,ae.attributes,xe,new Map([["geometry",a]])),l=new Int8Array([0,0,1,0,0,1,1,1]),n=k.createVertex(i,W.STATIC_DRAW,l),s=new K(i,Ge.attributes,xe,new Map([["geometry",n]]));this._outlineProgram=e,this._tileInfoProgram=t,this._outlineVertexArrayObject=r,this._tileInfoVertexArrayObject=s}_getTexture(i,e){if(!this._ctx){const n=document.createElement("canvas");n.width=Ye,n.height=ye,this._ctx=n.getContext("2d")}if(!e.tileDebugInfoTexture){const n=new Lt;n.wrapMode=yt.CLAMP_TO_EDGE,n.samplingMode=B.LINEAR,n.isImmutable=!0,n.width=Ye,n.height=ye,e.tileDebugInfoTexture=new Mt(i,n)}const t=this._ctx;t.clearRect(0,0,t.canvas.width,t.canvas.height),t.textAlign="left",t.textBaseline="top",t.font=$-2+"px sans-serif",t.lineWidth=2,t.fillStyle="white",t.strokeStyle="black";const{debugSlot:o}=e;let a=M+hi*o;const r=`${o}) ${e.key.id} (${e.constructor.name})`;t.strokeText(r,M,a),t.fillText(r,M,a),a+=$;const{debugInfo:l}=e;if(l){const{length:n,minOrderedLength:s,minUnorderedLength:c,triangleCount:u}=l.display;if(n>0){const _=`Length: ${n}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(s){const _=`Min ordered length: ${s}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(c){const _=`Min unordered length: ${c}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(u>0){u>1e5&&(t.fillStyle="red",t.strokeStyle="white");const _=`Triangle count: ${u}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}const{bytesUsed:f,bytesReserved:d}=l.memory;if(t.fillStyle="white",t.strokeStyle="black",f>0||d>0){const _=`Memory usage: ${f} of ${d} bytes`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}}return e.tileDebugInfoTexture.setData(t.canvas),e.tileDebugInfoTexture}},yi=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1),this._patternMatrix=oe(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(i,e){const{context:t,painter:o,requestRender:a,allowDelayedRender:r}=i;this._loadWGLResources(i);const l=i.displayLevel,n=i.styleLayer,s=n.backgroundMaterial,c=o.vectorTilesMaterialManager,u=n.getPaintValue("background-color",l),f=n.getPaintValue("background-opacity",l),d=n.getPaintValue("background-pattern",l),_=d!==void 0,x=1|window.devicePixelRatio,g=i.spriteMosaic;let b,O;const S=x>Ze?2:1,T=this._programOptions;T.pattern=_;const v=c.getMaterialProgram(t,s,T);if(!r||a==null||v.compiled){if(t.bindVAO(this._vao),t.useProgram(v),_){const p=g.getMosaicItemPosition(d,!0);if(p!=null){const{tl:h,br:y,page:I}=p;b=y[0]-h[0],O=y[1]-h[1];const m=g.getPageSize(I);m!=null&&(g.bind(t,B.LINEAR,I,F),v.setUniform4f("u_tlbr",h[0],h[1],y[0],y[1]),v.setUniform2fv("u_mosaicSize",m),v.setUniform1i("u_texture",F))}v.setUniform1f("u_opacity",f)}else{const p=u[3]*f;this._color[0]=p*u[0],this._color[1]=p*u[1],this._color[2]=p*u[2],this._color[3]=p,v.setUniform4fv("u_color",this._color)}v.setUniform1f("u_depth",n.z||0);for(const p of e){if(v.setUniform1f("u_coord_range",p.rangeX),v.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),_){const h=Math.max(2**(Math.round(l)-p.key.level),1),y=S*p.width*h,I=y/Oe(b),m=y/Oe(O);this._patternMatrix[0]=I,this._patternMatrix[4]=m,v.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}t.setStencilFunction(U.EQUAL,0,255),t.drawArrays(A.TRIANGLE_STRIP,0,4)}}else a()}_loadWGLResources(i){if(this._vao)return;const{context:e,styleLayer:t}=i,o=t.backgroundMaterial,a=new Int8Array([0,0,1,0,0,1,1,1]),r=k.createVertex(e,W.STATIC_DRAW,a),l=new K(e,o.getAttributeLocations(),o.getLayoutInfo(),new Map([["geometry",r]]));this._vao=l}},Si=class extends Z{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(i,e){const{context:t,displayLevel:o,requiredLevel:a,state:r,painter:l,spriteMosaic:n,styleLayerUID:s,requestRender:c,allowDelayedRender:u}=i;if(!e.some(v=>v.layerData.get(s)?.circleIndexCount??!1))return;const f=i.styleLayer,d=f.circleMaterial,_=l.vectorTilesMaterialManager,x=1.2,g=f.getPaintValue("circle-translate",o),b=f.getPaintValue("circle-translate-anchor",o),O=this._programOptions,S=_.getMaterialProgram(t,d,O);if(u&&c!=null&&!S.compiled)return void c();t.useProgram(S),S.setUniformMatrix3fv("u_displayMat3",b===J.VIEWPORT?r.displayMat3:r.displayViewMat3),S.setUniform2fv("u_circleTranslation",g),S.setUniform1f("u_depth",f.z),S.setUniform1f("u_antialiasingWidth",x);let T=-1;for(const v of e){if(!v.layerData.has(s))continue;v.key.level!==T&&(T=v.key.level,d.setDataUniforms(S,o,f,T,n));const p=v.layerData.get(s);if(!p.circleIndexCount)continue;p.prepareForRendering(t);const h=p.vao;h!=null&&(t.bindVAO(h),S.setUniformMatrix3fv("u_dvsMat3",v.transforms.displayViewScreenMat3),a!==v.key.level?t.setStencilFunction(U.EQUAL,v.stencilRef,255):t.setStencilFunction(U.GREATER,255,255),t.drawElements(A.TRIANGLES,p.circleIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*p.circleIndexStart),v.triangleCount+=p.circleIndexCount/3)}}};const ke=1/65536;class Ti extends Z{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,t){const{displayLevel:o,renderPass:a,spriteMosaic:r,styleLayerUID:l}=e;let n=!1;for(const T of t)if(T.layerData.has(l)){const v=T.layerData.get(l);if(v.fillIndexCount>0||v.outlineIndexCount>0){n=!0;break}}if(!n)return;const s=e.styleLayer,c=s.getPaintProperty("fill-pattern"),u=c!==void 0,f=u&&c.isDataDriven;let d;if(u&&!f){const T=c.getValue(o);d=r.getMosaicItemPosition(T,!0)}const _=!u&&s.getPaintValue("fill-antialias",o);let x=!0,g=1;if(!u){const T=s.getPaintProperty("fill-color"),v=s.getPaintProperty("fill-opacity");if(!T?.isDataDriven&&!v?.isDataDriven){const p=s.getPaintValue("fill-color",o);g=s.getPaintValue("fill-opacity",o)*p[3],g>=1&&(x=!1)}}if(x&&a==="opaque")return;const b=s.getPaintValue("fill-translate",o),O=s.getPaintValue("fill-translate-anchor",o);(x||a!=="translucent")&&this._drawFill(e,l,s,t,b,O,u,d,f);const S=!s.hasDataDrivenOutlineColor&&s.outlineUsesFillColor&&g<1;_&&a!=="opaque"&&!S&&this._drawOutline(e,l,s,t,b,O)}_drawFill(e,t,o,a,r,l,n,s,c){if(n&&!c&&s==null)return;const{context:u,displayLevel:f,state:d,painter:_,pixelRatio:x,spriteMosaic:g,requestRender:b,allowDelayedRender:O}=e,S=o.fillMaterial,T=_.vectorTilesMaterialManager,v=x>Ze?2:1,p=this._fillProgramOptions;p.pattern=n;const h=T.getMaterialProgram(u,S,p);if(O&&b!=null&&!h.compiled)return void b();if(u.useProgram(h),s!=null){const{page:I}=s,m=g.getPageSize(I);m!=null&&(g.bind(u,B.LINEAR,I,F),h.setUniform2fv("u_mosaicSize",m),h.setUniform1i("u_texture",F))}h.setUniformMatrix3fv("u_displayMat3",l===J.VIEWPORT?d.displayMat3:d.displayViewMat3),h.setUniform2fv("u_fillTranslation",r),h.setUniform1f("u_depth",o.z+ke);let y=-1;for(const I of a){if(!I.layerData.has(t))continue;I.key.level!==y&&(y=I.key.level,S.setDataUniforms(h,f,o,y,g));const m=I.layerData.get(t);if(!m.fillIndexCount)continue;m.prepareForRendering(u);const V=m.fillVAO;if(V!=null){if(u.bindVAO(V),h.setUniformMatrix3fv("u_dvsMat3",I.transforms.displayViewScreenMat3),u.setStencilFunction(U.EQUAL,I.stencilRef,255),n){const E=Math.max(2**(Math.round(f)-I.key.level),1),D=I.rangeX/(v*I.width*E);h.setUniform1f("u_patternFactor",D)}if(c){const E=m.patternMap;if(!E)continue;for(const[D,L]of E){const q=g.getPageSize(D);q!=null&&(g.bind(u,B.LINEAR,D,F),h.setUniform2fv("u_mosaicSize",q),h.setUniform1i("u_texture",F),u.drawElements(A.TRIANGLES,L[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L[0]))}}else u.drawElements(A.TRIANGLES,m.fillIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*m.fillIndexStart);I.triangleCount+=m.fillIndexCount/3}}}_drawOutline(e,t,o,a,r,l){const{context:n,displayLevel:s,state:c,painter:u,pixelRatio:f,spriteMosaic:d,requestRender:_,allowDelayedRender:x}=e,g=o.outlineMaterial,b=u.vectorTilesMaterialManager,O=.75/f,S=this._outlineProgramOptions,T=b.getMaterialProgram(n,g,S);if(x&&_!=null&&!T.compiled)return void _();n.useProgram(T),T.setUniformMatrix3fv("u_displayMat3",l===J.VIEWPORT?c.displayMat3:c.displayViewMat3),T.setUniform2fv("u_fillTranslation",r),T.setUniform1f("u_depth",o.z+ke),T.setUniform1f("u_outline_width",O);let v=-1;for(const p of a){if(!p.layerData.has(t))continue;p.key.level!==v&&(v=p.key.level,g.setDataUniforms(T,s,o,v,d));const h=p.layerData.get(t);if(h.prepareForRendering(n),!h.outlineIndexCount)continue;const y=h.outlineVAO;y!=null&&(n.bindVAO(y),T.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),n.setStencilFunction(U.EQUAL,p.stencilRef,255),n.drawElements(A.TRIANGLES,h.outlineIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*h.outlineIndexStart),p.triangleCount+=h.outlineIndexCount/3)}}}class bi extends Z{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,t){const{context:o,displayLevel:a,state:r,painter:l,pixelRatio:n,spriteMosaic:s,styleLayerUID:c,requestRender:u,allowDelayedRender:f}=e;if(!t.some(E=>E.layerData.get(c)?.lineIndexCount??!1))return;const d=e.styleLayer,_=d.lineMaterial,x=l.vectorTilesMaterialManager,g=d.getPaintValue("line-translate",a),b=d.getPaintValue("line-translate-anchor",a),O=d.getPaintProperty("line-pattern"),S=O!==void 0,T=S&&O.isDataDriven;let v,p;if(S&&!T){const E=O.getValue(a);v=s.getMosaicItemPosition(E)}let h=!1;if(!S){const E=d.getPaintProperty("line-dasharray");if(p=E!==void 0,h=p&&E.isDataDriven,p&&!h){const D=E.getValue(a),L=d.getDashKey(D,d.getLayoutValue("line-cap",a));v=s.getMosaicItemPosition(L)}}const y=1/n,I=this._programOptions;I.pattern=S,I.sdf=p;const m=x.getMaterialProgram(o,_,I);if(f&&u!=null&&!m.compiled)return void u();if(o.useProgram(m),m.setUniformMatrix3fv("u_displayViewMat3",r.displayViewMat3),m.setUniformMatrix3fv("u_displayMat3",b===J.VIEWPORT?r.displayMat3:r.displayViewMat3),m.setUniform2fv("u_lineTranslation",g),m.setUniform1f("u_depth",d.z),m.setUniform1f("u_antialiasing",y),v&&v!=null){const{page:E}=v,D=s.getPageSize(E);D!=null&&(s.bind(o,B.LINEAR,E,F),m.setUniform2fv("u_mosaicSize",D),m.setUniform1i("u_texture",F))}let V=-1;for(const E of t){if(!E.layerData.has(c))continue;E.key.level!==V&&(V=E.key.level,_.setDataUniforms(m,a,d,V,s));const D=2**(a-V)/n;m.setUniform1f("u_zoomFactor",D);const L=E.layerData.get(c);if(!L.lineIndexCount)continue;L.prepareForRendering(o);const q=L.vao;if(q!=null){if(o.bindVAO(q),m.setUniformMatrix3fv("u_dvsMat3",E.transforms.displayViewScreenMat3),o.setStencilFunction(U.EQUAL,E.stencilRef,255),T||h){const re=L.patternMap;if(!re)continue;for(const[C,X]of re){const z=s.getPageSize(C);z!=null&&(s.bind(o,B.LINEAR,C,F),m.setUniform2fv("u_mosaicSize",z),m.setUniform1i("u_texture",F),o.drawElements(A.TRIANGLES,X[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*X[0]))}}else o.drawElements(A.TRIANGLES,L.lineIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L.lineIndexStart);E.triangleCount+=L.lineIndexCount/3}}}}const Ii=256/360,Ei=1/Math.LN2;function Oi(i,e){return(i%=e)>=0?i:i+e}function He(i){return Oi(i*Ii,256)}function ro(i){return Math.log(i)*Ei}const Ai=1/65536;class Pi extends Z{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=zt()}dispose(){}drawMany(e,t){const o=e.styleLayer;this._drawIcons(e,o,t),this._drawText(e,o,t)}_drawIcons(e,t,o){const{context:a,displayLevel:r,painter:l,spriteMosaic:n,state:s,styleLayerUID:c,requestRender:u,allowDelayedRender:f}=e,d=t.iconMaterial,_=l.vectorTilesMaterialManager;let x,g=!1;for(const m of o)if(m.layerData.has(c)&&(x=m.layerData.get(c),x.iconPerPageElementsMap.size>0)){g=!0;break}if(!g)return;const b=t.getPaintValue("icon-translate",r),O=t.getPaintValue("icon-translate-anchor",r);let S=t.getLayoutValue("icon-rotation-alignment",r);S===G.AUTO&&(S=t.getLayoutValue("symbol-placement",r)===De.POINT?G.VIEWPORT:G.MAP);const T=S===G.MAP,v=t.getLayoutValue("icon-keep-upright",r)&&T,p=x.isIconSDF,h=this._iconProgramOptions;h.sdf=p;const y=_.getMaterialProgram(a,d,h);if(f&&u!=null&&!y.compiled)return void u();a.useProgram(y),y.setUniformMatrix3fv("u_displayViewMat3",S===G.MAP?s.displayViewMat3:s.displayMat3),y.setUniformMatrix3fv("u_displayMat3",O===J.VIEWPORT?s.displayMat3:s.displayViewMat3),y.setUniform2fv("u_iconTranslation",b),y.setUniform1f("u_depth",t.z),y.setUniform1f("u_mapRotation",He(s.rotation)),y.setUniform1f("u_keepUpright",v?1:0),y.setUniform1f("u_level",10*r),y.setUniform1i("u_texture",F),y.setUniform1f("u_fadeDuration",Re/1e3);let I=-1;for(const m of o){if(!m.layerData.has(c)||(m.key.level!==I&&(I=m.key.level,d.setDataUniforms(y,r,t,I,n)),x=m.layerData.get(c),x.iconPerPageElementsMap.size===0))continue;x.prepareForRendering(a),x.updateOpacityInfo();const V=x.iconVAO;if(V!=null){a.bindVAO(V),y.setUniformMatrix3fv("u_dvsMat3",m.transforms.displayViewScreenMat3),y.setUniform1f("u_time",(performance.now()-x.lastOpacityUpdate)/1e3);for(const[E,D]of x.iconPerPageElementsMap)this._renderIconRange(e,y,D,E,m)}}}_renderIconRange(e,t,o,a,r){const{context:l,spriteMosaic:n}=e;this._spritesTextureSize[0]=n.getWidth(a)/4,this._spritesTextureSize[1]=n.getHeight(a)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),n.bind(l,B.LINEAR,a,F),this._setStencilState(e,r),l.drawElements(A.TRIANGLES,o[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*o[0]),r.triangleCount+=o[1]/3}_drawText(e,t,o){const{context:a,displayLevel:r,glyphMosaic:l,painter:n,pixelRatio:s,spriteMosaic:c,state:u,styleLayerUID:f,requestRender:d,allowDelayedRender:_}=e,x=t.textMaterial,g=n.vectorTilesMaterialManager;let b,O=!1;for(const z of o)if(z.layerData.has(f)&&(b=z.layerData.get(f),b.glyphPerPageElementsMap.size>0)){O=!0;break}if(!O)return;const S=t.getPaintProperty("text-opacity");if(S&&!S.isDataDriven&&S.getValue(r)===0)return;const T=t.getPaintProperty("text-color"),v=!T||T.isDataDriven||T.getValue(r)[3]>0,p=t.getPaintProperty("text-halo-width"),h=t.getPaintProperty("text-halo-color"),y=(!p||p.isDataDriven||p.getValue(r)>0)&&(!h||h.isDataDriven||h.getValue(r)[3]>0);if(!v&&!y)return;const I=24/8;let m=t.getLayoutValue("text-rotation-alignment",r);m===G.AUTO&&(m=t.getLayoutValue("symbol-placement",r)===De.POINT?G.VIEWPORT:G.MAP);const V=m===G.MAP,E=t.getLayoutValue("text-keep-upright",r)&&V,D=.8*I/s;this._glyphTextureSize||(this._glyphTextureSize=Vt(l.width/4,l.height/4));const L=t.getPaintValue("text-translate",r),q=t.getPaintValue("text-translate-anchor",r),re=this._sdfProgramOptions,C=g.getMaterialProgram(a,x,re);if(_&&d!=null&&!C.compiled)return void d();a.useProgram(C),C.setUniformMatrix3fv("u_displayViewMat3",m===G.MAP?u.displayViewMat3:u.displayMat3),C.setUniformMatrix3fv("u_displayMat3",q===J.VIEWPORT?u.displayMat3:u.displayViewMat3),C.setUniform2fv("u_textTranslation",L),C.setUniform1f("u_depth",t.z+Ai),C.setUniform2fv("u_mosaicSize",this._glyphTextureSize),C.setUniform1f("u_mapRotation",He(u.rotation)),C.setUniform1f("u_keepUpright",E?1:0),C.setUniform1f("u_level",10*r),C.setUniform1i("u_texture",Pe),C.setUniform1f("u_antialiasingWidth",D),C.setUniform1f("u_fadeDuration",Re/1e3);let X=-1;for(const z of o){if(!z.layerData.has(f)||(z.key.level!==X&&(X=z.key.level,x.setDataUniforms(C,r,t,X,c)),b=z.layerData.get(f),b.glyphPerPageElementsMap.size===0))continue;b.prepareForRendering(a),b.updateOpacityInfo();const Ie=b.textVAO;if(Ie==null)continue;a.bindVAO(Ie),C.setUniformMatrix3fv("u_dvsMat3",z.transforms.displayViewScreenMat3),this._setStencilState(e,z);const st=(performance.now()-b.lastOpacityUpdate)/1e3;C.setUniform1f("u_time",st),b.glyphPerPageElementsMap.forEach((ut,ct)=>{this._renderGlyphRange(a,ut,ct,l,C,y,v,z)})}}_renderGlyphRange(e,t,o,a,r,l,n,s){a.bind(e,B.LINEAR,o,Pe),l&&(r.setUniform1f("u_halo",1),e.drawElements(A.TRIANGLES,t[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3),n&&(r.setUniform1f("u_halo",0),e.drawElements(A.TRIANGLES,t[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3)}_setStencilState(e,t){const{context:o,is3D:a,stencilSymbols:r}=e;if(o.setStencilTestEnabled(!0),r)return o.setStencilWriteMask(255),void o.setStencilFunction(U.ALWAYS,t.stencilRef,255);o.setStencilWriteMask(0),a?o.setStencilFunction(U.EQUAL,t.stencilRef,255):o.setStencilFunction(U.GREATER,255,255)}}const Ci={clip:ti,stencil:ii,bitmap:Yt,tileDebugInfo:xi,vtlBackground:yi,vtlFill:Ti,vtlLine:bi,vtlCircle:Si,vtlSymbol:Pi},Di=i=>{switch(i.BYTES_PER_ELEMENT){case 1:return P.UNSIGNED_BYTE;case 2:return P.UNSIGNED_SHORT;case 4:return P.UNSIGNED_INT;default:throw new Te("Cannot get DataType of array")}},Ri=(i,e,t,o)=>{let a=0;for(let r=1;r0:a<0},We=({coords:i,lengths:e},t)=>{const o=[];for(let a=0,r=0;ae?.dispose()),this._cache.indexBuffer=this._cache.vertexBuffers=null}get elementType(){return Di(this.indices)}getIndexBuffer(e,t=W.STATIC_DRAW){return this._cache.indexBuffer??=k.createIndex(e,t,this.indices),this._cache.indexBuffer}getVertexBuffers(e,t=W.STATIC_DRAW){return this._cache.vertexBuffers??=new Map(Object.keys(this.vertices).reduce((o,a)=>(o.push([a,k.createVertex(e,t,this.vertices[a])]),o),new Array)),this._cache.vertexBuffers}}class be extends $e{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=ft(()=>t.version,()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new be(e,t)}_destroyGL(){this._cache.mesh!=null&&(this._cache.mesh.destroy(),this._cache.mesh=null),this._cache.vao!=null&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,o,a){const[r,l]=t.size;if(this._clip.type!=="geometry"&&this._lastWidth===r&&this._lastHeight===l||(this._lastWidth=r,this._lastHeight=l,this._destroyGL()),this._cache.vao==null){const n=this._createMesh(t,this._clip),s=n.getIndexBuffer(e),c=n.getVertexBuffers(e);this._cache.mesh=n,this._cache.vao=new K(e,o,a,c,s)}return this._cache.vao}_createTransforms(){return{displayViewScreenMat3:oe()}}_invalidate(){this._destroyGL(),this.requestRender()}_createMesh(e,t){switch(t.type){case"rect":return w.fromScreenExtent(Ot(t,e.size[0],e.size[1]));case"path":return w.fromPath(t);case"geometry":return w.fromGeometry(e,t);default:return Se.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new Te("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),w.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}}class lo extends Dt{set clips(e){super.clips=e,this._updateClippingInfo(e)}renderChildren(e){e.painter.setPipelineState(null),this._renderPasses==null&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const t of this._renderPasses)try{t.render(e)}catch{}}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[Ci.clip],target:()=>this._clippingInfos,drawPhase:ee.MAP|ee.LABEL|ee.LABEL_ALPHA|ee.DEBUG|ee.HIGHLIGHT})]}_updateClippingInfo(e){this._clippingInfos!=null&&(this._clippingInfos.forEach(t=>t.destroy()),this._clippingInfos=null),e!=null&&e.length&&(this._clippingInfos=e.items.map(t=>be.fromClipArea(this.stage,t))),this.requestRender()}}export{Ut as F,oi as K,lo as N,ro as R,ii as Z,oo as a,gi as i,Z as k,ao as m,io as n,fe as o,xi as r,Ci as s}; diff --git a/main/assets/WGLContainer-LxgEo4I_-DOcf4AGd.js b/main/assets/WGLContainer-LxgEo4I_-DOcf4AGd.js deleted file mode 100644 index c3383251f..000000000 --- a/main/assets/WGLContainer-LxgEo4I_-DOcf4AGd.js +++ /dev/null @@ -1,3619 +0,0 @@ -import{K as j,O as ve,aA as Ee,a1 as Se,ah as ft,o as Te,iW as Oe}from"./main-BZaw9FpY.js";import{S as dt,W as _t,X as mt,Y as vt,t as ue,G as Ae,w as F,z as Pe,B as Ze}from"./definitions-DJSdSb77-DkoRHaVx.js";import{p as le,M as ne,s as Ke,T as pt,Z as gt,V as R,G as ht}from"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import{r as k}from"./BufferObject-BM_7mcDb-QLZylgsX.js";import{M as B,I as P,T as A,n as W,A as N,L as U,D as Q,C as xt,G as yt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as K}from"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import{n as ie}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{c as St,d as ce}from"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import{l as pe,H as Tt,K as bt}from"./Tile-D75RMC64-DprBAZDK.js";import{Q as qe,E as ge,k as It}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as oe,N as he,S as Ce,E as ee,o as Et,q as Ot}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{_ as At,Z as Pt}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{o as Ct}from"./vec3f32-BS0cezmI-B_madU1n.js";import{T as $e,x as Dt}from"./Container-BcuL1ZEG-DH5lSN9D.js";import{s as Rt}from"./TileKey-C5IL-JBr-0HJjsV9n.js";import{H as Lt,V as Mt}from"./Texture-BCt2hphT-D-X9O5uh.js";import{i as J,n as G,u as De}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as zt,e as Vt}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{e as Re}from"./config-nuMERBvb-MDUrh2eL.js";import{m as Nt}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{m as wt}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Le}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as Ft,O as Bt}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{c as Me}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";let Ut=class{constructor(i,e){this._rctx=i,this._attributes=[{name:"position",offset:0,type:P.SHORT,count:2}],this.layout={hash:gt(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=k.createVertex(i,W.STATIC_DRAW,new Uint16Array(e)),this._vao=new K(i,new Map([["a_position",0]]),new Map([["geometry",[new ie("a_position",2,P.SHORT,0,4)]]]),new Map([["geometry",this._vertexBuffer]])),this._count=e.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(A.TRIANGLE_STRIP,0,this._count)}},Z=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(i,e){}draw(i,e,t){}drawMany(i,e,t){for(const o of e)o.visible&&this.draw(i,o,t)}};const de={nearest:{defines:[],samplingMode:B.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:B.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:B.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:B.LINEAR_MIPMAP_LINEAR,mips:!0}},Gt=(i,e,t)=>{if(t.samplingMode==="dynamic"){const{state:o}=i,a=e.resolution/e.pixelRatio/o.resolution,r=Math.round(i.pixelRatio)!==i.pixelRatio,l=a>1.05||a<.95;return o.rotation||l||r||e.isSourceScaled||e.rotation?de.bilinear:de.nearest}return de[t.samplingMode]};let Yt=class extends Z{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:i}){i.setBlendingEnabled(!0),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!0)}draw(i,e){const{context:t,renderingOptions:o,painter:a,requestRender:r,allowDelayedRender:l}=i;if(!e.source||!e.isReady)return;const n=Gt(i,e,o),s=a.materialManager.getProgram(this._desc,n.defines);if(l&&r!=null&&!s.compiled)return void r();i.timeline.begin(this.name),e.blendFunction==="additive"?t.setBlendFunctionSeparate(N.ONE,N.ONE,N.ONE,N.ONE):t.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),t.setStencilFunction(U.EQUAL,e.stencilRef,255),this._quad||(this._quad=new Ut(t,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:u,transforms:f}=e;e.setSamplingProfile(n),e.bind(i.context,Ae),t.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",f.displayViewScreenMat3),s.setUniform1i("u_texture",Ae),s.setUniform2fv("u_coordScale",c),s.setUniform1f("u_opacity",u),this._quad.draw(),i.timeline.end(this.name)}};function je(){return new Float32Array(4)}function kt(i){const e=new Float32Array(4);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e}function H(i,e,t,o){const a=new Float32Array(4);return a[0]=i,a[1]=e,a[2]=t,a[3]=o,a}function Ht(i,e){return new Float32Array(i,e,4)}function Xe(){return je()}function Qe(){return H(1,1,1,1)}function Je(){return H(1,0,0,0)}function et(){return H(0,1,0,0)}function tt(){return H(0,0,1,0)}function it(){return H(0,0,0,1)}const Wt=Xe(),Zt=Qe(),Kt=Je(),qt=et(),$t=tt(),jt=it();Object.freeze(Object.defineProperty({__proto__:null,ONES:Zt,UNIT_W:jt,UNIT_X:Kt,UNIT_Y:qt,UNIT_Z:$t,ZEROS:Wt,clone:kt,create:je,createView:Ht,fromValues:H,ones:Qe,unitW:it,unitX:Je,unitY:et,unitZ:tt,zeros:Xe},Symbol.toStringTag,{value:"Module"}));const Xt={background:{"background.frag":`uniform lowp vec4 u_color; -void main() { -gl_FragColor = u_color; -}`,"background.vert":`attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform mediump vec2 u_coord_range; -uniform mediump float u_depth; -void main() { -vec3 v_pos = u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0); -gl_Position = vec4(v_pos.xy, 0.0, 1.0); -}`},bitBlit:{"bitBlit.frag":`uniform lowp sampler2D u_tex; -uniform lowp float u_opacity; -varying mediump vec2 v_uv; -void main() { -lowp vec4 color = texture2D(u_tex, v_uv); -gl_FragColor = color * u_opacity; -}`,"bitBlit.vert":`attribute vec2 a_pos; -attribute vec2 a_tex; -varying mediump vec2 v_uv; -void main(void) { -gl_Position = vec4(a_pos , 0.0, 1.0); -v_uv = a_tex; -}`},debug:{overlay:{"overlay.frag":`precision mediump float; -varying vec4 v_color; -void main(void) { -gl_FragColor = v_color; -}`,"overlay.vert":`attribute vec3 a_PositionAndFlags; -uniform mat3 u_dvsMat3; -uniform vec4 u_colors[4]; -uniform float u_opacities[4]; -varying vec4 v_color; -void main(void) { -vec2 position = a_PositionAndFlags.xy; -float flags = a_PositionAndFlags.z; -int colorIndex = int(mod(flags, 4.0)); -vec4 color; -for (int i = 0; i < 4; i++) { -color = u_colors[i]; -if (i == colorIndex) { -break; -} -} -int opacityIndex = int(mod(floor(flags / 4.0), 4.0)); -float opacity; -for (int i = 0; i < 4; i++) { -opacity = u_opacities[i]; -if (i == opacityIndex) { -break; -} -} -v_color = color * opacity; -gl_Position = vec4((u_dvsMat3 * vec3(position, 1.0)).xy, 0.0, 1.0); -}`}},dot:{dot:{"dot.frag":`precision mediump float; -varying vec4 v_color; -varying float v_dotRatio; -varying float v_invEdgeRatio; -uniform highp float u_tileZoomFactor; -void main() -{ -float dist = length(gl_PointCoord - vec2(.5, .5)) * 2.; -float alpha = smoothstep(0., 1., v_invEdgeRatio * (dist - v_dotRatio) + 1.); -gl_FragColor = v_color * alpha; -}`,"dot.vert":`precision highp float; -attribute vec2 a_pos; -uniform sampler2D u_texture; -uniform highp mat3 u_dvsMat3; -uniform highp float u_tileZoomFactor; -uniform highp float u_dotSize; -uniform highp float u_pixelRatio; -varying vec2 v_pos; -varying vec4 v_color; -varying float v_dotRatio; -varying float v_invEdgeRatio; -const float EPSILON = 0.000001; -void main() -{ -mat3 tileToTileTexture = mat3( 1., 0., 0., -0., -1., 0., -0., 1., 1. ); -vec3 texCoords = tileToTileTexture * vec3(a_pos.xy / 512., 1.); -v_color = texture2D(u_texture, texCoords.xy); -float smoothEdgeWidth = max(u_dotSize / 2., 1.) ; -float z = 0.; -z += 2.0 * step(v_color.a, EPSILON); -gl_PointSize = (smoothEdgeWidth + u_dotSize); -gl_Position = vec4((u_dvsMat3 * vec3(a_pos + .5, 1.)).xy, z, 1.); -v_dotRatio = u_dotSize / gl_PointSize; -v_invEdgeRatio = -1. / ( smoothEdgeWidth / gl_PointSize ); -gl_PointSize *= (u_pixelRatio * u_tileZoomFactor); -}`}},filtering:{"bicubic.glsl":`vec4 computeWeights(float v) { -float b = 1.0 / 6.0; -float v2 = v * v; -float v3 = v2 * v; -float w0 = b * (-v3 + 3.0 * v2 - 3.0 * v + 1.0); -float w1 = b * (3.0 * v3 - 6.0 * v2 + 4.0); -float w2 = b * (-3.0 * v3 + 3.0 * v2 + 3.0 * v + 1.0); -float w3 = b * v3; -return vec4(w0, w1, w2, w3); -} -vec4 bicubicOffsetsAndWeights(float v) { -vec4 w = computeWeights(v); -float g0 = w.x + w.y; -float g1 = w.z + w.w; -float h0 = 1.0 - (w.y / g0) + v; -float h1 = 1.0 + (w.w / g1) - v; -return vec4(h0, h1, g0, g1); -} -vec4 sampleBicubicBSpline(sampler2D sampler, vec2 coords, vec2 texSize) { -vec2 eX = vec2(1.0 / texSize.x, 0.0); -vec2 eY = vec2(0.0, 1.0 / texSize.y); -vec2 texel = coords * texSize - 0.5; -vec3 hgX = bicubicOffsetsAndWeights(fract(texel).x).xyz; -vec3 hgY = bicubicOffsetsAndWeights(fract(texel).y).xyz; -vec2 coords10 = coords + hgX.x * eX; -vec2 coords00 = coords - hgX.y * eX; -vec2 coords11 = coords10 + hgY.x * eY; -vec2 coords01 = coords00 + hgY.x * eY; -coords10 = coords10 - hgY.y * eY; -coords00 = coords00 - hgY.y * eY; -vec4 color00 = texture2D(sampler, coords00); -vec4 color10 = texture2D(sampler, coords10); -vec4 color01 = texture2D(sampler, coords01); -vec4 color11 = texture2D(sampler, coords11); -color00 = mix(color00, color01, hgY.z); -color10 = mix(color10, color11, hgY.z); -color00 = mix(color00, color10, hgX.z); -return color00; -}`,"bilinear.glsl":`vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) { -vec2 texelStart = floor(coords * texSize); -vec2 coord0 = texelStart / texSize; -vec2 coord1 = (texelStart + vec2(1.0, 0.0)) / texSize; -vec2 coord2 = (texelStart + vec2(0.0, 1.0)) / texSize; -vec2 coord3 = (texelStart + vec2(1.0, 1.0)) / texSize; -vec4 color0 = texture2D(sampler, coord0); -vec4 color1 = texture2D(sampler, coord1); -vec4 color2 = texture2D(sampler, coord2); -vec4 color3 = texture2D(sampler, coord3); -vec2 blend = fract(coords * texSize); -vec4 color01 = mix(color0, color1, blend.x); -vec4 color23 = mix(color2, color3, blend.x); -vec4 color = mix(color01, color23, blend.y); -#ifdef NNEDGE -float alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5); -color = color * alpha + (1.0 - alpha) * texture2D(sampler, coords); -#endif -return color; -}`,"epx.glsl":`vec4 sampleEPX(sampler2D sampler, float size, vec2 coords, vec2 texSize) { -vec2 invSize = 1.0 / texSize; -vec2 texel = coords * texSize; -vec2 texel_i = floor(texel); -vec2 texel_frac = fract(texel); -vec4 colorP = texture2D(sampler, texel_i * invSize); -vec4 colorP1 = vec4(colorP); -vec4 colorP2 = vec4(colorP); -vec4 colorP3 = vec4(colorP); -vec4 colorP4 = vec4(colorP); -vec4 colorA = texture2D(sampler, (texel_i - vec2(0.0, 1.0)) * invSize); -vec4 colorB = texture2D(sampler, (texel_i + vec2(1.0, 0.0)) * invSize); -vec4 colorC = texture2D(sampler, (texel_i - vec2(1.0, 0.0)) * invSize); -vec4 colorD = texture2D(sampler, (texel_i + vec2(0.0, 1.0)) * invSize); -if (colorC == colorA && colorC != colorD && colorA != colorB) { -colorP1 = colorA; -} -if (colorA == colorB && colorA != colorC && colorB != colorD) { -colorP2 = colorB; -} -if (colorD == colorC && colorD != colorB && colorC != colorA) { -colorP3 = colorC; -} -if (colorB == colorD && colorB != colorA && colorD != colorC) { -colorP4 = colorD; -} -vec4 colorP12 = mix(colorP1, colorP2, texel_frac.x); -vec4 colorP34 = mix(colorP1, colorP2, texel_frac.x); -return mix(colorP12, colorP34, texel_frac.y); -}`},heatmap:{heatmapResolve:{"heatmapResolve.frag":`precision highp float; -#ifdef HEATMAP_PRECISION_HALF_FLOAT -#define COMPRESSION_FACTOR 4.0 -#else -#define COMPRESSION_FACTOR 1.0 -#endif -uniform sampler2D u_texture; -uniform sampler2D u_gradient; -uniform vec2 u_densityMinAndInvRange; -uniform float u_densityNormalization; -varying vec2 v_uv; -void main() { -vec4 data = texture2D(u_texture, v_uv); -float density = data.r * COMPRESSION_FACTOR; -density *= u_densityNormalization; -density = (density - u_densityMinAndInvRange.x) * u_densityMinAndInvRange.y; -vec4 color = texture2D(u_gradient, vec2(density, 0.5)); -gl_FragColor = vec4(color.rgb * color.a, color.a); -}`,"heatmapResolve.vert":`precision highp float; -attribute vec2 a_pos; -varying vec2 v_uv; -void main() { -v_uv = a_pos; -gl_Position = vec4(a_pos * 2.0 - 1.0, 1., 1.); -}`}},highlight:{"blur.frag":`varying mediump vec2 v_texcoord; -uniform mediump vec4 u_direction; -uniform mediump mat4 u_channelSelector; -uniform mediump float u_sigma; -uniform sampler2D u_texture; -mediump float gauss1(mediump vec2 dir) { -return exp(-dot(dir, dir) / (2.0 * u_sigma * u_sigma)); -} -mediump vec4 selectChannel(mediump vec4 sample) { -return u_channelSelector * sample; -} -void accumGauss1(mediump float i, inout mediump float tot, inout mediump float weight) { -mediump float w = gauss1(i * u_direction.xy); -tot += selectChannel(texture2D(u_texture, v_texcoord + i * u_direction.zw))[3] * w; -weight += w; -} -void main(void) { -mediump float tot = 0.0; -mediump float weight = 0.0; -accumGauss1(-5.0, tot, weight); -accumGauss1(-4.0, tot, weight); -accumGauss1(-3.0, tot, weight); -accumGauss1(-2.0, tot, weight); -accumGauss1(-1.0, tot, weight); -accumGauss1(0.0, tot, weight); -accumGauss1(1.0, tot, weight); -accumGauss1(2.0, tot, weight); -accumGauss1(3.0, tot, weight); -accumGauss1(4.0, tot, weight); -accumGauss1(5.0, tot, weight); -gl_FragColor = vec4(0.0, 0.0, 0.0, tot / weight); -}`,"highlight.frag":`varying mediump vec2 v_texcoord; -uniform sampler2D u_texture; -uniform mediump float u_sigma; -uniform sampler2D u_shade; -uniform mediump vec2 u_minMaxDistance; -mediump float estimateDistance() { -mediump float y = texture2D(u_texture, v_texcoord)[3]; -const mediump float y0 = 0.5; -mediump float m0 = 1.0 / (sqrt(2.0 * 3.1415) * u_sigma); -mediump float d = (y - y0) / m0; -return d; -} -mediump vec4 shade(mediump float d) { -mediump float mappedDistance = (d - u_minMaxDistance.x) / (u_minMaxDistance.y - u_minMaxDistance.x); -mappedDistance = clamp(mappedDistance, 0.0, 1.0); -return texture2D(u_shade, vec2(mappedDistance, 0.5)); -} -void main(void) { -mediump float d = estimateDistance(); -gl_FragColor = shade(d); -}`,"textured.vert":`attribute mediump vec2 a_position; -attribute mediump vec2 a_texcoord; -varying mediump vec2 v_texcoord; -void main(void) { -gl_Position = vec4(a_position, 0.0, 1.0); -v_texcoord = a_texcoord; -}`},materials:{"attributeData.glsl":`uniform highp sampler2D filterFlags; -uniform highp sampler2D animation; -uniform highp sampler2D gpgpu; -uniform highp sampler2D visualVariableData; -uniform highp sampler2D dataDriven0; -uniform highp sampler2D dataDriven1; -uniform highp sampler2D dataDriven2; -uniform float size; -highp vec2 getAttributeDataCoords(in highp vec3 id) { -highp vec3 texel = unpackDisplayIdTexel(id); -highp float u32 = float(int(texel.r) + int(texel.g) * 256 + int(texel.b) * 256 * 256); -highp float col = mod(u32, size); -highp float row = (u32 - col) / size; -highp float u = col / size; -highp float v = row / size; -return vec2(u, v); -} -highp vec2 getAttributeDataTextureCoords(in highp vec3 id) { -return (getAttributeDataCoords(id) * 2.0) - 1.0 + (.5 / vec2(size)); -} -highp vec4 getFilterData(in highp vec3 id) { -vec2 coords = getAttributeDataCoords(id); -return texture2D(filterFlags, coords); -} -highp vec4 getAnimation(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(animation, coords); -} -highp vec4 getVisualVariableData(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(visualVariableData, coords); -} -highp vec4 getDataDriven0(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(dataDriven0, coords); -} -highp vec4 getDataDriven1(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(dataDriven1, coords); -} -highp vec4 getGPGPU(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(gpgpu, coords); -} -highp vec4 getDataDriven2(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(dataDriven2, coords); -} -float u88VVToFloat(in vec2 v) { -bool isMagic = v.x == 255.0 && v.y == 255.0; -if (isMagic) { -return NAN_MAGIC_NUMBER; -} -return (v.x + v.y * float(0x100)) - 32768.0; -}`,"barycentric.glsl":`float inTriangle(vec3 bary) { -vec3 absBary = abs(bary); -return step((absBary.x + absBary.y + absBary.z), 1.05); -} -vec3 xyToBarycentric(in vec2 pos, in vec2 v0, in vec2 v1, in vec2 v2) { -mat3 xyToBarycentricMat3 = mat3( -v1.x * v2.y - v2.x * v1.y, v2.x * v0.y - v0.x * v2.y, v0.x * v1.y - v1.x * v0.y, -v1.y - v2.y, v2.y - v0.y, v0.y - v1.y, -v2.x - v1.x, v0.x - v2.x, v1.x - v0.x -); -float A2 = v0.x * (v1.y - v2.y) + v1.x * (v2.y - v0.y) + v2.x * (v0.y - v1.y); -return (1. / A2) * xyToBarycentricMat3 * vec3(1., pos); -}`,"constants.glsl":`const float C_DEG_TO_RAD = 3.14159265359 / 180.0; -const float C_256_TO_RAD = 3.14159265359 / 128.0; -const float C_RAD_TO_DEG = 180.0 / 3.141592654; -const float POSITION_PRECISION = 1.0 / 8.0; -const float FILL_POSITION_PRECISION = 1.0 / 1.0; -const float SOFT_EDGE_RATIO = 1.0; -const float THIN_LINE_WIDTH_FACTOR = 1.1; -const float THIN_LINE_HALF_WIDTH = 1.0; -const float EXTRUDE_SCALE_PLACEMENT_PADDING = 1.0 / 4.0; -const float OFFSET_PRECISION = 1.0 / 8.0; -const float OUTLINE_SCALE = 1.0 / 5.0; -const float SDF_FONT_SIZE = 24.0; -const float MAX_SDF_DISTANCE = 8.0; -const float PLACEMENT_PADDING = 8.0; -const float EPSILON = 0.00001; -const float EPSILON_HITTEST = 0.05; -const int MAX_FILTER_COUNT = 2; -const int ATTR_VV_SIZE = 0; -const int ATTR_VV_COLOR = 1; -const int ATTR_VV_OPACITY = 2; -const int ATTR_VV_ROTATION = 3; -const highp float NAN_MAGIC_NUMBER = 1e-30; -const int BITSET_GENERIC_LOCK_COLOR = 1; -const int BITSET_GENERIC_CONSIDER_ALPHA_ONLY = 4; -const int BITSET_MARKER_ALIGNMENT_MAP = 0; -const int BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE = 2; -const int BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY = 3; -const int BITSET_TYPE_FILL_OUTLINE = 0; -const int BITSET_FILL_RANDOM_PATTERN_OFFSET = 2; -const int BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR = 3; -const int BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR = 5; -const int BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR = 6; -const int BITSET_LINE_SCALE_DASH = 2;`,fill:{"common.glsl":`#include -#ifdef PATTERN -uniform mediump vec2 u_mosaicSize; -varying mediump float v_sampleAlphaOnly; -#endif -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -uniform lowp vec4 u_isActive[ 2 ]; -uniform highp float u_dotValue; -uniform highp float u_tileDotsOverArea; -uniform highp float u_dotTextureDotCount; -uniform mediump float u_tileZoomFactor; -#endif -varying highp vec3 v_id; -varying lowp vec4 v_color; -varying lowp float v_opacity; -varying mediump vec4 v_aux1; -#ifdef PATTERN -varying mediump vec2 v_tileTextureCoord; -#endif -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -varying lowp float v_isOutline; -#endif -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -varying highp vec2 v_dotTextureCoords; -varying highp vec4 v_dotThresholds[ 2 ]; -#endif`,"fill.frag":`precision highp float; -#include -#include -#include -#ifdef PATTERN -uniform lowp sampler2D u_texture; -#endif -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -uniform mediump mat4 u_dotColors[ 2 ]; -uniform sampler2D u_dotTextures[ 2 ]; -uniform vec4 u_dotBackgroundColor; -#endif -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#include -#include -lowp vec4 drawLine() { -float v_lineWidth = v_aux1.x; -vec2 v_normal = v_aux1.yz; -LineData inputs = LineData( -v_color, -v_normal, -v_lineWidth, -v_opacity, -v_id -); -return shadeLine(inputs); -} -#endif -lowp vec4 drawFill() { -lowp vec4 out_color = vec4(0.); -#ifdef HITTEST -out_color = v_color; -#elif defined(PATTERN) -mediump vec4 v_tlbr = v_aux1; -mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0); -mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); -lowp vec4 color = texture2D(u_texture, samplePos); -if (v_sampleAlphaOnly > 0.5) { -color.rgb = vec3(color.a); -} -out_color = v_opacity * v_color * color; -#elif SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY && !defined(HIGHLIGHT) -vec4 textureThresholds0 = texture2D(u_dotTextures[0], v_dotTextureCoords); -vec4 textureThresholds1 = texture2D(u_dotTextures[1], v_dotTextureCoords); -vec4 difference0 = v_dotThresholds[0] - textureThresholds0; -vec4 difference1 = v_dotThresholds[1] - textureThresholds1; -#ifdef DD_DOT_BLENDING -vec4 isPositive0 = step(0.0, difference0); -vec4 isPositive1 = step(0.0, difference1); -float weightSum = dot(isPositive0, difference0) + dot(isPositive1, difference1); -float lessThanEqZero = step(weightSum, 0.0); -float greaterThanZero = 1.0 - lessThanEqZero ; -float divisor = (weightSum + lessThanEqZero); -vec4 weights0 = difference0 * isPositive0 / divisor; -vec4 weights1 = difference1 * isPositive1 / divisor; -vec4 dotColor = u_dotColors[0] * weights0 + u_dotColors[1] * weights1; -vec4 preEffectColor = greaterThanZero * dotColor + lessThanEqZero * u_dotBackgroundColor; -#else -float diffMax = max(max4(difference0), max4(difference1)); -float lessThanZero = step(diffMax, 0.0); -float greaterOrEqZero = 1.0 - lessThanZero; -vec4 isMax0 = step(diffMax, difference0); -vec4 isMax1 = step(diffMax, difference1); -vec4 dotColor = u_dotColors[0] * isMax0 + u_dotColors[1] * isMax1; -vec4 preEffectColor = greaterOrEqZero * dotColor + lessThanZero * u_dotBackgroundColor; -#endif -out_color = preEffectColor; -#else -out_color = v_opacity * v_color; -#endif -#ifdef HIGHLIGHT -out_color.a = 1.0; -#endif -return out_color; -} -void main() { -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -if (v_isOutline > 0.5) { -gl_FragColor = drawLine(); -} else { -gl_FragColor = drawFill(); -} -#else -gl_FragColor = drawFill(); -#endif -}`,"fill.vert":`#include -#define PACKED_LINE -precision highp float; -attribute float a_bitset; -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -attribute float a_inverseArea; -vec4 a_color = vec4(0.0, 0.0, 0.0, 1.0); -vec2 a_zoomRange = vec2(0.0, 10000.0); -#else -attribute vec4 a_color; -attribute vec4 a_aux2; -attribute vec4 a_aux3; -#ifndef SYMBOLOGY_TYPE_IS_SIMPLE_LIKE -attribute vec4 a_aux1; -attribute vec2 a_zoomRange; -#else -vec2 a_zoomRange = vec2(0.0, 10000.0); -#endif -#endif -uniform vec2 u_tileOffset; -uniform vec2 u_maxIntNumOfCrossing; -#include -#include -#include -#include -const float INV_SCALE_COMPRESSION_FACTOR = 1.0 / 128.0; -const float MAX_REPRESENTABLE_INT = 16777216.0; -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -vec4 dotThreshold(vec4 featureAttrOverFeatureArea, float dotValue, float tileDotsOverArea) { -return featureAttrOverFeatureArea * (1.0 / dotValue) * (1.0 / tileDotsOverArea); -} -#endif -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#include -#include -void drawLine(out lowp vec4 out_color, out highp vec3 out_pos) { -LineData outputs = buildLine( -out_pos, -a_id, -a_pos, -a_color, -(a_aux3.xy - 128.) / 16., -(a_aux3.zw - 128.) / 16., -0., -a_aux2.z / 16., -a_bitset, -vec4(0.), -vec2(0.), -a_aux2.w / 16. -); -v_id = outputs.id; -v_opacity = outputs.opacity; -v_aux1 = vec4(outputs.lineHalfWidth, outputs.normal, 0.); -out_color = outputs.color; -} -#endif -void drawFill(out lowp vec4 out_color, out highp vec3 out_pos) { -float a_bitSet = a_bitset; -out_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR); -v_opacity = getOpacity(); -v_id = norm(a_id); -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -mat3 tileToTileNormalized = mat3( 2. / 512., 0., 0., -0., -2. / 512., 0., --1., 1., 1. ); -out_pos = tileToTileNormalized * vec3((a_pos * FILL_POSITION_PRECISION), 1.); -#else -out_pos = u_dvsMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.); -#endif -#ifdef PATTERN -vec4 a_tlbr = a_aux1; -float a_width = a_aux2.x; -float a_height = a_aux2.y; -vec2 a_offset = a_aux2.zw; -vec2 a_scale = a_aux3.xy; -float a_angle = a_aux3.z; -if (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR) > 0.5) { -a_width *= INV_SCALE_COMPRESSION_FACTOR; -} -if (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR) > 0.5) { -a_height *= INV_SCALE_COMPRESSION_FACTOR; -} -vec2 scale = INV_SCALE_COMPRESSION_FACTOR * a_scale; -float width = u_zoomFactor * a_width * scale.x; -float height = u_zoomFactor * a_height * scale.y; -float angle = C_256_TO_RAD * a_angle; -float sinA = sin(angle); -float cosA = cos(angle); -float dx = 0.0; -float dy = 0.0; -if (getBit(a_bitset, BITSET_FILL_RANDOM_PATTERN_OFFSET) > 0.5) { -float id = rgba2float(vec4(a_id, 0.0)); -dx = rand(vec2(id, 0.0)); -dy = rand(vec2(0.0, id)); -} -mat3 patternMatrix = mat3(cosA / width, sinA / height, 0, --sinA / width, cosA / height, 0, -dx, dy, 1); -vec2 patternSize = vec2(a_width, a_height); -vec2 numPatternsPerMaxInt = vec2(MAX_REPRESENTABLE_INT) / patternSize; -vec2 maxIntCrossingOffsetCorrection = patternSize * fract(u_maxIntNumOfCrossing * numPatternsPerMaxInt); -vec2 tileOffset = u_tileOffset + maxIntCrossingOffsetCorrection - 0.5 * patternSize; -tileOffset = vec2(tileOffset.x * cosA - tileOffset.y * sinA, tileOffset.x * sinA + tileOffset.y * cosA); -tileOffset = mod(tileOffset, patternSize); -vec2 symbolOffset = u_zoomFactor * scale * vec2(a_offset - tileOffset) / vec2(width, height); -v_tileTextureCoord = (patternMatrix * vec3(a_pos * FILL_POSITION_PRECISION, 1.0)).xy - symbolOffset; -v_aux1 = a_tlbr / u_mosaicSize.xyxy; -v_sampleAlphaOnly = getBit(a_bitset, BITSET_GENERIC_CONSIDER_ALPHA_ONLY); -if (getBit(a_bitSet, BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR) > 0.5) { -#ifdef VV_COLOR -v_sampleAlphaOnly *= (1.0 - float(isNan(VV_ADATA[ATTR_VV_COLOR]))) * (1.0 - getBit(a_bitSet, BITSET_GENERIC_LOCK_COLOR)); -#else -v_sampleAlphaOnly = 0.0; -#endif -} -#elif SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -vec4 ddAttributeData0 = getAttributeData2(a_id) * u_isActive[0] * a_inverseArea; -vec4 ddAttributeData1 = getAttributeData3(a_id) * u_isActive[1] * a_inverseArea; -float size = u_tileZoomFactor * 512.0 * 1.0 / u_pixelRatio; -v_dotThresholds[0] = dotThreshold(ddAttributeData0, u_dotValue, u_tileDotsOverArea); -v_dotThresholds[1] = dotThreshold(ddAttributeData1, u_dotValue, u_tileDotsOverArea); -v_dotTextureCoords = (a_pos * FILL_POSITION_PRECISION + 0.5) / size; -#endif -} -#ifdef HITTEST -void draw(out lowp vec4 out_color, out highp vec3 out_pos) { -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -if (getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE) > 0.5) { -out_pos = vec3(0., 0., 2.); -return; -} -#endif -hittestFill(out_color, out_pos); -gl_PointSize = 1.0; -} -#elif defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) -void draw(out lowp vec4 out_color, out highp vec3 out_pos) { -v_isOutline = getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE); -if (v_isOutline > 0.5) { -drawLine(out_color, out_pos); -} else { -drawFill(out_color, out_pos); -} -} -#else -#define draw drawFill -#endif -void main() -{ -INIT; -highp vec3 pos = vec3(0.); -highp vec4 color = vec4(0.); -draw(color, pos); -v_color = color; -gl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0); -}`,"hittest.glsl":`#ifdef HITTEST -#include -attribute vec2 a_pos1; -attribute vec2 a_pos2; -void hittestFill( -out lowp vec4 out_color, -out highp vec3 out_pos -) { -vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.); -vec3 pos1 = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * FILL_POSITION_PRECISION, 1.); -vec3 pos2 = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * FILL_POSITION_PRECISION, 1.); -float hittestDist = u_hittestDist; -float dist = distPointTriangle(u_hittestPos, pos.xy, pos1.xy, pos2.xy); -out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); -if (dist < 0. || dist >= hittestDist) { -out_pos.z += 2.0; -} -out_color = vec4(1. / 255., 0, 0, dist == 0. ? (1. / 255.) : 0.); -} -#endif`},hittest:{"common.glsl":`#ifdef HITTEST -uniform float hittestDist; -uniform highp vec2 hittestPos; -float projectScalar(vec2 a, vec2 b) { -return dot(a, normalize(b)); -} -float distPointSegment(vec2 p0, vec2 p1, vec2 p2) { -vec2 L = p2 - p1; -vec2 A = p0 - p1; -float projAL = projectScalar(A, L); -float t = clamp(projAL / length(L), 0., 1.); -return distance(p0, p1 + t * (p2 - p1)); -} -void hittestMarker(out lowp vec4 out_color, out highp vec3 out_pos, in highp vec3 pos, float size) { -float dist = distance(pos, vec3(hittestPos, 1.)); -out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); -if ((dist - size) > hittestDist) { -out_pos.z += 2.0; -} -out_color = vec4(1. / 255., 0, 0, (dist - size) < 0. ? (1. / 255.) : 0.); -} -float intersectPointTriangleBary(vec2 p, vec2 a, vec2 b, vec2 c) { -return inTriangle(xyToBarycentric(p, a, b, c)); -} -float distPointTriangle(vec2 p, vec2 a, vec2 b, vec2 c) { -vec2 ba = b - a; -vec2 ca = c - a; -float crossProduct = ba.x * ca.y - ca.x * ba.y; -bool isParallel = crossProduct < EPSILON_HITTEST && crossProduct > -EPSILON_HITTEST; -if (isParallel) { -return -1.; -} -if (intersectPointTriangleBary(p.xy, a, b, c) == 1.) { -return 0.; -} -float distAB = distPointSegment(p, a, b); -float distBC = distPointSegment(p, b, c); -float distCA = distPointSegment(p, c, a); -return min(min(distAB, distBC), distCA); -} -#endif`},icon:{"common.glsl":`#include -uniform lowp vec2 u_mosaicSize; -varying lowp vec4 v_color; -varying highp vec3 v_id; -varying highp vec4 v_sizeTex; -varying mediump vec3 v_pos; -varying lowp float v_opacity; -uniform lowp sampler2D u_texture; -#ifdef SDF -varying lowp vec4 v_outlineColor; -varying mediump float v_outlineWidth; -varying mediump float v_distRatio; -varying mediump float v_overridingOutlineColor; -varying mediump float v_isThin; -#endif -#ifdef SDF -vec4 getColor(vec2 v_size, vec2 v_tex) { -#ifdef HITTEST -lowp vec4 fillPixelColor = vec4(1.0); -#else -lowp vec4 fillPixelColor = v_color; -#endif -float d = 0.5 - rgba2float(texture2D(u_texture, v_tex)); -float size = max(v_size.x, v_size.y); -float dist = d * size * SOFT_EDGE_RATIO * v_distRatio; -fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0); -float outlineWidth = v_outlineWidth; -#ifdef HIGHLIGHT -outlineWidth = max(outlineWidth, 4.0 * v_isThin); -#endif -if (outlineWidth > 0.25) { -lowp vec4 outlinePixelColor = v_overridingOutlineColor * v_color + (1.0 - v_overridingOutlineColor) * v_outlineColor; -float clampedOutlineSize = min(outlineWidth, size); -outlinePixelColor *= clamp(0.5 - abs(dist) + clampedOutlineSize * 0.5, 0.0, 1.0); -return v_opacity * ((1.0 - outlinePixelColor.a) * fillPixelColor + outlinePixelColor); -} -return v_opacity * fillPixelColor; -} -#else -vec4 getColor(vec2 _v_size, vec2 v_tex) { -lowp vec4 texColor = texture2D(u_texture, v_tex); -return v_opacity * texColor * v_color; -} -#endif`,heatmapAccumulate:{"common.glsl":`varying lowp vec4 v_hittestResult; -varying mediump vec2 v_offsetFromCenter; -varying highp float v_fieldValue;`,"heatmapAccumulate.frag":`precision mediump float; -#include -#ifdef HEATMAP_PRECISION_HALF_FLOAT -#define COMPRESSION_FACTOR 0.25 -#else -#define COMPRESSION_FACTOR 1.0 -#endif -uniform lowp sampler2D u_texture; -void main() { -#ifdef HITTEST -gl_FragColor = v_hittestResult; -#else -float radius = length(v_offsetFromCenter); -float shapeWeight = step(radius, 1.0); -float oneMinusRadiusSquared = 1.0 - radius * radius; -float kernelWeight = oneMinusRadiusSquared * oneMinusRadiusSquared; -gl_FragColor = vec4(shapeWeight * kernelWeight * v_fieldValue * COMPRESSION_FACTOR); -#endif -}`,"heatmapAccumulate.vert":`precision highp float; -attribute vec2 a_vertexOffset; -vec4 a_color = vec4(0.0); -vec2 a_zoomRange = vec2(0.0, 10000.0); -uniform float u_radius; -uniform float u_isFieldActive; -#include -#include -#include -void main() { -float filterFlags = getFilterFlags(); -#ifdef HITTEST -highp vec4 out_hittestResult = vec4(0.); -highp vec3 out_pos = vec3(0.); -vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0); -hittestMarker(out_hittestResult, out_pos, pos, u_radius); -v_hittestResult = out_hittestResult; -gl_PointSize = 1.; -gl_Position = vec4(clip(a_color, out_pos, filterFlags, a_zoomRange), 1.0); -#else -v_offsetFromCenter = sign(a_vertexOffset); -v_fieldValue = getAttributeData2(a_id).x * u_isFieldActive + 1.0 - u_isFieldActive; -vec3 centerPos = u_dvsMat3 * vec3(a_pos * POSITION_PRECISION, 1.0); -vec3 vertexPos = centerPos + u_displayViewMat3 * vec3(v_offsetFromCenter, 0.0) * u_radius; -gl_Position = vec4(clip(a_color, vertexPos, filterFlags, a_zoomRange), 1.0); -#endif -}`},"hittest.glsl":`#ifdef HITTEST -#include -attribute vec2 a_vertexOffset1; -attribute vec2 a_vertexOffset2; -attribute vec2 a_texCoords1; -attribute vec2 a_texCoords2; -vec2 getTextureCoords(in vec3 bary, in vec2 texCoords0, in vec2 texCoords1, in vec2 texCoords2) { -return texCoords0 * bary.x + texCoords1 * bary.y + texCoords2 * bary.z; -} -void hittestIcon( -inout lowp vec4 out_color, -out highp vec3 out_pos, -in vec3 pos, -in vec3 offset, -in vec2 size, -in float scaleFactor, -in float isMapAligned -) { -out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); -vec3 posBase = u_viewMat3 * u_tileMat3 * pos; -vec3 offset1 = scaleFactor * vec3(a_vertexOffset1 / 16.0, 0.); -vec3 offset2 = scaleFactor * vec3(a_vertexOffset2 / 16.0, 0.); -vec2 pos0 = (posBase + getMatrixNoDisplay(isMapAligned) * offset).xy; -vec2 pos1 = (posBase + getMatrixNoDisplay(isMapAligned) * offset1).xy; -vec2 pos2 = (posBase + getMatrixNoDisplay(isMapAligned) * offset2).xy; -vec3 bary0 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, -u_hittestDist), pos0, pos1, pos2); -vec3 bary1 = xyToBarycentric(u_hittestPos + vec2(0., -u_hittestDist), pos0, pos1, pos2); -vec3 bary2 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, -u_hittestDist), pos0, pos1, pos2); -vec3 bary3 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, 0.), pos0, pos1, pos2); -vec3 bary4 = xyToBarycentric(u_hittestPos, pos0, pos1, pos2); -vec3 bary5 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, 0.), pos0, pos1, pos2); -vec3 bary6 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, u_hittestDist), pos0, pos1, pos2); -vec3 bary7 = xyToBarycentric(u_hittestPos + vec2(0., u_hittestDist), pos0, pos1, pos2); -vec3 bary8 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, u_hittestDist), pos0, pos1, pos2); -vec2 tex0 = a_texCoords / u_mosaicSize; -vec2 tex1 = a_texCoords1 / u_mosaicSize; -vec2 tex2 = a_texCoords2 / u_mosaicSize; -float alphaSum = 0.; -alphaSum += inTriangle(bary0) * getColor(size, getTextureCoords(bary0, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary1) * getColor(size, getTextureCoords(bary1, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary2) * getColor(size, getTextureCoords(bary2, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary3) * getColor(size, getTextureCoords(bary3, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary4) * getColor(size, getTextureCoords(bary4, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary5) * getColor(size, getTextureCoords(bary5, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary6) * getColor(size, getTextureCoords(bary6, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary7) * getColor(size, getTextureCoords(bary7, tex0, tex1, tex2)).a; -out_pos.z += step(alphaSum, .05) * 2.0; -out_color = vec4(1. / 255., 0., 0., alphaSum / 255.); -} -#endif`,"icon.frag":`precision mediump float; -#include -#include -#include -void main() -{ -#ifdef HITTEST -vec4 color = v_color; -#else -vec4 color = getColor(v_sizeTex.xy, v_sizeTex.zw); -#endif -#ifdef HIGHLIGHT -color.a = step(1.0 / 255.0, color.a); -#endif -gl_FragColor = color; -}`,"icon.vert":`precision highp float; -attribute vec4 a_color; -attribute vec4 a_outlineColor; -attribute vec4 a_sizeAndOutlineWidth; -attribute vec2 a_vertexOffset; -attribute vec2 a_texCoords; -attribute vec2 a_bitSetAndDistRatio; -attribute vec2 a_zoomRange; -#include -#include -#include -float getMarkerScaleFactor(inout vec2 size, in float referenceSize) { -#ifdef VV_SIZE -float f = getSize(size.y) / size.y; -float sizeFactor = size.y / referenceSize; -return getSize(referenceSize) / referenceSize; -#else -return 1.; -#endif -} -void main() -{ -INIT; -float a_bitSet = a_bitSetAndDistRatio.x; -vec3 pos = vec3(a_pos * POSITION_PRECISION, 1.0); -vec2 size = a_sizeAndOutlineWidth.xy * a_sizeAndOutlineWidth.xy / 128.0; -vec3 offset = vec3(a_vertexOffset / 16.0, 0.); -float outlineSize = a_sizeAndOutlineWidth.z * a_sizeAndOutlineWidth.z / 128.0; -float isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP); -float referenceSize = a_sizeAndOutlineWidth.w * a_sizeAndOutlineWidth.w / 128.0; -float scaleSymbolProportionally = getBit(a_bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY); -float scaleFactor = getMarkerScaleFactor(size, referenceSize); -size.xy *= scaleFactor; -offset.xy *= scaleFactor; -outlineSize *= scaleSymbolProportionally * (scaleFactor - 1.0) + 1.0; -vec2 v_tex = a_texCoords / u_mosaicSize; -float filterFlags = getFilterFlags(); -v_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR); -v_opacity = getOpacity(); -v_id = norm(a_id); -v_pos = u_dvsMat3 * pos + getMatrix(isMapAligned) * getRotation() * offset; -v_sizeTex = vec4(size.xy, v_tex.xy); -#ifdef SDF -v_isThin = getBit(a_bitSet, BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE); -#ifdef VV_COLOR -v_overridingOutlineColor = v_isThin; -#else -v_overridingOutlineColor = 0.0; -#endif -v_outlineWidth = min(outlineSize, max(max(size.x, size.y) - 0.99, 0.0)); -v_outlineColor = a_outlineColor; -v_distRatio = a_bitSetAndDistRatio.y / 128.0; -#endif -#ifdef HITTEST -highp vec4 out_color = vec4(0.); -highp vec3 out_pos = vec3(0.); -hittestIcon(out_color, out_pos, pos, offset, size, scaleFactor, isMapAligned); -v_color = out_color; -gl_PointSize = 1.; -gl_Position = vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0); -#else -gl_Position = vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0); -#endif -}`},label:{"common.glsl":`uniform mediump float u_zoomLevel; -uniform mediump float u_mapRotation; -uniform mediump float u_mapAligned; -uniform mediump vec2 u_mosaicSize; -varying mediump float v_antialiasingWidth; -varying mediump float v_edgeDistanceOffset; -varying mediump vec2 v_tex; -varying mediump vec4 v_color; -varying lowp vec4 v_animation;`,"label.frag":"#include ","label.vert":`precision highp float; -#include -#include -attribute vec4 a_color; -attribute vec4 a_haloColor; -attribute vec4 a_texAndSize; -attribute vec4 a_refSymbolAndPlacementOffset; -attribute vec4 a_glyphData; -attribute vec2 a_vertexOffset; -attribute vec2 a_texCoords; -uniform float u_isHaloPass; -uniform float u_isBackgroundPass; -uniform float u_mapRotation; -uniform float u_mapAligned; -float getZ(in float minZoom, in float maxZoom, in float angle) { -float glyphAngle = angle * 360.0 / 254.0; -float mapAngle = u_mapRotation * 360.0 / 254.0; -float diffAngle = min(360.0 - abs(mapAngle - glyphAngle), abs(mapAngle - glyphAngle)); -float z = 0.0; -z += u_mapAligned * (2.0 * (1.0 - step(minZoom, u_currentZoom))); -z += u_mapAligned * 2.0 * step(90.0, diffAngle); -z += 2.0 * (1.0 - step(u_currentZoom, maxZoom)); -return z; -} -void main() -{ -INIT; -float groupMinZoom = getMinZoom(); -float glyphMinZoom = a_glyphData.x; -float glyphMaxZoom = a_glyphData.y; -float glyphAngle = a_glyphData.z; -float a_isBackground = a_glyphData.w; -float a_minZoom = max(groupMinZoom, glyphMinZoom); -float a_placementPadding = a_refSymbolAndPlacementOffset.x * EXTRUDE_SCALE_PLACEMENT_PADDING; -vec2 a_placementDir = unpack_u8_nf32(a_refSymbolAndPlacementOffset.zw); -float a_refSymbolSize = a_refSymbolAndPlacementOffset.y; -float fontSize = a_texAndSize.z; -float haloSize = a_texAndSize.w * OUTLINE_SCALE; -vec2 vertexOffset = a_vertexOffset * OFFSET_PRECISION; -vec3 pos = vec3(a_pos * POSITION_PRECISION, 1.0); -float z = getZ(a_minZoom, glyphMaxZoom, glyphAngle); -float fontScale = fontSize / SDF_FONT_SIZE; -float halfSize = getSize(a_refSymbolSize) / 2.0; -float animation = pow(getAnimationState(), vec4(2.0)).r; -float isText = 1.0 - a_isBackground; -float isBackground = u_isBackgroundPass * a_isBackground; -vec4 nonHaloColor = (isBackground + isText) * a_color; -v_color = animation * ((1.0 - u_isHaloPass) * nonHaloColor + (u_isHaloPass * a_haloColor)); -v_opacity = 1.0; -v_tex = a_texCoords / u_mosaicSize; -v_edgeDistanceOffset = u_isHaloPass * haloSize / fontScale / MAX_SDF_DISTANCE; -v_antialiasingWidth = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio; -vec2 placementOffset = a_placementDir * (halfSize + a_placementPadding); -vec3 glyphOffset = u_displayMat3 * vec3(vertexOffset + placementOffset, 0.0); -vec3 v_pos = vec3((u_dvsMat3 * pos + glyphOffset).xy, z); -float isHidden = u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground; -v_pos.z += 2.0 * isHidden; -gl_Position = vec4(v_pos, 1.0); -#ifdef DEBUG -v_color = vec4(a_color.rgb, z == 0.0 ? 1.0 : 0.645); -#endif -}`},line:{"common.glsl":`varying lowp vec4 v_color; -varying highp vec3 v_id; -varying mediump vec2 v_normal; -varying mediump float v_lineHalfWidth; -varying lowp float v_opacity; -#ifdef PATTERN -varying mediump vec4 v_tlbr; -varying mediump vec2 v_patternSize; -#endif -#if defined(PATTERN) || defined(SDF) -varying highp float v_accumulatedDistance; -#endif -#ifdef SDF -varying mediump float v_lineWidthRatio; -#endif`,"hittest.glsl":`#include -#ifdef HITTEST -attribute vec2 a_pos1; -attribute vec2 a_pos2; -void hittestLine(out lowp vec4 out_color, out highp vec3 out_pos, float halfWidth) { -vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.); -vec3 pos1 = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * POSITION_PRECISION, 1.); -vec3 pos2 = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * POSITION_PRECISION, 1.); -vec3 outTextureCoords = vec3(getAttributeDataTextureCoords(a_id), 0.0); -float dist = min(distPointSegment(u_hittestPos, pos.xy, pos1.xy), -distPointSegment(u_hittestPos, pos.xy, pos2.xy)) - halfWidth; -out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); -if (dist >= u_hittestDist) { -out_pos.z += 2.0; -} -out_color = vec4(1. / 255., 0, 0, dist <= 0. ? (1. / 255.) : 0.); -} -#endif`,"line.frag":`precision lowp float; -#include -#include -#include -#include -#include -#include -#ifdef HITTEST -void main() { -gl_FragColor = v_color; -} -#else -void main() { -LineData inputs = LineData( -v_color, -v_normal, -v_lineHalfWidth, -v_opacity, -#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#ifdef PATTERN -v_tlbr, -v_patternSize, -#endif -#ifdef SDF -v_lineWidthRatio, -#endif -#if defined(PATTERN) || defined(SDF) -v_accumulatedDistance, -#endif -#endif -v_id -); -gl_FragColor = shadeLine(inputs); -} -#endif`,"line.vert":`precision highp float; -attribute vec4 a_color; -attribute vec4 a_offsetAndNormal; -attribute vec2 a_accumulatedDistanceAndHalfWidth; -attribute vec4 a_tlbr; -attribute vec4 a_segmentDirection; -attribute vec2 a_aux; -attribute vec2 a_zoomRange; -#include -#include -#include -#include -#include -#include -#ifdef HITTEST -void draw() { -float aa = 0.5 * u_antialiasing; -float a_halfWidth = a_accumulatedDistanceAndHalfWidth.y / 16.; -float a_cimHalfWidth = a_aux.x / 16. ; -vec2 a_offset = a_offsetAndNormal.xy / 16.; -float baseWidth = getBaseLineHalfWidth(a_halfWidth, a_cimHalfWidth); -float halfWidth = getLineHalfWidth(baseWidth, aa); -highp vec3 pos = vec3(0.); -v_color = vec4(0.); -hittestLine(v_color, pos, halfWidth); -gl_PointSize = 1.; -gl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0); -} -#else -void draw() -{ -highp vec3 pos = vec3(0.); -LineData outputs = buildLine( -pos, -a_id, -a_pos, -a_color, -a_offsetAndNormal.xy / 16., -a_offsetAndNormal.zw / 16., -a_accumulatedDistanceAndHalfWidth.x, -a_accumulatedDistanceAndHalfWidth.y / 16., -a_segmentDirection.w, -a_tlbr, -a_segmentDirection.xy / 16., -a_aux.x / 16. -); -v_id = outputs.id; -v_color = outputs.color; -v_normal = outputs.normal; -v_lineHalfWidth = outputs.lineHalfWidth; -v_opacity = outputs.opacity; -#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#ifdef PATTERN -v_tlbr = outputs.tlbr; -v_patternSize = outputs.patternSize; -#endif -#ifdef SDF -v_lineWidthRatio = outputs.lineWidthRatio; -#endif -#if defined(PATTERN) || defined(SDF) -v_accumulatedDistance = outputs.accumulatedDistance; -#endif -#endif -gl_Position = vec4(clip(outputs.color, pos, getFilterFlags(), a_zoomRange), 1.0); -} -#endif -void main() { -INIT; -draw(); -}`},pie:{"pie.common.glsl":`uniform float outlineWidth; -uniform mediump float sectorThreshold; -varying vec3 v_id; -varying vec3 v_pos; -varying vec2 v_offset; -varying vec4 v_color; -varying float v_size; -varying float v_numOfEntries; -varying float v_maxSectorAngle; -varying vec2 v_filteredSectorToColorId[numberOfFields]; -varying vec2 v_texCoords; -varying float v_outlineWidth; -varying float v_opacity; -struct FilteredChartInfo { -float endSectorAngle; -int colorId; -};`,"pie.frag":`precision highp float; -#include -#include -#include -#include -uniform lowp vec4 colors[numberOfFields]; -uniform lowp vec4 defaultColor; -uniform lowp vec4 othersColor; -uniform lowp vec4 outlineColor; -uniform float donutRatio; -lowp vec4 getSectorColor(in int index, in vec2 filteredSectorToColorId[numberOfFields]) { -mediump int colorIndex = int(filteredSectorToColorId[index].y); -return colors[colorIndex]; -} -const int OTHER_SECTOR_ID = 255; -#ifdef HITTEST -vec4 getColor() { -float distanceSize = length(v_offset) * v_size; -float donutSize = donutRatio * v_size; -float alpha = step(donutSize, distanceSize) * (1.0 - step(v_size, distanceSize)); -return v_color; -} -#else -vec4 getColor() { -float angle = 90.0 - C_RAD_TO_DEG * atan2(v_offset.y, v_offset.x); -if (angle < 0.0) { -angle += 360.0; -} else if (angle > 360.0) { -angle = mod(angle, 360.0); -} -int numOfEntries = int(v_numOfEntries); -float maxSectorAngle = v_maxSectorAngle; -lowp vec4 fillColor = (maxSectorAngle > 0.0 || sectorThreshold > 0.0) ? othersColor : defaultColor; -lowp vec4 prevColor = vec4(0.0); -lowp vec4 nextColor = vec4(0.0); -float startSectorAngle = 0.0; -float endSectorAngle = 0.0; -if (angle < maxSectorAngle) { -for (int index = 0; index < numberOfFields; ++index) { -startSectorAngle = endSectorAngle; -endSectorAngle = v_filteredSectorToColorId[index].x; -if (endSectorAngle > angle) { -fillColor = getSectorColor(index, v_filteredSectorToColorId); -prevColor = sectorThreshold != 0.0 && index == 0 && abs(360.0 - maxSectorAngle) < EPSILON ? othersColor : -getSectorColor(index > 0 ? index - 1 : numOfEntries - 1, v_filteredSectorToColorId); -nextColor = sectorThreshold != 0.0 && abs(endSectorAngle - maxSectorAngle) < EPSILON ? othersColor : -getSectorColor(index < numOfEntries - 1 ? index + 1 : 0, v_filteredSectorToColorId); -break; -} -if (index == numOfEntries - 1) { -break; -} -} -} else { -prevColor = getSectorColor(numOfEntries - 1, v_filteredSectorToColorId); -nextColor = getSectorColor(0, v_filteredSectorToColorId); -startSectorAngle = maxSectorAngle; -endSectorAngle = 360.0; -} -lowp vec4 outlineColor = outlineColor; -float offset = length(v_offset); -float distanceSize = offset * v_size; -if (startSectorAngle != 0.0 || endSectorAngle != 360.0) { -float distanceToStartSector = (angle - startSectorAngle); -float distanceToEndSector = (endSectorAngle - angle); -float sectorThreshold = 0.6; -float beginSectorAlpha = smoothstep(0.0, sectorThreshold, distanceToStartSector * offset); -float endSectorAlpha = smoothstep(0.0, sectorThreshold, distanceToEndSector * offset); -if (endSectorAlpha > 0.0) { -fillColor = mix(nextColor, fillColor, endSectorAlpha); -} else if (beginSectorAlpha > 0.0) { -fillColor = mix(prevColor, fillColor, beginSectorAlpha); -} -} -float donutSize = donutRatio * (v_size - v_outlineWidth); -float endOfDonut = donutSize - v_outlineWidth; -float aaThreshold = 0.75; -float innerCircleAlpha = endOfDonut - aaThreshold > 0.0 ? smoothstep(endOfDonut - aaThreshold, endOfDonut + aaThreshold, distanceSize) : 1.0; -float outerCircleAlpha = 1.0 - smoothstep(v_size - aaThreshold, v_size + aaThreshold , distanceSize); -float circleAlpha = innerCircleAlpha * outerCircleAlpha; -float startOfOutline = v_size - v_outlineWidth; -if (startOfOutline > 0.0 && v_outlineWidth > 0.25) { -float outlineFactor = smoothstep(startOfOutline - aaThreshold, startOfOutline + aaThreshold, distanceSize); -float innerLineFactor = donutSize - aaThreshold > 0.0 ? 1.0 - smoothstep(donutSize - aaThreshold, donutSize + aaThreshold , distanceSize) : 0.0; -fillColor = mix(fillColor, outlineColor, innerLineFactor + outlineFactor); -} -return v_opacity * circleAlpha * fillColor; -} -#endif -void main() -{ -vec4 color = getColor(); -#ifdef highlight -color.a = step(1.0 / 255.0, color.a); -#endif -gl_FragColor = color; -}`,"pie.vert":`#include -#include -#include -#include -#include -#include -#include -#include -attribute float a_bitSet; -attribute vec2 a_offset; -attribute vec2 a_texCoords; -attribute vec2 a_size; -attribute float a_referenceSize; -attribute vec2 a_zoomRange; -int filterValue(in float sectorAngle, -in int currentIndex, -inout FilteredChartInfo filteredInfo, -inout vec2 filteredSectorToColorId[numberOfFields]) { -if (sectorAngle > sectorThreshold * 360.0) { -filteredInfo.endSectorAngle += sectorAngle; -filteredSectorToColorId[filteredInfo.colorId] = vec2(filteredInfo.endSectorAngle, currentIndex); -++filteredInfo.colorId; -} -return 0; -} -int filterValues(inout vec2 filteredSectorToColorId[numberOfFields], -inout FilteredChartInfo filteredInfo, -in float sectorAngles[numberOfFields]) { -for (int index = 0; index < numberOfFields; ++index) { -float sectorValue = sectorAngles[index]; -filterValue(sectorValue, index, filteredInfo, filteredSectorToColorId); -} -return filteredInfo.colorId; -} -vec2 getMarkerSize(inout vec2 offset, inout vec2 baseSize, inout float outlineSize, in float a_referenceSize, in float bitSet) { -vec2 outSize = baseSize; -#ifdef VV_SIZE -float r = getSize(a_referenceSize, currentScale) / a_referenceSize; -outSize.xy *= r; -offset.xy *= r; -float scaleSymbolProportionally = getBit(bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY); -outlineSize *= scaleSymbolProportionally * (r - 1.0) + 1.0; -#endif -return outSize; -} -vec3 getOffset(in vec2 in_offset, float a_bitSet) { -float isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP); -vec3 offset = vec3(in_offset, 0.0); -return getMatrix(isMapAligned) * offset; -} -float filterNaNValues(in float value) { -return value != NAN_MAGIC_NUMBER && value > 0.0 ? value : 0.0; -} -void main() -{ -INIT; -vec2 a_size = a_size; -vec2 a_offset = a_offset / 16.0; -float outlineSize = outlineWidth; -float a_bitSet = a_bitSet; -float a_referenceSize = a_referenceSize; -vec2 a_texCoords = a_texCoords / 4.0; -vec2 markerSize = getMarkerSize(a_offset, a_size, outlineSize, a_referenceSize, a_bitSet); -float filterFlags = getFilterFlags(); -vec3 pos = vec3(a_pos / 10.0, 1.0); -v_opacity = getOpacity(); -v_id = norm(a_id); -v_pos = displayViewScreenMat3 * pos + getOffset(a_offset, a_bitSet); -v_offset = sign(a_texCoords - 0.5); -v_size = max(markerSize.x, markerSize.y); -v_outlineWidth = outlineSize; -float attributeData[10]; -vec4 attributeData3 = getDataDriven0(a_id); -attributeData[0] = filterNaNValues(attributeData3.x); -attributeData[1] = filterNaNValues(attributeData3.y); -attributeData[2] = filterNaNValues(attributeData3.z); -attributeData[3] = filterNaNValues(attributeData3.w); -#if (numberOfFields > 4) -vec4 attributeData4 = getDataDriven1(a_id); -attributeData[4] = filterNaNValues(attributeData4.x); -attributeData[5] = filterNaNValues(attributeData4.y); -attributeData[6] = filterNaNValues(attributeData4.z); -attributeData[7] = filterNaNValues(attributeData4.w); -#endif -#if (numberOfFields > 8) -vec4 attributeData5 = getDataDriven2(a_id); -attributeData[8] = filterNaNValues(attributeData5.x); -attributeData[9] = filterNaNValues(attributeData5.y); -#endif -float sum = 0.0; -for (int i = 0; i < numberOfFields; ++i) { -sum += attributeData[i]; -} -float sectorAngles[numberOfFields]; -for (int i = 0; i < numberOfFields; ++i) { -sectorAngles[i] = 360.0 * attributeData[i] / sum; -} -vec2 filteredSectorToColorId[numberOfFields]; -FilteredChartInfo filteredInfo = FilteredChartInfo(0.0, 0); -int numOfEntries = filterValues(filteredSectorToColorId, filteredInfo, sectorAngles); -v_numOfEntries = float(numOfEntries); -v_maxSectorAngle = filteredInfo.endSectorAngle; -v_filteredSectorToColorId = filteredSectorToColorId; -#ifdef HITTEST -highp vec3 out_pos = vec3(0.0); -v_color = vec4(0.0); -hittestMarker(v_color, out_pos, viewMat3 * tileMat3 * pos, v_size); -gl_PointSize = 1.0; -gl_Position = vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0); -#else -gl_Position = vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0); -#endif -}`},shared:{line:{"common.glsl":`#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && defined(PATTERN) -uniform mediump vec2 u_mosaicSize; -varying mediump float v_sampleAlphaOnly; -#endif -struct LineData { -lowp vec4 color; -mediump vec2 normal; -mediump float lineHalfWidth; -lowp float opacity; -#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#ifdef PATTERN -mediump vec4 tlbr; -mediump vec2 patternSize; -#endif -#ifdef SDF -mediump float lineWidthRatio; -#endif -#if defined(PATTERN) || defined(SDF) -highp float accumulatedDistance; -#endif -#endif -highp vec3 id; -};`,"line.frag":`uniform lowp float u_blur; -#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && !defined(HIGHLIGHT) -#if defined(PATTERN) || defined(SDF) -uniform sampler2D u_texture; -uniform highp float u_pixelRatio; -#endif -#endif -#if defined(SDF) && !defined(HIGHLIGHT) && !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) -lowp vec4 getLineColor(LineData line) { -mediump float adjustedPatternWidth = line.patternSize.x * 2.0 * line.lineWidthRatio; -mediump float relativeTexX = fract(line.accumulatedDistance / adjustedPatternWidth); -mediump float relativeTexY = 0.5 + 0.25 * line.normal.y; -mediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY)); -mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5; -float dist = d * line.lineHalfWidth; -return line.opacity * clamp(0.5 - dist, 0.0, 1.0) * line.color; -} -#elif defined(PATTERN) && !defined(HIGHLIGHT) && !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) -lowp vec4 getLineColor(LineData line) { -mediump float lineHalfWidth = line.lineHalfWidth; -mediump float adjustedPatternHeight = line.patternSize.y * 2.0 * lineHalfWidth / line.patternSize.x; -mediump float relativeTexY = fract(line.accumulatedDistance / adjustedPatternHeight); -mediump float relativeTexX = 0.5 + 0.5 * line.normal.y; -mediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY)); -lowp vec4 color = texture2D(u_texture, texCoord); -#ifdef VV_COLOR -if (v_sampleAlphaOnly > 0.5) { -color.rgb = vec3(color.a); -} -#endif -return line.opacity * line.color * color; -} -#else -lowp vec4 getLineColor(LineData line) { -return line.opacity * line.color; -} -#endif -vec4 shadeLine(LineData line) -{ -mediump float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(line.lineHalfWidth, THIN_LINE_HALF_WIDTH), 1.0); -mediump float fragDist = length(line.normal) * line.lineHalfWidth; -lowp float alpha = clamp(thinLineFactor * (line.lineHalfWidth - fragDist) / (u_blur + thinLineFactor - 1.0), 0.0, 1.0); -lowp vec4 out_color = getLineColor(line) * alpha; -#ifdef HIGHLIGHT -out_color.a = step(1.0 / 255.0, out_color.a); -#endif -#ifdef ID -if (out_color.a < 1.0 / 255.0) { -discard; -} -out_color = vec4(line.id, 0.0); -#endif -return out_color; -}`,"line.vert":`float getBaseLineHalfWidth(in float lineHalfWidth, in float referenceHalfWidth) { -#ifdef VV_SIZE -float refLineWidth = 2.0 * referenceHalfWidth; -return 0.5 * (lineHalfWidth / max(referenceHalfWidth, EPSILON)) * getSize(refLineWidth); -#else -return lineHalfWidth; -#endif -} -float getLineHalfWidth(in float baseWidth, in float aa) { -float halfWidth = max(baseWidth + aa, 0.45) + 0.1 * aa; -#ifdef HIGHLIGHT -halfWidth = max(halfWidth, 2.0); -#endif -return halfWidth; -} -vec2 getDist(in vec2 offset, in float halfWidth) { -float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(halfWidth, THIN_LINE_HALF_WIDTH), 1.0); -return thinLineFactor * halfWidth * offset; -} -LineData buildLine( -out vec3 out_pos, -in vec3 in_id, -in vec2 in_pos, -in vec4 in_color, -in vec2 in_offset, -in vec2 in_normal, -in float in_accumulatedDist, -in float in_lineHalfWidth, -in float in_bitSet, -in vec4 in_tlbr, -in vec2 in_segmentDirection, -in float in_referenceHalfWidth -) -{ -float aa = 0.5 * u_antialiasing; -float baseWidth = getBaseLineHalfWidth(in_lineHalfWidth, in_referenceHalfWidth); -float halfWidth = getLineHalfWidth(baseWidth, aa); -float z = 2.0 * step(baseWidth, 0.0); -vec2 dist = getDist(in_offset, halfWidth); -vec3 offset = u_displayViewMat3 * vec3(dist, 0.0); -vec3 pos = u_dvsMat3 * vec3(in_pos * POSITION_PRECISION, 1.0) + offset; -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -vec4 color = in_color; -float opacity = 1.0; -#else -vec4 color = getColor(in_color, in_bitSet, BITSET_GENERIC_LOCK_COLOR); -float opacity = getOpacity(); -#ifdef SDF -const float SDF_PATTERN_HALF_WIDTH = 15.5; -float scaleDash = getBit(in_bitSet, BITSET_LINE_SCALE_DASH); -float lineWidthRatio = (scaleDash * max(halfWidth - 0.55 * u_antialiasing, 0.25) + (1.0 - scaleDash)) / SDF_PATTERN_HALF_WIDTH; -#endif -#endif -#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && defined(PATTERN) -v_sampleAlphaOnly = getBit(in_bitSet, BITSET_GENERIC_CONSIDER_ALPHA_ONLY); -#endif -out_pos = vec3(pos.xy, z); -return LineData( -color, -in_normal, -halfWidth, -opacity, -#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#ifdef PATTERN -in_tlbr / u_mosaicSize.xyxy, -vec2(in_tlbr.z - in_tlbr.x, in_tlbr.w - in_tlbr.y), -#endif -#ifdef SDF -lineWidthRatio, -#endif -#if defined(PATTERN) || defined(SDF) -in_accumulatedDist * u_zoomFactor + dot(in_segmentDirection, dist), -#endif -#endif -norm(in_id) -); -}`}},"symbologyTypeUtils.glsl":`#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL || SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE -#define SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#endif -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_SIMPLE || SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE -#define SYMBOLOGY_TYPE_IS_SIMPLE_LIKE -#endif`,text:{"common.glsl":`uniform highp vec2 u_mosaicSize; -varying highp vec3 v_id; -varying mediump vec3 v_pos; -varying lowp float v_opacity; -varying lowp vec4 v_color; -varying highp vec2 v_tex; -varying mediump float v_antialiasingWidth; -varying mediump float v_edgeDistanceOffset; -varying lowp float v_transparency;`,"hittest.glsl":"#include ","text.frag":`precision mediump float; -#include -uniform lowp sampler2D u_texture; -#ifdef HITTEST -vec4 getColor() { -return v_color; -} -#else -vec4 getColor() -{ -float SDF_CUTOFF = (2.0 / 8.0); -float SDF_BASE_EDGE_DIST = 1.0 - SDF_CUTOFF; -lowp float dist = texture2D(u_texture, v_tex).a; -mediump float edge = SDF_BASE_EDGE_DIST - v_edgeDistanceOffset; -#ifdef HIGHLIGHT -edge /= 2.0; -#endif -lowp float aa = v_antialiasingWidth; -lowp float alpha = smoothstep(edge - aa, edge + aa, dist); -return alpha * v_color * v_opacity; -} -#endif -void main() -{ -gl_FragColor = getColor(); -}`,"text.vert":`precision highp float; -#include -#include -#include -#include -attribute vec4 a_color; -attribute vec4 a_haloColor; -attribute vec4 a_texFontSize; -attribute vec4 a_aux; -attribute vec2 a_zoomRange; -attribute vec2 a_vertexOffset; -attribute vec2 a_texCoords; -uniform float u_isHaloPass; -uniform float u_isBackgroundPass; -float getTextSize(inout vec2 offset, inout float baseSize, in float referenceSize) { -#ifdef VV_SIZE -float r = getSize(referenceSize) / referenceSize; -baseSize *= r; -offset.xy *= r; -return baseSize; -#endif -return baseSize; -} -void main() -{ -INIT; -float a_isBackground = a_aux.y; -float a_referenceSize = a_aux.z * a_aux.z / 256.0; -float a_bitSet = a_aux.w; -float a_fontSize = a_texFontSize.z; -vec2 a_offset = a_vertexOffset * OFFSET_PRECISION; -vec3 in_pos = vec3(a_pos * POSITION_PRECISION, 1.0); -float fontSize = getTextSize(a_offset, a_fontSize, a_referenceSize); -float fontScale = fontSize / SDF_FONT_SIZE; -vec3 offset = getRotation() * vec3(a_offset, 0.0); -mat3 extrudeMatrix = getBit(a_bitSet, 0) == 1.0 ? u_displayViewMat3 : u_displayMat3; -float isText = 1.0 - a_isBackground; -float isBackground = u_isBackgroundPass * a_isBackground; -vec4 nonHaloColor = (isBackground * a_color) + (isText * getColor(a_color, a_bitSet, 1)); -v_color = u_isHaloPass * a_haloColor + (1.0 - u_isHaloPass) * nonHaloColor; -v_opacity = getOpacity(); -v_id = norm(a_id); -v_tex = a_texCoords / u_mosaicSize; -v_pos = u_dvsMat3 * in_pos + extrudeMatrix * offset; -float isHidden = u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground; -v_pos.z += 2.0 * isHidden; -v_edgeDistanceOffset = u_isHaloPass * OUTLINE_SCALE * a_texFontSize.w / fontScale / MAX_SDF_DISTANCE; -v_antialiasingWidth = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio; -#ifdef HITTEST -highp vec3 out_pos = vec3(0.); -v_color = vec4(0.); -hittestMarker(v_color, out_pos, u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0) -+ u_tileMat3 * offset, fontSize / 2.); -gl_PointSize = 1.; -gl_Position = vec4(clip(v_color, out_pos, getFilterFlags(), a_zoomRange), 1.0); -#else -gl_Position = vec4(clip(v_color, v_pos, getFilterFlags(), a_zoomRange), 1.0); -#endif -}`},"utils.glsl":`float rshift(in float u32, in int amount) { -return floor(u32 / pow(2.0, float(amount))); -} -float getBit(in float bitset, in int bitIndex) { -float offset = pow(2.0, float(bitIndex)); -return mod(floor(bitset / offset), 2.0); -} -const int maxHighlightReasons = 6; -float getFilterBit(in float bitset, in int bitIndex) { -return getBit(bitset, bitIndex + maxHighlightReasons); -} -float getHighlightBit(in float bitset, in int bitIndex) { -return getBit(bitset, bitIndex); -} -highp vec3 unpackDisplayIdTexel(in highp vec3 bitset) { -float isAggregate = getBit(bitset.b, 7); -return (1.0 - isAggregate) * bitset + isAggregate * (vec3(bitset.rgb) - vec3(0.0, 0.0, float(0x80))); -} -vec4 unpack(in float u32) { -float r = mod(rshift(u32, 0), 255.0); -float g = mod(rshift(u32, 8), 255.0); -float b = mod(rshift(u32, 16), 255.0); -float a = mod(rshift(u32, 24), 255.0); -return vec4(r, g, b, a); -} -vec3 norm(in vec3 v) { -return v /= 255.0; -} -vec4 norm(in vec4 v) { -return v /= 255.0; -} -float max4(vec4 target) { -return max(max(max(target.x, target.y), target.z), target.w); -} -vec2 unpack_u8_nf32(vec2 bytes) { -return (bytes - 127.0) / 127.0; -} -highp float rand(in vec2 co) { -highp float a = 12.9898; -highp float b = 78.233; -highp float c = 43758.5453; -highp float dt = dot(co, vec2(a,b)); -highp float sn = mod(dt, 3.14); -return fract(sin(sn) * c); -}`,"vcommon.glsl":`#include -#include -#include -#include -#include -attribute vec2 a_pos; -attribute highp vec3 a_id; -uniform highp mat3 displayViewScreenMat3; -uniform highp mat3 displayViewMat3; -uniform highp mat3 displayMat3; -uniform highp mat3 tileMat3; -uniform highp mat3 viewMat3; -uniform highp float pixelRatio; -uniform mediump float zoomFactor; -uniform mediump float antialiasing; -uniform mediump float currentScale; -uniform mediump float currentZoom; -uniform mediump float metersPerSRUnit; -vec4 VV_ADATA = vec4(0.0); -void loadVisualVariableData(inout vec4 target) { -target.rgba = getVisualVariableData(a_id); -} -#ifdef VV -#define INIT loadVisualVariableData(VV_ADATA) -#else -#define INIT -#endif -vec4 getColor(in vec4 a_color, in float a_bitSet, int index) { -#ifdef VV_COLOR -float isColorLocked = getBit(a_bitSet, index); -return getVVColor(VV_ADATA[ATTR_VV_COLOR], a_color, isColorLocked); -#else -return a_color; -#endif -} -float getOpacity() { -#ifdef VV_OPACITY -return getVVOpacity(VV_ADATA[ATTR_VV_OPACITY]); -#else -return 1.0; -#endif -} -float getSize(in float in_size, in float currentScale) { -#ifdef VV_SIZE -return getVVSize(in_size, VV_ADATA[ATTR_VV_SIZE], currentScale); -#else -return in_size; -#endif -} -mat3 getRotation() { -#ifdef VV_ROTATION -return getVVRotationMat3(mod(VV_ADATA[ATTR_VV_ROTATION], 360.0)); -#else -return mat3(1.0); -#endif -} -float getFilterFlags() { -#ifdef IGNORES_SAMPLER_PRECISION -return ceil(getFilterData(a_id).x * 255.0); -#else -return getFilterData(a_id).x * 255.0; -#endif -} -vec4 getAnimationState() { -return getAnimation(a_id); -} -float getMinZoom() { -vec4 data0 = getFilterData(a_id) * 255.0; -return data0.g; -} -mat3 getMatrixNoDisplay(float isMapAligned) { -return isMapAligned * viewMat3 * tileMat3 + (1.0 - isMapAligned) * tileMat3; -} -mat3 getMatrix(float isMapAligned) { -return isMapAligned * displayViewMat3 + (1.0 - isMapAligned) * displayMat3; -} -float checkHighlightBit(float filterFlags, int index) { -return getHighlightBit(filterFlags, index); -} -float checkHighlight(float filterFlags) { -float result = checkHighlightBit(filterFlags, 0); -for (int i = 1; i < maxHighlightReasons; i++) { -result = result + checkHighlightBit(filterFlags, i); -} -return step(0.1, result); -} -vec3 clip(inout vec4 color, inout vec3 pos, in float filterFlags, in vec2 minMaxZoom) { -pos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 0)); -#ifdef inside -pos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 1)); -#elif defined(outside) -pos.z += 2.0 * getFilterBit(filterFlags, 1); -#elif defined(highlight) -#if !defined(highlight_all) -pos.z += 2.0 * (1.0 - checkHighlight(filterFlags)); -#endif -#endif -pos.z += 2.0 * (step(minMaxZoom.y, currentZoom) + (1.0 - step(minMaxZoom.x, currentZoom))); -return pos; -}`,"vv.glsl":`#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE) -#define VV_SIZE -#endif -#if defined(VV_COLOR) || defined(VV_SIZE) || defined(VV_OPACITY) || defined(VV_ROTATION) -#define VV -#endif -#ifdef VV_COLOR -uniform highp float colorValues[8]; -uniform vec4 colors[8]; -#endif -#ifdef VV_SIZE_MIN_MAX_VALUE -uniform highp vec4 minMaxValueAndSize; -#endif -#ifdef VV_SIZE_SCALE_STOPS -uniform highp float values[8]; -uniform float sizes[8]; -#endif -#ifdef VV_SIZE_FIELD_STOPS -uniform highp float values[8]; -uniform float sizes[8]; -#endif -#ifdef VV_SIZE_UNIT_VALUE -uniform highp float unitMeterRatio; -#endif -#ifdef VV_OPACITY -uniform highp float opacityValues[8]; -uniform float opacities[8]; -#endif -#ifdef VV_ROTATION -uniform lowp float rotationType; -#endif -bool isNan(float val) { -return (val == NAN_MAGIC_NUMBER); -} -#ifdef VV_SIZE_MIN_MAX_VALUE -float getVVMinMaxSize(float sizeValue, float fallback) { -if (isNan(sizeValue)) { -return fallback; -} -float interpolationRatio = (sizeValue - minMaxValueAndSize.x) / (minMaxValueAndSize.y - minMaxValueAndSize.x); -interpolationRatio = clamp(interpolationRatio, 0.0, 1.0); -return minMaxValueAndSize.z + interpolationRatio * (minMaxValueAndSize.w - minMaxValueAndSize.z); -} -#endif -#ifdef VV_SIZE_SCALE_STOPS -float getVVScaleStopsSize(float currentScale) { -float outSize; -if (currentScale <= values[0]) { -outSize = sizes[0]; -} else { -if (currentScale >= values[7]) { -outSize = sizes[7]; -} else { -int index; -index = -1; -for (int i = 0; i < 8; i++) { -if (values[i] > currentScale) { -index = i; -break; -} -} -int prevIndex = index - 1; -float a = currentScale - values[prevIndex]; -float b = values[index] - values[prevIndex]; -outSize = mix(sizes[prevIndex], sizes[index], a / b); -} -} -return outSize; -} -#endif -#ifdef VV_SIZE_FIELD_STOPS -const int VV_SIZE_N = 8; -float getVVStopsSize(float sizeValue, float fallback) { -if (isNan(sizeValue)) { -return fallback; -} -if (sizeValue <= values[0]) { -return sizes[0]; -} -if (sizeValue >= values[VV_SIZE_N - 1]) { -return sizes[VV_SIZE_N - 1]; -} -for (int i = 1; i < VV_SIZE_N; ++i) { -if (values[i] >= sizeValue) { -float f = (sizeValue - values[i-1]) / (values[i] - values[i-1]); -return mix(sizes[i-1], sizes[i], f); -} -} -return sizes[VV_SIZE_N - 1]; -} -#endif -#ifdef VV_SIZE_UNIT_VALUE -float getVVUnitValue(float sizeValue, float fallback) { -if (isNan(sizeValue)) { -return fallback; -} -return sizeValue * (metersPerSRUnit / unitMeterRatio); -} -#endif -#ifdef VV_OPACITY -const int VV_OPACITY_N = 8; -float getVVOpacity(float opacityValue) { -if (isNan(opacityValue)) { -return 1.0; -} -if (opacityValue <= opacityValues[0]) { -return opacities[0]; -} -for (int i = 1; i < VV_OPACITY_N; ++i) { -if (opacityValues[i] >= opacityValue) { -float f = (opacityValue - opacityValues[i-1]) / (opacityValues[i] - opacityValues[i-1]); -return mix(opacities[i-1], opacities[i], f); -} -} -return opacities[VV_OPACITY_N - 1]; -} -#endif -#ifdef VV_ROTATION -mat4 getVVRotation(float rotationValue) { -if (isNan(rotationValue)) { -return mat4(1, 0, 0, 0, -0, 1, 0, 0, -0, 0, 1, 0, -0, 0, 0, 1); -} -float rotation = rotationValue; -if (rotationType == 1.0) { -rotation = 90.0 - rotation; -} -float angle = C_DEG_TO_RAD * rotation; -float sinA = sin(angle); -float cosA = cos(angle); -return mat4(cosA, sinA, 0, 0, --sinA, cosA, 0, 0, -0, 0, 1, 0, -0, 0, 0, 1); -} -mat3 getVVRotationMat3(float rotationValue) { -if (isNan(rotationValue)) { -return mat3(1, 0, 0, -0, 1, 0, -0, 0, 1); -} -float rotation = rotationValue; -if (rotationType == 1.0) { -rotation = 90.0 - rotation; -} -float angle = C_DEG_TO_RAD * -rotation; -float sinA = sin(angle); -float cosA = cos(angle); -return mat3(cosA, -sinA, 0, -sinA, cosA, 0, -0, 0, 1); -} -#endif -#ifdef VV_COLOR -const int VV_COLOR_N = 8; -vec4 getVVColor(float colorValue, vec4 fallback, float isColorLocked) { -if (isNan(colorValue) || isColorLocked == 1.0) { -return fallback; -} -if (colorValue <= colorValues[0]) { -return colors[0]; -} -for (int i = 1; i < VV_COLOR_N; ++i) { -if (colorValues[i] >= colorValue) { -float f = (colorValue - colorValues[i-1]) / (colorValues[i] - colorValues[i-1]); -return mix(colors[i-1], colors[i], f); -} -} -return colors[VV_COLOR_N - 1]; -} -#endif -float getVVSize(in float size, in float vvSize, in float currentScale) { -#ifdef VV_SIZE_MIN_MAX_VALUE -return getVVMinMaxSize(vvSize, size); -#elif defined(VV_SIZE_SCALE_STOPS) -float outSize = getVVScaleStopsSize(currentScale); -return isNan(outSize) ? size : outSize; -#elif defined(VV_SIZE_FIELD_STOPS) -float outSize = getVVStopsSize(vvSize, size); -return isNan(outSize) ? size : outSize; -#elif defined(VV_SIZE_UNIT_VALUE) -return getVVUnitValue(vvSize, size); -#else -return size; -#endif -}`},"post-processing":{blit:{"blit.frag":`precision mediump float; -uniform sampler2D u_texture; -varying vec2 v_uv; -void main() { -gl_FragColor = texture2D(u_texture, v_uv); -}`},bloom:{composite:{"composite.frag":`precision mediump float; -varying vec2 v_uv; -uniform sampler2D u_blurTexture1; -uniform sampler2D u_blurTexture2; -uniform sampler2D u_blurTexture3; -uniform sampler2D u_blurTexture4; -uniform sampler2D u_blurTexture5; -uniform float u_bloomStrength; -uniform float u_bloomRadius; -uniform float u_bloomFactors[NUMMIPS]; -uniform vec3 u_bloomTintColors[NUMMIPS]; -float lerpBloomFactor(const in float factor) { -float mirrorFactor = 1.2 - factor; -return mix(factor, mirrorFactor, u_bloomRadius); -} -void main() { -vec4 color = u_bloomStrength * ( -lerpBloomFactor(u_bloomFactors[0]) * vec4(u_bloomTintColors[0], 1.0) * texture2D(u_blurTexture1, v_uv) + -lerpBloomFactor(u_bloomFactors[1]) * vec4(u_bloomTintColors[1], 1.0) * texture2D(u_blurTexture2, v_uv) + -lerpBloomFactor(u_bloomFactors[2]) * vec4(u_bloomTintColors[2], 1.0) * texture2D(u_blurTexture3, v_uv) + -lerpBloomFactor(u_bloomFactors[3]) * vec4(u_bloomTintColors[3], 1.0) * texture2D(u_blurTexture4, v_uv) + -lerpBloomFactor(u_bloomFactors[4]) * vec4(u_bloomTintColors[4], 1.0) * texture2D(u_blurTexture5, v_uv) -); -gl_FragColor = clamp(color, 0.0, 1.0); -}`},gaussianBlur:{"gaussianBlur.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -uniform vec2 u_texSize; -uniform vec2 u_direction; -varying vec2 v_uv; -#define KERNEL_RADIUS RADIUS -#define SIGMA RADIUS -float gaussianPdf(in float x, in float sigma) { -return 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma; -} -void main() { -vec2 invSize = 1.0 / u_texSize; -float fSigma = float(SIGMA); -float weightSum = gaussianPdf(0.0, fSigma); -vec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum; -for (int i = 1; i < KERNEL_RADIUS; i ++) { -float x = float(i); -float w = gaussianPdf(x, fSigma); -vec2 uvOffset = u_direction * invSize * x; -vec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset); -vec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset); -pixelColorSum += (sample1 + sample2) * w; -weightSum += 2.0 * w; -} -gl_FragColor = pixelColorSum /weightSum; -}`},luminosityHighPass:{"luminosityHighPass.frag":`precision mediump float; -uniform sampler2D u_texture; -uniform vec3 u_defaultColor; -uniform float u_defaultOpacity; -uniform float u_luminosityThreshold; -uniform float u_smoothWidth; -varying vec2 v_uv; -void main() { -vec4 texel = texture2D(u_texture, v_uv); -vec3 luma = vec3(0.299, 0.587, 0.114); -float v = dot(texel.xyz, luma); -vec4 outputColor = vec4(u_defaultColor.rgb, u_defaultOpacity); -float alpha = smoothstep(u_luminosityThreshold, u_luminosityThreshold + u_smoothWidth, v); -gl_FragColor = mix(outputColor, texel, alpha); -}`}},blur:{gaussianBlur:{"gaussianBlur.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -uniform vec2 u_texSize; -uniform vec2 u_direction; -uniform float u_sigma; -varying vec2 v_uv; -#define KERNEL_RADIUS RADIUS -float gaussianPdf(in float x, in float sigma) { -return 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma; -} -void main() { -vec2 invSize = 1.0 / u_texSize; -float fSigma = u_sigma; -float weightSum = gaussianPdf(0.0, fSigma); -vec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum; -for (int i = 1; i < KERNEL_RADIUS; i ++) { -float x = float(i); -float w = gaussianPdf(x, fSigma); -vec2 uvOffset = u_direction * invSize * x; -vec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset); -vec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset); -pixelColorSum += (sample1 + sample2) * w; -weightSum += 2.0 * w; -} -gl_FragColor = pixelColorSum /weightSum; -}`},"radial-blur":{"radial-blur.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -varying vec2 v_uv; -const float sampleDist = 1.0; -const float sampleStrength = 2.2; -void main(void) { -float samples[10]; -samples[0] = -0.08; -samples[1] = -0.05; -samples[2] = -0.03; -samples[3] = -0.02; -samples[4] = -0.01; -samples[5] = 0.01; -samples[6] = 0.02; -samples[7] = 0.03; -samples[8] = 0.05; -samples[9] = 0.08; -vec2 dir = 0.5 - v_uv; -float dist = sqrt(dir.x * dir.x + dir.y * dir.y); -dir = dir / dist; -vec4 color = texture2D(u_colorTexture,v_uv); -vec4 sum = color; -for (int i = 0; i < 10; i++) { -sum += texture2D(u_colorTexture, v_uv + dir * samples[i] * sampleDist); -} -sum *= 1.0 / 11.0; -float t = dist * sampleStrength; -t = clamp(t, 0.0, 1.0); -gl_FragColor = mix(color, sum, t); -}`}},dra:{"dra.frag":`precision mediump float; -uniform sampler2D u_minColor; -uniform sampler2D u_maxColor; -uniform sampler2D u_texture; -varying vec2 v_uv; -void main() { -vec4 minColor = texture2D(u_minColor, vec2(0.5)); -vec4 maxColor = texture2D(u_maxColor, vec2(0.5)); -vec4 color = texture2D(u_texture, v_uv); -vec3 minColorUnpremultiply = minColor.rgb / minColor.a; -vec3 maxColorUnpremultiply = maxColor.rgb / maxColor.a; -vec3 colorUnpremultiply = color.rgb / color.a; -vec3 range = maxColorUnpremultiply - minColorUnpremultiply; -gl_FragColor = vec4(color.a * (colorUnpremultiply - minColorUnpremultiply) / range, color.a); -}`,"min-max":{"min-max.frag":`#extension GL_EXT_draw_buffers : require -precision mediump float; -#define CELL_SIZE 2 -uniform sampler2D u_minTexture; -uniform sampler2D u_maxTexture; -uniform vec2 u_srcResolution; -uniform vec2 u_dstResolution; -varying vec2 v_uv; -void main() { -vec2 srcPixel = floor(gl_FragCoord.xy) * float(CELL_SIZE); -vec2 onePixel = vec2(1.0) / u_srcResolution; -vec2 uv = (srcPixel + 0.5) / u_srcResolution; -vec4 minColor = vec4(1.0); -vec4 maxColor = vec4(0.0); -for (int y = 0; y < CELL_SIZE; ++y) { -for (int x = 0; x < CELL_SIZE; ++x) { -vec2 offset = uv + vec2(x, y) * onePixel; -minColor = min(minColor, texture2D(u_minTexture, offset)); -maxColor = max(maxColor, texture2D(u_maxTexture, offset)); -} -} -gl_FragData[0] = minColor; -gl_FragData[1] = maxColor; -}`}},"drop-shadow":{composite:{"composite.frag":`precision mediump float; -uniform sampler2D u_layerFBOTexture; -uniform sampler2D u_blurTexture; -uniform vec4 u_shadowColor; -uniform vec2 u_shadowOffset; -uniform highp mat3 u_displayViewMat3; -varying vec2 v_uv; -void main() { -vec3 offset = u_displayViewMat3 * vec3(u_shadowOffset, 0.0); -vec4 layerColor = texture2D(u_layerFBOTexture, v_uv); -vec4 blurColor = texture2D(u_blurTexture, v_uv - offset.xy / 2.0); -gl_FragColor = ((1.0 - layerColor.a) * blurColor.a * u_shadowColor + layerColor); -}`}},"edge-detect":{"frei-chen":{"frei-chen.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -uniform vec2 u_texSize; -varying vec2 v_uv; -vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); -mat3 G[9]; -const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 ); -const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 ); -const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 ); -const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 ); -const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 ); -const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 ); -const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 ); -const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 ); -const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 ); -void main() { -G[0] = g0, -G[1] = g1, -G[2] = g2, -G[3] = g3, -G[4] = g4, -G[5] = g5, -G[6] = g6, -G[7] = g7, -G[8] = g8; -mat3 I; -float cnv[9]; -vec3 sample; -for (float i = 0.0; i < 3.0; i++) { -for (float j = 0.0; j < 3.0; j++) { -sample = texture2D(u_colorTexture, v_uv + texel * vec2(i - 1.0,j - 1.0)).rgb; -I[int(i)][int(j)] = length(sample); -} -} -for (int i = 0; i < 9; i++) { -float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); -cnv[i] = dp3 * dp3; -} -float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]); -float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M); -gl_FragColor = vec4(vec3(sqrt(M / S)), texture2D(u_colorTexture, v_uv).a); -}`},sobel:{"sobel.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -varying vec2 v_uv; -uniform vec2 u_texSize; -vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); -mat3 G[2]; -const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 ); -const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 ); -void main() { -mat3 I; -float cnv[2]; -vec3 sample; -G[0] = g0; -G[1] = g1; -for (float i = 0.0; i < 3.0; i++) { -for (float j = 0.0; j < 3.0; j++) { -sample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb; -I[int(i)][int(j)] = length(sample); -} -} -for (int i = 0; i < 2; i++) { -float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); -cnv[i] = dp3 * dp3; -} -gl_FragColor = vec4(vec3(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1])), texture2D(u_colorTexture, v_uv).a); -}`}},"edge-enhance":{"edge-enhance.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -varying vec2 v_uv; -uniform vec2 u_texSize; -vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); -mat3 G[2]; -const mat3 g0 = mat3( 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0 ); -const mat3 g1 = mat3( 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -1.0, -1.0, -1.0 ); -void main() { -mat3 I; -float cnv[2]; -vec3 sample; -G[0] = g0; -G[1] = g1; -for (float i = 0.0; i < 3.0; i++) { -for (float j = 0.0; j < 3.0; j++) { -sample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb; -I[int(i)][int(j)] = length(sample); -} -} -for (int i = 0; i < 2; i++) { -float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); -cnv[i] = dp3 * dp3; -} -vec4 color = texture2D(u_colorTexture, v_uv); -gl_FragColor = vec4(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1]) * color); -}`},filterEffect:{"filterEffect.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -uniform mat4 u_coefficients; -varying vec2 v_uv; -void main() { -vec4 color = texture2D(u_colorTexture, v_uv); -vec4 rgbw = u_coefficients * vec4(color.a > 0.0 ? color.rgb / color.a : vec3(0.0), 1.0); -float a = color.a; -gl_FragColor = vec4(a * rgbw.rgb, a); -}`},pp:{"pp.vert":`precision mediump float; -attribute vec2 a_position; -varying vec2 v_uv; -void main() { -gl_Position = vec4(a_position, 0.0, 1.0); -v_uv = (a_position + 1.0) / 2.0; -}`}},raster:{bitmap:{"bitmap.frag":`precision mediump float; -varying highp vec2 v_texcoord; -uniform sampler2D u_texture; -uniform highp vec2 u_coordScale; -uniform lowp float u_opacity; -#include -void main() { -#ifdef BICUBIC -vec4 color = sampleBicubicBSpline(u_texture, v_texcoord, u_coordScale); -#else -vec4 color = texture2D(u_texture, v_texcoord); -#endif -gl_FragColor = vec4(color.rgb * u_opacity, color.a * u_opacity); -}`,"bitmap.vert":`precision mediump float; -attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -varying highp vec2 v_texcoord; -void main() -{ -v_texcoord = a_pos; -gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); -}`},common:{"common.glsl":`uniform sampler2D u_image; -uniform int u_bandCount; -uniform bool u_flipY; -uniform float u_opacity; -uniform int u_resampling; -uniform vec2 u_srcImageSize; -#ifdef APPLY_PROJECTION -#include -#endif -#ifdef BICUBIC -#include -#endif -#ifdef BILINEAR -#include -#endif -vec2 getPixelLocation(vec2 coords) { -vec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords; -#ifdef APPLY_PROJECTION -targetLocation = projectPixelLocation(targetLocation); -#endif -return targetLocation; -} -bool isOutside(vec2 coords){ -if (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) { -return true; -} else { -return false; -} -} -vec4 getPixel(vec2 pixelLocation) { -#ifdef BICUBIC -vec4 color = sampleBicubicBSpline(u_image, pixelLocation, u_srcImageSize); -#elif defined(BILINEAR) -vec4 color = sampleBilinear(u_image, pixelLocation, u_srcImageSize); -#else -vec4 color = texture2D(u_image, pixelLocation); -#endif -return color; -}`,"common.vert":`precision mediump float; -attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -uniform highp float u_scale; -uniform highp vec2 u_offset; -varying highp vec2 v_texcoord; -void main() -{ -v_texcoord = a_pos * u_scale + u_offset; -gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); -}`,"contrastBrightness.glsl":`uniform float u_contrastOffset; -uniform float u_brightnessOffset; -vec4 adjustContrastBrightness(vec4 currentPixel, bool isFloat) { -vec4 pixelValue = isFloat ? currentPixel * 255.0 : currentPixel; -float maxI = 255.0; -float mid = 128.0; -float c = u_contrastOffset; -float b = u_brightnessOffset; -vec4 v; -if (c > 0.0 && c < 100.0) { -v = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid; -} else if (c <= 0.0 && c > -100.0) { -v = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid; -} else if (c == 100.0) { -v = (200.0 * pixelValue - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b); -v = (sign(v) + 1.0) / 2.0; -} else if (c == -100.0) { -v = vec4(mid, mid, mid, currentPixel.a); -} -vec3 rgb = clamp(v.rgb / 255.0, 0.0, 1.0); -return vec4(rgb, currentPixel.a); -}`,"getSurfaceValues.glsl":`#include -void getSurfaceValues(sampler2D imageTexture, vec2 texCoord, vec2 srcImageSize, inout float values[10]) { -vec2 onePixel = 1.0 / srcImageSize; -vec4 va = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, -1.0))); -vec4 vb = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, -1.0))); -vec4 vc = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, -1.0))); -vec4 vd = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 0.0))); -vec4 ve = texture2D(imageTexture, mirror(texCoord)); -vec4 vf = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 0.0))); -vec4 vg = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 1.0))); -vec4 vh = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, 1.0))); -vec4 vi = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 1.0))); -float alpha = va.a * vb.a * vc.a * vd.a * ve.a * vf.a * vg.a * vh.a * vi.a; -values[0] = va.r; -values[1] = vb.r; -values[2] = vc.r; -values[3] = vd.r; -values[4] = ve.r; -values[5] = vf.r; -values[6] = vg.r; -values[7] = vh.r; -values[8] = vi.r; -values[9] = alpha; -}`,"inverse.glsl":`float invertValue(float value) { -float s = sign(value); -return (s * s) / (value + abs(s) - 1.0); -}`,"mirror.glsl":`vec2 mirror(vec2 pos) { -vec2 pos1 = abs(pos); -return step(pos1, vec2(1.0, 1.0)) * pos1 + step(1.0, pos1) * (2.0 - pos1); -}`,"projection.glsl":`uniform sampler2D u_transformGrid; -uniform vec2 u_transformSpacing; -uniform vec2 u_transformGridSize; -uniform vec2 u_targetImageSize; -vec2 projectPixelLocation(vec2 coords) { -#ifdef LOOKUP_PROJECTION -vec4 pv = texture2D(u_transformGrid, coords); -return vec2(pv.r, pv.g); -#endif -vec2 index_image = floor(coords * u_targetImageSize); -vec2 oneTransformPixel = vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t); -vec2 index_transform = floor(index_image / u_transformSpacing) / u_transformGridSize; -vec2 pos = fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing); -vec2 srcLocation; -vec2 transform_location = index_transform + oneTransformPixel * 0.5; -if (pos.s <= pos.t) { -vec4 ll_abc = texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t)); -vec4 ll_def = texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t)); -srcLocation.s = dot(ll_abc.rgb, vec3(pos, 1.0)); -srcLocation.t = dot(ll_def.rgb, vec3(pos, 1.0)); -} else { -vec4 ur_abc = texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t)); -vec4 ur_def = texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t)); -srcLocation.s = dot(ur_abc.rgb, vec3(pos, 1.0)); -srcLocation.t = dot(ur_def.rgb, vec3(pos, 1.0)); -} -return srcLocation; -}`},flow:{"getFadeOpacity.glsl":`uniform float u_decayRate; -uniform float u_fadeToZero; -float getFadeOpacity(float x) { -float cutOff = mix(0.0, exp(-u_decayRate), u_fadeToZero); -return (exp(-u_decayRate * x) - cutOff) / (1.0 - cutOff); -}`,"getFragmentColor.glsl":`vec4 getFragmentColor(vec4 color, float dist, float size, float featheringSize) { -float featheringStart = clamp(0.5 - featheringSize / size, 0.0, 0.5); -if (dist > featheringStart) { -color *= 1.0 - (dist - featheringStart) / (0.5 - featheringStart); -} -return color; -}`,imagery:{"imagery.frag":`precision highp float; -varying vec2 v_texcoord; -uniform sampler2D u_texture; -uniform float u_Min; -uniform float u_Max; -uniform float u_featheringSize; -#include -float getIntensity(float v) { -return u_Min + v * (u_Max - u_Min); -} -void main(void) { -vec4 sampled = texture2D(u_texture, v_texcoord); -float intensity = getIntensity(sampled.r); -gl_FragColor = getColor(intensity); -gl_FragColor.a *= getOpacity(sampled.r); -gl_FragColor.a *= sampled.a; -gl_FragColor.rgb *= gl_FragColor.a; -}`,"imagery.vert":`attribute vec2 a_position; -attribute vec2 a_texcoord; -uniform mat3 u_dvsMat3; -varying vec2 v_texcoord; -void main(void) { -vec2 xy = (u_dvsMat3 * vec3(a_position, 1.0)).xy; -gl_Position = vec4(xy, 0.0, 1.0); -v_texcoord = a_texcoord; -}`},particles:{"particles.frag":`precision highp float; -varying vec4 v_color; -varying vec2 v_texcoord; -varying float v_size; -uniform float u_featheringSize; -#include -void main(void) { -gl_FragColor = getFragmentColor(v_color, length(v_texcoord - 0.5), v_size, u_featheringSize); -}`,"particles.vert":`attribute vec4 a_xyts0; -attribute vec4 a_xyts1; -attribute vec4 a_typeIdDurationSeed; -attribute vec4 a_extrudeInfo; -uniform mat3 u_dvsMat3; -uniform mat3 u_displayViewMat3; -uniform float u_time; -uniform float u_trailLength; -uniform float u_flowSpeed; -varying vec4 v_color; -varying vec2 v_texcoord; -varying float v_size; -uniform float u_featheringSize; -uniform float u_introFade; -#include -#include -void main(void) { -vec2 position0 = a_xyts0.xy; -float t0 = a_xyts0.z; -float speed0 = a_xyts0.w; -vec2 position1 = a_xyts1.xy; -float t1 = a_xyts1.z; -float speed1 = a_xyts1.w; -float type = a_typeIdDurationSeed.x; -float id = a_typeIdDurationSeed.y; -float duration = a_typeIdDurationSeed.z; -float seed = a_typeIdDurationSeed.w; -vec2 e0 = a_extrudeInfo.xy; -vec2 e1 = a_extrudeInfo.zw; -float animationPeriod = duration + u_trailLength; -float scaledTime = u_time * u_flowSpeed; -float randomizedTime = scaledTime + seed * animationPeriod; -float t = mod(randomizedTime, animationPeriod); -float fUnclamped = (t - t0) / (t1 - t0); -float f = clamp(fUnclamped, 0.0, 1.0); -float clampedTime = mix(t0, t1, f); -float speed = mix(speed0, speed1, f); -vec2 extrude; -vec2 position; -float fadeOpacity; -float introOpacity; -if (type == 2.0) { -if (fUnclamped < 0.0 || (fUnclamped > 1.0 && t1 != duration)) { -gl_Position = vec4(0.0, 0.0, -2.0, 1.0); -return; -} -vec2 ortho = mix(e0, e1, f); -vec2 parallel; -parallel = normalize(position1 - position0) * 0.5; -if (id == 1.0) { -extrude = ortho; -v_texcoord = vec2(0.5, 0.0); -} else if (id == 2.0) { -extrude = -ortho; -v_texcoord = vec2(0.5, 1.0); -} else if (id == 3.0) { -extrude = ortho + parallel; -v_texcoord = vec2(1.0, 0.0); -} else if (id == 4.0) { -extrude = -ortho + parallel; -v_texcoord = vec2(1.0, 1.0); -} -fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); -introOpacity = 1.0 - exp(-clampedTime); -v_size = getSize(speed); -v_color = getColor(speed); -v_color.a *= getOpacity(speed); -position = mix(position0, position1, f); -} else { -if (fUnclamped < 0.0) { -gl_Position = vec4(0.0, 0.0, -2.0, 1.0); -return; -} -if (id == 1.0) { -extrude = e0; -v_texcoord = vec2(0.5, 0.0); -fadeOpacity = getFadeOpacity((t - t0) / u_trailLength); -introOpacity = 1.0 - exp(-t0); -v_size = getSize(speed0); -v_color = getColor(speed0); -v_color.a *= getOpacity(speed0); -position = position0; -} else if (id == 2.0) { -extrude = -e0; -v_texcoord = vec2(0.5, 1.0); -fadeOpacity = getFadeOpacity((t - t0) / u_trailLength); -introOpacity = 1.0 - exp(-t0); -v_size = getSize(speed0); -v_color = getColor(speed0); -v_color.a *= getOpacity(speed0); -position = position0; -} else if (id == 3.0) { -extrude = mix(e0, e1, f); -v_texcoord = vec2(0.5, 0.0); -fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); -introOpacity = 1.0 - exp(-clampedTime); -v_size = getSize(speed); -v_color = getColor(speed); -v_color.a *= getOpacity(speed); -position = mix(position0, position1, f); -} else if (id == 4.0) { -extrude = -mix(e0, e1, f); -v_texcoord = vec2(0.5, 1.0); -fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); -introOpacity = 1.0 - exp(-clampedTime); -v_size = getSize(speed); -v_color = getColor(speed); -v_color.a *= getOpacity(speed); -position = mix(position0, position1, f); -} -} -vec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(extrude * v_size, 0.0)).xy; -gl_Position = vec4(xy, 0.0, 1.0); -v_color.a *= fadeOpacity; -v_color.a *= mix(1.0, introOpacity, u_introFade); -v_color.rgb *= v_color.a; -}`},streamlines:{"streamlines.frag":`precision highp float; -varying float v_side; -varying float v_time; -varying float v_totalTime; -varying float v_timeSeed; -varying vec4 v_color; -varying float v_size; -uniform float u_time; -uniform float u_trailLength; -uniform float u_flowSpeed; -uniform float u_featheringSize; -uniform float u_introFade; -#include -#include -void main(void) { -float t = mod(v_timeSeed * (v_totalTime + u_trailLength) + u_time * u_flowSpeed, v_totalTime + u_trailLength) - v_time; -vec4 color = v_color * step(0.0, t) * getFadeOpacity(t / u_trailLength); -color *= mix(1.0, 1.0 - exp(-v_time), u_introFade); -gl_FragColor = getFragmentColor(color, length((v_side + 1.0) / 2.0 - 0.5), v_size, u_featheringSize); -}`,"streamlines.vert":`attribute vec3 a_positionAndSide; -attribute vec3 a_timeInfo; -attribute vec2 a_extrude; -attribute float a_speed; -uniform mat3 u_dvsMat3; -uniform mat3 u_displayViewMat3; -varying float v_time; -varying float v_totalTime; -varying float v_timeSeed; -varying vec4 v_color; -varying float v_side; -varying float v_size; -uniform float u_featheringSize; -#include -void main(void) { -vec4 lineColor = getColor(a_speed); -float lineOpacity = getOpacity(a_speed); -float lineSize = getSize(a_speed); -vec2 position = a_positionAndSide.xy; -v_side = a_positionAndSide.z; -vec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(a_extrude * lineSize, 0.0)).xy; -gl_Position = vec4(xy, 0.0, 1.0); -v_time = a_timeInfo.x; -v_totalTime = a_timeInfo.y; -v_timeSeed = a_timeInfo.z; -v_color = lineColor; -v_color.a *= lineOpacity; -v_color.rgb *= v_color.a; -v_size = lineSize; -}`},"vv.glsl":`#define MAX_STOPS 8 -#ifdef VV_COLOR -uniform float u_color_stops[MAX_STOPS]; -uniform vec4 u_color_values[MAX_STOPS]; -uniform int u_color_count; -#else -uniform vec4 u_color; -#endif -#ifdef VV_OPACITY -uniform float u_opacity_stops[MAX_STOPS]; -uniform float u_opacity_values[MAX_STOPS]; -uniform int u_opacity_count; -#else -uniform float u_opacity; -#endif -#ifdef VV_SIZE -uniform float u_size_stops[MAX_STOPS]; -uniform float u_size_values[MAX_STOPS]; -uniform int u_size_count; -#else -uniform float u_size; -#endif -uniform float u_featheringOffset; -vec4 getColor(float x) { -#ifdef VV_COLOR -vec4 color = u_color_values[0]; -{ -for (int i = 1; i < MAX_STOPS; i++) { -if (i >= u_color_count) { -break; -} -float x1 = u_color_stops[i - 1]; -if (x < x1) { -break; -} -float x2 = u_color_stops[i]; -vec4 y2 = u_color_values[i]; -if (x < x2) { -vec4 y1 = u_color_values[i - 1]; -color = y1 + (y2 - y1) * (x - x1) / (x2 - x1); -} else { -color = y2; -} -} -} -#else -vec4 color = u_color; -#endif -return color; -} -float getOpacity(float x) { -#ifdef VV_OPACITY -float opacity = u_opacity_values[0]; -{ -for (int i = 1; i < MAX_STOPS; i++) { -if (i >= u_opacity_count) { -break; -} -float x1 = u_opacity_stops[i - 1]; -if (x < x1) { -break; -} -float x2 = u_opacity_stops[i]; -float y2 = u_opacity_values[i]; -if (x < x2) { -float y1 = u_opacity_values[i - 1]; -opacity = y1 + (y2 - y1) * (x - x1) / (x2 - x1); -} else { -opacity = y2; -} -} -} -#else -float opacity = u_opacity; -#endif -return opacity; -} -float getSize(float x) { -#ifdef VV_SIZE -float size = u_size_values[0]; -{ -for (int i = 1; i < MAX_STOPS; i++) { -if (i >= u_size_count) { -break; -} -float x1 = u_size_stops[i - 1]; -if (x < x1) { -break; -} -float x2 = u_size_stops[i]; -float y2 = u_size_values[i]; -if (x < x2) { -float y1 = u_size_values[i - 1]; -size = y1 + (y2 - y1) * (x - x1) / (x2 - x1); -} else { -size = y2; -} -} -} -#else -float size = u_size; -#endif -return size + 2.0 * u_featheringSize * u_featheringOffset; -}`},hillshade:{"hillshade.frag":`precision mediump float; -varying highp vec2 v_texcoord; -#include -uniform int u_hillshadeType; -uniform float u_sinZcosAs[6]; -uniform float u_sinZsinAs[6]; -uniform float u_cosZs[6]; -uniform float u_weights[6]; -uniform vec2 u_factor; -uniform float u_minValue; -uniform float u_maxValue; -uniform float u_scaling; -#include -#include -vec3 rgb2hsv(vec3 c) { -vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); -vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); -vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); -float d = q.x - min(q.w, q.y); -float e = 1.0e-10; -return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); -} -vec3 hsv2rgb(vec3 c) { -vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); -return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); -} -vec4 overlay(float val, float minValue, float maxValue, float hillshade) { -val = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0); -vec4 rgb = colorize(vec4(val, val, val, 1.0), 255.0); -vec3 hsv = rgb2hsv(rgb.xyz); -hsv.z = hillshade; -return vec4(hsv2rgb(hsv) * u_scaling, 1.0) * rgb.a; -} -void main() { -vec2 pixelLocation = getPixelLocation(v_texcoord); -if (isOutside(pixelLocation)) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -return; -} -vec4 currentPixel = getPixel(pixelLocation); -if (currentPixel.a == 0.0) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -return; -} -float pv[10]; -getSurfaceValues(u_image, pixelLocation, u_srcImageSize, pv); -float alpha = pv[9]; -float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * u_factor.s; -float dzy = (pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * u_factor.t; -float dzd = sqrt(1.0 + dzx * dzx + dzy * dzy); -float hillshade = 0.0; -if (u_hillshadeType == 0){ -float cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx; -float z = (u_cosZs[0] + cosDelta) / dzd; -if (z < 0.0) z = 0.0; -hillshade = z; -} else { -for (int k = 0; k < 6; k++) { -float cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx; -float z = (u_cosZs[k] + cosDelta) / dzd; -if (z < 0.0) z = 0.0; -hillshade = hillshade + z * u_weights[k]; -if (k == 5) break; -} -} -#ifdef APPLY_COLORMAP -vec4 result = overlay(pv[4], u_minValue, u_maxValue, hillshade) * alpha * u_opacity; -#else -hillshade *= u_scaling; -vec4 result = vec4(hillshade, hillshade, hillshade, 1.0) * alpha * u_opacity; -#endif -#ifdef ROUND_OUTPUT -result = vec4(floor(result.xyz + 0.5), result.a); -#endif -gl_FragColor = result; -}`},lut:{"colorize.glsl":`uniform sampler2D u_colormap; -uniform float u_colormapOffset; -uniform float u_colormapMaxIndex; -vec4 colorize(vec4 currentPixel, float scaleFactor) { -float clrIndex = clamp(currentPixel.r * scaleFactor - u_colormapOffset, 0.0, u_colormapMaxIndex); -vec2 clrPosition = vec2((clrIndex + 0.5) / (u_colormapMaxIndex + 1.0), 0.0); -vec4 color = texture2D(u_colormap, clrPosition); -vec4 result = vec4(color.rgb, color.a * currentPixel.a); -return result; -} -vec4 colorizeNoClamp(vec4 currentPixel, float scaleFactor) { -float value = currentPixel.r * scaleFactor - u_colormapOffset; -vec4 result = colorize(currentPixel, scaleFactor); -return result * step(0.0, value) * step(value, u_colormapMaxIndex); -}`,"lut.frag":`precision mediump float; -varying highp vec2 v_texcoord; -#include -#include -void main() { -vec2 pixelLocation = getPixelLocation(v_texcoord); -if (isOutside(pixelLocation)) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -return; -} -vec4 currentPixel = getPixel(pixelLocation); -vec4 result = colorizeNoClamp(currentPixel, 1.0); -gl_FragColor = vec4(result.xyz, 1.0) * result.a * u_opacity; -}`},magdir:{"magdir.frag":`precision mediump float; -varying vec4 v_color; -uniform lowp float u_opacity; -void main() { -gl_FragColor = v_color * u_opacity; -}`,"magdir.vert":`precision mediump float; -attribute vec2 a_pos; -attribute vec2 a_offset; -attribute vec2 a_vv; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -uniform vec2 u_symbolSize; -uniform vec2 u_symbolPercentRange; -uniform vec2 u_dataRange; -uniform float u_rotation; -uniform vec4 u_colors[12]; -varying vec4 v_color; -void main() -{ -float angle = a_offset.y + u_rotation; -#ifndef ROTATION_GEOGRAPHIC -angle = 3.14159265359 * 2.0 - angle - 3.14159265359 / 2.0; -#endif -vec2 offset = vec2(cos(angle), sin(angle)) * a_offset.x; -#ifdef DATA_RANGE -float valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0); -float sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x); -float sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y); -#else -float sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0; -#endif -vec2 pos = a_pos + offset * sizePercentage * u_symbolSize; -v_color = u_colors[int(a_vv.x)]; -gl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0); -}`},reproject:{"reproject.frag":`precision mediump float; -varying vec2 v_texcoord; -#include -void main() { -vec2 pixelLocation = getPixelLocation(v_texcoord); -if (isOutside(pixelLocation)) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); -return; -} -vec4 currentPixel = getPixel(pixelLocation); -gl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity; -}`,"reproject.vert":`precision mediump float; -attribute vec2 a_position; -varying highp vec2 v_texcoord; -void main() -{ -v_texcoord = a_position; -gl_Position = vec4(2.0 * (a_position - 0.5), 0.0, 1.0); -}`},rfx:{aspect:{"aspect.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec2 u_cellSize; -uniform vec2 u_srcImageSize; -#include -const float pi = 3.14159265359; -void main() { -float pv[10]; -getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); -float alpha = pv[9]; -float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) / (8.0 * u_cellSize[0]); -float dzy = -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) / (8.0 * u_cellSize[1]); -alpha *= sign(abs(dzx) + abs(dzy)); -float aspect_rad = (dzx == 0.0) ? (step(0.0, dzy) * 0.5 * pi + step(dzy, 0.0) * 1.5 * pi) : mod((2.5 * pi + atan(dzy, -dzx)), 2.0 * pi); -float aspect = aspect_rad * 180.0 / pi; -gl_FragColor = vec4(aspect, aspect, aspect, 1.0) * alpha; -}`},bandarithmetic:{"bandarithmetic.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform mediump mat3 u_bandIndexMat3; -uniform float u_adjustments[3]; -#include -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec3 pv2 = u_bandIndexMat3 * pv.rgb; -float nir = pv2.r; -float red = pv2.g; -float index; -#ifdef NDXI -index = (nir - red) * invertValue(nir + red); -#elif defined(SR) -index = nir * invertValue(red); -#elif defined(CI) -index = nir * invertValue(red) - 1.0; -#elif defined(SAVI) -index = (nir - red) * invertValue(nir + red + u_adjustments[0]) * (1.0 + u_adjustments[0]); -#elif defined(TSAVI) -float s = u_adjustments[0]; -float a = u_adjustments[1]; -float x = u_adjustments[2]; -float y = -a * s + x * (1.0 + s * s); -index = (s * (nir - s * red - a)) * invertValue(a * nir + red + y); -#elif defined(MSAVI) -float nir2 = 2.0 * nir + 1.0; -index = 0.5 * (nir2 - sqrt(nir2 * nir2 - 8.0 * (nir - red))); -#elif defined(GEMI) -float eta = (2.0 * (nir * nir - red * red) + 1.5 * nir + 0.5 * red) * invertValue(nir + red + 0.5); -index = eta * (1.0 - 0.25 * eta) - (red - 0.125) * invertValue(1.0 - red); -#elif defined(PVI) -float a = u_adjustments[0]; -float b = u_adjustments[1]; -float y = sqrt(1.0 + a * a); -index = (nir - a * red - b) * invertValue(y); -#elif defined(VARI) -index = (pv2.g - pv2.r) * invertValue(pv2.g + pv2.r - pv2.b); -#elif defined(MTVI) -float green = pv2.b; -float v = sqrt(pow((2.0 * nir + 1.0), 2.0) - (6.0 * nir - 5.0 * sqrt(red)) - 0.5); -index = 1.5 * (1.2 * (nir - green) - 2.5 * (red - green)) * invertValue(v); -#elif defined(RTVICORE) -float green = pv2.b; -index = 100.0 * (nir - red) - 10.0 * (nir - green); -#elif defined(EVI) -float blue = pv2.b; -float denom = nir + 6.0 * red - 7.5 * blue + 1.0; -index = (2.5 * (nir - red)) * invertValue(denom); -#elif defined(WNDWI) -float g = pv2.r; -float n = pv2.g; -float s = pv2.b; -float a = u_adjustments[0]; -float denom = g + a * n + (1.0 - a) * s; -index = (g - a * n - (1.0 - a) * s) * invertValue(denom); -#elif defined(BAI) -index = invertValue(pow((0.1 - red), 2.0) + pow((0.06 - nir), 2.0)); -#else -gl_FragColor = pv; -return; -#endif -#ifdef ROUND_OUTPUT -index = floor(index + 0.5); -#endif -gl_FragColor = vec4(index, index, index, pv.a); -}`},colormap2rgb:{"colormap2rgb.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -#include -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec4 result = colorizeNoClamp(vec4(pv.r, pv.r, pv.r, 1.0), 1.0); -gl_FragColor = vec4(result.xyz * 255.0, 1.0) * result.a * pv.a; -}`},compositeband:{"compositeband.frag":`precision mediump float; -uniform sampler2D u_image; -uniform sampler2D u_image1; -uniform sampler2D u_image2; -#ifdef ONE_CONSTANT -uniform float u_image1Const; -#ifdef TWO_CONSTANT -uniform float u_image2Const; -#endif -uniform mat3 u_imageSwap; -#endif -varying vec2 v_texcoord; -void main() { -vec4 pv0 = texture2D(u_image, v_texcoord); -float a = pv0.r; -float alpha = pv0.a; -#ifdef TWO_CONSTANT -float b = u_image1Const; -float c = u_image2Const; -vec3 abc = u_imageSwap * vec3(a, b, c); -a = abc.s; -b = abc.t; -c = abc.p; -#elif defined(ONE_CONSTANT) -vec4 pv1 = texture2D(u_image1, v_texcoord); -float b = pv1.r; -float c = u_image1Const; -vec3 abc = u_imageSwap * vec3(a, b, c); -a = abc.s; -b = abc.t; -c = abc.p; -alpha *= pv1.a; -#else -vec4 pv1 = texture2D(u_image1, v_texcoord); -vec4 pv2 = texture2D(u_image2, v_texcoord); -float b = pv1.r; -float c = pv2.r; -alpha = alpha * pv1.a * pv2.a; -#endif -gl_FragColor = vec4(a, b, c, alpha); -}`},computechange:{"computechange.frag":`precision mediump float; -uniform sampler2D u_image; -uniform sampler2D u_image1; -#ifdef ONE_CONSTANT -uniform float u_image1Const; -uniform mat3 u_imageSwap; -#endif -varying vec2 v_texcoord; -uniform vec2 u_domainRange; -#include -void main() { -vec4 pv0 = texture2D(u_image, v_texcoord); -float a = pv0.r; -#ifdef ONE_CONSTANT -float b = u_image1Const; -vec3 abc = u_imageSwap * vec3(a, b, 0); -a = abc.s; -b = abc.t; -#else -vec4 pv1 = texture2D(u_image1, v_texcoord); -float b = pv1.r; -#endif -float result = a; -float alpha = pv0.a; -#ifdef DIFFERENCE -result = a - b; -#elif defined(RELATIVE) -result = (a - b) * invertValue(max(abs(a), abs(b))); -#endif -bool isInvalid = result < u_domainRange.s || result > u_domainRange.t; -result = isInvalid ? 0.0 : result; -alpha *= float(!isInvalid); -#ifdef ROUND_OUTPUT -result = floor(result + 0.5); -#endif -gl_FragColor = vec4(result, result, result, alpha); -}`},contrast:{"contrast.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -#include -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec4 result = adjustContrastBrightness(pv, false); -gl_FragColor = vec4(floor(result.rgb * 255.0 + 0.5), result.a); -}`},convolution:{"convolution.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec2 u_srcImageSize; -#define KERNEL_SIZE_ROWS ROWS -#define KERNEL_SIZE_COLS COLS -uniform vec2 u_clampRange; -uniform float u_kernel[25]; -#include -void main() { -vec3 rgb = vec3(0.0, 0.0, 0.0); -vec2 resolution = 1.0 / u_srcImageSize; -float rowOffset = -float(floor(float(KERNEL_SIZE_ROWS) / 2.0)); -float colOffset = -float(floor(float(KERNEL_SIZE_COLS) / 2.0)); -float alpha = 1.0; -for (int row = 0; row < KERNEL_SIZE_ROWS; row++) { -float pos_row = rowOffset + float(row); -for (int col = 0; col < KERNEL_SIZE_COLS; col++) { -vec2 pos = v_texcoord + vec2(colOffset + float(col), pos_row) * resolution; -vec4 pv = texture2D(u_image, mirror(pos)); -rgb += pv.rgb * u_kernel[row * KERNEL_SIZE_COLS + col]; -alpha *= pv.a; -} -} -rgb = clamp(rgb, u_clampRange.s, u_clampRange.t); -gl_FragColor = vec4(rgb * alpha, alpha); -}`},curvature:{"curvature.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform float u_zlFactor; -uniform vec2 u_srcImageSize; -#include -void main() { -float pv[10]; -getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); -float alpha = pv[9]; -float d = ((pv[3] + pv[5]) * 0.5 - pv[4]); -float e = ((pv[1] + pv[7]) * 0.5 - pv[4]); -float curvature = 0.0; -#ifdef STANDARD -curvature = -u_zlFactor * (d + e); -gl_FragColor = vec4(curvature, curvature, curvature, alpha); -#else -float f = (-pv[0] + pv[2] + pv[6] - pv[8]) / 4.0; -float g = (-pv[3] + pv[5]) / 2.0; -float h = (pv[1] - pv[7]) / 2.0; -float g2 = g * g; -float h2 = h * h; -#ifdef PROFILE -curvature = (u_zlFactor * (d * g2 + e * h2 + f * g * h)) / (g2 + h2); -#else -curvature = (-u_zlFactor * (d * h2 + e * g2 - f * g * h)) / (g2 + h2); -#endif -#endif -gl_FragColor = vec4(curvature, curvature, curvature, alpha); -}`},extractband:{"extractband.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform mediump mat3 u_bandIndexMat3; -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec3 pv2 = u_bandIndexMat3 * pv.rgb; -gl_FragColor = vec4(pv2, pv.a); -}`},focalstatistics:{"focalstatistics.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec2 u_srcImageSize; -#define KERNEL_SIZE_ROWS ROWS -#define KERNEL_SIZE_COLS COLS -uniform vec2 u_clampRange; -#include -#include -void main() { -vec2 resolution = 1.0 / u_srcImageSize; -float rowOffset = -float(floor(float(KERNEL_SIZE_ROWS) / 2.0)); -float colOffset = -float(floor(float(KERNEL_SIZE_COLS) / 2.0)); -float count = 0.0; -#ifdef STDDEV -vec3 sum = vec3(0.0, 0.0, 0.0); -vec3 sum2 = vec3(0.0, 0.0, 0.0); -#endif -vec4 currentPixel = texture2D(u_image, v_texcoord); -vec3 rgb = currentPixel.rgb; -for (int row = 0; row < KERNEL_SIZE_ROWS; row++) { -float pos_row = rowOffset + float(row); -for (int col = 0; col < KERNEL_SIZE_COLS; col++) { -vec2 pos = v_texcoord + vec2(colOffset + float(col), pos_row) * resolution; -vec4 pv = texture2D(u_image, mirror(pos)); -count += pv.a; -#ifdef MIN -rgb = min(rgb, pv.rgb); -#elif defined(MAX) -rgb = max(rgb, pv.rgb); -#elif defined(MEAN) -rgb += pv.rgb; -#elif defined(STDDEV) -sum += pv.rgb; -sum2 += (pv.rgb * pv.rgb); -#endif -} -} -#ifdef MEAN -rgb *= invertValue(count); -#elif defined(STDDEV) -rgb = sqrt((sum2 - sum * sum * invertValue(count)) * invertValue(count)); -#endif -float alpha = step(0.9999, count); -rgb = clamp(rgb, u_clampRange.s, u_clampRange.t); -#ifdef FILL -rgb = (1.0 - currentPixel.a) * rgb + currentPixel.a * currentPixel.rgb; -#endif -gl_FragColor = vec4(rgb * alpha, alpha); -}`},grayscale:{"grayscale.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec3 u_weights; -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -float value = dot(u_weights, pv.rgb); -gl_FragColor = vec4(value, value, value, pv.a); -}`},local:{"local.frag":`precision highp float; -uniform sampler2D u_image; -uniform sampler2D u_image1; -#ifdef ONE_CONSTANT -uniform float u_image1Const; -#ifdef TWO_CONSTANT -uniform float u_image2Const; -#endif -uniform mat3 u_imageSwap; -#endif -varying vec2 v_texcoord; -uniform vec2 u_domainRange; -#include -void main() { -vec4 pv0 = texture2D(u_image, v_texcoord); -float a = pv0.r; -#ifdef TWO_IMAGES -#ifdef ONE_CONSTANT -float b = u_image1Const; -vec3 abc = u_imageSwap * vec3(a, b, 0); -a = abc.s; -b = abc.t; -#else -vec4 pv1 = texture2D(u_image1, v_texcoord); -float b = pv1.r; -#endif -#elif defined(CONDITIONAL) -#ifdef TWO_CONSTANT -float b = u_image1Const; -float c = u_image2Const; -vec3 abc = u_imageSwap * vec3(a, b, c); -a = abc.s; -b = abc.t; -c = abc.p; -#elif defined(ONE_CONSTANT) -vec4 pv1 = texture2D(u_image1, v_texcoord); -float b = pv1.r; -float c = u_image1Const; -vec3 abc = u_imageSwap * vec3(a, b, c); -a = abc.s; -b = abc.t; -c = abc.p; -#else -vec4 pv1 = texture2D(u_image1, v_texcoord); -vec4 pv2 = texture2D(u_image2, v_texcoord); -float b = pv1.r; -float c = pv2.r; -#endif -#endif -float result = a; -float alpha = pv0.a; -#ifdef PLUS -result = a + b; -#elif defined(MINUS) -result = a - b; -#elif defined(TIMES) -result = a * b; -#elif defined(DIVIDE) -result = a * invertValue(b); -alpha *= float(abs(sign(b))); -#elif defined(FLOATDIVIDE) -result = a * invertValue(b); -alpha *= float(abs(sign(b))); -#elif defined(FLOORDIVIDE) -result = floor(a * invertValue(b)); -alpha *= float(abs(sign(b))); -#elif defined(SQUARE) -result = a * a; -#elif defined(SQRT) -result = sqrt(a); -#elif defined(POWER) -result = pow(a, b); -#elif defined(LN) -result = a <= 0.0 ? 0.0: log(a); -alpha *= float(a > 0.0); -#elif defined(LOG_1_0) -result = a <= 0.0 ? 0.0: log2(a) * invertValue(log2(10.0)); -alpha *= float(a > 0.0); -#elif defined(LOG_2) -result = a <= 0.0 ? 0.0: log2(a); -alpha *= float(a > 0.0); -#elif defined(EXP) -result = exp(a); -#elif defined(EXP_1_0) -result = pow(10.0, a); -#elif defined(EXP_2) -result = pow(2.0, a); -#elif defined(ROUNDDOWN) -result = floor(a); -#elif defined(ROUNDUP) -result = ceil(a); -#elif defined(INT) -result = float(sign(a)) * floor(abs(a)); -#elif defined(MOD) -result = mod(a, b); -#elif defined(NEGATE) -result = -a; -#elif defined(ABS) -result = abs(a); -#elif defined(ACOS) -result = abs(a) > 1.0 ? 0.0: acos(a); -alpha *= step(abs(a), 1.00001); -#elif defined(ACOSH) -result = acosh(a); -#elif defined(ASIN) -result = abs(a) > 1.0 ? 0.0: asin(a); -alpha *= step(abs(a), 1.00001); -#elif defined(ASINH) -result = asinh(a); -#elif defined(ATAN) -result = atan(a); -#elif defined(ATANH) -result = abs(a) > 1.0 ? 0.0: atanh(a); -alpha *= step(abs(a), 1.0); -#elif defined(ATAN_2) -result = atan(a, b); -#elif defined(COS) -result = cos(a); -#elif defined(COSH) -result = cosh(a); -#elif defined(SIN) -result = sin(a); -#elif defined(SINH) -result = sinh(a); -#elif defined(TAN) -result = tan(a); -#elif defined(TANH) -result = tanh(a); -#elif defined(BITWISEAND) -result = float(int(a) & int(b)); -#elif defined(BITWISEOR) -result = float(int(a) | int(b)); -#elif defined(BITWISELEFTSHIFT) -result = float(int(a) << int(b)); -#elif defined(BITWISERIGHTSHIFT) -result = float(int(a) >> int(b)); -#elif defined(BITWISENOT) -result = float(~(int(a))); -#elif defined(BITWISEXOR) -result = float(int(a) ^ int(b)); -#elif defined(BOOLEANAND) -result = float((a != 0.0) && (b != 0.0)); -#elif defined(BOOLEANNOT) -result = float(a == 0.0); -#elif defined(BOOLEANOR) -result = float((a != 0.0) || (b != 0.0)); -#elif defined(BOOLEANXOR) -result = float((a != 0.0) ^^ (b != 0.0)); -#elif defined(GREATERTHAN) -result = float(a > b); -#elif defined(GREATERTHANEQUAL) -result = float(a >= b); -#elif defined(LESSTHAN) -result = float(a < b); -#elif defined(LESSTHANEQUAL) -result = float(a <= b); -#elif defined(EQUALTO) -result = float(a == b); -#elif defined(NOTEQUAL) -result = float(a != b); -#elif defined(ISNULL) -result = float(alpha == 0.0); -alpha = 1.0; -#elif defined(SETNULL) -float maskValue = float(a == 0.0); -result = maskValue * b; -alpha *= maskValue; -#elif defined(CONDITIONAL) -float weight = float(abs(sign(a))); -result = weight * b + (1.0 - weight) * c; -#endif -float rangeFactor = step(u_domainRange.s, result) * step(result, u_domainRange.t); -result *= rangeFactor; -alpha *= rangeFactor; -#ifdef ROUND_OUTPUT -result = floor(result + 0.5); -#endif -gl_FragColor = vec4(result, result, result, alpha); -}`},mask:{"mask.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -#define LEN_INCLUDED_RANGES 6 -#define LEN_NODATA_VALUES 6 -uniform highp float u_includedRanges[6]; -uniform highp float u_noDataValues[6]; -float maskFactor(float bandValue, float fromValue, float to) { -float factor = 1.0; -for (int i = 0; i < LEN_NODATA_VALUES; i++) { -factor *= float(u_noDataValues[i] != bandValue); -} -factor *= step(fromValue, bandValue) * step(bandValue, to); -return factor; -} -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -float redFactor = maskFactor(pv.r, u_includedRanges[0], u_includedRanges[1]); -#ifdef MULTI_BAND -float greenFactor = maskFactor(pv.g, u_includedRanges[2], u_includedRanges[3]); -float blueFactor = maskFactor(pv.b, u_includedRanges[4], u_includedRanges[5]); -float maskFactor = redFactor * greenFactor * blueFactor; -gl_FragColor = pv * maskFactor; -#else -gl_FragColor = pv * redFactor; -#endif -}`},ndvi:{"ndvi.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform mediump mat3 u_bandIndexMat3; -#include -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec3 pv2 = u_bandIndexMat3 * pv.rgb; -float nir = pv2.r; -float red = pv2.g; -float index = (nir - red) * invertValue(nir + red); -#ifdef SCALED -index = floor((index + 1.0) * 100.0 + 0.5); -#endif -gl_FragColor = vec4(index, index, index, pv.a); -}`},remap:{"remap.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -#define LEN_REMAP_RANGES 18 -#define LEN_NODATA_RANGES 12 -uniform highp float u_rangeMaps[18]; -uniform highp float u_noDataRanges[12]; -uniform highp float u_unmatchMask; -uniform vec2 u_clampRange; -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -float factor = 1.0; -float bandValue = pv.r; -for (int i = 0; i < LEN_NODATA_RANGES; i+=2) { -float inside = 1.0 - step(u_noDataRanges[i], bandValue) * step(bandValue, u_noDataRanges[i+1]); -factor *= inside; -} -float mapValue = 0.0; -float includeMask = 0.0; -for (int i = 0; i < LEN_REMAP_RANGES; i+=3) { -float stepMask = step(u_rangeMaps[i], bandValue) * step(bandValue, u_rangeMaps[i+1]); -includeMask = (1.0 - stepMask) * includeMask + stepMask; -mapValue = (1.0 - stepMask) * mapValue + stepMask * u_rangeMaps[i+2]; -} -bandValue = factor * (mapValue + (1.0 - includeMask) * u_unmatchMask * pv.r); -float bandMask = factor * max(u_unmatchMask, includeMask); -bandValue = clamp(bandValue, u_clampRange.s, u_clampRange.t); -gl_FragColor = vec4(bandValue, bandValue, bandValue, bandMask * pv.a); -}`},slope:{"slope.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec2 u_cellSize; -uniform float u_zFactor; -uniform vec2 u_srcImageSize; -uniform float u_pixelSizePower; -uniform float u_pixelSizeFactor; -#include -void main() { -float pv[10]; -getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); -float alpha = pv[9]; -float xf = (u_zFactor + pow(u_cellSize[0], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[0]); -float yf = (u_zFactor + pow(u_cellSize[1], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[1]); -float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * xf; -float dzy = -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * yf; -float rise2run = sqrt(dzx * dzx + dzy * dzy); -#ifdef PERCENT_RISE -float result = rise2run * 100.0; -#else -float result = atan(rise2run) * 57.2957795; -#endif -#ifdef ROUND_OUTPUT -result = floor(result + 0.5); -#endif -gl_FragColor = vec4(result, result, result, alpha); -}`},stretch:{"stretch.frag":`precision mediump float; -uniform sampler2D u_image; -varying highp vec2 v_texcoord; -uniform float u_minCutOff[3]; -uniform float u_maxCutOff[3]; -uniform float u_minOutput; -uniform float u_maxOutput; -uniform float u_factor[3]; -uniform float u_gamma[3]; -uniform float u_gammaCorrection[3]; -float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, float gamma, float gammaCorrection) { -val = clamp(val, minCutOff, maxCutOff); -float stretchedVal; -#ifdef USE_GAMMA -float tempf = 1.0; -float outRange = maxOutput - minOutput; -float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); -tempf -= step(1.0, gamma) * sign(gamma - 1.0) * pow(1.0 / outRange, relativeVal * gammaCorrection); -stretchedVal = tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput; -stretchedVal = clamp(stretchedVal, minOutput, maxOutput); -#else -stretchedVal = minOutput + (val - minCutOff) * factor; -#endif -#ifdef ROUND_OUTPUT -stretchedVal = floor(stretchedVal + 0.5); -#endif -return stretchedVal; -} -void main() { -vec4 currentPixel = texture2D(u_image, v_texcoord); -float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_gamma[0], u_gammaCorrection[0]); -#ifdef MULTI_BAND -float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_gamma[1], u_gammaCorrection[1]); -float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_gamma[2], u_gammaCorrection[2]); -gl_FragColor = vec4(redVal, greenVal, blueVal, currentPixel.a); -#else -gl_FragColor = vec4(redVal, redVal, redVal, currentPixel.a); -#endif -}`},vs:{"vs.vert":`precision mediump float; -attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -varying highp vec2 v_texcoord; -void main() -{ -v_texcoord = a_pos; -gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); -}`}},scalar:{"scalar.frag":`precision mediump float; -uniform lowp float u_opacity; -varying vec2 v_pos; -const vec4 outlineColor = vec4(0.2, 0.2, 0.2, 1.0); -const float outlineSize = 0.02; -const float innerRadius = 0.25; -const float outerRadius = 0.42; -const float innerSquareLength = 0.15; -void main() { -mediump float dist = length(v_pos); -mediump float fillalpha1 = smoothstep(outerRadius, outerRadius + outlineSize, dist); -fillalpha1 *= (1.0-smoothstep(outerRadius + outlineSize, outerRadius + 0.1 + outlineSize, dist)); -#ifdef INNER_CIRCLE -mediump float fillalpha2 = smoothstep(innerRadius, innerRadius + outlineSize, dist); -fillalpha2 *= (1.0-smoothstep(innerRadius + outlineSize, innerRadius + 0.1 + outlineSize, dist)); -#else -mediump float fillalpha2 = (abs(v_pos.x) < innerSquareLength ? 1.0 : 0.0) * (abs(v_pos.y) < innerSquareLength ? 1.0 : 0.0); -#endif -gl_FragColor = (fillalpha2 + fillalpha1) * outlineColor * u_opacity; -}`,"scalar.vert":`precision mediump float; -attribute vec2 a_pos; -attribute vec2 a_offset; -attribute vec2 a_vv; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -uniform vec2 u_symbolSize; -uniform vec2 u_symbolPercentRange; -uniform vec2 u_dataRange; -varying vec2 v_pos; -void main() -{ -#ifdef DATA_RANGE -float valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0); -float sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x); -float sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y); -#else -float sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0; -#endif -vec2 size = u_symbolSize * sizePercentage; -vec2 pos = a_pos + a_offset * size; -v_pos = a_offset; -gl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0); -}`},stretch:{"stretch.frag":`precision mediump float; -varying highp vec2 v_texcoord; -#include -uniform float u_minCutOff[3]; -uniform float u_maxCutOff[3]; -uniform float u_minOutput; -uniform float u_maxOutput; -uniform float u_factor[3]; -uniform bool u_useGamma; -uniform float u_gamma[3]; -uniform float u_gammaCorrection[3]; -#include -float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) { -if (val >= maxCutOff) { -return maxOutput; -} else if (val <= minCutOff) { -return minOutput; -} -float stretchedVal; -if (useGamma) { -float tempf = 1.0; -float outRange = maxOutput - minOutput; -float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); -if (gamma > 1.0) { -tempf -= pow(1.0 / outRange, relativeVal * gammaCorrection); -} -stretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0; -} else { -stretchedVal = minOutput + (val - minCutOff) * factor; -} -#ifdef ROUND_OUTPUT -stretchedVal = floor(stretchedVal + 0.5); -#endif -return stretchedVal; -} -void main() { -vec2 pixelLocation = getPixelLocation(v_texcoord); -if (isOutside(pixelLocation)) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -return; -} -vec4 currentPixel = getPixel(pixelLocation); -#ifdef NOOP -gl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity; -return; -#endif -if (u_bandCount == 1) { -float grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); -#ifdef APPLY_COLORMAP -vec4 result = colorize(vec4(grayVal, grayVal, grayVal, 1.0), u_useGamma ? 255.0 : 1.0); -gl_FragColor = vec4(result.xyz, 1.0) * result.a * currentPixel.a * u_opacity; -#else -gl_FragColor = vec4(grayVal, grayVal, grayVal, 1.0) * currentPixel.a * u_opacity; -#endif -} else { -float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); -float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]); -float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]); -gl_FragColor = vec4(redVal, greenVal, blueVal, 1.0) * currentPixel.a * u_opacity; -} -}`}},stencil:{"stencil.frag":`void main() { -gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); -}`,"stencil.vert":`attribute vec2 a_pos; -uniform mat3 u_worldExtent; -void main() { -gl_Position = vec4(u_worldExtent * vec3(a_pos, 1.0), 1.0); -}`},test:{"TestShader.common.glsl":`#ifndef RETURN_RED -varying vec4 v_color; -#endif -varying vec2 v_offset;`,"TestShader.frag":`precision highp float; -#include -void main() { -if (v_offset.x > -.5 && v_offset.y > -.5 && v_offset.x < .5 && v_offset.y < .5) { -discard; -} -#ifdef RETURN_RED -gl_FragColor = vec4(1., 0., 0., 1.); -#else -gl_FragColor = v_color; -#endif -}`,"TestShader.vert":`const float POS_PRECISION_FACTOR = 10.; -const float OFFSET_PRECISION_FACTOR = 10.; -const float SIZE_PRECISION_FACTOR = 10.; -attribute vec2 a_pos_packed; -attribute vec2 a_offset_packed; -attribute float a_size_packed; -#ifdef DATA_DRIVEN_COLOR -const float u_dataDrivenColor_validValues[4] = float[4](0., 0., 1., 0.); -uniform vec4 u_dataDrivenColor_colorFallback; -uniform vec4 u_dataDrivenColor_color; -#endif -uniform float u_view_zoomLevel; -#include -#ifdef DATA_DRIVEN_COLOR -vec4 getColor(float value) { -int index = -1; -for (int i = 0; i < 4; i++) { -if (u_dataDrivenColor_validValues[i] == value) { -index = i; -break; -} -} -if (index == -1) { -return u_dataDrivenColor_colorFallback; -} -return u_dataDrivenColor_color; -} -#endif -void main() { -vec2 a_pos = a_pos_packed / POS_PRECISION_FACTOR; -vec2 a_offset = a_offset_packed / OFFSET_PRECISION_FACTOR; -float a_size = a_size_packed / SIZE_PRECISION_FACTOR; -vec4 color = vec4(1., 0., 0., 1.); -#ifdef DATA_DRIVEN_COLOR -color = getColor(1.); -#endif -vec2 offsetScaled = a_offset * a_size; -vec4 pos = vec4(a_pos.xy + offsetScaled, 0., 1.); -gl_Position = pos; -#ifndef RETURN_RED -v_color = color; -#endif -v_offset = a_offset; -}`},tileInfo:{"tileInfo.frag":`uniform mediump sampler2D u_texture; -varying mediump vec2 v_tex; -void main(void) { -lowp vec4 color = texture2D(u_texture, v_tex); -color.rgb *= color.a; -gl_FragColor = color; -}`,"tileInfo.vert":`attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform mediump float u_depth; -uniform mediump vec2 u_coord_ratio; -uniform mediump vec2 u_delta; -uniform mediump vec2 u_dimensions; -varying mediump vec2 v_tex; -void main() { -mediump vec2 offset = u_coord_ratio * vec2(u_delta + a_pos * u_dimensions); -vec3 v_pos = u_dvsMat3 * vec3(offset, 1.0); -gl_Position = vec4(v_pos.xy, 0.0, 1.0); -v_tex = a_pos; -}`},util:{"atan2.glsl":`float atan2(in float y, in float x) { -float t0, t1, t2, t3, t4; -t3 = abs(x); -t1 = abs(y); -t0 = max(t3, t1); -t1 = min(t3, t1); -t3 = 1.0 / t0; -t3 = t1 * t3; -t4 = t3 * t3; -t0 = - 0.013480470; -t0 = t0 * t4 + 0.057477314; -t0 = t0 * t4 - 0.121239071; -t0 = t0 * t4 + 0.195635925; -t0 = t0 * t4 - 0.332994597; -t0 = t0 * t4 + 0.999995630; -t3 = t0 * t3; -t3 = (abs(y) > abs(x)) ? 1.570796327 - t3 : t3; -t3 = x < 0.0 ? 3.141592654 - t3 : t3; -t3 = y < 0.0 ? -t3 : t3; -return t3; -}`,"encoding.glsl":`const vec4 rgba2float_factors = vec4( -255.0 / (256.0), -255.0 / (256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0 * 256.0) -); -float rgba2float(vec4 rgba) { -return dot(rgba, rgba2float_factors); -}`}};function Qt(i){return function(e){let t=i;return e.split("/").forEach(o=>{t&&(t=t[o])}),t}}const Jt=new St(Qt(Xt));function fe(i){return Jt.resolveIncludes(i)}const ae={shaders:{vertexShader:fe("background/background.vert"),fragmentShader:fe("background/background.frag")},attributes:new Map([["a_pos",0]])},ei=()=>ht("clip",{geometry:[{location:0,name:"a_pos",count:2,type:P.SHORT}]});let ti=class extends Z{constructor(){super(...arguments),this._color=H(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:i}){i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setFaceCullingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(Q.KEEP,Q.KEEP,Q.REPLACE),i.setStencilWriteMask(255),i.setStencilFunction(U.ALWAYS,0,255)}draw(i,e){const{context:t,state:o,requestRender:a,allowDelayedRender:r}=i,l=ei(),n=e.getVAO(t,o,l.attributes,l.bufferLayouts);n.indexBuffer!=null&&(this._program||(this._program=ce(t,ae)),!r||a==null||this._program.compiled?(t.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",o.displayMat3),t.bindVAO(n),t.drawElements(A.TRIANGLES,n.indexBuffer.size,P.UNSIGNED_INT,0),t.bindVAO()):a())}};const xe=new Map([["geometry",[new ie("a_pos",2,P.BYTE,0,2)]]]),io=new Map([["geometry",[new ie("a_pos",2,P.BYTE,0,4),new ie("a_tex",2,P.BYTE,2,4)]]]),oo=new Map([["geometry",[new ie("a_pos",2,P.UNSIGNED_SHORT,0,4)]]]);let ii=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:i}){i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(Q.KEEP,Q.KEEP,Q.REPLACE),i.setStencilWriteMask(255)}draw(i,e){const{context:t,requestRender:o,allowDelayedRender:a}=i;this._initialized||this._initialize(t),!a||o==null||this._solidProgram.compiled?(t.setStencilFunctionSeparate(xt.FRONT_AND_BACK,U.GREATER,e.stencilRef,255),t.bindVAO(this._solidVertexArrayObject),t.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._solidProgram.setUniform2fv("u_coord_range",[e.rangeX,e.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),t.drawArrays(A.TRIANGLE_STRIP,0,4),t.bindVAO()):o()}_initialize(i){if(this._initialized)return!0;const e=ce(i,ae);if(!e)return!1;const t=new Int8Array([0,0,1,0,0,1,1,1]),o=k.createVertex(i,W.STATIC_DRAW,t),a=new K(i,ae.attributes,xe,new Map([["geometry",o]]));return this._solidProgram=e,this._solidVertexArrayObject=a,this._initialized=!0,!0}},oi=class extends $e{constructor(i,e,t,o,a,r,l=a,n=r){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new Rt(i),this.resolution=e,this.x=t,this.y=o,this.width=a,this.height=r,this.rangeX=l,this.rangeY=n}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let i=this;for(;i.parent!==this._stage;){if(!i.parent)return 0;i=i.parent}return this._stage.children.indexOf(i)}setTransform(i){const e=this.resolution/(i.resolution*i.pixelRatio),t=this.transforms.tileMat3,[o,a]=i.toScreenNoRotation([0,0],[this.x,this.y]),r=this.width/this.rangeX*e,l=this.height/this.rangeY*e;qe(t,r,0,0,0,l,0,o,a,1),ge(this.transforms.displayViewScreenMat3,i.displayViewMat3,t)}get destroyed(){return this._destroyed}};const ze=oe(),_e=Ct();let ai=class extends oi{constructor(i,e,t,o){super(i,e,t,o,ue,ue)}destroy(){super.destroy()}setTransform(i){const e=this.resolution/i.resolution,t=this.transforms.tileMat3,[o,a]=i.toScreenNoRotation([0,0],[this.x,this.y]),r=this.width/this.rangeX*e,l=this.height/this.rangeY*e;qe(t,r,0,0,0,l,0,o,a,1),ge(this.transforms.displayViewScreenMat3,i.displayViewMat3,t);const n=Tt(pe(),r,0,0,l,o,a);bt(this.transforms.labelMat2d,i.viewMat2d,n)}_createTransforms(){return{labelMat2d:pe(),tileMat3:oe(),displayViewScreenMat3:oe()}}containsScreenPoint(i,e,t){const o=ge(ze,i.viewMat3,this.transforms.tileMat3),a=It(ze,o);if(a==null)return!0;At(_e,...e,1);const r=Pt(_e,_e,a),l=t*(this.resolution/i.resolution);return r[0]>=-l&&r[0]=-l&&r[1]{const t=e.end-e.start;i=Math.max(i,t)}),i}firstFit(i){if(this._head==null)return null;let e=null,t=this._head;for(;t;){const o=t.data.end-t.data.start;if(o===i)return e?e.next=t.next:this._head=t.next,t.data.start;if(o>i){const a=t.data.start;return t.data.start+=i,a}e=t,t=t.next}return null}free(i,e){const t=i+e;if(this._head==null){const l=new Y({start:i,end:t});return void(this._head=l)}if(t<=this._head.data.start){if(t===this._head.data.start)return void(this._head.data.start-=e);const l=new Y({start:i,end:t});return l.next=this._head,void(this._head=l)}let o=this._head,a=o.next;for(;a;){if(a.data.start>=t){if(o.data.end===i){if(o.data.end+=e,o.data.end===a.data.start){const n=a.data.end-a.data.start;return o.data.end+=n,void(o.next=a.next)}return}if(a.data.start===t)return void(a.data.start-=e);const l=new Y({start:i,end:t});return l.next=o.next,void(o.next=l)}o=a,a=a.next}if(i===o.data.end)return void(o.data.end+=e);const r=new Y({start:i,end:t});o.next=r}clear(){this._head=null}};function ri(i,e){return i<<16|255&e}function li(i){return 255&i}let te=class{constructor(i,e,t,o,a){this.instance=i,this.materialKey=e,this.target=t,this.start=o,this.count=a}get textureKey(){return li(this.materialKey)}get indexEnd(){return this.start+this.count}extend(i){this.count+=i}render(i){this.instance.techniqueRef.render(i,this)}getStencilReference(){return this.target.stencilRef}getAttributePrecisionPackFactors(){const i=this.instance.instanceId;return this.target.getMesh(i).getAttributePrecisionPackFactors()}draw(i,e){Et(i)?this.drawCompute(i.context,e):this.drawGeometry(i.context,e)}drawCompute(i,e){const t=this.instance.instanceId,o=this.target.getMesh(t).getComputeVAO(i,e),a=this.start*Uint32Array.BYTES_PER_ELEMENT/3;i.bindVAO(o),i.drawElements(A.POINTS,this.count/3,P.UNSIGNED_INT,a),i.bindVAO(null)}drawGeometry(i,e){const t=this.instance.instanceId,o=this.target.getMesh(t).getGeometryVAO(i,e),a=this.start*Uint32Array.BYTES_PER_ELEMENT;i.bindVAO(o),i.drawElements(A.TRIANGLES,this.count,P.UNSIGNED_INT,a),i.bindVAO(null)}},ni=class rt{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(e,t,o,a){const r=new rt;for(const l of e.values())for(const n of l.records){const s=o.getInstance(n.instanceId),c=ri(s.instanceId,n.textureKey);r.addRecord(s,c,n.indexStart,n.indexCount,n.vertexStart,n.vertexCount,t,a)}return r}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}render(e,t){const{drawPhase:o}=e;for(const a of this.infos()){const r=a.instance.techniqueRef;r.drawPhase&o&&(t==null||r.type===t)&&a.render(e)}}addRecord(e,t,o,a,r,l,n,s){let c=o,u=a;if(u||(c=r,u=l),!u)return;if(this._head==null){const g=new te(e,t,n,c,u);return this._head=new Y(g),this._tail=this._head,this._length++,void this._minOrderedLength++}if(s===he.STRICT_ORDER)return this._insert(e,t,n,c,u,this._tail,null);let f=null,d=this._head;const _=e.instanceId,x=e.techniqueRef.symbologyPlane;if(s===he.STRICT_MARKERS_AND_TEXT&&(x===Ce.MARKER||x===Ce.TEXT))return this._insert(e,t,n,c,u,this._tail,null);for(;d;){const g=d.data.instance,b=g.instanceId,O=g.techniqueRef.symbologyPlane,S=f?.data.instance.instanceId;if(x=1){const o=this.index.operations[this.index.operations.length-1];o.srcFrom+o.count===i.indexStart&&(o.count+=i.indexCount,t=!0)}t||this.index.operations.push({srcFrom:i.indexStart,dstFrom:this.index.count,count:i.indexCount,mutate:e}),i.indexStart=this.index.count,this.index.count+=i.indexCount}};const Ve=j("esri-2d-log-allocations");let Ne=class lt{static create(e,t){const o=t.acquireUint32Array(e);return new lt(o,t)}constructor(e,t){this._array=e,this._pool=t}get array(){return this._array}get length(){return this._array.length}getUint32View(e,t){return new Uint32Array(this._array.buffer,e+this._array.byteOffset,t)}expand(e){if(e<=this._array.byteLength)return;const t=this._pool.acquireUint32Array(e);t.set(this._array),this._pool.releaseUint32Array(this._array),this._array=t}destroy(){this._pool.releaseUint32Array(this._array)}},me=class nt{constructor(){this._data=new ArrayBuffer(nt.BYTE_LENGTH),this._freeList=new at({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 16e6}get buffer(){return this._data}acquireUint32Array(e){const t=this._freeList.firstFit(e);return t==null?null:new Uint32Array(this._data,t,e/Uint32Array.BYTES_PER_ELEMENT)}releaseUint32Array(e){this._freeList.free(e.byteOffset,e.byteLength)}};class ao{constructor(){this._pages=[],this._pagesByBuffer=new Map,this._bytesAllocated=0}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*me.BYTE_LENGTH}acquireUint32Array(e){if(this._bytesAllocated+=e,Ve&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>=me.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const o of this._pages){const a=o.acquireUint32Array(e);if(a!=null)return a}const t=this._addPage().acquireUint32Array(e);return ve(t,"Expected to allocate page"),t}releaseUint32Array(e){this._bytesAllocated-=e.byteLength,Ve&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const t=this._pagesByBuffer.get(e.buffer);t&&t.releaseUint32Array(e)}_addPage(){const e=new me;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}}const ui=1.25,we=32767,ci=we<<16|we;let Fe=class{constructor(i,e,t,o){this._pool=o;const a=Ne.create(e*t*Uint32Array.BYTES_PER_ELEMENT,this._pool);this.size=e,this.strideInt=t,this.bufferType=i,this.dirty={start:1/0,end:0},this.memoryStats={bytesUsed:0,bytesReserved:e*t*Uint32Array.BYTES_PER_ELEMENT},this._gpu=null,this._cpu=a,this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get intSize(){return this.fillPointer*this.strideInt}get byteSize(){return this.intSize*Uint32Array.BYTES_PER_ELEMENT}get invalidated(){return this.bufferSize>0&&!this._gpu}get invalidatedComputeBuffer(){return this.bufferSize>0&&!this._gpuComputeTriangles}invalidate(){this._invalidateTriangleBuffer(),this._gpu?.dispose(),this._gpu=null}_invalidateTriangleBuffer(){this._gpuComputeTriangles?.dispose(),this._gpuComputeTriangles=null}destroy(){this._gpu?.dispose(),this._gpuComputeTriangles?.dispose(),this._cpu?.destroy()}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new at({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(i){if(!(this.maxAvailableSpace()>=i)&&i*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const e=this._cpu.length/this.strideInt,t=Math.round((e+i)*ui),o=t*this.strideInt;this._cpu.expand(o*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(e,t-e),this.memoryStats.bytesReserved+=(t-e)*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}}set(i,e){this._cpu.array[i]!==e&&(this._cpu.array[i]=e,this.dirty.start=Math.min(i,this.dirty.start),this.dirty.end=Math.max(i+1,this.dirty.end))}getGPUBuffer(i,e=!1){if(!this.bufferSize)return null;if(e){if(this.bufferType!=="index")throw new Error("Tired to get triangle buffer, but target is not an index buffer");return this._gpuComputeTriangles==null&&(this._gpuComputeTriangles=this._createComputeBuffer(i)),this._gpuComputeTriangles}return this._gpu==null&&(this._gpu=this._createBuffer(i)),this._gpu}getView(i,e){return this._cpu.getUint32View(i,e/Uint32Array.BYTES_PER_ELEMENT)}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(i,e,t,o){const a=t*this.strideInt;if(!a)return 0;const r=e*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,l=new Uint32Array(i,r,a),n=this.freeList.firstFit(t);ve(n,"First fit region must be defined");const s=n*this.strideInt,c=a;if(this._cpu.array.set(l,s),o!==0)for(let u=0;uo,r=this._cpu,l=Ne.create(o,this._pool);a||l.array.set(this._cpu.getUint32View(0,this.intSize));for(const n of e)if(a||n.srcFrom!==n.dstFrom||n.mutate!==0){this.dirty.start=Math.min(this.dirty.start,n.dstFrom*this.strideInt),this.dirty.end=Math.max(this.dirty.end,(n.dstFrom+n.count)*this.strideInt);for(let s=0;se.locations.has(o.name)).map(o=>({name:o.name,type:o.type,count:o.count,divisor:0,normalized:o.normalized??!1,offset:o.offset,stride:i.stride}));return new Map([["geometry",t]])}function di(i,e){const t=[],o=i.attributes.filter(a=>e.locations.has(a.name));for(const a of o){t.push({name:a.name,type:a.type,count:a.count,divisor:0,normalized:a.normalized??!1,offset:a.offset,stride:i.stride});const r=e.computeAttributeMap[a.name];r!=null&&r.length===2&&(t.push({name:r[0],count:a.count,divisor:0,type:a.type,normalized:a.normalized??!1,offset:a.offset+i.stride,stride:i.stride}),t.push({name:r[1],count:a.count,divisor:0,type:a.type,normalized:a.normalized??!1,offset:a.offset+2*i.stride,stride:i.stride}))}return new Map([["geometry",t]])}let _i=class{constructor(i,e){if(this._bufferPool=i,this._layout=e,this._invalidatedGeometry=!1,this._invalidatedCompute=!1,this._position=this._layout.attributes.find(t=>t.name==="pos"||t.name==="position"),!this._position)throw new Error("InternalError: Unable to find position attribute")}destroy(){this._indexBuffer=Ee(this._indexBuffer),this._vertexBuffer=Ee(this._vertexBuffer),this._computeVAO?.disposeVAOOnly(),this._geometryVAO?.disposeVAOOnly()}get layout(){return this._layout}getDrawArgs(i,e,t,o){return o?{primitive:A.POINTS,count:e/3,offset:t/3}:{primitive:i,count:e,offset:t}}getAttributePrecisionPackFactors(){const i={};for(const e of this.layout.attributes)e.packPrecisionFactor&&(i[e.name]=e.packPrecisionFactor);return i}getDebugVertexInfo(i=!1,e){if(!this._vertexBuffer)return null;const t=this._layout,o=t.stride,a=this._vertexBuffer.getView(0,this._vertexBuffer.byteSize),r=[];if(i)if(e==null)console.log("must provide location info to see compute attributes");else for(const f of t.attributes){const d=e.computeAttributeMap[f.name];d!=null&&d.length===2&&(r.push({...f,name:d[0],offset:f.offset+o}),r.push({...f,name:d[1],offset:f.offset+2*o}))}const l=new DataView(a.slice().buffer);let n=a.byteLength/o;i&&(n=this._indexBuffer.fillPointer/3);const s=this._indexBuffer.getView(0,this._indexBuffer.byteSize);let c=0;const u=[];for(let f=0;fSe.getLogger("esri.views.2d.engine.webgl.FeatureTile");let pi=0,gi=class extends ai{constructor(i,e,t,o,a=!1){super(i,e,t,o),this._meshes=new Map,this._entities=[],this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=pi++,this._metrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this._objectIdMap=null,this.visible=!0,this.transforms.labelMat2d=pe(),this.enableDeferredUploads=a}destroy(){super.destroy(),this.clear()}clear(){for(const i of this._meshes.values())i.destroy();this._meshes.clear(),this._entities=[],this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(i){super.beforeRender(i),this._needsReshuffle&&i.reshuffleManager.schedule(this)}tryReady(i){const e=this._invalidated&&!this._uploadAllowed;return!(this.isReady||e||!this._encounteredEnd||!(i>=this._attributeEpoch))&&(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${i}]`),this.ready(),this.requestRender(),!0)}get labelMetrics(){return this._metrics}get hasData(){return!!this._meshes.size}get hasAnimations(){return!!this._objectIdMap}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}upload(){this._nextUploadAllowed=!0}getDisplayList(i,e){if(this._uploadAllowed&&this._invalidated){this._entities.sort((t,o)=>{const a=o.sortKey,r=t.sortKey;return r===a?t.id-o.id:r-a}),e===he.BATCHING&&this.reshuffle(!0),this._displayList=ni.fromDisplayEntities(this._entities,this,i,e);for(const t of this._meshes.values())t.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(i){if(!this._meshes.has(i))throw new Error(`InternalError: Unable to find VAO for instance: ${i}`);return this._meshes.get(i)}getSortKeys(i){const e=new Map;for(const{id:t,sortKey:o}of this._entities)if(i.has(t)&&e.set(t,o),e.size===i.size)break;return e}onMessage(i){if(i.objectIdMap)for(const e in i.objectIdMap)this._objectIdMap||(this._objectIdMap={}),this._objectIdMap[e]=i.objectIdMap[e];switch(i.type){case"append":this._onAppendMessage(i);break;case"update":this._onUpdateMessage(i)}if(this._aggregateMemoryStats(),this.requestRender(),i.end){if(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${i.attributeEpoch}]`),!i.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=i.attributeEpoch,this._encounteredEnd=!0}}_onAppendMessage(i){if(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:Ue(i?.append)}),i.clear&&this.clear(),!i.append)return;const e=le(new se(i.append.entities),ne);this._insert(e,i.append.data,!1)}_onUpdateMessage(i){j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:i.isPixelBuffer,modify:Ue(i.modify),remove:i.remove});const e=le(new se(i.modify.entities),ne),t=e.map(r=>r.id),o=i.isPixelBuffer??!1,a=[...i.remove,...t];o?this._removeByIdsFromBuffer(a):this._removeByIds(a),this._insert(e,i.modify.data,o)}reshuffle(i=!1){if(this.destroyed)return;const e=new Map;for(const t of this._entities)for(const o of t.records){const a=this._meshes.get(o.instanceId);let r=e.get(a);r||(r=new si(i),e.set(a,r)),r.copyRecord(o)}for(const[t,o]of e)t.reshuffle(o);this._invalidated=!0,this._aggregateMemoryStats(),j("esri-2d-update-debug")&&vi().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(i,e,t,o){const a=t*ue,r=o*ue;for(const l of i._entities){let n=null;for(const s of l.records)if(s.overlaps&e){const c=i.getMesh(s.instanceId),u=this._ensureMesh(s.instanceId,c.layout).copyRecordFrom(c,s,a,r);n||(n=new ne(l.id,l.sortKey),this._entityIdsFromBuffer.add(l.id),this._entities.push(n)),n.records.push(u)}}this._invalidated=!0}_ensureMesh(i,e){return this._meshes.has(i)||this._meshes.set(i,new _i(this._stage.bufferPool,e)),this._meshes.get(i)}_insert(i,e,t){if(!i.length)return;this._removeDuplicatedBufferedEntites(i);const o=this._insertVertexData(e);for(const a of i){for(const r of a.records)r.updateBaseOffsets(o.get(r.instanceId));t?this._tryInsertBufferedEntity(a):this._insertEntity(a)}this._invalidated=!0}_insertVertexData(i){const e=new Map;for(const t of i){const{instanceId:o,layout:a}=t,r=this._ensureMesh(o,a).append(t);if(t.metrics){const l=le(new se(t.metrics),pt)??[];this._metrics.push(...l)}e.set(o,r)}return e}_insertEntity(i){j("esri-2d-update-debug")&&this._entityIds.has(i.id)&&console.error(`Tile ${this.key.id} insertEnitty: Already have entityId ${i.id}`),this._entityIds.add(i.id),this._entities.push(i)}_tryInsertBufferedEntity(i){this._entityIds.has(i.id)?this._removeRecordsFromMesh(i.records):(this._entityIdsFromBuffer.add(i.id),this._entities.push(i))}_removeDuplicatedBufferedEntites(i){if(!this._entityIdsFromBuffer.size)return;const e=[];for(const t of i)this._entityIdsFromBuffer.has(t.id)&&e.push(t.id);this._removeByIds(e)}_removeByIdsFromBuffer(i){this._removeByIds(i.filter(e=>this._entityIdsFromBuffer.has(e)))}_removeByIds(i){if(i.length===0)return;const e=new Set(i),t=[];for(const o of this._entities)e.has(o.id)?this._remove(o):t.push(o);this._entities=t,this._invalidated=!0}_remove(i){this._removeRecordsFromMesh(i.records),this._entityIds.delete(i.id),this._entityIdsFromBuffer.delete(i.id);for(let e=this._metrics.length-1;e>=0;e--)this._metrics[e].entityTexel===i.id&&this._metrics.splice(e,1)}_removeRecordsFromMesh(i){for(const e of i){const{instanceId:t,indexStart:o,indexCount:a,vertexStart:r,vertexCount:l}=e;this._meshes.get(t)?.remove(o,a,r,l)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const i of this._meshes.values())this.debugInfo.memory.bytesUsed+=i.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=i.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:i,bytesReserved:e}=this.debugInfo.memory,t=i/e,{minOrderedLength:o,length:a}=this.debugInfo.display;return e>dt&&t<_t||a>mt&&o/a({objectId:this._objectIdMap[i],displayId:i})):[]}};const Ge={shaders:{vertexShader:fe("tileInfo/tileInfo.vert"),fragmentShader:fe("tileInfo/tileInfo.frag")},attributes:new Map([["a_pos",0]])},Ye=512,ye=512,$=16,M=8,hi=(ye-2*M)/5;let xi=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._ctx=null}prepareState({context:i}){i.setBlendingEnabled(!0),i.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!1)}draw(i,e){const{context:t,requestRender:o,allowDelayedRender:a}=i;if(!e.isReady&&e instanceof gi&&e.hasData)return;if(this._loadWGLResources(t),a&&o!=null&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void o();t.bindVAO(this._outlineVertexArrayObject),t.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._outlineProgram.setUniform2f("u_coord_range",e.rangeX,e.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),t.drawArrays(A.LINE_STRIP,0,4);const r=this._getTexture(t,e);r&&(t.bindVAO(this._tileInfoVertexArrayObject),t.useProgram(this._tileInfoProgram),t.bindTexture(r,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",e.rangeX/e.width,e.rangeY/e.height),this._tileInfoProgram.setUniform2f("u_delta",0,0),this._tileInfoProgram.setUniform2f("u_dimensions",r.descriptor.width,r.descriptor.height),t.drawArrays(A.TRIANGLE_STRIP,0,4)),t.bindVAO()}_loadWGLResources(i){if(this._outlineProgram&&this._tileInfoProgram)return;const e=ce(i,ae),t=ce(i,Ge),o=new Int8Array([0,0,1,0,1,1,0,1]),a=k.createVertex(i,W.STATIC_DRAW,o),r=new K(i,ae.attributes,xe,new Map([["geometry",a]])),l=new Int8Array([0,0,1,0,0,1,1,1]),n=k.createVertex(i,W.STATIC_DRAW,l),s=new K(i,Ge.attributes,xe,new Map([["geometry",n]]));this._outlineProgram=e,this._tileInfoProgram=t,this._outlineVertexArrayObject=r,this._tileInfoVertexArrayObject=s}_getTexture(i,e){if(!this._ctx){const n=document.createElement("canvas");n.width=Ye,n.height=ye,this._ctx=n.getContext("2d")}if(!e.tileDebugInfoTexture){const n=new Lt;n.wrapMode=yt.CLAMP_TO_EDGE,n.samplingMode=B.LINEAR,n.isImmutable=!0,n.width=Ye,n.height=ye,e.tileDebugInfoTexture=new Mt(i,n)}const t=this._ctx;t.clearRect(0,0,t.canvas.width,t.canvas.height),t.textAlign="left",t.textBaseline="top",t.font=$-2+"px sans-serif",t.lineWidth=2,t.fillStyle="white",t.strokeStyle="black";const{debugSlot:o}=e;let a=M+hi*o;const r=`${o}) ${e.key.id} (${e.constructor.name})`;t.strokeText(r,M,a),t.fillText(r,M,a),a+=$;const{debugInfo:l}=e;if(l){const{length:n,minOrderedLength:s,minUnorderedLength:c,triangleCount:u}=l.display;if(n>0){const _=`Length: ${n}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(s){const _=`Min ordered length: ${s}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(c){const _=`Min unordered length: ${c}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(u>0){u>1e5&&(t.fillStyle="red",t.strokeStyle="white");const _=`Triangle count: ${u}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}const{bytesUsed:f,bytesReserved:d}=l.memory;if(t.fillStyle="white",t.strokeStyle="black",f>0||d>0){const _=`Memory usage: ${f} of ${d} bytes`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}}return e.tileDebugInfoTexture.setData(t.canvas),e.tileDebugInfoTexture}},yi=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1),this._patternMatrix=oe(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(i,e){const{context:t,painter:o,requestRender:a,allowDelayedRender:r}=i;this._loadWGLResources(i);const l=i.displayLevel,n=i.styleLayer,s=n.backgroundMaterial,c=o.vectorTilesMaterialManager,u=n.getPaintValue("background-color",l),f=n.getPaintValue("background-opacity",l),d=n.getPaintValue("background-pattern",l),_=d!==void 0,x=1|window.devicePixelRatio,g=i.spriteMosaic;let b,O;const S=x>Ze?2:1,T=this._programOptions;T.pattern=_;const v=c.getMaterialProgram(t,s,T);if(!r||a==null||v.compiled){if(t.bindVAO(this._vao),t.useProgram(v),_){const p=g.getMosaicItemPosition(d,!0);if(p!=null){const{tl:h,br:y,page:I}=p;b=y[0]-h[0],O=y[1]-h[1];const m=g.getPageSize(I);m!=null&&(g.bind(t,B.LINEAR,I,F),v.setUniform4f("u_tlbr",h[0],h[1],y[0],y[1]),v.setUniform2fv("u_mosaicSize",m),v.setUniform1i("u_texture",F))}v.setUniform1f("u_opacity",f)}else{const p=u[3]*f;this._color[0]=p*u[0],this._color[1]=p*u[1],this._color[2]=p*u[2],this._color[3]=p,v.setUniform4fv("u_color",this._color)}v.setUniform1f("u_depth",n.z||0);for(const p of e){if(v.setUniform1f("u_coord_range",p.rangeX),v.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),_){const h=Math.max(2**(Math.round(l)-p.key.level),1),y=S*p.width*h,I=y/Oe(b),m=y/Oe(O);this._patternMatrix[0]=I,this._patternMatrix[4]=m,v.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}t.setStencilFunction(U.EQUAL,0,255),t.drawArrays(A.TRIANGLE_STRIP,0,4)}}else a()}_loadWGLResources(i){if(this._vao)return;const{context:e,styleLayer:t}=i,o=t.backgroundMaterial,a=new Int8Array([0,0,1,0,0,1,1,1]),r=k.createVertex(e,W.STATIC_DRAW,a),l=new K(e,o.getAttributeLocations(),o.getLayoutInfo(),new Map([["geometry",r]]));this._vao=l}},Si=class extends Z{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(i,e){const{context:t,displayLevel:o,requiredLevel:a,state:r,painter:l,spriteMosaic:n,styleLayerUID:s,requestRender:c,allowDelayedRender:u}=i;if(!e.some(v=>v.layerData.get(s)?.circleIndexCount??!1))return;const f=i.styleLayer,d=f.circleMaterial,_=l.vectorTilesMaterialManager,x=1.2,g=f.getPaintValue("circle-translate",o),b=f.getPaintValue("circle-translate-anchor",o),O=this._programOptions,S=_.getMaterialProgram(t,d,O);if(u&&c!=null&&!S.compiled)return void c();t.useProgram(S),S.setUniformMatrix3fv("u_displayMat3",b===J.VIEWPORT?r.displayMat3:r.displayViewMat3),S.setUniform2fv("u_circleTranslation",g),S.setUniform1f("u_depth",f.z),S.setUniform1f("u_antialiasingWidth",x);let T=-1;for(const v of e){if(!v.layerData.has(s))continue;v.key.level!==T&&(T=v.key.level,d.setDataUniforms(S,o,f,T,n));const p=v.layerData.get(s);if(!p.circleIndexCount)continue;p.prepareForRendering(t);const h=p.vao;h!=null&&(t.bindVAO(h),S.setUniformMatrix3fv("u_dvsMat3",v.transforms.displayViewScreenMat3),a!==v.key.level?t.setStencilFunction(U.EQUAL,v.stencilRef,255):t.setStencilFunction(U.GREATER,255,255),t.drawElements(A.TRIANGLES,p.circleIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*p.circleIndexStart),v.triangleCount+=p.circleIndexCount/3)}}};const ke=1/65536;class Ti extends Z{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,t){const{displayLevel:o,renderPass:a,spriteMosaic:r,styleLayerUID:l}=e;let n=!1;for(const T of t)if(T.layerData.has(l)){const v=T.layerData.get(l);if(v.fillIndexCount>0||v.outlineIndexCount>0){n=!0;break}}if(!n)return;const s=e.styleLayer,c=s.getPaintProperty("fill-pattern"),u=c!==void 0,f=u&&c.isDataDriven;let d;if(u&&!f){const T=c.getValue(o);d=r.getMosaicItemPosition(T,!0)}const _=!u&&s.getPaintValue("fill-antialias",o);let x=!0,g=1;if(!u){const T=s.getPaintProperty("fill-color"),v=s.getPaintProperty("fill-opacity");if(!T?.isDataDriven&&!v?.isDataDriven){const p=s.getPaintValue("fill-color",o);g=s.getPaintValue("fill-opacity",o)*p[3],g>=1&&(x=!1)}}if(x&&a==="opaque")return;const b=s.getPaintValue("fill-translate",o),O=s.getPaintValue("fill-translate-anchor",o);(x||a!=="translucent")&&this._drawFill(e,l,s,t,b,O,u,d,f);const S=!s.hasDataDrivenOutlineColor&&s.outlineUsesFillColor&&g<1;_&&a!=="opaque"&&!S&&this._drawOutline(e,l,s,t,b,O)}_drawFill(e,t,o,a,r,l,n,s,c){if(n&&!c&&s==null)return;const{context:u,displayLevel:f,state:d,painter:_,pixelRatio:x,spriteMosaic:g,requestRender:b,allowDelayedRender:O}=e,S=o.fillMaterial,T=_.vectorTilesMaterialManager,v=x>Ze?2:1,p=this._fillProgramOptions;p.pattern=n;const h=T.getMaterialProgram(u,S,p);if(O&&b!=null&&!h.compiled)return void b();if(u.useProgram(h),s!=null){const{page:I}=s,m=g.getPageSize(I);m!=null&&(g.bind(u,B.LINEAR,I,F),h.setUniform2fv("u_mosaicSize",m),h.setUniform1i("u_texture",F))}h.setUniformMatrix3fv("u_displayMat3",l===J.VIEWPORT?d.displayMat3:d.displayViewMat3),h.setUniform2fv("u_fillTranslation",r),h.setUniform1f("u_depth",o.z+ke);let y=-1;for(const I of a){if(!I.layerData.has(t))continue;I.key.level!==y&&(y=I.key.level,S.setDataUniforms(h,f,o,y,g));const m=I.layerData.get(t);if(!m.fillIndexCount)continue;m.prepareForRendering(u);const V=m.fillVAO;if(V!=null){if(u.bindVAO(V),h.setUniformMatrix3fv("u_dvsMat3",I.transforms.displayViewScreenMat3),u.setStencilFunction(U.EQUAL,I.stencilRef,255),n){const E=Math.max(2**(Math.round(f)-I.key.level),1),D=I.rangeX/(v*I.width*E);h.setUniform1f("u_patternFactor",D)}if(c){const E=m.patternMap;if(!E)continue;for(const[D,L]of E){const q=g.getPageSize(D);q!=null&&(g.bind(u,B.LINEAR,D,F),h.setUniform2fv("u_mosaicSize",q),h.setUniform1i("u_texture",F),u.drawElements(A.TRIANGLES,L[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L[0]))}}else u.drawElements(A.TRIANGLES,m.fillIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*m.fillIndexStart);I.triangleCount+=m.fillIndexCount/3}}}_drawOutline(e,t,o,a,r,l){const{context:n,displayLevel:s,state:c,painter:u,pixelRatio:f,spriteMosaic:d,requestRender:_,allowDelayedRender:x}=e,g=o.outlineMaterial,b=u.vectorTilesMaterialManager,O=.75/f,S=this._outlineProgramOptions,T=b.getMaterialProgram(n,g,S);if(x&&_!=null&&!T.compiled)return void _();n.useProgram(T),T.setUniformMatrix3fv("u_displayMat3",l===J.VIEWPORT?c.displayMat3:c.displayViewMat3),T.setUniform2fv("u_fillTranslation",r),T.setUniform1f("u_depth",o.z+ke),T.setUniform1f("u_outline_width",O);let v=-1;for(const p of a){if(!p.layerData.has(t))continue;p.key.level!==v&&(v=p.key.level,g.setDataUniforms(T,s,o,v,d));const h=p.layerData.get(t);if(h.prepareForRendering(n),!h.outlineIndexCount)continue;const y=h.outlineVAO;y!=null&&(n.bindVAO(y),T.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),n.setStencilFunction(U.EQUAL,p.stencilRef,255),n.drawElements(A.TRIANGLES,h.outlineIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*h.outlineIndexStart),p.triangleCount+=h.outlineIndexCount/3)}}}class bi extends Z{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,t){const{context:o,displayLevel:a,state:r,painter:l,pixelRatio:n,spriteMosaic:s,styleLayerUID:c,requestRender:u,allowDelayedRender:f}=e;if(!t.some(E=>E.layerData.get(c)?.lineIndexCount??!1))return;const d=e.styleLayer,_=d.lineMaterial,x=l.vectorTilesMaterialManager,g=d.getPaintValue("line-translate",a),b=d.getPaintValue("line-translate-anchor",a),O=d.getPaintProperty("line-pattern"),S=O!==void 0,T=S&&O.isDataDriven;let v,p;if(S&&!T){const E=O.getValue(a);v=s.getMosaicItemPosition(E)}let h=!1;if(!S){const E=d.getPaintProperty("line-dasharray");if(p=E!==void 0,h=p&&E.isDataDriven,p&&!h){const D=E.getValue(a),L=d.getDashKey(D,d.getLayoutValue("line-cap",a));v=s.getMosaicItemPosition(L)}}const y=1/n,I=this._programOptions;I.pattern=S,I.sdf=p;const m=x.getMaterialProgram(o,_,I);if(f&&u!=null&&!m.compiled)return void u();if(o.useProgram(m),m.setUniformMatrix3fv("u_displayViewMat3",r.displayViewMat3),m.setUniformMatrix3fv("u_displayMat3",b===J.VIEWPORT?r.displayMat3:r.displayViewMat3),m.setUniform2fv("u_lineTranslation",g),m.setUniform1f("u_depth",d.z),m.setUniform1f("u_antialiasing",y),v&&v!=null){const{page:E}=v,D=s.getPageSize(E);D!=null&&(s.bind(o,B.LINEAR,E,F),m.setUniform2fv("u_mosaicSize",D),m.setUniform1i("u_texture",F))}let V=-1;for(const E of t){if(!E.layerData.has(c))continue;E.key.level!==V&&(V=E.key.level,_.setDataUniforms(m,a,d,V,s));const D=2**(a-V)/n;m.setUniform1f("u_zoomFactor",D);const L=E.layerData.get(c);if(!L.lineIndexCount)continue;L.prepareForRendering(o);const q=L.vao;if(q!=null){if(o.bindVAO(q),m.setUniformMatrix3fv("u_dvsMat3",E.transforms.displayViewScreenMat3),o.setStencilFunction(U.EQUAL,E.stencilRef,255),T||h){const re=L.patternMap;if(!re)continue;for(const[C,X]of re){const z=s.getPageSize(C);z!=null&&(s.bind(o,B.LINEAR,C,F),m.setUniform2fv("u_mosaicSize",z),m.setUniform1i("u_texture",F),o.drawElements(A.TRIANGLES,X[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*X[0]))}}else o.drawElements(A.TRIANGLES,L.lineIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L.lineIndexStart);E.triangleCount+=L.lineIndexCount/3}}}}const Ii=256/360,Ei=1/Math.LN2;function Oi(i,e){return(i%=e)>=0?i:i+e}function He(i){return Oi(i*Ii,256)}function ro(i){return Math.log(i)*Ei}const Ai=1/65536;class Pi extends Z{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=zt()}dispose(){}drawMany(e,t){const o=e.styleLayer;this._drawIcons(e,o,t),this._drawText(e,o,t)}_drawIcons(e,t,o){const{context:a,displayLevel:r,painter:l,spriteMosaic:n,state:s,styleLayerUID:c,requestRender:u,allowDelayedRender:f}=e,d=t.iconMaterial,_=l.vectorTilesMaterialManager;let x,g=!1;for(const m of o)if(m.layerData.has(c)&&(x=m.layerData.get(c),x.iconPerPageElementsMap.size>0)){g=!0;break}if(!g)return;const b=t.getPaintValue("icon-translate",r),O=t.getPaintValue("icon-translate-anchor",r);let S=t.getLayoutValue("icon-rotation-alignment",r);S===G.AUTO&&(S=t.getLayoutValue("symbol-placement",r)===De.POINT?G.VIEWPORT:G.MAP);const T=S===G.MAP,v=t.getLayoutValue("icon-keep-upright",r)&&T,p=x.isIconSDF,h=this._iconProgramOptions;h.sdf=p;const y=_.getMaterialProgram(a,d,h);if(f&&u!=null&&!y.compiled)return void u();a.useProgram(y),y.setUniformMatrix3fv("u_displayViewMat3",S===G.MAP?s.displayViewMat3:s.displayMat3),y.setUniformMatrix3fv("u_displayMat3",O===J.VIEWPORT?s.displayMat3:s.displayViewMat3),y.setUniform2fv("u_iconTranslation",b),y.setUniform1f("u_depth",t.z),y.setUniform1f("u_mapRotation",He(s.rotation)),y.setUniform1f("u_keepUpright",v?1:0),y.setUniform1f("u_level",10*r),y.setUniform1i("u_texture",F),y.setUniform1f("u_fadeDuration",Re/1e3);let I=-1;for(const m of o){if(!m.layerData.has(c)||(m.key.level!==I&&(I=m.key.level,d.setDataUniforms(y,r,t,I,n)),x=m.layerData.get(c),x.iconPerPageElementsMap.size===0))continue;x.prepareForRendering(a),x.updateOpacityInfo();const V=x.iconVAO;if(V!=null){a.bindVAO(V),y.setUniformMatrix3fv("u_dvsMat3",m.transforms.displayViewScreenMat3),y.setUniform1f("u_time",(performance.now()-x.lastOpacityUpdate)/1e3);for(const[E,D]of x.iconPerPageElementsMap)this._renderIconRange(e,y,D,E,m)}}}_renderIconRange(e,t,o,a,r){const{context:l,spriteMosaic:n}=e;this._spritesTextureSize[0]=n.getWidth(a)/4,this._spritesTextureSize[1]=n.getHeight(a)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),n.bind(l,B.LINEAR,a,F),this._setStencilState(e,r),l.drawElements(A.TRIANGLES,o[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*o[0]),r.triangleCount+=o[1]/3}_drawText(e,t,o){const{context:a,displayLevel:r,glyphMosaic:l,painter:n,pixelRatio:s,spriteMosaic:c,state:u,styleLayerUID:f,requestRender:d,allowDelayedRender:_}=e,x=t.textMaterial,g=n.vectorTilesMaterialManager;let b,O=!1;for(const z of o)if(z.layerData.has(f)&&(b=z.layerData.get(f),b.glyphPerPageElementsMap.size>0)){O=!0;break}if(!O)return;const S=t.getPaintProperty("text-opacity");if(S&&!S.isDataDriven&&S.getValue(r)===0)return;const T=t.getPaintProperty("text-color"),v=!T||T.isDataDriven||T.getValue(r)[3]>0,p=t.getPaintProperty("text-halo-width"),h=t.getPaintProperty("text-halo-color"),y=(!p||p.isDataDriven||p.getValue(r)>0)&&(!h||h.isDataDriven||h.getValue(r)[3]>0);if(!v&&!y)return;const I=24/8;let m=t.getLayoutValue("text-rotation-alignment",r);m===G.AUTO&&(m=t.getLayoutValue("symbol-placement",r)===De.POINT?G.VIEWPORT:G.MAP);const V=m===G.MAP,E=t.getLayoutValue("text-keep-upright",r)&&V,D=.8*I/s;this._glyphTextureSize||(this._glyphTextureSize=Vt(l.width/4,l.height/4));const L=t.getPaintValue("text-translate",r),q=t.getPaintValue("text-translate-anchor",r),re=this._sdfProgramOptions,C=g.getMaterialProgram(a,x,re);if(_&&d!=null&&!C.compiled)return void d();a.useProgram(C),C.setUniformMatrix3fv("u_displayViewMat3",m===G.MAP?u.displayViewMat3:u.displayMat3),C.setUniformMatrix3fv("u_displayMat3",q===J.VIEWPORT?u.displayMat3:u.displayViewMat3),C.setUniform2fv("u_textTranslation",L),C.setUniform1f("u_depth",t.z+Ai),C.setUniform2fv("u_mosaicSize",this._glyphTextureSize),C.setUniform1f("u_mapRotation",He(u.rotation)),C.setUniform1f("u_keepUpright",E?1:0),C.setUniform1f("u_level",10*r),C.setUniform1i("u_texture",Pe),C.setUniform1f("u_antialiasingWidth",D),C.setUniform1f("u_fadeDuration",Re/1e3);let X=-1;for(const z of o){if(!z.layerData.has(f)||(z.key.level!==X&&(X=z.key.level,x.setDataUniforms(C,r,t,X,c)),b=z.layerData.get(f),b.glyphPerPageElementsMap.size===0))continue;b.prepareForRendering(a),b.updateOpacityInfo();const Ie=b.textVAO;if(Ie==null)continue;a.bindVAO(Ie),C.setUniformMatrix3fv("u_dvsMat3",z.transforms.displayViewScreenMat3),this._setStencilState(e,z);const st=(performance.now()-b.lastOpacityUpdate)/1e3;C.setUniform1f("u_time",st),b.glyphPerPageElementsMap.forEach((ut,ct)=>{this._renderGlyphRange(a,ut,ct,l,C,y,v,z)})}}_renderGlyphRange(e,t,o,a,r,l,n,s){a.bind(e,B.LINEAR,o,Pe),l&&(r.setUniform1f("u_halo",1),e.drawElements(A.TRIANGLES,t[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3),n&&(r.setUniform1f("u_halo",0),e.drawElements(A.TRIANGLES,t[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3)}_setStencilState(e,t){const{context:o,is3D:a,stencilSymbols:r}=e;if(o.setStencilTestEnabled(!0),r)return o.setStencilWriteMask(255),void o.setStencilFunction(U.ALWAYS,t.stencilRef,255);o.setStencilWriteMask(0),a?o.setStencilFunction(U.EQUAL,t.stencilRef,255):o.setStencilFunction(U.GREATER,255,255)}}const Ci={clip:ti,stencil:ii,bitmap:Yt,tileDebugInfo:xi,vtlBackground:yi,vtlFill:Ti,vtlLine:bi,vtlCircle:Si,vtlSymbol:Pi},Di=i=>{switch(i.BYTES_PER_ELEMENT){case 1:return P.UNSIGNED_BYTE;case 2:return P.UNSIGNED_SHORT;case 4:return P.UNSIGNED_INT;default:throw new Te("Cannot get DataType of array")}},Ri=(i,e,t,o)=>{let a=0;for(let r=1;r0:a<0},We=({coords:i,lengths:e},t)=>{const o=[];for(let a=0,r=0;ae?.dispose()),this._cache.indexBuffer=this._cache.vertexBuffers=null}get elementType(){return Di(this.indices)}getIndexBuffer(e,t=W.STATIC_DRAW){return this._cache.indexBuffer??=k.createIndex(e,t,this.indices),this._cache.indexBuffer}getVertexBuffers(e,t=W.STATIC_DRAW){return this._cache.vertexBuffers??=new Map(Object.keys(this.vertices).reduce((o,a)=>(o.push([a,k.createVertex(e,t,this.vertices[a])]),o),new Array)),this._cache.vertexBuffers}}class be extends $e{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=ft(()=>t.version,()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new be(e,t)}_destroyGL(){this._cache.mesh!=null&&(this._cache.mesh.destroy(),this._cache.mesh=null),this._cache.vao!=null&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,o,a){const[r,l]=t.size;if(this._clip.type!=="geometry"&&this._lastWidth===r&&this._lastHeight===l||(this._lastWidth=r,this._lastHeight=l,this._destroyGL()),this._cache.vao==null){const n=this._createMesh(t,this._clip),s=n.getIndexBuffer(e),c=n.getVertexBuffers(e);this._cache.mesh=n,this._cache.vao=new K(e,o,a,c,s)}return this._cache.vao}_createTransforms(){return{displayViewScreenMat3:oe()}}_invalidate(){this._destroyGL(),this.requestRender()}_createMesh(e,t){switch(t.type){case"rect":return w.fromScreenExtent(Ot(t,e.size[0],e.size[1]));case"path":return w.fromPath(t);case"geometry":return w.fromGeometry(e,t);default:return Se.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new Te("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),w.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}}class lo extends Dt{set clips(e){super.clips=e,this._updateClippingInfo(e)}renderChildren(e){e.painter.setPipelineState(null),this._renderPasses==null&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const t of this._renderPasses)try{t.render(e)}catch{}}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[Ci.clip],target:()=>this._clippingInfos,drawPhase:ee.MAP|ee.LABEL|ee.LABEL_ALPHA|ee.DEBUG|ee.HIGHLIGHT})]}_updateClippingInfo(e){this._clippingInfos!=null&&(this._clippingInfos.forEach(t=>t.destroy()),this._clippingInfos=null),e!=null&&e.length&&(this._clippingInfos=e.items.map(t=>be.fromClipArea(this.stage,t))),this.requestRender()}}export{Ut as F,oi as K,lo as N,ro as R,ii as Z,oo as a,gi as i,Z as k,ao as m,io as n,fe as o,xi as r,Ci as s}; diff --git a/main/assets/WMSLayer-C8eYRV4V-BmaQhELn.js b/main/assets/WMSLayer-C8eYRV4V-BmaQhELn.js new file mode 100644 index 000000000..2edaeb28c --- /dev/null +++ b/main/assets/WMSLayer-C8eYRV4V-BmaQhELn.js @@ -0,0 +1,2 @@ +import{bR as Me,ai as $,av as F,ah as H,bG as Ce,ag as z,v as a,S as u,n as L,a0 as O,ad as Te,i as xe,aK as je,W as $e,J as N,a as we,y as ie,f as W,aC as qe,bZ as Be,bL as Ve,bi as We,c as ke,C as De,o as ve,P as Ge,ac as k,bB as Xe,aq as U,F as He,b_ as Je,b$ as Ze}from"./main-C7yV2j71.js";import{f as ze}from"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import{_ as Ke,m as Qe}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{c as se}from"./scaleUtils-DxsfQwK1-B4OFXqEO.js";import{D as Ye}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as et}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as tt}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as rt}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as nt}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as it}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{x as st}from"./TemporalLayer-CpOrN_w9-D1I2RE1l.js";import{n as J}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{U as at}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{_ as ot,Z as lt}from"./commonProperties-BtIqvFU_-DuUske_0.js";import{r as ae}from"./ExportWMSImageParameters-CMk80WSM-CQGcVQcn.js";import{i as ut}from"./imageBitmapUtils-DA36kg39-BPA5qQx5.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeInfo-w_HB2CsF-Ce-xYAJs.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";var M;let pt=0,y=M=class extends Me(Ke){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},F),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},F)])}get id(){return this._get("id")??pt++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ce(z.ofType(M),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){const e=new M;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=this.fullExtents?.map(t=>t.clone())??null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers?.map(t=>t.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=this.spatialReferences?.map(t=>t)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};a([u()],y.prototype,"description",void 0),a([u({readOnly:!0})],y.prototype,"dimensions",void 0),a([u({type:L,json:{name:"extent"}})],y.prototype,"fullExtent",void 0),a([u()],y.prototype,"fullExtents",void 0),a([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],y.prototype,"id",null),a([u({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],y.prototype,"legendUrl",void 0),a([O("legendUrl",["legendUrl","legendURL"])],y.prototype,"readLegendUrl",null),a([u({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],y.prototype,"legendEnabled",void 0),a([u()],y.prototype,"layer",void 0),a([u()],y.prototype,"maxScale",void 0),a([u()],y.prototype,"minScale",void 0),a([u({readOnly:!0})],y.prototype,"effectiveScaleRange",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"name",void 0),a([u()],y.prototype,"parent",void 0),a([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],y.prototype,"popupEnabled",void 0),a([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],y.prototype,"queryable",void 0),a([u()],y.prototype,"sublayers",void 0),a([Te("sublayers")],y.prototype,"castSublayers",null),a([u({type:[Number],json:{read:{source:"spatialReferences"}}})],y.prototype,"spatialReferences",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"title",void 0),a([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],y.prototype,"visible",null),y=M=a([xe("esri.layers.support.WMSSublayer")],y);const Z=y,oe={84:4326,83:4269,27:4267};function mt(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(P=>P.textContent).join(`\r +`);throw new ve("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",b)}const n=g("Capability",r),i=g("Service",r),l=n&&g("Request",n);if(!n||!i||!l)return null;const s=g("Layer",n);if(!s)return null;const c=r.nodeName==="WMS_Capabilities"||r.nodeName==="WMT_MS_Capabilities"?r.getAttribute("version"):"1.3.0",o=w("Title",i,"")||w("Name",i,""),p=w("AccessConstraints",i,""),f=/^none$/i.test(p)?"":p,d=w("Abstract",i,""),x=parseInt(w("MaxWidth",i,"5000"),10),v=parseInt(w("MaxHeight",i,"5000"),10),S=ue(l,"GetMap"),I=le(l,"GetMap"),h=j(s,c,t);if(!h)return null;let K,q=0;const Ee=Array.prototype.slice.call(n.childNodes),Re=h.sublayers??[],Q=b=>{b!=null&&Re.push(b)};Ee.forEach(b=>{b.nodeName==="Layer"&&(q===0?K=b:(q===1&&h.name&&(h.name="",Q(j(K,c,t))),Q(j(b,c,t))),q++)});let E=h.sublayers,B=h.extent;const Oe=h.fullExtents??[];if(E||(E=[]),E.length===0&&E.push(h),!B){const b=new L(E[0].extent);h.extent=b.toJSON(),B=h.extent}const Le=h.spatialReferences.length>0?h.spatialReferences:Se(h),Y=le(l,"GetFeatureInfo"),Pe=Y?ue(l,"GetFeatureInfo"):null,ee=Ie(E),Ae=h.minScale||0,Ue=h.maxScale||0,te=h.dimensions??[],_e=ee.reduce((b,P)=>b.concat(P.dimensions??[]),[]),re=te.concat(_e).filter(Ne);let ne=null;if(re.length){const b=re.map(P=>{const{extent:V}=P;return ft(V)?V.map(_=>_.getTime()):V?.map(_=>[_.min.getTime(),_.max.getTime()])}).flat(2).filter(U);ne={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...b),Math.max(...b)]}}return{copyright:f,description:d,dimensions:te,extent:B,fullExtents:Oe,featureInfoFormats:Pe,featureInfoUrl:Y,mapUrl:I,maxWidth:x,maxHeight:v,maxScale:Ue,minScale:Ae,layers:ee,spatialReferences:Le,supportedImageFormatTypes:S,timeInfo:ne,title:o,version:c}}function ct(e){const t=e.filter(r=>r.popupEnabled&&r.name&&r.queryable);return t.length?t.map(({name:r})=>r).join():null}function Se(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const r=Se(t);if(r.length>0)return r}return[]}function Ie(e){let t=[];for(const r of e)t.push(r),r.sublayers?.length&&(t=t.concat(Ie(r.sublayers)),delete r.sublayers);return t}function C(e,t,r){return t.getAttribute(e)??r}function dt(e,t,r,n){const i=g(e,r);return i?C(t,i,n):n}function g(e,t){for(let r=0;ri).filter(U);const n=[];for(const i of r)if(i.getAttribute("name")===t){const l=T("Format",i);for(const{textContent:s}of l)s!=null&&n.push(s)}return n}function pe(e,t,r){const n=g(t,e);if(!n)return r;const{textContent:i}=n;if(i==null||i==="")return r;const l=Number(i);return isNaN(l)?r:l}function j(e,t,r){if(!e)return null;const n={id:r.idCounter++,fullExtents:[],parentLayerId:null,queryable:e.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},i=g("LatLonBoundingBox",e),l=g("EX_GeographicBoundingBox",e);let s=null;i&&(s=A(i,4326)),l&&(s=new L(0,0,0,0,new N({wkid:4326})),s.xmin=parseFloat(w("westBoundLongitude",l,"0")),s.ymin=parseFloat(w("southBoundLatitude",l,"0")),s.xmax=parseFloat(w("eastBoundLongitude",l,"0")),s.ymax=parseFloat(w("northBoundLatitude",l,"0"))),i||l||(s=new L(-180,-90,180,90,new N({wkid:4326}))),n.minScale=pe(e,"MaxScaleDenominator",0),n.maxScale=pe(e,"MinScaleDenominator",0);const c=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(o=>{if(o.nodeName==="Name")n.name=o.textContent||"";else if(o.nodeName==="Title")n.title=o.textContent||"";else if(o.nodeName==="Abstract")n.description=o.textContent||"";else if(o.nodeName==="BoundingBox"){const p=o.getAttribute(c);if(p&&p.indexOf("EPSG:")===0){const d=parseInt(p.slice(5),10);d===0||isNaN(d)||s||(s=t==="1.3.0"?A(o,d,J(d)):A(o,d))}const f=p?.indexOf(":");if(f&&f>-1){let d=parseInt(p.slice(f+1),10);d===0||isNaN(d)||(d=oe[d]??d);const x=t==="1.3.0"?A(o,d,J(d)):A(o,d);x&&n.fullExtents&&n.fullExtents.push(x)}}else if(o.nodeName===c)(o.textContent?.split(" ")??[]).forEach(p=>{let f=NaN;if(p.includes(":")){const[d,x]=p.toUpperCase().split(":");d!=="CRS"&&d!=="EPSG"||(f=parseInt(x,10))}else f=parseInt(p,10);if(f!==0&&!isNaN(f)){const d=oe[f]??f;n.spatialReferences.includes(d)||n.spatialReferences.push(d)}});else if(o.nodeName!=="Style"||n.legendUrl){if(o.nodeName==="Layer"){const p=j(o,t,r);p&&(p.parentLayerId=n.id,n.sublayers||(n.sublayers=[]),n.sublayers.push(p))}}else{const p=g("LegendURL",o);if(p){const f=g("OnlineResource",p);f&&(n.legendUrl=f.getAttribute("xlink:href"))}}}),n.extent=s?.toJSON(),n.dimensions=T("Dimension",e).filter(o=>o.getAttribute("name")&&o.getAttribute("units")&&o.textContent).map(o=>{const p=o.getAttribute("name"),f=o.getAttribute("units"),d=o.textContent,x=o.getAttribute("unitSymbol")??void 0,v=o.getAttribute("default")??void 0,S=C("default",o,"0")!=="0",I=C("nearestValue",o,"0")!=="0",h=C("current",o,"0")!=="0";return Ne({name:p,units:f})?{name:"time",units:"ISO8601",extent:de(d),default:de(v),multipleValues:S,nearestValue:I,current:h}:yt({name:p,units:f})?{name:"elevation",units:f,extent:me(d),unitSymbol:x,default:me(v),multipleValues:S,nearestValue:I}:{name:p,units:f,extent:ce(d),unitSymbol:x,default:ce(v),multipleValues:S,nearestValue:I}}),n}function ft(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function Fe(e){return e.nodeType===Node.ELEMENT_NODE}function yt(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function Ne(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function ht(e,t){const r=[],n=we(e);for(const i in n.query)n.query.hasOwnProperty(i)&&(t.includes(i.toLowerCase())||r.push(i+"="+n.query[i]));return n.path+(r.length?"?"+r.join("&"):"")}function me(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:parseFloat(i[0]),max:parseFloat(i[1]),resolution:i.length>=3&&i[2]!=="0"?parseFloat(i[2]):void 0}}).filter(U):r.map(n=>parseFloat(n))}function ce(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:i[0],max:i[1],resolution:i.length>=3&&i[2]!=="0"?i[2]:void 0}}).filter(U):r}function de(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:D(i[0]),max:D(i[1]),resolution:i.length>=3&&i[2]!=="0"?gt(i[2]):void 0}}).filter(U):r.map(n=>D(n))}function D(e){return He.fromISO(e,{zone:Je.utcInstance}).toJSDate()}function gt(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,r=e.match(t);return r?{years:R(r[1]),months:R(r[2]),days:R(r[3]),hours:R(r[4]),minutes:R(r[5]),seconds:R(r[6])}:null}function R(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,r=e.match(t);if(!r)return 0;const n=r[0].replace(",",".");return Number(n)}function G(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const bt="0000-01-01T00:00:00Z",xt="9999-12-31T23:59:59Z";function fe(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:r}=e;return t&&r&&t.getTime()===r.getTime()?`${G(t)}`:`${t?G(t):bt}/${r?G(r):xt}`}const ye=new Set([102100,3857,102113,900913]),wt=new Set([3395,54004]);function vt(e,t){let r=e.wkid;return t==null?r:(r!=null&&t.includes(r)||!e.latestWkid||(r=e.latestWkid),r!=null&&ye.has(r)?t.find(n=>ye.has(n))||t.find(n=>wt.has(n))||102100:r)}const X=new je({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function he(e){return e==="text/html"}function ge(e){return e==="text/plain"}let m=class extends et(st(nt(it(tt(rt(Qe(Ye))))))){constructor(...e){super(...e),this.allSublayers=new ze({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},F)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch($e).then(()=>this._fetchService(t)).then(()=>this._checkLayerValidity())),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new L({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(he)??this.featureInfoFormats.find(ge)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(he(e)||ge(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new N(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter(n=>n!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return be(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return be(t.layers,r)}writeSublayers(e,t,r,n){t.layers=[];const i=new Map,l=e.flatten(({sublayers:s})=>s??[]);for(const s of l)if(typeof s.parent?.id=="number"){const c=i.get(s.parent.id);c!=null?c.push(s.id):i.set(s.parent.id,[s.id])}for(const s of l){const c={sublayer:s,...n},o=s.write({parentLayerId:typeof s.parent?.id=="number"?s.parent.id:-1},c);if(i.has(s.id)&&(o.sublayerIds=i.get(s.id)),!s.sublayers&&s.name){const p=s.write({},c);delete p.id,t.layers.push(p)}}t.visibleLayers=l.filter(({visible:s,sublayers:c})=>s&&!c).map(({name:s})=>s).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=we(e);for(const i in r)/^(request|service)$/i.test(i)&&delete r[i];const n=ie(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const i=n?.pixelRatio??1,l=se({extent:e,width:t})*i,s=new ae({layer:this,scale:l}),{xmin:c,ymin:o,xmax:p,ymax:f,spatialReference:d}=e,x=vt(d,this.spatialReferences),v=this.version==="1.3.0"&&J(x)?`${o},${c},${f},${p}`:`${c},${o},${p},${f}`,S=s.toJSON(),I=this.version==="1.3.0"?"crs":"srs";return{bbox:v,[I]:x==null||isNaN(x)?void 0:"EPSG:"+x,...S}}async fetchImage(e,t,r,n){const i=this.mapUrl,l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const o=document.createElement("canvas");return o.width=t,o.height=r,o}const s=fe(n?.timeExtent),c={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal};return W(i??"",c).then(o=>o.data)}async fetchImageBitmap(e,t,r,n){const i=this.mapUrl??"",l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const p=document.createElement("canvas");return p.width=t,p.height=r,p}const s=fe(n?.timeExtent),c={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal},{data:o}=await W(i,c);return ut(o,i,n?.signal)}fetchFeatureInfo(e,t,r,n,i){const l=se({extent:e,width:t}),s=new ae({layer:this,scale:l}),c=ct(s.visibleSublayers);if(this.featureInfoUrl==null||c==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const o=this.version==="1.3.0"?{I:n,J:i}:{x:n,y:i},p={query_layers:c,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...o},f={...this.createExportImageParameters(e,t,r),...p},d=this._mixCustomParameters(f);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(d):this._defaultFetchFeatureInfoFunction(ie(this.featureInfoUrl,d))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return at(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?N.WebMercator:new N({wkid:t});return qe(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=Be(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new Ve({title:this.title,content:t}),n=new We({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:n}=await W(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=mt(n)}if(this.parsedUrl){const t=new ke(this.parsedUrl.path),{httpsDomains:r}=De.request;t.scheme!=="https"||t.port&&t.port!=="443"||!t.host||r.includes(t.host)||r.push(t.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new ve("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function St(e,t){return e.some(r=>{for(const n in r)if(Ze(r,n,null,t))return!0;return!1})}function be(e,t,r){e=e??[];const n=new Map;e.every(l=>l.id==null)&&(e=Ge(e)).forEach((l,s)=>l.id=s);for(const l of e){const s=new Z;s.read(l,t),r&&!r.includes(s.name)&&(s.visible=!1),n.set(s.id,s)}const i=[];for(const l of e){const s=l.id!=null?n.get(l.id):null;if(s)if(l.parentLayerId!=null&&l.parentLayerId>=0){const c=n.get(l.parentLayerId);if(!c)continue;c.sublayers||(c.sublayers=new z),c.sublayers.push(s)}else i.push(s)}return i}a([u({readOnly:!0})],m.prototype,"allSublayers",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customParameters",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customLayerParameters",void 0),a([u({type:String,json:{write:!0}})],m.prototype,"copyright",void 0),a([u()],m.prototype,"description",void 0),a([u({readOnly:!0})],m.prototype,"dimensions",void 0),a([u({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],m.prototype,"fullExtent",void 0),a([O(["web-document","portal-item"],"fullExtent",["extent"])],m.prototype,"readFullExtentFromItemOrMap",null),a([k(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],m.prototype,"writeFullExtent",null),a([u()],m.prototype,"fullExtents",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoFormat",null),a([u({type:[String],readOnly:!0})],m.prototype,"featureInfoFormats",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoUrl",void 0),a([u()],m.prototype,"fetchFeatureInfoFunction",void 0),a([u({type:String,json:{origins:{"web-document":{default:"image/png",type:X.jsonValues,read:{reader:X.read,source:"format"},write:{writer:X.write,target:"format"}}}}})],m.prototype,"imageFormat",void 0),a([O("imageFormat",["supportedImageFormatTypes"])],m.prototype,"readImageFormat",null),a([u({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],m.prototype,"imageMaxHeight",void 0),a([u({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],m.prototype,"imageMaxWidth",void 0),a([u()],m.prototype,"imageTransparency",void 0),a([u(ot)],m.prototype,"legendEnabled",void 0),a([u({type:["show","hide","hide-children"]})],m.prototype,"listMode",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"mapUrl",void 0),a([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],m.prototype,"isReference",void 0),a([u({type:["WMS"]})],m.prototype,"operationalLayerType",void 0),a([u()],m.prototype,"resourceInfo",void 0),a([u({type:N,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],m.prototype,"spatialReference",void 0),a([O(["web-document","portal-item"],"spatialReference",["spatialReferences"])],m.prototype,"readSpatialReferenceFromItemOrDocument",null),a([u({type:[Xe],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],m.prototype,"spatialReferences",void 0),a([k(["web-document","portal-item"],"spatialReferences")],m.prototype,"writeSpatialReferences",null),a([u({type:z.ofType(Z),json:{write:{target:"layers",overridePolicy(e,t,r){if(St(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],m.prototype,"sublayers",void 0),a([O(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],m.prototype,"readSublayersFromItemOrMap",null),a([O("service","sublayers",["layers"])],m.prototype,"readSublayers",null),a([k("sublayers",{layers:{type:[Z]},visibleLayers:{type:[String]}})],m.prototype,"writeSublayers",null),a([u({json:{read:!1},readOnly:!0,value:"wms"})],m.prototype,"type",void 0),a([u(lt)],m.prototype,"url",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"version",void 0),m=a([xe("esri.layers.WMSLayer")],m);const Qt=m;export{Qt as default}; diff --git a/main/assets/WMSLayer-C8eYRV4V-ozTC3oB7.js b/main/assets/WMSLayer-C8eYRV4V-ozTC3oB7.js deleted file mode 100644 index 2379fabda..000000000 --- a/main/assets/WMSLayer-C8eYRV4V-ozTC3oB7.js +++ /dev/null @@ -1,2 +0,0 @@ -import{bR as Me,ai as $,av as F,ah as H,bG as Ce,ag as z,v as a,S as u,n as L,a0 as O,ad as Te,i as xe,aK as je,W as $e,J as N,a as we,y as ie,f as W,aC as qe,bZ as Be,bL as Ve,bi as We,c as ke,C as De,o as ve,P as Ge,ac as k,bB as Xe,aq as U,F as He,b_ as Je,b$ as Ze}from"./main-BZaw9FpY.js";import{f as ze}from"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import{_ as Ke,m as Qe}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{c as se}from"./scaleUtils-DxsfQwK1-OKeSqBb9.js";import{D as Ye}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as et}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as tt}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as rt}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as nt}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as it}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{x as st}from"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import{n as J}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{U as at}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{_ as ot,Z as lt}from"./commonProperties-BtIqvFU_-Brj0aAM1.js";import{r as ae}from"./ExportWMSImageParameters-CMk80WSM-CXXj-iAb.js";import{i as ut}from"./imageBitmapUtils-DA36kg39-CBVFUZAU.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";var M;let pt=0,y=M=class extends Me(Ke){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},F),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},F)])}get id(){return this._get("id")??pt++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ce(z.ofType(M),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){const e=new M;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=this.fullExtents?.map(t=>t.clone())??null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers?.map(t=>t.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=this.spatialReferences?.map(t=>t)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};a([u()],y.prototype,"description",void 0),a([u({readOnly:!0})],y.prototype,"dimensions",void 0),a([u({type:L,json:{name:"extent"}})],y.prototype,"fullExtent",void 0),a([u()],y.prototype,"fullExtents",void 0),a([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],y.prototype,"id",null),a([u({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],y.prototype,"legendUrl",void 0),a([O("legendUrl",["legendUrl","legendURL"])],y.prototype,"readLegendUrl",null),a([u({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],y.prototype,"legendEnabled",void 0),a([u()],y.prototype,"layer",void 0),a([u()],y.prototype,"maxScale",void 0),a([u()],y.prototype,"minScale",void 0),a([u({readOnly:!0})],y.prototype,"effectiveScaleRange",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"name",void 0),a([u()],y.prototype,"parent",void 0),a([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],y.prototype,"popupEnabled",void 0),a([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],y.prototype,"queryable",void 0),a([u()],y.prototype,"sublayers",void 0),a([Te("sublayers")],y.prototype,"castSublayers",null),a([u({type:[Number],json:{read:{source:"spatialReferences"}}})],y.prototype,"spatialReferences",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"title",void 0),a([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],y.prototype,"visible",null),y=M=a([xe("esri.layers.support.WMSSublayer")],y);const Z=y,oe={84:4326,83:4269,27:4267};function mt(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(P=>P.textContent).join(`\r -`);throw new ve("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",b)}const n=g("Capability",r),i=g("Service",r),l=n&&g("Request",n);if(!n||!i||!l)return null;const s=g("Layer",n);if(!s)return null;const c=r.nodeName==="WMS_Capabilities"||r.nodeName==="WMT_MS_Capabilities"?r.getAttribute("version"):"1.3.0",o=w("Title",i,"")||w("Name",i,""),p=w("AccessConstraints",i,""),f=/^none$/i.test(p)?"":p,d=w("Abstract",i,""),x=parseInt(w("MaxWidth",i,"5000"),10),v=parseInt(w("MaxHeight",i,"5000"),10),S=ue(l,"GetMap"),I=le(l,"GetMap"),h=j(s,c,t);if(!h)return null;let K,q=0;const Ee=Array.prototype.slice.call(n.childNodes),Re=h.sublayers??[],Q=b=>{b!=null&&Re.push(b)};Ee.forEach(b=>{b.nodeName==="Layer"&&(q===0?K=b:(q===1&&h.name&&(h.name="",Q(j(K,c,t))),Q(j(b,c,t))),q++)});let E=h.sublayers,B=h.extent;const Oe=h.fullExtents??[];if(E||(E=[]),E.length===0&&E.push(h),!B){const b=new L(E[0].extent);h.extent=b.toJSON(),B=h.extent}const Le=h.spatialReferences.length>0?h.spatialReferences:Se(h),Y=le(l,"GetFeatureInfo"),Pe=Y?ue(l,"GetFeatureInfo"):null,ee=Ie(E),Ae=h.minScale||0,Ue=h.maxScale||0,te=h.dimensions??[],_e=ee.reduce((b,P)=>b.concat(P.dimensions??[]),[]),re=te.concat(_e).filter(Ne);let ne=null;if(re.length){const b=re.map(P=>{const{extent:V}=P;return ft(V)?V.map(_=>_.getTime()):V?.map(_=>[_.min.getTime(),_.max.getTime()])}).flat(2).filter(U);ne={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...b),Math.max(...b)]}}return{copyright:f,description:d,dimensions:te,extent:B,fullExtents:Oe,featureInfoFormats:Pe,featureInfoUrl:Y,mapUrl:I,maxWidth:x,maxHeight:v,maxScale:Ue,minScale:Ae,layers:ee,spatialReferences:Le,supportedImageFormatTypes:S,timeInfo:ne,title:o,version:c}}function ct(e){const t=e.filter(r=>r.popupEnabled&&r.name&&r.queryable);return t.length?t.map(({name:r})=>r).join():null}function Se(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const r=Se(t);if(r.length>0)return r}return[]}function Ie(e){let t=[];for(const r of e)t.push(r),r.sublayers?.length&&(t=t.concat(Ie(r.sublayers)),delete r.sublayers);return t}function C(e,t,r){return t.getAttribute(e)??r}function dt(e,t,r,n){const i=g(e,r);return i?C(t,i,n):n}function g(e,t){for(let r=0;ri).filter(U);const n=[];for(const i of r)if(i.getAttribute("name")===t){const l=T("Format",i);for(const{textContent:s}of l)s!=null&&n.push(s)}return n}function pe(e,t,r){const n=g(t,e);if(!n)return r;const{textContent:i}=n;if(i==null||i==="")return r;const l=Number(i);return isNaN(l)?r:l}function j(e,t,r){if(!e)return null;const n={id:r.idCounter++,fullExtents:[],parentLayerId:null,queryable:e.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},i=g("LatLonBoundingBox",e),l=g("EX_GeographicBoundingBox",e);let s=null;i&&(s=A(i,4326)),l&&(s=new L(0,0,0,0,new N({wkid:4326})),s.xmin=parseFloat(w("westBoundLongitude",l,"0")),s.ymin=parseFloat(w("southBoundLatitude",l,"0")),s.xmax=parseFloat(w("eastBoundLongitude",l,"0")),s.ymax=parseFloat(w("northBoundLatitude",l,"0"))),i||l||(s=new L(-180,-90,180,90,new N({wkid:4326}))),n.minScale=pe(e,"MaxScaleDenominator",0),n.maxScale=pe(e,"MinScaleDenominator",0);const c=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(o=>{if(o.nodeName==="Name")n.name=o.textContent||"";else if(o.nodeName==="Title")n.title=o.textContent||"";else if(o.nodeName==="Abstract")n.description=o.textContent||"";else if(o.nodeName==="BoundingBox"){const p=o.getAttribute(c);if(p&&p.indexOf("EPSG:")===0){const d=parseInt(p.slice(5),10);d===0||isNaN(d)||s||(s=t==="1.3.0"?A(o,d,J(d)):A(o,d))}const f=p?.indexOf(":");if(f&&f>-1){let d=parseInt(p.slice(f+1),10);d===0||isNaN(d)||(d=oe[d]??d);const x=t==="1.3.0"?A(o,d,J(d)):A(o,d);x&&n.fullExtents&&n.fullExtents.push(x)}}else if(o.nodeName===c)(o.textContent?.split(" ")??[]).forEach(p=>{let f=NaN;if(p.includes(":")){const[d,x]=p.toUpperCase().split(":");d!=="CRS"&&d!=="EPSG"||(f=parseInt(x,10))}else f=parseInt(p,10);if(f!==0&&!isNaN(f)){const d=oe[f]??f;n.spatialReferences.includes(d)||n.spatialReferences.push(d)}});else if(o.nodeName!=="Style"||n.legendUrl){if(o.nodeName==="Layer"){const p=j(o,t,r);p&&(p.parentLayerId=n.id,n.sublayers||(n.sublayers=[]),n.sublayers.push(p))}}else{const p=g("LegendURL",o);if(p){const f=g("OnlineResource",p);f&&(n.legendUrl=f.getAttribute("xlink:href"))}}}),n.extent=s?.toJSON(),n.dimensions=T("Dimension",e).filter(o=>o.getAttribute("name")&&o.getAttribute("units")&&o.textContent).map(o=>{const p=o.getAttribute("name"),f=o.getAttribute("units"),d=o.textContent,x=o.getAttribute("unitSymbol")??void 0,v=o.getAttribute("default")??void 0,S=C("default",o,"0")!=="0",I=C("nearestValue",o,"0")!=="0",h=C("current",o,"0")!=="0";return Ne({name:p,units:f})?{name:"time",units:"ISO8601",extent:de(d),default:de(v),multipleValues:S,nearestValue:I,current:h}:yt({name:p,units:f})?{name:"elevation",units:f,extent:me(d),unitSymbol:x,default:me(v),multipleValues:S,nearestValue:I}:{name:p,units:f,extent:ce(d),unitSymbol:x,default:ce(v),multipleValues:S,nearestValue:I}}),n}function ft(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function Fe(e){return e.nodeType===Node.ELEMENT_NODE}function yt(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function Ne(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function ht(e,t){const r=[],n=we(e);for(const i in n.query)n.query.hasOwnProperty(i)&&(t.includes(i.toLowerCase())||r.push(i+"="+n.query[i]));return n.path+(r.length?"?"+r.join("&"):"")}function me(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:parseFloat(i[0]),max:parseFloat(i[1]),resolution:i.length>=3&&i[2]!=="0"?parseFloat(i[2]):void 0}}).filter(U):r.map(n=>parseFloat(n))}function ce(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:i[0],max:i[1],resolution:i.length>=3&&i[2]!=="0"?i[2]:void 0}}).filter(U):r}function de(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:D(i[0]),max:D(i[1]),resolution:i.length>=3&&i[2]!=="0"?gt(i[2]):void 0}}).filter(U):r.map(n=>D(n))}function D(e){return He.fromISO(e,{zone:Je.utcInstance}).toJSDate()}function gt(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,r=e.match(t);return r?{years:R(r[1]),months:R(r[2]),days:R(r[3]),hours:R(r[4]),minutes:R(r[5]),seconds:R(r[6])}:null}function R(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,r=e.match(t);if(!r)return 0;const n=r[0].replace(",",".");return Number(n)}function G(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const bt="0000-01-01T00:00:00Z",xt="9999-12-31T23:59:59Z";function fe(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:r}=e;return t&&r&&t.getTime()===r.getTime()?`${G(t)}`:`${t?G(t):bt}/${r?G(r):xt}`}const ye=new Set([102100,3857,102113,900913]),wt=new Set([3395,54004]);function vt(e,t){let r=e.wkid;return t==null?r:(r!=null&&t.includes(r)||!e.latestWkid||(r=e.latestWkid),r!=null&&ye.has(r)?t.find(n=>ye.has(n))||t.find(n=>wt.has(n))||102100:r)}const X=new je({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function he(e){return e==="text/html"}function ge(e){return e==="text/plain"}let m=class extends et(st(nt(it(tt(rt(Qe(Ye))))))){constructor(...e){super(...e),this.allSublayers=new ze({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},F)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch($e).then(()=>this._fetchService(t)).then(()=>this._checkLayerValidity())),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new L({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(he)??this.featureInfoFormats.find(ge)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(he(e)||ge(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new N(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter(n=>n!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return be(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return be(t.layers,r)}writeSublayers(e,t,r,n){t.layers=[];const i=new Map,l=e.flatten(({sublayers:s})=>s??[]);for(const s of l)if(typeof s.parent?.id=="number"){const c=i.get(s.parent.id);c!=null?c.push(s.id):i.set(s.parent.id,[s.id])}for(const s of l){const c={sublayer:s,...n},o=s.write({parentLayerId:typeof s.parent?.id=="number"?s.parent.id:-1},c);if(i.has(s.id)&&(o.sublayerIds=i.get(s.id)),!s.sublayers&&s.name){const p=s.write({},c);delete p.id,t.layers.push(p)}}t.visibleLayers=l.filter(({visible:s,sublayers:c})=>s&&!c).map(({name:s})=>s).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=we(e);for(const i in r)/^(request|service)$/i.test(i)&&delete r[i];const n=ie(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const i=n?.pixelRatio??1,l=se({extent:e,width:t})*i,s=new ae({layer:this,scale:l}),{xmin:c,ymin:o,xmax:p,ymax:f,spatialReference:d}=e,x=vt(d,this.spatialReferences),v=this.version==="1.3.0"&&J(x)?`${o},${c},${f},${p}`:`${c},${o},${p},${f}`,S=s.toJSON(),I=this.version==="1.3.0"?"crs":"srs";return{bbox:v,[I]:x==null||isNaN(x)?void 0:"EPSG:"+x,...S}}async fetchImage(e,t,r,n){const i=this.mapUrl,l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const o=document.createElement("canvas");return o.width=t,o.height=r,o}const s=fe(n?.timeExtent),c={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal};return W(i??"",c).then(o=>o.data)}async fetchImageBitmap(e,t,r,n){const i=this.mapUrl??"",l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const p=document.createElement("canvas");return p.width=t,p.height=r,p}const s=fe(n?.timeExtent),c={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal},{data:o}=await W(i,c);return ut(o,i,n?.signal)}fetchFeatureInfo(e,t,r,n,i){const l=se({extent:e,width:t}),s=new ae({layer:this,scale:l}),c=ct(s.visibleSublayers);if(this.featureInfoUrl==null||c==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const o=this.version==="1.3.0"?{I:n,J:i}:{x:n,y:i},p={query_layers:c,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...o},f={...this.createExportImageParameters(e,t,r),...p},d=this._mixCustomParameters(f);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(d):this._defaultFetchFeatureInfoFunction(ie(this.featureInfoUrl,d))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return at(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?N.WebMercator:new N({wkid:t});return qe(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=Be(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new Ve({title:this.title,content:t}),n=new We({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:n}=await W(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=mt(n)}if(this.parsedUrl){const t=new ke(this.parsedUrl.path),{httpsDomains:r}=De.request;t.scheme!=="https"||t.port&&t.port!=="443"||!t.host||r.includes(t.host)||r.push(t.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new ve("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function St(e,t){return e.some(r=>{for(const n in r)if(Ze(r,n,null,t))return!0;return!1})}function be(e,t,r){e=e??[];const n=new Map;e.every(l=>l.id==null)&&(e=Ge(e)).forEach((l,s)=>l.id=s);for(const l of e){const s=new Z;s.read(l,t),r&&!r.includes(s.name)&&(s.visible=!1),n.set(s.id,s)}const i=[];for(const l of e){const s=l.id!=null?n.get(l.id):null;if(s)if(l.parentLayerId!=null&&l.parentLayerId>=0){const c=n.get(l.parentLayerId);if(!c)continue;c.sublayers||(c.sublayers=new z),c.sublayers.push(s)}else i.push(s)}return i}a([u({readOnly:!0})],m.prototype,"allSublayers",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customParameters",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customLayerParameters",void 0),a([u({type:String,json:{write:!0}})],m.prototype,"copyright",void 0),a([u()],m.prototype,"description",void 0),a([u({readOnly:!0})],m.prototype,"dimensions",void 0),a([u({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],m.prototype,"fullExtent",void 0),a([O(["web-document","portal-item"],"fullExtent",["extent"])],m.prototype,"readFullExtentFromItemOrMap",null),a([k(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],m.prototype,"writeFullExtent",null),a([u()],m.prototype,"fullExtents",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoFormat",null),a([u({type:[String],readOnly:!0})],m.prototype,"featureInfoFormats",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoUrl",void 0),a([u()],m.prototype,"fetchFeatureInfoFunction",void 0),a([u({type:String,json:{origins:{"web-document":{default:"image/png",type:X.jsonValues,read:{reader:X.read,source:"format"},write:{writer:X.write,target:"format"}}}}})],m.prototype,"imageFormat",void 0),a([O("imageFormat",["supportedImageFormatTypes"])],m.prototype,"readImageFormat",null),a([u({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],m.prototype,"imageMaxHeight",void 0),a([u({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],m.prototype,"imageMaxWidth",void 0),a([u()],m.prototype,"imageTransparency",void 0),a([u(ot)],m.prototype,"legendEnabled",void 0),a([u({type:["show","hide","hide-children"]})],m.prototype,"listMode",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"mapUrl",void 0),a([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],m.prototype,"isReference",void 0),a([u({type:["WMS"]})],m.prototype,"operationalLayerType",void 0),a([u()],m.prototype,"resourceInfo",void 0),a([u({type:N,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],m.prototype,"spatialReference",void 0),a([O(["web-document","portal-item"],"spatialReference",["spatialReferences"])],m.prototype,"readSpatialReferenceFromItemOrDocument",null),a([u({type:[Xe],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],m.prototype,"spatialReferences",void 0),a([k(["web-document","portal-item"],"spatialReferences")],m.prototype,"writeSpatialReferences",null),a([u({type:z.ofType(Z),json:{write:{target:"layers",overridePolicy(e,t,r){if(St(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],m.prototype,"sublayers",void 0),a([O(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],m.prototype,"readSublayersFromItemOrMap",null),a([O("service","sublayers",["layers"])],m.prototype,"readSublayers",null),a([k("sublayers",{layers:{type:[Z]},visibleLayers:{type:[String]}})],m.prototype,"writeSublayers",null),a([u({json:{read:!1},readOnly:!0,value:"wms"})],m.prototype,"type",void 0),a([u(lt)],m.prototype,"url",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"version",void 0),m=a([xe("esri.layers.WMSLayer")],m);const Qt=m;export{Qt as default}; diff --git a/main/assets/WMSLayerView2D-Dz-z-fa9-DL6MC_DE.js b/main/assets/WMSLayerView2D-Dz-z-fa9-DL6MC_DE.js deleted file mode 100644 index cc0e628af..000000000 --- a/main/assets/WMSLayerView2D-Dz-z-fa9-DL6MC_DE.js +++ /dev/null @@ -1 +0,0 @@ -import{aU as M,a1 as C,ah as R,aA as S,n as U,v as o,S as h,i as F,o as w,$ as V}from"./main-BZaw9FpY.js";import{d as b}from"./BitmapContainer-BC8fvmFc-DzZ9OrT1.js";import{X as q,Y as L}from"./LayerView-Bish-E63-DRGspiuk.js";import{K as W}from"./ExportStrategy-BNE7Gp0u-CVNDsUmZ.js";import{n as A}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import{r as z}from"./ExportWMSImageParameters-CMk80WSM-CXXj-iAb.js";import{T as B}from"./timeSupport-ohWmWReZ-CwKm-94j.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./Tile-D75RMC64-DprBAZDK.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./signal-CETehA7D-vStzfbaY.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";import"./Bitmap-CcqmzvfR-Cl_blWW9.js";const H=e=>{let t=class extends e{initialize(){this.exportImageParameters=new z({layer:this.layer})}destroy(){this.exportImageParameters=S(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return B(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,p){const{layer:a}=this;if(!i)throw new w("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:d}=a;if(!d)throw new w("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:d});const r=this.createFetchPopupFeaturesQuery(i);if(!r)return[];const{extent:m,width:s,height:n,x:c,y:l}=r;if(!(m&&s&&n))throw new w("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:m,width:s,height:n});const y=await a.fetchFeatureInfo(m,s,n,c,l);return V(p),y}};return o([h()],t.prototype,"exportImageParameters",void 0),o([h({readOnly:!0})],t.prototype,"exportImageVersion",null),o([h()],t.prototype,"layer",void 0),o([h({readOnly:!0})],t.prototype,"timeExtent",null),t=o([F("esri.views.layers.WMSLayerView")],t),t};let u=class extends H(A(q(L))){constructor(){super(...arguments),this.bitmapContainer=new b}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{M(t)||C.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:i}=e;this.bitmapContainer=new b,this.container.addChild(this.bitmapContainer),this.strategy=new W({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:i,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(R(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=S(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:i}=this,{x:p,y:a}=e,{spatialReference:d}=t;let r,m=0,s=0;if(i.children.some(y=>{const{width:f,height:v,resolution:I,x:g,y:x}=y,P=g+I*f,E=x-I*v;return p>=g&&p<=P&&a<=x&&a>=E&&(r=new U({xmin:g,ymin:E,xmax:P,ymax:x,spatialReference:d}),m=f,s=v,!0)}),!r)return null;const n=r.width/m,c=Math.round((p-r.xmin)/n),l=Math.round((r.ymax-a)/n);return{extent:r,width:m,height:s,x:c,y:l}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,i,p){return this.layer.fetchImageBitmap(e,t,i,{timeExtent:this.timeExtent,...p})}};o([h()],u.prototype,"strategy",void 0),o([h()],u.prototype,"updating",void 0),u=o([F("esri.views.2d.layers.WMSLayerView2D")],u);const ue=u;export{ue as default}; diff --git a/main/assets/WMSLayerView2D-Dz-z-fa9-DQ4tDf76.js b/main/assets/WMSLayerView2D-Dz-z-fa9-DQ4tDf76.js new file mode 100644 index 000000000..7a35e77c2 --- /dev/null +++ b/main/assets/WMSLayerView2D-Dz-z-fa9-DQ4tDf76.js @@ -0,0 +1 @@ +import{aU as M,a1 as C,ah as R,aA as S,n as U,v as o,S as h,i as F,o as w,$ as V}from"./main-C7yV2j71.js";import{d as b}from"./BitmapContainer-BC8fvmFc-CH1ryNve.js";import{X as q,Y as L}from"./LayerView-Bish-E63-I2LV0oDm.js";import{K as W}from"./ExportStrategy-BNE7Gp0u-CdeT3qVb.js";import{n as A}from"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";import{r as z}from"./ExportWMSImageParameters-CMk80WSM-CQGcVQcn.js";import{T as B}from"./timeSupport-ohWmWReZ-Ca1Xy2Rx.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./Tile-D75RMC64-CM0vKD9b.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./signal-CETehA7D-DxK1orqE.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";import"./Bitmap-CcqmzvfR-C92VuEM3.js";const H=e=>{let t=class extends e{initialize(){this.exportImageParameters=new z({layer:this.layer})}destroy(){this.exportImageParameters=S(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return B(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,p){const{layer:a}=this;if(!i)throw new w("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:d}=a;if(!d)throw new w("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:d});const r=this.createFetchPopupFeaturesQuery(i);if(!r)return[];const{extent:m,width:s,height:n,x:c,y:l}=r;if(!(m&&s&&n))throw new w("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:m,width:s,height:n});const y=await a.fetchFeatureInfo(m,s,n,c,l);return V(p),y}};return o([h()],t.prototype,"exportImageParameters",void 0),o([h({readOnly:!0})],t.prototype,"exportImageVersion",null),o([h()],t.prototype,"layer",void 0),o([h({readOnly:!0})],t.prototype,"timeExtent",null),t=o([F("esri.views.layers.WMSLayerView")],t),t};let u=class extends H(A(q(L))){constructor(){super(...arguments),this.bitmapContainer=new b}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{M(t)||C.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:i}=e;this.bitmapContainer=new b,this.container.addChild(this.bitmapContainer),this.strategy=new W({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:i,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(R(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=S(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:i}=this,{x:p,y:a}=e,{spatialReference:d}=t;let r,m=0,s=0;if(i.children.some(y=>{const{width:f,height:v,resolution:I,x:g,y:x}=y,P=g+I*f,E=x-I*v;return p>=g&&p<=P&&a<=x&&a>=E&&(r=new U({xmin:g,ymin:E,xmax:P,ymax:x,spatialReference:d}),m=f,s=v,!0)}),!r)return null;const n=r.width/m,c=Math.round((p-r.xmin)/n),l=Math.round((r.ymax-a)/n);return{extent:r,width:m,height:s,x:c,y:l}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,i,p){return this.layer.fetchImageBitmap(e,t,i,{timeExtent:this.timeExtent,...p})}};o([h()],u.prototype,"strategy",void 0),o([h()],u.prototype,"updating",void 0),u=o([F("esri.views.2d.layers.WMSLayerView2D")],u);const ue=u;export{ue as default}; diff --git a/main/assets/WMTSLayer-DJY_jjIE-DbxfHjqO.js b/main/assets/WMTSLayer-DJY_jjIE-DbxfHjqO.js deleted file mode 100644 index 23cb18367..000000000 --- a/main/assets/WMTSLayer-DJY_jjIE-DbxfHjqO.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as n,n as O,i as W,a0 as R,ag as G,ah as re,av as _,ai as ie,W as se,o as N,N as fe,aq as ce,f as B,P as le,a as K,X as ge,ac as we,e as Q,w as xe,j_ as q,j$ as ve}from"./main-BZaw9FpY.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as Me}from"./Layer-ChoECxvZ-C4wLrCej.js";import{p as Ie,I as Te}from"./WebTileLayer-CUoicUjK-CD-UQu9P.js";import{u as Le}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as Pe}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as Ce}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as be}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{u as ae}from"./imageBitmapUtils-DA36kg39-CBVFUZAU.js";import{V as Y,d as Re}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import{c as Ae}from"./TileInfoTilemapCache-D1SExPij-UDulH8vT.js";import{n as Z}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{l as oe}from"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var J;let F=J=class extends Q{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};o([n({type:O,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([n({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([n({type:Y,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([W("esri.layers.support.TileMatrixSet")],F);const Oe=F;var X;let L=X=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new X;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n({json:{read:{source:"id"}}})],L.prototype,"id",void 0),o([n({json:{read:{source:"title"}}})],L.prototype,"title",void 0),o([n({json:{read:{source:"abstract"}}})],L.prototype,"description",void 0),o([n({json:{read:{source:"legendUrl"}}})],L.prototype,"legendUrl",void 0),o([n({json:{read:{source:"isDefault"}}})],L.prototype,"isDefault",void 0),o([n({json:{read:{source:"keywords"}}})],L.prototype,"keywords",void 0),L=X=o([W("esri.layers.support.WMTSStyle")],L);const Fe=L;var H;let w=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?O.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(r=>O.fromJSON(r)):t.tileMatrixSets?.map(r=>O.fromJSON(r.fullExtent)).filter(r=>r)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats?.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n()],w.prototype,"description",void 0),o([n()],w.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],w.prototype,"readFullExtent",null),o([n({readOnly:!0})],w.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],w.prototype,"readFullExtents",null),o([n()],w.prototype,"id",void 0),o([n()],w.prototype,"imageFormat",null),o([n({json:{read:{source:"formats"}}})],w.prototype,"imageFormats",void 0),o([n()],w.prototype,"layer",void 0),o([n()],w.prototype,"parent",void 0),o([n()],w.prototype,"styleId",null),o([n({type:G.ofType(Fe),json:{read:{source:"styles"}}})],w.prototype,"styles",void 0),o([n({json:{write:{ignoreOrigin:!0}}})],w.prototype,"title",void 0),o([n()],w.prototype,"tileMatrixSetId",void 0),o([n({readOnly:!0})],w.prototype,"tileMatrixSet",null),o([n({type:G.ofType(Oe),json:{read:{source:"tileMatrixSets"}}})],w.prototype,"tileMatrixSets",void 0),w=H=o([W("esri.layers.support.WMTSSublayer")],w);const j=w,de=90.71428571428571;function ne(e){const t=e.replaceAll(/ows:/gi,"");if(!f("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function Ve(e,t){e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,a=f("Contents",r);if(!a)throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid");const l=f("OperationsMetadata",r),p=l?.querySelector("[name='GetTile']"),u=p?.getElementsByTagName("Get"),m=u&&Array.prototype.slice.call(u),y=t.url?.indexOf("https"),c=y!==void 0&&y>-1;let g,I,v=t.serviceMode,x=t?.url;m?.length&&m.some(C=>{const T=f("Constraint",C);return!T||V("AllowedValues","Value",v,T)?(x=C.attributes[0].nodeValue,!0):(!T||V("AllowedValues","Value","RESTful",T)||V("AllowedValues","Value","REST",T)?I=C.attributes[0].nodeValue:T&&!V("AllowedValues","Value","KVP",T)||(g=C.attributes[0].nodeValue),!1)}),!x&&(I?(x=I,v="RESTful"):g?(x=g,v="KVP"):x=f("ServiceMetadataURL",r)?.getAttribute("xlink:href"));const E=x.indexOf("1.0.0/");E===-1&&v==="RESTful"?x+="/":E>-1&&(x=x.slice(0,E)),v==="KVP"&&(x+=E>-1?"":"?"),c&&(x=x.replace(/^http:/i,"https:"));const S=h("ServiceIdentification>ServiceTypeVersion",r),M=h("ServiceIdentification>AccessConstraints",r),P=M&&/^none$/i.test(M)?null:M,k=b("Layer",a),D=b("TileMatrixSet",a),$=k.map(C=>{const T=h("Identifier",C);return i.set(T,C),je(T,C,D,c,S)});return{copyright:P,dimensionMap:s,layerMap:i,layers:$,serviceMode:v,tileUrl:x}}function Ue(e){return e.layers.forEach(t=>{t.tileMatrixSets?.forEach(r=>{const i=r.tileInfo;i&&i.dpi!==96&&(i.lods?.forEach(s=>{s.scale=96*s.scale/i.dpi,s.resolution=ye(i.spatialReference?.wkid,s.scale*de/96,r.id)}),i.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function f(e,t){for(let r=0;ri.textContent).filter(ce)}function h(e,t){return e.split(">").forEach(r=>{t&&(t=f(r,t))}),t&&t.textContent}function V(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(a=>{if(a.nodeName.includes(e)){const l=f(t,a),p=l?.textContent;if(p===r||r.split(":")&&r.split(":")[1]===p)return s=a,!0}return!1}),s}function je(e,t,r,i,s){const a=h("Abstract",t),l=A("Format",t);return{id:e,fullExtent:ke(t),fullExtents:De(t),description:a,formats:l,styles:$e(t,i),title:h("Title",t),tileMatrixSets:Be(s,t,r)}}function me(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return null;const s=b("ResourceURL",i),a=b("Dimension",i);let l,p,u,m;return a.length&&(l=h("Identifier",a[0]),p=A("Default",a[0])||A("Value",a[0])),a.length>1&&(u=h("Identifier",a[1]),m=A("Default",a[1])||A("Value",a[1])),e.dimensionMap.set(t,{dimensions:p,dimensions2:m}),s.forEach(y=>{let c=y.getAttribute("template");if(y.getAttribute("resourceType")==="tile"){if(l&&p.length)if(c.includes("{"+l+"}"))c=c.replace("{"+l+"}","{dimensionValue}");else{const g=c.toLowerCase().indexOf("{"+l.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue}"+c.slice(g+l.length+2))}if(u&&m.length)if(c.includes("{"+u+"}"))c=c.replace("{"+u+"}","{dimensionValue2}");else{const g=c.toLowerCase().indexOf("{"+u.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue2}"+c.slice(g+u.length+2))}r.push({template:c,format:y.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,a,l,p){const u=Ne(e,t,i);if(!(u?.length>0))return"";const{dimensionMap:m}=e,y=m.get(t).dimensions?.[0],c=m.get(t).dimensions2?.[0];return u[l%u.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,""+l).replaceAll(/\{TileCol\}/gi,""+p).replaceAll(/\{dimensionValue\}/gi,y).replaceAll(/\{dimensionValue2\}/gi,c)}function Ne(e,t,r){const i=me(e,t),s=i?.filter(a=>a.format===r);return(s?.length?s:i)??[]}function We(e,t,r,i){const{dimensionMap:s}=e,a=me(e,t);let l="";if(a&&a.length>0){const p=s.get(t).dimensions?.[0],u=s.get(t).dimensions2?.[0];l=a[0].template,l.endsWith(".xxx")&&(l=l.slice(0,-4)),l=l.replaceAll(/\{Style\}/gi,i),l=l.replaceAll(/\{TileMatrixSet\}/gi,r),l=l.replaceAll(/\{TileMatrix\}/gi,"{level}"),l=l.replaceAll(/\{TileRow\}/gi,"{row}"),l=l.replaceAll(/\{TileCol\}/gi,"{col}"),l=l.replaceAll(/\{dimensionValue\}/gi,p),l=l.replaceAll(/\{dimensionValue2\}/gi,u)}return l}function ke(e){const t=f("WGS84BoundingBox",e),r=t?h("LowerCorner",t).split(" "):["-180","-90"],i=t?h("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function De(e){const t=[];return oe(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),a=i.includes("epsg")&&Z(s.wkid);let l,p,u,m;oe(r,{LowerCorner:y=>{[l,p]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([l,p]=[p,l])},UpperCorner:y=>{[u,m]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([u,m]=[m,u])}}),t.push({xmin:l,ymin:p,xmax:u,ymax:m,spatialReference:s})}}),t}function $e(e,t){return b("Style",e).map(r=>{const i=f("LegendURL",r),s=f("Keywords",r),a=s?A("Keyword",s):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:h("Abstract",r),id:h("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:a,legendUrl:l,title:h("Title",r)}})}function Be(e,t,r){return b("TileMatrixSetLink",t).map(i=>Ke(e,i,r))}function Ke(e,t,r){const i=f("TileMatrixSet",t).textContent,s=A("TileMatrix",t),a=r.find(S=>{const M=f("Identifier",S),P=M?.textContent;return!!(P===i||i.split(":")&&i.split(":")[1]===P)}),l=f("TileMatrixSetLimits",t),p=l&&b("TileMatrixLimits",l),u=new Map;if(p?.length)for(const S of p){const M=f("TileMatrix",S).textContent,P=+f("MinTileRow",S).textContent,k=+f("MaxTileRow",S).textContent,D=+f("MinTileCol",S).textContent,$=+f("MaxTileCol",S).textContent;u.set(M,{minCol:D,maxCol:$,minRow:P,maxRow:k})}const m=h("SupportedCRS",a).toLowerCase(),y=qe(a,m),c=y.spatialReference,g=f("TileMatrix",a),I=[parseInt(h("TileWidth",g),10),parseInt(h("TileHeight",g),10)],v=[];s.length?s.forEach((S,M)=>{const P=V("TileMatrix","Identifier",S,a);v.push(pe(P,m,M,i,u))}):b("TileMatrix",a).forEach((S,M)=>{v.push(pe(S,m,M,i,u))});const x=Ge(e,a,y,I,v[0]).toJSON(),E=new Y({dpi:96,spatialReference:c,size:I,origin:y,lods:v}).toJSON();return{id:i,fullExtent:x,tileInfo:E}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=Xe(e);return r!=null&&(t=r),{wkid:t}}function qe(e,t){return he(f("TileMatrix",e),t)}function he(e,t){const r=te(t),[i,s]=h("TopLeftCorner",e).split(" ").map(l=>parseFloat(l)),a=t.includes("epsg")&&Z(r.wkid);return new xe(a?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Ge(e,t,r,i,s){const a=f("BoundingBox",t);let l,p,u,m,y,c;if(a&&(l=h("LowerCorner",a).split(" "),p=h("UpperCorner",a).split(" ")),l&&l.length>1&&p&&p.length>1)u=parseFloat(l[0]),y=parseFloat(l[1]),m=parseFloat(p[0]),c=parseFloat(p[1]);else{const g=f("TileMatrix",t),I=parseInt(h("MatrixWidth",g),10),v=parseInt(h("MatrixHeight",g),10);u=r.x,c=r.y,m=u+I*i[0]*s.resolution,y=c-v*i[1]*s.resolution}return Je(e,r.spatialReference,r)?new O(y,u,c,m,r.spatialReference):new O(u,y,m,c,r.spatialReference)}function Je(e,t,r){return e==="1.0.0"&&Z(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var U;function Xe(e){return e.includes("crs84")||e.includes("crs:84")?U.CRS84:e.includes("crs83")||e.includes("crs:83")?U.CRS83:e.includes("crs27")||e.includes("crs:27")?U.CRS27:null}function pe(e,t,r,i,s){const a=te(t),l=h("Identifier",e);let p=parseFloat(h("ScaleDenominator",e));const u=ye(a.wkid,p,i);p*=96/de;const m=+h("MatrixWidth",e),y=+h("MatrixHeight",e),{maxCol:c=m-1,maxRow:g=y-1,minCol:I=0,minRow:v=0}=s.get(l)??{},{x,y:E}=he(e,t);return new Re({cols:[I,c],level:r,levelValue:l,origin:[x,E],scale:p,resolution:u,rows:[v,g]})}function ye(e,t,r){let i;return i=q.hasOwnProperty(""+e)?q.values[q[e]]:r==="default028mm"?6370997*Math.PI/180:ve(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(U||(U={}));var z;const ue={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},He=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let d=z=class extends Le(Ce(be(Ee(Pe(Se(Me)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([re(()=>this.activeLayer,(t,r)=>{r&&!this.sublayers?.includes(r)&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},_),ie(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},_),ie(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},_),re(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},_)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(se).then(()=>this._fetchService(e)).catch(t=>{throw se(t),new N("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i?.layerIdentifier;let l=null;const p=i?.tileMatrixSet;p&&(Array.isArray(p)?p.length&&(l=p[0]):l=p);const u=s?.format,m=s?.style;return new j({id:a,imageFormat:u,styleId:m,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=fe("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return ze(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(ce)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new Ae(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new Ie({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new Te({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,t,r,i={}){const{signal:s}=i,a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"image",signal:s});return l}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==z.prototype.fetchTile){const p=await this.fetchTile(e,t,r,i);return ae(p,e,t,r,s)}const a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"blob",signal:s});return ae(l,e,t,r,s)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let l=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=We({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return ue[r.toLowerCase()]&&(s=ue[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ne(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ne(t.data),this.serviceMode=r}catch(i){throw new N("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=Ue(t.data):t.data=Ve(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await B(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find(t=>t.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=K(e),i={...r.query,...t},s=ge(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=K(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=K(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||He.has(s)||(e[s]=r[s])}))}return e}};function ze(e,t){return e.map(r=>{const i=new j;return i.read(r,t),i})}o([n()],d.prototype,"dimensionMap",void 0),o([n()],d.prototype,"layerMap",void 0),o([n({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([we(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:Y},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([n({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([n({type:["show","hide"]})],d.prototype,"listMode",void 0),o([n({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([n({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],d.prototype,"customParameters",void 0),o([R(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([n({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],d.prototype,"customLayerParameters",void 0),o([n({type:O,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([n({readOnly:!0})],d.prototype,"fullExtents",null),o([n({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([n()],d.prototype,"resourceInfo",void 0),o([n()],d.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([n({type:G.ofType(j)})],d.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([n({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([n({readOnly:!0})],d.prototype,"tilemapCache",null),o([n({json:{read:{source:"title"}}})],d.prototype,"title",null),o([n({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([n({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],d.prototype,"url",null),o([n()],d.prototype,"version",void 0),d=z=o([W("esri.layers.WMTSLayer")],d);const Lt=d;export{Lt as default}; diff --git a/main/assets/WMTSLayer-DJY_jjIE-DusHpV4U.js b/main/assets/WMTSLayer-DJY_jjIE-DusHpV4U.js new file mode 100644 index 000000000..0196701fe --- /dev/null +++ b/main/assets/WMTSLayer-DJY_jjIE-DusHpV4U.js @@ -0,0 +1 @@ +import{v as o,S as n,n as O,i as W,a0 as R,ag as G,ah as re,av as _,ai as ie,W as se,o as N,N as fe,aq as ce,f as B,P as le,a as K,X as ge,ac as we,e as Q,w as xe,j_ as q,j$ as ve}from"./main-C7yV2j71.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as Me}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{p as Ie,I as Te}from"./WebTileLayer-CUoicUjK-DGTooIUm.js";import{u as Le}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as Pe}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as Ce}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as be}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{u as ae}from"./imageBitmapUtils-DA36kg39-BPA5qQx5.js";import{V as Y,d as Re}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import{c as Ae}from"./TileInfoTilemapCache-D1SExPij-6JuHkhwl.js";import{n as Z}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{l as oe}from"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var J;let F=J=class extends Q{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};o([n({type:O,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([n({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([n({type:Y,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([W("esri.layers.support.TileMatrixSet")],F);const Oe=F;var X;let L=X=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new X;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n({json:{read:{source:"id"}}})],L.prototype,"id",void 0),o([n({json:{read:{source:"title"}}})],L.prototype,"title",void 0),o([n({json:{read:{source:"abstract"}}})],L.prototype,"description",void 0),o([n({json:{read:{source:"legendUrl"}}})],L.prototype,"legendUrl",void 0),o([n({json:{read:{source:"isDefault"}}})],L.prototype,"isDefault",void 0),o([n({json:{read:{source:"keywords"}}})],L.prototype,"keywords",void 0),L=X=o([W("esri.layers.support.WMTSStyle")],L);const Fe=L;var H;let w=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?O.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(r=>O.fromJSON(r)):t.tileMatrixSets?.map(r=>O.fromJSON(r.fullExtent)).filter(r=>r)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats?.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n()],w.prototype,"description",void 0),o([n()],w.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],w.prototype,"readFullExtent",null),o([n({readOnly:!0})],w.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],w.prototype,"readFullExtents",null),o([n()],w.prototype,"id",void 0),o([n()],w.prototype,"imageFormat",null),o([n({json:{read:{source:"formats"}}})],w.prototype,"imageFormats",void 0),o([n()],w.prototype,"layer",void 0),o([n()],w.prototype,"parent",void 0),o([n()],w.prototype,"styleId",null),o([n({type:G.ofType(Fe),json:{read:{source:"styles"}}})],w.prototype,"styles",void 0),o([n({json:{write:{ignoreOrigin:!0}}})],w.prototype,"title",void 0),o([n()],w.prototype,"tileMatrixSetId",void 0),o([n({readOnly:!0})],w.prototype,"tileMatrixSet",null),o([n({type:G.ofType(Oe),json:{read:{source:"tileMatrixSets"}}})],w.prototype,"tileMatrixSets",void 0),w=H=o([W("esri.layers.support.WMTSSublayer")],w);const j=w,de=90.71428571428571;function ne(e){const t=e.replaceAll(/ows:/gi,"");if(!f("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function Ve(e,t){e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,a=f("Contents",r);if(!a)throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid");const l=f("OperationsMetadata",r),p=l?.querySelector("[name='GetTile']"),u=p?.getElementsByTagName("Get"),m=u&&Array.prototype.slice.call(u),y=t.url?.indexOf("https"),c=y!==void 0&&y>-1;let g,I,v=t.serviceMode,x=t?.url;m?.length&&m.some(C=>{const T=f("Constraint",C);return!T||V("AllowedValues","Value",v,T)?(x=C.attributes[0].nodeValue,!0):(!T||V("AllowedValues","Value","RESTful",T)||V("AllowedValues","Value","REST",T)?I=C.attributes[0].nodeValue:T&&!V("AllowedValues","Value","KVP",T)||(g=C.attributes[0].nodeValue),!1)}),!x&&(I?(x=I,v="RESTful"):g?(x=g,v="KVP"):x=f("ServiceMetadataURL",r)?.getAttribute("xlink:href"));const E=x.indexOf("1.0.0/");E===-1&&v==="RESTful"?x+="/":E>-1&&(x=x.slice(0,E)),v==="KVP"&&(x+=E>-1?"":"?"),c&&(x=x.replace(/^http:/i,"https:"));const S=h("ServiceIdentification>ServiceTypeVersion",r),M=h("ServiceIdentification>AccessConstraints",r),P=M&&/^none$/i.test(M)?null:M,k=b("Layer",a),D=b("TileMatrixSet",a),$=k.map(C=>{const T=h("Identifier",C);return i.set(T,C),je(T,C,D,c,S)});return{copyright:P,dimensionMap:s,layerMap:i,layers:$,serviceMode:v,tileUrl:x}}function Ue(e){return e.layers.forEach(t=>{t.tileMatrixSets?.forEach(r=>{const i=r.tileInfo;i&&i.dpi!==96&&(i.lods?.forEach(s=>{s.scale=96*s.scale/i.dpi,s.resolution=ye(i.spatialReference?.wkid,s.scale*de/96,r.id)}),i.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function f(e,t){for(let r=0;ri.textContent).filter(ce)}function h(e,t){return e.split(">").forEach(r=>{t&&(t=f(r,t))}),t&&t.textContent}function V(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(a=>{if(a.nodeName.includes(e)){const l=f(t,a),p=l?.textContent;if(p===r||r.split(":")&&r.split(":")[1]===p)return s=a,!0}return!1}),s}function je(e,t,r,i,s){const a=h("Abstract",t),l=A("Format",t);return{id:e,fullExtent:ke(t),fullExtents:De(t),description:a,formats:l,styles:$e(t,i),title:h("Title",t),tileMatrixSets:Be(s,t,r)}}function me(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return null;const s=b("ResourceURL",i),a=b("Dimension",i);let l,p,u,m;return a.length&&(l=h("Identifier",a[0]),p=A("Default",a[0])||A("Value",a[0])),a.length>1&&(u=h("Identifier",a[1]),m=A("Default",a[1])||A("Value",a[1])),e.dimensionMap.set(t,{dimensions:p,dimensions2:m}),s.forEach(y=>{let c=y.getAttribute("template");if(y.getAttribute("resourceType")==="tile"){if(l&&p.length)if(c.includes("{"+l+"}"))c=c.replace("{"+l+"}","{dimensionValue}");else{const g=c.toLowerCase().indexOf("{"+l.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue}"+c.slice(g+l.length+2))}if(u&&m.length)if(c.includes("{"+u+"}"))c=c.replace("{"+u+"}","{dimensionValue2}");else{const g=c.toLowerCase().indexOf("{"+u.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue2}"+c.slice(g+u.length+2))}r.push({template:c,format:y.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,a,l,p){const u=Ne(e,t,i);if(!(u?.length>0))return"";const{dimensionMap:m}=e,y=m.get(t).dimensions?.[0],c=m.get(t).dimensions2?.[0];return u[l%u.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,""+l).replaceAll(/\{TileCol\}/gi,""+p).replaceAll(/\{dimensionValue\}/gi,y).replaceAll(/\{dimensionValue2\}/gi,c)}function Ne(e,t,r){const i=me(e,t),s=i?.filter(a=>a.format===r);return(s?.length?s:i)??[]}function We(e,t,r,i){const{dimensionMap:s}=e,a=me(e,t);let l="";if(a&&a.length>0){const p=s.get(t).dimensions?.[0],u=s.get(t).dimensions2?.[0];l=a[0].template,l.endsWith(".xxx")&&(l=l.slice(0,-4)),l=l.replaceAll(/\{Style\}/gi,i),l=l.replaceAll(/\{TileMatrixSet\}/gi,r),l=l.replaceAll(/\{TileMatrix\}/gi,"{level}"),l=l.replaceAll(/\{TileRow\}/gi,"{row}"),l=l.replaceAll(/\{TileCol\}/gi,"{col}"),l=l.replaceAll(/\{dimensionValue\}/gi,p),l=l.replaceAll(/\{dimensionValue2\}/gi,u)}return l}function ke(e){const t=f("WGS84BoundingBox",e),r=t?h("LowerCorner",t).split(" "):["-180","-90"],i=t?h("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function De(e){const t=[];return oe(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),a=i.includes("epsg")&&Z(s.wkid);let l,p,u,m;oe(r,{LowerCorner:y=>{[l,p]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([l,p]=[p,l])},UpperCorner:y=>{[u,m]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([u,m]=[m,u])}}),t.push({xmin:l,ymin:p,xmax:u,ymax:m,spatialReference:s})}}),t}function $e(e,t){return b("Style",e).map(r=>{const i=f("LegendURL",r),s=f("Keywords",r),a=s?A("Keyword",s):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:h("Abstract",r),id:h("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:a,legendUrl:l,title:h("Title",r)}})}function Be(e,t,r){return b("TileMatrixSetLink",t).map(i=>Ke(e,i,r))}function Ke(e,t,r){const i=f("TileMatrixSet",t).textContent,s=A("TileMatrix",t),a=r.find(S=>{const M=f("Identifier",S),P=M?.textContent;return!!(P===i||i.split(":")&&i.split(":")[1]===P)}),l=f("TileMatrixSetLimits",t),p=l&&b("TileMatrixLimits",l),u=new Map;if(p?.length)for(const S of p){const M=f("TileMatrix",S).textContent,P=+f("MinTileRow",S).textContent,k=+f("MaxTileRow",S).textContent,D=+f("MinTileCol",S).textContent,$=+f("MaxTileCol",S).textContent;u.set(M,{minCol:D,maxCol:$,minRow:P,maxRow:k})}const m=h("SupportedCRS",a).toLowerCase(),y=qe(a,m),c=y.spatialReference,g=f("TileMatrix",a),I=[parseInt(h("TileWidth",g),10),parseInt(h("TileHeight",g),10)],v=[];s.length?s.forEach((S,M)=>{const P=V("TileMatrix","Identifier",S,a);v.push(pe(P,m,M,i,u))}):b("TileMatrix",a).forEach((S,M)=>{v.push(pe(S,m,M,i,u))});const x=Ge(e,a,y,I,v[0]).toJSON(),E=new Y({dpi:96,spatialReference:c,size:I,origin:y,lods:v}).toJSON();return{id:i,fullExtent:x,tileInfo:E}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=Xe(e);return r!=null&&(t=r),{wkid:t}}function qe(e,t){return he(f("TileMatrix",e),t)}function he(e,t){const r=te(t),[i,s]=h("TopLeftCorner",e).split(" ").map(l=>parseFloat(l)),a=t.includes("epsg")&&Z(r.wkid);return new xe(a?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Ge(e,t,r,i,s){const a=f("BoundingBox",t);let l,p,u,m,y,c;if(a&&(l=h("LowerCorner",a).split(" "),p=h("UpperCorner",a).split(" ")),l&&l.length>1&&p&&p.length>1)u=parseFloat(l[0]),y=parseFloat(l[1]),m=parseFloat(p[0]),c=parseFloat(p[1]);else{const g=f("TileMatrix",t),I=parseInt(h("MatrixWidth",g),10),v=parseInt(h("MatrixHeight",g),10);u=r.x,c=r.y,m=u+I*i[0]*s.resolution,y=c-v*i[1]*s.resolution}return Je(e,r.spatialReference,r)?new O(y,u,c,m,r.spatialReference):new O(u,y,m,c,r.spatialReference)}function Je(e,t,r){return e==="1.0.0"&&Z(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var U;function Xe(e){return e.includes("crs84")||e.includes("crs:84")?U.CRS84:e.includes("crs83")||e.includes("crs:83")?U.CRS83:e.includes("crs27")||e.includes("crs:27")?U.CRS27:null}function pe(e,t,r,i,s){const a=te(t),l=h("Identifier",e);let p=parseFloat(h("ScaleDenominator",e));const u=ye(a.wkid,p,i);p*=96/de;const m=+h("MatrixWidth",e),y=+h("MatrixHeight",e),{maxCol:c=m-1,maxRow:g=y-1,minCol:I=0,minRow:v=0}=s.get(l)??{},{x,y:E}=he(e,t);return new Re({cols:[I,c],level:r,levelValue:l,origin:[x,E],scale:p,resolution:u,rows:[v,g]})}function ye(e,t,r){let i;return i=q.hasOwnProperty(""+e)?q.values[q[e]]:r==="default028mm"?6370997*Math.PI/180:ve(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(U||(U={}));var z;const ue={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},He=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let d=z=class extends Le(Ce(be(Ee(Pe(Se(Me)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([re(()=>this.activeLayer,(t,r)=>{r&&!this.sublayers?.includes(r)&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},_),ie(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},_),ie(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},_),re(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},_)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(se).then(()=>this._fetchService(e)).catch(t=>{throw se(t),new N("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i?.layerIdentifier;let l=null;const p=i?.tileMatrixSet;p&&(Array.isArray(p)?p.length&&(l=p[0]):l=p);const u=s?.format,m=s?.style;return new j({id:a,imageFormat:u,styleId:m,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=fe("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return ze(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(ce)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new Ae(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new Ie({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new Te({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,t,r,i={}){const{signal:s}=i,a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"image",signal:s});return l}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==z.prototype.fetchTile){const p=await this.fetchTile(e,t,r,i);return ae(p,e,t,r,s)}const a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"blob",signal:s});return ae(l,e,t,r,s)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let l=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=We({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return ue[r.toLowerCase()]&&(s=ue[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ne(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ne(t.data),this.serviceMode=r}catch(i){throw new N("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=Ue(t.data):t.data=Ve(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await B(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find(t=>t.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=K(e),i={...r.query,...t},s=ge(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=K(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=K(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||He.has(s)||(e[s]=r[s])}))}return e}};function ze(e,t){return e.map(r=>{const i=new j;return i.read(r,t),i})}o([n()],d.prototype,"dimensionMap",void 0),o([n()],d.prototype,"layerMap",void 0),o([n({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([we(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:Y},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([n({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([n({type:["show","hide"]})],d.prototype,"listMode",void 0),o([n({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([n({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],d.prototype,"customParameters",void 0),o([R(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([n({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],d.prototype,"customLayerParameters",void 0),o([n({type:O,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([n({readOnly:!0})],d.prototype,"fullExtents",null),o([n({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([n()],d.prototype,"resourceInfo",void 0),o([n()],d.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([n({type:G.ofType(j)})],d.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([n({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([n({readOnly:!0})],d.prototype,"tilemapCache",null),o([n({json:{read:{source:"title"}}})],d.prototype,"title",null),o([n({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([n({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],d.prototype,"url",null),o([n()],d.prototype,"version",void 0),d=z=o([W("esri.layers.WMTSLayer")],d);const Lt=d;export{Lt as default}; diff --git a/main/assets/WMTSLayerView2D-Bl5FUDUu-BIlJfFno.js b/main/assets/WMTSLayerView2D-Bl5FUDUu-BIlJfFno.js deleted file mode 100644 index 31b81f2a9..000000000 --- a/main/assets/WMTSLayerView2D-Bl5FUDUu-BIlJfFno.js +++ /dev/null @@ -1 +0,0 @@ -import{aC as l,aU as c,a1 as y,v as u,S as w,i as g}from"./main-BZaw9FpY.js";import{L as I,D as f}from"./imageUtils-Co-ELErj-CxjujewR.js";import{X as S,Y as T}from"./LayerView-Bish-E63-DRGspiuk.js";import{Q as V,$ as v,a as x}from"./Tile-D75RMC64-DprBAZDK.js";import{s as d}from"./TileKey-C5IL-JBr-0HJjsV9n.js";import{n as Q}from"./RefreshableLayerView-BdQpGYly-BX6IwUNP.js";import{i as M}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./MapView-BGOJJ8ch-Dom5daUl.js";import"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import"./signal-CETehA7D-vStzfbaY.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Bitmap-CcqmzvfR-Cl_blWW9.js";import"./Container-BcuL1ZEG-DH5lSN9D.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import"./LabelMetric-BeluzH3o-Dwc7BaHL.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DUDrdGpa.js";import"./BufferObject-BM_7mcDb-QLZylgsX.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-BVJ-tuHO.js";import"./ProgramTemplate-DQOm6Omy-B2krln6G.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TileContainer-D48pXXgL-DNbVOEpu.js";import"./layerViewUtils-DURAPenP-BHbJhKE8.js";const R=[0,0];let r=class extends Q(I(S(T))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:t}=this.layer,{tileMatrixSet:e}=t;if(e&&l(e.tileInfo?.spatialReference,this.view.spatialReference))return e;const i=this._getTileMatrixSetBySpatialReference(t);return i&&i.id!==t.tileMatrixSetId?(t.tileMatrixSetId=i.id,i):null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume()}attach(){const t=this.tileMatrixSet?.tileInfo;t&&(this._tileInfoView=new V(t),this._fetchQueue=new v({tileInfoView:this._tileInfoView,concurrency:16,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:M.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new x({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.activeLayer.tileMatrixSets?.some(e=>l(e.tileInfo?.spatialReference,t))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const e=this._bitmapView.createTile(t),i=e.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(R,e.key),i.resolution=this._tileInfoView.getTileResolution(e.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this._bitmapView.addChild(e),this.requestUpdate(),e}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,e={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:p=0}=e;if(!i)return this._fetchImage(t,s);const a=new d(0,0,0,0);let h;try{await i.fetchAvailabilityUpsample(t.level,t.row,t.col,a,{signal:s}),h=await this._fetchImage(a,s)}catch(o){if(c(o))throw o;if(p<3){const m=this._tileInfoView.getTileParentId(t.id);if(m){const n=new d(m),_=await this.fetchTile(n,{...e,resamplingLevel:p+1});return f(this._tileInfoView,_,n,t)}}throw o}return f(this._tileInfoView,h,a,t)}canResume(){return super.canResume()&&this.tileMatrixSet!==null}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const e=await this._fetchQueue.push(t.key);t.bitmap.source=e,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(e){c(e)||y.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(t,e){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:e})}_getTileMatrixSetBySpatialReference(t){return t.tileMatrixSets?.find(e=>l(e.tileInfo?.spatialReference,this.view.spatialReference))}};u([w({readOnly:!0})],r.prototype,"tileMatrixSet",null),r=u([g("esri.views.2d.layers.WMTSLayerView2D")],r);const Zt=r;export{Zt as default}; diff --git a/main/assets/WMTSLayerView2D-Bl5FUDUu-aU1GfclG.js b/main/assets/WMTSLayerView2D-Bl5FUDUu-aU1GfclG.js new file mode 100644 index 000000000..d0caa033e --- /dev/null +++ b/main/assets/WMTSLayerView2D-Bl5FUDUu-aU1GfclG.js @@ -0,0 +1 @@ +import{aC as l,aU as c,a1 as y,v as u,S as w,i as g}from"./main-C7yV2j71.js";import{L as I,D as f}from"./imageUtils-Co-ELErj-Cnx9scTS.js";import{X as S,Y as T}from"./LayerView-Bish-E63-I2LV0oDm.js";import{Q as V,$ as v,a as x}from"./Tile-D75RMC64-CM0vKD9b.js";import{s as d}from"./TileKey-C5IL-JBr-COMthbrT.js";import{n as Q}from"./RefreshableLayerView-BdQpGYly-DhXYwWWM.js";import{i as M}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./MapView-BGOJJ8ch-CG2YDFKt.js";import"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import"./signal-CETehA7D-DxK1orqE.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Bitmap-CcqmzvfR-C92VuEM3.js";import"./Container-BcuL1ZEG-DU-CDj3E.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import"./LabelMetric-BeluzH3o-CQPyji82.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-CHQtoRqS.js";import"./BufferObject-BM_7mcDb-CTo2uuE5.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-DLhbl4qv.js";import"./ProgramTemplate-DQOm6Omy-XULB1YWq.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TileContainer-D48pXXgL-DSah9A2g.js";import"./layerViewUtils-DURAPenP-Eay0s_jy.js";const R=[0,0];let r=class extends Q(I(S(T))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:t}=this.layer,{tileMatrixSet:e}=t;if(e&&l(e.tileInfo?.spatialReference,this.view.spatialReference))return e;const i=this._getTileMatrixSetBySpatialReference(t);return i&&i.id!==t.tileMatrixSetId?(t.tileMatrixSetId=i.id,i):null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume()}attach(){const t=this.tileMatrixSet?.tileInfo;t&&(this._tileInfoView=new V(t),this._fetchQueue=new v({tileInfoView:this._tileInfoView,concurrency:16,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:M.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new x({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.activeLayer.tileMatrixSets?.some(e=>l(e.tileInfo?.spatialReference,t))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const e=this._bitmapView.createTile(t),i=e.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(R,e.key),i.resolution=this._tileInfoView.getTileResolution(e.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this._bitmapView.addChild(e),this.requestUpdate(),e}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,e={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:p=0}=e;if(!i)return this._fetchImage(t,s);const a=new d(0,0,0,0);let h;try{await i.fetchAvailabilityUpsample(t.level,t.row,t.col,a,{signal:s}),h=await this._fetchImage(a,s)}catch(o){if(c(o))throw o;if(p<3){const m=this._tileInfoView.getTileParentId(t.id);if(m){const n=new d(m),_=await this.fetchTile(n,{...e,resamplingLevel:p+1});return f(this._tileInfoView,_,n,t)}}throw o}return f(this._tileInfoView,h,a,t)}canResume(){return super.canResume()&&this.tileMatrixSet!==null}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const e=await this._fetchQueue.push(t.key);t.bitmap.source=e,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(e){c(e)||y.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(t,e){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:e})}_getTileMatrixSetBySpatialReference(t){return t.tileMatrixSets?.find(e=>l(e.tileInfo?.spatialReference,this.view.spatialReference))}};u([w({readOnly:!0})],r.prototype,"tileMatrixSet",null),r=u([g("esri.views.2d.layers.WMTSLayerView2D")],r);const Zt=r;export{Zt as default}; diff --git a/main/assets/WebTileLayer-CUoicUjK-CD-UQu9P.js b/main/assets/WebTileLayer-CUoicUjK-CD-UQu9P.js deleted file mode 100644 index 14cc37d59..000000000 --- a/main/assets/WebTileLayer-CUoicUjK-CD-UQu9P.js +++ /dev/null @@ -1 +0,0 @@ -import{e as R,P as v,v as l,S as i,i as b,n as S,J as m,w as I,c as h,o as x,fm as M,db as U,k as W,f as w,cF as D,a0 as g,ac as L}from"./main-BZaw9FpY.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import{D as $}from"./Layer-ChoECxvZ-C4wLrCej.js";import{u as O}from"./BlendLayer-D1WkSmwP-UVXywJXM.js";import{E as z}from"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import{C as A}from"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import{T as V}from"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import{u as T}from"./imageBitmapUtils-DA36kg39-CBVFUZAU.js";import{V as j,d as r}from"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var d;let c=d=class extends R{constructor(e){super(e)}clone(){return new d({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=d=l([b("esri.layers.support.WMTSLayerInfo")],c);var f;let o=f=class extends O(V(q(z(A(E($)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new S(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,m.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=m.WebMercator,this.subDomains=null,this.tileInfo=new j({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new I({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:m.WebMercator}),spatialReference:m.WebMercator,lods:[new r({level:0,scale:591657527591555e-6,resolution:156543.033928}),new r({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new r({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new r({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new r({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new r({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new r({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new r({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new r({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new r({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new r({level:10,scale:577790.554289,resolution:152.874056570411}),new r({level:11,scale:288895.277144,resolution:76.4370282850732}),new r({level:12,scale:144447.638572,resolution:38.2185141425366}),new r({level:13,scale:72223.819286,resolution:19.1092570712683}),new r({level:14,scale:36111.909643,resolution:9.55462853563415}),new r({level:15,scale:18055.954822,resolution:4.77731426794937}),new r({level:16,scale:9027.977411,resolution:2.38865713397468}),new r({level:17,scale:4513.988705,resolution:1.19432856685505}),new r({level:18,scale:2256.994353,resolution:.597164283559817}),new r({level:19,scale:1128.497176,resolution:.298582141647617}),new r({level:20,scale:564.248588,resolution:.14929107082380833}),new r({level:21,scale:282.124294,resolution:.07464553541190416}),new r({level:22,scale:141.062147,resolution:.03732276770595208}),new r({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{let s="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const a=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&a.authority?.includes("{subDomain}")&&(s="is missing 'subDomains' property")}else s="spatialReference must match tileInfo.spatialReference";else s="is missing the required 'urlTemplate' property value";if(s)throw new x("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${s}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||m.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:s}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p?.includes("{subDomain}")){if(s&&s.length>0&&p.split(".").length>1)for(const y of s)e.push(n+p.replaceAll(/\{subDomain\}/gi,y)+"/")}else e.push(u);return e.map(M)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),s=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.slice(s.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){U(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=W(e)),t.templateUrl=e}fetchTile(e,t,s,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,s),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(y=>y.data)}async fetchImageBitmapTile(e,t,s,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const P=await this.fetchTile(e,t,s,a);return T(P,e,t,s,n)}const u=this.getTileUrl(e,t,s),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:y}=await w(u,p);return T(y,e,t,s,n)}getTileUrl(e,t,s){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+D(u,{level:p,z:p,col:s,x:s,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:S,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:m})],o.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:j,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([L("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([b("esri.layers.WebTileLayer")],o);const _=o,ce=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));export{_ as I,ce as W,c as p}; diff --git a/main/assets/WebTileLayer-CUoicUjK-DGTooIUm.js b/main/assets/WebTileLayer-CUoicUjK-DGTooIUm.js new file mode 100644 index 000000000..4eb7dc6d7 --- /dev/null +++ b/main/assets/WebTileLayer-CUoicUjK-DGTooIUm.js @@ -0,0 +1 @@ +import{e as R,P as v,v as l,S as i,i as b,n as S,J as m,w as I,c as h,o as x,fm as M,db as U,k as W,f as w,cF as D,a0 as g,ac as L}from"./main-C7yV2j71.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js";import{D as $}from"./Layer-ChoECxvZ--vVxyMLZ.js";import{u as O}from"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import{E as z}from"./OperationalLayer-B5IXiMa2-B5IUcPZ-.js";import{C as A}from"./PortalLayer-CElnYuSQ-BV63HHSL.js";import{T as V}from"./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import{u as T}from"./imageBitmapUtils-DA36kg39-BPA5qQx5.js";import{V as j,d as r}from"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DuUske_0.js";import"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var d;let c=d=class extends R{constructor(e){super(e)}clone(){return new d({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=d=l([b("esri.layers.support.WMTSLayerInfo")],c);var f;let o=f=class extends O(V(q(z(A(E($)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new S(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,m.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=m.WebMercator,this.subDomains=null,this.tileInfo=new j({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new I({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:m.WebMercator}),spatialReference:m.WebMercator,lods:[new r({level:0,scale:591657527591555e-6,resolution:156543.033928}),new r({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new r({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new r({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new r({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new r({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new r({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new r({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new r({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new r({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new r({level:10,scale:577790.554289,resolution:152.874056570411}),new r({level:11,scale:288895.277144,resolution:76.4370282850732}),new r({level:12,scale:144447.638572,resolution:38.2185141425366}),new r({level:13,scale:72223.819286,resolution:19.1092570712683}),new r({level:14,scale:36111.909643,resolution:9.55462853563415}),new r({level:15,scale:18055.954822,resolution:4.77731426794937}),new r({level:16,scale:9027.977411,resolution:2.38865713397468}),new r({level:17,scale:4513.988705,resolution:1.19432856685505}),new r({level:18,scale:2256.994353,resolution:.597164283559817}),new r({level:19,scale:1128.497176,resolution:.298582141647617}),new r({level:20,scale:564.248588,resolution:.14929107082380833}),new r({level:21,scale:282.124294,resolution:.07464553541190416}),new r({level:22,scale:141.062147,resolution:.03732276770595208}),new r({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{let s="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const a=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&a.authority?.includes("{subDomain}")&&(s="is missing 'subDomains' property")}else s="spatialReference must match tileInfo.spatialReference";else s="is missing the required 'urlTemplate' property value";if(s)throw new x("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${s}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||m.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:s}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p?.includes("{subDomain}")){if(s&&s.length>0&&p.split(".").length>1)for(const y of s)e.push(n+p.replaceAll(/\{subDomain\}/gi,y)+"/")}else e.push(u);return e.map(M)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),s=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.slice(s.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){U(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=W(e)),t.templateUrl=e}fetchTile(e,t,s,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,s),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(y=>y.data)}async fetchImageBitmapTile(e,t,s,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const P=await this.fetchTile(e,t,s,a);return T(P,e,t,s,n)}const u=this.getTileUrl(e,t,s),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:y}=await w(u,p);return T(y,e,t,s,n)}getTileUrl(e,t,s){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+D(u,{level:p,z:p,col:s,x:s,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:S,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:m})],o.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:j,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([L("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([b("esri.layers.WebTileLayer")],o);const _=o,ce=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));export{_ as I,ce as W,c as p}; diff --git a/main/assets/WhereClause-DxwoyBMS-BIlXG7Pl.js b/main/assets/WhereClause-DxwoyBMS-BIlXG7Pl.js deleted file mode 100644 index 6ac434103..000000000 --- a/main/assets/WhereClause-DxwoyBMS-BIlXG7Pl.js +++ /dev/null @@ -1,7 +0,0 @@ -import{O as j,m as $,r as qo}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{cF as jo,F as J,K as ur,b_ as Yo,cI as Bo,cJ as Qo,q as Go}from"./main-BZaw9FpY.js";import{t as He,r as qe,a as pe}from"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";var d;(function(a){a.InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Wo={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let m=class pr extends Error{constructor(i,u){super(jo(Wo[i],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,pr)}};function or(a){return Number.isNaN(a)||a===0?a:Math.trunc(a)}let Q=class oe{constructor(i){this._timeStampOffset=i,this._date=null}toDateTime(){return this._date??=J.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return or(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return or(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return oe.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(i){return new oe(J.fromJSDate(i).toISO({includeOffset:!0}))}static fromDateTime(i){return new oe(i.toISO({includeOffset:!0}))}static fromParts(i,u,t=0,l=0,v=0,g=0,T=0,S=!1,O=0,x=0){const D=`${i.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`;let F="";g<10&&(F="0");let X=`${l.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}:${F+g.toString()}`;T!==0&&(X+="."+T.toString().padStart(3,"0"));const ee=`${S?"-":"+"}${O.toString().padStart(2,"0")}:${x.toString().padStart(2,"0")}`;return new oe(D+"T"+X+ee)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let i=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return i&&(i=i.replace(".000","")),i}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(i){const u=this.toDateTime().plus(i);return oe.fromDateTime(u)}};function Ko(a,i){const u=mr[a.toLowerCase()];if(u==null)throw new m(d.FunctionNotRecognized);if(i.lengthu.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return u.evaluate(i)}function lr(a,i){const u=mr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}const mr={min:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"min")},max:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"max")},avg:{minParams:1,maxParams:1,evaluate:a=>vr(a[0])},sum:{minParams:1,maxParams:1,evaluate:a=>Xo(a[0])},stddev:{minParams:1,maxParams:1,evaluate:a=>el(a[0])},count:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].length},var:{minParams:1,maxParams:1,evaluate:a=>hr(a[0])}};function vr(a){if(a===null)return null;let i=0,u=0;for(let t=0;t=v)&&(u=l,t=v)}return u}function Xo(a){if(a===null)return null;let i=0;for(let u=0;ut!==null)).length===0)return null;const i=vr(a);if(i===null)return null;let u=0;for(const t of a){if(!et(t))throw new m(d.InvalidValueForAggregateFunction);u+=(i-t)**2}return u/(a.length-1)}class E{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(i){if(i.precision!==null||i.secondary!==null)throw new m(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(i,u){if(u.includes(".")){const t=u.split(".");i.second=parseFloat(t[0]),i.millis=parseInt(t[1],10)}else i.second=parseFloat(u)}static createFromMilliseconds(i){const u=new E;return u.second=i/1e3,u}static createFromValueAndQualifier(i,u,t){let l=null;const v=new E;if(v.op=t==="-"?"-":"+",u.type==="interval-period"){E._fixDefaults(u);const g=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new m(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(i))throw new m(d.IllegalInterval);E._parseSecondsComponent(v,i)}else{if(!g.test(i))throw new m(d.IllegalInterval);v[u.period]=parseFloat(i)}}else{if(E._fixDefaults(u.start),E._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new m(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v[u.start.period]=parseFloat(i.split(" ")[0]),v[u.end.period]=parseFloat(i.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v.hour=parseFloat(i.split(":")[0]),v.minute=parseFloat(i.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new m(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.minute=parseFloat(g[0]),E._parseSecondsComponent(v,g[1])}break;default:throw new m(d.IllegalInterval)}}return v}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const tl=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,rl=/^(\d{1,2}):(\d{1,2})$/,nl=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,wr=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,il=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,al=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,sl=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,ul=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function Pe(a,i){if(i instanceof Bo)return i===He.instance?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i});switch(i){case"system":case"local":case null:return J.fromJSDate(a);default:return i?.toLowerCase()==="unknown"?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i})}}function V(a){return typeof a=="number"}function Z(a){return typeof a=="string"||a instanceof String}function K(a){return a instanceof E}function q(a){return a instanceof Date}function b(a){return a instanceof J}function A(a){return a instanceof j}function L(a){return a instanceof $}function P(a){return a instanceof Q}function tt(a){let i=tl.exec(a);if(i!==null){const[,u,t,l]=i,v=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),0);if(v!==null)return v;throw new m(d.InvalidTime)}if(i=rl.exec(a),i!==null){const[,u,t]=i,l=$.fromParts(parseInt(u,10),parseInt(t,10),0,0);if(l!==null)return l;throw new m(d.InvalidTime)}if(i=nl.exec(a),i!==null){const[,u,t,l,v]=i,g=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g!==null)return g;throw new m(d.InvalidTime)}throw new m(d.InvalidTime)}function De(a,i,u=!1){let t=il.exec(a);if(t!==null){const[,l,v,g,T,S,O,x]=t,D=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:parseInt(O,10),millisecond:x?parseInt(x.replace(".",""),10):0},{zone:qe(i)});if(D.isValid===!1)throw new m(d.InvalidTimeStamp);return D}if(t=al.exec(a),t!==null){const[,l,v,g,T,S,O,x,D,F,X]=t,ee=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),parseInt(O,10),x?parseInt(x.replace(".",""),10):0,D==="-",parseInt(F,10),parseInt(X,10));if(ee.isValid===!1)throw new m(d.InvalidTimeStamp);return ee}if(t=sl.exec(a),t!==null){const[,l,v,g,T,S,O,x,D]=t,F=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),0,0,O==="-",parseInt(x,10),parseInt(D,10));if(F.isValid===!1)throw new m(d.InvalidTimeStamp);return F}if(t=ul.exec(a),t!==null){const[,l,v,g,T,S]=t,O=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:0},{zone:qe(i)});if(O.isValid===!1)throw new m(d.InvalidTimeStamp);return O}if(t=wr.exec(a),t!==null){const[,l,v,g]=t,T=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:0,minute:0,second:0},{zone:qe(i)});if(T.isValid===!1)throw new m(d.InvalidTimeStamp);return T}throw new m(d.InvalidTimeStamp)}function Ir(a,i){const u=wr.exec(a);if(u===null)try{return De(a,i)}catch{throw new m(d.InvalidDate)}const[,t,l,v]=u,g=j.fromParts(parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g===null)throw new m(d.InvalidDate);return g}const ol=321408e5,ll=26784e5,cl=864e5,fl=36e5,dl=6e4;function je(a){return!!b(a)||!!P(a)}function Ge(a){return!!b(a)||!!A(a)||!!P(a)||!!L(a)}function Fe(a){if(b(a))return a.toMillis();if(A(a))return a.toNumber();if(P(a))return a.toMilliseconds();throw new m(d.InvalidDataType)}function z(a,i,u,t){if(a==null||i==null)return null;if(V(a)){if(V(i))return B(a,i,u);if(Z(i))return pl(a,i,u);if(Ge(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator)}else if(Z(a)){if(V(i))return ml(a,i,u);if(Z(i))return vl(a,i,u);if(b(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(L(i))throw new m(d.InvalidOperator);if(P(i))throw new m(d.InvalidOperator)}else if(b(a)){if(je(i)){if(a instanceof J&&pe(a.zone)){if(i instanceof J&&pe(i.zone)===!1||i instanceof Q)return Ye(a,i,u)}else if(i instanceof J&&pe(i.zone)&&(a instanceof J&&pe(a.zone)===!1||a instanceof Q))return Ye(a,i,u);return B(Fe(a),Fe(i),u)}if(Z(i))throw new m(d.InvalidOperator);if(A(i))return hl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(A(a)){if(P(i))return gl(a,i,u);if(b(i))return Il(a,i,u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return B(a.toNumber(),i.toNumber(),u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(L(a)){if(L(i))return B(a.toNumber(),i.toNumber(),u);if(Z(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(je(i))throw new m(d.InvalidOperator)}else if(P(a)){if(je(i))return i instanceof J&&pe(i.zone)?Ye(a,i,u):B(Fe(a),Fe(i),u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return wl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function B(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function pl(a,i,u){const t=parseFloat(i);if(!isNaN(t))return B(a,t,u);const l=a.toString();switch(u){case"<>":return l!==i;case"=":return l===i;case">":return l>i;case"<":return l=":return l>=i;case"<=":return l<=i}}function ml(a,i,u){const t=parseFloat(a);if(!isNaN(t))return B(t,i,u);const l=i.toString();switch(u){case"<>":return a!==l;case"=":return a===l;case">":return a>l;case"<":return a=":return a>=l;case"<=":return a<=l}}function vl(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function hl(a,i,u){const t=i.toDateTimeLuxon(a.zone);return B((a=a.startOf("day")).toMillis(),t.toMillis(),u)}function wl(a,i,u){const t=i.toDateTimeLuxon(a.toDateTime().zone);return B((a=a.startOfDay()).toMilliseconds(),t.toMillis(),u)}function Il(a,i,u){const t=a.toDateTimeLuxon(i.zone);return i=i.startOf("day"),B(t.toMillis(),i.toMillis(),u)}function gl(a,i,u){const t=a.toDateTimeLuxon(i.toDateTime().zone);return i=i.startOfDay(),B(t.toMillis(),i.toMilliseconds(),u)}function Ye(a,i,u){a instanceof Q&&(a=a.toDateTime()),i instanceof Q&&(i=i.toDateTime());const t=fr(a),l=fr(i);switch(u){case"<>":return t!==l;case"=":return t===l;case">":return t>l;case"<":return t=":return t>=l;case"<=":return t<=l}}function fr(a){return a.year*ol+a.month*ll+a.day*cl+a.hour*fl+a.minute*dl+1e3*a.second+a.millisecond}function rt(a,i,u){const t=yr[a.toLowerCase()];if(t==null)throw new m(d.FunctionNotRecognized);if(i.lengtht.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return t.evaluate(i,u)}function yl(a,i){const u=yr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}function Le(a){return typeof a=="string"||a instanceof String}function Be(a){return!q(a)&&!A(a)&&!b(a)&&!L(a)&&!P(a)}function gr(a){return A(a)||L(a)?a.toString():P(a)?a.toSQLValue():b(a)?a.millisecond===0?a.toFormat("yyyy-LL-dd HH:mm:ss"):a.toSQL({includeOffset:!1}):q(a)?gr(J.fromJSDate(a)):a.toString()}function Tl(a){if(q(a))return j.fromDateJS(a);if(b(a))return j.fromParts(a.year,a.month,a.day);if(A(a))return a;if(L(a))throw new m(d.CannotCastValue);if(P(a)&&j.fromParts(a.year,a.month,a.day)===null)throw new m(d.CannotCastValue);if(Le(a)){const i=j.fromReader(a);if(i!==null&&i.isValid)return i}throw new m(d.CannotCastValue)}function Nl(a,i,u){if(q(a))return Pe(a,i);if(b(a))return a;if(A(a))return a.toDateTimeLuxon("unknown");if(L(a))throw new m(d.CannotCastValue);if(P(a))return a;if(Le(a))return De(a,"unknown",u);throw new m(d.CannotCastValue)}function Ol(a){if(q(a))return $.fromDateJS(a);if(b(a))return $.fromDateTime(a);if(A(a))throw new m(d.CannotCastValue);if(L(a))return a;if(P(a))return $.fromSqlTimeStampOffset(a);if(Le(a))return tt(a);throw new m(d.CannotCastValue)}const yr={extract:{minParams:2,maxParams:2,evaluate:([a,i])=>{if(i==null)return null;if(q(i))switch(a.toUpperCase()){case"SECOND":return i.getSeconds();case"MINUTE":return i.getMinutes();case"HOUR":return i.getHours();case"DAY":return i.getDate();case"MONTH":return i.getMonth()+1;case"YEAR":return i.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(b(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(A(i))switch(a.toUpperCase()){case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(L(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour}else if(P(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":return i.timezoneOffsetHour;case"TIMEZONE_MINUTE":return i.timezoneOffsetMinutes}throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:a=>{if(a.length===2){const[i,u]=a;return i==null||u==null?null:i.toString().substring(u-1)}if(a.length===3){const[i,u,t]=a;return i==null||u==null||t==null?null:t<=0?"":i.toString().substring(u-1,u+t-1)}}},position:{minParams:2,maxParams:2,evaluate:([a,i])=>a==null||i==null?null:i.indexOf(a)+1},trim:{minParams:2,maxParams:3,evaluate:a=>{const i=a.length===3,u=i?a[1]:" ",t=i?a[2]:a[1];if(u==null||t==null)return null;const l=`(${Qo(u)})`;switch(a[0]){case"BOTH":return t.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return t.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return t.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new m(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.abs(a[0])},ceiling:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.ceil(a[0])},floor:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.floor(a[0])},log:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])},log10:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sin(a[0])},cos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cos(a[0])},tan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tan(a[0])},asin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.asin(a[0])},acos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.acos(a[0])},atan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.atan(a[0])},sign:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0]>0?1:a[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]**a[1]},mod:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]%a[1]},round:{minParams:1,maxParams:2,evaluate:a=>{const i=a[0],u=a.length===2?10**a[1]:1;return i==null?null:Math.round(i*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:a=>a[0]==null?null:a.length===1||a[1]===0?Math.trunc(a[0]):Go("trunc",a[0],-Number(a[1]))},char_length:{minParams:1,maxParams:1,evaluate:a=>Le(a[0])?a[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:a=>{let i="";for(let u=0;ua[0]==null?null:a[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:a=>{for(const i of a)if(i!==null)return i;return null}},cosh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cosh(a[0])},sinh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sinh(a[0])},tanh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tanh(a[0])},nullif:{minParams:2,maxParams:2,evaluate:(a,i)=>z(a[0],a[1],"=")?null:a[0]},cast:{minParams:2,maxParams:2,evaluate:(a,i)=>{const u=a[0],t=a[1];if(u===null)return null;switch(t.type){case"integer":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"smallint":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);if(l>32767||l<-32767)throw new m(d.CannotCastValue);return l}case"float":case"real":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"time":return Ol(u);case"date":return Tl(u);case"timestamp":return Nl(u,i,t.withtimezone===!0);case"varchar":{const l=gr(u);if(l.length>t.size)throw new m(d.CannotCastValue);return l}default:throw new m(d.InvalidDataType)}}}};function Tr(a,i,u,t){if(a==="||")return rt("concat",[i,u],t);if(i===null||u===null)return null;if(V(i)){if(V(u))return nt(i,u,a);if(K(u))return Al(i,u,a);if(L(u))return kl();if(A(u))return zl();if(P(u))return Zl();if(b(u))return Jl();if(Z(u))return $l(i,u,a);throw new m(d.InvalidOperator)}if(A(i)){if(V(u))return Rl(i,u,a);if(K(u))return Pl(i,u,a);if(L(u))return Wl();if(A(u))return Gl(i,u,a);if(P(u))return Ql(i,u,a);if(b(u))return Bl(i,u,a);if(Z(u))return cc();throw new m(d.InvalidOperator)}if(L(i)){if(V(u))return Ul(i,u,a);if(K(u))return Ml(i,u,a);if(L(u))return ac();if(A(u))return nc();if(P(u))return ic();if(b(u))return rc();if(Z(u))return fc();throw new m(d.InvalidOperator)}if(K(i)){if(V(u))return bl(i,u,a);if(K(u))return Fl(i,u,a);if(L(u))return xl(i,u,a);if(A(u))return Cl(i,u,a);if(P(u))return El(i,u,a);if(b(u))return Sl(i,u,a);if(Z(u))return jl();throw new m(d.InvalidOperator)}if(b(i)){if(V(u))return _l(i,u,a);if(K(u))return Dl(i,u,a);if(L(u))return lc();if(A(u))return uc(i,u,a);if(P(u))return oc(i,u,a);if(b(u))return sc(i,u,a);if(Z(u))return dc();throw new m(d.InvalidOperator)}if(P(i)){if(V(u))return Vl(i,u,a);if(K(u))return Ll(i,u,a);if(L(u))return Kl();if(A(u))return Xl(i,u,a);if(P(u))return tc(i,u,a);if(b(u))return ec(i,u,a);if(Z(u))return pc();throw new m(d.InvalidOperator)}if(Z(i)){if(V(u))return Hl(i,u,a);if(K(u))return Yl();if(L(u))return mc();if(A(u))return vc();if(P(u))return wc();if(b(u))return hc();if(Z(u))return ql(i,u,a);throw new m(d.InvalidOperator)}throw new m(d.InvalidOperator)}function nt(a,i,u){switch(u){case"+":return a+i;case"-":return a-i;case"*":return a*i;case"/":return a/i}throw new m(d.InvalidOperator)}function Sl(a,i,u){switch(u){case"+":return i.plus({milliseconds:a.valueInMilliseconds()});case"-":return a.valueInMilliseconds()-i.toMillis()}throw new m(d.InvalidOperator)}function xl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Cl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Ml(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function El(a,i,u){if(u==="+")return i.addMilliseconds(a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Fl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function bl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i);case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i);case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i);case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i)}throw new m(d.InvalidOperator)}function Al(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Pl(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Dl(a,i,u){switch(u){case"+":return a.plus({milliseconds:i.valueInMilliseconds()});case"-":return a.minus({milliseconds:i.valueInMilliseconds()})}throw new m(d.InvalidOperator)}function Ll(a,i,u){switch(u){case"+":return a.addMilliseconds(i.valueInMilliseconds());case"-":return a.addMilliseconds(-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function _l(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus({milliseconds:t});case"-":return a.minus({milliseconds:t})}throw new m(d.InvalidOperator)}function Rl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Ul(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Jl(a,i,u){throw new m(d.InvalidOperator)}function Vl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.addMilliseconds(t);case"-":return a.addMilliseconds(-1*t)}throw new m(d.InvalidOperator)}function Zl(a,i,u){throw new m(d.InvalidOperator)}function kl(a,i,u){throw new m(d.InvalidOperator)}function zl(a,i,u){throw new m(d.InvalidOperator)}function $l(a,i,u){const t=parseFloat(i);if(isNaN(t))throw new m(d.InvalidOperator);return nt(a,t,u)}function Hl(a,i,u){const t=parseFloat(a);if(isNaN(t))throw new m(d.InvalidOperator);return nt(t,i,u)}function ql(a,i,u){if(u==="+")return a+i;throw new m(d.InvalidOperator)}function jl(a,i,u){throw new m(d.InvalidOperator)}function Yl(a,i,u){throw new m(d.InvalidOperator)}function Bl(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.zone).diff(i).as("days");throw new m(d.InvalidOperator)}function Ql(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.toDateTime().zone).diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function Gl(a,i,u){if(u==="-")return a.toDateTimeLuxon("UTC").diff(i.toDateTimeLuxon("UTC")).as("days");throw new m(d.InvalidOperator)}function Wl(a,i,u){throw new m(d.InvalidOperator)}function Kl(a,i,u){throw new m(d.InvalidOperator)}function Xl(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTimeLuxon(a.toDateTime().zone)).as("days");throw new m(d.InvalidOperator)}function ec(a,i,u){if(u==="-")return a.toDateTime().diff(i).as("days");throw new m(d.InvalidOperator)}function tc(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function rc(a,i,u){throw new m(d.InvalidOperator)}function nc(a,i,u){throw new m(d.InvalidOperator)}function ic(a,i,u){throw new m(d.InvalidOperator)}function ac(a,i,u){throw new m(d.InvalidOperator)}function sc(a,i,u){if(u==="-")return a.diff(i).as("days");throw new m(d.InvalidOperator)}function uc(a,i,u){if(u==="-")return a.diff(i.toDateTimeLuxon(a.zone)).as("days");throw new m(d.InvalidOperator)}function oc(a,i,u){if(u==="-")return a.diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function lc(a,i,u){throw new m(d.InvalidOperator)}function cc(a,i,u){throw new m(d.InvalidOperator)}function fc(a,i,u){throw new m(d.InvalidOperator)}function dc(a,i,u){throw new m(d.InvalidOperator)}function pc(a,i,u){throw new m(d.InvalidOperator)}function mc(a,i,u){throw new m(d.InvalidOperator)}function vc(a,i,u){throw new m(d.InvalidOperator)}function hc(a,i,u){throw new m(d.InvalidOperator)}function wc(a,i,u){throw new m(d.InvalidOperator)}function Ic(a,i){function u(){this.constructor=a}u.prototype=i.prototype,a.prototype=new u}function se(a,i,u,t){var l=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(l,se.prototype),l.expected=i,l.found=u,l.location=t,l.name="SyntaxError",l}function Qe(a,i,u){return u=u||" ",a.length>i?a:(i-=a.length,a+(u+=u.repeat(i)).slice(0,i))}function gc(a,i){var u,t={},l=(i=i!==void 0?i:{}).grammarSource,v={start:St},g=St,T="!",S="=",O=">=",x=">",D="<=",F="<>",X="!=",ee="||",Cr="@",at="'",st="N'",me="''",Mr=".",Er="null",Fr="true",br="false",Ar="in",Pr="is",Dr="like",Lr="escape",_r="not",Rr="and",Ur="or",Jr="between",Vr="from",Zr="for",kr="substring",zr="extract",$r="trim",Hr="position",qr="timestamp",jr="date",Yr="time",Br="leading",Qr="trailing",Gr="both",Wr="cast",Kr="as",Xr="integer",en="int",tn="smallint",rn="float",nn="real",an="varchar",sn="to",un="interval",on="year",ln="timezone_hour",cn="timezone_minute",fn="month",dn="day",pn="hour",mn="minute",vn="second",hn="case",wn="end",In="when",gn="then",yn="else",Tn=",",Nn="(",On=")",ut="`",Sn=/^[<-=]/,ve=/^[+\-]/,xn=/^[*\/]/,Cn=/^[A-Za-z_\x80-\uFFFF]/,Mn=/^[A-Za-z0-9_]/,ot=/^[A-Za-z0-9_.\x80-\uFFFF]/,En=/^["]/,lt=/^[^']/,Fn=/^[0-9]/,bn=/^[eE]/,An=/^[ \t\n\r]/,ct=/^[^`]/,Pn=y("!",!1),Dn=y("=",!1),Ln=y(">=",!1),_n=y(">",!1),Rn=y("<=",!1),Un=y("<>",!1),Jn=H([["<","="]],!1,!1),Vn=y("!=",!1),he=H(["+","-"],!1,!1),Zn=y("||",!1),kn=H(["*","/"],!1,!1),zn=H([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),$n=H([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ft=H([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Hn=H(['"'],!1,!1),qn=y("@",!1),dt=y("'",!1),jn=y("N'",!1),pt=y("''",!1),mt=H(["'"],!0,!1),Yn=y(".",!1),Bn=H([["0","9"]],!1,!1),Qn=H(["e","E"],!1,!1),Gn=y("NULL",!0),Wn=y("TRUE",!0),Kn=y("FALSE",!0),Xn=y("IN",!0),ei=y("IS",!0),ti=y("LIKE",!0),ri=y("ESCAPE",!0),ni=y("NOT",!0),ii=y("AND",!0),ai=y("OR",!0),si=y("BETWEEN",!0),ui=y("FROM",!0),oi=y("FOR",!0),li=y("SUBSTRING",!0),ci=y("EXTRACT",!0),fi=y("TRIM",!0),di=y("POSITION",!0),pi=y("TIMESTAMP",!0),mi=y("DATE",!0),vi=y("TIME",!0),hi=y("LEADING",!0),wi=y("TRAILING",!0),Ii=y("BOTH",!0),gi=y("CAST",!0),yi=y("AS",!0),Ti=y("INTEGER",!0),Ni=y("INT",!0),Oi=y("SMALLINT",!0),Si=y("FLOAT",!0),xi=y("REAL",!0),Ci=y("VARCHAR",!0),Mi=y("TO",!0),Ei=y("INTERVAL",!0),Fi=y("YEAR",!0),bi=y("TIMEZONE_HOUR",!0),Ai=y("TIMEZONE_MINUTE",!0),Pi=y("MONTH",!0),Di=y("DAY",!0),Li=y("HOUR",!0),_i=y("MINUTE",!0),Ri=y("SECOND",!0),Ui=y("CASE",!0),Ji=y("END",!0),Vi=y("WHEN",!0),Zi=y("THEN",!0),ki=y("ELSE",!0),zi=y(",",!1),$i=y("(",!1),Hi=y(")",!1),qi=H([" "," ",` -`,"\r"],!1,!1),vt=y("`",!1),ht=H(["`"],!0,!1),ji=function(e){return e},Yi=function(e){return k(I(),...e)},wt=function(e,r,s){return{op:r,expr:s,location:I()}},Bi=function(e,r){return de(e,r)},It=function(e,r,s){return{op:r,expr:s,location:I()}},Qi=function(e,r){return de(e,r)},Gi=function(e){return ko("NOT",e,I())},Wi=function(e,r){return r==""||r==null||r==null?e:r.type=="arithmetic"?de(e,r.tail):ar(r.op,e,r.right,r.escape,I())},gt=function(e,r){return{op:e,expr:r,location:I()}},Ki=function(e){return{type:"arithmetic",tail:e}},Xi=function(e,r){return{op:e+"NOT",right:r}},ea=function(e,r){return{op:e,right:r}},ta=function(e,r,s){return k(I(),r,s)},ra=function(e,r){return{op:"NOT"+e,right:r}},na=function(e,r,s){return k(I(),r,s)},ia=function(e,r){return{op:e,right:r}},aa=function(e){return e[0]+" "+e[2]},sa=function(e){return e[0]+" "+e[2]},ua=function(e,r,s){return{op:e,right:r,escape:s.value}},oa=function(e,r){return{op:e,right:r,escape:""}},la=function(e,r){return{op:e,right:r}},ca=function(e,r){return{op:e,right:r}},yt=function(e,r,s){return{op:r,expr:s,location:I()}},fa=function(e,r){return de(e,r)},Tt=function(e,r,s){return{op:r,expr:s,location:I()}},da=function(e,r){return de(e,r)},pa=function(e){return e.paren=!0,e},ma=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:I(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:I(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:I(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:I()}:{type:"column-reference",location:I(),table:"",column:e}},va=function(e){return{type:"column-reference",location:I(),table:"",column:e,delimited:!0}},ha=function(e){return e},wa=function(e,r){return e+r.join("")},Ia=function(e,r){return e+r.join("")},ga=function(e){return e},ya=function(e){return e.join("")},Ta=function(){return'"'},Na=function(e){return{type:"parameter",location:I(),value:e[1]}},Oa=function(e,r){return k(I(),e,r)},Sa=function(e,r){return k(I(),e,r)},xa=function(e){return{type:"function",location:I(),name:"extract",args:e}},Ca=function(e,r,s){return k(I(),e,r,...s?[s]:[])},Ma=function(e,r,s){return k(I(),e,r,s)},Ea=function(e){return{type:"function",location:I(),name:"substring",args:e}},Fa=function(e,r){return k(I(),e,r)},ba=function(e,r){return k(I(),e,r)},Aa=function(e){return{type:"function",location:I(),name:"cast",args:e}},Pa=function(){return{type:"data-type",location:I(),value:{type:"integer"}}},Da=function(){return{type:"data-type",location:I(),value:{type:"smallint"}}},La=function(){return{type:"data-type",location:I(),value:{type:"float"}}},_a=function(){return{type:"data-type",location:I(),value:{type:"real"}}},Ra=function(){return{type:"data-type",location:I(),value:{type:"date"}}},Ua=function(){return{type:"data-type",location:I(),value:{type:"timestamp"}}},Ja=function(){return{type:"data-type",location:I(),value:{type:"time"}}},Va=function(e){return{type:"data-type",location:I(),value:{type:"varchar",size:parseInt(e)}}},Za=function(e,r,s){return k(I(),e,r,s)},ka=function(e,r){return k(I(),e,r)},za=function(e){return{type:"function",location:I(),name:"trim",args:e}},$a=function(e){return{type:"string",location:I(),value:e??"BOTH"}},Ha=function(e,r){return k(I(),e,r)},qa=function(e,r){return k(I(),e,r)},ja=function(e){return{type:"function",location:I(),name:"position",args:e}},Ya=function(e,r){return{type:"function",location:I(),name:e,args:r}},Ba=function(e){return{type:"string",location:I(),value:e}},Qa=function(e){return e.type==="string"&&zo(e.value),{type:"timestamp",location:I(),value:e.value}},Ga=function(e){return e.type==="string"&&$o(e.value),{type:"time",location:I(),value:e.value}},Wa=function(e,r,s){return{type:"interval",location:I(),value:r,qualifier:s,op:e}},Ka=function(e,r){return{type:"interval",location:I(),value:e,qualifier:r,op:""}},Xa=function(e,r){return{type:"interval-qualifier",location:I(),start:e,end:r}},es=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},ts=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},rs=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},ns=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},is=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},as=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},ss=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},us=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},os=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},ls=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},cs=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},fs=function(){return{type:"string",location:I(),value:"day"}},ds=function(){return{type:"string",location:I(),value:"hour"}},ps=function(){return{type:"string",location:I(),value:"minute"}},ms=function(){return{type:"string",location:I(),value:"month"}},vs=function(){return{type:"string",location:I(),value:"year"}},hs=function(e){return parseFloat(e)},ws=function(e){return parseFloat(e)},Is=function(e){return e.type==="string"&&Ho(e.value),{type:"date",location:I(),value:e.value}},gs=function(){return{type:"null",location:I(),value:null}},ys=function(){return{type:"boolean",location:I(),value:!0}},Ts=function(){return{type:"boolean",location:I(),value:!1}},Nt=function(){return"'"},Ns=function(e){return{type:"string",location:I(),value:e.join("")}},Os=function(e,r){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:null,elseLocation:null}},Ss=function(e,r,s){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:s.value,elseLocation:s.location}},xs=function(e){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:null,elseLocation:null}},Cs=function(e,r){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:r.value,elseLocation:r.location}},Ms=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Es=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Fs=function(e){return{type:"else-clause",location:I(),value:e}},bs=function(e){return{type:"number",location:I(),value:e}},As=function(e,r,s){return parseFloat(e+r+s)},Ps=function(e,r){return parseFloat(e+r)},Ds=function(e,r){return parseFloat(e+r)},Ls=function(e){return parseFloat(e)},_s=function(e,r){return e[0]+r},Rs=function(e){return"."+(e??"")},Us=function(e,r){return e+r},Js=function(e){return e.join("")},Vs=function(e,r){return"e"+(r===null?"":r)},Zs=function(){return"IN"},ks=function(){return"IS"},zs=function(){return"LIKE"},$s=function(){return"ESCAPE"},Hs=function(){return"NOT"},qs=function(){return"AND"},js=function(){return"OR"},Ys=function(){return"BETWEEN"},Bs=function(){return"FROM"},Qs=function(){return"FOR"},Gs=function(){return"SUBSTRING"},Ws=function(){return"EXTRACT"},Ks=function(){return"TRIM"},Xs=function(){return"POSITION"},eu=function(){return"TIMESTAMP"},tu=function(){return"DATE"},ru=function(){return"TIME"},nu=function(){return"LEADING"},iu=function(){return"TRAILING"},au=function(){return"BOTH"},su=function(){return"CAST"},uu=function(){return"AS"},ou=function(){return"INTEGER"},lu=function(){return"INT"},cu=function(){return"SMALLINT"},fu=function(){return"FLOAT"},du=function(){return"REAL"},pu=function(){return"VARCHAR"},mu=function(){return"TO"},vu=function(){return"INTERVAL"},hu=function(){return"YEAR"},wu=function(){return"TIMEZONE_HOUR"},Iu=function(){return"TIMEZONE_MINUTE"},gu=function(){return"MONTH"},yu=function(){return"DAY"},Tu=function(){return"HOUR"},Nu=function(){return"MINUTE"},Ou=function(){return"SECOND"},Su=function(){return"CASE"},xu=function(){return"END"},Cu=function(){return"WHEN"},Mu=function(){return"THEN"},Eu=function(){return"ELSE"},Fu=function(e){return e},bu=function(e){return e.join("")},n=0|i.peg$currPos,f=n,ue=[{line:1,column:1}],Y=n,we=i.peg$maxFailExpected||[],c=0|i.peg$silentFails;if(i.startRule){if(!(i.startRule in v))throw new Error(`Can't start parsing from rule "`+i.startRule+'".');g=v[i.startRule]}function I(){return Ie(f,n)}function _e(e,r){throw Pu(e,r=r!==void 0?r:Ie(f,n))}function y(e,r){return{type:"literal",text:e,ignoreCase:r}}function H(e,r,s){return{type:"class",parts:e,inverted:r,ignoreCase:s}}function Au(){return{type:"end"}}function Ot(e){var r,s=ue[e];if(s)return s;if(e>=ue.length)r=ue.length-1;else for(r=e;!ue[--r];);for(s={line:(s=ue[r]).line,column:s.column};rY&&(Y=n,we=[]),we.push(e))}function Pu(e,r){return new se(e,null,null,r)}function Du(e,r,s){return new se(se.buildMessage(e,r),e,r,s)}function St(){var e,r;return e=n,p(),(r=M())!==t?(p(),f=e,e=ji(r)):(n=e,e=t),e}function xt(){var e,r,s,o,h,C;if(e=n,_()!==t){for(p(),r=[],s=M();s!==t;)r.push(s),s=n,o=n,h=p(),(C=W())!==t?o=h=[h,C,p()]:(n=o,o=t),o!==t&&(o=M())===t?(n=s,s=t):s=o;s=p(),(o=R())!==t?(f=e,e=Yi(r)):(n=e,e=t)}else n=e,e=t;return e}function M(){var e,r,s,o,h,C;if(e=n,(r=Re())!==t){for(s=[],o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Bi(r,s)}else n=e,e=t;return e}function Re(){var e,r,s,o,h,C;if(e=n,(r=ge())!==t){for(s=[],o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Qi(r,s)}else n=e,e=t;return e}function ge(){var e,r,s,o,h;return e=n,(r=fe())===t&&(r=n,a.charCodeAt(n)===33?(s=T,n++):(s=t,c===0&&w(Pn)),s!==t?(o=n,c++,a.charCodeAt(n)===61?(h=S,n++):(h=t,c===0&&w(Dn)),c--,h===t?o=void 0:(n=o,o=t),o!==t?r=s=[s,o]:(n=r,r=t)):(n=r,r=t)),r!==t?(s=p(),(o=ge())!==t?(f=e,e=Gi(o)):(n=e,e=t)):(n=e,e=t),e===t&&(e=Lu()),e}function Lu(){var e,r,s,o;return e=n,(r=G())!==t?(s=n,p(),(o=_u())!==t?s=o:(n=s,s=t),s===t&&(s=null),f=e,e=Wi(r,s)):(n=e,e=t),e}function _u(){var e;return(e=Ru())===t&&(e=Zu())===t&&(e=Ju())===t&&(e=Uu())===t&&(e=Vu()),e}function Ru(){var e,r,s,o,h;if(e=n,r=[],s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t),s!==t)for(;s!==t;)r.push(s),s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t);else r=t;return r!==t&&(f=e,r=Ki(r)),e=r}function Ct(){var e;return a.substr(n,2)===O?(e=O,n+=2):(e=t,c===0&&w(Ln)),e===t&&(a.charCodeAt(n)===62?(e=x,n++):(e=t,c===0&&w(_n)),e===t&&(a.substr(n,2)===D?(e=D,n+=2):(e=t,c===0&&w(Rn)),e===t&&(a.substr(n,2)===F?(e=F,n+=2):(e=t,c===0&&w(Un)),e===t&&(e=a.charAt(n),Sn.test(e)?n++:(e=t,c===0&&w(Jn)),e===t&&(a.substr(n,2)===X?(e=X,n+=2):(e=t,c===0&&w(Vn))))))),e}function Uu(){var e,r,s,o;return e=n,(r=zt())!==t?(p(),(s=fe())!==t?(p(),(o=G())!==t?(f=e,e=Xi(r,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=zt())!==t?(p(),(s=G())!==t?(f=e,e=ea(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Ju(){var e,r,s,o,h,C,ie,sr;return e=n,(r=fe())!==t?(p(),(s=qt())!==t?(o=p(),h=n,(C=G())!==t?(p(),(ie=Ce())!==t?(p(),(sr=G())!==t?(f=h,h=ta(s,C,sr)):(n=h,h=t)):(n=h,h=t)):(n=h,h=t),h!==t?(f=e,e=ra(s,h)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=qt())!==t?(p(),s=n,(o=G())!==t?(h=p(),(C=Ce())!==t?(p(),(ie=G())!==t?(f=s,s=na(r,o,ie)):(n=s,s=t)):(n=s,s=t)):(n=s,s=t),s!==t?(f=e,e=ia(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Mt(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=$t())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=aa(r)),(e=r)===t&&(e=$t()),e}function Et(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=ze())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=sa(r)),(e=r)===t&&(e=ze()),e}function Vu(){var e,r,s,o;return e=n,(r=Mt())!==t?(p(),(s=te())!==t?(p(),yo()!==t?(p(),(o=ke())!==t?(f=e,e=ua(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Mt())!==t?(p(),(s=te())!==t?(f=e,e=oa(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Zu(){var e,r,s;return e=n,(r=Et())!==t?(p(),(s=xt())!==t?(f=e,e=la(r,s)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Et())!==t?(p(),(s=Ze())!==t?(f=e,e=ca(r,s)):(n=e,e=t)):(n=e,e=t)),e}function G(){var e,r,s,o,h,C;if(e=n,(r=Ue())!==t){for(s=[],o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=fa(r,s)}else n=e,e=t;return e}function Ft(){var e;return e=a.charAt(n),ve.test(e)?n++:(e=t,c===0&&w(he)),e===t&&(a.substr(n,2)===ee?(e=ee,n+=2):(e=t,c===0&&w(Zn))),e}function Ue(){var e,r,s,o,h,C;if(e=n,(r=Je())!==t){for(s=[],o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=da(r,s)}else n=e,e=t;return e}function bt(){var e;return e=a.charAt(n),xn.test(e)?n++:(e=t,c===0&&w(kn)),e}function Je(){var e,r;return(e=eo())===t&&(e=Bu())===t&&(e=Qu())===t&&(e=Wu())===t&&(e=Ku())===t&&(e=Gu())===t&&(e=Xu())===t&&(e=co())===t&&(e=ku())===t&&(e=Ze())===t&&(e=n,_()!==t?(p(),(r=M())!==t?(p(),R()!==t?(f=e,e=pa(r)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function ku(){var e,r;return e=n,(r=zu())!==t&&(f=e,r=ma(r)),(e=r)===t&&(e=n,(r=Hu())!==t&&(f=e,r=va(r)),e=r),e}function zu(){var e,r;return e=n,(r=$u())!==t&&(f=e,r=ha(r)),e=r}function $u(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=Pt();o!==t;)s.push(o),o=Pt();f=e,e=wa(r,s)}else n=e,e=t;return e}function At(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=N();o!==t;)s.push(o),o=N();f=e,e=Ia(r,s)}else n=e,e=t;return e}function Ve(){var e;return e=a.charAt(n),Cn.test(e)?n++:(e=t,c===0&&w(zn)),e}function N(){var e;return e=a.charAt(n),Mn.test(e)?n++:(e=t,c===0&&w($n)),e}function Pt(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function Hu(){var e,r;return e=n,ye()!==t?(r=qu(),ye()!==t?(f=e,e=ga(r)):(n=e,e=t)):(n=e,e=t),e}function qu(){var e,r,s;for(e=n,r=[],s=Dt();s!==t;)r.push(s),s=Dt();return f=e,e=r=ya(r)}function Dt(){var e;return(e=Yu())===t&&(e=ju()),e}function ju(){var e;return e=n,ye()!==t&&ye()!==t?(f=e,e=Ta()):(n=e,e=t),e}function Yu(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function ye(){var e;return e=a.charAt(n),En.test(e)?n++:(e=t,c===0&&w(Hn)),e}function Ze(){var e,r,s,o;return e=n,r=n,a.charCodeAt(n)===64?(s=Cr,n++):(s=t,c===0&&w(qn)),s!==t&&(o=At())!==t?r=s=[s,o]:(n=r,r=t),r!==t&&(f=e,r=Na(r)),e=r}function Bu(){var e,r,s,o;return e=n,jt()!==t?(p(),r=n,_()!==t?(p(),(s=Rt())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Oa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=Rt())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Sa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=xa(r)):(n=e,e=t)):(n=e,e=t),e}function Qu(){var e,r,s,o,h,C,ie;return e=n,No()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),h=n,To()!==t?(C=p(),(ie=M())!==t?(p(),h=ie):(n=h,h=t)):(n=h,h=t),h===t&&(h=null),R()!==t?(f=r,r=Ca(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),(h=W())!==t?(p(),(C=M())!==t&&(ie=R())!==t?(f=r,r=Ma(s,o,C)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Ea(r)):(n=e,e=t)):(n=e,e=t),e}function Gu(){var e,r,s,o;return e=n,Eo()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),Fo()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=Fa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=ba(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Aa(r)):(n=e,e=t)):(n=e,e=t),e}function Lt(){var e,r,s;return e=n,(r=bo())===t&&(r=Ao()),r!==t&&(f=e,r=Pa()),(e=r)===t&&(e=n,(r=Po())!==t&&(f=e,r=Da()),(e=r)===t&&(e=n,(r=Do())!==t&&(f=e,r=La()),(e=r)===t&&(e=n,(r=Lo())!==t&&(f=e,r=_a()),(e=r)===t&&(e=n,(r=Bt())!==t&&(f=e,r=Ra()),(e=r)===t&&(e=n,(r=Yt())!==t&&(f=e,r=Ua()),(e=r)===t&&(e=n,(r=Qt())!==t&&(f=e,r=Ja()),(e=r)===t&&(e=n,(r=_o())!==t?(p(),_()!==t?(p(),(s=re())!==t?(p(),R()!==t?(f=e,e=Va(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)))))))),e}function Wu(){var e,r,s,o,h;return e=n,Oo()!==t?(p(),r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),$e()!==t?(p(),(h=M())!==t?(p(),R()!==t?(f=r,r=Za(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),R()!==t?(f=r,r=ka(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=za(r)):(n=e,e=t)):(n=e,e=t),e}function _t(){var e,r;return e=n,(r=xo())===t&&(r=Co())===t&&(r=Mo()),r===t&&(r=null),f=e,e=r=$a(r)}function Ku(){var e,r,s,o;return e=n,So()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),ze()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Ha(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=qa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=ja(r)):(n=e,e=t)):(n=e,e=t),e}function Xu(){var e,r,s,o;return e=n,r=n,c++,s=jt(),c--,s===t?r=void 0:(n=r,r=t),r!==t&&(s=Zo())!==t?(p(),(o=xt())!==t?(f=e,e=Ya(s,o)):(n=e,e=t)):(n=e,e=t),e}function Rt(){var e,r;return e=n,(r=Wt())===t&&(r=Kt())===t&&(r=Xt())===t&&(r=er())===t&&(r=tr())===t&&(r=ne())===t&&(r=Uo())===t&&(r=Jo()),r!==t&&(f=e,r=Ba(r)),e=r}function eo(){var e;return(e=ke())===t&&(e=mo())===t&&(e=lo())===t&&(e=oo())===t&&(e=uo())===t&&(e=to())===t&&(e=no())===t&&(e=ro()),e}function to(){var e,r;return e=n,Yt()!==t?(p(),(r=te())!==t?(f=e,e=Qa(r)):(n=e,e=t)):(n=e,e=t),e}function ro(){var e,r;return e=n,Qt()!==t?(p(),(r=te())!==t?(f=e,e=Ga(r)):(n=e,e=t)):(n=e,e=t),e}function no(){var e,r,s,o;return e=n,Gt()!==t?(p(),r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t?(p(),(s=te())!==t?(p(),(o=Ut())!==t?(f=e,e=Wa(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,Gt()!==t?(p(),(r=te())!==t?(p(),(s=Ut())!==t?(f=e,e=Ka(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function Ut(){var e,r,s;return e=n,(r=io())!==t?(p(),Ro()!==t?(p(),(s=ao())!==t?(f=e,e=Xa(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=so()),e}function io(){var e,r,s;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=ts(r)),e=r),e}function ao(){var e,r,s,o;return e=n,(r=ce())!==t&&(f=e,r=rs(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=ns(s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=is(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=as()),e=r))),e}function so(){var e,r,s,o;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ss(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=us(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=os(s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ls(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=cs()),e=r)))),e}function ce(){var e,r;return e=n,(r=Xt())!==t&&(f=e,r=fs()),(e=r)===t&&(e=n,(r=er())!==t&&(f=e,r=ds()),(e=r)===t&&(e=n,(r=tr())!==t&&(f=e,r=ps()),(e=r)===t&&(e=n,(r=Kt())!==t&&(f=e,r=ms()),(e=r)===t&&(e=n,(r=Wt())!==t&&(f=e,r=vs()),e=r)))),e}function Te(){var e,r;return e=n,(r=re())!==t&&(f=e,r=hs(r)),e=r}function Ne(){var e,r;return e=n,(r=re())!==t&&(f=e,r=ws(r)),e=r}function uo(){var e,r;return e=n,Bt()!==t?(p(),(r=te())!==t?(f=e,e=Is(r)):(n=e,e=t)):(n=e,e=t),e}function oo(){var e,r;return e=n,(r=wo())!==t&&(f=e,r=gs()),e=r}function lo(){var e,r;return e=n,(r=Io())!==t&&(f=e,r=ys()),(e=r)===t&&(e=n,(r=go())!==t&&(f=e,r=Ts()),e=r),e}function te(){var e;return(e=ke())===t&&(e=Ze()),e}function ke(){var e,r,s,o,h;if(e=n,a.charCodeAt(n)===39?(r=at,n++):(r=t,c===0&&w(dt)),r===t&&(a.substr(n,2)===st?(r=st,n+=2):(r=t,c===0&&w(jn))),r!==t){for(s=[],o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));o!==t;)s.push(o),o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));a.charCodeAt(n)===39?(o=at,n++):(o=t,c===0&&w(dt)),o!==t?(f=e,e=Ns(s)):(n=e,e=t)}else n=e,e=t;return e}function co(){var e;return(e=fo())===t&&(e=po()),e}function fo(){var e,r,s,o,h;if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Ee())!==t?(f=e,e=Os(r,s)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;if(e===t)if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Jt())!==t?(h=p(),Ee()!==t?(f=e,e=Ss(r,s,o)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;return e}function po(){var e,r,s,o;if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Ee())!==t?(f=e,e=xs(r)):(n=e,e=t)}else n=e,e=t;if(e===t)if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Jt())!==t?(o=p(),Ee()!==t?(f=e,e=Cs(r,s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function Oe(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Ms(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Se(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Jt(){var e,r;return e=n,Vo()!==t?(p(),(r=M())!==t?(f=e,e=Fs(r)):(n=e,e=t)):(n=e,e=t),e}function mo(){var e,r,s,o;return e=n,(r=vo())!==t?(s=n,c++,o=Ve(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=bs(r)):(n=e,e=t)):(n=e,e=t),e}function vo(){var e,r,s,o;return e=n,(r=xe())!==t&&(s=Vt())!==t&&(o=Zt())!==t?(f=e,e=As(r,s,o)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Vt())!==t?(f=e,e=Ps(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Zt())!==t?(f=e,e=Ds(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(f=e,r=Ls(r)),e=r))),e}function xe(){var e,r,s;return(e=re())===t&&(e=n,r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t&&(s=re())!==t?(f=e,e=_s(r,s)):(n=e,e=t)),e}function Vt(){var e,r,s;return e=n,a.charCodeAt(n)===46?(r=Mr,n++):(r=t,c===0&&w(Yn)),r!==t?((s=re())===t&&(s=null),f=e,e=Rs(s)):(n=e,e=t),e}function Zt(){var e,r,s;return e=n,(r=ho())!==t&&(s=re())!==t?(f=e,e=Us(r,s)):(n=e,e=t),e}function re(){var e,r,s;if(e=n,r=[],(s=kt())!==t)for(;s!==t;)r.push(s),s=kt();else r=t;return r!==t&&(f=e,r=Js(r)),e=r}function kt(){var e;return e=a.charAt(n),Fn.test(e)?n++:(e=t,c===0&&w(Bn)),e}function ho(){var e,r,s;return e=n,r=a.charAt(n),bn.test(r)?n++:(r=t,c===0&&w(Qn)),r!==t?(s=a.charAt(n),ve.test(s)?n++:(s=t,c===0&&w(he)),s===t&&(s=null),f=e,e=Vs(r,s)):(n=e,e=t),e}function wo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Er?n+=4:(r=t,c===0&&w(Gn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function Io(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Fr?n+=4:(r=t,c===0&&w(Wn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function go(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===br?n+=5:(r=t,c===0&&w(Kn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function ze(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ar?n+=2:(r=t,c===0&&w(Xn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Zs()):(n=e,e=t)):(n=e,e=t),e}function zt(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Pr?n+=2:(r=t,c===0&&w(ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ks()):(n=e,e=t)):(n=e,e=t),e}function $t(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Dr?n+=4:(r=t,c===0&&w(ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=zs()):(n=e,e=t)):(n=e,e=t),e}function yo(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===Lr?n+=6:(r=t,c===0&&w(ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=$s()):(n=e,e=t)):(n=e,e=t),e}function fe(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===_r?n+=3:(r=t,c===0&&w(ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Hs()):(n=e,e=t)):(n=e,e=t),e}function Ce(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Rr?n+=3:(r=t,c===0&&w(ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=qs()):(n=e,e=t)):(n=e,e=t),e}function Ht(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ur?n+=2:(r=t,c===0&&w(ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=js()):(n=e,e=t)):(n=e,e=t),e}function qt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Jr?n+=7:(r=t,c===0&&w(si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ys()):(n=e,e=t)):(n=e,e=t),e}function $e(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Vr?n+=4:(r=t,c===0&&w(ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Bs()):(n=e,e=t)):(n=e,e=t),e}function To(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Zr?n+=3:(r=t,c===0&&w(oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Qs()):(n=e,e=t)):(n=e,e=t),e}function No(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===kr?n+=9:(r=t,c===0&&w(li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Gs()):(n=e,e=t)):(n=e,e=t),e}function jt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===zr?n+=7:(r=t,c===0&&w(ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ws()):(n=e,e=t)):(n=e,e=t),e}function Oo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===$r?n+=4:(r=t,c===0&&w(fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ks()):(n=e,e=t)):(n=e,e=t),e}function So(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Hr?n+=8:(r=t,c===0&&w(di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Xs()):(n=e,e=t)):(n=e,e=t),e}function Yt(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===qr?n+=9:(r=t,c===0&&w(pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=eu()):(n=e,e=t)):(n=e,e=t),e}function Bt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===jr?n+=4:(r=t,c===0&&w(mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=tu()):(n=e,e=t)):(n=e,e=t),e}function Qt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Yr?n+=4:(r=t,c===0&&w(vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ru()):(n=e,e=t)):(n=e,e=t),e}function xo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Br?n+=7:(r=t,c===0&&w(hi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=nu()):(n=e,e=t)):(n=e,e=t),e}function Co(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Qr?n+=8:(r=t,c===0&&w(wi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=iu()):(n=e,e=t)):(n=e,e=t),e}function Mo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Gr?n+=4:(r=t,c===0&&w(Ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=au()):(n=e,e=t)):(n=e,e=t),e}function Eo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Wr?n+=4:(r=t,c===0&&w(gi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=su()):(n=e,e=t)):(n=e,e=t),e}function Fo(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Kr?n+=2:(r=t,c===0&&w(yi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=uu()):(n=e,e=t)):(n=e,e=t),e}function bo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Xr?n+=7:(r=t,c===0&&w(Ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ou()):(n=e,e=t)):(n=e,e=t),e}function Ao(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===en?n+=3:(r=t,c===0&&w(Ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=lu()):(n=e,e=t)):(n=e,e=t),e}function Po(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===tn?n+=8:(r=t,c===0&&w(Oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=cu()):(n=e,e=t)):(n=e,e=t),e}function Do(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===rn?n+=5:(r=t,c===0&&w(Si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=fu()):(n=e,e=t)):(n=e,e=t),e}function Lo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===nn?n+=4:(r=t,c===0&&w(xi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=du()):(n=e,e=t)):(n=e,e=t),e}function _o(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===an?n+=7:(r=t,c===0&&w(Ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=pu()):(n=e,e=t)):(n=e,e=t),e}function Ro(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===sn?n+=2:(r=t,c===0&&w(Mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=mu()):(n=e,e=t)):(n=e,e=t),e}function Gt(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===un?n+=8:(r=t,c===0&&w(Ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=vu()):(n=e,e=t)):(n=e,e=t),e}function Wt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===on?n+=4:(r=t,c===0&&w(Fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=hu()):(n=e,e=t)):(n=e,e=t),e}function Uo(){var e,r,s,o;return e=n,(r=a.substr(n,13)).toLowerCase()===ln?n+=13:(r=t,c===0&&w(bi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=wu()):(n=e,e=t)):(n=e,e=t),e}function Jo(){var e,r,s,o;return e=n,(r=a.substr(n,15)).toLowerCase()===cn?n+=15:(r=t,c===0&&w(Ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Iu()):(n=e,e=t)):(n=e,e=t),e}function Kt(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===fn?n+=5:(r=t,c===0&&w(Pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=gu()):(n=e,e=t)):(n=e,e=t),e}function Xt(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===dn?n+=3:(r=t,c===0&&w(Di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=yu()):(n=e,e=t)):(n=e,e=t),e}function er(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===pn?n+=4:(r=t,c===0&&w(Li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Tu()):(n=e,e=t)):(n=e,e=t),e}function tr(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===mn?n+=6:(r=t,c===0&&w(_i)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Nu()):(n=e,e=t)):(n=e,e=t),e}function ne(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===vn?n+=6:(r=t,c===0&&w(Ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ou()):(n=e,e=t)):(n=e,e=t),e}function Me(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===hn?n+=4:(r=t,c===0&&w(Ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Su()):(n=e,e=t)):(n=e,e=t),e}function Ee(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===wn?n+=3:(r=t,c===0&&w(Ji)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=xu()):(n=e,e=t)):(n=e,e=t),e}function rr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===In?n+=4:(r=t,c===0&&w(Vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Cu()):(n=e,e=t)):(n=e,e=t),e}function nr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===gn?n+=4:(r=t,c===0&&w(Zi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Mu()):(n=e,e=t)):(n=e,e=t),e}function Vo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===yn?n+=4:(r=t,c===0&&w(ki)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Eu()):(n=e,e=t)):(n=e,e=t),e}function W(){var e;return a.charCodeAt(n)===44?(e=Tn,n++):(e=t,c===0&&w(zi)),e}function _(){var e;return a.charCodeAt(n)===40?(e=Nn,n++):(e=t,c===0&&w($i)),e}function R(){var e;return a.charCodeAt(n)===41?(e=On,n++):(e=t,c===0&&w(Hi)),e}function p(){var e,r;for(e=[],r=ir();r!==t;)e.push(r),r=ir();return e}function ir(){var e;return e=a.charAt(n),An.test(e)?n++:(e=t,c===0&&w(qi)),e}function Zo(){var e,r,s,o;if(e=n,(r=At())!==t&&(f=e,r=Fu(r)),(e=r)===t)if(e=n,a.charCodeAt(n)===96?(r=ut,n++):(r=t,c===0&&w(vt)),r!==t){if(s=[],o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht)),o!==t)for(;o!==t;)s.push(o),o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht));else s=t;s!==t?(a.charCodeAt(n)===96?(o=ut,n++):(o=t,c===0&&w(vt)),o!==t?(f=e,e=bu(s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function ko(e,r,s){return{type:"unary-expression",location:s,operator:e,expr:r}}function ar(e,r,s,o,h){const C={type:"binary-expression",location:h,operator:e,left:r,right:s};return o!==void 0&&(C.escape=o),C}function k(e,...r){return{type:"expression-list",location:e,value:r}}function de(e,r){let s=e;for(const{op:o,expr:h,location:{end:C}}of r)s=ar(o,s,h,void 0,{...s.location,end:C});return s}function zo(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Timestamp literal is invalid")}function $o(e){/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)!==!0&&_e("Time literal is invalid")}function Ho(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Date literal is invalid")}if(u=g(),i.peg$library)return{peg$result:u,peg$currPos:n,peg$FAILED:t,peg$maxFailExpected:we,peg$maxFailPos:Y};if(u!==t&&n===a.length)return u;throw u!==t&&n `+g+` -`+S+` | -`+v.line+" | "+O+` -`+S+" | "+Qe("",l.column-1," ")+Qe("",x,"^")}else i+=` - at `+g}return i},se.buildMessage=function(a,i){var u={literal:function(O){return'"'+l(O.text)+'"'},class:function(O){var x=O.parts.map(function(D){return Array.isArray(D)?v(D[0])+"-"+v(D[1]):v(D)});return"["+(O.inverted?"^":"")+x.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(O){return O.description}};function t(O){return O.charCodeAt(0).toString(16).toUpperCase()}function l(O){return O.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+t(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+t(x)})}function v(O){return O.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+t(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+t(x)})}function g(O){return u[O.type](O)}function T(O){var x,D,F=O.map(g);if(F.sort(),F.length>0){for(x=1,D=1;x=")&&z(i,u[1],"<=")}static notbetween(i,u,t){return i==null||u[0]==null||u[1]==null?null:z(i,u[0],"<")||z(i,u[1],">")}static ternaryNot(i){return Ae(i)}static ternaryAnd(i,u){return Or(i,u)}static ternaryOr(i,u){return Sr(i,u)}}class it{constructor(i,u,t="UTC",l=null){this.fieldsIndex=u,this.timeZone=t,this.currentUser=l,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=yc.parse(i);const{isStandardized:v,isAggregate:g,currentUserRequired:T,referencedFieldNames:S}=this._extractExpressionInfo(u);this._referencedFieldNames=S,this.isStandardized=v,this.isAggregate=g,this.currentUserRequired=T}static convertValueToStorageFormat(i,u=null){if(u===null)return q(i)?i.getTime():b(i)?i.toMillis():P(i)?i.toStorageFormat():L(i)?i.toStorageString():A(i)?i.toStorageFormat():i;switch(u){case"date":return q(i)?i.getTime():b(i)?i.toMillis():P(i)?i.toMilliseconds():A(i)?i.toNumber():i;case"date-only":return q(i)?j.fromDateJS(i).toString():P(i)?j.fromSqlTimeStampOffset(i).toString():b(i)?j.fromDateTime(i).toString():i;case"time-only":return q(i)?$.fromDateJS(i).toStorageString():b(i)?$.fromDateTime(i).toStorageString():P(i)?$.fromSqlTimeStampOffset(i).toStorageString():L(i)?i.toStorageString():i;case"timestamp-offset":if(q(i))return Q.fromJSDate(i).toStorageFormat();if(b(i))return Q.fromDateTime(i).toStorageFormat();if(P(i))return i.toStorageFormat()}return i}static create(i,u={}){return new it(i,u.fieldsIndex,u.timeZone??void 0,u.currentUser)}get fieldNames(){return this._referencedFieldNames}testSet(i,u=le,t=this.currentUser){return!!this._evaluateNode(this.parseTree,null,u,i,t)}calculateValue(i,u=le,t=this.currentUser){const l=this._evaluateNode(this.parseTree,i,u,null,t);return l instanceof E?l.valueInMilliseconds()/864e5:l}calculateValueCompiled(i,u=le,t=this.currentUser){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null):ur("esri-csp-restrictions")?this.calculateValue(i,u):(this._compileMe(),this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null))}testFeature(i,u=le,t=this.currentUser){return!!this._evaluateNode(this.parseTree,i,u,null,t)}testFeatureCompiled(i,u=le,t=this.currentUser){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null):ur("esri-csp-restrictions")?this.testFeature(i,u):(this._compileMe(),!!this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null))}get hasDateFunctions(){return this._hasDateFunctions!=null||(this._hasDateFunctions=!1,U(this.parseTree,i=>{i.type==="current-time"?this._hasDateFunctions=!0:i.type==="function"&&(this._hasDateFunctions=this._hasDateFunctions||Tc.has(i.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const i=new Set;return U(this.parseTree,u=>{u.type==="function"&&i.add(u.name.toLowerCase())}),Array.from(i)}getExpressions(){const i=new Map;return U(this.parseTree,u=>{if(u.type==="function"){const t=u.name.toLowerCase(),l=u.args.value[0];if(l.type==="column-reference"){const v=l.column,g=`${t}-${v}`;i.has(g)||i.set(g,{aggregateType:t,field:v})}}}),[...i.values()]}getVariables(){const i=new Set;return U(this.parseTree,u=>{u.type==="parameter"&&i.add(u.value.toLowerCase())}),Array.from(i)}_compileMe(){const i="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone","currentUser",i).bind(be)}_extractExpressionInfo(i){const u=[],t=new Set;let l=!0,v=!1,g=!1;return U(this.parseTree,T=>{switch(T.type){case"column-reference":{const S=i?.get(T.column);let O,x;S?O=x=S.name??"":(x=T.column,O=x.toLowerCase()),t.has(O)||(t.add(O),u.push(x)),T.column=x;break}case"current-user":g=!0;break;case"function":{const{name:S,args:O}=T,x=O.value.length;l&&(l=yl(S,x)),v===!1&&(v=lr(S,x));break}}}),{referencedFieldNames:Array.from(u),isStandardized:l,isAggregate:v,currentUserRequired:g}}evaluateNodeToJavaScript(i){switch(i.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(i.value)+", "+JSON.stringify(i.qualifier)+","+JSON.stringify(i.op)+")";case"case-expression":{let u="";if(i.format==="simple"){const t=this.evaluateNodeToJavaScript(i.operand);u="( ";for(let l=0;l=",this.timeZone)&&z(T,S[1],"<=",this.timeZone)}case"NOTBETWEEN":{const T=this._evaluateNode(i.left,u,t,l,v),S=this._evaluateNode(i.right,u,t,l,v);return T==null||S[0]==null||S[1]==null?null:z(T,S[0],"<",this.timeZone)||z(T,S[1],">",this.timeZone)}case"LIKE":return Xe(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.escape);case"NOT LIKE":return Ae(Xe(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return z(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return Tr(i.operator,this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),this.timeZone)}case"null":case"boolean":case"string":case"number":return i.value;case"date":return i.parsedValue??=Ir(i.value,"unknown"),i.parsedValue;case"timestamp":return i.parsedValue??=De(i.value,"unknown"),i.parsedValue;case"time":return tt(i.value);case"current-time":return i.mode==="date"?be.currentDate(this.timeZone):i.mode==="time"?be.currentTime(this.timeZone):be.currentTimestamp(this.timeZone);case"current-user":return v??null;case"column-reference":return xr(u,i.column,this.fieldsIndex,t);case"data-type":return i.value;case"function":{if(this.isAggregate&&lr(i.name,i.args.value.length)){const S=[];for(const O of i.args?.value||[]){const x=[];for(const D of l||[])x.push(this._evaluateNode(O,D,t,null,v));S.push(x)}return Ko(i.name,S)}const T=this._evaluateNode(i.args,u,t,l,v);return rt(i.name,T,this.timeZone)}}throw new m(d.UnsupportedSyntax,{node:i.type})}}function Nr(a){return a===!0}function We(a){return Array.isArray(a)?a:[a]}function Ae(a){return a!==null?a!==!0:null}function Or(a,i){return a!=null&&i!=null?a===!0&&i===!0:a!==!1&&i!==!1&&null}function Sr(a,i){return a!=null&&i!=null?a===!0||i===!0:a===!0||i===!0||null}function Ke(a,i,u){if(a==null)return null;let t=!1;for(const l of i)if(l==null)t=null;else{if(a===l){t=!0;break}if(Ge(a)&&Ge(l)&&(t=z(a,l,"="),t))break}return t}const dr="-[]/{}()*+?.\\^$|";var ae;function Nc(a,i){const u=i;let t="",l=ae.Normal;for(let v=0;v(Oc(a)?a.attributes:a)[i]},Mc=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:it,defaultAttributeAdapter:le},Symbol.toStringTag,{value:"Module"}));export{Mc as W,it as Z,d as a,m as n,Q as r,Ko as u}; diff --git a/main/assets/WhereClause-DxwoyBMS-DCzFGfA-.js b/main/assets/WhereClause-DxwoyBMS-DCzFGfA-.js new file mode 100644 index 000000000..57672045e --- /dev/null +++ b/main/assets/WhereClause-DxwoyBMS-DCzFGfA-.js @@ -0,0 +1,7 @@ +import{O as j,m as $,r as qo}from"./TimeOnly-DSMefxKy-C21ZkqlE.js";import{cF as jo,F as J,K as ur,b_ as Yo,cI as Bo,cJ as Qo,q as Go}from"./main-C7yV2j71.js";import{t as He,r as qe,a as pe}from"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";var d;(function(a){a.InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Wo={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let m=class pr extends Error{constructor(i,u){super(jo(Wo[i],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,pr)}};function or(a){return Number.isNaN(a)||a===0?a:Math.trunc(a)}let Q=class oe{constructor(i){this._timeStampOffset=i,this._date=null}toDateTime(){return this._date??=J.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return or(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return or(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return oe.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(i){return new oe(J.fromJSDate(i).toISO({includeOffset:!0}))}static fromDateTime(i){return new oe(i.toISO({includeOffset:!0}))}static fromParts(i,u,t=0,l=0,v=0,g=0,T=0,S=!1,O=0,x=0){const D=`${i.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`;let F="";g<10&&(F="0");let X=`${l.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}:${F+g.toString()}`;T!==0&&(X+="."+T.toString().padStart(3,"0"));const ee=`${S?"-":"+"}${O.toString().padStart(2,"0")}:${x.toString().padStart(2,"0")}`;return new oe(D+"T"+X+ee)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let i=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return i&&(i=i.replace(".000","")),i}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(i){const u=this.toDateTime().plus(i);return oe.fromDateTime(u)}};function Ko(a,i){const u=mr[a.toLowerCase()];if(u==null)throw new m(d.FunctionNotRecognized);if(i.lengthu.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return u.evaluate(i)}function lr(a,i){const u=mr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}const mr={min:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"min")},max:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"max")},avg:{minParams:1,maxParams:1,evaluate:a=>vr(a[0])},sum:{minParams:1,maxParams:1,evaluate:a=>Xo(a[0])},stddev:{minParams:1,maxParams:1,evaluate:a=>el(a[0])},count:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].length},var:{minParams:1,maxParams:1,evaluate:a=>hr(a[0])}};function vr(a){if(a===null)return null;let i=0,u=0;for(let t=0;t=v)&&(u=l,t=v)}return u}function Xo(a){if(a===null)return null;let i=0;for(let u=0;ut!==null)).length===0)return null;const i=vr(a);if(i===null)return null;let u=0;for(const t of a){if(!et(t))throw new m(d.InvalidValueForAggregateFunction);u+=(i-t)**2}return u/(a.length-1)}class E{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(i){if(i.precision!==null||i.secondary!==null)throw new m(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(i,u){if(u.includes(".")){const t=u.split(".");i.second=parseFloat(t[0]),i.millis=parseInt(t[1],10)}else i.second=parseFloat(u)}static createFromMilliseconds(i){const u=new E;return u.second=i/1e3,u}static createFromValueAndQualifier(i,u,t){let l=null;const v=new E;if(v.op=t==="-"?"-":"+",u.type==="interval-period"){E._fixDefaults(u);const g=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new m(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(i))throw new m(d.IllegalInterval);E._parseSecondsComponent(v,i)}else{if(!g.test(i))throw new m(d.IllegalInterval);v[u.period]=parseFloat(i)}}else{if(E._fixDefaults(u.start),E._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new m(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v[u.start.period]=parseFloat(i.split(" ")[0]),v[u.end.period]=parseFloat(i.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v.hour=parseFloat(i.split(":")[0]),v.minute=parseFloat(i.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new m(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.minute=parseFloat(g[0]),E._parseSecondsComponent(v,g[1])}break;default:throw new m(d.IllegalInterval)}}return v}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const tl=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,rl=/^(\d{1,2}):(\d{1,2})$/,nl=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,wr=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,il=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,al=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,sl=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,ul=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function Pe(a,i){if(i instanceof Bo)return i===He.instance?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i});switch(i){case"system":case"local":case null:return J.fromJSDate(a);default:return i?.toLowerCase()==="unknown"?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i})}}function V(a){return typeof a=="number"}function Z(a){return typeof a=="string"||a instanceof String}function K(a){return a instanceof E}function q(a){return a instanceof Date}function b(a){return a instanceof J}function A(a){return a instanceof j}function L(a){return a instanceof $}function P(a){return a instanceof Q}function tt(a){let i=tl.exec(a);if(i!==null){const[,u,t,l]=i,v=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),0);if(v!==null)return v;throw new m(d.InvalidTime)}if(i=rl.exec(a),i!==null){const[,u,t]=i,l=$.fromParts(parseInt(u,10),parseInt(t,10),0,0);if(l!==null)return l;throw new m(d.InvalidTime)}if(i=nl.exec(a),i!==null){const[,u,t,l,v]=i,g=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g!==null)return g;throw new m(d.InvalidTime)}throw new m(d.InvalidTime)}function De(a,i,u=!1){let t=il.exec(a);if(t!==null){const[,l,v,g,T,S,O,x]=t,D=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:parseInt(O,10),millisecond:x?parseInt(x.replace(".",""),10):0},{zone:qe(i)});if(D.isValid===!1)throw new m(d.InvalidTimeStamp);return D}if(t=al.exec(a),t!==null){const[,l,v,g,T,S,O,x,D,F,X]=t,ee=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),parseInt(O,10),x?parseInt(x.replace(".",""),10):0,D==="-",parseInt(F,10),parseInt(X,10));if(ee.isValid===!1)throw new m(d.InvalidTimeStamp);return ee}if(t=sl.exec(a),t!==null){const[,l,v,g,T,S,O,x,D]=t,F=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),0,0,O==="-",parseInt(x,10),parseInt(D,10));if(F.isValid===!1)throw new m(d.InvalidTimeStamp);return F}if(t=ul.exec(a),t!==null){const[,l,v,g,T,S]=t,O=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:0},{zone:qe(i)});if(O.isValid===!1)throw new m(d.InvalidTimeStamp);return O}if(t=wr.exec(a),t!==null){const[,l,v,g]=t,T=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:0,minute:0,second:0},{zone:qe(i)});if(T.isValid===!1)throw new m(d.InvalidTimeStamp);return T}throw new m(d.InvalidTimeStamp)}function Ir(a,i){const u=wr.exec(a);if(u===null)try{return De(a,i)}catch{throw new m(d.InvalidDate)}const[,t,l,v]=u,g=j.fromParts(parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g===null)throw new m(d.InvalidDate);return g}const ol=321408e5,ll=26784e5,cl=864e5,fl=36e5,dl=6e4;function je(a){return!!b(a)||!!P(a)}function Ge(a){return!!b(a)||!!A(a)||!!P(a)||!!L(a)}function Fe(a){if(b(a))return a.toMillis();if(A(a))return a.toNumber();if(P(a))return a.toMilliseconds();throw new m(d.InvalidDataType)}function z(a,i,u,t){if(a==null||i==null)return null;if(V(a)){if(V(i))return B(a,i,u);if(Z(i))return pl(a,i,u);if(Ge(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator)}else if(Z(a)){if(V(i))return ml(a,i,u);if(Z(i))return vl(a,i,u);if(b(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(L(i))throw new m(d.InvalidOperator);if(P(i))throw new m(d.InvalidOperator)}else if(b(a)){if(je(i)){if(a instanceof J&&pe(a.zone)){if(i instanceof J&&pe(i.zone)===!1||i instanceof Q)return Ye(a,i,u)}else if(i instanceof J&&pe(i.zone)&&(a instanceof J&&pe(a.zone)===!1||a instanceof Q))return Ye(a,i,u);return B(Fe(a),Fe(i),u)}if(Z(i))throw new m(d.InvalidOperator);if(A(i))return hl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(A(a)){if(P(i))return gl(a,i,u);if(b(i))return Il(a,i,u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return B(a.toNumber(),i.toNumber(),u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(L(a)){if(L(i))return B(a.toNumber(),i.toNumber(),u);if(Z(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(je(i))throw new m(d.InvalidOperator)}else if(P(a)){if(je(i))return i instanceof J&&pe(i.zone)?Ye(a,i,u):B(Fe(a),Fe(i),u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return wl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function B(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function pl(a,i,u){const t=parseFloat(i);if(!isNaN(t))return B(a,t,u);const l=a.toString();switch(u){case"<>":return l!==i;case"=":return l===i;case">":return l>i;case"<":return l=":return l>=i;case"<=":return l<=i}}function ml(a,i,u){const t=parseFloat(a);if(!isNaN(t))return B(t,i,u);const l=i.toString();switch(u){case"<>":return a!==l;case"=":return a===l;case">":return a>l;case"<":return a=":return a>=l;case"<=":return a<=l}}function vl(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function hl(a,i,u){const t=i.toDateTimeLuxon(a.zone);return B((a=a.startOf("day")).toMillis(),t.toMillis(),u)}function wl(a,i,u){const t=i.toDateTimeLuxon(a.toDateTime().zone);return B((a=a.startOfDay()).toMilliseconds(),t.toMillis(),u)}function Il(a,i,u){const t=a.toDateTimeLuxon(i.zone);return i=i.startOf("day"),B(t.toMillis(),i.toMillis(),u)}function gl(a,i,u){const t=a.toDateTimeLuxon(i.toDateTime().zone);return i=i.startOfDay(),B(t.toMillis(),i.toMilliseconds(),u)}function Ye(a,i,u){a instanceof Q&&(a=a.toDateTime()),i instanceof Q&&(i=i.toDateTime());const t=fr(a),l=fr(i);switch(u){case"<>":return t!==l;case"=":return t===l;case">":return t>l;case"<":return t=":return t>=l;case"<=":return t<=l}}function fr(a){return a.year*ol+a.month*ll+a.day*cl+a.hour*fl+a.minute*dl+1e3*a.second+a.millisecond}function rt(a,i,u){const t=yr[a.toLowerCase()];if(t==null)throw new m(d.FunctionNotRecognized);if(i.lengtht.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return t.evaluate(i,u)}function yl(a,i){const u=yr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}function Le(a){return typeof a=="string"||a instanceof String}function Be(a){return!q(a)&&!A(a)&&!b(a)&&!L(a)&&!P(a)}function gr(a){return A(a)||L(a)?a.toString():P(a)?a.toSQLValue():b(a)?a.millisecond===0?a.toFormat("yyyy-LL-dd HH:mm:ss"):a.toSQL({includeOffset:!1}):q(a)?gr(J.fromJSDate(a)):a.toString()}function Tl(a){if(q(a))return j.fromDateJS(a);if(b(a))return j.fromParts(a.year,a.month,a.day);if(A(a))return a;if(L(a))throw new m(d.CannotCastValue);if(P(a)&&j.fromParts(a.year,a.month,a.day)===null)throw new m(d.CannotCastValue);if(Le(a)){const i=j.fromReader(a);if(i!==null&&i.isValid)return i}throw new m(d.CannotCastValue)}function Nl(a,i,u){if(q(a))return Pe(a,i);if(b(a))return a;if(A(a))return a.toDateTimeLuxon("unknown");if(L(a))throw new m(d.CannotCastValue);if(P(a))return a;if(Le(a))return De(a,"unknown",u);throw new m(d.CannotCastValue)}function Ol(a){if(q(a))return $.fromDateJS(a);if(b(a))return $.fromDateTime(a);if(A(a))throw new m(d.CannotCastValue);if(L(a))return a;if(P(a))return $.fromSqlTimeStampOffset(a);if(Le(a))return tt(a);throw new m(d.CannotCastValue)}const yr={extract:{minParams:2,maxParams:2,evaluate:([a,i])=>{if(i==null)return null;if(q(i))switch(a.toUpperCase()){case"SECOND":return i.getSeconds();case"MINUTE":return i.getMinutes();case"HOUR":return i.getHours();case"DAY":return i.getDate();case"MONTH":return i.getMonth()+1;case"YEAR":return i.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(b(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(A(i))switch(a.toUpperCase()){case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(L(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour}else if(P(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":return i.timezoneOffsetHour;case"TIMEZONE_MINUTE":return i.timezoneOffsetMinutes}throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:a=>{if(a.length===2){const[i,u]=a;return i==null||u==null?null:i.toString().substring(u-1)}if(a.length===3){const[i,u,t]=a;return i==null||u==null||t==null?null:t<=0?"":i.toString().substring(u-1,u+t-1)}}},position:{minParams:2,maxParams:2,evaluate:([a,i])=>a==null||i==null?null:i.indexOf(a)+1},trim:{minParams:2,maxParams:3,evaluate:a=>{const i=a.length===3,u=i?a[1]:" ",t=i?a[2]:a[1];if(u==null||t==null)return null;const l=`(${Qo(u)})`;switch(a[0]){case"BOTH":return t.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return t.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return t.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new m(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.abs(a[0])},ceiling:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.ceil(a[0])},floor:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.floor(a[0])},log:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])},log10:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sin(a[0])},cos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cos(a[0])},tan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tan(a[0])},asin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.asin(a[0])},acos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.acos(a[0])},atan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.atan(a[0])},sign:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0]>0?1:a[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]**a[1]},mod:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]%a[1]},round:{minParams:1,maxParams:2,evaluate:a=>{const i=a[0],u=a.length===2?10**a[1]:1;return i==null?null:Math.round(i*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:a=>a[0]==null?null:a.length===1||a[1]===0?Math.trunc(a[0]):Go("trunc",a[0],-Number(a[1]))},char_length:{minParams:1,maxParams:1,evaluate:a=>Le(a[0])?a[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:a=>{let i="";for(let u=0;ua[0]==null?null:a[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:a=>{for(const i of a)if(i!==null)return i;return null}},cosh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cosh(a[0])},sinh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sinh(a[0])},tanh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tanh(a[0])},nullif:{minParams:2,maxParams:2,evaluate:(a,i)=>z(a[0],a[1],"=")?null:a[0]},cast:{minParams:2,maxParams:2,evaluate:(a,i)=>{const u=a[0],t=a[1];if(u===null)return null;switch(t.type){case"integer":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"smallint":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);if(l>32767||l<-32767)throw new m(d.CannotCastValue);return l}case"float":case"real":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"time":return Ol(u);case"date":return Tl(u);case"timestamp":return Nl(u,i,t.withtimezone===!0);case"varchar":{const l=gr(u);if(l.length>t.size)throw new m(d.CannotCastValue);return l}default:throw new m(d.InvalidDataType)}}}};function Tr(a,i,u,t){if(a==="||")return rt("concat",[i,u],t);if(i===null||u===null)return null;if(V(i)){if(V(u))return nt(i,u,a);if(K(u))return Al(i,u,a);if(L(u))return kl();if(A(u))return zl();if(P(u))return Zl();if(b(u))return Jl();if(Z(u))return $l(i,u,a);throw new m(d.InvalidOperator)}if(A(i)){if(V(u))return Rl(i,u,a);if(K(u))return Pl(i,u,a);if(L(u))return Wl();if(A(u))return Gl(i,u,a);if(P(u))return Ql(i,u,a);if(b(u))return Bl(i,u,a);if(Z(u))return cc();throw new m(d.InvalidOperator)}if(L(i)){if(V(u))return Ul(i,u,a);if(K(u))return Ml(i,u,a);if(L(u))return ac();if(A(u))return nc();if(P(u))return ic();if(b(u))return rc();if(Z(u))return fc();throw new m(d.InvalidOperator)}if(K(i)){if(V(u))return bl(i,u,a);if(K(u))return Fl(i,u,a);if(L(u))return xl(i,u,a);if(A(u))return Cl(i,u,a);if(P(u))return El(i,u,a);if(b(u))return Sl(i,u,a);if(Z(u))return jl();throw new m(d.InvalidOperator)}if(b(i)){if(V(u))return _l(i,u,a);if(K(u))return Dl(i,u,a);if(L(u))return lc();if(A(u))return uc(i,u,a);if(P(u))return oc(i,u,a);if(b(u))return sc(i,u,a);if(Z(u))return dc();throw new m(d.InvalidOperator)}if(P(i)){if(V(u))return Vl(i,u,a);if(K(u))return Ll(i,u,a);if(L(u))return Kl();if(A(u))return Xl(i,u,a);if(P(u))return tc(i,u,a);if(b(u))return ec(i,u,a);if(Z(u))return pc();throw new m(d.InvalidOperator)}if(Z(i)){if(V(u))return Hl(i,u,a);if(K(u))return Yl();if(L(u))return mc();if(A(u))return vc();if(P(u))return wc();if(b(u))return hc();if(Z(u))return ql(i,u,a);throw new m(d.InvalidOperator)}throw new m(d.InvalidOperator)}function nt(a,i,u){switch(u){case"+":return a+i;case"-":return a-i;case"*":return a*i;case"/":return a/i}throw new m(d.InvalidOperator)}function Sl(a,i,u){switch(u){case"+":return i.plus({milliseconds:a.valueInMilliseconds()});case"-":return a.valueInMilliseconds()-i.toMillis()}throw new m(d.InvalidOperator)}function xl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Cl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Ml(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function El(a,i,u){if(u==="+")return i.addMilliseconds(a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Fl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function bl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i);case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i);case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i);case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i)}throw new m(d.InvalidOperator)}function Al(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Pl(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Dl(a,i,u){switch(u){case"+":return a.plus({milliseconds:i.valueInMilliseconds()});case"-":return a.minus({milliseconds:i.valueInMilliseconds()})}throw new m(d.InvalidOperator)}function Ll(a,i,u){switch(u){case"+":return a.addMilliseconds(i.valueInMilliseconds());case"-":return a.addMilliseconds(-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function _l(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus({milliseconds:t});case"-":return a.minus({milliseconds:t})}throw new m(d.InvalidOperator)}function Rl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Ul(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Jl(a,i,u){throw new m(d.InvalidOperator)}function Vl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.addMilliseconds(t);case"-":return a.addMilliseconds(-1*t)}throw new m(d.InvalidOperator)}function Zl(a,i,u){throw new m(d.InvalidOperator)}function kl(a,i,u){throw new m(d.InvalidOperator)}function zl(a,i,u){throw new m(d.InvalidOperator)}function $l(a,i,u){const t=parseFloat(i);if(isNaN(t))throw new m(d.InvalidOperator);return nt(a,t,u)}function Hl(a,i,u){const t=parseFloat(a);if(isNaN(t))throw new m(d.InvalidOperator);return nt(t,i,u)}function ql(a,i,u){if(u==="+")return a+i;throw new m(d.InvalidOperator)}function jl(a,i,u){throw new m(d.InvalidOperator)}function Yl(a,i,u){throw new m(d.InvalidOperator)}function Bl(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.zone).diff(i).as("days");throw new m(d.InvalidOperator)}function Ql(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.toDateTime().zone).diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function Gl(a,i,u){if(u==="-")return a.toDateTimeLuxon("UTC").diff(i.toDateTimeLuxon("UTC")).as("days");throw new m(d.InvalidOperator)}function Wl(a,i,u){throw new m(d.InvalidOperator)}function Kl(a,i,u){throw new m(d.InvalidOperator)}function Xl(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTimeLuxon(a.toDateTime().zone)).as("days");throw new m(d.InvalidOperator)}function ec(a,i,u){if(u==="-")return a.toDateTime().diff(i).as("days");throw new m(d.InvalidOperator)}function tc(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function rc(a,i,u){throw new m(d.InvalidOperator)}function nc(a,i,u){throw new m(d.InvalidOperator)}function ic(a,i,u){throw new m(d.InvalidOperator)}function ac(a,i,u){throw new m(d.InvalidOperator)}function sc(a,i,u){if(u==="-")return a.diff(i).as("days");throw new m(d.InvalidOperator)}function uc(a,i,u){if(u==="-")return a.diff(i.toDateTimeLuxon(a.zone)).as("days");throw new m(d.InvalidOperator)}function oc(a,i,u){if(u==="-")return a.diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function lc(a,i,u){throw new m(d.InvalidOperator)}function cc(a,i,u){throw new m(d.InvalidOperator)}function fc(a,i,u){throw new m(d.InvalidOperator)}function dc(a,i,u){throw new m(d.InvalidOperator)}function pc(a,i,u){throw new m(d.InvalidOperator)}function mc(a,i,u){throw new m(d.InvalidOperator)}function vc(a,i,u){throw new m(d.InvalidOperator)}function hc(a,i,u){throw new m(d.InvalidOperator)}function wc(a,i,u){throw new m(d.InvalidOperator)}function Ic(a,i){function u(){this.constructor=a}u.prototype=i.prototype,a.prototype=new u}function se(a,i,u,t){var l=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(l,se.prototype),l.expected=i,l.found=u,l.location=t,l.name="SyntaxError",l}function Qe(a,i,u){return u=u||" ",a.length>i?a:(i-=a.length,a+(u+=u.repeat(i)).slice(0,i))}function gc(a,i){var u,t={},l=(i=i!==void 0?i:{}).grammarSource,v={start:St},g=St,T="!",S="=",O=">=",x=">",D="<=",F="<>",X="!=",ee="||",Cr="@",at="'",st="N'",me="''",Mr=".",Er="null",Fr="true",br="false",Ar="in",Pr="is",Dr="like",Lr="escape",_r="not",Rr="and",Ur="or",Jr="between",Vr="from",Zr="for",kr="substring",zr="extract",$r="trim",Hr="position",qr="timestamp",jr="date",Yr="time",Br="leading",Qr="trailing",Gr="both",Wr="cast",Kr="as",Xr="integer",en="int",tn="smallint",rn="float",nn="real",an="varchar",sn="to",un="interval",on="year",ln="timezone_hour",cn="timezone_minute",fn="month",dn="day",pn="hour",mn="minute",vn="second",hn="case",wn="end",In="when",gn="then",yn="else",Tn=",",Nn="(",On=")",ut="`",Sn=/^[<-=]/,ve=/^[+\-]/,xn=/^[*\/]/,Cn=/^[A-Za-z_\x80-\uFFFF]/,Mn=/^[A-Za-z0-9_]/,ot=/^[A-Za-z0-9_.\x80-\uFFFF]/,En=/^["]/,lt=/^[^']/,Fn=/^[0-9]/,bn=/^[eE]/,An=/^[ \t\n\r]/,ct=/^[^`]/,Pn=y("!",!1),Dn=y("=",!1),Ln=y(">=",!1),_n=y(">",!1),Rn=y("<=",!1),Un=y("<>",!1),Jn=H([["<","="]],!1,!1),Vn=y("!=",!1),he=H(["+","-"],!1,!1),Zn=y("||",!1),kn=H(["*","/"],!1,!1),zn=H([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),$n=H([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ft=H([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Hn=H(['"'],!1,!1),qn=y("@",!1),dt=y("'",!1),jn=y("N'",!1),pt=y("''",!1),mt=H(["'"],!0,!1),Yn=y(".",!1),Bn=H([["0","9"]],!1,!1),Qn=H(["e","E"],!1,!1),Gn=y("NULL",!0),Wn=y("TRUE",!0),Kn=y("FALSE",!0),Xn=y("IN",!0),ei=y("IS",!0),ti=y("LIKE",!0),ri=y("ESCAPE",!0),ni=y("NOT",!0),ii=y("AND",!0),ai=y("OR",!0),si=y("BETWEEN",!0),ui=y("FROM",!0),oi=y("FOR",!0),li=y("SUBSTRING",!0),ci=y("EXTRACT",!0),fi=y("TRIM",!0),di=y("POSITION",!0),pi=y("TIMESTAMP",!0),mi=y("DATE",!0),vi=y("TIME",!0),hi=y("LEADING",!0),wi=y("TRAILING",!0),Ii=y("BOTH",!0),gi=y("CAST",!0),yi=y("AS",!0),Ti=y("INTEGER",!0),Ni=y("INT",!0),Oi=y("SMALLINT",!0),Si=y("FLOAT",!0),xi=y("REAL",!0),Ci=y("VARCHAR",!0),Mi=y("TO",!0),Ei=y("INTERVAL",!0),Fi=y("YEAR",!0),bi=y("TIMEZONE_HOUR",!0),Ai=y("TIMEZONE_MINUTE",!0),Pi=y("MONTH",!0),Di=y("DAY",!0),Li=y("HOUR",!0),_i=y("MINUTE",!0),Ri=y("SECOND",!0),Ui=y("CASE",!0),Ji=y("END",!0),Vi=y("WHEN",!0),Zi=y("THEN",!0),ki=y("ELSE",!0),zi=y(",",!1),$i=y("(",!1),Hi=y(")",!1),qi=H([" "," ",` +`,"\r"],!1,!1),vt=y("`",!1),ht=H(["`"],!0,!1),ji=function(e){return e},Yi=function(e){return k(I(),...e)},wt=function(e,r,s){return{op:r,expr:s,location:I()}},Bi=function(e,r){return de(e,r)},It=function(e,r,s){return{op:r,expr:s,location:I()}},Qi=function(e,r){return de(e,r)},Gi=function(e){return ko("NOT",e,I())},Wi=function(e,r){return r==""||r==null||r==null?e:r.type=="arithmetic"?de(e,r.tail):ar(r.op,e,r.right,r.escape,I())},gt=function(e,r){return{op:e,expr:r,location:I()}},Ki=function(e){return{type:"arithmetic",tail:e}},Xi=function(e,r){return{op:e+"NOT",right:r}},ea=function(e,r){return{op:e,right:r}},ta=function(e,r,s){return k(I(),r,s)},ra=function(e,r){return{op:"NOT"+e,right:r}},na=function(e,r,s){return k(I(),r,s)},ia=function(e,r){return{op:e,right:r}},aa=function(e){return e[0]+" "+e[2]},sa=function(e){return e[0]+" "+e[2]},ua=function(e,r,s){return{op:e,right:r,escape:s.value}},oa=function(e,r){return{op:e,right:r,escape:""}},la=function(e,r){return{op:e,right:r}},ca=function(e,r){return{op:e,right:r}},yt=function(e,r,s){return{op:r,expr:s,location:I()}},fa=function(e,r){return de(e,r)},Tt=function(e,r,s){return{op:r,expr:s,location:I()}},da=function(e,r){return de(e,r)},pa=function(e){return e.paren=!0,e},ma=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:I(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:I(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:I(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:I()}:{type:"column-reference",location:I(),table:"",column:e}},va=function(e){return{type:"column-reference",location:I(),table:"",column:e,delimited:!0}},ha=function(e){return e},wa=function(e,r){return e+r.join("")},Ia=function(e,r){return e+r.join("")},ga=function(e){return e},ya=function(e){return e.join("")},Ta=function(){return'"'},Na=function(e){return{type:"parameter",location:I(),value:e[1]}},Oa=function(e,r){return k(I(),e,r)},Sa=function(e,r){return k(I(),e,r)},xa=function(e){return{type:"function",location:I(),name:"extract",args:e}},Ca=function(e,r,s){return k(I(),e,r,...s?[s]:[])},Ma=function(e,r,s){return k(I(),e,r,s)},Ea=function(e){return{type:"function",location:I(),name:"substring",args:e}},Fa=function(e,r){return k(I(),e,r)},ba=function(e,r){return k(I(),e,r)},Aa=function(e){return{type:"function",location:I(),name:"cast",args:e}},Pa=function(){return{type:"data-type",location:I(),value:{type:"integer"}}},Da=function(){return{type:"data-type",location:I(),value:{type:"smallint"}}},La=function(){return{type:"data-type",location:I(),value:{type:"float"}}},_a=function(){return{type:"data-type",location:I(),value:{type:"real"}}},Ra=function(){return{type:"data-type",location:I(),value:{type:"date"}}},Ua=function(){return{type:"data-type",location:I(),value:{type:"timestamp"}}},Ja=function(){return{type:"data-type",location:I(),value:{type:"time"}}},Va=function(e){return{type:"data-type",location:I(),value:{type:"varchar",size:parseInt(e)}}},Za=function(e,r,s){return k(I(),e,r,s)},ka=function(e,r){return k(I(),e,r)},za=function(e){return{type:"function",location:I(),name:"trim",args:e}},$a=function(e){return{type:"string",location:I(),value:e??"BOTH"}},Ha=function(e,r){return k(I(),e,r)},qa=function(e,r){return k(I(),e,r)},ja=function(e){return{type:"function",location:I(),name:"position",args:e}},Ya=function(e,r){return{type:"function",location:I(),name:e,args:r}},Ba=function(e){return{type:"string",location:I(),value:e}},Qa=function(e){return e.type==="string"&&zo(e.value),{type:"timestamp",location:I(),value:e.value}},Ga=function(e){return e.type==="string"&&$o(e.value),{type:"time",location:I(),value:e.value}},Wa=function(e,r,s){return{type:"interval",location:I(),value:r,qualifier:s,op:e}},Ka=function(e,r){return{type:"interval",location:I(),value:e,qualifier:r,op:""}},Xa=function(e,r){return{type:"interval-qualifier",location:I(),start:e,end:r}},es=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},ts=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},rs=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},ns=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},is=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},as=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},ss=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},us=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},os=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},ls=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},cs=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},fs=function(){return{type:"string",location:I(),value:"day"}},ds=function(){return{type:"string",location:I(),value:"hour"}},ps=function(){return{type:"string",location:I(),value:"minute"}},ms=function(){return{type:"string",location:I(),value:"month"}},vs=function(){return{type:"string",location:I(),value:"year"}},hs=function(e){return parseFloat(e)},ws=function(e){return parseFloat(e)},Is=function(e){return e.type==="string"&&Ho(e.value),{type:"date",location:I(),value:e.value}},gs=function(){return{type:"null",location:I(),value:null}},ys=function(){return{type:"boolean",location:I(),value:!0}},Ts=function(){return{type:"boolean",location:I(),value:!1}},Nt=function(){return"'"},Ns=function(e){return{type:"string",location:I(),value:e.join("")}},Os=function(e,r){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:null,elseLocation:null}},Ss=function(e,r,s){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:s.value,elseLocation:s.location}},xs=function(e){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:null,elseLocation:null}},Cs=function(e,r){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:r.value,elseLocation:r.location}},Ms=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Es=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Fs=function(e){return{type:"else-clause",location:I(),value:e}},bs=function(e){return{type:"number",location:I(),value:e}},As=function(e,r,s){return parseFloat(e+r+s)},Ps=function(e,r){return parseFloat(e+r)},Ds=function(e,r){return parseFloat(e+r)},Ls=function(e){return parseFloat(e)},_s=function(e,r){return e[0]+r},Rs=function(e){return"."+(e??"")},Us=function(e,r){return e+r},Js=function(e){return e.join("")},Vs=function(e,r){return"e"+(r===null?"":r)},Zs=function(){return"IN"},ks=function(){return"IS"},zs=function(){return"LIKE"},$s=function(){return"ESCAPE"},Hs=function(){return"NOT"},qs=function(){return"AND"},js=function(){return"OR"},Ys=function(){return"BETWEEN"},Bs=function(){return"FROM"},Qs=function(){return"FOR"},Gs=function(){return"SUBSTRING"},Ws=function(){return"EXTRACT"},Ks=function(){return"TRIM"},Xs=function(){return"POSITION"},eu=function(){return"TIMESTAMP"},tu=function(){return"DATE"},ru=function(){return"TIME"},nu=function(){return"LEADING"},iu=function(){return"TRAILING"},au=function(){return"BOTH"},su=function(){return"CAST"},uu=function(){return"AS"},ou=function(){return"INTEGER"},lu=function(){return"INT"},cu=function(){return"SMALLINT"},fu=function(){return"FLOAT"},du=function(){return"REAL"},pu=function(){return"VARCHAR"},mu=function(){return"TO"},vu=function(){return"INTERVAL"},hu=function(){return"YEAR"},wu=function(){return"TIMEZONE_HOUR"},Iu=function(){return"TIMEZONE_MINUTE"},gu=function(){return"MONTH"},yu=function(){return"DAY"},Tu=function(){return"HOUR"},Nu=function(){return"MINUTE"},Ou=function(){return"SECOND"},Su=function(){return"CASE"},xu=function(){return"END"},Cu=function(){return"WHEN"},Mu=function(){return"THEN"},Eu=function(){return"ELSE"},Fu=function(e){return e},bu=function(e){return e.join("")},n=0|i.peg$currPos,f=n,ue=[{line:1,column:1}],Y=n,we=i.peg$maxFailExpected||[],c=0|i.peg$silentFails;if(i.startRule){if(!(i.startRule in v))throw new Error(`Can't start parsing from rule "`+i.startRule+'".');g=v[i.startRule]}function I(){return Ie(f,n)}function _e(e,r){throw Pu(e,r=r!==void 0?r:Ie(f,n))}function y(e,r){return{type:"literal",text:e,ignoreCase:r}}function H(e,r,s){return{type:"class",parts:e,inverted:r,ignoreCase:s}}function Au(){return{type:"end"}}function Ot(e){var r,s=ue[e];if(s)return s;if(e>=ue.length)r=ue.length-1;else for(r=e;!ue[--r];);for(s={line:(s=ue[r]).line,column:s.column};rY&&(Y=n,we=[]),we.push(e))}function Pu(e,r){return new se(e,null,null,r)}function Du(e,r,s){return new se(se.buildMessage(e,r),e,r,s)}function St(){var e,r;return e=n,p(),(r=M())!==t?(p(),f=e,e=ji(r)):(n=e,e=t),e}function xt(){var e,r,s,o,h,C;if(e=n,_()!==t){for(p(),r=[],s=M();s!==t;)r.push(s),s=n,o=n,h=p(),(C=W())!==t?o=h=[h,C,p()]:(n=o,o=t),o!==t&&(o=M())===t?(n=s,s=t):s=o;s=p(),(o=R())!==t?(f=e,e=Yi(r)):(n=e,e=t)}else n=e,e=t;return e}function M(){var e,r,s,o,h,C;if(e=n,(r=Re())!==t){for(s=[],o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Bi(r,s)}else n=e,e=t;return e}function Re(){var e,r,s,o,h,C;if(e=n,(r=ge())!==t){for(s=[],o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Qi(r,s)}else n=e,e=t;return e}function ge(){var e,r,s,o,h;return e=n,(r=fe())===t&&(r=n,a.charCodeAt(n)===33?(s=T,n++):(s=t,c===0&&w(Pn)),s!==t?(o=n,c++,a.charCodeAt(n)===61?(h=S,n++):(h=t,c===0&&w(Dn)),c--,h===t?o=void 0:(n=o,o=t),o!==t?r=s=[s,o]:(n=r,r=t)):(n=r,r=t)),r!==t?(s=p(),(o=ge())!==t?(f=e,e=Gi(o)):(n=e,e=t)):(n=e,e=t),e===t&&(e=Lu()),e}function Lu(){var e,r,s,o;return e=n,(r=G())!==t?(s=n,p(),(o=_u())!==t?s=o:(n=s,s=t),s===t&&(s=null),f=e,e=Wi(r,s)):(n=e,e=t),e}function _u(){var e;return(e=Ru())===t&&(e=Zu())===t&&(e=Ju())===t&&(e=Uu())===t&&(e=Vu()),e}function Ru(){var e,r,s,o,h;if(e=n,r=[],s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t),s!==t)for(;s!==t;)r.push(s),s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t);else r=t;return r!==t&&(f=e,r=Ki(r)),e=r}function Ct(){var e;return a.substr(n,2)===O?(e=O,n+=2):(e=t,c===0&&w(Ln)),e===t&&(a.charCodeAt(n)===62?(e=x,n++):(e=t,c===0&&w(_n)),e===t&&(a.substr(n,2)===D?(e=D,n+=2):(e=t,c===0&&w(Rn)),e===t&&(a.substr(n,2)===F?(e=F,n+=2):(e=t,c===0&&w(Un)),e===t&&(e=a.charAt(n),Sn.test(e)?n++:(e=t,c===0&&w(Jn)),e===t&&(a.substr(n,2)===X?(e=X,n+=2):(e=t,c===0&&w(Vn))))))),e}function Uu(){var e,r,s,o;return e=n,(r=zt())!==t?(p(),(s=fe())!==t?(p(),(o=G())!==t?(f=e,e=Xi(r,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=zt())!==t?(p(),(s=G())!==t?(f=e,e=ea(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Ju(){var e,r,s,o,h,C,ie,sr;return e=n,(r=fe())!==t?(p(),(s=qt())!==t?(o=p(),h=n,(C=G())!==t?(p(),(ie=Ce())!==t?(p(),(sr=G())!==t?(f=h,h=ta(s,C,sr)):(n=h,h=t)):(n=h,h=t)):(n=h,h=t),h!==t?(f=e,e=ra(s,h)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=qt())!==t?(p(),s=n,(o=G())!==t?(h=p(),(C=Ce())!==t?(p(),(ie=G())!==t?(f=s,s=na(r,o,ie)):(n=s,s=t)):(n=s,s=t)):(n=s,s=t),s!==t?(f=e,e=ia(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Mt(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=$t())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=aa(r)),(e=r)===t&&(e=$t()),e}function Et(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=ze())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=sa(r)),(e=r)===t&&(e=ze()),e}function Vu(){var e,r,s,o;return e=n,(r=Mt())!==t?(p(),(s=te())!==t?(p(),yo()!==t?(p(),(o=ke())!==t?(f=e,e=ua(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Mt())!==t?(p(),(s=te())!==t?(f=e,e=oa(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Zu(){var e,r,s;return e=n,(r=Et())!==t?(p(),(s=xt())!==t?(f=e,e=la(r,s)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Et())!==t?(p(),(s=Ze())!==t?(f=e,e=ca(r,s)):(n=e,e=t)):(n=e,e=t)),e}function G(){var e,r,s,o,h,C;if(e=n,(r=Ue())!==t){for(s=[],o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=fa(r,s)}else n=e,e=t;return e}function Ft(){var e;return e=a.charAt(n),ve.test(e)?n++:(e=t,c===0&&w(he)),e===t&&(a.substr(n,2)===ee?(e=ee,n+=2):(e=t,c===0&&w(Zn))),e}function Ue(){var e,r,s,o,h,C;if(e=n,(r=Je())!==t){for(s=[],o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=da(r,s)}else n=e,e=t;return e}function bt(){var e;return e=a.charAt(n),xn.test(e)?n++:(e=t,c===0&&w(kn)),e}function Je(){var e,r;return(e=eo())===t&&(e=Bu())===t&&(e=Qu())===t&&(e=Wu())===t&&(e=Ku())===t&&(e=Gu())===t&&(e=Xu())===t&&(e=co())===t&&(e=ku())===t&&(e=Ze())===t&&(e=n,_()!==t?(p(),(r=M())!==t?(p(),R()!==t?(f=e,e=pa(r)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function ku(){var e,r;return e=n,(r=zu())!==t&&(f=e,r=ma(r)),(e=r)===t&&(e=n,(r=Hu())!==t&&(f=e,r=va(r)),e=r),e}function zu(){var e,r;return e=n,(r=$u())!==t&&(f=e,r=ha(r)),e=r}function $u(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=Pt();o!==t;)s.push(o),o=Pt();f=e,e=wa(r,s)}else n=e,e=t;return e}function At(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=N();o!==t;)s.push(o),o=N();f=e,e=Ia(r,s)}else n=e,e=t;return e}function Ve(){var e;return e=a.charAt(n),Cn.test(e)?n++:(e=t,c===0&&w(zn)),e}function N(){var e;return e=a.charAt(n),Mn.test(e)?n++:(e=t,c===0&&w($n)),e}function Pt(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function Hu(){var e,r;return e=n,ye()!==t?(r=qu(),ye()!==t?(f=e,e=ga(r)):(n=e,e=t)):(n=e,e=t),e}function qu(){var e,r,s;for(e=n,r=[],s=Dt();s!==t;)r.push(s),s=Dt();return f=e,e=r=ya(r)}function Dt(){var e;return(e=Yu())===t&&(e=ju()),e}function ju(){var e;return e=n,ye()!==t&&ye()!==t?(f=e,e=Ta()):(n=e,e=t),e}function Yu(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function ye(){var e;return e=a.charAt(n),En.test(e)?n++:(e=t,c===0&&w(Hn)),e}function Ze(){var e,r,s,o;return e=n,r=n,a.charCodeAt(n)===64?(s=Cr,n++):(s=t,c===0&&w(qn)),s!==t&&(o=At())!==t?r=s=[s,o]:(n=r,r=t),r!==t&&(f=e,r=Na(r)),e=r}function Bu(){var e,r,s,o;return e=n,jt()!==t?(p(),r=n,_()!==t?(p(),(s=Rt())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Oa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=Rt())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Sa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=xa(r)):(n=e,e=t)):(n=e,e=t),e}function Qu(){var e,r,s,o,h,C,ie;return e=n,No()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),h=n,To()!==t?(C=p(),(ie=M())!==t?(p(),h=ie):(n=h,h=t)):(n=h,h=t),h===t&&(h=null),R()!==t?(f=r,r=Ca(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),(h=W())!==t?(p(),(C=M())!==t&&(ie=R())!==t?(f=r,r=Ma(s,o,C)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Ea(r)):(n=e,e=t)):(n=e,e=t),e}function Gu(){var e,r,s,o;return e=n,Eo()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),Fo()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=Fa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=ba(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Aa(r)):(n=e,e=t)):(n=e,e=t),e}function Lt(){var e,r,s;return e=n,(r=bo())===t&&(r=Ao()),r!==t&&(f=e,r=Pa()),(e=r)===t&&(e=n,(r=Po())!==t&&(f=e,r=Da()),(e=r)===t&&(e=n,(r=Do())!==t&&(f=e,r=La()),(e=r)===t&&(e=n,(r=Lo())!==t&&(f=e,r=_a()),(e=r)===t&&(e=n,(r=Bt())!==t&&(f=e,r=Ra()),(e=r)===t&&(e=n,(r=Yt())!==t&&(f=e,r=Ua()),(e=r)===t&&(e=n,(r=Qt())!==t&&(f=e,r=Ja()),(e=r)===t&&(e=n,(r=_o())!==t?(p(),_()!==t?(p(),(s=re())!==t?(p(),R()!==t?(f=e,e=Va(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)))))))),e}function Wu(){var e,r,s,o,h;return e=n,Oo()!==t?(p(),r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),$e()!==t?(p(),(h=M())!==t?(p(),R()!==t?(f=r,r=Za(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),R()!==t?(f=r,r=ka(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=za(r)):(n=e,e=t)):(n=e,e=t),e}function _t(){var e,r;return e=n,(r=xo())===t&&(r=Co())===t&&(r=Mo()),r===t&&(r=null),f=e,e=r=$a(r)}function Ku(){var e,r,s,o;return e=n,So()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),ze()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Ha(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=qa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=ja(r)):(n=e,e=t)):(n=e,e=t),e}function Xu(){var e,r,s,o;return e=n,r=n,c++,s=jt(),c--,s===t?r=void 0:(n=r,r=t),r!==t&&(s=Zo())!==t?(p(),(o=xt())!==t?(f=e,e=Ya(s,o)):(n=e,e=t)):(n=e,e=t),e}function Rt(){var e,r;return e=n,(r=Wt())===t&&(r=Kt())===t&&(r=Xt())===t&&(r=er())===t&&(r=tr())===t&&(r=ne())===t&&(r=Uo())===t&&(r=Jo()),r!==t&&(f=e,r=Ba(r)),e=r}function eo(){var e;return(e=ke())===t&&(e=mo())===t&&(e=lo())===t&&(e=oo())===t&&(e=uo())===t&&(e=to())===t&&(e=no())===t&&(e=ro()),e}function to(){var e,r;return e=n,Yt()!==t?(p(),(r=te())!==t?(f=e,e=Qa(r)):(n=e,e=t)):(n=e,e=t),e}function ro(){var e,r;return e=n,Qt()!==t?(p(),(r=te())!==t?(f=e,e=Ga(r)):(n=e,e=t)):(n=e,e=t),e}function no(){var e,r,s,o;return e=n,Gt()!==t?(p(),r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t?(p(),(s=te())!==t?(p(),(o=Ut())!==t?(f=e,e=Wa(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,Gt()!==t?(p(),(r=te())!==t?(p(),(s=Ut())!==t?(f=e,e=Ka(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function Ut(){var e,r,s;return e=n,(r=io())!==t?(p(),Ro()!==t?(p(),(s=ao())!==t?(f=e,e=Xa(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=so()),e}function io(){var e,r,s;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=ts(r)),e=r),e}function ao(){var e,r,s,o;return e=n,(r=ce())!==t&&(f=e,r=rs(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=ns(s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=is(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=as()),e=r))),e}function so(){var e,r,s,o;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ss(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=us(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=os(s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ls(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=cs()),e=r)))),e}function ce(){var e,r;return e=n,(r=Xt())!==t&&(f=e,r=fs()),(e=r)===t&&(e=n,(r=er())!==t&&(f=e,r=ds()),(e=r)===t&&(e=n,(r=tr())!==t&&(f=e,r=ps()),(e=r)===t&&(e=n,(r=Kt())!==t&&(f=e,r=ms()),(e=r)===t&&(e=n,(r=Wt())!==t&&(f=e,r=vs()),e=r)))),e}function Te(){var e,r;return e=n,(r=re())!==t&&(f=e,r=hs(r)),e=r}function Ne(){var e,r;return e=n,(r=re())!==t&&(f=e,r=ws(r)),e=r}function uo(){var e,r;return e=n,Bt()!==t?(p(),(r=te())!==t?(f=e,e=Is(r)):(n=e,e=t)):(n=e,e=t),e}function oo(){var e,r;return e=n,(r=wo())!==t&&(f=e,r=gs()),e=r}function lo(){var e,r;return e=n,(r=Io())!==t&&(f=e,r=ys()),(e=r)===t&&(e=n,(r=go())!==t&&(f=e,r=Ts()),e=r),e}function te(){var e;return(e=ke())===t&&(e=Ze()),e}function ke(){var e,r,s,o,h;if(e=n,a.charCodeAt(n)===39?(r=at,n++):(r=t,c===0&&w(dt)),r===t&&(a.substr(n,2)===st?(r=st,n+=2):(r=t,c===0&&w(jn))),r!==t){for(s=[],o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));o!==t;)s.push(o),o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));a.charCodeAt(n)===39?(o=at,n++):(o=t,c===0&&w(dt)),o!==t?(f=e,e=Ns(s)):(n=e,e=t)}else n=e,e=t;return e}function co(){var e;return(e=fo())===t&&(e=po()),e}function fo(){var e,r,s,o,h;if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Ee())!==t?(f=e,e=Os(r,s)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;if(e===t)if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Jt())!==t?(h=p(),Ee()!==t?(f=e,e=Ss(r,s,o)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;return e}function po(){var e,r,s,o;if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Ee())!==t?(f=e,e=xs(r)):(n=e,e=t)}else n=e,e=t;if(e===t)if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Jt())!==t?(o=p(),Ee()!==t?(f=e,e=Cs(r,s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function Oe(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Ms(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Se(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Jt(){var e,r;return e=n,Vo()!==t?(p(),(r=M())!==t?(f=e,e=Fs(r)):(n=e,e=t)):(n=e,e=t),e}function mo(){var e,r,s,o;return e=n,(r=vo())!==t?(s=n,c++,o=Ve(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=bs(r)):(n=e,e=t)):(n=e,e=t),e}function vo(){var e,r,s,o;return e=n,(r=xe())!==t&&(s=Vt())!==t&&(o=Zt())!==t?(f=e,e=As(r,s,o)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Vt())!==t?(f=e,e=Ps(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Zt())!==t?(f=e,e=Ds(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(f=e,r=Ls(r)),e=r))),e}function xe(){var e,r,s;return(e=re())===t&&(e=n,r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t&&(s=re())!==t?(f=e,e=_s(r,s)):(n=e,e=t)),e}function Vt(){var e,r,s;return e=n,a.charCodeAt(n)===46?(r=Mr,n++):(r=t,c===0&&w(Yn)),r!==t?((s=re())===t&&(s=null),f=e,e=Rs(s)):(n=e,e=t),e}function Zt(){var e,r,s;return e=n,(r=ho())!==t&&(s=re())!==t?(f=e,e=Us(r,s)):(n=e,e=t),e}function re(){var e,r,s;if(e=n,r=[],(s=kt())!==t)for(;s!==t;)r.push(s),s=kt();else r=t;return r!==t&&(f=e,r=Js(r)),e=r}function kt(){var e;return e=a.charAt(n),Fn.test(e)?n++:(e=t,c===0&&w(Bn)),e}function ho(){var e,r,s;return e=n,r=a.charAt(n),bn.test(r)?n++:(r=t,c===0&&w(Qn)),r!==t?(s=a.charAt(n),ve.test(s)?n++:(s=t,c===0&&w(he)),s===t&&(s=null),f=e,e=Vs(r,s)):(n=e,e=t),e}function wo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Er?n+=4:(r=t,c===0&&w(Gn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function Io(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Fr?n+=4:(r=t,c===0&&w(Wn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function go(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===br?n+=5:(r=t,c===0&&w(Kn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function ze(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ar?n+=2:(r=t,c===0&&w(Xn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Zs()):(n=e,e=t)):(n=e,e=t),e}function zt(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Pr?n+=2:(r=t,c===0&&w(ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ks()):(n=e,e=t)):(n=e,e=t),e}function $t(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Dr?n+=4:(r=t,c===0&&w(ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=zs()):(n=e,e=t)):(n=e,e=t),e}function yo(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===Lr?n+=6:(r=t,c===0&&w(ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=$s()):(n=e,e=t)):(n=e,e=t),e}function fe(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===_r?n+=3:(r=t,c===0&&w(ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Hs()):(n=e,e=t)):(n=e,e=t),e}function Ce(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Rr?n+=3:(r=t,c===0&&w(ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=qs()):(n=e,e=t)):(n=e,e=t),e}function Ht(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ur?n+=2:(r=t,c===0&&w(ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=js()):(n=e,e=t)):(n=e,e=t),e}function qt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Jr?n+=7:(r=t,c===0&&w(si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ys()):(n=e,e=t)):(n=e,e=t),e}function $e(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Vr?n+=4:(r=t,c===0&&w(ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Bs()):(n=e,e=t)):(n=e,e=t),e}function To(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Zr?n+=3:(r=t,c===0&&w(oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Qs()):(n=e,e=t)):(n=e,e=t),e}function No(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===kr?n+=9:(r=t,c===0&&w(li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Gs()):(n=e,e=t)):(n=e,e=t),e}function jt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===zr?n+=7:(r=t,c===0&&w(ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ws()):(n=e,e=t)):(n=e,e=t),e}function Oo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===$r?n+=4:(r=t,c===0&&w(fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ks()):(n=e,e=t)):(n=e,e=t),e}function So(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Hr?n+=8:(r=t,c===0&&w(di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Xs()):(n=e,e=t)):(n=e,e=t),e}function Yt(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===qr?n+=9:(r=t,c===0&&w(pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=eu()):(n=e,e=t)):(n=e,e=t),e}function Bt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===jr?n+=4:(r=t,c===0&&w(mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=tu()):(n=e,e=t)):(n=e,e=t),e}function Qt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Yr?n+=4:(r=t,c===0&&w(vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ru()):(n=e,e=t)):(n=e,e=t),e}function xo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Br?n+=7:(r=t,c===0&&w(hi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=nu()):(n=e,e=t)):(n=e,e=t),e}function Co(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Qr?n+=8:(r=t,c===0&&w(wi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=iu()):(n=e,e=t)):(n=e,e=t),e}function Mo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Gr?n+=4:(r=t,c===0&&w(Ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=au()):(n=e,e=t)):(n=e,e=t),e}function Eo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Wr?n+=4:(r=t,c===0&&w(gi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=su()):(n=e,e=t)):(n=e,e=t),e}function Fo(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Kr?n+=2:(r=t,c===0&&w(yi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=uu()):(n=e,e=t)):(n=e,e=t),e}function bo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Xr?n+=7:(r=t,c===0&&w(Ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ou()):(n=e,e=t)):(n=e,e=t),e}function Ao(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===en?n+=3:(r=t,c===0&&w(Ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=lu()):(n=e,e=t)):(n=e,e=t),e}function Po(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===tn?n+=8:(r=t,c===0&&w(Oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=cu()):(n=e,e=t)):(n=e,e=t),e}function Do(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===rn?n+=5:(r=t,c===0&&w(Si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=fu()):(n=e,e=t)):(n=e,e=t),e}function Lo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===nn?n+=4:(r=t,c===0&&w(xi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=du()):(n=e,e=t)):(n=e,e=t),e}function _o(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===an?n+=7:(r=t,c===0&&w(Ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=pu()):(n=e,e=t)):(n=e,e=t),e}function Ro(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===sn?n+=2:(r=t,c===0&&w(Mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=mu()):(n=e,e=t)):(n=e,e=t),e}function Gt(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===un?n+=8:(r=t,c===0&&w(Ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=vu()):(n=e,e=t)):(n=e,e=t),e}function Wt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===on?n+=4:(r=t,c===0&&w(Fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=hu()):(n=e,e=t)):(n=e,e=t),e}function Uo(){var e,r,s,o;return e=n,(r=a.substr(n,13)).toLowerCase()===ln?n+=13:(r=t,c===0&&w(bi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=wu()):(n=e,e=t)):(n=e,e=t),e}function Jo(){var e,r,s,o;return e=n,(r=a.substr(n,15)).toLowerCase()===cn?n+=15:(r=t,c===0&&w(Ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Iu()):(n=e,e=t)):(n=e,e=t),e}function Kt(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===fn?n+=5:(r=t,c===0&&w(Pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=gu()):(n=e,e=t)):(n=e,e=t),e}function Xt(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===dn?n+=3:(r=t,c===0&&w(Di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=yu()):(n=e,e=t)):(n=e,e=t),e}function er(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===pn?n+=4:(r=t,c===0&&w(Li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Tu()):(n=e,e=t)):(n=e,e=t),e}function tr(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===mn?n+=6:(r=t,c===0&&w(_i)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Nu()):(n=e,e=t)):(n=e,e=t),e}function ne(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===vn?n+=6:(r=t,c===0&&w(Ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ou()):(n=e,e=t)):(n=e,e=t),e}function Me(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===hn?n+=4:(r=t,c===0&&w(Ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Su()):(n=e,e=t)):(n=e,e=t),e}function Ee(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===wn?n+=3:(r=t,c===0&&w(Ji)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=xu()):(n=e,e=t)):(n=e,e=t),e}function rr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===In?n+=4:(r=t,c===0&&w(Vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Cu()):(n=e,e=t)):(n=e,e=t),e}function nr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===gn?n+=4:(r=t,c===0&&w(Zi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Mu()):(n=e,e=t)):(n=e,e=t),e}function Vo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===yn?n+=4:(r=t,c===0&&w(ki)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Eu()):(n=e,e=t)):(n=e,e=t),e}function W(){var e;return a.charCodeAt(n)===44?(e=Tn,n++):(e=t,c===0&&w(zi)),e}function _(){var e;return a.charCodeAt(n)===40?(e=Nn,n++):(e=t,c===0&&w($i)),e}function R(){var e;return a.charCodeAt(n)===41?(e=On,n++):(e=t,c===0&&w(Hi)),e}function p(){var e,r;for(e=[],r=ir();r!==t;)e.push(r),r=ir();return e}function ir(){var e;return e=a.charAt(n),An.test(e)?n++:(e=t,c===0&&w(qi)),e}function Zo(){var e,r,s,o;if(e=n,(r=At())!==t&&(f=e,r=Fu(r)),(e=r)===t)if(e=n,a.charCodeAt(n)===96?(r=ut,n++):(r=t,c===0&&w(vt)),r!==t){if(s=[],o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht)),o!==t)for(;o!==t;)s.push(o),o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht));else s=t;s!==t?(a.charCodeAt(n)===96?(o=ut,n++):(o=t,c===0&&w(vt)),o!==t?(f=e,e=bu(s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function ko(e,r,s){return{type:"unary-expression",location:s,operator:e,expr:r}}function ar(e,r,s,o,h){const C={type:"binary-expression",location:h,operator:e,left:r,right:s};return o!==void 0&&(C.escape=o),C}function k(e,...r){return{type:"expression-list",location:e,value:r}}function de(e,r){let s=e;for(const{op:o,expr:h,location:{end:C}}of r)s=ar(o,s,h,void 0,{...s.location,end:C});return s}function zo(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Timestamp literal is invalid")}function $o(e){/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)!==!0&&_e("Time literal is invalid")}function Ho(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Date literal is invalid")}if(u=g(),i.peg$library)return{peg$result:u,peg$currPos:n,peg$FAILED:t,peg$maxFailExpected:we,peg$maxFailPos:Y};if(u!==t&&n===a.length)return u;throw u!==t&&n `+g+` +`+S+` | +`+v.line+" | "+O+` +`+S+" | "+Qe("",l.column-1," ")+Qe("",x,"^")}else i+=` + at `+g}return i},se.buildMessage=function(a,i){var u={literal:function(O){return'"'+l(O.text)+'"'},class:function(O){var x=O.parts.map(function(D){return Array.isArray(D)?v(D[0])+"-"+v(D[1]):v(D)});return"["+(O.inverted?"^":"")+x.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(O){return O.description}};function t(O){return O.charCodeAt(0).toString(16).toUpperCase()}function l(O){return O.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+t(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+t(x)})}function v(O){return O.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+t(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+t(x)})}function g(O){return u[O.type](O)}function T(O){var x,D,F=O.map(g);if(F.sort(),F.length>0){for(x=1,D=1;x=")&&z(i,u[1],"<=")}static notbetween(i,u,t){return i==null||u[0]==null||u[1]==null?null:z(i,u[0],"<")||z(i,u[1],">")}static ternaryNot(i){return Ae(i)}static ternaryAnd(i,u){return Or(i,u)}static ternaryOr(i,u){return Sr(i,u)}}class it{constructor(i,u,t="UTC",l=null){this.fieldsIndex=u,this.timeZone=t,this.currentUser=l,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=yc.parse(i);const{isStandardized:v,isAggregate:g,currentUserRequired:T,referencedFieldNames:S}=this._extractExpressionInfo(u);this._referencedFieldNames=S,this.isStandardized=v,this.isAggregate=g,this.currentUserRequired=T}static convertValueToStorageFormat(i,u=null){if(u===null)return q(i)?i.getTime():b(i)?i.toMillis():P(i)?i.toStorageFormat():L(i)?i.toStorageString():A(i)?i.toStorageFormat():i;switch(u){case"date":return q(i)?i.getTime():b(i)?i.toMillis():P(i)?i.toMilliseconds():A(i)?i.toNumber():i;case"date-only":return q(i)?j.fromDateJS(i).toString():P(i)?j.fromSqlTimeStampOffset(i).toString():b(i)?j.fromDateTime(i).toString():i;case"time-only":return q(i)?$.fromDateJS(i).toStorageString():b(i)?$.fromDateTime(i).toStorageString():P(i)?$.fromSqlTimeStampOffset(i).toStorageString():L(i)?i.toStorageString():i;case"timestamp-offset":if(q(i))return Q.fromJSDate(i).toStorageFormat();if(b(i))return Q.fromDateTime(i).toStorageFormat();if(P(i))return i.toStorageFormat()}return i}static create(i,u={}){return new it(i,u.fieldsIndex,u.timeZone??void 0,u.currentUser)}get fieldNames(){return this._referencedFieldNames}testSet(i,u=le,t=this.currentUser){return!!this._evaluateNode(this.parseTree,null,u,i,t)}calculateValue(i,u=le,t=this.currentUser){const l=this._evaluateNode(this.parseTree,i,u,null,t);return l instanceof E?l.valueInMilliseconds()/864e5:l}calculateValueCompiled(i,u=le,t=this.currentUser){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null):ur("esri-csp-restrictions")?this.calculateValue(i,u):(this._compileMe(),this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null))}testFeature(i,u=le,t=this.currentUser){return!!this._evaluateNode(this.parseTree,i,u,null,t)}testFeatureCompiled(i,u=le,t=this.currentUser){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null):ur("esri-csp-restrictions")?this.testFeature(i,u):(this._compileMe(),!!this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null))}get hasDateFunctions(){return this._hasDateFunctions!=null||(this._hasDateFunctions=!1,U(this.parseTree,i=>{i.type==="current-time"?this._hasDateFunctions=!0:i.type==="function"&&(this._hasDateFunctions=this._hasDateFunctions||Tc.has(i.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const i=new Set;return U(this.parseTree,u=>{u.type==="function"&&i.add(u.name.toLowerCase())}),Array.from(i)}getExpressions(){const i=new Map;return U(this.parseTree,u=>{if(u.type==="function"){const t=u.name.toLowerCase(),l=u.args.value[0];if(l.type==="column-reference"){const v=l.column,g=`${t}-${v}`;i.has(g)||i.set(g,{aggregateType:t,field:v})}}}),[...i.values()]}getVariables(){const i=new Set;return U(this.parseTree,u=>{u.type==="parameter"&&i.add(u.value.toLowerCase())}),Array.from(i)}_compileMe(){const i="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone","currentUser",i).bind(be)}_extractExpressionInfo(i){const u=[],t=new Set;let l=!0,v=!1,g=!1;return U(this.parseTree,T=>{switch(T.type){case"column-reference":{const S=i?.get(T.column);let O,x;S?O=x=S.name??"":(x=T.column,O=x.toLowerCase()),t.has(O)||(t.add(O),u.push(x)),T.column=x;break}case"current-user":g=!0;break;case"function":{const{name:S,args:O}=T,x=O.value.length;l&&(l=yl(S,x)),v===!1&&(v=lr(S,x));break}}}),{referencedFieldNames:Array.from(u),isStandardized:l,isAggregate:v,currentUserRequired:g}}evaluateNodeToJavaScript(i){switch(i.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(i.value)+", "+JSON.stringify(i.qualifier)+","+JSON.stringify(i.op)+")";case"case-expression":{let u="";if(i.format==="simple"){const t=this.evaluateNodeToJavaScript(i.operand);u="( ";for(let l=0;l=",this.timeZone)&&z(T,S[1],"<=",this.timeZone)}case"NOTBETWEEN":{const T=this._evaluateNode(i.left,u,t,l,v),S=this._evaluateNode(i.right,u,t,l,v);return T==null||S[0]==null||S[1]==null?null:z(T,S[0],"<",this.timeZone)||z(T,S[1],">",this.timeZone)}case"LIKE":return Xe(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.escape);case"NOT LIKE":return Ae(Xe(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return z(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return Tr(i.operator,this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),this.timeZone)}case"null":case"boolean":case"string":case"number":return i.value;case"date":return i.parsedValue??=Ir(i.value,"unknown"),i.parsedValue;case"timestamp":return i.parsedValue??=De(i.value,"unknown"),i.parsedValue;case"time":return tt(i.value);case"current-time":return i.mode==="date"?be.currentDate(this.timeZone):i.mode==="time"?be.currentTime(this.timeZone):be.currentTimestamp(this.timeZone);case"current-user":return v??null;case"column-reference":return xr(u,i.column,this.fieldsIndex,t);case"data-type":return i.value;case"function":{if(this.isAggregate&&lr(i.name,i.args.value.length)){const S=[];for(const O of i.args?.value||[]){const x=[];for(const D of l||[])x.push(this._evaluateNode(O,D,t,null,v));S.push(x)}return Ko(i.name,S)}const T=this._evaluateNode(i.args,u,t,l,v);return rt(i.name,T,this.timeZone)}}throw new m(d.UnsupportedSyntax,{node:i.type})}}function Nr(a){return a===!0}function We(a){return Array.isArray(a)?a:[a]}function Ae(a){return a!==null?a!==!0:null}function Or(a,i){return a!=null&&i!=null?a===!0&&i===!0:a!==!1&&i!==!1&&null}function Sr(a,i){return a!=null&&i!=null?a===!0||i===!0:a===!0||i===!0||null}function Ke(a,i,u){if(a==null)return null;let t=!1;for(const l of i)if(l==null)t=null;else{if(a===l){t=!0;break}if(Ge(a)&&Ge(l)&&(t=z(a,l,"="),t))break}return t}const dr="-[]/{}()*+?.\\^$|";var ae;function Nc(a,i){const u=i;let t="",l=ae.Normal;for(let v=0;v(Oc(a)?a.attributes:a)[i]},Mc=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:it,defaultAttributeAdapter:le},Symbol.toStringTag,{value:"Module"}));export{Mc as W,it as Z,d as a,m as n,Q as r,Ko as u}; diff --git a/main/assets/WorkerTileHandler-DLznBxmP-Db71OMXn.js b/main/assets/WorkerTileHandler-DLznBxmP-Db71OMXn.js deleted file mode 100644 index 11b79f7f7..000000000 --- a/main/assets/WorkerTileHandler-DLznBxmP-Db71OMXn.js +++ /dev/null @@ -1,2 +0,0 @@ -import{aU as Ue,x as je,ba as Be,hm as Le,O as qe}from"./main-BZaw9FpY.js";import{C as oe,I as _e}from"./enums-qHpGJ28Q-CmnLAccm.js";import{g as V,B as Te,R as ne,E as te,C as Ge,b as Ve,V as Ae,j as Ye,D as $e,N as Ze,d as Je,U as $,F as ye}from"./GeometryUtils-NHgB9gGQ-CDTp-_cE.js";import{a as ke}from"./Rect-DD6XS68q-D_hsV3ag.js";import{o as Ce}from"./config-nuMERBvb-MDUrh2eL.js";import{n as se,l as C,p as Q,o as Ee,u as Me,r as Xe,m as we}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as Qe}from"./pbf-D-y3_eZO-BOjQwfR-.js";import{M as et,k as tt,D as st}from"./TurboLine-CIlsAy5m-BrOlSIM-.js";import{f as it,g as rt}from"./SourceLayerData-BT_Ywuvg-BR7vjYvJ.js";import{a as at,X as v,W as ot,Z as nt}from"./StyleRepository-D3WuVprR-COU4Jcir.js";import{m as Se}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{d as lt}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";function ht(a){return a===746||a===747||!(a<4352)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103&&!(a>=65097&&a<=65103)||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351&&!(a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=12592&&a<=12687||a>=43360&&a<=43391||a>=55216&&a<=55295||a>=4352&&a<=4607||a>=44032&&a<=55215||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12688&&a<=12703||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543&&a!==12540||a>=65280&&a<=65519&&!(a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||a>=65104&&a<=65135&&!(a>=65112&&a<=65118||a>=65123&&a<=65126)||a>=5120&&a<=5759||a>=6320&&a<=6399||a>=65040&&a<=65055||a>=19904&&a<=19967||a>=40960&&a<=42127||a>=42128&&a<=42191)}function ct(a){return!(a<11904)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=65280&&a<=65519||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543||a>=65040&&a<=65055||a>=42128&&a<=42191||a>=40960&&a<=42127)}function ut(a){switch(a){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function ve(a){switch(a){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const K=24,He=17;let Ke=class{constructor(a,t,e,i,s,n,o){this._glyphItems=a,this._maxWidth=t,this._lineHeight=e,this._letterSpacing=i,this._hAnchor=s,this._vAnchor=n,this._justify=o}getShaping(a,t,e){const i=this._letterSpacing,s=this._lineHeight,n=this._justify,o=this._maxWidth,r=[];let l=0,h=0;for(const p of a){const g=p.codePointAt(0);if(g==null)continue;const M=e&&ht(g);let m;for(const I of this._glyphItems)if(m=I[g],m)break;r.push({codePoint:g,x:l,y:h,vertical:M,glyphMosaicItem:m}),m&&(l+=m.metrics.advance+i)}let u=l;o>0&&(u=l/Math.max(1,Math.ceil(l/o)));const d=a.includes("​"),f=[],c=r.length;for(let p=0;pM&&ve(r[m].codePoint);)r[m].glyphMosaicItem=null,--m;if(M<=m){const I=r[M].x;for(let T=M;T<=m;T++)r[T].x-=I,r[T].y=h;let P=r[m].x;r[m].glyphMosaicItem&&(P+=r[m].glyphMosaicItem.metrics.advance),_=Math.max(P,_),n&&this._applyJustification(r,M,m)}y=g,h+=w}if(r.length>0){const p=x.length-1,g=(n-this._hAnchor)*_;let M=(-this._vAnchor*(p+1)+.5)*s;t&&p&&(M+=p*s);for(const m of r)m.x+=g,m.y+=M}return r.filter(p=>p.glyphMosaicItem)}static getTextBox(a,t){if(!a.length)return null;let e=1/0,i=1/0,s=0,n=0;for(const o of a){const r=o.glyphMosaicItem.metrics.advance,l=o.x,h=o.y-He,u=l+r,d=h+t;e=Math.min(e,l),s=Math.max(s,u),i=Math.min(i,h),n=Math.max(n,d)}return{x:e,y:i,width:s-e,height:n-i}}static getBox(a){if(!a.length)return null;let t=1/0,e=1/0,i=0,s=0;for(const n of a){const{height:o,left:r,top:l,width:h}=n.glyphMosaicItem.metrics,u=n.x,d=n.y-(o-Math.abs(l)),f=u+h+r,c=d+o;t=Math.min(t,u),i=Math.max(i,f),e=Math.min(e,d),s=Math.max(s,c)}return{x:t,y:e,width:i-t,height:s-e}}static addDecoration(a,t){const e=a.length;if(e===0)return;const i=3;let s=a[0].x+a[0].glyphMosaicItem.metrics.left,n=a[0].y;for(let r=1;r=0&&o,f=i.allowOverlap&&i.ignorePlacement?null:[],c=[],x=4,_=!d;let w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y;const M=(d||o)&&r,m=i.size/K;let I=!1;for(const D of t)if(D.vertical){I=!0;break}let P,T=0,b=0;if(!d&&I){const D=Ke.getTextBox(t,i.lineHeight*K);switch(i.anchor){case C.LEFT:T=D.height/2,b=-D.width/2;break;case C.RIGHT:T=-D.height/2,b=D.width/2;break;case C.TOP:T=D.height/2,b=D.width/2;break;case C.BOTTOM:T=-D.height/2,b=-D.width/2;break;case C.TOP_LEFT:T=D.height;break;case C.BOTTOM_LEFT:b=-D.width;break;case C.TOP_RIGHT:b=D.width;break;case C.BOTTOM_RIGHT:T=-D.height}}T+=i.offset[0]*K,b+=i.offset[1]*K;for(const D of t){const B=D.glyphMosaicItem;if(!B||B.rect.isEmpty)continue;const A=B.rect,k=B.metrics,E=B.page;if(f&&_){if(P!==void 0&&P!==D.y){let S,F,G,H;I?(S=-g+T,F=w+b,G=g-p,H=y-w):(S=w+T,F=p+b,G=y-w,H=g-p);const q={xTile:a.x,yTile:a.y,dxPixels:S*m-l,dyPixels:F*m-l,hard:!i.optional,partIndex:1,width:G*m+2*l,height:H*m+2*l,angle:n,minLod:X,maxLod:te};f.push(q),w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y}P=D.y}const R=[];if(d){const S=.5*B.metrics.width,F=(D.x+k.left-x+S)*m*le;if(h=this._placeGlyph(a,h,F,e,a.segment,1,D.vertical,E,R),r&&(h=this._placeGlyph(a,h,F,e,a.segment,-1,D.vertical,E,R)),h>=Pe)break}else R.push(new pe(s,u,u,E,!1)),o&&r&&R.push(new pe(s,u+ne,u+ne,E,!1));const N=D.x+k.left,j=D.y-He-k.top,Z=N+k.width,ie=j+k.height;let O,U,he,ce,J,ue,De,be;if(!d&&I)if(D.vertical){const S=(N+Z)/2-k.height/2,F=(j+ie)/2+k.width/2;O=new V(-F-x+T,S-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y)}else O=new V(-j+x+T,N-x+b),U=new V(O.x-A.height,O.y+A.width),he=new V(U.x,O.y),ce=new V(O.x,U.y);else O=new V(N-x+T,j-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y);for(const S of R){let F,G,H,q;if(S.alternateVerticalGlyph){if(!J){const Y=(j+ie)/2+b;J=new V((N+Z)/2+T-k.height/2-x,Y+k.width/2+x),ue=new V(J.x+A.height,J.y-A.width),De=new V(ue.x,J.y),be=new V(J.x,ue.y)}F=J,G=De,H=be,q=ue}else F=O,G=he,H=ce,q=U;const fe=j,Ie=ie,de=S.glyphAngle+n;if(de!==0){const Y=Math.cos(de),xe=Math.sin(de);F=F.clone(),G=G?.clone(),H=H?.clone(),q=q?.clone(),F.rotate(Y,xe),q?.rotate(Y,xe),G?.rotate(Y,xe),H?.rotate(Y,xe)}let re=0,ae=256;if(d&&I?D.vertical?S.alternateVerticalGlyph?(re=32,ae=96):(re=224,ae=32):(re=224,ae=96):(re=192,ae=64),c.push(new Oe(F,H,G,q,A,S.labelAngle,re,ae,S.anchor,S.minzoom,S.maxzoom,S.page)),f&&(!M||this._legible(S.labelAngle))){if(_)Ny&&(y=Z),Ie>g&&(g=Ie);else if(S.minzoom=Pe)return null;if(f&&_){let D,B,A,k;I?(D=-g+T,B=w+b,A=g-p,k=y-w):(D=w+T,B=p+b,A=y-w,k=g-p);const E={xTile:a.x,yTile:a.y,dxPixels:D*m-l,dyPixels:B*m-l,hard:!i.optional,partIndex:1,width:A*m+2*l,height:k*m+2*l,angle:n,minLod:X,maxLod:te};f.push(E)}const L=new Fe(c);return f&&f.length>0&&(L.textColliders=f),L}_legible(a){const t=Ge(a);return t<65||t>=193}_placeGlyph(a,t,e,i,s,n,o,r,l){let h=n;const u=h<0?Ve(a.angle+ne,Ae):a.angle;let d=0;e<0&&(h*=-1,e*=-1,d=ne),h>0&&++s;let f=new V(a.x,a.y),c=i[s],x=te;if(i.length<=s)return x;for(;;){const _=c.x-f.x,w=c.y-f.y,y=Math.sqrt(_*_+w*w),p=Math.max(e/y,t),g=_/y,M=w/y,m=Ve(Math.atan2(M,g)+d,Ae);if(l.push(new pe(f,u,m,r,!1,p,x)),o&&l.push(new pe(f,u,m,r,!0,p,x)),p<=t)return p;f=c.clone();do{if(s+=h,i.length<=s||s<0)return p;c=i[s]}while(f.isEqual(c));let I=c.x-f.x,P=c.y-f.y;const T=Math.sqrt(I*I+P*P);I*=y/T,P*=y/T,f.x-=I,f.y-=P,x=p}}},ee=class extends v{constructor(){super(12)}add(a,t,e){const i=this.array;i.push(a),i.push(t),i.push(e)}},dt=class extends v{constructor(a){super(a)}add(a,t,e,i,s,n,o,r,l,h,u,d){const f=this.array;let c=v.i1616to32(a,t);f.push(c);const x=31;c=v.i8888to32(Math.round(x*e),Math.round(x*i),Math.round(x*s),Math.round(x*n)),f.push(c),c=v.i8888to32(Math.round(x*o),Math.round(x*r),Math.round(x*l),Math.round(x*h)),f.push(c),c=v.i1616to32(u,0),f.push(c),d&&f.push(...d)}},xt=class extends v{constructor(a){super(a)}add(a,t,e){const i=this.array;i.push(v.i1616to32(a,t)),e&&i.push(...e)}};class yt extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r){const l=this.array,h=this.index;let u=v.i1616to32(t,e);l.push(u);const d=15;return u=v.i8888to32(Math.round(d*i),Math.round(d*s),n,o),l.push(u),r&&l.push(...r),h}}class ze extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r,l,h,u,d,f){const c=this.array;let x=v.i1616to32(t,e);c.push(x),x=v.i1616to32(Math.round(8*i),Math.round(8*s)),c.push(x),x=v.i8888to32(n/4,o/4,l,h),c.push(x),x=v.i8888to32(0,Ge(r),10*u,Math.min(10*d,255)),c.push(x),f&&c.push(...f)}}class gt extends v{constructor(t){super(t)}add(t,e,i,s,n){const o=this.array,r=v.i1616to32(2*t+i,2*e+s);o.push(r),n&&o.push(...n)}}class me{constructor(t,e,i){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=i,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,i){}}let pt=class extends me{constructor(a,t,e,i,s){super(a,t,e),this.type=_e.CIRCLE,this._circleVertexBuffer=i,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(a){const t=this._circleVertexBuffer,e=this._circleIndexBuffer;this._circleIndexStart=3*e.index,this._circleIndexCount=0;const i=this.layer,s=this.zoom;a&&a.setExtent(this.layerExtent);for(const n of this._features){const o=n.getGeometry(a);if(!o)continue;const r=i.circleMaterial.encodeAttributes(n,s,i);for(const l of o)if(l)for(const h of l){const u=t.index;t.add(h.x,h.y,0,0,r),t.add(h.x,h.y,0,1,r),t.add(h.x,h.y,1,0,r),t.add(h.x,h.y,1,1,r),e.add(u,u+1,u+2),e.add(u+1,u+2,u+3),this._circleIndexCount+=6}}}serialize(){let a=6;a+=this.layerUIDs.length,a+=this._circleVertexBuffer.array.length,a+=this._circleIndexBuffer.array.length;const t=new Uint32Array(a),e=new Int32Array(t.buffer);let i=0;t[i++]=this.type,t[i++]=this.layerUIDs.length;for(let s=0;sM.page-m.page);for(const{ddFillAttributes:M,ddOutlineAttributes:m,page:I,geometry:P}of c)this._processFeature(P,u,e.outlineUsesFillColor,M,m,f,I)}}else for(const c of d){const x=o?s.encodeAttributes(c,i,e):null,_=u&&r?n.encodeAttributes(c,i,e):null,w=c.getGeometry(t);this._processFeature(w,u,e.outlineUsesFillColor,x,_,f)}}serialize(){let t=10;t+=this.layerUIDs.length,t+=this._fillVertexBuffer.array.length,t+=this._fillIndexBuffer.array.length,t+=this._outlineVertexBuffer.array.length,t+=this._outlineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this._fillVertexBuffer.array.length;for(let r=0;ru?(d!==void 0&&this._processFill(t,d,s,o,r),d=[f]):c<-u&&d!==void 0&&d.push(f)}d!==void 0&&this._processFill(t,d,s,o,r)}_processOutline(t,e){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,n=s.index;let o,r,l;const h=new V(0,0),u=new V(0,0),d=new V(0,0);let f=-1,c=-1,x=-1,_=-1,w=-1,y=!1;const p=0;let g=t.length;if(g<2)return;const M=t[p];let m=t[g-1];for(;g&&m.isEqual(M);)--g,m=t[g-1];if(!(g-p<2)){for(let I=p;I8&&(L=8),T>=0?(x=i.add(r.x,r.y,h.x,h.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,L*-d.x,L*-d.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,d.x,d.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,u.x,u.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x)):(x=i.add(r.x,r.y,L*d.x,L*d.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,-h.x,-h.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,-d.x,-d.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=i.add(r.x,r.y,-u.x,-u.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x))}f>=0&&c>=0&&_>=0&&!y&&s.add(f,c,_),f>=0&&_>=0&&w>=0&&!y&&s.add(f,w,_),this._outlineIndexCount+=3*(s.index-n)}}_processFill(t,e,i,s,n){s=!0;let o;e.length>1&&(o=[]);let r=0;for(const d of e)r!==0&&o.push(r),r+=t[d].length;const l=2*r,h=Be.acquire();for(const d of e){const f=t[d],c=f.length;for(let x=0;x0){const d=e.map(x=>t[x].length),{buffer:f,vertexCount:c}=tt(h,d);if(c>0){const x=this._fillVertexBuffer.index;for(let _=0;_0){const f=this._fillVertexBuffer.index;let c=0;for(;c=4160:t.y===e.y&&(t.y<=-64||t.y>=4160)}static _area(t){let e=0;const i=t.length-1;for(let s=0;sB.page-A.page),n.textured=!0;for(const{ddAttributes:B,page:A,cap:k,join:E,miterLimit:R,roundLimit:N,halfWidth:j,offset:Z,geometry:ie}of D)n.capType=k,n.joinType=E,n.miterLimit=R,n.roundLimit=N,n.halfWidth=j,n.offset=Z,this._processFeature(ie,B,A)}else{if(l){const D=l.getValue(i);if(!this._spriteInfo[D]?.rect)return}n.textured=!(!l&&!h),n.capType=x,n.joinType=p,n.miterLimit=M,n.roundLimit=I,n.halfWidth=.5*T,n.offset=L;for(const D of s){const B=o?r.encodeAttributes(D,i,e):null;c&&(n.capType=c.getValue(i,D)),y&&(n.joinType=y.getValue(i,D)),g&&(n.miterLimit=g.getValue(i,D)),m&&(n.roundLimit=m.getValue(i,D)),P&&(n.halfWidth=.5*P.getValue(i,D)),b&&(n.offset=b.getValue(i,D));const A=D.getGeometry(t);this._processFeature(A,B)}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this.tessellationProperties._lineVertexBuffer.array.length,t+=this.tessellationProperties._lineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let r=0;r(t,e,i,s,n,o,r,l,h,u,d)=>(a._lineVertexBuffer.add(t,e,r,l,i,s,n,o,h,u,d,a._ddValues),a._lineVertexBuffer.index-1),wt=a=>(t,e,i)=>{a._lineIndexBuffer.add(t,e,i)},Ne=10;function Pt(a,t){return a.iconMosaicItem&&t.iconMosaicItem?a.iconMosaicItem.page===t.iconMosaicItem.page?0:a.iconMosaicItem.page-t.iconMosaicItem.page:a.iconMosaicItem&&!t.iconMosaicItem?1:!a.iconMosaicItem&&t.iconMosaicItem?-1:0}class z extends me{constructor(t,e,i,s,n,o,r,l,h){super(e,i,h.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=t,this._iconVertexBuffer=s,this._iconIndexBuffer=n,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(t,e,i){const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const u=[];let d,f,c,x;o&&!o.isDataDriven&&(d=o.getValue(n)),r&&!r.isDataDriven&&(f=r.getValue(n)),l&&l.isDataDriven||(c=s.getLayoutValue("text-transform",n),l=null),h&&h.isDataDriven||(x=s.getLayoutValue("text-font",n),h=null);for(const _ of this._features){const w=_.getGeometry(t);if(!w||w.length===0)continue;let y,p;o&&(y=o.isDataDriven?o.getValue(n,_):this._replaceKeys(d,_.values),y&&e(y));let g=!1;if(r&&(p=r.isDataDriven?r.getValue(n,_):this._replaceKeys(f,_.values),p)){switch(p=p.replaceAll("\\n",` -`),l&&(c=l.getValue(n,_)),c){case Ee.LOWERCASE:p=p.toLowerCase();break;case Ee.UPPERCASE:p=p.toUpperCase()}if(z._bidiEngine.hasBidiChar(p)){let I;I=z._bidiEngine.checkContextual(p)==="rtl"?"IDNNN":"ICNNN",p=z._bidiEngine.bidiTransform(p,I,"VLYSN"),g=!0}if(p.length>0){h&&(x=h.getValue(n,_));for(const I of x){let P=i[I];P||(P=i[I]=new Set);for(const T of p){const b=T.codePointAt(0);b!=null&&P.add(b)}}}}if(!y&&!p)continue;const M=s.getLayoutValue("symbol-sort-key",n,_),m={feature:_,sprite:y,label:p,rtl:g,geometry:w,hash:(p?Le(p):0)^(y?Le(y):0),priority:M,textFont:x};u.push(m)}this._symbolFeatures=u}processFeatures(t){t&&t.setExtent(this.layerExtent);const e=this.layer,i=this.zoom,s=e.getLayoutValue("symbol-placement",i),n=s!==Me.POINT,o=e.getLayoutValue("symbol-spacing",i)*le,r=e.getLayoutProperty("icon-image"),l=e.getLayoutProperty("text-field"),h=r?new ot(e,i,n):null,u=l?new nt(e,i,n):null,d=this._workerTileHandler;let f;r&&(f=d.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const c=[];let x=1;u?.size&&(x=u.size/K);const _=u?u.maxAngle*Te:0,w=u?u.size*le:0;for(const y of this._symbolFeatures){let p;h&&f&&y.sprite&&(p=f[y.sprite],p&&p.sdf&&(this._isIconSDF=!0));let g;p&&h.update(i,y.feature);let M=0;const m=y.label;if(m){qe(u),u.update(i,y.feature);const I=n&&u.rotationAlignment===se.MAP?u.keepUpright:u.writingMode&&u.writingMode.includes(Xe.VERTICAL);let P=.5;switch(u.anchor){case C.TOP_LEFT:case C.LEFT:case C.BOTTOM_LEFT:P=0;break;case C.TOP_RIGHT:case C.RIGHT:case C.BOTTOM_RIGHT:P=1}let T=.5;switch(u.anchor){case C.TOP_LEFT:case C.TOP:case C.TOP_RIGHT:T=0;break;case C.BOTTOM_LEFT:case C.BOTTOM:case C.BOTTOM_RIGHT:T=1}let b=.5;switch(u.justify){case we.AUTO:b=P;break;case we.LEFT:b=0;break;case we.RIGHT:b=1}const L=u.letterSpacing*K,D=n?0:u.maxWidth*K,B=u.lineHeight*K,A=y.textFont.map(k=>d.getGlyphItems(k));if(g=new Ke(A,D,B,L,P,T,b).getShaping(m,y.rtl,I),g&&g.length>0){let k=1e30,E=-1e30;for(const R of g)k=Math.min(k,R.x),E=Math.max(E,R.x);M=(E-k+2*K)*x*le}}for(let I of y.geometry){const P=[];if(s===Me.LINE){if(g?.length&&u?.size){const T=u.size*le*(2+Math.min(2,4*Math.abs(u.offset[1])));I=z._smoothVertices(I,T)}z._pushAnchors(P,I,o,M)}else s===Me.LINE_CENTER?z._pushCenterAnchor(P,I):y.feature.type===Je.Polygon?z._pushCentroid(P,I):P.push(new ge(I[0].x,I[0].y));for(const T of P){if(T.x<0||T.x>Re||T.y<0||T.y>Re||n&&M>0&&u?.rotationAlignment===se.MAP&&!z._honorsTextMaxAngle(I,T,M,_,w))continue;const b={shaping:g,line:I,iconMosaicItem:p,anchor:T,symbolFeature:y,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};c.push(b),this._processFeature(b,h,u)}}}c.sort(Pt),this._addPlacedGlyphs(),this._symbolInstances=c}serialize(){let t=14;t+=this.layerUIDs.length,t+=3*this.markerPageMap.size,t+=3*this.glyphsPageMap.size,t+=z._symbolsSerializationLength(this._symbolInstances),t+=this._iconVertexBuffer.array.length,t+=this._iconIndexBuffer.array.length,t+=this._textVertexBuffer.array.length,t+=this._textIndexBuffer.array.length;const e=new Uint32Array(t),i=new Int32Array(e.buffer),s=new Float32Array(e.buffer),[n,o,r]=this._sourceTileKey.split("/");let l=0;e[l++]=this.type,e[l++]=this.layerUIDs.length;for(let h=0;hs in e?e[s]:"")}_processFeature(t,e,i){const{line:s,iconMosaicItem:n,shaping:o,anchor:r}=t,l=this.zoom,h=this.layer,u=!!n;let d=!0;u&&(d=e?.optional||!n);const f=o&&o.length>0,c=!f||i?.optional;let x,_;if(u&&(x=this._placementEngine.getIconPlacement(r,n,e)),(x||d)&&(f&&(_=this._placementEngine.getTextPlacement(r,o,s,i)),_||c)){if(x&&_||(c||d?c||_?d||x||(_=null):x=null:(x=null,_=null)),_){const w=h.hasDataDrivenText?h.textMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(t,_.shapes,l,i.rotationAlignment,w),_.textColliders){t.textColliders=_.textColliders;for(const y of _.textColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}if(x){const w=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(t,x.shapes,l,n.page,e.rotationAlignment===se.VIEWPORT,w),x.iconColliders){t.iconColliders=x.iconColliders;for(const y of x.iconColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}}}_addPlacedIcons(t,e,i,s,n,o){const r=Math.max(i-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,u=this._markerMap;for(const d of e){const f=n?0:Math.max(i+$(d.minzoom),r),c=n?25:Math.min(i+$(d.maxzoom),25);if(c<=f)continue;const x=d.tl,_=d.tr,w=d.bl,y=d.br,p=d.mosaicRect,g=d.labelAngle,M=d.minAngle,m=d.maxAngle,I=d.anchor,P=l.index,T=p.x,b=p.y,L=T+p.width,D=b+p.height,B=l.index;l.add(I.x,I.y,x.x,x.y,T,b,g,M,m,f,c,o),l.add(I.x,I.y,_.x,_.y,L,b,g,M,m,f,c,o),l.add(I.x,I.y,w.x,w.y,T,D,g,M,m,f,c,o),l.add(I.x,I.y,y.x,y.y,L,D,g,M,m,f,c,o),t.iconVertexRanges.length>0&&t.iconVertexRanges[0][0]+t.iconVertexRanges[0][1]===B?t.iconVertexRanges[0][1]+=4:t.iconVertexRanges.push([B,4]),h.add(P,P+1,P+2),h.add(P+1,P+2,P+3),u.has(s)?u.get(s)[1]+=6:u.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const t=this._textVertexBuffer,e=this._textIndexBuffer,i=this._glyphMap;for(const[s,n]of this._glyphBufferDataStorage)for(const o of n){const r=t.index,l=o.symbolInstance,h=o.ddAttributes,u=t.index;t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tl[0],o.tl[1],o.xmin,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tr[0],o.tr[1],o.xmax,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.bl[0],o.bl[1],o.xmin,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.br[0],o.br[1],o.xmax,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===u?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([u,4]),e.add(r,r+1,r+2),e.add(r+1,r+2,r+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(t,e,i,s,n){const o=Math.max(i-1,0),r=s===se.VIEWPORT;let l,h,u,d,f,c,x,_,w,y,p;for(const g of e)l=r?0:Math.max(i+$(g.minzoom),o),h=r?25:Math.min(i+$(g.maxzoom),25),!(h<=l)&&(u=g.tl,d=g.tr,f=g.bl,c=g.br,x=g.labelAngle,_=g.minAngle,w=g.maxAngle,y=g.anchor,p=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[y.x,y.y],tl:[u.x,u.y],tr:[d.x,d.y],bl:[f.x,f.y],br:[c.x,c.y],xmin:p.x,ymin:p.y,xmax:p.x+p.width,ymax:p.y+p.height,labelAngle:x,minAngle:_,maxAngle:w,minLod:l,maxLod:h,placementLod:o,symbolInstance:t,ddAttributes:n}))}static _pushAnchors(t,e,i,s){i+=s;let n=0;const o=e.length-1;for(let f=0;f-r;){if(--h,h<0)return!1;o-=V.distance(t[h],l),l=t[h]}o+=V.distance(t[h],t[h+1]);const u=[];let d=0;const f=t.length;for(;on;)d-=u.shift().deviation;if(Math.abs(d)>s)return!1;o+=V.distance(x,w),h=_}return!0}static _smoothVertices(t,e){if(e<=0)return t;let i=t.length;if(i<3)return t;const s=[];let n=0,o=0;s.push(0);for(let _=1;_0&&(n+=w,s.push(n),o++,o!==_&&(t[o]=t[_]))}if(i=o+1,i<3)return t;e=Math.min(e,.2*n);const r=t[0].x,l=t[0].y,h=t[i-1].x,u=t[i-1].y,d=V.sub(t[0],t[1]);d.normalize(),t[0].x+=e*d.x,t[0].y+=e*d.y,d.assignSub(t[i-1],t[i-2]),d.normalize(),t[i-1].x+=e*d.x,t[i-1].y+=e*d.y,s[0]-=e,s[i-1]+=e;const f=[];f.push(new V(r,l));const c=1e-6,x=.5*e;for(let _=1;_=0;g--){const M=x+s[g+1]-s[_];if(M<0)break;const m=s[g+1]-s[g],I=s[_]-s[g]4096&&(r=4096),r<0&&(r=0),l>4096&&(l=4096),l<0&&(l=0);for(let h=1;h4096&&(u=4096),u<0&&(u=0),d>4096&&(d=4096),d<0&&(d=0),f>4096&&(f=4096),f<0&&(f=0),c>4096&&(c=4096),c<0&&(c=0);const x=(u-r)*(c-l)-(f-r)*(d-l);s+=x*(r+u+f),n+=x*(l+d+c),o+=x}s/=3*o,n/=3*o,isNaN(s)||isNaN(n)||t.push(new ge(s,n))}}z._bidiEngine=new lt;var W;(function(a){a[a.INITIALIZED=0]="INITIALIZED",a[a.NO_DATA=1]="NO_DATA",a[a.READY=2]="READY",a[a.MODIFIED=3]="MODIFIED",a[a.INVALID=4]="INVALID"})(W||(W={}));class Tt{constructor(t,e,i,s,n,o){if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=e,this._sourceDataMaxLOD=s,o){this._styleLayerUIDs=new Set;for(const d of o)this._styleLayerUIDs.add(d)}this._styleRepository=n,this._layers=this._styleRepository?.layers??[];const[r,l,h]=e.tileKey.split("/").map(parseFloat);this._level=r;const u=Ye(this._level);for(const d of Object.keys(t)){const f=t[d];if(this._pbfTiles[d]=new Qe(new Uint8Array(f.protobuff),new DataView(f.protobuff)),f.refKey){const[c]=f.refKey.split("/").map(parseFloat),x=r-c;if(x>0){const _=(1<{o.has(u)||(n.push({name:u,repeat:d}),o.add(u))},l={};for(const u of s)u.getResources(u.tileClipper,r,l);if(this._tile.status===W.INVALID)return[];const h=this._fetchResources(n,l,t);return Promise.all([...h,e]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(t){return{signal:t?.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(t){const{sourceNameToTileData:e,zoom:i,layers:s,sourceNameToTileClipper:n,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:r,returnedBuckets:l,layerIdToBucket:h,referencerUIDToReferencedId:u}=t,d=this._sourceDataMaxLOD;for(let f=s.length-1;f>=0;f--){const c=s[f];if(i=c.maxzoom)continue}else if(c.maxzoom&&i>=c.maxzoom)continue;if(c.type===Q.BACKGROUND||!this._canParseStyleLayer(c.uid)||!e[c.source]||!n[c.source])continue;const x=e[c.source],_=n[c.source],w=c.sourceLayer,y=x[w];if(y){let p=r[c.source];if(p||(p=r[c.source]=new Set),p.add(c.sourceLayer),c.refLayerId)u.set(c.uid,c.refLayerId);else{const g=this._createBucket(c);if(g){g.layerUIDs=[c.uid],g.layerExtent=y.extent,g.tileClipper=_;let M=o[c.source];M||(M=o[c.source]={});let m=M[w];m||(m=M[w]=[]),m.push(g),l.push(g),h[c.id]=g}}}}}_linkReferences(t){const{layerIdToBucket:e,referencerUIDToReferencedId:i}=t;i.forEach((s,n)=>{e[s]&&e[s].layerUIDs.push(n)})}_filterFeatures(t){const{signal:e,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:n}=t,o=10*this._level,r=10*(this._level+1),l=[],h=[];for(const u of Object.keys(n))n[u].forEach(d=>{l.push(d),h.push(u)});for(let u=0;u=r)continue;const m=g._maxzoom;if(m&&m<=o)continue}for(const M of x)M.pushFeature(p)}}}_fetchResources(t,e,i){const s=[],n=this._tile.getWorkerTileHandler();let o,r;t.length>0&&(o=n.fetchSprites(t,this._client,i),s.push(o));for(const l in e){const h=e[l];h.size>0&&(r=n.fetchGlyphs(this._tile.tileKey,l,h,this._client,i),s.push(r))}return s}_processFeatures(t){const e=t.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of e)i.processFeatures(i.tileClipper);return e}_parseTileData(t){const e={};for(const i of Object.keys(t)){const s=t[i],n={};for(;s.next();)switch(s.tag()){case 3:{const o=s.getMessage(),r=new rt(o);o.release(),n[r.name]=r;break}default:s.skip()}e[i]=n}return e}_createBucket(t){switch(t.type){case Q.BACKGROUND:return null;case Q.FILL:return this._createFillBucket(t);case Q.LINE:return this._createLineBucket(t);case Q.CIRCLE:return this._createCircleBucket(t);case Q.SYMBOL:return this._createSymbolBucket(t)}}_createFillBucket(t){return new _t(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(t.fillMaterial.getStride()),new ee,new yt(t.outlineMaterial.getStride()),new ee)}_createLineBucket(t){return new It(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new dt(t.lineMaterial.getStride()),new ee)}_createCircleBucket(t){return new pt(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new gt(t.circleMaterial.getStride()),new ee)}_createSymbolBucket(t){const e=this._tile;return new z(e.tileKey,t,this._level,new ze(t.iconMaterial.getStride()),new ee,new ze(t.textMaterial.getStride()),new ee,e.placementEngine,e.getWorkerTileHandler())}}let Dt=class{constructor(a,t,e,i){this.status=W.INITIALIZED,this.placementEngine=new ft,this.tileKey=a,this.refKeys=t,this._workerTileHandler=e,this._styleRepository=i}release(){this.tileKey="",this.refKeys=null,this.status=W.INITIALIZED,this._workerTileHandler=null}async parse(a,t){const e=t?.signal;if(e!=null){const h=()=>{e.removeEventListener("abort",h),this.status=W.INVALID};e.addEventListener("abort",h)}let i;const s={bucketsWithData:[],emptyBuckets:null};try{i=await this._parse(a,t)}catch(h){if(Ue(h))throw h;return{result:s,transferList:[]}}this.status=W.READY;const n=s.bucketsWithData,o=[];for(const h of i)if(h.hasFeatures()){const u=h.serialize();n.push(u)}else o.push(h.layer.uid);const r=[...n];let l=null;return o.length>0&&(l=Uint32Array.from(o),r.push(l.buffer)),s.emptyBuckets=l,{result:s,transferList:r}}setObsolete(){this.status=W.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(a,t){const e=a.sourceName2DataAndRefKey;return Object.keys(e).length===0?[]:(this.status=W.MODIFIED,new Tt(e,this,t.client,a.sourceDataMaxLOD,this._styleRepository,a.styleLayerUIDs).parse(t))}};const bt=25;class Yt{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=bt}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){return this._styleRepository?.layers??[]}async createTileAndParse(t,e){const{key:i}=t,s={};for(const o of Object.keys(t.sourceName2DataAndRefKey)){const r=t.sourceName2DataAndRefKey[o];s[o]=r.refKey}const n=new Dt(i,s,this,this._styleRepository);try{return await n.parse({...t,sourceDataMaxLOD:this._sourceDataMaxLOD},e)}catch(o){if(n.setObsolete(),n.release(),!Ue(o))throw o;return null}}updateStyle(t){if(!t||t.length===0||!this._styleRepository)return;const e=this._styleRepository;for(const i of t){const s=i.type,n=i.data;switch(s){case oe.PAINTER_CHANGED:e.setPaintProperties(n.layer,n.paint);break;case oe.LAYOUT_CHANGED:e.setLayoutProperties(n.layer,n.layout);break;case oe.LAYER_REMOVED:e.deleteStyleLayer(n.layer);break;case oe.LAYER_CHANGED:e.setStyleLayer(n.layer,n.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(t){const{style:e,sourceDataMaxLOD:i}=t;this._styleRepository=new at(e),this._sourceDataMaxLOD=i,this._spriteInfo={},this._glyphInfo={}}fetchSprites(t,e,i){const s=[],n=this._spriteInfo;for(const o of t)n[o.name]===void 0&&s.push(o);return s.length===0?Promise.resolve():e.invoke("getSprites",s,{signal:i?.signal}).then(o=>{for(const r in o){const l=o[r];n[r]=l}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(t,e,i,s,n){const o=[];let r=this._glyphInfo[e];return r?i.forEach(l=>{r[l]||o.push(l)}):(r=this._glyphInfo[e]=[],i.forEach(l=>o.push(l))),o.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:t,font:e,codePoints:o},n).then(l=>{for(let h=0;h=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103&&!(a>=65097&&a<=65103)||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351&&!(a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=12592&&a<=12687||a>=43360&&a<=43391||a>=55216&&a<=55295||a>=4352&&a<=4607||a>=44032&&a<=55215||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12688&&a<=12703||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543&&a!==12540||a>=65280&&a<=65519&&!(a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||a>=65104&&a<=65135&&!(a>=65112&&a<=65118||a>=65123&&a<=65126)||a>=5120&&a<=5759||a>=6320&&a<=6399||a>=65040&&a<=65055||a>=19904&&a<=19967||a>=40960&&a<=42127||a>=42128&&a<=42191)}function ct(a){return!(a<11904)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=65280&&a<=65519||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543||a>=65040&&a<=65055||a>=42128&&a<=42191||a>=40960&&a<=42127)}function ut(a){switch(a){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function ve(a){switch(a){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const K=24,He=17;let Ke=class{constructor(a,t,e,i,s,n,o){this._glyphItems=a,this._maxWidth=t,this._lineHeight=e,this._letterSpacing=i,this._hAnchor=s,this._vAnchor=n,this._justify=o}getShaping(a,t,e){const i=this._letterSpacing,s=this._lineHeight,n=this._justify,o=this._maxWidth,r=[];let l=0,h=0;for(const p of a){const g=p.codePointAt(0);if(g==null)continue;const M=e&&ht(g);let m;for(const I of this._glyphItems)if(m=I[g],m)break;r.push({codePoint:g,x:l,y:h,vertical:M,glyphMosaicItem:m}),m&&(l+=m.metrics.advance+i)}let u=l;o>0&&(u=l/Math.max(1,Math.ceil(l/o)));const d=a.includes("​"),f=[],c=r.length;for(let p=0;pM&&ve(r[m].codePoint);)r[m].glyphMosaicItem=null,--m;if(M<=m){const I=r[M].x;for(let T=M;T<=m;T++)r[T].x-=I,r[T].y=h;let P=r[m].x;r[m].glyphMosaicItem&&(P+=r[m].glyphMosaicItem.metrics.advance),_=Math.max(P,_),n&&this._applyJustification(r,M,m)}y=g,h+=w}if(r.length>0){const p=x.length-1,g=(n-this._hAnchor)*_;let M=(-this._vAnchor*(p+1)+.5)*s;t&&p&&(M+=p*s);for(const m of r)m.x+=g,m.y+=M}return r.filter(p=>p.glyphMosaicItem)}static getTextBox(a,t){if(!a.length)return null;let e=1/0,i=1/0,s=0,n=0;for(const o of a){const r=o.glyphMosaicItem.metrics.advance,l=o.x,h=o.y-He,u=l+r,d=h+t;e=Math.min(e,l),s=Math.max(s,u),i=Math.min(i,h),n=Math.max(n,d)}return{x:e,y:i,width:s-e,height:n-i}}static getBox(a){if(!a.length)return null;let t=1/0,e=1/0,i=0,s=0;for(const n of a){const{height:o,left:r,top:l,width:h}=n.glyphMosaicItem.metrics,u=n.x,d=n.y-(o-Math.abs(l)),f=u+h+r,c=d+o;t=Math.min(t,u),i=Math.max(i,f),e=Math.min(e,d),s=Math.max(s,c)}return{x:t,y:e,width:i-t,height:s-e}}static addDecoration(a,t){const e=a.length;if(e===0)return;const i=3;let s=a[0].x+a[0].glyphMosaicItem.metrics.left,n=a[0].y;for(let r=1;r=0&&o,f=i.allowOverlap&&i.ignorePlacement?null:[],c=[],x=4,_=!d;let w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y;const M=(d||o)&&r,m=i.size/K;let I=!1;for(const D of t)if(D.vertical){I=!0;break}let P,T=0,b=0;if(!d&&I){const D=Ke.getTextBox(t,i.lineHeight*K);switch(i.anchor){case C.LEFT:T=D.height/2,b=-D.width/2;break;case C.RIGHT:T=-D.height/2,b=D.width/2;break;case C.TOP:T=D.height/2,b=D.width/2;break;case C.BOTTOM:T=-D.height/2,b=-D.width/2;break;case C.TOP_LEFT:T=D.height;break;case C.BOTTOM_LEFT:b=-D.width;break;case C.TOP_RIGHT:b=D.width;break;case C.BOTTOM_RIGHT:T=-D.height}}T+=i.offset[0]*K,b+=i.offset[1]*K;for(const D of t){const B=D.glyphMosaicItem;if(!B||B.rect.isEmpty)continue;const A=B.rect,k=B.metrics,E=B.page;if(f&&_){if(P!==void 0&&P!==D.y){let S,F,G,H;I?(S=-g+T,F=w+b,G=g-p,H=y-w):(S=w+T,F=p+b,G=y-w,H=g-p);const q={xTile:a.x,yTile:a.y,dxPixels:S*m-l,dyPixels:F*m-l,hard:!i.optional,partIndex:1,width:G*m+2*l,height:H*m+2*l,angle:n,minLod:X,maxLod:te};f.push(q),w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y}P=D.y}const R=[];if(d){const S=.5*B.metrics.width,F=(D.x+k.left-x+S)*m*le;if(h=this._placeGlyph(a,h,F,e,a.segment,1,D.vertical,E,R),r&&(h=this._placeGlyph(a,h,F,e,a.segment,-1,D.vertical,E,R)),h>=Pe)break}else R.push(new pe(s,u,u,E,!1)),o&&r&&R.push(new pe(s,u+ne,u+ne,E,!1));const N=D.x+k.left,j=D.y-He-k.top,Z=N+k.width,ie=j+k.height;let O,U,he,ce,J,ue,De,be;if(!d&&I)if(D.vertical){const S=(N+Z)/2-k.height/2,F=(j+ie)/2+k.width/2;O=new V(-F-x+T,S-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y)}else O=new V(-j+x+T,N-x+b),U=new V(O.x-A.height,O.y+A.width),he=new V(U.x,O.y),ce=new V(O.x,U.y);else O=new V(N-x+T,j-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y);for(const S of R){let F,G,H,q;if(S.alternateVerticalGlyph){if(!J){const Y=(j+ie)/2+b;J=new V((N+Z)/2+T-k.height/2-x,Y+k.width/2+x),ue=new V(J.x+A.height,J.y-A.width),De=new V(ue.x,J.y),be=new V(J.x,ue.y)}F=J,G=De,H=be,q=ue}else F=O,G=he,H=ce,q=U;const fe=j,Ie=ie,de=S.glyphAngle+n;if(de!==0){const Y=Math.cos(de),xe=Math.sin(de);F=F.clone(),G=G?.clone(),H=H?.clone(),q=q?.clone(),F.rotate(Y,xe),q?.rotate(Y,xe),G?.rotate(Y,xe),H?.rotate(Y,xe)}let re=0,ae=256;if(d&&I?D.vertical?S.alternateVerticalGlyph?(re=32,ae=96):(re=224,ae=32):(re=224,ae=96):(re=192,ae=64),c.push(new Oe(F,H,G,q,A,S.labelAngle,re,ae,S.anchor,S.minzoom,S.maxzoom,S.page)),f&&(!M||this._legible(S.labelAngle))){if(_)Ny&&(y=Z),Ie>g&&(g=Ie);else if(S.minzoom=Pe)return null;if(f&&_){let D,B,A,k;I?(D=-g+T,B=w+b,A=g-p,k=y-w):(D=w+T,B=p+b,A=y-w,k=g-p);const E={xTile:a.x,yTile:a.y,dxPixels:D*m-l,dyPixels:B*m-l,hard:!i.optional,partIndex:1,width:A*m+2*l,height:k*m+2*l,angle:n,minLod:X,maxLod:te};f.push(E)}const L=new Fe(c);return f&&f.length>0&&(L.textColliders=f),L}_legible(a){const t=Ge(a);return t<65||t>=193}_placeGlyph(a,t,e,i,s,n,o,r,l){let h=n;const u=h<0?Ve(a.angle+ne,Ae):a.angle;let d=0;e<0&&(h*=-1,e*=-1,d=ne),h>0&&++s;let f=new V(a.x,a.y),c=i[s],x=te;if(i.length<=s)return x;for(;;){const _=c.x-f.x,w=c.y-f.y,y=Math.sqrt(_*_+w*w),p=Math.max(e/y,t),g=_/y,M=w/y,m=Ve(Math.atan2(M,g)+d,Ae);if(l.push(new pe(f,u,m,r,!1,p,x)),o&&l.push(new pe(f,u,m,r,!0,p,x)),p<=t)return p;f=c.clone();do{if(s+=h,i.length<=s||s<0)return p;c=i[s]}while(f.isEqual(c));let I=c.x-f.x,P=c.y-f.y;const T=Math.sqrt(I*I+P*P);I*=y/T,P*=y/T,f.x-=I,f.y-=P,x=p}}},ee=class extends v{constructor(){super(12)}add(a,t,e){const i=this.array;i.push(a),i.push(t),i.push(e)}},dt=class extends v{constructor(a){super(a)}add(a,t,e,i,s,n,o,r,l,h,u,d){const f=this.array;let c=v.i1616to32(a,t);f.push(c);const x=31;c=v.i8888to32(Math.round(x*e),Math.round(x*i),Math.round(x*s),Math.round(x*n)),f.push(c),c=v.i8888to32(Math.round(x*o),Math.round(x*r),Math.round(x*l),Math.round(x*h)),f.push(c),c=v.i1616to32(u,0),f.push(c),d&&f.push(...d)}},xt=class extends v{constructor(a){super(a)}add(a,t,e){const i=this.array;i.push(v.i1616to32(a,t)),e&&i.push(...e)}};class yt extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r){const l=this.array,h=this.index;let u=v.i1616to32(t,e);l.push(u);const d=15;return u=v.i8888to32(Math.round(d*i),Math.round(d*s),n,o),l.push(u),r&&l.push(...r),h}}class ze extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r,l,h,u,d,f){const c=this.array;let x=v.i1616to32(t,e);c.push(x),x=v.i1616to32(Math.round(8*i),Math.round(8*s)),c.push(x),x=v.i8888to32(n/4,o/4,l,h),c.push(x),x=v.i8888to32(0,Ge(r),10*u,Math.min(10*d,255)),c.push(x),f&&c.push(...f)}}class gt extends v{constructor(t){super(t)}add(t,e,i,s,n){const o=this.array,r=v.i1616to32(2*t+i,2*e+s);o.push(r),n&&o.push(...n)}}class me{constructor(t,e,i){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=i,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,i){}}let pt=class extends me{constructor(a,t,e,i,s){super(a,t,e),this.type=_e.CIRCLE,this._circleVertexBuffer=i,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(a){const t=this._circleVertexBuffer,e=this._circleIndexBuffer;this._circleIndexStart=3*e.index,this._circleIndexCount=0;const i=this.layer,s=this.zoom;a&&a.setExtent(this.layerExtent);for(const n of this._features){const o=n.getGeometry(a);if(!o)continue;const r=i.circleMaterial.encodeAttributes(n,s,i);for(const l of o)if(l)for(const h of l){const u=t.index;t.add(h.x,h.y,0,0,r),t.add(h.x,h.y,0,1,r),t.add(h.x,h.y,1,0,r),t.add(h.x,h.y,1,1,r),e.add(u,u+1,u+2),e.add(u+1,u+2,u+3),this._circleIndexCount+=6}}}serialize(){let a=6;a+=this.layerUIDs.length,a+=this._circleVertexBuffer.array.length,a+=this._circleIndexBuffer.array.length;const t=new Uint32Array(a),e=new Int32Array(t.buffer);let i=0;t[i++]=this.type,t[i++]=this.layerUIDs.length;for(let s=0;sM.page-m.page);for(const{ddFillAttributes:M,ddOutlineAttributes:m,page:I,geometry:P}of c)this._processFeature(P,u,e.outlineUsesFillColor,M,m,f,I)}}else for(const c of d){const x=o?s.encodeAttributes(c,i,e):null,_=u&&r?n.encodeAttributes(c,i,e):null,w=c.getGeometry(t);this._processFeature(w,u,e.outlineUsesFillColor,x,_,f)}}serialize(){let t=10;t+=this.layerUIDs.length,t+=this._fillVertexBuffer.array.length,t+=this._fillIndexBuffer.array.length,t+=this._outlineVertexBuffer.array.length,t+=this._outlineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this._fillVertexBuffer.array.length;for(let r=0;ru?(d!==void 0&&this._processFill(t,d,s,o,r),d=[f]):c<-u&&d!==void 0&&d.push(f)}d!==void 0&&this._processFill(t,d,s,o,r)}_processOutline(t,e){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,n=s.index;let o,r,l;const h=new V(0,0),u=new V(0,0),d=new V(0,0);let f=-1,c=-1,x=-1,_=-1,w=-1,y=!1;const p=0;let g=t.length;if(g<2)return;const M=t[p];let m=t[g-1];for(;g&&m.isEqual(M);)--g,m=t[g-1];if(!(g-p<2)){for(let I=p;I8&&(L=8),T>=0?(x=i.add(r.x,r.y,h.x,h.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,L*-d.x,L*-d.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,d.x,d.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,u.x,u.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x)):(x=i.add(r.x,r.y,L*d.x,L*d.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,-h.x,-h.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,-d.x,-d.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=i.add(r.x,r.y,-u.x,-u.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x))}f>=0&&c>=0&&_>=0&&!y&&s.add(f,c,_),f>=0&&_>=0&&w>=0&&!y&&s.add(f,w,_),this._outlineIndexCount+=3*(s.index-n)}}_processFill(t,e,i,s,n){s=!0;let o;e.length>1&&(o=[]);let r=0;for(const d of e)r!==0&&o.push(r),r+=t[d].length;const l=2*r,h=Be.acquire();for(const d of e){const f=t[d],c=f.length;for(let x=0;x0){const d=e.map(x=>t[x].length),{buffer:f,vertexCount:c}=tt(h,d);if(c>0){const x=this._fillVertexBuffer.index;for(let _=0;_0){const f=this._fillVertexBuffer.index;let c=0;for(;c=4160:t.y===e.y&&(t.y<=-64||t.y>=4160)}static _area(t){let e=0;const i=t.length-1;for(let s=0;sB.page-A.page),n.textured=!0;for(const{ddAttributes:B,page:A,cap:k,join:E,miterLimit:R,roundLimit:N,halfWidth:j,offset:Z,geometry:ie}of D)n.capType=k,n.joinType=E,n.miterLimit=R,n.roundLimit=N,n.halfWidth=j,n.offset=Z,this._processFeature(ie,B,A)}else{if(l){const D=l.getValue(i);if(!this._spriteInfo[D]?.rect)return}n.textured=!(!l&&!h),n.capType=x,n.joinType=p,n.miterLimit=M,n.roundLimit=I,n.halfWidth=.5*T,n.offset=L;for(const D of s){const B=o?r.encodeAttributes(D,i,e):null;c&&(n.capType=c.getValue(i,D)),y&&(n.joinType=y.getValue(i,D)),g&&(n.miterLimit=g.getValue(i,D)),m&&(n.roundLimit=m.getValue(i,D)),P&&(n.halfWidth=.5*P.getValue(i,D)),b&&(n.offset=b.getValue(i,D));const A=D.getGeometry(t);this._processFeature(A,B)}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this.tessellationProperties._lineVertexBuffer.array.length,t+=this.tessellationProperties._lineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let r=0;r(t,e,i,s,n,o,r,l,h,u,d)=>(a._lineVertexBuffer.add(t,e,r,l,i,s,n,o,h,u,d,a._ddValues),a._lineVertexBuffer.index-1),wt=a=>(t,e,i)=>{a._lineIndexBuffer.add(t,e,i)},Ne=10;function Pt(a,t){return a.iconMosaicItem&&t.iconMosaicItem?a.iconMosaicItem.page===t.iconMosaicItem.page?0:a.iconMosaicItem.page-t.iconMosaicItem.page:a.iconMosaicItem&&!t.iconMosaicItem?1:!a.iconMosaicItem&&t.iconMosaicItem?-1:0}class z extends me{constructor(t,e,i,s,n,o,r,l,h){super(e,i,h.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=t,this._iconVertexBuffer=s,this._iconIndexBuffer=n,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(t,e,i){const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const u=[];let d,f,c,x;o&&!o.isDataDriven&&(d=o.getValue(n)),r&&!r.isDataDriven&&(f=r.getValue(n)),l&&l.isDataDriven||(c=s.getLayoutValue("text-transform",n),l=null),h&&h.isDataDriven||(x=s.getLayoutValue("text-font",n),h=null);for(const _ of this._features){const w=_.getGeometry(t);if(!w||w.length===0)continue;let y,p;o&&(y=o.isDataDriven?o.getValue(n,_):this._replaceKeys(d,_.values),y&&e(y));let g=!1;if(r&&(p=r.isDataDriven?r.getValue(n,_):this._replaceKeys(f,_.values),p)){switch(p=p.replaceAll("\\n",` +`),l&&(c=l.getValue(n,_)),c){case Ee.LOWERCASE:p=p.toLowerCase();break;case Ee.UPPERCASE:p=p.toUpperCase()}if(z._bidiEngine.hasBidiChar(p)){let I;I=z._bidiEngine.checkContextual(p)==="rtl"?"IDNNN":"ICNNN",p=z._bidiEngine.bidiTransform(p,I,"VLYSN"),g=!0}if(p.length>0){h&&(x=h.getValue(n,_));for(const I of x){let P=i[I];P||(P=i[I]=new Set);for(const T of p){const b=T.codePointAt(0);b!=null&&P.add(b)}}}}if(!y&&!p)continue;const M=s.getLayoutValue("symbol-sort-key",n,_),m={feature:_,sprite:y,label:p,rtl:g,geometry:w,hash:(p?Le(p):0)^(y?Le(y):0),priority:M,textFont:x};u.push(m)}this._symbolFeatures=u}processFeatures(t){t&&t.setExtent(this.layerExtent);const e=this.layer,i=this.zoom,s=e.getLayoutValue("symbol-placement",i),n=s!==Me.POINT,o=e.getLayoutValue("symbol-spacing",i)*le,r=e.getLayoutProperty("icon-image"),l=e.getLayoutProperty("text-field"),h=r?new ot(e,i,n):null,u=l?new nt(e,i,n):null,d=this._workerTileHandler;let f;r&&(f=d.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const c=[];let x=1;u?.size&&(x=u.size/K);const _=u?u.maxAngle*Te:0,w=u?u.size*le:0;for(const y of this._symbolFeatures){let p;h&&f&&y.sprite&&(p=f[y.sprite],p&&p.sdf&&(this._isIconSDF=!0));let g;p&&h.update(i,y.feature);let M=0;const m=y.label;if(m){qe(u),u.update(i,y.feature);const I=n&&u.rotationAlignment===se.MAP?u.keepUpright:u.writingMode&&u.writingMode.includes(Xe.VERTICAL);let P=.5;switch(u.anchor){case C.TOP_LEFT:case C.LEFT:case C.BOTTOM_LEFT:P=0;break;case C.TOP_RIGHT:case C.RIGHT:case C.BOTTOM_RIGHT:P=1}let T=.5;switch(u.anchor){case C.TOP_LEFT:case C.TOP:case C.TOP_RIGHT:T=0;break;case C.BOTTOM_LEFT:case C.BOTTOM:case C.BOTTOM_RIGHT:T=1}let b=.5;switch(u.justify){case we.AUTO:b=P;break;case we.LEFT:b=0;break;case we.RIGHT:b=1}const L=u.letterSpacing*K,D=n?0:u.maxWidth*K,B=u.lineHeight*K,A=y.textFont.map(k=>d.getGlyphItems(k));if(g=new Ke(A,D,B,L,P,T,b).getShaping(m,y.rtl,I),g&&g.length>0){let k=1e30,E=-1e30;for(const R of g)k=Math.min(k,R.x),E=Math.max(E,R.x);M=(E-k+2*K)*x*le}}for(let I of y.geometry){const P=[];if(s===Me.LINE){if(g?.length&&u?.size){const T=u.size*le*(2+Math.min(2,4*Math.abs(u.offset[1])));I=z._smoothVertices(I,T)}z._pushAnchors(P,I,o,M)}else s===Me.LINE_CENTER?z._pushCenterAnchor(P,I):y.feature.type===Je.Polygon?z._pushCentroid(P,I):P.push(new ge(I[0].x,I[0].y));for(const T of P){if(T.x<0||T.x>Re||T.y<0||T.y>Re||n&&M>0&&u?.rotationAlignment===se.MAP&&!z._honorsTextMaxAngle(I,T,M,_,w))continue;const b={shaping:g,line:I,iconMosaicItem:p,anchor:T,symbolFeature:y,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};c.push(b),this._processFeature(b,h,u)}}}c.sort(Pt),this._addPlacedGlyphs(),this._symbolInstances=c}serialize(){let t=14;t+=this.layerUIDs.length,t+=3*this.markerPageMap.size,t+=3*this.glyphsPageMap.size,t+=z._symbolsSerializationLength(this._symbolInstances),t+=this._iconVertexBuffer.array.length,t+=this._iconIndexBuffer.array.length,t+=this._textVertexBuffer.array.length,t+=this._textIndexBuffer.array.length;const e=new Uint32Array(t),i=new Int32Array(e.buffer),s=new Float32Array(e.buffer),[n,o,r]=this._sourceTileKey.split("/");let l=0;e[l++]=this.type,e[l++]=this.layerUIDs.length;for(let h=0;hs in e?e[s]:"")}_processFeature(t,e,i){const{line:s,iconMosaicItem:n,shaping:o,anchor:r}=t,l=this.zoom,h=this.layer,u=!!n;let d=!0;u&&(d=e?.optional||!n);const f=o&&o.length>0,c=!f||i?.optional;let x,_;if(u&&(x=this._placementEngine.getIconPlacement(r,n,e)),(x||d)&&(f&&(_=this._placementEngine.getTextPlacement(r,o,s,i)),_||c)){if(x&&_||(c||d?c||_?d||x||(_=null):x=null:(x=null,_=null)),_){const w=h.hasDataDrivenText?h.textMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(t,_.shapes,l,i.rotationAlignment,w),_.textColliders){t.textColliders=_.textColliders;for(const y of _.textColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}if(x){const w=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(t,x.shapes,l,n.page,e.rotationAlignment===se.VIEWPORT,w),x.iconColliders){t.iconColliders=x.iconColliders;for(const y of x.iconColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}}}_addPlacedIcons(t,e,i,s,n,o){const r=Math.max(i-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,u=this._markerMap;for(const d of e){const f=n?0:Math.max(i+$(d.minzoom),r),c=n?25:Math.min(i+$(d.maxzoom),25);if(c<=f)continue;const x=d.tl,_=d.tr,w=d.bl,y=d.br,p=d.mosaicRect,g=d.labelAngle,M=d.minAngle,m=d.maxAngle,I=d.anchor,P=l.index,T=p.x,b=p.y,L=T+p.width,D=b+p.height,B=l.index;l.add(I.x,I.y,x.x,x.y,T,b,g,M,m,f,c,o),l.add(I.x,I.y,_.x,_.y,L,b,g,M,m,f,c,o),l.add(I.x,I.y,w.x,w.y,T,D,g,M,m,f,c,o),l.add(I.x,I.y,y.x,y.y,L,D,g,M,m,f,c,o),t.iconVertexRanges.length>0&&t.iconVertexRanges[0][0]+t.iconVertexRanges[0][1]===B?t.iconVertexRanges[0][1]+=4:t.iconVertexRanges.push([B,4]),h.add(P,P+1,P+2),h.add(P+1,P+2,P+3),u.has(s)?u.get(s)[1]+=6:u.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const t=this._textVertexBuffer,e=this._textIndexBuffer,i=this._glyphMap;for(const[s,n]of this._glyphBufferDataStorage)for(const o of n){const r=t.index,l=o.symbolInstance,h=o.ddAttributes,u=t.index;t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tl[0],o.tl[1],o.xmin,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tr[0],o.tr[1],o.xmax,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.bl[0],o.bl[1],o.xmin,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.br[0],o.br[1],o.xmax,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===u?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([u,4]),e.add(r,r+1,r+2),e.add(r+1,r+2,r+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(t,e,i,s,n){const o=Math.max(i-1,0),r=s===se.VIEWPORT;let l,h,u,d,f,c,x,_,w,y,p;for(const g of e)l=r?0:Math.max(i+$(g.minzoom),o),h=r?25:Math.min(i+$(g.maxzoom),25),!(h<=l)&&(u=g.tl,d=g.tr,f=g.bl,c=g.br,x=g.labelAngle,_=g.minAngle,w=g.maxAngle,y=g.anchor,p=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[y.x,y.y],tl:[u.x,u.y],tr:[d.x,d.y],bl:[f.x,f.y],br:[c.x,c.y],xmin:p.x,ymin:p.y,xmax:p.x+p.width,ymax:p.y+p.height,labelAngle:x,minAngle:_,maxAngle:w,minLod:l,maxLod:h,placementLod:o,symbolInstance:t,ddAttributes:n}))}static _pushAnchors(t,e,i,s){i+=s;let n=0;const o=e.length-1;for(let f=0;f-r;){if(--h,h<0)return!1;o-=V.distance(t[h],l),l=t[h]}o+=V.distance(t[h],t[h+1]);const u=[];let d=0;const f=t.length;for(;on;)d-=u.shift().deviation;if(Math.abs(d)>s)return!1;o+=V.distance(x,w),h=_}return!0}static _smoothVertices(t,e){if(e<=0)return t;let i=t.length;if(i<3)return t;const s=[];let n=0,o=0;s.push(0);for(let _=1;_0&&(n+=w,s.push(n),o++,o!==_&&(t[o]=t[_]))}if(i=o+1,i<3)return t;e=Math.min(e,.2*n);const r=t[0].x,l=t[0].y,h=t[i-1].x,u=t[i-1].y,d=V.sub(t[0],t[1]);d.normalize(),t[0].x+=e*d.x,t[0].y+=e*d.y,d.assignSub(t[i-1],t[i-2]),d.normalize(),t[i-1].x+=e*d.x,t[i-1].y+=e*d.y,s[0]-=e,s[i-1]+=e;const f=[];f.push(new V(r,l));const c=1e-6,x=.5*e;for(let _=1;_=0;g--){const M=x+s[g+1]-s[_];if(M<0)break;const m=s[g+1]-s[g],I=s[_]-s[g]4096&&(r=4096),r<0&&(r=0),l>4096&&(l=4096),l<0&&(l=0);for(let h=1;h4096&&(u=4096),u<0&&(u=0),d>4096&&(d=4096),d<0&&(d=0),f>4096&&(f=4096),f<0&&(f=0),c>4096&&(c=4096),c<0&&(c=0);const x=(u-r)*(c-l)-(f-r)*(d-l);s+=x*(r+u+f),n+=x*(l+d+c),o+=x}s/=3*o,n/=3*o,isNaN(s)||isNaN(n)||t.push(new ge(s,n))}}z._bidiEngine=new lt;var W;(function(a){a[a.INITIALIZED=0]="INITIALIZED",a[a.NO_DATA=1]="NO_DATA",a[a.READY=2]="READY",a[a.MODIFIED=3]="MODIFIED",a[a.INVALID=4]="INVALID"})(W||(W={}));class Tt{constructor(t,e,i,s,n,o){if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=e,this._sourceDataMaxLOD=s,o){this._styleLayerUIDs=new Set;for(const d of o)this._styleLayerUIDs.add(d)}this._styleRepository=n,this._layers=this._styleRepository?.layers??[];const[r,l,h]=e.tileKey.split("/").map(parseFloat);this._level=r;const u=Ye(this._level);for(const d of Object.keys(t)){const f=t[d];if(this._pbfTiles[d]=new Qe(new Uint8Array(f.protobuff),new DataView(f.protobuff)),f.refKey){const[c]=f.refKey.split("/").map(parseFloat),x=r-c;if(x>0){const _=(1<{o.has(u)||(n.push({name:u,repeat:d}),o.add(u))},l={};for(const u of s)u.getResources(u.tileClipper,r,l);if(this._tile.status===W.INVALID)return[];const h=this._fetchResources(n,l,t);return Promise.all([...h,e]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(t){return{signal:t?.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(t){const{sourceNameToTileData:e,zoom:i,layers:s,sourceNameToTileClipper:n,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:r,returnedBuckets:l,layerIdToBucket:h,referencerUIDToReferencedId:u}=t,d=this._sourceDataMaxLOD;for(let f=s.length-1;f>=0;f--){const c=s[f];if(i=c.maxzoom)continue}else if(c.maxzoom&&i>=c.maxzoom)continue;if(c.type===Q.BACKGROUND||!this._canParseStyleLayer(c.uid)||!e[c.source]||!n[c.source])continue;const x=e[c.source],_=n[c.source],w=c.sourceLayer,y=x[w];if(y){let p=r[c.source];if(p||(p=r[c.source]=new Set),p.add(c.sourceLayer),c.refLayerId)u.set(c.uid,c.refLayerId);else{const g=this._createBucket(c);if(g){g.layerUIDs=[c.uid],g.layerExtent=y.extent,g.tileClipper=_;let M=o[c.source];M||(M=o[c.source]={});let m=M[w];m||(m=M[w]=[]),m.push(g),l.push(g),h[c.id]=g}}}}}_linkReferences(t){const{layerIdToBucket:e,referencerUIDToReferencedId:i}=t;i.forEach((s,n)=>{e[s]&&e[s].layerUIDs.push(n)})}_filterFeatures(t){const{signal:e,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:n}=t,o=10*this._level,r=10*(this._level+1),l=[],h=[];for(const u of Object.keys(n))n[u].forEach(d=>{l.push(d),h.push(u)});for(let u=0;u=r)continue;const m=g._maxzoom;if(m&&m<=o)continue}for(const M of x)M.pushFeature(p)}}}_fetchResources(t,e,i){const s=[],n=this._tile.getWorkerTileHandler();let o,r;t.length>0&&(o=n.fetchSprites(t,this._client,i),s.push(o));for(const l in e){const h=e[l];h.size>0&&(r=n.fetchGlyphs(this._tile.tileKey,l,h,this._client,i),s.push(r))}return s}_processFeatures(t){const e=t.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of e)i.processFeatures(i.tileClipper);return e}_parseTileData(t){const e={};for(const i of Object.keys(t)){const s=t[i],n={};for(;s.next();)switch(s.tag()){case 3:{const o=s.getMessage(),r=new rt(o);o.release(),n[r.name]=r;break}default:s.skip()}e[i]=n}return e}_createBucket(t){switch(t.type){case Q.BACKGROUND:return null;case Q.FILL:return this._createFillBucket(t);case Q.LINE:return this._createLineBucket(t);case Q.CIRCLE:return this._createCircleBucket(t);case Q.SYMBOL:return this._createSymbolBucket(t)}}_createFillBucket(t){return new _t(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(t.fillMaterial.getStride()),new ee,new yt(t.outlineMaterial.getStride()),new ee)}_createLineBucket(t){return new It(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new dt(t.lineMaterial.getStride()),new ee)}_createCircleBucket(t){return new pt(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new gt(t.circleMaterial.getStride()),new ee)}_createSymbolBucket(t){const e=this._tile;return new z(e.tileKey,t,this._level,new ze(t.iconMaterial.getStride()),new ee,new ze(t.textMaterial.getStride()),new ee,e.placementEngine,e.getWorkerTileHandler())}}let Dt=class{constructor(a,t,e,i){this.status=W.INITIALIZED,this.placementEngine=new ft,this.tileKey=a,this.refKeys=t,this._workerTileHandler=e,this._styleRepository=i}release(){this.tileKey="",this.refKeys=null,this.status=W.INITIALIZED,this._workerTileHandler=null}async parse(a,t){const e=t?.signal;if(e!=null){const h=()=>{e.removeEventListener("abort",h),this.status=W.INVALID};e.addEventListener("abort",h)}let i;const s={bucketsWithData:[],emptyBuckets:null};try{i=await this._parse(a,t)}catch(h){if(Ue(h))throw h;return{result:s,transferList:[]}}this.status=W.READY;const n=s.bucketsWithData,o=[];for(const h of i)if(h.hasFeatures()){const u=h.serialize();n.push(u)}else o.push(h.layer.uid);const r=[...n];let l=null;return o.length>0&&(l=Uint32Array.from(o),r.push(l.buffer)),s.emptyBuckets=l,{result:s,transferList:r}}setObsolete(){this.status=W.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(a,t){const e=a.sourceName2DataAndRefKey;return Object.keys(e).length===0?[]:(this.status=W.MODIFIED,new Tt(e,this,t.client,a.sourceDataMaxLOD,this._styleRepository,a.styleLayerUIDs).parse(t))}};const bt=25;class Yt{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=bt}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){return this._styleRepository?.layers??[]}async createTileAndParse(t,e){const{key:i}=t,s={};for(const o of Object.keys(t.sourceName2DataAndRefKey)){const r=t.sourceName2DataAndRefKey[o];s[o]=r.refKey}const n=new Dt(i,s,this,this._styleRepository);try{return await n.parse({...t,sourceDataMaxLOD:this._sourceDataMaxLOD},e)}catch(o){if(n.setObsolete(),n.release(),!Ue(o))throw o;return null}}updateStyle(t){if(!t||t.length===0||!this._styleRepository)return;const e=this._styleRepository;for(const i of t){const s=i.type,n=i.data;switch(s){case oe.PAINTER_CHANGED:e.setPaintProperties(n.layer,n.paint);break;case oe.LAYOUT_CHANGED:e.setLayoutProperties(n.layer,n.layout);break;case oe.LAYER_REMOVED:e.deleteStyleLayer(n.layer);break;case oe.LAYER_CHANGED:e.setStyleLayer(n.layer,n.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(t){const{style:e,sourceDataMaxLOD:i}=t;this._styleRepository=new at(e),this._sourceDataMaxLOD=i,this._spriteInfo={},this._glyphInfo={}}fetchSprites(t,e,i){const s=[],n=this._spriteInfo;for(const o of t)n[o.name]===void 0&&s.push(o);return s.length===0?Promise.resolve():e.invoke("getSprites",s,{signal:i?.signal}).then(o=>{for(const r in o){const l=o[r];n[r]=l}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(t,e,i,s,n){const o=[];let r=this._glyphInfo[e];return r?i.forEach(l=>{r[l]||o.push(l)}):(r=this._glyphInfo[e]=[],i.forEach(l=>o.push(l))),o.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:t,font:e,codePoints:o},n).then(l=>{for(let h=0;hk(this)),this.guid=`calcite-action-${C()}`,this.indicatorId=`${this.guid}-indicator`,this.buttonId=`${this.guid}-button`,this.handleTooltipSlotChange=t=>{const i=t.target.assignedElements({flatten:!0}).filter(a=>a?.matches("calcite-tooltip"))[0];i&&(i.referenceElement=this.buttonEl)},this.active=!1,this.alignment=void 0,this.appearance="solid",this.compact=!1,this.disabled=!1,this.icon=void 0,this.iconFlipRtl=!1,this.indicator=!1,this.label=void 0,this.loading=!1,this.scale="m",this.text=void 0,this.textEnabled=!1,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0}onMessagesChange(){}effectiveLocaleChange(){R(this,this.effectiveLocale)}connectedCallback(){O(this),W(this),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}async componentWillLoad(){$(this),w()&&await j(this)}componentDidLoad(){L(this)}disconnectedCallback(){M(this),H(this),this.mutationObserver?.disconnect()}componentDidRender(){E(this)}async setFocus(){await T(this),this.buttonEl?.focus()}renderTextContainer(){const{text:t,textEnabled:i}=this,a={[o.textContainer]:!0,[o.textContainerVisible]:i};return t?e("div",{class:a,key:"text-container"},t):null}renderIndicatorText(){const{indicator:t,messages:i,indicatorId:a,buttonId:n}=this;return e("div",{"aria-labelledby":n,"aria-live":"polite",class:o.indicatorText,id:a,role:"region"},t?i.indicator:null)}renderIconContainer(){const{loading:t,icon:i,scale:a,el:n,iconFlipRtl:s,indicator:l}=this,d=a==="l"?"l":"m",u=t?e("calcite-loader",{inline:!0,label:this.messages.loading,scale:d}):null,c=i?e("calcite-icon",{class:{[o.indicatorWithIcon]:l},flipRtl:s,icon:i,scale:F(this.scale)}):null,r=u||c,b=r||n.children?.length,h=e("div",{class:{[o.slotContainer]:!0,[o.slotContainerHidden]:t}},e("slot",null));return b?e("div",{"aria-hidden":"true",class:o.iconContainer,key:"icon-container"},r,h):null}render(){const{active:t,compact:i,disabled:a,icon:n,loading:s,textEnabled:l,label:d,text:u,indicator:c,indicatorId:r,buttonId:b,messages:h}=this,p=d||u,m=p?`${p}${c?` (${h.indicator})`:""}`:"",f={[o.button]:!0,[o.buttonTextVisible]:l,[o.buttonCompact]:i};return e(z,{key:"3b459307dcb6f8d373e70cd5c7a45d122565a70e"},e(I,{key:"3a81f1fb62a66f1dbd608f095ed90f2d47a9daf6",disabled:a},e("button",{key:"bb5249babc116d462becd6b9a056ca0d368c6e09","aria-busy":v(s),"aria-controls":c?r:null,"aria-label":m,"aria-pressed":v(t),class:f,disabled:a,id:b,ref:g=>this.buttonEl=g},this.renderIconContainer(),this.renderTextContainer(),!n&&c&&e("div",{class:o.indicatorWithoutIcon,key:"indicator-no-icon"})),e("slot",{key:"983989711d64076eca866c1928f9c777331fcba4",name:_.tooltip,onSlotchange:this.handleTooltipSlotChange}),this.renderIndicatorText()))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return A}},[1,"calcite-action",{active:[516],alignment:[513],appearance:[513],compact:[516],disabled:[516],icon:[1],iconFlipRtl:[516,"icon-flip-rtl"],indicator:[516],label:[1],loading:[516],scale:[513],text:[1],textEnabled:[516,"text-enabled"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function G(){typeof customElements>"u"||["calcite-action","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-action":customElements.get(t)||customElements.define(t,B);break;case"calcite-icon":customElements.get(t)||S();break;case"calcite-loader":customElements.get(t)||V();break}})}G();export{B as f,G as m}; diff --git a/main/assets/action-GCQoufcz-D2daq3Sk.js b/main/assets/action-GCQoufcz-D2daq3Sk.js new file mode 100644 index 000000000..23fdaefad --- /dev/null +++ b/main/assets/action-GCQoufcz-D2daq3Sk.js @@ -0,0 +1,21 @@ +import{p as x,b as y,n as k,c as w,a as e,D as z}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{A as v}from"./dom-N58V0tYi-DBU3jlah.js";import{i as C}from"./guid-Dls486Er-CBh637k4.js";import{l as E,p as I}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{o as $,r as L,f as T}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{K as O,q as M}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{c as D}from"./observers-BigwqTsw-Du14S4xc.js";import{e as F}from"./component-CWGf1hug-BASJpoEG.js";import{l as R,d as W,h as j,M as H}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{m as S}from"./icon-BXFbBbop-Du8Zws1L.js";import{v as V}from"./loader-Ch7Jr16w-BlGvYEIO.js";const o={button:"button",buttonTextVisible:"button--text-visible",buttonCompact:"button--compact",indicatorText:"indicator-text",iconContainer:"icon-container",slotContainer:"slot-container",slotContainerHidden:"slot-container--hidden",textContainer:"text-container",textContainerVisible:"text-container--visible",indicatorWithIcon:"indicator-with-icon",indicatorWithoutIcon:"indicator-without-icon"},_={tooltip:"tooltip"},q=`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;background-color:transparent}:host,button{border-end-end-radius:var(--calcite-action-corner-radius-end-end, var(--calcite-action-corner-radius, var(--calcite-corner-radius)));border-end-start-radius:var(--calcite-action-corner-radius-end-start, var(--calcite-action-corner-radius, var(--calcite-corner-radius)));border-start-end-radius:var(--calcite-action-corner-radius-start-end, var(--calcite-action-corner-radius, var(--calcite-corner-radius)));border-start-start-radius:var(--calcite-action-corner-radius-start-start, var(--calcite-action-corner-radius, var(--calcite-corner-radius)))}.button{position:relative;margin:0px;display:flex;inline-size:auto;cursor:pointer;align-items:center;justify-content:flex-start;border-style:none;font-family:var(--calcite-font-family);font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1));color:var(--calcite-action-text-color, var(--calcite-color-text-3));text-align:unset;flex:1 0 auto}.button:hover,.button:focus{background-color:var(--calcite-action-background-color-hover, var(--calcite-color-foreground-2));color:var(--calcite-action-text-color-pressed, var(--calcite-color-text-1))}.button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.button:active{background-color:var(--calcite-action-background-color-pressed, var(--calcite-color-foreground-3))}.icon-container{pointer-events:none;margin:0px;display:flex;align-items:center;justify-content:center;min-inline-size:1rem;min-block-size:1.5rem}.text-container{margin:0px;inline-size:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5rem;opacity:0;transition-property:opacity;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-property:margin;transition-property:inline-size}.text-container--visible{inline-size:auto;flex:1 1 auto;opacity:1}:host([active]) .button,:host([active]) .button:hover,:host([active]) .button:focus{color:var(--calcite-action-text-color-pressed, var(--calcite-color-text-1));background-color:var(--calcite-action-background-color-pressed, var(--calcite-color-foreground-3))}:host([active]) .button:active{background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1))}:host([loading]) .button:hover,:host([loading]) .button:focus{background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1))}:host([loading]) .text-container{opacity:var(--calcite-opacity-disabled)}:host([loading]) calcite-loader[inline]{margin-inline-end:0px}:host([appearance=transparent]) .button{background-color:transparent;transition-property:box-shadow;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host([appearance=transparent]) .button:hover,:host([appearance=transparent]) .button:focus{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]) .button:active{background-color:var(--calcite-color-transparent-press)}:host([data-active]) .button{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host([scale=s]) .button{padding-inline:0.5rem;padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=s]) .button--text-visible .icon-container{margin-inline-end:0.5rem}:host([scale=m]) .button{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=m]) .button--text-visible .icon-container{margin-inline-end:0.75rem}:host([scale=l]) .button{padding:1.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=l]) .button--text-visible .icon-container{margin-inline-end:1rem}:host([alignment=center]) .button{justify-content:center}:host([alignment=end]) .button{justify-content:flex-end}:host([alignment=center]) .button .text-container--visible,:host([alignment=end]) .button .text-container--visible{flex:0 1 auto}:host([scale=s][compact]) .button,:host([scale=m][compact]) .button,:host([scale=l][compact]) .button{padding-inline:0px}.slot-container{display:flex}.slot-container--hidden{display:none}.button--text-visible{inline-size:100%}.indicator-with-icon{position:relative}.indicator-with-icon::after{content:"";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;inset-block-end:-0.275rem;inset-inline-end:-0.275rem;background-color:var(--calcite-action-indicator-color, var(--calcite-color-brand))}.indicator-without-icon{margin-inline:0.25rem;inline-size:1rem;position:relative}.indicator-without-icon::after{content:"";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;inset-block-end:-0.275rem;inset-inline-end:-0.275rem;background-color:var(--calcite-action-indicator-color, var(--calcite-color-brand))}.indicator-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) .button,:host([disabled]) .button:hover,:host([disabled]) .button:focus{cursor:default;background-color:var(--calcite-color-foreground-1);opacity:var(--calcite-opacity-disabled)}:host([disabled]):host([active]) .button,:host([disabled]):host([active]) .button:hover,:host([disabled]):host([active]) .button:focus{background-color:var(--calcite-color-foreground-3);opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,A=q,B=x(class extends y{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=D("mutation",()=>k(this)),this.guid=`calcite-action-${C()}`,this.indicatorId=`${this.guid}-indicator`,this.buttonId=`${this.guid}-button`,this.handleTooltipSlotChange=t=>{const i=t.target.assignedElements({flatten:!0}).filter(a=>a?.matches("calcite-tooltip"))[0];i&&(i.referenceElement=this.buttonEl)},this.active=!1,this.alignment=void 0,this.appearance="solid",this.compact=!1,this.disabled=!1,this.icon=void 0,this.iconFlipRtl=!1,this.indicator=!1,this.label=void 0,this.loading=!1,this.scale="m",this.text=void 0,this.textEnabled=!1,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0}onMessagesChange(){}effectiveLocaleChange(){R(this,this.effectiveLocale)}connectedCallback(){O(this),W(this),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}async componentWillLoad(){$(this),w()&&await j(this)}componentDidLoad(){L(this)}disconnectedCallback(){M(this),H(this),this.mutationObserver?.disconnect()}componentDidRender(){E(this)}async setFocus(){await T(this),this.buttonEl?.focus()}renderTextContainer(){const{text:t,textEnabled:i}=this,a={[o.textContainer]:!0,[o.textContainerVisible]:i};return t?e("div",{class:a,key:"text-container"},t):null}renderIndicatorText(){const{indicator:t,messages:i,indicatorId:a,buttonId:n}=this;return e("div",{"aria-labelledby":n,"aria-live":"polite",class:o.indicatorText,id:a,role:"region"},t?i.indicator:null)}renderIconContainer(){const{loading:t,icon:i,scale:a,el:n,iconFlipRtl:s,indicator:l}=this,d=a==="l"?"l":"m",u=t?e("calcite-loader",{inline:!0,label:this.messages.loading,scale:d}):null,c=i?e("calcite-icon",{class:{[o.indicatorWithIcon]:l},flipRtl:s,icon:i,scale:F(this.scale)}):null,r=u||c,b=r||n.children?.length,h=e("div",{class:{[o.slotContainer]:!0,[o.slotContainerHidden]:t}},e("slot",null));return b?e("div",{"aria-hidden":"true",class:o.iconContainer,key:"icon-container"},r,h):null}render(){const{active:t,compact:i,disabled:a,icon:n,loading:s,textEnabled:l,label:d,text:u,indicator:c,indicatorId:r,buttonId:b,messages:h}=this,p=d||u,m=p?`${p}${c?` (${h.indicator})`:""}`:"",f={[o.button]:!0,[o.buttonTextVisible]:l,[o.buttonCompact]:i};return e(z,{key:"3b459307dcb6f8d373e70cd5c7a45d122565a70e"},e(I,{key:"3a81f1fb62a66f1dbd608f095ed90f2d47a9daf6",disabled:a},e("button",{key:"bb5249babc116d462becd6b9a056ca0d368c6e09","aria-busy":v(s),"aria-controls":c?r:null,"aria-label":m,"aria-pressed":v(t),class:f,disabled:a,id:b,ref:g=>this.buttonEl=g},this.renderIconContainer(),this.renderTextContainer(),!n&&c&&e("div",{class:o.indicatorWithoutIcon,key:"indicator-no-icon"})),e("slot",{key:"983989711d64076eca866c1928f9c777331fcba4",name:_.tooltip,onSlotchange:this.handleTooltipSlotChange}),this.renderIndicatorText()))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return A}},[1,"calcite-action",{active:[516],alignment:[513],appearance:[513],compact:[516],disabled:[516],icon:[1],iconFlipRtl:[516,"icon-flip-rtl"],indicator:[516],label:[1],loading:[516],scale:[513],text:[1],textEnabled:[516,"text-enabled"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function G(){typeof customElements>"u"||["calcite-action","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-action":customElements.get(t)||customElements.define(t,B);break;case"calcite-icon":customElements.get(t)||S();break;case"calcite-loader":customElements.get(t)||V();break}})}G();export{B as f,G as m}; diff --git a/main/assets/action-group-DhwU7QZv-D6TFqyAr.js b/main/assets/action-group-DhwU7QZv-D6TFqyAr.js deleted file mode 100644 index 032937664..000000000 --- a/main/assets/action-group-DhwU7QZv-D6TFqyAr.js +++ /dev/null @@ -1 +0,0 @@ -import{p as d,b as p,a as t}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{s as h,c as g}from"./conditionalSlot-DsCzytJ4-Ay0m1nEb.js";import{f,o as v,r as b}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{K as x,q as y}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{l as M,d as k,M as O,h as C}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{_ as s,K as P,O as E}from"./action-menu-DTIJuZNc-DM_2ZtiL.js";import{G as L}from"./dom-N58V0tYi-DBU3jlah.js";import{m as A}from"./action-GCQoufcz-Cwgl1KRC.js";import{m as w}from"./icon-BXFbBbop-O5hL8B42.js";import{v as z}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";const i={menuActions:"menu-actions",menuTooltip:"menu-tooltip"},_={menu:"ellipsis"},F={container:"container"},H=':host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:flex;flex-direction:column;padding:0px;background-color:transparent;border-color:var(--calcite-action-group-border-color, var(--calcite-color-border-3));border-style:solid;border-width:0}.container{display:flex;flex-grow:1;flex-direction:column}:host([columns="1"]){--calcite-internal-action-group-columns:1}:host([columns="2"]){--calcite-internal-action-group-columns:2}:host([columns="3"]){--calcite-internal-action-group-columns:3}:host([columns="4"]){--calcite-internal-action-group-columns:4}:host([columns="5"]){--calcite-internal-action-group-columns:5}:host([columns="6"]){--calcite-internal-action-group-columns:6}:host(:first-child){padding-block-start:0px}:host([layout=horizontal]),:host([layout=horizontal]) .container{flex-direction:row}:host([layout=grid]){display:grid}:host([layout=grid]) .container{display:grid;place-content:stretch;background-color:transparent;grid-template-columns:repeat(var(--calcite-action-group-columns, var(--calcite-internal-action-group-columns, 3)), auto);gap:var(--calcite-action-group-gap, 1px);padding:var(--calcite-action-group-gap, 1px)}:host([hidden]){display:none}[hidden]{display:none}',$=H,S=d(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.setMenuOpen=e=>{this.menuOpen=!!e.target.open},this.handleMenuActionsSlotChange=e=>{this.hasMenuActions=L(e)},this.expanded=!1,this.label=void 0,this.layout="vertical",this.columns=void 0,this.menuOpen=!1,this.overlayPositioning="absolute",this.scale=void 0,this.menuFlipPlacements=void 0,this.menuPlacement=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.hasMenuActions=!1}expandedHandler(){this.menuOpen=!1}onMessagesChange(){}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await f(this),this.el.focus()}connectedCallback(){x(this),k(this),h(this)}disconnectedCallback(){y(this),O(this),g(this)}async componentWillLoad(){v(this),await C(this)}componentDidLoad(){b(this)}renderMenu(){const{expanded:e,menuOpen:c,scale:o,layout:a,messages:n,overlayPositioning:l,hasMenuActions:r,menuFlipPlacements:m,menuPlacement:u}=this;return t("calcite-action-menu",{expanded:e,flipPlacements:m??(a==="horizontal"?["top","bottom"]:["left","right"]),hidden:!r,label:n.more,onCalciteActionMenuOpen:this.setMenuOpen,open:c,overlayPositioning:l,placement:u??(a==="horizontal"?"bottom-start":"leading-start"),scale:o},t("calcite-action",{icon:_.menu,scale:o,slot:s.trigger,text:n.more,textEnabled:e}),t("slot",{name:i.menuActions,onSlotchange:this.handleMenuActionsSlotChange}),t("slot",{name:i.menuTooltip,slot:s.tooltip}))}render(){return t("div",{key:"8143606c5745053f15140f34ff5ea375a683325f","aria-label":this.label,class:F.container,role:"group"},t("slot",{key:"e8c2821b9ce2e9d0293478989fc31d24f043f9c3"}),this.renderMenu())}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return $}},[17,"calcite-action-group",{expanded:[516],label:[1],layout:[513],columns:[514],menuOpen:[1540,"menu-open"],overlayPositioning:[513,"overlay-positioning"],scale:[513],menuFlipPlacements:[16],menuPlacement:[513,"menu-placement"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],hasMenuActions:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function D(){typeof customElements>"u"||["calcite-action-group","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-group":customElements.get(e)||customElements.define(e,S);break;case"calcite-action":customElements.get(e)||A();break;case"calcite-action-menu":customElements.get(e)||E();break;case"calcite-icon":customElements.get(e)||w();break;case"calcite-loader":customElements.get(e)||z();break;case"calcite-popover":customElements.get(e)||P();break}})}D();export{S as c,D as l,i as o}; diff --git a/main/assets/action-group-DhwU7QZv-Xo45JeJh.js b/main/assets/action-group-DhwU7QZv-Xo45JeJh.js new file mode 100644 index 000000000..d1b090d3a --- /dev/null +++ b/main/assets/action-group-DhwU7QZv-Xo45JeJh.js @@ -0,0 +1 @@ +import{p as d,b as p,a as t}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{s as h,c as g}from"./conditionalSlot-DsCzytJ4-DxmRN7Hl.js";import{f,o as v,r as b}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{K as x,q as y}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{l as M,d as k,M as O,h as C}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{_ as s,K as P,O as E}from"./action-menu-DTIJuZNc-BWLxzbAy.js";import{G as L}from"./dom-N58V0tYi-DBU3jlah.js";import{m as A}from"./action-GCQoufcz-D2daq3Sk.js";import{m as w}from"./icon-BXFbBbop-Du8Zws1L.js";import{v as z}from"./loader-Ch7Jr16w-BlGvYEIO.js";const i={menuActions:"menu-actions",menuTooltip:"menu-tooltip"},_={menu:"ellipsis"},F={container:"container"},H=':host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:flex;flex-direction:column;padding:0px;background-color:transparent;border-color:var(--calcite-action-group-border-color, var(--calcite-color-border-3));border-style:solid;border-width:0}.container{display:flex;flex-grow:1;flex-direction:column}:host([columns="1"]){--calcite-internal-action-group-columns:1}:host([columns="2"]){--calcite-internal-action-group-columns:2}:host([columns="3"]){--calcite-internal-action-group-columns:3}:host([columns="4"]){--calcite-internal-action-group-columns:4}:host([columns="5"]){--calcite-internal-action-group-columns:5}:host([columns="6"]){--calcite-internal-action-group-columns:6}:host(:first-child){padding-block-start:0px}:host([layout=horizontal]),:host([layout=horizontal]) .container{flex-direction:row}:host([layout=grid]){display:grid}:host([layout=grid]) .container{display:grid;place-content:stretch;background-color:transparent;grid-template-columns:repeat(var(--calcite-action-group-columns, var(--calcite-internal-action-group-columns, 3)), auto);gap:var(--calcite-action-group-gap, 1px);padding:var(--calcite-action-group-gap, 1px)}:host([hidden]){display:none}[hidden]{display:none}',$=H,S=d(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.setMenuOpen=e=>{this.menuOpen=!!e.target.open},this.handleMenuActionsSlotChange=e=>{this.hasMenuActions=L(e)},this.expanded=!1,this.label=void 0,this.layout="vertical",this.columns=void 0,this.menuOpen=!1,this.overlayPositioning="absolute",this.scale=void 0,this.menuFlipPlacements=void 0,this.menuPlacement=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.hasMenuActions=!1}expandedHandler(){this.menuOpen=!1}onMessagesChange(){}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await f(this),this.el.focus()}connectedCallback(){x(this),k(this),h(this)}disconnectedCallback(){y(this),O(this),g(this)}async componentWillLoad(){v(this),await C(this)}componentDidLoad(){b(this)}renderMenu(){const{expanded:e,menuOpen:c,scale:o,layout:a,messages:n,overlayPositioning:l,hasMenuActions:r,menuFlipPlacements:m,menuPlacement:u}=this;return t("calcite-action-menu",{expanded:e,flipPlacements:m??(a==="horizontal"?["top","bottom"]:["left","right"]),hidden:!r,label:n.more,onCalciteActionMenuOpen:this.setMenuOpen,open:c,overlayPositioning:l,placement:u??(a==="horizontal"?"bottom-start":"leading-start"),scale:o},t("calcite-action",{icon:_.menu,scale:o,slot:s.trigger,text:n.more,textEnabled:e}),t("slot",{name:i.menuActions,onSlotchange:this.handleMenuActionsSlotChange}),t("slot",{name:i.menuTooltip,slot:s.tooltip}))}render(){return t("div",{key:"8143606c5745053f15140f34ff5ea375a683325f","aria-label":this.label,class:F.container,role:"group"},t("slot",{key:"e8c2821b9ce2e9d0293478989fc31d24f043f9c3"}),this.renderMenu())}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return $}},[17,"calcite-action-group",{expanded:[516],label:[1],layout:[513],columns:[514],menuOpen:[1540,"menu-open"],overlayPositioning:[513,"overlay-positioning"],scale:[513],menuFlipPlacements:[16],menuPlacement:[513,"menu-placement"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],hasMenuActions:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function D(){typeof customElements>"u"||["calcite-action-group","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-group":customElements.get(e)||customElements.define(e,S);break;case"calcite-action":customElements.get(e)||A();break;case"calcite-action-menu":customElements.get(e)||E();break;case"calcite-icon":customElements.get(e)||w();break;case"calcite-loader":customElements.get(e)||z();break;case"calcite-popover":customElements.get(e)||P();break}})}D();export{S as c,D as l,i as o}; diff --git a/main/assets/action-menu-DTIJuZNc-BWLxzbAy.js b/main/assets/action-menu-DTIJuZNc-BWLxzbAy.js new file mode 100644 index 000000000..1cfbe505c --- /dev/null +++ b/main/assets/action-menu-DTIJuZNc-BWLxzbAy.js @@ -0,0 +1 @@ +import{p as ue,b as fe,W as F,n as Oe,a as h,D as Ce,u as Be,m as Te}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{A as G,g as Ie,U as Fe,M as pe,j as Ae,D as Me,d as S,k as Le,c as Re,s as P,R as T}from"./dom-N58V0tYi-DBU3jlah.js";import{i as he}from"./guid-Dls486Er-CBh637k4.js";import{n as ve}from"./key-CZySMiwx-kmS7VeUz.js";import{o as me,r as be,f as ge}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{m as Ee}from"./action-GCQoufcz-D2daq3Sk.js";import{m as ye}from"./icon-BXFbBbop-Du8Zws1L.js";import{v as we}from"./loader-Ch7Jr16w-BlGvYEIO.js";import{I as He,U as Ne,X as Se,q as ze,_ as Ge,j as J}from"./floating-ui-DKFFlLv3-B6atYKJb.js";import{p as Q}from"./openCloseComponent-BGQ6h7vg-DwGQl3jY.js";import{K as je,q as $e}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{l as Ke,d as _e,h as Ue,M as qe}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{c as We}from"./observers-BigwqTsw-Du14S4xc.js";import{$ as Ve}from"./FloatingArrow-BG9llDYg-AyYcVK-v.js";import{e as Xe}from"./component-CWGf1hug-BASJpoEG.js";function Ye(e,t,n){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function ee(e){for(var t=1;t0){var n=e[e.length-1];n!==t&&n.pause()}var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Ze=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},et=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},A=function(e){return e?.key==="Tab"||e?.keyCode===9},tt=function(e){return A(e)&&!e.shiftKey},nt=function(e){return A(e)&&e.shiftKey},ne=function(e){return setTimeout(e,0)},ie=function(e,t){var n=-1;return e.every(function(s,r){return t(s)?(n=r,!1):!0}),n},I=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s1?c-1:0),l=1;l=0)i=n.activeElement;else{var o=a.tabbableGroups[0],c=o&&o.firstTabbableNode;i=c||y("fallbackFocus")}if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i},O=function(){if(a.containerGroups=a.containers.map(function(i){var o=Le(i,r.tabbableOptions),c=Re(i,r.tabbableOptions),d=o.length>0?o[0]:void 0,l=o.length>0?o[o.length-1]:void 0,u=c.find(function(p){return P(p)}),f=c.slice().reverse().find(function(p){return P(p)}),b=!!o.find(function(p){return T(p)>0});return{container:i,tabbableNodes:o,focusableNodes:c,posTabIndexesFound:b,firstTabbableNode:d,lastTabbableNode:l,firstDomTabbableNode:u,lastDomTabbableNode:f,nextTabbableNode:function(p){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=o.indexOf(p);return B<0?x?c.slice(c.indexOf(p)+1).find(function(w){return P(w)}):c.slice(0,c.indexOf(p)).reverse().find(function(w){return P(w)}):o[B+(x?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(i){return i.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!y("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(i){return i.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},j=function(i){var o=i.activeElement;if(o)return o.shadowRoot&&o.shadowRoot.activeElement!==null?j(o.shadowRoot):o},k=function(i){if(i!==!1&&i!==j(document)){if(!i||!i.focus){k(D());return}i.focus({preventScroll:!!r.preventScroll}),a.mostRecentlyFocusedNode=i,Ze(i)&&i.select()}},$=function(i){var o=y("setReturnFocus",i);return o||(o===!1?!1:i)},K=function(i){var o=i.target,c=i.event,d=i.isBackward,l=d===void 0?!1:d;o=o||L(c),O();var u=null;if(a.tabbableGroups.length>0){var f=g(o,c),b=f>=0?a.containerGroups[f]:void 0;if(f<0)l?u=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:u=a.tabbableGroups[0].firstTabbableNode;else if(l){var p=ie(a.tabbableGroups,function(H){var N=H.firstTabbableNode;return o===N});if(p<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o,!1))&&(p=f),p>=0){var x=p===0?a.tabbableGroups.length-1:p-1,B=a.tabbableGroups[x];u=T(o)>=0?B.lastTabbableNode:B.lastDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o,!1))}else{var w=ie(a.tabbableGroups,function(H){var N=H.lastTabbableNode;return o===N});if(w<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o))&&(w=f),w>=0){var De=w===a.tabbableGroups.length-1?0:w+1,Y=a.tabbableGroups[De];u=T(o)>=0?Y.firstTabbableNode:Y.firstDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o))}}else u=y("fallbackFocus");return u},M=function(i){var o=L(i);if(!(g(o,i)>=0)){if(I(r.clickOutsideDeactivates,i)){m.deactivate({returnFocus:r.returnFocusOnDeactivate});return}I(r.allowOutsideClick,i)||i.preventDefault()}},_=function(i){var o=L(i),c=g(o,i)>=0;if(c||o instanceof Document)c&&(a.mostRecentlyFocusedNode=o);else{i.stopImmediatePropagation();var d,l=!0;if(a.mostRecentlyFocusedNode)if(T(a.mostRecentlyFocusedNode)>0){var u=g(a.mostRecentlyFocusedNode),f=a.containerGroups[u].tabbableNodes;if(f.length>0){var b=f.findIndex(function(p){return p===a.mostRecentlyFocusedNode});b>=0&&(r.isKeyForward(a.recentNavEvent)?b+1=0&&(d=f[b-1],l=!1))}}else a.containerGroups.some(function(p){return p.tabbableNodes.some(function(x){return T(x)>0})})||(l=!1);else l=!1;l&&(d=K({target:a.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(a.recentNavEvent)})),k(d||a.mostRecentlyFocusedNode||D())}a.recentNavEvent=void 0},xe=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=i;var c=K({event:i,isBackward:o});c&&(A(i)&&i.preventDefault(),k(c))},U=function(i){(r.isKeyForward(i)||r.isKeyBackward(i))&&xe(i,r.isKeyBackward(i))},q=function(i){et(i)&&I(r.escapeDeactivates,i)!==!1&&(i.preventDefault(),m.deactivate())},W=function(i){var o=L(i);g(o,i)>=0||I(r.clickOutsideDeactivates,i)||I(r.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())},V=function(){if(a.active)return te.activateTrap(s,m),a.delayInitialFocusTimer=r.delayInitialFocus?ne(function(){k(D())}):k(D()),n.addEventListener("focusin",_,!0),n.addEventListener("mousedown",M,{capture:!0,passive:!1}),n.addEventListener("touchstart",M,{capture:!0,passive:!1}),n.addEventListener("click",W,{capture:!0,passive:!1}),n.addEventListener("keydown",U,{capture:!0,passive:!1}),n.addEventListener("keydown",q),m},X=function(){if(a.active)return n.removeEventListener("focusin",_,!0),n.removeEventListener("mousedown",M,!0),n.removeEventListener("touchstart",M,!0),n.removeEventListener("click",W,!0),n.removeEventListener("keydown",U,!0),n.removeEventListener("keydown",q),m},Pe=function(i){var o=i.some(function(c){var d=Array.from(c.removedNodes);return d.some(function(l){return l===a.mostRecentlyFocusedNode})});o&&k(D())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Pe):void 0,C=function(){R&&(R.disconnect(),a.active&&!a.paused&&a.containers.map(function(i){R.observe(i,{subtree:!0,childList:!0})}))};return m={get active(){return a.active},get paused(){return a.paused},activate:function(i){if(a.active)return this;var o=v(i,"onActivate"),c=v(i,"onPostActivate"),d=v(i,"checkCanFocusTrap");d||O(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=n.activeElement,o?.();var l=function(){d&&O(),V(),C(),c?.()};return d?(d(a.containers.concat()).then(l,l),this):(l(),this)},deactivate:function(i){if(!a.active)return this;var o=ee({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},i);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,X(),a.active=!1,a.paused=!1,C(),te.deactivateTrap(s,m);var c=v(o,"onDeactivate"),d=v(o,"onPostDeactivate"),l=v(o,"checkCanReturnFocus"),u=v(o,"returnFocus","returnFocusOnDeactivate");c?.();var f=function(){ne(function(){u&&k($(a.nodeFocusedBeforeActivation)),d?.()})};return u&&l?(l($(a.nodeFocusedBeforeActivation)).then(f,f),this):(f(),this)},pause:function(i){if(a.paused||!a.active)return this;var o=v(i,"onPause"),c=v(i,"onPostPause");return a.paused=!0,o?.(),X(),C(),c?.(),this},unpause:function(i){if(!a.paused||!a.active)return this;var o=v(i,"onUnpause"),c=v(i,"onPostUnpause");return a.paused=!1,o?.(),O(),V(),C(),c?.(),this},updateContainerElements:function(i){var o=[].concat(i).filter(Boolean);return a.containers=o.map(function(c){return typeof c=="string"?n.querySelector(c):c}),a.active&&O(),C(),this}},m.updateContainerElements(e),m};function at(e,t){const{el:n}=e,s=n;if(!s)return;const r={clickOutsideDeactivates:!0,escapeDeactivates:!1,fallbackFocus:s,setReturnFocus:a=>(pe(a),!1),...t?.focusTrapOptions,document:n.ownerDocument,tabbableOptions:Ae,trapStack:Te};e.focusTrap=ot(s,r)}function oe(e,t){e.focusTrapDisabled||e.focusTrap?.activate(t)}function z(e,t){e.focusTrap?.deactivate(t)}function rt(e){e.focusTrap?.updateContainerElements(e.el)}function ae(e,t){return(e+t)%t}const st=(e,t)=>{const n=e.level?`h${e.level}`:"div";return delete e.level,h(n,{class:e.class,key:e.key},t)};class ct{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=t=>{const{registeredElements:n}=this,s=t.find(r=>n.has(r));return n.get(s)},this.togglePopovers=t=>{const n=t.composedPath(),s=this.queryPopover(n);s&&!s.triggerDisabled&&(s.open=!s.open),Array.from(this.registeredElements.values()).filter(r=>r!==s&&r.autoClose&&r.open&&!n.includes(r)).forEach(r=>r.open=!1)},this.keyDownHandler=t=>{t.defaultPrevented||(t.key==="Escape"?this.closeAllPopovers():ve(t.key)&&this.togglePopovers(t))},this.clickHandler=t=>{Me(t)||this.togglePopovers(t)}}registerElement(t,n){this.registeredElementCount++,this.registeredElements.set(t,n),this.registeredElementCount===1&&this.addListeners()}unregisterElement(t){this.registeredElements.delete(t)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(t=>t.open=!1)}addListeners(){window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}}const E={container:"container",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"headerContainer",headerContent:"header-content",heading:"heading"},lt="auto",re="aria-controls",se="aria-expanded",dt=":host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, var(--calcite-z-index-popup));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));--calcite-action-corner-radius-start-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp));--calcite-action-corner-radius-end-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}:host([hidden]){display:none}[hidden]{display:none}",ut=dt,ce=new ct,ft=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=F(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=F(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=F(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=F(this,"calcitePopoverOpen",6),this.mutationObserver=We("mutation",()=>this.updateFocusTrapElements()),this.guid=`calcite-popover-${he()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=e=>{this.transitionEl=e},this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?He(t,e):null},this.setUpReferenceElement=(e=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),Ne(this,this.effectiveReferenceElement,this.el);const{el:t,referenceElement:n,effectiveReferenceElement:s}=this;e&&n&&!s&&console.warn(`${t.tagName}: reference-element id "${n}" was not found.`,{el:t}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(se,G(t))},this.addReferences=()=>{const{effectiveReferenceElement:e}=this;if(!e)return;const t=this.getId();"setAttribute"in e&&e.setAttribute(re,t),ce.registerElement(e,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(re),e.removeAttribute(se)),ce.unregisterElement(e))},this.hide=()=>{this.open=!1},this.storeArrowEl=e=>{this.arrowEl=e,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=Se,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=lt,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.floatingLayout="vertical",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handleFocusTrapDisabled(e){this.open&&(e?z(this):oe(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){Q(this),this.reposition(!0),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){Ke(this,this.effectiveLocale)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),je(this),_e(this),at(this),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}async componentWillLoad(){await Ue(this),me(this)}componentDidLoad(){be(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.open&&Q(this),this.hasLoaded=!0}disconnectedCallback(){this.mutationObserver?.disconnect(),this.removeReferences(),$e(this),qe(this),ze(this,this.effectiveReferenceElement,this.el),z(this)}async reposition(e=!1){const{el:t,effectiveReferenceElement:n,placement:s,overlayPositioning:r,flipDisabled:a,filteredFlipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y}=this;return Ge(this,{floatingEl:t,referenceEl:n,overlayPositioning:r,placement:s,flipDisabled:a,flipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y,type:"popover"},e)}async setFocus(){await ge(this),Oe(this.el),Ie(this.el)}async updateFocusTrapElements(){rt(this)}getReferenceElement(){const{referenceElement:e,el:t}=this;return(typeof e=="string"?Fe(t,{id:e}):e)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),oe(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),z(this)}renderCloseButton(){const{messages:e,closable:t}=this;return t?h("div",{class:E.closeButtonContainer,key:E.closeButtonContainer},h("calcite-action",{appearance:"transparent",class:E.closeButton,onClick:this.hide,ref:n=>this.closeButtonEl=n,scale:this.scale,text:e.close},h("calcite-icon",{icon:"x",scale:Xe(this.scale)}))):null}renderHeader(){const{heading:e,headingLevel:t}=this,n=e?h(st,{class:E.heading,level:t},e):null;return n?h("div",{class:E.header,key:E.header},n,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:e,heading:t,label:n,open:s,pointerDisabled:r,floatingLayout:a}=this,m=e&&s,v=!m,g=r?null:h(Ve,{floatingLayout:a,key:"floating-arrow",ref:this.storeArrowEl});return h(Ce,{key:"a563d48090d6e6c0c138023e169667834f657c4c","aria-hidden":G(v),"aria-label":n,"aria-live":"polite","calcite-hydrated-hidden":v,id:this.getId(),role:"dialog"},h("div",{key:"73053dbdce2cfc68fcd42667089d611e81010955",class:{[E.container]:!0,[J.animation]:!0,[J.animationActive]:m},ref:this.setTransitionEl},g,h("div",{key:"1fbcd45ee42b10a67881ced74db2db051231c94d",class:{[E.hasHeader]:!!t,[E.headerContainer]:!0}},this.renderHeader(),h("div",{key:"522abe801b98787863aac14d990b948d2d286156",class:E.content},h("slot",{key:"022a8f690288acdbac4ec1b3eccf807ffe382d5d"})),t?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ut}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[516],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],floatingLayout:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]},void 0,{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function ke(){typeof customElements>"u"||["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,ft);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break}})}ke();const le={menu:"menu",defaultTrigger:"default-trigger"},de={tooltip:"tooltip",trigger:"trigger"},pt={menu:"ellipsis"},ht="data-active",vt=":host{box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--calcite-font-size-1)}::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{display:flex;max-block-size:45vh;flex-direction:column;flex-wrap:nowrap;overflow-y:auto;overflow-x:hidden;outline:2px solid transparent;outline-offset:2px;gap:var(--calcite-action-menu-items-space, 0)}:host([hidden]){display:none}[hidden]{display:none}",mt=vt,bt=["ArrowUp","ArrowDown","End","Home"],gt=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=F(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${he()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:e,menuId:t,open:n,label:s}=this,r=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==r&&(this.disconnectMenuButtonEl(),this.menuButtonEl=r,this.setTooltipReferenceElement(),r&&(r.active=n,r.setAttribute("aria-controls",t),r.setAttribute("aria-expanded",G(n)),r.setAttribute("aria-haspopup","true"),r.id||(r.id=e),r.label||(r.label=s),r.text||(r.text=s),r.addEventListener("click",this.menuButtonClick),r.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:e}=this;e&&(e.removeEventListener("click",this.menuButtonClick),e.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-action"));this.slottedMenuButtonEl=t[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=e=>{this.defaultMenuButtonEl=e,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=()=>{this.toggleOpen()},this.updateTooltip=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-tooltip"));this.tooltipEl=t[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:e,expanded:t,menuButtonEl:n,open:s}=this;e&&(e.referenceElement=!t&&!s?n:null)},this.updateAction=(e,t)=>{const{guid:n,activeMenuItemIndex:s}=this,r=`${n}-action-${t}`;e.tabIndex=-1,e.setAttribute("role","menuitem"),e.id||(e.id=r),e.toggleAttribute(ht,t===s)},this.updateActions=e=>{e?.forEach(this.updateAction)},this.handleDefaultSlotChange=e=>{const t=e.target.assignedElements({flatten:!0}).reduce((n,s)=>s?.matches("calcite-action")?(n.push(s),n):s?.matches("calcite-action-group")?n.concat(Array.from(s.querySelectorAll("calcite-action"))):n,[]);this.actionElements=t.filter(n=>!n.disabled&&!n.hidden)},this.menuButtonKeyDown=e=>{const{key:t}=e,{actionElements:n,activeMenuItemIndex:s,open:r}=this;if(n.length){if(ve(t)){if(e.preventDefault(),!r){this.toggleOpen();return}const a=n[s];a?a.click():this.toggleOpen(!1)}if(t==="Tab"){this.open=!1;return}if(t==="Escape"){this.toggleOpen(!1),e.preventDefault();return}this.handleActionNavigation(e,t,n)}},this.handleActionNavigation=(e,t,n)=>{if(!this.isValidKey(t,bt))return;if(e.preventDefault(),!this.open){this.toggleOpen(),(t==="Home"||t==="ArrowDown")&&(this.activeMenuItemIndex=0),(t==="End"||t==="ArrowUp")&&(this.activeMenuItemIndex=n.length-1);return}t==="Home"&&(this.activeMenuItemIndex=0),t==="End"&&(this.activeMenuItemIndex=n.length-1);const s=this.activeMenuItemIndex;t==="ArrowUp"&&(this.activeMenuItemIndex=ae(Math.max(s-1,-1),n.length)),t==="ArrowDown"&&(this.activeMenuItemIndex=ae(s+1,n.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(e=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=e},this.handlePopoverOpen=()=>{this.open=!0},this.handlePopoverClose=()=>{this.open=!1},this.appearance="solid",this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}connectedCallback(){this.connectMenuButtonEl()}componentWillLoad(){me(this)}componentDidLoad(){be(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(e){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=e),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){return await ge(this),pe(this.menuButtonEl)}renderMenuButton(){const{appearance:e,label:t,scale:n,expanded:s}=this;return h("slot",{name:de.trigger,onSlotchange:this.setMenuButtonEl},h("calcite-action",{appearance:e,class:le.defaultTrigger,icon:pt.menu,ref:this.setDefaultMenuButtonEl,scale:n,text:t,textEnabled:s}))}renderMenuItems(){const{actionElements:e,activeMenuItemIndex:t,open:n,menuId:s,menuButtonEl:r,label:a,placement:m,overlayPositioning:v,flipPlacements:g}=this,y=e[t]?.id||null;return h("calcite-popover",{autoClose:!0,flipPlacements:g,focusTrapDisabled:!0,label:a,offsetDistance:0,onCalcitePopoverClose:this.handlePopoverClose,onCalcitePopoverOpen:this.handlePopoverOpen,open:n,overlayPositioning:v,placement:m,pointerDisabled:!0,referenceElement:r},h("div",{"aria-activedescendant":y,"aria-labelledby":r?.id,class:le.menu,id:s,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},h("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return h(Be,{key:"d13aa4f3d43fb5651c0487ccfa456813f69955d2"},this.renderMenuButton(),this.renderMenuItems(),h("slot",{key:"b63d187516c766db6a1b1db3df34050fdec9e6ce",name:de.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(e,t){return!!t.find(n=>n===e)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return mt}},[1,"calcite-action-menu",{appearance:[513],expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}]);function Et(){typeof customElements>"u"||["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,gt);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break;case"calcite-popover":customElements.get(e)||ke();break}})}Et();export{rt as E,z as H,ke as K,Et as O,de as _,at as g,oe as j,st as w}; diff --git a/main/assets/action-menu-DTIJuZNc-DM_2ZtiL.js b/main/assets/action-menu-DTIJuZNc-DM_2ZtiL.js deleted file mode 100644 index 4c092a0b1..000000000 --- a/main/assets/action-menu-DTIJuZNc-DM_2ZtiL.js +++ /dev/null @@ -1 +0,0 @@ -import{p as ue,b as fe,W as F,n as Oe,a as h,D as Ce,u as Be,m as Te}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{A as G,g as Ie,U as Fe,M as pe,j as Ae,D as Me,d as S,k as Le,c as Re,s as P,R as T}from"./dom-N58V0tYi-DBU3jlah.js";import{i as he}from"./guid-Dls486Er-CBh637k4.js";import{n as ve}from"./key-CZySMiwx-kmS7VeUz.js";import{o as me,r as be,f as ge}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{m as Ee}from"./action-GCQoufcz-Cwgl1KRC.js";import{m as ye}from"./icon-BXFbBbop-O5hL8B42.js";import{v as we}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";import{I as He,U as Ne,X as Se,q as ze,_ as Ge,j as J}from"./floating-ui-DKFFlLv3-DZ3_fUHw.js";import{p as Q}from"./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js";import{K as je,q as $e}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{l as Ke,d as _e,h as Ue,M as qe}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{c as We}from"./observers-BigwqTsw-DJJPVpPW.js";import{$ as Ve}from"./FloatingArrow-BG9llDYg-B1DQ6cRb.js";import{e as Xe}from"./component-CWGf1hug-BASJpoEG.js";function Ye(e,t,n){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function ee(e){for(var t=1;t0){var n=e[e.length-1];n!==t&&n.pause()}var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Ze=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},et=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},A=function(e){return e?.key==="Tab"||e?.keyCode===9},tt=function(e){return A(e)&&!e.shiftKey},nt=function(e){return A(e)&&e.shiftKey},ne=function(e){return setTimeout(e,0)},ie=function(e,t){var n=-1;return e.every(function(s,r){return t(s)?(n=r,!1):!0}),n},I=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s1?c-1:0),l=1;l=0)i=n.activeElement;else{var o=a.tabbableGroups[0],c=o&&o.firstTabbableNode;i=c||y("fallbackFocus")}if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i},O=function(){if(a.containerGroups=a.containers.map(function(i){var o=Le(i,r.tabbableOptions),c=Re(i,r.tabbableOptions),d=o.length>0?o[0]:void 0,l=o.length>0?o[o.length-1]:void 0,u=c.find(function(p){return P(p)}),f=c.slice().reverse().find(function(p){return P(p)}),b=!!o.find(function(p){return T(p)>0});return{container:i,tabbableNodes:o,focusableNodes:c,posTabIndexesFound:b,firstTabbableNode:d,lastTabbableNode:l,firstDomTabbableNode:u,lastDomTabbableNode:f,nextTabbableNode:function(p){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=o.indexOf(p);return B<0?x?c.slice(c.indexOf(p)+1).find(function(w){return P(w)}):c.slice(0,c.indexOf(p)).reverse().find(function(w){return P(w)}):o[B+(x?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(i){return i.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!y("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(i){return i.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},j=function(i){var o=i.activeElement;if(o)return o.shadowRoot&&o.shadowRoot.activeElement!==null?j(o.shadowRoot):o},k=function(i){if(i!==!1&&i!==j(document)){if(!i||!i.focus){k(D());return}i.focus({preventScroll:!!r.preventScroll}),a.mostRecentlyFocusedNode=i,Ze(i)&&i.select()}},$=function(i){var o=y("setReturnFocus",i);return o||(o===!1?!1:i)},K=function(i){var o=i.target,c=i.event,d=i.isBackward,l=d===void 0?!1:d;o=o||L(c),O();var u=null;if(a.tabbableGroups.length>0){var f=g(o,c),b=f>=0?a.containerGroups[f]:void 0;if(f<0)l?u=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:u=a.tabbableGroups[0].firstTabbableNode;else if(l){var p=ie(a.tabbableGroups,function(H){var N=H.firstTabbableNode;return o===N});if(p<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o,!1))&&(p=f),p>=0){var x=p===0?a.tabbableGroups.length-1:p-1,B=a.tabbableGroups[x];u=T(o)>=0?B.lastTabbableNode:B.lastDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o,!1))}else{var w=ie(a.tabbableGroups,function(H){var N=H.lastTabbableNode;return o===N});if(w<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o))&&(w=f),w>=0){var De=w===a.tabbableGroups.length-1?0:w+1,Y=a.tabbableGroups[De];u=T(o)>=0?Y.firstTabbableNode:Y.firstDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o))}}else u=y("fallbackFocus");return u},M=function(i){var o=L(i);if(!(g(o,i)>=0)){if(I(r.clickOutsideDeactivates,i)){m.deactivate({returnFocus:r.returnFocusOnDeactivate});return}I(r.allowOutsideClick,i)||i.preventDefault()}},_=function(i){var o=L(i),c=g(o,i)>=0;if(c||o instanceof Document)c&&(a.mostRecentlyFocusedNode=o);else{i.stopImmediatePropagation();var d,l=!0;if(a.mostRecentlyFocusedNode)if(T(a.mostRecentlyFocusedNode)>0){var u=g(a.mostRecentlyFocusedNode),f=a.containerGroups[u].tabbableNodes;if(f.length>0){var b=f.findIndex(function(p){return p===a.mostRecentlyFocusedNode});b>=0&&(r.isKeyForward(a.recentNavEvent)?b+1=0&&(d=f[b-1],l=!1))}}else a.containerGroups.some(function(p){return p.tabbableNodes.some(function(x){return T(x)>0})})||(l=!1);else l=!1;l&&(d=K({target:a.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(a.recentNavEvent)})),k(d||a.mostRecentlyFocusedNode||D())}a.recentNavEvent=void 0},xe=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=i;var c=K({event:i,isBackward:o});c&&(A(i)&&i.preventDefault(),k(c))},U=function(i){(r.isKeyForward(i)||r.isKeyBackward(i))&&xe(i,r.isKeyBackward(i))},q=function(i){et(i)&&I(r.escapeDeactivates,i)!==!1&&(i.preventDefault(),m.deactivate())},W=function(i){var o=L(i);g(o,i)>=0||I(r.clickOutsideDeactivates,i)||I(r.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())},V=function(){if(a.active)return te.activateTrap(s,m),a.delayInitialFocusTimer=r.delayInitialFocus?ne(function(){k(D())}):k(D()),n.addEventListener("focusin",_,!0),n.addEventListener("mousedown",M,{capture:!0,passive:!1}),n.addEventListener("touchstart",M,{capture:!0,passive:!1}),n.addEventListener("click",W,{capture:!0,passive:!1}),n.addEventListener("keydown",U,{capture:!0,passive:!1}),n.addEventListener("keydown",q),m},X=function(){if(a.active)return n.removeEventListener("focusin",_,!0),n.removeEventListener("mousedown",M,!0),n.removeEventListener("touchstart",M,!0),n.removeEventListener("click",W,!0),n.removeEventListener("keydown",U,!0),n.removeEventListener("keydown",q),m},Pe=function(i){var o=i.some(function(c){var d=Array.from(c.removedNodes);return d.some(function(l){return l===a.mostRecentlyFocusedNode})});o&&k(D())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Pe):void 0,C=function(){R&&(R.disconnect(),a.active&&!a.paused&&a.containers.map(function(i){R.observe(i,{subtree:!0,childList:!0})}))};return m={get active(){return a.active},get paused(){return a.paused},activate:function(i){if(a.active)return this;var o=v(i,"onActivate"),c=v(i,"onPostActivate"),d=v(i,"checkCanFocusTrap");d||O(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=n.activeElement,o?.();var l=function(){d&&O(),V(),C(),c?.()};return d?(d(a.containers.concat()).then(l,l),this):(l(),this)},deactivate:function(i){if(!a.active)return this;var o=ee({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},i);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,X(),a.active=!1,a.paused=!1,C(),te.deactivateTrap(s,m);var c=v(o,"onDeactivate"),d=v(o,"onPostDeactivate"),l=v(o,"checkCanReturnFocus"),u=v(o,"returnFocus","returnFocusOnDeactivate");c?.();var f=function(){ne(function(){u&&k($(a.nodeFocusedBeforeActivation)),d?.()})};return u&&l?(l($(a.nodeFocusedBeforeActivation)).then(f,f),this):(f(),this)},pause:function(i){if(a.paused||!a.active)return this;var o=v(i,"onPause"),c=v(i,"onPostPause");return a.paused=!0,o?.(),X(),C(),c?.(),this},unpause:function(i){if(!a.paused||!a.active)return this;var o=v(i,"onUnpause"),c=v(i,"onPostUnpause");return a.paused=!1,o?.(),O(),V(),C(),c?.(),this},updateContainerElements:function(i){var o=[].concat(i).filter(Boolean);return a.containers=o.map(function(c){return typeof c=="string"?n.querySelector(c):c}),a.active&&O(),C(),this}},m.updateContainerElements(e),m};function at(e,t){const{el:n}=e,s=n;if(!s)return;const r={clickOutsideDeactivates:!0,escapeDeactivates:!1,fallbackFocus:s,setReturnFocus:a=>(pe(a),!1),...t?.focusTrapOptions,document:n.ownerDocument,tabbableOptions:Ae,trapStack:Te};e.focusTrap=ot(s,r)}function oe(e,t){e.focusTrapDisabled||e.focusTrap?.activate(t)}function z(e,t){e.focusTrap?.deactivate(t)}function rt(e){e.focusTrap?.updateContainerElements(e.el)}function ae(e,t){return(e+t)%t}const st=(e,t)=>{const n=e.level?`h${e.level}`:"div";return delete e.level,h(n,{class:e.class,key:e.key},t)};class ct{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=t=>{const{registeredElements:n}=this,s=t.find(r=>n.has(r));return n.get(s)},this.togglePopovers=t=>{const n=t.composedPath(),s=this.queryPopover(n);s&&!s.triggerDisabled&&(s.open=!s.open),Array.from(this.registeredElements.values()).filter(r=>r!==s&&r.autoClose&&r.open&&!n.includes(r)).forEach(r=>r.open=!1)},this.keyDownHandler=t=>{t.defaultPrevented||(t.key==="Escape"?this.closeAllPopovers():ve(t.key)&&this.togglePopovers(t))},this.clickHandler=t=>{Me(t)||this.togglePopovers(t)}}registerElement(t,n){this.registeredElementCount++,this.registeredElements.set(t,n),this.registeredElementCount===1&&this.addListeners()}unregisterElement(t){this.registeredElements.delete(t)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(t=>t.open=!1)}addListeners(){window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}}const E={container:"container",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"headerContainer",headerContent:"header-content",heading:"heading"},lt="auto",re="aria-controls",se="aria-expanded",dt=":host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, var(--calcite-z-index-popup));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));--calcite-action-corner-radius-start-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp));--calcite-action-corner-radius-end-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}:host([hidden]){display:none}[hidden]{display:none}",ut=dt,ce=new ct,ft=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=F(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=F(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=F(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=F(this,"calcitePopoverOpen",6),this.mutationObserver=We("mutation",()=>this.updateFocusTrapElements()),this.guid=`calcite-popover-${he()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=e=>{this.transitionEl=e},this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?He(t,e):null},this.setUpReferenceElement=(e=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),Ne(this,this.effectiveReferenceElement,this.el);const{el:t,referenceElement:n,effectiveReferenceElement:s}=this;e&&n&&!s&&console.warn(`${t.tagName}: reference-element id "${n}" was not found.`,{el:t}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(se,G(t))},this.addReferences=()=>{const{effectiveReferenceElement:e}=this;if(!e)return;const t=this.getId();"setAttribute"in e&&e.setAttribute(re,t),ce.registerElement(e,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(re),e.removeAttribute(se)),ce.unregisterElement(e))},this.hide=()=>{this.open=!1},this.storeArrowEl=e=>{this.arrowEl=e,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=Se,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=lt,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.floatingLayout="vertical",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handleFocusTrapDisabled(e){this.open&&(e?z(this):oe(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){Q(this),this.reposition(!0),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){Ke(this,this.effectiveLocale)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),je(this),_e(this),at(this),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}async componentWillLoad(){await Ue(this),me(this)}componentDidLoad(){be(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.open&&Q(this),this.hasLoaded=!0}disconnectedCallback(){this.mutationObserver?.disconnect(),this.removeReferences(),$e(this),qe(this),ze(this,this.effectiveReferenceElement,this.el),z(this)}async reposition(e=!1){const{el:t,effectiveReferenceElement:n,placement:s,overlayPositioning:r,flipDisabled:a,filteredFlipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y}=this;return Ge(this,{floatingEl:t,referenceEl:n,overlayPositioning:r,placement:s,flipDisabled:a,flipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y,type:"popover"},e)}async setFocus(){await ge(this),Oe(this.el),Ie(this.el)}async updateFocusTrapElements(){rt(this)}getReferenceElement(){const{referenceElement:e,el:t}=this;return(typeof e=="string"?Fe(t,{id:e}):e)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),oe(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),z(this)}renderCloseButton(){const{messages:e,closable:t}=this;return t?h("div",{class:E.closeButtonContainer,key:E.closeButtonContainer},h("calcite-action",{appearance:"transparent",class:E.closeButton,onClick:this.hide,ref:n=>this.closeButtonEl=n,scale:this.scale,text:e.close},h("calcite-icon",{icon:"x",scale:Xe(this.scale)}))):null}renderHeader(){const{heading:e,headingLevel:t}=this,n=e?h(st,{class:E.heading,level:t},e):null;return n?h("div",{class:E.header,key:E.header},n,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:e,heading:t,label:n,open:s,pointerDisabled:r,floatingLayout:a}=this,m=e&&s,v=!m,g=r?null:h(Ve,{floatingLayout:a,key:"floating-arrow",ref:this.storeArrowEl});return h(Ce,{key:"a563d48090d6e6c0c138023e169667834f657c4c","aria-hidden":G(v),"aria-label":n,"aria-live":"polite","calcite-hydrated-hidden":v,id:this.getId(),role:"dialog"},h("div",{key:"73053dbdce2cfc68fcd42667089d611e81010955",class:{[E.container]:!0,[J.animation]:!0,[J.animationActive]:m},ref:this.setTransitionEl},g,h("div",{key:"1fbcd45ee42b10a67881ced74db2db051231c94d",class:{[E.hasHeader]:!!t,[E.headerContainer]:!0}},this.renderHeader(),h("div",{key:"522abe801b98787863aac14d990b948d2d286156",class:E.content},h("slot",{key:"022a8f690288acdbac4ec1b3eccf807ffe382d5d"})),t?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ut}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[516],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],floatingLayout:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]},void 0,{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function ke(){typeof customElements>"u"||["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,ft);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break}})}ke();const le={menu:"menu",defaultTrigger:"default-trigger"},de={tooltip:"tooltip",trigger:"trigger"},pt={menu:"ellipsis"},ht="data-active",vt=":host{box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--calcite-font-size-1)}::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{display:flex;max-block-size:45vh;flex-direction:column;flex-wrap:nowrap;overflow-y:auto;overflow-x:hidden;outline:2px solid transparent;outline-offset:2px;gap:var(--calcite-action-menu-items-space, 0)}:host([hidden]){display:none}[hidden]{display:none}",mt=vt,bt=["ArrowUp","ArrowDown","End","Home"],gt=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=F(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${he()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:e,menuId:t,open:n,label:s}=this,r=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==r&&(this.disconnectMenuButtonEl(),this.menuButtonEl=r,this.setTooltipReferenceElement(),r&&(r.active=n,r.setAttribute("aria-controls",t),r.setAttribute("aria-expanded",G(n)),r.setAttribute("aria-haspopup","true"),r.id||(r.id=e),r.label||(r.label=s),r.text||(r.text=s),r.addEventListener("click",this.menuButtonClick),r.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:e}=this;e&&(e.removeEventListener("click",this.menuButtonClick),e.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-action"));this.slottedMenuButtonEl=t[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=e=>{this.defaultMenuButtonEl=e,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=()=>{this.toggleOpen()},this.updateTooltip=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-tooltip"));this.tooltipEl=t[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:e,expanded:t,menuButtonEl:n,open:s}=this;e&&(e.referenceElement=!t&&!s?n:null)},this.updateAction=(e,t)=>{const{guid:n,activeMenuItemIndex:s}=this,r=`${n}-action-${t}`;e.tabIndex=-1,e.setAttribute("role","menuitem"),e.id||(e.id=r),e.toggleAttribute(ht,t===s)},this.updateActions=e=>{e?.forEach(this.updateAction)},this.handleDefaultSlotChange=e=>{const t=e.target.assignedElements({flatten:!0}).reduce((n,s)=>s?.matches("calcite-action")?(n.push(s),n):s?.matches("calcite-action-group")?n.concat(Array.from(s.querySelectorAll("calcite-action"))):n,[]);this.actionElements=t.filter(n=>!n.disabled&&!n.hidden)},this.menuButtonKeyDown=e=>{const{key:t}=e,{actionElements:n,activeMenuItemIndex:s,open:r}=this;if(n.length){if(ve(t)){if(e.preventDefault(),!r){this.toggleOpen();return}const a=n[s];a?a.click():this.toggleOpen(!1)}if(t==="Tab"){this.open=!1;return}if(t==="Escape"){this.toggleOpen(!1),e.preventDefault();return}this.handleActionNavigation(e,t,n)}},this.handleActionNavigation=(e,t,n)=>{if(!this.isValidKey(t,bt))return;if(e.preventDefault(),!this.open){this.toggleOpen(),(t==="Home"||t==="ArrowDown")&&(this.activeMenuItemIndex=0),(t==="End"||t==="ArrowUp")&&(this.activeMenuItemIndex=n.length-1);return}t==="Home"&&(this.activeMenuItemIndex=0),t==="End"&&(this.activeMenuItemIndex=n.length-1);const s=this.activeMenuItemIndex;t==="ArrowUp"&&(this.activeMenuItemIndex=ae(Math.max(s-1,-1),n.length)),t==="ArrowDown"&&(this.activeMenuItemIndex=ae(s+1,n.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(e=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=e},this.handlePopoverOpen=()=>{this.open=!0},this.handlePopoverClose=()=>{this.open=!1},this.appearance="solid",this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}connectedCallback(){this.connectMenuButtonEl()}componentWillLoad(){me(this)}componentDidLoad(){be(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(e){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=e),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){return await ge(this),pe(this.menuButtonEl)}renderMenuButton(){const{appearance:e,label:t,scale:n,expanded:s}=this;return h("slot",{name:de.trigger,onSlotchange:this.setMenuButtonEl},h("calcite-action",{appearance:e,class:le.defaultTrigger,icon:pt.menu,ref:this.setDefaultMenuButtonEl,scale:n,text:t,textEnabled:s}))}renderMenuItems(){const{actionElements:e,activeMenuItemIndex:t,open:n,menuId:s,menuButtonEl:r,label:a,placement:m,overlayPositioning:v,flipPlacements:g}=this,y=e[t]?.id||null;return h("calcite-popover",{autoClose:!0,flipPlacements:g,focusTrapDisabled:!0,label:a,offsetDistance:0,onCalcitePopoverClose:this.handlePopoverClose,onCalcitePopoverOpen:this.handlePopoverOpen,open:n,overlayPositioning:v,placement:m,pointerDisabled:!0,referenceElement:r},h("div",{"aria-activedescendant":y,"aria-labelledby":r?.id,class:le.menu,id:s,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},h("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return h(Be,{key:"d13aa4f3d43fb5651c0487ccfa456813f69955d2"},this.renderMenuButton(),this.renderMenuItems(),h("slot",{key:"b63d187516c766db6a1b1db3df34050fdec9e6ce",name:de.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(e,t){return!!t.find(n=>n===e)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return mt}},[1,"calcite-action-menu",{appearance:[513],expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}]);function Et(){typeof customElements>"u"||["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,gt);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break;case"calcite-popover":customElements.get(e)||ke();break}})}Et();export{rt as E,z as H,ke as K,Et as O,de as _,at as g,oe as j,st as w}; diff --git a/main/assets/apng-DuERAVke-DjvWOkXS.js b/main/assets/apng-DuERAVke-DjvWOkXS.js new file mode 100644 index 000000000..2636e75bd --- /dev/null +++ b/main/assets/apng-DuERAVke-DjvWOkXS.js @@ -0,0 +1 @@ +import{t as G}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{$ as B,aN as S}from"./main-C7yV2j71.js";var R,T={exports:{}};function V(){return R||(R=1,E=function(){return function(w){var o={};function s(a){if(o[a])return o[a].exports;var l=o[a]={exports:{},id:a,loaded:!1};return w[a].call(l.exports,l,l.exports,s),l.loaded=!0,l.exports}return s.m=w,s.c=o,s.p="",s(0)}([function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.isNotPNG=n,o.isNotAPNG=r,o.default=i;var a=v(s(1)),l=s(2);function v(h){return h&&h.__esModule?h:{default:h}}var f=new Error("Not a PNG"),e=new Error("Not an animated PNG");function n(h){return h===f}function r(h){return h===e}var t=new Uint8Array([137,80,78,71,13,10,26,10]);function i(h){var _=new Uint8Array(h);if(Array.prototype.some.call(t,function(L,b){return L!==_[b]}))return f;var y=!1;if(u(_,function(L){return!(y=L==="acTL")}),!y)return e;var d=[],k=[],x=null,c=null,I=0,F=new l.APNG;if(u(_,function(L,b,p,U){var P=new DataView(b.buffer);switch(L){case"IHDR":x=b.subarray(p+8,p+8+U),F.width=P.getUint32(p+8),F.height=P.getUint32(p+12);break;case"acTL":F.numPlays=P.getUint32(p+8+4);break;case"fcTL":c&&(F.frames.push(c),I++),(c=new l.Frame).width=P.getUint32(p+8+4),c.height=P.getUint32(p+8+8),c.left=P.getUint32(p+8+12),c.top=P.getUint32(p+8+16);var M=P.getUint16(p+8+20),N=P.getUint16(p+8+22);N===0&&(N=100),c.delay=1e3*M/N,c.delay<=10&&(c.delay=100),F.playTime+=c.delay,c.disposeOp=P.getUint8(p+8+24),c.blendOp=P.getUint8(p+8+25),c.dataParts=[],I===0&&c.disposeOp===2&&(c.disposeOp=1);break;case"fdAT":c&&c.dataParts.push(b.subarray(p+8+4,p+8+U));break;case"IDAT":c&&c.dataParts.push(b.subarray(p+8,p+8+U));break;case"IEND":k.push(O(b,p,12+U));break;default:d.push(O(b,p,12+U))}}),c&&F.frames.push(c),F.frames.length==0)return e;var j=new Blob(d),C=new Blob(k);return F.frames.forEach(function(L){var b=[];b.push(t),x.set(D(L.width),0),x.set(D(L.height),4),b.push(A("IHDR",x)),b.push(j),L.dataParts.forEach(function(p){return b.push(A("IDAT",p))}),b.push(C),L.imageData=new Blob(b,{type:"image/png"}),delete L.dataParts,b=null}),F}function u(h,_){var y=new DataView(h.buffer),d=8,k=void 0,x=void 0,c=void 0;do x=y.getUint32(d),c=_(k=g(h,d+4,4),h,d,x),d+=12+x;while(c!==!1&&k!="IEND"&&d>>24&255,h>>>16&255,h>>>8&255,255&h])}},function(w,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(f){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,t=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.length-e);r>>8^s[255&(n^f[r])];return~n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var l=a,v=0;v<8;v++)l=1&l?3988292384^l>>>1:l>>>1;s[a]=l}},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.Frame=o.APNG=void 0;var a=function(){function e(n,r){for(var t=0;t1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new l.default(r,n,t)})}}]),e}(),o.Frame=function(){function e(){f(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,t){var i=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(i),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(i),n.imageElement=null,t(new Error("Image creation error"))},n.imageElement.src=i})}}]),e}()},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0});var a=function(){function r(t,i){for(var u=0;u=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var i=this.currentFrame;this._prevFrame=i,this._prevFrameData=null,i.disposeOp==2&&(this._prevFrameData=this.context.getImageData(i.left,i.top,i.width,i.height)),i.blendOp==0&&this.context.clearRect(i.left,i.top,i.width,i.height),this.context.drawImage(i.imageElement,i.left,i.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var i=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var u=performance.now()+this.currentFrame.delay/this.playbackRate,g=function m(O){if(!i._ended&&!i._paused){if(O>=u){for(;O-u>=i._apng.playTime/i.playbackRate;)u+=i._apng.playTime/i.playbackRate,i._numPlays++;do i.renderNextFrame(),u+=i.currentFrame.delay/i.playbackRate;while(!i._ended&&!i._paused&&O>u)}requestAnimationFrame(m)}};requestAnimationFrame(g)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),t}(l(s(4)).default);o.default=n},function(w,o){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function l(e){return typeof e=="number"}function v(e){return typeof e=="object"&&e!==null}function f(e){return e===void 0}w.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!l(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,t,i,u,g;if(this._events||(this._events={}),e==="error"&&(!this._events.error||v(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(f(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(v(r))for(i=Array.prototype.slice.call(arguments,1),t=(g=r.slice()).length,u=0;u0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function t(){this.removeListener(e,t),r||(r=!0,n.apply(this,arguments))}return t.listener=n,this.on(e,t),this},s.prototype.removeListener=function(e,n){var r,t,i,u;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,t=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(v(r)){for(u=i;u-- >0;)if(r[u]===n||r[u].listener&&r[u].listener===n){t=u;break}if(t<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(t,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},T.exports=E()),T.exports;var E}const q=G(V());async function z(E,w){const o=q(E);if(o instanceof Error)throw o;await o.createImages(),B(w);const{frames:s,width:a,height:l}=o,v=document.createElement("canvas");v.width=a,v.height=l;const f=v.getContext("2d",{willReadFrequently:!0}),e=[],n=[];let r=0;for(const t of s){const i=S(t.delay||100);n.push(i),r+=i;const u=t.imageElement;t.blendOp===0?f.globalCompositeOperation="copy":f.globalCompositeOperation="source-over";const g=t.disposeOp===2?f.getImageData(t.left,t.top,t.width,t.height):void 0;f.drawImage(u,t.left,t.top);const m=f.getImageData(0,0,a,l);e.push(m),t.disposeOp===0||(t.disposeOp===1?f.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&f.putImageData(g,t.left,t.top))}return{frameCount:s.length,duration:r,frameDurations:n,getFrame:t=>e[t],width:a,height:l}}const H=[137,80,78,71,13,10,26,10];function $(E){const w=new Uint8Array(E);return!H.some((o,s)=>o!==w[s])}function J(E){if(!$(E))return!1;const w=new DataView(E),o=new Uint8Array(E);let s,a=8;do{const l=w.getUint32(a);if(s=String.fromCharCode.apply(String,Array.prototype.slice.call(o.subarray(a+4,a+8))),s==="acTL")return!0;a+=12+l}while(s!=="IEND"&&a>>24&255,h>>>16&255,h>>>8&255,255&h])}},function(w,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(f){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,t=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.length-e);r>>8^s[255&(n^f[r])];return~n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var l=a,v=0;v<8;v++)l=1&l?3988292384^l>>>1:l>>>1;s[a]=l}},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.Frame=o.APNG=void 0;var a=function(){function e(n,r){for(var t=0;t1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new l.default(r,n,t)})}}]),e}(),o.Frame=function(){function e(){f(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,t){var i=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(i),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(i),n.imageElement=null,t(new Error("Image creation error"))},n.imageElement.src=i})}}]),e}()},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0});var a=function(){function r(t,i){for(var u=0;u=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var i=this.currentFrame;this._prevFrame=i,this._prevFrameData=null,i.disposeOp==2&&(this._prevFrameData=this.context.getImageData(i.left,i.top,i.width,i.height)),i.blendOp==0&&this.context.clearRect(i.left,i.top,i.width,i.height),this.context.drawImage(i.imageElement,i.left,i.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var i=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var u=performance.now()+this.currentFrame.delay/this.playbackRate,g=function m(O){if(!i._ended&&!i._paused){if(O>=u){for(;O-u>=i._apng.playTime/i.playbackRate;)u+=i._apng.playTime/i.playbackRate,i._numPlays++;do i.renderNextFrame(),u+=i.currentFrame.delay/i.playbackRate;while(!i._ended&&!i._paused&&O>u)}requestAnimationFrame(m)}};requestAnimationFrame(g)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),t}(l(s(4)).default);o.default=n},function(w,o){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function l(e){return typeof e=="number"}function v(e){return typeof e=="object"&&e!==null}function f(e){return e===void 0}w.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!l(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,t,i,u,g;if(this._events||(this._events={}),e==="error"&&(!this._events.error||v(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(f(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(v(r))for(i=Array.prototype.slice.call(arguments,1),t=(g=r.slice()).length,u=0;u0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function t(){this.removeListener(e,t),r||(r=!0,n.apply(this,arguments))}return t.listener=n,this.on(e,t),this},s.prototype.removeListener=function(e,n){var r,t,i,u;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,t=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(v(r)){for(u=i;u-- >0;)if(r[u]===n||r[u].listener&&r[u].listener===n){t=u;break}if(t<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(t,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},T.exports=E()),T.exports;var E}const q=G(V());async function z(E,w){const o=q(E);if(o instanceof Error)throw o;await o.createImages(),B(w);const{frames:s,width:a,height:l}=o,v=document.createElement("canvas");v.width=a,v.height=l;const f=v.getContext("2d",{willReadFrequently:!0}),e=[],n=[];let r=0;for(const t of s){const i=S(t.delay||100);n.push(i),r+=i;const u=t.imageElement;t.blendOp===0?f.globalCompositeOperation="copy":f.globalCompositeOperation="source-over";const g=t.disposeOp===2?f.getImageData(t.left,t.top,t.width,t.height):void 0;f.drawImage(u,t.left,t.top);const m=f.getImageData(0,0,a,l);e.push(m),t.disposeOp===0||(t.disposeOp===1?f.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&f.putImageData(g,t.left,t.top))}return{frameCount:s.length,duration:r,frameDurations:n,getFrame:t=>e[t],width:a,height:l}}const H=[137,80,78,71,13,10,26,10];function $(E){const w=new Uint8Array(E);return!H.some((o,s)=>o!==w[s])}function J(E){if(!$(E))return!1;const w=new DataView(E),o=new Uint8Array(E);let s,a=8;do{const l=w.getUint32(a);if(s=String.fromCharCode.apply(String,Array.prototype.slice.call(o.subarray(a+4,a+8))),s==="acTL")return!0;a+=12+l}while(s!=="IEND"&&a{const t={};return h(t,c,{[n]:p},r,o),t[n]}))}function N(e,i,r={}){const o=e instanceof z?new J({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return i.constructFeatureSet(o,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function Y(e,i,r={}){const{spatialReference:o,interceptor:a,lruCache:n}=r;return typeof e=="string"?i.createFeatureSetCollectionFromService(e,o,n,a):i.createFeatureSetCollectionFromMap(e,o,n,a)}function q(e,i,r,o={}){const a={};return h(a,i.properties,e,r,o),new d.Dictionary(a)}function h(e,i,r,o,a={}){const n={};for(const c of Object.keys(r))n[c.toLowerCase()]=r[c];for(const c of i){const p=c.name.toLowerCase();if(a.variablesPreProcessed)e[p]=n[p];else switch(c.type){case"array":{const t=n[p];e[p]=t==null?null:E(t,c,o,a);break}case"feature":{const t=n[p];e[p]=t==null?null:d.Feature.createFromGraphic(t,a?.timeZone);break}case"featureSet":{const t=n[p];e[p]=t==null?null:o?N(t,o,a):null;break}case"featureSetCollection":{const t=n[p];e[p]=t==null?null:o?Y(t,o,a):null;break}case"dictionary":{const t=n[p];e[p]=t==null?null:q(t,c,o,a);break}case"date":{const t=n[p];e[p]=t?t instanceof g?t:a?.timeZone?g.dateJSAndZoneToArcadeDate(t,a?.timeZone):g.dateJSToArcadeDate(t):null;break}case"dateOnly":{const t=n[p];e[p]=t?t instanceof O?t:O.fromReader(t):null;break}case"time":{const t=n[p];e[p]=t?t instanceof T?t:T.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[p]=n[p]}}}function Z(e,i){for(const r of e)i.push(r),r.type==="dictionary"&&Z(r.properties,i);return i}function R(e,i,r,o,a){const{spatialReference:n,interceptor:c,lruCache:p,console:t,abortSignal:u,timeZone:m,services:S={portal:M.getDefault()}}=r,b={vars:{},spatialReference:n,interceptor:c,timeZone:m,lrucache:p,useAsync:a,services:S,console:t,abortSignal:u};return i&&h(b.vars,e.variables,i,o,r),b}function v(e,i){switch(i.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const r=(e.type,e),o="geometry"in r?r.geometry():null,a="readAttributes"in r?r.readAttributes():r.attributes;return new j({geometry:o,attributes:a})}case"dictionary":{const r=e,o=r.attributes,a={};for(const n of Object.keys(o))a[n]=v(r.field(n),i);return a}case"array":return("toArray"in e?e.toArray():e).map(r=>v(r,i))}return e}const F={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},D={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},U=new Map([["aggregate-field",{variables:[{name:"$feature",type:"feature"}]}],["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",F],["popup-element",F],["feature-reduction-popup",D],["feature-reduction-popup-element",D],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function $t(e){const i=U.get(e);if(!i){const r=Array.from(U.keys()).map(o=>`'${o}'`).join(", ");throw new w("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${r}`)}return P(i)}async function At(e,i,r={}){d||(d=await L());const{arcade:o,arcadeUtils:a}=d,{loadScriptDependencies:n,referencesMember:c,scriptIsAsync:p}=o,t=Z(i.variables,[]),u=t.filter(s=>s.type==="featureSet"||s.type==="featureSetCollection").map(s=>s.name.toLowerCase()),m=o.parseScript(e,u);if(!m)throw new w("arcade:invalid-script","Unable to create SyntaxTree");const S=a.extractFieldNames(m),b=o.scriptTouchesGeometry(m),C=t.map(s=>s.name.toLowerCase()).filter(s=>c(m,s)),l=p(m,u);await n(m,l,u);const $={vars:{},spatialReference:null,useAsync:l};for(const s of C)$.vars[s]="any";const{lruCache:A}=r,x=o.compileScript(m,$),k=o.featureSetUtils(),{services:G}=r;return{execute:(s,f={})=>{if(l)throw new w("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const y=x(R(i,s,{lruCache:A,...f},k,l));return f.rawOutput?y:v(y,a)},executeAsync:async(s,f={})=>{const y=await x(R(i,s,{lruCache:A,services:G,...f},k,l));return f.rawOutput?y:v(y,a)},isAsync:l,variablesUsed:C,fieldsUsed:S,geometryUsed:b,syntaxTree:m}}export{At as createArcadeExecutor,$t as createArcadeProfile}; diff --git a/main/assets/arcade-CaGqU4sP-Dk6yM-FW.js b/main/assets/arcade-CaGqU4sP-Dk6yM-FW.js deleted file mode 100644 index b710e579d..000000000 --- a/main/assets/arcade-CaGqU4sP-Dk6yM-FW.js +++ /dev/null @@ -1 +0,0 @@ -import{o as w,P,ex as L,r as M,bi as j}from"./main-BZaw9FpY.js";import{m as T,O,r as g}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{n as I}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import J from"./FeatureLayer-BrRKw5Si-CHreUEJ9.js";import{O as z}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./versionUtils-LZYZz-38-xZnsxhiL.js";import"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";let d=null;function E(e,i,r,o={}){const a=i.elementType,n="value",c=a.type==="array"?[{name:n,type:a.type,elementType:a.elementType}]:a.type==="dictionary"?[{name:n,type:a.type,properties:a.properties}]:[{name:n,type:a.type}];return new I(e.map(p=>{const t={};return h(t,c,{[n]:p},r,o),t[n]}))}function N(e,i,r={}){const o=e instanceof z?new J({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return i.constructFeatureSet(o,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function Y(e,i,r={}){const{spatialReference:o,interceptor:a,lruCache:n}=r;return typeof e=="string"?i.createFeatureSetCollectionFromService(e,o,n,a):i.createFeatureSetCollectionFromMap(e,o,n,a)}function q(e,i,r,o={}){const a={};return h(a,i.properties,e,r,o),new d.Dictionary(a)}function h(e,i,r,o,a={}){const n={};for(const c of Object.keys(r))n[c.toLowerCase()]=r[c];for(const c of i){const p=c.name.toLowerCase();if(a.variablesPreProcessed)e[p]=n[p];else switch(c.type){case"array":{const t=n[p];e[p]=t==null?null:E(t,c,o,a);break}case"feature":{const t=n[p];e[p]=t==null?null:d.Feature.createFromGraphic(t,a?.timeZone);break}case"featureSet":{const t=n[p];e[p]=t==null?null:o?N(t,o,a):null;break}case"featureSetCollection":{const t=n[p];e[p]=t==null?null:o?Y(t,o,a):null;break}case"dictionary":{const t=n[p];e[p]=t==null?null:q(t,c,o,a);break}case"date":{const t=n[p];e[p]=t?t instanceof g?t:a?.timeZone?g.dateJSAndZoneToArcadeDate(t,a?.timeZone):g.dateJSToArcadeDate(t):null;break}case"dateOnly":{const t=n[p];e[p]=t?t instanceof O?t:O.fromReader(t):null;break}case"time":{const t=n[p];e[p]=t?t instanceof T?t:T.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[p]=n[p]}}}function Z(e,i){for(const r of e)i.push(r),r.type==="dictionary"&&Z(r.properties,i);return i}function R(e,i,r,o,a){const{spatialReference:n,interceptor:c,lruCache:p,console:t,abortSignal:u,timeZone:m,services:S={portal:M.getDefault()}}=r,b={vars:{},spatialReference:n,interceptor:c,timeZone:m,lrucache:p,useAsync:a,services:S,console:t,abortSignal:u};return i&&h(b.vars,e.variables,i,o,r),b}function v(e,i){switch(i.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const r=(e.type,e),o="geometry"in r?r.geometry():null,a="readAttributes"in r?r.readAttributes():r.attributes;return new j({geometry:o,attributes:a})}case"dictionary":{const r=e,o=r.attributes,a={};for(const n of Object.keys(o))a[n]=v(r.field(n),i);return a}case"array":return("toArray"in e?e.toArray():e).map(r=>v(r,i))}return e}const F={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},D={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},U=new Map([["aggregate-field",{variables:[{name:"$feature",type:"feature"}]}],["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",F],["popup-element",F],["feature-reduction-popup",D],["feature-reduction-popup-element",D],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function $t(e){const i=U.get(e);if(!i){const r=Array.from(U.keys()).map(o=>`'${o}'`).join(", ");throw new w("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${r}`)}return P(i)}async function At(e,i,r={}){d||(d=await L());const{arcade:o,arcadeUtils:a}=d,{loadScriptDependencies:n,referencesMember:c,scriptIsAsync:p}=o,t=Z(i.variables,[]),u=t.filter(s=>s.type==="featureSet"||s.type==="featureSetCollection").map(s=>s.name.toLowerCase()),m=o.parseScript(e,u);if(!m)throw new w("arcade:invalid-script","Unable to create SyntaxTree");const S=a.extractFieldNames(m),b=o.scriptTouchesGeometry(m),C=t.map(s=>s.name.toLowerCase()).filter(s=>c(m,s)),l=p(m,u);await n(m,l,u);const $={vars:{},spatialReference:null,useAsync:l};for(const s of C)$.vars[s]="any";const{lruCache:A}=r,x=o.compileScript(m,$),k=o.featureSetUtils(),{services:G}=r;return{execute:(s,f={})=>{if(l)throw new w("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const y=x(R(i,s,{lruCache:A,...f},k,l));return f.rawOutput?y:v(y,a)},executeAsync:async(s,f={})=>{const y=await x(R(i,s,{lruCache:A,services:G,...f},k,l));return f.rawOutput?y:v(y,a)},isAsync:l,variablesUsed:C,fieldsUsed:S,geometryUsed:b,syntaxTree:m}}export{At as createArcadeExecutor,$t as createArcadeProfile}; diff --git a/main/assets/arcadeAsyncRuntime-B-LnqhTo-C_ijf5yV.js b/main/assets/arcadeAsyncRuntime-B-LnqhTo-C_ijf5yV.js new file mode 100644 index 000000000..102ead72c --- /dev/null +++ b/main/assets/arcadeAsyncRuntime-B-LnqhTo-C_ijf5yV.js @@ -0,0 +1,2 @@ +import{C as pt,X as wt,M as dt,L as ht,f as gt,m as mt,s as yt,a as rt,p as vt,N as M,e as y,b as J,D as ot}from"./arcadeUtils-DpP0k7IY-BXKRfMc2.js";import{w as Q,b as R,T as l,n as s,B as W,a5 as v,a9 as z,l as p,U as S,a6 as F,a7 as E,N as at,y as g,C as U,S as C,f,t as k,Z as j,M as O,V as bt,o as D,a0 as St,z as xt,a8 as Ft,H as It,a4 as T,r as Rt,ac as Mt,ad as $}from"./languageUtils-BYxF9hRA-BLoYMqdU.js";import{registerFunctions as At}from"./geomasync-uGYsifQH-iajyCE0f.js";import{J as nt,d as tt}from"./main-C7yV2j71.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./number-eRKYXfX9-C213qXfW.js";import"./shared-D1w-26bA-CNuAEz8h.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./portalUtils-CKN9iXwH-D_ZWpoBZ.js";import"./geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js";import"./workers-PiCjreoO-DqI62TYf.js";const K=100;async function X(e,t){const r=[];for(let o=0;o{const o={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter+1},globalScope:this.context.globalScope};if(o.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,null);return Z(this.definition,o,r,null)}}call(t,r){return B(t,r,(o,a,n)=>{const i={spatialReference:t.spatialReference,services:t.services,console:t.console,libraryResolver:t.libraryResolver,exports:t.exports,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{},abortSignal:t.abortSignal,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,r);return Z(this.definition,i,n,r)})}marshalledCall(t,r,o,a){return a(t,r,async(n,i,c)=>{const w={spatialReference:t.spatialReference,globalScope:o.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,abortSignal:t.abortSignal,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{}};return c=c.map(d=>!S(d)||d instanceof T?d:$(d,t,a)),$(await Z(this.definition,w,c,r),o,a)})}}class A extends It{constructor(t){super(),this.source=t}async global(t){const r=this.executingContext.globalScope[t.toLowerCase()];if(r.valueset||(r.value=await u(this.executingContext,r.node),r.valueset=!0),S(r.value)&&!(r.value instanceof T)){const o=new T;o.fn=r.value,o.parameterEvaluator=B,o.context=this.executingContext,r.value=o}return r.value}setGlobal(t,r){if(S(r))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:r,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}async loadModule(t){let r=t.spatialReference;r==null&&(r=new nt({wkid:102100})),this.moduleScope=ut({},t.customfunctions,t.timeZone),this.executingContext={spatialReference:r,services:t.services,libraryResolver:new rt(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:t.abortSignal===void 0||t.abortSignal===null?{aborted:!1}:t.abortSignal,globalScope:this.moduleScope,console:t.console??ft,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:null,depthCounter:{depth:1}},await H(this.executingContext,this.source.syntax)}}async function B(e,t,r){return t.preparsed===!0?r(e,null,t.arguments):r(e,t,await X(e,t))}async function u(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"UpdateExpression":return await Kt(e,t);case"AssignmentExpression":return await Lt(e,t);case"TemplateLiteral":return await Jt(e,t);case"Identifier":return await Y(e,t);case"MemberExpression":return await _t(e,t);case"Literal":return t.value;case"CallExpression":return await Yt(e,t);case"UnaryExpression":return await Wt(e,t);case"BinaryExpression":return await Xt(e,t);case"LogicalExpression":return await Ht(e,t);case"ArrayExpression":return await zt(e,t);case"ObjectExpression":return await Nt(e,t);default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function b(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"ImportDeclaration":return await qt(e,t);case"ExportNamedDeclaration":return await Gt(e,t);case"VariableDeclaration":return await lt(e,t,0);case"BlockStatement":return await H(e,t);case"FunctionDeclaration":return await Pt(e,t);case"ReturnStatement":return await Tt(e,t);case"IfStatement":return await Dt(e,t);case"ExpressionStatement":return await Zt(e,t);case"ForStatement":return await Bt(e,t);case"WhileStatement":return await kt(e,t);case"ForInStatement":return await jt(e,t);case"BreakStatement":return F;case"EmptyStatement":return p;case"ContinueStatement":return E;default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function Nt(e,t){const r=[];for(let i=0;i{try{r.testResult===!0?++n>K?(n=0,setTimeout(()=>{P(e,t,r,o,a,n)},0)):P(e,t,r,o,a,n):r.lastAction instanceof v?o(r.lastAction):o(p)}catch(i){a(i)}},i=>{a(i)})}catch(i){a(i)}}async function Bt(e,t){try{return t.init!==null&&(t.init.type==="VariableDeclaration"?await b(e,t.init):await u(e,t.init)),await new Promise((r,o)=>{P(e,t,{testResult:!0,lastAction:p},a=>{r(a)},a=>{o(a)},0)})}catch(r){throw r}}function q(e,t,r,o,a,n,i,c,w,d){try{if(o<=n)return void c(p);a.value=i==="k"?r[n]:n,b(e,t.body).then(m=>{try{m instanceof v?c(m):m===F?c(p):++d>K?(d=0,setTimeout(()=>{q(e,t,r,o,a,n+1,i,c,w,d)},0)):q(e,t,r,o,a,n+1,i,c,w,d)}catch(L){w(L)}},m=>{w(m)})}catch(m){w(m)}}function G(e,t,r,o,a,n,i,c,w){try{if(r.length()<=a)return void i(p);o.value=n==="k"?r.get(a):a,b(e,t.body).then(d=>{d instanceof v?i(d):d===F?i(p):++w>K?(w=0,setTimeout(()=>{G(e,t,r,o,a+1,n,i,c,w)},0)):G(e,t,r,o,a+1,n,i,c,w)},d=>{c(d)})}catch(d){c(d)}}function V(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length===0)return void o.resolve(p);q(e,t,r,r.length,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Et(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length()===0)return void o.resolve(p);G(e,t,r,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Ut(e,t,r,o,a){try{V(e,t,r.keys(),o,a,"k")}catch(n){o.reject(n)}}function _(e,t,r,o,a,n,i,c){try{e.next().then(w=>{try{if(w===null)n(p);else{const d=ot.createFromGraphicLikeObject(w.geometry,w.attributes,o,t.timeZone);d._underlyingGraphic=w,a.value=d,b(t,r.body).then(m=>{try{m===F?n(p):m instanceof v?n(m):++c>K?(c=0,setTimeout(()=>{_(e,t,r,o,a,n,i,c)},0)):_(e,t,r,o,a,n,i,c)}catch(L){i(L)}},m=>{i(m)})}}catch(d){i(d)}},w=>{i(w)})}catch(w){i(w)}}async function jt(e,t){return new Promise((r,o)=>{u(e,t.right).then(a=>{try{let n;n=t.left.type==="VariableDeclaration"?b(e,t.left):Promise.resolve(),n.then(()=>{try{const i=y(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);let c=null;if(e.localScope!=null&&e.localScope[i]!==void 0&&(c=e.localScope[i]),c===null&&e.globalScope[i]!==void 0&&(c=e.globalScope[i]),c===null)return void o(new l(e,s.InvalidIdentifier,t));U(a)||g(a)?V(e,t,a,{reject:o,resolve:r},c):j(a)?Et(e,t,a,{reject:o,resolve:r},c):a instanceof M||k(a)?Ut(e,t,a,{reject:o,resolve:r},c):Rt(a)?_(a.iterator(e.abortSignal),e,t,a,c,w=>{r(w)},w=>{o(w)},0):V(e,t,[],{reject:o,resolve:r},c)}catch(i){o(i)}},o)}catch(n){o(n)}},o)})}async function Kt(e,t){const r=t.argument;if(r.type==="CallExpression")throw new l(e,s.NeverReach,t);if(r.type==="MemberExpression"){const n=await u(e,r.object);let i,c;if(r.computed===!0)i=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.Unrecognized,t);i=r.property.name}if(U(n)){if(!C(i))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(i<0&&(i=n.length+i),i<0||i>=n.length)throw new l(e,s.OutOfBounds,t);c=f(n[i]),n[i]=t.operator==="++"?c+1:c-1}else if(n instanceof M){if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}else if(n instanceof A){if(g(i)===!1)throw new l(e,s.ModuleAccessorMustBeString,t);if(n.hasGlobal(i)!==!0)throw new l(e,s.ModuleExportNotFound,t);c=f(await n.global(i)),n.setGlobal(i,t.operator==="++"?c+1:c-1)}else{if(!k(n))throw j(n)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}return t.prefix===!1?c:t.operator==="++"?c+1:c-1}const o=y(r);let a;if(e.localScope!=null&&e.localScope[o]!==void 0)return a=f(e.localScope[o].value),e.localScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;if(e.globalScope[o]!==void 0)return a=f(e.globalScope[o].value),e.globalScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;throw new l(e,s.InvalidIdentifier,t)}function x(e,t,r,o,a){switch(t){case"=":return e===p?null:e;case"/=":return f(r)/f(e);case"*=":return f(r)*f(e);case"-=":return f(r)-f(e);case"+=":return g(r)||g(e)?O(r)+O(e):f(r)+f(e);case"%=":return f(r)%f(e);default:throw new l(a,s.UnsupportedOperator,o)}}async function Lt(e,t){const r=t.left;if(r.type==="MemberExpression"){const a=await u(e,r.object);let n;if(r.computed===!0)n=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);n=r.property.name}const i=await u(e,t.right);if(U(a)){if(!C(n))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(n<0&&(n=a.length+n),n<0||n>a.length)throw new l(e,s.OutOfBounds,t);if(n===a.length){if(t.operator!=="=")throw new l(e,s.OutOfBounds,t);a[n]=x(i,t.operator,a[n],t,e)}else a[n]=x(i,t.operator,a[n],t,e)}else if(a instanceof M){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}else if(a instanceof A){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasGlobal(n)!==!0)throw new l(e,s.ModuleExportNotFound,t);a.setGlobal(n,x(i,t.operator,await a.global(n),t,e))}else{if(!k(a))throw j(a)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}return p}const o=y(r);if(e.localScope!=null&&e.localScope[o]!==void 0){const a=await u(e,t.right);return e.localScope[o]={value:x(a,t.operator,e.localScope[o].value,t,e),valueset:!0,node:t.right},p}if(e.globalScope[o]!==void 0){const a=await u(e,t.right);return e.globalScope[o]={value:x(a,t.operator,e.globalScope[o].value,t,e),valueset:!0,node:t.right},p}throw new l(e,s.InvalidIdentifier,t)}async function Zt(e,t){const r=await u(e,t.expression);return r===p?p:new z(r)}async function Dt(e,t){const r=await u(e,t.test);if(r===!0)return b(e,t.consequent);if(r===!1)return t.alternate!==null?b(e,t.alternate):p;throw new l(e,s.BooleanConditionRequired,t)}async function H(e,t){return it(e,t,0)}async function it(e,t,r){if(r>=t.body.length)return p;const o=await b(e,t.body[r]);return o instanceof v||o===F||o===E||r===t.body.length-1?o:it(e,t,r+1)}async function Tt(e,t){if(t.argument===null)return new v(p);const r=await u(e,t.argument);return new v(r)}async function Pt(e,t){const r=y(t.id);return e.globalScope[r]={valueset:!0,node:null,value:new Ct(t,e)},p}async function qt(e,t){const r=y(t.specifiers[0].local),o=e.libraryResolver.loadLibrary(r);let a;return e.libraryResolver._moduleSingletons?.has(o.uri)?a=e.libraryResolver._moduleSingletons.get(o.uri):(a=new A(o),await a.loadModule(e),e.libraryResolver._moduleSingletons?.set(o.uri,a)),e.globalScope[r]={value:a,valueset:!0,node:t},p}async function Gt(e,t){if(await b(e,t.declaration),t.declaration.type==="FunctionDeclaration")e.exports[y(t.declaration.id)]="function";else if(t.declaration.type==="VariableDeclaration")for(const r of t.declaration.declarations)e.exports[y(r.id)]="variable";return p}async function lt(e,t,r){return r>=t.declarations.length?p:(await Vt(e,t.declarations[r]),r===t.declarations.length-1||await lt(e,t,r+1),p)}async function Vt(e,t){let r=null;if(r=t.init===null?null:await u(e,t.init),e.localScope!==null){if(r===p&&(r=null),t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const a=y(t.id);return void(e.localScope!=null&&(e.localScope[a]={value:r,valueset:!0,node:t.init}))}if(t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const o=y(t.id);r===p&&(r=null),e.globalScope[o]={value:r,valueset:!0,node:t.init}}async function _t(e,t){const r=await u(e,t.object);if(r===null)throw new l(e,s.MemberOfNull,t);if(t.computed===!1){if(t.property.type==="Identifier"){if(r instanceof M||k(r))return r.field(t.property.name);if(r instanceof tt)return J(r,t.property.name,e,t);if(r instanceof A){if(!r.hasGlobal(t.property.name))throw new l(e,s.InvalidIdentifier,t);return r.global(t.property.name)}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}let o=await u(e,t.property);if(r instanceof M||k(r)){if(g(o))return r.field(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof A){if(g(o))return r.global(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof tt){if(g(o))return J(r,o,e,t);throw new l(e,s.InvalidMemberAccessKey,t)}if(U(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}if(j(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length()+o),o>=r.length()||o<0)throw new l(e,s.OutOfBounds,t);return r.get(o)}throw new l(e,s.InvalidMemberAccessKey,t)}if(g(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}async function Wt(e,t){const r=await u(e,t.argument);if(R(r)){if(t.operator==="!")return!r;if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}async function zt(e,t){const r=[];for(let o=0;o>":case">>>":case"^":case"&":return St(f(r),f(o),t.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return bt(r,o,t.operator);case"+":return g(r)||g(o)?O(r)+O(o):f(r)+f(o);case"-":return f(r)-f(o);case"*":return f(r)*f(o);case"/":return f(r)/f(o);case"%":return f(r)%f(o);default:throw new l(e,s.UnsupportedOperator,t)}}async function Ht(e,t){const r=await u(e,t.left);if(!R(r))throw new l(e,s.LogicalExpressionOnlyBoolean,t);switch(t.operator){case"||":{if(r===!0)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}case"&&":{if(r===!1)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}default:throw new l(e,s.LogicExpressionOrAnd,t)}}async function Y(e,t){const r=y(t);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}throw new l(e,s.InvalidIdentifier,t)}async function Yt(e,t){if(t.callee.type==="MemberExpression"){const o=await u(e,t.callee.object);if(!(o instanceof A))throw new l(e,s.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:await u(e,t.callee.property);if(!o.hasGlobal(a))throw new l(e,s.FunctionNotFound,t);const n=await o.global(a);if(!S(n))throw new l(e,s.CallNonFunction,t);return n.call(e,t)}if(t.callee.type!=="Identifier")throw new l(e,s.FunctionNotFound,t);const r=y(t.callee);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}throw new l(e,s.FunctionNotFound,t)}async function Jt(e,t){let r="",o=0;for(const a of t.quasis)if(r+=a.value?a.value.cooked:"",a.tail===!1){if(t.expressions[o]){const n=await u(e,t.expressions[o]);if(S(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);r+=O(n)}o++}return r}const h={};async function st(e,t,r,o){const a=await u(e,t.arguments[r]);if(D(a,o))return u(e,t.arguments[r+1]);const n=t.arguments.length-r;return n===1?u(e,t.arguments[r]):n===2?null:n===3?u(e,t.arguments[r+2]):st(e,t,r+2,o)}async function ct(e,t,r,o){if(o===!0)return u(e,t.arguments[r+1]);if(t.arguments.length-r===3)return u(e,t.arguments[r+2]);const a=await u(e,t.arguments[r+2]);if(R(a)===!1)throw new l(e,s.ModuleExportNotFound,t.arguments[r+2]);return ct(e,t,r+2,a)}async function Z(e,t,r,o){const a=e.body;if(r.length!==e.params.length)throw new l(t,s.WrongNumberOfParameters,null);for(let i=0;i{const o={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter+1},globalScope:this.context.globalScope};if(o.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,null);return Z(this.definition,o,r,null)}}call(t,r){return B(t,r,(o,a,n)=>{const i={spatialReference:t.spatialReference,services:t.services,console:t.console,libraryResolver:t.libraryResolver,exports:t.exports,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{},abortSignal:t.abortSignal,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,r);return Z(this.definition,i,n,r)})}marshalledCall(t,r,o,a){return a(t,r,async(n,i,c)=>{const w={spatialReference:t.spatialReference,globalScope:o.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,abortSignal:t.abortSignal,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{}};return c=c.map(d=>!S(d)||d instanceof T?d:$(d,t,a)),$(await Z(this.definition,w,c,r),o,a)})}}class A extends It{constructor(t){super(),this.source=t}async global(t){const r=this.executingContext.globalScope[t.toLowerCase()];if(r.valueset||(r.value=await u(this.executingContext,r.node),r.valueset=!0),S(r.value)&&!(r.value instanceof T)){const o=new T;o.fn=r.value,o.parameterEvaluator=B,o.context=this.executingContext,r.value=o}return r.value}setGlobal(t,r){if(S(r))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:r,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}async loadModule(t){let r=t.spatialReference;r==null&&(r=new nt({wkid:102100})),this.moduleScope=ut({},t.customfunctions,t.timeZone),this.executingContext={spatialReference:r,services:t.services,libraryResolver:new rt(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:t.abortSignal===void 0||t.abortSignal===null?{aborted:!1}:t.abortSignal,globalScope:this.moduleScope,console:t.console??ft,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:null,depthCounter:{depth:1}},await H(this.executingContext,this.source.syntax)}}async function B(e,t,r){return t.preparsed===!0?r(e,null,t.arguments):r(e,t,await X(e,t))}async function u(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"UpdateExpression":return await Kt(e,t);case"AssignmentExpression":return await Lt(e,t);case"TemplateLiteral":return await Jt(e,t);case"Identifier":return await Y(e,t);case"MemberExpression":return await _t(e,t);case"Literal":return t.value;case"CallExpression":return await Yt(e,t);case"UnaryExpression":return await Wt(e,t);case"BinaryExpression":return await Xt(e,t);case"LogicalExpression":return await Ht(e,t);case"ArrayExpression":return await zt(e,t);case"ObjectExpression":return await Nt(e,t);default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function b(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"ImportDeclaration":return await qt(e,t);case"ExportNamedDeclaration":return await Gt(e,t);case"VariableDeclaration":return await lt(e,t,0);case"BlockStatement":return await H(e,t);case"FunctionDeclaration":return await Pt(e,t);case"ReturnStatement":return await Tt(e,t);case"IfStatement":return await Dt(e,t);case"ExpressionStatement":return await Zt(e,t);case"ForStatement":return await Bt(e,t);case"WhileStatement":return await kt(e,t);case"ForInStatement":return await jt(e,t);case"BreakStatement":return F;case"EmptyStatement":return p;case"ContinueStatement":return E;default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function Nt(e,t){const r=[];for(let i=0;i{try{r.testResult===!0?++n>K?(n=0,setTimeout(()=>{P(e,t,r,o,a,n)},0)):P(e,t,r,o,a,n):r.lastAction instanceof v?o(r.lastAction):o(p)}catch(i){a(i)}},i=>{a(i)})}catch(i){a(i)}}async function Bt(e,t){try{return t.init!==null&&(t.init.type==="VariableDeclaration"?await b(e,t.init):await u(e,t.init)),await new Promise((r,o)=>{P(e,t,{testResult:!0,lastAction:p},a=>{r(a)},a=>{o(a)},0)})}catch(r){throw r}}function q(e,t,r,o,a,n,i,c,w,d){try{if(o<=n)return void c(p);a.value=i==="k"?r[n]:n,b(e,t.body).then(m=>{try{m instanceof v?c(m):m===F?c(p):++d>K?(d=0,setTimeout(()=>{q(e,t,r,o,a,n+1,i,c,w,d)},0)):q(e,t,r,o,a,n+1,i,c,w,d)}catch(L){w(L)}},m=>{w(m)})}catch(m){w(m)}}function G(e,t,r,o,a,n,i,c,w){try{if(r.length()<=a)return void i(p);o.value=n==="k"?r.get(a):a,b(e,t.body).then(d=>{d instanceof v?i(d):d===F?i(p):++w>K?(w=0,setTimeout(()=>{G(e,t,r,o,a+1,n,i,c,w)},0)):G(e,t,r,o,a+1,n,i,c,w)},d=>{c(d)})}catch(d){c(d)}}function V(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length===0)return void o.resolve(p);q(e,t,r,r.length,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Et(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length()===0)return void o.resolve(p);G(e,t,r,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Ut(e,t,r,o,a){try{V(e,t,r.keys(),o,a,"k")}catch(n){o.reject(n)}}function _(e,t,r,o,a,n,i,c){try{e.next().then(w=>{try{if(w===null)n(p);else{const d=ot.createFromGraphicLikeObject(w.geometry,w.attributes,o,t.timeZone);d._underlyingGraphic=w,a.value=d,b(t,r.body).then(m=>{try{m===F?n(p):m instanceof v?n(m):++c>K?(c=0,setTimeout(()=>{_(e,t,r,o,a,n,i,c)},0)):_(e,t,r,o,a,n,i,c)}catch(L){i(L)}},m=>{i(m)})}}catch(d){i(d)}},w=>{i(w)})}catch(w){i(w)}}async function jt(e,t){return new Promise((r,o)=>{u(e,t.right).then(a=>{try{let n;n=t.left.type==="VariableDeclaration"?b(e,t.left):Promise.resolve(),n.then(()=>{try{const i=y(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);let c=null;if(e.localScope!=null&&e.localScope[i]!==void 0&&(c=e.localScope[i]),c===null&&e.globalScope[i]!==void 0&&(c=e.globalScope[i]),c===null)return void o(new l(e,s.InvalidIdentifier,t));U(a)||g(a)?V(e,t,a,{reject:o,resolve:r},c):j(a)?Et(e,t,a,{reject:o,resolve:r},c):a instanceof M||k(a)?Ut(e,t,a,{reject:o,resolve:r},c):Rt(a)?_(a.iterator(e.abortSignal),e,t,a,c,w=>{r(w)},w=>{o(w)},0):V(e,t,[],{reject:o,resolve:r},c)}catch(i){o(i)}},o)}catch(n){o(n)}},o)})}async function Kt(e,t){const r=t.argument;if(r.type==="CallExpression")throw new l(e,s.NeverReach,t);if(r.type==="MemberExpression"){const n=await u(e,r.object);let i,c;if(r.computed===!0)i=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.Unrecognized,t);i=r.property.name}if(U(n)){if(!C(i))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(i<0&&(i=n.length+i),i<0||i>=n.length)throw new l(e,s.OutOfBounds,t);c=f(n[i]),n[i]=t.operator==="++"?c+1:c-1}else if(n instanceof M){if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}else if(n instanceof A){if(g(i)===!1)throw new l(e,s.ModuleAccessorMustBeString,t);if(n.hasGlobal(i)!==!0)throw new l(e,s.ModuleExportNotFound,t);c=f(await n.global(i)),n.setGlobal(i,t.operator==="++"?c+1:c-1)}else{if(!k(n))throw j(n)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}return t.prefix===!1?c:t.operator==="++"?c+1:c-1}const o=y(r);let a;if(e.localScope!=null&&e.localScope[o]!==void 0)return a=f(e.localScope[o].value),e.localScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;if(e.globalScope[o]!==void 0)return a=f(e.globalScope[o].value),e.globalScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;throw new l(e,s.InvalidIdentifier,t)}function x(e,t,r,o,a){switch(t){case"=":return e===p?null:e;case"/=":return f(r)/f(e);case"*=":return f(r)*f(e);case"-=":return f(r)-f(e);case"+=":return g(r)||g(e)?O(r)+O(e):f(r)+f(e);case"%=":return f(r)%f(e);default:throw new l(a,s.UnsupportedOperator,o)}}async function Lt(e,t){const r=t.left;if(r.type==="MemberExpression"){const a=await u(e,r.object);let n;if(r.computed===!0)n=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);n=r.property.name}const i=await u(e,t.right);if(U(a)){if(!C(n))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(n<0&&(n=a.length+n),n<0||n>a.length)throw new l(e,s.OutOfBounds,t);if(n===a.length){if(t.operator!=="=")throw new l(e,s.OutOfBounds,t);a[n]=x(i,t.operator,a[n],t,e)}else a[n]=x(i,t.operator,a[n],t,e)}else if(a instanceof M){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}else if(a instanceof A){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasGlobal(n)!==!0)throw new l(e,s.ModuleExportNotFound,t);a.setGlobal(n,x(i,t.operator,await a.global(n),t,e))}else{if(!k(a))throw j(a)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}return p}const o=y(r);if(e.localScope!=null&&e.localScope[o]!==void 0){const a=await u(e,t.right);return e.localScope[o]={value:x(a,t.operator,e.localScope[o].value,t,e),valueset:!0,node:t.right},p}if(e.globalScope[o]!==void 0){const a=await u(e,t.right);return e.globalScope[o]={value:x(a,t.operator,e.globalScope[o].value,t,e),valueset:!0,node:t.right},p}throw new l(e,s.InvalidIdentifier,t)}async function Zt(e,t){const r=await u(e,t.expression);return r===p?p:new z(r)}async function Dt(e,t){const r=await u(e,t.test);if(r===!0)return b(e,t.consequent);if(r===!1)return t.alternate!==null?b(e,t.alternate):p;throw new l(e,s.BooleanConditionRequired,t)}async function H(e,t){return it(e,t,0)}async function it(e,t,r){if(r>=t.body.length)return p;const o=await b(e,t.body[r]);return o instanceof v||o===F||o===E||r===t.body.length-1?o:it(e,t,r+1)}async function Tt(e,t){if(t.argument===null)return new v(p);const r=await u(e,t.argument);return new v(r)}async function Pt(e,t){const r=y(t.id);return e.globalScope[r]={valueset:!0,node:null,value:new Ct(t,e)},p}async function qt(e,t){const r=y(t.specifiers[0].local),o=e.libraryResolver.loadLibrary(r);let a;return e.libraryResolver._moduleSingletons?.has(o.uri)?a=e.libraryResolver._moduleSingletons.get(o.uri):(a=new A(o),await a.loadModule(e),e.libraryResolver._moduleSingletons?.set(o.uri,a)),e.globalScope[r]={value:a,valueset:!0,node:t},p}async function Gt(e,t){if(await b(e,t.declaration),t.declaration.type==="FunctionDeclaration")e.exports[y(t.declaration.id)]="function";else if(t.declaration.type==="VariableDeclaration")for(const r of t.declaration.declarations)e.exports[y(r.id)]="variable";return p}async function lt(e,t,r){return r>=t.declarations.length?p:(await Vt(e,t.declarations[r]),r===t.declarations.length-1||await lt(e,t,r+1),p)}async function Vt(e,t){let r=null;if(r=t.init===null?null:await u(e,t.init),e.localScope!==null){if(r===p&&(r=null),t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const a=y(t.id);return void(e.localScope!=null&&(e.localScope[a]={value:r,valueset:!0,node:t.init}))}if(t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const o=y(t.id);r===p&&(r=null),e.globalScope[o]={value:r,valueset:!0,node:t.init}}async function _t(e,t){const r=await u(e,t.object);if(r===null)throw new l(e,s.MemberOfNull,t);if(t.computed===!1){if(t.property.type==="Identifier"){if(r instanceof M||k(r))return r.field(t.property.name);if(r instanceof tt)return J(r,t.property.name,e,t);if(r instanceof A){if(!r.hasGlobal(t.property.name))throw new l(e,s.InvalidIdentifier,t);return r.global(t.property.name)}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}let o=await u(e,t.property);if(r instanceof M||k(r)){if(g(o))return r.field(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof A){if(g(o))return r.global(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof tt){if(g(o))return J(r,o,e,t);throw new l(e,s.InvalidMemberAccessKey,t)}if(U(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}if(j(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length()+o),o>=r.length()||o<0)throw new l(e,s.OutOfBounds,t);return r.get(o)}throw new l(e,s.InvalidMemberAccessKey,t)}if(g(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}async function Wt(e,t){const r=await u(e,t.argument);if(R(r)){if(t.operator==="!")return!r;if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}async function zt(e,t){const r=[];for(let o=0;o>":case">>>":case"^":case"&":return St(f(r),f(o),t.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return bt(r,o,t.operator);case"+":return g(r)||g(o)?O(r)+O(o):f(r)+f(o);case"-":return f(r)-f(o);case"*":return f(r)*f(o);case"/":return f(r)/f(o);case"%":return f(r)%f(o);default:throw new l(e,s.UnsupportedOperator,t)}}async function Ht(e,t){const r=await u(e,t.left);if(!R(r))throw new l(e,s.LogicalExpressionOnlyBoolean,t);switch(t.operator){case"||":{if(r===!0)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}case"&&":{if(r===!1)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}default:throw new l(e,s.LogicExpressionOrAnd,t)}}async function Y(e,t){const r=y(t);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}throw new l(e,s.InvalidIdentifier,t)}async function Yt(e,t){if(t.callee.type==="MemberExpression"){const o=await u(e,t.callee.object);if(!(o instanceof A))throw new l(e,s.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:await u(e,t.callee.property);if(!o.hasGlobal(a))throw new l(e,s.FunctionNotFound,t);const n=await o.global(a);if(!S(n))throw new l(e,s.CallNonFunction,t);return n.call(e,t)}if(t.callee.type!=="Identifier")throw new l(e,s.FunctionNotFound,t);const r=y(t.callee);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}throw new l(e,s.FunctionNotFound,t)}async function Jt(e,t){let r="",o=0;for(const a of t.quasis)if(r+=a.value?a.value.cooked:"",a.tail===!1){if(t.expressions[o]){const n=await u(e,t.expressions[o]);if(S(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);r+=O(n)}o++}return r}const h={};async function st(e,t,r,o){const a=await u(e,t.arguments[r]);if(D(a,o))return u(e,t.arguments[r+1]);const n=t.arguments.length-r;return n===1?u(e,t.arguments[r]):n===2?null:n===3?u(e,t.arguments[r+2]):st(e,t,r+2,o)}async function ct(e,t,r,o){if(o===!0)return u(e,t.arguments[r+1]);if(t.arguments.length-r===3)return u(e,t.arguments[r+2]);const a=await u(e,t.arguments[r+2]);if(R(a)===!1)throw new l(e,s.ModuleExportNotFound,t.arguments[r+2]);return ct(e,t,r+2,a)}async function Z(e,t,r,o){const a=e.body;if(r.length!==e.params.length)throw new l(t,s.WrongNumberOfParameters,null);for(let i=0;ii.map(i=>d[i]); +import{d as k,j as Ki,g as se,w as V,F as Gt,h as Xi,D as Qi,l as le,m as ae,G as We,n as Ne,p as yt,q as fn,r as Wn,t as $e,B as Gr,R as sr,Q as Yi,J as Pt,K as Zr,_ as je,O as jr,P as $i,f as ea}from"./main-C7yV2j71.js";import{T as h,n as c,U as Y,b as X,S as W,y as S,u as qe,v as _n,m as ta,E as _t,k as Vr,G as ur,C as _,Z as P,t as K,a as qn,R as nn,r as rn,h as Q,c as q,d as ce,w as D,e as B,f as m,M as E,P as oe,g as N,i as na,_ as lr,z as te,j as it,J as L,l as I,o as Pe,p as Ye,q as Tn,L as Tt,s as at,I as Jr,x as ra,$ as mn,W as ia,Q as aa,X as oa,A as sa,B as nt,D as Hn,F as ua,H as Kn,O as He,Y as cr,K as pn,N as la,V as Wr,a0 as qr,a1 as he,a2 as Dn,a3 as gn,a4 as ft,a5 as Fe,a6 as Le,a7 as Ot,a8 as Hr,a9 as an,aa as Kr,ab as Zt,ac as Xr,ad as Kt}from"./languageUtils-BYxF9hRA-BLoYMqdU.js";import{r as G,m as ye,O as we,u as jt,I as Se,A as Vt,z as re}from"./TimeOnly-DSMefxKy-C21ZkqlE.js";import{n as et}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ca}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import{o as ha}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{M as da}from"./number-eRKYXfX9-C213qXfW.js";import{M as hr}from"./shared-D1w-26bA-CNuAEz8h.js";import{r as Ft}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";function $(e){return e.name.toLowerCase()}let on=class{constructor(e,t){this._moduleSingletons=e,this._syntaxModules=t}loadLibrary(e){if(this._syntaxModules==null)return null;const t=this._syntaxModules[e];return t?{syntax:t.script,uri:t.uri}:null}};function fa(e){Qr=e}let Qr;function Mt(e){return e===null?null:ce(e)?e.clone():_t(e)?e:nn(e)?e.clone():P(e)?e.toArray().map(t=>Mt(t)):_(e)?e.map(t=>Mt(t)):K(e)?Qr.createFromArcadeFeature(e):Hn(e)||rn(e)?e:qn(e)||e?.declaredClass==="esri.arcade.Attachment"?e.deepClone():(e?.declaredClass==="esri.arcade.Portal"||ua(e)||e instanceof Kn||Y(e),e)}function Xt(e,t,n=!1,r=!1){if(e==null)return null;if(W(e))return m(e);if(X(e))return Tt(e);if(S(e))return E(e);if(ce(e))return oe(e,t);if(q(e)||Q(e))return e;if(_(e)){const s=[];for(const o of e)s.push(Xt(o,t,n,r));return s}if(r&&nn(e))return e;const a=new v;a.immutable=!1;for(const s of Object.keys(e)){const o=e[s];o!==void 0&&a.setField(s,Xt(o,t,n,r))}return a.immutable=n,a}let v=class Wt{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof Wt?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new h(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new h(null,c.Immutable,null);if(Y(n))throw new h(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=G.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const s=new Wt;s.immutable=!1;for(const o in t){const i=t[o];i!==void 0&&s.setField(o.toString(),Xt(i,n,r,a))}return s.immutable=r,s}static convertJsonToArcade(t,n,r=!1,a=!1){return Xt(t,n,r,a)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t?.keyTranslate&&(r=t.keyTranslate(r)),n[r]=_n(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,s){const o=await ta(r,a,s);return t[n]=o,o}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let s in this.attributes){const o=this.attributes[s];n?.keyTranslate&&(s=n.keyTranslate(s)),o!==void 0&&(_t(o)||o instanceof k||o instanceof G?r[s]=_n(o,n):a.push(this.castDictionaryValueAsJsonAsync(r,s,o,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new Wt;t.immutable=!1;for(const n of this.keys())t.setField(n,Mt(this.field(n)));return t}},Oe=0;function mt(e,t,n,r,a=1){let s;switch(t=t.toLowerCase()){case"hasz":{const o=e.hasZ;return o!==void 0&&o}case"hasm":{const o=e.hasM;return o!==void 0&&o}case"spatialreference":{let o=e.spatialReference._arcadeCacheId;if(o===void 0){let u=!0;Ki.isFrozen(e.spatialReference)&&(u=!1),u&&(Oe++,e.spatialReference._arcadeCacheId=Oe,o=Oe)}const i=new v({wkt:e.spatialReference.wkt,wkid:e.spatialReference.wkid});return o!==void 0&&(i._arcadeCacheId="SPREF"+o.toString()),i}}switch(e.type){case"extent":switch(t){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const o=e[t];return o!==void 0?o:null}case"type":return"Extent"}break;case"polygon":switch(t){case"rings":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.rings,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polygon"}break;case"point":switch(t){case"x":case"y":case"z":case"m":return e[t]??null;case"type":return"Point"}break;case"polyline":switch(t){case"paths":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.paths,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polyline"}break;case"multipoint":switch(t){case"points":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new Vr(e.points,e.spatialReference,e.hasZ===!0,e.hasM===!0,s,1);case"type":return"Multipoint"}}if(a===1)throw new h(n,c.InvalidIdentifier,r);return a===2?{keystate:"notfound"}:null}function Xn(e,t){let n,r=e;if(r==null)return null;if(_(t))n=t;else if(P(t))n=t.toArray();else{if(t==null)return null;n=[t]}for(const a of n){if(K(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(qn(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(nn(r)){if(S(a)===!1)return null;r=mt(r,a,null,null,0)}else if(_(r)){if(W(a)===!1)return null;r=a>=0?r[a]:r[r.length+a]}else{if(!P(r)||W(a)===!1)return null;r=a>=0?r.get(a):r.get(r.length()+a)}if(r==null)return null}return r}let H=class Ce{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new Ce;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof Ce){const r=new Ce;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return Ce.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new Ce;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t,n){const r=new Ce;return r.attributes=t.field("attributes"),r.attributes!==null&&r.attributes instanceof v?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=t.field("geometry"),r._geometry!==null&&(r._geometry instanceof v?r._geometry=Ce.parseGeometryFromDictionary(r._geometry,n):r._geometry instanceof k||(r._geometry=null)),r}static createFromGraphicLikeObject(t,n,r=null,a){const s=new Ce;return s.contextTimeZone=a??null,n===null&&(n={}),s.attributes=n,s._geometry=t??null,s._layer=r,s._layer&&(s._fieldTypesFixed=!1,s.fieldsIndex=this.hydrateFieldsIndex(s._layer)),s}static hydrateFieldsIndex(t){return t===null?null:rn(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:ha.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof ye||a instanceof we?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":qe(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let r=0;r0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){return this.fieldsIndex?.getTimeZone(t)==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function $r(e){const t=[];return j(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:$(n.specifiers[0].local),source:n.source.value}),!0)),t}function Da(e,t){let n=!1;const r=t.toLowerCase();return j(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function ga(e){const t=[];return j(e,n=>n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)),t}function ya(e){const t=[];return j(e,n=>{if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let r="";for(let a=0;a<(n.arguments||[]).length;a++)a===0?n.arguments[a].type==="Identifier"&&(r=n.arguments[a].name.toLowerCase()):r&&n.arguments[a].type==="Literal"&&fr(n.arguments[a].value)&&t.push(r+"."+n.arguments[a].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let r="";return n.arguments[0].type==="Identifier"&&(r=n.arguments[0].name.toLowerCase()),r&&n.arguments[1].type==="Literal"&&fr(n.arguments[1].value)&&t.push(r+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)}),t}function Nn(e){const t=[];return j(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Ut(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Nn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Yr(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,$r(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Nn(e));for(let r=0;r0||u.length>0;)if(i.length>0&&u.length>0){let d=l(i[0],u[0]);isNaN(d)&&(d=0),d<=0?(f.push(i[0]),i=i.slice(1)):(f.push(u[0]),u=u.slice(1))}else i.length>0?(f.push(i[0]),i=i.slice(1)):u.length>0&&(f.push(u[0]),u=u.slice(1));return f}async function a(i,u){const l=i.length,f=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const d=[await a(i.slice(0,f),u),await a(i.slice(f,l),u)];return s(d[0],d[1],u,[])}async function s(i,u,l,f){const d=f;if(i.length>0||u.length>0){if(i.length>0&&u.length>0){let p=await l(i[0],u[0]);return isNaN(p)&&(p=1),p<=0?(d.push(i[0]),i=i.slice(1)):(d.push(u[0]),u=u.slice(1)),s(i,u,l,f)}return i.length>0?(d.push(i[0]),s(i=i.slice(1),u,l,f)):(d.push(u[0]),s(i,u=u.slice(1),l,f))}return f}function o(i,u,l,f){D(l,1,2,i,u);let d=l[0];if(P(d)&&(d=d.toArray()),_(d)===!1)throw new h(i,c.InvalidParameter,u);if(l.length>1){if(Y(l[1])===!1)throw new h(i,c.InvalidParameter,u);let x=d;const O=l[1].createFunction(i);return f?a(x,O):(x=n(x,(ne,de)=>O(ne,de)),x)}let p=d;if(p.length===0)return[];const g={};for(let x=0;x1||b==="String"?n(p,(x,O)=>{if(x==null||x===I)return O==null||O===I?0:1;if(O==null||O===I)return-1;const ne=E(x),de=E(O);return nex-O):b==="Boolean"?n(p,(x,O)=>x===O?0:O?-1:1):b==="Date"?n(p,(x,O)=>O-x):p.slice(),p}e.functions.array=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,0,2,i,u),d.length===0)return[];if(d.length===1&&d[0]===null)return[];if(_(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].slice()}if(P(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].toArray().slice()}const p=m(d[0]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=N(d[1],null),y=new Array(p);return y.fill(g),y})},e.functions.front=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(0)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][0]}throw new h(i,c.InvalidParameter,u)})},e.functions.back=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(d[0].length()-1)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][d[0].length-1]}throw new h(i,c.InvalidParameter,u)})},e.functions.push=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,2,i,u),_(d[0]))return d[0][d[0].length]=d[1],d[0].length;throw new h(i,c.InvalidParameter,u)})},e.functions.pop=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);const p=d[0][d[0].length-1];return d[0].length=d[0].length-1,p}throw new h(i,c.InvalidParameter,u)})},e.functions.erase=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,2,i,u),_(d[0])){let p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[0];if(g.length<=0)throw new h(i,c.OutOfBounds,u);if(p<0&&(p=g.length+p),p<0)throw new h(i,c.OutOfBounds,u);if(p>=g.length)throw new h(i,c.OutOfBounds,u);return g.splice(p,1),I}throw new h(i,c.InvalidParameter,u)})},e.functions.insert=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,3,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[2],y=d[0];if(p>y.length)throw new h(i,c.OutOfBounds,u);if(p<0&&p<-1*y.length)throw new h(i,c.OutOfBounds,u);return p===y.length?(y[p]=g,I):(y.splice(p,0,g),I)}throw new h(i,c.InvalidParameter,u)})},e.functions.resize=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(p<0)throw new h(i,c.InvalidParameter,u);const g=N(d[2],null),y=d[0];if(y.length>=p)return y.length=p,I;const b=y.length;y.length=p;for(let x=b;x{if(D(d,2,2,i,u),_(d[0])){const p=d[1];return!!d[0].some(g=>Pe(g,p))}if(P(d[0])){const p=d[1];return!!d[0].toArray().some(g=>Pe(g,p))}throw new h(i,c.InvalidParameter,u)})},e.functions.slice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,3,i,u),_(d[0])){const p=m(N(d[1],0)),g=m(N(d[2],d[0].length));if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);return d[0].slice(p,g)}if(P(d[0])){const p=d[0],g=m(N(d[1],0)),y=m(N(d[2],p.length()));if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(y)||He(y)===!1)throw new h(i,c.InvalidParameter,u);return p.toArray().slice(g,y)}throw new h(i,c.InvalidParameter,u)})},e.functions.splice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{const p=[];for(let g=0;g{if(D(d,2,2,i,u),_(d[0]))return m(d[1])>=d[0].length?d[0].slice():d[0].slice(0,m(d[1]));if(P(d[0]))return m(d[1])>=d[0].length()?d[0].slice():d[0].slice(0,m(d[1]));throw new h(i,c.InvalidParameter,u)})},e.functions.first=function(i,u){return e.standardFunction(i,u,(l,f,d)=>(D(d,1,1,i,u),_(d[0])?d[0].length===0?null:d[0][0]:P(d[0])?d[0].length()===0?null:d[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,u){return e.standardFunction(i,u,(l,f,d)=>o(i,f,d,!1))},e.functions.any=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=p(y);if(X(b)&&b===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)!==!0)return!1;return!0})},e.functions.none=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)===!0)return!1;return!0})},e.functions.reduce=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);return d.length===2?g.length===0?null:g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null}):g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null},d[2])})},e.functions.map=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=p(b);x!==void 0&&x!==I?y.push(x):y.push(null)}return y})},e.functions.filter=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g)p(b)===!0&&y.push(b);return y})}),e.mode==="async"&&(e.functions.sort=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>o(i,f,d,!0))},e.functions.any=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,X(x)&&x===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x!==!0)return!1}return!0})},e.functions.none=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x===!0)return!1}return!0})},e.functions.filter=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O===!0&&y.push(b)}return y})},e.functions.reduce=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);let y;if(d.length>2){const b=N(d[2],null);y=g.reduce(async(x,O)=>{let ne=await x;return ne!==void 0&&ne!==I||(ne=null),p(ne,O)},Promise.resolve(b))}else{if(g.length===0)return null;y=g.reduce(async(b,x,O)=>{if(O<=1)return p(b,x);let ne=await b;return ne!==void 0&&ne!==I||(ne=null),p(ne,x)})}return y.then(b=>b!==void 0&&b!==I?b:null)})},e.functions.map=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O!==void 0&&O!==I?y.push(O):y.push(null)}return y})})}const Rn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:wa},Symbol.toStringTag,{value:"Module"}));function xa(e,t,n){return e+(Fa(n)?Ca:Aa)[t]}function Fa(e){return e%4==0&&(e%100!=0||e%400==0)}const Aa=[0,31,59,90,120,151,181,212,243,273,304,334],Ca=[0,31,60,91,121,152,182,213,244,274,305,335];function Te(e){return e===null?e:e.isValid===!1?null:e}function At(e,t){return e===""||e.toLowerCase().trim()==="default"?B(t):e==="z"||e==="Z"?"UTC":e}function ze(e,t){return q(e)?e.toArcadeDate():oe(e,B(t))}function ei(e,t){e.today=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),G.dateJSAndZoneToArcadeDate(i,B(n))})},e.time=function(n,r){return t(n,r,(a,s,o)=>{switch(D(o,0,4,n,r),o.length){case 0:{const i=G.nowToArcadeDate(B(n));return new ye(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(Q(o[0]))return o[0].clone();if(ce(o[0]))return new ye(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(q(o[0]))return new ye(0,0,0,0);if(S(o[0]))return ye.fromString(o[0]);const i=m(o[0]);return isNaN(i)===!1?ye.fromMilliseconds(i):null}case 2:return S(o[0])&&S(o[1])?ye.fromString(o[0],o[1]):ye.fromParts(m(o[0]),m(o[1]),0,0);case 3:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),0);case 4:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),m(o[3]))}throw new h(n,c.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,3,n,r),o.length===3)return we.fromParts(m(o[0]),m(o[1])+1,m(o[2]));if(o.length===2){const i=E(o[1]);return i===""?null:i==="X"?we.fromSeconds(m(o[0])):i==="x"?we.fromMilliseconds(m(o[0])):we.fromString(E(o[0]),i)}if(o.length===1){if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return we.fromString(o[0]+"-01-01")}if(q(o[0]))return o[0].clone();if(ce(o[0]))return we.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const i=m(o[0]);return isNaN(i)===!1?we.fromMilliseconds(i):S(o[0])?we.fromString(o[0]):null}if(o.length===0){const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:we.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),o[0]===null)return null;if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneDateOnly,r);if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneTime,r);const i=oe(o[0],B(n));if(i===null)throw new h(n,c.InvalidParameter,r);const u=jt(At(E(o[1]),n),!1);if(u===null)return null;const l=G.arcadeDateAndZoneToArcadeDate(i,u);return l.isValid===!1?null:l})},e.timezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,2,n,r),Q(o[0])||q(o[0]))return"Unknown";const i=oe(o[0],B(n));if(i===null)return null;const u=i.timeZone;return u==="system"?G.systemTimeZoneCanonicalName:u.toLowerCase()==="utc"?"UTC":u.toLowerCase()==="unknown"?"Unknown":u})},e.timezoneoffset=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].hour;const i=oe(o[0],B(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].second;const i=oe(o[0],B(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].millisecond;const i=oe(o[0],B(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].minute;const i=oe(o[0],B(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=ze(o[0],B(n));if(i===null)return NaN;const u=m(N(o[1],0));if(u<0||u>6)throw new h(n,c.InvalidParameter,r);const l=i.day,f=i.monthJS,d=i.year,p=i.dayOfWeekJS,g=xa(l,f,d)-1,y=Math.floor(g/7);return p-u+(p-u<0?7:0){D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,8,n,r),o.length===3){if(q(o[0])&&Q(o[1])&&S(o[2])){const i=jt(At(E(o[2])??"unknown",n),!1);return i===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,i))}return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),0,0,0,0,B(n)))}if(o.length===4)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),0,0,0,B(n)));if(o.length===5)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),0,0,B(n)));if(o.length===6)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),0,B(n)));if(o.length===7)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),B(n)));if(o.length===8){const i=jt(At(E(o[7])??"unknown",n),!1);return i===null?null:Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),i))}if(o.length===2){if(q(o[0])&&S(o[1])){const l=jt(At(E(o[1])??"unknown",n),!1);return l===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,l))}if(q(o[0])&&Q(o[1]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let i,u=E(o[1]);return u===""?null:(u=na(u,!0),i=u==="X"?Gt.fromSeconds(m(o[0])):u==="x"?Gt.fromMillis(m(o[0])):Gt.fromFormat(E(o[0]),u,{locale:Xi(),numberingSystem:"latn"}),i.isValid?G.dateTimeToArcadeDate(i):null)}if(o.length===1){if(q(o[0]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return oe(o[0]+"-01-01",B(n))}const i=m(o[0]);if(isNaN(i)===!1){const u=Gt.fromMillis(i);return u.isValid?G.dateTimeAndZoneToArcadeDate(u,B(n)):null}return oe(o[0],B(n))}return o.length===0?G.nowToArcadeDate(B(n)):null})},e.datediff=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),Q(o[0]))return Q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(Q(o[1]))return NaN;if(q(o[0]))return q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(q(o[1]))return NaN;let i=oe(o[0],B(n)),u=oe(o[1],B(n));if(i===null||u===null)return NaN;let l=N(o[3],"");switch(l!==""&&l!==null?(l=At(E(l),n),i=G.arcadeDateAndZoneToArcadeDate(i,l),u=G.arcadeDateAndZoneToArcadeDate(u,l)):i.timeZone!==u.timeZone&&(i.isUnknownTimeZone?i=G.arcadeDateAndZoneToArcadeDate(i,u.timeZone):u=(u.isUnknownTimeZone,G.arcadeDateAndZoneToArcadeDate(u,i.timeZone))),E(o[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(u,"days");case"months":case"month":return i.diff(u,"months");case"minutes":case"minute":case"m":return o[2]==="M"?i.diff(u,"months"):i.diff(u,"minutes");case"seconds":case"second":case"s":return i.diff(u,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(u);case"hours":case"hour":case"h":return i.diff(u,"hours");case"years":case"year":case"y":return i.diff(u,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i)||i===1/0||i===-1/0)return Q(o[0])||q(o[0])?o[0].clone():oe(o[0],B(n));let u="milliseconds";switch(E(o[2]).toLowerCase()){case"days":case"day":case"d":u="days",i=q(o[0])?i:lr(i);break;case"months":case"month":u="months",i=q(o[0])?i:lr(i);break;case"minutes":case"minute":case"m":u=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":u="seconds";break;case"milliseconds":case"millisecond":case"ms":u="milliseconds";break;case"hours":case"hour":case"h":u="hours";break;case"years":case"year":case"y":u="years"}if(Q(o[0])||q(o[0]))return o[0].plus(u,i);const l=oe(o[0],B(n));return l===null?null:l.plus({[u]:i})})}}function De(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}function ti(e,t,n){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0)}const Et=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function Ea(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function ba(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new V(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new V(t)):null}function Ia(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let o=0;o=r;)e-=t;return e}function ri(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function _a(e,t){return ln(ri(e,t),2*Math.PI)*(180/Math.PI)}function Ta(e,t){return ln(Math.PI/2-ri(e,t),2*Math.PI)*(180/Math.PI)}function ii(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Ba(r,a),ka(r,a))}function Ma(e,t,n){return Gr(ln(ii(e,t,n),2*Math.PI))}function Na(e,t,n){return Gr(ln(-1*ii(e,t,n),2*Math.PI))}It[9002]=.3048,It[9003]=.3048006096012192,It[9095]=.3048007491;const ie=[0,0];function pr(e){for(let t=0;t1&&(r=1)),r<=.5?[t[0]+(n[0]-t[0])*r,t[1]+(n[1]-t[1])*r]:[n[0]-(n[0]-t[0])*(1-r),n[1]-(n[1]-t[1])*(1-r)]}function ai(e,t){e.ringisclockwise=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=[];if(o[0]===null)return!1;if(_(o[0]))for(const u of o[0]){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}else if(o[0]instanceof Vr)i=o[0]._elements;else{if(!P(o[0]))throw new h(n,c.InvalidParameter,r);for(const u of o[0].toArray()){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}}return!(i.length<3)&&Qi(i)})},e.polygon=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof le))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof le)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new le(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.polyline=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof ae))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof ae)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new ae(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.point=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof V)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new V(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.multipoint=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof We))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof We)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new We(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.extent=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=null;if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else if(o[0]instanceof V){const u={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},l=o[0];l.hasZ?(u.zmin=l.z,u.zmax=l.z):l.hasM&&(u.mmin=l.m,u.mmax=l.m),i=se(u)}else if(o[0]instanceof le)i=se(o[0].extent?.toJSON());else if(o[0]instanceof ae)i=se(o[0].extent?.toJSON());else if(o[0]instanceof We)i=se(o[0].extent?.toJSON());else if(o[0]instanceof Ne)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new Ne(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.geometry=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=null;if(o[0]===null)return null;if(K(o[0]))i=te(o[0].geometry(),n.spatialReference);else if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(se(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.setgeometry=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),!K(o[0]))throw new h(n,c.InvalidParameter,r);if(o[0].immutable===!0)throw new h(n,c.Immutable,r);if(!(o[1]instanceof k||o[1]===null))throw new h(n,c.InvalidParameter,r);return o[0]._geometry=o[1],I})},e.feature=function(n,r){return t(n,r,(a,s,o)=>{if(o.length===0)throw new h(n,c.WrongNumberOfParameters,r);let i;if(o.length===1)if(S(o[0]))i=H.fromJson(JSON.parse(o[0]),n.timeZone);else if(K(o[0]))i=H.createFromArcadeFeature(o[0]);else if(o[0]instanceof k)i=H.createFromGraphicLikeObject(o[0],null,null,n.timeZone);else{if(!(o[0]instanceof v))throw new h(n,c.InvalidParameter,r);{let u=o[0].hasField("geometry")?o[0].field("geometry"):null,l=o[0].hasField("attributes")?o[0].field("attributes"):null;u!==null&&u instanceof v&&(u=H.parseGeometryFromDictionary(u,n.spatialReference)),l!==null&&(l=H.parseAttributesFromDictionary(l)),i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}}else if(o.length===2){let u=null,l=null;if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}if(o[1]!==null){if(!(o[1]instanceof v))throw new h(n,c.InvalidParameter,r);l=H.parseAttributesFromDictionary(o[1])}i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}else{let u=null;const l={};if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}for(let f=1;f{if(o.length===0||o.length===1&&o[0]===null){const l=new v;return l.immutable=!1,l}if(o.length===1&&S(o[0]))try{const l=JSON.parse(o[0]),f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof k)try{const l=o[0].toJSON();l.hasZ=o[0].hasZ===!0,l.hasM=o[0].hasM===!0;const f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&K(o[0]))try{const l=new v;l.immutable=!1,l.setField("geometry",o[0].geometry());const f=new v;f.immutable=!1,l.setField("attributes",f);for(const d of o[0].keys())f.setField(d,o[0].field(d));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof v)try{const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===2&&o[0]instanceof v&&X(o[1]))try{if(o[1]!==!0){const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}return o[0].deepClone()}catch{throw new h(n,c.InvalidParameter,r)}if(o.length%2!=0)throw new h(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(o,2,2,n,r);const i=E(o[1]);if(K(o[0])||o[0]instanceof v)return o[0].hasField(i);if(o[0]instanceof k){const u=mt(o[0],i,null,null,2);return!u||u.keystate!=="notfound"}throw new h(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,s,o)=>(D(o,2,2,n,r),Xn(o[0],o[1])!=null))},e.indexof=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=o[1];if(_(o[0])){for(let u=0;u{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?_a(o[0],o[1]):Ma(o[0],o[1],o[2])})},e.bearing=function(n,r){return t(n,r,(a,s,o)=>{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?Ta(o[0],o[1]):Na(o[0],o[1],o[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=o[0];if(i instanceof le)return i.isSelfIntersecting;if(i instanceof ae)return pr(i.paths);if(i instanceof We){const u=i.points;for(let l=0;l0&&l[0][i]===t)return{partId:a,distanceAlong:s,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:l[0][0],y:l[0][1],...e.hasZ?{z:l[0][u]}:{},...e.hasM?{m:l[0][i]}:{}}),segmentId:0};let f=-1;for(let d=1;dt&&t>l[d-1][i]){const b=(t-l[d-1][i])/g*p;let x=e.hasZ?si(l[d-1],l[d],b,r):ui(l[d-1],l[d],b);x=[...x,t];const O=new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:x[0],y:x[1],...e.hasZ?{z:x[u]}:{},...e.hasM?{m:x[i]}:{}});return{partId:a,distanceAlong:s+o(l[d-1],[O.x,O.y,...O.hasZ?[O.z]:[],...O.hasM?[O.m]:[]],r),coordinate:O,segmentId:f}}s+=p}}return null}function ja(e,t){if(!e)return null;switch(e.type){case"extent":case"multipoint":case"mesh":case"point":return null}const n=e.type==="polygon"?e.rings:e.paths;if(t<0)return null;let r=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(r=wt(e.spatialReference)/yt(e.spatialReference));let a=0;const s=e.hasZ?3:2,o=2,i=e.hasZ?De:oi;let u=-1;if(t===0)return n.length===0||n[0].length===0?null:{partId:0,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:n[0][0][0],y:n[0][0][1],...e.hasZ?{z:n[0][0][o]}:{},...e.hasM?{m:n[0][0][s]}:{}}),segmentId:0};for(const l of n){u++;let f=-1;for(let d=1;dt){let y=e.hasZ?si(l[d-1],l[d],t-a,r):ui(l[d-1],l[d],t-a);return y=[...y,Ln(l[d-1][s],l[d][s],p,t-a)],{partId:u,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:y[0],y:y[1],...e.hasZ?{z:y[o]}:{},...e.hasM?{m:y[s]}:{}}),segmentId:f}}a=g}}return null}function Va(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0;return r=e,a=e.hasZ&&t.hasZ?De([t.x,t.y,t.z],[e.x,e.y,e.z],n):Ve([t.x,t.y],[e.x,e.y],!1),{coordinate:r,distance:a}}function Ja(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0,s=Number.MAX_VALUE,o=-1,i=-1;for(const u of e.points||[]){i++;const l=e.hasZ&&t.hasZ?ti([u[0],u[1],u[2]],[t.x,t.y,t.z],n):ni([u[0],u[1]],[t.x,t.y]);l(i=L(i),n(r,a,i),i[0]===null||i[1]===null||R.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof k&&i[1]instanceof k?R.equals(i[0],i[1]):(ce(i[0])&&ce(i[1])||Q(i[0])&&Q(i[1])||!(!q(i[0])||!q(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,3,3,r,a),i[0]instanceof k&&i[1]instanceof k)return R.relate(i[0],i[1],E(i[2]));if(i[0]instanceof k&&i[1]===null||i[1]instanceof k&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new h(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null||i[1]===null?null:R.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(s,o,i)=>{const u=[];if((i=L(i)).length===0)throw new h(r,c.WrongNumberOfParameters,a);if(i.length===1)if(_(i[0])){const l=L(i[0]);for(let f=0;f(i=L(i),n(r,a,i),i[0]===null?null:i[1]===null?Se(i[0]):R.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Se(i[1]):i[1]===null?Se(i[0]):R.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof Ne)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?null:R.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof ae)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?[Se(i[0])]:R.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.planarArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarArea(i[0],Vt(N(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.geodesicArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicArea(i[0],Vt(N(i[1],-1)))})},e.length=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarLength(i[0],re(N(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:u.hasZ===!0?Dr(u,re(N(i[1],-1))):R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[0].hasZ===!0?Dr(i[0],re(N(i[1],-1))):R.planarLength(i[0],re(N(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.geodesicLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicLength(i[0],re(N(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);let u=i[0];(_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference));let l=i[1];if((_(i[1])||P(i[1]))&&(l=pn(i[1],r.spatialReference)),!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(l instanceof k))throw new h(r,c.InvalidParameter,a);return R.distance(u,l,re(N(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);const u=i[0],l=i[1];if(!(u instanceof V))throw new h(r,c.InvalidParameter,a);if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);const f=new ae({paths:[],spatialReference:u.spatialReference});return f.addPath([u,l]),R.geodesicLength(f,re(N(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.densify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.densify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.geodesicDensify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.geodesicDensify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return R.generalize(i[0],u,Tt(N(i[2],!0)),re(N(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.buffer(i[0],u,re(N(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.geodesicBuffer(i[0],u,re(N(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof le||i[0]instanceof ae))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);const l=m(N(i[4],10));if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=m(N(i[5],0));if(isNaN(f))throw new h(r,c.InvalidParameter,a);return R.offset(i[0],u,re(N(i[2],-1)),E(N(i[3],"round")).toLowerCase(),l,f)})},e.rotate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=i[0]instanceof Ne?le.fromExtent(i[0]):i[0],l=m(i[1]);if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=N(i[2],null);if(f===null)return R.rotate(u,l);if(f instanceof V)return R.rotate(u,l,f);throw new h(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);return u instanceof V?te(Se(u),r.spatialReference):u instanceof le?u.centroid:u instanceof ae?Sa(u):u instanceof We?Ia(u):u instanceof Ne?u.center:null})},e.measuretocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=Za(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.pointtocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);const l=i[1];if(l===null)return null;if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const f=qa(u,l);return f?v.convertObjectToArcadeDictionary(f,B(r),!1,!0):null})},e.distancetocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=ja(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.multiparttosinglepart=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);if(i[0]instanceof V)return[te(Se(i[0]),r.spatialReference)];if(i[0]instanceof Ne)return[te(Se(i[0]),r.spatialReference)];const u=R.simplify(i[0]);if(u instanceof le){const l=[],f=[];for(let d=0;d{if(i=L(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestCoordinate(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestVertex(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})}}function ci(e,t){function n(r,a,s){const o=m(r);return isNaN(o)?o:isNaN(a)||isNaN(s)||a>s?NaN:os?s:o}e.number=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,2,r,a);const u=i[0];if(W(u))return u;if(u===null)return 0;if(ce(u)||Q(u)||q(u))return u.toNumber();if(X(u))return Number(u);if(_(u))return NaN;if(u===""||u===void 0)return Number(u);if(S(u)){if(i[1]!==void 0){let l=Tn(i[1],"‰","");return l=Tn(l,"¤",""),da(u,{pattern:l})}return Number(u.trim())}return Number(u)})},e.abs=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.abs(m(i[0]))))},e.acos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.acos(m(i[0]))))},e.asin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.asin(m(i[0]))))},e.atan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.atan(m(i[0]))))},e.atan2=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),Math.atan2(m(i[0]),m(i[1]))))},e.ceil=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("ceil",m(i[0]),-1*u)}return Math.ceil(m(i[0]))})},e.round=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("round",m(i[0]),-1*u)}return Math.round(m(i[0]))})},e.floor=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("floor",m(i[0]),-1*u)}return Math.floor(m(i[0]))})},e.cos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.cos(m(i[0]))))},e.isnan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.exp(m(i[0]))))},e.log=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.log(m(i[0]))))},e.pow=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),m(i[0])**m(i[1])))},e.random=function(r,a){return t(r,a,(s,o,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sin(m(i[0]))))},e.sqrt=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sqrt(m(i[0]))))},e.tan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.tan(m(i[0]))))},e.isempty=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0||i[0]===I))},e.boolean=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,1,r,a);const u=i[0];return Tt(u)})},e.constrain=function(r,a){return t(r,a,(s,o,i)=>{D(i,3,3,r,a);const u=m(i[1]),l=m(i[2]);if(_(i[0])){const f=[];for(const d of i[0])f.push(n(d,u,l));return f}if(P(i[0])){const f=[];for(let d=0;d=t&&t!==-1)return n}return n}function yn(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Xa(t,n);case"avg":case"mean":return hi(at(t));case"min":return Math.min.apply(Math,at(t));case"sum":return Ka(at(t));case"max":return Math.max.apply(Math,at(t));case"stdev":case"stddev":return Math.sqrt(gr(at(t)));case"var":case"variance":return gr(at(t));case"count":return t.length}return 0}function Ke(e,t){if(t.length===1){if(_(t[0]))return yn(e,t[0],-1);if(P(t[0]))return yn(e,t[0].toArray(),-1)}return yn(e,t,-1)}function di(e,t){e.stdev=function(n,r){return t(n,r,(a,s,o)=>Ke("stdev",o))},e.variance=function(n,r){return t(n,r,(a,s,o)=>Ke("variance",o))},e.average=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.mean=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.sum=function(n,r){return t(n,r,(a,s,o)=>Ke("sum",o))},e.min=function(n,r){return t(n,r,(a,s,o)=>Ke("min",o))},e.max=function(n,r){return t(n,r,(a,s,o)=>Ke("max",o))},e.distinct=function(n,r){return t(n,r,(a,s,o)=>Ke("distinct",o))},e.count=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),_(o[0])||S(o[0]))return o[0].length;if(P(o[0]))return o[0].length();throw new h(n,c.InvalidParameter,r)})}}let Pn=class extends v{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},Qa=class fi extends v{constructor(t,n,r,a,s,o,i){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",o),this.setField("keywords",i),this.immutable=!0}deepClone(){return new fi(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}};const Qn=e=>(t,n,r=14)=>+e(t,n).toFixed(r),Ya=(e,t)=>e+t,$a=(e,t)=>e*t,eo=(e,t)=>e/t,yr=(e,t,n)=>Qn(Ya)(e,t,n),dt=(e,t,n)=>Qn($a)(e,t,n),Qt=(e,t,n)=>Qn(eo)(e,t,n),Yt=360,to=400,no=2*Math.PI,Ie=3600,wr=3240,kt=60,Qe=60,xr=180*Ie/Math.PI,bt=Yt*kt*Qe,wn=90*Ie,ot=180*Ie,ro=270*Ie,mi="ᵍ",vt="°";function Ct(e){if(S(e)===!1)throw new h(null,c.InvalidParameter,null);return e}function On(e,t){const n=10**t;return Math.round(e*n)/n}function io(e,t){return e%t}function st(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var J,w,Z,Un;function ht(e,t){switch(e){case J.north:return t==="SHORT"?"N":"North";case J.east:return t==="SHORT"?"E":"East";case J.south:return t==="SHORT"?"S":"South";case J.west:return t==="SHORT"?"W":"West"}}function xn(e,t){return e-Math.floor(e/t)*t}function Fn(e){switch(e){case w.truncated_degrees:case w.decimal_degrees:return Yt;case w.radians:return no;case w.gradians:return to;case w.seconds:return bt;case w.fractional_degree_minutes:return kt;case w.fractional_minute_seconds:return Qe;default:throw new h(null,c.LogicError,null,{reason:"unsupported evaluations"})}}function Fr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return Z.north_azimuth;case"POLAR":return Z.polar;case"QUADRANT":return Z.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return Z.south_azimuth}throw new h(null,c.LogicError,null,{reason:"unsupported directionType"})}function Ar(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return w.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return w.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return w.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return w.gradians}throw new h(null,c.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(J||(J={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(w||(w={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(Z||(Z={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Un||(Un={}));let pt=class qt{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case w.decimal_degrees:case w.truncated_degrees:return this.m_degrees;case w.fractional_degree_minutes:return this.m_minutes;case w.seconds:case w.fractional_minute_seconds:return this.m_seconds;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=st(t).fraction;let r=st(t).integer;const a=Math.floor(r/Ie);r-=a*Ie;const s=Math.floor(r/Qe);return r-=s*Qe,new qt(a,s,r+n)}static numberToDms(t){const n=st(t).fraction,r=st(t).integer,a=dt(st(100*n).fraction,100),s=st(100*n).integer;return new qt(r,s,a)}format(t,n){let r=On(this.m_seconds,n),a=this.m_minutes,s=this.m_degrees;if(t===w.seconds||t===w.fractional_minute_seconds)Qe<=r&&(r-=Qe,++a),kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,s=this.m_degrees,kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.decimal_degrees||t===w.truncated_degrees){const o=Qt(this.m_seconds,Ie),i=Qt(this.m_minutes,kt);s=Math.round(this.m_degrees+i+o),a=0,r=0}return new qt(s,a,r)}static dmsToSeconds(t,n,r){return t*Ie+n*Qe+r}},ao=class{constructor(e,t,n){this.meridian=e,this.angle=t,this.direction=n}fetchAzimuth(e){return e===Un.meridian?this.meridian:this.direction}},Xe=class Ze{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Ze(new Re(Ze._convertDirectionFormat(t.extractAngularUnits(w.seconds),n,Z.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:case Z.south_azimuth:case Z.polar:return new Re(Ze._convertDirectionFormat(n,Z.north_azimuth,t));case Z.quadrant:{const r=Ze.secondsNorthAzimuthToQuadrant(n);return new Re(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.north;case Z.south_azimuth:return J.south;case Z.polar:return J.east;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.east;case Z.south_azimuth:return J.west;case Z.polar:return J.north;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=wn||t>=ro?J.north:J.south,r=n===J.north?Math.min(bt-t,t):Math.abs(t-ot),a=t>ot?J.west:J.east;return new ao(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Ze(new Re(Ze.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===J.north?r===J.east?t:bt-t:r===J.east?ot-t:ot+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case Z.north_azimuth:a=t;break;case Z.polar:a=wn-t;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:a=t+ot}let s=0;switch(r){case Z.north_azimuth:s=a;break;case Z.polar:s=wn-a;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:s=a-ot}return s=io(s,bt),s<0?bt+s:s}};function Cr(e,t,n){let r=null;switch(t){case w.decimal_degrees:r=dt(e,Ie);break;case w.seconds:r=e;break;case w.gradians:r=dt(e,wr);break;case w.radians:r=dt(e,xr);break;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return Qt(r,Ie);case w.seconds:return r;case w.gradians:return Qt(r,wr);case w.radians:return r/xr;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Re=class zn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new zn(Cr(t,n,w.seconds))}extractAngularUnits(t){return Cr(this._seconds,w.seconds,Nt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new zn(yr(yr(dt(t,Ie),dt(n,Qe)),r))}};function Nt(e){switch(jr(e),e){case w.decimal_degrees:case w.truncated_degrees:case w.degrees_minutes_seconds:return w.decimal_degrees;case w.gradians:return w.gradians;case w.fractional_degree_minutes:return w.fractional_degree_minutes;case w.radians:return w.radians;case w.seconds:case w.fractional_minute_seconds:return w.seconds}}let oo=class pi{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new pi(t,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let t=null,n=w.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case w.truncated_degrees:case w.fractional_degree_minutes:return s=xn(a.fetchFormattedDms().getField(t),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");case w.fractional_minute_seconds:return s=xn(On(a.fetchDms().getField(t),r),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function uo(e,t,n){if(n===Z.quadrant)throw new h(null,c.LogicError,null,{reason:"conversion error"});if(t===w.degrees_minutes_seconds){const r=pt.numberToDms(e);return Xe.createFromAngleAndDirection(Re.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(e,Nt(t)),n)}function lo(e){switch(m(e)){case 1:return{first:J.north,second:J.east};case 2:return{first:J.south,second:J.east};case 3:return{first:J.south,second:J.west};case 4:return{first:J.north,second:J.west}}return null}function Er(e){switch(e.toUpperCase().trim()){case"N":case"NORTH":return J.north;case"E":case"EAST":return J.east;case"S":case"SOUTH":return J.south;case"W":case"WEST":return J.west}return null}function ut(e){const t=parseFloat(e);if(W(t)){if(isNaN(t))throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function An(e,t,n){const r=n===Z.quadrant;let a=null,s=null,o=0,i=0,u=0;if(r){if(e.length<2)throw new h(null,c.LogicError,null,{reason:"conversion error"});u=1;const l=lo(E(e[e.length-1]));if(l?(a=l.first,s=l.second):(o=1,a=Er(E(e[0])),s=Er(E(e[e.length-1]))),a===null||s===null)throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case w.decimal_degrees:case w.radians:case w.gradians:if(e.length===0)throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return r?Xe.createFromAngleMeridianAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),a,s):Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),n);case w.degrees_minutes_seconds:if(i=e.length-u-o,i===3){const l=Re.createFromDegreesMinutesSeconds(ut(e[o]),ut(e[o+1]),ut(e[o+2]));return r?Xe.createFromAngleMeridianAndDirection(l,a,s):Xe.createFromAngleAndDirection(l,n)}if(i===1){const l=ut(e[o]),f=pt.numberToDms(l),d=Re.createFromDegreesMinutesSeconds(f.m_degrees,f.m_minutes,f.m_seconds);return r?Xe.createFromAngleMeridianAndDirection(d,a,s):Xe.createFromAngleAndDirection(d,n)}}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function co(e){const t=new Set([" ","-","/","'",'"',"\\","^",vt,mi," ","\r",` +`,"*"]);let n="";for(let r=0;rr!=="")}function ho(e,t,n){if(W(e))return uo(m(e),t,n);if(S(e))return An(co(e),t,n);if(_(e))return An(e,t,n);if(P(e))return An(e.toArray(),t,n);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function fo(e,t,n){const r=Nt(n);if(r&&n!==w.degrees_minutes_seconds)return e.getAngle(t).extractAngularUnits(r);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function mo(e,t,n){const r=e.getAngle(t);if(t===Z.quadrant&&n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[ht(e.getMeridian(t),"SHORT"),a.m_degrees,a.m_minutes,a.m_seconds,ht(e.getDirection(t),"SHORT")]}if(n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[a.m_degrees,a.m_minutes,a.m_seconds]}return t===Z.quadrant?[ht(e.getMeridian(t),"SHORT"),r.extractAngularUnits(n),ht(e.getDirection(t),"SHORT")]:[r.extractAngularUnits(n)]}function po(e,t){let n="";switch(e){case w.decimal_degrees:n=t===Z.quadrant?"DD.DD"+vt:"DDD.DD"+vt;break;case w.degrees_minutes_seconds:n=t===Z.quadrant?"dd"+vt+` mm' ss"`:"ddd"+vt+` mm' ss.ss"`;break;case w.radians:n="R.RR";break;case w.gradians:n="GGG.GG"+mi;break;default:throw new h(null,c.LogicError,null,{reason:"conversion error"})}return t===Z.quadrant&&(n="p "+n+" b"),n}function Gn(e,t,n){const r={padding:0,rounding:0,newpos:t};let a=!1;for(;t>6,128|63&a):a<55296||a>=57344?t.push(224|a>>12,128|a>>6&63,128|63&a):(n++,a=65536+((1023&a)<<10|1023&e.charCodeAt(n)),t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a))}return new Uint8Array(t)}let wo=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const t=[];for(const n of e)isNaN(n)?t.push("NaN"):n===1/0?t.push("Infinity"):n===-1/0?t.push("-Infinity"):n===0?t.push("0"):t.push(n.toString(16));this.update(Sr(t.join("")))}updateIntArray(e){const t=Int32Array.from(e);this.update(new Uint8Array(t.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(Sr(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let t=0;for(const n of this._bufs)e.set(n,t),t+=n.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,t=0){const n=e;let r=t+vr&4294967295,a=0;if(n.length>=16){const o=[t+lt+ct&4294967295,t+ct&4294967295,t+0&4294967295,t-lt&4294967295],i=e,u=i.length-16;let l=0;for(a=0;(4294967280&a)<=u;a+=4){const f=a,d=i[f]+(i[f+1]<<8),p=i[f+2]+(i[f+3]<<8),g=d*ct+(p*ct<<16);let y=o[l]+g&4294967295;y=y<<13|y>>>19;const b=65535&y,x=y>>>16;o[l]=b*lt+(x*lt<<16)&4294967295,l=l+1&3}r=(o[0]<<1|o[0]>>>31)+(o[1]<<7|o[1]>>>25)+(o[2]<<12|o[2]>>>20)+(o[3]<<18|o[3]>>>14)&4294967295}r=r+e.length&4294967295;const s=e.length-4;for(;a<=s;a+=4){const o=a,i=n[o]+(n[o+1]<<8),u=n[o+2]+(n[o+3]<<8);r=r+(i*Jt+(u*Jt<<16))&4294967295,r=r<<17|r>>>15,r=(65535&r)*br+((r>>>16)*br<<16)&4294967295}for(;a>>21,r=(65535&r)*lt+((r>>>16)*lt<<16)&4294967295;return r^=r>>>15,r=((65535&r)*ct&4294967295)+((r>>>16)*ct<<16),r^=r>>>13,r=((65535&r)*Jt&4294967295)+((r>>>16)*Jt<<16),r^=r>>>16,r<0?r+4294967296:r}};function xo(e){return e.loadStatus==="loaded"&&e.user?.sourceJSON?e.user.sourceJSON:null}function Fo(e,t){return!!e&&Yi(e,t?.restUrl||"")}function Ir(e,t){if(!e||!t)return e===t;if(e.x===t.x&&e.y===t.y){if(e.hasZ){if(e.z!==t.z)return!1}else if(t.hasZ)return!1;if(e.hasM){if(e.m!==t.m)return!1}else if(t.hasM)return!1;return!0}return!1}function Ee(e,t,n){if(e!==null)if(_(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e)Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else if(P(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e.toArray())Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else{if(ce(e))return t.updateIntArray([e.toNumber()]),void t.updateUint8Array([241]);if(q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([257]);if(Q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([263]);if(S(e))return t.updateIntArray([e.length]),t.updateWithString(e),void t.updateUint8Array([41]);if(X(e))t.updateUint8Array([e===!0?1:0,113]);else{if(W(e))return t.updateFloatArray([e]),void t.updateUint8Array([173]);if(e instanceof Qa)throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof Pn)throw new h(n.context,c.UnsupportedHashType,n.node);if(!(e instanceof v)){if(K(e))throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof V)return t.updateIntArray([3833836621]),t.updateIntArray([0]),t.updateFloatArray([e.x]),t.updateIntArray([1]),t.updateFloatArray([e.y]),e.hasZ&&(t.updateIntArray([2]),t.updateFloatArray([e.z])),e.hasM&&(t.updateIntArray([3]),t.updateFloatArray([e.m])),t.updateIntArray([3765347959]),void Ee(e.spatialReference.wkid,t,n);if(e instanceof le){t.updateIntArray([1266616829]);for(let r=0;r(D(o,1,1,n,r),new Pn(E(o[0]))))},e.typeof=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=Jr(o[0]);if(i==="Unrecognized Type")throw new h(n,c.UnrecognizedType,r);return i})},e.trim=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).trim()))},e.tohex=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=m(o[0]);return isNaN(i)?i:i.toString(16)})},e.upper=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).toUpperCase()))},e.proper=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);let i=1;o.length===2&&E(o[1]).toLowerCase()==="firstword"&&(i=2);const u=/\s/,l=E(o[0]);let f="",d=!0;for(let p=0;p(D(o,1,1,n,r),E(o[0]).toLowerCase()))},e.guid=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,1,n,r),o.length>0)switch(E(o[0]).toLowerCase()){case"digits":return Ft().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return Ft();case"digits-hyphen-braces":return"{"+Ft()+"}";case"digits-hyphen-parentheses":return"("+Ft()+")"}return"{"+Ft()+"}"})},e.standardizeguid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=E(o[0]);if(i===""||i===null)return"";const u=/^(\{|\()?(?[0-9a-z]{8})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(i);if(!u)return"";const l=u.groups;switch(i=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,E(o[1]).toLowerCase()){case"digits":return i.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return i;case"digits-hyphen-braces":return"{"+i+"}";case"digits-hyphen-parentheses":return"("+i+")"}return"{"+i+"}"})},e.console=function(n,r){return t(n,r,(a,s,o)=>(o.length===0||(o.length===1?n.console(E(o[0])):n.console(E(o))),I))},e.mid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i))return"";if(i=Math.max(0,i),o.length===2)return E(o[0]).slice(i);let u=m(o[2]);return isNaN(u)?"":(u<0&&(u=0),E(o[0]).slice(i,i+u))})},e.find=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=0;if(o.length>2){if(i=m(N(o[2],0)),isNaN(i))return-1;i<0&&(i=0)}return E(o[1]).indexOf(E(o[0]),i)})},e.left=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=m(o[1]);return isNaN(i)?"":(i<0&&(i=0),E(o[0]).slice(0,i))})},e.right=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=m(o[1]);return isNaN(i)||i<=0?"":E(o[0]).slice(-i)})},e.split=function(n,r){return t(n,r,(a,s,o)=>{let i;D(o,2,4,n,r);let u=m(N(o[2],-1));const l=Tt(N(o[3],!1));if(u===-1||u===null||l===!0?i=E(o[0]).split(E(o[1])):(isNaN(u)&&(u=-1),u<-1&&(u=-1),i=E(o[0]).split(E(o[1]),u)),l===!1)return i;const f=[];for(let d=0;d=u);d++)i[d]!==""&&i[d]!==void 0&&f.push(i[d]);return f})},e.text=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,2,n,r),qe(o[0],o[1])))},e.concatenate=function(n,r){return t(n,r,(a,s,o)=>{const i=[];if(o.length<1)return"";if(_(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}if(P(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}for(let u=0;u{if(D(o,1,1,n,r),_(o[0])){const i=o[0].slice();return i.reverse(),i}if(P(o[0])){const i=o[0].toArray().slice();return i.reverse(),i}throw new h(n,c.InvalidParameter,r)})},e.replace=function(n,r){return t(n,r,(a,s,o)=>{D(o,3,4,n,r);const i=E(o[0]),u=E(o[1]),l=E(o[2]);return o.length!==4||Tt(o[3])?Tn(i,u,l):i.replace(u,l)})},e.schema=function(n,r){return t(n,r,(a,s,o)=>{if(K(o[0])){const i=ra(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypes=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypecode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return null;if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.code;return null}return null}throw new h(n,c.InvalidParameter,r)})},e.subtypename=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return"";if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.name;return""}return""}throw new h(n,c.InvalidParameter,r)})},e.gdbversion=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0]))return o[0].gdbVersion();throw new h(n,c.InvalidParameter,r)})},e.domain=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,3,n,r),K(o[0])){const i=ia(o[0],E(o[1]),o[2]===void 0?void 0:o[2]);return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:hr[i.field.type],codedValues:i.domain.codedValues.map(u=>({name:u.name,code:u.code}))},B(n)):v.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:hr[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.domainname=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return aa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.domaincode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return oa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.urlencode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),o[0]===null)return"";if(o[0]instanceof v){let i="";for(const u of o[0].keys()){const l=o[0].field(u);i!==""&&(i+="&"),i+=l===null?encodeURIComponent(u)+"=":encodeURIComponent(u)+"="+encodeURIComponent(l)}return i}return encodeURIComponent(E(o[0]))})},e.hash=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=new wo(0);return Ee(o[0],i,{context:n,node:r,map:new Map,currentLength:0}),i.digest()})},e.convertdirection=function(n,r){return t(n,r,(a,s,o)=>(D(o,3,3,n,r),yo(o[0],o[1],o[2])))},e.fromjson=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),S(o[0])===!1)throw new h(n,c.InvalidParameter,r);return v.convertJsonToArcade(JSON.parse(E(o[0])),B(n))})},e.expects=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);return I})},e.tocharcode=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.charCodeAt(i)})},e.tocodepoint=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.codePointAt(i)})},e.fromcharcode=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);const i=o.map(u=>Math.trunc(m(u))).filter(u=>u>=0&&u<=65535);return i.length===0?null:String.fromCharCode.apply(null,i)})},e.fromcodepoint=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);let i;try{i=o.map(u=>Math.trunc(m(u))).filter(u=>u<=1114111&&u>>>0===u)}catch{return null}return i.length===0?null:String.fromCodePoint.apply(null,i)})},e.getuser=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,2,n,r);let i=N(o[1],"");if(i=i===!0||i===!1?"":E(i),i!==null&&i!=="")return null;if(o.length===0||o[0]instanceof Pn){let u=null;if(u=n.services?.portal?n.services.portal:Wn.getDefault(),o.length>0&&!Fo(o[0].field("url"),u)||!u)return null;if(i===""){const l=xo(u);if(l){const f=JSON.parse(JSON.stringify(l));for(const d of["lastLogin","created","modified"])f[d]!==void 0&&f[d]!==null&&(f[d]=new Date(f[d]));return v.convertObjectToArcadeDictionary(f,B(n))}}return null}throw new h(n,c.InvalidParameter,r)})},e.getenvironment=function(n,r){return t(n,r,(a,s,o)=>(D(o,0,0,n,r),v.convertObjectToArcadeDictionary(sa(B(n),n.spatialReference),B(n),!0)))}}let Ao=class extends Xr{constructor(e,t){super(),this.paramCount=t,this.fn=e}createFunction(e){return(...t)=>{if(t.length!==this.paramCount)throw new h(e,c.WrongNumberOfParameters,null);return this.fn(...t)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r));const i=this.call(n,{arguments:o});return $e(i)?i.then(u=>Kt(u,n,r)):i})}};function xe(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function T(e,t){switch(t.type){case"AssignmentExpression":return Io(e,t);case"UpdateExpression":return vo(e,t);case"TemplateLiteral":return Uo(e,t);case"Identifier":return Zo(e,t);case"MemberExpression":return Lo(e,t);case"Literal":return t.value===null||t.value===void 0?"null":JSON.stringify(t.value);case"CallExpression":return jo(e,t);case"UnaryExpression":return Po(e,t);case"BinaryExpression":return zo(e,t);case"LogicalExpression":return Go(e,t);case"ArrayExpression":return Oo(e,t);case"ObjectExpression":return Co(e,t);default:throw new he(e,c.Unrecognized,t)}}function pe(e,t){switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclaration":return No(e,t);case"BlockStatement":return Rt(e,t);case"FunctionDeclaration":return Mo(e,t);case"ImportDeclaration":return _o(e,t);case"ExportNamedDeclaration":return To(e,t);case"ReturnStatement":return Bo(e,t);case"IfStatement":return gi(e,t);case"ExpressionStatement":return ko(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"ForStatement":return bo(e,t);case"ForInStatement":return Eo(e,t);case"WhileStatement":return So(e,t);default:throw new he(e,c.Unrecognized,t)}}function Co(e,t){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+s+",'ObjectExpression'),lang.aCheck("+T(e,a.value)+", 'ObjectExpression')"}return n+="])",n}function Eo(e,t){const n=be(e),r=be(e),a=be(e);let s="var "+n+" = "+T(e,t.right)+`; +`;t.left.type==="VariableDeclaration"&&(s+=pe(e,t.left));const o=$(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);Ae(o);let i="";e.localScope!==null&&(e.localScope[o]!==void 0?i="lscope['"+o+"']":e.localScope._SymbolsMap[o]!==void 0&&(i="lscope['"+e.localScope._SymbolsMap[o]+"']"));let u="";if(i===""){if(e.globalScope[o]!==void 0)i="gscope['"+o+"']";else if(e.globalScope._SymbolsMap[o]!==void 0)i="gscope['"+e.globalScope._SymbolsMap[o]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(o))i="gscope['"+e.undeclaredGlobalsInFunctions.get(o).manglename+"']",u=e.undeclaredGlobalsInFunctions.get(o).manglename;else{const l={manglename:_e(e),node:t.left};e.undeclaredGlobalsInFunctions.set(o,l),i="gscope['"+l.manglename+"']",u=l.manglename}}return u&&(s+="lang.chkAssig('"+u+`',runtimeCtx); +`),s+="if ("+n+`===null) { lastStatement = lc.voidOperation; } + `,s+="else if (lc.isArray("+n+") || lc.isString("+n+")) {",s+="var "+r+"="+n+`.length; +`,s+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { +`,s+=i+"="+a+`; +`,s+=pe(e,t.body),s+=` +} +`,s+=` lastStatement = lc.voidOperation; +`,s+=` +} +`,s+="else if (lc.isImmutableArray("+n+")) {",s+="var "+r+"="+n+`.length(); +`,s+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { +`,s+=i+"="+a+`; +`,s+=pe(e,t.body),s+=` +} +`,s+=` lastStatement = lc.voidOperation; +`,s+=` +} +`,s+="else if (( "+n+" instanceof lang.Dictionary) || ( "+n+" instanceof lang.Feature)) {",s+="var "+r+"="+n+`.keys(); +`,s+="for(var "+a+"=0; "+a+"<"+r+".length; "+a+`++) { +`,s+=i+"="+r+"["+a+`]; +`,s+=pe(e,t.body),s+=` +} +`,s+=` lastStatement = lc.voidOperation; +`,s+=` +} +`,e.isAsync&&(s+="else if (lc.isFeatureSet("+n+")) {",s+="var "+r+"="+n+`.iterator(runtimeCtx.abortSignal); +`,s+="for(var "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+", runtimeCtx); "+a+"!=null; "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+`, runtimeCtx)) { +`,s+=i+"="+a+`; +`,s+=pe(e,t.body),s+=` +} +`,s+=` lastStatement = lc.voidOperation; +`,s+=` +} +`),s+=`else { lastStatement = lc.voidOperation; } +`,s}function bo(e,t){let n=`lastStatement = lc.voidOperation; +`;t.init!==null&&(t.init.type==="VariableDeclaration"?n+=pe(e,t.init):n+=T(e,t.init)+"; ");const r=be(e),a=be(e);return n+="var "+r+" = true; ",n+=` + do { `,t.update!==null&&(n+=" if ("+r+`===false) { + `+T(e,t.update)+` +} + `+r+`=false; +`),t.test!==null&&(n+="var "+a+" = "+T(e,t.test)+"; ",n+="if ("+a+"===false) { break; } else if ("+a+"!==true) { lang.error('"+c.BooleanConditionRequired+`'); } +`),n+=pe(e,t.body),t.update!==null&&(n+=` + `+T(e,t.update)),n+=` +`+r+` = true; +} while(true); lastStatement = lc.voidOperation; `,n}function vo(e,t){if(t.argument.type==="CallExpression")throw new he(e,c.NeverReach,t);let n;if(t.argument.type==="MemberExpression"){const a=T(e,t.argument.object);return t.argument.computed===!0?n=T(e,t.argument.property):(Ae(t.argument.property.name),n="'"+t.argument.property.name+"'"),"lang.memberupdate("+a+","+n+",'"+t.operator+"',"+t.prefix+")"}const r=$(t.argument);if(Ae(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lang.update(lscope, '"+r+"','"+t.operator+"',"+t.prefix+")";if(e.localScope._SymbolsMap[r]!==void 0)return"lang.update(lscope, '"+e.localScope._SymbolsMap[r]+"','"+t.operator+"',"+t.prefix+")"}if(e.globalScope[r]!==void 0)return"lang.update(gscope, '"+r+"','"+t.operator+"',"+t.prefix+")";if(e.globalScope._SymbolsMap[r]!==void 0)return"lang.update(gscope, '"+e.globalScope._SymbolsMap[r]+"','"+t.operator+"',"+t.prefix+")";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"lang.update(gscope,lang.chkAssig( '"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")";const a={manglename:_e(e),node:t.argument};return e.undeclaredGlobalsInFunctions.set(r,a),"lang.update(gscope, lang.chkAssig('"+a.manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")"}throw new h(e,c.InvalidIdentifier,t)}function So(e,t){let n=`lastStatement = lc.voidOperation; +`;const r=be(e);return n+=` + var ${r} = true; + do { + ${r} = ${T(e,t.test)}; + if (${r}==false) { + break; + } + if (${r}!==true) { + lang.error('${c.BooleanConditionRequired}'); + } + ${pe(e,t.body)} + } + while (${r} !== false); + lastStatement = lc.voidOperation; + `,n}function Io(e,t){const n=T(e,t.right);if(t.left.type==="MemberExpression"){let a;const s=T(e,t.left.object);return t.left.computed===!0?a=T(e,t.left.property):(a="'"+t.left.property.name+"'",Ae(t.left.property.name)),"lang.assignmember("+s+","+a+",'"+t.operator+"',"+n+")"}const r=$(t.left);if(Ae(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+r+"'])";if(e.localScope._SymbolsMap[r]!==void 0)return"lscope['"+e.localScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+e.localScope._SymbolsMap[r]+"'])"}if(e.globalScope[r]!==void 0)return"gscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+r+"'])";if(e.globalScope._SymbolsMap[r]!==void 0)return"gscope['"+e.globalScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+e.globalScope._SymbolsMap[r]+"'])";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+e.undeclaredGlobalsInFunctions.get(r).manglename+"'])";const a={manglename:_e(e),node:t.left};return e.undeclaredGlobalsInFunctions.set(r,a),"gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+a.manglename+"'])"}throw new h(e,c.InvalidIdentifier,t)}function ko(e,t){return t.expression.type==="AssignmentExpression"?"lastStatement = lc.voidOperation; "+T(e,t.expression)+`; + `:"lastStatement = "+T(e,t.expression)+"; "}function kr(e,t){return t.type==="BlockStatement"?pe(e,t):t.type==="ReturnStatement"||t.type==="BreakStatement"||t.type==="ContinueStatement"?pe(e,t)+"; ":t.type==="ExpressionStatement"?pe(e,t):pe(e,t)+"; "}function gi(e,t){return`if (lang.mustBoolean(${T(e,t.test)}, runtimeCtx) === true) { + ${kr(e,t.consequent)} + } `+(t.alternate!==null?t.alternate.type==="IfStatement"?" else "+gi(e,t.alternate):` else { + ${kr(e,t.alternate)} + } +`:` else { + lastStatement = lc.voidOperation; + } +`)}function Rt(e,t){let n="";for(let r=0;r0&&(s+=", "),s+=T(e,t.arguments[o]);return s+="]",e.isAsync?"(yield lang.callModuleFunction("+T(e,t.callee.object)+","+s+","+a+",runtimeCtx))":"lang.callModuleFunction("+T(e,t.callee.object)+","+s+","+a+",runtimeCtx)"}if(t.callee.type!=="Identifier")throw new he(e,c.FunctionNotFound,t);const n=$(t.callee);if(n==="iif")return Vo(e,t);if(n==="when")return Wo(e,t);if(n==="defaultvalue")return Jo(e,t);if(n==="decode")return qo(e,t);let r="";if(e.localScope!==null&&(e.localScope[n]!==void 0?r="lscope['"+n+"']":e.localScope._SymbolsMap[n]!==void 0&&(r="lscope['"+e.localScope._SymbolsMap[n]+"']")),r===""){if(e.globalScope[n]!==void 0)r="gscope['"+n+"']";else if(e.globalScope._SymbolsMap[n]!==void 0)r="gscope['"+e.globalScope._SymbolsMap[n]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(n))r="gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(n).manglename+"',runtimeCtx)]";else{const a={manglename:_e(e),node:t.callee};e.undeclaredGlobalsInFunctions.set(n,a),r="gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]"}}if(r!==""){let a="[";for(let s=0;s0&&(a+=", "),a+=T(e,t.arguments[s]);return a+="]",e.isAsync?"(yield lang.callfunc("+r+","+a+",runtimeCtx) )":"lang.callfunc("+r+","+a+",runtimeCtx)"}throw new he(e,c.FunctionNotFound,t)}catch(n){throw n}}function Vo(e,t){try{if(t.arguments.length!==3)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e);return`${e.isAsync?`(yield (function() { + return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} + var ${n} = ${T(e,t.arguments[0])}; + + if (${n} === true) { + return ${T(e,t.arguments[1])}; + } + else if (${n} === false) { + return ${T(e,t.arguments[2])}; + } + else { + lang.error('ExecutionErrorCodes.BooleanConditionRequired'); + } + ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Jo(e,t){try{if(t.arguments.length<2||t.arguments.length>3)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e),r=be(e);return t.arguments.length===3?`${e.isAsync?`(yield (function() { + return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} + var ${n} = ${T(e,t.arguments[0])}; + var ${r} = ${T(e,t.arguments[1])}; + ${n} = lang.getNestedOptionalValue(${n}, ${r}); + return ${n} != null && ${n} !== "" ? ${n} : ${T(e,t.arguments[2])}; + ${e.isAsync?"})}()))":"}()"}`:`${e.isAsync?`(yield (function() { + return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} + var ${n} = ${T(e,t.arguments[0])}; + if (${n} === null) { + return ${T(e,t.arguments[1])}; + } + if (${n} === "") { + return ${T(e,t.arguments[1])}; + } + if (${n} === undefined) { + return ${T(e,t.arguments[1])}; + } + return ${n}; + ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Wo(e,t){try{if(t.arguments.length<3)throw new he(e,c.WrongNumberOfParameters,t);if(t.arguments.length%2==0)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e);let r="var ";for(let a=0;a{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.decode=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.when=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.defaultvalue=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}};const Dt={};for(const e in ee)Dt[e]=new nt(ee[e]);li(ee,xe);for(const e in ee)ee[e]=new nt(ee[e]);const Yn=function(){};Yn.prototype=ee;const $n=function(){};function yi(e,t,n){const r={_SymbolsMap:{}};e||(e={}),n||(n={}),r.textformatting=1,r.infinity=1,r.pi=1;for(const a in t)r[a]=1;for(const a in n)r[a]=1;for(const a in e)r[a]=1;return r}function wi(e,t,n,r){const a=n?new $n:new Yn;e||(e={}),t||(t={});const s=new v({newline:` +`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});s.immutable=!1,a._SymbolsMap={textformatting:1,infinity:1,pi:1},a.textformatting=s,a.infinity=Number.POSITIVE_INFINITY,a.pi=Math.PI;for(const o in t)a[o]=t[o],a._SymbolsMap[o]=1;for(const o in e){const i=e[o];a._SymbolsMap[o]=1,Hr(i)?a[o]=H.createFromGraphic(i,r??null):a[o]=i}return a}$n.prototype=Dt;function rt(e,t){const n={mode:t,compiled:!0,functions:{},signatures:[],standardFunction:xe,standardFunctionAsync:xe,evaluateIdentifier:Ho};for(let r=0;r0){if(!n.toLowerCase().startsWith("_t")&&e.localStack[e.localStack.length-1][n]!==void 0)return e.localStack[e.localStack.length-1][n];const a=e.mangleMap[n];if(a!==void 0&&e.localStack[e.localStack.length-1][a]!==void 0)return e.localStack[e.localStack.length-1][a]}if(!n.toLowerCase().startsWith("_t")&&e.globalScope[n]!==void 0||e.globalScope._SymbolsMap[n]===1)return e.globalScope[n];const r=e.mangleMap[n];return r!==void 0?e.globalScope[r]:void 0}rt([Rn],"sync"),rt([Rn],"async");let Cn=0;const xi={isNumber:e=>W(e),isArray:e=>_(e),isImmutableArray:e=>P(e),isFeature:e=>K(e),isString:e=>S(e),isDictionary:e=>qn(e),isGeometry:e=>nn(e),geometryMember:(e,t,n,r,a=1)=>mt(e,t,n,r,a),error(e){throw new h(null,e,null)},__awaiter:(e,t,n,r)=>new Promise((a,s)=>{function o(l){try{u(r.next(l))}catch(f){s(f)}}function i(l){try{u(r.throw(l))}catch(f){s(f)}}function u(l){l.done?a(l.value):l.value?.then?l.value.then(o,i):(Cn++,Cn%100==0?setTimeout(()=>{Cn=0,o(l.value)},0):o(l.value))}u((r=r.apply(e,t||[])).next())}),functionDepthchecker:(e,t)=>function(){if(t.depthCounter.depth++,t.localStack.push({}),t.depthCounter.depth>64)throw new h(null,c.MaximumCallDepth,null);const n=e.apply(this,arguments);return $e(n)?n.then(r=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,r)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)},chkAssig(e,t){if(t.gdefs[e]===void 0)throw new h(t,c.InvalidIdentifier,null);return e},mustBoolean(e,t){if(e===!0||e===!1)return e;throw new h(t,c.BooleanConditionRequired,null)},setAssig:(e,t)=>(t.gdefs[e]=1,e),castString:e=>E(e),aCheck(e,t){if(Y(e))throw t==="ArrayExpression"?new h(null,c.NoFunctionInArray,null):t==="ObjectExpression"?new h(null,c.NoFunctionInDictionary,null):new h(null,c.NoFunctionInTemplateLiteral,null);return e===I?null:e},Dictionary:v,Feature:H,UserDefinedCompiledFunction:Ao,dictionary(e){const t={},n=new Map;for(let a=0;a>":case">>>":case"^":case"&":return qr(m(e),m(t),n);case"==":case"=":return Pe(e,t);case"!=":return!Pe(e,t);case"<":case">":case"<=":case">=":return Wr(e,t,n);case"+":return S(e)||S(t)?E(e)+E(t):m(e)+m(t);case"-":return m(e)-m(t);case"*":return m(e)*m(t);case"/":return m(e)/m(t);case"%":return m(e)%m(t);default:throw new h(null,c.UnsupportedOperator,null)}},assign(e,t,n){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(null,c.UnsupportedOperator,null)}},update(e,t,n,r){const a=m(e[t]);return e[t]=n==="++"?a+1:a-1,r===!1?a:n==="++"?a+1:a-1},graphicToFeature:(e,t,n)=>e===null?null:H.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone),memberupdate(e,t,n,r){let a;if(_(e)){if(!W(t))throw new h(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>=e.length)throw new h(null,c.OutOfBounds,null);a=m(e[t]),e[t]=n==="++"?a+1:a-1}else if(e instanceof v){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new h(null,c.FieldNotFound,null,{key:t});a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else if(K(e)){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new h(null,c.FieldNotFound,null);a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else{if(P(e))throw new h(null,c.Immutable,null);if(!(e instanceof St))throw new h(null,c.InvalidIdentifier,null);if(S(t)===!1)throw new h(null,c.ModuleAccessorMustBeString,null);if(e.hasGlobal(t)!==!0)throw new h(null,c.ModuleExportNotFound,null);a=m(e.global(t)),e.setGlobal(t,n==="++"?a+1:a-1)}return r===!1?a:n==="++"?a+1:a-1},assignmember(e,t,n,r){if(_(e)){if(!W(t))throw new h(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>e.length)throw new h(null,c.OutOfBounds,null);if(t===e.length){if(n!=="=")throw new h(null,c.OutOfBounds,null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else if(e instanceof v){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new h(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else if(K(e)){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new h(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else{if(P(e))throw new h(null,c.Immutable,null);if(!(e instanceof St))throw new h(null,c.InvalidIdentifier,null);if(S(t)===!1)throw new h(null,c.ModuleAccessorMustBeString,null);if(!e.hasGlobal(t))throw new h(null,c.ModuleExportNotFound,null);e.setGlobal(t,this.assign(r,n,e.global(t)))}},member(e,t){if(e===null)throw new h(null,c.MemberOfNull,null);if(e instanceof v||K(e)){if(S(t))return e.field(t);throw new h(null,c.InvalidMemberAccessKey,null)}if(e instanceof k){if(S(t))return mt(e,t,null,null);throw new h(null,c.InvalidMemberAccessKey,null)}if(_(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new h(null,c.OutOfBounds,null);return e[t]}throw new h(null,c.InvalidMemberAccessKey,null)}if(S(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new h(null,c.OutOfBounds,null);return e[t]}throw new h(null,c.InvalidMemberAccessKey,null)}if(P(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length()+t),t>=e.length()||t<0)throw new h(null,c.OutOfBounds,null);return e.get(t)}throw new h(null,c.InvalidMemberAccessKey,null)}if(e instanceof St){if(S(t))return e.global(t);throw new h(null,c.InvalidMemberAccessKey,null)}throw new h(null,c.InvalidMemberAccessKey,null)},callfunc:(e,t,n)=>e.call(n,{arguments:t,preparsed:!0}),loadModule(e,t){const n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];const r=t.moduleFactory[n]({vars:{},moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,console:t.console,abortSignal:t.abortSignal,isAsync:t.isAsync,services:t.services,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor},t.spatialReference);return t.moduleSingletons[n]=r,r},callModuleFunction(e,t,n,r){if(!(e instanceof St))throw new h(null,c.FunctionNotFound,null);const a=e.global(n);if(Y(a)===!1)throw new h(null,c.CallNonFunction,null);return a.call(r,{preparsed:!0,arguments:t})},getNestedOptionalValue:(e,t)=>Xn(e,t)};function $t(e){console.log(e)}function Fi(e,t,n=!1){t===null&&(t={vars:{},customfunctions:{}});let r=null;e.usesModules&&(r=new on(null,e.loadedModules));const a={isAsync:n,globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:t.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let s=Rt(a,e);s===""&&(s="lc.voidOperation; "),a.undeclaredGlobalsInFunctions.size>0&&a.undeclaredGlobalsInFunctions.forEach(g=>{throw new he(t,c.InvalidIdentifier,g.node)});let o="";o=n?`var runtimeCtx=this.prepare(context, true); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; +return lang.__awaiter(this, void 0, void 0, function* () { + + function mainBody() { + var lastStatement=lc.voidOperation; + return lang.__awaiter(this, void 0, void 0, function* () { +`+s+` + return lastStatement; }); } + return this.postProcess(yield mainBody()); }); `:`var runtimeCtx=this.prepare(context, false); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; + function mainBody() { + var lastStatement=lc.voidOperation; + `+s+` + return lastStatement; } + return this.postProcess(mainBody()); `;const i=a.moduleFactory,u=a.moduleFactoryMap,l=a.exports,f={};let d;for(d in l)f[d]=a.mangleMap[d]??d;const p={lc:Kr,lang:xi,mangles:a.mangleMap,postProcess(g){if(g instanceof Fe&&(g=g.value),g instanceof an&&(g=g.value),g===I&&(g=null),g===Le)throw new h(null,c.IllegalResult,null);if(g===Ot)throw new h(null,c.IllegalResult,null);if(Y(g))throw new h(null,c.IllegalResult,null);return g},prepare(g,y){let b=g.spatialReference;b==null&&(b=Pt.WebMercator);const x=wi(g.vars,g.customfunctions,y,g.timeZone);return{localStack:[],isAsync:y,moduleFactory:i,moduleFactoryMap:u,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:f,spatialReference:b,globalScope:x,abortSignal:g.abortSignal===void 0||g.abortSignal===null?{aborted:!1}:g.abortSignal,localScope:null,services:g.services,console:g.console??$t,lrucache:g.lrucache,timeZone:g.timeZone??null,interceptor:g.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(p)}async function Ko(){return rt([await je(()=>import("./geomasync-uGYsifQH-iajyCE0f.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url)],"async"),!0}class St extends Kn{constructor(t){super(),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(Y(n))throw new h(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope,r=t.toLowerCase(),a=n[this.moduleContext.exportmangle[r]];if(a===void 0)throw new h(null,c.InvalidIdentifier,null);if(Y(a)&&!(a instanceof ft)){const s=new ft;return s.fn=a,s.parameterEvaluator=xe,s.context=this.moduleContext,n[this.moduleContext.exportmangle[r]]=s,s}return a}}function Xo(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new on(null,e.loadedModules),globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=Rt(r,e);a===""&&(a="lc.voidOperation; ");let s="";s=n?`var runtimeCtx=this.prepare(context, true); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; +return lang.__awaiter(this, void 0, void 0, function* () { + + function mainBody() { + var lastStatement=lc.voidOperation; + return lang.__awaiter(this, void 0, void 0, function* () { +`+a+` + return lastStatement; }); } + yield mainBody(); + return this.prepareModule(runtimeCtx); }); `:`var runtimeCtx=this.prepare(context, false); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; + function mainBody() { + var lastStatement=lc.voidOperation; + `+a+` + return lastStatement; } + mainBody(); + return this.prepareModule(runtimeCtx); `;const o=r.moduleFactory,i=r.moduleFactoryMap,u=r.exports,l={};let f;for(f in u)l[f]=r.mangleMap[f]??f;const d={lc:Kr,lang:xi,mangles:r.mangleMap,prepareModule:p=>new St(p),prepare(p,g){let y=p.spatialReference;y==null&&(y=new Pt({wkid:102100}));const b=wi(p.vars,p.customfunctions,g,p.timeZone);return{localStack:[],isAsync:g,exports:u,exportmangle:l,gdefs:{},moduleFactory:o,moduleFactoryMap:i,moduleSingletons:p.moduleSingletons,mangleMap:this.mangles,spatialReference:y,globalScope:b,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console??$t,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:p.depthCounter}}};return new Function("context","spatialReference",s).bind(d)}var Ht={False:"false",Null:"null",True:"true"},z={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},A={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},Zn=["++","--"],Ai=["-","+","!","~"],Ci=["=","/=","*=","%=","+=","-="],Ei=["||","&&"],Qo=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],Br={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},C={Unknown:0,BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,Template:10},Yo=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"],F={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentiferExpected:"IdentiferExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},$o={[F.InvalidModuleUri]:"Module uri must be a text literal.",[F.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[F.IdentiferExpected]:"'${value}' is an invalid identifier.",[F.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[F.InvalidExpression]:"Invalid expression.",[F.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[F.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[F.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[F.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[F.InvalidTemplateHead]:"Invalid template structure.",[F.InvalidVariableAssignment]:"Invalid variable assignment.",[F.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[F.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[F.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[F.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[F.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[F.PunctuatorExpected]:"'${value}' expected.",[F.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[F.UnexpectedBoolean]:"Unexpected boolean literal.",[F.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[F.UnexpectedIdentifier]:"Unexpected identifier.",[F.UnexpectedKeyword]:"Unexpected keyword.",[F.UnexpectedNull]:"Unexpected null literal.",[F.UnexpectedNumber]:"Unexpected number.",[F.UnexpectedPunctuator]:"Unexpected ponctuator.",[F.UnexpectedString]:"Unexpected text literal.",[F.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[F.UnexpectedToken]:"Unexpected token '${value}'."},Lt=class bi extends Error{constructor({code:t,index:n,line:r,column:a,len:s=0,description:o,data:i}){super(o??t),this.declaredRootClass="esri.arcade.lib.diagnostic",this.name="ParsingError",this.code=t,this.index=n,this.line=r,this.column=a,this.len=s,this.data=i,this.description=o,this.range={start:{line:r,column:a-1},end:{line:r,column:a+s}},Error.captureStackTrace?.(this,bi)}};function es(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.Program}function _r(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.BlockStatement}function ts(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.BlockComment}function ns(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.EmptyStatement}function rs(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.VariableDeclarator}function En(e,t){return t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function Tr(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}var is=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!_r(e)||e.body.length!==0)return;let t=[];for(let n=this._newComments.length-1;n>=0;n--){let r=this._newComments[n];e.range[1]>=r.range[0]&&(t.unshift(r),this._newComments.splice(n,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){let t=this._nodeStack.at(-1);if(!t)return;if(_r(e)&&Tr(t,e))for(let r=this._newComments.length-1;r>=0;r--){let a=this._newComments[r];Tr(a,e)&&(t.trailingComments=[...t.trailingComments??[],a],this._newComments.splice(r,1))}let n=[];if(this._newComments.length>0)for(let r=this._newComments.length-1;r>=0;r--){let a=this._newComments[r];En(a,t)?(t.trailingComments=[...t.trailingComments??[],a],this._newComments.splice(r,1)):En(a,e)&&(n.unshift(a),this._newComments.splice(r,1))}t.trailingComments&&En(t.trailingComments[0],e)&&(n=[...n,...t.trailingComments],delete t.trailingComments),n.length>0&&(e.trailingComments=n)}attachLeadingComments(e){let t;for(;this._nodeStack.length>0;){let a=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=a.range[0]))break;t=a,this._nodeStack.pop()}let n=[],r=[];if(t!=null){if(!t.leadingComments)return;for(let a=t.leadingComments.length-1;a>=0;a--){let s=t.leadingComments[a];e.range[0]>=s.range[1]?(n.unshift(s),t.leadingComments.splice(a,1)):rs(e)&&!ts(s)&&(r.unshift(s),t.leadingComments.splice(a,1))}return t.leadingComments.length===0&&delete t.leadingComments,n.length&&(e.leadingComments=n),void(r.length&&(e.trailingComments=[...r,...e.trailingComments??[]]))}for(let a=this._newComments.length-1;a>=0;a--){let s=this._newComments[a];e.range[0]>=s.range[0]&&(n.unshift(s),this._newComments.splice(a,1))}n.length&&(e.leadingComments=n)}attachComments(e){if(es(e)&&e.body.length>0){let t=this._nodeStack.at(-1);return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}},as=/\$\{(.*?)\}/gu;function jn(e,t){let n=$o[e];return t?n.replace(as,(r,a)=>t[a]?.toString()??""):n}var os=class{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description??(e.description=jn(e.code,e.data)),new Lt(e)}tolerateError(e){e.description??(e.description=jn(e.code,e.data));let t=new Lt(e);if(!this.tolerant)throw t;this.recordError(t)}};function Mr(e,t){if(!e)throw new Error(`ASSERT: ${t}`)}var Nr={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u},U={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>e===10||e===13||e===8232||e===8233,isIdentifierStart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Nr.NonAsciiIdentifierStart.test(U.fromCodePoint(e)),isIdentifierPart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Nr.NonAsciiIdentifierPart.test(U.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function Rr(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function bn(e){return"01234567".indexOf(e)}var tt=[[],[],[]];Zn.forEach(e=>tt[e.length-1]?.push(e)),Ai.forEach(e=>tt[e.length-1]?.push(e)),Ei.forEach(e=>tt[e.length-1]?.push(e)),Ci.forEach(e=>tt[e.length-1]?.push(e)),Qo.forEach(e=>tt[e.length-1]?.push(e));var ss=class{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=F.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(e=F.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){let t=[],n=this.index-e,r={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){let s=this.source.charCodeAt(this.index);if(this.index+=1,U.isLineTerminator(s)){r.end={line:this.lineNumber,column:this.index-this.lineStart-1};let o={multiLine:!1,start:n+e,end:this.index-1,range:[n,this.index-1],loc:r};return t.push(o),s===13&&this.source.charCodeAt(this.index)===10&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,t}}r.end={line:this.lineNumber,column:this.index-this.lineStart};let a={multiLine:!1,start:n+e,end:this.index,range:[n,this.index],loc:r};return t.push(a),t}skipMultiLineComment(){let e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){let a=this.source.charCodeAt(this.index);if(U.isLineTerminator(a))a===13&&this.source.charCodeAt(this.index+1)===10&&(this.index+=1),this.lineNumber+=1,this.index+=1,this.lineStart=this.index;else if(a===42){if(this.source.charCodeAt(this.index+1)===47){this.index+=2,n.end={line:this.lineNumber,column:this.index-this.lineStart};let s={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:n};return e.push(s),e}this.index+=1}else this.index+=1}n.end={line:this.lineNumber,column:this.index-this.lineStart};let r={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:n};return e.push(r),this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(U.isWhiteSpace(t))this.index+=1;else if(U.isLineTerminator(t))this.index+=1,t===13&&this.source.charCodeAt(this.index)===10&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else{if(t!==47)break;if(t=this.source.charCodeAt(this.index+1),t===47){this.index+=2;let n=this.skipSingleLineComment(2);e=[...e,...n]}else{if(t!==42)break;{this.index+=2;let n=this.skipMultiLineComment();e=[...e,...n]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===z.If||e===z.In;case 3:return e===z.Var||e===z.For;case 4:return e===z.Else;case 5:return e===z.Break||e===z.While;case 6:return e===z.Return||e===z.Import||e===z.Export;case 8:return e===z.Function||e===z.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){let n=this.source.charCodeAt(e+1);n>=56320&&n<=57343&&(t=1024*(t-55296)+n-56320+65536)}return t}scanHexEscape(e){let t=e==="u"?4:2,n=0;for(let r=0;r1114111||e!=="}")&&this.throwUnexpectedToken(),U.fromCodePoint(t)}getIdentifier(){let e=this.index;for(this.index+=1;!this.eof();){let t=this.source.charCodeAt(this.index);if(t===92)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!U.isIdentifierPart(t))break;this.index+=1}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),n=U.fromCodePoint(t);for(this.index+=n.length,t===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),this.index+=1,this.source[this.index]==="{"?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(e===null||e==="\\"||!U.isIdentifierStart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),n=e);!this.eof()&&(t=this.codePointAt(this.index),U.isIdentifierPart(t));)e=U.fromCodePoint(t),n+=e,this.index+=e.length,t===92&&(n=n.substring(0,n.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),this.index+=1,this.source[this.index]==="{"?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(e===null||e==="\\"||!U.isIdentifierPart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),n+=e);return n}octalToDecimal(e){let t=e!=="0",n=bn(e);return!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+bn(this.source[this.index]??""),this.index+=1,"0123".includes(e)&&!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+bn(this.source[this.index]??""),this.index+=1)),{code:n,octal:t}}scanIdentifier(){let e,t=this.index,n=this.source.charCodeAt(t)===92?this.getComplexIdentifier():this.getIdentifier();if(e=n.length===1?C.Identifier:this.isKeyword(n)?C.Keyword:n.toLowerCase()===Ht.Null?C.NullLiteral:n.toLowerCase()===Ht.True||n.toLowerCase()===Ht.False?C.BooleanLiteral:C.Identifier,e!==C.Identifier&&t+n.length!==this.index){let r=this.index;this.index=t,this.tolerateUnexpectedToken(F.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanPunctuator(){let e=this.index,t=this.source[this.index]??"";switch(t){case"(":case"{":t==="{"&&this.curlyStack.push("{"),this.index+=1;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":this.index+=1;break;case"}":this.index+=1,this.curlyStack.pop();break;default:for(let n=tt.length;n>0;n--)if(t=this.source.substring(this.index,this.index+n),tt[n-1]?.includes(t)){this.index+=n;break}}return this.index===e&&this.throwUnexpectedToken(),{type:C.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&U.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index],this.index+=1;return t.length===0&&this.throwUnexpectedToken(),U.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseInt(`0x${t}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){let n=this.source[this.index];if(n!=="0"&&n!=="1")break;t+=this.source[this.index],this.index+=1}if(t.length===0&&this.throwUnexpectedToken(),!this.eof()){let n=this.source.charCodeAt(this.index);(U.isIdentifierStart(n)||U.isDecimalDigit(n))&&this.throwUnexpectedToken()}return{type:C.NumericLiteral,value:Number.parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let n="",r=!1;for(U.isOctalDigit(e.charCodeAt(0))&&(r=!0,n=`0${this.source[this.index]}`),this.index+=1;!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;return!r&&n.length===0&&this.throwUnexpectedToken(),(U.isIdentifierStart(this.source.charCodeAt(this.index))||U.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseInt(n,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){let e=this.index,t=this.source[e]??"";Mr(U.isDecimalDigit(t.charCodeAt(0))||t===".","Numeric literal must start with a decimal digit or a decimal point");let n="";if(t!=="."){if(n=this.source[this.index]??"",this.index+=1,t=this.source[this.index]??"",n==="0"){if(t==="x"||t==="X")return this.index+=1,this.scanHexLiteral(e);if(t==="b"||t==="B")return this.index+=1,this.scanBinaryLiteral(e);if(t==="o"||t==="O")return this.scanOctalLiteral(t,e)}for(;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if(t==="."){for(n+=this.source[this.index],this.index+=1;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if(t==="e"||t==="E")if(n+=this.source[this.index],this.index+=1,t=this.source[this.index]??"",(t==="+"||t==="-")&&(n+=this.source[this.index],this.index+=1),U.isDecimalDigit(this.source.charCodeAt(this.index)))for(;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken();return U.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){let e=this.index,t=this.source[e];Mr(t==="'"||t==='"',"String literal must starts with a quote"),this.index+=1;let n=!1,r="";for(;!this.eof();){let a=this.source[this.index]??"";if(this.index+=1,a===t){t="";break}if(a==="\\")if(a=this.source[this.index]??"",this.index+=1,a&&U.isLineTerminator(a.charCodeAt(0)))this.lineNumber+=1,a==="\r"&&this.source[this.index]===` +`&&(this.index+=1),this.lineStart=this.index;else switch(a){case"u":if(this.source[this.index]==="{")this.index+=1,r+=this.scanUnicodeCodePointEscape();else{let s=this.scanHexEscape(a);s===null&&this.throwUnexpectedToken(),r+=s}break;case"x":{let s=this.scanHexEscape(a);s===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),r+=s;break}case"n":r+=` +`;break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;case"8":case"9":r+=a,this.tolerateUnexpectedToken();break;default:if(a&&U.isOctalDigit(a.charCodeAt(0))){let s=this.octalToDecimal(a);n=s.octal||n,r+=String.fromCharCode(s.code)}else r+=a}else{if(U.isLineTerminator(a.charCodeAt(0)))break;r+=a}}return t!==""&&(this.index=e,this.throwUnexpectedToken()),{type:C.StringLiteral,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",t=!1,n=this.index,r=this.source[n]==="`",a=!1,s=2;for(this.index+=1;!this.eof();){let o=this.source[this.index]??"";if(this.index+=1,o==="`"){s=1,a=!0,t=!0;break}if(o!=="$")if(o!=="\\")U.isLineTerminator(o.charCodeAt(0))?(this.lineNumber+=1,o==="\r"&&this.source[this.index]===` +`&&(this.index+=1),this.lineStart=this.index,e+=` +`):e+=o;else if(o=this.source[this.index]??"",this.index+=1,U.isLineTerminator(o.charCodeAt(0)))this.lineNumber+=1,o==="\r"&&this.source[this.index]===` +`&&(this.index+=1),this.lineStart=this.index;else switch(o){case"n":e+=` +`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"u":if(this.source[this.index]==="{")this.index+=1,e+=this.scanUnicodeCodePointEscape();else{let i=this.index,u=this.scanHexEscape(o);u!==null?e+=u:(this.index=i,e+=o)}break;case"x":{let i=this.scanHexEscape(o);i===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),e+=i;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:o==="0"?(U.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(F.TemplateOctalLiteral),e+="\0"):U.isOctalDigit(o.charCodeAt(0))?this.throwUnexpectedToken(F.TemplateOctalLiteral):e+=o}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),this.index+=1,t=!0;break}e+=o}}return t||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:C.Template,value:this.source.slice(n+1,this.index-s),cooked:e,head:r,tail:a,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}lex(){if(this.eof())return{type:C.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};let e=this.source.charCodeAt(this.index);return U.isIdentifierStart(e)?this.scanIdentifier():e===40||e===41||e===59?this.scanPunctuator():e===39||e===34?this.scanStringLiteral():e===46?U.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():U.isDecimalDigit(e)?this.scanNumericLiteral():e===96||e===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():e>=55296&&e<57343&&U.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}},ge={None:0,Function:1,IfClause:2,ForLoop:4,WhileLoop:8},vn={AsObject:0,Automatic:1};function Lr(e,t=0){let n=e.start-e.lineStart,r=e.lineNumber;return n<0&&(n+=t,r-=1),{index:e.start,line:r,column:n}}function Pr(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function Or(e){return e in Br?Br[e]:0}var us=class{constructor(e,t={},n){this.delegate=n,this.hasLineTerminator=!1,this.options={tokens:typeof t.tokens=="boolean"&&t.tokens,comments:typeof t.comments=="boolean"&&t.comments,tolerant:typeof t.tolerant=="boolean"&&t.tolerant},this.options.comments&&(this.commentHandler=new is),this.errorHandler=new os(this.options.tolerant),this.scanner=new ss(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:ge.None,curlyParsingType:vn.AsObject},this.rawToken={type:C.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:n,invalidTypes:r}){n?.some(a=>e.type===a)||r?.some(a=>e.type===a)&&this.throwError(F.InvalidExpression,t)}throwError(e,t,n=this.endMarker){let{index:r,line:a,column:s}=t,o=n.index-r-1;this.errorHandler.throwError({code:e,index:r,line:a,column:s+1,len:o})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){let t,{rawToken:n}=e,{code:r,data:a}=e;if(n){if(!r)switch(n.type){case C.EOF:r=F.UnexpectedEndOfScript;break;case C.Identifier:r=F.UnexpectedIdentifier;break;case C.NumericLiteral:r=F.UnexpectedNumber;break;case C.StringLiteral:r=F.UnexpectedString;break;case C.Template:r=F.UnexpectedTemplate}t=n.value.toString()}else t="ILLEGAL";r??(r=F.UnexpectedToken),a||(a={value:t});let s=jn(r,a);if(n){let u=n.start,l=n.lineNumber,f=n.start-n.lineStart+1;return new Lt({code:r,index:u,line:l,column:f,len:n.end-n.start-1,data:a,description:s})}let{index:o,line:i}=this.endMarker;return new Lt({code:r,index:o,line:i,column:this.endMarker.column+1,data:a,description:s})}throwUnexpectedToken(e={}){throw e.rawToken??(e.rawToken=this.rawToken),this.unexpectedTokenError(e)}collectComments(e){let{commentHandler:t}=this;!t||!e.length||e.forEach(n=>{let r={type:n.multiLine?A.BlockComment:A.LineComment,value:this.getSourceValue(n),range:n.range,loc:n.loc};t.collectComment(r)})}peekAhead(e){let t=()=>(this.scanner.scanComments(),this.scanner.lex()),n=this.scanner.saveState(),r=e.call(this,t);return this.scanner.restoreState(n),r}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:Yo[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;let e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==C.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate??this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){let t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:F.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==C.Keyword||this.rawToken.value.toLowerCase()!==e.toString()?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==C.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===C.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===C.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===C.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if(typeof e=="string"&&(e=e.split("")),this.rawToken.type===C.Punctuator&&e.length)return e.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(e){let t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let n=e.call(this);return this.context.isAssignmentTarget=t,n}inheritCoverGrammar(e){var t;let n=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let r=e.call(this);return(t=this.context).isAssignmentTarget&&(t.isAssignmentTarget=n),r}withBlockContext(e,t){let n=this.context.blockContext;this.context.blockContext|=e;let r=this.context.curlyParsingType;this.context.curlyParsingType=vn.Automatic;let a=t.call(this);return this.context.blockContext=n,this.context.curlyParsingType=r,a}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator){if(this.rawToken.type===C.EOF||this.matchPunctuator("}"))return this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column);this.throwUnexpectedToken({rawToken:this.rawToken})}}parsePrimaryExpression(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case C.Identifier:return this.readNextRawToken(),this.finalize({type:A.Identifier,name:t.value,...this.getItemLocation(e)});case C.NumericLiteral:case C.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:typeof t.value=="string",...this.getItemLocation(e)});case C.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value.toLowerCase()===Ht.True,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case C.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:null,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case C.Template:return this.parseTemplateLiteral();case C.Punctuator:switch(t.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case"[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case"{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case C.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){let e=this.captureStartMarker();this.expectPunctuator("[");let t=[];for(;!this.matchPunctuator("]");){let n=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(F.InvalidExpression,n)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:A.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case C.StringLiteral:return this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case C.Identifier:case C.BooleanLiteral:case C.NullLiteral:case C.Keyword:return this.readNextRawToken(),this.finalize({type:A.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(F.KeyMustBeString,e)}}parseObjectProperty(){let e=this.rawToken,t=this.captureStartMarker(),n=this.parseObjectPropertyKey(),r=!1,a=null;return this.matchPunctuator(":")?(this.readNextRawToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):e.type===C.Identifier?(r=!0,a=this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:A.Property,kind:"init",key:n,value:a,shorthand:r,...this.getItemLocation(t)})}parseObjectExpression(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:A.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){let t=this.rawToken;t.type!==C.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:F.InvalidTemplateHead,rawToken:t});let n=this.captureStartMarker();this.readNextRawToken();let{value:r,cooked:a,tail:s}=t,o=this.finalize({type:A.TemplateElement,value:{raw:r,cooked:a},tail:s,...this.getItemLocation(n)});return o.loc.start.column+=1,o.loc.end.column-=s?1:2,o}parseTemplateLiteral(){let e=this.captureStartMarker(),t=[],n=[],r=this.parseTemplateElement(!0);for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize({type:A.TemplateLiteral,quasis:n,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");let e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");let e=[];if(!this.matchPunctuator(")"))for(;;){let t=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){let e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==C.NullLiteral&&e.type!==C.Identifier&&e.type!==C.Keyword&&e.type!==C.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){let e,t=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)),r=this.captureStartMarker();for(;e=this.getMatchingPunctuator("([.");)switch(e){case"(":{this.context.isAssignmentTarget=!1,n.type!==A.Identifier&&n.type!==A.MemberExpression&&this.throwError(F.IdentiferExpected,t,r);let a=this.parseArguments();n=this.finalize({type:A.CallExpression,callee:n,arguments:a,...this.getItemLocation(t)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");let a=this.isolateCoverGrammar(()=>this.parseExpression());this.expectPunctuator("]"),n=this.finalize({type:A.MemberExpression,computed:!0,object:n,property:a,...this.getItemLocation(t)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");let a=this.parseMemberName();n=this.finalize({type:A.MemberExpression,computed:!1,object:n,property:a,...this.getItemLocation(t)});continue}}return n}parseUpdateExpression(){let e=this.captureStartMarker(),t=this.getMatchingPunctuator(Zn);if(t){this.readNextRawToken();let s=this.captureStartMarker(),o=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return o.type!==A.Identifier&&o.type!==A.MemberExpression&&o.type!==A.CallExpression&&this.throwError(F.InvalidExpression,s),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:A.UpdateExpression,operator:t,argument:o,prefix:!0,...this.getItemLocation(e)})}let n=this.captureStartMarker(),r=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this)),a=this.captureStartMarker();return this.hasLineTerminator||(t=this.getMatchingPunctuator(Zn),!t)?r:(r.type!==A.Identifier&&r.type!==A.MemberExpression&&this.throwError(F.InvalidExpression,n,a),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:A.UpdateExpression,operator:t,argument:r,prefix:!1,...this.getItemLocation(e)}))}parseUnaryExpression(){let e=this.getMatchingPunctuator(Ai);if(e){let t=this.captureStartMarker();this.readNextRawToken();let n=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:A.UnaryExpression,operator:e,argument:n,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){let e=this.rawToken,t=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));if(this.rawToken.type!==C.Punctuator)return t;let n=this.rawToken.value,r=Or(n);if(r===0)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;let a=[e,this.rawToken],s=t,o=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)),i=[s,n,o],u=[r];for(;this.rawToken.type===C.Punctuator&&(r=Or(this.rawToken.value))>0;){for(;i.length>2&&r<=u[u.length-1];){o=i.pop();let d=i.pop();u.pop(),s=i.pop(),a.pop();let p=a[a.length-1],g=Lr(p,p.lineStart);i.push(this.finalize(this.createBinaryOrLogicalExpression(g,d,s,o)))}i.push(this.rawToken.value),u.push(r),a.push(this.rawToken),this.readNextRawToken(),i.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}let l=i.length-1;t=i[l];let f=a.pop();for(;l>1;){let d=a.pop();if(!d)break;let p=f?.lineStart,g=Lr(d,p),y=i[l-1];t=this.finalize(this.createBinaryOrLogicalExpression(g,y,i[l-2],t)),l-=2,f=d}return t}createBinaryOrLogicalExpression(e,t,n,r){let a=Ei.includes(t)?A.LogicalExpression:A.BinaryExpression;return a===A.BinaryExpression||((n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,...Pr(n)),(r.type===A.AssignmentExpression||r.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,...Pr(n))),{type:a,operator:t,left:n,right:r,...this.getItemLocation(e)}}parseAssignmentExpression(){let e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this)),n=this.captureStartMarker(),r=this.getMatchingPunctuator(Ci);if(!r)return t;t.type!==A.Identifier&&t.type!==A.MemberExpression&&this.throwError(F.InvalidExpression,e,n),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();let a=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:A.AssignmentExpression,left:t,operator:r,right:a,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(e){let t=[];for(;this.rawToken.type!==C.EOF&&!this.matchPunctuator(e);){let n=this.parseStatementListItem();ns(n)||t.push(n)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(z.Function)?this.parseFunctionDeclaration():this.matchKeyword(z.Export)?this.parseExportDeclaration():this.matchKeyword(z.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:A.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){let e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:A.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===vn.AsObject||this.peekAhead(e=>{let t=e();return!(t.type!==C.Identifier&&t.type!==C.StringLiteral||(t=e(),t.type!==C.Punctuator||t.value!==":"))})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){let e=this.rawToken;if(e.type!==C.Identifier)return null;let t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){let e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:F.IdentiferExpected});let n=null;if(this.matchPunctuator("=")){this.readNextRawToken();let r=this.rawToken;try{n=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:r,code:F.InvalidVariableAssignment})}}return this.finalize({type:A.VariableDeclarator,id:t,init:n,...this.getItemLocation(e)})}parseVariableDeclarationList(){let e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){let e=this.captureStartMarker();this.expectKeyword(z.Var);let t=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:A.VariableDeclaration,declarations:t,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){let e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:A.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){let e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:A.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(ge.IfClause,this.parseStatement.bind(this))}parseIfStatement(){let e=this.captureStartMarker();this.expectKeyword(z.If),this.expectPunctuator("(");let t=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,t,r);let a=this.parseIfClause(),s=null;return this.matchKeyword(z.Else)&&(this.readNextRawToken(),s=this.parseIfClause()),this.finalize({type:A.IfStatement,test:n,consequent:a,alternate:s,...this.getItemLocation(e)})}parseWhileStatement(){let e=this.captureStartMarker();this.expectKeyword(z.While),this.expectPunctuator("(");let t=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,t,r);let a=this.withBlockContext(ge.WhileLoop,this.parseStatement.bind(this));return this.finalize({type:A.WhileStatement,test:n,body:a,...this.getItemLocation(e)})}parseForStatement(){let e=null,t=null,n=null,r=null,a=null,s=this.captureStartMarker();if(this.expectKeyword(z.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(z.Var)){let i=this.captureStartMarker();this.readNextRawToken();let u=this.parseVariableDeclarationList();u.length===1&&this.matchKeyword(z.In)?(u[0].init&&this.throwError(F.ForInOfLoopInitializer,i),r=this.finalize({type:A.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(i)}),this.readNextRawToken(),a=this.parseExpression()):(this.matchKeyword(z.In)&&this.throwError(F.InvalidLeftHandSideInForIn,i),e=this.finalize({type:A.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(i)}),this.expectPunctuator(";"))}else{let i=this.context.isAssignmentTarget,u=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this)),this.matchKeyword(z.In)?(this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInForIn,u),e.type!==A.Identifier&&this.throwError(F.InvalidLeftHandSideInForIn,u),this.readNextRawToken(),r=e,a=this.parseExpression(),e=null):(this.context.isAssignmentTarget=i,this.expectPunctuator(";"))}r||(this.matchPunctuator(";")||(t=this.isolateCoverGrammar(this.parseExpression.bind(this))),this.expectPunctuator(";"),this.matchPunctuator(")")||(n=this.isolateCoverGrammar(this.parseExpression.bind(this)))),this.expectPunctuator(")");let o=this.withBlockContext(ge.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement.bind(this)));return r&&a?this.finalize({type:A.ForInStatement,left:r,right:a,body:o,...this.getItemLocation(s)}):this.finalize({type:A.ForStatement,init:e,test:t,update:n,body:o,...this.getItemLocation(s)})}parseContinueStatement(){let e=this.captureStartMarker();return this.expectKeyword(z.Continue),this.consumeSemicolon(),this.finalize({type:A.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){let e=this.captureStartMarker();return this.expectKeyword(z.Break),this.consumeSemicolon(),this.finalize({type:A.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){let e=this.captureStartMarker();this.expectKeyword(z.Return);let t=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||this.rawToken.type===C.EOF)&&this.rawToken.type!==C.StringLiteral&&this.rawToken.type!==C.Template?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:A.ReturnStatement,argument:t,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case C.BooleanLiteral:case C.NullLiteral:case C.NumericLiteral:case C.StringLiteral:case C.Template:case C.Identifier:return this.parseExpressionStatement();case C.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case C.Keyword:switch(this.rawToken.value.toLowerCase()){case z.Break:return this.parseBreakStatement();case z.Continue:return this.parseContinueStatement();case z.For:return this.parseForStatement();case z.Function:return this.parseFunctionDeclaration();case z.If:return this.parseIfStatement();case z.Return:return this.parseReturnStatement();case z.Var:return this.parseVariableDeclaration();case z.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){let e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==C.EOF;){let t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:F.IdentiferExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&ge.Function)===ge.Function&&this.throwUnexpectedToken({code:F.NoFunctionInsideFunction}),((this.context.blockContext&ge.WhileLoop)===ge.WhileLoop||(this.context.blockContext&ge.IfClause)===ge.IfClause)&&this.throwUnexpectedToken({code:F.NoFunctionInsideBlock});let e=this.captureStartMarker();this.expectKeyword(z.Function);let t=this.parseIdentifier();t||this.throwUnexpectedToken({code:F.InvalidFunctionIdentifier});let n=this.parseFormalParameters(),r=this.context.blockContext;this.context.blockContext|=ge.Function;let a=this.parseBlock();return this.context.blockContext=r,this.finalize({type:A.FunctionDeclaration,id:t,params:n,body:a,...this.getItemLocation(e)})}parseScript(){let e=this.captureStartMarker(),t=this.parseStatements(),n=this.finalize({type:A.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(n.tokens=this.tokens),this.options.tolerant&&(n.errors=this.errorHandler.errors),n}parseExportDeclaration(){this.context.blockContext!==ge.None&&this.throwUnexpectedToken({code:F.ModuleExportRootOnly});let e=null,t=this.captureStartMarker();return this.expectKeyword(z.Export),this.matchKeyword(z.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:F.InvalidExpression}),this.finalize({type:A.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(t)})}parseModuleSpecifier(){let e=this.captureStartMarker(),t=this.rawToken;if(t.type===C.StringLiteral)return this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(F.InvalidModuleUri,e)}parseDefaultSpecifier(){let e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:F.IdentiferExpected}),this.finalize({type:A.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==ge.None&&this.throwUnexpectedToken({code:F.ModuleImportRootOnly});let e=this.captureStartMarker();this.expectKeyword(z.Import);let t=this.parseDefaultSpecifier();this.expectContextualKeyword(z.From);let n=this.parseModuleSpecifier();return this.finalize({type:A.ImportDeclaration,specifiers:[t],source:n,...this.getItemLocation(e)})}};function ls(e,t,n){return new us(e,t,n).parseScript()}function en(e,t=[]){const n=ls(e);if(n.body===null||n.body===void 0)throw new Lt({index:0,line:0,column:0,data:null,description:"",code:F.InvalidExpression});return n.loadedModules={},Ut(n,t),n}class tn{constructor(t){const n=this;n._keys=[],n._values=[],n.length=0,t&&t.forEach(r=>{n.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((t,n)=>[t,this._values[n]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(t){return this._keys.includes(t)}get(t){const n=this._keys.indexOf(t);return n>-1?this._values[n]:null}deepGet(t){if(!t?.length)return null;const n=(r,a)=>r==null?null:a.length?n(r instanceof tn?r.get(a[0]):r[a[0]],a.slice(1)):r;return n(this.get(t[0]),t.slice(1))}set(t,n){const r=this,a=this._keys.indexOf(t);return a>-1?r._values[a]=n:(r._keys.push(t),r._values.push(n),r.length=r._values.length),this}sortedSet(t,n,r,a){const s=this,o=this._keys.length,i=r||0,u=a!==void 0?a:o-1;if(o===0)return s._keys.push(t),s._values.push(n),s;if(t===this._keys[i])return this._values.splice(i,0,n),this;if(t===this._keys[u])return this._values.splice(u,0,n),this;if(t>this._keys[u])return this._keys.splice(u+1,0,t),this._values.splice(u+1,0,n),this;if(t=u)return this;const l=i+Math.floor((u-i)/2);return tthis._keys[l]?this.sortedSet(t,n,l+1,u):this}size(){return this.length}clear(){const t=this;return t._keys.length=t.length=t._values.length=0,this}delete(t){const n=this,r=n._keys.indexOf(t);return r>-1&&(n._keys.splice(r,1),n._values.splice(r,1),n.length=n._keys.length,!0)}forEach(t){this._keys.forEach((n,r)=>{t(this._values[r],n,r)})}map(t){return this.keys().map((n,r)=>t(this._values[r],n,r))}filter(t){const n=this;return n._keys.forEach((r,a)=>{t(n._values[a],r,a)===!1&&n.delete(r)}),this}clone(){return new tn(this.entries())}}class Me{constructor(t=20){this._maxEntries=t,this._values=new tn}delete(t){this._values.has(t)&&this._values.delete(t)}get(t){let n=null;return this._values.has(t)&&(n=this._values.get(t),this._values.delete(t),this._values.set(t,n)),n}put(t,n){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(t,n)}}class cs{constructor(t=20){this._maxEntries=t,this._cache=new Me(this._maxEntries),this._layerMetadata=new Me(this._maxEntries),this._serviceMetadata=new Me(this._maxEntries),this._portalItems=new Me(this._maxEntries),this._portalItemLayers=new Me(this._maxEntries)}clear(){this._cache=new Me(this._maxEntries),this._layerMetadata=new Me(this._maxEntries),this._serviceMetadata=new Me(this._maxEntries),this._portalItems=new Me(this._maxEntries),this._portalItemLayers=new Me(this._maxEntries)}addToCache(t,n){this._cache.put(t,n)}removeFromCache(t){this._cache.delete(t)}getFromCache(t){return this._cache.get(t)}getCachedLayerMetadata(t){return this._layerMetadata.get(t)}setCachedLayerMetadata(t,n){this._layerMetadata.put(t,n)}removeCachedLayerMetadata(t,n){this._layerMetadata.get(t)===n&&this._layerMetadata.delete(t)}getCachedServiceMetadata(t){return this._serviceMetadata.get(t)}setCachedServiceMetadata(t,n){this._serviceMetadata.put(t,n)}removeCachedServiceMetadata(t,n){this._serviceMetadata.get(t)===n&&this._serviceMetadata.delete(t)}getCachedPortalItem(t,n){return this._portalItems.get(`${n}:${t}`)}setCachedPortalItem(t,n,r){this._portalItems.put(`${n}:${t}`,r)}removeCachedPortalItem(t,n,r){const a=`${n}:${t}`;this._portalItems.get(a)===r&&this._portalItems.delete(a)}getCachedPortalItemLayer(t,n){return this._portalItemLayers.get(`${n}:${t}`)}setCachedPortalItemLayer(t,n,r){this._portalItemLayers.put(`${n}:${t}`,r)}removeCachedPortalItemLayer(t,n,r){const a=`${n}:${t}`;this._portalItemLayers.get(a)===r&&this._portalItemLayers.delete(a)}}class me{constructor(t){this.portalUri=t}normalizeModuleUri(t){const n=/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([?|/].*)?$/gi,r=/(?.+)\/home\/item\.html\?id=(?.+)$/gi,a=/(?.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?.+)$/gi,s=/(?.+)\/sharing\/rest\/content\/items\/(?.+)$/gi,o=/(?.*)@(?[0-9]+\.[0-9]+\.[0-9]+)([?|/].*)?$/gi;if(t.startsWith("portal+")){let i=t.slice(7),u="",l=i,f=!1;for(const g of[r,s,a]){const y=g.exec(i);if(y!==null){const b=y.groups;l=b.itemid,u=b.portalurl,f=!0;break}}if(f===!1){if(!n.test(i))throw new Dn(gn.UnsupportedUriProtocol,{uri:t});l=i,u=this.portalUri}l.includes("/")&&(l=l.split("/")[0]),l.includes("?")&&(l=l.split("?")[0]);let d="current";const p=o.exec(l);if(p!==null){const g=p.groups;l=g.itemid,d=g.versionstring}return i=new Wn({url:u}).restUrl+"/content/items/"+l+"/resources/"+d+".arc",{url:i,scheme:"portal",uri:"PO:"+i}}if(t.startsWith("mock")){if(t==="mock")return{url:"",scheme:"mock",data:` + export var hello = 1; + export function helloWorld() { + return "Hello World " + hello; + } + `,uri:"mock"};const i=t.replace("mock:","");if(me.mocks[i]!==void 0)return{url:"",scheme:"mock",data:me.mocks[i],uri:t}}throw new Dn(gn.UnrecognizedUri,{uri:t})}async fetchModule(t){const n=me.cachedModules.getFromCache(t.uri);if(n)return n;const r=this.fetchSource(t);me.cachedModules.addToCache(t.uri,r);let a=null;try{a=await r}catch(s){throw me.cachedModules.removeFromCache(t.uri),s}return a}async fetchSource(t){if(t.scheme==="portal"){const n=await ea(t.url,{responseType:"text",query:{}});if(n.data)return en(n.data,[])}if(t.scheme==="mock")return en(t.data??"",[]);throw new Dn(gn.UnsupportedUriProtocol)}static create(t){return new me(t)}static getDefault(){return this._default??(me._default=me._moduleResolverFactory())}static set moduleResolverClass(t){this._moduleResolverFactory=t,this._default=null}}me.mocks={},me.cachedModules=new cs(30),me._default=null,me._moduleResolverFactory=()=>{const e=Wn.getDefault();return new me(e.url)};let hs=class extends Xr{constructor(e,t){super(),this.definition=e,this.context=t}createFunction(e){return(...t)=>{const n={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(n.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,null);return Sn(this.definition,n,t,null)}}call(e,t){return Je(e,t,(n,r,a)=>{const s={spatialReference:e.spatialReference,services:e.services,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeZone:e.timeZone??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(s.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,t);return Sn(this.definition,s,a,t)})}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{const i={spatialReference:e.spatialReference,globalScope:n.globalScope,services:e.services,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r)),Kt(Sn(this.definition,i,o,t),n,r)})}},gt=class extends Kn{constructor(e){super(),this.source=e}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=M(this.executingContext,t.node),t.valueset=!0),Y(t.value)&&!(t.value instanceof ft)){const n=new ft;n.fn=t.value,n.parameterEvaluator=Je,n.context=this.executingContext,t.value=n}return t.value}setGlobal(e,t){if(Y(t))throw new h(null,c.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}loadModule(e){let t=e.spatialReference;t==null&&(t=new Pt({wkid:102100})),this.moduleScope=Bi({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,globalScope:this.moduleScope,localScope:null,libraryResolver:new on(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:e.services,console:e.console??_i,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},er(this.executingContext,this.source.syntax)}};function ds(e,t){const n=[];for(let r=0;r=a.length)throw new h(e,c.OutOfBounds,t);n=m(a[s]),a[s]=t.operator==="++"?n+1:n-1}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidParameter,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);n=m(a.global(s)),a.setGlobal(s,t.operator==="++"?n+1:n-1)}return t.prefix===!1?n:t.operator==="++"?n+1:n-1}const r=$(t.argument);if(e.localScope!=null&&e.localScope[r]!==void 0)return n=m(e.localScope[r].value),e.localScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;if(e.globalScope[r]!==void 0)return n=m(e.globalScope[r].value),e.globalScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;throw new h(e,c.InvalidIdentifier,t)}function Ge(e,t,n,r,a){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(a,c.UnsupportedOperator,r)}}function ws(e,t){if(t.left.type==="MemberExpression"){const a=M(e,t.left.object);let s;if(t.left.computed===!0)s=M(e,t.left.property);else{if(t.left.property.type!=="Identifier")throw new h(e,c.InvalidIdentifier,t);s=t.left.property.name}const o=M(e,t.right);if(_(a)){if(!W(s))throw new h(e,c.ArrayAccessorMustBeNumber,t);if(s<0&&(s=a.length+s),s<0||s>a.length)throw new h(e,c.OutOfBounds,t);if(s===a.length){if(t.operator!=="=")throw new h(e,c.OutOfBounds,t);a[s]=Ge(o,t.operator,a[s],t,e)}else a[s]=Ge(o,t.operator,a[s],t,e)}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidIdentifier,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);a.setGlobal(s,Ge(o,t.operator,a.global(s),t,e))}return I}const n=$(t.left),r=M(e,t.right);if(e.localScope!=null&&e.localScope[n]!==void 0)return e.localScope[n]={value:Ge(r,t.operator,e.localScope[n].value,t,e),valueset:!0,node:t.right},I;if(e.globalScope[n]!==void 0)return e.globalScope[n]={value:Ge(r,t.operator,e.globalScope[n].value,t,e),valueset:!0,node:t.right},I;throw new h(e,c.InvalidIdentifier,t)}function xs(e,t){const n=M(e,t.expression);return n===I?I:new an(n)}function Fs(e,t){const n=M(e,t.test);if(n===!0)return ke(e,t.consequent);if(n===!1)return t.alternate!==null?ke(e,t.alternate):I;throw new h(e,c.BooleanConditionRequired,t)}function er(e,t){let n=I;for(let r=0;r=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(S(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(P(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new h(e,c.OutOfBounds,t);return n.get(r)}throw new h(e,c.InvalidMemberAccessKey,t)}throw new h(e,c.InvalidMemberAccessKey,t)}catch(n){throw n}}function Is(e,t){try{const n=M(e,t.argument);if(X(n)){if(t.operator==="!")return!n;if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);if(t.operator==="~")return~m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}if(t.operator==="~")return~m(n);if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}catch(n){throw n}}function ks(e,t){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return qr(m(n),m(r),t.operator);case"==":return Pe(n,r);case"!=":return!Pe(n,r);case"<":case">":case"<=":case">=":return Wr(n,r,t.operator);case"+":return S(n)||S(r)?E(n)+E(r):m(n)+m(r);case"-":return m(n)-m(r);case"*":return m(n)*m(r);case"/":return m(n)/m(r);case"%":return m(n)%m(r);default:throw new h(e,c.UnsupportedOperator,t)}}catch(n){throw n}}function _s(e,t){try{const n=M(e,t.left);if(X(n))switch(t.operator){case"||":{if(n===!0)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}case"&&":{if(n===!1)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}default:throw new h(e,c.LogicExpressionOrAnd,t)}throw new h(e,c.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function Ts(e,t,n){if(Y(e))throw new h(t,c.NoFunctionInTemplateLiteral,n);return e}function Ms(e,t){let n="",r=0;for(const a of t.quasis)n+=a.value?a.value.cooked:"",a.tail===!1&&(n+=t.expressions[r]?E(Ts(M(e,t.expressions[r]),e,t)):"",r++);return n}function Si(e,t){try{const n=$(t);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}throw new h(e,c.InvalidIdentifier,t)}catch(n){throw n}}function Ns(e,t){try{if(t.callee.type==="MemberExpression"){const r=M(e,t.callee.object);if(!(r instanceof gt))throw new h(e,c.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:M(e,t.callee.property);if(!r.hasGlobal(a))throw new h(e,c.FunctionNotFound,t);const s=r.global(a);if(!Y(s))throw new h(e,c.CallNonFunction,t);return s.call(e,t)}if(t.callee.type!=="Identifier")throw new h(e,c.FunctionNotFound,t);const n=$(t.callee);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}throw new h(e,c.FunctionNotFound,t)}catch(n){throw n}}const ue={};function Ii(e,t,n,r){try{const a=t.arguments,s=M(e,a[n]);if(Pe(s,r))return M(e,a[n+1]);{const o=a.length-n;return o===1?M(e,a[n]):o===2?null:o===3?M(e,a[n+2]):Ii(e,t,n+2,r)}}catch(a){throw a}}function ki(e,t,n,r){try{const a=t.arguments;if(r===!0)return M(e,a[n+1]);if(a.length-n===3)return M(e,a[n+2]);{const s=M(e,a[n+2]);if(X(s)===!1)throw new h(e,c.BooleanConditionRequired,a[n+2]);return ki(e,t,n+2,s)}}catch(a){throw a}}function Sn(e,t,n,r){try{const a=e.body;if(n.length!==e.params.length)throw new h(t,c.WrongNumberOfParameters,r);if(t.localScope!=null)for(let o=0;oimport("./geometryEngine-CdPoFSE4-Bq1o6CJZ.js"),__vite__mapDeps([21,2,3,22,23,24]),import.meta.url);return Ni=!0,Ha(e),!0}let kn=null;function ir(){return kn!==null||(kn=Oi()),kn}async function Oi(){await Ko(),Be=await je(()=>import("./arcadeAsyncRuntime-B-LnqhTo-C_ijf5yV.js"),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10,11,12,0,13,14,15,16,17,18,19,20]),import.meta.url);for(const e of Jn)Be.extend(e),rt(e,"async");return Jn=null,!0}function Ui(){return Mi}function zi(){return!!Be}function Gi(){return Ni}let Bn=null;function ar(){return Bn||(Bn=Zi(),Bn)}async function Zi(){await ir();const[e,t,n,r,a,s]=await Promise.all([je(()=>import("./featureSetUtils-wd4FcF3A-DuQxSVav.js"),__vite__mapDeps([26,2,3,1,4,5,6,7,8,9,10,11,12,27,28,14,15,19,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,20,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,16,17,18]),import.meta.url).then(o=>o.g),je(()=>import("./featuresetbase-BDDCCC0O-DBTFwiRt.js"),__vite__mapDeps([103,4,2,3,5,1,6,7,8,9,10,11,12,26,27,28,14,15,19,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,20,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,16,17,18,13]),import.meta.url),je(()=>import("./featuresetgeom-BftbGgg3-DP9IJFWb.js"),__vite__mapDeps([104,1,2,3,4,5,6,7,8,9,10,11,12,27,28,14,15,19,16,17,18,20]),import.meta.url),je(()=>import("./featuresetstats-CY6YJ8Jt-CCnPraQt.js"),__vite__mapDeps([105,4,2,3,5,1,6,7,8,9,10,11,12,28,16,17,18,19,20]),import.meta.url),je(()=>import("./featuresetstring-DFELZWNA-CIVmslvs.js"),__vite__mapDeps([106,1,2,3,4,5,6,7,8,9,10,11,12,16,17,18,19,20]),import.meta.url),je(()=>import("./knowledgegraph-Dt7zfNlJ-BkLDKrPN.js"),__vite__mapDeps([107,2,3,1,4,5,6,7,8,9,10,11,12,13,66,67,89,108,109,110,111,16,17,18,19,20]),import.meta.url)]);return qi=e,Be.extend([t,n,r,a,s]),rt([t,n,r,a,s],"async"),Mi=!0,!0}function ji(e,t=[]){return e.usesFeatureSet===void 0&&Ut(e,t),e.usesFeatureSet===!0}function Gs(e,t=[]){return e.isAsync===void 0&&Ut(e,t),e.isAsync===!0}function Zs(e,t){if(t){for(const n of t)if(cn(e,n))return!0;return!1}return!1}async function Vi(e,t,n=[],r=!1,a=null){return or(new Set,e,t,n,r,a)}async function or(e,t,n,r=[],a=!1,s=null){const o=typeof t=="string"?tr(t):t,i=[];return o&&(Gi()===!1&&(hn(o)||a)&&i.push(rr()),zi()===!1&&(o.isAsync===!0||n)&&i.push(ir()),Ui()===!1&&(ji(o)||Zs(o,r))&&i.push(ar())),i.length&&await Promise.all(i),await Ji(e,o,s,n,a),!0}function js(e,t=[]){return e.usesModules===void 0&&Ut(e,t),e.usesModules===!0}async function Ji(e,t,n=null,r=!1,a=!1){const s=$r(t);n===null&&s.length>0&&(n=me.getDefault()),t.loadedModules={};for(const o of s){jr(n);const i=n.normalizeModuleUri(o.source);if(e.has(i.uri))throw new h(null,c.CircularModules,null);e.add(i.uri);const u=await n.fetchModule(i);await or(e,u,r,[],a,n),e.delete(i.uri),u.isAsync&&(t.isAsync=!0),u.usesFeatureSet&&(t.usesFeatureSet=!0),u.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[o.libname]={uri:i.uri,script:u}}}function Wi(e){if(hn(e))return!0;const t=Nn(e);let n=!1;for(let r=0;r{Ur.test(o)&&(o=o.replace(Ur,""),a.push(o))});const s=a.filter(o=>o.includes("*"));return a=a.filter(o=>!s.includes(o)),t&&s.forEach(o=>{const i=new RegExp(`^${o.split(/\*+/).map(Ws).join(".*")}$`,"i");t.forEach(u=>i.test(u)?a.push(u):null)}),[...new Set(a.sort())]}function nu(e){return cn(e,"$view")}function ru(e,t){return!!e&&cn(e,t)}function iu(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new v({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function au({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=dn();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function ou({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:s}){if(e===null)return null;const o=dn();return o?o.constructFeatureSet(e,t,n,r??!0,a,s):null}function su(e){if(e?.map===null)return null;const t=dn();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function uu(e,t){return v.convertJsonToArcade(e,t)}function lu(e,t,n=[]){return Vi(e,t,n)}function cu(){return rr()}function hu(){return ar()}function du(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function fu(e){return e.declaredClass==="esri.layers.support.LabelClass"}function mu(e){return e.declaredClass==="esri.PopupTemplate"}function Hi(e,t){if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(du(n)){if(n.type==="dot-density"){const s=n.attributes?.some(o=>t(o.valueExpression));if(s)return s}const r=n.visualVariables,a=!!r&&r.some(s=>{let o=t(s.valueExpression);return s.type==="size"&&(zr(s.minSize)&&(o=o||t(s.minSize.valueExpression)),zr(s.maxSize)&&(o=o||t(s.maxSize.valueExpression))),o});return!(!("valueExpression"in n)||!t(n.valueExpression))||a}if(fu(n)){const r=n.labelExpressionInfo?.expression;return!(!r||!t(r))||!1}return!!mu(n)&&(!!n.expressionInfos&&n.expressionInfos.some(r=>t(r.expression))||Array.isArray(n.content)&&n.content.some(r=>r.type==="expression"&&t(r.expressionInfo?.expression)))}function pu(e){const t=zt(e);return!!t&&Wi(t)}function Du(e){return Hi(e,pu)}function gu(e){const t=zt(e);return!!t&&hn(t)}function yu(e){return Hi(e,gu)}function zr(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const Ru=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:v,arcade:Vs,arcadeFeature:H,convertFeatureLayerToFeatureSet:ou,convertJsonToArcade:uu,convertMapToFeatureSetCollection:su,convertServiceUrlToWorkspace:au,createExecContext:Ks,createFeature:Xs,createFunction:Hs,createSyntaxTree:zt,dependsOnView:nu,enableFeatureSetOperations:hu,enableGeometryOperations:cu,evalSyntaxTree:Ys,executeAsyncFunction:eu,executeFunction:$s,extractFieldNames:tu,getArcadeType:qs,getViewInfo:iu,hasGeometryFunctions:Du,hasGeometryOperations:yu,hasVariable:ru,loadScriptDependencies:lu,updateExecContext:Qs},Symbol.toStringTag,{value:"Module"}));export{ei as C,H as D,ai as L,ci as M,v as N,Di as X,ja as Z,on as a,mt as b,Ia as c,Za as d,$ as e,di as f,wt as g,Qa as h,Ru as i,yn as l,Xn as m,Rn as p,De as r,Mn as s,Pn as t,qa as x,Sa as y}; diff --git a/main/assets/arcadeUtils-DpP0k7IY-DIwxqttO.js b/main/assets/arcadeUtils-DpP0k7IY-DIwxqttO.js deleted file mode 100644 index 7ab61e5a2..000000000 --- a/main/assets/arcadeUtils-DpP0k7IY-DIwxqttO.js +++ /dev/null @@ -1,182 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geomasync-uGYsifQH-gccYe-Fi.js","./languageUtils-BYxF9hRA-Dig_Awzu.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./TimeOnly-DSMefxKy-DBJeVQCe.js","./UnknownTimeZone-C--TOcPG-hkNbcn35.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./shared-D1w-26bA-Cy2KeMh-.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./number-eRKYXfX9-B-l8dJUS.js","./Query-BrwMGK8U-sojFdYaD.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./portalUtils-CKN9iXwH-AaE_9x6i.js","./geometryEngineAsync-D7oEu5dd-DTqB2IHB.js","./workers-PiCjreoO-oGzLvkSt.js","./featureConversionUtils-D6hFQ4Af-CkdezteH.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./FieldsIndex-HmzMbJQG-CiA2Ur00.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./geometryEngine-CdPoFSE4-BRF8cFYX.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-CV-sFImk.js","./arcadeAsyncRuntime-B-LnqhTo-MEE-Bvjt.js","./featureSetUtils-wd4FcF3A-Dl4vKkUg.js","./SpatialFilter-BlQBFhwz-DQzQDaNp.js","./WhereClause-DxwoyBMS-BIlXG7Pl.js","./MD5-CHHr-oed-SuyrCYQ0.js","./FeatureLayer-BrRKw5Si-CHreUEJ9.js","./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js","./RendererLegendOptions-K3md58-X-B6y5tQg5.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./colorRamps-q0bZVhs2-Bqen3nIx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./styleUtils-BtpNqZyT-B-RFL3S3.js","./jsonUtils-C64Zfu7c-trwRB9M4.js","./LRUCache-C3erQTWv-CeYLuvL9.js","./Version-CoKzbupV-BxOJQpf3.js","./OverrideHelper-DWRbVlj1-C2SNS5Gu.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-DpAlEmQT.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-72T4gbed.js","./heatmapUtils-seiMkkkR-D9lAE87R.js","./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js","./commonProperties-BtIqvFU_-Brj0aAM1.js","./ElevationInfo-yv2-9tj6-pjIBBQET.js","./FeatureLayerBase-vvYyZTfh-K4Z036-G.js","./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./featureLayerUtils-DgfQQyK4-D6z7j0IK.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js","./Relationship-PyhUibYK-Bz6HFiBe.js","./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js","./Layer-ChoECxvZ-C4wLrCej.js","./editsZScale-BDsX6vv--CeDyYvz6.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./APIKeyMixin-BUMSx9ny-xmyEzAt4.js","./ArcGISService-BYA-y6X6-DLcDzG-r.js","./BlendLayer-D1WkSmwP-UVXywJXM.js","./jsonUtils-wIllKWI4-DQ36DuUP.js","./parser-DyDJ-rlI-mkgQEqcN.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./CustomParametersMixin-vdKsTHer-CoiI71pj.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js","./FeatureEffect-CDEk9Es7-DK_N6ZYk.js","./FeatureFilter-BCFHgLVU-BSMrX0wh.js","./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js","./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js","./labelingInfo-DGVNul26-CXiwzGiu.js","./labelUtils-BW14kBqX-8wHrIU-s.js","./OperationalLayer-B5IXiMa2-KEXCVZUA.js","./OrderedLayer-6Qsmrd_l-CGz1PXc3.js","./OrderByInfo-GD2XnU8e-C-uyyo-i.js","./PortalLayer-CElnYuSQ-tfjbIq8z.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js","./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js","./TemporalLayer-CpOrN_w9-kgJDrMMF.js","./TimeInfo-w_HB2CsF-wq_g9Zh1.js","./FeatureTemplate-SPHPD45f-tAS5Ccaa.js","./FeatureType-C9hJmS6_-pVJc0p7X.js","./fieldProperties-Bq26w7gt-DT6oRGMS.js","./versionUtils-LZYZz-38-xZnsxhiL.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js","./popupUtils-B0uZcXX0-BqljON9c.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./featuresetbase-BDDCCC0O-F4vb-x5f.js","./featuresetgeom-BftbGgg3-BYUUChZd.js","./featuresetstats-CY6YJ8Jt-DuADBO37.js","./featuresetstring-DFELZWNA-DcES9f5x.js","./knowledgegraph-Dt7zfNlJ-CPwlmP6C.js","./project-DQKhruav-CYVbgcFi.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./Relationship-Db9GUmYx-DPu3VSRE.js"])))=>i.map(i=>d[i]); -import{d as k,j as Ki,g as se,w as V,F as Gt,h as Xi,D as Qi,l as le,m as ae,G as We,n as Ne,p as yt,q as fn,r as Wn,t as $e,B as Gr,R as sr,Q as Yi,J as Pt,K as Zr,_ as je,O as jr,P as $i,f as ea}from"./main-BZaw9FpY.js";import{T as h,n as c,U as Y,b as X,S as W,y as S,u as qe,v as _n,m as ta,E as _t,k as Vr,G as ur,C as _,Z as P,t as K,a as qn,R as nn,r as rn,h as Q,c as q,d as ce,w as D,e as B,f as m,M as E,P as oe,g as N,i as na,_ as lr,z as te,j as it,J as L,l as I,o as Pe,p as Ye,q as Tn,L as Tt,s as at,I as Jr,x as ra,$ as mn,W as ia,Q as aa,X as oa,A as sa,B as nt,D as Hn,F as ua,H as Kn,O as He,Y as cr,K as pn,N as la,V as Wr,a0 as qr,a1 as he,a2 as Dn,a3 as gn,a4 as ft,a5 as Fe,a6 as Le,a7 as Ot,a8 as Hr,a9 as an,aa as Kr,ab as Zt,ac as Xr,ad as Kt}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{r as G,m as ye,O as we,u as jt,I as Se,A as Vt,z as re}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{n as et}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ca}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import{o as ha}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{M as da}from"./number-eRKYXfX9-B-l8dJUS.js";import{M as hr}from"./shared-D1w-26bA-Cy2KeMh-.js";import{r as Ft}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";function $(e){return e.name.toLowerCase()}let on=class{constructor(e,t){this._moduleSingletons=e,this._syntaxModules=t}loadLibrary(e){if(this._syntaxModules==null)return null;const t=this._syntaxModules[e];return t?{syntax:t.script,uri:t.uri}:null}};function fa(e){Qr=e}let Qr;function Mt(e){return e===null?null:ce(e)?e.clone():_t(e)?e:nn(e)?e.clone():P(e)?e.toArray().map(t=>Mt(t)):_(e)?e.map(t=>Mt(t)):K(e)?Qr.createFromArcadeFeature(e):Hn(e)||rn(e)?e:qn(e)||e?.declaredClass==="esri.arcade.Attachment"?e.deepClone():(e?.declaredClass==="esri.arcade.Portal"||ua(e)||e instanceof Kn||Y(e),e)}function Xt(e,t,n=!1,r=!1){if(e==null)return null;if(W(e))return m(e);if(X(e))return Tt(e);if(S(e))return E(e);if(ce(e))return oe(e,t);if(q(e)||Q(e))return e;if(_(e)){const s=[];for(const o of e)s.push(Xt(o,t,n,r));return s}if(r&&nn(e))return e;const a=new v;a.immutable=!1;for(const s of Object.keys(e)){const o=e[s];o!==void 0&&a.setField(s,Xt(o,t,n,r))}return a.immutable=n,a}let v=class Wt{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof Wt?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new h(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new h(null,c.Immutable,null);if(Y(n))throw new h(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=G.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const s=new Wt;s.immutable=!1;for(const o in t){const i=t[o];i!==void 0&&s.setField(o.toString(),Xt(i,n,r,a))}return s.immutable=r,s}static convertJsonToArcade(t,n,r=!1,a=!1){return Xt(t,n,r,a)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t?.keyTranslate&&(r=t.keyTranslate(r)),n[r]=_n(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,s){const o=await ta(r,a,s);return t[n]=o,o}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let s in this.attributes){const o=this.attributes[s];n?.keyTranslate&&(s=n.keyTranslate(s)),o!==void 0&&(_t(o)||o instanceof k||o instanceof G?r[s]=_n(o,n):a.push(this.castDictionaryValueAsJsonAsync(r,s,o,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new Wt;t.immutable=!1;for(const n of this.keys())t.setField(n,Mt(this.field(n)));return t}},Oe=0;function mt(e,t,n,r,a=1){let s;switch(t=t.toLowerCase()){case"hasz":{const o=e.hasZ;return o!==void 0&&o}case"hasm":{const o=e.hasM;return o!==void 0&&o}case"spatialreference":{let o=e.spatialReference._arcadeCacheId;if(o===void 0){let u=!0;Ki.isFrozen(e.spatialReference)&&(u=!1),u&&(Oe++,e.spatialReference._arcadeCacheId=Oe,o=Oe)}const i=new v({wkt:e.spatialReference.wkt,wkid:e.spatialReference.wkid});return o!==void 0&&(i._arcadeCacheId="SPREF"+o.toString()),i}}switch(e.type){case"extent":switch(t){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const o=e[t];return o!==void 0?o:null}case"type":return"Extent"}break;case"polygon":switch(t){case"rings":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.rings,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polygon"}break;case"point":switch(t){case"x":case"y":case"z":case"m":return e[t]??null;case"type":return"Point"}break;case"polyline":switch(t){case"paths":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.paths,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polyline"}break;case"multipoint":switch(t){case"points":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new Vr(e.points,e.spatialReference,e.hasZ===!0,e.hasM===!0,s,1);case"type":return"Multipoint"}}if(a===1)throw new h(n,c.InvalidIdentifier,r);return a===2?{keystate:"notfound"}:null}function Xn(e,t){let n,r=e;if(r==null)return null;if(_(t))n=t;else if(P(t))n=t.toArray();else{if(t==null)return null;n=[t]}for(const a of n){if(K(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(qn(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(nn(r)){if(S(a)===!1)return null;r=mt(r,a,null,null,0)}else if(_(r)){if(W(a)===!1)return null;r=a>=0?r[a]:r[r.length+a]}else{if(!P(r)||W(a)===!1)return null;r=a>=0?r.get(a):r.get(r.length()+a)}if(r==null)return null}return r}let H=class Ce{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new Ce;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof Ce){const r=new Ce;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return Ce.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new Ce;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t,n){const r=new Ce;return r.attributes=t.field("attributes"),r.attributes!==null&&r.attributes instanceof v?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=t.field("geometry"),r._geometry!==null&&(r._geometry instanceof v?r._geometry=Ce.parseGeometryFromDictionary(r._geometry,n):r._geometry instanceof k||(r._geometry=null)),r}static createFromGraphicLikeObject(t,n,r=null,a){const s=new Ce;return s.contextTimeZone=a??null,n===null&&(n={}),s.attributes=n,s._geometry=t??null,s._layer=r,s._layer&&(s._fieldTypesFixed=!1,s.fieldsIndex=this.hydrateFieldsIndex(s._layer)),s}static hydrateFieldsIndex(t){return t===null?null:rn(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:ha.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof ye||a instanceof we?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":qe(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let r=0;r0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){return this.fieldsIndex?.getTimeZone(t)==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function $r(e){const t=[];return j(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:$(n.specifiers[0].local),source:n.source.value}),!0)),t}function Da(e,t){let n=!1;const r=t.toLowerCase();return j(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function ga(e){const t=[];return j(e,n=>n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)),t}function ya(e){const t=[];return j(e,n=>{if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let r="";for(let a=0;a<(n.arguments||[]).length;a++)a===0?n.arguments[a].type==="Identifier"&&(r=n.arguments[a].name.toLowerCase()):r&&n.arguments[a].type==="Literal"&&fr(n.arguments[a].value)&&t.push(r+"."+n.arguments[a].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let r="";return n.arguments[0].type==="Identifier"&&(r=n.arguments[0].name.toLowerCase()),r&&n.arguments[1].type==="Literal"&&fr(n.arguments[1].value)&&t.push(r+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)}),t}function Nn(e){const t=[];return j(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Ut(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Nn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Yr(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,$r(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Nn(e));for(let r=0;r0||u.length>0;)if(i.length>0&&u.length>0){let d=l(i[0],u[0]);isNaN(d)&&(d=0),d<=0?(f.push(i[0]),i=i.slice(1)):(f.push(u[0]),u=u.slice(1))}else i.length>0?(f.push(i[0]),i=i.slice(1)):u.length>0&&(f.push(u[0]),u=u.slice(1));return f}async function a(i,u){const l=i.length,f=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const d=[await a(i.slice(0,f),u),await a(i.slice(f,l),u)];return s(d[0],d[1],u,[])}async function s(i,u,l,f){const d=f;if(i.length>0||u.length>0){if(i.length>0&&u.length>0){let p=await l(i[0],u[0]);return isNaN(p)&&(p=1),p<=0?(d.push(i[0]),i=i.slice(1)):(d.push(u[0]),u=u.slice(1)),s(i,u,l,f)}return i.length>0?(d.push(i[0]),s(i=i.slice(1),u,l,f)):(d.push(u[0]),s(i,u=u.slice(1),l,f))}return f}function o(i,u,l,f){D(l,1,2,i,u);let d=l[0];if(P(d)&&(d=d.toArray()),_(d)===!1)throw new h(i,c.InvalidParameter,u);if(l.length>1){if(Y(l[1])===!1)throw new h(i,c.InvalidParameter,u);let x=d;const O=l[1].createFunction(i);return f?a(x,O):(x=n(x,(ne,de)=>O(ne,de)),x)}let p=d;if(p.length===0)return[];const g={};for(let x=0;x1||b==="String"?n(p,(x,O)=>{if(x==null||x===I)return O==null||O===I?0:1;if(O==null||O===I)return-1;const ne=E(x),de=E(O);return nex-O):b==="Boolean"?n(p,(x,O)=>x===O?0:O?-1:1):b==="Date"?n(p,(x,O)=>O-x):p.slice(),p}e.functions.array=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,0,2,i,u),d.length===0)return[];if(d.length===1&&d[0]===null)return[];if(_(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].slice()}if(P(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].toArray().slice()}const p=m(d[0]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=N(d[1],null),y=new Array(p);return y.fill(g),y})},e.functions.front=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(0)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][0]}throw new h(i,c.InvalidParameter,u)})},e.functions.back=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(d[0].length()-1)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][d[0].length-1]}throw new h(i,c.InvalidParameter,u)})},e.functions.push=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,2,i,u),_(d[0]))return d[0][d[0].length]=d[1],d[0].length;throw new h(i,c.InvalidParameter,u)})},e.functions.pop=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);const p=d[0][d[0].length-1];return d[0].length=d[0].length-1,p}throw new h(i,c.InvalidParameter,u)})},e.functions.erase=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,2,i,u),_(d[0])){let p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[0];if(g.length<=0)throw new h(i,c.OutOfBounds,u);if(p<0&&(p=g.length+p),p<0)throw new h(i,c.OutOfBounds,u);if(p>=g.length)throw new h(i,c.OutOfBounds,u);return g.splice(p,1),I}throw new h(i,c.InvalidParameter,u)})},e.functions.insert=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,3,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[2],y=d[0];if(p>y.length)throw new h(i,c.OutOfBounds,u);if(p<0&&p<-1*y.length)throw new h(i,c.OutOfBounds,u);return p===y.length?(y[p]=g,I):(y.splice(p,0,g),I)}throw new h(i,c.InvalidParameter,u)})},e.functions.resize=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(p<0)throw new h(i,c.InvalidParameter,u);const g=N(d[2],null),y=d[0];if(y.length>=p)return y.length=p,I;const b=y.length;y.length=p;for(let x=b;x{if(D(d,2,2,i,u),_(d[0])){const p=d[1];return!!d[0].some(g=>Pe(g,p))}if(P(d[0])){const p=d[1];return!!d[0].toArray().some(g=>Pe(g,p))}throw new h(i,c.InvalidParameter,u)})},e.functions.slice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,3,i,u),_(d[0])){const p=m(N(d[1],0)),g=m(N(d[2],d[0].length));if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);return d[0].slice(p,g)}if(P(d[0])){const p=d[0],g=m(N(d[1],0)),y=m(N(d[2],p.length()));if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(y)||He(y)===!1)throw new h(i,c.InvalidParameter,u);return p.toArray().slice(g,y)}throw new h(i,c.InvalidParameter,u)})},e.functions.splice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{const p=[];for(let g=0;g{if(D(d,2,2,i,u),_(d[0]))return m(d[1])>=d[0].length?d[0].slice():d[0].slice(0,m(d[1]));if(P(d[0]))return m(d[1])>=d[0].length()?d[0].slice():d[0].slice(0,m(d[1]));throw new h(i,c.InvalidParameter,u)})},e.functions.first=function(i,u){return e.standardFunction(i,u,(l,f,d)=>(D(d,1,1,i,u),_(d[0])?d[0].length===0?null:d[0][0]:P(d[0])?d[0].length()===0?null:d[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,u){return e.standardFunction(i,u,(l,f,d)=>o(i,f,d,!1))},e.functions.any=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=p(y);if(X(b)&&b===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)!==!0)return!1;return!0})},e.functions.none=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)===!0)return!1;return!0})},e.functions.reduce=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);return d.length===2?g.length===0?null:g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null}):g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null},d[2])})},e.functions.map=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=p(b);x!==void 0&&x!==I?y.push(x):y.push(null)}return y})},e.functions.filter=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g)p(b)===!0&&y.push(b);return y})}),e.mode==="async"&&(e.functions.sort=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>o(i,f,d,!0))},e.functions.any=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,X(x)&&x===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x!==!0)return!1}return!0})},e.functions.none=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x===!0)return!1}return!0})},e.functions.filter=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O===!0&&y.push(b)}return y})},e.functions.reduce=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);let y;if(d.length>2){const b=N(d[2],null);y=g.reduce(async(x,O)=>{let ne=await x;return ne!==void 0&&ne!==I||(ne=null),p(ne,O)},Promise.resolve(b))}else{if(g.length===0)return null;y=g.reduce(async(b,x,O)=>{if(O<=1)return p(b,x);let ne=await b;return ne!==void 0&&ne!==I||(ne=null),p(ne,x)})}return y.then(b=>b!==void 0&&b!==I?b:null)})},e.functions.map=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O!==void 0&&O!==I?y.push(O):y.push(null)}return y})})}const Rn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:wa},Symbol.toStringTag,{value:"Module"}));function xa(e,t,n){return e+(Fa(n)?Ca:Aa)[t]}function Fa(e){return e%4==0&&(e%100!=0||e%400==0)}const Aa=[0,31,59,90,120,151,181,212,243,273,304,334],Ca=[0,31,60,91,121,152,182,213,244,274,305,335];function Te(e){return e===null?e:e.isValid===!1?null:e}function At(e,t){return e===""||e.toLowerCase().trim()==="default"?B(t):e==="z"||e==="Z"?"UTC":e}function ze(e,t){return q(e)?e.toArcadeDate():oe(e,B(t))}function ei(e,t){e.today=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),G.dateJSAndZoneToArcadeDate(i,B(n))})},e.time=function(n,r){return t(n,r,(a,s,o)=>{switch(D(o,0,4,n,r),o.length){case 0:{const i=G.nowToArcadeDate(B(n));return new ye(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(Q(o[0]))return o[0].clone();if(ce(o[0]))return new ye(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(q(o[0]))return new ye(0,0,0,0);if(S(o[0]))return ye.fromString(o[0]);const i=m(o[0]);return isNaN(i)===!1?ye.fromMilliseconds(i):null}case 2:return S(o[0])&&S(o[1])?ye.fromString(o[0],o[1]):ye.fromParts(m(o[0]),m(o[1]),0,0);case 3:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),0);case 4:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),m(o[3]))}throw new h(n,c.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,3,n,r),o.length===3)return we.fromParts(m(o[0]),m(o[1])+1,m(o[2]));if(o.length===2){const i=E(o[1]);return i===""?null:i==="X"?we.fromSeconds(m(o[0])):i==="x"?we.fromMilliseconds(m(o[0])):we.fromString(E(o[0]),i)}if(o.length===1){if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return we.fromString(o[0]+"-01-01")}if(q(o[0]))return o[0].clone();if(ce(o[0]))return we.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const i=m(o[0]);return isNaN(i)===!1?we.fromMilliseconds(i):S(o[0])?we.fromString(o[0]):null}if(o.length===0){const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:we.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),o[0]===null)return null;if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneDateOnly,r);if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneTime,r);const i=oe(o[0],B(n));if(i===null)throw new h(n,c.InvalidParameter,r);const u=jt(At(E(o[1]),n),!1);if(u===null)return null;const l=G.arcadeDateAndZoneToArcadeDate(i,u);return l.isValid===!1?null:l})},e.timezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,2,n,r),Q(o[0])||q(o[0]))return"Unknown";const i=oe(o[0],B(n));if(i===null)return null;const u=i.timeZone;return u==="system"?G.systemTimeZoneCanonicalName:u.toLowerCase()==="utc"?"UTC":u.toLowerCase()==="unknown"?"Unknown":u})},e.timezoneoffset=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].hour;const i=oe(o[0],B(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].second;const i=oe(o[0],B(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].millisecond;const i=oe(o[0],B(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].minute;const i=oe(o[0],B(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=ze(o[0],B(n));if(i===null)return NaN;const u=m(N(o[1],0));if(u<0||u>6)throw new h(n,c.InvalidParameter,r);const l=i.day,f=i.monthJS,d=i.year,p=i.dayOfWeekJS,g=xa(l,f,d)-1,y=Math.floor(g/7);return p-u+(p-u<0?7:0){D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,8,n,r),o.length===3){if(q(o[0])&&Q(o[1])&&S(o[2])){const i=jt(At(E(o[2])??"unknown",n),!1);return i===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,i))}return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),0,0,0,0,B(n)))}if(o.length===4)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),0,0,0,B(n)));if(o.length===5)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),0,0,B(n)));if(o.length===6)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),0,B(n)));if(o.length===7)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),B(n)));if(o.length===8){const i=jt(At(E(o[7])??"unknown",n),!1);return i===null?null:Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),i))}if(o.length===2){if(q(o[0])&&S(o[1])){const l=jt(At(E(o[1])??"unknown",n),!1);return l===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,l))}if(q(o[0])&&Q(o[1]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let i,u=E(o[1]);return u===""?null:(u=na(u,!0),i=u==="X"?Gt.fromSeconds(m(o[0])):u==="x"?Gt.fromMillis(m(o[0])):Gt.fromFormat(E(o[0]),u,{locale:Xi(),numberingSystem:"latn"}),i.isValid?G.dateTimeToArcadeDate(i):null)}if(o.length===1){if(q(o[0]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return oe(o[0]+"-01-01",B(n))}const i=m(o[0]);if(isNaN(i)===!1){const u=Gt.fromMillis(i);return u.isValid?G.dateTimeAndZoneToArcadeDate(u,B(n)):null}return oe(o[0],B(n))}return o.length===0?G.nowToArcadeDate(B(n)):null})},e.datediff=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),Q(o[0]))return Q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(Q(o[1]))return NaN;if(q(o[0]))return q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(q(o[1]))return NaN;let i=oe(o[0],B(n)),u=oe(o[1],B(n));if(i===null||u===null)return NaN;let l=N(o[3],"");switch(l!==""&&l!==null?(l=At(E(l),n),i=G.arcadeDateAndZoneToArcadeDate(i,l),u=G.arcadeDateAndZoneToArcadeDate(u,l)):i.timeZone!==u.timeZone&&(i.isUnknownTimeZone?i=G.arcadeDateAndZoneToArcadeDate(i,u.timeZone):u=(u.isUnknownTimeZone,G.arcadeDateAndZoneToArcadeDate(u,i.timeZone))),E(o[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(u,"days");case"months":case"month":return i.diff(u,"months");case"minutes":case"minute":case"m":return o[2]==="M"?i.diff(u,"months"):i.diff(u,"minutes");case"seconds":case"second":case"s":return i.diff(u,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(u);case"hours":case"hour":case"h":return i.diff(u,"hours");case"years":case"year":case"y":return i.diff(u,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i)||i===1/0||i===-1/0)return Q(o[0])||q(o[0])?o[0].clone():oe(o[0],B(n));let u="milliseconds";switch(E(o[2]).toLowerCase()){case"days":case"day":case"d":u="days",i=q(o[0])?i:lr(i);break;case"months":case"month":u="months",i=q(o[0])?i:lr(i);break;case"minutes":case"minute":case"m":u=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":u="seconds";break;case"milliseconds":case"millisecond":case"ms":u="milliseconds";break;case"hours":case"hour":case"h":u="hours";break;case"years":case"year":case"y":u="years"}if(Q(o[0])||q(o[0]))return o[0].plus(u,i);const l=oe(o[0],B(n));return l===null?null:l.plus({[u]:i})})}}function De(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}function ti(e,t,n){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0)}const Et=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function Ea(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function ba(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new V(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new V(t)):null}function Ia(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let o=0;o=r;)e-=t;return e}function ri(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function _a(e,t){return ln(ri(e,t),2*Math.PI)*(180/Math.PI)}function Ta(e,t){return ln(Math.PI/2-ri(e,t),2*Math.PI)*(180/Math.PI)}function ii(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Ba(r,a),ka(r,a))}function Ma(e,t,n){return Gr(ln(ii(e,t,n),2*Math.PI))}function Na(e,t,n){return Gr(ln(-1*ii(e,t,n),2*Math.PI))}It[9002]=.3048,It[9003]=.3048006096012192,It[9095]=.3048007491;const ie=[0,0];function pr(e){for(let t=0;t1&&(r=1)),r<=.5?[t[0]+(n[0]-t[0])*r,t[1]+(n[1]-t[1])*r]:[n[0]-(n[0]-t[0])*(1-r),n[1]-(n[1]-t[1])*(1-r)]}function ai(e,t){e.ringisclockwise=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=[];if(o[0]===null)return!1;if(_(o[0]))for(const u of o[0]){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}else if(o[0]instanceof Vr)i=o[0]._elements;else{if(!P(o[0]))throw new h(n,c.InvalidParameter,r);for(const u of o[0].toArray()){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}}return!(i.length<3)&&Qi(i)})},e.polygon=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof le))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof le)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new le(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.polyline=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof ae))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof ae)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new ae(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.point=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof V)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new V(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.multipoint=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof We))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof We)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new We(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.extent=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=null;if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else if(o[0]instanceof V){const u={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},l=o[0];l.hasZ?(u.zmin=l.z,u.zmax=l.z):l.hasM&&(u.mmin=l.m,u.mmax=l.m),i=se(u)}else if(o[0]instanceof le)i=se(o[0].extent?.toJSON());else if(o[0]instanceof ae)i=se(o[0].extent?.toJSON());else if(o[0]instanceof We)i=se(o[0].extent?.toJSON());else if(o[0]instanceof Ne)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new Ne(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.geometry=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=null;if(o[0]===null)return null;if(K(o[0]))i=te(o[0].geometry(),n.spatialReference);else if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(se(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.setgeometry=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),!K(o[0]))throw new h(n,c.InvalidParameter,r);if(o[0].immutable===!0)throw new h(n,c.Immutable,r);if(!(o[1]instanceof k||o[1]===null))throw new h(n,c.InvalidParameter,r);return o[0]._geometry=o[1],I})},e.feature=function(n,r){return t(n,r,(a,s,o)=>{if(o.length===0)throw new h(n,c.WrongNumberOfParameters,r);let i;if(o.length===1)if(S(o[0]))i=H.fromJson(JSON.parse(o[0]),n.timeZone);else if(K(o[0]))i=H.createFromArcadeFeature(o[0]);else if(o[0]instanceof k)i=H.createFromGraphicLikeObject(o[0],null,null,n.timeZone);else{if(!(o[0]instanceof v))throw new h(n,c.InvalidParameter,r);{let u=o[0].hasField("geometry")?o[0].field("geometry"):null,l=o[0].hasField("attributes")?o[0].field("attributes"):null;u!==null&&u instanceof v&&(u=H.parseGeometryFromDictionary(u,n.spatialReference)),l!==null&&(l=H.parseAttributesFromDictionary(l)),i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}}else if(o.length===2){let u=null,l=null;if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}if(o[1]!==null){if(!(o[1]instanceof v))throw new h(n,c.InvalidParameter,r);l=H.parseAttributesFromDictionary(o[1])}i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}else{let u=null;const l={};if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}for(let f=1;f{if(o.length===0||o.length===1&&o[0]===null){const l=new v;return l.immutable=!1,l}if(o.length===1&&S(o[0]))try{const l=JSON.parse(o[0]),f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof k)try{const l=o[0].toJSON();l.hasZ=o[0].hasZ===!0,l.hasM=o[0].hasM===!0;const f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&K(o[0]))try{const l=new v;l.immutable=!1,l.setField("geometry",o[0].geometry());const f=new v;f.immutable=!1,l.setField("attributes",f);for(const d of o[0].keys())f.setField(d,o[0].field(d));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof v)try{const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===2&&o[0]instanceof v&&X(o[1]))try{if(o[1]!==!0){const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}return o[0].deepClone()}catch{throw new h(n,c.InvalidParameter,r)}if(o.length%2!=0)throw new h(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(o,2,2,n,r);const i=E(o[1]);if(K(o[0])||o[0]instanceof v)return o[0].hasField(i);if(o[0]instanceof k){const u=mt(o[0],i,null,null,2);return!u||u.keystate!=="notfound"}throw new h(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,s,o)=>(D(o,2,2,n,r),Xn(o[0],o[1])!=null))},e.indexof=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=o[1];if(_(o[0])){for(let u=0;u{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?_a(o[0],o[1]):Ma(o[0],o[1],o[2])})},e.bearing=function(n,r){return t(n,r,(a,s,o)=>{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?Ta(o[0],o[1]):Na(o[0],o[1],o[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=o[0];if(i instanceof le)return i.isSelfIntersecting;if(i instanceof ae)return pr(i.paths);if(i instanceof We){const u=i.points;for(let l=0;l0&&l[0][i]===t)return{partId:a,distanceAlong:s,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:l[0][0],y:l[0][1],...e.hasZ?{z:l[0][u]}:{},...e.hasM?{m:l[0][i]}:{}}),segmentId:0};let f=-1;for(let d=1;dt&&t>l[d-1][i]){const b=(t-l[d-1][i])/g*p;let x=e.hasZ?si(l[d-1],l[d],b,r):ui(l[d-1],l[d],b);x=[...x,t];const O=new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:x[0],y:x[1],...e.hasZ?{z:x[u]}:{},...e.hasM?{m:x[i]}:{}});return{partId:a,distanceAlong:s+o(l[d-1],[O.x,O.y,...O.hasZ?[O.z]:[],...O.hasM?[O.m]:[]],r),coordinate:O,segmentId:f}}s+=p}}return null}function ja(e,t){if(!e)return null;switch(e.type){case"extent":case"multipoint":case"mesh":case"point":return null}const n=e.type==="polygon"?e.rings:e.paths;if(t<0)return null;let r=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(r=wt(e.spatialReference)/yt(e.spatialReference));let a=0;const s=e.hasZ?3:2,o=2,i=e.hasZ?De:oi;let u=-1;if(t===0)return n.length===0||n[0].length===0?null:{partId:0,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:n[0][0][0],y:n[0][0][1],...e.hasZ?{z:n[0][0][o]}:{},...e.hasM?{m:n[0][0][s]}:{}}),segmentId:0};for(const l of n){u++;let f=-1;for(let d=1;dt){let y=e.hasZ?si(l[d-1],l[d],t-a,r):ui(l[d-1],l[d],t-a);return y=[...y,Ln(l[d-1][s],l[d][s],p,t-a)],{partId:u,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:y[0],y:y[1],...e.hasZ?{z:y[o]}:{},...e.hasM?{m:y[s]}:{}}),segmentId:f}}a=g}}return null}function Va(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0;return r=e,a=e.hasZ&&t.hasZ?De([t.x,t.y,t.z],[e.x,e.y,e.z],n):Ve([t.x,t.y],[e.x,e.y],!1),{coordinate:r,distance:a}}function Ja(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0,s=Number.MAX_VALUE,o=-1,i=-1;for(const u of e.points||[]){i++;const l=e.hasZ&&t.hasZ?ti([u[0],u[1],u[2]],[t.x,t.y,t.z],n):ni([u[0],u[1]],[t.x,t.y]);l(i=L(i),n(r,a,i),i[0]===null||i[1]===null||R.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof k&&i[1]instanceof k?R.equals(i[0],i[1]):(ce(i[0])&&ce(i[1])||Q(i[0])&&Q(i[1])||!(!q(i[0])||!q(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,3,3,r,a),i[0]instanceof k&&i[1]instanceof k)return R.relate(i[0],i[1],E(i[2]));if(i[0]instanceof k&&i[1]===null||i[1]instanceof k&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new h(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null||i[1]===null?null:R.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(s,o,i)=>{const u=[];if((i=L(i)).length===0)throw new h(r,c.WrongNumberOfParameters,a);if(i.length===1)if(_(i[0])){const l=L(i[0]);for(let f=0;f(i=L(i),n(r,a,i),i[0]===null?null:i[1]===null?Se(i[0]):R.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Se(i[1]):i[1]===null?Se(i[0]):R.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof Ne)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?null:R.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof ae)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?[Se(i[0])]:R.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.planarArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarArea(i[0],Vt(N(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.geodesicArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicArea(i[0],Vt(N(i[1],-1)))})},e.length=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarLength(i[0],re(N(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:u.hasZ===!0?Dr(u,re(N(i[1],-1))):R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[0].hasZ===!0?Dr(i[0],re(N(i[1],-1))):R.planarLength(i[0],re(N(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.geodesicLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicLength(i[0],re(N(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);let u=i[0];(_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference));let l=i[1];if((_(i[1])||P(i[1]))&&(l=pn(i[1],r.spatialReference)),!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(l instanceof k))throw new h(r,c.InvalidParameter,a);return R.distance(u,l,re(N(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);const u=i[0],l=i[1];if(!(u instanceof V))throw new h(r,c.InvalidParameter,a);if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);const f=new ae({paths:[],spatialReference:u.spatialReference});return f.addPath([u,l]),R.geodesicLength(f,re(N(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.densify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.densify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.geodesicDensify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.geodesicDensify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return R.generalize(i[0],u,Tt(N(i[2],!0)),re(N(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.buffer(i[0],u,re(N(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.geodesicBuffer(i[0],u,re(N(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof le||i[0]instanceof ae))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);const l=m(N(i[4],10));if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=m(N(i[5],0));if(isNaN(f))throw new h(r,c.InvalidParameter,a);return R.offset(i[0],u,re(N(i[2],-1)),E(N(i[3],"round")).toLowerCase(),l,f)})},e.rotate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=i[0]instanceof Ne?le.fromExtent(i[0]):i[0],l=m(i[1]);if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=N(i[2],null);if(f===null)return R.rotate(u,l);if(f instanceof V)return R.rotate(u,l,f);throw new h(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);return u instanceof V?te(Se(u),r.spatialReference):u instanceof le?u.centroid:u instanceof ae?Sa(u):u instanceof We?Ia(u):u instanceof Ne?u.center:null})},e.measuretocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=Za(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.pointtocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);const l=i[1];if(l===null)return null;if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const f=qa(u,l);return f?v.convertObjectToArcadeDictionary(f,B(r),!1,!0):null})},e.distancetocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=ja(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.multiparttosinglepart=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);if(i[0]instanceof V)return[te(Se(i[0]),r.spatialReference)];if(i[0]instanceof Ne)return[te(Se(i[0]),r.spatialReference)];const u=R.simplify(i[0]);if(u instanceof le){const l=[],f=[];for(let d=0;d{if(i=L(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestCoordinate(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestVertex(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})}}function ci(e,t){function n(r,a,s){const o=m(r);return isNaN(o)?o:isNaN(a)||isNaN(s)||a>s?NaN:os?s:o}e.number=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,2,r,a);const u=i[0];if(W(u))return u;if(u===null)return 0;if(ce(u)||Q(u)||q(u))return u.toNumber();if(X(u))return Number(u);if(_(u))return NaN;if(u===""||u===void 0)return Number(u);if(S(u)){if(i[1]!==void 0){let l=Tn(i[1],"‰","");return l=Tn(l,"¤",""),da(u,{pattern:l})}return Number(u.trim())}return Number(u)})},e.abs=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.abs(m(i[0]))))},e.acos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.acos(m(i[0]))))},e.asin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.asin(m(i[0]))))},e.atan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.atan(m(i[0]))))},e.atan2=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),Math.atan2(m(i[0]),m(i[1]))))},e.ceil=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("ceil",m(i[0]),-1*u)}return Math.ceil(m(i[0]))})},e.round=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("round",m(i[0]),-1*u)}return Math.round(m(i[0]))})},e.floor=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("floor",m(i[0]),-1*u)}return Math.floor(m(i[0]))})},e.cos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.cos(m(i[0]))))},e.isnan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.exp(m(i[0]))))},e.log=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.log(m(i[0]))))},e.pow=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),m(i[0])**m(i[1])))},e.random=function(r,a){return t(r,a,(s,o,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sin(m(i[0]))))},e.sqrt=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sqrt(m(i[0]))))},e.tan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.tan(m(i[0]))))},e.isempty=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0||i[0]===I))},e.boolean=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,1,r,a);const u=i[0];return Tt(u)})},e.constrain=function(r,a){return t(r,a,(s,o,i)=>{D(i,3,3,r,a);const u=m(i[1]),l=m(i[2]);if(_(i[0])){const f=[];for(const d of i[0])f.push(n(d,u,l));return f}if(P(i[0])){const f=[];for(let d=0;d=t&&t!==-1)return n}return n}function yn(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Xa(t,n);case"avg":case"mean":return hi(at(t));case"min":return Math.min.apply(Math,at(t));case"sum":return Ka(at(t));case"max":return Math.max.apply(Math,at(t));case"stdev":case"stddev":return Math.sqrt(gr(at(t)));case"var":case"variance":return gr(at(t));case"count":return t.length}return 0}function Ke(e,t){if(t.length===1){if(_(t[0]))return yn(e,t[0],-1);if(P(t[0]))return yn(e,t[0].toArray(),-1)}return yn(e,t,-1)}function di(e,t){e.stdev=function(n,r){return t(n,r,(a,s,o)=>Ke("stdev",o))},e.variance=function(n,r){return t(n,r,(a,s,o)=>Ke("variance",o))},e.average=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.mean=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.sum=function(n,r){return t(n,r,(a,s,o)=>Ke("sum",o))},e.min=function(n,r){return t(n,r,(a,s,o)=>Ke("min",o))},e.max=function(n,r){return t(n,r,(a,s,o)=>Ke("max",o))},e.distinct=function(n,r){return t(n,r,(a,s,o)=>Ke("distinct",o))},e.count=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),_(o[0])||S(o[0]))return o[0].length;if(P(o[0]))return o[0].length();throw new h(n,c.InvalidParameter,r)})}}let Pn=class extends v{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},Qa=class fi extends v{constructor(t,n,r,a,s,o,i){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",o),this.setField("keywords",i),this.immutable=!0}deepClone(){return new fi(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}};const Qn=e=>(t,n,r=14)=>+e(t,n).toFixed(r),Ya=(e,t)=>e+t,$a=(e,t)=>e*t,eo=(e,t)=>e/t,yr=(e,t,n)=>Qn(Ya)(e,t,n),dt=(e,t,n)=>Qn($a)(e,t,n),Qt=(e,t,n)=>Qn(eo)(e,t,n),Yt=360,to=400,no=2*Math.PI,Ie=3600,wr=3240,kt=60,Qe=60,xr=180*Ie/Math.PI,bt=Yt*kt*Qe,wn=90*Ie,ot=180*Ie,ro=270*Ie,mi="ᵍ",vt="°";function Ct(e){if(S(e)===!1)throw new h(null,c.InvalidParameter,null);return e}function On(e,t){const n=10**t;return Math.round(e*n)/n}function io(e,t){return e%t}function st(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var J,w,Z,Un;function ht(e,t){switch(e){case J.north:return t==="SHORT"?"N":"North";case J.east:return t==="SHORT"?"E":"East";case J.south:return t==="SHORT"?"S":"South";case J.west:return t==="SHORT"?"W":"West"}}function xn(e,t){return e-Math.floor(e/t)*t}function Fn(e){switch(e){case w.truncated_degrees:case w.decimal_degrees:return Yt;case w.radians:return no;case w.gradians:return to;case w.seconds:return bt;case w.fractional_degree_minutes:return kt;case w.fractional_minute_seconds:return Qe;default:throw new h(null,c.LogicError,null,{reason:"unsupported evaluations"})}}function Fr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return Z.north_azimuth;case"POLAR":return Z.polar;case"QUADRANT":return Z.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return Z.south_azimuth}throw new h(null,c.LogicError,null,{reason:"unsupported directionType"})}function Ar(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return w.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return w.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return w.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return w.gradians}throw new h(null,c.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(J||(J={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(w||(w={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(Z||(Z={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Un||(Un={}));let pt=class qt{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case w.decimal_degrees:case w.truncated_degrees:return this.m_degrees;case w.fractional_degree_minutes:return this.m_minutes;case w.seconds:case w.fractional_minute_seconds:return this.m_seconds;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=st(t).fraction;let r=st(t).integer;const a=Math.floor(r/Ie);r-=a*Ie;const s=Math.floor(r/Qe);return r-=s*Qe,new qt(a,s,r+n)}static numberToDms(t){const n=st(t).fraction,r=st(t).integer,a=dt(st(100*n).fraction,100),s=st(100*n).integer;return new qt(r,s,a)}format(t,n){let r=On(this.m_seconds,n),a=this.m_minutes,s=this.m_degrees;if(t===w.seconds||t===w.fractional_minute_seconds)Qe<=r&&(r-=Qe,++a),kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,s=this.m_degrees,kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.decimal_degrees||t===w.truncated_degrees){const o=Qt(this.m_seconds,Ie),i=Qt(this.m_minutes,kt);s=Math.round(this.m_degrees+i+o),a=0,r=0}return new qt(s,a,r)}static dmsToSeconds(t,n,r){return t*Ie+n*Qe+r}},ao=class{constructor(e,t,n){this.meridian=e,this.angle=t,this.direction=n}fetchAzimuth(e){return e===Un.meridian?this.meridian:this.direction}},Xe=class Ze{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Ze(new Re(Ze._convertDirectionFormat(t.extractAngularUnits(w.seconds),n,Z.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:case Z.south_azimuth:case Z.polar:return new Re(Ze._convertDirectionFormat(n,Z.north_azimuth,t));case Z.quadrant:{const r=Ze.secondsNorthAzimuthToQuadrant(n);return new Re(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.north;case Z.south_azimuth:return J.south;case Z.polar:return J.east;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.east;case Z.south_azimuth:return J.west;case Z.polar:return J.north;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=wn||t>=ro?J.north:J.south,r=n===J.north?Math.min(bt-t,t):Math.abs(t-ot),a=t>ot?J.west:J.east;return new ao(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Ze(new Re(Ze.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===J.north?r===J.east?t:bt-t:r===J.east?ot-t:ot+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case Z.north_azimuth:a=t;break;case Z.polar:a=wn-t;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:a=t+ot}let s=0;switch(r){case Z.north_azimuth:s=a;break;case Z.polar:s=wn-a;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:s=a-ot}return s=io(s,bt),s<0?bt+s:s}};function Cr(e,t,n){let r=null;switch(t){case w.decimal_degrees:r=dt(e,Ie);break;case w.seconds:r=e;break;case w.gradians:r=dt(e,wr);break;case w.radians:r=dt(e,xr);break;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return Qt(r,Ie);case w.seconds:return r;case w.gradians:return Qt(r,wr);case w.radians:return r/xr;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Re=class zn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new zn(Cr(t,n,w.seconds))}extractAngularUnits(t){return Cr(this._seconds,w.seconds,Nt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new zn(yr(yr(dt(t,Ie),dt(n,Qe)),r))}};function Nt(e){switch(jr(e),e){case w.decimal_degrees:case w.truncated_degrees:case w.degrees_minutes_seconds:return w.decimal_degrees;case w.gradians:return w.gradians;case w.fractional_degree_minutes:return w.fractional_degree_minutes;case w.radians:return w.radians;case w.seconds:case w.fractional_minute_seconds:return w.seconds}}let oo=class pi{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new pi(t,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let t=null,n=w.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case w.truncated_degrees:case w.fractional_degree_minutes:return s=xn(a.fetchFormattedDms().getField(t),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");case w.fractional_minute_seconds:return s=xn(On(a.fetchDms().getField(t),r),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function uo(e,t,n){if(n===Z.quadrant)throw new h(null,c.LogicError,null,{reason:"conversion error"});if(t===w.degrees_minutes_seconds){const r=pt.numberToDms(e);return Xe.createFromAngleAndDirection(Re.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(e,Nt(t)),n)}function lo(e){switch(m(e)){case 1:return{first:J.north,second:J.east};case 2:return{first:J.south,second:J.east};case 3:return{first:J.south,second:J.west};case 4:return{first:J.north,second:J.west}}return null}function Er(e){switch(e.toUpperCase().trim()){case"N":case"NORTH":return J.north;case"E":case"EAST":return J.east;case"S":case"SOUTH":return J.south;case"W":case"WEST":return J.west}return null}function ut(e){const t=parseFloat(e);if(W(t)){if(isNaN(t))throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function An(e,t,n){const r=n===Z.quadrant;let a=null,s=null,o=0,i=0,u=0;if(r){if(e.length<2)throw new h(null,c.LogicError,null,{reason:"conversion error"});u=1;const l=lo(E(e[e.length-1]));if(l?(a=l.first,s=l.second):(o=1,a=Er(E(e[0])),s=Er(E(e[e.length-1]))),a===null||s===null)throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case w.decimal_degrees:case w.radians:case w.gradians:if(e.length===0)throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return r?Xe.createFromAngleMeridianAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),a,s):Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),n);case w.degrees_minutes_seconds:if(i=e.length-u-o,i===3){const l=Re.createFromDegreesMinutesSeconds(ut(e[o]),ut(e[o+1]),ut(e[o+2]));return r?Xe.createFromAngleMeridianAndDirection(l,a,s):Xe.createFromAngleAndDirection(l,n)}if(i===1){const l=ut(e[o]),f=pt.numberToDms(l),d=Re.createFromDegreesMinutesSeconds(f.m_degrees,f.m_minutes,f.m_seconds);return r?Xe.createFromAngleMeridianAndDirection(d,a,s):Xe.createFromAngleAndDirection(d,n)}}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function co(e){const t=new Set([" ","-","/","'",'"',"\\","^",vt,mi," ","\r",` -`,"*"]);let n="";for(let r=0;rr!=="")}function ho(e,t,n){if(W(e))return uo(m(e),t,n);if(S(e))return An(co(e),t,n);if(_(e))return An(e,t,n);if(P(e))return An(e.toArray(),t,n);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function fo(e,t,n){const r=Nt(n);if(r&&n!==w.degrees_minutes_seconds)return e.getAngle(t).extractAngularUnits(r);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function mo(e,t,n){const r=e.getAngle(t);if(t===Z.quadrant&&n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[ht(e.getMeridian(t),"SHORT"),a.m_degrees,a.m_minutes,a.m_seconds,ht(e.getDirection(t),"SHORT")]}if(n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[a.m_degrees,a.m_minutes,a.m_seconds]}return t===Z.quadrant?[ht(e.getMeridian(t),"SHORT"),r.extractAngularUnits(n),ht(e.getDirection(t),"SHORT")]:[r.extractAngularUnits(n)]}function po(e,t){let n="";switch(e){case w.decimal_degrees:n=t===Z.quadrant?"DD.DD"+vt:"DDD.DD"+vt;break;case w.degrees_minutes_seconds:n=t===Z.quadrant?"dd"+vt+` mm' ss"`:"ddd"+vt+` mm' ss.ss"`;break;case w.radians:n="R.RR";break;case w.gradians:n="GGG.GG"+mi;break;default:throw new h(null,c.LogicError,null,{reason:"conversion error"})}return t===Z.quadrant&&(n="p "+n+" b"),n}function Gn(e,t,n){const r={padding:0,rounding:0,newpos:t};let a=!1;for(;t>6,128|63&a):a<55296||a>=57344?t.push(224|a>>12,128|a>>6&63,128|63&a):(n++,a=65536+((1023&a)<<10|1023&e.charCodeAt(n)),t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a))}return new Uint8Array(t)}let wo=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const t=[];for(const n of e)isNaN(n)?t.push("NaN"):n===1/0?t.push("Infinity"):n===-1/0?t.push("-Infinity"):n===0?t.push("0"):t.push(n.toString(16));this.update(Sr(t.join("")))}updateIntArray(e){const t=Int32Array.from(e);this.update(new Uint8Array(t.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(Sr(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let t=0;for(const n of this._bufs)e.set(n,t),t+=n.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,t=0){const n=e;let r=t+vr&4294967295,a=0;if(n.length>=16){const o=[t+lt+ct&4294967295,t+ct&4294967295,t+0&4294967295,t-lt&4294967295],i=e,u=i.length-16;let l=0;for(a=0;(4294967280&a)<=u;a+=4){const f=a,d=i[f]+(i[f+1]<<8),p=i[f+2]+(i[f+3]<<8),g=d*ct+(p*ct<<16);let y=o[l]+g&4294967295;y=y<<13|y>>>19;const b=65535&y,x=y>>>16;o[l]=b*lt+(x*lt<<16)&4294967295,l=l+1&3}r=(o[0]<<1|o[0]>>>31)+(o[1]<<7|o[1]>>>25)+(o[2]<<12|o[2]>>>20)+(o[3]<<18|o[3]>>>14)&4294967295}r=r+e.length&4294967295;const s=e.length-4;for(;a<=s;a+=4){const o=a,i=n[o]+(n[o+1]<<8),u=n[o+2]+(n[o+3]<<8);r=r+(i*Jt+(u*Jt<<16))&4294967295,r=r<<17|r>>>15,r=(65535&r)*br+((r>>>16)*br<<16)&4294967295}for(;a>>21,r=(65535&r)*lt+((r>>>16)*lt<<16)&4294967295;return r^=r>>>15,r=((65535&r)*ct&4294967295)+((r>>>16)*ct<<16),r^=r>>>13,r=((65535&r)*Jt&4294967295)+((r>>>16)*Jt<<16),r^=r>>>16,r<0?r+4294967296:r}};function xo(e){return e.loadStatus==="loaded"&&e.user?.sourceJSON?e.user.sourceJSON:null}function Fo(e,t){return!!e&&Yi(e,t?.restUrl||"")}function Ir(e,t){if(!e||!t)return e===t;if(e.x===t.x&&e.y===t.y){if(e.hasZ){if(e.z!==t.z)return!1}else if(t.hasZ)return!1;if(e.hasM){if(e.m!==t.m)return!1}else if(t.hasM)return!1;return!0}return!1}function Ee(e,t,n){if(e!==null)if(_(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e)Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else if(P(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e.toArray())Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else{if(ce(e))return t.updateIntArray([e.toNumber()]),void t.updateUint8Array([241]);if(q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([257]);if(Q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([263]);if(S(e))return t.updateIntArray([e.length]),t.updateWithString(e),void t.updateUint8Array([41]);if(X(e))t.updateUint8Array([e===!0?1:0,113]);else{if(W(e))return t.updateFloatArray([e]),void t.updateUint8Array([173]);if(e instanceof Qa)throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof Pn)throw new h(n.context,c.UnsupportedHashType,n.node);if(!(e instanceof v)){if(K(e))throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof V)return t.updateIntArray([3833836621]),t.updateIntArray([0]),t.updateFloatArray([e.x]),t.updateIntArray([1]),t.updateFloatArray([e.y]),e.hasZ&&(t.updateIntArray([2]),t.updateFloatArray([e.z])),e.hasM&&(t.updateIntArray([3]),t.updateFloatArray([e.m])),t.updateIntArray([3765347959]),void Ee(e.spatialReference.wkid,t,n);if(e instanceof le){t.updateIntArray([1266616829]);for(let r=0;r(D(o,1,1,n,r),new Pn(E(o[0]))))},e.typeof=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=Jr(o[0]);if(i==="Unrecognized Type")throw new h(n,c.UnrecognizedType,r);return i})},e.trim=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).trim()))},e.tohex=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=m(o[0]);return isNaN(i)?i:i.toString(16)})},e.upper=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).toUpperCase()))},e.proper=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);let i=1;o.length===2&&E(o[1]).toLowerCase()==="firstword"&&(i=2);const u=/\s/,l=E(o[0]);let f="",d=!0;for(let p=0;p(D(o,1,1,n,r),E(o[0]).toLowerCase()))},e.guid=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,1,n,r),o.length>0)switch(E(o[0]).toLowerCase()){case"digits":return Ft().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return Ft();case"digits-hyphen-braces":return"{"+Ft()+"}";case"digits-hyphen-parentheses":return"("+Ft()+")"}return"{"+Ft()+"}"})},e.standardizeguid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=E(o[0]);if(i===""||i===null)return"";const u=/^(\{|\()?(?[0-9a-z]{8})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(i);if(!u)return"";const l=u.groups;switch(i=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,E(o[1]).toLowerCase()){case"digits":return i.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return i;case"digits-hyphen-braces":return"{"+i+"}";case"digits-hyphen-parentheses":return"("+i+")"}return"{"+i+"}"})},e.console=function(n,r){return t(n,r,(a,s,o)=>(o.length===0||(o.length===1?n.console(E(o[0])):n.console(E(o))),I))},e.mid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i))return"";if(i=Math.max(0,i),o.length===2)return E(o[0]).slice(i);let u=m(o[2]);return isNaN(u)?"":(u<0&&(u=0),E(o[0]).slice(i,i+u))})},e.find=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=0;if(o.length>2){if(i=m(N(o[2],0)),isNaN(i))return-1;i<0&&(i=0)}return E(o[1]).indexOf(E(o[0]),i)})},e.left=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=m(o[1]);return isNaN(i)?"":(i<0&&(i=0),E(o[0]).slice(0,i))})},e.right=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=m(o[1]);return isNaN(i)||i<=0?"":E(o[0]).slice(-i)})},e.split=function(n,r){return t(n,r,(a,s,o)=>{let i;D(o,2,4,n,r);let u=m(N(o[2],-1));const l=Tt(N(o[3],!1));if(u===-1||u===null||l===!0?i=E(o[0]).split(E(o[1])):(isNaN(u)&&(u=-1),u<-1&&(u=-1),i=E(o[0]).split(E(o[1]),u)),l===!1)return i;const f=[];for(let d=0;d=u);d++)i[d]!==""&&i[d]!==void 0&&f.push(i[d]);return f})},e.text=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,2,n,r),qe(o[0],o[1])))},e.concatenate=function(n,r){return t(n,r,(a,s,o)=>{const i=[];if(o.length<1)return"";if(_(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}if(P(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}for(let u=0;u{if(D(o,1,1,n,r),_(o[0])){const i=o[0].slice();return i.reverse(),i}if(P(o[0])){const i=o[0].toArray().slice();return i.reverse(),i}throw new h(n,c.InvalidParameter,r)})},e.replace=function(n,r){return t(n,r,(a,s,o)=>{D(o,3,4,n,r);const i=E(o[0]),u=E(o[1]),l=E(o[2]);return o.length!==4||Tt(o[3])?Tn(i,u,l):i.replace(u,l)})},e.schema=function(n,r){return t(n,r,(a,s,o)=>{if(K(o[0])){const i=ra(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypes=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypecode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return null;if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.code;return null}return null}throw new h(n,c.InvalidParameter,r)})},e.subtypename=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return"";if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.name;return""}return""}throw new h(n,c.InvalidParameter,r)})},e.gdbversion=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0]))return o[0].gdbVersion();throw new h(n,c.InvalidParameter,r)})},e.domain=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,3,n,r),K(o[0])){const i=ia(o[0],E(o[1]),o[2]===void 0?void 0:o[2]);return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:hr[i.field.type],codedValues:i.domain.codedValues.map(u=>({name:u.name,code:u.code}))},B(n)):v.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:hr[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.domainname=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return aa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.domaincode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return oa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.urlencode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),o[0]===null)return"";if(o[0]instanceof v){let i="";for(const u of o[0].keys()){const l=o[0].field(u);i!==""&&(i+="&"),i+=l===null?encodeURIComponent(u)+"=":encodeURIComponent(u)+"="+encodeURIComponent(l)}return i}return encodeURIComponent(E(o[0]))})},e.hash=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=new wo(0);return Ee(o[0],i,{context:n,node:r,map:new Map,currentLength:0}),i.digest()})},e.convertdirection=function(n,r){return t(n,r,(a,s,o)=>(D(o,3,3,n,r),yo(o[0],o[1],o[2])))},e.fromjson=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),S(o[0])===!1)throw new h(n,c.InvalidParameter,r);return v.convertJsonToArcade(JSON.parse(E(o[0])),B(n))})},e.expects=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);return I})},e.tocharcode=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.charCodeAt(i)})},e.tocodepoint=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.codePointAt(i)})},e.fromcharcode=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);const i=o.map(u=>Math.trunc(m(u))).filter(u=>u>=0&&u<=65535);return i.length===0?null:String.fromCharCode.apply(null,i)})},e.fromcodepoint=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);let i;try{i=o.map(u=>Math.trunc(m(u))).filter(u=>u<=1114111&&u>>>0===u)}catch{return null}return i.length===0?null:String.fromCodePoint.apply(null,i)})},e.getuser=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,2,n,r);let i=N(o[1],"");if(i=i===!0||i===!1?"":E(i),i!==null&&i!=="")return null;if(o.length===0||o[0]instanceof Pn){let u=null;if(u=n.services?.portal?n.services.portal:Wn.getDefault(),o.length>0&&!Fo(o[0].field("url"),u)||!u)return null;if(i===""){const l=xo(u);if(l){const f=JSON.parse(JSON.stringify(l));for(const d of["lastLogin","created","modified"])f[d]!==void 0&&f[d]!==null&&(f[d]=new Date(f[d]));return v.convertObjectToArcadeDictionary(f,B(n))}}return null}throw new h(n,c.InvalidParameter,r)})},e.getenvironment=function(n,r){return t(n,r,(a,s,o)=>(D(o,0,0,n,r),v.convertObjectToArcadeDictionary(sa(B(n),n.spatialReference),B(n),!0)))}}let Ao=class extends Xr{constructor(e,t){super(),this.paramCount=t,this.fn=e}createFunction(e){return(...t)=>{if(t.length!==this.paramCount)throw new h(e,c.WrongNumberOfParameters,null);return this.fn(...t)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r));const i=this.call(n,{arguments:o});return $e(i)?i.then(u=>Kt(u,n,r)):i})}};function xe(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function T(e,t){switch(t.type){case"AssignmentExpression":return Io(e,t);case"UpdateExpression":return vo(e,t);case"TemplateLiteral":return Uo(e,t);case"Identifier":return Zo(e,t);case"MemberExpression":return Lo(e,t);case"Literal":return t.value===null||t.value===void 0?"null":JSON.stringify(t.value);case"CallExpression":return jo(e,t);case"UnaryExpression":return Po(e,t);case"BinaryExpression":return zo(e,t);case"LogicalExpression":return Go(e,t);case"ArrayExpression":return Oo(e,t);case"ObjectExpression":return Co(e,t);default:throw new he(e,c.Unrecognized,t)}}function pe(e,t){switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclaration":return No(e,t);case"BlockStatement":return Rt(e,t);case"FunctionDeclaration":return Mo(e,t);case"ImportDeclaration":return _o(e,t);case"ExportNamedDeclaration":return To(e,t);case"ReturnStatement":return Bo(e,t);case"IfStatement":return gi(e,t);case"ExpressionStatement":return ko(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"ForStatement":return bo(e,t);case"ForInStatement":return Eo(e,t);case"WhileStatement":return So(e,t);default:throw new he(e,c.Unrecognized,t)}}function Co(e,t){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+s+",'ObjectExpression'),lang.aCheck("+T(e,a.value)+", 'ObjectExpression')"}return n+="])",n}function Eo(e,t){const n=be(e),r=be(e),a=be(e);let s="var "+n+" = "+T(e,t.right)+`; -`;t.left.type==="VariableDeclaration"&&(s+=pe(e,t.left));const o=$(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);Ae(o);let i="";e.localScope!==null&&(e.localScope[o]!==void 0?i="lscope['"+o+"']":e.localScope._SymbolsMap[o]!==void 0&&(i="lscope['"+e.localScope._SymbolsMap[o]+"']"));let u="";if(i===""){if(e.globalScope[o]!==void 0)i="gscope['"+o+"']";else if(e.globalScope._SymbolsMap[o]!==void 0)i="gscope['"+e.globalScope._SymbolsMap[o]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(o))i="gscope['"+e.undeclaredGlobalsInFunctions.get(o).manglename+"']",u=e.undeclaredGlobalsInFunctions.get(o).manglename;else{const l={manglename:_e(e),node:t.left};e.undeclaredGlobalsInFunctions.set(o,l),i="gscope['"+l.manglename+"']",u=l.manglename}}return u&&(s+="lang.chkAssig('"+u+`',runtimeCtx); -`),s+="if ("+n+`===null) { lastStatement = lc.voidOperation; } - `,s+="else if (lc.isArray("+n+") || lc.isString("+n+")) {",s+="var "+r+"="+n+`.length; -`,s+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { -`,s+=i+"="+a+`; -`,s+=pe(e,t.body),s+=` -} -`,s+=` lastStatement = lc.voidOperation; -`,s+=` -} -`,s+="else if (lc.isImmutableArray("+n+")) {",s+="var "+r+"="+n+`.length(); -`,s+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { -`,s+=i+"="+a+`; -`,s+=pe(e,t.body),s+=` -} -`,s+=` lastStatement = lc.voidOperation; -`,s+=` -} -`,s+="else if (( "+n+" instanceof lang.Dictionary) || ( "+n+" instanceof lang.Feature)) {",s+="var "+r+"="+n+`.keys(); -`,s+="for(var "+a+"=0; "+a+"<"+r+".length; "+a+`++) { -`,s+=i+"="+r+"["+a+`]; -`,s+=pe(e,t.body),s+=` -} -`,s+=` lastStatement = lc.voidOperation; -`,s+=` -} -`,e.isAsync&&(s+="else if (lc.isFeatureSet("+n+")) {",s+="var "+r+"="+n+`.iterator(runtimeCtx.abortSignal); -`,s+="for(var "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+", runtimeCtx); "+a+"!=null; "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+`, runtimeCtx)) { -`,s+=i+"="+a+`; -`,s+=pe(e,t.body),s+=` -} -`,s+=` lastStatement = lc.voidOperation; -`,s+=` -} -`),s+=`else { lastStatement = lc.voidOperation; } -`,s}function bo(e,t){let n=`lastStatement = lc.voidOperation; -`;t.init!==null&&(t.init.type==="VariableDeclaration"?n+=pe(e,t.init):n+=T(e,t.init)+"; ");const r=be(e),a=be(e);return n+="var "+r+" = true; ",n+=` - do { `,t.update!==null&&(n+=" if ("+r+`===false) { - `+T(e,t.update)+` -} - `+r+`=false; -`),t.test!==null&&(n+="var "+a+" = "+T(e,t.test)+"; ",n+="if ("+a+"===false) { break; } else if ("+a+"!==true) { lang.error('"+c.BooleanConditionRequired+`'); } -`),n+=pe(e,t.body),t.update!==null&&(n+=` - `+T(e,t.update)),n+=` -`+r+` = true; -} while(true); lastStatement = lc.voidOperation; `,n}function vo(e,t){if(t.argument.type==="CallExpression")throw new he(e,c.NeverReach,t);let n;if(t.argument.type==="MemberExpression"){const a=T(e,t.argument.object);return t.argument.computed===!0?n=T(e,t.argument.property):(Ae(t.argument.property.name),n="'"+t.argument.property.name+"'"),"lang.memberupdate("+a+","+n+",'"+t.operator+"',"+t.prefix+")"}const r=$(t.argument);if(Ae(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lang.update(lscope, '"+r+"','"+t.operator+"',"+t.prefix+")";if(e.localScope._SymbolsMap[r]!==void 0)return"lang.update(lscope, '"+e.localScope._SymbolsMap[r]+"','"+t.operator+"',"+t.prefix+")"}if(e.globalScope[r]!==void 0)return"lang.update(gscope, '"+r+"','"+t.operator+"',"+t.prefix+")";if(e.globalScope._SymbolsMap[r]!==void 0)return"lang.update(gscope, '"+e.globalScope._SymbolsMap[r]+"','"+t.operator+"',"+t.prefix+")";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"lang.update(gscope,lang.chkAssig( '"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")";const a={manglename:_e(e),node:t.argument};return e.undeclaredGlobalsInFunctions.set(r,a),"lang.update(gscope, lang.chkAssig('"+a.manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")"}throw new h(e,c.InvalidIdentifier,t)}function So(e,t){let n=`lastStatement = lc.voidOperation; -`;const r=be(e);return n+=` - var ${r} = true; - do { - ${r} = ${T(e,t.test)}; - if (${r}==false) { - break; - } - if (${r}!==true) { - lang.error('${c.BooleanConditionRequired}'); - } - ${pe(e,t.body)} - } - while (${r} !== false); - lastStatement = lc.voidOperation; - `,n}function Io(e,t){const n=T(e,t.right);if(t.left.type==="MemberExpression"){let a;const s=T(e,t.left.object);return t.left.computed===!0?a=T(e,t.left.property):(a="'"+t.left.property.name+"'",Ae(t.left.property.name)),"lang.assignmember("+s+","+a+",'"+t.operator+"',"+n+")"}const r=$(t.left);if(Ae(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+r+"'])";if(e.localScope._SymbolsMap[r]!==void 0)return"lscope['"+e.localScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+e.localScope._SymbolsMap[r]+"'])"}if(e.globalScope[r]!==void 0)return"gscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+r+"'])";if(e.globalScope._SymbolsMap[r]!==void 0)return"gscope['"+e.globalScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+e.globalScope._SymbolsMap[r]+"'])";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+e.undeclaredGlobalsInFunctions.get(r).manglename+"'])";const a={manglename:_e(e),node:t.left};return e.undeclaredGlobalsInFunctions.set(r,a),"gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+a.manglename+"'])"}throw new h(e,c.InvalidIdentifier,t)}function ko(e,t){return t.expression.type==="AssignmentExpression"?"lastStatement = lc.voidOperation; "+T(e,t.expression)+`; - `:"lastStatement = "+T(e,t.expression)+"; "}function kr(e,t){return t.type==="BlockStatement"?pe(e,t):t.type==="ReturnStatement"||t.type==="BreakStatement"||t.type==="ContinueStatement"?pe(e,t)+"; ":t.type==="ExpressionStatement"?pe(e,t):pe(e,t)+"; "}function gi(e,t){return`if (lang.mustBoolean(${T(e,t.test)}, runtimeCtx) === true) { - ${kr(e,t.consequent)} - } `+(t.alternate!==null?t.alternate.type==="IfStatement"?" else "+gi(e,t.alternate):` else { - ${kr(e,t.alternate)} - } -`:` else { - lastStatement = lc.voidOperation; - } -`)}function Rt(e,t){let n="";for(let r=0;r0&&(s+=", "),s+=T(e,t.arguments[o]);return s+="]",e.isAsync?"(yield lang.callModuleFunction("+T(e,t.callee.object)+","+s+","+a+",runtimeCtx))":"lang.callModuleFunction("+T(e,t.callee.object)+","+s+","+a+",runtimeCtx)"}if(t.callee.type!=="Identifier")throw new he(e,c.FunctionNotFound,t);const n=$(t.callee);if(n==="iif")return Vo(e,t);if(n==="when")return Wo(e,t);if(n==="defaultvalue")return Jo(e,t);if(n==="decode")return qo(e,t);let r="";if(e.localScope!==null&&(e.localScope[n]!==void 0?r="lscope['"+n+"']":e.localScope._SymbolsMap[n]!==void 0&&(r="lscope['"+e.localScope._SymbolsMap[n]+"']")),r===""){if(e.globalScope[n]!==void 0)r="gscope['"+n+"']";else if(e.globalScope._SymbolsMap[n]!==void 0)r="gscope['"+e.globalScope._SymbolsMap[n]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(n))r="gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(n).manglename+"',runtimeCtx)]";else{const a={manglename:_e(e),node:t.callee};e.undeclaredGlobalsInFunctions.set(n,a),r="gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]"}}if(r!==""){let a="[";for(let s=0;s0&&(a+=", "),a+=T(e,t.arguments[s]);return a+="]",e.isAsync?"(yield lang.callfunc("+r+","+a+",runtimeCtx) )":"lang.callfunc("+r+","+a+",runtimeCtx)"}throw new he(e,c.FunctionNotFound,t)}catch(n){throw n}}function Vo(e,t){try{if(t.arguments.length!==3)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e);return`${e.isAsync?`(yield (function() { - return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} - var ${n} = ${T(e,t.arguments[0])}; - - if (${n} === true) { - return ${T(e,t.arguments[1])}; - } - else if (${n} === false) { - return ${T(e,t.arguments[2])}; - } - else { - lang.error('ExecutionErrorCodes.BooleanConditionRequired'); - } - ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Jo(e,t){try{if(t.arguments.length<2||t.arguments.length>3)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e),r=be(e);return t.arguments.length===3?`${e.isAsync?`(yield (function() { - return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} - var ${n} = ${T(e,t.arguments[0])}; - var ${r} = ${T(e,t.arguments[1])}; - ${n} = lang.getNestedOptionalValue(${n}, ${r}); - return ${n} != null && ${n} !== "" ? ${n} : ${T(e,t.arguments[2])}; - ${e.isAsync?"})}()))":"}()"}`:`${e.isAsync?`(yield (function() { - return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} - var ${n} = ${T(e,t.arguments[0])}; - if (${n} === null) { - return ${T(e,t.arguments[1])}; - } - if (${n} === "") { - return ${T(e,t.arguments[1])}; - } - if (${n} === undefined) { - return ${T(e,t.arguments[1])}; - } - return ${n}; - ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Wo(e,t){try{if(t.arguments.length<3)throw new he(e,c.WrongNumberOfParameters,t);if(t.arguments.length%2==0)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e);let r="var ";for(let a=0;a{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.decode=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.when=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.defaultvalue=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}};const Dt={};for(const e in ee)Dt[e]=new nt(ee[e]);li(ee,xe);for(const e in ee)ee[e]=new nt(ee[e]);const Yn=function(){};Yn.prototype=ee;const $n=function(){};function yi(e,t,n){const r={_SymbolsMap:{}};e||(e={}),n||(n={}),r.textformatting=1,r.infinity=1,r.pi=1;for(const a in t)r[a]=1;for(const a in n)r[a]=1;for(const a in e)r[a]=1;return r}function wi(e,t,n,r){const a=n?new $n:new Yn;e||(e={}),t||(t={});const s=new v({newline:` -`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});s.immutable=!1,a._SymbolsMap={textformatting:1,infinity:1,pi:1},a.textformatting=s,a.infinity=Number.POSITIVE_INFINITY,a.pi=Math.PI;for(const o in t)a[o]=t[o],a._SymbolsMap[o]=1;for(const o in e){const i=e[o];a._SymbolsMap[o]=1,Hr(i)?a[o]=H.createFromGraphic(i,r??null):a[o]=i}return a}$n.prototype=Dt;function rt(e,t){const n={mode:t,compiled:!0,functions:{},signatures:[],standardFunction:xe,standardFunctionAsync:xe,evaluateIdentifier:Ho};for(let r=0;r0){if(!n.toLowerCase().startsWith("_t")&&e.localStack[e.localStack.length-1][n]!==void 0)return e.localStack[e.localStack.length-1][n];const a=e.mangleMap[n];if(a!==void 0&&e.localStack[e.localStack.length-1][a]!==void 0)return e.localStack[e.localStack.length-1][a]}if(!n.toLowerCase().startsWith("_t")&&e.globalScope[n]!==void 0||e.globalScope._SymbolsMap[n]===1)return e.globalScope[n];const r=e.mangleMap[n];return r!==void 0?e.globalScope[r]:void 0}rt([Rn],"sync"),rt([Rn],"async");let Cn=0;const xi={isNumber:e=>W(e),isArray:e=>_(e),isImmutableArray:e=>P(e),isFeature:e=>K(e),isString:e=>S(e),isDictionary:e=>qn(e),isGeometry:e=>nn(e),geometryMember:(e,t,n,r,a=1)=>mt(e,t,n,r,a),error(e){throw new h(null,e,null)},__awaiter:(e,t,n,r)=>new Promise((a,s)=>{function o(l){try{u(r.next(l))}catch(f){s(f)}}function i(l){try{u(r.throw(l))}catch(f){s(f)}}function u(l){l.done?a(l.value):l.value?.then?l.value.then(o,i):(Cn++,Cn%100==0?setTimeout(()=>{Cn=0,o(l.value)},0):o(l.value))}u((r=r.apply(e,t||[])).next())}),functionDepthchecker:(e,t)=>function(){if(t.depthCounter.depth++,t.localStack.push({}),t.depthCounter.depth>64)throw new h(null,c.MaximumCallDepth,null);const n=e.apply(this,arguments);return $e(n)?n.then(r=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,r)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)},chkAssig(e,t){if(t.gdefs[e]===void 0)throw new h(t,c.InvalidIdentifier,null);return e},mustBoolean(e,t){if(e===!0||e===!1)return e;throw new h(t,c.BooleanConditionRequired,null)},setAssig:(e,t)=>(t.gdefs[e]=1,e),castString:e=>E(e),aCheck(e,t){if(Y(e))throw t==="ArrayExpression"?new h(null,c.NoFunctionInArray,null):t==="ObjectExpression"?new h(null,c.NoFunctionInDictionary,null):new h(null,c.NoFunctionInTemplateLiteral,null);return e===I?null:e},Dictionary:v,Feature:H,UserDefinedCompiledFunction:Ao,dictionary(e){const t={},n=new Map;for(let a=0;a>":case">>>":case"^":case"&":return qr(m(e),m(t),n);case"==":case"=":return Pe(e,t);case"!=":return!Pe(e,t);case"<":case">":case"<=":case">=":return Wr(e,t,n);case"+":return S(e)||S(t)?E(e)+E(t):m(e)+m(t);case"-":return m(e)-m(t);case"*":return m(e)*m(t);case"/":return m(e)/m(t);case"%":return m(e)%m(t);default:throw new h(null,c.UnsupportedOperator,null)}},assign(e,t,n){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(null,c.UnsupportedOperator,null)}},update(e,t,n,r){const a=m(e[t]);return e[t]=n==="++"?a+1:a-1,r===!1?a:n==="++"?a+1:a-1},graphicToFeature:(e,t,n)=>e===null?null:H.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone),memberupdate(e,t,n,r){let a;if(_(e)){if(!W(t))throw new h(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>=e.length)throw new h(null,c.OutOfBounds,null);a=m(e[t]),e[t]=n==="++"?a+1:a-1}else if(e instanceof v){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new h(null,c.FieldNotFound,null,{key:t});a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else if(K(e)){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new h(null,c.FieldNotFound,null);a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else{if(P(e))throw new h(null,c.Immutable,null);if(!(e instanceof St))throw new h(null,c.InvalidIdentifier,null);if(S(t)===!1)throw new h(null,c.ModuleAccessorMustBeString,null);if(e.hasGlobal(t)!==!0)throw new h(null,c.ModuleExportNotFound,null);a=m(e.global(t)),e.setGlobal(t,n==="++"?a+1:a-1)}return r===!1?a:n==="++"?a+1:a-1},assignmember(e,t,n,r){if(_(e)){if(!W(t))throw new h(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>e.length)throw new h(null,c.OutOfBounds,null);if(t===e.length){if(n!=="=")throw new h(null,c.OutOfBounds,null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else if(e instanceof v){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new h(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else if(K(e)){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new h(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else{if(P(e))throw new h(null,c.Immutable,null);if(!(e instanceof St))throw new h(null,c.InvalidIdentifier,null);if(S(t)===!1)throw new h(null,c.ModuleAccessorMustBeString,null);if(!e.hasGlobal(t))throw new h(null,c.ModuleExportNotFound,null);e.setGlobal(t,this.assign(r,n,e.global(t)))}},member(e,t){if(e===null)throw new h(null,c.MemberOfNull,null);if(e instanceof v||K(e)){if(S(t))return e.field(t);throw new h(null,c.InvalidMemberAccessKey,null)}if(e instanceof k){if(S(t))return mt(e,t,null,null);throw new h(null,c.InvalidMemberAccessKey,null)}if(_(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new h(null,c.OutOfBounds,null);return e[t]}throw new h(null,c.InvalidMemberAccessKey,null)}if(S(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new h(null,c.OutOfBounds,null);return e[t]}throw new h(null,c.InvalidMemberAccessKey,null)}if(P(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length()+t),t>=e.length()||t<0)throw new h(null,c.OutOfBounds,null);return e.get(t)}throw new h(null,c.InvalidMemberAccessKey,null)}if(e instanceof St){if(S(t))return e.global(t);throw new h(null,c.InvalidMemberAccessKey,null)}throw new h(null,c.InvalidMemberAccessKey,null)},callfunc:(e,t,n)=>e.call(n,{arguments:t,preparsed:!0}),loadModule(e,t){const n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];const r=t.moduleFactory[n]({vars:{},moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,console:t.console,abortSignal:t.abortSignal,isAsync:t.isAsync,services:t.services,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor},t.spatialReference);return t.moduleSingletons[n]=r,r},callModuleFunction(e,t,n,r){if(!(e instanceof St))throw new h(null,c.FunctionNotFound,null);const a=e.global(n);if(Y(a)===!1)throw new h(null,c.CallNonFunction,null);return a.call(r,{preparsed:!0,arguments:t})},getNestedOptionalValue:(e,t)=>Xn(e,t)};function $t(e){console.log(e)}function Fi(e,t,n=!1){t===null&&(t={vars:{},customfunctions:{}});let r=null;e.usesModules&&(r=new on(null,e.loadedModules));const a={isAsync:n,globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:t.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let s=Rt(a,e);s===""&&(s="lc.voidOperation; "),a.undeclaredGlobalsInFunctions.size>0&&a.undeclaredGlobalsInFunctions.forEach(g=>{throw new he(t,c.InvalidIdentifier,g.node)});let o="";o=n?`var runtimeCtx=this.prepare(context, true); - var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; -return lang.__awaiter(this, void 0, void 0, function* () { - - function mainBody() { - var lastStatement=lc.voidOperation; - return lang.__awaiter(this, void 0, void 0, function* () { -`+s+` - return lastStatement; }); } - return this.postProcess(yield mainBody()); }); `:`var runtimeCtx=this.prepare(context, false); - var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; - function mainBody() { - var lastStatement=lc.voidOperation; - `+s+` - return lastStatement; } - return this.postProcess(mainBody()); `;const i=a.moduleFactory,u=a.moduleFactoryMap,l=a.exports,f={};let d;for(d in l)f[d]=a.mangleMap[d]??d;const p={lc:Kr,lang:xi,mangles:a.mangleMap,postProcess(g){if(g instanceof Fe&&(g=g.value),g instanceof an&&(g=g.value),g===I&&(g=null),g===Le)throw new h(null,c.IllegalResult,null);if(g===Ot)throw new h(null,c.IllegalResult,null);if(Y(g))throw new h(null,c.IllegalResult,null);return g},prepare(g,y){let b=g.spatialReference;b==null&&(b=Pt.WebMercator);const x=wi(g.vars,g.customfunctions,y,g.timeZone);return{localStack:[],isAsync:y,moduleFactory:i,moduleFactoryMap:u,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:f,spatialReference:b,globalScope:x,abortSignal:g.abortSignal===void 0||g.abortSignal===null?{aborted:!1}:g.abortSignal,localScope:null,services:g.services,console:g.console??$t,lrucache:g.lrucache,timeZone:g.timeZone??null,interceptor:g.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(p)}async function Ko(){return rt([await je(()=>import("./geomasync-uGYsifQH-gccYe-Fi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url)],"async"),!0}class St extends Kn{constructor(t){super(),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(Y(n))throw new h(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope,r=t.toLowerCase(),a=n[this.moduleContext.exportmangle[r]];if(a===void 0)throw new h(null,c.InvalidIdentifier,null);if(Y(a)&&!(a instanceof ft)){const s=new ft;return s.fn=a,s.parameterEvaluator=xe,s.context=this.moduleContext,n[this.moduleContext.exportmangle[r]]=s,s}return a}}function Xo(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new on(null,e.loadedModules),globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=Rt(r,e);a===""&&(a="lc.voidOperation; ");let s="";s=n?`var runtimeCtx=this.prepare(context, true); - var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; -return lang.__awaiter(this, void 0, void 0, function* () { - - function mainBody() { - var lastStatement=lc.voidOperation; - return lang.__awaiter(this, void 0, void 0, function* () { -`+a+` - return lastStatement; }); } - yield mainBody(); - return this.prepareModule(runtimeCtx); }); `:`var runtimeCtx=this.prepare(context, false); - var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; - function mainBody() { - var lastStatement=lc.voidOperation; - `+a+` - return lastStatement; } - mainBody(); - return this.prepareModule(runtimeCtx); `;const o=r.moduleFactory,i=r.moduleFactoryMap,u=r.exports,l={};let f;for(f in u)l[f]=r.mangleMap[f]??f;const d={lc:Kr,lang:xi,mangles:r.mangleMap,prepareModule:p=>new St(p),prepare(p,g){let y=p.spatialReference;y==null&&(y=new Pt({wkid:102100}));const b=wi(p.vars,p.customfunctions,g,p.timeZone);return{localStack:[],isAsync:g,exports:u,exportmangle:l,gdefs:{},moduleFactory:o,moduleFactoryMap:i,moduleSingletons:p.moduleSingletons,mangleMap:this.mangles,spatialReference:y,globalScope:b,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console??$t,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:p.depthCounter}}};return new Function("context","spatialReference",s).bind(d)}var Ht={False:"false",Null:"null",True:"true"},z={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},A={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},Zn=["++","--"],Ai=["-","+","!","~"],Ci=["=","/=","*=","%=","+=","-="],Ei=["||","&&"],Qo=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],Br={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},C={Unknown:0,BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,Template:10},Yo=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"],F={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentiferExpected:"IdentiferExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},$o={[F.InvalidModuleUri]:"Module uri must be a text literal.",[F.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[F.IdentiferExpected]:"'${value}' is an invalid identifier.",[F.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[F.InvalidExpression]:"Invalid expression.",[F.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[F.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[F.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[F.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[F.InvalidTemplateHead]:"Invalid template structure.",[F.InvalidVariableAssignment]:"Invalid variable assignment.",[F.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[F.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[F.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[F.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[F.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[F.PunctuatorExpected]:"'${value}' expected.",[F.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[F.UnexpectedBoolean]:"Unexpected boolean literal.",[F.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[F.UnexpectedIdentifier]:"Unexpected identifier.",[F.UnexpectedKeyword]:"Unexpected keyword.",[F.UnexpectedNull]:"Unexpected null literal.",[F.UnexpectedNumber]:"Unexpected number.",[F.UnexpectedPunctuator]:"Unexpected ponctuator.",[F.UnexpectedString]:"Unexpected text literal.",[F.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[F.UnexpectedToken]:"Unexpected token '${value}'."},Lt=class bi extends Error{constructor({code:t,index:n,line:r,column:a,len:s=0,description:o,data:i}){super(o??t),this.declaredRootClass="esri.arcade.lib.diagnostic",this.name="ParsingError",this.code=t,this.index=n,this.line=r,this.column=a,this.len=s,this.data=i,this.description=o,this.range={start:{line:r,column:a-1},end:{line:r,column:a+s}},Error.captureStackTrace?.(this,bi)}};function es(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.Program}function _r(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.BlockStatement}function ts(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.BlockComment}function ns(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.EmptyStatement}function rs(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.VariableDeclarator}function En(e,t){return t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function Tr(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}var is=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!_r(e)||e.body.length!==0)return;let t=[];for(let n=this._newComments.length-1;n>=0;n--){let r=this._newComments[n];e.range[1]>=r.range[0]&&(t.unshift(r),this._newComments.splice(n,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){let t=this._nodeStack.at(-1);if(!t)return;if(_r(e)&&Tr(t,e))for(let r=this._newComments.length-1;r>=0;r--){let a=this._newComments[r];Tr(a,e)&&(t.trailingComments=[...t.trailingComments??[],a],this._newComments.splice(r,1))}let n=[];if(this._newComments.length>0)for(let r=this._newComments.length-1;r>=0;r--){let a=this._newComments[r];En(a,t)?(t.trailingComments=[...t.trailingComments??[],a],this._newComments.splice(r,1)):En(a,e)&&(n.unshift(a),this._newComments.splice(r,1))}t.trailingComments&&En(t.trailingComments[0],e)&&(n=[...n,...t.trailingComments],delete t.trailingComments),n.length>0&&(e.trailingComments=n)}attachLeadingComments(e){let t;for(;this._nodeStack.length>0;){let a=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=a.range[0]))break;t=a,this._nodeStack.pop()}let n=[],r=[];if(t!=null){if(!t.leadingComments)return;for(let a=t.leadingComments.length-1;a>=0;a--){let s=t.leadingComments[a];e.range[0]>=s.range[1]?(n.unshift(s),t.leadingComments.splice(a,1)):rs(e)&&!ts(s)&&(r.unshift(s),t.leadingComments.splice(a,1))}return t.leadingComments.length===0&&delete t.leadingComments,n.length&&(e.leadingComments=n),void(r.length&&(e.trailingComments=[...r,...e.trailingComments??[]]))}for(let a=this._newComments.length-1;a>=0;a--){let s=this._newComments[a];e.range[0]>=s.range[0]&&(n.unshift(s),this._newComments.splice(a,1))}n.length&&(e.leadingComments=n)}attachComments(e){if(es(e)&&e.body.length>0){let t=this._nodeStack.at(-1);return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}},as=/\$\{(.*?)\}/gu;function jn(e,t){let n=$o[e];return t?n.replace(as,(r,a)=>t[a]?.toString()??""):n}var os=class{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description??(e.description=jn(e.code,e.data)),new Lt(e)}tolerateError(e){e.description??(e.description=jn(e.code,e.data));let t=new Lt(e);if(!this.tolerant)throw t;this.recordError(t)}};function Mr(e,t){if(!e)throw new Error(`ASSERT: ${t}`)}var Nr={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u},U={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>e===10||e===13||e===8232||e===8233,isIdentifierStart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Nr.NonAsciiIdentifierStart.test(U.fromCodePoint(e)),isIdentifierPart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Nr.NonAsciiIdentifierPart.test(U.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function Rr(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function bn(e){return"01234567".indexOf(e)}var tt=[[],[],[]];Zn.forEach(e=>tt[e.length-1]?.push(e)),Ai.forEach(e=>tt[e.length-1]?.push(e)),Ei.forEach(e=>tt[e.length-1]?.push(e)),Ci.forEach(e=>tt[e.length-1]?.push(e)),Qo.forEach(e=>tt[e.length-1]?.push(e));var ss=class{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=F.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(e=F.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){let t=[],n=this.index-e,r={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){let s=this.source.charCodeAt(this.index);if(this.index+=1,U.isLineTerminator(s)){r.end={line:this.lineNumber,column:this.index-this.lineStart-1};let o={multiLine:!1,start:n+e,end:this.index-1,range:[n,this.index-1],loc:r};return t.push(o),s===13&&this.source.charCodeAt(this.index)===10&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,t}}r.end={line:this.lineNumber,column:this.index-this.lineStart};let a={multiLine:!1,start:n+e,end:this.index,range:[n,this.index],loc:r};return t.push(a),t}skipMultiLineComment(){let e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){let a=this.source.charCodeAt(this.index);if(U.isLineTerminator(a))a===13&&this.source.charCodeAt(this.index+1)===10&&(this.index+=1),this.lineNumber+=1,this.index+=1,this.lineStart=this.index;else if(a===42){if(this.source.charCodeAt(this.index+1)===47){this.index+=2,n.end={line:this.lineNumber,column:this.index-this.lineStart};let s={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:n};return e.push(s),e}this.index+=1}else this.index+=1}n.end={line:this.lineNumber,column:this.index-this.lineStart};let r={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:n};return e.push(r),this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(U.isWhiteSpace(t))this.index+=1;else if(U.isLineTerminator(t))this.index+=1,t===13&&this.source.charCodeAt(this.index)===10&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else{if(t!==47)break;if(t=this.source.charCodeAt(this.index+1),t===47){this.index+=2;let n=this.skipSingleLineComment(2);e=[...e,...n]}else{if(t!==42)break;{this.index+=2;let n=this.skipMultiLineComment();e=[...e,...n]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===z.If||e===z.In;case 3:return e===z.Var||e===z.For;case 4:return e===z.Else;case 5:return e===z.Break||e===z.While;case 6:return e===z.Return||e===z.Import||e===z.Export;case 8:return e===z.Function||e===z.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){let n=this.source.charCodeAt(e+1);n>=56320&&n<=57343&&(t=1024*(t-55296)+n-56320+65536)}return t}scanHexEscape(e){let t=e==="u"?4:2,n=0;for(let r=0;r1114111||e!=="}")&&this.throwUnexpectedToken(),U.fromCodePoint(t)}getIdentifier(){let e=this.index;for(this.index+=1;!this.eof();){let t=this.source.charCodeAt(this.index);if(t===92)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!U.isIdentifierPart(t))break;this.index+=1}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),n=U.fromCodePoint(t);for(this.index+=n.length,t===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),this.index+=1,this.source[this.index]==="{"?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(e===null||e==="\\"||!U.isIdentifierStart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),n=e);!this.eof()&&(t=this.codePointAt(this.index),U.isIdentifierPart(t));)e=U.fromCodePoint(t),n+=e,this.index+=e.length,t===92&&(n=n.substring(0,n.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),this.index+=1,this.source[this.index]==="{"?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(e===null||e==="\\"||!U.isIdentifierPart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),n+=e);return n}octalToDecimal(e){let t=e!=="0",n=bn(e);return!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+bn(this.source[this.index]??""),this.index+=1,"0123".includes(e)&&!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+bn(this.source[this.index]??""),this.index+=1)),{code:n,octal:t}}scanIdentifier(){let e,t=this.index,n=this.source.charCodeAt(t)===92?this.getComplexIdentifier():this.getIdentifier();if(e=n.length===1?C.Identifier:this.isKeyword(n)?C.Keyword:n.toLowerCase()===Ht.Null?C.NullLiteral:n.toLowerCase()===Ht.True||n.toLowerCase()===Ht.False?C.BooleanLiteral:C.Identifier,e!==C.Identifier&&t+n.length!==this.index){let r=this.index;this.index=t,this.tolerateUnexpectedToken(F.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanPunctuator(){let e=this.index,t=this.source[this.index]??"";switch(t){case"(":case"{":t==="{"&&this.curlyStack.push("{"),this.index+=1;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":this.index+=1;break;case"}":this.index+=1,this.curlyStack.pop();break;default:for(let n=tt.length;n>0;n--)if(t=this.source.substring(this.index,this.index+n),tt[n-1]?.includes(t)){this.index+=n;break}}return this.index===e&&this.throwUnexpectedToken(),{type:C.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&U.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index],this.index+=1;return t.length===0&&this.throwUnexpectedToken(),U.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseInt(`0x${t}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){let n=this.source[this.index];if(n!=="0"&&n!=="1")break;t+=this.source[this.index],this.index+=1}if(t.length===0&&this.throwUnexpectedToken(),!this.eof()){let n=this.source.charCodeAt(this.index);(U.isIdentifierStart(n)||U.isDecimalDigit(n))&&this.throwUnexpectedToken()}return{type:C.NumericLiteral,value:Number.parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let n="",r=!1;for(U.isOctalDigit(e.charCodeAt(0))&&(r=!0,n=`0${this.source[this.index]}`),this.index+=1;!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;return!r&&n.length===0&&this.throwUnexpectedToken(),(U.isIdentifierStart(this.source.charCodeAt(this.index))||U.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseInt(n,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){let e=this.index,t=this.source[e]??"";Mr(U.isDecimalDigit(t.charCodeAt(0))||t===".","Numeric literal must start with a decimal digit or a decimal point");let n="";if(t!=="."){if(n=this.source[this.index]??"",this.index+=1,t=this.source[this.index]??"",n==="0"){if(t==="x"||t==="X")return this.index+=1,this.scanHexLiteral(e);if(t==="b"||t==="B")return this.index+=1,this.scanBinaryLiteral(e);if(t==="o"||t==="O")return this.scanOctalLiteral(t,e)}for(;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if(t==="."){for(n+=this.source[this.index],this.index+=1;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if(t==="e"||t==="E")if(n+=this.source[this.index],this.index+=1,t=this.source[this.index]??"",(t==="+"||t==="-")&&(n+=this.source[this.index],this.index+=1),U.isDecimalDigit(this.source.charCodeAt(this.index)))for(;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken();return U.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){let e=this.index,t=this.source[e];Mr(t==="'"||t==='"',"String literal must starts with a quote"),this.index+=1;let n=!1,r="";for(;!this.eof();){let a=this.source[this.index]??"";if(this.index+=1,a===t){t="";break}if(a==="\\")if(a=this.source[this.index]??"",this.index+=1,a&&U.isLineTerminator(a.charCodeAt(0)))this.lineNumber+=1,a==="\r"&&this.source[this.index]===` -`&&(this.index+=1),this.lineStart=this.index;else switch(a){case"u":if(this.source[this.index]==="{")this.index+=1,r+=this.scanUnicodeCodePointEscape();else{let s=this.scanHexEscape(a);s===null&&this.throwUnexpectedToken(),r+=s}break;case"x":{let s=this.scanHexEscape(a);s===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),r+=s;break}case"n":r+=` -`;break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;case"8":case"9":r+=a,this.tolerateUnexpectedToken();break;default:if(a&&U.isOctalDigit(a.charCodeAt(0))){let s=this.octalToDecimal(a);n=s.octal||n,r+=String.fromCharCode(s.code)}else r+=a}else{if(U.isLineTerminator(a.charCodeAt(0)))break;r+=a}}return t!==""&&(this.index=e,this.throwUnexpectedToken()),{type:C.StringLiteral,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",t=!1,n=this.index,r=this.source[n]==="`",a=!1,s=2;for(this.index+=1;!this.eof();){let o=this.source[this.index]??"";if(this.index+=1,o==="`"){s=1,a=!0,t=!0;break}if(o!=="$")if(o!=="\\")U.isLineTerminator(o.charCodeAt(0))?(this.lineNumber+=1,o==="\r"&&this.source[this.index]===` -`&&(this.index+=1),this.lineStart=this.index,e+=` -`):e+=o;else if(o=this.source[this.index]??"",this.index+=1,U.isLineTerminator(o.charCodeAt(0)))this.lineNumber+=1,o==="\r"&&this.source[this.index]===` -`&&(this.index+=1),this.lineStart=this.index;else switch(o){case"n":e+=` -`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"u":if(this.source[this.index]==="{")this.index+=1,e+=this.scanUnicodeCodePointEscape();else{let i=this.index,u=this.scanHexEscape(o);u!==null?e+=u:(this.index=i,e+=o)}break;case"x":{let i=this.scanHexEscape(o);i===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),e+=i;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:o==="0"?(U.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(F.TemplateOctalLiteral),e+="\0"):U.isOctalDigit(o.charCodeAt(0))?this.throwUnexpectedToken(F.TemplateOctalLiteral):e+=o}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),this.index+=1,t=!0;break}e+=o}}return t||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:C.Template,value:this.source.slice(n+1,this.index-s),cooked:e,head:r,tail:a,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}lex(){if(this.eof())return{type:C.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};let e=this.source.charCodeAt(this.index);return U.isIdentifierStart(e)?this.scanIdentifier():e===40||e===41||e===59?this.scanPunctuator():e===39||e===34?this.scanStringLiteral():e===46?U.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():U.isDecimalDigit(e)?this.scanNumericLiteral():e===96||e===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():e>=55296&&e<57343&&U.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}},ge={None:0,Function:1,IfClause:2,ForLoop:4,WhileLoop:8},vn={AsObject:0,Automatic:1};function Lr(e,t=0){let n=e.start-e.lineStart,r=e.lineNumber;return n<0&&(n+=t,r-=1),{index:e.start,line:r,column:n}}function Pr(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function Or(e){return e in Br?Br[e]:0}var us=class{constructor(e,t={},n){this.delegate=n,this.hasLineTerminator=!1,this.options={tokens:typeof t.tokens=="boolean"&&t.tokens,comments:typeof t.comments=="boolean"&&t.comments,tolerant:typeof t.tolerant=="boolean"&&t.tolerant},this.options.comments&&(this.commentHandler=new is),this.errorHandler=new os(this.options.tolerant),this.scanner=new ss(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:ge.None,curlyParsingType:vn.AsObject},this.rawToken={type:C.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:n,invalidTypes:r}){n?.some(a=>e.type===a)||r?.some(a=>e.type===a)&&this.throwError(F.InvalidExpression,t)}throwError(e,t,n=this.endMarker){let{index:r,line:a,column:s}=t,o=n.index-r-1;this.errorHandler.throwError({code:e,index:r,line:a,column:s+1,len:o})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){let t,{rawToken:n}=e,{code:r,data:a}=e;if(n){if(!r)switch(n.type){case C.EOF:r=F.UnexpectedEndOfScript;break;case C.Identifier:r=F.UnexpectedIdentifier;break;case C.NumericLiteral:r=F.UnexpectedNumber;break;case C.StringLiteral:r=F.UnexpectedString;break;case C.Template:r=F.UnexpectedTemplate}t=n.value.toString()}else t="ILLEGAL";r??(r=F.UnexpectedToken),a||(a={value:t});let s=jn(r,a);if(n){let u=n.start,l=n.lineNumber,f=n.start-n.lineStart+1;return new Lt({code:r,index:u,line:l,column:f,len:n.end-n.start-1,data:a,description:s})}let{index:o,line:i}=this.endMarker;return new Lt({code:r,index:o,line:i,column:this.endMarker.column+1,data:a,description:s})}throwUnexpectedToken(e={}){throw e.rawToken??(e.rawToken=this.rawToken),this.unexpectedTokenError(e)}collectComments(e){let{commentHandler:t}=this;!t||!e.length||e.forEach(n=>{let r={type:n.multiLine?A.BlockComment:A.LineComment,value:this.getSourceValue(n),range:n.range,loc:n.loc};t.collectComment(r)})}peekAhead(e){let t=()=>(this.scanner.scanComments(),this.scanner.lex()),n=this.scanner.saveState(),r=e.call(this,t);return this.scanner.restoreState(n),r}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:Yo[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;let e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==C.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate??this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){let t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:F.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==C.Keyword||this.rawToken.value.toLowerCase()!==e.toString()?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==C.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===C.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===C.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===C.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if(typeof e=="string"&&(e=e.split("")),this.rawToken.type===C.Punctuator&&e.length)return e.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(e){let t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let n=e.call(this);return this.context.isAssignmentTarget=t,n}inheritCoverGrammar(e){var t;let n=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let r=e.call(this);return(t=this.context).isAssignmentTarget&&(t.isAssignmentTarget=n),r}withBlockContext(e,t){let n=this.context.blockContext;this.context.blockContext|=e;let r=this.context.curlyParsingType;this.context.curlyParsingType=vn.Automatic;let a=t.call(this);return this.context.blockContext=n,this.context.curlyParsingType=r,a}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator){if(this.rawToken.type===C.EOF||this.matchPunctuator("}"))return this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column);this.throwUnexpectedToken({rawToken:this.rawToken})}}parsePrimaryExpression(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case C.Identifier:return this.readNextRawToken(),this.finalize({type:A.Identifier,name:t.value,...this.getItemLocation(e)});case C.NumericLiteral:case C.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:typeof t.value=="string",...this.getItemLocation(e)});case C.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value.toLowerCase()===Ht.True,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case C.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:null,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case C.Template:return this.parseTemplateLiteral();case C.Punctuator:switch(t.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case"[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case"{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case C.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){let e=this.captureStartMarker();this.expectPunctuator("[");let t=[];for(;!this.matchPunctuator("]");){let n=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(F.InvalidExpression,n)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:A.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case C.StringLiteral:return this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case C.Identifier:case C.BooleanLiteral:case C.NullLiteral:case C.Keyword:return this.readNextRawToken(),this.finalize({type:A.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(F.KeyMustBeString,e)}}parseObjectProperty(){let e=this.rawToken,t=this.captureStartMarker(),n=this.parseObjectPropertyKey(),r=!1,a=null;return this.matchPunctuator(":")?(this.readNextRawToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):e.type===C.Identifier?(r=!0,a=this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:A.Property,kind:"init",key:n,value:a,shorthand:r,...this.getItemLocation(t)})}parseObjectExpression(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:A.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){let t=this.rawToken;t.type!==C.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:F.InvalidTemplateHead,rawToken:t});let n=this.captureStartMarker();this.readNextRawToken();let{value:r,cooked:a,tail:s}=t,o=this.finalize({type:A.TemplateElement,value:{raw:r,cooked:a},tail:s,...this.getItemLocation(n)});return o.loc.start.column+=1,o.loc.end.column-=s?1:2,o}parseTemplateLiteral(){let e=this.captureStartMarker(),t=[],n=[],r=this.parseTemplateElement(!0);for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize({type:A.TemplateLiteral,quasis:n,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");let e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");let e=[];if(!this.matchPunctuator(")"))for(;;){let t=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){let e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==C.NullLiteral&&e.type!==C.Identifier&&e.type!==C.Keyword&&e.type!==C.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){let e,t=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)),r=this.captureStartMarker();for(;e=this.getMatchingPunctuator("([.");)switch(e){case"(":{this.context.isAssignmentTarget=!1,n.type!==A.Identifier&&n.type!==A.MemberExpression&&this.throwError(F.IdentiferExpected,t,r);let a=this.parseArguments();n=this.finalize({type:A.CallExpression,callee:n,arguments:a,...this.getItemLocation(t)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");let a=this.isolateCoverGrammar(()=>this.parseExpression());this.expectPunctuator("]"),n=this.finalize({type:A.MemberExpression,computed:!0,object:n,property:a,...this.getItemLocation(t)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");let a=this.parseMemberName();n=this.finalize({type:A.MemberExpression,computed:!1,object:n,property:a,...this.getItemLocation(t)});continue}}return n}parseUpdateExpression(){let e=this.captureStartMarker(),t=this.getMatchingPunctuator(Zn);if(t){this.readNextRawToken();let s=this.captureStartMarker(),o=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return o.type!==A.Identifier&&o.type!==A.MemberExpression&&o.type!==A.CallExpression&&this.throwError(F.InvalidExpression,s),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:A.UpdateExpression,operator:t,argument:o,prefix:!0,...this.getItemLocation(e)})}let n=this.captureStartMarker(),r=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this)),a=this.captureStartMarker();return this.hasLineTerminator||(t=this.getMatchingPunctuator(Zn),!t)?r:(r.type!==A.Identifier&&r.type!==A.MemberExpression&&this.throwError(F.InvalidExpression,n,a),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:A.UpdateExpression,operator:t,argument:r,prefix:!1,...this.getItemLocation(e)}))}parseUnaryExpression(){let e=this.getMatchingPunctuator(Ai);if(e){let t=this.captureStartMarker();this.readNextRawToken();let n=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:A.UnaryExpression,operator:e,argument:n,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){let e=this.rawToken,t=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));if(this.rawToken.type!==C.Punctuator)return t;let n=this.rawToken.value,r=Or(n);if(r===0)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;let a=[e,this.rawToken],s=t,o=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)),i=[s,n,o],u=[r];for(;this.rawToken.type===C.Punctuator&&(r=Or(this.rawToken.value))>0;){for(;i.length>2&&r<=u[u.length-1];){o=i.pop();let d=i.pop();u.pop(),s=i.pop(),a.pop();let p=a[a.length-1],g=Lr(p,p.lineStart);i.push(this.finalize(this.createBinaryOrLogicalExpression(g,d,s,o)))}i.push(this.rawToken.value),u.push(r),a.push(this.rawToken),this.readNextRawToken(),i.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}let l=i.length-1;t=i[l];let f=a.pop();for(;l>1;){let d=a.pop();if(!d)break;let p=f?.lineStart,g=Lr(d,p),y=i[l-1];t=this.finalize(this.createBinaryOrLogicalExpression(g,y,i[l-2],t)),l-=2,f=d}return t}createBinaryOrLogicalExpression(e,t,n,r){let a=Ei.includes(t)?A.LogicalExpression:A.BinaryExpression;return a===A.BinaryExpression||((n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,...Pr(n)),(r.type===A.AssignmentExpression||r.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,...Pr(n))),{type:a,operator:t,left:n,right:r,...this.getItemLocation(e)}}parseAssignmentExpression(){let e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this)),n=this.captureStartMarker(),r=this.getMatchingPunctuator(Ci);if(!r)return t;t.type!==A.Identifier&&t.type!==A.MemberExpression&&this.throwError(F.InvalidExpression,e,n),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();let a=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:A.AssignmentExpression,left:t,operator:r,right:a,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(e){let t=[];for(;this.rawToken.type!==C.EOF&&!this.matchPunctuator(e);){let n=this.parseStatementListItem();ns(n)||t.push(n)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(z.Function)?this.parseFunctionDeclaration():this.matchKeyword(z.Export)?this.parseExportDeclaration():this.matchKeyword(z.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:A.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){let e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:A.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===vn.AsObject||this.peekAhead(e=>{let t=e();return!(t.type!==C.Identifier&&t.type!==C.StringLiteral||(t=e(),t.type!==C.Punctuator||t.value!==":"))})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){let e=this.rawToken;if(e.type!==C.Identifier)return null;let t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){let e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:F.IdentiferExpected});let n=null;if(this.matchPunctuator("=")){this.readNextRawToken();let r=this.rawToken;try{n=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:r,code:F.InvalidVariableAssignment})}}return this.finalize({type:A.VariableDeclarator,id:t,init:n,...this.getItemLocation(e)})}parseVariableDeclarationList(){let e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){let e=this.captureStartMarker();this.expectKeyword(z.Var);let t=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:A.VariableDeclaration,declarations:t,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){let e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:A.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){let e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:A.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(ge.IfClause,this.parseStatement.bind(this))}parseIfStatement(){let e=this.captureStartMarker();this.expectKeyword(z.If),this.expectPunctuator("(");let t=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,t,r);let a=this.parseIfClause(),s=null;return this.matchKeyword(z.Else)&&(this.readNextRawToken(),s=this.parseIfClause()),this.finalize({type:A.IfStatement,test:n,consequent:a,alternate:s,...this.getItemLocation(e)})}parseWhileStatement(){let e=this.captureStartMarker();this.expectKeyword(z.While),this.expectPunctuator("(");let t=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,t,r);let a=this.withBlockContext(ge.WhileLoop,this.parseStatement.bind(this));return this.finalize({type:A.WhileStatement,test:n,body:a,...this.getItemLocation(e)})}parseForStatement(){let e=null,t=null,n=null,r=null,a=null,s=this.captureStartMarker();if(this.expectKeyword(z.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(z.Var)){let i=this.captureStartMarker();this.readNextRawToken();let u=this.parseVariableDeclarationList();u.length===1&&this.matchKeyword(z.In)?(u[0].init&&this.throwError(F.ForInOfLoopInitializer,i),r=this.finalize({type:A.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(i)}),this.readNextRawToken(),a=this.parseExpression()):(this.matchKeyword(z.In)&&this.throwError(F.InvalidLeftHandSideInForIn,i),e=this.finalize({type:A.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(i)}),this.expectPunctuator(";"))}else{let i=this.context.isAssignmentTarget,u=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this)),this.matchKeyword(z.In)?(this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInForIn,u),e.type!==A.Identifier&&this.throwError(F.InvalidLeftHandSideInForIn,u),this.readNextRawToken(),r=e,a=this.parseExpression(),e=null):(this.context.isAssignmentTarget=i,this.expectPunctuator(";"))}r||(this.matchPunctuator(";")||(t=this.isolateCoverGrammar(this.parseExpression.bind(this))),this.expectPunctuator(";"),this.matchPunctuator(")")||(n=this.isolateCoverGrammar(this.parseExpression.bind(this)))),this.expectPunctuator(")");let o=this.withBlockContext(ge.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement.bind(this)));return r&&a?this.finalize({type:A.ForInStatement,left:r,right:a,body:o,...this.getItemLocation(s)}):this.finalize({type:A.ForStatement,init:e,test:t,update:n,body:o,...this.getItemLocation(s)})}parseContinueStatement(){let e=this.captureStartMarker();return this.expectKeyword(z.Continue),this.consumeSemicolon(),this.finalize({type:A.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){let e=this.captureStartMarker();return this.expectKeyword(z.Break),this.consumeSemicolon(),this.finalize({type:A.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){let e=this.captureStartMarker();this.expectKeyword(z.Return);let t=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||this.rawToken.type===C.EOF)&&this.rawToken.type!==C.StringLiteral&&this.rawToken.type!==C.Template?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:A.ReturnStatement,argument:t,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case C.BooleanLiteral:case C.NullLiteral:case C.NumericLiteral:case C.StringLiteral:case C.Template:case C.Identifier:return this.parseExpressionStatement();case C.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case C.Keyword:switch(this.rawToken.value.toLowerCase()){case z.Break:return this.parseBreakStatement();case z.Continue:return this.parseContinueStatement();case z.For:return this.parseForStatement();case z.Function:return this.parseFunctionDeclaration();case z.If:return this.parseIfStatement();case z.Return:return this.parseReturnStatement();case z.Var:return this.parseVariableDeclaration();case z.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){let e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==C.EOF;){let t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:F.IdentiferExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&ge.Function)===ge.Function&&this.throwUnexpectedToken({code:F.NoFunctionInsideFunction}),((this.context.blockContext&ge.WhileLoop)===ge.WhileLoop||(this.context.blockContext&ge.IfClause)===ge.IfClause)&&this.throwUnexpectedToken({code:F.NoFunctionInsideBlock});let e=this.captureStartMarker();this.expectKeyword(z.Function);let t=this.parseIdentifier();t||this.throwUnexpectedToken({code:F.InvalidFunctionIdentifier});let n=this.parseFormalParameters(),r=this.context.blockContext;this.context.blockContext|=ge.Function;let a=this.parseBlock();return this.context.blockContext=r,this.finalize({type:A.FunctionDeclaration,id:t,params:n,body:a,...this.getItemLocation(e)})}parseScript(){let e=this.captureStartMarker(),t=this.parseStatements(),n=this.finalize({type:A.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(n.tokens=this.tokens),this.options.tolerant&&(n.errors=this.errorHandler.errors),n}parseExportDeclaration(){this.context.blockContext!==ge.None&&this.throwUnexpectedToken({code:F.ModuleExportRootOnly});let e=null,t=this.captureStartMarker();return this.expectKeyword(z.Export),this.matchKeyword(z.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:F.InvalidExpression}),this.finalize({type:A.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(t)})}parseModuleSpecifier(){let e=this.captureStartMarker(),t=this.rawToken;if(t.type===C.StringLiteral)return this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(F.InvalidModuleUri,e)}parseDefaultSpecifier(){let e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:F.IdentiferExpected}),this.finalize({type:A.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==ge.None&&this.throwUnexpectedToken({code:F.ModuleImportRootOnly});let e=this.captureStartMarker();this.expectKeyword(z.Import);let t=this.parseDefaultSpecifier();this.expectContextualKeyword(z.From);let n=this.parseModuleSpecifier();return this.finalize({type:A.ImportDeclaration,specifiers:[t],source:n,...this.getItemLocation(e)})}};function ls(e,t,n){return new us(e,t,n).parseScript()}function en(e,t=[]){const n=ls(e);if(n.body===null||n.body===void 0)throw new Lt({index:0,line:0,column:0,data:null,description:"",code:F.InvalidExpression});return n.loadedModules={},Ut(n,t),n}class tn{constructor(t){const n=this;n._keys=[],n._values=[],n.length=0,t&&t.forEach(r=>{n.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((t,n)=>[t,this._values[n]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(t){return this._keys.includes(t)}get(t){const n=this._keys.indexOf(t);return n>-1?this._values[n]:null}deepGet(t){if(!t?.length)return null;const n=(r,a)=>r==null?null:a.length?n(r instanceof tn?r.get(a[0]):r[a[0]],a.slice(1)):r;return n(this.get(t[0]),t.slice(1))}set(t,n){const r=this,a=this._keys.indexOf(t);return a>-1?r._values[a]=n:(r._keys.push(t),r._values.push(n),r.length=r._values.length),this}sortedSet(t,n,r,a){const s=this,o=this._keys.length,i=r||0,u=a!==void 0?a:o-1;if(o===0)return s._keys.push(t),s._values.push(n),s;if(t===this._keys[i])return this._values.splice(i,0,n),this;if(t===this._keys[u])return this._values.splice(u,0,n),this;if(t>this._keys[u])return this._keys.splice(u+1,0,t),this._values.splice(u+1,0,n),this;if(t=u)return this;const l=i+Math.floor((u-i)/2);return tthis._keys[l]?this.sortedSet(t,n,l+1,u):this}size(){return this.length}clear(){const t=this;return t._keys.length=t.length=t._values.length=0,this}delete(t){const n=this,r=n._keys.indexOf(t);return r>-1&&(n._keys.splice(r,1),n._values.splice(r,1),n.length=n._keys.length,!0)}forEach(t){this._keys.forEach((n,r)=>{t(this._values[r],n,r)})}map(t){return this.keys().map((n,r)=>t(this._values[r],n,r))}filter(t){const n=this;return n._keys.forEach((r,a)=>{t(n._values[a],r,a)===!1&&n.delete(r)}),this}clone(){return new tn(this.entries())}}class Me{constructor(t=20){this._maxEntries=t,this._values=new tn}delete(t){this._values.has(t)&&this._values.delete(t)}get(t){let n=null;return this._values.has(t)&&(n=this._values.get(t),this._values.delete(t),this._values.set(t,n)),n}put(t,n){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(t,n)}}class cs{constructor(t=20){this._maxEntries=t,this._cache=new Me(this._maxEntries),this._layerMetadata=new Me(this._maxEntries),this._serviceMetadata=new Me(this._maxEntries),this._portalItems=new Me(this._maxEntries),this._portalItemLayers=new Me(this._maxEntries)}clear(){this._cache=new Me(this._maxEntries),this._layerMetadata=new Me(this._maxEntries),this._serviceMetadata=new Me(this._maxEntries),this._portalItems=new Me(this._maxEntries),this._portalItemLayers=new Me(this._maxEntries)}addToCache(t,n){this._cache.put(t,n)}removeFromCache(t){this._cache.delete(t)}getFromCache(t){return this._cache.get(t)}getCachedLayerMetadata(t){return this._layerMetadata.get(t)}setCachedLayerMetadata(t,n){this._layerMetadata.put(t,n)}removeCachedLayerMetadata(t,n){this._layerMetadata.get(t)===n&&this._layerMetadata.delete(t)}getCachedServiceMetadata(t){return this._serviceMetadata.get(t)}setCachedServiceMetadata(t,n){this._serviceMetadata.put(t,n)}removeCachedServiceMetadata(t,n){this._serviceMetadata.get(t)===n&&this._serviceMetadata.delete(t)}getCachedPortalItem(t,n){return this._portalItems.get(`${n}:${t}`)}setCachedPortalItem(t,n,r){this._portalItems.put(`${n}:${t}`,r)}removeCachedPortalItem(t,n,r){const a=`${n}:${t}`;this._portalItems.get(a)===r&&this._portalItems.delete(a)}getCachedPortalItemLayer(t,n){return this._portalItemLayers.get(`${n}:${t}`)}setCachedPortalItemLayer(t,n,r){this._portalItemLayers.put(`${n}:${t}`,r)}removeCachedPortalItemLayer(t,n,r){const a=`${n}:${t}`;this._portalItemLayers.get(a)===r&&this._portalItemLayers.delete(a)}}class me{constructor(t){this.portalUri=t}normalizeModuleUri(t){const n=/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([?|/].*)?$/gi,r=/(?.+)\/home\/item\.html\?id=(?.+)$/gi,a=/(?.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?.+)$/gi,s=/(?.+)\/sharing\/rest\/content\/items\/(?.+)$/gi,o=/(?.*)@(?[0-9]+\.[0-9]+\.[0-9]+)([?|/].*)?$/gi;if(t.startsWith("portal+")){let i=t.slice(7),u="",l=i,f=!1;for(const g of[r,s,a]){const y=g.exec(i);if(y!==null){const b=y.groups;l=b.itemid,u=b.portalurl,f=!0;break}}if(f===!1){if(!n.test(i))throw new Dn(gn.UnsupportedUriProtocol,{uri:t});l=i,u=this.portalUri}l.includes("/")&&(l=l.split("/")[0]),l.includes("?")&&(l=l.split("?")[0]);let d="current";const p=o.exec(l);if(p!==null){const g=p.groups;l=g.itemid,d=g.versionstring}return i=new Wn({url:u}).restUrl+"/content/items/"+l+"/resources/"+d+".arc",{url:i,scheme:"portal",uri:"PO:"+i}}if(t.startsWith("mock")){if(t==="mock")return{url:"",scheme:"mock",data:` - export var hello = 1; - export function helloWorld() { - return "Hello World " + hello; - } - `,uri:"mock"};const i=t.replace("mock:","");if(me.mocks[i]!==void 0)return{url:"",scheme:"mock",data:me.mocks[i],uri:t}}throw new Dn(gn.UnrecognizedUri,{uri:t})}async fetchModule(t){const n=me.cachedModules.getFromCache(t.uri);if(n)return n;const r=this.fetchSource(t);me.cachedModules.addToCache(t.uri,r);let a=null;try{a=await r}catch(s){throw me.cachedModules.removeFromCache(t.uri),s}return a}async fetchSource(t){if(t.scheme==="portal"){const n=await ea(t.url,{responseType:"text",query:{}});if(n.data)return en(n.data,[])}if(t.scheme==="mock")return en(t.data??"",[]);throw new Dn(gn.UnsupportedUriProtocol)}static create(t){return new me(t)}static getDefault(){return this._default??(me._default=me._moduleResolverFactory())}static set moduleResolverClass(t){this._moduleResolverFactory=t,this._default=null}}me.mocks={},me.cachedModules=new cs(30),me._default=null,me._moduleResolverFactory=()=>{const e=Wn.getDefault();return new me(e.url)};let hs=class extends Xr{constructor(e,t){super(),this.definition=e,this.context=t}createFunction(e){return(...t)=>{const n={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(n.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,null);return Sn(this.definition,n,t,null)}}call(e,t){return Je(e,t,(n,r,a)=>{const s={spatialReference:e.spatialReference,services:e.services,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeZone:e.timeZone??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(s.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,t);return Sn(this.definition,s,a,t)})}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{const i={spatialReference:e.spatialReference,globalScope:n.globalScope,services:e.services,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r)),Kt(Sn(this.definition,i,o,t),n,r)})}},gt=class extends Kn{constructor(e){super(),this.source=e}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=M(this.executingContext,t.node),t.valueset=!0),Y(t.value)&&!(t.value instanceof ft)){const n=new ft;n.fn=t.value,n.parameterEvaluator=Je,n.context=this.executingContext,t.value=n}return t.value}setGlobal(e,t){if(Y(t))throw new h(null,c.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}loadModule(e){let t=e.spatialReference;t==null&&(t=new Pt({wkid:102100})),this.moduleScope=Bi({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,globalScope:this.moduleScope,localScope:null,libraryResolver:new on(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:e.services,console:e.console??_i,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},er(this.executingContext,this.source.syntax)}};function ds(e,t){const n=[];for(let r=0;r=a.length)throw new h(e,c.OutOfBounds,t);n=m(a[s]),a[s]=t.operator==="++"?n+1:n-1}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidParameter,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);n=m(a.global(s)),a.setGlobal(s,t.operator==="++"?n+1:n-1)}return t.prefix===!1?n:t.operator==="++"?n+1:n-1}const r=$(t.argument);if(e.localScope!=null&&e.localScope[r]!==void 0)return n=m(e.localScope[r].value),e.localScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;if(e.globalScope[r]!==void 0)return n=m(e.globalScope[r].value),e.globalScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;throw new h(e,c.InvalidIdentifier,t)}function Ge(e,t,n,r,a){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(a,c.UnsupportedOperator,r)}}function ws(e,t){if(t.left.type==="MemberExpression"){const a=M(e,t.left.object);let s;if(t.left.computed===!0)s=M(e,t.left.property);else{if(t.left.property.type!=="Identifier")throw new h(e,c.InvalidIdentifier,t);s=t.left.property.name}const o=M(e,t.right);if(_(a)){if(!W(s))throw new h(e,c.ArrayAccessorMustBeNumber,t);if(s<0&&(s=a.length+s),s<0||s>a.length)throw new h(e,c.OutOfBounds,t);if(s===a.length){if(t.operator!=="=")throw new h(e,c.OutOfBounds,t);a[s]=Ge(o,t.operator,a[s],t,e)}else a[s]=Ge(o,t.operator,a[s],t,e)}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidIdentifier,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);a.setGlobal(s,Ge(o,t.operator,a.global(s),t,e))}return I}const n=$(t.left),r=M(e,t.right);if(e.localScope!=null&&e.localScope[n]!==void 0)return e.localScope[n]={value:Ge(r,t.operator,e.localScope[n].value,t,e),valueset:!0,node:t.right},I;if(e.globalScope[n]!==void 0)return e.globalScope[n]={value:Ge(r,t.operator,e.globalScope[n].value,t,e),valueset:!0,node:t.right},I;throw new h(e,c.InvalidIdentifier,t)}function xs(e,t){const n=M(e,t.expression);return n===I?I:new an(n)}function Fs(e,t){const n=M(e,t.test);if(n===!0)return ke(e,t.consequent);if(n===!1)return t.alternate!==null?ke(e,t.alternate):I;throw new h(e,c.BooleanConditionRequired,t)}function er(e,t){let n=I;for(let r=0;r=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(S(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(P(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new h(e,c.OutOfBounds,t);return n.get(r)}throw new h(e,c.InvalidMemberAccessKey,t)}throw new h(e,c.InvalidMemberAccessKey,t)}catch(n){throw n}}function Is(e,t){try{const n=M(e,t.argument);if(X(n)){if(t.operator==="!")return!n;if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);if(t.operator==="~")return~m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}if(t.operator==="~")return~m(n);if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}catch(n){throw n}}function ks(e,t){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return qr(m(n),m(r),t.operator);case"==":return Pe(n,r);case"!=":return!Pe(n,r);case"<":case">":case"<=":case">=":return Wr(n,r,t.operator);case"+":return S(n)||S(r)?E(n)+E(r):m(n)+m(r);case"-":return m(n)-m(r);case"*":return m(n)*m(r);case"/":return m(n)/m(r);case"%":return m(n)%m(r);default:throw new h(e,c.UnsupportedOperator,t)}}catch(n){throw n}}function _s(e,t){try{const n=M(e,t.left);if(X(n))switch(t.operator){case"||":{if(n===!0)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}case"&&":{if(n===!1)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}default:throw new h(e,c.LogicExpressionOrAnd,t)}throw new h(e,c.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function Ts(e,t,n){if(Y(e))throw new h(t,c.NoFunctionInTemplateLiteral,n);return e}function Ms(e,t){let n="",r=0;for(const a of t.quasis)n+=a.value?a.value.cooked:"",a.tail===!1&&(n+=t.expressions[r]?E(Ts(M(e,t.expressions[r]),e,t)):"",r++);return n}function Si(e,t){try{const n=$(t);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}throw new h(e,c.InvalidIdentifier,t)}catch(n){throw n}}function Ns(e,t){try{if(t.callee.type==="MemberExpression"){const r=M(e,t.callee.object);if(!(r instanceof gt))throw new h(e,c.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:M(e,t.callee.property);if(!r.hasGlobal(a))throw new h(e,c.FunctionNotFound,t);const s=r.global(a);if(!Y(s))throw new h(e,c.CallNonFunction,t);return s.call(e,t)}if(t.callee.type!=="Identifier")throw new h(e,c.FunctionNotFound,t);const n=$(t.callee);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}throw new h(e,c.FunctionNotFound,t)}catch(n){throw n}}const ue={};function Ii(e,t,n,r){try{const a=t.arguments,s=M(e,a[n]);if(Pe(s,r))return M(e,a[n+1]);{const o=a.length-n;return o===1?M(e,a[n]):o===2?null:o===3?M(e,a[n+2]):Ii(e,t,n+2,r)}}catch(a){throw a}}function ki(e,t,n,r){try{const a=t.arguments;if(r===!0)return M(e,a[n+1]);if(a.length-n===3)return M(e,a[n+2]);{const s=M(e,a[n+2]);if(X(s)===!1)throw new h(e,c.BooleanConditionRequired,a[n+2]);return ki(e,t,n+2,s)}}catch(a){throw a}}function Sn(e,t,n,r){try{const a=e.body;if(n.length!==e.params.length)throw new h(t,c.WrongNumberOfParameters,r);if(t.localScope!=null)for(let o=0;oimport("./geometryEngine-CdPoFSE4-BRF8cFYX.js"),__vite__mapDeps([21,2,3,22,23,24]),import.meta.url);return Ni=!0,Ha(e),!0}let kn=null;function ir(){return kn!==null||(kn=Oi()),kn}async function Oi(){await Ko(),Be=await je(()=>import("./arcadeAsyncRuntime-B-LnqhTo-MEE-Bvjt.js"),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10,11,12,0,13,14,15,16,17,18,19,20]),import.meta.url);for(const e of Jn)Be.extend(e),rt(e,"async");return Jn=null,!0}function Ui(){return Mi}function zi(){return!!Be}function Gi(){return Ni}let Bn=null;function ar(){return Bn||(Bn=Zi(),Bn)}async function Zi(){await ir();const[e,t,n,r,a,s]=await Promise.all([je(()=>import("./featureSetUtils-wd4FcF3A-Dl4vKkUg.js"),__vite__mapDeps([26,2,3,1,4,5,6,7,8,9,10,11,12,27,28,14,15,19,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,20,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,16,17,18]),import.meta.url).then(o=>o.g),je(()=>import("./featuresetbase-BDDCCC0O-F4vb-x5f.js"),__vite__mapDeps([103,4,2,3,5,1,6,7,8,9,10,11,12,26,27,28,14,15,19,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,20,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,16,17,18,13]),import.meta.url),je(()=>import("./featuresetgeom-BftbGgg3-BYUUChZd.js"),__vite__mapDeps([104,1,2,3,4,5,6,7,8,9,10,11,12,27,28,14,15,19,16,17,18,20]),import.meta.url),je(()=>import("./featuresetstats-CY6YJ8Jt-DuADBO37.js"),__vite__mapDeps([105,4,2,3,5,1,6,7,8,9,10,11,12,28,16,17,18,19,20]),import.meta.url),je(()=>import("./featuresetstring-DFELZWNA-DcES9f5x.js"),__vite__mapDeps([106,1,2,3,4,5,6,7,8,9,10,11,12,16,17,18,19,20]),import.meta.url),je(()=>import("./knowledgegraph-Dt7zfNlJ-CPwlmP6C.js"),__vite__mapDeps([107,2,3,1,4,5,6,7,8,9,10,11,12,13,66,67,89,108,109,110,111,16,17,18,19,20]),import.meta.url)]);return qi=e,Be.extend([t,n,r,a,s]),rt([t,n,r,a,s],"async"),Mi=!0,!0}function ji(e,t=[]){return e.usesFeatureSet===void 0&&Ut(e,t),e.usesFeatureSet===!0}function Gs(e,t=[]){return e.isAsync===void 0&&Ut(e,t),e.isAsync===!0}function Zs(e,t){if(t){for(const n of t)if(cn(e,n))return!0;return!1}return!1}async function Vi(e,t,n=[],r=!1,a=null){return or(new Set,e,t,n,r,a)}async function or(e,t,n,r=[],a=!1,s=null){const o=typeof t=="string"?tr(t):t,i=[];return o&&(Gi()===!1&&(hn(o)||a)&&i.push(rr()),zi()===!1&&(o.isAsync===!0||n)&&i.push(ir()),Ui()===!1&&(ji(o)||Zs(o,r))&&i.push(ar())),i.length&&await Promise.all(i),await Ji(e,o,s,n,a),!0}function js(e,t=[]){return e.usesModules===void 0&&Ut(e,t),e.usesModules===!0}async function Ji(e,t,n=null,r=!1,a=!1){const s=$r(t);n===null&&s.length>0&&(n=me.getDefault()),t.loadedModules={};for(const o of s){jr(n);const i=n.normalizeModuleUri(o.source);if(e.has(i.uri))throw new h(null,c.CircularModules,null);e.add(i.uri);const u=await n.fetchModule(i);await or(e,u,r,[],a,n),e.delete(i.uri),u.isAsync&&(t.isAsync=!0),u.usesFeatureSet&&(t.usesFeatureSet=!0),u.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[o.libname]={uri:i.uri,script:u}}}function Wi(e){if(hn(e))return!0;const t=Nn(e);let n=!1;for(let r=0;r{Ur.test(o)&&(o=o.replace(Ur,""),a.push(o))});const s=a.filter(o=>o.includes("*"));return a=a.filter(o=>!s.includes(o)),t&&s.forEach(o=>{const i=new RegExp(`^${o.split(/\*+/).map(Ws).join(".*")}$`,"i");t.forEach(u=>i.test(u)?a.push(u):null)}),[...new Set(a.sort())]}function nu(e){return cn(e,"$view")}function ru(e,t){return!!e&&cn(e,t)}function iu(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new v({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function au({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=dn();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function ou({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:s}){if(e===null)return null;const o=dn();return o?o.constructFeatureSet(e,t,n,r??!0,a,s):null}function su(e){if(e?.map===null)return null;const t=dn();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function uu(e,t){return v.convertJsonToArcade(e,t)}function lu(e,t,n=[]){return Vi(e,t,n)}function cu(){return rr()}function hu(){return ar()}function du(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function fu(e){return e.declaredClass==="esri.layers.support.LabelClass"}function mu(e){return e.declaredClass==="esri.PopupTemplate"}function Hi(e,t){if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(du(n)){if(n.type==="dot-density"){const s=n.attributes?.some(o=>t(o.valueExpression));if(s)return s}const r=n.visualVariables,a=!!r&&r.some(s=>{let o=t(s.valueExpression);return s.type==="size"&&(zr(s.minSize)&&(o=o||t(s.minSize.valueExpression)),zr(s.maxSize)&&(o=o||t(s.maxSize.valueExpression))),o});return!(!("valueExpression"in n)||!t(n.valueExpression))||a}if(fu(n)){const r=n.labelExpressionInfo?.expression;return!(!r||!t(r))||!1}return!!mu(n)&&(!!n.expressionInfos&&n.expressionInfos.some(r=>t(r.expression))||Array.isArray(n.content)&&n.content.some(r=>r.type==="expression"&&t(r.expressionInfo?.expression)))}function pu(e){const t=zt(e);return!!t&&Wi(t)}function Du(e){return Hi(e,pu)}function gu(e){const t=zt(e);return!!t&&hn(t)}function yu(e){return Hi(e,gu)}function zr(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const Ru=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:v,arcade:Vs,arcadeFeature:H,convertFeatureLayerToFeatureSet:ou,convertJsonToArcade:uu,convertMapToFeatureSetCollection:su,convertServiceUrlToWorkspace:au,createExecContext:Ks,createFeature:Xs,createFunction:Hs,createSyntaxTree:zt,dependsOnView:nu,enableFeatureSetOperations:hu,enableGeometryOperations:cu,evalSyntaxTree:Ys,executeAsyncFunction:eu,executeFunction:$s,extractFieldNames:tu,getArcadeType:qs,getViewInfo:iu,hasGeometryFunctions:Du,hasGeometryOperations:yu,hasVariable:ru,loadScriptDependencies:lu,updateExecContext:Qs},Symbol.toStringTag,{value:"Module"}));export{ei as C,H as D,ai as L,ci as M,v as N,Di as X,ja as Z,on as a,mt as b,Ia as c,Za as d,$ as e,di as f,wt as g,Qa as h,Ru as i,yn as l,Xn as m,Rn as p,De as r,Mn as s,Pn as t,qa as x,Sa as y}; diff --git a/main/assets/arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js b/main/assets/arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js new file mode 100644 index 000000000..93e045aa9 --- /dev/null +++ b/main/assets/arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js @@ -0,0 +1 @@ +import{a,dH as m,dI as o,dJ as c,du as y,bX as S}from"./main-C7yV2j71.js";const v={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",knowledgegraphserver:"KnowledgeGraphServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer",videoserver:"VideoServer"},d=Object.values(v),p=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),w=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^/\\n]+)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),g=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function C(r){return p.test(r)}function f(r){if(r==null)return null;const e=a(r),t=e?.path.match(p)||e?.path.match(w);if(!t)return null;const[,s,n,l,u]=t,i=n.indexOf("/");return{title:h(i!==-1?n.slice(i+1):n),serverType:v[l.toLowerCase()],sublayer:u!=null&&u!==""?parseInt(u,10):null,url:{path:s}}}function I(r){const e=a(r).path.match(g);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function h(r){return(r=r.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+r.slice(1)}function L(r,e){const t=[];if(r){const s=f(r);s!=null&&s.title&&t.push(s.title)}if(e){const s=h(e);t.push(s)}if(t.length===2){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function j(r){let e=m(r,!0);return!!e&&(e=e.toLowerCase(),e.endsWith(".arcgis.com")&&(e.startsWith("services")||e.startsWith("tiles")||e.startsWith("features")))}function x(r,e){return r&&o(c(r,e))}function U(r){let{url:e}=r;if(!e)return{url:e};e=c(e,r.logger);const t=a(e),s=f(t.path);let n;if(s!=null)s.sublayer!=null&&r.layer.layerId==null&&(n=s.sublayer),e=s.url.path;else if(r.nonStandardUrlAllowed){const l=I(t.path);l!=null&&(e=l.serviceUrl,n=l.sublayerId)}return{url:o(e),layerId:n}}function T(r,e,t,s,n){y(e,s,"url",n),s.url&&r.layerId!=null&&(s.url=S(s.url,t,r.layerId.toString()))}function W(r){if(!r)return!1;const e=r.toLowerCase(),t=e.includes("/services/"),s=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),l=e.includes("/wmsserver");return t&&(s||n||l)}export{L as I,j as L,T,W as U,C as b,f as i,x as j,I as m,h as o,U as x}; diff --git a/main/assets/arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js b/main/assets/arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js deleted file mode 100644 index ad83bb0cb..000000000 --- a/main/assets/arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js +++ /dev/null @@ -1 +0,0 @@ -import{a,dH as m,dI as o,dJ as c,du as y,bX as S}from"./main-BZaw9FpY.js";const v={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",knowledgegraphserver:"KnowledgeGraphServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer",videoserver:"VideoServer"},d=Object.values(v),p=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),w=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^/\\n]+)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),g=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function C(r){return p.test(r)}function f(r){if(r==null)return null;const e=a(r),t=e?.path.match(p)||e?.path.match(w);if(!t)return null;const[,s,n,l,u]=t,i=n.indexOf("/");return{title:h(i!==-1?n.slice(i+1):n),serverType:v[l.toLowerCase()],sublayer:u!=null&&u!==""?parseInt(u,10):null,url:{path:s}}}function I(r){const e=a(r).path.match(g);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function h(r){return(r=r.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+r.slice(1)}function L(r,e){const t=[];if(r){const s=f(r);s!=null&&s.title&&t.push(s.title)}if(e){const s=h(e);t.push(s)}if(t.length===2){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function j(r){let e=m(r,!0);return!!e&&(e=e.toLowerCase(),e.endsWith(".arcgis.com")&&(e.startsWith("services")||e.startsWith("tiles")||e.startsWith("features")))}function x(r,e){return r&&o(c(r,e))}function U(r){let{url:e}=r;if(!e)return{url:e};e=c(e,r.logger);const t=a(e),s=f(t.path);let n;if(s!=null)s.sublayer!=null&&r.layer.layerId==null&&(n=s.sublayer),e=s.url.path;else if(r.nonStandardUrlAllowed){const l=I(t.path);l!=null&&(e=l.serviceUrl,n=l.sublayerId)}return{url:o(e),layerId:n}}function T(r,e,t,s,n){y(e,s,"url",n),s.url&&r.layerId!=null&&(s.url=S(s.url,t,r.layerId.toString()))}function W(r){if(!r)return!1;const e=r.toLowerCase(),t=e.includes("/services/"),s=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),l=e.includes("/wmsserver");return t&&(s||n||l)}export{L as I,j as L,T,W as U,C as b,f as i,x as j,I as m,h as o,U as x}; diff --git a/main/assets/arcgisLayers-CL8_MH7S-B7OganfD.js b/main/assets/arcgisLayers-CL8_MH7S-B7OganfD.js deleted file mode 100644 index 6bfeaea1e..000000000 --- a/main/assets/arcgisLayers-CL8_MH7S-B7OganfD.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GroupLayer-ER-XzoYr-Dk-USe8D.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./CollectionFlattener-DkHuHn5E-D3nwGseo.js","./loadAll-e978YItg-CB-7_cng.js","./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js","./Layer-ChoECxvZ-C4wLrCej.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./BlendLayer-D1WkSmwP-UVXywJXM.js","./jsonUtils-wIllKWI4-DQ36DuUP.js","./parser-DyDJ-rlI-mkgQEqcN.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./common-CYWrYyJl-E8-sukrT.js","./OperationalLayer-B5IXiMa2-KEXCVZUA.js","./commonProperties-BtIqvFU_-Brj0aAM1.js","./ElevationInfo-yv2-9tj6-pjIBBQET.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./PortalLayer-CElnYuSQ-tfjbIq8z.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js","./fetchService-DbaKmJhP-CtznRt8p.js","./TablesMixin-C8RojhYs-DjK1Q1jj.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js","./writeUtils-D5qlLkwk-DIX6zS6N.js"])))=>i.map(i=>d[i]); -import{_ as I,o as m,gK as g,a as P,gG as v}from"./main-BZaw9FpY.js";import{i as L,m as O}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{b as T}from"./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js";import{o as p,g as d,d as C,p as U}from"./fetchService-DbaKmJhP-CtznRt8p.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";const F={FeatureLayer:!0,SceneLayer:!0};async function R(r){const{properties:l,url:e}=r,t={...l,url:e},s=await N(e,l?.customParameters),{Constructor:a,layerId:o,sourceJSON:c,parsedUrl:i,layers:u,tables:n}=s;if(u.length+n.length===0)return o!=null&&(t.layerId=o),c!=null&&(t.sourceJSON=c),new a(t);const y=new(await I(async()=>{const{default:f}=await import("./GroupLayer-ER-XzoYr-Dk-USe8D.js");return{default:f}},__vite__mapDeps([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,26,27,28]),import.meta.url)).default({title:i.title});return await _(y,s,t),y}function S(r,l){return r?r.find(({id:e})=>e===l):null}function b(r,l,e,t,s){const a={...s,layerId:l};return r!=null&&(a.url=r),e!=null&&(a.sourceJSON=e),"sublayerTitleMode"in t.prototype&&(a.sublayerTitleMode="service-name"),new t(a)}async function _(r,l,e){const t=l.sublayerConstructorProvider;for(const{id:s,serverUrl:a}of l.layers){const o=S(l.sublayerInfos,s),c=b(a,s,o,(o&&t?.(o))??l.Constructor,e);r.add(c)}if(l.tables.length){const s=await w("FeatureLayer");l.tables.forEach(({id:a,serverUrl:o})=>{const c=b(o,a,S(l.tableInfos,a),s,e);r.tables.add(c)})}}async function N(r,l){let e=L(r);if(e==null&&(e=await V(r,l)),e==null)throw new m("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:s}=e;let a;const o={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},c=t==="FeatureServer",i=t==="SceneServer",u={parsedUrl:e,Constructor:null,layerId:c||i?s??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":if(s!=null){const{type:n}=await p(r,{customParameters:l});switch(a="FeatureLayer",n){case"Catalog Layer":a="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new m("arcgis-layers:unsupported",`fromUrl() not supported for "${n}" layers`)}}else a=await x(r,l)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const n=await p(r,{customParameters:l}),{tileInfo:y,cacheType:f}=n;a=y?y?.format?.toUpperCase()!=="LERC"||f&&f.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const n=await p(e.url.path,{customParameters:l});if(a="SceneLayer",n){const y=n?.layers;if(n?.layerType==="Voxel")a="VoxelLayer";else if(y?.length){const f=y[0]?.layerType;f!=null&&v[f]!=null&&(a=v[f])}}break}case"3DTilesServer":throw new m("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(a="FeatureLayer",s!=null){const n=await p(r,{customParameters:l});u.sourceJSON=n,a=d(n.type)}break;default:a=o[t]}if(F[a]&&s==null){const n=await k(r,t,l);if(c&&(u.sublayerInfos=n.layerInfos,u.tableInfos=n.tableInfos),n.layers.length+n.tables.length!==1)u.layers=n.layers,u.tables=n.tables,c&&n.layerInfos?.length&&(u.sublayerConstructorProvider=await E(n.layerInfos));else if(c||i){const y=n.layerInfos?.[0]??n.tableInfos?.[0];if(u.layerId=n.layers[0]?.id??n.tables[0]?.id,u.sourceJSON=y,c){const f=y?.type;a=d(f)}}}return u.Constructor=await w(a),u}async function V(r,l){const e=await p(r,{customParameters:l});let t=null,s=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",s=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":h(e)?(t="SceneServer",s=e.id):e.hasOwnProperty("layers")&&h(e.layers?.[0])&&(t="SceneServer"),!t)return null;const o=s!=null?O(r):null;return{title:o!=null&&e.name||g(r),serverType:t,sublayer:s,url:{path:o!=null?o.serviceUrl:P(r).path}}}function h(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function k(r,l,e){let t,s,a=!1;switch(l){case"FeatureServer":{const i=await C(r,{customParameters:e});a=!!i.layersJSON,t=i.layersJSON||i.serviceJSON;break}case"SceneServer":{const i=await J(r,e);t=i.serviceInfo,s=i.tableServerUrl;break}default:t=await p(r,{customParameters:e})}const o=t?.layers,c=t?.tables;return{layers:o?.map(i=>({id:i.id})).reverse()||[],tables:c?.map(i=>({serverUrl:s,id:i.id})).reverse()||[],layerInfos:a?o:[],tableInfos:a?c:[]}}async function J(r,l){const e=await p(r,{customParameters:l});if(!e.layers?.[0])return{serviceInfo:e};try{const{serverUrl:t}=await T(r),s=await p(t,{customParameters:l}).catch(()=>null);return s&&(e.tables=s.tables),{serviceInfo:e,tableServerUrl:t}}catch{return{serviceInfo:e}}}async function w(r){return(0,U[r])()}async function x(r,l){return(await p(r,{customParameters:l})).tileInfo}async function E(r){if(!r.length)return;const l=new Set,e=[];for(const{type:a}of r)l.has(a)||(l.add(a),e.push(w(d(a))));const t=await Promise.all(e),s=new Map;return Array.from(l).forEach((a,o)=>{s.set(a,t[o])}),a=>s.get(a.type)}export{R as fromUrl}; diff --git a/main/assets/arcgisLayers-CL8_MH7S-DkYPKRxI.js b/main/assets/arcgisLayers-CL8_MH7S-DkYPKRxI.js new file mode 100644 index 000000000..295bcacb2 --- /dev/null +++ b/main/assets/arcgisLayers-CL8_MH7S-DkYPKRxI.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GroupLayer-ER-XzoYr-B2r6nbwd.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./CollectionFlattener-DkHuHn5E-BN4WFIND.js","./loadAll-e978YItg-NjG3VBGi.js","./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js","./Layer-ChoECxvZ--vVxyMLZ.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./BlendLayer-D1WkSmwP-D_mOfOGH.js","./jsonUtils-wIllKWI4-DRJhEzZa.js","./parser-DyDJ-rlI-CV6nO3M9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./common-CYWrYyJl-E8-sukrT.js","./OperationalLayer-B5IXiMa2-B5IUcPZ-.js","./commonProperties-BtIqvFU_-DuUske_0.js","./ElevationInfo-yv2-9tj6-CpVy5FM0.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./PortalLayer-CElnYuSQ-BV63HHSL.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js","./fetchService-DbaKmJhP-DPDp5i2e.js","./TablesMixin-C8RojhYs-CMxVrapj.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js","./writeUtils-D5qlLkwk-IaioN2Q8.js"])))=>i.map(i=>d[i]); +import{_ as I,o as m,gK as g,a as P,gG as v}from"./main-C7yV2j71.js";import{i as L,m as O}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{b as T}from"./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js";import{o as p,g as d,d as C,p as U}from"./fetchService-DbaKmJhP-DPDp5i2e.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";const F={FeatureLayer:!0,SceneLayer:!0};async function R(r){const{properties:l,url:e}=r,t={...l,url:e},s=await N(e,l?.customParameters),{Constructor:a,layerId:o,sourceJSON:c,parsedUrl:i,layers:u,tables:n}=s;if(u.length+n.length===0)return o!=null&&(t.layerId=o),c!=null&&(t.sourceJSON=c),new a(t);const y=new(await I(async()=>{const{default:f}=await import("./GroupLayer-ER-XzoYr-B2r6nbwd.js");return{default:f}},__vite__mapDeps([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,26,27,28]),import.meta.url)).default({title:i.title});return await _(y,s,t),y}function S(r,l){return r?r.find(({id:e})=>e===l):null}function b(r,l,e,t,s){const a={...s,layerId:l};return r!=null&&(a.url=r),e!=null&&(a.sourceJSON=e),"sublayerTitleMode"in t.prototype&&(a.sublayerTitleMode="service-name"),new t(a)}async function _(r,l,e){const t=l.sublayerConstructorProvider;for(const{id:s,serverUrl:a}of l.layers){const o=S(l.sublayerInfos,s),c=b(a,s,o,(o&&t?.(o))??l.Constructor,e);r.add(c)}if(l.tables.length){const s=await w("FeatureLayer");l.tables.forEach(({id:a,serverUrl:o})=>{const c=b(o,a,S(l.tableInfos,a),s,e);r.tables.add(c)})}}async function N(r,l){let e=L(r);if(e==null&&(e=await V(r,l)),e==null)throw new m("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:s}=e;let a;const o={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},c=t==="FeatureServer",i=t==="SceneServer",u={parsedUrl:e,Constructor:null,layerId:c||i?s??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":if(s!=null){const{type:n}=await p(r,{customParameters:l});switch(a="FeatureLayer",n){case"Catalog Layer":a="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new m("arcgis-layers:unsupported",`fromUrl() not supported for "${n}" layers`)}}else a=await x(r,l)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const n=await p(r,{customParameters:l}),{tileInfo:y,cacheType:f}=n;a=y?y?.format?.toUpperCase()!=="LERC"||f&&f.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const n=await p(e.url.path,{customParameters:l});if(a="SceneLayer",n){const y=n?.layers;if(n?.layerType==="Voxel")a="VoxelLayer";else if(y?.length){const f=y[0]?.layerType;f!=null&&v[f]!=null&&(a=v[f])}}break}case"3DTilesServer":throw new m("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(a="FeatureLayer",s!=null){const n=await p(r,{customParameters:l});u.sourceJSON=n,a=d(n.type)}break;default:a=o[t]}if(F[a]&&s==null){const n=await k(r,t,l);if(c&&(u.sublayerInfos=n.layerInfos,u.tableInfos=n.tableInfos),n.layers.length+n.tables.length!==1)u.layers=n.layers,u.tables=n.tables,c&&n.layerInfos?.length&&(u.sublayerConstructorProvider=await E(n.layerInfos));else if(c||i){const y=n.layerInfos?.[0]??n.tableInfos?.[0];if(u.layerId=n.layers[0]?.id??n.tables[0]?.id,u.sourceJSON=y,c){const f=y?.type;a=d(f)}}}return u.Constructor=await w(a),u}async function V(r,l){const e=await p(r,{customParameters:l});let t=null,s=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",s=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":h(e)?(t="SceneServer",s=e.id):e.hasOwnProperty("layers")&&h(e.layers?.[0])&&(t="SceneServer"),!t)return null;const o=s!=null?O(r):null;return{title:o!=null&&e.name||g(r),serverType:t,sublayer:s,url:{path:o!=null?o.serviceUrl:P(r).path}}}function h(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function k(r,l,e){let t,s,a=!1;switch(l){case"FeatureServer":{const i=await C(r,{customParameters:e});a=!!i.layersJSON,t=i.layersJSON||i.serviceJSON;break}case"SceneServer":{const i=await J(r,e);t=i.serviceInfo,s=i.tableServerUrl;break}default:t=await p(r,{customParameters:e})}const o=t?.layers,c=t?.tables;return{layers:o?.map(i=>({id:i.id})).reverse()||[],tables:c?.map(i=>({serverUrl:s,id:i.id})).reverse()||[],layerInfos:a?o:[],tableInfos:a?c:[]}}async function J(r,l){const e=await p(r,{customParameters:l});if(!e.layers?.[0])return{serviceInfo:e};try{const{serverUrl:t}=await T(r),s=await p(t,{customParameters:l}).catch(()=>null);return s&&(e.tables=s.tables),{serviceInfo:e,tableServerUrl:t}}catch{return{serviceInfo:e}}}async function w(r){return(0,U[r])()}async function x(r,l){return(await p(r,{customParameters:l})).tileInfo}async function E(r){if(!r.length)return;const l=new Set,e=[];for(const{type:a}of r)l.has(a)||(l.add(a),e.push(w(d(a))));const t=await Promise.all(e),s=new Map;return Array.from(l).forEach((a,o)=>{s.set(a,t[o])}),a=>s.get(a.type)}export{R as fromUrl}; diff --git a/main/assets/associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js b/main/assets/associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js new file mode 100644 index 000000000..d8ce9aa54 --- /dev/null +++ b/main/assets/associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js @@ -0,0 +1 @@ +import{o as c,r as j,W as u,f,V as D}from"./main-C7yV2j71.js";import{i as v}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import w from"./PortalItem-CctGdnxF-CHPkp6yW.js";async function x(e,n){const t=v(e);if(!t)throw new c("invalid-url","Invalid scene service url");const r={...n,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(r.sceneLayerItem??=await A(r),r.sceneLayerItem==null)return p(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const a=await K(r);if(!a?.url)throw new c("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=a;const s=await p(a.url,r);return s.portalItem=a,s}async function A(e){const n=(await h(e)).serviceItemId;if(!n)return null;const t=new w({id:n,apiKey:e.apiKey}),r=await b(e);r!=null&&(t.portal=new j({url:r}));try{return await t.load({signal:e.signal})}catch(a){return u(a),null}}async function h(e){if(e.rootDocument)return e.rootDocument;const n={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await f(e.sceneServerUrl,n);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function b(e){const n=D?.findServerInfo(e.sceneServerUrl);if(n?.owningSystemUrl)return n.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await f(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(r)return r}catch(r){u(r)}return null}async function p(e,n){const t=v(e);if(!t)throw new c("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,a=n.layerId;if(a==null)return{serverUrl:r};const s=h(n),y=n.featureServiceItem?await n.featureServiceItem.fetchData("json"):null,g=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=o=>{const U={query:{f:"json",...g},responseType:"json",authMode:o,signal:n.signal};return f(r,U)},S=d("anonymous").catch(()=>d("no-prompt")),[m,I]=await Promise.all([S,s]),l=I?.layers,i=m.data&&m.data.layers;if(!Array.isArray(i))throw new Error("expected layers array");if(Array.isArray(l)){for(let o=0;oa.type==="Feature Service")||null;if(!t)return null;const r=new w({portal:t.portal,id:t.id});return await r.load(),r}catch(t){return u(t),null}}export{x as b}; diff --git a/main/assets/associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js b/main/assets/associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js deleted file mode 100644 index d68d00475..000000000 --- a/main/assets/associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js +++ /dev/null @@ -1 +0,0 @@ -import{o as c,r as j,W as u,f,V as D}from"./main-BZaw9FpY.js";import{i as v}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import w from"./PortalItem-CctGdnxF-DNdsi_Qx.js";async function x(e,n){const t=v(e);if(!t)throw new c("invalid-url","Invalid scene service url");const r={...n,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(r.sceneLayerItem??=await A(r),r.sceneLayerItem==null)return p(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const a=await K(r);if(!a?.url)throw new c("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=a;const s=await p(a.url,r);return s.portalItem=a,s}async function A(e){const n=(await h(e)).serviceItemId;if(!n)return null;const t=new w({id:n,apiKey:e.apiKey}),r=await b(e);r!=null&&(t.portal=new j({url:r}));try{return await t.load({signal:e.signal})}catch(a){return u(a),null}}async function h(e){if(e.rootDocument)return e.rootDocument;const n={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await f(e.sceneServerUrl,n);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function b(e){const n=D?.findServerInfo(e.sceneServerUrl);if(n?.owningSystemUrl)return n.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await f(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(r)return r}catch(r){u(r)}return null}async function p(e,n){const t=v(e);if(!t)throw new c("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,a=n.layerId;if(a==null)return{serverUrl:r};const s=h(n),y=n.featureServiceItem?await n.featureServiceItem.fetchData("json"):null,g=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=o=>{const U={query:{f:"json",...g},responseType:"json",authMode:o,signal:n.signal};return f(r,U)},S=d("anonymous").catch(()=>d("no-prompt")),[m,I]=await Promise.all([S,s]),l=I?.layers,i=m.data&&m.data.layers;if(!Array.isArray(i))throw new Error("expected layers array");if(Array.isArray(l)){for(let o=0;oa.type==="Feature Service")||null;if(!t)return null;const r=new w({portal:t.portal,id:t.id});return await r.load(),r}catch(t){return u(t),null}}export{x as b}; diff --git a/main/assets/boundedPlane-DlvE0eNx-BetNH2zh.js b/main/assets/boundedPlane-DlvE0eNx-BetNH2zh.js deleted file mode 100644 index 1aee139b5..000000000 --- a/main/assets/boundedPlane-DlvE0eNx-BetNH2zh.js +++ /dev/null @@ -1 +0,0 @@ -import{hZ as w,i8 as E,cS as rt,ha as st,i9 as _,dU as N,a1 as at}from"./main-BZaw9FpY.js";import{X as O,p as ct}from"./sphere-BenPORjV-CgNvGf8s.js";import{z as ut,G as gt,K as bt}from"./mat4-DX7gBViE-CQMXDC3Z.js";import{t as L}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as u,L as l,j as p,_ as M,g as ft,b as I,W as lt,y as h,r as z,R as A,Y as m,l as D,v as G}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{u as pt,j as H,x as dt}from"./lineSegment-CcqvCARM-D_SdPttv.js";import{y,a as mt,j as ht,T as F,f as s,H as It,M as $t,S as Nt,m as Mt,g as X,D as Pt,l as P,N as T,h as Tt}from"./plane-Dt8R0KeE-fuXvBrPY.js";const Y=()=>at.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class xt{constructor(){this.plane=y(),this.origin=N(),this.basis1=N(),this.basis2=N()}}const yt=xt;function $(t=ot){return{plane:y(t.plane),origin:E(t.origin),basis1:E(t.basis1),basis2:E(t.basis2)}}function St(t,n,i){const e=Dt.get();return e.origin=t,e.basis1=n,e.basis2=i,e.plane=mt(0,0,0,0),j(e),e}function S(t,n=$()){return U(t.origin,t.basis1,t.basis2,n)}function jt(t,n){u(n.origin,t.origin),u(n.basis1,t.basis1),u(n.basis2,t.basis2),ht(n.plane,t.plane)}function U(t,n,i,e=$()){return u(e.origin,t),u(e.basis1,n),u(e.basis2,i),j(e),Ct(e,"fromValues()"),e}function j(t){F(t.basis2,t.basis1,t.origin,t.plane)}function Z(t,n,i){t!==i&&S(t,i);const e=l(s.get(),f(t),n);return p(i.origin,i.origin,e),i.plane[3]-=n,i}function vt(t,n,i){return W(n,i),Z(i,B(t,t.origin),i),i}function wt(t,n){const i=t.basis1[0],e=t.basis2[1],[o,r]=t.origin;return rt(o-i,r-e,o+i,r+e,n)}function W(t,n=$()){const i=(t[2]-t[0])/2,e=(t[3]-t[1])/2;return M(n.origin,t[0]+i,t[1]+e,0),M(n.basis1,i,0,0),M(n.basis2,0,e,0),It(0,0,1,0,n.plane),n}function R(t,n,i){return!!$t(t.plane,n,i)&&nt(t,i)}function Et(t,n,i){if(R(t,n,i))return i;const e=Q(t,n,s.get());return p(i,n.origin,l(s.get(),n.direction,ft(n.origin,e)/I(n.direction))),i}function Q(t,n,i){const e=x.get();et(t,n,e,x.get());let o=Number.POSITIVE_INFINITY;for(const r of k){const a=C(t,r,v.get()),g=s.get();if(Nt(e,a,g)){const c=lt(s.get(),n.origin,g),b=Math.abs(st(h(n.direction,c)));bi&&(i=r)}return Math.sqrt(i)}function Vt(t,n){return X(t.plane,n)&&nt(t,n)}function Ft(t,n,i,e){return Bt(t,i,e)}function B(t,n){const i=-t.plane[3];return P(f(t),n)-i}function Ot(t,n,i,e){const o=B(t,n),r=l(kt,f(t),i-o);return p(e,n,r),e}function zt(t,n){return A(t.basis1,n.basis1)&&A(t.basis2,n.basis2)&&A(t.origin,n.origin)}function Rt(t,n,i){return t!==i&&S(t,i),ut(d,n),gt(d,d),m(i.basis1,t.basis1,d),m(i.basis2,t.basis2,d),m(T(i.plane),T(t.plane),d),m(i.origin,t.origin,n),Tt(i.plane,i.plane,i.origin),i}function qt(t,n,i,e){return t!==e&&S(t,e),bt(V,n,i),m(e.basis1,t.basis1,V),m(e.basis2,t.basis2,V),j(e),e}function f(t){return T(t.plane)}function Bt(t,n,i){switch(n){case _.X:u(i,t.basis1),D(i,i);break;case _.Y:u(i,t.basis2),D(i,i);break;case _.Z:u(i,f(t))}return i}function nt(t,n){const i=z(s.get(),n,t.origin),e=G(t.basis1),o=G(t.basis2),r=h(t.basis1,i),a=h(t.basis2,i);return-r-e<0&&r-e<0&&-a-o<0&&a-o<0}function K(t,n){const i=v.get();return u(i.origin,t.origin),u(i.vector,n),i}function C(t,n,i){const{basis1:e,basis2:o,origin:r}=t,a=l(s.get(),e,n.origin[0]),g=l(s.get(),o,n.origin[1]);p(i.origin,a,g),p(i.origin,i.origin,r);const c=l(s.get(),e,n.direction[0]),b=l(s.get(),o,n.direction[1]);return l(i.vector,p(c,c,b),2),i}function Ct(t,n){Math.abs(h(t.basis1,t.basis2)/(I(t.basis1)*I(t.basis2)))>1e-6&&Y().warn(n,"Provided basis vectors are not perpendicular"),Math.abs(h(t.basis1,f(t)))>1e-6&&Y().warn(n,"Basis vectors and plane normal are not perpendicular"),Math.abs(-h(f(t),t.origin)-t.plane[3])>1e-6&&Y().warn(n,"Plane offset is not consistent with plane origin")}function et(t,n,i,e){const o=f(t);F(o,n.direction,n.origin,i),F(T(i),o,n.origin,e)}const ot={plane:y(),origin:w(0,0,0),basis1:w(1,0,0),basis2:w(0,1,0)},x=new O(y),v=new O(pt),kt=N(),Dt=new O(()=>$()),k=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],d=L(),V=L(),Wt=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:yt,altitudeAt:B,axisAt:Ft,cameraFrustumCoverage:_t,closestPoint:J,closestPointOnSilhouette:Q,copy:S,copyWithoutVerify:jt,create:$,distance:At,distance2:q,distanceToSilhouette:Yt,elevate:Z,equals:zt,extrusionContainsPoint:Vt,fromAABoundingRect:W,fromValues:U,getExtent:wt,intersectRay:R,intersectRayClosestSilhouette:Et,normal:f,projectPoint:tt,projectPointLocal:it,rotate:qt,setAltitudeAt:Ot,setExtent:vt,transform:Rt,up:ot,updateUnboundedPlane:j,wrap:St},Symbol.toStringTag,{value:"Module"}));export{S as M,j as N,Wt as R,$ as h,U as q}; diff --git a/main/assets/boundedPlane-DlvE0eNx-DhJ9Zyo3.js b/main/assets/boundedPlane-DlvE0eNx-DhJ9Zyo3.js new file mode 100644 index 000000000..c75539975 --- /dev/null +++ b/main/assets/boundedPlane-DlvE0eNx-DhJ9Zyo3.js @@ -0,0 +1 @@ +import{hZ as w,i8 as E,cS as rt,ha as st,i9 as _,dU as N,a1 as at}from"./main-C7yV2j71.js";import{X as O,p as ct}from"./sphere-BenPORjV-CiIWUavi.js";import{z as ut,G as gt,K as bt}from"./mat4-DX7gBViE-vewreEuZ.js";import{t as L}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as u,L as l,j as p,_ as M,g as ft,b as I,W as lt,y as h,r as z,R as A,Y as m,l as D,v as G}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{u as pt,j as H,x as dt}from"./lineSegment-CcqvCARM-_ZNy9SM-.js";import{y,a as mt,j as ht,T as F,f as s,H as It,M as $t,S as Nt,m as Mt,g as X,D as Pt,l as P,N as T,h as Tt}from"./plane-Dt8R0KeE-CdQQbSdq.js";const Y=()=>at.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class xt{constructor(){this.plane=y(),this.origin=N(),this.basis1=N(),this.basis2=N()}}const yt=xt;function $(t=ot){return{plane:y(t.plane),origin:E(t.origin),basis1:E(t.basis1),basis2:E(t.basis2)}}function St(t,n,i){const e=Dt.get();return e.origin=t,e.basis1=n,e.basis2=i,e.plane=mt(0,0,0,0),j(e),e}function S(t,n=$()){return U(t.origin,t.basis1,t.basis2,n)}function jt(t,n){u(n.origin,t.origin),u(n.basis1,t.basis1),u(n.basis2,t.basis2),ht(n.plane,t.plane)}function U(t,n,i,e=$()){return u(e.origin,t),u(e.basis1,n),u(e.basis2,i),j(e),Ct(e,"fromValues()"),e}function j(t){F(t.basis2,t.basis1,t.origin,t.plane)}function Z(t,n,i){t!==i&&S(t,i);const e=l(s.get(),f(t),n);return p(i.origin,i.origin,e),i.plane[3]-=n,i}function vt(t,n,i){return W(n,i),Z(i,B(t,t.origin),i),i}function wt(t,n){const i=t.basis1[0],e=t.basis2[1],[o,r]=t.origin;return rt(o-i,r-e,o+i,r+e,n)}function W(t,n=$()){const i=(t[2]-t[0])/2,e=(t[3]-t[1])/2;return M(n.origin,t[0]+i,t[1]+e,0),M(n.basis1,i,0,0),M(n.basis2,0,e,0),It(0,0,1,0,n.plane),n}function R(t,n,i){return!!$t(t.plane,n,i)&&nt(t,i)}function Et(t,n,i){if(R(t,n,i))return i;const e=Q(t,n,s.get());return p(i,n.origin,l(s.get(),n.direction,ft(n.origin,e)/I(n.direction))),i}function Q(t,n,i){const e=x.get();et(t,n,e,x.get());let o=Number.POSITIVE_INFINITY;for(const r of k){const a=C(t,r,v.get()),g=s.get();if(Nt(e,a,g)){const c=lt(s.get(),n.origin,g),b=Math.abs(st(h(n.direction,c)));bi&&(i=r)}return Math.sqrt(i)}function Vt(t,n){return X(t.plane,n)&&nt(t,n)}function Ft(t,n,i,e){return Bt(t,i,e)}function B(t,n){const i=-t.plane[3];return P(f(t),n)-i}function Ot(t,n,i,e){const o=B(t,n),r=l(kt,f(t),i-o);return p(e,n,r),e}function zt(t,n){return A(t.basis1,n.basis1)&&A(t.basis2,n.basis2)&&A(t.origin,n.origin)}function Rt(t,n,i){return t!==i&&S(t,i),ut(d,n),gt(d,d),m(i.basis1,t.basis1,d),m(i.basis2,t.basis2,d),m(T(i.plane),T(t.plane),d),m(i.origin,t.origin,n),Tt(i.plane,i.plane,i.origin),i}function qt(t,n,i,e){return t!==e&&S(t,e),bt(V,n,i),m(e.basis1,t.basis1,V),m(e.basis2,t.basis2,V),j(e),e}function f(t){return T(t.plane)}function Bt(t,n,i){switch(n){case _.X:u(i,t.basis1),D(i,i);break;case _.Y:u(i,t.basis2),D(i,i);break;case _.Z:u(i,f(t))}return i}function nt(t,n){const i=z(s.get(),n,t.origin),e=G(t.basis1),o=G(t.basis2),r=h(t.basis1,i),a=h(t.basis2,i);return-r-e<0&&r-e<0&&-a-o<0&&a-o<0}function K(t,n){const i=v.get();return u(i.origin,t.origin),u(i.vector,n),i}function C(t,n,i){const{basis1:e,basis2:o,origin:r}=t,a=l(s.get(),e,n.origin[0]),g=l(s.get(),o,n.origin[1]);p(i.origin,a,g),p(i.origin,i.origin,r);const c=l(s.get(),e,n.direction[0]),b=l(s.get(),o,n.direction[1]);return l(i.vector,p(c,c,b),2),i}function Ct(t,n){Math.abs(h(t.basis1,t.basis2)/(I(t.basis1)*I(t.basis2)))>1e-6&&Y().warn(n,"Provided basis vectors are not perpendicular"),Math.abs(h(t.basis1,f(t)))>1e-6&&Y().warn(n,"Basis vectors and plane normal are not perpendicular"),Math.abs(-h(f(t),t.origin)-t.plane[3])>1e-6&&Y().warn(n,"Plane offset is not consistent with plane origin")}function et(t,n,i,e){const o=f(t);F(o,n.direction,n.origin,i),F(T(i),o,n.origin,e)}const ot={plane:y(),origin:w(0,0,0),basis1:w(1,0,0),basis2:w(0,1,0)},x=new O(y),v=new O(pt),kt=N(),Dt=new O(()=>$()),k=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],d=L(),V=L(),Wt=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:yt,altitudeAt:B,axisAt:Ft,cameraFrustumCoverage:_t,closestPoint:J,closestPointOnSilhouette:Q,copy:S,copyWithoutVerify:jt,create:$,distance:At,distance2:q,distanceToSilhouette:Yt,elevate:Z,equals:zt,extrusionContainsPoint:Vt,fromAABoundingRect:W,fromValues:U,getExtent:wt,intersectRay:R,intersectRayClosestSilhouette:Et,normal:f,projectPoint:tt,projectPointLocal:it,rotate:qt,setAltitudeAt:Ot,setExtent:vt,transform:Rt,up:ot,updateUnboundedPlane:j,wrap:St},Symbol.toStringTag,{value:"Module"}));export{S as M,j as N,Wt as R,$ as h,U as q}; diff --git a/main/assets/calcite-action-2fclGKoO-DM2fRYrF.js b/main/assets/calcite-action-2fclGKoO-DM2fRYrF.js new file mode 100644 index 000000000..0c98343bd --- /dev/null +++ b/main/assets/calcite-action-2fclGKoO-DM2fRYrF.js @@ -0,0 +1 @@ +import{f as o,m as t}from"./action-GCQoufcz-D2daq3Sk.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./guid-Dls486Er-CBh637k4.js";import"./interactive-DqhNilgd-D_Gwwuwg.js";import"./loadable-DbNDKH4r-YgUDHAtn.js";import"./locale-Cn_GDVD_-DrOI-_a9.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-Du14S4xc.js";import"./component-CWGf1hug-BASJpoEG.js";import"./t9n-C_hcZMZJ-CZmw6XOE.js";import"./icon-BXFbBbop-Du8Zws1L.js";import"./loader-Ch7Jr16w-BlGvYEIO.js";const A=o,E=t;export{A as CalciteAction,E as defineCustomElement}; diff --git a/main/assets/calcite-action-2fclGKoO-tJ2F9SXc.js b/main/assets/calcite-action-2fclGKoO-tJ2F9SXc.js deleted file mode 100644 index f8c7266ca..000000000 --- a/main/assets/calcite-action-2fclGKoO-tJ2F9SXc.js +++ /dev/null @@ -1 +0,0 @@ -import{f as o,m as t}from"./action-GCQoufcz-Cwgl1KRC.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./guid-Dls486Er-CBh637k4.js";import"./interactive-DqhNilgd-DrUFww1w.js";import"./loadable-DbNDKH4r-Cc9Ee-I5.js";import"./locale-Cn_GDVD_-CiwD7jxT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-DJJPVpPW.js";import"./component-CWGf1hug-BASJpoEG.js";import"./t9n-C_hcZMZJ-BmtPt6-4.js";import"./icon-BXFbBbop-O5hL8B42.js";import"./loader-Ch7Jr16w-ztJ2p2Gj.js";const A=o,E=t;export{A as CalciteAction,E as defineCustomElement}; diff --git a/main/assets/calcite-action-bar-ugh74qU5-Be9dclDf.js b/main/assets/calcite-action-bar-ugh74qU5-Be9dclDf.js new file mode 100644 index 000000000..d5c60de0a --- /dev/null +++ b/main/assets/calcite-action-bar-ugh74qU5-Be9dclDf.js @@ -0,0 +1 @@ +import{p as G,b as k,W as T,a as d,D as B,n as M,h as W}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{s as $,c as q}from"./conditionalSlot-DsCzytJ4-DxmRN7Hl.js";import{V as A,G as w,g as P,p as _}from"./dom-N58V0tYi-DBU3jlah.js";import{r as K,o as R,f as F}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{K as j,q as V}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{c as E}from"./observers-BigwqTsw-Du14S4xc.js";import{l as I,d as J,h as N,M as Q}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{o as g,l as U}from"./action-group-DhwU7QZv-Xo45JeJh.js";import{K as X,O as Y,_ as Z}from"./action-menu-DTIJuZNc-BWLxzbAy.js";import{m as ee}from"./action-GCQoufcz-D2daq3Sk.js";import{m as te}from"./icon-BXFbBbop-Du8Zws1L.js";import{v as oe}from"./loader-Ch7Jr16w-BlGvYEIO.js";import{l as ie}from"./debounce-27Hmkkyg-Th7bw3mg.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";import"./floating-ui-DKFFlLv3-B6atYKJb.js";import"./openCloseComponent-BGQ6h7vg-DwGQl3jY.js";import"./FloatingArrow-BG9llDYg-AyYcVK-v.js";import"./component-CWGf1hug-BASJpoEG.js";import"./interactive-DqhNilgd-D_Gwwuwg.js";const ae=2,C=e=>e.reduce((t,o)=>t+o,0)/e.length,se=e=>{const t=e.filter(i=>i.slot!==g.menuActions),o=t?.length;return{actionWidth:o?C(t.map(i=>i.clientWidth||0)):0,actionHeight:o?C(t.map(i=>i.clientHeight||0)):0}},ne=({width:e,actionWidth:t,layout:o,height:i,actionHeight:l,groupCount:s})=>{const n=o==="horizontal"?e:i,a=o==="horizontal"?t:l;return Math.floor((n-s*ae)/a)},le=({layout:e,actionCount:t,actionWidth:o,width:i,actionHeight:l,height:s,groupCount:n})=>Math.max(t-ne({width:i,actionWidth:o,layout:e,height:s,actionHeight:l,groupCount:n}),0),x=e=>Array.from(e.querySelectorAll("calcite-action")).filter(t=>t.closest("calcite-action-menu")?t.slot===Z.trigger:!0),ce=({actionGroups:e,expanded:t,overflowCount:o})=>{let i=o;e.reverse().forEach(l=>{let s=0;const n=x(l).reverse();n.forEach(a=>{a.slot===g.menuActions&&(a.removeAttribute("slot"),a.textEnabled=t)}),i>0&&n.some(a=>(n.filter(c=>!c.slot).length>1&&n.length>2&&!a.closest("calcite-action-menu")&&(a.textEnabled=!0,a.setAttribute("slot",g.menuActions),s++,s>1&&i--),i<1)),M(l)})},H={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function re(e,t){return e||t.closest("calcite-shell-panel")?.position||"start"}function m({el:e,expanded:t}){x(e).filter(o=>o.slot!==g.menuActions).forEach(o=>o.textEnabled=t),e.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=t)}const de=({tooltip:e,referenceElement:t,expanded:o,ref:i})=>(e&&(e.referenceElement=!o&&t?t:null),i&&i(t),t),he=({expanded:e,expandText:t,collapseText:o,expandLabel:i,collapseLabel:l,toggle:s,el:n,position:a,tooltip:c,ref:r,scale:h})=>{const f=_(n)==="rtl",u=e?o:t,b=e?l:i,p=[H.chevronsLeft,H.chevronsRight];f&&p.reverse();const y=re(a,n)==="end",D=y?p[1]:p[0],O=y?p[0]:p[1];return d("calcite-action",{icon:e?D:O,id:"expand-toggle",label:b,onClick:s,ref:S=>de({tooltip:c,referenceElement:S,expanded:e,ref:r}),scale:h,text:u,textEnabled:e,title:!e&&!c?u:null})},pe={actionGroupEnd:"action-group--end"},v={actionsEnd:"actions-end",bottomActions:"bottom-actions",expandTooltip:"expand-tooltip"},ue=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{pointer-events:auto;display:inline-flex;align-self:stretch;gap:var(--calcite-action-bar-items-space, 0)}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]){overflow-y:auto}:host([layout=vertical]):host([expanded]){max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]){overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-inline-end-width:var(--calcite-border-width-sm)}.action-group--end{justify-content:flex-end}:host([hidden]){display:none}[hidden]{display:none}",me=ue,z=G(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionBarToggle=T(this,"calciteActionBarToggle",6),this.mutationObserver=E("mutation",()=>{const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}),this.resizeObserver=E("resize",e=>this.resizeHandlerEntries(e)),this.actionMenuOpenHandler=e=>{if(e.target.menuOpen){const t=e.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach(o=>{t.includes(o)||(o.menuOpen=!1)})}},this.resizeHandlerEntries=e=>{e.forEach(this.resizeHandler)},this.resizeHandler=e=>{const{width:t,height:o}=e.contentRect;this.resize({width:t,height:o})},this.resize=ie(({width:e,height:t})=>{const{el:o,expanded:i,expandDisabled:l,layout:s,overflowActionsDisabled:n}=this;if(n||s==="vertical"&&!t||s==="horizontal"&&!e)return;const a=x(o),c=l?a.length:a.length+1,r=Array.from(o.querySelectorAll("calcite-action-group"));this.setGroupLayout(r);const h=this.hasActionsEnd||this.hasBottomActions||!l?r.length+1:r.length,{actionHeight:f,actionWidth:u}=se(a),b=le({layout:s,actionCount:c,actionHeight:f,actionWidth:u,height:t,width:e,groupCount:h});ce({actionGroups:r,expanded:i,overflowCount:b})},W.resize),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.handleDefaultSlotChange=e=>{const t=A(e).filter(o=>o.matches("calcite-action-group"));this.setGroupLayout(t)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=w(e)},this.handleBottomActionsSlotChange=e=>{this.hasBottomActions=w(e)},this.handleTooltipSlotChange=e=>{const t=A(e).filter(o=>o?.matches("calcite-tooltip"));this.expandTooltip=t[0]},this.actionsEndGroupLabel=void 0,this.expandDisabled=!1,this.expanded=!1,this.layout="vertical",this.overflowActionsDisabled=!1,this.overlayPositioning="absolute",this.position=void 0,this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.hasActionsEnd=!1,this.hasBottomActions=!1,this.expandTooltip=void 0,this.defaultMessages=void 0}expandHandler(){this.overflowActions()}expandedHandler(){const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}layoutHandler(){this.updateGroups()}overflowDisabledHandler(e){if(e){this.resizeObserver?.disconnect();return}this.resizeObserver?.observe(this.el),this.overflowActions()}onMessagesChange(){}effectiveLocaleChange(){I(this,this.effectiveLocale)}componentDidLoad(){const{el:e,expanded:t}=this;K(this),m({el:e,expanded:t}),this.overflowActions()}connectedCallback(){const{el:e,expanded:t}=this;j(this),J(this),m({el:e,expanded:t}),this.mutationObserver?.observe(e,{childList:!0,subtree:!0}),this.overflowActionsDisabled||this.resizeObserver?.observe(e),this.overflowActions(),$(this)}async componentWillLoad(){R(this),await N(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),q(this),V(this),Q(this)}async overflowActions(){this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(){await F(this),P(this.el)}updateGroups(){this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group")))}setGroupLayout(e){e.forEach(t=>t.layout=this.layout)}renderBottomActionGroup(){const{expanded:e,expandDisabled:t,el:o,position:i,toggleExpand:l,scale:s,layout:n,messages:a,actionsEndGroupLabel:c,overlayPositioning:r}=this,h=t?null:d(he,{collapseLabel:a.collapseLabel,collapseText:a.collapse,el:o,expandLabel:a.expandLabel,expandText:a.expand,expanded:e,position:i,scale:s,toggle:l,tooltip:this.expandTooltip});return d("calcite-action-group",{class:pe.actionGroupEnd,hidden:this.expandDisabled&&!(this.hasActionsEnd||this.hasBottomActions),label:c,layout:n,overlayPositioning:r,scale:s},d("slot",{name:v.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),d("slot",{name:v.bottomActions,onSlotchange:this.handleBottomActionsSlotChange}),d("slot",{name:v.expandTooltip,onSlotchange:this.handleTooltipSlotChange}),h)}render(){return d(B,{key:"ff6e365531a0ed2032864bb0777910c3932e9c6b",onCalciteActionMenuOpen:this.actionMenuOpenHandler},d("slot",{key:"f12b2f455752a62ee32b65224bed385940135a49",onSlotchange:this.handleDefaultSlotChange}),this.renderBottomActionGroup())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return me}},[1,"calcite-action-bar",{actionsEndGroupLabel:[1,"actions-end-group-label"],expandDisabled:[516,"expand-disabled"],expanded:[1540],layout:[513],overflowActionsDisabled:[516,"overflow-actions-disabled"],overlayPositioning:[513,"overlay-positioning"],position:[513],scale:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],hasActionsEnd:[32],hasBottomActions:[32],expandTooltip:[32],defaultMessages:[32],overflowActions:[64],setFocus:[64]},void 0,{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function L(){typeof customElements>"u"||["calcite-action-bar","calcite-action","calcite-action-group","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-bar":customElements.get(e)||customElements.define(e,z);break;case"calcite-action":customElements.get(e)||ee();break;case"calcite-action-group":customElements.get(e)||U();break;case"calcite-action-menu":customElements.get(e)||Y();break;case"calcite-icon":customElements.get(e)||te();break;case"calcite-loader":customElements.get(e)||oe();break;case"calcite-popover":customElements.get(e)||X();break}})}L();const $e=z,qe=L;export{$e as CalciteActionBar,qe as defineCustomElement}; diff --git a/main/assets/calcite-action-bar-ugh74qU5-vzTzIHYF.js b/main/assets/calcite-action-bar-ugh74qU5-vzTzIHYF.js deleted file mode 100644 index 7b4286c30..000000000 --- a/main/assets/calcite-action-bar-ugh74qU5-vzTzIHYF.js +++ /dev/null @@ -1 +0,0 @@ -import{p as G,b as k,W as T,a as d,D as B,n as M,h as W}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{s as $,c as q}from"./conditionalSlot-DsCzytJ4-Ay0m1nEb.js";import{V as A,G as w,g as P,p as _}from"./dom-N58V0tYi-DBU3jlah.js";import{r as K,o as R,f as F}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{K as j,q as V}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{c as E}from"./observers-BigwqTsw-DJJPVpPW.js";import{l as I,d as J,h as N,M as Q}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{o as g,l as U}from"./action-group-DhwU7QZv-D6TFqyAr.js";import{K as X,O as Y,_ as Z}from"./action-menu-DTIJuZNc-DM_2ZtiL.js";import{m as ee}from"./action-GCQoufcz-Cwgl1KRC.js";import{m as te}from"./icon-BXFbBbop-O5hL8B42.js";import{v as oe}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";import{l as ie}from"./debounce-27Hmkkyg-Th7bw3mg.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";import"./floating-ui-DKFFlLv3-DZ3_fUHw.js";import"./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js";import"./FloatingArrow-BG9llDYg-B1DQ6cRb.js";import"./component-CWGf1hug-BASJpoEG.js";import"./interactive-DqhNilgd-DrUFww1w.js";const ae=2,C=e=>e.reduce((t,o)=>t+o,0)/e.length,se=e=>{const t=e.filter(i=>i.slot!==g.menuActions),o=t?.length;return{actionWidth:o?C(t.map(i=>i.clientWidth||0)):0,actionHeight:o?C(t.map(i=>i.clientHeight||0)):0}},ne=({width:e,actionWidth:t,layout:o,height:i,actionHeight:l,groupCount:s})=>{const n=o==="horizontal"?e:i,a=o==="horizontal"?t:l;return Math.floor((n-s*ae)/a)},le=({layout:e,actionCount:t,actionWidth:o,width:i,actionHeight:l,height:s,groupCount:n})=>Math.max(t-ne({width:i,actionWidth:o,layout:e,height:s,actionHeight:l,groupCount:n}),0),x=e=>Array.from(e.querySelectorAll("calcite-action")).filter(t=>t.closest("calcite-action-menu")?t.slot===Z.trigger:!0),ce=({actionGroups:e,expanded:t,overflowCount:o})=>{let i=o;e.reverse().forEach(l=>{let s=0;const n=x(l).reverse();n.forEach(a=>{a.slot===g.menuActions&&(a.removeAttribute("slot"),a.textEnabled=t)}),i>0&&n.some(a=>(n.filter(c=>!c.slot).length>1&&n.length>2&&!a.closest("calcite-action-menu")&&(a.textEnabled=!0,a.setAttribute("slot",g.menuActions),s++,s>1&&i--),i<1)),M(l)})},H={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function re(e,t){return e||t.closest("calcite-shell-panel")?.position||"start"}function m({el:e,expanded:t}){x(e).filter(o=>o.slot!==g.menuActions).forEach(o=>o.textEnabled=t),e.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=t)}const de=({tooltip:e,referenceElement:t,expanded:o,ref:i})=>(e&&(e.referenceElement=!o&&t?t:null),i&&i(t),t),he=({expanded:e,expandText:t,collapseText:o,expandLabel:i,collapseLabel:l,toggle:s,el:n,position:a,tooltip:c,ref:r,scale:h})=>{const f=_(n)==="rtl",u=e?o:t,b=e?l:i,p=[H.chevronsLeft,H.chevronsRight];f&&p.reverse();const y=re(a,n)==="end",D=y?p[1]:p[0],O=y?p[0]:p[1];return d("calcite-action",{icon:e?D:O,id:"expand-toggle",label:b,onClick:s,ref:S=>de({tooltip:c,referenceElement:S,expanded:e,ref:r}),scale:h,text:u,textEnabled:e,title:!e&&!c?u:null})},pe={actionGroupEnd:"action-group--end"},v={actionsEnd:"actions-end",bottomActions:"bottom-actions",expandTooltip:"expand-tooltip"},ue=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{pointer-events:auto;display:inline-flex;align-self:stretch;gap:var(--calcite-action-bar-items-space, 0)}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]){overflow-y:auto}:host([layout=vertical]):host([expanded]){max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]){overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-inline-end-width:var(--calcite-border-width-sm)}.action-group--end{justify-content:flex-end}:host([hidden]){display:none}[hidden]{display:none}",me=ue,z=G(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionBarToggle=T(this,"calciteActionBarToggle",6),this.mutationObserver=E("mutation",()=>{const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}),this.resizeObserver=E("resize",e=>this.resizeHandlerEntries(e)),this.actionMenuOpenHandler=e=>{if(e.target.menuOpen){const t=e.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach(o=>{t.includes(o)||(o.menuOpen=!1)})}},this.resizeHandlerEntries=e=>{e.forEach(this.resizeHandler)},this.resizeHandler=e=>{const{width:t,height:o}=e.contentRect;this.resize({width:t,height:o})},this.resize=ie(({width:e,height:t})=>{const{el:o,expanded:i,expandDisabled:l,layout:s,overflowActionsDisabled:n}=this;if(n||s==="vertical"&&!t||s==="horizontal"&&!e)return;const a=x(o),c=l?a.length:a.length+1,r=Array.from(o.querySelectorAll("calcite-action-group"));this.setGroupLayout(r);const h=this.hasActionsEnd||this.hasBottomActions||!l?r.length+1:r.length,{actionHeight:f,actionWidth:u}=se(a),b=le({layout:s,actionCount:c,actionHeight:f,actionWidth:u,height:t,width:e,groupCount:h});ce({actionGroups:r,expanded:i,overflowCount:b})},W.resize),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.handleDefaultSlotChange=e=>{const t=A(e).filter(o=>o.matches("calcite-action-group"));this.setGroupLayout(t)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=w(e)},this.handleBottomActionsSlotChange=e=>{this.hasBottomActions=w(e)},this.handleTooltipSlotChange=e=>{const t=A(e).filter(o=>o?.matches("calcite-tooltip"));this.expandTooltip=t[0]},this.actionsEndGroupLabel=void 0,this.expandDisabled=!1,this.expanded=!1,this.layout="vertical",this.overflowActionsDisabled=!1,this.overlayPositioning="absolute",this.position=void 0,this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.hasActionsEnd=!1,this.hasBottomActions=!1,this.expandTooltip=void 0,this.defaultMessages=void 0}expandHandler(){this.overflowActions()}expandedHandler(){const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}layoutHandler(){this.updateGroups()}overflowDisabledHandler(e){if(e){this.resizeObserver?.disconnect();return}this.resizeObserver?.observe(this.el),this.overflowActions()}onMessagesChange(){}effectiveLocaleChange(){I(this,this.effectiveLocale)}componentDidLoad(){const{el:e,expanded:t}=this;K(this),m({el:e,expanded:t}),this.overflowActions()}connectedCallback(){const{el:e,expanded:t}=this;j(this),J(this),m({el:e,expanded:t}),this.mutationObserver?.observe(e,{childList:!0,subtree:!0}),this.overflowActionsDisabled||this.resizeObserver?.observe(e),this.overflowActions(),$(this)}async componentWillLoad(){R(this),await N(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),q(this),V(this),Q(this)}async overflowActions(){this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(){await F(this),P(this.el)}updateGroups(){this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group")))}setGroupLayout(e){e.forEach(t=>t.layout=this.layout)}renderBottomActionGroup(){const{expanded:e,expandDisabled:t,el:o,position:i,toggleExpand:l,scale:s,layout:n,messages:a,actionsEndGroupLabel:c,overlayPositioning:r}=this,h=t?null:d(he,{collapseLabel:a.collapseLabel,collapseText:a.collapse,el:o,expandLabel:a.expandLabel,expandText:a.expand,expanded:e,position:i,scale:s,toggle:l,tooltip:this.expandTooltip});return d("calcite-action-group",{class:pe.actionGroupEnd,hidden:this.expandDisabled&&!(this.hasActionsEnd||this.hasBottomActions),label:c,layout:n,overlayPositioning:r,scale:s},d("slot",{name:v.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),d("slot",{name:v.bottomActions,onSlotchange:this.handleBottomActionsSlotChange}),d("slot",{name:v.expandTooltip,onSlotchange:this.handleTooltipSlotChange}),h)}render(){return d(B,{key:"ff6e365531a0ed2032864bb0777910c3932e9c6b",onCalciteActionMenuOpen:this.actionMenuOpenHandler},d("slot",{key:"f12b2f455752a62ee32b65224bed385940135a49",onSlotchange:this.handleDefaultSlotChange}),this.renderBottomActionGroup())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return me}},[1,"calcite-action-bar",{actionsEndGroupLabel:[1,"actions-end-group-label"],expandDisabled:[516,"expand-disabled"],expanded:[1540],layout:[513],overflowActionsDisabled:[516,"overflow-actions-disabled"],overlayPositioning:[513,"overlay-positioning"],position:[513],scale:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],hasActionsEnd:[32],hasBottomActions:[32],expandTooltip:[32],defaultMessages:[32],overflowActions:[64],setFocus:[64]},void 0,{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function L(){typeof customElements>"u"||["calcite-action-bar","calcite-action","calcite-action-group","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-bar":customElements.get(e)||customElements.define(e,z);break;case"calcite-action":customElements.get(e)||ee();break;case"calcite-action-group":customElements.get(e)||U();break;case"calcite-action-menu":customElements.get(e)||Y();break;case"calcite-icon":customElements.get(e)||te();break;case"calcite-loader":customElements.get(e)||oe();break;case"calcite-popover":customElements.get(e)||X();break}})}L();const $e=z,qe=L;export{$e as CalciteActionBar,qe as defineCustomElement}; diff --git a/main/assets/calcite-action-group-qlkUfh_o-B4ny7Mme.js b/main/assets/calcite-action-group-qlkUfh_o-B4ny7Mme.js new file mode 100644 index 000000000..0e215ede4 --- /dev/null +++ b/main/assets/calcite-action-group-qlkUfh_o-B4ny7Mme.js @@ -0,0 +1 @@ +import{c as o,l as t}from"./action-group-DhwU7QZv-Xo45JeJh.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./conditionalSlot-DsCzytJ4-DxmRN7Hl.js";import"./observers-BigwqTsw-Du14S4xc.js";import"./loadable-DbNDKH4r-YgUDHAtn.js";import"./locale-Cn_GDVD_-DrOI-_a9.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./t9n-C_hcZMZJ-CZmw6XOE.js";import"./action-menu-DTIJuZNc-BWLxzbAy.js";import"./guid-Dls486Er-CBh637k4.js";import"./action-GCQoufcz-D2daq3Sk.js";import"./interactive-DqhNilgd-D_Gwwuwg.js";import"./component-CWGf1hug-BASJpoEG.js";import"./icon-BXFbBbop-Du8Zws1L.js";import"./loader-Ch7Jr16w-BlGvYEIO.js";import"./floating-ui-DKFFlLv3-B6atYKJb.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./openCloseComponent-BGQ6h7vg-DwGQl3jY.js";import"./FloatingArrow-BG9llDYg-AyYcVK-v.js";const k=o,q=t;export{k as CalciteActionGroup,q as defineCustomElement}; diff --git a/main/assets/calcite-action-group-qlkUfh_o-BnjsUS6-.js b/main/assets/calcite-action-group-qlkUfh_o-BnjsUS6-.js deleted file mode 100644 index c5ce4c152..000000000 --- a/main/assets/calcite-action-group-qlkUfh_o-BnjsUS6-.js +++ /dev/null @@ -1 +0,0 @@ -import{c as o,l as t}from"./action-group-DhwU7QZv-D6TFqyAr.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./conditionalSlot-DsCzytJ4-Ay0m1nEb.js";import"./observers-BigwqTsw-DJJPVpPW.js";import"./loadable-DbNDKH4r-Cc9Ee-I5.js";import"./locale-Cn_GDVD_-CiwD7jxT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./t9n-C_hcZMZJ-BmtPt6-4.js";import"./action-menu-DTIJuZNc-DM_2ZtiL.js";import"./guid-Dls486Er-CBh637k4.js";import"./action-GCQoufcz-Cwgl1KRC.js";import"./interactive-DqhNilgd-DrUFww1w.js";import"./component-CWGf1hug-BASJpoEG.js";import"./icon-BXFbBbop-O5hL8B42.js";import"./loader-Ch7Jr16w-ztJ2p2Gj.js";import"./floating-ui-DKFFlLv3-DZ3_fUHw.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js";import"./FloatingArrow-BG9llDYg-B1DQ6cRb.js";const k=o,q=t;export{k as CalciteActionGroup,q as defineCustomElement}; diff --git a/main/assets/calcite-button-Cm9_TJei-BWKp46iV.js b/main/assets/calcite-button-Cm9_TJei-BWKp46iV.js deleted file mode 100644 index 4a768e80f..000000000 --- a/main/assets/calcite-button-Cm9_TJei-BWKp46iV.js +++ /dev/null @@ -1,11 +0,0 @@ -import{p as b,b as v,n as g,c as f,a}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{D as k,V as m,I as x}from"./form-CRSw616T-Cd5gFTXp.js";import{l as w,p as y}from"./interactive-DqhNilgd-DrUFww1w.js";import{b as z,I as C,M as E}from"./label-Dys24PJn-BCewo2Re.js";import{o as S,r as L,f as O}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{K as T,q as F}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{c as o}from"./observers-BigwqTsw-DJJPVpPW.js";import{e as r}from"./component-CWGf1hug-BASJpoEG.js";import{d as R,M,h as $,l as A}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{A as D}from"./dom-N58V0tYi-DBU3jlah.js";import{m as I}from"./icon-BXFbBbop-O5hL8B42.js";import{v as j}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";const e={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},H=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - 2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host button,:host a{--calcite-button-content-margin-internal:0.5rem;--calcite-button-padding-x-internal:7px;--calcite-button-padding-y-internal:3px;padding-block:var(--calcite-button-padding-y-internal);padding-inline:var(--calcite-button-padding-x-internal);position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-radius:0px;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host button:hover,:host a:hover{text-decoration-line:none}:host button span,:host a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{margin-inline:var(--calcite-button-content-margin-internal)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-content-margin-internal:0.75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-button-content-margin-internal:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-button-content-margin-internal)}.icon{position:relative;margin:0px;display:inline-flex;font-weight:var(--calcite-font-weight-normal);line-height:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(0.5)}100%{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}100%{inline-size:0;opacity:0;transform:scale(0.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0px}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-button-content-margin-internal)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{border-width:1px;border-style:solid;border-color:transparent}:host([kind=brand]) button,:host([kind=brand]) a{background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) button:focus,:host([kind=brand]) a:hover,:host([kind=brand]) a:focus{background-color:var(--calcite-color-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{background-color:var(--calcite-color-brand-press)}:host([kind=brand]) button calcite-loader,:host([kind=brand]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=danger]) button,:host([kind=danger]) a{background-color:var(--calcite-color-status-danger);color:var(--calcite-color-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) button:focus,:host([kind=danger]) a:hover,:host([kind=danger]) a:focus{background-color:var(--calcite-color-status-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{background-color:var(--calcite-color-status-danger-press)}:host([kind=danger]) button calcite-loader,:host([kind=danger]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=neutral]) button,:host([kind=neutral]) a{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) button:focus,:host([kind=neutral]) a:hover,:host([kind=neutral]) a:focus{background-color:var(--calcite-color-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{background-color:var(--calcite-color-foreground-1)}:host([kind=neutral]) button calcite-loader,:host([kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) button:focus,:host([kind=inverse]) a:hover,:host([kind=inverse]) a:focus{background-color:var(--calcite-color-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{background-color:var(--calcite-color-inverse-press)}:host([kind=inverse]) button calcite-loader,:host([kind=inverse]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-width:1px;border-style:solid;background-color:var(--calcite-color-foreground-1);box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button calcite-loader,:host([appearance=outline-fill][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline-fill][kind=inverse]) button calcite-loader,:host([appearance=outline-fill][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-width:1px;border-style:solid;background-color:transparent;box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:transparent;color:var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:transparent;color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button calcite-loader,:host([appearance=outline][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline][kind=inverse]) button calcite-loader,:host([appearance=outline][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:transparent}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) button:focus,:host([appearance=transparent]:not(.enable-editing-button)) a:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:focus{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{color:var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{color:var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{color:var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{color:var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{border-block-start-width:1px;border-block-end-width:1px;color:var(--calcite-color-text-3);border-block-start-color:var(--calcite-color-border-input);border-block-end-color:var(--calcite-color-border-input);border-block-style:solid}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:not(.content--slotted){--calcite-button-padding-y-internal:0}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].enable-editing-button) button{background-color:transparent}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button,:host([appearance=transparent][kind=inverse]) a,:host([appearance=transparent][kind=inverse]) calcite-loader{color:var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-button-padding-y-internal:3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-button-padding-x-internal:11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-padding-y-internal:7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-button-padding-x-internal:15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-button-padding-x-internal:1rem;--calcite-button-padding-y-internal:11px}:host([scale=l]) .button-padding--shrunk{--calcite-button-padding-y-internal:9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host(:is([scale=s],[scale=m],[scale=l])[width=full]) a:not(.content--slotted),:host(:is([scale=s],[scale=m],[scale=l])[width=full]) button:not(.content--slotted){inline-size:var(--calcite-container-size-content-fluid)}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-y-internal:0.625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,N=H,i=b(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=o("mutation",()=>this.updateHasContent()),this.resizeObserver=o("resize",()=>this.setTooltipText()),this.handleClick=()=>{const{type:t}=this;this.href||(t==="submit"?k(this):t==="reset"&&m(this))},this.setTooltipText=()=>{const{contentEl:t}=this;t&&(this.tooltipText=t.offsetWidth{this.childEl=t,t&&this.resizeObserver?.observe(t)},this.alignment="center",this.appearance="solid",this.label=void 0,this.kind="brand",this.disabled=!1,this.form=void 0,this.download=!1,this.href=void 0,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.loading=!1,this.name=void 0,this.rel=void 0,this.round=!1,this.scale="m",this.splitChild=!1,this.target=void 0,this.type="button",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.hasContent=!1,this.effectiveLocale="",this.defaultMessages=void 0,this.tooltipText=void 0}handleGlobalAttributesChanged(){g(this)}onMessagesChange(){}async connectedCallback(){T(this),R(this),this.setupTextContentObserver(),z(this),this.formEl=x(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),C(this),F(this),M(this),this.resizeObserver?.disconnect(),this.formEl=null}async componentWillLoad(){S(this),f()&&(this.updateHasContent(),await $(this))}componentDidLoad(){L(this),this.setTooltipText()}componentDidRender(){w(this)}render(){const t=this.href?"a":"button",l=t,s=this.loading?a("div",{class:e.buttonLoader},a("calcite-loader",{class:this.loading?e.loadingIn:e.loadingOut,inline:!0,label:this.messages.loading,scale:this.scale==="l"?"m":"s"})):null,n=!this.iconStart&&!this.iconEnd,d=a("calcite-icon",{key:"f1036c0a1bf5740fe63806e3559ea66fac29b726",class:{[e.icon]:!0,[e.iconStart]:!0},flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:r(this.scale)}),h=a("calcite-icon",{key:"d2c22ecf9ca23426b4c4a3b42d623f35ee988a44",class:{[e.icon]:!0,[e.iconEnd]:!0},flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:r(this.scale)}),p=a("span",{key:"d1803021f5fa106c9e296402ec0a1498ecdf36c7",class:e.content,ref:u=>this.contentEl=u},a("slot",{key:"d2f729c16f9c803ffa109b68d58a22a4383dd426"}));return a(y,{key:"2757c795d29f812cf11def4df108837b9971dcdb",disabled:this.disabled},a(l,{key:"e67a4882c8a0c13d6b5f98bc8c5b53c10ba36e3e","aria-busy":D(this.loading),"aria-expanded":this.el.ariaExpanded?this.el.ariaExpanded:null,"aria-label":this.loading?this.messages.loading:E(this),"aria-live":"polite",class:{[e.buttonPadding]:n,[e.buttonPaddingShrunk]:!n,[e.contentSlotted]:this.hasContent,[e.iconStartEmpty]:!this.iconStart,[e.iconEndEmpty]:!this.iconEnd},disabled:t==="button"?this.disabled:null,download:t==="a"?this.download===!0||this.download===""?"":this.download||null:null,href:t==="a"&&this.href,name:t==="button"&&this.name,onClick:this.handleClick,ref:this.setChildEl,rel:t==="a"&&this.rel,tabIndex:this.disabled?-1:null,target:t==="a"&&this.target,title:this.tooltipText,type:t==="button"&&this.type},s,this.iconStart?d:null,this.hasContent?p:null,this.iconEnd?h:null))}async setFocus(){await O(this),this.childEl?.focus()}effectiveLocaleChange(){A(this,this.effectiveLocale)}updateHasContent(){const t=this.el.textContent.trim().length>0||this.el.childNodes.length>0;this.hasContent=this.el.childNodes.length===1&&this.el.childNodes[0]?.nodeName==="#text"?this.el.textContent?.trim().length>0:t}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.handleClick(),this.setFocus()}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{"aria-expanded":["handleGlobalAttributesChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return N}},[1,"calcite-button",{alignment:[513],appearance:[513],label:[1],kind:[513],disabled:[516],form:[513],download:[520],href:[513],iconEnd:[513,"icon-end"],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],loading:[516],name:[513],rel:[513],round:[516],scale:[513],splitChild:[520,"split-child"],target:[513],type:[513],width:[513],messages:[1040],messageOverrides:[1040],hasContent:[32],effectiveLocale:[32],defaultMessages:[32],tooltipText:[32],setFocus:[64]},void 0,{"aria-expanded":["handleGlobalAttributesChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function c(){typeof customElements>"u"||["calcite-button","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-button":customElements.get(t)||customElements.define(t,i);break;case"calcite-icon":customElements.get(t)||I();break;case"calcite-loader":customElements.get(t)||j();break}})}c();const at=i,nt=c;export{at as CalciteButton,nt as defineCustomElement}; diff --git a/main/assets/calcite-button-Cm9_TJei-CW2FD2Xf.js b/main/assets/calcite-button-Cm9_TJei-CW2FD2Xf.js new file mode 100644 index 000000000..2baf4ed0b --- /dev/null +++ b/main/assets/calcite-button-Cm9_TJei-CW2FD2Xf.js @@ -0,0 +1,11 @@ +import{p as b,b as v,n as g,c as f,a}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{D as k,V as m,I as x}from"./form-CRSw616T-2CDQhr1H.js";import{l as w,p as y}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{b as z,I as C,M as E}from"./label-Dys24PJn-BCewo2Re.js";import{o as S,r as L,f as O}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{K as T,q as F}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{c as o}from"./observers-BigwqTsw-Du14S4xc.js";import{e as r}from"./component-CWGf1hug-BASJpoEG.js";import{d as R,M,h as $,l as A}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{A as D}from"./dom-N58V0tYi-DBU3jlah.js";import{m as I}from"./icon-BXFbBbop-Du8Zws1L.js";import{v as j}from"./loader-Ch7Jr16w-BlGvYEIO.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";const e={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},H=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host button,:host a{--calcite-button-content-margin-internal:0.5rem;--calcite-button-padding-x-internal:7px;--calcite-button-padding-y-internal:3px;padding-block:var(--calcite-button-padding-y-internal);padding-inline:var(--calcite-button-padding-x-internal);position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-radius:0px;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host button:hover,:host a:hover{text-decoration-line:none}:host button span,:host a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{margin-inline:var(--calcite-button-content-margin-internal)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-content-margin-internal:0.75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-button-content-margin-internal:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-button-content-margin-internal)}.icon{position:relative;margin:0px;display:inline-flex;font-weight:var(--calcite-font-weight-normal);line-height:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(0.5)}100%{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}100%{inline-size:0;opacity:0;transform:scale(0.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0px}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-button-content-margin-internal)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{border-width:1px;border-style:solid;border-color:transparent}:host([kind=brand]) button,:host([kind=brand]) a{background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) button:focus,:host([kind=brand]) a:hover,:host([kind=brand]) a:focus{background-color:var(--calcite-color-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{background-color:var(--calcite-color-brand-press)}:host([kind=brand]) button calcite-loader,:host([kind=brand]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=danger]) button,:host([kind=danger]) a{background-color:var(--calcite-color-status-danger);color:var(--calcite-color-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) button:focus,:host([kind=danger]) a:hover,:host([kind=danger]) a:focus{background-color:var(--calcite-color-status-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{background-color:var(--calcite-color-status-danger-press)}:host([kind=danger]) button calcite-loader,:host([kind=danger]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=neutral]) button,:host([kind=neutral]) a{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) button:focus,:host([kind=neutral]) a:hover,:host([kind=neutral]) a:focus{background-color:var(--calcite-color-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{background-color:var(--calcite-color-foreground-1)}:host([kind=neutral]) button calcite-loader,:host([kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) button:focus,:host([kind=inverse]) a:hover,:host([kind=inverse]) a:focus{background-color:var(--calcite-color-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{background-color:var(--calcite-color-inverse-press)}:host([kind=inverse]) button calcite-loader,:host([kind=inverse]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-width:1px;border-style:solid;background-color:var(--calcite-color-foreground-1);box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button calcite-loader,:host([appearance=outline-fill][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline-fill][kind=inverse]) button calcite-loader,:host([appearance=outline-fill][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-width:1px;border-style:solid;background-color:transparent;box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:transparent;color:var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:transparent;color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button calcite-loader,:host([appearance=outline][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline][kind=inverse]) button calcite-loader,:host([appearance=outline][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:transparent}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) button:focus,:host([appearance=transparent]:not(.enable-editing-button)) a:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:focus{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{color:var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{color:var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{color:var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{color:var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{border-block-start-width:1px;border-block-end-width:1px;color:var(--calcite-color-text-3);border-block-start-color:var(--calcite-color-border-input);border-block-end-color:var(--calcite-color-border-input);border-block-style:solid}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:not(.content--slotted){--calcite-button-padding-y-internal:0}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].enable-editing-button) button{background-color:transparent}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button,:host([appearance=transparent][kind=inverse]) a,:host([appearance=transparent][kind=inverse]) calcite-loader{color:var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-button-padding-y-internal:3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-button-padding-x-internal:11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-padding-y-internal:7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-button-padding-x-internal:15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-button-padding-x-internal:1rem;--calcite-button-padding-y-internal:11px}:host([scale=l]) .button-padding--shrunk{--calcite-button-padding-y-internal:9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host(:is([scale=s],[scale=m],[scale=l])[width=full]) a:not(.content--slotted),:host(:is([scale=s],[scale=m],[scale=l])[width=full]) button:not(.content--slotted){inline-size:var(--calcite-container-size-content-fluid)}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-y-internal:0.625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,N=H,i=b(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=o("mutation",()=>this.updateHasContent()),this.resizeObserver=o("resize",()=>this.setTooltipText()),this.handleClick=()=>{const{type:t}=this;this.href||(t==="submit"?k(this):t==="reset"&&m(this))},this.setTooltipText=()=>{const{contentEl:t}=this;t&&(this.tooltipText=t.offsetWidth{this.childEl=t,t&&this.resizeObserver?.observe(t)},this.alignment="center",this.appearance="solid",this.label=void 0,this.kind="brand",this.disabled=!1,this.form=void 0,this.download=!1,this.href=void 0,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.loading=!1,this.name=void 0,this.rel=void 0,this.round=!1,this.scale="m",this.splitChild=!1,this.target=void 0,this.type="button",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.hasContent=!1,this.effectiveLocale="",this.defaultMessages=void 0,this.tooltipText=void 0}handleGlobalAttributesChanged(){g(this)}onMessagesChange(){}async connectedCallback(){T(this),R(this),this.setupTextContentObserver(),z(this),this.formEl=x(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),C(this),F(this),M(this),this.resizeObserver?.disconnect(),this.formEl=null}async componentWillLoad(){S(this),f()&&(this.updateHasContent(),await $(this))}componentDidLoad(){L(this),this.setTooltipText()}componentDidRender(){w(this)}render(){const t=this.href?"a":"button",l=t,s=this.loading?a("div",{class:e.buttonLoader},a("calcite-loader",{class:this.loading?e.loadingIn:e.loadingOut,inline:!0,label:this.messages.loading,scale:this.scale==="l"?"m":"s"})):null,n=!this.iconStart&&!this.iconEnd,d=a("calcite-icon",{key:"f1036c0a1bf5740fe63806e3559ea66fac29b726",class:{[e.icon]:!0,[e.iconStart]:!0},flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:r(this.scale)}),h=a("calcite-icon",{key:"d2c22ecf9ca23426b4c4a3b42d623f35ee988a44",class:{[e.icon]:!0,[e.iconEnd]:!0},flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:r(this.scale)}),p=a("span",{key:"d1803021f5fa106c9e296402ec0a1498ecdf36c7",class:e.content,ref:u=>this.contentEl=u},a("slot",{key:"d2f729c16f9c803ffa109b68d58a22a4383dd426"}));return a(y,{key:"2757c795d29f812cf11def4df108837b9971dcdb",disabled:this.disabled},a(l,{key:"e67a4882c8a0c13d6b5f98bc8c5b53c10ba36e3e","aria-busy":D(this.loading),"aria-expanded":this.el.ariaExpanded?this.el.ariaExpanded:null,"aria-label":this.loading?this.messages.loading:E(this),"aria-live":"polite",class:{[e.buttonPadding]:n,[e.buttonPaddingShrunk]:!n,[e.contentSlotted]:this.hasContent,[e.iconStartEmpty]:!this.iconStart,[e.iconEndEmpty]:!this.iconEnd},disabled:t==="button"?this.disabled:null,download:t==="a"?this.download===!0||this.download===""?"":this.download||null:null,href:t==="a"&&this.href,name:t==="button"&&this.name,onClick:this.handleClick,ref:this.setChildEl,rel:t==="a"&&this.rel,tabIndex:this.disabled?-1:null,target:t==="a"&&this.target,title:this.tooltipText,type:t==="button"&&this.type},s,this.iconStart?d:null,this.hasContent?p:null,this.iconEnd?h:null))}async setFocus(){await O(this),this.childEl?.focus()}effectiveLocaleChange(){A(this,this.effectiveLocale)}updateHasContent(){const t=this.el.textContent.trim().length>0||this.el.childNodes.length>0;this.hasContent=this.el.childNodes.length===1&&this.el.childNodes[0]?.nodeName==="#text"?this.el.textContent?.trim().length>0:t}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.handleClick(),this.setFocus()}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{"aria-expanded":["handleGlobalAttributesChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return N}},[1,"calcite-button",{alignment:[513],appearance:[513],label:[1],kind:[513],disabled:[516],form:[513],download:[520],href:[513],iconEnd:[513,"icon-end"],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],loading:[516],name:[513],rel:[513],round:[516],scale:[513],splitChild:[520,"split-child"],target:[513],type:[513],width:[513],messages:[1040],messageOverrides:[1040],hasContent:[32],effectiveLocale:[32],defaultMessages:[32],tooltipText:[32],setFocus:[64]},void 0,{"aria-expanded":["handleGlobalAttributesChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function c(){typeof customElements>"u"||["calcite-button","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-button":customElements.get(t)||customElements.define(t,i);break;case"calcite-icon":customElements.get(t)||I();break;case"calcite-loader":customElements.get(t)||j();break}})}c();const at=i,nt=c;export{at as CalciteButton,nt as defineCustomElement}; diff --git a/main/assets/calcite-chip-DE_c-1hr-CqMmwMwm.js b/main/assets/calcite-chip-DE_c-1hr-CqMmwMwm.js new file mode 100644 index 000000000..5f6bb0757 --- /dev/null +++ b/main/assets/calcite-chip-DE_c-1hr-CqMmwMwm.js @@ -0,0 +1,21 @@ +import{p,b as d,W as c,c as m,a as i,D as v}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{G as g,A as u}from"./dom-N58V0tYi-DBU3jlah.js";import{r as b,o as x,f}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{l as k,d as y,M as C,h as z}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{l as S,p as I}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{K as w,q as M}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{n as E}from"./key-CZySMiwx-kmS7VeUz.js";import{e as n}from"./component-CWGf1hug-BASJpoEG.js";import{m as D}from"./icon-BXFbBbop-Du8Zws1L.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-Du14S4xc.js";const t={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",single:"single",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle",selected:"selected"},H={image:"image"},a={close:"x",checkedSingle:"circle-f",uncheckedMultiple:"square",checkedMultiple:"check-square-f"},L=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;cursor:default;border-radius:var(--calcite-chip-corner-radius, 9999px)}:host([closed]){display:none}:host([appearance=outline]) .container,:host([appearance=outline-fill]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([appearance=outline]):host([kind=brand]) .container,:host([appearance=outline-fill]):host([kind=brand]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-brand))}:host([appearance=outline]):host([kind=inverse]) .container,:host([appearance=outline-fill]):host([kind=inverse]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-inverse))}:host([appearance=outline]):host([kind=neutral]) .container,:host([appearance=outline-fill]):host([kind=neutral]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-1))}:host([appearance=outline]) .container{background-color:transparent}:host([appearance=outline-fill]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-1))}:host([appearance=solid]) .container{border-color:transparent}:host([appearance=solid]):host([kind=brand]) .container,:host([appearance=solid]):host([kind=inverse]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-inverse))}:host([appearance=solid]):host([kind=brand]) .close,:host([appearance=solid]):host([kind=inverse]) .close{outline-color:var(--calcite-color-text-inverse)}:host([appearance=solid]):host([kind=brand]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-brand))}:host([appearance=solid]):host([kind=inverse]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-inverse))}:host([appearance=solid]):host([kind=neutral]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-2))}:host([kind=neutral]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([selected]) .select-icon{opacity:1}:host([scale=s]) .container{--calcite-internal-chip-block-size:1.5rem ;--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--2);--calcite-internal-chip-icon-size:1rem ;--calcite-internal-chip-icon-space:0.25rem ;--calcite-internal-chip-image-size:1.25rem ;--calcite-internal-chip-title-space:0.25rem ;--calcite-internal-close-size:1rem }:host([scale=s]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px)}:host([scale=s]) .container.image--slotted:has(.chip-icon),:host([scale=s]) .container.image--slotted.text--slotted,:host([scale=s]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.25rem }:host([scale=s]) .container.image--slotted:not(.text--slotted,:has(.chip-icon)),:host([scale=s]) .container.image--slotted:not(.selectable){--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=s]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=s]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=s]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.375rem ;--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.multiple:not(.is-circle).image--slotted:not(.text--slotted){--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container{--calcite-internal-chip-block-size:2rem ;--calcite-internal-chip-container-space-x-end:0.375rem ;--calcite-internal-chip-container-space-x-start:0.375rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--1);--calcite-internal-chip-icon-size:1.5rem ;--calcite-internal-chip-icon-space:0.375rem ;--calcite-internal-chip-image-size:1.5rem ;--calcite-internal-chip-title-space:0.375rem ;--calcite-internal-close-size:1.5rem }:host([scale=m]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=m]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.image--slotted:has(.chip-icon),:host([scale=m]) .container.image--slotted.text--slotted,:host([scale=m]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.375rem }:host([scale=m]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-select-space-x-start:0}:host([scale=m]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container.multiple:not(.is-circle){--calcite-internal-chip-select-space-x-end:0.125rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=m]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=m]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.25rem }:host([scale=l]) .container{--calcite-internal-chip-block-size:2.75rem ;--calcite-internal-chip-container-space-x-end:0.5rem ;--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-font-size:var(--calcite-font-size-0);--calcite-internal-chip-icon-size:2rem ;--calcite-internal-chip-icon-space:0.5rem ;--calcite-internal-chip-image-size:2rem ;--calcite-internal-chip-title-space:0.5rem ;--calcite-internal-close-size:2rem }:host([scale=l]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=l]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.image--slotted:has(.chip-icon),:host([scale=l]) .container.image--slotted.text--slotted,:host([scale=l]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.5rem }:host([scale=l]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=l]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0.5rem }:host([scale=l]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=l]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.75rem }:host([scale=l]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.375rem }.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;border-radius:var(--calcite-chip-corner-radius, 9999px);border-width:var(--calcite-border-width-sm);border-style:solid;font-size:var(--calcite-internal-chip-font-size, var(--calcite-font-size));padding-inline-start:var(--calcite-internal-chip-container-space-x-start);padding-inline-end:var(--calcite-internal-chip-container-space-x-end);block-size:var(--calcite-internal-chip-block-size, auto);inline-size:var(--calcite-internal-chip-inline-size, auto);min-inline-size:var(--calcite-internal-chip-block-size, auto)}.container:hover .select-icon--active{opacity:1}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.container.text--slotted .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.container:not(.text--slotted) .title,.container:not(.image--slotted) .image-container{display:none}.container.is-circle .chip-icon,.container.is-circle .image-container{padding:0}.title{padding-inline:var(--calcite-internal-chip-title-space)}.image-container{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;pointer-events:none;block-size:var(--calcite-internal-chip-image-size, 1.5rem);inline-size:var(--calcite-internal-chip-image-size, 1.5rem);padding-inline-start:0;padding-inline-end:var(--calcite-internal-chip-image-space-x-end, 0)}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);color:var(--calcite-chip-icon-color, var(--calcite-chip-text-color, var(--calcite-icon-color, currentColor)));padding-inline:var(--calcite-internal-chip-icon-space, 0.375rem)}.select-icon{align-self:center;justify-content:center;align-items:center;display:flex;inset-block-start:-1px;position:absolute;visibility:hidden;inline-size:auto;opacity:0;transition:opacity 0.15s ease-in-out, inline-size 0.15s ease-in-out;color:var(--calcite-chip-select-icon-color, currentColor)}.select-icon.select-icon--active{position:relative;visibility:visible;opacity:0.5;color:var(--calcite-chip-select-icon-color-pressed, var(--calcite-chip-select-icon-color, currentColor))}.multiple .select-icon{display:flex;align-items:center;justify-content:center}.multiple .select-icon,.single .select-icon--active{padding-inline-start:var(--calcite-internal-chip-select-space-x-start);padding-inline-end:var(--calcite-internal-chip-select-space-x-end);block-size:var(--calcite-internal-chip-icon-size, 1.5rem);inline-size:var(--calcite-internal-chip-icon-size, 1.5rem)}slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}.close{margin:0px;cursor:pointer;align-items:center;border-radius:50%;border-style:none;outline-color:transparent;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;background-color:var(--calcite-close-background-color, var(--calcite-color-transparent));-webkit-appearance:none;display:flex;align-content:center;justify-content:center;color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, var(--calcite-internal-chip-close-icon-color, var(--calcite-color-text-1))));block-size:var(--calcite-internal-close-size, 1.5rem);inline-size:var(--calcite-internal-close-size, 1.5rem);padding:0}.close:hover,.close:focus{background-color:var(--calcite-close-background-color-hover, var(--calcite-color-transparent-hover))}.close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.close:active{background-color:var(--calcite-close-background-color-press, var(--calcite-color-transparent-press))}.close calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,K=L,l=p(class extends d{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteChipClose=c(this,"calciteChipClose",6),this.calciteChipSelect=c(this,"calciteChipSelect",6),this.calciteInternalChipKeyEvent=c(this,"calciteInternalChipKeyEvent",6),this.calciteInternalChipSelect=c(this,"calciteInternalChipSelect",6),this.calciteInternalSyncSelectedChips=c(this,"calciteInternalSyncSelectedChips",6),this.handleDefaultSlotChange=()=>{this.updateHasText()},this.close=()=>{this.calciteChipClose.emit(),this.selected=!1,this.closed=!0},this.closeButtonKeyDownHandler=e=>{E(e.key)&&(e.preventDefault(),this.close())},this.handleSlotImageChange=e=>{this.hasImage=g(e)},this.handleEmittingEvent=()=>{this.interactive&&this.calciteChipSelect.emit()},this.disabled=!1,this.appearance="solid",this.kind="neutral",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.label=void 0,this.value=void 0,this.closed=!1,this.selectionMode="none",this.selected=!1,this.messageOverrides=void 0,this.messages=void 0,this.interactive=!1,this.parentChipGroup=void 0,this.defaultMessages=void 0,this.effectiveLocale=void 0,this.hasText=!1,this.hasImage=!1}watchSelected(e){this.selectionMode!=="none"&&this.handleSelectionPropertyChange(e)}onMessagesChange(){}effectiveLocaleChange(){k(this,this.effectiveLocale)}connectedCallback(){w(this),y(this)}componentDidLoad(){b(this),this.selectionMode!=="none"&&this.interactive&&this.selected&&this.handleSelectionPropertyChange(this.selected)}componentDidRender(){S(this)}disconnectedCallback(){M(this),C(this)}async componentWillLoad(){x(this),m()&&(await z(this),this.updateHasText())}keyDownHandler(e){if(e.target===this.el)switch(e.key){case" ":case"Enter":this.handleEmittingEvent(),e.preventDefault();break;case"ArrowRight":case"ArrowLeft":case"Home":case"End":this.calciteInternalChipKeyEvent.emit(e),e.preventDefault();break}}clickHandler(){!this.interactive&&this.closable&&this.closeButtonEl.focus()}async setFocus(){await f(this),!this.disabled&&this.interactive?this.containerEl?.focus():!this.disabled&&this.closable&&this.closeButtonEl?.focus()}updateHasText(){this.hasText=this.el.textContent.trim().length>0}handleSelectionPropertyChange(e){this.selectionMode==="single"&&this.calciteInternalSyncSelectedChips.emit(),!this.parentChipGroup.selectedItems.includes(this.el)&&e&&this.selectionMode!=="multiple"&&this.calciteInternalChipSelect.emit(),this.selectionMode!=="single"&&this.calciteInternalSyncSelectedChips.emit()}renderChipImage(){return i("div",{class:t.imageContainer},i("slot",{name:H.image,onSlotchange:this.handleSlotImageChange}))}renderSelectionIcon(){const e=this.selectionMode==="multiple"?this.selected?a.checkedMultiple:a.uncheckedMultiple:this.selected?a.checkedSingle:void 0;return i("div",{class:{[t.selectIcon]:!0,[t.selectIconActive]:this.selectionMode==="multiple"||this.selected}},e?i("calcite-icon",{icon:e,scale:n(this.scale)}):null)}renderCloseButton(){return i("button",{"aria-label":this.messages.dismissLabel,class:t.close,onClick:this.close,onKeyDown:this.closeButtonKeyDownHandler,ref:e=>this.closeButtonEl=e,tabIndex:this.disabled?-1:0},i("calcite-icon",{icon:a.close,scale:n(this.scale)}))}renderIcon(){return i("calcite-icon",{class:t.chipIcon,flipRtl:this.iconFlipRtl,icon:this.icon,scale:n(this.scale)})}render(){const{disabled:e}=this,o=e||!e&&!this.interactive,r=this.selectionMode==="multiple"&&this.interactive?"checkbox":this.selectionMode!=="none"&&this.interactive?"radio":this.interactive?"button":void 0;return i(v,{key:"7feca8bad37627baabfc4abd25cf135e1e9f196b"},i(I,{key:"af2360b4b768ae8c643d52f4bdb9f5d282504114",disabled:e},i("div",{key:"8d905c4ab20d271a211282b95ebcb2d305d76cb7","aria-checked":this.selectionMode!=="none"&&this.interactive?u(this.selected):void 0,"aria-label":this.label,class:{[t.container]:!0,[t.textSlotted]:this.hasText,[t.imageSlotted]:this.hasImage,[t.selectable]:this.selectionMode!=="none",[t.multiple]:this.selectionMode==="multiple",[t.single]:this.selectionMode==="single"||this.selectionMode==="single-persist",[t.selected]:this.selected,[t.closable]:this.closable,[t.nonInteractive]:!this.interactive,[t.isCircle]:!this.closable&&!this.hasText&&(!this.icon||!this.hasImage)&&(this.selectionMode==="none"||!!this.selectionMode&&this.selectionMode!=="multiple"&&!this.selected)},onClick:this.handleEmittingEvent,ref:h=>this.containerEl=h,role:r,tabIndex:o?-1:0},this.selectionMode!=="none"&&this.renderSelectionIcon(),this.renderChipImage(),this.icon&&this.renderIcon(),i("span",{key:"dab6eae3f8330b85ffac4c7fe1b2fcbb53327196",class:t.title},i("slot",{key:"72ba5bd0c7a97c30f766da119f419261aab24acb",onSlotchange:this.handleDefaultSlotChange})),this.closable&&this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{selected:["watchSelected"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return K}},[1,"calcite-chip",{disabled:[516],appearance:[513],kind:[513],closable:[516],icon:[513],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],label:[1],value:[8],closed:[1540],selectionMode:[1,"selection-mode"],selected:[1540],messageOverrides:[1040],messages:[1040],interactive:[4],parentChipGroup:[16],defaultMessages:[32],effectiveLocale:[32],hasText:[32],hasImage:[32],setFocus:[64]},[[0,"keydown","keyDownHandler"],[0,"click","clickHandler"]],{selected:["watchSelected"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function s(){typeof customElements>"u"||["calcite-chip","calcite-icon"].forEach(e=>{switch(e){case"calcite-chip":customElements.get(e)||customElements.define(e,l);break;case"calcite-icon":customElements.get(e)||D();break}})}s();const W=l,J=s;export{W as CalciteChip,J as defineCustomElement}; diff --git a/main/assets/calcite-chip-DE_c-1hr-rXOunzT9.js b/main/assets/calcite-chip-DE_c-1hr-rXOunzT9.js deleted file mode 100644 index 84dd546b3..000000000 --- a/main/assets/calcite-chip-DE_c-1hr-rXOunzT9.js +++ /dev/null @@ -1,21 +0,0 @@ -import{p,b as d,W as c,c as m,a as i,D as v}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{G as g,A as u}from"./dom-N58V0tYi-DBU3jlah.js";import{r as b,o as x,f}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{l as k,d as y,M as C,h as z}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{l as S,p as I}from"./interactive-DqhNilgd-DrUFww1w.js";import{K as w,q as M}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{n as E}from"./key-CZySMiwx-kmS7VeUz.js";import{e as n}from"./component-CWGf1hug-BASJpoEG.js";import{m as D}from"./icon-BXFbBbop-O5hL8B42.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-DJJPVpPW.js";const t={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",single:"single",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle",selected:"selected"},H={image:"image"},a={close:"x",checkedSingle:"circle-f",uncheckedMultiple:"square",checkedMultiple:"check-square-f"},L=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;cursor:default;border-radius:var(--calcite-chip-corner-radius, 9999px)}:host([closed]){display:none}:host([appearance=outline]) .container,:host([appearance=outline-fill]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([appearance=outline]):host([kind=brand]) .container,:host([appearance=outline-fill]):host([kind=brand]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-brand))}:host([appearance=outline]):host([kind=inverse]) .container,:host([appearance=outline-fill]):host([kind=inverse]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-inverse))}:host([appearance=outline]):host([kind=neutral]) .container,:host([appearance=outline-fill]):host([kind=neutral]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-1))}:host([appearance=outline]) .container{background-color:transparent}:host([appearance=outline-fill]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-1))}:host([appearance=solid]) .container{border-color:transparent}:host([appearance=solid]):host([kind=brand]) .container,:host([appearance=solid]):host([kind=inverse]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-inverse))}:host([appearance=solid]):host([kind=brand]) .close,:host([appearance=solid]):host([kind=inverse]) .close{outline-color:var(--calcite-color-text-inverse)}:host([appearance=solid]):host([kind=brand]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-brand))}:host([appearance=solid]):host([kind=inverse]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-inverse))}:host([appearance=solid]):host([kind=neutral]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-2))}:host([kind=neutral]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([selected]) .select-icon{opacity:1}:host([scale=s]) .container{--calcite-internal-chip-block-size:1.5rem ;--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--2);--calcite-internal-chip-icon-size:1rem ;--calcite-internal-chip-icon-space:0.25rem ;--calcite-internal-chip-image-size:1.25rem ;--calcite-internal-chip-title-space:0.25rem ;--calcite-internal-close-size:1rem }:host([scale=s]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px)}:host([scale=s]) .container.image--slotted:has(.chip-icon),:host([scale=s]) .container.image--slotted.text--slotted,:host([scale=s]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.25rem }:host([scale=s]) .container.image--slotted:not(.text--slotted,:has(.chip-icon)),:host([scale=s]) .container.image--slotted:not(.selectable){--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=s]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=s]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=s]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.375rem ;--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.multiple:not(.is-circle).image--slotted:not(.text--slotted){--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container{--calcite-internal-chip-block-size:2rem ;--calcite-internal-chip-container-space-x-end:0.375rem ;--calcite-internal-chip-container-space-x-start:0.375rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--1);--calcite-internal-chip-icon-size:1.5rem ;--calcite-internal-chip-icon-space:0.375rem ;--calcite-internal-chip-image-size:1.5rem ;--calcite-internal-chip-title-space:0.375rem ;--calcite-internal-close-size:1.5rem }:host([scale=m]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=m]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.image--slotted:has(.chip-icon),:host([scale=m]) .container.image--slotted.text--slotted,:host([scale=m]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.375rem }:host([scale=m]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-select-space-x-start:0}:host([scale=m]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container.multiple:not(.is-circle){--calcite-internal-chip-select-space-x-end:0.125rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=m]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=m]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.25rem }:host([scale=l]) .container{--calcite-internal-chip-block-size:2.75rem ;--calcite-internal-chip-container-space-x-end:0.5rem ;--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-font-size:var(--calcite-font-size-0);--calcite-internal-chip-icon-size:2rem ;--calcite-internal-chip-icon-space:0.5rem ;--calcite-internal-chip-image-size:2rem ;--calcite-internal-chip-title-space:0.5rem ;--calcite-internal-close-size:2rem }:host([scale=l]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=l]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.image--slotted:has(.chip-icon),:host([scale=l]) .container.image--slotted.text--slotted,:host([scale=l]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.5rem }:host([scale=l]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=l]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0.5rem }:host([scale=l]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=l]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.75rem }:host([scale=l]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.375rem }.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;border-radius:var(--calcite-chip-corner-radius, 9999px);border-width:var(--calcite-border-width-sm);border-style:solid;font-size:var(--calcite-internal-chip-font-size, var(--calcite-font-size));padding-inline-start:var(--calcite-internal-chip-container-space-x-start);padding-inline-end:var(--calcite-internal-chip-container-space-x-end);block-size:var(--calcite-internal-chip-block-size, auto);inline-size:var(--calcite-internal-chip-inline-size, auto);min-inline-size:var(--calcite-internal-chip-block-size, auto)}.container:hover .select-icon--active{opacity:1}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - 2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.container.text--slotted .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.container:not(.text--slotted) .title,.container:not(.image--slotted) .image-container{display:none}.container.is-circle .chip-icon,.container.is-circle .image-container{padding:0}.title{padding-inline:var(--calcite-internal-chip-title-space)}.image-container{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;pointer-events:none;block-size:var(--calcite-internal-chip-image-size, 1.5rem);inline-size:var(--calcite-internal-chip-image-size, 1.5rem);padding-inline-start:0;padding-inline-end:var(--calcite-internal-chip-image-space-x-end, 0)}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);color:var(--calcite-chip-icon-color, var(--calcite-chip-text-color, var(--calcite-icon-color, currentColor)));padding-inline:var(--calcite-internal-chip-icon-space, 0.375rem)}.select-icon{align-self:center;justify-content:center;align-items:center;display:flex;inset-block-start:-1px;position:absolute;visibility:hidden;inline-size:auto;opacity:0;transition:opacity 0.15s ease-in-out, inline-size 0.15s ease-in-out;color:var(--calcite-chip-select-icon-color, currentColor)}.select-icon.select-icon--active{position:relative;visibility:visible;opacity:0.5;color:var(--calcite-chip-select-icon-color-pressed, var(--calcite-chip-select-icon-color, currentColor))}.multiple .select-icon{display:flex;align-items:center;justify-content:center}.multiple .select-icon,.single .select-icon--active{padding-inline-start:var(--calcite-internal-chip-select-space-x-start);padding-inline-end:var(--calcite-internal-chip-select-space-x-end);block-size:var(--calcite-internal-chip-icon-size, 1.5rem);inline-size:var(--calcite-internal-chip-icon-size, 1.5rem)}slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}.close{margin:0px;cursor:pointer;align-items:center;border-radius:50%;border-style:none;outline-color:transparent;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;background-color:var(--calcite-close-background-color, var(--calcite-color-transparent));-webkit-appearance:none;display:flex;align-content:center;justify-content:center;color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, var(--calcite-internal-chip-close-icon-color, var(--calcite-color-text-1))));block-size:var(--calcite-internal-close-size, 1.5rem);inline-size:var(--calcite-internal-close-size, 1.5rem);padding:0}.close:hover,.close:focus{background-color:var(--calcite-close-background-color-hover, var(--calcite-color-transparent-hover))}.close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.close:active{background-color:var(--calcite-close-background-color-press, var(--calcite-color-transparent-press))}.close calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,K=L,l=p(class extends d{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteChipClose=c(this,"calciteChipClose",6),this.calciteChipSelect=c(this,"calciteChipSelect",6),this.calciteInternalChipKeyEvent=c(this,"calciteInternalChipKeyEvent",6),this.calciteInternalChipSelect=c(this,"calciteInternalChipSelect",6),this.calciteInternalSyncSelectedChips=c(this,"calciteInternalSyncSelectedChips",6),this.handleDefaultSlotChange=()=>{this.updateHasText()},this.close=()=>{this.calciteChipClose.emit(),this.selected=!1,this.closed=!0},this.closeButtonKeyDownHandler=e=>{E(e.key)&&(e.preventDefault(),this.close())},this.handleSlotImageChange=e=>{this.hasImage=g(e)},this.handleEmittingEvent=()=>{this.interactive&&this.calciteChipSelect.emit()},this.disabled=!1,this.appearance="solid",this.kind="neutral",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.label=void 0,this.value=void 0,this.closed=!1,this.selectionMode="none",this.selected=!1,this.messageOverrides=void 0,this.messages=void 0,this.interactive=!1,this.parentChipGroup=void 0,this.defaultMessages=void 0,this.effectiveLocale=void 0,this.hasText=!1,this.hasImage=!1}watchSelected(e){this.selectionMode!=="none"&&this.handleSelectionPropertyChange(e)}onMessagesChange(){}effectiveLocaleChange(){k(this,this.effectiveLocale)}connectedCallback(){w(this),y(this)}componentDidLoad(){b(this),this.selectionMode!=="none"&&this.interactive&&this.selected&&this.handleSelectionPropertyChange(this.selected)}componentDidRender(){S(this)}disconnectedCallback(){M(this),C(this)}async componentWillLoad(){x(this),m()&&(await z(this),this.updateHasText())}keyDownHandler(e){if(e.target===this.el)switch(e.key){case" ":case"Enter":this.handleEmittingEvent(),e.preventDefault();break;case"ArrowRight":case"ArrowLeft":case"Home":case"End":this.calciteInternalChipKeyEvent.emit(e),e.preventDefault();break}}clickHandler(){!this.interactive&&this.closable&&this.closeButtonEl.focus()}async setFocus(){await f(this),!this.disabled&&this.interactive?this.containerEl?.focus():!this.disabled&&this.closable&&this.closeButtonEl?.focus()}updateHasText(){this.hasText=this.el.textContent.trim().length>0}handleSelectionPropertyChange(e){this.selectionMode==="single"&&this.calciteInternalSyncSelectedChips.emit(),!this.parentChipGroup.selectedItems.includes(this.el)&&e&&this.selectionMode!=="multiple"&&this.calciteInternalChipSelect.emit(),this.selectionMode!=="single"&&this.calciteInternalSyncSelectedChips.emit()}renderChipImage(){return i("div",{class:t.imageContainer},i("slot",{name:H.image,onSlotchange:this.handleSlotImageChange}))}renderSelectionIcon(){const e=this.selectionMode==="multiple"?this.selected?a.checkedMultiple:a.uncheckedMultiple:this.selected?a.checkedSingle:void 0;return i("div",{class:{[t.selectIcon]:!0,[t.selectIconActive]:this.selectionMode==="multiple"||this.selected}},e?i("calcite-icon",{icon:e,scale:n(this.scale)}):null)}renderCloseButton(){return i("button",{"aria-label":this.messages.dismissLabel,class:t.close,onClick:this.close,onKeyDown:this.closeButtonKeyDownHandler,ref:e=>this.closeButtonEl=e,tabIndex:this.disabled?-1:0},i("calcite-icon",{icon:a.close,scale:n(this.scale)}))}renderIcon(){return i("calcite-icon",{class:t.chipIcon,flipRtl:this.iconFlipRtl,icon:this.icon,scale:n(this.scale)})}render(){const{disabled:e}=this,o=e||!e&&!this.interactive,r=this.selectionMode==="multiple"&&this.interactive?"checkbox":this.selectionMode!=="none"&&this.interactive?"radio":this.interactive?"button":void 0;return i(v,{key:"7feca8bad37627baabfc4abd25cf135e1e9f196b"},i(I,{key:"af2360b4b768ae8c643d52f4bdb9f5d282504114",disabled:e},i("div",{key:"8d905c4ab20d271a211282b95ebcb2d305d76cb7","aria-checked":this.selectionMode!=="none"&&this.interactive?u(this.selected):void 0,"aria-label":this.label,class:{[t.container]:!0,[t.textSlotted]:this.hasText,[t.imageSlotted]:this.hasImage,[t.selectable]:this.selectionMode!=="none",[t.multiple]:this.selectionMode==="multiple",[t.single]:this.selectionMode==="single"||this.selectionMode==="single-persist",[t.selected]:this.selected,[t.closable]:this.closable,[t.nonInteractive]:!this.interactive,[t.isCircle]:!this.closable&&!this.hasText&&(!this.icon||!this.hasImage)&&(this.selectionMode==="none"||!!this.selectionMode&&this.selectionMode!=="multiple"&&!this.selected)},onClick:this.handleEmittingEvent,ref:h=>this.containerEl=h,role:r,tabIndex:o?-1:0},this.selectionMode!=="none"&&this.renderSelectionIcon(),this.renderChipImage(),this.icon&&this.renderIcon(),i("span",{key:"dab6eae3f8330b85ffac4c7fe1b2fcbb53327196",class:t.title},i("slot",{key:"72ba5bd0c7a97c30f766da119f419261aab24acb",onSlotchange:this.handleDefaultSlotChange})),this.closable&&this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{selected:["watchSelected"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return K}},[1,"calcite-chip",{disabled:[516],appearance:[513],kind:[513],closable:[516],icon:[513],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],label:[1],value:[8],closed:[1540],selectionMode:[1,"selection-mode"],selected:[1540],messageOverrides:[1040],messages:[1040],interactive:[4],parentChipGroup:[16],defaultMessages:[32],effectiveLocale:[32],hasText:[32],hasImage:[32],setFocus:[64]},[[0,"keydown","keyDownHandler"],[0,"click","clickHandler"]],{selected:["watchSelected"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function s(){typeof customElements>"u"||["calcite-chip","calcite-icon"].forEach(e=>{switch(e){case"calcite-chip":customElements.get(e)||customElements.define(e,l);break;case"calcite-icon":customElements.get(e)||D();break}})}s();const W=l,J=s;export{W as CalciteChip,J as defineCustomElement}; diff --git a/main/assets/calcite-dialog-DAngwHC1-CHG3gNw0.js b/main/assets/calcite-dialog-DAngwHC1-CHG3gNw0.js deleted file mode 100644 index c1c25d725..000000000 --- a/main/assets/calcite-dialog-DAngwHC1-CHG3gNw0.js +++ /dev/null @@ -1,6 +0,0 @@ -import{p as Ni,b as Ji,W as Ot,a as C,D as Qi}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{A as Zi,g as tr}from"./dom-N58V0tYi-DBU3jlah.js";import{g as er,H as _n,E as nr,j as ir,K as rr,O as or}from"./action-menu-DTIJuZNc-DM_2ZtiL.js";import{o as ar,r as sr,f as cr}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{c as lr}from"./observers-BigwqTsw-DJJPVpPW.js";import{p as ur}from"./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js";import{K as pr,q as dr}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{h as fr,d as hr,M as vr,l as gr}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{o as mr}from"./component-CWGf1hug-BASJpoEG.js";import{s as V,y as yr}from"./panel-DRUEhsxp-DdHxn7R2.js";import{m as br}from"./action-GCQoufcz-Cwgl1KRC.js";import{m as xr}from"./icon-BXFbBbop-O5hL8B42.js";import{v as wr}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";import{c as Er}from"./scrim-BscQh4v9-uedhhKYH.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./floating-ui-DKFFlLv3-DZ3_fUHw.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./FloatingArrow-BG9llDYg-B1DQ6cRb.js";import"./interactive-DqhNilgd-DrUFww1w.js";var kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},An={exports:{}};(function(y,A){(function(O,M){y.exports=M()})(kr,function(){function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function M(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,i=B(e);if(t){var r=B(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(o,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _t(o)}(this,n)}}function It(){return It=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(o,a){for(;!Object.prototype.hasOwnProperty.call(o,a)&&(o=B(o))!==null;);return o}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},It.apply(this,arguments)}function Se(e){var t=function(n,i){if(typeof n!="object"||n===null)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var o=r.call(n,i);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(e,"string");return typeof t=="symbol"?t:t+""}var Pe=function(e){return!(!e||!e.Window)&&e instanceof e.Window},De=void 0,ct=void 0;function Oe(e){De=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),ct=e}function N(e){return Pe(e)?e:(e.ownerDocument||e).defaultView||ct.window}typeof window<"u"&&window&&Oe(window);var Mt=function(e){return!!e&&I(e)==="object"},_e=function(e){return typeof e=="function"},f={window:function(e){return e===ct||Pe(e)},docFrag:function(e){return Mt(e)&&e.nodeType===11},object:Mt,func:_e,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||I(e)!=="object")return!1;var t=N(e)||ct;return/object|function/.test(typeof Element>"u"?"undefined":I(Element))?e instanceof Element||e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return Mt(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return Mt(e)&&e.length!==void 0&&_e(e.splice)}};function Jt(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.prepared.axis;n==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):n==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function Ie(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="drag"){var i=n.prepared.axis;if(i==="x"||i==="y"){var r=i==="x"?"y":"x";t.page[r]=n.coords.start.page[r],t.client[r]=n.coords.start.client[r],t.delta[r]=0}}}var Ct={id:"actions/drag",install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.draggable=Ct.draggable,t.map.drag=Ct,t.methodDict.drag="draggable",i.actions.drag=Ct.defaults},listeners:{"interactions:before-action-move":Jt,"interactions:action-resume":Jt,"interactions:action-move":Ie,"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.buttons,r=n.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||i&n.options.drag.mouseButtons))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return f.object(e)?(this.options.drag.enabled=e.enabled!==!1,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):f.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:Jt,move:Ie,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(e){return e.search("drag")===0}},Me=Ct,X={init:function(e){var t=e;X.document=t.document,X.DocumentFragment=t.DocumentFragment||ft,X.SVGElement=t.SVGElement||ft,X.SVGSVGElement=t.SVGSVGElement||ft,X.SVGElementInstance=t.SVGElementInstance||ft,X.Element=t.Element||ft,X.HTMLElement=t.HTMLElement||X.Element,X.Event=t.Event,X.Touch=t.Touch||ft,X.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ft(){}var R=X,q={init:function(e){var t=R.Element,n=e.navigator||{};q.supportsTouch="ontouchstart"in e||f.func(e.DocumentTouch)&&R.document instanceof e.DocumentTouch,q.supportsPointerEvent=n.pointerEnabled!==!1&&!!R.PointerEvent,q.isIOS=/iP(hone|od|ad)/.test(n.platform),q.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),q.isIe9=/MSIE 9/.test(n.userAgent),q.isOperaMobile=n.appName==="Opera"&&q.supportsTouch&&/Presto/.test(n.userAgent),q.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",q.pEventTypes=q.supportsPointerEvent?R.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,q.wheelEvent=R.document&&"onmousewheel"in R.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},U=q;function lt(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ce(e,t){for(;f.element(e);){if(et(e,t))return e;e=J(e)}return null}function J(e){var t=e.parentNode;if(f.docFrag(t)){for(;(t=t.host)&&f.docFrag(t););return t}return t}function et(e,t){return ct!==De&&(t=t.replace(/\/deep\//g," ")),e[U.prefixedMatchesSelector](t)}var Qt=function(e){return e.parentNode||e.host};function Ae(e,t){for(var n,i=[],r=e;(n=Qt(r))&&r!==t&&n!==r.ownerDocument;)i.unshift(r),r=n;return i}function Zt(e,t,n){for(;f.element(e);){if(et(e,t))return!0;if((e=J(e))===n)return et(e,t)}return!1}function Re(e){return e.correspondingUseElement||e}function te(e){var t=e instanceof R.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ee(e){var t,n=te(e);if(!U.isIOS7&&n){var i={x:(t=(t=N(e))||ct).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};n.left+=i.x,n.right+=i.x,n.top+=i.y,n.bottom+=i.y}return n}function je(e){for(var t=[];e;)t.push(e),e=J(e);return t}function Fe(e){return!!f.string(e)&&(R.document.querySelector(e),!0)}function w(e,t){for(var n in t)e[n]=t[n];return e}function Le(e,t,n){return e==="parent"?J(n):e==="self"?t.getRect(n):Ce(n,e)}function mt(e,t,n,i){var r=e;return f.string(r)?r=Le(r,t,n):f.func(r)&&(r=r.apply(void 0,i)),f.element(r)&&(r=ee(r)),r}function At(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}}function ne(e){return!e||"x"in e&&"y"in e||((e=w({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e}function Rt(e,t,n){e.left&&(t.left+=n.x),e.right&&(t.right+=n.x),e.top&&(t.top+=n.y),e.bottom&&(t.bottom+=n.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function yt(e,t,n){var i=n&&e.options[n];return At(mt(i&&i.origin||e.options.origin,e,t,[e&&t]))||{x:0,y:0}}function ut(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(c){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},f.string(e)&&e.search(" ")!==-1&&(e=Be(e)),f.array(e))return e.forEach(function(c){return ut(c,t,n,i)}),i;if(f.object(e)&&(t=e,e=""),f.func(t)&&n(e))i[e]=i[e]||[],i[e].push(t);else if(f.array(t))for(var r=0,o=t;r1?Xe(t):t[0];Ke(i,e.page),function(r,o){o=o||{},U.isOperaMobile&&He(r)?Lt("screen",r,o):Lt("client",r,o)}(i,e.client),e.timeStamp=n}function ie(e){var t=[];return f.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function Xe(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},n=0;n=(parseInt(N(x).getComputedStyle(x).zIndex,10)||0)&&(b=S);else b=S}else b=S}return b}(a);return i.activeDrops[h]||null}function ce(e,t,n){var i=e.dropState,r={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return n.type==="dragstart"&&(r.activate=new ht(i,n,"dropactivate"),r.activate.target=null,r.activate.dropzone=null),n.type==="dragend"&&(r.deactivate=new ht(i,n,"dropdeactivate"),r.deactivate.target=null,r.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(r.leave=new ht(i,n,"dragleave"),n.dragLeave=r.leave.target=i.prev.element,n.prevDropzone=r.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(r.enter=new ht(i,n,"dragenter"),n.dragEnter=i.cur.element,n.dropzone=i.cur.dropzone)),n.type==="dragend"&&i.cur.dropzone&&(r.drop=new ht(i,n,"drop"),n.dropzone=i.cur.dropzone,n.relatedTarget=i.cur.element),n.type==="dragmove"&&i.cur.dropzone&&(r.move=new ht(i,n,"dropmove"),n.dropzone=i.cur.dropzone)),r}function le(e,t){var n=e.dropState,i=n.activeDrops,r=n.cur,o=n.prev;t.leave&&o.dropzone.fire(t.leave),t.enter&&r.dropzone.fire(t.enter),t.move&&r.dropzone.fire(t.move),t.drop&&r.dropzone.fire(t.drop),t.deactivate&&Ge(i,t.deactivate),n.prev.dropzone=r.dropzone,n.prev.element=r.element}function Ne(e,t){var n=e.interaction,i=e.iEvent,r=e.event;if(i.type==="dragmove"||i.type==="dragend"){var o=n.dropState;t.dynamicDrop&&(o.activeDrops=se(t,n.element));var a=i,s=$e(n,a,r);o.rejected=o.rejected&&!!s&&s.dropzone===o.cur.dropzone&&s.element===o.cur.element,o.cur.dropzone=s&&s.dropzone,o.cur.element=s&&s.element,o.events=ce(n,0,a)}}var Je={id:"actions/drop",install:function(e){var t=e.actions,n=e.interactStatic,i=e.Interactable,r=e.defaults;e.usePlugin(Me),i.prototype.dropzone=function(o){return function(a,s){if(f.object(s)){if(a.options.drop.enabled=s.enabled!==!1,s.listeners){var c=ut(s.listeners),u=Object.keys(c).reduce(function(p,d){return p[/^(enter|leave)/.test(d)?"drag".concat(d):/^(activate|deactivate|move)/.test(d)?"drop".concat(d):d]=c[d],p},{}),l=a.options.drop.listeners;l&&a.off(l),a.on(u),a.options.drop.listeners=u}return f.func(s.ondrop)&&a.on("drop",s.ondrop),f.func(s.ondropactivate)&&a.on("dropactivate",s.ondropactivate),f.func(s.ondropdeactivate)&&a.on("dropdeactivate",s.ondropdeactivate),f.func(s.ondragenter)&&a.on("dragenter",s.ondragenter),f.func(s.ondragleave)&&a.on("dragleave",s.ondragleave),f.func(s.ondropmove)&&a.on("dropmove",s.ondropmove),/^(pointer|center)$/.test(s.overlap)?a.options.drop.overlap=s.overlap:f.number(s.overlap)&&(a.options.drop.overlap=Math.max(Math.min(1,s.overlap),0)),"accept"in s&&(a.options.drop.accept=s.accept),"checker"in s&&(a.options.drop.checker=s.checker),a}return f.bool(s)?(a.options.drop.enabled=s,a):a.options.drop}(this,o)},i.prototype.dropCheck=function(o,a,s,c,u,l){return function(p,d,v,h,g,b,m){var x=!1;if(!(m=m||p.getRect(b)))return!!p.options.drop.checker&&p.options.drop.checker(d,v,x,p,b,h,g);var T=p.options.drop.overlap;if(T==="pointer"){var S=yt(h,g,"drag"),E=Ke(d);E.x+=S.x,E.y+=S.y;var z=E.x>m.left&&E.xm.top&&E.y=m.left&&Y<=m.right&&G>=m.top&&G<=m.bottom}return _&&f.number(T)&&(x=Math.max(0,Math.min(m.right,_.right)-Math.max(m.left,_.left))*Math.max(0,Math.min(m.bottom,_.bottom)-Math.max(m.top,_.top))/(_.width*_.height)>=T),p.options.drop.checker&&(x=p.options.drop.checker(d,v,x,p,b,h,g)),x}(this,o,a,s,c,u,l)},n.dynamicDrop=function(o){return f.bool(o)?(e.dynamicDrop=o,n):e.dynamicDrop},w(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",e.dynamicDrop=!1,r.actions.drop=Je.defaults},listeners:{"interactions:before-action-start":function(e){var t=e.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;r.activeDrops=[],r.events={},r.activeDrops=se(t,n.element),r.events=ce(n,0,i),r.events.activate&&(Ge(r.activeDrops,r.events.activate),t.fire("actions/drop:start",{interaction:n,dragEvent:i}))}},"interactions:action-move":Ne,"interactions:after-action-move":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;le(n,r.events),t.fire("actions/drop:move",{interaction:n,dragEvent:i}),r.events={}}},"interactions:action-end":function(e,t){if(e.interaction.prepared.name==="drag"){var n=e.interaction,i=e.iEvent;Ne(e,t),le(n,n.dropState.events),t.fire("actions/drop:end",{interaction:n,dragEvent:i})}},"interactions:stop":function(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.dropState;n&&(n.activeDrops=null,n.events=null,n.cur.dropzone=null,n.cur.element=null,n.prev.dropzone=null,n.prev.element=null,n.rejected=!1)}}},getActiveDrops:se,getDrop:$e,getDropEvents:ce,fireDropEvents:le,filterEventType:function(e){return e.search("drag")===0||e.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Bn=Je;function ue(e){var t=e.interaction,n=e.iEvent,i=e.phase;if(t.prepared.name==="gesture"){var r=t.pointers.map(function(u){return u.pointer}),o=i==="start",a=i==="end",s=t.interactable.options.deltaSource;if(n.touches=[r[0],r[1]],o)n.distance=oe(r,s),n.box=re(r),n.scale=1,n.ds=0,n.angle=ae(r,s),n.da=0,t.gesture.startDistance=n.distance,t.gesture.startAngle=n.angle;else if(a||t.pointers.length<2){var c=t.prevEvent;n.distance=c.distance,n.box=c.box,n.scale=c.scale,n.ds=0,n.angle=c.angle,n.da=0}else n.distance=oe(r,s),n.box=re(r),n.scale=n.distance/t.gesture.startDistance,n.angle=ae(r,s),n.ds=n.scale-t.gesture.scale,n.da=n.angle-t.gesture.angle;t.gesture.distance=n.distance,t.gesture.angle=n.angle,f.number(n.scale)&&n.scale!==1/0&&!isNaN(n.scale)&&(t.gesture.scale=n.scale)}}var pe={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.gesturable=function(r){return f.object(r)?(this.options.gesture.enabled=r.enabled!==!1,this.setPerAction("gesture",r),this.setOnEvents("gesture",r),this):f.bool(r)?(this.options.gesture.enabled=r,this):this.options.gesture},t.map.gesture=pe,t.methodDict.gesture="gesturable",i.actions.gesture=pe.defaults},listeners:{"interactions:action-start":ue,"interactions:action-move":ue,"interactions:action-end":ue,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var t=e.interactable.options.gesture;if(t&&t.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(e){return e.search("gesture")===0}},Yn=pe;function Hn(e,t,n,i,r,o,a){if(!t)return!1;if(t===!0){var s=f.number(o.width)?o.width:o.right-o.left,c=f.number(o.height)?o.height:o.bottom-o.top;if(a=Math.min(a,Math.abs((e==="left"||e==="right"?s:c)/2)),s<0&&(e==="left"?e="right":e==="right"&&(e="left")),c<0&&(e==="top"?e="bottom":e==="bottom"&&(e="top")),e==="left"){var u=s>=0?o.left:o.right;return n.x=0?o.top:o.bottom;return n.y(s>=0?o.right:o.left)-a;if(e==="bottom")return n.y>(c>=0?o.bottom:o.top)-a}return!!f.element(i)&&(f.element(t)?t===i:Zt(i,t,r))}function Qe(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.resizeAxes){var i=t;n.interactable.options.resize.square?(n.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=n.resizeAxes,n.resizeAxes==="x"?i.delta.y=0:n.resizeAxes==="y"&&(i.delta.x=0))}}var Q,pt,Z={id:"actions/resize",before:["actions/drag"],install:function(e){var t=e.actions,n=e.browser,i=e.Interactable,r=e.defaults;Z.cursors=function(o){return o.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),Z.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(o){return function(a,s,c){return f.object(s)?(a.options.resize.enabled=s.enabled!==!1,a.setPerAction("resize",s),a.setOnEvents("resize",s),f.string(s.axis)&&/^x$|^y$|^xy$/.test(s.axis)?a.options.resize.axis=s.axis:s.axis===null&&(a.options.resize.axis=c.defaults.actions.resize.axis),f.bool(s.preserveAspectRatio)?a.options.resize.preserveAspectRatio=s.preserveAspectRatio:f.bool(s.square)&&(a.options.resize.square=s.square),a):f.bool(s)?(a.options.resize.enabled=s,a):a.options.resize}(this,o,e)},t.map.resize=Z,t.methodDict.resize="resizable",r.actions.resize=Z.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.rect;i._rects={start:w({},o),corrected:w({},o),previous:w({},o),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},r.edges=i.prepared.edges,r.rect=i._rects.corrected,r.deltaRect=i._rects.delta}})(e),Qe(e)},"interactions:action-move":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.interactable.options.resize.invert,a=o==="reposition"||o==="negate",s=i.rect,c=i._rects,u=c.start,l=c.corrected,p=c.delta,d=c.previous;if(w(d,l),a){if(w(l,s),o==="reposition"){if(l.top>l.bottom){var v=l.top;l.top=l.bottom,l.bottom=v}if(l.left>l.right){var h=l.left;l.left=l.right,l.right=h}}}else l.top=Math.min(s.top,u.bottom),l.bottom=Math.max(s.bottom,u.top),l.left=Math.min(s.left,u.right),l.right=Math.max(s.right,u.left);for(var g in l.width=l.right-l.left,l.height=l.bottom-l.top,l)p[g]=l[g]-d[g];r.edges=i.prepared.edges,r.rect=l,r.deltaRect=p}})(e),Qe(e)},"interactions:action-end":function(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.prepared.edges){var i=t;i.edges=n.prepared.edges,i.rect=n._rects.corrected,i.deltaRect=n._rects.delta}},"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.element,r=e.rect,o=e.buttons;if(r){var a=w({},t.coords.cur.page),s=n.options.resize;if(s&&s.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||o&s.mouseButtons)){if(f.object(s.edges)){var c={left:!1,right:!1,top:!1,bottom:!1};for(var u in c)c[u]=Hn(u,s.edges[u],a,t._latestPointer.eventTarget,i,r,s.margin||Z.defaultMargin);c.left=c.left&&!c.right,c.top=c.top&&!c.bottom,(c.left||c.right||c.top||c.bottom)&&(e.action={name:"resize",edges:c})}else{var l=s.axis!=="y"&&a.x>r.right-Z.defaultMargin,p=s.axis!=="x"&&a.y>r.bottom-Z.defaultMargin;(l||p)&&(e.action={name:"resize",axes:(l?"x":"")+(p?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var t=e.edges,n=e.axis,i=e.name,r=Z.cursors,o=null;if(n)o=r[i+n];else if(t){for(var a="",s=0,c=["top","bottom","left","right"];s=1){var u={x:k.x*c,y:k.y*c};if(u.x||u.y){var l=en(o);f.window(o)?o.scrollBy(u.x,u.y):o&&(o.scrollLeft+=u.x,o.scrollTop+=u.y);var p=en(o),d={x:p.x-l.x,y:p.y-l.y};(d.x||d.y)&&t.fire({type:"autoscroll",target:n,interactable:t,delta:d,interaction:e,container:o})}k.prevTime=a}k.isScrolling&&(nt.cancel(k.i),k.i=nt.request(k.scroll))},check:function(e,t){var n;return(n=e.options[t].autoScroll)==null?void 0:n.enabled},onInteractionMove:function(e){var t=e.interaction,n=e.pointer;if(t.interacting()&&k.check(t.interactable,t.prepared.name))if(t.simulation)k.x=k.y=0;else{var i,r,o,a,s=t.interactable,c=t.element,u=t.prepared.name,l=s.options[u].autoScroll,p=tn(l.container,s,c);if(f.window(p))a=n.clientXp.innerWidth-k.margin,o=n.clientY>p.innerHeight-k.margin;else{var d=te(p);a=n.clientXd.right-k.margin,o=n.clientY>d.bottom-k.margin}k.x=r?1:a?-1:0,k.y=o?1:i?-1:0,k.isScrolling||(k.margin=l.margin,k.speed=l.speed,k.start(t))}}};function tn(e,t,n){return(f.string(e)?Le(e,t,n):e)||N(n)}function en(e){return f.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var qn={id:"auto-scroll",install:function(e){var t=e.defaults,n=e.actions;e.autoScroll=k,k.now=function(){return e.now()},n.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=k.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,k.stop(),k.interaction&&(k.interaction=null)},"interactions:stop":k.stop,"interactions:action-move":function(e){return k.onInteractionMove(e)}}},Vn=qn;function kt(e,t){var n=!1;return function(){return n||(ct.console.warn(t),n=!0),e.apply(this,arguments)}}function de(e,t){return e.name=t.name,e.axis=t.axis,e.edges=t.edges,e}function Wn(e){return f.bool(e)?(this.options.styleCursor=e,this):e===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Un(e){return f.func(e)?(this.options.actionChecker=e,this):e===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Gn={id:"auto-start/interactableMethods",install:function(e){var t=e.Interactable;t.prototype.getAction=function(n,i,r,o){var a=function(s,c,u,l,p){var d=s.getRect(l),v=c.buttons||{0:1,1:4,3:8,4:16}[c.button],h={action:null,interactable:s,interaction:u,element:l,rect:d,buttons:v};return p.fire("auto-start:check",h),h.action}(this,i,r,o,e);return this.options.actionChecker?this.options.actionChecker(n,i,a,this,o,r):a},t.prototype.ignoreFrom=kt(function(n){return this._backCompatOption("ignoreFrom",n)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=kt(function(n){return this._backCompatOption("allowFrom",n)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Un,t.prototype.styleCursor=Wn}};function nn(e,t,n,i,r){return t.testIgnoreAllow(t.options[e.name],n,i)&&t.options[e.name].enabled&&Yt(t,n,e,r)?e:null}function $n(e,t,n,i,r,o,a){for(var s=0,c=i.length;s=s||v.interactable===e&&((u+=h===n.name?1:0)>=o||v.element===t&&(l++,h===n.name&&l>=a))))return!1}return s>0}function an(e,t){return f.number(e)?(t.autoStart.maxInteractions=e,this):t.autoStart.maxInteractions}function fe(e,t,n){var i=n.autoStart.cursorElement;i&&i!==e&&(i.style.cursor=""),e.ownerDocument.documentElement.style.cursor=t,e.style.cursor=t,n.autoStart.cursorElement=t?e:null}function sn(e,t){var n=e.interactable,i=e.element,r=e.prepared;if(e.pointerType==="mouse"&&n&&n.options.styleCursor){var o="";if(r.name){var a=n.options[r.name].cursorChecker;o=f.func(a)?a(r,n,i,e._interacting):t.actions.map[r.name].getCursor(r)}fe(e.element,o||"",t)}else t.autoStart.cursorElement&&fe(t.autoStart.cursorElement,"",t)}var Nn={id:"auto-start/base",before:["actions"],install:function(e){var t=e.interactStatic,n=e.defaults;e.usePlugin(Gn),n.base.actionChecker=null,n.base.styleCursor=!0,w(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(i){return an(i,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:Yt,cursorElement:null}},listeners:{"interactions:down":function(e,t){var n=e.interaction,i=e.pointer,r=e.event,o=e.eventTarget;n.interacting()||on(n,rn(n,i,r,o,t),t)},"interactions:move":function(e,t){(function(n,i){var r=n.interaction,o=n.pointer,a=n.event,s=n.eventTarget;r.pointerType!=="mouse"||r.pointerIsDown||r.interacting()||on(r,rn(r,o,a,s,i),i)})(e,t),function(n,i){var r=n.interaction;if(r.pointerIsDown&&!r.interacting()&&r.pointerWasMoved&&r.prepared.name){i.fire("autoStart:before-start",n);var o=r.interactable,a=r.prepared.name;a&&o&&(o.options[a].manualStart||!Yt(o,r.element,r.prepared,i)?r.stop():(r.start(r.prepared,o,r.element),sn(r,i)))}}(e,t)},"interactions:stop":function(e,t){var n=e.interaction,i=n.interactable;i&&i.options.styleCursor&&fe(n.element,"",t)}},maxInteractions:an,withinInteractionLimit:Yt,validateAction:nn},he=Nn,Jn={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,t){var n=e.interaction,i=e.eventTarget,r=e.dx,o=e.dy;if(n.prepared.name==="drag"){var a=Math.abs(r),s=Math.abs(o),c=n.interactable.options.drag,u=c.startAxis,l=a>s?"x":a0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},n))},"interactions:move":function(e){var t=e.interaction,n=e.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!n&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var t=e.interaction;ve(t)>0&&(t.prepared.name=null)}},getHoldDuration:ve},Zn=Qn,ti={id:"auto-start",install:function(e){e.usePlugin(he),e.usePlugin(Zn),e.usePlugin(Jn)}},ei=function(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):f.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault};function ni(e){var t=e.interaction,n=e.event;t.interactable&&t.interactable.checkAndPreventDefault(n)}var cn={id:"core/interactablePreventDefault",install:function(e){var t=e.Interactable;t.prototype.preventDefault=ei,t.prototype.checkAndPreventDefault=function(n){return function(i,r,o){var a=i.options.preventDefault;if(a!=="never")if(a!=="always"){if(r.events.supportsPassive&&/^touch(start|move)$/.test(o.type)){var s=N(o.target).document,c=r.getDocOptions(s);if(!c||!c.events||c.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(o.type)||f.element(o.target)&&et(o.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||o.preventDefault()}else o.preventDefault()}(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var i=0,r=e.interactions.list;i150)return null;var r=180*Math.atan2(i.prevEvent.velocityY,i.prevEvent.velocityX)/Math.PI;r<0&&(r+=360);var o=112.5<=r&&r<247.5,a=202.5<=r&&r<337.5;return{up:a,down:!a&&22.5<=r&&r<157.5,left:o,right:!o&&(292.5<=r||r<67.5),angle:r,speed:i.prevEvent.speed,velocity:{x:i.prevEvent.velocityX,y:i.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),n}(Bt);Object.defineProperties(me.prototype,{pageX:{get:function(){return this.page.x},set:function(e){this.page.x=e}},pageY:{get:function(){return this.page.y},set:function(e){this.page.y=e}},clientX:{get:function(){return this.client.x},set:function(e){this.client.x=e}},clientY:{get:function(){return this.client.y},set:function(e){this.client.y=e}},dx:{get:function(){return this.delta.x},set:function(e){this.delta.x=e}},dy:{get:function(){return this.delta.y},set:function(e){this.delta.y=e}},velocityX:{get:function(){return this.velocity.x},set:function(e){this.velocity.x=e}},velocityY:{get:function(){return this.velocity.y},set:function(e){this.velocity.y=e}}});var ri=P(function e(t,n,i,r,o){D(this,e),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=n,this.event=i,this.downTime=r,this.downTarget=o}),oi=function(e){return e.interactable="",e.element="",e.prepared="",e.pointerIsDown="",e.pointerWasMoved="",e._proxy="",e}({}),pn=function(e){return e.start="",e.move="",e.end="",e.stop="",e.interacting="",e}({}),ai=0,si=function(){function e(t){var n=this,i=t.pointerType,r=t.scopeFire;D(this,e),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=kt(function(l){this.move(l)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=ai++,this._scopeFire=r,this.pointerType=i;var o=this;this._proxy={};var a=function(l){Object.defineProperty(n._proxy,l,{get:function(){return o[l]}})};for(var s in oi)a(s);var c=function(l){Object.defineProperty(n._proxy,l,{value:function(){return o[l].apply(o,arguments)}})};for(var u in pn)c(u);this._scopeFire("interactions:new",{interaction:this})}return P(e,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,n,i){var r=this.updatePointer(t,n,i,!0),o=this.pointers[r];this._scopeFire("interactions:down",{pointer:t,event:n,eventTarget:i,pointerIndex:r,pointerInfo:o,type:"down",interaction:this})}},{key:"start",value:function(t,n,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!n.options[t.name].enabled)&&(de(this.prepared,t),this.interactable=n,this.element=i,this.rect=n.getRect(i),this.edges=this.prepared.edges?w({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,n,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,n,i,!1);var r,o,a=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=bt(r,o)>this.pointerMoveTolerance);var s,c,u,l=this.getPointerIndex(t),p={pointer:t,pointerIndex:l,pointerInfo:this.pointers[l],event:n,type:"move",eventTarget:i,dx:r,dy:o,duplicate:a,interaction:this};a||(s=this.coords.velocity,c=this.coords.delta,u=Math.max(c.timeStamp/1e3,.001),s.page.x=c.page.x/u,s.page.y=c.page.y/u,s.client.x=c.client.x/u,s.client.y=c.client.y/u,s.timeStamp=u),this._scopeFire("interactions:move",p),a||this.simulation||(this.interacting()&&(p.type=null,this.move(p)),this.pointerWasMoved&&Ft(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||Ye(this.coords.delta),(t=w({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,n,i,r){var o=this.getPointerIndex(t);o===-1&&(o=this.updatePointer(t,n,i,!1));var a=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(a),{pointer:t,pointerIndex:o,pointerInfo:this.pointers[o],event:n,eventTarget:i,type:a,curEventTarget:r,interaction:this}),this.simulation||this.end(n),this.removePointer(t,n)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var n;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,n===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var n=xt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:wt(this.pointers,function(i){return i.id===n})}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,n,i,r){var o,a,s,c=xt(t),u=this.getPointerIndex(t),l=this.pointers[u];return r=r!==!1&&(r||/(down|start)$/i.test(n.type)),l?l.pointer=t:(l=new ri(c,t,n,null,null),u=this.pointers.length,this.pointers.push(l)),Ln(this.coords.cur,this.pointers.map(function(p){return p.pointer}),this._now()),o=this.coords.delta,a=this.coords.prev,s=this.coords.cur,o.page.x=s.page.x-a.page.x,o.page.y=s.page.y-a.page.y,o.client.x=s.client.x-a.client.x,o.client.y=s.client.y-a.client.y,o.timeStamp=s.timeStamp-a.timeStamp,r&&(this.pointerIsDown=!0,l.downTime=this.coords.cur.timeStamp,l.downTarget=i,jt(this.downPointer,t),this.interacting()||(Ft(this.coords.start,this.coords.cur),Ft(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(t,n,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:n,eventTarget:i,down:r,pointerInfo:l,pointerIndex:u,interaction:this}),u}},{key:"removePointer",value:function(t,n){var i=this.getPointerIndex(t);if(i!==-1){var r=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:n,eventTarget:null,pointerIndex:i,pointerInfo:r,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,n,i){this._latestPointer.pointer=t,this._latestPointer.event=n,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,n,i,r){return new me(this,t,this.prepared.name,n,this.element,i,r)}},{key:"_fireEvent",value:function(t){var n;(n=this.interactable)==null||n.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var n=t.event,i=t.phase,r=t.preEnd,o=t.type,a=this.rect;if(a&&i==="move"&&(Rt(this.edges,a,this.coords.delta[this.interactable.options.deltaSource]),a.width=a.right-a.left,a.height=a.bottom-a.top),this._scopeFire("interactions:before-action-".concat(i),t)===!1)return!1;var s=t.iEvent=this._createPreparedEvent(n,i,r,o);return this._scopeFire("interactions:action-".concat(i),t),i==="start"&&(this.prevEvent=s),this._fireEvent(s),this._scopeFire("interactions:after-action-".concat(i),t),!0}},{key:"_now",value:function(){return Date.now()}}]),e}();function dn(e){fn(e.interaction)}function fn(e){if(!function(n){return!(!n.offset.pending.x&&!n.offset.pending.y)}(e))return!1;var t=e.offset.pending;return ye(e.coords.cur,t),ye(e.coords.delta,t),Rt(e.edges,e.rect,t),t.x=0,t.y=0,!0}function ci(e){var t=e.x,n=e.y;this.offset.pending.x+=t,this.offset.pending.y+=n,this.offset.total.x+=t,this.offset.total.y+=n}function ye(e,t){var n=e.page,i=e.client,r=t.x,o=t.y;n.x+=r,n.y+=o,i.x+=r,i.y+=o}pn.offsetBy="";var li={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(e){e.Interaction.prototype.offsetBy=ci},listeners:{"interactions:new":function(e){e.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(e){return function(t){t.pointerIsDown&&(ye(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(e.interaction)},"interactions:before-action-start":dn,"interactions:before-action-move":dn,"interactions:before-action-end":function(e){var t=e.interaction;if(fn(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(e){var t=e.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},hn=li,ui=function(){function e(t){D(this,e),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return P(e,[{key:"start",value:function(t){var n=this.interaction,i=Xt(n);if(!i||!i.enabled)return!1;var r=n.coords.velocity.client,o=bt(r.x,r.y),a=this.modification||(this.modification=new ge(n));if(a.copyFrom(n.modification),this.t0=n._now(),this.allowResume=i.allowResume,this.v0=o,this.currentOffset={x:0,y:0},this.startCoords=n.coords.cur.page,this.modifierArg=a.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-n.coords.cur.timeStamp<50&&o>i.minSpeed&&o>i.endSpeed)this.startInertia();else{if(a.result=a.setAll(this.modifierArg),!a.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:t,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,n=this.interaction.coords.velocity.client,i=Xt(this.interaction),r=i.resistance,o=-Math.log(i.endSpeed/this.v0)/r;this.targetOffset={x:(n.x-o)/r,y:(n.y-o)/r},this.te=o,this.lambda_v0=r/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var a=this.modification,s=this.modifierArg;s.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},a.result=a.setAll(s),a.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+a.result.delta.x,y:this.targetOffset.y+a.result.delta.y}),this.onNextFrame(function(){return t.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return t.smoothEndTick()})}},{key:"onNextFrame",value:function(t){var n=this;this.timeout=nt.request(function(){n.active&&t()})}},{key:"inertiaTick",value:function(){var t,n,i,r,o,a,s,c=this,u=this.interaction,l=Xt(u).resistance,p=(u._now()-this.t0)/1e3;if(p=0;g--){var T=m[g];if(T.selector===l&&T.context===p){for(var S=T.listeners,E=S.length-1;E>=0;E--){var z=S[E];if(z.func===v&&qt(z.options,b)){S.splice(E,1),S.length||(m.splice(g,1),s(p,d,c),s(p,d,u,!0)),x=!0;break}}if(x)break}}},delegateListener:c,delegateUseCapture:u,delegatedEvents:i,documents:r,targets:n,supportsOptions:!1,supportsPassive:!1};function a(l,p,d,v){if(l.addEventListener){var h=zt(v),g=Et(n,function(b){return b.eventTarget===l});g||(g={eventTarget:l,events:{}},n.push(g)),g.events[p]||(g.events[p]=[]),Et(g.events[p],function(b){return b.func===d&&qt(b.options,h)})||(l.addEventListener(p,d,o.supportsOptions?h:h.capture),g.events[p].push({func:d,options:h}))}}function s(l,p,d,v){if(l.addEventListener&&l.removeEventListener){var h=wt(n,function(L){return L.eventTarget===l}),g=n[h];if(g&&g.events)if(p!=="all"){var b=!1,m=g.events[p];if(m){if(d==="all"){for(var x=m.length-1;x>=0;x--){var T=m[x];s(l,p,T.func,T.options)}return}for(var S=zt(v),E=0;E=2)continue;if(!r.interacting()&&t===r.pointerType)return r}return null}};function bn(e,t){return e.pointers.some(function(n){return n.id===t})}var vi=be,xe=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function xn(e,t){return function(n){var i=t.interactions.list,r=qe(n),o=Ve(n),a=o[0],s=o[1],c=[];if(/^touch/.test(n.type)){t.prevTouchTime=t.now();for(var u=0,l=n.changedTouches;u=0;i--){var r=t.interactions.list[i];r.interactable===n&&(r.stop(),t.fire("interactions:destroy",{interaction:r}),r.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(i,1))}}},onDocSignal:we,doOnInteractions:xn,methodNames:xe},mi=gi,rt=function(e){return e[e.On=0]="On",e[e.Off=1]="Off",e}(rt||{}),yi=function(){function e(t,n,i,r){D(this,e),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new yn,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=n.actions,this.target=t,this._context=n.context||i,this._win=N(Fe(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=r,this.set(n)}return P(e,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,n){return f.func(n.onstart)&&this.on("".concat(t,"start"),n.onstart),f.func(n.onmove)&&this.on("".concat(t,"move"),n.onmove),f.func(n.onend)&&this.on("".concat(t,"end"),n.onend),f.func(n.oninertiastart)&&this.on("".concat(t,"inertiastart"),n.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,n,i){var r,o=this,a=(r=this._actions.map[t])==null?void 0:r.filterEventType,s=function(c){return(a==null||a(c))&&Ht(c,o._actions)};(f.array(n)||f.object(n))&&this._onOff(rt.Off,t,n,void 0,s),(f.array(i)||f.object(i))&&this._onOff(rt.On,t,i,void 0,s)}},{key:"setPerAction",value:function(t,n){var i=this._defaults;for(var r in n){var o=r,a=this.options[t],s=n[o];o==="listeners"&&this.updatePerActionListeners(t,a.listeners,s),f.array(s)?a[o]=Ue(s):f.plainObject(s)?(a[o]=w(a[o]||{},vt(s)),f.object(i.perAction[o])&&"enabled"in i.perAction[o]&&(a[o].enabled=s.enabled!==!1)):f.bool(s)&&f.object(i.perAction[o])?a[o].enabled=s:a[o]=s}}},{key:"getRect",value:function(t){return t=t||(f.element(this.target)?this.target:null),f.string(this.target)&&(t=t||this._context.querySelector(this.target)),ee(t)}},{key:"rectChecker",value:function(t){var n=this;return f.func(t)?(this.getRect=function(i){var r=w({},t.apply(n,i));return"width"in r||(r.width=r.right-r.left,r.height=r.bottom-r.top),r},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,n){if(Fe(n)||f.object(n)){for(var i in this.options[t]=n,this._actions.map)this.options[i][t]=n;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return f.string(t)?Array.from(this._context.querySelectorAll(t)):f.func(t)&&t.getAllElements?t.getAllElements():f.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||lt(this._context,t)}},{key:"testIgnoreAllow",value:function(t,n,i){return!this.testIgnore(t.ignoreFrom,n,i)&&this.testAllow(t.allowFrom,n,i)}},{key:"testAllow",value:function(t,n,i){return!t||!!f.element(i)&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"testIgnore",value:function(t,n,i){return!(!t||!f.element(i))&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,n,i,r,o){f.object(n)&&!f.array(n)&&(r=i,i=null);var a=ut(n,i,o);for(var s in a){s==="wheel"&&(s=U.wheelEvent);for(var c=0,u=a[s];c=0;i--){var r=n[i],o=r.selector,a=r.context,s=r.listeners;o===this.target&&a===this._context&&n.splice(i,1);for(var c=s.length-1;c>=0;c--)this._scopeEvents.removeDelegate(this.target,this._context,t,s[c][0],s[c][1])}else this._scopeEvents.remove(this.target,"all")}}]),e}(),bi=function(){function e(t){var n=this;D(this,e),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(i){var r=i.interactable,o=r.target,a=f.string(o)?n.selectorMap[o]:o[n.scope.id],s=wt(a,function(c){return c===r});a.splice(s,1)}})}return P(e,[{key:"new",value:function(t,n){n=w(n||{},{actions:this.scope.actions});var i=new this.scope.Interactable(t,n,this.scope.document,this.scope.events);return this.scope.addDocument(i._doc),this.list.push(i),f.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:n,interactable:i,win:this.scope._win}),i}},{key:"getExisting",value:function(t,n){var i=n&&n.context||this.scope.document,r=f.string(t),o=r?this.selectorMap[t]:t[this.scope.id];if(o)return Et(o,function(a){return a._context===i&&(r||a.inContext(t))})}},{key:"forEachMatch",value:function(t,n){for(var i=0,r=this.list;iMath.abs(u.y),c.coords,c.rect),w(i,c.coords)),c.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Si(e,t,n){var i=e.startCoords,r=e.edgeSign;t?n.y=i.y+(n.x-i.x)*r.y:n.x=i.x+(n.y-i.y)*r.x}function Pi(e,t,n,i){var r=e.startRect,o=e.startCoords,a=e.ratio,s=e.edgeSign;if(t){var c=i.width/a;n.y=o.y+(c-r.height)*s.y}else{var u=i.height*a;n.x=o.x+(u-r.width)*s.x}}var Di=it(zi,"aspectRatio"),Tn=function(){};Tn._defaults={};var Vt=Tn;function dt(e,t,n){return f.func(e)?mt(e,t.interactable,t.element,[n.x,n.y,t]):mt(e,t.interactable,t.element)}var Wt={start:function(e){var t=e.rect,n=e.startOffset,i=e.state,r=e.interaction,o=e.pageCoords,a=i.options,s=a.elementRect,c=w({left:0,top:0,right:0,bottom:0},a.offset||{});if(t&&s){var u=dt(a.restriction,r,o);if(u){var l=u.right-u.left-t.width,p=u.bottom-u.top-t.height;l<0&&(c.left+=l,c.right+=l),p<0&&(c.top+=p,c.bottom+=p)}c.left+=n.left-t.width*s.left,c.top+=n.top-t.height*s.top,c.right+=n.right-t.width*(1-s.right),c.bottom+=n.bottom-t.height*(1-s.bottom)}i.offset=c},set:function(e){var t=e.coords,n=e.interaction,i=e.state,r=i.options,o=i.offset,a=dt(r.restriction,n,t);if(a){var s=function(c){return!c||"left"in c&&"top"in c||((c=w({},c)).left=c.x||0,c.top=c.y||0,c.right=c.right||c.left+c.width,c.bottom=c.bottom||c.top+c.height),c}(a);t.x=Math.max(Math.min(s.right-o.right,t.x),s.left+o.left),t.y=Math.max(Math.min(s.bottom-o.bottom,t.y),s.top+o.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Oi=it(Wt,"restrict"),zn={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Sn={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Pn(e,t){for(var n=0,i=["top","left","bottom","right"];nthis.handleMutationObserver()),this.handleKeyDown=y=>{const{key:A,shiftKey:O,defaultPrevented:M}=y,{dragEnabled:I,resizable:D,resizePosition:j,dragPosition:P,transitionEl:W}=this;if(!(M||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(A)))switch(A){case"ArrowUp":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().height-st,type:"blockSize"}),j.bottom-=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.y-=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowDown":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().height+st,type:"blockSize"}),j.bottom+=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.y+=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowLeft":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().width-st,type:"inlineSize"}),j.right-=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.x-=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowRight":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().width+st,type:"inlineSize"}),j.right+=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.x+=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break}},this.setTransitionEl=y=>{this.transitionEl=y,this.setupInteractions()},this.openEnd=()=>{this.setFocus(),this.el.removeEventListener("calciteDialogOpen",this.openEnd)},this.handleInternalPanelScroll=y=>{y.target===this.panelEl&&(y.stopPropagation(),this.calciteDialogScroll.emit())},this.handleInternalPanelCloseClick=y=>{y.target===this.panelEl&&(y.stopPropagation(),this.open=!1)},this.handlePanelKeyDown=y=>{this.escapeDisabled&&y.key==="Escape"&&y.preventDefault()},this.handleOutsideClose=()=>{this.outsideCloseDisabled||(this.open=!1)},this.closeDialog=async()=>{if(this.beforeClose)try{await this.beforeClose()}catch{requestAnimationFrame(()=>{this.ignoreOpenChange=!0,this.open=!0,this.ignoreOpenChange=!1});return}ze--,this.opened=!1,this.updateOverflowHiddenClass()},this.updateOverflowHiddenClass=()=>{this.opened&&!this.embedded&&this.modal?this.addOverflowHiddenClass():this.removeOverflowHiddenClass()},this.handleMutationObserver=()=>{this.updateFocusTrapElements()},this.beforeClose=void 0,this.description=void 0,this.dragEnabled=!1,this.closeDisabled=!1,this.embedded=!1,this.escapeDisabled=!1,this.heading=void 0,this.headingLevel=void 0,this.kind=void 0,this.loading=!1,this.menuOpen=!1,this.messages=void 0,this.messageOverrides=void 0,this.modal=!1,this.open=!1,this.outsideCloseDisabled=!1,this.overlayPositioning="absolute",this.placement="center",this.resizable=!1,this.scale="m",this.widthScale="m",this.opened=!1,this.hasFooter=!0,this.hasContentTop=!1,this.hasContentBottom=!1,this.effectiveLocale=void 0,this.defaultMessages=void 0,this.assistiveText=null}onMessagesChange(){}onModalChange(){this.updateOverflowHiddenClass()}async componentWillLoad(){await fr(this),ar(this),this.open&&this.openDialog()}componentDidLoad(){sr(this)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),pr(this),hr(this),er(this),this.setupInteractions()}disconnectedCallback(){this.removeOverflowHiddenClass(),this.mutationObserver?.disconnect(),_n(this),dr(this),vr(this),this.embedded=!1,this.cleanupInteractions()}render(){const{assistiveText:y,description:A,heading:O,opened:M}=this;return C(Qi,{key:"bf406255eaa6d94c8443af185a74a2b2d58c6d59"},C("div",{key:"de2a34b6da4a82c66e9fafdbdd2056e4e11e1315",class:{[at.container]:!0,[at.containerOpen]:M,[at.containerEmbedded]:this.embedded}},this.modal?C("calcite-scrim",{class:at.scrim,onClick:this.handleOutsideClose}):null,C("div",{key:"be47093e3a955ce45a71c555700143a4a1c7a166","aria-description":A,"aria-label":O,"aria-modal":Zi(this.modal),class:at.dialog,onKeyDown:this.handleKeyDown,ref:this.setTransitionEl,role:"dialog"},y?C("div",{"aria-live":"polite",class:at.assistiveText,key:"assistive-text"},y):null,C("slot",{key:"6ed9f10ae7d5ecc1ec9062d6aba559001d5194e6",name:H.content},C("calcite-panel",{key:"cd6ebaa7d7362cbeb70e9ae623f38298d1e831e3",beforeClose:this.beforeClose,class:at.panel,closable:!this.closeDisabled,closed:!M,description:A,heading:O,headingLevel:this.headingLevel,loading:this.loading,menuOpen:this.menuOpen,messageOverrides:this.messageOverrides,onCalcitePanelClose:this.handleInternalPanelCloseClick,onCalcitePanelScroll:this.handleInternalPanelScroll,onKeyDown:this.handlePanelKeyDown,overlayPositioning:this.overlayPositioning,ref:I=>this.panelEl=I,scale:this.scale},C("slot",{key:"2ce955775c33b09fc849a083d0bcc1c8ce523dd8",name:H.actionBar,slot:V.actionBar}),C("slot",{key:"dd44184de251320af6225baa2e59571b881a23cd",name:H.alerts,slot:V.alerts}),C("slot",{key:"da343a1a10e015b04b37463c10592e612a576e9b",name:H.headerActionsStart,slot:V.headerActionsStart}),C("slot",{key:"6680fde2bd7ad6dc5803c78ea7250d11d4920b7c",name:H.headerActionsEnd,slot:V.headerActionsEnd}),C("slot",{key:"a17ca64188ffe6000792e67eafc838df575ebbc3",name:H.headerContent,slot:V.headerContent}),C("slot",{key:"7e048c4a9104053ca0a61ab2514b018efb4fc872",name:H.headerMenuActions,slot:V.headerMenuActions}),C("slot",{key:"6760c8a6c105a511fcb859cfd222f8c1355a82c4",name:H.fab,slot:V.fab}),C("slot",{key:"e0f2e7644281d408d8c21ce5bf16b08af0a59c3b",name:H.contentTop,slot:V.contentTop}),C("slot",{key:"01889c3b7fc13bc49521c27feb2ab35346552504",name:H.contentBottom,slot:V.contentBottom}),C("slot",{key:"593bad35110b5d7e7b44d598b397e4b87cc28e28",name:H.footerStart,slot:V.footerStart}),C("slot",{key:"5e84099e096a6afb678cce9731b189f4011dc067",name:H.footer,slot:V.footer}),C("slot",{key:"69a805bd0c1f43a6d165939e62db562428f39f11",name:H.footerEnd,slot:V.footerEnd}),C("slot",{key:"b49e14ff6d2c63caaa8fd296920618e7673eb71b"}))))))}effectiveLocaleChange(){gr(this,this.effectiveLocale)}handleInteractionChange(){this.setupInteractions()}updateAssistiveText(){const{messages:y}=this;this.assistiveText=y&&(this.dragEnabled||this.resizable)?`${this.dragEnabled?y.dragEnabled:""} ${this.resizable?y.resizeEnabled:""}`:null}handleEscape(y){this.open&&!this.escapeDisabled&&y.key==="Escape"&&!y.defaultPrevented&&(this.open=!1,y.preventDefault())}async setFocus(){return await cr(this),this.panelEl?.setFocus()??tr(this.el)}async updateFocusTrapElements(){nr(this)}async scrollContentTo(y){await this.panelEl?.scrollContentTo(y)}onBeforeOpen(){this.calciteDialogBeforeOpen.emit()}onOpen(){this.calciteDialogOpen.emit(),ir(this)}onBeforeClose(){this.calciteDialogBeforeClose.emit()}onClose(){this.calciteDialogClose.emit(),_n(this)}toggleDialog(y){this.ignoreOpenChange||(y?this.openDialog():this.closeDialog())}handleOpenedChange(y){this.transitionEl.classList.toggle(at.openingActive,y),ur(this)}async triggerInteractModifiers(){const{interaction:y}=this;y&&(await y.reflow({name:"drag"}),await y.reflow({name:"resize"}))}getTransitionElDOMRect(){return this.transitionEl.getBoundingClientRect()}updateTransform(){const{dragPosition:{x:y,y:A},resizePosition:O,transitionEl:M,dragEnabled:I,resizable:D}=this;if(!M)return;if(!I&&!D){M.style.transform=null;return}const{top:j,right:P,bottom:W,left:$}=this.getAdjustedResizePosition(O),B=Math.round(y+$+P),K=Math.round(A+j+W);M.style.transform=B||K?`translate(${B}px, ${K}px)`:null}updateSize({type:y,size:A}){const{transitionEl:O}=this;O&&(O.style[y]=A!==null?`${Math.round(A)}px`:null)}cleanupInteractions(){this.interaction?.unset(),this.updateSize({size:null,type:"inlineSize"}),this.updateSize({size:null,type:"blockSize"}),this.dragPosition={...In},this.resizePosition={...Mn},this.updateTransform()}setupInteractions(){this.cleanupInteractions();const{el:y,transitionEl:A,resizable:O,dragEnabled:M,resizePosition:I,dragPosition:D}=this;if(!(!A||!this.open)){if((O||M)&&(this.interaction=$t(A,{context:y.ownerDocument})),O){const{minInlineSize:j,minBlockSize:P,maxInlineSize:W,maxBlockSize:$}=window.getComputedStyle(A);this.interaction.resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},modifiers:[$t.modifiers.restrictSize({min:{width:this.isPixelValue(j)?parseInt(j,10):0,height:this.isPixelValue(P)?parseInt(P,10):0},max:{width:this.isPixelValue(W)?parseInt(W,10):window.innerWidth,height:this.isPixelValue($)?parseInt($,10):window.innerHeight}}),$t.modifiers.restrict({restriction:"parent"})],listeners:{move:({rect:B,deltaRect:K})=>{K&&(I.top+=K.top,I.right+=K.right,I.bottom+=K.bottom,I.left+=K.left),this.updateSize({size:B.width,type:"inlineSize"}),this.updateSize({size:B.height,type:"blockSize"}),this.updateTransform()}}})}M&&this.interaction.draggable({modifiers:[$t.modifiers.restrictRect({restriction:"parent"})],listeners:{move:({dx:j,dy:P})=>{D.x+=j,D.y+=P,this.updateTransform()}}})}}isPixelValue(y){return y.indexOf("px")!==-1}getAdjustedResizePosition({top:y,right:A,bottom:O,left:M}){const I=y/2,D=A/2,j=O/2,P=M/2;switch(this.placement){case"top":return{top:y,right:D,bottom:0,left:P};case"top-start":return{top:y,right:0,bottom:0,left:M};case"top-end":return{top:y,right:A,bottom:0,left:0};case"bottom":return{top:0,right:D,bottom:O,left:P};case"bottom-start":return{top:0,right:0,bottom:O,left:M};case"bottom-end":return{top:0,right:A,bottom:O,left:0};case"cover":case"center":default:return{top:I,right:D,bottom:j,left:P}}}async openDialog(){await mr(this.el),this.el.addEventListener("calciteDialogOpen",this.openEnd),this.opened=!0,this.updateOverflowHiddenClass()}addOverflowHiddenClass(){ze===0&&(Cn=document.documentElement.style.overflow),ze++,document.documentElement.style.setProperty("overflow","hidden")}removeOverflowHiddenClass(){document.documentElement.style.setProperty("overflow",Cn)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],modal:["onModalChange"],effectiveLocale:["effectiveLocaleChange"],open:["handleInteractionChange","toggleDialog"],placement:["handleInteractionChange"],resizable:["handleInteractionChange","updateAssistiveText"],dragEnabled:["handleInteractionChange","updateAssistiveText"],messages:["updateAssistiveText"],opened:["handleOpenedChange"]}}static get style(){return zr}},[1,"calcite-dialog",{beforeClose:[16],description:[1],dragEnabled:[516,"drag-enabled"],closeDisabled:[516,"close-disabled"],embedded:[1028],escapeDisabled:[516,"escape-disabled"],heading:[1],headingLevel:[514,"heading-level"],kind:[513],loading:[516],menuOpen:[516,"menu-open"],messages:[1040],messageOverrides:[1040],modal:[516],open:[1540],outsideCloseDisabled:[516,"outside-close-disabled"],overlayPositioning:[513,"overlay-positioning"],placement:[513],resizable:[516],scale:[513],widthScale:[513,"width-scale"],opened:[32],hasFooter:[32],hasContentTop:[32],hasContentBottom:[32],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],setFocus:[64],updateFocusTrapElements:[64],scrollContentTo:[64]},[[8,"keydown","handleEscape"]],{messageOverrides:["onMessagesChange"],modal:["onModalChange"],effectiveLocale:["effectiveLocaleChange"],open:["handleInteractionChange","toggleDialog"],placement:["handleInteractionChange"],resizable:["handleInteractionChange","updateAssistiveText"],dragEnabled:["handleInteractionChange","updateAssistiveText"],messages:["updateAssistiveText"],opened:["handleOpenedChange"]}]);function jn(){typeof customElements>"u"||["calcite-dialog","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(y=>{switch(y){case"calcite-dialog":customElements.get(y)||customElements.define(y,Rn);break;case"calcite-action":customElements.get(y)||br();break;case"calcite-action-menu":customElements.get(y)||or();break;case"calcite-icon":customElements.get(y)||xr();break;case"calcite-loader":customElements.get(y)||wr();break;case"calcite-panel":customElements.get(y)||yr();break;case"calcite-popover":customElements.get(y)||rr();break;case"calcite-scrim":customElements.get(y)||Er();break}})}jn();const Gr=Rn,$r=jn;export{Gr as CalciteDialog,$r as defineCustomElement}; diff --git a/main/assets/calcite-dialog-DAngwHC1-DKYOLeFn.js b/main/assets/calcite-dialog-DAngwHC1-DKYOLeFn.js new file mode 100644 index 000000000..8a08c8fd4 --- /dev/null +++ b/main/assets/calcite-dialog-DAngwHC1-DKYOLeFn.js @@ -0,0 +1,6 @@ +import{p as Ni,b as Ji,W as Ot,a as C,D as Qi}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{A as Zi,g as tr}from"./dom-N58V0tYi-DBU3jlah.js";import{g as er,H as _n,E as nr,j as ir,K as rr,O as or}from"./action-menu-DTIJuZNc-BWLxzbAy.js";import{o as ar,r as sr,f as cr}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{c as lr}from"./observers-BigwqTsw-Du14S4xc.js";import{p as ur}from"./openCloseComponent-BGQ6h7vg-DwGQl3jY.js";import{K as pr,q as dr}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{h as fr,d as hr,M as vr,l as gr}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{o as mr}from"./component-CWGf1hug-BASJpoEG.js";import{s as V,y as yr}from"./panel-DRUEhsxp-DDDczPW_.js";import{m as br}from"./action-GCQoufcz-D2daq3Sk.js";import{m as xr}from"./icon-BXFbBbop-Du8Zws1L.js";import{v as wr}from"./loader-Ch7Jr16w-BlGvYEIO.js";import{c as Er}from"./scrim-BscQh4v9-DBRj_VaE.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./floating-ui-DKFFlLv3-B6atYKJb.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./FloatingArrow-BG9llDYg-AyYcVK-v.js";import"./interactive-DqhNilgd-D_Gwwuwg.js";var kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},An={exports:{}};(function(y,A){(function(O,M){y.exports=M()})(kr,function(){function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function M(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,i=B(e);if(t){var r=B(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(o,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _t(o)}(this,n)}}function It(){return It=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(o,a){for(;!Object.prototype.hasOwnProperty.call(o,a)&&(o=B(o))!==null;);return o}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},It.apply(this,arguments)}function Se(e){var t=function(n,i){if(typeof n!="object"||n===null)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var o=r.call(n,i);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(e,"string");return typeof t=="symbol"?t:t+""}var Pe=function(e){return!(!e||!e.Window)&&e instanceof e.Window},De=void 0,ct=void 0;function Oe(e){De=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),ct=e}function N(e){return Pe(e)?e:(e.ownerDocument||e).defaultView||ct.window}typeof window<"u"&&window&&Oe(window);var Mt=function(e){return!!e&&I(e)==="object"},_e=function(e){return typeof e=="function"},f={window:function(e){return e===ct||Pe(e)},docFrag:function(e){return Mt(e)&&e.nodeType===11},object:Mt,func:_e,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||I(e)!=="object")return!1;var t=N(e)||ct;return/object|function/.test(typeof Element>"u"?"undefined":I(Element))?e instanceof Element||e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return Mt(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return Mt(e)&&e.length!==void 0&&_e(e.splice)}};function Jt(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.prepared.axis;n==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):n==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function Ie(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="drag"){var i=n.prepared.axis;if(i==="x"||i==="y"){var r=i==="x"?"y":"x";t.page[r]=n.coords.start.page[r],t.client[r]=n.coords.start.client[r],t.delta[r]=0}}}var Ct={id:"actions/drag",install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.draggable=Ct.draggable,t.map.drag=Ct,t.methodDict.drag="draggable",i.actions.drag=Ct.defaults},listeners:{"interactions:before-action-move":Jt,"interactions:action-resume":Jt,"interactions:action-move":Ie,"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.buttons,r=n.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||i&n.options.drag.mouseButtons))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return f.object(e)?(this.options.drag.enabled=e.enabled!==!1,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):f.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:Jt,move:Ie,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(e){return e.search("drag")===0}},Me=Ct,X={init:function(e){var t=e;X.document=t.document,X.DocumentFragment=t.DocumentFragment||ft,X.SVGElement=t.SVGElement||ft,X.SVGSVGElement=t.SVGSVGElement||ft,X.SVGElementInstance=t.SVGElementInstance||ft,X.Element=t.Element||ft,X.HTMLElement=t.HTMLElement||X.Element,X.Event=t.Event,X.Touch=t.Touch||ft,X.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ft(){}var R=X,q={init:function(e){var t=R.Element,n=e.navigator||{};q.supportsTouch="ontouchstart"in e||f.func(e.DocumentTouch)&&R.document instanceof e.DocumentTouch,q.supportsPointerEvent=n.pointerEnabled!==!1&&!!R.PointerEvent,q.isIOS=/iP(hone|od|ad)/.test(n.platform),q.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),q.isIe9=/MSIE 9/.test(n.userAgent),q.isOperaMobile=n.appName==="Opera"&&q.supportsTouch&&/Presto/.test(n.userAgent),q.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",q.pEventTypes=q.supportsPointerEvent?R.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,q.wheelEvent=R.document&&"onmousewheel"in R.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},U=q;function lt(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ce(e,t){for(;f.element(e);){if(et(e,t))return e;e=J(e)}return null}function J(e){var t=e.parentNode;if(f.docFrag(t)){for(;(t=t.host)&&f.docFrag(t););return t}return t}function et(e,t){return ct!==De&&(t=t.replace(/\/deep\//g," ")),e[U.prefixedMatchesSelector](t)}var Qt=function(e){return e.parentNode||e.host};function Ae(e,t){for(var n,i=[],r=e;(n=Qt(r))&&r!==t&&n!==r.ownerDocument;)i.unshift(r),r=n;return i}function Zt(e,t,n){for(;f.element(e);){if(et(e,t))return!0;if((e=J(e))===n)return et(e,t)}return!1}function Re(e){return e.correspondingUseElement||e}function te(e){var t=e instanceof R.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ee(e){var t,n=te(e);if(!U.isIOS7&&n){var i={x:(t=(t=N(e))||ct).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};n.left+=i.x,n.right+=i.x,n.top+=i.y,n.bottom+=i.y}return n}function je(e){for(var t=[];e;)t.push(e),e=J(e);return t}function Fe(e){return!!f.string(e)&&(R.document.querySelector(e),!0)}function w(e,t){for(var n in t)e[n]=t[n];return e}function Le(e,t,n){return e==="parent"?J(n):e==="self"?t.getRect(n):Ce(n,e)}function mt(e,t,n,i){var r=e;return f.string(r)?r=Le(r,t,n):f.func(r)&&(r=r.apply(void 0,i)),f.element(r)&&(r=ee(r)),r}function At(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}}function ne(e){return!e||"x"in e&&"y"in e||((e=w({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e}function Rt(e,t,n){e.left&&(t.left+=n.x),e.right&&(t.right+=n.x),e.top&&(t.top+=n.y),e.bottom&&(t.bottom+=n.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function yt(e,t,n){var i=n&&e.options[n];return At(mt(i&&i.origin||e.options.origin,e,t,[e&&t]))||{x:0,y:0}}function ut(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(c){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},f.string(e)&&e.search(" ")!==-1&&(e=Be(e)),f.array(e))return e.forEach(function(c){return ut(c,t,n,i)}),i;if(f.object(e)&&(t=e,e=""),f.func(t)&&n(e))i[e]=i[e]||[],i[e].push(t);else if(f.array(t))for(var r=0,o=t;r1?Xe(t):t[0];Ke(i,e.page),function(r,o){o=o||{},U.isOperaMobile&&He(r)?Lt("screen",r,o):Lt("client",r,o)}(i,e.client),e.timeStamp=n}function ie(e){var t=[];return f.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function Xe(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},n=0;n=(parseInt(N(x).getComputedStyle(x).zIndex,10)||0)&&(b=S);else b=S}else b=S}return b}(a);return i.activeDrops[h]||null}function ce(e,t,n){var i=e.dropState,r={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return n.type==="dragstart"&&(r.activate=new ht(i,n,"dropactivate"),r.activate.target=null,r.activate.dropzone=null),n.type==="dragend"&&(r.deactivate=new ht(i,n,"dropdeactivate"),r.deactivate.target=null,r.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(r.leave=new ht(i,n,"dragleave"),n.dragLeave=r.leave.target=i.prev.element,n.prevDropzone=r.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(r.enter=new ht(i,n,"dragenter"),n.dragEnter=i.cur.element,n.dropzone=i.cur.dropzone)),n.type==="dragend"&&i.cur.dropzone&&(r.drop=new ht(i,n,"drop"),n.dropzone=i.cur.dropzone,n.relatedTarget=i.cur.element),n.type==="dragmove"&&i.cur.dropzone&&(r.move=new ht(i,n,"dropmove"),n.dropzone=i.cur.dropzone)),r}function le(e,t){var n=e.dropState,i=n.activeDrops,r=n.cur,o=n.prev;t.leave&&o.dropzone.fire(t.leave),t.enter&&r.dropzone.fire(t.enter),t.move&&r.dropzone.fire(t.move),t.drop&&r.dropzone.fire(t.drop),t.deactivate&&Ge(i,t.deactivate),n.prev.dropzone=r.dropzone,n.prev.element=r.element}function Ne(e,t){var n=e.interaction,i=e.iEvent,r=e.event;if(i.type==="dragmove"||i.type==="dragend"){var o=n.dropState;t.dynamicDrop&&(o.activeDrops=se(t,n.element));var a=i,s=$e(n,a,r);o.rejected=o.rejected&&!!s&&s.dropzone===o.cur.dropzone&&s.element===o.cur.element,o.cur.dropzone=s&&s.dropzone,o.cur.element=s&&s.element,o.events=ce(n,0,a)}}var Je={id:"actions/drop",install:function(e){var t=e.actions,n=e.interactStatic,i=e.Interactable,r=e.defaults;e.usePlugin(Me),i.prototype.dropzone=function(o){return function(a,s){if(f.object(s)){if(a.options.drop.enabled=s.enabled!==!1,s.listeners){var c=ut(s.listeners),u=Object.keys(c).reduce(function(p,d){return p[/^(enter|leave)/.test(d)?"drag".concat(d):/^(activate|deactivate|move)/.test(d)?"drop".concat(d):d]=c[d],p},{}),l=a.options.drop.listeners;l&&a.off(l),a.on(u),a.options.drop.listeners=u}return f.func(s.ondrop)&&a.on("drop",s.ondrop),f.func(s.ondropactivate)&&a.on("dropactivate",s.ondropactivate),f.func(s.ondropdeactivate)&&a.on("dropdeactivate",s.ondropdeactivate),f.func(s.ondragenter)&&a.on("dragenter",s.ondragenter),f.func(s.ondragleave)&&a.on("dragleave",s.ondragleave),f.func(s.ondropmove)&&a.on("dropmove",s.ondropmove),/^(pointer|center)$/.test(s.overlap)?a.options.drop.overlap=s.overlap:f.number(s.overlap)&&(a.options.drop.overlap=Math.max(Math.min(1,s.overlap),0)),"accept"in s&&(a.options.drop.accept=s.accept),"checker"in s&&(a.options.drop.checker=s.checker),a}return f.bool(s)?(a.options.drop.enabled=s,a):a.options.drop}(this,o)},i.prototype.dropCheck=function(o,a,s,c,u,l){return function(p,d,v,h,g,b,m){var x=!1;if(!(m=m||p.getRect(b)))return!!p.options.drop.checker&&p.options.drop.checker(d,v,x,p,b,h,g);var T=p.options.drop.overlap;if(T==="pointer"){var S=yt(h,g,"drag"),E=Ke(d);E.x+=S.x,E.y+=S.y;var z=E.x>m.left&&E.xm.top&&E.y=m.left&&Y<=m.right&&G>=m.top&&G<=m.bottom}return _&&f.number(T)&&(x=Math.max(0,Math.min(m.right,_.right)-Math.max(m.left,_.left))*Math.max(0,Math.min(m.bottom,_.bottom)-Math.max(m.top,_.top))/(_.width*_.height)>=T),p.options.drop.checker&&(x=p.options.drop.checker(d,v,x,p,b,h,g)),x}(this,o,a,s,c,u,l)},n.dynamicDrop=function(o){return f.bool(o)?(e.dynamicDrop=o,n):e.dynamicDrop},w(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",e.dynamicDrop=!1,r.actions.drop=Je.defaults},listeners:{"interactions:before-action-start":function(e){var t=e.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;r.activeDrops=[],r.events={},r.activeDrops=se(t,n.element),r.events=ce(n,0,i),r.events.activate&&(Ge(r.activeDrops,r.events.activate),t.fire("actions/drop:start",{interaction:n,dragEvent:i}))}},"interactions:action-move":Ne,"interactions:after-action-move":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;le(n,r.events),t.fire("actions/drop:move",{interaction:n,dragEvent:i}),r.events={}}},"interactions:action-end":function(e,t){if(e.interaction.prepared.name==="drag"){var n=e.interaction,i=e.iEvent;Ne(e,t),le(n,n.dropState.events),t.fire("actions/drop:end",{interaction:n,dragEvent:i})}},"interactions:stop":function(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.dropState;n&&(n.activeDrops=null,n.events=null,n.cur.dropzone=null,n.cur.element=null,n.prev.dropzone=null,n.prev.element=null,n.rejected=!1)}}},getActiveDrops:se,getDrop:$e,getDropEvents:ce,fireDropEvents:le,filterEventType:function(e){return e.search("drag")===0||e.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Bn=Je;function ue(e){var t=e.interaction,n=e.iEvent,i=e.phase;if(t.prepared.name==="gesture"){var r=t.pointers.map(function(u){return u.pointer}),o=i==="start",a=i==="end",s=t.interactable.options.deltaSource;if(n.touches=[r[0],r[1]],o)n.distance=oe(r,s),n.box=re(r),n.scale=1,n.ds=0,n.angle=ae(r,s),n.da=0,t.gesture.startDistance=n.distance,t.gesture.startAngle=n.angle;else if(a||t.pointers.length<2){var c=t.prevEvent;n.distance=c.distance,n.box=c.box,n.scale=c.scale,n.ds=0,n.angle=c.angle,n.da=0}else n.distance=oe(r,s),n.box=re(r),n.scale=n.distance/t.gesture.startDistance,n.angle=ae(r,s),n.ds=n.scale-t.gesture.scale,n.da=n.angle-t.gesture.angle;t.gesture.distance=n.distance,t.gesture.angle=n.angle,f.number(n.scale)&&n.scale!==1/0&&!isNaN(n.scale)&&(t.gesture.scale=n.scale)}}var pe={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.gesturable=function(r){return f.object(r)?(this.options.gesture.enabled=r.enabled!==!1,this.setPerAction("gesture",r),this.setOnEvents("gesture",r),this):f.bool(r)?(this.options.gesture.enabled=r,this):this.options.gesture},t.map.gesture=pe,t.methodDict.gesture="gesturable",i.actions.gesture=pe.defaults},listeners:{"interactions:action-start":ue,"interactions:action-move":ue,"interactions:action-end":ue,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var t=e.interactable.options.gesture;if(t&&t.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(e){return e.search("gesture")===0}},Yn=pe;function Hn(e,t,n,i,r,o,a){if(!t)return!1;if(t===!0){var s=f.number(o.width)?o.width:o.right-o.left,c=f.number(o.height)?o.height:o.bottom-o.top;if(a=Math.min(a,Math.abs((e==="left"||e==="right"?s:c)/2)),s<0&&(e==="left"?e="right":e==="right"&&(e="left")),c<0&&(e==="top"?e="bottom":e==="bottom"&&(e="top")),e==="left"){var u=s>=0?o.left:o.right;return n.x=0?o.top:o.bottom;return n.y(s>=0?o.right:o.left)-a;if(e==="bottom")return n.y>(c>=0?o.bottom:o.top)-a}return!!f.element(i)&&(f.element(t)?t===i:Zt(i,t,r))}function Qe(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.resizeAxes){var i=t;n.interactable.options.resize.square?(n.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=n.resizeAxes,n.resizeAxes==="x"?i.delta.y=0:n.resizeAxes==="y"&&(i.delta.x=0))}}var Q,pt,Z={id:"actions/resize",before:["actions/drag"],install:function(e){var t=e.actions,n=e.browser,i=e.Interactable,r=e.defaults;Z.cursors=function(o){return o.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),Z.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(o){return function(a,s,c){return f.object(s)?(a.options.resize.enabled=s.enabled!==!1,a.setPerAction("resize",s),a.setOnEvents("resize",s),f.string(s.axis)&&/^x$|^y$|^xy$/.test(s.axis)?a.options.resize.axis=s.axis:s.axis===null&&(a.options.resize.axis=c.defaults.actions.resize.axis),f.bool(s.preserveAspectRatio)?a.options.resize.preserveAspectRatio=s.preserveAspectRatio:f.bool(s.square)&&(a.options.resize.square=s.square),a):f.bool(s)?(a.options.resize.enabled=s,a):a.options.resize}(this,o,e)},t.map.resize=Z,t.methodDict.resize="resizable",r.actions.resize=Z.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.rect;i._rects={start:w({},o),corrected:w({},o),previous:w({},o),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},r.edges=i.prepared.edges,r.rect=i._rects.corrected,r.deltaRect=i._rects.delta}})(e),Qe(e)},"interactions:action-move":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.interactable.options.resize.invert,a=o==="reposition"||o==="negate",s=i.rect,c=i._rects,u=c.start,l=c.corrected,p=c.delta,d=c.previous;if(w(d,l),a){if(w(l,s),o==="reposition"){if(l.top>l.bottom){var v=l.top;l.top=l.bottom,l.bottom=v}if(l.left>l.right){var h=l.left;l.left=l.right,l.right=h}}}else l.top=Math.min(s.top,u.bottom),l.bottom=Math.max(s.bottom,u.top),l.left=Math.min(s.left,u.right),l.right=Math.max(s.right,u.left);for(var g in l.width=l.right-l.left,l.height=l.bottom-l.top,l)p[g]=l[g]-d[g];r.edges=i.prepared.edges,r.rect=l,r.deltaRect=p}})(e),Qe(e)},"interactions:action-end":function(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.prepared.edges){var i=t;i.edges=n.prepared.edges,i.rect=n._rects.corrected,i.deltaRect=n._rects.delta}},"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.element,r=e.rect,o=e.buttons;if(r){var a=w({},t.coords.cur.page),s=n.options.resize;if(s&&s.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||o&s.mouseButtons)){if(f.object(s.edges)){var c={left:!1,right:!1,top:!1,bottom:!1};for(var u in c)c[u]=Hn(u,s.edges[u],a,t._latestPointer.eventTarget,i,r,s.margin||Z.defaultMargin);c.left=c.left&&!c.right,c.top=c.top&&!c.bottom,(c.left||c.right||c.top||c.bottom)&&(e.action={name:"resize",edges:c})}else{var l=s.axis!=="y"&&a.x>r.right-Z.defaultMargin,p=s.axis!=="x"&&a.y>r.bottom-Z.defaultMargin;(l||p)&&(e.action={name:"resize",axes:(l?"x":"")+(p?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var t=e.edges,n=e.axis,i=e.name,r=Z.cursors,o=null;if(n)o=r[i+n];else if(t){for(var a="",s=0,c=["top","bottom","left","right"];s=1){var u={x:k.x*c,y:k.y*c};if(u.x||u.y){var l=en(o);f.window(o)?o.scrollBy(u.x,u.y):o&&(o.scrollLeft+=u.x,o.scrollTop+=u.y);var p=en(o),d={x:p.x-l.x,y:p.y-l.y};(d.x||d.y)&&t.fire({type:"autoscroll",target:n,interactable:t,delta:d,interaction:e,container:o})}k.prevTime=a}k.isScrolling&&(nt.cancel(k.i),k.i=nt.request(k.scroll))},check:function(e,t){var n;return(n=e.options[t].autoScroll)==null?void 0:n.enabled},onInteractionMove:function(e){var t=e.interaction,n=e.pointer;if(t.interacting()&&k.check(t.interactable,t.prepared.name))if(t.simulation)k.x=k.y=0;else{var i,r,o,a,s=t.interactable,c=t.element,u=t.prepared.name,l=s.options[u].autoScroll,p=tn(l.container,s,c);if(f.window(p))a=n.clientXp.innerWidth-k.margin,o=n.clientY>p.innerHeight-k.margin;else{var d=te(p);a=n.clientXd.right-k.margin,o=n.clientY>d.bottom-k.margin}k.x=r?1:a?-1:0,k.y=o?1:i?-1:0,k.isScrolling||(k.margin=l.margin,k.speed=l.speed,k.start(t))}}};function tn(e,t,n){return(f.string(e)?Le(e,t,n):e)||N(n)}function en(e){return f.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var qn={id:"auto-scroll",install:function(e){var t=e.defaults,n=e.actions;e.autoScroll=k,k.now=function(){return e.now()},n.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=k.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,k.stop(),k.interaction&&(k.interaction=null)},"interactions:stop":k.stop,"interactions:action-move":function(e){return k.onInteractionMove(e)}}},Vn=qn;function kt(e,t){var n=!1;return function(){return n||(ct.console.warn(t),n=!0),e.apply(this,arguments)}}function de(e,t){return e.name=t.name,e.axis=t.axis,e.edges=t.edges,e}function Wn(e){return f.bool(e)?(this.options.styleCursor=e,this):e===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Un(e){return f.func(e)?(this.options.actionChecker=e,this):e===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Gn={id:"auto-start/interactableMethods",install:function(e){var t=e.Interactable;t.prototype.getAction=function(n,i,r,o){var a=function(s,c,u,l,p){var d=s.getRect(l),v=c.buttons||{0:1,1:4,3:8,4:16}[c.button],h={action:null,interactable:s,interaction:u,element:l,rect:d,buttons:v};return p.fire("auto-start:check",h),h.action}(this,i,r,o,e);return this.options.actionChecker?this.options.actionChecker(n,i,a,this,o,r):a},t.prototype.ignoreFrom=kt(function(n){return this._backCompatOption("ignoreFrom",n)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=kt(function(n){return this._backCompatOption("allowFrom",n)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Un,t.prototype.styleCursor=Wn}};function nn(e,t,n,i,r){return t.testIgnoreAllow(t.options[e.name],n,i)&&t.options[e.name].enabled&&Yt(t,n,e,r)?e:null}function $n(e,t,n,i,r,o,a){for(var s=0,c=i.length;s=s||v.interactable===e&&((u+=h===n.name?1:0)>=o||v.element===t&&(l++,h===n.name&&l>=a))))return!1}return s>0}function an(e,t){return f.number(e)?(t.autoStart.maxInteractions=e,this):t.autoStart.maxInteractions}function fe(e,t,n){var i=n.autoStart.cursorElement;i&&i!==e&&(i.style.cursor=""),e.ownerDocument.documentElement.style.cursor=t,e.style.cursor=t,n.autoStart.cursorElement=t?e:null}function sn(e,t){var n=e.interactable,i=e.element,r=e.prepared;if(e.pointerType==="mouse"&&n&&n.options.styleCursor){var o="";if(r.name){var a=n.options[r.name].cursorChecker;o=f.func(a)?a(r,n,i,e._interacting):t.actions.map[r.name].getCursor(r)}fe(e.element,o||"",t)}else t.autoStart.cursorElement&&fe(t.autoStart.cursorElement,"",t)}var Nn={id:"auto-start/base",before:["actions"],install:function(e){var t=e.interactStatic,n=e.defaults;e.usePlugin(Gn),n.base.actionChecker=null,n.base.styleCursor=!0,w(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(i){return an(i,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:Yt,cursorElement:null}},listeners:{"interactions:down":function(e,t){var n=e.interaction,i=e.pointer,r=e.event,o=e.eventTarget;n.interacting()||on(n,rn(n,i,r,o,t),t)},"interactions:move":function(e,t){(function(n,i){var r=n.interaction,o=n.pointer,a=n.event,s=n.eventTarget;r.pointerType!=="mouse"||r.pointerIsDown||r.interacting()||on(r,rn(r,o,a,s,i),i)})(e,t),function(n,i){var r=n.interaction;if(r.pointerIsDown&&!r.interacting()&&r.pointerWasMoved&&r.prepared.name){i.fire("autoStart:before-start",n);var o=r.interactable,a=r.prepared.name;a&&o&&(o.options[a].manualStart||!Yt(o,r.element,r.prepared,i)?r.stop():(r.start(r.prepared,o,r.element),sn(r,i)))}}(e,t)},"interactions:stop":function(e,t){var n=e.interaction,i=n.interactable;i&&i.options.styleCursor&&fe(n.element,"",t)}},maxInteractions:an,withinInteractionLimit:Yt,validateAction:nn},he=Nn,Jn={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,t){var n=e.interaction,i=e.eventTarget,r=e.dx,o=e.dy;if(n.prepared.name==="drag"){var a=Math.abs(r),s=Math.abs(o),c=n.interactable.options.drag,u=c.startAxis,l=a>s?"x":a0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},n))},"interactions:move":function(e){var t=e.interaction,n=e.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!n&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var t=e.interaction;ve(t)>0&&(t.prepared.name=null)}},getHoldDuration:ve},Zn=Qn,ti={id:"auto-start",install:function(e){e.usePlugin(he),e.usePlugin(Zn),e.usePlugin(Jn)}},ei=function(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):f.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault};function ni(e){var t=e.interaction,n=e.event;t.interactable&&t.interactable.checkAndPreventDefault(n)}var cn={id:"core/interactablePreventDefault",install:function(e){var t=e.Interactable;t.prototype.preventDefault=ei,t.prototype.checkAndPreventDefault=function(n){return function(i,r,o){var a=i.options.preventDefault;if(a!=="never")if(a!=="always"){if(r.events.supportsPassive&&/^touch(start|move)$/.test(o.type)){var s=N(o.target).document,c=r.getDocOptions(s);if(!c||!c.events||c.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(o.type)||f.element(o.target)&&et(o.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||o.preventDefault()}else o.preventDefault()}(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var i=0,r=e.interactions.list;i150)return null;var r=180*Math.atan2(i.prevEvent.velocityY,i.prevEvent.velocityX)/Math.PI;r<0&&(r+=360);var o=112.5<=r&&r<247.5,a=202.5<=r&&r<337.5;return{up:a,down:!a&&22.5<=r&&r<157.5,left:o,right:!o&&(292.5<=r||r<67.5),angle:r,speed:i.prevEvent.speed,velocity:{x:i.prevEvent.velocityX,y:i.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),n}(Bt);Object.defineProperties(me.prototype,{pageX:{get:function(){return this.page.x},set:function(e){this.page.x=e}},pageY:{get:function(){return this.page.y},set:function(e){this.page.y=e}},clientX:{get:function(){return this.client.x},set:function(e){this.client.x=e}},clientY:{get:function(){return this.client.y},set:function(e){this.client.y=e}},dx:{get:function(){return this.delta.x},set:function(e){this.delta.x=e}},dy:{get:function(){return this.delta.y},set:function(e){this.delta.y=e}},velocityX:{get:function(){return this.velocity.x},set:function(e){this.velocity.x=e}},velocityY:{get:function(){return this.velocity.y},set:function(e){this.velocity.y=e}}});var ri=P(function e(t,n,i,r,o){D(this,e),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=n,this.event=i,this.downTime=r,this.downTarget=o}),oi=function(e){return e.interactable="",e.element="",e.prepared="",e.pointerIsDown="",e.pointerWasMoved="",e._proxy="",e}({}),pn=function(e){return e.start="",e.move="",e.end="",e.stop="",e.interacting="",e}({}),ai=0,si=function(){function e(t){var n=this,i=t.pointerType,r=t.scopeFire;D(this,e),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=kt(function(l){this.move(l)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=ai++,this._scopeFire=r,this.pointerType=i;var o=this;this._proxy={};var a=function(l){Object.defineProperty(n._proxy,l,{get:function(){return o[l]}})};for(var s in oi)a(s);var c=function(l){Object.defineProperty(n._proxy,l,{value:function(){return o[l].apply(o,arguments)}})};for(var u in pn)c(u);this._scopeFire("interactions:new",{interaction:this})}return P(e,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,n,i){var r=this.updatePointer(t,n,i,!0),o=this.pointers[r];this._scopeFire("interactions:down",{pointer:t,event:n,eventTarget:i,pointerIndex:r,pointerInfo:o,type:"down",interaction:this})}},{key:"start",value:function(t,n,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!n.options[t.name].enabled)&&(de(this.prepared,t),this.interactable=n,this.element=i,this.rect=n.getRect(i),this.edges=this.prepared.edges?w({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,n,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,n,i,!1);var r,o,a=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=bt(r,o)>this.pointerMoveTolerance);var s,c,u,l=this.getPointerIndex(t),p={pointer:t,pointerIndex:l,pointerInfo:this.pointers[l],event:n,type:"move",eventTarget:i,dx:r,dy:o,duplicate:a,interaction:this};a||(s=this.coords.velocity,c=this.coords.delta,u=Math.max(c.timeStamp/1e3,.001),s.page.x=c.page.x/u,s.page.y=c.page.y/u,s.client.x=c.client.x/u,s.client.y=c.client.y/u,s.timeStamp=u),this._scopeFire("interactions:move",p),a||this.simulation||(this.interacting()&&(p.type=null,this.move(p)),this.pointerWasMoved&&Ft(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||Ye(this.coords.delta),(t=w({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,n,i,r){var o=this.getPointerIndex(t);o===-1&&(o=this.updatePointer(t,n,i,!1));var a=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(a),{pointer:t,pointerIndex:o,pointerInfo:this.pointers[o],event:n,eventTarget:i,type:a,curEventTarget:r,interaction:this}),this.simulation||this.end(n),this.removePointer(t,n)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var n;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,n===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var n=xt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:wt(this.pointers,function(i){return i.id===n})}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,n,i,r){var o,a,s,c=xt(t),u=this.getPointerIndex(t),l=this.pointers[u];return r=r!==!1&&(r||/(down|start)$/i.test(n.type)),l?l.pointer=t:(l=new ri(c,t,n,null,null),u=this.pointers.length,this.pointers.push(l)),Ln(this.coords.cur,this.pointers.map(function(p){return p.pointer}),this._now()),o=this.coords.delta,a=this.coords.prev,s=this.coords.cur,o.page.x=s.page.x-a.page.x,o.page.y=s.page.y-a.page.y,o.client.x=s.client.x-a.client.x,o.client.y=s.client.y-a.client.y,o.timeStamp=s.timeStamp-a.timeStamp,r&&(this.pointerIsDown=!0,l.downTime=this.coords.cur.timeStamp,l.downTarget=i,jt(this.downPointer,t),this.interacting()||(Ft(this.coords.start,this.coords.cur),Ft(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(t,n,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:n,eventTarget:i,down:r,pointerInfo:l,pointerIndex:u,interaction:this}),u}},{key:"removePointer",value:function(t,n){var i=this.getPointerIndex(t);if(i!==-1){var r=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:n,eventTarget:null,pointerIndex:i,pointerInfo:r,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,n,i){this._latestPointer.pointer=t,this._latestPointer.event=n,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,n,i,r){return new me(this,t,this.prepared.name,n,this.element,i,r)}},{key:"_fireEvent",value:function(t){var n;(n=this.interactable)==null||n.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var n=t.event,i=t.phase,r=t.preEnd,o=t.type,a=this.rect;if(a&&i==="move"&&(Rt(this.edges,a,this.coords.delta[this.interactable.options.deltaSource]),a.width=a.right-a.left,a.height=a.bottom-a.top),this._scopeFire("interactions:before-action-".concat(i),t)===!1)return!1;var s=t.iEvent=this._createPreparedEvent(n,i,r,o);return this._scopeFire("interactions:action-".concat(i),t),i==="start"&&(this.prevEvent=s),this._fireEvent(s),this._scopeFire("interactions:after-action-".concat(i),t),!0}},{key:"_now",value:function(){return Date.now()}}]),e}();function dn(e){fn(e.interaction)}function fn(e){if(!function(n){return!(!n.offset.pending.x&&!n.offset.pending.y)}(e))return!1;var t=e.offset.pending;return ye(e.coords.cur,t),ye(e.coords.delta,t),Rt(e.edges,e.rect,t),t.x=0,t.y=0,!0}function ci(e){var t=e.x,n=e.y;this.offset.pending.x+=t,this.offset.pending.y+=n,this.offset.total.x+=t,this.offset.total.y+=n}function ye(e,t){var n=e.page,i=e.client,r=t.x,o=t.y;n.x+=r,n.y+=o,i.x+=r,i.y+=o}pn.offsetBy="";var li={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(e){e.Interaction.prototype.offsetBy=ci},listeners:{"interactions:new":function(e){e.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(e){return function(t){t.pointerIsDown&&(ye(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(e.interaction)},"interactions:before-action-start":dn,"interactions:before-action-move":dn,"interactions:before-action-end":function(e){var t=e.interaction;if(fn(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(e){var t=e.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},hn=li,ui=function(){function e(t){D(this,e),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return P(e,[{key:"start",value:function(t){var n=this.interaction,i=Xt(n);if(!i||!i.enabled)return!1;var r=n.coords.velocity.client,o=bt(r.x,r.y),a=this.modification||(this.modification=new ge(n));if(a.copyFrom(n.modification),this.t0=n._now(),this.allowResume=i.allowResume,this.v0=o,this.currentOffset={x:0,y:0},this.startCoords=n.coords.cur.page,this.modifierArg=a.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-n.coords.cur.timeStamp<50&&o>i.minSpeed&&o>i.endSpeed)this.startInertia();else{if(a.result=a.setAll(this.modifierArg),!a.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:t,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,n=this.interaction.coords.velocity.client,i=Xt(this.interaction),r=i.resistance,o=-Math.log(i.endSpeed/this.v0)/r;this.targetOffset={x:(n.x-o)/r,y:(n.y-o)/r},this.te=o,this.lambda_v0=r/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var a=this.modification,s=this.modifierArg;s.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},a.result=a.setAll(s),a.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+a.result.delta.x,y:this.targetOffset.y+a.result.delta.y}),this.onNextFrame(function(){return t.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return t.smoothEndTick()})}},{key:"onNextFrame",value:function(t){var n=this;this.timeout=nt.request(function(){n.active&&t()})}},{key:"inertiaTick",value:function(){var t,n,i,r,o,a,s,c=this,u=this.interaction,l=Xt(u).resistance,p=(u._now()-this.t0)/1e3;if(p=0;g--){var T=m[g];if(T.selector===l&&T.context===p){for(var S=T.listeners,E=S.length-1;E>=0;E--){var z=S[E];if(z.func===v&&qt(z.options,b)){S.splice(E,1),S.length||(m.splice(g,1),s(p,d,c),s(p,d,u,!0)),x=!0;break}}if(x)break}}},delegateListener:c,delegateUseCapture:u,delegatedEvents:i,documents:r,targets:n,supportsOptions:!1,supportsPassive:!1};function a(l,p,d,v){if(l.addEventListener){var h=zt(v),g=Et(n,function(b){return b.eventTarget===l});g||(g={eventTarget:l,events:{}},n.push(g)),g.events[p]||(g.events[p]=[]),Et(g.events[p],function(b){return b.func===d&&qt(b.options,h)})||(l.addEventListener(p,d,o.supportsOptions?h:h.capture),g.events[p].push({func:d,options:h}))}}function s(l,p,d,v){if(l.addEventListener&&l.removeEventListener){var h=wt(n,function(L){return L.eventTarget===l}),g=n[h];if(g&&g.events)if(p!=="all"){var b=!1,m=g.events[p];if(m){if(d==="all"){for(var x=m.length-1;x>=0;x--){var T=m[x];s(l,p,T.func,T.options)}return}for(var S=zt(v),E=0;E=2)continue;if(!r.interacting()&&t===r.pointerType)return r}return null}};function bn(e,t){return e.pointers.some(function(n){return n.id===t})}var vi=be,xe=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function xn(e,t){return function(n){var i=t.interactions.list,r=qe(n),o=Ve(n),a=o[0],s=o[1],c=[];if(/^touch/.test(n.type)){t.prevTouchTime=t.now();for(var u=0,l=n.changedTouches;u=0;i--){var r=t.interactions.list[i];r.interactable===n&&(r.stop(),t.fire("interactions:destroy",{interaction:r}),r.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(i,1))}}},onDocSignal:we,doOnInteractions:xn,methodNames:xe},mi=gi,rt=function(e){return e[e.On=0]="On",e[e.Off=1]="Off",e}(rt||{}),yi=function(){function e(t,n,i,r){D(this,e),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new yn,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=n.actions,this.target=t,this._context=n.context||i,this._win=N(Fe(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=r,this.set(n)}return P(e,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,n){return f.func(n.onstart)&&this.on("".concat(t,"start"),n.onstart),f.func(n.onmove)&&this.on("".concat(t,"move"),n.onmove),f.func(n.onend)&&this.on("".concat(t,"end"),n.onend),f.func(n.oninertiastart)&&this.on("".concat(t,"inertiastart"),n.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,n,i){var r,o=this,a=(r=this._actions.map[t])==null?void 0:r.filterEventType,s=function(c){return(a==null||a(c))&&Ht(c,o._actions)};(f.array(n)||f.object(n))&&this._onOff(rt.Off,t,n,void 0,s),(f.array(i)||f.object(i))&&this._onOff(rt.On,t,i,void 0,s)}},{key:"setPerAction",value:function(t,n){var i=this._defaults;for(var r in n){var o=r,a=this.options[t],s=n[o];o==="listeners"&&this.updatePerActionListeners(t,a.listeners,s),f.array(s)?a[o]=Ue(s):f.plainObject(s)?(a[o]=w(a[o]||{},vt(s)),f.object(i.perAction[o])&&"enabled"in i.perAction[o]&&(a[o].enabled=s.enabled!==!1)):f.bool(s)&&f.object(i.perAction[o])?a[o].enabled=s:a[o]=s}}},{key:"getRect",value:function(t){return t=t||(f.element(this.target)?this.target:null),f.string(this.target)&&(t=t||this._context.querySelector(this.target)),ee(t)}},{key:"rectChecker",value:function(t){var n=this;return f.func(t)?(this.getRect=function(i){var r=w({},t.apply(n,i));return"width"in r||(r.width=r.right-r.left,r.height=r.bottom-r.top),r},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,n){if(Fe(n)||f.object(n)){for(var i in this.options[t]=n,this._actions.map)this.options[i][t]=n;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return f.string(t)?Array.from(this._context.querySelectorAll(t)):f.func(t)&&t.getAllElements?t.getAllElements():f.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||lt(this._context,t)}},{key:"testIgnoreAllow",value:function(t,n,i){return!this.testIgnore(t.ignoreFrom,n,i)&&this.testAllow(t.allowFrom,n,i)}},{key:"testAllow",value:function(t,n,i){return!t||!!f.element(i)&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"testIgnore",value:function(t,n,i){return!(!t||!f.element(i))&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,n,i,r,o){f.object(n)&&!f.array(n)&&(r=i,i=null);var a=ut(n,i,o);for(var s in a){s==="wheel"&&(s=U.wheelEvent);for(var c=0,u=a[s];c=0;i--){var r=n[i],o=r.selector,a=r.context,s=r.listeners;o===this.target&&a===this._context&&n.splice(i,1);for(var c=s.length-1;c>=0;c--)this._scopeEvents.removeDelegate(this.target,this._context,t,s[c][0],s[c][1])}else this._scopeEvents.remove(this.target,"all")}}]),e}(),bi=function(){function e(t){var n=this;D(this,e),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(i){var r=i.interactable,o=r.target,a=f.string(o)?n.selectorMap[o]:o[n.scope.id],s=wt(a,function(c){return c===r});a.splice(s,1)}})}return P(e,[{key:"new",value:function(t,n){n=w(n||{},{actions:this.scope.actions});var i=new this.scope.Interactable(t,n,this.scope.document,this.scope.events);return this.scope.addDocument(i._doc),this.list.push(i),f.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:n,interactable:i,win:this.scope._win}),i}},{key:"getExisting",value:function(t,n){var i=n&&n.context||this.scope.document,r=f.string(t),o=r?this.selectorMap[t]:t[this.scope.id];if(o)return Et(o,function(a){return a._context===i&&(r||a.inContext(t))})}},{key:"forEachMatch",value:function(t,n){for(var i=0,r=this.list;iMath.abs(u.y),c.coords,c.rect),w(i,c.coords)),c.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Si(e,t,n){var i=e.startCoords,r=e.edgeSign;t?n.y=i.y+(n.x-i.x)*r.y:n.x=i.x+(n.y-i.y)*r.x}function Pi(e,t,n,i){var r=e.startRect,o=e.startCoords,a=e.ratio,s=e.edgeSign;if(t){var c=i.width/a;n.y=o.y+(c-r.height)*s.y}else{var u=i.height*a;n.x=o.x+(u-r.width)*s.x}}var Di=it(zi,"aspectRatio"),Tn=function(){};Tn._defaults={};var Vt=Tn;function dt(e,t,n){return f.func(e)?mt(e,t.interactable,t.element,[n.x,n.y,t]):mt(e,t.interactable,t.element)}var Wt={start:function(e){var t=e.rect,n=e.startOffset,i=e.state,r=e.interaction,o=e.pageCoords,a=i.options,s=a.elementRect,c=w({left:0,top:0,right:0,bottom:0},a.offset||{});if(t&&s){var u=dt(a.restriction,r,o);if(u){var l=u.right-u.left-t.width,p=u.bottom-u.top-t.height;l<0&&(c.left+=l,c.right+=l),p<0&&(c.top+=p,c.bottom+=p)}c.left+=n.left-t.width*s.left,c.top+=n.top-t.height*s.top,c.right+=n.right-t.width*(1-s.right),c.bottom+=n.bottom-t.height*(1-s.bottom)}i.offset=c},set:function(e){var t=e.coords,n=e.interaction,i=e.state,r=i.options,o=i.offset,a=dt(r.restriction,n,t);if(a){var s=function(c){return!c||"left"in c&&"top"in c||((c=w({},c)).left=c.x||0,c.top=c.y||0,c.right=c.right||c.left+c.width,c.bottom=c.bottom||c.top+c.height),c}(a);t.x=Math.max(Math.min(s.right-o.right,t.x),s.left+o.left),t.y=Math.max(Math.min(s.bottom-o.bottom,t.y),s.top+o.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Oi=it(Wt,"restrict"),zn={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Sn={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Pn(e,t){for(var n=0,i=["top","left","bottom","right"];nthis.handleMutationObserver()),this.handleKeyDown=y=>{const{key:A,shiftKey:O,defaultPrevented:M}=y,{dragEnabled:I,resizable:D,resizePosition:j,dragPosition:P,transitionEl:W}=this;if(!(M||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(A)))switch(A){case"ArrowUp":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().height-st,type:"blockSize"}),j.bottom-=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.y-=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowDown":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().height+st,type:"blockSize"}),j.bottom+=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.y+=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowLeft":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().width-st,type:"inlineSize"}),j.right-=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.x-=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowRight":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().width+st,type:"inlineSize"}),j.right+=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.x+=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break}},this.setTransitionEl=y=>{this.transitionEl=y,this.setupInteractions()},this.openEnd=()=>{this.setFocus(),this.el.removeEventListener("calciteDialogOpen",this.openEnd)},this.handleInternalPanelScroll=y=>{y.target===this.panelEl&&(y.stopPropagation(),this.calciteDialogScroll.emit())},this.handleInternalPanelCloseClick=y=>{y.target===this.panelEl&&(y.stopPropagation(),this.open=!1)},this.handlePanelKeyDown=y=>{this.escapeDisabled&&y.key==="Escape"&&y.preventDefault()},this.handleOutsideClose=()=>{this.outsideCloseDisabled||(this.open=!1)},this.closeDialog=async()=>{if(this.beforeClose)try{await this.beforeClose()}catch{requestAnimationFrame(()=>{this.ignoreOpenChange=!0,this.open=!0,this.ignoreOpenChange=!1});return}ze--,this.opened=!1,this.updateOverflowHiddenClass()},this.updateOverflowHiddenClass=()=>{this.opened&&!this.embedded&&this.modal?this.addOverflowHiddenClass():this.removeOverflowHiddenClass()},this.handleMutationObserver=()=>{this.updateFocusTrapElements()},this.beforeClose=void 0,this.description=void 0,this.dragEnabled=!1,this.closeDisabled=!1,this.embedded=!1,this.escapeDisabled=!1,this.heading=void 0,this.headingLevel=void 0,this.kind=void 0,this.loading=!1,this.menuOpen=!1,this.messages=void 0,this.messageOverrides=void 0,this.modal=!1,this.open=!1,this.outsideCloseDisabled=!1,this.overlayPositioning="absolute",this.placement="center",this.resizable=!1,this.scale="m",this.widthScale="m",this.opened=!1,this.hasFooter=!0,this.hasContentTop=!1,this.hasContentBottom=!1,this.effectiveLocale=void 0,this.defaultMessages=void 0,this.assistiveText=null}onMessagesChange(){}onModalChange(){this.updateOverflowHiddenClass()}async componentWillLoad(){await fr(this),ar(this),this.open&&this.openDialog()}componentDidLoad(){sr(this)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),pr(this),hr(this),er(this),this.setupInteractions()}disconnectedCallback(){this.removeOverflowHiddenClass(),this.mutationObserver?.disconnect(),_n(this),dr(this),vr(this),this.embedded=!1,this.cleanupInteractions()}render(){const{assistiveText:y,description:A,heading:O,opened:M}=this;return C(Qi,{key:"bf406255eaa6d94c8443af185a74a2b2d58c6d59"},C("div",{key:"de2a34b6da4a82c66e9fafdbdd2056e4e11e1315",class:{[at.container]:!0,[at.containerOpen]:M,[at.containerEmbedded]:this.embedded}},this.modal?C("calcite-scrim",{class:at.scrim,onClick:this.handleOutsideClose}):null,C("div",{key:"be47093e3a955ce45a71c555700143a4a1c7a166","aria-description":A,"aria-label":O,"aria-modal":Zi(this.modal),class:at.dialog,onKeyDown:this.handleKeyDown,ref:this.setTransitionEl,role:"dialog"},y?C("div",{"aria-live":"polite",class:at.assistiveText,key:"assistive-text"},y):null,C("slot",{key:"6ed9f10ae7d5ecc1ec9062d6aba559001d5194e6",name:H.content},C("calcite-panel",{key:"cd6ebaa7d7362cbeb70e9ae623f38298d1e831e3",beforeClose:this.beforeClose,class:at.panel,closable:!this.closeDisabled,closed:!M,description:A,heading:O,headingLevel:this.headingLevel,loading:this.loading,menuOpen:this.menuOpen,messageOverrides:this.messageOverrides,onCalcitePanelClose:this.handleInternalPanelCloseClick,onCalcitePanelScroll:this.handleInternalPanelScroll,onKeyDown:this.handlePanelKeyDown,overlayPositioning:this.overlayPositioning,ref:I=>this.panelEl=I,scale:this.scale},C("slot",{key:"2ce955775c33b09fc849a083d0bcc1c8ce523dd8",name:H.actionBar,slot:V.actionBar}),C("slot",{key:"dd44184de251320af6225baa2e59571b881a23cd",name:H.alerts,slot:V.alerts}),C("slot",{key:"da343a1a10e015b04b37463c10592e612a576e9b",name:H.headerActionsStart,slot:V.headerActionsStart}),C("slot",{key:"6680fde2bd7ad6dc5803c78ea7250d11d4920b7c",name:H.headerActionsEnd,slot:V.headerActionsEnd}),C("slot",{key:"a17ca64188ffe6000792e67eafc838df575ebbc3",name:H.headerContent,slot:V.headerContent}),C("slot",{key:"7e048c4a9104053ca0a61ab2514b018efb4fc872",name:H.headerMenuActions,slot:V.headerMenuActions}),C("slot",{key:"6760c8a6c105a511fcb859cfd222f8c1355a82c4",name:H.fab,slot:V.fab}),C("slot",{key:"e0f2e7644281d408d8c21ce5bf16b08af0a59c3b",name:H.contentTop,slot:V.contentTop}),C("slot",{key:"01889c3b7fc13bc49521c27feb2ab35346552504",name:H.contentBottom,slot:V.contentBottom}),C("slot",{key:"593bad35110b5d7e7b44d598b397e4b87cc28e28",name:H.footerStart,slot:V.footerStart}),C("slot",{key:"5e84099e096a6afb678cce9731b189f4011dc067",name:H.footer,slot:V.footer}),C("slot",{key:"69a805bd0c1f43a6d165939e62db562428f39f11",name:H.footerEnd,slot:V.footerEnd}),C("slot",{key:"b49e14ff6d2c63caaa8fd296920618e7673eb71b"}))))))}effectiveLocaleChange(){gr(this,this.effectiveLocale)}handleInteractionChange(){this.setupInteractions()}updateAssistiveText(){const{messages:y}=this;this.assistiveText=y&&(this.dragEnabled||this.resizable)?`${this.dragEnabled?y.dragEnabled:""} ${this.resizable?y.resizeEnabled:""}`:null}handleEscape(y){this.open&&!this.escapeDisabled&&y.key==="Escape"&&!y.defaultPrevented&&(this.open=!1,y.preventDefault())}async setFocus(){return await cr(this),this.panelEl?.setFocus()??tr(this.el)}async updateFocusTrapElements(){nr(this)}async scrollContentTo(y){await this.panelEl?.scrollContentTo(y)}onBeforeOpen(){this.calciteDialogBeforeOpen.emit()}onOpen(){this.calciteDialogOpen.emit(),ir(this)}onBeforeClose(){this.calciteDialogBeforeClose.emit()}onClose(){this.calciteDialogClose.emit(),_n(this)}toggleDialog(y){this.ignoreOpenChange||(y?this.openDialog():this.closeDialog())}handleOpenedChange(y){this.transitionEl.classList.toggle(at.openingActive,y),ur(this)}async triggerInteractModifiers(){const{interaction:y}=this;y&&(await y.reflow({name:"drag"}),await y.reflow({name:"resize"}))}getTransitionElDOMRect(){return this.transitionEl.getBoundingClientRect()}updateTransform(){const{dragPosition:{x:y,y:A},resizePosition:O,transitionEl:M,dragEnabled:I,resizable:D}=this;if(!M)return;if(!I&&!D){M.style.transform=null;return}const{top:j,right:P,bottom:W,left:$}=this.getAdjustedResizePosition(O),B=Math.round(y+$+P),K=Math.round(A+j+W);M.style.transform=B||K?`translate(${B}px, ${K}px)`:null}updateSize({type:y,size:A}){const{transitionEl:O}=this;O&&(O.style[y]=A!==null?`${Math.round(A)}px`:null)}cleanupInteractions(){this.interaction?.unset(),this.updateSize({size:null,type:"inlineSize"}),this.updateSize({size:null,type:"blockSize"}),this.dragPosition={...In},this.resizePosition={...Mn},this.updateTransform()}setupInteractions(){this.cleanupInteractions();const{el:y,transitionEl:A,resizable:O,dragEnabled:M,resizePosition:I,dragPosition:D}=this;if(!(!A||!this.open)){if((O||M)&&(this.interaction=$t(A,{context:y.ownerDocument})),O){const{minInlineSize:j,minBlockSize:P,maxInlineSize:W,maxBlockSize:$}=window.getComputedStyle(A);this.interaction.resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},modifiers:[$t.modifiers.restrictSize({min:{width:this.isPixelValue(j)?parseInt(j,10):0,height:this.isPixelValue(P)?parseInt(P,10):0},max:{width:this.isPixelValue(W)?parseInt(W,10):window.innerWidth,height:this.isPixelValue($)?parseInt($,10):window.innerHeight}}),$t.modifiers.restrict({restriction:"parent"})],listeners:{move:({rect:B,deltaRect:K})=>{K&&(I.top+=K.top,I.right+=K.right,I.bottom+=K.bottom,I.left+=K.left),this.updateSize({size:B.width,type:"inlineSize"}),this.updateSize({size:B.height,type:"blockSize"}),this.updateTransform()}}})}M&&this.interaction.draggable({modifiers:[$t.modifiers.restrictRect({restriction:"parent"})],listeners:{move:({dx:j,dy:P})=>{D.x+=j,D.y+=P,this.updateTransform()}}})}}isPixelValue(y){return y.indexOf("px")!==-1}getAdjustedResizePosition({top:y,right:A,bottom:O,left:M}){const I=y/2,D=A/2,j=O/2,P=M/2;switch(this.placement){case"top":return{top:y,right:D,bottom:0,left:P};case"top-start":return{top:y,right:0,bottom:0,left:M};case"top-end":return{top:y,right:A,bottom:0,left:0};case"bottom":return{top:0,right:D,bottom:O,left:P};case"bottom-start":return{top:0,right:0,bottom:O,left:M};case"bottom-end":return{top:0,right:A,bottom:O,left:0};case"cover":case"center":default:return{top:I,right:D,bottom:j,left:P}}}async openDialog(){await mr(this.el),this.el.addEventListener("calciteDialogOpen",this.openEnd),this.opened=!0,this.updateOverflowHiddenClass()}addOverflowHiddenClass(){ze===0&&(Cn=document.documentElement.style.overflow),ze++,document.documentElement.style.setProperty("overflow","hidden")}removeOverflowHiddenClass(){document.documentElement.style.setProperty("overflow",Cn)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],modal:["onModalChange"],effectiveLocale:["effectiveLocaleChange"],open:["handleInteractionChange","toggleDialog"],placement:["handleInteractionChange"],resizable:["handleInteractionChange","updateAssistiveText"],dragEnabled:["handleInteractionChange","updateAssistiveText"],messages:["updateAssistiveText"],opened:["handleOpenedChange"]}}static get style(){return zr}},[1,"calcite-dialog",{beforeClose:[16],description:[1],dragEnabled:[516,"drag-enabled"],closeDisabled:[516,"close-disabled"],embedded:[1028],escapeDisabled:[516,"escape-disabled"],heading:[1],headingLevel:[514,"heading-level"],kind:[513],loading:[516],menuOpen:[516,"menu-open"],messages:[1040],messageOverrides:[1040],modal:[516],open:[1540],outsideCloseDisabled:[516,"outside-close-disabled"],overlayPositioning:[513,"overlay-positioning"],placement:[513],resizable:[516],scale:[513],widthScale:[513,"width-scale"],opened:[32],hasFooter:[32],hasContentTop:[32],hasContentBottom:[32],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],setFocus:[64],updateFocusTrapElements:[64],scrollContentTo:[64]},[[8,"keydown","handleEscape"]],{messageOverrides:["onMessagesChange"],modal:["onModalChange"],effectiveLocale:["effectiveLocaleChange"],open:["handleInteractionChange","toggleDialog"],placement:["handleInteractionChange"],resizable:["handleInteractionChange","updateAssistiveText"],dragEnabled:["handleInteractionChange","updateAssistiveText"],messages:["updateAssistiveText"],opened:["handleOpenedChange"]}]);function jn(){typeof customElements>"u"||["calcite-dialog","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(y=>{switch(y){case"calcite-dialog":customElements.get(y)||customElements.define(y,Rn);break;case"calcite-action":customElements.get(y)||br();break;case"calcite-action-menu":customElements.get(y)||or();break;case"calcite-icon":customElements.get(y)||xr();break;case"calcite-loader":customElements.get(y)||wr();break;case"calcite-panel":customElements.get(y)||yr();break;case"calcite-popover":customElements.get(y)||rr();break;case"calcite-scrim":customElements.get(y)||Er();break}})}jn();const Gr=Rn,$r=jn;export{Gr as CalciteDialog,$r as defineCustomElement}; diff --git a/main/assets/calcite-dropdown-CLrG397W-BUH-uj2q.js b/main/assets/calcite-dropdown-CLrG397W-BUH-uj2q.js new file mode 100644 index 000000000..eaf8f2fa3 --- /dev/null +++ b/main/assets/calcite-dropdown-CLrG397W-BUH-uj2q.js @@ -0,0 +1 @@ +import{p as v,b as D,W as a,a as o,D as E}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{M as p,g as y,A as h,O as r}from"./dom-N58V0tYi-DBU3jlah.js";import{I,U as l,V as O,q as x,j as m,_ as k}from"./floating-ui-DKFFlLv3-B6atYKJb.js";import{i as C}from"./guid-Dls486Er-CBh637k4.js";import{l as P,p as H}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{n as S}from"./key-CZySMiwx-kmS7VeUz.js";import{f as z,o as T,r as A}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{c as f}from"./observers-BigwqTsw-Du14S4xc.js";import{p as w}from"./openCloseComponent-BGQ6h7vg-DwGQl3jY.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const F={dropdownTrigger:"trigger"},L=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;block-size:100%;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width-scale=s]){--calcite-dropdown-width:12rem}:host([width-scale=m]){--calcite-dropdown-width:14rem}:host([width-scale=l]){--calcite-dropdown-width:16rem}:host([hidden]){display:none}[hidden]{display:none}",B=L,u=v(class extends D{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownSelect=a(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=a(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=a(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=a(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=a(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=f("mutation",()=>this.updateItems()),this.resizeObserver=f("resize",e=>this.resizeObserverCallback(e)),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${C()}`,this.focusLastDropdownItem=!1,this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?I(t,e):null},this.updateTriggers=e=>{this.triggers=e.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map(e=>Array.from(e?.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)},this.updateGroups=e=>{const t=e.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-dropdown-group"));this.groups=t,this.updateItems(),this.updateGroupScale()},this.resizeObserverCallback=e=>{e.forEach(t=>{const{target:i}=t;i===this.referenceEl?this.setDropdownWidth():i===this.scrollerEl&&this.setMaxScrollerHeight()})},this.setDropdownWidth=()=>{const{referenceEl:e,scrollerEl:t}=this,i=e?.clientWidth;!i||!t||(t.style.minWidth=`${i}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:e}=this;if(!e)return;this.reposition(!0);const t=this.getMaxScrollerHeight();e.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=e=>{this.resizeObserver.observe(e),this.scrollerEl=e,this.transitionEl=e},this.setReferenceEl=e=>{this.referenceEl=e,l(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(e)},this.setFloatingEl=e=>{this.floatingEl=e,l(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=e=>{if(!e.composedPath().includes(this.referenceEl))return;const{defaultPrevented:t,key:i}=e;if(!t){if(i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}if(this.open&&e.shiftKey&&i==="Tab"){this.closeCalciteDropdown(),e.preventDefault();return}S(i)?(this.toggleDropdown(),e.preventDefault()):(i==="ArrowDown"||i==="ArrowUp")&&(this.focusLastDropdownItem=i==="ArrowUp",this.open=!0,this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd))}},this.focusOnFirstActiveOrDefaultItem=()=>{const e=this.getTraversableItems().find(t=>t.selected)||(this.focusLastDropdownItem?this.items[this.items.length-1]:this.items[0]);this.focusLastDropdownItem=!1,e&&p(e)},this.onOpenEnd=()=>{this.focusOnFirstActiveOrDefaultItem(),this.el.removeEventListener("calciteDropdownOpen",this.onOpenEnd)},this.toggleDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=O,this.selectedItems=[],this.type="click",this.widthScale=void 0,this.scale="m"}openHandler(){if(w(this),this.disabled){this.open=!1;return}this.reposition(!0)}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupScale()}async setFocus(){await z(this),y(this.referenceEl)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.open&&(this.openHandler(),w(this)),this.updateItems(),l(this,this.referenceEl,this.floatingEl)}componentWillLoad(){T(this)}componentDidLoad(){A(this),l(this,this.referenceEl,this.floatingEl)}componentDidRender(){P(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),x(this,this.referenceEl,this.floatingEl)}render(){const{open:e,guid:t}=this;return o(E,{key:"377c3d9687bc025f004b4efe58bfa5f0893d86d0"},o(H,{key:"9e2f48be045fc6db10cc7203a8b998ec2b6abafd",disabled:this.disabled},o("div",{key:"8607de2d53a4f8c4b29206ee56aa23ad4c2cbe3d",class:"calcite-trigger-container",id:`${t}-menubutton`,onClick:this.toggleDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},o("slot",{key:"07de8df34055ddc39301654a5ca312ddf293e6a9","aria-controls":`${t}-menu`,"aria-expanded":h(e),"aria-haspopup":"menu",name:F.dropdownTrigger,onSlotchange:this.updateTriggers})),o("div",{key:"c1469efb62eb704b021ce6479ad55deda59582d4","aria-hidden":h(!e),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},o("div",{key:"f875166d486a53cd393f17d9295974aa449d449f","aria-labelledby":`${t}-menubutton`,class:{"calcite-dropdown-content":!0,[m.animation]:!0,[m.animationActive]:e},id:`${t}-menu`,ref:this.setScrollerAndTransitionEl,role:"menu"},o("slot",{key:"bc6e61383aaf85b3d6242a86c50da68bc8b31e27",onSlotchange:this.updateGroups})))))}async reposition(e=!1){const{floatingEl:t,referenceEl:i,placement:s,overlayPositioning:n,filteredFlipPlacements:c}=this;return k(this,{floatingEl:t,referenceEl:i,overlayPositioning:n,placement:s,flipPlacements:c,type:"menu"},e)}closeCalciteDropdownOnClick(e){this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(e){this.closeCalciteDropdown(),e.stopPropagation()}closeCalciteDropdownOnOpenEvent(e){e.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||this.type!=="hover"||this.toggleDropdown()}pointerLeaveHandler(){this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.hidden)}calciteInternalDropdownItemKeyEvent(e){const{keyboardEvent:t}=e.detail,i=t.target,s=this.getTraversableItems();switch(t.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(i);break;case"ArrowDown":r(s,i,"next");break;case"ArrowUp":r(s,i,"previous");break;case"Home":r(s,i,"first");break;case"End":r(s,i,"last");break}e.stopPropagation()}handleItemSelect(e){this.updateSelectedItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),(!this.closeOnSelectDisabled||e.detail.requestedDropdownGroup.selectionMode==="none")&&this.closeCalciteDropdown(),e.stopPropagation()}updateGroupScale(){this.groups?.forEach(e=>e.scale=this.scale)}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getMaxScrollerHeight(){const{maxItems:e,items:t}=this;let i=0,s=0,n;return this.groups.forEach(c=>{e>0&&i{b===0&&(isNaN(n)&&(n=d.offsetTop),s+=n),ie?s:0}closeCalciteDropdown(e=!0){this.open=!1,e&&p(this.triggers[0])}updateTabIndexOfItems(e){this.items.forEach(t=>{t.tabIndex=e!==t?-1:0})}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}static get style(){return B}},[17,"calcite-dropdown",{open:[1540],closeOnSelectDisabled:[516,"close-on-select-disabled"],disabled:[516],flipPlacements:[16],maxItems:[514,"max-items"],overlayPositioning:[513,"overlay-positioning"],placement:[513],selectedItems:[1040],type:[513],widthScale:[513,"width-scale"],scale:[513],setFocus:[64],reposition:[64]},[[8,"click","closeCalciteDropdownOnClick"],[0,"calciteInternalDropdownCloseRequest","closeCalciteDropdownOnEvent"],[8,"calciteDropdownOpen","closeCalciteDropdownOnOpenEvent"],[1,"pointerenter","pointerEnterHandler"],[1,"pointerleave","pointerLeaveHandler"],[0,"calciteInternalDropdownItemKeyEvent","calciteInternalDropdownItemKeyEvent"],[0,"calciteInternalDropdownItemSelect","handleItemSelect"]],{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}]);function g(){typeof customElements>"u"||["calcite-dropdown"].forEach(e=>{switch(e){case"calcite-dropdown":customElements.get(e)||customElements.define(e,u);break}})}g();const J=u,Q=g;export{J as CalciteDropdown,Q as defineCustomElement}; diff --git a/main/assets/calcite-dropdown-CLrG397W-D0Dzxk5y.js b/main/assets/calcite-dropdown-CLrG397W-D0Dzxk5y.js deleted file mode 100644 index 84c704477..000000000 --- a/main/assets/calcite-dropdown-CLrG397W-D0Dzxk5y.js +++ /dev/null @@ -1 +0,0 @@ -import{p as v,b as D,W as a,a as o,D as E}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{M as p,g as y,A as h,O as r}from"./dom-N58V0tYi-DBU3jlah.js";import{I,U as l,V as O,q as x,j as m,_ as k}from"./floating-ui-DKFFlLv3-DZ3_fUHw.js";import{i as C}from"./guid-Dls486Er-CBh637k4.js";import{l as P,p as H}from"./interactive-DqhNilgd-DrUFww1w.js";import{n as S}from"./key-CZySMiwx-kmS7VeUz.js";import{f as z,o as T,r as A}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{c as f}from"./observers-BigwqTsw-DJJPVpPW.js";import{p as w}from"./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const F={dropdownTrigger:"trigger"},L=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;block-size:100%;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width-scale=s]){--calcite-dropdown-width:12rem}:host([width-scale=m]){--calcite-dropdown-width:14rem}:host([width-scale=l]){--calcite-dropdown-width:16rem}:host([hidden]){display:none}[hidden]{display:none}",B=L,u=v(class extends D{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownSelect=a(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=a(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=a(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=a(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=a(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=f("mutation",()=>this.updateItems()),this.resizeObserver=f("resize",e=>this.resizeObserverCallback(e)),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${C()}`,this.focusLastDropdownItem=!1,this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?I(t,e):null},this.updateTriggers=e=>{this.triggers=e.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map(e=>Array.from(e?.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)},this.updateGroups=e=>{const t=e.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-dropdown-group"));this.groups=t,this.updateItems(),this.updateGroupScale()},this.resizeObserverCallback=e=>{e.forEach(t=>{const{target:i}=t;i===this.referenceEl?this.setDropdownWidth():i===this.scrollerEl&&this.setMaxScrollerHeight()})},this.setDropdownWidth=()=>{const{referenceEl:e,scrollerEl:t}=this,i=e?.clientWidth;!i||!t||(t.style.minWidth=`${i}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:e}=this;if(!e)return;this.reposition(!0);const t=this.getMaxScrollerHeight();e.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=e=>{this.resizeObserver.observe(e),this.scrollerEl=e,this.transitionEl=e},this.setReferenceEl=e=>{this.referenceEl=e,l(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(e)},this.setFloatingEl=e=>{this.floatingEl=e,l(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=e=>{if(!e.composedPath().includes(this.referenceEl))return;const{defaultPrevented:t,key:i}=e;if(!t){if(i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}if(this.open&&e.shiftKey&&i==="Tab"){this.closeCalciteDropdown(),e.preventDefault();return}S(i)?(this.toggleDropdown(),e.preventDefault()):(i==="ArrowDown"||i==="ArrowUp")&&(this.focusLastDropdownItem=i==="ArrowUp",this.open=!0,this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd))}},this.focusOnFirstActiveOrDefaultItem=()=>{const e=this.getTraversableItems().find(t=>t.selected)||(this.focusLastDropdownItem?this.items[this.items.length-1]:this.items[0]);this.focusLastDropdownItem=!1,e&&p(e)},this.onOpenEnd=()=>{this.focusOnFirstActiveOrDefaultItem(),this.el.removeEventListener("calciteDropdownOpen",this.onOpenEnd)},this.toggleDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=O,this.selectedItems=[],this.type="click",this.widthScale=void 0,this.scale="m"}openHandler(){if(w(this),this.disabled){this.open=!1;return}this.reposition(!0)}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupScale()}async setFocus(){await z(this),y(this.referenceEl)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.open&&(this.openHandler(),w(this)),this.updateItems(),l(this,this.referenceEl,this.floatingEl)}componentWillLoad(){T(this)}componentDidLoad(){A(this),l(this,this.referenceEl,this.floatingEl)}componentDidRender(){P(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),x(this,this.referenceEl,this.floatingEl)}render(){const{open:e,guid:t}=this;return o(E,{key:"377c3d9687bc025f004b4efe58bfa5f0893d86d0"},o(H,{key:"9e2f48be045fc6db10cc7203a8b998ec2b6abafd",disabled:this.disabled},o("div",{key:"8607de2d53a4f8c4b29206ee56aa23ad4c2cbe3d",class:"calcite-trigger-container",id:`${t}-menubutton`,onClick:this.toggleDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},o("slot",{key:"07de8df34055ddc39301654a5ca312ddf293e6a9","aria-controls":`${t}-menu`,"aria-expanded":h(e),"aria-haspopup":"menu",name:F.dropdownTrigger,onSlotchange:this.updateTriggers})),o("div",{key:"c1469efb62eb704b021ce6479ad55deda59582d4","aria-hidden":h(!e),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},o("div",{key:"f875166d486a53cd393f17d9295974aa449d449f","aria-labelledby":`${t}-menubutton`,class:{"calcite-dropdown-content":!0,[m.animation]:!0,[m.animationActive]:e},id:`${t}-menu`,ref:this.setScrollerAndTransitionEl,role:"menu"},o("slot",{key:"bc6e61383aaf85b3d6242a86c50da68bc8b31e27",onSlotchange:this.updateGroups})))))}async reposition(e=!1){const{floatingEl:t,referenceEl:i,placement:s,overlayPositioning:n,filteredFlipPlacements:c}=this;return k(this,{floatingEl:t,referenceEl:i,overlayPositioning:n,placement:s,flipPlacements:c,type:"menu"},e)}closeCalciteDropdownOnClick(e){this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(e){this.closeCalciteDropdown(),e.stopPropagation()}closeCalciteDropdownOnOpenEvent(e){e.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||this.type!=="hover"||this.toggleDropdown()}pointerLeaveHandler(){this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.hidden)}calciteInternalDropdownItemKeyEvent(e){const{keyboardEvent:t}=e.detail,i=t.target,s=this.getTraversableItems();switch(t.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(i);break;case"ArrowDown":r(s,i,"next");break;case"ArrowUp":r(s,i,"previous");break;case"Home":r(s,i,"first");break;case"End":r(s,i,"last");break}e.stopPropagation()}handleItemSelect(e){this.updateSelectedItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),(!this.closeOnSelectDisabled||e.detail.requestedDropdownGroup.selectionMode==="none")&&this.closeCalciteDropdown(),e.stopPropagation()}updateGroupScale(){this.groups?.forEach(e=>e.scale=this.scale)}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getMaxScrollerHeight(){const{maxItems:e,items:t}=this;let i=0,s=0,n;return this.groups.forEach(c=>{e>0&&i{b===0&&(isNaN(n)&&(n=d.offsetTop),s+=n),ie?s:0}closeCalciteDropdown(e=!0){this.open=!1,e&&p(this.triggers[0])}updateTabIndexOfItems(e){this.items.forEach(t=>{t.tabIndex=e!==t?-1:0})}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}static get style(){return B}},[17,"calcite-dropdown",{open:[1540],closeOnSelectDisabled:[516,"close-on-select-disabled"],disabled:[516],flipPlacements:[16],maxItems:[514,"max-items"],overlayPositioning:[513,"overlay-positioning"],placement:[513],selectedItems:[1040],type:[513],widthScale:[513,"width-scale"],scale:[513],setFocus:[64],reposition:[64]},[[8,"click","closeCalciteDropdownOnClick"],[0,"calciteInternalDropdownCloseRequest","closeCalciteDropdownOnEvent"],[8,"calciteDropdownOpen","closeCalciteDropdownOnOpenEvent"],[1,"pointerenter","pointerEnterHandler"],[1,"pointerleave","pointerLeaveHandler"],[0,"calciteInternalDropdownItemKeyEvent","calciteInternalDropdownItemKeyEvent"],[0,"calciteInternalDropdownItemSelect","handleItemSelect"]],{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}]);function g(){typeof customElements>"u"||["calcite-dropdown"].forEach(e=>{switch(e){case"calcite-dropdown":customElements.get(e)||customElements.define(e,u);break}})}g();const J=u,Q=g;export{J as CalciteDropdown,Q as defineCustomElement}; diff --git a/main/assets/calcite-dropdown-group-0sIPwaDd-CQ-6-G1K.js b/main/assets/calcite-dropdown-group-0sIPwaDd-CQ-6-G1K.js new file mode 100644 index 000000000..422213a03 --- /dev/null +++ b/main/assets/calcite-dropdown-group-0sIPwaDd-CQ-6-G1K.js @@ -0,0 +1 @@ +import{p as s,b as a,W as n,a as t,D as l}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{c as d}from"./observers-BigwqTsw-Du14S4xc.js";import{n as c}from"./resources3-Duvedxls-DbbvfBW6.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const p=":host{position:relative;display:block}.container{text-align:start}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-title{padding:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-title{padding:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-title{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}",h=p,o=s(class extends a{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalDropdownItemChange=n(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(e=>e.selectionMode=this.selectionMode)},this.mutationObserver=d("mutation",()=>this.updateItems()),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){this.updateItems(),this.mutationObserver?.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){this.mutationObserver?.disconnect()}render(){const e=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(l,{key:"f41943751aefdb17d4f5d5bd8778c219cfd01a00","aria-label":this.groupTitle,role:"group"},t("div",{key:"87b78040b93c06081ca8282a785d466ed8fcf334",class:{[c.container]:!0}},i,e,t("slot",{key:"f635a5bdbe439315eba6292a4858cbd8519d23d1"})))}updateActiveItemOnChange(e){this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{selectionMode:["handlePropsChange"]}}static get style(){return h}},[17,"calcite-dropdown-group",{groupTitle:[513,"group-title"],scale:[513],selectionMode:[513,"selection-mode"]},[[0,"calciteInternalDropdownItemSelect","updateActiveItemOnChange"]],{selectionMode:["handlePropsChange"]}]);function r(){typeof customElements>"u"||["calcite-dropdown-group"].forEach(e=>{switch(e){case"calcite-dropdown-group":customElements.get(e)||customElements.define(e,o);break}})}r();const f=o,v=r;export{f as CalciteDropdownGroup,v as defineCustomElement}; diff --git a/main/assets/calcite-dropdown-group-0sIPwaDd-DYLu_D_p.js b/main/assets/calcite-dropdown-group-0sIPwaDd-DYLu_D_p.js deleted file mode 100644 index 4046536c9..000000000 --- a/main/assets/calcite-dropdown-group-0sIPwaDd-DYLu_D_p.js +++ /dev/null @@ -1 +0,0 @@ -import{p as s,b as a,W as n,a as t,D as l}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{c as d}from"./observers-BigwqTsw-DJJPVpPW.js";import{n as c}from"./resources3-Duvedxls-DbbvfBW6.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const p=":host{position:relative;display:block}.container{text-align:start}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-title{padding:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-title{padding:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-title{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}",h=p,o=s(class extends a{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalDropdownItemChange=n(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(e=>e.selectionMode=this.selectionMode)},this.mutationObserver=d("mutation",()=>this.updateItems()),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){this.updateItems(),this.mutationObserver?.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){this.mutationObserver?.disconnect()}render(){const e=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(l,{key:"f41943751aefdb17d4f5d5bd8778c219cfd01a00","aria-label":this.groupTitle,role:"group"},t("div",{key:"87b78040b93c06081ca8282a785d466ed8fcf334",class:{[c.container]:!0}},i,e,t("slot",{key:"f635a5bdbe439315eba6292a4858cbd8519d23d1"})))}updateActiveItemOnChange(e){this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{selectionMode:["handlePropsChange"]}}static get style(){return h}},[17,"calcite-dropdown-group",{groupTitle:[513,"group-title"],scale:[513],selectionMode:[513,"selection-mode"]},[[0,"calciteInternalDropdownItemSelect","updateActiveItemOnChange"]],{selectionMode:["handlePropsChange"]}]);function r(){typeof customElements>"u"||["calcite-dropdown-group"].forEach(e=>{switch(e){case"calcite-dropdown-group":customElements.get(e)||customElements.define(e,o);break}})}r();const f=o,v=r;export{f as CalciteDropdownGroup,v as defineCustomElement}; diff --git a/main/assets/calcite-dropdown-item-DpLfv4A0-7PxMAxbJ.js b/main/assets/calcite-dropdown-item-DpLfv4A0-7PxMAxbJ.js new file mode 100644 index 000000000..599b5e5a1 --- /dev/null +++ b/main/assets/calcite-dropdown-item-DpLfv4A0-7PxMAxbJ.js @@ -0,0 +1,11 @@ +import{p as g,b as k,W as a,a as t,D}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{A as I}from"./dom-N58V0tYi-DBU3jlah.js";import{f as y,o as x,r as E}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{e as s}from"./component-CWGf1hug-BASJpoEG.js";import{l as q,p as z}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{n as i}from"./resources3-Duvedxls-DbbvfBW6.js";import{m as R}from"./icon-BXFbBbop-Du8Zws1L.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-Du14S4xc.js";const S=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;flex-grow:1;align-items:center;outline-color:transparent}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.container a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem}.dropdown-item-icon{position:relative;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}:host([scale=s]) .container{padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-item-icon,:host([scale=s]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .container{padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-item-icon,:host([scale=m]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-md)}:host([scale=m]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .container{padding-block:0.625rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-item-icon,:host([scale=l]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-xl)}:host([scale=l]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-xl)}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host(:focus) .container{color:var(--calcite-color-text-1);text-decoration-line:none}:host(:hover:not([disabled])) .container,:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);text-decoration-line:none}:host(:hover:not([disabled])) .dropdown-link,:host(:active:not([disabled])) .dropdown-link{color:var(--calcite-color-text-1)}:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-3)}:host([selected]) .container:not(.container--none-selection),:host([selected]) .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .dropdown-link calcite-icon{color:var(--calcite-color-brand)}:host(:hover:not([disabled])) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,C=S,m=g(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownItemSelect=a(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=a(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=a(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=a(this,"calciteInternalDropdownCloseRequest",6),this.disabled=!1,this.href=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.label=void 0,this.rel=void 0,this.selected=!1,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){await y(this),this.el?.focus()}componentWillLoad(){x(this),this.initialize()}componentDidLoad(){E(this)}connectedCallback(){this.initialize()}componentDidRender(){q(this)}render(){const{href:e,selectionMode:o,label:l,iconFlipRtl:n}=this,r=t("calcite-icon",{key:"1ec1c941651dda8f39fa15427592141f04180f3e",class:i.iconStart,flipRtl:n==="start"||n==="both",icon:this.iconStart,scale:s(this.scale)}),c=t("span",{key:"3ab167ed4054ca34b4e13e72b752af6cf25522ae",class:i.itemContent},t("slot",{key:"88cf44809fb48450c66cc8f105bbda008a78157d"})),d=t("calcite-icon",{key:"32fb27182943a032c0037f1f878a95c194d2dff1",class:i.iconEnd,flipRtl:n==="end"||n==="both",icon:this.iconEnd,scale:s(this.scale)}),p=this.iconStart&&this.iconEnd?[r,c,d]:this.iconStart?[r,c]:this.iconEnd?[c,d]:c,b=e?t("a",{"aria-label":l,class:i.link,href:e,ref:v=>this.childLink=v,rel:this.rel,tabIndex:-1,target:this.target},p):p,f=e?null:o==="single"?"menuitemradio":o==="multiple"?"menuitemcheckbox":"menuitem",w=o!=="none"?I(this.selected):null,{disabled:h}=this;return t(D,{key:"beec8e51bf18bdcab1928181828b372cc70bb7ee","aria-checked":w,"aria-label":e?"":l,role:f,tabIndex:h?-1:0},t(z,{key:"5cbbd1074d6c571f4cac3a99e4a2c09bf113db55",disabled:h},t("div",{key:"bff025aeb280c9d0d829e5cf4d94e9392604e607",class:{[i.container]:!0,[i.containerNone]:o==="none"}},o!=="none"?t("calcite-icon",{class:i.icon,icon:o==="multiple"?"check":"bullet-point",scale:s(this.scale)}):null,b)))}onClick(){this.emitRequestedItem()}keyDownHandler(e){switch(e.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),e.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),e.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":e.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break}}updateActiveItemOnChange(e){e.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.determineActiveItem()),e.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),this.selectionMode==="none"&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1;break}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return this}static get style(){return C}},[1,"calcite-dropdown-item",{disabled:[516],href:[513],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],iconEnd:[513,"icon-end"],label:[1],rel:[513],selected:[1540],target:[513],selectionMode:[1,"selection-mode"],scale:[513],setFocus:[64]},[[0,"click","onClick"],[0,"keydown","keyDownHandler"],[16,"calciteInternalDropdownItemChange","updateActiveItemOnChange"]]]);function u(){typeof customElements>"u"||["calcite-dropdown-item","calcite-icon"].forEach(e=>{switch(e){case"calcite-dropdown-item":customElements.get(e)||customElements.define(e,m);break;case"calcite-icon":customElements.get(e)||R();break}})}u();const O=m,P=u;export{O as CalciteDropdownItem,P as defineCustomElement}; diff --git a/main/assets/calcite-dropdown-item-DpLfv4A0-BVjBECLP.js b/main/assets/calcite-dropdown-item-DpLfv4A0-BVjBECLP.js deleted file mode 100644 index bf316bc5b..000000000 --- a/main/assets/calcite-dropdown-item-DpLfv4A0-BVjBECLP.js +++ /dev/null @@ -1,11 +0,0 @@ -import{p as g,b as k,W as a,a as t,D}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{A as I}from"./dom-N58V0tYi-DBU3jlah.js";import{f as y,o as x,r as E}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{e as s}from"./component-CWGf1hug-BASJpoEG.js";import{l as q,p as z}from"./interactive-DqhNilgd-DrUFww1w.js";import{n as i}from"./resources3-Duvedxls-DbbvfBW6.js";import{m as R}from"./icon-BXFbBbop-O5hL8B42.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-DJJPVpPW.js";const S=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;flex-grow:1;align-items:center;outline-color:transparent}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.container a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem}.dropdown-item-icon{position:relative;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}:host([scale=s]) .container{padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-item-icon,:host([scale=s]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .container{padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-item-icon,:host([scale=m]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-md)}:host([scale=m]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .container{padding-block:0.625rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-item-icon,:host([scale=l]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-xl)}:host([scale=l]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-xl)}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host(:focus) .container{color:var(--calcite-color-text-1);text-decoration-line:none}:host(:hover:not([disabled])) .container,:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);text-decoration-line:none}:host(:hover:not([disabled])) .dropdown-link,:host(:active:not([disabled])) .dropdown-link{color:var(--calcite-color-text-1)}:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-3)}:host([selected]) .container:not(.container--none-selection),:host([selected]) .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .dropdown-link calcite-icon{color:var(--calcite-color-brand)}:host(:hover:not([disabled])) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,C=S,m=g(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownItemSelect=a(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=a(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=a(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=a(this,"calciteInternalDropdownCloseRequest",6),this.disabled=!1,this.href=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.label=void 0,this.rel=void 0,this.selected=!1,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){await y(this),this.el?.focus()}componentWillLoad(){x(this),this.initialize()}componentDidLoad(){E(this)}connectedCallback(){this.initialize()}componentDidRender(){q(this)}render(){const{href:e,selectionMode:o,label:l,iconFlipRtl:n}=this,r=t("calcite-icon",{key:"1ec1c941651dda8f39fa15427592141f04180f3e",class:i.iconStart,flipRtl:n==="start"||n==="both",icon:this.iconStart,scale:s(this.scale)}),c=t("span",{key:"3ab167ed4054ca34b4e13e72b752af6cf25522ae",class:i.itemContent},t("slot",{key:"88cf44809fb48450c66cc8f105bbda008a78157d"})),d=t("calcite-icon",{key:"32fb27182943a032c0037f1f878a95c194d2dff1",class:i.iconEnd,flipRtl:n==="end"||n==="both",icon:this.iconEnd,scale:s(this.scale)}),p=this.iconStart&&this.iconEnd?[r,c,d]:this.iconStart?[r,c]:this.iconEnd?[c,d]:c,b=e?t("a",{"aria-label":l,class:i.link,href:e,ref:v=>this.childLink=v,rel:this.rel,tabIndex:-1,target:this.target},p):p,f=e?null:o==="single"?"menuitemradio":o==="multiple"?"menuitemcheckbox":"menuitem",w=o!=="none"?I(this.selected):null,{disabled:h}=this;return t(D,{key:"beec8e51bf18bdcab1928181828b372cc70bb7ee","aria-checked":w,"aria-label":e?"":l,role:f,tabIndex:h?-1:0},t(z,{key:"5cbbd1074d6c571f4cac3a99e4a2c09bf113db55",disabled:h},t("div",{key:"bff025aeb280c9d0d829e5cf4d94e9392604e607",class:{[i.container]:!0,[i.containerNone]:o==="none"}},o!=="none"?t("calcite-icon",{class:i.icon,icon:o==="multiple"?"check":"bullet-point",scale:s(this.scale)}):null,b)))}onClick(){this.emitRequestedItem()}keyDownHandler(e){switch(e.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),e.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),e.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":e.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break}}updateActiveItemOnChange(e){e.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.determineActiveItem()),e.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),this.selectionMode==="none"&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1;break}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return this}static get style(){return C}},[1,"calcite-dropdown-item",{disabled:[516],href:[513],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],iconEnd:[513,"icon-end"],label:[1],rel:[513],selected:[1540],target:[513],selectionMode:[1,"selection-mode"],scale:[513],setFocus:[64]},[[0,"click","onClick"],[0,"keydown","keyDownHandler"],[16,"calciteInternalDropdownItemChange","updateActiveItemOnChange"]]]);function u(){typeof customElements>"u"||["calcite-dropdown-item","calcite-icon"].forEach(e=>{switch(e){case"calcite-dropdown-item":customElements.get(e)||customElements.define(e,m);break;case"calcite-icon":customElements.get(e)||R();break}})}u();const O=m,P=u;export{O as CalciteDropdownItem,P as defineCustomElement}; diff --git a/main/assets/calcite-flow-CAdorlph-BXJ9a_4b.js b/main/assets/calcite-flow-CAdorlph-BXJ9a_4b.js new file mode 100644 index 000000000..78e537c9b --- /dev/null +++ b/main/assets/calcite-flow-CAdorlph-BXJ9a_4b.js @@ -0,0 +1 @@ +import{p as h,b as u,a as m}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{c as g}from"./observers-BigwqTsw-Du14S4xc.js";import{f as p,o as b,r as w}from"./loadable-DbNDKH4r-YgUDHAtn.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const c={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},v=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",y=v,f=h(class extends u{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=g("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const o=t>1;return!(t&&e>1)&&!o?null:e{const{customItemSelectors:t,el:e,items:o}=this,s=Array.from(e.querySelectorAll(`calcite-flow-item${t?`,${t}`:""}`)).filter(i=>i.closest("calcite-flow")===e),n=o.length,a=s.length,r=s[a-1],l=s[a-2];if(a&&r&&s.forEach(i=>{i.showBackButton=i===r&&a>1,i.hidden=i!==r}),l&&(l.menuOpen=!1),this.items=s,n!==a){const i=this.getFlowDirection(n,a);this.itemCount=a,this.flowDirection=i}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];if(!e)return;const o=e.beforeBack?e.beforeBack:()=>Promise.resolve();try{await o.call(e)}catch{return}return e.remove(),e}async setFocus(){await p(this);const{items:t}=this;return t[t.length-1]?.setFocus()}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){b(this)}componentDidLoad(){w(this)}disconnectedCallback(){this.itemMutationObserver?.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this,e={[c.frame]:!0,[c.frameAdvancing]:t==="advancing",[c.frameRetreating]:t==="retreating"};return m("div",{key:"01fbee965d48cb54fa5bd1b53a3435538df84332",class:e},m("slot",{key:"495880eceeb04387dd1352aa00337f037ab0636c"}))}get el(){return this}static get style(){return y}},[1,"calcite-flow",{customItemSelectors:[1,"custom-item-selectors"],flowDirection:[32],itemCount:[32],items:[32],back:[64],setFocus:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function d(){typeof customElements>"u"||["calcite-flow"].forEach(t=>{switch(t){case"calcite-flow":customElements.get(t)||customElements.define(t,f);break}})}d();const B=f,D=d;export{B as CalciteFlow,D as defineCustomElement}; diff --git a/main/assets/calcite-flow-CAdorlph-Cs9fueJs.js b/main/assets/calcite-flow-CAdorlph-Cs9fueJs.js deleted file mode 100644 index 7bc51f311..000000000 --- a/main/assets/calcite-flow-CAdorlph-Cs9fueJs.js +++ /dev/null @@ -1 +0,0 @@ -import{p as h,b as u,a as m}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{c as g}from"./observers-BigwqTsw-DJJPVpPW.js";import{f as p,o as b,r as w}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const c={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},v=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",y=v,f=h(class extends u{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=g("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const o=t>1;return!(t&&e>1)&&!o?null:e{const{customItemSelectors:t,el:e,items:o}=this,s=Array.from(e.querySelectorAll(`calcite-flow-item${t?`,${t}`:""}`)).filter(i=>i.closest("calcite-flow")===e),n=o.length,a=s.length,r=s[a-1],l=s[a-2];if(a&&r&&s.forEach(i=>{i.showBackButton=i===r&&a>1,i.hidden=i!==r}),l&&(l.menuOpen=!1),this.items=s,n!==a){const i=this.getFlowDirection(n,a);this.itemCount=a,this.flowDirection=i}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];if(!e)return;const o=e.beforeBack?e.beforeBack:()=>Promise.resolve();try{await o.call(e)}catch{return}return e.remove(),e}async setFocus(){await p(this);const{items:t}=this;return t[t.length-1]?.setFocus()}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){b(this)}componentDidLoad(){w(this)}disconnectedCallback(){this.itemMutationObserver?.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this,e={[c.frame]:!0,[c.frameAdvancing]:t==="advancing",[c.frameRetreating]:t==="retreating"};return m("div",{key:"01fbee965d48cb54fa5bd1b53a3435538df84332",class:e},m("slot",{key:"495880eceeb04387dd1352aa00337f037ab0636c"}))}get el(){return this}static get style(){return y}},[1,"calcite-flow",{customItemSelectors:[1,"custom-item-selectors"],flowDirection:[32],itemCount:[32],items:[32],back:[64],setFocus:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function d(){typeof customElements>"u"||["calcite-flow"].forEach(t=>{switch(t){case"calcite-flow":customElements.get(t)||customElements.define(t,f);break}})}d();const B=f,D=d;export{B as CalciteFlow,D as defineCustomElement}; diff --git a/main/assets/calcite-flow-item-uRuGc3ks-CdaGasS2.js b/main/assets/calcite-flow-item-uRuGc3ks-CdaGasS2.js new file mode 100644 index 000000000..3f25f0094 --- /dev/null +++ b/main/assets/calcite-flow-item-uRuGc3ks-CdaGasS2.js @@ -0,0 +1 @@ +import{p as w,b as C,W as l,a as t,D as B}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{p as E}from"./dom-N58V0tYi-DBU3jlah.js";import{l as I,p as F}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{o as L,r as P,f as S}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{K as x,q as A}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{d as T,h as O,M as D,l as M}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{s as o,y as $}from"./panel-DRUEhsxp-DDDczPW_.js";import{m as R}from"./action-GCQoufcz-D2daq3Sk.js";import{K as z,O as K}from"./action-menu-DTIJuZNc-BWLxzbAy.js";import{m as _}from"./icon-BXFbBbop-Du8Zws1L.js";import{v as W}from"./loader-Ch7Jr16w-BlGvYEIO.js";import{c as H}from"./scrim-BscQh4v9-DBRj_VaE.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-Du14S4xc.js";import"./floating-ui-DKFFlLv3-B6atYKJb.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";import"./openCloseComponent-BGQ6h7vg-DwGQl3jY.js";import"./FloatingArrow-BG9llDYg-AyYcVK-v.js";const q={backButton:"back-button"},h={backLeft:"chevron-left",backRight:"chevron-right"},a={actionBar:"action-bar",alerts:"alerts",contentTop:"content-top",contentBottom:"content-bottom",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions",footerEnd:"footer-end",footerStart:"footer-start"},G=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}",J=G,f=w(class extends C{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=l(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=l(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=l(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=l(this,"calciteFlowItemToggle",6),this.handleInternalPanelScroll=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.calciteFlowItemScroll.emit())},this.handleInternalPanelClose=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())},this.handleInternalPanelToggle=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.collapsed=e.target.collapsed,this.calciteFlowItemToggle.emit())},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=e=>{this.backButtonEl=e},this.setContainerRef=e=>{this.containerEl=e},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.beforeClose=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){x(this),T(this)}async componentWillLoad(){await O(this),L(this)}componentDidRender(){I(this)}disconnectedCallback(){A(this),D(this)}componentDidLoad(){P(this)}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await S(this);const{backButtonEl:e,containerEl:s}=this;if(e)return e.setFocus();if(s)return s.setFocus()}async scrollContentTo(e){await this.containerEl?.scrollContentTo(e)}renderBackButton(){const{el:e}=this,s=E(e)==="rtl",{showBackButton:n,backButtonClick:r,messages:d}=this,c=d.back,i=s?h.backRight:h.backLeft;return n?t("calcite-action",{"aria-label":c,class:q.backButton,icon:i,key:"flow-back-button",onClick:r,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:c,title:c}):null}render(){const{collapsed:e,collapseDirection:s,collapsible:n,closable:r,closed:d,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messages:k,overlayPositioning:v,beforeClose:y}=this;return t(B,{key:"2e7872bb2687db0b67ddbf375f8ec0beaabbda36"},t(F,{key:"a9418954405a2cec2092bae3be5d77f02306e3c9",disabled:i},t("calcite-panel",{key:"d563c751421bf2d66c03286deaa613e09f585546",beforeClose:y,closable:r,closed:d,collapseDirection:s,collapsed:e,collapsible:n,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messageOverrides:k,onCalcitePanelClose:this.handleInternalPanelClose,onCalcitePanelScroll:this.handleInternalPanelScroll,onCalcitePanelToggle:this.handleInternalPanelToggle,overlayPositioning:v,ref:this.setContainerRef,scale:this.scale},this.renderBackButton(),t("slot",{key:"c506ec8bb4debbd6a9da6c7941878de49776f614",name:a.actionBar,slot:o.actionBar}),t("slot",{key:"e76e55e654ff878acff734bdf387402a9e262159",name:a.alerts,slot:o.alerts}),t("slot",{key:"f7ab8839d7b101e31087130ebf3e36af1ec7da24",name:a.headerActionsStart,slot:o.headerActionsStart}),t("slot",{key:"2932c4c15b168732356b8e55fcc3064f5b3f4cf5",name:a.headerActionsEnd,slot:o.headerActionsEnd}),t("slot",{key:"1ef8a9050683022733695445092f8c626487d87b",name:a.headerContent,slot:o.headerContent}),t("slot",{key:"24c0ab570a601a6c0edfb0c820e580fd24b158ce",name:a.headerMenuActions,slot:o.headerMenuActions}),t("slot",{key:"ec55bbe7ba939a6efb35225850c37a1aadb97275",name:a.fab,slot:o.fab}),t("slot",{key:"aa0bfec47656ef9f7f575cd933897a7909e5badc",name:a.contentTop,slot:o.contentTop}),t("slot",{key:"e23532d080e2df529c2aeb6af043c6efe7a0ab6d",name:a.contentBottom,slot:o.contentBottom}),t("slot",{key:"db6ffc0d9300c77067a4c88ab277de685c7713af",name:a.footerStart,slot:o.footerStart}),t("slot",{key:"5f249356da9292f34c4036d0d0741f048fe999e9",name:a.footer,slot:o.footer}),t("slot",{key:"7476137bacc0f3be5c97682c5027f74d73254765",name:a.footerEnd,slot:o.footerEnd}),t("slot",{key:"58f60a46c42a05abe9b100a57d478d991e4f25bc",name:a.footerActions,slot:o.footerActions}),t("slot",{key:"926a8d94b76b6fcdef6dfd219ba8180c44f81c35"}))))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return J}},[1,"calcite-flow-item",{closable:[516],closed:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],beforeBack:[16],beforeClose:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],overlayPositioning:[513,"overlay-positioning"],scale:[513],showBackButton:[4,"show-back-button"],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function b(){typeof customElements>"u"||["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,f);break;case"calcite-action":customElements.get(e)||R();break;case"calcite-action-menu":customElements.get(e)||K();break;case"calcite-icon":customElements.get(e)||_();break;case"calcite-loader":customElements.get(e)||W();break;case"calcite-panel":customElements.get(e)||$();break;case"calcite-popover":customElements.get(e)||z();break;case"calcite-scrim":customElements.get(e)||H();break}})}b();const me=f,pe=b;export{me as CalciteFlowItem,pe as defineCustomElement}; diff --git a/main/assets/calcite-flow-item-uRuGc3ks-LY9sq3aM.js b/main/assets/calcite-flow-item-uRuGc3ks-LY9sq3aM.js deleted file mode 100644 index e9a8e4f40..000000000 --- a/main/assets/calcite-flow-item-uRuGc3ks-LY9sq3aM.js +++ /dev/null @@ -1 +0,0 @@ -import{p as w,b as C,W as l,a as t,D as B}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{p as E}from"./dom-N58V0tYi-DBU3jlah.js";import{l as I,p as F}from"./interactive-DqhNilgd-DrUFww1w.js";import{o as L,r as P,f as S}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{K as x,q as A}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{d as T,h as O,M as D,l as M}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{s as o,y as $}from"./panel-DRUEhsxp-DdHxn7R2.js";import{m as R}from"./action-GCQoufcz-Cwgl1KRC.js";import{K as z,O as K}from"./action-menu-DTIJuZNc-DM_2ZtiL.js";import{m as _}from"./icon-BXFbBbop-O5hL8B42.js";import{v as W}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";import{c as H}from"./scrim-BscQh4v9-uedhhKYH.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-DJJPVpPW.js";import"./floating-ui-DKFFlLv3-DZ3_fUHw.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";import"./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js";import"./FloatingArrow-BG9llDYg-B1DQ6cRb.js";const q={backButton:"back-button"},h={backLeft:"chevron-left",backRight:"chevron-right"},a={actionBar:"action-bar",alerts:"alerts",contentTop:"content-top",contentBottom:"content-bottom",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions",footerEnd:"footer-end",footerStart:"footer-start"},G=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}",J=G,f=w(class extends C{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=l(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=l(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=l(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=l(this,"calciteFlowItemToggle",6),this.handleInternalPanelScroll=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.calciteFlowItemScroll.emit())},this.handleInternalPanelClose=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())},this.handleInternalPanelToggle=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.collapsed=e.target.collapsed,this.calciteFlowItemToggle.emit())},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=e=>{this.backButtonEl=e},this.setContainerRef=e=>{this.containerEl=e},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.beforeClose=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){x(this),T(this)}async componentWillLoad(){await O(this),L(this)}componentDidRender(){I(this)}disconnectedCallback(){A(this),D(this)}componentDidLoad(){P(this)}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await S(this);const{backButtonEl:e,containerEl:s}=this;if(e)return e.setFocus();if(s)return s.setFocus()}async scrollContentTo(e){await this.containerEl?.scrollContentTo(e)}renderBackButton(){const{el:e}=this,s=E(e)==="rtl",{showBackButton:n,backButtonClick:r,messages:d}=this,c=d.back,i=s?h.backRight:h.backLeft;return n?t("calcite-action",{"aria-label":c,class:q.backButton,icon:i,key:"flow-back-button",onClick:r,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:c,title:c}):null}render(){const{collapsed:e,collapseDirection:s,collapsible:n,closable:r,closed:d,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messages:k,overlayPositioning:v,beforeClose:y}=this;return t(B,{key:"2e7872bb2687db0b67ddbf375f8ec0beaabbda36"},t(F,{key:"a9418954405a2cec2092bae3be5d77f02306e3c9",disabled:i},t("calcite-panel",{key:"d563c751421bf2d66c03286deaa613e09f585546",beforeClose:y,closable:r,closed:d,collapseDirection:s,collapsed:e,collapsible:n,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messageOverrides:k,onCalcitePanelClose:this.handleInternalPanelClose,onCalcitePanelScroll:this.handleInternalPanelScroll,onCalcitePanelToggle:this.handleInternalPanelToggle,overlayPositioning:v,ref:this.setContainerRef,scale:this.scale},this.renderBackButton(),t("slot",{key:"c506ec8bb4debbd6a9da6c7941878de49776f614",name:a.actionBar,slot:o.actionBar}),t("slot",{key:"e76e55e654ff878acff734bdf387402a9e262159",name:a.alerts,slot:o.alerts}),t("slot",{key:"f7ab8839d7b101e31087130ebf3e36af1ec7da24",name:a.headerActionsStart,slot:o.headerActionsStart}),t("slot",{key:"2932c4c15b168732356b8e55fcc3064f5b3f4cf5",name:a.headerActionsEnd,slot:o.headerActionsEnd}),t("slot",{key:"1ef8a9050683022733695445092f8c626487d87b",name:a.headerContent,slot:o.headerContent}),t("slot",{key:"24c0ab570a601a6c0edfb0c820e580fd24b158ce",name:a.headerMenuActions,slot:o.headerMenuActions}),t("slot",{key:"ec55bbe7ba939a6efb35225850c37a1aadb97275",name:a.fab,slot:o.fab}),t("slot",{key:"aa0bfec47656ef9f7f575cd933897a7909e5badc",name:a.contentTop,slot:o.contentTop}),t("slot",{key:"e23532d080e2df529c2aeb6af043c6efe7a0ab6d",name:a.contentBottom,slot:o.contentBottom}),t("slot",{key:"db6ffc0d9300c77067a4c88ab277de685c7713af",name:a.footerStart,slot:o.footerStart}),t("slot",{key:"5f249356da9292f34c4036d0d0741f048fe999e9",name:a.footer,slot:o.footer}),t("slot",{key:"7476137bacc0f3be5c97682c5027f74d73254765",name:a.footerEnd,slot:o.footerEnd}),t("slot",{key:"58f60a46c42a05abe9b100a57d478d991e4f25bc",name:a.footerActions,slot:o.footerActions}),t("slot",{key:"926a8d94b76b6fcdef6dfd219ba8180c44f81c35"}))))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return J}},[1,"calcite-flow-item",{closable:[516],closed:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],beforeBack:[16],beforeClose:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],overlayPositioning:[513,"overlay-positioning"],scale:[513],showBackButton:[4,"show-back-button"],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function b(){typeof customElements>"u"||["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,f);break;case"calcite-action":customElements.get(e)||R();break;case"calcite-action-menu":customElements.get(e)||K();break;case"calcite-icon":customElements.get(e)||_();break;case"calcite-loader":customElements.get(e)||W();break;case"calcite-panel":customElements.get(e)||$();break;case"calcite-popover":customElements.get(e)||z();break;case"calcite-scrim":customElements.get(e)||H();break}})}b();const me=f,pe=b;export{me as CalciteFlowItem,pe as defineCustomElement}; diff --git a/main/assets/calcite-icon-laqhdRBY-Bm5S9Lju.js b/main/assets/calcite-icon-laqhdRBY-Bm5S9Lju.js deleted file mode 100644 index e5a5fe02c..000000000 --- a/main/assets/calcite-icon-laqhdRBY-Bm5S9Lju.js +++ /dev/null @@ -1 +0,0 @@ -import{f as t,m as o}from"./icon-BXFbBbop-O5hL8B42.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./observers-BigwqTsw-DJJPVpPW.js";const n=t,a=o;export{n as CalciteIcon,a as defineCustomElement}; diff --git a/main/assets/calcite-icon-laqhdRBY-CcSx2g4c.js b/main/assets/calcite-icon-laqhdRBY-CcSx2g4c.js new file mode 100644 index 000000000..0a89a4d21 --- /dev/null +++ b/main/assets/calcite-icon-laqhdRBY-CcSx2g4c.js @@ -0,0 +1 @@ +import{f as t,m as o}from"./icon-BXFbBbop-Du8Zws1L.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./observers-BigwqTsw-Du14S4xc.js";const n=t,a=o;export{n as CalciteIcon,a as defineCustomElement}; diff --git a/main/assets/calcite-input-BKRd7MCS-BjdnYfeD.js b/main/assets/calcite-input-BKRd7MCS-BjdnYfeD.js deleted file mode 100644 index a7d0e969d..000000000 --- a/main/assets/calcite-input-BKRd7MCS-BjdnYfeD.js +++ /dev/null @@ -1 +0,0 @@ -import{F as t,M as o}from"./input2-eOtqu-iO-CInnv9HE.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./form-CRSw616T-Cd5gFTXp.js";import"./interactive-DqhNilgd-DrUFww1w.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./loadable-DbNDKH4r-Cc9Ee-I5.js";import"./locale-Cn_GDVD_-CiwD7jxT.js";import"./observers-BigwqTsw-DJJPVpPW.js";import"./t9n-C_hcZMZJ-BmtPt6-4.js";import"./icon-BXFbBbop-O5hL8B42.js";const E=t,F=o;export{E as CalciteInput,F as defineCustomElement}; diff --git a/main/assets/calcite-input-BKRd7MCS-DmQD4QYo.js b/main/assets/calcite-input-BKRd7MCS-DmQD4QYo.js new file mode 100644 index 000000000..156374ad3 --- /dev/null +++ b/main/assets/calcite-input-BKRd7MCS-DmQD4QYo.js @@ -0,0 +1 @@ +import{F as t,M as o}from"./input2-eOtqu-iO-CM6Z_r7O.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./form-CRSw616T-2CDQhr1H.js";import"./interactive-DqhNilgd-D_Gwwuwg.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./loadable-DbNDKH4r-YgUDHAtn.js";import"./locale-Cn_GDVD_-DrOI-_a9.js";import"./observers-BigwqTsw-Du14S4xc.js";import"./t9n-C_hcZMZJ-CZmw6XOE.js";import"./icon-BXFbBbop-Du8Zws1L.js";const E=t,F=o;export{E as CalciteInput,F as defineCustomElement}; diff --git a/main/assets/calcite-label-DMj3M4QR-C9p7ZdtQ.js b/main/assets/calcite-label-DMj3M4QR-C9p7ZdtQ.js new file mode 100644 index 000000000..03f6f139a --- /dev/null +++ b/main/assets/calcite-label-DMj3M4QR-C9p7ZdtQ.js @@ -0,0 +1 @@ +import{p as n,b as l,W as o,a as t,D as s}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{y as c,d as r,u as d}from"./label-Dys24PJn-BCewo2Re.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./component-CWGf1hug-BASJpoEG.js";const h={container:"container"},m=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.5rem)}:host([scale=m]) .container{gap:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.75rem)}:host([scale=l]) .container{gap:0.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-color-text-1)}:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}:host([layout=inline][scale=l]) .container{gap:0.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity:1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity:0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}",b=m,a=n(class extends l{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalLabelClick=o(this,"calciteInternalLabelClick",2),this.labelClickHandler=e=>{window.getSelection()?.type!=="Range"&&this.calciteInternalLabelClick.emit({sourceEvent:e})},this.alignment="start",this.for=void 0,this.scale="m",this.layout="default"}handleForChange(){c(this.el)}connectedCallback(){document.dispatchEvent(new CustomEvent(r))}disconnectedCallback(){document.dispatchEvent(new CustomEvent(d))}render(){return t(s,{key:"c3eff09792519c9e5a76ee28e3754db83b536f99",onClick:this.labelClickHandler},t("div",{key:"387902edd9b59be290f95ad6c2721584037d7256",class:h.container},t("slot",{key:"b54d782522e95323333040e40e1a6dd06b52a575"})))}get el(){return this}static get watchers(){return{for:["handleForChange"]}}static get style(){return b}},[1,"calcite-label",{alignment:[513],for:[513],scale:[513],layout:[513]},void 0,{for:["handleForChange"]}]);function i(){typeof customElements>"u"||["calcite-label"].forEach(e=>{switch(e){case"calcite-label":customElements.get(e)||customElements.define(e,a);break}})}i();const k=a,C=i;export{k as CalciteLabel,C as defineCustomElement}; diff --git a/main/assets/calcite-label-DMj3M4QR-DVsijlea.js b/main/assets/calcite-label-DMj3M4QR-DVsijlea.js deleted file mode 100644 index 142427e84..000000000 --- a/main/assets/calcite-label-DMj3M4QR-DVsijlea.js +++ /dev/null @@ -1 +0,0 @@ -import{p as n,b as l,W as o,a as t,D as s}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{y as c,d as r,u as d}from"./label-Dys24PJn-BCewo2Re.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./component-CWGf1hug-BASJpoEG.js";const h={container:"container"},m=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.5rem)}:host([scale=m]) .container{gap:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.75rem)}:host([scale=l]) .container{gap:0.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-color-text-1)}:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}:host([layout=inline][scale=l]) .container{gap:0.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity:1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity:0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}",b=m,a=n(class extends l{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalLabelClick=o(this,"calciteInternalLabelClick",2),this.labelClickHandler=e=>{window.getSelection()?.type!=="Range"&&this.calciteInternalLabelClick.emit({sourceEvent:e})},this.alignment="start",this.for=void 0,this.scale="m",this.layout="default"}handleForChange(){c(this.el)}connectedCallback(){document.dispatchEvent(new CustomEvent(r))}disconnectedCallback(){document.dispatchEvent(new CustomEvent(d))}render(){return t(s,{key:"c3eff09792519c9e5a76ee28e3754db83b536f99",onClick:this.labelClickHandler},t("div",{key:"387902edd9b59be290f95ad6c2721584037d7256",class:h.container},t("slot",{key:"b54d782522e95323333040e40e1a6dd06b52a575"})))}get el(){return this}static get watchers(){return{for:["handleForChange"]}}static get style(){return b}},[1,"calcite-label",{alignment:[513],for:[513],scale:[513],layout:[513]},void 0,{for:["handleForChange"]}]);function i(){typeof customElements>"u"||["calcite-label"].forEach(e=>{switch(e){case"calcite-label":customElements.get(e)||customElements.define(e,a);break}})}i();const k=a,C=i;export{k as CalciteLabel,C as defineCustomElement}; diff --git a/main/assets/calcite-list-item-VYBhSMxV-CL6sUu6o.js b/main/assets/calcite-list-item-VYBhSMxV-CL6sUu6o.js new file mode 100644 index 000000000..0b592b8a8 --- /dev/null +++ b/main/assets/calcite-list-item-VYBhSMxV-CL6sUu6o.js @@ -0,0 +1,21 @@ +import{p as k,b as L,W as c,a as i,D as q}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{A as C,G as m,X as I,p as X}from"./dom-N58V0tYi-DBU3jlah.js";import{l as E,p as A}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{K as w,q as D}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{d as H,h as T,M,l as z}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{o as F,r as $,f as P}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{h as J,m as Q,u as V,f as Y}from"./utils3-BSH0zqNl-OPNf8-Bp.js";import{c as y,o as f,n as a,e as p}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{m as Z}from"./action-GCQoufcz-D2daq3Sk.js";import{m as B}from"./icon-BXFbBbop-Du8Zws1L.js";import{v as ee}from"./loader-Ch7Jr16w-BlGvYEIO.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-Du14S4xc.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";const x={handle:"handle",handleSelected:"handle--selected"},te={drag:"drag"},b={itemLabel:"{itemLabel}",position:"{position}",total:"{total}"},ne=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.handle{display:flex;align-items:center;justify-content:center;align-self:stretch;border-style:none;outline-color:transparent;color:var(--calcite-handle-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-handle-background-color, transparent);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle calcite-icon{color:inherit}:host(:not([disabled])) .handle{cursor:move}:host(:not([disabled])) .handle:hover{color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2))}:host(:not([disabled])) .handle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + );color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1))}:host(:not([disabled])) .handle--selected{color:var(--calcite-handle-icon-color-selected, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-selected, var(--calcite-color-foreground-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,ie=ne,ae=k(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteHandleChange=c(this,"calciteHandleChange",6),this.calciteHandleNudge=c(this,"calciteHandleNudge",6),this.calciteInternalAssistiveTextChange=c(this,"calciteInternalAssistiveTextChange",6),this.handleKeyDown=e=>{if(!this.disabled)switch(e.key){case" ":this.selected=!this.selected,this.calciteHandleChange.emit(),e.preventDefault();break;case"ArrowUp":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"up"});break;case"ArrowDown":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"down"});break}},this.handleBlur=()=>{this.blurUnselectDisabled||this.disabled||this.selected&&(this.selected=!1,this.calciteHandleChange.emit())},this.selected=!1,this.disabled=!1,this.dragHandle=void 0,this.messages=void 0,this.setPosition=void 0,this.setSize=void 0,this.label=void 0,this.blurUnselectDisabled=!1,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}handleAriaTextChange(){const e=this.getAriaText("live");e&&this.calciteInternalAssistiveTextChange.emit({message:e})}onMessagesChange(){}connectedCallback(){H(this),w(this)}async componentWillLoad(){F(this),await T(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}disconnectedCallback(){M(this),D(this)}effectiveLocaleChange(){z(this,this.effectiveLocale)}async setFocus(){await P(this),this.handleButton?.focus()}getTooltip(){const{label:e,messages:t}=this;return t?e?t.dragHandle.replace(b.itemLabel,e):t.dragHandleUntitled:""}getAriaText(e){const{setPosition:t,setSize:n,label:l,messages:s,selected:o}=this;return!s||!l||typeof n!="number"||typeof t!="number"?null:(e==="label"?o?s.dragHandleChange:s.dragHandleIdle:o?s.dragHandleActive:s.dragHandleCommit).replace(b.position,t.toString()).replace(b.itemLabel,l).replace(b.total,n.toString())}render(){return i(A,{key:"1a694de393421691c83e7265850275c217ef7ffe",disabled:this.disabled},i("span",{key:"82ff692c15c2d9294ceb814b3f7f06bb4d8ff0e0","aria-checked":this.disabled?null:C(this.selected),"aria-disabled":this.disabled?C(this.disabled):null,"aria-label":this.disabled?null:this.getAriaText("label"),class:{[x.handle]:!0,[x.handleSelected]:!this.disabled&&this.selected},onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,ref:e=>{this.handleButton=e},role:"radio",tabIndex:this.disabled?null:0,title:this.getTooltip()},i("calcite-icon",{key:"25862a953826aea2d594507157aaffc21d07001c",icon:te.drag,scale:"s"})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],selected:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ie}},[1,"calcite-handle",{selected:[1540],disabled:[516],dragHandle:[513,"drag-handle"],messages:[1040],setPosition:[2,"set-position"],setSize:[2,"set-size"],label:[1],blurUnselectDisabled:[4,"blur-unselect-disabled"],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],selected:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function O(){typeof customElements>"u"||["calcite-handle","calcite-icon"].forEach(e=>{switch(e){case"calcite-handle":customElements.get(e)||customElements.define(e,ae);break;case"calcite-icon":customElements.get(e)||B();break}})}O();const le=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1);--calcite-list-item-icon-color:var(--calcite-color-brand)}:host([filter-hidden]),:host([closed]){display:none}.wrapper--bordered{border-block-end:1px solid var(--calcite-color-border-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{box-sizing:border-box;display:flex;flex:1 1 0%;overflow:hidden;background-color:var(--calcite-color-foreground-1)}.container *{box-sizing:border-box}.container--hover:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}.container:active{background-color:var(--calcite-color-foreground-1)}.container--border{border-inline-start-width:4px;border-inline-start-style:solid}.container--border-selected{border-inline-start-color:var(--calcite-color-brand)}.container--border-unselected{border-inline-start-color:transparent}.container:hover.container--border-unselected{border-color:var(--calcite-color-border-1)}.nested-container{display:none;flex-direction:column;border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);margin-inline-start:var(--calcite-list-item-spacing-indent, 1.5rem)}.nested-container--open{display:flex}.content-container{display:flex;flex:1 1 auto;-webkit-user-select:none;user-select:none;align-items:stretch;padding:0px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content-container--unavailable{opacity:var(--calcite-opacity-disabled)}tr,td{outline-color:transparent}tr{position:relative}tr:focus,td:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description,.content-bottom{font-family:var(--calcite-font-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child,.content-bottom:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-color-text-1)}:host([selected]) .label{font-weight:var(--calcite-font-weight-medium)}.description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}:host([selected]) .description{color:var(--calcite-color-text-2)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.content-bottom{display:flex;flex-direction:column}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-block:0px;color:var(--calcite-color-border-input);padding-inline:var(--calcite-spacing-md) var(--calcite-spacing-xxs)}.selection-container--single{color:transparent}:host(:not([disabled]):not([selected])) .container:hover .selection-container--single{color:var(--calcite-color-border-1)}:host([selected]:hover) .selection-container,:host([selected]:hover) .selection-container--single,:host([selected]) .selection-container{color:var(--calcite-list-item-icon-color)}.open-container{color:var(--calcite-color-text-3)}:host(:not([disabled])) .container:hover .open-container{color:var(--calcite-color-text-1)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.drag-container,.open-container{display:flex;align-items:center}.actions-start calcite-action,.actions-start calcite-handle,.actions-end calcite-action,.actions-end calcite-handle,.content-start calcite-action,.content-start calcite-handle,.content-end calcite-action,.content-end calcite-handle,.selection-container calcite-action,.selection-container calcite-handle,.drag-container calcite-action,.drag-container calcite-handle,.open-container calcite-action,.open-container calcite-handle{align-self:stretch}.open-container,.selection-container{cursor:pointer}.actions-start,.actions-end{position:relative;padding:0px}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}tr:focus .actions-start,tr:focus .actions-end{inset-block:0.125rem}tr:focus .actions-start .close,tr:focus .actions-start ::slotted(calcite-action),tr:focus .actions-start ::slotted(calcite-action-menu),tr:focus .actions-start ::slotted(calcite-handle),tr:focus .actions-start ::slotted(calcite-dropdown),tr:focus .actions-end .close,tr:focus .actions-end ::slotted(calcite-action),tr:focus .actions-end ::slotted(calcite-action-menu),tr:focus .actions-end ::slotted(calcite-handle),tr:focus .actions-end ::slotted(calcite-dropdown){block-size:calc(100% - 0.25rem)}tr:focus::after,tr:focus::before{position:absolute;content:"";inline-size:0.125rem;z-index:var(--calcite-z-index-header);background-color:var(--calcite-color-brand);inset-block:0}tr:focus::before{inset-inline-start:0}tr:focus::after{inset-inline-end:0}.container--border:focus::before{display:none}::slotted(calcite-list:empty){border-block-start-width:0px}:host([hidden]){display:none}[hidden]{display:none}`,se=le,S=new Map,oe="calcite-list",G=k(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListItemSelect=c(this,"calciteListItemSelect",6),this.calciteListItemClose=c(this,"calciteListItemClose",6),this.calciteListItemDragHandleChange=c(this,"calciteListItemDragHandleChange",6),this.calciteListItemToggle=c(this,"calciteListItemToggle",6),this.calciteInternalListItemSelect=c(this,"calciteInternalListItemSelect",6),this.calciteInternalListItemSelectMultiple=c(this,"calciteInternalListItemSelectMultiple",6),this.calciteInternalListItemActive=c(this,"calciteInternalListItemActive",6),this.calciteInternalFocusPreviousItem=c(this,"calciteInternalFocusPreviousItem",6),this.calciteInternalListItemChange=c(this,"calciteInternalListItemChange",6),this.calciteInternalListItemToggle=c(this,"calciteInternalListItemToggle",6),this.dragHandleSelectedChangeHandler=e=>{this.dragSelected=e.target.selected,this.calciteListItemDragHandleChange.emit(),e.stopPropagation()},this.emitInternalListItemActive=()=>{this.calciteInternalListItemActive.emit()},this.focusCellHandle=()=>{this.handleCellFocusIn(this.handleGridEl)},this.focusCellActionsStart=()=>{this.handleCellFocusIn(this.actionsStartEl)},this.focusCellContent=()=>{this.handleCellFocusIn(this.contentEl)},this.focusCellActionsEnd=()=>{this.handleCellFocusIn(this.actionsEndEl)},this.handleCloseClick=()=>{this.closed=!0,this.calciteListItemClose.emit()},this.handleContentSlotChange=e=>{this.hasCustomContent=m(e)},this.handleActionsStartSlotChange=e=>{this.hasActionsStart=m(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=m(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=m(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=m(e)},this.handleContentBottomSlotChange=e=>{this.hasContentBottom=m(e)},this.handleDefaultSlotChange=e=>{this.handleOpenableChange(e.target)},this.handleToggleClick=()=>{this.toggle()},this.toggle=(e=!this.open)=>{this.open=e,this.calciteListItemToggle.emit()},this.handleItemClick=e=>{e.defaultPrevented||this.toggleSelected(e.shiftKey)},this.toggleSelected=e=>{const{selectionMode:t,selected:n}=this;this.disabled||(t==="multiple"||t==="single"?this.selected=!n:t==="single-persist"&&(this.selected=!0),this.calciteInternalListItemSelectMultiple.emit({selectMultiple:e&&t==="multiple"}),this.calciteListItemSelect.emit())},this.handleItemKeyDown=e=>{if(e.defaultPrevented)return;const{key:t}=e,n=e.composedPath(),{containerEl:l,actionsStartEl:s,actionsEndEl:o,open:d,openable:u}=this,r=this.getGridCells(),h=r.findIndex(g=>n.includes(g));if(t==="Enter"&&!n.includes(s)&&!n.includes(o))e.preventDefault(),this.toggleSelected(e.shiftKey);else if(t==="ArrowRight"){e.preventDefault();const g=h+1;h===-1?!d&&u?(this.toggle(!0),this.focusCell(null)):r[0]&&this.focusCell(r[0]):r[h]&&r[g]&&this.focusCell(r[g])}else if(t==="ArrowLeft"){e.preventDefault();const g=h-1;h===-1?(this.focusCell(null),d&&u?this.toggle(!1):this.calciteInternalFocusPreviousItem.emit()):h===0?(this.focusCell(null),l.focus()):r[h]&&r[g]&&this.focusCell(r[g])}},this.focusCellNull=()=>{this.focusCell(null)},this.handleCellFocusIn=e=>{this.setFocusCell(e,I(e),!0)},this.setFocusCell=(e,t,n)=>{const{parentListEl:l}=this;n&&S.set(l,null);const s=this.getGridCells();s.forEach(o=>{o.tabIndex=-1,o.removeAttribute(y)}),e&&(e.tabIndex=e===t?0:-1,e.setAttribute(y,""),n&&S.set(l,s.indexOf(e)))},this.focusCell=(e,t=!0)=>{const n=I(e);this.setFocusCell(e,n,t),n?.focus()},this.active=!1,this.bordered=!1,this.closable=!1,this.closed=!1,this.description=void 0,this.disabled=!1,this.dragDisabled=!1,this.dragHandle=!1,this.dragSelected=!1,this.filterHidden=!1,this.label=void 0,this.metadata=void 0,this.open=!1,this.setSize=null,this.setPosition=null,this.selected=!1,this.unavailable=!1,this.value=void 0,this.selectionMode=null,this.selectionAppearance=null,this.messageOverrides=void 0,this.messages=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.level=null,this.parentListEl=void 0,this.openable=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasCustomContent=!1,this.hasContentStart=!1,this.hasContentEnd=!1,this.hasContentBottom=!1}activeHandler(e){e||this.focusCell(null,!1)}handleClosedChange(){this.emitCalciteInternalListItemChange()}handleDisabledChange(){this.emitCalciteInternalListItemChange()}handleOpenChange(){this.emitCalciteInternalListItemToggle()}handleSelectedChange(){this.calciteInternalListItemSelect.emit()}onMessagesChange(){}handleCalciteInternalListDefaultSlotChanges(e){e.stopPropagation(),this.handleOpenableChange(this.defaultSlotEl)}effectiveLocaleChange(){z(this,this.effectiveLocale)}connectedCallback(){w(this),H(this);const{el:e}=this;this.parentListEl=e.closest(oe),this.level=J(e)+1,this.setSelectionDefaults()}async componentWillLoad(){F(this),await T(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}disconnectedCallback(){D(this),M(this)}async setFocus(){await P(this);const{containerEl:e,parentListEl:t}=this,n=S.get(t);if(typeof n=="number"){const l=this.getGridCells();l[n]?this.focusCell(l[n]):e?.focus();return}e?.focus()}renderSelected(){const{selected:e,selectionMode:t,selectionAppearance:n}=this;return t==="none"||n==="border"?null:i("td",{class:{[a.selectionContainer]:!0,[a.selectionContainerSingle]:t==="single"||t==="single-persist"},key:"selection-container",onClick:this.handleItemClick},i("calcite-icon",{icon:e?t==="multiple"?f.selectedMultiple:f.selectedSingle:t==="multiple"?f.unselectedMultiple:f.unselectedSingle,scale:"s"}))}renderDragHandle(){const{label:e,dragHandle:t,dragSelected:n,dragDisabled:l,setPosition:s,setSize:o}=this;return t?i("td",{"aria-label":e,class:a.dragContainer,key:"drag-handle-container",onFocusin:this.focusCellHandle,ref:d=>this.handleGridEl=d,role:"gridcell"},i("calcite-handle",{disabled:l,label:e,onCalciteHandleChange:this.dragHandleSelectedChangeHandler,selected:n,setPosition:s,setSize:o})):null}renderOpen(){const{el:e,open:t,openable:n,messages:l}=this,s=X(e),o=t?f.open:s==="rtl"?f.closedRTL:f.closedLTR,d=t?l.collapse:l.expand;return n?i("td",{class:a.openContainer,key:"open-container",onClick:this.handleToggleClick,title:d},i("calcite-icon",{icon:o,key:o,scale:"s"})):null}renderActionsStart(){const{label:e,hasActionsStart:t}=this;return i("td",{"aria-label":e,class:a.actionsStart,hidden:!t,key:"actions-start-container",onFocusin:this.focusCellActionsStart,ref:n=>this.actionsStartEl=n,role:"gridcell"},i("slot",{name:p.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{label:e,hasActionsEnd:t,closable:n,messages:l}=this;return i("td",{"aria-label":e,class:a.actionsEnd,hidden:!(t||n),key:"actions-end-container",onFocusin:this.focusCellActionsEnd,ref:s=>this.actionsEndEl=s,role:"gridcell"},i("slot",{name:p.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),n?i("calcite-action",{appearance:"transparent",class:a.close,icon:f.close,key:"close-action",label:l.close,onClick:this.handleCloseClick,text:l.close}):null)}renderContentStart(){const{hasContentStart:e}=this;return i("div",{class:a.contentStart,hidden:!e},i("slot",{name:p.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderCustomContent(){const{hasCustomContent:e}=this;return i("div",{class:a.customContent,hidden:!e},i("slot",{name:p.content,onSlotchange:this.handleContentSlotChange}))}renderContentEnd(){const{hasContentEnd:e}=this;return i("div",{class:a.contentEnd,hidden:!e},i("slot",{name:p.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}renderContentBottom(){const{hasContentBottom:e}=this;return i("div",{class:a.contentBottom,hidden:!e},i("slot",{name:p.contentBottom,onSlotchange:this.handleContentBottomSlotChange}))}renderDefaultContainer(){return i("div",{class:{[a.nestedContainer]:!0,[a.nestedContainerOpen]:this.openable&&this.open}},i("slot",{onSlotchange:this.handleDefaultSlotChange,ref:e=>this.defaultSlotEl=e}))}renderContentProperties(){const{label:e,description:t,hasCustomContent:n}=this;return!n&&(e||t)?i("div",{class:a.content,key:"content"},e?i("div",{class:a.label,key:"label"},e):null,t?i("div",{class:a.description,key:"description"},t):null):null}renderContentContainer(){const{description:e,label:t,selectionMode:n,hasCustomContent:l,unavailable:s}=this,o=l||!!t||!!e,d=[this.renderContentStart(),this.renderCustomContent(),this.renderContentProperties(),this.renderContentEnd()];return i("td",{"aria-label":t,class:{[a.contentContainer]:!0,[a.contentContainerUnavailable]:s,[a.contentContainerSelectable]:n!=="none",[a.contentContainerHasCenterContent]:o},key:"content-container",onClick:this.handleItemClick,onFocusin:this.focusCellContent,ref:u=>this.contentEl=u,role:"gridcell"},d)}render(){const{openable:e,open:t,level:n,setPosition:l,setSize:s,active:o,label:d,selected:u,selectionAppearance:r,selectionMode:h,closed:g,filterHidden:_,bordered:U,disabled:N}=this,v=h!=="none"&&r==="border",R=v&&u,j=v&&!u;return i(q,{key:"a610ab740c82b6088400839884d58d4d867829db"},i(A,{key:"f05bf10e82fab03ddfdaf3ab2e100dcbd6d69c63",disabled:N},i("div",{key:"4bf63ed08d2a4a049e060d26d3699656558d495e",class:{[a.wrapper]:!0,[a.wrapperBordered]:U}},i("tr",{key:"d231a113c3bd8ee7f67c2ffb0cf804c142a95fb9","aria-expanded":e?C(t):null,"aria-label":d,"aria-level":n,"aria-posinset":l,"aria-selected":C(u),"aria-setsize":s,class:{[a.container]:!0,[a.containerHover]:!0,[a.containerBorder]:v,[a.containerBorderSelected]:R,[a.containerBorderUnselected]:j},hidden:g||_,onFocus:this.focusCellNull,onFocusin:this.emitInternalListItemActive,onKeyDown:this.handleItemKeyDown,ref:W=>this.containerEl=W,role:"row",tabIndex:o?0:-1},this.renderDragHandle(),this.renderSelected(),this.renderOpen(),this.renderActionsStart(),this.renderContentContainer(),this.renderActionsEnd()),this.renderContentBottom()),this.renderDefaultContainer()))}emitCalciteInternalListItemToggle(){this.calciteInternalListItemToggle.emit()}emitCalciteInternalListItemChange(){this.calciteInternalListItemChange.emit()}setSelectionDefaults(){const{parentListEl:e,selectionMode:t,selectionAppearance:n}=this;e&&(t||(this.selectionMode=e.selectionMode),n||(this.selectionAppearance=e.selectionAppearance))}handleOpenableChange(e){if(!e)return;const t=Q(e),n=V(e);Y(t),this.openable=!!t.length||!!n.length}getGridCells(){return[this.handleGridEl,this.actionsStartEl,this.contentEl,this.actionsEndEl].filter(e=>e&&!e.hidden)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],open:["handleOpenChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return se}},[1,"calcite-list-item",{active:[4],bordered:[4],closable:[516],closed:[1540],description:[1],disabled:[516],dragDisabled:[516,"drag-disabled"],dragHandle:[4,"drag-handle"],dragSelected:[1540,"drag-selected"],filterHidden:[516,"filter-hidden"],label:[1],metadata:[16],open:[1540],setSize:[2,"set-size"],setPosition:[2,"set-position"],selected:[1540],unavailable:[516],value:[8],selectionMode:[1025,"selection-mode"],selectionAppearance:[1025,"selection-appearance"],messageOverrides:[1040],messages:[1040],effectiveLocale:[32],defaultMessages:[32],level:[32],parentListEl:[32],openable:[32],hasActionsStart:[32],hasActionsEnd:[32],hasCustomContent:[32],hasContentStart:[32],hasContentEnd:[32],hasContentBottom:[32],setFocus:[64]},[[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"],[0,"calciteInternalListDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"]],{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],open:["handleOpenChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function K(){typeof customElements>"u"||["calcite-list-item","calcite-action","calcite-handle","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-list-item":customElements.get(e)||customElements.define(e,G);break;case"calcite-action":customElements.get(e)||Z();break;case"calcite-handle":customElements.get(e)||O();break;case"calcite-icon":customElements.get(e)||B();break;case"calcite-loader":customElements.get(e)||ee();break}})}K();const Le=G,Ee=K;export{Le as CalciteListItem,Ee as defineCustomElement}; diff --git a/main/assets/calcite-list-item-VYBhSMxV-DcHoxADM.js b/main/assets/calcite-list-item-VYBhSMxV-DcHoxADM.js deleted file mode 100644 index b99ed4db1..000000000 --- a/main/assets/calcite-list-item-VYBhSMxV-DcHoxADM.js +++ /dev/null @@ -1,21 +0,0 @@ -import{p as k,b as L,W as c,a as i,D as q}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{A as C,G as m,X as I,p as X}from"./dom-N58V0tYi-DBU3jlah.js";import{l as E,p as A}from"./interactive-DqhNilgd-DrUFww1w.js";import{K as w,q as D}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{d as H,h as T,M,l as z}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{o as F,r as $,f as P}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{h as J,m as Q,u as V,f as Y}from"./utils3-BSH0zqNl-Dva1wv1w.js";import{c as y,o as f,n as a,e as p}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{m as Z}from"./action-GCQoufcz-Cwgl1KRC.js";import{m as B}from"./icon-BXFbBbop-O5hL8B42.js";import{v as ee}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-DJJPVpPW.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";const x={handle:"handle",handleSelected:"handle--selected"},te={drag:"drag"},b={itemLabel:"{itemLabel}",position:"{position}",total:"{total}"},ne=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.handle{display:flex;align-items:center;justify-content:center;align-self:stretch;border-style:none;outline-color:transparent;color:var(--calcite-handle-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-handle-background-color, transparent);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle calcite-icon{color:inherit}:host(:not([disabled])) .handle{cursor:move}:host(:not([disabled])) .handle:hover{color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2))}:host(:not([disabled])) .handle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - );color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1))}:host(:not([disabled])) .handle--selected{color:var(--calcite-handle-icon-color-selected, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-selected, var(--calcite-color-foreground-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,ie=ne,ae=k(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteHandleChange=c(this,"calciteHandleChange",6),this.calciteHandleNudge=c(this,"calciteHandleNudge",6),this.calciteInternalAssistiveTextChange=c(this,"calciteInternalAssistiveTextChange",6),this.handleKeyDown=e=>{if(!this.disabled)switch(e.key){case" ":this.selected=!this.selected,this.calciteHandleChange.emit(),e.preventDefault();break;case"ArrowUp":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"up"});break;case"ArrowDown":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"down"});break}},this.handleBlur=()=>{this.blurUnselectDisabled||this.disabled||this.selected&&(this.selected=!1,this.calciteHandleChange.emit())},this.selected=!1,this.disabled=!1,this.dragHandle=void 0,this.messages=void 0,this.setPosition=void 0,this.setSize=void 0,this.label=void 0,this.blurUnselectDisabled=!1,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}handleAriaTextChange(){const e=this.getAriaText("live");e&&this.calciteInternalAssistiveTextChange.emit({message:e})}onMessagesChange(){}connectedCallback(){H(this),w(this)}async componentWillLoad(){F(this),await T(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}disconnectedCallback(){M(this),D(this)}effectiveLocaleChange(){z(this,this.effectiveLocale)}async setFocus(){await P(this),this.handleButton?.focus()}getTooltip(){const{label:e,messages:t}=this;return t?e?t.dragHandle.replace(b.itemLabel,e):t.dragHandleUntitled:""}getAriaText(e){const{setPosition:t,setSize:n,label:l,messages:s,selected:o}=this;return!s||!l||typeof n!="number"||typeof t!="number"?null:(e==="label"?o?s.dragHandleChange:s.dragHandleIdle:o?s.dragHandleActive:s.dragHandleCommit).replace(b.position,t.toString()).replace(b.itemLabel,l).replace(b.total,n.toString())}render(){return i(A,{key:"1a694de393421691c83e7265850275c217ef7ffe",disabled:this.disabled},i("span",{key:"82ff692c15c2d9294ceb814b3f7f06bb4d8ff0e0","aria-checked":this.disabled?null:C(this.selected),"aria-disabled":this.disabled?C(this.disabled):null,"aria-label":this.disabled?null:this.getAriaText("label"),class:{[x.handle]:!0,[x.handleSelected]:!this.disabled&&this.selected},onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,ref:e=>{this.handleButton=e},role:"radio",tabIndex:this.disabled?null:0,title:this.getTooltip()},i("calcite-icon",{key:"25862a953826aea2d594507157aaffc21d07001c",icon:te.drag,scale:"s"})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],selected:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ie}},[1,"calcite-handle",{selected:[1540],disabled:[516],dragHandle:[513,"drag-handle"],messages:[1040],setPosition:[2,"set-position"],setSize:[2,"set-size"],label:[1],blurUnselectDisabled:[4,"blur-unselect-disabled"],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],selected:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function O(){typeof customElements>"u"||["calcite-handle","calcite-icon"].forEach(e=>{switch(e){case"calcite-handle":customElements.get(e)||customElements.define(e,ae);break;case"calcite-icon":customElements.get(e)||B();break}})}O();const le=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1);--calcite-list-item-icon-color:var(--calcite-color-brand)}:host([filter-hidden]),:host([closed]){display:none}.wrapper--bordered{border-block-end:1px solid var(--calcite-color-border-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{box-sizing:border-box;display:flex;flex:1 1 0%;overflow:hidden;background-color:var(--calcite-color-foreground-1)}.container *{box-sizing:border-box}.container--hover:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}.container:active{background-color:var(--calcite-color-foreground-1)}.container--border{border-inline-start-width:4px;border-inline-start-style:solid}.container--border-selected{border-inline-start-color:var(--calcite-color-brand)}.container--border-unselected{border-inline-start-color:transparent}.container:hover.container--border-unselected{border-color:var(--calcite-color-border-1)}.nested-container{display:none;flex-direction:column;border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);margin-inline-start:var(--calcite-list-item-spacing-indent, 1.5rem)}.nested-container--open{display:flex}.content-container{display:flex;flex:1 1 auto;-webkit-user-select:none;user-select:none;align-items:stretch;padding:0px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content-container--unavailable{opacity:var(--calcite-opacity-disabled)}tr,td{outline-color:transparent}tr{position:relative}tr:focus,td:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description,.content-bottom{font-family:var(--calcite-font-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child,.content-bottom:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-color-text-1)}:host([selected]) .label{font-weight:var(--calcite-font-weight-medium)}.description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}:host([selected]) .description{color:var(--calcite-color-text-2)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.content-bottom{display:flex;flex-direction:column}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-block:0px;color:var(--calcite-color-border-input);padding-inline:var(--calcite-spacing-md) var(--calcite-spacing-xxs)}.selection-container--single{color:transparent}:host(:not([disabled]):not([selected])) .container:hover .selection-container--single{color:var(--calcite-color-border-1)}:host([selected]:hover) .selection-container,:host([selected]:hover) .selection-container--single,:host([selected]) .selection-container{color:var(--calcite-list-item-icon-color)}.open-container{color:var(--calcite-color-text-3)}:host(:not([disabled])) .container:hover .open-container{color:var(--calcite-color-text-1)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.drag-container,.open-container{display:flex;align-items:center}.actions-start calcite-action,.actions-start calcite-handle,.actions-end calcite-action,.actions-end calcite-handle,.content-start calcite-action,.content-start calcite-handle,.content-end calcite-action,.content-end calcite-handle,.selection-container calcite-action,.selection-container calcite-handle,.drag-container calcite-action,.drag-container calcite-handle,.open-container calcite-action,.open-container calcite-handle{align-self:stretch}.open-container,.selection-container{cursor:pointer}.actions-start,.actions-end{position:relative;padding:0px}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}tr:focus .actions-start,tr:focus .actions-end{inset-block:0.125rem}tr:focus .actions-start .close,tr:focus .actions-start ::slotted(calcite-action),tr:focus .actions-start ::slotted(calcite-action-menu),tr:focus .actions-start ::slotted(calcite-handle),tr:focus .actions-start ::slotted(calcite-dropdown),tr:focus .actions-end .close,tr:focus .actions-end ::slotted(calcite-action),tr:focus .actions-end ::slotted(calcite-action-menu),tr:focus .actions-end ::slotted(calcite-handle),tr:focus .actions-end ::slotted(calcite-dropdown){block-size:calc(100% - 0.25rem)}tr:focus::after,tr:focus::before{position:absolute;content:"";inline-size:0.125rem;z-index:var(--calcite-z-index-header);background-color:var(--calcite-color-brand);inset-block:0}tr:focus::before{inset-inline-start:0}tr:focus::after{inset-inline-end:0}.container--border:focus::before{display:none}::slotted(calcite-list:empty){border-block-start-width:0px}:host([hidden]){display:none}[hidden]{display:none}`,se=le,S=new Map,oe="calcite-list",G=k(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListItemSelect=c(this,"calciteListItemSelect",6),this.calciteListItemClose=c(this,"calciteListItemClose",6),this.calciteListItemDragHandleChange=c(this,"calciteListItemDragHandleChange",6),this.calciteListItemToggle=c(this,"calciteListItemToggle",6),this.calciteInternalListItemSelect=c(this,"calciteInternalListItemSelect",6),this.calciteInternalListItemSelectMultiple=c(this,"calciteInternalListItemSelectMultiple",6),this.calciteInternalListItemActive=c(this,"calciteInternalListItemActive",6),this.calciteInternalFocusPreviousItem=c(this,"calciteInternalFocusPreviousItem",6),this.calciteInternalListItemChange=c(this,"calciteInternalListItemChange",6),this.calciteInternalListItemToggle=c(this,"calciteInternalListItemToggle",6),this.dragHandleSelectedChangeHandler=e=>{this.dragSelected=e.target.selected,this.calciteListItemDragHandleChange.emit(),e.stopPropagation()},this.emitInternalListItemActive=()=>{this.calciteInternalListItemActive.emit()},this.focusCellHandle=()=>{this.handleCellFocusIn(this.handleGridEl)},this.focusCellActionsStart=()=>{this.handleCellFocusIn(this.actionsStartEl)},this.focusCellContent=()=>{this.handleCellFocusIn(this.contentEl)},this.focusCellActionsEnd=()=>{this.handleCellFocusIn(this.actionsEndEl)},this.handleCloseClick=()=>{this.closed=!0,this.calciteListItemClose.emit()},this.handleContentSlotChange=e=>{this.hasCustomContent=m(e)},this.handleActionsStartSlotChange=e=>{this.hasActionsStart=m(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=m(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=m(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=m(e)},this.handleContentBottomSlotChange=e=>{this.hasContentBottom=m(e)},this.handleDefaultSlotChange=e=>{this.handleOpenableChange(e.target)},this.handleToggleClick=()=>{this.toggle()},this.toggle=(e=!this.open)=>{this.open=e,this.calciteListItemToggle.emit()},this.handleItemClick=e=>{e.defaultPrevented||this.toggleSelected(e.shiftKey)},this.toggleSelected=e=>{const{selectionMode:t,selected:n}=this;this.disabled||(t==="multiple"||t==="single"?this.selected=!n:t==="single-persist"&&(this.selected=!0),this.calciteInternalListItemSelectMultiple.emit({selectMultiple:e&&t==="multiple"}),this.calciteListItemSelect.emit())},this.handleItemKeyDown=e=>{if(e.defaultPrevented)return;const{key:t}=e,n=e.composedPath(),{containerEl:l,actionsStartEl:s,actionsEndEl:o,open:d,openable:u}=this,r=this.getGridCells(),h=r.findIndex(g=>n.includes(g));if(t==="Enter"&&!n.includes(s)&&!n.includes(o))e.preventDefault(),this.toggleSelected(e.shiftKey);else if(t==="ArrowRight"){e.preventDefault();const g=h+1;h===-1?!d&&u?(this.toggle(!0),this.focusCell(null)):r[0]&&this.focusCell(r[0]):r[h]&&r[g]&&this.focusCell(r[g])}else if(t==="ArrowLeft"){e.preventDefault();const g=h-1;h===-1?(this.focusCell(null),d&&u?this.toggle(!1):this.calciteInternalFocusPreviousItem.emit()):h===0?(this.focusCell(null),l.focus()):r[h]&&r[g]&&this.focusCell(r[g])}},this.focusCellNull=()=>{this.focusCell(null)},this.handleCellFocusIn=e=>{this.setFocusCell(e,I(e),!0)},this.setFocusCell=(e,t,n)=>{const{parentListEl:l}=this;n&&S.set(l,null);const s=this.getGridCells();s.forEach(o=>{o.tabIndex=-1,o.removeAttribute(y)}),e&&(e.tabIndex=e===t?0:-1,e.setAttribute(y,""),n&&S.set(l,s.indexOf(e)))},this.focusCell=(e,t=!0)=>{const n=I(e);this.setFocusCell(e,n,t),n?.focus()},this.active=!1,this.bordered=!1,this.closable=!1,this.closed=!1,this.description=void 0,this.disabled=!1,this.dragDisabled=!1,this.dragHandle=!1,this.dragSelected=!1,this.filterHidden=!1,this.label=void 0,this.metadata=void 0,this.open=!1,this.setSize=null,this.setPosition=null,this.selected=!1,this.unavailable=!1,this.value=void 0,this.selectionMode=null,this.selectionAppearance=null,this.messageOverrides=void 0,this.messages=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.level=null,this.parentListEl=void 0,this.openable=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasCustomContent=!1,this.hasContentStart=!1,this.hasContentEnd=!1,this.hasContentBottom=!1}activeHandler(e){e||this.focusCell(null,!1)}handleClosedChange(){this.emitCalciteInternalListItemChange()}handleDisabledChange(){this.emitCalciteInternalListItemChange()}handleOpenChange(){this.emitCalciteInternalListItemToggle()}handleSelectedChange(){this.calciteInternalListItemSelect.emit()}onMessagesChange(){}handleCalciteInternalListDefaultSlotChanges(e){e.stopPropagation(),this.handleOpenableChange(this.defaultSlotEl)}effectiveLocaleChange(){z(this,this.effectiveLocale)}connectedCallback(){w(this),H(this);const{el:e}=this;this.parentListEl=e.closest(oe),this.level=J(e)+1,this.setSelectionDefaults()}async componentWillLoad(){F(this),await T(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}disconnectedCallback(){D(this),M(this)}async setFocus(){await P(this);const{containerEl:e,parentListEl:t}=this,n=S.get(t);if(typeof n=="number"){const l=this.getGridCells();l[n]?this.focusCell(l[n]):e?.focus();return}e?.focus()}renderSelected(){const{selected:e,selectionMode:t,selectionAppearance:n}=this;return t==="none"||n==="border"?null:i("td",{class:{[a.selectionContainer]:!0,[a.selectionContainerSingle]:t==="single"||t==="single-persist"},key:"selection-container",onClick:this.handleItemClick},i("calcite-icon",{icon:e?t==="multiple"?f.selectedMultiple:f.selectedSingle:t==="multiple"?f.unselectedMultiple:f.unselectedSingle,scale:"s"}))}renderDragHandle(){const{label:e,dragHandle:t,dragSelected:n,dragDisabled:l,setPosition:s,setSize:o}=this;return t?i("td",{"aria-label":e,class:a.dragContainer,key:"drag-handle-container",onFocusin:this.focusCellHandle,ref:d=>this.handleGridEl=d,role:"gridcell"},i("calcite-handle",{disabled:l,label:e,onCalciteHandleChange:this.dragHandleSelectedChangeHandler,selected:n,setPosition:s,setSize:o})):null}renderOpen(){const{el:e,open:t,openable:n,messages:l}=this,s=X(e),o=t?f.open:s==="rtl"?f.closedRTL:f.closedLTR,d=t?l.collapse:l.expand;return n?i("td",{class:a.openContainer,key:"open-container",onClick:this.handleToggleClick,title:d},i("calcite-icon",{icon:o,key:o,scale:"s"})):null}renderActionsStart(){const{label:e,hasActionsStart:t}=this;return i("td",{"aria-label":e,class:a.actionsStart,hidden:!t,key:"actions-start-container",onFocusin:this.focusCellActionsStart,ref:n=>this.actionsStartEl=n,role:"gridcell"},i("slot",{name:p.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{label:e,hasActionsEnd:t,closable:n,messages:l}=this;return i("td",{"aria-label":e,class:a.actionsEnd,hidden:!(t||n),key:"actions-end-container",onFocusin:this.focusCellActionsEnd,ref:s=>this.actionsEndEl=s,role:"gridcell"},i("slot",{name:p.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),n?i("calcite-action",{appearance:"transparent",class:a.close,icon:f.close,key:"close-action",label:l.close,onClick:this.handleCloseClick,text:l.close}):null)}renderContentStart(){const{hasContentStart:e}=this;return i("div",{class:a.contentStart,hidden:!e},i("slot",{name:p.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderCustomContent(){const{hasCustomContent:e}=this;return i("div",{class:a.customContent,hidden:!e},i("slot",{name:p.content,onSlotchange:this.handleContentSlotChange}))}renderContentEnd(){const{hasContentEnd:e}=this;return i("div",{class:a.contentEnd,hidden:!e},i("slot",{name:p.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}renderContentBottom(){const{hasContentBottom:e}=this;return i("div",{class:a.contentBottom,hidden:!e},i("slot",{name:p.contentBottom,onSlotchange:this.handleContentBottomSlotChange}))}renderDefaultContainer(){return i("div",{class:{[a.nestedContainer]:!0,[a.nestedContainerOpen]:this.openable&&this.open}},i("slot",{onSlotchange:this.handleDefaultSlotChange,ref:e=>this.defaultSlotEl=e}))}renderContentProperties(){const{label:e,description:t,hasCustomContent:n}=this;return!n&&(e||t)?i("div",{class:a.content,key:"content"},e?i("div",{class:a.label,key:"label"},e):null,t?i("div",{class:a.description,key:"description"},t):null):null}renderContentContainer(){const{description:e,label:t,selectionMode:n,hasCustomContent:l,unavailable:s}=this,o=l||!!t||!!e,d=[this.renderContentStart(),this.renderCustomContent(),this.renderContentProperties(),this.renderContentEnd()];return i("td",{"aria-label":t,class:{[a.contentContainer]:!0,[a.contentContainerUnavailable]:s,[a.contentContainerSelectable]:n!=="none",[a.contentContainerHasCenterContent]:o},key:"content-container",onClick:this.handleItemClick,onFocusin:this.focusCellContent,ref:u=>this.contentEl=u,role:"gridcell"},d)}render(){const{openable:e,open:t,level:n,setPosition:l,setSize:s,active:o,label:d,selected:u,selectionAppearance:r,selectionMode:h,closed:g,filterHidden:_,bordered:U,disabled:N}=this,v=h!=="none"&&r==="border",R=v&&u,j=v&&!u;return i(q,{key:"a610ab740c82b6088400839884d58d4d867829db"},i(A,{key:"f05bf10e82fab03ddfdaf3ab2e100dcbd6d69c63",disabled:N},i("div",{key:"4bf63ed08d2a4a049e060d26d3699656558d495e",class:{[a.wrapper]:!0,[a.wrapperBordered]:U}},i("tr",{key:"d231a113c3bd8ee7f67c2ffb0cf804c142a95fb9","aria-expanded":e?C(t):null,"aria-label":d,"aria-level":n,"aria-posinset":l,"aria-selected":C(u),"aria-setsize":s,class:{[a.container]:!0,[a.containerHover]:!0,[a.containerBorder]:v,[a.containerBorderSelected]:R,[a.containerBorderUnselected]:j},hidden:g||_,onFocus:this.focusCellNull,onFocusin:this.emitInternalListItemActive,onKeyDown:this.handleItemKeyDown,ref:W=>this.containerEl=W,role:"row",tabIndex:o?0:-1},this.renderDragHandle(),this.renderSelected(),this.renderOpen(),this.renderActionsStart(),this.renderContentContainer(),this.renderActionsEnd()),this.renderContentBottom()),this.renderDefaultContainer()))}emitCalciteInternalListItemToggle(){this.calciteInternalListItemToggle.emit()}emitCalciteInternalListItemChange(){this.calciteInternalListItemChange.emit()}setSelectionDefaults(){const{parentListEl:e,selectionMode:t,selectionAppearance:n}=this;e&&(t||(this.selectionMode=e.selectionMode),n||(this.selectionAppearance=e.selectionAppearance))}handleOpenableChange(e){if(!e)return;const t=Q(e),n=V(e);Y(t),this.openable=!!t.length||!!n.length}getGridCells(){return[this.handleGridEl,this.actionsStartEl,this.contentEl,this.actionsEndEl].filter(e=>e&&!e.hidden)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],open:["handleOpenChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return se}},[1,"calcite-list-item",{active:[4],bordered:[4],closable:[516],closed:[1540],description:[1],disabled:[516],dragDisabled:[516,"drag-disabled"],dragHandle:[4,"drag-handle"],dragSelected:[1540,"drag-selected"],filterHidden:[516,"filter-hidden"],label:[1],metadata:[16],open:[1540],setSize:[2,"set-size"],setPosition:[2,"set-position"],selected:[1540],unavailable:[516],value:[8],selectionMode:[1025,"selection-mode"],selectionAppearance:[1025,"selection-appearance"],messageOverrides:[1040],messages:[1040],effectiveLocale:[32],defaultMessages:[32],level:[32],parentListEl:[32],openable:[32],hasActionsStart:[32],hasActionsEnd:[32],hasCustomContent:[32],hasContentStart:[32],hasContentEnd:[32],hasContentBottom:[32],setFocus:[64]},[[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"],[0,"calciteInternalListDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"]],{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],open:["handleOpenChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function K(){typeof customElements>"u"||["calcite-list-item","calcite-action","calcite-handle","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-list-item":customElements.get(e)||customElements.define(e,G);break;case"calcite-action":customElements.get(e)||Z();break;case"calcite-handle":customElements.get(e)||O();break;case"calcite-icon":customElements.get(e)||B();break;case"calcite-loader":customElements.get(e)||ee();break}})}K();const Le=G,Ee=K;export{Le as CalciteListItem,Ee as defineCustomElement}; diff --git a/main/assets/calcite-list-item-group-CuQ2MPLW-BDMj-Jdi.js b/main/assets/calcite-list-item-group-CuQ2MPLW-BDMj-Jdi.js new file mode 100644 index 000000000..d77fac85d --- /dev/null +++ b/main/assets/calcite-list-item-group-CuQ2MPLW-BDMj-Jdi.js @@ -0,0 +1 @@ +import{p as o,b as n,W as l,a as t,D as c}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{l as r,p as h}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{t as f}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const i={container:"container",heading:"heading"},p=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1)}:host([filter-hidden]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{margin:0px;display:flex;flex:1 1 0%;padding:0.75rem;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2)}.heading{padding:0px}:host([hidden]){display:none}[hidden]{display:none}",u=p,a=o(class extends n{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalListItemGroupDefaultSlotChange=l(this,"calciteInternalListItemGroupDefaultSlotChange",6),this.handleDefaultSlotChange=()=>{this.calciteInternalListItemGroupDefaultSlotChange.emit()},this.disabled=!1,this.filterHidden=!1,this.heading=void 0}componentDidRender(){r(this)}render(){const{disabled:e,heading:d}=this;return t(c,{key:"e1e0304c3d4fe02909fd0075de2e4f5ef806be39"},t(h,{key:"5fb0861fb58de90808e98b7061d3c906c822203c",disabled:e},t("tr",{key:"c77af78f937c3135601df2c4574b858662d5fcdb",class:i.container},t("td",{key:"f1ae6b9e09e78f87b814287f8eaeb0a105575c7a",class:i.heading,colSpan:f},d)),t("slot",{key:"7346d5d774173403910eddd35bf700ccd1437c4f",onSlotchange:this.handleDefaultSlotChange})))}get el(){return this}static get style(){return u}},[1,"calcite-list-item-group",{disabled:[516],filterHidden:[516,"filter-hidden"],heading:[513]}]);function s(){typeof customElements>"u"||["calcite-list-item-group"].forEach(e=>{switch(e){case"calcite-list-item-group":customElements.get(e)||customElements.define(e,a);break}})}s();const k=a,D=s;export{k as CalciteListItemGroup,D as defineCustomElement}; diff --git a/main/assets/calcite-list-item-group-CuQ2MPLW-BznsgUiX.js b/main/assets/calcite-list-item-group-CuQ2MPLW-BznsgUiX.js deleted file mode 100644 index 9db5af375..000000000 --- a/main/assets/calcite-list-item-group-CuQ2MPLW-BznsgUiX.js +++ /dev/null @@ -1 +0,0 @@ -import{p as o,b as n,W as l,a as t,D as c}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{l as r,p as h}from"./interactive-DqhNilgd-DrUFww1w.js";import{t as f}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const i={container:"container",heading:"heading"},p=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1)}:host([filter-hidden]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{margin:0px;display:flex;flex:1 1 0%;padding:0.75rem;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2)}.heading{padding:0px}:host([hidden]){display:none}[hidden]{display:none}",u=p,a=o(class extends n{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalListItemGroupDefaultSlotChange=l(this,"calciteInternalListItemGroupDefaultSlotChange",6),this.handleDefaultSlotChange=()=>{this.calciteInternalListItemGroupDefaultSlotChange.emit()},this.disabled=!1,this.filterHidden=!1,this.heading=void 0}componentDidRender(){r(this)}render(){const{disabled:e,heading:d}=this;return t(c,{key:"e1e0304c3d4fe02909fd0075de2e4f5ef806be39"},t(h,{key:"5fb0861fb58de90808e98b7061d3c906c822203c",disabled:e},t("tr",{key:"c77af78f937c3135601df2c4574b858662d5fcdb",class:i.container},t("td",{key:"f1ae6b9e09e78f87b814287f8eaeb0a105575c7a",class:i.heading,colSpan:f},d)),t("slot",{key:"7346d5d774173403910eddd35bf700ccd1437c4f",onSlotchange:this.handleDefaultSlotChange})))}get el(){return this}static get style(){return u}},[1,"calcite-list-item-group",{disabled:[516],filterHidden:[516,"filter-hidden"],heading:[513]}]);function s(){typeof customElements>"u"||["calcite-list-item-group"].forEach(e=>{switch(e){case"calcite-list-item-group":customElements.get(e)||customElements.define(e,a);break}})}s();const k=a,D=s;export{k as CalciteListItemGroup,D as defineCustomElement}; diff --git a/main/assets/calcite-list-rnu1YzAl-BT4YOn58.js b/main/assets/calcite-list-rnu1YzAl-BT4YOn58.js deleted file mode 100644 index 2af2f1915..000000000 --- a/main/assets/calcite-list-rnu1YzAl-BT4YOn58.js +++ /dev/null @@ -1,2 +0,0 @@ -import{p as vt,b as bt,a as v,D as Nn,W as ce,h as jn}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{G as he,A as Rn}from"./dom-N58V0tYi-DBU3jlah.js";import{l as zt,p as $t}from"./interactive-DqhNilgd-DrUFww1w.js";import{c as Hn}from"./observers-BigwqTsw-DJJPVpPW.js";import{t as Xn}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{f as Yn,m as zn}from"./utils3-BSH0zqNl-Dva1wv1w.js";import{o as Bt,r as Wt,f as Ut}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{l as Gt,h as Vt,d as Zt,M as Kt}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{K as Qt,q as qt,X as It}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{b as Ct,A as yt,O as $n,l as Jt,W as Et,$ as Bn,D as Wn,g as en}from"./debounce-27Hmkkyg-Th7bw3mg.js";import{m as tn}from"./icon-BXFbBbop-O5hL8B42.js";import{z as nn,w as an,M as on}from"./input2-eOtqu-iO-CInnv9HE.js";import{v as Un}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";import{c as Gn}from"./scrim-BscQh4v9-uedhhKYH.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./form-CRSw616T-Cd5gFTXp.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./guid-Dls486Er-CBh637k4.js";function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,i)}return n}function B(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function Kn(e,t){if(e==null)return{};var n=Zn(e,t),i,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Qn="1.15.3";function V(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var K=V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oe=V(/Edge/i),Dt=V(/firefox/i),Ae=V(/safari/i)&&!V(/chrome/i)&&!V(/android/i),rn=V(/iP(ad|od|hone)/i),ln=V(/chrome/i)&&V(/android/i),sn={capture:!1,passive:!1};function E(e,t,n){e.addEventListener(t,n,!K&&sn)}function b(e,t,n){e.removeEventListener(t,n,!K&&sn)}function Ue(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function cn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Y(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ue(e,t):Ue(e,t))||i&&e===n)return e;if(e===n)break}while(e=cn(e))}return null}var At=/\s+/g;function j(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(At," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(At," ")}}function f(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function Ee(e,t){var n="";if(typeof e=="string")n=e;else do{var i=f(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function dn(e,t,n){if(e){var i=e.getElementsByTagName(t),a=0,o=i.length;if(n)for(;a=o,!r)return i;if(i===$())break;i=ne(i,!1)}return!1}function we(e,t,n,i){for(var a=0,o=0,r=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,a=Kn(n,oi);Fe.pluginEvent.bind(p)(e,t,B({dragEl:d,parentEl:D,ghostEl:g,rootEl:C,nextEl:de,lastDownEl:ze,cloneEl:x,cloneHidden:te,dragStarted:Ce,putSortable:_,activeSortable:p.active,originalEvent:i,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee,hideGhostForTarget:bn,unhideGhostForTarget:yn,cloneNowHidden:function(){te=!0},cloneNowShown:function(){te=!1},dispatchSortableEvent:function(o){O({sortable:t,name:o,originalEvent:i})}},a))};function O(e){ai(B({putSortable:_,cloneEl:x,targetEl:d,rootEl:C,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee},e))}var d,D,g,C,de,ze,x,te,be,R,_e,ee,Ne,_,ve=!1,Ge=!1,Ve=[],le,X,tt,nt,Lt,Pt,Ce,ge,Le,Pe=!1,je=!1,$e,P,it=[],ht=!1,Ze=[],Qe=typeof document<"u",Re=rn,kt=Oe||K?"cssFloat":"float",ri=Qe&&!ln&&!rn&&"draggable"in document.createElement("div"),gn=function(){if(Qe){if(K)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mn=function(e,t){var n=f(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=we(e,0,t),o=we(e,1,t),r=a&&f(a),s=o&&f(o),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+T(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&r.float&&r.float!=="none"){var h=r.float==="left"?"left":"right";return o&&(s.clear==="both"||s.clear===h)?"vertical":"horizontal"}return a&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||l>=i&&n[kt]==="none"||o&&n[kt]==="none"&&l+c>i)?"vertical":"horizontal"},li=function(e,t,n){var i=n?e.left:e.top,a=n?e.right:e.bottom,o=n?e.width:e.height,r=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return i===r||a===s||i+o/2===r+l/2},si=function(e,t){var n;return Ve.some(function(i){var a=i[M].options.emptyInsertThreshold;if(!(!a||wt(i))){var o=T(i),r=e>=o.left-a&&e<=o.right+a,s=t>=o.top-a&&t<=o.bottom+a;if(r&&s)return n=i}}),n},vn=function(e){function t(a,o){return function(r,s,l,c){var h=r.options.group.name&&s.options.group.name&&r.options.group.name===s.options.group.name;if(a==null&&(o||h))return!0;if(a==null||a===!1)return!1;if(o&&a==="clone")return a;if(typeof a=="function")return t(a(r,s,l,c),o)(r,s,l,c);var u=(o?r:s).options.group.name;return a===!0||typeof a=="string"&&a===u||a.join&&a.indexOf(u)>-1}}var n={},i=e.group;(!i||Ye(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},bn=function(){!gn&&g&&f(g,"display","none")},yn=function(){!gn&&g&&f(g,"display","")};Qe&&!ln&&document.addEventListener("click",function(e){if(Ge)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ge=!1,!1},!0);var se=function(e){if(d){e=e.touches?e.touches[0]:e;var t=si(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[M]._onDragOver(n)}}},ci=function(e){d&&d.parentNode[M]._isOutsideThisEl(e.target)};function p(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Z({},t),e[M]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!Ae,emptyInsertThreshold:5};Fe.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);vn(t);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=t.forceFallback?!1:ri,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(e,"pointerdown",this._onTapStart):(E(e,"mousedown",this._onTapStart),E(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(e,"dragover",this),E(e,"dragenter",this)),Ve.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Z(this,ti())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ge=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,a=i.preventOnFilter,o=e.type,r=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=i.filter;if(vi(n),!d&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Ae&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Y(s,i.draggable,n,!1),!(s&&s.animated)&&ze!==s)){if(be=H(s),_e=H(s,i.draggable),typeof c=="function"){if(c.call(this,e,s,this)){O({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),F("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=Y(l,h.trim(),n,!1),h)return O({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),F("filter",t,{evt:e}),!0}),c)){a&&e.cancelable&&e.preventDefault();return}i.handle&&!Y(l,i.handle,n,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,n){var i=this,a=i.el,o=i.options,r=a.ownerDocument,s;if(n&&!d&&n.parentNode===a){var l=T(n);if(C=a,d=n,D=d.parentNode,de=d.nextSibling,ze=n,Ne=o.group,p.dragged=d,le={target:d,clientX:(t||e).clientX,clientY:(t||e).clientY},Lt=le.clientX-l.left,Pt=le.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,d.style["will-change"]="all",s=function(){if(F("delayEnded",i,{evt:e}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Dt&&i.nativeDraggable&&(d.draggable=!0),i._triggerDragStart(e,t),O({sortable:i,name:"choose",originalEvent:e}),j(d,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){dn(d,c.trim(),at)}),E(r,"dragover",se),E(r,"mousemove",se),E(r,"touchmove",se),E(r,"mouseup",i._onDrop),E(r,"touchend",i._onDrop),E(r,"touchcancel",i._onDrop),Dt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),F("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Oe||K))){if(p.eventCanceled){this._onDrop();return}E(r,"mouseup",i._disableDelayedDrag),E(r,"touchend",i._disableDelayedDrag),E(r,"touchcancel",i._disableDelayedDrag),E(r,"mousemove",i._delayedDragTouchMoveHandler),E(r,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&E(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,o.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&at(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):t?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(d,"dragend",this),E(C,"dragstart",this._onDragStart));try{document.selection?Be(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ve=!1,C&&d){F("dragStarted",this,{evt:t}),this.nativeDraggable&&E(document,"dragover",ci);var n=this.options;!e&&j(d,n.dragClass,!1),j(d,n.ghostClass,!0),p.active=this,e&&this._appendGhost(),O({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,bn();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(d.parentNode[M]._isOutsideThisEl(e),t)do{if(t[M]){var n=void 0;if(n=t[M]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=cn(t));yn()}},_onTouchMove:function(e){if(le){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,a=e.touches?e.touches[0]:e,o=g&&Ee(g,!0),r=g&&o&&o.a,s=g&&o&&o.d,l=Re&&P&&_t(P),c=(a.clientX-le.clientX+i.x)/(r||1)+(l?l[0]-it[0]:0)/(r||1),h=(a.clientY-le.clientY+i.y)/(s||1)+(l?l[1]-it[1]:0)/(s||1);if(!p.active&&!ve){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))=0&&(O({rootEl:D,name:"add",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"remove",toEl:D,originalEvent:e}),O({rootEl:D,name:"sort",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),_&&_.save()):R!==be&&R>=0&&(O({sortable:this,name:"update",toEl:D,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((R==null||R===-1)&&(R=be,ee=_e),O({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){F("nulling",this),C=d=D=g=de=x=ze=te=le=X=Ce=R=ee=be=_e=ge=Le=_=Ne=p.dragged=p.ghost=p.clone=p.active=null,Ze.forEach(function(e){e.checked=!0}),Ze.length=tt=nt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),di(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,a=n.length,o=this.options;ia.right+o||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>a.bottom+o||e.clientX>i.right&&e.clientY>i.top}function pi(e,t,n,i,a,o,r,s){var l=i?e.clientY:e.clientX,c=i?n.height:n.width,h=i?n.top:n.left,u=i?n.bottom:n.right,y=!1;if(!r){if(s&&$eh+c*o/2:lu-$e)return-Le}else if(l>h+c*(1-a)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function gi(e){return H(d)e.canPull({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})},...!!e.canPut&&{put:(o,r,s,{newIndex:l,oldIndex:c})=>e.canPut({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})}}},handle:i,filter:`${i}[disabled]`,onStart:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!0,wi(),e.onDragStart({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onEnd:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!1,Si(),e.onDragEnd({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onSort:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{e.onDragSort({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})}})}function wn(e){Sn(e)||(qe.delete(e),e.sortable?.destroy(),e.sortable=null)}const mt={active:!1};function Sn(e){return e.dragEnabled&&mt.active}function wi(){Array.from(qe).forEach(e=>e.onGlobalDragStart())}function Si(){Array.from(qe).forEach(e=>e.onGlobalDragEnd())}const me={container:"container",actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},ye={actionsStart:"actions-start",contentStart:"content-start",contentEnd:"content-end",actionsEnd:"actions-end"},Ii=":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}",Ci=Ii,xi=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleActionsStartSlotChange=e=>{this.hasActionsStart=he(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=he(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=he(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=he(e)},this.disabled=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasContentStart=!1,this.hasContentEnd=!1}renderActionsStart(){const{hasActionsStart:e}=this;return v("div",{class:me.actionsStart,hidden:!e,key:"actions-start-container"},v("slot",{name:ye.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{hasActionsEnd:e}=this;return v("div",{class:me.actionsEnd,hidden:!e,key:"actions-end-container"},v("slot",{name:ye.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:e}=this;return v("div",{class:me.contentStart,hidden:!e},v("slot",{name:ye.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderDefaultContent(){return v("div",{class:me.content},v("slot",null))}renderContentEnd(){const{hasContentEnd:e}=this;return v("div",{class:me.contentEnd,hidden:!e},v("slot",{name:ye.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}render(){return v(Nn,{key:"97f052828720d715fd3b11a4b0e77fa085127796"},v("div",{key:"5351cc20a8a437763894fef35ecc7a7240cb7c46",class:me.container},this.renderActionsStart(),this.renderContentStart(),this.renderDefaultContent(),this.renderContentEnd(),this.renderActionsEnd()))}static get style(){return Ci}},[1,"calcite-stack",{disabled:[516],hasActionsStart:[32],hasActionsEnd:[32],hasContentStart:[32],hasContentEnd:[32]}]);function In(){typeof customElements>"u"||["calcite-stack"].forEach(e=>{switch(e){case"calcite-stack":customElements.get(e)||customElements.define(e,xi);break}})}In();function Di(e,t){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ri}function Hi(e){return e!=null&&Dn(e.length)&&!Fi(e)}var Xi=Object.prototype;function Yi(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Xi;return e===n}function zi(e,t){for(var n=-1,i=Array(e);++n{const i=Ya(t),a=new RegExp(i,"i");e.length===0&&console.warn(`No data was passed to the filter function. - The data argument should be an array of objects`);const o=(r,s,l)=>{if(r?.constant||r?.filterDisabled)return!0;let c=!1;return za(r,(h,u)=>{typeof h=="function"||h==null||l&&!l.includes(u)||(Array.isArray(h)||typeof h=="object"&&h!==null?o(h,s)&&(c=!0):s.test(h)&&(c=!0))}),c};return e.filter(r=>o(r,a,n))},$a={container:"container",searchIcon:"search-icon"},Ba={search:"search",close:"x"},Wa=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-color-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-color-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-color-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-color-text-1)}:host([hidden]){display:none}[hidden]{display:none}",Ua=Wa,Ga=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=ce(this,"calciteFilterChange",6),this.filterDebounced=Jt((e,t=!1,n)=>this.updateFiltered(Yt(this.items??[],e,this.filterProps),t,n),jn.filter),this.inputHandler=e=>{const t=e.target;this.value=t.value,this.filterDebounced(t.value,!0)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"&&(this.clear(),e.preventDefault()),e.key==="Enter"&&e.preventDefault())},this.clear=()=>{this.value="",this.filterDebounced("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.filterProps=void 0,this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filterDebounced(this.value)}filterPropsHandler(){this.filterDebounced(this.value)}onMessagesChange(){}valueHandler(e){this.filterDebounced(e)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async componentWillLoad(){Bt(this),this.updateFiltered(Yt(this.items??[],this.value,this.filterProps)),await Vt(this)}connectedCallback(){Qt(this),Zt(this)}componentDidRender(){zt(this)}disconnectedCallback(){qt(this),Kt(this),this.filterDebounced.cancel()}componentDidLoad(){Wt(this)}async filter(e=this.value){return new Promise(t=>{this.value=e,this.filterDebounced(e,!1,t)})}async setFocus(){return await Ut(this),this.textInput?.setFocus()}updateFiltered(e,t=!1,n){this.filteredItems=e,t&&this.calciteFilterChange.emit(),n?.()}render(){const{disabled:e,scale:t}=this;return v($t,{key:"c4a624e52409ed90839b506f5d99ab623767260e",disabled:e},v("div",{key:"1f2ef99156489719dd2f938bc5ce8a05185866bf",class:$a.container},v("label",{key:"6fe8c6cf73f554908be38299263d23380a4ed089"},v("calcite-input",{key:"6765e00d208d6898221540769865d84aa1c64974",clearable:!0,disabled:e,icon:Ba.search,label:this.messages.label,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:n=>{this.textInput=n},scale:t,type:"text",value:this.value}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ua}},[17,"calcite-filter",{items:[16],disabled:[516],filteredItems:[1040],filterProps:[16],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],filter:[64],setFocus:[64]},void 0,{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function Pn(){typeof customElements>"u"||["calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-filter":customElements.get(e)||customElements.define(e,Ga);break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-progress":customElements.get(e)||nn();break}})}Pn();const J={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text"},Va=0,dt={filterNoResults:"filter-no-results",filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},Za=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{position:relative}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%;border-collapse:collapse}.stack{--calcite-stack-padding-inline:0;--calcite-stack-padding-block:0}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-z-index-sticky);background-color:var(--calcite-color-foreground-1)}.sticky-pos th{padding:0px}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}",Ka=Za,Xe="calcite-list-item",Qa="calcite-list-item-group, calcite-list-item",kn=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListChange=ce(this,"calciteListChange",6),this.calciteListDragEnd=ce(this,"calciteListDragEnd",6),this.calciteListDragStart=ce(this,"calciteListDragStart",6),this.calciteListFilter=ce(this,"calciteListFilter",6),this.calciteListOrderChange=ce(this,"calciteListOrderChange",6),this.calciteInternalListDefaultSlotChange=ce(this,"calciteInternalListDefaultSlotChange",6),this.dragSelector=Xe,this.focusableItems=[],this.handleSelector="calcite-handle",this.listItems=[],this.mutationObserver=Hn("mutation",()=>this.updateListItems({performFilter:!0})),this.visibleItems=[],this.handleDefaultSlotChange=e=>{Yn(zn(e.target)),this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()},this.handleFilterActionsStartSlotChange=e=>{this.hasFilterActionsStart=he(e)},this.handleFilterActionsEndSlotChange=e=>{this.hasFilterActionsEnd=he(e)},this.handleFilterNoResultsSlotChange=e=>{this.hasFilterNoResults=he(e)},this.setActiveListItem=()=>{const{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)},this.updateSelectedItems=(e=!1)=>{this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()},this.borderItems=()=>{const e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsOpen(t));e.forEach(t=>t.bordered=t!==e[e.length-1])},this.updateFilteredItems=(e=!1)=>{const{visibleItems:t,filteredData:n,filterText:i}=this,a=n.map(l=>l.value),o=t?.filter(l=>t.every(c=>c===l||!l.contains(c))),r=t.filter(l=>!i||a.includes(l.value))||[],s=new WeakSet;o.forEach(l=>this.filterElements({el:l,filteredItems:r,visibleParents:s})),this.filteredItems=r,e&&this.calciteListFilter.emit()},this.setFilterEl=e=>{this.filterEl=e,this.performFilter()},this.handleFilterChange=e=>{e.stopPropagation();const{value:t}=e.currentTarget;this.filterText=t,this.updateFilteredData(!0)},this.getItemData=()=>this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,value:e.value})),this.updateListItems=Jt(e=>{const t=e?.emitFilterChange??!1,n=e?.performFilter??!1,{selectionAppearance:i,selectionMode:a,dragEnabled:o,el:r,filterEl:s,filterEnabled:l}=this,c=Array.from(this.el.querySelectorAll(Xe));if(c.forEach(h=>{h.selectionAppearance=i,h.selectionMode=a,h.closest("calcite-list")===r&&(h.dragHandle=o)}),this.parentListEl){this.setUpSorting();return}this.listItems=c,l&&n&&(this.dataForFilter=this.getItemData(),s&&(s.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(h=>!h.closed&&!h.hidden),this.updateFilteredItems(t),this.borderItems(),this.focusableItems=this.filteredItems.filter(h=>!h.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()},Va),this.focusRow=e=>{const{focusableItems:t}=this;e&&(t.forEach(n=>n.active=n===e),e.setFocus())},this.isNavigable=e=>{const t=e.parentElement?.closest(Xe);return t?t.open&&this.isNavigable(t):!0},this.handleListKeydown=e=>{if(e.defaultPrevented||this.parentListEl)return;const{key:t}=e,n=this.focusableItems.filter(a=>this.isNavigable(a)),i=n.findIndex(a=>a.active);if(t==="ArrowDown"){e.preventDefault();const a=e.target===this.filterEl?0:i+1;n[a]&&this.focusRow(n[a])}else if(t==="ArrowUp"){if(e.preventDefault(),i===0&&this.filterEnabled){this.filterEl?.setFocus();return}const a=i-1;n[a]&&this.focusRow(n[a])}else if(t==="Home"){e.preventDefault();const a=n[0];a&&this.focusRow(a)}else if(t==="End"){e.preventDefault();const a=n[n.length-1];a&&this.focusRow(a)}},this.disabled=!1,this.canPull=void 0,this.canPut=void 0,this.dragEnabled=!1,this.group=void 0,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.filterProps=void 0,this.messageOverrides=void 0,this.messages=void 0,this.numberingSystem=void 0,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.effectiveLocale="",this.defaultMessages=void 0,this.assistiveText=void 0,this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1}async handleFilterTextChange(){this.performFilter()}async handleFilterPropsChange(){this.performFilter()}onMessagesChange(){}handleListItemChange(){this.updateListItems({performFilter:!0})}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();const{focusableItems:t}=this,n=t.findIndex(i=>i.active)-1;t[n]&&this.focusRow(t[n])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n}=this;n.forEach(i=>{i.active=i===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleCalciteHandleNudge(e){this.parentListEl||this.handleNudgeEvent(e)}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n,selectionMode:i}=this;t.selected&&(i==="single"||i==="single-persist")&&n.forEach(a=>a.selected=a===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();const{target:t,detail:n}=e,{focusableItems:i,lastSelectedInfo:a}=this,o=t;if(n.selectMultiple&&a){const r=i.indexOf(o),s=i.indexOf(a.selectedItem),l=Math.min(s,r),c=Math.max(s,r);i.slice(l,c+1).forEach(h=>h.selected=a.selected)}else this.lastSelectedInfo={selectedItem:o,selected:o.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.updateListItems())}handleCalciteInternalListItemGroupDefaultSlotChange(e){e.stopPropagation()}connectedCallback(){Qt(this),Zt(this),this.connectObserver(),this.updateListItems({performFilter:!0}),this.setUpSorting(),this.setParentList()}async componentWillLoad(){Bt(this),await Vt(this)}componentDidRender(){zt(this)}componentDidLoad(){Wt(this)}disconnectedCallback(){this.disconnectObserver(),wn(this),qt(this),Kt(this)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async setFocus(){return await Ut(this),this.filterEnabled?this.filterEl?.setFocus():this.focusableItems.find(e=>e.active)?.setFocus()}render(){const{loading:e,label:t,disabled:n,dataForFilter:i,filterEnabled:a,filterPlaceholder:o,filterText:r,filteredItems:s,hasFilterActionsStart:l,hasFilterActionsEnd:c,hasFilterNoResults:h,filterProps:u}=this;return v($t,{key:"c3139afe4fe7c7462578a51a4578971c97473167",disabled:this.disabled},v("div",{key:"5e99dc8b479c35609c5f0318723b3da84ec23ef4",class:J.container},this.dragEnabled?v("span",{"aria-live":"assertive",class:J.assistiveText},this.assistiveText):null,this.renderItemAriaLive(),e?v("calcite-scrim",{class:J.scrim,loading:e}):null,v("table",{key:"a31ba050d3141351e491141365e8244ed3ca5303","aria-busy":Rn(e),"aria-label":t||"",class:J.table,onKeyDown:this.handleListKeydown,role:"treegrid"},a||l||c?v("thead",{class:J.sticky},v("tr",null,v("th",{colSpan:Xn},v("calcite-stack",{class:J.stack},v("slot",{name:dt.filterActionsStart,onSlotchange:this.handleFilterActionsStartSlotChange,slot:ye.actionsStart}),v("calcite-filter",{"aria-label":o,disabled:n,filterProps:u,items:i,onCalciteFilterChange:this.handleFilterChange,placeholder:o,ref:this.setFilterEl,value:r}),v("slot",{name:dt.filterActionsEnd,onSlotchange:this.handleFilterActionsEndSlotChange,slot:ye.actionsEnd}))))):null,v("tbody",{key:"3ed1b8d9a4387c3ea0f4ff38e5388be35b32d89b",class:J.tableContainer},v("slot",{key:"712562533b4609749cbff0968bd0a9e77d99758e",onSlotchange:this.handleDefaultSlotChange}))),v("div",{key:"3ff977013e0ca0d58229e1305dca702000d91a99","aria-live":"polite","data-test-id":"no-results-container",hidden:!(h&&a&&r&&!s.length)},v("slot",{key:"7c2bf6389c8b5f4b6f617950e4068baf6b1dc358",name:dt.filterNoResults,onSlotchange:this.handleFilterNoResultsSlotChange}))))}renderItemAriaLive(){const{messages:e,filteredItems:t,parentListEl:n,effectiveLocale:i,numberingSystem:a,filterEnabled:o,filterText:r,filteredData:s}=this;return It.numberFormatOptions={locale:i,numberingSystem:a},n?null:v("div",{"aria-live":"polite",class:J.assistiveText},o&&r&&s?.length?v("div",{key:"aria-filter-enabled"},e.filterEnabled):null,v("div",{key:"aria-item-count"},e.total.replace("{count}",It.localize(t.length.toString()))),t.length?v("ol",{key:"aria-item-list"},t.map(l=>v("li",null,l.label))):null)}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){const{dragEnabled:e}=this;e&&Ei(this)}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItems(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest("calcite-list")}filterElements({el:e,filteredItems:t,visibleParents:n}){const i=!n.has(e)&&!t.includes(e);e.filterHidden=i;const a=e.parentElement.closest(Qa);a&&(i||n.add(a),this.filterElements({el:a,filteredItems:t,visibleParents:n}))}allParentListItemsOpen(e){const t=e.parentElement?.closest(Xe);if(t){if(!t.open)return!1}else return!0;return this.allParentListItemsOpen(t)}updateFilteredData(e=!1){const{filterEl:t}=this;t&&(t.filteredItems&&(this.filteredData=t.filteredItems),this.updateListItems({emitFilterChange:e}))}async filterAndUpdateData(){await this.filterEl?.filter(this.filterText),this.updateFilteredData()}performFilter(){const{filterEl:e,filterText:t,filterProps:n}=this;e&&(e.value=t,e.filterProps=n,this.filterAndUpdateData())}handleNudgeEvent(e){const{handleSelector:t,dragSelector:n}=this,{direction:i}=e.detail,a=e.composedPath(),o=a.find(S=>S?.tagName&&S.matches(t)),r=a.find(S=>S?.tagName&&S.matches(n)),s=r?.parentElement;if(!s)return;const{filteredItems:l}=this,c=l.filter(S=>S.parentElement===s),h=c.length-1,u=c.indexOf(r);let y;i==="up"?y=u===0?h:u-1:y=u===h?0:u+1,this.disconnectObserver(),o.blurUnselectDisabled=!0;const m=i==="up"&&y!==h||i==="down"&&y===0?c[y]:c[y].nextSibling;s.insertBefore(r,m),this.updateListItems(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:r,fromEl:s,toEl:s,newIndex:y,oldIndex:u}),o.setFocus().then(()=>o.blurUnselectDisabled=!1)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ka}},[1,"calcite-list",{disabled:[516],canPull:[16],canPut:[16],dragEnabled:[516,"drag-enabled"],group:[513],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],filterProps:[16],messageOverrides:[1040],messages:[1040],numberingSystem:[1,"numbering-system"],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],dataForFilter:[32],hasFilterActionsEnd:[32],hasFilterActionsStart:[32],hasFilterNoResults:[32],setFocus:[64]},[[0,"calciteInternalListItemToggle","handleCalciteListItemToggle"],[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteInternalListItemActive"],[0,"calciteListItemSelect","handleCalciteListItemSelect"],[0,"calciteInternalAssistiveTextChange","handleCalciteInternalAssistiveTextChange"],[0,"calciteHandleNudge","handleCalciteHandleNudge"],[0,"calciteInternalListItemSelect","handleCalciteInternalListItemSelect"],[0,"calciteInternalListItemSelectMultiple","handleCalciteInternalListItemSelectMultiple"],[0,"calciteInternalListItemChange","handleCalciteInternalListItemChange"],[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListItemGroupDefaultSlotChange"]],{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}]);function On(){typeof customElements>"u"||["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-loader","calcite-progress","calcite-scrim","calcite-stack"].forEach(e=>{switch(e){case"calcite-list":customElements.get(e)||customElements.define(e,kn);break;case"calcite-filter":customElements.get(e)||Pn();break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-loader":customElements.get(e)||Un();break;case"calcite-progress":customElements.get(e)||nn();break;case"calcite-scrim":customElements.get(e)||Gn();break;case"calcite-stack":customElements.get(e)||In();break}})}On();const Eo=kn,wo=On;export{Eo as CalciteList,wo as defineCustomElement}; diff --git a/main/assets/calcite-list-rnu1YzAl-CPviA1UK.js b/main/assets/calcite-list-rnu1YzAl-CPviA1UK.js new file mode 100644 index 000000000..12c08b383 --- /dev/null +++ b/main/assets/calcite-list-rnu1YzAl-CPviA1UK.js @@ -0,0 +1,2 @@ +import{p as vt,b as bt,a as v,D as Nn,W as ce,h as jn}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{G as he,A as Rn}from"./dom-N58V0tYi-DBU3jlah.js";import{l as zt,p as $t}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{c as Hn}from"./observers-BigwqTsw-Du14S4xc.js";import{t as Xn}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{f as Yn,m as zn}from"./utils3-BSH0zqNl-OPNf8-Bp.js";import{o as Bt,r as Wt,f as Ut}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{l as Gt,h as Vt,d as Zt,M as Kt}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{K as Qt,q as qt,X as It}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{b as Ct,A as yt,O as $n,l as Jt,W as Et,$ as Bn,D as Wn,g as en}from"./debounce-27Hmkkyg-Th7bw3mg.js";import{m as tn}from"./icon-BXFbBbop-Du8Zws1L.js";import{z as nn,w as an,M as on}from"./input2-eOtqu-iO-CM6Z_r7O.js";import{v as Un}from"./loader-Ch7Jr16w-BlGvYEIO.js";import{c as Gn}from"./scrim-BscQh4v9-DBRj_VaE.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./form-CRSw616T-2CDQhr1H.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./guid-Dls486Er-CBh637k4.js";function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,i)}return n}function B(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function Kn(e,t){if(e==null)return{};var n=Zn(e,t),i,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Qn="1.15.3";function V(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var K=V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oe=V(/Edge/i),Dt=V(/firefox/i),Ae=V(/safari/i)&&!V(/chrome/i)&&!V(/android/i),rn=V(/iP(ad|od|hone)/i),ln=V(/chrome/i)&&V(/android/i),sn={capture:!1,passive:!1};function E(e,t,n){e.addEventListener(t,n,!K&&sn)}function b(e,t,n){e.removeEventListener(t,n,!K&&sn)}function Ue(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function cn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Y(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ue(e,t):Ue(e,t))||i&&e===n)return e;if(e===n)break}while(e=cn(e))}return null}var At=/\s+/g;function j(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(At," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(At," ")}}function f(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function Ee(e,t){var n="";if(typeof e=="string")n=e;else do{var i=f(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function dn(e,t,n){if(e){var i=e.getElementsByTagName(t),a=0,o=i.length;if(n)for(;a=o,!r)return i;if(i===$())break;i=ne(i,!1)}return!1}function we(e,t,n,i){for(var a=0,o=0,r=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,a=Kn(n,oi);Fe.pluginEvent.bind(p)(e,t,B({dragEl:d,parentEl:D,ghostEl:g,rootEl:C,nextEl:de,lastDownEl:ze,cloneEl:x,cloneHidden:te,dragStarted:Ce,putSortable:_,activeSortable:p.active,originalEvent:i,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee,hideGhostForTarget:bn,unhideGhostForTarget:yn,cloneNowHidden:function(){te=!0},cloneNowShown:function(){te=!1},dispatchSortableEvent:function(o){O({sortable:t,name:o,originalEvent:i})}},a))};function O(e){ai(B({putSortable:_,cloneEl:x,targetEl:d,rootEl:C,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee},e))}var d,D,g,C,de,ze,x,te,be,R,_e,ee,Ne,_,ve=!1,Ge=!1,Ve=[],le,X,tt,nt,Lt,Pt,Ce,ge,Le,Pe=!1,je=!1,$e,P,it=[],ht=!1,Ze=[],Qe=typeof document<"u",Re=rn,kt=Oe||K?"cssFloat":"float",ri=Qe&&!ln&&!rn&&"draggable"in document.createElement("div"),gn=function(){if(Qe){if(K)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mn=function(e,t){var n=f(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=we(e,0,t),o=we(e,1,t),r=a&&f(a),s=o&&f(o),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+T(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&r.float&&r.float!=="none"){var h=r.float==="left"?"left":"right";return o&&(s.clear==="both"||s.clear===h)?"vertical":"horizontal"}return a&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||l>=i&&n[kt]==="none"||o&&n[kt]==="none"&&l+c>i)?"vertical":"horizontal"},li=function(e,t,n){var i=n?e.left:e.top,a=n?e.right:e.bottom,o=n?e.width:e.height,r=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return i===r||a===s||i+o/2===r+l/2},si=function(e,t){var n;return Ve.some(function(i){var a=i[M].options.emptyInsertThreshold;if(!(!a||wt(i))){var o=T(i),r=e>=o.left-a&&e<=o.right+a,s=t>=o.top-a&&t<=o.bottom+a;if(r&&s)return n=i}}),n},vn=function(e){function t(a,o){return function(r,s,l,c){var h=r.options.group.name&&s.options.group.name&&r.options.group.name===s.options.group.name;if(a==null&&(o||h))return!0;if(a==null||a===!1)return!1;if(o&&a==="clone")return a;if(typeof a=="function")return t(a(r,s,l,c),o)(r,s,l,c);var u=(o?r:s).options.group.name;return a===!0||typeof a=="string"&&a===u||a.join&&a.indexOf(u)>-1}}var n={},i=e.group;(!i||Ye(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},bn=function(){!gn&&g&&f(g,"display","none")},yn=function(){!gn&&g&&f(g,"display","")};Qe&&!ln&&document.addEventListener("click",function(e){if(Ge)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ge=!1,!1},!0);var se=function(e){if(d){e=e.touches?e.touches[0]:e;var t=si(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[M]._onDragOver(n)}}},ci=function(e){d&&d.parentNode[M]._isOutsideThisEl(e.target)};function p(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Z({},t),e[M]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!Ae,emptyInsertThreshold:5};Fe.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);vn(t);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=t.forceFallback?!1:ri,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(e,"pointerdown",this._onTapStart):(E(e,"mousedown",this._onTapStart),E(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(e,"dragover",this),E(e,"dragenter",this)),Ve.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Z(this,ti())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ge=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,a=i.preventOnFilter,o=e.type,r=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=i.filter;if(vi(n),!d&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Ae&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Y(s,i.draggable,n,!1),!(s&&s.animated)&&ze!==s)){if(be=H(s),_e=H(s,i.draggable),typeof c=="function"){if(c.call(this,e,s,this)){O({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),F("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=Y(l,h.trim(),n,!1),h)return O({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),F("filter",t,{evt:e}),!0}),c)){a&&e.cancelable&&e.preventDefault();return}i.handle&&!Y(l,i.handle,n,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,n){var i=this,a=i.el,o=i.options,r=a.ownerDocument,s;if(n&&!d&&n.parentNode===a){var l=T(n);if(C=a,d=n,D=d.parentNode,de=d.nextSibling,ze=n,Ne=o.group,p.dragged=d,le={target:d,clientX:(t||e).clientX,clientY:(t||e).clientY},Lt=le.clientX-l.left,Pt=le.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,d.style["will-change"]="all",s=function(){if(F("delayEnded",i,{evt:e}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Dt&&i.nativeDraggable&&(d.draggable=!0),i._triggerDragStart(e,t),O({sortable:i,name:"choose",originalEvent:e}),j(d,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){dn(d,c.trim(),at)}),E(r,"dragover",se),E(r,"mousemove",se),E(r,"touchmove",se),E(r,"mouseup",i._onDrop),E(r,"touchend",i._onDrop),E(r,"touchcancel",i._onDrop),Dt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),F("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Oe||K))){if(p.eventCanceled){this._onDrop();return}E(r,"mouseup",i._disableDelayedDrag),E(r,"touchend",i._disableDelayedDrag),E(r,"touchcancel",i._disableDelayedDrag),E(r,"mousemove",i._delayedDragTouchMoveHandler),E(r,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&E(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,o.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&at(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):t?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(d,"dragend",this),E(C,"dragstart",this._onDragStart));try{document.selection?Be(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ve=!1,C&&d){F("dragStarted",this,{evt:t}),this.nativeDraggable&&E(document,"dragover",ci);var n=this.options;!e&&j(d,n.dragClass,!1),j(d,n.ghostClass,!0),p.active=this,e&&this._appendGhost(),O({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,bn();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(d.parentNode[M]._isOutsideThisEl(e),t)do{if(t[M]){var n=void 0;if(n=t[M]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=cn(t));yn()}},_onTouchMove:function(e){if(le){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,a=e.touches?e.touches[0]:e,o=g&&Ee(g,!0),r=g&&o&&o.a,s=g&&o&&o.d,l=Re&&P&&_t(P),c=(a.clientX-le.clientX+i.x)/(r||1)+(l?l[0]-it[0]:0)/(r||1),h=(a.clientY-le.clientY+i.y)/(s||1)+(l?l[1]-it[1]:0)/(s||1);if(!p.active&&!ve){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))=0&&(O({rootEl:D,name:"add",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"remove",toEl:D,originalEvent:e}),O({rootEl:D,name:"sort",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),_&&_.save()):R!==be&&R>=0&&(O({sortable:this,name:"update",toEl:D,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((R==null||R===-1)&&(R=be,ee=_e),O({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){F("nulling",this),C=d=D=g=de=x=ze=te=le=X=Ce=R=ee=be=_e=ge=Le=_=Ne=p.dragged=p.ghost=p.clone=p.active=null,Ze.forEach(function(e){e.checked=!0}),Ze.length=tt=nt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),di(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,a=n.length,o=this.options;ia.right+o||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>a.bottom+o||e.clientX>i.right&&e.clientY>i.top}function pi(e,t,n,i,a,o,r,s){var l=i?e.clientY:e.clientX,c=i?n.height:n.width,h=i?n.top:n.left,u=i?n.bottom:n.right,y=!1;if(!r){if(s&&$eh+c*o/2:lu-$e)return-Le}else if(l>h+c*(1-a)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function gi(e){return H(d)e.canPull({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})},...!!e.canPut&&{put:(o,r,s,{newIndex:l,oldIndex:c})=>e.canPut({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})}}},handle:i,filter:`${i}[disabled]`,onStart:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!0,wi(),e.onDragStart({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onEnd:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!1,Si(),e.onDragEnd({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onSort:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{e.onDragSort({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})}})}function wn(e){Sn(e)||(qe.delete(e),e.sortable?.destroy(),e.sortable=null)}const mt={active:!1};function Sn(e){return e.dragEnabled&&mt.active}function wi(){Array.from(qe).forEach(e=>e.onGlobalDragStart())}function Si(){Array.from(qe).forEach(e=>e.onGlobalDragEnd())}const me={container:"container",actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},ye={actionsStart:"actions-start",contentStart:"content-start",contentEnd:"content-end",actionsEnd:"actions-end"},Ii=":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}",Ci=Ii,xi=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleActionsStartSlotChange=e=>{this.hasActionsStart=he(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=he(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=he(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=he(e)},this.disabled=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasContentStart=!1,this.hasContentEnd=!1}renderActionsStart(){const{hasActionsStart:e}=this;return v("div",{class:me.actionsStart,hidden:!e,key:"actions-start-container"},v("slot",{name:ye.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{hasActionsEnd:e}=this;return v("div",{class:me.actionsEnd,hidden:!e,key:"actions-end-container"},v("slot",{name:ye.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:e}=this;return v("div",{class:me.contentStart,hidden:!e},v("slot",{name:ye.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderDefaultContent(){return v("div",{class:me.content},v("slot",null))}renderContentEnd(){const{hasContentEnd:e}=this;return v("div",{class:me.contentEnd,hidden:!e},v("slot",{name:ye.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}render(){return v(Nn,{key:"97f052828720d715fd3b11a4b0e77fa085127796"},v("div",{key:"5351cc20a8a437763894fef35ecc7a7240cb7c46",class:me.container},this.renderActionsStart(),this.renderContentStart(),this.renderDefaultContent(),this.renderContentEnd(),this.renderActionsEnd()))}static get style(){return Ci}},[1,"calcite-stack",{disabled:[516],hasActionsStart:[32],hasActionsEnd:[32],hasContentStart:[32],hasContentEnd:[32]}]);function In(){typeof customElements>"u"||["calcite-stack"].forEach(e=>{switch(e){case"calcite-stack":customElements.get(e)||customElements.define(e,xi);break}})}In();function Di(e,t){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ri}function Hi(e){return e!=null&&Dn(e.length)&&!Fi(e)}var Xi=Object.prototype;function Yi(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Xi;return e===n}function zi(e,t){for(var n=-1,i=Array(e);++n{const i=Ya(t),a=new RegExp(i,"i");e.length===0&&console.warn(`No data was passed to the filter function. + The data argument should be an array of objects`);const o=(r,s,l)=>{if(r?.constant||r?.filterDisabled)return!0;let c=!1;return za(r,(h,u)=>{typeof h=="function"||h==null||l&&!l.includes(u)||(Array.isArray(h)||typeof h=="object"&&h!==null?o(h,s)&&(c=!0):s.test(h)&&(c=!0))}),c};return e.filter(r=>o(r,a,n))},$a={container:"container",searchIcon:"search-icon"},Ba={search:"search",close:"x"},Wa=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-color-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-color-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-color-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-color-text-1)}:host([hidden]){display:none}[hidden]{display:none}",Ua=Wa,Ga=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=ce(this,"calciteFilterChange",6),this.filterDebounced=Jt((e,t=!1,n)=>this.updateFiltered(Yt(this.items??[],e,this.filterProps),t,n),jn.filter),this.inputHandler=e=>{const t=e.target;this.value=t.value,this.filterDebounced(t.value,!0)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"&&(this.clear(),e.preventDefault()),e.key==="Enter"&&e.preventDefault())},this.clear=()=>{this.value="",this.filterDebounced("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.filterProps=void 0,this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filterDebounced(this.value)}filterPropsHandler(){this.filterDebounced(this.value)}onMessagesChange(){}valueHandler(e){this.filterDebounced(e)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async componentWillLoad(){Bt(this),this.updateFiltered(Yt(this.items??[],this.value,this.filterProps)),await Vt(this)}connectedCallback(){Qt(this),Zt(this)}componentDidRender(){zt(this)}disconnectedCallback(){qt(this),Kt(this),this.filterDebounced.cancel()}componentDidLoad(){Wt(this)}async filter(e=this.value){return new Promise(t=>{this.value=e,this.filterDebounced(e,!1,t)})}async setFocus(){return await Ut(this),this.textInput?.setFocus()}updateFiltered(e,t=!1,n){this.filteredItems=e,t&&this.calciteFilterChange.emit(),n?.()}render(){const{disabled:e,scale:t}=this;return v($t,{key:"c4a624e52409ed90839b506f5d99ab623767260e",disabled:e},v("div",{key:"1f2ef99156489719dd2f938bc5ce8a05185866bf",class:$a.container},v("label",{key:"6fe8c6cf73f554908be38299263d23380a4ed089"},v("calcite-input",{key:"6765e00d208d6898221540769865d84aa1c64974",clearable:!0,disabled:e,icon:Ba.search,label:this.messages.label,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:n=>{this.textInput=n},scale:t,type:"text",value:this.value}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ua}},[17,"calcite-filter",{items:[16],disabled:[516],filteredItems:[1040],filterProps:[16],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],filter:[64],setFocus:[64]},void 0,{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function Pn(){typeof customElements>"u"||["calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-filter":customElements.get(e)||customElements.define(e,Ga);break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-progress":customElements.get(e)||nn();break}})}Pn();const J={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text"},Va=0,dt={filterNoResults:"filter-no-results",filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},Za=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{position:relative}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%;border-collapse:collapse}.stack{--calcite-stack-padding-inline:0;--calcite-stack-padding-block:0}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-z-index-sticky);background-color:var(--calcite-color-foreground-1)}.sticky-pos th{padding:0px}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}",Ka=Za,Xe="calcite-list-item",Qa="calcite-list-item-group, calcite-list-item",kn=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListChange=ce(this,"calciteListChange",6),this.calciteListDragEnd=ce(this,"calciteListDragEnd",6),this.calciteListDragStart=ce(this,"calciteListDragStart",6),this.calciteListFilter=ce(this,"calciteListFilter",6),this.calciteListOrderChange=ce(this,"calciteListOrderChange",6),this.calciteInternalListDefaultSlotChange=ce(this,"calciteInternalListDefaultSlotChange",6),this.dragSelector=Xe,this.focusableItems=[],this.handleSelector="calcite-handle",this.listItems=[],this.mutationObserver=Hn("mutation",()=>this.updateListItems({performFilter:!0})),this.visibleItems=[],this.handleDefaultSlotChange=e=>{Yn(zn(e.target)),this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()},this.handleFilterActionsStartSlotChange=e=>{this.hasFilterActionsStart=he(e)},this.handleFilterActionsEndSlotChange=e=>{this.hasFilterActionsEnd=he(e)},this.handleFilterNoResultsSlotChange=e=>{this.hasFilterNoResults=he(e)},this.setActiveListItem=()=>{const{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)},this.updateSelectedItems=(e=!1)=>{this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()},this.borderItems=()=>{const e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsOpen(t));e.forEach(t=>t.bordered=t!==e[e.length-1])},this.updateFilteredItems=(e=!1)=>{const{visibleItems:t,filteredData:n,filterText:i}=this,a=n.map(l=>l.value),o=t?.filter(l=>t.every(c=>c===l||!l.contains(c))),r=t.filter(l=>!i||a.includes(l.value))||[],s=new WeakSet;o.forEach(l=>this.filterElements({el:l,filteredItems:r,visibleParents:s})),this.filteredItems=r,e&&this.calciteListFilter.emit()},this.setFilterEl=e=>{this.filterEl=e,this.performFilter()},this.handleFilterChange=e=>{e.stopPropagation();const{value:t}=e.currentTarget;this.filterText=t,this.updateFilteredData(!0)},this.getItemData=()=>this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,value:e.value})),this.updateListItems=Jt(e=>{const t=e?.emitFilterChange??!1,n=e?.performFilter??!1,{selectionAppearance:i,selectionMode:a,dragEnabled:o,el:r,filterEl:s,filterEnabled:l}=this,c=Array.from(this.el.querySelectorAll(Xe));if(c.forEach(h=>{h.selectionAppearance=i,h.selectionMode=a,h.closest("calcite-list")===r&&(h.dragHandle=o)}),this.parentListEl){this.setUpSorting();return}this.listItems=c,l&&n&&(this.dataForFilter=this.getItemData(),s&&(s.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(h=>!h.closed&&!h.hidden),this.updateFilteredItems(t),this.borderItems(),this.focusableItems=this.filteredItems.filter(h=>!h.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()},Va),this.focusRow=e=>{const{focusableItems:t}=this;e&&(t.forEach(n=>n.active=n===e),e.setFocus())},this.isNavigable=e=>{const t=e.parentElement?.closest(Xe);return t?t.open&&this.isNavigable(t):!0},this.handleListKeydown=e=>{if(e.defaultPrevented||this.parentListEl)return;const{key:t}=e,n=this.focusableItems.filter(a=>this.isNavigable(a)),i=n.findIndex(a=>a.active);if(t==="ArrowDown"){e.preventDefault();const a=e.target===this.filterEl?0:i+1;n[a]&&this.focusRow(n[a])}else if(t==="ArrowUp"){if(e.preventDefault(),i===0&&this.filterEnabled){this.filterEl?.setFocus();return}const a=i-1;n[a]&&this.focusRow(n[a])}else if(t==="Home"){e.preventDefault();const a=n[0];a&&this.focusRow(a)}else if(t==="End"){e.preventDefault();const a=n[n.length-1];a&&this.focusRow(a)}},this.disabled=!1,this.canPull=void 0,this.canPut=void 0,this.dragEnabled=!1,this.group=void 0,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.filterProps=void 0,this.messageOverrides=void 0,this.messages=void 0,this.numberingSystem=void 0,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.effectiveLocale="",this.defaultMessages=void 0,this.assistiveText=void 0,this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1}async handleFilterTextChange(){this.performFilter()}async handleFilterPropsChange(){this.performFilter()}onMessagesChange(){}handleListItemChange(){this.updateListItems({performFilter:!0})}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();const{focusableItems:t}=this,n=t.findIndex(i=>i.active)-1;t[n]&&this.focusRow(t[n])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n}=this;n.forEach(i=>{i.active=i===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleCalciteHandleNudge(e){this.parentListEl||this.handleNudgeEvent(e)}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n,selectionMode:i}=this;t.selected&&(i==="single"||i==="single-persist")&&n.forEach(a=>a.selected=a===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();const{target:t,detail:n}=e,{focusableItems:i,lastSelectedInfo:a}=this,o=t;if(n.selectMultiple&&a){const r=i.indexOf(o),s=i.indexOf(a.selectedItem),l=Math.min(s,r),c=Math.max(s,r);i.slice(l,c+1).forEach(h=>h.selected=a.selected)}else this.lastSelectedInfo={selectedItem:o,selected:o.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.updateListItems())}handleCalciteInternalListItemGroupDefaultSlotChange(e){e.stopPropagation()}connectedCallback(){Qt(this),Zt(this),this.connectObserver(),this.updateListItems({performFilter:!0}),this.setUpSorting(),this.setParentList()}async componentWillLoad(){Bt(this),await Vt(this)}componentDidRender(){zt(this)}componentDidLoad(){Wt(this)}disconnectedCallback(){this.disconnectObserver(),wn(this),qt(this),Kt(this)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async setFocus(){return await Ut(this),this.filterEnabled?this.filterEl?.setFocus():this.focusableItems.find(e=>e.active)?.setFocus()}render(){const{loading:e,label:t,disabled:n,dataForFilter:i,filterEnabled:a,filterPlaceholder:o,filterText:r,filteredItems:s,hasFilterActionsStart:l,hasFilterActionsEnd:c,hasFilterNoResults:h,filterProps:u}=this;return v($t,{key:"c3139afe4fe7c7462578a51a4578971c97473167",disabled:this.disabled},v("div",{key:"5e99dc8b479c35609c5f0318723b3da84ec23ef4",class:J.container},this.dragEnabled?v("span",{"aria-live":"assertive",class:J.assistiveText},this.assistiveText):null,this.renderItemAriaLive(),e?v("calcite-scrim",{class:J.scrim,loading:e}):null,v("table",{key:"a31ba050d3141351e491141365e8244ed3ca5303","aria-busy":Rn(e),"aria-label":t||"",class:J.table,onKeyDown:this.handleListKeydown,role:"treegrid"},a||l||c?v("thead",{class:J.sticky},v("tr",null,v("th",{colSpan:Xn},v("calcite-stack",{class:J.stack},v("slot",{name:dt.filterActionsStart,onSlotchange:this.handleFilterActionsStartSlotChange,slot:ye.actionsStart}),v("calcite-filter",{"aria-label":o,disabled:n,filterProps:u,items:i,onCalciteFilterChange:this.handleFilterChange,placeholder:o,ref:this.setFilterEl,value:r}),v("slot",{name:dt.filterActionsEnd,onSlotchange:this.handleFilterActionsEndSlotChange,slot:ye.actionsEnd}))))):null,v("tbody",{key:"3ed1b8d9a4387c3ea0f4ff38e5388be35b32d89b",class:J.tableContainer},v("slot",{key:"712562533b4609749cbff0968bd0a9e77d99758e",onSlotchange:this.handleDefaultSlotChange}))),v("div",{key:"3ff977013e0ca0d58229e1305dca702000d91a99","aria-live":"polite","data-test-id":"no-results-container",hidden:!(h&&a&&r&&!s.length)},v("slot",{key:"7c2bf6389c8b5f4b6f617950e4068baf6b1dc358",name:dt.filterNoResults,onSlotchange:this.handleFilterNoResultsSlotChange}))))}renderItemAriaLive(){const{messages:e,filteredItems:t,parentListEl:n,effectiveLocale:i,numberingSystem:a,filterEnabled:o,filterText:r,filteredData:s}=this;return It.numberFormatOptions={locale:i,numberingSystem:a},n?null:v("div",{"aria-live":"polite",class:J.assistiveText},o&&r&&s?.length?v("div",{key:"aria-filter-enabled"},e.filterEnabled):null,v("div",{key:"aria-item-count"},e.total.replace("{count}",It.localize(t.length.toString()))),t.length?v("ol",{key:"aria-item-list"},t.map(l=>v("li",null,l.label))):null)}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){const{dragEnabled:e}=this;e&&Ei(this)}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItems(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest("calcite-list")}filterElements({el:e,filteredItems:t,visibleParents:n}){const i=!n.has(e)&&!t.includes(e);e.filterHidden=i;const a=e.parentElement.closest(Qa);a&&(i||n.add(a),this.filterElements({el:a,filteredItems:t,visibleParents:n}))}allParentListItemsOpen(e){const t=e.parentElement?.closest(Xe);if(t){if(!t.open)return!1}else return!0;return this.allParentListItemsOpen(t)}updateFilteredData(e=!1){const{filterEl:t}=this;t&&(t.filteredItems&&(this.filteredData=t.filteredItems),this.updateListItems({emitFilterChange:e}))}async filterAndUpdateData(){await this.filterEl?.filter(this.filterText),this.updateFilteredData()}performFilter(){const{filterEl:e,filterText:t,filterProps:n}=this;e&&(e.value=t,e.filterProps=n,this.filterAndUpdateData())}handleNudgeEvent(e){const{handleSelector:t,dragSelector:n}=this,{direction:i}=e.detail,a=e.composedPath(),o=a.find(S=>S?.tagName&&S.matches(t)),r=a.find(S=>S?.tagName&&S.matches(n)),s=r?.parentElement;if(!s)return;const{filteredItems:l}=this,c=l.filter(S=>S.parentElement===s),h=c.length-1,u=c.indexOf(r);let y;i==="up"?y=u===0?h:u-1:y=u===h?0:u+1,this.disconnectObserver(),o.blurUnselectDisabled=!0;const m=i==="up"&&y!==h||i==="down"&&y===0?c[y]:c[y].nextSibling;s.insertBefore(r,m),this.updateListItems(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:r,fromEl:s,toEl:s,newIndex:y,oldIndex:u}),o.setFocus().then(()=>o.blurUnselectDisabled=!1)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ka}},[1,"calcite-list",{disabled:[516],canPull:[16],canPut:[16],dragEnabled:[516,"drag-enabled"],group:[513],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],filterProps:[16],messageOverrides:[1040],messages:[1040],numberingSystem:[1,"numbering-system"],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],dataForFilter:[32],hasFilterActionsEnd:[32],hasFilterActionsStart:[32],hasFilterNoResults:[32],setFocus:[64]},[[0,"calciteInternalListItemToggle","handleCalciteListItemToggle"],[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteInternalListItemActive"],[0,"calciteListItemSelect","handleCalciteListItemSelect"],[0,"calciteInternalAssistiveTextChange","handleCalciteInternalAssistiveTextChange"],[0,"calciteHandleNudge","handleCalciteHandleNudge"],[0,"calciteInternalListItemSelect","handleCalciteInternalListItemSelect"],[0,"calciteInternalListItemSelectMultiple","handleCalciteInternalListItemSelectMultiple"],[0,"calciteInternalListItemChange","handleCalciteInternalListItemChange"],[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListItemGroupDefaultSlotChange"]],{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}]);function On(){typeof customElements>"u"||["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-loader","calcite-progress","calcite-scrim","calcite-stack"].forEach(e=>{switch(e){case"calcite-list":customElements.get(e)||customElements.define(e,kn);break;case"calcite-filter":customElements.get(e)||Pn();break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-loader":customElements.get(e)||Un();break;case"calcite-progress":customElements.get(e)||nn();break;case"calcite-scrim":customElements.get(e)||Gn();break;case"calcite-stack":customElements.get(e)||In();break}})}On();const Eo=kn,wo=On;export{Eo as CalciteList,wo as defineCustomElement}; diff --git a/main/assets/calcite-loader-CtpHSU2--CSF9hYfM.js b/main/assets/calcite-loader-CtpHSU2--CSF9hYfM.js new file mode 100644 index 000000000..c1a107072 --- /dev/null +++ b/main/assets/calcite-loader-CtpHSU2--CSF9hYfM.js @@ -0,0 +1 @@ +import{f as o,v as t}from"./loader-Ch7Jr16w-BlGvYEIO.js";import"./themeUtils-YjM7iIiX-J3djxNmP.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./locale-Cn_GDVD_-DrOI-_a9.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-Du14S4xc.js";const c=o,d=t;export{c as CalciteLoader,d as defineCustomElement}; diff --git a/main/assets/calcite-loader-CtpHSU2--Cbej2XpA.js b/main/assets/calcite-loader-CtpHSU2--Cbej2XpA.js deleted file mode 100644 index cf59ff5c7..000000000 --- a/main/assets/calcite-loader-CtpHSU2--Cbej2XpA.js +++ /dev/null @@ -1 +0,0 @@ -import{f as o,v as t}from"./loader-Ch7Jr16w-ztJ2p2Gj.js";import"./themeUtils-YjM7iIiX-xQe6qdbF.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./locale-Cn_GDVD_-CiwD7jxT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-DJJPVpPW.js";const c=o,d=t;export{c as CalciteLoader,d as defineCustomElement}; diff --git a/main/assets/calcite-notice-DeAGopAs-Cw8GCh9D.js b/main/assets/calcite-notice-DeAGopAs-Cw8GCh9D.js new file mode 100644 index 000000000..c2e0edcc5 --- /dev/null +++ b/main/assets/calcite-notice-DeAGopAs-Cw8GCh9D.js @@ -0,0 +1,11 @@ +import{p as f,b as p,W as n,a as t}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{s as b,c as u}from"./conditionalSlot-DsCzytJ4-DxmRN7Hl.js";import{b as c,w as k}from"./dom-N58V0tYi-DBU3jlah.js";import{o as v,r as x,f as w}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{K as y,q as z}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{d as C,M as E,h as q,l as N}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{p as s}from"./openCloseComponent-BGQ6h7vg-DwGQl3jY.js";import{e as a}from"./component-CWGf1hug-BASJpoEG.js";import{m as B}from"./icon-BXFbBbop-Du8Zws1L.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-Du14S4xc.js";import"./key-CZySMiwx-kmS7VeUz.js";const l={brand:"lightbulb",danger:"exclamationMarkTriangle",info:"information",success:"checkCircle",warning:"exclamationMarkTriangle"},o={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},i={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},O=`:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;background-color:var(--calcite-color-foreground-1);opacity:0;overflow:hidden;max-block-size:0;transition-property:opacity, max-block-size;transition-duration:var(--calcite-animation-timing);text-align:start;border-inline-start:var(--calcite-border-width-md) solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host{display:flex}:host([open]) .container{pointer-events:auto;max-block-size:100%;align-items:center;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);overflow:visible}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-color-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.notice-close:active{background-color:var(--calcite-color-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-color-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-color-brand)}:host([kind=info]) .container{border-color:var(--calcite-color-status-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-color-status-info)}:host([kind=danger]) .container{border-color:var(--calcite-color-status-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-color-status-danger)}:host([kind=success]) .container{border-color:var(--calcite-color-status-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-color-status-success)}:host([kind=warning]) .container{border-color:var(--calcite-color-status-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-color-status-warning)}:host([hidden]){display:none}[hidden]{display:none}`,L=O,r=f(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteNoticeBeforeClose=n(this,"calciteNoticeBeforeClose",6),this.calciteNoticeBeforeOpen=n(this,"calciteNoticeBeforeOpen",6),this.calciteNoticeClose=n(this,"calciteNoticeClose",6),this.calciteNoticeOpen=n(this,"calciteNoticeOpen",6),this.setTransitionEl=e=>{this.transitionEl=e},this.close=()=>{this.open=!1},this.openTransitionProp="opacity",this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){s(this)}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=c(l,this.icon,this.kind)}connectedCallback(){b(this),y(this),C(this)}disconnectedCallback(){u(this),z(this),E(this)}async componentWillLoad(){v(this),this.requestedIcon=c(l,this.icon,this.kind),await q(this),this.open&&s(this)}componentDidLoad(){x(this)}render(){const{el:e}=this,h=t("button",{key:"52f9306ebe945398929f68fe66615359836ba2d8","aria-label":this.messages.close,class:i.close,onClick:this.close,ref:g=>this.closeButton=g},t("calcite-icon",{key:"f3601ac9547c73219661eebc7e7470db5dee7b52",icon:"x",scale:a(this.scale)})),m=k(e,o.actionsEnd);return t("div",{key:"3f8117ff7cdd08c92ce804ef4ac8af83003156a4",class:i.container,ref:this.setTransitionEl},this.requestedIcon?t("div",{class:i.icon},t("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:a(this.scale)})):null,t("div",{key:"1b614ee86618bd5ce6e8834b466baf7d2564b5a1",class:i.content},t("slot",{key:"19467ed9718a78c7530c2a08c727028d565dee7b",name:o.title}),t("slot",{key:"191e71caf2f2147c62fd6b73602e41d95dc27558",name:o.message}),t("slot",{key:"d4fbf2b8aaa980cd24c5be89c6c8a36d091658f3",name:o.link})),m?t("div",{class:i.actionsEnd},t("slot",{name:o.actionsEnd})):null,this.closable?h:null)}async setFocus(){await w(this);const e=this.el.querySelector("calcite-link");if(!(!this.closeButton&&!e)){if(e)return e.setFocus();this.closeButton&&this.closeButton.focus()}}onBeforeClose(){this.calciteNoticeBeforeClose.emit()}onBeforeOpen(){this.calciteNoticeBeforeOpen.emit()}onClose(){this.calciteNoticeClose.emit()}onOpen(){this.calciteNoticeOpen.emit()}effectiveLocaleChange(){N(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return L}},[1,"calcite-notice",{open:[1540],kind:[513],closable:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],width:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}]);function d(){typeof customElements>"u"||["calcite-notice","calcite-icon"].forEach(e=>{switch(e){case"calcite-notice":customElements.get(e)||customElements.define(e,r);break;case"calcite-icon":customElements.get(e)||B();break}})}d();const j=r,A=d;export{j as CalciteNotice,A as defineCustomElement}; diff --git a/main/assets/calcite-notice-DeAGopAs-D67uezlU.js b/main/assets/calcite-notice-DeAGopAs-D67uezlU.js deleted file mode 100644 index 866227ace..000000000 --- a/main/assets/calcite-notice-DeAGopAs-D67uezlU.js +++ /dev/null @@ -1,11 +0,0 @@ -import{p as f,b as p,W as n,a as t}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{s as b,c as u}from"./conditionalSlot-DsCzytJ4-Ay0m1nEb.js";import{b as c,w as k}from"./dom-N58V0tYi-DBU3jlah.js";import{o as v,r as x,f as w}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{K as y,q as z}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{d as C,M as E,h as q,l as N}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{p as s}from"./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js";import{e as a}from"./component-CWGf1hug-BASJpoEG.js";import{m as B}from"./icon-BXFbBbop-O5hL8B42.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-DJJPVpPW.js";import"./key-CZySMiwx-kmS7VeUz.js";const l={brand:"lightbulb",danger:"exclamationMarkTriangle",info:"information",success:"checkCircle",warning:"exclamationMarkTriangle"},o={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},i={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},O=`:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;background-color:var(--calcite-color-foreground-1);opacity:0;overflow:hidden;max-block-size:0;transition-property:opacity, max-block-size;transition-duration:var(--calcite-animation-timing);text-align:start;border-inline-start:var(--calcite-border-width-md) solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host{display:flex}:host([open]) .container{pointer-events:auto;max-block-size:100%;align-items:center;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);overflow:visible}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-color-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.notice-close:active{background-color:var(--calcite-color-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-color-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-color-brand)}:host([kind=info]) .container{border-color:var(--calcite-color-status-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-color-status-info)}:host([kind=danger]) .container{border-color:var(--calcite-color-status-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-color-status-danger)}:host([kind=success]) .container{border-color:var(--calcite-color-status-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-color-status-success)}:host([kind=warning]) .container{border-color:var(--calcite-color-status-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-color-status-warning)}:host([hidden]){display:none}[hidden]{display:none}`,L=O,r=f(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteNoticeBeforeClose=n(this,"calciteNoticeBeforeClose",6),this.calciteNoticeBeforeOpen=n(this,"calciteNoticeBeforeOpen",6),this.calciteNoticeClose=n(this,"calciteNoticeClose",6),this.calciteNoticeOpen=n(this,"calciteNoticeOpen",6),this.setTransitionEl=e=>{this.transitionEl=e},this.close=()=>{this.open=!1},this.openTransitionProp="opacity",this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){s(this)}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=c(l,this.icon,this.kind)}connectedCallback(){b(this),y(this),C(this)}disconnectedCallback(){u(this),z(this),E(this)}async componentWillLoad(){v(this),this.requestedIcon=c(l,this.icon,this.kind),await q(this),this.open&&s(this)}componentDidLoad(){x(this)}render(){const{el:e}=this,h=t("button",{key:"52f9306ebe945398929f68fe66615359836ba2d8","aria-label":this.messages.close,class:i.close,onClick:this.close,ref:g=>this.closeButton=g},t("calcite-icon",{key:"f3601ac9547c73219661eebc7e7470db5dee7b52",icon:"x",scale:a(this.scale)})),m=k(e,o.actionsEnd);return t("div",{key:"3f8117ff7cdd08c92ce804ef4ac8af83003156a4",class:i.container,ref:this.setTransitionEl},this.requestedIcon?t("div",{class:i.icon},t("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:a(this.scale)})):null,t("div",{key:"1b614ee86618bd5ce6e8834b466baf7d2564b5a1",class:i.content},t("slot",{key:"19467ed9718a78c7530c2a08c727028d565dee7b",name:o.title}),t("slot",{key:"191e71caf2f2147c62fd6b73602e41d95dc27558",name:o.message}),t("slot",{key:"d4fbf2b8aaa980cd24c5be89c6c8a36d091658f3",name:o.link})),m?t("div",{class:i.actionsEnd},t("slot",{name:o.actionsEnd})):null,this.closable?h:null)}async setFocus(){await w(this);const e=this.el.querySelector("calcite-link");if(!(!this.closeButton&&!e)){if(e)return e.setFocus();this.closeButton&&this.closeButton.focus()}}onBeforeClose(){this.calciteNoticeBeforeClose.emit()}onBeforeOpen(){this.calciteNoticeBeforeOpen.emit()}onClose(){this.calciteNoticeClose.emit()}onOpen(){this.calciteNoticeOpen.emit()}effectiveLocaleChange(){N(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return L}},[1,"calcite-notice",{open:[1540],kind:[513],closable:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],width:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}]);function d(){typeof customElements>"u"||["calcite-notice","calcite-icon"].forEach(e=>{switch(e){case"calcite-notice":customElements.get(e)||customElements.define(e,r);break;case"calcite-icon":customElements.get(e)||B();break}})}d();const j=r,A=d;export{j as CalciteNotice,A as defineCustomElement}; diff --git a/main/assets/calcite-tooltip-63c9fmIw-C6HlFBgP.js b/main/assets/calcite-tooltip-63c9fmIw-C6HlFBgP.js deleted file mode 100644 index 5aae4bac9..000000000 --- a/main/assets/calcite-tooltip-63c9fmIw-C6HlFBgP.js +++ /dev/null @@ -1 +0,0 @@ -import{p as g,b as T,W as l,a as s,D as E}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{A as w,U as b,m as H}from"./dom-N58V0tYi-DBU3jlah.js";import{U as y,X as k,q as R,_ as C,j as d}from"./floating-ui-DKFFlLv3-DZ3_fUHw.js";import{i as L}from"./guid-Dls486Er-CBh637k4.js";import{p as c}from"./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js";import{$ as x}from"./FloatingArrow-BG9llDYg-B1DQ6cRb.js";import"./main-BZaw9FpY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const O={container:"container"},S=300,A=500,h="aria-describedby";function f(o){const{referenceElement:e}=o;return(typeof e=="string"?b(o,{id:e}):e)||null}class D{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.activeTooltip=null,this.registeredElementCount=0,this.clickedTooltip=null,this.queryTooltip=e=>{const{registeredElements:t}=this,i=e.find(n=>t.has(n));return t.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltip:t}=this;if(t?.open){this.clearHoverTimeout(),this.closeActiveTooltip();const i=f(t);i instanceof Element&&i.contains(e.target)&&e.preventDefault()}}},this.pointerMoveHandler=e=>{const t=e.composedPath(),{activeTooltip:i}=this,n=this.queryTooltip(t);if(this.pathHasOpenTooltip(n,t)){this.clearHoverTimeout();return}n!==this.clickedTooltip&&(n?this.openHoveredTooltip(n):i?.open&&this.closeHoveredTooltip(),this.clickedTooltip=null)},this.clickHandler=e=>{this.clickedTooltip=null;const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}if(this.closeActiveTooltip(),!!i){if(this.clearHoverTimeout(),i.closeOnClick){this.clickedTooltip=i,this.toggleTooltip(i,!1);return}this.toggleTooltip(i,!0)}},this.blurHandler=()=>{this.closeActiveTooltip()},this.focusInHandler=e=>{const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}this.closeTooltipIfNotActive(i),i&&this.toggleFocusedTooltip(i,!0)},this.openHoveredTooltip=e=>{this.hoverOpenTimeout=window.setTimeout(()=>{this.hoverOpenTimeout!==null&&(this.clearHoverCloseTimeout(),this.closeTooltipIfNotActive(e),this.toggleTooltip(e,!0))},this.activeTooltip?.open?0:S)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout(()=>{this.hoverCloseTimeout!==null&&this.closeActiveTooltip()},A)}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t);const i=this.getReferenceElShadowRootNode(e);i&&this.registerShadowRoot(i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){const t=this.getReferenceElShadowRootNode(e);t&&this.unregisterShadowRoot(t),this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}pathHasOpenTooltip(e,t){const{activeTooltip:i}=this;return i?.open&&t.includes(i)||e?.open&&t.includes(e)}addShadowListeners(e){e.addEventListener("focusin",this.focusInHandler,{capture:!0})}removeShadowListeners(e){e.removeEventListener("focusin",this.focusInHandler,{capture:!0})}addListeners(){window.addEventListener("keydown",this.keyDownHandler,{capture:!0}),window.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.addEventListener("click",this.clickHandler,{capture:!0}),window.addEventListener("focusin",this.focusInHandler,{capture:!0}),window.addEventListener("blur",this.blurHandler)}removeListeners(){window.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),window.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.removeEventListener("click",this.clickHandler,{capture:!0}),window.removeEventListener("focusin",this.focusInHandler,{capture:!0}),window.removeEventListener("blur",this.blurHandler)}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeTooltipIfNotActive(e){this.activeTooltip!==e&&this.closeActiveTooltip()}closeActiveTooltip(){const{activeTooltip:e}=this;e?.open&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,t){t&&this.clearHoverTimeout(),this.toggleTooltip(e,t)}toggleTooltip(e,t){e.open=t,this.activeTooltip=t?e:null}registerShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.min((typeof i=="number"?i:0)+1,1);n===1&&this.addShadowListeners(e),t.set(e,n)}unregisterShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.max((typeof i=="number"?i:1)-1,0);n===0&&this.removeShadowListeners(e),t.set(e,n)}getReferenceElShadowRootNode(e){return e instanceof Element?H(e):null}}const P=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.arrow::before{outline:1px solid var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}",z=P,p=new D,m=g(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=l(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=l(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=l(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=l(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${L()}`,this.openTransitionProp="opacity",this.setTransitionEl=o=>{this.transitionEl=o},this.setUpReferenceElement=(o=!0)=>{this.removeReferences(),this.effectiveReferenceElement=f(this.el),y(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:t,effectiveReferenceElement:i}=this;o&&t&&!i&&console.warn(`${e.tagName}: reference-element id "${t}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:o}=this;if(!o)return;const e=this.getId();"setAttribute"in o&&o.setAttribute(h,e),p.registerElement(o,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:o}=this;o&&("removeAttribute"in o&&o.removeAttribute(h),p.unregisterElement(o))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=k,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){c(this),this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(!0),this.open&&c(this)}async componentWillLoad(){this.open&&c(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement()}disconnectedCallback(){this.removeReferences(),R(this,this.effectiveReferenceElement,this.el)}async reposition(o=!1){const{el:e,effectiveReferenceElement:t,placement:i,overlayPositioning:n,offsetDistance:r,offsetSkidding:a,arrowEl:v}=this;return C(this,{floatingEl:e,referenceEl:t,overlayPositioning:n,placement:i,offsetDistance:r,offsetSkidding:a,arrowEl:v,type:"tooltip"},o)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:o,label:e,open:t,floatingLayout:i}=this,n=o&&t,r=!n;return s(E,{key:"4f097fd8c6eda6dfcd5734e5aaea1f52092501e7","aria-hidden":w(r),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":r,id:this.getId(),role:"tooltip"},s("div",{key:"6b5055ab6f95277dd4daeaaff15cb9848d85eea0",class:{[d.animation]:!0,[d.animationActive]:n},ref:this.setTransitionEl},s(x,{key:"57f68bea5a7bb369d82437f10535cab9753677ea",floatingLayout:i,ref:a=>this.arrowEl=a}),s("div",{key:"100b8318173849508952f996acaeb5bf81b8af43",class:O.container},s("slot",{key:"f89d3ae9313d9555e6a7acdc32c323de85319a3a"}))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return z}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],floatingLayout:[32],reposition:[64]},void 0,{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}]);function u(){typeof customElements>"u"||["calcite-tooltip"].forEach(o=>{switch(o){case"calcite-tooltip":customElements.get(o)||customElements.define(o,m);break}})}u();const j=m,F=u;export{j as CalciteTooltip,F as defineCustomElement}; diff --git a/main/assets/calcite-tooltip-63c9fmIw-DjinfNBS.js b/main/assets/calcite-tooltip-63c9fmIw-DjinfNBS.js new file mode 100644 index 000000000..c1fc90417 --- /dev/null +++ b/main/assets/calcite-tooltip-63c9fmIw-DjinfNBS.js @@ -0,0 +1 @@ +import{p as g,b as T,W as l,a as s,D as E}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{A as w,U as b,m as H}from"./dom-N58V0tYi-DBU3jlah.js";import{U as y,X as k,q as R,_ as C,j as d}from"./floating-ui-DKFFlLv3-B6atYKJb.js";import{i as L}from"./guid-Dls486Er-CBh637k4.js";import{p as c}from"./openCloseComponent-BGQ6h7vg-DwGQl3jY.js";import{$ as x}from"./FloatingArrow-BG9llDYg-AyYcVK-v.js";import"./main-C7yV2j71.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const O={container:"container"},S=300,A=500,h="aria-describedby";function f(o){const{referenceElement:e}=o;return(typeof e=="string"?b(o,{id:e}):e)||null}class D{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.activeTooltip=null,this.registeredElementCount=0,this.clickedTooltip=null,this.queryTooltip=e=>{const{registeredElements:t}=this,i=e.find(n=>t.has(n));return t.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltip:t}=this;if(t?.open){this.clearHoverTimeout(),this.closeActiveTooltip();const i=f(t);i instanceof Element&&i.contains(e.target)&&e.preventDefault()}}},this.pointerMoveHandler=e=>{const t=e.composedPath(),{activeTooltip:i}=this,n=this.queryTooltip(t);if(this.pathHasOpenTooltip(n,t)){this.clearHoverTimeout();return}n!==this.clickedTooltip&&(n?this.openHoveredTooltip(n):i?.open&&this.closeHoveredTooltip(),this.clickedTooltip=null)},this.clickHandler=e=>{this.clickedTooltip=null;const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}if(this.closeActiveTooltip(),!!i){if(this.clearHoverTimeout(),i.closeOnClick){this.clickedTooltip=i,this.toggleTooltip(i,!1);return}this.toggleTooltip(i,!0)}},this.blurHandler=()=>{this.closeActiveTooltip()},this.focusInHandler=e=>{const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}this.closeTooltipIfNotActive(i),i&&this.toggleFocusedTooltip(i,!0)},this.openHoveredTooltip=e=>{this.hoverOpenTimeout=window.setTimeout(()=>{this.hoverOpenTimeout!==null&&(this.clearHoverCloseTimeout(),this.closeTooltipIfNotActive(e),this.toggleTooltip(e,!0))},this.activeTooltip?.open?0:S)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout(()=>{this.hoverCloseTimeout!==null&&this.closeActiveTooltip()},A)}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t);const i=this.getReferenceElShadowRootNode(e);i&&this.registerShadowRoot(i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){const t=this.getReferenceElShadowRootNode(e);t&&this.unregisterShadowRoot(t),this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}pathHasOpenTooltip(e,t){const{activeTooltip:i}=this;return i?.open&&t.includes(i)||e?.open&&t.includes(e)}addShadowListeners(e){e.addEventListener("focusin",this.focusInHandler,{capture:!0})}removeShadowListeners(e){e.removeEventListener("focusin",this.focusInHandler,{capture:!0})}addListeners(){window.addEventListener("keydown",this.keyDownHandler,{capture:!0}),window.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.addEventListener("click",this.clickHandler,{capture:!0}),window.addEventListener("focusin",this.focusInHandler,{capture:!0}),window.addEventListener("blur",this.blurHandler)}removeListeners(){window.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),window.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.removeEventListener("click",this.clickHandler,{capture:!0}),window.removeEventListener("focusin",this.focusInHandler,{capture:!0}),window.removeEventListener("blur",this.blurHandler)}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeTooltipIfNotActive(e){this.activeTooltip!==e&&this.closeActiveTooltip()}closeActiveTooltip(){const{activeTooltip:e}=this;e?.open&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,t){t&&this.clearHoverTimeout(),this.toggleTooltip(e,t)}toggleTooltip(e,t){e.open=t,this.activeTooltip=t?e:null}registerShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.min((typeof i=="number"?i:0)+1,1);n===1&&this.addShadowListeners(e),t.set(e,n)}unregisterShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.max((typeof i=="number"?i:1)-1,0);n===0&&this.removeShadowListeners(e),t.set(e,n)}getReferenceElShadowRootNode(e){return e instanceof Element?H(e):null}}const P=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.arrow::before{outline:1px solid var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}",z=P,p=new D,m=g(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=l(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=l(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=l(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=l(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${L()}`,this.openTransitionProp="opacity",this.setTransitionEl=o=>{this.transitionEl=o},this.setUpReferenceElement=(o=!0)=>{this.removeReferences(),this.effectiveReferenceElement=f(this.el),y(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:t,effectiveReferenceElement:i}=this;o&&t&&!i&&console.warn(`${e.tagName}: reference-element id "${t}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:o}=this;if(!o)return;const e=this.getId();"setAttribute"in o&&o.setAttribute(h,e),p.registerElement(o,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:o}=this;o&&("removeAttribute"in o&&o.removeAttribute(h),p.unregisterElement(o))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=k,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){c(this),this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(!0),this.open&&c(this)}async componentWillLoad(){this.open&&c(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement()}disconnectedCallback(){this.removeReferences(),R(this,this.effectiveReferenceElement,this.el)}async reposition(o=!1){const{el:e,effectiveReferenceElement:t,placement:i,overlayPositioning:n,offsetDistance:r,offsetSkidding:a,arrowEl:v}=this;return C(this,{floatingEl:e,referenceEl:t,overlayPositioning:n,placement:i,offsetDistance:r,offsetSkidding:a,arrowEl:v,type:"tooltip"},o)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:o,label:e,open:t,floatingLayout:i}=this,n=o&&t,r=!n;return s(E,{key:"4f097fd8c6eda6dfcd5734e5aaea1f52092501e7","aria-hidden":w(r),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":r,id:this.getId(),role:"tooltip"},s("div",{key:"6b5055ab6f95277dd4daeaaff15cb9848d85eea0",class:{[d.animation]:!0,[d.animationActive]:n},ref:this.setTransitionEl},s(x,{key:"57f68bea5a7bb369d82437f10535cab9753677ea",floatingLayout:i,ref:a=>this.arrowEl=a}),s("div",{key:"100b8318173849508952f996acaeb5bf81b8af43",class:O.container},s("slot",{key:"f89d3ae9313d9555e6a7acdc32c323de85319a3a"}))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return z}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],floatingLayout:[32],reposition:[64]},void 0,{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}]);function u(){typeof customElements>"u"||["calcite-tooltip"].forEach(o=>{switch(o){case"calcite-tooltip":customElements.get(o)||customElements.define(o,m);break}})}u();const j=m,F=u;export{j as CalciteTooltip,F as defineCustomElement}; diff --git a/main/assets/chartCommon-rWfJsTPl-B8T05uOT.js b/main/assets/chartCommon-rWfJsTPl-B8T05uOT.js deleted file mode 100644 index 96433cc48..000000000 --- a/main/assets/chartCommon-rWfJsTPl-B8T05uOT.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as X,a8 as s,ab as P,e as T,c as x,U as A,s as f,H,ao as S,V as B,av as R,B as b,l as M}from"./Theme-rblUnB2V-BIrfCzYF.js";import{l as L,m as k}from"./Button-MQvwxOnj-A6j60P2U.js";import{w as E}from"./Tooltip-B0HefZ7r-DsuX4aL4.js";import{i as F}from"./ColorSet-DkIwOmgs-BZOv8dDH.js";import"./main-BZaw9FpY.js";class j extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}}class e extends X{constructor(t,i){super(t,i),Object.defineProperty(this,"_dp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._dp=new P([this._root._rootContainer.onPrivate("width",n=>{this._isUsed()&&this._maybeApplyRules()}),this._root._rootContainer.onPrivate("height",n=>{this._isUsed()&&this._maybeApplyRules()})])}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),this.responsiveRules.push(t),this._maybeApplyRule(t),t}removeRule(t){T(this.responsiveRules,t)}dispose(){this._dp&&this._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_maybeApplyRules(){x(this.responsiveRules,t=>{this._maybeUnapplyRule(t)}),x(this.responsiveRules,t=>{this._maybeApplyRule(t)})}_maybeApplyRule(t){if(t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)&&(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t))}_maybeUnapplyRule(t){if(!t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)||(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:A,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["x","minor"],relevant:e.widthXXL,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y","minor"],relevant:e.heightXXL,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});class w extends H{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=S(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=L.new(this._root,{themeTags:S(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(k.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:B.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(L.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,i=this.endGrip,n=this.thumb,o=this.get("background");o&&this._disposers.push(o.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const r=this._display.toLocal(a.point),h=this.width(),d=this.height(),u=this.get("orientation");let l,m,g;l=u=="vertical"?(r.y-n.height()/2)/d:(r.x-n.width()/2)/h,u=="vertical"?(m=l*d,g="y"):(m=l*h,g="x");const p=this.get("animationDuration",0);p>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:m,duration:p,easing:this.get("animationEasing")}))):(this.thumb.set(g,m),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!R(a.originalEvent,this))return;const r=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:r,easing:h}),this.animate({key:"end",to:1,duration:r,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._startDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._endDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),i.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(t.set("y",0),i.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}_released(){const t="released";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}updateGrips(){const t=this.startGrip,i=this.endGrip,n=this.get("orientation"),o=this.height(),a=this.width();n=="vertical"?(t.set("y",o*this.get("start",0)),i.set("y",o*this.get("end",1))):(t.set("x",a*this.get("start",0)),i.set("x",a*this.get("end",1)));const r=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),d=Math.round(100*this.get("end",0));let u,l;r?(u=r.call(this,this.get("start",0)),l=r.call(this,this.get("end",0))):(u=h+"%",l=d+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),i.set("ariaLabel",this._t("To %1",void 0,l)),i.set("ariaValueNow",""+d),i.set("ariaValueText",d+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip,o=this.height(),a=this.width();let r=i.x(),h=n.x(),d=i.y(),u=n.y(),l=0,m=1;this.get("orientation")=="vertical"?b(d)&&b(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-d),t.set("y",d)),l=d/o,m=u/o):b(r)&&b(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-r),t.set("x",r)),l=r/a,m=h/a),!this.getPrivate("isBusy")||this.get("start")==l&&this.get("end")==m||(this.set("start",l),this.set("end",m));const g=this.getPrivate("positionTextFunction"),p=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=p+"%",y=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),t.set("ariaValueNow",""+p),t.set("ariaValueText",p+"%")}_updateGripsByThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const o=t.height();i.set("y",t.y()),n.set("y",t.y()+o)}else{const o=t.width();i.set("x",t.x()),n.set("x",t.x()+o)}}}Object.defineProperty(w,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(w,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([w.className])});class G extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}}const N=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(c=>M(c));export{G as AnimatedThemeAm5,F as ColorSetAm5,j as DarkThemeAm5,e as ResponsiveThemeAm5,w as ScrollbarAm5,X as ThemeAm5,E as TooltipAm5,M as colorAm5,N as esriChartColorSet}; diff --git a/main/assets/chartCommon-rWfJsTPl-CYhSSylP.js b/main/assets/chartCommon-rWfJsTPl-CYhSSylP.js new file mode 100644 index 000000000..b34fd060b --- /dev/null +++ b/main/assets/chartCommon-rWfJsTPl-CYhSSylP.js @@ -0,0 +1 @@ +import{ar as X,a8 as s,ab as P,e as T,c as x,U as A,s as f,H,ao as S,V as B,av as R,B as b,l as M}from"./Theme-rblUnB2V-BgKdZgu2.js";import{l as L,m as k}from"./Button-MQvwxOnj-DFss60Dm.js";import{w as E}from"./Tooltip-B0HefZ7r-CwNTZqWe.js";import{i as F}from"./ColorSet-DkIwOmgs-CITJ697b.js";import"./main-C7yV2j71.js";class j extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}}class e extends X{constructor(t,i){super(t,i),Object.defineProperty(this,"_dp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._dp=new P([this._root._rootContainer.onPrivate("width",n=>{this._isUsed()&&this._maybeApplyRules()}),this._root._rootContainer.onPrivate("height",n=>{this._isUsed()&&this._maybeApplyRules()})])}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),this.responsiveRules.push(t),this._maybeApplyRule(t),t}removeRule(t){T(this.responsiveRules,t)}dispose(){this._dp&&this._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_maybeApplyRules(){x(this.responsiveRules,t=>{this._maybeUnapplyRule(t)}),x(this.responsiveRules,t=>{this._maybeApplyRule(t)})}_maybeApplyRule(t){if(t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)&&(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t))}_maybeUnapplyRule(t){if(!t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)||(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:A,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["x","minor"],relevant:e.widthXXL,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y","minor"],relevant:e.heightXXL,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});class w extends H{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=S(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=L.new(this._root,{themeTags:S(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(k.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:B.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(L.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,i=this.endGrip,n=this.thumb,o=this.get("background");o&&this._disposers.push(o.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const r=this._display.toLocal(a.point),h=this.width(),d=this.height(),u=this.get("orientation");let l,m,g;l=u=="vertical"?(r.y-n.height()/2)/d:(r.x-n.width()/2)/h,u=="vertical"?(m=l*d,g="y"):(m=l*h,g="x");const p=this.get("animationDuration",0);p>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:m,duration:p,easing:this.get("animationEasing")}))):(this.thumb.set(g,m),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!R(a.originalEvent,this))return;const r=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:r,easing:h}),this.animate({key:"end",to:1,duration:r,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._startDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._endDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),i.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(t.set("y",0),i.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}_released(){const t="released";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}updateGrips(){const t=this.startGrip,i=this.endGrip,n=this.get("orientation"),o=this.height(),a=this.width();n=="vertical"?(t.set("y",o*this.get("start",0)),i.set("y",o*this.get("end",1))):(t.set("x",a*this.get("start",0)),i.set("x",a*this.get("end",1)));const r=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),d=Math.round(100*this.get("end",0));let u,l;r?(u=r.call(this,this.get("start",0)),l=r.call(this,this.get("end",0))):(u=h+"%",l=d+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),i.set("ariaLabel",this._t("To %1",void 0,l)),i.set("ariaValueNow",""+d),i.set("ariaValueText",d+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip,o=this.height(),a=this.width();let r=i.x(),h=n.x(),d=i.y(),u=n.y(),l=0,m=1;this.get("orientation")=="vertical"?b(d)&&b(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-d),t.set("y",d)),l=d/o,m=u/o):b(r)&&b(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-r),t.set("x",r)),l=r/a,m=h/a),!this.getPrivate("isBusy")||this.get("start")==l&&this.get("end")==m||(this.set("start",l),this.set("end",m));const g=this.getPrivate("positionTextFunction"),p=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=p+"%",y=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),t.set("ariaValueNow",""+p),t.set("ariaValueText",p+"%")}_updateGripsByThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const o=t.height();i.set("y",t.y()),n.set("y",t.y()+o)}else{const o=t.width();i.set("x",t.x()),n.set("x",t.x()+o)}}}Object.defineProperty(w,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(w,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([w.className])});class G extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}}const N=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(c=>M(c));export{G as AnimatedThemeAm5,F as ColorSetAm5,j as DarkThemeAm5,e as ResponsiveThemeAm5,w as ScrollbarAm5,X as ThemeAm5,E as TooltipAm5,M as colorAm5,N as esriChartColorSet}; diff --git a/main/assets/chartUtilsAm5-CtY-kHPy-BrLMKJ5b.js b/main/assets/chartUtilsAm5-CtY-kHPy-BrLMKJ5b.js new file mode 100644 index 000000000..6d75d8d75 --- /dev/null +++ b/main/assets/chartUtilsAm5-CtY-kHPy-BrLMKJ5b.js @@ -0,0 +1 @@ +import{h as ut,_ as P}from"./main-C7yV2j71.js";import{E as te,O as ct,W as dt,z as bt,G as ft,Y as _t,R as mt,c as y,L as ie,H as Z,s as tt,U as J,K as pt,l as re,V as Fe,I as K,o as ge,a as C,b as de,j as gt,d as yt,w as we,k as se,N as vt,D as X,P as Ae,T as wt,e as ae,f as Ye,g as De,t as xt,h as Ce,v as ue,i as ye,m as Pt,n as ve,p as He,S as it,q as rt,r as Le,u as Ot,x as ee,y as Q,_ as W,F as kt,A as Et,B as H,C as Mt,J as B,Q as be,M as fe,X as Ve,Z as St,$ as Ue,a0 as Tt,a1 as jt,a2 as V,a3 as We,a4 as Dt,a5 as Bt,a6 as At,a7 as Ct,a8 as $,a9 as _e,aa as Lt,ab as Ge,ac as Be,ad as st,ae as Xe,af as zt,ag as It,ah as ke,ai as Rt,aj as Ft,ak as Yt,al as Ht,am as Vt,an as le}from"./Theme-rblUnB2V-BgKdZgu2.js";import{w as $e}from"./Tooltip-B0HefZ7r-CwNTZqWe.js";import{h as Ut}from"./DefaultTheme-Bt5OI-Ht-CMIseonm.js";class Wt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{y(e,t=>{y(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),we(this._targets,t=>t.target!==e)}}class xe{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+xe.delay)&&(r=s,y(this._targets,n=>{let l=n.target.getBoundingClientRect();l.width===n.size.width&&l.height===n.size.height||(n.size=l,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){we(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(xe,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Ee=null;function Gt(){return Ee===null&&(Ee=typeof ResizeObserver<"u"?new Wt:new xe),Ee}class Xt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Gt(),this._element=e,this._listener=it(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class pe extends te{}Object.defineProperty(pe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(pe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([pe.className])});class $t extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||ye(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(rt(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=Le(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(l.parsed)return;let d=l.source;d.toLowerCase()==="number"&&(d=this.get("numberFormat","#,###.#####"));let m=W.chunk(d,!0);for(let c=0;c=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(c[0]),a="e"+c[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){const c=kt(e);if(c>0){const f=Math.pow(10,t.decimals.passive);e=Math.round(parseFloat((e*f).toFixed(c)))/f}}let n="",l=Et(e).split("."),d=l[0];if(d.length0){let c=[],f=d.split("").reverse().join("");for(let o=0,p=d.length;o<=p;o+=t.thousands.interval){let h=f.substr(o,t.thousands.interval).split("").reverse().join("");h!==""&&c.unshift(h)}d=c.join(t.thousands.separator)}n+=d,l.length===1&&l.push("");let m=l[1];return m.length{switch(m.type){case"year":t=+m.value;break;case"month":i=+m.value-1;break;case"day":r=+m.value;break;case"hour":a=+m.value;break;case"minute":s=+m.value;break;case"second":n=+m.value;break;case"fractionalSecond":l=+m.value;break;case"weekday":switch(m.value){case"Sun":d=0;break;case"Mon":d=1;break;case"Tue":d=2;break;case"Wed":d=3;break;case"Thu":d=4;break;case"Fri":d=5;break;case"Sat":d=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l,weekday:d}}function Ne(b,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l}=at(b,e);return Date.UTC(t,i,r,a,s,n,l)}class Nt{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(Ne(this._utc,e)-Ne(this._dtf,e))/6e4}parseDate(e){return at(this._dtf,e)}}class qt extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i=!1){let r;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let a=e;if(rt(t))try{const l=this.get("intlLocales");return l?new Intl.DateTimeFormat(l,t).format(a):new Intl.DateTimeFormat(void 0,t).format(a)}catch{return"Invalid"}let s=this.parseFormat(t);const n=this._root.timezone;return!n||this._root.utc||i||(a=n.convertLocal(a)),H(a.getTime())?(r=this.applyFormat(a,s,i),this.get("capitalize")&&(r=r.replace(/^.{1}/,r.substr(0,1).toUpperCase())),r):"Invalid date"}applyFormat(e,t,i=!1){let r,a,s,n,l,d,m,c,f=t.template,o=e.getTime();this._root.utc&&!i?(r=e.getUTCFullYear(),a=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),l=e.getUTCHours(),d=e.getUTCMinutes(),m=e.getUTCSeconds(),c=e.getUTCMilliseconds()):(r=e.getFullYear(),a=e.getMonth(),s=e.getDay(),n=e.getDate(),l=e.getHours(),d=e.getMinutes(),m=e.getSeconds(),c=e.getMilliseconds());for(let p=0,h=t.parts.length;p=12?this._t("PM"):this._t("AM");break;case"aa":u=l>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":u=l>=12?this._t("P"):this._t("A");break;case"h":u=fe(l).toString();break;case"hh":u=B(fe(l),2,"0");break;case"H":u=l.toString();break;case"HH":u=B(l,2,"0");break;case"K":u=fe(l,0).toString();break;case"KK":u=B(fe(l,0),2,"0");break;case"k":u=(l+1).toString();break;case"kk":u=B(l+1,2,"0");break;case"m":u=d.toString();break;case"mm":u=B(d,2,"0");break;case"s":u=m.toString();break;case"ss":u=B(m,2,"0");break;case"S":case"SS":case"SSS":u=Math.round(c/1e3*Math.pow(10,t.parts[p].length)).toString();break;case"x":u=o.toString();break;case"n":case"nn":case"nnn":u=B(c,t.parts[p].length,"0");break;case"z":u=be(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":u=be(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":u=be(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":u=be(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let w=this._root.utc?"UTC":this._root.timezone;w instanceof Nt&&(w=w.name);const v=w?Mt(w):e.getTimezoneOffset();let _=Math.abs(v)/60,x=Math.floor(_),E=60*_-60*x;this._root.utc&&(x=0,E=0),t.parts[p]=="Z"?(u="GMT",u+=v>0?"-":"+",u+=B(x,2)+":"+B(E,2)):(u=v>0?"-":"+",u+=B(x,2)+B(E,2));break;case"i":u=e.toISOString();break;case"I":u=e.toUTCString()}f=f.replace(ee,u)}return f}parseFormat(e){let t={template:"",parts:[]},i=W.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(c[s.year])),s.year3>-1){let f=parseInt(c[s.year3]);f+=1e3,n.year=f}if(s.year2>-1){let f=parseInt(c[s.year2]);f+=f>50?1e3:2e3,n.year=f}if(s.year1>-1){let f=parseInt(c[s.year1]);f=10*Math.floor(new Date().getFullYear()/10)+f,n.year=f}if(s.monthLong>-1&&(n.month=this.resolveMonth(c[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(c[s.monthShort])),s.month>-1&&(n.month=parseInt(c[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=jt(parseInt(c[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(c[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(c[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(c[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(c[s.hourBase1])-1),s.hour12Base0>-1){let f=parseInt(c[s.hour12Base0]);f==11&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.hour12Base1>-1){let f=parseInt(c[s.hour12Base1]);f==12&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.minute>-1&&(n.minute=parseInt(c[s.minute])),s.second>-1&&(n.second=parseInt(c[s.second])),s.millisecond>-1){let f=parseInt(c[s.millisecond]);s.millisecondDigits==2?f*=10:s.millisecondDigits==1&&(f*=100),n.millisecond=f}if(s.timestamp>-1){n.timestamp=parseInt(c[s.timestamp]);const f=new Date(n.timestamp);n.year=f.getUTCFullYear(),n.month=f.getUTCMonth(),n.day=f.getUTCDate(),n.hour=f.getUTCHours(),n.minute=f.getUTCMinutes(),n.second=f.getUTCSeconds(),n.millisecond=f.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.zone])),s.iso>-1&&(n.year=V(c[s.iso+0]),n.month=V(c[s.iso+1])-1,n.day=V(c[s.iso+2]),n.hour=V(c[s.iso+3]),n.minute=V(c[s.iso+4]),n.second=V(c[s.iso+5]),n.millisecond=V(c[s.iso+6]),c[s.iso+7]=="Z"||c[s.iso+7]=="z"?n.utc=!0:c[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let l=n.source,d=[];d=n.source.match(/^\[([^\]]*)\]/),d&&d.length&&d[0]!==""&&(l=n.source.substr(d[0].length),n.color=d[1]);let m=W.chunk(l,!0);for(let c=0;c{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const nt={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(b){let e="th";if(b<11||b>13)switch(b%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Jt extends te{_setDefaults(){this.setPrivate("defaultLocale",nt),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Bt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class Me{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Kt=function(){function b(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,l=e[Symbol.iterator]();!(r=(n=l.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(d){a=!0,s=d}finally{try{!r&&l.return&&l.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return b(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Se=function(b,e,t,i,r,a,s){var n=b.x,l=b.y;return{x:i*(n*=e)-r*(l*=t)+a,y:r*n+i*l+s}},Qt=function(b,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(b),r=Math.sin(b),a=Math.cos(b+e),s=Math.sin(b+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},qe=function(b,e,t,i){var r=b*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(b*i-e*t<0?-1:1)*Math.acos(r)},ei=function(b,e,t,i,r,a,s,n,l,d,m,c){var f=Math.pow(r,2),o=Math.pow(a,2),p=Math.pow(m,2),h=Math.pow(c,2),u=f*o-f*h-o*p;u<0&&(u=0),u/=f*h+o*p;var g=(u=Math.sqrt(u)*(s===n?-1:1))*r/a*c,w=u*-a/r*m,v=d*g-l*w+(b+t)/2,_=l*g+d*w+(e+i)/2,x=(m-g)/r,E=(c-w)/a,k=(-m-g)/r,M=(-c-w)/a,j=qe(1,0,x,E),O=qe(x,E,k,M);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[v,_,j,O]},ti=function(b){var e=b.px,t=b.py,i=b.cx,r=b.cy,a=b.rx,s=b.ry,n=b.xAxisRotation,l=n===void 0?0:n,d=b.largeArcFlag,m=d===void 0?0:d,c=b.sweepFlag,f=c===void 0?0:c,o=[];if(a===0||s===0)return[];var p=Math.sin(l*he/360),h=Math.cos(l*he/360),u=h*(e-i)/2+p*(t-r)/2,g=-p*(e-i)/2+h*(t-r)/2;if(u===0&&g===0)return[];a=Math.abs(a),s=Math.abs(s);var w=Math.pow(u,2)/Math.pow(a,2)+Math.pow(g,2)/Math.pow(s,2);w>1&&(a*=Math.sqrt(w),s*=Math.sqrt(w));var v=ei(e,t,i,r,a,s,m,f,p,h,u,g),_=Kt(v,4),x=_[0],E=_[1],k=_[2],M=_[3],j=Math.abs(M)/(he/4);Math.abs(1-j)<1e-7&&(j=1);var O=Math.max(Math.ceil(j),1);M/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b.splice(t,0,r[2]),++t,r[3].length>0?b[t]=r[3]:b.splice(t,1))}if(++t,i=b[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b[t]=r[2])}}}function Ze(b){if(b===0||b===1)return b;throw new Error("Flag must be 0 or 1")}function si(b){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&b,b>>=1;return(0|e[0])+(e[1]<<8)+(e[2]<<16)}function me(b,e){for(;(!b.interactive||e(b))&&b._parent;)b=b._parent}function ai(b,e,t){return C(b,Be(e),i=>{const r=st(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(zt(a),r)):t([i],r)})}function Je(b){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(b,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+b.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(b){b.width=0,b.height=0,b.style.width="0px",b.style.height="0px"}function Ke(b){return Math.floor(b)+.5}class ni{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class Pe extends Ht{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ni}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}subStatus(e){return{inactive:this.inactive==null?e.inactive:this.inactive,layer:this._layer||e.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&K(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(e){return!e.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(e){return this._isInteractive(e)}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Ke(r),a=Ke(a)),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this.subStatus(e),i=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,s=a.context,n=this.mask;n&&n._setMatrix(),y(r,l=>{if(l){const d=l.context;d.save(),n&&(n._transformLayer(d,i,l),n._runPath(d),d.clip()),d.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(d,i,l),this.filter&&(d.filter=this.filter)}}),s.save(),n&&this._isInteractiveMask(t)&&(n._transformMargin(s,i,a.margin),n._runPath(s),s.clip()),this._transformMargin(s,i,a.margin),this._render(t),s.restore(),y(r,l=>{l&&l.context.restore()})}}_render(e){this.exportable===!1&&(e.layer.tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class oi extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(e){return this.interactiveChildren||super._isInteractiveMask(e)}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,Ae(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive,y(this._children,i=>{i.compoundAlpha=this.compoundAlpha*this.alpha,i.render(e)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),De(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&y(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&y(this._childLayers,e=>{e.dirty=!0})}}function T(b,e){b.left=Math.min(b.left,e.x),b.top=Math.min(b.top,e.y),b.right=Math.max(b.right,e.x),b.bottom=Math.max(b.bottom,e.y)}class D{colorize(e,t){}colorizeGhost(e,t){this.colorize(e,t)}path(e){}pathGhost(e){this.path(e)}addBounds(e){}}class li extends D{colorize(e,t){e.beginPath()}}class Te extends D{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class hi extends D{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class ui extends D{colorize(e,t){e.stroke()}}class je extends D{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ci extends D{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class di extends D{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class bi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;T(e,{x:t,y:i}),T(e,{x:r,y:i}),T(e,{x:t,y:a}),T(e,{x:r,y:a})}}class fi extends D{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radius,y:this.y-this.radius}),T(e,{x:this.x+this.radius,y:this.y+this.radius})}}class _i extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),T(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class mi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Vt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}class pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class gi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class yi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class vi extends D{path(e){e.closePath()}}class wi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.cpX2,y:this.cpY2}),T(e,{x:this.toX,y:this.toY})}}class xi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.toX,y:this.toY})}}class Pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}colorizeGhost(e,t){}}class Oi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){T(e,{x:this.x,y:this.y}),T(e,{x:this.width,y:this.height})}}class ki extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:It.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof $?this._pushOp(new Te(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Te(e))):this._pushOp(new Te("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new hi(this._hasShadows))}endStroke(){this._pushOp(new ui)}beginPath(){this._pushOp(new li)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof $?this._pushOp(new je(e,t.toCSS(i),r)):this._pushOp(new je(e,t,r)):this._pushOp(new je(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new ci(e||[]))}setLineDashOffset(e=0){this._pushOp(new di(e))}drawRect(e,t,i,r){this._pushOp(new bi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new fi(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new _i(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new mi(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new pi(e,t,i,r,a))}lineTo(e,t){this._pushOp(new gi(e,t))}moveTo(e,t){this._pushOp(new yi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new wi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new xi(e,t,i,r))}closePath(){this._pushOp(new vi)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new Pi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new Oi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,d=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let m;for(;(m=l.exec(e))!==null;){const c=m[1],f=m[2],o=[];for(;(m=d.exec(f))!==null;)o.push(m[1]);switch(c!=="S"&&c!=="s"&&c!=="C"&&c!=="c"&&(r=null,a=null),c!=="Q"&&c!=="q"&&c!=="T"&&c!=="t"&&(s=null,n=null),c){case"M":z(c,o.length,2),t=+o[0],i=+o[1],this.moveTo(t,i);for(let h=2;h{this.bezierCurveTo(v.x1,v.y1,v.x2,v.y2,v.x,v.y),t=v.x,i=v.y})}break;case"Z":case"z":ii(c,o.length,0),this.closePath()}}}_runPath(e){e.beginPath(),y(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=e.layer.dirty,i=this._isInteractive(e);if(t||i){const r=e.layer.context,a=this._renderer._ghostLayer.context;let s;t&&(r.globalCompositeOperation=this.blendMode,r.beginPath()),i&&(a.beginPath(),s=this._getColorId()),y(this._operations,n=>{t&&(n.path(r),n.colorize(r,void 0)),i&&(n.pathGhost(a),n.colorizeGhost(a,s))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),y(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&y(this._operations,t=>{t.addBounds(e)})}}class ot extends Pe{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.layer.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive(e)&&!t&&(a.font=n),s.fill&&(s.fill instanceof $?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.layer.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.layer.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.layer.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.layer.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive(e)&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){if(this._textInfo||this._measure(e),this.textVisible){const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),a.save(),this._prerender(e),y(this._textInfo,(s,n)=>{y(s.textChunks,(l,d)=>{if(l.style&&(i.save(),a.save(),i.font=l.style,this._isInteractive(e)&&(a.font=l.style)),l.fill&&(i.save(),i.fillStyle=l.fill.toCSS()),r&&i.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.textDecoration=="underline"||l.textDecoration=="line-through"){let m=1,c=1,f=l.height;const o=this.style.oversizedBehavior||"";if(["truncate","wrap","wrap-no-break"].indexOf(o)>-1){const u=this._measureText(l.text,i);l.width=u.actualBoundingBoxLeft+u.actualBoundingBoxRight}let p,h=l.offsetX;switch(this.style.textAlign){case"right":case"end":h-=l.width;break;case"center":h-=l.width/2}if(l.style)switch(W.getTextStyle(l.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":m=2}f&&(c=f/20),p=l.textDecoration=="line-through"?m+s.offsetY+l.offsetY-l.height/2:m+1.5*c+s.offsetY+l.offsetY,i.save(),i.beginPath(),l.fill?i.strokeStyle=l.fill.toCSS():this.style.fill&&this.style.fill instanceof $&&(i.strokeStyle=this.style.fill.toCSS()),i.lineWidth=m*c,i.moveTo(h,p),i.lineTo(h+l.width,p),i.stroke(),i.restore()}t&&this.interactive&&a.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.fill&&i.restore(),l.style&&(i.restore(),a.restore())})}),i.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure({inactive:this.inactive,layer:this.getLayer()});T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",m=this.text.toString().replace(/\r/g,"").split(/\n/);let c,f=!0,o=0,p=0,h=0;y(m,(g,w)=>{let v;for(v=g==""?[{type:"value",text:""}]:W.chunk(g,!1,this.style.ignoreFormatting);v.length>0;){let _={offsetY:h,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const x=this._measureText(d,t),E=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;let k;_.height=E,_.ascent=x.actualBoundingBoxAscent;let M,j,O,I=this.style.textDecoration,L=!1,Y=!0,N=[];Ce(v,(A,ce)=>{if(A.type=="format")if(A.text=="[/]")f||(t.restore(),i.restore(),f=!0),M=void 0,c=void 0,j=void 0,I=this.style.textDecoration,O=void 0,k=A.text;else{f||(t.restore(),i.restore());let S=W.getTextStyle(A.text);const R=this._getFontStyle(S);t.save(),i.save(),t.font=R,c=R,k=A.text,S.textDecoration&&(I=S.textDecoration),S.fill&&(M=S.fill),S.width&&(j=V(S.width)),S.verticalAlign&&(O=S.verticalAlign),f=!1;const F=this._measureText(d,t),q=F.actualBoundingBoxAscent+F.actualBoundingBoxDescent;q>_.height&&(_.height=q),F.actualBoundingBoxAscent>_.ascent&&(_.ascent=F.actualBoundingBoxAscent)}else if(A.type=="value"&&!L){const S=this._measureText(A.text,t);let R=S.actualBoundingBoxLeft+S.actualBoundingBoxRight;if(n){let U=Y||this.style.breakWords||!1;const G=this.style.ellipsis||"",Re=this._measureText(G,t),lt=Re.actualBoundingBoxLeft+Re.actualBoundingBoxRight;if(_.width+R>s){const ht=s-_.width-lt;A.text=this._truncateText(t,A.text,ht,U),A.text+=G,L=!0}}else if(l&&_.width+R>s){const U=s-_.width,G=this._truncateText(t,A.text,U,!1,Y&&this.style.oversizedBehavior!="wrap-no-break");if(G=="")return this.textVisible=!0,!1;N=v.slice(ce+1),ke(G)!=ke(A.text)&&(N.unshift({type:"value",text:A.text.substr(G.length)}),k&&N.unshift({type:"format",text:k})),A.text=ke(G),v=[],L=!0}let F=1,q=1;if(c&&j&&j>R){const U=R/j;switch(this.style.textAlign){case"right":case"end":F=U;break;case"center":F=U,q=U;break;default:q=U}R=j}const Oe=S.actualBoundingBoxAscent+S.actualBoundingBoxDescent;Oe>_.height&&(_.height=Oe),S.actualBoundingBoxAscent>_.ascent&&(_.ascent=S.actualBoundingBoxAscent),_.width+=R,_.left+=S.actualBoundingBoxLeft/F,_.right+=S.actualBoundingBoxRight/q,_.textChunks.push({style:c,fill:M,text:A.text,width:R,height:Oe,left:S.actualBoundingBoxLeft,right:S.actualBoundingBoxRight,ascent:S.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),Y=!1}return!0}),this.style.lineHeight instanceof ve?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),o<_.left&&(o=_.left),p<_.right&&(p=_.right),this._textInfo.push(_),h+=_.height,v=N||[]}}),f||(t.restore(),i.restore()),y(this._textInfo,(g,w)=>{let v=0;y(g.textChunks,_=>{if(_.offsetX=v+_.left-g.left,_.offsetY+=g.height-g.height*(this.style.baselineRatio||.19),v+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=g.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const u={left:r?-p:-o,top:0,right:r?o:p,bottom:h};if(a!=="none"){const g=this._fitRatio(u);if(g<1)if(a=="fit")H(this.style.minScale)&&gi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const l=n.height,d=i.width;r={actualBoundingBoxAscent:l,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:d,fontBoundingBoxAscent:l,fontBoundingBoxDescent:0,width:d}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class Ei{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:tt(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class Mi extends ot{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){this._prerender(e);const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),t&&a.save(),this._textInfo||this._measure(e);let s=this.radius||0,n=this.startAngle||0,l=0,d=this.orientation,m=d=="auto"?"auto":d=="inward";const c=this.inside,f=this.style.textAlign||"left",o=this.kerning||0;let p=f=="left"?1:-1;const h=!this._textReversed;if(m=="auto"){let u=0,g=0;y(this._textInfo,(w,v)=>{const _=n+w.width/(s-w.height)/2*-p;_>u&&(u=_)}),g=f=="left"?(u+l/2)*le:f=="right"?(u-l/2)*le:n*le,g=Rt(g),m=g>=270||g<=90}m==1&&h&&(this._textInfo.reverse(),this._textReversed=!0),y(this._textInfo,(u,g)=>{const w=u.height;c||(s+=w),(p==-1&&m||p==1&&!m)&&h&&u.textChunks.reverse();let v=n;l=0,f=="center"&&(v+=u.width/(s-w)/2*-p,l=v-n),v+=Math.PI*(m?0:1),i.save(),t&&a.save(),i.rotate(v),t&&a.rotate(v);let _=0;y(u.textChunks,(x,E)=>{const k=x.text,M=x.width;_=M/2/(s-w)*p,i.rotate(_),t&&a.rotate(_),x.style&&(i.save(),a.save(),i.font=x.style,t&&(a.font=x.style)),x.fill&&(i.save(),i.fillStyle=x.fill.toCSS()),i.textBaseline="middle",i.textAlign="center",t&&(a.textBaseline="middle",a.textAlign="center"),r&&i.fillText(k,0,(m?1:-1)*(0-s+w/2)),t&&a.fillText(k,0,(m?1:-1)*(0-s+w/2)),x.fill&&i.restore(),x.style&&(i.restore(),a.restore()),_=(M/2+o)/(s-w)*p,i.rotate(_),t&&a.rotate(_)}),i.restore(),t&&a.restore(),c&&(s-=w)}),i.restore(),t&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=this.style.ellipsis||"";let d;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const m=this.text.toString().replace(/\r/g,"").split(/\n/);let c=!0,f=0,o=0;return y(m,(p,h)=>{let u,g,w,v=W.chunk(p,!1,this.style.ignoreFormatting),_={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};y(v,(x,E)=>{if(x.type=="format"){if(x.text=="[/]")c||(t.restore(),i.restore(),c=!0),g=void 0,u=void 0,w=void 0;else{let k=W.getTextStyle(x.text);const M=this._getFontStyle(k);t.save(),i.save(),t.font=M,u=M,k.fill&&(g=k.fill),k.width&&(w=V(k.width)),c=!1}n&&(d=this._measureText(l,t))}else if(x.type=="value"){let k=x.text.match(/./gu)||[];r&&(k=Ft(x.text),k.reverse());for(let M=0;MI&&(I=w);const L=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(L>_.height&&(_.height=L),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),f+=I,n){d||(d=this._measureText(l,t));const Y=d.actualBoundingBoxLeft+d.actualBoundingBoxRight;if(f+Y>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=Y,_.left+=d.actualBoundingBoxLeft,_.right+=d.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:l,width:Y,height:L+d.actualBoundingBoxDescent,left:d.actualBoundingBoxLeft,right:d.actualBoundingBoxRight,ascent:d.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0}));break}}_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:j,width:I,height:L+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0})}}}),this.style.lineHeight instanceof ve?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),o+=_.height}),c||(t.restore(),i.restore()),a=="hide"&&f>s&&(this.textVisible=!1),y(this._textInfo,p=>{y(p.textChunks,h=>{h.offsetY+=Math.round((p.height-h.height+(p.ascent-h.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Si extends Pe{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){if(this.tainted===void 0&&(this.tainted=Je(this.image),e.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(e.layer.dirty){this.shadowColor&&(e.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(e.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(e.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(e.layer.context.shadowOffsetY=this.shadowOffsetY);const t=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;e.layer.context.drawImage(this.image,0,0,t,i)}if(this.interactive&&this._isInteractive(e)){const t=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(t,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Je(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class Ti{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),ge("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class ji extends At{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Di}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),y(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(it(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),ge("touchevents")){const t=i=>{this._dragging.length!==0&&Ce(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(C(window,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(C(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(C(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}ge("wheelevents")&&this._disposers.push(C(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new oi(this)}makeGraphics(){return new ki(this)}makeText(e,t){return new ot(this,e,t)}makeTextStyle(){return new Ei}makeRadialText(e,t){return new Mi(this,e,t)}makePicture(e){return new Si(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,y(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Bi(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rl.order>d.order?1:l.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render({inactive:null,layer:this.defaultLayer}),this._ghostLayer.context.restore(),y(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),y(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;y(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=si(++this._colorId),i=$.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,l={x:r-i.left,y:a-i.top},d={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new Ti(e,l,d,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=$.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}getObjectAtPoint(e){const t=this._ghostLayer.getImageArray(e);if(t[0]===0&&t[1]===0&&t[2]===0)return;const i=$.fromRGB(t[0],t[1],t[2]).toCSS();return this._colorMap[i]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,we(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{y(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{y(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;me(a,l=>{const d={id:s,value:l};return this._mousedown.push(d),!n&&this._dispatchEvent("pointerdown",l,r)&&(n=!0,this._dragging.some(m=>m.value===l&&m.id===s)||this._dragging.push(d)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&me(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=Yt(document.body,"cursor"),_e(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}removeHovering(e){this._hovering.delete(e),e.cursorOverStyle&&_e(document.body,"cursor",e._replacedCursorStyle)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(l=>{l.id===s&&l.value.contains(n)&&this._dispatchEvent(r,l.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new Lt(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new Ge([new X(()=>{r!==null&&clearTimeout(r),a()}),C(this.view,Be(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),ai(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},y(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new Ge([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{y(s,l=>{this._dispatchMousedown(l,n)})}),i=this._onPointerEvent("pointermove",s=>{y(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{y(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>C(this.view,Be("wheel"),t=>{this._dispatchWheel(t,st(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(Ae(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let o=t.minWidth/r;o>i&&(i=o*this.resolution)}if(t.minHeight&&t.minHeight>a){let o=t.minHeight/a;o>i&&(i=o*this.resolution)}if(t.maxWidth&&t.maxWidtha){let o=t.maxHeight/a;o{if(o&&o.visible&&(o.tainted||n)){f=!0,o.exportableView=o.view,o.exportableContext=o.context,o.view=document.createElement("canvas"),o.view.style.position="fixed",o.view.style.top="-10000px",this.view.appendChild(o.view),s.push(o.view);let p=0,h=0;o.margin&&(p+=o.margin.left||0+o.margin.right||0,h+=o.margin.top||0+o.margin.bottom||0),o.view.width=r+p,o.view.height=a+h,o.context=o.view.getContext("2d"),o.dirty=!0,o.scale=i}}),f&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),y(this.layers,o=>{if(o&&o.visible){let p=0,h=0;o.margin&&(p=-(o.margin.left||0)*this.resolution,h=-(o.margin.top||0)*this.resolution),d.drawImage(o.view,p,h),o.exportableView&&(o.view=o.exportableView,o.exportableView=void 0),o.exportableContext&&(o.context=o.exportableContext,o.exportableContext=void 0),m{o.style.position="",o.style.top="",this.view.removeChild(o)}),l}}class Di{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"imageArray",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){this._resolution=a,e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}getImageArray(e){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);const t=this.imageArray,i=Math.round(e.x*this._resolution),r=4*(Math.round(e.y*this._resolution)*this._width+i);return[t[r],t[r+1],t[r+2],t[r+3]]}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,y(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Bi{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Qe(b,e){b==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/b)}class ze{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyAnimation",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new dt}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Jt.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:qt.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Zt.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ft.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:_t.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=mt()),this._renderer=new ji(r),a=e instanceof HTMLElement?e:document.getElementById(e),y(ie.rootElements,l=>{if(l.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=pe.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new ze(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Z.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:tt(100),centerY:J,tooltipText:"Created using amCharts 5",tooltipX:J,cursorOverStyle:"pointer",background:pt.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=$e.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(Fe.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(Fe.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel),e.role&&this._inner.setAttribute("role",e.role));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),l=Math.floor(i.height),d=Z.new(this,{visible:!0,width:a,height:s});this._rootContainer=d,this._rootContainer._defaultThemes.push(Ut.new(this));const m=d.children.push(Z.new(this,{visible:!0,width:J,height:J}));this.container=m,t.resize(n,l,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const c=document.createElement("div");if(this._htmlElementContainer=c,c.className="am5-html-container",c.style.position="absolute",c.style.pointerEvents="none",this._tooltipContainerSettings||(c.style.overflow="hidden"),this._inner.appendChild(c),this._a11yD!==!0){const f=document.createElement("div");f.className="am5-reader-container",f.setAttribute("role","alert"),f.style.position="absolute",f.style.width="1px",f.style.height="1px",f.style.overflow="hidden",f.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=f,this._inner.appendChild(this._readerAlertElement);const o=document.createElement("div");o.className="am5-focus-container",o.style.position="absolute",o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.width=a+"px",o.style.height=s+"px",o.setAttribute("role","graphics-document"),K(o,!1),this._focusElementContainer=o,this._inner.appendChild(this._focusElementContainer);const p=document.createElement("div");this._tooltipElementContainer=p,p.className="am5-tooltip-container",this._inner.appendChild(p),ge("keyboardevents")&&(this._disposers.push(C(window,"keydown",h=>{const u=de(h);u=="Shift"?this._isShift=!0:u=="Tab"&&(this._isShift=h.shiftKey)})),this._disposers.push(C(window,"keyup",h=>{de(h)=="Shift"&&(this._isShift=!1)})),this._disposers.push(C(o,"click",()=>{const h=this._focusedSprite;if(h){const u=t.getEvent(new MouseEvent("click"));h.events.dispatch("click",{type:"click",originalEvent:u.event,point:u.point,simulated:!0,target:h})}})),this._disposers.push(C(o,"keydown",h=>{const u=this._focusedSprite;if(u){h.key=="Escape"&&(gt(),this._focusedSprite=void 0);let g=0,w=0;const v=de(h);switch(v){case"Enter":case" ":if(v==" "&&u.get("role")!="checkbox")return;h.preventDefault();const _=t.getEvent(new MouseEvent("mouse"));return void u.events.dispatch("click",{type:"click",originalEvent:_.event,point:_.point,simulated:!0,target:u});case"ArrowLeft":g=-6;break;case"ArrowRight":g=6;break;case"ArrowUp":w=-6;break;case"ArrowDown":w=6;break;default:return}if(g!=0||w!=0){if(h.preventDefault(),!u.isDragging()){this._keyboardDragPoint={x:0,y:0};const E=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));E.point={x:0,y:0},u.events.isEnabled("pointerdown")&&u.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:E.event,point:E.point,simulated:!0,target:u})}const _=this._keyboardDragPoint;_.x+=g,_.y+=w;const x=t.getEvent(new MouseEvent("mousemove",{clientX:_.x,clientY:_.y}),!1);u.events.isEnabled("globalpointermove")&&u.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:x.event,point:x.point,simulated:!0,target:u})}}})),this._disposers.push(C(o,"keyup",h=>{if(this._focusedSprite){const u=this._focusedSprite,g=de(h);switch(g){case"ArrowLeft":case"ArrowRight":case"ArrowTop":case"ArrowDown":if(u.isDragging()){const w=this._keyboardDragPoint,v=t.getEvent(new MouseEvent("mouseup",{clientX:w.x,clientY:w.y}));return u.events.isEnabled("globalpointerup")&&u.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:v.event,point:v.point,simulated:!0,target:u}),void(this._keyboardDragPoint=void 0)}if(u.get("focusableGroup")){const w=u.get("focusableGroup"),v=this._tabindexes.filter(E=>!(E.get("focusableGroup")!=w||E.getPrivate("focusable")===!1||!E.isVisibleDeep()));let _=v.indexOf(u);const x=v.length-1;_+=g=="ArrowRight"||g=="ArrowDown"?1:-1,_<0?_=x:_>x&&(_=0),yt(v[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Xt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const d=this._focusElementContainer;d.style.width=i+"px",d.style.height=r+"px"}this._renderer.resize(a,s,i,r);const l=this._rootContainer;l.setPrivate("width",i),l.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){y(this._tickers,t=>{t(e)})}_runAnimations(e){let t=0;return we(this._animations,i=>{const r=i._runAnimation(e);return r!==Xe.Stopped&&(r!==Xe.Playing||(++t,!0))}),this._isDirtyAnimation=!1,t===0}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>vt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e);const t=this._runAnimations(e);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&t&&!this._isDirtyAnimation&&!this._isDirty}return!0}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Qe(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Qe(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._isDirty=!0,this._dirty[e.uid]===void 0&&(this._dirty[e.uid]=e),this._startTicker()}_addDirtyParent(e){this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]===void 0&&(this._dirtyParents[e.uid]=e),this._startTicker()}_addDirtyBounds(e){this._isDirty=!0,this._dirtyBounds[e.uid]===void 0&&(this._dirtyBounds[e.uid]=e),this._startTicker()}_addDirtyPosition(e){this._isDirty=!0,this._dirtyPositions[e.uid]===void 0&&(this._dirtyPositions[e.uid]=e),this._startTicker()}_addAnimation(e){this._isDirtyAnimation=!0,this._animations.indexOf(e)===-1&&this._animations.push(e),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{Ae(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Z&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),y(this._disposers,e=>{e.dispose()}),this._inner&&wt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ye(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Z.new(this,{position:"absolute",isMeasured:!1,width:J,height:J,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=$e.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?De(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];y(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const h=xt(e,r);t.setAttribute("aria-label",h)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked");const n=e.get("ariaCurrent");n!=null?t.setAttribute("aria-current",n):t.removeAttribute("aria-current");const l=e.get("ariaSelected");l!=null&&i&&["gridcell","option","row","tab","columnheader","rowheader","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-selected",l?"true":"false"):t.removeAttribute("aria-selected"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const d=e.get("ariaOrientation");d?t.setAttribute("aria-orientation",d):t.removeAttribute("aria-orientation");const m=e.get("ariaValueNow");m?t.setAttribute("aria-valuenow",m):t.removeAttribute("aria-valuenow");const c=e.get("ariaValueMin");c?t.setAttribute("aria-valuemin",c):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const o=e.get("ariaValueText");o?t.setAttribute("aria-valuetext",o):t.removeAttribute("aria-valuetext");const p=e.get("ariaControls");p?t.setAttribute("aria-controls",p):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",K(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(C(i,"focus",a=>{this._handleFocus(a)})),r.push(C(i,"blur",a=>{this._handleBlur(a)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),y(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top;const a=this._settings.focusPadding!==void 0?this._settings.focusPadding:2;let s=t.left-a,n=t.top-a;i<0&&(s+=i,i=Math.abs(i)),r<0&&(n+=r,r=Math.abs(r));const l=e.getPrivate("focusElement").dom;l.style.top=n+"px",l.style.left=s+"px",l.style.width=i+2*a+"px",l.style.height=r+2*a+"px"}_getSpriteByFocusElement(e){let t;return Ce(this._tabindexes,(i,r)=>i.getPrivate("focusElement").dom!==e||(t=i,!1)),t}_handleFocus(e){if(this._a11yD==1)return;const t=this._getSpriteByFocusElement(e.target);t&&(t.isVisibleDeep()?(this._positionFocusElement(t),this._focusedSprite=t,t.events.isEnabled("focus")&&t.events.dispatch("focus",{type:"focus",originalEvent:e,target:t})):this._focusNext(e.target,this._isShift?-1:1))}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e){if(this._a11yD==1)return;const t=this._focusedSprite;t&&!t.isDisposed()&&t.events.isEnabled("blur")&&t.events.dispatch("blur",{type:"blur",originalEvent:e,target:t}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ye(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t),i.setAttribute("aria-hidden",e.isVisibleDeep()?"false":"true")):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",K(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{ye(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Z?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof Pt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),De(this._htmlEnabledContainers,e),i}_positionHTMLElements(){y(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){y(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],u=>{const g=e.get(u);t.style[u]=g?g+"px":""});const i=e.compositeScale()||1,r=e.compositeRotation()||0;t.style.transform="",t.style.transformOrigin="";const a=e.compositeOpacity();setTimeout(()=>{t.style.opacity=a+""},10);const s=e.isVisibleDeep();s&&(t.style.display="block");let n={x:e.x(),y:e.y()};e.parent&&(n=e.parent.toGlobal(n)),t.style.top=n.y+"px",t.style.left=n.x+"px";const l=e.get("width"),d=e.get("height");let m=0,c=0;if(l&&(m=e.width()),d&&(c=e.height()),!l||!d){t.style.position="fixed",t.style.width="",t.style.height="";const u=t.getBoundingClientRect();t.style.position="absolute",l||(m=u.width),d||(c=u.height);let g=m/i,w=c/i,v=e.get("centerX",0),_=e.get("centerY",0),x=0,E=0,k=0,M=0;v instanceof ve?(x=-v.value*g,E=(1-v.value)*g):(x=-v,E=g-v),_ instanceof ve?(k=-_.value*w,M=(1-_.value)*w):(k=-_,M=w-_),e._localBounds={left:x,right:E,top:k,bottom:M};let j=e._adjustedLocalBounds,O=e._display.getAdjustedBounds(e._localBounds);e._adjustedLocalBounds=O,j.left===O.left&&j.right===O.right&&j.top===O.top&&j.bottom===O.bottom||e.markDirtyBounds()}m>0&&(t.style.minWidth=m+"px"),c>0&&(t.style.minHeight=c+"px"),s&&a!=0||(t.style.display="none");const f=e.get("centerX",0),o=He(f)?f.percent+"%":f+"px",p=e.get("centerY",0),h=He(p)?p.percent+"%":p+"px";(f||p)&&(t.style.transform="translate(-"+o+", -"+h+")"+t.style.transform),i!=1&&(t.style.transform+="scale("+i+")"),r!=0&&(t.style.transform+=" rotate("+r+"deg)"),t.style.transform!=""&&(t.style.transformOrigin=o+" "+h)}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&(this._htmlElementContainer.removeChild(t),e.removePrivate("htmlElement")),ae(this._htmlEnabledContainers,e)}}ct("AM5C241025748");const et="en-us",Ie=new Map([["ar",()=>P(()=>import("./ar-69w_pNvD-7lDIs8Pw.js"),[],import.meta.url)],["bg-bg",()=>P(()=>import("./bg_BG-HxX0GdS4-O8Kpb0zp.js"),[],import.meta.url)],["bs-ba",()=>P(()=>import("./bs_BA-DrqKjqQh-Cr-VUOtJ.js"),[],import.meta.url)],["ca-es",()=>P(()=>import("./ca_ES-B8P53VJs-DWC4n8NA.js"),[],import.meta.url)],["cs-cz",()=>P(()=>import("./cs_CZ-Bqde4kKV-CyqqX6ir.js"),[],import.meta.url)],["da-dk",()=>P(()=>import("./da_DK-BHlKtWuS-2ex9kBWh.js"),[],import.meta.url)],["de-de",()=>P(()=>import("./de_DE-BjuOMedt-BF1_XBt7.js"),[],import.meta.url)],["de-ch",()=>P(()=>import("./de_CH-DAPp1Ncl-B97rjhoW.js"),[],import.meta.url)],["el-gr",()=>P(()=>import("./el_GR-C1WdWwt2-BN9c0-aL.js"),[],import.meta.url)],["en-us",()=>P(()=>import("./en_US-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["en-ca",()=>P(()=>import("./en_CA-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["es-es",()=>P(()=>import("./es_ES-D1FgMsXM-_3WcXaQ2.js"),[],import.meta.url)],["et-ee",()=>P(()=>import("./et_EE-Dz_TpNNF-F7kgGek-.js"),[],import.meta.url)],["fi-fi",()=>P(()=>import("./fi_FI-Cte3XVjc-Bozs9Z2H.js"),[],import.meta.url)],["fr-fr",()=>P(()=>import("./fr_FR-D4Jnvm3b-BkfBDc1T.js"),[],import.meta.url)],["he-il",()=>P(()=>import("./he_IL-DcsZ56bm-B900khEo.js"),[],import.meta.url)],["hr-hr",()=>P(()=>import("./hr_HR-C0BJtvO7-BXNws4dg.js"),[],import.meta.url)],["hu-hu",()=>P(()=>import("./hu_HU-BGreOcqI-BPCtb03x.js"),[],import.meta.url)],["id-id",()=>P(()=>import("./id_ID-DCZBbKD3-Bk2oUsUi.js"),[],import.meta.url)],["it-it",()=>P(()=>import("./it_IT-BeKgphnk-BU_dnupK.js"),[],import.meta.url)],["ja-jp",()=>P(()=>import("./ja_JP-gzKc2xa8-BjWjUZZi.js"),[],import.meta.url)],["ko-kr",()=>P(()=>import("./ko_KR-sv9FjurR-C63G07Pj.js"),[],import.meta.url)],["lt-lt",()=>P(()=>import("./lt_LT-yZNULmv_-DHDBnlgq.js"),[],import.meta.url)],["lv-lv",()=>P(()=>import("./lv_LV-Cu8aigXF-BGX5_oyM.js"),[],import.meta.url)],["nb-no",()=>P(()=>import("./nb_NO-CqN3wUJH-BVuLzJb0.js"),[],import.meta.url)],["nl-nl",()=>P(()=>import("./nl_NL-DAiuag9r-DiE2F1Fx.js"),[],import.meta.url)],["pl-pl",()=>P(()=>import("./pl_PL-BDbrX9O9-CCCo8oJV.js"),[],import.meta.url)],["pt-br",()=>P(()=>import("./pt_BR-D3fc0auN-ClOz39JC.js"),[],import.meta.url)],["pt-pt",()=>P(()=>import("./pt_PT-ne3A0-MZ-CugZtzXR.js"),[],import.meta.url)],["ro-ro",()=>P(()=>import("./ro_RO-BfLaePMk-D4DP893q.js"),[],import.meta.url)],["ru-ru",()=>P(()=>import("./ru_RU-jSaqVZwA-TpCrDGWK.js"),[],import.meta.url)],["sk-sk",()=>P(()=>import("./sk_SK-Dp9r7-Al-CP61SfDR.js"),[],import.meta.url)],["sl-sl",()=>P(()=>import("./sl_SL-CArbvniK-hZyOU_tZ.js"),[],import.meta.url)],["sr-rs",()=>P(()=>import("./sr_RS-KKcjmG1u-BY82CeQm.js"),[],import.meta.url)],["sv-se",()=>P(()=>import("./sv_SE-CT8Rd8gJ-CRc7K9Uw.js"),[],import.meta.url)],["th-th",()=>P(()=>import("./th_TH-DHvdpgHD-CZOpdnuT.js"),[],import.meta.url)],["tr-tr",()=>P(()=>import("./tr_TR-CooWKX5o-BqZDkyaY.js"),[],import.meta.url)],["uk-ua",()=>P(()=>import("./uk_UA-D4LhzxxY-iB1TkjZJ.js"),[],import.meta.url)],["vi-vn",()=>P(()=>import("./vi_VN-Byu5lfYa-DrrDewoL.js"),[],import.meta.url)],["zh-cn",()=>P(()=>import("./zh_Hans-DQ0VpKp5-DN9wG9bm.js"),[],import.meta.url)],["zh-hk",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)],["zh-tw",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)]]);function Ai(b){const e=b.split("-")[0].toLowerCase();let t=null;for(const i of Ie.keys())if(i.startsWith(e)){t=i;break}return t}function Ci(b){return b?Ie.has(b.toLowerCase())?b.toLowerCase():Ai(b)||et:et}async function Fi(b,e=ut()){const t=ze.new(b);return t.locale=(await Ie.get(Ci(e))()).default,t}export{Fi as createRoot}; diff --git a/main/assets/chartUtilsAm5-CtY-kHPy-Dkmz_Xm3.js b/main/assets/chartUtilsAm5-CtY-kHPy-Dkmz_Xm3.js deleted file mode 100644 index 604d81688..000000000 --- a/main/assets/chartUtilsAm5-CtY-kHPy-Dkmz_Xm3.js +++ /dev/null @@ -1 +0,0 @@ -import{h as ut,_ as P}from"./main-BZaw9FpY.js";import{E as te,O as ct,W as dt,z as bt,G as ft,Y as _t,R as mt,c as y,L as ie,H as Z,s as tt,U as J,K as pt,l as re,V as Fe,I as K,o as ge,a as C,b as de,j as gt,d as yt,w as we,k as se,N as vt,D as X,P as Ae,T as wt,e as ae,f as Ye,g as De,t as xt,h as Ce,v as ue,i as ye,m as Pt,n as ve,p as He,S as it,q as rt,r as Le,u as Ot,x as ee,y as Q,_ as W,F as kt,A as Et,B as H,C as Mt,J as B,Q as be,M as fe,X as Ve,Z as St,$ as Ue,a0 as Tt,a1 as jt,a2 as V,a3 as We,a4 as Dt,a5 as Bt,a6 as At,a7 as Ct,a8 as $,a9 as _e,aa as Lt,ab as Ge,ac as Be,ad as st,ae as Xe,af as zt,ag as It,ah as ke,ai as Rt,aj as Ft,ak as Yt,al as Ht,am as Vt,an as le}from"./Theme-rblUnB2V-BIrfCzYF.js";import{w as $e}from"./Tooltip-B0HefZ7r-DsuX4aL4.js";import{h as Ut}from"./DefaultTheme-Bt5OI-Ht-D4nvY2Bb.js";class Wt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{y(e,t=>{y(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),we(this._targets,t=>t.target!==e)}}class xe{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+xe.delay)&&(r=s,y(this._targets,n=>{let l=n.target.getBoundingClientRect();l.width===n.size.width&&l.height===n.size.height||(n.size=l,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){we(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(xe,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Ee=null;function Gt(){return Ee===null&&(Ee=typeof ResizeObserver<"u"?new Wt:new xe),Ee}class Xt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Gt(),this._element=e,this._listener=it(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class pe extends te{}Object.defineProperty(pe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(pe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([pe.className])});class $t extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||ye(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(rt(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=Le(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(l.parsed)return;let d=l.source;d.toLowerCase()==="number"&&(d=this.get("numberFormat","#,###.#####"));let m=W.chunk(d,!0);for(let c=0;c=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(c[0]),a="e"+c[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){const c=kt(e);if(c>0){const f=Math.pow(10,t.decimals.passive);e=Math.round(parseFloat((e*f).toFixed(c)))/f}}let n="",l=Et(e).split("."),d=l[0];if(d.length0){let c=[],f=d.split("").reverse().join("");for(let o=0,p=d.length;o<=p;o+=t.thousands.interval){let h=f.substr(o,t.thousands.interval).split("").reverse().join("");h!==""&&c.unshift(h)}d=c.join(t.thousands.separator)}n+=d,l.length===1&&l.push("");let m=l[1];return m.length{switch(m.type){case"year":t=+m.value;break;case"month":i=+m.value-1;break;case"day":r=+m.value;break;case"hour":a=+m.value;break;case"minute":s=+m.value;break;case"second":n=+m.value;break;case"fractionalSecond":l=+m.value;break;case"weekday":switch(m.value){case"Sun":d=0;break;case"Mon":d=1;break;case"Tue":d=2;break;case"Wed":d=3;break;case"Thu":d=4;break;case"Fri":d=5;break;case"Sat":d=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l,weekday:d}}function Ne(b,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l}=at(b,e);return Date.UTC(t,i,r,a,s,n,l)}class Nt{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(Ne(this._utc,e)-Ne(this._dtf,e))/6e4}parseDate(e){return at(this._dtf,e)}}class qt extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i=!1){let r;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let a=e;if(rt(t))try{const l=this.get("intlLocales");return l?new Intl.DateTimeFormat(l,t).format(a):new Intl.DateTimeFormat(void 0,t).format(a)}catch{return"Invalid"}let s=this.parseFormat(t);const n=this._root.timezone;return!n||this._root.utc||i||(a=n.convertLocal(a)),H(a.getTime())?(r=this.applyFormat(a,s,i),this.get("capitalize")&&(r=r.replace(/^.{1}/,r.substr(0,1).toUpperCase())),r):"Invalid date"}applyFormat(e,t,i=!1){let r,a,s,n,l,d,m,c,f=t.template,o=e.getTime();this._root.utc&&!i?(r=e.getUTCFullYear(),a=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),l=e.getUTCHours(),d=e.getUTCMinutes(),m=e.getUTCSeconds(),c=e.getUTCMilliseconds()):(r=e.getFullYear(),a=e.getMonth(),s=e.getDay(),n=e.getDate(),l=e.getHours(),d=e.getMinutes(),m=e.getSeconds(),c=e.getMilliseconds());for(let p=0,h=t.parts.length;p=12?this._t("PM"):this._t("AM");break;case"aa":u=l>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":u=l>=12?this._t("P"):this._t("A");break;case"h":u=fe(l).toString();break;case"hh":u=B(fe(l),2,"0");break;case"H":u=l.toString();break;case"HH":u=B(l,2,"0");break;case"K":u=fe(l,0).toString();break;case"KK":u=B(fe(l,0),2,"0");break;case"k":u=(l+1).toString();break;case"kk":u=B(l+1,2,"0");break;case"m":u=d.toString();break;case"mm":u=B(d,2,"0");break;case"s":u=m.toString();break;case"ss":u=B(m,2,"0");break;case"S":case"SS":case"SSS":u=Math.round(c/1e3*Math.pow(10,t.parts[p].length)).toString();break;case"x":u=o.toString();break;case"n":case"nn":case"nnn":u=B(c,t.parts[p].length,"0");break;case"z":u=be(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":u=be(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":u=be(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":u=be(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let w=this._root.utc?"UTC":this._root.timezone;w instanceof Nt&&(w=w.name);const v=w?Mt(w):e.getTimezoneOffset();let _=Math.abs(v)/60,x=Math.floor(_),E=60*_-60*x;this._root.utc&&(x=0,E=0),t.parts[p]=="Z"?(u="GMT",u+=v>0?"-":"+",u+=B(x,2)+":"+B(E,2)):(u=v>0?"-":"+",u+=B(x,2)+B(E,2));break;case"i":u=e.toISOString();break;case"I":u=e.toUTCString()}f=f.replace(ee,u)}return f}parseFormat(e){let t={template:"",parts:[]},i=W.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(c[s.year])),s.year3>-1){let f=parseInt(c[s.year3]);f+=1e3,n.year=f}if(s.year2>-1){let f=parseInt(c[s.year2]);f+=f>50?1e3:2e3,n.year=f}if(s.year1>-1){let f=parseInt(c[s.year1]);f=10*Math.floor(new Date().getFullYear()/10)+f,n.year=f}if(s.monthLong>-1&&(n.month=this.resolveMonth(c[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(c[s.monthShort])),s.month>-1&&(n.month=parseInt(c[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=jt(parseInt(c[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(c[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(c[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(c[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(c[s.hourBase1])-1),s.hour12Base0>-1){let f=parseInt(c[s.hour12Base0]);f==11&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.hour12Base1>-1){let f=parseInt(c[s.hour12Base1]);f==12&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.minute>-1&&(n.minute=parseInt(c[s.minute])),s.second>-1&&(n.second=parseInt(c[s.second])),s.millisecond>-1){let f=parseInt(c[s.millisecond]);s.millisecondDigits==2?f*=10:s.millisecondDigits==1&&(f*=100),n.millisecond=f}if(s.timestamp>-1){n.timestamp=parseInt(c[s.timestamp]);const f=new Date(n.timestamp);n.year=f.getUTCFullYear(),n.month=f.getUTCMonth(),n.day=f.getUTCDate(),n.hour=f.getUTCHours(),n.minute=f.getUTCMinutes(),n.second=f.getUTCSeconds(),n.millisecond=f.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.zone])),s.iso>-1&&(n.year=V(c[s.iso+0]),n.month=V(c[s.iso+1])-1,n.day=V(c[s.iso+2]),n.hour=V(c[s.iso+3]),n.minute=V(c[s.iso+4]),n.second=V(c[s.iso+5]),n.millisecond=V(c[s.iso+6]),c[s.iso+7]=="Z"||c[s.iso+7]=="z"?n.utc=!0:c[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let l=n.source,d=[];d=n.source.match(/^\[([^\]]*)\]/),d&&d.length&&d[0]!==""&&(l=n.source.substr(d[0].length),n.color=d[1]);let m=W.chunk(l,!0);for(let c=0;c{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const nt={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(b){let e="th";if(b<11||b>13)switch(b%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Jt extends te{_setDefaults(){this.setPrivate("defaultLocale",nt),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Bt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class Me{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Kt=function(){function b(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,l=e[Symbol.iterator]();!(r=(n=l.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(d){a=!0,s=d}finally{try{!r&&l.return&&l.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return b(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Se=function(b,e,t,i,r,a,s){var n=b.x,l=b.y;return{x:i*(n*=e)-r*(l*=t)+a,y:r*n+i*l+s}},Qt=function(b,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(b),r=Math.sin(b),a=Math.cos(b+e),s=Math.sin(b+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},qe=function(b,e,t,i){var r=b*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(b*i-e*t<0?-1:1)*Math.acos(r)},ei=function(b,e,t,i,r,a,s,n,l,d,m,c){var f=Math.pow(r,2),o=Math.pow(a,2),p=Math.pow(m,2),h=Math.pow(c,2),u=f*o-f*h-o*p;u<0&&(u=0),u/=f*h+o*p;var g=(u=Math.sqrt(u)*(s===n?-1:1))*r/a*c,w=u*-a/r*m,v=d*g-l*w+(b+t)/2,_=l*g+d*w+(e+i)/2,x=(m-g)/r,E=(c-w)/a,k=(-m-g)/r,M=(-c-w)/a,j=qe(1,0,x,E),O=qe(x,E,k,M);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[v,_,j,O]},ti=function(b){var e=b.px,t=b.py,i=b.cx,r=b.cy,a=b.rx,s=b.ry,n=b.xAxisRotation,l=n===void 0?0:n,d=b.largeArcFlag,m=d===void 0?0:d,c=b.sweepFlag,f=c===void 0?0:c,o=[];if(a===0||s===0)return[];var p=Math.sin(l*he/360),h=Math.cos(l*he/360),u=h*(e-i)/2+p*(t-r)/2,g=-p*(e-i)/2+h*(t-r)/2;if(u===0&&g===0)return[];a=Math.abs(a),s=Math.abs(s);var w=Math.pow(u,2)/Math.pow(a,2)+Math.pow(g,2)/Math.pow(s,2);w>1&&(a*=Math.sqrt(w),s*=Math.sqrt(w));var v=ei(e,t,i,r,a,s,m,f,p,h,u,g),_=Kt(v,4),x=_[0],E=_[1],k=_[2],M=_[3],j=Math.abs(M)/(he/4);Math.abs(1-j)<1e-7&&(j=1);var O=Math.max(Math.ceil(j),1);M/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b.splice(t,0,r[2]),++t,r[3].length>0?b[t]=r[3]:b.splice(t,1))}if(++t,i=b[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b[t]=r[2])}}}function Ze(b){if(b===0||b===1)return b;throw new Error("Flag must be 0 or 1")}function si(b){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&b,b>>=1;return(0|e[0])+(e[1]<<8)+(e[2]<<16)}function me(b,e){for(;(!b.interactive||e(b))&&b._parent;)b=b._parent}function ai(b,e,t){return C(b,Be(e),i=>{const r=st(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(zt(a),r)):t([i],r)})}function Je(b){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(b,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+b.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(b){b.width=0,b.height=0,b.style.width="0px",b.style.height="0px"}function Ke(b){return Math.floor(b)+.5}class ni{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class Pe extends Ht{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ni}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}subStatus(e){return{inactive:this.inactive==null?e.inactive:this.inactive,layer:this._layer||e.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&K(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(e){return!e.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(e){return this._isInteractive(e)}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Ke(r),a=Ke(a)),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this.subStatus(e),i=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,s=a.context,n=this.mask;n&&n._setMatrix(),y(r,l=>{if(l){const d=l.context;d.save(),n&&(n._transformLayer(d,i,l),n._runPath(d),d.clip()),d.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(d,i,l),this.filter&&(d.filter=this.filter)}}),s.save(),n&&this._isInteractiveMask(t)&&(n._transformMargin(s,i,a.margin),n._runPath(s),s.clip()),this._transformMargin(s,i,a.margin),this._render(t),s.restore(),y(r,l=>{l&&l.context.restore()})}}_render(e){this.exportable===!1&&(e.layer.tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class oi extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(e){return this.interactiveChildren||super._isInteractiveMask(e)}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,Ae(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive,y(this._children,i=>{i.compoundAlpha=this.compoundAlpha*this.alpha,i.render(e)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),De(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&y(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&y(this._childLayers,e=>{e.dirty=!0})}}function T(b,e){b.left=Math.min(b.left,e.x),b.top=Math.min(b.top,e.y),b.right=Math.max(b.right,e.x),b.bottom=Math.max(b.bottom,e.y)}class D{colorize(e,t){}colorizeGhost(e,t){this.colorize(e,t)}path(e){}pathGhost(e){this.path(e)}addBounds(e){}}class li extends D{colorize(e,t){e.beginPath()}}class Te extends D{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class hi extends D{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class ui extends D{colorize(e,t){e.stroke()}}class je extends D{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ci extends D{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class di extends D{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class bi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;T(e,{x:t,y:i}),T(e,{x:r,y:i}),T(e,{x:t,y:a}),T(e,{x:r,y:a})}}class fi extends D{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radius,y:this.y-this.radius}),T(e,{x:this.x+this.radius,y:this.y+this.radius})}}class _i extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),T(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class mi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Vt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}class pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class gi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class yi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class vi extends D{path(e){e.closePath()}}class wi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.cpX2,y:this.cpY2}),T(e,{x:this.toX,y:this.toY})}}class xi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.toX,y:this.toY})}}class Pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}colorizeGhost(e,t){}}class Oi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){T(e,{x:this.x,y:this.y}),T(e,{x:this.width,y:this.height})}}class ki extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:It.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof $?this._pushOp(new Te(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Te(e))):this._pushOp(new Te("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new hi(this._hasShadows))}endStroke(){this._pushOp(new ui)}beginPath(){this._pushOp(new li)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof $?this._pushOp(new je(e,t.toCSS(i),r)):this._pushOp(new je(e,t,r)):this._pushOp(new je(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new ci(e||[]))}setLineDashOffset(e=0){this._pushOp(new di(e))}drawRect(e,t,i,r){this._pushOp(new bi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new fi(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new _i(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new mi(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new pi(e,t,i,r,a))}lineTo(e,t){this._pushOp(new gi(e,t))}moveTo(e,t){this._pushOp(new yi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new wi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new xi(e,t,i,r))}closePath(){this._pushOp(new vi)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new Pi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new Oi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,d=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let m;for(;(m=l.exec(e))!==null;){const c=m[1],f=m[2],o=[];for(;(m=d.exec(f))!==null;)o.push(m[1]);switch(c!=="S"&&c!=="s"&&c!=="C"&&c!=="c"&&(r=null,a=null),c!=="Q"&&c!=="q"&&c!=="T"&&c!=="t"&&(s=null,n=null),c){case"M":z(c,o.length,2),t=+o[0],i=+o[1],this.moveTo(t,i);for(let h=2;h{this.bezierCurveTo(v.x1,v.y1,v.x2,v.y2,v.x,v.y),t=v.x,i=v.y})}break;case"Z":case"z":ii(c,o.length,0),this.closePath()}}}_runPath(e){e.beginPath(),y(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=e.layer.dirty,i=this._isInteractive(e);if(t||i){const r=e.layer.context,a=this._renderer._ghostLayer.context;let s;t&&(r.globalCompositeOperation=this.blendMode,r.beginPath()),i&&(a.beginPath(),s=this._getColorId()),y(this._operations,n=>{t&&(n.path(r),n.colorize(r,void 0)),i&&(n.pathGhost(a),n.colorizeGhost(a,s))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),y(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&y(this._operations,t=>{t.addBounds(e)})}}class ot extends Pe{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.layer.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive(e)&&!t&&(a.font=n),s.fill&&(s.fill instanceof $?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.layer.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.layer.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.layer.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.layer.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive(e)&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){if(this._textInfo||this._measure(e),this.textVisible){const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),a.save(),this._prerender(e),y(this._textInfo,(s,n)=>{y(s.textChunks,(l,d)=>{if(l.style&&(i.save(),a.save(),i.font=l.style,this._isInteractive(e)&&(a.font=l.style)),l.fill&&(i.save(),i.fillStyle=l.fill.toCSS()),r&&i.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.textDecoration=="underline"||l.textDecoration=="line-through"){let m=1,c=1,f=l.height;const o=this.style.oversizedBehavior||"";if(["truncate","wrap","wrap-no-break"].indexOf(o)>-1){const u=this._measureText(l.text,i);l.width=u.actualBoundingBoxLeft+u.actualBoundingBoxRight}let p,h=l.offsetX;switch(this.style.textAlign){case"right":case"end":h-=l.width;break;case"center":h-=l.width/2}if(l.style)switch(W.getTextStyle(l.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":m=2}f&&(c=f/20),p=l.textDecoration=="line-through"?m+s.offsetY+l.offsetY-l.height/2:m+1.5*c+s.offsetY+l.offsetY,i.save(),i.beginPath(),l.fill?i.strokeStyle=l.fill.toCSS():this.style.fill&&this.style.fill instanceof $&&(i.strokeStyle=this.style.fill.toCSS()),i.lineWidth=m*c,i.moveTo(h,p),i.lineTo(h+l.width,p),i.stroke(),i.restore()}t&&this.interactive&&a.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.fill&&i.restore(),l.style&&(i.restore(),a.restore())})}),i.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure({inactive:this.inactive,layer:this.getLayer()});T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",m=this.text.toString().replace(/\r/g,"").split(/\n/);let c,f=!0,o=0,p=0,h=0;y(m,(g,w)=>{let v;for(v=g==""?[{type:"value",text:""}]:W.chunk(g,!1,this.style.ignoreFormatting);v.length>0;){let _={offsetY:h,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const x=this._measureText(d,t),E=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;let k;_.height=E,_.ascent=x.actualBoundingBoxAscent;let M,j,O,I=this.style.textDecoration,L=!1,Y=!0,N=[];Ce(v,(A,ce)=>{if(A.type=="format")if(A.text=="[/]")f||(t.restore(),i.restore(),f=!0),M=void 0,c=void 0,j=void 0,I=this.style.textDecoration,O=void 0,k=A.text;else{f||(t.restore(),i.restore());let S=W.getTextStyle(A.text);const R=this._getFontStyle(S);t.save(),i.save(),t.font=R,c=R,k=A.text,S.textDecoration&&(I=S.textDecoration),S.fill&&(M=S.fill),S.width&&(j=V(S.width)),S.verticalAlign&&(O=S.verticalAlign),f=!1;const F=this._measureText(d,t),q=F.actualBoundingBoxAscent+F.actualBoundingBoxDescent;q>_.height&&(_.height=q),F.actualBoundingBoxAscent>_.ascent&&(_.ascent=F.actualBoundingBoxAscent)}else if(A.type=="value"&&!L){const S=this._measureText(A.text,t);let R=S.actualBoundingBoxLeft+S.actualBoundingBoxRight;if(n){let U=Y||this.style.breakWords||!1;const G=this.style.ellipsis||"",Re=this._measureText(G,t),lt=Re.actualBoundingBoxLeft+Re.actualBoundingBoxRight;if(_.width+R>s){const ht=s-_.width-lt;A.text=this._truncateText(t,A.text,ht,U),A.text+=G,L=!0}}else if(l&&_.width+R>s){const U=s-_.width,G=this._truncateText(t,A.text,U,!1,Y&&this.style.oversizedBehavior!="wrap-no-break");if(G=="")return this.textVisible=!0,!1;N=v.slice(ce+1),ke(G)!=ke(A.text)&&(N.unshift({type:"value",text:A.text.substr(G.length)}),k&&N.unshift({type:"format",text:k})),A.text=ke(G),v=[],L=!0}let F=1,q=1;if(c&&j&&j>R){const U=R/j;switch(this.style.textAlign){case"right":case"end":F=U;break;case"center":F=U,q=U;break;default:q=U}R=j}const Oe=S.actualBoundingBoxAscent+S.actualBoundingBoxDescent;Oe>_.height&&(_.height=Oe),S.actualBoundingBoxAscent>_.ascent&&(_.ascent=S.actualBoundingBoxAscent),_.width+=R,_.left+=S.actualBoundingBoxLeft/F,_.right+=S.actualBoundingBoxRight/q,_.textChunks.push({style:c,fill:M,text:A.text,width:R,height:Oe,left:S.actualBoundingBoxLeft,right:S.actualBoundingBoxRight,ascent:S.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),Y=!1}return!0}),this.style.lineHeight instanceof ve?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),o<_.left&&(o=_.left),p<_.right&&(p=_.right),this._textInfo.push(_),h+=_.height,v=N||[]}}),f||(t.restore(),i.restore()),y(this._textInfo,(g,w)=>{let v=0;y(g.textChunks,_=>{if(_.offsetX=v+_.left-g.left,_.offsetY+=g.height-g.height*(this.style.baselineRatio||.19),v+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=g.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const u={left:r?-p:-o,top:0,right:r?o:p,bottom:h};if(a!=="none"){const g=this._fitRatio(u);if(g<1)if(a=="fit")H(this.style.minScale)&&gi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const l=n.height,d=i.width;r={actualBoundingBoxAscent:l,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:d,fontBoundingBoxAscent:l,fontBoundingBoxDescent:0,width:d}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class Ei{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:tt(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class Mi extends ot{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){this._prerender(e);const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),t&&a.save(),this._textInfo||this._measure(e);let s=this.radius||0,n=this.startAngle||0,l=0,d=this.orientation,m=d=="auto"?"auto":d=="inward";const c=this.inside,f=this.style.textAlign||"left",o=this.kerning||0;let p=f=="left"?1:-1;const h=!this._textReversed;if(m=="auto"){let u=0,g=0;y(this._textInfo,(w,v)=>{const _=n+w.width/(s-w.height)/2*-p;_>u&&(u=_)}),g=f=="left"?(u+l/2)*le:f=="right"?(u-l/2)*le:n*le,g=Rt(g),m=g>=270||g<=90}m==1&&h&&(this._textInfo.reverse(),this._textReversed=!0),y(this._textInfo,(u,g)=>{const w=u.height;c||(s+=w),(p==-1&&m||p==1&&!m)&&h&&u.textChunks.reverse();let v=n;l=0,f=="center"&&(v+=u.width/(s-w)/2*-p,l=v-n),v+=Math.PI*(m?0:1),i.save(),t&&a.save(),i.rotate(v),t&&a.rotate(v);let _=0;y(u.textChunks,(x,E)=>{const k=x.text,M=x.width;_=M/2/(s-w)*p,i.rotate(_),t&&a.rotate(_),x.style&&(i.save(),a.save(),i.font=x.style,t&&(a.font=x.style)),x.fill&&(i.save(),i.fillStyle=x.fill.toCSS()),i.textBaseline="middle",i.textAlign="center",t&&(a.textBaseline="middle",a.textAlign="center"),r&&i.fillText(k,0,(m?1:-1)*(0-s+w/2)),t&&a.fillText(k,0,(m?1:-1)*(0-s+w/2)),x.fill&&i.restore(),x.style&&(i.restore(),a.restore()),_=(M/2+o)/(s-w)*p,i.rotate(_),t&&a.rotate(_)}),i.restore(),t&&a.restore(),c&&(s-=w)}),i.restore(),t&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=this.style.ellipsis||"";let d;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const m=this.text.toString().replace(/\r/g,"").split(/\n/);let c=!0,f=0,o=0;return y(m,(p,h)=>{let u,g,w,v=W.chunk(p,!1,this.style.ignoreFormatting),_={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};y(v,(x,E)=>{if(x.type=="format"){if(x.text=="[/]")c||(t.restore(),i.restore(),c=!0),g=void 0,u=void 0,w=void 0;else{let k=W.getTextStyle(x.text);const M=this._getFontStyle(k);t.save(),i.save(),t.font=M,u=M,k.fill&&(g=k.fill),k.width&&(w=V(k.width)),c=!1}n&&(d=this._measureText(l,t))}else if(x.type=="value"){let k=x.text.match(/./gu)||[];r&&(k=Ft(x.text),k.reverse());for(let M=0;MI&&(I=w);const L=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(L>_.height&&(_.height=L),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),f+=I,n){d||(d=this._measureText(l,t));const Y=d.actualBoundingBoxLeft+d.actualBoundingBoxRight;if(f+Y>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=Y,_.left+=d.actualBoundingBoxLeft,_.right+=d.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:l,width:Y,height:L+d.actualBoundingBoxDescent,left:d.actualBoundingBoxLeft,right:d.actualBoundingBoxRight,ascent:d.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0}));break}}_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:j,width:I,height:L+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0})}}}),this.style.lineHeight instanceof ve?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),o+=_.height}),c||(t.restore(),i.restore()),a=="hide"&&f>s&&(this.textVisible=!1),y(this._textInfo,p=>{y(p.textChunks,h=>{h.offsetY+=Math.round((p.height-h.height+(p.ascent-h.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Si extends Pe{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){if(this.tainted===void 0&&(this.tainted=Je(this.image),e.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(e.layer.dirty){this.shadowColor&&(e.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(e.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(e.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(e.layer.context.shadowOffsetY=this.shadowOffsetY);const t=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;e.layer.context.drawImage(this.image,0,0,t,i)}if(this.interactive&&this._isInteractive(e)){const t=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(t,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Je(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class Ti{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),ge("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class ji extends At{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Di}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),y(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(it(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),ge("touchevents")){const t=i=>{this._dragging.length!==0&&Ce(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(C(window,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(C(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(C(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}ge("wheelevents")&&this._disposers.push(C(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new oi(this)}makeGraphics(){return new ki(this)}makeText(e,t){return new ot(this,e,t)}makeTextStyle(){return new Ei}makeRadialText(e,t){return new Mi(this,e,t)}makePicture(e){return new Si(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,y(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Bi(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rl.order>d.order?1:l.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render({inactive:null,layer:this.defaultLayer}),this._ghostLayer.context.restore(),y(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),y(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;y(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=si(++this._colorId),i=$.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,l={x:r-i.left,y:a-i.top},d={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new Ti(e,l,d,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=$.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}getObjectAtPoint(e){const t=this._ghostLayer.getImageArray(e);if(t[0]===0&&t[1]===0&&t[2]===0)return;const i=$.fromRGB(t[0],t[1],t[2]).toCSS();return this._colorMap[i]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,we(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{y(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{y(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;me(a,l=>{const d={id:s,value:l};return this._mousedown.push(d),!n&&this._dispatchEvent("pointerdown",l,r)&&(n=!0,this._dragging.some(m=>m.value===l&&m.id===s)||this._dragging.push(d)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&me(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=Yt(document.body,"cursor"),_e(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}removeHovering(e){this._hovering.delete(e),e.cursorOverStyle&&_e(document.body,"cursor",e._replacedCursorStyle)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(l=>{l.id===s&&l.value.contains(n)&&this._dispatchEvent(r,l.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new Lt(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new Ge([new X(()=>{r!==null&&clearTimeout(r),a()}),C(this.view,Be(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),ai(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},y(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new Ge([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{y(s,l=>{this._dispatchMousedown(l,n)})}),i=this._onPointerEvent("pointermove",s=>{y(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{y(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>C(this.view,Be("wheel"),t=>{this._dispatchWheel(t,st(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(Ae(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let o=t.minWidth/r;o>i&&(i=o*this.resolution)}if(t.minHeight&&t.minHeight>a){let o=t.minHeight/a;o>i&&(i=o*this.resolution)}if(t.maxWidth&&t.maxWidtha){let o=t.maxHeight/a;o{if(o&&o.visible&&(o.tainted||n)){f=!0,o.exportableView=o.view,o.exportableContext=o.context,o.view=document.createElement("canvas"),o.view.style.position="fixed",o.view.style.top="-10000px",this.view.appendChild(o.view),s.push(o.view);let p=0,h=0;o.margin&&(p+=o.margin.left||0+o.margin.right||0,h+=o.margin.top||0+o.margin.bottom||0),o.view.width=r+p,o.view.height=a+h,o.context=o.view.getContext("2d"),o.dirty=!0,o.scale=i}}),f&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),y(this.layers,o=>{if(o&&o.visible){let p=0,h=0;o.margin&&(p=-(o.margin.left||0)*this.resolution,h=-(o.margin.top||0)*this.resolution),d.drawImage(o.view,p,h),o.exportableView&&(o.view=o.exportableView,o.exportableView=void 0),o.exportableContext&&(o.context=o.exportableContext,o.exportableContext=void 0),m{o.style.position="",o.style.top="",this.view.removeChild(o)}),l}}class Di{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"imageArray",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){this._resolution=a,e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}getImageArray(e){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);const t=this.imageArray,i=Math.round(e.x*this._resolution),r=4*(Math.round(e.y*this._resolution)*this._width+i);return[t[r],t[r+1],t[r+2],t[r+3]]}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,y(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Bi{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Qe(b,e){b==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/b)}class ze{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyAnimation",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new dt}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Jt.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:qt.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Zt.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ft.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:_t.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=mt()),this._renderer=new ji(r),a=e instanceof HTMLElement?e:document.getElementById(e),y(ie.rootElements,l=>{if(l.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=pe.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new ze(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Z.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:tt(100),centerY:J,tooltipText:"Created using amCharts 5",tooltipX:J,cursorOverStyle:"pointer",background:pt.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=$e.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(Fe.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(Fe.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel),e.role&&this._inner.setAttribute("role",e.role));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),l=Math.floor(i.height),d=Z.new(this,{visible:!0,width:a,height:s});this._rootContainer=d,this._rootContainer._defaultThemes.push(Ut.new(this));const m=d.children.push(Z.new(this,{visible:!0,width:J,height:J}));this.container=m,t.resize(n,l,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const c=document.createElement("div");if(this._htmlElementContainer=c,c.className="am5-html-container",c.style.position="absolute",c.style.pointerEvents="none",this._tooltipContainerSettings||(c.style.overflow="hidden"),this._inner.appendChild(c),this._a11yD!==!0){const f=document.createElement("div");f.className="am5-reader-container",f.setAttribute("role","alert"),f.style.position="absolute",f.style.width="1px",f.style.height="1px",f.style.overflow="hidden",f.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=f,this._inner.appendChild(this._readerAlertElement);const o=document.createElement("div");o.className="am5-focus-container",o.style.position="absolute",o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.width=a+"px",o.style.height=s+"px",o.setAttribute("role","graphics-document"),K(o,!1),this._focusElementContainer=o,this._inner.appendChild(this._focusElementContainer);const p=document.createElement("div");this._tooltipElementContainer=p,p.className="am5-tooltip-container",this._inner.appendChild(p),ge("keyboardevents")&&(this._disposers.push(C(window,"keydown",h=>{const u=de(h);u=="Shift"?this._isShift=!0:u=="Tab"&&(this._isShift=h.shiftKey)})),this._disposers.push(C(window,"keyup",h=>{de(h)=="Shift"&&(this._isShift=!1)})),this._disposers.push(C(o,"click",()=>{const h=this._focusedSprite;if(h){const u=t.getEvent(new MouseEvent("click"));h.events.dispatch("click",{type:"click",originalEvent:u.event,point:u.point,simulated:!0,target:h})}})),this._disposers.push(C(o,"keydown",h=>{const u=this._focusedSprite;if(u){h.key=="Escape"&&(gt(),this._focusedSprite=void 0);let g=0,w=0;const v=de(h);switch(v){case"Enter":case" ":if(v==" "&&u.get("role")!="checkbox")return;h.preventDefault();const _=t.getEvent(new MouseEvent("mouse"));return void u.events.dispatch("click",{type:"click",originalEvent:_.event,point:_.point,simulated:!0,target:u});case"ArrowLeft":g=-6;break;case"ArrowRight":g=6;break;case"ArrowUp":w=-6;break;case"ArrowDown":w=6;break;default:return}if(g!=0||w!=0){if(h.preventDefault(),!u.isDragging()){this._keyboardDragPoint={x:0,y:0};const E=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));E.point={x:0,y:0},u.events.isEnabled("pointerdown")&&u.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:E.event,point:E.point,simulated:!0,target:u})}const _=this._keyboardDragPoint;_.x+=g,_.y+=w;const x=t.getEvent(new MouseEvent("mousemove",{clientX:_.x,clientY:_.y}),!1);u.events.isEnabled("globalpointermove")&&u.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:x.event,point:x.point,simulated:!0,target:u})}}})),this._disposers.push(C(o,"keyup",h=>{if(this._focusedSprite){const u=this._focusedSprite,g=de(h);switch(g){case"ArrowLeft":case"ArrowRight":case"ArrowTop":case"ArrowDown":if(u.isDragging()){const w=this._keyboardDragPoint,v=t.getEvent(new MouseEvent("mouseup",{clientX:w.x,clientY:w.y}));return u.events.isEnabled("globalpointerup")&&u.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:v.event,point:v.point,simulated:!0,target:u}),void(this._keyboardDragPoint=void 0)}if(u.get("focusableGroup")){const w=u.get("focusableGroup"),v=this._tabindexes.filter(E=>!(E.get("focusableGroup")!=w||E.getPrivate("focusable")===!1||!E.isVisibleDeep()));let _=v.indexOf(u);const x=v.length-1;_+=g=="ArrowRight"||g=="ArrowDown"?1:-1,_<0?_=x:_>x&&(_=0),yt(v[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Xt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const d=this._focusElementContainer;d.style.width=i+"px",d.style.height=r+"px"}this._renderer.resize(a,s,i,r);const l=this._rootContainer;l.setPrivate("width",i),l.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){y(this._tickers,t=>{t(e)})}_runAnimations(e){let t=0;return we(this._animations,i=>{const r=i._runAnimation(e);return r!==Xe.Stopped&&(r!==Xe.Playing||(++t,!0))}),this._isDirtyAnimation=!1,t===0}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>vt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e);const t=this._runAnimations(e);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&t&&!this._isDirtyAnimation&&!this._isDirty}return!0}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Qe(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Qe(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._isDirty=!0,this._dirty[e.uid]===void 0&&(this._dirty[e.uid]=e),this._startTicker()}_addDirtyParent(e){this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]===void 0&&(this._dirtyParents[e.uid]=e),this._startTicker()}_addDirtyBounds(e){this._isDirty=!0,this._dirtyBounds[e.uid]===void 0&&(this._dirtyBounds[e.uid]=e),this._startTicker()}_addDirtyPosition(e){this._isDirty=!0,this._dirtyPositions[e.uid]===void 0&&(this._dirtyPositions[e.uid]=e),this._startTicker()}_addAnimation(e){this._isDirtyAnimation=!0,this._animations.indexOf(e)===-1&&this._animations.push(e),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{Ae(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Z&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),y(this._disposers,e=>{e.dispose()}),this._inner&&wt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ye(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Z.new(this,{position:"absolute",isMeasured:!1,width:J,height:J,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=$e.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?De(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];y(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const h=xt(e,r);t.setAttribute("aria-label",h)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked");const n=e.get("ariaCurrent");n!=null?t.setAttribute("aria-current",n):t.removeAttribute("aria-current");const l=e.get("ariaSelected");l!=null&&i&&["gridcell","option","row","tab","columnheader","rowheader","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-selected",l?"true":"false"):t.removeAttribute("aria-selected"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const d=e.get("ariaOrientation");d?t.setAttribute("aria-orientation",d):t.removeAttribute("aria-orientation");const m=e.get("ariaValueNow");m?t.setAttribute("aria-valuenow",m):t.removeAttribute("aria-valuenow");const c=e.get("ariaValueMin");c?t.setAttribute("aria-valuemin",c):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const o=e.get("ariaValueText");o?t.setAttribute("aria-valuetext",o):t.removeAttribute("aria-valuetext");const p=e.get("ariaControls");p?t.setAttribute("aria-controls",p):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",K(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(C(i,"focus",a=>{this._handleFocus(a)})),r.push(C(i,"blur",a=>{this._handleBlur(a)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),y(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top;const a=this._settings.focusPadding!==void 0?this._settings.focusPadding:2;let s=t.left-a,n=t.top-a;i<0&&(s+=i,i=Math.abs(i)),r<0&&(n+=r,r=Math.abs(r));const l=e.getPrivate("focusElement").dom;l.style.top=n+"px",l.style.left=s+"px",l.style.width=i+2*a+"px",l.style.height=r+2*a+"px"}_getSpriteByFocusElement(e){let t;return Ce(this._tabindexes,(i,r)=>i.getPrivate("focusElement").dom!==e||(t=i,!1)),t}_handleFocus(e){if(this._a11yD==1)return;const t=this._getSpriteByFocusElement(e.target);t&&(t.isVisibleDeep()?(this._positionFocusElement(t),this._focusedSprite=t,t.events.isEnabled("focus")&&t.events.dispatch("focus",{type:"focus",originalEvent:e,target:t})):this._focusNext(e.target,this._isShift?-1:1))}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e){if(this._a11yD==1)return;const t=this._focusedSprite;t&&!t.isDisposed()&&t.events.isEnabled("blur")&&t.events.dispatch("blur",{type:"blur",originalEvent:e,target:t}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ye(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t),i.setAttribute("aria-hidden",e.isVisibleDeep()?"false":"true")):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",K(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{ye(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Z?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof Pt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),De(this._htmlEnabledContainers,e),i}_positionHTMLElements(){y(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){y(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],u=>{const g=e.get(u);t.style[u]=g?g+"px":""});const i=e.compositeScale()||1,r=e.compositeRotation()||0;t.style.transform="",t.style.transformOrigin="";const a=e.compositeOpacity();setTimeout(()=>{t.style.opacity=a+""},10);const s=e.isVisibleDeep();s&&(t.style.display="block");let n={x:e.x(),y:e.y()};e.parent&&(n=e.parent.toGlobal(n)),t.style.top=n.y+"px",t.style.left=n.x+"px";const l=e.get("width"),d=e.get("height");let m=0,c=0;if(l&&(m=e.width()),d&&(c=e.height()),!l||!d){t.style.position="fixed",t.style.width="",t.style.height="";const u=t.getBoundingClientRect();t.style.position="absolute",l||(m=u.width),d||(c=u.height);let g=m/i,w=c/i,v=e.get("centerX",0),_=e.get("centerY",0),x=0,E=0,k=0,M=0;v instanceof ve?(x=-v.value*g,E=(1-v.value)*g):(x=-v,E=g-v),_ instanceof ve?(k=-_.value*w,M=(1-_.value)*w):(k=-_,M=w-_),e._localBounds={left:x,right:E,top:k,bottom:M};let j=e._adjustedLocalBounds,O=e._display.getAdjustedBounds(e._localBounds);e._adjustedLocalBounds=O,j.left===O.left&&j.right===O.right&&j.top===O.top&&j.bottom===O.bottom||e.markDirtyBounds()}m>0&&(t.style.minWidth=m+"px"),c>0&&(t.style.minHeight=c+"px"),s&&a!=0||(t.style.display="none");const f=e.get("centerX",0),o=He(f)?f.percent+"%":f+"px",p=e.get("centerY",0),h=He(p)?p.percent+"%":p+"px";(f||p)&&(t.style.transform="translate(-"+o+", -"+h+")"+t.style.transform),i!=1&&(t.style.transform+="scale("+i+")"),r!=0&&(t.style.transform+=" rotate("+r+"deg)"),t.style.transform!=""&&(t.style.transformOrigin=o+" "+h)}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&(this._htmlElementContainer.removeChild(t),e.removePrivate("htmlElement")),ae(this._htmlEnabledContainers,e)}}ct("AM5C241025748");const et="en-us",Ie=new Map([["ar",()=>P(()=>import("./ar-69w_pNvD-7lDIs8Pw.js"),[],import.meta.url)],["bg-bg",()=>P(()=>import("./bg_BG-HxX0GdS4-O8Kpb0zp.js"),[],import.meta.url)],["bs-ba",()=>P(()=>import("./bs_BA-DrqKjqQh-Cr-VUOtJ.js"),[],import.meta.url)],["ca-es",()=>P(()=>import("./ca_ES-B8P53VJs-DWC4n8NA.js"),[],import.meta.url)],["cs-cz",()=>P(()=>import("./cs_CZ-Bqde4kKV-CyqqX6ir.js"),[],import.meta.url)],["da-dk",()=>P(()=>import("./da_DK-BHlKtWuS-2ex9kBWh.js"),[],import.meta.url)],["de-de",()=>P(()=>import("./de_DE-BjuOMedt-BF1_XBt7.js"),[],import.meta.url)],["de-ch",()=>P(()=>import("./de_CH-DAPp1Ncl-B97rjhoW.js"),[],import.meta.url)],["el-gr",()=>P(()=>import("./el_GR-C1WdWwt2-BN9c0-aL.js"),[],import.meta.url)],["en-us",()=>P(()=>import("./en_US-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["en-ca",()=>P(()=>import("./en_CA-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["es-es",()=>P(()=>import("./es_ES-D1FgMsXM-_3WcXaQ2.js"),[],import.meta.url)],["et-ee",()=>P(()=>import("./et_EE-Dz_TpNNF-F7kgGek-.js"),[],import.meta.url)],["fi-fi",()=>P(()=>import("./fi_FI-Cte3XVjc-Bozs9Z2H.js"),[],import.meta.url)],["fr-fr",()=>P(()=>import("./fr_FR-D4Jnvm3b-BkfBDc1T.js"),[],import.meta.url)],["he-il",()=>P(()=>import("./he_IL-DcsZ56bm-B900khEo.js"),[],import.meta.url)],["hr-hr",()=>P(()=>import("./hr_HR-C0BJtvO7-BXNws4dg.js"),[],import.meta.url)],["hu-hu",()=>P(()=>import("./hu_HU-BGreOcqI-BPCtb03x.js"),[],import.meta.url)],["id-id",()=>P(()=>import("./id_ID-DCZBbKD3-Bk2oUsUi.js"),[],import.meta.url)],["it-it",()=>P(()=>import("./it_IT-BeKgphnk-BU_dnupK.js"),[],import.meta.url)],["ja-jp",()=>P(()=>import("./ja_JP-gzKc2xa8-BjWjUZZi.js"),[],import.meta.url)],["ko-kr",()=>P(()=>import("./ko_KR-sv9FjurR-C63G07Pj.js"),[],import.meta.url)],["lt-lt",()=>P(()=>import("./lt_LT-yZNULmv_-DHDBnlgq.js"),[],import.meta.url)],["lv-lv",()=>P(()=>import("./lv_LV-Cu8aigXF-BGX5_oyM.js"),[],import.meta.url)],["nb-no",()=>P(()=>import("./nb_NO-CqN3wUJH-BVuLzJb0.js"),[],import.meta.url)],["nl-nl",()=>P(()=>import("./nl_NL-DAiuag9r-DiE2F1Fx.js"),[],import.meta.url)],["pl-pl",()=>P(()=>import("./pl_PL-BDbrX9O9-CCCo8oJV.js"),[],import.meta.url)],["pt-br",()=>P(()=>import("./pt_BR-D3fc0auN-ClOz39JC.js"),[],import.meta.url)],["pt-pt",()=>P(()=>import("./pt_PT-ne3A0-MZ-CugZtzXR.js"),[],import.meta.url)],["ro-ro",()=>P(()=>import("./ro_RO-BfLaePMk-D4DP893q.js"),[],import.meta.url)],["ru-ru",()=>P(()=>import("./ru_RU-jSaqVZwA-TpCrDGWK.js"),[],import.meta.url)],["sk-sk",()=>P(()=>import("./sk_SK-Dp9r7-Al-CP61SfDR.js"),[],import.meta.url)],["sl-sl",()=>P(()=>import("./sl_SL-CArbvniK-hZyOU_tZ.js"),[],import.meta.url)],["sr-rs",()=>P(()=>import("./sr_RS-KKcjmG1u-BY82CeQm.js"),[],import.meta.url)],["sv-se",()=>P(()=>import("./sv_SE-CT8Rd8gJ-CRc7K9Uw.js"),[],import.meta.url)],["th-th",()=>P(()=>import("./th_TH-DHvdpgHD-CZOpdnuT.js"),[],import.meta.url)],["tr-tr",()=>P(()=>import("./tr_TR-CooWKX5o-BqZDkyaY.js"),[],import.meta.url)],["uk-ua",()=>P(()=>import("./uk_UA-D4LhzxxY-iB1TkjZJ.js"),[],import.meta.url)],["vi-vn",()=>P(()=>import("./vi_VN-Byu5lfYa-DrrDewoL.js"),[],import.meta.url)],["zh-cn",()=>P(()=>import("./zh_Hans-DQ0VpKp5-DN9wG9bm.js"),[],import.meta.url)],["zh-hk",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)],["zh-tw",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)]]);function Ai(b){const e=b.split("-")[0].toLowerCase();let t=null;for(const i of Ie.keys())if(i.startsWith(e)){t=i;break}return t}function Ci(b){return b?Ie.has(b.toLowerCase())?b.toLowerCase():Ai(b)||et:et}async function Fi(b,e=ut()){const t=ze.new(b);return t.locale=(await Ie.get(Ci(e))()).default,t}export{Fi as createRoot}; diff --git a/main/assets/cimSymbolUtils-CKIzBgMU-BHD6i8OW.js b/main/assets/cimSymbolUtils-CKIzBgMU-BHD6i8OW.js deleted file mode 100644 index d7b20da51..000000000 --- a/main/assets/cimSymbolUtils-CKIzBgMU-BHD6i8OW.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as l}from"./main-BZaw9FpY.js";import{e as y,r as f,t as k,N as M,T as b}from"./utils-SPbpQbmm-DpAlEmQT.js";function S(e){const o=[];return s(y(e),o),o.length?new l(b(o[0])):null}function s(e,o){if(!e)return;let a;a=e.type==="CIMTextSymbol"?e.symbol:e;const c=e.type==="CIMPolygonSymbol";if(a?.symbolLayers){for(const r of a.symbolLayers)if(!(r.colorLocked||c&&(f(r)||k(r)&&r.markerPlacement&&M(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":r.tintColor&&m(o,r.tintColor);break;case"CIMVectorMarker":r.markerGraphics?.forEach(t=>{s(t.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":m(o,r.color);break;case"CIMHatchFill":s(r.lineSymbol,o)}}}function m(e,o){for(const a of e)if(a.join(".")===o.join("."))return;e.push(o)}function p(e,o,a){o instanceof l||(o=new l(o));const c=y(e);c&&i(c,o)}function i(e,o,a){if(!e)return;let c;c=e.type==="CIMTextSymbol"?e.symbol:e;const r=c?.type==="CIMPolygonSymbol";if(c?.symbolLayers)for(const t of c.symbolLayers){if(t.colorLocked||r&&(f(t)||k(t)&&t.markerPlacement&&M(t.markerPlacement)))continue;const n=o.toArray();switch(t.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":t.tintColor=n;break;case"CIMVectorMarker":t.markerGraphics?.forEach(C=>{i(C.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":t.color=n;break;case"CIMHatchFill":i(t.lineSymbol,o)}}}export{S as I,p as u}; diff --git a/main/assets/cimSymbolUtils-CKIzBgMU-D2oNADot.js b/main/assets/cimSymbolUtils-CKIzBgMU-D2oNADot.js new file mode 100644 index 000000000..115473b63 --- /dev/null +++ b/main/assets/cimSymbolUtils-CKIzBgMU-D2oNADot.js @@ -0,0 +1 @@ +import{ar as l}from"./main-C7yV2j71.js";import{e as y,r as f,t as k,N as M,T as b}from"./utils-SPbpQbmm-Dl9Ps2XQ.js";function S(e){const o=[];return s(y(e),o),o.length?new l(b(o[0])):null}function s(e,o){if(!e)return;let a;a=e.type==="CIMTextSymbol"?e.symbol:e;const c=e.type==="CIMPolygonSymbol";if(a?.symbolLayers){for(const r of a.symbolLayers)if(!(r.colorLocked||c&&(f(r)||k(r)&&r.markerPlacement&&M(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":r.tintColor&&m(o,r.tintColor);break;case"CIMVectorMarker":r.markerGraphics?.forEach(t=>{s(t.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":m(o,r.color);break;case"CIMHatchFill":s(r.lineSymbol,o)}}}function m(e,o){for(const a of e)if(a.join(".")===o.join("."))return;e.push(o)}function p(e,o,a){o instanceof l||(o=new l(o));const c=y(e);c&&i(c,o)}function i(e,o,a){if(!e)return;let c;c=e.type==="CIMTextSymbol"?e.symbol:e;const r=c?.type==="CIMPolygonSymbol";if(c?.symbolLayers)for(const t of c.symbolLayers){if(t.colorLocked||r&&(f(t)||k(t)&&t.markerPlacement&&M(t.markerPlacement)))continue;const n=o.toArray();switch(t.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":t.tintColor=n;break;case"CIMVectorMarker":t.markerGraphics?.forEach(C=>{i(C.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":t.color=n;break;case"CIMHatchFill":i(t.lineSymbol,o)}}}export{S as I,p as u}; diff --git a/main/assets/clientSideDefaults-BqqayPct-B0cLE-po.js b/main/assets/clientSideDefaults-BqqayPct-B0cLE-po.js new file mode 100644 index 000000000..48db310ac --- /dev/null +++ b/main/assets/clientSideDefaults-BqqayPct-B0cLE-po.js @@ -0,0 +1,7 @@ +import{h3 as u,h4 as n,h5 as i,K as a,P as c}from"./main-C7yV2j71.js";import{t as l}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{s as y}from"./capabilities-Cjn77swe-Y9lFlGVh.js";function $(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?u:t==="esriGeometryPolyline"?n:i}}}const d=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let m=1;function B(t,s){if(a("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${p(s)} = null;`;for(const e in t)r+=`this${p(e)} = ${JSON.stringify(t[e])};`;const o=new Function(` + return class AttributesClass$${m++} { + constructor() { + ${r}; + } + } + `)();return()=>new o}catch{return()=>({[s]:null,...t})}}function p(t){return d.test(t)?`.${t}`:`["${t}"]`}function C(t={}){return[{name:"New Feature",description:"",prototype:{attributes:c(t)}}]}function R(t,s){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:s,supportsDelete:s,supportsEditing:s,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:s,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:l,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryBins:y,editing:{supportsGeometryUpdate:s,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{R as $,C as A,$ as d,B as f}; diff --git a/main/assets/clientSideDefaults-BqqayPct-BMC57bnT.js b/main/assets/clientSideDefaults-BqqayPct-BMC57bnT.js deleted file mode 100644 index 49a37c881..000000000 --- a/main/assets/clientSideDefaults-BqqayPct-BMC57bnT.js +++ /dev/null @@ -1,7 +0,0 @@ -import{h3 as u,h4 as n,h5 as i,K as a,P as c}from"./main-BZaw9FpY.js";import{t as l}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{s as y}from"./capabilities-Cjn77swe-Y9lFlGVh.js";function $(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?u:t==="esriGeometryPolyline"?n:i}}}const d=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let m=1;function B(t,s){if(a("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${p(s)} = null;`;for(const e in t)r+=`this${p(e)} = ${JSON.stringify(t[e])};`;const o=new Function(` - return class AttributesClass$${m++} { - constructor() { - ${r}; - } - } - `)();return()=>new o}catch{return()=>({[s]:null,...t})}}function p(t){return d.test(t)?`.${t}`:`["${t}"]`}function C(t={}){return[{name:"New Feature",description:"",prototype:{attributes:c(t)}}]}function R(t,s){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:s,supportsDelete:s,supportsEditing:s,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:s,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:l,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryBins:y,editing:{supportsGeometryUpdate:s,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{R as $,C as A,$ as d,B as f}; diff --git a/main/assets/colorRamps-q0bZVhs2-Bqen3nIx.js b/main/assets/colorRamps-q0bZVhs2-Bqen3nIx.js deleted file mode 100644 index 9e9060267..000000000 --- a/main/assets/colorRamps-q0bZVhs2-Bqen3nIx.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as e,i as m,bz as g,ar as c,bB as h,e as v,P as p}from"./main-BZaw9FpY.js";let s=class extends v{constructor(t){super(t),this.type=null}};o([e({readOnly:!0,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=o([m("esri.rest.support.ColorRamp")],s);const n=s;var i;let r=i=class extends n{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:p(this.fromColor),toColor:p(this.toColor),algorithm:this.algorithm})}};o([g({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],r.prototype,"algorithm",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"fromColor",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"toColor",void 0),o([e({type:["algorithmic"]})],r.prototype,"type",void 0),r=i=o([m("esri.rest.support.AlgorithmicColorRamp")],r);const y=r;var a;let l=a=class extends n{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new a({colorRamps:p(this.colorRamps)})}};o([e({type:[y],json:{write:!0}})],l.prototype,"colorRamps",void 0),o([e({type:["multipart"]})],l.prototype,"type",void 0),l=a=o([m("esri.rest.support.MultipartColorRamp")],l);const u=l,d={key:"type",base:n,typeMap:{algorithmic:y,multipart:u}};function f(t){return t?.type?t.type==="algorithmic"?y.fromJSON(t):t.type==="multipart"?u.fromJSON(t):null:null}export{u as c,d as g,f as v}; diff --git a/main/assets/colorRamps-q0bZVhs2-DeDskCk_.js b/main/assets/colorRamps-q0bZVhs2-DeDskCk_.js new file mode 100644 index 000000000..c3d3c64ac --- /dev/null +++ b/main/assets/colorRamps-q0bZVhs2-DeDskCk_.js @@ -0,0 +1 @@ +import{v as o,S as e,i as m,bz as g,ar as c,bB as h,e as v,P as p}from"./main-C7yV2j71.js";let s=class extends v{constructor(t){super(t),this.type=null}};o([e({readOnly:!0,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=o([m("esri.rest.support.ColorRamp")],s);const n=s;var i;let r=i=class extends n{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:p(this.fromColor),toColor:p(this.toColor),algorithm:this.algorithm})}};o([g({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],r.prototype,"algorithm",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"fromColor",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"toColor",void 0),o([e({type:["algorithmic"]})],r.prototype,"type",void 0),r=i=o([m("esri.rest.support.AlgorithmicColorRamp")],r);const y=r;var a;let l=a=class extends n{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new a({colorRamps:p(this.colorRamps)})}};o([e({type:[y],json:{write:!0}})],l.prototype,"colorRamps",void 0),o([e({type:["multipart"]})],l.prototype,"type",void 0),l=a=o([m("esri.rest.support.MultipartColorRamp")],l);const u=l,d={key:"type",base:n,typeMap:{algorithmic:y,multipart:u}};function f(t){return t?.type?t.type==="algorithmic"?y.fromJSON(t):t.type==="multipart"?u.fromJSON(t):null:null}export{u as c,d as g,f as v}; diff --git a/main/assets/colorUtils-Cthpxcks-BhGjp9AU.js b/main/assets/colorUtils-Cthpxcks-BhGjp9AU.js deleted file mode 100644 index fa300b356..000000000 --- a/main/assets/colorUtils-Cthpxcks-BhGjp9AU.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as h,f5 as w,P,f6 as A}from"./main-BZaw9FpY.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function E(t){return"r"in t&&"g"in t&&"b"in t}function x(t){return"h"in t&&"s"in t&&"v"in t}function k(t){return"l"in t&&"a"in t&&"b"in t}function y(t){return"l"in t&&"c"in t&&"h"in t}function I(t){return"x"in t&&"y"in t&&"z"in t}const j=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],q=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function z(t,r){const e=[];let n,o;if(t[0].length!==r.length)throw new Error("dimensions do not match");const u=t.length,a=t[0].length;let c=0;for(n=0;nn<=.04045?n/12.92:((n+.055)/1.055)**2.4),e=z(j,r);return{x:100*e[0],y:100*e[1],z:100*e[2]}}function M(t){const r=z(q,[t.x/100,t.y/100,t.z/100]).map(e=>{const n=e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055;return Math.min(1,Math.max(n,0))});return{r:Math.round(255*r[0]),g:Math.round(255*r[1]),b:Math.round(255*r[2])}}function H(t){const r=[t.x/95.047,t.y/100,t.z/108.883].map(e=>e>.008856451679035631?e**.3333333333333333:7.787037037037035*e+.13793103448275862);return{l:116*r[1]-16,a:500*(r[0]-r[1]),b:200*(r[1]-r[2])}}function L(t){const r=t.l,e=[(r+16)/116+t.a/500,(r+16)/116,(r+16)/116-t.b/200].map(n=>n>6/29?n**3:3*(6/29)**2*(n-4/29));return{x:95.047*e[0],y:100*e[1],z:108.883*e[2]}}function B(t){const r=t.l,e=t.a,n=t.b,o=Math.sqrt(e*e+n*n);let u=Math.atan2(n,e);return u=u>0?u:u+2*Math.PI,{l:r,c:o,h:u}}function C(t){const r=t.l,e=t.c,n=t.h;return{l:r,a:e*Math.cos(n),b:e*Math.sin(n)}}function D(t){return H(v(t))}function F(t){return M(L(t))}function G(t){return B(H(v(t)))}function O(t){return M(L(C(t)))}function Q(t){const r=t.r,e=t.g,n=t.b,o=Math.max(r,e,n),u=o-Math.min(r,e,n);let a=o,c=u===0?0:o===r?(e-n)/u%6:o===e?(n-r)/u+2:(r-e)/u+4,i=u===0?0:u/a;return c<0&&(c+=6),c*=60,i*=100,a*=100/255,{h:c,s:i,v:a}}function R(t){const r=(t.h+360)%360/60,e=t.s/100,n=t.v/100*255,o=n*e,u=o*(1-Math.abs(r%2-1));let a;switch(Math.floor(r)){case 0:a={r:o,g:u,b:0};break;case 1:a={r:u,g:o,b:0};break;case 2:a={r:0,g:o,b:u};break;case 3:a={r:0,g:u,b:o};break;case 4:a={r:u,g:0,b:o};break;case 5:case 6:a={r:o,g:0,b:u};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+n-o),a.g=Math.round(a.g+n-o),a.b=Math.round(a.b+n-o),a}function m(t){return E(t)?t:y(t)?O(t):k(t)?F(t):I(t)?M(t):x(t)?R(t):t}function Y(t){return x(t)?t:Q(m(t))}function _(t){return k(t)?t:D(m(t))}function $(t){return y(t)?t:G(m(t))}function S(t,r){const{r:e,g:n,b:o}=t;return .2126*e+.7152*n+.0722*o}var b;function J(t,r=b.High){return S(t)>r?new h([0,0,0,t.a]):new h([255,255,255,t.a])}function K(t,r,e={}){if(t.length===0||r<=0)return[];if((t=t.map(n=>typeof n=="string"?new h(n):n)).length===1||r===1){const n=[],o=t[0];for(let u=0;u=r){const n=[],o=(t.length-1)/(r-1);for(let u=0;ua.clone()),...w(n,e.seed??1)]}(function(t){t[t.Low=160]="Low",t[t.High=225]="High"})(b||(b={}));const g=(t,r)=>{const e=Math.floor(10*r())-5;return Math.min(255,Math.max(0,t+e))};function U(t,r,e,n={}){const o=t.r,u=t.g,a=t.b,c=r.r,i=r.g,s=r.b,f=Math.round(o+(c-o)*e),d=Math.round(u+(i-u)*e),p=Math.round(a+(s-a)*e);if(!n.offset)return new h([f,d,p]);const l=A(n.seed);return new h([g(f,l),g(d,l),g(p,l)])}export{Y as S,_ as T,$ as U,J as W,K as X,m as l,E as x}; diff --git a/main/assets/colorUtils-Cthpxcks-CXgjba3p.js b/main/assets/colorUtils-Cthpxcks-CXgjba3p.js new file mode 100644 index 000000000..85bec9fb5 --- /dev/null +++ b/main/assets/colorUtils-Cthpxcks-CXgjba3p.js @@ -0,0 +1 @@ +import{ar as h,f5 as w,P,f6 as A}from"./main-C7yV2j71.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function E(t){return"r"in t&&"g"in t&&"b"in t}function x(t){return"h"in t&&"s"in t&&"v"in t}function k(t){return"l"in t&&"a"in t&&"b"in t}function y(t){return"l"in t&&"c"in t&&"h"in t}function I(t){return"x"in t&&"y"in t&&"z"in t}const j=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],q=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function z(t,r){const e=[];let n,o;if(t[0].length!==r.length)throw new Error("dimensions do not match");const u=t.length,a=t[0].length;let c=0;for(n=0;nn<=.04045?n/12.92:((n+.055)/1.055)**2.4),e=z(j,r);return{x:100*e[0],y:100*e[1],z:100*e[2]}}function M(t){const r=z(q,[t.x/100,t.y/100,t.z/100]).map(e=>{const n=e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055;return Math.min(1,Math.max(n,0))});return{r:Math.round(255*r[0]),g:Math.round(255*r[1]),b:Math.round(255*r[2])}}function H(t){const r=[t.x/95.047,t.y/100,t.z/108.883].map(e=>e>.008856451679035631?e**.3333333333333333:7.787037037037035*e+.13793103448275862);return{l:116*r[1]-16,a:500*(r[0]-r[1]),b:200*(r[1]-r[2])}}function L(t){const r=t.l,e=[(r+16)/116+t.a/500,(r+16)/116,(r+16)/116-t.b/200].map(n=>n>6/29?n**3:3*(6/29)**2*(n-4/29));return{x:95.047*e[0],y:100*e[1],z:108.883*e[2]}}function B(t){const r=t.l,e=t.a,n=t.b,o=Math.sqrt(e*e+n*n);let u=Math.atan2(n,e);return u=u>0?u:u+2*Math.PI,{l:r,c:o,h:u}}function C(t){const r=t.l,e=t.c,n=t.h;return{l:r,a:e*Math.cos(n),b:e*Math.sin(n)}}function D(t){return H(v(t))}function F(t){return M(L(t))}function G(t){return B(H(v(t)))}function O(t){return M(L(C(t)))}function Q(t){const r=t.r,e=t.g,n=t.b,o=Math.max(r,e,n),u=o-Math.min(r,e,n);let a=o,c=u===0?0:o===r?(e-n)/u%6:o===e?(n-r)/u+2:(r-e)/u+4,i=u===0?0:u/a;return c<0&&(c+=6),c*=60,i*=100,a*=100/255,{h:c,s:i,v:a}}function R(t){const r=(t.h+360)%360/60,e=t.s/100,n=t.v/100*255,o=n*e,u=o*(1-Math.abs(r%2-1));let a;switch(Math.floor(r)){case 0:a={r:o,g:u,b:0};break;case 1:a={r:u,g:o,b:0};break;case 2:a={r:0,g:o,b:u};break;case 3:a={r:0,g:u,b:o};break;case 4:a={r:u,g:0,b:o};break;case 5:case 6:a={r:o,g:0,b:u};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+n-o),a.g=Math.round(a.g+n-o),a.b=Math.round(a.b+n-o),a}function m(t){return E(t)?t:y(t)?O(t):k(t)?F(t):I(t)?M(t):x(t)?R(t):t}function Y(t){return x(t)?t:Q(m(t))}function _(t){return k(t)?t:D(m(t))}function $(t){return y(t)?t:G(m(t))}function S(t,r){const{r:e,g:n,b:o}=t;return .2126*e+.7152*n+.0722*o}var b;function J(t,r=b.High){return S(t)>r?new h([0,0,0,t.a]):new h([255,255,255,t.a])}function K(t,r,e={}){if(t.length===0||r<=0)return[];if((t=t.map(n=>typeof n=="string"?new h(n):n)).length===1||r===1){const n=[],o=t[0];for(let u=0;u=r){const n=[],o=(t.length-1)/(r-1);for(let u=0;ua.clone()),...w(n,e.seed??1)]}(function(t){t[t.Low=160]="Low",t[t.High=225]="High"})(b||(b={}));const g=(t,r)=>{const e=Math.floor(10*r())-5;return Math.min(255,Math.max(0,t+e))};function U(t,r,e,n={}){const o=t.r,u=t.g,a=t.b,c=r.r,i=r.g,s=r.b,f=Math.round(o+(c-o)*e),d=Math.round(u+(i-u)*e),p=Math.round(a+(s-a)*e);if(!n.offset)return new h([f,d,p]);const l=A(n.seed);return new h([g(f,l),g(d,l),g(p,l)])}export{Y as S,_ as T,$ as U,J as W,K as X,m as l,E as x}; diff --git a/main/assets/commonProperties-BtIqvFU_-Brj0aAM1.js b/main/assets/commonProperties-BtIqvFU_-Brj0aAM1.js deleted file mode 100644 index cbaa48ab3..000000000 --- a/main/assets/commonProperties-BtIqvFU_-Brj0aAM1.js +++ /dev/null @@ -1 +0,0 @@ -import{v as n,S as i,ad as D,a0 as G,ac as O,bC as E,i as u,P as W,e as A,d3 as P,du as k,n as S,J as $}from"./main-BZaw9FpY.js";import{q}from"./ElevationInfo-yv2-9tj6-pjIBBQET.js";const a=(e=>e)(["operational-layers","basemap","ground"]);let y=class extends A{constructor(e){super(e),this.description=null,this.label=null,this.type=null}};n([i({type:String,json:{write:!0}})],y.prototype,"description",void 0),n([i({type:String,json:{write:!0}})],y.prototype,"label",void 0),n([i()],y.prototype,"type",void 0),y=n([u("esri.tables.elements.AttributeTableElement")],y);const d=y;var f;let c=f=class extends d{constructor(e){super(e),this.displayType="auto",this.type="attachment"}clone(){return new f({description:this.description,displayType:this.displayType,label:this.label})}};n([i({type:["auto"],json:{write:!0}})],c.prototype,"displayType",void 0),n([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],c.prototype,"type",void 0),c=f=n([u("esri.tables.elements.AttributeTableAttachmentElement")],c);const I=c;var g;let m=g=class extends d{constructor(e){super(e),this.fieldName=null,this.type="field"}clone(){return new g({description:this.description,fieldName:this.fieldName,label:this.label})}};n([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),n([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=g=n([u("esri.tables.elements.AttributeTableFieldElement")],m);const N=m;var v;let b=v=class extends d{constructor(e){super(e),this.relationshipId=null,this.type="relationship"}clone(){return new v({description:this.description,label:this.label,relationshipId:this.relationshipId})}};n([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),n([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=v=n([u("esri.tables.elements.AttributeTableRelationshipElement")],b);const C=b;function B(e){return{typesWithGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,group:e,relationship:C}},typesWithoutGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,relationship:C}}}}function R(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>p[o.type].fromJSON(o))}function M(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>o.toJSON())}function F(e,t,r=!0){return e?e.map(p=>P(r?t.typesWithGroup:t.typesWithoutGroup,p)):null}var j;let s=j=class extends d{constructor(e){super(e),this.elements=null,this.type="group"}castElements(e){return F(e,w,!1)}readElements(e,t){return R(t.attributeTableElements,w,!1)}writeElements(e,t){t.attributeTableElements=M(e,w,!1)}clone(){return new j({description:this.description,elements:W(this.elements),label:this.label})}};n([i({json:{write:!0}})],s.prototype,"elements",void 0),n([D("elements")],s.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],s.prototype,"readElements",null),n([O("elements")],s.prototype,"writeElements",null),n([i({type:String,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=j=n([u("esri.tables.elements.AttributeTableGroupElement")],s);const w=B(s),K=s;var T;const h=B(K);let l=T=class extends A{constructor(e){super(e),this.elements=null,this.orderByFields=null}castElements(e){return F(e,h)}readElements(e,t){return R(t.attributeTableElements,h)}writeElements(e,t){t.attributeTableElements=M(e,h)}clone(){return new T({elements:W(this.elements),orderByFields:this.orderByFields})}};n([i({json:{write:!0}})],l.prototype,"elements",void 0),n([D("elements")],l.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],l.prototype,"readElements",null),n([O("elements")],l.prototype,"writeElements",null),n([i({type:[Object],json:{write:!0}})],l.prototype,"orderByFields",void 0),l=T=n([u("esri.tables.AttributeTableTemplate")],l);const L=l,z={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:a}}},H={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,r){t[r]=!e}}}},Q={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:a}}},V={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:k}}},X={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:a}}},Y={value:null,type:q,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:a}}};function Z(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const J={write:{enabled:!0,layerContainerTypes:a},read:!0},x={type:Number,json:{origins:{"web-document":J,"portal-item":{write:!0}}}},ee={...x,json:{...x.json,origins:{"web-document":{...J,write:{enabled:!0,layerContainerTypes:a,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,r)=>r&&r.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?E(t.layerDefinition.drawingInfo.transparency):void 0:E(t.drawingInfo.transparency)}}},te={type:S,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const r=S.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(r.spatialReference=$.fromJSON(t.spatialReference)),r}}}},read:!1}},ne={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},re={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.minScale",write:!0}},ie={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.maxScale",write:!0}},se={json:{write:{ignoreOrigin:!0,layerContainerTypes:a},origins:{"web-map":{read:!1,write:!1}}}},ae={type:L,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{Y as $,x as E,Z as H,L as J,ee as K,te as Q,z as V,H as X,Q as Y,V as Z,X as _,ne as e,ae as i,ie as n,se as r,a as s,re as t}; diff --git a/main/assets/commonProperties-BtIqvFU_-DuUske_0.js b/main/assets/commonProperties-BtIqvFU_-DuUske_0.js new file mode 100644 index 000000000..a20727bf0 --- /dev/null +++ b/main/assets/commonProperties-BtIqvFU_-DuUske_0.js @@ -0,0 +1 @@ +import{v as n,S as i,ad as D,a0 as G,ac as O,bC as E,i as u,P as W,e as A,d3 as P,du as k,n as S,J as $}from"./main-C7yV2j71.js";import{q}from"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";const a=(e=>e)(["operational-layers","basemap","ground"]);let y=class extends A{constructor(e){super(e),this.description=null,this.label=null,this.type=null}};n([i({type:String,json:{write:!0}})],y.prototype,"description",void 0),n([i({type:String,json:{write:!0}})],y.prototype,"label",void 0),n([i()],y.prototype,"type",void 0),y=n([u("esri.tables.elements.AttributeTableElement")],y);const d=y;var f;let c=f=class extends d{constructor(e){super(e),this.displayType="auto",this.type="attachment"}clone(){return new f({description:this.description,displayType:this.displayType,label:this.label})}};n([i({type:["auto"],json:{write:!0}})],c.prototype,"displayType",void 0),n([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],c.prototype,"type",void 0),c=f=n([u("esri.tables.elements.AttributeTableAttachmentElement")],c);const I=c;var g;let m=g=class extends d{constructor(e){super(e),this.fieldName=null,this.type="field"}clone(){return new g({description:this.description,fieldName:this.fieldName,label:this.label})}};n([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),n([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=g=n([u("esri.tables.elements.AttributeTableFieldElement")],m);const N=m;var v;let b=v=class extends d{constructor(e){super(e),this.relationshipId=null,this.type="relationship"}clone(){return new v({description:this.description,label:this.label,relationshipId:this.relationshipId})}};n([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),n([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=v=n([u("esri.tables.elements.AttributeTableRelationshipElement")],b);const C=b;function B(e){return{typesWithGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,group:e,relationship:C}},typesWithoutGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,relationship:C}}}}function R(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>p[o.type].fromJSON(o))}function M(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>o.toJSON())}function F(e,t,r=!0){return e?e.map(p=>P(r?t.typesWithGroup:t.typesWithoutGroup,p)):null}var j;let s=j=class extends d{constructor(e){super(e),this.elements=null,this.type="group"}castElements(e){return F(e,w,!1)}readElements(e,t){return R(t.attributeTableElements,w,!1)}writeElements(e,t){t.attributeTableElements=M(e,w,!1)}clone(){return new j({description:this.description,elements:W(this.elements),label:this.label})}};n([i({json:{write:!0}})],s.prototype,"elements",void 0),n([D("elements")],s.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],s.prototype,"readElements",null),n([O("elements")],s.prototype,"writeElements",null),n([i({type:String,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=j=n([u("esri.tables.elements.AttributeTableGroupElement")],s);const w=B(s),K=s;var T;const h=B(K);let l=T=class extends A{constructor(e){super(e),this.elements=null,this.orderByFields=null}castElements(e){return F(e,h)}readElements(e,t){return R(t.attributeTableElements,h)}writeElements(e,t){t.attributeTableElements=M(e,h)}clone(){return new T({elements:W(this.elements),orderByFields:this.orderByFields})}};n([i({json:{write:!0}})],l.prototype,"elements",void 0),n([D("elements")],l.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],l.prototype,"readElements",null),n([O("elements")],l.prototype,"writeElements",null),n([i({type:[Object],json:{write:!0}})],l.prototype,"orderByFields",void 0),l=T=n([u("esri.tables.AttributeTableTemplate")],l);const L=l,z={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:a}}},H={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,r){t[r]=!e}}}},Q={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:a}}},V={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:k}}},X={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:a}}},Y={value:null,type:q,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:a}}};function Z(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const J={write:{enabled:!0,layerContainerTypes:a},read:!0},x={type:Number,json:{origins:{"web-document":J,"portal-item":{write:!0}}}},ee={...x,json:{...x.json,origins:{"web-document":{...J,write:{enabled:!0,layerContainerTypes:a,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,r)=>r&&r.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?E(t.layerDefinition.drawingInfo.transparency):void 0:E(t.drawingInfo.transparency)}}},te={type:S,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const r=S.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(r.spatialReference=$.fromJSON(t.spatialReference)),r}}}},read:!1}},ne={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},re={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.minScale",write:!0}},ie={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.maxScale",write:!0}},se={json:{write:{ignoreOrigin:!0,layerContainerTypes:a},origins:{"web-map":{read:!1,write:!1}}}},ae={type:L,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{Y as $,x as E,Z as H,L as J,ee as K,te as Q,z as V,H as X,Q as Y,V as Z,X as _,ne as e,ae as i,ie as n,se as r,a as s,re as t}; diff --git a/main/assets/compilerUtils-CV1QYWI8-89qN_-l3.js b/main/assets/compilerUtils-CV1QYWI8-89qN_-l3.js new file mode 100644 index 000000000..fb35df26d --- /dev/null +++ b/main/assets/compilerUtils-CV1QYWI8-89qN_-l3.js @@ -0,0 +1 @@ +import"./main-C7yV2j71.js";function o(n){}function r(n){return()=>n}export{r as o,o as t}; diff --git a/main/assets/compilerUtils-CV1QYWI8-Ds7TbAp_.js b/main/assets/compilerUtils-CV1QYWI8-Ds7TbAp_.js deleted file mode 100644 index 5e6fdb15c..000000000 --- a/main/assets/compilerUtils-CV1QYWI8-Ds7TbAp_.js +++ /dev/null @@ -1 +0,0 @@ -import"./main-BZaw9FpY.js";function o(n){}function r(n){return()=>n}export{r as o,o as t}; diff --git a/main/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js b/main/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js deleted file mode 100644 index 2e1cc3144..000000000 --- a/main/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js +++ /dev/null @@ -1 +0,0 @@ -import{aC as O,bj as S,dU as R}from"./main-BZaw9FpY.js";import{J as G,Z as M,G as P}from"./mat4-DX7gBViE-CQMXDC3Z.js";import{F as e,l as s,e as T,N as r,L as i}from"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";function N(o,E,t){const A=Math.sin(o),L=Math.cos(o),a=Math.sin(E),c=Math.cos(E),n=t;return n[0]=-A,n[4]=-a*L,n[8]=c*L,n[12]=0,n[1]=L,n[5]=-a*A,n[9]=c*A,n[13]=0,n[2]=0,n[6]=c,n[10]=a,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,n}function W(o,E,t){return N(o,E,t),P(t,t),t}function p(o,E,t,A){if(o==null||A==null)return!1;const L=e(o,s),a=e(A,T);if(L===a&&!C(a)&&(L!==r.UNKNOWN||O(o,A)))return G(t,E),!0;if(C(a)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),N(u*_[0],u*_[1],t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}const c=C(L);if((a===r.WEB_MERCATOR||a===r.PLATE_CARREE||a===r.WGS84||a===r.CGCS2000)&&(L===r.WGS84||c||L===r.WEB_MERCATOR||L===r.CGCS2000)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),c?W(u*_[0],u*_[1],t):M(t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}return!1}function C(o){return o===r.SPHERICAL_ECEF||o===r.SPHERICAL_MARS_PCPF||o===r.SPHERICAL_MOON_PCPF||o===r.WGS84_ECEF}const u=S(1),_=R(),l=R();export{p as G}; diff --git a/main/assets/computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js b/main/assets/computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js new file mode 100644 index 000000000..529ea53e0 --- /dev/null +++ b/main/assets/computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js @@ -0,0 +1 @@ +import{aC as O,bj as S,dU as R}from"./main-C7yV2j71.js";import{J as G,Z as M,G as P}from"./mat4-DX7gBViE-vewreEuZ.js";import{F as e,l as s,e as T,N as r,L as i}from"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";function N(o,E,t){const A=Math.sin(o),L=Math.cos(o),a=Math.sin(E),c=Math.cos(E),n=t;return n[0]=-A,n[4]=-a*L,n[8]=c*L,n[12]=0,n[1]=L,n[5]=-a*A,n[9]=c*A,n[13]=0,n[2]=0,n[6]=c,n[10]=a,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,n}function W(o,E,t){return N(o,E,t),P(t,t),t}function p(o,E,t,A){if(o==null||A==null)return!1;const L=e(o,s),a=e(A,T);if(L===a&&!C(a)&&(L!==r.UNKNOWN||O(o,A)))return G(t,E),!0;if(C(a)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),N(u*_[0],u*_[1],t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}const c=C(L);if((a===r.WEB_MERCATOR||a===r.PLATE_CARREE||a===r.WGS84||a===r.CGCS2000)&&(L===r.WGS84||c||L===r.WEB_MERCATOR||L===r.CGCS2000)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),c?W(u*_[0],u*_[1],t):M(t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}return!1}function C(o){return o===r.SPHERICAL_ECEF||o===r.SPHERICAL_MARS_PCPF||o===r.SPHERICAL_MOON_PCPF||o===r.WGS84_ECEF}const u=S(1),_=R(),l=R();export{p as G}; diff --git a/main/assets/conditionalSlot-DsCzytJ4-Ay0m1nEb.js b/main/assets/conditionalSlot-DsCzytJ4-Ay0m1nEb.js deleted file mode 100644 index aebc75402..000000000 --- a/main/assets/conditionalSlot-DsCzytJ4-Ay0m1nEb.js +++ /dev/null @@ -1 +0,0 @@ -import{n as i}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{c}from"./observers-BigwqTsw-DJJPVpPW.js";let t;const e={childList:!0};function a(o){t||(t=c("mutation",r)),t.observe(o.el,e)}function m(o){t.unobserve(o.el)}function r(o){o.forEach(({target:n})=>{i(n)})}export{m as c,a as s}; diff --git a/main/assets/conditionalSlot-DsCzytJ4-DxmRN7Hl.js b/main/assets/conditionalSlot-DsCzytJ4-DxmRN7Hl.js new file mode 100644 index 000000000..77dcae494 --- /dev/null +++ b/main/assets/conditionalSlot-DsCzytJ4-DxmRN7Hl.js @@ -0,0 +1 @@ +import{n as i}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{c}from"./observers-BigwqTsw-Du14S4xc.js";let t;const e={childList:!0};function a(o){t||(t=c("mutation",r)),t.observe(o.el,e)}function m(o){t.unobserve(o.el)}function r(o){o.forEach(({target:n})=>{i(n)})}export{m as c,a as s}; diff --git a/main/assets/convertMeshVertexSpace-BO7NR5uA-BDll_-Zx.js b/main/assets/convertMeshVertexSpace-BO7NR5uA-BDll_-Zx.js deleted file mode 100644 index db9b4eb96..000000000 --- a/main/assets/convertMeshVertexSpace-BO7NR5uA-BDll_-Zx.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as m,o as s,P as p}from"./main-BZaw9FpY.js";import{o as n}from"./MeshVertexAttributes-CbNpPur2-BzFN0z5X.js";import{b as c}from"./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js";import"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import"./vec3-BazNroeq-CFXHYIOm.js";import"./BufferView-PQoE3GL7-DXIpDOUe.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-maVOs7I3.js";async function U(o,r,t){await Promise.resolve(),m(t);const i=c(o,r,{useEllipsoid:t?.useEllipsoid});if(!i)throw new s("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");const e=o.cloneAndModifyVertexAttributes(new n({...i,uv:p(o.vertexAttributes.uv),color:p(o.vertexAttributes.color)}),r);return e.transform=null,e}export{U as convertMeshVertexSpace}; diff --git a/main/assets/convertMeshVertexSpace-BO7NR5uA-Clnp7CLV.js b/main/assets/convertMeshVertexSpace-BO7NR5uA-Clnp7CLV.js new file mode 100644 index 000000000..f37891192 --- /dev/null +++ b/main/assets/convertMeshVertexSpace-BO7NR5uA-Clnp7CLV.js @@ -0,0 +1 @@ +import{$ as m,o as s,P as p}from"./main-C7yV2j71.js";import{o as n}from"./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js";import{b as c}from"./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import"./vec3-BazNroeq-Cdhfm-VN.js";import"./BufferView-PQoE3GL7-M6q1od-Y.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-DGtcegeJ.js";async function U(o,r,t){await Promise.resolve(),m(t);const i=c(o,r,{useEllipsoid:t?.useEllipsoid});if(!i)throw new s("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");const e=o.cloneAndModifyVertexAttributes(new n({...i,uv:p(o.vertexAttributes.uv),color:p(o.vertexAttributes.color)}),r);return e.transform=null,e}export{U as convertMeshVertexSpace}; diff --git a/main/assets/createConnection-CrkuTLXs-BPFNVKMW.js b/main/assets/createConnection-CrkuTLXs-BPFNVKMW.js new file mode 100644 index 000000000..4fca45de6 --- /dev/null +++ b/main/assets/createConnection-CrkuTLXs-BPFNVKMW.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-Rem12G_g.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js","./RendererLegendOptions-K3md58-X-Bf90N-cx.js","./diffUtils-Cz3Fi8Xb-BvD0JNhD.js","./colorRamps-q0bZVhs2-DeDskCk_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-5umqHW84.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./styleUtils-BtpNqZyT-CwQxANzG.js","./jsonUtils-C64Zfu7c-BqaK54UK.js","./LRUCache-C3erQTWv-DhyPlt5p.js","./Version-CoKzbupV-BKAqCewj.js","./FieldsIndex-HmzMbJQG-CzzKuIHi.js","./UnknownTimeZone-C--TOcPG-DfRfNtw8.js","./OverrideHelper-DWRbVlj1-D6dDt4cu.js","./colorUtils-Cthpxcks-CXgjba3p.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-Dl9Ps2XQ.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-1xSDkBxg.js","./heatmapUtils-seiMkkkR-BSMLb7yQ.js","./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js","./commonProperties-BtIqvFU_-DuUske_0.js","./ElevationInfo-yv2-9tj6-CpVy5FM0.js","./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./HeightModelInfo-C5vFqzyF-DTZiz4z_.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./featureLayerUtils-DgfQQyK4-D0OGSvJx.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-DV_czrJX.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./RelationshipQuery-DJsz3K0U-BHNd_b19.js","./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js","./Relationship-PyhUibYK-DuMEI2S9.js","./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js","./Layer-ChoECxvZ--vVxyMLZ.js","./workers-PiCjreoO-DqI62TYf.js","./editsZScale-BDsX6vv--CoeIQyxn.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./FeatureSet-BkVNthuN-DDwR53LR.js","./APIKeyMixin-BUMSx9ny-AE1ffoPb.js","./ArcGISService-BYA-y6X6-BtWUPppI.js","./BlendLayer-D1WkSmwP-D_mOfOGH.js","./jsonUtils-wIllKWI4-DRJhEzZa.js","./parser-DyDJ-rlI-CV6nO3M9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./CustomParametersMixin-vdKsTHer-DndyRc71.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js","./FeatureEffect-CDEk9Es7-CW8HxX_m.js","./FeatureFilter-BCFHgLVU-DU6FY8I7.js","./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js","./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js","./labelingInfo-DGVNul26-ReCWpi39.js","./labelUtils-BW14kBqX-Cu1LInU4.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-B5IUcPZ-.js","./OrderedLayer-6Qsmrd_l-sp1TyHmN.js","./OrderByInfo-GD2XnU8e-CsM0tB0E.js","./PortalLayer-CElnYuSQ-BV63HHSL.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js","./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js","./TemporalLayer-CpOrN_w9-D1I2RE1l.js","./TimeInfo-w_HB2CsF-Ce-xYAJs.js","./FeatureTemplate-SPHPD45f-DdZuptIc.js","./FeatureType-C9hJmS6_-5PPiaaCJ.js","./fieldProperties-Bq26w7gt-DgCDIFFS.js","./versionUtils-LZYZz-38-DgmFurh2.js","./styleUtils-ChrJTYIw-OCRItq_6.js","./popupUtils-B0uZcXX0-B9v3xvNZ.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); +import{I as L,o as c,v as d,S as _,i as m,y as b,a1 as a,az as N,b as k,f as O,g as x,_ as E,J as P}from"./main-C7yV2j71.js";import{o as v}from"./projection-BA9M1R7d-DXrPfsKU.js";import{q as S}from"./query-DFW9-NG_-CfusC8cS.js";import{b as q}from"./Query-BrwMGK8U-DV_czrJX.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";let p=class extends L.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new c("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};d([_({readOnly:!0})],p.prototype,"connectionError",null),p=d([m("esri.layers.support.StreamConnection")],p);const F=p;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends F{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:s}=e;this._config=e,this._featureZScaler=v(t,s,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(e){this._websocket!=null?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const s=b(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(s),this.notifyChange("connectionStatus")}catch(s){const o=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(a.getLogger(this).error(new c("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.getLogger(this).error(new c("websocket-connection",`Failed to connect. Attempting to reconnect in ${o}s`,s)),await N(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=t=>{try{const r=JSON.parse(t.data);this._onMessage(r)}catch(r){return void a.getLogger(this).error(new c("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_createWebSocket(e){return new Promise((t,r)=>{const s=new WebSocket(e);s.onopen=()=>{if(s.onopen=null,this.destroyed)return s.onclose=null,void s.close();s.onclose=o=>this._onClose(o),s.onerror=o=>this._onError(o),this._setWebSocketJSONParseHandler(s),t(s)},s.onclose=o=>{s.onopen=s.onclose=null,r(o)}})}async _handshake(e=1e4){const t=this._websocket;if(t==null)return;const r=k(),s=t.onmessage,{filter:o,outFields:n,spatialReference:u}=this._config;return r.timeout(e),t.onmessage=h=>{let l=null;try{l=JSON.parse(h.data)}catch{}l&&typeof l=="object"||(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),r.reject(),this.destroy()),l.spatialReference?.wkid!==u?.wkid&&(a.getLogger(this).error(new c("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,h.data)),r.reject(),this.destroy()),l.format!=="json"&&(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),r.reject(),this.destroy()),o&&l.filter!==o&&a.getLogger(this).error(new c("websocket-connection","Tried to set filter, but server doesn't support it")),n&&l.outFields!==n&&a.getLogger(this).error(new c("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=s;for(const i of this._outstandingMessages)t.send(JSON.stringify(i));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:o,outFields:n,format:"json",spatialReference:{wkid:u.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&a.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};d([_()],f.prototype,"connectionStatus",null),d([_()],f.prototype,"errorString",void 0),f=d([m("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,T={maxQueryDepth:5,maxRecordCountFactor:3};let w=class extends f{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:s}=this._config;this.destroyed||this._setFilter(r,s)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void a.getLogger(this).error(new c("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=O(e.path,{query:t,responseType:"json"}),s=(await r).data;return this._serviceDefinition=s,s}_fetchWebSocketUrl(e,t){const r=e[0],{urls:s,token:o}=r,n=this._inferWebSocketBaseUrl(s);return b(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return a.getLogger(this).error(new c("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const s=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const n=k(),u=()=>{o||(this.destroyed||this._websocket!==r||a.getLogger(this).error(new c("geoevent-connection","Server timed out when setting filter")),n.reject())},h=l=>{const i=JSON.parse(l.data);i.filter&&(i.error&&(a.getLogger(this).error(new c("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),this._setWebSocketJSONParseHandler(r),o=!0,n.resolve())};return r.onmessage=h,r.send(s),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e?.geometry)try{const s=x(e.geometry);if(s.type!=="extent")throw new c(`Expected extent but found type ${s.type}`);r.geometry=JSON.stringify(s.shiftCentralMeridian())}catch(s){a.getLogger(this).error(new c("geoevent-connection","Encountered an error when setting connection geometryDefinition",s))}return e?.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],s=this._relatedFeatures.get(r);if(!s)return a.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:n}=s;for(const u in o)e.attributes[u]=o[u];return n&&(e.geometry=n),e.geometry||e.centroid||a.getLogger(this).error(new c("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),s=this._queryArchive(t);await r;const o=await s;if(!o)return;for(const n of o.features)this.onFeature(this._enrich(n))}catch(e){a.getLogger(this).error(new c("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new(await E(async()=>{const{default:R}=await import("./FeatureLayer-BrRKw5Si-Rem12G_g.js");return{default:R}},__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83]),import.meta.url)).default({url:e}),{capabilities:r}=await t.load(),s=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,l=s?h*u:h,i=new q;if(i.outFields=this._config.outFields??["*"],i.where=this._config.filter?.where??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),s&&(i.maxRecordCountFactor=u),o)return i.num=l,t.destroy(),this._queryPages(e,i);const C=await S(e,i,this._config.sourceSpatialReference);return t.destroy(),C.data}async _queryPages(e,t,r=[],s=0){t.start=t.num!=null?s*t.num:null;const{data:o}=await S(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&s<(this._config.maxQueryDepth??0)?(o.features.forEach(n=>r.push(n)),this._queryPages(e,t,r,s+1)):(r.forEach(n=>o.features.push(n)),o)}_addRelatedFeatures(e){const t=new Map,r=e.features,s=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const n=o.attributes[s];t.set(n,o)}this._relatedFeatures=t}};w=d([m("esri.layers.graphics.sources.connections.GeoEventConnection")],w);const W=w;let y=class extends F{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:s}=e;this._featureZScaler=v(t,s,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([_()],y.prototype,"connectionStatus",void 0),d([_()],y.prototype,"errorString",void 0),y=d([m("esri.layers.support.ClientSideConnection")],y);function I(e,t){if(e==null&&t==null)return null;const r={};return t!=null&&(r.geometry=t),e!=null&&(r.where=e),r}function te(e,t,r,s,o,n,u,h,l){const i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:s,filter:I(o,n),maxReconnectionAttempts:u,maxReconnectionInterval:h,customParameters:l};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(i):new W(i):new y(i)}export{te as createConnection}; diff --git a/main/assets/createConnection-CrkuTLXs-CU9LZMAw.js b/main/assets/createConnection-CrkuTLXs-CU9LZMAw.js deleted file mode 100644 index 00fe91479..000000000 --- a/main/assets/createConnection-CrkuTLXs-CU9LZMAw.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-CHreUEJ9.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js","./RendererLegendOptions-K3md58-X-B6y5tQg5.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./colorRamps-q0bZVhs2-Bqen3nIx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./styleUtils-BtpNqZyT-B-RFL3S3.js","./jsonUtils-C64Zfu7c-trwRB9M4.js","./LRUCache-C3erQTWv-CeYLuvL9.js","./Version-CoKzbupV-BxOJQpf3.js","./FieldsIndex-HmzMbJQG-CiA2Ur00.js","./UnknownTimeZone-C--TOcPG-hkNbcn35.js","./OverrideHelper-DWRbVlj1-C2SNS5Gu.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-DpAlEmQT.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-72T4gbed.js","./heatmapUtils-seiMkkkR-D9lAE87R.js","./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js","./commonProperties-BtIqvFU_-Brj0aAM1.js","./ElevationInfo-yv2-9tj6-pjIBBQET.js","./FeatureLayerBase-vvYyZTfh-K4Z036-G.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./featureLayerUtils-DgfQQyK4-D6z7j0IK.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-sojFdYaD.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js","./Relationship-PyhUibYK-Bz6HFiBe.js","./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js","./Layer-ChoECxvZ-C4wLrCej.js","./workers-PiCjreoO-oGzLvkSt.js","./editsZScale-BDsX6vv--CeDyYvz6.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./APIKeyMixin-BUMSx9ny-xmyEzAt4.js","./ArcGISService-BYA-y6X6-DLcDzG-r.js","./BlendLayer-D1WkSmwP-UVXywJXM.js","./jsonUtils-wIllKWI4-DQ36DuUP.js","./parser-DyDJ-rlI-mkgQEqcN.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./CustomParametersMixin-vdKsTHer-CoiI71pj.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js","./FeatureEffect-CDEk9Es7-DK_N6ZYk.js","./FeatureFilter-BCFHgLVU-BSMrX0wh.js","./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js","./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js","./labelingInfo-DGVNul26-CXiwzGiu.js","./labelUtils-BW14kBqX-8wHrIU-s.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-KEXCVZUA.js","./OrderedLayer-6Qsmrd_l-CGz1PXc3.js","./OrderByInfo-GD2XnU8e-C-uyyo-i.js","./PortalLayer-CElnYuSQ-tfjbIq8z.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js","./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js","./TemporalLayer-CpOrN_w9-kgJDrMMF.js","./TimeInfo-w_HB2CsF-wq_g9Zh1.js","./FeatureTemplate-SPHPD45f-tAS5Ccaa.js","./FeatureType-C9hJmS6_-pVJc0p7X.js","./fieldProperties-Bq26w7gt-DT6oRGMS.js","./versionUtils-LZYZz-38-xZnsxhiL.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js","./popupUtils-B0uZcXX0-BqljON9c.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); -import{I as L,o as c,v as d,S as _,i as m,y as b,a1 as a,az as N,b as k,f as O,g as x,_ as E,J as P}from"./main-BZaw9FpY.js";import{o as v}from"./projection-BA9M1R7d-DoNqITCd.js";import{q as S}from"./query-DFW9-NG_-1nHUNdNu.js";import{b as q}from"./Query-BrwMGK8U-sojFdYaD.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";let p=class extends L.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new c("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};d([_({readOnly:!0})],p.prototype,"connectionError",null),p=d([m("esri.layers.support.StreamConnection")],p);const F=p;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends F{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:s}=e;this._config=e,this._featureZScaler=v(t,s,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(e){this._websocket!=null?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const s=b(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(s),this.notifyChange("connectionStatus")}catch(s){const o=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(a.getLogger(this).error(new c("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.getLogger(this).error(new c("websocket-connection",`Failed to connect. Attempting to reconnect in ${o}s`,s)),await N(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=t=>{try{const r=JSON.parse(t.data);this._onMessage(r)}catch(r){return void a.getLogger(this).error(new c("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_createWebSocket(e){return new Promise((t,r)=>{const s=new WebSocket(e);s.onopen=()=>{if(s.onopen=null,this.destroyed)return s.onclose=null,void s.close();s.onclose=o=>this._onClose(o),s.onerror=o=>this._onError(o),this._setWebSocketJSONParseHandler(s),t(s)},s.onclose=o=>{s.onopen=s.onclose=null,r(o)}})}async _handshake(e=1e4){const t=this._websocket;if(t==null)return;const r=k(),s=t.onmessage,{filter:o,outFields:n,spatialReference:u}=this._config;return r.timeout(e),t.onmessage=h=>{let l=null;try{l=JSON.parse(h.data)}catch{}l&&typeof l=="object"||(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),r.reject(),this.destroy()),l.spatialReference?.wkid!==u?.wkid&&(a.getLogger(this).error(new c("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,h.data)),r.reject(),this.destroy()),l.format!=="json"&&(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),r.reject(),this.destroy()),o&&l.filter!==o&&a.getLogger(this).error(new c("websocket-connection","Tried to set filter, but server doesn't support it")),n&&l.outFields!==n&&a.getLogger(this).error(new c("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=s;for(const i of this._outstandingMessages)t.send(JSON.stringify(i));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:o,outFields:n,format:"json",spatialReference:{wkid:u.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&a.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};d([_()],f.prototype,"connectionStatus",null),d([_()],f.prototype,"errorString",void 0),f=d([m("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,T={maxQueryDepth:5,maxRecordCountFactor:3};let w=class extends f{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:s}=this._config;this.destroyed||this._setFilter(r,s)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void a.getLogger(this).error(new c("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=O(e.path,{query:t,responseType:"json"}),s=(await r).data;return this._serviceDefinition=s,s}_fetchWebSocketUrl(e,t){const r=e[0],{urls:s,token:o}=r,n=this._inferWebSocketBaseUrl(s);return b(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return a.getLogger(this).error(new c("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const s=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const n=k(),u=()=>{o||(this.destroyed||this._websocket!==r||a.getLogger(this).error(new c("geoevent-connection","Server timed out when setting filter")),n.reject())},h=l=>{const i=JSON.parse(l.data);i.filter&&(i.error&&(a.getLogger(this).error(new c("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),this._setWebSocketJSONParseHandler(r),o=!0,n.resolve())};return r.onmessage=h,r.send(s),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e?.geometry)try{const s=x(e.geometry);if(s.type!=="extent")throw new c(`Expected extent but found type ${s.type}`);r.geometry=JSON.stringify(s.shiftCentralMeridian())}catch(s){a.getLogger(this).error(new c("geoevent-connection","Encountered an error when setting connection geometryDefinition",s))}return e?.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],s=this._relatedFeatures.get(r);if(!s)return a.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:n}=s;for(const u in o)e.attributes[u]=o[u];return n&&(e.geometry=n),e.geometry||e.centroid||a.getLogger(this).error(new c("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),s=this._queryArchive(t);await r;const o=await s;if(!o)return;for(const n of o.features)this.onFeature(this._enrich(n))}catch(e){a.getLogger(this).error(new c("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new(await E(async()=>{const{default:R}=await import("./FeatureLayer-BrRKw5Si-CHreUEJ9.js");return{default:R}},__vite__mapDeps([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,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,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83]),import.meta.url)).default({url:e}),{capabilities:r}=await t.load(),s=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,l=s?h*u:h,i=new q;if(i.outFields=this._config.outFields??["*"],i.where=this._config.filter?.where??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),s&&(i.maxRecordCountFactor=u),o)return i.num=l,t.destroy(),this._queryPages(e,i);const C=await S(e,i,this._config.sourceSpatialReference);return t.destroy(),C.data}async _queryPages(e,t,r=[],s=0){t.start=t.num!=null?s*t.num:null;const{data:o}=await S(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&s<(this._config.maxQueryDepth??0)?(o.features.forEach(n=>r.push(n)),this._queryPages(e,t,r,s+1)):(r.forEach(n=>o.features.push(n)),o)}_addRelatedFeatures(e){const t=new Map,r=e.features,s=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const n=o.attributes[s];t.set(n,o)}this._relatedFeatures=t}};w=d([m("esri.layers.graphics.sources.connections.GeoEventConnection")],w);const W=w;let y=class extends F{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:s}=e;this._featureZScaler=v(t,s,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([_()],y.prototype,"connectionStatus",void 0),d([_()],y.prototype,"errorString",void 0),y=d([m("esri.layers.support.ClientSideConnection")],y);function I(e,t){if(e==null&&t==null)return null;const r={};return t!=null&&(r.geometry=t),e!=null&&(r.where=e),r}function te(e,t,r,s,o,n,u,h,l){const i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:s,filter:I(o,n),maxReconnectionAttempts:u,maxReconnectionInterval:h,customParameters:l};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(i):new W(i):new y(i)}export{te as createConnection}; diff --git a/main/assets/dataUtils-BkPy4R3C-B2SUbyy5.js b/main/assets/dataUtils-BkPy4R3C-B2SUbyy5.js deleted file mode 100644 index ef1c75019..000000000 --- a/main/assets/dataUtils-BkPy4R3C-B2SUbyy5.js +++ /dev/null @@ -1 +0,0 @@ -import{v as O,S as $,ad as _t,i as Dt,aK as Rt,e as Lt,o as Nt,P as Et,a1 as Z,K as et,$ as jt,ff as At,aG as Gt,n as Ot,bj as Wt}from"./main-BZaw9FpY.js";let bt=class{constructor(t=null,e=null,n=null){this.minValue=t,this.maxValue=e,this.noDataValue=n}};const $t=9999999e31,qt=2e-7,zt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function lt(t){return zt[t]??[-34028234663852886e22,34028234663852886e22]}function ke(t,e){return t==null||e==null?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function Kt(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function Me(t,e,n,r){let[o,s]=lt(n);const i=Kt(n);return i&&(o-=1e-5,s+=1e-5),i?n.startsWith("u")?Xt(t,e,r,[o,s]):Jt(t,e,r,[o,s]):Ht(t,e,r,[o,s])}function Ae(t,e){for(let n=0;ns?e[i]=0:n[i]=c+.5|0}}function Jt(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c+(c>0?.5:-.5)|0}}function Ht(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c}}function be(t,e,n){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:o,pixelType:s}=t,i=r[0].length,c=t.bandMasks??[],a=t.mask??new Uint8Array(i).fill(255),h=s==="f32"||s==="f64",l=lt(s);let f=!1;for(let p=0;pu+Number.EPSILON||d=$t?qt*Math.abs(u):s==="f32"?2**-23:Number.EPSILON);for(let w=0;w1?c:null,t.mask=a),f&&"updateStatistics"in t&&t.updateStatistics()}var J;let G=J=class extends Lt{static createEmptyBand(t,e){return new(J.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,n=new Uint8Array(e).fill(255);for(let r=0;rYt(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:cf>=e.length),s=r===t.length&&!t.some((f,p)=>f!==p);if(o||s)return this;const i=this.bandMasks?.length===r?t.map(f=>this.bandMasks[f]):void 0;let{mask:c,validPixelCount:a}=this;const{width:h,height:l}=this;return i?.length&&(c=J.combineBandMasks(i),a=c.filter(f=>!!f).length),new J({pixelType:this.pixelType,width:h,height:l,mask:c,bandMasks:i,validPixelCount:a,maskIsAlpha:this.maskIsAlpha,pixels:t.map(f=>e[f]),statistics:n&&t.map(f=>n[f])})}clone(){const t=new J({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(t.mask=new Uint8Array(this.mask)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const n=J.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(i=o[1],c=o[2]):o.length===2&&(i=o[1]);const h=new Uint32Array(t),l=this.width*this.height;if(s.length===l)if(e!=null&&e.length===l)if(n)for(a=0;a0){for(const d of r)if(d.minValue!=null&&(i=Math.min(i,d.minValue)),d.maxValue!=null&&d.minValue!=null){const g=d.maxValue-d.minValue;c=Math.max(c,g)}s=255/c}else{let d=255;o==="s8"?(i=-128,d=127):o==="u16"?d=65535:o==="s16"?(i=-32768,d=32767):o==="u32"?d=4294967295:o==="s32"?(i=-2147483648,d=2147483647):o==="f32"?(i=-34e38,d=34e38):o==="f64"&&(i=-Number.MAX_VALUE,d=Number.MAX_VALUE),s=255/(d-i)}const a=new Uint32Array(t),h=this.width*this.height;let l,f,p,u,m;if(l=f=p=e[0],l.length!==h)return Z.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===h)for(u=0;u=3?(o=e[1],s=e[2]):e.length===2&&(o=e[1]);const c=this.width*this.height;if(r.length!==c)return Z.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(n!=null&&n.length===c)for(i=0;ir?i:r);else for(s=0;sr?i:r;return new bt(n,r)}O([$({json:{write:!0}})],G.prototype,"width",void 0),O([$({json:{write:!0}})],G.prototype,"height",void 0),O([$({json:{write:!0}})],G.prototype,"pixelType",void 0),O([_t("pixelType")],G.prototype,"castPixelType",null),O([$({json:{write:!0}})],G.prototype,"validPixelCount",void 0),O([$({json:{write:!0}})],G.prototype,"mask",void 0),O([$({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"pixels",void 0),O([$()],G.prototype,"premultiplyAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"statistics",void 0),O([$({json:{write:!0}})],G.prototype,"depthCount",void 0),O([$({json:{write:!0}})],G.prototype,"noDataValues",void 0),O([$({json:{write:!0}})],G.prototype,"bandMasks",void 0),G=J=O([Dt("esri.layers.support.PixelBlock")],G);const D=G;var dt,mt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(dt||(dt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(mt||(mt={}));const ve=6;function L(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Ue(t){if(!t?.length||t.some(l=>!L(l)))return null;if(t.length===1)return t[0]?.clone()??null;const e=t,{width:n,height:r,pixelType:o}=e[0];if(e.some(l=>l.width!==n||l.height!==r))return null;const s=e.map(({mask:l})=>l).filter(l=>l!=null);let i=null;s.length&&(i=new Uint8Array(n*r),i.set(s[0]),s.length>1&&Ut(s.slice(1),i));const c=[];e.forEach(({pixels:l})=>c.push(...l));const a=e.map(({statistics:l})=>l).filter(l=>l?.length),h=[];return a.forEach(l=>h.push(...l)),new D({pixelType:o,width:n,height:r,mask:i,pixels:c,statistics:h.length?h:null})}function Pe(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((f,p)=>f[0]-p[0]);let r=0;n[0][0]<0&&(r=n[0][0]);const o=Math.max(256,n[n.length-1][0]-r+1),s=new Uint8Array(4*o),i=[];let c,a=0,h=0;const l=n[0].length===5;if(o>65536)return n.forEach(f=>{i[f[0]-r]=l?f.slice(1):f.slice(1).concat([255])}),{indexed2DColormap:i,offset:r,alphaSpecified:l};if(t.fillUnspecified)for(c=n[h],a=c[0]-r;ak?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]));else{for(o=new Uint8Array(s),l=0;lk?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]);n.mask=o}}else if(c)if(o!=null)for(l=0;ls));const c=[],a=e.outputPixelType||"u8";for(let l=0;l1;){if(h===l.value){d=!0;break}h>l.value?f=m:p=m,m=Math.floor((f+p)/2),l=e[Math.floor(m)]}d||(h===e[f].value?(l=e[f],d=!0):h===e[p].value?(l=e[p],d=!0):he[f].value&&(hw-m);d[0]=o[0],d[d.length-1]=o[o.length-1]+(h?1e-6:0);const g=o.length/2,[k,M]=lt(i);for(let w=0;w=0;T--)if(U===d[2*T]||U>d[2*T]&&UM?M:U=c[P]&&U<=c[P+1]){f[b]=0,u[b]=0;break}}}return new D({width:n,height:r,pixelType:i,pixels:[f],mask:u})}function gt(t,e,n,r){const o=n!=null&&n.length>=2?new Set(n):null,s=n?.length===1?n[0]:null,i=!!e?.length;for(let c=0;c=e[l]&&a<=e[l+1]){h=!0;break}h||(r[c]=0)}r[c]&&(a===s||o?.has(a))&&(r[c]=0)}}function xt(t,e){const n=t[0].length;for(let r=0;rd-1e-6);m[0]=n[0],i&&(m[m.length-1]=n[n.length-1]);for(let d=0;du?u:r[d]m.pixelBlock);if(n?.pixelBlock==null)return null;const r=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,o=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,s=.01*Math.min(r,o),i=t.sort((m,d)=>Math.abs(m.extent.ymax-d.extent.ymax)>s?d.extent.ymax-m.extent.ymax:Math.abs(m.extent.xmin-d.extent.xmin)>s?m.extent.xmin-d.extent.xmin:0),c=Math.min.apply(null,i.map(m=>m.extent.xmin)),a=Math.min.apply(null,i.map(m=>m.extent.ymin)),h=Math.max.apply(null,i.map(m=>m.extent.xmax)),l=Math.max.apply(null,i.map(m=>m.extent.ymax)),f={x:Math.round((e.xmin-c)/r),y:Math.round((l-e.ymax)/o)},p={width:Math.round((h-c)/r),height:Math.round((l-a)/o)},u={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/o)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==i.length||f.x<0||f.y<0||p.widthm.pixelBlock),p,{clipOffset:f,clipSize:u})}}function ht(t,e,n,r,o,s){const{width:i,height:c}=n.block,{x:a,y:h}=n.offset,{width:l,height:f}=n.mosaic,p=Zt(i,c,r,o,a,h,l,f);let u=0,m=0;if(s){const d=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,g=i*s.resolutionX,k=s.startX+r*g;kd?m=s.rightPadding:k>=d&&(u=s.leftMargin-s.rightPadding,m=0)}if(p.xmax-=m,typeof e!="number")for(let d=p.ymin;dL(v));if(c==null)return null;const a=o?o.width:e.width,h=o?o.height:e.height,l=c.width,f=c.height,p=e.width/l,u=e.height/f,m={offset:r||{x:0,y:0},mosaic:o||e,block:{width:l,height:f}},d=c.pixelType,g=D.getPixelArrayConstructor(d),k=c.pixels.length,M=[];let y,w;for(let v=0;vv==null||v.mask!=null&&v.mask.length>0),b=t.some(v=>v?.bandMasks&&v.bandMasks.length>1),U=x?new Uint8Array(a*h):void 0,P=b?[]:void 0;if(U){for(let v=0;vg!=null);if(r==null)return null;const o=t.some(g=>g==null||!!g.mask),{width:s,height:i}=e,c=o?new Uint8Array(s*i):null,{blockWidths:a}=n,h=[],l=r.getPlaneCount(),f=D.getPixelArrayConstructor(r.pixelType);if(o)for(let g=0,k=0;gg?.bandMasks&&g.bandMasks.length>1),u=p?[]:void 0,m=s*i;for(let g=0;gr||a>o||s===0&&i===0&&c===r&&a===o)return t;t.mask||(t.mask=new Uint8Array(r*o));const h=t.mask;for(let l=0;l=a||p=c?0:1}return t.updateStatistics(),t}function ee(t){if(!L(t))return null;const e=t.clone(),{width:n,height:r,pixels:o}=t,s=o[0],i=e.pixels[0],c=t.mask;for(let a=2;ae&&(n=s.value,e=r),s=o.next();return n}function rt(t,e,n){if(n===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function st(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Pt(t,e,n){let{x:r,y:o}=e;const{width:s,height:i}=n;if(r===0&&o===0&&i===t.height&&s===t.width)return t;const{width:c,height:a}=t,h=Math.max(0,o),l=Math.max(0,r),f=Math.min(r+s,c),p=Math.min(o+i,a);if(f<0||p<0||!L(t))return null;r=Math.max(0,-r),o=Math.max(0,-o);const{pixels:u}=t,m=s*i,d=u.length,g=[];for(let w=0;w0;u--)p=It(p,i);return p}function Bt(t,e,n,r,o=0){const{width:s,height:i}=t,{width:c,height:a}=e,h=r.cols,l=r.rows,f=Math.ceil(c/h-.1/h),p=Math.ceil(a/l-.1/l);let u,m,d,g,k,M,y;const w=f*h,x=w*p*l,b=new Float32Array(x),U=new Float32Array(x),P=new Uint32Array(x),T=new Uint32Array(x);let v,B,A=0;for(let I=0;I{const F=A instanceof Float32Array||A instanceof Float64Array?0:.5;for(let N=0;N0){const[_,R]=E(M,U,e,a),[nt,it]=E(g,k,e,a);A.push(_),A.push(R),A.push(H),A.push(tt),A.push(nt),A.push(it)}else{const[_,R]=E(M,y,e,a),[nt,it]=E(w,x,e,a),[Vt,Ct]=E(P,T,e,a);I.push(H),I.push(tt),I.push(Vt),I.push(Ct),I.push(nt),I.push(it),I.push(_),I.push(R)}U+=s,k+=s,y+=s,x+=s,T+=s}const[V,S]=E(h+d,l+i,e,a),F=(r/2+f)*m,[N,C]=E(h+F,l+i,e,a),[j,W]=E(h+d,l-c,e,a),[q,X]=E(h+F,l-c,e,a);return{pennants:A,barbs:I,shaft:[V,S,N,C,j,W,q,X]}}function E(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,s=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+s-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],le=[0,.5,1,1.5,2],re=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Y(t,e,n,r){const o=pt(r||"knots",n);let s;for(s=1;sx>0).length:p*u,M=new Float32Array(k*a),y=new Uint32Array(h*k),w=e.invertDirection?Ft(0,0,0,!1):ie;for(let x=0;x=ut){const k=(c[d]+360)%360/180*Math.PI,{pennants:M,barbs:y,shaft:w}=ct[Math.min(Math.floor(g/5),29)];if(M.length+y.length===0)continue;let x=h.length/a;const b=(m+.5)/r,U=(u+.5)/o;for(let P=0;P=(T-U)*(v-P)*(1-o)){k[b]=1;const[B,A]=St([d[b]/x,g[b]/x]);d[b]=B,g[b]=A}else k[b]=0,d[b]=0,g[b]=0}const M=new D({width:p,height:u,pixels:[d,g],mask:k});return M.updateStatistics(),M}const z=()=>Z.getLogger("esri.views.2d.engine.flow.dataUtils"),fe=10;async function qe(t,e,n,r){const o=performance.now(),s=ue(e,n),i=performance.now(),c=de(e,s,n.width,n.height),a=performance.now(),h=ge(c),l=performance.now(),f=t==="Streamlines"?xe(h,fe):we(h),p=performance.now();return et("esri-2d-profiler")&&(z().info("I.1","_createFlowFieldFromData (ms)",Math.round(i-o)),z().info("I.2","_getStreamlines (ms)",Math.round(a-i)),z().info("I.3","createAnimatedLinesData (ms)",Math.round(l-a)),z().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-l)),z().info("I.5","createFlowMesh (ms)",Math.round(p-o)),z().info("I.6","Mesh size (bytes)",f.vertexData.buffer.byteLength+f.indexData.buffer.byteLength)),await Promise.resolve(),jt(r),f}function ue(t,e){const n=me(e.data,e.width,e.height,t.smoothing);return t.interpolate?(r,o)=>{const s=Math.floor(r),i=Math.floor(o);if(s<0||s>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const c=r-s,a=o-i,h=s,l=i,f=s{const s=Math.round(r),i=Math.round(o);return s<0||s>=e.width||i<0||i>=e.height?[0,0]:[n[2*(i*e.width+s)],n[2*(i*e.width+s)+1]]}}function pe(t,e,n,r,o,s,i,c,a){const h=[];let l=n,f=r,p=0,[u,m]=e(l,f);u*=t.velocityScale,m*=t.velocityScale;const d=Math.sqrt(u*u+m*m);let g,k;h.push({x:l,y:f,t:p,speed:d});for(let M=0;Mt.maxTurnAngle)return h;if(t.collisions){const P=Math.round(l*a),T=Math.round(f*a);if(P<0||P>i-1||T<0||T>c-1)return h;const v=s[T*i+P];if(v!==-1&&v!==o)return h;s[T*i+P]=o}h.push({x:l,y:f,t:p,speed:x}),g=b,k=U}return h}function de(t,e,n,r){const o=[],s=new At,i=1/Math.max(t.lineCollisionWidth,1),c=Math.round(n*i),a=Math.round(r*i),h=new Int32Array(c*a);for(let f=0;ff.sort-p.sort);for(const{x:f,y:p}of l)if(s.getFloat()=e)continue;const m=s[u+o];f+=m*t[2*(h*e+(l+u))],p+=m*t[2*(h*e+(l+u))+1]}c[2*(h*e+l)]=f,c[2*(h*e+l)+1]=p}const a=new Float32Array(t.length);for(let h=0;h=n)continue;const m=s[u+o];f+=m*c[2*((l+u)*e+h)],p+=m*c[2*((l+u)*e+h)+1]}a[2*(l*e+h)]=f,a[2*(l*e+h)+1]=p}return a}function ge(t,e){const n=new At,r=t.reduce((a,h)=>a+h.length,0),o=new Float32Array(4*r),s=new Array(t.length);let i=0,c=0;for(const a of t){const h=i;for(const l of a)o[4*i]=l.x,o[4*i+1]=l.y,o[4*i+2]=l.t,o[4*i+3]=l.speed,i++;s[c++]={startVertex:h,numberOfVertices:a.length,totalTime:a[a.length-1].t,timeSeed:n.getFloat()}}return{lineVertices:o,lineDescriptors:s}}function xe(t,e){const{lineVertices:n,lineDescriptors:r}=t;let o=0,s=0;for(const p of r)o+=2*p.numberOfVertices,s+=6*(p.numberOfVertices-1);const i=new Float32Array(o*9),c=new Uint32Array(s);let a=0,h=0;function l(){c[h++]=a-2,c[h++]=a,c[h++]=a-1,c[h++]=a,c[h++]=a+1,c[h++]=a-1}function f(p,u,m,d,g,k,M,y){const w=a*9;let x=0;i[w+x++]=p,i[w+x++]=u,i[w+x++]=1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=d/2,i[w+x++]=g/2,i[w+x++]=y,a++,i[w+x++]=p,i[w+x++]=u,i[w+x++]=-1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=-d/2,i[w+x++]=-g/2,i[w+x++]=y,a++}for(const p of r){const{totalTime:u,timeSeed:m}=p;let d=null,g=null,k=null,M=null,y=null,w=null;for(let x=0;x0){v=b-d,B=U-g;const V=Math.sqrt(v*v+B*B);if(v/=V,B/=V,x>1){let S=v+y,F=B+w;const N=Math.sqrt(S*S+F*F);S/=N,F/=N;const C=Math.min(1/(S*v+F*B),e);S*=C,F*=C,A=-F,I=S}else A=-B,I=v;A!==null&&I!==null&&(f(d,g,k,A,I,u,m,T),l())}d=b,g=U,k=P,y=v,w=B,M=T}f(d,g,k,-w,y,u,m,M)}return{vertexData:i,indexData:c}}function we(t){const{lineVertices:e,lineDescriptors:n}=t;let r=0,o=0;for(const A of n){const I=A.numberOfVertices-1;r+=4*I*2,o+=6*I*2}const s=new Float32Array(r*16),i=new Uint32Array(o);let c,a,h,l,f,p,u,m,d,g,k,M,y,w,x=0,b=0;function U(){i[b++]=x-8,i[b++]=x-7,i[b++]=x-6,i[b++]=x-7,i[b++]=x-5,i[b++]=x-6,i[b++]=x-4,i[b++]=x-3,i[b++]=x-2,i[b++]=x-3,i[b++]=x-1,i[b++]=x-2}function P(A,I,V,S,F,N,C,j,W,q,X,K,H,tt){const _=x*16;let R=0;for(const nt of[1,2])for(const it of[1,2,3,4])s[_+R++]=A,s[_+R++]=I,s[_+R++]=V,s[_+R++]=S,s[_+R++]=C,s[_+R++]=j,s[_+R++]=W,s[_+R++]=q,s[_+R++]=nt,s[_+R++]=it,s[_+R++]=H,s[_+R++]=tt,s[_+R++]=F/2,s[_+R++]=N/2,s[_+R++]=X/2,s[_+R++]=K/2,x++}function T(A,I){let V=d+k,S=g+M;const F=Math.sqrt(V*V+S*S);V/=F,S/=F;const N=d*V+g*S;V/=N,S/=N;let C=k+y,j=M+w;const W=Math.sqrt(C*C+j*j);C/=W,j/=W;const q=k*C+M*j;C/=q,j/=q,P(c,a,h,l,-S,V,f,p,u,m,-j,C,A,I),U()}function v(A,I,V,S,F,N){if(d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),f!=null&&p!=null){y=A-f,w=I-p;const C=Math.sqrt(y*y+w*w);y/=C,w/=C}d!=null&&g!=null&&T(F,N),c=f,a=p,h=u,l=m,f=A,p=I,u=V,m=S}function B(A,I){d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),d!=null&&g!=null&&T(A,I)}for(const A of n){c=null,a=null,h=null,l=null,f=null,p=null,u=null,m=null,d=null,g=null,k=null,M=null,y=null,w=null;const{totalTime:I,timeSeed:V}=A;for(let S=0;S=n||(M.data[2*(x*n+y+b)]=w.data[2*(x*w.width+b)],M.data[2*(x*n+y+b)+1]=w.data[2*(x*w.width+b)+1],M.mask[x*n+y+b]=w.mask[x*w.width+b]);y+=w.width}return et("esri-2d-profiler")&&z().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-i)),M}async function Mt(t,e,n,r,o,s){const i={requestProjectedLocalDirections:!0,signal:s};if(o!=null&&(i.timeExtent=o),t.type==="imagery"){await t.load({signal:s});const h=t.rasterInfo.dataType,l=await t.fetchImage(e,n,r,i);return l?.pixelData?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(h,l.pixelData.pixelBlock)}await t.load({signal:s});const c=t.serviceRasterInfo.dataType,a=await t.fetchPixels(e,n,r,i);return a?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(c,a.pixelBlock)}export{ze as $,Ee as A,$e as B,ce as C,D,De as E,ke as K,L,Ne as M,Oe as P,Me as Q,qe as R,Ge as U,Ae as Y,We as _,pt as a,be as b,bt as c,Be as d,Pe as e,Qt as f,Kt as g,Te as h,dt as i,Fe as j,Le as k,Ue as l,Ve as m,lt as n,at as o,Ce as p,vt as q,Ie as r,ve as s,Se as t,mt as u,je as v,yt as w,St as x,Re as y,_e as z}; diff --git a/main/assets/dataUtils-BkPy4R3C-D8T8_whC.js b/main/assets/dataUtils-BkPy4R3C-D8T8_whC.js new file mode 100644 index 000000000..2b8131f4a --- /dev/null +++ b/main/assets/dataUtils-BkPy4R3C-D8T8_whC.js @@ -0,0 +1 @@ +import{v as O,S as $,ad as _t,i as Dt,aK as Rt,e as Lt,o as Nt,P as Et,a1 as Z,K as et,$ as jt,ff as At,aG as Gt,n as Ot,bj as Wt}from"./main-C7yV2j71.js";let bt=class{constructor(t=null,e=null,n=null){this.minValue=t,this.maxValue=e,this.noDataValue=n}};const $t=9999999e31,qt=2e-7,zt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function lt(t){return zt[t]??[-34028234663852886e22,34028234663852886e22]}function ke(t,e){return t==null||e==null?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function Kt(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function Me(t,e,n,r){let[o,s]=lt(n);const i=Kt(n);return i&&(o-=1e-5,s+=1e-5),i?n.startsWith("u")?Xt(t,e,r,[o,s]):Jt(t,e,r,[o,s]):Ht(t,e,r,[o,s])}function Ae(t,e){for(let n=0;ns?e[i]=0:n[i]=c+.5|0}}function Jt(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c+(c>0?.5:-.5)|0}}function Ht(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c}}function be(t,e,n){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:o,pixelType:s}=t,i=r[0].length,c=t.bandMasks??[],a=t.mask??new Uint8Array(i).fill(255),h=s==="f32"||s==="f64",l=lt(s);let f=!1;for(let p=0;pu+Number.EPSILON||d=$t?qt*Math.abs(u):s==="f32"?2**-23:Number.EPSILON);for(let w=0;w1?c:null,t.mask=a),f&&"updateStatistics"in t&&t.updateStatistics()}var J;let G=J=class extends Lt{static createEmptyBand(t,e){return new(J.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,n=new Uint8Array(e).fill(255);for(let r=0;rYt(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:cf>=e.length),s=r===t.length&&!t.some((f,p)=>f!==p);if(o||s)return this;const i=this.bandMasks?.length===r?t.map(f=>this.bandMasks[f]):void 0;let{mask:c,validPixelCount:a}=this;const{width:h,height:l}=this;return i?.length&&(c=J.combineBandMasks(i),a=c.filter(f=>!!f).length),new J({pixelType:this.pixelType,width:h,height:l,mask:c,bandMasks:i,validPixelCount:a,maskIsAlpha:this.maskIsAlpha,pixels:t.map(f=>e[f]),statistics:n&&t.map(f=>n[f])})}clone(){const t=new J({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(t.mask=new Uint8Array(this.mask)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const n=J.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(i=o[1],c=o[2]):o.length===2&&(i=o[1]);const h=new Uint32Array(t),l=this.width*this.height;if(s.length===l)if(e!=null&&e.length===l)if(n)for(a=0;a0){for(const d of r)if(d.minValue!=null&&(i=Math.min(i,d.minValue)),d.maxValue!=null&&d.minValue!=null){const g=d.maxValue-d.minValue;c=Math.max(c,g)}s=255/c}else{let d=255;o==="s8"?(i=-128,d=127):o==="u16"?d=65535:o==="s16"?(i=-32768,d=32767):o==="u32"?d=4294967295:o==="s32"?(i=-2147483648,d=2147483647):o==="f32"?(i=-34e38,d=34e38):o==="f64"&&(i=-Number.MAX_VALUE,d=Number.MAX_VALUE),s=255/(d-i)}const a=new Uint32Array(t),h=this.width*this.height;let l,f,p,u,m;if(l=f=p=e[0],l.length!==h)return Z.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===h)for(u=0;u=3?(o=e[1],s=e[2]):e.length===2&&(o=e[1]);const c=this.width*this.height;if(r.length!==c)return Z.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(n!=null&&n.length===c)for(i=0;ir?i:r);else for(s=0;sr?i:r;return new bt(n,r)}O([$({json:{write:!0}})],G.prototype,"width",void 0),O([$({json:{write:!0}})],G.prototype,"height",void 0),O([$({json:{write:!0}})],G.prototype,"pixelType",void 0),O([_t("pixelType")],G.prototype,"castPixelType",null),O([$({json:{write:!0}})],G.prototype,"validPixelCount",void 0),O([$({json:{write:!0}})],G.prototype,"mask",void 0),O([$({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"pixels",void 0),O([$()],G.prototype,"premultiplyAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"statistics",void 0),O([$({json:{write:!0}})],G.prototype,"depthCount",void 0),O([$({json:{write:!0}})],G.prototype,"noDataValues",void 0),O([$({json:{write:!0}})],G.prototype,"bandMasks",void 0),G=J=O([Dt("esri.layers.support.PixelBlock")],G);const D=G;var dt,mt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(dt||(dt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(mt||(mt={}));const ve=6;function L(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Ue(t){if(!t?.length||t.some(l=>!L(l)))return null;if(t.length===1)return t[0]?.clone()??null;const e=t,{width:n,height:r,pixelType:o}=e[0];if(e.some(l=>l.width!==n||l.height!==r))return null;const s=e.map(({mask:l})=>l).filter(l=>l!=null);let i=null;s.length&&(i=new Uint8Array(n*r),i.set(s[0]),s.length>1&&Ut(s.slice(1),i));const c=[];e.forEach(({pixels:l})=>c.push(...l));const a=e.map(({statistics:l})=>l).filter(l=>l?.length),h=[];return a.forEach(l=>h.push(...l)),new D({pixelType:o,width:n,height:r,mask:i,pixels:c,statistics:h.length?h:null})}function Pe(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((f,p)=>f[0]-p[0]);let r=0;n[0][0]<0&&(r=n[0][0]);const o=Math.max(256,n[n.length-1][0]-r+1),s=new Uint8Array(4*o),i=[];let c,a=0,h=0;const l=n[0].length===5;if(o>65536)return n.forEach(f=>{i[f[0]-r]=l?f.slice(1):f.slice(1).concat([255])}),{indexed2DColormap:i,offset:r,alphaSpecified:l};if(t.fillUnspecified)for(c=n[h],a=c[0]-r;ak?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]));else{for(o=new Uint8Array(s),l=0;lk?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]);n.mask=o}}else if(c)if(o!=null)for(l=0;ls));const c=[],a=e.outputPixelType||"u8";for(let l=0;l1;){if(h===l.value){d=!0;break}h>l.value?f=m:p=m,m=Math.floor((f+p)/2),l=e[Math.floor(m)]}d||(h===e[f].value?(l=e[f],d=!0):h===e[p].value?(l=e[p],d=!0):he[f].value&&(hw-m);d[0]=o[0],d[d.length-1]=o[o.length-1]+(h?1e-6:0);const g=o.length/2,[k,M]=lt(i);for(let w=0;w=0;T--)if(U===d[2*T]||U>d[2*T]&&UM?M:U=c[P]&&U<=c[P+1]){f[b]=0,u[b]=0;break}}}return new D({width:n,height:r,pixelType:i,pixels:[f],mask:u})}function gt(t,e,n,r){const o=n!=null&&n.length>=2?new Set(n):null,s=n?.length===1?n[0]:null,i=!!e?.length;for(let c=0;c=e[l]&&a<=e[l+1]){h=!0;break}h||(r[c]=0)}r[c]&&(a===s||o?.has(a))&&(r[c]=0)}}function xt(t,e){const n=t[0].length;for(let r=0;rd-1e-6);m[0]=n[0],i&&(m[m.length-1]=n[n.length-1]);for(let d=0;du?u:r[d]m.pixelBlock);if(n?.pixelBlock==null)return null;const r=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,o=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,s=.01*Math.min(r,o),i=t.sort((m,d)=>Math.abs(m.extent.ymax-d.extent.ymax)>s?d.extent.ymax-m.extent.ymax:Math.abs(m.extent.xmin-d.extent.xmin)>s?m.extent.xmin-d.extent.xmin:0),c=Math.min.apply(null,i.map(m=>m.extent.xmin)),a=Math.min.apply(null,i.map(m=>m.extent.ymin)),h=Math.max.apply(null,i.map(m=>m.extent.xmax)),l=Math.max.apply(null,i.map(m=>m.extent.ymax)),f={x:Math.round((e.xmin-c)/r),y:Math.round((l-e.ymax)/o)},p={width:Math.round((h-c)/r),height:Math.round((l-a)/o)},u={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/o)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==i.length||f.x<0||f.y<0||p.widthm.pixelBlock),p,{clipOffset:f,clipSize:u})}}function ht(t,e,n,r,o,s){const{width:i,height:c}=n.block,{x:a,y:h}=n.offset,{width:l,height:f}=n.mosaic,p=Zt(i,c,r,o,a,h,l,f);let u=0,m=0;if(s){const d=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,g=i*s.resolutionX,k=s.startX+r*g;kd?m=s.rightPadding:k>=d&&(u=s.leftMargin-s.rightPadding,m=0)}if(p.xmax-=m,typeof e!="number")for(let d=p.ymin;dL(v));if(c==null)return null;const a=o?o.width:e.width,h=o?o.height:e.height,l=c.width,f=c.height,p=e.width/l,u=e.height/f,m={offset:r||{x:0,y:0},mosaic:o||e,block:{width:l,height:f}},d=c.pixelType,g=D.getPixelArrayConstructor(d),k=c.pixels.length,M=[];let y,w;for(let v=0;vv==null||v.mask!=null&&v.mask.length>0),b=t.some(v=>v?.bandMasks&&v.bandMasks.length>1),U=x?new Uint8Array(a*h):void 0,P=b?[]:void 0;if(U){for(let v=0;vg!=null);if(r==null)return null;const o=t.some(g=>g==null||!!g.mask),{width:s,height:i}=e,c=o?new Uint8Array(s*i):null,{blockWidths:a}=n,h=[],l=r.getPlaneCount(),f=D.getPixelArrayConstructor(r.pixelType);if(o)for(let g=0,k=0;gg?.bandMasks&&g.bandMasks.length>1),u=p?[]:void 0,m=s*i;for(let g=0;gr||a>o||s===0&&i===0&&c===r&&a===o)return t;t.mask||(t.mask=new Uint8Array(r*o));const h=t.mask;for(let l=0;l=a||p=c?0:1}return t.updateStatistics(),t}function ee(t){if(!L(t))return null;const e=t.clone(),{width:n,height:r,pixels:o}=t,s=o[0],i=e.pixels[0],c=t.mask;for(let a=2;ae&&(n=s.value,e=r),s=o.next();return n}function rt(t,e,n){if(n===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function st(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Pt(t,e,n){let{x:r,y:o}=e;const{width:s,height:i}=n;if(r===0&&o===0&&i===t.height&&s===t.width)return t;const{width:c,height:a}=t,h=Math.max(0,o),l=Math.max(0,r),f=Math.min(r+s,c),p=Math.min(o+i,a);if(f<0||p<0||!L(t))return null;r=Math.max(0,-r),o=Math.max(0,-o);const{pixels:u}=t,m=s*i,d=u.length,g=[];for(let w=0;w0;u--)p=It(p,i);return p}function Bt(t,e,n,r,o=0){const{width:s,height:i}=t,{width:c,height:a}=e,h=r.cols,l=r.rows,f=Math.ceil(c/h-.1/h),p=Math.ceil(a/l-.1/l);let u,m,d,g,k,M,y;const w=f*h,x=w*p*l,b=new Float32Array(x),U=new Float32Array(x),P=new Uint32Array(x),T=new Uint32Array(x);let v,B,A=0;for(let I=0;I{const F=A instanceof Float32Array||A instanceof Float64Array?0:.5;for(let N=0;N0){const[_,R]=E(M,U,e,a),[nt,it]=E(g,k,e,a);A.push(_),A.push(R),A.push(H),A.push(tt),A.push(nt),A.push(it)}else{const[_,R]=E(M,y,e,a),[nt,it]=E(w,x,e,a),[Vt,Ct]=E(P,T,e,a);I.push(H),I.push(tt),I.push(Vt),I.push(Ct),I.push(nt),I.push(it),I.push(_),I.push(R)}U+=s,k+=s,y+=s,x+=s,T+=s}const[V,S]=E(h+d,l+i,e,a),F=(r/2+f)*m,[N,C]=E(h+F,l+i,e,a),[j,W]=E(h+d,l-c,e,a),[q,X]=E(h+F,l-c,e,a);return{pennants:A,barbs:I,shaft:[V,S,N,C,j,W,q,X]}}function E(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,s=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+s-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],le=[0,.5,1,1.5,2],re=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Y(t,e,n,r){const o=pt(r||"knots",n);let s;for(s=1;sx>0).length:p*u,M=new Float32Array(k*a),y=new Uint32Array(h*k),w=e.invertDirection?Ft(0,0,0,!1):ie;for(let x=0;x=ut){const k=(c[d]+360)%360/180*Math.PI,{pennants:M,barbs:y,shaft:w}=ct[Math.min(Math.floor(g/5),29)];if(M.length+y.length===0)continue;let x=h.length/a;const b=(m+.5)/r,U=(u+.5)/o;for(let P=0;P=(T-U)*(v-P)*(1-o)){k[b]=1;const[B,A]=St([d[b]/x,g[b]/x]);d[b]=B,g[b]=A}else k[b]=0,d[b]=0,g[b]=0}const M=new D({width:p,height:u,pixels:[d,g],mask:k});return M.updateStatistics(),M}const z=()=>Z.getLogger("esri.views.2d.engine.flow.dataUtils"),fe=10;async function qe(t,e,n,r){const o=performance.now(),s=ue(e,n),i=performance.now(),c=de(e,s,n.width,n.height),a=performance.now(),h=ge(c),l=performance.now(),f=t==="Streamlines"?xe(h,fe):we(h),p=performance.now();return et("esri-2d-profiler")&&(z().info("I.1","_createFlowFieldFromData (ms)",Math.round(i-o)),z().info("I.2","_getStreamlines (ms)",Math.round(a-i)),z().info("I.3","createAnimatedLinesData (ms)",Math.round(l-a)),z().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-l)),z().info("I.5","createFlowMesh (ms)",Math.round(p-o)),z().info("I.6","Mesh size (bytes)",f.vertexData.buffer.byteLength+f.indexData.buffer.byteLength)),await Promise.resolve(),jt(r),f}function ue(t,e){const n=me(e.data,e.width,e.height,t.smoothing);return t.interpolate?(r,o)=>{const s=Math.floor(r),i=Math.floor(o);if(s<0||s>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const c=r-s,a=o-i,h=s,l=i,f=s{const s=Math.round(r),i=Math.round(o);return s<0||s>=e.width||i<0||i>=e.height?[0,0]:[n[2*(i*e.width+s)],n[2*(i*e.width+s)+1]]}}function pe(t,e,n,r,o,s,i,c,a){const h=[];let l=n,f=r,p=0,[u,m]=e(l,f);u*=t.velocityScale,m*=t.velocityScale;const d=Math.sqrt(u*u+m*m);let g,k;h.push({x:l,y:f,t:p,speed:d});for(let M=0;Mt.maxTurnAngle)return h;if(t.collisions){const P=Math.round(l*a),T=Math.round(f*a);if(P<0||P>i-1||T<0||T>c-1)return h;const v=s[T*i+P];if(v!==-1&&v!==o)return h;s[T*i+P]=o}h.push({x:l,y:f,t:p,speed:x}),g=b,k=U}return h}function de(t,e,n,r){const o=[],s=new At,i=1/Math.max(t.lineCollisionWidth,1),c=Math.round(n*i),a=Math.round(r*i),h=new Int32Array(c*a);for(let f=0;ff.sort-p.sort);for(const{x:f,y:p}of l)if(s.getFloat()=e)continue;const m=s[u+o];f+=m*t[2*(h*e+(l+u))],p+=m*t[2*(h*e+(l+u))+1]}c[2*(h*e+l)]=f,c[2*(h*e+l)+1]=p}const a=new Float32Array(t.length);for(let h=0;h=n)continue;const m=s[u+o];f+=m*c[2*((l+u)*e+h)],p+=m*c[2*((l+u)*e+h)+1]}a[2*(l*e+h)]=f,a[2*(l*e+h)+1]=p}return a}function ge(t,e){const n=new At,r=t.reduce((a,h)=>a+h.length,0),o=new Float32Array(4*r),s=new Array(t.length);let i=0,c=0;for(const a of t){const h=i;for(const l of a)o[4*i]=l.x,o[4*i+1]=l.y,o[4*i+2]=l.t,o[4*i+3]=l.speed,i++;s[c++]={startVertex:h,numberOfVertices:a.length,totalTime:a[a.length-1].t,timeSeed:n.getFloat()}}return{lineVertices:o,lineDescriptors:s}}function xe(t,e){const{lineVertices:n,lineDescriptors:r}=t;let o=0,s=0;for(const p of r)o+=2*p.numberOfVertices,s+=6*(p.numberOfVertices-1);const i=new Float32Array(o*9),c=new Uint32Array(s);let a=0,h=0;function l(){c[h++]=a-2,c[h++]=a,c[h++]=a-1,c[h++]=a,c[h++]=a+1,c[h++]=a-1}function f(p,u,m,d,g,k,M,y){const w=a*9;let x=0;i[w+x++]=p,i[w+x++]=u,i[w+x++]=1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=d/2,i[w+x++]=g/2,i[w+x++]=y,a++,i[w+x++]=p,i[w+x++]=u,i[w+x++]=-1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=-d/2,i[w+x++]=-g/2,i[w+x++]=y,a++}for(const p of r){const{totalTime:u,timeSeed:m}=p;let d=null,g=null,k=null,M=null,y=null,w=null;for(let x=0;x0){v=b-d,B=U-g;const V=Math.sqrt(v*v+B*B);if(v/=V,B/=V,x>1){let S=v+y,F=B+w;const N=Math.sqrt(S*S+F*F);S/=N,F/=N;const C=Math.min(1/(S*v+F*B),e);S*=C,F*=C,A=-F,I=S}else A=-B,I=v;A!==null&&I!==null&&(f(d,g,k,A,I,u,m,T),l())}d=b,g=U,k=P,y=v,w=B,M=T}f(d,g,k,-w,y,u,m,M)}return{vertexData:i,indexData:c}}function we(t){const{lineVertices:e,lineDescriptors:n}=t;let r=0,o=0;for(const A of n){const I=A.numberOfVertices-1;r+=4*I*2,o+=6*I*2}const s=new Float32Array(r*16),i=new Uint32Array(o);let c,a,h,l,f,p,u,m,d,g,k,M,y,w,x=0,b=0;function U(){i[b++]=x-8,i[b++]=x-7,i[b++]=x-6,i[b++]=x-7,i[b++]=x-5,i[b++]=x-6,i[b++]=x-4,i[b++]=x-3,i[b++]=x-2,i[b++]=x-3,i[b++]=x-1,i[b++]=x-2}function P(A,I,V,S,F,N,C,j,W,q,X,K,H,tt){const _=x*16;let R=0;for(const nt of[1,2])for(const it of[1,2,3,4])s[_+R++]=A,s[_+R++]=I,s[_+R++]=V,s[_+R++]=S,s[_+R++]=C,s[_+R++]=j,s[_+R++]=W,s[_+R++]=q,s[_+R++]=nt,s[_+R++]=it,s[_+R++]=H,s[_+R++]=tt,s[_+R++]=F/2,s[_+R++]=N/2,s[_+R++]=X/2,s[_+R++]=K/2,x++}function T(A,I){let V=d+k,S=g+M;const F=Math.sqrt(V*V+S*S);V/=F,S/=F;const N=d*V+g*S;V/=N,S/=N;let C=k+y,j=M+w;const W=Math.sqrt(C*C+j*j);C/=W,j/=W;const q=k*C+M*j;C/=q,j/=q,P(c,a,h,l,-S,V,f,p,u,m,-j,C,A,I),U()}function v(A,I,V,S,F,N){if(d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),f!=null&&p!=null){y=A-f,w=I-p;const C=Math.sqrt(y*y+w*w);y/=C,w/=C}d!=null&&g!=null&&T(F,N),c=f,a=p,h=u,l=m,f=A,p=I,u=V,m=S}function B(A,I){d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),d!=null&&g!=null&&T(A,I)}for(const A of n){c=null,a=null,h=null,l=null,f=null,p=null,u=null,m=null,d=null,g=null,k=null,M=null,y=null,w=null;const{totalTime:I,timeSeed:V}=A;for(let S=0;S=n||(M.data[2*(x*n+y+b)]=w.data[2*(x*w.width+b)],M.data[2*(x*n+y+b)+1]=w.data[2*(x*w.width+b)+1],M.mask[x*n+y+b]=w.mask[x*w.width+b]);y+=w.width}return et("esri-2d-profiler")&&z().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-i)),M}async function Mt(t,e,n,r,o,s){const i={requestProjectedLocalDirections:!0,signal:s};if(o!=null&&(i.timeExtent=o),t.type==="imagery"){await t.load({signal:s});const h=t.rasterInfo.dataType,l=await t.fetchImage(e,n,r,i);return l?.pixelData?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(h,l.pixelData.pixelBlock)}await t.load({signal:s});const c=t.serviceRasterInfo.dataType,a=await t.fetchPixels(e,n,r,i);return a?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(c,a.pixelBlock)}export{ze as $,Ee as A,$e as B,ce as C,D,De as E,ke as K,L,Ne as M,Oe as P,Me as Q,qe as R,Ge as U,Ae as Y,We as _,pt as a,be as b,bt as c,Be as d,Pe as e,Qt as f,Kt as g,Te as h,dt as i,Fe as j,Le as k,Ue as l,Ve as m,lt as n,at as o,Ce as p,vt as q,Ie as r,ve as s,Se as t,mt as u,je as v,yt as w,St as x,Re as y,_e as z}; diff --git a/main/assets/deduplicate-D2d-E5Pw-cAmFzdIS.js b/main/assets/deduplicate-D2d-E5Pw-cAmFzdIS.js deleted file mode 100644 index 4f26ea4a8..000000000 --- a/main/assets/deduplicate-D2d-E5Pw-cAmFzdIS.js +++ /dev/null @@ -1 +0,0 @@ -import{hb as v}from"./main-BZaw9FpY.js";import{h as z,w as O}from"./Indices-DEr2HrWx-Cw8IJeSy.js";function B(o,n,c){const r=Array.isArray(o),e=r?o.length/n:o.byteLength/(4*n),y=r?o:new Uint32Array(o,0,e*n),A=c?.minReduction??0,s=c?.originalIndices||null,q=s?s.length:0,f=c?.componentOffsets||null;let b=0;if(f)for(let t=0;tb&&(b=u)}else b=e;const w=Math.floor(1.1*b)+1;(a==null||a.length<2*w)&&(a=new Uint32Array(v(2*w)));for(let t=0;t<2*w;t++)a[t]=0;let i=0;const m=!!f&&!!s,U=m?q:e;let h=z(e);const p=new Uint32Array(q),$=1.96;let C=A!==0?Math.ceil(4*$*$/(A*A)*A*(1-A)):U,d=1,I=f?f[1]:U;for(let t=0;t=w&&(g-=w)}x===i&&(a[2*g]=k,a[2*g+1]=u+1,i++),h[u]=x}if(A!==0&&1-i/e>>2)|0;return r>>>0}let a=null;export{B as v}; diff --git a/main/assets/deduplicate-D2d-E5Pw-eujRBTUy.js b/main/assets/deduplicate-D2d-E5Pw-eujRBTUy.js new file mode 100644 index 000000000..3d9ac35ea --- /dev/null +++ b/main/assets/deduplicate-D2d-E5Pw-eujRBTUy.js @@ -0,0 +1 @@ +import{hb as v}from"./main-C7yV2j71.js";import{h as z,w as O}from"./Indices-DEr2HrWx-Cd6y9wum.js";function B(o,n,c){const r=Array.isArray(o),e=r?o.length/n:o.byteLength/(4*n),y=r?o:new Uint32Array(o,0,e*n),A=c?.minReduction??0,s=c?.originalIndices||null,q=s?s.length:0,f=c?.componentOffsets||null;let b=0;if(f)for(let t=0;tb&&(b=u)}else b=e;const w=Math.floor(1.1*b)+1;(a==null||a.length<2*w)&&(a=new Uint32Array(v(2*w)));for(let t=0;t<2*w;t++)a[t]=0;let i=0;const m=!!f&&!!s,U=m?q:e;let h=z(e);const p=new Uint32Array(q),$=1.96;let C=A!==0?Math.ceil(4*$*$/(A*A)*A*(1-A)):U,d=1,I=f?f[1]:U;for(let t=0;t=w&&(g-=w)}x===i&&(a[2*g]=k,a[2*g+1]=u+1,i++),h[u]=x}if(A!==0&&1-i/e>>2)|0;return r>>>0}let a=null;export{B as v}; diff --git a/main/assets/deleteForwardEdits-BHWvOnK8-BMOlhqlR.js b/main/assets/deleteForwardEdits-BHWvOnK8-BMOlhqlR.js new file mode 100644 index 000000000..39a215ce0 --- /dev/null +++ b/main/assets/deleteForwardEdits-BHWvOnK8-BMOlhqlR.js @@ -0,0 +1 @@ +import{o as f,f as m}from"./main-C7yV2j71.js";import{y as p,a as u,n as c}from"./utils-9sQxfkoa-Bn_d9vXA.js";async function g(i,t,r,s){if(!t)throw new f("post:missing-guid","guid for version is missing");const o=p(i),e=r.toJSON(),n=u(o.query,{query:c({...e,f:"json"}),...s,method:"post"});t.startsWith("{")&&(t=t.slice(1,-1));const a=`${o.path}/versions/${t}/deleteForwardEdits`,{data:d}=await m(a,n);return d}export{g as deleteForwardEdits}; diff --git a/main/assets/deleteForwardEdits-BHWvOnK8-JWeZ9yT2.js b/main/assets/deleteForwardEdits-BHWvOnK8-JWeZ9yT2.js deleted file mode 100644 index 13ded73de..000000000 --- a/main/assets/deleteForwardEdits-BHWvOnK8-JWeZ9yT2.js +++ /dev/null @@ -1 +0,0 @@ -import{o as f,f as m}from"./main-BZaw9FpY.js";import{y as p,a as u,n as c}from"./utils-9sQxfkoa-Cus_qP6M.js";async function g(i,t,r,s){if(!t)throw new f("post:missing-guid","guid for version is missing");const o=p(i),e=r.toJSON(),n=u(o.query,{query:c({...e,f:"json"}),...s,method:"post"});t.startsWith("{")&&(t=t.slice(1,-1));const a=`${o.path}/versions/${t}/deleteForwardEdits`,{data:d}=await m(a,n);return d}export{g as deleteForwardEdits}; diff --git a/main/assets/details-screen-DE85sbTV-CVHeA4Eo.js b/main/assets/details-screen-DE85sbTV-CVHeA4Eo.js new file mode 100644 index 000000000..2318d89da --- /dev/null +++ b/main/assets/details-screen-DE85sbTV-CVHeA4Eo.js @@ -0,0 +1 @@ +import{c2 as F,c3 as se,ch as L,cj as ie,ca as t,cm as a,cd as h,cw as R,cx as Y,ce as U,fF as ve,cg as O,cr as I,fx as J,c8 as M,cl as N,cn as A,cz as le,gb as pe,c6 as Z,gj as ne,ct as Q,ci as G,ck as X,cb as V,cf as w,c7 as ee,cy as _e,c4 as W,fG as ae,c9 as Te,cc as de,gq as me,fK as je,gp as Me}from"./main-C7yV2j71.js";import{Z as ze}from"./toggle-switch-control-B4JzuvHa-B22huNUa.js";const He={key:0,class:"relative"},$e={key:0,class:"relative"},qe=["innerHTML"],Ee=["src"],Ie={key:1,class:"w-32 h-32"},Oe={class:"symbologyIcon"},Ce=["innerHTML"],Be=["src"],De={class:"badge z-50 rounded-full text-white absolute h-10 w-10 p-8 inline-flex items-center justify-center"},Ae={key:0,class:"px-5"},Ne={key:1,class:"inline-flex justify-center items-center relative"},Pe=F({__name:"symbology-stack",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0}},setup(v){const k=v,i=L([]);return ie(()=>{i.value=k.layer.legend}),(d,p)=>v.result.loaded?(t(),a("div",He,[h("div",{class:U(v.result.items.length===0?"opacity-50":"")},[i.value.length>1?(t(),a("div",$e,[(t(!0),a(R,null,Y(i.value.slice(0,3).reverse(),(_,y)=>(t(),a("div",{class:U(["absolute",[y==0?"symbol-0":y==1?"left-3":"left-6"]]),style:ve({"z-index":3-y}),key:y},[i.value[y].svgcode?(t(),a("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[y].svgcode},null,8,qe)):i.value[y].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[y].imgUrl},null,8,Ee)):O("",!0)],6))),128))])):i.value.length>0?(t(),a("div",Ie,[h("div",Oe,[i.value[0].svgcode?(t(),a("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ce)):i.value[0].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Be)):O("",!0)])])):O("",!0)],2),h("div",De,[v.result.loaded?(t(),a("div",Ae,I(v.result.items.length),1)):O("",!0)])])):(t(),a("div",Ne,p[0]||(p[0]=[h("div",{class:"symbologyIcon h-32 w-32"},[h("div",{class:"relative animate-spin spinner h-24 w-24"})],-1)])))}}),Fe=se(Pe,[["__scopeId","data-v-496d788d"]]),Se=["content"],Ge={class:"symbologyLayerName truncate"},Ue=F({__name:"symbology-item",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0},selected:{type:Boolean,required:!0}},setup(v){const k=J(),i=M(()=>k.properties),d=v,p=()=>{const _=d.layer;return _&&i.value[_.id]&&i.value[_.id].name?i.value[_.id].name:_?.name??""};return(_,y)=>{const b=N("tippy");return A((t(),a("button",{class:U(["flex flex-grow justify-start items-center px-7 py-10 default-focus-style symbologyStackButton truncate",v.selected?"detailsButtonSelected":"px-11"]),onClick:y[0]||(y[0]=pe(()=>{},["stop"])),content:p()},[le(Fe,{class:"symbStack w-32 h-32 mr-10",layer:v.layer,result:v.result},null,8,["layer","result"]),h("div",Ge,I(p()),1)],10,Se)),[[b,{placement:"right",sticky:!0}]])}}}),Ve=["content"],Ze=F({__name:"symbology-list",props:{results:{type:Object,required:!0},selected:{type:String,required:!0}},emits:["selection-changed"],setup(v,{emit:k}){const{t:i}=Z(),d=ne(),p=L(),_=()=>{p.value._tippy.hide()},y=g=>{g.key==="Tab"&&p.value?.matches(":focus")&&p.value._tippy.show()},b=k,o=v,r=L(""),c=L([]),u=L(!1),e=L(!1),n=g=>d.getLayerByUid(g),z=g=>{r.value=g,b("selection-changed",g),u.value=!1},C=()=>{e.value||setTimeout(()=>{u.value=e.value},500),e.value=!0},E=()=>{u.value=e.value=!1},m=()=>{e.value||(u.value=!0),e.value=!0},H=()=>{u.value=e.value=!1};return Q(()=>{c.value.push(G(o,()=>{r.value=o.selected}))}),ie(()=>{p.value?.addEventListener("blur",_),p.value?.addEventListener("keyup",y)}),X(()=>{c.value.forEach(g=>g()),p.value?.removeEventListener("blur",_),p.value?.removeEventListener("keyup",y)}),(g,P)=>{const D=N("focus-item"),q=N("focus-list"),$=N("tippy");return A((t(),a("div",{class:U(["symbology-list absolute overflow-hidden z-50 p-0 w-48 bg-white text-sm inline-flex flex-col",{"symbology-list-expanded":u.value}]),onMouseover:C,onMouseleave:E,onFocus:m,onBlur:pe(H,["self"]),content:w(i)("details.layers.results.list.tooltip"),ref_key:"el",ref:p},[(t(!0),a(R,null,Y(o.results,(l,f)=>(t(),a("div",{class:"flex justify-start relative",key:f},[A((t(),V(Ue,{key:l.uid,layer:n(l.uid),result:l,selected:l.uid===r.value,onClick:x=>z(l.uid)},null,8,["layer","result","selected","onClick"])),[[D]])]))),128))],42,Ve)),[[q],[$,{trigger:"manual",placement:"top-start",touch:!1}]])}}}),Re={class:"inline font-bold"},Ke=["innerHTML"],We=F({__name:"esri-default",props:{fixtureFields:{type:Object,required:!1},fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=v,p=(r,c,u,e)=>{const n=r.find(z=>z[c].toLowerCase()===u.toLowerCase());n&&delete e[n.name]},_=()=>{const r=Object.assign({},d.identifyData.data);p(d.fields,"type","geometry",r),i?.ui.exposeOids||p(d.fields,"type","oid",r),i?.ui.exposeMeasurements||(p(d.fields,"name","shape_length",r),p(d.fields,"name","shape_area",r));const c={};d.fields.forEach(e=>{const n=d.fixtureFields?.find(z=>e.name===z.field);c[e.name]={name:n?.alias||e.alias||e.name,type:e.type,visible:n?.visible??!0}});const u={};Object.keys(r).forEach(e=>{const n=c[e];if(n&&n.visible){const z=r[e];u[e]={value:typeof z=="number"?i?.ui.formatNumber(z):z,alias:n.name,type:n.type}}});for(const[e]of Object.entries(u))i.ui.isPlainText(u[e].value)&&(u[e].value=i.ui.escapeHtml(u[e].value));return u},y=(r,c,u)=>{switch(u){case"date":return o(r);default:return b(r,c)}},b=(r,c)=>{if(!r)return r;if(r.trim().match(/\.(jpeg|jpg|gif|png)$/)||r.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${k(`;const u="underline text-blue-700 break-all",e=document.createElement("div");return e.innerHTML=r.trim(),e.firstElementChild?.tagName=="A"?(e.firstElementChild.className=u,e.innerHTML):me(r,{className:u,target:"_blank",validate:{url:n=>/^https?:\/\//.test(n)}})},o=r=>{const c=parseInt(r);return isNaN(c)?r:new Date(c).toISOString().split("T")[0]};return(r,c)=>(t(),a("div",null,[(t(!0),a(R,null,Y(_(),(u,e,n)=>(t(),a("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:n},[h("span",Re,I(u.alias),1),c[0]||(c[0]=h("span",{class:"flex-auto"},null,-1)),h("span",{class:"inline",innerHTML:y(u.value,u.alias,u.type)},null,8,Ke)]))),128))]))}}),Ye=["innerHTML"],Je={key:1},Qe=F({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z();return(i,d)=>v.identifyData?(t(),a("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:v.identifyData.data.data??v.identifyData.data},null,8,Ye)):(t(),a("div",Je,I(w(k)("details.layers.results.empty")),1))}}),Xe={class:"relative flex flex-grow truncate"},et={key:0,class:"flex flex-grow items-center truncate"},tt={class:"flex p-8 items-center"},lt=["innerHTML"],at={key:1,class:"symbologyIcon p-6"},st=["content","innerHTML","tabindex"],it={key:1,class:"flex p-6 flex-grow"},nt={key:2,class:"zoomButton text-center p-3"},ut=["content","aria-label"],rt={key:0,class:"m-auto animate-spin spinner h-20 w-20"},ot={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"m-auto w-20 h-20"},dt={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"m-auto w-20 h-20"},ct=["innerHTML"],ce=F({__name:"result-item",props:{uid:{type:String,required:!0},data:{type:Object,required:!0},open:{type:Boolean,required:!1},inList:{type:Boolean,required:!1}},setup(v){const k=ne(),i=v,d=ee("iApi"),p=L([]),_=J(),{t:y}=Z(),b=L(""),o=L("none"),r=L(),c=()=>k.getLayerByUid(i.uid),u=M(()=>_.properties),e=M(()=>_.defaultTemplates),n=M(()=>c()?.supportsFeatures??!1),z=M(()=>c()?.mapLayer??!1),C=M(()=>{const l=c()?.nameField;let f=l&&i.data.loaded?i.data.data[l]:d.$i18n.t("details.items.title");return d.ui.isPlainText(f)&&(f=d.ui.escapeHtml(f)),f}),E=l=>{if(typeof l=="string"){const f="underline text-blue-700 break-all",x=document.createElement("div");return x.innerHTML=l.trim(),x.firstElementChild?.tagName=="A"?(x.firstElementChild.className=f,x.innerHTML):me(l,{className:f,target:"_blank",validate:{url:T=>/^https?:\/\//.test(T)}})}return l},m=()=>{q("none"),i.data.loaded?H():i.data.load().then(()=>{H()})},H=()=>{if(b.value="",!(i.data&&i.data.loaded))return;const l=c();if(l===void 0){console.warn(`could not find layer for uid ${i.uid} during icon lookup`);return}if(l.supportsFeatures){const f=l.oidField;l.getIcon(i.data.data[f]).then(x=>{b.value=x})}},g=M(()=>{const l=c();return l&&u.value[l.id]&&u.value[l.id].template?u.value[l.id].template:e.value&&e.value[i.data.format]?e.value[i.data.format]:n.value?We:Qe}),P=M(()=>n.value?c()?.fields||[]:[]),D=M(()=>{const l=c();if(l&&u.value[l.id]&&u.value[l.id].fields)return u.value[l.id].fields}),q=l=>{l==="zoomed"||l==="error"?setTimeout(()=>{o.value=l,r.value?._tippy.show(),setTimeout(()=>{r.value?._tippy.hide(),o.value="none"},3e3)},300):o.value=l},$=()=>{if(o.value!=="none")return;q("zooming");const l=c();if(l===void 0||!l.isLoaded){console.warn(`Could not find layer for uid ${i.uid} during zoom geometry lookup`),q("error");return}if(!i.data.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),q("error");return}const f=i.data.data[l.oidField],x=()=>{const T={getGeom:!0};l.getGraphic(f,T).then(B=>{B.geometry.invalid()?(console.error(`Could not find graphic for objectid ${f}`),q("error")):(d.geo.map.zoomMapTo(B.geometry),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom")))}).catch(()=>{q("error")})};l.layerType===je.FEATURE&&l.geomType!==Me.POINT?l.getGraphicExtent(f).then(T=>{d.geo.map.zoomMapTo(T),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom"))}).catch(()=>{x()}):x()};return Q(()=>{p.value.push(G(i,()=>{m()},{deep:!1,immediate:!0}))}),X(()=>{p.value.forEach(l=>l())}),(l,f)=>{const x=N("truncate"),T=N("tippy");return t(),a(R,null,[h("div",Xe,[n.value?(t(),a("div",et,[h("div",tt,[v.data.loaded&&b.value?(t(),a("span",{key:0,class:"flex-none symbologyIcon",innerHTML:b.value},null,8,lt)):(t(),a("div",at,f[1]||(f[1]=[h("div",{class:"animate-spin spinner h-20 w-20"},null,-1)])))]),v.data.loaded?A((t(),a("span",{key:0,class:"pl-3 text-left flex-grow itemName",content:C.value,innerHTML:E(C.value),tabindex:v.inList?-1:0},null,8,st)),[[x,{options:{placement:"right"}}]]):(t(),a("div",it,I(w(y)("details.loading")),1)),v.data.loaded?(t(),a("span",nt,[z.value?A((t(),a("button",{key:0,type:"button",content:w(y)(`details.item.zoom${o.value==="none"?"":`.${o.value}`}`),"aria-label":w(y)(`grid.cells.zoom${o.value==="none"?"":`.${o.value}`}`),ref_key:"zoomButton",ref:r,onClick:f[0]||(f[0]=B=>{B.stopPropagation(),$()}),class:"text-gray-600 w-24 h-24 p-2 flex justify-center items-center"},[o.value==="zooming"?(t(),a("div",rt)):o.value==="zoomed"?(t(),a("svg",ot,f[2]||(f[2]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)]))):o.value==="error"?(t(),a("svg",dt,f[3]||(f[3]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(t(),a("span",{key:3,innerHTML:w(d).ui.getZoomIcon()},null,8,ct))],8,ut)),[[T,{placement:"bottom"}]]):O("",!0)])):O("",!0)])):O("",!0)]),v.open?(t(),V(_e(g.value),{key:0,identifyData:v.data,fields:P.value,fixtureFields:D.value,class:"p-8"},null,8,["identifyData","fields","fixtureFields"])):O("",!0)],64)}}}),vt={key:0,class:"layerName w-full flex-grow p-5 pb-8 font-bold truncate",tabIndex:"0"},pt={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},mt={for:"toggle"},yt={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},gt={class:"flex"},ft=["aria-label"],ht=["content","aria-label","disabled"],bt={class:"px-3 text-center flex-grow"},kt=["content","aria-label","disabled"],xt={key:3},wt={key:0},Lt=["content"],_t=["onClick"],Tt={key:1,class:"text-center"},jt={key:4,class:"p-5"},Mt=F({__name:"result-list",props:{uid:{type:String,required:!0},results:{type:Object,required:!0}},setup(v){const k=L(),i=()=>{k.value._tippy.hide()},d=s=>{s.key==="Tab"&&k.value?.matches(":focus")&&k.value._tippy.show()},p=ee("iApi"),_=J(),y=ne(),b=v,{t:o}=Z(),r=L(!1),c=L(p.fixture.get("details")),u=L(!0),e=L(!1),n=L(0),z=L(20),C=L([]),E=L([]),m=M(()=>_.activeGreedy),H=M(()=>_.properties),g=M(()=>n.value+z.value),P=()=>y.getLayerByUid(b.uid),D=()=>b.results.find(s=>s.uid===b.uid),q=M(()=>D()?.loaded??!1),$=M(()=>D()?.requestTime),l=M(()=>r.value&&(!e.value&&T().length>1||e.value&&T().length>z.value)),f=M(()=>{const s=P();return s&&H.value[s.id]&&H.value[s.id].name?H.value[s.id].name:s?.name??""}),x=M(()=>b.uid),T=()=>{const s=D();return s?s.items:[]},B=M(()=>T()[n.value]),ue=M(()=>{if(c.value.hasHilighter()){const s=P();if(s)return s.mapLayer&&s.supportsFeatures}return!1}),ye=s=>{u.value=s,_.hilightToggle=s,S()},ge=()=>{const s=P();n.value=n.value??0,u.value=_.hilightToggle??u.value,e.value=!1,r.value=!!s,S()},re=s=>{e.value?(n.value+=s*z.value,S()):n.value+=s},S=()=>{const s=T();if(u.value&&q.value&&s.length>0&&ue.value)if(e.value)c.value.hilightDetailsItems(s.slice(n.value,g.value),b.uid);else{const j=s[n.value];j&&c.value.hilightDetailsItems([j],b.uid)}else c.value.removeDetailsHilight()},fe=()=>{e.value=!0,n.value=Math.floor(n.value/z.value)*z.value,S()},he=()=>{c.value.removeDetailsHilight()},be=()=>{c.value.removeDetailsHilight()},ke=s=>{const j=n.value;n.value=s,e.value=!1,j===s&&S()};return ie(()=>{C.value.push(p.event.on(W.LAYER_REMOVE,s=>{const j=p.panel.get("details");b.uid===s.uid&&j&&j.close()})),C.value.push(p.event.on(W.PANEL_CLOSED,s=>{s.id==="details"&&he()})),C.value.push(p.event.on(W.PANEL_MINIMIZED,s=>{s.id==="details"&&be()})),C.value.push(p.event.on(W.MAP_BASEMAPCHANGE,s=>{u.value&&s.schemaChanged&&S()})),k.value?.addEventListener("blur",i),k.value?.addEventListener("keyup",d)}),Q(()=>{E.value.push(G(B,()=>{e.value||(ge(),B.value===void 0&&c.value.removeDetailsHilight())},{deep:!1,immediate:!0})),E.value.push(G(x,()=>{const s=b.uid;if(e.value&&s){const j=D();j&&j.loading.then(()=>{b.uid===s&&e.value&&S()})}},{deep:!1,immediate:!0})),E.value.push(G($,()=>{n.value=0})),E.value.push(G(()=>b.uid,()=>{n.value=0}))}),X(()=>{E.value.forEach(s=>s()),C.value.forEach(s=>p.event.off(s)),k.value?.removeEventListener("blur",i),k.value?.removeEventListener("keyup",d)}),(s,j)=>{const xe=N("truncate"),te=N("tippy"),we=N("focus-item"),Le=N("focus-list");return q.value&&m.value===0?(t(),a("div",{key:0,class:"detailsContent relative flex flex-col flex-grow pl-5",style:ve(v.results.length>1?{"margin-left":"42px"}:"")},[r.value?A((t(),a("h1",vt,[ae(I(f.value),1)])),[[xe,{options:{placement:"top-start"}}]]):O("",!0),ue.value?(t(),a("div",pt,[h("label",mt,I(w(o)("details.togglehilight.title")),1),le(ze,{config:{value:u.value,disabled:!1},onToggled:ye},null,8,["config"])])):O("",!0),l.value?(t(),a("div",yt,[h("div",gt,[e.value?O("",!0):(t(),a("button",{key:0,type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":w(o)("details.item.see.list"),onClick:j[0]||(j[0]=K=>fe())},I(w(o)("details.item.see.list")),9,ft)),h("div",{class:U(["flex ml-auto bg-gray-200 py-8 items-center",{"w-full":e.value}])},[A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.previous":"details.item.previous.item"),onClick:j[1]||(j[1]=K=>re(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.previous":"details.item.previous.item"),disabled:n.value===0},j[3]||(j[3]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,ht)),[[te,{placement:"top"}]]),h("span",bt,I(e.value?w(o)("details.items.range",[n.value+1,Math.min(g.value,T().length),T().length]):w(o)("details.item.count",[n.value+1,T().length])),1),A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.next":"details.item.next.item"),onClick:j[2]||(j[2]=K=>re(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.next":"details.item.next.item"),disabled:!e.value&&n.value===T().length-1||e.value&&g.value>=T().length},j[4]||(j[4]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,kt)),[[te,{placement:"top"}]])],2)])])):O("",!0),r.value?(t(),a("div",xt,[T().length>0?(t(),a("div",wt,[e.value?A((t(),a("div",{key:0,class:"flex flex-col",content:w(o)("details.layers.results.list.tooltip"),ref_key:"el",ref:k},[(t(!0),a(R,null,Y(T().slice(n.value,g.value),(K,oe)=>A((t(),a("button",{class:"flex flex-grow truncate default-focus-style hover:bg-gray-200",key:oe,onClick:Et=>ke(n.value+oe)},[le(ce,{data:K,uid:v.uid,open:!1,"in-list":!0},null,8,["data","uid"])],8,_t)),[[we,"show-truncate"]])),128))],8,Lt)),[[Le],[te,{trigger:"manual",placement:"top-start",touch:!1}]]):(t(),V(ce,{key:1,data:B.value,uid:v.uid,open:!0,"in-list":!1},null,8,["data","uid"]))])):(t(),a("div",Tt,I(w(o)("details.layers.results.empty.currentLayer")),1))])):(t(),a("div",jt,I(w(o)("details.item.no.data")),1))],4)):(t(),a("div",{key:1,class:U(["flex justify-center py-10 items-center",v.results.length>1?"ml-42":""])},[j[5]||(j[5]=h("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1)),ae(" "+I(w(o)("details.item.loading")),1)],2))}}}),zt=se(Mt,[["__scopeId","data-v-3a47d6ad"]]),Ht={class:"relative h-full"},$t={class:"detailsContentSection overflow-y-auto h-full"},qt=F({__name:"details-screen",props:{panel:{type:Object}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=J(),p=L([]),_=L([]),y=L([]),b=L(!1),o=L(""),r=M(()=>d.activeGreedy),c=M(()=>d.payload),u=M(()=>d.properties),e=m=>{o.value=m},n=m=>y.value.find(H=>H.uid===m),z=m=>{m!==void 0&&(d.activeGreedy=m.length===0?0:m[0].requestTime,y.value=m,C(m))},C=m=>{if(o.value){const H=n(o.value);H?H.loading.then(()=>{H.requestTime===r.value&&(H.items.length>0?(d.activeGreedy=0,b.value=!1):E(m))}):E(m)}else E(m)},E=(m,H)=>{let g;if(H)g=H;else{const $=d.properties,l=m.map(x=>[$[x.layerId]?.priority??50,x.layerId]),f=new Set(l.map(x=>x[0]));g=[],f.forEach(x=>{const T=l.filter(B=>B[0]===x).map(B=>B[1]);g.push([x,T])}),g.sort((x,T)=>T[0]-x[0])}if(g.length===0){d.activeGreedy=0,b.value=!0;return}const P=g[g.length-1][1],D=m.filter($=>P.includes($.layerId)).map($=>$.loading.then(()=>$.items.length>0?Promise.resolve($):Promise.reject())),q=m.length===0?0:m[0].requestTime;Promise.any(D).then($=>{$.requestTime===r.value&&(d.activeGreedy=0,o.value=$.uid,b.value=!1)}).catch(()=>{q===r.value&&(g.pop(),E(m,g))})};return Q(()=>{_.value.push(G(c,m=>{z(m)},{deep:!1,immediate:!0}))}),X(()=>{p.value.forEach(m=>i.event.off(m)),_.value.forEach(m=>m())}),(m,H)=>{const g=Te("panel-screen");return t(),V(g,{panel:v.panel},{header:de(()=>[ae(I(w(d).origin==="toggleEvent"?w(k)("details.layers.title.gridOrigin"):w(k)("details.layers.title.identifyOrigin")),1)]),content:de(()=>[h("div",Ht,[y.value.length>1?(t(),V(Ze,{key:0,results:y.value,detailsProperties:u.value,selected:o.value,onSelectionChanged:e},null,8,["results","detailsProperties","selected"])):O("",!0),h("div",$t,[b.value?(t(),a("div",{key:1,class:U(["text-center",{"ml-42":y.value.length>1}])},I(y.value.length>=1?w(k)("details.layers.results.empty"):w(k)("details.layers.results.empty.noLayers")),3)):(t(),V(zt,{key:0,uid:o.value,results:y.value},null,8,["uid","results"]))])])]),_:1},8,["panel"])}}}),Ct=se(qt,[["__scopeId","data-v-2a8a1e06"]]);export{Ct as default}; diff --git a/main/assets/details-screen-DE85sbTV-CnDBzoal.js b/main/assets/details-screen-DE85sbTV-CnDBzoal.js deleted file mode 100644 index 6a8f722fe..000000000 --- a/main/assets/details-screen-DE85sbTV-CnDBzoal.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as F,c3 as se,ch as L,cj as ie,ca as t,cm as a,cd as h,cw as R,cx as Y,ce as U,fF as ve,cg as O,cr as I,fx as J,c8 as M,cl as N,cn as A,cz as le,gb as pe,c6 as Z,gj as ne,ct as Q,ci as G,ck as X,cb as V,cf as w,c7 as ee,cy as _e,c4 as W,fG as ae,c9 as Te,cc as de,gq as me,fK as je,gp as Me}from"./main-BZaw9FpY.js";import{Z as ze}from"./toggle-switch-control-B4JzuvHa-CnJ57I53.js";const He={key:0,class:"relative"},$e={key:0,class:"relative"},qe=["innerHTML"],Ee=["src"],Ie={key:1,class:"w-32 h-32"},Oe={class:"symbologyIcon"},Ce=["innerHTML"],Be=["src"],De={class:"badge z-50 rounded-full text-white absolute h-10 w-10 p-8 inline-flex items-center justify-center"},Ae={key:0,class:"px-5"},Ne={key:1,class:"inline-flex justify-center items-center relative"},Pe=F({__name:"symbology-stack",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0}},setup(v){const k=v,i=L([]);return ie(()=>{i.value=k.layer.legend}),(d,p)=>v.result.loaded?(t(),a("div",He,[h("div",{class:U(v.result.items.length===0?"opacity-50":"")},[i.value.length>1?(t(),a("div",$e,[(t(!0),a(R,null,Y(i.value.slice(0,3).reverse(),(_,y)=>(t(),a("div",{class:U(["absolute",[y==0?"symbol-0":y==1?"left-3":"left-6"]]),style:ve({"z-index":3-y}),key:y},[i.value[y].svgcode?(t(),a("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[y].svgcode},null,8,qe)):i.value[y].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[y].imgUrl},null,8,Ee)):O("",!0)],6))),128))])):i.value.length>0?(t(),a("div",Ie,[h("div",Oe,[i.value[0].svgcode?(t(),a("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ce)):i.value[0].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Be)):O("",!0)])])):O("",!0)],2),h("div",De,[v.result.loaded?(t(),a("div",Ae,I(v.result.items.length),1)):O("",!0)])])):(t(),a("div",Ne,p[0]||(p[0]=[h("div",{class:"symbologyIcon h-32 w-32"},[h("div",{class:"relative animate-spin spinner h-24 w-24"})],-1)])))}}),Fe=se(Pe,[["__scopeId","data-v-496d788d"]]),Se=["content"],Ge={class:"symbologyLayerName truncate"},Ue=F({__name:"symbology-item",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0},selected:{type:Boolean,required:!0}},setup(v){const k=J(),i=M(()=>k.properties),d=v,p=()=>{const _=d.layer;return _&&i.value[_.id]&&i.value[_.id].name?i.value[_.id].name:_?.name??""};return(_,y)=>{const b=N("tippy");return A((t(),a("button",{class:U(["flex flex-grow justify-start items-center px-7 py-10 default-focus-style symbologyStackButton truncate",v.selected?"detailsButtonSelected":"px-11"]),onClick:y[0]||(y[0]=pe(()=>{},["stop"])),content:p()},[le(Fe,{class:"symbStack w-32 h-32 mr-10",layer:v.layer,result:v.result},null,8,["layer","result"]),h("div",Ge,I(p()),1)],10,Se)),[[b,{placement:"right",sticky:!0}]])}}}),Ve=["content"],Ze=F({__name:"symbology-list",props:{results:{type:Object,required:!0},selected:{type:String,required:!0}},emits:["selection-changed"],setup(v,{emit:k}){const{t:i}=Z(),d=ne(),p=L(),_=()=>{p.value._tippy.hide()},y=g=>{g.key==="Tab"&&p.value?.matches(":focus")&&p.value._tippy.show()},b=k,o=v,r=L(""),c=L([]),u=L(!1),e=L(!1),n=g=>d.getLayerByUid(g),z=g=>{r.value=g,b("selection-changed",g),u.value=!1},C=()=>{e.value||setTimeout(()=>{u.value=e.value},500),e.value=!0},E=()=>{u.value=e.value=!1},m=()=>{e.value||(u.value=!0),e.value=!0},H=()=>{u.value=e.value=!1};return Q(()=>{c.value.push(G(o,()=>{r.value=o.selected}))}),ie(()=>{p.value?.addEventListener("blur",_),p.value?.addEventListener("keyup",y)}),X(()=>{c.value.forEach(g=>g()),p.value?.removeEventListener("blur",_),p.value?.removeEventListener("keyup",y)}),(g,P)=>{const D=N("focus-item"),q=N("focus-list"),$=N("tippy");return A((t(),a("div",{class:U(["symbology-list absolute overflow-hidden z-50 p-0 w-48 bg-white text-sm inline-flex flex-col",{"symbology-list-expanded":u.value}]),onMouseover:C,onMouseleave:E,onFocus:m,onBlur:pe(H,["self"]),content:w(i)("details.layers.results.list.tooltip"),ref_key:"el",ref:p},[(t(!0),a(R,null,Y(o.results,(l,f)=>(t(),a("div",{class:"flex justify-start relative",key:f},[A((t(),V(Ue,{key:l.uid,layer:n(l.uid),result:l,selected:l.uid===r.value,onClick:x=>z(l.uid)},null,8,["layer","result","selected","onClick"])),[[D]])]))),128))],42,Ve)),[[q],[$,{trigger:"manual",placement:"top-start",touch:!1}]])}}}),Re={class:"inline font-bold"},Ke=["innerHTML"],We=F({__name:"esri-default",props:{fixtureFields:{type:Object,required:!1},fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=v,p=(r,c,u,e)=>{const n=r.find(z=>z[c].toLowerCase()===u.toLowerCase());n&&delete e[n.name]},_=()=>{const r=Object.assign({},d.identifyData.data);p(d.fields,"type","geometry",r),i?.ui.exposeOids||p(d.fields,"type","oid",r),i?.ui.exposeMeasurements||(p(d.fields,"name","shape_length",r),p(d.fields,"name","shape_area",r));const c={};d.fields.forEach(e=>{const n=d.fixtureFields?.find(z=>e.name===z.field);c[e.name]={name:n?.alias||e.alias||e.name,type:e.type,visible:n?.visible??!0}});const u={};Object.keys(r).forEach(e=>{const n=c[e];if(n&&n.visible){const z=r[e];u[e]={value:typeof z=="number"?i?.ui.formatNumber(z):z,alias:n.name,type:n.type}}});for(const[e]of Object.entries(u))i.ui.isPlainText(u[e].value)&&(u[e].value=i.ui.escapeHtml(u[e].value));return u},y=(r,c,u)=>{switch(u){case"date":return o(r);default:return b(r,c)}},b=(r,c)=>{if(!r)return r;if(r.trim().match(/\.(jpeg|jpg|gif|png)$/)||r.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${k(`;const u="underline text-blue-700 break-all",e=document.createElement("div");return e.innerHTML=r.trim(),e.firstElementChild?.tagName=="A"?(e.firstElementChild.className=u,e.innerHTML):me(r,{className:u,target:"_blank",validate:{url:n=>/^https?:\/\//.test(n)}})},o=r=>{const c=parseInt(r);return isNaN(c)?r:new Date(c).toISOString().split("T")[0]};return(r,c)=>(t(),a("div",null,[(t(!0),a(R,null,Y(_(),(u,e,n)=>(t(),a("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:n},[h("span",Re,I(u.alias),1),c[0]||(c[0]=h("span",{class:"flex-auto"},null,-1)),h("span",{class:"inline",innerHTML:y(u.value,u.alias,u.type)},null,8,Ke)]))),128))]))}}),Ye=["innerHTML"],Je={key:1},Qe=F({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z();return(i,d)=>v.identifyData?(t(),a("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:v.identifyData.data.data??v.identifyData.data},null,8,Ye)):(t(),a("div",Je,I(w(k)("details.layers.results.empty")),1))}}),Xe={class:"relative flex flex-grow truncate"},et={key:0,class:"flex flex-grow items-center truncate"},tt={class:"flex p-8 items-center"},lt=["innerHTML"],at={key:1,class:"symbologyIcon p-6"},st=["content","innerHTML","tabindex"],it={key:1,class:"flex p-6 flex-grow"},nt={key:2,class:"zoomButton text-center p-3"},ut=["content","aria-label"],rt={key:0,class:"m-auto animate-spin spinner h-20 w-20"},ot={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"m-auto w-20 h-20"},dt={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"m-auto w-20 h-20"},ct=["innerHTML"],ce=F({__name:"result-item",props:{uid:{type:String,required:!0},data:{type:Object,required:!0},open:{type:Boolean,required:!1},inList:{type:Boolean,required:!1}},setup(v){const k=ne(),i=v,d=ee("iApi"),p=L([]),_=J(),{t:y}=Z(),b=L(""),o=L("none"),r=L(),c=()=>k.getLayerByUid(i.uid),u=M(()=>_.properties),e=M(()=>_.defaultTemplates),n=M(()=>c()?.supportsFeatures??!1),z=M(()=>c()?.mapLayer??!1),C=M(()=>{const l=c()?.nameField;let f=l&&i.data.loaded?i.data.data[l]:d.$i18n.t("details.items.title");return d.ui.isPlainText(f)&&(f=d.ui.escapeHtml(f)),f}),E=l=>{if(typeof l=="string"){const f="underline text-blue-700 break-all",x=document.createElement("div");return x.innerHTML=l.trim(),x.firstElementChild?.tagName=="A"?(x.firstElementChild.className=f,x.innerHTML):me(l,{className:f,target:"_blank",validate:{url:T=>/^https?:\/\//.test(T)}})}return l},m=()=>{q("none"),i.data.loaded?H():i.data.load().then(()=>{H()})},H=()=>{if(b.value="",!(i.data&&i.data.loaded))return;const l=c();if(l===void 0){console.warn(`could not find layer for uid ${i.uid} during icon lookup`);return}if(l.supportsFeatures){const f=l.oidField;l.getIcon(i.data.data[f]).then(x=>{b.value=x})}},g=M(()=>{const l=c();return l&&u.value[l.id]&&u.value[l.id].template?u.value[l.id].template:e.value&&e.value[i.data.format]?e.value[i.data.format]:n.value?We:Qe}),P=M(()=>n.value?c()?.fields||[]:[]),D=M(()=>{const l=c();if(l&&u.value[l.id]&&u.value[l.id].fields)return u.value[l.id].fields}),q=l=>{l==="zoomed"||l==="error"?setTimeout(()=>{o.value=l,r.value?._tippy.show(),setTimeout(()=>{r.value?._tippy.hide(),o.value="none"},3e3)},300):o.value=l},$=()=>{if(o.value!=="none")return;q("zooming");const l=c();if(l===void 0||!l.isLoaded){console.warn(`Could not find layer for uid ${i.uid} during zoom geometry lookup`),q("error");return}if(!i.data.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),q("error");return}const f=i.data.data[l.oidField],x=()=>{const T={getGeom:!0};l.getGraphic(f,T).then(B=>{B.geometry.invalid()?(console.error(`Could not find graphic for objectid ${f}`),q("error")):(d.geo.map.zoomMapTo(B.geometry),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom")))}).catch(()=>{q("error")})};l.layerType===je.FEATURE&&l.geomType!==Me.POINT?l.getGraphicExtent(f).then(T=>{d.geo.map.zoomMapTo(T),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom"))}).catch(()=>{x()}):x()};return Q(()=>{p.value.push(G(i,()=>{m()},{deep:!1,immediate:!0}))}),X(()=>{p.value.forEach(l=>l())}),(l,f)=>{const x=N("truncate"),T=N("tippy");return t(),a(R,null,[h("div",Xe,[n.value?(t(),a("div",et,[h("div",tt,[v.data.loaded&&b.value?(t(),a("span",{key:0,class:"flex-none symbologyIcon",innerHTML:b.value},null,8,lt)):(t(),a("div",at,f[1]||(f[1]=[h("div",{class:"animate-spin spinner h-20 w-20"},null,-1)])))]),v.data.loaded?A((t(),a("span",{key:0,class:"pl-3 text-left flex-grow itemName",content:C.value,innerHTML:E(C.value),tabindex:v.inList?-1:0},null,8,st)),[[x,{options:{placement:"right"}}]]):(t(),a("div",it,I(w(y)("details.loading")),1)),v.data.loaded?(t(),a("span",nt,[z.value?A((t(),a("button",{key:0,type:"button",content:w(y)(`details.item.zoom${o.value==="none"?"":`.${o.value}`}`),"aria-label":w(y)(`grid.cells.zoom${o.value==="none"?"":`.${o.value}`}`),ref_key:"zoomButton",ref:r,onClick:f[0]||(f[0]=B=>{B.stopPropagation(),$()}),class:"text-gray-600 w-24 h-24 p-2 flex justify-center items-center"},[o.value==="zooming"?(t(),a("div",rt)):o.value==="zoomed"?(t(),a("svg",ot,f[2]||(f[2]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)]))):o.value==="error"?(t(),a("svg",dt,f[3]||(f[3]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(t(),a("span",{key:3,innerHTML:w(d).ui.getZoomIcon()},null,8,ct))],8,ut)),[[T,{placement:"bottom"}]]):O("",!0)])):O("",!0)])):O("",!0)]),v.open?(t(),V(_e(g.value),{key:0,identifyData:v.data,fields:P.value,fixtureFields:D.value,class:"p-8"},null,8,["identifyData","fields","fixtureFields"])):O("",!0)],64)}}}),vt={key:0,class:"layerName w-full flex-grow p-5 pb-8 font-bold truncate",tabIndex:"0"},pt={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},mt={for:"toggle"},yt={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},gt={class:"flex"},ft=["aria-label"],ht=["content","aria-label","disabled"],bt={class:"px-3 text-center flex-grow"},kt=["content","aria-label","disabled"],xt={key:3},wt={key:0},Lt=["content"],_t=["onClick"],Tt={key:1,class:"text-center"},jt={key:4,class:"p-5"},Mt=F({__name:"result-list",props:{uid:{type:String,required:!0},results:{type:Object,required:!0}},setup(v){const k=L(),i=()=>{k.value._tippy.hide()},d=s=>{s.key==="Tab"&&k.value?.matches(":focus")&&k.value._tippy.show()},p=ee("iApi"),_=J(),y=ne(),b=v,{t:o}=Z(),r=L(!1),c=L(p.fixture.get("details")),u=L(!0),e=L(!1),n=L(0),z=L(20),C=L([]),E=L([]),m=M(()=>_.activeGreedy),H=M(()=>_.properties),g=M(()=>n.value+z.value),P=()=>y.getLayerByUid(b.uid),D=()=>b.results.find(s=>s.uid===b.uid),q=M(()=>D()?.loaded??!1),$=M(()=>D()?.requestTime),l=M(()=>r.value&&(!e.value&&T().length>1||e.value&&T().length>z.value)),f=M(()=>{const s=P();return s&&H.value[s.id]&&H.value[s.id].name?H.value[s.id].name:s?.name??""}),x=M(()=>b.uid),T=()=>{const s=D();return s?s.items:[]},B=M(()=>T()[n.value]),ue=M(()=>{if(c.value.hasHilighter()){const s=P();if(s)return s.mapLayer&&s.supportsFeatures}return!1}),ye=s=>{u.value=s,_.hilightToggle=s,S()},ge=()=>{const s=P();n.value=n.value??0,u.value=_.hilightToggle??u.value,e.value=!1,r.value=!!s,S()},re=s=>{e.value?(n.value+=s*z.value,S()):n.value+=s},S=()=>{const s=T();if(u.value&&q.value&&s.length>0&&ue.value)if(e.value)c.value.hilightDetailsItems(s.slice(n.value,g.value),b.uid);else{const j=s[n.value];j&&c.value.hilightDetailsItems([j],b.uid)}else c.value.removeDetailsHilight()},fe=()=>{e.value=!0,n.value=Math.floor(n.value/z.value)*z.value,S()},he=()=>{c.value.removeDetailsHilight()},be=()=>{c.value.removeDetailsHilight()},ke=s=>{const j=n.value;n.value=s,e.value=!1,j===s&&S()};return ie(()=>{C.value.push(p.event.on(W.LAYER_REMOVE,s=>{const j=p.panel.get("details");b.uid===s.uid&&j&&j.close()})),C.value.push(p.event.on(W.PANEL_CLOSED,s=>{s.id==="details"&&he()})),C.value.push(p.event.on(W.PANEL_MINIMIZED,s=>{s.id==="details"&&be()})),C.value.push(p.event.on(W.MAP_BASEMAPCHANGE,s=>{u.value&&s.schemaChanged&&S()})),k.value?.addEventListener("blur",i),k.value?.addEventListener("keyup",d)}),Q(()=>{E.value.push(G(B,()=>{e.value||(ge(),B.value===void 0&&c.value.removeDetailsHilight())},{deep:!1,immediate:!0})),E.value.push(G(x,()=>{const s=b.uid;if(e.value&&s){const j=D();j&&j.loading.then(()=>{b.uid===s&&e.value&&S()})}},{deep:!1,immediate:!0})),E.value.push(G($,()=>{n.value=0})),E.value.push(G(()=>b.uid,()=>{n.value=0}))}),X(()=>{E.value.forEach(s=>s()),C.value.forEach(s=>p.event.off(s)),k.value?.removeEventListener("blur",i),k.value?.removeEventListener("keyup",d)}),(s,j)=>{const xe=N("truncate"),te=N("tippy"),we=N("focus-item"),Le=N("focus-list");return q.value&&m.value===0?(t(),a("div",{key:0,class:"detailsContent relative flex flex-col flex-grow pl-5",style:ve(v.results.length>1?{"margin-left":"42px"}:"")},[r.value?A((t(),a("h1",vt,[ae(I(f.value),1)])),[[xe,{options:{placement:"top-start"}}]]):O("",!0),ue.value?(t(),a("div",pt,[h("label",mt,I(w(o)("details.togglehilight.title")),1),le(ze,{config:{value:u.value,disabled:!1},onToggled:ye},null,8,["config"])])):O("",!0),l.value?(t(),a("div",yt,[h("div",gt,[e.value?O("",!0):(t(),a("button",{key:0,type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":w(o)("details.item.see.list"),onClick:j[0]||(j[0]=K=>fe())},I(w(o)("details.item.see.list")),9,ft)),h("div",{class:U(["flex ml-auto bg-gray-200 py-8 items-center",{"w-full":e.value}])},[A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.previous":"details.item.previous.item"),onClick:j[1]||(j[1]=K=>re(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.previous":"details.item.previous.item"),disabled:n.value===0},j[3]||(j[3]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,ht)),[[te,{placement:"top"}]]),h("span",bt,I(e.value?w(o)("details.items.range",[n.value+1,Math.min(g.value,T().length),T().length]):w(o)("details.item.count",[n.value+1,T().length])),1),A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.next":"details.item.next.item"),onClick:j[2]||(j[2]=K=>re(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.next":"details.item.next.item"),disabled:!e.value&&n.value===T().length-1||e.value&&g.value>=T().length},j[4]||(j[4]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,kt)),[[te,{placement:"top"}]])],2)])])):O("",!0),r.value?(t(),a("div",xt,[T().length>0?(t(),a("div",wt,[e.value?A((t(),a("div",{key:0,class:"flex flex-col",content:w(o)("details.layers.results.list.tooltip"),ref_key:"el",ref:k},[(t(!0),a(R,null,Y(T().slice(n.value,g.value),(K,oe)=>A((t(),a("button",{class:"flex flex-grow truncate default-focus-style hover:bg-gray-200",key:oe,onClick:Et=>ke(n.value+oe)},[le(ce,{data:K,uid:v.uid,open:!1,"in-list":!0},null,8,["data","uid"])],8,_t)),[[we,"show-truncate"]])),128))],8,Lt)),[[Le],[te,{trigger:"manual",placement:"top-start",touch:!1}]]):(t(),V(ce,{key:1,data:B.value,uid:v.uid,open:!0,"in-list":!1},null,8,["data","uid"]))])):(t(),a("div",Tt,I(w(o)("details.layers.results.empty.currentLayer")),1))])):(t(),a("div",jt,I(w(o)("details.item.no.data")),1))],4)):(t(),a("div",{key:1,class:U(["flex justify-center py-10 items-center",v.results.length>1?"ml-42":""])},[j[5]||(j[5]=h("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1)),ae(" "+I(w(o)("details.item.loading")),1)],2))}}}),zt=se(Mt,[["__scopeId","data-v-3a47d6ad"]]),Ht={class:"relative h-full"},$t={class:"detailsContentSection overflow-y-auto h-full"},qt=F({__name:"details-screen",props:{panel:{type:Object}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=J(),p=L([]),_=L([]),y=L([]),b=L(!1),o=L(""),r=M(()=>d.activeGreedy),c=M(()=>d.payload),u=M(()=>d.properties),e=m=>{o.value=m},n=m=>y.value.find(H=>H.uid===m),z=m=>{m!==void 0&&(d.activeGreedy=m.length===0?0:m[0].requestTime,y.value=m,C(m))},C=m=>{if(o.value){const H=n(o.value);H?H.loading.then(()=>{H.requestTime===r.value&&(H.items.length>0?(d.activeGreedy=0,b.value=!1):E(m))}):E(m)}else E(m)},E=(m,H)=>{let g;if(H)g=H;else{const $=d.properties,l=m.map(x=>[$[x.layerId]?.priority??50,x.layerId]),f=new Set(l.map(x=>x[0]));g=[],f.forEach(x=>{const T=l.filter(B=>B[0]===x).map(B=>B[1]);g.push([x,T])}),g.sort((x,T)=>T[0]-x[0])}if(g.length===0){d.activeGreedy=0,b.value=!0;return}const P=g[g.length-1][1],D=m.filter($=>P.includes($.layerId)).map($=>$.loading.then(()=>$.items.length>0?Promise.resolve($):Promise.reject())),q=m.length===0?0:m[0].requestTime;Promise.any(D).then($=>{$.requestTime===r.value&&(d.activeGreedy=0,o.value=$.uid,b.value=!1)}).catch(()=>{q===r.value&&(g.pop(),E(m,g))})};return Q(()=>{_.value.push(G(c,m=>{z(m)},{deep:!1,immediate:!0}))}),X(()=>{p.value.forEach(m=>i.event.off(m)),_.value.forEach(m=>m())}),(m,H)=>{const g=Te("panel-screen");return t(),V(g,{panel:v.panel},{header:de(()=>[ae(I(w(d).origin==="toggleEvent"?w(k)("details.layers.title.gridOrigin"):w(k)("details.layers.title.identifyOrigin")),1)]),content:de(()=>[h("div",Ht,[y.value.length>1?(t(),V(Ze,{key:0,results:y.value,detailsProperties:u.value,selected:o.value,onSelectionChanged:e},null,8,["results","detailsProperties","selected"])):O("",!0),h("div",$t,[b.value?(t(),a("div",{key:1,class:U(["text-center",{"ml-42":y.value.length>1}])},I(y.value.length>=1?w(k)("details.layers.results.empty"):w(k)("details.layers.results.empty.noLayers")),3)):(t(),V(zt,{key:0,uid:o.value,results:y.value},null,8,["uid","results"]))])])]),_:1},8,["panel"])}}}),Ct=se(qt,[["__scopeId","data-v-2a8a1e06"]]);export{Ct as default}; diff --git a/main/assets/diffUtils-Cz3Fi8Xb-BvD0JNhD.js b/main/assets/diffUtils-Cz3Fi8Xb-BvD0JNhD.js new file mode 100644 index 000000000..979feb493 --- /dev/null +++ b/main/assets/diffUtils-Cz3Fi8Xb-BvD0JNhD.js @@ -0,0 +1 @@ +import{ag as g,bU as D,j as w}from"./main-C7yV2j71.js";const A=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function y(e){return e instanceof w}function b(e){return e instanceof g?Object.keys(e.items):y(e)?D(e).keys():e?Object.keys(e):[]}function p(e,n){return e instanceof g?e.items[n]:e[n]}function k(e,n){return!(!Array.isArray(e)||!Array.isArray(n))&&e.length!==n.length}function c(e){return e?e.declaredClass:null}function h(e,n){const o=e.diff;if(o&&typeof o=="function")return o(e,n);const i=b(e),f=b(n);if(i.length===0&&f.length===0)return;if(!i.length||!f.length||k(e,n))return{type:"complete",oldValue:e,newValue:n};const s=f.filter(t=>!i.includes(t)),V=i.filter(t=>!f.includes(t)),m=i.filter(t=>f.includes(t)&&p(e,t)!==p(n,t)).concat(s,V).sort(),d=c(e);if(d&&A.has(d)&&m.length)return{type:"complete",oldValue:e,newValue:n};let a;const j=y(e)&&y(n);for(const t of m){const l=p(e,t),r=p(n,t);let u;if((j||typeof l!="function"&&typeof r!="function")&&l!==r&&(l!=null||r!=null)){if(o&&o[t]&&typeof o[t]=="function")u=o[t]?.(l,r);else if(l instanceof Date&&r instanceof Date){if(l.getTime()===r.getTime())continue;u={type:"complete",oldValue:l,newValue:r}}else u=typeof l=="object"&&typeof r=="object"&&c(l)===c(r)?h(l,r):{type:"complete",oldValue:l,newValue:r};u!=null&&(a!=null?a.diff[t]=u:a={type:"partial",diff:{[t]:u}})}}return a}function S(e,n){return O(e,n)}function O(e,n){if(e==null)return!1;const o=n.split(".");let i=e;for(const f of o){if(i.type==="complete")return!0;if(i.type!=="partial")return!1;{const s=i.diff[f];if(!s)return!1;i=s}}return!0}function C(e,n){if(!e)return!1;if(e.type==="partial"){const o=Object.keys(e.diff);return o.length===1&&o[0]===n}return!1}function T(e,n){if(typeof e!="function"&&typeof n!="function"&&(e!=null||n!=null))return e==null||n==null||typeof e=="object"&&typeof n=="object"&&c(e)!==c(n)?{type:"complete",oldValue:e,newValue:n}:h(e,n)}export{C,T as P,S,O as g}; diff --git a/main/assets/diffUtils-Cz3Fi8Xb-DBwynpLu.js b/main/assets/diffUtils-Cz3Fi8Xb-DBwynpLu.js deleted file mode 100644 index 8b29493cf..000000000 --- a/main/assets/diffUtils-Cz3Fi8Xb-DBwynpLu.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as g,bU as D,j as w}from"./main-BZaw9FpY.js";const A=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function y(e){return e instanceof w}function b(e){return e instanceof g?Object.keys(e.items):y(e)?D(e).keys():e?Object.keys(e):[]}function p(e,n){return e instanceof g?e.items[n]:e[n]}function k(e,n){return!(!Array.isArray(e)||!Array.isArray(n))&&e.length!==n.length}function c(e){return e?e.declaredClass:null}function h(e,n){const o=e.diff;if(o&&typeof o=="function")return o(e,n);const i=b(e),f=b(n);if(i.length===0&&f.length===0)return;if(!i.length||!f.length||k(e,n))return{type:"complete",oldValue:e,newValue:n};const s=f.filter(t=>!i.includes(t)),V=i.filter(t=>!f.includes(t)),m=i.filter(t=>f.includes(t)&&p(e,t)!==p(n,t)).concat(s,V).sort(),d=c(e);if(d&&A.has(d)&&m.length)return{type:"complete",oldValue:e,newValue:n};let a;const j=y(e)&&y(n);for(const t of m){const l=p(e,t),r=p(n,t);let u;if((j||typeof l!="function"&&typeof r!="function")&&l!==r&&(l!=null||r!=null)){if(o&&o[t]&&typeof o[t]=="function")u=o[t]?.(l,r);else if(l instanceof Date&&r instanceof Date){if(l.getTime()===r.getTime())continue;u={type:"complete",oldValue:l,newValue:r}}else u=typeof l=="object"&&typeof r=="object"&&c(l)===c(r)?h(l,r):{type:"complete",oldValue:l,newValue:r};u!=null&&(a!=null?a.diff[t]=u:a={type:"partial",diff:{[t]:u}})}}return a}function S(e,n){return O(e,n)}function O(e,n){if(e==null)return!1;const o=n.split(".");let i=e;for(const f of o){if(i.type==="complete")return!0;if(i.type!=="partial")return!1;{const s=i.diff[f];if(!s)return!1;i=s}}return!0}function C(e,n){if(!e)return!1;if(e.type==="partial"){const o=Object.keys(e.diff);return o.length===1&&o[0]===n}return!1}function T(e,n){if(typeof e!="function"&&typeof n!="function"&&(e!=null||n!=null))return e==null||n==null||typeof e=="object"&&typeof n=="object"&&c(e)!==c(n)?{type:"complete",oldValue:e,newValue:n}:h(e,n)}export{C,T as P,S,O as g}; diff --git a/main/assets/drapedUtils-BZ1SGPtE-BPt00fGU.js b/main/assets/drapedUtils-BZ1SGPtE-BPt00fGU.js new file mode 100644 index 000000000..48cdd9b48 --- /dev/null +++ b/main/assets/drapedUtils-BZ1SGPtE-BPt00fGU.js @@ -0,0 +1 @@ +import{n as m,p as c}from"./main-C7yV2j71.js";function u(n,e){return e?"xoffset"in e&&e.xoffset?Math.max(n,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(n,Math.abs(e.yoffset||0)):n:n}function x(n){let e=0,r=0;for(let t=0;ta.type==="size").map(a=>{const{maxSize:s,minSize:f}=a;return(p(s,n)+p(f,n))/2});let t=0;const i=r.length;if(i===0)return n;for(let a=0;a{o=u(o,a.symbol)}),o}if(e.type==="class-breaks"){let o=i;return e.classBreakInfos.forEach(a=>{o=u(o,a.symbol)}),o}return e.type==="dot-density"||e.type,i}function d(n,e,r,t=new m){let i=0;if(r.type==="2d")i=e*(r.resolution??0);else if(r.type==="3d"){const h=r.overlayPixelSizeInMapUnits(n),l=r.basemapSpatialReference;i=l==null||l.equals(r.spatialReference)?e*h:c(l)/c(r.spatialReference)}const o=n.x-i,a=n.y-i,s=n.x+i,f=n.y+i,{spatialReference:y}=r;return t.xmin=Math.min(o,s),t.ymin=Math.min(a,f),t.xmax=Math.max(o,s),t.ymax=Math.max(a,f),t.spatialReference=y,t}function q(n,e,r){const t=r.toMap(n);return t==null?!1:d(t,b(),r,z).intersects(e)}const z=new m;export{d as x,b as y,q as z}; diff --git a/main/assets/drapedUtils-BZ1SGPtE-DN0L7Y_o.js b/main/assets/drapedUtils-BZ1SGPtE-DN0L7Y_o.js deleted file mode 100644 index cc821c6ce..000000000 --- a/main/assets/drapedUtils-BZ1SGPtE-DN0L7Y_o.js +++ /dev/null @@ -1 +0,0 @@ -import{n as m,p as c}from"./main-BZaw9FpY.js";function u(n,e){return e?"xoffset"in e&&e.xoffset?Math.max(n,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(n,Math.abs(e.yoffset||0)):n:n}function x(n){let e=0,r=0;for(let t=0;ta.type==="size").map(a=>{const{maxSize:s,minSize:f}=a;return(p(s,n)+p(f,n))/2});let t=0;const i=r.length;if(i===0)return n;for(let a=0;a{o=u(o,a.symbol)}),o}if(e.type==="class-breaks"){let o=i;return e.classBreakInfos.forEach(a=>{o=u(o,a.symbol)}),o}return e.type==="dot-density"||e.type,i}function d(n,e,r,t=new m){let i=0;if(r.type==="2d")i=e*(r.resolution??0);else if(r.type==="3d"){const h=r.overlayPixelSizeInMapUnits(n),l=r.basemapSpatialReference;i=l==null||l.equals(r.spatialReference)?e*h:c(l)/c(r.spatialReference)}const o=n.x-i,a=n.y-i,s=n.x+i,f=n.y+i,{spatialReference:y}=r;return t.xmin=Math.min(o,s),t.ymin=Math.min(a,f),t.xmax=Math.max(o,s),t.ymax=Math.max(a,f),t.spatialReference=y,t}function q(n,e,r){const t=r.toMap(n);return t==null?!1:d(t,b(),r,z).intersects(e)}const z=new m;export{d as x,b as y,q as z}; diff --git a/main/assets/edgeProcessing-CALv8P-b-BX_riuLT.js b/main/assets/edgeProcessing-CALv8P-b-BX_riuLT.js new file mode 100644 index 000000000..b94273c6c --- /dev/null +++ b/main/assets/edgeProcessing-CALv8P-b-BX_riuLT.js @@ -0,0 +1 @@ +import{v as It}from"./deduplicate-D2d-E5Pw-eujRBTUy.js";import{R as F}from"./InterleavedLayout-DXzw3B2n-BD0-ikLj.js";import{T as l}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{p as Q}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{dD as tt,ha as St,dU as w,bj as dt,ae as Ot,ff as At}from"./main-C7yV2j71.js";import{g as Et,_ as j,A as st,y as H,W as wt,S as ht,r as rt,l as pt,j as Tt}from"./vec32-D9GsKZ1t-CXe4l2D-.js";const Mt=F().vec3f(l.POSITION).u16(l.COMPONENTINDEX).freeze(),Rt=F().vec2u8(l.SIDENESS).freeze();Q(Rt);const q=F().vec3f(l.POSITION0).vec3f(l.POSITION1).vec2i16(l.NORMALCOMPRESSED).u16(l.COMPONENTINDEX).u8(l.VARIANTOFFSET,{glNormalized:!0}).u8(l.VARIANTSTROKE).u8(l.VARIANTEXTENSION,{glNormalized:!0}).freeze(),G=F().vec3f(l.POSITION0).vec3f(l.POSITION1).vec2i16(l.NORMALCOMPRESSED).vec2i16(l.NORMAL2COMPRESSED).u16(l.COMPONENTINDEX).u8(l.VARIANTOFFSET,{glNormalized:!0}).u8(l.VARIANTSTROKE).u8(l.VARIANTEXTENSION,{glNormalized:!0}).freeze();l.POSITION0,l.POSITION1,l.COMPONENTINDEX,l.VARIANTOFFSET,l.VARIANTSTROKE,l.VARIANTEXTENSION,l.NORMALCOMPRESSED,l.NORMAL2COMPRESSED,l.SIDENESS;let yt=class{constructor(){this.position0=w(),this.position1=w(),this.faceNormal0=w(),this.faceNormal1=w(),this.componentIndex=0,this.cosAngle=0}};const U=-1;function vt(t,n,o){const r=t.vertices.position,i=t.vertices.componentIndex,c=S.position0,h=S.position1,g=S.faceNormal0,m=S.faceNormal1,{edges:a,normals:d}=Ct(t),N=a.length/4,A=n.allocate(N);let V=0;const _=N,T=o?.allocate(_);let B=0,e=0,s=0;W.length=0;for(let p=0;pR.length-p.length);const f=new Array,u=new Array;W.forAll(({length:p,index:R})=>{const C=a.data[R],mt=a.data[R+1],et=a.data[R+2],nt=a.data[R+3],ot=nt===U;if(r.getVec(C,c),r.getVec(mt,h),ot){const E=3*et;j(g,d.data[E],d.data[E+1],d.data[E+2]),st(m,g),S.componentIndex=i.get(C),S.cosAngle=H(g,m)}else{let E=3*et;if(j(g,d.data[E],d.data[E+1],d.data[E+2]),E=3*nt,j(m,d.data[E],d.data[E+1],d.data[E+2]),S.componentIndex=i.get(C),S.cosAngle=H(g,m),Vt(S,Lt))return;S.cosAngle<-.9999&&st(m,g)}e+=p,s++,ot||Pt(S,_t)?(n.write(A,V++,S),f.push(p)):Dt(S,gt)&&(T&&o&&o.write(T,B++,S),u.push(p))});const O=new Float32Array(f.reverse()),M=new Float32Array(u.reverse()),y=T&&o?{instancesData:T.slice(0,B),lodInfo:{lengths:M}}:void 0;return{regular:{instancesData:A.slice(0,V),lodInfo:{lengths:O}},silhouette:y,averageEdgeLength:e/s}}function Pt(t,n){return t.cosAnglen}function Dt(t,n){const o=St(t.cosAngle);return wt(it,t.position1,t.position0),o*(H(ht(xt,t.faceNormal0,t.faceNormal1),it)>0?-1:1)>n}function Ct(t){const n=t.faces.length/3,o=t.faces,r=t.neighbors,i=t.vertices.position;I.length=k.length=0;for(let c=0;ct||new bt,deallocator:null}),I=new tt({deallocator:null}),k=new tt({deallocator:null}),S=new yt,xt=w(),it=w(),D=w(),X=w(),z=w(),gt=dt(4),Lt=Math.cos(gt),Ft=dt(35),_t=Math.cos(Ft);function at(t,n,o){const r=n/3,i=new Uint32Array(o+1),c=new Uint32Array(o+1),h=(e,s)=>{e{if(e{const f=2*e,u=s-e;for(let O=1;O=0&&a[f+2*p]>M;p--)a[f+2*p+2]=a[f+2*p],a[f+2*p+3]=a[f+2*p+1];a[f+2*p+2]=M,a[f+2*p+3]=y}};for(let e=0;ee===t[3*s]?0:e===t[3*s+1]?1:e===t[3*s+2]?2:-1,T=(e,s)=>{const f=_(e,s);V[3*s+f]=-1},B=(e,s,f,u)=>{const O=_(e,s);V[3*s+O]=u;const M=_(f,u);V[3*u+M]=s};for(let e=0;e=0?1:-1)*(1-Math.abs(m)):g,d=i<=0?(m>=0?1:-1)*(1-Math.abs(g)):m,N=n*c;t[N]=ct(a),t[N+1]=ct(d)}function ct(t){return Ot(Math.round(32767*t),-32767,32767)}const K=.7;let Nt=class{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?Wt:Bt}write(t,n,o){$.seed=this._edgeHashFunction(o);const r=$.getIntRange(0,255),i=$.getIntRange(0,this.settings.variants-1),c=$.getFloat(),h=255*(.5*Xt(-(1-Math.min(c/K,1))+Math.max(0,c-K)/(1-K),1.2)+.5);t.position0.setVec(n,o.position0),t.position1.setVec(n,o.position1),t.componentIndex.set(n,o.componentIndex),t.variantOffset.set(n,r),t.variantStroke.set(n,i),t.variantExtension.set(n,h)}};const v=new Float32Array(6),P=new Uint32Array(v.buffer),L=new Uint32Array(1);function Bt(t){return v[0]=t.position0[0],v[1]=t.position0[1],v[2]=t.position0[2],v[3]=t.position1[0],v[4]=t.position1[1],v[5]=t.position1[2],L[0]=31*(31*(31*(31*(31*(166811+P[0])+P[1])+P[2])+P[3])+P[4])+P[5],L[0]}function Wt(t){const n=v;n[0]=b(t.position0[0]),n[1]=b(t.position0[1]),n[2]=b(t.position0[2]),n[3]=b(t.position1[0]),n[4]=b(t.position1[1]),n[5]=b(t.position1[2]),L[0]=5381;for(let o=0;oR.length-p.length);const f=new Array,u=new Array;W.forAll(({length:p,index:R})=>{const C=a.data[R],mt=a.data[R+1],et=a.data[R+2],nt=a.data[R+3],ot=nt===U;if(r.getVec(C,c),r.getVec(mt,h),ot){const E=3*et;j(g,d.data[E],d.data[E+1],d.data[E+2]),st(m,g),S.componentIndex=i.get(C),S.cosAngle=H(g,m)}else{let E=3*et;if(j(g,d.data[E],d.data[E+1],d.data[E+2]),E=3*nt,j(m,d.data[E],d.data[E+1],d.data[E+2]),S.componentIndex=i.get(C),S.cosAngle=H(g,m),Vt(S,Lt))return;S.cosAngle<-.9999&&st(m,g)}e+=p,s++,ot||Pt(S,_t)?(n.write(A,V++,S),f.push(p)):Dt(S,gt)&&(T&&o&&o.write(T,B++,S),u.push(p))});const O=new Float32Array(f.reverse()),M=new Float32Array(u.reverse()),y=T&&o?{instancesData:T.slice(0,B),lodInfo:{lengths:M}}:void 0;return{regular:{instancesData:A.slice(0,V),lodInfo:{lengths:O}},silhouette:y,averageEdgeLength:e/s}}function Pt(t,n){return t.cosAnglen}function Dt(t,n){const o=St(t.cosAngle);return wt(it,t.position1,t.position0),o*(H(ht(xt,t.faceNormal0,t.faceNormal1),it)>0?-1:1)>n}function Ct(t){const n=t.faces.length/3,o=t.faces,r=t.neighbors,i=t.vertices.position;I.length=k.length=0;for(let c=0;ct||new bt,deallocator:null}),I=new tt({deallocator:null}),k=new tt({deallocator:null}),S=new yt,xt=w(),it=w(),D=w(),X=w(),z=w(),gt=dt(4),Lt=Math.cos(gt),Ft=dt(35),_t=Math.cos(Ft);function at(t,n,o){const r=n/3,i=new Uint32Array(o+1),c=new Uint32Array(o+1),h=(e,s)=>{e{if(e{const f=2*e,u=s-e;for(let O=1;O=0&&a[f+2*p]>M;p--)a[f+2*p+2]=a[f+2*p],a[f+2*p+3]=a[f+2*p+1];a[f+2*p+2]=M,a[f+2*p+3]=y}};for(let e=0;ee===t[3*s]?0:e===t[3*s+1]?1:e===t[3*s+2]?2:-1,T=(e,s)=>{const f=_(e,s);V[3*s+f]=-1},B=(e,s,f,u)=>{const O=_(e,s);V[3*s+O]=u;const M=_(f,u);V[3*u+M]=s};for(let e=0;e=0?1:-1)*(1-Math.abs(m)):g,d=i<=0?(m>=0?1:-1)*(1-Math.abs(g)):m,N=n*c;t[N]=ct(a),t[N+1]=ct(d)}function ct(t){return Ot(Math.round(32767*t),-32767,32767)}const K=.7;let Nt=class{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?Wt:Bt}write(t,n,o){$.seed=this._edgeHashFunction(o);const r=$.getIntRange(0,255),i=$.getIntRange(0,this.settings.variants-1),c=$.getFloat(),h=255*(.5*Xt(-(1-Math.min(c/K,1))+Math.max(0,c-K)/(1-K),1.2)+.5);t.position0.setVec(n,o.position0),t.position1.setVec(n,o.position1),t.componentIndex.set(n,o.componentIndex),t.variantOffset.set(n,r),t.variantStroke.set(n,i),t.variantExtension.set(n,h)}};const v=new Float32Array(6),P=new Uint32Array(v.buffer),L=new Uint32Array(1);function Bt(t){return v[0]=t.position0[0],v[1]=t.position0[1],v[2]=t.position0[2],v[3]=t.position1[0],v[4]=t.position1[1],v[5]=t.position1[2],L[0]=31*(31*(31*(31*(31*(166811+P[0])+P[1])+P[2])+P[3])+P[4])+P[5],L[0]}function Wt(t){const n=v;n[0]=b(t.position0[0]),n[1]=b(t.position0[1]),n[2]=b(t.position0[2]),n[3]=b(t.position1[0]),n[4]=b(t.position1[1]),n[5]=b(t.position1[2]),L[0]=5381;for(let o=0;o{(o.addedFeatures.length||o.updatedFeatures.length||o.deletedFeatures.length||o.addedAttachments.length||o.updatedAttachments.length||o.deletedAttachments.length)&&e.emit("edits",o)});const i={result:s.promise};e.emit("apply-edits",i)}try{const{results:i,edits:o}=await C(e,t,r,a),u=l=>l.filter(h=>!h.error).map(v),c={edits:o,addedFeatures:u(i.addFeatureResults),updatedFeatures:u(i.updateFeatureResults),deletedFeatures:u(i.deleteFeatureResults),addedAttachments:u(i.addAttachmentResults),updatedAttachments:u(i.updateAttachmentResults),deletedAttachments:u(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:a.globalIdToObjectId};return i.editedFeatureResults?.length&&(c.editedFeatures=i.editedFeatureResults),s.resolve(c),i}catch(i){throw s.reject(i),i}}async function C(e,t,r,a){if(await e.load(),!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!$(e))throw new n(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:d}=await D(e,r,a);return s.addFeatures?.length||s.updateFeatures?.length||s.deleteFeatures?.length||s.addAttachments?.length||s.updateAttachments?.length||s.deleteAttachments?.length?{edits:s,results:await t.applyEdits(s,d)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function D(e,t,r){const a=w(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),d=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),p=e.infoFor3D!=null;if(Q(t,a,r,!!s,!!d,`${e.type}-layer`),!a.data.isVersioned&&r?.gdbVersion)throw new n(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!a.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const i={...r};if(i.rollbackOnFailureEnabled!=null||a.editing.supportsRollbackOnFailure||(i.rollbackOnFailureEnabled=!0),i.rollbackOnFailureEnabled||i.returnServiceEditsOption!=="original-and-current-features"||(i.rollbackOnFailureEnabled===!1&&E.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),i.rollbackOnFailureEnabled=!0),!a.editing.supportsReturnServiceEditsInSourceSpatialReference&&i.returnServiceEditsInSourceSR)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(i.returnServiceEditsInSourceSR&&i.returnServiceEditsOption!=="original-and-current-features")throw new n(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const o=P(t,a,`${e.type}-layer`),u=r?.globalIdUsed||p,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(u){const{globalIdField:l}=e;if(l==null)throw new n(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");o.addFeatures.forEach(h=>q(h,l))}return o.addFeatures.forEach(l=>N(l,e,u,c)),o.updateFeatures.forEach(l=>x(l,e,u,c)),o.deleteFeatures.forEach(l=>Z(l,e,u,c)),o.addAttachments.forEach(l=>m(l,e)),o.updateAttachments.forEach(l=>m(l,e)),p&&await X(o,e),{edits:await J(o),options:i}}function f(e,t,r,a){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(a.length&&"attributes"in e)for(const s of a){const d=e.attributes[s.name];if(d!==void 0&&!k(s,d))throw new n(`${t.type}-layer:invalid-parameter`,`Big-integer field '${s.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&t.capabilities?.data.supportsZ===!1)throw new n(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&t.capabilities?.data.supportsM===!1)throw new n(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function I(e,t){if("geometry"in e&&e.geometry?.type==="mesh"&&t.infoFor3D!=null&&t.spatialReference!=null){const{geometry:r}=e,{spatialReference:a,vertexSpace:s}=r,d=t.spatialReference,p=s.type==="local",i=L(d),o=B(d,a),u=o||y(d)&&(y(a)||U(a));if(!(p&&i&&u||!p&&!i&&o))throw new n(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${s.type} vertex space and a spatial reference wkid:${a.wkid} to a layer with a spatial reference wkid:${d.wkid} is not supported.`)}}function N(e,t,r,a){f(e,t,r,a),I(e,t)}function Z(e,t,r,a){f(e,t,r,a)}function x(e,t,r,a){f(e,t,r,a),I(e,t);const s=w(t);if("geometry"in e&&e.geometry!=null&&!s?.editing.supportsGeometryUpdate)throw new n(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){const{feature:r,attachment:a}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!a.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!a.data&&!a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(a.data instanceof File&&a.data.name)&&!a.name)throw new n(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof a.data=="string"){const s=S(a.data);if(s&&!s.isBase64)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function q(e,t){const{attributes:r}=e;r[t]==null&&(r[t]=j())}async function J(e){const t=e.addFeatures??[],r=e.updateFeatures??[],a=t.concat(r).map(i=>i.geometry),s=await G(a),d=t.length,p=r.length;return s.slice(0,d).forEach((i,o)=>t[o].geometry=i),s.slice(d,d+p).forEach((i,o)=>r[o].geometry=i),e}function _(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&R.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function P(e,t,r){const a=_(e);if(a.addFeatures?.length&&!t.operations.supportsAdd)throw new n(`${r}:unsupported-operation`,"Layer does not support adding features.");if(a.updateFeatures?.length&&!t.operations.supportsUpdate)throw new n(`${r}:unsupported-operation`,"Layer does not support updating features.");if(a.deleteFeatures?.length&&!t.operations.supportsDelete)throw new n(`${r}:unsupported-operation`,"Layer does not support deleting features.");return a.addFeatures=a.addFeatures.map(g),a.updateFeatures=a.updateFeatures.map(g),a.addAssetFeatures=[],a}function Q(e,t,r,a,s,d){if(!e||!a&&!s)throw new n(`${d}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new n(`${d}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new n(`${d}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&s)throw new n(`${d}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function g(e){const t=new O;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function X(e,t){const{infoFor3D:r}=t;if(r==null)return;if(!M(r))throw new n(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const s of e.addFeatures??[])b(s)&&a.push(s);for(const s of e.updateFeatures??[])b(s)&&a.push(s)}function b(e){return e?.geometry?.type==="mesh"}function de(e,t,r,a){if(!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,a)}export{oe as applyEdits,Q as checkEditingCapabilities,ne as isFeatureIdentifierArrayWithGlobalId,ie as isFeatureIdentifierArrayWithObjectId,W as isFeatureIdentifierWithGlobalId,V as isFeatureIdentifierWithObjectId,_ as normalizeCollections,P as normalizeEdits,J as normalizeGeometries,g as shallowCloneFeature,de as uploadAssets}; diff --git a/main/assets/editingSupport-gUqP9iyf-Bz3XNCt8.js b/main/assets/editingSupport-gUqP9iyf-Bz3XNCt8.js deleted file mode 100644 index 313606994..000000000 --- a/main/assets/editingSupport-gUqP9iyf-Bz3XNCt8.js +++ /dev/null @@ -1 +0,0 @@ -import{b as A,P as v,o as n,bF as $,bE as w,a1 as E,eh as S,ag as R,bi as O,jg as k,dB as L,aC as B,dQ as y,dR as U}from"./main-BZaw9FpY.js";import{a as j}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{B as G}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{B as T,z}from"./EditBusLayer-Df29OyJh-C36maE2j.js";import{g as M}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";function F(e){return e?.applyEdits!=null}function V(e){return typeof e=="object"&&e!=null&&"objectId"in e&&!!e.objectId}function ie(e){return e.every(V)}function W(e){return typeof e=="object"&&e!=null&&"globalId"in e&&!!e.globalId}function ne(e){return e.every(W)}async function oe(e,t,r,a={}){let s;const d="gdbVersion"in e?e.gdbVersion:null,p=a.gdbVersion??d;if(T(e)&&e.url)s=z(e.url,e.layerId,p,a.returnServiceEditsOption==="original-and-current-features");else{s=A(),s.promise.then(o=>{(o.addedFeatures.length||o.updatedFeatures.length||o.deletedFeatures.length||o.addedAttachments.length||o.updatedAttachments.length||o.deletedAttachments.length)&&e.emit("edits",o)});const i={result:s.promise};e.emit("apply-edits",i)}try{const{results:i,edits:o}=await C(e,t,r,a),u=l=>l.filter(h=>!h.error).map(v),c={edits:o,addedFeatures:u(i.addFeatureResults),updatedFeatures:u(i.updateFeatureResults),deletedFeatures:u(i.deleteFeatureResults),addedAttachments:u(i.addAttachmentResults),updatedAttachments:u(i.updateAttachmentResults),deletedAttachments:u(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:a.globalIdToObjectId};return i.editedFeatureResults?.length&&(c.editedFeatures=i.editedFeatureResults),s.resolve(c),i}catch(i){throw s.reject(i),i}}async function C(e,t,r,a){if(await e.load(),!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!$(e))throw new n(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:d}=await D(e,r,a);return s.addFeatures?.length||s.updateFeatures?.length||s.deleteFeatures?.length||s.addAttachments?.length||s.updateAttachments?.length||s.deleteAttachments?.length?{edits:s,results:await t.applyEdits(s,d)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function D(e,t,r){const a=w(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),d=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),p=e.infoFor3D!=null;if(Q(t,a,r,!!s,!!d,`${e.type}-layer`),!a.data.isVersioned&&r?.gdbVersion)throw new n(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!a.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const i={...r};if(i.rollbackOnFailureEnabled!=null||a.editing.supportsRollbackOnFailure||(i.rollbackOnFailureEnabled=!0),i.rollbackOnFailureEnabled||i.returnServiceEditsOption!=="original-and-current-features"||(i.rollbackOnFailureEnabled===!1&&E.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),i.rollbackOnFailureEnabled=!0),!a.editing.supportsReturnServiceEditsInSourceSpatialReference&&i.returnServiceEditsInSourceSR)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(i.returnServiceEditsInSourceSR&&i.returnServiceEditsOption!=="original-and-current-features")throw new n(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const o=P(t,a,`${e.type}-layer`),u=r?.globalIdUsed||p,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(u){const{globalIdField:l}=e;if(l==null)throw new n(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");o.addFeatures.forEach(h=>q(h,l))}return o.addFeatures.forEach(l=>N(l,e,u,c)),o.updateFeatures.forEach(l=>x(l,e,u,c)),o.deleteFeatures.forEach(l=>Z(l,e,u,c)),o.addAttachments.forEach(l=>m(l,e)),o.updateAttachments.forEach(l=>m(l,e)),p&&await X(o,e),{edits:await J(o),options:i}}function f(e,t,r,a){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(a.length&&"attributes"in e)for(const s of a){const d=e.attributes[s.name];if(d!==void 0&&!k(s,d))throw new n(`${t.type}-layer:invalid-parameter`,`Big-integer field '${s.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&t.capabilities?.data.supportsZ===!1)throw new n(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&t.capabilities?.data.supportsM===!1)throw new n(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function I(e,t){if("geometry"in e&&e.geometry?.type==="mesh"&&t.infoFor3D!=null&&t.spatialReference!=null){const{geometry:r}=e,{spatialReference:a,vertexSpace:s}=r,d=t.spatialReference,p=s.type==="local",i=L(d),o=B(d,a),u=o||y(d)&&(y(a)||U(a));if(!(p&&i&&u||!p&&!i&&o))throw new n(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${s.type} vertex space and a spatial reference wkid:${a.wkid} to a layer with a spatial reference wkid:${d.wkid} is not supported.`)}}function N(e,t,r,a){f(e,t,r,a),I(e,t)}function Z(e,t,r,a){f(e,t,r,a)}function x(e,t,r,a){f(e,t,r,a),I(e,t);const s=w(t);if("geometry"in e&&e.geometry!=null&&!s?.editing.supportsGeometryUpdate)throw new n(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){const{feature:r,attachment:a}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!a.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!a.data&&!a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(a.data instanceof File&&a.data.name)&&!a.name)throw new n(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof a.data=="string"){const s=S(a.data);if(s&&!s.isBase64)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function q(e,t){const{attributes:r}=e;r[t]==null&&(r[t]=j())}async function J(e){const t=e.addFeatures??[],r=e.updateFeatures??[],a=t.concat(r).map(i=>i.geometry),s=await G(a),d=t.length,p=r.length;return s.slice(0,d).forEach((i,o)=>t[o].geometry=i),s.slice(d,d+p).forEach((i,o)=>r[o].geometry=i),e}function _(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&R.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function P(e,t,r){const a=_(e);if(a.addFeatures?.length&&!t.operations.supportsAdd)throw new n(`${r}:unsupported-operation`,"Layer does not support adding features.");if(a.updateFeatures?.length&&!t.operations.supportsUpdate)throw new n(`${r}:unsupported-operation`,"Layer does not support updating features.");if(a.deleteFeatures?.length&&!t.operations.supportsDelete)throw new n(`${r}:unsupported-operation`,"Layer does not support deleting features.");return a.addFeatures=a.addFeatures.map(g),a.updateFeatures=a.updateFeatures.map(g),a.addAssetFeatures=[],a}function Q(e,t,r,a,s,d){if(!e||!a&&!s)throw new n(`${d}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new n(`${d}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new n(`${d}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&s)throw new n(`${d}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function g(e){const t=new O;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function X(e,t){const{infoFor3D:r}=t;if(r==null)return;if(!M(r))throw new n(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const s of e.addFeatures??[])b(s)&&a.push(s);for(const s of e.updateFeatures??[])b(s)&&a.push(s)}function b(e){return e?.geometry?.type==="mesh"}function de(e,t,r,a){if(!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,a)}export{oe as applyEdits,Q as checkEditingCapabilities,ne as isFeatureIdentifierArrayWithGlobalId,ie as isFeatureIdentifierArrayWithObjectId,W as isFeatureIdentifierWithGlobalId,V as isFeatureIdentifierWithObjectId,_ as normalizeCollections,P as normalizeEdits,J as normalizeGeometries,g as shallowCloneFeature,de as uploadAssets}; diff --git a/main/assets/editingTools-BZ3yVmXf-BJsElS9B.js b/main/assets/editingTools-BZ3yVmXf-BJsElS9B.js deleted file mode 100644 index a4fbd521e..000000000 --- a/main/assets/editingTools-BZ3yVmXf-BJsElS9B.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-BWKp46iV.js","./themeUtils-YjM7iIiX-xQe6qdbF.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-Cd5gFTXp.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-DrUFww1w.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-Cc9Ee-I5.js","./locale-Cn_GDVD_-CiwD7jxT.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-DJJPVpPW.js","./t9n-C_hcZMZJ-BmtPt6-4.js","./icon-BXFbBbop-O5hL8B42.js","./loader-Ch7Jr16w-ztJ2p2Gj.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-Bm5S9Lju.js","./calcite-input-BKRd7MCS-BjdnYfeD.js","./input2-eOtqu-iO-CInnv9HE.js","./calcite-dropdown-CLrG397W-D0Dzxk5y.js","./floating-ui-DKFFlLv3-DZ3_fUHw.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-PlHdEMJ6.js","./calcite-dropdown-item-DpLfv4A0-BVjBECLP.js","./resources3-Duvedxls-DbbvfBW6.js","./calcite-dropdown-group-0sIPwaDd-DYLu_D_p.js"])))=>i.map(i=>d[i]); -import{v as a,S as c,i as x,ar as _i,eF as pi,eD as Ne,w as C,dU as g,i8 as ye,aq as ki,J as ue,I as Ce,ah as $,ax as ke,aA as dt,aL as es,aF as Il,av as Us,L as di,k8 as So,as as $s,i1 as Hs,ay as Ll,e8 as Po,bi as It,a2 as W,j as tt,dM as Gl,P as is,b9 as ns,G as Mr,aY as Ns,aC as Qe,p as vi,l as De,eC as Dl,fl as li,e as kr,m as fi,aO as Gn,f3 as Dn,eB as zl,ag as ss,aw as Mo,dN as Ul,dW as fn,j_ as $l,k9 as Hl,dK as Nl,b7 as Fl,ka as Zl,dX as Bl,h$ as Wl,kb as Cr,hq as Fe,D as Yl,kc as Xl,_ as Lt,bt as ko,$ as ql,az as jl,bx as Rr,dV as Fs,b as Kl,kd as Ql,bp as Vr,aW as os,al as Ar,ke as Jl,kf as Co,f4 as ze,B as Or,bj as Ir,au as Lr,hZ as pe,bo as Gr,i9 as zn,d$ as tc,an as ec,a3 as Dr,r as ic,kg as nc,kh as Ze,ki as sc,kj as oc,kk as rc,kl as Ro,km as ac,jw as zr,il as lc,aG as Ur,ae as cc,ih as hc,b1 as uc,kn as pc,i3 as Vo,o as Un,i4 as dc,cG as Ci,dR as Zs,ko as Bs,h_ as Ao,hh as fc,dQ as gc,dS as mc,dP as yc,kp as _c}from"./main-BZaw9FpY.js";import{i as q,j as Ws,A as vc,l as Be,S as _e,y as qt,M as sn,m as Wt,x as xc,g as bc,b as $n,v as Oo,I as $r,f as Hr,d as wc,E as Tc,P as Ec,O as on,T as Sc,z as Pc,h as Mc,D as Io}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as G,_ as kc,e as de,u as Cc,m as Rc,s as Vc}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{S as Ac,R as Oc}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as Ys,p as xt,f as Ic}from"./projectVectorToVector-sIYLNlex-CXXu_lyF.js";import{x as Lc,f as Nr,m as gn,y as Gc,P as Dc,w as zc,I as Uc,g as $c,Z as Lo}from"./elevationInfoUtils-mOZsPH2J-CGmjotSk.js";import{N as z,O as rs,L as fe,b as xi,l as le,j as ut,X as Pe,r as Et,R as H,p as Hc,k as pt,v as Fr,y as Z,S as Ot,A as rt,g as ge,w as Go,_ as N,T as We,W as Do,G as as,H as zo}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{i as Zr}from"./UpdatingHandles-CUu3u1ms-D2fDxJPP.js";import Xs from"./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js";import{O as bi,u as rn,E as mn,D as yn,P as Br,h as Nc,c as Fc}from"./geodesicUtils-B8mFUfTk-CCpgrgwm.js";import{simplify as Zc,distance as Bc,geodesicArea as Wc,geodesicLength as Wr}from"./geometryEngine-CdPoFSE4-BRF8cFYX.js";import{U as Yc}from"./Tile-D75RMC64-DprBAZDK.js";import{T as Xc,P as Yr,J as qc,Q as we,_ as Xr,u as Uo,O as jc}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{Y as Kc,L as Qc}from"./quat-BODLR7mS-Bk09s2KF.js";import{e as $o}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{s as Jc,N as Ye,L as Kt,K as te,P as qs,U as Qt,Q as th,x as _n,D as ft,c as Dt,F as qr,W as eh,m as ih,S as vn,u as nh,b as sh,R as oh,Y as rh,Z as ah,q as lh,G as ch,J as hh,j as uh,A as ph,C as dh,H as fh}from"./ReactiveSet-QxEZenFW-Cl_EaQiS.js";import{y as gh,w as mh,A as yh,p as _h,O as vh}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as jr,e as Hn,c as xh}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{i as bh}from"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import{y as at,_ as js,w as Ae,D as Ks,N as Ue,g as Kr,B as Ri,$ as Qr,P as ls,c as ii,e as wh,l as Ho,j as Nn,G as Jr,a as Th,O as Eh}from"./plane-Dt8R0KeE-fuXvBrPY.js";import{U as Sh,z as Ph,k as Mh,w as kh,F as Ch}from"./sphere-BenPORjV-CgNvGf8s.js";import{n as wi}from"./common-CYWrYyJl-E8-sukrT.js";import{c as ta,o as Qs}from"./Cyclical-C_9rKUUQ-CmN6QXv-.js";import"./MeshTransform-C--IG09w-B7P01ZzU.js";import{t as Rh}from"./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js";import{_ as cs,H as Vh,z as Ah,R as Vi,P as v,F as wt,$ as Oh,k as Js}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{r as Ih}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{m as Lh}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{S as Gh}from"./triangle-hqU-Tc1X-DRFR6OWE.js";import{m as Dh,x as zh}from"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import{P as Uh}from"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import{l as Ti}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{K as Xe,N as ea,J as $h}from"./projection-BA9M1R7d-DoNqITCd.js";import"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import{t as Hh}from"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import{i as ia,f as na}from"./Scheduler-B7UX7Wr5-DXVwwlDm.js";import"./Query-BrwMGK8U-sojFdYaD.js";import{q as Nh}from"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import{u as No}from"./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js";import{p as Fh}from"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import{z as Zh}from"./drapedUtils-BZ1SGPtE-DN0L7Y_o.js";import{W as Fo}from"./colorUtils-Cthpxcks-BhGjp9AU.js";import{h as Ei,M as Qi,N as xn}from"./boundedPlane-DlvE0eNx-BetNH2zh.js";import"./GraphicsCollection-CWTXNZOX-8-_pDOZK.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./geometryEngineBase-DueYg7ux-CCeespPx.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./hydrated-CplJC1Fs-CV-sFImk.js";import"./TileKey-C5IL-JBr-0HJjsV9n.js";import"./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./ReactiveMap-CFk6jPfN-Dz1UG3IA.js";import"./signal-CETehA7D-vStzfbaY.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./CollectionFlattener-DkHuHn5E-D3nwGseo.js";import"./TileInfo-CWIRDhZl-BN68IeQv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Map-1zd11DKO-DdBAdkuj.js";import"./Basemap-BEqqSTw9-BkQ-c4vY.js";import"./loadAll-e978YItg-CB-7_cng.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./writeUtils-D5qlLkwk-DIX6zS6N.js";import"./TablesMixin-C8RojhYs-DjK1Q1jj.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-D-X9O5uh.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./ColorBackground-gVZldRLm-BDCeusMw.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./lineSegment-CcqvCARM-D_SdPttv.js";import"./utils-SPbpQbmm-DpAlEmQT.js";function gi(e,t){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.m===t.m}function Fn(e,t,i){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&li(e.x,t.x,i)&&li(e.y,t.y,i)&&li(e.z??0,t.z??0,i)&&li(e.m??0,t.m??0,i)}function Bh(e){return"declaredClass"in e}function sa(e,t){if(!e)return null;let i;return Bh(e)?e.clone():(i=Ys(e.x,e.y,e.z,e.spatialReference),e.hasM&&(i.m=e.m,i.hasM=!0),i)}var Zo;function oa(e,t,i){return j(e,t,i)}function j(e=0,t=0,i=0){return pe(e,t,i)}function ve(e,t,i){return pe(e,t,i)}function qe(e){const[t,i,n]=e;return e.length>3?[t,i,n,e[3]]:[t,i,n]}function to(e,t,i,n=j()){return n[0]=e.x,n[1]=e.y,n[2]=e.z??0,t==null||(t.type==="2d"?n[2]=0:n[2]=Dc(t,e,i,gn)??0),n}function Wh(e,t,{z:i,m:n},s,o){const{spatialReference:r,elevationInfo:l}=s;let h;i==null&&n==null?h=void 0:t==null||t.type==="2d"?h=i??void 0:h=zc(t,e,r,gn,l)??0;const[u,p]=e;return o?Ic(o,u,p,h,r):o=Ys(u,p,h,r),n!=null&&(o.m=n,o.hasM=!0),o}(function(e){e[e.NONE=0]="NONE",e[e.TARGET=1]="TARGET"})(Zo||(Zo={}));let St=class extends kr{constructor(){super(...arguments),this.enabled=!0}};a([c({type:Boolean})],St.prototype,"enabled",void 0),St=a([x("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],St);let V=class extends kr{constructor(e){super(e),this.lineSnapper=new St,this.parallelLineSnapper=new St,this.rightAngleSnapper=new St,this.rightAngleTriangleSnapper=new St,this.shortLineThreshold=15,this.distance=5,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThresholdMeters=.3,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new _i([255,127,0]),this.orangeTransparent=new _i([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"lineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"parallelLineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleTriangleSnapper",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"shortLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"distance",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"intersectionParallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"parallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"verticalLineThresholdMeters",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"touchSensitivityMultiplier",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointOnLineThreshold",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orange",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orangeTransparent",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthReference",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthTarget",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"lineHintFadedExtensions",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"parallelLineHintWidth",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],V.prototype,"parallelLineHintLength",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"parallelLineHintOffset",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],V.prototype,"rightAngleHintSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],V.prototype,"rightAngleHintOutlineSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"satisfiesConstraintScreenThreshold",void 0),V=a([x("esri.views.interactive.snapping.Settings.Defaults")],V);const Zn=new V;var je;(function(e){e[e.FEATURE=1]="FEATURE",e[e.SELF=2]="SELF",e[e.ALL=3]="ALL"})(je||(je={}));let Ai=class{constructor(e,t){this.isDraped=e,this.domain=t}},Yh=class ra extends Ai{constructor(t,i,n=je.ALL){super(i,n),this.intersectionPoint=t}equals(t){return t instanceof ra&&H(this.intersectionPoint,t.intersectionPoint)}},Xh=class aa extends Ai{constructor(t,i,n,s,o=je.ALL,r=!0,l=!0){super(s,o),this.type=t,this.lineStart=i,this.lineEnd=n,this.fadeLeft=r,this.fadeRight=l}equals(t){return t instanceof aa&&this.type===t.type&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)&&this.fadeLeft===t.fadeLeft&&this.fadeRight===t.fadeRight}get length(){return ge(this.lineStart,this.lineEnd)}},qh=class la extends Ai{constructor(t,i,n,s=je.ALL){super(n,s),this.lineStart=t,this.lineEnd=i}equals(t){return t instanceof la&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)}},jh=class ca extends Ai{constructor(t,i,n){super(i,n),this.point=t}equals(t){return t instanceof ca&&H(this.point,t.point)}},Kh=class ha extends Ai{constructor(t,i,n,s,o=je.ALL){super(s,o),this.previousVertex=t,this.centerVertex=i,this.nextVertex=n}equals(t){return t instanceof ha&&H(this.previousVertex,t.previousVertex)&&H(this.centerVertex,t.centerVertex)&&H(this.nextVertex,t.nextVertex)}},Qh=class{draw(e,t){const i=Jh(e),n=this.sortUniqueHints(i),s=[];for(const o of n)o instanceof Yh&&s.push(this.visualizeIntersectionPoint(o,t)),o instanceof Xh&&s.push(this.visualizeLine(o,t)),o instanceof qh&&s.push(this.visualizeParallelSign(o,t)),o instanceof Kh&&s.push(this.visualizeRightAngleQuad(o,t)),o instanceof jh&&s.push(this.visualizePoint(o,t));return Gr(s)}sortUniqueHints(e){return e}};function Jh(e){const t=[];for(const i of e){let n=!0;for(const s of t)if(i.equals(s)){n=!1;break}n&&t.push(i)}return t}let tu=class extends Qh{constructor(e){super(),this._graphicsLayer=e,this._symbolPairingsByType=new Map}visualizeIntersectionPoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.intersectionPoint[0],y:e.intersectionPoint[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("intersectionPoint",t.view.effectiveTheme.accentColor))}visualizePoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.point[0],y:e.point[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("point",t.view.effectiveTheme.accentColor))}visualizeLine(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("line",t.view.effectiveTheme.accentColor))}visualizeParallelSign(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("parallelSign",t.view.effectiveTheme.accentColor))}visualizeRightAngleQuad(e,t){const i=G(),n=G(),s=g();q(i,e.centerVertex,e.previousVertex),q(n,e.nextVertex,e.previousVertex),vc(s,i,n);const o=`rightAngleQuad${s[2]<0?45:225}`;return this._visualizeSnappingIndicator(new fi({paths:[[[...e.previousVertex],[...e.centerVertex],[...e.nextVertex]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol(o,t.view.effectiveTheme.accentColor))}_visualizeSnappingIndicator(e,t){const i=new It({geometry:e,symbol:t});return this._graphicsLayer.add(i),W(()=>{this._graphicsLayer.remove(i)})}_getOrCreateSymbol(e,t){const i=this._symbolPairingsByType;return i.get(e)?.color!==t&&i.set(e,{color:t,symbol:eu(e,t)}),i.get(e).symbol}};function eu(e,t){const i=[...t.toRgb(),255*t.a];switch(e){case"point":return new Ne({outline:{width:.5,color:[0,0,0,1]},size:10,color:t});case"intersectionPoint":return new Ne({outline:new zl({width:1.5,color:t}),size:15,color:[0,0,0,0]});case"line":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:Ac.Butt,joinStyle:Oc.Round,miterLimit:10,width:Dn(Zn.lineHintWidthTarget),color:i}]}}});case"parallelSign":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,1.5],[7,1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,-1.5],[7,-1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}});case"rightAngleQuad45":case"rightAngleQuad225":{const n=e==="rightAngleQuad45"?45:225;return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:.5,y:.5,z:0},anchorPointUnits:"Relative",size:Dn(Zn.rightAngleHintSize),rotation:n,markerPlacement:{type:"CIMMarkerPlacementOnVertices",placePerPart:!0,angleToLine:!0,placeOnEndPoints:!1},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[5,-5],[-5,-5],[-5,5],[5,5],[5,-5]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:Dn(Zn.rightAngleHintOutlineSize),color:i},{type:"CIMSolidFill",enable:!0,color:[...t.toRgb(),255*t.a*.4]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}})}}}const iu=new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[3.75,3.75],lineDashEnding:"HalfPattern",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:1.6,color:[255,255,255,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:2,color:[0,0,0,255]}]}}}),nu=new Ne({style:"circle",size:6,color:[127,127,127,1],outline:{color:[50,50,50],width:1}}),su=new Ne({style:"circle",size:6,color:[255,127,0,1],outline:{color:[50,50,50],width:1}});var ht;(function(e){e[e.NeverApplied=0]="NeverApplied",e[e.Applied=1]="Applied",e[e.Undone=2]="Undone"})(ht||(ht={}));var Gt;(function(e){e.UndoRedoUpdating="UndoRedoUpdating",e.UndoInvalidError="UndoInvalidError",e.RedoInvalidError="RedoInvalidError",e.ApplyInvalidError="ApplyInvalidError"})(Gt||(Gt={}));const bn={[Gt.UndoRedoUpdating]:"Cannot perform operation whilst undo redo is updating",[Gt.UndoInvalidError]:"There are no items to Undo",[Gt.RedoInvalidError]:"There are no items to Redo",[Gt.ApplyInvalidError]:"Cannot apply an item that is already applied"};let ni=class extends Error{constructor(){super(bn[Gt.UndoRedoUpdating]),this.type="undo-redo-updating-error"}},hs=class extends Error{constructor(){super(bn[Gt.UndoInvalidError]),this.type="undo-redo-undo-error"}},Bo=class extends Error{constructor(){super(bn[Gt.RedoInvalidError]),this.type="undo-redo-redo-error"}},ou=class extends Error{constructor(){super(bn[Gt.ApplyInvalidError]),this.type="undo-redo-apply-error"}};var Xt;(function(e){e[e.Apply=0]="Apply",e[e.Undo=1]="Undo",e[e.Redo=2]="Redo"})(Xt||(Xt={}));let Di=class extends tt{constructor(){super(...arguments),this.name="",this.tag=Symbol(),this.status=ht.NeverApplied}get canUndo(){return this.status===ht.Applied}get canRedo(){return this.status===ht.Undone}async executeUndoRedoOperation(e){switch(e){case Xt.Apply:if(this.status!==ht.NeverApplied)throw new ou;return await this.apply(),void(this.status=ht.Applied);case Xt.Undo:if(this.status!==ht.Applied)throw new hs;return await this.undo(),void(this.status=ht.Undone);case Xt.Redo:if(this.status!==ht.Undone)throw new hs;return await this.redo(),void(this.status=ht.Applied)}}};a([c()],Di.prototype,"name",void 0),a([c()],Di.prototype,"tag",void 0),Di=a([x("esri.undoredo.UndoableOperation")],Di);let Ct=class extends tt{constructor(){super(...arguments),this._stack=new ss,this._stackPosition=-1,this._updatingHandles=new Zr}get updating(){return this._updatingHandles.updating}get canUndo(){return this.hasUndo&&!this.updating}get hasUndo(){return this._stackPosition>=0}get canRedo(){return this.hasRedo&&!this.updating}get hasRedo(){return this._stackPositione.destroy())}_drainStack(){this._stack.drain(e=>e.destroy()),this._stackPosition=-1}async undo(){if(!this.hasUndo)throw new hs;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition);e&&await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Undo),--this._stackPosition,e.canRedo||this._truncateForwardStack()})())}async redo(){if(!this.hasRedo)throw new Bo;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition+1);if(!e)throw new Bo;await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Redo),++this._stackPosition})())}peekUndo(){if(this.canUndo)return this._stack.getItemAt(this._stackPosition)}peekRedo(){if(this.canRedo)return this._stack.getItemAt(this._stackPosition+1)}async inject(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),e.canUndo?(this._stack.splice(this._stackPosition+1,0,e),this._stackPosition++):this._stackPosition>-1&&(this._stack.splice(0,this._stackPosition+1).forEach(t=>t.destroy()),this._stackPosition=-1)})())}async add(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),this._stackPosition>=-1&&this._truncateForwardStack(),e.canUndo?(this._stack.push(e),this._stackPosition=this._stack.length-1):this._drainStack()})())}async removeTagged(e,t=!1){if(this.updating&&!t)return;await Mo(()=>!this.updating);const i=new ss;for(let n=0;ni.length-1&&(this._stackPosition=i.length-1)}async clear(e=!1){if(this.updating&&!e)throw new ni;await Mo(()=>!this.updating),this._drainStack()}};a([c()],Ct.prototype,"_stack",void 0),a([c()],Ct.prototype,"_stackPosition",void 0),a([c()],Ct.prototype,"updating",null),a([c({readOnly:!0})],Ct.prototype,"canUndo",null),a([c({readOnly:!0})],Ct.prototype,"hasUndo",null),a([c({readOnly:!0})],Ct.prototype,"canRedo",null),a([c({readOnly:!0})],Ct.prototype,"hasRedo",null),Ct=a([x("esri.UndoRedo")],Ct);function eo(){return uc()}function ru(){return Ul()}function Si(e,t){const i=[];e=(e=(e=e.replaceAll(/[\u00B0\u00BA]/g,"^")).replaceAll("′","'")).replaceAll("″",'"');const n=cu(t);return pc.dmsToGeog(n,1,[e],i)?new C(i[0][0],i[0][1],ue.WGS84):null}function au(e){return e&&eo()?Ze(e)??Si(`0° 0' 0" N | ${e}`)?.longitude??Si(`0 | ${e}`)?.longitude??null:null}function lu(e){return e&&eo()?Ze(e)??Si(`${e} | 0° 0' 0" E`)?.latitude??Si(`${e} | 0`)?.latitude??null:null}function cu(e){let t=null;if(e||(e=ue.WGS84),e.wkid){if(t=Vo.geogcs(e.wkid),!t)throw new Un("coordinate-formatter:invalid-spatial-reference","wkid is not valid")}else{if(!e.wkt2&&!e.wkt)throw new Un("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing");if(t=Vo.fromString(dc.PE_TYPE_GEOGCS,e.wkt2||e.wkt),!t)throw new Un("coordinate-formatter:invalid-spatial-reference","wkt is not valid")}return t}let hu=class{constructor(){this.committedVertices=null,this.cursorVertex=null,this.full=null,this.outline=null,this.cursorEdge=null,this.circle=null,this.rectangle=null}};var us;let se=us=class extends De{constructor(e){super(e),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}initialize(){const e=this.center,t=this.numberOfPoints;if(this.hasZ=e?.hasZ??!1,this.rings.length!==0||!e)return;const i=fn(this.radius,this.radiusUnit,"meters"),n=e.spatialReference;let s,o="geographic";if(n.isWebMercator?o="webMercator":((n.wkid&&$l[n.wkid])!=null||(n.wkt2||n.wkt)&&Hl(n.wkt2||n.wkt))&&(o="projected"),this.geodesic){let r;switch(o){case"webMercator":r=Nl(e);break;case"projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case"geographic":r=e}s=this._createGeodesicCircle(r,i,t),o==="webMercator"&&(s=Fl(s))}else{let r;o==="webMercator"||o==="projected"?r=i/Zl(e.spatialReference):o==="geographic"&&(r=Bl(i,"meters",Wl(e.spatialReference).radius)),s=this._createPlanarCircle(e,r,t)}this.spatialReference=s.spatialReference,this.addRing(s.rings[0])}clone(){const{center:e,numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s}=this;return new us({center:e?.clone(),numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s})}_createGeodesicCircle(e,t,i){let n=0;const s=[];for(;n<360;){const o=[0,0],r=[e.x,e.y];bi(o,r,n,t,ue.WGS84),this.hasZ&&o.push(e.z),s.push(o),n+=360/i}return s.push(s[0]),new De({rings:[s]})}_createPlanarCircle(e,t,i){const n=[],s=2*Math.PI/i;for(let o=0;othis.mapToLocal(t)).filter(ki)}get doUnnormalization(){return!1}},pu=class extends ua{constructor(e,t,i=null){super(t),this._defaultZ=i,this.transform=Uo(),this.transformInv=Uo(),this.transform=jc(e),Yc(this.transformInv,this.transform)}makeMapPoint(e,t){return an(e,t,this._defaultZ)}mapToLocal(e){return k(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return an(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}},du=class extends ua{constructor(e,t){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=g(),this.tangentFrameUpWS=g(),this.tangentFrameRightWS=g(),this.tangentFrameForwardWS=g(),this.localFrameRightWS=g(),this.localFrameUpWS=g(),this.worldToLocalTransform=$o(),this.localToWorldTransform=$o(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=t,this.defaultZ=t.hasZ?t.z:null;const i=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Z,this.tangentFrameForwardWS);const n=g();fe(n,this.tangentFrameForwardWS,Z(i,this.tangentFrameForwardWS)),Et(this.localFrameRightWS,i,n),le(this.localFrameRightWS,this.localFrameRightWS),Ot(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),Kc(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),Qc(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.viewingMode==="global"}makeMapPoint(e,t){return an(e,t,this.defaultZ)}mapToLocal(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e[0],y:e[1],spatialReference:this.spatialReference}),t),Go(t,t,this.worldToLocalTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?k(i.x/this.scale,i.y/this.scale):null}localToMap(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e.x*this.scale,y:e.y*this.scale,spatialReference:this.spatialReference}),t),Go(t,t,this.localToWorldTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?an(i.x,i.y,this.defaultZ):null}};function fu(e,t){if(e.type==="2d")return new pu(e.state.transform,e.spatialReference,t.length>2?t[2]:null);if(e.type==="3d"){const i=t.length>2?new C({x:t[0],y:t[1],z:t[2],spatialReference:e.spatialReference}):new C({x:t[0],y:t[1],spatialReference:e.spatialReference});return new du(e,i)}return null}function Me(e,t){const i=new C({x:e[0],y:e[1],spatialReference:t});return e.length>2&&(i.z=e[2]),i}function gu(e,t){return new Mr({points:e,spatialReference:t})}function Wo(e,t,i){const n=new fi({paths:e,spatialReference:t});return i&&Cr(n),n}function Oi(e,t,i,n=!0){const s=is(e);s.forEach(r=>{const l=r[0],h=r[r.length-1];Fe(l,h)&&r.length!==1||r.push(r[0])});let o=new De({rings:s,spatialReference:t});return o.rings.forEach(r=>{Yl(r)||r.reverse()}),i&&Cr(o),n&&o.isSelfIntersecting&&Ns(t)&&(o=Zc(o)),o}function Yo(e,t,i){const n=t.mapToLocalMultiple(e),s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y},l=Math.round(r.x-o.x),h=Math.round(r.y-o.y),u=Math.max(Math.abs(l),Math.abs(h));if(i){const p={x:o.x+u,y:o.y+u},d={x:o.x-u,y:o.y-u};s.push(k(p.x,d.y),k(d.x,d.y),k(d.x,p.y),k(p.x,p.y))}else{const p={x:l>0?o.x+u:o.x-u,y:h>0?o.y+u:o.y-u};s.push(k(o.x,o.y),k(p.x,o.y),k(p.x,p.y),k(o.x,p.y))}return pa(Oi([s.map(p=>t.localToMap(p)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function mu(e,t,i){let n=t.mapToLocalMultiple(e);if(n.length===1){const l=n[0];n=[k(l.x-48,l.y+48),k(l.x+48,l.y-48),k(l.x+48,l.y-48),k(l.x-48,l.y+48)]}const s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y};if(i){const l=Math.round(r.x-o.x),h=Math.round(r.y-o.y);s.push(k(o.x-l,o.y-h),k(r.x,o.y-h),k(r.x,r.y),k(o.x-l,r.y))}else s.push(k(o.x,o.y),k(r.x,o.y),k(r.x,r.y),k(o.x,r.y));return pa(Oi([s.map(l=>t.localToMap(l)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function pa(e,t,i){const n=zi(t[3],t[2],i),s=zi(t[1],t[2],i),o=zi(t[0],t[1],i),r=zi(t[0],t[3],i);return{geometry:e,midpoints:n!=null&&s!=null&&o!=null&&r!=null?{top:n,right:s,bottom:o,left:r}:null}}function zi(e,t,i){Re[0]=e.x,Re[1]=e.y,Re[2]=0,Ve[0]=t.x,Ve[1]=t.y,Ve[2]=0,Pe(Re,Re,Ve,.5),Ui.x=Re[0],Ui.y=Ve[1],Ui.z=Ve[2];const n=i.localToMap(Ui);return n!=null?Me(n,i.spatialReference):null}const Ui=k(0,0,0),Re=g(),Ve=g();function Xo(e,t,i,n){const s=t.mapToLocalMultiple(e);let o=null,r=null;if(i)o=s[0],r=s[1];else{const _=s[0],y=s[1],w=Math.round(y.x-_.x),b=Math.round(y.y-_.y),S=Math.max(Math.abs(w),Math.abs(b));o=k(w>0?_.x+S/2:_.x-S/2,b>0?_.y+S/2:_.y-S/2),r=k(Math.abs(w)>Math.abs(b)?o.x-S/2:o.x,Math.abs(w)>Math.abs(b)?o.y:o.y-S/2)}const l=t.localToMap(o),h=t.localToMap(r);if(l==null||h==null)return null;t.doUnnormalization&&Xl([[l,h]],t.spatialReference);const u=Me(l,t.spatialReference),p=Me(h,t.spatialReference),d=vi(t.spatialReference);let m=0;if(Ns(t.spatialReference))m=d*Bc(u,p,null);else{const _=o.x-r.x,y=o.y-r.y;m=d*Math.sqrt(_*_+y*y)*1}const f=new uu({center:u,radius:m,radiusUnit:"meters",spatialReference:t.spatialReference});return{geometry:Oi(f.rings,f.spatialReference,!1),center:u,edge:p}}function yu(e,t,i){const n=t.mapToLocalMultiple(e),s=n[0],o=n[1],r=Math.round(o.x-s.x),l=Math.round(o.y-s.y),h=k(i?s.x:s.x+r/2,i?s.y:s.y+l/2),u=i?r:r/2,p=i?l:l/2,d=60,m=[],f=2*Math.PI/d;function _(Y){const gt=Math.cos(Y),lt=Math.sin(Y);return k(u*gt+h.x,p*lt+h.y)}for(let Y=0;Yt.localToMap(Y)).filter(ki)],y,w,!1),S=t.localToMap(_(Math.PI/2)),I=t.localToMap(_(0)),K=t.localToMap(_(-Math.PI/2)),et=t.localToMap(_(Math.PI));return{geometry:b,midpoints:S!=null&&I!=null&&K!=null&&et!=null?{top:Me(S,y),right:Me(I,y),bottom:Me(K,y),left:Me(et,y)}:null}}function io(e,t){switch(e){case"point":case"multipoint":return _u();case"polyline":return vu(t);case"polygon":return xu(t);default:return}}function _u(e){return"point"}function vu(e){return(e!=null&&e.type==="polyline"&&e.paths.length?e.paths[0].length:0)<2?"polylineZeroVertices":"polylineOneVertex"}function xu(e){const t=e!=null&&e.type==="polygon"&&e.rings.length?e.rings[0].length:0;return t<3?"polylineZeroVertices":t<4?"polygonOneVertex":"polygonTwoVertices"}function bu(e,t){const i=e?.geometry;if(!e||i?.type!=="mesh"||!t)return;const{renderCoordsHelper:n,elevationProvider:s}=t,{camera:o}=t.state,{extent:r}=i,{center:l,spatialReference:h}=r,u=vi(h),p=Fs(h),d=vi(n.spatialReference),m=r.width*u,f=r.height*p,_=(r.zmax??0)*p,y=_-(r.zmin??0)*p,w=Math.max(m,f,y)/d,{x:b,y:S}=l,I=l.z??0;N($i,b,S,I),n.toRenderCoords($i,h,$i);const K=w/o.computeScreenPixelSizeAt($i);if(K>o.width*Tu)return"meshTooClose";if(K=0){if(d>=0||t.type===O.LINE)return[qt(ln,i,r,p)]}else if(e.type===O.LINE&&(d>=0||t.type===O.LINE))return[qt(ln,i,r,p)];return[]}function Pu(e,t,i){const n=[],s=q(da,e.end,e.start),o=q(fa,e.start,t),r=Be(s),l=2*_e(s,o),h=l*l-4*r*(Be(o)-i*i);if(h===0){const u=-l/(2*r);(e.type===O.LINE||u>=0)&&n.push(qt(ln,e.start,s,u))}else if(h>0){const u=Math.sqrt(h),p=(-l+u)/(2*r);(e.type===O.LINE||p>=0)&&n.push(qt(ln,e.start,s,p));const d=(-l-u)/(2*r);(e.type===O.LINE||d>=0)&&n.push(qt(ga,e.start,s,d))}return n}var O;(function(e){e[e.RAY=0]="RAY",e[e.LINE=1]="LINE"})(O||(O={}));const Mu=1e-6,da=G(),fa=G(),ga=G(),ln=G();function no({start:e,end:t,type:i},n,s){const o=[],r=q(Ii,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===bt.PLANE||d>=0)&&o.push(qt(G(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===bt.PLANE||m>=0)&&o.push(qt(G(),e,r,m));const f=(-u-d)/(2*h);(i===bt.PLANE||f>=0)&&o.push(qt(G(),e,r,f))}return o}function ma(e,t){const i=e.start,n=e.end,s=q(Ii,n,i),o=N(En,-s[1],s[0],0),r=t.start,l=t.end,h=pt(oo,l,r),u=Z(h,o),p=N(Ea,i[0],i[1],0),d=pt(Sa,p,r),m=Z(d,o),f=wi();if(Math.abs(u)de(i,n))}function _a(e,t,i){return xa(e,cn(ro,e[2],t),i)}function va(e,t,i,n=g()){const s=q(Ii,e,t),o=Mc(s);return qt(n,t,s,o===0?1:i/o),n[2]=e[2],n}function xa(e,{start:t,end:i,type:n},s=g()){const o=pt(Tn,e,t),r=pt(En,i,t),l=Z(o,r)/Z(r,r);return z(s,t,r,n===O.RAY?Math.max(l,0):l)}const Cu=(()=>{const e=g(),t=g(),i=g();return({start:n,end:s},{center:o,radius:r,normal:l,slicePlane:h})=>{const u=Ri(o,l,Ou);if(R(ls(u,n),0)&&R(ls(u,s),0)){Qr(l,e,t);const d=(_,y)=>(Et(i,y,o),Wt(_,Z(i,e),Z(i,t)),_),m=Pu({start:d(Ii,n),end:d(wn,s),type:O.LINE},Vc,r),f=[];for(const[_,y]of m){const w=rt(g(),o);z(w,w,e,_),z(w,w,t,y),h&&!me(h,w)||f.push(w)}return f}const p=g();return js(u,n,s,p)?!R(ge(p,o),r)||h&&!me(h,p)?[]:[p]:[]}})();function ba({start:e,end:t,type:i},n,s){const o=[],r=Et(Tn,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===O.LINE||d>=0)&&o.push(z(g(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===O.LINE||m>=0)&&o.push(z(g(),e,r,m));const f=(-u-d)/(2*h);(i===O.LINE||f>=0)&&o.push(z(g(),e,r,f))}return o}function wa(e,t){const i=e.start,n=e.end,s=t.start,o=t.end,r=pt(Tn,n,i),l=pt(En,o,s),h=pt(oo,s,i),u=Ot(Ea,r,l);if(!R(Z(h,u),0))return[];const p=as(u);if(R(p,0))return[];const d=Ot(Sa,h,l),m=Z(d,u)/p,f=z(Pa,i,r,m);if(e.type===O.RAY){const _=pt(ps,f,i);if(Z(r,_)<-wi())return[]}if(t.type===O.RAY){const _=pt(ps,f,s);if(Z(l,_)<-wi())return[]}return[ye(f)]}function Ru({start:e,end:t,type:i},n){const s=pt(Tn,n,e),o=pt(En,t,e),r=Ot(oo,o,s),l=as(r)/as(o),h=wi();if(lt+n)return[];if(dme(e,i))}function me(e,t){return Kr(e,t)}var bt;(function(e){e[e.PLANE=0]="PLANE",e[e.HALF_PLANE=1]="HALF_PLANE"})(bt||(bt={}));const Au={[bt.PLANE]:O.LINE,[bt.HALF_PLANE]:O.RAY},Ii=G(),wn=G(),Tn=g(),En=g(),oo=g(),Ea=g(),Sa=g(),Pa=g(),ps=g(),Ou=at(),ro={start:g(),end:g(),type:O.LINE},Iu={start:g(),end:g(),type:O.LINE};class Tt{intersect(t){return $t(this,t)}closestPoints(t){return[this.closestTo(t)]}}class Je extends Tt{constructor(t){super(),this.point=t}equals(t){return this===t||vt(t)&&H(this.point,t.point)}closestTo(){return qe(this.point)}}class ao extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.lineLike={start:t,end:i,type:n}}equals(t){return this===t||Rt(t)&&this.lineLike.type===t.lineLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return xa(t,this.lineLike,i),i}}class Ma extends ao{constructor(t,i){super(t,i,O.LINE)}}class Lu extends ao{constructor(t,i){super(t,i,O.RAY)}}class ka extends Tt{constructor(t){super(),this.constraints=t}equals(t){return this===t||ds(t)&&Fe(this.constraints,t.constraints,(i,n)=>i.equals(n))}closestTo(t){let i,n=1/0;for(const s of this.constraints){const o=s.closestTo(t),r=Hc(t,o);ri===this?[]:i.closestPoints(t))}}class Ca extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||At(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i}}class lo extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||Nt(t)&&H(this.center,t.center)&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i[2]=this.center[2],i}asCircle(){return new co(qe(this.center),this.radius,ve(0,0,1))}}class co extends Tt{constructor(t,i,n,s=void 0){super(),this.center=t,this.radius=i,this.normal=n,this.slicePlane=s}equals(t){return this===t||oe(t)&&H(this.center,t.center)&&H(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:i,radius:n}=this;Ks(this.getPlane(Gu),t,Wn);const s=pt(Wn,Wn,i),o=Fr(s);if(R(o,0))return qe(t);const r=n/Math.sqrt(o),l=j();z(l,i,s,r);const{slicePlane:h}=this;return h&&!me(h,l)?uo(h,this)?.closestTo(t)??qe(t):l}getPlane(t=at()){return Ri(this.center,this.normal,t)}}const Wn=g(),Gu=at();class Ra extends Tt{constructor(t){super(),this.z=t}equals(t){return this===t||Ht(t)&&this.z===t.z}closestTo(t){return ve(t[0],t[1],this.z)}getPlane(t=at()){return N(qo,0,0,this.z),Ri(qo,Hs,t)}}const qo=g();class Va extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.planeLike={start:t,end:i,type:n}}equals(t){return this===t||Vt(t)&&this.planeLike.type===t.planeLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return _a(t,this.planeLike,i),i}closestEndTo(t){const{start:i,end:n}=this.planeLike;return Math.sign(_e(q(Du,n,i),q(zu,t,i)))>0?this.end:this.start}getPlane(t=at()){const i=rt(jo,this.end);return i[2]+=1,Jr(this.start,this.end,i,t)}getSlicePlane(t=at()){const{start:i,end:n,type:s}=this.planeLike;if(s===bt.PLANE)return;const o=N(jo,i[0],i[1],0),r=N(Ko,n[0],n[1],0),l=Et(Ko,r,o);return Ri(o,l,t),t}}const Du=G(),zu=G(),jo=g(),Ko=g();class Uu extends Va{constructor(t,i){super(t,i,bt.HALF_PLANE)}}class $u extends Tt{constructor(t,i){super(),this.sphere=Ph(t,i)}equals(t){return this===t||Ft(t)&&Mh(this.sphere,t.sphere)}closestTo(t){const i=j();return kh(this.sphere,t,i),i}get center(){return Ch(this.sphere)}get radius(){return this.sphere[3]}}class Hu extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.getZ=n,this.planeLike={start:t,end:i,type:bt.PLANE}}equals(t){return this===t||hn(t)&&H(this.start,t.start)&&H(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Bu(this,t)}addIfOnTheGround(t,i){for(const n of i){const s=this.getZ(n[0],n[1])??0;R(n[2],s)&&(n[2]=s,t.push(n))}}}class ho extends Tt{constructor(t,i,n){super(),this._x=t,this._y=i,this._z=n}equals(t){return this===t||ap(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,i,n]){return oa(this._x??t,this._y??i,this._z??n)}}class Aa extends Tt{constructor(t,i,n,s,o){super(),this._origin=t,this._spatialReference=i,this._distanceMeters=n,this._z=s,this._directionDegrees=o}equals(t){return this===t||rp(t)&&Io(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,i,n]){return Wt(si,t,i),Io(si,this._origin)||this._applyDirectionAndDistance(si),oa(si[0],si[1],this._z??n)}_applyDirectionAndDistance(t){if(this._directionDegrees!=null&&this._distanceMeters!=null)bi(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(this._directionDegrees!=null)Fu(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(this._distanceMeters!=null){const{azimuth:i}=mn(Nu,this._origin,t,this._spatialReference);bi(t,this._origin,i??0,this._distanceMeters,this._spatialReference)}}}const si=[0,0],Nu=new yn;function Fu(e,t,i,n,s){let{azimuth:o,distance:r}=mn(Zu,t,n,s);o??=0;let l=r*Math.cos((o-i)*bh);l=Math.max(0,l),bi(e,t,i,l,s)}const Zu=new yn;function Bu(e,t){const i=j();return _a(t,e.planeLike,i),i[2]=e.getZ(i[0],i[1])??Ia,i}function $t(e,t){if(ds(e)){const i=[];for(const n of e.constraints){const s=n.intersect(t);s&&i.push(s)}return Li(i)}if(ds(t))return $t(t,e);if(hn(e))return Qo(e,t);if(hn(t))return Qo(t,e);if(vt(e)){const{point:i}=e;if(vt(t))return H(i,t.point)?e:void 0;const n=t.closestTo(i);return We(n,i)?e:void 0}if(Rt(e)){if(vt(t))return $t(t,e);if(Rt(t))return Pt(wa(e.lineLike,t.lineLike));if(Ht(t))return Wu(e,t);if(Vt(t))return Pt(ma(t.planeLike,e.lineLike));if(At(t))return Pt(ba(e.lineLike,t.center,t.radius));if(oe(t))return Pt(Cu(e.lineLike,t));if(Nt(t))return Yu(e,t);if(Ft(t))return Xu(e,t)}else if(Ht(e)){if(vt(t)||Rt(t))return $t(t,e);if(Ht(t))return qu(e,t);if(Vt(t))return ju(e,t);if(At(t))return Ku(e,t);if(oe(t))return Ju(e,t);if(Nt(t))return Qu(e,t);if(Ft(t))return tp(e,t)}else if(Vt(e)){if(vt(t)||Rt(t)||Ht(t))return $t(t,e);if(Vt(t))return Yn(ya(e.planeLike,t.planeLike));if(At(t))return Yn(no(e.planeLike,t.center,t.radius));if(oe(t))return ip(e,t);if(Nt(t))return ep(e,t);if(Ft(t))return np(e,t)}else if(At(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t))return $t(t,e);if(At(t))return Yn(so(e.center,e.radius,t.center,t.radius));if(oe(t))return;if(Nt(t))return sp(e,t);if(Ft(t))return}else if(oe(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t))return $t(t,e);if(oe(t))return;if(Nt(t))return t.asCircle(),void 0;if(Ft(t))return}else if(Nt(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||oe(t))return $t(t,e);if(Nt(t))return op(t,e);if(Ft(t))return}else if(Ft(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||Nt(t))return $t(t,e);if(Ft(t))return}}const Wu=(()=>{const e=at();return(t,i)=>{const{start:n,end:s}=t;if(Ta(n,s)&&R(n[2],i.z))return t;const o=j();return js(i.getPlane(e),n,s,o)?new Je(o):void 0}})();function Yu({lineLike:e},{center:t,radius:i}){const n=t[2];return Pt(ba(e,t,i).filter(s=>R(s[2],n)))}function Xu({lineLike:e},{sphere:t}){return Pt(Sh(t,e.start,e.end))}const uo=(()=>{const e=jr(),t=g(),i=g();return(n,s,o)=>{const{normal:r,center:l,radius:h}=s;Qr(r,t,i);const u=Ue(n),p=h*Z(u,t),d=h*Z(u,i);gh(e,l[0],l[1],l[2],1);const m=mh(n,e),f=Math.hypot(p,d),_=R(f,0);if(R(ls(n,l),0)){if(_)return s;if(R(h,0))return!o||me(o,l)?new Je(qe(l)):void 0;Ot(t,u,r),le(t,t);const Y=new Array,gt=ye(l);z(gt,gt,t,h),o&&!me(o,gt)||Y.push(gt);const lt=ye(l);return z(lt,lt,t,-h),o&&!me(o,lt)||Y.push(lt),Pt(Y)}if(_)return;const y=-m/f;if(Math.abs(y)>1||R(y,1))return;const w=Math.atan(p/d),b=tc(y)-w,S=Math.PI-b,I=new Array,K=g();z(K,l,t,h*Math.cos(b)),z(K,K,i,h*Math.sin(b)),I.push(K);const et=g();return z(et,l,t,h*Math.cos(S)),z(et,et,i,h*Math.sin(S)),I.push(et),Pt(o?Vu(o,I):I)}})();function qu(e,t){return R(e.z,t.z)?e:void 0}function ju({z:e},{planeLike:t}){const[i,n]=t.start,[s,o]=t.end,r=ve(i,n,e),l=ve(s,o,e);return t.type===bt.PLANE?new Ma(r,l):new Lu(r,l)}function Ku(e,t){const[i,n]=t.center;return new lo(ve(i,n,e.z),t.radius)}function Qu(e,t){return R(t.center[2],e.z)?t:void 0}const Ju=(()=>{const e=at();return(t,i)=>uo(t.getPlane(e),i,i.slicePlane)})();function tp(e,{center:t,radius:i}){const n=Math.abs(t[2]-e.z);if(n>i&&!R(n,i))return;const s=ve(t[0],t[1],e.z),o=Math.sqrt(i**2-n**2);return R(o,0)?void 0:new lo(s,o)}const ep=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=no(t.planeLike,i,n),o=i[2];t.getSlicePlane(e);const r=new Array;for(const[l,h]of s){const u=[l,h,o];me(e,u)&&r.push(u)}return Pt(r)}})(),ip=(()=>{const e=at(),t=at();return(i,n)=>uo(i.getPlane(e),n,i.getSlicePlane(t))})(),np=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=t.getPlane(e),o=Ae(s,i),r=Math.abs(o);if(r>n&&!R(r,n))return;const l=Math.sqrt(n**2-o**2);if(R(l,0)){const p=j();return Ks(s,i,p),new Je(p)}const h=j(),u=ye(Ue(s));return z(h,i,u,o),new co(h,l,u,t.getSlicePlane())}})();function sp(e,t){const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?t:Oa(so(e.center,e.radius,t.center,t.radius),t.center[2])}function op(e,t){if(!Ta(e.center,t.center))return;const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?e:Oa(so(e.center,e.radius,t.center,t.radius),e.center[2])}function Qo(e,t){const{planeLike:i,getZ:n}=e,s=new Array;if(vt(t))e.addIfOnTheGround(s,ku(i,t.point));else if(Rt(t))e.addIfOnTheGround(s,ma(i,t.lineLike));else if(At(t))for(const[o,r]of no(i,t.center,t.radius)){const l=n(o,r);l!=null&&s.push(pe(o,r,l))}else if(Vt(t)||hn(t))for(const[o,r]of ya(i,t.planeLike)){const l=n(o,r)??Ia;s.push(pe(o,r,l))}return Pt(s)}function Yn(e){return Li(e.map(([t,i])=>{const n=ve(t,i,0),s=ve(t,i,1);return new Ma(n,s)}))}function Pt(e){return Li(e.map(t=>t?new Je(t):void 0))}function Oa(e,t){return Pt(e.map(([i,n])=>[i,n,t]))}function Li(e){if(e.length!==0)return e.length===1?e[0]??void 0:new ka(e.filter(ki))}function ds(e){return e instanceof ka}function vt(e){return e instanceof Je}function Rt(e){return e instanceof ao}function Ht(e){return e instanceof Ra}function Vt(e){return e instanceof Va}function At(e){return e instanceof Ca}function Nt(e){return e instanceof lo}function oe(e){return e instanceof co}function Ft(e){return e instanceof $u}function hn(e){return e instanceof Hu}function rp(e){return e instanceof Aa}function ap(e){return e instanceof ho}const Ia=0;var A;function po(e,t){if(e==null||t==null)return;const i=fs(e,t);return i!=null?Dt(i,"radians","geographic"):void 0}(function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"})(A||(A={}));const fs=(()=>{const e=g(),t=g();return(i,n)=>(N(e,i.x,i.y,i.z??0),N(t,n.x,n.y,n.z??0),lp(e,t,i.spatialReference,n.spatialReference))})(),lp=(()=>{const e=G(),t=g(),i=g();return(n,s,o,r)=>{if(H(n,s))return;const l=rn(o),h=rn(r);if(l&&h&&Qe(l,h)&&xt(n,o,t,l)&&xt(s,r,i,h)){const{azimuth:p}=mn(pp,t,i,l);return p!=null?fn(p,"degrees","radians"):void 0}e[0]=s[0]-n[0],e[1]=s[1]-n[1];let u=Pc(Rc,e);return e[0]<0&&(u=dp-u),u}})();function cp(e,t,i,n=A.Absolute){if(t&&i)switch(n){case A.Absolute:return po(t,i);case A.Relative:return un(Jo(e,t,i),A.Relative);case A.RelativeBilateral:return un(Jo(e,t,i),A.RelativeBilateral)}}function Jo(e,t,i){if(!e||!t||!i)return;const n=fs(e,t),s=fs(t,i);return n!=null&&s!=null?Dt(s-n,"radians","geographic"):void 0}function un(e,t){if(e!=null)switch(t){case A.Absolute:return gs(e);case A.Relative:{const i=Mt(e);let n=tr.normalize(i,0,!0);return n===-180&&(n=180),Dt(n,"degrees","geographic")}case A.RelativeBilateral:{const i=Mt(e),n=Math.abs(tr.normalize(i,0,!0));return Dt(n,"degrees","geographic")}}}function gs(e){const t=Mt(e),i=fp.normalize(t,0,!0);return Dt(i,"degrees","geographic")}const hp=(()=>{const e=g();return(t,i,n,s,o,r="geodesic")=>{rt(e,i);const l=Mt(o);if(r==="geodesic"){const f=rn(n);if(f&&xt(e,n,e,f))return bi(t,e,l,s,f),t[2]=i[2],!!xt(t,f,t,n)}const h=qr(l,"geographic","arithmetic"),u=fn(h,"degrees","radians"),p=i[0]+s*Math.cos(u),d=i[1]+s*Math.sin(u),m=i[2];return N(t,p,d,m),!0}})();function Mt(e){if(e!=null)return qr(up(e),e.rotationType,"geographic")}function up(e){return fn(e.value,e.unit,"degrees")}const pp=new yn,dp=2*Math.PI,fp=ta,tr=new Qs(-180,180);function gp(e,t,i,n,s,o){let r="geodesic",l=rn(i);const h=j();return to(e,t,n,h),h[2]=0,l&&xt(h,i,h,l)||(r="euclidean",l=i),{mode:r,view:t,elevationInfo:n,hasZ:s,directionMode:o,spatialReference:e.spatialReference,measurementSR:l,origin:h}}function mp(e,t,i){if(t==null||e==null)return;const n=Bs(i.measurementSR);if(n==null)return;const s=Sn(e,i);if(s==null)return;const o=_n(t,n);return new Ca(s,o)}function yp(e,t,i,n){if(i==null||e==null)return;const s=Sn(e,n);if(s==null)return;const o=Mt(i),r=10,l=u=>{if(u==null)return;const p=j(),d=Dt(u,"degrees","geographic");return hp(p,s,n.measurementSR,r,d,n.mode)?new Uu(s,p):void 0},h=()=>{if(t!=null&&e!=null)return Mt(po(t,e))};switch(n.directionMode){case A.Absolute:return l(o);case A.Relative:{const u=h();return u==null?void 0:l(u+o)}case A.RelativeBilateral:{const u=h();return u==null?void 0:Li([l(u+o),l(u-o)])}}}function La(e,t){const i=Pn(e,t);return i!=null?new Ra(i):void 0}function Ga(e,t,i){const{context:n,longitude:s,latitude:o,direction:r,distance:l,elevation:h}=i;if(s!=null||o!=null||l!=null||h!=null||r!=null){if(s!=null||o!=null){const u=Mt(s),p=Mt(o),d=Pn(h,n);return new ho(u,p,d)}return _p(e,t,i)}}function _p(e,t,{context:i,direction:n,distance:s,elevation:o}){if(t==null)return La(o,i);const{view:r,elevationInfo:l,measurementSR:h}=i,u=to(t,r,l);if(!h||!xt(u,t.spatialReference,er,h))return;const[p,d]=er,m=s!=null?_n(s,"meters"):void 0,f=Mt(n),_=Pn(o,i),y=b=>{const S=new Aa([p,d],h,m,_,b);return m==null||b==null||_==null&&i.hasZ?S:new Je(S.closestTo(u))};if(f==null)return y(void 0);const w=()=>{if(e!=null&&t!=null)return Mt(po(e,t))};switch(i.directionMode){case A.Absolute:return y(f);case A.Relative:{const b=w();return b==null?void 0:y(b+f)}case A.RelativeBilateral:{const b=w();return b==null?void 0:Li([y(b+f),y(b-f)])}}}function vp(e){return e.context.mode==="geodesic"?Ga(null,null,e):Da(e)}function xp(e,t,i){const{context:n,x:s,y:o,distance:r,direction:l,elevation:h}=i;return n.mode==="geodesic"?Ga(t,e,i):s!=null||o!=null?Da(i):bp([mp(e,r,n),yp(e,t,l,n),La(h,n)])}function Da({x:e,y:t,elevation:i,context:n}){Hi.x=e?.value??0,Hi.y=t?.value??0,Hi.spatialReference=n.spatialReference;const s=Sn(Hi,n,Ep);return new ho(e!=null&&s!=null?s[0]:void 0,t!=null&&s!=null?s[1]:void 0,Pn(i,n))}function bp(e){let t;for(const i of e)i&&(t=t?.intersect(i)??i);return t}function Sn(e,t,i=j()){const{view:n,elevationInfo:s,measurementSR:o,origin:r,mode:l}=t;if(to(e,n,s,i),xt(i,e.spatialReference,i,o))return l!=="geodesic"&&Et(i,i,r),i}function wp(e,t,i,n){const{view:s,measurementSR:o,spatialReference:r,origin:l,mode:h}=i;if(h==="geodesic"?rt(oi,e):ut(oi,e,l),xt(oi,o,oi,r))return Wh(oi,s,t,i,n)}function Pn(e,t){return Tp(e,t)?.value??void 0}function Tp(e,{view:t,origin:i,elevationInfo:n,hasZ:s,measurementSR:o}){if(e==null||!s)return;const r=zr(o);if(r==null)return;const[l,h]=i,u=_n(e,r),p=t?.type==="3d"?Nr(t,l,h,u,o,n):u;return p!=null?ft(p,r):void 0}const er=j(),Ep=j(),oi=j(),Hi=Ys(0,0,0,ue.WGS84),Sp="z",Pp="r",ir={toggle:"Control"},$e={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"},kt={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight",modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:Yr,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},undo:Sp,redo:Pp};let Mp=class{constructor(){this._bindings=new Map}add(e,t){return this.addToggle(e,i=>{i.type==="key-down"&&t(i)})}addToggle(e,t){const i=kp.fromDefinition(e,t),n=ec(this._bindings,i.key,()=>[]);return n.push(i),W(()=>Dr(n,i))}register(e,t=Xr.WIDGET){return Gr([e.on("key-down",i=>this.dispatch(e.inputManager,i),t),e.on("key-up",i=>this.dispatch(e.inputManager,i),t)])}dispatch(e,t){const i=t.key,n=this._bindings.get(i);if(n)for(const s of n)s.process(e,t)}},kp=class ms{constructor(t,i,n,s,o){this.key=t,this.modifiers=i,this.repeats=n,this.continuePropagation=s,this.callback=o}process(t,i){if(!(i.key!==this.key||"repeat"in i&&i.repeat&&!this.repeats)){for(const n of this.modifiers)if(!t.isModifierKeyDown(n))return;this.continuePropagation||i.stopPropagation(),this.callback(i)}}static fromDefinition(t,i){if(typeof t=="string")return new ms(t,[],!1,!1,i);const{key:n,modifier:s,repeats:o,continuePropagation:r}=t;return new ms(n,s?Array.isArray(s)?s:[s]:[],!!o,!!r,i)}};const Q="esri-tooltip",Cp=`${Q}-content`,Rp=`${Q}-content--input`,Vp=`${Q}-content__header`,Ap=`${Q}-content__header__spacer`,nr=`${Q}-content__header__actions`,za=`${Q}-draw-header-actions`,Op=`${Q}-table`,Ip=`${Q}-help-message`,Lp=`${Q}-help-message__text`,Gp=`${Q}-help-message__icon`,Ni=`${Q}-field`,Fi={base:Ni,inputMode:`${Ni}--input`,title:`${Ni}__title`,value:`${Ni}__value`};let U=class extends Vi{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return v("div",{class:this.classes({[Fi.base]:!0,[Fi.inputMode]:this.mode==="input"})},v("div",{class:Fi.title,key:"title"},this.title),v("div",{class:Fi.value,key:"value"},this.value))}};a([c()],U.prototype,"hidden",void 0),a([c()],U.prototype,"mode",void 0),a([c()],U.prototype,"title",void 0),a([c()],U.prototype,"value",void 0),U=a([x("esri.views.interactive.tooltip.components.TooltipField")],U);const Dp={base:`${Q}-value-by-value`};let Yt=class extends Vi{constructor(){super(...arguments),this.divider="×"}render(){return v("div",{class:Dp.base},v("span",null,this.left),v("span",null,this.divider),v("span",null,this.right))}};a([c()],Yt.prototype,"left",void 0),a([c()],Yt.prototype,"divider",void 0),a([c()],Yt.prototype,"right",void 0),Yt=a([x("esri.views.interactive.tooltip.components.ValueByValue")],Yt);function ys(e){let t,i,n=[],s=!1;function o(...r){return s&&t===this&&zp(r,n)||(i=e.apply(this,r),t=this,n=r,s=!0),i}return o}function zp(e,t){if(e.length!==t.length)return!1;for(let i=0;iQp(e,i,n??t.area),length:(i,n,s)=>or(e,i,n??t.length,s),lengthRelative:(i,n)=>qp(e,i,n??t.length),totalLength:(i,n)=>or(e,i,n??t.length),verticalLength:(i,n)=>jp(e,i,n??t.verticalLength),verticalLengthRelative:(i,n)=>Kp(e,i,n??t.verticalLength),percentage:ld,scalar:Fa,scale:cd}}function td(e){return Ci(e,{signDisplay:"exceptZero",...go(kn)})}function ed(e){return Mn(e,e.rotationType,kn)}function id(e){const t=Mt(e);return Ci(t,{style:"unit",unitDisplay:"narrow",unit:"degree",signDisplay:t>0?"never":"exceptZero",...go(kn)})}function nd(e){return Mn(e,e.rotationType,kn)}function sd(e){return Ha(e,Wa)}function od(e){return Ha(e,Ya)}function rd(e){return Na(e,Wa)}function ad(e){return Na(e,Ya)}function Ha(e,t){return Mn(te(e,"degrees"),"geographic",$a,t,!1)}function Na(e,t){const i=t.normalize(te(e,"degrees").value,void 0,!1);return Fa(Qt(i),$a)}function ld(e){return Ci(e.value,{style:"percent"})}function cd(e){return Ci(e,{style:"percent",maximumFractionDigits:0})}function Fa(e,t){return Ci(e.value,go(t))}function go(e){return{minimumFractionDigits:e,maximumFractionDigits:e}}function xe({createQuantity:e,sanitize:t}){return(i,n)=>{if(i==null)return null;t&&(i=t(i));const s=Ze(i);return s==null?null:e(s,n)}}function Za(e){return e.replaceAll(/[*^~°º]/g,"")}const hd=e=>{let t=`[-+]?[0-9${e.thousands}]+`;return e.decimal!==""&&(t+=`${e.decimal}[0-9]+`),new RegExp(`^(${t}\\s*)${e.separator}(\\s*${t})$`,"i")},ud=" ",Ba=[];for(const e of[",","\\|","\\s+"])for(const t of["\\.",",",""])for(const i of["",",","\\.",ud,"\\s+"])e!==t&&e!==i&&t!==i&&Ba.push({separator:e,decimal:t,thousands:i,pattern:hd({decimal:t,thousands:i,separator:e})});function pd(e){for(const{decimal:t,thousands:i,pattern:n}of Ba){n.lastIndex=0;const s=e.match(n);if(!s)continue;const o=Ze(rr(s[1],t,i)),r=Ze(rr(s[2],t,i));if(o!=null&&r!=null)return{x:Qt(o),y:Qt(r)}}return null}function rr(e,t,i){let n=e.replaceAll(/[\s+]/g,"");return i!==""&&(n=n.replaceAll(i,"")),t!==""&&(n=n.replaceAll(t,".")),n}function dd(e){if(!e||Ze(e)!=null||!eo())return null;const t=Si(e),i=Ke(t?.latitude),n=Ke(t?.longitude);return n!=null&&i!=null?{latitude:i,longitude:n}:null}function fd(e){return Ke(au(e))}function gd(e){return Ke(lu(e))}function Ke(e){return e!=null?Dt(e,"degrees","geographic"):null}const Wa=new Qs(-180,180),Ya=new Qs(-90,90),Xn=Symbol("dragHandles");let E=class extends Vi{constructor(){super(...arguments),this._focusAbortController=new AbortController,this._transitionInfo=null,this._mode="feedback",this._getFormatters=ys(Jp),this._onHeaderPointerDown=e=>{const t=e.target;t instanceof HTMLElement&&t?.tagName?.toLowerCase()!=="calcite-button"&&(this.removeHandles(Xn),t.setPointerCapture(e.pointerId),this.tooltip.onDragStart(e.clientX,e.clientY),this.addHandles([di(t,"pointermove",({clientX:i,clientY:n})=>{this.tooltip.onDrag(i,n)}),di(t,["pointerup","pointercancel"],i=>{this.removeHandles(Xn),t.releasePointerCapture(e.pointerId),this.tooltip.onDragEnd()}),di(t,"touchstart",i=>i.preventDefault())],Xn))},this._onDiscard=()=>{this.destroyed||(this.tooltip.emit("discard"),this.info.clearInputValues(),this.exitInputMode())},this._onCommit=(e,t)=>{if(this.destroyed)return;if(this.tooltip.emit("commit",{type:t}),t==="commit-and-exit")return void this.exitInputMode();if(t==="commit-on-blur")return;const i=this._getFocusableElements(),n=i.length,s=i.indexOf(e);if(s===-1)return void this.exitInputMode();const o=((s+(t==="commit-and-next"?1:-1))%n+n)%n;Zi(i.at(o))},this._onKeyDown=e=>{switch(e.code){case $e.next:return this._onNextKey(e);case $e.discard:return e.stopPropagation(),this._onDiscard()}}}get mode(){return this._mode}get _displayUnits(){const{displayUnits:e}=this.info.sketchOptions.values,t=sr(this.tooltip.view);return{length:e.length??t,verticalLength:e.verticalLength??t,area:e.area??t}}get _inputUnitInfos(){const e=this._messagesUnits,t=l=>({unit:l,abbreviation:ih(e,l,"abbr")}),{inputUnits:i}=this.info.sketchOptions.values,n=sr(this.tooltip.view),s=i.length??n,o=i.verticalLength??n,r=i.area??n;return{length:t(sc(s)),verticalLength:t(oc(o)),area:t(rc(r)),angle:t("degrees")}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,sketchOptions:this.info.sketchOptions,onCommit:this._onCommit,onDiscard:this._onDiscard}}render(){const{visibleElements:e}=this.info.sketchOptions.tooltips,t=this._renderedContent,i=this._renderedActions,n=this._renderedHelpMessage,s=t.length>0,o=s||!!n,r=this.mode==="input";return v("div",{class:Oh(Cp,r&&Rp),onkeydown:this._onKeyDown,tabIndex:-1},r&&o&&e.header?v("div",{class:Vp,"data-testid":"tooltip-header",key:"header",onpointerdown:this._onHeaderPointerDown},v("calcite-button",{appearance:"transparent","data-testid":"tooltip-back-button",iconFlipRtl:"both",iconStart:"chevron-left",key:"discard-button",kind:"neutral",onclick:this._onDiscard,scale:"s",tabIndex:-1}),i.length>0?v(wt,null,v("div",{class:Ap,key:"spacer"}),v("div",{class:nr,key:"actions"},i)):null):null,s?v("div",{class:Op,key:"content"},...t):null,n)}destroy(){this._focusAbortController.abort(),this._transitionInfo?.transition.skipTransition()}_renderActions(){return null}loadDependencies(){return Js({button:()=>Lt(()=>import("./calcite-button-Cm9_TJei-BWKp46iV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),icon:()=>Lt(()=>import("./calcite-icon-laqhdRBY-Bm5S9Lju.js"),__vite__mapDeps([18,15,1,2,3,4,6,13]),import.meta.url),input:()=>Lt(()=>import("./calcite-input-BKRd7MCS-BjdnYfeD.js"),__vite__mapDeps([19,20,1,2,3,4,6,5,7,12,8,9,10,11,13,14,15]),import.meta.url)})}async enterInputMode(e,t){try{await this._transitionTo("input",t),await this._focusField(e)}catch(i){ko(i)}}async exitInputMode({focusOnView:e=!0}={}){try{const{container:t,info:i}=this;i.clearInputValues();const n=e?t?.closest(".esri-view")?.querySelector(".esri-view-surface"):null;await this._transitionTo("feedback"),n instanceof HTMLElement&&n.focus()}catch(t){ko(t)}}_onNextKey(e){const t=this._getFocusableElements(),i=t.at(0),n=t.at(-1);i&&n&&(e.shiftKey?document.activeElement===i&&(e.preventDefault(),e.stopPropagation(),Zi(n)):document.activeElement===n&&(e.preventDefault(),e.stopPropagation(),Zi(i)))}get _renderedContent(){return ar(this._renderContent())}get _renderedActions(){return ar(this._renderActions())}get _renderedHelpMessage(){const{sketchOptions:e,visibleElements:t}=this.info;if(!t.helpMessage)return null;const i=e.tooltips.helpMessage??this._defaultHelpMessage;if(!i)return null;const n=e.tooltips.helpMessageIcon??"information";return v("div",{class:Ip,key:"help-message"},n?v("calcite-icon",{class:Gp,icon:n,scale:"s"}):null,v("div",{class:Lp},i))}get _defaultHelpMessage(){const{helpMessage:e,viewType:t}=this.info;if(e==null)return null;const i=t==="3d"?"helpMessages3d":"helpMessages2d";return this._messagesTooltip?.sketch?.[i]?.[e]}async _focusField(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const{signal:t}=this._focusAbortController;await this._waitForInputs(),ql(t);const i=this._getFocusableInputs(),n=e?i.find(s=>s.getAttribute("data-field-name")===e):i.at(0);await Zi(n)}async _transitionTo(e,t){if(this._mode===e&&!this._transitionInfo)return;if(this._transitionInfo?.mode===e)return this._transitionInfo.transition.finished;this._transitionInfo?.transition.skipTransition();const i=async()=>{this.destroyed||(this._mode=e,await Ro(),this.destroyed||(this.renderNow(),await Ro(),this.destroyed||t?.()))};if(!this.domNode?.firstChild||!document.startViewTransition||qc())return void await i();this.autoRenderingEnabled=!1;const n=this._transitionInfo={transition:document.startViewTransition(async()=>{this.destroyed||n!==this._transitionInfo||(this.autoRenderingEnabled=!0,await i())}),mode:e};try{await n.transition.finished}finally{n===this._transitionInfo&&(this._transitionInfo=null)}}async _waitForInputs(){const e=()=>Array.from(this.domNode?.querySelectorAll("calcite-input")??[]);for(;e().length===0;)await jl(md);await Rr()}_getFocusableInputs(){return Array.from(this.domNode?.querySelectorAll("calcite-input:not([read-only]):not([disabled])")??[])}_getFocusableElements(){const e=this.domNode?.querySelector(`.${za}`);return[...Array.from(e?.querySelectorAll(`.${nr} calcite-button:not([disabled])`)??[]),...this._getFocusableInputs()]}};async function Zi(e){await e?.setFocus()}function ar(e){return(Array.isArray(e)?e:[e]).flat(10).filter(t=>!!t)}a([cs("esri/core/t9n/Units"),c()],E.prototype,"_messagesUnits",void 0),a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],E.prototype,"_messagesTooltip",void 0),a([c()],E.prototype,"info",void 0),a([c()],E.prototype,"tooltip",void 0),a([c()],E.prototype,"_mode",void 0),a([c()],E.prototype,"mode",null),a([c()],E.prototype,"_displayUnits",null),a([c()],E.prototype,"_inputUnitInfos",null),a([c()],E.prototype,"_formatters",null),a([c()],E.prototype,"fieldContext",null),a([c()],E.prototype,"_renderedContent",null),a([c()],E.prototype,"_renderedActions",null),a([c()],E.prototype,"_renderedHelpMessage",null),a([c()],E.prototype,"_defaultHelpMessage",null),E=a([x("esri.views.interactive.tooltip.content.TooltipContent")],E);const md=20;let _s=class extends E{_renderContent(){const{area:e,radius:t,xSize:i,ySize:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.radius&&t!=null?v(U,{title:o.radius,value:r.length(t)}):null,s.size&&i!=null&&n!=null?v(U,{title:o.size,value:v(Yt,{left:r.length(i),right:r.length(n)})}):null,s.area?v(U,{title:o.area,value:r.area(e)}):null)}};_s=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],_s);const ct=`${Q}-editable-field`,st={base:ct,inputMode:`${ct}--input`,feedbackMode:`${ct}--feedback`,readOnly:`${ct}--read-only`,locked:`${ct}--locked`,title:`${ct}__title`,value:`${ct}__value`,valueContent:`${ct}__value__content`,valueContentReadOnly:`${ct}__value__content--read-only`,lockIcon:`${ct}__lock-icon`,input:`${ct}__input`,inputSuffix:`${ct}__input-suffix`,button:`${ct}__button`},qn={lock:"lock",unlock:"unlock"};let yt=class extends Vi{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=e=>{this._lock=e},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=e=>{e.key===$e.discard&&this.mode==="input"&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=e=>{const t=this._input;if(t)switch(e.key){case $e.commit:return this.field.onCommit("commit-and-exit",t,this.context);case $e.next:{e.preventDefault(),e.stopPropagation();const i=e.shiftKey?"commit-and-previous":"commit-and-next";return this.field.onCommit(i,t,this.context)}}},this._onInput=e=>{this.field.onInput(e.target.value)},this._onInputBlur=e=>{const t=this._input;t&&e.relatedTarget!==this._lock&&this.field.onCommit("commit-on-blur",t,this.context)},this._selectText=()=>{const e=()=>{this._input===document.activeElement&&this._input?.selectText()};e(),Rr().then(e)},this._onAfterCreate=e=>{this._input=e,e.addEventListener("paste",this._onPaste),e.addEventListener("beforeinput",this._onBeforeInput)},this._onAfterRemoved=e=>{e.removeEventListener("paste",this._onPaste),e.removeEventListener("beforeinput",this._onBeforeInput)},this._onPaste=e=>{const t=e.clipboardData?.getData("text");t&&this.field.parse(t,this.context)!=null&&(e.stopPropagation(),this.field.onInput(t))},this._onBeforeInput=e=>{(e.inputType==="historyUndo"||e.inputType==="historyRedo")&&!this.field.dirty&&e.preventDefault()}}initialize(){this.addHandles($(()=>this._rawDisplayValue,()=>{const{committed:e,inputValue:t}=this.field;e||t||this._input!==document.activeElement||this._selectText()}))}loadDependencies(){return Js({button:()=>Lt(()=>import("./calcite-button-Cm9_TJei-BWKp46iV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),icon:()=>Lt(()=>import("./calcite-icon-laqhdRBY-Bm5S9Lju.js"),__vite__mapDeps([18,15,1,2,3,4,6,13]),import.meta.url),input:()=>Lt(()=>import("./calcite-input-BKRd7MCS-BjdnYfeD.js"),__vite__mapDeps([19,20,1,2,3,4,6,5,7,12,8,9,10,11,13,14,15]),import.meta.url)})}render(){const{field:e,mode:t}=this,i=t==="input",{locked:n,readOnly:s}=e;return v("div",{class:this.classes({[st.base]:!0,[st.feedbackMode]:t==="feedback",[st.inputMode]:t==="input",[st.locked]:n,[st.readOnly]:s})},v("div",{class:st.title,key:"title"},this._title),v("div",{class:st.value,key:"value",onkeydown:this._onKeyDown},i?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||lr}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){const{title:e}=this.field;return typeof e=="string"?e:e(this.context)}_renderValueFeedbackMode(){return v(wt,null,v("div",{class:st.valueContent,key:"value-feedback"},this._formattedValue),this.field.locked&&this.mode!=="input"?v("calcite-icon",{class:st.lockIcon,icon:qn.lock,key:"icon",scale:"s"}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return v("div",{class:this.classes(st.valueContent,st.valueContentReadOnly),key:"value-read-only"},this._formattedValue)}_renderValueWritable(){const{field:e}=this,{name:t,invalid:i,locked:n}=e,s=this.context?.messages.sketch??{},o=n?s.unlockConstraint:s.lockConstraint;return v(wt,null,v("calcite-input",{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:st.input,"data-field-name":t,"data-testid":`tooltip-field-${t}`,key:"input",onblur:this._onInputBlur,onfocus:this._selectText,onkeydown:this._onInputKeyDown,scale:"s",status:i?"invalid":"idle",type:"text",value:this._rawDisplayValue??lr,onCalciteInputInput:this._onInput}),v("div",{class:st.inputSuffix,key:"suffix"},this._suffix),e.lockable?v("calcite-button",{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:"center",appearance:"transparent",class:st.button,"data-testid":`tooltip-field-${t}-lock`,iconStart:n?qn.lock:qn.unlock,key:"lock",kind:"neutral",label:o,onclick:this._onLockClick,scale:"s",tabIndex:-1,title:o}):v("div",{key:"lock-empty"}))}};a([c()],yt.prototype,"field",void 0),a([c()],yt.prototype,"context",void 0),a([c()],yt.prototype,"mode",void 0),a([c()],yt.prototype,"_input",void 0),a([c()],yt.prototype,"_lock",void 0),a([c()],yt.prototype,"_formattedValue",null),a([c()],yt.prototype,"_rawDisplayValue",null),a([c()],yt.prototype,"_suffix",null),a([c()],yt.prototype,"_title",null),yt=a([x("esri.views.interactive.tooltip.components.TooltipEditableField")],yt);const lr="—";function ee(e){const t=e.fields.filter(i=>i?.visible===!0);return t.length===0?null:v(wt,null,t.map(i=>v(yt,{context:e.context,field:i,key:i.id,mode:e.mode})))}let vs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};vs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],vs);let xs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{elevation:n,visibleElements:s}=t;return v(ee,{context:e,fields:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0,s.elevation?n:void 0],mode:i})}};xs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],xs);const jn={absolute:"absolute-direction",relative:"relative-direction"};let Ee=class extends Vi{constructor(e){super(e),this.visibleElements={}}render(){return v("div",{class:za},this._isElementVisible("direction")?v(yd,{messages:this.messages,sketchOptions:this.sketchOptions}):null)}loadDependencies(){return Js({button:()=>Lt(()=>import("./calcite-button-Cm9_TJei-BWKp46iV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),dropdown:()=>Lt(()=>import("./calcite-dropdown-CLrG397W-D0Dzxk5y.js"),__vite__mapDeps([21,1,2,3,4,6,22,23,17,7,12,10,13,24]),import.meta.url),"dropdown-item":()=>Lt(()=>import("./calcite-dropdown-item-DpLfv4A0-BVjBECLP.js"),__vite__mapDeps([25,1,2,3,4,6,10,9,7,26,15,13]),import.meta.url),"dropdown-group":()=>Lt(()=>import("./calcite-dropdown-group-0sIPwaDd-DYLu_D_p.js"),__vite__mapDeps([27,1,2,3,4,13,26]),import.meta.url)})}_isElementVisible(e){return this.visibleElements?.[e]??this.sketchOptions.tooltips.visibleElements[e]}};function yd(e){const{directionMode:t}=e.sketchOptions.values,i=e.messages?.sketch,n=i?.directionModeSelect?.title,s="absolute",o="relative";return v("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",widthScale:"s",onCalciteDropdownSelect:r=>{const l=r.target.selectedItems?.[0]?.getAttribute("data-mode");e.sketchOptions.values.directionMode=l??"absolute"}},v("calcite-button",{alignment:"end",appearance:"transparent",iconStart:jn[t],kind:"neutral",label:n,scale:"s",slot:"trigger",title:n}),v("calcite-dropdown-group",{selectionMode:"single"},v("calcite-dropdown-item",{"data-mode":o,"data-testid":"tooltip-direction-mode-relative",iconStart:jn.relative,key:"relative",selected:t===o},i?.directionModeSelect?.relative),v("calcite-dropdown-item",{"data-mode":s,"data-testid":"tooltip-direction-mode-absolute",iconStart:jn.absolute,key:"absolute",selected:t===s},i?.directionModeSelect?.absolute)))}a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],Ee.prototype,"messages",void 0),a([c()],Ee.prototype,"sketchOptions",void 0),a([c()],Ee.prototype,"visibleElements",void 0),Ee=a([x("esri.views.interactive.tooltip.components.DrawHeaderActions")],Ee);let bs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.area?t.area:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};bs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],bs);let ws=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.totalLength?t.totalLength:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};ws=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],ws);let Ts=class extends E{_renderContent(){const{area:e,xSize:t,ySize:i,visibleElements:n}=this.info,s=this._messagesTooltip.sketch,o=this._formatters;return v(wt,null,n.size&&t!=null&&i!=null?v(U,{title:s.size,value:v(Yt,{left:o.length(t),right:o.length(i)})}):null,n.area?v(U,{title:s.area,value:o.area(e)}):null)}};Ts=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],Ts);let Es=class extends E{_renderContent(){const{angle:e,visibleElements:t}=this.info,i=this._messagesTooltip.sketch;return v(wt,null,t.rotation?v(U,{title:i.rotation,value:this._formatters.angleRelative(e)}):null)}};Es=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentRotate")],Es);let Ss=class extends E{_renderContent(){const e=this.info,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.size?v(U,{title:i.size,value:v(Yt,{left:n.length(e.xSize),right:n.length(e.ySize)})}):null,t.scale?v(U,{title:i.scale,value:v(Yt,{left:n.scale(e.xScale),right:n.scale(e.yScale)})}):null)}};Ss=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentScale")],Ss);let Ps=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0],mode:i})}};Ps=a([x("esri.views.interactive.tooltip.content.TooltipContentMovePoint")],Ps);let Ms=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.distance?t.distance:void 0,n.area?t.area:void 0,n.totalLength?t.totalLength:void 0],mode:i})}};Ms=a([x("esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset")],Ms);let ks=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.area&&t.geometryType==="polygon"?t.area:null,n.totalLength&&t.geometryType==="polyline"?t.totalLength:null],mode:i})}};ks=a([x("esri.views.interactive.tooltip.content.TooltipContentSelectedVertex")],ks);let Cs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};Cs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformMesh")],Cs);let Rs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.size?t.size:void 0],mode:i})}};Rs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformPoint")],Rs);let Vs=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v(U,{title:i.distance,value:n.length(e.distance)}):null)}};Vs=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslate")],Vs);let As=class extends E{_renderContent(){const{distance:e,elevation:t,area:i,totalLength:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.distance?v(U,{title:o.distance,value:r.length(e)}):null,s.elevation&&t?.actual!=null?v(U,{title:o.elevation,value:r.verticalLength(t.actual)}):null,s.area&&i!=null?v(U,{title:o.area,value:r.area(i)}):null,s.totalLength&&n!=null?v(U,{title:o.totalLength,value:r.length(n)}):null)}};As=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],As);let Os=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v(U,{title:i.distance,value:n.length(e.distance)}):null)}};Os=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateXY")],Os);let Is=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch;return v(wt,null,t.distance?v(U,{title:i.distance,value:this._formatters.verticalLengthRelative(e.distance)}):null)}};Is=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateZ")],Is);function _d(e,t){if(t==null)return null;const i=document.createElement("div");switch(t.type){case"draw-point":return new xs({tooltip:e,info:t,container:i});case"draw-polygon":return new bs({tooltip:e,info:t,container:i});case"draw-polyline":return new ws({tooltip:e,info:t,container:i});case"draw-mesh":return new vs({tooltip:e,info:t,container:i});case"draw-rectangle":return new Ts({tooltip:e,info:t,container:i});case"draw-circle":return new _s({tooltip:e,info:t,container:i});case"extent-rotate":return new Es({tooltip:e,info:t,container:i});case"extent-scale":return new Ss({tooltip:e,info:t,container:i});case"move-point":return new Ps({tooltip:e,info:t,container:i});case"selected-vertex":return new ks({tooltip:e,info:t,container:i});case"transform-point":return new Rs({tooltip:e,info:t,container:i});case"transform-mesh":return new Cs({tooltip:e,info:t,container:i});case"translate":return new Vs({tooltip:e,info:t,container:i});case"translate-vertex":return new As({tooltip:e,info:t,container:i});case"translate-z":return new Is({tooltip:e,info:t,container:i});case"translate-xy":return new Os({tooltip:e,info:t,container:i});case"reshape-edge-offset":return new Ms({tooltip:e,info:t,container:i})}}const ci={base:`${Q}`,ltr:`${Q}--ltr`,rtl:`${Q}--rtl`,debug:`${Q}--debug`},vd=20,xd=16,bd="bottom-end";let F=class extends Ce.EventedAccessor{constructor(e){super(e),this.info=null,this.options=null,this.position=null,this.content=null,this._focused=!1,this.outerContainer=document.createElement("div"),this.debug=!1,this._lastPosition=null,this._rtl=!1,this._prevXY=[0,0]}initialize(){const{outerContainer:e}=this;this.addHandles([$(()=>this.view.overlay?.surface,t=>{e.remove(),t?.appendChild(e),this._rtl=Vh(t)},ke),$(()=>this.info,(t,i)=>{if(this.content!=null&&t!=null&&i!=null&&t.type===i.type)this.content.info=t;else{dt(this.content);const n=_d(this,t);n?(this.content=n,n.container&&e.appendChild(n.container),this.exitInputMode()):this.content=null}},ke),$(()=>({container:this.outerContainer,style:this._outerContainerStyle}),({container:t,style:i})=>{Object.assign(t.style,i)},es),$(()=>({outerContainer:this.outerContainer,placement:this.effectivePlacement,effectiveOffset:this._effectiveOffset,rtl:this._rtl,debug:this.debug}),({outerContainer:t,placement:i,effectiveOffset:n,rtl:s,debug:o})=>{const{classList:r}=t;r.add(ci.base),r.toggle(ci.rtl,s),r.toggle(ci.ltr,!s),r.toggle(ci.debug,o),this.outerContainer.style.setProperty("--offset",`${n}px`),Ah(t),Ed(t,i)},es),Il(()=>this.mode==="feedback",()=>{this.position=null,this._clearOverride("effectivePlacement")},Us),di(this.outerContainer,"paste",t=>{this.emit("paste",t)}),di(this.outerContainer,["focusin","focusout"],()=>{setTimeout(()=>{this._focused=this.content?.container?.contains(document.activeElement)??!1})})])}destroy(){this.info=null,this.content=dt(this.content),this.outerContainer.remove()}get mode(){return this.content?.mode??"feedback"}get focused(){return this._focused}get visible(){return this._outerContainerStyle.display!=="none"}get contentContainer(){return this.content?.container}get effectivePlacement(){const e=this.options?.placement;return e==="auto"?"bottom-end":e??bd}get _screenPoint(){const{inputManager:e}=this.view;return e?.multiTouchActive?null:e?.latestPointerLocation}get _effectiveOffset(){return this.options?.offset??vd}get _outerContainerStyle(){const e=this.position??this._screenPoint;return this._lastPosition=So(e),e!=null&&this.content!=null?{display:"block",transform:`translate(${Math.round(e.x)}px, ${Math.round(e.y)}px)`}:{display:"none",transform:"none"}}clear(){this.info=null}async enterInputMode(e){const t=this.position??this._lastPosition??this._screenPoint,i=this.position=So(t),{effectivePlacement:n}=this;this._override("effectivePlacement",n);const s=()=>{i&&(this.position=wd(this.contentContainer,i,this._effectiveOffset,this.view),Object.assign(this.outerContainer.style,this._outerContainerStyle))};await this.content?.enterInputMode(e,s)}async exitInputMode(e){await this.content?.exitInputMode(e)}onDragStart(e,t){this._prevXY=[e,t]}onDrag(e,t){const i=e-this._prevXY[0],n=t-this._prevXY[1];this._prevXY=[e,t];const{position:s}=this;if(s){const{view:o}=this,r=e-o.position[0],l=t-o.position[1];if(r<0||r>o.width||l<0||l>o.height-xd)return;this.position=$s(s.x+i,s.y+n)}}onDragEnd(){this._prevXY=[0,0]}};function wd(e,t,i,n){if(!e||!n.container)return t;const s=e.getBoundingClientRect(),{left:o,top:r}=n.container.getBoundingClientRect();let{x:l,y:h}=t;const u=s.left-o-i;u<0&&(l-=u);const p=s.right-o+i-n.width;p>0&&(l-=p);const d=s.top-r-i;d<0&&(h-=d);const m=s.bottom-r+i-n.height;return m>0&&(h-=m),$s(l,h)}a([c({nonNullable:!0})],F.prototype,"view",void 0),a([c()],F.prototype,"info",void 0),a([c()],F.prototype,"options",void 0),a([c()],F.prototype,"position",void 0),a([c()],F.prototype,"content",void 0),a([c({readOnly:!0})],F.prototype,"mode",null),a([c()],F.prototype,"_focused",void 0),a([c({readOnly:!0})],F.prototype,"focused",null),a([c({readOnly:!0})],F.prototype,"outerContainer",void 0),a([c({readOnly:!0})],F.prototype,"contentContainer",null),a([c({readOnly:!0})],F.prototype,"effectivePlacement",null),a([c()],F.prototype,"debug",void 0),a([c()],F.prototype,"_lastPosition",void 0),a([c()],F.prototype,"_screenPoint",null),a([c()],F.prototype,"_rtl",void 0),a([c()],F.prototype,"_effectiveOffset",null),a([c()],F.prototype,"_outerContainerStyle",null),F=a([x("esri.views.interactive.Tooltip")],F);const Td=["top","bottom","leading","trailing"].flatMap(e=>[Ji(`${e}-start`),Ji(e),Ji(`${e}-end`)]);function Ji(e){return`${ci.base}--${e}`}function Ed({classList:e},t){Td.forEach(i=>e.remove(i)),e.add(Ji(t))}const Sd=F;function Pd(e){const t=new Sd(e());return t.addHandles($(()=>e(),({view:i,options:n,info:s})=>{t.view=i,n!==void 0&&(t.options=n),s!==void 0&&(t.info=s)})),t}function Md(e,t){const i=Rh(t.vertexSpace),{scale:n,orientation:s}=e,{transform:o}=t,r=kd(o);i&&r!=null?(s.actual=Dt(r,"degrees","arithmetic"),s.visible=!0):(s.actual=null,s.visible=!1),i?(n.actual=Qt(Vd(o)),n.visible=!0):(n.actual=null,n.visible=!1)}function kd(e){if(!e)return 0;const t=Cd(e.rotationAxis);return t!=null?t*e.rotationAngle:null}function Cd(e){return We(e,Hs)?1:We(e,Rd)?-1:null}const Rd=rs(g(),Hs);function Vd(e){return e?Math.max(...e.scale):1}function Ad(e,t){return!(e.type!=="key-down"||e.key!==$e.enterInputMode||!t||!Od(t.info))&&(t.enterInputMode(),e.preventDefault(),e.stopPropagation(),!0)}function Od(e){const t=e?.sketchOptions;if(!t)return!1;const{inputEnabled:i,visibleElements:n}=t.tooltips;return i&&e.editableFields.some(({name:s})=>s==="x"||s==="y"?n.coordinates:n[s])===!0}function Id(e,t,i){if(!t||!("geographic"in t))return;const n=e.clipboardData?.getData("text");if(!n)return;const s=o=>{e.stopPropagation(),e.preventDefault(),o()};if(t.geographic){const o=dd(n);o&&s(()=>{t.longitude.applyValue(o.longitude),t.latitude.applyValue(o.latitude)})}else{const o=pd(n);o&&s(()=>{t.x.applyValue(o.x),t.y.applyValue(o.y)})}}let ot=class extends tt{constructor(e){super(e),this.helpMessage=void 0,this.viewType=void 0}get visibleElements(){return this.sketchOptions.tooltips.visibleElements}get allFields(){return[]}get editableFields(){return this.allFields.filter(e=>e.visible&&!e.readOnly)}clearInputValues(){this.allFields.forEach(e=>e.clearInputValue())}};a([c()],ot.prototype,"sketchOptions",void 0),a([c()],ot.prototype,"visibleElements",null),a([c()],ot.prototype,"helpMessage",void 0),a([c()],ot.prototype,"viewType",void 0),a([c()],ot.prototype,"allFields",null),a([c()],ot.prototype,"editableFields",null),ot=a([x("esri.views.interactive.tooltip.infos.SketchTooltipInfo")],ot);let Zt=class extends ot{constructor(e){super(e),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=Ye}get allFields(){return[]}};a([c()],Zt.prototype,"type",void 0),a([c()],Zt.prototype,"radius",void 0),a([c()],Zt.prototype,"xSize",void 0),a([c()],Zt.prototype,"ySize",void 0),a([c()],Zt.prototype,"area",void 0),a([c()],Zt.prototype,"allFields",null),Zt=a([x("esri.views.interactive.tooltip.infos.DrawCircleTooltipInfo")],Zt);let M=class extends tt{constructor(e){super(e),this.actual=null,this.lockable=!0,this.id=Ih(),this.inputValue=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0}get committed(){return this.lockable?this._get("committed"):null}set committed(e){this.lockable&&this._set("committed",e)}get dirty(){return this.inputValue!=null}get locked(){return this.lockable&&this.committed!=null}onInput(e){this.inputValue=e}onCommit(e,t,i){this.lockable?this._onCommitLockable(e,i):this._onCommitNonLockable(i),this.invalid&&e==="commit-and-exit"||i.onCommit(t,e)}_onCommitLockable(e,t){const{inputValue:i,locked:n}=this;n&&Bi(i)?this.unlock():(e==="commit-and-exit"&&!n||i!=null)&&this._parseInputAndLock(t)}_onCommitNonLockable(e){const{inputValue:t}=this;Bi(t)?this.setActual(null):t!=null&&this._parseInputAndSetActual(e)}applyValue(e){this.lockable?this.lock(e):this.setActual(e)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(e){this.actual=e,this.clearInputValue()}lock(e){this.lockable&&(this.committed=e??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(e){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(e))}getSuffix(e){const{suffix:t}=this;return typeof t=="function"?t(e):t}getFormattedValue(e){const{actual:t,committed:i,format:n}=this;return i!=null?n(i,e):t!=null?n(t,e):null}getRawDisplayValue(e){const{actual:t,committed:i,inputValue:n}=this;return n??(this.lockable&&i!=null?this.formatForInputMode(i,e):t!=null?this.formatForInputMode(t,e):null)}_parseInputAndSetActual(e){const{inputValue:t}=this;if(t==null||Bi(t))return this.setActual(null);const i=this.parse(t,e);i!=null?this.setActual(i):this.invalid=!0}_parseInputAndLock(e){const{inputValue:t,actual:i}=this;if(Bi(t))return this.unlock();if(t==null)return this.lock(i);const n=this.parse(t,e);n!=null?this.lock(n):this.invalid=!0}};function Bi(e){return e!=null&&e.trim()===""}a([c()],M.prototype,"actual",void 0),a([c()],M.prototype,"committed",null),a([c()],M.prototype,"dirty",null),a([c()],M.prototype,"format",void 0),a([c()],M.prototype,"formatForInputMode",void 0),a([c()],M.prototype,"lockable",void 0),a([c()],M.prototype,"locked",null),a([c()],M.prototype,"id",void 0),a([c()],M.prototype,"inputValue",void 0),a([c()],M.prototype,"name",void 0),a([c()],M.prototype,"parse",void 0),a([c()],M.prototype,"readOnly",void 0),a([c()],M.prototype,"suffix",void 0),a([c()],M.prototype,"title",void 0),a([c()],M.prototype,"visible",void 0),a([c()],M.prototype,"invalid",void 0),a([c()],M.prototype,"unlockOnVertexPlacement",void 0),M=a([x("esri.views.interactive.tooltip.fields.TooltipField")],M);let tn=class extends M{constructor(e){super(e),this.showAsZ=!1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.verticalLength.unit;return{name:"elevation",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.verticalLength(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.verticalLength.abbreviation,title:i=>i.messages.sketch[this.showAsZ?"z":"elevation"],unlockOnVertexPlacement:!1,...e}}};a([c()],tn.prototype,"showAsZ",void 0),tn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldElevation")],tn);let en=class extends M{constructor(e){super(e),this.precision=1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.angle.unit;return{name:"orientation",actual:null,parse:xe({createQuantity:(i,n)=>Dt(i,t(n),"geographic"),sanitize:Za}),format:i=>{const n=gs(i);return Mn(n,"geographic",this.precision)},formatForInputMode:(i,n)=>{const s=gs(i);return n.formatters.scalar(s)},suffix:i=>i.inputUnitInfos.angle.abbreviation,title:i=>i.messages.sketch.orientation,...e}}};a([c()],en.prototype,"precision",void 0),en=a([x("esri.views.interactive.tooltip.fields.TooltipFieldOrientation")],en);let Kn=class extends M{constructor(e){super(e),this.precision=null}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.length.unit;return{name:"size",actual:null,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.size,...e}}};a([c()],Kn.prototype,"precision",void 0),Kn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldSize")],Kn);function Xa(e){const t=n=>n.inputUnitInfos.angle.unit,i=n=>n.sketchOptions.values.effectiveDirectionMode;return new M({name:"direction",actual:qs,parse:xe({createQuantity:(n,s)=>Dt(n,t(s),"geographic"),sanitize:Za}),format:(n,s)=>{const o=i(s),r=un(n,o);switch(o){case A.Absolute:return s.formatters.direction(r);case A.Relative:return s.formatters.directionRelative(r);case A.RelativeBilateral:return s.formatters.directionRelativeBilateral(r)}},formatForInputMode:(n,s)=>{const o=un(n,i(s));return s.formatters.scalar(te(o,t(s)))},suffix:n=>n.inputUnitInfos.angle.abbreviation,title:n=>{const s=i(n),{absolute:o,relative:r}=n.messages.sketch.direction;switch(s){case A.Absolute:return o;case A.Relative:case A.RelativeBilateral:return r}},...e})}function qa(e){const t=i=>i.inputUnitInfos.length.unit;return new M({name:"distance",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(Math.max(i,0),t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.distance,...e})}function Ld(e){return qa({format:(t,i)=>i.formatters.totalLength(t),title:t=>t.messages.sketch.totalLength,readOnly:!0,...e})}function ja(e){return qa({...e})}function Gd(e){return new tn(e)}function Dd(e){return new en(e)}function zd(e){return mo("scale",{name:"scale",actual:null,parse:xe({createQuantity:t=>Qt(Math.abs(t))}),...e})}function Ud(e){const t=i=>i.inputUnitInfos.area.unit;return new M({name:"area",actual:Ye,parse:xe({createQuantity:(i,n)=>vn(i,t(n))}),format:(i,n)=>n.formatters.area(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.area.abbreviation,title:i=>i.messages.sketch.area,readOnly:!0,...e})}function $d(e){return new M({name:"x",actual:qs,parse:fd,format:(t,i)=>i.formatters.longitudeDecimalDegrees(t),formatForInputMode:t=>rd(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.longitude,...e})}function Hd(e){return new M({name:"y",actual:qs,parse:gd,format:(t,i)=>i.formatters.latitudeDecimalDegrees(t),formatForInputMode:t=>ad(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.latitude,...e})}function Nd(e){return mo("x",{name:"x",...e})}function Fd(e){return mo("y",{name:"y",...e})}function mo(e,t){return new M({actual:Qt(0),parse:xe({createQuantity:i=>Qt(i)}),format:(i,n)=>n.formatters.scalar(i),formatForInputMode:(i,n)=>n.formatters.scalar(i),title:i=>i.messages.sketch[e],...t})}function Zd(e){return Br(e)||Zs(e)}function yo(e,t,i,...n){return Br(e)?t.apply(void 0,n):Zs(e)?i.apply(void 0,n):null}const Cn=e=>{let t=class extends e{constructor(){super(...arguments),this.longitude=$d(),this.latitude=Hd(),this.x=Nd(),this.y=Fd(),this.elevation=Gd(),this.geographic=!1}get effectiveX(){return this.geographic?this.longitude:this.x}get effectiveY(){return this.geographic?this.latitude:this.y}get key(){return{longitude:this.longitude.actual,latitude:this.latitude.actual,x:this.x.actual,y:this.y.actual,elevation:this.elevation.actual,geographic:this.geographic}}setLocationFromPoint(i,n=i?.spatialReference){if(this.geographic=!!n&&Zd(n),i==null)return this._setActualLonLat(null,null),void this._setActualXY(null,null);if(this.geographic){const s=ac(i,Bd);this._setActualLonLat(Ke(s?.[0]),Ke(s?.[1]))}else this._setActualXY(Qt(i.x),Qt(i.y))}_setActualLonLat(i,n){this.longitude.actual=i,this.latitude.actual=n}_setActualXY(i,n){this.x.actual=i,this.y.actual=n}};return a([c()],t.prototype,"geographic",void 0),a([c()],t.prototype,"effectiveX",null),a([c()],t.prototype,"effectiveY",null),a([c()],t.prototype,"key",null),t=a([x("esri.views.interactive.tooltip.infos.TooltipInfoWithCoordinates")],t),t},Bd=[0,0];let hi=class extends Cn(ot){constructor(e){super(e),this.type="draw-mesh",this.orientation=Dd({lockable:!1}),this.scale=zd({lockable:!1})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,this.orientation,this.scale]}};a([c()],hi.prototype,"helpMessage",void 0),a([c()],hi.prototype,"allFields",null),hi=a([x("esri.views.interactive.tooltip.infos.DrawMeshTooltipInfo")],hi);let ui=class extends Cn(ot){constructor(e){super(e),this.type="draw-point"}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation]}};a([c()],ui.prototype,"helpMessage",void 0),a([c()],ui.prototype,"allFields",null),ui=a([x("esri.views.interactive.tooltip.infos.DrawPointTooltipInfo")],ui);let Oe=class extends Cn(ot){constructor(e){super(e),this.type="draw-polygon",this.direction=Xa(),this.distance=ja(),this.area=Ud(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.area]}};a([c()],Oe.prototype,"xyMode",void 0),a([c()],Oe.prototype,"helpMessage",void 0),a([c()],Oe.prototype,"allFields",null),Oe=a([x("esri.views.interactive.tooltip.infos.DrawPolygonTooltipInfo")],Oe);let Ie=class extends Cn(ot){constructor(e){super(e),this.type="draw-polyline",this.direction=Xa(),this.distance=ja(),this.totalLength=Ld(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.totalLength]}};a([c()],Ie.prototype,"helpMessage",void 0),a([c()],Ie.prototype,"xyMode",void 0),a([c()],Ie.prototype,"allFields",null),Ie=a([x("esri.views.interactive.tooltip.infos.DrawPolylineTooltipInfo")],Ie);let re=class extends ot{constructor(e){super(e),this.type="draw-rectangle",this.xSize=Kt,this.ySize=Kt,this.area=Ye}get allFields(){return[]}};a([c()],re.prototype,"type",void 0),a([c()],re.prototype,"xSize",void 0),a([c()],re.prototype,"ySize",void 0),a([c()],re.prototype,"area",void 0),a([c()],re.prototype,"allFields",null),re=a([x("esri.views.interactive.tooltip.infos.DrawRectangleTooltipInfo")],re);function _o(e){return fc(e)?gc(e)||Zs(e)||mc(e)||yc(e)?Dh:e:zh(e)}function Wd(e,t=vo()){return Yd(e,t,!1)}function Yd(e,t,i=e.hasZ){const n=_o(e.spatialReference),s=_c(n);if(s==null)return null;const o=(l,h)=>!(h.length<2)&&(N(l,h[0],h[1],i&&h[2]||0),!0);let r=0;for(const l of e.rings){const h=l.length;if(h<3)continue;const{positionsWorldCoords:u}=t;for(;u.length{const h=Vn(e).mode,u=s[l].elevation;h==="relative-to-ground"||h==="relative-to-scene"||h==="on-the-ground"?u.lock(bo(e)):u.unlock()},r=l=>{if(t){const h=s[l].direction;h.committed=t.angle,h.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(i){case"polygon":case"polyline":o(i),r(i);break;case"point":case"mesh":o(i)}}function vf(e,t){const{drawOperation:i,view:n}=t,s=xo(t),o=Vn(t);if(n.type==="2d"||!e||o.mode!=="absolute-height"||i?.numCommittedVertices!==1||!s||s.type!=="draw-polyline"&&s.type!=="draw-polygon"||s.elevation.locked)return;const[r,l,h]=e,u=Vf(r,l,h,o,t);u!=null&&s.elevation.lock(u)}function hr(e){xo(e)?.allFields.forEach(t=>{t.unlockOnVertexPlacement&&t.unlock()})}function xo({geometryType:e,graphic:t,tooltipInfos:i}){return e==="multipoint"||t?.geometry?.type!==xf[e]?null:i[e]}const xf={point:"point",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon"};function bf(e,t){switch(e?.type){case"draw-point":wf(e,t);break;case"draw-polyline":Ef(e,t);break;case"draw-polygon":Sf(e,t);break;case"draw-rectangle":Mf(e,t);break;case"draw-circle":kf(e,t);break;case"draw-mesh":Tf(e,t)}}function wf(e,t){const i=t.graphic?.geometry;i?.type==="point"&&(el(e,i,t),e.helpMessage=io("point",i))}function Tf(e,t){const{graphic:i,view:n}=t,s=i?.geometry;n.type!=="3d"||s&&s.type!=="mesh"||(el(e,s?.origin,t),s&&Md(e,s),e.helpMessage=bu(i,n))}function el(e,t,i){const{drawOperation:n,view:s,sketchOptions:o}=i,{cursorVertex:r}=n;if(e.sketchOptions=o,e.viewType=s.type,e.setLocationFromPoint(t,ti(i)),nl(e.elevation,i),!r)return void(n.constraints=void 0);const l=r;n.constraints={context:al(l,i),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function Ef(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polyline"||(il(e,t),e.totalLength.actual=n.lastVertex?(s?yf(s):null)??Kt:null,e.helpMessage=io("polyline",s))}function Sf(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polygon"||(il(e,t),e.area.actual=n.lastVertex?(s?Ka(s):null)??Ye:null,e.helpMessage=io("polygon",s))}function il(e,t){const{drawOperation:i,sketchOptions:n,view:s}=t,{cursorVertex:o,lastVertex:r,secondToLastVertex:l}=i,h=n.values.effectiveDirectionMode;e.sketchOptions=n,e.viewType=s.type;const u=r&&o?Rn(r,o)??Kt:null;if(e.distance.actual=u,e.distance.readOnly=r==null,e.direction.actual=null,e.direction.readOnly=!0,r&&o&&(h==="absolute"||l)){const m=cp(l,r,o,h);e.direction.actual=m??th,e.direction.readOnly=!1}e.setLocationFromPoint(o,ti(t)),nl(e.elevation,t);const p=Pf(r,t);e.xyMode=p,e.direction.visible=p==="direction-distance",e.distance.visible=p==="direction-distance",e.effectiveX.visible=p==="coordinates",e.effectiveY.visible=p==="coordinates";const d=o??r;i.constraints=d?{context:al(d,t),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:e.distance.committed,direction:e.direction.committed}:void 0}function Pf(e,{sketchOptions:t}){const i=t.tooltips.xyMode;return i==="auto"?e?"direction-distance":"coordinates":i}function Mf(e,t){e.sketchOptions=t.sketchOptions,e.xSize=ol(t),e.ySize=rl(t),e.area=sl(t)}function kf(e,t){const{forceUniformSize:i,sketchOptions:n}=t;e.sketchOptions=n,e.radius=i?Cf(t):null,e.xSize=i?null:ol(t),e.ySize=i?null:rl(t),e.area=sl(t)}function nl(e,t){const{drawOperation:i}=t,n=i?.cursorVertex??i?.lastVertex;e.actual=rf(n)??bo(t),e.visible=i.hasZ,e.readOnly=!1,e.showAsZ=!0}function sl(e){const t=e.createOperationGeometry?.full;return t?.type!=="polygon"?Ye:Ka(t)??Ye}function ol(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.left,t.right):null)??Kt}function rl(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.top,t.bottom):null)??Kt}function Cf({createOperationGeometry:e}){return(e?.circle?.center!=null&&e.circle.edge!=null?Rn(e.circle.center,e.circle.edge):null)??Kt}function Rf(e){const{geometryType:t,tooltipInfos:i}=e;switch(t){case"point":case"mesh":case"polyline":case"polygon":{const n=i[t].elevation.committed;return n?_n(n,"meters")/Fs(ti(e)):void 0}default:return}}function Vf(e,t,i,n,s){const{view:o,drawOperation:r}=s;if(o.type!=="3d"||!r)return;i??=0;const l=ti(s),h=Vn(s),u=Nr(o,e,t,i,l,h,n);return Qa(u,l)??bo(s)}function Vn(e){return e.drawOperation.elevationInfo??gn}function ti(e){return e.drawOperation.coordinateHelper.spatialReference}function bo(e){const t=Fs(ti(e));return ft(e.defaultZ*t,"meters")}function al(e,t){return gp(e,t.view,ti(t),Vn(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}var Se;(function(e){e[e.WhenToolEditable=0]="WhenToolEditable",e[e.WhenToolNotEditable=1]="WhenToolNotEditable",e[e.Always=2]="Always"})(Se||(Se={}));let Af=class{constructor(){this._isToolEditable=!0,this._manipulators=new ss,this._resourceContexts={manipulator3D:{}},this._attached=!1}set isToolEditable(e){this._isToolEditable=e}get length(){return this._manipulators.length}add(e,t=Se.WhenToolEditable){this.addMany([e],t)}addMany(e,t=Se.WhenToolEditable){for(const i of e){const n={manipulator:i,visibilityPredicate:t,attached:!1};this._manipulators.add(n),this._attached&&this._updateManipulatorAttachment(n)}}remove(e){for(let t=0;t{this._detachManipulator(e)}),this._manipulators.removeAll()}attach(){this._manipulators.forEach(e=>{this._updateManipulatorAttachment(e)}),this._attached=!0}detach(){this._manipulators.forEach(e=>{this._detachManipulator(e)}),this._attached=!1}destroy(){this.detach(),this._manipulators.forEach(({manipulator:e})=>e.destroy()),this._manipulators.destroy(),this._resourceContexts=null}on(e,t){return this._manipulators.on(e,i=>{t(i)})}forEach(e){for(const t of this._manipulators.items)e(t)}some(e){return this._manipulators.items.some(e)}toArray(){const e=[];return this.forEach(t=>e.push(t.manipulator)),e}intersect(e,t){let i=null,n=Number.MAX_VALUE;return this._manipulators.forEach(({manipulator:s,attached:o})=>{if(!o||!s.interactive)return;const r=s.intersectionDistance(e,t);r!=null&&r{i.dragging&&(t=!0,i.events.emit("drag",{action:"end",start:e,screenPoint:e}))}),t&&(this.view.toolViewManager.activeTool=null)}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(e){}onInputEventAfter(e){}get internallyEditable(){return this.getEditableFlag(we.USER)&&this.getEditableFlag(we.MANAGER)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized){if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};a([c({constructOnly:!0})],B.prototype,"view",void 0),a([c({readOnly:!0})],B.prototype,"active",null),a([c({value:!0})],B.prototype,"visible",null),a([c({value:!0})],B.prototype,"editable",null),a([c({readOnly:!0})],B.prototype,"manipulators",void 0),a([c({readOnly:!0})],B.prototype,"updating",null),a([c()],B.prototype,"cursor",null),a([c({readOnly:!0})],B.prototype,"automaticManipulatorSelection",void 0),a([c()],B.prototype,"hasFocusedManipulators",null),a([c()],B.prototype,"hasGrabbedManipulators",void 0),a([c()],B.prototype,"hasHoveredManipulators",void 0),a([c()],B.prototype,"firstGrabbedManipulator",void 0),a([c({readOnly:!0})],B.prototype,"created",void 0),a([c({readOnly:!0})],B.prototype,"removeIncompleteOnCancel",void 0),B=a([x("esri.views.interactive.InteractiveToolBase")],B);let nn=class extends tt{constructor(e){super(e),this.enabled=!1}};a([c({type:Boolean,nonNullable:!0})],nn.prototype,"enabled",void 0),nn=a([x("esri.views.interactive.sketch.SketchLabelOptions")],nn);const An=nn;let mi=class extends tt{constructor(e){super(e),this.mode="absolute-height"}toJSON(){return{mode:this.mode}}};a([c({type:String,nonNullable:!0})],mi.prototype,"mode",void 0),mi=a([x("esri.views.interactive.sketch.SketchTooltipElevationOptions")],mi);let J=class extends tt{constructor(e){super(e),this.area=!0,this.coordinates=!0,this.direction=!0,this.distance=!0,this.elevation=!0,this.header=!0,this.helpMessage=!1,this.orientation=!0,this.radius=!0,this.rotation=!0,this.scale=!0,this.size=!0,this.totalLength=!0}};a([c({type:Boolean,nonNullable:!0})],J.prototype,"area",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"coordinates",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"direction",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"distance",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"elevation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"header",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"helpMessage",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"orientation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"radius",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"rotation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"scale",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"size",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"totalLength",void 0),J=a([x("esri.views.interactive.sketch.SketchTooltipVisibleElements")],J);const ll=J;let it=class extends tt{constructor(e){super(e),this.enabled=!1,this.forceEnabled=!1,this.helpMessage=null,this.helpMessageIcon=null,this.inputEnabled=!0,this.elevation=new mi,this.placement="auto",this.offset=null,this.visibleElements=new ll,this.visualVariables=null,this.xyMode="auto"}get effectiveEnabled(){return this.forceEnabled||this.enabled}};a([c({type:Boolean,nonNullable:!0})],it.prototype,"enabled",void 0),a([c()],it.prototype,"forceEnabled",void 0),a([c()],it.prototype,"effectiveEnabled",null),a([c()],it.prototype,"helpMessage",void 0),a([c()],it.prototype,"helpMessageIcon",void 0),a([c({type:Boolean,nonNullable:!0})],it.prototype,"inputEnabled",void 0),a([c({type:mi,nonNullable:!0})],it.prototype,"elevation",void 0),a([c()],it.prototype,"placement",void 0),a([c()],it.prototype,"offset",void 0),a([c({type:ll,nonNullable:!0})],it.prototype,"visibleElements",void 0),a([c()],it.prototype,"visualVariables",void 0),a([c()],it.prototype,"xyMode",void 0),it=a([x("esri.views.interactive.sketch.SketchTooltipOptions")],it);const cl=it;let Le=class extends tt{constructor(e){super(e),this.length=null,this.verticalLength=null,this.area=null}};a([c()],Le.prototype,"length",void 0),a([c()],Le.prototype,"verticalLength",void 0),a([c()],Le.prototype,"area",void 0),Le=a([x("esri.views.interactive.sketch.Units")],Le);const pn=Le;let ae=class extends tt{constructor(e){super(e),this.directionMode="relative",this.relativeDirectionIsBilateral=!1}get effectiveDirectionMode(){switch(this.directionMode){case"relative":return this.relativeDirectionIsBilateral?A.RelativeBilateral:A.Relative;case"absolute":return A.Absolute}}get displayUnits(){return this._get("displayUnits")??new pn}set displayUnits(e){this._set("displayUnits",e)}get inputUnits(){return this._get("inputUnits")??new pn}set inputUnits(e){this._set("inputUnits",e)}};a([c({type:String,nonNullable:!0})],ae.prototype,"directionMode",void 0),a([c({type:Boolean,nonNullable:!0})],ae.prototype,"relativeDirectionIsBilateral",void 0),a([c()],ae.prototype,"effectiveDirectionMode",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"displayUnits",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"inputUnits",null),ae=a([x("esri.views.interactive.sketch.SketchValueOptions")],ae);const hl=ae;let Ge=class extends tt{constructor(e){super(e),this.labels=new An,this.tooltips=new cl,this.values=new hl}};a([c({nonNullable:!0,type:An})],Ge.prototype,"labels",void 0),a([c({nonNullable:!0,type:cl})],Ge.prototype,"tooltips",void 0),a([c({nonNullable:!0,type:hl})],Ge.prototype,"values",void 0),Ge=a([x("esri.views.interactive.sketch.SketchOptions")],Ge);const ul=Ge;let P=class extends Ce.EventedMixin(B){constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new ul}initialize(){const{view:e}=this;this.internalGraphicsLayer=new Xs({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer);const t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=_f(e.type,this.sketchOptions);const i=Pd(()=>({view:e,options:this.sketchOptions.tooltips}));this.tooltip=i,cr(this._tooltipsContext),this._coordinateFormatterLoadTask=Ll(()=>ru()),this.addHandles([t.on("vertex-add",n=>this.onVertexAdd(n)),t.on("vertex-remove",n=>this.onVertexRemove(n)),t.on("vertex-update",n=>this.onVertexUpdate(n)),t.on("cursor-update",n=>this.onCursorUpdate(n)),t.on("cursor-remove",()=>this._updateGraphic()),t.on("complete",n=>this.onComplete(n)),this._coordinateFormatterLoadTask,i.on("paste",n=>Id(n,this.activeTooltipInfo)),$(()=>this.cursor,n=>{t.cursor=n},ke),Po(()=>{const{activeTooltipInfo:n,sketchOptions:s}=this;bf(n,this._tooltipsContext),i.info=s.tooltips.effectiveEnabled?n:null}),Po(()=>{t.constraintZ=Rf(this._tooltipsContext)},Us)]),this.finishToolCreation()}destroy(){this.drawOperation=dt(this.drawOperation),this.tooltip=dt(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=dt(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){return{createOperationGeometry:this._createOperationGeometry,defaultZ:this.defaultZ,directionOptions:this.directionOptions,drawOperation:this.drawOperation,forceUniformSize:this.forceUniformSize,geometryType:this.geometryType,graphic:this.graphic,sketchOptions:this.sketchOptions,tooltipInfos:this.tooltipInfos,view:this.view}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(e){this._set("cursor",e)}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){const t=this.drawOperation;t&&(t.drawingMode=e),this._set("mode",e)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:e,map:t}}=this;return e==="2d"&&t&&"undoRedo"in t&&t.undoRedo instanceof Ct?t.undoRedo:null}set undoRedo(e){this._override("undoRedo",e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||Ad(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&cr(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(mt.outline),this.removeHandles(mt.regularVertices),this.removeHandles(mt.activeVertex),this.removeHandles(mt.activeEdge),this.removeHandles(Jn)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;const t=new It({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange("graphic"),this.addHandles(W(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),Jn),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;const{coordinateHelper:t,view:i,visualizationCursorVertex:n,lastVertex:s,committedVertices:o,geometryIncludingUncommittedVertices:r,numCommittedVertices:l}=this.drawOperation;if(!(l>0||n!=null))return;const h=e.operationComplete?o:r,u=h.length,p=n!=null?t.pointToArray(n):null,d=this._drawSpatialReference,m=i.type==="3d"&&i.viewingMode==="global",f=new hu;f.committedVertices=o,f.cursorVertex=p;const{geometryType:_}=this;switch(_){case"point":case"mesh":f.full=t.arrayToPoint(h[0]);break;case"multipoint":f.full=u>0?gu(h,d):null;break;case"polyline":case"polygon":u>0&&(f.full=_==="polygon"?Oi([h],d,m,!0):Wo([h],d,m),f.cursorEdge=p!=null&&s&&!gi(n,s)?Wo([[p,t.pointToArray(s)]],d,m):null,f.outline=u>1?f.full:null);break;case"circle":case"rectangle":{if(f.committedVertices=f.cursorVertex=null,!u)break;const y=fu(i,h[0]),w=h[0],b=y.makeMapPoint(w[0]+If*i.resolution,w[1]);_==="circle"?u===1&&e.operationComplete?f.circle=Xo([w,b],y,!0):u===2&&(this.forceUniformSize?f.circle=Xo(h,y,this.centered):f.rectangle=yu(h,y,this.centered)):u===1&&e.operationComplete?f.rectangle=Yo([w,b],y,!0):u===2&&(f.rectangle=this.forceUniformSize?Yo(h,y,this.centered):mu(h,y,this.centered)),f.full=f.circle!=null?f.circle.geometry:f.rectangle?.geometry,f.outline=f.full?.type==="polygon"?f.full:null;break}default:return null}return f}initializeGraphic(e){return W()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const i=this._getCreateOperationGeometry({operationComplete:!0});i!=null&&(t=this._createOrUpdateGraphic(i.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){const{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return W()}onCursorEdgeChanged(e){return W()}onVertexAdd(e){hr(this._tooltipsContext),this._updateGraphic(),vf(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",e)}onVertexRemove(e){hr(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e!=null?(e.cursorEdge!=null?this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),mt.activeEdge):this.removeHandles(mt.activeEdge),e.outline!=null?this.addHandles(this.onOutlineChanged(e.outline),mt.outline):this.removeHandles(mt.outline),e.committedVertices!=null?this.addHandles(this.onRegularVerticesChanged(e.committedVertices),mt.regularVertices):this.removeHandles(mt.regularVertices),e.cursorVertex!=null?this.addHandles(this.onActiveVertexChanged(e.cursorVertex),mt.activeVertex):this.removeHandles(mt.activeVertex),e.full!=null?this._createOrUpdateGraphic(e.full):this.removeHandles(Jn)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?xo(this._tooltipsContext):null}};a([c()],P.prototype,"_coordinateFormatterLoadTask",void 0),a([c()],P.prototype,"_createOperationGeometry",void 0),a([c()],P.prototype,"_tooltipsContext",null),a([c({value:!0})],P.prototype,"centered",null),a([c()],P.prototype,"cursor",null),a([c({nonNullable:!0})],P.prototype,"defaultZ",void 0),a([c({constructOnly:!0})],P.prototype,"directionOptions",void 0),a([c()],P.prototype,"drawOperation",void 0),a([c({value:!0})],P.prototype,"enabled",null),a([c({value:!0})],P.prototype,"forceUniformSize",null),a([c({constructOnly:!0})],P.prototype,"geometryType",void 0),a([c()],P.prototype,"graphic",null),a([c({constructOnly:!0})],P.prototype,"graphicProperties",void 0),a([c()],P.prototype,"graphicSymbol",null),a([c({constructOnly:!0})],P.prototype,"hasZ",void 0),a([c({constructOnly:!0})],P.prototype,"geometryToPlace",void 0),a([c()],P.prototype,"mode",null),a([c()],P.prototype,"snappingManager",void 0),a([c()],P.prototype,"snapToScene",void 0),a([c()],P.prototype,"tooltip",void 0),a([c()],P.prototype,"tooltipInfos",void 0),a([c({constructOnly:!0,type:ul})],P.prototype,"sketchOptions",void 0),a([c()],P.prototype,"updating",null),a([c({constructOnly:!0,nonNullable:!0})],P.prototype,"view",void 0),a([c({constructOnly:!0})],P.prototype,"undoRedo",null),a([c()],P.prototype,"activeTooltipInfo",null),P=a([x("esri.views.draw.DrawGraphicTool")],P);const Jn=Symbol("create-operation-graphic"),mt={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function Of(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const If=48,pl="click";let Lf=class{constructor({consumesClicks:e,grabbableForEvent:t}){this.events=new Ce,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0,this.consumesClicks=e,this.grabbableForEvent=t}destroy(){}intersectionDistance(e,t){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}};var D;(function(e){e[e.Z=0]="Z",e[e.M=1]="M"})(D||(D={}));let Gf=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(G())}pointToVector(e){return this._tag(de(e.x,e.y))}arrayToVector(e){return this._tag(de(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return $r(n,e,t,i)}addDelta(e,t,i){e[0]+=t,e[1]+=i}distance(e,t){return Hr(e,t)}getZ(e,t=void 0){return t}hasZ(){return!1}getM(e,t=void 0){return t}hasM(){return!1}clone(e){return this._tag(Cc(e))}copy(e,t){return wc(t,e)}fromXYZ(e){return this._tag(de(e[0],e[1]))}toXYZ(e,t=g()){return N(t,e[0],e[1],0)}pointToXYZ(e,t=g()){return N(t,e.x,e.y,0)}equals(e,t){return Tc(e,t)}_tag(e){return e}};class ur{constructor(t,i){this._valueType=t,this.spatialReference=i}createVector(){return this._tag(g())}pointToVector(t){return this._tag(pe(t.x,t.y,this._valueType===D.Z?t.z:t.m))}arrayToVector(t){return this._tag(pe(t[0],t[1],t[2]||0))}vectorToArray(t){return[t[0],t[1],t[2]]}pointToArray(t){return this._valueType===D.Z?[t.x,t.y,t.z]:[t.x,t.y,t.m]}vectorToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}arrayToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}vectorToDehydratedPoint(t,i){if(!t)return;i??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const n=this._valueType===D.Z,s=this._valueType===D.M;return i.x=t[0],i.y=t[1],i.z=n?t[2]:void 0,i.m=s?t[2]:void 0,i.hasZ=n,i.hasM=s,i.spatialReference=this.spatialReference,i}lerp(t,i,n,s){return Pe(s,t,i,n)}addDelta(t,i,n,s){t[0]+=i,t[1]+=n,this._valueType===D.Z&&(t[2]+=s)}distance(t,i){return this._valueType===D.Z?ge(t,i):Hr(t,i)}getZ(t,i=void 0){return this._valueType===D.Z?t[2]:i}hasZ(){return this._valueType===D.Z}getM(t,i=void 0){return this._valueType===D.M?t[2]:i}hasM(){return this._valueType===D.M}clone(t){return this._tag(lc(t))}copy(t,i){return rt(i,t)}fromXYZ(t,i=0,n=0){return this._tag(pe(t[0],t[1],this._valueType===D.Z?t.length>2?t[2]:i:n))}toXYZ(t,i=g()){return N(i,t[0],t[1],this._valueType===D.Z?t[2]:0)}pointToXYZ(t,i=g()){return N(i,t.x,t.y,this._valueType===D.Z?t.z??0:0)}equals(t,i){return We(t,i)}_tag(t){return t}}let Df=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(jr())}pointToVector(e){return this._tag(Hn(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Hn(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return yh(n,e,t,i)}addDelta(e,t,i,n){e[0]+=t,e[1]+=i,e[2]+=n}distance(e,t){return ge(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(xh(e))}copy(e,t){return _h(t,e)}fromXYZ(e,t=0,i=0){return this._tag(Hn(e[0],e[1],e.length>2?e[2]:t,i))}toXYZ(e,t=g()){return N(t,e[0],e[1],e[2])}pointToXYZ(e,t=g()){return N(t,e.x,e.y,e.z??0)}equals(e,t){return vh(e,t)}_tag(e){return e}};function dl(e,t,i){return e&&t?new Df(i):t?new ur(D.M,i):e?new ur(D.Z,i):new Gf(i)}function zf(e,t){if(!t.supported)return;let i=1/0,n=-1/0;const s=t.upperBoundX-t.lowerBoundX;e.forEach(r=>{let l=r.pos[0];for(;lt.upperBoundX;)l-=s;i=Math.min(i,l),n=Math.max(n,l),r.pos[0]=l});const o=n-i;s-o{r.pos[0]<0&&(r.pos[0]+=s)})}function Uf(e,t){const i=Ur(e);return t===Ti.Global&&i?{supported:!0,lowerBoundX:i.valid[0],upperBoundX:i.valid[1]}:{supported:!1,lowerBoundX:null,upperBoundX:null}}let Gi=class{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}};class Jt{constructor(t,i,n){this.component=t,this.leftVertex=i,this.rightVertex=n,this.type="edge",i.rightEdge=this,n.leftEdge=this}}class On{constructor(t,i){this._spatialReference=t,this._viewingMode=i,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||zf(this.vertices,Uf(this._spatialReference,this._viewingMode))}updateVertexIndex(t,i){if(this.vertices.length===0)return;const n=this.vertices[0];let s=null,o=t,r=i;do s=o,s.index=r++,o=s.rightEdge?s.rightEdge.rightVertex:null;while(o!=null&&o!==n);s.leftEdge&&s!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(s),this.vertices.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return this.vertices.length>2&&this.vertices[0].leftEdge!==null}swapVertices(t,i){const n=this.vertices[t];this.vertices[t]=this.vertices[i],this.vertices[i]=n}iterateVertices(t){if(this.vertices.length===0)return;const i=this.vertices[0];let n=i;do t(n,n.index),n=n.rightEdge!=null?n.rightEdge.rightVertex:null;while(n!==i&&n!=null)}}let dn=class fl extends Ce{constructor(t,i){super(),this.type=t,this.coordinateHelper=i,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:Hh(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.components)for(const i of t.vertices)yield i}notifyChanges(t){this._dirty=!0,this.emit("change",t)}_toPoint(){return this.components.length===0||this.components[0].vertices.length===0?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[];let o=n.vertices.find(l=>l.leftEdge==null);const r=o;do s.push(i(o.pos)),o=o.rightEdge?o.rightEdge.rightVertex:null;while(o&&o!==r);t.push(s)}return new fi({paths:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[],o=n.vertices[0];let r=o;const l=r;do s.push(i(r.pos)),r=r.rightEdge!=null?r.rightEdge.rightVertex:null;while(r&&r!==l);n.isClosed()&&s.push(i(o.pos)),t.push(s)}return new De({rings:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,i){const n=t.spatialReference,s=dl(t.hasZ,t.hasM,n),o=new fl(t.type,s);switch(t.type){case"polygon":$f(o,t,i);break;case"polyline":Hf(o,t,i);break;case"point":pr(o,t,i);break;case"mesh":pr(o,t.origin,i),o._geometry=t,o._dirty=!1}return o}};function $f(e,t,i){const n=t.spatialReference,s=e.coordinateHelper,o=t.rings;for(let r=0;r2&&Fe(l[0],l[l.length-1]),p=u?l.length-1:l.length;for(let m=0;mthis.operation.apply(t)),this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(t=>this.operation.undo(t)),this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices}),this._undone=!0}canAccumulate(t){if(this._undone||t._vertices.length!==this._vertices.length)return!1;for(let i=0;ithis.operation.accumulate(i,t.operation)),this.operation.accumulateParams(t.operation),this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0)}};var nt;(function(e){e[e.CUMULATIVE=0]="CUMULATIVE",e[e.REPLACE=1]="REPLACE"})(nt||(nt={}));let Ff=class{constructor(e,t,i=0){this._editGeometry=e,this._vertices=t,this._minNumberOfVertices=i,this.removedVertices=null}apply(){let e="redo";if(this.removedVertices==null){const t=this.removedVertices=[];this._vertices.forEach(i=>{const n=this._removeVertex(i);n!=null&&t.push(n)}),e="apply"}else this.removedVertices.forEach(t=>{this._removeVertex(t.removedVertex)});this._editGeometry.notifyChanges({operation:e,removedVertices:this._vertices})}undo(){this.removedVertices?.forEach(e=>{this._undoRemoveVertex(e)}),this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(e){const t=e.component;if(t.vertices.length<=this._minNumberOfVertices)return null;const i={removedVertex:e,createdEdge:null},n=e.leftEdge,s=e.rightEdge;return t.vertices.splice(t.vertices.indexOf(e),1),n&&(t.edges.splice(t.edges.indexOf(n),1),n.leftVertex.rightEdge=null),s&&(t.edges.splice(t.edges.indexOf(s),1),s.rightVertex.leftEdge=null),e.index===0&&s&&this._vertices.length>0&&t.swapVertices(t.vertices.indexOf(s.rightVertex),0),n&&s&&(i.createdEdge=new Jt(t,n.leftVertex,s.rightVertex),t.edges.push(i.createdEdge)),s&&t.updateVertexIndex(s.rightVertex,s.rightVertex.index-1),i}_undoRemoveVertex(e){const t=e.removedVertex,i=e.removedVertex.component,n=t.leftEdge,s=t.rightEdge;e.createdEdge&&i.edges.splice(i.edges.indexOf(e.createdEdge),1),i.vertices.push(t),n&&(i.edges.push(n),n.leftVertex.rightEdge=n),s&&(i.edges.push(s),s.rightVertex.leftEdge=s),i.updateVertexIndex(t,t.index)}},Zf=class{constructor(e,t,i){this._editGeometry=e,this._edge=t,this._t=i,this.createdVertex=null,this._left=null,this._right=null}apply(){let e="redo";const t=this._edge,i=t.component,n=t.leftVertex,s=t.rightVertex;i.edges.splice(i.edges.indexOf(t),1),this.createdVertex==null&&(e="apply",this.createdVertex=new Gi(t.component)),i.vertices.push(this.createdVertex),this.createdVertex.pos=this._editGeometry.coordinateHelper.lerp(t.leftVertex.pos,t.rightVertex.pos,this._t,this._editGeometry.coordinateHelper.createVector()),this._left==null&&(this._left=new Jt(i,n,this.createdVertex)),this._left.leftVertex.leftEdge?i.edges.push(this._left):i.edges.unshift(this._left),n.rightEdge=this._left,this._right==null&&(this._right=new Jt(i,this.createdVertex,s)),i.edges.push(this._right),s.leftEdge=this._right,i.updateVertexIndex(this.createdVertex,n.index+1),this._editGeometry.notifyChanges({operation:e,addedVertices:[this.createdVertex]})}undo(){if(this.createdVertex==null||this._left==null||this._right==null)return null;const e=this._edge,t=e.component,i=this.createdVertex.leftEdge,n=this.createdVertex.rightEdge,s=i?.leftVertex,o=n?.rightVertex;t.vertices.splice(t.vertices.indexOf(this.createdVertex),1),t.edges.splice(t.edges.indexOf(this._left),1),t.edges.splice(t.edges.indexOf(this._right),1),this._edge.leftVertex.leftEdge?t.edges.push(this._edge):t.edges.unshift(this._edge),s&&(s.rightEdge=e),o&&(o.leftEdge=e),s&&t.updateVertexIndex(s,s.index),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this.createdVertex]})}accumulate(){return!1}},Bf=class yl{constructor(t,i,n){this._editGeometry=t,this._vertex=i,this._pos=n}apply(){const t=this._originalPosition==null;t&&(this._originalPosition=this._vertex.pos),this._apply(t?"apply":"redo")}undo(){this._vertex.pos=this._originalPosition,this._editGeometry.notifyChanges({operation:"undo",updatedVertices:[this._vertex]})}accumulate(t){return t instanceof yl&&t._vertex===this._vertex&&(this._pos=t._pos,this._apply("apply"),!0)}_apply(t){this._vertex.pos=this._pos,this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:[this._vertex]})}},Wf=class{constructor(e,t){this._editGeometry=e,this._component=t,this._createdEdge=null}apply(){let e="redo";if(this._createdEdge==null){e="apply";const t=this._component.getFirstVertex(),i=this._component.getLastVertex();if(this._component.isClosed()||this._component.vertices.length<3||t==null||i==null)return;this._createdEdge=new Jt(this._component,i,t)}this._createdEdge.leftVertex.rightEdge=this._createdEdge,this._createdEdge.rightVertex.leftEdge=this._createdEdge,this._component.edges.push(this._createdEdge),this._editGeometry.notifyChanges({operation:e})}undo(){this._createdEdge!=null&&(Dr(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}},dr=class _l{constructor(t,i,n,s){this._editGeometry=t,this.dx=i,this.dy=n,this.dz=s,this._firstTime=!0}apply(){const t=this._firstTime?"apply":"redo";this._firstTime=!1,this._apply(t,this.dx,this.dy,this.dz)}undo(){this._apply("undo",-this.dx,-this.dy,-this.dz)}accumulate(t){const i=this._editGeometry.geometry;return t instanceof _l&&t._editGeometry.geometry===i&&(this._apply("apply",t.dx,t.dy,t.dz),this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz,!0)}_apply(t,i,n,s){const o=this._editGeometry.geometry;o.offset(i,n,s);const r=this._editGeometry.components[0].getFirstVertex();if(!r)return;const l=this._editGeometry.coordinateHelper;r.pos=l.pointToVector(o.origin),this._editGeometry.notifyChanges({operation:t,updatedVertices:[r]})}},vl=class xl{constructor(t,i,n,s){this._helper=t,this.dx=i,this.dy=n,this.dz=s}_move(t,i,n,s){this._helper.addDelta(t.pos,i,n,s)}apply(t){this._move(t,this.dx,this.dy,this.dz)}undo(t){this._move(t,-this.dx,-this.dy,-this.dz)}canAccumulate(t){return t instanceof xl}accumulate(t,i){this._move(t,i.dx,i.dy,i.dz)}accumulateParams(t){this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz}},Yf=class Ls{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,n,s=0,o=yi.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=n,this.distance=s,this._plane=at(),this._offsetPlane=at(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,o===yi.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),n=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=Do(g(),t,n),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(n,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(n,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return t!=null?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,n,s){const o=g();if(i){Do(o,t,i);const r=!this._passesBisectingAngleThreshold(o,n);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(n,o):o,isOriginalDirection:!r}}return this._helper.hasZ()?s&&(Ot(o,n,s.direction),Ot(o,o,n),le(o,o),Math.sign(o[1])!==Math.sign(n[0])&&fe(o,o,-1)):N(o,-n[1],n[0],0),{start:t,end:i,direction:o,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const n=Math.abs(wh(i,t));return n>=fr&&n<=Math.PI-fr}_bisectVectorsPerpendicular(t,i){const n=Z(t,i)<0?t:rs(g(),t),s=Math.abs(Z(n,i));if(!(s1-gr))return this._bisectDirection(n,i);const o=Ot(g(),n,[0,0,1]);return le(o,o)}_bisectDirection(t,i){const n=ut(g(),t,i);return le(n,n)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);Z(t,i)<0&&rs(i,i),Ri(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=Ot(g(),t.direction,this._edgeDirection);le(i,i);const n=Ot(g(),this._edgeDirection,i);return this._planeType===Gs.XY&&(n[2]=0),le(n,n)}_initializeDistanceConstraints(){this._left.end==null||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(Ae(this._plane,this._left.end)),this._right.end==null||this.requiresSplitEdgeRight||this._updateDistanceConstraint(Ae(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=Ue(t),n=this._edgeDirection,s=ut(g(),this._left.start,this._left.direction),o=ut(g(),this._right.start,this._right.direction),r=this._pointInBasis2D(G(),i,n,this._left.start),l=this._pointInBasis2D(G(),i,n,s),h=this._pointInBasis2D(G(),i,n,this._right.start),u=this._pointInBasis2D(G(),i,n,o),[p]=Su({start:l,end:r,type:O.LINE},{start:u,end:h,type:O.LINE});if(!p)return;const d=q(G(),r,l);Ws(d,d);const m=q(G(),p,l),f=_e(d,m),_=ut(g(),s,fe(g(),this._left.direction,-f)),y=Ae(t,_);this._updateDistanceConstraint(y)}_pointInBasis2D(t,i,n,s){return t[0]=Ho(i,s),t[1]=Ho(n,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),Nn(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const n=(o,r,l)=>r!=null&&js(this._offsetPlane,o,ut(g(),o,r),l),s=g();(t===this._edge.leftVertex?n(this._left.start,this._left.direction,s):n(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=Kr(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return Ae(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(t){const i=this._helper.toXYZ(this._helper.pointToVector(t)),n=Ks(this._plane,i,g()),s=Ae(this._plane,i),o=cc(s,this._minDistance,this._maxDistance);return Pe(i,n,i,o/s),{start:n,end:i}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Ls&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&We(Ue(this._plane),Ue(t._plane))}accumulate(t,i){const n=this._plane[3]-i._plane[3]+i.distance;this._offset(t,n)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Ls(this._helper,this._planeType,this._edge,this.distance,yi.DEFERRED);return Nn(t._plane,this._plane),Nn(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=rt(g(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return t==null&&i==null||t!=null&&i!=null&&We(t,i)}_cloneNeighbor({start:t,end:i,direction:n,isOriginalDirection:s}){return{start:rt(g(),t),end:i!=null?rt(g(),i):null,direction:rt(g(),n),isOriginalDirection:s}}};const fr=Ir(15),gr=.001;var Gs,yi;(function(e){e[e.XYZ=0]="XYZ",e[e.XY=1]="XY"})(Gs||(Gs={})),function(e){e[e.IMMEDIATE=0]="IMMEDIATE",e[e.DEFERRED=1]="DEFERRED"}(yi||(yi={}));let bl=class wl{constructor(t,i,n=nt.CUMULATIVE){this.origin=t,this.angle=i,this._accumulationType=n}_rotate(t,i){Ec(t.pos,t.pos,this.origin,i)}apply(t){this._rotate(t,this.angle)}undo(t){this._rotate(t,-this.angle)}canAccumulate(t){return t instanceof wl&&Fe(this.origin,t.origin)}accumulate(t,i){const n=i._accumulationType===nt.REPLACE;this._rotate(t,n?i.angle-this.angle:i.angle)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.angle=i?t.angle:this.angle+t.angle}};class In{constructor(t,i,n,s,o=nt.CUMULATIVE){this.origin=t,this.axis1=i,this.factor1=n,this.factor2=s,this._accumulationType=o,this.axis2=de(i[1],-i[0])}_scale(t,i,n){on(t.pos,t.pos,this.origin,this.axis1,i),on(t.pos,t.pos,this.origin,this.axis2,n)}apply(t){this._scale(t,this.factor1,this.factor2)}undo(t){this._scale(t,1/this.factor1,1/this.factor2)}canAccumulate(t){return t instanceof In&&Fe(this.origin,t.origin)&&Fe(this.axis1,t.axis1)}accumulate(t,i){i._accumulationType===nt.REPLACE?this._scale(t,i.factor1/this.factor1,i.factor2/this.factor2):this._scale(t,i.factor1,i.factor2)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.factor1=i?t.factor1:this.factor1*t.factor1,this.factor2=i?t.factor2:this.factor2*t.factor2}}let Xf=class Tl{constructor(t,i){this._editGeometry=t,this._newPositions=i}apply(){const t=this._originalPositions==null?"apply":"redo";if(!this._originalPositions){const i=this._editGeometry.coordinateHelper;this._originalPositions=this._editGeometry.allVertices.map(n=>i.clone(n.pos))}this._apply(t,this._newPositions)}undo(){this._originalPositions&&this._apply("undo",this._originalPositions)}accumulate(t){return t instanceof Tl&&(this._newPositions=t._newPositions,this._apply("apply",this._newPositions),!0)}_apply(t,i){const n=this._editGeometry.coordinateHelper,s=this._editGeometry.allVertices;for(let o=0;oo.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:s})}};var El;const qf=Symbol();let jf=class{constructor(e){this._operations=[],this._closed=!1,this[El]=!0,e&&(this._operations=e,this._closed=!0)}close(){this._closed=!0}apply(){for(const e of this._operations)e.apply()}undo(){for(let e=this._operations.length-1;e>=0;e--)this._operations[e].undo()}accumulate(e){if(this._closed)return!1;const t=this._operations.length?this._operations[this._operations.length-1]:null;return t&&t.accumulate(e)||(this._operations.push(e),e.apply()),!0}};El=qf;let wo=class Sl extends Ce{constructor(t,i){super(),this.data=t,this.viewingMode=i,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",n=>{n.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:n.addedVertices,operation:n.operation}),n.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:n.removedVertices,operation:n.operation}),n.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:n.updatedVertices,operation:n.operation})})}destroy(){this._listener.remove()}splitEdge(t,i){return this._apply(new Zf(this.data,t,i))}updateVertices(t,i,n=L.ACCUMULATE_STEPS){return this._apply(new gl(this.data,t,i),n)}move(t,i,n,s=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,t,i,n),s):this.moveVertices(this.data.allVertices,t,i,n,s)}moveVertices(t,i,n,s,o=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,i,n,s),o):this.updateVertices(t,new vl(this.data.coordinateHelper,i,n,s),o)}scale(t,i,n,s,o=L.ACCUMULATE_STEPS,r=nt.CUMULATIVE){return this.scaleVertices(this.data.allVertices,t,i,n,s,o,r)}scaleVertices(t,i,n,s,o,r=L.ACCUMULATE_STEPS,l=nt.CUMULATIVE){return this.updateVertices(t,new In(i,n,s,o,l),r)}rotate(t,i,n=L.ACCUMULATE_STEPS,s=nt.CUMULATIVE){return this.rotateVertices(this.data.allVertices,t,i,n,s)}rotateVertices(t,i,n,s=L.ACCUMULATE_STEPS,o=nt.CUMULATIVE){return this.updateVertices(t,new bl(i,n,o),s)}removeVertices(t){return this._apply(new Ff(this.data,t,this._minNumVerticesPerType))}appendVertex(t){return this.data.components.length===0?null:this._apply(new Nf(this.data,this.data.components[0],t))}setVertexPosition(t,i){return this._apply(new Bf(this.data,t,i))}offsetEdge(t,i,n,s=L.ACCUMULATE_STEPS){return this.updateVertices([i.leftVertex,i.rightVertex],new Yf(this.data.coordinateHelper,t,i,n),s)}trySetGeometry(t,i=L.ACCUMULATE_STEPS){const{data:n}=this,{coordinateHelper:s}=n;if(n.type!==t.type||!n.spatialReference.equals(t.spatialReference)||s.hasZ()!==t.hasZ||s.hasM()!==t.hasM||!Ql(n.geometry,t)||ri(n))return;const o=Array.from(dn.fromGeometry(t,this.viewingMode).iterateVertices(),r=>r.pos);return this.setVertexPositions(o,i)}setVertexPositions(t,i=L.ACCUMULATE_STEPS){return this._apply(new Xf(this.data,t),i)}createResetState(){if(ri(this.data))return this._createResetStateMesh();const t=this.data.geometry.clone();return W(()=>this.trySetGeometry(t))}closeComponent(t){return this.data.components.includes(t)?this._apply(new Wf(this.data,t)):null}canRemoveVertex(t){return t.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const t=new jf;return this._apply(t),W(()=>t.close())}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();return t.undo(),this._redoStack.push(t),t}return null}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();return t.apply(),this._undoStack.push(t),t}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(t,i=L.ACCUMULATE_STEPS){return i!==L.NEW_STEP&&this.lastOperation!=null&&this.lastOperation.accumulate(t)||(t.apply(),this._undoStack.push(t),this._redoStack=[]),t}_createResetStateMesh(){if(!ri(this.data))return W();const t=this.data.geometry,{vertexSpace:i}=t;if(i.origin){const s=ye(i.origin);return W(()=>{t.vertexSpace.origin=s})}const n=t.vertexAttributes.clonePositional();return W(()=>{t.vertexAttributes=n,t.vertexAttributesChanged()})}static fromGeometry(t,i){return new Sl(dn.fromGeometry(t,i),i)}};function Kf(e,t){let i=null,n=null;return s=>{if(s.action==="cancel")return void(n!=null&&(n.execute({action:"cancel"}),i=null,n=null));const o={action:s.action,screenStart:s.start,screenEnd:s.screenPoint};s.action==="start"&&i==null&&(i=new Pi,n=new Pi,t(e,i,n,s.pointerType,o)),i?.execute(o),s.action==="end"&&i!=null&&(i=null,n=null)}}function He(e,t){return e.events.on("drag",Kf(e,t))}function To(e,t=null,i){let n=null;const s=t==null||e.spatialReference?.equals(t)?r=>r:r=>r!=null?Xe(r,t):r,o={exclude:[],...i};return r=>{if(r.action==="start"&&(n=s(e.toMap(r.screenStart,o))),n==null)return null;const l=s(e.toMap(r.screenEnd,o));return l!=null?{...r,mapStart:n,mapEnd:l}:null}}const Qf=()=>{};let Pi=class Pl{constructor(){this.execute=Qf}next(t,i=new Pl){return t!=null&&(this.execute=n=>{const s=t(n);s!=null&&i.execute(s)}),i}};function Jf(e,t,i=[]){if(e.type==="2d")return s=>s;let n=null;return s=>{s.action==="start"&&(n=e.toMap(s.screenStart,{exclude:i}),n!=null&&(n.z=Lo(n,e,t)));const o=e.toMap(s.screenEnd,{exclude:i});o!=null&&(o.z=Lo(o,e,t));const r=n!=null&&o!=null?{sceneStart:n,sceneEnd:o}:null;return{...s,scenePoints:r}}}let Ds=class{constructor(e){this.vertexHandle=null,this.excludeFeature=null,this.visualizer=null,this.selfSnappingZ=null,this.drawConstraints=null,this.editGeometryOperations=e.editGeometryOperations,this.elevationInfo=e.elevationInfo,this.pointer=e.pointer,this.vertexHandle=e.vertexHandle,this.excludeFeature=e.excludeFeature,this.feature=e.feature,this.visualizer=e.visualizer,this.selfSnappingZ=e.selfSnappingZ,this.drawConstraints=e.drawConstraints}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}};function tg({predicate:e=()=>!0,snappingManager:t,snappingContext:i,updatingHandles:n,useZ:s=!0}){const o=new Pi;if(t==null)return{snappingStep:[mr,o],cancelSnapping:mr};let r,l=null,h=null,u=null;const p=()=>{l=os(l),t.doneSnapping(),h?.frameTask.remove(),h=null,r=Ar(r),u=null},d=eg(t,s,o);let m=null,f=null,_=null;return{snappingStep:[y=>{if(!e(y))return y;const{action:w}=y;if(w==="start"){const{info:b}=y,S=ig(t.view);if(h=ng(i,y,S),h.context.selfSnappingZ=null,!s&&b!=null){const I=og(i.coordinateHelper,b.handle.component);I!=null&&(h.context.selfSnappingZ={value:I,elevationInfo:i.elevationInfo??gn})}}if(h!=null){const{context:b,originalScenePos:S,originalPos:I}=h,{mapEnd:K,mapStart:et,scenePoints:Y}=y,gt=Ml(I,zs(K,et)),lt=zs(et,I),ei={...y,action:"update"},zt=h.context,ie=sg(S,Y),be=t.update({point:gt,scenePoint:ie,context:b});if(_=be,kl(K,be,lt,s),m=gt,f=ie,w!=="end"){const{frameTask:Ln}=h;l==null&&(l=new AbortController),u=Ol=>{n.addPromise(ns(d({frameTask:Ln,event:ei,context:zt,point:gt,scenePoint:ie,delta:lt,getLastState:()=>({point:m,scenePoint:f,updatePoint:Ol.forceUpdate?null:_})},l.signal)))},u({forceUpdate:!1}),r==null&&(r=$(()=>t.options.effectiveEnabled,()=>u?.({forceUpdate:!0})))}}return w==="end"&&p(),y},o],cancelSnapping:y=>(p(),y)}}function eg(e,t,i){return Vr(async({frameTask:n,point:s,scenePoint:o,context:r,event:l,delta:h,getLastState:u},p)=>{const d=await n.schedule(()=>e.snap({point:s,scenePoint:o,context:r,signal:p}),p);if(d.valid){let m=await n.schedule(()=>d.apply(),p);const f=u();f.point!=null&&s!==f.point&&(m=e.update({point:f.point,scenePoint:f.scenePoint,context:r})),f.updatePoint!=null&&gi(m,f.updatePoint)||(kl(l.mapEnd,m,h,t),i.execute(l))}})}function ig(e){return e.type==="3d"?e.resourceController.scheduler.registerTask(ia.SNAPPING):na}function ng(e,t,i){return{context:new Ds({editGeometryOperations:e.editGeometryOperations,elevationInfo:e.elevationInfo,pointer:e.pointer,vertexHandle:t.info!=null?t.info.handle:null,excludeFeature:e.excludeFeature,feature:e.feature,visualizer:e.visualizer}),originalPos:t.snapOrigin!=null?e.coordinateHelper.vectorToDehydratedPoint(t.snapOrigin):t.mapStart,originalScenePos:t.scenePoints!=null?t.scenePoints.sceneStart:null,frameTask:i}}function Ml(e,[t,i,n]){const s=sa(e);return s.x+=t,s.y+=i,s.hasZ&&(s.z+=n),s}function sg(e,t){return e==null||t==null?null:Ml(e,zs(t.sceneEnd,t.sceneStart))}function zs(e,t){const i=e.hasZ&&t.hasZ?e.z-t.z:0;return[e.x-t.x,e.y-t.y,i]}function kl(e,t,[i,n,s],o){e.x=t.x+i,e.y=t.y+n,o&&e.hasZ&&t.hasZ&&(e.z=t.z+s)}function og(e,t){if(!e.hasZ())return null;const i=t.vertices;let n=null;for(const s of i){const o=e.getZ(s.pos);if(n!=null&&o!=null&&Math.abs(o-n)>1e-6)return null;n==null&&(n=o)}return n}function mr(e){return e}let Te=class extends tt{constructor(e){super(e),this.constrainResult=t=>t,this._snapPoints=null,this._frameTask=null,this._abortController=null,this._stagedPoint=null,this._snap=Vr(async(t,i,n,s)=>{const o=this._frameTask;if(o==null)return;const r=await o.schedule(()=>i.snap({...t,context:n,signal:s}),s);r.valid&&await o.schedule(()=>{this.stagedPoint=r.apply(),t!==this._snapPoints&&this._snapPoints!=null&&(this.stagedPoint=i.update({...this._snapPoints,context:n}))},s)})}get stagedPoint(){return this._stagedPoint}set stagedPoint(e){this._stagedPoint=this.constrainResult(e)}initialize(){const e=this.view.type==="3d"?this.view?.resourceController?.scheduler:null;this._frameTask=e!=null?e.registerTask(ia.SNAPPING):na}destroy(){this._abortController=os(this._abortController),this._frameTask=Ar(this._frameTask)}update(e,t,i){this._snapPoints=e;const{point:n,scenePoint:s}=e,o=t.update({point:n,scenePoint:s,context:i});return this.stagedPoint=o,o}async snap(e,t,i){const{point:n,scenePoint:s}=e;return this.stagedPoint=t.update({point:n,scenePoint:s,context:i}),this._snapPoints=e,this._abortController==null&&(this._abortController=new AbortController),this._snap(e,t,i,this._abortController.signal)}async snapAgainNearPreviousMapPoint(e,t){this._snapPoints!=null&&await this.snap(this._snapPoints,e,t)}abort(){this._abortController=os(this._abortController),this._snapPoints=null}};a([c({constructOnly:!0})],Te.prototype,"view",void 0),a([c()],Te.prototype,"stagedPoint",null),a([c()],Te.prototype,"constrainResult",void 0),a([c()],Te.prototype,"_stagedPoint",void 0),Te=a([x("esri.views.interactive.snapping.SnappingOperation")],Te);var yr;(function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(yr||(yr={}));const _r=Symbol("snapping-toggle");function rg(e,t=()=>{}){const i=$(()=>({view:e.view,snappingOptions:e.snappingOptions}),({view:n,snappingOptions:s})=>{if(e.removeHandles(_r),!n||!s)return;const o=Xr.TOOL,r=[n.on("key-down",l=>{l.key!==ir.toggle||l.repeat||(s.enabledToggled=!0,t())},o),n.on("key-up",l=>{l.key===ir.toggle&&(s.enabledToggled=!1,t())},o),n.on("pointer-move",l=>{const h=l.native.ctrlKey;s.enabledToggled!==h&&(s.enabledToggled=h,t())},o)];e.addHandles(r,_r)},ke);e.addHandles(i)}const ag="crosshair",lg="progress",vr=Symbol(),xr=Symbol();let T=class extends Ce.EventedMixin(tt){constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new Jc,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new Zr,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=ys(vp),this._getPolylineOrPolygonConstraint=ys(xp),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new An,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo==null&&(this.elevationInfo=Lc(!!e.hasZ))}initialize(){const{geometryType:e,view:t}=this,i=t.spatialReference,n="viewingMode"in t.state?t.state.viewingMode:Ti.Local,s=e==="segment"||e==="multipoint"?"polyline":e;this.coordinateHelper=dl(this.hasZ,this.hasM,i),this._editGeometryOperations=new wo(new dn(s,this.coordinateHelper),n),this._snappingOperation=new Te({view:t}),this.addHandles([$(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:l,constraint:h},u)=>{const{snappingOptions:p}=this;if(p&&(p.forceDisabled=h!=null&&vt(h)),u!=null&&l===u.stagedPoint&&h!==u.constraint)return this._onKeyboardBasedChange();this._processCursor(l??this._screenToMap(this._stagedScreenPoint))},{equals:(l,h)=>l.stagedPoint===h.stagedPoint&&Gl(l.constraint,h.constraint)}),$(()=>this.view.viewpoint,(l,h)=>{l&&h&&Uh(l,h)&&this._onKeyboardBasedChange()})]),this._activeComponent=new On(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const o=this.segmentLabels;o!=null&&(o.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles($(()=>this.labelOptions.enabled,l=>{o.visible=l},ke))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],l=>{const h=l.vertices.map(f=>({componentIndex:0,vertexIndex:f.index,coordinates:this.coordinateHelper.vectorToArray(f.pos)})),u=h.map(f=>f.coordinates),p=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;gi(p,this.firstVertex)||(this.firstVertex=p);const d=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;gi(d,this.lastVertex)||(this.lastVertex=d);const m=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;switch(gi(m,this.secondToLastVertex)||(this.secondToLastVertex=m),this._processCursor(this.cursorVertex),l.type){case"vertex-add":this.emit(l.type,{...l,added:u,vertices:h});break;case"vertex-update":this.emit(l.type,{...l,updated:u,vertices:h});break;case"vertex-remove":this.emit(l.type,{...l,removed:u,vertices:h})}}));const r=this._manipulator=new Lf({consumesClicks:!1,grabbableForEvent:l=>this.drawingMode!=="click"||l.pointerType==="touch"&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(r),r.grabbable=e!=="point",this.addHandles([r.events.on("immediate-click",l=>this._onImmediateClick(l)),r.events.on("immediate-double-click",l=>this._onImmediateDoubleClick(l)),$(()=>this.drawingMode,()=>{this.removeHandles(vr),this.addHandles(this._createManipulatorDragPipeline(r),vr)},ke),$(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:l})=>{r.cursor=l},ke)]),rg(this,()=>{const l=this.view.inputManager.latestPointerType??"mouse",h=this._getSnappingContext(l);if(this.snappingManager!=null){const u=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,h);this._updatingHandles.addPromise(ns(u))}})}destroy(){dt(this.segmentLabels),dt(this._snappingOperation),this._editGeometryOperations=dt(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const e=this._updateAndGetEffectiveDrawSurface();return this.view.type==="3d"&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){const{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case"point":return this._getPointConstraint(e);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set("drawingMode",e??pl)}get effectiveCursor(){return this.loading?lg:this._hideDefaultCursor?null:this.cursor||ag}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return this.snappingManager!=null?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return this._stagedPointerType==="mouse"?this.cursorVertex:null}get committableVertex(){const{cursorVertex:e,lastVertex:t,firstVertex:i,geometryType:n}=this;return n==="polygon"&&Fn(e,i)||Fn(e,t)?null:e}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:e,committableVertex:t,coordinateHelper:i}=this,n=e.slice();return t!=null&&n.push(i.pointToArray(t)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e))}complete(e){const t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,s=i==="multipoint"&&n===0||i==="polyline"&&n<2||i==="polygon"&&n<3;i!=="segment"&&i!=="point"||this.commitStagedVertex(),this._createOperationCompleted=!s,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((o,r)=>({componentIndex:0,vertexIndex:r,coordinates:o})),aborted:t,type:"complete"}))}onInputEvent(e){switch(e.type){case"pointer-down":this._pointerDownStates.add(e.pointerId);break;case"pointer-up":this._pointerDownStates.delete(e.pointerId)}switch(e.type){case"pointer-move":return this._onPointerMove(e);case"hold":return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){const t=is(this.cursorVertex),i=is(e),n=i&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(i)??i),s=this._snapToClosingVertex(n),o=this._applyConstraints(s);Fn(t,o)||(this._set("cursorVertex",o),this.segmentLabels?.set("stagedVertex",o!=null?this.coordinateHelper.pointToVector(o):null),o==null||this._stagedPointerType!=="mouse"?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!=="polygon"||this.numCommittedVertices<=2)return e;const t=this._mapToScreen(e);if(!t)return e;const i=this._activeComponent;return this._vertexWithinPointerDistance(i.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(e);case"freehand":return this._createManipulatorDragPipelineFreehand(e);case"hybrid":return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return He(e,(t,i,n,s)=>{const o=s==="touch"&&this._snappingEnabled;if(this.isCompleted||!o)return;const{snappingStep:r,cancelSnapping:l}=tg({predicate:()=>o,snappingManager:this.snappingManager,snappingContext:new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:s,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n=n.next(h=>(o&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),h)).next(l),i.next(this._screenToMapDragEventStep()).next(h=>(h.action==="start"&&(this._processCursor(h.mapStart),(this.geometryType==="segment"||o&&!this.numCommittedVertices)&&this.commitStagedVertex()),h)).next(Jf(this.view,this.elevationInfo)).next(...r).next(h=>(o&&(this._processCursor(h.mapEnd),h.action==="end"&&this.commitStagedVertex()),h)).next(h=>(h.action==="end"&&(this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()),h))})}_createManipulatorDragPipelineFreehand(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.committableVertex==null&&this._processCursor(n.mapStart),this.geometryType==="segment"&&this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this.complete()}return n})})}_createManipulatorDragPipelineHybrid(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),xr),this._processCursor(n.mapStart),this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.removeHandles(xr),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()}return n})})}get _drawAtFixedElevation(){const{constraintsEnabled:e,constraintZ:t,geometryType:i,numCommittedVertices:n}=this;return e?t!=null||i==="segment"&&n>0:(i==="segment"||i==="polygon")&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:e,coordinateHelper:t,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:s}=this;if(n==null)return i;if(!this.hasZ)return n.defaultZ=null,n;const o=this.elevationInfo?.mode;let r=this.defaultZ,l=e||o==="absolute-height";return s!=null&&(l=s),o==="on-the-ground"&&(l=!1),this._drawAtFixedElevation&&(r=(e?this.constraintZ:null)??t.getZ(this._activeComponent.vertices[0].pos),l=!1),l?i:(n.defaultZ=r,n)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode==="click"&&e.pointerType==="touch"&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType==="mouse"&&e.button===2||this._manipulator.dragging))try{const{drawingMode:t,geometryType:i}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;const n=this._screenToMap(e.screenPoint);if(n==null||n==null||t==="freehand"&&i!=="point")return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(n),this.committableVertex==null)return void this.complete();this.commitStagedVertex(),e.pointerType!=="mouse"&&this._processCursor(null),(t==="freehand"||i==="point"||i==="segment"&&this.numCommittedVertices===2||i==="segment"&&t==="hybrid"&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType==="point"||(this.complete(),e.stopPropagation())}_onPointerMove(e){const t=$s(e.x,e.y);this._stagedScreenPoint=t,this._stagedPointerType=e.pointerType,this._stagedPointerId=e.pointerId,this._isDragging?this._snappingOperation.abort():(e.stopPropagation(),this._processCursorMovementRelativeToSurface(t,e.pointerType))}_onKeyboardBasedChange(){this._stagedPointerType==="mouse"&&this._stagedScreenPoint&&this._stagedPointerId!=null&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(e,t){const i=this._snappingOperation,n=this._screenToMap(e),s=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(n==null)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const o=this.snappingManager;if(o==null)return this._processCursor(n),void i.abort();const r=this._getSnappingContext(t);this._updatingHandles.addPromise(ns(i.snap({point:n,scenePoint:s},o,r)))}_applyConstraints(e){const{_constraint:t,constraints:i}=this;if(!e||!i||!t)return e;const{context:n}=i,s=Sn(e,n),o=s?t.closestTo(s):void 0;if(!o)return e;const r=wp(o,e,n),l=this.view.type==="2d"||n.elevationInfo.mode!=="absolute-height";return r!=null&&l&&this.constraintZ!=null&&this.hasZ&&(r.z=this.constraintZ),r}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action==="start"&&(e=this._screenToMap(t.screenStart)),e==null)return null;const i=this._screenToMap(t.screenEnd);return i!=null?{...t,mapStart:e,mapEnd:i}:null}}_vertexWithinPointerDistance(e,t){const i=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return i!=null&&cg(i,t,25)}_getSnappingContext(e){const t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t!=null?{value:t,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function cg(e,t,i){const n=e.x-t.x,s=e.y-t.y;return n*n+s*s<=i}a([c()],T.prototype,"_hideDefaultCursor",void 0),a([c()],T.prototype,"_stagedPointerId",void 0),a([c()],T.prototype,"_isDragging",null),a([c()],T.prototype,"_snappingOperation",void 0),a([c()],T.prototype,"_snappingEnabled",null),a([c({constructOnly:!0})],T.prototype,"graphic",void 0),a([c()],T.prototype,"constraintsEnabled",void 0),a([c()],T.prototype,"constraints",void 0),a([c()],T.prototype,"_constraint",null),a([c()],T.prototype,"constraintZ",void 0),a([c()],T.prototype,"defaultZ",void 0),a([c()],T.prototype,"isDraped",void 0),a([c({value:pl})],T.prototype,"drawingMode",null),a([c({constructOnly:!0})],T.prototype,"elevationDrawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"elevationInfo",void 0),a([c({constructOnly:!0,type:An})],T.prototype,"labelOptions",void 0),a([c({constructOnly:!0})],T.prototype,"geometryType",void 0),a([c({constructOnly:!0})],T.prototype,"hasM",void 0),a([c({constructOnly:!0})],T.prototype,"hasZ",void 0),a([c()],T.prototype,"cursor",void 0),a([c()],T.prototype,"effectiveCursor",null),a([c()],T.prototype,"loading",void 0),a([c({constructOnly:!0})],T.prototype,"manipulators",void 0),a([c({constructOnly:!0})],T.prototype,"drawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"segmentLabels",void 0),a([c({constructOnly:!0})],T.prototype,"snappingManager",void 0),a([c({constructOnly:!0})],T.prototype,"snappingVisualizer",void 0),a([c()],T.prototype,"snapToSceneEnabled",void 0),a([c({readOnly:!0})],T.prototype,"cursorVertex",null),a([c({readOnly:!0})],T.prototype,"visualizationCursorVertex",null),a([c()],T.prototype,"committableVertex",null),a([c()],T.prototype,"firstVertex",void 0),a([c()],T.prototype,"lastVertex",void 0),a([c()],T.prototype,"secondToLastVertex",void 0),a([c()],T.prototype,"updating",null),a([c({constructOnly:!0})],T.prototype,"view",void 0),T=a([x("esri.views.draw.DrawOperation")],T);let hg=class{constructor(e,t=!1,i=0){this.view=e,this.hasZ=t,this.defaultZ=i,this.mapToScreen=n=>e.toScreen(n),this.screenToMap=t?n=>{const s=e.toMap(n);return s.z=i,s}:n=>e.toMap(n)}constrainZ(e){const{defaultZ:t}=this;return this.hasZ&&e.z!==t&&((e=sa(e)).z=t),e}};new ue;let ai=class extends P{constructor(e){super(e),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??iu,regularVertices:e.regularVerticesSymbol??nu,activeVertex:e.activeVertexSymbol??su,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles($(()=>this.view?.effectiveTheme?.accentColor,t=>{if(!t)return;const i=this._visualElementSymbols.activeVertex.clone().set({color:t});this._visualElementGraphics.activeVertex?.set("symbol",i),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:i}},es))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return this._visualElementSymbols.fill!=null&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(ji),W()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:i}=this;return this._createOrUpdateGraphic(null),new T({view:i,manipulators:this.manipulators,geometryType:Of(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new hg(i,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new tu(this.internalGraphicsLayer),graphic:this.graphic,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){if(this.geometryType==="point")return W();const[t,i]=e,n=new C({x:t,y:i,spatialReference:this.view.spatialReference});return this._visualElementGraphics.activeVertex!=null?(this._visualElementGraphics.activeVertex.geometry=n,W()):(this._visualElementGraphics.activeVertex=new It({geometry:n,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(ji),W(()=>{this._visualElementGraphics.activeVertex!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=dt(this._visualElementGraphics.activeVertex))}))}onCursorEdgeChanged(e){return this._visualElementGraphics.activeEdge!=null?(this._visualElementGraphics.activeEdge.geometry=e,W()):(this._visualElementGraphics.activeEdge=new It({geometry:e,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeEdge),this.internalGraphicsLayer.graphics.sort(ji),W(()=>{this._visualElementGraphics.activeEdge!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeEdge),this._visualElementGraphics.activeEdge=dt(this._visualElementGraphics.activeEdge))}))}onRegularVerticesChanged(e){const t=new Mr({points:e,spatialReference:this.view.spatialReference});return this._visualElementGraphics.regularVertices!=null?(this._visualElementGraphics.regularVertices.geometry=t,W()):(this._visualElementGraphics.regularVertices=new It({geometry:t,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(ji),W(()=>{this._visualElementGraphics.regularVertices!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=dt(this._visualElementGraphics.regularVertices))}))}};function ji(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}a([c()],ai.prototype,"activeFillSymbol",void 0),a([c({readOnly:!0})],ai.prototype,"type",void 0),a([c({constructOnly:!0,nonNullable:!0})],ai.prototype,"view",void 0),ai=a([x("esri.views.2d.interactive.editingTools.draw.DrawGraphicTool2D")],ai);let Eo=class{get hovering(){return this.someManipulator(e=>e.hovering)}get grabbing(){return this.someManipulator(e=>e.grabbing)}get dragging(){return this.someManipulator(e=>e.dragging)}hasManipulator(e){return this.someManipulator(t=>t===e)}someManipulator(e){let t=!1;return this.forEachManipulator(i=>{!t&&e(i)&&(t=!0)}),t}};var Mi;(function(e){e[e.TRANSLATE_XY=0]="TRANSLATE_XY",e[e.SCALE=1]="SCALE",e[e.ROTATE=2]="ROTATE"})(Mi||(Mi={}));function Cl(e){let t=0,i=0,n=0;return e?(e.type==="cim"&&e.data.symbol&&"symbolLayers"in e.data.symbol&&e.data.symbol.symbolLayers&&e.data.symbol.symbolLayers.map(s=>{s.type==="CIMVectorMarker"&&s.anchorPoint&&(Math.abs(s.anchorPoint.x)>t&&(t=s.anchorPoint.x),Math.abs(s.anchorPoint.y)>i&&(i=s.anchorPoint.y),s.size!=null&&s.size>n&&(n=s.size))}),t=ze(t),i=ze(i),n=ze(n),{offsetX:t,offsetY:i,size:n}):{offsetX:t,offsetY:i,size:n}}let X=class extends tt{set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const{layer:e}=this.graphic,t=e&&"elevationInfo"in e?e.elevationInfo:null,i=Gc(this.graphic),n=t?t.offset:0;return new Nh({mode:i,offset:n})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new Ce.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const t=this.graphic;if(t.visible===!1)return null;const i=t.geometry;if(i==null)return null;const n=this._get("focusedSymbol"),s=n??t.symbol;return this.view.type==="2d"?this._intersectDistance2D(this.view,e,i,s):this._intersectDistance3D(this.view,e,t)}attach(){this.attachSymbolChanged(),this.layer!=null&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this.layer!=null&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=$(()=>this.graphic?.symbol,e=>{e!=null&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&this.focusedSymbol!=null&&(this.graphic.symbol=this.focusedSymbol))},Us)}detachSymbolChanged(){this._graphicSymbolChangedHandle!=null&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&this.focusedSymbol!=null?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,t,i,n){if((n=n||Jl(i))==null)return null;const s=1;let o=this._circleCollisionCache;if(i.type==="point"&&n.type==="cim"&&n.data.symbol?.type==="CIMPointSymbol"&&n.data.symbol.symbolLayers){const{offsetX:r,offsetY:l,size:h}=Cl(n),u=Co(t,wr),p=h/2,d=e.toScreen(i),m=d.x+r,f=d.y+l;return sn(u,[m,f])this._tool.manipulators.add(t))}destroy(){this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._graphic=null}forEachManipulator(e){e(this._manipulator,Mi.TRANSLATE_XY)}createDragPipeline(e,t){let i=null,n=null,s=0,o=0,r=0;const{offsetX:l,offsetY:h,size:u}=Cl(this._graphic.symbol);return He(this._manipulator,(p,d)=>{d.next(m=>{if(m.action==="start"){const f=e();i=f.editGeometryOperations,n=f.constraints}return m}).next(To(this._view)).next(m=>{const{x:f,y:_,z:y}=m.mapEnd;if(n&&(f+ln.xmax||_+h-u>n.ymax))return m;(m.action==="start"||s===0&&o===0&&r===0)&&(s=m.mapStart.x,o=m.mapStart.y,r=m.mapStart.z);const w=f-s,b=_-o,S=y-r;s=f,o=_,r=y;const I=m.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,K=i.move(w,b,S,I);return t(m,K),m})})}_createManipulator(){const e=this._view,t=this._graphic;return new X({view:e,graphic:t,selectable:!0,cursor:"move"})}};const Ut={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:Yr},ug=1,pg=10,Tr=new _i("#009af2");let Bt=class extends B{constructor(e){super(e),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0,this.type="reshape"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._controlPointManipulations.forEach(t=>t.destroy()),this._controlPointEditGeometryOperations.forEach(t=>t.destroy()),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return Ns(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const e=this._undoStack[this._undoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canUndo}canRedo(){const e=this._redoStack[this._redoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canRedo}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();this._controlPointEditGeometryOperations[e].undo(),this.updateGraphics(),this._redoStack.push(e)}}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();this._controlPointEditGeometryOperations[e].redo(),this.updateGraphics(),this._undoStack.push(e)}}refresh(){const{mediaElement:e}=this;if(e.georeference==null)return;const t=e.georeference;t.type==="control-points"&&t.coords!=null&&(this._georeference=t,this._georeference.controlPoints.forEach(({mapPoint:i},n)=>{const s=this._controlPointEditGeometryOperations[n],o=s.data.components[0].vertices[0];s.setVertexPosition(o,s.data.coordinateHelper.pointToVector(i))}),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._georeference,t=e.controlPoints,i=t[0].mapPoint.spatialReference,n=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map((s,o)=>{const r=s.data.geometry;return this._controlPointGraphics[o].geometry=r,{mapPoint:Xe(r,i),sourcePoint:n?t[o].sourcePoint:e.toSource(r)}})}updateActiveHandle(e){if(this.activeHandle===e)return;const t=this._controlPointGraphics[this.activeHandle].symbol.clone();No(t,this.view.effectiveTheme.accentColor),this._controlPointGraphics[this.activeHandle].symbol=t;const i=this._controlPointGraphics[e].symbol.clone();No(i,Tr),this._controlPointGraphics[e].symbol=i,this.activeHandle=e,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const e=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=e.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,mediaElement:t}=this;if(t.georeference==null)return;const i=t.georeference;i.type==="control-points"&&i.coords!=null&&(this._georeference=i,this._initialControlPoints=this._georeference.controlPoints,e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map(({mapPoint:n})=>wo.fromGeometry(Xe(n,e.spatialReference),Ti.Local)),this._controlPointGraphics=this._controlPointEditGeometryOperations.map((n,s)=>new It({symbol:new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:s===this.activeHandle?Tr.toArray():this.view.effectiveTheme.accentColor.toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:n.data.geometry})),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map(n=>new Rl({tool:this,view:e,graphic:n})),this.addHandles([...this._controlPointManipulations.map((n,s)=>n.createDragPipeline(this._getInfo.bind(this,s),(o,r)=>{o.action==="start"&&(this._undoStack.push(s),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0),this.updateGraphics()})),$(()=>this.view.scale,()=>this.active?this.updateGraphics():null)]),this._controlPointManipulations.forEach((n,s)=>{const o=r=>{this.addHandles([r.events.on(["click","grab-changed"],l=>this.updateActiveHandle(s))])};n.forEachManipulator(o)}),this.addHandles([e.on("key-down",n=>{e.activeTool===this&&(n.key!==Ut.shift||n.repeat||(this._isModifierActive=!0,n.stopPropagation()),n.key!==Ut.toggleOpacity||n.repeat||(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,n.stopPropagation()),n.key!==Ut.primaryKey||n.repeat||(this._factor=pg,n.stopPropagation()),this._isModifierActive&&(n.key===Ut.up&&(this._move(0,this._factor),n.stopPropagation()),n.key===Ut.down&&(this._move(0,-this._factor),n.stopPropagation()),n.key===Ut.left&&(this._move(-this._factor,0),n.stopPropagation()),n.key===Ut.right&&(this._move(this._factor,0),n.stopPropagation())))}),e.on("key-up",n=>{e.activeTool===this&&(n.key===Ut.shift&&(this._isModifierActive=!1,n.stopPropagation()),n.key===Ut.primaryKey&&(this._factor=ug,n.stopPropagation()))})]))}async _loadProjectionEngine(){const e=this._georeference.controlPoints[0].mapPoint;return ea(e.spatialReference,this.view.spatialReference)}_getInfo(e){return{editGeometryOperations:this._controlPointEditGeometryOperations[e],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(e,t){const i=this._controlPointEditGeometryOperations[this.activeHandle].move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],Bt.prototype,"_hasValidSpatialReference",null),a([c()],Bt.prototype,"activeHandle",void 0),a([c({constructOnly:!0,nonNullable:!0})],Bt.prototype,"mediaElement",void 0),a([c({readOnly:!0})],Bt.prototype,"type",void 0),a([c({constructOnly:!0})],Bt.prototype,"view",void 0),Bt=a([x("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],Bt);function Vl(e,t){e.action==="start"?t.cursor="grabbing":t.cursor="grab"}class dg{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null){const i={...this._lastDragEvent,action:"update"};t&&this._adjustScaleFactors(i),this.next.execute(i)}this._enabled=t}createDragEventPipelineStep(){return this._lastDragEvent=null,t=>(this._lastDragEvent=t.action!=="end"?{...t}:null,this._enabled&&this._adjustScaleFactors(t),t)}_adjustScaleFactors(t){const i=t.direction[0]!==0&&t.direction[1]!==0?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):t.direction[0]===0?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-i:i,t.factor2=t.factor2<0?-i:i}}let fg=class{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&this._lastDragEvent!=null){const t={...this._lastDragEvent,action:"update"};e&&this._adjustRotateAngle(t),this.next.execute(t)}this._enabled=e}createDragEventPipelineStep(){return this._lastDragEvent=null,e=>(this._lastDragEvent=e.action!=="end"?{...e}:null,this._enabled&&this._adjustRotateAngle(e),e)}_adjustRotateAngle(e){const t=Or(e.rotateAngle);e.rotateAngle=Ir(5*Math.round(t/5))}};function gg(e,t,i,n=!1){const s=Math.atan2(t.y-i.y,t.x-i.x)-Math.atan2(e.y-i.y,e.x-i.x),o=Math.atan2(Math.sin(s),Math.cos(s));return n?o:Or(o)}function Al(e,t){return mg(e,t,!1)}function mg(e,t,i){if(e instanceof gl){if(e.operation instanceof vl)return yg(e.operation,t,i),!0;if(e.operation instanceof bl)return _g(e.operation,t,i),!0;if(e.operation instanceof In)return vg(e.operation,t,i),!0}return!1}function yg(e,t,i=!1){const n=i?-1:1,s=pe(n*e.dx,n*e.dy,n*e.dz);ut(t.origin,t.origin,s),xn(t)}function _g(e,t,i=!1){const n=i?-e.angle:e.angle;zo(t.basis1,t.basis1,Ao,n),zo(t.basis2,t.basis2,Ao,n),xn(t)}function vg(e,t,i=!1){const n=i?1/e.factor1:e.factor1,s=i?1/e.factor2:e.factor2;fe(t.basis1,t.basis1,n),fe(t.basis2,t.basis2,s),on(t.origin,t.origin,e.origin,e.axis1,n),on(t.origin,t.origin,e.origin,e.axis2,s),xn(t)}function xg(e,t,i,n){n||(n=Ei());const s=Wt(ii.get(),e[1],-e[0]),o=Wt(ii.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=Wt(ii.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l=ii.get();t.components.forEach(p=>p.vertices.forEach(({pos:d})=>{Wt(l,_e(e,d),_e(s,d)),xc(o,o,l),bc(r,r,l)}));const h=1e-6,u=Wt(ii.get(),r[0]-o[0]Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._snapRotation=null,this._graphic=null,this._handles=null,this._originCache=null}forEachManipulator(t){t(this._manipulator,Mi.ROTATE)}createDragPipeline(t,i){let n=null,s=null;return He(this._manipulator,(o,r)=>{r.next(l=>{if(l.action==="start"){o.cursor="grabbing";const h=t();n=h.plane,s=h.editGeometryOperations}return l}).next(To(this._view)).next(l=>({...l,rotateAngle:gg(l.mapStart,l.mapEnd,{x:n.origin[0],y:n.origin[1]},!0)})).next(this._snapRotation.createDragEventPipelineStep(),this._snapRotation.next).next(l=>{const h=rt(this._originCache,n.origin),u=l.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,p=s.rotate(h,l.rotateAngle,u,nt.REPLACE);return Al(p,n),i(l,p),l}).next(l=>(l.action==="end"&&(o.cursor="grab"),l))})}_createManipulator(){const t=this._view,i=this._graphic;return new X({view:t,graphic:i,selectable:!0,cursor:"grab"})}}const ts=10,Er=1e-6,wg=.3;function Sr(e){const t=xi(e.basis1),i=xi(e.basis2);return wg*Math.min(t,i)}class Tg extends Eo{constructor(t){super(),this._handles=new Lr,this._planeStart=Ei(),this._displayPlaneStart=Ei(),this._originCache=g(),this._axisCache=G(),this._renderStartCache=g(),this._renderEndCache=g(),this._resizeOriginCache=g(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._direction=t.direction,this._preserveAspectRatio=t.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",i=>Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,Mi.SCALE)}createDragPipeline(t,i){let n=null,s=null,o=null,r=0,l=null,h=null;const u=this._planeStart,p=this._displayPlaneStart,d=this._direction;return He(this._manipulator,(m,f)=>{f.next(_=>{if(_.action==="start"){m.cursor="grabbing";const y=t();n=y.plane,s=y.displayPlane,o=y.editGeometryOperations,r=ts*this._view.resolution,Qi(n,u),Qi(s,p);const w=Ur(o.data.spatialReference);l=w?w.valid[1]-w.valid[0]-3*ts*this._view.resolution:null}return _}).next(To(this._view)).next(_=>{const y=rt(this._renderStartCache,[_.mapStart.x,_.mapStart.y,0]),w=rt(this._renderEndCache,[_.mapEnd.x,_.mapEnd.y,0]),b=rt(this._resizeOriginCache,p.origin);z(b,b,p.basis1,-d[0]),z(b,b,p.basis2,-d[1]),Et(w,w,b),Et(y,y,b);const S=d[0]!==0&&d[1]!==0,I=Sr(p),K=Sr(s)/I,et=(lt,ei)=>{if(lt===0)return 1;let zt=xi(ei),ie=.5*lt*Z(ei,w)/zt;const be=ie<0?-1:1;S&&(ie+=(zt-.5*lt*Z(ei,y)/zt)*be*K);const Ln=zt<1.5*r?1:Er;return zt=Math.max(zt-r,Er),be>0&&(ie-=ts*this._view.resolution),be*Math.max(be*(ie/zt),Ln)},Y=et(d[0],p.basis1),gt=et(d[1],p.basis2);return{..._,direction:d,factor1:Y,factor2:gt}}).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(_=>{const y=rt(this._originCache,u.origin);z(y,y,u.basis1,-d[0]),z(y,y,u.basis2,-d[1]);const w=Wt(this._axisCache,u.basis1[0],u.basis1[1]);Ws(w,w);const b=o.data.allVertices,S=_.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,I=o.scaleVertices(b,y,w,_.factor1,_.factor2,S,nt.REPLACE);return l&&l(_.action==="end"&&(m.cursor="grab"),_))})}_createManipulator(){return new X({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}function Eg(e){return e?.type==="graphic"}function Sg(e){return e.find(Eg)??null}const Pg=80,Mg=10,kg=30,Cg=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Pr=1,Rg=10;let _t=class extends B{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=Ei(),this._displayPlaneCache=Ei(),this._mainAxisCache=G(),this._rotationHandleCache=g(),this._cornerA=g(),this._cornerB=g(),this._cornerC=g(),this._cornerD=g(),this._avgAB=g(),this._avgBC=g(),this._avgCD=g(),this._avgDA=g(),this._preserveAspectRatio=new dg,this._snapRotation=new fg,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=Pr,this.preserveAspectRatio=null,this.snapRotation=null,this.type="transform"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(t=>t.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(e==null)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],n=q(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);Ws(n,n);let s=Pg*this.view.resolution;const o=this.view.spatialReference;return Qe(o,e.spatialReference)&&(s*=vi(o)/vi(e.spatialReference)),xg(n,t,s,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;Qi(e,t);const i=Mg*this.view.resolution;return fe(t.basis1,t.basis1,1+i/xi(t.basis1)),fe(t.basis2,t.basis2,1+i/xi(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new De({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return le(t,e.basis1),fe(t,t,kg*this.view.resolution),ut(t,t,e.origin),ut(t,t,e.basis1),new C({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:n,_cornerC:s,_cornerD:o}=this,r=Pe(this._avgAB,i,n,.5),l=Pe(this._avgBC,n,s,.5),h=Pe(this._avgCD,s,o,.5),u=Pe(this._avgDA,o,i,.5);return[new C({x:i[0],y:i[1],spatialReference:t}),new C({x:n[0],y:n[1],spatialReference:t}),new C({x:s[0],y:s[1],spatialReference:t}),new C({x:o[0],y:o[1],spatialReference:t}),new C({x:r[0],y:r[1],spatialReference:t}),new C({x:l[0],y:l[1],spatialReference:t}),new C({x:h[0],y:h[1],spatialReference:t}),new C({x:u[0],y:u[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,n=this._editGeometryOperations,s=n.data.components[0].vertices,o=dn.fromGeometry(Xe(i,e.spatialReference),Ti.Local).components[0].vertices;s.forEach((r,l)=>{n.setVertexPosition(r,o[l].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;t.type==="control-points"&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;"georeference"in this.target&&(this.target.georeference.coords=e),this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((t,i)=>{this._scaleGraphics[i].geometry=t})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:t}=this;if("georeference"in t){const s=t.georeference;this._graphic=new It({geometry:s.coords}),this._initialControlPoints=s.type==="control-points"?s.controlPoints:null}else this._graphic=t,this._initialGeometry=t.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=wo.fromGeometry(Xe(this._graphic.geometry,e.spatialReference),Ti.Local),this._backgroundGraphic=new It({symbol:new Dl({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new It({symbol:new Ne({color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(s=>new It({symbol:new Ne({size:6,style:"square",color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new Rl({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new bg({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((s,o)=>new Tg({tool:this,view:e,graphic:s,direction:Cg[o],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(s=>s.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),$(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async s=>{if(e.activeTool!=null&&e.activeTool!==this)return;const o=Xc(s),r=[];e.map.allLayers.forEach(u=>{u.type!=="vector-tile"&&u.type!=="imagery"||r.push(u)});const l=await this.view.hitTest(o,{exclude:r}),h=l.results;if(h.length===0)e.activeTool=null;else{const u=Sg(l.results),p="georeference"in t,d=h.map(f=>f.type==="media"?f.element:null).filter(Boolean),m=new Set([...this._graphicsLayer.graphics,p?null:t].filter(Boolean));p&&d.includes(t)||u!=null&&m.has(u.graphic)?e.activeTool==null&&(e.activeTool=this):e.activeTool=null}})]);const i=s=>{this.addHandles(s.events.on("grab-changed",o=>{"georeference"in t&&(o.action==="start"?t.opacity*=.5:o.action==="end"&&(t.opacity*=2))}))};this._dragManipulation.forEachManipulator(i),this._rotateManipulation.forEachManipulator(i),this._scaleManipulations.forEach(s=>s.forEachManipulator(i));const n=new Mp;n.addToggle(kt.preserveAspectRatio,()=>{this.preserveAspectRatio==null&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)}),n.addToggle(kt.rotateIncrements,()=>{this.snapRotation==null&&(this._snapRotation.enabled=!this._snapRotation.enabled)}),n.add(kt.toggleOpacity,()=>{"georeference"in t&&(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),n.addToggle(kt.factorModifier,s=>this._factor=s.type==="key-down"?Rg:Pr),n.add(kt.scaleUp,()=>this._scale(this._factor)),n.add(kt.scaleDown,()=>this._scale(-this._factor)),n.add(kt.moveUp,()=>this._move(0,this._factor)),n.add(kt.moveDown,()=>this._move(0,-this._factor)),n.add(kt.moveLeft,()=>this._move(-this._factor,0)),n.add(kt.moveRight,()=>this._move(this._factor,0)),this.addHandles([e.on("key-down",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)}),e.on("key-up",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return ea(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:n}=e,s=this._cornerA;ut(s,n,t),ut(s,s,i);const o=this._cornerB;ut(o,n,t),Et(o,o,i);const r=this._cornerC;Et(r,n,t),Et(r,r,i);const l=this._cornerD;Et(l,n,t),ut(l,l,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){e.action==="start"&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,n=(i+e*this.view.resolution)/i,s=t.scale(this._plane.origin,kc,n,n,L.NEW_STEP,nt.REPLACE);this._sharedUndoStack.push({tool:this,operation:s}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],_t.prototype,"_plane",null),a([c()],_t.prototype,"_backgroundGraphicGeometry",null),a([c()],_t.prototype,"_rotateGraphicGeometry",null),a([c()],_t.prototype,"_scaleGraphicGeometries",null),a([c()],_t.prototype,"preserveAspectRatio",void 0),a([c()],_t.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],_t.prototype,"target",void 0),a([c({readOnly:!0})],_t.prototype,"type",void 0),a([c({constructOnly:!0})],_t.prototype,"view",void 0),_t=a([x("esri.views.2d.interactive.editingTools.TransformTool")],_t);const Ki={redo:"r",undo:"z"};let ne=class extends tt{constructor(e){super(e),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:e,mediaElement:t,preserveAspectRatio:i,snapRotation:n,advancedMode:s}=this;this._originalOpacity=t.opacity,this._transformTool=new _t({target:t,view:e,preserveAspectRatio:i,snapRotation:n}),this._controlPointsTransformTool=new Bt({mediaElement:t,view:e}),this._advancedModeTransformTool=new Bt({mediaElement:s.mediaElement,view:s.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const o=t.georeference,r=s.mediaElement.georeference;s.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in r&&"controlPoints"in o&&this.addHandles([s.view.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),s.view.on("focus",async l=>{this._controlPointsTransformTool.removeHighlightActiveHandle(),this._advancedModeTransformTool.highlightActiveHandle()}),$(()=>r.controlPoints,l=>{o.controlPoints=l.map(({sourcePoint:h},u)=>({sourcePoint:h,mapPoint:o.controlPoints[u].mapPoint})),this._activeTool?.refresh()}),$(()=>this._controlPointsTransformTool.activeHandle,l=>{this._advancedModeTransformTool.updateActiveHandle(l),this.activeHandle=l}),$(()=>this._advancedModeTransformTool.activeHandle,l=>{this._controlPointsTransformTool.updateActiveHandle(l),this.activeHandle=l})]),this.addHandles([e.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),e.on("focus",async l=>{this._advancedModeTransformTool.removeHighlightActiveHandle(),this._controlPointsTransformTool.highlightActiveHandle()})]),e.tools.addMany([this._transformTool,this._controlPointsTransformTool]),e.activeTool=this._transformTool,this._activeTool=this._transformTool,e.focus()}destroy(){this._transformTool?.destroy(),this._controlPointsTransformTool?.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){if(this._sharedUndoStack.length>0){const{tool:e,operation:t}=this._sharedUndoStack.pop();e!==this._activeTool&&e.refresh(),t.undo(),e.updateGraphics(),this._sharedRedoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}redo(){if(this._sharedRedoStack.length>0){const{tool:e,operation:t}=this._sharedRedoStack.pop();e!==this._activeTool&&e.refresh(),t.apply(),e.updateGraphics(),this._sharedUndoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._originalOpacity=this._controlPointsTransformTool.mediaElement.opacity,this._controlPointsTransformTool.mediaElement.opacity=.25*this._originalOpacity}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=this._originalOpacity}};a([c()],ne.prototype,"activeHandle",void 0),a([c({constructOnly:!0})],ne.prototype,"advancedMode",void 0),a([c()],ne.prototype,"preserveAspectRatio",void 0),a([c()],ne.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],ne.prototype,"mediaElement",void 0),a([c({constructOnly:!0})],ne.prototype,"view",void 0),ne=a([x("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],ne);export{Bt as ControlPointsTransformTool,ai as DrawGraphicTool2D,ne as MediaTransformToolsWrapper,_t as TransformTool}; diff --git a/main/assets/editingTools-BZ3yVmXf-DYT2ioOm.js b/main/assets/editingTools-BZ3yVmXf-DYT2ioOm.js new file mode 100644 index 000000000..129f44b2a --- /dev/null +++ b/main/assets/editingTools-BZ3yVmXf-DYT2ioOm.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-CW2FD2Xf.js","./themeUtils-YjM7iIiX-J3djxNmP.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-2CDQhr1H.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-D_Gwwuwg.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-YgUDHAtn.js","./locale-Cn_GDVD_-DrOI-_a9.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-Du14S4xc.js","./t9n-C_hcZMZJ-CZmw6XOE.js","./icon-BXFbBbop-Du8Zws1L.js","./loader-Ch7Jr16w-BlGvYEIO.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-CcSx2g4c.js","./calcite-input-BKRd7MCS-DmQD4QYo.js","./input2-eOtqu-iO-CM6Z_r7O.js","./calcite-dropdown-CLrG397W-BUH-uj2q.js","./floating-ui-DKFFlLv3-B6atYKJb.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-DwGQl3jY.js","./calcite-dropdown-item-DpLfv4A0-7PxMAxbJ.js","./resources3-Duvedxls-DbbvfBW6.js","./calcite-dropdown-group-0sIPwaDd-CQ-6-G1K.js"])))=>i.map(i=>d[i]); +import{v as a,S as c,i as x,ar as _i,eF as pi,eD as Ne,w as C,dU as g,i8 as ye,aq as ki,J as ue,I as Ce,ah as $,ax as ke,aA as dt,aL as es,aF as Il,av as Us,L as di,k8 as So,as as $s,i1 as Hs,ay as Ll,e8 as Po,bi as It,a2 as W,j as tt,dM as Gl,P as is,b9 as ns,G as Mr,aY as Ns,aC as Qe,p as vi,l as De,eC as Dl,fl as li,e as kr,m as fi,aO as Gn,f3 as Dn,eB as zl,ag as ss,aw as Mo,dN as Ul,dW as fn,j_ as $l,k9 as Hl,dK as Nl,b7 as Fl,ka as Zl,dX as Bl,h$ as Wl,kb as Cr,hq as Fe,D as Yl,kc as Xl,_ as Lt,bt as ko,$ as ql,az as jl,bx as Rr,dV as Fs,b as Kl,kd as Ql,bp as Vr,aW as os,al as Ar,ke as Jl,kf as Co,f4 as ze,B as Or,bj as Ir,au as Lr,hZ as pe,bo as Gr,i9 as zn,d$ as tc,an as ec,a3 as Dr,r as ic,kg as nc,kh as Ze,ki as sc,kj as oc,kk as rc,kl as Ro,km as ac,jw as zr,il as lc,aG as Ur,ae as cc,ih as hc,b1 as uc,kn as pc,i3 as Vo,o as Un,i4 as dc,cG as Ci,dR as Zs,ko as Bs,h_ as Ao,hh as fc,dQ as gc,dS as mc,dP as yc,kp as _c}from"./main-C7yV2j71.js";import{i as q,j as Ws,A as vc,l as Be,S as _e,y as qt,M as sn,m as Wt,x as xc,g as bc,b as $n,v as Oo,I as $r,f as Hr,d as wc,E as Tc,P as Ec,O as on,T as Sc,z as Pc,h as Mc,D as Io}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as G,_ as kc,e as de,u as Cc,m as Rc,s as Vc}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{S as Ac,R as Oc}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as Ys,p as xt,f as Ic}from"./projectVectorToVector-sIYLNlex-B5U5xz17.js";import{x as Lc,f as Nr,m as gn,y as Gc,P as Dc,w as zc,I as Uc,g as $c,Z as Lo}from"./elevationInfoUtils-mOZsPH2J-Bwot-813.js";import{N as z,O as rs,L as fe,b as xi,l as le,j as ut,X as Pe,r as Et,R as H,p as Hc,k as pt,v as Fr,y as Z,S as Ot,A as rt,g as ge,w as Go,_ as N,T as We,W as Do,G as as,H as zo}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{i as Zr}from"./UpdatingHandles-CUu3u1ms-m6cYzEJ6.js";import Xs from"./GraphicsLayer-DfeGaYc1-DAZy-iUY.js";import{O as bi,u as rn,E as mn,D as yn,P as Br,h as Nc,c as Fc}from"./geodesicUtils-B8mFUfTk-BoXyQMna.js";import{simplify as Zc,distance as Bc,geodesicArea as Wc,geodesicLength as Wr}from"./geometryEngine-CdPoFSE4-Bq1o6CJZ.js";import{U as Yc}from"./Tile-D75RMC64-CM0vKD9b.js";import{T as Xc,P as Yr,J as qc,Q as we,_ as Xr,u as Uo,O as jc}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{Y as Kc,L as Qc}from"./quat-BODLR7mS-Dbd8ftOx.js";import{e as $o}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{s as Jc,N as Ye,L as Kt,K as te,P as qs,U as Qt,Q as th,x as _n,D as ft,c as Dt,F as qr,W as eh,m as ih,S as vn,u as nh,b as sh,R as oh,Y as rh,Z as ah,q as lh,G as ch,J as hh,j as uh,A as ph,C as dh,H as fh}from"./ReactiveSet-QxEZenFW-B_-rGoLX.js";import{y as gh,w as mh,A as yh,p as _h,O as vh}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as jr,e as Hn,c as xh}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{i as bh}from"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import{y as at,_ as js,w as Ae,D as Ks,N as Ue,g as Kr,B as Ri,$ as Qr,P as ls,c as ii,e as wh,l as Ho,j as Nn,G as Jr,a as Th,O as Eh}from"./plane-Dt8R0KeE-CdQQbSdq.js";import{U as Sh,z as Ph,k as Mh,w as kh,F as Ch}from"./sphere-BenPORjV-CiIWUavi.js";import{n as wi}from"./common-CYWrYyJl-E8-sukrT.js";import{c as ta,o as Qs}from"./Cyclical-C_9rKUUQ-DaQlxz0D.js";import"./MeshTransform-C--IG09w-QYZk68_K.js";import{t as Rh}from"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import{_ as cs,H as Vh,z as Ah,R as Vi,P as v,F as wt,$ as Oh,k as Js}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{r as Ih}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{m as Lh}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{S as Gh}from"./triangle-hqU-Tc1X-0gyFMdne.js";import{m as Dh,x as zh}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import{P as Uh}from"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import{l as Ti}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{K as Xe,N as ea,J as $h}from"./projection-BA9M1R7d-DXrPfsKU.js";import"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import{t as Hh}from"./compilerUtils-CV1QYWI8-89qN_-l3.js";import{i as ia,f as na}from"./Scheduler-B7UX7Wr5-BziCzZ_c.js";import"./Query-BrwMGK8U-DV_czrJX.js";import{q as Nh}from"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";import{u as No}from"./cimSymbolUtils-CKIzBgMU-D2oNADot.js";import{p as Fh}from"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import{z as Zh}from"./drapedUtils-BZ1SGPtE-BPt00fGU.js";import{W as Fo}from"./colorUtils-Cthpxcks-CXgjba3p.js";import{h as Ei,M as Qi,N as xn}from"./boundedPlane-DlvE0eNx-DhJ9Zyo3.js";import"./GraphicsCollection-CWTXNZOX-BB4NQ39c.js";import"./Layer-ChoECxvZ--vVxyMLZ.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./BlendLayer-D1WkSmwP-D_mOfOGH.js";import"./jsonUtils-wIllKWI4-DRJhEzZa.js";import"./parser-DyDJ-rlI-CV6nO3M9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./geometryEngineBase-DueYg7ux-CCeespPx.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./hydrated-CplJC1Fs-wGAJYB2w.js";import"./TileKey-C5IL-JBr-COMthbrT.js";import"./QueueProcessor-DbfV9fLy-DobN0ur5.js";import"./workers-PiCjreoO-DqI62TYf.js";import"./ReactiveMap-CFk6jPfN-CM49HI11.js";import"./signal-CETehA7D-DxK1orqE.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./CollectionFlattener-DkHuHn5E-BN4WFIND.js";import"./TileInfo-CWIRDhZl-CwJ-BCrJ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Map-1zd11DKO-Bvo5kMfb.js";import"./Basemap-BEqqSTw9-COwFtp-h.js";import"./loadAll-e978YItg-NjG3VBGi.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./writeUtils-D5qlLkwk-IaioN2Q8.js";import"./TablesMixin-C8RojhYs-CMxVrapj.js";import"./HeightModelInfo-C5vFqzyF-DTZiz4z_.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-CtQVMDnp.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./ColorBackground-gVZldRLm-BdWj-dur.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./lineSegment-CcqvCARM-_ZNy9SM-.js";import"./utils-SPbpQbmm-Dl9Ps2XQ.js";function gi(e,t){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.m===t.m}function Fn(e,t,i){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&li(e.x,t.x,i)&&li(e.y,t.y,i)&&li(e.z??0,t.z??0,i)&&li(e.m??0,t.m??0,i)}function Bh(e){return"declaredClass"in e}function sa(e,t){if(!e)return null;let i;return Bh(e)?e.clone():(i=Ys(e.x,e.y,e.z,e.spatialReference),e.hasM&&(i.m=e.m,i.hasM=!0),i)}var Zo;function oa(e,t,i){return j(e,t,i)}function j(e=0,t=0,i=0){return pe(e,t,i)}function ve(e,t,i){return pe(e,t,i)}function qe(e){const[t,i,n]=e;return e.length>3?[t,i,n,e[3]]:[t,i,n]}function to(e,t,i,n=j()){return n[0]=e.x,n[1]=e.y,n[2]=e.z??0,t==null||(t.type==="2d"?n[2]=0:n[2]=Dc(t,e,i,gn)??0),n}function Wh(e,t,{z:i,m:n},s,o){const{spatialReference:r,elevationInfo:l}=s;let h;i==null&&n==null?h=void 0:t==null||t.type==="2d"?h=i??void 0:h=zc(t,e,r,gn,l)??0;const[u,p]=e;return o?Ic(o,u,p,h,r):o=Ys(u,p,h,r),n!=null&&(o.m=n,o.hasM=!0),o}(function(e){e[e.NONE=0]="NONE",e[e.TARGET=1]="TARGET"})(Zo||(Zo={}));let St=class extends kr{constructor(){super(...arguments),this.enabled=!0}};a([c({type:Boolean})],St.prototype,"enabled",void 0),St=a([x("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],St);let V=class extends kr{constructor(e){super(e),this.lineSnapper=new St,this.parallelLineSnapper=new St,this.rightAngleSnapper=new St,this.rightAngleTriangleSnapper=new St,this.shortLineThreshold=15,this.distance=5,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThresholdMeters=.3,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new _i([255,127,0]),this.orangeTransparent=new _i([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"lineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"parallelLineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleTriangleSnapper",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"shortLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"distance",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"intersectionParallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"parallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"verticalLineThresholdMeters",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"touchSensitivityMultiplier",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointOnLineThreshold",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orange",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orangeTransparent",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthReference",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthTarget",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"lineHintFadedExtensions",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"parallelLineHintWidth",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],V.prototype,"parallelLineHintLength",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"parallelLineHintOffset",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],V.prototype,"rightAngleHintSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],V.prototype,"rightAngleHintOutlineSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"satisfiesConstraintScreenThreshold",void 0),V=a([x("esri.views.interactive.snapping.Settings.Defaults")],V);const Zn=new V;var je;(function(e){e[e.FEATURE=1]="FEATURE",e[e.SELF=2]="SELF",e[e.ALL=3]="ALL"})(je||(je={}));let Ai=class{constructor(e,t){this.isDraped=e,this.domain=t}},Yh=class ra extends Ai{constructor(t,i,n=je.ALL){super(i,n),this.intersectionPoint=t}equals(t){return t instanceof ra&&H(this.intersectionPoint,t.intersectionPoint)}},Xh=class aa extends Ai{constructor(t,i,n,s,o=je.ALL,r=!0,l=!0){super(s,o),this.type=t,this.lineStart=i,this.lineEnd=n,this.fadeLeft=r,this.fadeRight=l}equals(t){return t instanceof aa&&this.type===t.type&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)&&this.fadeLeft===t.fadeLeft&&this.fadeRight===t.fadeRight}get length(){return ge(this.lineStart,this.lineEnd)}},qh=class la extends Ai{constructor(t,i,n,s=je.ALL){super(n,s),this.lineStart=t,this.lineEnd=i}equals(t){return t instanceof la&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)}},jh=class ca extends Ai{constructor(t,i,n){super(i,n),this.point=t}equals(t){return t instanceof ca&&H(this.point,t.point)}},Kh=class ha extends Ai{constructor(t,i,n,s,o=je.ALL){super(s,o),this.previousVertex=t,this.centerVertex=i,this.nextVertex=n}equals(t){return t instanceof ha&&H(this.previousVertex,t.previousVertex)&&H(this.centerVertex,t.centerVertex)&&H(this.nextVertex,t.nextVertex)}},Qh=class{draw(e,t){const i=Jh(e),n=this.sortUniqueHints(i),s=[];for(const o of n)o instanceof Yh&&s.push(this.visualizeIntersectionPoint(o,t)),o instanceof Xh&&s.push(this.visualizeLine(o,t)),o instanceof qh&&s.push(this.visualizeParallelSign(o,t)),o instanceof Kh&&s.push(this.visualizeRightAngleQuad(o,t)),o instanceof jh&&s.push(this.visualizePoint(o,t));return Gr(s)}sortUniqueHints(e){return e}};function Jh(e){const t=[];for(const i of e){let n=!0;for(const s of t)if(i.equals(s)){n=!1;break}n&&t.push(i)}return t}let tu=class extends Qh{constructor(e){super(),this._graphicsLayer=e,this._symbolPairingsByType=new Map}visualizeIntersectionPoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.intersectionPoint[0],y:e.intersectionPoint[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("intersectionPoint",t.view.effectiveTheme.accentColor))}visualizePoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.point[0],y:e.point[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("point",t.view.effectiveTheme.accentColor))}visualizeLine(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("line",t.view.effectiveTheme.accentColor))}visualizeParallelSign(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("parallelSign",t.view.effectiveTheme.accentColor))}visualizeRightAngleQuad(e,t){const i=G(),n=G(),s=g();q(i,e.centerVertex,e.previousVertex),q(n,e.nextVertex,e.previousVertex),vc(s,i,n);const o=`rightAngleQuad${s[2]<0?45:225}`;return this._visualizeSnappingIndicator(new fi({paths:[[[...e.previousVertex],[...e.centerVertex],[...e.nextVertex]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol(o,t.view.effectiveTheme.accentColor))}_visualizeSnappingIndicator(e,t){const i=new It({geometry:e,symbol:t});return this._graphicsLayer.add(i),W(()=>{this._graphicsLayer.remove(i)})}_getOrCreateSymbol(e,t){const i=this._symbolPairingsByType;return i.get(e)?.color!==t&&i.set(e,{color:t,symbol:eu(e,t)}),i.get(e).symbol}};function eu(e,t){const i=[...t.toRgb(),255*t.a];switch(e){case"point":return new Ne({outline:{width:.5,color:[0,0,0,1]},size:10,color:t});case"intersectionPoint":return new Ne({outline:new zl({width:1.5,color:t}),size:15,color:[0,0,0,0]});case"line":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:Ac.Butt,joinStyle:Oc.Round,miterLimit:10,width:Dn(Zn.lineHintWidthTarget),color:i}]}}});case"parallelSign":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,1.5],[7,1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,-1.5],[7,-1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}});case"rightAngleQuad45":case"rightAngleQuad225":{const n=e==="rightAngleQuad45"?45:225;return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:.5,y:.5,z:0},anchorPointUnits:"Relative",size:Dn(Zn.rightAngleHintSize),rotation:n,markerPlacement:{type:"CIMMarkerPlacementOnVertices",placePerPart:!0,angleToLine:!0,placeOnEndPoints:!1},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[5,-5],[-5,-5],[-5,5],[5,5],[5,-5]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:Dn(Zn.rightAngleHintOutlineSize),color:i},{type:"CIMSolidFill",enable:!0,color:[...t.toRgb(),255*t.a*.4]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}})}}}const iu=new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[3.75,3.75],lineDashEnding:"HalfPattern",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:1.6,color:[255,255,255,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:2,color:[0,0,0,255]}]}}}),nu=new Ne({style:"circle",size:6,color:[127,127,127,1],outline:{color:[50,50,50],width:1}}),su=new Ne({style:"circle",size:6,color:[255,127,0,1],outline:{color:[50,50,50],width:1}});var ht;(function(e){e[e.NeverApplied=0]="NeverApplied",e[e.Applied=1]="Applied",e[e.Undone=2]="Undone"})(ht||(ht={}));var Gt;(function(e){e.UndoRedoUpdating="UndoRedoUpdating",e.UndoInvalidError="UndoInvalidError",e.RedoInvalidError="RedoInvalidError",e.ApplyInvalidError="ApplyInvalidError"})(Gt||(Gt={}));const bn={[Gt.UndoRedoUpdating]:"Cannot perform operation whilst undo redo is updating",[Gt.UndoInvalidError]:"There are no items to Undo",[Gt.RedoInvalidError]:"There are no items to Redo",[Gt.ApplyInvalidError]:"Cannot apply an item that is already applied"};let ni=class extends Error{constructor(){super(bn[Gt.UndoRedoUpdating]),this.type="undo-redo-updating-error"}},hs=class extends Error{constructor(){super(bn[Gt.UndoInvalidError]),this.type="undo-redo-undo-error"}},Bo=class extends Error{constructor(){super(bn[Gt.RedoInvalidError]),this.type="undo-redo-redo-error"}},ou=class extends Error{constructor(){super(bn[Gt.ApplyInvalidError]),this.type="undo-redo-apply-error"}};var Xt;(function(e){e[e.Apply=0]="Apply",e[e.Undo=1]="Undo",e[e.Redo=2]="Redo"})(Xt||(Xt={}));let Di=class extends tt{constructor(){super(...arguments),this.name="",this.tag=Symbol(),this.status=ht.NeverApplied}get canUndo(){return this.status===ht.Applied}get canRedo(){return this.status===ht.Undone}async executeUndoRedoOperation(e){switch(e){case Xt.Apply:if(this.status!==ht.NeverApplied)throw new ou;return await this.apply(),void(this.status=ht.Applied);case Xt.Undo:if(this.status!==ht.Applied)throw new hs;return await this.undo(),void(this.status=ht.Undone);case Xt.Redo:if(this.status!==ht.Undone)throw new hs;return await this.redo(),void(this.status=ht.Applied)}}};a([c()],Di.prototype,"name",void 0),a([c()],Di.prototype,"tag",void 0),Di=a([x("esri.undoredo.UndoableOperation")],Di);let Ct=class extends tt{constructor(){super(...arguments),this._stack=new ss,this._stackPosition=-1,this._updatingHandles=new Zr}get updating(){return this._updatingHandles.updating}get canUndo(){return this.hasUndo&&!this.updating}get hasUndo(){return this._stackPosition>=0}get canRedo(){return this.hasRedo&&!this.updating}get hasRedo(){return this._stackPositione.destroy())}_drainStack(){this._stack.drain(e=>e.destroy()),this._stackPosition=-1}async undo(){if(!this.hasUndo)throw new hs;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition);e&&await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Undo),--this._stackPosition,e.canRedo||this._truncateForwardStack()})())}async redo(){if(!this.hasRedo)throw new Bo;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition+1);if(!e)throw new Bo;await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Redo),++this._stackPosition})())}peekUndo(){if(this.canUndo)return this._stack.getItemAt(this._stackPosition)}peekRedo(){if(this.canRedo)return this._stack.getItemAt(this._stackPosition+1)}async inject(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),e.canUndo?(this._stack.splice(this._stackPosition+1,0,e),this._stackPosition++):this._stackPosition>-1&&(this._stack.splice(0,this._stackPosition+1).forEach(t=>t.destroy()),this._stackPosition=-1)})())}async add(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),this._stackPosition>=-1&&this._truncateForwardStack(),e.canUndo?(this._stack.push(e),this._stackPosition=this._stack.length-1):this._drainStack()})())}async removeTagged(e,t=!1){if(this.updating&&!t)return;await Mo(()=>!this.updating);const i=new ss;for(let n=0;ni.length-1&&(this._stackPosition=i.length-1)}async clear(e=!1){if(this.updating&&!e)throw new ni;await Mo(()=>!this.updating),this._drainStack()}};a([c()],Ct.prototype,"_stack",void 0),a([c()],Ct.prototype,"_stackPosition",void 0),a([c()],Ct.prototype,"updating",null),a([c({readOnly:!0})],Ct.prototype,"canUndo",null),a([c({readOnly:!0})],Ct.prototype,"hasUndo",null),a([c({readOnly:!0})],Ct.prototype,"canRedo",null),a([c({readOnly:!0})],Ct.prototype,"hasRedo",null),Ct=a([x("esri.UndoRedo")],Ct);function eo(){return uc()}function ru(){return Ul()}function Si(e,t){const i=[];e=(e=(e=e.replaceAll(/[\u00B0\u00BA]/g,"^")).replaceAll("′","'")).replaceAll("″",'"');const n=cu(t);return pc.dmsToGeog(n,1,[e],i)?new C(i[0][0],i[0][1],ue.WGS84):null}function au(e){return e&&eo()?Ze(e)??Si(`0° 0' 0" N | ${e}`)?.longitude??Si(`0 | ${e}`)?.longitude??null:null}function lu(e){return e&&eo()?Ze(e)??Si(`${e} | 0° 0' 0" E`)?.latitude??Si(`${e} | 0`)?.latitude??null:null}function cu(e){let t=null;if(e||(e=ue.WGS84),e.wkid){if(t=Vo.geogcs(e.wkid),!t)throw new Un("coordinate-formatter:invalid-spatial-reference","wkid is not valid")}else{if(!e.wkt2&&!e.wkt)throw new Un("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing");if(t=Vo.fromString(dc.PE_TYPE_GEOGCS,e.wkt2||e.wkt),!t)throw new Un("coordinate-formatter:invalid-spatial-reference","wkt is not valid")}return t}let hu=class{constructor(){this.committedVertices=null,this.cursorVertex=null,this.full=null,this.outline=null,this.cursorEdge=null,this.circle=null,this.rectangle=null}};var us;let se=us=class extends De{constructor(e){super(e),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}initialize(){const e=this.center,t=this.numberOfPoints;if(this.hasZ=e?.hasZ??!1,this.rings.length!==0||!e)return;const i=fn(this.radius,this.radiusUnit,"meters"),n=e.spatialReference;let s,o="geographic";if(n.isWebMercator?o="webMercator":((n.wkid&&$l[n.wkid])!=null||(n.wkt2||n.wkt)&&Hl(n.wkt2||n.wkt))&&(o="projected"),this.geodesic){let r;switch(o){case"webMercator":r=Nl(e);break;case"projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case"geographic":r=e}s=this._createGeodesicCircle(r,i,t),o==="webMercator"&&(s=Fl(s))}else{let r;o==="webMercator"||o==="projected"?r=i/Zl(e.spatialReference):o==="geographic"&&(r=Bl(i,"meters",Wl(e.spatialReference).radius)),s=this._createPlanarCircle(e,r,t)}this.spatialReference=s.spatialReference,this.addRing(s.rings[0])}clone(){const{center:e,numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s}=this;return new us({center:e?.clone(),numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s})}_createGeodesicCircle(e,t,i){let n=0;const s=[];for(;n<360;){const o=[0,0],r=[e.x,e.y];bi(o,r,n,t,ue.WGS84),this.hasZ&&o.push(e.z),s.push(o),n+=360/i}return s.push(s[0]),new De({rings:[s]})}_createPlanarCircle(e,t,i){const n=[],s=2*Math.PI/i;for(let o=0;othis.mapToLocal(t)).filter(ki)}get doUnnormalization(){return!1}},pu=class extends ua{constructor(e,t,i=null){super(t),this._defaultZ=i,this.transform=Uo(),this.transformInv=Uo(),this.transform=jc(e),Yc(this.transformInv,this.transform)}makeMapPoint(e,t){return an(e,t,this._defaultZ)}mapToLocal(e){return k(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return an(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}},du=class extends ua{constructor(e,t){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=g(),this.tangentFrameUpWS=g(),this.tangentFrameRightWS=g(),this.tangentFrameForwardWS=g(),this.localFrameRightWS=g(),this.localFrameUpWS=g(),this.worldToLocalTransform=$o(),this.localToWorldTransform=$o(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=t,this.defaultZ=t.hasZ?t.z:null;const i=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Z,this.tangentFrameForwardWS);const n=g();fe(n,this.tangentFrameForwardWS,Z(i,this.tangentFrameForwardWS)),Et(this.localFrameRightWS,i,n),le(this.localFrameRightWS,this.localFrameRightWS),Ot(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),Kc(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),Qc(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.viewingMode==="global"}makeMapPoint(e,t){return an(e,t,this.defaultZ)}mapToLocal(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e[0],y:e[1],spatialReference:this.spatialReference}),t),Go(t,t,this.worldToLocalTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?k(i.x/this.scale,i.y/this.scale):null}localToMap(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e.x*this.scale,y:e.y*this.scale,spatialReference:this.spatialReference}),t),Go(t,t,this.localToWorldTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?an(i.x,i.y,this.defaultZ):null}};function fu(e,t){if(e.type==="2d")return new pu(e.state.transform,e.spatialReference,t.length>2?t[2]:null);if(e.type==="3d"){const i=t.length>2?new C({x:t[0],y:t[1],z:t[2],spatialReference:e.spatialReference}):new C({x:t[0],y:t[1],spatialReference:e.spatialReference});return new du(e,i)}return null}function Me(e,t){const i=new C({x:e[0],y:e[1],spatialReference:t});return e.length>2&&(i.z=e[2]),i}function gu(e,t){return new Mr({points:e,spatialReference:t})}function Wo(e,t,i){const n=new fi({paths:e,spatialReference:t});return i&&Cr(n),n}function Oi(e,t,i,n=!0){const s=is(e);s.forEach(r=>{const l=r[0],h=r[r.length-1];Fe(l,h)&&r.length!==1||r.push(r[0])});let o=new De({rings:s,spatialReference:t});return o.rings.forEach(r=>{Yl(r)||r.reverse()}),i&&Cr(o),n&&o.isSelfIntersecting&&Ns(t)&&(o=Zc(o)),o}function Yo(e,t,i){const n=t.mapToLocalMultiple(e),s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y},l=Math.round(r.x-o.x),h=Math.round(r.y-o.y),u=Math.max(Math.abs(l),Math.abs(h));if(i){const p={x:o.x+u,y:o.y+u},d={x:o.x-u,y:o.y-u};s.push(k(p.x,d.y),k(d.x,d.y),k(d.x,p.y),k(p.x,p.y))}else{const p={x:l>0?o.x+u:o.x-u,y:h>0?o.y+u:o.y-u};s.push(k(o.x,o.y),k(p.x,o.y),k(p.x,p.y),k(o.x,p.y))}return pa(Oi([s.map(p=>t.localToMap(p)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function mu(e,t,i){let n=t.mapToLocalMultiple(e);if(n.length===1){const l=n[0];n=[k(l.x-48,l.y+48),k(l.x+48,l.y-48),k(l.x+48,l.y-48),k(l.x-48,l.y+48)]}const s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y};if(i){const l=Math.round(r.x-o.x),h=Math.round(r.y-o.y);s.push(k(o.x-l,o.y-h),k(r.x,o.y-h),k(r.x,r.y),k(o.x-l,r.y))}else s.push(k(o.x,o.y),k(r.x,o.y),k(r.x,r.y),k(o.x,r.y));return pa(Oi([s.map(l=>t.localToMap(l)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function pa(e,t,i){const n=zi(t[3],t[2],i),s=zi(t[1],t[2],i),o=zi(t[0],t[1],i),r=zi(t[0],t[3],i);return{geometry:e,midpoints:n!=null&&s!=null&&o!=null&&r!=null?{top:n,right:s,bottom:o,left:r}:null}}function zi(e,t,i){Re[0]=e.x,Re[1]=e.y,Re[2]=0,Ve[0]=t.x,Ve[1]=t.y,Ve[2]=0,Pe(Re,Re,Ve,.5),Ui.x=Re[0],Ui.y=Ve[1],Ui.z=Ve[2];const n=i.localToMap(Ui);return n!=null?Me(n,i.spatialReference):null}const Ui=k(0,0,0),Re=g(),Ve=g();function Xo(e,t,i,n){const s=t.mapToLocalMultiple(e);let o=null,r=null;if(i)o=s[0],r=s[1];else{const _=s[0],y=s[1],w=Math.round(y.x-_.x),b=Math.round(y.y-_.y),S=Math.max(Math.abs(w),Math.abs(b));o=k(w>0?_.x+S/2:_.x-S/2,b>0?_.y+S/2:_.y-S/2),r=k(Math.abs(w)>Math.abs(b)?o.x-S/2:o.x,Math.abs(w)>Math.abs(b)?o.y:o.y-S/2)}const l=t.localToMap(o),h=t.localToMap(r);if(l==null||h==null)return null;t.doUnnormalization&&Xl([[l,h]],t.spatialReference);const u=Me(l,t.spatialReference),p=Me(h,t.spatialReference),d=vi(t.spatialReference);let m=0;if(Ns(t.spatialReference))m=d*Bc(u,p,null);else{const _=o.x-r.x,y=o.y-r.y;m=d*Math.sqrt(_*_+y*y)*1}const f=new uu({center:u,radius:m,radiusUnit:"meters",spatialReference:t.spatialReference});return{geometry:Oi(f.rings,f.spatialReference,!1),center:u,edge:p}}function yu(e,t,i){const n=t.mapToLocalMultiple(e),s=n[0],o=n[1],r=Math.round(o.x-s.x),l=Math.round(o.y-s.y),h=k(i?s.x:s.x+r/2,i?s.y:s.y+l/2),u=i?r:r/2,p=i?l:l/2,d=60,m=[],f=2*Math.PI/d;function _(Y){const gt=Math.cos(Y),lt=Math.sin(Y);return k(u*gt+h.x,p*lt+h.y)}for(let Y=0;Yt.localToMap(Y)).filter(ki)],y,w,!1),S=t.localToMap(_(Math.PI/2)),I=t.localToMap(_(0)),K=t.localToMap(_(-Math.PI/2)),et=t.localToMap(_(Math.PI));return{geometry:b,midpoints:S!=null&&I!=null&&K!=null&&et!=null?{top:Me(S,y),right:Me(I,y),bottom:Me(K,y),left:Me(et,y)}:null}}function io(e,t){switch(e){case"point":case"multipoint":return _u();case"polyline":return vu(t);case"polygon":return xu(t);default:return}}function _u(e){return"point"}function vu(e){return(e!=null&&e.type==="polyline"&&e.paths.length?e.paths[0].length:0)<2?"polylineZeroVertices":"polylineOneVertex"}function xu(e){const t=e!=null&&e.type==="polygon"&&e.rings.length?e.rings[0].length:0;return t<3?"polylineZeroVertices":t<4?"polygonOneVertex":"polygonTwoVertices"}function bu(e,t){const i=e?.geometry;if(!e||i?.type!=="mesh"||!t)return;const{renderCoordsHelper:n,elevationProvider:s}=t,{camera:o}=t.state,{extent:r}=i,{center:l,spatialReference:h}=r,u=vi(h),p=Fs(h),d=vi(n.spatialReference),m=r.width*u,f=r.height*p,_=(r.zmax??0)*p,y=_-(r.zmin??0)*p,w=Math.max(m,f,y)/d,{x:b,y:S}=l,I=l.z??0;N($i,b,S,I),n.toRenderCoords($i,h,$i);const K=w/o.computeScreenPixelSizeAt($i);if(K>o.width*Tu)return"meshTooClose";if(K=0){if(d>=0||t.type===O.LINE)return[qt(ln,i,r,p)]}else if(e.type===O.LINE&&(d>=0||t.type===O.LINE))return[qt(ln,i,r,p)];return[]}function Pu(e,t,i){const n=[],s=q(da,e.end,e.start),o=q(fa,e.start,t),r=Be(s),l=2*_e(s,o),h=l*l-4*r*(Be(o)-i*i);if(h===0){const u=-l/(2*r);(e.type===O.LINE||u>=0)&&n.push(qt(ln,e.start,s,u))}else if(h>0){const u=Math.sqrt(h),p=(-l+u)/(2*r);(e.type===O.LINE||p>=0)&&n.push(qt(ln,e.start,s,p));const d=(-l-u)/(2*r);(e.type===O.LINE||d>=0)&&n.push(qt(ga,e.start,s,d))}return n}var O;(function(e){e[e.RAY=0]="RAY",e[e.LINE=1]="LINE"})(O||(O={}));const Mu=1e-6,da=G(),fa=G(),ga=G(),ln=G();function no({start:e,end:t,type:i},n,s){const o=[],r=q(Ii,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===bt.PLANE||d>=0)&&o.push(qt(G(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===bt.PLANE||m>=0)&&o.push(qt(G(),e,r,m));const f=(-u-d)/(2*h);(i===bt.PLANE||f>=0)&&o.push(qt(G(),e,r,f))}return o}function ma(e,t){const i=e.start,n=e.end,s=q(Ii,n,i),o=N(En,-s[1],s[0],0),r=t.start,l=t.end,h=pt(oo,l,r),u=Z(h,o),p=N(Ea,i[0],i[1],0),d=pt(Sa,p,r),m=Z(d,o),f=wi();if(Math.abs(u)de(i,n))}function _a(e,t,i){return xa(e,cn(ro,e[2],t),i)}function va(e,t,i,n=g()){const s=q(Ii,e,t),o=Mc(s);return qt(n,t,s,o===0?1:i/o),n[2]=e[2],n}function xa(e,{start:t,end:i,type:n},s=g()){const o=pt(Tn,e,t),r=pt(En,i,t),l=Z(o,r)/Z(r,r);return z(s,t,r,n===O.RAY?Math.max(l,0):l)}const Cu=(()=>{const e=g(),t=g(),i=g();return({start:n,end:s},{center:o,radius:r,normal:l,slicePlane:h})=>{const u=Ri(o,l,Ou);if(R(ls(u,n),0)&&R(ls(u,s),0)){Qr(l,e,t);const d=(_,y)=>(Et(i,y,o),Wt(_,Z(i,e),Z(i,t)),_),m=Pu({start:d(Ii,n),end:d(wn,s),type:O.LINE},Vc,r),f=[];for(const[_,y]of m){const w=rt(g(),o);z(w,w,e,_),z(w,w,t,y),h&&!me(h,w)||f.push(w)}return f}const p=g();return js(u,n,s,p)?!R(ge(p,o),r)||h&&!me(h,p)?[]:[p]:[]}})();function ba({start:e,end:t,type:i},n,s){const o=[],r=Et(Tn,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===O.LINE||d>=0)&&o.push(z(g(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===O.LINE||m>=0)&&o.push(z(g(),e,r,m));const f=(-u-d)/(2*h);(i===O.LINE||f>=0)&&o.push(z(g(),e,r,f))}return o}function wa(e,t){const i=e.start,n=e.end,s=t.start,o=t.end,r=pt(Tn,n,i),l=pt(En,o,s),h=pt(oo,s,i),u=Ot(Ea,r,l);if(!R(Z(h,u),0))return[];const p=as(u);if(R(p,0))return[];const d=Ot(Sa,h,l),m=Z(d,u)/p,f=z(Pa,i,r,m);if(e.type===O.RAY){const _=pt(ps,f,i);if(Z(r,_)<-wi())return[]}if(t.type===O.RAY){const _=pt(ps,f,s);if(Z(l,_)<-wi())return[]}return[ye(f)]}function Ru({start:e,end:t,type:i},n){const s=pt(Tn,n,e),o=pt(En,t,e),r=Ot(oo,o,s),l=as(r)/as(o),h=wi();if(lt+n)return[];if(dme(e,i))}function me(e,t){return Kr(e,t)}var bt;(function(e){e[e.PLANE=0]="PLANE",e[e.HALF_PLANE=1]="HALF_PLANE"})(bt||(bt={}));const Au={[bt.PLANE]:O.LINE,[bt.HALF_PLANE]:O.RAY},Ii=G(),wn=G(),Tn=g(),En=g(),oo=g(),Ea=g(),Sa=g(),Pa=g(),ps=g(),Ou=at(),ro={start:g(),end:g(),type:O.LINE},Iu={start:g(),end:g(),type:O.LINE};class Tt{intersect(t){return $t(this,t)}closestPoints(t){return[this.closestTo(t)]}}class Je extends Tt{constructor(t){super(),this.point=t}equals(t){return this===t||vt(t)&&H(this.point,t.point)}closestTo(){return qe(this.point)}}class ao extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.lineLike={start:t,end:i,type:n}}equals(t){return this===t||Rt(t)&&this.lineLike.type===t.lineLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return xa(t,this.lineLike,i),i}}class Ma extends ao{constructor(t,i){super(t,i,O.LINE)}}class Lu extends ao{constructor(t,i){super(t,i,O.RAY)}}class ka extends Tt{constructor(t){super(),this.constraints=t}equals(t){return this===t||ds(t)&&Fe(this.constraints,t.constraints,(i,n)=>i.equals(n))}closestTo(t){let i,n=1/0;for(const s of this.constraints){const o=s.closestTo(t),r=Hc(t,o);ri===this?[]:i.closestPoints(t))}}class Ca extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||At(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i}}class lo extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||Nt(t)&&H(this.center,t.center)&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i[2]=this.center[2],i}asCircle(){return new co(qe(this.center),this.radius,ve(0,0,1))}}class co extends Tt{constructor(t,i,n,s=void 0){super(),this.center=t,this.radius=i,this.normal=n,this.slicePlane=s}equals(t){return this===t||oe(t)&&H(this.center,t.center)&&H(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:i,radius:n}=this;Ks(this.getPlane(Gu),t,Wn);const s=pt(Wn,Wn,i),o=Fr(s);if(R(o,0))return qe(t);const r=n/Math.sqrt(o),l=j();z(l,i,s,r);const{slicePlane:h}=this;return h&&!me(h,l)?uo(h,this)?.closestTo(t)??qe(t):l}getPlane(t=at()){return Ri(this.center,this.normal,t)}}const Wn=g(),Gu=at();class Ra extends Tt{constructor(t){super(),this.z=t}equals(t){return this===t||Ht(t)&&this.z===t.z}closestTo(t){return ve(t[0],t[1],this.z)}getPlane(t=at()){return N(qo,0,0,this.z),Ri(qo,Hs,t)}}const qo=g();class Va extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.planeLike={start:t,end:i,type:n}}equals(t){return this===t||Vt(t)&&this.planeLike.type===t.planeLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return _a(t,this.planeLike,i),i}closestEndTo(t){const{start:i,end:n}=this.planeLike;return Math.sign(_e(q(Du,n,i),q(zu,t,i)))>0?this.end:this.start}getPlane(t=at()){const i=rt(jo,this.end);return i[2]+=1,Jr(this.start,this.end,i,t)}getSlicePlane(t=at()){const{start:i,end:n,type:s}=this.planeLike;if(s===bt.PLANE)return;const o=N(jo,i[0],i[1],0),r=N(Ko,n[0],n[1],0),l=Et(Ko,r,o);return Ri(o,l,t),t}}const Du=G(),zu=G(),jo=g(),Ko=g();class Uu extends Va{constructor(t,i){super(t,i,bt.HALF_PLANE)}}class $u extends Tt{constructor(t,i){super(),this.sphere=Ph(t,i)}equals(t){return this===t||Ft(t)&&Mh(this.sphere,t.sphere)}closestTo(t){const i=j();return kh(this.sphere,t,i),i}get center(){return Ch(this.sphere)}get radius(){return this.sphere[3]}}class Hu extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.getZ=n,this.planeLike={start:t,end:i,type:bt.PLANE}}equals(t){return this===t||hn(t)&&H(this.start,t.start)&&H(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Bu(this,t)}addIfOnTheGround(t,i){for(const n of i){const s=this.getZ(n[0],n[1])??0;R(n[2],s)&&(n[2]=s,t.push(n))}}}class ho extends Tt{constructor(t,i,n){super(),this._x=t,this._y=i,this._z=n}equals(t){return this===t||ap(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,i,n]){return oa(this._x??t,this._y??i,this._z??n)}}class Aa extends Tt{constructor(t,i,n,s,o){super(),this._origin=t,this._spatialReference=i,this._distanceMeters=n,this._z=s,this._directionDegrees=o}equals(t){return this===t||rp(t)&&Io(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,i,n]){return Wt(si,t,i),Io(si,this._origin)||this._applyDirectionAndDistance(si),oa(si[0],si[1],this._z??n)}_applyDirectionAndDistance(t){if(this._directionDegrees!=null&&this._distanceMeters!=null)bi(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(this._directionDegrees!=null)Fu(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(this._distanceMeters!=null){const{azimuth:i}=mn(Nu,this._origin,t,this._spatialReference);bi(t,this._origin,i??0,this._distanceMeters,this._spatialReference)}}}const si=[0,0],Nu=new yn;function Fu(e,t,i,n,s){let{azimuth:o,distance:r}=mn(Zu,t,n,s);o??=0;let l=r*Math.cos((o-i)*bh);l=Math.max(0,l),bi(e,t,i,l,s)}const Zu=new yn;function Bu(e,t){const i=j();return _a(t,e.planeLike,i),i[2]=e.getZ(i[0],i[1])??Ia,i}function $t(e,t){if(ds(e)){const i=[];for(const n of e.constraints){const s=n.intersect(t);s&&i.push(s)}return Li(i)}if(ds(t))return $t(t,e);if(hn(e))return Qo(e,t);if(hn(t))return Qo(t,e);if(vt(e)){const{point:i}=e;if(vt(t))return H(i,t.point)?e:void 0;const n=t.closestTo(i);return We(n,i)?e:void 0}if(Rt(e)){if(vt(t))return $t(t,e);if(Rt(t))return Pt(wa(e.lineLike,t.lineLike));if(Ht(t))return Wu(e,t);if(Vt(t))return Pt(ma(t.planeLike,e.lineLike));if(At(t))return Pt(ba(e.lineLike,t.center,t.radius));if(oe(t))return Pt(Cu(e.lineLike,t));if(Nt(t))return Yu(e,t);if(Ft(t))return Xu(e,t)}else if(Ht(e)){if(vt(t)||Rt(t))return $t(t,e);if(Ht(t))return qu(e,t);if(Vt(t))return ju(e,t);if(At(t))return Ku(e,t);if(oe(t))return Ju(e,t);if(Nt(t))return Qu(e,t);if(Ft(t))return tp(e,t)}else if(Vt(e)){if(vt(t)||Rt(t)||Ht(t))return $t(t,e);if(Vt(t))return Yn(ya(e.planeLike,t.planeLike));if(At(t))return Yn(no(e.planeLike,t.center,t.radius));if(oe(t))return ip(e,t);if(Nt(t))return ep(e,t);if(Ft(t))return np(e,t)}else if(At(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t))return $t(t,e);if(At(t))return Yn(so(e.center,e.radius,t.center,t.radius));if(oe(t))return;if(Nt(t))return sp(e,t);if(Ft(t))return}else if(oe(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t))return $t(t,e);if(oe(t))return;if(Nt(t))return t.asCircle(),void 0;if(Ft(t))return}else if(Nt(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||oe(t))return $t(t,e);if(Nt(t))return op(t,e);if(Ft(t))return}else if(Ft(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||Nt(t))return $t(t,e);if(Ft(t))return}}const Wu=(()=>{const e=at();return(t,i)=>{const{start:n,end:s}=t;if(Ta(n,s)&&R(n[2],i.z))return t;const o=j();return js(i.getPlane(e),n,s,o)?new Je(o):void 0}})();function Yu({lineLike:e},{center:t,radius:i}){const n=t[2];return Pt(ba(e,t,i).filter(s=>R(s[2],n)))}function Xu({lineLike:e},{sphere:t}){return Pt(Sh(t,e.start,e.end))}const uo=(()=>{const e=jr(),t=g(),i=g();return(n,s,o)=>{const{normal:r,center:l,radius:h}=s;Qr(r,t,i);const u=Ue(n),p=h*Z(u,t),d=h*Z(u,i);gh(e,l[0],l[1],l[2],1);const m=mh(n,e),f=Math.hypot(p,d),_=R(f,0);if(R(ls(n,l),0)){if(_)return s;if(R(h,0))return!o||me(o,l)?new Je(qe(l)):void 0;Ot(t,u,r),le(t,t);const Y=new Array,gt=ye(l);z(gt,gt,t,h),o&&!me(o,gt)||Y.push(gt);const lt=ye(l);return z(lt,lt,t,-h),o&&!me(o,lt)||Y.push(lt),Pt(Y)}if(_)return;const y=-m/f;if(Math.abs(y)>1||R(y,1))return;const w=Math.atan(p/d),b=tc(y)-w,S=Math.PI-b,I=new Array,K=g();z(K,l,t,h*Math.cos(b)),z(K,K,i,h*Math.sin(b)),I.push(K);const et=g();return z(et,l,t,h*Math.cos(S)),z(et,et,i,h*Math.sin(S)),I.push(et),Pt(o?Vu(o,I):I)}})();function qu(e,t){return R(e.z,t.z)?e:void 0}function ju({z:e},{planeLike:t}){const[i,n]=t.start,[s,o]=t.end,r=ve(i,n,e),l=ve(s,o,e);return t.type===bt.PLANE?new Ma(r,l):new Lu(r,l)}function Ku(e,t){const[i,n]=t.center;return new lo(ve(i,n,e.z),t.radius)}function Qu(e,t){return R(t.center[2],e.z)?t:void 0}const Ju=(()=>{const e=at();return(t,i)=>uo(t.getPlane(e),i,i.slicePlane)})();function tp(e,{center:t,radius:i}){const n=Math.abs(t[2]-e.z);if(n>i&&!R(n,i))return;const s=ve(t[0],t[1],e.z),o=Math.sqrt(i**2-n**2);return R(o,0)?void 0:new lo(s,o)}const ep=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=no(t.planeLike,i,n),o=i[2];t.getSlicePlane(e);const r=new Array;for(const[l,h]of s){const u=[l,h,o];me(e,u)&&r.push(u)}return Pt(r)}})(),ip=(()=>{const e=at(),t=at();return(i,n)=>uo(i.getPlane(e),n,i.getSlicePlane(t))})(),np=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=t.getPlane(e),o=Ae(s,i),r=Math.abs(o);if(r>n&&!R(r,n))return;const l=Math.sqrt(n**2-o**2);if(R(l,0)){const p=j();return Ks(s,i,p),new Je(p)}const h=j(),u=ye(Ue(s));return z(h,i,u,o),new co(h,l,u,t.getSlicePlane())}})();function sp(e,t){const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?t:Oa(so(e.center,e.radius,t.center,t.radius),t.center[2])}function op(e,t){if(!Ta(e.center,t.center))return;const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?e:Oa(so(e.center,e.radius,t.center,t.radius),e.center[2])}function Qo(e,t){const{planeLike:i,getZ:n}=e,s=new Array;if(vt(t))e.addIfOnTheGround(s,ku(i,t.point));else if(Rt(t))e.addIfOnTheGround(s,ma(i,t.lineLike));else if(At(t))for(const[o,r]of no(i,t.center,t.radius)){const l=n(o,r);l!=null&&s.push(pe(o,r,l))}else if(Vt(t)||hn(t))for(const[o,r]of ya(i,t.planeLike)){const l=n(o,r)??Ia;s.push(pe(o,r,l))}return Pt(s)}function Yn(e){return Li(e.map(([t,i])=>{const n=ve(t,i,0),s=ve(t,i,1);return new Ma(n,s)}))}function Pt(e){return Li(e.map(t=>t?new Je(t):void 0))}function Oa(e,t){return Pt(e.map(([i,n])=>[i,n,t]))}function Li(e){if(e.length!==0)return e.length===1?e[0]??void 0:new ka(e.filter(ki))}function ds(e){return e instanceof ka}function vt(e){return e instanceof Je}function Rt(e){return e instanceof ao}function Ht(e){return e instanceof Ra}function Vt(e){return e instanceof Va}function At(e){return e instanceof Ca}function Nt(e){return e instanceof lo}function oe(e){return e instanceof co}function Ft(e){return e instanceof $u}function hn(e){return e instanceof Hu}function rp(e){return e instanceof Aa}function ap(e){return e instanceof ho}const Ia=0;var A;function po(e,t){if(e==null||t==null)return;const i=fs(e,t);return i!=null?Dt(i,"radians","geographic"):void 0}(function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"})(A||(A={}));const fs=(()=>{const e=g(),t=g();return(i,n)=>(N(e,i.x,i.y,i.z??0),N(t,n.x,n.y,n.z??0),lp(e,t,i.spatialReference,n.spatialReference))})(),lp=(()=>{const e=G(),t=g(),i=g();return(n,s,o,r)=>{if(H(n,s))return;const l=rn(o),h=rn(r);if(l&&h&&Qe(l,h)&&xt(n,o,t,l)&&xt(s,r,i,h)){const{azimuth:p}=mn(pp,t,i,l);return p!=null?fn(p,"degrees","radians"):void 0}e[0]=s[0]-n[0],e[1]=s[1]-n[1];let u=Pc(Rc,e);return e[0]<0&&(u=dp-u),u}})();function cp(e,t,i,n=A.Absolute){if(t&&i)switch(n){case A.Absolute:return po(t,i);case A.Relative:return un(Jo(e,t,i),A.Relative);case A.RelativeBilateral:return un(Jo(e,t,i),A.RelativeBilateral)}}function Jo(e,t,i){if(!e||!t||!i)return;const n=fs(e,t),s=fs(t,i);return n!=null&&s!=null?Dt(s-n,"radians","geographic"):void 0}function un(e,t){if(e!=null)switch(t){case A.Absolute:return gs(e);case A.Relative:{const i=Mt(e);let n=tr.normalize(i,0,!0);return n===-180&&(n=180),Dt(n,"degrees","geographic")}case A.RelativeBilateral:{const i=Mt(e),n=Math.abs(tr.normalize(i,0,!0));return Dt(n,"degrees","geographic")}}}function gs(e){const t=Mt(e),i=fp.normalize(t,0,!0);return Dt(i,"degrees","geographic")}const hp=(()=>{const e=g();return(t,i,n,s,o,r="geodesic")=>{rt(e,i);const l=Mt(o);if(r==="geodesic"){const f=rn(n);if(f&&xt(e,n,e,f))return bi(t,e,l,s,f),t[2]=i[2],!!xt(t,f,t,n)}const h=qr(l,"geographic","arithmetic"),u=fn(h,"degrees","radians"),p=i[0]+s*Math.cos(u),d=i[1]+s*Math.sin(u),m=i[2];return N(t,p,d,m),!0}})();function Mt(e){if(e!=null)return qr(up(e),e.rotationType,"geographic")}function up(e){return fn(e.value,e.unit,"degrees")}const pp=new yn,dp=2*Math.PI,fp=ta,tr=new Qs(-180,180);function gp(e,t,i,n,s,o){let r="geodesic",l=rn(i);const h=j();return to(e,t,n,h),h[2]=0,l&&xt(h,i,h,l)||(r="euclidean",l=i),{mode:r,view:t,elevationInfo:n,hasZ:s,directionMode:o,spatialReference:e.spatialReference,measurementSR:l,origin:h}}function mp(e,t,i){if(t==null||e==null)return;const n=Bs(i.measurementSR);if(n==null)return;const s=Sn(e,i);if(s==null)return;const o=_n(t,n);return new Ca(s,o)}function yp(e,t,i,n){if(i==null||e==null)return;const s=Sn(e,n);if(s==null)return;const o=Mt(i),r=10,l=u=>{if(u==null)return;const p=j(),d=Dt(u,"degrees","geographic");return hp(p,s,n.measurementSR,r,d,n.mode)?new Uu(s,p):void 0},h=()=>{if(t!=null&&e!=null)return Mt(po(t,e))};switch(n.directionMode){case A.Absolute:return l(o);case A.Relative:{const u=h();return u==null?void 0:l(u+o)}case A.RelativeBilateral:{const u=h();return u==null?void 0:Li([l(u+o),l(u-o)])}}}function La(e,t){const i=Pn(e,t);return i!=null?new Ra(i):void 0}function Ga(e,t,i){const{context:n,longitude:s,latitude:o,direction:r,distance:l,elevation:h}=i;if(s!=null||o!=null||l!=null||h!=null||r!=null){if(s!=null||o!=null){const u=Mt(s),p=Mt(o),d=Pn(h,n);return new ho(u,p,d)}return _p(e,t,i)}}function _p(e,t,{context:i,direction:n,distance:s,elevation:o}){if(t==null)return La(o,i);const{view:r,elevationInfo:l,measurementSR:h}=i,u=to(t,r,l);if(!h||!xt(u,t.spatialReference,er,h))return;const[p,d]=er,m=s!=null?_n(s,"meters"):void 0,f=Mt(n),_=Pn(o,i),y=b=>{const S=new Aa([p,d],h,m,_,b);return m==null||b==null||_==null&&i.hasZ?S:new Je(S.closestTo(u))};if(f==null)return y(void 0);const w=()=>{if(e!=null&&t!=null)return Mt(po(e,t))};switch(i.directionMode){case A.Absolute:return y(f);case A.Relative:{const b=w();return b==null?void 0:y(b+f)}case A.RelativeBilateral:{const b=w();return b==null?void 0:Li([y(b+f),y(b-f)])}}}function vp(e){return e.context.mode==="geodesic"?Ga(null,null,e):Da(e)}function xp(e,t,i){const{context:n,x:s,y:o,distance:r,direction:l,elevation:h}=i;return n.mode==="geodesic"?Ga(t,e,i):s!=null||o!=null?Da(i):bp([mp(e,r,n),yp(e,t,l,n),La(h,n)])}function Da({x:e,y:t,elevation:i,context:n}){Hi.x=e?.value??0,Hi.y=t?.value??0,Hi.spatialReference=n.spatialReference;const s=Sn(Hi,n,Ep);return new ho(e!=null&&s!=null?s[0]:void 0,t!=null&&s!=null?s[1]:void 0,Pn(i,n))}function bp(e){let t;for(const i of e)i&&(t=t?.intersect(i)??i);return t}function Sn(e,t,i=j()){const{view:n,elevationInfo:s,measurementSR:o,origin:r,mode:l}=t;if(to(e,n,s,i),xt(i,e.spatialReference,i,o))return l!=="geodesic"&&Et(i,i,r),i}function wp(e,t,i,n){const{view:s,measurementSR:o,spatialReference:r,origin:l,mode:h}=i;if(h==="geodesic"?rt(oi,e):ut(oi,e,l),xt(oi,o,oi,r))return Wh(oi,s,t,i,n)}function Pn(e,t){return Tp(e,t)?.value??void 0}function Tp(e,{view:t,origin:i,elevationInfo:n,hasZ:s,measurementSR:o}){if(e==null||!s)return;const r=zr(o);if(r==null)return;const[l,h]=i,u=_n(e,r),p=t?.type==="3d"?Nr(t,l,h,u,o,n):u;return p!=null?ft(p,r):void 0}const er=j(),Ep=j(),oi=j(),Hi=Ys(0,0,0,ue.WGS84),Sp="z",Pp="r",ir={toggle:"Control"},$e={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"},kt={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight",modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:Yr,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},undo:Sp,redo:Pp};let Mp=class{constructor(){this._bindings=new Map}add(e,t){return this.addToggle(e,i=>{i.type==="key-down"&&t(i)})}addToggle(e,t){const i=kp.fromDefinition(e,t),n=ec(this._bindings,i.key,()=>[]);return n.push(i),W(()=>Dr(n,i))}register(e,t=Xr.WIDGET){return Gr([e.on("key-down",i=>this.dispatch(e.inputManager,i),t),e.on("key-up",i=>this.dispatch(e.inputManager,i),t)])}dispatch(e,t){const i=t.key,n=this._bindings.get(i);if(n)for(const s of n)s.process(e,t)}},kp=class ms{constructor(t,i,n,s,o){this.key=t,this.modifiers=i,this.repeats=n,this.continuePropagation=s,this.callback=o}process(t,i){if(!(i.key!==this.key||"repeat"in i&&i.repeat&&!this.repeats)){for(const n of this.modifiers)if(!t.isModifierKeyDown(n))return;this.continuePropagation||i.stopPropagation(),this.callback(i)}}static fromDefinition(t,i){if(typeof t=="string")return new ms(t,[],!1,!1,i);const{key:n,modifier:s,repeats:o,continuePropagation:r}=t;return new ms(n,s?Array.isArray(s)?s:[s]:[],!!o,!!r,i)}};const Q="esri-tooltip",Cp=`${Q}-content`,Rp=`${Q}-content--input`,Vp=`${Q}-content__header`,Ap=`${Q}-content__header__spacer`,nr=`${Q}-content__header__actions`,za=`${Q}-draw-header-actions`,Op=`${Q}-table`,Ip=`${Q}-help-message`,Lp=`${Q}-help-message__text`,Gp=`${Q}-help-message__icon`,Ni=`${Q}-field`,Fi={base:Ni,inputMode:`${Ni}--input`,title:`${Ni}__title`,value:`${Ni}__value`};let U=class extends Vi{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return v("div",{class:this.classes({[Fi.base]:!0,[Fi.inputMode]:this.mode==="input"})},v("div",{class:Fi.title,key:"title"},this.title),v("div",{class:Fi.value,key:"value"},this.value))}};a([c()],U.prototype,"hidden",void 0),a([c()],U.prototype,"mode",void 0),a([c()],U.prototype,"title",void 0),a([c()],U.prototype,"value",void 0),U=a([x("esri.views.interactive.tooltip.components.TooltipField")],U);const Dp={base:`${Q}-value-by-value`};let Yt=class extends Vi{constructor(){super(...arguments),this.divider="×"}render(){return v("div",{class:Dp.base},v("span",null,this.left),v("span",null,this.divider),v("span",null,this.right))}};a([c()],Yt.prototype,"left",void 0),a([c()],Yt.prototype,"divider",void 0),a([c()],Yt.prototype,"right",void 0),Yt=a([x("esri.views.interactive.tooltip.components.ValueByValue")],Yt);function ys(e){let t,i,n=[],s=!1;function o(...r){return s&&t===this&&zp(r,n)||(i=e.apply(this,r),t=this,n=r,s=!0),i}return o}function zp(e,t){if(e.length!==t.length)return!1;for(let i=0;iQp(e,i,n??t.area),length:(i,n,s)=>or(e,i,n??t.length,s),lengthRelative:(i,n)=>qp(e,i,n??t.length),totalLength:(i,n)=>or(e,i,n??t.length),verticalLength:(i,n)=>jp(e,i,n??t.verticalLength),verticalLengthRelative:(i,n)=>Kp(e,i,n??t.verticalLength),percentage:ld,scalar:Fa,scale:cd}}function td(e){return Ci(e,{signDisplay:"exceptZero",...go(kn)})}function ed(e){return Mn(e,e.rotationType,kn)}function id(e){const t=Mt(e);return Ci(t,{style:"unit",unitDisplay:"narrow",unit:"degree",signDisplay:t>0?"never":"exceptZero",...go(kn)})}function nd(e){return Mn(e,e.rotationType,kn)}function sd(e){return Ha(e,Wa)}function od(e){return Ha(e,Ya)}function rd(e){return Na(e,Wa)}function ad(e){return Na(e,Ya)}function Ha(e,t){return Mn(te(e,"degrees"),"geographic",$a,t,!1)}function Na(e,t){const i=t.normalize(te(e,"degrees").value,void 0,!1);return Fa(Qt(i),$a)}function ld(e){return Ci(e.value,{style:"percent"})}function cd(e){return Ci(e,{style:"percent",maximumFractionDigits:0})}function Fa(e,t){return Ci(e.value,go(t))}function go(e){return{minimumFractionDigits:e,maximumFractionDigits:e}}function xe({createQuantity:e,sanitize:t}){return(i,n)=>{if(i==null)return null;t&&(i=t(i));const s=Ze(i);return s==null?null:e(s,n)}}function Za(e){return e.replaceAll(/[*^~°º]/g,"")}const hd=e=>{let t=`[-+]?[0-9${e.thousands}]+`;return e.decimal!==""&&(t+=`${e.decimal}[0-9]+`),new RegExp(`^(${t}\\s*)${e.separator}(\\s*${t})$`,"i")},ud=" ",Ba=[];for(const e of[",","\\|","\\s+"])for(const t of["\\.",",",""])for(const i of["",",","\\.",ud,"\\s+"])e!==t&&e!==i&&t!==i&&Ba.push({separator:e,decimal:t,thousands:i,pattern:hd({decimal:t,thousands:i,separator:e})});function pd(e){for(const{decimal:t,thousands:i,pattern:n}of Ba){n.lastIndex=0;const s=e.match(n);if(!s)continue;const o=Ze(rr(s[1],t,i)),r=Ze(rr(s[2],t,i));if(o!=null&&r!=null)return{x:Qt(o),y:Qt(r)}}return null}function rr(e,t,i){let n=e.replaceAll(/[\s+]/g,"");return i!==""&&(n=n.replaceAll(i,"")),t!==""&&(n=n.replaceAll(t,".")),n}function dd(e){if(!e||Ze(e)!=null||!eo())return null;const t=Si(e),i=Ke(t?.latitude),n=Ke(t?.longitude);return n!=null&&i!=null?{latitude:i,longitude:n}:null}function fd(e){return Ke(au(e))}function gd(e){return Ke(lu(e))}function Ke(e){return e!=null?Dt(e,"degrees","geographic"):null}const Wa=new Qs(-180,180),Ya=new Qs(-90,90),Xn=Symbol("dragHandles");let E=class extends Vi{constructor(){super(...arguments),this._focusAbortController=new AbortController,this._transitionInfo=null,this._mode="feedback",this._getFormatters=ys(Jp),this._onHeaderPointerDown=e=>{const t=e.target;t instanceof HTMLElement&&t?.tagName?.toLowerCase()!=="calcite-button"&&(this.removeHandles(Xn),t.setPointerCapture(e.pointerId),this.tooltip.onDragStart(e.clientX,e.clientY),this.addHandles([di(t,"pointermove",({clientX:i,clientY:n})=>{this.tooltip.onDrag(i,n)}),di(t,["pointerup","pointercancel"],i=>{this.removeHandles(Xn),t.releasePointerCapture(e.pointerId),this.tooltip.onDragEnd()}),di(t,"touchstart",i=>i.preventDefault())],Xn))},this._onDiscard=()=>{this.destroyed||(this.tooltip.emit("discard"),this.info.clearInputValues(),this.exitInputMode())},this._onCommit=(e,t)=>{if(this.destroyed)return;if(this.tooltip.emit("commit",{type:t}),t==="commit-and-exit")return void this.exitInputMode();if(t==="commit-on-blur")return;const i=this._getFocusableElements(),n=i.length,s=i.indexOf(e);if(s===-1)return void this.exitInputMode();const o=((s+(t==="commit-and-next"?1:-1))%n+n)%n;Zi(i.at(o))},this._onKeyDown=e=>{switch(e.code){case $e.next:return this._onNextKey(e);case $e.discard:return e.stopPropagation(),this._onDiscard()}}}get mode(){return this._mode}get _displayUnits(){const{displayUnits:e}=this.info.sketchOptions.values,t=sr(this.tooltip.view);return{length:e.length??t,verticalLength:e.verticalLength??t,area:e.area??t}}get _inputUnitInfos(){const e=this._messagesUnits,t=l=>({unit:l,abbreviation:ih(e,l,"abbr")}),{inputUnits:i}=this.info.sketchOptions.values,n=sr(this.tooltip.view),s=i.length??n,o=i.verticalLength??n,r=i.area??n;return{length:t(sc(s)),verticalLength:t(oc(o)),area:t(rc(r)),angle:t("degrees")}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,sketchOptions:this.info.sketchOptions,onCommit:this._onCommit,onDiscard:this._onDiscard}}render(){const{visibleElements:e}=this.info.sketchOptions.tooltips,t=this._renderedContent,i=this._renderedActions,n=this._renderedHelpMessage,s=t.length>0,o=s||!!n,r=this.mode==="input";return v("div",{class:Oh(Cp,r&&Rp),onkeydown:this._onKeyDown,tabIndex:-1},r&&o&&e.header?v("div",{class:Vp,"data-testid":"tooltip-header",key:"header",onpointerdown:this._onHeaderPointerDown},v("calcite-button",{appearance:"transparent","data-testid":"tooltip-back-button",iconFlipRtl:"both",iconStart:"chevron-left",key:"discard-button",kind:"neutral",onclick:this._onDiscard,scale:"s",tabIndex:-1}),i.length>0?v(wt,null,v("div",{class:Ap,key:"spacer"}),v("div",{class:nr,key:"actions"},i)):null):null,s?v("div",{class:Op,key:"content"},...t):null,n)}destroy(){this._focusAbortController.abort(),this._transitionInfo?.transition.skipTransition()}_renderActions(){return null}loadDependencies(){return Js({button:()=>Lt(()=>import("./calcite-button-Cm9_TJei-CW2FD2Xf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),icon:()=>Lt(()=>import("./calcite-icon-laqhdRBY-CcSx2g4c.js"),__vite__mapDeps([18,15,1,2,3,4,6,13]),import.meta.url),input:()=>Lt(()=>import("./calcite-input-BKRd7MCS-DmQD4QYo.js"),__vite__mapDeps([19,20,1,2,3,4,6,5,7,12,8,9,10,11,13,14,15]),import.meta.url)})}async enterInputMode(e,t){try{await this._transitionTo("input",t),await this._focusField(e)}catch(i){ko(i)}}async exitInputMode({focusOnView:e=!0}={}){try{const{container:t,info:i}=this;i.clearInputValues();const n=e?t?.closest(".esri-view")?.querySelector(".esri-view-surface"):null;await this._transitionTo("feedback"),n instanceof HTMLElement&&n.focus()}catch(t){ko(t)}}_onNextKey(e){const t=this._getFocusableElements(),i=t.at(0),n=t.at(-1);i&&n&&(e.shiftKey?document.activeElement===i&&(e.preventDefault(),e.stopPropagation(),Zi(n)):document.activeElement===n&&(e.preventDefault(),e.stopPropagation(),Zi(i)))}get _renderedContent(){return ar(this._renderContent())}get _renderedActions(){return ar(this._renderActions())}get _renderedHelpMessage(){const{sketchOptions:e,visibleElements:t}=this.info;if(!t.helpMessage)return null;const i=e.tooltips.helpMessage??this._defaultHelpMessage;if(!i)return null;const n=e.tooltips.helpMessageIcon??"information";return v("div",{class:Ip,key:"help-message"},n?v("calcite-icon",{class:Gp,icon:n,scale:"s"}):null,v("div",{class:Lp},i))}get _defaultHelpMessage(){const{helpMessage:e,viewType:t}=this.info;if(e==null)return null;const i=t==="3d"?"helpMessages3d":"helpMessages2d";return this._messagesTooltip?.sketch?.[i]?.[e]}async _focusField(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const{signal:t}=this._focusAbortController;await this._waitForInputs(),ql(t);const i=this._getFocusableInputs(),n=e?i.find(s=>s.getAttribute("data-field-name")===e):i.at(0);await Zi(n)}async _transitionTo(e,t){if(this._mode===e&&!this._transitionInfo)return;if(this._transitionInfo?.mode===e)return this._transitionInfo.transition.finished;this._transitionInfo?.transition.skipTransition();const i=async()=>{this.destroyed||(this._mode=e,await Ro(),this.destroyed||(this.renderNow(),await Ro(),this.destroyed||t?.()))};if(!this.domNode?.firstChild||!document.startViewTransition||qc())return void await i();this.autoRenderingEnabled=!1;const n=this._transitionInfo={transition:document.startViewTransition(async()=>{this.destroyed||n!==this._transitionInfo||(this.autoRenderingEnabled=!0,await i())}),mode:e};try{await n.transition.finished}finally{n===this._transitionInfo&&(this._transitionInfo=null)}}async _waitForInputs(){const e=()=>Array.from(this.domNode?.querySelectorAll("calcite-input")??[]);for(;e().length===0;)await jl(md);await Rr()}_getFocusableInputs(){return Array.from(this.domNode?.querySelectorAll("calcite-input:not([read-only]):not([disabled])")??[])}_getFocusableElements(){const e=this.domNode?.querySelector(`.${za}`);return[...Array.from(e?.querySelectorAll(`.${nr} calcite-button:not([disabled])`)??[]),...this._getFocusableInputs()]}};async function Zi(e){await e?.setFocus()}function ar(e){return(Array.isArray(e)?e:[e]).flat(10).filter(t=>!!t)}a([cs("esri/core/t9n/Units"),c()],E.prototype,"_messagesUnits",void 0),a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],E.prototype,"_messagesTooltip",void 0),a([c()],E.prototype,"info",void 0),a([c()],E.prototype,"tooltip",void 0),a([c()],E.prototype,"_mode",void 0),a([c()],E.prototype,"mode",null),a([c()],E.prototype,"_displayUnits",null),a([c()],E.prototype,"_inputUnitInfos",null),a([c()],E.prototype,"_formatters",null),a([c()],E.prototype,"fieldContext",null),a([c()],E.prototype,"_renderedContent",null),a([c()],E.prototype,"_renderedActions",null),a([c()],E.prototype,"_renderedHelpMessage",null),a([c()],E.prototype,"_defaultHelpMessage",null),E=a([x("esri.views.interactive.tooltip.content.TooltipContent")],E);const md=20;let _s=class extends E{_renderContent(){const{area:e,radius:t,xSize:i,ySize:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.radius&&t!=null?v(U,{title:o.radius,value:r.length(t)}):null,s.size&&i!=null&&n!=null?v(U,{title:o.size,value:v(Yt,{left:r.length(i),right:r.length(n)})}):null,s.area?v(U,{title:o.area,value:r.area(e)}):null)}};_s=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],_s);const ct=`${Q}-editable-field`,st={base:ct,inputMode:`${ct}--input`,feedbackMode:`${ct}--feedback`,readOnly:`${ct}--read-only`,locked:`${ct}--locked`,title:`${ct}__title`,value:`${ct}__value`,valueContent:`${ct}__value__content`,valueContentReadOnly:`${ct}__value__content--read-only`,lockIcon:`${ct}__lock-icon`,input:`${ct}__input`,inputSuffix:`${ct}__input-suffix`,button:`${ct}__button`},qn={lock:"lock",unlock:"unlock"};let yt=class extends Vi{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=e=>{this._lock=e},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=e=>{e.key===$e.discard&&this.mode==="input"&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=e=>{const t=this._input;if(t)switch(e.key){case $e.commit:return this.field.onCommit("commit-and-exit",t,this.context);case $e.next:{e.preventDefault(),e.stopPropagation();const i=e.shiftKey?"commit-and-previous":"commit-and-next";return this.field.onCommit(i,t,this.context)}}},this._onInput=e=>{this.field.onInput(e.target.value)},this._onInputBlur=e=>{const t=this._input;t&&e.relatedTarget!==this._lock&&this.field.onCommit("commit-on-blur",t,this.context)},this._selectText=()=>{const e=()=>{this._input===document.activeElement&&this._input?.selectText()};e(),Rr().then(e)},this._onAfterCreate=e=>{this._input=e,e.addEventListener("paste",this._onPaste),e.addEventListener("beforeinput",this._onBeforeInput)},this._onAfterRemoved=e=>{e.removeEventListener("paste",this._onPaste),e.removeEventListener("beforeinput",this._onBeforeInput)},this._onPaste=e=>{const t=e.clipboardData?.getData("text");t&&this.field.parse(t,this.context)!=null&&(e.stopPropagation(),this.field.onInput(t))},this._onBeforeInput=e=>{(e.inputType==="historyUndo"||e.inputType==="historyRedo")&&!this.field.dirty&&e.preventDefault()}}initialize(){this.addHandles($(()=>this._rawDisplayValue,()=>{const{committed:e,inputValue:t}=this.field;e||t||this._input!==document.activeElement||this._selectText()}))}loadDependencies(){return Js({button:()=>Lt(()=>import("./calcite-button-Cm9_TJei-CW2FD2Xf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),icon:()=>Lt(()=>import("./calcite-icon-laqhdRBY-CcSx2g4c.js"),__vite__mapDeps([18,15,1,2,3,4,6,13]),import.meta.url),input:()=>Lt(()=>import("./calcite-input-BKRd7MCS-DmQD4QYo.js"),__vite__mapDeps([19,20,1,2,3,4,6,5,7,12,8,9,10,11,13,14,15]),import.meta.url)})}render(){const{field:e,mode:t}=this,i=t==="input",{locked:n,readOnly:s}=e;return v("div",{class:this.classes({[st.base]:!0,[st.feedbackMode]:t==="feedback",[st.inputMode]:t==="input",[st.locked]:n,[st.readOnly]:s})},v("div",{class:st.title,key:"title"},this._title),v("div",{class:st.value,key:"value",onkeydown:this._onKeyDown},i?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||lr}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){const{title:e}=this.field;return typeof e=="string"?e:e(this.context)}_renderValueFeedbackMode(){return v(wt,null,v("div",{class:st.valueContent,key:"value-feedback"},this._formattedValue),this.field.locked&&this.mode!=="input"?v("calcite-icon",{class:st.lockIcon,icon:qn.lock,key:"icon",scale:"s"}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return v("div",{class:this.classes(st.valueContent,st.valueContentReadOnly),key:"value-read-only"},this._formattedValue)}_renderValueWritable(){const{field:e}=this,{name:t,invalid:i,locked:n}=e,s=this.context?.messages.sketch??{},o=n?s.unlockConstraint:s.lockConstraint;return v(wt,null,v("calcite-input",{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:st.input,"data-field-name":t,"data-testid":`tooltip-field-${t}`,key:"input",onblur:this._onInputBlur,onfocus:this._selectText,onkeydown:this._onInputKeyDown,scale:"s",status:i?"invalid":"idle",type:"text",value:this._rawDisplayValue??lr,onCalciteInputInput:this._onInput}),v("div",{class:st.inputSuffix,key:"suffix"},this._suffix),e.lockable?v("calcite-button",{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:"center",appearance:"transparent",class:st.button,"data-testid":`tooltip-field-${t}-lock`,iconStart:n?qn.lock:qn.unlock,key:"lock",kind:"neutral",label:o,onclick:this._onLockClick,scale:"s",tabIndex:-1,title:o}):v("div",{key:"lock-empty"}))}};a([c()],yt.prototype,"field",void 0),a([c()],yt.prototype,"context",void 0),a([c()],yt.prototype,"mode",void 0),a([c()],yt.prototype,"_input",void 0),a([c()],yt.prototype,"_lock",void 0),a([c()],yt.prototype,"_formattedValue",null),a([c()],yt.prototype,"_rawDisplayValue",null),a([c()],yt.prototype,"_suffix",null),a([c()],yt.prototype,"_title",null),yt=a([x("esri.views.interactive.tooltip.components.TooltipEditableField")],yt);const lr="—";function ee(e){const t=e.fields.filter(i=>i?.visible===!0);return t.length===0?null:v(wt,null,t.map(i=>v(yt,{context:e.context,field:i,key:i.id,mode:e.mode})))}let vs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};vs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],vs);let xs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{elevation:n,visibleElements:s}=t;return v(ee,{context:e,fields:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0,s.elevation?n:void 0],mode:i})}};xs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],xs);const jn={absolute:"absolute-direction",relative:"relative-direction"};let Ee=class extends Vi{constructor(e){super(e),this.visibleElements={}}render(){return v("div",{class:za},this._isElementVisible("direction")?v(yd,{messages:this.messages,sketchOptions:this.sketchOptions}):null)}loadDependencies(){return Js({button:()=>Lt(()=>import("./calcite-button-Cm9_TJei-CW2FD2Xf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),dropdown:()=>Lt(()=>import("./calcite-dropdown-CLrG397W-BUH-uj2q.js"),__vite__mapDeps([21,1,2,3,4,6,22,23,17,7,12,10,13,24]),import.meta.url),"dropdown-item":()=>Lt(()=>import("./calcite-dropdown-item-DpLfv4A0-7PxMAxbJ.js"),__vite__mapDeps([25,1,2,3,4,6,10,9,7,26,15,13]),import.meta.url),"dropdown-group":()=>Lt(()=>import("./calcite-dropdown-group-0sIPwaDd-CQ-6-G1K.js"),__vite__mapDeps([27,1,2,3,4,13,26]),import.meta.url)})}_isElementVisible(e){return this.visibleElements?.[e]??this.sketchOptions.tooltips.visibleElements[e]}};function yd(e){const{directionMode:t}=e.sketchOptions.values,i=e.messages?.sketch,n=i?.directionModeSelect?.title,s="absolute",o="relative";return v("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",widthScale:"s",onCalciteDropdownSelect:r=>{const l=r.target.selectedItems?.[0]?.getAttribute("data-mode");e.sketchOptions.values.directionMode=l??"absolute"}},v("calcite-button",{alignment:"end",appearance:"transparent",iconStart:jn[t],kind:"neutral",label:n,scale:"s",slot:"trigger",title:n}),v("calcite-dropdown-group",{selectionMode:"single"},v("calcite-dropdown-item",{"data-mode":o,"data-testid":"tooltip-direction-mode-relative",iconStart:jn.relative,key:"relative",selected:t===o},i?.directionModeSelect?.relative),v("calcite-dropdown-item",{"data-mode":s,"data-testid":"tooltip-direction-mode-absolute",iconStart:jn.absolute,key:"absolute",selected:t===s},i?.directionModeSelect?.absolute)))}a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],Ee.prototype,"messages",void 0),a([c()],Ee.prototype,"sketchOptions",void 0),a([c()],Ee.prototype,"visibleElements",void 0),Ee=a([x("esri.views.interactive.tooltip.components.DrawHeaderActions")],Ee);let bs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.area?t.area:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};bs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],bs);let ws=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.totalLength?t.totalLength:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};ws=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],ws);let Ts=class extends E{_renderContent(){const{area:e,xSize:t,ySize:i,visibleElements:n}=this.info,s=this._messagesTooltip.sketch,o=this._formatters;return v(wt,null,n.size&&t!=null&&i!=null?v(U,{title:s.size,value:v(Yt,{left:o.length(t),right:o.length(i)})}):null,n.area?v(U,{title:s.area,value:o.area(e)}):null)}};Ts=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],Ts);let Es=class extends E{_renderContent(){const{angle:e,visibleElements:t}=this.info,i=this._messagesTooltip.sketch;return v(wt,null,t.rotation?v(U,{title:i.rotation,value:this._formatters.angleRelative(e)}):null)}};Es=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentRotate")],Es);let Ss=class extends E{_renderContent(){const e=this.info,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.size?v(U,{title:i.size,value:v(Yt,{left:n.length(e.xSize),right:n.length(e.ySize)})}):null,t.scale?v(U,{title:i.scale,value:v(Yt,{left:n.scale(e.xScale),right:n.scale(e.yScale)})}):null)}};Ss=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentScale")],Ss);let Ps=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0],mode:i})}};Ps=a([x("esri.views.interactive.tooltip.content.TooltipContentMovePoint")],Ps);let Ms=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.distance?t.distance:void 0,n.area?t.area:void 0,n.totalLength?t.totalLength:void 0],mode:i})}};Ms=a([x("esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset")],Ms);let ks=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.area&&t.geometryType==="polygon"?t.area:null,n.totalLength&&t.geometryType==="polyline"?t.totalLength:null],mode:i})}};ks=a([x("esri.views.interactive.tooltip.content.TooltipContentSelectedVertex")],ks);let Cs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};Cs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformMesh")],Cs);let Rs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.size?t.size:void 0],mode:i})}};Rs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformPoint")],Rs);let Vs=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v(U,{title:i.distance,value:n.length(e.distance)}):null)}};Vs=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslate")],Vs);let As=class extends E{_renderContent(){const{distance:e,elevation:t,area:i,totalLength:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.distance?v(U,{title:o.distance,value:r.length(e)}):null,s.elevation&&t?.actual!=null?v(U,{title:o.elevation,value:r.verticalLength(t.actual)}):null,s.area&&i!=null?v(U,{title:o.area,value:r.area(i)}):null,s.totalLength&&n!=null?v(U,{title:o.totalLength,value:r.length(n)}):null)}};As=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],As);let Os=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v(U,{title:i.distance,value:n.length(e.distance)}):null)}};Os=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateXY")],Os);let Is=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch;return v(wt,null,t.distance?v(U,{title:i.distance,value:this._formatters.verticalLengthRelative(e.distance)}):null)}};Is=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateZ")],Is);function _d(e,t){if(t==null)return null;const i=document.createElement("div");switch(t.type){case"draw-point":return new xs({tooltip:e,info:t,container:i});case"draw-polygon":return new bs({tooltip:e,info:t,container:i});case"draw-polyline":return new ws({tooltip:e,info:t,container:i});case"draw-mesh":return new vs({tooltip:e,info:t,container:i});case"draw-rectangle":return new Ts({tooltip:e,info:t,container:i});case"draw-circle":return new _s({tooltip:e,info:t,container:i});case"extent-rotate":return new Es({tooltip:e,info:t,container:i});case"extent-scale":return new Ss({tooltip:e,info:t,container:i});case"move-point":return new Ps({tooltip:e,info:t,container:i});case"selected-vertex":return new ks({tooltip:e,info:t,container:i});case"transform-point":return new Rs({tooltip:e,info:t,container:i});case"transform-mesh":return new Cs({tooltip:e,info:t,container:i});case"translate":return new Vs({tooltip:e,info:t,container:i});case"translate-vertex":return new As({tooltip:e,info:t,container:i});case"translate-z":return new Is({tooltip:e,info:t,container:i});case"translate-xy":return new Os({tooltip:e,info:t,container:i});case"reshape-edge-offset":return new Ms({tooltip:e,info:t,container:i})}}const ci={base:`${Q}`,ltr:`${Q}--ltr`,rtl:`${Q}--rtl`,debug:`${Q}--debug`},vd=20,xd=16,bd="bottom-end";let F=class extends Ce.EventedAccessor{constructor(e){super(e),this.info=null,this.options=null,this.position=null,this.content=null,this._focused=!1,this.outerContainer=document.createElement("div"),this.debug=!1,this._lastPosition=null,this._rtl=!1,this._prevXY=[0,0]}initialize(){const{outerContainer:e}=this;this.addHandles([$(()=>this.view.overlay?.surface,t=>{e.remove(),t?.appendChild(e),this._rtl=Vh(t)},ke),$(()=>this.info,(t,i)=>{if(this.content!=null&&t!=null&&i!=null&&t.type===i.type)this.content.info=t;else{dt(this.content);const n=_d(this,t);n?(this.content=n,n.container&&e.appendChild(n.container),this.exitInputMode()):this.content=null}},ke),$(()=>({container:this.outerContainer,style:this._outerContainerStyle}),({container:t,style:i})=>{Object.assign(t.style,i)},es),$(()=>({outerContainer:this.outerContainer,placement:this.effectivePlacement,effectiveOffset:this._effectiveOffset,rtl:this._rtl,debug:this.debug}),({outerContainer:t,placement:i,effectiveOffset:n,rtl:s,debug:o})=>{const{classList:r}=t;r.add(ci.base),r.toggle(ci.rtl,s),r.toggle(ci.ltr,!s),r.toggle(ci.debug,o),this.outerContainer.style.setProperty("--offset",`${n}px`),Ah(t),Ed(t,i)},es),Il(()=>this.mode==="feedback",()=>{this.position=null,this._clearOverride("effectivePlacement")},Us),di(this.outerContainer,"paste",t=>{this.emit("paste",t)}),di(this.outerContainer,["focusin","focusout"],()=>{setTimeout(()=>{this._focused=this.content?.container?.contains(document.activeElement)??!1})})])}destroy(){this.info=null,this.content=dt(this.content),this.outerContainer.remove()}get mode(){return this.content?.mode??"feedback"}get focused(){return this._focused}get visible(){return this._outerContainerStyle.display!=="none"}get contentContainer(){return this.content?.container}get effectivePlacement(){const e=this.options?.placement;return e==="auto"?"bottom-end":e??bd}get _screenPoint(){const{inputManager:e}=this.view;return e?.multiTouchActive?null:e?.latestPointerLocation}get _effectiveOffset(){return this.options?.offset??vd}get _outerContainerStyle(){const e=this.position??this._screenPoint;return this._lastPosition=So(e),e!=null&&this.content!=null?{display:"block",transform:`translate(${Math.round(e.x)}px, ${Math.round(e.y)}px)`}:{display:"none",transform:"none"}}clear(){this.info=null}async enterInputMode(e){const t=this.position??this._lastPosition??this._screenPoint,i=this.position=So(t),{effectivePlacement:n}=this;this._override("effectivePlacement",n);const s=()=>{i&&(this.position=wd(this.contentContainer,i,this._effectiveOffset,this.view),Object.assign(this.outerContainer.style,this._outerContainerStyle))};await this.content?.enterInputMode(e,s)}async exitInputMode(e){await this.content?.exitInputMode(e)}onDragStart(e,t){this._prevXY=[e,t]}onDrag(e,t){const i=e-this._prevXY[0],n=t-this._prevXY[1];this._prevXY=[e,t];const{position:s}=this;if(s){const{view:o}=this,r=e-o.position[0],l=t-o.position[1];if(r<0||r>o.width||l<0||l>o.height-xd)return;this.position=$s(s.x+i,s.y+n)}}onDragEnd(){this._prevXY=[0,0]}};function wd(e,t,i,n){if(!e||!n.container)return t;const s=e.getBoundingClientRect(),{left:o,top:r}=n.container.getBoundingClientRect();let{x:l,y:h}=t;const u=s.left-o-i;u<0&&(l-=u);const p=s.right-o+i-n.width;p>0&&(l-=p);const d=s.top-r-i;d<0&&(h-=d);const m=s.bottom-r+i-n.height;return m>0&&(h-=m),$s(l,h)}a([c({nonNullable:!0})],F.prototype,"view",void 0),a([c()],F.prototype,"info",void 0),a([c()],F.prototype,"options",void 0),a([c()],F.prototype,"position",void 0),a([c()],F.prototype,"content",void 0),a([c({readOnly:!0})],F.prototype,"mode",null),a([c()],F.prototype,"_focused",void 0),a([c({readOnly:!0})],F.prototype,"focused",null),a([c({readOnly:!0})],F.prototype,"outerContainer",void 0),a([c({readOnly:!0})],F.prototype,"contentContainer",null),a([c({readOnly:!0})],F.prototype,"effectivePlacement",null),a([c()],F.prototype,"debug",void 0),a([c()],F.prototype,"_lastPosition",void 0),a([c()],F.prototype,"_screenPoint",null),a([c()],F.prototype,"_rtl",void 0),a([c()],F.prototype,"_effectiveOffset",null),a([c()],F.prototype,"_outerContainerStyle",null),F=a([x("esri.views.interactive.Tooltip")],F);const Td=["top","bottom","leading","trailing"].flatMap(e=>[Ji(`${e}-start`),Ji(e),Ji(`${e}-end`)]);function Ji(e){return`${ci.base}--${e}`}function Ed({classList:e},t){Td.forEach(i=>e.remove(i)),e.add(Ji(t))}const Sd=F;function Pd(e){const t=new Sd(e());return t.addHandles($(()=>e(),({view:i,options:n,info:s})=>{t.view=i,n!==void 0&&(t.options=n),s!==void 0&&(t.info=s)})),t}function Md(e,t){const i=Rh(t.vertexSpace),{scale:n,orientation:s}=e,{transform:o}=t,r=kd(o);i&&r!=null?(s.actual=Dt(r,"degrees","arithmetic"),s.visible=!0):(s.actual=null,s.visible=!1),i?(n.actual=Qt(Vd(o)),n.visible=!0):(n.actual=null,n.visible=!1)}function kd(e){if(!e)return 0;const t=Cd(e.rotationAxis);return t!=null?t*e.rotationAngle:null}function Cd(e){return We(e,Hs)?1:We(e,Rd)?-1:null}const Rd=rs(g(),Hs);function Vd(e){return e?Math.max(...e.scale):1}function Ad(e,t){return!(e.type!=="key-down"||e.key!==$e.enterInputMode||!t||!Od(t.info))&&(t.enterInputMode(),e.preventDefault(),e.stopPropagation(),!0)}function Od(e){const t=e?.sketchOptions;if(!t)return!1;const{inputEnabled:i,visibleElements:n}=t.tooltips;return i&&e.editableFields.some(({name:s})=>s==="x"||s==="y"?n.coordinates:n[s])===!0}function Id(e,t,i){if(!t||!("geographic"in t))return;const n=e.clipboardData?.getData("text");if(!n)return;const s=o=>{e.stopPropagation(),e.preventDefault(),o()};if(t.geographic){const o=dd(n);o&&s(()=>{t.longitude.applyValue(o.longitude),t.latitude.applyValue(o.latitude)})}else{const o=pd(n);o&&s(()=>{t.x.applyValue(o.x),t.y.applyValue(o.y)})}}let ot=class extends tt{constructor(e){super(e),this.helpMessage=void 0,this.viewType=void 0}get visibleElements(){return this.sketchOptions.tooltips.visibleElements}get allFields(){return[]}get editableFields(){return this.allFields.filter(e=>e.visible&&!e.readOnly)}clearInputValues(){this.allFields.forEach(e=>e.clearInputValue())}};a([c()],ot.prototype,"sketchOptions",void 0),a([c()],ot.prototype,"visibleElements",null),a([c()],ot.prototype,"helpMessage",void 0),a([c()],ot.prototype,"viewType",void 0),a([c()],ot.prototype,"allFields",null),a([c()],ot.prototype,"editableFields",null),ot=a([x("esri.views.interactive.tooltip.infos.SketchTooltipInfo")],ot);let Zt=class extends ot{constructor(e){super(e),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=Ye}get allFields(){return[]}};a([c()],Zt.prototype,"type",void 0),a([c()],Zt.prototype,"radius",void 0),a([c()],Zt.prototype,"xSize",void 0),a([c()],Zt.prototype,"ySize",void 0),a([c()],Zt.prototype,"area",void 0),a([c()],Zt.prototype,"allFields",null),Zt=a([x("esri.views.interactive.tooltip.infos.DrawCircleTooltipInfo")],Zt);let M=class extends tt{constructor(e){super(e),this.actual=null,this.lockable=!0,this.id=Ih(),this.inputValue=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0}get committed(){return this.lockable?this._get("committed"):null}set committed(e){this.lockable&&this._set("committed",e)}get dirty(){return this.inputValue!=null}get locked(){return this.lockable&&this.committed!=null}onInput(e){this.inputValue=e}onCommit(e,t,i){this.lockable?this._onCommitLockable(e,i):this._onCommitNonLockable(i),this.invalid&&e==="commit-and-exit"||i.onCommit(t,e)}_onCommitLockable(e,t){const{inputValue:i,locked:n}=this;n&&Bi(i)?this.unlock():(e==="commit-and-exit"&&!n||i!=null)&&this._parseInputAndLock(t)}_onCommitNonLockable(e){const{inputValue:t}=this;Bi(t)?this.setActual(null):t!=null&&this._parseInputAndSetActual(e)}applyValue(e){this.lockable?this.lock(e):this.setActual(e)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(e){this.actual=e,this.clearInputValue()}lock(e){this.lockable&&(this.committed=e??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(e){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(e))}getSuffix(e){const{suffix:t}=this;return typeof t=="function"?t(e):t}getFormattedValue(e){const{actual:t,committed:i,format:n}=this;return i!=null?n(i,e):t!=null?n(t,e):null}getRawDisplayValue(e){const{actual:t,committed:i,inputValue:n}=this;return n??(this.lockable&&i!=null?this.formatForInputMode(i,e):t!=null?this.formatForInputMode(t,e):null)}_parseInputAndSetActual(e){const{inputValue:t}=this;if(t==null||Bi(t))return this.setActual(null);const i=this.parse(t,e);i!=null?this.setActual(i):this.invalid=!0}_parseInputAndLock(e){const{inputValue:t,actual:i}=this;if(Bi(t))return this.unlock();if(t==null)return this.lock(i);const n=this.parse(t,e);n!=null?this.lock(n):this.invalid=!0}};function Bi(e){return e!=null&&e.trim()===""}a([c()],M.prototype,"actual",void 0),a([c()],M.prototype,"committed",null),a([c()],M.prototype,"dirty",null),a([c()],M.prototype,"format",void 0),a([c()],M.prototype,"formatForInputMode",void 0),a([c()],M.prototype,"lockable",void 0),a([c()],M.prototype,"locked",null),a([c()],M.prototype,"id",void 0),a([c()],M.prototype,"inputValue",void 0),a([c()],M.prototype,"name",void 0),a([c()],M.prototype,"parse",void 0),a([c()],M.prototype,"readOnly",void 0),a([c()],M.prototype,"suffix",void 0),a([c()],M.prototype,"title",void 0),a([c()],M.prototype,"visible",void 0),a([c()],M.prototype,"invalid",void 0),a([c()],M.prototype,"unlockOnVertexPlacement",void 0),M=a([x("esri.views.interactive.tooltip.fields.TooltipField")],M);let tn=class extends M{constructor(e){super(e),this.showAsZ=!1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.verticalLength.unit;return{name:"elevation",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.verticalLength(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.verticalLength.abbreviation,title:i=>i.messages.sketch[this.showAsZ?"z":"elevation"],unlockOnVertexPlacement:!1,...e}}};a([c()],tn.prototype,"showAsZ",void 0),tn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldElevation")],tn);let en=class extends M{constructor(e){super(e),this.precision=1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.angle.unit;return{name:"orientation",actual:null,parse:xe({createQuantity:(i,n)=>Dt(i,t(n),"geographic"),sanitize:Za}),format:i=>{const n=gs(i);return Mn(n,"geographic",this.precision)},formatForInputMode:(i,n)=>{const s=gs(i);return n.formatters.scalar(s)},suffix:i=>i.inputUnitInfos.angle.abbreviation,title:i=>i.messages.sketch.orientation,...e}}};a([c()],en.prototype,"precision",void 0),en=a([x("esri.views.interactive.tooltip.fields.TooltipFieldOrientation")],en);let Kn=class extends M{constructor(e){super(e),this.precision=null}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.length.unit;return{name:"size",actual:null,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.size,...e}}};a([c()],Kn.prototype,"precision",void 0),Kn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldSize")],Kn);function Xa(e){const t=n=>n.inputUnitInfos.angle.unit,i=n=>n.sketchOptions.values.effectiveDirectionMode;return new M({name:"direction",actual:qs,parse:xe({createQuantity:(n,s)=>Dt(n,t(s),"geographic"),sanitize:Za}),format:(n,s)=>{const o=i(s),r=un(n,o);switch(o){case A.Absolute:return s.formatters.direction(r);case A.Relative:return s.formatters.directionRelative(r);case A.RelativeBilateral:return s.formatters.directionRelativeBilateral(r)}},formatForInputMode:(n,s)=>{const o=un(n,i(s));return s.formatters.scalar(te(o,t(s)))},suffix:n=>n.inputUnitInfos.angle.abbreviation,title:n=>{const s=i(n),{absolute:o,relative:r}=n.messages.sketch.direction;switch(s){case A.Absolute:return o;case A.Relative:case A.RelativeBilateral:return r}},...e})}function qa(e){const t=i=>i.inputUnitInfos.length.unit;return new M({name:"distance",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(Math.max(i,0),t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.distance,...e})}function Ld(e){return qa({format:(t,i)=>i.formatters.totalLength(t),title:t=>t.messages.sketch.totalLength,readOnly:!0,...e})}function ja(e){return qa({...e})}function Gd(e){return new tn(e)}function Dd(e){return new en(e)}function zd(e){return mo("scale",{name:"scale",actual:null,parse:xe({createQuantity:t=>Qt(Math.abs(t))}),...e})}function Ud(e){const t=i=>i.inputUnitInfos.area.unit;return new M({name:"area",actual:Ye,parse:xe({createQuantity:(i,n)=>vn(i,t(n))}),format:(i,n)=>n.formatters.area(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.area.abbreviation,title:i=>i.messages.sketch.area,readOnly:!0,...e})}function $d(e){return new M({name:"x",actual:qs,parse:fd,format:(t,i)=>i.formatters.longitudeDecimalDegrees(t),formatForInputMode:t=>rd(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.longitude,...e})}function Hd(e){return new M({name:"y",actual:qs,parse:gd,format:(t,i)=>i.formatters.latitudeDecimalDegrees(t),formatForInputMode:t=>ad(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.latitude,...e})}function Nd(e){return mo("x",{name:"x",...e})}function Fd(e){return mo("y",{name:"y",...e})}function mo(e,t){return new M({actual:Qt(0),parse:xe({createQuantity:i=>Qt(i)}),format:(i,n)=>n.formatters.scalar(i),formatForInputMode:(i,n)=>n.formatters.scalar(i),title:i=>i.messages.sketch[e],...t})}function Zd(e){return Br(e)||Zs(e)}function yo(e,t,i,...n){return Br(e)?t.apply(void 0,n):Zs(e)?i.apply(void 0,n):null}const Cn=e=>{let t=class extends e{constructor(){super(...arguments),this.longitude=$d(),this.latitude=Hd(),this.x=Nd(),this.y=Fd(),this.elevation=Gd(),this.geographic=!1}get effectiveX(){return this.geographic?this.longitude:this.x}get effectiveY(){return this.geographic?this.latitude:this.y}get key(){return{longitude:this.longitude.actual,latitude:this.latitude.actual,x:this.x.actual,y:this.y.actual,elevation:this.elevation.actual,geographic:this.geographic}}setLocationFromPoint(i,n=i?.spatialReference){if(this.geographic=!!n&&Zd(n),i==null)return this._setActualLonLat(null,null),void this._setActualXY(null,null);if(this.geographic){const s=ac(i,Bd);this._setActualLonLat(Ke(s?.[0]),Ke(s?.[1]))}else this._setActualXY(Qt(i.x),Qt(i.y))}_setActualLonLat(i,n){this.longitude.actual=i,this.latitude.actual=n}_setActualXY(i,n){this.x.actual=i,this.y.actual=n}};return a([c()],t.prototype,"geographic",void 0),a([c()],t.prototype,"effectiveX",null),a([c()],t.prototype,"effectiveY",null),a([c()],t.prototype,"key",null),t=a([x("esri.views.interactive.tooltip.infos.TooltipInfoWithCoordinates")],t),t},Bd=[0,0];let hi=class extends Cn(ot){constructor(e){super(e),this.type="draw-mesh",this.orientation=Dd({lockable:!1}),this.scale=zd({lockable:!1})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,this.orientation,this.scale]}};a([c()],hi.prototype,"helpMessage",void 0),a([c()],hi.prototype,"allFields",null),hi=a([x("esri.views.interactive.tooltip.infos.DrawMeshTooltipInfo")],hi);let ui=class extends Cn(ot){constructor(e){super(e),this.type="draw-point"}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation]}};a([c()],ui.prototype,"helpMessage",void 0),a([c()],ui.prototype,"allFields",null),ui=a([x("esri.views.interactive.tooltip.infos.DrawPointTooltipInfo")],ui);let Oe=class extends Cn(ot){constructor(e){super(e),this.type="draw-polygon",this.direction=Xa(),this.distance=ja(),this.area=Ud(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.area]}};a([c()],Oe.prototype,"xyMode",void 0),a([c()],Oe.prototype,"helpMessage",void 0),a([c()],Oe.prototype,"allFields",null),Oe=a([x("esri.views.interactive.tooltip.infos.DrawPolygonTooltipInfo")],Oe);let Ie=class extends Cn(ot){constructor(e){super(e),this.type="draw-polyline",this.direction=Xa(),this.distance=ja(),this.totalLength=Ld(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.totalLength]}};a([c()],Ie.prototype,"helpMessage",void 0),a([c()],Ie.prototype,"xyMode",void 0),a([c()],Ie.prototype,"allFields",null),Ie=a([x("esri.views.interactive.tooltip.infos.DrawPolylineTooltipInfo")],Ie);let re=class extends ot{constructor(e){super(e),this.type="draw-rectangle",this.xSize=Kt,this.ySize=Kt,this.area=Ye}get allFields(){return[]}};a([c()],re.prototype,"type",void 0),a([c()],re.prototype,"xSize",void 0),a([c()],re.prototype,"ySize",void 0),a([c()],re.prototype,"area",void 0),a([c()],re.prototype,"allFields",null),re=a([x("esri.views.interactive.tooltip.infos.DrawRectangleTooltipInfo")],re);function _o(e){return fc(e)?gc(e)||Zs(e)||mc(e)||yc(e)?Dh:e:zh(e)}function Wd(e,t=vo()){return Yd(e,t,!1)}function Yd(e,t,i=e.hasZ){const n=_o(e.spatialReference),s=_c(n);if(s==null)return null;const o=(l,h)=>!(h.length<2)&&(N(l,h[0],h[1],i&&h[2]||0),!0);let r=0;for(const l of e.rings){const h=l.length;if(h<3)continue;const{positionsWorldCoords:u}=t;for(;u.length{const h=Vn(e).mode,u=s[l].elevation;h==="relative-to-ground"||h==="relative-to-scene"||h==="on-the-ground"?u.lock(bo(e)):u.unlock()},r=l=>{if(t){const h=s[l].direction;h.committed=t.angle,h.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(i){case"polygon":case"polyline":o(i),r(i);break;case"point":case"mesh":o(i)}}function vf(e,t){const{drawOperation:i,view:n}=t,s=xo(t),o=Vn(t);if(n.type==="2d"||!e||o.mode!=="absolute-height"||i?.numCommittedVertices!==1||!s||s.type!=="draw-polyline"&&s.type!=="draw-polygon"||s.elevation.locked)return;const[r,l,h]=e,u=Vf(r,l,h,o,t);u!=null&&s.elevation.lock(u)}function hr(e){xo(e)?.allFields.forEach(t=>{t.unlockOnVertexPlacement&&t.unlock()})}function xo({geometryType:e,graphic:t,tooltipInfos:i}){return e==="multipoint"||t?.geometry?.type!==xf[e]?null:i[e]}const xf={point:"point",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon"};function bf(e,t){switch(e?.type){case"draw-point":wf(e,t);break;case"draw-polyline":Ef(e,t);break;case"draw-polygon":Sf(e,t);break;case"draw-rectangle":Mf(e,t);break;case"draw-circle":kf(e,t);break;case"draw-mesh":Tf(e,t)}}function wf(e,t){const i=t.graphic?.geometry;i?.type==="point"&&(el(e,i,t),e.helpMessage=io("point",i))}function Tf(e,t){const{graphic:i,view:n}=t,s=i?.geometry;n.type!=="3d"||s&&s.type!=="mesh"||(el(e,s?.origin,t),s&&Md(e,s),e.helpMessage=bu(i,n))}function el(e,t,i){const{drawOperation:n,view:s,sketchOptions:o}=i,{cursorVertex:r}=n;if(e.sketchOptions=o,e.viewType=s.type,e.setLocationFromPoint(t,ti(i)),nl(e.elevation,i),!r)return void(n.constraints=void 0);const l=r;n.constraints={context:al(l,i),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function Ef(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polyline"||(il(e,t),e.totalLength.actual=n.lastVertex?(s?yf(s):null)??Kt:null,e.helpMessage=io("polyline",s))}function Sf(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polygon"||(il(e,t),e.area.actual=n.lastVertex?(s?Ka(s):null)??Ye:null,e.helpMessage=io("polygon",s))}function il(e,t){const{drawOperation:i,sketchOptions:n,view:s}=t,{cursorVertex:o,lastVertex:r,secondToLastVertex:l}=i,h=n.values.effectiveDirectionMode;e.sketchOptions=n,e.viewType=s.type;const u=r&&o?Rn(r,o)??Kt:null;if(e.distance.actual=u,e.distance.readOnly=r==null,e.direction.actual=null,e.direction.readOnly=!0,r&&o&&(h==="absolute"||l)){const m=cp(l,r,o,h);e.direction.actual=m??th,e.direction.readOnly=!1}e.setLocationFromPoint(o,ti(t)),nl(e.elevation,t);const p=Pf(r,t);e.xyMode=p,e.direction.visible=p==="direction-distance",e.distance.visible=p==="direction-distance",e.effectiveX.visible=p==="coordinates",e.effectiveY.visible=p==="coordinates";const d=o??r;i.constraints=d?{context:al(d,t),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:e.distance.committed,direction:e.direction.committed}:void 0}function Pf(e,{sketchOptions:t}){const i=t.tooltips.xyMode;return i==="auto"?e?"direction-distance":"coordinates":i}function Mf(e,t){e.sketchOptions=t.sketchOptions,e.xSize=ol(t),e.ySize=rl(t),e.area=sl(t)}function kf(e,t){const{forceUniformSize:i,sketchOptions:n}=t;e.sketchOptions=n,e.radius=i?Cf(t):null,e.xSize=i?null:ol(t),e.ySize=i?null:rl(t),e.area=sl(t)}function nl(e,t){const{drawOperation:i}=t,n=i?.cursorVertex??i?.lastVertex;e.actual=rf(n)??bo(t),e.visible=i.hasZ,e.readOnly=!1,e.showAsZ=!0}function sl(e){const t=e.createOperationGeometry?.full;return t?.type!=="polygon"?Ye:Ka(t)??Ye}function ol(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.left,t.right):null)??Kt}function rl(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.top,t.bottom):null)??Kt}function Cf({createOperationGeometry:e}){return(e?.circle?.center!=null&&e.circle.edge!=null?Rn(e.circle.center,e.circle.edge):null)??Kt}function Rf(e){const{geometryType:t,tooltipInfos:i}=e;switch(t){case"point":case"mesh":case"polyline":case"polygon":{const n=i[t].elevation.committed;return n?_n(n,"meters")/Fs(ti(e)):void 0}default:return}}function Vf(e,t,i,n,s){const{view:o,drawOperation:r}=s;if(o.type!=="3d"||!r)return;i??=0;const l=ti(s),h=Vn(s),u=Nr(o,e,t,i,l,h,n);return Qa(u,l)??bo(s)}function Vn(e){return e.drawOperation.elevationInfo??gn}function ti(e){return e.drawOperation.coordinateHelper.spatialReference}function bo(e){const t=Fs(ti(e));return ft(e.defaultZ*t,"meters")}function al(e,t){return gp(e,t.view,ti(t),Vn(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}var Se;(function(e){e[e.WhenToolEditable=0]="WhenToolEditable",e[e.WhenToolNotEditable=1]="WhenToolNotEditable",e[e.Always=2]="Always"})(Se||(Se={}));let Af=class{constructor(){this._isToolEditable=!0,this._manipulators=new ss,this._resourceContexts={manipulator3D:{}},this._attached=!1}set isToolEditable(e){this._isToolEditable=e}get length(){return this._manipulators.length}add(e,t=Se.WhenToolEditable){this.addMany([e],t)}addMany(e,t=Se.WhenToolEditable){for(const i of e){const n={manipulator:i,visibilityPredicate:t,attached:!1};this._manipulators.add(n),this._attached&&this._updateManipulatorAttachment(n)}}remove(e){for(let t=0;t{this._detachManipulator(e)}),this._manipulators.removeAll()}attach(){this._manipulators.forEach(e=>{this._updateManipulatorAttachment(e)}),this._attached=!0}detach(){this._manipulators.forEach(e=>{this._detachManipulator(e)}),this._attached=!1}destroy(){this.detach(),this._manipulators.forEach(({manipulator:e})=>e.destroy()),this._manipulators.destroy(),this._resourceContexts=null}on(e,t){return this._manipulators.on(e,i=>{t(i)})}forEach(e){for(const t of this._manipulators.items)e(t)}some(e){return this._manipulators.items.some(e)}toArray(){const e=[];return this.forEach(t=>e.push(t.manipulator)),e}intersect(e,t){let i=null,n=Number.MAX_VALUE;return this._manipulators.forEach(({manipulator:s,attached:o})=>{if(!o||!s.interactive)return;const r=s.intersectionDistance(e,t);r!=null&&r{i.dragging&&(t=!0,i.events.emit("drag",{action:"end",start:e,screenPoint:e}))}),t&&(this.view.toolViewManager.activeTool=null)}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(e){}onInputEventAfter(e){}get internallyEditable(){return this.getEditableFlag(we.USER)&&this.getEditableFlag(we.MANAGER)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized){if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};a([c({constructOnly:!0})],B.prototype,"view",void 0),a([c({readOnly:!0})],B.prototype,"active",null),a([c({value:!0})],B.prototype,"visible",null),a([c({value:!0})],B.prototype,"editable",null),a([c({readOnly:!0})],B.prototype,"manipulators",void 0),a([c({readOnly:!0})],B.prototype,"updating",null),a([c()],B.prototype,"cursor",null),a([c({readOnly:!0})],B.prototype,"automaticManipulatorSelection",void 0),a([c()],B.prototype,"hasFocusedManipulators",null),a([c()],B.prototype,"hasGrabbedManipulators",void 0),a([c()],B.prototype,"hasHoveredManipulators",void 0),a([c()],B.prototype,"firstGrabbedManipulator",void 0),a([c({readOnly:!0})],B.prototype,"created",void 0),a([c({readOnly:!0})],B.prototype,"removeIncompleteOnCancel",void 0),B=a([x("esri.views.interactive.InteractiveToolBase")],B);let nn=class extends tt{constructor(e){super(e),this.enabled=!1}};a([c({type:Boolean,nonNullable:!0})],nn.prototype,"enabled",void 0),nn=a([x("esri.views.interactive.sketch.SketchLabelOptions")],nn);const An=nn;let mi=class extends tt{constructor(e){super(e),this.mode="absolute-height"}toJSON(){return{mode:this.mode}}};a([c({type:String,nonNullable:!0})],mi.prototype,"mode",void 0),mi=a([x("esri.views.interactive.sketch.SketchTooltipElevationOptions")],mi);let J=class extends tt{constructor(e){super(e),this.area=!0,this.coordinates=!0,this.direction=!0,this.distance=!0,this.elevation=!0,this.header=!0,this.helpMessage=!1,this.orientation=!0,this.radius=!0,this.rotation=!0,this.scale=!0,this.size=!0,this.totalLength=!0}};a([c({type:Boolean,nonNullable:!0})],J.prototype,"area",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"coordinates",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"direction",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"distance",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"elevation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"header",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"helpMessage",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"orientation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"radius",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"rotation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"scale",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"size",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"totalLength",void 0),J=a([x("esri.views.interactive.sketch.SketchTooltipVisibleElements")],J);const ll=J;let it=class extends tt{constructor(e){super(e),this.enabled=!1,this.forceEnabled=!1,this.helpMessage=null,this.helpMessageIcon=null,this.inputEnabled=!0,this.elevation=new mi,this.placement="auto",this.offset=null,this.visibleElements=new ll,this.visualVariables=null,this.xyMode="auto"}get effectiveEnabled(){return this.forceEnabled||this.enabled}};a([c({type:Boolean,nonNullable:!0})],it.prototype,"enabled",void 0),a([c()],it.prototype,"forceEnabled",void 0),a([c()],it.prototype,"effectiveEnabled",null),a([c()],it.prototype,"helpMessage",void 0),a([c()],it.prototype,"helpMessageIcon",void 0),a([c({type:Boolean,nonNullable:!0})],it.prototype,"inputEnabled",void 0),a([c({type:mi,nonNullable:!0})],it.prototype,"elevation",void 0),a([c()],it.prototype,"placement",void 0),a([c()],it.prototype,"offset",void 0),a([c({type:ll,nonNullable:!0})],it.prototype,"visibleElements",void 0),a([c()],it.prototype,"visualVariables",void 0),a([c()],it.prototype,"xyMode",void 0),it=a([x("esri.views.interactive.sketch.SketchTooltipOptions")],it);const cl=it;let Le=class extends tt{constructor(e){super(e),this.length=null,this.verticalLength=null,this.area=null}};a([c()],Le.prototype,"length",void 0),a([c()],Le.prototype,"verticalLength",void 0),a([c()],Le.prototype,"area",void 0),Le=a([x("esri.views.interactive.sketch.Units")],Le);const pn=Le;let ae=class extends tt{constructor(e){super(e),this.directionMode="relative",this.relativeDirectionIsBilateral=!1}get effectiveDirectionMode(){switch(this.directionMode){case"relative":return this.relativeDirectionIsBilateral?A.RelativeBilateral:A.Relative;case"absolute":return A.Absolute}}get displayUnits(){return this._get("displayUnits")??new pn}set displayUnits(e){this._set("displayUnits",e)}get inputUnits(){return this._get("inputUnits")??new pn}set inputUnits(e){this._set("inputUnits",e)}};a([c({type:String,nonNullable:!0})],ae.prototype,"directionMode",void 0),a([c({type:Boolean,nonNullable:!0})],ae.prototype,"relativeDirectionIsBilateral",void 0),a([c()],ae.prototype,"effectiveDirectionMode",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"displayUnits",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"inputUnits",null),ae=a([x("esri.views.interactive.sketch.SketchValueOptions")],ae);const hl=ae;let Ge=class extends tt{constructor(e){super(e),this.labels=new An,this.tooltips=new cl,this.values=new hl}};a([c({nonNullable:!0,type:An})],Ge.prototype,"labels",void 0),a([c({nonNullable:!0,type:cl})],Ge.prototype,"tooltips",void 0),a([c({nonNullable:!0,type:hl})],Ge.prototype,"values",void 0),Ge=a([x("esri.views.interactive.sketch.SketchOptions")],Ge);const ul=Ge;let P=class extends Ce.EventedMixin(B){constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new ul}initialize(){const{view:e}=this;this.internalGraphicsLayer=new Xs({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer);const t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=_f(e.type,this.sketchOptions);const i=Pd(()=>({view:e,options:this.sketchOptions.tooltips}));this.tooltip=i,cr(this._tooltipsContext),this._coordinateFormatterLoadTask=Ll(()=>ru()),this.addHandles([t.on("vertex-add",n=>this.onVertexAdd(n)),t.on("vertex-remove",n=>this.onVertexRemove(n)),t.on("vertex-update",n=>this.onVertexUpdate(n)),t.on("cursor-update",n=>this.onCursorUpdate(n)),t.on("cursor-remove",()=>this._updateGraphic()),t.on("complete",n=>this.onComplete(n)),this._coordinateFormatterLoadTask,i.on("paste",n=>Id(n,this.activeTooltipInfo)),$(()=>this.cursor,n=>{t.cursor=n},ke),Po(()=>{const{activeTooltipInfo:n,sketchOptions:s}=this;bf(n,this._tooltipsContext),i.info=s.tooltips.effectiveEnabled?n:null}),Po(()=>{t.constraintZ=Rf(this._tooltipsContext)},Us)]),this.finishToolCreation()}destroy(){this.drawOperation=dt(this.drawOperation),this.tooltip=dt(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=dt(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){return{createOperationGeometry:this._createOperationGeometry,defaultZ:this.defaultZ,directionOptions:this.directionOptions,drawOperation:this.drawOperation,forceUniformSize:this.forceUniformSize,geometryType:this.geometryType,graphic:this.graphic,sketchOptions:this.sketchOptions,tooltipInfos:this.tooltipInfos,view:this.view}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(e){this._set("cursor",e)}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){const t=this.drawOperation;t&&(t.drawingMode=e),this._set("mode",e)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:e,map:t}}=this;return e==="2d"&&t&&"undoRedo"in t&&t.undoRedo instanceof Ct?t.undoRedo:null}set undoRedo(e){this._override("undoRedo",e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||Ad(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&cr(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(mt.outline),this.removeHandles(mt.regularVertices),this.removeHandles(mt.activeVertex),this.removeHandles(mt.activeEdge),this.removeHandles(Jn)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;const t=new It({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange("graphic"),this.addHandles(W(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),Jn),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;const{coordinateHelper:t,view:i,visualizationCursorVertex:n,lastVertex:s,committedVertices:o,geometryIncludingUncommittedVertices:r,numCommittedVertices:l}=this.drawOperation;if(!(l>0||n!=null))return;const h=e.operationComplete?o:r,u=h.length,p=n!=null?t.pointToArray(n):null,d=this._drawSpatialReference,m=i.type==="3d"&&i.viewingMode==="global",f=new hu;f.committedVertices=o,f.cursorVertex=p;const{geometryType:_}=this;switch(_){case"point":case"mesh":f.full=t.arrayToPoint(h[0]);break;case"multipoint":f.full=u>0?gu(h,d):null;break;case"polyline":case"polygon":u>0&&(f.full=_==="polygon"?Oi([h],d,m,!0):Wo([h],d,m),f.cursorEdge=p!=null&&s&&!gi(n,s)?Wo([[p,t.pointToArray(s)]],d,m):null,f.outline=u>1?f.full:null);break;case"circle":case"rectangle":{if(f.committedVertices=f.cursorVertex=null,!u)break;const y=fu(i,h[0]),w=h[0],b=y.makeMapPoint(w[0]+If*i.resolution,w[1]);_==="circle"?u===1&&e.operationComplete?f.circle=Xo([w,b],y,!0):u===2&&(this.forceUniformSize?f.circle=Xo(h,y,this.centered):f.rectangle=yu(h,y,this.centered)):u===1&&e.operationComplete?f.rectangle=Yo([w,b],y,!0):u===2&&(f.rectangle=this.forceUniformSize?Yo(h,y,this.centered):mu(h,y,this.centered)),f.full=f.circle!=null?f.circle.geometry:f.rectangle?.geometry,f.outline=f.full?.type==="polygon"?f.full:null;break}default:return null}return f}initializeGraphic(e){return W()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const i=this._getCreateOperationGeometry({operationComplete:!0});i!=null&&(t=this._createOrUpdateGraphic(i.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){const{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return W()}onCursorEdgeChanged(e){return W()}onVertexAdd(e){hr(this._tooltipsContext),this._updateGraphic(),vf(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",e)}onVertexRemove(e){hr(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e!=null?(e.cursorEdge!=null?this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),mt.activeEdge):this.removeHandles(mt.activeEdge),e.outline!=null?this.addHandles(this.onOutlineChanged(e.outline),mt.outline):this.removeHandles(mt.outline),e.committedVertices!=null?this.addHandles(this.onRegularVerticesChanged(e.committedVertices),mt.regularVertices):this.removeHandles(mt.regularVertices),e.cursorVertex!=null?this.addHandles(this.onActiveVertexChanged(e.cursorVertex),mt.activeVertex):this.removeHandles(mt.activeVertex),e.full!=null?this._createOrUpdateGraphic(e.full):this.removeHandles(Jn)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?xo(this._tooltipsContext):null}};a([c()],P.prototype,"_coordinateFormatterLoadTask",void 0),a([c()],P.prototype,"_createOperationGeometry",void 0),a([c()],P.prototype,"_tooltipsContext",null),a([c({value:!0})],P.prototype,"centered",null),a([c()],P.prototype,"cursor",null),a([c({nonNullable:!0})],P.prototype,"defaultZ",void 0),a([c({constructOnly:!0})],P.prototype,"directionOptions",void 0),a([c()],P.prototype,"drawOperation",void 0),a([c({value:!0})],P.prototype,"enabled",null),a([c({value:!0})],P.prototype,"forceUniformSize",null),a([c({constructOnly:!0})],P.prototype,"geometryType",void 0),a([c()],P.prototype,"graphic",null),a([c({constructOnly:!0})],P.prototype,"graphicProperties",void 0),a([c()],P.prototype,"graphicSymbol",null),a([c({constructOnly:!0})],P.prototype,"hasZ",void 0),a([c({constructOnly:!0})],P.prototype,"geometryToPlace",void 0),a([c()],P.prototype,"mode",null),a([c()],P.prototype,"snappingManager",void 0),a([c()],P.prototype,"snapToScene",void 0),a([c()],P.prototype,"tooltip",void 0),a([c()],P.prototype,"tooltipInfos",void 0),a([c({constructOnly:!0,type:ul})],P.prototype,"sketchOptions",void 0),a([c()],P.prototype,"updating",null),a([c({constructOnly:!0,nonNullable:!0})],P.prototype,"view",void 0),a([c({constructOnly:!0})],P.prototype,"undoRedo",null),a([c()],P.prototype,"activeTooltipInfo",null),P=a([x("esri.views.draw.DrawGraphicTool")],P);const Jn=Symbol("create-operation-graphic"),mt={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function Of(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const If=48,pl="click";let Lf=class{constructor({consumesClicks:e,grabbableForEvent:t}){this.events=new Ce,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0,this.consumesClicks=e,this.grabbableForEvent=t}destroy(){}intersectionDistance(e,t){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}};var D;(function(e){e[e.Z=0]="Z",e[e.M=1]="M"})(D||(D={}));let Gf=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(G())}pointToVector(e){return this._tag(de(e.x,e.y))}arrayToVector(e){return this._tag(de(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return $r(n,e,t,i)}addDelta(e,t,i){e[0]+=t,e[1]+=i}distance(e,t){return Hr(e,t)}getZ(e,t=void 0){return t}hasZ(){return!1}getM(e,t=void 0){return t}hasM(){return!1}clone(e){return this._tag(Cc(e))}copy(e,t){return wc(t,e)}fromXYZ(e){return this._tag(de(e[0],e[1]))}toXYZ(e,t=g()){return N(t,e[0],e[1],0)}pointToXYZ(e,t=g()){return N(t,e.x,e.y,0)}equals(e,t){return Tc(e,t)}_tag(e){return e}};class ur{constructor(t,i){this._valueType=t,this.spatialReference=i}createVector(){return this._tag(g())}pointToVector(t){return this._tag(pe(t.x,t.y,this._valueType===D.Z?t.z:t.m))}arrayToVector(t){return this._tag(pe(t[0],t[1],t[2]||0))}vectorToArray(t){return[t[0],t[1],t[2]]}pointToArray(t){return this._valueType===D.Z?[t.x,t.y,t.z]:[t.x,t.y,t.m]}vectorToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}arrayToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}vectorToDehydratedPoint(t,i){if(!t)return;i??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const n=this._valueType===D.Z,s=this._valueType===D.M;return i.x=t[0],i.y=t[1],i.z=n?t[2]:void 0,i.m=s?t[2]:void 0,i.hasZ=n,i.hasM=s,i.spatialReference=this.spatialReference,i}lerp(t,i,n,s){return Pe(s,t,i,n)}addDelta(t,i,n,s){t[0]+=i,t[1]+=n,this._valueType===D.Z&&(t[2]+=s)}distance(t,i){return this._valueType===D.Z?ge(t,i):Hr(t,i)}getZ(t,i=void 0){return this._valueType===D.Z?t[2]:i}hasZ(){return this._valueType===D.Z}getM(t,i=void 0){return this._valueType===D.M?t[2]:i}hasM(){return this._valueType===D.M}clone(t){return this._tag(lc(t))}copy(t,i){return rt(i,t)}fromXYZ(t,i=0,n=0){return this._tag(pe(t[0],t[1],this._valueType===D.Z?t.length>2?t[2]:i:n))}toXYZ(t,i=g()){return N(i,t[0],t[1],this._valueType===D.Z?t[2]:0)}pointToXYZ(t,i=g()){return N(i,t.x,t.y,this._valueType===D.Z?t.z??0:0)}equals(t,i){return We(t,i)}_tag(t){return t}}let Df=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(jr())}pointToVector(e){return this._tag(Hn(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Hn(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return yh(n,e,t,i)}addDelta(e,t,i,n){e[0]+=t,e[1]+=i,e[2]+=n}distance(e,t){return ge(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(xh(e))}copy(e,t){return _h(t,e)}fromXYZ(e,t=0,i=0){return this._tag(Hn(e[0],e[1],e.length>2?e[2]:t,i))}toXYZ(e,t=g()){return N(t,e[0],e[1],e[2])}pointToXYZ(e,t=g()){return N(t,e.x,e.y,e.z??0)}equals(e,t){return vh(e,t)}_tag(e){return e}};function dl(e,t,i){return e&&t?new Df(i):t?new ur(D.M,i):e?new ur(D.Z,i):new Gf(i)}function zf(e,t){if(!t.supported)return;let i=1/0,n=-1/0;const s=t.upperBoundX-t.lowerBoundX;e.forEach(r=>{let l=r.pos[0];for(;lt.upperBoundX;)l-=s;i=Math.min(i,l),n=Math.max(n,l),r.pos[0]=l});const o=n-i;s-o{r.pos[0]<0&&(r.pos[0]+=s)})}function Uf(e,t){const i=Ur(e);return t===Ti.Global&&i?{supported:!0,lowerBoundX:i.valid[0],upperBoundX:i.valid[1]}:{supported:!1,lowerBoundX:null,upperBoundX:null}}let Gi=class{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}};class Jt{constructor(t,i,n){this.component=t,this.leftVertex=i,this.rightVertex=n,this.type="edge",i.rightEdge=this,n.leftEdge=this}}class On{constructor(t,i){this._spatialReference=t,this._viewingMode=i,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||zf(this.vertices,Uf(this._spatialReference,this._viewingMode))}updateVertexIndex(t,i){if(this.vertices.length===0)return;const n=this.vertices[0];let s=null,o=t,r=i;do s=o,s.index=r++,o=s.rightEdge?s.rightEdge.rightVertex:null;while(o!=null&&o!==n);s.leftEdge&&s!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(s),this.vertices.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return this.vertices.length>2&&this.vertices[0].leftEdge!==null}swapVertices(t,i){const n=this.vertices[t];this.vertices[t]=this.vertices[i],this.vertices[i]=n}iterateVertices(t){if(this.vertices.length===0)return;const i=this.vertices[0];let n=i;do t(n,n.index),n=n.rightEdge!=null?n.rightEdge.rightVertex:null;while(n!==i&&n!=null)}}let dn=class fl extends Ce{constructor(t,i){super(),this.type=t,this.coordinateHelper=i,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:Hh(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.components)for(const i of t.vertices)yield i}notifyChanges(t){this._dirty=!0,this.emit("change",t)}_toPoint(){return this.components.length===0||this.components[0].vertices.length===0?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[];let o=n.vertices.find(l=>l.leftEdge==null);const r=o;do s.push(i(o.pos)),o=o.rightEdge?o.rightEdge.rightVertex:null;while(o&&o!==r);t.push(s)}return new fi({paths:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[],o=n.vertices[0];let r=o;const l=r;do s.push(i(r.pos)),r=r.rightEdge!=null?r.rightEdge.rightVertex:null;while(r&&r!==l);n.isClosed()&&s.push(i(o.pos)),t.push(s)}return new De({rings:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,i){const n=t.spatialReference,s=dl(t.hasZ,t.hasM,n),o=new fl(t.type,s);switch(t.type){case"polygon":$f(o,t,i);break;case"polyline":Hf(o,t,i);break;case"point":pr(o,t,i);break;case"mesh":pr(o,t.origin,i),o._geometry=t,o._dirty=!1}return o}};function $f(e,t,i){const n=t.spatialReference,s=e.coordinateHelper,o=t.rings;for(let r=0;r2&&Fe(l[0],l[l.length-1]),p=u?l.length-1:l.length;for(let m=0;mthis.operation.apply(t)),this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(t=>this.operation.undo(t)),this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices}),this._undone=!0}canAccumulate(t){if(this._undone||t._vertices.length!==this._vertices.length)return!1;for(let i=0;ithis.operation.accumulate(i,t.operation)),this.operation.accumulateParams(t.operation),this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0)}};var nt;(function(e){e[e.CUMULATIVE=0]="CUMULATIVE",e[e.REPLACE=1]="REPLACE"})(nt||(nt={}));let Ff=class{constructor(e,t,i=0){this._editGeometry=e,this._vertices=t,this._minNumberOfVertices=i,this.removedVertices=null}apply(){let e="redo";if(this.removedVertices==null){const t=this.removedVertices=[];this._vertices.forEach(i=>{const n=this._removeVertex(i);n!=null&&t.push(n)}),e="apply"}else this.removedVertices.forEach(t=>{this._removeVertex(t.removedVertex)});this._editGeometry.notifyChanges({operation:e,removedVertices:this._vertices})}undo(){this.removedVertices?.forEach(e=>{this._undoRemoveVertex(e)}),this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(e){const t=e.component;if(t.vertices.length<=this._minNumberOfVertices)return null;const i={removedVertex:e,createdEdge:null},n=e.leftEdge,s=e.rightEdge;return t.vertices.splice(t.vertices.indexOf(e),1),n&&(t.edges.splice(t.edges.indexOf(n),1),n.leftVertex.rightEdge=null),s&&(t.edges.splice(t.edges.indexOf(s),1),s.rightVertex.leftEdge=null),e.index===0&&s&&this._vertices.length>0&&t.swapVertices(t.vertices.indexOf(s.rightVertex),0),n&&s&&(i.createdEdge=new Jt(t,n.leftVertex,s.rightVertex),t.edges.push(i.createdEdge)),s&&t.updateVertexIndex(s.rightVertex,s.rightVertex.index-1),i}_undoRemoveVertex(e){const t=e.removedVertex,i=e.removedVertex.component,n=t.leftEdge,s=t.rightEdge;e.createdEdge&&i.edges.splice(i.edges.indexOf(e.createdEdge),1),i.vertices.push(t),n&&(i.edges.push(n),n.leftVertex.rightEdge=n),s&&(i.edges.push(s),s.rightVertex.leftEdge=s),i.updateVertexIndex(t,t.index)}},Zf=class{constructor(e,t,i){this._editGeometry=e,this._edge=t,this._t=i,this.createdVertex=null,this._left=null,this._right=null}apply(){let e="redo";const t=this._edge,i=t.component,n=t.leftVertex,s=t.rightVertex;i.edges.splice(i.edges.indexOf(t),1),this.createdVertex==null&&(e="apply",this.createdVertex=new Gi(t.component)),i.vertices.push(this.createdVertex),this.createdVertex.pos=this._editGeometry.coordinateHelper.lerp(t.leftVertex.pos,t.rightVertex.pos,this._t,this._editGeometry.coordinateHelper.createVector()),this._left==null&&(this._left=new Jt(i,n,this.createdVertex)),this._left.leftVertex.leftEdge?i.edges.push(this._left):i.edges.unshift(this._left),n.rightEdge=this._left,this._right==null&&(this._right=new Jt(i,this.createdVertex,s)),i.edges.push(this._right),s.leftEdge=this._right,i.updateVertexIndex(this.createdVertex,n.index+1),this._editGeometry.notifyChanges({operation:e,addedVertices:[this.createdVertex]})}undo(){if(this.createdVertex==null||this._left==null||this._right==null)return null;const e=this._edge,t=e.component,i=this.createdVertex.leftEdge,n=this.createdVertex.rightEdge,s=i?.leftVertex,o=n?.rightVertex;t.vertices.splice(t.vertices.indexOf(this.createdVertex),1),t.edges.splice(t.edges.indexOf(this._left),1),t.edges.splice(t.edges.indexOf(this._right),1),this._edge.leftVertex.leftEdge?t.edges.push(this._edge):t.edges.unshift(this._edge),s&&(s.rightEdge=e),o&&(o.leftEdge=e),s&&t.updateVertexIndex(s,s.index),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this.createdVertex]})}accumulate(){return!1}},Bf=class yl{constructor(t,i,n){this._editGeometry=t,this._vertex=i,this._pos=n}apply(){const t=this._originalPosition==null;t&&(this._originalPosition=this._vertex.pos),this._apply(t?"apply":"redo")}undo(){this._vertex.pos=this._originalPosition,this._editGeometry.notifyChanges({operation:"undo",updatedVertices:[this._vertex]})}accumulate(t){return t instanceof yl&&t._vertex===this._vertex&&(this._pos=t._pos,this._apply("apply"),!0)}_apply(t){this._vertex.pos=this._pos,this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:[this._vertex]})}},Wf=class{constructor(e,t){this._editGeometry=e,this._component=t,this._createdEdge=null}apply(){let e="redo";if(this._createdEdge==null){e="apply";const t=this._component.getFirstVertex(),i=this._component.getLastVertex();if(this._component.isClosed()||this._component.vertices.length<3||t==null||i==null)return;this._createdEdge=new Jt(this._component,i,t)}this._createdEdge.leftVertex.rightEdge=this._createdEdge,this._createdEdge.rightVertex.leftEdge=this._createdEdge,this._component.edges.push(this._createdEdge),this._editGeometry.notifyChanges({operation:e})}undo(){this._createdEdge!=null&&(Dr(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}},dr=class _l{constructor(t,i,n,s){this._editGeometry=t,this.dx=i,this.dy=n,this.dz=s,this._firstTime=!0}apply(){const t=this._firstTime?"apply":"redo";this._firstTime=!1,this._apply(t,this.dx,this.dy,this.dz)}undo(){this._apply("undo",-this.dx,-this.dy,-this.dz)}accumulate(t){const i=this._editGeometry.geometry;return t instanceof _l&&t._editGeometry.geometry===i&&(this._apply("apply",t.dx,t.dy,t.dz),this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz,!0)}_apply(t,i,n,s){const o=this._editGeometry.geometry;o.offset(i,n,s);const r=this._editGeometry.components[0].getFirstVertex();if(!r)return;const l=this._editGeometry.coordinateHelper;r.pos=l.pointToVector(o.origin),this._editGeometry.notifyChanges({operation:t,updatedVertices:[r]})}},vl=class xl{constructor(t,i,n,s){this._helper=t,this.dx=i,this.dy=n,this.dz=s}_move(t,i,n,s){this._helper.addDelta(t.pos,i,n,s)}apply(t){this._move(t,this.dx,this.dy,this.dz)}undo(t){this._move(t,-this.dx,-this.dy,-this.dz)}canAccumulate(t){return t instanceof xl}accumulate(t,i){this._move(t,i.dx,i.dy,i.dz)}accumulateParams(t){this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz}},Yf=class Ls{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,n,s=0,o=yi.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=n,this.distance=s,this._plane=at(),this._offsetPlane=at(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,o===yi.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),n=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=Do(g(),t,n),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(n,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(n,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return t!=null?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,n,s){const o=g();if(i){Do(o,t,i);const r=!this._passesBisectingAngleThreshold(o,n);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(n,o):o,isOriginalDirection:!r}}return this._helper.hasZ()?s&&(Ot(o,n,s.direction),Ot(o,o,n),le(o,o),Math.sign(o[1])!==Math.sign(n[0])&&fe(o,o,-1)):N(o,-n[1],n[0],0),{start:t,end:i,direction:o,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const n=Math.abs(wh(i,t));return n>=fr&&n<=Math.PI-fr}_bisectVectorsPerpendicular(t,i){const n=Z(t,i)<0?t:rs(g(),t),s=Math.abs(Z(n,i));if(!(s1-gr))return this._bisectDirection(n,i);const o=Ot(g(),n,[0,0,1]);return le(o,o)}_bisectDirection(t,i){const n=ut(g(),t,i);return le(n,n)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);Z(t,i)<0&&rs(i,i),Ri(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=Ot(g(),t.direction,this._edgeDirection);le(i,i);const n=Ot(g(),this._edgeDirection,i);return this._planeType===Gs.XY&&(n[2]=0),le(n,n)}_initializeDistanceConstraints(){this._left.end==null||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(Ae(this._plane,this._left.end)),this._right.end==null||this.requiresSplitEdgeRight||this._updateDistanceConstraint(Ae(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=Ue(t),n=this._edgeDirection,s=ut(g(),this._left.start,this._left.direction),o=ut(g(),this._right.start,this._right.direction),r=this._pointInBasis2D(G(),i,n,this._left.start),l=this._pointInBasis2D(G(),i,n,s),h=this._pointInBasis2D(G(),i,n,this._right.start),u=this._pointInBasis2D(G(),i,n,o),[p]=Su({start:l,end:r,type:O.LINE},{start:u,end:h,type:O.LINE});if(!p)return;const d=q(G(),r,l);Ws(d,d);const m=q(G(),p,l),f=_e(d,m),_=ut(g(),s,fe(g(),this._left.direction,-f)),y=Ae(t,_);this._updateDistanceConstraint(y)}_pointInBasis2D(t,i,n,s){return t[0]=Ho(i,s),t[1]=Ho(n,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),Nn(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const n=(o,r,l)=>r!=null&&js(this._offsetPlane,o,ut(g(),o,r),l),s=g();(t===this._edge.leftVertex?n(this._left.start,this._left.direction,s):n(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=Kr(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return Ae(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(t){const i=this._helper.toXYZ(this._helper.pointToVector(t)),n=Ks(this._plane,i,g()),s=Ae(this._plane,i),o=cc(s,this._minDistance,this._maxDistance);return Pe(i,n,i,o/s),{start:n,end:i}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Ls&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&We(Ue(this._plane),Ue(t._plane))}accumulate(t,i){const n=this._plane[3]-i._plane[3]+i.distance;this._offset(t,n)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Ls(this._helper,this._planeType,this._edge,this.distance,yi.DEFERRED);return Nn(t._plane,this._plane),Nn(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=rt(g(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return t==null&&i==null||t!=null&&i!=null&&We(t,i)}_cloneNeighbor({start:t,end:i,direction:n,isOriginalDirection:s}){return{start:rt(g(),t),end:i!=null?rt(g(),i):null,direction:rt(g(),n),isOriginalDirection:s}}};const fr=Ir(15),gr=.001;var Gs,yi;(function(e){e[e.XYZ=0]="XYZ",e[e.XY=1]="XY"})(Gs||(Gs={})),function(e){e[e.IMMEDIATE=0]="IMMEDIATE",e[e.DEFERRED=1]="DEFERRED"}(yi||(yi={}));let bl=class wl{constructor(t,i,n=nt.CUMULATIVE){this.origin=t,this.angle=i,this._accumulationType=n}_rotate(t,i){Ec(t.pos,t.pos,this.origin,i)}apply(t){this._rotate(t,this.angle)}undo(t){this._rotate(t,-this.angle)}canAccumulate(t){return t instanceof wl&&Fe(this.origin,t.origin)}accumulate(t,i){const n=i._accumulationType===nt.REPLACE;this._rotate(t,n?i.angle-this.angle:i.angle)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.angle=i?t.angle:this.angle+t.angle}};class In{constructor(t,i,n,s,o=nt.CUMULATIVE){this.origin=t,this.axis1=i,this.factor1=n,this.factor2=s,this._accumulationType=o,this.axis2=de(i[1],-i[0])}_scale(t,i,n){on(t.pos,t.pos,this.origin,this.axis1,i),on(t.pos,t.pos,this.origin,this.axis2,n)}apply(t){this._scale(t,this.factor1,this.factor2)}undo(t){this._scale(t,1/this.factor1,1/this.factor2)}canAccumulate(t){return t instanceof In&&Fe(this.origin,t.origin)&&Fe(this.axis1,t.axis1)}accumulate(t,i){i._accumulationType===nt.REPLACE?this._scale(t,i.factor1/this.factor1,i.factor2/this.factor2):this._scale(t,i.factor1,i.factor2)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.factor1=i?t.factor1:this.factor1*t.factor1,this.factor2=i?t.factor2:this.factor2*t.factor2}}let Xf=class Tl{constructor(t,i){this._editGeometry=t,this._newPositions=i}apply(){const t=this._originalPositions==null?"apply":"redo";if(!this._originalPositions){const i=this._editGeometry.coordinateHelper;this._originalPositions=this._editGeometry.allVertices.map(n=>i.clone(n.pos))}this._apply(t,this._newPositions)}undo(){this._originalPositions&&this._apply("undo",this._originalPositions)}accumulate(t){return t instanceof Tl&&(this._newPositions=t._newPositions,this._apply("apply",this._newPositions),!0)}_apply(t,i){const n=this._editGeometry.coordinateHelper,s=this._editGeometry.allVertices;for(let o=0;oo.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:s})}};var El;const qf=Symbol();let jf=class{constructor(e){this._operations=[],this._closed=!1,this[El]=!0,e&&(this._operations=e,this._closed=!0)}close(){this._closed=!0}apply(){for(const e of this._operations)e.apply()}undo(){for(let e=this._operations.length-1;e>=0;e--)this._operations[e].undo()}accumulate(e){if(this._closed)return!1;const t=this._operations.length?this._operations[this._operations.length-1]:null;return t&&t.accumulate(e)||(this._operations.push(e),e.apply()),!0}};El=qf;let wo=class Sl extends Ce{constructor(t,i){super(),this.data=t,this.viewingMode=i,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",n=>{n.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:n.addedVertices,operation:n.operation}),n.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:n.removedVertices,operation:n.operation}),n.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:n.updatedVertices,operation:n.operation})})}destroy(){this._listener.remove()}splitEdge(t,i){return this._apply(new Zf(this.data,t,i))}updateVertices(t,i,n=L.ACCUMULATE_STEPS){return this._apply(new gl(this.data,t,i),n)}move(t,i,n,s=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,t,i,n),s):this.moveVertices(this.data.allVertices,t,i,n,s)}moveVertices(t,i,n,s,o=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,i,n,s),o):this.updateVertices(t,new vl(this.data.coordinateHelper,i,n,s),o)}scale(t,i,n,s,o=L.ACCUMULATE_STEPS,r=nt.CUMULATIVE){return this.scaleVertices(this.data.allVertices,t,i,n,s,o,r)}scaleVertices(t,i,n,s,o,r=L.ACCUMULATE_STEPS,l=nt.CUMULATIVE){return this.updateVertices(t,new In(i,n,s,o,l),r)}rotate(t,i,n=L.ACCUMULATE_STEPS,s=nt.CUMULATIVE){return this.rotateVertices(this.data.allVertices,t,i,n,s)}rotateVertices(t,i,n,s=L.ACCUMULATE_STEPS,o=nt.CUMULATIVE){return this.updateVertices(t,new bl(i,n,o),s)}removeVertices(t){return this._apply(new Ff(this.data,t,this._minNumVerticesPerType))}appendVertex(t){return this.data.components.length===0?null:this._apply(new Nf(this.data,this.data.components[0],t))}setVertexPosition(t,i){return this._apply(new Bf(this.data,t,i))}offsetEdge(t,i,n,s=L.ACCUMULATE_STEPS){return this.updateVertices([i.leftVertex,i.rightVertex],new Yf(this.data.coordinateHelper,t,i,n),s)}trySetGeometry(t,i=L.ACCUMULATE_STEPS){const{data:n}=this,{coordinateHelper:s}=n;if(n.type!==t.type||!n.spatialReference.equals(t.spatialReference)||s.hasZ()!==t.hasZ||s.hasM()!==t.hasM||!Ql(n.geometry,t)||ri(n))return;const o=Array.from(dn.fromGeometry(t,this.viewingMode).iterateVertices(),r=>r.pos);return this.setVertexPositions(o,i)}setVertexPositions(t,i=L.ACCUMULATE_STEPS){return this._apply(new Xf(this.data,t),i)}createResetState(){if(ri(this.data))return this._createResetStateMesh();const t=this.data.geometry.clone();return W(()=>this.trySetGeometry(t))}closeComponent(t){return this.data.components.includes(t)?this._apply(new Wf(this.data,t)):null}canRemoveVertex(t){return t.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const t=new jf;return this._apply(t),W(()=>t.close())}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();return t.undo(),this._redoStack.push(t),t}return null}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();return t.apply(),this._undoStack.push(t),t}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(t,i=L.ACCUMULATE_STEPS){return i!==L.NEW_STEP&&this.lastOperation!=null&&this.lastOperation.accumulate(t)||(t.apply(),this._undoStack.push(t),this._redoStack=[]),t}_createResetStateMesh(){if(!ri(this.data))return W();const t=this.data.geometry,{vertexSpace:i}=t;if(i.origin){const s=ye(i.origin);return W(()=>{t.vertexSpace.origin=s})}const n=t.vertexAttributes.clonePositional();return W(()=>{t.vertexAttributes=n,t.vertexAttributesChanged()})}static fromGeometry(t,i){return new Sl(dn.fromGeometry(t,i),i)}};function Kf(e,t){let i=null,n=null;return s=>{if(s.action==="cancel")return void(n!=null&&(n.execute({action:"cancel"}),i=null,n=null));const o={action:s.action,screenStart:s.start,screenEnd:s.screenPoint};s.action==="start"&&i==null&&(i=new Pi,n=new Pi,t(e,i,n,s.pointerType,o)),i?.execute(o),s.action==="end"&&i!=null&&(i=null,n=null)}}function He(e,t){return e.events.on("drag",Kf(e,t))}function To(e,t=null,i){let n=null;const s=t==null||e.spatialReference?.equals(t)?r=>r:r=>r!=null?Xe(r,t):r,o={exclude:[],...i};return r=>{if(r.action==="start"&&(n=s(e.toMap(r.screenStart,o))),n==null)return null;const l=s(e.toMap(r.screenEnd,o));return l!=null?{...r,mapStart:n,mapEnd:l}:null}}const Qf=()=>{};let Pi=class Pl{constructor(){this.execute=Qf}next(t,i=new Pl){return t!=null&&(this.execute=n=>{const s=t(n);s!=null&&i.execute(s)}),i}};function Jf(e,t,i=[]){if(e.type==="2d")return s=>s;let n=null;return s=>{s.action==="start"&&(n=e.toMap(s.screenStart,{exclude:i}),n!=null&&(n.z=Lo(n,e,t)));const o=e.toMap(s.screenEnd,{exclude:i});o!=null&&(o.z=Lo(o,e,t));const r=n!=null&&o!=null?{sceneStart:n,sceneEnd:o}:null;return{...s,scenePoints:r}}}let Ds=class{constructor(e){this.vertexHandle=null,this.excludeFeature=null,this.visualizer=null,this.selfSnappingZ=null,this.drawConstraints=null,this.editGeometryOperations=e.editGeometryOperations,this.elevationInfo=e.elevationInfo,this.pointer=e.pointer,this.vertexHandle=e.vertexHandle,this.excludeFeature=e.excludeFeature,this.feature=e.feature,this.visualizer=e.visualizer,this.selfSnappingZ=e.selfSnappingZ,this.drawConstraints=e.drawConstraints}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}};function tg({predicate:e=()=>!0,snappingManager:t,snappingContext:i,updatingHandles:n,useZ:s=!0}){const o=new Pi;if(t==null)return{snappingStep:[mr,o],cancelSnapping:mr};let r,l=null,h=null,u=null;const p=()=>{l=os(l),t.doneSnapping(),h?.frameTask.remove(),h=null,r=Ar(r),u=null},d=eg(t,s,o);let m=null,f=null,_=null;return{snappingStep:[y=>{if(!e(y))return y;const{action:w}=y;if(w==="start"){const{info:b}=y,S=ig(t.view);if(h=ng(i,y,S),h.context.selfSnappingZ=null,!s&&b!=null){const I=og(i.coordinateHelper,b.handle.component);I!=null&&(h.context.selfSnappingZ={value:I,elevationInfo:i.elevationInfo??gn})}}if(h!=null){const{context:b,originalScenePos:S,originalPos:I}=h,{mapEnd:K,mapStart:et,scenePoints:Y}=y,gt=Ml(I,zs(K,et)),lt=zs(et,I),ei={...y,action:"update"},zt=h.context,ie=sg(S,Y),be=t.update({point:gt,scenePoint:ie,context:b});if(_=be,kl(K,be,lt,s),m=gt,f=ie,w!=="end"){const{frameTask:Ln}=h;l==null&&(l=new AbortController),u=Ol=>{n.addPromise(ns(d({frameTask:Ln,event:ei,context:zt,point:gt,scenePoint:ie,delta:lt,getLastState:()=>({point:m,scenePoint:f,updatePoint:Ol.forceUpdate?null:_})},l.signal)))},u({forceUpdate:!1}),r==null&&(r=$(()=>t.options.effectiveEnabled,()=>u?.({forceUpdate:!0})))}}return w==="end"&&p(),y},o],cancelSnapping:y=>(p(),y)}}function eg(e,t,i){return Vr(async({frameTask:n,point:s,scenePoint:o,context:r,event:l,delta:h,getLastState:u},p)=>{const d=await n.schedule(()=>e.snap({point:s,scenePoint:o,context:r,signal:p}),p);if(d.valid){let m=await n.schedule(()=>d.apply(),p);const f=u();f.point!=null&&s!==f.point&&(m=e.update({point:f.point,scenePoint:f.scenePoint,context:r})),f.updatePoint!=null&&gi(m,f.updatePoint)||(kl(l.mapEnd,m,h,t),i.execute(l))}})}function ig(e){return e.type==="3d"?e.resourceController.scheduler.registerTask(ia.SNAPPING):na}function ng(e,t,i){return{context:new Ds({editGeometryOperations:e.editGeometryOperations,elevationInfo:e.elevationInfo,pointer:e.pointer,vertexHandle:t.info!=null?t.info.handle:null,excludeFeature:e.excludeFeature,feature:e.feature,visualizer:e.visualizer}),originalPos:t.snapOrigin!=null?e.coordinateHelper.vectorToDehydratedPoint(t.snapOrigin):t.mapStart,originalScenePos:t.scenePoints!=null?t.scenePoints.sceneStart:null,frameTask:i}}function Ml(e,[t,i,n]){const s=sa(e);return s.x+=t,s.y+=i,s.hasZ&&(s.z+=n),s}function sg(e,t){return e==null||t==null?null:Ml(e,zs(t.sceneEnd,t.sceneStart))}function zs(e,t){const i=e.hasZ&&t.hasZ?e.z-t.z:0;return[e.x-t.x,e.y-t.y,i]}function kl(e,t,[i,n,s],o){e.x=t.x+i,e.y=t.y+n,o&&e.hasZ&&t.hasZ&&(e.z=t.z+s)}function og(e,t){if(!e.hasZ())return null;const i=t.vertices;let n=null;for(const s of i){const o=e.getZ(s.pos);if(n!=null&&o!=null&&Math.abs(o-n)>1e-6)return null;n==null&&(n=o)}return n}function mr(e){return e}let Te=class extends tt{constructor(e){super(e),this.constrainResult=t=>t,this._snapPoints=null,this._frameTask=null,this._abortController=null,this._stagedPoint=null,this._snap=Vr(async(t,i,n,s)=>{const o=this._frameTask;if(o==null)return;const r=await o.schedule(()=>i.snap({...t,context:n,signal:s}),s);r.valid&&await o.schedule(()=>{this.stagedPoint=r.apply(),t!==this._snapPoints&&this._snapPoints!=null&&(this.stagedPoint=i.update({...this._snapPoints,context:n}))},s)})}get stagedPoint(){return this._stagedPoint}set stagedPoint(e){this._stagedPoint=this.constrainResult(e)}initialize(){const e=this.view.type==="3d"?this.view?.resourceController?.scheduler:null;this._frameTask=e!=null?e.registerTask(ia.SNAPPING):na}destroy(){this._abortController=os(this._abortController),this._frameTask=Ar(this._frameTask)}update(e,t,i){this._snapPoints=e;const{point:n,scenePoint:s}=e,o=t.update({point:n,scenePoint:s,context:i});return this.stagedPoint=o,o}async snap(e,t,i){const{point:n,scenePoint:s}=e;return this.stagedPoint=t.update({point:n,scenePoint:s,context:i}),this._snapPoints=e,this._abortController==null&&(this._abortController=new AbortController),this._snap(e,t,i,this._abortController.signal)}async snapAgainNearPreviousMapPoint(e,t){this._snapPoints!=null&&await this.snap(this._snapPoints,e,t)}abort(){this._abortController=os(this._abortController),this._snapPoints=null}};a([c({constructOnly:!0})],Te.prototype,"view",void 0),a([c()],Te.prototype,"stagedPoint",null),a([c()],Te.prototype,"constrainResult",void 0),a([c()],Te.prototype,"_stagedPoint",void 0),Te=a([x("esri.views.interactive.snapping.SnappingOperation")],Te);var yr;(function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(yr||(yr={}));const _r=Symbol("snapping-toggle");function rg(e,t=()=>{}){const i=$(()=>({view:e.view,snappingOptions:e.snappingOptions}),({view:n,snappingOptions:s})=>{if(e.removeHandles(_r),!n||!s)return;const o=Xr.TOOL,r=[n.on("key-down",l=>{l.key!==ir.toggle||l.repeat||(s.enabledToggled=!0,t())},o),n.on("key-up",l=>{l.key===ir.toggle&&(s.enabledToggled=!1,t())},o),n.on("pointer-move",l=>{const h=l.native.ctrlKey;s.enabledToggled!==h&&(s.enabledToggled=h,t())},o)];e.addHandles(r,_r)},ke);e.addHandles(i)}const ag="crosshair",lg="progress",vr=Symbol(),xr=Symbol();let T=class extends Ce.EventedMixin(tt){constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new Jc,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new Zr,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=ys(vp),this._getPolylineOrPolygonConstraint=ys(xp),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new An,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo==null&&(this.elevationInfo=Lc(!!e.hasZ))}initialize(){const{geometryType:e,view:t}=this,i=t.spatialReference,n="viewingMode"in t.state?t.state.viewingMode:Ti.Local,s=e==="segment"||e==="multipoint"?"polyline":e;this.coordinateHelper=dl(this.hasZ,this.hasM,i),this._editGeometryOperations=new wo(new dn(s,this.coordinateHelper),n),this._snappingOperation=new Te({view:t}),this.addHandles([$(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:l,constraint:h},u)=>{const{snappingOptions:p}=this;if(p&&(p.forceDisabled=h!=null&&vt(h)),u!=null&&l===u.stagedPoint&&h!==u.constraint)return this._onKeyboardBasedChange();this._processCursor(l??this._screenToMap(this._stagedScreenPoint))},{equals:(l,h)=>l.stagedPoint===h.stagedPoint&&Gl(l.constraint,h.constraint)}),$(()=>this.view.viewpoint,(l,h)=>{l&&h&&Uh(l,h)&&this._onKeyboardBasedChange()})]),this._activeComponent=new On(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const o=this.segmentLabels;o!=null&&(o.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles($(()=>this.labelOptions.enabled,l=>{o.visible=l},ke))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],l=>{const h=l.vertices.map(f=>({componentIndex:0,vertexIndex:f.index,coordinates:this.coordinateHelper.vectorToArray(f.pos)})),u=h.map(f=>f.coordinates),p=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;gi(p,this.firstVertex)||(this.firstVertex=p);const d=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;gi(d,this.lastVertex)||(this.lastVertex=d);const m=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;switch(gi(m,this.secondToLastVertex)||(this.secondToLastVertex=m),this._processCursor(this.cursorVertex),l.type){case"vertex-add":this.emit(l.type,{...l,added:u,vertices:h});break;case"vertex-update":this.emit(l.type,{...l,updated:u,vertices:h});break;case"vertex-remove":this.emit(l.type,{...l,removed:u,vertices:h})}}));const r=this._manipulator=new Lf({consumesClicks:!1,grabbableForEvent:l=>this.drawingMode!=="click"||l.pointerType==="touch"&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(r),r.grabbable=e!=="point",this.addHandles([r.events.on("immediate-click",l=>this._onImmediateClick(l)),r.events.on("immediate-double-click",l=>this._onImmediateDoubleClick(l)),$(()=>this.drawingMode,()=>{this.removeHandles(vr),this.addHandles(this._createManipulatorDragPipeline(r),vr)},ke),$(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:l})=>{r.cursor=l},ke)]),rg(this,()=>{const l=this.view.inputManager.latestPointerType??"mouse",h=this._getSnappingContext(l);if(this.snappingManager!=null){const u=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,h);this._updatingHandles.addPromise(ns(u))}})}destroy(){dt(this.segmentLabels),dt(this._snappingOperation),this._editGeometryOperations=dt(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const e=this._updateAndGetEffectiveDrawSurface();return this.view.type==="3d"&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){const{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case"point":return this._getPointConstraint(e);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set("drawingMode",e??pl)}get effectiveCursor(){return this.loading?lg:this._hideDefaultCursor?null:this.cursor||ag}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return this.snappingManager!=null?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return this._stagedPointerType==="mouse"?this.cursorVertex:null}get committableVertex(){const{cursorVertex:e,lastVertex:t,firstVertex:i,geometryType:n}=this;return n==="polygon"&&Fn(e,i)||Fn(e,t)?null:e}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:e,committableVertex:t,coordinateHelper:i}=this,n=e.slice();return t!=null&&n.push(i.pointToArray(t)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e))}complete(e){const t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,s=i==="multipoint"&&n===0||i==="polyline"&&n<2||i==="polygon"&&n<3;i!=="segment"&&i!=="point"||this.commitStagedVertex(),this._createOperationCompleted=!s,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((o,r)=>({componentIndex:0,vertexIndex:r,coordinates:o})),aborted:t,type:"complete"}))}onInputEvent(e){switch(e.type){case"pointer-down":this._pointerDownStates.add(e.pointerId);break;case"pointer-up":this._pointerDownStates.delete(e.pointerId)}switch(e.type){case"pointer-move":return this._onPointerMove(e);case"hold":return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){const t=is(this.cursorVertex),i=is(e),n=i&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(i)??i),s=this._snapToClosingVertex(n),o=this._applyConstraints(s);Fn(t,o)||(this._set("cursorVertex",o),this.segmentLabels?.set("stagedVertex",o!=null?this.coordinateHelper.pointToVector(o):null),o==null||this._stagedPointerType!=="mouse"?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!=="polygon"||this.numCommittedVertices<=2)return e;const t=this._mapToScreen(e);if(!t)return e;const i=this._activeComponent;return this._vertexWithinPointerDistance(i.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(e);case"freehand":return this._createManipulatorDragPipelineFreehand(e);case"hybrid":return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return He(e,(t,i,n,s)=>{const o=s==="touch"&&this._snappingEnabled;if(this.isCompleted||!o)return;const{snappingStep:r,cancelSnapping:l}=tg({predicate:()=>o,snappingManager:this.snappingManager,snappingContext:new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:s,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n=n.next(h=>(o&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),h)).next(l),i.next(this._screenToMapDragEventStep()).next(h=>(h.action==="start"&&(this._processCursor(h.mapStart),(this.geometryType==="segment"||o&&!this.numCommittedVertices)&&this.commitStagedVertex()),h)).next(Jf(this.view,this.elevationInfo)).next(...r).next(h=>(o&&(this._processCursor(h.mapEnd),h.action==="end"&&this.commitStagedVertex()),h)).next(h=>(h.action==="end"&&(this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()),h))})}_createManipulatorDragPipelineFreehand(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.committableVertex==null&&this._processCursor(n.mapStart),this.geometryType==="segment"&&this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this.complete()}return n})})}_createManipulatorDragPipelineHybrid(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),xr),this._processCursor(n.mapStart),this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.removeHandles(xr),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()}return n})})}get _drawAtFixedElevation(){const{constraintsEnabled:e,constraintZ:t,geometryType:i,numCommittedVertices:n}=this;return e?t!=null||i==="segment"&&n>0:(i==="segment"||i==="polygon")&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:e,coordinateHelper:t,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:s}=this;if(n==null)return i;if(!this.hasZ)return n.defaultZ=null,n;const o=this.elevationInfo?.mode;let r=this.defaultZ,l=e||o==="absolute-height";return s!=null&&(l=s),o==="on-the-ground"&&(l=!1),this._drawAtFixedElevation&&(r=(e?this.constraintZ:null)??t.getZ(this._activeComponent.vertices[0].pos),l=!1),l?i:(n.defaultZ=r,n)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode==="click"&&e.pointerType==="touch"&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType==="mouse"&&e.button===2||this._manipulator.dragging))try{const{drawingMode:t,geometryType:i}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;const n=this._screenToMap(e.screenPoint);if(n==null||n==null||t==="freehand"&&i!=="point")return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(n),this.committableVertex==null)return void this.complete();this.commitStagedVertex(),e.pointerType!=="mouse"&&this._processCursor(null),(t==="freehand"||i==="point"||i==="segment"&&this.numCommittedVertices===2||i==="segment"&&t==="hybrid"&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType==="point"||(this.complete(),e.stopPropagation())}_onPointerMove(e){const t=$s(e.x,e.y);this._stagedScreenPoint=t,this._stagedPointerType=e.pointerType,this._stagedPointerId=e.pointerId,this._isDragging?this._snappingOperation.abort():(e.stopPropagation(),this._processCursorMovementRelativeToSurface(t,e.pointerType))}_onKeyboardBasedChange(){this._stagedPointerType==="mouse"&&this._stagedScreenPoint&&this._stagedPointerId!=null&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(e,t){const i=this._snappingOperation,n=this._screenToMap(e),s=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(n==null)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const o=this.snappingManager;if(o==null)return this._processCursor(n),void i.abort();const r=this._getSnappingContext(t);this._updatingHandles.addPromise(ns(i.snap({point:n,scenePoint:s},o,r)))}_applyConstraints(e){const{_constraint:t,constraints:i}=this;if(!e||!i||!t)return e;const{context:n}=i,s=Sn(e,n),o=s?t.closestTo(s):void 0;if(!o)return e;const r=wp(o,e,n),l=this.view.type==="2d"||n.elevationInfo.mode!=="absolute-height";return r!=null&&l&&this.constraintZ!=null&&this.hasZ&&(r.z=this.constraintZ),r}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action==="start"&&(e=this._screenToMap(t.screenStart)),e==null)return null;const i=this._screenToMap(t.screenEnd);return i!=null?{...t,mapStart:e,mapEnd:i}:null}}_vertexWithinPointerDistance(e,t){const i=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return i!=null&&cg(i,t,25)}_getSnappingContext(e){const t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t!=null?{value:t,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function cg(e,t,i){const n=e.x-t.x,s=e.y-t.y;return n*n+s*s<=i}a([c()],T.prototype,"_hideDefaultCursor",void 0),a([c()],T.prototype,"_stagedPointerId",void 0),a([c()],T.prototype,"_isDragging",null),a([c()],T.prototype,"_snappingOperation",void 0),a([c()],T.prototype,"_snappingEnabled",null),a([c({constructOnly:!0})],T.prototype,"graphic",void 0),a([c()],T.prototype,"constraintsEnabled",void 0),a([c()],T.prototype,"constraints",void 0),a([c()],T.prototype,"_constraint",null),a([c()],T.prototype,"constraintZ",void 0),a([c()],T.prototype,"defaultZ",void 0),a([c()],T.prototype,"isDraped",void 0),a([c({value:pl})],T.prototype,"drawingMode",null),a([c({constructOnly:!0})],T.prototype,"elevationDrawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"elevationInfo",void 0),a([c({constructOnly:!0,type:An})],T.prototype,"labelOptions",void 0),a([c({constructOnly:!0})],T.prototype,"geometryType",void 0),a([c({constructOnly:!0})],T.prototype,"hasM",void 0),a([c({constructOnly:!0})],T.prototype,"hasZ",void 0),a([c()],T.prototype,"cursor",void 0),a([c()],T.prototype,"effectiveCursor",null),a([c()],T.prototype,"loading",void 0),a([c({constructOnly:!0})],T.prototype,"manipulators",void 0),a([c({constructOnly:!0})],T.prototype,"drawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"segmentLabels",void 0),a([c({constructOnly:!0})],T.prototype,"snappingManager",void 0),a([c({constructOnly:!0})],T.prototype,"snappingVisualizer",void 0),a([c()],T.prototype,"snapToSceneEnabled",void 0),a([c({readOnly:!0})],T.prototype,"cursorVertex",null),a([c({readOnly:!0})],T.prototype,"visualizationCursorVertex",null),a([c()],T.prototype,"committableVertex",null),a([c()],T.prototype,"firstVertex",void 0),a([c()],T.prototype,"lastVertex",void 0),a([c()],T.prototype,"secondToLastVertex",void 0),a([c()],T.prototype,"updating",null),a([c({constructOnly:!0})],T.prototype,"view",void 0),T=a([x("esri.views.draw.DrawOperation")],T);let hg=class{constructor(e,t=!1,i=0){this.view=e,this.hasZ=t,this.defaultZ=i,this.mapToScreen=n=>e.toScreen(n),this.screenToMap=t?n=>{const s=e.toMap(n);return s.z=i,s}:n=>e.toMap(n)}constrainZ(e){const{defaultZ:t}=this;return this.hasZ&&e.z!==t&&((e=sa(e)).z=t),e}};new ue;let ai=class extends P{constructor(e){super(e),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??iu,regularVertices:e.regularVerticesSymbol??nu,activeVertex:e.activeVertexSymbol??su,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles($(()=>this.view?.effectiveTheme?.accentColor,t=>{if(!t)return;const i=this._visualElementSymbols.activeVertex.clone().set({color:t});this._visualElementGraphics.activeVertex?.set("symbol",i),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:i}},es))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return this._visualElementSymbols.fill!=null&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(ji),W()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:i}=this;return this._createOrUpdateGraphic(null),new T({view:i,manipulators:this.manipulators,geometryType:Of(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new hg(i,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new tu(this.internalGraphicsLayer),graphic:this.graphic,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){if(this.geometryType==="point")return W();const[t,i]=e,n=new C({x:t,y:i,spatialReference:this.view.spatialReference});return this._visualElementGraphics.activeVertex!=null?(this._visualElementGraphics.activeVertex.geometry=n,W()):(this._visualElementGraphics.activeVertex=new It({geometry:n,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(ji),W(()=>{this._visualElementGraphics.activeVertex!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=dt(this._visualElementGraphics.activeVertex))}))}onCursorEdgeChanged(e){return this._visualElementGraphics.activeEdge!=null?(this._visualElementGraphics.activeEdge.geometry=e,W()):(this._visualElementGraphics.activeEdge=new It({geometry:e,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeEdge),this.internalGraphicsLayer.graphics.sort(ji),W(()=>{this._visualElementGraphics.activeEdge!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeEdge),this._visualElementGraphics.activeEdge=dt(this._visualElementGraphics.activeEdge))}))}onRegularVerticesChanged(e){const t=new Mr({points:e,spatialReference:this.view.spatialReference});return this._visualElementGraphics.regularVertices!=null?(this._visualElementGraphics.regularVertices.geometry=t,W()):(this._visualElementGraphics.regularVertices=new It({geometry:t,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(ji),W(()=>{this._visualElementGraphics.regularVertices!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=dt(this._visualElementGraphics.regularVertices))}))}};function ji(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}a([c()],ai.prototype,"activeFillSymbol",void 0),a([c({readOnly:!0})],ai.prototype,"type",void 0),a([c({constructOnly:!0,nonNullable:!0})],ai.prototype,"view",void 0),ai=a([x("esri.views.2d.interactive.editingTools.draw.DrawGraphicTool2D")],ai);let Eo=class{get hovering(){return this.someManipulator(e=>e.hovering)}get grabbing(){return this.someManipulator(e=>e.grabbing)}get dragging(){return this.someManipulator(e=>e.dragging)}hasManipulator(e){return this.someManipulator(t=>t===e)}someManipulator(e){let t=!1;return this.forEachManipulator(i=>{!t&&e(i)&&(t=!0)}),t}};var Mi;(function(e){e[e.TRANSLATE_XY=0]="TRANSLATE_XY",e[e.SCALE=1]="SCALE",e[e.ROTATE=2]="ROTATE"})(Mi||(Mi={}));function Cl(e){let t=0,i=0,n=0;return e?(e.type==="cim"&&e.data.symbol&&"symbolLayers"in e.data.symbol&&e.data.symbol.symbolLayers&&e.data.symbol.symbolLayers.map(s=>{s.type==="CIMVectorMarker"&&s.anchorPoint&&(Math.abs(s.anchorPoint.x)>t&&(t=s.anchorPoint.x),Math.abs(s.anchorPoint.y)>i&&(i=s.anchorPoint.y),s.size!=null&&s.size>n&&(n=s.size))}),t=ze(t),i=ze(i),n=ze(n),{offsetX:t,offsetY:i,size:n}):{offsetX:t,offsetY:i,size:n}}let X=class extends tt{set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const{layer:e}=this.graphic,t=e&&"elevationInfo"in e?e.elevationInfo:null,i=Gc(this.graphic),n=t?t.offset:0;return new Nh({mode:i,offset:n})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new Ce.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const t=this.graphic;if(t.visible===!1)return null;const i=t.geometry;if(i==null)return null;const n=this._get("focusedSymbol"),s=n??t.symbol;return this.view.type==="2d"?this._intersectDistance2D(this.view,e,i,s):this._intersectDistance3D(this.view,e,t)}attach(){this.attachSymbolChanged(),this.layer!=null&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this.layer!=null&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=$(()=>this.graphic?.symbol,e=>{e!=null&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&this.focusedSymbol!=null&&(this.graphic.symbol=this.focusedSymbol))},Us)}detachSymbolChanged(){this._graphicSymbolChangedHandle!=null&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&this.focusedSymbol!=null?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,t,i,n){if((n=n||Jl(i))==null)return null;const s=1;let o=this._circleCollisionCache;if(i.type==="point"&&n.type==="cim"&&n.data.symbol?.type==="CIMPointSymbol"&&n.data.symbol.symbolLayers){const{offsetX:r,offsetY:l,size:h}=Cl(n),u=Co(t,wr),p=h/2,d=e.toScreen(i),m=d.x+r,f=d.y+l;return sn(u,[m,f])this._tool.manipulators.add(t))}destroy(){this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._graphic=null}forEachManipulator(e){e(this._manipulator,Mi.TRANSLATE_XY)}createDragPipeline(e,t){let i=null,n=null,s=0,o=0,r=0;const{offsetX:l,offsetY:h,size:u}=Cl(this._graphic.symbol);return He(this._manipulator,(p,d)=>{d.next(m=>{if(m.action==="start"){const f=e();i=f.editGeometryOperations,n=f.constraints}return m}).next(To(this._view)).next(m=>{const{x:f,y:_,z:y}=m.mapEnd;if(n&&(f+ln.xmax||_+h-u>n.ymax))return m;(m.action==="start"||s===0&&o===0&&r===0)&&(s=m.mapStart.x,o=m.mapStart.y,r=m.mapStart.z);const w=f-s,b=_-o,S=y-r;s=f,o=_,r=y;const I=m.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,K=i.move(w,b,S,I);return t(m,K),m})})}_createManipulator(){const e=this._view,t=this._graphic;return new X({view:e,graphic:t,selectable:!0,cursor:"move"})}};const Ut={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:Yr},ug=1,pg=10,Tr=new _i("#009af2");let Bt=class extends B{constructor(e){super(e),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0,this.type="reshape"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._controlPointManipulations.forEach(t=>t.destroy()),this._controlPointEditGeometryOperations.forEach(t=>t.destroy()),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return Ns(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const e=this._undoStack[this._undoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canUndo}canRedo(){const e=this._redoStack[this._redoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canRedo}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();this._controlPointEditGeometryOperations[e].undo(),this.updateGraphics(),this._redoStack.push(e)}}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();this._controlPointEditGeometryOperations[e].redo(),this.updateGraphics(),this._undoStack.push(e)}}refresh(){const{mediaElement:e}=this;if(e.georeference==null)return;const t=e.georeference;t.type==="control-points"&&t.coords!=null&&(this._georeference=t,this._georeference.controlPoints.forEach(({mapPoint:i},n)=>{const s=this._controlPointEditGeometryOperations[n],o=s.data.components[0].vertices[0];s.setVertexPosition(o,s.data.coordinateHelper.pointToVector(i))}),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._georeference,t=e.controlPoints,i=t[0].mapPoint.spatialReference,n=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map((s,o)=>{const r=s.data.geometry;return this._controlPointGraphics[o].geometry=r,{mapPoint:Xe(r,i),sourcePoint:n?t[o].sourcePoint:e.toSource(r)}})}updateActiveHandle(e){if(this.activeHandle===e)return;const t=this._controlPointGraphics[this.activeHandle].symbol.clone();No(t,this.view.effectiveTheme.accentColor),this._controlPointGraphics[this.activeHandle].symbol=t;const i=this._controlPointGraphics[e].symbol.clone();No(i,Tr),this._controlPointGraphics[e].symbol=i,this.activeHandle=e,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const e=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=e.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,mediaElement:t}=this;if(t.georeference==null)return;const i=t.georeference;i.type==="control-points"&&i.coords!=null&&(this._georeference=i,this._initialControlPoints=this._georeference.controlPoints,e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map(({mapPoint:n})=>wo.fromGeometry(Xe(n,e.spatialReference),Ti.Local)),this._controlPointGraphics=this._controlPointEditGeometryOperations.map((n,s)=>new It({symbol:new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:s===this.activeHandle?Tr.toArray():this.view.effectiveTheme.accentColor.toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:n.data.geometry})),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map(n=>new Rl({tool:this,view:e,graphic:n})),this.addHandles([...this._controlPointManipulations.map((n,s)=>n.createDragPipeline(this._getInfo.bind(this,s),(o,r)=>{o.action==="start"&&(this._undoStack.push(s),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0),this.updateGraphics()})),$(()=>this.view.scale,()=>this.active?this.updateGraphics():null)]),this._controlPointManipulations.forEach((n,s)=>{const o=r=>{this.addHandles([r.events.on(["click","grab-changed"],l=>this.updateActiveHandle(s))])};n.forEachManipulator(o)}),this.addHandles([e.on("key-down",n=>{e.activeTool===this&&(n.key!==Ut.shift||n.repeat||(this._isModifierActive=!0,n.stopPropagation()),n.key!==Ut.toggleOpacity||n.repeat||(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,n.stopPropagation()),n.key!==Ut.primaryKey||n.repeat||(this._factor=pg,n.stopPropagation()),this._isModifierActive&&(n.key===Ut.up&&(this._move(0,this._factor),n.stopPropagation()),n.key===Ut.down&&(this._move(0,-this._factor),n.stopPropagation()),n.key===Ut.left&&(this._move(-this._factor,0),n.stopPropagation()),n.key===Ut.right&&(this._move(this._factor,0),n.stopPropagation())))}),e.on("key-up",n=>{e.activeTool===this&&(n.key===Ut.shift&&(this._isModifierActive=!1,n.stopPropagation()),n.key===Ut.primaryKey&&(this._factor=ug,n.stopPropagation()))})]))}async _loadProjectionEngine(){const e=this._georeference.controlPoints[0].mapPoint;return ea(e.spatialReference,this.view.spatialReference)}_getInfo(e){return{editGeometryOperations:this._controlPointEditGeometryOperations[e],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(e,t){const i=this._controlPointEditGeometryOperations[this.activeHandle].move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],Bt.prototype,"_hasValidSpatialReference",null),a([c()],Bt.prototype,"activeHandle",void 0),a([c({constructOnly:!0,nonNullable:!0})],Bt.prototype,"mediaElement",void 0),a([c({readOnly:!0})],Bt.prototype,"type",void 0),a([c({constructOnly:!0})],Bt.prototype,"view",void 0),Bt=a([x("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],Bt);function Vl(e,t){e.action==="start"?t.cursor="grabbing":t.cursor="grab"}class dg{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null){const i={...this._lastDragEvent,action:"update"};t&&this._adjustScaleFactors(i),this.next.execute(i)}this._enabled=t}createDragEventPipelineStep(){return this._lastDragEvent=null,t=>(this._lastDragEvent=t.action!=="end"?{...t}:null,this._enabled&&this._adjustScaleFactors(t),t)}_adjustScaleFactors(t){const i=t.direction[0]!==0&&t.direction[1]!==0?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):t.direction[0]===0?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-i:i,t.factor2=t.factor2<0?-i:i}}let fg=class{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&this._lastDragEvent!=null){const t={...this._lastDragEvent,action:"update"};e&&this._adjustRotateAngle(t),this.next.execute(t)}this._enabled=e}createDragEventPipelineStep(){return this._lastDragEvent=null,e=>(this._lastDragEvent=e.action!=="end"?{...e}:null,this._enabled&&this._adjustRotateAngle(e),e)}_adjustRotateAngle(e){const t=Or(e.rotateAngle);e.rotateAngle=Ir(5*Math.round(t/5))}};function gg(e,t,i,n=!1){const s=Math.atan2(t.y-i.y,t.x-i.x)-Math.atan2(e.y-i.y,e.x-i.x),o=Math.atan2(Math.sin(s),Math.cos(s));return n?o:Or(o)}function Al(e,t){return mg(e,t,!1)}function mg(e,t,i){if(e instanceof gl){if(e.operation instanceof vl)return yg(e.operation,t,i),!0;if(e.operation instanceof bl)return _g(e.operation,t,i),!0;if(e.operation instanceof In)return vg(e.operation,t,i),!0}return!1}function yg(e,t,i=!1){const n=i?-1:1,s=pe(n*e.dx,n*e.dy,n*e.dz);ut(t.origin,t.origin,s),xn(t)}function _g(e,t,i=!1){const n=i?-e.angle:e.angle;zo(t.basis1,t.basis1,Ao,n),zo(t.basis2,t.basis2,Ao,n),xn(t)}function vg(e,t,i=!1){const n=i?1/e.factor1:e.factor1,s=i?1/e.factor2:e.factor2;fe(t.basis1,t.basis1,n),fe(t.basis2,t.basis2,s),on(t.origin,t.origin,e.origin,e.axis1,n),on(t.origin,t.origin,e.origin,e.axis2,s),xn(t)}function xg(e,t,i,n){n||(n=Ei());const s=Wt(ii.get(),e[1],-e[0]),o=Wt(ii.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=Wt(ii.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l=ii.get();t.components.forEach(p=>p.vertices.forEach(({pos:d})=>{Wt(l,_e(e,d),_e(s,d)),xc(o,o,l),bc(r,r,l)}));const h=1e-6,u=Wt(ii.get(),r[0]-o[0]Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._snapRotation=null,this._graphic=null,this._handles=null,this._originCache=null}forEachManipulator(t){t(this._manipulator,Mi.ROTATE)}createDragPipeline(t,i){let n=null,s=null;return He(this._manipulator,(o,r)=>{r.next(l=>{if(l.action==="start"){o.cursor="grabbing";const h=t();n=h.plane,s=h.editGeometryOperations}return l}).next(To(this._view)).next(l=>({...l,rotateAngle:gg(l.mapStart,l.mapEnd,{x:n.origin[0],y:n.origin[1]},!0)})).next(this._snapRotation.createDragEventPipelineStep(),this._snapRotation.next).next(l=>{const h=rt(this._originCache,n.origin),u=l.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,p=s.rotate(h,l.rotateAngle,u,nt.REPLACE);return Al(p,n),i(l,p),l}).next(l=>(l.action==="end"&&(o.cursor="grab"),l))})}_createManipulator(){const t=this._view,i=this._graphic;return new X({view:t,graphic:i,selectable:!0,cursor:"grab"})}}const ts=10,Er=1e-6,wg=.3;function Sr(e){const t=xi(e.basis1),i=xi(e.basis2);return wg*Math.min(t,i)}class Tg extends Eo{constructor(t){super(),this._handles=new Lr,this._planeStart=Ei(),this._displayPlaneStart=Ei(),this._originCache=g(),this._axisCache=G(),this._renderStartCache=g(),this._renderEndCache=g(),this._resizeOriginCache=g(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._direction=t.direction,this._preserveAspectRatio=t.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",i=>Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,Mi.SCALE)}createDragPipeline(t,i){let n=null,s=null,o=null,r=0,l=null,h=null;const u=this._planeStart,p=this._displayPlaneStart,d=this._direction;return He(this._manipulator,(m,f)=>{f.next(_=>{if(_.action==="start"){m.cursor="grabbing";const y=t();n=y.plane,s=y.displayPlane,o=y.editGeometryOperations,r=ts*this._view.resolution,Qi(n,u),Qi(s,p);const w=Ur(o.data.spatialReference);l=w?w.valid[1]-w.valid[0]-3*ts*this._view.resolution:null}return _}).next(To(this._view)).next(_=>{const y=rt(this._renderStartCache,[_.mapStart.x,_.mapStart.y,0]),w=rt(this._renderEndCache,[_.mapEnd.x,_.mapEnd.y,0]),b=rt(this._resizeOriginCache,p.origin);z(b,b,p.basis1,-d[0]),z(b,b,p.basis2,-d[1]),Et(w,w,b),Et(y,y,b);const S=d[0]!==0&&d[1]!==0,I=Sr(p),K=Sr(s)/I,et=(lt,ei)=>{if(lt===0)return 1;let zt=xi(ei),ie=.5*lt*Z(ei,w)/zt;const be=ie<0?-1:1;S&&(ie+=(zt-.5*lt*Z(ei,y)/zt)*be*K);const Ln=zt<1.5*r?1:Er;return zt=Math.max(zt-r,Er),be>0&&(ie-=ts*this._view.resolution),be*Math.max(be*(ie/zt),Ln)},Y=et(d[0],p.basis1),gt=et(d[1],p.basis2);return{..._,direction:d,factor1:Y,factor2:gt}}).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(_=>{const y=rt(this._originCache,u.origin);z(y,y,u.basis1,-d[0]),z(y,y,u.basis2,-d[1]);const w=Wt(this._axisCache,u.basis1[0],u.basis1[1]);Ws(w,w);const b=o.data.allVertices,S=_.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,I=o.scaleVertices(b,y,w,_.factor1,_.factor2,S,nt.REPLACE);return l&&l(_.action==="end"&&(m.cursor="grab"),_))})}_createManipulator(){return new X({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}function Eg(e){return e?.type==="graphic"}function Sg(e){return e.find(Eg)??null}const Pg=80,Mg=10,kg=30,Cg=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Pr=1,Rg=10;let _t=class extends B{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=Ei(),this._displayPlaneCache=Ei(),this._mainAxisCache=G(),this._rotationHandleCache=g(),this._cornerA=g(),this._cornerB=g(),this._cornerC=g(),this._cornerD=g(),this._avgAB=g(),this._avgBC=g(),this._avgCD=g(),this._avgDA=g(),this._preserveAspectRatio=new dg,this._snapRotation=new fg,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=Pr,this.preserveAspectRatio=null,this.snapRotation=null,this.type="transform"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(t=>t.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(e==null)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],n=q(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);Ws(n,n);let s=Pg*this.view.resolution;const o=this.view.spatialReference;return Qe(o,e.spatialReference)&&(s*=vi(o)/vi(e.spatialReference)),xg(n,t,s,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;Qi(e,t);const i=Mg*this.view.resolution;return fe(t.basis1,t.basis1,1+i/xi(t.basis1)),fe(t.basis2,t.basis2,1+i/xi(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new De({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return le(t,e.basis1),fe(t,t,kg*this.view.resolution),ut(t,t,e.origin),ut(t,t,e.basis1),new C({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:n,_cornerC:s,_cornerD:o}=this,r=Pe(this._avgAB,i,n,.5),l=Pe(this._avgBC,n,s,.5),h=Pe(this._avgCD,s,o,.5),u=Pe(this._avgDA,o,i,.5);return[new C({x:i[0],y:i[1],spatialReference:t}),new C({x:n[0],y:n[1],spatialReference:t}),new C({x:s[0],y:s[1],spatialReference:t}),new C({x:o[0],y:o[1],spatialReference:t}),new C({x:r[0],y:r[1],spatialReference:t}),new C({x:l[0],y:l[1],spatialReference:t}),new C({x:h[0],y:h[1],spatialReference:t}),new C({x:u[0],y:u[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,n=this._editGeometryOperations,s=n.data.components[0].vertices,o=dn.fromGeometry(Xe(i,e.spatialReference),Ti.Local).components[0].vertices;s.forEach((r,l)=>{n.setVertexPosition(r,o[l].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;t.type==="control-points"&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;"georeference"in this.target&&(this.target.georeference.coords=e),this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((t,i)=>{this._scaleGraphics[i].geometry=t})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:t}=this;if("georeference"in t){const s=t.georeference;this._graphic=new It({geometry:s.coords}),this._initialControlPoints=s.type==="control-points"?s.controlPoints:null}else this._graphic=t,this._initialGeometry=t.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=wo.fromGeometry(Xe(this._graphic.geometry,e.spatialReference),Ti.Local),this._backgroundGraphic=new It({symbol:new Dl({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new It({symbol:new Ne({color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(s=>new It({symbol:new Ne({size:6,style:"square",color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new Rl({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new bg({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((s,o)=>new Tg({tool:this,view:e,graphic:s,direction:Cg[o],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(s=>s.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),$(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async s=>{if(e.activeTool!=null&&e.activeTool!==this)return;const o=Xc(s),r=[];e.map.allLayers.forEach(u=>{u.type!=="vector-tile"&&u.type!=="imagery"||r.push(u)});const l=await this.view.hitTest(o,{exclude:r}),h=l.results;if(h.length===0)e.activeTool=null;else{const u=Sg(l.results),p="georeference"in t,d=h.map(f=>f.type==="media"?f.element:null).filter(Boolean),m=new Set([...this._graphicsLayer.graphics,p?null:t].filter(Boolean));p&&d.includes(t)||u!=null&&m.has(u.graphic)?e.activeTool==null&&(e.activeTool=this):e.activeTool=null}})]);const i=s=>{this.addHandles(s.events.on("grab-changed",o=>{"georeference"in t&&(o.action==="start"?t.opacity*=.5:o.action==="end"&&(t.opacity*=2))}))};this._dragManipulation.forEachManipulator(i),this._rotateManipulation.forEachManipulator(i),this._scaleManipulations.forEach(s=>s.forEachManipulator(i));const n=new Mp;n.addToggle(kt.preserveAspectRatio,()=>{this.preserveAspectRatio==null&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)}),n.addToggle(kt.rotateIncrements,()=>{this.snapRotation==null&&(this._snapRotation.enabled=!this._snapRotation.enabled)}),n.add(kt.toggleOpacity,()=>{"georeference"in t&&(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),n.addToggle(kt.factorModifier,s=>this._factor=s.type==="key-down"?Rg:Pr),n.add(kt.scaleUp,()=>this._scale(this._factor)),n.add(kt.scaleDown,()=>this._scale(-this._factor)),n.add(kt.moveUp,()=>this._move(0,this._factor)),n.add(kt.moveDown,()=>this._move(0,-this._factor)),n.add(kt.moveLeft,()=>this._move(-this._factor,0)),n.add(kt.moveRight,()=>this._move(this._factor,0)),this.addHandles([e.on("key-down",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)}),e.on("key-up",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return ea(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:n}=e,s=this._cornerA;ut(s,n,t),ut(s,s,i);const o=this._cornerB;ut(o,n,t),Et(o,o,i);const r=this._cornerC;Et(r,n,t),Et(r,r,i);const l=this._cornerD;Et(l,n,t),ut(l,l,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){e.action==="start"&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,n=(i+e*this.view.resolution)/i,s=t.scale(this._plane.origin,kc,n,n,L.NEW_STEP,nt.REPLACE);this._sharedUndoStack.push({tool:this,operation:s}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],_t.prototype,"_plane",null),a([c()],_t.prototype,"_backgroundGraphicGeometry",null),a([c()],_t.prototype,"_rotateGraphicGeometry",null),a([c()],_t.prototype,"_scaleGraphicGeometries",null),a([c()],_t.prototype,"preserveAspectRatio",void 0),a([c()],_t.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],_t.prototype,"target",void 0),a([c({readOnly:!0})],_t.prototype,"type",void 0),a([c({constructOnly:!0})],_t.prototype,"view",void 0),_t=a([x("esri.views.2d.interactive.editingTools.TransformTool")],_t);const Ki={redo:"r",undo:"z"};let ne=class extends tt{constructor(e){super(e),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:e,mediaElement:t,preserveAspectRatio:i,snapRotation:n,advancedMode:s}=this;this._originalOpacity=t.opacity,this._transformTool=new _t({target:t,view:e,preserveAspectRatio:i,snapRotation:n}),this._controlPointsTransformTool=new Bt({mediaElement:t,view:e}),this._advancedModeTransformTool=new Bt({mediaElement:s.mediaElement,view:s.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const o=t.georeference,r=s.mediaElement.georeference;s.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in r&&"controlPoints"in o&&this.addHandles([s.view.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),s.view.on("focus",async l=>{this._controlPointsTransformTool.removeHighlightActiveHandle(),this._advancedModeTransformTool.highlightActiveHandle()}),$(()=>r.controlPoints,l=>{o.controlPoints=l.map(({sourcePoint:h},u)=>({sourcePoint:h,mapPoint:o.controlPoints[u].mapPoint})),this._activeTool?.refresh()}),$(()=>this._controlPointsTransformTool.activeHandle,l=>{this._advancedModeTransformTool.updateActiveHandle(l),this.activeHandle=l}),$(()=>this._advancedModeTransformTool.activeHandle,l=>{this._controlPointsTransformTool.updateActiveHandle(l),this.activeHandle=l})]),this.addHandles([e.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),e.on("focus",async l=>{this._advancedModeTransformTool.removeHighlightActiveHandle(),this._controlPointsTransformTool.highlightActiveHandle()})]),e.tools.addMany([this._transformTool,this._controlPointsTransformTool]),e.activeTool=this._transformTool,this._activeTool=this._transformTool,e.focus()}destroy(){this._transformTool?.destroy(),this._controlPointsTransformTool?.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){if(this._sharedUndoStack.length>0){const{tool:e,operation:t}=this._sharedUndoStack.pop();e!==this._activeTool&&e.refresh(),t.undo(),e.updateGraphics(),this._sharedRedoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}redo(){if(this._sharedRedoStack.length>0){const{tool:e,operation:t}=this._sharedRedoStack.pop();e!==this._activeTool&&e.refresh(),t.apply(),e.updateGraphics(),this._sharedUndoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._originalOpacity=this._controlPointsTransformTool.mediaElement.opacity,this._controlPointsTransformTool.mediaElement.opacity=.25*this._originalOpacity}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=this._originalOpacity}};a([c()],ne.prototype,"activeHandle",void 0),a([c({constructOnly:!0})],ne.prototype,"advancedMode",void 0),a([c()],ne.prototype,"preserveAspectRatio",void 0),a([c()],ne.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],ne.prototype,"mediaElement",void 0),a([c({constructOnly:!0})],ne.prototype,"view",void 0),ne=a([x("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],ne);export{Bt as ControlPointsTransformTool,ai as DrawGraphicTool2D,ne as MediaTransformToolsWrapper,_t as TransformTool}; diff --git a/main/assets/editsZScale-BDsX6vv--CeDyYvz6.js b/main/assets/editsZScale-BDsX6vv--CeDyYvz6.js deleted file mode 100644 index 345b0e0c7..000000000 --- a/main/assets/editsZScale-BDsX6vv--CeDyYvz6.js +++ /dev/null @@ -1 +0,0 @@ -import{dV as a,aC as c}from"./main-BZaw9FpY.js";function i(n,f,o){if(n.hasM==null||n.hasZ)for(const e of f)for(const t of e)t.length>2&&(t[2]*=o)}function u(n,f,o){if(!n&&!f||!o)return;const e=a(o);r(n,o,e),r(f,o,e)}function r(n,f,o){if(n)for(const e of n)l(e.geometry,f,o)}function l(n,f,o){if(!n?.spatialReference||c(n.spatialReference,f))return;const e=a(n.spatialReference)/o;if(e!==1){if("x"in n)n.z!=null&&(n.z*=e);else if("rings"in n)i(n,n.rings,e);else if("paths"in n)i(n,n.paths,e);else if("points"in n&&(n.hasM==null||n.hasZ))for(const t of n.points)t.length>2&&(t[2]*=e)}}export{u as c}; diff --git a/main/assets/editsZScale-BDsX6vv--CoeIQyxn.js b/main/assets/editsZScale-BDsX6vv--CoeIQyxn.js new file mode 100644 index 000000000..c4501ef50 --- /dev/null +++ b/main/assets/editsZScale-BDsX6vv--CoeIQyxn.js @@ -0,0 +1 @@ +import{dV as a,aC as c}from"./main-C7yV2j71.js";function i(n,f,o){if(n.hasM==null||n.hasZ)for(const e of f)for(const t of e)t.length>2&&(t[2]*=o)}function u(n,f,o){if(!n&&!f||!o)return;const e=a(o);r(n,o,e),r(f,o,e)}function r(n,f,o){if(n)for(const e of n)l(e.geometry,f,o)}function l(n,f,o){if(!n?.spatialReference||c(n.spatialReference,f))return;const e=a(n.spatialReference)/o;if(e!==1){if("x"in n)n.z!=null&&(n.z*=e);else if("rings"in n)i(n,n.rings,e);else if("paths"in n)i(n,n.paths,e);else if("points"in n&&(n.hasM==null||n.hasZ))for(const t of n.points)t.length>2&&(t[2]*=e)}}export{u as c}; diff --git a/main/assets/elevationInfoUtils-mOZsPH2J-Bwot-813.js b/main/assets/elevationInfoUtils-mOZsPH2J-Bwot-813.js new file mode 100644 index 000000000..c44f21cbe --- /dev/null +++ b/main/assets/elevationInfoUtils-mOZsPH2J-Bwot-813.js @@ -0,0 +1 @@ +import{jw as g,dW as m}from"./main-C7yV2j71.js";import{j as h}from"./ElevationInfo-yv2-9tj6-CpVy5FM0.js";function c(e){return e?y:I}function p(e,n){return n?.mode?n.mode:c(e).mode}function w(e,n){return n??c(e)}function f(e,n){return p(e==null||(e.hasZ??!1),n)}function $(e){const n=d(e);return f(e.geometry,n)}function R(e){const n=d(e),t=f(e.geometry,n),o=n!=null&&t!=="on-the-ground"?x(n):0,r=n?.featureExpressionInfo;return{mode:t,offset:o,featureExpressionInfo:r}}function d(e){return e.layer&&"elevationInfo"in e.layer?e.layer.elevationInfo:null}function s(e,n){if(!e?.offset)return 0;const{offset:t,unit:o}=e;if(o==="decimal-degrees")return 0;const r=o!=="unknown"&&o?o:"meters",i=g(n);return i?m(t,r,i):0}function j(e,n,t){if(!t?.mode)return;const o=e.hasZ?e.z:0,r=s(t,e.spatialReference);switch(t.mode){case"absolute-height":return o-r;case"on-the-ground":return 0;case"relative-to-ground":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"ground")??0)+r);case"relative-to-scene":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"scene")??0)+r)}}function z(e,n,t,o=null){return v(e,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,t,o)}function k(e,n,t,o,r=null){return v(e,n[0],n[1],n.length>2?n[2]:0,t,o,r)}function v(e,n,t,o,r,i,l=null){if(i==null)return;const u=l!=null?l.mode:"absolute-height";if(u==="on-the-ground")return 0;const{absoluteZ:a}=E(n,t,o,r,e,i);return b(a,n,t,o,r,e,l,u)}function E(e,n,t,o,r,i){const l=s(i,o);switch(i.mode){case"absolute-height":return{absoluteZ:t+l,elevation:0};case"on-the-ground":{const u=r.elevationProvider.getElevation(e,n,0,o,"ground")??0;return{absoluteZ:u,elevation:u}}case"relative-to-ground":{const u=r.elevationProvider.getElevation(e,n,t,o,"ground")??0;return{absoluteZ:t+u+l,elevation:u}}case"relative-to-scene":{const u=r.elevationProvider.getElevation(e,n,t,o,"scene")??0;return{absoluteZ:t+u+l,elevation:u}}}}function b(e,n,t,o,r,i,l,u){const a=s(l,r);switch(u){case"absolute-height":return e-a;case"relative-to-ground":return e-((i.elevationProvider.getElevation(n,t,o,r,"ground")??0)+a);case"relative-to-scene":return e-((i.elevationProvider.getElevation(n,t,o,r,"scene")??0)+a)}}function V(e,n,t){return t&&t.mode!==n?`${e} only support ${n} elevation mode`:null}function q(e,n,t){return t?.mode===n?`${e} do not support ${n} elevation mode`:null}function A(e,n){return n?.featureExpressionInfo!=null&&n.featureExpressionInfo.expression!=="0"?`${e} do not support featureExpressionInfo`:null}function O(e,n){n&&e.warn(".elevationInfo=",n)}function x(e){return(e?.offset??0)*h(e?.unit)}const y={mode:"absolute-height",offset:0},I={mode:"on-the-ground",offset:null};export{R as I,z as P,V as R,j as Z,v as f,E as g,A as j,O as k,f as l,y as m,k as w,w as x,$ as y,q as z}; diff --git a/main/assets/elevationInfoUtils-mOZsPH2J-CGmjotSk.js b/main/assets/elevationInfoUtils-mOZsPH2J-CGmjotSk.js deleted file mode 100644 index 0a4eb3601..000000000 --- a/main/assets/elevationInfoUtils-mOZsPH2J-CGmjotSk.js +++ /dev/null @@ -1 +0,0 @@ -import{jw as g,dW as m}from"./main-BZaw9FpY.js";import{j as h}from"./ElevationInfo-yv2-9tj6-pjIBBQET.js";function c(e){return e?y:I}function p(e,n){return n?.mode?n.mode:c(e).mode}function w(e,n){return n??c(e)}function f(e,n){return p(e==null||(e.hasZ??!1),n)}function $(e){const n=d(e);return f(e.geometry,n)}function R(e){const n=d(e),t=f(e.geometry,n),o=n!=null&&t!=="on-the-ground"?x(n):0,r=n?.featureExpressionInfo;return{mode:t,offset:o,featureExpressionInfo:r}}function d(e){return e.layer&&"elevationInfo"in e.layer?e.layer.elevationInfo:null}function s(e,n){if(!e?.offset)return 0;const{offset:t,unit:o}=e;if(o==="decimal-degrees")return 0;const r=o!=="unknown"&&o?o:"meters",i=g(n);return i?m(t,r,i):0}function j(e,n,t){if(!t?.mode)return;const o=e.hasZ?e.z:0,r=s(t,e.spatialReference);switch(t.mode){case"absolute-height":return o-r;case"on-the-ground":return 0;case"relative-to-ground":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"ground")??0)+r);case"relative-to-scene":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"scene")??0)+r)}}function z(e,n,t,o=null){return v(e,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,t,o)}function k(e,n,t,o,r=null){return v(e,n[0],n[1],n.length>2?n[2]:0,t,o,r)}function v(e,n,t,o,r,i,l=null){if(i==null)return;const u=l!=null?l.mode:"absolute-height";if(u==="on-the-ground")return 0;const{absoluteZ:a}=E(n,t,o,r,e,i);return b(a,n,t,o,r,e,l,u)}function E(e,n,t,o,r,i){const l=s(i,o);switch(i.mode){case"absolute-height":return{absoluteZ:t+l,elevation:0};case"on-the-ground":{const u=r.elevationProvider.getElevation(e,n,0,o,"ground")??0;return{absoluteZ:u,elevation:u}}case"relative-to-ground":{const u=r.elevationProvider.getElevation(e,n,t,o,"ground")??0;return{absoluteZ:t+u+l,elevation:u}}case"relative-to-scene":{const u=r.elevationProvider.getElevation(e,n,t,o,"scene")??0;return{absoluteZ:t+u+l,elevation:u}}}}function b(e,n,t,o,r,i,l,u){const a=s(l,r);switch(u){case"absolute-height":return e-a;case"relative-to-ground":return e-((i.elevationProvider.getElevation(n,t,o,r,"ground")??0)+a);case"relative-to-scene":return e-((i.elevationProvider.getElevation(n,t,o,r,"scene")??0)+a)}}function V(e,n,t){return t&&t.mode!==n?`${e} only support ${n} elevation mode`:null}function q(e,n,t){return t?.mode===n?`${e} do not support ${n} elevation mode`:null}function A(e,n){return n?.featureExpressionInfo!=null&&n.featureExpressionInfo.expression!=="0"?`${e} do not support featureExpressionInfo`:null}function O(e,n){n&&e.warn(".elevationInfo=",n)}function x(e){return(e?.offset??0)*h(e?.unit)}const y={mode:"absolute-height",offset:0},I={mode:"on-the-ground",offset:null};export{R as I,z as P,V as R,j as Z,v as f,E as g,A as j,O as k,f as l,y as m,k as w,w as x,$ as y,q as z}; diff --git a/main/assets/executeBinsQuery-26-59HNS-B-fN88FW.js b/main/assets/executeBinsQuery-26-59HNS-B-fN88FW.js deleted file mode 100644 index bbaba84df..000000000 --- a/main/assets/executeBinsQuery-26-59HNS-B-fN88FW.js +++ /dev/null @@ -1 +0,0 @@ -import{y as u}from"./utils-9sQxfkoa-Cus_qP6M.js";import{a as f,f as p,bX as y,bM as m,bK as S,aC as c}from"./main-BZaw9FpY.js";import{B as l}from"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import{f as R}from"./query-DFW9-NG_-1nHUNdNu.js";import g from"./BinsQuery-DjwQZqB8-T-ydjXwz.js";import{O}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./queryUtils-Brxu6254-DDAvXp_C.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";function N(i){const r=i.geometry,e=i.toJSON(),t=e;let n,o,a;return r!=null&&(o=r.spatialReference,a=m(o),t.geometryType=S(r),t.geometry=JSON.stringify(r),t.inSR=a),e.outSR?(t.outSR=m(e.outSR),n=i.outSpatialReference):r&&(t.outSR=t.inSR,n=o),t.bin&&=JSON.stringify(t.bin),t.quantizationParameters&&=JSON.stringify(t.quantizationParameters),t.outStatistics&&=JSON.stringify(t.outStatistics),t.outTimeReference&&=JSON.stringify(t.outTimeReference),i.defaultSpatialReference&&c(o,n)&&(t.defaultSR=t.inSR,delete t.inSR,delete t.outSR),t}async function d(i,r,e){return q(i,r,e)}async function q(i,r,e={}){const t=typeof i=="string"?f(i):i,n=r.geometry?[r.geometry]:[],o=await l(n,null,{signal:e.signal}),a=o?.[0];a!=null&&((r=r.clone()).geometry=a);const s=R({...t.query,f:"json",...N(r)});return p(y(t.path,"queryBins"),{...e,query:{...s,...e.query}})}async function A(i,r,e){const{data:t}=await d(u(i),g.from(r),e);return O.fromJSON(t)}export{A as executeBinsQuery}; diff --git a/main/assets/executeBinsQuery-26-59HNS-C05wOd4_.js b/main/assets/executeBinsQuery-26-59HNS-C05wOd4_.js new file mode 100644 index 000000000..13e4a73c5 --- /dev/null +++ b/main/assets/executeBinsQuery-26-59HNS-C05wOd4_.js @@ -0,0 +1 @@ +import{y as u}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{a as f,f as p,bX as y,bM as m,bK as S,aC as c}from"./main-C7yV2j71.js";import{B as l}from"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import{f as R}from"./query-DFW9-NG_-CfusC8cS.js";import g from"./BinsQuery-DjwQZqB8-CUCgQbor.js";import{O}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./queryUtils-Brxu6254-T3UhaATW.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";function N(i){const r=i.geometry,e=i.toJSON(),t=e;let n,o,a;return r!=null&&(o=r.spatialReference,a=m(o),t.geometryType=S(r),t.geometry=JSON.stringify(r),t.inSR=a),e.outSR?(t.outSR=m(e.outSR),n=i.outSpatialReference):r&&(t.outSR=t.inSR,n=o),t.bin&&=JSON.stringify(t.bin),t.quantizationParameters&&=JSON.stringify(t.quantizationParameters),t.outStatistics&&=JSON.stringify(t.outStatistics),t.outTimeReference&&=JSON.stringify(t.outTimeReference),i.defaultSpatialReference&&c(o,n)&&(t.defaultSR=t.inSR,delete t.inSR,delete t.outSR),t}async function d(i,r,e){return q(i,r,e)}async function q(i,r,e={}){const t=typeof i=="string"?f(i):i,n=r.geometry?[r.geometry]:[],o=await l(n,null,{signal:e.signal}),a=o?.[0];a!=null&&((r=r.clone()).geometry=a);const s=R({...t.query,f:"json",...N(r)});return p(y(t.path,"queryBins"),{...e,query:{...s,...e.query}})}async function A(i,r,e){const{data:t}=await d(u(i),g.from(r),e);return O.fromJSON(t)}export{A as executeBinsQuery}; diff --git a/main/assets/executeForIds-Z1gkLduF-BNBrXf-U.js b/main/assets/executeForIds-Z1gkLduF-BNBrXf-U.js new file mode 100644 index 000000000..77e633e33 --- /dev/null +++ b/main/assets/executeForIds-Z1gkLduF-BNBrXf-U.js @@ -0,0 +1 @@ +import{y as c}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{P as m,N as f}from"./query-DFW9-NG_-CfusC8cS.js";import{b as i}from"./Query-BrwMGK8U-DV_czrJX.js";async function p(t,o,r){const n=c(t),{data:a}=await m(n,i.from(o),r);return a.count}async function d(t,o,r){const n=c(t),{data:a}=await f(n,i.from(o),r);return a.objectIds}export{d as e,p as i}; diff --git a/main/assets/executeForIds-Z1gkLduF-Daa1fnES.js b/main/assets/executeForIds-Z1gkLduF-Daa1fnES.js deleted file mode 100644 index cb8f883a6..000000000 --- a/main/assets/executeForIds-Z1gkLduF-Daa1fnES.js +++ /dev/null @@ -1 +0,0 @@ -import{y as c}from"./utils-9sQxfkoa-Cus_qP6M.js";import{P as m,N as f}from"./query-DFW9-NG_-1nHUNdNu.js";import{b as i}from"./Query-BrwMGK8U-sojFdYaD.js";async function p(t,o,r){const n=c(t),{data:a}=await m(n,i.from(o),r);return a.count}async function d(t,o,r){const n=c(t),{data:a}=await f(n,i.from(o),r);return a.objectIds}export{d as e,p as i}; diff --git a/main/assets/executeForTopCount-Dx1gCDe1-Bd3sqrnv.js b/main/assets/executeForTopCount-Dx1gCDe1-Bd3sqrnv.js new file mode 100644 index 000000000..5f5c4ecda --- /dev/null +++ b/main/assets/executeForTopCount-Dx1gCDe1-Bd3sqrnv.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{S as p}from"./queryTopFeatures-IbhAPJlP-JGKZFCDQ.js";import a from"./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js";import"./main-C7yV2j71.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";async function h(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{h as executeForTopCount}; diff --git a/main/assets/executeForTopCount-Dx1gCDe1-Blv1ngys.js b/main/assets/executeForTopCount-Dx1gCDe1-Blv1ngys.js deleted file mode 100644 index 1a537d1a8..000000000 --- a/main/assets/executeForTopCount-Dx1gCDe1-Blv1ngys.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-Cus_qP6M.js";import{S as p}from"./queryTopFeatures-IbhAPJlP-DzgjIri_.js";import a from"./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js";import"./main-BZaw9FpY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";async function h(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{h as executeForTopCount}; diff --git a/main/assets/executeForTopExtents-3NOTiZTn-BAEfYmuL.js b/main/assets/executeForTopExtents-3NOTiZTn-BAEfYmuL.js deleted file mode 100644 index a85ab8ba6..000000000 --- a/main/assets/executeForTopExtents-3NOTiZTn-BAEfYmuL.js +++ /dev/null @@ -1 +0,0 @@ -import{n as p}from"./main-BZaw9FpY.js";import{y as n}from"./utils-9sQxfkoa-Cus_qP6M.js";import{R as e}from"./queryTopFeatures-IbhAPJlP-DzgjIri_.js";import x from"./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";async function T(m,r,i){const a=n(m),o=await e(a,x.from(r),{...i}),t=o.data.extent;return!t||isNaN(t.xmin)||isNaN(t.ymin)||isNaN(t.xmax)||isNaN(t.ymax)?{count:o.data.count,extent:null}:{count:o.data.count,extent:p.fromJSON(t)}}export{T as executeForTopExtents}; diff --git a/main/assets/executeForTopExtents-3NOTiZTn-DGqWdu2v.js b/main/assets/executeForTopExtents-3NOTiZTn-DGqWdu2v.js new file mode 100644 index 000000000..1e8545686 --- /dev/null +++ b/main/assets/executeForTopExtents-3NOTiZTn-DGqWdu2v.js @@ -0,0 +1 @@ +import{n as p}from"./main-C7yV2j71.js";import{y as n}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{R as e}from"./queryTopFeatures-IbhAPJlP-JGKZFCDQ.js";import x from"./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";async function T(m,r,i){const a=n(m),o=await e(a,x.from(r),{...i}),t=o.data.extent;return!t||isNaN(t.xmin)||isNaN(t.ymin)||isNaN(t.xmax)||isNaN(t.ymax)?{count:o.data.count,extent:null}:{count:o.data.count,extent:p.fromJSON(t)}}export{T as executeForTopExtents}; diff --git a/main/assets/executeForTopIds-BWxBZygF-B3N-R4je.js b/main/assets/executeForTopIds-BWxBZygF-B3N-R4je.js deleted file mode 100644 index adc65ca69..000000000 --- a/main/assets/executeForTopIds-BWxBZygF-B3N-R4je.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-Cus_qP6M.js";import{B as p}from"./queryTopFeatures-IbhAPJlP-DzgjIri_.js";import a from"./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js";import"./main-BZaw9FpY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";async function g(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{g as executeForTopIds}; diff --git a/main/assets/executeForTopIds-BWxBZygF-Bqc8aFlq.js b/main/assets/executeForTopIds-BWxBZygF-Bqc8aFlq.js new file mode 100644 index 000000000..5ea7ea824 --- /dev/null +++ b/main/assets/executeForTopIds-BWxBZygF-Bqc8aFlq.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{B as p}from"./queryTopFeatures-IbhAPJlP-JGKZFCDQ.js";import a from"./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js";import"./main-C7yV2j71.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";async function g(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{g as executeForTopIds}; diff --git a/main/assets/executeQueryJSON-CcHnccia-CB1D7q08.js b/main/assets/executeQueryJSON-CcHnccia-CB1D7q08.js new file mode 100644 index 000000000..3df22ef5f --- /dev/null +++ b/main/assets/executeQueryJSON-CcHnccia-CB1D7q08.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{q as s}from"./query-DFW9-NG_-CfusC8cS.js";import{O as c}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{b as e}from"./Query-BrwMGK8U-DV_czrJX.js";async function S(r,t,o){const a=await p(r,t,o);return c.fromJSON(a)}async function p(r,t,o){const a=i(r),m={...o},n=e.from(t),{data:f}=await s(a,n,n.sourceSpatialReference,m);return f}export{p as s,S as u}; diff --git a/main/assets/executeQueryJSON-CcHnccia-DVecwfbV.js b/main/assets/executeQueryJSON-CcHnccia-DVecwfbV.js deleted file mode 100644 index 7883eabfb..000000000 --- a/main/assets/executeQueryJSON-CcHnccia-DVecwfbV.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-Cus_qP6M.js";import{q as s}from"./query-DFW9-NG_-1nHUNdNu.js";import{O as c}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{b as e}from"./Query-BrwMGK8U-sojFdYaD.js";async function S(r,t,o){const a=await p(r,t,o);return c.fromJSON(a)}async function p(r,t,o){const a=i(r),m={...o},n=e.from(t),{data:f}=await s(a,n,n.sourceSpatialReference,m);return f}export{p as s,S as u}; diff --git a/main/assets/executeQueryPBF-o8010HS9-E5WwNUPn.js b/main/assets/executeQueryPBF-o8010HS9-E5WwNUPn.js new file mode 100644 index 000000000..035c0cb52 --- /dev/null +++ b/main/assets/executeQueryPBF-o8010HS9-E5WwNUPn.js @@ -0,0 +1 @@ +import{n as f,O as m}from"./main-C7yV2j71.js";import{y as u}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{w as _,J as p}from"./query-DFW9-NG_-CfusC8cS.js";import{b as l}from"./Query-BrwMGK8U-DV_czrJX.js";import{o as y}from"./projection-BA9M1R7d-DXrPfsKU.js";import{D as P,n as C}from"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./FeatureSet-BkVNthuN-DDwR53LR.js";async function k(o,t,e){const r=u(o),s=await _(r,l.from(t),{...e}),n=s.data.extent;return!n||isNaN(n.xmin)||isNaN(n.ymin)||isNaN(n.xmax)||isNaN(n.ymax)?{count:s.data.count,extent:null}:{count:s.data.count,extent:f.fromJSON(n)}}function g(o,t){return t}function h(o,t,e,r){switch(e){case 0:return i(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?i(o,t+r,1):v(o,t+r,1)}}function d(o,t,e,r){return e===2?i(o,t,2):h(o,t,e,r)}function G(o,t,e,r){return e===2?t===0?0:i(o,t,3):h(o,t,e,r)}function x(o,t,e,r){return e===3?t===0?0:i(o,t,3):d(o,t,e,r)}function i({translate:o,scale:t},e,r){return o[r]+e*t[r]}function v({translate:o,scale:t},e,r){return o[r]-e*t[r]}class M{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=g,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=y(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;m(r),r.push(e);const s=r.map(n=>n.name);this._attributesConstructor=function(){for(const n of s)this[n]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,n=P(r.clone(),r,!1,!1,this._transform),a=C(n,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._mValueOffset!==null&&t===0&&e>0&&!(e%this._mValueOffset)?0:this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),n=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),n.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?x:e?d:r?G:h}}async function N(o,t,e){const r=u(o),s={...e},n=l.from(t),a=!n.quantizationParameters,{data:c}=await p(r,n,new M({sourceSpatialReference:n.sourceSpatialReference,applyTransform:a}),s);return c}export{N as T,k as g}; diff --git a/main/assets/executeQueryPBF-o8010HS9-dWp8mQx-.js b/main/assets/executeQueryPBF-o8010HS9-dWp8mQx-.js deleted file mode 100644 index fb6344575..000000000 --- a/main/assets/executeQueryPBF-o8010HS9-dWp8mQx-.js +++ /dev/null @@ -1 +0,0 @@ -import{n as f,O as m}from"./main-BZaw9FpY.js";import{y as u}from"./utils-9sQxfkoa-Cus_qP6M.js";import{w as _,J as p}from"./query-DFW9-NG_-1nHUNdNu.js";import{b as l}from"./Query-BrwMGK8U-sojFdYaD.js";import{o as y}from"./projection-BA9M1R7d-DoNqITCd.js";import{D as P,n as C}from"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";async function k(o,t,e){const r=u(o),s=await _(r,l.from(t),{...e}),n=s.data.extent;return!n||isNaN(n.xmin)||isNaN(n.ymin)||isNaN(n.xmax)||isNaN(n.ymax)?{count:s.data.count,extent:null}:{count:s.data.count,extent:f.fromJSON(n)}}function g(o,t){return t}function h(o,t,e,r){switch(e){case 0:return i(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?i(o,t+r,1):v(o,t+r,1)}}function d(o,t,e,r){return e===2?i(o,t,2):h(o,t,e,r)}function G(o,t,e,r){return e===2?t===0?0:i(o,t,3):h(o,t,e,r)}function x(o,t,e,r){return e===3?t===0?0:i(o,t,3):d(o,t,e,r)}function i({translate:o,scale:t},e,r){return o[r]+e*t[r]}function v({translate:o,scale:t},e,r){return o[r]-e*t[r]}class M{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=g,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=y(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;m(r),r.push(e);const s=r.map(n=>n.name);this._attributesConstructor=function(){for(const n of s)this[n]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,n=P(r.clone(),r,!1,!1,this._transform),a=C(n,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._mValueOffset!==null&&t===0&&e>0&&!(e%this._mValueOffset)?0:this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),n=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),n.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?x:e?d:r?G:h}}async function N(o,t,e){const r=u(o),s={...e},n=l.from(t),a=!n.quantizationParameters,{data:c}=await p(r,n,new M({sourceSpatialReference:n.sourceSpatialReference,applyTransform:a}),s);return c}export{N as T,k as g}; diff --git a/main/assets/executeRelationshipQuery-BlX9_g4g-D0r3rl0-.js b/main/assets/executeRelationshipQuery-BlX9_g4g-D0r3rl0-.js new file mode 100644 index 000000000..a6eb52305 --- /dev/null +++ b/main/assets/executeRelationshipQuery-BlX9_g4g-D0r3rl0-.js @@ -0,0 +1 @@ +import{y as m}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{f as y,bM as p}from"./main-C7yV2j71.js";import{f as j}from"./query-DFW9-NG_-CfusC8cS.js";import{O as R}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import{d as f}from"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";function b(r,e){const t=r.toJSON();return t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.orderByFields&&(t.orderByFields=t.orderByFields.join(",")),t.outFields&&!e?.returnCountOnly?t.outFields.includes("*")?t.outFields="*":t.outFields=t.outFields.join(","):delete t.outFields,t.outSR&&(t.outSR=p(t.outSR)),t.dynamicDataSource&&(t.layer=JSON.stringify({source:t.dynamicDataSource}),delete t.dynamicDataSource),t}async function F(r,e,t){const n=await l(r,e,t),o=n.data,s=o.geometryType,a=o.spatialReference,i={};for(const c of o.relatedRecordGroups){const d={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:c.relatedRecords};if(c.objectId!=null)i[c.objectId]=d;else for(const u of Object.keys(c))u!=="relatedRecords"&&(i[c[u]]=d)}return{...n,data:i}}async function h(r,e,t){const n=await l(r,e,t,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function l(r,e,t={},n){const o=j({...r.query,f:"json",...n,...b(e,n)});return y(r.path+"/queryRelatedRecords",{...t,query:{...t.query,...o}})}async function E(r,e,t){e=f.from(e);const n=m(r);return F(n,e,t).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(i=>a[i]=R.fromJSON(s[i])),a})}async function V(r,e,t){e=f.from(e);const n=m(r);return h(n,e,{...t}).then(o=>o.data)}export{E as executeRelationshipQuery,V as executeRelationshipQueryForCount}; diff --git a/main/assets/executeRelationshipQuery-BlX9_g4g-DqUK0EmM.js b/main/assets/executeRelationshipQuery-BlX9_g4g-DqUK0EmM.js deleted file mode 100644 index b89806c4e..000000000 --- a/main/assets/executeRelationshipQuery-BlX9_g4g-DqUK0EmM.js +++ /dev/null @@ -1 +0,0 @@ -import{y as m}from"./utils-9sQxfkoa-Cus_qP6M.js";import{f as y,bM as p}from"./main-BZaw9FpY.js";import{f as j}from"./query-DFW9-NG_-1nHUNdNu.js";import{O as R}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import{d as f}from"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";function b(r,e){const t=r.toJSON();return t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.orderByFields&&(t.orderByFields=t.orderByFields.join(",")),t.outFields&&!e?.returnCountOnly?t.outFields.includes("*")?t.outFields="*":t.outFields=t.outFields.join(","):delete t.outFields,t.outSR&&(t.outSR=p(t.outSR)),t.dynamicDataSource&&(t.layer=JSON.stringify({source:t.dynamicDataSource}),delete t.dynamicDataSource),t}async function F(r,e,t){const n=await l(r,e,t),o=n.data,s=o.geometryType,a=o.spatialReference,i={};for(const c of o.relatedRecordGroups){const d={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:c.relatedRecords};if(c.objectId!=null)i[c.objectId]=d;else for(const u of Object.keys(c))u!=="relatedRecords"&&(i[c[u]]=d)}return{...n,data:i}}async function h(r,e,t){const n=await l(r,e,t,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function l(r,e,t={},n){const o=j({...r.query,f:"json",...n,...b(e,n)});return y(r.path+"/queryRelatedRecords",{...t,query:{...t.query,...o}})}async function E(r,e,t){e=f.from(e);const n=m(r);return F(n,e,t).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(i=>a[i]=R.fromJSON(s[i])),a})}async function V(r,e,t){e=f.from(e);const n=m(r);return h(n,e,{...t}).then(o=>o.data)}export{E as executeRelationshipQuery,V as executeRelationshipQueryForCount}; diff --git a/main/assets/executeTopFeaturesQuery-CjTd36wS-CU_eFWMm.js b/main/assets/executeTopFeaturesQuery-CjTd36wS-CU_eFWMm.js new file mode 100644 index 000000000..401dea67f --- /dev/null +++ b/main/assets/executeTopFeaturesQuery-CjTd36wS-CU_eFWMm.js @@ -0,0 +1 @@ +import{y as f}from"./utils-9sQxfkoa-Bn_d9vXA.js";import{g as a}from"./queryTopFeatures-IbhAPJlP-JGKZFCDQ.js";import{O as u}from"./FeatureSet-BkVNthuN-DDwR53LR.js";import n from"./TopFeaturesQuery-Ckj_IYM7-Dz3OAcyc.js";import"./main-C7yV2j71.js";import"./normalizeUtils-Bxmy9MNI-nfuKj9G4.js";import"./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";import"./query-DFW9-NG_-CfusC8cS.js";import"./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js";import"./pbf-D-y3_eZO-SEvl9j6c.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Byqa7f2t.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";async function q(r,o,t,m){const i=f(r),p={...m},{data:e}=await a(i,n.from(o),t,p);return u.fromJSON(e)}export{q as executeTopFeaturesQuery}; diff --git a/main/assets/executeTopFeaturesQuery-CjTd36wS-CqZW1hbK.js b/main/assets/executeTopFeaturesQuery-CjTd36wS-CqZW1hbK.js deleted file mode 100644 index 8daef7362..000000000 --- a/main/assets/executeTopFeaturesQuery-CjTd36wS-CqZW1hbK.js +++ /dev/null @@ -1 +0,0 @@ -import{y as f}from"./utils-9sQxfkoa-Cus_qP6M.js";import{g as a}from"./queryTopFeatures-IbhAPJlP-DzgjIri_.js";import{O as u}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";import n from"./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js";import"./main-BZaw9FpY.js";import"./normalizeUtils-Bxmy9MNI-DmSw8J5C.js";import"./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";import"./query-DFW9-NG_-1nHUNdNu.js";import"./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js";import"./pbf-D-y3_eZO-BOjQwfR-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";async function q(r,o,t,m){const i=f(r),p={...m},{data:e}=await a(i,n.from(o),t,p);return u.fromJSON(e)}export{q as executeTopFeaturesQuery}; diff --git a/main/assets/fabric-Df28hv38-D454t-UP.js b/main/assets/fabric-Df28hv38-D454t-UP.js new file mode 100644 index 000000000..367ca7dd6 --- /dev/null +++ b/main/assets/fabric-Df28hv38-D454t-UP.js @@ -0,0 +1,437 @@ +import{fA as Ct}from"./main-C7yV2j71.js";function St(Z,f){for(var ft=0;ftht[lt]})}}}return Object.freeze(Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"}))}var mt={};const Tt={},wt=Object.freeze(Object.defineProperty({__proto__:null,default:Tt},Symbol.toStringTag,{value:"Module"})),pt=Ct(wt);var yt;function Ot(){return yt||(yt=1,function(Z){var f=f||{version:"5.3.0"};if(Z.fabric=f,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?f.document=document:f.document=document.implementation.createHTMLDocument(""),f.window=window;else{var ft=pt,ht=new ft.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;f.document=ht.document,f.jsdomImplForWrapper=pt.implForWrapper,f.nodeCanvas=pt.Canvas,f.window=ht,DOMParser=f.window.DOMParser}f.isTouchSupported="ontouchstart"in f.window||"ontouchstart"in f.document||f.window&&f.window.navigator&&f.window.navigator.maxTouchPoints>0,f.isLikelyNode=typeof Buffer<"u"&&typeof window>"u",f.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],f.DPI=96,f.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",f.commaWsp="(?:\\s+,?\\s*|,\\s*)",f.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,f.reNonWord=/[ \n\.,;!\?\-]/,f.fontPaths={},f.iMatrix=[1,0,0,1,0,0],f.svgNS="http://www.w3.org/2000/svg",f.perfLimitSizeTotal=2097152,f.maxCacheSideLimit=4096,f.minCacheSideLimit=256,f.charWidthsCache={},f.textureSize=2048,f.disableStyleCopyPaste=!1,f.enableGLFiltering=!0,f.devicePixelRatio=f.window.devicePixelRatio||f.window.webkitDevicePixelRatio||f.window.mozDevicePixelRatio||1,f.browserShadowBlurConstant=1,f.arcToSegmentsCache={},f.boundsOfCurveCache={},f.cachesBoundsOfCurve=!0,f.forceGLPutImageData=!1,f.initFilterBackend=function(){if(f.enableGLFiltering&&f.isWebglSupported&&f.isWebglSupported(f.textureSize))return console.log("max texture size: "+f.maxTextureSize),new f.WebglFilterBackend({tileSize:f.textureSize});if(f.Canvas2dFilterBackend)return new f.Canvas2dFilterBackend},typeof document<"u"&&typeof window<"u"&&(window.fabric=f),function(){function c(t,n){if(this.__eventListeners[t]){var a=this.__eventListeners[t];n?a[a.indexOf(n)]=!1:f.util.array.fill(a,!1)}}function s(t,n){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var a in t)this.on(a,t[a]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(n);return this}function h(t,n){var a=function(){n.apply(this,arguments),this.off(t,a)}.bind(this);this.on(t,a)}function o(t,n){if(arguments.length===1)for(var a in t)h.call(this,a,t[a]);else h.call(this,t,n);return this}function e(t,n){if(!this.__eventListeners)return this;if(arguments.length===0)for(t in this.__eventListeners)c.call(this,t);else if(arguments.length===1&&typeof arguments[0]=="object")for(var a in t)c.call(this,a,t[a]);else c.call(this,t,n);return this}function r(t,n){if(!this.__eventListeners)return this;var a=this.__eventListeners[t];if(!a)return this;for(var i=0,l=a.length;i"u"?this._objects.concat():this._objects.filter(function(s){return s.type===c})},item:function(c){return this._objects[c]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(c,s){return this._objects.indexOf(c)>-1?!0:s?this._objects.some(function(h){return typeof h.contains=="function"&&h.contains(c,!0)}):!1},complexity:function(){return this._objects.reduce(function(c,s){return c+=s.complexity?s.complexity():0,c},0)}},f.CommonMethods={_setOptions:function(c){for(var s in c)this.set(s,c[s])},_initGradient:function(c,s){c&&c.colorStops&&!(c instanceof f.Gradient)&&this.set(s,new f.Gradient(c))},_initPattern:function(c,s,h){c&&c.source&&!(c instanceof f.Pattern)?this.set(s,new f.Pattern(c,h)):h&&h()},_setObject:function(c){for(var s in c)this._set(s,c[s])},set:function(c,s){return typeof c=="object"?this._setObject(c):this._set(c,s),this},_set:function(c,s){this[c]=s},toggle:function(c){var s=this.get(c);return typeof s=="boolean"&&this.set(c,!s),this},get:function(c){return this[c]}},function(c){var s=Math.sqrt,h=Math.atan2,o=Math.pow,e=Math.PI/180,r=Math.PI/2;f.util={cos:function(t){if(t===0)return 1;t<0&&(t=-t);var n=t/r;switch(n){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(t===0)return 0;var n=t/r,a=1;switch(t<0&&(a=-1),n){case 1:return a;case 2:return 0;case 3:return-a}return Math.sin(t)},removeFromArray:function(t,n){var a=t.indexOf(n);return a!==-1&&t.splice(a,1),t},getRandomInt:function(t,n){return Math.floor(Math.random()*(n-t+1))+t},degreesToRadians:function(t){return t*e},radiansToDegrees:function(t){return t/e},rotatePoint:function(t,n,a){var i=new f.Point(t.x-n.x,t.y-n.y),l=f.util.rotateVector(i,a);return new f.Point(l.x,l.y).addEquals(n)},rotateVector:function(t,n){var a=f.util.sin(n),i=f.util.cos(n),l=t.x*i-t.y*a,u=t.x*a+t.y*i;return{x:l,y:u}},createVector:function(t,n){return new f.Point(n.x-t.x,n.y-t.y)},calcAngleBetweenVectors:function(t,n){return Math.acos((t.x*n.x+t.y*n.y)/(Math.hypot(t.x,t.y)*Math.hypot(n.x,n.y)))},getHatVector:function(t){return new f.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,n,a){var i=f.util.createVector(t,n),l=f.util.createVector(t,a),u=f.util.calcAngleBetweenVectors(i,l),d=f.util.calcAngleBetweenVectors(f.util.rotateVector(i,u),l),g=u*(d===0?1:-1)/2;return{vector:f.util.getHatVector(f.util.rotateVector(i,g)),angle:u}},projectStrokeOnPoints:function(t,n,a){var i=[],l=n.strokeWidth/2,u=n.strokeUniform?new f.Point(1/n.scaleX,1/n.scaleY):new f.Point(1,1),d=function(g){var p=l/Math.hypot(g.x,g.y);return new f.Point(g.x*p*u.x,g.y*p*u.y)};return t.length<=1||t.forEach(function(g,p){var v=new f.Point(g.x,g.y),_,T;p===0?(T=t[p+1],_=a?d(f.util.createVector(T,v)).addEquals(v):t[t.length-1]):p===t.length-1?(_=t[p-1],T=a?d(f.util.createVector(_,v)).addEquals(v):t[0]):(_=t[p-1],T=t[p+1]);var A=f.util.getBisector(v,_,T),X=A.vector,W=A.angle,N,V;if(n.strokeLineJoin==="miter"&&(N=-l/Math.sin(W/2),V=new f.Point(X.x*N*u.x,X.y*N*u.y),Math.hypot(V.x,V.y)/l<=n.strokeMiterLimit)){i.push(v.add(V)),i.push(v.subtract(V));return}N=-l*Math.SQRT2,V=new f.Point(X.x*N*u.x,X.y*N*u.y),i.push(v.add(V)),i.push(v.subtract(V))}),i},transformPoint:function(t,n,a){return a?new f.Point(n[0]*t.x+n[2]*t.y,n[1]*t.x+n[3]*t.y):new f.Point(n[0]*t.x+n[2]*t.y+n[4],n[1]*t.x+n[3]*t.y+n[5])},makeBoundingBoxFromPoints:function(t,n){if(n)for(var a=0;a"u"?1:t.scaleX,a=typeof t.scaleY>"u"?1:t.scaleY,i=[t.flipX?-n:n,0,0,t.flipY?-a:a,0,0],l=f.util.multiplyTransformMatrices,u=f.util.degreesToRadians;return t.skewX&&(i=l(i,[1,0,Math.tan(u(t.skewX)),1],!0)),t.skewY&&(i=l(i,[1,Math.tan(u(t.skewY)),0,1],!0)),i},composeMatrix:function(t){var n=[1,0,0,1,t.translateX||0,t.translateY||0],a=f.util.multiplyTransformMatrices;return t.angle&&(n=a(n,f.util.calcRotateMatrix(t))),(t.scaleX!==1||t.scaleY!==1||t.skewX||t.skewY||t.flipX||t.flipY)&&(n=a(n,f.util.calcDimensionsMatrix(t))),n},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,n,a,i){i>0&&(n>i?n-=i:n=0,a>i?a-=i:a=0);var l=!0,u,d,g=t.getImageData(n,a,i*2||1,i*2||1),p=g.data.length;for(u=3;u0){var v=f.util.hasStyleChanged(l,p,!0);v?u.push({start:i,end:i+1,style:p}):u[u.length-1].end++}l=p||{}}}return u},stylesFromArray:function(t,n){if(!Array.isArray(t))return t;for(var a=n.split(` +`),i=-1,l=0,u={},d=0;d0?nt-=2*w:x===1&&nt<0&&(nt+=2*w);for(var rt=Math.ceil(Math.abs(nt/w*2)),ot=[],st=nt/rt,ut=8/3*Math.sin(st/4)*Math.sin(st/4)/Math.sin(st/2),dt=it+st,at=0;at=P?x-P:2*Math.PI-(P-x)}function t(m,C,S,b,P,x,y,w){var k;if(f.cachesBoundsOfCurve&&(k=c.call(arguments),f.boundsOfCurveCache[k]))return f.boundsOfCurveCache[k];var M=Math.sqrt,E=Math.min,R=Math.max,Y=Math.abs,z=[],j=[[],[]],O,I,L,D,B,H,tt,Q;I=6*m-12*S+6*P,O=-3*m+9*S-9*P+3*y,L=3*S-3*m;for(var F=0;F<2;++F){if(F>0&&(I=6*C-12*b+6*x,O=-3*C+9*b-9*x+3*w,L=3*b-3*C),Y(O)<1e-12){if(Y(I)<1e-12)continue;D=-L/I,01e-4;)y=P(S),E=S,w=i(x.x,x.y,y.x,y.y),w+b>C?(S-=k,k/=2):(x=y,S+=k,b+=w);return y.angle=M(E),y}function U(m){for(var C=0,S=m.length,b,P=0,x=0,y=0,w=0,k=[],M,E,R,Y=0;Y0&&btt)for(var F=1,$=O.length;F<$;F+=tt)C.push([L].concat(O.slice(F,F+tt))),L=Q;else C.push(O)}return C}function J(m,C){var S=[],b,P=new f.Point(m[0].x,m[0].y),x=new f.Point(m[1].x,m[1].y),y=m.length,w=1,k=0,M=y>2;for(C=C||0,M&&(w=m[2].xm[b-2].x?1:P.x===m[b-2].x?0:-1,k=P.y>m[b-2].y?1:P.y===m[b-2].y?0:-1),S.push(["L",P.x+w*C,P.y+k*C]),S}function K(m,C,S){return S&&(C=f.util.multiplyTransformMatrices(C,[1,0,0,1,-S.x,-S.y])),m.map(function(b){for(var P=b.slice(0),x={},y=1;y=i})}function o(t,n){return r(t,n,function(a,i){return a/g,">")}function o(r){var t=0,n,a=[];for(t=0,n;t57343)return r.charAt(t);if(55296<=n&&n<=56319){if(r.length<=t+1)throw"High surrogate without following low surrogate";var a=r.charCodeAt(t+1);if(56320>a||a>57343)throw"High surrogate without following low surrogate";return r.charAt(t)+r.charAt(t+1)}if(t===0)throw"Low surrogate without preceding high surrogate";var i=r.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}f.util.string={camelize:c,capitalize:s,escapeXml:h,graphemeSplit:o}}(),function(){var c=Array.prototype.slice,s=function(){},h=function(){for(var n in{toString:1})if(n==="toString")return!1;return!0}(),o=function(n,a,i){for(var l in a)l in n.prototype&&typeof n.prototype[l]=="function"&&(a[l]+"").indexOf("callSuper")>-1?n.prototype[l]=function(u){return function(){var d=this.constructor.superclass;this.constructor.superclass=i;var g=a[u].apply(this,arguments);if(this.constructor.superclass=d,u!=="initialize")return g}}(l):n.prototype[l]=a[l],h&&(a.toString!==Object.prototype.toString&&(n.prototype.toString=a.toString),a.valueOf!==Object.prototype.valueOf&&(n.prototype.valueOf=a.valueOf))};function e(){}function r(n){for(var a=null,i=this;i.constructor.superclass;){var l=i.constructor.superclass.prototype[n];if(i[n]!==l){a=l;break}i=i.constructor.superclass.prototype}return a?arguments.length>1?a.apply(this,c.call(arguments,1)):a.call(this):console.log("tried to callSuper "+n+", method not found in prototype chain",this)}function t(){var n=null,a=c.call(arguments,0);typeof a[0]=="function"&&(n=a.shift());function i(){this.initialize.apply(this,arguments)}i.superclass=n,i.subclasses=[],n&&(e.prototype=n.prototype,i.prototype=new e,n.subclasses.push(i));for(var l=0,u=a.length;l-1||o.pointerType==="touch"}}(),function(){function c(t,n){var a=t.style;if(!a)return t;if(typeof n=="string")return t.style.cssText+=";"+n,n.indexOf("opacity")>-1?r(t,n.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var i in n)if(i==="opacity")r(t,n[i]);else{var l=i==="float"||i==="cssFloat"?typeof a.styleFloat>"u"?"cssFloat":"styleFloat":i;a.setProperty(l,n[i])}return t}var s=f.document.createElement("div"),h=typeof s.style.opacity=="string",o=typeof s.style.filter=="string",e=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,r=function(t){return t};h?r=function(t,n){return t.style.opacity=n,t}:o&&(r=function(t,n){var a=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(a.zoom=1),e.test(a.filter)?(n=n>=.9999?"":"alpha(opacity="+n*100+")",a.filter=a.filter.replace(e,n)):a.filter+=" alpha(opacity="+n*100+")",t}),f.util.setStyle=c}(),function(){var c=Array.prototype.slice;function s(g){return typeof g=="string"?f.document.getElementById(g):g}var h,o=function(g){return c.call(g,0)};try{h=o(f.document.childNodes)instanceof Array}catch{}h||(o=function(g){for(var p=new Array(g.length),v=g.length;v--;)p[v]=g[v];return p});function e(g,p){var v=f.document.createElement(g);for(var _ in p)_==="class"?v.className=p[_]:_==="for"?v.htmlFor=p[_]:v.setAttribute(_,p[_]);return v}function r(g,p){g&&(" "+g.className+" ").indexOf(" "+p+" ")===-1&&(g.className+=(g.className?" ":"")+p)}function t(g,p,v){return typeof p=="string"&&(p=e(p,v)),g.parentNode&&g.parentNode.replaceChild(p,g),p.appendChild(g),p}function n(g){for(var p=0,v=0,_=f.document.documentElement,T=f.document.body||{scrollLeft:0,scrollTop:0};g&&(g.parentNode||g.host)&&(g=g.parentNode||g.host,g===f.document?(p=T.scrollLeft||_.scrollLeft||0,v=T.scrollTop||_.scrollTop||0):(p+=g.scrollLeft||0,v+=g.scrollTop||0),!(g.nodeType===1&&g.style.position==="fixed")););return{left:p,top:v}}function a(g){var p,v=g&&g.ownerDocument,_={left:0,top:0},T={left:0,top:0},A,X={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!v)return T;for(var W in X)T[X[W]]+=parseInt(i(g,W),10)||0;return p=v.documentElement,typeof g.getBoundingClientRect<"u"&&(_=g.getBoundingClientRect()),A=n(g),{left:_.left+A.left-(p.clientLeft||0)+T.left,top:_.top+A.top-(p.clientTop||0)+T.top}}var i;f.document.defaultView&&f.document.defaultView.getComputedStyle?i=function(g,p){var v=f.document.defaultView.getComputedStyle(g,null);return v?v[p]:void 0}:i=function(g,p){var v=g.style[p];return!v&&g.currentStyle&&(v=g.currentStyle[p]),v},function(){var g=f.document.documentElement.style,p="userSelect"in g?"userSelect":"MozUserSelect"in g?"MozUserSelect":"WebkitUserSelect"in g?"WebkitUserSelect":"KhtmlUserSelect"in g?"KhtmlUserSelect":"";function v(T){return typeof T.onselectstart<"u"&&(T.onselectstart=f.util.falseFunction),p?T.style[p]="none":typeof T.unselectable=="string"&&(T.unselectable="on"),T}function _(T){return typeof T.onselectstart<"u"&&(T.onselectstart=null),p?T.style[p]="":typeof T.unselectable=="string"&&(T.unselectable=""),T}f.util.makeElementUnselectable=v,f.util.makeElementSelectable=_}();function l(g){var p=f.jsdomImplForWrapper(g);return p._canvas||p._image}function u(g){if(f.isLikelyNode){var p=f.jsdomImplForWrapper(g);p&&(p._image=null,p._canvas=null,p._currentSrc=null,p._attributes=null,p._classList=null)}}function d(g,p){g.imageSmoothingEnabled=g.imageSmoothingEnabled||g.webkitImageSmoothingEnabled||g.mozImageSmoothingEnabled||g.msImageSmoothingEnabled||g.oImageSmoothingEnabled,g.imageSmoothingEnabled=p}f.util.setImageSmoothing=d,f.util.getById=s,f.util.toArray=o,f.util.addClass=r,f.util.makeElement=e,f.util.wrapElement=t,f.util.getScrollLeftTop=n,f.util.getElementOffset=a,f.util.getNodeCanvas=l,f.util.cleanUpJsdomNode=u}(),function(){function c(o,e){return o+(/\?/.test(o)?"&":"?")+e}function s(){}function h(o,e){e||(e={});var r=e.method?e.method.toUpperCase():"GET",t=e.onComplete||function(){},n=new f.window.XMLHttpRequest,a=e.body||e.parameters;return n.onreadystatechange=function(){n.readyState===4&&(t(n),n.onreadystatechange=s)},r==="GET"&&(a=null,typeof e.parameters=="string"&&(o=c(o,e.parameters))),n.open(r,o,!0),(r==="POST"||r==="PUT")&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.send(a),n}f.util.request=h}(),f.log=console.log,f.warn=console.warn,function(){var c=f.util.object.extend,s=f.util.object.clone,h=[];f.util.object.extend(h,{cancelAll:function(){var l=this.splice(0);return l.forEach(function(u){u.cancel()}),l},cancelByCanvas:function(l){if(!l)return[];var u=this.filter(function(d){return typeof d.target=="object"&&d.target.canvas===l});return u.forEach(function(d){d.cancel()}),u},cancelByTarget:function(l){var u=this.findAnimationsByTarget(l);return u.forEach(function(d){d.cancel()}),u},findAnimationIndex:function(l){return this.indexOf(this.findAnimation(l))},findAnimation:function(l){return this.find(function(u){return u.cancel===l})},findAnimationsByTarget:function(l){return l?this.filter(function(u){return u.target===l}):[]}});function o(){return!1}function e(l,u,d,g){return-d*Math.cos(l/g*(Math.PI/2))+d+u}function r(l){l||(l={});var u=!1,d,g=function(){var p=f.runningAnimations.indexOf(d);return p>-1&&f.runningAnimations.splice(p,1)[0]};return d=c(s(l),{cancel:function(){return u=!0,g()},currentValue:"startValue"in l?l.startValue:0,completionRate:0,durationRate:0}),f.runningAnimations.push(d),a(function(p){var v=p||+new Date,_=l.duration||500,T=v+_,A,X=l.onChange||o,W=l.abort||o,N=l.onComplete||o,V=l.easing||e,U="startValue"in l?l.startValue.length>0:!1,G="startValue"in l?l.startValue:0,q="endValue"in l?l.endValue:100,J=l.byValue||(U?G.map(function(K,m){return q[m]-G[m]}):q-G);l.onStart&&l.onStart(),function K(m){A=m||+new Date;var C=A>T?_:A-v,S=C/_,b=U?G.map(function(x,y){return V(C,G[y],J[y],_)}):V(C,G,J,_),P=Math.abs(U?(b[0]-G[0])/J[0]:(b-G)/J);if(d.currentValue=U?b.slice():b,d.completionRate=P,d.durationRate=S,!u){if(W(b,P,S)){g();return}if(A>T){d.currentValue=U?q.slice():q,d.completionRate=1,d.durationRate=1,X(U?q.slice():q,1,1),N(q,1,1),g();return}else X(b,P,S),a(K)}}(v)}),d.cancel}var t=f.window.requestAnimationFrame||f.window.webkitRequestAnimationFrame||f.window.mozRequestAnimationFrame||f.window.oRequestAnimationFrame||f.window.msRequestAnimationFrame||function(l){return f.window.setTimeout(l,1e3/60)},n=f.window.cancelAnimationFrame||f.window.clearTimeout;function a(){return t.apply(f.window,arguments)}function i(){return n.apply(f.window,arguments)}f.util.animate=r,f.util.requestAnimFrame=a,f.util.cancelAnimFrame=i,f.runningAnimations=h}(),function(){function c(h,o,e){var r="rgba("+parseInt(h[0]+e*(o[0]-h[0]),10)+","+parseInt(h[1]+e*(o[1]-h[1]),10)+","+parseInt(h[2]+e*(o[2]-h[2]),10);return r+=","+(h&&o?parseFloat(h[3]+e*(o[3]-h[3])):1),r+=")",r}function s(h,o,e,r){var t=new f.Color(h).getSource(),n=new f.Color(o).getSource(),a=r.onComplete,i=r.onChange;return r=r||{},f.util.animate(f.util.object.extend(r,{duration:e||500,startValue:t,endValue:n,byValue:n,easing:function(l,u,d,g){var p=r.colorEasing?r.colorEasing(l,g):1-Math.cos(l/g*(Math.PI/2));return c(u,d,p)},onComplete:function(l,u,d){if(a)return a(c(n,n,0),u,d)},onChange:function(l,u,d){if(i){if(Array.isArray(l))return i(c(l,l,0),u,d);i(l,u,d)}}}))}f.util.animateColor=s}(),function(){function c(m,C,S,b){return m-1&&Y>-1&&Y-1)&&(y="stroke")}else{if(x==="href"||x==="xlink:href"||x==="font")return y;if(x==="imageSmoothing")return y==="optimizeQuality";E=M?y.map(r):r(y,k)}}return!M&&isNaN(E)?y:E}function T(x){return new RegExp("^("+x.join("|")+")\\b","i")}function A(x){for(var y in d)if(!(typeof x[d[y]]>"u"||x[y]==="")){if(typeof x[y]>"u"){if(!s.Object.prototype[y])continue;x[y]=s.Object.prototype[y]}if(x[y].indexOf("url(")!==0){var w=new s.Color(x[y]);x[y]=w.setAlpha(e(w.getAlpha()*x[d[y]],2)).toRgba()}}return x}function X(x,y){var w,k=[],M,E,R;for(E=0,R=y.length;E1;)et.shift(),it=s.util.multiplyTransformMatrices(it,et[0]);return it}}();function W(x,y){var w,k;x.replace(/;\s*$/,"").split(";").forEach(function(M){var E=M.split(":");w=E[0].trim().toLowerCase(),k=E[1].trim(),y[w]=k})}function N(x,y){var w,k;for(var M in x)typeof x[M]>"u"||(w=M.toLowerCase(),k=x[M],y[w]=k)}function V(x,y){var w={};for(var k in s.cssRules[y])if(U(x,k.split(" ")))for(var M in s.cssRules[y][k])w[M]=s.cssRules[y][k][M];return w}function U(x,y){var w,k=!0;return w=q(x,y.pop()),w&&y.length&&(k=G(x,y)),w&&k&&y.length===0}function G(x,y){for(var w,k=!0;x.parentNode&&x.parentNode.nodeType===1&&y.length;)k&&(w=y.pop()),x=x.parentNode,k=q(x,w);return y.length===0}function q(x,y){var w=x.nodeName,k=x.getAttribute("class"),M=x.getAttribute("id"),E,R;if(E=new RegExp("^"+w,"i"),y=y.replace(E,""),M&&y.length&&(E=new RegExp("#"+M+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"")),k&&y.length)for(k=k.split(" "),R=k.length;R--;)E=new RegExp("\\."+k[R]+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"");return y.length===0}function J(x,y){var w;if(x.getElementById&&(w=x.getElementById(y)),w)return w;var k,M,E,R=x.getElementsByTagName("*");for(M=0,E=R.length;Mk?k:w),B.meetOrSlice==="slice"&&(k=w=w>k?w:k),et=F.width-R*w,it=F.height-Y*w,B.alignX==="Mid"&&(et/=2),B.alignY==="Mid"&&(it/=2),B.alignX==="Min"&&(et=0),B.alignY==="Min"&&(it=0)),w===1&&k===1&&M===0&&E===0&&L===0&&D===0)return F;if((L||D)&&x.parentNode.nodeName!=="#document"&&($=" translate("+r(L)+" "+r(D)+") "),z=$+" matrix("+w+" 0 0 "+k+" "+(M*w+et)+" "+(E*k+it)+") ",x.nodeName==="svg"){for(j=x.ownerDocument.createElementNS(s.svgNS,"g");x.firstChild;)j.appendChild(x.firstChild);x.appendChild(j)}else j=x,j.removeAttribute("x"),j.removeAttribute("y"),z=j.getAttribute("transform")+z;return j.setAttribute("transform",z),F}function S(x,y){for(;x&&(x=x.parentNode);)if(x.nodeName&&y.test(x.nodeName.replace("svg:",""))&&!x.getAttribute("instantiated_by_use"))return!0;return!1}s.parseSVGDocument=function(x,y,w,k){if(x){K(x);var M=s.Object.__uid++,E,R,Y=C(x),z=s.util.toArray(x.getElementsByTagName("*"));if(Y.crossOrigin=k&&k.crossOrigin,Y.svgUid=M,z.length===0&&s.isLikelyNode){z=x.selectNodes('//*[name(.)!="svg"]');var j=[];for(E=0,R=z.length;E"u"&&(w=x.getAttribute("svgUid")),x.parentNode&&s.svgValidParentsRegEx.test(x.parentNode.nodeName)&&(M=s.parseAttributes(x.parentNode,y,w));var Y=y.reduce(function(B,H){return k=x.getAttribute(H),k&&(B[H]=k),B},{}),z=h(V(x,w),s.parseStyleAttribute(x));Y=h(Y,z),z[p]&&x.setAttribute(p,z[p]),E=R=M.fontSize||s.Text.DEFAULT_SVG_FONT_SIZE,Y[g]&&(Y[g]=E=r(Y[g],R));var j,O,I={};for(var L in Y)j=v(L),O=_(j,Y[L],M,E),I[j]=O;I&&I.font&&s.parseFontDeclaration(I.font,I);var D=h(M,I);return s.svgValidParentsRegEx.test(x.nodeName)?D:A(D)}},parseElements:function(x,y,w,k,M){new s.ElementsParser(x,y,w,k,M).parse()},parseStyleAttribute:function(x){var y={},w=x.getAttribute("style");return w&&(typeof w=="string"?W(w,y):N(w,y)),y},parsePointsAttribute:function(x){if(!x)return null;x=x.replace(/,/g," ").trim(),x=x.split(/\s+/);var y=[],w,k;for(w=0,k=x.length;wo.x&&this.y>o.y},gte:function(o){return this.x>=o.x&&this.y>=o.y},lerp:function(o,e){return typeof e>"u"&&(e=.5),e=Math.max(Math.min(1,e),0),new h(this.x+(o.x-this.x)*e,this.y+(o.y-this.y)*e)},distanceFrom:function(o){var e=this.x-o.x,r=this.y-o.y;return Math.sqrt(e*e+r*r)},midPointFrom:function(o){return this.lerp(o)},min:function(o){return new h(Math.min(this.x,o.x),Math.min(this.y,o.y))},max:function(o){return new h(Math.max(this.x,o.x),Math.max(this.y,o.y))},toString:function(){return this.x+","+this.y},setXY:function(o,e){return this.x=o,this.y=e,this},setX:function(o){return this.x=o,this},setY:function(o){return this.y=o,this},setFromPoint:function(o){return this.x=o.x,this.y=o.y,this},swap:function(o){var e=this.x,r=this.y;this.x=o.x,this.y=o.y,o.x=e,o.y=r},clone:function(){return new h(this.x,this.y)}}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Intersection){s.warn("fabric.Intersection is already defined");return}function h(o){this.status=o,this.points=[]}s.Intersection=h,s.Intersection.prototype={constructor:h,appendPoint:function(o){return this.points.push(o),this},appendPoints:function(o){return this.points=this.points.concat(o),this}},s.Intersection.intersectLineLine=function(o,e,r,t){var n,a=(t.x-r.x)*(o.y-r.y)-(t.y-r.y)*(o.x-r.x),i=(e.x-o.x)*(o.y-r.y)-(e.y-o.y)*(o.x-r.x),l=(t.y-r.y)*(e.x-o.x)-(t.x-r.x)*(e.y-o.y);if(l!==0){var u=a/l,d=i/l;0<=u&&u<=1&&0<=d&&d<=1?(n=new h("Intersection"),n.appendPoint(new s.Point(o.x+u*(e.x-o.x),o.y+u*(e.y-o.y)))):n=new h}else a===0||i===0?n=new h("Coincident"):n=new h("Parallel");return n},s.Intersection.intersectLinePolygon=function(o,e,r){var t=new h,n=r.length,a,i,l,u;for(u=0;u0&&(t.status="Intersection"),t},s.Intersection.intersectPolygonPolygon=function(o,e){var r=new h,t=o.length,n;for(n=0;n0&&(r.status="Intersection"),r},s.Intersection.intersectPolygonRectangle=function(o,e,r){var t=e.min(r),n=e.max(r),a=new s.Point(n.x,t.y),i=new s.Point(t.x,n.y),l=h.intersectLinePolygon(t,a,o),u=h.intersectLinePolygon(a,n,o),d=h.intersectLinePolygon(n,i,o),g=h.intersectLinePolygon(i,t,o),p=new h;return p.appendPoints(l.points),p.appendPoints(u.points),p.appendPoints(d.points),p.appendPoints(g.points),p.points.length>0&&(p.status="Intersection"),p}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Color){s.warn("fabric.Color is already defined.");return}function h(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}s.Color=h,s.Color.prototype={_tryParsingColor:function(e){var r;e in h.colorNameMap&&(e=h.colorNameMap[e]),e==="transparent"&&(r=[255,255,255,0]),r||(r=h.sourceFromHex(e)),r||(r=h.sourceFromRgb(e)),r||(r=h.sourceFromHsl(e)),r||(r=[0,0,0,1]),r&&this.setSource(r)},_rgbToHsl:function(e,r,t){e/=255,r/=255,t/=255;var n,a,i,l=s.util.array.max([e,r,t]),u=s.util.array.min([e,r,t]);if(i=(l+u)/2,l===u)n=a=0;else{var d=l-u;switch(a=i>.5?d/(2-l-u):d/(l+u),l){case e:n=(r-t)/d+(r1&&(t-=1),t<1/6?e+(r-e)*6*t:t<1/2?r:t<2/3?e+(r-e)*(2/3-t)*6:e}s.Color.fromRgb=function(e){return h.fromSource(h.sourceFromRgb(e))},s.Color.sourceFromRgb=function(e){var r=e.match(h.reRGBa);if(r){var t=parseInt(r[1],10)/(/%$/.test(r[1])?100:1)*(/%$/.test(r[1])?255:1),n=parseInt(r[2],10)/(/%$/.test(r[2])?100:1)*(/%$/.test(r[2])?255:1),a=parseInt(r[3],10)/(/%$/.test(r[3])?100:1)*(/%$/.test(r[3])?255:1);return[parseInt(t,10),parseInt(n,10),parseInt(a,10),r[4]?parseFloat(r[4]):1]}},s.Color.fromRgba=h.fromRgb,s.Color.fromHsl=function(e){return h.fromSource(h.sourceFromHsl(e))},s.Color.sourceFromHsl=function(e){var r=e.match(h.reHSLa);if(r){var t=(parseFloat(r[1])%360+360)%360/360,n=parseFloat(r[2])/(/%$/.test(r[2])?100:1),a=parseFloat(r[3])/(/%$/.test(r[3])?100:1),i,l,u;if(n===0)i=l=u=a;else{var d=a<=.5?a*(n+1):a+n-a*n,g=a*2-d;i=o(g,d,t+1/3),l=o(g,d,t),u=o(g,d,t-1/3)}return[Math.round(i*255),Math.round(l*255),Math.round(u*255),r[4]?parseFloat(r[4]):1]}},s.Color.fromHsla=h.fromHsl,s.Color.fromHex=function(e){return h.fromSource(h.sourceFromHex(e))},s.Color.sourceFromHex=function(e){if(e.match(h.reHex)){var r=e.slice(e.indexOf("#")+1),t=r.length===3||r.length===4,n=r.length===8||r.length===4,a=t?r.charAt(0)+r.charAt(0):r.substring(0,2),i=t?r.charAt(1)+r.charAt(1):r.substring(2,4),l=t?r.charAt(2)+r.charAt(2):r.substring(4,6),u=n?t?r.charAt(3)+r.charAt(3):r.substring(6,8):"FF";return[parseInt(a,16),parseInt(i,16),parseInt(l,16),parseFloat((parseInt(u,16)/255).toFixed(2))]}},s.Color.fromSource=function(e){var r=new h;return r.setSource(e),r}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=["e","se","s","sw","w","nw","n","ne","e"],o=["ns","nesw","ew","nwse"],e={},r="left",t="top",n="right",a="bottom",i="center",l={top:a,bottom:t,left:n,right:r,center:i},u=s.util.radiansToDegrees,d=Math.sign||function(j){return(j>0)-(j<0)||+j};function g(j,O){var I=j.angle+u(Math.atan2(O.y,O.x))+360;return Math.round(I%360/45)}function p(j,O){var I=O.transform.target,L=I.canvas,D=s.util.object.clone(O);D.target=I,L&&L.fire("object:"+j,D),I.fire(j,O)}function v(j,O){var I=O.canvas,L=I.uniScaleKey,D=j[L];return I.uniformScaling&&!D||!I.uniformScaling&&D}function _(j){return j.originX===i&&j.originY===i}function T(j,O,I){var L=j.lockScalingX,D=j.lockScalingY;return!!(L&&D||!O&&(L||D)&&I||L&&O==="x"||D&&O==="y")}function A(j,O,I){var L="not-allowed",D=v(j,I),B="";if(O.x!==0&&O.y===0?B="x":O.x===0&&O.y!==0&&(B="y"),T(I,B,D))return L;var H=g(I,O);return h[H]+"-resize"}function X(j,O,I){var L="not-allowed";if(O.x!==0&&I.lockSkewingY||O.y!==0&&I.lockSkewingX)return L;var D=g(I,O)%4;return o[D]+"-resize"}function W(j,O,I){return j[I.canvas.altActionKey]?e.skewCursorStyleHandler(j,O,I):e.scaleCursorStyleHandler(j,O,I)}function N(j,O,I){var L=j[I.canvas.altActionKey];if(O.x===0)return L?"skewX":"scaleY";if(O.y===0)return L?"skewY":"scaleX"}function V(j,O,I){return I.lockRotation?"not-allowed":O.cursorStyle}function U(j,O,I,L){return{e:j,transform:O,pointer:{x:I,y:L}}}function G(j){return function(O,I,L,D){var B=I.target,H=B.getCenterPoint(),tt=B.translateToOriginPoint(H,I.originX,I.originY),Q=j(O,I,L,D);return B.setPositionByOrigin(tt,I.originX,I.originY),Q}}function q(j,O){return function(I,L,D,B){var H=O(I,L,D,B);return H&&p(j,U(I,L,D,B)),H}}function J(j,O,I,L,D){var B=j.target,H=B.controls[j.corner],tt=B.canvas.getZoom(),Q=B.padding/tt,F=B.toLocalPoint(new s.Point(L,D),O,I);return F.x>=Q&&(F.x-=Q),F.x<=-Q&&(F.x+=Q),F.y>=Q&&(F.y-=Q),F.y<=Q&&(F.y+=Q),F.x-=H.offsetX,F.y-=H.offsetY,F}function K(j){return j.flipX!==j.flipY}function m(j,O,I,L,D){if(j[O]!==0){var B=j._getTransformedDimensions()[L],H=D/B*j[I];j.set(I,H)}}function C(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(0,D.skewY),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.x*2)-B.x,Q=D.skewX,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleX,B.y/D.scaleY)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().y;D.set("skewX",F),m(D,"skewY","scaleY","y",et)}return $}function S(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(D.skewX,0),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.y*2)-B.y,Q=D.skewY,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleY,B.x/D.scaleX)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().x;D.set("skewY",F),m(D,"skewX","scaleX","x",et)}return $}function b(j,O,I,L){var D=O.target,B=D.skewX,H,tt=O.originY;if(D.lockSkewingX)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.x>0?H=r:H=n}else B>0&&(H=tt===t?r:n),B<0&&(H=tt===t?n:r),K(D)&&(H=H===r?n:r);O.originX=H;var F=q("skewing",G(C));return F(j,O,I,L)}function P(j,O,I,L){var D=O.target,B=D.skewY,H,tt=O.originX;if(D.lockSkewingY)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.y>0?H=t:H=a}else B>0&&(H=tt===r?t:a),B<0&&(H=tt===r?a:t),K(D)&&(H=H===t?a:t);O.originY=H;var F=q("skewing",G(S));return F(j,O,I,L)}function x(j,O,I,L){var D=O,B=D.target,H=B.translateToOriginPoint(B.getCenterPoint(),D.originX,D.originY);if(B.lockRotation)return!1;var tt=Math.atan2(D.ey-H.y,D.ex-H.x),Q=Math.atan2(L-H.y,I-H.x),F=u(Q-tt+D.theta),$=!0;if(B.snapAngle>0){var et=B.snapAngle,it=B.snapThreshold||et,nt=Math.ceil(F/et)*et,rt=Math.floor(F/et)*et;Math.abs(F-rt)d?(A=u,t.scale(1,d/u),T=a*u/d):d>u?(A=d,t.scale(u/d,1),_=n*d/u):A=u,t.lineWidth=1,t.beginPath(),t.arc(_,T,A/2,0,2*Math.PI,!1),t[p](),v&&t.stroke(),t.restore()}function r(t,n,a,i,l){i=i||{};var u=this.sizeX||i.cornerSize||l.cornerSize,d=this.sizeY||i.cornerSize||l.cornerSize,g=typeof i.transparentCorners<"u"?i.transparentCorners:l.transparentCorners,p=g?"stroke":"fill",v=!g&&(i.cornerStrokeColor||l.cornerStrokeColor),_=u/2,T=d/2;t.save(),t.fillStyle=i.cornerColor||l.cornerColor,t.strokeStyle=i.cornerStrokeColor||l.cornerStrokeColor,t.lineWidth=1,t.translate(n,a),t.rotate(h(l.angle)),t[p+"Rect"](-_,-T,u,d),v&&t.strokeRect(-_,-T,u,d),t.restore()}o.renderCircleControl=e,o.renderSquareControl=r}(Z),function(c){var s=c.fabric||(c.fabric={});function h(o){for(var e in o)this[e]=o[e]}s.Control=h,s.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(o,e){return e.cursorStyle},getActionName:function(o,e){return e.actionName},getVisibility:function(o,e){var r=o._controlsVisibility;return r&&typeof r[e]<"u"?r[e]:this.visible},setVisibility:function(o){this.visible=o},positionHandler:function(o,e){var r=s.util.transformPoint({x:this.x*o.x+this.offsetX,y:this.y*o.y+this.offsetY},e);return r},calcCornerCoords:function(o,e,r,t,n){var a,i,l,u,d=n?this.touchSizeX:this.sizeX,g=n?this.touchSizeY:this.sizeY;if(d&&g&&d!==g){var p=Math.atan2(g,d),v=Math.sqrt(d*d+g*g)/2,_=p-s.util.degreesToRadians(o),T=Math.PI/2-p-s.util.degreesToRadians(o);a=v*s.util.cos(_),i=v*s.util.sin(_),l=v*s.util.cos(T),u=v*s.util.sin(T)}else{var A=d&&g?d:e;v=A*.7071067812;var _=s.util.degreesToRadians(45-o);a=l=v*s.util.cos(_),i=u=v*s.util.sin(_)}return{tl:{x:r-u,y:t-l},tr:{x:r+a,y:t-i},bl:{x:r-a,y:t+i},br:{x:r+u,y:t+l}}},render:function(o,e,r,t,n){switch(t=t||{},t.cornerStyle||n.cornerStyle){case"circle":s.controlsUtils.renderCircleControl.call(this,o,e,r,t,n);break;default:s.controlsUtils.renderSquareControl.call(this,o,e,r,t,n)}}}}(Z),function(){function c(r,t){var n=r.getAttribute("style"),a=r.getAttribute("offset")||0,i,l,u,d;if(a=parseFloat(a)/(/%$/.test(a)?100:1),a=a<0?0:a>1?1:a,n){var g=n.split(/\s*;\s*/);for(g[g.length-1]===""&&g.pop(),d=g.length;d--;){var p=g[d].split(/\s*:\s*/),v=p[0].trim(),_=p[1].trim();v==="stop-color"?i=_:v==="stop-opacity"&&(u=_)}}return i||(i=r.getAttribute("stop-color")||"rgb(0,0,0)"),u||(u=r.getAttribute("stop-opacity")),i=new f.Color(i),l=i.getAlpha(),u=isNaN(parseFloat(u))?1:parseFloat(u),u*=l*t,{offset:a,color:i.toRgb(),opacity:u}}function s(r){return{x1:r.getAttribute("x1")||0,y1:r.getAttribute("y1")||0,x2:r.getAttribute("x2")||"100%",y2:r.getAttribute("y2")||0}}function h(r){return{x1:r.getAttribute("fx")||r.getAttribute("cx")||"50%",y1:r.getAttribute("fy")||r.getAttribute("cy")||"50%",r1:0,x2:r.getAttribute("cx")||"50%",y2:r.getAttribute("cy")||"50%",r2:r.getAttribute("r")||"50%"}}var o=f.util.object.clone;f.Gradient=f.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(r){r||(r={}),r.coords||(r.coords={});var t,n=this;Object.keys(r).forEach(function(a){n[a]=r[a]}),this.id?this.id+="_"+f.Object.__uid++:this.id=f.Object.__uid++,t={x1:r.coords.x1||0,y1:r.coords.y1||0,x2:r.coords.x2||0,y2:r.coords.y2||0},this.type==="radial"&&(t.r1=r.coords.r1||0,t.r2=r.coords.r2||0),this.coords=t,this.colorStops=r.colorStops.slice()},addColorStop:function(r){for(var t in r){var n=new f.Color(r[t]);this.colorStops.push({offset:parseFloat(t),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(r){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return f.util.populateWithProperties(this,t,r),t},toSVG:function(r,l){var n=o(this.coords,!0),a,i,l=l||{},u,d,g=o(this.colorStops,!0),p=n.r1>n.r2,v=this.gradientTransform?this.gradientTransform.concat():f.iMatrix.concat(),_=-this.offsetX,T=-this.offsetY,A=!!l.additionalTransform,X=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(g.sort(function(G,q){return G.offset-q.offset}),X==="objectBoundingBox"?(_/=r.width,T/=r.height):(_+=r.width/2,T+=r.height/2),r.type==="path"&&this.gradientUnits!=="percentage"&&(_-=r.pathOffset.x,T-=r.pathOffset.y),v[4]-=_,v[5]-=T,d='id="SVGID_'+this.id+'" gradientUnits="'+X+'"',d+=' gradientTransform="'+(A?l.additionalTransform+" ":"")+f.util.matrixToSVG(v)+'" ',this.type==="linear"?u=[" +`]:this.type==="radial"&&(u=[" +`]),this.type==="radial"){if(p)for(g=g.concat(),g.reverse(),a=0,i=g.length;a0){var N=Math.max(n.r1,n.r2),V=W/N;for(a=0,i=g.length;a +`)}return u.push(this.type==="linear"?` +`:` +`),u.join("")},toLive:function(r){var t,n=f.util.object.clone(this.coords),a,i;if(this.type){for(this.type==="linear"?t=r.createLinearGradient(n.x1,n.y1,n.x2,n.y2):this.type==="radial"&&(t=r.createRadialGradient(n.x1,n.y1,n.r1,n.x2,n.y2,n.r2)),a=0,i=this.colorStops.length;a1?1:i,isNaN(i)&&(i=1);var l=r.getElementsByTagName("stop"),u,d=r.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",g=r.getAttribute("gradientTransform")||"",p=[],v,_,T=0,A=0,X;for(r.nodeName==="linearGradient"||r.nodeName==="LINEARGRADIENT"?(u="linear",v=s(r)):(u="radial",v=h(r)),_=l.length;_--;)p.push(c(l[_],i));X=f.parseTransformAttribute(g),e(t,v,a,d),d==="pixels"&&(T=-t.left,A=-t.top);var W=new f.Gradient({id:r.getAttribute("id"),type:u,coords:v,colorStops:p,gradientUnits:d,gradientTransform:X,offsetX:T,offsetY:A});return W}});function e(r,t,n,a){var i,l;Object.keys(t).forEach(function(u){i=t[u],i==="Infinity"?l=1:i==="-Infinity"?l=0:(l=parseFloat(t[u],10),typeof i=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(l*=.01,a==="pixels"&&((u==="x1"||u==="x2"||u==="r2")&&(l*=n.viewBoxWidth||n.width),(u==="y1"||u==="y2")&&(l*=n.viewBoxHeight||n.height)))),t[u]=l})}}(),function(){var c=f.util.toFixed;f.Pattern=f.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(s,h){if(s||(s={}),this.id=f.Object.__uid++,this.setOptions(s),!s.source||s.source&&typeof s.source!="string"){h&&h(this);return}else{var o=this;this.source=f.util.createImage(),f.util.loadImage(s.source,function(e,r){o.source=e,h&&h(o,r)},null,this.crossOrigin)}},toObject:function(s){var h=f.Object.NUM_FRACTION_DIGITS,o,e;return typeof this.source.src=="string"?o=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(o=this.source.toDataURL()),e={type:"pattern",source:o,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:c(this.offsetX,h),offsetY:c(this.offsetY,h),patternTransform:this.patternTransform?this.patternTransform.concat():null},f.util.populateWithProperties(this,e,s),e},toSVG:function(s){var h=typeof this.source=="function"?this.source():this.source,o=h.width/s.width,e=h.height/s.height,r=this.offsetX/s.width,t=this.offsetY/s.height,n="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(e=1,t&&(e+=Math.abs(t))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(o=1,r&&(o+=Math.abs(r))),h.src?n=h.src:h.toDataURL&&(n=h.toDataURL()),' + + +`},setOptions:function(s){for(var h in s)this[h]=s[h]},toLive:function(s){var h=this.source;return!h||typeof h.src<"u"&&(!h.complete||h.naturalWidth===0||h.naturalHeight===0)?"":s.createPattern(h,this.repeat)}})}(),function(c){var s=c.fabric||(c.fabric={}),h=s.util.toFixed;if(s.Shadow){s.warn("fabric.Shadow is already defined.");return}s.Shadow=s.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(o){typeof o=="string"&&(o=this._parseShadow(o));for(var e in o)this[e]=o[e];this.id=s.Object.__uid++},_parseShadow:function(o){var e=o.trim(),r=s.Shadow.reOffsetsAndBlur.exec(e)||[],t=e.replace(s.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:t.trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(o){var e=40,r=40,t=s.Object.NUM_FRACTION_DIGITS,n=s.util.rotateVector({x:this.offsetX,y:this.offsetY},s.util.degreesToRadians(-o.angle)),a=20,i=new s.Color(this.color);return o.width&&o.height&&(e=h((Math.abs(n.x)+this.blur)/o.width,t)*100+a,r=h((Math.abs(n.y)+this.blur)/o.height,t)*100+a),o.flipX&&(n.x*=-1),o.flipY&&(n.y*=-1),' + + + + + + + + + +`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var o={},e=s.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(r){this[r]!==e[r]&&(o[r]=this[r])},this),o}}),s.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(Z),function(){if(f.StaticCanvas){f.warn("fabric.StaticCanvas is already defined.");return}var c=f.util.object.extend,s=f.util.getElementOffset,h=f.util.removeFromArray,o=f.util.toFixed,e=f.util.transformPoint,r=f.util.invertTransform,t=f.util.getNodeCanvas,n=f.util.createCanvasElement,a=new Error("Could not initialize `canvas` element");f.StaticCanvas=f.util.createClass(f.CommonMethods,{initialize:function(i,l){l||(l={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(i,l)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:f.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(i,l){var u=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(i),this._initOptions(l),this.interactive||this._initRetinaScaling(),l.overlayImage&&this.setOverlayImage(l.overlayImage,u),l.backgroundImage&&this.setBackgroundImage(l.backgroundImage,u),l.backgroundColor&&this.setBackgroundColor(l.backgroundColor,u),l.overlayColor&&this.setOverlayColor(l.overlayColor,u),this.calcOffset()},_isRetinaScaling:function(){return f.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,f.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var i=f.devicePixelRatio;this.__initRetinaScaling(i,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(i,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(i,l,u){l.setAttribute("width",this.width*i),l.setAttribute("height",this.height*i),u.scale(i,i)},calcOffset:function(){return this._offset=s(this.lowerCanvasEl),this},setOverlayImage:function(i,l,u){return this.__setBgOverlayImage("overlayImage",i,l,u)},setBackgroundImage:function(i,l,u){return this.__setBgOverlayImage("backgroundImage",i,l,u)},setOverlayColor:function(i,l){return this.__setBgOverlayColor("overlayColor",i,l)},setBackgroundColor:function(i,l){return this.__setBgOverlayColor("backgroundColor",i,l)},__setBgOverlayImage:function(i,l,u,d){return typeof l=="string"?f.util.loadImage(l,function(g,p){if(g){var v=new f.Image(g,d);this[i]=v,v.canvas=this}u&&u(g,p)},this,d&&d.crossOrigin):(d&&l.setOptions(d),this[i]=l,l&&(l.canvas=this),u&&u(l,!1)),this},__setBgOverlayColor:function(i,l,u){return this[i]=l,this._initGradient(l,i),this._initPattern(l,i,u),this},_createCanvasElement:function(){var i=n();if(!i||(i.style||(i.style={}),typeof i.getContext>"u"))throw a;return i},_initOptions:function(i){var l=this.lowerCanvasEl;this._setOptions(i),this.width=this.width||parseInt(l.width,10)||0,this.height=this.height||parseInt(l.height,10)||0,this.lowerCanvasEl.style&&(l.width=this.width,l.height=this.height,l.style.width=this.width+"px",l.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(i){i&&i.getContext?this.lowerCanvasEl=i:this.lowerCanvasEl=f.util.getById(i)||this._createCanvasElement(),f.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(i,l){return this.setDimensions({width:i},l)},setHeight:function(i,l){return this.setDimensions({height:i},l)},setDimensions:function(i,l){var u;l=l||{};for(var d in i)u=i[d],l.cssOnly||(this._setBackstoreDimension(d,i[d]),u+="px",this.hasLostContext=!0),l.backstoreOnly||this._setCssDimension(d,u);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),l.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(i,l){return this.lowerCanvasEl[i]=l,this.upperCanvasEl&&(this.upperCanvasEl[i]=l),this.cacheCanvasEl&&(this.cacheCanvasEl[i]=l),this[i]=l,this},_setCssDimension:function(i,l){return this.lowerCanvasEl.style[i]=l,this.upperCanvasEl&&(this.upperCanvasEl.style[i]=l),this.wrapperEl&&(this.wrapperEl.style[i]=l),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(i){var l=this._activeObject,u=this.backgroundImage,d=this.overlayImage,g,p,v;for(this.viewportTransform=i,p=0,v=this._objects.length;p +`),this._setSVGBgOverlayColor(u,"background"),this._setSVGBgOverlayImage(u,"backgroundImage",l),this._setSVGObjects(u,l),this.clipPath&&u.push(` +`),this._setSVGBgOverlayColor(u,"overlay"),this._setSVGBgOverlayImage(u,"overlayImage",l),u.push(""),u.join("")},_setSVGPreamble:function(i,l){l.suppressPreamble||i.push(' +`,' +`)},_setSVGHeader:function(i,l){var u=l.width||this.width,d=l.height||this.height,g,p='viewBox="0 0 '+this.width+" "+this.height+'" ',v=f.Object.NUM_FRACTION_DIGITS;l.viewBox?p='viewBox="'+l.viewBox.x+" "+l.viewBox.y+" "+l.viewBox.width+" "+l.viewBox.height+'" ':this.svgViewportTransformation&&(g=this.viewportTransform,p='viewBox="'+o(-g[4]/g[0],v)+" "+o(-g[5]/g[3],v)+" "+o(this.width/g[0],v)+" "+o(this.height/g[3],v)+'" '),i.push(" +`,"Created with Fabric.js ",f.version,` +`,` +`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(l),` +`)},createSVGClipPathMarkup:function(i){var l=this.clipPath;return l?(l.clipPathId="CLIPPATH_"+f.Object.__uid++,' +`+this.clipPath.toClipPathSVG(i.reviver)+` +`):""},createSVGRefElementsMarkup:function(){var i=this,l=["background","overlay"].map(function(u){var d=i[u+"Color"];if(d&&d.toLive){var g=i[u+"Vpt"],p=i.viewportTransform,v={width:i.width/(g?p[0]:1),height:i.height/(g?p[3]:1)};return d.toSVG(v,{additionalTransform:g?f.util.matrixToSVG(p):""})}});return l.join("")},createSVGFontFacesMarkup:function(){var i="",l={},u,d,g,p,v,_,T,A,X,W=f.fontPaths,N=[];for(this._objects.forEach(function U(G){N.push(G),G._objects&&G._objects.forEach(U)}),A=0,X=N.length;A',` +`,i,"",` +`].join("")),i},_setSVGObjects:function(i,l){var u,d,g,p=this._objects;for(d=0,g=p.length;d +`)}else i.push(' +`)},sendToBack:function(i){if(!i)return this;var l=this._activeObject,u,d,g;if(i===l&&i.type==="activeSelection")for(g=l._objects,u=g.length;u--;)d=g[u],h(this._objects,d),this._objects.unshift(d);else h(this._objects,i),this._objects.unshift(i);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(i){if(!i)return this;var l=this._activeObject,u,d,g;if(i===l&&i.type==="activeSelection")for(g=l._objects,u=0;u0+T&&(v=p-1,h(this._objects,g),this._objects.splice(v,0,g)),T++;else p=this._objects.indexOf(i),p!==0&&(v=this._findNewLowerIndex(i,p,l),h(this._objects,i),this._objects.splice(v,0,i));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(i,l,u){var d,g;if(u)for(d=l,g=l-1;g>=0;--g){var p=i.intersectsWithObject(this._objects[g])||i.isContainedWithinObject(this._objects[g])||this._objects[g].isContainedWithinObject(i);if(p){d=g;break}}else d=l-1;return d},bringForward:function(i,l){if(!i)return this;var u=this._activeObject,d,g,p,v,_,T=0;if(i===u&&i.type==="activeSelection")for(_=u._objects,d=_.length;d--;)g=_[d],p=this._objects.indexOf(g),p"}}),c(f.StaticCanvas.prototype,f.Observable),c(f.StaticCanvas.prototype,f.Collection),c(f.StaticCanvas.prototype,f.DataURLExporter),c(f.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(i){var l=n();if(!l||!l.getContext)return null;var u=l.getContext("2d");if(!u)return null;switch(i){case"setLineDash":return typeof u.setLineDash<"u";default:return null}}}),f.StaticCanvas.prototype.toJSON=f.StaticCanvas.prototype.toObject,f.isLikelyNode&&(f.StaticCanvas.prototype.createPNGStream=function(){var i=t(this.lowerCanvasEl);return i&&i.createPNGStream()},f.StaticCanvas.prototype.createJPEGStream=function(i){var l=t(this.lowerCanvasEl);return l&&l.createJPEGStream(i)})}(),f.BaseBrush=f.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(c){c.strokeStyle=this.color,c.lineWidth=this.width,c.lineCap=this.strokeLineCap,c.miterLimit=this.strokeMiterLimit,c.lineJoin=this.strokeLineJoin,c.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(c){var s=this.canvas.viewportTransform;c.save(),c.transform(s[0],s[1],s[2],s[3],s[4],s[5])},_setShadow:function(){if(this.shadow){var c=this.canvas,s=this.shadow,h=c.contextTop,o=c.getZoom();c&&c._isRetinaScaling()&&(o*=f.devicePixelRatio),h.shadowColor=s.color,h.shadowBlur=s.blur*o,h.shadowOffsetX=s.offsetX*o,h.shadowOffsetY=s.offsetY*o}},needsFullRender:function(){var c=new f.Color(this.color);return c.getAlpha()<1||!!this.shadow},_resetShadow:function(){var c=this.canvas.contextTop;c.shadowColor="",c.shadowBlur=c.shadowOffsetX=c.shadowOffsetY=0},_isOutSideCanvas:function(c){return c.x<0||c.x>this.canvas.getWidth()||c.y<0||c.y>this.canvas.getHeight()}}),function(){f.PencilBrush=f.util.createClass(f.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(c){this.canvas=c,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(c,s,h){var o=s.midPointFrom(h);return c.quadraticCurveTo(s.x,s.y,o.x,o.y),o},onMouseDown:function(c,s){this.canvas._isMainEvent(s.e)&&(this.drawStraightLine=s.e[this.straightLineKey],this._prepareForDrawing(c),this._captureDrawingPath(c),this._render())},onMouseMove:function(c,s){if(this.canvas._isMainEvent(s.e)&&(this.drawStraightLine=s.e[this.straightLineKey],!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(c))&&this._captureDrawingPath(c)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var h=this._points,o=h.length,e=this.canvas.contextTop;this._saveAndTransform(e),this.oldEnd&&(e.beginPath(),e.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(e,h[o-2],h[o-1],!0),e.stroke(),e.restore()}},onMouseUp:function(c){return this.canvas._isMainEvent(c.e)?(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(c){var s=new f.Point(c.x,c.y);this._reset(),this._addPoint(s),this.canvas.contextTop.moveTo(s.x,s.y)},_addPoint:function(c){return this._points.length>1&&c.eq(this._points[this._points.length-1])?!1:(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(c),!0)},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(c){var s=new f.Point(c.x,c.y);return this._addPoint(s)},_render:function(c){var s,h,o=this._points[0],e=this._points[1];if(c=c||this.canvas.contextTop,this._saveAndTransform(c),c.beginPath(),this._points.length===2&&o.x===e.x&&o.y===e.y){var r=this.width/1e3;o=new f.Point(o.x,o.y),e=new f.Point(e.x,e.y),o.x-=r,e.x+=r}for(c.moveTo(o.x,o.y),s=1,h=this._points.length;s=o&&(t=c[e],n.push(t));return n.push(c[r]),n},_finalizeAndAddPath:function(){var c=this.canvas.contextTop;c.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var s=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(s)){this.canvas.requestRenderAll();return}var h=this.createPath(s);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:h}),this.canvas.add(h),this.canvas.requestRenderAll(),h.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:h})}})}(),f.CircleBrush=f.util.createClass(f.BaseBrush,{width:10,initialize:function(c){this.canvas=c,this.points=[]},drawDot:function(c){var s=this.addPoint(c),h=this.canvas.contextTop;this._saveAndTransform(h),this.dot(h,s),h.restore()},dot:function(c,s){c.fillStyle=s.fill,c.beginPath(),c.arc(s.x,s.y,s.radius,0,Math.PI*2,!1),c.closePath(),c.fill()},onMouseDown:function(c){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(c)},_render:function(){var c=this.canvas.contextTop,s,h,o=this.points;for(this._saveAndTransform(c),s=0,h=o.length;s0&&!this.preserveObjectStacking){t=[],n=[];for(var a=0,i=this._objects.length;a1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,r){var t=e.calcTransformMatrix(),n=f.util.invertTransform(t),a=this.restorePointerVpt(r);return f.util.transformPoint(a,n)},isTargetTransparent:function(e,r,t){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var n=this._normalizePointer(e,{x:r,y:t}),a=Math.max(e.cacheTranslationX+n.x*e.zoomX,0),i=Math.max(e.cacheTranslationY+n.y*e.zoomY,0),g=f.util.isTransparent(e._cacheContext,Math.round(a),Math.round(i),this.targetFindTolerance);return g}var l=this.contextCache,u=e.selectionBackgroundColor,d=this.viewportTransform;e.selectionBackgroundColor="",this.clearContext(l),l.save(),l.transform(d[0],d[1],d[2],d[3],d[4],d[5]),e.render(l),l.restore(),e.selectionBackgroundColor=u;var g=f.util.isTransparent(l,r,t,this.targetFindTolerance);return g},_isSelectionKeyPressed:function(e){var r=!1;return Array.isArray(this.selectionKey)?r=!!this.selectionKey.find(function(t){return e[t]===!0}):r=e[this.selectionKey],r},_shouldClearSelection:function(e,r){var t=this.getActiveObjects(),n=this._activeObject;return!r||r&&n&&t.length>1&&t.indexOf(r)===-1&&n!==r&&!this._isSelectionKeyPressed(e)||r&&!r.evented||r&&!r.selectable&&n&&n!==r},_shouldCenterTransform:function(e,r,t){if(e){var n;return r==="scale"||r==="scaleX"||r==="scaleY"||r==="resizing"?n=this.centeredScaling||e.centeredScaling:r==="rotate"&&(n=this.centeredRotation||e.centeredRotation),n?!t:t}},_getOriginFromCorner:function(e,r){var t={x:e.originX,y:e.originY};return r==="ml"||r==="tl"||r==="bl"?t.x="right":(r==="mr"||r==="tr"||r==="br")&&(t.x="left"),r==="tl"||r==="mt"||r==="tr"?t.y="bottom":(r==="bl"||r==="mb"||r==="br")&&(t.y="top"),t},_getActionFromCorner:function(e,r,t,n){if(!r||!e)return"drag";var a=n.controls[r];return a.getActionName(t,a,n)},_setupCurrentTransform:function(e,r,t){if(r){var n=this.getPointer(e),a=r.__corner,i=r.controls[a],l=t&&a?i.getActionHandler(e,r,i):f.controlsUtils.dragHandler,u=this._getActionFromCorner(t,a,e,r),d=this._getOriginFromCorner(r,a),g=e[this.centeredKey],p={target:r,action:u,actionHandler:l,corner:a,scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,offsetX:n.x-r.left,offsetY:n.y-r.top,originX:d.x,originY:d.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:s(r.angle),width:r.width*r.scaleX,shiftKey:e.shiftKey,altKey:g,original:f.util.saveObjectTransform(r)};this._shouldCenterTransform(r,u,g)&&(p.originX="center",p.originY="center"),p.original.originX=d.x,p.original.originY=d.y,this._currentTransform=p,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var r=this._groupSelector,t=new f.Point(r.ex,r.ey),n=f.util.transformPoint(t,this.viewportTransform),a=new f.Point(r.ex+r.left,r.ey+r.top),i=f.util.transformPoint(a,this.viewportTransform),l=Math.min(n.x,i.x),u=Math.min(n.y,i.y),d=Math.max(n.x,i.x),g=Math.max(n.y,i.y),p=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(l,u,d-l,g-u)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,l+=p,u+=p,d-=p,g-=p,f.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(l,u,d-l,g-u))},findTarget:function(e,r){if(!this.skipTargetFind){var t=!0,n=this.getPointer(e,t),a=this._activeObject,i=this.getActiveObjects(),l,u,d=h(e),g=i.length>1&&!r||i.length===1;if(this.targets=[],g&&a._findTargetCorner(n,d)||i.length>1&&!r&&a===this._searchPossibleTargets([a],n))return a;if(i.length===1&&a===this._searchPossibleTargets([a],n))if(this.preserveObjectStacking)l=a,u=this.targets,this.targets=[];else return a;var p=this._searchPossibleTargets(this._objects,n);return e[this.altSelectionKey]&&p&&l&&p!==l&&(p=l,this.targets=u),p}},_checkTarget:function(e,r,t){if(r&&r.visible&&r.evented&&r.containsPoint(e))if((this.perPixelTargetFind||r.perPixelTargetFind)&&!r.isEditing){var n=this.isTargetTransparent(r,t.x,t.y);if(!n)return!0}else return!0},_searchPossibleTargets:function(e,r){for(var t,n=e.length,a;n--;){var i=e[n],l=i.group?this._normalizePointer(i.group,r):r;if(this._checkTarget(l,i,r)){t=e[n],t.subTargetCheck&&t instanceof f.Group&&(a=this._searchPossibleTargets(t._objects,r),a&&this.targets.push(a));break}}return t},restorePointerVpt:function(e){return f.util.transformPoint(e,f.util.invertTransform(this.viewportTransform))},getPointer:function(e,r){if(this._absolutePointer&&!r)return this._absolutePointer;if(this._pointer&&r)return this._pointer;var t=c(e),n=this.upperCanvasEl,a=n.getBoundingClientRect(),i=a.width||0,l=a.height||0,u;(!i||!l)&&("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(i=Math.abs(a.right-a.left))),this.calcOffset(),t.x=t.x-this._offset.left,t.y=t.y-this._offset.top,r||(t=this.restorePointerVpt(t));var d=this.getRetinaScaling();return d!==1&&(t.x/=d,t.y/=d),i===0||l===0?u={width:1,height:1}:u={width:n.width/i,height:n.height/l},{x:t.x*u.width,y:t.y*u.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),r=this.lowerCanvasEl,t=this.upperCanvasEl;t?t.className="":(t=this._createCanvasElement(),this.upperCanvasEl=t),f.util.addClass(t,"upper-canvas "+e),this.wrapperEl.appendChild(t),this._copyCanvasStyle(r,t),this._applyCanvasStyle(t),this.contextTop=t.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=f.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),f.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),f.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var r=this.width||e.width,t=this.height||e.height;f.util.setStyle(e,{position:"absolute",width:r+"px",height:t+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=r,e.height=t,f.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,r){r.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?e.type==="activeSelection"&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,r){var t=!1,n=this.getActiveObjects(),a=[],i=[];e.forEach(function(l){n.indexOf(l)===-1&&(t=!0,l.fire("deselected",{e:r,target:l}),i.push(l))}),n.forEach(function(l){e.indexOf(l)===-1&&(t=!0,l.fire("selected",{e:r,target:l}),a.push(l))}),e.length>0&&n.length>0?t&&this.fire("selection:updated",{e:r,selected:a,deselected:i}):n.length>0?this.fire("selection:created",{e:r,selected:a}):e.length>0&&this.fire("selection:cleared",{e:r,deselected:i})},setActiveObject:function(e,r){var t=this.getActiveObjects();return this._setActiveObject(e,r),this._fireSelectionEvents(t,r),this},_setActiveObject:function(e,r){return this._activeObject===e||!this._discardActiveObject(r,e)||e.onSelect({e:r})?!1:(this._activeObject=e,!0)},_discardActiveObject:function(e,r){var t=this._activeObject;if(t){if(t.onDeselect({e,object:r}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var r=this.getActiveObjects(),t=this.getActiveObject();return r.length&&this.fire("before:selection:cleared",{target:t,e}),this._discardActiveObject(e),this._fireSelectionEvents(r,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(r){f.util.cleanUpJsdomNode(this[r]),this[r]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,f.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var r=this._activeObject;r&&r._renderControls(e)},_toObject:function(e,r,t){var n=this._realizeGroupTransformOnObject(e),a=this.callSuper("_toObject",e,r,t);return this._unwindGroupTransformOnObject(e,n),a},_realizeGroupTransformOnObject:function(e){if(e.group&&e.group.type==="activeSelection"&&this._activeObject===e.group){var r=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],t={};return r.forEach(function(n){t[n]=e[n]}),f.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}else return null},_unwindGroupTransformOnObject:function(e,r){r&&e.set(r)},_setSVGObject:function(e,r,t){var n=this._realizeGroupTransformOnObject(r);this.callSuper("_setSVGObject",e,r,t),this._unwindGroupTransformOnObject(r,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),f.StaticCanvas.prototype.setViewportTransform.call(this,e)}});for(var o in f.StaticCanvas)o!=="prototype"&&(f.Canvas[o]=f.StaticCanvas[o])}(),function(){var c=f.util.addListener,s=f.util.removeListener,h=3,o=2,e=1,r={passive:!1};function t(n,a){return n.button&&n.button===a-1}f.util.object.extend(f.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(c,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(n,a){var i=this.upperCanvasEl,l=this._getEventPrefix();n(f.window,"resize",this._onResize),n(i,l+"down",this._onMouseDown),n(i,l+"move",this._onMouseMove,r),n(i,l+"out",this._onMouseOut),n(i,l+"enter",this._onMouseEnter),n(i,"wheel",this._onMouseWheel),n(i,"contextmenu",this._onContextMenu),n(i,"dblclick",this._onDoubleClick),n(i,"dragover",this._onDragOver),n(i,"dragenter",this._onDragEnter),n(i,"dragleave",this._onDragLeave),n(i,"drop",this._onDrop),this.enablePointerEvents||n(i,"touchstart",this._onTouchStart,r),typeof eventjs<"u"&&a in eventjs&&(eventjs[a](i,"gesture",this._onGesture),eventjs[a](i,"drag",this._onDrag),eventjs[a](i,"orientation",this._onOrientationChange),eventjs[a](i,"shake",this._onShake),eventjs[a](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(s,"remove");var n=this._getEventPrefix();s(f.document,n+"up",this._onMouseUp),s(f.document,"touchend",this._onTouchEnd,r),s(f.document,n+"move",this._onMouseMove,r),s(f.document,"touchmove",this._onMouseMove,r)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(n,a){this.__onTransformGesture&&this.__onTransformGesture(n,a)},_onDrag:function(n,a){this.__onDrag&&this.__onDrag(n,a)},_onMouseWheel:function(n){this.__onMouseWheel(n)},_onMouseOut:function(n){var a=this._hoveredTarget;this.fire("mouse:out",{target:a,e:n}),this._hoveredTarget=null,a&&a.fire("mouseout",{e:n});var i=this;this._hoveredTargets.forEach(function(l){i.fire("mouse:out",{target:a,e:n}),l&&a.fire("mouseout",{e:n})}),this._hoveredTargets=[]},_onMouseEnter:function(n){!this._currentTransform&&!this.findTarget(n)&&(this.fire("mouse:over",{target:null,e:n}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(n,a){this.__onOrientationChange&&this.__onOrientationChange(n,a)},_onShake:function(n,a){this.__onShake&&this.__onShake(n,a)},_onLongPress:function(n,a){this.__onLongPress&&this.__onLongPress(n,a)},_onDragOver:function(n){n.preventDefault();var a=this._simpleEventHandler("dragover",n);this._fireEnterLeaveEvents(a,n)},_onDrop:function(n){return this._simpleEventHandler("drop:before",n),this._simpleEventHandler("drop",n)},_onContextMenu:function(n){return this.stopContextMenu&&(n.stopPropagation(),n.preventDefault()),!1},_onDoubleClick:function(n){this._cacheTransformEventData(n),this._handleEvent(n,"dblclick"),this._resetTransformEventData(n)},getPointerId:function(n){var a=n.changedTouches;return a?a[0]&&a[0].identifier:this.enablePointerEvents?n.pointerId:-1},_isMainEvent:function(n){return n.isPrimary===!0?!0:n.isPrimary===!1?!1:n.type==="touchend"&&n.touches.length===0?!0:n.changedTouches?n.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(n){n.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();c(f.document,"touchend",this._onTouchEnd,r),c(f.document,"touchmove",this._onMouseMove,r),s(a,i+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();s(a,i+"move",this._onMouseMove,r),c(f.document,i+"up",this._onMouseUp),c(f.document,i+"move",this._onMouseMove,r)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var a=this._getEventPrefix();s(f.document,"touchend",this._onTouchEnd,r),s(f.document,"touchmove",this._onMouseMove,r);var i=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){c(i.upperCanvasEl,a+"down",i._onMouseDown),i._willAddMouseDown=0},400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();this._isMainEvent(n)&&(s(f.document,i+"up",this._onMouseUp),s(f.document,i+"move",this._onMouseMove,r),c(a,i+"move",this._onMouseMove,r))},_onMouseMove:function(n){!this.allowTouchScrolling&&n.preventDefault&&n.preventDefault(),this.__onMouseMove(n)},_onResize:function(){this.calcOffset()},_shouldRender:function(n){var a=this._activeObject;return!!a!=!!n||a&&n&&a!==n?!0:(a&&a.isEditing,!1)},__onMouseUp:function(n){var a,i=this._currentTransform,l=this._groupSelector,u=!1,d=!l||l.left===0&&l.top===0;if(this._cacheTransformEventData(n),a=this._target,this._handleEvent(n,"up:before"),t(n,h)){this.fireRightClick&&this._handleEvent(n,"up",h,d);return}if(t(n,o)){this.fireMiddleClick&&this._handleEvent(n,"up",o,d),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(n);return}if(this._isMainEvent(n)){if(i&&(this._finalizeCurrentTransform(n),u=i.actionPerformed),!d){var g=a===this._activeObject;this._maybeGroupObjects(n),u||(u=this._shouldRender(a)||!g&&a===this._activeObject)}var p,v;if(a){if(p=a._findTargetCorner(this.getPointer(n,!0),f.util.isTouchEvent(n)),a.selectable&&a!==this._activeObject&&a.activeOn==="up")this.setActiveObject(a,n),u=!0;else{var _=a.controls[p],T=_&&_.getMouseUpHandler(n,a,_);T&&(v=this.getPointer(n),T(n,i,v.x,v.y))}a.isMoving=!1}if(i&&(i.target!==a||i.corner!==p)){var A=i.target&&i.target.controls[i.corner],X=A&&A.getMouseUpHandler(n,a,_);v=v||this.getPointer(n),X&&X(n,i,v.x,v.y)}this._setCursorFromEvent(n,a),this._handleEvent(n,"up",e,d),this._groupSelector=null,this._currentTransform=null,a&&(a.__corner=0),u?this.requestRenderAll():d||this.renderTop()}},_simpleEventHandler:function(n,a){var i=this.findTarget(a),l=this.targets,u={e:a,target:i,subTargets:l};if(this.fire(n,u),i&&i.fire(n,u),!l)return i;for(var d=0;d1&&(e=new f.ActiveSelection(o.reverse(),{canvas:this}),this.setActiveObject(e,h))},_collectObjects:function(h){for(var o=[],e,r=this._groupSelector.ex,t=this._groupSelector.ey,n=r+this._groupSelector.left,a=t+this._groupSelector.top,i=new f.Point(c(r,n),c(t,a)),l=new f.Point(s(r,n),s(t,a)),u=!this.selectionFullyContained,d=r===n&&t===a,g=this._objects.length;g--&&(e=this._objects[g],!(!(!e||!e.selectable||!e.visible)&&(u&&e.intersectsWithRect(i,l,!0)||e.isContainedWithinRect(i,l,!0)||u&&e.containsPoint(i,null,!0)||u&&e.containsPoint(l,null,!0))&&(o.push(e),d))););return o.length>1&&(o=o.filter(function(p){return!p.onSelect({e:h})})),o},_maybeGroupObjects:function(h){this.selection&&this._groupSelector&&this._groupSelectedObjects(h),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){f.util.object.extend(f.StaticCanvas.prototype,{toDataURL:function(c){c||(c={});var s=c.format||"png",h=c.quality||1,o=(c.multiplier||1)*(c.enableRetinaScaling?this.getRetinaScaling():1),e=this.toCanvasElement(o,c);return f.util.toDataURL(e,s,h)},toCanvasElement:function(c,s){c=c||1,s=s||{};var h=(s.width||this.width)*c,o=(s.height||this.height)*c,e=this.getZoom(),r=this.width,t=this.height,n=e*c,a=this.viewportTransform,i=(a[4]-(s.left||0))*c,l=(a[5]-(s.top||0))*c,u=this.interactive,d=[n,0,0,n,i,l],g=this.enableRetinaScaling,p=f.util.createCanvasElement(),v=this.contextTop;return p.width=h,p.height=o,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=d,this.width=h,this.height=o,this.calcViewportBoundaries(),this.renderCanvas(p.getContext("2d"),this._objects),this.viewportTransform=a,this.width=r,this.height=t,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=g,this.contextTop=v,p}})}(),f.util.object.extend(f.StaticCanvas.prototype,{loadFromJSON:function(c,s,h){if(c){var o=typeof c=="string"?JSON.parse(c):f.util.object.clone(c),e=this,r=o.clipPath,t=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete o.clipPath,this._enlivenObjects(o.objects,function(n){e.clear(),e._setBgOverlay(o,function(){r?e._enlivenObjects([r],function(a){e.clipPath=a[0],e.__setupCanvas.call(e,o,n,t,s)}):e.__setupCanvas.call(e,o,n,t,s)})},h),this}},__setupCanvas:function(c,s,h,o){var e=this;s.forEach(function(r,t){e.insertAt(r,t)}),this.renderOnAddRemove=h,delete c.objects,delete c.backgroundImage,delete c.overlayImage,delete c.background,delete c.overlay,this._setOptions(c),this.renderAll(),o&&o()},_setBgOverlay:function(c,s){var h={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!c.backgroundImage&&!c.overlayImage&&!c.background&&!c.overlay){s&&s();return}var o=function(){h.backgroundImage&&h.overlayImage&&h.backgroundColor&&h.overlayColor&&s&&s()};this.__setBgOverlay("backgroundImage",c.backgroundImage,h,o),this.__setBgOverlay("overlayImage",c.overlayImage,h,o),this.__setBgOverlay("backgroundColor",c.background,h,o),this.__setBgOverlay("overlayColor",c.overlay,h,o)},__setBgOverlay:function(c,s,h,o){var e=this;if(!s){h[c]=!0,o&&o();return}c==="backgroundImage"||c==="overlayImage"?f.util.enlivenObjects([s],function(r){e[c]=r[0],h[c]=!0,o&&o()}):this["set"+f.util.string.capitalize(c,!0)](s,function(){h[c]=!0,o&&o()})},_enlivenObjects:function(c,s,h){if(!c||c.length===0){s&&s([]);return}f.util.enlivenObjects(c,function(o){s&&s(o)},null,h)},_toDataURL:function(c,s){this.clone(function(h){s(h.toDataURL(c))})},_toDataURLWithMultiplier:function(c,s,h){this.clone(function(o){h(o.toDataURLWithMultiplier(c,s))})},clone:function(c,s){var h=JSON.stringify(this.toJSON(s));this.cloneWithoutData(function(o){o.loadFromJSON(h,function(){c&&c(o)})})},cloneWithoutData:function(c){var s=f.util.createCanvasElement();s.width=this.width,s.height=this.height;var h=new f.Canvas(s);this.backgroundImage?(h.setBackgroundImage(this.backgroundImage.src,function(){h.renderAll(),c&&c(h)}),h.backgroundImageOpacity=this.backgroundImageOpacity,h.backgroundImageStretch=this.backgroundImageStretch):c&&c(h)}}),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.object.clone,e=s.util.toFixed,r=s.util.string.capitalize,t=s.util.degreesToRadians,n=!s.isLikelyNode,a=2;s.Object||(s.Object=s.util.createClass(s.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:n,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(i){i&&this.setOptions(i)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=s.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(i){var l=s.perfLimitSizeTotal,u=i.width,d=i.height,g=s.maxCacheSideLimit,p=s.minCacheSideLimit;if(u<=g&&d<=g&&u*d<=l)return uA&&(i.zoomX/=u/A,i.width=A,i.capped=!0),d>X&&(i.zoomY/=d/X,i.height=X,i.capped=!0),i},_getCacheCanvasDimensions:function(){var i=this.getTotalObjectScaling(),l=this._getTransformedDimensions(0,0),u=l.x*i.scaleX/this.scaleX,d=l.y*i.scaleY/this.scaleY;return{width:u+a,height:d+a,zoomX:i.scaleX,zoomY:i.scaleY,x:u,y:d}},_updateCacheCanvas:function(){var i=this.canvas;if(this.noScaleCache&&i&&i._currentTransform){var l=i._currentTransform.target,u=i._currentTransform.action;if(this===l&&u.slice&&u.slice(0,5)==="scale")return!1}var d=this._cacheCanvas,g=this._limitCacheSize(this._getCacheCanvasDimensions()),p=s.minCacheSideLimit,v=g.width,_=g.height,T,A,X=g.zoomX,W=g.zoomY,N=v!==this.cacheWidth||_!==this.cacheHeight,V=this.zoomX!==X||this.zoomY!==W,U=N||V,G=0,q=0,J=!1;if(N){var K=this._cacheCanvas.width,m=this._cacheCanvas.height,C=v>K||_>m,S=(vp&&m>p;J=C||S,C&&!g.capped&&(v>p||_>p)&&(G=v*.1,q=_*.1)}return this instanceof s.Text&&this.path&&(U=!0,J=!0,G+=this.getHeightOfLine(0)*this.zoomX,q+=this.getHeightOfLine(0)*this.zoomY),U?(J?(d.width=Math.ceil(v+G),d.height=Math.ceil(_+q)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,d.width,d.height)),T=g.x/2,A=g.y/2,this.cacheTranslationX=Math.round(d.width/2-T)+T,this.cacheTranslationY=Math.round(d.height/2-A)+A,this.cacheWidth=v,this.cacheHeight=_,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(X,W),this.zoomX=X,this.zoomY=W,!0):!1},setOptions:function(i){this._setOptions(i),this._initGradient(i.fill,"fill"),this._initGradient(i.stroke,"stroke"),this._initPattern(i.fill,"fill"),this._initPattern(i.stroke,"stroke")},transform:function(i){var l=this.group&&!this.group._transformDone||this.group&&this.canvas&&i===this.canvas.contextTop,u=this.calcTransformMatrix(!l);i.transform(u[0],u[1],u[2],u[3],u[4],u[5])},toObject:function(i){var l=s.Object.NUM_FRACTION_DIGITS,u={type:this.type,version:s.version,originX:this.originX,originY:this.originY,left:e(this.left,l),top:e(this.top,l),width:e(this.width,l),height:e(this.height,l),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:e(this.strokeWidth,l),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:e(this.strokeMiterLimit,l),scaleX:e(this.scaleX,l),scaleY:e(this.scaleY,l),angle:e(this.angle,l),flipX:this.flipX,flipY:this.flipY,opacity:e(this.opacity,l),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:e(this.skewX,l),skewY:e(this.skewY,l)};return this.clipPath&&!this.clipPath.excludeFromExport&&(u.clipPath=this.clipPath.toObject(i),u.clipPath.inverted=this.clipPath.inverted,u.clipPath.absolutePositioned=this.clipPath.absolutePositioned),s.util.populateWithProperties(this,u,i),this.includeDefaultValues||(u=this._removeDefaultValues(u)),u},toDatalessObject:function(i){return this.toObject(i)},_removeDefaultValues:function(i){var l=s.util.getKlass(i.type).prototype,u=l.stateProperties;return u.forEach(function(d){d==="left"||d==="top"||(i[d]===l[d]&&delete i[d],Array.isArray(i[d])&&Array.isArray(l[d])&&i[d].length===0&&l[d].length===0&&delete i[d])}),i},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var i=s.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(i.scaleX),scaleY:Math.abs(i.scaleY)}},getTotalObjectScaling:function(){var i=this.getObjectScaling(),l=i.scaleX,u=i.scaleY;if(this.canvas){var d=this.canvas.getZoom(),g=this.canvas.getRetinaScaling();l*=d*g,u*=d*g}return{scaleX:l,scaleY:u}},getObjectOpacity:function(){var i=this.opacity;return this.group&&(i*=this.group.getObjectOpacity()),i},_set:function(i,l){var u=i==="scaleX"||i==="scaleY",d=this[i]!==l,g=!1;return u&&(l=this._constrainScale(l)),i==="scaleX"&&l<0?(this.flipX=!this.flipX,l*=-1):i==="scaleY"&&l<0?(this.flipY=!this.flipY,l*=-1):i==="shadow"&&l&&!(l instanceof s.Shadow)?l=new s.Shadow(l):i==="dirty"&&this.group&&this.group.set("dirty",l),this[i]=l,d&&(g=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(i)>-1?(this.dirty=!0,g&&this.group.set("dirty",!0)):g&&this.stateProperties.indexOf(i)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:s.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(i){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(i.save(),this._setupCompositeOperation(i),this.drawSelectionBackground(i),this.transform(i),this._setOpacity(i),this._setShadow(i,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(i)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(i),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),i.restore())},renderCache:function(i){i=i||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,i.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(i,l){if(i.save(),l.inverted?i.globalCompositeOperation="destination-out":i.globalCompositeOperation="destination-in",l.absolutePositioned){var u=s.util.invertTransform(this.calcTransformMatrix());i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}l.transform(i),i.scale(1/l.zoomX,1/l.zoomY),i.drawImage(l._cacheCanvas,-l.cacheTranslationX,-l.cacheTranslationY),i.restore()},drawObject:function(i,l){var u=this.fill,d=this.stroke;l?(this.fill="black",this.stroke="",this._setClippingProperties(i)):this._renderBackground(i),this._render(i),this._drawClipPath(i,this.clipPath),this.fill=u,this.stroke=d},_drawClipPath:function(i,l){l&&(l.canvas=this.canvas,l.shouldCache(),l._transformDone=!0,l.renderCache({forClipping:!0}),this.drawClipPathOnCache(i,l))},drawCacheOnCanvas:function(i){i.scale(1/this.zoomX,1/this.zoomY),i.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(i){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!i&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!i){var l=this.cacheWidth/this.zoomX,u=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-l/2,-u/2,l,u)}return!0}return!1},_renderBackground:function(i){if(this.backgroundColor){var l=this._getNonTransformedDimensions();i.fillStyle=this.backgroundColor,i.fillRect(-l.x/2,-l.y/2,l.x,l.y),this._removeShadow(i)}},_setOpacity:function(i){this.group&&!this.group._transformDone?i.globalAlpha=this.getObjectOpacity():i.globalAlpha*=this.opacity},_setStrokeStyles:function(i,l){var u=l.stroke;u&&(i.lineWidth=l.strokeWidth,i.lineCap=l.strokeLineCap,i.lineDashOffset=l.strokeDashOffset,i.lineJoin=l.strokeLineJoin,i.miterLimit=l.strokeMiterLimit,u.toLive?u.gradientUnits==="percentage"||u.gradientTransform||u.patternTransform?this._applyPatternForTransformedGradient(i,u):(i.strokeStyle=u.toLive(i,this),this._applyPatternGradientTransform(i,u)):i.strokeStyle=l.stroke)},_setFillStyles:function(i,l){var u=l.fill;u&&(u.toLive?(i.fillStyle=u.toLive(i,this),this._applyPatternGradientTransform(i,l.fill)):i.fillStyle=u)},_setClippingProperties:function(i){i.globalAlpha=1,i.strokeStyle="transparent",i.fillStyle="#000000"},_setLineDash:function(i,l){!l||l.length===0||(1&l.length&&l.push.apply(l,l),i.setLineDash(l))},_renderControls:function(i,l){var u=this.getViewportTransform(),d=this.calcTransformMatrix(),g,p,v;l=l||{},p=typeof l.hasBorders<"u"?l.hasBorders:this.hasBorders,v=typeof l.hasControls<"u"?l.hasControls:this.hasControls,d=s.util.multiplyTransformMatrices(u,d),g=s.util.qrDecompose(d),i.save(),i.translate(g.translateX,g.translateY),i.lineWidth=1*this.borderScaleFactor,this.group||(i.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(g.angle-=180),i.rotate(t(this.group?g.angle:this.angle)),l.forActiveSelection||this.group?p&&this.drawBordersInGroup(i,g,l):p&&this.drawBorders(i,l),v&&this.drawControls(i,l),i.restore()},_setShadow:function(i){if(this.shadow){var l=this.shadow,u=this.canvas,d,g=u&&u.viewportTransform[0]||1,p=u&&u.viewportTransform[3]||1;l.nonScaling?d={scaleX:1,scaleY:1}:d=this.getObjectScaling(),u&&u._isRetinaScaling()&&(g*=s.devicePixelRatio,p*=s.devicePixelRatio),i.shadowColor=l.color,i.shadowBlur=l.blur*s.browserShadowBlurConstant*(g+p)*(d.scaleX+d.scaleY)/4,i.shadowOffsetX=l.offsetX*g*d.scaleX,i.shadowOffsetY=l.offsetY*p*d.scaleY}},_removeShadow:function(i){this.shadow&&(i.shadowColor="",i.shadowBlur=i.shadowOffsetX=i.shadowOffsetY=0)},_applyPatternGradientTransform:function(i,l){if(!l||!l.toLive)return{offsetX:0,offsetY:0};var u=l.gradientTransform||l.patternTransform,d=-this.width/2+l.offsetX||0,g=-this.height/2+l.offsetY||0;return l.gradientUnits==="percentage"?i.transform(this.width,0,0,this.height,d,g):i.transform(1,0,0,1,d,g),u&&i.transform(u[0],u[1],u[2],u[3],u[4],u[5]),{offsetX:d,offsetY:g}},_renderPaintInOrder:function(i){this.paintFirst==="stroke"?(this._renderStroke(i),this._renderFill(i)):(this._renderFill(i),this._renderStroke(i))},_render:function(){},_renderFill:function(i){this.fill&&(i.save(),this._setFillStyles(i,this),this.fillRule==="evenodd"?i.fill("evenodd"):i.fill(),i.restore())},_renderStroke:function(i){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(i),i.save(),this.strokeUniform&&this.group){var l=this.getObjectScaling();i.scale(1/l.scaleX,1/l.scaleY)}else this.strokeUniform&&i.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(i,this.strokeDashArray),this._setStrokeStyles(i,this),i.stroke(),i.restore()}},_applyPatternForTransformedGradient:function(i,l){var u=this._limitCacheSize(this._getCacheCanvasDimensions()),d=s.util.createCanvasElement(),g,p=this.canvas.getRetinaScaling(),v=u.x/this.scaleX/p,_=u.y/this.scaleY/p;d.width=v,d.height=_,g=d.getContext("2d"),g.beginPath(),g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,_),g.lineTo(0,_),g.closePath(),g.translate(v/2,_/2),g.scale(u.zoomX/this.scaleX/p,u.zoomY/this.scaleY/p),this._applyPatternGradientTransform(g,l),g.fillStyle=l.toLive(i),g.fill(),i.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),i.scale(p*this.scaleX/u.zoomX,p*this.scaleY/u.zoomY),i.strokeStyle=g.createPattern(d,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var i=s.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",i.scaleX),this.set("scaleY",i.scaleY),this.angle=i.angle,this.skewX=i.skewX,this.skewY=0}},_removeTransformMatrix:function(i){var l=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),l=s.util.transformPoint(l,this.transformMatrix)),this.transformMatrix=null,i&&(this.scaleX*=i.scaleX,this.scaleY*=i.scaleY,this.cropX=i.cropX,this.cropY=i.cropY,l.x+=i.offsetLeft,l.y+=i.offsetTop,this.width=i.width,this.height=i.height),this.setPositionByOrigin(l,"center","center")},clone:function(i,l){var u=this.toObject(l);this.constructor.fromObject?this.constructor.fromObject(u,i):s.Object._fromObject("Object",u,i)},cloneAsImage:function(i,l){var u=this.toCanvasElement(l);return i&&i(new s.Image(u)),this},toCanvasElement:function(i){i||(i={});var l=s.util,u=l.saveObjectTransform(this),d=this.group,g=this.shadow,p=Math.abs,v=(i.multiplier||1)*(i.enableRetinaScaling?s.devicePixelRatio:1);delete this.group,i.withoutTransform&&l.resetObjectTransform(this),i.withoutShadow&&(this.shadow=null);var _=s.util.createCanvasElement(),T=this.getBoundingRect(!0,!0),A=this.shadow,X,W={x:0,y:0},N,V,U;A&&(N=A.blur,A.nonScaling?X={scaleX:1,scaleY:1}:X=this.getObjectScaling(),W.x=2*Math.round(p(A.offsetX)+N)*p(X.scaleX),W.y=2*Math.round(p(A.offsetY)+N)*p(X.scaleY)),V=T.width+W.x,U=T.height+W.y,_.width=Math.ceil(V),_.height=Math.ceil(U);var G=new s.StaticCanvas(_,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});i.format==="jpeg"&&(G.backgroundColor="#fff"),this.setPositionByOrigin(new s.Point(G.width/2,G.height/2),"center","center");var q=this.canvas;G.add(this);var J=G.toCanvasElement(v||1,i);return this.shadow=g,this.set("canvas",q),d&&(this.group=d),this.set(u).setCoords(),G._objects=[],G.dispose(),G=null,J},toDataURL:function(i){return i||(i={}),s.util.toDataURL(this.toCanvasElement(i),i.format||"png",i.quality||1)},isType:function(i){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===i},complexity:function(){return 1},toJSON:function(i){return this.toObject(i)},rotate:function(i){var l=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return l&&this._setOriginToCenter(),this.set("angle",i),l&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(i,l){l=l||this.canvas.getPointer(i);var u=new s.Point(l.x,l.y),d=this._getLeftTopCoords();return this.angle&&(u=s.util.rotatePoint(u,d,t(-this.angle))),{x:u.x-d.x,y:u.y-d.y}},_setupCompositeOperation:function(i){this.globalCompositeOperation&&(i.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){s.runningAnimations&&s.runningAnimations.cancelByTarget(this)}}),s.util.createAccessors&&s.util.createAccessors(s.Object),h(s.Object.prototype,s.Observable),s.Object.NUM_FRACTION_DIGITS=2,s.Object.ENLIVEN_PROPS=["clipPath"],s.Object._fromObject=function(i,l,u,d){var g=s[i];l=o(l,!0),s.util.enlivenPatterns([l.fill,l.stroke],function(p){typeof p[0]<"u"&&(l.fill=p[0]),typeof p[1]<"u"&&(l.stroke=p[1]),s.util.enlivenObjectEnlivables(l,l,function(){var v=d?new g(l[d],l):new g(l);u&&u(v)})})},s.Object.__uid=0)}(Z),function(){var c=f.util.degreesToRadians,s={left:-.5,center:0,right:.5},h={top:-.5,center:0,bottom:.5};f.util.object.extend(f.Object.prototype,{translateToGivenOrigin:function(o,e,r,t,n){var a=o.x,i=o.y,l,u,d;return typeof e=="string"?e=s[e]:e-=.5,typeof t=="string"?t=s[t]:t-=.5,l=t-e,typeof r=="string"?r=h[r]:r-=.5,typeof n=="string"?n=h[n]:n-=.5,u=n-r,(l||u)&&(d=this._getTransformedDimensions(),a=o.x+l*d.x,i=o.y+u*d.y),new f.Point(a,i)},translateToCenterPoint:function(o,e,r){var t=this.translateToGivenOrigin(o,e,r,"center","center");return this.angle?f.util.rotatePoint(t,o,c(this.angle)):t},translateToOriginPoint:function(o,e,r){var t=this.translateToGivenOrigin(o,"center","center",e,r);return this.angle?f.util.rotatePoint(t,o,c(this.angle)):t},getCenterPoint:function(){var o=new f.Point(this.left,this.top);return this.translateToCenterPoint(o,this.originX,this.originY)},getPointByOrigin:function(o,e){var r=this.getCenterPoint();return this.translateToOriginPoint(r,o,e)},toLocalPoint:function(o,e,r){var t=this.getCenterPoint(),n,a;return typeof e<"u"&&typeof r<"u"?n=this.translateToGivenOrigin(t,"center","center",e,r):n=new f.Point(this.left,this.top),a=new f.Point(o.x,o.y),this.angle&&(a=f.util.rotatePoint(a,t,-c(this.angle))),a.subtractEquals(n)},setPositionByOrigin:function(o,e,r){var t=this.translateToCenterPoint(o,e,r),n=this.translateToOriginPoint(t,this.originX,this.originY);this.set("left",n.x),this.set("top",n.y)},adjustPosition:function(o){var e=c(this.angle),r=this.getScaledWidth(),t=f.util.cos(e)*r,n=f.util.sin(e)*r,a,i;typeof this.originX=="string"?a=s[this.originX]:a=this.originX-.5,typeof o=="string"?i=s[o]:i=o-.5,this.left+=t*(i-a),this.top+=n*(i-a),this.setCoords(),this.originX=o},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var o=this.getCenterPoint();this.originX="center",this.originY="center",this.left=o.x,this.top=o.y},_resetOrigin:function(){var o=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=o.x,this.top=o.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function c(r){return[new f.Point(r.tl.x,r.tl.y),new f.Point(r.tr.x,r.tr.y),new f.Point(r.br.x,r.br.y),new f.Point(r.bl.x,r.bl.y)]}var s=f.util,h=s.degreesToRadians,o=s.multiplyTransformMatrices,e=s.transformPoint;s.object.extend(f.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(r,t){return t?r?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),r?this.aCoords:this.lineCoords)},getCoords:function(r,t){return c(this._getCoords(r,t))},intersectsWithRect:function(r,t,n,a){var i=this.getCoords(n,a),l=f.Intersection.intersectPolygonRectangle(i,r,t);return l.status==="Intersection"},intersectsWithObject:function(r,t,n){var a=f.Intersection.intersectPolygonPolygon(this.getCoords(t,n),r.getCoords(t,n));return a.status==="Intersection"||r.isContainedWithinObject(this,t,n)||this.isContainedWithinObject(r,t,n)},isContainedWithinObject:function(r,t,n){for(var a=this.getCoords(t,n),i=t?r.aCoords:r.lineCoords,l=0,u=r._getImageLines(i);l<4;l++)if(!r.containsPoint(a[l],u))return!1;return!0},isContainedWithinRect:function(r,t,n,a){var i=this.getBoundingRect(n,a);return i.left>=r.x&&i.left+i.width<=t.x&&i.top>=r.y&&i.top+i.height<=t.y},containsPoint:function(r,l,n,a){var i=this._getCoords(n,a),l=l||this._getImageLines(i),u=this._findCrossPoints(r,l);return u!==0&&u%2===1},isOnScreen:function(r){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br,a=this.getCoords(!0,r);return a.some(function(i){return i.x<=n.x&&i.x>=t.x&&i.y<=n.y&&i.y>=t.y})||this.intersectsWithRect(t,n,!0,r)?!0:this._containsCenterOfCanvas(t,n,r)},_containsCenterOfCanvas:function(r,t,n){var a={x:(r.x+t.x)/2,y:(r.y+t.y)/2};return!!this.containsPoint(a,null,!0,n)},isPartiallyOnScreen:function(r){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;if(this.intersectsWithRect(t,n,!0,r))return!0;var a=this.getCoords(!0,r).every(function(i){return(i.x>=n.x||i.x<=t.x)&&(i.y>=n.y||i.y<=t.y)});return a&&this._containsCenterOfCanvas(t,n,r)},_getImageLines:function(r){var t={topline:{o:r.tl,d:r.tr},rightline:{o:r.tr,d:r.br},bottomline:{o:r.br,d:r.bl},leftline:{o:r.bl,d:r.tl}};return t},_findCrossPoints:function(r,t){var n,a,i,l,u,d=0,g;for(var p in t)if(g=t[p],!(g.o.y=r.y&&g.d.y>=r.y)&&(g.o.x===g.d.x&&g.o.x>=r.x?u=g.o.x:(n=0,a=(g.d.y-g.o.y)/(g.d.x-g.o.x),i=r.y-n*r.x,l=g.o.y-a*g.o.x,u=-(i-l)/(n-a)),u>=r.x&&(d+=1),d===2))break;return d},getBoundingRect:function(r,t){var n=this.getCoords(r,t);return s.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(r){return Math.abs(r)"u"&&(r=this.skewX),typeof t>"u"&&(t=this.skewY);var n,a,i,l=r===0&&t===0;if(this.strokeUniform?(a=this.width,i=this.height):(n=this._getNonTransformedDimensions(),a=n.x,i=n.y),l)return this._finalizeDimensions(a*this.scaleX,i*this.scaleY);var u=s.sizeAfterTransform(a,i,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:r,skewY:t});return this._finalizeDimensions(u.x,u.y)},_finalizeDimensions:function(r,t){return this.strokeUniform?{x:r+this.strokeWidth,y:t+this.strokeWidth}:{x:r,y:t}},_calculateCurrentDimensions:function(){var r=this.getViewportTransform(),t=this._getTransformedDimensions(),n=e(t,r,!0);return n.scalarAdd(2*this.padding)}})}(),f.util.object.extend(f.Object.prototype,{sendToBack:function(){return this.group?f.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?f.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(c){return this.group?f.StaticCanvas.prototype.sendBackwards.call(this.group,this,c):this.canvas&&this.canvas.sendBackwards(this,c),this},bringForward:function(c){return this.group?f.StaticCanvas.prototype.bringForward.call(this.group,this,c):this.canvas&&this.canvas.bringForward(this,c),this},moveTo:function(c){return this.group&&this.group.type!=="activeSelection"?f.StaticCanvas.prototype.moveTo.call(this.group,this,c):this.canvas&&this.canvas.moveTo(this,c),this}}),function(){function c(h,o){if(o){if(o.toLive)return h+": url(#SVGID_"+o.id+"); ";var e=new f.Color(o),r=h+": "+e.toRgb()+"; ",t=e.getAlpha();return t!==1&&(r+=h+"-opacity: "+t.toString()+"; "),r}else return h+": none; "}var s=f.util.toFixed;f.util.object.extend(f.Object.prototype,{getSvgStyles:function(h){var o=this.fillRule?this.fillRule:"nonzero",e=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",t=this.strokeDashOffset?this.strokeDashOffset:"0",n=this.strokeLineCap?this.strokeLineCap:"butt",a=this.strokeLineJoin?this.strokeLineJoin:"miter",i=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=typeof this.opacity<"u"?this.opacity:"1",u=this.visible?"":" visibility: hidden;",d=h?"":this.getSvgFilter(),g=c("fill",this.fill),p=c("stroke",this.stroke);return[p,"stroke-width: ",e,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",n,"; ","stroke-dashoffset: ",t,"; ","stroke-linejoin: ",a,"; ","stroke-miterlimit: ",i,"; ",g,"fill-rule: ",o,"; ","opacity: ",l,";",d,u].join("")},getSvgSpanStyles:function(h,o){var e="; ",t=h.fontFamily?"font-family: "+(h.fontFamily.indexOf("'")===-1&&h.fontFamily.indexOf('"')===-1?"'"+h.fontFamily+"'":h.fontFamily)+e:"",r=h.strokeWidth?"stroke-width: "+h.strokeWidth+e:"",t=t,n=h.fontSize?"font-size: "+h.fontSize+"px"+e:"",a=h.fontStyle?"font-style: "+h.fontStyle+e:"",i=h.fontWeight?"font-weight: "+h.fontWeight+e:"",l=h.fill?c("fill",h.fill):"",u=h.stroke?c("stroke",h.stroke):"",d=this.getSvgTextDecoration(h),g=h.deltaY?"baseline-shift: "+-h.deltaY+"; ":"";return d&&(d="text-decoration: "+d+e),[u,r,t,n,a,i,d,l,g,o?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(h){return["overline","underline","line-through"].filter(function(o){return h[o.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(h,o){var e=h?this.calcTransformMatrix():this.calcOwnMatrix(),r='transform="'+f.util.matrixToSVG(e);return r+(o||"")+'" '},_setSVGBg:function(h){if(this.backgroundColor){var o=f.Object.NUM_FRACTION_DIGITS;h.push(" +`)}},toSVG:function(h){return this._createBaseSVGMarkup(this._toSVG(h),{reviver:h})},toClipPathSVG:function(h){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(h),{reviver:h})},_createBaseClipPathSVGMarkup:function(h,o){o=o||{};var e=o.reviver,r=o.additionalTransform||"",t=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),n=h.indexOf("COMMON_PARTS");return h[n]=t,e?e(h.join("")):h.join("")},_createBaseSVGMarkup:function(h,o){o=o||{};var e=o.noStyle,r=o.reviver,t=e?"":'style="'+this.getSvgStyles()+'" ',n=o.withShadow?'style="'+this.getSvgFilter()+'" ':"",a=this.clipPath,i=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",l=a&&a.absolutePositioned,u=this.stroke,d=this.fill,g=this.shadow,p,v=[],_,T=h.indexOf("COMMON_PARTS"),A=o.additionalTransform;return a&&(a.clipPathId="CLIPPATH_"+f.Object.__uid++,_=' +`+a.toClipPathSVG(r)+` +`),l&&v.push(" +`),v.push(" +`),p=[t,i,e?"":this.addPaintOrder()," ",A?'transform="'+A+'" ':""].join(""),h[T]=p,d&&d.toLive&&v.push(d.toSVG(this)),u&&u.toLive&&v.push(u.toSVG(this)),g&&v.push(g.toSVG(this)),a&&v.push(_),v.push(h.join("")),v.push(` +`),l&&v.push(` +`),r?r(v.join("")):v.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var c=f.util.object.extend,s="stateProperties";function h(e,r,t){var n={},a=!0;t.forEach(function(i){n[i]=e[i]}),c(e[r],n,a)}function o(e,r,t){if(e===r)return!0;if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0,a=e.length;n=0;a--)if(i=n[a],!!this.isControlVisible(i)&&(t=this._getImageLines(h?this.oCoords[i].touchCorner:this.oCoords[i].corner),r=this._findCrossPoints({x:o,y:e},t),r!==0&&r%2===1))return this.__corner=i,i;return!1},forEachControl:function(s){for(var h in this.controls)s(this.controls[h],h,this)},_setCornerCoords:function(){var s=this.oCoords;for(var h in s){var o=this.controls[h];s[h].corner=o.calcCornerCoords(this.angle,this.cornerSize,s[h].x,s[h].y,!1),s[h].touchCorner=o.calcCornerCoords(this.angle,this.touchCornerSize,s[h].x,s[h].y,!0)}},drawSelectionBackground:function(s){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;s.save();var h=this.getCenterPoint(),o=this._calculateCurrentDimensions(),e=this.canvas.viewportTransform;return s.translate(h.x,h.y),s.scale(1/e[0],1/e[3]),s.rotate(c(this.angle)),s.fillStyle=this.selectionBackgroundColor,s.fillRect(-o.x/2,-o.y/2,o.x,o.y),s.restore(),this},drawBorders:function(s,h){h=h||{};var o=this._calculateCurrentDimensions(),e=this.borderScaleFactor,r=o.x+e,t=o.y+e,n=typeof h.hasControls<"u"?h.hasControls:this.hasControls,a=!1;return s.save(),s.strokeStyle=h.borderColor||this.borderColor,this._setLineDash(s,h.borderDashArray||this.borderDashArray),s.strokeRect(-r/2,-t/2,r,t),n&&(s.beginPath(),this.forEachControl(function(i,l,u){i.withConnection&&i.getVisibility(u,l)&&(a=!0,s.moveTo(i.x*r,i.y*t),s.lineTo(i.x*r+i.offsetX,i.y*t+i.offsetY))}),a&&s.stroke()),s.restore(),this},drawBordersInGroup:function(s,h,o){o=o||{};var e=f.util.sizeAfterTransform(this.width,this.height,h),r=this.strokeWidth,t=this.strokeUniform,n=this.borderScaleFactor,a=e.x+r*(t?this.canvas.getZoom():h.scaleX)+n,i=e.y+r*(t?this.canvas.getZoom():h.scaleY)+n;return s.save(),this._setLineDash(s,o.borderDashArray||this.borderDashArray),s.strokeStyle=o.borderColor||this.borderColor,s.strokeRect(-a/2,-i/2,a,i),s.restore(),this},drawControls:function(s,h){h=h||{},s.save();var o=this.canvas.getRetinaScaling(),e,r;return s.setTransform(o,0,0,o,0,0),s.strokeStyle=s.fillStyle=h.cornerColor||this.cornerColor,this.transparentCorners||(s.strokeStyle=h.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(s,h.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(e=this.group.calcTransformMatrix()),this.forEachControl(function(t,n,a){r=a.oCoords[n],t.getVisibility(a,n)&&(e&&(r=f.util.transformPoint(r,e)),t.render(s,r.x,r.y,h,a))}),s.restore(),this},isControlVisible:function(s){return this.controls[s]&&this.controls[s].getVisibility(this,s)},setControlVisible:function(s,h){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[s]=h,this},setControlsVisibility:function(s){s||(s={});for(var h in s)this.setControlVisible(h,s[h]);return this},onDeselect:function(){},onSelect:function(){}})}(),f.util.object.extend(f.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){c.set("left",t),r.requestRenderAll(),e()},onComplete:function(){c.setCoords(),o()}})},fxCenterObjectV:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){c.set("top",t),r.requestRenderAll(),e()},onComplete:function(){c.setCoords(),o()}})},fxRemove:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){c.set("opacity",t),r.requestRenderAll(),e()},onComplete:function(){r.remove(c),o()}})}}),f.util.object.extend(f.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var c=[],s,h,o=[];for(s in arguments[0])c.push(s);for(var e=0,r=c.length;e-1||r&&e.colorProperties.indexOf(r[1])>-1,n=r?this.get(r[0])[r[1]]:this.get(c);"from"in h||(h.from=n),t||(~s.indexOf("=")?s=n+parseFloat(s.replace("=","")):s=parseFloat(s));var a={target:this,startValue:h.from,endValue:s,byValue:h.by,easing:h.easing,duration:h.duration,abort:h.abort&&function(i,l,u){return h.abort.call(e,i,l,u)},onChange:function(i,l,u){r?e[r[0]][r[1]]=i:e.set(c,i),!o&&h.onChange&&h.onChange(i,l,u)},onComplete:function(i,l,u){o||(e.setCoords(),h.onComplete&&h.onComplete(i,l,u))}};return t?f.util.animateColor(a.startValue,a.endValue,a.duration,a):f.util.animate(a)}}),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.object.clone,e={x1:1,x2:1,y1:1,y2:1};if(s.Line){s.warn("fabric.Line is already defined");return}s.Line=s.util.createClass(s.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:s.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,n){t||(t=[0,0,0,0]),this.callSuper("initialize",n),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(n)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,n){return this.callSuper("_set",t,n),typeof e[t]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:r({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:r({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var n=this.calcLinePoints();t.moveTo(n.x1,n.y1),t.lineTo(n.x2,n.y2),t.lineWidth=this.strokeWidth;var a=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=a},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return h(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(t.y-=this.strokeWidth),this.height===0&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,n=this.y1<=this.y2?-1:1,a=t*this.width*.5,i=n*this.height*.5,l=t*this.width*-.5,u=n*this.height*-.5;return{x1:a,x2:l,y1:i,y2:u}},_toSVG:function(){var t=this.calcLinePoints();return[" +`]}}),s.Line.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),s.Line.fromElement=function(t,n,a){a=a||{};var i=s.parseAttributes(t,s.Line.ATTRIBUTE_NAMES),l=[i.x1||0,i.y1||0,i.x2||0,i.y2||0];n(new s.Line(l,h(i,a)))},s.Line.fromObject=function(t,n){function a(l){delete l.points,n&&n(l)}var i=o(t,!0);i.points=[t.x1,t.y1,t.x2,t.y2],s.Object._fromObject("Line",i,a,"points")};function r(t,n){var a=t.origin,i=t.axis1,l=t.axis2,u=t.dimension,d=n.nearest,g=n.center,p=n.farthest;return function(){switch(this.get(a)){case d:return Math.min(this.get(i),this.get(l));case g:return Math.min(this.get(i),this.get(l))+.5*this.get(u);case p:return Math.max(this.get(i),this.get(l))}}}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.degreesToRadians;if(s.Circle){s.warn("fabric.Circle is already defined.");return}s.Circle=s.util.createClass(s.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:s.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,r){return this.callSuper("_set",e,r),e==="radius"&&this.setRadius(r),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,r=0,t=0,n=(this.endAngle-this.startAngle)%360;if(n===0)e=[" +`];else{var a=h(this.startAngle),i=h(this.endAngle),l=this.radius,u=s.util.cos(a)*l,d=s.util.sin(a)*l,g=s.util.cos(i)*l,p=s.util.sin(i)*l,v=n>180?"1":"0";e=[' +`]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,h(this.startAngle),h(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",e*2).set("height",e*2)}}),s.Circle.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),s.Circle.fromElement=function(e,r){var t=s.parseAttributes(e,s.Circle.ATTRIBUTE_NAMES);if(!o(t))throw new Error("value of `r` attribute is required and can not be negative");t.left=(t.left||0)-t.radius,t.top=(t.top||0)-t.radius,r(new s.Circle(t))};function o(e){return"radius"in e&&e.radius>=0}s.Circle.fromObject=function(e,r){s.Object._fromObject("Circle",e,r)}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Triangle){s.warn("fabric.Triangle is already defined");return}s.Triangle=s.util.createClass(s.Object,{type:"triangle",width:100,height:100,_render:function(h){var o=this.width/2,e=this.height/2;h.beginPath(),h.moveTo(-o,e),h.lineTo(0,-e),h.lineTo(o,e),h.closePath(),this._renderPaintInOrder(h)},_toSVG:function(){var h=this.width/2,o=this.height/2,e=[-h+" "+o,"0 "+-o,h+" "+o].join(",");return["']}}),s.Triangle.fromObject=function(h,o){return s.Object._fromObject("Triangle",h,o)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=Math.PI*2;if(s.Ellipse){s.warn("fabric.Ellipse is already defined.");return}s.Ellipse=s.util.createClass(s.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(o){this.callSuper("initialize",o),this.set("rx",o&&o.rx||0),this.set("ry",o&&o.ry||0)},_set:function(o,e){switch(this.callSuper("_set",o,e),o){case"rx":this.rx=e,this.set("width",e*2);break;case"ry":this.ry=e,this.set("height",e*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(o){return this.callSuper("toObject",["rx","ry"].concat(o))},_toSVG:function(){return[" +`]},_render:function(o){o.beginPath(),o.save(),o.transform(1,0,0,this.ry/this.rx,0,0),o.arc(0,0,this.rx,0,h,!1),o.restore(),this._renderPaintInOrder(o)}}),s.Ellipse.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),s.Ellipse.fromElement=function(o,e){var r=s.parseAttributes(o,s.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,e(new s.Ellipse(r))},s.Ellipse.fromObject=function(o,e){s.Object._fromObject("Ellipse",o,e)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend;if(s.Rect){s.warn("fabric.Rect is already defined");return}s.Rect=s.util.createClass(s.Object,{stateProperties:s.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(o){this.callSuper("initialize",o),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(o){var e=this.rx?Math.min(this.rx,this.width/2):0,r=this.ry?Math.min(this.ry,this.height/2):0,t=this.width,n=this.height,a=-this.width/2,i=-this.height/2,l=e!==0||r!==0,u=1-.5522847498;o.beginPath(),o.moveTo(a+e,i),o.lineTo(a+t-e,i),l&&o.bezierCurveTo(a+t-u*e,i,a+t,i+u*r,a+t,i+r),o.lineTo(a+t,i+n-r),l&&o.bezierCurveTo(a+t,i+n-u*r,a+t-u*e,i+n,a+t-e,i+n),o.lineTo(a+e,i+n),l&&o.bezierCurveTo(a+u*e,i+n,a,i+n-u*r,a,i+n-r),o.lineTo(a,i+r),l&&o.bezierCurveTo(a,i+u*r,a+u*e,i,a+e,i),o.closePath(),this._renderPaintInOrder(o)},toObject:function(o){return this.callSuper("toObject",["rx","ry"].concat(o))},_toSVG:function(){var o=-this.width/2,e=-this.height/2;return[" +`]}}),s.Rect.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),s.Rect.fromElement=function(o,e,r){if(!o)return e(null);r=r||{};var t=s.parseAttributes(o,s.Rect.ATTRIBUTE_NAMES);t.left=t.left||0,t.top=t.top||0,t.height=t.height||0,t.width=t.width||0;var n=new s.Rect(h(r?s.util.object.clone(r):{},t));n.visible=n.visible&&n.width>0&&n.height>0,e(n)},s.Rect.fromObject=function(o,e){return s.Object._fromObject("Rect",o,e)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.array.min,e=s.util.array.max,r=s.util.toFixed,t=s.util.projectStrokeOnPoints;if(s.Polyline){s.warn("fabric.Polyline is already defined");return}s.Polyline=s.util.createClass(s.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:s.Object.prototype.cacheProperties.concat("points"),initialize:function(n,a){a=a||{},this.points=n||[],this.callSuper("initialize",a),this._setPositionDimensions(a)},_projectStrokeOnPoints:function(){return t(this.points,this,!0)},_setPositionDimensions:function(n){var a=this._calcDimensions(n),i,l=this.exactBoundingBox?this.strokeWidth:0;this.width=a.width-l,this.height=a.height-l,n.fromSVG||(i=this.translateToGivenOrigin({x:a.left-this.strokeWidth/2+l/2,y:a.top-this.strokeWidth/2+l/2},"left","top",this.originX,this.originY)),typeof n.left>"u"&&(this.left=n.fromSVG?a.left:i.x),typeof n.top>"u"&&(this.top=n.fromSVG?a.top:i.y),this.pathOffset={x:a.left+this.width/2+l/2,y:a.top+this.height/2+l/2}},_calcDimensions:function(){var n=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,a=o(n,"x")||0,i=o(n,"y")||0,l=e(n,"x")||0,u=e(n,"y")||0,d=l-a,g=u-i;return{left:a,top:i,width:d,height:g}},toObject:function(n){return h(this.callSuper("toObject",n),{points:this.points.concat()})},_toSVG:function(){for(var n=[],a=this.pathOffset.x,i=this.pathOffset.y,l=s.Object.NUM_FRACTION_DIGITS,u=0,d=this.points.length;u +`]},commonRender:function(n){var a,i=this.points.length,l=this.pathOffset.x,u=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;n.beginPath(),n.moveTo(this.points[0].x-l,this.points[0].y-u);for(var d=0;d"},toObject:function(n){return e(this.callSuper("toObject",n),{path:this.path.map(function(a){return a.slice()})})},toDatalessObject:function(n){var a=this.toObject(["sourcePath"].concat(n));return a.sourcePath&&delete a.path,a},_toSVG:function(){var n=s.util.joinPath(this.path);return[" +`]},_getOffsetTransform:function(){var n=s.Object.NUM_FRACTION_DIGITS;return" translate("+t(-this.pathOffset.x,n)+", "+t(-this.pathOffset.y,n)+")"},toClipPathSVG:function(n){var a=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:n,additionalTransform:a})},toSVG:function(n){var a=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:n,additionalTransform:a})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var n=[],a=[],i,l=0,u=0,d=0,g=0,p,v=0,_=this.path.length;v<_;++v){switch(i=this.path[v],i[0]){case"L":d=i[1],g=i[2],p=[];break;case"M":d=i[1],g=i[2],l=d,u=g,p=[];break;case"C":p=s.util.getBoundsOfCurve(d,g,i[1],i[2],i[3],i[4],i[5],i[6]),d=i[5],g=i[6];break;case"Q":p=s.util.getBoundsOfCurve(d,g,i[1],i[2],i[1],i[2],i[3],i[4]),d=i[3],g=i[4];break;case"z":case"Z":d=l,g=u;break}p.forEach(function(U){n.push(U.x),a.push(U.y)}),n.push(d),a.push(g)}var T=h(n)||0,A=h(a)||0,X=o(n)||0,W=o(a)||0,N=X-T,V=W-A;return{left:T,top:A,width:N,height:V}}}),s.Path.fromObject=function(n,a){if(typeof n.sourcePath=="string"){var i=n.sourcePath;s.loadSVGFromURL(i,function(l){var u=l[0];u.setOptions(n),n.clipPath?s.util.enlivenObjects([n.clipPath],function(d){u.clipPath=d[0],a&&a(u)}):a&&a(u)})}else s.Object._fromObject("Path",n,a,"path")},s.Path.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat(["d"]),s.Path.fromElement=function(n,a,i){var l=s.parseAttributes(n,s.Path.ATTRIBUTE_NAMES);l.fromSVG=!0,a(new s.Path(l.d,e(l,i)))}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.array.min,o=s.util.array.max;s.Group||(s.Group=s.util.createClass(s.Object,s.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,r,t){r=r||{},this._objects=[],t&&this.callSuper("initialize",r),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(t)this._updateObjectsACoords();else{var a=r&&r.centerPoint;r.originX!==void 0&&(this.originX=r.originX),r.originY!==void 0&&(this.originY=r.originY),a||this._calcBounds(),this._updateObjectsCoords(a),delete r.centerPoint,this.callSuper("initialize",r)}this.setCoords()},_updateObjectsACoords:function(){for(var e=!0,r=this._objects.length;r--;)this._objects[r].setCoords(e)},_updateObjectsCoords:function(e){for(var e=e||this.getCenterPoint(),r=this._objects.length;r--;)this._updateObjectCoords(this._objects[r],e)},_updateObjectCoords:function(e,r){var t=e.left,n=e.top,a=!0;e.set({left:t-r.x,top:n-r.y}),e.group=this,e.setCoords(a)},toString:function(){return"#"},addWithUpdate:function(e){var r=!!this.group;return this._restoreObjectsState(),s.util.resetObjectTransform(this),e&&(r&&s.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,r?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),s.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,r){var t=this._objects.length;if(this.useSetOnGroup)for(;t--;)this._objects[t].setOnGroup(e,r);if(e==="canvas")for(;t--;)this._objects[t]._set(e,r);s.Object.prototype._set.call(this,e,r)},toObject:function(e){var r=this.includeDefaultValues,t=this._objects.filter(function(a){return!a.excludeFromExport}).map(function(a){var i=a.includeDefaultValues;a.includeDefaultValues=r;var l=a.toObject(e);return a.includeDefaultValues=i,l}),n=s.Object.prototype.toObject.call(this,e);return n.objects=t,n},toDatalessObject:function(e){var r,t=this.sourcePath;if(t)r=t;else{var n=this.includeDefaultValues;r=this._objects.map(function(i){var l=i.includeDefaultValues;i.includeDefaultValues=n;var u=i.toDatalessObject(e);return i.includeDefaultValues=l,u})}var a=s.Object.prototype.toDatalessObject.call(this,e);return a.objects=r,a},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=s.Object.prototype.shouldCache.call(this);if(e){for(var r=0,t=this._objects.length;r +`],t=0,n=this._objects.length;t +`),r},getSvgStyles:function(){var e=typeof this.opacity<"u"&&this.opacity!==1?"opacity: "+this.opacity+";":"",r=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),r].join("")},toClipPathSVG:function(e){for(var r=[],t=0,n=this._objects.length;t"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(h,o,e){h.save(),h.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",h,o),e=e||{},typeof e.hasControls>"u"&&(e.hasControls=!1),e.forActiveSelection=!0;for(var r=0,t=this._objects.length;r +`,' +`,` +`),a=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(i='" image-rendering="optimizeSpeed'),o.push(" +`),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=[" +`],this.fill=u}return this.paintFirst!=="fill"?h=h.concat(e,o):h=h.concat(o,e),h},getSrc:function(h){var o=h?this._element:this._originalElement;return o?o.toDataURL?o.toDataURL():this.srcFromAttribute?o.getAttribute("src"):o.src:this.src||""},setSrc:function(h,o,e){return f.util.loadImage(h,function(r,t){this.setElement(r,e),this._setWidthHeight(),o&&o(this,t)},this,e&&e.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var h=this.resizeFilter,o=this.minimumScaleTrigger,e=this.getTotalObjectScaling(),r=e.scaleX,t=e.scaleY,n=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!h||r>o&&t>o){this._element=n,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=r,this._lastScaleY=t;return}f.filterBackend||(f.filterBackend=f.initFilterBackend());var a=f.util.createCanvasElement(),i=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=n.width,u=n.height;a.width=l,a.height=u,this._element=a,this._lastScaleX=h.scaleX=r,this._lastScaleY=h.scaleY=t,f.filterBackend.applyFilters([h],n,l,u,this._element,i),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height},applyFilters:function(h){if(h=h||this.filters||[],h=h.filter(function(n){return n&&!n.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),h.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var o=this._originalElement,e=o.naturalWidth||o.width,r=o.naturalHeight||o.height;if(this._element===this._originalElement){var t=f.util.createCanvasElement();t.width=e,t.height=r,this._element=t,this._filteredEl=t}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,e,r),this._lastScaleX=1,this._lastScaleY=1;return f.filterBackend||(f.filterBackend=f.initFilterBackend()),f.filterBackend.applyFilters(h,this._originalElement,e,r,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(h){f.util.setImageSmoothing(h,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(h),this._renderPaintInOrder(h)},drawCacheOnCanvas:function(h){f.util.setImageSmoothing(h,this.imageSmoothing),f.Object.prototype.drawCacheOnCanvas.call(this,h)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(h){var o=this._element;if(o){var e=this._filterScalingX,r=this._filterScalingY,t=this.width,n=this.height,a=Math.min,i=Math.max,l=i(this.cropX,0),u=i(this.cropY,0),d=o.naturalWidth||o.width,g=o.naturalHeight||o.height,p=l*e,v=u*r,_=a(t*e,d-p),T=a(n*r,g-v),A=-t/2,X=-n/2,W=a(t,d/e-l),N=a(n,g/r-u);o&&h.drawImage(o,p,v,_,T,A,X,W,N)}},_needsResize:function(){var h=this.getTotalObjectScaling();return h.scaleX!==this._lastScaleX||h.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(h,o){this.setElement(f.util.getById(h),o),f.util.addClass(this.getElement(),f.Image.CSS_CANVAS)},_initConfig:function(h){h||(h={}),this.setOptions(h),this._setWidthHeight(h)},_initFilters:function(h,o){h&&h.length?f.util.enlivenObjects(h,function(e){o&&o(e)},"fabric.Image.filters"):o&&o()},_setWidthHeight:function(h){h||(h={});var o=this.getElement();this.width=h.width||o.naturalWidth||o.width||0,this.height=h.height||o.naturalHeight||o.height||0},parsePreserveAspectRatioAttribute:function(){var h=f.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),o=this._element.width,e=this._element.height,r=1,t=1,n=0,a=0,i=0,l=0,u,d=this.width,g=this.height,p={width:d,height:g};return h&&(h.alignX!=="none"||h.alignY!=="none")?(h.meetOrSlice==="meet"&&(r=t=f.util.findScaleToFit(this._element,p),u=(d-o*r)/2,h.alignX==="Min"&&(n=-u),h.alignX==="Max"&&(n=u),u=(g-e*t)/2,h.alignY==="Min"&&(a=-u),h.alignY==="Max"&&(a=u)),h.meetOrSlice==="slice"&&(r=t=f.util.findScaleToCover(this._element,p),u=o-d/r,h.alignX==="Mid"&&(i=u/2),h.alignX==="Max"&&(i=u),u=e-g/t,h.alignY==="Mid"&&(l=u/2),h.alignY==="Max"&&(l=u),o=d/r,e=g/t)):(r=d/o,t=g/e),{width:o,height:e,scaleX:r,scaleY:t,offsetLeft:n,offsetTop:a,cropX:i,cropY:l}}}),f.Image.CSS_CANVAS="canvas-img",f.Image.prototype.getSvgSrc=f.Image.prototype.getSrc,f.Image.fromObject=function(h,o){var e=f.util.object.clone(h);f.util.loadImage(e.src,function(r,t){if(t){o&&o(null,!0);return}f.Image.prototype._initFilters.call(e,e.filters,function(n){e.filters=n||[],f.Image.prototype._initFilters.call(e,[e.resizeFilter],function(a){e.resizeFilter=a[0],f.util.enlivenObjectEnlivables(e,e,function(){var i=new f.Image(r,e);o(i,!1)})})})},null,e.crossOrigin)},f.Image.fromURL=function(h,o,e){f.util.loadImage(h,function(r,t){o&&o(new f.Image(r,e),t)},null,e&&e.crossOrigin)},f.Image.ATTRIBUTE_NAMES=f.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),f.Image.fromElement=function(h,o,e){var r=f.parseAttributes(h,f.Image.ATTRIBUTE_NAMES);f.Image.fromURL(r["xlink:href"],o,s(e?f.util.object.clone(e):{},r))}}(Z),f.util.object.extend(f.Object.prototype,{_getAngleValueForStraighten:function(){var c=this.angle%360;return c>0?Math.round((c-1)/90)*90:Math.round(c/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(c){c=c||{};var s=function(){},h=c.onComplete||s,o=c.onChange||s,e=this;return f.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(r){e.rotate(r),o()},onComplete:function(){e.setCoords(),h()}})}}),f.util.object.extend(f.StaticCanvas.prototype,{straightenObject:function(c){return c.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(c){return c.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function c(h,o){var e="precision "+o+` float; +void main(){}`,r=h.createShader(h.FRAGMENT_SHADER);return h.shaderSource(r,e),h.compileShader(r),!!h.getShaderParameter(r,h.COMPILE_STATUS)}f.isWebglSupported=function(h){if(f.isLikelyNode)return!1;h=h||f.WebglFilterBackend.prototype.tileSize;var o=document.createElement("canvas"),e=o.getContext("webgl")||o.getContext("experimental-webgl"),r=!1;if(e){f.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),r=f.maxTextureSize>=h;for(var t=["highp","mediump","lowp"],n=0;n<3;n++)if(c(e,t[n])){f.webGlPrecision=t[n];break}}return this.isSupported=r,r},f.WebglFilterBackend=s;function s(h){h&&h.tileSize&&(this.tileSize=h.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}s.prototype={tileSize:2048,resources:{},setupGLContext:function(h,o){this.dispose(),this.createWebGLCanvas(h,o),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(h,o)},chooseFastestCopyGLTo2DMethod:function(h,o){var e=typeof window.performance<"u",r;try{new ImageData(1,1),r=!0}catch{r=!1}var t=typeof ArrayBuffer<"u",n=typeof Uint8ClampedArray<"u";if(e&&r&&t&&n){var a=f.util.createCanvasElement(),i=new ArrayBuffer(h*o*4);if(f.forceGLPutImageData){this.imageBuffer=i,this.copyGLTo2D=gt;return}var l={imageBuffer:i,destinationWidth:h,destinationHeight:o,targetCanvas:a},u,d,g;a.width=h,a.height=o,u=window.performance.now(),ct.call(l,this.gl,l),d=window.performance.now()-u,u=window.performance.now(),gt.call(l,this.gl,l),g=window.performance.now()-u,d>g?(this.imageBuffer=i,this.copyGLTo2D=gt):this.copyGLTo2D=ct}},createWebGLCanvas:function(h,o){var e=f.util.createCanvasElement();e.width=h,e.height=o;var r={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},t=e.getContext("webgl",r);t||(t=e.getContext("experimental-webgl",r)),t&&(t.clearColor(0,0,0,0),this.canvas=e,this.gl=t)},applyFilters:function(h,o,e,r,t,n){var a=this.gl,i;n&&(i=this.getCachedTexture(n,o));var l={originalWidth:o.width||o.originalWidth,originalHeight:o.height||o.originalHeight,sourceWidth:e,sourceHeight:r,destinationWidth:e,destinationHeight:r,context:a,sourceTexture:this.createTexture(a,e,r,!i&&o),targetTexture:this.createTexture(a,e,r),originalTexture:i||this.createTexture(a,e,r,!i&&o),passes:h.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:t},u=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,u),h.forEach(function(d){d&&d.applyTo(l)}),lt(l),this.copyGLTo2D(a,l),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(l.sourceTexture),a.deleteTexture(l.targetTexture),a.deleteFramebuffer(u),t.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(h,o,e,r,t){var n=h.createTexture();return h.bindTexture(h.TEXTURE_2D,n),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t||h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,t||h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),r?h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,r):h.texImage2D(h.TEXTURE_2D,0,h.RGBA,o,e,0,h.RGBA,h.UNSIGNED_BYTE,null),n},getCachedTexture:function(h,o){if(this.textureCache[h])return this.textureCache[h];var e=this.createTexture(this.gl,o.width,o.height,o);return this.textureCache[h]=e,e},evictCachesForKey:function(h){this.textureCache[h]&&(this.gl.deleteTexture(this.textureCache[h]),delete this.textureCache[h])},copyGLTo2D:ct,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var h=this.gl,o={renderer:"",vendor:""};if(!h)return o;var e=h.getExtension("WEBGL_debug_renderer_info");if(e){var r=h.getParameter(e.UNMASKED_RENDERER_WEBGL),t=h.getParameter(e.UNMASKED_VENDOR_WEBGL);r&&(o.renderer=r.toLowerCase()),t&&(o.vendor=t.toLowerCase())}return this.gpuInfo=o,o}}}();function lt(c){var s=c.targetCanvas,h=s.width,o=s.height,e=c.destinationWidth,r=c.destinationHeight;(h!==e||o!==r)&&(s.width=e,s.height=r)}function ct(c,s){var h=c.canvas,o=s.targetCanvas,e=o.getContext("2d");e.translate(0,o.height),e.scale(1,-1);var r=h.height-o.height;e.drawImage(h,0,r,o.width,o.height,0,0,o.width,o.height)}function gt(c,s){var h=s.targetCanvas,o=h.getContext("2d"),e=s.destinationWidth,r=s.destinationHeight,t=e*r*4,n=new Uint8Array(this.imageBuffer,0,t),a=new Uint8ClampedArray(this.imageBuffer,0,t);c.readPixels(0,0,e,r,c.RGBA,c.UNSIGNED_BYTE,n);var i=new ImageData(a,e,r);o.putImageData(i,0,0)}(function(){var c=function(){};f.Canvas2dFilterBackend=s;function s(){}s.prototype={evictCachesForKey:c,dispose:c,clearWebGLCaches:c,resources:{},applyFilters:function(h,o,e,r,t){var n=t.getContext("2d");n.drawImage(o,0,0,e,r);var a=n.getImageData(0,0,e,r),i=n.getImageData(0,0,e,r),l={sourceWidth:e,sourceHeight:r,imageData:a,originalEl:o,originalImageData:i,canvasEl:t,ctx:n,filterBackend:this};return h.forEach(function(u){u.applyTo(l)}),(l.imageData.width!==e||l.imageData.height!==r)&&(t.width=l.imageData.width,t.height=l.imageData.height),n.putImageData(l.imageData,0,0),l}}})(),f.Image=f.Image||{},f.Image.filters=f.Image.filters||{},f.Image.filters.BaseFilter=f.util.createClass({type:"BaseFilter",vertexSource:`attribute vec2 aPosition; +varying vec2 vTexCoord; +void main() { +vTexCoord = aPosition; +gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0); +}`,fragmentSource:`precision highp float; +varying vec2 vTexCoord; +uniform sampler2D uTexture; +void main() { +gl_FragColor = texture2D(uTexture, vTexCoord); +}`,initialize:function(c){c&&this.setOptions(c)},setOptions:function(c){for(var s in c)this[s]=c[s]},createProgram:function(c,s,h){s=s||this.fragmentSource,h=h||this.vertexSource,f.webGlPrecision!=="highp"&&(s=s.replace(/precision highp float/g,"precision "+f.webGlPrecision+" float"));var o=c.createShader(c.VERTEX_SHADER);if(c.shaderSource(o,h),c.compileShader(o),!c.getShaderParameter(o,c.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+c.getShaderInfoLog(o));var e=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(e,s),c.compileShader(e),!c.getShaderParameter(e,c.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+c.getShaderInfoLog(e));var r=c.createProgram();if(c.attachShader(r,o),c.attachShader(r,e),c.linkProgram(r),!c.getProgramParameter(r,c.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+c.getProgramInfoLog(r));var t=this.getAttributeLocations(c,r),n=this.getUniformLocations(c,r)||{};return n.uStepW=c.getUniformLocation(r,"uStepW"),n.uStepH=c.getUniformLocation(r,"uStepH"),{program:r,attributeLocations:t,uniformLocations:n}},getAttributeLocations:function(c,s){return{aPosition:c.getAttribLocation(s,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(c,s,h){var o=s.aPosition,e=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,e),c.enableVertexAttribArray(o),c.vertexAttribPointer(o,2,c.FLOAT,!1,0,0),c.bufferData(c.ARRAY_BUFFER,h,c.STATIC_DRAW)},_setupFrameBuffer:function(c){var s=c.context,h,o;c.passes>1?(h=c.destinationWidth,o=c.destinationHeight,(c.sourceWidth!==h||c.sourceHeight!==o)&&(s.deleteTexture(c.targetTexture),c.targetTexture=c.filterBackend.createTexture(s,h,o)),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,c.targetTexture,0)):(s.bindFramebuffer(s.FRAMEBUFFER,null),s.finish())},_swapTextures:function(c){c.passes--,c.pass++;var s=c.targetTexture;c.targetTexture=c.sourceTexture,c.sourceTexture=s},isNeutralState:function(){var c=this.mainParameter,s=f.Image.filters[this.type].prototype;if(c)if(Array.isArray(s[c])){for(var h=s[c].length;h--;)if(this[c][h]!==s[c][h])return!1;return!0}else return s[c]===this[c];else return!1},applyTo:function(c){c.webgl?(this._setupFrameBuffer(c),this.applyToWebGL(c),this._swapTextures(c)):this.applyTo2d(c)},retrieveShader:function(c){return c.programCache.hasOwnProperty(this.type)||(c.programCache[this.type]=this.createProgram(c.context)),c.programCache[this.type]},applyToWebGL:function(c){var s=c.context,h=this.retrieveShader(c);c.pass===0&&c.originalTexture?s.bindTexture(s.TEXTURE_2D,c.originalTexture):s.bindTexture(s.TEXTURE_2D,c.sourceTexture),s.useProgram(h.program),this.sendAttributeData(s,h.attributeLocations,c.aPosition),s.uniform1f(h.uniformLocations.uStepW,1/c.sourceWidth),s.uniform1f(h.uniformLocations.uStepH,1/c.sourceHeight),this.sendUniformData(s,h.uniformLocations),s.viewport(0,0,c.destinationWidth,c.destinationHeight),s.drawArrays(s.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(c,s,h){c.activeTexture(h),c.bindTexture(c.TEXTURE_2D,s),c.activeTexture(c.TEXTURE0)},unbindAdditionalTexture:function(c,s){c.activeTexture(s),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(c){this[this.mainParameter]=c},sendUniformData:function(){},createHelpLayer:function(c){if(!c.helpLayer){var s=document.createElement("canvas");s.width=c.sourceWidth,s.height=c.sourceHeight,c.helpLayer=s}},toObject:function(){var c={type:this.type},s=this.mainParameter;return s&&(c[s]=this[s]),c},toJSON:function(){return this.toObject()}}),f.Image.filters.BaseFilter.fromObject=function(c,s){var h=new f.Image.filters[c.type](c);return s&&s(h),h},function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.ColorMatrix=o(h.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float; +uniform sampler2D uTexture; +varying vec2 vTexCoord; +uniform mat4 uColorMatrix; +uniform vec4 uConstants; +void main() { +vec4 color = texture2D(uTexture, vTexCoord); +color *= uColorMatrix; +color += uConstants; +gl_FragColor = color; +}`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var r=e.imageData,t=r.data,n=t.length,a=this.matrix,i,l,u,d,g,p=this.colorsOnly;for(g=0;g=d||N<0||N>=u)&&(U=(V*u+N)*4,G=a[m*i+K],_+=n[U]*G,T+=n[U+1]*G,A+=n[U+2]*G,v||(X+=n[U+3]*G));p[W]=_,p[W+1]=T,p[W+2]=A,v?p[W+3]=n[W+3]:p[W+3]=X}r.imageData=g},getUniformLocations:function(r,t){return{uMatrix:r.getUniformLocation(t,"uMatrix"),uOpaque:r.getUniformLocation(t,"uOpaque"),uHalfSize:r.getUniformLocation(t,"uHalfSize"),uSize:r.getUniformLocation(t,"uSize")}},sendUniformData:function(r,t){r.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return h(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),s.Image.filters.Convolute.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Grayscale=o(h.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float; +uniform sampler2D uTexture; +varying vec2 vTexCoord; +void main() { +vec4 color = texture2D(uTexture, vTexCoord); +float average = (color.r + color.b + color.g) / 3.0; +gl_FragColor = vec4(average, average, average, color.a); +}`,lightness:`precision highp float; +uniform sampler2D uTexture; +uniform int uMode; +varying vec2 vTexCoord; +void main() { +vec4 col = texture2D(uTexture, vTexCoord); +float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0; +gl_FragColor = vec4(average, average, average, col.a); +}`,luminosity:`precision highp float; +uniform sampler2D uTexture; +uniform int uMode; +varying vec2 vTexCoord; +void main() { +vec4 col = texture2D(uTexture, vTexCoord); +float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b; +gl_FragColor = vec4(average, average, average, col.a); +}`},mode:"average",mainParameter:"mode",applyTo2d:function(e){var r=e.imageData,t=r.data,n,a=t.length,i,l=this.mode;for(n=0;np[0]&&u>p[1]&&d>p[2]&&l 0.0) { +`+this.fragmentSource[e]+`} +}`},retrieveShader:function(e){var r=this.type+"_"+this.mode,t;return e.programCache.hasOwnProperty(r)||(t=this.buildSource(this.mode),e.programCache[r]=this.createProgram(e.context,t)),e.programCache[r]},applyTo2d:function(e){var r=e.imageData,t=r.data,n=t.length,a,i,l,u,d,g,p,v=1-this.alpha;p=new s.Color(this.color).getSource(),a=p[0]*this.alpha,i=p[1]*this.alpha,l=p[2]*this.alpha;for(var _=0;_=u||d<=-u)return 0;if(d<11920929e-14&&d>-11920929e-14)return 1;d*=Math.PI;var g=d/u;return n(d)/d*n(g)/g}},applyTo2d:function(u){var d=u.imageData,g=this.scaleX,p=this.scaleY;this.rcpScaleX=1/g,this.rcpScaleY=1/p;var v=d.width,_=d.height,T=t(v*g),A=t(_*p),X;this.resizeType==="sliceHack"?X=this.sliceByTwo(u,v,_,T,A):this.resizeType==="hermite"?X=this.hermiteFastResize(u,v,_,T,A):this.resizeType==="bilinear"?X=this.bilinearFiltering(u,v,_,T,A):this.resizeType==="lanczos"&&(X=this.lanczosResize(u,v,_,T,A)),u.imageData=X},sliceByTwo:function(u,d,g,p,v){var _=u.imageData,T=.5,A=!1,X=!1,W=d*T,N=g*T,V=s.filterBackend.resources,U,G,q=0,J=0,K=d,m=0;for(V.sliceByTwo||(V.sliceByTwo=document.createElement("canvas")),U=V.sliceByTwo,(U.width=d)){Y=o(1e3*r(P-m.x)),K[Y]||(K[Y]={});for(var j=C.y-J;j<=C.y+J;j++)j<0||j>=g||(z=o(1e3*r(j-m.y)),K[Y][z]||(K[Y][z]=W(e(h(Y*U,2)+h(z*G,2))/1e3)),x=K[Y][z],x>0&&(y=(j*d+P)*4,w+=x,k+=x*T[y],M+=x*T[y+1],E+=x*T[y+2],R+=x*T[y+3]))}y=(b*p+S)*4,X[y]=k/w,X[y+1]=M/w,X[y+2]=E/w,X[y+3]=R/w}return++S1&&z<-1||(K=2*z*z*z-3*z*z+1,K>0&&(Y=4*(R+w*d),x+=K*N[Y+3],C+=K,N[Y+3]<255&&(K=K*N[Y+3]/250),S+=K*N[Y],b+=K*N[Y+1],P+=K*N[Y+2],m+=K))}U[J]=S/m,U[J+1]=b/m,U[J+2]=P/m,U[J+3]=x/C}return V},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),s.Image.filters.Resize.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Contrast=o(h.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float; +uniform sampler2D uTexture; +uniform float uContrast; +varying vec2 vTexCoord; +void main() { +vec4 color = texture2D(uTexture, vTexCoord); +float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast)); +color.rgb = contrastF * (color.rgb - 0.5) + 0.5; +gl_FragColor = color; +}`,contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(this.contrast!==0){var r=e.imageData,t,a,n=r.data,a=n.length,i=Math.floor(this.contrast*255),l=259*(i+255)/(255*(259-i));for(t=0;t1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?r[0]=t:r[1]=t,r}}),h.Blur.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Gamma=o(h.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float; +uniform sampler2D uTexture; +uniform vec3 uGamma; +varying vec2 vTexCoord; +void main() { +vec4 color = texture2D(uTexture, vTexCoord); +vec3 correction = (1.0 / uGamma); +color.r = pow(color.r, correction.r); +color.g = pow(color.g, correction.g); +color.b = pow(color.b, correction.b); +gl_FragColor = color; +gl_FragColor.rgb *= color.a; +}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],h.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var r=e.imageData,t=r.data,n=this.gamma,a=t.length,i=1/n[0],l=1/n[1],u=1/n[2],d;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),d=0,a=256;d'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),r=this.fontSize;return e.width+=r*e.zoomX,e.height+=r*e.zoomY,e},_render:function(e){var r=this.path;r&&!r.isNotVisible()&&r._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){this.paintFirst==="stroke"?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,r,t){if(e.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":e.textBaseline="middle";break;case"ascender":e.textBaseline="top";break;case"descender":e.textBaseline="bottom";break}e.font=this._getFontDeclaration(r,t)},calcTextWidth:function(){for(var e=this.getLineWidth(0),r=1,t=this._textLines.length;re&&(e=n)}return e},_renderTextLine:function(e,r,t,n,a,i){this._renderChars(e,r,t,n,a,i)},_renderTextLinesBackground:function(e){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var r,t,n=e.fillStyle,a,i,l=this._getLeftOffset(),u=this._getTopOffset(),d=0,g=0,p,v,_=this.path,T,A=0,X=this._textLines.length;A=0:tv?g%=v:g<0&&(g+=v),this._setGraphemeOnPath(g,l,p),g+=l.kernedWidth}return{width:r,numOfSpaces:u}},_setGraphemeOnPath:function(e,r,t){var n=e+r.kernedWidth/2,a=this.path,i=s.util.getPointOnPath(a.path,n,a.segmentsInfo);r.renderLeft=i.x-t.x,r.renderTop=i.y-t.y,r.angle=i.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(e,r,t,n,a){var i=this.getCompleteStyleDeclaration(r,t),l=n?this.getCompleteStyleDeclaration(r,t-1):{},u=this._measureChar(e,i,n,l),d=u.kernedWidth,g=u.width,p;this.charSpacing!==0&&(p=this._getWidthOfCharSpacing(),g+=p,d+=p);var v={width:g,left:0,height:i.fontSize,kernedWidth:d,deltaY:i.deltaY};if(t>0&&!a){var _=this.__charBounds[r][t-1];v.left=_.left+_.width+u.kernedWidth-u.width}return v},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var r=this._textLines[e],t=this.getHeightOfChar(e,0),n=1,a=r.length;n0){var b=p+i+T;this.direction==="rtl"&&(b=this.width-b-A),g&&U&&(e.fillStyle=U,e.fillRect(b,_+J*n+l,A,this.fontSize/15)),T=X.left,A=X.width,g=W,U=V,n=a,l=u}else A+=X.kernedWidth;var b=p+i+T;this.direction==="rtl"&&(b=this.width-b-A),e.fillStyle=V,W&&V&&e.fillRect(b,_+J*n+l,A-q,this.fontSize/15),v+=t}this._removeShadow(e)}},_getFontDeclaration:function(e,r){var t=e||this,n=this.fontFamily,a=s.Text.genericFonts.indexOf(n.toLowerCase())>-1,i=n===void 0||n.indexOf("'")>-1||n.indexOf(",")>-1||n.indexOf('"')>-1||a?t.fontFamily:'"'+t.fontFamily+'"';return[s.isLikelyNode?t.fontWeight:t.fontStyle,s.isLikelyNode?t.fontStyle:t.fontWeight,r?this.CACHE_FONT_SIZE+"px":t.fontSize+"px",i].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var r=e.split(this._reNewline),t=new Array(r.length),n=[` +`],a=[],i=0;i"u"?this.styles:{line:this.styles[c]};for(var h in s)for(var o in s[h])for(var e in s[h][o])return!1;return!0},styleHas:function(c,s){if(!this.styles||!c||c===""||typeof s<"u"&&!this.styles[s])return!1;var h=typeof s>"u"?this.styles:{0:this.styles[s]};for(var o in h)for(var e in h[o])if(typeof h[o][e][c]<"u")return!0;return!1},cleanStyle:function(c){if(!this.styles||!c||c==="")return!1;var s=this.styles,h=0,o,e,r=!0,t=0,n;for(var a in s){o=0;for(var i in s[a]){var n=s[a][i],l=n.hasOwnProperty(c);h++,l?(e?n[c]!==e&&(r=!1):e=n[c],n[c]===this[c]&&delete n[c]):r=!1,Object.keys(n).length!==0?o++:delete s[a][i]}o===0&&delete s[a]}for(var u=0;u"u"&&(c=this.selectionStart);for(var h=s?this._unwrappedTextLines:this._textLines,o=h.length,e=0;e"u"&&(c=this.selectionStart||0),typeof s>"u"&&(s=this.selectionEnd||c);for(var o=[],e=c;e"u"&&(s=this.selectionStart||0),typeof h>"u"&&(h=this.selectionEnd||s);for(var o=s;o"u"?this[e]:h[e];return o},_setStyleDeclaration:function(c,s,h){this.styles[c][s]=h},_deleteStyleDeclaration:function(c,s){delete this.styles[c][s]},_getLineStyle:function(c){return!!this.styles[c]},_setLineStyle:function(c){this.styles[c]={}},_deleteLineStyle:function(c){delete this.styles[c]}})}(),function(){function c(s){s.textDecoration&&(s.textDecoration.indexOf("underline")>-1&&(s.underline=!0),s.textDecoration.indexOf("line-through")>-1&&(s.linethrough=!0),s.textDecoration.indexOf("overline")>-1&&(s.overline=!0),delete s.textDecoration)}f.IText=f.util.createClass(f.Text,f.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(s,h){this.callSuper("initialize",s,h),this.initBehavior()},setSelectionStart:function(s){s=Math.max(s,0),this._updateAndFire("selectionStart",s)},setSelectionEnd:function(s){s=Math.min(s,this.text.length),this._updateAndFire("selectionEnd",s)},_updateAndFire:function(s,h){this[s]!==h&&(this._fireSelectionChanged(),this[s]=h),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(s){this.clearContextTop(),this.callSuper("render",s),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(s){this.callSuper("_render",s)},clearContextTop:function(s){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var h=this.canvas.contextTop,o=this.canvas.viewportTransform;h.save(),h.transform(o[0],o[1],o[2],o[3],o[4],o[5]),this.transform(h),this._clearTextArea(h),s||h.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var s=this._getCursorBoundaries(),h=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(s,h):this.renderSelection(s,h),h.restore()}},_clearTextArea:function(s){var h=this.width+4,o=this.height+4;s.clearRect(-h/2,-o/2,h,o)},_getCursorBoundaries:function(s){typeof s>"u"&&(s=this.selectionStart);var h=this._getLeftOffset(),o=this._getTopOffset(),e=this._getCursorBoundariesOffsets(s);return{left:h,top:o,leftOffset:e.left,topOffset:e.top}},_getCursorBoundariesOffsets:function(s){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var h,o,e,r=0,t=0,n,a=this.get2DCursorLocation(s);e=a.charIndex,o=a.lineIndex;for(var i=0;i0?t:0)},this.direction==="rtl"&&(n.left*=-1),this.cursorOffsetCache=n,this.cursorOffsetCache},renderCursor:function(s,h){var o=this.get2DCursorLocation(),e=o.lineIndex,r=o.charIndex>0?o.charIndex-1:0,t=this.getValueOfPropertyAt(e,r,"fontSize"),n=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/n,i=s.topOffset,l=this.getValueOfPropertyAt(e,r,"deltaY");i+=(1-this._fontSizeFraction)*this.getHeightOfLine(e)/this.lineHeight-t*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(s,h),h.fillStyle=this.cursorColor||this.getValueOfPropertyAt(e,r,"fill"),h.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,h.fillRect(s.left+s.leftOffset-a/2,i+s.top+l,a,t)},renderSelection:function(s,h){for(var o=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,e=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=this.textAlign.indexOf("justify")!==-1,t=this.get2DCursorLocation(o),n=this.get2DCursorLocation(e),a=t.lineIndex,i=n.lineIndex,l=t.charIndex<0?0:t.charIndex,u=n.charIndex<0?0:n.charIndex,d=a;d<=i;d++){var g=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),v=0,_=0,T=0;if(d===a&&(_=this.__charBounds[a][l].left),d>=a&&d1)&&(p/=this.lineHeight);var X=s.left+g+_,W=T-_,N=p,V=0;this.inCompositionMode?(h.fillStyle=this.compositionColor||"black",N=1,V=p):h.fillStyle=this.selectionColor,this.direction==="rtl"&&(X=this.width-X-W),h.fillRect(X,s.top+s.topOffset+V,W,N),s.topOffset+=v}},getCurrentCharFontSize:function(){var s=this._getCurrentCharIndex();return this.getValueOfPropertyAt(s.l,s.c,"fontSize")},getCurrentCharColor:function(){var s=this._getCurrentCharIndex();return this.getValueOfPropertyAt(s.l,s.c,"fill")},_getCurrentCharIndex:function(){var s=this.get2DCursorLocation(this.selectionStart,!0),h=s.charIndex>0?s.charIndex-1:0;return{l:s.lineIndex,c:h}}}),f.IText.fromObject=function(s,h){var o=f.util.stylesFromArray(s.styles,s.text),e=Object.assign({},s,{styles:o});if(c(e),e.styles)for(var r in e.styles)for(var t in e.styles[r])c(e.styles[r][t]);f.Object._fromObject("IText",e,h,"text")}}(),function(){var c=f.util.object.clone;f.util.object.extend(f.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var s=this;this.on("added",function(){var h=s.canvas;h&&(h._hasITextHandlers||(h._hasITextHandlers=!0,s._initCanvasHandlers(h)),h._iTextInstances=h._iTextInstances||[],h._iTextInstances.push(s))})},initRemovedHandler:function(){var s=this;this.on("removed",function(){var h=s.canvas;h&&(h._iTextInstances=h._iTextInstances||[],f.util.removeFromArray(h._iTextInstances,s),h._iTextInstances.length===0&&(h._hasITextHandlers=!1,s._removeCanvasHandlers(h)))})},_initCanvasHandlers:function(s){s._mouseUpITextHandler=function(){s._iTextInstances&&s._iTextInstances.forEach(function(h){h.__isMousedown=!1})},s.on("mouse:up",s._mouseUpITextHandler)},_removeCanvasHandlers:function(s){s.off("mouse:up",s._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(s,h,o,e){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},s.animate("_currentCursorOpacity",h,{duration:o,onComplete:function(){r.isAborted||s[e]()},onChange:function(){s.canvas&&s.selectionStart===s.selectionEnd&&s.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var s=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){s._currentTickCompleteState=s._animateCursor(s,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(s){var h=this,o=s?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){h._tick()},o)},abortCursorAnimation:function(){var s=this._currentTickState||this._currentTickCompleteState,h=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,s&&h&&h.clearContext(h.contextTop||h.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(s){var h=0,o=s-1;if(this._reSpace.test(this._text[o]))for(;this._reSpace.test(this._text[o]);)h++,o--;for(;/\S/.test(this._text[o])&&o>-1;)h++,o--;return s-h},findWordBoundaryRight:function(s){var h=0,o=s;if(this._reSpace.test(this._text[o]))for(;this._reSpace.test(this._text[o]);)h++,o++;for(;/\S/.test(this._text[o])&&o-1;)h++,o--;return s-h},findLineBoundaryRight:function(s){for(var h=0,o=s;!/\n/.test(this._text[o])&&o0&&ethis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=h):(this.selectionStart=h,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==o||this.selectionEnd!==e)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(s,h,o){var e=o.slice(0,s),r=f.util.string.graphemeSplit(e).length;if(s===h)return{selectionStart:r,selectionEnd:r};var t=o.slice(s,h),n=f.util.string.graphemeSplit(t).length;return{selectionStart:r,selectionEnd:r+n}},fromGraphemeToStringSelection:function(s,h,o){var e=o.slice(0,s),r=e.join("").length;if(s===h)return{selectionStart:r,selectionEnd:r};var t=o.slice(s,h),n=t.join("").length;return{selectionStart:r,selectionEnd:r+n}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var s=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=s.selectionStart,this.hiddenTextarea.selectionEnd=s.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var s=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=s.selectionEnd,this.inCompositionMode||(this.selectionStart=s.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var s=this._calcTextareaPosition();this.hiddenTextarea.style.left=s.left,this.hiddenTextarea.style.top=s.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var s=this.inCompositionMode?this.compositionStart:this.selectionStart,h=this._getCursorBoundaries(s),o=this.get2DCursorLocation(s),e=o.lineIndex,r=o.charIndex,t=this.getValueOfPropertyAt(e,r,"fontSize")*this.lineHeight,n=h.leftOffset,a=this.calcTransformMatrix(),i={x:h.left+n,y:h.top+h.topOffset+t},l=this.canvas.getRetinaScaling(),u=this.canvas.upperCanvasEl,d=u.width/l,g=u.height/l,p=d-t,v=g-t,_=u.clientWidth/d,T=u.clientHeight/g;return i=f.util.transformPoint(i,a),i=f.util.transformPoint(i,this.canvas.viewportTransform),i.x*=_,i.y*=T,i.x<0&&(i.x=0),i.x>p&&(i.x=p),i.y<0&&(i.y=0),i.y>v&&(i.y=v),i.x+=this.canvas._offset.left,i.y+=this.canvas._offset.top,{left:i.x+"px",top:i.y+"px",fontSize:t+"px",charHeight:t}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var s=this._textBeforeEdit!==this.text,h=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,h&&(h.blur&&h.blur(),h.parentNode&&h.parentNode.removeChild(h)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),s&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),s&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var s in this.styles)this._textLines[s]||delete this.styles[s]},removeStyleFromTo:function(s,h){var o=this.get2DCursorLocation(s,!0),e=this.get2DCursorLocation(h,!0),r=o.lineIndex,t=o.charIndex,n=e.lineIndex,a=e.charIndex,i,l;if(r!==n){if(this.styles[r])for(i=t;i=a&&(l[d-u]=l[g],delete l[g])}},shiftLineStyles:function(s,h){var o=c(this.styles);for(var e in this.styles){var r=parseInt(e,10);r>s&&(this.styles[r+h]=o[r],o[r-h]||delete this.styles[r])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(s,h,o,e){var r,t={},n=!1,a=this._unwrappedTextLines[s].length===h;o||(o=1),this.shiftLineStyles(s,o),this.styles[s]&&(r=this.styles[s][h===0?h:h-1]);for(var i in this.styles[s]){var l=parseInt(i,10);l>=h&&(n=!0,t[l-h]=this.styles[s][i],a&&h===0||delete this.styles[s][i])}var u=!1;for(n&&!a&&(this.styles[s+o]=t,u=!0),u&&o--;o>0;)e&&e[o-1]?this.styles[s+o]={0:c(e[o-1])}:r?this.styles[s+o]={0:c(r)}:delete this.styles[s+o],o--;this._forceClearCache=!0},insertCharStyleObject:function(s,h,o,e){this.styles||(this.styles={});var r=this.styles[s],t=r?c(r):{};o||(o=1);for(var n in t){var a=parseInt(n,10);a>=h&&(r[a+o]=t[a],t[a-o]||delete r[a])}if(this._forceClearCache=!0,e){for(;o--;)Object.keys(e[o]).length&&(this.styles[s]||(this.styles[s]={}),this.styles[s][h+o]=c(e[o]));return}if(r)for(var i=r[h?h-1:1];i&&o--;)this.styles[s][h+o]=c(i)},insertNewStyleBlock:function(s,h,o){for(var e=this.get2DCursorLocation(h,!0),r=[0],t=0,n=0;n0&&(this.insertCharStyleObject(e.lineIndex,e.charIndex,r[0],o),o=o&&o.slice(r[0]+1)),t&&this.insertNewlineStyleObject(e.lineIndex,e.charIndex+r[0],t);for(var n=1;n0?this.insertCharStyleObject(e.lineIndex+n,0,r[n],o):o&&this.styles[e.lineIndex+n]&&o[0]&&(this.styles[e.lineIndex+n][0]=o[0]),o=o&&o.slice(r[n]+1);r[n]>0&&this.insertCharStyleObject(e.lineIndex+n,0,r[n],o)},setSelectionStartEndWithShift:function(s,h,o){o<=s?(h===s?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=s),this.selectionStart=o):o>s&&os?this.selectionStart=s:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>s?this.selectionEnd=s:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),f.util.object.extend(f.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(c){if(this.canvas){this.__newClickTime=+new Date;var s=c.pointer;this.isTripleClick(s)&&(this.fire("tripleclick",c),this._stopEvent(c.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=s,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(c){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===c.x&&this.__lastPointer.y===c.y},_stopEvent:function(c){c.preventDefault&&c.preventDefault(),c.stopPropagation&&c.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(c){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(c.e))},tripleClickHandler:function(c){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(c.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(c){!this.canvas||!this.editable||c.e.button&&c.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(c.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(c){!this.canvas||!this.editable||c.e.button&&c.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(c){if(this.__isMousedown=!1,!(!this.editable||this.group||c.transform&&c.transform.actionPerformed||c.e.button&&c.e.button!==1)){if(this.canvas){var s=this.canvas._activeObject;if(s&&s!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(c.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(c){var s=this.getSelectionStartFromPointer(c),h=this.selectionStart,o=this.selectionEnd;c.shiftKey?this.setSelectionStartEndWithShift(h,o,s):(this.selectionStart=s,this.selectionEnd=s),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(c){for(var s=this.getLocalPointer(c),h=0,o=0,e=0,r=0,t=0,n,a,i=0,l=this._textLines.length;i0&&(r+=this._textLines[i-1].length+this.missingNewlineOffset(i-1));n=this._getLineLeftOffset(t),o=n*this.scaleX,a=this._textLines[t],this.direction==="rtl"&&(s.x=this.width*this.scaleX-s.x+o);for(var u=0,d=a.length;ur||t<0?0:1,a=o+n;return this.flipX&&(a=e-a),a>this._text.length&&(a=this._text.length),a}}),f.util.object.extend(f.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=f.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var c=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+c.top+"; left: "+c.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+c.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):f.document.body.appendChild(this.hiddenTextarea),f.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),f.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),f.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),f.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),f.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),f.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(f.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(c){if(this.isEditing){var s=this.direction==="rtl"?this.keysMapRtl:this.keysMap;if(c.keyCode in s)this[s[c.keyCode]](c);else if(c.keyCode in this.ctrlKeysMapDown&&(c.ctrlKey||c.metaKey))this[this.ctrlKeysMapDown[c.keyCode]](c);else return;c.stopImmediatePropagation(),c.preventDefault(),c.keyCode>=33&&c.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(c){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(c.keyCode in this.ctrlKeysMapUp&&(c.ctrlKey||c.metaKey))this[this.ctrlKeysMapUp[c.keyCode]](c);else return;c.stopImmediatePropagation(),c.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(c){var s=this.fromPaste;if(this.fromPaste=!1,c&&c.stopPropagation(),!!this.isEditing){var h=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,o=this._text.length,e=h.length,r,t,n=e-o,a=this.selectionStart,i=this.selectionEnd,l=a!==i,u,d,g;if(this.hiddenTextarea.value===""){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var p=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),v=a>p.selectionStart;l?(r=this._text.slice(a,i),n+=i-a):e0&&(o=this.__charBounds[c][s-1],h+=o.left+o.width),h},getDownCursorOffset:function(c,s){var h=this._getSelectionForOffset(c,s),o=this.get2DCursorLocation(h),e=o.lineIndex;if(e===this._textLines.length-1||c.metaKey||c.keyCode===34)return this._text.length-h;var r=o.charIndex,t=this._getWidthBeforeCursor(e,r),n=this._getIndexOnLine(e+1,t),a=this._textLines[e].slice(r);return a.length+n+1+this.missingNewlineOffset(e)},_getSelectionForOffset:function(c,s){return c.shiftKey&&this.selectionStart!==this.selectionEnd&&s?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(c,s){var h=this._getSelectionForOffset(c,s),o=this.get2DCursorLocation(h),e=o.lineIndex;if(e===0||c.metaKey||c.keyCode===33)return-h;var r=o.charIndex,t=this._getWidthBeforeCursor(e,r),n=this._getIndexOnLine(e-1,t),a=this._textLines[e].slice(0,r),i=this.missingNewlineOffset(e-1);return-this._textLines[e-1].length+n-a.length+(1-i)},_getIndexOnLine:function(c,s){for(var h=this._textLines[c],o=this._getLineLeftOffset(c),e=o,r=0,t,n,a=0,i=h.length;as){n=!0;var l=e-t,u=e,d=Math.abs(l-s),g=Math.abs(u-s);r=g=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",c)},moveCursorUp:function(c){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",c)},_moveCursorUpOrDown:function(c,s){var h="get"+c+"CursorOffset",o=this[h](s,this._selectionDirection==="right");s.shiftKey?this.moveCursorWithShift(o):this.moveCursorWithoutShift(o),o!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(c){var s=this._selectionDirection==="left"?this.selectionStart+c:this.selectionEnd+c;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,s),c!==0},moveCursorWithoutShift:function(c){return c<0?(this.selectionStart+=c,this.selectionEnd=this.selectionStart):(this.selectionEnd+=c,this.selectionStart=this.selectionEnd),c!==0},moveCursorLeft:function(c){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",c)},_move:function(c,s,h){var o;if(c.altKey)o=this["findWordBoundary"+h](this[s]);else if(c.metaKey||c.keyCode===35||c.keyCode===36)o=this["findLineBoundary"+h](this[s]);else return this[s]+=h==="Left"?-1:1,!0;if(typeof o<"u"&&this[s]!==o)return this[s]=o,!0},_moveLeft:function(c,s){return this._move(c,s,"Left")},_moveRight:function(c,s){return this._move(c,s,"Right")},moveCursorLeftWithoutShift:function(c){var s=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(s=this._moveLeft(c,"selectionStart")),this.selectionEnd=this.selectionStart,s},moveCursorLeftWithShift:function(c){if(this._selectionDirection==="right"&&this.selectionStart!==this.selectionEnd)return this._moveLeft(c,"selectionEnd");if(this.selectionStart!==0)return this._selectionDirection="left",this._moveLeft(c,"selectionStart")},moveCursorRight:function(c){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",c)},_moveCursorLeftOrRight:function(c,s){var h="moveCursor"+c+"With";this._currentCursorOpacity=1,s.shiftKey?h+="Shift":h+="outShift",this[h](s)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(c){if(this._selectionDirection==="left"&&this.selectionStart!==this.selectionEnd)return this._moveRight(c,"selectionStart");if(this.selectionEnd!==this._text.length)return this._selectionDirection="right",this._moveRight(c,"selectionEnd")},moveCursorRightWithoutShift:function(c){var s=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(s=this._moveRight(c,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,s},removeChars:function(c,s){typeof s>"u"&&(s=c+1),this.removeStyleFromTo(c,s),this._text.splice(c,s-c),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(c,s,h,o){typeof o>"u"&&(o=h),o>h&&this.removeStyleFromTo(h,o);var e=f.util.string.graphemeSplit(c);this.insertNewStyleBlock(e,h,s),this._text=[].concat(this._text.slice(0,h),e,this._text.slice(o)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var c=f.util.toFixed,s=/ +/g;f.util.object.extend(f.Text.prototype,{_toSVG:function(){var h=this._getSVGLeftTopOffsets(),o=this._getSVGTextAndBg(h.textTop,h.textLeft);return this._wrapSVGTextAndBg(o)},toSVG:function(h){return this._createBaseSVGMarkup(this._toSVG(),{reviver:h,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(h){var o=!0,e=this.getSvgTextDecoration(this);return[h.textBgRects.join(""),' ",h.textSpans.join(""),` +`]},_getSVGTextAndBg:function(h,o){var e=[],r=[],t=h,n;this._setSVGBg(r);for(var a=0,i=this._textLines.length;a",f.util.string.escapeXml(h),""].join("")},_setSVGTextLineText:function(h,o,e,r){var t=this.getHeightOfLine(o),n=this.textAlign.indexOf("justify")!==-1,a,i,l="",u,d,g=0,p=this._textLines[o],v;r+=t*(1-this._fontSizeFraction)/this.lineHeight;for(var _=0,T=p.length-1;_<=T;_++)v=_===T||this.charSpacing,l+=p[_],u=this.__charBounds[o][_],g===0?(e+=u.kernedWidth-u.width,g+=u.width):g+=u.kernedWidth,n&&!v&&this._reSpaceAndTab.test(p[_])&&(v=!0),v||(a=a||this.getCompleteStyleDeclaration(o,_),i=this.getCompleteStyleDeclaration(o,_+1),v=f.util.hasStyleChanged(a,i,!0)),v&&(d=this._getStyleDeclaration(o,_)||{},h.push(this._createTextCharSpan(l,d,e,r)),l="",a=i,e+=g,g=0)},_pushTextBgRect:function(h,o,e,r,t,n){var a=f.Object.NUM_FRACTION_DIGITS;h.push(" +`)},_setSVGTextLineBg:function(h,o,e,r){for(var t=this._textLines[o],n=this.getHeightOfLine(o)/this.lineHeight,a=0,i=0,l,u,d=this.getValueOfPropertyAt(o,0,"textBackgroundColor"),g=0,p=t.length;gthis.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(h){for(var o=0,e=0,r=0,t={},n=0;n0?(e=0,r++,o++):!this.splitByGrapheme&&this._reSpaceAndTab.test(h.graphemeText[r])&&n>0&&(e++,r++),t[n]={line:o,offset:e},r+=h.graphemeLines[n].length,e+=h.graphemeLines[n].length;return t},styleHas:function(h,o){if(this._styleMap&&!this.isWrapping){var e=this._styleMap[o];e&&(o=e.line)}return s.Text.prototype.styleHas.call(this,h,o)},isEmptyStyles:function(h){if(!this.styles)return!0;var o=0,e=h+1,r,t,n=!1,a=this._styleMap[h],i=this._styleMap[h+1];a&&(h=a.line,o=a.offset),i&&(e=i.line,n=e===h,r=i.offset),t=typeof h>"u"?this.styles:{line:this.styles[h]};for(var l in t)for(var u in t[l])if(u>=o&&(!n||ue&&!T?(a.push(i),i=[],t=p,T=!0):t+=A,!T&&!n&&i.push(g),i=i.concat(u),v=n?0:this._measureWord([g],o,d),d++,T=!1,p>_&&(_=p);return W&&a.push(i),_+X>this.dynamicMinWidth&&(this.dynamicMinWidth=_-A+X),a},isEndOfWrapping:function(h){return!this._styleMap[h+1]||this._styleMap[h+1].line!==this._styleMap[h].line},missingNewlineOffset:function(h){return this.splitByGrapheme?this.isEndOfWrapping(h)?1:0:1},_splitTextIntoLines:function(h){for(var o=s.Text.prototype._splitTextIntoLines.call(this,h),e=this._wrapText(o.lines,this.width),r=new Array(e.length),t=0;tht[lt]})}}}return Object.freeze(Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"}))}var mt={};const Tt={},wt=Object.freeze(Object.defineProperty({__proto__:null,default:Tt},Symbol.toStringTag,{value:"Module"})),pt=Ct(wt);var yt;function Ot(){return yt||(yt=1,function(Z){var f=f||{version:"5.3.0"};if(Z.fabric=f,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?f.document=document:f.document=document.implementation.createHTMLDocument(""),f.window=window;else{var ft=pt,ht=new ft.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;f.document=ht.document,f.jsdomImplForWrapper=pt.implForWrapper,f.nodeCanvas=pt.Canvas,f.window=ht,DOMParser=f.window.DOMParser}f.isTouchSupported="ontouchstart"in f.window||"ontouchstart"in f.document||f.window&&f.window.navigator&&f.window.navigator.maxTouchPoints>0,f.isLikelyNode=typeof Buffer<"u"&&typeof window>"u",f.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],f.DPI=96,f.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",f.commaWsp="(?:\\s+,?\\s*|,\\s*)",f.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,f.reNonWord=/[ \n\.,;!\?\-]/,f.fontPaths={},f.iMatrix=[1,0,0,1,0,0],f.svgNS="http://www.w3.org/2000/svg",f.perfLimitSizeTotal=2097152,f.maxCacheSideLimit=4096,f.minCacheSideLimit=256,f.charWidthsCache={},f.textureSize=2048,f.disableStyleCopyPaste=!1,f.enableGLFiltering=!0,f.devicePixelRatio=f.window.devicePixelRatio||f.window.webkitDevicePixelRatio||f.window.mozDevicePixelRatio||1,f.browserShadowBlurConstant=1,f.arcToSegmentsCache={},f.boundsOfCurveCache={},f.cachesBoundsOfCurve=!0,f.forceGLPutImageData=!1,f.initFilterBackend=function(){if(f.enableGLFiltering&&f.isWebglSupported&&f.isWebglSupported(f.textureSize))return console.log("max texture size: "+f.maxTextureSize),new f.WebglFilterBackend({tileSize:f.textureSize});if(f.Canvas2dFilterBackend)return new f.Canvas2dFilterBackend},typeof document<"u"&&typeof window<"u"&&(window.fabric=f),function(){function c(t,n){if(this.__eventListeners[t]){var a=this.__eventListeners[t];n?a[a.indexOf(n)]=!1:f.util.array.fill(a,!1)}}function s(t,n){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var a in t)this.on(a,t[a]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(n);return this}function h(t,n){var a=function(){n.apply(this,arguments),this.off(t,a)}.bind(this);this.on(t,a)}function o(t,n){if(arguments.length===1)for(var a in t)h.call(this,a,t[a]);else h.call(this,t,n);return this}function e(t,n){if(!this.__eventListeners)return this;if(arguments.length===0)for(t in this.__eventListeners)c.call(this,t);else if(arguments.length===1&&typeof arguments[0]=="object")for(var a in t)c.call(this,a,t[a]);else c.call(this,t,n);return this}function r(t,n){if(!this.__eventListeners)return this;var a=this.__eventListeners[t];if(!a)return this;for(var i=0,l=a.length;i"u"?this._objects.concat():this._objects.filter(function(s){return s.type===c})},item:function(c){return this._objects[c]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(c,s){return this._objects.indexOf(c)>-1?!0:s?this._objects.some(function(h){return typeof h.contains=="function"&&h.contains(c,!0)}):!1},complexity:function(){return this._objects.reduce(function(c,s){return c+=s.complexity?s.complexity():0,c},0)}},f.CommonMethods={_setOptions:function(c){for(var s in c)this.set(s,c[s])},_initGradient:function(c,s){c&&c.colorStops&&!(c instanceof f.Gradient)&&this.set(s,new f.Gradient(c))},_initPattern:function(c,s,h){c&&c.source&&!(c instanceof f.Pattern)?this.set(s,new f.Pattern(c,h)):h&&h()},_setObject:function(c){for(var s in c)this._set(s,c[s])},set:function(c,s){return typeof c=="object"?this._setObject(c):this._set(c,s),this},_set:function(c,s){this[c]=s},toggle:function(c){var s=this.get(c);return typeof s=="boolean"&&this.set(c,!s),this},get:function(c){return this[c]}},function(c){var s=Math.sqrt,h=Math.atan2,o=Math.pow,e=Math.PI/180,r=Math.PI/2;f.util={cos:function(t){if(t===0)return 1;t<0&&(t=-t);var n=t/r;switch(n){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(t===0)return 0;var n=t/r,a=1;switch(t<0&&(a=-1),n){case 1:return a;case 2:return 0;case 3:return-a}return Math.sin(t)},removeFromArray:function(t,n){var a=t.indexOf(n);return a!==-1&&t.splice(a,1),t},getRandomInt:function(t,n){return Math.floor(Math.random()*(n-t+1))+t},degreesToRadians:function(t){return t*e},radiansToDegrees:function(t){return t/e},rotatePoint:function(t,n,a){var i=new f.Point(t.x-n.x,t.y-n.y),l=f.util.rotateVector(i,a);return new f.Point(l.x,l.y).addEquals(n)},rotateVector:function(t,n){var a=f.util.sin(n),i=f.util.cos(n),l=t.x*i-t.y*a,u=t.x*a+t.y*i;return{x:l,y:u}},createVector:function(t,n){return new f.Point(n.x-t.x,n.y-t.y)},calcAngleBetweenVectors:function(t,n){return Math.acos((t.x*n.x+t.y*n.y)/(Math.hypot(t.x,t.y)*Math.hypot(n.x,n.y)))},getHatVector:function(t){return new f.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,n,a){var i=f.util.createVector(t,n),l=f.util.createVector(t,a),u=f.util.calcAngleBetweenVectors(i,l),d=f.util.calcAngleBetweenVectors(f.util.rotateVector(i,u),l),g=u*(d===0?1:-1)/2;return{vector:f.util.getHatVector(f.util.rotateVector(i,g)),angle:u}},projectStrokeOnPoints:function(t,n,a){var i=[],l=n.strokeWidth/2,u=n.strokeUniform?new f.Point(1/n.scaleX,1/n.scaleY):new f.Point(1,1),d=function(g){var p=l/Math.hypot(g.x,g.y);return new f.Point(g.x*p*u.x,g.y*p*u.y)};return t.length<=1||t.forEach(function(g,p){var v=new f.Point(g.x,g.y),_,T;p===0?(T=t[p+1],_=a?d(f.util.createVector(T,v)).addEquals(v):t[t.length-1]):p===t.length-1?(_=t[p-1],T=a?d(f.util.createVector(_,v)).addEquals(v):t[0]):(_=t[p-1],T=t[p+1]);var A=f.util.getBisector(v,_,T),X=A.vector,W=A.angle,N,V;if(n.strokeLineJoin==="miter"&&(N=-l/Math.sin(W/2),V=new f.Point(X.x*N*u.x,X.y*N*u.y),Math.hypot(V.x,V.y)/l<=n.strokeMiterLimit)){i.push(v.add(V)),i.push(v.subtract(V));return}N=-l*Math.SQRT2,V=new f.Point(X.x*N*u.x,X.y*N*u.y),i.push(v.add(V)),i.push(v.subtract(V))}),i},transformPoint:function(t,n,a){return a?new f.Point(n[0]*t.x+n[2]*t.y,n[1]*t.x+n[3]*t.y):new f.Point(n[0]*t.x+n[2]*t.y+n[4],n[1]*t.x+n[3]*t.y+n[5])},makeBoundingBoxFromPoints:function(t,n){if(n)for(var a=0;a"u"?1:t.scaleX,a=typeof t.scaleY>"u"?1:t.scaleY,i=[t.flipX?-n:n,0,0,t.flipY?-a:a,0,0],l=f.util.multiplyTransformMatrices,u=f.util.degreesToRadians;return t.skewX&&(i=l(i,[1,0,Math.tan(u(t.skewX)),1],!0)),t.skewY&&(i=l(i,[1,Math.tan(u(t.skewY)),0,1],!0)),i},composeMatrix:function(t){var n=[1,0,0,1,t.translateX||0,t.translateY||0],a=f.util.multiplyTransformMatrices;return t.angle&&(n=a(n,f.util.calcRotateMatrix(t))),(t.scaleX!==1||t.scaleY!==1||t.skewX||t.skewY||t.flipX||t.flipY)&&(n=a(n,f.util.calcDimensionsMatrix(t))),n},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,n,a,i){i>0&&(n>i?n-=i:n=0,a>i?a-=i:a=0);var l=!0,u,d,g=t.getImageData(n,a,i*2||1,i*2||1),p=g.data.length;for(u=3;u0){var v=f.util.hasStyleChanged(l,p,!0);v?u.push({start:i,end:i+1,style:p}):u[u.length-1].end++}l=p||{}}}return u},stylesFromArray:function(t,n){if(!Array.isArray(t))return t;for(var a=n.split(` -`),i=-1,l=0,u={},d=0;d0?nt-=2*w:x===1&&nt<0&&(nt+=2*w);for(var rt=Math.ceil(Math.abs(nt/w*2)),ot=[],st=nt/rt,ut=8/3*Math.sin(st/4)*Math.sin(st/4)/Math.sin(st/2),dt=it+st,at=0;at=P?x-P:2*Math.PI-(P-x)}function t(m,C,S,b,P,x,y,w){var k;if(f.cachesBoundsOfCurve&&(k=c.call(arguments),f.boundsOfCurveCache[k]))return f.boundsOfCurveCache[k];var M=Math.sqrt,E=Math.min,R=Math.max,Y=Math.abs,z=[],j=[[],[]],O,I,L,D,B,H,tt,Q;I=6*m-12*S+6*P,O=-3*m+9*S-9*P+3*y,L=3*S-3*m;for(var F=0;F<2;++F){if(F>0&&(I=6*C-12*b+6*x,O=-3*C+9*b-9*x+3*w,L=3*b-3*C),Y(O)<1e-12){if(Y(I)<1e-12)continue;D=-L/I,01e-4;)y=P(S),E=S,w=i(x.x,x.y,y.x,y.y),w+b>C?(S-=k,k/=2):(x=y,S+=k,b+=w);return y.angle=M(E),y}function U(m){for(var C=0,S=m.length,b,P=0,x=0,y=0,w=0,k=[],M,E,R,Y=0;Y0&&btt)for(var F=1,$=O.length;F<$;F+=tt)C.push([L].concat(O.slice(F,F+tt))),L=Q;else C.push(O)}return C}function J(m,C){var S=[],b,P=new f.Point(m[0].x,m[0].y),x=new f.Point(m[1].x,m[1].y),y=m.length,w=1,k=0,M=y>2;for(C=C||0,M&&(w=m[2].xm[b-2].x?1:P.x===m[b-2].x?0:-1,k=P.y>m[b-2].y?1:P.y===m[b-2].y?0:-1),S.push(["L",P.x+w*C,P.y+k*C]),S}function K(m,C,S){return S&&(C=f.util.multiplyTransformMatrices(C,[1,0,0,1,-S.x,-S.y])),m.map(function(b){for(var P=b.slice(0),x={},y=1;y=i})}function o(t,n){return r(t,n,function(a,i){return a/g,">")}function o(r){var t=0,n,a=[];for(t=0,n;t57343)return r.charAt(t);if(55296<=n&&n<=56319){if(r.length<=t+1)throw"High surrogate without following low surrogate";var a=r.charCodeAt(t+1);if(56320>a||a>57343)throw"High surrogate without following low surrogate";return r.charAt(t)+r.charAt(t+1)}if(t===0)throw"Low surrogate without preceding high surrogate";var i=r.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}f.util.string={camelize:c,capitalize:s,escapeXml:h,graphemeSplit:o}}(),function(){var c=Array.prototype.slice,s=function(){},h=function(){for(var n in{toString:1})if(n==="toString")return!1;return!0}(),o=function(n,a,i){for(var l in a)l in n.prototype&&typeof n.prototype[l]=="function"&&(a[l]+"").indexOf("callSuper")>-1?n.prototype[l]=function(u){return function(){var d=this.constructor.superclass;this.constructor.superclass=i;var g=a[u].apply(this,arguments);if(this.constructor.superclass=d,u!=="initialize")return g}}(l):n.prototype[l]=a[l],h&&(a.toString!==Object.prototype.toString&&(n.prototype.toString=a.toString),a.valueOf!==Object.prototype.valueOf&&(n.prototype.valueOf=a.valueOf))};function e(){}function r(n){for(var a=null,i=this;i.constructor.superclass;){var l=i.constructor.superclass.prototype[n];if(i[n]!==l){a=l;break}i=i.constructor.superclass.prototype}return a?arguments.length>1?a.apply(this,c.call(arguments,1)):a.call(this):console.log("tried to callSuper "+n+", method not found in prototype chain",this)}function t(){var n=null,a=c.call(arguments,0);typeof a[0]=="function"&&(n=a.shift());function i(){this.initialize.apply(this,arguments)}i.superclass=n,i.subclasses=[],n&&(e.prototype=n.prototype,i.prototype=new e,n.subclasses.push(i));for(var l=0,u=a.length;l-1||o.pointerType==="touch"}}(),function(){function c(t,n){var a=t.style;if(!a)return t;if(typeof n=="string")return t.style.cssText+=";"+n,n.indexOf("opacity")>-1?r(t,n.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var i in n)if(i==="opacity")r(t,n[i]);else{var l=i==="float"||i==="cssFloat"?typeof a.styleFloat>"u"?"cssFloat":"styleFloat":i;a.setProperty(l,n[i])}return t}var s=f.document.createElement("div"),h=typeof s.style.opacity=="string",o=typeof s.style.filter=="string",e=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,r=function(t){return t};h?r=function(t,n){return t.style.opacity=n,t}:o&&(r=function(t,n){var a=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(a.zoom=1),e.test(a.filter)?(n=n>=.9999?"":"alpha(opacity="+n*100+")",a.filter=a.filter.replace(e,n)):a.filter+=" alpha(opacity="+n*100+")",t}),f.util.setStyle=c}(),function(){var c=Array.prototype.slice;function s(g){return typeof g=="string"?f.document.getElementById(g):g}var h,o=function(g){return c.call(g,0)};try{h=o(f.document.childNodes)instanceof Array}catch{}h||(o=function(g){for(var p=new Array(g.length),v=g.length;v--;)p[v]=g[v];return p});function e(g,p){var v=f.document.createElement(g);for(var _ in p)_==="class"?v.className=p[_]:_==="for"?v.htmlFor=p[_]:v.setAttribute(_,p[_]);return v}function r(g,p){g&&(" "+g.className+" ").indexOf(" "+p+" ")===-1&&(g.className+=(g.className?" ":"")+p)}function t(g,p,v){return typeof p=="string"&&(p=e(p,v)),g.parentNode&&g.parentNode.replaceChild(p,g),p.appendChild(g),p}function n(g){for(var p=0,v=0,_=f.document.documentElement,T=f.document.body||{scrollLeft:0,scrollTop:0};g&&(g.parentNode||g.host)&&(g=g.parentNode||g.host,g===f.document?(p=T.scrollLeft||_.scrollLeft||0,v=T.scrollTop||_.scrollTop||0):(p+=g.scrollLeft||0,v+=g.scrollTop||0),!(g.nodeType===1&&g.style.position==="fixed")););return{left:p,top:v}}function a(g){var p,v=g&&g.ownerDocument,_={left:0,top:0},T={left:0,top:0},A,X={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!v)return T;for(var W in X)T[X[W]]+=parseInt(i(g,W),10)||0;return p=v.documentElement,typeof g.getBoundingClientRect<"u"&&(_=g.getBoundingClientRect()),A=n(g),{left:_.left+A.left-(p.clientLeft||0)+T.left,top:_.top+A.top-(p.clientTop||0)+T.top}}var i;f.document.defaultView&&f.document.defaultView.getComputedStyle?i=function(g,p){var v=f.document.defaultView.getComputedStyle(g,null);return v?v[p]:void 0}:i=function(g,p){var v=g.style[p];return!v&&g.currentStyle&&(v=g.currentStyle[p]),v},function(){var g=f.document.documentElement.style,p="userSelect"in g?"userSelect":"MozUserSelect"in g?"MozUserSelect":"WebkitUserSelect"in g?"WebkitUserSelect":"KhtmlUserSelect"in g?"KhtmlUserSelect":"";function v(T){return typeof T.onselectstart<"u"&&(T.onselectstart=f.util.falseFunction),p?T.style[p]="none":typeof T.unselectable=="string"&&(T.unselectable="on"),T}function _(T){return typeof T.onselectstart<"u"&&(T.onselectstart=null),p?T.style[p]="":typeof T.unselectable=="string"&&(T.unselectable=""),T}f.util.makeElementUnselectable=v,f.util.makeElementSelectable=_}();function l(g){var p=f.jsdomImplForWrapper(g);return p._canvas||p._image}function u(g){if(f.isLikelyNode){var p=f.jsdomImplForWrapper(g);p&&(p._image=null,p._canvas=null,p._currentSrc=null,p._attributes=null,p._classList=null)}}function d(g,p){g.imageSmoothingEnabled=g.imageSmoothingEnabled||g.webkitImageSmoothingEnabled||g.mozImageSmoothingEnabled||g.msImageSmoothingEnabled||g.oImageSmoothingEnabled,g.imageSmoothingEnabled=p}f.util.setImageSmoothing=d,f.util.getById=s,f.util.toArray=o,f.util.addClass=r,f.util.makeElement=e,f.util.wrapElement=t,f.util.getScrollLeftTop=n,f.util.getElementOffset=a,f.util.getNodeCanvas=l,f.util.cleanUpJsdomNode=u}(),function(){function c(o,e){return o+(/\?/.test(o)?"&":"?")+e}function s(){}function h(o,e){e||(e={});var r=e.method?e.method.toUpperCase():"GET",t=e.onComplete||function(){},n=new f.window.XMLHttpRequest,a=e.body||e.parameters;return n.onreadystatechange=function(){n.readyState===4&&(t(n),n.onreadystatechange=s)},r==="GET"&&(a=null,typeof e.parameters=="string"&&(o=c(o,e.parameters))),n.open(r,o,!0),(r==="POST"||r==="PUT")&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.send(a),n}f.util.request=h}(),f.log=console.log,f.warn=console.warn,function(){var c=f.util.object.extend,s=f.util.object.clone,h=[];f.util.object.extend(h,{cancelAll:function(){var l=this.splice(0);return l.forEach(function(u){u.cancel()}),l},cancelByCanvas:function(l){if(!l)return[];var u=this.filter(function(d){return typeof d.target=="object"&&d.target.canvas===l});return u.forEach(function(d){d.cancel()}),u},cancelByTarget:function(l){var u=this.findAnimationsByTarget(l);return u.forEach(function(d){d.cancel()}),u},findAnimationIndex:function(l){return this.indexOf(this.findAnimation(l))},findAnimation:function(l){return this.find(function(u){return u.cancel===l})},findAnimationsByTarget:function(l){return l?this.filter(function(u){return u.target===l}):[]}});function o(){return!1}function e(l,u,d,g){return-d*Math.cos(l/g*(Math.PI/2))+d+u}function r(l){l||(l={});var u=!1,d,g=function(){var p=f.runningAnimations.indexOf(d);return p>-1&&f.runningAnimations.splice(p,1)[0]};return d=c(s(l),{cancel:function(){return u=!0,g()},currentValue:"startValue"in l?l.startValue:0,completionRate:0,durationRate:0}),f.runningAnimations.push(d),a(function(p){var v=p||+new Date,_=l.duration||500,T=v+_,A,X=l.onChange||o,W=l.abort||o,N=l.onComplete||o,V=l.easing||e,U="startValue"in l?l.startValue.length>0:!1,G="startValue"in l?l.startValue:0,q="endValue"in l?l.endValue:100,J=l.byValue||(U?G.map(function(K,m){return q[m]-G[m]}):q-G);l.onStart&&l.onStart(),function K(m){A=m||+new Date;var C=A>T?_:A-v,S=C/_,b=U?G.map(function(x,y){return V(C,G[y],J[y],_)}):V(C,G,J,_),P=Math.abs(U?(b[0]-G[0])/J[0]:(b-G)/J);if(d.currentValue=U?b.slice():b,d.completionRate=P,d.durationRate=S,!u){if(W(b,P,S)){g();return}if(A>T){d.currentValue=U?q.slice():q,d.completionRate=1,d.durationRate=1,X(U?q.slice():q,1,1),N(q,1,1),g();return}else X(b,P,S),a(K)}}(v)}),d.cancel}var t=f.window.requestAnimationFrame||f.window.webkitRequestAnimationFrame||f.window.mozRequestAnimationFrame||f.window.oRequestAnimationFrame||f.window.msRequestAnimationFrame||function(l){return f.window.setTimeout(l,1e3/60)},n=f.window.cancelAnimationFrame||f.window.clearTimeout;function a(){return t.apply(f.window,arguments)}function i(){return n.apply(f.window,arguments)}f.util.animate=r,f.util.requestAnimFrame=a,f.util.cancelAnimFrame=i,f.runningAnimations=h}(),function(){function c(h,o,e){var r="rgba("+parseInt(h[0]+e*(o[0]-h[0]),10)+","+parseInt(h[1]+e*(o[1]-h[1]),10)+","+parseInt(h[2]+e*(o[2]-h[2]),10);return r+=","+(h&&o?parseFloat(h[3]+e*(o[3]-h[3])):1),r+=")",r}function s(h,o,e,r){var t=new f.Color(h).getSource(),n=new f.Color(o).getSource(),a=r.onComplete,i=r.onChange;return r=r||{},f.util.animate(f.util.object.extend(r,{duration:e||500,startValue:t,endValue:n,byValue:n,easing:function(l,u,d,g){var p=r.colorEasing?r.colorEasing(l,g):1-Math.cos(l/g*(Math.PI/2));return c(u,d,p)},onComplete:function(l,u,d){if(a)return a(c(n,n,0),u,d)},onChange:function(l,u,d){if(i){if(Array.isArray(l))return i(c(l,l,0),u,d);i(l,u,d)}}}))}f.util.animateColor=s}(),function(){function c(m,C,S,b){return m-1&&Y>-1&&Y-1)&&(y="stroke")}else{if(x==="href"||x==="xlink:href"||x==="font")return y;if(x==="imageSmoothing")return y==="optimizeQuality";E=M?y.map(r):r(y,k)}}return!M&&isNaN(E)?y:E}function T(x){return new RegExp("^("+x.join("|")+")\\b","i")}function A(x){for(var y in d)if(!(typeof x[d[y]]>"u"||x[y]==="")){if(typeof x[y]>"u"){if(!s.Object.prototype[y])continue;x[y]=s.Object.prototype[y]}if(x[y].indexOf("url(")!==0){var w=new s.Color(x[y]);x[y]=w.setAlpha(e(w.getAlpha()*x[d[y]],2)).toRgba()}}return x}function X(x,y){var w,k=[],M,E,R;for(E=0,R=y.length;E1;)et.shift(),it=s.util.multiplyTransformMatrices(it,et[0]);return it}}();function W(x,y){var w,k;x.replace(/;\s*$/,"").split(";").forEach(function(M){var E=M.split(":");w=E[0].trim().toLowerCase(),k=E[1].trim(),y[w]=k})}function N(x,y){var w,k;for(var M in x)typeof x[M]>"u"||(w=M.toLowerCase(),k=x[M],y[w]=k)}function V(x,y){var w={};for(var k in s.cssRules[y])if(U(x,k.split(" ")))for(var M in s.cssRules[y][k])w[M]=s.cssRules[y][k][M];return w}function U(x,y){var w,k=!0;return w=q(x,y.pop()),w&&y.length&&(k=G(x,y)),w&&k&&y.length===0}function G(x,y){for(var w,k=!0;x.parentNode&&x.parentNode.nodeType===1&&y.length;)k&&(w=y.pop()),x=x.parentNode,k=q(x,w);return y.length===0}function q(x,y){var w=x.nodeName,k=x.getAttribute("class"),M=x.getAttribute("id"),E,R;if(E=new RegExp("^"+w,"i"),y=y.replace(E,""),M&&y.length&&(E=new RegExp("#"+M+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"")),k&&y.length)for(k=k.split(" "),R=k.length;R--;)E=new RegExp("\\."+k[R]+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"");return y.length===0}function J(x,y){var w;if(x.getElementById&&(w=x.getElementById(y)),w)return w;var k,M,E,R=x.getElementsByTagName("*");for(M=0,E=R.length;Mk?k:w),B.meetOrSlice==="slice"&&(k=w=w>k?w:k),et=F.width-R*w,it=F.height-Y*w,B.alignX==="Mid"&&(et/=2),B.alignY==="Mid"&&(it/=2),B.alignX==="Min"&&(et=0),B.alignY==="Min"&&(it=0)),w===1&&k===1&&M===0&&E===0&&L===0&&D===0)return F;if((L||D)&&x.parentNode.nodeName!=="#document"&&($=" translate("+r(L)+" "+r(D)+") "),z=$+" matrix("+w+" 0 0 "+k+" "+(M*w+et)+" "+(E*k+it)+") ",x.nodeName==="svg"){for(j=x.ownerDocument.createElementNS(s.svgNS,"g");x.firstChild;)j.appendChild(x.firstChild);x.appendChild(j)}else j=x,j.removeAttribute("x"),j.removeAttribute("y"),z=j.getAttribute("transform")+z;return j.setAttribute("transform",z),F}function S(x,y){for(;x&&(x=x.parentNode);)if(x.nodeName&&y.test(x.nodeName.replace("svg:",""))&&!x.getAttribute("instantiated_by_use"))return!0;return!1}s.parseSVGDocument=function(x,y,w,k){if(x){K(x);var M=s.Object.__uid++,E,R,Y=C(x),z=s.util.toArray(x.getElementsByTagName("*"));if(Y.crossOrigin=k&&k.crossOrigin,Y.svgUid=M,z.length===0&&s.isLikelyNode){z=x.selectNodes('//*[name(.)!="svg"]');var j=[];for(E=0,R=z.length;E"u"&&(w=x.getAttribute("svgUid")),x.parentNode&&s.svgValidParentsRegEx.test(x.parentNode.nodeName)&&(M=s.parseAttributes(x.parentNode,y,w));var Y=y.reduce(function(B,H){return k=x.getAttribute(H),k&&(B[H]=k),B},{}),z=h(V(x,w),s.parseStyleAttribute(x));Y=h(Y,z),z[p]&&x.setAttribute(p,z[p]),E=R=M.fontSize||s.Text.DEFAULT_SVG_FONT_SIZE,Y[g]&&(Y[g]=E=r(Y[g],R));var j,O,I={};for(var L in Y)j=v(L),O=_(j,Y[L],M,E),I[j]=O;I&&I.font&&s.parseFontDeclaration(I.font,I);var D=h(M,I);return s.svgValidParentsRegEx.test(x.nodeName)?D:A(D)}},parseElements:function(x,y,w,k,M){new s.ElementsParser(x,y,w,k,M).parse()},parseStyleAttribute:function(x){var y={},w=x.getAttribute("style");return w&&(typeof w=="string"?W(w,y):N(w,y)),y},parsePointsAttribute:function(x){if(!x)return null;x=x.replace(/,/g," ").trim(),x=x.split(/\s+/);var y=[],w,k;for(w=0,k=x.length;wo.x&&this.y>o.y},gte:function(o){return this.x>=o.x&&this.y>=o.y},lerp:function(o,e){return typeof e>"u"&&(e=.5),e=Math.max(Math.min(1,e),0),new h(this.x+(o.x-this.x)*e,this.y+(o.y-this.y)*e)},distanceFrom:function(o){var e=this.x-o.x,r=this.y-o.y;return Math.sqrt(e*e+r*r)},midPointFrom:function(o){return this.lerp(o)},min:function(o){return new h(Math.min(this.x,o.x),Math.min(this.y,o.y))},max:function(o){return new h(Math.max(this.x,o.x),Math.max(this.y,o.y))},toString:function(){return this.x+","+this.y},setXY:function(o,e){return this.x=o,this.y=e,this},setX:function(o){return this.x=o,this},setY:function(o){return this.y=o,this},setFromPoint:function(o){return this.x=o.x,this.y=o.y,this},swap:function(o){var e=this.x,r=this.y;this.x=o.x,this.y=o.y,o.x=e,o.y=r},clone:function(){return new h(this.x,this.y)}}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Intersection){s.warn("fabric.Intersection is already defined");return}function h(o){this.status=o,this.points=[]}s.Intersection=h,s.Intersection.prototype={constructor:h,appendPoint:function(o){return this.points.push(o),this},appendPoints:function(o){return this.points=this.points.concat(o),this}},s.Intersection.intersectLineLine=function(o,e,r,t){var n,a=(t.x-r.x)*(o.y-r.y)-(t.y-r.y)*(o.x-r.x),i=(e.x-o.x)*(o.y-r.y)-(e.y-o.y)*(o.x-r.x),l=(t.y-r.y)*(e.x-o.x)-(t.x-r.x)*(e.y-o.y);if(l!==0){var u=a/l,d=i/l;0<=u&&u<=1&&0<=d&&d<=1?(n=new h("Intersection"),n.appendPoint(new s.Point(o.x+u*(e.x-o.x),o.y+u*(e.y-o.y)))):n=new h}else a===0||i===0?n=new h("Coincident"):n=new h("Parallel");return n},s.Intersection.intersectLinePolygon=function(o,e,r){var t=new h,n=r.length,a,i,l,u;for(u=0;u0&&(t.status="Intersection"),t},s.Intersection.intersectPolygonPolygon=function(o,e){var r=new h,t=o.length,n;for(n=0;n0&&(r.status="Intersection"),r},s.Intersection.intersectPolygonRectangle=function(o,e,r){var t=e.min(r),n=e.max(r),a=new s.Point(n.x,t.y),i=new s.Point(t.x,n.y),l=h.intersectLinePolygon(t,a,o),u=h.intersectLinePolygon(a,n,o),d=h.intersectLinePolygon(n,i,o),g=h.intersectLinePolygon(i,t,o),p=new h;return p.appendPoints(l.points),p.appendPoints(u.points),p.appendPoints(d.points),p.appendPoints(g.points),p.points.length>0&&(p.status="Intersection"),p}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Color){s.warn("fabric.Color is already defined.");return}function h(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}s.Color=h,s.Color.prototype={_tryParsingColor:function(e){var r;e in h.colorNameMap&&(e=h.colorNameMap[e]),e==="transparent"&&(r=[255,255,255,0]),r||(r=h.sourceFromHex(e)),r||(r=h.sourceFromRgb(e)),r||(r=h.sourceFromHsl(e)),r||(r=[0,0,0,1]),r&&this.setSource(r)},_rgbToHsl:function(e,r,t){e/=255,r/=255,t/=255;var n,a,i,l=s.util.array.max([e,r,t]),u=s.util.array.min([e,r,t]);if(i=(l+u)/2,l===u)n=a=0;else{var d=l-u;switch(a=i>.5?d/(2-l-u):d/(l+u),l){case e:n=(r-t)/d+(r1&&(t-=1),t<1/6?e+(r-e)*6*t:t<1/2?r:t<2/3?e+(r-e)*(2/3-t)*6:e}s.Color.fromRgb=function(e){return h.fromSource(h.sourceFromRgb(e))},s.Color.sourceFromRgb=function(e){var r=e.match(h.reRGBa);if(r){var t=parseInt(r[1],10)/(/%$/.test(r[1])?100:1)*(/%$/.test(r[1])?255:1),n=parseInt(r[2],10)/(/%$/.test(r[2])?100:1)*(/%$/.test(r[2])?255:1),a=parseInt(r[3],10)/(/%$/.test(r[3])?100:1)*(/%$/.test(r[3])?255:1);return[parseInt(t,10),parseInt(n,10),parseInt(a,10),r[4]?parseFloat(r[4]):1]}},s.Color.fromRgba=h.fromRgb,s.Color.fromHsl=function(e){return h.fromSource(h.sourceFromHsl(e))},s.Color.sourceFromHsl=function(e){var r=e.match(h.reHSLa);if(r){var t=(parseFloat(r[1])%360+360)%360/360,n=parseFloat(r[2])/(/%$/.test(r[2])?100:1),a=parseFloat(r[3])/(/%$/.test(r[3])?100:1),i,l,u;if(n===0)i=l=u=a;else{var d=a<=.5?a*(n+1):a+n-a*n,g=a*2-d;i=o(g,d,t+1/3),l=o(g,d,t),u=o(g,d,t-1/3)}return[Math.round(i*255),Math.round(l*255),Math.round(u*255),r[4]?parseFloat(r[4]):1]}},s.Color.fromHsla=h.fromHsl,s.Color.fromHex=function(e){return h.fromSource(h.sourceFromHex(e))},s.Color.sourceFromHex=function(e){if(e.match(h.reHex)){var r=e.slice(e.indexOf("#")+1),t=r.length===3||r.length===4,n=r.length===8||r.length===4,a=t?r.charAt(0)+r.charAt(0):r.substring(0,2),i=t?r.charAt(1)+r.charAt(1):r.substring(2,4),l=t?r.charAt(2)+r.charAt(2):r.substring(4,6),u=n?t?r.charAt(3)+r.charAt(3):r.substring(6,8):"FF";return[parseInt(a,16),parseInt(i,16),parseInt(l,16),parseFloat((parseInt(u,16)/255).toFixed(2))]}},s.Color.fromSource=function(e){var r=new h;return r.setSource(e),r}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=["e","se","s","sw","w","nw","n","ne","e"],o=["ns","nesw","ew","nwse"],e={},r="left",t="top",n="right",a="bottom",i="center",l={top:a,bottom:t,left:n,right:r,center:i},u=s.util.radiansToDegrees,d=Math.sign||function(j){return(j>0)-(j<0)||+j};function g(j,O){var I=j.angle+u(Math.atan2(O.y,O.x))+360;return Math.round(I%360/45)}function p(j,O){var I=O.transform.target,L=I.canvas,D=s.util.object.clone(O);D.target=I,L&&L.fire("object:"+j,D),I.fire(j,O)}function v(j,O){var I=O.canvas,L=I.uniScaleKey,D=j[L];return I.uniformScaling&&!D||!I.uniformScaling&&D}function _(j){return j.originX===i&&j.originY===i}function T(j,O,I){var L=j.lockScalingX,D=j.lockScalingY;return!!(L&&D||!O&&(L||D)&&I||L&&O==="x"||D&&O==="y")}function A(j,O,I){var L="not-allowed",D=v(j,I),B="";if(O.x!==0&&O.y===0?B="x":O.x===0&&O.y!==0&&(B="y"),T(I,B,D))return L;var H=g(I,O);return h[H]+"-resize"}function X(j,O,I){var L="not-allowed";if(O.x!==0&&I.lockSkewingY||O.y!==0&&I.lockSkewingX)return L;var D=g(I,O)%4;return o[D]+"-resize"}function W(j,O,I){return j[I.canvas.altActionKey]?e.skewCursorStyleHandler(j,O,I):e.scaleCursorStyleHandler(j,O,I)}function N(j,O,I){var L=j[I.canvas.altActionKey];if(O.x===0)return L?"skewX":"scaleY";if(O.y===0)return L?"skewY":"scaleX"}function V(j,O,I){return I.lockRotation?"not-allowed":O.cursorStyle}function U(j,O,I,L){return{e:j,transform:O,pointer:{x:I,y:L}}}function G(j){return function(O,I,L,D){var B=I.target,H=B.getCenterPoint(),tt=B.translateToOriginPoint(H,I.originX,I.originY),Q=j(O,I,L,D);return B.setPositionByOrigin(tt,I.originX,I.originY),Q}}function q(j,O){return function(I,L,D,B){var H=O(I,L,D,B);return H&&p(j,U(I,L,D,B)),H}}function J(j,O,I,L,D){var B=j.target,H=B.controls[j.corner],tt=B.canvas.getZoom(),Q=B.padding/tt,F=B.toLocalPoint(new s.Point(L,D),O,I);return F.x>=Q&&(F.x-=Q),F.x<=-Q&&(F.x+=Q),F.y>=Q&&(F.y-=Q),F.y<=Q&&(F.y+=Q),F.x-=H.offsetX,F.y-=H.offsetY,F}function K(j){return j.flipX!==j.flipY}function m(j,O,I,L,D){if(j[O]!==0){var B=j._getTransformedDimensions()[L],H=D/B*j[I];j.set(I,H)}}function C(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(0,D.skewY),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.x*2)-B.x,Q=D.skewX,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleX,B.y/D.scaleY)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().y;D.set("skewX",F),m(D,"skewY","scaleY","y",et)}return $}function S(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(D.skewX,0),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.y*2)-B.y,Q=D.skewY,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleY,B.x/D.scaleX)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().x;D.set("skewY",F),m(D,"skewX","scaleX","x",et)}return $}function b(j,O,I,L){var D=O.target,B=D.skewX,H,tt=O.originY;if(D.lockSkewingX)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.x>0?H=r:H=n}else B>0&&(H=tt===t?r:n),B<0&&(H=tt===t?n:r),K(D)&&(H=H===r?n:r);O.originX=H;var F=q("skewing",G(C));return F(j,O,I,L)}function P(j,O,I,L){var D=O.target,B=D.skewY,H,tt=O.originX;if(D.lockSkewingY)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.y>0?H=t:H=a}else B>0&&(H=tt===r?t:a),B<0&&(H=tt===r?a:t),K(D)&&(H=H===t?a:t);O.originY=H;var F=q("skewing",G(S));return F(j,O,I,L)}function x(j,O,I,L){var D=O,B=D.target,H=B.translateToOriginPoint(B.getCenterPoint(),D.originX,D.originY);if(B.lockRotation)return!1;var tt=Math.atan2(D.ey-H.y,D.ex-H.x),Q=Math.atan2(L-H.y,I-H.x),F=u(Q-tt+D.theta),$=!0;if(B.snapAngle>0){var et=B.snapAngle,it=B.snapThreshold||et,nt=Math.ceil(F/et)*et,rt=Math.floor(F/et)*et;Math.abs(F-rt)d?(A=u,t.scale(1,d/u),T=a*u/d):d>u?(A=d,t.scale(u/d,1),_=n*d/u):A=u,t.lineWidth=1,t.beginPath(),t.arc(_,T,A/2,0,2*Math.PI,!1),t[p](),v&&t.stroke(),t.restore()}function r(t,n,a,i,l){i=i||{};var u=this.sizeX||i.cornerSize||l.cornerSize,d=this.sizeY||i.cornerSize||l.cornerSize,g=typeof i.transparentCorners<"u"?i.transparentCorners:l.transparentCorners,p=g?"stroke":"fill",v=!g&&(i.cornerStrokeColor||l.cornerStrokeColor),_=u/2,T=d/2;t.save(),t.fillStyle=i.cornerColor||l.cornerColor,t.strokeStyle=i.cornerStrokeColor||l.cornerStrokeColor,t.lineWidth=1,t.translate(n,a),t.rotate(h(l.angle)),t[p+"Rect"](-_,-T,u,d),v&&t.strokeRect(-_,-T,u,d),t.restore()}o.renderCircleControl=e,o.renderSquareControl=r}(Z),function(c){var s=c.fabric||(c.fabric={});function h(o){for(var e in o)this[e]=o[e]}s.Control=h,s.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(o,e){return e.cursorStyle},getActionName:function(o,e){return e.actionName},getVisibility:function(o,e){var r=o._controlsVisibility;return r&&typeof r[e]<"u"?r[e]:this.visible},setVisibility:function(o){this.visible=o},positionHandler:function(o,e){var r=s.util.transformPoint({x:this.x*o.x+this.offsetX,y:this.y*o.y+this.offsetY},e);return r},calcCornerCoords:function(o,e,r,t,n){var a,i,l,u,d=n?this.touchSizeX:this.sizeX,g=n?this.touchSizeY:this.sizeY;if(d&&g&&d!==g){var p=Math.atan2(g,d),v=Math.sqrt(d*d+g*g)/2,_=p-s.util.degreesToRadians(o),T=Math.PI/2-p-s.util.degreesToRadians(o);a=v*s.util.cos(_),i=v*s.util.sin(_),l=v*s.util.cos(T),u=v*s.util.sin(T)}else{var A=d&&g?d:e;v=A*.7071067812;var _=s.util.degreesToRadians(45-o);a=l=v*s.util.cos(_),i=u=v*s.util.sin(_)}return{tl:{x:r-u,y:t-l},tr:{x:r+a,y:t-i},bl:{x:r-a,y:t+i},br:{x:r+u,y:t+l}}},render:function(o,e,r,t,n){switch(t=t||{},t.cornerStyle||n.cornerStyle){case"circle":s.controlsUtils.renderCircleControl.call(this,o,e,r,t,n);break;default:s.controlsUtils.renderSquareControl.call(this,o,e,r,t,n)}}}}(Z),function(){function c(r,t){var n=r.getAttribute("style"),a=r.getAttribute("offset")||0,i,l,u,d;if(a=parseFloat(a)/(/%$/.test(a)?100:1),a=a<0?0:a>1?1:a,n){var g=n.split(/\s*;\s*/);for(g[g.length-1]===""&&g.pop(),d=g.length;d--;){var p=g[d].split(/\s*:\s*/),v=p[0].trim(),_=p[1].trim();v==="stop-color"?i=_:v==="stop-opacity"&&(u=_)}}return i||(i=r.getAttribute("stop-color")||"rgb(0,0,0)"),u||(u=r.getAttribute("stop-opacity")),i=new f.Color(i),l=i.getAlpha(),u=isNaN(parseFloat(u))?1:parseFloat(u),u*=l*t,{offset:a,color:i.toRgb(),opacity:u}}function s(r){return{x1:r.getAttribute("x1")||0,y1:r.getAttribute("y1")||0,x2:r.getAttribute("x2")||"100%",y2:r.getAttribute("y2")||0}}function h(r){return{x1:r.getAttribute("fx")||r.getAttribute("cx")||"50%",y1:r.getAttribute("fy")||r.getAttribute("cy")||"50%",r1:0,x2:r.getAttribute("cx")||"50%",y2:r.getAttribute("cy")||"50%",r2:r.getAttribute("r")||"50%"}}var o=f.util.object.clone;f.Gradient=f.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(r){r||(r={}),r.coords||(r.coords={});var t,n=this;Object.keys(r).forEach(function(a){n[a]=r[a]}),this.id?this.id+="_"+f.Object.__uid++:this.id=f.Object.__uid++,t={x1:r.coords.x1||0,y1:r.coords.y1||0,x2:r.coords.x2||0,y2:r.coords.y2||0},this.type==="radial"&&(t.r1=r.coords.r1||0,t.r2=r.coords.r2||0),this.coords=t,this.colorStops=r.colorStops.slice()},addColorStop:function(r){for(var t in r){var n=new f.Color(r[t]);this.colorStops.push({offset:parseFloat(t),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(r){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return f.util.populateWithProperties(this,t,r),t},toSVG:function(r,l){var n=o(this.coords,!0),a,i,l=l||{},u,d,g=o(this.colorStops,!0),p=n.r1>n.r2,v=this.gradientTransform?this.gradientTransform.concat():f.iMatrix.concat(),_=-this.offsetX,T=-this.offsetY,A=!!l.additionalTransform,X=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(g.sort(function(G,q){return G.offset-q.offset}),X==="objectBoundingBox"?(_/=r.width,T/=r.height):(_+=r.width/2,T+=r.height/2),r.type==="path"&&this.gradientUnits!=="percentage"&&(_-=r.pathOffset.x,T-=r.pathOffset.y),v[4]-=_,v[5]-=T,d='id="SVGID_'+this.id+'" gradientUnits="'+X+'"',d+=' gradientTransform="'+(A?l.additionalTransform+" ":"")+f.util.matrixToSVG(v)+'" ',this.type==="linear"?u=[" -`]:this.type==="radial"&&(u=[" -`]),this.type==="radial"){if(p)for(g=g.concat(),g.reverse(),a=0,i=g.length;a0){var N=Math.max(n.r1,n.r2),V=W/N;for(a=0,i=g.length;a -`)}return u.push(this.type==="linear"?` -`:` -`),u.join("")},toLive:function(r){var t,n=f.util.object.clone(this.coords),a,i;if(this.type){for(this.type==="linear"?t=r.createLinearGradient(n.x1,n.y1,n.x2,n.y2):this.type==="radial"&&(t=r.createRadialGradient(n.x1,n.y1,n.r1,n.x2,n.y2,n.r2)),a=0,i=this.colorStops.length;a1?1:i,isNaN(i)&&(i=1);var l=r.getElementsByTagName("stop"),u,d=r.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",g=r.getAttribute("gradientTransform")||"",p=[],v,_,T=0,A=0,X;for(r.nodeName==="linearGradient"||r.nodeName==="LINEARGRADIENT"?(u="linear",v=s(r)):(u="radial",v=h(r)),_=l.length;_--;)p.push(c(l[_],i));X=f.parseTransformAttribute(g),e(t,v,a,d),d==="pixels"&&(T=-t.left,A=-t.top);var W=new f.Gradient({id:r.getAttribute("id"),type:u,coords:v,colorStops:p,gradientUnits:d,gradientTransform:X,offsetX:T,offsetY:A});return W}});function e(r,t,n,a){var i,l;Object.keys(t).forEach(function(u){i=t[u],i==="Infinity"?l=1:i==="-Infinity"?l=0:(l=parseFloat(t[u],10),typeof i=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(l*=.01,a==="pixels"&&((u==="x1"||u==="x2"||u==="r2")&&(l*=n.viewBoxWidth||n.width),(u==="y1"||u==="y2")&&(l*=n.viewBoxHeight||n.height)))),t[u]=l})}}(),function(){var c=f.util.toFixed;f.Pattern=f.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(s,h){if(s||(s={}),this.id=f.Object.__uid++,this.setOptions(s),!s.source||s.source&&typeof s.source!="string"){h&&h(this);return}else{var o=this;this.source=f.util.createImage(),f.util.loadImage(s.source,function(e,r){o.source=e,h&&h(o,r)},null,this.crossOrigin)}},toObject:function(s){var h=f.Object.NUM_FRACTION_DIGITS,o,e;return typeof this.source.src=="string"?o=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(o=this.source.toDataURL()),e={type:"pattern",source:o,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:c(this.offsetX,h),offsetY:c(this.offsetY,h),patternTransform:this.patternTransform?this.patternTransform.concat():null},f.util.populateWithProperties(this,e,s),e},toSVG:function(s){var h=typeof this.source=="function"?this.source():this.source,o=h.width/s.width,e=h.height/s.height,r=this.offsetX/s.width,t=this.offsetY/s.height,n="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(e=1,t&&(e+=Math.abs(t))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(o=1,r&&(o+=Math.abs(r))),h.src?n=h.src:h.toDataURL&&(n=h.toDataURL()),' - - -`},setOptions:function(s){for(var h in s)this[h]=s[h]},toLive:function(s){var h=this.source;return!h||typeof h.src<"u"&&(!h.complete||h.naturalWidth===0||h.naturalHeight===0)?"":s.createPattern(h,this.repeat)}})}(),function(c){var s=c.fabric||(c.fabric={}),h=s.util.toFixed;if(s.Shadow){s.warn("fabric.Shadow is already defined.");return}s.Shadow=s.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(o){typeof o=="string"&&(o=this._parseShadow(o));for(var e in o)this[e]=o[e];this.id=s.Object.__uid++},_parseShadow:function(o){var e=o.trim(),r=s.Shadow.reOffsetsAndBlur.exec(e)||[],t=e.replace(s.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:t.trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(o){var e=40,r=40,t=s.Object.NUM_FRACTION_DIGITS,n=s.util.rotateVector({x:this.offsetX,y:this.offsetY},s.util.degreesToRadians(-o.angle)),a=20,i=new s.Color(this.color);return o.width&&o.height&&(e=h((Math.abs(n.x)+this.blur)/o.width,t)*100+a,r=h((Math.abs(n.y)+this.blur)/o.height,t)*100+a),o.flipX&&(n.x*=-1),o.flipY&&(n.y*=-1),' - - - - - - - - - -`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var o={},e=s.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(r){this[r]!==e[r]&&(o[r]=this[r])},this),o}}),s.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(Z),function(){if(f.StaticCanvas){f.warn("fabric.StaticCanvas is already defined.");return}var c=f.util.object.extend,s=f.util.getElementOffset,h=f.util.removeFromArray,o=f.util.toFixed,e=f.util.transformPoint,r=f.util.invertTransform,t=f.util.getNodeCanvas,n=f.util.createCanvasElement,a=new Error("Could not initialize `canvas` element");f.StaticCanvas=f.util.createClass(f.CommonMethods,{initialize:function(i,l){l||(l={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(i,l)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:f.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(i,l){var u=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(i),this._initOptions(l),this.interactive||this._initRetinaScaling(),l.overlayImage&&this.setOverlayImage(l.overlayImage,u),l.backgroundImage&&this.setBackgroundImage(l.backgroundImage,u),l.backgroundColor&&this.setBackgroundColor(l.backgroundColor,u),l.overlayColor&&this.setOverlayColor(l.overlayColor,u),this.calcOffset()},_isRetinaScaling:function(){return f.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,f.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var i=f.devicePixelRatio;this.__initRetinaScaling(i,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(i,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(i,l,u){l.setAttribute("width",this.width*i),l.setAttribute("height",this.height*i),u.scale(i,i)},calcOffset:function(){return this._offset=s(this.lowerCanvasEl),this},setOverlayImage:function(i,l,u){return this.__setBgOverlayImage("overlayImage",i,l,u)},setBackgroundImage:function(i,l,u){return this.__setBgOverlayImage("backgroundImage",i,l,u)},setOverlayColor:function(i,l){return this.__setBgOverlayColor("overlayColor",i,l)},setBackgroundColor:function(i,l){return this.__setBgOverlayColor("backgroundColor",i,l)},__setBgOverlayImage:function(i,l,u,d){return typeof l=="string"?f.util.loadImage(l,function(g,p){if(g){var v=new f.Image(g,d);this[i]=v,v.canvas=this}u&&u(g,p)},this,d&&d.crossOrigin):(d&&l.setOptions(d),this[i]=l,l&&(l.canvas=this),u&&u(l,!1)),this},__setBgOverlayColor:function(i,l,u){return this[i]=l,this._initGradient(l,i),this._initPattern(l,i,u),this},_createCanvasElement:function(){var i=n();if(!i||(i.style||(i.style={}),typeof i.getContext>"u"))throw a;return i},_initOptions:function(i){var l=this.lowerCanvasEl;this._setOptions(i),this.width=this.width||parseInt(l.width,10)||0,this.height=this.height||parseInt(l.height,10)||0,this.lowerCanvasEl.style&&(l.width=this.width,l.height=this.height,l.style.width=this.width+"px",l.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(i){i&&i.getContext?this.lowerCanvasEl=i:this.lowerCanvasEl=f.util.getById(i)||this._createCanvasElement(),f.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(i,l){return this.setDimensions({width:i},l)},setHeight:function(i,l){return this.setDimensions({height:i},l)},setDimensions:function(i,l){var u;l=l||{};for(var d in i)u=i[d],l.cssOnly||(this._setBackstoreDimension(d,i[d]),u+="px",this.hasLostContext=!0),l.backstoreOnly||this._setCssDimension(d,u);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),l.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(i,l){return this.lowerCanvasEl[i]=l,this.upperCanvasEl&&(this.upperCanvasEl[i]=l),this.cacheCanvasEl&&(this.cacheCanvasEl[i]=l),this[i]=l,this},_setCssDimension:function(i,l){return this.lowerCanvasEl.style[i]=l,this.upperCanvasEl&&(this.upperCanvasEl.style[i]=l),this.wrapperEl&&(this.wrapperEl.style[i]=l),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(i){var l=this._activeObject,u=this.backgroundImage,d=this.overlayImage,g,p,v;for(this.viewportTransform=i,p=0,v=this._objects.length;p -`),this._setSVGBgOverlayColor(u,"background"),this._setSVGBgOverlayImage(u,"backgroundImage",l),this._setSVGObjects(u,l),this.clipPath&&u.push(` -`),this._setSVGBgOverlayColor(u,"overlay"),this._setSVGBgOverlayImage(u,"overlayImage",l),u.push(""),u.join("")},_setSVGPreamble:function(i,l){l.suppressPreamble||i.push(' -`,' -`)},_setSVGHeader:function(i,l){var u=l.width||this.width,d=l.height||this.height,g,p='viewBox="0 0 '+this.width+" "+this.height+'" ',v=f.Object.NUM_FRACTION_DIGITS;l.viewBox?p='viewBox="'+l.viewBox.x+" "+l.viewBox.y+" "+l.viewBox.width+" "+l.viewBox.height+'" ':this.svgViewportTransformation&&(g=this.viewportTransform,p='viewBox="'+o(-g[4]/g[0],v)+" "+o(-g[5]/g[3],v)+" "+o(this.width/g[0],v)+" "+o(this.height/g[3],v)+'" '),i.push(" -`,"Created with Fabric.js ",f.version,` -`,` -`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(l),` -`)},createSVGClipPathMarkup:function(i){var l=this.clipPath;return l?(l.clipPathId="CLIPPATH_"+f.Object.__uid++,' -`+this.clipPath.toClipPathSVG(i.reviver)+` -`):""},createSVGRefElementsMarkup:function(){var i=this,l=["background","overlay"].map(function(u){var d=i[u+"Color"];if(d&&d.toLive){var g=i[u+"Vpt"],p=i.viewportTransform,v={width:i.width/(g?p[0]:1),height:i.height/(g?p[3]:1)};return d.toSVG(v,{additionalTransform:g?f.util.matrixToSVG(p):""})}});return l.join("")},createSVGFontFacesMarkup:function(){var i="",l={},u,d,g,p,v,_,T,A,X,W=f.fontPaths,N=[];for(this._objects.forEach(function U(G){N.push(G),G._objects&&G._objects.forEach(U)}),A=0,X=N.length;A',` -`,i,"",` -`].join("")),i},_setSVGObjects:function(i,l){var u,d,g,p=this._objects;for(d=0,g=p.length;d -`)}else i.push(' -`)},sendToBack:function(i){if(!i)return this;var l=this._activeObject,u,d,g;if(i===l&&i.type==="activeSelection")for(g=l._objects,u=g.length;u--;)d=g[u],h(this._objects,d),this._objects.unshift(d);else h(this._objects,i),this._objects.unshift(i);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(i){if(!i)return this;var l=this._activeObject,u,d,g;if(i===l&&i.type==="activeSelection")for(g=l._objects,u=0;u0+T&&(v=p-1,h(this._objects,g),this._objects.splice(v,0,g)),T++;else p=this._objects.indexOf(i),p!==0&&(v=this._findNewLowerIndex(i,p,l),h(this._objects,i),this._objects.splice(v,0,i));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(i,l,u){var d,g;if(u)for(d=l,g=l-1;g>=0;--g){var p=i.intersectsWithObject(this._objects[g])||i.isContainedWithinObject(this._objects[g])||this._objects[g].isContainedWithinObject(i);if(p){d=g;break}}else d=l-1;return d},bringForward:function(i,l){if(!i)return this;var u=this._activeObject,d,g,p,v,_,T=0;if(i===u&&i.type==="activeSelection")for(_=u._objects,d=_.length;d--;)g=_[d],p=this._objects.indexOf(g),p"}}),c(f.StaticCanvas.prototype,f.Observable),c(f.StaticCanvas.prototype,f.Collection),c(f.StaticCanvas.prototype,f.DataURLExporter),c(f.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(i){var l=n();if(!l||!l.getContext)return null;var u=l.getContext("2d");if(!u)return null;switch(i){case"setLineDash":return typeof u.setLineDash<"u";default:return null}}}),f.StaticCanvas.prototype.toJSON=f.StaticCanvas.prototype.toObject,f.isLikelyNode&&(f.StaticCanvas.prototype.createPNGStream=function(){var i=t(this.lowerCanvasEl);return i&&i.createPNGStream()},f.StaticCanvas.prototype.createJPEGStream=function(i){var l=t(this.lowerCanvasEl);return l&&l.createJPEGStream(i)})}(),f.BaseBrush=f.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(c){c.strokeStyle=this.color,c.lineWidth=this.width,c.lineCap=this.strokeLineCap,c.miterLimit=this.strokeMiterLimit,c.lineJoin=this.strokeLineJoin,c.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(c){var s=this.canvas.viewportTransform;c.save(),c.transform(s[0],s[1],s[2],s[3],s[4],s[5])},_setShadow:function(){if(this.shadow){var c=this.canvas,s=this.shadow,h=c.contextTop,o=c.getZoom();c&&c._isRetinaScaling()&&(o*=f.devicePixelRatio),h.shadowColor=s.color,h.shadowBlur=s.blur*o,h.shadowOffsetX=s.offsetX*o,h.shadowOffsetY=s.offsetY*o}},needsFullRender:function(){var c=new f.Color(this.color);return c.getAlpha()<1||!!this.shadow},_resetShadow:function(){var c=this.canvas.contextTop;c.shadowColor="",c.shadowBlur=c.shadowOffsetX=c.shadowOffsetY=0},_isOutSideCanvas:function(c){return c.x<0||c.x>this.canvas.getWidth()||c.y<0||c.y>this.canvas.getHeight()}}),function(){f.PencilBrush=f.util.createClass(f.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(c){this.canvas=c,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(c,s,h){var o=s.midPointFrom(h);return c.quadraticCurveTo(s.x,s.y,o.x,o.y),o},onMouseDown:function(c,s){this.canvas._isMainEvent(s.e)&&(this.drawStraightLine=s.e[this.straightLineKey],this._prepareForDrawing(c),this._captureDrawingPath(c),this._render())},onMouseMove:function(c,s){if(this.canvas._isMainEvent(s.e)&&(this.drawStraightLine=s.e[this.straightLineKey],!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(c))&&this._captureDrawingPath(c)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var h=this._points,o=h.length,e=this.canvas.contextTop;this._saveAndTransform(e),this.oldEnd&&(e.beginPath(),e.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(e,h[o-2],h[o-1],!0),e.stroke(),e.restore()}},onMouseUp:function(c){return this.canvas._isMainEvent(c.e)?(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(c){var s=new f.Point(c.x,c.y);this._reset(),this._addPoint(s),this.canvas.contextTop.moveTo(s.x,s.y)},_addPoint:function(c){return this._points.length>1&&c.eq(this._points[this._points.length-1])?!1:(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(c),!0)},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(c){var s=new f.Point(c.x,c.y);return this._addPoint(s)},_render:function(c){var s,h,o=this._points[0],e=this._points[1];if(c=c||this.canvas.contextTop,this._saveAndTransform(c),c.beginPath(),this._points.length===2&&o.x===e.x&&o.y===e.y){var r=this.width/1e3;o=new f.Point(o.x,o.y),e=new f.Point(e.x,e.y),o.x-=r,e.x+=r}for(c.moveTo(o.x,o.y),s=1,h=this._points.length;s=o&&(t=c[e],n.push(t));return n.push(c[r]),n},_finalizeAndAddPath:function(){var c=this.canvas.contextTop;c.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var s=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(s)){this.canvas.requestRenderAll();return}var h=this.createPath(s);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:h}),this.canvas.add(h),this.canvas.requestRenderAll(),h.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:h})}})}(),f.CircleBrush=f.util.createClass(f.BaseBrush,{width:10,initialize:function(c){this.canvas=c,this.points=[]},drawDot:function(c){var s=this.addPoint(c),h=this.canvas.contextTop;this._saveAndTransform(h),this.dot(h,s),h.restore()},dot:function(c,s){c.fillStyle=s.fill,c.beginPath(),c.arc(s.x,s.y,s.radius,0,Math.PI*2,!1),c.closePath(),c.fill()},onMouseDown:function(c){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(c)},_render:function(){var c=this.canvas.contextTop,s,h,o=this.points;for(this._saveAndTransform(c),s=0,h=o.length;s0&&!this.preserveObjectStacking){t=[],n=[];for(var a=0,i=this._objects.length;a1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,r){var t=e.calcTransformMatrix(),n=f.util.invertTransform(t),a=this.restorePointerVpt(r);return f.util.transformPoint(a,n)},isTargetTransparent:function(e,r,t){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var n=this._normalizePointer(e,{x:r,y:t}),a=Math.max(e.cacheTranslationX+n.x*e.zoomX,0),i=Math.max(e.cacheTranslationY+n.y*e.zoomY,0),g=f.util.isTransparent(e._cacheContext,Math.round(a),Math.round(i),this.targetFindTolerance);return g}var l=this.contextCache,u=e.selectionBackgroundColor,d=this.viewportTransform;e.selectionBackgroundColor="",this.clearContext(l),l.save(),l.transform(d[0],d[1],d[2],d[3],d[4],d[5]),e.render(l),l.restore(),e.selectionBackgroundColor=u;var g=f.util.isTransparent(l,r,t,this.targetFindTolerance);return g},_isSelectionKeyPressed:function(e){var r=!1;return Array.isArray(this.selectionKey)?r=!!this.selectionKey.find(function(t){return e[t]===!0}):r=e[this.selectionKey],r},_shouldClearSelection:function(e,r){var t=this.getActiveObjects(),n=this._activeObject;return!r||r&&n&&t.length>1&&t.indexOf(r)===-1&&n!==r&&!this._isSelectionKeyPressed(e)||r&&!r.evented||r&&!r.selectable&&n&&n!==r},_shouldCenterTransform:function(e,r,t){if(e){var n;return r==="scale"||r==="scaleX"||r==="scaleY"||r==="resizing"?n=this.centeredScaling||e.centeredScaling:r==="rotate"&&(n=this.centeredRotation||e.centeredRotation),n?!t:t}},_getOriginFromCorner:function(e,r){var t={x:e.originX,y:e.originY};return r==="ml"||r==="tl"||r==="bl"?t.x="right":(r==="mr"||r==="tr"||r==="br")&&(t.x="left"),r==="tl"||r==="mt"||r==="tr"?t.y="bottom":(r==="bl"||r==="mb"||r==="br")&&(t.y="top"),t},_getActionFromCorner:function(e,r,t,n){if(!r||!e)return"drag";var a=n.controls[r];return a.getActionName(t,a,n)},_setupCurrentTransform:function(e,r,t){if(r){var n=this.getPointer(e),a=r.__corner,i=r.controls[a],l=t&&a?i.getActionHandler(e,r,i):f.controlsUtils.dragHandler,u=this._getActionFromCorner(t,a,e,r),d=this._getOriginFromCorner(r,a),g=e[this.centeredKey],p={target:r,action:u,actionHandler:l,corner:a,scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,offsetX:n.x-r.left,offsetY:n.y-r.top,originX:d.x,originY:d.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:s(r.angle),width:r.width*r.scaleX,shiftKey:e.shiftKey,altKey:g,original:f.util.saveObjectTransform(r)};this._shouldCenterTransform(r,u,g)&&(p.originX="center",p.originY="center"),p.original.originX=d.x,p.original.originY=d.y,this._currentTransform=p,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var r=this._groupSelector,t=new f.Point(r.ex,r.ey),n=f.util.transformPoint(t,this.viewportTransform),a=new f.Point(r.ex+r.left,r.ey+r.top),i=f.util.transformPoint(a,this.viewportTransform),l=Math.min(n.x,i.x),u=Math.min(n.y,i.y),d=Math.max(n.x,i.x),g=Math.max(n.y,i.y),p=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(l,u,d-l,g-u)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,l+=p,u+=p,d-=p,g-=p,f.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(l,u,d-l,g-u))},findTarget:function(e,r){if(!this.skipTargetFind){var t=!0,n=this.getPointer(e,t),a=this._activeObject,i=this.getActiveObjects(),l,u,d=h(e),g=i.length>1&&!r||i.length===1;if(this.targets=[],g&&a._findTargetCorner(n,d)||i.length>1&&!r&&a===this._searchPossibleTargets([a],n))return a;if(i.length===1&&a===this._searchPossibleTargets([a],n))if(this.preserveObjectStacking)l=a,u=this.targets,this.targets=[];else return a;var p=this._searchPossibleTargets(this._objects,n);return e[this.altSelectionKey]&&p&&l&&p!==l&&(p=l,this.targets=u),p}},_checkTarget:function(e,r,t){if(r&&r.visible&&r.evented&&r.containsPoint(e))if((this.perPixelTargetFind||r.perPixelTargetFind)&&!r.isEditing){var n=this.isTargetTransparent(r,t.x,t.y);if(!n)return!0}else return!0},_searchPossibleTargets:function(e,r){for(var t,n=e.length,a;n--;){var i=e[n],l=i.group?this._normalizePointer(i.group,r):r;if(this._checkTarget(l,i,r)){t=e[n],t.subTargetCheck&&t instanceof f.Group&&(a=this._searchPossibleTargets(t._objects,r),a&&this.targets.push(a));break}}return t},restorePointerVpt:function(e){return f.util.transformPoint(e,f.util.invertTransform(this.viewportTransform))},getPointer:function(e,r){if(this._absolutePointer&&!r)return this._absolutePointer;if(this._pointer&&r)return this._pointer;var t=c(e),n=this.upperCanvasEl,a=n.getBoundingClientRect(),i=a.width||0,l=a.height||0,u;(!i||!l)&&("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(i=Math.abs(a.right-a.left))),this.calcOffset(),t.x=t.x-this._offset.left,t.y=t.y-this._offset.top,r||(t=this.restorePointerVpt(t));var d=this.getRetinaScaling();return d!==1&&(t.x/=d,t.y/=d),i===0||l===0?u={width:1,height:1}:u={width:n.width/i,height:n.height/l},{x:t.x*u.width,y:t.y*u.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),r=this.lowerCanvasEl,t=this.upperCanvasEl;t?t.className="":(t=this._createCanvasElement(),this.upperCanvasEl=t),f.util.addClass(t,"upper-canvas "+e),this.wrapperEl.appendChild(t),this._copyCanvasStyle(r,t),this._applyCanvasStyle(t),this.contextTop=t.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=f.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),f.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),f.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var r=this.width||e.width,t=this.height||e.height;f.util.setStyle(e,{position:"absolute",width:r+"px",height:t+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=r,e.height=t,f.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,r){r.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?e.type==="activeSelection"&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,r){var t=!1,n=this.getActiveObjects(),a=[],i=[];e.forEach(function(l){n.indexOf(l)===-1&&(t=!0,l.fire("deselected",{e:r,target:l}),i.push(l))}),n.forEach(function(l){e.indexOf(l)===-1&&(t=!0,l.fire("selected",{e:r,target:l}),a.push(l))}),e.length>0&&n.length>0?t&&this.fire("selection:updated",{e:r,selected:a,deselected:i}):n.length>0?this.fire("selection:created",{e:r,selected:a}):e.length>0&&this.fire("selection:cleared",{e:r,deselected:i})},setActiveObject:function(e,r){var t=this.getActiveObjects();return this._setActiveObject(e,r),this._fireSelectionEvents(t,r),this},_setActiveObject:function(e,r){return this._activeObject===e||!this._discardActiveObject(r,e)||e.onSelect({e:r})?!1:(this._activeObject=e,!0)},_discardActiveObject:function(e,r){var t=this._activeObject;if(t){if(t.onDeselect({e,object:r}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var r=this.getActiveObjects(),t=this.getActiveObject();return r.length&&this.fire("before:selection:cleared",{target:t,e}),this._discardActiveObject(e),this._fireSelectionEvents(r,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(r){f.util.cleanUpJsdomNode(this[r]),this[r]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,f.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var r=this._activeObject;r&&r._renderControls(e)},_toObject:function(e,r,t){var n=this._realizeGroupTransformOnObject(e),a=this.callSuper("_toObject",e,r,t);return this._unwindGroupTransformOnObject(e,n),a},_realizeGroupTransformOnObject:function(e){if(e.group&&e.group.type==="activeSelection"&&this._activeObject===e.group){var r=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],t={};return r.forEach(function(n){t[n]=e[n]}),f.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}else return null},_unwindGroupTransformOnObject:function(e,r){r&&e.set(r)},_setSVGObject:function(e,r,t){var n=this._realizeGroupTransformOnObject(r);this.callSuper("_setSVGObject",e,r,t),this._unwindGroupTransformOnObject(r,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),f.StaticCanvas.prototype.setViewportTransform.call(this,e)}});for(var o in f.StaticCanvas)o!=="prototype"&&(f.Canvas[o]=f.StaticCanvas[o])}(),function(){var c=f.util.addListener,s=f.util.removeListener,h=3,o=2,e=1,r={passive:!1};function t(n,a){return n.button&&n.button===a-1}f.util.object.extend(f.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(c,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(n,a){var i=this.upperCanvasEl,l=this._getEventPrefix();n(f.window,"resize",this._onResize),n(i,l+"down",this._onMouseDown),n(i,l+"move",this._onMouseMove,r),n(i,l+"out",this._onMouseOut),n(i,l+"enter",this._onMouseEnter),n(i,"wheel",this._onMouseWheel),n(i,"contextmenu",this._onContextMenu),n(i,"dblclick",this._onDoubleClick),n(i,"dragover",this._onDragOver),n(i,"dragenter",this._onDragEnter),n(i,"dragleave",this._onDragLeave),n(i,"drop",this._onDrop),this.enablePointerEvents||n(i,"touchstart",this._onTouchStart,r),typeof eventjs<"u"&&a in eventjs&&(eventjs[a](i,"gesture",this._onGesture),eventjs[a](i,"drag",this._onDrag),eventjs[a](i,"orientation",this._onOrientationChange),eventjs[a](i,"shake",this._onShake),eventjs[a](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(s,"remove");var n=this._getEventPrefix();s(f.document,n+"up",this._onMouseUp),s(f.document,"touchend",this._onTouchEnd,r),s(f.document,n+"move",this._onMouseMove,r),s(f.document,"touchmove",this._onMouseMove,r)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(n,a){this.__onTransformGesture&&this.__onTransformGesture(n,a)},_onDrag:function(n,a){this.__onDrag&&this.__onDrag(n,a)},_onMouseWheel:function(n){this.__onMouseWheel(n)},_onMouseOut:function(n){var a=this._hoveredTarget;this.fire("mouse:out",{target:a,e:n}),this._hoveredTarget=null,a&&a.fire("mouseout",{e:n});var i=this;this._hoveredTargets.forEach(function(l){i.fire("mouse:out",{target:a,e:n}),l&&a.fire("mouseout",{e:n})}),this._hoveredTargets=[]},_onMouseEnter:function(n){!this._currentTransform&&!this.findTarget(n)&&(this.fire("mouse:over",{target:null,e:n}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(n,a){this.__onOrientationChange&&this.__onOrientationChange(n,a)},_onShake:function(n,a){this.__onShake&&this.__onShake(n,a)},_onLongPress:function(n,a){this.__onLongPress&&this.__onLongPress(n,a)},_onDragOver:function(n){n.preventDefault();var a=this._simpleEventHandler("dragover",n);this._fireEnterLeaveEvents(a,n)},_onDrop:function(n){return this._simpleEventHandler("drop:before",n),this._simpleEventHandler("drop",n)},_onContextMenu:function(n){return this.stopContextMenu&&(n.stopPropagation(),n.preventDefault()),!1},_onDoubleClick:function(n){this._cacheTransformEventData(n),this._handleEvent(n,"dblclick"),this._resetTransformEventData(n)},getPointerId:function(n){var a=n.changedTouches;return a?a[0]&&a[0].identifier:this.enablePointerEvents?n.pointerId:-1},_isMainEvent:function(n){return n.isPrimary===!0?!0:n.isPrimary===!1?!1:n.type==="touchend"&&n.touches.length===0?!0:n.changedTouches?n.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(n){n.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();c(f.document,"touchend",this._onTouchEnd,r),c(f.document,"touchmove",this._onMouseMove,r),s(a,i+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();s(a,i+"move",this._onMouseMove,r),c(f.document,i+"up",this._onMouseUp),c(f.document,i+"move",this._onMouseMove,r)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var a=this._getEventPrefix();s(f.document,"touchend",this._onTouchEnd,r),s(f.document,"touchmove",this._onMouseMove,r);var i=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){c(i.upperCanvasEl,a+"down",i._onMouseDown),i._willAddMouseDown=0},400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();this._isMainEvent(n)&&(s(f.document,i+"up",this._onMouseUp),s(f.document,i+"move",this._onMouseMove,r),c(a,i+"move",this._onMouseMove,r))},_onMouseMove:function(n){!this.allowTouchScrolling&&n.preventDefault&&n.preventDefault(),this.__onMouseMove(n)},_onResize:function(){this.calcOffset()},_shouldRender:function(n){var a=this._activeObject;return!!a!=!!n||a&&n&&a!==n?!0:(a&&a.isEditing,!1)},__onMouseUp:function(n){var a,i=this._currentTransform,l=this._groupSelector,u=!1,d=!l||l.left===0&&l.top===0;if(this._cacheTransformEventData(n),a=this._target,this._handleEvent(n,"up:before"),t(n,h)){this.fireRightClick&&this._handleEvent(n,"up",h,d);return}if(t(n,o)){this.fireMiddleClick&&this._handleEvent(n,"up",o,d),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(n);return}if(this._isMainEvent(n)){if(i&&(this._finalizeCurrentTransform(n),u=i.actionPerformed),!d){var g=a===this._activeObject;this._maybeGroupObjects(n),u||(u=this._shouldRender(a)||!g&&a===this._activeObject)}var p,v;if(a){if(p=a._findTargetCorner(this.getPointer(n,!0),f.util.isTouchEvent(n)),a.selectable&&a!==this._activeObject&&a.activeOn==="up")this.setActiveObject(a,n),u=!0;else{var _=a.controls[p],T=_&&_.getMouseUpHandler(n,a,_);T&&(v=this.getPointer(n),T(n,i,v.x,v.y))}a.isMoving=!1}if(i&&(i.target!==a||i.corner!==p)){var A=i.target&&i.target.controls[i.corner],X=A&&A.getMouseUpHandler(n,a,_);v=v||this.getPointer(n),X&&X(n,i,v.x,v.y)}this._setCursorFromEvent(n,a),this._handleEvent(n,"up",e,d),this._groupSelector=null,this._currentTransform=null,a&&(a.__corner=0),u?this.requestRenderAll():d||this.renderTop()}},_simpleEventHandler:function(n,a){var i=this.findTarget(a),l=this.targets,u={e:a,target:i,subTargets:l};if(this.fire(n,u),i&&i.fire(n,u),!l)return i;for(var d=0;d1&&(e=new f.ActiveSelection(o.reverse(),{canvas:this}),this.setActiveObject(e,h))},_collectObjects:function(h){for(var o=[],e,r=this._groupSelector.ex,t=this._groupSelector.ey,n=r+this._groupSelector.left,a=t+this._groupSelector.top,i=new f.Point(c(r,n),c(t,a)),l=new f.Point(s(r,n),s(t,a)),u=!this.selectionFullyContained,d=r===n&&t===a,g=this._objects.length;g--&&(e=this._objects[g],!(!(!e||!e.selectable||!e.visible)&&(u&&e.intersectsWithRect(i,l,!0)||e.isContainedWithinRect(i,l,!0)||u&&e.containsPoint(i,null,!0)||u&&e.containsPoint(l,null,!0))&&(o.push(e),d))););return o.length>1&&(o=o.filter(function(p){return!p.onSelect({e:h})})),o},_maybeGroupObjects:function(h){this.selection&&this._groupSelector&&this._groupSelectedObjects(h),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){f.util.object.extend(f.StaticCanvas.prototype,{toDataURL:function(c){c||(c={});var s=c.format||"png",h=c.quality||1,o=(c.multiplier||1)*(c.enableRetinaScaling?this.getRetinaScaling():1),e=this.toCanvasElement(o,c);return f.util.toDataURL(e,s,h)},toCanvasElement:function(c,s){c=c||1,s=s||{};var h=(s.width||this.width)*c,o=(s.height||this.height)*c,e=this.getZoom(),r=this.width,t=this.height,n=e*c,a=this.viewportTransform,i=(a[4]-(s.left||0))*c,l=(a[5]-(s.top||0))*c,u=this.interactive,d=[n,0,0,n,i,l],g=this.enableRetinaScaling,p=f.util.createCanvasElement(),v=this.contextTop;return p.width=h,p.height=o,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=d,this.width=h,this.height=o,this.calcViewportBoundaries(),this.renderCanvas(p.getContext("2d"),this._objects),this.viewportTransform=a,this.width=r,this.height=t,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=g,this.contextTop=v,p}})}(),f.util.object.extend(f.StaticCanvas.prototype,{loadFromJSON:function(c,s,h){if(c){var o=typeof c=="string"?JSON.parse(c):f.util.object.clone(c),e=this,r=o.clipPath,t=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete o.clipPath,this._enlivenObjects(o.objects,function(n){e.clear(),e._setBgOverlay(o,function(){r?e._enlivenObjects([r],function(a){e.clipPath=a[0],e.__setupCanvas.call(e,o,n,t,s)}):e.__setupCanvas.call(e,o,n,t,s)})},h),this}},__setupCanvas:function(c,s,h,o){var e=this;s.forEach(function(r,t){e.insertAt(r,t)}),this.renderOnAddRemove=h,delete c.objects,delete c.backgroundImage,delete c.overlayImage,delete c.background,delete c.overlay,this._setOptions(c),this.renderAll(),o&&o()},_setBgOverlay:function(c,s){var h={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!c.backgroundImage&&!c.overlayImage&&!c.background&&!c.overlay){s&&s();return}var o=function(){h.backgroundImage&&h.overlayImage&&h.backgroundColor&&h.overlayColor&&s&&s()};this.__setBgOverlay("backgroundImage",c.backgroundImage,h,o),this.__setBgOverlay("overlayImage",c.overlayImage,h,o),this.__setBgOverlay("backgroundColor",c.background,h,o),this.__setBgOverlay("overlayColor",c.overlay,h,o)},__setBgOverlay:function(c,s,h,o){var e=this;if(!s){h[c]=!0,o&&o();return}c==="backgroundImage"||c==="overlayImage"?f.util.enlivenObjects([s],function(r){e[c]=r[0],h[c]=!0,o&&o()}):this["set"+f.util.string.capitalize(c,!0)](s,function(){h[c]=!0,o&&o()})},_enlivenObjects:function(c,s,h){if(!c||c.length===0){s&&s([]);return}f.util.enlivenObjects(c,function(o){s&&s(o)},null,h)},_toDataURL:function(c,s){this.clone(function(h){s(h.toDataURL(c))})},_toDataURLWithMultiplier:function(c,s,h){this.clone(function(o){h(o.toDataURLWithMultiplier(c,s))})},clone:function(c,s){var h=JSON.stringify(this.toJSON(s));this.cloneWithoutData(function(o){o.loadFromJSON(h,function(){c&&c(o)})})},cloneWithoutData:function(c){var s=f.util.createCanvasElement();s.width=this.width,s.height=this.height;var h=new f.Canvas(s);this.backgroundImage?(h.setBackgroundImage(this.backgroundImage.src,function(){h.renderAll(),c&&c(h)}),h.backgroundImageOpacity=this.backgroundImageOpacity,h.backgroundImageStretch=this.backgroundImageStretch):c&&c(h)}}),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.object.clone,e=s.util.toFixed,r=s.util.string.capitalize,t=s.util.degreesToRadians,n=!s.isLikelyNode,a=2;s.Object||(s.Object=s.util.createClass(s.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:n,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(i){i&&this.setOptions(i)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=s.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(i){var l=s.perfLimitSizeTotal,u=i.width,d=i.height,g=s.maxCacheSideLimit,p=s.minCacheSideLimit;if(u<=g&&d<=g&&u*d<=l)return uA&&(i.zoomX/=u/A,i.width=A,i.capped=!0),d>X&&(i.zoomY/=d/X,i.height=X,i.capped=!0),i},_getCacheCanvasDimensions:function(){var i=this.getTotalObjectScaling(),l=this._getTransformedDimensions(0,0),u=l.x*i.scaleX/this.scaleX,d=l.y*i.scaleY/this.scaleY;return{width:u+a,height:d+a,zoomX:i.scaleX,zoomY:i.scaleY,x:u,y:d}},_updateCacheCanvas:function(){var i=this.canvas;if(this.noScaleCache&&i&&i._currentTransform){var l=i._currentTransform.target,u=i._currentTransform.action;if(this===l&&u.slice&&u.slice(0,5)==="scale")return!1}var d=this._cacheCanvas,g=this._limitCacheSize(this._getCacheCanvasDimensions()),p=s.minCacheSideLimit,v=g.width,_=g.height,T,A,X=g.zoomX,W=g.zoomY,N=v!==this.cacheWidth||_!==this.cacheHeight,V=this.zoomX!==X||this.zoomY!==W,U=N||V,G=0,q=0,J=!1;if(N){var K=this._cacheCanvas.width,m=this._cacheCanvas.height,C=v>K||_>m,S=(vp&&m>p;J=C||S,C&&!g.capped&&(v>p||_>p)&&(G=v*.1,q=_*.1)}return this instanceof s.Text&&this.path&&(U=!0,J=!0,G+=this.getHeightOfLine(0)*this.zoomX,q+=this.getHeightOfLine(0)*this.zoomY),U?(J?(d.width=Math.ceil(v+G),d.height=Math.ceil(_+q)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,d.width,d.height)),T=g.x/2,A=g.y/2,this.cacheTranslationX=Math.round(d.width/2-T)+T,this.cacheTranslationY=Math.round(d.height/2-A)+A,this.cacheWidth=v,this.cacheHeight=_,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(X,W),this.zoomX=X,this.zoomY=W,!0):!1},setOptions:function(i){this._setOptions(i),this._initGradient(i.fill,"fill"),this._initGradient(i.stroke,"stroke"),this._initPattern(i.fill,"fill"),this._initPattern(i.stroke,"stroke")},transform:function(i){var l=this.group&&!this.group._transformDone||this.group&&this.canvas&&i===this.canvas.contextTop,u=this.calcTransformMatrix(!l);i.transform(u[0],u[1],u[2],u[3],u[4],u[5])},toObject:function(i){var l=s.Object.NUM_FRACTION_DIGITS,u={type:this.type,version:s.version,originX:this.originX,originY:this.originY,left:e(this.left,l),top:e(this.top,l),width:e(this.width,l),height:e(this.height,l),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:e(this.strokeWidth,l),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:e(this.strokeMiterLimit,l),scaleX:e(this.scaleX,l),scaleY:e(this.scaleY,l),angle:e(this.angle,l),flipX:this.flipX,flipY:this.flipY,opacity:e(this.opacity,l),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:e(this.skewX,l),skewY:e(this.skewY,l)};return this.clipPath&&!this.clipPath.excludeFromExport&&(u.clipPath=this.clipPath.toObject(i),u.clipPath.inverted=this.clipPath.inverted,u.clipPath.absolutePositioned=this.clipPath.absolutePositioned),s.util.populateWithProperties(this,u,i),this.includeDefaultValues||(u=this._removeDefaultValues(u)),u},toDatalessObject:function(i){return this.toObject(i)},_removeDefaultValues:function(i){var l=s.util.getKlass(i.type).prototype,u=l.stateProperties;return u.forEach(function(d){d==="left"||d==="top"||(i[d]===l[d]&&delete i[d],Array.isArray(i[d])&&Array.isArray(l[d])&&i[d].length===0&&l[d].length===0&&delete i[d])}),i},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var i=s.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(i.scaleX),scaleY:Math.abs(i.scaleY)}},getTotalObjectScaling:function(){var i=this.getObjectScaling(),l=i.scaleX,u=i.scaleY;if(this.canvas){var d=this.canvas.getZoom(),g=this.canvas.getRetinaScaling();l*=d*g,u*=d*g}return{scaleX:l,scaleY:u}},getObjectOpacity:function(){var i=this.opacity;return this.group&&(i*=this.group.getObjectOpacity()),i},_set:function(i,l){var u=i==="scaleX"||i==="scaleY",d=this[i]!==l,g=!1;return u&&(l=this._constrainScale(l)),i==="scaleX"&&l<0?(this.flipX=!this.flipX,l*=-1):i==="scaleY"&&l<0?(this.flipY=!this.flipY,l*=-1):i==="shadow"&&l&&!(l instanceof s.Shadow)?l=new s.Shadow(l):i==="dirty"&&this.group&&this.group.set("dirty",l),this[i]=l,d&&(g=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(i)>-1?(this.dirty=!0,g&&this.group.set("dirty",!0)):g&&this.stateProperties.indexOf(i)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:s.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(i){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(i.save(),this._setupCompositeOperation(i),this.drawSelectionBackground(i),this.transform(i),this._setOpacity(i),this._setShadow(i,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(i)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(i),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),i.restore())},renderCache:function(i){i=i||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,i.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(i,l){if(i.save(),l.inverted?i.globalCompositeOperation="destination-out":i.globalCompositeOperation="destination-in",l.absolutePositioned){var u=s.util.invertTransform(this.calcTransformMatrix());i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}l.transform(i),i.scale(1/l.zoomX,1/l.zoomY),i.drawImage(l._cacheCanvas,-l.cacheTranslationX,-l.cacheTranslationY),i.restore()},drawObject:function(i,l){var u=this.fill,d=this.stroke;l?(this.fill="black",this.stroke="",this._setClippingProperties(i)):this._renderBackground(i),this._render(i),this._drawClipPath(i,this.clipPath),this.fill=u,this.stroke=d},_drawClipPath:function(i,l){l&&(l.canvas=this.canvas,l.shouldCache(),l._transformDone=!0,l.renderCache({forClipping:!0}),this.drawClipPathOnCache(i,l))},drawCacheOnCanvas:function(i){i.scale(1/this.zoomX,1/this.zoomY),i.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(i){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!i&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!i){var l=this.cacheWidth/this.zoomX,u=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-l/2,-u/2,l,u)}return!0}return!1},_renderBackground:function(i){if(this.backgroundColor){var l=this._getNonTransformedDimensions();i.fillStyle=this.backgroundColor,i.fillRect(-l.x/2,-l.y/2,l.x,l.y),this._removeShadow(i)}},_setOpacity:function(i){this.group&&!this.group._transformDone?i.globalAlpha=this.getObjectOpacity():i.globalAlpha*=this.opacity},_setStrokeStyles:function(i,l){var u=l.stroke;u&&(i.lineWidth=l.strokeWidth,i.lineCap=l.strokeLineCap,i.lineDashOffset=l.strokeDashOffset,i.lineJoin=l.strokeLineJoin,i.miterLimit=l.strokeMiterLimit,u.toLive?u.gradientUnits==="percentage"||u.gradientTransform||u.patternTransform?this._applyPatternForTransformedGradient(i,u):(i.strokeStyle=u.toLive(i,this),this._applyPatternGradientTransform(i,u)):i.strokeStyle=l.stroke)},_setFillStyles:function(i,l){var u=l.fill;u&&(u.toLive?(i.fillStyle=u.toLive(i,this),this._applyPatternGradientTransform(i,l.fill)):i.fillStyle=u)},_setClippingProperties:function(i){i.globalAlpha=1,i.strokeStyle="transparent",i.fillStyle="#000000"},_setLineDash:function(i,l){!l||l.length===0||(1&l.length&&l.push.apply(l,l),i.setLineDash(l))},_renderControls:function(i,l){var u=this.getViewportTransform(),d=this.calcTransformMatrix(),g,p,v;l=l||{},p=typeof l.hasBorders<"u"?l.hasBorders:this.hasBorders,v=typeof l.hasControls<"u"?l.hasControls:this.hasControls,d=s.util.multiplyTransformMatrices(u,d),g=s.util.qrDecompose(d),i.save(),i.translate(g.translateX,g.translateY),i.lineWidth=1*this.borderScaleFactor,this.group||(i.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(g.angle-=180),i.rotate(t(this.group?g.angle:this.angle)),l.forActiveSelection||this.group?p&&this.drawBordersInGroup(i,g,l):p&&this.drawBorders(i,l),v&&this.drawControls(i,l),i.restore()},_setShadow:function(i){if(this.shadow){var l=this.shadow,u=this.canvas,d,g=u&&u.viewportTransform[0]||1,p=u&&u.viewportTransform[3]||1;l.nonScaling?d={scaleX:1,scaleY:1}:d=this.getObjectScaling(),u&&u._isRetinaScaling()&&(g*=s.devicePixelRatio,p*=s.devicePixelRatio),i.shadowColor=l.color,i.shadowBlur=l.blur*s.browserShadowBlurConstant*(g+p)*(d.scaleX+d.scaleY)/4,i.shadowOffsetX=l.offsetX*g*d.scaleX,i.shadowOffsetY=l.offsetY*p*d.scaleY}},_removeShadow:function(i){this.shadow&&(i.shadowColor="",i.shadowBlur=i.shadowOffsetX=i.shadowOffsetY=0)},_applyPatternGradientTransform:function(i,l){if(!l||!l.toLive)return{offsetX:0,offsetY:0};var u=l.gradientTransform||l.patternTransform,d=-this.width/2+l.offsetX||0,g=-this.height/2+l.offsetY||0;return l.gradientUnits==="percentage"?i.transform(this.width,0,0,this.height,d,g):i.transform(1,0,0,1,d,g),u&&i.transform(u[0],u[1],u[2],u[3],u[4],u[5]),{offsetX:d,offsetY:g}},_renderPaintInOrder:function(i){this.paintFirst==="stroke"?(this._renderStroke(i),this._renderFill(i)):(this._renderFill(i),this._renderStroke(i))},_render:function(){},_renderFill:function(i){this.fill&&(i.save(),this._setFillStyles(i,this),this.fillRule==="evenodd"?i.fill("evenodd"):i.fill(),i.restore())},_renderStroke:function(i){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(i),i.save(),this.strokeUniform&&this.group){var l=this.getObjectScaling();i.scale(1/l.scaleX,1/l.scaleY)}else this.strokeUniform&&i.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(i,this.strokeDashArray),this._setStrokeStyles(i,this),i.stroke(),i.restore()}},_applyPatternForTransformedGradient:function(i,l){var u=this._limitCacheSize(this._getCacheCanvasDimensions()),d=s.util.createCanvasElement(),g,p=this.canvas.getRetinaScaling(),v=u.x/this.scaleX/p,_=u.y/this.scaleY/p;d.width=v,d.height=_,g=d.getContext("2d"),g.beginPath(),g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,_),g.lineTo(0,_),g.closePath(),g.translate(v/2,_/2),g.scale(u.zoomX/this.scaleX/p,u.zoomY/this.scaleY/p),this._applyPatternGradientTransform(g,l),g.fillStyle=l.toLive(i),g.fill(),i.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),i.scale(p*this.scaleX/u.zoomX,p*this.scaleY/u.zoomY),i.strokeStyle=g.createPattern(d,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var i=s.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",i.scaleX),this.set("scaleY",i.scaleY),this.angle=i.angle,this.skewX=i.skewX,this.skewY=0}},_removeTransformMatrix:function(i){var l=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),l=s.util.transformPoint(l,this.transformMatrix)),this.transformMatrix=null,i&&(this.scaleX*=i.scaleX,this.scaleY*=i.scaleY,this.cropX=i.cropX,this.cropY=i.cropY,l.x+=i.offsetLeft,l.y+=i.offsetTop,this.width=i.width,this.height=i.height),this.setPositionByOrigin(l,"center","center")},clone:function(i,l){var u=this.toObject(l);this.constructor.fromObject?this.constructor.fromObject(u,i):s.Object._fromObject("Object",u,i)},cloneAsImage:function(i,l){var u=this.toCanvasElement(l);return i&&i(new s.Image(u)),this},toCanvasElement:function(i){i||(i={});var l=s.util,u=l.saveObjectTransform(this),d=this.group,g=this.shadow,p=Math.abs,v=(i.multiplier||1)*(i.enableRetinaScaling?s.devicePixelRatio:1);delete this.group,i.withoutTransform&&l.resetObjectTransform(this),i.withoutShadow&&(this.shadow=null);var _=s.util.createCanvasElement(),T=this.getBoundingRect(!0,!0),A=this.shadow,X,W={x:0,y:0},N,V,U;A&&(N=A.blur,A.nonScaling?X={scaleX:1,scaleY:1}:X=this.getObjectScaling(),W.x=2*Math.round(p(A.offsetX)+N)*p(X.scaleX),W.y=2*Math.round(p(A.offsetY)+N)*p(X.scaleY)),V=T.width+W.x,U=T.height+W.y,_.width=Math.ceil(V),_.height=Math.ceil(U);var G=new s.StaticCanvas(_,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});i.format==="jpeg"&&(G.backgroundColor="#fff"),this.setPositionByOrigin(new s.Point(G.width/2,G.height/2),"center","center");var q=this.canvas;G.add(this);var J=G.toCanvasElement(v||1,i);return this.shadow=g,this.set("canvas",q),d&&(this.group=d),this.set(u).setCoords(),G._objects=[],G.dispose(),G=null,J},toDataURL:function(i){return i||(i={}),s.util.toDataURL(this.toCanvasElement(i),i.format||"png",i.quality||1)},isType:function(i){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===i},complexity:function(){return 1},toJSON:function(i){return this.toObject(i)},rotate:function(i){var l=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return l&&this._setOriginToCenter(),this.set("angle",i),l&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(i,l){l=l||this.canvas.getPointer(i);var u=new s.Point(l.x,l.y),d=this._getLeftTopCoords();return this.angle&&(u=s.util.rotatePoint(u,d,t(-this.angle))),{x:u.x-d.x,y:u.y-d.y}},_setupCompositeOperation:function(i){this.globalCompositeOperation&&(i.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){s.runningAnimations&&s.runningAnimations.cancelByTarget(this)}}),s.util.createAccessors&&s.util.createAccessors(s.Object),h(s.Object.prototype,s.Observable),s.Object.NUM_FRACTION_DIGITS=2,s.Object.ENLIVEN_PROPS=["clipPath"],s.Object._fromObject=function(i,l,u,d){var g=s[i];l=o(l,!0),s.util.enlivenPatterns([l.fill,l.stroke],function(p){typeof p[0]<"u"&&(l.fill=p[0]),typeof p[1]<"u"&&(l.stroke=p[1]),s.util.enlivenObjectEnlivables(l,l,function(){var v=d?new g(l[d],l):new g(l);u&&u(v)})})},s.Object.__uid=0)}(Z),function(){var c=f.util.degreesToRadians,s={left:-.5,center:0,right:.5},h={top:-.5,center:0,bottom:.5};f.util.object.extend(f.Object.prototype,{translateToGivenOrigin:function(o,e,r,t,n){var a=o.x,i=o.y,l,u,d;return typeof e=="string"?e=s[e]:e-=.5,typeof t=="string"?t=s[t]:t-=.5,l=t-e,typeof r=="string"?r=h[r]:r-=.5,typeof n=="string"?n=h[n]:n-=.5,u=n-r,(l||u)&&(d=this._getTransformedDimensions(),a=o.x+l*d.x,i=o.y+u*d.y),new f.Point(a,i)},translateToCenterPoint:function(o,e,r){var t=this.translateToGivenOrigin(o,e,r,"center","center");return this.angle?f.util.rotatePoint(t,o,c(this.angle)):t},translateToOriginPoint:function(o,e,r){var t=this.translateToGivenOrigin(o,"center","center",e,r);return this.angle?f.util.rotatePoint(t,o,c(this.angle)):t},getCenterPoint:function(){var o=new f.Point(this.left,this.top);return this.translateToCenterPoint(o,this.originX,this.originY)},getPointByOrigin:function(o,e){var r=this.getCenterPoint();return this.translateToOriginPoint(r,o,e)},toLocalPoint:function(o,e,r){var t=this.getCenterPoint(),n,a;return typeof e<"u"&&typeof r<"u"?n=this.translateToGivenOrigin(t,"center","center",e,r):n=new f.Point(this.left,this.top),a=new f.Point(o.x,o.y),this.angle&&(a=f.util.rotatePoint(a,t,-c(this.angle))),a.subtractEquals(n)},setPositionByOrigin:function(o,e,r){var t=this.translateToCenterPoint(o,e,r),n=this.translateToOriginPoint(t,this.originX,this.originY);this.set("left",n.x),this.set("top",n.y)},adjustPosition:function(o){var e=c(this.angle),r=this.getScaledWidth(),t=f.util.cos(e)*r,n=f.util.sin(e)*r,a,i;typeof this.originX=="string"?a=s[this.originX]:a=this.originX-.5,typeof o=="string"?i=s[o]:i=o-.5,this.left+=t*(i-a),this.top+=n*(i-a),this.setCoords(),this.originX=o},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var o=this.getCenterPoint();this.originX="center",this.originY="center",this.left=o.x,this.top=o.y},_resetOrigin:function(){var o=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=o.x,this.top=o.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function c(r){return[new f.Point(r.tl.x,r.tl.y),new f.Point(r.tr.x,r.tr.y),new f.Point(r.br.x,r.br.y),new f.Point(r.bl.x,r.bl.y)]}var s=f.util,h=s.degreesToRadians,o=s.multiplyTransformMatrices,e=s.transformPoint;s.object.extend(f.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(r,t){return t?r?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),r?this.aCoords:this.lineCoords)},getCoords:function(r,t){return c(this._getCoords(r,t))},intersectsWithRect:function(r,t,n,a){var i=this.getCoords(n,a),l=f.Intersection.intersectPolygonRectangle(i,r,t);return l.status==="Intersection"},intersectsWithObject:function(r,t,n){var a=f.Intersection.intersectPolygonPolygon(this.getCoords(t,n),r.getCoords(t,n));return a.status==="Intersection"||r.isContainedWithinObject(this,t,n)||this.isContainedWithinObject(r,t,n)},isContainedWithinObject:function(r,t,n){for(var a=this.getCoords(t,n),i=t?r.aCoords:r.lineCoords,l=0,u=r._getImageLines(i);l<4;l++)if(!r.containsPoint(a[l],u))return!1;return!0},isContainedWithinRect:function(r,t,n,a){var i=this.getBoundingRect(n,a);return i.left>=r.x&&i.left+i.width<=t.x&&i.top>=r.y&&i.top+i.height<=t.y},containsPoint:function(r,l,n,a){var i=this._getCoords(n,a),l=l||this._getImageLines(i),u=this._findCrossPoints(r,l);return u!==0&&u%2===1},isOnScreen:function(r){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br,a=this.getCoords(!0,r);return a.some(function(i){return i.x<=n.x&&i.x>=t.x&&i.y<=n.y&&i.y>=t.y})||this.intersectsWithRect(t,n,!0,r)?!0:this._containsCenterOfCanvas(t,n,r)},_containsCenterOfCanvas:function(r,t,n){var a={x:(r.x+t.x)/2,y:(r.y+t.y)/2};return!!this.containsPoint(a,null,!0,n)},isPartiallyOnScreen:function(r){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;if(this.intersectsWithRect(t,n,!0,r))return!0;var a=this.getCoords(!0,r).every(function(i){return(i.x>=n.x||i.x<=t.x)&&(i.y>=n.y||i.y<=t.y)});return a&&this._containsCenterOfCanvas(t,n,r)},_getImageLines:function(r){var t={topline:{o:r.tl,d:r.tr},rightline:{o:r.tr,d:r.br},bottomline:{o:r.br,d:r.bl},leftline:{o:r.bl,d:r.tl}};return t},_findCrossPoints:function(r,t){var n,a,i,l,u,d=0,g;for(var p in t)if(g=t[p],!(g.o.y=r.y&&g.d.y>=r.y)&&(g.o.x===g.d.x&&g.o.x>=r.x?u=g.o.x:(n=0,a=(g.d.y-g.o.y)/(g.d.x-g.o.x),i=r.y-n*r.x,l=g.o.y-a*g.o.x,u=-(i-l)/(n-a)),u>=r.x&&(d+=1),d===2))break;return d},getBoundingRect:function(r,t){var n=this.getCoords(r,t);return s.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(r){return Math.abs(r)"u"&&(r=this.skewX),typeof t>"u"&&(t=this.skewY);var n,a,i,l=r===0&&t===0;if(this.strokeUniform?(a=this.width,i=this.height):(n=this._getNonTransformedDimensions(),a=n.x,i=n.y),l)return this._finalizeDimensions(a*this.scaleX,i*this.scaleY);var u=s.sizeAfterTransform(a,i,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:r,skewY:t});return this._finalizeDimensions(u.x,u.y)},_finalizeDimensions:function(r,t){return this.strokeUniform?{x:r+this.strokeWidth,y:t+this.strokeWidth}:{x:r,y:t}},_calculateCurrentDimensions:function(){var r=this.getViewportTransform(),t=this._getTransformedDimensions(),n=e(t,r,!0);return n.scalarAdd(2*this.padding)}})}(),f.util.object.extend(f.Object.prototype,{sendToBack:function(){return this.group?f.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?f.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(c){return this.group?f.StaticCanvas.prototype.sendBackwards.call(this.group,this,c):this.canvas&&this.canvas.sendBackwards(this,c),this},bringForward:function(c){return this.group?f.StaticCanvas.prototype.bringForward.call(this.group,this,c):this.canvas&&this.canvas.bringForward(this,c),this},moveTo:function(c){return this.group&&this.group.type!=="activeSelection"?f.StaticCanvas.prototype.moveTo.call(this.group,this,c):this.canvas&&this.canvas.moveTo(this,c),this}}),function(){function c(h,o){if(o){if(o.toLive)return h+": url(#SVGID_"+o.id+"); ";var e=new f.Color(o),r=h+": "+e.toRgb()+"; ",t=e.getAlpha();return t!==1&&(r+=h+"-opacity: "+t.toString()+"; "),r}else return h+": none; "}var s=f.util.toFixed;f.util.object.extend(f.Object.prototype,{getSvgStyles:function(h){var o=this.fillRule?this.fillRule:"nonzero",e=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",t=this.strokeDashOffset?this.strokeDashOffset:"0",n=this.strokeLineCap?this.strokeLineCap:"butt",a=this.strokeLineJoin?this.strokeLineJoin:"miter",i=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=typeof this.opacity<"u"?this.opacity:"1",u=this.visible?"":" visibility: hidden;",d=h?"":this.getSvgFilter(),g=c("fill",this.fill),p=c("stroke",this.stroke);return[p,"stroke-width: ",e,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",n,"; ","stroke-dashoffset: ",t,"; ","stroke-linejoin: ",a,"; ","stroke-miterlimit: ",i,"; ",g,"fill-rule: ",o,"; ","opacity: ",l,";",d,u].join("")},getSvgSpanStyles:function(h,o){var e="; ",t=h.fontFamily?"font-family: "+(h.fontFamily.indexOf("'")===-1&&h.fontFamily.indexOf('"')===-1?"'"+h.fontFamily+"'":h.fontFamily)+e:"",r=h.strokeWidth?"stroke-width: "+h.strokeWidth+e:"",t=t,n=h.fontSize?"font-size: "+h.fontSize+"px"+e:"",a=h.fontStyle?"font-style: "+h.fontStyle+e:"",i=h.fontWeight?"font-weight: "+h.fontWeight+e:"",l=h.fill?c("fill",h.fill):"",u=h.stroke?c("stroke",h.stroke):"",d=this.getSvgTextDecoration(h),g=h.deltaY?"baseline-shift: "+-h.deltaY+"; ":"";return d&&(d="text-decoration: "+d+e),[u,r,t,n,a,i,d,l,g,o?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(h){return["overline","underline","line-through"].filter(function(o){return h[o.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(h,o){var e=h?this.calcTransformMatrix():this.calcOwnMatrix(),r='transform="'+f.util.matrixToSVG(e);return r+(o||"")+'" '},_setSVGBg:function(h){if(this.backgroundColor){var o=f.Object.NUM_FRACTION_DIGITS;h.push(" -`)}},toSVG:function(h){return this._createBaseSVGMarkup(this._toSVG(h),{reviver:h})},toClipPathSVG:function(h){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(h),{reviver:h})},_createBaseClipPathSVGMarkup:function(h,o){o=o||{};var e=o.reviver,r=o.additionalTransform||"",t=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),n=h.indexOf("COMMON_PARTS");return h[n]=t,e?e(h.join("")):h.join("")},_createBaseSVGMarkup:function(h,o){o=o||{};var e=o.noStyle,r=o.reviver,t=e?"":'style="'+this.getSvgStyles()+'" ',n=o.withShadow?'style="'+this.getSvgFilter()+'" ':"",a=this.clipPath,i=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",l=a&&a.absolutePositioned,u=this.stroke,d=this.fill,g=this.shadow,p,v=[],_,T=h.indexOf("COMMON_PARTS"),A=o.additionalTransform;return a&&(a.clipPathId="CLIPPATH_"+f.Object.__uid++,_=' -`+a.toClipPathSVG(r)+` -`),l&&v.push(" -`),v.push(" -`),p=[t,i,e?"":this.addPaintOrder()," ",A?'transform="'+A+'" ':""].join(""),h[T]=p,d&&d.toLive&&v.push(d.toSVG(this)),u&&u.toLive&&v.push(u.toSVG(this)),g&&v.push(g.toSVG(this)),a&&v.push(_),v.push(h.join("")),v.push(` -`),l&&v.push(` -`),r?r(v.join("")):v.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var c=f.util.object.extend,s="stateProperties";function h(e,r,t){var n={},a=!0;t.forEach(function(i){n[i]=e[i]}),c(e[r],n,a)}function o(e,r,t){if(e===r)return!0;if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0,a=e.length;n=0;a--)if(i=n[a],!!this.isControlVisible(i)&&(t=this._getImageLines(h?this.oCoords[i].touchCorner:this.oCoords[i].corner),r=this._findCrossPoints({x:o,y:e},t),r!==0&&r%2===1))return this.__corner=i,i;return!1},forEachControl:function(s){for(var h in this.controls)s(this.controls[h],h,this)},_setCornerCoords:function(){var s=this.oCoords;for(var h in s){var o=this.controls[h];s[h].corner=o.calcCornerCoords(this.angle,this.cornerSize,s[h].x,s[h].y,!1),s[h].touchCorner=o.calcCornerCoords(this.angle,this.touchCornerSize,s[h].x,s[h].y,!0)}},drawSelectionBackground:function(s){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;s.save();var h=this.getCenterPoint(),o=this._calculateCurrentDimensions(),e=this.canvas.viewportTransform;return s.translate(h.x,h.y),s.scale(1/e[0],1/e[3]),s.rotate(c(this.angle)),s.fillStyle=this.selectionBackgroundColor,s.fillRect(-o.x/2,-o.y/2,o.x,o.y),s.restore(),this},drawBorders:function(s,h){h=h||{};var o=this._calculateCurrentDimensions(),e=this.borderScaleFactor,r=o.x+e,t=o.y+e,n=typeof h.hasControls<"u"?h.hasControls:this.hasControls,a=!1;return s.save(),s.strokeStyle=h.borderColor||this.borderColor,this._setLineDash(s,h.borderDashArray||this.borderDashArray),s.strokeRect(-r/2,-t/2,r,t),n&&(s.beginPath(),this.forEachControl(function(i,l,u){i.withConnection&&i.getVisibility(u,l)&&(a=!0,s.moveTo(i.x*r,i.y*t),s.lineTo(i.x*r+i.offsetX,i.y*t+i.offsetY))}),a&&s.stroke()),s.restore(),this},drawBordersInGroup:function(s,h,o){o=o||{};var e=f.util.sizeAfterTransform(this.width,this.height,h),r=this.strokeWidth,t=this.strokeUniform,n=this.borderScaleFactor,a=e.x+r*(t?this.canvas.getZoom():h.scaleX)+n,i=e.y+r*(t?this.canvas.getZoom():h.scaleY)+n;return s.save(),this._setLineDash(s,o.borderDashArray||this.borderDashArray),s.strokeStyle=o.borderColor||this.borderColor,s.strokeRect(-a/2,-i/2,a,i),s.restore(),this},drawControls:function(s,h){h=h||{},s.save();var o=this.canvas.getRetinaScaling(),e,r;return s.setTransform(o,0,0,o,0,0),s.strokeStyle=s.fillStyle=h.cornerColor||this.cornerColor,this.transparentCorners||(s.strokeStyle=h.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(s,h.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(e=this.group.calcTransformMatrix()),this.forEachControl(function(t,n,a){r=a.oCoords[n],t.getVisibility(a,n)&&(e&&(r=f.util.transformPoint(r,e)),t.render(s,r.x,r.y,h,a))}),s.restore(),this},isControlVisible:function(s){return this.controls[s]&&this.controls[s].getVisibility(this,s)},setControlVisible:function(s,h){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[s]=h,this},setControlsVisibility:function(s){s||(s={});for(var h in s)this.setControlVisible(h,s[h]);return this},onDeselect:function(){},onSelect:function(){}})}(),f.util.object.extend(f.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){c.set("left",t),r.requestRenderAll(),e()},onComplete:function(){c.setCoords(),o()}})},fxCenterObjectV:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){c.set("top",t),r.requestRenderAll(),e()},onComplete:function(){c.setCoords(),o()}})},fxRemove:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){c.set("opacity",t),r.requestRenderAll(),e()},onComplete:function(){r.remove(c),o()}})}}),f.util.object.extend(f.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var c=[],s,h,o=[];for(s in arguments[0])c.push(s);for(var e=0,r=c.length;e-1||r&&e.colorProperties.indexOf(r[1])>-1,n=r?this.get(r[0])[r[1]]:this.get(c);"from"in h||(h.from=n),t||(~s.indexOf("=")?s=n+parseFloat(s.replace("=","")):s=parseFloat(s));var a={target:this,startValue:h.from,endValue:s,byValue:h.by,easing:h.easing,duration:h.duration,abort:h.abort&&function(i,l,u){return h.abort.call(e,i,l,u)},onChange:function(i,l,u){r?e[r[0]][r[1]]=i:e.set(c,i),!o&&h.onChange&&h.onChange(i,l,u)},onComplete:function(i,l,u){o||(e.setCoords(),h.onComplete&&h.onComplete(i,l,u))}};return t?f.util.animateColor(a.startValue,a.endValue,a.duration,a):f.util.animate(a)}}),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.object.clone,e={x1:1,x2:1,y1:1,y2:1};if(s.Line){s.warn("fabric.Line is already defined");return}s.Line=s.util.createClass(s.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:s.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,n){t||(t=[0,0,0,0]),this.callSuper("initialize",n),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(n)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,n){return this.callSuper("_set",t,n),typeof e[t]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:r({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:r({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var n=this.calcLinePoints();t.moveTo(n.x1,n.y1),t.lineTo(n.x2,n.y2),t.lineWidth=this.strokeWidth;var a=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=a},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return h(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(t.y-=this.strokeWidth),this.height===0&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,n=this.y1<=this.y2?-1:1,a=t*this.width*.5,i=n*this.height*.5,l=t*this.width*-.5,u=n*this.height*-.5;return{x1:a,x2:l,y1:i,y2:u}},_toSVG:function(){var t=this.calcLinePoints();return[" -`]}}),s.Line.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),s.Line.fromElement=function(t,n,a){a=a||{};var i=s.parseAttributes(t,s.Line.ATTRIBUTE_NAMES),l=[i.x1||0,i.y1||0,i.x2||0,i.y2||0];n(new s.Line(l,h(i,a)))},s.Line.fromObject=function(t,n){function a(l){delete l.points,n&&n(l)}var i=o(t,!0);i.points=[t.x1,t.y1,t.x2,t.y2],s.Object._fromObject("Line",i,a,"points")};function r(t,n){var a=t.origin,i=t.axis1,l=t.axis2,u=t.dimension,d=n.nearest,g=n.center,p=n.farthest;return function(){switch(this.get(a)){case d:return Math.min(this.get(i),this.get(l));case g:return Math.min(this.get(i),this.get(l))+.5*this.get(u);case p:return Math.max(this.get(i),this.get(l))}}}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.degreesToRadians;if(s.Circle){s.warn("fabric.Circle is already defined.");return}s.Circle=s.util.createClass(s.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:s.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,r){return this.callSuper("_set",e,r),e==="radius"&&this.setRadius(r),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,r=0,t=0,n=(this.endAngle-this.startAngle)%360;if(n===0)e=[" -`];else{var a=h(this.startAngle),i=h(this.endAngle),l=this.radius,u=s.util.cos(a)*l,d=s.util.sin(a)*l,g=s.util.cos(i)*l,p=s.util.sin(i)*l,v=n>180?"1":"0";e=[' -`]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,h(this.startAngle),h(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",e*2).set("height",e*2)}}),s.Circle.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),s.Circle.fromElement=function(e,r){var t=s.parseAttributes(e,s.Circle.ATTRIBUTE_NAMES);if(!o(t))throw new Error("value of `r` attribute is required and can not be negative");t.left=(t.left||0)-t.radius,t.top=(t.top||0)-t.radius,r(new s.Circle(t))};function o(e){return"radius"in e&&e.radius>=0}s.Circle.fromObject=function(e,r){s.Object._fromObject("Circle",e,r)}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Triangle){s.warn("fabric.Triangle is already defined");return}s.Triangle=s.util.createClass(s.Object,{type:"triangle",width:100,height:100,_render:function(h){var o=this.width/2,e=this.height/2;h.beginPath(),h.moveTo(-o,e),h.lineTo(0,-e),h.lineTo(o,e),h.closePath(),this._renderPaintInOrder(h)},_toSVG:function(){var h=this.width/2,o=this.height/2,e=[-h+" "+o,"0 "+-o,h+" "+o].join(",");return["']}}),s.Triangle.fromObject=function(h,o){return s.Object._fromObject("Triangle",h,o)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=Math.PI*2;if(s.Ellipse){s.warn("fabric.Ellipse is already defined.");return}s.Ellipse=s.util.createClass(s.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(o){this.callSuper("initialize",o),this.set("rx",o&&o.rx||0),this.set("ry",o&&o.ry||0)},_set:function(o,e){switch(this.callSuper("_set",o,e),o){case"rx":this.rx=e,this.set("width",e*2);break;case"ry":this.ry=e,this.set("height",e*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(o){return this.callSuper("toObject",["rx","ry"].concat(o))},_toSVG:function(){return[" -`]},_render:function(o){o.beginPath(),o.save(),o.transform(1,0,0,this.ry/this.rx,0,0),o.arc(0,0,this.rx,0,h,!1),o.restore(),this._renderPaintInOrder(o)}}),s.Ellipse.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),s.Ellipse.fromElement=function(o,e){var r=s.parseAttributes(o,s.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,e(new s.Ellipse(r))},s.Ellipse.fromObject=function(o,e){s.Object._fromObject("Ellipse",o,e)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend;if(s.Rect){s.warn("fabric.Rect is already defined");return}s.Rect=s.util.createClass(s.Object,{stateProperties:s.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(o){this.callSuper("initialize",o),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(o){var e=this.rx?Math.min(this.rx,this.width/2):0,r=this.ry?Math.min(this.ry,this.height/2):0,t=this.width,n=this.height,a=-this.width/2,i=-this.height/2,l=e!==0||r!==0,u=1-.5522847498;o.beginPath(),o.moveTo(a+e,i),o.lineTo(a+t-e,i),l&&o.bezierCurveTo(a+t-u*e,i,a+t,i+u*r,a+t,i+r),o.lineTo(a+t,i+n-r),l&&o.bezierCurveTo(a+t,i+n-u*r,a+t-u*e,i+n,a+t-e,i+n),o.lineTo(a+e,i+n),l&&o.bezierCurveTo(a+u*e,i+n,a,i+n-u*r,a,i+n-r),o.lineTo(a,i+r),l&&o.bezierCurveTo(a,i+u*r,a+u*e,i,a+e,i),o.closePath(),this._renderPaintInOrder(o)},toObject:function(o){return this.callSuper("toObject",["rx","ry"].concat(o))},_toSVG:function(){var o=-this.width/2,e=-this.height/2;return[" -`]}}),s.Rect.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),s.Rect.fromElement=function(o,e,r){if(!o)return e(null);r=r||{};var t=s.parseAttributes(o,s.Rect.ATTRIBUTE_NAMES);t.left=t.left||0,t.top=t.top||0,t.height=t.height||0,t.width=t.width||0;var n=new s.Rect(h(r?s.util.object.clone(r):{},t));n.visible=n.visible&&n.width>0&&n.height>0,e(n)},s.Rect.fromObject=function(o,e){return s.Object._fromObject("Rect",o,e)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.array.min,e=s.util.array.max,r=s.util.toFixed,t=s.util.projectStrokeOnPoints;if(s.Polyline){s.warn("fabric.Polyline is already defined");return}s.Polyline=s.util.createClass(s.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:s.Object.prototype.cacheProperties.concat("points"),initialize:function(n,a){a=a||{},this.points=n||[],this.callSuper("initialize",a),this._setPositionDimensions(a)},_projectStrokeOnPoints:function(){return t(this.points,this,!0)},_setPositionDimensions:function(n){var a=this._calcDimensions(n),i,l=this.exactBoundingBox?this.strokeWidth:0;this.width=a.width-l,this.height=a.height-l,n.fromSVG||(i=this.translateToGivenOrigin({x:a.left-this.strokeWidth/2+l/2,y:a.top-this.strokeWidth/2+l/2},"left","top",this.originX,this.originY)),typeof n.left>"u"&&(this.left=n.fromSVG?a.left:i.x),typeof n.top>"u"&&(this.top=n.fromSVG?a.top:i.y),this.pathOffset={x:a.left+this.width/2+l/2,y:a.top+this.height/2+l/2}},_calcDimensions:function(){var n=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,a=o(n,"x")||0,i=o(n,"y")||0,l=e(n,"x")||0,u=e(n,"y")||0,d=l-a,g=u-i;return{left:a,top:i,width:d,height:g}},toObject:function(n){return h(this.callSuper("toObject",n),{points:this.points.concat()})},_toSVG:function(){for(var n=[],a=this.pathOffset.x,i=this.pathOffset.y,l=s.Object.NUM_FRACTION_DIGITS,u=0,d=this.points.length;u -`]},commonRender:function(n){var a,i=this.points.length,l=this.pathOffset.x,u=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;n.beginPath(),n.moveTo(this.points[0].x-l,this.points[0].y-u);for(var d=0;d"},toObject:function(n){return e(this.callSuper("toObject",n),{path:this.path.map(function(a){return a.slice()})})},toDatalessObject:function(n){var a=this.toObject(["sourcePath"].concat(n));return a.sourcePath&&delete a.path,a},_toSVG:function(){var n=s.util.joinPath(this.path);return[" -`]},_getOffsetTransform:function(){var n=s.Object.NUM_FRACTION_DIGITS;return" translate("+t(-this.pathOffset.x,n)+", "+t(-this.pathOffset.y,n)+")"},toClipPathSVG:function(n){var a=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:n,additionalTransform:a})},toSVG:function(n){var a=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:n,additionalTransform:a})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var n=[],a=[],i,l=0,u=0,d=0,g=0,p,v=0,_=this.path.length;v<_;++v){switch(i=this.path[v],i[0]){case"L":d=i[1],g=i[2],p=[];break;case"M":d=i[1],g=i[2],l=d,u=g,p=[];break;case"C":p=s.util.getBoundsOfCurve(d,g,i[1],i[2],i[3],i[4],i[5],i[6]),d=i[5],g=i[6];break;case"Q":p=s.util.getBoundsOfCurve(d,g,i[1],i[2],i[1],i[2],i[3],i[4]),d=i[3],g=i[4];break;case"z":case"Z":d=l,g=u;break}p.forEach(function(U){n.push(U.x),a.push(U.y)}),n.push(d),a.push(g)}var T=h(n)||0,A=h(a)||0,X=o(n)||0,W=o(a)||0,N=X-T,V=W-A;return{left:T,top:A,width:N,height:V}}}),s.Path.fromObject=function(n,a){if(typeof n.sourcePath=="string"){var i=n.sourcePath;s.loadSVGFromURL(i,function(l){var u=l[0];u.setOptions(n),n.clipPath?s.util.enlivenObjects([n.clipPath],function(d){u.clipPath=d[0],a&&a(u)}):a&&a(u)})}else s.Object._fromObject("Path",n,a,"path")},s.Path.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat(["d"]),s.Path.fromElement=function(n,a,i){var l=s.parseAttributes(n,s.Path.ATTRIBUTE_NAMES);l.fromSVG=!0,a(new s.Path(l.d,e(l,i)))}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.array.min,o=s.util.array.max;s.Group||(s.Group=s.util.createClass(s.Object,s.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,r,t){r=r||{},this._objects=[],t&&this.callSuper("initialize",r),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(t)this._updateObjectsACoords();else{var a=r&&r.centerPoint;r.originX!==void 0&&(this.originX=r.originX),r.originY!==void 0&&(this.originY=r.originY),a||this._calcBounds(),this._updateObjectsCoords(a),delete r.centerPoint,this.callSuper("initialize",r)}this.setCoords()},_updateObjectsACoords:function(){for(var e=!0,r=this._objects.length;r--;)this._objects[r].setCoords(e)},_updateObjectsCoords:function(e){for(var e=e||this.getCenterPoint(),r=this._objects.length;r--;)this._updateObjectCoords(this._objects[r],e)},_updateObjectCoords:function(e,r){var t=e.left,n=e.top,a=!0;e.set({left:t-r.x,top:n-r.y}),e.group=this,e.setCoords(a)},toString:function(){return"#"},addWithUpdate:function(e){var r=!!this.group;return this._restoreObjectsState(),s.util.resetObjectTransform(this),e&&(r&&s.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,r?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),s.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,r){var t=this._objects.length;if(this.useSetOnGroup)for(;t--;)this._objects[t].setOnGroup(e,r);if(e==="canvas")for(;t--;)this._objects[t]._set(e,r);s.Object.prototype._set.call(this,e,r)},toObject:function(e){var r=this.includeDefaultValues,t=this._objects.filter(function(a){return!a.excludeFromExport}).map(function(a){var i=a.includeDefaultValues;a.includeDefaultValues=r;var l=a.toObject(e);return a.includeDefaultValues=i,l}),n=s.Object.prototype.toObject.call(this,e);return n.objects=t,n},toDatalessObject:function(e){var r,t=this.sourcePath;if(t)r=t;else{var n=this.includeDefaultValues;r=this._objects.map(function(i){var l=i.includeDefaultValues;i.includeDefaultValues=n;var u=i.toDatalessObject(e);return i.includeDefaultValues=l,u})}var a=s.Object.prototype.toDatalessObject.call(this,e);return a.objects=r,a},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=s.Object.prototype.shouldCache.call(this);if(e){for(var r=0,t=this._objects.length;r -`],t=0,n=this._objects.length;t -`),r},getSvgStyles:function(){var e=typeof this.opacity<"u"&&this.opacity!==1?"opacity: "+this.opacity+";":"",r=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),r].join("")},toClipPathSVG:function(e){for(var r=[],t=0,n=this._objects.length;t"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(h,o,e){h.save(),h.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",h,o),e=e||{},typeof e.hasControls>"u"&&(e.hasControls=!1),e.forActiveSelection=!0;for(var r=0,t=this._objects.length;r -`,' -`,` -`),a=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(i='" image-rendering="optimizeSpeed'),o.push(" -`),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=[" -`],this.fill=u}return this.paintFirst!=="fill"?h=h.concat(e,o):h=h.concat(o,e),h},getSrc:function(h){var o=h?this._element:this._originalElement;return o?o.toDataURL?o.toDataURL():this.srcFromAttribute?o.getAttribute("src"):o.src:this.src||""},setSrc:function(h,o,e){return f.util.loadImage(h,function(r,t){this.setElement(r,e),this._setWidthHeight(),o&&o(this,t)},this,e&&e.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var h=this.resizeFilter,o=this.minimumScaleTrigger,e=this.getTotalObjectScaling(),r=e.scaleX,t=e.scaleY,n=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!h||r>o&&t>o){this._element=n,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=r,this._lastScaleY=t;return}f.filterBackend||(f.filterBackend=f.initFilterBackend());var a=f.util.createCanvasElement(),i=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=n.width,u=n.height;a.width=l,a.height=u,this._element=a,this._lastScaleX=h.scaleX=r,this._lastScaleY=h.scaleY=t,f.filterBackend.applyFilters([h],n,l,u,this._element,i),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height},applyFilters:function(h){if(h=h||this.filters||[],h=h.filter(function(n){return n&&!n.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),h.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var o=this._originalElement,e=o.naturalWidth||o.width,r=o.naturalHeight||o.height;if(this._element===this._originalElement){var t=f.util.createCanvasElement();t.width=e,t.height=r,this._element=t,this._filteredEl=t}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,e,r),this._lastScaleX=1,this._lastScaleY=1;return f.filterBackend||(f.filterBackend=f.initFilterBackend()),f.filterBackend.applyFilters(h,this._originalElement,e,r,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(h){f.util.setImageSmoothing(h,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(h),this._renderPaintInOrder(h)},drawCacheOnCanvas:function(h){f.util.setImageSmoothing(h,this.imageSmoothing),f.Object.prototype.drawCacheOnCanvas.call(this,h)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(h){var o=this._element;if(o){var e=this._filterScalingX,r=this._filterScalingY,t=this.width,n=this.height,a=Math.min,i=Math.max,l=i(this.cropX,0),u=i(this.cropY,0),d=o.naturalWidth||o.width,g=o.naturalHeight||o.height,p=l*e,v=u*r,_=a(t*e,d-p),T=a(n*r,g-v),A=-t/2,X=-n/2,W=a(t,d/e-l),N=a(n,g/r-u);o&&h.drawImage(o,p,v,_,T,A,X,W,N)}},_needsResize:function(){var h=this.getTotalObjectScaling();return h.scaleX!==this._lastScaleX||h.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(h,o){this.setElement(f.util.getById(h),o),f.util.addClass(this.getElement(),f.Image.CSS_CANVAS)},_initConfig:function(h){h||(h={}),this.setOptions(h),this._setWidthHeight(h)},_initFilters:function(h,o){h&&h.length?f.util.enlivenObjects(h,function(e){o&&o(e)},"fabric.Image.filters"):o&&o()},_setWidthHeight:function(h){h||(h={});var o=this.getElement();this.width=h.width||o.naturalWidth||o.width||0,this.height=h.height||o.naturalHeight||o.height||0},parsePreserveAspectRatioAttribute:function(){var h=f.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),o=this._element.width,e=this._element.height,r=1,t=1,n=0,a=0,i=0,l=0,u,d=this.width,g=this.height,p={width:d,height:g};return h&&(h.alignX!=="none"||h.alignY!=="none")?(h.meetOrSlice==="meet"&&(r=t=f.util.findScaleToFit(this._element,p),u=(d-o*r)/2,h.alignX==="Min"&&(n=-u),h.alignX==="Max"&&(n=u),u=(g-e*t)/2,h.alignY==="Min"&&(a=-u),h.alignY==="Max"&&(a=u)),h.meetOrSlice==="slice"&&(r=t=f.util.findScaleToCover(this._element,p),u=o-d/r,h.alignX==="Mid"&&(i=u/2),h.alignX==="Max"&&(i=u),u=e-g/t,h.alignY==="Mid"&&(l=u/2),h.alignY==="Max"&&(l=u),o=d/r,e=g/t)):(r=d/o,t=g/e),{width:o,height:e,scaleX:r,scaleY:t,offsetLeft:n,offsetTop:a,cropX:i,cropY:l}}}),f.Image.CSS_CANVAS="canvas-img",f.Image.prototype.getSvgSrc=f.Image.prototype.getSrc,f.Image.fromObject=function(h,o){var e=f.util.object.clone(h);f.util.loadImage(e.src,function(r,t){if(t){o&&o(null,!0);return}f.Image.prototype._initFilters.call(e,e.filters,function(n){e.filters=n||[],f.Image.prototype._initFilters.call(e,[e.resizeFilter],function(a){e.resizeFilter=a[0],f.util.enlivenObjectEnlivables(e,e,function(){var i=new f.Image(r,e);o(i,!1)})})})},null,e.crossOrigin)},f.Image.fromURL=function(h,o,e){f.util.loadImage(h,function(r,t){o&&o(new f.Image(r,e),t)},null,e&&e.crossOrigin)},f.Image.ATTRIBUTE_NAMES=f.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),f.Image.fromElement=function(h,o,e){var r=f.parseAttributes(h,f.Image.ATTRIBUTE_NAMES);f.Image.fromURL(r["xlink:href"],o,s(e?f.util.object.clone(e):{},r))}}(Z),f.util.object.extend(f.Object.prototype,{_getAngleValueForStraighten:function(){var c=this.angle%360;return c>0?Math.round((c-1)/90)*90:Math.round(c/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(c){c=c||{};var s=function(){},h=c.onComplete||s,o=c.onChange||s,e=this;return f.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(r){e.rotate(r),o()},onComplete:function(){e.setCoords(),h()}})}}),f.util.object.extend(f.StaticCanvas.prototype,{straightenObject:function(c){return c.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(c){return c.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function c(h,o){var e="precision "+o+` float; -void main(){}`,r=h.createShader(h.FRAGMENT_SHADER);return h.shaderSource(r,e),h.compileShader(r),!!h.getShaderParameter(r,h.COMPILE_STATUS)}f.isWebglSupported=function(h){if(f.isLikelyNode)return!1;h=h||f.WebglFilterBackend.prototype.tileSize;var o=document.createElement("canvas"),e=o.getContext("webgl")||o.getContext("experimental-webgl"),r=!1;if(e){f.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),r=f.maxTextureSize>=h;for(var t=["highp","mediump","lowp"],n=0;n<3;n++)if(c(e,t[n])){f.webGlPrecision=t[n];break}}return this.isSupported=r,r},f.WebglFilterBackend=s;function s(h){h&&h.tileSize&&(this.tileSize=h.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}s.prototype={tileSize:2048,resources:{},setupGLContext:function(h,o){this.dispose(),this.createWebGLCanvas(h,o),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(h,o)},chooseFastestCopyGLTo2DMethod:function(h,o){var e=typeof window.performance<"u",r;try{new ImageData(1,1),r=!0}catch{r=!1}var t=typeof ArrayBuffer<"u",n=typeof Uint8ClampedArray<"u";if(e&&r&&t&&n){var a=f.util.createCanvasElement(),i=new ArrayBuffer(h*o*4);if(f.forceGLPutImageData){this.imageBuffer=i,this.copyGLTo2D=gt;return}var l={imageBuffer:i,destinationWidth:h,destinationHeight:o,targetCanvas:a},u,d,g;a.width=h,a.height=o,u=window.performance.now(),ct.call(l,this.gl,l),d=window.performance.now()-u,u=window.performance.now(),gt.call(l,this.gl,l),g=window.performance.now()-u,d>g?(this.imageBuffer=i,this.copyGLTo2D=gt):this.copyGLTo2D=ct}},createWebGLCanvas:function(h,o){var e=f.util.createCanvasElement();e.width=h,e.height=o;var r={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},t=e.getContext("webgl",r);t||(t=e.getContext("experimental-webgl",r)),t&&(t.clearColor(0,0,0,0),this.canvas=e,this.gl=t)},applyFilters:function(h,o,e,r,t,n){var a=this.gl,i;n&&(i=this.getCachedTexture(n,o));var l={originalWidth:o.width||o.originalWidth,originalHeight:o.height||o.originalHeight,sourceWidth:e,sourceHeight:r,destinationWidth:e,destinationHeight:r,context:a,sourceTexture:this.createTexture(a,e,r,!i&&o),targetTexture:this.createTexture(a,e,r),originalTexture:i||this.createTexture(a,e,r,!i&&o),passes:h.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:t},u=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,u),h.forEach(function(d){d&&d.applyTo(l)}),lt(l),this.copyGLTo2D(a,l),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(l.sourceTexture),a.deleteTexture(l.targetTexture),a.deleteFramebuffer(u),t.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(h,o,e,r,t){var n=h.createTexture();return h.bindTexture(h.TEXTURE_2D,n),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t||h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,t||h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),r?h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,r):h.texImage2D(h.TEXTURE_2D,0,h.RGBA,o,e,0,h.RGBA,h.UNSIGNED_BYTE,null),n},getCachedTexture:function(h,o){if(this.textureCache[h])return this.textureCache[h];var e=this.createTexture(this.gl,o.width,o.height,o);return this.textureCache[h]=e,e},evictCachesForKey:function(h){this.textureCache[h]&&(this.gl.deleteTexture(this.textureCache[h]),delete this.textureCache[h])},copyGLTo2D:ct,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var h=this.gl,o={renderer:"",vendor:""};if(!h)return o;var e=h.getExtension("WEBGL_debug_renderer_info");if(e){var r=h.getParameter(e.UNMASKED_RENDERER_WEBGL),t=h.getParameter(e.UNMASKED_VENDOR_WEBGL);r&&(o.renderer=r.toLowerCase()),t&&(o.vendor=t.toLowerCase())}return this.gpuInfo=o,o}}}();function lt(c){var s=c.targetCanvas,h=s.width,o=s.height,e=c.destinationWidth,r=c.destinationHeight;(h!==e||o!==r)&&(s.width=e,s.height=r)}function ct(c,s){var h=c.canvas,o=s.targetCanvas,e=o.getContext("2d");e.translate(0,o.height),e.scale(1,-1);var r=h.height-o.height;e.drawImage(h,0,r,o.width,o.height,0,0,o.width,o.height)}function gt(c,s){var h=s.targetCanvas,o=h.getContext("2d"),e=s.destinationWidth,r=s.destinationHeight,t=e*r*4,n=new Uint8Array(this.imageBuffer,0,t),a=new Uint8ClampedArray(this.imageBuffer,0,t);c.readPixels(0,0,e,r,c.RGBA,c.UNSIGNED_BYTE,n);var i=new ImageData(a,e,r);o.putImageData(i,0,0)}(function(){var c=function(){};f.Canvas2dFilterBackend=s;function s(){}s.prototype={evictCachesForKey:c,dispose:c,clearWebGLCaches:c,resources:{},applyFilters:function(h,o,e,r,t){var n=t.getContext("2d");n.drawImage(o,0,0,e,r);var a=n.getImageData(0,0,e,r),i=n.getImageData(0,0,e,r),l={sourceWidth:e,sourceHeight:r,imageData:a,originalEl:o,originalImageData:i,canvasEl:t,ctx:n,filterBackend:this};return h.forEach(function(u){u.applyTo(l)}),(l.imageData.width!==e||l.imageData.height!==r)&&(t.width=l.imageData.width,t.height=l.imageData.height),n.putImageData(l.imageData,0,0),l}}})(),f.Image=f.Image||{},f.Image.filters=f.Image.filters||{},f.Image.filters.BaseFilter=f.util.createClass({type:"BaseFilter",vertexSource:`attribute vec2 aPosition; -varying vec2 vTexCoord; -void main() { -vTexCoord = aPosition; -gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0); -}`,fragmentSource:`precision highp float; -varying vec2 vTexCoord; -uniform sampler2D uTexture; -void main() { -gl_FragColor = texture2D(uTexture, vTexCoord); -}`,initialize:function(c){c&&this.setOptions(c)},setOptions:function(c){for(var s in c)this[s]=c[s]},createProgram:function(c,s,h){s=s||this.fragmentSource,h=h||this.vertexSource,f.webGlPrecision!=="highp"&&(s=s.replace(/precision highp float/g,"precision "+f.webGlPrecision+" float"));var o=c.createShader(c.VERTEX_SHADER);if(c.shaderSource(o,h),c.compileShader(o),!c.getShaderParameter(o,c.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+c.getShaderInfoLog(o));var e=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(e,s),c.compileShader(e),!c.getShaderParameter(e,c.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+c.getShaderInfoLog(e));var r=c.createProgram();if(c.attachShader(r,o),c.attachShader(r,e),c.linkProgram(r),!c.getProgramParameter(r,c.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+c.getProgramInfoLog(r));var t=this.getAttributeLocations(c,r),n=this.getUniformLocations(c,r)||{};return n.uStepW=c.getUniformLocation(r,"uStepW"),n.uStepH=c.getUniformLocation(r,"uStepH"),{program:r,attributeLocations:t,uniformLocations:n}},getAttributeLocations:function(c,s){return{aPosition:c.getAttribLocation(s,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(c,s,h){var o=s.aPosition,e=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,e),c.enableVertexAttribArray(o),c.vertexAttribPointer(o,2,c.FLOAT,!1,0,0),c.bufferData(c.ARRAY_BUFFER,h,c.STATIC_DRAW)},_setupFrameBuffer:function(c){var s=c.context,h,o;c.passes>1?(h=c.destinationWidth,o=c.destinationHeight,(c.sourceWidth!==h||c.sourceHeight!==o)&&(s.deleteTexture(c.targetTexture),c.targetTexture=c.filterBackend.createTexture(s,h,o)),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,c.targetTexture,0)):(s.bindFramebuffer(s.FRAMEBUFFER,null),s.finish())},_swapTextures:function(c){c.passes--,c.pass++;var s=c.targetTexture;c.targetTexture=c.sourceTexture,c.sourceTexture=s},isNeutralState:function(){var c=this.mainParameter,s=f.Image.filters[this.type].prototype;if(c)if(Array.isArray(s[c])){for(var h=s[c].length;h--;)if(this[c][h]!==s[c][h])return!1;return!0}else return s[c]===this[c];else return!1},applyTo:function(c){c.webgl?(this._setupFrameBuffer(c),this.applyToWebGL(c),this._swapTextures(c)):this.applyTo2d(c)},retrieveShader:function(c){return c.programCache.hasOwnProperty(this.type)||(c.programCache[this.type]=this.createProgram(c.context)),c.programCache[this.type]},applyToWebGL:function(c){var s=c.context,h=this.retrieveShader(c);c.pass===0&&c.originalTexture?s.bindTexture(s.TEXTURE_2D,c.originalTexture):s.bindTexture(s.TEXTURE_2D,c.sourceTexture),s.useProgram(h.program),this.sendAttributeData(s,h.attributeLocations,c.aPosition),s.uniform1f(h.uniformLocations.uStepW,1/c.sourceWidth),s.uniform1f(h.uniformLocations.uStepH,1/c.sourceHeight),this.sendUniformData(s,h.uniformLocations),s.viewport(0,0,c.destinationWidth,c.destinationHeight),s.drawArrays(s.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(c,s,h){c.activeTexture(h),c.bindTexture(c.TEXTURE_2D,s),c.activeTexture(c.TEXTURE0)},unbindAdditionalTexture:function(c,s){c.activeTexture(s),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(c){this[this.mainParameter]=c},sendUniformData:function(){},createHelpLayer:function(c){if(!c.helpLayer){var s=document.createElement("canvas");s.width=c.sourceWidth,s.height=c.sourceHeight,c.helpLayer=s}},toObject:function(){var c={type:this.type},s=this.mainParameter;return s&&(c[s]=this[s]),c},toJSON:function(){return this.toObject()}}),f.Image.filters.BaseFilter.fromObject=function(c,s){var h=new f.Image.filters[c.type](c);return s&&s(h),h},function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.ColorMatrix=o(h.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float; -uniform sampler2D uTexture; -varying vec2 vTexCoord; -uniform mat4 uColorMatrix; -uniform vec4 uConstants; -void main() { -vec4 color = texture2D(uTexture, vTexCoord); -color *= uColorMatrix; -color += uConstants; -gl_FragColor = color; -}`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var r=e.imageData,t=r.data,n=t.length,a=this.matrix,i,l,u,d,g,p=this.colorsOnly;for(g=0;g=d||N<0||N>=u)&&(U=(V*u+N)*4,G=a[m*i+K],_+=n[U]*G,T+=n[U+1]*G,A+=n[U+2]*G,v||(X+=n[U+3]*G));p[W]=_,p[W+1]=T,p[W+2]=A,v?p[W+3]=n[W+3]:p[W+3]=X}r.imageData=g},getUniformLocations:function(r,t){return{uMatrix:r.getUniformLocation(t,"uMatrix"),uOpaque:r.getUniformLocation(t,"uOpaque"),uHalfSize:r.getUniformLocation(t,"uHalfSize"),uSize:r.getUniformLocation(t,"uSize")}},sendUniformData:function(r,t){r.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return h(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),s.Image.filters.Convolute.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Grayscale=o(h.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float; -uniform sampler2D uTexture; -varying vec2 vTexCoord; -void main() { -vec4 color = texture2D(uTexture, vTexCoord); -float average = (color.r + color.b + color.g) / 3.0; -gl_FragColor = vec4(average, average, average, color.a); -}`,lightness:`precision highp float; -uniform sampler2D uTexture; -uniform int uMode; -varying vec2 vTexCoord; -void main() { -vec4 col = texture2D(uTexture, vTexCoord); -float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0; -gl_FragColor = vec4(average, average, average, col.a); -}`,luminosity:`precision highp float; -uniform sampler2D uTexture; -uniform int uMode; -varying vec2 vTexCoord; -void main() { -vec4 col = texture2D(uTexture, vTexCoord); -float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b; -gl_FragColor = vec4(average, average, average, col.a); -}`},mode:"average",mainParameter:"mode",applyTo2d:function(e){var r=e.imageData,t=r.data,n,a=t.length,i,l=this.mode;for(n=0;np[0]&&u>p[1]&&d>p[2]&&l 0.0) { -`+this.fragmentSource[e]+`} -}`},retrieveShader:function(e){var r=this.type+"_"+this.mode,t;return e.programCache.hasOwnProperty(r)||(t=this.buildSource(this.mode),e.programCache[r]=this.createProgram(e.context,t)),e.programCache[r]},applyTo2d:function(e){var r=e.imageData,t=r.data,n=t.length,a,i,l,u,d,g,p,v=1-this.alpha;p=new s.Color(this.color).getSource(),a=p[0]*this.alpha,i=p[1]*this.alpha,l=p[2]*this.alpha;for(var _=0;_=u||d<=-u)return 0;if(d<11920929e-14&&d>-11920929e-14)return 1;d*=Math.PI;var g=d/u;return n(d)/d*n(g)/g}},applyTo2d:function(u){var d=u.imageData,g=this.scaleX,p=this.scaleY;this.rcpScaleX=1/g,this.rcpScaleY=1/p;var v=d.width,_=d.height,T=t(v*g),A=t(_*p),X;this.resizeType==="sliceHack"?X=this.sliceByTwo(u,v,_,T,A):this.resizeType==="hermite"?X=this.hermiteFastResize(u,v,_,T,A):this.resizeType==="bilinear"?X=this.bilinearFiltering(u,v,_,T,A):this.resizeType==="lanczos"&&(X=this.lanczosResize(u,v,_,T,A)),u.imageData=X},sliceByTwo:function(u,d,g,p,v){var _=u.imageData,T=.5,A=!1,X=!1,W=d*T,N=g*T,V=s.filterBackend.resources,U,G,q=0,J=0,K=d,m=0;for(V.sliceByTwo||(V.sliceByTwo=document.createElement("canvas")),U=V.sliceByTwo,(U.width=d)){Y=o(1e3*r(P-m.x)),K[Y]||(K[Y]={});for(var j=C.y-J;j<=C.y+J;j++)j<0||j>=g||(z=o(1e3*r(j-m.y)),K[Y][z]||(K[Y][z]=W(e(h(Y*U,2)+h(z*G,2))/1e3)),x=K[Y][z],x>0&&(y=(j*d+P)*4,w+=x,k+=x*T[y],M+=x*T[y+1],E+=x*T[y+2],R+=x*T[y+3]))}y=(b*p+S)*4,X[y]=k/w,X[y+1]=M/w,X[y+2]=E/w,X[y+3]=R/w}return++S1&&z<-1||(K=2*z*z*z-3*z*z+1,K>0&&(Y=4*(R+w*d),x+=K*N[Y+3],C+=K,N[Y+3]<255&&(K=K*N[Y+3]/250),S+=K*N[Y],b+=K*N[Y+1],P+=K*N[Y+2],m+=K))}U[J]=S/m,U[J+1]=b/m,U[J+2]=P/m,U[J+3]=x/C}return V},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),s.Image.filters.Resize.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Contrast=o(h.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float; -uniform sampler2D uTexture; -uniform float uContrast; -varying vec2 vTexCoord; -void main() { -vec4 color = texture2D(uTexture, vTexCoord); -float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast)); -color.rgb = contrastF * (color.rgb - 0.5) + 0.5; -gl_FragColor = color; -}`,contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(this.contrast!==0){var r=e.imageData,t,a,n=r.data,a=n.length,i=Math.floor(this.contrast*255),l=259*(i+255)/(255*(259-i));for(t=0;t1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?r[0]=t:r[1]=t,r}}),h.Blur.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Gamma=o(h.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float; -uniform sampler2D uTexture; -uniform vec3 uGamma; -varying vec2 vTexCoord; -void main() { -vec4 color = texture2D(uTexture, vTexCoord); -vec3 correction = (1.0 / uGamma); -color.r = pow(color.r, correction.r); -color.g = pow(color.g, correction.g); -color.b = pow(color.b, correction.b); -gl_FragColor = color; -gl_FragColor.rgb *= color.a; -}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],h.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var r=e.imageData,t=r.data,n=this.gamma,a=t.length,i=1/n[0],l=1/n[1],u=1/n[2],d;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),d=0,a=256;d'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),r=this.fontSize;return e.width+=r*e.zoomX,e.height+=r*e.zoomY,e},_render:function(e){var r=this.path;r&&!r.isNotVisible()&&r._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){this.paintFirst==="stroke"?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,r,t){if(e.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":e.textBaseline="middle";break;case"ascender":e.textBaseline="top";break;case"descender":e.textBaseline="bottom";break}e.font=this._getFontDeclaration(r,t)},calcTextWidth:function(){for(var e=this.getLineWidth(0),r=1,t=this._textLines.length;re&&(e=n)}return e},_renderTextLine:function(e,r,t,n,a,i){this._renderChars(e,r,t,n,a,i)},_renderTextLinesBackground:function(e){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var r,t,n=e.fillStyle,a,i,l=this._getLeftOffset(),u=this._getTopOffset(),d=0,g=0,p,v,_=this.path,T,A=0,X=this._textLines.length;A=0:tv?g%=v:g<0&&(g+=v),this._setGraphemeOnPath(g,l,p),g+=l.kernedWidth}return{width:r,numOfSpaces:u}},_setGraphemeOnPath:function(e,r,t){var n=e+r.kernedWidth/2,a=this.path,i=s.util.getPointOnPath(a.path,n,a.segmentsInfo);r.renderLeft=i.x-t.x,r.renderTop=i.y-t.y,r.angle=i.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(e,r,t,n,a){var i=this.getCompleteStyleDeclaration(r,t),l=n?this.getCompleteStyleDeclaration(r,t-1):{},u=this._measureChar(e,i,n,l),d=u.kernedWidth,g=u.width,p;this.charSpacing!==0&&(p=this._getWidthOfCharSpacing(),g+=p,d+=p);var v={width:g,left:0,height:i.fontSize,kernedWidth:d,deltaY:i.deltaY};if(t>0&&!a){var _=this.__charBounds[r][t-1];v.left=_.left+_.width+u.kernedWidth-u.width}return v},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var r=this._textLines[e],t=this.getHeightOfChar(e,0),n=1,a=r.length;n0){var b=p+i+T;this.direction==="rtl"&&(b=this.width-b-A),g&&U&&(e.fillStyle=U,e.fillRect(b,_+J*n+l,A,this.fontSize/15)),T=X.left,A=X.width,g=W,U=V,n=a,l=u}else A+=X.kernedWidth;var b=p+i+T;this.direction==="rtl"&&(b=this.width-b-A),e.fillStyle=V,W&&V&&e.fillRect(b,_+J*n+l,A-q,this.fontSize/15),v+=t}this._removeShadow(e)}},_getFontDeclaration:function(e,r){var t=e||this,n=this.fontFamily,a=s.Text.genericFonts.indexOf(n.toLowerCase())>-1,i=n===void 0||n.indexOf("'")>-1||n.indexOf(",")>-1||n.indexOf('"')>-1||a?t.fontFamily:'"'+t.fontFamily+'"';return[s.isLikelyNode?t.fontWeight:t.fontStyle,s.isLikelyNode?t.fontStyle:t.fontWeight,r?this.CACHE_FONT_SIZE+"px":t.fontSize+"px",i].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var r=e.split(this._reNewline),t=new Array(r.length),n=[` -`],a=[],i=0;i"u"?this.styles:{line:this.styles[c]};for(var h in s)for(var o in s[h])for(var e in s[h][o])return!1;return!0},styleHas:function(c,s){if(!this.styles||!c||c===""||typeof s<"u"&&!this.styles[s])return!1;var h=typeof s>"u"?this.styles:{0:this.styles[s]};for(var o in h)for(var e in h[o])if(typeof h[o][e][c]<"u")return!0;return!1},cleanStyle:function(c){if(!this.styles||!c||c==="")return!1;var s=this.styles,h=0,o,e,r=!0,t=0,n;for(var a in s){o=0;for(var i in s[a]){var n=s[a][i],l=n.hasOwnProperty(c);h++,l?(e?n[c]!==e&&(r=!1):e=n[c],n[c]===this[c]&&delete n[c]):r=!1,Object.keys(n).length!==0?o++:delete s[a][i]}o===0&&delete s[a]}for(var u=0;u"u"&&(c=this.selectionStart);for(var h=s?this._unwrappedTextLines:this._textLines,o=h.length,e=0;e"u"&&(c=this.selectionStart||0),typeof s>"u"&&(s=this.selectionEnd||c);for(var o=[],e=c;e"u"&&(s=this.selectionStart||0),typeof h>"u"&&(h=this.selectionEnd||s);for(var o=s;o"u"?this[e]:h[e];return o},_setStyleDeclaration:function(c,s,h){this.styles[c][s]=h},_deleteStyleDeclaration:function(c,s){delete this.styles[c][s]},_getLineStyle:function(c){return!!this.styles[c]},_setLineStyle:function(c){this.styles[c]={}},_deleteLineStyle:function(c){delete this.styles[c]}})}(),function(){function c(s){s.textDecoration&&(s.textDecoration.indexOf("underline")>-1&&(s.underline=!0),s.textDecoration.indexOf("line-through")>-1&&(s.linethrough=!0),s.textDecoration.indexOf("overline")>-1&&(s.overline=!0),delete s.textDecoration)}f.IText=f.util.createClass(f.Text,f.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(s,h){this.callSuper("initialize",s,h),this.initBehavior()},setSelectionStart:function(s){s=Math.max(s,0),this._updateAndFire("selectionStart",s)},setSelectionEnd:function(s){s=Math.min(s,this.text.length),this._updateAndFire("selectionEnd",s)},_updateAndFire:function(s,h){this[s]!==h&&(this._fireSelectionChanged(),this[s]=h),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(s){this.clearContextTop(),this.callSuper("render",s),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(s){this.callSuper("_render",s)},clearContextTop:function(s){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var h=this.canvas.contextTop,o=this.canvas.viewportTransform;h.save(),h.transform(o[0],o[1],o[2],o[3],o[4],o[5]),this.transform(h),this._clearTextArea(h),s||h.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var s=this._getCursorBoundaries(),h=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(s,h):this.renderSelection(s,h),h.restore()}},_clearTextArea:function(s){var h=this.width+4,o=this.height+4;s.clearRect(-h/2,-o/2,h,o)},_getCursorBoundaries:function(s){typeof s>"u"&&(s=this.selectionStart);var h=this._getLeftOffset(),o=this._getTopOffset(),e=this._getCursorBoundariesOffsets(s);return{left:h,top:o,leftOffset:e.left,topOffset:e.top}},_getCursorBoundariesOffsets:function(s){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var h,o,e,r=0,t=0,n,a=this.get2DCursorLocation(s);e=a.charIndex,o=a.lineIndex;for(var i=0;i0?t:0)},this.direction==="rtl"&&(n.left*=-1),this.cursorOffsetCache=n,this.cursorOffsetCache},renderCursor:function(s,h){var o=this.get2DCursorLocation(),e=o.lineIndex,r=o.charIndex>0?o.charIndex-1:0,t=this.getValueOfPropertyAt(e,r,"fontSize"),n=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/n,i=s.topOffset,l=this.getValueOfPropertyAt(e,r,"deltaY");i+=(1-this._fontSizeFraction)*this.getHeightOfLine(e)/this.lineHeight-t*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(s,h),h.fillStyle=this.cursorColor||this.getValueOfPropertyAt(e,r,"fill"),h.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,h.fillRect(s.left+s.leftOffset-a/2,i+s.top+l,a,t)},renderSelection:function(s,h){for(var o=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,e=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=this.textAlign.indexOf("justify")!==-1,t=this.get2DCursorLocation(o),n=this.get2DCursorLocation(e),a=t.lineIndex,i=n.lineIndex,l=t.charIndex<0?0:t.charIndex,u=n.charIndex<0?0:n.charIndex,d=a;d<=i;d++){var g=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),v=0,_=0,T=0;if(d===a&&(_=this.__charBounds[a][l].left),d>=a&&d1)&&(p/=this.lineHeight);var X=s.left+g+_,W=T-_,N=p,V=0;this.inCompositionMode?(h.fillStyle=this.compositionColor||"black",N=1,V=p):h.fillStyle=this.selectionColor,this.direction==="rtl"&&(X=this.width-X-W),h.fillRect(X,s.top+s.topOffset+V,W,N),s.topOffset+=v}},getCurrentCharFontSize:function(){var s=this._getCurrentCharIndex();return this.getValueOfPropertyAt(s.l,s.c,"fontSize")},getCurrentCharColor:function(){var s=this._getCurrentCharIndex();return this.getValueOfPropertyAt(s.l,s.c,"fill")},_getCurrentCharIndex:function(){var s=this.get2DCursorLocation(this.selectionStart,!0),h=s.charIndex>0?s.charIndex-1:0;return{l:s.lineIndex,c:h}}}),f.IText.fromObject=function(s,h){var o=f.util.stylesFromArray(s.styles,s.text),e=Object.assign({},s,{styles:o});if(c(e),e.styles)for(var r in e.styles)for(var t in e.styles[r])c(e.styles[r][t]);f.Object._fromObject("IText",e,h,"text")}}(),function(){var c=f.util.object.clone;f.util.object.extend(f.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var s=this;this.on("added",function(){var h=s.canvas;h&&(h._hasITextHandlers||(h._hasITextHandlers=!0,s._initCanvasHandlers(h)),h._iTextInstances=h._iTextInstances||[],h._iTextInstances.push(s))})},initRemovedHandler:function(){var s=this;this.on("removed",function(){var h=s.canvas;h&&(h._iTextInstances=h._iTextInstances||[],f.util.removeFromArray(h._iTextInstances,s),h._iTextInstances.length===0&&(h._hasITextHandlers=!1,s._removeCanvasHandlers(h)))})},_initCanvasHandlers:function(s){s._mouseUpITextHandler=function(){s._iTextInstances&&s._iTextInstances.forEach(function(h){h.__isMousedown=!1})},s.on("mouse:up",s._mouseUpITextHandler)},_removeCanvasHandlers:function(s){s.off("mouse:up",s._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(s,h,o,e){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},s.animate("_currentCursorOpacity",h,{duration:o,onComplete:function(){r.isAborted||s[e]()},onChange:function(){s.canvas&&s.selectionStart===s.selectionEnd&&s.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var s=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){s._currentTickCompleteState=s._animateCursor(s,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(s){var h=this,o=s?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){h._tick()},o)},abortCursorAnimation:function(){var s=this._currentTickState||this._currentTickCompleteState,h=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,s&&h&&h.clearContext(h.contextTop||h.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(s){var h=0,o=s-1;if(this._reSpace.test(this._text[o]))for(;this._reSpace.test(this._text[o]);)h++,o--;for(;/\S/.test(this._text[o])&&o>-1;)h++,o--;return s-h},findWordBoundaryRight:function(s){var h=0,o=s;if(this._reSpace.test(this._text[o]))for(;this._reSpace.test(this._text[o]);)h++,o++;for(;/\S/.test(this._text[o])&&o-1;)h++,o--;return s-h},findLineBoundaryRight:function(s){for(var h=0,o=s;!/\n/.test(this._text[o])&&o0&&ethis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=h):(this.selectionStart=h,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==o||this.selectionEnd!==e)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(s,h,o){var e=o.slice(0,s),r=f.util.string.graphemeSplit(e).length;if(s===h)return{selectionStart:r,selectionEnd:r};var t=o.slice(s,h),n=f.util.string.graphemeSplit(t).length;return{selectionStart:r,selectionEnd:r+n}},fromGraphemeToStringSelection:function(s,h,o){var e=o.slice(0,s),r=e.join("").length;if(s===h)return{selectionStart:r,selectionEnd:r};var t=o.slice(s,h),n=t.join("").length;return{selectionStart:r,selectionEnd:r+n}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var s=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=s.selectionStart,this.hiddenTextarea.selectionEnd=s.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var s=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=s.selectionEnd,this.inCompositionMode||(this.selectionStart=s.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var s=this._calcTextareaPosition();this.hiddenTextarea.style.left=s.left,this.hiddenTextarea.style.top=s.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var s=this.inCompositionMode?this.compositionStart:this.selectionStart,h=this._getCursorBoundaries(s),o=this.get2DCursorLocation(s),e=o.lineIndex,r=o.charIndex,t=this.getValueOfPropertyAt(e,r,"fontSize")*this.lineHeight,n=h.leftOffset,a=this.calcTransformMatrix(),i={x:h.left+n,y:h.top+h.topOffset+t},l=this.canvas.getRetinaScaling(),u=this.canvas.upperCanvasEl,d=u.width/l,g=u.height/l,p=d-t,v=g-t,_=u.clientWidth/d,T=u.clientHeight/g;return i=f.util.transformPoint(i,a),i=f.util.transformPoint(i,this.canvas.viewportTransform),i.x*=_,i.y*=T,i.x<0&&(i.x=0),i.x>p&&(i.x=p),i.y<0&&(i.y=0),i.y>v&&(i.y=v),i.x+=this.canvas._offset.left,i.y+=this.canvas._offset.top,{left:i.x+"px",top:i.y+"px",fontSize:t+"px",charHeight:t}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var s=this._textBeforeEdit!==this.text,h=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,h&&(h.blur&&h.blur(),h.parentNode&&h.parentNode.removeChild(h)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),s&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),s&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var s in this.styles)this._textLines[s]||delete this.styles[s]},removeStyleFromTo:function(s,h){var o=this.get2DCursorLocation(s,!0),e=this.get2DCursorLocation(h,!0),r=o.lineIndex,t=o.charIndex,n=e.lineIndex,a=e.charIndex,i,l;if(r!==n){if(this.styles[r])for(i=t;i=a&&(l[d-u]=l[g],delete l[g])}},shiftLineStyles:function(s,h){var o=c(this.styles);for(var e in this.styles){var r=parseInt(e,10);r>s&&(this.styles[r+h]=o[r],o[r-h]||delete this.styles[r])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(s,h,o,e){var r,t={},n=!1,a=this._unwrappedTextLines[s].length===h;o||(o=1),this.shiftLineStyles(s,o),this.styles[s]&&(r=this.styles[s][h===0?h:h-1]);for(var i in this.styles[s]){var l=parseInt(i,10);l>=h&&(n=!0,t[l-h]=this.styles[s][i],a&&h===0||delete this.styles[s][i])}var u=!1;for(n&&!a&&(this.styles[s+o]=t,u=!0),u&&o--;o>0;)e&&e[o-1]?this.styles[s+o]={0:c(e[o-1])}:r?this.styles[s+o]={0:c(r)}:delete this.styles[s+o],o--;this._forceClearCache=!0},insertCharStyleObject:function(s,h,o,e){this.styles||(this.styles={});var r=this.styles[s],t=r?c(r):{};o||(o=1);for(var n in t){var a=parseInt(n,10);a>=h&&(r[a+o]=t[a],t[a-o]||delete r[a])}if(this._forceClearCache=!0,e){for(;o--;)Object.keys(e[o]).length&&(this.styles[s]||(this.styles[s]={}),this.styles[s][h+o]=c(e[o]));return}if(r)for(var i=r[h?h-1:1];i&&o--;)this.styles[s][h+o]=c(i)},insertNewStyleBlock:function(s,h,o){for(var e=this.get2DCursorLocation(h,!0),r=[0],t=0,n=0;n0&&(this.insertCharStyleObject(e.lineIndex,e.charIndex,r[0],o),o=o&&o.slice(r[0]+1)),t&&this.insertNewlineStyleObject(e.lineIndex,e.charIndex+r[0],t);for(var n=1;n0?this.insertCharStyleObject(e.lineIndex+n,0,r[n],o):o&&this.styles[e.lineIndex+n]&&o[0]&&(this.styles[e.lineIndex+n][0]=o[0]),o=o&&o.slice(r[n]+1);r[n]>0&&this.insertCharStyleObject(e.lineIndex+n,0,r[n],o)},setSelectionStartEndWithShift:function(s,h,o){o<=s?(h===s?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=s),this.selectionStart=o):o>s&&os?this.selectionStart=s:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>s?this.selectionEnd=s:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),f.util.object.extend(f.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(c){if(this.canvas){this.__newClickTime=+new Date;var s=c.pointer;this.isTripleClick(s)&&(this.fire("tripleclick",c),this._stopEvent(c.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=s,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(c){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===c.x&&this.__lastPointer.y===c.y},_stopEvent:function(c){c.preventDefault&&c.preventDefault(),c.stopPropagation&&c.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(c){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(c.e))},tripleClickHandler:function(c){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(c.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(c){!this.canvas||!this.editable||c.e.button&&c.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(c.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(c){!this.canvas||!this.editable||c.e.button&&c.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(c){if(this.__isMousedown=!1,!(!this.editable||this.group||c.transform&&c.transform.actionPerformed||c.e.button&&c.e.button!==1)){if(this.canvas){var s=this.canvas._activeObject;if(s&&s!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(c.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(c){var s=this.getSelectionStartFromPointer(c),h=this.selectionStart,o=this.selectionEnd;c.shiftKey?this.setSelectionStartEndWithShift(h,o,s):(this.selectionStart=s,this.selectionEnd=s),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(c){for(var s=this.getLocalPointer(c),h=0,o=0,e=0,r=0,t=0,n,a,i=0,l=this._textLines.length;i0&&(r+=this._textLines[i-1].length+this.missingNewlineOffset(i-1));n=this._getLineLeftOffset(t),o=n*this.scaleX,a=this._textLines[t],this.direction==="rtl"&&(s.x=this.width*this.scaleX-s.x+o);for(var u=0,d=a.length;ur||t<0?0:1,a=o+n;return this.flipX&&(a=e-a),a>this._text.length&&(a=this._text.length),a}}),f.util.object.extend(f.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=f.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var c=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+c.top+"; left: "+c.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+c.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):f.document.body.appendChild(this.hiddenTextarea),f.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),f.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),f.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),f.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),f.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),f.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(f.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(c){if(this.isEditing){var s=this.direction==="rtl"?this.keysMapRtl:this.keysMap;if(c.keyCode in s)this[s[c.keyCode]](c);else if(c.keyCode in this.ctrlKeysMapDown&&(c.ctrlKey||c.metaKey))this[this.ctrlKeysMapDown[c.keyCode]](c);else return;c.stopImmediatePropagation(),c.preventDefault(),c.keyCode>=33&&c.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(c){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(c.keyCode in this.ctrlKeysMapUp&&(c.ctrlKey||c.metaKey))this[this.ctrlKeysMapUp[c.keyCode]](c);else return;c.stopImmediatePropagation(),c.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(c){var s=this.fromPaste;if(this.fromPaste=!1,c&&c.stopPropagation(),!!this.isEditing){var h=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,o=this._text.length,e=h.length,r,t,n=e-o,a=this.selectionStart,i=this.selectionEnd,l=a!==i,u,d,g;if(this.hiddenTextarea.value===""){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var p=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),v=a>p.selectionStart;l?(r=this._text.slice(a,i),n+=i-a):e0&&(o=this.__charBounds[c][s-1],h+=o.left+o.width),h},getDownCursorOffset:function(c,s){var h=this._getSelectionForOffset(c,s),o=this.get2DCursorLocation(h),e=o.lineIndex;if(e===this._textLines.length-1||c.metaKey||c.keyCode===34)return this._text.length-h;var r=o.charIndex,t=this._getWidthBeforeCursor(e,r),n=this._getIndexOnLine(e+1,t),a=this._textLines[e].slice(r);return a.length+n+1+this.missingNewlineOffset(e)},_getSelectionForOffset:function(c,s){return c.shiftKey&&this.selectionStart!==this.selectionEnd&&s?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(c,s){var h=this._getSelectionForOffset(c,s),o=this.get2DCursorLocation(h),e=o.lineIndex;if(e===0||c.metaKey||c.keyCode===33)return-h;var r=o.charIndex,t=this._getWidthBeforeCursor(e,r),n=this._getIndexOnLine(e-1,t),a=this._textLines[e].slice(0,r),i=this.missingNewlineOffset(e-1);return-this._textLines[e-1].length+n-a.length+(1-i)},_getIndexOnLine:function(c,s){for(var h=this._textLines[c],o=this._getLineLeftOffset(c),e=o,r=0,t,n,a=0,i=h.length;as){n=!0;var l=e-t,u=e,d=Math.abs(l-s),g=Math.abs(u-s);r=g=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",c)},moveCursorUp:function(c){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",c)},_moveCursorUpOrDown:function(c,s){var h="get"+c+"CursorOffset",o=this[h](s,this._selectionDirection==="right");s.shiftKey?this.moveCursorWithShift(o):this.moveCursorWithoutShift(o),o!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(c){var s=this._selectionDirection==="left"?this.selectionStart+c:this.selectionEnd+c;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,s),c!==0},moveCursorWithoutShift:function(c){return c<0?(this.selectionStart+=c,this.selectionEnd=this.selectionStart):(this.selectionEnd+=c,this.selectionStart=this.selectionEnd),c!==0},moveCursorLeft:function(c){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",c)},_move:function(c,s,h){var o;if(c.altKey)o=this["findWordBoundary"+h](this[s]);else if(c.metaKey||c.keyCode===35||c.keyCode===36)o=this["findLineBoundary"+h](this[s]);else return this[s]+=h==="Left"?-1:1,!0;if(typeof o<"u"&&this[s]!==o)return this[s]=o,!0},_moveLeft:function(c,s){return this._move(c,s,"Left")},_moveRight:function(c,s){return this._move(c,s,"Right")},moveCursorLeftWithoutShift:function(c){var s=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(s=this._moveLeft(c,"selectionStart")),this.selectionEnd=this.selectionStart,s},moveCursorLeftWithShift:function(c){if(this._selectionDirection==="right"&&this.selectionStart!==this.selectionEnd)return this._moveLeft(c,"selectionEnd");if(this.selectionStart!==0)return this._selectionDirection="left",this._moveLeft(c,"selectionStart")},moveCursorRight:function(c){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",c)},_moveCursorLeftOrRight:function(c,s){var h="moveCursor"+c+"With";this._currentCursorOpacity=1,s.shiftKey?h+="Shift":h+="outShift",this[h](s)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(c){if(this._selectionDirection==="left"&&this.selectionStart!==this.selectionEnd)return this._moveRight(c,"selectionStart");if(this.selectionEnd!==this._text.length)return this._selectionDirection="right",this._moveRight(c,"selectionEnd")},moveCursorRightWithoutShift:function(c){var s=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(s=this._moveRight(c,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,s},removeChars:function(c,s){typeof s>"u"&&(s=c+1),this.removeStyleFromTo(c,s),this._text.splice(c,s-c),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(c,s,h,o){typeof o>"u"&&(o=h),o>h&&this.removeStyleFromTo(h,o);var e=f.util.string.graphemeSplit(c);this.insertNewStyleBlock(e,h,s),this._text=[].concat(this._text.slice(0,h),e,this._text.slice(o)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var c=f.util.toFixed,s=/ +/g;f.util.object.extend(f.Text.prototype,{_toSVG:function(){var h=this._getSVGLeftTopOffsets(),o=this._getSVGTextAndBg(h.textTop,h.textLeft);return this._wrapSVGTextAndBg(o)},toSVG:function(h){return this._createBaseSVGMarkup(this._toSVG(),{reviver:h,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(h){var o=!0,e=this.getSvgTextDecoration(this);return[h.textBgRects.join(""),' ",h.textSpans.join(""),` -`]},_getSVGTextAndBg:function(h,o){var e=[],r=[],t=h,n;this._setSVGBg(r);for(var a=0,i=this._textLines.length;a",f.util.string.escapeXml(h),""].join("")},_setSVGTextLineText:function(h,o,e,r){var t=this.getHeightOfLine(o),n=this.textAlign.indexOf("justify")!==-1,a,i,l="",u,d,g=0,p=this._textLines[o],v;r+=t*(1-this._fontSizeFraction)/this.lineHeight;for(var _=0,T=p.length-1;_<=T;_++)v=_===T||this.charSpacing,l+=p[_],u=this.__charBounds[o][_],g===0?(e+=u.kernedWidth-u.width,g+=u.width):g+=u.kernedWidth,n&&!v&&this._reSpaceAndTab.test(p[_])&&(v=!0),v||(a=a||this.getCompleteStyleDeclaration(o,_),i=this.getCompleteStyleDeclaration(o,_+1),v=f.util.hasStyleChanged(a,i,!0)),v&&(d=this._getStyleDeclaration(o,_)||{},h.push(this._createTextCharSpan(l,d,e,r)),l="",a=i,e+=g,g=0)},_pushTextBgRect:function(h,o,e,r,t,n){var a=f.Object.NUM_FRACTION_DIGITS;h.push(" -`)},_setSVGTextLineBg:function(h,o,e,r){for(var t=this._textLines[o],n=this.getHeightOfLine(o)/this.lineHeight,a=0,i=0,l,u,d=this.getValueOfPropertyAt(o,0,"textBackgroundColor"),g=0,p=t.length;gthis.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(h){for(var o=0,e=0,r=0,t={},n=0;n0?(e=0,r++,o++):!this.splitByGrapheme&&this._reSpaceAndTab.test(h.graphemeText[r])&&n>0&&(e++,r++),t[n]={line:o,offset:e},r+=h.graphemeLines[n].length,e+=h.graphemeLines[n].length;return t},styleHas:function(h,o){if(this._styleMap&&!this.isWrapping){var e=this._styleMap[o];e&&(o=e.line)}return s.Text.prototype.styleHas.call(this,h,o)},isEmptyStyles:function(h){if(!this.styles)return!0;var o=0,e=h+1,r,t,n=!1,a=this._styleMap[h],i=this._styleMap[h+1];a&&(h=a.line,o=a.offset),i&&(e=i.line,n=e===h,r=i.offset),t=typeof h>"u"?this.styles:{line:this.styles[h]};for(var l in t)for(var u in t[l])if(u>=o&&(!n||ue&&!T?(a.push(i),i=[],t=p,T=!0):t+=A,!T&&!n&&i.push(g),i=i.concat(u),v=n?0:this._measureWord([g],o,d),d++,T=!1,p>_&&(_=p);return W&&a.push(i),_+X>this.dynamicMinWidth&&(this.dynamicMinWidth=_-A+X),a},isEndOfWrapping:function(h){return!this._styleMap[h+1]||this._styleMap[h+1].line!==this._styleMap[h].line},missingNewlineOffset:function(h){return this.splitByGrapheme?this.isEndOfWrapping(h)?1:0:1},_splitTextIntoLines:function(h){for(var o=s.Text.prototype._splitTextIntoLines.call(this,h),e=this._wrapText(o.lines,this.width),r=new Array(e.length),t=0;tun.getLogger("esri.layers.graphics.featureConversionUtils"),H={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0},dn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t},O=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2]},mn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+3]},gn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2],n[e+3]=r[o+3]};function q(n,r,e,o){if(n){if(e)return r&&o?gn:O;if(r&&o)return mn}else if(r&&o)return O;return dn}function j({scale:n,translate:r},e){return Math.round((e-r[0])/n[0])}function z({scale:n,translate:r},e){return Math.round((r[1]-e)/n[1])}function L({scale:n,translate:r},e,o){return e*n[o]+r[o]}function En(n,r,e){return n?r?e?U(n):E(n):e?R(n):k(n):null}function k(n){const r=n.coords;return{x:r[0],y:r[1]}}function Q(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n}function E(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2]}}function yn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n}function R(n){const r=n.coords;return{x:r[0],y:r[1],m:r[2]}}function pn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.m,n}function U(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2],m:r[3]}}function bn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n.coords[3]=r.m,n}function wn(n,r,e,o){let s=k;e&&o?s=U:e?s=E:o&&(s=R);for(const t of r){const{geometry:u,attributes:c}=t,i=u!=null?s(u):null;n.push({attributes:c,geometry:i})}return n}function Y(n,r){return n&&r?bn:n?yn:r?pn:Q}function Mn(n,r,e,o,s){const t=Y(e,o);for(const{geometry:u,attributes:c}of r){const i=u!=null?t(new P,u):null;n.push(new F(i,c,null,s?c[s]:void 0))}return n}function In(n,r,e=Y(r.z!=null,r.m!=null)){return e(n,r)}function Gn(n,r,e,o){for(const{geometry:s,attributes:t}of r)n.push({attributes:t,geometry:s!=null?W(s,e,o):null});return n}function W(n,r,e){if(n==null)return null;const o=p(r,e),s=[];for(let t=0;t=i&&(n.lengths.push(v),I=g)}return G(n.coords,I),n.coords.length?n:null}function Cn(n,r,e,o,s,t,u=e,c=o){if(N(n),!r?.coords.length)return null;const i=H[s],{coords:l,lengths:a}=r,f=p(e,o),h=p(e&&u,o&&c),d=q(e,o,u,c);if(!a.length)return d(n.coords,l,0,0,l[0],l[1]),N(n,f,0),n;let m=0;const y=t*t;for(const w of a){if(w=i?n.lengths.push(I):G(n.coords,M*h),m+=w*f}return n.coords.length?n:null}function kn(n,r,e,o){const s=n[r],t=n[r+1],u=n[e],c=n[e+1],i=n[o],l=n[o+1];let a=u,f=c,h=i-a,d=l-f;if(h!==0||d!==0){const m=((s-a)*h+(t-f)*d)/(h*h+d*d);m>1?(a=i,f=l):m>0&&(a+=h*m,f+=d*m)}return h=s-a,d=t-f,h*h+d*d}function _(n,r,e,o,s,t,u){let c,i=o,l=0;for(let a=t+e;ai&&(l=a,i=c);i>o&&(l-t>e&&_(n,r,e,o,s,t,l),s(n,r,n.length,l,r[l],r[l+1]),u-l>e&&_(n,r,e,o,s,l,u))}function Hn(n,r,e,o){if(!r?.coords?.length)return null;const s=p(e,o);let t=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(r&&r.coords){const l=r.coords;for(let a=0;aun.getLogger("esri.layers.graphics.featureConversionUtils"),H={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0},dn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t},O=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2]},mn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+3]},gn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2],n[e+3]=r[o+3]};function q(n,r,e,o){if(n){if(e)return r&&o?gn:O;if(r&&o)return mn}else if(r&&o)return O;return dn}function j({scale:n,translate:r},e){return Math.round((e-r[0])/n[0])}function z({scale:n,translate:r},e){return Math.round((r[1]-e)/n[1])}function L({scale:n,translate:r},e,o){return e*n[o]+r[o]}function En(n,r,e){return n?r?e?U(n):E(n):e?R(n):k(n):null}function k(n){const r=n.coords;return{x:r[0],y:r[1]}}function Q(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n}function E(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2]}}function yn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n}function R(n){const r=n.coords;return{x:r[0],y:r[1],m:r[2]}}function pn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.m,n}function U(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2],m:r[3]}}function bn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n.coords[3]=r.m,n}function wn(n,r,e,o){let s=k;e&&o?s=U:e?s=E:o&&(s=R);for(const t of r){const{geometry:u,attributes:c}=t,i=u!=null?s(u):null;n.push({attributes:c,geometry:i})}return n}function Y(n,r){return n&&r?bn:n?yn:r?pn:Q}function Mn(n,r,e,o,s){const t=Y(e,o);for(const{geometry:u,attributes:c}of r){const i=u!=null?t(new P,u):null;n.push(new F(i,c,null,s?c[s]:void 0))}return n}function In(n,r,e=Y(r.z!=null,r.m!=null)){return e(n,r)}function Gn(n,r,e,o){for(const{geometry:s,attributes:t}of r)n.push({attributes:t,geometry:s!=null?W(s,e,o):null});return n}function W(n,r,e){if(n==null)return null;const o=p(r,e),s=[];for(let t=0;t=i&&(n.lengths.push(v),I=g)}return G(n.coords,I),n.coords.length?n:null}function Cn(n,r,e,o,s,t,u=e,c=o){if(N(n),!r?.coords.length)return null;const i=H[s],{coords:l,lengths:a}=r,f=p(e,o),h=p(e&&u,o&&c),d=q(e,o,u,c);if(!a.length)return d(n.coords,l,0,0,l[0],l[1]),N(n,f,0),n;let m=0;const y=t*t;for(const w of a){if(w=i?n.lengths.push(I):G(n.coords,M*h),m+=w*f}return n.coords.length?n:null}function kn(n,r,e,o){const s=n[r],t=n[r+1],u=n[e],c=n[e+1],i=n[o],l=n[o+1];let a=u,f=c,h=i-a,d=l-f;if(h!==0||d!==0){const m=((s-a)*h+(t-f)*d)/(h*h+d*d);m>1?(a=i,f=l):m>0&&(a+=h*m,f+=d*m)}return h=s-a,d=t-f,h*h+d*d}function _(n,r,e,o,s,t,u){let c,i=o,l=0;for(let a=t+e;ai&&(l=a,i=c);i>o&&(l-t>e&&_(n,r,e,o,s,t,l),s(n,r,n.length,l,r[l],r[l+1]),u-l>e&&_(n,r,e,o,s,l,u))}function Hn(n,r,e,o){if(!r?.coords?.length)return null;const s=p(e,o);let t=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(r&&r.coords){const l=r.coords;for(let a=0;an.layer.layerId)),a}function j(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function C(e){e.layers||=[],e.tables||=[]}function q(e,t){const a=[],r=[];for(const{layer:o}of t){const{isTable:s,layerId:n}=o;s?r.push(n):a.push(n)}m(e.layers,a),m(e.tables,r)}function m(e,t){if(e.length<2)return;const a=[];for(const{id:r}of e)a.push(r);w(a.sort(p),t.slice().sort(p))&&e.sort((r,o)=>{const s=t.indexOf(r.id),n=t.indexOf(o.id);return sn?1:0})}function p(e,t){return et?1:0}async function B(e,t,a){const{url:r,customParameters:o,apiKey:s}=t,{serviceJSON:n,layersJSON:i}=await x(r,{customParameters:o,apiKey:s}),c=E(e.layers,n.layers,a),u=E(e.tables,n.tables,a);e.layers=c.itemResources,e.tables=u.itemResources;const y=[...c.added,...u.added],S=i?[...i.layers,...i.tables]:[];await U(e,y,r,S)}function E(e,t,a){const r=$(e,t,(s,n)=>s.id===n.id);e=e.filter(s=>!r.removed.some(n=>n.id===s.id));const o=r.added;return o.forEach(({id:s})=>{e.push({id:s})}),{itemResources:e,added:o.filter(({id:s})=>!a.includes(s))}}async function U(e,t,a,r){const o=await V(t),s=t.map(({id:n,type:i})=>new(o.get(i))({url:a,layerId:n,sourceJSON:r.find(({id:c})=>c===n)}));await Promise.allSettled(s.map(n=>n.load())),s.forEach(n=>{const{layerId:i,loaded:c,defaultPopupTemplate:u}=n;if(!c||u==null)return;const y={id:i,popupInfo:u.toJSON()};n.operationalLayerType!=="ArcGISFeatureLayer"&&(y.layerType=n.operationalLayerType),v(n,y,e)})}async function V(e){const t=[];e.forEach(({type:o})=>{const s=g(o),n=D[s];t.push(n())});const a=await Promise.all(t),r=new Map;return e.forEach(({type:o},s)=>{r.set(o,a[s])}),r}function v(e,t,a){e.isTable?I(a.tables,t):I(a.layers,t)}function I(e,t){const a=e.findIndex(({id:r})=>r===t.id);a===-1?e.push(t):e[a]=t}function Z(e,t){const a=e.layers.some(r=>r.layerType==="OrientedImageryLayer");f(t,l.ORIENTED_IMAGERY_LAYER,a)}function k(e,t){const a=e.some(r=>r.type==="oriented-imagery");f(t,l.ORIENTED_IMAGERY_LAYER,a)}async function z(e,t,a){Z(a,t)}async function H(e,t){const{url:a,layerId:r,title:o,fullExtent:s,isTable:n}=e,i=R(a);t.url=(i?.serverType==="FeatureServer"?a:`${a}/${r}`)??null,t.title||=o,t.extent=null,n||s==null||(t.extent=await J(s)),d(t,l.METADATA),d(t,l.MULTI_LAYER),M(t,l.SINGLE_LAYER),f(t,l.TABLE,n),k([e],t)}async function le(e,t){return N({layer:e,itemType:T,validateLayer:h,createItemData:(a,r)=>F(r,[a]),errorNamePrefix:Y,setItemProperties:z},t)}async function ue(e,t,a){return O({layer:e,itemType:T,validateLayer:h,createItemData:(r,o)=>Promise.resolve(L(r)),errorNamePrefix:_,newItem:t,setItemProperties:H},a)}export{le as save,ue as saveAs}; diff --git a/main/assets/featureLayerUtils-BlPdhYbm-DR3CjbQa.js b/main/assets/featureLayerUtils-BlPdhYbm-DR3CjbQa.js deleted file mode 100644 index d276abc2a..000000000 --- a/main/assets/featureLayerUtils-BlPdhYbm-DR3CjbQa.js +++ /dev/null @@ -1 +0,0 @@ -import{jc as P,hq as w,ao as $}from"./main-BZaw9FpY.js";import{C as N,D as O}from"./utils-BVWK2jiA-Ewzf326n.js";import{i as R}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{d as x,p as D,g}from"./fetchService-DbaKmJhP-CtznRt8p.js";import{S as J,l as d,u as M,L as f,E as l}from"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./jsonContext-BA8GHqVk-BMETb6sX.js";import"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";const T="Feature Service",A="feature-layer-utils",Y=`${A}-save`,_=`${A}-save-as`;function h(e){return{isValid:P(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function b(e){const t=[],a=[];for(const{layer:r,layerJSON:o}of e)r.isTable?a.push(o):t.push(o);return{layers:t,tables:a}}function L(e){return b([e])}async function F(e,t){return/\/\d+\/?$/.test(e.url)?L(t[0]):G(t,e)}async function G(e,t){if(e.reverse(),!t)return b(e);const a=await K(t,e);for(const r of e)v(r.layer,r.layerJSON,a);return q(a,e),a}async function K(e,t){let a=await e.fetchData("json");if(j(a))return a;a||={},C(a);const{layer:{url:r,customParameters:o,apiKey:s}}=t[0];return await B(a,{url:r??"",customParameters:o,apiKey:s},t.map(n=>n.layer.layerId)),a}function j(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function C(e){e.layers||=[],e.tables||=[]}function q(e,t){const a=[],r=[];for(const{layer:o}of t){const{isTable:s,layerId:n}=o;s?r.push(n):a.push(n)}m(e.layers,a),m(e.tables,r)}function m(e,t){if(e.length<2)return;const a=[];for(const{id:r}of e)a.push(r);w(a.sort(p),t.slice().sort(p))&&e.sort((r,o)=>{const s=t.indexOf(r.id),n=t.indexOf(o.id);return sn?1:0})}function p(e,t){return et?1:0}async function B(e,t,a){const{url:r,customParameters:o,apiKey:s}=t,{serviceJSON:n,layersJSON:i}=await x(r,{customParameters:o,apiKey:s}),c=E(e.layers,n.layers,a),u=E(e.tables,n.tables,a);e.layers=c.itemResources,e.tables=u.itemResources;const y=[...c.added,...u.added],S=i?[...i.layers,...i.tables]:[];await U(e,y,r,S)}function E(e,t,a){const r=$(e,t,(s,n)=>s.id===n.id);e=e.filter(s=>!r.removed.some(n=>n.id===s.id));const o=r.added;return o.forEach(({id:s})=>{e.push({id:s})}),{itemResources:e,added:o.filter(({id:s})=>!a.includes(s))}}async function U(e,t,a,r){const o=await V(t),s=t.map(({id:n,type:i})=>new(o.get(i))({url:a,layerId:n,sourceJSON:r.find(({id:c})=>c===n)}));await Promise.allSettled(s.map(n=>n.load())),s.forEach(n=>{const{layerId:i,loaded:c,defaultPopupTemplate:u}=n;if(!c||u==null)return;const y={id:i,popupInfo:u.toJSON()};n.operationalLayerType!=="ArcGISFeatureLayer"&&(y.layerType=n.operationalLayerType),v(n,y,e)})}async function V(e){const t=[];e.forEach(({type:o})=>{const s=g(o),n=D[s];t.push(n())});const a=await Promise.all(t),r=new Map;return e.forEach(({type:o},s)=>{r.set(o,a[s])}),r}function v(e,t,a){e.isTable?I(a.tables,t):I(a.layers,t)}function I(e,t){const a=e.findIndex(({id:r})=>r===t.id);a===-1?e.push(t):e[a]=t}function Z(e,t){const a=e.layers.some(r=>r.layerType==="OrientedImageryLayer");f(t,l.ORIENTED_IMAGERY_LAYER,a)}function k(e,t){const a=e.some(r=>r.type==="oriented-imagery");f(t,l.ORIENTED_IMAGERY_LAYER,a)}async function z(e,t,a){Z(a,t)}async function H(e,t){const{url:a,layerId:r,title:o,fullExtent:s,isTable:n}=e,i=R(a);t.url=(i?.serverType==="FeatureServer"?a:`${a}/${r}`)??null,t.title||=o,t.extent=null,n||s==null||(t.extent=await J(s)),d(t,l.METADATA),d(t,l.MULTI_LAYER),M(t,l.SINGLE_LAYER),f(t,l.TABLE,n),k([e],t)}async function le(e,t){return N({layer:e,itemType:T,validateLayer:h,createItemData:(a,r)=>F(r,[a]),errorNamePrefix:Y,setItemProperties:z},t)}async function ue(e,t,a){return O({layer:e,itemType:T,validateLayer:h,createItemData:(r,o)=>Promise.resolve(L(r)),errorNamePrefix:_,newItem:t,setItemProperties:H},a)}export{le as save,ue as saveAs}; diff --git a/main/assets/featureLayerUtils-DgfQQyK4-D0OGSvJx.js b/main/assets/featureLayerUtils-DgfQQyK4-D0OGSvJx.js new file mode 100644 index 000000000..700f8a19f --- /dev/null +++ b/main/assets/featureLayerUtils-DgfQQyK4-D0OGSvJx.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-3W9GNLNT.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{aK as A,o as s,_ as g,eM as v,eN as P,eO as j,d4 as L,ep as E,eP as R,V as m,dr as C}from"./main-C7yV2j71.js";import{s as S}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{p as I,a as F}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{b as f}from"./Query-BrwMGK8U-DV_czrJX.js";import{p as _}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{d as M}from"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{c as T,d as x}from"./RelationshipQuery-DJsz3K0U-BHNd_b19.js";async function V(t,e,r){e=e.clone(),t.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=q(t));const n=D(t),a=t.capabilities.query.supportsPagination;e.start=0,e.num=n;let o=null;for(;;){const i=await t.source.queryFeaturesJSON(e,r);if(o==null?o=i:o.features=o.features.concat(i.features),o.exceededTransferLimit=i.exceededTransferLimit,!a||!i.exceededTransferLimit)break;e.start+=n}return o}function D(t){return q(t)*N(t)}function N(t){return t.capabilities.query.maxRecordCount||2e3}function q(t){return t.capabilities.query.supportsMaxRecordCountFactor?f.MAX_MAX_RECORD_COUNT_FACTOR:1}const K=new A({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function W(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.addAttachment)throw new s(n,"Layer source does not support addAttachment capability");return a.addAttachment(e,r)}function w(t,e,r){const{attributes:n}=e,{objectIdField:a}=t;return t.capabilities?.data?.supportsAttachment?e?n?a&&n[a]?Promise.resolve():Promise.reject(new s(r,`feature is missing the identifying attribute ${a}`)):Promise.reject(new s(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new s(r,"A feature is required to add/delete/update attachments")):Promise.reject(new s(r,"this layer doesn't support attachments"))}async function Y(t,e,r,n,a){const o=await d(t);if(await w(t,e,a),!o.updateAttachment)throw new s(a,"Layer source does not support updateAttachment capability");return o.updateAttachment(e,r,n)}async function tt(t,e,r){const{applyEdits:n}=await g(()=>import("./editingSupport-gUqP9iyf-3W9GNLNT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),a=await t.load();let o=r;return a.type==="feature"&&a.infoFor3D&&e.deleteFeatures!=null&&a.globalIdField!=null&&(o={...o,globalIdToObjectId:await $(a,e.deleteFeatures,a.globalIdField)}),n(a,a.source,e,r)}async function et(t,e,r){const{uploadAssets:n}=await g(()=>import("./editingSupport-gUqP9iyf-3W9GNLNT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),a=await t.load();return n(a,a.source,e,r)}async function nt(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.deleteAttachments)throw new s(n,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(e,r)}async function rt(t,e,r){const n=(await t.load({signal:e?.signal})).source;if(!n.fetchRecomputedExtents)throw new s(r,"Layer source does not support fetchUpdates capability");return n.fetchRecomputedExtents(e)}async function at(t,e,r,n){e=T.from(e),await t.load();const a=t.source,o=t.capabilities;if(!o?.data?.supportsAttachment)throw new s(n,"this layer doesn't support attachments");const{attachmentTypes:i,objectIds:l,globalIds:y,num:u,size:c,start:p,where:b}=e;if(!o?.operations?.supportsQueryAttachments&&(i?.length>0||y?.length>0||c?.length>0||u||p||b))throw new s(n,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(l?.length||y?.length||b))throw new s(n,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!a.queryAttachments)throw new s(n,"Layer source does not support queryAttachments capability",e);return a.queryAttachments(e)}async function ot(t,e,r,n){const a=await d(t);if(!a.queryObjectIds)throw new s(n,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(f.from(e)??t.createQuery(),r)}async function st(t,e,r,n){const a=await d(t);if(!a.queryFeatureCount)throw new s(n,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(f.from(e)??t.createQuery(),r)}async function it(t,e,r,n){const a=await d(t);if(!a.queryExtent)throw new s(n,"Layer source does not support queryExtent capability");return a.queryExtent(f.from(e)??t.createQuery(),r)}async function ut(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeatures)throw new s(n,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(x.from(e),r)}async function ct(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeaturesCount)throw new s(n,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(x.from(e),r)}async function lt(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(n!=null&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await v(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function pt(t){const e=new f,r=t.capabilities?.data,n=t.capabilities?.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),r.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:a,timeExtent:o}=t;return e.timeExtent=a!=null&&o!=null?o.offset(-a.value,a.unit):o||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function dt(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeGlobalID")return n.name}}function ft(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeOID")return n.name}}function yt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}function mt(t,e){const{subtypes:r,subtypeField:n}=t;if(!e?.attributes||!r?.length||!n)return null;const a=e.attributes[n];return a==null?null:r.find(o=>o.code===a)}function ht(t,e){const{fieldsIndex:r,subtypeField:n}=t,{name:a,type:o}=r.get(e)??{};if(!a)return null;if((n&&r.get(n)?.name)===a&&t.subtypes?.length){const i=t.subtypes.map(l=>new I({code:O(l.code,o),name:l.name}));if(i?.length)return new F({codedValues:i})}return null}function wt(t,e){const{fieldsIndex:r}=t,{name:n,type:a}=r.get(e)??{};if(!n)return null;if(("typeIdField"in t?r.get(t.typeIdField)?.name:null)===n&&"types"in t&&t.types?.length){const o=t.types.map(i=>new I({code:O(i.id,a),name:i.name}));return new F({codedValues:o})}return null}function O(t,e){return e?P({type:e})&&typeof t=="number"?`${t}`:j({type:e})&&typeof t=="string"?Number.parseInt(t,10):t:t}async function d(t){return(await t.load()).source}async function G(t,e){if(!m||m.findCredential(t))return;let r;try{const n=await C(t,e);n&&(r=await m.checkSignInStatus(`${n}/sharing`))}catch{}if(r)try{const n=e!=null?e.signal:null;await m.getCredential(t,{signal:n})}catch{}}async function bt(t,e,r){const n=t.parsedUrl?.path;n&&t.authenticationTriggerEvent===e&&await G(n,r)}function gt(t){return!Q(t)&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const h=L({types:E});function It(t,e){if(t.defaultSymbol)return t.types?.length?new M({defaultSymbol:h(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map(r=>({id:r.id,symbol:h(r.symbol,r,e)}))}):new _({symbol:h(t.defaultSymbol,t,e)})}function Ft(t){let e=t.sourceJSON?.cacheMaxAge;if(!e)return!1;const r=t.editingInfo?.lastEditDate?.getTime();return r==null||(e*=1e3,Date.now()-r{let c=null;if("attributes"in u){const{attributes:p}=u;c={globalId:p[r],objectId:p[a]!=null&&p[a]!==-1?p[a]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||n.push(c.globalId))}),n.length===0)return null;const o=t.createQuery();o.where=n.map(u=>`${r}='${u}'`).join(" OR "),o.returnGeometry=!1,o.outFields=[a,r],o.cacheHint=!1;const i=await R(V(t,o));if(!i.ok)return null;const l=new Map,y=i.value.features;for(const u of y){const c=u.attributes[r],p=u.attributes[a];c!=null&&p!=null&&p!==-1&&l.set(S(c),p)}return l}function xt(t,e,r){if(!e||!r||!t)return null;const n=r.getAttribute(e);return n==null?null:t.find(a=>{const{id:o}=a;return o!=null&&o.toString()===n.toString()})??null}function Q(t){return t.sourceJSON?.isMultiServicesView||J(t)}function J(t){return!!t.sourceJSON?.capabilities?.toLowerCase().split(",").map(e=>e.trim()).includes("map")}function qt(t,e,r){const n=e?.queryBins;if(!n)throw new s(r,"Layer source does not support binning");switch(t.binParameters.type){case"auto-interval":if(!n.supportsAutoInterval)throw new s(r,"Layer source does not support auto-interval binning");break;case"date":if(!n.supportsDate)throw new s(r,"Layer source does not support date binning");break;case"fixed-boundaries":if(!n.supportsFixedBoundaries)throw new s(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!n.supportsFixedInterval)throw new s(r,"Layer source does not support fixed-interval binning")}const a=n?.supportedStatistics;if(t.outStatistics&&a){const o=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:i}of t.outStatistics){const l=o.get(i);if(l&&!a[l])throw new s(r,`Layer source does not support ${i} statistic type`)}}}export{Y as $,$ as A,at as B,ot as H,st as K,Q as O,W as Q,tt as U,ut as W,it as X,ct as Y,et as Z,nt as _,yt as a,bt as c,Ft as d,lt as e,xt as f,wt as i,K as k,gt as l,qt as m,dt as n,mt as o,It as p,ft as r,ht as s,pt as t,rt as z}; diff --git a/main/assets/featureLayerUtils-DgfQQyK4-D6z7j0IK.js b/main/assets/featureLayerUtils-DgfQQyK4-D6z7j0IK.js deleted file mode 100644 index ace7cbc72..000000000 --- a/main/assets/featureLayerUtils-DgfQQyK4-D6z7j0IK.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-Bz3XNCt8.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{aK as A,o as s,_ as g,eM as v,eN as P,eO as j,d4 as L,ep as E,eP as R,V as m,dr as C}from"./main-BZaw9FpY.js";import{s as S}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{p as I,a as F}from"./Field-C6hA1tZj-CbELM0zp.js";import{b as f}from"./Query-BrwMGK8U-sojFdYaD.js";import{p as _}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{d as M}from"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{c as T,d as x}from"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";async function V(t,e,r){e=e.clone(),t.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=q(t));const n=D(t),a=t.capabilities.query.supportsPagination;e.start=0,e.num=n;let o=null;for(;;){const i=await t.source.queryFeaturesJSON(e,r);if(o==null?o=i:o.features=o.features.concat(i.features),o.exceededTransferLimit=i.exceededTransferLimit,!a||!i.exceededTransferLimit)break;e.start+=n}return o}function D(t){return q(t)*N(t)}function N(t){return t.capabilities.query.maxRecordCount||2e3}function q(t){return t.capabilities.query.supportsMaxRecordCountFactor?f.MAX_MAX_RECORD_COUNT_FACTOR:1}const K=new A({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function W(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.addAttachment)throw new s(n,"Layer source does not support addAttachment capability");return a.addAttachment(e,r)}function w(t,e,r){const{attributes:n}=e,{objectIdField:a}=t;return t.capabilities?.data?.supportsAttachment?e?n?a&&n[a]?Promise.resolve():Promise.reject(new s(r,`feature is missing the identifying attribute ${a}`)):Promise.reject(new s(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new s(r,"A feature is required to add/delete/update attachments")):Promise.reject(new s(r,"this layer doesn't support attachments"))}async function Y(t,e,r,n,a){const o=await d(t);if(await w(t,e,a),!o.updateAttachment)throw new s(a,"Layer source does not support updateAttachment capability");return o.updateAttachment(e,r,n)}async function tt(t,e,r){const{applyEdits:n}=await g(()=>import("./editingSupport-gUqP9iyf-Bz3XNCt8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),a=await t.load();let o=r;return a.type==="feature"&&a.infoFor3D&&e.deleteFeatures!=null&&a.globalIdField!=null&&(o={...o,globalIdToObjectId:await $(a,e.deleteFeatures,a.globalIdField)}),n(a,a.source,e,r)}async function et(t,e,r){const{uploadAssets:n}=await g(()=>import("./editingSupport-gUqP9iyf-Bz3XNCt8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),a=await t.load();return n(a,a.source,e,r)}async function nt(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.deleteAttachments)throw new s(n,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(e,r)}async function rt(t,e,r){const n=(await t.load({signal:e?.signal})).source;if(!n.fetchRecomputedExtents)throw new s(r,"Layer source does not support fetchUpdates capability");return n.fetchRecomputedExtents(e)}async function at(t,e,r,n){e=T.from(e),await t.load();const a=t.source,o=t.capabilities;if(!o?.data?.supportsAttachment)throw new s(n,"this layer doesn't support attachments");const{attachmentTypes:i,objectIds:l,globalIds:y,num:u,size:c,start:p,where:b}=e;if(!o?.operations?.supportsQueryAttachments&&(i?.length>0||y?.length>0||c?.length>0||u||p||b))throw new s(n,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(l?.length||y?.length||b))throw new s(n,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!a.queryAttachments)throw new s(n,"Layer source does not support queryAttachments capability",e);return a.queryAttachments(e)}async function ot(t,e,r,n){const a=await d(t);if(!a.queryObjectIds)throw new s(n,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(f.from(e)??t.createQuery(),r)}async function st(t,e,r,n){const a=await d(t);if(!a.queryFeatureCount)throw new s(n,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(f.from(e)??t.createQuery(),r)}async function it(t,e,r,n){const a=await d(t);if(!a.queryExtent)throw new s(n,"Layer source does not support queryExtent capability");return a.queryExtent(f.from(e)??t.createQuery(),r)}async function ut(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeatures)throw new s(n,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(x.from(e),r)}async function ct(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeaturesCount)throw new s(n,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(x.from(e),r)}async function lt(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(n!=null&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await v(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function pt(t){const e=new f,r=t.capabilities?.data,n=t.capabilities?.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),r.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:a,timeExtent:o}=t;return e.timeExtent=a!=null&&o!=null?o.offset(-a.value,a.unit):o||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function dt(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeGlobalID")return n.name}}function ft(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeOID")return n.name}}function yt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}function mt(t,e){const{subtypes:r,subtypeField:n}=t;if(!e?.attributes||!r?.length||!n)return null;const a=e.attributes[n];return a==null?null:r.find(o=>o.code===a)}function ht(t,e){const{fieldsIndex:r,subtypeField:n}=t,{name:a,type:o}=r.get(e)??{};if(!a)return null;if((n&&r.get(n)?.name)===a&&t.subtypes?.length){const i=t.subtypes.map(l=>new I({code:O(l.code,o),name:l.name}));if(i?.length)return new F({codedValues:i})}return null}function wt(t,e){const{fieldsIndex:r}=t,{name:n,type:a}=r.get(e)??{};if(!n)return null;if(("typeIdField"in t?r.get(t.typeIdField)?.name:null)===n&&"types"in t&&t.types?.length){const o=t.types.map(i=>new I({code:O(i.id,a),name:i.name}));return new F({codedValues:o})}return null}function O(t,e){return e?P({type:e})&&typeof t=="number"?`${t}`:j({type:e})&&typeof t=="string"?Number.parseInt(t,10):t:t}async function d(t){return(await t.load()).source}async function G(t,e){if(!m||m.findCredential(t))return;let r;try{const n=await C(t,e);n&&(r=await m.checkSignInStatus(`${n}/sharing`))}catch{}if(r)try{const n=e!=null?e.signal:null;await m.getCredential(t,{signal:n})}catch{}}async function bt(t,e,r){const n=t.parsedUrl?.path;n&&t.authenticationTriggerEvent===e&&await G(n,r)}function gt(t){return!Q(t)&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const h=L({types:E});function It(t,e){if(t.defaultSymbol)return t.types?.length?new M({defaultSymbol:h(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map(r=>({id:r.id,symbol:h(r.symbol,r,e)}))}):new _({symbol:h(t.defaultSymbol,t,e)})}function Ft(t){let e=t.sourceJSON?.cacheMaxAge;if(!e)return!1;const r=t.editingInfo?.lastEditDate?.getTime();return r==null||(e*=1e3,Date.now()-r{let c=null;if("attributes"in u){const{attributes:p}=u;c={globalId:p[r],objectId:p[a]!=null&&p[a]!==-1?p[a]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||n.push(c.globalId))}),n.length===0)return null;const o=t.createQuery();o.where=n.map(u=>`${r}='${u}'`).join(" OR "),o.returnGeometry=!1,o.outFields=[a,r],o.cacheHint=!1;const i=await R(V(t,o));if(!i.ok)return null;const l=new Map,y=i.value.features;for(const u of y){const c=u.attributes[r],p=u.attributes[a];c!=null&&p!=null&&p!==-1&&l.set(S(c),p)}return l}function xt(t,e,r){if(!e||!r||!t)return null;const n=r.getAttribute(e);return n==null?null:t.find(a=>{const{id:o}=a;return o!=null&&o.toString()===n.toString()})??null}function Q(t){return t.sourceJSON?.isMultiServicesView||J(t)}function J(t){return!!t.sourceJSON?.capabilities?.toLowerCase().split(",").map(e=>e.trim()).includes("map")}function qt(t,e,r){const n=e?.queryBins;if(!n)throw new s(r,"Layer source does not support binning");switch(t.binParameters.type){case"auto-interval":if(!n.supportsAutoInterval)throw new s(r,"Layer source does not support auto-interval binning");break;case"date":if(!n.supportsDate)throw new s(r,"Layer source does not support date binning");break;case"fixed-boundaries":if(!n.supportsFixedBoundaries)throw new s(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!n.supportsFixedInterval)throw new s(r,"Layer source does not support fixed-interval binning")}const a=n?.supportedStatistics;if(t.outStatistics&&a){const o=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:i}of t.outStatistics){const l=o.get(i);if(l&&!a[l])throw new s(r,`Layer source does not support ${i} statistic type`)}}}export{Y as $,$ as A,at as B,ot as H,st as K,Q as O,W as Q,tt as U,ut as W,it as X,ct as Y,et as Z,nt as _,yt as a,bt as c,Ft as d,lt as e,xt as f,wt as i,K as k,gt as l,qt as m,dt as n,mt as o,It as p,ft as r,ht as s,pt as t,rt as z}; diff --git a/main/assets/featureReferenceUtils-Ct4KY5u7-ByRyweVx.js b/main/assets/featureReferenceUtils-Ct4KY5u7-ByRyweVx.js deleted file mode 100644 index d4e601c8d..000000000 --- a/main/assets/featureReferenceUtils-Ct4KY5u7-ByRyweVx.js +++ /dev/null @@ -1 +0,0 @@ -import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./main-BZaw9FpY.js";import{d as n}from"./sphere-BenPORjV-CgNvGf8s.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./boundedPlane-DlvE0eNx-BetNH2zh.js";function y(t,l){return e(t)===e(l)}function e(t){if(t==null)return null;const l=t.layer!=null?t.layer.id:"";let r=null;return r=t.objectId!=null?t.objectId:t.layer!=null&&"objectIdField"in t.layer&&t.layer.objectIdField!=null&&t.attributes!=null?t.attributes[t.layer.objectIdField]:t.uid,r==null?null:`o-${l}-${r}`}const j={json:{write:{writer:u,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:i}}}};function u(t,l){t?.layer?.objectIdField!=null&&t.attributes!=null&&(l.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})}function i(t){if(t.layerId!=null&&t.objectId!=null)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}n();export{y as n,j as u}; diff --git a/main/assets/featureReferenceUtils-Ct4KY5u7-Cgw_hpcQ.js b/main/assets/featureReferenceUtils-Ct4KY5u7-Cgw_hpcQ.js new file mode 100644 index 000000000..0ebb22daf --- /dev/null +++ b/main/assets/featureReferenceUtils-Ct4KY5u7-Cgw_hpcQ.js @@ -0,0 +1 @@ +import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./main-C7yV2j71.js";import{d as n}from"./sphere-BenPORjV-CiIWUavi.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./boundedPlane-DlvE0eNx-DhJ9Zyo3.js";function y(t,l){return e(t)===e(l)}function e(t){if(t==null)return null;const l=t.layer!=null?t.layer.id:"";let r=null;return r=t.objectId!=null?t.objectId:t.layer!=null&&"objectIdField"in t.layer&&t.layer.objectIdField!=null&&t.attributes!=null?t.attributes[t.layer.objectIdField]:t.uid,r==null?null:`o-${l}-${r}`}const j={json:{write:{writer:u,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:i}}}};function u(t,l){t?.layer?.objectIdField!=null&&t.attributes!=null&&(l.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})}function i(t){if(t.layerId!=null&&t.objectId!=null)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}n();export{y as n,j as u}; diff --git a/main/assets/featureSetUtils-wd4FcF3A-Dl4vKkUg.js b/main/assets/featureSetUtils-wd4FcF3A-Dl4vKkUg.js deleted file mode 100644 index a85f1dcee..000000000 --- a/main/assets/featureSetUtils-wd4FcF3A-Dl4vKkUg.js +++ /dev/null @@ -1 +0,0 @@ -import{J as te,t as Ne,O as Le,bi as E,bV as P,d as Ae,bM as Pe,f as j,g as Oe,V as le,aB as oe}from"./main-BZaw9FpY.js";import{ae as U,r as Ee,af as je}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{p as x,b as y,v as O,y as I,f as b,D as M,U as T,W as Ge,J as qe,z as Be,G as J,M as ue,R as de,O as he,t as Ue,a as Ie,I as Me,A as g,e as W,V as We,x as Qe,c as Ve}from"./SpatialFilter-BlQBFhwz-DQzQDaNp.js";import{L as ie,y as S,I as Ze,a as R,D as ce,N as pe,w as fe,P as ye,x as _e,B as re,d as $e,R as be,U as Je,j as ge}from"./shared-D1w-26bA-Cy2KeMh-.js";import{Z as C,n as v,a as k,r as Ke,u as ze}from"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import{I as He,O as Xe,m as Ye}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{k as Ce,g as Te}from"./MD5-CHHr-oed-SuyrCYQ0.js";import{y as G}from"./Field-C6hA1tZj-CbELM0zp.js";import{o as et}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{N as tt,h as it}from"./arcadeUtils-DpP0k7IY-DIwxqttO.js";import N from"./FeatureLayer-BrRKw5Si-CHreUEJ9.js";import{c as rt,d as me}from"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import{b as z,m as we}from"./Query-BrwMGK8U-sojFdYaD.js";import{y as st}from"./FeatureType-C9hJmS6_-pVJc0p7X.js";import{D as H}from"./Layer-ChoECxvZ-C4wLrCej.js";import at from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./geometryEngineAsync-D7oEu5dd-DTqB2IHB.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./versionUtils-LZYZz-38-xZnsxhiL.js";import"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";let Re=class{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(u,e,t){this._layerById[e]=t,this._layerByName[u]=t}async featureSetByName(u,e=!0,t=["*"]){return this._layerByName[u]===void 0?null:this._layerByName[u]}async featureSetById(u,e=!0,t=["*"]){return this._layerById[u]===void 0?null:this._layerById[u]}castToText(u=!1){return"object, FeatureSetCollection"}};class q extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof C?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new te({wkid:4326}),this.geometryType=ie.point)}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),this._whereClauseFunction!==null?this._wset=new y(t._candidates.slice().concat(t._known.slice()),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new y(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent?._isInFeatureSet(e);return t===S.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?S.Unknown:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause?.testFeature(e)??!1}async executeWhereClauseDeferred(e){if(this._whereClauseFunction!==null){const t=this._whereClauseFunction(e);return Ne(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){const r=new y([],e,!1,null),s=Math.min(t,e.length);if(await this._parent?._getFeatures(r,-1,s,i),this._checkCancelled(i),this._whereClauseFunction==null){for(let n=0;n":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return Be(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":qe(e.column);case"data-type":return e.value;case"function":{const d=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,s);return Ge(e.name,d,t)}}throw new v(k.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof C?this.reverseLkp[C.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}}F.BADNESS="_!!!_BAD_LKP_!!!!";class lt extends ${constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:M(e,this.field.name,T(this._sql,R.Standardised),t.getFieldsIndex())}}extractValue(e){return C.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}let ot=class extends x{static findField(u,e){for(const t of u)if(t.name.toLowerCase()===e.toString().toLowerCase())return t;return null}constructor(u){super(u),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=u.extraFilter,this._parent=u.parentfeatureset,this._maxProcessing=30,this.adaptedFields=u.adaptedFields}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new te({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ie.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const u of this.adaptedFields)u.postInitialization(this,this._parent),this.fields.push(u.field)}async _getSet(u){if(this._wset===null){await this._ensureLoaded();let e=null;return e=this._extraFilter?await this._getFilteredSet("",null,null,null,u):await this._parent?._getSet(u),this._checkCancelled(u),Le(e),this._wset=new y(e._candidates.slice(),e._known.slice(),e._ordered,this._clonePageDefinition(e.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(u){return this._parent._isInFeatureSet(u)}async _getFeatures(u,e,t,i){const r=[];e!==-1&&this._featureCache[e]===void 0&&r.push(e);const s=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(u,s)===!0)return await this._expandPagedSet(u,s,0,0,i),this._getFeatures(u,e,t,i);let a=0;for(let o=u._lastFetchedIndex;o=s)));o++);if(r.length===0)return"success";u=new y([],r,u._ordered,null);const n=Math.min(r.length,t);await this._parent?._getFeatures(u,-1,n,i),this._checkCancelled(i);const l=[];for(let o=0;o0&&(i=i.replaceFields(d))}t!==null?this._extraFilter!==null&&(t=O(this._extraFilter,t)):t=this._extraFilter,await this._ensureLoaded();const l=await this._parent._getFilteredSet(u,e,t,i,r);let o;return this._checkCancelled(r),o=s===!0?new y(l._candidates.slice().concat(l._known.slice()),[],n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)):new y(l._candidates.slice(),l._known.slice(),n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)),o}_reformulateWithoutAdaptions(u){const e={cannot:!1,where:u};if(u!==null){for(const t of this.adaptedFields)if(Ie(u,t.field.name)===!0){const i=t.rewriteSql(u,this);if(i.rewritten!==!0){e.cannot=!0,e.where=null;break}e.where=i.where}}return e}async _stat(u,e,t,i,r,s,a){let n=!1,l=this._reformulateWithoutAdaptions(e);if(n=l.cannot,e=l.where,l=this._reformulateWithoutAdaptions(r),n=n||l.cannot,(r=l.where)!==null?this._extraFilter!==null&&(r=O(this._extraFilter,r)):r=this._extraFilter,n===!0)return r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1};const o=await this._parent._stat(u,e,t,i,r,s,a);return o.calculated===!1?r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1}:o}async _canDoAggregates(u,e,t,i,r){if(this._parent===null)return!1;for(let n=0;n{for(let r=0;r0?(await U(this._refineSetBlock(e,this._maxProcessingRate(),r)),this._checkCancelled(r),this.getIdColumnDictionary(e,t,i,r)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new I(b.NeverReach)}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r===null?this._orderbyclause:r,s);this._checkCancelled(s);const n=new y(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition));let l=!0;if(a._candidates.length>0&&(l=!1),n._ordered===!1){let o=await this.manualOrderSet(n,s);return l===!1&&(t===null&&i===null||(o=new y(o._candidates.slice().concat(o._known.slice()),[],o._ordered,this._clonePageDefinition(o.pagesDefinition)))),o}return n}static registerAction(){x._featuresetFunctions.orderBy=function(e){return e===""?this:new De({parentfeatureset:this,orderbyclause:new B(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function ut(u){if(u.parseTree.type==="function"){if(u.parseTree.args.value.length===0)return{name:u.parseTree.name,expr:null};if(u.parseTree.args.value.length>1)throw new v(k.MissingStatisticParameters);const e=C.create(Ve(u.parseTree.args.value[0],R.Standardised,u.parameters),{fieldsIndex:u.fieldsIndex,timeZone:u.timeZone,currentUser:u.currentUser});return{name:u.parseTree.name,expr:e}}return null}let Se=class ee{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ee;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const s=new ee;s.field=e;const a=C.create(t,{fieldsIndex:i,timeZone:r}),n=ut(a);if(n===null)throw new v(k.UnsupportedSqlFunction,{function:""});const l=n.name.toUpperCase().trim();if(l==="MIN"){if(s.typeofstat="MIN",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(s.typeofstat="MAX",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")s.typeofstat="COUNT",s.workingexpr=n.expr;else if(l==="STDEV"){if(s.typeofstat="STDDEV",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(s.typeofstat="SUM",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new v(k.UnsupportedSqlFunction,{function:l});if(s.typeofstat="VAR",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"var"})}return s}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}};function dt(u){if(!u)return"COUNT";switch(u.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}let ht=class ve extends x{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return S.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const r=this._parent?this._parent.getFieldsIndex():new et([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let a=!1;for(let n=0;n0)for(const a of this._parent.fields)this._adaptedFields.push(new X(a));for(let a=0;a0&&(l=new ot({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),n.nowhereclause===!0)a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:l,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let o=l;if(i!==null){let d=null;i&&(d=this._reformulateWhereClauseWithoutGroupByFields(i)),o=new q({parentfeatureset:o,whereclause:d})}a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:o,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return a}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=M(e,t.tofieldname,T(t.workingexpr,R.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=M(e,t.tofieldname,T(t.expression,R.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const s of r){const a={geometry:s.geometry,attributes:{}},n={};for(const l in s.attributes)n[l.toLowerCase()]=s.attributes[l];for(const l of this._decodedGroupbyfield)a.attributes[l.tofieldname]=n[l.name.toLowerCase()];for(const l of this._decodedStatsfield)a.attributes[l.tofieldname]=n[l.field.toLowerCase()];this._featureCache[a.attributes[this.objectIdField]]=new E(a)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((s,a)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?s(r.length):this._nextAggregateItem(e,t,i,r,n=>{n===null?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))},a)})}_nextAggregateItem(e,t,i,r,s,a){try{U(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(null);else{const l=this._generateAggregateHash(n);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const o=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(o)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,r,s,a)}},a)}catch(n){a(n)}}_calculateFieldStat(e,t,i){const r=[];for(const s of e.features)if(t.workingexpr!==null){const a=t.workingexpr.calculateValue(s);a!==null&&(a instanceof Xe||a instanceof Ye?r.push(a.toNumber()):a instanceof Ke?r.push(a.toMilliseconds()):r.push(a))}else r.push(null);i.attributes[t.tofieldname]=ze(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const r of this._decodedGroupbyfield){const s=r.singlefield?e.features[0].attributes[r.singlefield]:C.convertValueToStorageFormat(r.expression.calculateValue(e.features[0]),r.sqlType);t.attributes[r.tofieldname]=s}for(const r of this._decodedStatsfield)this._calculateFieldStat(e,r,t);const i=[];for(let r=0;rthis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===S.NotInFeatureSet)return t;const i=this._idstates[e];return i===S.InFeatureSet||i===S.NotInFeatureSet?i:t===S.InFeatureSet&&i===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let n=e._known.length;return n>0&&e._known[n-1]==="GETPAGES"&&(e._known.length=n-1),n=e._candidates.length,n>0&&e._candidates[n-1]==="GETPAGES"&&(e._candidates.length=n-1),"success"}const a=await this._parent._expandPagedSet(e,t,i,r,s);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,i,r){const s=[],a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);t!==-1&&this._featureCache[t]===void 0&&s.push(t);let n=0;for(let d=e._lastFetchedIndex;da)));d++);if(s.length===0)return"success";const l=new y([],s,!1,null),o=Math.min(s.length,i);await this._parent._getFeatures(l,-1,o,r);for(let d=0;d=this._topnum)break}else if(n===S.NotInFeatureSet)r===null?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),i+=1;else if(n===S.Unknown)break;if(i>=t)break}r!==null&&s.push(r);for(let a=s.length-1;a>=0;a--)e._candidates.splice(s[a].start,s[a].end-s[a].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){x._featuresetFunctions.top=function(e){return new se({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}class Q extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Je(e.toJSON());return Ce(t,Te.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=R.StandardisedNoInterval,e!=null&&e>=10.61&&(this._databaseType=R.Standardised)):e!=null&&(e>=10.5&&(this._databaseType=R.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=R.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_isInFeatureSet(){return S.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new z;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?this._layer.type==="subtype-group"&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const i=t==="execute"?this._layer.queryFeatures.bind(this._layer):t==="executeForCount"?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const s=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(s),r===null&&(r=i(e),this.recentlyUsedQueries.addToCache(s,r),r=r.catch(a=>{throw this.recentlyUsedQueries?.removeFromCache(s),a}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,s){const a=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,s);let n="",l=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=r.constructClause(),l=!0);const o=this._createQuery();o.where=P(o.where,i===null?t===null?"1=1":"":T(i,a)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null,o.geometry=t===null?null:t,o.relationParameter=this._makeRelationshipParam(e);let d=await this.executeQuery(o,"executeForIds");return d===null&&(d=[]),this._checkCancelled(s),new y([],d,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let a="",n=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=r.constructClause(),n=!0);const l=await this.databaseType(),o=i===null?t===null?"1=1":"":T(i,l);let d=this._maxQueryRate();const h=this._layer.capabilities?.query.maxRecordCount;h!=null&&h=this._maxProcessingRate()-1))break}if(a>=i&&s.length===0)break}if(s.length===0)return"success";const n=this._createQuery();n.objectIds=s,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(r),l.error!==void 0)throw new I(b.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let d=0;d=n)break}return p.features.length===0?l:p.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()));const s=e.pagesDefinition.internal.lastRetrieved,a=s,n=e.pagesDefinition.internal.lastPage,l=this._createQuery();if(l.where=P(l.where,r),l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const o=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!o.hasOwnProperty("features"))throw new I(b.InvalidStatResponse);const d=[];if(e.pagesDefinition.internal.lastPage!==n)return[];o.features.length>0&&o.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let h=0;h0||i&&i>0)&&(l.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(l.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:n,query:l,method:"attachments"});const o=await n.queryAttachments(new rt(l)),d=[];return o&&o[e]&&o[e].forEach(h=>{const c=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+h.id.toString();let f=null;s&&h.exifInfo&&(f=tt.convertJsonToArcade(h.exifInfo,"system",!0)),d.push(new it(h.id,h.name,h.contentType,h.size,c,f,h.keywords??null))}),d}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=Pe(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await j(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const r={},s=i.data;if(s?.relatedRecordGroups){const a=s.spatialReference;for(const n of s.relatedRecordGroups){const l=n.objectId,o=[];for(const d of n.relatedRecords){d.geometry&&(d.geometry.spatialReference=a);const h=new E({geometry:d.geometry?Oe(d.geometry):null,attributes:d.attributes});o.push(h)}r[l]={features:o,exceededTransferLimit:s.exceededTransferLimit===!0}}}return r}throw new I(b.InvalidRequest)}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=P(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return r.features.length===1?r.features[0]:null}async getIdentityUser(){await this.load();const e=le?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=le?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const r=await j(t,{query:{f:"json"}});let s="";return r.data?.owningSystemUrl&&(s=r.data.owningSystemUrl),s}catch{return""}}return""}getDataSourceFeatureSet(){const e=new Q({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl.path;if(i){const s=await j(i,{responseType:"json",query:{f:"json"}});e=s?.data?.name??null,t=s?.data?.serviceItemId??null}const r=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:t===""?null:t,serviceLayerUrl:i===""?null:i,webMapLayerId:r?this._layer.id??null:null,webMapLayerTitle:r?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}class V extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this._databaseType=R.Standardised,this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return S.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new E({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){let a="",n=!1;if(r!==null&&(a=r.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=this._layer.createQuery();l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=P(l.where,i===null?t===null?"1=1":"":T(i,R.Standardised)),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=a!==""?a.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const o=await this._layer.queryFeatures(l);if(o===null)return new y([],[],n,null);this._checkCancelled(s);const d=[];return o.features.forEach(h=>{const c=h.attributes[this._layer.objectIdField];d.push(c),this._featureCache[c]=this._changeFeature(h)}),new y([],d,n,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new z;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const r=[];return this._layer.source.items.forEach(s=>{const a=s.attributes[this._layer.objectIdField];r.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new y([],r,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(r=>{const s=r.attributes[this._layer.objectIdField];i.push(s),this._featureCache[s]=this._changeFeature(r)}),this._wset=new y([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);for(let s=e._lastFetchedIndex;si)));s++);if(r.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const p of e.layerDefinition.types)s.push(st.fromJSON(p));let a=e.layerDefinition.geometryType;a===void 0&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let p=!1;for(const m of e.layerDefinition.fields)if(m.type==="oid"||m.type==="esriFieldTypeOID"){i=m.name,p=!0;break}if(p===!1){let m="FID",_=!0,w=0;for(;_;){let A=!0;for(const xe of e.layerDefinition.fields)if(xe.name===m){A=!1;break}A===!0?_=!1:(w++,m="FID"+w.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:m,alias:m});const D=[];for(let A=0;Aw.name):["*"]);o.outFields=d,o.relationshipId=this.relationship.id,o.where="1=1";let h=!0;this._removeGeometry===!0&&(h=!1),o.returnGeometry=h,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null;const c=await a.source.queryRelatedFeatures(o);this._checkCancelled(s);const f=c[this._findObjectId]?c[this._findObjectId].features:[],p=[];for(let w=0;ww.name):["*"]);return p=new y(c||f?["GETPAGES"]:[],c||f?[]:["GETPAGES"],n,{outFields:_.join(","),resultRecordCount:d,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:a,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,d,0,0,s),p}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new me;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==a)return 0;const d=o[this._findObjectId]?o[this._findObjectId].features:[];for(let c=0;ci)))&&!(n>=i&&s.length===0);l++);if(s.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function pt(){g.applicationCache===null&&(g.applicationCache=new g)}async function Z(u,e,t){if(g.applicationCache){const i=g.applicationCache.getLayerInfo(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();if(g.applicationCache){g.applicationCache.setLayerInfo(u,s);try{return await s,r}catch(a){throw g.applicationCache.clearLayerInfo(u),a}}return await s,r}if(t!=null){const i=t.getCachedLayerMetadata(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();t.setCachedLayerMetadata(u,s);try{return await s,r}catch(a){throw t.removeCachedLayerMetadata(u,s),a}}return new N({url:u,outFields:e})}async function ae(u,e,t,i,r,s=null){return L(await Z(u,["*"],r),e,t,i,r,s)}function L(u,e=null,t=null,i=!0,r=null,s=null){switch(u.type){case"catalog-footprint":return L(u.parent,e,t,i,r,s);case"subtype-sublayer":{const a=L(u.parent,e,t,i,r,s);return a.filter(C.create(u.parent.subtypeField+"="+u.subtypeCode.toString(),{fieldsIndex:u.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"wfs":return new V({layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s};return!u.url&&u.source?new V(a):new Q(a)}default:throw new Error(`Unsupported layer type: ${u.type}`)}}async function ft(u){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(u);if(t!==null)return t}const e=(async()=>{const t=await j(u,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(u),t}}return e}async function yt(u,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+u;if(g.applicationCache!==null){const r=g.applicationCache.getLayerInfo(t);if(r!==null)return r}const i=(async()=>{const r=await j(u+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(r.data){const s=r.data;if(s.layerDataElements?.[0])return s.layerDataElements[0]}throw new I(b.DataElementsNotFound)})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(t,i);try{return await i}catch(r){throw g.applicationCache.clearLayerInfo(t),r}}return i}async function ke(u,e){if(g.applicationCache!==null){const i=g.applicationCache.getLayerInfo(u);if(i!==null)return i}if(e!=null){const i=e.getCachedServiceMetadata(u);if(i!=null)return i}const t=(async()=>{const i=await j(u,{responseType:"json",query:{f:"json"}});if(i.data){const r=i.data;return r.layers||(r.layers=[]),r.tables||(r.tables=[]),r}return{layers:[],tables:[]}})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,t);try{return await t}catch(i){throw g.applicationCache.clearLayerInfo(u),i}}if(e!=null){e.setCachedServiceMetadata(u,t);try{return await t}catch(i){throw e.removeCachedServiceMetadata(u,t),i}}return t}async function _t(u,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await ke(u,null);if(t.metadata=i,i.controllerDatasetLayers?.utilityNetworkLayerId!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const a of i.layers)t.layerNameLkp[a.id]=a.name;if(i.tables)for(const a of i.tables)t.layerNameLkp[a.id]=a.name;const r=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=r;const s=await yt(u,r);if(s){t.queryelem=s,t.queryelem?.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const n of t.queryelem.dataElement.domainNetworks){for(const l of n.edgeSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}for(const l of n.junctionSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}}if(t.queryelem.dataElement.terminalConfigurations)for(const n of t.queryelem.dataElement.terminalConfigurations)for(const l of n.terminals)t.terminals.push({terminalId:l.terminalId,terminalName:l.terminalName});const a=await ft(u+"/"+r);if(a.systemLayers?.associationsTableId!==void 0&&a.systemLayers.associationsTableId!==null){const n=[];t.unVersion>=4&&(n.push("STATUS"),n.push("PERCENTALONG"));let l=await ae(u+"/"+a.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...n],!1,null,null);return await l.load(),t.unVersion>=4&&(l=l.filter(C.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC})),await l.load()),{lkp:t.lkp,associations:l,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function gt(u,e,t,i=null,r=null,s=!0,a=null,n=null){let l=u.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const o=await ae(l,i,r,s,a,n);return new ct({layer:u,relatedLayer:o,relationship:e,objectId:t,spatialReference:i,outFields:r,includeGeometry:s,lrucache:a,interceptor:n})}q.registerAction(),ht.registerAction(),Y.registerAction(),Me.registerAction(),se.registerAction();class mt extends Re{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.title===e);if(s!=null)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.title===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}async featureSetById(e,t=!0,i=["*"]){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.id===e);if(s)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.id===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n={...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}}class ne extends Re{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ke(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ne(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let n=0;n":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return Be(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":qe(e.column);case"data-type":return e.value;case"function":{const d=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,s);return Ge(e.name,d,t)}}throw new v(k.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof C?this.reverseLkp[C.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}}F.BADNESS="_!!!_BAD_LKP_!!!!";class lt extends ${constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:M(e,this.field.name,T(this._sql,R.Standardised),t.getFieldsIndex())}}extractValue(e){return C.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}let ot=class extends x{static findField(u,e){for(const t of u)if(t.name.toLowerCase()===e.toString().toLowerCase())return t;return null}constructor(u){super(u),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=u.extraFilter,this._parent=u.parentfeatureset,this._maxProcessing=30,this.adaptedFields=u.adaptedFields}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new te({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ie.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const u of this.adaptedFields)u.postInitialization(this,this._parent),this.fields.push(u.field)}async _getSet(u){if(this._wset===null){await this._ensureLoaded();let e=null;return e=this._extraFilter?await this._getFilteredSet("",null,null,null,u):await this._parent?._getSet(u),this._checkCancelled(u),Le(e),this._wset=new y(e._candidates.slice(),e._known.slice(),e._ordered,this._clonePageDefinition(e.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(u){return this._parent._isInFeatureSet(u)}async _getFeatures(u,e,t,i){const r=[];e!==-1&&this._featureCache[e]===void 0&&r.push(e);const s=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(u,s)===!0)return await this._expandPagedSet(u,s,0,0,i),this._getFeatures(u,e,t,i);let a=0;for(let o=u._lastFetchedIndex;o=s)));o++);if(r.length===0)return"success";u=new y([],r,u._ordered,null);const n=Math.min(r.length,t);await this._parent?._getFeatures(u,-1,n,i),this._checkCancelled(i);const l=[];for(let o=0;o0&&(i=i.replaceFields(d))}t!==null?this._extraFilter!==null&&(t=O(this._extraFilter,t)):t=this._extraFilter,await this._ensureLoaded();const l=await this._parent._getFilteredSet(u,e,t,i,r);let o;return this._checkCancelled(r),o=s===!0?new y(l._candidates.slice().concat(l._known.slice()),[],n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)):new y(l._candidates.slice(),l._known.slice(),n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)),o}_reformulateWithoutAdaptions(u){const e={cannot:!1,where:u};if(u!==null){for(const t of this.adaptedFields)if(Ie(u,t.field.name)===!0){const i=t.rewriteSql(u,this);if(i.rewritten!==!0){e.cannot=!0,e.where=null;break}e.where=i.where}}return e}async _stat(u,e,t,i,r,s,a){let n=!1,l=this._reformulateWithoutAdaptions(e);if(n=l.cannot,e=l.where,l=this._reformulateWithoutAdaptions(r),n=n||l.cannot,(r=l.where)!==null?this._extraFilter!==null&&(r=O(this._extraFilter,r)):r=this._extraFilter,n===!0)return r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1};const o=await this._parent._stat(u,e,t,i,r,s,a);return o.calculated===!1?r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1}:o}async _canDoAggregates(u,e,t,i,r){if(this._parent===null)return!1;for(let n=0;n{for(let r=0;r0?(await U(this._refineSetBlock(e,this._maxProcessingRate(),r)),this._checkCancelled(r),this.getIdColumnDictionary(e,t,i,r)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new I(b.NeverReach)}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r===null?this._orderbyclause:r,s);this._checkCancelled(s);const n=new y(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition));let l=!0;if(a._candidates.length>0&&(l=!1),n._ordered===!1){let o=await this.manualOrderSet(n,s);return l===!1&&(t===null&&i===null||(o=new y(o._candidates.slice().concat(o._known.slice()),[],o._ordered,this._clonePageDefinition(o.pagesDefinition)))),o}return n}static registerAction(){x._featuresetFunctions.orderBy=function(e){return e===""?this:new De({parentfeatureset:this,orderbyclause:new B(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function ut(u){if(u.parseTree.type==="function"){if(u.parseTree.args.value.length===0)return{name:u.parseTree.name,expr:null};if(u.parseTree.args.value.length>1)throw new v(k.MissingStatisticParameters);const e=C.create(Ve(u.parseTree.args.value[0],R.Standardised,u.parameters),{fieldsIndex:u.fieldsIndex,timeZone:u.timeZone,currentUser:u.currentUser});return{name:u.parseTree.name,expr:e}}return null}let Se=class ee{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ee;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const s=new ee;s.field=e;const a=C.create(t,{fieldsIndex:i,timeZone:r}),n=ut(a);if(n===null)throw new v(k.UnsupportedSqlFunction,{function:""});const l=n.name.toUpperCase().trim();if(l==="MIN"){if(s.typeofstat="MIN",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(s.typeofstat="MAX",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")s.typeofstat="COUNT",s.workingexpr=n.expr;else if(l==="STDEV"){if(s.typeofstat="STDDEV",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(s.typeofstat="SUM",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new v(k.UnsupportedSqlFunction,{function:l});if(s.typeofstat="VAR",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"var"})}return s}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}};function dt(u){if(!u)return"COUNT";switch(u.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}let ht=class ve extends x{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return S.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const r=this._parent?this._parent.getFieldsIndex():new et([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let a=!1;for(let n=0;n0)for(const a of this._parent.fields)this._adaptedFields.push(new X(a));for(let a=0;a0&&(l=new ot({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),n.nowhereclause===!0)a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:l,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let o=l;if(i!==null){let d=null;i&&(d=this._reformulateWhereClauseWithoutGroupByFields(i)),o=new q({parentfeatureset:o,whereclause:d})}a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:o,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return a}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=M(e,t.tofieldname,T(t.workingexpr,R.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=M(e,t.tofieldname,T(t.expression,R.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const s of r){const a={geometry:s.geometry,attributes:{}},n={};for(const l in s.attributes)n[l.toLowerCase()]=s.attributes[l];for(const l of this._decodedGroupbyfield)a.attributes[l.tofieldname]=n[l.name.toLowerCase()];for(const l of this._decodedStatsfield)a.attributes[l.tofieldname]=n[l.field.toLowerCase()];this._featureCache[a.attributes[this.objectIdField]]=new E(a)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((s,a)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?s(r.length):this._nextAggregateItem(e,t,i,r,n=>{n===null?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))},a)})}_nextAggregateItem(e,t,i,r,s,a){try{U(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(null);else{const l=this._generateAggregateHash(n);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const o=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(o)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,r,s,a)}},a)}catch(n){a(n)}}_calculateFieldStat(e,t,i){const r=[];for(const s of e.features)if(t.workingexpr!==null){const a=t.workingexpr.calculateValue(s);a!==null&&(a instanceof Xe||a instanceof Ye?r.push(a.toNumber()):a instanceof Ke?r.push(a.toMilliseconds()):r.push(a))}else r.push(null);i.attributes[t.tofieldname]=ze(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const r of this._decodedGroupbyfield){const s=r.singlefield?e.features[0].attributes[r.singlefield]:C.convertValueToStorageFormat(r.expression.calculateValue(e.features[0]),r.sqlType);t.attributes[r.tofieldname]=s}for(const r of this._decodedStatsfield)this._calculateFieldStat(e,r,t);const i=[];for(let r=0;rthis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===S.NotInFeatureSet)return t;const i=this._idstates[e];return i===S.InFeatureSet||i===S.NotInFeatureSet?i:t===S.InFeatureSet&&i===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let n=e._known.length;return n>0&&e._known[n-1]==="GETPAGES"&&(e._known.length=n-1),n=e._candidates.length,n>0&&e._candidates[n-1]==="GETPAGES"&&(e._candidates.length=n-1),"success"}const a=await this._parent._expandPagedSet(e,t,i,r,s);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,i,r){const s=[],a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);t!==-1&&this._featureCache[t]===void 0&&s.push(t);let n=0;for(let d=e._lastFetchedIndex;da)));d++);if(s.length===0)return"success";const l=new y([],s,!1,null),o=Math.min(s.length,i);await this._parent._getFeatures(l,-1,o,r);for(let d=0;d=this._topnum)break}else if(n===S.NotInFeatureSet)r===null?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),i+=1;else if(n===S.Unknown)break;if(i>=t)break}r!==null&&s.push(r);for(let a=s.length-1;a>=0;a--)e._candidates.splice(s[a].start,s[a].end-s[a].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){x._featuresetFunctions.top=function(e){return new se({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}class Q extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Je(e.toJSON());return Ce(t,Te.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=R.StandardisedNoInterval,e!=null&&e>=10.61&&(this._databaseType=R.Standardised)):e!=null&&(e>=10.5&&(this._databaseType=R.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=R.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_isInFeatureSet(){return S.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new z;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?this._layer.type==="subtype-group"&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const i=t==="execute"?this._layer.queryFeatures.bind(this._layer):t==="executeForCount"?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const s=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(s),r===null&&(r=i(e),this.recentlyUsedQueries.addToCache(s,r),r=r.catch(a=>{throw this.recentlyUsedQueries?.removeFromCache(s),a}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,s){const a=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,s);let n="",l=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=r.constructClause(),l=!0);const o=this._createQuery();o.where=P(o.where,i===null?t===null?"1=1":"":T(i,a)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null,o.geometry=t===null?null:t,o.relationParameter=this._makeRelationshipParam(e);let d=await this.executeQuery(o,"executeForIds");return d===null&&(d=[]),this._checkCancelled(s),new y([],d,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let a="",n=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=r.constructClause(),n=!0);const l=await this.databaseType(),o=i===null?t===null?"1=1":"":T(i,l);let d=this._maxQueryRate();const h=this._layer.capabilities?.query.maxRecordCount;h!=null&&h=this._maxProcessingRate()-1))break}if(a>=i&&s.length===0)break}if(s.length===0)return"success";const n=this._createQuery();n.objectIds=s,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(r),l.error!==void 0)throw new I(b.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let d=0;d=n)break}return p.features.length===0?l:p.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()));const s=e.pagesDefinition.internal.lastRetrieved,a=s,n=e.pagesDefinition.internal.lastPage,l=this._createQuery();if(l.where=P(l.where,r),l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const o=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!o.hasOwnProperty("features"))throw new I(b.InvalidStatResponse);const d=[];if(e.pagesDefinition.internal.lastPage!==n)return[];o.features.length>0&&o.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let h=0;h0||i&&i>0)&&(l.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(l.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:n,query:l,method:"attachments"});const o=await n.queryAttachments(new rt(l)),d=[];return o&&o[e]&&o[e].forEach(h=>{const c=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+h.id.toString();let f=null;s&&h.exifInfo&&(f=tt.convertJsonToArcade(h.exifInfo,"system",!0)),d.push(new it(h.id,h.name,h.contentType,h.size,c,f,h.keywords??null))}),d}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=Pe(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await j(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const r={},s=i.data;if(s?.relatedRecordGroups){const a=s.spatialReference;for(const n of s.relatedRecordGroups){const l=n.objectId,o=[];for(const d of n.relatedRecords){d.geometry&&(d.geometry.spatialReference=a);const h=new E({geometry:d.geometry?Oe(d.geometry):null,attributes:d.attributes});o.push(h)}r[l]={features:o,exceededTransferLimit:s.exceededTransferLimit===!0}}}return r}throw new I(b.InvalidRequest)}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=P(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return r.features.length===1?r.features[0]:null}async getIdentityUser(){await this.load();const e=le?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=le?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const r=await j(t,{query:{f:"json"}});let s="";return r.data?.owningSystemUrl&&(s=r.data.owningSystemUrl),s}catch{return""}}return""}getDataSourceFeatureSet(){const e=new Q({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl.path;if(i){const s=await j(i,{responseType:"json",query:{f:"json"}});e=s?.data?.name??null,t=s?.data?.serviceItemId??null}const r=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:t===""?null:t,serviceLayerUrl:i===""?null:i,webMapLayerId:r?this._layer.id??null:null,webMapLayerTitle:r?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}class V extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this._databaseType=R.Standardised,this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return S.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new E({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){let a="",n=!1;if(r!==null&&(a=r.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=this._layer.createQuery();l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=P(l.where,i===null?t===null?"1=1":"":T(i,R.Standardised)),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=a!==""?a.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const o=await this._layer.queryFeatures(l);if(o===null)return new y([],[],n,null);this._checkCancelled(s);const d=[];return o.features.forEach(h=>{const c=h.attributes[this._layer.objectIdField];d.push(c),this._featureCache[c]=this._changeFeature(h)}),new y([],d,n,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new z;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const r=[];return this._layer.source.items.forEach(s=>{const a=s.attributes[this._layer.objectIdField];r.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new y([],r,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(r=>{const s=r.attributes[this._layer.objectIdField];i.push(s),this._featureCache[s]=this._changeFeature(r)}),this._wset=new y([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);for(let s=e._lastFetchedIndex;si)));s++);if(r.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const p of e.layerDefinition.types)s.push(st.fromJSON(p));let a=e.layerDefinition.geometryType;a===void 0&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let p=!1;for(const m of e.layerDefinition.fields)if(m.type==="oid"||m.type==="esriFieldTypeOID"){i=m.name,p=!0;break}if(p===!1){let m="FID",_=!0,w=0;for(;_;){let A=!0;for(const xe of e.layerDefinition.fields)if(xe.name===m){A=!1;break}A===!0?_=!1:(w++,m="FID"+w.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:m,alias:m});const D=[];for(let A=0;Aw.name):["*"]);o.outFields=d,o.relationshipId=this.relationship.id,o.where="1=1";let h=!0;this._removeGeometry===!0&&(h=!1),o.returnGeometry=h,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null;const c=await a.source.queryRelatedFeatures(o);this._checkCancelled(s);const f=c[this._findObjectId]?c[this._findObjectId].features:[],p=[];for(let w=0;ww.name):["*"]);return p=new y(c||f?["GETPAGES"]:[],c||f?[]:["GETPAGES"],n,{outFields:_.join(","),resultRecordCount:d,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:a,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,d,0,0,s),p}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new me;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==a)return 0;const d=o[this._findObjectId]?o[this._findObjectId].features:[];for(let c=0;ci)))&&!(n>=i&&s.length===0);l++);if(s.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function pt(){g.applicationCache===null&&(g.applicationCache=new g)}async function Z(u,e,t){if(g.applicationCache){const i=g.applicationCache.getLayerInfo(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();if(g.applicationCache){g.applicationCache.setLayerInfo(u,s);try{return await s,r}catch(a){throw g.applicationCache.clearLayerInfo(u),a}}return await s,r}if(t!=null){const i=t.getCachedLayerMetadata(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();t.setCachedLayerMetadata(u,s);try{return await s,r}catch(a){throw t.removeCachedLayerMetadata(u,s),a}}return new N({url:u,outFields:e})}async function ae(u,e,t,i,r,s=null){return L(await Z(u,["*"],r),e,t,i,r,s)}function L(u,e=null,t=null,i=!0,r=null,s=null){switch(u.type){case"catalog-footprint":return L(u.parent,e,t,i,r,s);case"subtype-sublayer":{const a=L(u.parent,e,t,i,r,s);return a.filter(C.create(u.parent.subtypeField+"="+u.subtypeCode.toString(),{fieldsIndex:u.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"wfs":return new V({layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s};return!u.url&&u.source?new V(a):new Q(a)}default:throw new Error(`Unsupported layer type: ${u.type}`)}}async function ft(u){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(u);if(t!==null)return t}const e=(async()=>{const t=await j(u,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(u),t}}return e}async function yt(u,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+u;if(g.applicationCache!==null){const r=g.applicationCache.getLayerInfo(t);if(r!==null)return r}const i=(async()=>{const r=await j(u+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(r.data){const s=r.data;if(s.layerDataElements?.[0])return s.layerDataElements[0]}throw new I(b.DataElementsNotFound)})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(t,i);try{return await i}catch(r){throw g.applicationCache.clearLayerInfo(t),r}}return i}async function ke(u,e){if(g.applicationCache!==null){const i=g.applicationCache.getLayerInfo(u);if(i!==null)return i}if(e!=null){const i=e.getCachedServiceMetadata(u);if(i!=null)return i}const t=(async()=>{const i=await j(u,{responseType:"json",query:{f:"json"}});if(i.data){const r=i.data;return r.layers||(r.layers=[]),r.tables||(r.tables=[]),r}return{layers:[],tables:[]}})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,t);try{return await t}catch(i){throw g.applicationCache.clearLayerInfo(u),i}}if(e!=null){e.setCachedServiceMetadata(u,t);try{return await t}catch(i){throw e.removeCachedServiceMetadata(u,t),i}}return t}async function _t(u,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await ke(u,null);if(t.metadata=i,i.controllerDatasetLayers?.utilityNetworkLayerId!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const a of i.layers)t.layerNameLkp[a.id]=a.name;if(i.tables)for(const a of i.tables)t.layerNameLkp[a.id]=a.name;const r=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=r;const s=await yt(u,r);if(s){t.queryelem=s,t.queryelem?.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const n of t.queryelem.dataElement.domainNetworks){for(const l of n.edgeSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}for(const l of n.junctionSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}}if(t.queryelem.dataElement.terminalConfigurations)for(const n of t.queryelem.dataElement.terminalConfigurations)for(const l of n.terminals)t.terminals.push({terminalId:l.terminalId,terminalName:l.terminalName});const a=await ft(u+"/"+r);if(a.systemLayers?.associationsTableId!==void 0&&a.systemLayers.associationsTableId!==null){const n=[];t.unVersion>=4&&(n.push("STATUS"),n.push("PERCENTALONG"));let l=await ae(u+"/"+a.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...n],!1,null,null);return await l.load(),t.unVersion>=4&&(l=l.filter(C.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC})),await l.load()),{lkp:t.lkp,associations:l,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function gt(u,e,t,i=null,r=null,s=!0,a=null,n=null){let l=u.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const o=await ae(l,i,r,s,a,n);return new ct({layer:u,relatedLayer:o,relationship:e,objectId:t,spatialReference:i,outFields:r,includeGeometry:s,lrucache:a,interceptor:n})}q.registerAction(),ht.registerAction(),Y.registerAction(),Me.registerAction(),se.registerAction();class mt extends Re{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.title===e);if(s!=null)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.title===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}async featureSetById(e,t=!0,i=["*"]){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.id===e);if(s)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.id===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n={...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}}class ne extends Re{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ke(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ne(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let n=0;n0){const F=[];for(let t=0;t{if(x(e,1,2,n,i),$e(e[0])||Y(e[0]))return"Unknown";if(N(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof Z)||e[1].hasField("type")===!1)throw new c(n,m.InvalidParameter,i);const s=e[1].field("type");if(C(s)===!1)throw new c(n,m.InvalidParameter,i);switch(E(s).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(e[0].editFieldsInfo?.timeZone??null);case"timeinfo":return z(e[0].timeInfo?.timeZone??null);case"field":if(e[1].hasField("fieldname")&&C(e[1].field("fieldname")))return z(e[0].fieldTimeZone(E(e[1].field("fieldname"))))}throw new c(n,m.InvalidParameter,i)}const t=xe(e[0],de(n));if(t===null)return null;const o=t.timeZone;return o==="system"?Fe.systemTimeZoneCanonicalName:o.toLowerCase()==="utc"?"UTC":o.toLowerCase()==="unknown"?"Unknown":o})},r.functions.sqltimestamp=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,3,n,i);const t=e[0];if(ue(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(E(e[1])).toSQLWithKeyword();throw new c(n,m.InvalidParameter,i)}if(Y(t))return t.toSQLWithKeyword();if(N(t)){if(e.length!==3)throw new c(n,m.InvalidParameter,i);await t.load();const o=E(e[1]);if(Y(e[2]))return e[2].toSQLWithKeyword();if(ue(e[2])===!1)throw new c(n,m.InvalidParameter,i);const s=t.fieldTimeZone(o);return s===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(s).toSQLWithKeyword()}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"sqltimestamp",min:2,max:4}),r.functions.featuresetbyid=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetById(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyid",min:2,max:4}),r.functions.getfeatureset=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,2,n,i),G(e[0])){let t=L(e[1],"datasource");return t===null&&(t="datasource"),t=E(t).toLowerCase(),Ae(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference??null)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"getfeatureset",min:1,max:2}),r.functions.featuresetbyportalitem=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,5,n,i),e[0]===null)throw new c(n,m.PortalRequired,i);if(e[0]instanceof De){const f=E(e[1]),a=E(e[2]);let l=L(e[3],null);const d=k(L(e[4],!0));if(l===null&&(l=["*"]),b(l)===!1)throw new c(n,m.InvalidParameter,i);let w;return w=n.services?.portal?n.services.portal:ye.getDefault(),w=ke(e[0],w),me(f,a,n.spatialReference??null,l,d,w,n.lrucache,n.interceptor)}if(C(e[0])===!1)throw new c(n,m.PortalRequired,i);const t=E(e[0]),o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);return me(t,o,n.spatialReference??null,s,p,n.services?.portal??ye.getDefault(),n.lrucache,n.interceptor)})},r.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),r.functions.featuresetbyname=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetByName(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyname",min:2,max:4}),r.functions.featureset=function(n,i){return r.standardFunction(n,i,(y,F,e)=>{x(e,1,1,n,i);const t={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if(C(e[0])){const o=JSON.parse(e[0]);o.layerDefinition!==void 0?(t.layerDefinition=o.layerDefinition,t.featureSet=o.featureSet,o.layerDefinition.spatialReference&&(t.layerDefinition.spatialReference=o.layerDefinition.spatialReference)):(t.featureSet.features=o.features,t.featureSet.geometryType=o.geometryType,t.layerDefinition.geometryType=t.featureSet.geometryType,t.layerDefinition.objectIdField=o.objectIdFieldName??"",t.layerDefinition.typeIdField=o.typeIdFieldName,t.layerDefinition.globalIdField=o.globalIdFieldName,t.layerDefinition.fields=o.fields,o.spatialReference&&(t.layerDefinition.spatialReference=o.spatialReference))}else{if(!(e[0]instanceof Z))throw new c(n,m.InvalidParameter,i);{const o=JSON.parse(e[0].castToText(!0)),s=u(o,"layerdefinition");if(s!==null){t.layerDefinition.geometryType=u(s,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.globalIdField=u(s,"globalidfield",""),t.layerDefinition.objectIdField=u(s,"objectidfield",""),t.layerDefinition.typeIdField=u(s,"typeidfield",""),t.layerDefinition.hasZ=u(s,"hasz",!1)===!0,t.layerDefinition.hasM=u(s,"hasm",!1)===!0;const p=u(s,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[];for(const l of u(s,"fields",[])){const d={name:u(l,"name",""),alias:u(l,"alias",""),type:u(l,"type",""),nullable:u(l,"nullable",!0),editable:u(l,"editable",!0),length:u(l,"length",null),domain:we(u(l,"domain"))};f.push(d)}t.layerDefinition.fields=f;const a=u(o,"featureset");if(a){const l={};for(const d of f)l[d.name.toLowerCase()]=d.name;for(const d of u(a,"features",[])){const w={},D=u(d,"attributes",{});for(const g in D)w[l[g.toLowerCase()]]=D[g];t.featureSet.features.push({attributes:w,geometry:he(u(d,"geometry"))})}}}else{t.layerDefinition.hasZ=u(o,"hasz",!1)===!0,t.layerDefinition.hasM=u(o,"hasm",!1)===!0,t.layerDefinition.geometryType=u(o,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.objectIdField=u(o,"objectidfieldname",""),t.layerDefinition.typeIdField=u(o,"typeidfieldname","");const p=u(o,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[],a=u(o,"fields",null);if(!b(a))throw new c(n,m.InvalidParameter,i);for(const w of a){const D={name:u(w,"name",""),alias:u(w,"alias",""),type:u(w,"type",""),nullable:u(w,"nullable",!0),editable:u(w,"editable",!0),length:u(w,"length",null),domain:we(u(w,"domain"))};f.push(D)}t.layerDefinition.fields=f;const l={};for(const w of f)l[w.name.toLowerCase()]=w.name;let d=u(o,"features",null);if(b(d))for(const w of d){const D={},g=u(w,"attributes",{});for(const T in g)D[l[T.toLowerCase()]]=g[T];t.featureSet.features.push({attributes:D,geometry:he(u(w,"geometry",null))})}else d=null,t.featureSet.features=d}}}if(We(t)===!1)throw new c(n,m.InvalidParameter,i);return t.layerDefinition.geometryType||(t.layerDefinition.geometryType="esriGeometryNull"),Le.create(t,n.spatialReference)})},r.signatures.push({name:"featureset",min:1,max:1}),r.functions.filter=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),b(e[0])||M(e[0])){const t=[];let o,s=e[0];if(s instanceof Me&&(s=s.toArray()),!Ee(e[1]))throw new c(n,m.InvalidParameter,i);o=e[1].createFunction(n);for(const p of s){const f=o(p);ze(f)?await f===!0&&t.push(p):f===!0&&t.push(p)}return t}if(N(e[0])){const t=await e[0].load(),o=$.create(e[1],{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),s=o.getVariables();if(s.length>0){const p=[];for(let a=0;a{if(x(e,2,2,n,i),N(e[0])){const t=new Se(e[1]);return new Ze({parentfeatureset:e[0],orderbyclause:t})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"orderby",min:2,max:2}),r.functions.top=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0]))return new Ce({parentfeatureset:e[0],topnum:e[1]});if(b(e[0]))return O(e[1])>=e[0].length?e[0].slice():e[0].slice(0,O(e[1]));if(M(e[0]))return O(e[1])>=e[0].length()?e[0].slice():e[0].slice(0,O(e[1]));throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"top",min:2,max:2}),r.functions.first=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),N(e[0])){const t=await e[0].first(y.abortSignal);if(t!==null){const o=Te.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return o._underlyingGraphic=t,o}return t}return b(e[0])?e[0].length===0?null:e[0][0]:M(e[0])?e[0].length()===0?null:e[0].get(0):null})},r.signatures.push({name:"first",min:1,max:1}),r.functions.attachments=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,2,n,i);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof Z){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=k(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const o=be(e[1].field("types"),!1);o.length>0&&(t.types=o)}}else if(e[1]!==null)throw new c(n,m.InvalidParameter,i)}if(G(e[0])){let o=e[0]._layer;return o instanceof te&&(o=X(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null?[]:N(o)===!1?[]:(await o.load(),o.queryAttachments(e[0].field(o.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"attachments",min:1,max:2}),r.functions.featuresetbyrelationshipname=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,4,n,i);const t=e[0],o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let f=t._layer;if(f instanceof te&&(f=X(f,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),f===null||N(f)===!1)return null;f=await f.load();const a=f.relationshipMetaData().filter(g=>g.name===o);if(a.length===0)return null;if(a[0].relationshipTableId!==void 0&&a[0].relationshipTableId!==null&&a[0].relationshipTableId>-1)return ve(f,a[0],t.field(f.objectIdField),f.spatialReference,s,p,n.lrucache,n.interceptor);let l=f.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+a[0].relatedTableId.toString():l+"/"+a[0].relatedTableId.toString();const d=await Pe(l,f.spatialReference,s,p,n.lrucache,n.interceptor);await d.load();let w=d.relationshipMetaData();if(w=w.filter(g=>g.id===a[0].id),t.hasField(a[0].keyField)===!1||t.field(a[0].keyField)===null){const g=await f.getFeatureByObjectId(t.field(f.objectIdField),[a[0].keyField]);if(g){const T=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return T.parameters={id:g.attributes[a[0].keyField]},d.filter(T)}return new Oe({parentfeatureset:d})}const D=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return D.parameters={id:t.field(a[0].keyField)},d.filter(D)})},r.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),r.functions.featuresetbyassociation=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,3,n,i);const t=e[0],o=E(L(e[1],"")).toLowerCase(),s=C(e[2])?E(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let p=t._layer;if(p instanceof te&&(p=X(p,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),p===null||N(p)===!1)return null;await p.load();const f=p.serviceUrl(),a=await Re(f,n.spatialReference);let l=null,d=null,w=!1;if(s!==null&&s!==""&&s!==void 0){for(const I of a.terminals)I.terminalName===s&&(d=I.terminalId);d===null&&(w=!0)}const D=a.associations.getFieldsIndex(),g=D.get("TOGLOBALID").name,T=D.get("FROMGLOBALID").name,B=D.get("TOTERMINALID").name,K=D.get("FROMTERMINALID").name,H=D.get("FROMNETWORKSOURCEID").name,j=D.get("TONETWORKSOURCEID").name,R=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Ie=D.get("OBJECTID").name;for(const I of p.fields)if(I.type==="global-id"){l=t.field(I.name);break}let v=null,re=new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create("''",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));const A="globalid",le="globalId",se={};for(const I in a.lkp)se[I]=a.lkp[I].sourceId;const P=new Ue(new W({name:"classname",alias:"classname",type:"string"}),null,se);let h="";switch(o){case"midspan":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (5))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),re=a.unVersion>=4?new ee(S.findField(a.associations.fields,D.get("PERCENTALONG").name)):new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (4,6))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create(`CASE WHEN (${R}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let I=`${g}='@T'`,fe=`${T}='@T'`;d!==null&&(I+=` AND ${B}=@A`,fe+=` AND ${K}=@A`),h="(("+I+") OR ("+fe+"))",h=q(h,"@T",l??""),I=q(I,"@T",l??""),d!==null&&(I=q(I,"@A",d.toString()),h=q(h,"@A",d.toString())),P.codefield=$.create("CASE WHEN "+I+` THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const Q=ne(S.findField(a.associations.fields,T));Q.name=A,Q.alias=A,v=new U(Q,$.create("CASE WHEN "+I+` THEN ${T} ELSE ${g} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":h=`${g}='${l}' AND ${R} = 2`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,A);break;case"content":h=`(${T}='${l}' AND ${R} = 2)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,A);break;case"structure":h=`(${g}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,le);break;case"attached":h=`(${T}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,le);break;default:throw new c(n,m.InvalidParameter,i)}return w&&(h="1 <> 1"),new S({parentfeatureset:a.associations,adaptedFields:[new ee(S.findField(a.associations.fields,Ie)),new ee(S.findField(a.associations.fields,ge)),v,oe,P,re],extraFilter:h?$.create(h,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}):null})})},r.signatures.push({name:"featuresetbyassociation",min:2,max:6}),r.functions.groupby=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,3,3,n,i),!N(e[0]))throw new c(n,m.InvalidParameter,i);const t=await e[0].load(),o=[],s=[];let p=!1,f=[];if(C(e[1]))f.push(e[1]);else if(e[1]instanceof Z)f.push(e[1]);else if(b(e[1]))f=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);f=e[1].toArray()}for(const a of f)if(C(a)){const l=$.create(E(a),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),d=pe(l)===!0?E(a):"%%%%FIELDNAME";o.push({name:d,expression:l}),d==="%%%%FIELDNAME"&&(p=!0)}else{if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"%%%%FIELDNAME",d=a.hasField("expression")?a.field("expression"):"";if(l==="%%%%FIELDNAME"&&(p=!0),!l)throw new c(n,m.InvalidParameter,i);o.push({name:l,expression:$.create(d||l,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(f=[],C(e[2]))f.push(e[2]);else if(b(e[2]))f=e[2];else if(M(e[2]))f=e[2].toArray();else{if(!(e[2]instanceof Z))throw new c(n,m.InvalidParameter,i);f.push(e[2])}for(const a of f){if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"",d=a.hasField("statistic")?a.field("statistic"):"",w=a.hasField("expression")?a.field("expression"):"";if(!l||!d||!w)throw new c(n,m.InvalidParameter,i);s.push({name:l,statistic:d.toLowerCase(),expression:$.create(w,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const a={};for(const d of t.fields)a[d.name.toLowerCase()]=1;for(const d of o)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);for(const d of s)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);let l=0;for(const d of o)if(d.name==="%%%%FIELDNAME"){for(;a["field_"+l.toString()]===1;)l++;a["field_"+l.toString()]=1,d.name="FIELD_"+l.toString()}}for(const a of o)await ie(a.expression,r,n);for(const a of s)await ie(a.expression,r,n);return e[0].groupby(o,s)})},r.signatures.push({name:"groupby",min:3,max:3}),r.functions.distinct=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(N(e[0])){x(e,2,2,n,i);const t=await e[0].load(),o=[];let s=[];if(C(e[1]))s.push(e[1]);else if(e[1]instanceof Z)s.push(e[1]);else if(b(e[1]))s=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);s=e[1].toArray()}let p=!1;for(const f of s)if(C(f)){const a=$.create(E(f),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),l=pe(a)===!0?E(f):"%%%%FIELDNAME";o.push({name:l,expression:a}),l==="%%%%FIELDNAME"&&(p=!0)}else{if(!(f instanceof Z))throw new c(n,m.InvalidParameter,i);{const a=f.hasField("name")?f.field("name"):"%%%%FIELDNAME",l=f.hasField("expression")?f.field("expression"):"";if(a==="%%%%FIELDNAME"&&(p=!0),!a)throw new c(n,m.InvalidParameter,i);o.push({name:a,expression:$.create(l||a,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const f={};for(const l of t.fields)f[l.name.toLowerCase()]=1;for(const l of o)l.name!=="%%%%FIELDNAME"&&(f[l.name.toLowerCase()]=1);let a=0;for(const l of o)if(l.name==="%%%%FIELDNAME"){for(;f["field_"+a.toString()]===1;)a++;f["field_"+a.toString()]=1,l.name="FIELD_"+a.toString()}}for(const f of o)await ie(f.expression,r,n);return e[0].groupby(o,[])}return He(e)})},r.functions.getfeaturesetinfo=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),!N(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?Z.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},de(n),!1,!1):null})},r.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),r.functions.filterbysubtypecode=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0])){const t=await e[0].load(),o=e[1];if(!Ne(o))throw new c(n,m.InvalidParameter,i);if(t.subtypeField){const p=$.create(`${t.subtypeField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:p})}if(t.typeIdField===null||t.typeIdField==="")throw new c(n,m.FeatureSetDoesNotHaveSubtypes,i);const s=$.create(`${t.typeIdField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:s})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}export{Pt as registerFunctions}; diff --git a/main/assets/featuresetbase-BDDCCC0O-F4vb-x5f.js b/main/assets/featuresetbase-BDDCCC0O-F4vb-x5f.js deleted file mode 100644 index f4b510ccb..000000000 --- a/main/assets/featuresetbase-BDDCCC0O-F4vb-x5f.js +++ /dev/null @@ -1 +0,0 @@ -import{r as Fe}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{N as Z,t as De,D as Te,l as J}from"./arcadeUtils-DpP0k7IY-DIwxqttO.js";import{w as x,h as $e,c as Y,r as N,T as c,n as m,y as C,M as E,P as xe,e as de,d as ue,D as ce,g as L,L as k,C as b,t as G,Z as M,U as Ee,f as O,ag as be,q,O as Ne}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{M as Ae,q as me,f as Le,c as _,e as Se,a as Ze,b as Ce,T as X,E as ve,N as Pe,O as Re,L as U,B as Ue,d as V,R as S,k as ee}from"./featureSetUtils-wd4FcF3A-Dl4vKkUg.js";import{n as Me}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ke}from"./portalUtils-CKN9iXwH-AaE_9x6i.js";import{E as Oe,e as pe}from"./SpatialFilter-BlQBFhwz-DQzQDaNp.js";import{I as ne}from"./shared-D1w-26bA-Cy2KeMh-.js";import{r as ye,t as ze}from"./main-BZaw9FpY.js";import{Z as $}from"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import te from"./FeatureLayer-BrRKw5Si-CHreUEJ9.js";import{y as W}from"./Field-C6hA1tZj-CbELM0zp.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./RelationshipQuery-DJsz3K0U-CSUcCWzp.js";import"./FeatureType-C9hJmS6_-pVJc0p7X.js";import"./FeatureTemplate-SPHPD45f-tAS5Ccaa.js";import"./Layer-ChoECxvZ-C4wLrCej.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./geometryEngineAsync-D7oEu5dd-DTqB2IHB.js";import"./workers-PiCjreoO-oGzLvkSt.js";import"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./jsonUtils-C64Zfu7c-trwRB9M4.js";import"./LRUCache-C3erQTWv-CeYLuvL9.js";import"./Version-CoKzbupV-BxOJQpf3.js";import"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-DpAlEmQT.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./heatmapUtils-seiMkkkR-D9lAE87R.js";import"./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js";import"./commonProperties-BtIqvFU_-Brj0aAM1.js";import"./ElevationInfo-yv2-9tj6-pjIBBQET.js";import"./FeatureLayerBase-vvYyZTfh-K4Z036-G.js";import"./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./featureLayerUtils-DgfQQyK4-D6z7j0IK.js";import"./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js";import"./Relationship-PyhUibYK-Bz6HFiBe.js";import"./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js";import"./editsZScale-BDsX6vv--CeDyYvz6.js";import"./queryZScale-BiYV6Pr6-ci22dEZj.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./FeatureSet-BkVNthuN-D0ikVdR5.js";import"./APIKeyMixin-BUMSx9ny-xmyEzAt4.js";import"./ArcGISService-BYA-y6X6-DLcDzG-r.js";import"./BlendLayer-D1WkSmwP-UVXywJXM.js";import"./jsonUtils-wIllKWI4-DQ36DuUP.js";import"./parser-DyDJ-rlI-mkgQEqcN.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./CustomParametersMixin-vdKsTHer-CoiI71pj.js";import"./EditBusLayer-Df29OyJh-C36maE2j.js";import"./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js";import"./FeatureEffect-CDEk9Es7-DK_N6ZYk.js";import"./FeatureFilter-BCFHgLVU-BSMrX0wh.js";import"./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js";import"./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js";import"./labelingInfo-DGVNul26-CXiwzGiu.js";import"./labelUtils-BW14kBqX-8wHrIU-s.js";import"./OperationalLayer-B5IXiMa2-KEXCVZUA.js";import"./OrderedLayer-6Qsmrd_l-CGz1PXc3.js";import"./OrderByInfo-GD2XnU8e-C-uyyo-i.js";import"./PortalLayer-CElnYuSQ-tfjbIq8z.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js";import"./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js";import"./TemporalLayer-CpOrN_w9-kgJDrMMF.js";import"./TimeInfo-w_HB2CsF-wq_g9Zh1.js";import"./fieldProperties-Bq26w7gt-DT6oRGMS.js";import"./versionUtils-LZYZz-38-xZnsxhiL.js";import"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./popupUtils-B0uZcXX0-BqljON9c.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function He(r){if(r.length===1){if(b(r[0]))return J("distinct",r[0],-1);if(M(r[0]))return J("distinct",r[0].toArray(),-1)}return J("distinct",r,-1)}async function ie(r,n,i){const y=r.getVariables();if(y.length>0){const F=[];for(let t=0;t{if(x(e,1,2,n,i),$e(e[0])||Y(e[0]))return"Unknown";if(N(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof Z)||e[1].hasField("type")===!1)throw new c(n,m.InvalidParameter,i);const s=e[1].field("type");if(C(s)===!1)throw new c(n,m.InvalidParameter,i);switch(E(s).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(e[0].editFieldsInfo?.timeZone??null);case"timeinfo":return z(e[0].timeInfo?.timeZone??null);case"field":if(e[1].hasField("fieldname")&&C(e[1].field("fieldname")))return z(e[0].fieldTimeZone(E(e[1].field("fieldname"))))}throw new c(n,m.InvalidParameter,i)}const t=xe(e[0],de(n));if(t===null)return null;const o=t.timeZone;return o==="system"?Fe.systemTimeZoneCanonicalName:o.toLowerCase()==="utc"?"UTC":o.toLowerCase()==="unknown"?"Unknown":o})},r.functions.sqltimestamp=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,3,n,i);const t=e[0];if(ue(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(E(e[1])).toSQLWithKeyword();throw new c(n,m.InvalidParameter,i)}if(Y(t))return t.toSQLWithKeyword();if(N(t)){if(e.length!==3)throw new c(n,m.InvalidParameter,i);await t.load();const o=E(e[1]);if(Y(e[2]))return e[2].toSQLWithKeyword();if(ue(e[2])===!1)throw new c(n,m.InvalidParameter,i);const s=t.fieldTimeZone(o);return s===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(s).toSQLWithKeyword()}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"sqltimestamp",min:2,max:4}),r.functions.featuresetbyid=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetById(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyid",min:2,max:4}),r.functions.getfeatureset=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,2,n,i),G(e[0])){let t=L(e[1],"datasource");return t===null&&(t="datasource"),t=E(t).toLowerCase(),Ae(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference??null)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"getfeatureset",min:1,max:2}),r.functions.featuresetbyportalitem=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,5,n,i),e[0]===null)throw new c(n,m.PortalRequired,i);if(e[0]instanceof De){const f=E(e[1]),a=E(e[2]);let l=L(e[3],null);const d=k(L(e[4],!0));if(l===null&&(l=["*"]),b(l)===!1)throw new c(n,m.InvalidParameter,i);let w;return w=n.services?.portal?n.services.portal:ye.getDefault(),w=ke(e[0],w),me(f,a,n.spatialReference??null,l,d,w,n.lrucache,n.interceptor)}if(C(e[0])===!1)throw new c(n,m.PortalRequired,i);const t=E(e[0]),o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);return me(t,o,n.spatialReference??null,s,p,n.services?.portal??ye.getDefault(),n.lrucache,n.interceptor)})},r.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),r.functions.featuresetbyname=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetByName(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyname",min:2,max:4}),r.functions.featureset=function(n,i){return r.standardFunction(n,i,(y,F,e)=>{x(e,1,1,n,i);const t={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if(C(e[0])){const o=JSON.parse(e[0]);o.layerDefinition!==void 0?(t.layerDefinition=o.layerDefinition,t.featureSet=o.featureSet,o.layerDefinition.spatialReference&&(t.layerDefinition.spatialReference=o.layerDefinition.spatialReference)):(t.featureSet.features=o.features,t.featureSet.geometryType=o.geometryType,t.layerDefinition.geometryType=t.featureSet.geometryType,t.layerDefinition.objectIdField=o.objectIdFieldName??"",t.layerDefinition.typeIdField=o.typeIdFieldName,t.layerDefinition.globalIdField=o.globalIdFieldName,t.layerDefinition.fields=o.fields,o.spatialReference&&(t.layerDefinition.spatialReference=o.spatialReference))}else{if(!(e[0]instanceof Z))throw new c(n,m.InvalidParameter,i);{const o=JSON.parse(e[0].castToText(!0)),s=u(o,"layerdefinition");if(s!==null){t.layerDefinition.geometryType=u(s,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.globalIdField=u(s,"globalidfield",""),t.layerDefinition.objectIdField=u(s,"objectidfield",""),t.layerDefinition.typeIdField=u(s,"typeidfield",""),t.layerDefinition.hasZ=u(s,"hasz",!1)===!0,t.layerDefinition.hasM=u(s,"hasm",!1)===!0;const p=u(s,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[];for(const l of u(s,"fields",[])){const d={name:u(l,"name",""),alias:u(l,"alias",""),type:u(l,"type",""),nullable:u(l,"nullable",!0),editable:u(l,"editable",!0),length:u(l,"length",null),domain:we(u(l,"domain"))};f.push(d)}t.layerDefinition.fields=f;const a=u(o,"featureset");if(a){const l={};for(const d of f)l[d.name.toLowerCase()]=d.name;for(const d of u(a,"features",[])){const w={},D=u(d,"attributes",{});for(const g in D)w[l[g.toLowerCase()]]=D[g];t.featureSet.features.push({attributes:w,geometry:he(u(d,"geometry"))})}}}else{t.layerDefinition.hasZ=u(o,"hasz",!1)===!0,t.layerDefinition.hasM=u(o,"hasm",!1)===!0,t.layerDefinition.geometryType=u(o,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.objectIdField=u(o,"objectidfieldname",""),t.layerDefinition.typeIdField=u(o,"typeidfieldname","");const p=u(o,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[],a=u(o,"fields",null);if(!b(a))throw new c(n,m.InvalidParameter,i);for(const w of a){const D={name:u(w,"name",""),alias:u(w,"alias",""),type:u(w,"type",""),nullable:u(w,"nullable",!0),editable:u(w,"editable",!0),length:u(w,"length",null),domain:we(u(w,"domain"))};f.push(D)}t.layerDefinition.fields=f;const l={};for(const w of f)l[w.name.toLowerCase()]=w.name;let d=u(o,"features",null);if(b(d))for(const w of d){const D={},g=u(w,"attributes",{});for(const T in g)D[l[T.toLowerCase()]]=g[T];t.featureSet.features.push({attributes:D,geometry:he(u(w,"geometry",null))})}else d=null,t.featureSet.features=d}}}if(We(t)===!1)throw new c(n,m.InvalidParameter,i);return t.layerDefinition.geometryType||(t.layerDefinition.geometryType="esriGeometryNull"),Le.create(t,n.spatialReference)})},r.signatures.push({name:"featureset",min:1,max:1}),r.functions.filter=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),b(e[0])||M(e[0])){const t=[];let o,s=e[0];if(s instanceof Me&&(s=s.toArray()),!Ee(e[1]))throw new c(n,m.InvalidParameter,i);o=e[1].createFunction(n);for(const p of s){const f=o(p);ze(f)?await f===!0&&t.push(p):f===!0&&t.push(p)}return t}if(N(e[0])){const t=await e[0].load(),o=$.create(e[1],{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),s=o.getVariables();if(s.length>0){const p=[];for(let a=0;a{if(x(e,2,2,n,i),N(e[0])){const t=new Se(e[1]);return new Ze({parentfeatureset:e[0],orderbyclause:t})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"orderby",min:2,max:2}),r.functions.top=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0]))return new Ce({parentfeatureset:e[0],topnum:e[1]});if(b(e[0]))return O(e[1])>=e[0].length?e[0].slice():e[0].slice(0,O(e[1]));if(M(e[0]))return O(e[1])>=e[0].length()?e[0].slice():e[0].slice(0,O(e[1]));throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"top",min:2,max:2}),r.functions.first=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),N(e[0])){const t=await e[0].first(y.abortSignal);if(t!==null){const o=Te.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return o._underlyingGraphic=t,o}return t}return b(e[0])?e[0].length===0?null:e[0][0]:M(e[0])?e[0].length()===0?null:e[0].get(0):null})},r.signatures.push({name:"first",min:1,max:1}),r.functions.attachments=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,2,n,i);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof Z){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=k(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const o=be(e[1].field("types"),!1);o.length>0&&(t.types=o)}}else if(e[1]!==null)throw new c(n,m.InvalidParameter,i)}if(G(e[0])){let o=e[0]._layer;return o instanceof te&&(o=X(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null?[]:N(o)===!1?[]:(await o.load(),o.queryAttachments(e[0].field(o.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"attachments",min:1,max:2}),r.functions.featuresetbyrelationshipname=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,4,n,i);const t=e[0],o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let f=t._layer;if(f instanceof te&&(f=X(f,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),f===null||N(f)===!1)return null;f=await f.load();const a=f.relationshipMetaData().filter(g=>g.name===o);if(a.length===0)return null;if(a[0].relationshipTableId!==void 0&&a[0].relationshipTableId!==null&&a[0].relationshipTableId>-1)return ve(f,a[0],t.field(f.objectIdField),f.spatialReference,s,p,n.lrucache,n.interceptor);let l=f.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+a[0].relatedTableId.toString():l+"/"+a[0].relatedTableId.toString();const d=await Pe(l,f.spatialReference,s,p,n.lrucache,n.interceptor);await d.load();let w=d.relationshipMetaData();if(w=w.filter(g=>g.id===a[0].id),t.hasField(a[0].keyField)===!1||t.field(a[0].keyField)===null){const g=await f.getFeatureByObjectId(t.field(f.objectIdField),[a[0].keyField]);if(g){const T=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return T.parameters={id:g.attributes[a[0].keyField]},d.filter(T)}return new Oe({parentfeatureset:d})}const D=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return D.parameters={id:t.field(a[0].keyField)},d.filter(D)})},r.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),r.functions.featuresetbyassociation=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,3,n,i);const t=e[0],o=E(L(e[1],"")).toLowerCase(),s=C(e[2])?E(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let p=t._layer;if(p instanceof te&&(p=X(p,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),p===null||N(p)===!1)return null;await p.load();const f=p.serviceUrl(),a=await Re(f,n.spatialReference);let l=null,d=null,w=!1;if(s!==null&&s!==""&&s!==void 0){for(const I of a.terminals)I.terminalName===s&&(d=I.terminalId);d===null&&(w=!0)}const D=a.associations.getFieldsIndex(),g=D.get("TOGLOBALID").name,T=D.get("FROMGLOBALID").name,B=D.get("TOTERMINALID").name,K=D.get("FROMTERMINALID").name,H=D.get("FROMNETWORKSOURCEID").name,j=D.get("TONETWORKSOURCEID").name,R=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Ie=D.get("OBJECTID").name;for(const I of p.fields)if(I.type==="global-id"){l=t.field(I.name);break}let v=null,re=new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create("''",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));const A="globalid",le="globalId",se={};for(const I in a.lkp)se[I]=a.lkp[I].sourceId;const P=new Ue(new W({name:"classname",alias:"classname",type:"string"}),null,se);let h="";switch(o){case"midspan":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (5))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),re=a.unVersion>=4?new ee(S.findField(a.associations.fields,D.get("PERCENTALONG").name)):new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (4,6))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create(`CASE WHEN (${R}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let I=`${g}='@T'`,fe=`${T}='@T'`;d!==null&&(I+=` AND ${B}=@A`,fe+=` AND ${K}=@A`),h="(("+I+") OR ("+fe+"))",h=q(h,"@T",l??""),I=q(I,"@T",l??""),d!==null&&(I=q(I,"@A",d.toString()),h=q(h,"@A",d.toString())),P.codefield=$.create("CASE WHEN "+I+` THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const Q=ne(S.findField(a.associations.fields,T));Q.name=A,Q.alias=A,v=new U(Q,$.create("CASE WHEN "+I+` THEN ${T} ELSE ${g} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":h=`${g}='${l}' AND ${R} = 2`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,A);break;case"content":h=`(${T}='${l}' AND ${R} = 2)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,A);break;case"structure":h=`(${g}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,le);break;case"attached":h=`(${T}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,le);break;default:throw new c(n,m.InvalidParameter,i)}return w&&(h="1 <> 1"),new S({parentfeatureset:a.associations,adaptedFields:[new ee(S.findField(a.associations.fields,Ie)),new ee(S.findField(a.associations.fields,ge)),v,oe,P,re],extraFilter:h?$.create(h,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}):null})})},r.signatures.push({name:"featuresetbyassociation",min:2,max:6}),r.functions.groupby=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,3,3,n,i),!N(e[0]))throw new c(n,m.InvalidParameter,i);const t=await e[0].load(),o=[],s=[];let p=!1,f=[];if(C(e[1]))f.push(e[1]);else if(e[1]instanceof Z)f.push(e[1]);else if(b(e[1]))f=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);f=e[1].toArray()}for(const a of f)if(C(a)){const l=$.create(E(a),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),d=pe(l)===!0?E(a):"%%%%FIELDNAME";o.push({name:d,expression:l}),d==="%%%%FIELDNAME"&&(p=!0)}else{if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"%%%%FIELDNAME",d=a.hasField("expression")?a.field("expression"):"";if(l==="%%%%FIELDNAME"&&(p=!0),!l)throw new c(n,m.InvalidParameter,i);o.push({name:l,expression:$.create(d||l,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(f=[],C(e[2]))f.push(e[2]);else if(b(e[2]))f=e[2];else if(M(e[2]))f=e[2].toArray();else{if(!(e[2]instanceof Z))throw new c(n,m.InvalidParameter,i);f.push(e[2])}for(const a of f){if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"",d=a.hasField("statistic")?a.field("statistic"):"",w=a.hasField("expression")?a.field("expression"):"";if(!l||!d||!w)throw new c(n,m.InvalidParameter,i);s.push({name:l,statistic:d.toLowerCase(),expression:$.create(w,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const a={};for(const d of t.fields)a[d.name.toLowerCase()]=1;for(const d of o)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);for(const d of s)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);let l=0;for(const d of o)if(d.name==="%%%%FIELDNAME"){for(;a["field_"+l.toString()]===1;)l++;a["field_"+l.toString()]=1,d.name="FIELD_"+l.toString()}}for(const a of o)await ie(a.expression,r,n);for(const a of s)await ie(a.expression,r,n);return e[0].groupby(o,s)})},r.signatures.push({name:"groupby",min:3,max:3}),r.functions.distinct=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(N(e[0])){x(e,2,2,n,i);const t=await e[0].load(),o=[];let s=[];if(C(e[1]))s.push(e[1]);else if(e[1]instanceof Z)s.push(e[1]);else if(b(e[1]))s=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);s=e[1].toArray()}let p=!1;for(const f of s)if(C(f)){const a=$.create(E(f),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),l=pe(a)===!0?E(f):"%%%%FIELDNAME";o.push({name:l,expression:a}),l==="%%%%FIELDNAME"&&(p=!0)}else{if(!(f instanceof Z))throw new c(n,m.InvalidParameter,i);{const a=f.hasField("name")?f.field("name"):"%%%%FIELDNAME",l=f.hasField("expression")?f.field("expression"):"";if(a==="%%%%FIELDNAME"&&(p=!0),!a)throw new c(n,m.InvalidParameter,i);o.push({name:a,expression:$.create(l||a,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const f={};for(const l of t.fields)f[l.name.toLowerCase()]=1;for(const l of o)l.name!=="%%%%FIELDNAME"&&(f[l.name.toLowerCase()]=1);let a=0;for(const l of o)if(l.name==="%%%%FIELDNAME"){for(;f["field_"+a.toString()]===1;)a++;f["field_"+a.toString()]=1,l.name="FIELD_"+a.toString()}}for(const f of o)await ie(f.expression,r,n);return e[0].groupby(o,[])}return He(e)})},r.functions.getfeaturesetinfo=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),!N(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?Z.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},de(n),!1,!1):null})},r.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),r.functions.filterbysubtypecode=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0])){const t=await e[0].load(),o=e[1];if(!Ne(o))throw new c(n,m.InvalidParameter,i);if(t.subtypeField){const p=$.create(`${t.subtypeField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:p})}if(t.typeIdField===null||t.typeIdField==="")throw new c(n,m.FeatureSetDoesNotHaveSubtypes,i);const s=$.create(`${t.typeIdField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:s})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}export{Pt as registerFunctions}; diff --git a/main/assets/featuresetgeom-BftbGgg3-BYUUChZd.js b/main/assets/featuresetgeom-BftbGgg3-BYUUChZd.js deleted file mode 100644 index 687d778c6..000000000 --- a/main/assets/featuresetgeom-BftbGgg3-BYUUChZd.js +++ /dev/null @@ -1 +0,0 @@ -import{J as S,w as R,M as p,r as a,T as u,n as l}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{Y as d}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{E as c,I as w}from"./SpatialFilter-BlQBFhwz-DQzQDaNp.js";import{d as o}from"./main-BZaw9FpY.js";import{relate as y,crosses as I,touches as F,within as A,overlaps as C,contains as P,intersects as h}from"./geometryEngineAsync-D7oEu5dd-DTqB2IHB.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-Cy2KeMh-.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./arcadeUtils-DpP0k7IY-DIwxqttO.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./workers-PiCjreoO-oGzLvkSt.js";function f(n){return n instanceof o}function s(n,t,i,m){return m(n,t,async(v,e,r)=>{if(r.length<2)throw new u(n,l.WrongNumberOfParameters,t);if((r=S(r))[0]===null&&r[1]===null)return!1;if(a(r[0])){if(r[1]instanceof o)return new w({parentfeatureset:r[0],relation:i,relationGeom:r[1]});if(r[1]===null)return new c({parentfeatureset:r[0]});throw new u(n,l.InvalidParameter,t)}if(f(r[0])){if(f(r[1])){switch(i){case"esriSpatialRelEnvelopeIntersects":return h(d(r[0]),d(r[1]));case"esriSpatialRelIntersects":return h(r[0],r[1]);case"esriSpatialRelContains":return P(r[0],r[1]);case"esriSpatialRelOverlaps":return C(r[0],r[1]);case"esriSpatialRelWithin":return A(r[0],r[1]);case"esriSpatialRelTouches":return F(r[0],r[1]);case"esriSpatialRelCrosses":return I(r[0],r[1])}throw new u(n,l.InvalidParameter,t)}if(a(r[1]))return new w({parentfeatureset:r[1],relation:i,relationGeom:r[0]});if(r[1]===null)return!1;throw new u(n,l.InvalidParameter,t)}if(r[0]===null){if(a(r[1]))return new c({parentfeatureset:r[1]});if(r[1]instanceof o||r[1]===null)return!1}throw new u(n,l.InvalidParameter,t)})}function K(n){n.mode==="async"&&(n.functions.intersects=function(t,i){return s(t,i,"esriSpatialRelIntersects",n.standardFunctionAsync)},n.functions.envelopeintersects=function(t,i){return s(t,i,"esriSpatialRelEnvelopeIntersects",n.standardFunctionAsync)},n.signatures.push({name:"envelopeintersects",min:2,max:2}),n.functions.contains=function(t,i){return s(t,i,"esriSpatialRelContains",n.standardFunctionAsync)},n.functions.overlaps=function(t,i){return s(t,i,"esriSpatialRelOverlaps",n.standardFunctionAsync)},n.functions.within=function(t,i){return s(t,i,"esriSpatialRelWithin",n.standardFunctionAsync)},n.functions.touches=function(t,i){return s(t,i,"esriSpatialRelTouches",n.standardFunctionAsync)},n.functions.crosses=function(t,i){return s(t,i,"esriSpatialRelCrosses",n.standardFunctionAsync)},n.functions.relate=function(t,i){return n.standardFunctionAsync(t,i,async(m,v,e)=>{if(e=S(e),R(e,3,3,t,i),f(e[0])&&f(e[1]))return y(e[0],e[1],p(e[2]));if(e[0]instanceof o&&e[1]===null||e[1]instanceof o&&e[0]===null)return!1;if(a(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(a(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(a(e[0])&&e[1]instanceof o)return e[0].relate(e[1],p(e[2]));if(a(e[1])&&e[0]instanceof o)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new u(t,l.InvalidParameter,i)})})}export{K as registerFunctions}; diff --git a/main/assets/featuresetgeom-BftbGgg3-DP9IJFWb.js b/main/assets/featuresetgeom-BftbGgg3-DP9IJFWb.js new file mode 100644 index 000000000..e3aef7889 --- /dev/null +++ b/main/assets/featuresetgeom-BftbGgg3-DP9IJFWb.js @@ -0,0 +1 @@ +import{J as S,w as R,M as p,r as a,T as u,n as l}from"./languageUtils-BYxF9hRA-BLoYMqdU.js";import{Y as d}from"./TimeOnly-DSMefxKy-C21ZkqlE.js";import{E as c,I as w}from"./SpatialFilter-BlQBFhwz-DNDU1J87.js";import{d as o}from"./main-C7yV2j71.js";import{relate as y,crosses as I,touches as F,within as A,overlaps as C,contains as P,intersects as h}from"./geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-CNuAEz8h.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./number-eRKYXfX9-C213qXfW.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./arcadeUtils-DpP0k7IY-BXKRfMc2.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./workers-PiCjreoO-DqI62TYf.js";function f(n){return n instanceof o}function s(n,t,i,m){return m(n,t,async(v,e,r)=>{if(r.length<2)throw new u(n,l.WrongNumberOfParameters,t);if((r=S(r))[0]===null&&r[1]===null)return!1;if(a(r[0])){if(r[1]instanceof o)return new w({parentfeatureset:r[0],relation:i,relationGeom:r[1]});if(r[1]===null)return new c({parentfeatureset:r[0]});throw new u(n,l.InvalidParameter,t)}if(f(r[0])){if(f(r[1])){switch(i){case"esriSpatialRelEnvelopeIntersects":return h(d(r[0]),d(r[1]));case"esriSpatialRelIntersects":return h(r[0],r[1]);case"esriSpatialRelContains":return P(r[0],r[1]);case"esriSpatialRelOverlaps":return C(r[0],r[1]);case"esriSpatialRelWithin":return A(r[0],r[1]);case"esriSpatialRelTouches":return F(r[0],r[1]);case"esriSpatialRelCrosses":return I(r[0],r[1])}throw new u(n,l.InvalidParameter,t)}if(a(r[1]))return new w({parentfeatureset:r[1],relation:i,relationGeom:r[0]});if(r[1]===null)return!1;throw new u(n,l.InvalidParameter,t)}if(r[0]===null){if(a(r[1]))return new c({parentfeatureset:r[1]});if(r[1]instanceof o||r[1]===null)return!1}throw new u(n,l.InvalidParameter,t)})}function K(n){n.mode==="async"&&(n.functions.intersects=function(t,i){return s(t,i,"esriSpatialRelIntersects",n.standardFunctionAsync)},n.functions.envelopeintersects=function(t,i){return s(t,i,"esriSpatialRelEnvelopeIntersects",n.standardFunctionAsync)},n.signatures.push({name:"envelopeintersects",min:2,max:2}),n.functions.contains=function(t,i){return s(t,i,"esriSpatialRelContains",n.standardFunctionAsync)},n.functions.overlaps=function(t,i){return s(t,i,"esriSpatialRelOverlaps",n.standardFunctionAsync)},n.functions.within=function(t,i){return s(t,i,"esriSpatialRelWithin",n.standardFunctionAsync)},n.functions.touches=function(t,i){return s(t,i,"esriSpatialRelTouches",n.standardFunctionAsync)},n.functions.crosses=function(t,i){return s(t,i,"esriSpatialRelCrosses",n.standardFunctionAsync)},n.functions.relate=function(t,i){return n.standardFunctionAsync(t,i,async(m,v,e)=>{if(e=S(e),R(e,3,3,t,i),f(e[0])&&f(e[1]))return y(e[0],e[1],p(e[2]));if(e[0]instanceof o&&e[1]===null||e[1]instanceof o&&e[0]===null)return!1;if(a(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(a(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(a(e[0])&&e[1]instanceof o)return e[0].relate(e[1],p(e[2]));if(a(e[1])&&e[0]instanceof o)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new u(t,l.InvalidParameter,i)})})}export{K as registerFunctions}; diff --git a/main/assets/featuresetstats-CY6YJ8Jt-CCnPraQt.js b/main/assets/featuresetstats-CY6YJ8Jt-CCnPraQt.js new file mode 100644 index 000000000..7ac9468b5 --- /dev/null +++ b/main/assets/featuresetstats-CY6YJ8Jt-CCnPraQt.js @@ -0,0 +1 @@ +import{r as l}from"./TimeOnly-DSMefxKy-C21ZkqlE.js";import{w as A,r as f,C as m,y as w,Z as d,T as h,n as S,g as c,e as v}from"./languageUtils-BYxF9hRA-BLoYMqdU.js";import{l as u}from"./arcadeUtils-DpP0k7IY-BXKRfMc2.js";import{Z as p,r as x}from"./WhereClause-DxwoyBMS-DCzFGfA-.js";import"./main-C7yV2j71.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-CNuAEz8h.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./number-eRKYXfX9-C213qXfW.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";async function s(n,r,t,i){if(t.length===1){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1));if(f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}}else if(t.length===3&&f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}return u(n,t,-1)}function g(n,r){return r instanceof x?l.fromReaderAsTimeStampOffset(r.toStorageFormat()):r instanceof Date?l.dateJSAndZoneToArcadeDate(r,v(n)):r}async function y(n,r,t){const i=n.getVariables();if(i.length>0){const o=[];for(let e=0;es("stdev",r,a,n))},n.functions.variance=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("variance",r,a,n))},n.functions.average=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.mean=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.sum=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("sum",r,a,n))},n.functions.min=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("min",r,a,n))},n.functions.max=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("max",r,a,n))},n.functions.count=function(r,t){return n.standardFunctionAsync(r,t,async(i,o,a)=>{if(A(a,1,1,r,t),f(a[0]))return a[0].count(i.abortSignal);if(m(a[0])||w(a[0]))return a[0].length;if(d(a[0]))return a[0].length();throw new h(r,S.InvalidParameter,t)})})}export{E as registerFunctions}; diff --git a/main/assets/featuresetstats-CY6YJ8Jt-DuADBO37.js b/main/assets/featuresetstats-CY6YJ8Jt-DuADBO37.js deleted file mode 100644 index 199bb9a70..000000000 --- a/main/assets/featuresetstats-CY6YJ8Jt-DuADBO37.js +++ /dev/null @@ -1 +0,0 @@ -import{r as l}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{w as A,r as f,C as m,y as w,Z as d,T as h,n as S,g as c,e as v}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{l as u}from"./arcadeUtils-DpP0k7IY-DIwxqttO.js";import{Z as p,r as x}from"./WhereClause-DxwoyBMS-BIlXG7Pl.js";import"./main-BZaw9FpY.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-Cy2KeMh-.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";async function s(n,r,t,i){if(t.length===1){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1));if(f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}}else if(t.length===3&&f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}return u(n,t,-1)}function g(n,r){return r instanceof x?l.fromReaderAsTimeStampOffset(r.toStorageFormat()):r instanceof Date?l.dateJSAndZoneToArcadeDate(r,v(n)):r}async function y(n,r,t){const i=n.getVariables();if(i.length>0){const o=[];for(let e=0;es("stdev",r,a,n))},n.functions.variance=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("variance",r,a,n))},n.functions.average=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.mean=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.sum=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("sum",r,a,n))},n.functions.min=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("min",r,a,n))},n.functions.max=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("max",r,a,n))},n.functions.count=function(r,t){return n.standardFunctionAsync(r,t,async(i,o,a)=>{if(A(a,1,1,r,t),f(a[0]))return a[0].count(i.abortSignal);if(m(a[0])||w(a[0]))return a[0].length;if(d(a[0]))return a[0].length();throw new h(r,S.InvalidParameter,t)})})}export{E as registerFunctions}; diff --git a/main/assets/featuresetstring-DFELZWNA-CIVmslvs.js b/main/assets/featuresetstring-DFELZWNA-CIVmslvs.js new file mode 100644 index 000000000..abdf4aefb --- /dev/null +++ b/main/assets/featuresetstring-DFELZWNA-CIVmslvs.js @@ -0,0 +1 @@ +import{N as l}from"./arcadeUtils-DpP0k7IY-BXKRfMc2.js";import{w as a,t as m,W as T,M as f,r as c,ah as y,T as d,n as u,$ as h,e as p,Q as b,ai as A,X as g,aj as x,g as j,u as F,x as V}from"./languageUtils-BYxF9hRA-BLoYMqdU.js";import{M as v}from"./shared-D1w-26bA-CNuAEz8h.js";import"./main-C7yV2j71.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./number-eRKYXfX9-C213qXfW.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";function w(i,t){return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?l.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:v[i.field.type],codedValues:i.domain.codedValues.map(e=>({name:e.name,code:e.code}))},p(t)):l.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:v[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},p(t)):null}function B(i){i.mode==="async"&&(i.functions.domain=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,3,t,e),m(n[0]))return w(T(n[0],f(n[1]),n[2]===void 0?void 0:n[2]),t);if(c(n[0]))return await n[0]._ensureLoaded(),w(y(f(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),t);throw new d(t,u.InvalidParameter,e)})},i.functions.subtypes=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0])){const r=h(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypeMetaData();return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})},i.functions.domainname=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return b(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return A(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domainname",min:2,max:4}),i.functions.domaincode=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return g(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return x(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domaincode",min:2,max:4}),i.functions.text=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,2,t,e),c(n[0])){const r=j(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",o.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",o.abortSignal);throw new d(t,u.InvalidParameter,e)}return F(n[0],n[1])})},i.functions.gdbversion=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new d(t,u.InvalidParameter,e)})},i.functions.schema=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),c(n[0]))return await n[0].load(),l.convertObjectToArcadeDictionary(n[0].schema(),p(t));if(m(n[0])){const r=V(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})})}export{B as registerFunctions}; diff --git a/main/assets/featuresetstring-DFELZWNA-DcES9f5x.js b/main/assets/featuresetstring-DFELZWNA-DcES9f5x.js deleted file mode 100644 index 724bce632..000000000 --- a/main/assets/featuresetstring-DFELZWNA-DcES9f5x.js +++ /dev/null @@ -1 +0,0 @@ -import{N as l}from"./arcadeUtils-DpP0k7IY-DIwxqttO.js";import{w as a,t as m,W as T,M as f,r as c,ah as y,T as d,n as u,$ as h,e as p,Q as b,ai as A,X as g,aj as x,g as j,u as F,x as V}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{M as v}from"./shared-D1w-26bA-Cy2KeMh-.js";import"./main-BZaw9FpY.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";function w(i,t){return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?l.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:v[i.field.type],codedValues:i.domain.codedValues.map(e=>({name:e.name,code:e.code}))},p(t)):l.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:v[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},p(t)):null}function B(i){i.mode==="async"&&(i.functions.domain=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,3,t,e),m(n[0]))return w(T(n[0],f(n[1]),n[2]===void 0?void 0:n[2]),t);if(c(n[0]))return await n[0]._ensureLoaded(),w(y(f(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),t);throw new d(t,u.InvalidParameter,e)})},i.functions.subtypes=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0])){const r=h(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypeMetaData();return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})},i.functions.domainname=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return b(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return A(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domainname",min:2,max:4}),i.functions.domaincode=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return g(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return x(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domaincode",min:2,max:4}),i.functions.text=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,2,t,e),c(n[0])){const r=j(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",o.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",o.abortSignal);throw new d(t,u.InvalidParameter,e)}return F(n[0],n[1])})},i.functions.gdbversion=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new d(t,u.InvalidParameter,e)})},i.functions.schema=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),c(n[0]))return await n[0].load(),l.convertObjectToArcadeDictionary(n[0].schema(),p(t));if(m(n[0])){const r=V(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})})}export{B as registerFunctions}; diff --git a/main/assets/fetchService-DbaKmJhP-CtznRt8p.js b/main/assets/fetchService-DbaKmJhP-CtznRt8p.js deleted file mode 100644 index 9f5108a52..000000000 --- a/main/assets/fetchService-DbaKmJhP-CtznRt8p.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BingMapsLayer-BigMnKl_-mmBYr2Ct.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js","./Layer-ChoECxvZ-C4wLrCej.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./BlendLayer-D1WkSmwP-UVXywJXM.js","./jsonUtils-wIllKWI4-DQ36DuUP.js","./parser-DyDJ-rlI-mkgQEqcN.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./common-CYWrYyJl-E8-sukrT.js","./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js","./commonProperties-BtIqvFU_-Brj0aAM1.js","./ElevationInfo-yv2-9tj6-pjIBBQET.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js","./imageBitmapUtils-DA36kg39-CBVFUZAU.js","./TileInfo-CWIRDhZl-BN68IeQv.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./OperationalLayer-B5IXiMa2-KEXCVZUA.js","./BuildingSceneLayer-IIePcdNz-ByUbiYty.js","./CollectionFlattener-DkHuHn5E-D3nwGseo.js","./loadAll-e978YItg-CB-7_cng.js","./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js","./RendererLegendOptions-K3md58-X-B6y5tQg5.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./colorRamps-q0bZVhs2-Bqen3nIx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./styleUtils-BtpNqZyT-B-RFL3S3.js","./jsonUtils-C64Zfu7c-trwRB9M4.js","./LRUCache-C3erQTWv-CeYLuvL9.js","./Version-CoKzbupV-BxOJQpf3.js","./FieldsIndex-HmzMbJQG-CiA2Ur00.js","./UnknownTimeZone-C--TOcPG-hkNbcn35.js","./OverrideHelper-DWRbVlj1-C2SNS5Gu.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-DpAlEmQT.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-72T4gbed.js","./heatmapUtils-seiMkkkR-D9lAE87R.js","./FeatureLayer-BrRKw5Si-CHreUEJ9.js","./FeatureLayerBase-vvYyZTfh-K4Z036-G.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./featureLayerUtils-DgfQQyK4-D6z7j0IK.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-sojFdYaD.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js","./Relationship-PyhUibYK-Bz6HFiBe.js","./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js","./workers-PiCjreoO-oGzLvkSt.js","./editsZScale-BDsX6vv--CeDyYvz6.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./APIKeyMixin-BUMSx9ny-xmyEzAt4.js","./ArcGISService-BYA-y6X6-DLcDzG-r.js","./CustomParametersMixin-vdKsTHer-CoiI71pj.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js","./FeatureEffect-CDEk9Es7-DK_N6ZYk.js","./FeatureFilter-BCFHgLVU-BSMrX0wh.js","./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js","./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js","./labelingInfo-DGVNul26-CXiwzGiu.js","./labelUtils-BW14kBqX-8wHrIU-s.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OrderedLayer-6Qsmrd_l-CGz1PXc3.js","./OrderByInfo-GD2XnU8e-C-uyyo-i.js","./PortalLayer-CElnYuSQ-tfjbIq8z.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./TemporalLayer-CpOrN_w9-kgJDrMMF.js","./TimeInfo-w_HB2CsF-wq_g9Zh1.js","./FeatureTemplate-SPHPD45f-tAS5Ccaa.js","./FeatureType-C9hJmS6_-pVJc0p7X.js","./fieldProperties-Bq26w7gt-DT6oRGMS.js","./versionUtils-LZYZz-38-xZnsxhiL.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js","./popupUtils-B0uZcXX0-BqljON9c.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./SceneService-BZqGtWmG-B8Xgkv2e.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./jsonContext-BA8GHqVk-BMETb6sX.js","./resourceUtils-BmW6QqlX-Cs99W_og.js","./resourceUtils-rTM6Iemx-C_sFWCPe.js","./saveUtils-CIYk-dsQ-BCXbqzbn.js","./I3SLayerDefinitions-CwLXCKtU-DIMh5lHL.js","./I3SUtil-Bq8KpP2j-B88-rKNw.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./projectVectorToVector-sIYLNlex-CXXu_lyF.js","./projectPointToVector-B2UUY9SE-DeA9AEsl.js","./sphere-BenPORjV-CgNvGf8s.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-fuXvBrPY.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./I3SBinaryReader-DEbI3cKZ-DbzHzPlz.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./floatRGBA-4pIJN00G-DwTr03sX.js","./NormalAttribute.glsl-axtNsUxo-corrAl_5.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./BindType-9iOk18Ed-CRW1cdX4.js","./orientedBoundingBox-oHezdpWm-CdJ2bdTT.js","./quat-BODLR7mS-Bk09s2KF.js","./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./popupUtils-nV1O8RUO-xbvi-u4x.js","./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js","./elevationInfoUtils-mOZsPH2J-CGmjotSk.js","./CSVLayer-CJQy-BsL-BoJ1PxIN.js","./clientSideDefaults-BqqayPct-BMC57bnT.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./CatalogLayer-BeO1fLsl-DdxDtWgZ.js","./ReactiveMap-CFk6jPfN-Dz1UG3IA.js","./signal-CETehA7D-vStzfbaY.js","./utils-tNxq3jkf-ni0gpzk6.js","./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js","./FeatureLayerSource-k4WMYop1-BFDYORV0.js","./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js","./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js","./External-D_wl4XAw-MFWeclAP.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-B7P01ZzU.js","./editingSupport-gUqP9iyf-Bz3XNCt8.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./QueryTask-CwHwH2rS-CU-oJwb3.js","./executeForIds-Z1gkLduF-Daa1fnES.js","./query-DFW9-NG_-1nHUNdNu.js","./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js","./pbf-D-y3_eZO-BOjQwfR-.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./executeQueryPBF-o8010HS9-dWp8mQx-.js","./featureConversionUtils-D6hFQ4Af-CkdezteH.js","./executeQueryJSON-CcHnccia-DVecwfbV.js","./DimensionLayer-DFh7fPYo-Dagcf84w.js","./Analysis-BPgJ-FCw-72MMAaCQ.js","./Cyclical-C_9rKUUQ-CmN6QXv-.js","./ElevationLayer-G6y-P-jo-CgtzrvPg.js","./ArcGISCachedService-C64Ko1TY-YBzt3RaL.js","./TileInfoTilemapCache-D1SExPij-UDulH8vT.js","./TilemapCache-CRRxws77-B5V8seF0.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./GeoJSONLayer-BFFwDRph-WFy27EiL.js","./GeoRSSLayer-DgF8xnYi-U408jYSK.js","./GroupLayer-ER-XzoYr-Dk-USe8D.js","./TablesMixin-C8RojhYs-DjK1Q1jj.js","./writeUtils-D5qlLkwk-DIX6zS6N.js","./ImageryLayer-B-bJb8lU-B5SbVSix.js","./RasterPresetRendererMixin-D6W9pUY6-BpvSTPuo.js","./multidimensionalUtils-BwTugeu7-CpzGLouA.js","./dataUtils-BkPy4R3C-B2SUbyy5.js","./RasterSymbolizer-BVys6HkM-CeBx4Ld8.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./utils-DPtQ14k3-D1wtSpry.js","./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js","./ImageryTileLayer-DixyNESc-BPxwTHVO.js","./RawBlockCache-Cj_tmHDm-d1RSObdh.js","./rasterProjectionHelper-Calp0o_1-B4RgRe7E.js","./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js","./PolynomialTransform-C3nWCu0l-Draevh5B.js","./IntegratedMesh3DTilesLayer-BEcgXCkk-BqNlS4x8.js","./IntegratedMeshLayer-C-XaBbXd-CPvMhR5k.js","./persistable-C6RBwzJi-B2W1QdS_.js","./resourceExtension-CdQvIDKV-X6Zoj5Td.js","./KMLLayer-DwQXpcMB-Dk5jM17E.js","./kmlUtils-C5oIEoOy-CLmxrxRw.js","./KnowledgeGraphLayer-BjNFJGLf-DsV8zTWJ.js","./KnowledgeGraphSublayer-DPj4igi1-DI2RO5d6.js","./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js","./GraphicsCollection-CWTXNZOX-8-_pDOZK.js","./knowledgeGraphService-DOJz0fzA-6E_aD1T8.js","./Relationship-Db9GUmYx-DPu3VSRE.js","./FeatureStore-Co2V0sVE-CXrTGv5U.js","./BoundsStore--N6o1xkF-DBAJ8yky.js","./PooledRBush-DbfAmeLn-DzJ6h3wI.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./timeSupport-jPViR5jn-DVbPitWZ.js","./queryUtils-Brxu6254-DDAvXp_C.js","./json-BI97KiBB-Ce5cWfI2.js","./optimizedFeatureQueryEngineAdapter-DFdaawxC-B00n4rHs.js","./QueryEngine-CH5uUhZK-D2fBx3cq.js","./WhereClause-DxwoyBMS-BIlXG7Pl.js","./TimeOnly-DSMefxKy-DBJeVQCe.js","./utils-HtkT8Fn3-DRbEu-K5.js","./utils-DyydRFHu-D-5zlVyA.js","./Basemap-BEqqSTw9-BkQ-c4vY.js","./Scheduler-B7UX7Wr5-DXVwwlDm.js","./LineOfSightLayer-D6sUQaEP-CK15mn6v.js","./featureReferenceUtils-Ct4KY5u7-ByRyweVx.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./boundedPlane-DlvE0eNx-BetNH2zh.js","./lineSegment-CcqvCARM-D_SdPttv.js","./LinkChartLayer-KcYDvLxD-5ZdeWZDk.js","./MapImageLayer-B_rP0PhA-IiizomG9.js","./scaleUtils-DxsfQwK1-OKeSqBb9.js","./SublayersOwner-DfTaMJ5V-CcYzSRLx.js","./sublayerUtils-CyM0QC5B-BB_azrTi.js","./ExportImageParameters-DxyNGQ57-DAeGZbW_.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./MapNotesLayer-DauvjDLM-CG1np16e.js","./objectIdUtils-EszJVKSV-Bi133oF_.js","./MediaLayer-DiCs97gD-ChMe9P3l.js","./perspectiveUtils-Bu88xlbg-Dy8WOySc.js","./normalizeUtilsSync-CBU7m8rm-BwWpNUEt.js","./vec2-tHZ6OaOy-xCj1obDt.js","./imageUtils-BA2D6Uf1-BIs7TUww.js","./OGCFeatureLayer-DPXQjO1S-rxAMv6lM.js","./ogcFeatureUtils-Bs12bZY3-DAr9GIuj.js","./geojson-CNt_qtQf-BQNqVsVZ.js","./date-Cqvy-TgA-DIf-QFLz.js","./sourceUtils-BMeqkJ5g-CD_x4f6t.js","./OpenStreetMapLayer-Bx4EhJij-DzFDuY-s.js","./WebTileLayer-CUoicUjK-CD-UQu9P.js","./OrientedImageryLayer-CwG5o4Di-DYTbbojC.js","./PointCloudLayer-CkxImr5P--Ckfo6GN.js","./PointCloudUniqueValueRenderer-C-5hwEaR-DdDCmiVd.js","./RouteLayer-BQQ6WxtH-CfUqYUOq.js","./Stop-he5xSAJJ-B5QVbzdn.js","./SceneLayer-DOh9PmQy-BaxV7T2s.js","./Mesh-DLzjDUIO-L2WFr_jE.js","./MeshVertexAttributes-CbNpPur2-BzFN0z5X.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-Cw8IJeSy.js","./deduplicate-D2d-E5Pw-cAmFzdIS.js","./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js","./vec3-BazNroeq-CFXHYIOm.js","./BufferView-PQoE3GL7-DXIpDOUe.js","./vec4-DWDdg1fj-maVOs7I3.js","./meshSpatialReferenceScaleUtils-B1zR72Os-DiWGnc4E.js","./StreamLayer-Bqnt-d3H-D6cxPEIX.js","./SubtypeGroupLayer-D1vAbwEU-CoAWt7WI.js","./TileLayer-Be5tWeN5-CfDmVQKc.js","./UnknownLayer-DwWK383_-B85_VjP3.js","./UnsupportedLayer-CCUtmZ2i-C4THy2jL.js","./VectorTileLayer-DruyQukp-DM5uhmkp.js","./TileKey-C5IL-JBr-0HJjsV9n.js","./StyleRepository-D3WuVprR-COU4Jcir.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./enums-qHpGJ28Q-CmnLAccm.js","./GeometryUtils-NHgB9gGQ-CDTp-_cE.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./definitions-DJSdSb77-DkoRHaVx.js","./capabilities-agoTWNzb-CtsNgRyk.js","./VideoLayer-Dxs-NJSn-DOPIz0CI.js","./TelemetryDisplay-Bq2PXfI8-BWfBxjew.js","./ViewshedLayer-BYX-h7eL-CBz4CWxL.js","./VoxelLayer-KL84GttA-D57b8TA4.js","./WFSLayer-DKnx5V8b-hsBbBIQ2.js","./wfsUtils-DoLaqXsj-BVPAm0Zv.js","./xmlUtils-TLuV3CJ7-Cs2DGP6C.js","./WMSLayer-C8eYRV4V-ozTC3oB7.js","./crsUtils-BLe27KvG-VS_BXVdj.js","./ExportWMSImageParameters-CMk80WSM-CXXj-iAb.js","./WMTSLayer-DJY_jjIE-DbxfHjqO.js"])))=>i.map(i=>d[i]); -import{f as s,_ as a}from"./main-BZaw9FpY.js";async function d(t,e){const{data:_}=await s(t,{responseType:"json",query:{f:"json",...e?.customParameters,token:e?.apiKey}});return _}const v={BingMapsLayer:async()=>(await a(async()=>{const{default:t}=await import("./BingMapsLayer-BigMnKl_-mmBYr2Ct.js");return{default:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url)).default,BuildingSceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./BuildingSceneLayer-IIePcdNz-ByUbiYty.js");return{default:t}},__vite__mapDeps([21,1,2,22,23,3,4,5,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,45,13,14,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124]),import.meta.url)).default,CSVLayer:async()=>(await a(async()=>{const{default:t}=await import("./CSVLayer-CJQy-BsL-BoJ1PxIN.js");return{default:t}},__vite__mapDeps([125,1,2,45,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,13,14,46,47,48,49,50,51,52,53,5,54,55,56,57,4,58,59,60,61,62,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90,126,127,91]),import.meta.url)).default,CatalogLayer:async()=>(await a(async()=>{const{default:t}=await import("./CatalogLayer-BeO1fLsl-DdxDtWgZ.js");return{default:t}},__vite__mapDeps([128,1,2,3,4,5,33,129,130,6,7,8,9,10,11,16,13,14,15,77,131,132,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,55,56,57,68,69,70,73,74,88,133,134,135,102,136,137,61,62,138,101,118,107,109,139,140,141,142,143,67,126,127,91,144,145,146,147,148,149,150,60,151,152,63,153,59,64,65,66,20,76,78,79,80,12,81,82,84,83,85,86]),import.meta.url)).default,DimensionLayer:async()=>(await a(async()=>{const{default:t}=await import("./DimensionLayer-DFh7fPYo-Dagcf84w.js");return{default:t}},__vite__mapDeps([154,1,2,155,156,61,62,3,4,5,20,13,14,15]),import.meta.url)).default,ElevationLayer:async()=>(await a(async()=>{const{default:t}=await import("./ElevationLayer-G6y-P-jo-CgtzrvPg.js");return{default:t}},__vite__mapDeps([157,1,2,3,49,4,5,158,18,19,159,160,161,33,65,50,20,13,14,15,78,79,80,61,62,58]),import.meta.url)).default,FeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./FeatureLayer-BrRKw5Si-CHreUEJ9.js");return{default:t}},__vite__mapDeps([45,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,13,14,46,47,48,49,50,51,52,53,5,54,55,56,57,4,58,59,60,61,62,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90]),import.meta.url)).default,GeoJSONLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoJSONLayer-BFFwDRph-WFy27EiL.js");return{default:t}},__vite__mapDeps([162,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,4,5,58,126,127,91,63,47,48,6,7,8,9,10,66,68,69,70,53,71,13,14,72,51,52,54,73,74,75,20,76,77,78,79,80,61,62,12,16,81,82,83,85,88]),import.meta.url)).default,GeoRSSLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoRSSLayer-DgF8xnYi-U408jYSK.js");return{default:t}},__vite__mapDeps([163,1,2,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16]),import.meta.url)).default,GroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./GroupLayer-ER-XzoYr-Dk-USe8D.js");return{default:t}},__vite__mapDeps([164,1,2,22,23,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,16,165,90,98,166]),import.meta.url)).default,ImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryLayer-B-bJb8lU-B5SbVSix.js");return{default:t}},__vite__mapDeps([167,1,2,3,4,5,168,169,58,170,47,48,24,25,26,27,28,29,30,15,31,171,172,38,39,11,40,132,142,63,140,141,143,173,8,9,10,174,41,42,33,13,14,35,36,17,53,145,146,147,148,149,150,60,61,62,153,65,50,6,7,66,20,78,79,80,12,16,81,82,86,88,90]),import.meta.url)).default,ImageryTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryTileLayer-DixyNESc-BPxwTHVO.js");return{default:t}},__vite__mapDeps([175,1,2,3,4,5,65,50,6,7,8,9,10,11,66,168,169,58,170,47,48,24,25,26,27,28,29,30,15,31,171,172,38,39,40,132,142,63,140,141,143,173,174,41,42,33,13,14,18,19,176,177,61,62,178,129,130,179,20,78,79,80,12,16,81,82,160,161,88,90]),import.meta.url)).default,IntegratedMesh3DTilesLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMesh3DTilesLayer-BEcgXCkk-BqNlS4x8.js");return{default:t}},__vite__mapDeps([180,1,2,3,102,11,62,4,5,64,65,50,66,20,13,14,15,78,79,80,61,16,124]),import.meta.url)).default,IntegratedMeshLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMeshLayer-C-XaBbXd-CPvMhR5k.js");return{default:t}},__vite__mapDeps([181,1,2,3,182,75,94,52,183,4,5,64,65,50,66,20,13,14,15,78,79,80,61,62,16,92,93,49,95,96,97,98,99,124]),import.meta.url)).default,KMLLayer:async()=>(await a(async()=>{const{default:t}=await import("./KMLLayer-DwQXpcMB-Dk5jM17E.js");return{default:t}},__vite__mapDeps([184,1,2,22,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,185,32,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,63,47,48]),import.meta.url)).default,KnowledgeGraphLayer:async()=>(await a(async()=>{const{default:t}=await import("./KnowledgeGraphLayer-BjNFJGLf-DsV8zTWJ.js");return{default:t}},__vite__mapDeps([186,1,2,3,52,4,5,187,61,62,152,149,150,188,189,6,7,8,9,10,11,16,14,15,190,191,53,47,48,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,58,192,193,194,195,196,197,140,141,142,143,198,199,200,201,202,127,203,204,205,23,79,166,131,132,206,130,126,91,85,68,69,70,71,13,72,51,54,73,74,75,76,77,12,81,82,63,88,65,50,66,20,78,80]),import.meta.url)).default,LineOfSightLayer:async()=>(await a(async()=>{const{default:t}=await import("./LineOfSightLayer-D6sUQaEP-CK15mn6v.js");return{default:t}},__vite__mapDeps([207,1,2,155,208,102,11,105,10,39,40,106,107,108,101,109,110,209,210,211,182,75,94,52,183,14,15,61,62,124,3,4,5,20,13]),import.meta.url)).default,LinkChartLayer:async()=>(await a(async()=>{const{default:t}=await import("./LinkChartLayer-KcYDvLxD-5ZdeWZDk.js");return{default:t}},__vite__mapDeps([212,1,2,3,4,5,152,149,150,187,61,62,188,189,6,7,8,9,10,11,16,14,15,190,191,53,47,48,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,58,192,193,194,195,196,197,140,141,142,143,198,199,200,201,202,127,203,204,205,23,79,166,131,132,206,130,126,91,85,68,69,70,71,13,72,51,52,54,73,74,75,76,77,12,81,82,63,88,20]),import.meta.url)).default,MapImageLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapImageLayer-B_rP0PhA-IiizomG9.js");return{default:t}},__vite__mapDeps([213,1,2,23,3,214,4,5,64,215,34,50,13,14,15,80,61,62,22,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,11,40,41,42,43,44,144,137,53,47,48,142,145,146,140,141,143,147,148,149,150,60,151,152,63,153,51,52,54,84,83,73,74,55,56,57,88,216,65,6,7,8,9,10,66,20,78,79,12,16,81,82,217,218,17,86]),import.meta.url)).default,MapNotesLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapNotesLayer-DauvjDLM-CG1np16e.js");return{default:t}},__vite__mapDeps([219,1,2,3,61,62,140,141,142,143,45,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,13,14,46,47,48,49,50,51,52,53,5,54,55,56,57,4,58,59,60,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90,188,189,220]),import.meta.url)).default,MediaLayer:async()=>(await a(async()=>{const{default:t}=await import("./MediaLayer-DiCs97gD-ChMe9P3l.js");return{default:t}},__vite__mapDeps([221,1,2,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,16,222,223,141,106,107,224,102,110,225,52,183,193,194,195,90]),import.meta.url)).default,OGCFeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./OGCFeatureLayer-DPXQjO1S-rxAMv6lM.js");return{default:t}},__vite__mapDeps([226,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,4,5,227,152,149,150,228,229,126,127,91,230,48,63,47,64,6,7,8,9,10,66,68,69,70,53,71,13,14,72,51,52,54,73,74,75,20,76,77,78,79,80,61,62,12,16,81,82,84,83,85,88]),import.meta.url)).default,OpenStreetMapLayer:async()=>(await a(async()=>{const{default:t}=await import("./OpenStreetMapLayer-Bx4EhJij-DzFDuY-s.js");return{default:t}},__vite__mapDeps([231,1,2,232,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,17,18,19]),import.meta.url)).default,OrientedImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./OrientedImageryLayer-CwG5o4Di-DYTbbojC.js");return{default:t}},__vite__mapDeps([233,1,2,45,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,13,14,46,47,48,49,50,51,52,53,5,54,55,56,57,4,58,59,60,61,62,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90]),import.meta.url)).default,PointCloudLayer:async()=>(await a(async()=>{const{default:t}=await import("./PointCloudLayer-CkxImr5P--Ckfo6GN.js");return{default:t}},__vite__mapDeps([234,1,2,3,4,5,64,65,50,66,20,13,14,15,78,79,80,61,62,16,92,93,94,49,95,96,52,97,98,47,48,85,35,36,235,25,124,88]),import.meta.url)).default,RouteLayer:async()=>(await a(async()=>{const{default:t}=await import("./RouteLayer-BQQ6WxtH-CfUqYUOq.js");return{default:t}},__vite__mapDeps([236,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,93,94,61,62,4,5,6,7,8,9,10,20,13,14,78,79,80,16,50,142,237,140,141,143,63,47,48]),import.meta.url)).default,SceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./SceneLayer-DOh9PmQy-BaxV7T2s.js");return{default:t}},__vite__mapDeps([238,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,239,138,10,101,118,107,109,102,225,240,134,135,241,242,108,110,243,104,61,62,244,106,119,120,245,246,224,247,136,137,4,5,248,64,65,50,66,67,52,20,13,14,78,79,80,16,92,93,94,49,95,96,97,98,81,82,123,91,51,47,48,53,54,72,85,99,73,74,55,182,75,183,87,124,88,100,103,105,111,112,113,114,115,116,117,121,122]),import.meta.url)).default,StreamLayer:async()=>(await a(async()=>{const{default:t}=await import("./StreamLayer-Bqnt-d3H-D6cxPEIX.js");return{default:t}},__vite__mapDeps([249,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,4,5,65,50,6,7,8,9,10,66,68,69,70,53,47,48,71,13,14,72,51,52,54,73,74,75,20,78,79,80,61,62,12,16,81,82,85,87,88,90]),import.meta.url)).default,SubtypeGroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./SubtypeGroupLayer-D1vAbwEU-CoAWt7WI.js");return{default:t}},__vite__mapDeps([250,1,2,23,3,4,5,64,65,50,6,7,8,9,10,11,66,67,52,46,47,48,13,14,15,49,51,53,32,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,54,55,56,57,20,78,79,80,61,62,12,16,81,82,85,174,173,83,73,74,88,86,90]),import.meta.url)).default,TileLayer:async()=>(await a(async()=>{const{default:t}=await import("./TileLayer-Be5tWeN5-CfDmVQKc.js");return{default:t}},__vite__mapDeps([251,1,2,23,3,4,5,64,158,18,19,159,160,161,33,215,34,50,13,14,15,80,61,62,22,24,25,26,27,28,29,30,31,32,35,36,37,38,39,11,40,41,42,43,44,144,137,53,47,48,142,145,146,140,141,143,147,148,149,150,60,151,152,63,153,51,52,54,84,83,73,74,55,56,57,88,216,65,6,7,8,9,10,66,20,78,79,12,16,17]),import.meta.url)).default,UnknownLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnknownLayer-DwWK383_-B85_VjP3.js");return{default:t}},__vite__mapDeps([252,1,2,3,4,5,78,79,80,61,62]),import.meta.url)).default,UnsupportedLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnsupportedLayer-CCUtmZ2i-C4THy2jL.js");return{default:t}},__vite__mapDeps([253,1,2,3,4,5,78,79,80,61,62]),import.meta.url)).default,VectorTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./VectorTileLayer-DruyQukp-DM5uhmkp.js");return{default:t}},__vite__mapDeps([254,1,2,3,4,5,64,158,18,19,159,160,161,33,65,50,6,7,8,9,10,11,66,20,13,14,15,78,79,80,61,62,12,16,255,95,256,257,42,258,259,260,261,38,39,40,262,263,264]),import.meta.url)).default,VideoLayer:async()=>(await a(async()=>{const{default:t}=await import("./VideoLayer-Dxs-NJSn-DOPIz0CI.js");return{default:t}},__vite__mapDeps([265,1,2,3,4,5,6,7,8,9,10,11,66,16,50,13,14,15,57,266,107,106,102,119,62,172]),import.meta.url)).default,ViewshedLayer:async()=>(await a(async()=>{const{default:t}=await import("./ViewshedLayer-BYX-h7eL-CBz4CWxL.js");return{default:t}},__vite__mapDeps([267,1,2,208,102,11,105,10,39,40,106,107,108,101,109,110,209,210,211,156,155,61,62,3,4,5,20,13,14,15]),import.meta.url)).default,VoxelLayer:async()=>(await a(async()=>{const{default:t}=await import("./VoxelLayer-KL84GttA-D57b8TA4.js");return{default:t}},__vite__mapDeps([268,1,2,3,102,11,4,5,64,65,50,66,20,13,14,15,78,79,80,61,62,16,92,93,94,49,95,96,52,97,98,47,48,35,36,82,156,182,75,183,118,107,109,39,88]),import.meta.url)).default,WFSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WFSLayer-DKnx5V8b-hsBbBIQ2.js");return{default:t}},__vite__mapDeps([269,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,4,5,58,126,127,91,270,61,62,228,229,149,271,50,47,48,63,6,7,8,9,10,66,68,69,70,53,71,13,14,72,51,52,54,73,74,75,20,76,77,78,79,80,12,16,81,82,85,88]),import.meta.url)).default,WMSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMSLayer-C8eYRV4V-ozTC3oB7.js");return{default:t}},__vite__mapDeps([272,1,2,22,3,214,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,81,82,273,50,274,17]),import.meta.url)).default,WMTSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMTSLayer-DJY_jjIE-DbxfHjqO.js");return{default:t}},__vite__mapDeps([275,1,2,3,4,5,232,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,17,18,19,159,273,271]),import.meta.url)).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-CUoicUjK-CD-UQu9P.js"),__vite__mapDeps([232,1,2,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,17,18,19]),import.meta.url).then(t=>t.W)).default},y=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function E(t,e){const{loadContext:_,...r}=e||{},u=_?await _.fetchServiceMetadata(t,r):await d(t,r);f(u),o(u);const l={serviceJSON:u};if((u.currentVersion??0)<10.5)return l;const n=`${t}/layers`,i=_?await _.fetchServiceMetadata(n,r):await d(n,r);return f(i),o(i),l.layersJSON={layers:i.layers,tables:i.tables},l}function c(t){const{type:e}=t;return!!e&&y.has(e)}function m(t){return t.type==="Table"}function o(t){t.layers=t.layers?.filter(c),t.tables=t.tables?.filter(m)}function p(t){t.type||="Feature Layer"}function L(t){t.type||="Table"}function f(t){t.layers?.forEach(p),t.tables?.forEach(L)}function O(t){switch(t){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}export{E as d,O as g,d as o,v as p}; diff --git a/main/assets/fetchService-DbaKmJhP-DPDp5i2e.js b/main/assets/fetchService-DbaKmJhP-DPDp5i2e.js new file mode 100644 index 000000000..c4b7f1adf --- /dev/null +++ b/main/assets/fetchService-DbaKmJhP-DPDp5i2e.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BingMapsLayer-BigMnKl_-D6t2rOyx.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./MultiOriginJSONSupport-DKRh9P6w-06-n7Flv.js","./Layer-ChoECxvZ--vVxyMLZ.js","./TimeExtent-Cn0Jofqr-5JsvQYX6.js","./BlendLayer-D1WkSmwP-D_mOfOGH.js","./jsonUtils-wIllKWI4-DRJhEzZa.js","./parser-DyDJ-rlI-CV6nO3M9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-vewreEuZ.js","./common-CYWrYyJl-E8-sukrT.js","./RefreshableLayer-a8BQ58Xh-DVxzH3dc.js","./commonProperties-BtIqvFU_-DuUske_0.js","./ElevationInfo-yv2-9tj6-CpVy5FM0.js","./lengthUtils-DKpMe5qR-E2FfnN85.js","./ScaleRangeLayer-Bz0DcnvM-s-boYtri.js","./imageBitmapUtils-DA36kg39-BPA5qQx5.js","./TileInfo-CWIRDhZl-CwJ-BCrJ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./OperationalLayer-B5IXiMa2-B5IUcPZ-.js","./BuildingSceneLayer-IIePcdNz-xcftlFLr.js","./CollectionFlattener-DkHuHn5E-BN4WFIND.js","./loadAll-e978YItg-NjG3VBGi.js","./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js","./RendererLegendOptions-K3md58-X-Bf90N-cx.js","./diffUtils-Cz3Fi8Xb-BvD0JNhD.js","./colorRamps-q0bZVhs2-DeDskCk_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-5umqHW84.js","./compilerUtils-CV1QYWI8-89qN_-l3.js","./styleUtils-BtpNqZyT-CwQxANzG.js","./jsonUtils-C64Zfu7c-BqaK54UK.js","./LRUCache-C3erQTWv-DhyPlt5p.js","./Version-CoKzbupV-BKAqCewj.js","./FieldsIndex-HmzMbJQG-CzzKuIHi.js","./UnknownTimeZone-C--TOcPG-DfRfNtw8.js","./OverrideHelper-DWRbVlj1-D6dDt4cu.js","./colorUtils-Cthpxcks-CXgjba3p.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-Dl9Ps2XQ.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-1xSDkBxg.js","./heatmapUtils-seiMkkkR-BSMLb7yQ.js","./FeatureLayer-BrRKw5Si-Rem12G_g.js","./FeatureLayerBase-vvYyZTfh-CZhAh2L8.js","./Field-C6hA1tZj-C0Sp7XvY.js","./fieldType-CD2CL2hr-B1iISniv.js","./HeightModelInfo-C5vFqzyF-DTZiz4z_.js","./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js","./featureLayerUtils-DgfQQyK4-D0OGSvJx.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-DV_czrJX.js","./RelationshipQuery-DJsz3K0U-BHNd_b19.js","./LayerFloorInfo-DRJ8wfwx-Dcb-ZwRi.js","./Relationship-PyhUibYK-DuMEI2S9.js","./serviceCapabilitiesUtils-rPjN5QBe-Bi0AeWaF.js","./workers-PiCjreoO-DqI62TYf.js","./editsZScale-BDsX6vv--CoeIQyxn.js","./queryZScale-BiYV6Pr6-Byqa7f2t.js","./projection-BA9M1R7d-DXrPfsKU.js","./projectBuffer-CvCBvJ6W-D_Mlrmjj.js","./FeatureSet-BkVNthuN-DDwR53LR.js","./APIKeyMixin-BUMSx9ny-AE1ffoPb.js","./ArcGISService-BYA-y6X6-BtWUPppI.js","./CustomParametersMixin-vdKsTHer-DndyRc71.js","./EditBusLayer-Df29OyJh-DJOAJb6r.js","./FeatureEffectLayer-Cro89IEC-BTHxGcqL.js","./FeatureEffect-CDEk9Es7-CW8HxX_m.js","./FeatureFilter-BCFHgLVU-DU6FY8I7.js","./FeatureReductionLayer-BTZjL0_Z-C_UuVBzN.js","./FeatureReductionSelection-BjX3h7Sz-DZKYFIQQ.js","./labelingInfo-DGVNul26-ReCWpi39.js","./labelUtils-BW14kBqX-Cu1LInU4.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OrderedLayer-6Qsmrd_l-sp1TyHmN.js","./OrderByInfo-GD2XnU8e-CsM0tB0E.js","./PortalLayer-CElnYuSQ-BV63HHSL.js","./PortalItem-CctGdnxF-CHPkp6yW.js","./portalItemUtils-B8bw6SAG-DNmyZ8kw.js","./TemporalLayer-CpOrN_w9-D1I2RE1l.js","./TimeInfo-w_HB2CsF-Ce-xYAJs.js","./FeatureTemplate-SPHPD45f-DdZuptIc.js","./FeatureType-C9hJmS6_-5PPiaaCJ.js","./fieldProperties-Bq26w7gt-DgCDIFFS.js","./versionUtils-LZYZz-38-DgmFurh2.js","./styleUtils-ChrJTYIw-OCRItq_6.js","./popupUtils-B0uZcXX0-B9v3xvNZ.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./SceneService-BZqGtWmG-B9O0VJ5b.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./jsonContext-BA8GHqVk-DpBf0bCt.js","./resourceUtils-BmW6QqlX-CP-OW4gT.js","./resourceUtils-rTM6Iemx-Bu5Czfos.js","./saveUtils-CIYk-dsQ-h9O9-CBJ.js","./I3SLayerDefinitions-CwLXCKtU-DliEVqX4.js","./I3SUtil-Bq8KpP2j-DfTxNx-1.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-CXe4l2D-.js","./projectVectorToVector-sIYLNlex-B5U5xz17.js","./projectPointToVector-B2UUY9SE-BWg0qYG-.js","./sphere-BenPORjV-CiIWUavi.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-CdQQbSdq.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./I3SBinaryReader-DEbI3cKZ-D9EuM1ww.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./floatRGBA-4pIJN00G-ClP9XgP7.js","./NormalAttribute.glsl-axtNsUxo-BBxjKgoo.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./BindType-9iOk18Ed-CRW1cdX4.js","./orientedBoundingBox-oHezdpWm-BA8RF5F7.js","./quat-BODLR7mS-Dbd8ftOx.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js","./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./popupUtils-nV1O8RUO-X6GWMgRY.js","./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js","./elevationInfoUtils-mOZsPH2J-Bwot-813.js","./CSVLayer-CJQy-BsL-CVXWwvJs.js","./clientSideDefaults-BqqayPct-B0cLE-po.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./CatalogLayer-BeO1fLsl-2bzVHku5.js","./ReactiveMap-CFk6jPfN-CM49HI11.js","./signal-CETehA7D-DxK1orqE.js","./utils-tNxq3jkf-DW91Ot0z.js","./ClassBreaksDefinition-bYRgYgPp-DFbyqf-C.js","./FeatureLayerSource-k4WMYop1-z-zJ1lao.js","./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js","./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js","./External-D_wl4XAw-Bzqlxz38.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-QYZk68_K.js","./editingSupport-gUqP9iyf-3W9GNLNT.js","./normalizeUtils-Bxmy9MNI-nfuKj9G4.js","./normalizeUtilsCommon-CRJlkfEA-gUMlOjU7.js","./utils-9sQxfkoa-Bn_d9vXA.js","./utils-Bq23Xwmj-Bx2NKKg4.js","./QueryTask-CwHwH2rS-CT1NKU1Q.js","./executeForIds-Z1gkLduF-BNBrXf-U.js","./query-DFW9-NG_-CfusC8cS.js","./pbfQueryUtils-F4ZE8-K8-OJsDwOym.js","./pbf-D-y3_eZO-SEvl9j6c.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./executeQueryPBF-o8010HS9-E5WwNUPn.js","./featureConversionUtils-D6hFQ4Af-sYSorBK9.js","./executeQueryJSON-CcHnccia-CB1D7q08.js","./DimensionLayer-DFh7fPYo-CxFJ4hke.js","./Analysis-BPgJ-FCw-Bdup4FTz.js","./Cyclical-C_9rKUUQ-DaQlxz0D.js","./ElevationLayer-G6y-P-jo-DB8amMzu.js","./ArcGISCachedService-C64Ko1TY-C2ql8te1.js","./TileInfoTilemapCache-D1SExPij-6JuHkhwl.js","./TilemapCache-CRRxws77-Cj_Hxxs_.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./GeoJSONLayer-BFFwDRph-64SMPh4J.js","./GeoRSSLayer-DgF8xnYi-BEBXvG2J.js","./GroupLayer-ER-XzoYr-B2r6nbwd.js","./TablesMixin-C8RojhYs-CMxVrapj.js","./writeUtils-D5qlLkwk-IaioN2Q8.js","./ImageryLayer-B-bJb8lU-DHQsi7TZ.js","./RasterPresetRendererMixin-D6W9pUY6-Q9Qi8PwW.js","./multidimensionalUtils-BwTugeu7-LevYq4ep.js","./dataUtils-BkPy4R3C-D8T8_whC.js","./RasterSymbolizer-BVys6HkM-BxgX8zwh.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./utils-DPtQ14k3-BW98GOs_.js","./cimSymbolUtils-CKIzBgMU-D2oNADot.js","./ImageryTileLayer-DixyNESc-CLvjCbqI.js","./RawBlockCache-Cj_tmHDm-CYD33Wpe.js","./rasterProjectionHelper-Calp0o_1-CEgzFjuf.js","./QueueProcessor-DbfV9fLy-DobN0ur5.js","./PolynomialTransform-C3nWCu0l-DmoNKYd3.js","./IntegratedMesh3DTilesLayer-BEcgXCkk-BFGow1HJ.js","./IntegratedMeshLayer-C-XaBbXd-BQWd-pKc.js","./persistable-C6RBwzJi-DoQq7vOT.js","./resourceExtension-CdQvIDKV-BFbGjGZW.js","./KMLLayer-DwQXpcMB-0SwlR7uL.js","./kmlUtils-C5oIEoOy-CbWoF4Dn.js","./KnowledgeGraphLayer-BjNFJGLf-uaXruRWF.js","./KnowledgeGraphSublayer-DPj4igi1-DXaAi0X5.js","./GraphicsLayer-DfeGaYc1-DAZy-iUY.js","./GraphicsCollection-CWTXNZOX-BB4NQ39c.js","./knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js","./Relationship-Db9GUmYx-DnaxtAbX.js","./FeatureStore-Co2V0sVE-BoTs_3tu.js","./BoundsStore--N6o1xkF-mEMXylgh.js","./PooledRBush-DbfAmeLn-dj1fSLWj.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./timeSupport-jPViR5jn-BnQYlj-C.js","./queryUtils-Brxu6254-T3UhaATW.js","./json-BI97KiBB-Ce5cWfI2.js","./optimizedFeatureQueryEngineAdapter-DFdaawxC-vgHWskCb.js","./QueryEngine-CH5uUhZK-DnnsKt6q.js","./WhereClause-DxwoyBMS-DCzFGfA-.js","./TimeOnly-DSMefxKy-C21ZkqlE.js","./utils-HtkT8Fn3-d1uN_zlY.js","./utils-DyydRFHu-DkAWn-U5.js","./Basemap-BEqqSTw9-COwFtp-h.js","./Scheduler-B7UX7Wr5-BziCzZ_c.js","./LineOfSightLayer-D6sUQaEP-CM4VKqod.js","./featureReferenceUtils-Ct4KY5u7-Cgw_hpcQ.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./boundedPlane-DlvE0eNx-DhJ9Zyo3.js","./lineSegment-CcqvCARM-_ZNy9SM-.js","./LinkChartLayer-KcYDvLxD-YSUnl4xT.js","./MapImageLayer-B_rP0PhA-BMKx3_KE.js","./scaleUtils-DxsfQwK1-B4OFXqEO.js","./SublayersOwner-DfTaMJ5V-DBe6p6TL.js","./sublayerUtils-CyM0QC5B-BQ17aSXL.js","./ExportImageParameters-DxyNGQ57-pIUsifIT.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./MapNotesLayer-DauvjDLM-DfkSCK2i.js","./objectIdUtils-EszJVKSV-Bi133oF_.js","./MediaLayer-DiCs97gD-DwBJPZLQ.js","./perspectiveUtils-Bu88xlbg-DmCqcrzQ.js","./normalizeUtilsSync-CBU7m8rm-zyoavT3m.js","./vec2-tHZ6OaOy-xCj1obDt.js","./imageUtils-BA2D6Uf1-DyozB2y5.js","./OGCFeatureLayer-DPXQjO1S-CmSpZQWR.js","./ogcFeatureUtils-Bs12bZY3-Dzw8-_6l.js","./geojson-CNt_qtQf-utywq02B.js","./date-Cqvy-TgA-DIf-QFLz.js","./sourceUtils-BMeqkJ5g-C2dbTHus.js","./OpenStreetMapLayer-Bx4EhJij-DG5ieN6G.js","./WebTileLayer-CUoicUjK-DGTooIUm.js","./OrientedImageryLayer-CwG5o4Di-DvaUs8z-.js","./PointCloudLayer-CkxImr5P-Cr0Wmw1H.js","./PointCloudUniqueValueRenderer-C-5hwEaR-CdfgO-6L.js","./RouteLayer-BQQ6WxtH-Bt2P8nRf.js","./Stop-he5xSAJJ-2gQ-bcQc.js","./SceneLayer-DOh9PmQy-Dj9ChnIg.js","./Mesh-DLzjDUIO-B17ONcIN.js","./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-Cd6y9wum.js","./deduplicate-D2d-E5Pw-eujRBTUy.js","./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js","./vec3-BazNroeq-Cdhfm-VN.js","./BufferView-PQoE3GL7-M6q1od-Y.js","./vec4-DWDdg1fj-DGtcegeJ.js","./meshSpatialReferenceScaleUtils-B1zR72Os-BsiWm3Am.js","./StreamLayer-Bqnt-d3H-ZHpoIWVk.js","./SubtypeGroupLayer-D1vAbwEU-BGQuWZvd.js","./TileLayer-Be5tWeN5-DkNCDOOT.js","./UnknownLayer-DwWK383_-B9F_y5SB.js","./UnsupportedLayer-CCUtmZ2i-x2JJvhEj.js","./VectorTileLayer-DruyQukp-Dv3Jeiv4.js","./TileKey-C5IL-JBr-COMthbrT.js","./StyleRepository-D3WuVprR-DfGaR0vd.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./enums-qHpGJ28Q-CmnLAccm.js","./GeometryUtils-NHgB9gGQ-B3_wQtO7.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./definitions-DJSdSb77-DkoRHaVx.js","./capabilities-agoTWNzb-CtsNgRyk.js","./VideoLayer-Dxs-NJSn-DBh0bJWU.js","./TelemetryDisplay-Bq2PXfI8-8bnvuClQ.js","./ViewshedLayer-BYX-h7eL-BtdySDnr.js","./VoxelLayer-KL84GttA-BXyDxf1k.js","./WFSLayer-DKnx5V8b-CGzBCYUj.js","./wfsUtils-DoLaqXsj-CcouY8qc.js","./xmlUtils-TLuV3CJ7-Cs2DGP6C.js","./WMSLayer-C8eYRV4V-BmaQhELn.js","./crsUtils-BLe27KvG-VS_BXVdj.js","./ExportWMSImageParameters-CMk80WSM-CQGcVQcn.js","./WMTSLayer-DJY_jjIE-DusHpV4U.js"])))=>i.map(i=>d[i]); +import{f as s,_ as a}from"./main-C7yV2j71.js";async function d(t,e){const{data:_}=await s(t,{responseType:"json",query:{f:"json",...e?.customParameters,token:e?.apiKey}});return _}const v={BingMapsLayer:async()=>(await a(async()=>{const{default:t}=await import("./BingMapsLayer-BigMnKl_-D6t2rOyx.js");return{default:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url)).default,BuildingSceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./BuildingSceneLayer-IIePcdNz-xcftlFLr.js");return{default:t}},__vite__mapDeps([21,1,2,22,23,3,4,5,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,45,13,14,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124]),import.meta.url)).default,CSVLayer:async()=>(await a(async()=>{const{default:t}=await import("./CSVLayer-CJQy-BsL-CVXWwvJs.js");return{default:t}},__vite__mapDeps([125,1,2,45,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,13,14,46,47,48,49,50,51,52,53,5,54,55,56,57,4,58,59,60,61,62,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90,126,127,91]),import.meta.url)).default,CatalogLayer:async()=>(await a(async()=>{const{default:t}=await import("./CatalogLayer-BeO1fLsl-2bzVHku5.js");return{default:t}},__vite__mapDeps([128,1,2,3,4,5,33,129,130,6,7,8,9,10,11,16,13,14,15,77,131,132,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,55,56,57,68,69,70,73,74,88,133,134,135,102,136,137,61,62,138,101,118,107,109,139,140,141,142,143,67,126,127,91,144,145,146,147,148,149,150,60,151,152,63,153,59,64,65,66,20,76,78,79,80,12,81,82,84,83,85,86]),import.meta.url)).default,DimensionLayer:async()=>(await a(async()=>{const{default:t}=await import("./DimensionLayer-DFh7fPYo-CxFJ4hke.js");return{default:t}},__vite__mapDeps([154,1,2,155,156,61,62,3,4,5,20,13,14,15]),import.meta.url)).default,ElevationLayer:async()=>(await a(async()=>{const{default:t}=await import("./ElevationLayer-G6y-P-jo-DB8amMzu.js");return{default:t}},__vite__mapDeps([157,1,2,3,49,4,5,158,18,19,159,160,161,33,65,50,20,13,14,15,78,79,80,61,62,58]),import.meta.url)).default,FeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./FeatureLayer-BrRKw5Si-Rem12G_g.js");return{default:t}},__vite__mapDeps([45,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,13,14,46,47,48,49,50,51,52,53,5,54,55,56,57,4,58,59,60,61,62,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90]),import.meta.url)).default,GeoJSONLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoJSONLayer-BFFwDRph-64SMPh4J.js");return{default:t}},__vite__mapDeps([162,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,4,5,58,126,127,91,63,47,48,6,7,8,9,10,66,68,69,70,53,71,13,14,72,51,52,54,73,74,75,20,76,77,78,79,80,61,62,12,16,81,82,83,85,88]),import.meta.url)).default,GeoRSSLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoRSSLayer-DgF8xnYi-BEBXvG2J.js");return{default:t}},__vite__mapDeps([163,1,2,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16]),import.meta.url)).default,GroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./GroupLayer-ER-XzoYr-B2r6nbwd.js");return{default:t}},__vite__mapDeps([164,1,2,22,23,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,16,165,90,98,166]),import.meta.url)).default,ImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryLayer-B-bJb8lU-DHQsi7TZ.js");return{default:t}},__vite__mapDeps([167,1,2,3,4,5,168,169,58,170,47,48,24,25,26,27,28,29,30,15,31,171,172,38,39,11,40,132,142,63,140,141,143,173,8,9,10,174,41,42,33,13,14,35,36,17,53,145,146,147,148,149,150,60,61,62,153,65,50,6,7,66,20,78,79,80,12,16,81,82,86,88,90]),import.meta.url)).default,ImageryTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryTileLayer-DixyNESc-CLvjCbqI.js");return{default:t}},__vite__mapDeps([175,1,2,3,4,5,65,50,6,7,8,9,10,11,66,168,169,58,170,47,48,24,25,26,27,28,29,30,15,31,171,172,38,39,40,132,142,63,140,141,143,173,174,41,42,33,13,14,18,19,176,177,61,62,178,129,130,179,20,78,79,80,12,16,81,82,160,161,88,90]),import.meta.url)).default,IntegratedMesh3DTilesLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMesh3DTilesLayer-BEcgXCkk-BFGow1HJ.js");return{default:t}},__vite__mapDeps([180,1,2,3,102,11,62,4,5,64,65,50,66,20,13,14,15,78,79,80,61,16,124]),import.meta.url)).default,IntegratedMeshLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMeshLayer-C-XaBbXd-BQWd-pKc.js");return{default:t}},__vite__mapDeps([181,1,2,3,182,75,94,52,183,4,5,64,65,50,66,20,13,14,15,78,79,80,61,62,16,92,93,49,95,96,97,98,99,124]),import.meta.url)).default,KMLLayer:async()=>(await a(async()=>{const{default:t}=await import("./KMLLayer-DwQXpcMB-0SwlR7uL.js");return{default:t}},__vite__mapDeps([184,1,2,22,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,185,32,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,63,47,48]),import.meta.url)).default,KnowledgeGraphLayer:async()=>(await a(async()=>{const{default:t}=await import("./KnowledgeGraphLayer-BjNFJGLf-uaXruRWF.js");return{default:t}},__vite__mapDeps([186,1,2,3,52,4,5,187,61,62,152,149,150,188,189,6,7,8,9,10,11,16,14,15,190,191,53,47,48,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,58,192,193,194,195,196,197,140,141,142,143,198,199,200,201,202,127,203,204,205,23,79,166,131,132,206,130,126,91,85,68,69,70,71,13,72,51,54,73,74,75,76,77,12,81,82,63,88,65,50,66,20,78,80]),import.meta.url)).default,LineOfSightLayer:async()=>(await a(async()=>{const{default:t}=await import("./LineOfSightLayer-D6sUQaEP-CM4VKqod.js");return{default:t}},__vite__mapDeps([207,1,2,155,208,102,11,105,10,39,40,106,107,108,101,109,110,209,210,211,182,75,94,52,183,14,15,61,62,124,3,4,5,20,13]),import.meta.url)).default,LinkChartLayer:async()=>(await a(async()=>{const{default:t}=await import("./LinkChartLayer-KcYDvLxD-YSUnl4xT.js");return{default:t}},__vite__mapDeps([212,1,2,3,4,5,152,149,150,187,61,62,188,189,6,7,8,9,10,11,16,14,15,190,191,53,47,48,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,58,192,193,194,195,196,197,140,141,142,143,198,199,200,201,202,127,203,204,205,23,79,166,131,132,206,130,126,91,85,68,69,70,71,13,72,51,52,54,73,74,75,76,77,12,81,82,63,88,20]),import.meta.url)).default,MapImageLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapImageLayer-B_rP0PhA-BMKx3_KE.js");return{default:t}},__vite__mapDeps([213,1,2,23,3,214,4,5,64,215,34,50,13,14,15,80,61,62,22,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,11,40,41,42,43,44,144,137,53,47,48,142,145,146,140,141,143,147,148,149,150,60,151,152,63,153,51,52,54,84,83,73,74,55,56,57,88,216,65,6,7,8,9,10,66,20,78,79,12,16,81,82,217,218,17,86]),import.meta.url)).default,MapNotesLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapNotesLayer-DauvjDLM-DfkSCK2i.js");return{default:t}},__vite__mapDeps([219,1,2,3,61,62,140,141,142,143,45,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,13,14,46,47,48,49,50,51,52,53,5,54,55,56,57,4,58,59,60,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90,188,189,220]),import.meta.url)).default,MediaLayer:async()=>(await a(async()=>{const{default:t}=await import("./MediaLayer-DiCs97gD-DwBJPZLQ.js");return{default:t}},__vite__mapDeps([221,1,2,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,16,222,223,141,106,107,224,102,110,225,52,183,193,194,195,90]),import.meta.url)).default,OGCFeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./OGCFeatureLayer-DPXQjO1S-CmSpZQWR.js");return{default:t}},__vite__mapDeps([226,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,4,5,227,152,149,150,228,229,126,127,91,230,48,63,47,64,6,7,8,9,10,66,68,69,70,53,71,13,14,72,51,52,54,73,74,75,20,76,77,78,79,80,61,62,12,16,81,82,84,83,85,88]),import.meta.url)).default,OpenStreetMapLayer:async()=>(await a(async()=>{const{default:t}=await import("./OpenStreetMapLayer-Bx4EhJij-DG5ieN6G.js");return{default:t}},__vite__mapDeps([231,1,2,232,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,17,18,19]),import.meta.url)).default,OrientedImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./OrientedImageryLayer-CwG5o4Di-DvaUs8z-.js");return{default:t}},__vite__mapDeps([233,1,2,45,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,13,14,46,47,48,49,50,51,52,53,5,54,55,56,57,4,58,59,60,61,62,63,64,65,6,7,8,9,10,66,67,68,69,70,71,72,73,74,75,20,76,77,78,79,80,12,16,81,82,83,84,85,86,87,88,89,90]),import.meta.url)).default,PointCloudLayer:async()=>(await a(async()=>{const{default:t}=await import("./PointCloudLayer-CkxImr5P-Cr0Wmw1H.js");return{default:t}},__vite__mapDeps([234,1,2,3,4,5,64,65,50,66,20,13,14,15,78,79,80,61,62,16,92,93,94,49,95,96,52,97,98,47,48,85,35,36,235,25,124,88]),import.meta.url)).default,RouteLayer:async()=>(await a(async()=>{const{default:t}=await import("./RouteLayer-BQQ6WxtH-Bt2P8nRf.js");return{default:t}},__vite__mapDeps([236,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,93,94,61,62,4,5,6,7,8,9,10,20,13,14,78,79,80,16,50,142,237,140,141,143,63,47,48]),import.meta.url)).default,SceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./SceneLayer-DOh9PmQy-Dj9ChnIg.js");return{default:t}},__vite__mapDeps([238,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,239,138,10,101,118,107,109,102,225,240,134,135,241,242,108,110,243,104,61,62,244,106,119,120,245,246,224,247,136,137,4,5,248,64,65,50,66,67,52,20,13,14,78,79,80,16,92,93,94,49,95,96,97,98,81,82,123,91,51,47,48,53,54,72,85,99,73,74,55,182,75,183,87,124,88,100,103,105,111,112,113,114,115,116,117,121,122]),import.meta.url)).default,StreamLayer:async()=>(await a(async()=>{const{default:t}=await import("./StreamLayer-Bqnt-d3H-ZHpoIWVk.js");return{default:t}},__vite__mapDeps([249,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,4,5,65,50,6,7,8,9,10,66,68,69,70,53,47,48,71,13,14,72,51,52,54,73,74,75,20,78,79,80,61,62,12,16,81,82,85,87,88,90]),import.meta.url)).default,SubtypeGroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./SubtypeGroupLayer-D1vAbwEU-BGQuWZvd.js");return{default:t}},__vite__mapDeps([250,1,2,23,3,4,5,64,65,50,6,7,8,9,10,11,66,67,52,46,47,48,13,14,15,49,51,53,32,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,54,55,56,57,20,78,79,80,61,62,12,16,81,82,85,174,173,83,73,74,88,86,90]),import.meta.url)).default,TileLayer:async()=>(await a(async()=>{const{default:t}=await import("./TileLayer-Be5tWeN5-DkNCDOOT.js");return{default:t}},__vite__mapDeps([251,1,2,23,3,4,5,64,158,18,19,159,160,161,33,215,34,50,13,14,15,80,61,62,22,24,25,26,27,28,29,30,31,32,35,36,37,38,39,11,40,41,42,43,44,144,137,53,47,48,142,145,146,140,141,143,147,148,149,150,60,151,152,63,153,51,52,54,84,83,73,74,55,56,57,88,216,65,6,7,8,9,10,66,20,78,79,12,16,17]),import.meta.url)).default,UnknownLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnknownLayer-DwWK383_-B9F_y5SB.js");return{default:t}},__vite__mapDeps([252,1,2,3,4,5,78,79,80,61,62]),import.meta.url)).default,UnsupportedLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnsupportedLayer-CCUtmZ2i-x2JJvhEj.js");return{default:t}},__vite__mapDeps([253,1,2,3,4,5,78,79,80,61,62]),import.meta.url)).default,VectorTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./VectorTileLayer-DruyQukp-Dv3Jeiv4.js");return{default:t}},__vite__mapDeps([254,1,2,3,4,5,64,158,18,19,159,160,161,33,65,50,6,7,8,9,10,11,66,20,13,14,15,78,79,80,61,62,12,16,255,95,256,257,42,258,259,260,261,38,39,40,262,263,264]),import.meta.url)).default,VideoLayer:async()=>(await a(async()=>{const{default:t}=await import("./VideoLayer-Dxs-NJSn-DBh0bJWU.js");return{default:t}},__vite__mapDeps([265,1,2,3,4,5,6,7,8,9,10,11,66,16,50,13,14,15,57,266,107,106,102,119,62,172]),import.meta.url)).default,ViewshedLayer:async()=>(await a(async()=>{const{default:t}=await import("./ViewshedLayer-BYX-h7eL-BtdySDnr.js");return{default:t}},__vite__mapDeps([267,1,2,208,102,11,105,10,39,40,106,107,108,101,109,110,209,210,211,156,155,61,62,3,4,5,20,13,14,15]),import.meta.url)).default,VoxelLayer:async()=>(await a(async()=>{const{default:t}=await import("./VoxelLayer-KL84GttA-BXyDxf1k.js");return{default:t}},__vite__mapDeps([268,1,2,3,102,11,4,5,64,65,50,66,20,13,14,15,78,79,80,61,62,16,92,93,94,49,95,96,52,97,98,47,48,35,36,82,156,182,75,183,118,107,109,39,88]),import.meta.url)).default,WFSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WFSLayer-DKnx5V8b-CGzBCYUj.js");return{default:t}},__vite__mapDeps([269,1,2,24,25,26,27,28,29,30,15,31,32,33,34,35,36,37,38,39,11,40,41,42,43,44,3,4,5,58,126,127,91,270,61,62,228,229,149,271,50,47,48,63,6,7,8,9,10,66,68,69,70,53,71,13,14,72,51,52,54,73,74,75,20,76,77,78,79,80,12,16,81,82,85,88]),import.meta.url)).default,WMSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMSLayer-C8eYRV4V-BmaQhELn.js");return{default:t}},__vite__mapDeps([272,1,2,22,3,214,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,81,82,273,50,274,17]),import.meta.url)).default,WMTSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMTSLayer-DJY_jjIE-DusHpV4U.js");return{default:t}},__vite__mapDeps([275,1,2,3,4,5,232,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,17,18,19,159,273,271]),import.meta.url)).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-CUoicUjK-DGTooIUm.js"),__vite__mapDeps([232,1,2,3,4,5,6,7,8,9,10,11,20,13,14,15,78,79,80,61,62,12,16,17,18,19]),import.meta.url).then(t=>t.W)).default},y=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function E(t,e){const{loadContext:_,...r}=e||{},u=_?await _.fetchServiceMetadata(t,r):await d(t,r);f(u),o(u);const l={serviceJSON:u};if((u.currentVersion??0)<10.5)return l;const n=`${t}/layers`,i=_?await _.fetchServiceMetadata(n,r):await d(n,r);return f(i),o(i),l.layersJSON={layers:i.layers,tables:i.tables},l}function c(t){const{type:e}=t;return!!e&&y.has(e)}function m(t){return t.type==="Table"}function o(t){t.layers=t.layers?.filter(c),t.tables=t.tables?.filter(m)}function p(t){t.type||="Feature Layer"}function L(t){t.type||="Table"}function f(t){t.layers?.forEach(p),t.tables?.forEach(L)}function O(t){switch(t){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}export{E as d,O as g,d as o,v as p}; diff --git a/main/assets/fieldProperties-Bq26w7gt-DT6oRGMS.js b/main/assets/fieldProperties-Bq26w7gt-DT6oRGMS.js deleted file mode 100644 index 4b38b9669..000000000 --- a/main/assets/fieldProperties-Bq26w7gt-DT6oRGMS.js +++ /dev/null @@ -1 +0,0 @@ -import{K as n,a1 as r,eQ as l}from"./main-BZaw9FpY.js";import{y as o}from"./Field-C6hA1tZj-CbELM0zp.js";import{o as d}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";function g(){return{fields:{type:[o],value:null,set:function(e){if(e&&n("big-integer-warning-enabled")){const i=e.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(i.length){const t=i.map(s=>`'${s.name}'`).join(", ");r.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return d.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)this.fieldsIndex?.has(i)||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return l(this.fieldsIndex,e)}}}}export{g as f}; diff --git a/main/assets/fieldProperties-Bq26w7gt-DgCDIFFS.js b/main/assets/fieldProperties-Bq26w7gt-DgCDIFFS.js new file mode 100644 index 000000000..c99919156 --- /dev/null +++ b/main/assets/fieldProperties-Bq26w7gt-DgCDIFFS.js @@ -0,0 +1 @@ +import{K as n,a1 as r,eQ as l}from"./main-C7yV2j71.js";import{y as o}from"./Field-C6hA1tZj-C0Sp7XvY.js";import{o as d}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";function g(){return{fields:{type:[o],value:null,set:function(e){if(e&&n("big-integer-warning-enabled")){const i=e.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(i.length){const t=i.map(s=>`'${s.name}'`).join(", ");r.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return d.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)this.fieldsIndex?.has(i)||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return l(this.fieldsIndex,e)}}}}export{g as f}; diff --git a/main/assets/fieldType-CD2CL2hr-B1iISniv.js b/main/assets/fieldType-CD2CL2hr-B1iISniv.js new file mode 100644 index 000000000..4135a63fa --- /dev/null +++ b/main/assets/fieldType-CD2CL2hr-B1iISniv.js @@ -0,0 +1 @@ +import{aK as e}from"./main-C7yV2j71.js";const l=new e({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});export{l as i}; diff --git a/main/assets/fieldType-CD2CL2hr-BAgRuESI.js b/main/assets/fieldType-CD2CL2hr-BAgRuESI.js deleted file mode 100644 index 27c15fe9c..000000000 --- a/main/assets/fieldType-CD2CL2hr-BAgRuESI.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as e}from"./main-BZaw9FpY.js";const l=new e({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});export{l as i}; diff --git a/main/assets/floatRGBA-4pIJN00G-ClP9XgP7.js b/main/assets/floatRGBA-4pIJN00G-ClP9XgP7.js new file mode 100644 index 000000000..079d2a194 --- /dev/null +++ b/main/assets/floatRGBA-4pIJN00G-ClP9XgP7.js @@ -0,0 +1 @@ +import{ae as f}from"./main-C7yV2j71.js";function m(t,e,n=0){const r=f(t,0,i);for(let o=0;o<4;o++)e[n+o]=Math.floor(256*u(r*l[o]))}function a(t,e=0){let n=0;for(let r=0;r<4;r++)n+=t[e+r]*c[r];return n}const l=[1,256,65536,16777216],c=[1/256,1/65536,1/16777216,1/4294967296],i=a(new Uint8ClampedArray([255,255,255,255]));function u(t){return t-Math.floor(t)}export{a as f,m as l}; diff --git a/main/assets/floatRGBA-4pIJN00G-DwTr03sX.js b/main/assets/floatRGBA-4pIJN00G-DwTr03sX.js deleted file mode 100644 index dc01a9632..000000000 --- a/main/assets/floatRGBA-4pIJN00G-DwTr03sX.js +++ /dev/null @@ -1 +0,0 @@ -import{ae as f}from"./main-BZaw9FpY.js";function m(t,e,n=0){const r=f(t,0,i);for(let o=0;o<4;o++)e[n+o]=Math.floor(256*u(r*l[o]))}function a(t,e=0){let n=0;for(let r=0;r<4;r++)n+=t[e+r]*c[r];return n}const l=[1,256,65536,16777216],c=[1/256,1/65536,1/16777216,1/4294967296],i=a(new Uint8ClampedArray([255,255,255,255]));function u(t){return t-Math.floor(t)}export{a as f,m as l}; diff --git a/main/assets/floating-ui-DKFFlLv3-B6atYKJb.js b/main/assets/floating-ui-DKFFlLv3-B6atYKJb.js new file mode 100644 index 000000000..8bcaa6dd5 --- /dev/null +++ b/main/assets/floating-ui-DKFFlLv3-B6atYKJb.js @@ -0,0 +1 @@ +import{h as xt,c as Ht}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{p as Xt}from"./dom-N58V0tYi-DBU3jlah.js";import{l as Gt}from"./debounce-27Hmkkyg-Th7bw3mg.js";const Ft=["top","right","bottom","left"],vt=["start","end"],bt=Ft.reduce((t,e)=>t.concat(e,e+"-"+vt[0],e+"-"+vt[1]),[]),U=Math.min,j=Math.max,et=Math.round,tt=Math.floor,V=t=>({x:t,y:t}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Qt={start:"end",end:"start"};function pt(t,e,n){return j(t,U(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function F(t){return t.split("-")[1]}function Wt(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function lt(t){return["top","bottom"].includes(B(t))?"y":"x"}function ht(t){return Wt(lt(t))}function Mt(t,e,n){n===void 0&&(n=!1);const o=F(t),i=ht(t),l=gt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(r=ot(r)),[r,ot(r)]}function Zt(t){const e=ot(t);return[nt(t),e,nt(e)]}function nt(t){return t.replace(/start|end/g,e=>Qt[e])}function Jt(t,e,n){const o=["left","right"],i=["right","left"],l=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?l:r;default:return[]}}function te(t,e,n,o){const i=F(t);let l=Jt(B(t),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),e&&(l=l.concat(l.map(nt)))),l}function ot(t){return t.replace(/left|right|bottom|top/g,e=>Kt[e])}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function it(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:i}=t;const l=lt(e),r=ht(e),a=gt(r),c=B(e),s=l==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(F(e)){case"start":f[r]-=h*(n&&s?-1:1);break;case"end":f[r]+=h*(n&&s?-1:1);break}return f}const ne=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:r}=n,a=l.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let s=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Et(s,o,c),h=o,f={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:l,platform:r,elements:a,middlewareData:c}=e,{element:s,padding:u=0}=_(t,e)||{};if(s==null)return{};const d=Bt(u),h={x:n,y:o},f=ht(i),p=gt(f),m=await r.getDimensions(s),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=l.reference[p]+l.reference[f]-h[f]-l.floating[p],b=h[f]-l.reference[f],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s));let R=T?T[x]:0;(!R||!await(r.isElement==null?void 0:r.isElement(T)))&&(R=a.floating[x]||l.floating[p]);const A=v/2-b/2,E=R/2-m[p]/2-1,O=U(d[g],E),z=U(d[w],E),L=O,G=R-m[p]-z,P=R/2-m[p]/2+A,C=pt(L,P,G),H=!c.arrow&&F(i)!=null&&P!==C&&l.reference[p]/2-(PF(o)===t),...n.filter(o=>F(o)!==t)]:n.filter(o=>B(o)===o)).filter(o=>t?F(o)===t||(e?nt(o)!==o:!1):!0)}const re=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:l,middlewareData:r,placement:a,platform:c,elements:s}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:h=bt,autoAlignment:f=!0,...p}=_(t,e),m=d!==void 0||h===bt?ie(d||null,f,h):h,y=await K(e,p),g=((n=r.autoPlacement)==null?void 0:n.index)||0,w=m[g];if(w==null)return{};const x=Mt(w,l,await(c.isRTL==null?void 0:c.isRTL(s.floating)));if(a!==w)return{reset:{placement:m[0]}};const v=[y[B(w)],y[x[0]],y[x[1]]],b=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:w,overflows:v}],T=m[g+1];if(T)return{data:{index:g+1,overflows:b},reset:{placement:T}};const R=b.map(E=>{const O=F(E.placement);return[E.placement,O&&u?E.overflows.slice(0,2).reduce((z,L)=>z+L,0):E.overflows[0],E.overflows]}).sort((E,O)=>E[1]-O[1]),A=((i=R.filter(E=>E[2].slice(0,F(E[0])?2:3).every(O=>O<=0))[0])==null?void 0:i[0])||R[0][0];return A!==a?{data:{index:g+1,overflows:b},reset:{placement:A}}:{}}}},le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:l,rects:r,initialPlacement:a,platform:c,elements:s}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=_(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const g=B(i),w=B(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(s.floating)),v=h||(w||!m?[ot(a)]:Zt(a));!h&&p!=="none"&&v.push(...te(a,m,p,x));const b=[a,...v],T=await K(e,y),R=[];let A=((o=l.flip)==null?void 0:o.overflows)||[];if(u&&R.push(T[g]),d){const L=Mt(i,r,x);R.push(T[L[0]],T[L[1]])}if(A=[...A,{placement:i,overflows:R}],!R.every(L=>L<=0)){var E,O;const L=(((E=l.flip)==null?void 0:E.index)||0)+1,G=b[L];if(G)return{data:{index:L,overflows:A},reset:{placement:G}};let P=(O=A.filter(C=>C.overflows[0]<=0).sort((C,H)=>C.overflows[1]-H.overflows[1])[0])==null?void 0:O.placement;if(!P)switch(f){case"bestFit":{var z;const C=(z=A.map(H=>[H.placement,H.overflows.filter(M=>M>0).reduce((M,Yt)=>M+Yt,0)]).sort((H,M)=>H[1]-M[1])[0])==null?void 0:z[0];C&&(P=C);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Rt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Tt(t){return Ft.some(e=>t[e]>=0)}const ae=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=_(t,e);switch(o){case"referenceHidden":{const l=await K(e,{...i,elementContext:"reference"}),r=Rt(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Tt(r)}}}case"escaped":{const l=await K(e,{...i,altBoundary:!0}),r=Rt(l,n.floating);return{data:{escapedOffsets:r,escaped:Tt(r)}}}default:return{}}}}};async function ce(t,e){const{placement:n,platform:o,elements:i}=t,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=B(n),a=F(n),c=lt(n)==="y",s=["left","top"].includes(r)?-1:1,u=l&&c?-1:1,d=_(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:h*s}:{x:h*s,y:f*u}}const se=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:l,placement:r,middlewareData:a}=e,c=await ce(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:l+c.y,data:{...c,placement:r}}}}},fe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:y=>{let{x:g,y:w}=y;return{x:g,y:w}}},...c}=_(t,e),s={x:n,y:o},u=await K(e,c),d=lt(B(i)),h=Wt(d);let f=s[h],p=s[d];if(l){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=f+u[y],x=f-u[g];f=pt(w,f,x)}if(r){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",w=p+u[y],x=p-u[g];p=pt(w,p,x)}const m=a.fn({...e,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function at(){return typeof window<"u"}function X(t){return Nt(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Nt(t){return at()?t instanceof Node||t instanceof D(t).Node:!1}function S(t){return at()?t instanceof Element||t instanceof D(t).Element:!1}function W(t){return at()?t instanceof HTMLElement||t instanceof D(t).HTMLElement:!1}function Lt(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof D(t).ShadowRoot}function J(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function ue(t){return["table","td","th"].includes(X(t))}function ct(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function st(t){const e=yt(),n=S(t)?k(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function de(t){let e=$(t);for(;W(e)&&!Y(e);){if(st(e))return e;if(ct(e))return null;e=$(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Y(t){return["html","body","#document"].includes(X(t))}function k(t){return D(t).getComputedStyle(t)}function ft(t){return S(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||N(t);return Lt(e)?e.host:e}function Vt(t){const e=$(t);return Y(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&J(e)?e:Vt(e)}function Q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Vt(t),l=i===((o=t.ownerDocument)==null?void 0:o.body),r=D(i);if(l){const a=pe(r);return e.concat(r,r.visualViewport||[],J(i)?i:[],a&&n?Q(a):[])}return e.concat(i,Q(i,[],n))}function pe(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function $t(t){const e=k(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=W(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=et(n)!==l||et(o)!==r;return a&&(n=l,o=r),{width:n,height:o,$:a}}function wt(t){return S(t)?t:t.contextElement}function q(t){const e=wt(t);if(!W(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=$t(e);let r=(l?et(n.width):n.width)/o,a=(l?et(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const me=V(0);function zt(t){const e=D(t);return!yt()||!e.visualViewport?me:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==D(t)?!1:e}function I(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=wt(t);let r=V(1);e&&(o?S(o)&&(r=q(o)):r=q(t));const a=ge(l,n,o)?zt(l):V(0);let c=(i.left+a.x)/r.x,s=(i.top+a.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(l){const h=D(l),f=o&&S(o)?D(o):o;let p=h,m=p.frameElement;for(;m&&o&&f!==p;){const y=q(m),g=m.getBoundingClientRect(),w=k(m),x=g.left+(m.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(m.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,s*=y.y,u*=y.x,d*=y.y,c+=x,s+=v,p=D(m),m=p.frameElement}}return it({width:u,height:d,x:c,y:s})}function he(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l=i==="fixed",r=N(o),a=e?ct(e.floating):!1;if(o===r||a&&l)return n;let c={scrollLeft:0,scrollTop:0},s=V(1);const u=V(0),d=W(o);if((d||!d&&!l)&&((X(o)!=="body"||J(r))&&(c=ft(o)),W(o))){const h=I(o);s=q(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+u.x,y:n.y*s.y-c.scrollTop*s.y+u.y}}function ye(t){return Array.from(t.getClientRects())}function jt(t){return I(N(t)).left+ft(t).scrollLeft}function we(t){const e=N(t),n=ft(t),o=t.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+jt(t);const a=-n.scrollTop;return k(o).direction==="rtl"&&(r+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}function xe(t,e){const n=D(t),o=N(t),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){l=i.width,r=i.height;const s=yt();(!s||s&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:l,height:r,x:a,y:c}}function ve(t,e){const n=I(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=W(t)?q(t):V(1),r=t.clientWidth*l.x,a=t.clientHeight*l.y,c=i*l.x,s=o*l.y;return{width:r,height:a,x:c,y:s}}function Pt(t,e,n){let o;if(e==="viewport")o=xe(t,n);else if(e==="document")o=we(N(t));else if(S(e))o=ve(e,n);else{const i=zt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return it(o)}function It(t,e){const n=$(t);return n===e||!S(n)||Y(n)?!1:k(n).position==="fixed"||It(n,e)}function be(t,e){const n=e.get(t);if(n)return n;let o=Q(t,[],!1).filter(a=>S(a)&&X(a)!=="body"),i=null;const l=k(t).position==="fixed";let r=l?$(t):t;for(;S(r)&&!Y(r);){const a=k(r),c=st(r);!c&&a.position==="fixed"&&(i=null),(l?!c&&!i:!c&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||J(r)&&!c&&It(t,r))?o=o.filter(s=>s!==r):i=a,r=$(r)}return e.set(t,o),o}function Ee(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?ct(e)?[]:be(e,this._c):[].concat(n),o],r=l[0],a=l.reduce((c,s)=>{const u=Pt(e,s,i);return c.top=j(u.top,c.top),c.right=U(u.right,c.right),c.bottom=U(u.bottom,c.bottom),c.left=j(u.left,c.left),c},Pt(e,r,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){const{width:e,height:n}=$t(t);return{width:e,height:n}}function Te(t,e,n){const o=W(e),i=N(e),l=n==="fixed",r=I(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const c=V(0);if(o||!o&&!l)if((X(e)!=="body"||J(i))&&(a=ft(e)),o){const d=I(e,!0,l,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else i&&(c.x=jt(i));const s=r.left+a.scrollLeft-c.x,u=r.top+a.scrollTop-c.y;return{x:s,y:u,width:r.width,height:r.height}}function ut(t){return k(t).position==="static"}function Dt(t,e){return!W(t)||k(t).position==="fixed"?null:e?e(t):t.offsetParent}function _t(t,e){const n=D(t);if(ct(t))return n;if(!W(t)){let i=$(t);for(;i&&!Y(i);){if(S(i)&&!ut(i))return i;i=$(i)}return n}let o=Dt(t,e);for(;o&&ue(o)&&ut(o);)o=Dt(o,e);return o&&Y(o)&&ut(o)&&!st(o)?n:o||de(t)||n}const Le=async function(t){const e=this.getOffsetParent||_t,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pe(t){return k(t).direction==="rtl"}const mt={convertOffsetParentRelativeRectToViewportRelativeRect:he,getDocumentElement:N,getClippingRect:Ee,getOffsetParent:_t,getElementRects:Le,getClientRects:ye,getDimensions:Re,getScale:q,isElement:S,isRTL:Pe};function De(t,e){let n=null,o;const i=N(t);function l(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),l();const{left:s,top:u,width:d,height:h}=t.getBoundingClientRect();if(a||e(),!d||!h)return;const f=tt(u),p=tt(i.clientWidth-(s+d)),m=tt(i.clientHeight-(u+h)),y=tt(s),g={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:j(0,U(1,c))||1};let w=!0;function x(v){const b=v[0].intersectionRatio;if(b!==c){if(!w)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,g)}n.observe(t)}return r(!0),l}function Ae(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,s=wt(t),u=i||l?[...s?Q(s):[],...Q(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),l&&g.addEventListener("resize",n)});const d=s&&a?De(s,n):null;let h=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===s&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),s&&!c&&f.observe(s),f.observe(e));let p,m=c?I(t):null;c&&y();function y(){const g=I(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,p=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),l&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const Oe=se,Se=re,ke=fe,At=le,Ce=ae,He=oe,Fe=(t,e,n)=>{const o=new Map,i={platform:mt,...n},l={...i.platform,_c:o};return ne(t,e,{...i,platform:l})};function We(t){return Me(t)}function dt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Me(t){for(let e=t;e;e=dt(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=dt(t);e;e=dt(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||st(n)||e.tagName==="BODY"))return e}return null}(function(){if(Ht()){const t=mt.getOffsetParent;mt.getOffsetParent=e=>t(e,We)}})();function Ot(t){const e=window.devicePixelRatio||1;return Math.round(t*e)/e}const qt=async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:l,flipPlacements:r,offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})=>{if(!e||!n)return null;const d=Xt(n)==="rtl",{x:h,y:f,placement:p,strategy:m,middlewareData:y}=await Fe(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:kt(i,d),middleware:Ne({placement:i,flipDisabled:l,flipPlacements:r?.map(v=>kt(v,d)),offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})});if(s&&y.arrow){const{x:v,y:b}=y.arrow,T=p.split("-")[0],R=v!=null?"left":"top",A=$e[T],E={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=T==="left"||T==="right"?"horizontal":"vertical"),Object.assign(s.style,{...E,[R]:`${R=="left"?v:b}px`,[T]:"100%",transform:A})}const g=y.hide?.referenceHidden?"hidden":null,w=g?"none":null;n.setAttribute(Be,p);const{open:x}=t;Object.assign(n.style,{visibility:g,pointerEvents:w,position:m,transform:x?`translate(${Ot(h)}px,${Ot(f)}px)`:"",top:0,left:0})},Be="data-placement",St=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],qe="bottom-start",Ue="bottom-end",Ye={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active",arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"};function Ne({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:l,type:r}){const a=[ke(),Ce()];if(r==="menu")return[...a,At({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(r==="popover"||r==="tooltip"){const c=[...a,Oe({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Se({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(At(n?{fallbackPlacements:n}:{})),l&&c.push(He({element:l})),c}return[]}function Xe(t,e){const n=t.filter(o=>St.includes(o));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${St.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function kt(t,e=!1){const n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Ge(t,e,n=!1){if(!(!t.open||!e.floatingEl||!e.referenceEl)){if(!Z.get(t))return Ut(t,e.referenceEl,e.floatingEl);await(n?Ve(t):qt)(t,e)}}function Ve(t){let e=rt.get(t);return e||(e=Gt(qt,xt.reposition,{leading:!0,maxWait:xt.reposition}),rt.set(t,e),e)}const $e={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},Z=new WeakMap,rt=new WeakMap;async function Ut(t,e,n){if(!n.isConnected)return;const o=Ht()?Ae:(r,a,c)=>(c(),()=>{});Z.set(t,{state:"pending"});let i;const l=o(e,n,()=>{const r=t.reposition();i||(i=r)});return Z.set(t,{state:"active",cleanUp:l}),i}async function Ke(t,e,n){if(!(!n||!e)&&(ze(t,e,n),Object.assign(n.style,{visibility:"hidden",pointerEvents:"none",position:t.overlayPositioning}),!!t.open))return Ut(t,e,n)}function ze(t,e,n){if(!n||!e)return;const o=Z.get(t);o?.state==="active"&&o.cleanUp(),Z.delete(t),rt.get(t)?.cancel(),rt.delete(t)}const Ct=4,Qe=Math.ceil(Math.hypot(Ct,Ct));export{Ue as $,Xe as I,Ke as U,qe as V,Qe as X,Ge as _,Ye as j,ze as q}; diff --git a/main/assets/floating-ui-DKFFlLv3-DZ3_fUHw.js b/main/assets/floating-ui-DKFFlLv3-DZ3_fUHw.js deleted file mode 100644 index cfb31c9d7..000000000 --- a/main/assets/floating-ui-DKFFlLv3-DZ3_fUHw.js +++ /dev/null @@ -1 +0,0 @@ -import{h as xt,c as Ht}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{p as Xt}from"./dom-N58V0tYi-DBU3jlah.js";import{l as Gt}from"./debounce-27Hmkkyg-Th7bw3mg.js";const Ft=["top","right","bottom","left"],vt=["start","end"],bt=Ft.reduce((t,e)=>t.concat(e,e+"-"+vt[0],e+"-"+vt[1]),[]),U=Math.min,j=Math.max,et=Math.round,tt=Math.floor,V=t=>({x:t,y:t}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Qt={start:"end",end:"start"};function pt(t,e,n){return j(t,U(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function F(t){return t.split("-")[1]}function Wt(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function lt(t){return["top","bottom"].includes(B(t))?"y":"x"}function ht(t){return Wt(lt(t))}function Mt(t,e,n){n===void 0&&(n=!1);const o=F(t),i=ht(t),l=gt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(r=ot(r)),[r,ot(r)]}function Zt(t){const e=ot(t);return[nt(t),e,nt(e)]}function nt(t){return t.replace(/start|end/g,e=>Qt[e])}function Jt(t,e,n){const o=["left","right"],i=["right","left"],l=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?l:r;default:return[]}}function te(t,e,n,o){const i=F(t);let l=Jt(B(t),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),e&&(l=l.concat(l.map(nt)))),l}function ot(t){return t.replace(/left|right|bottom|top/g,e=>Kt[e])}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function it(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:i}=t;const l=lt(e),r=ht(e),a=gt(r),c=B(e),s=l==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(F(e)){case"start":f[r]-=h*(n&&s?-1:1);break;case"end":f[r]+=h*(n&&s?-1:1);break}return f}const ne=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:r}=n,a=l.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let s=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Et(s,o,c),h=o,f={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:l,platform:r,elements:a,middlewareData:c}=e,{element:s,padding:u=0}=_(t,e)||{};if(s==null)return{};const d=Bt(u),h={x:n,y:o},f=ht(i),p=gt(f),m=await r.getDimensions(s),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=l.reference[p]+l.reference[f]-h[f]-l.floating[p],b=h[f]-l.reference[f],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s));let R=T?T[x]:0;(!R||!await(r.isElement==null?void 0:r.isElement(T)))&&(R=a.floating[x]||l.floating[p]);const A=v/2-b/2,E=R/2-m[p]/2-1,O=U(d[g],E),z=U(d[w],E),L=O,G=R-m[p]-z,P=R/2-m[p]/2+A,C=pt(L,P,G),H=!c.arrow&&F(i)!=null&&P!==C&&l.reference[p]/2-(PF(o)===t),...n.filter(o=>F(o)!==t)]:n.filter(o=>B(o)===o)).filter(o=>t?F(o)===t||(e?nt(o)!==o:!1):!0)}const re=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:l,middlewareData:r,placement:a,platform:c,elements:s}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:h=bt,autoAlignment:f=!0,...p}=_(t,e),m=d!==void 0||h===bt?ie(d||null,f,h):h,y=await K(e,p),g=((n=r.autoPlacement)==null?void 0:n.index)||0,w=m[g];if(w==null)return{};const x=Mt(w,l,await(c.isRTL==null?void 0:c.isRTL(s.floating)));if(a!==w)return{reset:{placement:m[0]}};const v=[y[B(w)],y[x[0]],y[x[1]]],b=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:w,overflows:v}],T=m[g+1];if(T)return{data:{index:g+1,overflows:b},reset:{placement:T}};const R=b.map(E=>{const O=F(E.placement);return[E.placement,O&&u?E.overflows.slice(0,2).reduce((z,L)=>z+L,0):E.overflows[0],E.overflows]}).sort((E,O)=>E[1]-O[1]),A=((i=R.filter(E=>E[2].slice(0,F(E[0])?2:3).every(O=>O<=0))[0])==null?void 0:i[0])||R[0][0];return A!==a?{data:{index:g+1,overflows:b},reset:{placement:A}}:{}}}},le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:l,rects:r,initialPlacement:a,platform:c,elements:s}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=_(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const g=B(i),w=B(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(s.floating)),v=h||(w||!m?[ot(a)]:Zt(a));!h&&p!=="none"&&v.push(...te(a,m,p,x));const b=[a,...v],T=await K(e,y),R=[];let A=((o=l.flip)==null?void 0:o.overflows)||[];if(u&&R.push(T[g]),d){const L=Mt(i,r,x);R.push(T[L[0]],T[L[1]])}if(A=[...A,{placement:i,overflows:R}],!R.every(L=>L<=0)){var E,O;const L=(((E=l.flip)==null?void 0:E.index)||0)+1,G=b[L];if(G)return{data:{index:L,overflows:A},reset:{placement:G}};let P=(O=A.filter(C=>C.overflows[0]<=0).sort((C,H)=>C.overflows[1]-H.overflows[1])[0])==null?void 0:O.placement;if(!P)switch(f){case"bestFit":{var z;const C=(z=A.map(H=>[H.placement,H.overflows.filter(M=>M>0).reduce((M,Yt)=>M+Yt,0)]).sort((H,M)=>H[1]-M[1])[0])==null?void 0:z[0];C&&(P=C);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Rt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Tt(t){return Ft.some(e=>t[e]>=0)}const ae=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=_(t,e);switch(o){case"referenceHidden":{const l=await K(e,{...i,elementContext:"reference"}),r=Rt(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Tt(r)}}}case"escaped":{const l=await K(e,{...i,altBoundary:!0}),r=Rt(l,n.floating);return{data:{escapedOffsets:r,escaped:Tt(r)}}}default:return{}}}}};async function ce(t,e){const{placement:n,platform:o,elements:i}=t,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=B(n),a=F(n),c=lt(n)==="y",s=["left","top"].includes(r)?-1:1,u=l&&c?-1:1,d=_(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:h*s}:{x:h*s,y:f*u}}const se=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:l,placement:r,middlewareData:a}=e,c=await ce(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:l+c.y,data:{...c,placement:r}}}}},fe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:y=>{let{x:g,y:w}=y;return{x:g,y:w}}},...c}=_(t,e),s={x:n,y:o},u=await K(e,c),d=lt(B(i)),h=Wt(d);let f=s[h],p=s[d];if(l){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=f+u[y],x=f-u[g];f=pt(w,f,x)}if(r){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",w=p+u[y],x=p-u[g];p=pt(w,p,x)}const m=a.fn({...e,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function at(){return typeof window<"u"}function X(t){return Nt(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Nt(t){return at()?t instanceof Node||t instanceof D(t).Node:!1}function S(t){return at()?t instanceof Element||t instanceof D(t).Element:!1}function W(t){return at()?t instanceof HTMLElement||t instanceof D(t).HTMLElement:!1}function Lt(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof D(t).ShadowRoot}function J(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function ue(t){return["table","td","th"].includes(X(t))}function ct(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function st(t){const e=yt(),n=S(t)?k(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function de(t){let e=$(t);for(;W(e)&&!Y(e);){if(st(e))return e;if(ct(e))return null;e=$(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Y(t){return["html","body","#document"].includes(X(t))}function k(t){return D(t).getComputedStyle(t)}function ft(t){return S(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||N(t);return Lt(e)?e.host:e}function Vt(t){const e=$(t);return Y(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&J(e)?e:Vt(e)}function Q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Vt(t),l=i===((o=t.ownerDocument)==null?void 0:o.body),r=D(i);if(l){const a=pe(r);return e.concat(r,r.visualViewport||[],J(i)?i:[],a&&n?Q(a):[])}return e.concat(i,Q(i,[],n))}function pe(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function $t(t){const e=k(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=W(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=et(n)!==l||et(o)!==r;return a&&(n=l,o=r),{width:n,height:o,$:a}}function wt(t){return S(t)?t:t.contextElement}function q(t){const e=wt(t);if(!W(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=$t(e);let r=(l?et(n.width):n.width)/o,a=(l?et(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const me=V(0);function zt(t){const e=D(t);return!yt()||!e.visualViewport?me:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==D(t)?!1:e}function I(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=wt(t);let r=V(1);e&&(o?S(o)&&(r=q(o)):r=q(t));const a=ge(l,n,o)?zt(l):V(0);let c=(i.left+a.x)/r.x,s=(i.top+a.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(l){const h=D(l),f=o&&S(o)?D(o):o;let p=h,m=p.frameElement;for(;m&&o&&f!==p;){const y=q(m),g=m.getBoundingClientRect(),w=k(m),x=g.left+(m.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(m.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,s*=y.y,u*=y.x,d*=y.y,c+=x,s+=v,p=D(m),m=p.frameElement}}return it({width:u,height:d,x:c,y:s})}function he(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l=i==="fixed",r=N(o),a=e?ct(e.floating):!1;if(o===r||a&&l)return n;let c={scrollLeft:0,scrollTop:0},s=V(1);const u=V(0),d=W(o);if((d||!d&&!l)&&((X(o)!=="body"||J(r))&&(c=ft(o)),W(o))){const h=I(o);s=q(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+u.x,y:n.y*s.y-c.scrollTop*s.y+u.y}}function ye(t){return Array.from(t.getClientRects())}function jt(t){return I(N(t)).left+ft(t).scrollLeft}function we(t){const e=N(t),n=ft(t),o=t.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+jt(t);const a=-n.scrollTop;return k(o).direction==="rtl"&&(r+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}function xe(t,e){const n=D(t),o=N(t),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){l=i.width,r=i.height;const s=yt();(!s||s&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:l,height:r,x:a,y:c}}function ve(t,e){const n=I(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=W(t)?q(t):V(1),r=t.clientWidth*l.x,a=t.clientHeight*l.y,c=i*l.x,s=o*l.y;return{width:r,height:a,x:c,y:s}}function Pt(t,e,n){let o;if(e==="viewport")o=xe(t,n);else if(e==="document")o=we(N(t));else if(S(e))o=ve(e,n);else{const i=zt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return it(o)}function It(t,e){const n=$(t);return n===e||!S(n)||Y(n)?!1:k(n).position==="fixed"||It(n,e)}function be(t,e){const n=e.get(t);if(n)return n;let o=Q(t,[],!1).filter(a=>S(a)&&X(a)!=="body"),i=null;const l=k(t).position==="fixed";let r=l?$(t):t;for(;S(r)&&!Y(r);){const a=k(r),c=st(r);!c&&a.position==="fixed"&&(i=null),(l?!c&&!i:!c&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||J(r)&&!c&&It(t,r))?o=o.filter(s=>s!==r):i=a,r=$(r)}return e.set(t,o),o}function Ee(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?ct(e)?[]:be(e,this._c):[].concat(n),o],r=l[0],a=l.reduce((c,s)=>{const u=Pt(e,s,i);return c.top=j(u.top,c.top),c.right=U(u.right,c.right),c.bottom=U(u.bottom,c.bottom),c.left=j(u.left,c.left),c},Pt(e,r,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){const{width:e,height:n}=$t(t);return{width:e,height:n}}function Te(t,e,n){const o=W(e),i=N(e),l=n==="fixed",r=I(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const c=V(0);if(o||!o&&!l)if((X(e)!=="body"||J(i))&&(a=ft(e)),o){const d=I(e,!0,l,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else i&&(c.x=jt(i));const s=r.left+a.scrollLeft-c.x,u=r.top+a.scrollTop-c.y;return{x:s,y:u,width:r.width,height:r.height}}function ut(t){return k(t).position==="static"}function Dt(t,e){return!W(t)||k(t).position==="fixed"?null:e?e(t):t.offsetParent}function _t(t,e){const n=D(t);if(ct(t))return n;if(!W(t)){let i=$(t);for(;i&&!Y(i);){if(S(i)&&!ut(i))return i;i=$(i)}return n}let o=Dt(t,e);for(;o&&ue(o)&&ut(o);)o=Dt(o,e);return o&&Y(o)&&ut(o)&&!st(o)?n:o||de(t)||n}const Le=async function(t){const e=this.getOffsetParent||_t,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pe(t){return k(t).direction==="rtl"}const mt={convertOffsetParentRelativeRectToViewportRelativeRect:he,getDocumentElement:N,getClippingRect:Ee,getOffsetParent:_t,getElementRects:Le,getClientRects:ye,getDimensions:Re,getScale:q,isElement:S,isRTL:Pe};function De(t,e){let n=null,o;const i=N(t);function l(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),l();const{left:s,top:u,width:d,height:h}=t.getBoundingClientRect();if(a||e(),!d||!h)return;const f=tt(u),p=tt(i.clientWidth-(s+d)),m=tt(i.clientHeight-(u+h)),y=tt(s),g={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:j(0,U(1,c))||1};let w=!0;function x(v){const b=v[0].intersectionRatio;if(b!==c){if(!w)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,g)}n.observe(t)}return r(!0),l}function Ae(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,s=wt(t),u=i||l?[...s?Q(s):[],...Q(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),l&&g.addEventListener("resize",n)});const d=s&&a?De(s,n):null;let h=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===s&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),s&&!c&&f.observe(s),f.observe(e));let p,m=c?I(t):null;c&&y();function y(){const g=I(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,p=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),l&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const Oe=se,Se=re,ke=fe,At=le,Ce=ae,He=oe,Fe=(t,e,n)=>{const o=new Map,i={platform:mt,...n},l={...i.platform,_c:o};return ne(t,e,{...i,platform:l})};function We(t){return Me(t)}function dt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Me(t){for(let e=t;e;e=dt(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=dt(t);e;e=dt(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||st(n)||e.tagName==="BODY"))return e}return null}(function(){if(Ht()){const t=mt.getOffsetParent;mt.getOffsetParent=e=>t(e,We)}})();function Ot(t){const e=window.devicePixelRatio||1;return Math.round(t*e)/e}const qt=async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:l,flipPlacements:r,offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})=>{if(!e||!n)return null;const d=Xt(n)==="rtl",{x:h,y:f,placement:p,strategy:m,middlewareData:y}=await Fe(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:kt(i,d),middleware:Ne({placement:i,flipDisabled:l,flipPlacements:r?.map(v=>kt(v,d)),offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})});if(s&&y.arrow){const{x:v,y:b}=y.arrow,T=p.split("-")[0],R=v!=null?"left":"top",A=$e[T],E={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=T==="left"||T==="right"?"horizontal":"vertical"),Object.assign(s.style,{...E,[R]:`${R=="left"?v:b}px`,[T]:"100%",transform:A})}const g=y.hide?.referenceHidden?"hidden":null,w=g?"none":null;n.setAttribute(Be,p);const{open:x}=t;Object.assign(n.style,{visibility:g,pointerEvents:w,position:m,transform:x?`translate(${Ot(h)}px,${Ot(f)}px)`:"",top:0,left:0})},Be="data-placement",St=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],qe="bottom-start",Ue="bottom-end",Ye={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active",arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"};function Ne({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:l,type:r}){const a=[ke(),Ce()];if(r==="menu")return[...a,At({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(r==="popover"||r==="tooltip"){const c=[...a,Oe({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Se({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(At(n?{fallbackPlacements:n}:{})),l&&c.push(He({element:l})),c}return[]}function Xe(t,e){const n=t.filter(o=>St.includes(o));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${St.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function kt(t,e=!1){const n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Ge(t,e,n=!1){if(!(!t.open||!e.floatingEl||!e.referenceEl)){if(!Z.get(t))return Ut(t,e.referenceEl,e.floatingEl);await(n?Ve(t):qt)(t,e)}}function Ve(t){let e=rt.get(t);return e||(e=Gt(qt,xt.reposition,{leading:!0,maxWait:xt.reposition}),rt.set(t,e),e)}const $e={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},Z=new WeakMap,rt=new WeakMap;async function Ut(t,e,n){if(!n.isConnected)return;const o=Ht()?Ae:(r,a,c)=>(c(),()=>{});Z.set(t,{state:"pending"});let i;const l=o(e,n,()=>{const r=t.reposition();i||(i=r)});return Z.set(t,{state:"active",cleanUp:l}),i}async function Ke(t,e,n){if(!(!n||!e)&&(ze(t,e,n),Object.assign(n.style,{visibility:"hidden",pointerEvents:"none",position:t.overlayPositioning}),!!t.open))return Ut(t,e,n)}function ze(t,e,n){if(!n||!e)return;const o=Z.get(t);o?.state==="active"&&o.cleanUp(),Z.delete(t),rt.get(t)?.cancel(),rt.delete(t)}const Ct=4,Qe=Math.ceil(Math.hypot(Ct,Ct));export{Ue as $,Xe as I,Ke as U,qe as V,Qe as X,Ge as _,Ye as j,ze as q}; diff --git a/main/assets/form-CRSw616T-2CDQhr1H.js b/main/assets/form-CRSw616T-2CDQhr1H.js new file mode 100644 index 000000000..5b2afb420 --- /dev/null +++ b/main/assets/form-CRSw616T-2CDQhr1H.js @@ -0,0 +1 @@ +import{a as M}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{U as L,T as p}from"./dom-N58V0tYi-DBU3jlah.js";const A=["calcite-input","calcite-input-number","calcite-input-text","calcite-text-area"];function w(e){return`${e.split("-").map((n,i)=>i===0?n:`${n[0].toUpperCase()}${n.slice(1)}`).join("")}${A.includes(e)?"Input":"Change"}`}const f="hidden-form-input";function h(e){return"checked"in e}const m=new WeakMap,E=new WeakSet;function q(e,n){if(p(n.parentElement,"[form]"))return!0;const i="calciteInternalFormComponentRegister";let t=!1;return e.addEventListener(i,a=>{t=a.composedPath().some(s=>E.has(s)),a.stopPropagation()},{once:!0}),n.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0})),t}function F(e,{status:n,message:i,icon:t}){"status"in e&&(e.status=n),"validationIcon"in e&&typeof e.validationIcon!="string"&&(e.validationIcon=t),"validationMessage"in e&&!e.validationMessage&&(e.validationMessage=i)}function y(e){return e.nodeName==="CALCITE-RADIO-BUTTON"?p(e,"calcite-radio-button-group"):e}const S=new CustomEvent("calciteInvalid",{bubbles:!0,composed:!0});function g(e){const n=e?.target,i=n?.validationMessage,t=y(n?.parentElement);if(!t)return;const a=t?.nodeName?.toLowerCase(),s=a?.split("-");if(s.length<2||s[0]!=="calcite")return;e?.preventDefault(),"validity"in t&&(t.validity=n?.validity),t.dispatchEvent(S),F(t,{message:i,icon:!0,status:"invalid"});const c=w(a);t.addEventListener(c,()=>{"status"in t&&(t.status="idle"),"validationIcon"in t&&!t.validationIcon&&(t.validationIcon=!1),"validationMessage"in t&&t.validationMessage===i&&(t.validationMessage=""),"validity"in t&&(t.validity=n?.validity)},{once:!0})}function R(e){const{formEl:n}=e;return n?(n.addEventListener("invalid",g,!0),n.requestSubmit(),n.removeEventListener("invalid",g,!0),requestAnimationFrame(()=>{const i=n.querySelectorAll("[status=invalid]");for(const t of i)if(t?.validationMessage){t?.setFocus();break}}),!0):!1}function T(e){e.formEl?.reset()}function O(e){const{el:n,value:i}=e,t=$(e);if(!t||q(t,n))return;e.formEl=t,e.defaultValue=i,h(e)&&(e.defaultChecked=e.checked);const a=(e.onFormReset||x).bind(e);t.addEventListener("reset",a),m.set(e.el,a),E.add(n)}function $(e){const{el:n,form:i}=e;return i?L(n,{id:i}):p(n,"form")}function x(){if("status"in this&&(this.status="idle"),"validationIcon"in this&&(this.validationIcon=!1),"validationMessage"in this&&(this.validationMessage=""),h(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function P(e){const{el:n,formEl:i}=e;if(!i)return;const t=m.get(n);i.removeEventListener("reset",t),m.delete(n),e.formEl=null,E.delete(n)}const D="calciteInternalHiddenInputInput",k=e=>{e.target.dispatchEvent(new CustomEvent(D,{bubbles:!0}))},b=e=>e.removeEventListener("input",k);function V(e){const{el:n,formEl:i,name:t,value:a}=e,{ownerDocument:s}=n,c=n.querySelectorAll(`input[slot="${f}"]`);if(!i||!t){c.forEach(o=>{b(o),o.remove()});return}const v=Array.isArray(a)?a:[a],l=[],d=new Set;c.forEach(o=>{const r=v.find(C=>C==o.value);r!=null?(d.add(r),I(e,o,r)):l.push(o)});let u;v.forEach(o=>{if(d.has(o))return;let r=l.pop();r||(r=s.createElement("input"),r.slot=f),u||(u=s.createDocumentFragment()),u.append(r),r.addEventListener("input",k),I(e,r,o)}),u&&n.append(u),l.forEach(o=>{b(o),o.remove()})}function I(e,n,i){const{defaultValue:t,disabled:a,form:s,name:c,required:v}=e;n.defaultValue=t,n.disabled=a,n.name=c,n.required=v,n.tabIndex=-1,s?n.setAttribute("form",s):n.removeAttribute("form"),h(e)?(n.checked=e.checked,n.defaultChecked=e.defaultChecked,n.value=e.checked?i||"on":""):n.value=i||"",e.syncHiddenFormInput?.(n);const l=y(e.el);if(l&&"validity"in l)for(const d in{...n?.validity})l.validity[d]=n.validity[d]}const U=({component:e})=>(V(e),M("slot",{name:f}));export{R as D,O as H,$ as I,P as N,U as P,T as V,D as y}; diff --git a/main/assets/form-CRSw616T-Cd5gFTXp.js b/main/assets/form-CRSw616T-Cd5gFTXp.js deleted file mode 100644 index 04b80c9fc..000000000 --- a/main/assets/form-CRSw616T-Cd5gFTXp.js +++ /dev/null @@ -1 +0,0 @@ -import{a as M}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{U as L,T as p}from"./dom-N58V0tYi-DBU3jlah.js";const A=["calcite-input","calcite-input-number","calcite-input-text","calcite-text-area"];function w(e){return`${e.split("-").map((n,i)=>i===0?n:`${n[0].toUpperCase()}${n.slice(1)}`).join("")}${A.includes(e)?"Input":"Change"}`}const f="hidden-form-input";function h(e){return"checked"in e}const m=new WeakMap,E=new WeakSet;function q(e,n){if(p(n.parentElement,"[form]"))return!0;const i="calciteInternalFormComponentRegister";let t=!1;return e.addEventListener(i,a=>{t=a.composedPath().some(s=>E.has(s)),a.stopPropagation()},{once:!0}),n.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0})),t}function F(e,{status:n,message:i,icon:t}){"status"in e&&(e.status=n),"validationIcon"in e&&typeof e.validationIcon!="string"&&(e.validationIcon=t),"validationMessage"in e&&!e.validationMessage&&(e.validationMessage=i)}function y(e){return e.nodeName==="CALCITE-RADIO-BUTTON"?p(e,"calcite-radio-button-group"):e}const S=new CustomEvent("calciteInvalid",{bubbles:!0,composed:!0});function g(e){const n=e?.target,i=n?.validationMessage,t=y(n?.parentElement);if(!t)return;const a=t?.nodeName?.toLowerCase(),s=a?.split("-");if(s.length<2||s[0]!=="calcite")return;e?.preventDefault(),"validity"in t&&(t.validity=n?.validity),t.dispatchEvent(S),F(t,{message:i,icon:!0,status:"invalid"});const c=w(a);t.addEventListener(c,()=>{"status"in t&&(t.status="idle"),"validationIcon"in t&&!t.validationIcon&&(t.validationIcon=!1),"validationMessage"in t&&t.validationMessage===i&&(t.validationMessage=""),"validity"in t&&(t.validity=n?.validity)},{once:!0})}function R(e){const{formEl:n}=e;return n?(n.addEventListener("invalid",g,!0),n.requestSubmit(),n.removeEventListener("invalid",g,!0),requestAnimationFrame(()=>{const i=n.querySelectorAll("[status=invalid]");for(const t of i)if(t?.validationMessage){t?.setFocus();break}}),!0):!1}function T(e){e.formEl?.reset()}function O(e){const{el:n,value:i}=e,t=$(e);if(!t||q(t,n))return;e.formEl=t,e.defaultValue=i,h(e)&&(e.defaultChecked=e.checked);const a=(e.onFormReset||x).bind(e);t.addEventListener("reset",a),m.set(e.el,a),E.add(n)}function $(e){const{el:n,form:i}=e;return i?L(n,{id:i}):p(n,"form")}function x(){if("status"in this&&(this.status="idle"),"validationIcon"in this&&(this.validationIcon=!1),"validationMessage"in this&&(this.validationMessage=""),h(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function P(e){const{el:n,formEl:i}=e;if(!i)return;const t=m.get(n);i.removeEventListener("reset",t),m.delete(n),e.formEl=null,E.delete(n)}const D="calciteInternalHiddenInputInput",k=e=>{e.target.dispatchEvent(new CustomEvent(D,{bubbles:!0}))},b=e=>e.removeEventListener("input",k);function V(e){const{el:n,formEl:i,name:t,value:a}=e,{ownerDocument:s}=n,c=n.querySelectorAll(`input[slot="${f}"]`);if(!i||!t){c.forEach(o=>{b(o),o.remove()});return}const v=Array.isArray(a)?a:[a],l=[],d=new Set;c.forEach(o=>{const r=v.find(C=>C==o.value);r!=null?(d.add(r),I(e,o,r)):l.push(o)});let u;v.forEach(o=>{if(d.has(o))return;let r=l.pop();r||(r=s.createElement("input"),r.slot=f),u||(u=s.createDocumentFragment()),u.append(r),r.addEventListener("input",k),I(e,r,o)}),u&&n.append(u),l.forEach(o=>{b(o),o.remove()})}function I(e,n,i){const{defaultValue:t,disabled:a,form:s,name:c,required:v}=e;n.defaultValue=t,n.disabled=a,n.name=c,n.required=v,n.tabIndex=-1,s?n.setAttribute("form",s):n.removeAttribute("form"),h(e)?(n.checked=e.checked,n.defaultChecked=e.defaultChecked,n.value=e.checked?i||"on":""):n.value=i||"",e.syncHiddenFormInput?.(n);const l=y(e.el);if(l&&"validity"in l)for(const d in{...n?.validity})l.validity[d]=n.validity[d]}const U=({component:e})=>(V(e),M("slot",{name:f}));export{R as D,O as H,$ as I,P as N,U as P,T as V,D as y}; diff --git a/main/assets/geodesicUtils-B8mFUfTk-BoXyQMna.js b/main/assets/geodesicUtils-B8mFUfTk-BoXyQMna.js new file mode 100644 index 000000000..33de927c6 --- /dev/null +++ b/main/assets/geodesicUtils-B8mFUfTk-BoXyQMna.js @@ -0,0 +1 @@ +import{dB as $,o as B,dW as J,dR as ee,J as L,aO as te,m as ne,l as se}from"./main-C7yV2j71.js";import{i as q,d as ae,t as ie}from"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";function V(e){if(!e)return null;const n=e.wkid;if(n)return ae[n];const t=e.wkt2??e.wkt;return t?oe(t):null}function oe(e){const n=ie.exec(e);if(!n||n.length!==2)return null;const t=n[1].split(",");if(!t||t.length<3)return null;const c=parseFloat(t[1]),s=parseFloat(t[2]);return isNaN(c)||isNaN(s)?null:{a:c,f:s===0?0:1/s}}function T(e){const n=V(e);if(re(n))return n;const t=n.a*(1-n.f);return Object.assign(n,{b:t,eSq:1-(t/n.a)**2,radius:(2*n.a+t)/3,densificationRatio:1e4/((2*n.a+t)/3)})}function re(e){return e!=null&&"b"in e&&"eSq"in e&&"radius"in e}function G(e,n,t){const{a:c,eSq:s}=T(t),a=Math.sqrt(s),i=Math.sin(n[1]*q),l=c*n[0]*q;let r;return s>0?r=c*((1-s)*(i/(1-s*(i*i))-1/(2*a)*Math.log((1-a*i)/(1+a*i))))*.5:r=c*i,e[0]=l,e[1]=r,e}function C(e){return $(e)&&!!V(e)}function ue(e,n="square-meters"){if(e.some(i=>!C(i.spatialReference)))throw new B("geodesic-areas:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let i=0;i!C(c.spatialReference)))throw new B("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let c=0;c1){for(let S=1;S<=w-1;S++)E(a,g,p,S*n,t),h.push(a.slice());E(a,g,p,(v+Math.floor(w-1)*n)/2,t),h.push(a.slice())}E(a,g,p,v,t),h.push(a.slice()),M=a[0],d=a[1]}}const l=te(L,t);return e.type==="polyline"?new ne({paths:s,spatialReference:l}):new se({rings:s,spatialReference:l})}class X{constructor(n=0,t=void 0,c=void 0){this.distance=n,this.azimuth=t,this.reverseAzimuth=c}}function E(e,n,t,c,s){const a=n[0],i=n[1],l=a*q,r=i*q,h=(t??0)*q,{a:u,b:o,f:M}=T(s),d=Math.sin(h),m=Math.cos(h),g=(1-M)*Math.tan(r),p=1/Math.sqrt(1+g*g),v=g*p,w=Math.atan2(g,m),S=p*d,F=S*S,z=1-F,f=z*(u*u-o*o)/(o*o),I=1+f/16384*(4096+f*(f*(320-175*f)-768)),O=f/1024*(256+f*(f*(74-47*f)-128));let R,N,y,x,k=c/(o*I),A=2*Math.PI;for(;Math.abs(k-A)>1e-12;)y=Math.cos(2*w+k),R=Math.sin(k),N=Math.cos(k),x=O*R*(y+O/4*(N*(2*y*y-1)-O/6*y*(4*R*R-3)*(4*y*y-3))),A=k,k=c/(o*I)+x;const b=v*R-p*N*m,W=Math.atan2(v*N+p*R*m,(1-M)*Math.sqrt(F+b*b)),D=Math.atan2(R*d,p*N-v*R*m),j=M/16*z*(4+M*(4-3*z)),P=W/q,U=(l+(D-(1-j)*M*S*(k+j*R*(y+j*N*(2*y*y-1)))))/q;return e[0]=U,e[1]=P,e}function Y(e,n,t,c){const s=n[0]*q,a=n[1]*q,i=t[0]*q,l=t[1]*q,{a:r,b:h,f:u,radius:o}=T(c),M=i-s,d=Math.atan((1-u)*Math.tan(a)),m=Math.atan((1-u)*Math.tan(l)),g=Math.sin(d),p=Math.cos(d),v=Math.sin(m),w=Math.cos(m);let S,F,z,f,I,O,R,N,y,x,k=1e3,A=M;do{if(R=Math.sin(A),N=Math.cos(A),z=Math.sqrt(w*R*(w*R)+(p*v-g*w*N)*(p*v-g*w*N)),z===0)return e.distance=0,e.azimuth=void 0,e.reverseAzimuth=void 0,e;I=g*v+p*w*N,O=Math.atan2(z,I),y=p*w*R/z,F=1-y*y,f=I-2*g*v/F,isNaN(f)&&(f=0),x=u/16*F*(4+u*(4-3*F)),S=A,A=M+(1-x)*u*y*(O+x*z*(f+x*I*(2*f*f-1)))}while(Math.abs(A-S)>1e-12&&--k>0);if(k===0){const U=o,Z=Math.acos(Math.sin(a)*Math.sin(l)+Math.cos(a)*Math.cos(l)*Math.cos(i-s))*U,H=i-s,_=Math.sin(H)*Math.cos(l),K=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(H),Q=Math.atan2(_,K);return e.azimuth=Q/q,e.distance=Z,e.reverseAzimuth=void 0,e}const b=F*(r*r-h*h)/(h*h),W=b/1024*(256+b*(b*(74-47*b)-128)),D=h*(1+b/16384*(4096+b*(b*(320-175*b)-768)))*(O-W*z*(f+W/4*(I*(2*f*f-1)-W/6*f*(4*z*z-3)*(4*f*f-3)))),j=Math.atan2(w*Math.sin(A),p*v-g*w*Math.cos(A)),P=Math.atan2(p*Math.sin(A),p*v*Math.cos(A)-g*w);return e.azimuth=j/q,e.distance=D,e.reverseAzimuth=P/q,e}function pe(e){return C(e)?e:ee(e)?L.WGS84:null}export{X as D,Y as E,E as O,C as P,fe as c,ue as h,pe as u}; diff --git a/main/assets/geodesicUtils-B8mFUfTk-CCpgrgwm.js b/main/assets/geodesicUtils-B8mFUfTk-CCpgrgwm.js deleted file mode 100644 index e7e0a21b7..000000000 --- a/main/assets/geodesicUtils-B8mFUfTk-CCpgrgwm.js +++ /dev/null @@ -1 +0,0 @@ -import{dB as $,o as B,dW as J,dR as ee,J as L,aO as te,m as ne,l as se}from"./main-BZaw9FpY.js";import{i as q,d as ae,t as ie}from"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";function V(e){if(!e)return null;const n=e.wkid;if(n)return ae[n];const t=e.wkt2??e.wkt;return t?oe(t):null}function oe(e){const n=ie.exec(e);if(!n||n.length!==2)return null;const t=n[1].split(",");if(!t||t.length<3)return null;const c=parseFloat(t[1]),s=parseFloat(t[2]);return isNaN(c)||isNaN(s)?null:{a:c,f:s===0?0:1/s}}function T(e){const n=V(e);if(re(n))return n;const t=n.a*(1-n.f);return Object.assign(n,{b:t,eSq:1-(t/n.a)**2,radius:(2*n.a+t)/3,densificationRatio:1e4/((2*n.a+t)/3)})}function re(e){return e!=null&&"b"in e&&"eSq"in e&&"radius"in e}function G(e,n,t){const{a:c,eSq:s}=T(t),a=Math.sqrt(s),i=Math.sin(n[1]*q),l=c*n[0]*q;let r;return s>0?r=c*((1-s)*(i/(1-s*(i*i))-1/(2*a)*Math.log((1-a*i)/(1+a*i))))*.5:r=c*i,e[0]=l,e[1]=r,e}function C(e){return $(e)&&!!V(e)}function ue(e,n="square-meters"){if(e.some(i=>!C(i.spatialReference)))throw new B("geodesic-areas:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let i=0;i!C(c.spatialReference)))throw new B("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let c=0;c1){for(let S=1;S<=w-1;S++)E(a,g,p,S*n,t),h.push(a.slice());E(a,g,p,(v+Math.floor(w-1)*n)/2,t),h.push(a.slice())}E(a,g,p,v,t),h.push(a.slice()),M=a[0],d=a[1]}}const l=te(L,t);return e.type==="polyline"?new ne({paths:s,spatialReference:l}):new se({rings:s,spatialReference:l})}class X{constructor(n=0,t=void 0,c=void 0){this.distance=n,this.azimuth=t,this.reverseAzimuth=c}}function E(e,n,t,c,s){const a=n[0],i=n[1],l=a*q,r=i*q,h=(t??0)*q,{a:u,b:o,f:M}=T(s),d=Math.sin(h),m=Math.cos(h),g=(1-M)*Math.tan(r),p=1/Math.sqrt(1+g*g),v=g*p,w=Math.atan2(g,m),S=p*d,F=S*S,z=1-F,f=z*(u*u-o*o)/(o*o),I=1+f/16384*(4096+f*(f*(320-175*f)-768)),O=f/1024*(256+f*(f*(74-47*f)-128));let R,N,y,x,k=c/(o*I),A=2*Math.PI;for(;Math.abs(k-A)>1e-12;)y=Math.cos(2*w+k),R=Math.sin(k),N=Math.cos(k),x=O*R*(y+O/4*(N*(2*y*y-1)-O/6*y*(4*R*R-3)*(4*y*y-3))),A=k,k=c/(o*I)+x;const b=v*R-p*N*m,W=Math.atan2(v*N+p*R*m,(1-M)*Math.sqrt(F+b*b)),D=Math.atan2(R*d,p*N-v*R*m),j=M/16*z*(4+M*(4-3*z)),P=W/q,U=(l+(D-(1-j)*M*S*(k+j*R*(y+j*N*(2*y*y-1)))))/q;return e[0]=U,e[1]=P,e}function Y(e,n,t,c){const s=n[0]*q,a=n[1]*q,i=t[0]*q,l=t[1]*q,{a:r,b:h,f:u,radius:o}=T(c),M=i-s,d=Math.atan((1-u)*Math.tan(a)),m=Math.atan((1-u)*Math.tan(l)),g=Math.sin(d),p=Math.cos(d),v=Math.sin(m),w=Math.cos(m);let S,F,z,f,I,O,R,N,y,x,k=1e3,A=M;do{if(R=Math.sin(A),N=Math.cos(A),z=Math.sqrt(w*R*(w*R)+(p*v-g*w*N)*(p*v-g*w*N)),z===0)return e.distance=0,e.azimuth=void 0,e.reverseAzimuth=void 0,e;I=g*v+p*w*N,O=Math.atan2(z,I),y=p*w*R/z,F=1-y*y,f=I-2*g*v/F,isNaN(f)&&(f=0),x=u/16*F*(4+u*(4-3*F)),S=A,A=M+(1-x)*u*y*(O+x*z*(f+x*I*(2*f*f-1)))}while(Math.abs(A-S)>1e-12&&--k>0);if(k===0){const U=o,Z=Math.acos(Math.sin(a)*Math.sin(l)+Math.cos(a)*Math.cos(l)*Math.cos(i-s))*U,H=i-s,_=Math.sin(H)*Math.cos(l),K=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(H),Q=Math.atan2(_,K);return e.azimuth=Q/q,e.distance=Z,e.reverseAzimuth=void 0,e}const b=F*(r*r-h*h)/(h*h),W=b/1024*(256+b*(b*(74-47*b)-128)),D=h*(1+b/16384*(4096+b*(b*(320-175*b)-768)))*(O-W*z*(f+W/4*(I*(2*f*f-1)-W/6*f*(4*z*z-3)*(4*f*f-3)))),j=Math.atan2(w*Math.sin(A),p*v-g*w*Math.cos(A)),P=Math.atan2(p*Math.sin(A),p*v*Math.cos(A)-g*w);return e.azimuth=j/q,e.distance=D,e.reverseAzimuth=P/q,e}function pe(e){return C(e)?e:ee(e)?L.WGS84:null}export{X as D,Y as E,E as O,C as P,fe as c,ue as h,pe as u}; diff --git a/main/assets/geojson-CNt_qtQf-BQNqVsVZ.js b/main/assets/geojson-CNt_qtQf-BQNqVsVZ.js deleted file mode 100644 index dbe75d65f..000000000 --- a/main/assets/geojson-CNt_qtQf-BQNqVsVZ.js +++ /dev/null @@ -1 +0,0 @@ -import{y as $}from"./date-Cqvy-TgA-DIf-QFLz.js";import{o as m,dQ as C,d0 as F,cU as N}from"./main-BZaw9FpY.js";import{i as O,c as v}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const D={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function w(t){return D[t]}function*j(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const n of t.features)n&&(yield n)}}function*I(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)yield*n;break;case"MultiPolygon":for(const n of t.coordinates)for(const e of n)yield*e}}function*J(t,n={}){const{geometryType:e,objectIdField:o}=n;for(const r of t){const{geometry:c,properties:y,id:i}=r;if(c&&w(c.type)!==e)continue;const f=y||{};let u;o&&(u=f[o],i==null||u||(f[o]=u=i)),yield new O(c?E(new v,c,n):null,f,null,u??void 0)}}function R(t){for(const n of t)if(n.length>2)return!0;return!1}function x(t){return!k(t)}function A(t){return k(t)}function k(t){let n=0;for(let e=0;e=0;o--)P(t,n[o],e);t.lengths.push(n.length)}function P(t,n,e){const[o,r,c]=n;t.coords.push(o,r),e.hasZ&&t.coords.push(c||0)}function z(t){switch(typeof t){case"string":return $(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function _(t,n=4326){if(!t)throw new m("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new m("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const o=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=C({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!o||!r.test(o))throw new m("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function V(t,n={}){const e=[],o=new Set,r=new Set;let c,y=!1,i=null,f=!1,{geometryType:u=null}=n;for(const p of j(t)){const{geometry:g,properties:l,id:a}=p;if((!g||(u||(u=w(g.type)),w(g.type)===u))&&(y||(y=R(I(g))),f||(f=a!=null,f&&(c=typeof a,l&&(i=Object.keys(l).filter(s=>l[s]===a)))),l&&i&&f&&a!=null&&(i.length>1?i=i.filter(s=>l[s]===a):i.length===1&&(i=l[i[0]]===a?i:[])),l))for(const s in l){if(o.has(s))continue;const b=z(l[s]);if(b==="unknown"){r.add(s);continue}r.delete(s),o.add(s);const S=F(s);S&&e.push({name:S,alias:s,type:b})}}const h=F(i?.length===1&&i[0]||null)??void 0;if(h){for(const p of e)if(p.name===h&&N(p)){p.type="esriFieldTypeOID";break}}return{fields:e,geometryType:u,hasZ:y,objectIdFieldName:h,objectIdFieldType:c,unknownFields:Array.from(r)}}function W(t,n){return Array.from(J(j(t),n))}export{_ as X,V as Y,W as _,w as h}; diff --git a/main/assets/geojson-CNt_qtQf-utywq02B.js b/main/assets/geojson-CNt_qtQf-utywq02B.js new file mode 100644 index 000000000..922c70f84 --- /dev/null +++ b/main/assets/geojson-CNt_qtQf-utywq02B.js @@ -0,0 +1 @@ +import{y as $}from"./date-Cqvy-TgA-DIf-QFLz.js";import{o as m,dQ as C,d0 as F,cU as N}from"./main-C7yV2j71.js";import{i as O,c as v}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const D={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function w(t){return D[t]}function*j(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const n of t.features)n&&(yield n)}}function*I(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)yield*n;break;case"MultiPolygon":for(const n of t.coordinates)for(const e of n)yield*e}}function*J(t,n={}){const{geometryType:e,objectIdField:o}=n;for(const r of t){const{geometry:c,properties:y,id:i}=r;if(c&&w(c.type)!==e)continue;const f=y||{};let u;o&&(u=f[o],i==null||u||(f[o]=u=i)),yield new O(c?E(new v,c,n):null,f,null,u??void 0)}}function R(t){for(const n of t)if(n.length>2)return!0;return!1}function x(t){return!k(t)}function A(t){return k(t)}function k(t){let n=0;for(let e=0;e=0;o--)P(t,n[o],e);t.lengths.push(n.length)}function P(t,n,e){const[o,r,c]=n;t.coords.push(o,r),e.hasZ&&t.coords.push(c||0)}function z(t){switch(typeof t){case"string":return $(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function _(t,n=4326){if(!t)throw new m("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new m("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const o=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=C({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!o||!r.test(o))throw new m("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function V(t,n={}){const e=[],o=new Set,r=new Set;let c,y=!1,i=null,f=!1,{geometryType:u=null}=n;for(const p of j(t)){const{geometry:g,properties:l,id:a}=p;if((!g||(u||(u=w(g.type)),w(g.type)===u))&&(y||(y=R(I(g))),f||(f=a!=null,f&&(c=typeof a,l&&(i=Object.keys(l).filter(s=>l[s]===a)))),l&&i&&f&&a!=null&&(i.length>1?i=i.filter(s=>l[s]===a):i.length===1&&(i=l[i[0]]===a?i:[])),l))for(const s in l){if(o.has(s))continue;const b=z(l[s]);if(b==="unknown"){r.add(s);continue}r.delete(s),o.add(s);const S=F(s);S&&e.push({name:S,alias:s,type:b})}}const h=F(i?.length===1&&i[0]||null)??void 0;if(h){for(const p of e)if(p.name===h&&N(p)){p.type="esriFieldTypeOID";break}}return{fields:e,geometryType:u,hasZ:y,objectIdFieldName:h,objectIdFieldType:c,unknownFields:Array.from(r)}}function W(t,n){return Array.from(J(j(t),n))}export{_ as X,V as Y,W as _,w as h}; diff --git a/main/assets/geomasync-uGYsifQH-gccYe-Fi.js b/main/assets/geomasync-uGYsifQH-gccYe-Fi.js deleted file mode 100644 index a73c2067e..000000000 --- a/main/assets/geomasync-uGYsifQH-gccYe-Fi.js +++ /dev/null @@ -1 +0,0 @@ -import{y as le,c as ie,d as oe,N as b,x as ce,Z as ue,t as E,g as fe,r as T}from"./arcadeUtils-DpP0k7IY-DIwxqttO.js";import{J as f,w as m,d as V,h as G,c as W,M as z,T as s,n as l,C as g,Z as P,z as C,r as J,g as w,Y,p as D,K as M,f as R,L as de,S as q,e as S}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{I,A as j,z as p}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{n as B}from"./portalUtils-CKN9iXwH-AaE_9x6i.js";import{d,n as L,m as A,w as O,l as x,G as H,g as K,r as X,V as we,f as _,p as me}from"./main-BZaw9FpY.js";import{disjoint as he,intersects as pe,touches as ye,crosses as ve,within as ge,contains as Pe,overlaps as Ie,equals as Ae,relate as Fe,intersect as Re,union as Ne,difference as be,symmetricDifference as Se,clip as Oe,cut as xe,planarArea as Q,geodesicArea as $,planarLength as Z,geodesicLength as U,distance as De,densify as ee,geodesicDensify as ne,generalize as je,buffer as Le,geodesicBuffer as Te,offset as Ce,rotate as te,simplify as ae,isSimple as Je,convexHull as Ze,nearestCoordinate as ke,nearestVertex as ze}from"./geometryEngineAsync-D7oEu5dd-DTqB2IHB.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./shared-D1w-26bA-Cy2KeMh-.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./workers-PiCjreoO-oGzLvkSt.js";async function re(r,n,t){if(!we?.findCredential(r.restUrl))return null;if(r.loadStatus==="loaded"&&n===""&&r.user?.sourceJSON&&t===!1)return r.user.sourceJSON;const o={responseType:"json",query:{f:"json"}};if(t&&(o.query.returnUserLicenseTypeExtensions=!0),n===""){const e=await _(r.restUrl+"/community/self",o);if(e.data){const a=e.data;if(a?.username)return a}return null}const c=await _(r.restUrl+"/community/users/"+n,o);if(c.data){const e=c.data;return e.error?null:e}return null}function F(r,n,t){if(m(r,2,2,n,t),!(r[0]instanceof d&&r[1]instanceof d)&&!(r[0]instanceof d&&r[1]===null)&&!(r[1]instanceof d&&r[0]===null)&&(r[0]!==null||r[1]!==null))throw new s(n,l.InvalidParameter,t)}async function se(r,n){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let t=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(t=fe(r.spatialReference)/me(r.spatialReference));let o=0;if(r.type==="polyline")for(const e of r.paths)for(let a=1;a(F(e=f(e),n,t),e[0]===null||e[1]===null||he(e[0],e[1])))},r.functions.intersects=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&pe(e[0],e[1])))},r.functions.touches=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ye(e[0],e[1])))},r.functions.crosses=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ve(e[0],e[1])))},r.functions.within=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ge(e[0],e[1])))},r.functions.contains=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Pe(e[0],e[1])))},r.functions.overlaps=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Ie(e[0],e[1])))},r.functions.equals=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(m(e,2,2,n,t),e[0]===e[1]||(e[0]instanceof d&&e[1]instanceof d?Ae(e[0],e[1]):(V(e[0])&&V(e[1])||!!(G(e[0])&&G(e[1])||W(e[0])&&W(e[1])))&&e[0].equals(e[1]))))},r.functions.relate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,3,3,n,t),e[0]instanceof d&&e[1]instanceof d)return Fe(e[0],e[1],z(e[2]));if(e[0]instanceof d&&e[1]===null||e[1]instanceof d&&e[0]===null||e[0]===null&&e[1]===null)return!1;throw new s(n,l.InvalidParameter,t)})},r.functions.intersection=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null||e[1]===null?null:Re(e[0],e[1])))},r.functions.union=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{const a=[];if((e=f(e)).length===0)throw new s(n,l.WrongNumberOfParameters,t);if(e.length===1)if(g(e[0])){const i=f(e[0]);for(let u=0;u(F(e=f(e),n,t),e[0]===null?null:e[1]===null?I(e[0]):be(e[0],e[1])))},r.functions.symmetricdifference=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null&&e[1]===null?null:e[0]===null?I(e[1]):e[1]===null?I(e[0]):Se(e[0],e[1])))},r.functions.clip=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof L)&&e[1]!==null)throw new s(n,l.InvalidParameter,t);if(e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return e[1]===null?null:Oe(e[0],e[1])})},r.functions.cut=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof A)&&e[1]!==null)throw new s(n,l.InvalidParameter,t);if(e[0]===null)return[];if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return e[1]===null?[I(e[0])]:xe(e[0],e[1])})},r.functions.area=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,l.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:Q(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return Q(e[0],j(w(e[1],-1)))})},r.functions.areageodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,l.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:$(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return $(e[0],j(w(e[1],-1)))})},r.functions.length=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,l.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return Z(e[0],p(w(e[1],-1)))})},r.functions.length3d=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:a.hasZ===!0?se(a,p(w(e[1],-1))):Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return e[0].hasZ===!0?se(e[0],p(w(e[1],-1))):Z(e[0],p(w(e[1],-1)))})},r.functions.lengthgeodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,l.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:U(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return U(e[0],p(w(e[1],-1)))})},r.functions.distance=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);let a=e[0];(g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference));let i=e[1];if((g(e[1])||P(e[1]))&&(i=M(e[1],n.spatialReference)),!(a instanceof d))throw new s(n,l.InvalidParameter,t);if(!(i instanceof d))throw new s(n,l.InvalidParameter,t);return De(a,i,p(w(e[2],-1)))})},r.functions.distancegeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);const a=e[0],i=e[1];if(!(a instanceof O))throw new s(n,l.InvalidParameter,t);if(!(i instanceof O))throw new s(n,l.InvalidParameter,t);const u=new A({paths:[],spatialReference:a.spatialReference});return u.addPath([a,i]),U(u,p(w(e[2],-1)))})},r.functions.densify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);if(a<=0)throw new s(n,l.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ee(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ee(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.densifygeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);if(a<=0)throw new s(n,l.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ne(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ne(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.generalize=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,4,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);return je(e[0],a,de(w(e[2],!0)),p(w(e[3],-1)))})},r.functions.buffer=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);return a===0?I(e[0]):Le(e[0],a,p(w(e[2],-1)))})},r.functions.buffergeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);return a===0?I(e[0]):Te(e[0],a,p(w(e[2],-1)))})},r.functions.offset=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,6,n,t),e[0]===null)return null;if(!(e[0]instanceof x||e[0]instanceof A))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);const i=R(w(e[4],10));if(isNaN(i))throw new s(n,l.InvalidParameter,t);const u=R(w(e[5],0));if(isNaN(u))throw new s(n,l.InvalidParameter,t);return Ce(e[0],a,p(w(e[2],-1)),z(w(e[3],"round")).toLowerCase(),i,u)})},r.functions.rotate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=e[0]instanceof L?x.fromExtent(e[0]):e[0],i=R(e[1]);if(isNaN(i))throw new s(n,l.InvalidParameter,t);const u=w(e[2],null);if(u===null)return te(a,i);if(u instanceof O)return te(a,i,u);throw new s(n,l.InvalidParameter,t)})},r.functions.centroid=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,l.InvalidParameter,t);return a instanceof O?C(I(a),n.spatialReference):a instanceof x?a.centroid:a instanceof A?le(a):a instanceof H?ie(a):a instanceof L?a.center:null})},r.functions.measuretocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,l.InvalidParameter,t);if(!(a instanceof A))throw new s(n,l.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,l.InvalidParameter,t);const i=oe(a,e[1]);return i?b.convertObjectToArcadeDictionary(i,S(n),!1,!0):null})},r.functions.pointtocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,l.InvalidParameter,t);if(!(a instanceof A))throw new s(n,l.InvalidParameter,t);const i=e[1];if(i===null)return null;if(!(i instanceof O))throw new s(n,l.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,l.InvalidParameter,t);const u=ce(a,i);return u?b.convertObjectToArcadeDictionary(u,S(n),!1,!0):null})},r.functions.distancetocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,l.InvalidParameter,t);if(!(a instanceof A))throw new s(n,l.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,l.InvalidParameter,t);const i=ue(a,e[1]);return i?b.convertObjectToArcadeDictionary(i,S(n),!1,!0):null})},r.functions.multiparttosinglepart=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);if(e[0]instanceof O)return[C(I(e[0]),n.spatialReference)];if(e[0]instanceof L)return[C(I(e[0]),n.spatialReference)];const a=await ae(e[0]);if(a instanceof x){const i=[],u=[];for(let h=0;h{if(e=f(e),m(e,1,1,n,t),e[0]===null)return!0;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return Je(e[0])})},r.functions.simplify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return ae(e[0])})},r.functions.convexhull=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return Ze(e[0])})},r.functions.getuser=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{m(e,0,2,n,t);let a=w(e[1],""),i=a===!0;if(a=a===!0||a===!1?"":z(a),e.length===0||e[0]instanceof E){let h;h=n.services?.portal?n.services.portal:X.getDefault(),e.length>0&&(h=B(e[0],h));const y=await re(h,a,i);if(y){const N=JSON.parse(JSON.stringify(y));for(const v of["lastLogin","created","modified"])N[v]!==void 0&&N[v]!==null&&(N[v]=new Date(N[v]));return b.convertObjectToArcadeDictionary(N,S(n))}return null}let u=null;if(J(e[0])&&(u=e[0]),u){if(i=!1,a)return null;await u.load();const h=await u.getOwningSystemUrl();if(!h){if(!a){const v=await u.getIdentityUser();return v?b.convertObjectToArcadeDictionary({username:v},S(n)):null}return null}let y;y=n.services?.portal?n.services.portal:X.getDefault(),y=B(new E(h),y);const N=await re(y,a,i);if(N){const v=JSON.parse(JSON.stringify(N));for(const k of["lastLogin","created","modified"])v[k]!==void 0&&v[k]!==null&&(v[k]=new Date(v[k]));return b.convertObjectToArcadeDictionary(v,S(n))}return null}throw new s(n,l.InvalidParameter,t)})},r.functions.nearestcoordinate=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,l.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,l.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ke(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})},r.functions.nearestvertex=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,l.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,l.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ze(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})})}export{sn as registerFunctions}; diff --git a/main/assets/geomasync-uGYsifQH-iajyCE0f.js b/main/assets/geomasync-uGYsifQH-iajyCE0f.js new file mode 100644 index 000000000..a8863c247 --- /dev/null +++ b/main/assets/geomasync-uGYsifQH-iajyCE0f.js @@ -0,0 +1 @@ +import{y as le,c as ie,d as oe,N as b,x as ce,Z as ue,t as E,g as fe,r as T}from"./arcadeUtils-DpP0k7IY-BXKRfMc2.js";import{J as f,w as m,d as V,h as G,c as W,M as z,T as s,n as l,C as g,Z as P,z as C,r as J,g as w,Y,p as D,K as M,f as R,L as de,S as q,e as S}from"./languageUtils-BYxF9hRA-BLoYMqdU.js";import{I,A as j,z as p}from"./TimeOnly-DSMefxKy-C21ZkqlE.js";import{n as B}from"./portalUtils-CKN9iXwH-D_ZWpoBZ.js";import{d,n as L,m as A,w as O,l as x,G as H,g as K,r as X,V as we,f as _,p as me}from"./main-C7yV2j71.js";import{disjoint as he,intersects as pe,touches as ye,crosses as ve,within as ge,contains as Pe,overlaps as Ie,equals as Ae,relate as Fe,intersect as Re,union as Ne,difference as be,symmetricDifference as Se,clip as Oe,cut as xe,planarArea as Q,geodesicArea as $,planarLength as Z,geodesicLength as U,distance as De,densify as ee,geodesicDensify as ne,generalize as je,buffer as Le,geodesicBuffer as Te,offset as Ce,rotate as te,simplify as ae,isSimple as Je,convexHull as Ze,nearestCoordinate as ke,nearestVertex as ze}from"./geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./number-eRKYXfX9-C213qXfW.js";import"./shared-D1w-26bA-CNuAEz8h.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./workers-PiCjreoO-DqI62TYf.js";async function re(r,n,t){if(!we?.findCredential(r.restUrl))return null;if(r.loadStatus==="loaded"&&n===""&&r.user?.sourceJSON&&t===!1)return r.user.sourceJSON;const o={responseType:"json",query:{f:"json"}};if(t&&(o.query.returnUserLicenseTypeExtensions=!0),n===""){const e=await _(r.restUrl+"/community/self",o);if(e.data){const a=e.data;if(a?.username)return a}return null}const c=await _(r.restUrl+"/community/users/"+n,o);if(c.data){const e=c.data;return e.error?null:e}return null}function F(r,n,t){if(m(r,2,2,n,t),!(r[0]instanceof d&&r[1]instanceof d)&&!(r[0]instanceof d&&r[1]===null)&&!(r[1]instanceof d&&r[0]===null)&&(r[0]!==null||r[1]!==null))throw new s(n,l.InvalidParameter,t)}async function se(r,n){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let t=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(t=fe(r.spatialReference)/me(r.spatialReference));let o=0;if(r.type==="polyline")for(const e of r.paths)for(let a=1;a(F(e=f(e),n,t),e[0]===null||e[1]===null||he(e[0],e[1])))},r.functions.intersects=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&pe(e[0],e[1])))},r.functions.touches=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ye(e[0],e[1])))},r.functions.crosses=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ve(e[0],e[1])))},r.functions.within=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ge(e[0],e[1])))},r.functions.contains=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Pe(e[0],e[1])))},r.functions.overlaps=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Ie(e[0],e[1])))},r.functions.equals=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(m(e,2,2,n,t),e[0]===e[1]||(e[0]instanceof d&&e[1]instanceof d?Ae(e[0],e[1]):(V(e[0])&&V(e[1])||!!(G(e[0])&&G(e[1])||W(e[0])&&W(e[1])))&&e[0].equals(e[1]))))},r.functions.relate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,3,3,n,t),e[0]instanceof d&&e[1]instanceof d)return Fe(e[0],e[1],z(e[2]));if(e[0]instanceof d&&e[1]===null||e[1]instanceof d&&e[0]===null||e[0]===null&&e[1]===null)return!1;throw new s(n,l.InvalidParameter,t)})},r.functions.intersection=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null||e[1]===null?null:Re(e[0],e[1])))},r.functions.union=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{const a=[];if((e=f(e)).length===0)throw new s(n,l.WrongNumberOfParameters,t);if(e.length===1)if(g(e[0])){const i=f(e[0]);for(let u=0;u(F(e=f(e),n,t),e[0]===null?null:e[1]===null?I(e[0]):be(e[0],e[1])))},r.functions.symmetricdifference=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null&&e[1]===null?null:e[0]===null?I(e[1]):e[1]===null?I(e[0]):Se(e[0],e[1])))},r.functions.clip=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof L)&&e[1]!==null)throw new s(n,l.InvalidParameter,t);if(e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return e[1]===null?null:Oe(e[0],e[1])})},r.functions.cut=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof A)&&e[1]!==null)throw new s(n,l.InvalidParameter,t);if(e[0]===null)return[];if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return e[1]===null?[I(e[0])]:xe(e[0],e[1])})},r.functions.area=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,l.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:Q(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return Q(e[0],j(w(e[1],-1)))})},r.functions.areageodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,l.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:$(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return $(e[0],j(w(e[1],-1)))})},r.functions.length=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,l.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return Z(e[0],p(w(e[1],-1)))})},r.functions.length3d=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:a.hasZ===!0?se(a,p(w(e[1],-1))):Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return e[0].hasZ===!0?se(e[0],p(w(e[1],-1))):Z(e[0],p(w(e[1],-1)))})},r.functions.lengthgeodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,l.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:U(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return U(e[0],p(w(e[1],-1)))})},r.functions.distance=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);let a=e[0];(g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference));let i=e[1];if((g(e[1])||P(e[1]))&&(i=M(e[1],n.spatialReference)),!(a instanceof d))throw new s(n,l.InvalidParameter,t);if(!(i instanceof d))throw new s(n,l.InvalidParameter,t);return De(a,i,p(w(e[2],-1)))})},r.functions.distancegeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);const a=e[0],i=e[1];if(!(a instanceof O))throw new s(n,l.InvalidParameter,t);if(!(i instanceof O))throw new s(n,l.InvalidParameter,t);const u=new A({paths:[],spatialReference:a.spatialReference});return u.addPath([a,i]),U(u,p(w(e[2],-1)))})},r.functions.densify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);if(a<=0)throw new s(n,l.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ee(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ee(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.densifygeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);if(a<=0)throw new s(n,l.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ne(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ne(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.generalize=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,4,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);return je(e[0],a,de(w(e[2],!0)),p(w(e[3],-1)))})},r.functions.buffer=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);return a===0?I(e[0]):Le(e[0],a,p(w(e[2],-1)))})},r.functions.buffergeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);return a===0?I(e[0]):Te(e[0],a,p(w(e[2],-1)))})},r.functions.offset=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,6,n,t),e[0]===null)return null;if(!(e[0]instanceof x||e[0]instanceof A))throw new s(n,l.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,l.InvalidParameter,t);const i=R(w(e[4],10));if(isNaN(i))throw new s(n,l.InvalidParameter,t);const u=R(w(e[5],0));if(isNaN(u))throw new s(n,l.InvalidParameter,t);return Ce(e[0],a,p(w(e[2],-1)),z(w(e[3],"round")).toLowerCase(),i,u)})},r.functions.rotate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);const a=e[0]instanceof L?x.fromExtent(e[0]):e[0],i=R(e[1]);if(isNaN(i))throw new s(n,l.InvalidParameter,t);const u=w(e[2],null);if(u===null)return te(a,i);if(u instanceof O)return te(a,i,u);throw new s(n,l.InvalidParameter,t)})},r.functions.centroid=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,l.InvalidParameter,t);return a instanceof O?C(I(a),n.spatialReference):a instanceof x?a.centroid:a instanceof A?le(a):a instanceof H?ie(a):a instanceof L?a.center:null})},r.functions.measuretocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,l.InvalidParameter,t);if(!(a instanceof A))throw new s(n,l.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,l.InvalidParameter,t);const i=oe(a,e[1]);return i?b.convertObjectToArcadeDictionary(i,S(n),!1,!0):null})},r.functions.pointtocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,l.InvalidParameter,t);if(!(a instanceof A))throw new s(n,l.InvalidParameter,t);const i=e[1];if(i===null)return null;if(!(i instanceof O))throw new s(n,l.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,l.InvalidParameter,t);const u=ce(a,i);return u?b.convertObjectToArcadeDictionary(u,S(n),!1,!0):null})},r.functions.distancetocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,l.InvalidParameter,t);if(!(a instanceof A))throw new s(n,l.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,l.InvalidParameter,t);const i=ue(a,e[1]);return i?b.convertObjectToArcadeDictionary(i,S(n),!1,!0):null})},r.functions.multiparttosinglepart=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);if(e[0]instanceof O)return[C(I(e[0]),n.spatialReference)];if(e[0]instanceof L)return[C(I(e[0]),n.spatialReference)];const a=await ae(e[0]);if(a instanceof x){const i=[],u=[];for(let h=0;h{if(e=f(e),m(e,1,1,n,t),e[0]===null)return!0;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return Je(e[0])})},r.functions.simplify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return ae(e[0])})},r.functions.convexhull=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,l.InvalidParameter,t);return Ze(e[0])})},r.functions.getuser=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{m(e,0,2,n,t);let a=w(e[1],""),i=a===!0;if(a=a===!0||a===!1?"":z(a),e.length===0||e[0]instanceof E){let h;h=n.services?.portal?n.services.portal:X.getDefault(),e.length>0&&(h=B(e[0],h));const y=await re(h,a,i);if(y){const N=JSON.parse(JSON.stringify(y));for(const v of["lastLogin","created","modified"])N[v]!==void 0&&N[v]!==null&&(N[v]=new Date(N[v]));return b.convertObjectToArcadeDictionary(N,S(n))}return null}let u=null;if(J(e[0])&&(u=e[0]),u){if(i=!1,a)return null;await u.load();const h=await u.getOwningSystemUrl();if(!h){if(!a){const v=await u.getIdentityUser();return v?b.convertObjectToArcadeDictionary({username:v},S(n)):null}return null}let y;y=n.services?.portal?n.services.portal:X.getDefault(),y=B(new E(h),y);const N=await re(y,a,i);if(N){const v=JSON.parse(JSON.stringify(N));for(const k of["lastLogin","created","modified"])v[k]!==void 0&&v[k]!==null&&(v[k]=new Date(v[k]));return b.convertObjectToArcadeDictionary(v,S(n))}return null}throw new s(n,l.InvalidParameter,t)})},r.functions.nearestcoordinate=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,l.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,l.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ke(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})},r.functions.nearestvertex=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,l.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,l.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ze(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})})}export{sn as registerFunctions}; diff --git a/main/assets/geometryEngine-CdPoFSE4-BRF8cFYX.js b/main/assets/geometryEngine-CdPoFSE4-BRF8cFYX.js deleted file mode 100644 index 254f487ef..000000000 --- a/main/assets/geometryEngine-CdPoFSE4-BRF8cFYX.js +++ /dev/null @@ -1 +0,0 @@ -import{aO as p,J as l}from"./main-BZaw9FpY.js";import{G as n}from"./geometryEngineBase-DueYg7ux-CCeespPx.js";import{hydratedAdapter as r}from"./hydrated-CplJC1Fs-CV-sFImk.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";function i(e){const t=Array.isArray(e)?e[0].spatialReference:e.spatialReference;return t?p(l,t):l.WGS84}function w(e){return n.extendedSpatialReferenceInfo(e)}function R(e,t){return n.clip(r,i(e),e,t)}function x(e,t){return n.cut(r,i(e),e,t)}function S(e,t){return n.contains(r,i(e),e,t)}function y(e,t){return n.crosses(r,i(e),e,t)}function A(e,t,a){return n.distance(r,i(e),e,t,a)}function D(e,t){return n.equals(r,i(e),e,t)}function L(e,t){return n.intersects(r,i(e),e,t)}function T(e,t){return n.touches(r,i(e),e,t)}function V(e,t){return n.within(r,i(e),e,t)}function O(e,t){return n.disjoint(r,i(e),e,t)}function v(e,t){return n.overlaps(r,i(e),e,t)}function z(e,t,a){return n.relate(r,i(e),e,t,a)}function H(e){return n.isSimple(r,i(e),e)}function J(e){return n.simplify(r,i(e),e)}function C(e,t=!1){return n.convexHull(r,i(e),e,t)}function I(e,t){return n.difference(r,i(e),e,t)}function N(e,t){return n.symmetricDifference(r,i(e),e,t)}function b(e,t){return n.intersect(r,i(e),e,t)}function j(e,t=null){return n.union(r,i(e),e,t)}function q(e,t,a,s,c,u){return n.offset(r,i(e),e,t,a,s,c,u)}function B(e,t,a,s=!1){return n.buffer(r,i(e),e,t,a,s)}function E(e,t,a,s,c,u){return n.geodesicBuffer(r,i(e),e,t,a,s,c,u)}function G(e,t,a=!0){return n.nearestCoordinate(r,i(e),e,t,a)}function P(e,t){return n.nearestVertex(r,i(e),e,t)}function W(e,t,a,s){return n.nearestVertices(r,i(e),e,t,a,s)}function f(e){return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?e.extent?.center??null:null}function k(e,t,a){if(e==null)throw new o;const s=e.spatialReference;if((a=a??f(e))==null)throw new o;const c=e.constructor.fromJSON(n.rotate(e,t,a));return c.spatialReference=s,c}function F(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(n.flipHorizontal(e,t));return s.spatialReference=a,s}function K(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(n.flipVertical(e,t));return s.spatialReference=a,s}function M(e,t,a,s){return n.generalize(r,i(e),e,t,a,s)}function Q(e,t,a){return n.densify(r,i(e),e,t,a)}function U(e,t,a,s=0){return n.geodesicDensify(r,i(e),e,t,a,s)}function X(e,t){return n.planarArea(r,i(e),e,t)}function Y(e,t){return n.planarLength(r,i(e),e,t)}function Z(e,t,a){return n.geodesicArea(r,i(e),e,t,a)}function $(e,t,a){return n.geodesicLength(r,i(e),e,t,a)}function _(e,t){return n.intersectLinesToPoints(r,i(e),e,t)}function ee(e,t){n.changeDefaultSpatialReferenceTolerance(e,t)}function te(e){n.clearDefaultSpatialReferenceTolerance(e)}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{B as buffer,ee as changeDefaultSpatialReferenceTolerance,te as clearDefaultSpatialReferenceTolerance,R as clip,S as contains,C as convexHull,y as crosses,x as cut,Q as densify,I as difference,O as disjoint,A as distance,D as equals,w as extendedSpatialReferenceInfo,F as flipHorizontal,K as flipVertical,M as generalize,Z as geodesicArea,E as geodesicBuffer,U as geodesicDensify,$ as geodesicLength,b as intersect,_ as intersectLinesToPoints,L as intersects,H as isSimple,G as nearestCoordinate,P as nearestVertex,W as nearestVertices,q as offset,v as overlaps,X as planarArea,Y as planarLength,z as relate,k as rotate,J as simplify,N as symmetricDifference,T as touches,j as union,V as within}; diff --git a/main/assets/geometryEngine-CdPoFSE4-Bq1o6CJZ.js b/main/assets/geometryEngine-CdPoFSE4-Bq1o6CJZ.js new file mode 100644 index 000000000..584dcf797 --- /dev/null +++ b/main/assets/geometryEngine-CdPoFSE4-Bq1o6CJZ.js @@ -0,0 +1 @@ +import{aO as p,J as l}from"./main-C7yV2j71.js";import{G as n}from"./geometryEngineBase-DueYg7ux-CCeespPx.js";import{hydratedAdapter as r}from"./hydrated-CplJC1Fs-wGAJYB2w.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";function i(e){const t=Array.isArray(e)?e[0].spatialReference:e.spatialReference;return t?p(l,t):l.WGS84}function w(e){return n.extendedSpatialReferenceInfo(e)}function R(e,t){return n.clip(r,i(e),e,t)}function x(e,t){return n.cut(r,i(e),e,t)}function S(e,t){return n.contains(r,i(e),e,t)}function y(e,t){return n.crosses(r,i(e),e,t)}function A(e,t,a){return n.distance(r,i(e),e,t,a)}function D(e,t){return n.equals(r,i(e),e,t)}function L(e,t){return n.intersects(r,i(e),e,t)}function T(e,t){return n.touches(r,i(e),e,t)}function V(e,t){return n.within(r,i(e),e,t)}function O(e,t){return n.disjoint(r,i(e),e,t)}function v(e,t){return n.overlaps(r,i(e),e,t)}function z(e,t,a){return n.relate(r,i(e),e,t,a)}function H(e){return n.isSimple(r,i(e),e)}function J(e){return n.simplify(r,i(e),e)}function C(e,t=!1){return n.convexHull(r,i(e),e,t)}function I(e,t){return n.difference(r,i(e),e,t)}function N(e,t){return n.symmetricDifference(r,i(e),e,t)}function b(e,t){return n.intersect(r,i(e),e,t)}function j(e,t=null){return n.union(r,i(e),e,t)}function q(e,t,a,s,c,u){return n.offset(r,i(e),e,t,a,s,c,u)}function B(e,t,a,s=!1){return n.buffer(r,i(e),e,t,a,s)}function E(e,t,a,s,c,u){return n.geodesicBuffer(r,i(e),e,t,a,s,c,u)}function G(e,t,a=!0){return n.nearestCoordinate(r,i(e),e,t,a)}function P(e,t){return n.nearestVertex(r,i(e),e,t)}function W(e,t,a,s){return n.nearestVertices(r,i(e),e,t,a,s)}function f(e){return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?e.extent?.center??null:null}function k(e,t,a){if(e==null)throw new o;const s=e.spatialReference;if((a=a??f(e))==null)throw new o;const c=e.constructor.fromJSON(n.rotate(e,t,a));return c.spatialReference=s,c}function F(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(n.flipHorizontal(e,t));return s.spatialReference=a,s}function K(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(n.flipVertical(e,t));return s.spatialReference=a,s}function M(e,t,a,s){return n.generalize(r,i(e),e,t,a,s)}function Q(e,t,a){return n.densify(r,i(e),e,t,a)}function U(e,t,a,s=0){return n.geodesicDensify(r,i(e),e,t,a,s)}function X(e,t){return n.planarArea(r,i(e),e,t)}function Y(e,t){return n.planarLength(r,i(e),e,t)}function Z(e,t,a){return n.geodesicArea(r,i(e),e,t,a)}function $(e,t,a){return n.geodesicLength(r,i(e),e,t,a)}function _(e,t){return n.intersectLinesToPoints(r,i(e),e,t)}function ee(e,t){n.changeDefaultSpatialReferenceTolerance(e,t)}function te(e){n.clearDefaultSpatialReferenceTolerance(e)}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{B as buffer,ee as changeDefaultSpatialReferenceTolerance,te as clearDefaultSpatialReferenceTolerance,R as clip,S as contains,C as convexHull,y as crosses,x as cut,Q as densify,I as difference,O as disjoint,A as distance,D as equals,w as extendedSpatialReferenceInfo,F as flipHorizontal,K as flipVertical,M as generalize,Z as geodesicArea,E as geodesicBuffer,U as geodesicDensify,$ as geodesicLength,b as intersect,_ as intersectLinesToPoints,L as intersects,H as isSimple,G as nearestCoordinate,P as nearestVertex,W as nearestVertices,q as offset,v as overlaps,X as planarArea,Y as planarLength,z as relate,k as rotate,J as simplify,N as symmetricDifference,T as touches,j as union,V as within}; diff --git a/main/assets/geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js b/main/assets/geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js new file mode 100644 index 000000000..bc10219a7 --- /dev/null +++ b/main/assets/geometryEngineAsync-D7oEu5dd-BQ5sCMUo.js @@ -0,0 +1 @@ +import{w as l,g as w}from"./main-C7yV2j71.js";import{q as h}from"./workers-PiCjreoO-DqI62TYf.js";function a(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),t!=null&&n.push(t)),n}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function r(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const n=await d();return Promise.all(n.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function A(e){return r("extendedSpatialReferenceInfo",[e])}async function O(e,t){return c(await r("clip",[a(e),e,t]))}async function D(e,t){return c(await r("cut",[a(e),e,t]))}function J(e,t){return r("contains",[a(e),e,t])}function N(e,t){return r("crosses",[a(e),e,t])}function L(e,t,n){return r("distance",[a(e),e,t,n])}function T(e,t){return r("equals",[a(e),e,t])}function V(e,t){return r("intersects",[a(e),e,t])}function v(e,t){return r("touches",[a(e),e,t])}function E(e,t){return r("within",[a(e),e,t])}function b(e,t){return r("disjoint",[a(e),e,t])}function q(e,t){return r("overlaps",[a(e),e,t])}function z(e,t,n){return r("relate",[a(e),e,t,n])}function H(e){return r("isSimple",[a(e),e])}async function I(e){return c(await r("simplify",[a(e),e]))}async function P(e,t=!1){return c(await r("convexHull",[a(e),e,t]))}async function j(e,t){return c(await r("difference",[a(e),e,t]))}async function k(e,t){return c(await r("symmetricDifference",[a(e),e,t]))}async function B(e,t){return c(await r("intersect",[a(e),e,t]))}async function C(e,t=null){const n=S(e,t);return c(await r("union",[a(n),n]))}async function G(e,t,n,i,s,u){return c(await r("offset",[a(e),e,t,n,i,s,u]))}async function W(e,t,n,i=!1){const s=[a(e),e,t,n,i];return c(await r("buffer",s))}async function F(e,t,n,i,s,u){const g=[a(e),e,t,n,i,s,u];return c(await r("geodesicBuffer",g))}async function K(e,t,n=!0){const i=await r("nearestCoordinate",[a(e),e,t,n]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function M(e,t){const n=await r("nearestVertex",[a(e),e,t]);return{...n,coordinate:l.fromJSON(n.coordinate)}}async function Q(e,t,n,i){return(await r("nearestVertices",[a(e),e,t,n,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){return"xmin"in e?e.center:"x"in e?e:e.extent?.center}async function U(e,t,n){if(e==null)throw new o;const i=e.spatialReference;if((n=n??y(e))==null)throw new o;const s=e.constructor.fromJSON(await r("rotate",[i,e,t,n]));return s.spatialReference=i,s}async function X(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipHorizontal",[n,e,t]));return i.spatialReference=n,i}async function Y(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipVertical",[n,e,t]));return i.spatialReference=n,i}async function Z(e,t,n,i){return c(await r("generalize",[a(e),e,t,n,i]))}async function _(e,t,n){return c(await r("densify",[a(e),e,t,n]))}async function $(e,t,n,i=0){return c(await r("geodesicDensify",[a(e),e,t,n,i]))}function ee(e,t){return r("planarArea",[a(e),e,t])}function te(e,t){return r("planarLength",[a(e),e,t])}function ne(e,t,n){return r("geodesicArea",[a(e),e,t,n])}function re(e,t,n){return r("geodesicLength",[a(e),e,t,n])}async function ae(e,t){return c(await r("intersectLinesToPoints",[a(e),e,t]))}async function ie(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function ce(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{W as buffer,ie as changeDefaultSpatialReferenceTolerance,ce as clearDefaultSpatialReferenceTolerance,O as clip,J as contains,P as convexHull,N as crosses,D as cut,_ as densify,j as difference,b as disjoint,L as distance,T as equals,A as extendedSpatialReferenceInfo,X as flipHorizontal,Y as flipVertical,Z as generalize,ne as geodesicArea,F as geodesicBuffer,$ as geodesicDensify,re as geodesicLength,B as intersect,ae as intersectLinesToPoints,V as intersects,H as isSimple,K as nearestCoordinate,M as nearestVertex,Q as nearestVertices,G as offset,q as overlaps,ee as planarArea,te as planarLength,z as relate,U as rotate,I as simplify,k as symmetricDifference,v as touches,C as union,E as within}; diff --git a/main/assets/geometryEngineAsync-D7oEu5dd-DTqB2IHB.js b/main/assets/geometryEngineAsync-D7oEu5dd-DTqB2IHB.js deleted file mode 100644 index 9bf4c52da..000000000 --- a/main/assets/geometryEngineAsync-D7oEu5dd-DTqB2IHB.js +++ /dev/null @@ -1 +0,0 @@ -import{w as l,g as w}from"./main-BZaw9FpY.js";import{q as h}from"./workers-PiCjreoO-oGzLvkSt.js";function a(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),t!=null&&n.push(t)),n}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function r(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const n=await d();return Promise.all(n.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function A(e){return r("extendedSpatialReferenceInfo",[e])}async function O(e,t){return c(await r("clip",[a(e),e,t]))}async function D(e,t){return c(await r("cut",[a(e),e,t]))}function J(e,t){return r("contains",[a(e),e,t])}function N(e,t){return r("crosses",[a(e),e,t])}function L(e,t,n){return r("distance",[a(e),e,t,n])}function T(e,t){return r("equals",[a(e),e,t])}function V(e,t){return r("intersects",[a(e),e,t])}function v(e,t){return r("touches",[a(e),e,t])}function E(e,t){return r("within",[a(e),e,t])}function b(e,t){return r("disjoint",[a(e),e,t])}function q(e,t){return r("overlaps",[a(e),e,t])}function z(e,t,n){return r("relate",[a(e),e,t,n])}function H(e){return r("isSimple",[a(e),e])}async function I(e){return c(await r("simplify",[a(e),e]))}async function P(e,t=!1){return c(await r("convexHull",[a(e),e,t]))}async function j(e,t){return c(await r("difference",[a(e),e,t]))}async function k(e,t){return c(await r("symmetricDifference",[a(e),e,t]))}async function B(e,t){return c(await r("intersect",[a(e),e,t]))}async function C(e,t=null){const n=S(e,t);return c(await r("union",[a(n),n]))}async function G(e,t,n,i,s,u){return c(await r("offset",[a(e),e,t,n,i,s,u]))}async function W(e,t,n,i=!1){const s=[a(e),e,t,n,i];return c(await r("buffer",s))}async function F(e,t,n,i,s,u){const g=[a(e),e,t,n,i,s,u];return c(await r("geodesicBuffer",g))}async function K(e,t,n=!0){const i=await r("nearestCoordinate",[a(e),e,t,n]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function M(e,t){const n=await r("nearestVertex",[a(e),e,t]);return{...n,coordinate:l.fromJSON(n.coordinate)}}async function Q(e,t,n,i){return(await r("nearestVertices",[a(e),e,t,n,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){return"xmin"in e?e.center:"x"in e?e:e.extent?.center}async function U(e,t,n){if(e==null)throw new o;const i=e.spatialReference;if((n=n??y(e))==null)throw new o;const s=e.constructor.fromJSON(await r("rotate",[i,e,t,n]));return s.spatialReference=i,s}async function X(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipHorizontal",[n,e,t]));return i.spatialReference=n,i}async function Y(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipVertical",[n,e,t]));return i.spatialReference=n,i}async function Z(e,t,n,i){return c(await r("generalize",[a(e),e,t,n,i]))}async function _(e,t,n){return c(await r("densify",[a(e),e,t,n]))}async function $(e,t,n,i=0){return c(await r("geodesicDensify",[a(e),e,t,n,i]))}function ee(e,t){return r("planarArea",[a(e),e,t])}function te(e,t){return r("planarLength",[a(e),e,t])}function ne(e,t,n){return r("geodesicArea",[a(e),e,t,n])}function re(e,t,n){return r("geodesicLength",[a(e),e,t,n])}async function ae(e,t){return c(await r("intersectLinesToPoints",[a(e),e,t]))}async function ie(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function ce(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{W as buffer,ie as changeDefaultSpatialReferenceTolerance,ce as clearDefaultSpatialReferenceTolerance,O as clip,J as contains,P as convexHull,N as crosses,D as cut,_ as densify,j as difference,b as disjoint,L as distance,T as equals,A as extendedSpatialReferenceInfo,X as flipHorizontal,Y as flipVertical,Z as generalize,ne as geodesicArea,F as geodesicBuffer,$ as geodesicDensify,re as geodesicLength,B as intersect,ae as intersectLinesToPoints,V as intersects,H as isSimple,K as nearestCoordinate,M as nearestVertex,Q as nearestVertices,G as offset,q as overlaps,ee as planarArea,te as planarLength,z as relate,U as rotate,I as simplify,k as symmetricDifference,v as touches,C as union,E as within}; diff --git a/main/assets/geometryServiceUtils-nsujb7BH-BZ1M-sZ1.js b/main/assets/geometryServiceUtils-nsujb7BH-BZ1M-sZ1.js new file mode 100644 index 000000000..71753259e --- /dev/null +++ b/main/assets/geometryServiceUtils-nsujb7BH-BZ1M-sZ1.js @@ -0,0 +1 @@ +import{C as a,o as i,r as s}from"./main-C7yV2j71.js";import{f,j as m}from"./project-DQKhruav-BEFloNIO.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";async function g(e=null,n){if(a.geometryServiceUrl)return a.geometryServiceUrl;if(!e)throw new i("internal:geometry-service-url-not-configured");let r;r="portal"in e?e.portal||s.getDefault():e,await r.load({signal:n});const t=r.helperServices?.geometry?.url;if(!t)throw new i("internal:geometry-service-url-not-configured");return t}async function v(e,n,r=null,t){const l=await g(r,t),c=new f({geometries:[e],outSpatialReference:n}),o=await m(l,c,{signal:t});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new i("internal:geometry-service-projection-failed")}export{g as getGeometryServiceURL,v as projectGeometry}; diff --git a/main/assets/geometryServiceUtils-nsujb7BH-D7iwbaPn.js b/main/assets/geometryServiceUtils-nsujb7BH-D7iwbaPn.js deleted file mode 100644 index 085f15941..000000000 --- a/main/assets/geometryServiceUtils-nsujb7BH-D7iwbaPn.js +++ /dev/null @@ -1 +0,0 @@ -import{C as a,o as i,r as s}from"./main-BZaw9FpY.js";import{f,j as m}from"./project-DQKhruav-CYVbgcFi.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";async function g(e=null,n){if(a.geometryServiceUrl)return a.geometryServiceUrl;if(!e)throw new i("internal:geometry-service-url-not-configured");let r;r="portal"in e?e.portal||s.getDefault():e,await r.load({signal:n});const t=r.helperServices?.geometry?.url;if(!t)throw new i("internal:geometry-service-url-not-configured");return t}async function v(e,n,r=null,t){const l=await g(r,t),c=new f({geometries:[e],outSpatialReference:n}),o=await m(l,c,{signal:t});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new i("internal:geometry-service-projection-failed")}export{g as getGeometryServiceURL,v as projectGeometry}; diff --git a/main/assets/gif-BZzSowd2-CDmnzkgh.js b/main/assets/gif-BZzSowd2-CDmnzkgh.js new file mode 100644 index 000000000..3d9b05e72 --- /dev/null +++ b/main/assets/gif-BZzSowd2-CDmnzkgh.js @@ -0,0 +1 @@ +import{aN as H}from"./main-C7yV2j71.js";var D,x={},G={},B={};function V(){if(D)return B;D=1,Object.defineProperty(B,"__esModule",{value:!0}),B.loop=B.conditional=B.parse=void 0;var g=function a(d,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s;if(Array.isArray(o))o.forEach(function(h){return a(d,h,s,c)});else if(typeof o=="function")o(d,s,c,a);else{var l=Object.keys(o)[0];Array.isArray(o[l])?(c[l]={},a(d,o[l],s,c[l])):c[l]=o[l](d,s,c,a)}return s};B.parse=g;var u=function(a,d){return function(o,s,c,l){d(o,s,c)&&l(o,a,s,c)}};B.conditional=u;var t=function(a,d){return function(o,s,c,l){for(var h=[],e=o.pos;d(o,s,c);){var r={};if(l(o,a,s,r),o.pos===e)break;e=o.pos,h.push(r)}return h}};return B.loop=t,B}var O,T,v={};function $(){if(O)return v;O=1,Object.defineProperty(v,"__esModule",{value:!0}),v.readBits=v.readArray=v.readUnsigned=v.readString=v.peekBytes=v.readBytes=v.peekByte=v.readByte=v.buildStream=void 0;var g=function(e){return{data:e,pos:0}};v.buildStream=g;var u=function(){return function(e){return e.data[e.pos++]}};v.readByte=u;var t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};v.peekByte=t;var a=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};v.readBytes=a;var d=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};v.peekBytes=d;var o=function(e){return function(r){return Array.from(a(e)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};v.readString=o;var s=function(e){return function(r){var n=a(2)(r);return e?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};v.readUnsigned=s;var c=function(e,r){return function(n,i,f){for(var y=typeof r=="function"?r(n,i,f):r,p=a(e),m=new Array(y),w=0;w=i){var p=i-e.pos;n.push((0,t.readBytes)(p)(e)),f+=p;break}n.push((0,t.readBytes)(y)(e)),f+=y}for(var m=new Uint8Array(f),w=0,b=0;b>=c,y-=c,r>d||r==l)break;if(r==o){s=(1<<(c=i+1))-1,d=o+2,e=C;continue}if(e==C){U[m++]=A[r],e=r,p=r;continue}for(h=r,r==d&&(U[m++]=p,r=e);r>o;)U[m++]=A[r],r=M[r];p=255&A[r],U[m++]=p,dc[e],width:d,height:o}}function Y(g){return z??=document.createElement("canvas"),N??=z.getContext("2d",{willReadFrequently:!0}),z.width=g.width,z.height=g.height,N.putImageData(g,0,0),z}const Z=[71,73,70];function L(g){const u=new Uint8Array(g);return!Z.some((t,a)=>t!==u[a])}function te(g){if(!L(g))return!1;const u=new DataView(g),t=u.getUint8(10);let a=13+(128&t?3*2**(1+(7&t)):0),d=0,o=!1;for(;!o;){switch(u.getUint8(a++)){case 33:if(!s())return!1;break;case 44:c();break;case 59:o=!0;break;default:return!1}if(d>1)return!0}function s(){switch(u.getUint8(a++)){case 249:l();break;case 1:h();break;case 254:e();break;case 255:r();break;default:return!1}return!0}function c(){d++,a+=8;const i=u.getUint8(a++);a+=128&i?3*2**(1+(7&i)):0,a++,n()}function l(){a++,a+=4,n()}function h(){d++,a++,a+=12,n()}function e(){n()}function r(){a++,a+=8,a+=3,n()}function n(){let i;for(;i=u.getUint8(a++);)a+=i}return!1}export{te as isAnimatedGIF,L as isGIF,re as parseGif}; diff --git a/main/assets/gif-BZzSowd2-XnWuwdXp.js b/main/assets/gif-BZzSowd2-XnWuwdXp.js deleted file mode 100644 index f1b90ddc2..000000000 --- a/main/assets/gif-BZzSowd2-XnWuwdXp.js +++ /dev/null @@ -1 +0,0 @@ -import{aN as H}from"./main-BZaw9FpY.js";var D,x={},G={},B={};function V(){if(D)return B;D=1,Object.defineProperty(B,"__esModule",{value:!0}),B.loop=B.conditional=B.parse=void 0;var g=function a(d,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s;if(Array.isArray(o))o.forEach(function(h){return a(d,h,s,c)});else if(typeof o=="function")o(d,s,c,a);else{var l=Object.keys(o)[0];Array.isArray(o[l])?(c[l]={},a(d,o[l],s,c[l])):c[l]=o[l](d,s,c,a)}return s};B.parse=g;var u=function(a,d){return function(o,s,c,l){d(o,s,c)&&l(o,a,s,c)}};B.conditional=u;var t=function(a,d){return function(o,s,c,l){for(var h=[],e=o.pos;d(o,s,c);){var r={};if(l(o,a,s,r),o.pos===e)break;e=o.pos,h.push(r)}return h}};return B.loop=t,B}var O,T,v={};function $(){if(O)return v;O=1,Object.defineProperty(v,"__esModule",{value:!0}),v.readBits=v.readArray=v.readUnsigned=v.readString=v.peekBytes=v.readBytes=v.peekByte=v.readByte=v.buildStream=void 0;var g=function(e){return{data:e,pos:0}};v.buildStream=g;var u=function(){return function(e){return e.data[e.pos++]}};v.readByte=u;var t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};v.peekByte=t;var a=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};v.readBytes=a;var d=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};v.peekBytes=d;var o=function(e){return function(r){return Array.from(a(e)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};v.readString=o;var s=function(e){return function(r){var n=a(2)(r);return e?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};v.readUnsigned=s;var c=function(e,r){return function(n,i,f){for(var y=typeof r=="function"?r(n,i,f):r,p=a(e),m=new Array(y),w=0;w=i){var p=i-e.pos;n.push((0,t.readBytes)(p)(e)),f+=p;break}n.push((0,t.readBytes)(y)(e)),f+=y}for(var m=new Uint8Array(f),w=0,b=0;b>=c,y-=c,r>d||r==l)break;if(r==o){s=(1<<(c=i+1))-1,d=o+2,e=C;continue}if(e==C){U[m++]=A[r],e=r,p=r;continue}for(h=r,r==d&&(U[m++]=p,r=e);r>o;)U[m++]=A[r],r=M[r];p=255&A[r],U[m++]=p,dc[e],width:d,height:o}}function Y(g){return z??=document.createElement("canvas"),N??=z.getContext("2d",{willReadFrequently:!0}),z.width=g.width,z.height=g.height,N.putImageData(g,0,0),z}const Z=[71,73,70];function L(g){const u=new Uint8Array(g);return!Z.some((t,a)=>t!==u[a])}function te(g){if(!L(g))return!1;const u=new DataView(g),t=u.getUint8(10);let a=13+(128&t?3*2**(1+(7&t)):0),d=0,o=!1;for(;!o;){switch(u.getUint8(a++)){case 33:if(!s())return!1;break;case 44:c();break;case 59:o=!0;break;default:return!1}if(d>1)return!0}function s(){switch(u.getUint8(a++)){case 249:l();break;case 1:h();break;case 254:e();break;case 255:r();break;default:return!1}return!0}function c(){d++,a+=8;const i=u.getUint8(a++);a+=128&i?3*2**(1+(7&i)):0,a++,n()}function l(){a++,a+=4,n()}function h(){d++,a++,a+=12,n()}function e(){n()}function r(){a++,a+=8,a+=3,n()}function n(){let i;for(;i=u.getUint8(a++);)a+=i}return!1}export{te as isAnimatedGIF,L as isGIF,re as parseGif}; diff --git a/main/assets/gltfexport-Dj6nF2RN-B5Lxo2wd.js b/main/assets/gltfexport-Dj6nF2RN-B5Lxo2wd.js deleted file mode 100644 index 1b9e7f21f..000000000 --- a/main/assets/gltfexport-Dj6nF2RN-B5Lxo2wd.js +++ /dev/null @@ -1 +0,0 @@ -import{dU as S,i8 as v,fj as Q,a3 as re,$ as k,h_ as ie,bj as ne,an as oe,o as Y,d7 as ae,eh as ce,a1 as he}from"./main-BZaw9FpY.js";import{O as fe,X as ue}from"./quat-BODLR7mS-Bk09s2KF.js";import{e as le,n as de,r as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{R as $,_ as O,r as j,S as pe,l as _e}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{m as ge}from"./Mesh-DLzjDUIO-L2WFr_jE.js";import{b as Ee}from"./vertexSpaceConversion-CiKaVq_u-CSCrUe19.js";import{I as p,G as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{f as U}from"./resourceUtils-Ds65naCv-erCXStgB.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./MeshTransform-C--IG09w-B7P01ZzU.js";import"./mat4-DX7gBViE-CQMXDC3Z.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./imageUtils-BA2D6Uf1-BIs7TUww.js";import"./MeshVertexAttributes-CbNpPur2-BzFN0z5X.js";import"./MeshLocalVertexSpace-BqgocsoS-LyO4wl8W.js";import"./meshVertexSpaceUtils-B4l_Zo0M-COZz0iY8.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Cw8IJeSy.js";import"./plane-Dt8R0KeE-fuXvBrPY.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-cAmFzdIS.js";import"./projectPointToVector-B2UUY9SE-DeA9AEsl.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-PvJCbaaz.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CkKCAiNc.js";import"./vec3-BazNroeq-CFXHYIOm.js";import"./External-D_wl4XAw-MFWeclAP.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./BufferView-PQoE3GL7-DXIpDOUe.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-maVOs7I3.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function we(t){const e=q(t);return e!=null?e.toDataURL():""}async function J(t,e){const s=q(t);if(s==null)throw new Y("imageToArrayBuffer","Unsupported image type");const r=Ae(t),i=await new Promise(o=>s.toBlob(o,r));if(k(e),!i)throw new Y("imageToArrayBuffer","Failed to encode image");const a=await i.arrayBuffer();return k(e),{data:a,type:r}}function Ae(t){if(!(t instanceof HTMLImageElement))return"image/png";const e=t.src;if(ae(e)){const s=ce(e);return s?.mediaType==="image/jpeg"?s.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function q(t){if(t instanceof HTMLCanvasElement)return t;if(t instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");return t instanceof HTMLImageElement?s.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&s.putImageData(t,0,0),e}function Te(t){const e=[],s=new Uint8Array(t);for(let r=0;r=4&&i!==y.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),e.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(t){const e=this._data.length;if(this._data.push(t),this._accessorIndex>=0){const s=e%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?t:Math.min(r,t);const i=this._accessorMax[s];this._accessorMax[s]=typeof i!="number"?t:Math.max(i,t)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function t(e,s){return s*Math.ceil(e/s)}return t(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(t,e){switch(this._componentType){case p.BYTE:return new Int8Array(t,e);case p.FLOAT:return new Float32Array(t,e);case p.SHORT:return new Int16Array(t,e);case p.UNSIGNED_BYTE:return new Uint8Array(t,e);case p.UNSIGNED_INT:return new Uint32Array(t,e);case p.UNSIGNED_SHORT:return new Uint16Array(t,e)}}writeOutToBuffer(t,e){this._createTypedArray(t,e).set(this._data)}writeAsync(t){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=t.then(e=>{const s=new Uint8Array(e);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=t;const e=this._numComponentsForDataType;this._accessorMin=new Array(e),this._accessorMax=new Array(e)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const t=this._getElementSize(),e=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/e;if(s%1)throw new Error("An accessor was ended with missing component values");for(let i=0;ithis._finalizedPromiseResolve=t)}async finalize(){const t=this._bufferView,e=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&e.push(this._asyncWritePromise),await Promise.allSettled(e),this._isFinalized=!0,t.byteOffset=this.getByteOffset(),t.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case p.BYTE:case p.UNSIGNED_BYTE:return 1;case p.SHORT:case p.UNSIGNED_SHORT:return 2;case p.UNSIGNED_INT:case p.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case g.SCALAR:return 1;case g.VEC2:return 2;case g.VEC3:return 3;case g.VEC4:case g.MAT2:return 4;case g.MAT3:return 9;case g.MAT4:return 16}}},Z=class{constructor(t){this._gltf=t,this._bufferViews=[],this._isFinalized=!1,t.buffers||(t.buffers=[]),this.index=t.buffers.length;const e={byteLength:-1};t.buffers.push(e),this._buffer=e}addBufferView(t,e,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new xe(this,this._gltf,t,e,s);return this._bufferViews.push(r),r}getByteOffset(t){let e=0;for(const s of this._bufferViews){if(s===t)return e;e+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(t){const e=[];for(const s of this._bufferViews){if(t&&s===t)return e;e.push(s.finalized)}return e}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const t=this._getTotalSize(),e=new ArrayBuffer(t);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(e,s),s+=r.byteSize;return e}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let t=0;for(const e of this._bufferViews)t+=e.byteSize;return t}};function Ie(t,e){if(t.components)for(const s of t.components)s.faces&&s.shading==="smooth"&&Ne(s,e)}function Ne(t,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const s=t.faces,{position:r,normal:i}=e,a=s.length/3;for(let o=0;ohe.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class Le{constructor(e,s){this.options=s,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:s.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const s=this.gltf.extras,r=s.output.buffer===R.GLB||s.output.image===b.GLB;r&&(s.binChunkBuffer=new Z(this.gltf)),e.forEachScene(i=>{this._addScene(i)}),r&&s.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const s={};e.name&&(s.name=e.name),e.forEachNode(r=>{s.nodes||(s.nodes=[]),s.nodes.push(...this._addNodes(r))}),this.gltf.scenes.push(s)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const s={};e.name&&(s.name=e.name);const r=e.translation;$(r,ie)||(s.translation=v(r));const i=e.rotation;ue(i,de)||(s.rotation=me(i));const a=e.scale;$(a,Q)||(s.scale=v(a));const o=this.gltf.nodes.length;if(this.gltf.nodes.push(s),e.mesh&&e.mesh.vertexAttributes.position){const n=this._createMeshes(e.mesh),c=[o];if(n.length===1)this._addMesh(s,n[0]);else for(const h of n){const u={};this._addMesh(u,h),c.push(this.gltf.nodes.length),this.gltf.nodes.push(u)}return c}return e.forEachNode(n=>{s.children||(s.children=[]),s.children.push(...this._addNodes(n))}),[o]}_addMesh(e,s){this.gltf.meshes??=[];const r=this.gltf.meshes.length;this.gltf.meshes.push(s),e.mesh=r}_createMeshes(e){const s=this.gltf.extras,r=s.output.buffer===R.GLB;let i;i=r?s.binChunkBuffer:new Z(this.gltf);const a=this.options.origin,o=e.vertexSpace.clone();o.origin=[a.x,a.y,a.z??0];const n=Ee({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!n)return[];Ie(e,n),Be(n);const{position:c,normal:h,tangent:u}=n,{uv:_,color:l}=e.vertexAttributes,E=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER);let d,m,w,A;h&&(d=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER)),_&&(m=i.addBufferView(p.FLOAT,g.VEC2,y.ARRAY_BUFFER)),u&&(w=i.addBufferView(p.FLOAT,g.VEC4,y.ARRAY_BUFFER)),l&&(A=i.addBufferView(p.UNSIGNED_BYTE,g.VEC4,y.ARRAY_BUFFER)),E.startAccessor("POSITION"),d&&d.startAccessor("NORMAL"),m&&m.startAccessor("TEXCOORD_0"),w&&w.startAccessor("TANGENT"),A&&A.startAccessor("COLOR_0");const te=n.position.length/3;for(let f=0;f0&&e.components[0].faces?(M=i.addBufferView(p.UNSIGNED_INT,g.SCALAR,y.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(M,e.components,D,H,C,V,z,F)):this._addMeshVertexNonIndexed(e.components,D,H,C,V,z,F),E.finalize(),d&&d.finalize(),m&&m.finalize(),w&&w.finalize(),M&&M.finalize(),A&&A.finalize(),r||i.finalize(),D}_addMaterial(e){if(e===null)return;const s=this._materialMap.indexOf(e);if(s!==-1)return s;this.gltf.materials||(this.gltf.materials=[]);const r={};switch(e.alphaMode){case"mask":r.alphaMode=B.MASK;break;case"auto":case"blend":r.alphaMode=B.BLEND}r.alphaCutoff=e.alphaCutoff,e.doubleSided&&(r.doubleSided=e.doubleSided),r.pbrMetallicRoughness={};const i=n=>n**2.1,a=n=>{const c=n.toRgba();return c[0]=i(c[0]/255),c[1]=i(c[1]/255),c[2]=i(c[2]/255),c};if(e.color!=null&&(r.pbrMetallicRoughness.baseColorFactor=a(e.color)),e.colorTexture!=null&&(r.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(r.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof ge){if(e.emissiveTexture!=null&&(r.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const n=a(e.emissiveColor);r.emissiveFactor=[n[0],n[1],n[2]]}e.occlusionTexture!=null&&(r.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(r.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),r.pbrMetallicRoughness.metallicFactor=e.metallic,r.pbrMetallicRoughness.roughnessFactor=e.roughness}else r.pbrMetallicRoughness.metallicFactor=1,r.pbrMetallicRoughness.roughnessFactor=1,P().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const o=this.gltf.materials.length;return this.gltf.materials.push(r),this._materialMap.push(e),o}_createTextureInfo(e,s){const r={index:this._addTexture(e)};return s&&(r.extensions||(r.extensions={}),r.extensions.KHR_texture_transform={scale:s.scale,offset:s.offset,rotation:ne(s.rotation)}),r}_addTexture(e){const s=this.gltf.textures??[];return this.gltf.textures=s,oe(this._textureMap,e,()=>{const r={sampler:this._addSampler(e),source:this._addImage(e)},i=s.length;return s.push(r),i})}_addImage(e){const s=this._imageMap.get(e);if(s!=null)return s;this.gltf.images||(this.gltf.images=[]);const r={};if(e.url)r.uri=e.url;else{const a=e.data;r.extras=a;for(let n=0;n(r.mimeType=u,h));o.promises.push(n.writeAsync(c).then(()=>{n.finalize()}))}r.bufferView=n.index;break}case b.DataURI:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}r.uri=we(a);break;default:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}o.promises.push(J(a,this.options.signal).then(({data:n,type:c})=>{r.uri=n,r.mimeType=c}))}}const i=this.gltf.images.length;return this.gltf.images.push(r),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let s=T.REPEAT,r=T.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":s=T.CLAMP_TO_EDGE,r=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT,r=T.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":r=T.CLAMP_TO_EDGE;break;case"mirror":r=T.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":s=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT}}const i={wrapS:s,wrapT:r};for(let o=0;o{if(u!=="extras"){if(_ instanceof ArrayBuffer){if(be(_))switch(e.output?.image){case b.DataURI:case b.GLB:break;case b.External:default:{const l=`img${a}.png`;return a++,c.set(l,_),l}}switch(e.output?.buffer){case R.DataURI:return Te(_);case R.GLB:if(o)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(o=_);case R.External:default:{const l=`data${i}.bin`;return i++,c.set(l,_),l}}}return _}},n);return e.output?.buffer===R.GLB||e.output?.image===b.GLB?c.set(ee,new N(h,o).buffer):c.set(Fe,h),c}async function Ue(t,e){const s=(await De(t,{output:{buffer:R.GLB,image:b.GLB},jsonSpacing:0,...e})).get(ee);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}async function bt(t,e){const s=new Ce,r=new Ve;return s.addScene(r),r.addNode(new ze(t)),await Ue(s,{origin:t.origin,...e})}export{bt as toBinaryGLTF}; diff --git a/main/assets/gltfexport-Dj6nF2RN-BRI_tJ3X.js b/main/assets/gltfexport-Dj6nF2RN-BRI_tJ3X.js new file mode 100644 index 000000000..76a11adce --- /dev/null +++ b/main/assets/gltfexport-Dj6nF2RN-BRI_tJ3X.js @@ -0,0 +1 @@ +import{dU as S,i8 as v,fj as Q,a3 as re,$ as k,h_ as ie,bj as ne,an as oe,o as Y,d7 as ae,eh as ce,a1 as he}from"./main-C7yV2j71.js";import{O as fe,X as ue}from"./quat-BODLR7mS-Dbd8ftOx.js";import{e as le,n as de,r as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{R as $,_ as O,r as j,S as pe,l as _e}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{m as ge}from"./Mesh-DLzjDUIO-B17ONcIN.js";import{b as Ee}from"./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js";import{I as p,G as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{f as U}from"./resourceUtils-Ds65naCv-DTjz-__I.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./MeshTransform-C--IG09w-QYZk68_K.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js";import"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Cd6y9wum.js";import"./plane-Dt8R0KeE-CdQQbSdq.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-eujRBTUy.js";import"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import"./vec3-BazNroeq-Cdhfm-VN.js";import"./External-D_wl4XAw-Bzqlxz38.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./BufferView-PQoE3GL7-M6q1od-Y.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-DGtcegeJ.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function we(t){const e=q(t);return e!=null?e.toDataURL():""}async function J(t,e){const s=q(t);if(s==null)throw new Y("imageToArrayBuffer","Unsupported image type");const r=Ae(t),i=await new Promise(o=>s.toBlob(o,r));if(k(e),!i)throw new Y("imageToArrayBuffer","Failed to encode image");const a=await i.arrayBuffer();return k(e),{data:a,type:r}}function Ae(t){if(!(t instanceof HTMLImageElement))return"image/png";const e=t.src;if(ae(e)){const s=ce(e);return s?.mediaType==="image/jpeg"?s.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function q(t){if(t instanceof HTMLCanvasElement)return t;if(t instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");return t instanceof HTMLImageElement?s.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&s.putImageData(t,0,0),e}function Te(t){const e=[],s=new Uint8Array(t);for(let r=0;r=4&&i!==y.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),e.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(t){const e=this._data.length;if(this._data.push(t),this._accessorIndex>=0){const s=e%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?t:Math.min(r,t);const i=this._accessorMax[s];this._accessorMax[s]=typeof i!="number"?t:Math.max(i,t)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function t(e,s){return s*Math.ceil(e/s)}return t(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(t,e){switch(this._componentType){case p.BYTE:return new Int8Array(t,e);case p.FLOAT:return new Float32Array(t,e);case p.SHORT:return new Int16Array(t,e);case p.UNSIGNED_BYTE:return new Uint8Array(t,e);case p.UNSIGNED_INT:return new Uint32Array(t,e);case p.UNSIGNED_SHORT:return new Uint16Array(t,e)}}writeOutToBuffer(t,e){this._createTypedArray(t,e).set(this._data)}writeAsync(t){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=t.then(e=>{const s=new Uint8Array(e);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=t;const e=this._numComponentsForDataType;this._accessorMin=new Array(e),this._accessorMax=new Array(e)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const t=this._getElementSize(),e=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/e;if(s%1)throw new Error("An accessor was ended with missing component values");for(let i=0;ithis._finalizedPromiseResolve=t)}async finalize(){const t=this._bufferView,e=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&e.push(this._asyncWritePromise),await Promise.allSettled(e),this._isFinalized=!0,t.byteOffset=this.getByteOffset(),t.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case p.BYTE:case p.UNSIGNED_BYTE:return 1;case p.SHORT:case p.UNSIGNED_SHORT:return 2;case p.UNSIGNED_INT:case p.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case g.SCALAR:return 1;case g.VEC2:return 2;case g.VEC3:return 3;case g.VEC4:case g.MAT2:return 4;case g.MAT3:return 9;case g.MAT4:return 16}}},Z=class{constructor(t){this._gltf=t,this._bufferViews=[],this._isFinalized=!1,t.buffers||(t.buffers=[]),this.index=t.buffers.length;const e={byteLength:-1};t.buffers.push(e),this._buffer=e}addBufferView(t,e,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new xe(this,this._gltf,t,e,s);return this._bufferViews.push(r),r}getByteOffset(t){let e=0;for(const s of this._bufferViews){if(s===t)return e;e+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(t){const e=[];for(const s of this._bufferViews){if(t&&s===t)return e;e.push(s.finalized)}return e}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const t=this._getTotalSize(),e=new ArrayBuffer(t);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(e,s),s+=r.byteSize;return e}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let t=0;for(const e of this._bufferViews)t+=e.byteSize;return t}};function Ie(t,e){if(t.components)for(const s of t.components)s.faces&&s.shading==="smooth"&&Ne(s,e)}function Ne(t,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const s=t.faces,{position:r,normal:i}=e,a=s.length/3;for(let o=0;ohe.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class Le{constructor(e,s){this.options=s,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:s.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const s=this.gltf.extras,r=s.output.buffer===R.GLB||s.output.image===b.GLB;r&&(s.binChunkBuffer=new Z(this.gltf)),e.forEachScene(i=>{this._addScene(i)}),r&&s.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const s={};e.name&&(s.name=e.name),e.forEachNode(r=>{s.nodes||(s.nodes=[]),s.nodes.push(...this._addNodes(r))}),this.gltf.scenes.push(s)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const s={};e.name&&(s.name=e.name);const r=e.translation;$(r,ie)||(s.translation=v(r));const i=e.rotation;ue(i,de)||(s.rotation=me(i));const a=e.scale;$(a,Q)||(s.scale=v(a));const o=this.gltf.nodes.length;if(this.gltf.nodes.push(s),e.mesh&&e.mesh.vertexAttributes.position){const n=this._createMeshes(e.mesh),c=[o];if(n.length===1)this._addMesh(s,n[0]);else for(const h of n){const u={};this._addMesh(u,h),c.push(this.gltf.nodes.length),this.gltf.nodes.push(u)}return c}return e.forEachNode(n=>{s.children||(s.children=[]),s.children.push(...this._addNodes(n))}),[o]}_addMesh(e,s){this.gltf.meshes??=[];const r=this.gltf.meshes.length;this.gltf.meshes.push(s),e.mesh=r}_createMeshes(e){const s=this.gltf.extras,r=s.output.buffer===R.GLB;let i;i=r?s.binChunkBuffer:new Z(this.gltf);const a=this.options.origin,o=e.vertexSpace.clone();o.origin=[a.x,a.y,a.z??0];const n=Ee({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!n)return[];Ie(e,n),Be(n);const{position:c,normal:h,tangent:u}=n,{uv:_,color:l}=e.vertexAttributes,E=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER);let d,m,w,A;h&&(d=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER)),_&&(m=i.addBufferView(p.FLOAT,g.VEC2,y.ARRAY_BUFFER)),u&&(w=i.addBufferView(p.FLOAT,g.VEC4,y.ARRAY_BUFFER)),l&&(A=i.addBufferView(p.UNSIGNED_BYTE,g.VEC4,y.ARRAY_BUFFER)),E.startAccessor("POSITION"),d&&d.startAccessor("NORMAL"),m&&m.startAccessor("TEXCOORD_0"),w&&w.startAccessor("TANGENT"),A&&A.startAccessor("COLOR_0");const te=n.position.length/3;for(let f=0;f0&&e.components[0].faces?(M=i.addBufferView(p.UNSIGNED_INT,g.SCALAR,y.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(M,e.components,D,H,C,V,z,F)):this._addMeshVertexNonIndexed(e.components,D,H,C,V,z,F),E.finalize(),d&&d.finalize(),m&&m.finalize(),w&&w.finalize(),M&&M.finalize(),A&&A.finalize(),r||i.finalize(),D}_addMaterial(e){if(e===null)return;const s=this._materialMap.indexOf(e);if(s!==-1)return s;this.gltf.materials||(this.gltf.materials=[]);const r={};switch(e.alphaMode){case"mask":r.alphaMode=B.MASK;break;case"auto":case"blend":r.alphaMode=B.BLEND}r.alphaCutoff=e.alphaCutoff,e.doubleSided&&(r.doubleSided=e.doubleSided),r.pbrMetallicRoughness={};const i=n=>n**2.1,a=n=>{const c=n.toRgba();return c[0]=i(c[0]/255),c[1]=i(c[1]/255),c[2]=i(c[2]/255),c};if(e.color!=null&&(r.pbrMetallicRoughness.baseColorFactor=a(e.color)),e.colorTexture!=null&&(r.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(r.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof ge){if(e.emissiveTexture!=null&&(r.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const n=a(e.emissiveColor);r.emissiveFactor=[n[0],n[1],n[2]]}e.occlusionTexture!=null&&(r.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(r.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),r.pbrMetallicRoughness.metallicFactor=e.metallic,r.pbrMetallicRoughness.roughnessFactor=e.roughness}else r.pbrMetallicRoughness.metallicFactor=1,r.pbrMetallicRoughness.roughnessFactor=1,P().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const o=this.gltf.materials.length;return this.gltf.materials.push(r),this._materialMap.push(e),o}_createTextureInfo(e,s){const r={index:this._addTexture(e)};return s&&(r.extensions||(r.extensions={}),r.extensions.KHR_texture_transform={scale:s.scale,offset:s.offset,rotation:ne(s.rotation)}),r}_addTexture(e){const s=this.gltf.textures??[];return this.gltf.textures=s,oe(this._textureMap,e,()=>{const r={sampler:this._addSampler(e),source:this._addImage(e)},i=s.length;return s.push(r),i})}_addImage(e){const s=this._imageMap.get(e);if(s!=null)return s;this.gltf.images||(this.gltf.images=[]);const r={};if(e.url)r.uri=e.url;else{const a=e.data;r.extras=a;for(let n=0;n(r.mimeType=u,h));o.promises.push(n.writeAsync(c).then(()=>{n.finalize()}))}r.bufferView=n.index;break}case b.DataURI:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}r.uri=we(a);break;default:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}o.promises.push(J(a,this.options.signal).then(({data:n,type:c})=>{r.uri=n,r.mimeType=c}))}}const i=this.gltf.images.length;return this.gltf.images.push(r),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let s=T.REPEAT,r=T.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":s=T.CLAMP_TO_EDGE,r=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT,r=T.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":r=T.CLAMP_TO_EDGE;break;case"mirror":r=T.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":s=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT}}const i={wrapS:s,wrapT:r};for(let o=0;o{if(u!=="extras"){if(_ instanceof ArrayBuffer){if(be(_))switch(e.output?.image){case b.DataURI:case b.GLB:break;case b.External:default:{const l=`img${a}.png`;return a++,c.set(l,_),l}}switch(e.output?.buffer){case R.DataURI:return Te(_);case R.GLB:if(o)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(o=_);case R.External:default:{const l=`data${i}.bin`;return i++,c.set(l,_),l}}}return _}},n);return e.output?.buffer===R.GLB||e.output?.image===b.GLB?c.set(ee,new N(h,o).buffer):c.set(Fe,h),c}async function Ue(t,e){const s=(await De(t,{output:{buffer:R.GLB,image:b.GLB},jsonSpacing:0,...e})).get(ee);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}async function bt(t,e){const s=new Ce,r=new Ve;return s.addScene(r),r.addNode(new ze(t)),await Ue(s,{origin:t.origin,...e})}export{bt as toBinaryGLTF}; diff --git a/main/assets/groupLayerUtils-D-25JsA_-3fG5R8MN.js b/main/assets/groupLayerUtils-D-25JsA_-3fG5R8MN.js deleted file mode 100644 index 5aa63911f..000000000 --- a/main/assets/groupLayerUtils-D-25JsA_-3fG5R8MN.js +++ /dev/null @@ -1 +0,0 @@ -import{C as l,D as y}from"./utils-BVWK2jiA-Ewzf326n.js";import{i as f}from"./jsonContext-BA8GHqVk-BMETb6sX.js";import{o as v,l as d,u as g,E as s}from"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import{T as i}from"./resourceUtils-BmW6QqlX-Cs99W_og.js";import"./main-BZaw9FpY.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-C_sFWCPe.js";const n="Group Layer",A="group-layer-save",I="group-layer-save-as",a=s.GROUP_LAYER_MAP;function m(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function P(e){return{isValid:v(e,a),errorMessage:`Layer.portalItem.typeKeywords should have '${a}'`}}function u(e,r){return{...f(e,"web-map",!0),initiator:r}}function c(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function R(e,r){r.title||=e.title,d(r,s.METADATA),g(r,a)}async function J(e,r){return l({layer:e,itemType:n,validateLayer:m,validateItem:P,createJSONContext:t=>u(t,e),createItemData:c,errorNamePrefix:A,saveResources:async(t,o)=>(e.sourceIsPortalItem||await t.removeAllResources().catch(()=>{}),i(e.resourceReferences,o))},r)}async function S(e,r,t){return y({layer:e,itemType:n,validateLayer:m,createJSONContext:o=>u(o,e),createItemData:c,errorNamePrefix:I,newItem:r,setItemProperties:R,saveResources:(o,p)=>i(e.resourceReferences,p)},t)}export{J as save,S as saveAs}; diff --git a/main/assets/groupLayerUtils-D-25JsA_-CXHoRLaC.js b/main/assets/groupLayerUtils-D-25JsA_-CXHoRLaC.js new file mode 100644 index 000000000..2eb568000 --- /dev/null +++ b/main/assets/groupLayerUtils-D-25JsA_-CXHoRLaC.js @@ -0,0 +1 @@ +import{C as l,D as y}from"./utils-BVWK2jiA-D8rVYIEJ.js";import{i as f}from"./jsonContext-BA8GHqVk-DpBf0bCt.js";import{o as v,l as d,u as g,E as s}from"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import{T as i}from"./resourceUtils-BmW6QqlX-CP-OW4gT.js";import"./main-C7yV2j71.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-Bu5Czfos.js";const n="Group Layer",A="group-layer-save",I="group-layer-save-as",a=s.GROUP_LAYER_MAP;function m(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function P(e){return{isValid:v(e,a),errorMessage:`Layer.portalItem.typeKeywords should have '${a}'`}}function u(e,r){return{...f(e,"web-map",!0),initiator:r}}function c(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function R(e,r){r.title||=e.title,d(r,s.METADATA),g(r,a)}async function J(e,r){return l({layer:e,itemType:n,validateLayer:m,validateItem:P,createJSONContext:t=>u(t,e),createItemData:c,errorNamePrefix:A,saveResources:async(t,o)=>(e.sourceIsPortalItem||await t.removeAllResources().catch(()=>{}),i(e.resourceReferences,o))},r)}async function S(e,r,t){return y({layer:e,itemType:n,validateLayer:m,createJSONContext:o=>u(o,e),createItemData:c,errorNamePrefix:I,newItem:r,setItemProperties:R,saveResources:(o,p)=>i(e.resourceReferences,p)},t)}export{J as save,S as saveAs}; diff --git a/main/assets/grouping-RwmXkHDc-CUd3AkxY.js b/main/assets/grouping-RwmXkHDc-CUd3AkxY.js deleted file mode 100644 index b1dabe1f6..000000000 --- a/main/assets/grouping-RwmXkHDc-CUd3AkxY.js +++ /dev/null @@ -1 +0,0 @@ -import{hm as o}from"./main-BZaw9FpY.js";function i(e,r){let t;if(typeof e=="string")t=o(e+`-seed(${r})`);else{let n=12;t=e^r;do t=107*(t>>8^t)+n|0;while(--n!=0)}return(1+t/(1<<31))/2}function c(e){return Math.floor(i(e,f)*l)}const f=53290320,l=10;export{i,c as r}; diff --git a/main/assets/grouping-RwmXkHDc-Cfuv9DrK.js b/main/assets/grouping-RwmXkHDc-Cfuv9DrK.js new file mode 100644 index 000000000..b2e505dec --- /dev/null +++ b/main/assets/grouping-RwmXkHDc-Cfuv9DrK.js @@ -0,0 +1 @@ +import{hm as o}from"./main-C7yV2j71.js";function i(e,r){let t;if(typeof e=="string")t=o(e+`-seed(${r})`);else{let n=12;t=e^r;do t=107*(t>>8^t)+n|0;while(--n!=0)}return(1+t/(1<<31))/2}function c(e){return Math.floor(i(e,f)*l)}const f=53290320,l=10;export{i,c as r}; diff --git a/main/assets/header-BRE2xzQs-DV0AigoW.js b/main/assets/header-BRE2xzQs-DV0AigoW.js new file mode 100644 index 000000000..d8a83da10 --- /dev/null +++ b/main/assets/header-BRE2xzQs-DV0AigoW.js @@ -0,0 +1 @@ +import{c2 as k,fQ as I,c6 as M,c7 as _,c8 as A,c9 as E,cl as G,ca as p,cm as v,cd as e,cn as n,co as c,cf as a,cz as m,cc as o,cr as d,c3 as H,c4 as w}from"./main-C7yV2j71.js";const P={class:"relative legend-header flex align-middle"},j=["content","aria-label"],B=["content","aria-label"],R=k({__name:"header",setup(L){const x=I(),{t:l}=M(),s=_("iApi"),r=A(()=>s.fixture.get("legend")),b=()=>{s.event.emit(w.WIZARD_TOGGLE)},y=()=>{try{return s.fixture.exists("wizard")}catch{return!1}},z=()=>{s.event.emit(w.REORDER_TOGGLE)},C=()=>{try{return s.fixture.exists("layer-reorder")}catch{return!1}},i=u=>x.headerControls.includes(u);return(u,t)=>{const g=E("dropdown-menu"),f=G("tippy");return p(),v("div",P,[e("div",null,[n((p(),v("button",{type:"button",onClick:b,class:"relative mr-auto text-gray-500 hover:text-black",content:a(l)("legend.header.addlayer"),"aria-label":a(l)("legend.header.addlayer")},t[4]||(t[4]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})])],-1)]),8,j)),[[c,y()&&i("wizard")],[f,{placement:"right"}]])]),e("div",null,[n((p(),v("button",{type:"button",onClick:z,class:"relative mr-auto text-gray-500 hover:text-black flex justify-center items-center",content:a(l)("legend.header.reorderlayers"),"aria-label":a(l)("legend.header.reorderlayers")},t[5]||(t[5]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z"})])],-1)]),8,B)),[[c,C()&&i("layerReorder")],[f,{placement:"right"}]])]),t[8]||(t[8]=e("span",{class:"flex-1"},null,-1)),n(m(g,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.groups"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:o(()=>t[6]||(t[6]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})])],-1)])),default:o(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[0]||(t[0]=h=>r.value.expandItems(!0))},d(a(l)("legend.header.groups.expand")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[1]||(t[1]=h=>r.value.expandItems(!1))},d(a(l)("legend.header.groups.collapse")),1)]),_:1},8,["tooltip"]),[[c,i("groupToggle")]]),n(m(g,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.visible"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:o(()=>t[7]||(t[7]=[e("div",{class:"flex p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})])],-1)])),default:o(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[2]||(t[2]=h=>r.value.showItems(!0))},d(a(l)("legend.header.visible.show")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[3]||(t[3]=h=>r.value.showItems(!1))},d(a(l)("legend.header.visible.hide")),1)]),_:1},8,["tooltip"]),[[c,i("visibilityToggle")]])])}}}),O=H(R,[["__scopeId","data-v-e8031c30"]]);export{O as default}; diff --git a/main/assets/header-BRE2xzQs-qEADao5u.js b/main/assets/header-BRE2xzQs-qEADao5u.js deleted file mode 100644 index fac87a2cb..000000000 --- a/main/assets/header-BRE2xzQs-qEADao5u.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as k,fQ as I,c6 as M,c7 as _,c8 as A,c9 as E,cl as G,ca as p,cm as v,cd as e,cn as n,co as c,cf as a,cz as m,cc as o,cr as d,c3 as H,c4 as w}from"./main-BZaw9FpY.js";const P={class:"relative legend-header flex align-middle"},j=["content","aria-label"],B=["content","aria-label"],R=k({__name:"header",setup(L){const x=I(),{t:l}=M(),s=_("iApi"),r=A(()=>s.fixture.get("legend")),b=()=>{s.event.emit(w.WIZARD_TOGGLE)},y=()=>{try{return s.fixture.exists("wizard")}catch{return!1}},z=()=>{s.event.emit(w.REORDER_TOGGLE)},C=()=>{try{return s.fixture.exists("layer-reorder")}catch{return!1}},i=u=>x.headerControls.includes(u);return(u,t)=>{const g=E("dropdown-menu"),f=G("tippy");return p(),v("div",P,[e("div",null,[n((p(),v("button",{type:"button",onClick:b,class:"relative mr-auto text-gray-500 hover:text-black",content:a(l)("legend.header.addlayer"),"aria-label":a(l)("legend.header.addlayer")},t[4]||(t[4]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})])],-1)]),8,j)),[[c,y()&&i("wizard")],[f,{placement:"right"}]])]),e("div",null,[n((p(),v("button",{type:"button",onClick:z,class:"relative mr-auto text-gray-500 hover:text-black flex justify-center items-center",content:a(l)("legend.header.reorderlayers"),"aria-label":a(l)("legend.header.reorderlayers")},t[5]||(t[5]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z"})])],-1)]),8,B)),[[c,C()&&i("layerReorder")],[f,{placement:"right"}]])]),t[8]||(t[8]=e("span",{class:"flex-1"},null,-1)),n(m(g,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.groups"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:o(()=>t[6]||(t[6]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})])],-1)])),default:o(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[0]||(t[0]=h=>r.value.expandItems(!0))},d(a(l)("legend.header.groups.expand")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[1]||(t[1]=h=>r.value.expandItems(!1))},d(a(l)("legend.header.groups.collapse")),1)]),_:1},8,["tooltip"]),[[c,i("groupToggle")]]),n(m(g,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.visible"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:o(()=>t[7]||(t[7]=[e("div",{class:"flex p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})])],-1)])),default:o(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[2]||(t[2]=h=>r.value.showItems(!0))},d(a(l)("legend.header.visible.show")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[3]||(t[3]=h=>r.value.showItems(!1))},d(a(l)("legend.header.visible.hide")),1)]),_:1},8,["tooltip"]),[[c,i("visibilityToggle")]])])}}}),O=H(R,[["__scopeId","data-v-e8031c30"]]);export{O as default}; diff --git a/main/assets/heatmapUtils-seiMkkkR-BSMLb7yQ.js b/main/assets/heatmapUtils-seiMkkkR-BSMLb7yQ.js new file mode 100644 index 000000000..bb39defe0 --- /dev/null +++ b/main/assets/heatmapUtils-seiMkkkR-BSMLb7yQ.js @@ -0,0 +1 @@ +import{f3 as u,f4 as l,ae as m}from"./main-C7yV2j71.js";import{A as p}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as A}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";const f=2.4;function g(o){return u(o*f)}function x(o){return l(o)/f}function h(o,n,i,a){let{color:c,ratio:e}=n,{color:r,ratio:t}=i;t===e&&(t===1?e-=1e-6:t+=1e-6);const s=m((a-e)/(t-e),0,1);p(o,c.toArray(),r.toArray(),s)}function P(o){const n=new Uint8ClampedArray(2048);if(o=o.filter(({ratio:r})=>r>=0&&r<=1).sort((r,t)=>r.ratio-t.ratio).map(({color:r,ratio:t})=>({color:r,ratio:Math.max(t,.001)})),o.length<1)return n;let i=o[0],a=o[0],c=1;const e=A();for(let r=0;r<512;r++){const t=(r+.5)/512;for(;t>a.ratio&&c1?0:3/(Math.PI*i**2)*(1-a**2)**2}function w(o){return typeof o=="function"?o:o?n=>+n[o]:()=>1}export{q as A,w as M,f as c,x as d,P as x,g as y}; diff --git a/main/assets/heatmapUtils-seiMkkkR-D9lAE87R.js b/main/assets/heatmapUtils-seiMkkkR-D9lAE87R.js deleted file mode 100644 index 6e848130f..000000000 --- a/main/assets/heatmapUtils-seiMkkkR-D9lAE87R.js +++ /dev/null @@ -1 +0,0 @@ -import{f3 as u,f4 as l,ae as m}from"./main-BZaw9FpY.js";import{A as p}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as A}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";const f=2.4;function g(o){return u(o*f)}function x(o){return l(o)/f}function h(o,n,i,a){let{color:c,ratio:e}=n,{color:r,ratio:t}=i;t===e&&(t===1?e-=1e-6:t+=1e-6);const s=m((a-e)/(t-e),0,1);p(o,c.toArray(),r.toArray(),s)}function P(o){const n=new Uint8ClampedArray(2048);if(o=o.filter(({ratio:r})=>r>=0&&r<=1).sort((r,t)=>r.ratio-t.ratio).map(({color:r,ratio:t})=>({color:r,ratio:Math.max(t,.001)})),o.length<1)return n;let i=o[0],a=o[0],c=1;const e=A();for(let r=0;r<512;r++){const t=(r+.5)/512;for(;t>a.ratio&&c1?0:3/(Math.PI*i**2)*(1-a**2)**2}function w(o){return typeof o=="function"?o:o?n=>+n[o]:()=>1}export{q as A,w as M,f as c,x as d,P as x,g as y}; diff --git a/main/assets/hydrated-CplJC1Fs-CV-sFImk.js b/main/assets/hydrated-CplJC1Fs-CV-sFImk.js deleted file mode 100644 index 1a6e9c9c2..000000000 --- a/main/assets/hydrated-CplJC1Fs-CV-sFImk.js +++ /dev/null @@ -1 +0,0 @@ -import{w as r,l as c,m as h,G as x,n as m}from"./main-BZaw9FpY.js";const P={convertToGEGeometry:p,exportPoint:g,exportPolygon:l,exportPolyline:u,exportMultipoint:f,exportExtent:M};function p(e,t){if(t==null)return null;let a="cache"in t?t.cache._geVersion:void 0;return a==null&&(a=e.convertJSONToGeometry(t),"cache"in t&&(t.cache._geVersion=a)),a}function g(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new r({x:e.getPointX(t),y:e.getPointY(t),spatialReference:a});return o&&(s.z=e.getPointZ(t)),n&&(s.m=e.getPointM(t)),s.cache._geVersion=t,s}function l(e,t,a){const o=new c({rings:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function u(e,t,a){const o=new h({paths:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function f(e,t,a){const o=new x({hasZ:e.hasZ(t),hasM:e.hasM(t),points:e.exportPoints(t),spatialReference:a});return o.cache._geVersion=t,o}function M(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new m({xmin:e.getXMin(t),ymin:e.getYMin(t),xmax:e.getXMax(t),ymax:e.getYMax(t),spatialReference:a});if(o){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(n){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s.cache._geVersion=t,s}export{P as hydratedAdapter}; diff --git a/main/assets/hydrated-CplJC1Fs-wGAJYB2w.js b/main/assets/hydrated-CplJC1Fs-wGAJYB2w.js new file mode 100644 index 000000000..4d6e68c18 --- /dev/null +++ b/main/assets/hydrated-CplJC1Fs-wGAJYB2w.js @@ -0,0 +1 @@ +import{w as r,l as c,m as h,G as x,n as m}from"./main-C7yV2j71.js";const P={convertToGEGeometry:p,exportPoint:g,exportPolygon:l,exportPolyline:u,exportMultipoint:f,exportExtent:M};function p(e,t){if(t==null)return null;let a="cache"in t?t.cache._geVersion:void 0;return a==null&&(a=e.convertJSONToGeometry(t),"cache"in t&&(t.cache._geVersion=a)),a}function g(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new r({x:e.getPointX(t),y:e.getPointY(t),spatialReference:a});return o&&(s.z=e.getPointZ(t)),n&&(s.m=e.getPointM(t)),s.cache._geVersion=t,s}function l(e,t,a){const o=new c({rings:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function u(e,t,a){const o=new h({paths:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function f(e,t,a){const o=new x({hasZ:e.hasZ(t),hasM:e.hasM(t),points:e.exportPoints(t),spatialReference:a});return o.cache._geVersion=t,o}function M(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new m({xmin:e.getXMin(t),ymin:e.getYMin(t),xmax:e.getXMax(t),ymax:e.getYMax(t),spatialReference:a});if(o){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(n){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s.cache._geVersion=t,s}export{P as hydratedAdapter}; diff --git a/main/assets/icon-BXFbBbop-Du8Zws1L.js b/main/assets/icon-BXFbBbop-Du8Zws1L.js new file mode 100644 index 000000000..e8fdd00be --- /dev/null +++ b/main/assets/icon-BXFbBbop-Du8Zws1L.js @@ -0,0 +1 @@ +import{p as m,b as v,a as l,D as x,c as g,M as y}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{p as w,A as z}from"./dom-N58V0tYi-DBU3jlah.js";import{c as D}from"./observers-BigwqTsw-Du14S4xc.js";const k={icon:"icon",flipRtl:"flip-rtl"},p={},h={},b={s:16,m:24,l:32};function d({icon:t,scale:i}){const s=b[i],e=I(t),n=e.charAt(e.length-1)==="F";return`${n?e.substring(0,e.length-1):e}${s}${n?"F":""}`}async function $(t){const i=d(t),s=u(i);if(s)return s;h[i]||(h[i]=fetch(y(`./assets/icon/${i}.json`)).then(n=>n.json()).catch(()=>(console.error(`"${i}" is not a valid calcite-ui-icon name`),"")));const e=await h[i];return p[i]=e,e}function O(t){return u(d(t))}function u(t){return p[t]}function I(t){const i=!isNaN(Number(t.charAt(0))),s=t.split("-");if(s.length>0){const e=/[a-z]/i;t=s.map((n,r)=>n.replace(e,function(c,a){return r===0&&a===0?c:c.toUpperCase()})).join("")}return i?`i${t}`:t}const P=":host{display:inline-flex;color:var(--calcite-icon-color, var(--calcite-ui-icon-color, currentColor))}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",C=P,E=m(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.visible||this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}render(){const{el:t,flipRtl:i,pathData:s,scale:e,textLabel:n}=this,r=w(t),c=b[e],a=!!n,f=[].concat(s||"");return l(x,{key:"724265acdc6fb528bf7b25d7ec445c73a63f4c8e","aria-hidden":z(!a),"aria-label":a?n:null,role:a?"img":null},l("svg",{key:"864ee2d80bebd282543ba5d94c57f84b48a6204d","aria-hidden":"true",class:{[k.flipRtl]:r==="rtl"&&i,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${c} ${c}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},f.map(o=>typeof o=="string"?l("path",{d:o}):l("path",{d:o.d,opacity:"opacity"in o?o.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:i,visible:s}=this;if(!g()||!t||!s)return;const e={icon:t,scale:i},n=O(e)||await $(e);t===this.icon&&(this.pathData=n)}waitUntilVisible(t){if(this.intersectionObserver=D("intersection",i=>{i.forEach(s=>{s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return C}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]},void 0,{icon:["loadIconPathData"],scale:["loadIconPathData"]}]);function R(){typeof customElements>"u"||["calcite-icon"].forEach(t=>{switch(t){case"calcite-icon":customElements.get(t)||customElements.define(t,E);break}})}R();export{E as f,R as m}; diff --git a/main/assets/icon-BXFbBbop-O5hL8B42.js b/main/assets/icon-BXFbBbop-O5hL8B42.js deleted file mode 100644 index 26bc6f996..000000000 --- a/main/assets/icon-BXFbBbop-O5hL8B42.js +++ /dev/null @@ -1 +0,0 @@ -import{p as m,b as v,a as l,D as x,c as g,M as y}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{p as w,A as z}from"./dom-N58V0tYi-DBU3jlah.js";import{c as D}from"./observers-BigwqTsw-DJJPVpPW.js";const k={icon:"icon",flipRtl:"flip-rtl"},p={},h={},b={s:16,m:24,l:32};function d({icon:t,scale:i}){const s=b[i],e=I(t),n=e.charAt(e.length-1)==="F";return`${n?e.substring(0,e.length-1):e}${s}${n?"F":""}`}async function $(t){const i=d(t),s=u(i);if(s)return s;h[i]||(h[i]=fetch(y(`./assets/icon/${i}.json`)).then(n=>n.json()).catch(()=>(console.error(`"${i}" is not a valid calcite-ui-icon name`),"")));const e=await h[i];return p[i]=e,e}function O(t){return u(d(t))}function u(t){return p[t]}function I(t){const i=!isNaN(Number(t.charAt(0))),s=t.split("-");if(s.length>0){const e=/[a-z]/i;t=s.map((n,r)=>n.replace(e,function(c,a){return r===0&&a===0?c:c.toUpperCase()})).join("")}return i?`i${t}`:t}const P=":host{display:inline-flex;color:var(--calcite-icon-color, var(--calcite-ui-icon-color, currentColor))}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",C=P,E=m(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.visible||this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}render(){const{el:t,flipRtl:i,pathData:s,scale:e,textLabel:n}=this,r=w(t),c=b[e],a=!!n,f=[].concat(s||"");return l(x,{key:"724265acdc6fb528bf7b25d7ec445c73a63f4c8e","aria-hidden":z(!a),"aria-label":a?n:null,role:a?"img":null},l("svg",{key:"864ee2d80bebd282543ba5d94c57f84b48a6204d","aria-hidden":"true",class:{[k.flipRtl]:r==="rtl"&&i,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${c} ${c}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},f.map(o=>typeof o=="string"?l("path",{d:o}):l("path",{d:o.d,opacity:"opacity"in o?o.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:i,visible:s}=this;if(!g()||!t||!s)return;const e={icon:t,scale:i},n=O(e)||await $(e);t===this.icon&&(this.pathData=n)}waitUntilVisible(t){if(this.intersectionObserver=D("intersection",i=>{i.forEach(s=>{s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return C}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]},void 0,{icon:["loadIconPathData"],scale:["loadIconPathData"]}]);function R(){typeof customElements>"u"||["calcite-icon"].forEach(t=>{switch(t){case"calcite-icon":customElements.get(t)||customElements.define(t,E);break}})}R();export{E as f,R as m}; diff --git a/main/assets/imageBitmapUtils-DA36kg39-BPA5qQx5.js b/main/assets/imageBitmapUtils-DA36kg39-BPA5qQx5.js new file mode 100644 index 000000000..3ac9eb32e --- /dev/null +++ b/main/assets/imageBitmapUtils-DA36kg39-BPA5qQx5.js @@ -0,0 +1 @@ +import{o as c,$ as l}from"./main-C7yV2j71.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new c("request:server",`Unable to load ${e}`,{url:e,error:o})}return l(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(i){throw new c("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:i,level:e,row:t,col:r})}return l(o),n}export{u as i,w as u}; diff --git a/main/assets/imageBitmapUtils-DA36kg39-CBVFUZAU.js b/main/assets/imageBitmapUtils-DA36kg39-CBVFUZAU.js deleted file mode 100644 index bbe37df56..000000000 --- a/main/assets/imageBitmapUtils-DA36kg39-CBVFUZAU.js +++ /dev/null @@ -1 +0,0 @@ -import{o as c,$ as l}from"./main-BZaw9FpY.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new c("request:server",`Unable to load ${e}`,{url:e,error:o})}return l(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(i){throw new c("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:i,level:e,row:t,col:r})}return l(o),n}export{u as i,w as u}; diff --git a/main/assets/imageUtils-BA2D6Uf1-BIs7TUww.js b/main/assets/imageUtils-BA2D6Uf1-BIs7TUww.js deleted file mode 100644 index 33b1325f6..000000000 --- a/main/assets/imageUtils-BA2D6Uf1-BIs7TUww.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./gif-BZzSowd2-XnWuwdXp.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./apng-DuERAVke-qB22-3s6.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as u,eh as d,ei as w,f,aU as p,o as y}from"./main-BZaw9FpY.js";let r=null,o=!0;function T(a,e,t){if(!a||!e)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e)}catch{o=!1}return m(a,e,t)}function E(a,e,t,n){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e,t)}catch{o=!1}const i=m(e,t,n);return i.data.set(a,0),i}function g(){return r||(r=document.createElement("canvas"),r.width=1,r.height=1),r}function m(a,e,t){return t||(t=g()),t.getContext("2d").createImageData(a,e)}async function h(a,e){const t=window.URL.createObjectURL(a);try{const{data:n}=await f(t,{...e,responseType:"image"});return n}catch(n){throw p(n)?n:new y("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function I(a,e){const{arrayBuffer:t,mediaType:n}=await l(a,e),i=n==="image/png";if(n==="image/gif"){const{isAnimatedGIF:c,parseGif:s}=await u(()=>import("./gif-BZzSowd2-XnWuwdXp.js"),__vite__mapDeps([0,1,2]),import.meta.url);if(c(t))return s(t,e)}if(i){const{isAnimatedPNG:c,parseApng:s}=await u(()=>import("./apng-DuERAVke-qB22-3s6.js"),__vite__mapDeps([3,4,1,2]),import.meta.url);if(c(t))return s(t,e)}return h(new Blob([t],{type:n}),e)}async function l(a,e){const t=d(a);if(t?.isBase64)return{arrayBuffer:w(t.data),mediaType:t.mediaType};const n=await f(a,{responseType:"array-buffer",...e});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}export{I as T,E as g,T as y}; diff --git a/main/assets/imageUtils-BA2D6Uf1-DyozB2y5.js b/main/assets/imageUtils-BA2D6Uf1-DyozB2y5.js new file mode 100644 index 000000000..1d866302b --- /dev/null +++ b/main/assets/imageUtils-BA2D6Uf1-DyozB2y5.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./gif-BZzSowd2-CDmnzkgh.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./apng-DuERAVke-DjvWOkXS.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{_ as u,eh as d,ei as w,f,aU as p,o as y}from"./main-C7yV2j71.js";let r=null,o=!0;function T(a,e,t){if(!a||!e)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e)}catch{o=!1}return m(a,e,t)}function E(a,e,t,n){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e,t)}catch{o=!1}const i=m(e,t,n);return i.data.set(a,0),i}function g(){return r||(r=document.createElement("canvas"),r.width=1,r.height=1),r}function m(a,e,t){return t||(t=g()),t.getContext("2d").createImageData(a,e)}async function h(a,e){const t=window.URL.createObjectURL(a);try{const{data:n}=await f(t,{...e,responseType:"image"});return n}catch(n){throw p(n)?n:new y("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function I(a,e){const{arrayBuffer:t,mediaType:n}=await l(a,e),i=n==="image/png";if(n==="image/gif"){const{isAnimatedGIF:c,parseGif:s}=await u(()=>import("./gif-BZzSowd2-CDmnzkgh.js"),__vite__mapDeps([0,1,2]),import.meta.url);if(c(t))return s(t,e)}if(i){const{isAnimatedPNG:c,parseApng:s}=await u(()=>import("./apng-DuERAVke-DjvWOkXS.js"),__vite__mapDeps([3,4,1,2]),import.meta.url);if(c(t))return s(t,e)}return h(new Blob([t],{type:n}),e)}async function l(a,e){const t=d(a);if(t?.isBase64)return{arrayBuffer:w(t.data),mediaType:t.mediaType};const n=await f(a,{responseType:"array-buffer",...e});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}export{I as T,E as g,T as y}; diff --git a/main/assets/imageUtils-Co-ELErj-Cnx9scTS.js b/main/assets/imageUtils-Co-ELErj-Cnx9scTS.js new file mode 100644 index 000000000..ed4642911 --- /dev/null +++ b/main/assets/imageUtils-Co-ELErj-Cnx9scTS.js @@ -0,0 +1 @@ +import{v as V,i as y,bh as I}from"./main-C7yV2j71.js";import{E as m,e as c}from"./MapView-BGOJJ8ch-CG2YDFKt.js";import{I as M}from"./Bitmap-CcqmzvfR-C92VuEM3.js";import{s as T,K as C}from"./WGLContainer-LxgEo4I_-BLj3WxOd.js";import{h as P}from"./TileContainer-D48pXXgL-DSah9A2g.js";let A=class extends C{constructor(e,t,r,s,i,n,o=null){super(e,t,r,s,i,n),this.bitmap=new M(o),this.bitmap.coordScale=[i,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:c(),tileMat3:c()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},F=class extends P{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this.tileInfoView.getTileBounds(I(),e),r=this.tileInfoView.getTileResolution(e.level),[s,i]=this.tileInfoView.tileInfo.size;return new A(e,r,t[0],t[3],s,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[T.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:m.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===m.MAP&&super.doRender(e)}};const O=e=>{let t=class extends e{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new F(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren(),this._bitmapView=null}};return t=V([y("esri.views.2d.layers.BitmapTileLayerView2D")],t),t};function L(e){return e instanceof HTMLImageElement?e.naturalWidth:e.width}function _(e){return e instanceof HTMLImageElement?e.naturalHeight:e.height}function z(e,t,r,s){if(r.level===s.level)return t;const i=e.tileInfo.size,n=e.getTileResolution(r.level),o=e.getTileResolution(s.level);let a=e.getLODInfoAt(s.level);const p=a.getXForColumn(s.col),u=a.getYForRow(s.row);a=e.getLODInfoAt(r.level);const f=a.getXForColumn(r.col),b=a.getYForRow(r.row),l=L(t)/i[0],h=_(t)/i[1],w=Math.round(l*((p-f)/n)),g=Math.round(h*(-(u-b)/n)),R=Math.round(l*i[0]*(o/n)),v=Math.round(h*i[1]*(o/n)),d=x(i);return d.getContext("2d").drawImage(t,w,g,R,v,0,0,i[0],i[1]),d}function x(e){const t=document.createElement("canvas");return[t.width,t.height]=e,t}export{z as D,O as L,x as p}; diff --git a/main/assets/imageUtils-Co-ELErj-CxjujewR.js b/main/assets/imageUtils-Co-ELErj-CxjujewR.js deleted file mode 100644 index 8be0cfc48..000000000 --- a/main/assets/imageUtils-Co-ELErj-CxjujewR.js +++ /dev/null @@ -1 +0,0 @@ -import{v as V,i as y,bh as I}from"./main-BZaw9FpY.js";import{E as m,e as c}from"./MapView-BGOJJ8ch-Dom5daUl.js";import{I as M}from"./Bitmap-CcqmzvfR-Cl_blWW9.js";import{s as T,K as C}from"./WGLContainer-LxgEo4I_-DOcf4AGd.js";import{h as P}from"./TileContainer-D48pXXgL-DNbVOEpu.js";let A=class extends C{constructor(e,t,r,s,i,n,o=null){super(e,t,r,s,i,n),this.bitmap=new M(o),this.bitmap.coordScale=[i,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:c(),tileMat3:c()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},F=class extends P{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this.tileInfoView.getTileBounds(I(),e),r=this.tileInfoView.getTileResolution(e.level),[s,i]=this.tileInfoView.tileInfo.size;return new A(e,r,t[0],t[3],s,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[T.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:m.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===m.MAP&&super.doRender(e)}};const O=e=>{let t=class extends e{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new F(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren(),this._bitmapView=null}};return t=V([y("esri.views.2d.layers.BitmapTileLayerView2D")],t),t};function L(e){return e instanceof HTMLImageElement?e.naturalWidth:e.width}function _(e){return e instanceof HTMLImageElement?e.naturalHeight:e.height}function z(e,t,r,s){if(r.level===s.level)return t;const i=e.tileInfo.size,n=e.getTileResolution(r.level),o=e.getTileResolution(s.level);let a=e.getLODInfoAt(s.level);const p=a.getXForColumn(s.col),u=a.getYForRow(s.row);a=e.getLODInfoAt(r.level);const f=a.getXForColumn(r.col),b=a.getYForRow(r.row),l=L(t)/i[0],h=_(t)/i[1],w=Math.round(l*((p-f)/n)),g=Math.round(h*(-(u-b)/n)),R=Math.round(l*i[0]*(o/n)),v=Math.round(h*i[1]*(o/n)),d=x(i);return d.getContext("2d").drawImage(t,w,g,R,v,0,0,i[0],i[1]),d}function x(e){const t=document.createElement("canvas");return[t.width,t.height]=e,t}export{z as D,O as L,x as p}; diff --git a/main/assets/imageryUtils-6MVSqijr-DkiL-1bk.js b/main/assets/imageryUtils-6MVSqijr-DkiL-1bk.js deleted file mode 100644 index f7229e17e..000000000 --- a/main/assets/imageryUtils-6MVSqijr-DkiL-1bk.js +++ /dev/null @@ -1 +0,0 @@ -import{C as y,D as n}from"./utils-BVWK2jiA-Ewzf326n.js";import{S as p,l as c,L as u,E as i}from"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./main-BZaw9FpY.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./jsonContext-BA8GHqVk-BMETb6sX.js";import"./saveUtils-CIYk-dsQ-BCXbqzbn.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";const s="Image Service",g="imagery-layer-save",v="imagery-layer-save-as",f="imagery-tile-layer-save",d="imagery-tile-layer-save-as";function m(t){if(t.type==="imagery")return{isValid:!0};const{raster:e}=t,r=e?.datasetFormat==="Function"?e.primaryRasters?.rasters[0]:e;return{isValid:r?.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function o(t){const e=t.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function T(t,e){const{parsedUrl:r,title:a,fullExtent:l}=t;e.url=r.path,e.title||=a;try{e.extent=await p(l)}catch{e.extent=void 0}c(e,i.METADATA),u(e,i.TILED_IMAGERY,t.type==="imagery-tile")}async function S(t,e){const r=t.type==="imagery"?g:f;return y({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:r},e)}async function F(t,e,r){const a=t.type==="imagery"?v:d;return n({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:a,newItem:e,setItemProperties:T},r)}export{S as save,F as saveAs}; diff --git a/main/assets/imageryUtils-6MVSqijr-wws7sSH-.js b/main/assets/imageryUtils-6MVSqijr-wws7sSH-.js new file mode 100644 index 000000000..f7cb2ba7b --- /dev/null +++ b/main/assets/imageryUtils-6MVSqijr-wws7sSH-.js @@ -0,0 +1 @@ +import{C as y,D as n}from"./utils-BVWK2jiA-D8rVYIEJ.js";import{S as p,l as c,L as u,E as i}from"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./main-C7yV2j71.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./jsonContext-BA8GHqVk-DpBf0bCt.js";import"./saveUtils-CIYk-dsQ-h9O9-CBJ.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";const s="Image Service",g="imagery-layer-save",v="imagery-layer-save-as",f="imagery-tile-layer-save",d="imagery-tile-layer-save-as";function m(t){if(t.type==="imagery")return{isValid:!0};const{raster:e}=t,r=e?.datasetFormat==="Function"?e.primaryRasters?.rasters[0]:e;return{isValid:r?.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function o(t){const e=t.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function T(t,e){const{parsedUrl:r,title:a,fullExtent:l}=t;e.url=r.path,e.title||=a;try{e.extent=await p(l)}catch{e.extent=void 0}c(e,i.METADATA),u(e,i.TILED_IMAGERY,t.type==="imagery-tile")}async function S(t,e){const r=t.type==="imagery"?g:f;return y({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:r},e)}async function F(t,e,r){const a=t.type==="imagery"?v:d;return n({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:a,newItem:e,setItemProperties:T},r)}export{S as save,F as saveAs}; diff --git a/main/assets/index--i98kM5n-BVA2E5cn.js b/main/assets/index--i98kM5n-BVA2E5cn.js new file mode 100644 index 000000000..ef858e8bd --- /dev/null +++ b/main/assets/index--i98kM5n-BVA2E5cn.js @@ -0,0 +1 @@ +import{a as o}from"./fabric-Df28hv38-D454t-UP.js";import{cB as s}from"./main-C7yV2j71.js";class p extends s{get config(){return this.$iApi.fixture.get("export").config?.map}async make(t){const e=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),a=new Image;a.src=e.dataUrl;const r=await new Promise(i=>a.onload=()=>i(a));return new o.fabric.Image(r,t)}}export{p as default}; diff --git a/main/assets/index--i98kM5n-ftbcqF2Z.js b/main/assets/index--i98kM5n-ftbcqF2Z.js deleted file mode 100644 index a4486f58c..000000000 --- a/main/assets/index--i98kM5n-ftbcqF2Z.js +++ /dev/null @@ -1 +0,0 @@ -import{a as o}from"./fabric-Df28hv38-J5FIMqqY.js";import{cB as s}from"./main-BZaw9FpY.js";class p extends s{get config(){return this.$iApi.fixture.get("export").config?.map}async make(t){const e=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),a=new Image;a.src=e.dataUrl;const r=await new Promise(i=>a.onload=()=>i(a));return new o.fabric.Image(r,t)}}export{p as default}; diff --git a/main/assets/index-5nGe0Bgx-CqhLB4Qc.js b/main/assets/index-5nGe0Bgx-CqhLB4Qc.js new file mode 100644 index 000000000..acf70bc35 --- /dev/null +++ b/main/assets/index-5nGe0Bgx-CqhLB4Qc.js @@ -0,0 +1,10 @@ +import{c2 as z,fX as w,cB as N,fN as R,c7 as S,ch as s,c8 as b,fY as W,cj as Y,c4 as q,fZ as B,ck as T,fB as G,f_ as X,fK as F,f$ as O,g0 as j,ca as V,cm as D,cd as K,fF as Z}from"./main-C7yV2j71.js";class J extends N{_parseConfig(t){const a=w(this.$vApp.$pinia);t&&(a.arrowIcon=t.arrowIcon,a.poleIcon=t.poleIcon)}get config(){return super.config}}const U="path",Q=12,ee="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z",te="#ff0000ff",ae=5,se=6,ie={style:U,size:Q,path:ee,colour:te,xOffset:ae,yOffset:se},oe=["innerHTML"],re=z({__name:"northarrow",setup(y){const t=R(),a=w(),e=S("iApi"),n=s(),M=b(()=>a.arrowIcon),$=b(()=>a.poleIcon),c=s(0),r=s(0),h=s(!1),k=s(` + + + + + + + + + `),A=s(!1),x=W([]),I=s([]);let P;Y(()=>{const i=t.config.map;I.value=i.tileSchemas,M?.value&&(k.value=``),e.geo.map.esriView?.ready&&C(e.geo.map.getExtent()),x.push(e.event.on(q.MAP_EXTENTCHANGE,B(300,C)))}),T(()=>{x.forEach(i=>e.event.off(i))});const C=async i=>{P=t.activeBasemapConfig;let p;for(const f of I.value)if(P?.tileSchemaId===f.id){p=f?.hasNorthPole;break}const l=e.$vApp.$el.querySelector(".inner-shell"),d=n.value.querySelector(".northarrow").getBoundingClientRect().width,v=e.$vApp.$el.querySelector(".appbar")?.clientWidth||0,_=i.sr;if(p||typeof p>"u"&&!_.isWebMercator()){const f=new G("pole",{x:-96,y:90}),E=await e.geo.proj.projectGeometry(_,f),u=e.geo.map.mapPointToScreenPoint(E);if(u.screenY<0){h.value=!0;const o={screenX:l.clientWidth/2,screenY:l.clientHeight};c.value=Math.atan((u.screenX-o.screenX)/(o.screenY-u.screenY))*180/Math.PI,r.value=l.clientWidth/2+l.clientHeight*Math.tan(c.value*Math.PI/180)-d/2,r.value=Math.max(v-d/2,Math.min(e.geo.map.getPixelWidth()-d/2,r.value))}else if(h.value=!1,!A.value){A.value=!0;let o;$.value?o={style:X.ICON,icon:$.value,height:16.5,width:16.5}:o=ie;const g=e.geo.layer.createLayer({id:m,layerType:F.GRAPHIC,url:"",cosmetic:!0});e.geo.map.addLayer(g),g.loadPromise().then(()=>{const L=new O(E,"northpole"),H=new j(o);L.style=H,g.addGraphic(L)})}}else h.value=!0,c.value=0,r.value=v+(l.clientWidth-v-d)/2};return(i,p)=>(V(),D("div",{class:"absolute transition-all duration-300 ease-out",style:Z({"transform-origin":"top center",transform:`rotate(${c.value}deg)`,left:`${r.value}px`,visibility:h.value?"visible":"hidden"}),ref_key:"el",ref:n},[K("span",{class:"northarrow",innerHTML:k.value},null,8,oe)],4))}}),m="RampPoleMarker";class ne extends J{async added(){this._parseConfig(this.config);const t=this.$vApp.$watch(()=>this.config,n=>this._parseConfig(n)),{destroy:a,el:e}=this.mount(re,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(e.childNodes[0]),this.removed=()=>{t(),this.$iApi.geo.layer.getLayer(m)&&this.$iApi.geo.map.removeLayer(m),w(this.$vApp.$pinia).$reset(),a()}}}export{m as POLE_MARKER_LAYER_ID,ne as default}; diff --git a/main/assets/index-5nGe0Bgx-CtG6tTZq.js b/main/assets/index-5nGe0Bgx-CtG6tTZq.js deleted file mode 100644 index 6123a714b..000000000 --- a/main/assets/index-5nGe0Bgx-CtG6tTZq.js +++ /dev/null @@ -1,10 +0,0 @@ -import{c2 as z,fX as w,cB as N,fN as R,c7 as S,ch as s,c8 as b,fY as W,cj as Y,c4 as q,fZ as B,ck as T,fB as G,f_ as X,fK as F,f$ as O,g0 as j,ca as V,cm as D,cd as K,fF as Z}from"./main-BZaw9FpY.js";class J extends N{_parseConfig(t){const a=w(this.$vApp.$pinia);t&&(a.arrowIcon=t.arrowIcon,a.poleIcon=t.poleIcon)}get config(){return super.config}}const U="path",Q=12,ee="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z",te="#ff0000ff",ae=5,se=6,ie={style:U,size:Q,path:ee,colour:te,xOffset:ae,yOffset:se},oe=["innerHTML"],re=z({__name:"northarrow",setup(y){const t=R(),a=w(),e=S("iApi"),n=s(),M=b(()=>a.arrowIcon),$=b(()=>a.poleIcon),c=s(0),r=s(0),h=s(!1),k=s(` - - - - - - - - - `),A=s(!1),x=W([]),I=s([]);let P;Y(()=>{const i=t.config.map;I.value=i.tileSchemas,M?.value&&(k.value=``),e.geo.map.esriView?.ready&&C(e.geo.map.getExtent()),x.push(e.event.on(q.MAP_EXTENTCHANGE,B(300,C)))}),T(()=>{x.forEach(i=>e.event.off(i))});const C=async i=>{P=t.activeBasemapConfig;let p;for(const f of I.value)if(P?.tileSchemaId===f.id){p=f?.hasNorthPole;break}const l=e.$vApp.$el.querySelector(".inner-shell"),d=n.value.querySelector(".northarrow").getBoundingClientRect().width,v=e.$vApp.$el.querySelector(".appbar")?.clientWidth||0,_=i.sr;if(p||typeof p>"u"&&!_.isWebMercator()){const f=new G("pole",{x:-96,y:90}),E=await e.geo.proj.projectGeometry(_,f),u=e.geo.map.mapPointToScreenPoint(E);if(u.screenY<0){h.value=!0;const o={screenX:l.clientWidth/2,screenY:l.clientHeight};c.value=Math.atan((u.screenX-o.screenX)/(o.screenY-u.screenY))*180/Math.PI,r.value=l.clientWidth/2+l.clientHeight*Math.tan(c.value*Math.PI/180)-d/2,r.value=Math.max(v-d/2,Math.min(e.geo.map.getPixelWidth()-d/2,r.value))}else if(h.value=!1,!A.value){A.value=!0;let o;$.value?o={style:X.ICON,icon:$.value,height:16.5,width:16.5}:o=ie;const g=e.geo.layer.createLayer({id:m,layerType:F.GRAPHIC,url:"",cosmetic:!0});e.geo.map.addLayer(g),g.loadPromise().then(()=>{const L=new O(E,"northpole"),H=new j(o);L.style=H,g.addGraphic(L)})}}else h.value=!0,c.value=0,r.value=v+(l.clientWidth-v-d)/2};return(i,p)=>(V(),D("div",{class:"absolute transition-all duration-300 ease-out",style:Z({"transform-origin":"top center",transform:`rotate(${c.value}deg)`,left:`${r.value}px`,visibility:h.value?"visible":"hidden"}),ref_key:"el",ref:n},[K("span",{class:"northarrow",innerHTML:k.value},null,8,oe)],4))}}),m="RampPoleMarker";class ne extends J{async added(){this._parseConfig(this.config);const t=this.$vApp.$watch(()=>this.config,n=>this._parseConfig(n)),{destroy:a,el:e}=this.mount(re,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(e.childNodes[0]),this.removed=()=>{t(),this.$iApi.geo.layer.getLayer(m)&&this.$iApi.geo.map.removeLayer(m),w(this.$vApp.$pinia).$reset(),a()}}}export{m as POLE_MARKER_LAYER_ID,ne as default}; diff --git a/main/assets/index-7blUq_oP-BarAXEha.js b/main/assets/index-7blUq_oP-BarAXEha.js deleted file mode 100644 index 511910f66..000000000 --- a/main/assets/index-7blUq_oP-BarAXEha.js +++ /dev/null @@ -1 +0,0 @@ -import{a as i}from"./fabric-Df28hv38-J5FIMqqY.js";import{cB as a}from"./main-BZaw9FpY.js";class f extends a{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(o){const t=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let e=0;e<2;e++){const n=new i.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(t[e].distance,"number")}${t[e].units}`]),{fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:16,top:e*50,left:0,originX:"left",originY:"top"}),s=new i.fabric.Line([0,e===0?30:40,t[e].pixels,e===0?30:40],{stroke:"black",strokeWidth:3});r.push(new i.fabric.Group([s,n]))}return Promise.resolve(new i.fabric.Group(r,o))}}export{f as default}; diff --git a/main/assets/index-7blUq_oP-C1hAWS60.js b/main/assets/index-7blUq_oP-C1hAWS60.js new file mode 100644 index 000000000..6d63518d5 --- /dev/null +++ b/main/assets/index-7blUq_oP-C1hAWS60.js @@ -0,0 +1 @@ +import{a as i}from"./fabric-Df28hv38-D454t-UP.js";import{cB as a}from"./main-C7yV2j71.js";class f extends a{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(o){const t=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let e=0;e<2;e++){const n=new i.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(t[e].distance,"number")}${t[e].units}`]),{fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:16,top:e*50,left:0,originX:"left",originY:"top"}),s=new i.fabric.Line([0,e===0?30:40,t[e].pixels,e===0?30:40],{stroke:"black",strokeWidth:3});r.push(new i.fabric.Group([s,n]))}return Promise.resolve(new i.fabric.Group(r,o))}}export{f as default}; diff --git a/main/assets/index-98it_ulG-C3_-u3sQ.js b/main/assets/index-98it_ulG-C3_-u3sQ.js new file mode 100644 index 000000000..d4f699599 --- /dev/null +++ b/main/assets/index-98it_ulG-C3_-u3sQ.js @@ -0,0 +1 @@ +import{a as o}from"./fabric-Df28hv38-D454t-UP.js";import{cB as k,fB as M,fz as y}from"./main-C7yV2j71.js";class A extends k{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(c){let h=n=>0,s=0;const f='N',t=this.$vApp.$el.querySelector(".inner-shell"),p=this.$iApi.geo.map.getSR();let a=0;if(p.isWebMercator())a=0;else{const n=new M("pole",{x:-96,y:90}),i=await this.$iApi.geo.proj.projectGeometry(p,n),r=this.$iApi.geo.map.mapPointToScreenPoint(i),d={screenX:t.clientWidth/2,screenY:t.clientHeight};a=Math.atan((r.screenX-d.screenX)/(d.screenY-r.screenY))*180/Math.PI;const w=t.clientWidth/2+t.clientHeight*Math.tan(a*Math.PI/180)-50/2,x=Math.round(w/t.clientWidth*100);s=Math.min(Math.max(x,0),100),h=l=>{if(l<0||l>100)throw new Error("Normalized position must be between 0 and 100");const u=t.clientWidth*l/100;return Math.atan((r.screenX-u)/(50/2-r.screenY))*(180/Math.PI)}}const g={top:0,left:0,originX:"center",originY:"center",angle:a},m=[];let e=new o.fabric.Group;return o.fabric.loadSVGFromString(f,()=>{e=new o.fabric.Group(m),e.positionX=s,e.getAngleFromPosition=h},(n,i)=>{m.push(i)}),e.set(y(g,c||{})),Promise.resolve(e)}}export{A as default}; diff --git a/main/assets/index-98it_ulG-wSo8snBa.js b/main/assets/index-98it_ulG-wSo8snBa.js deleted file mode 100644 index bc52e5e83..000000000 --- a/main/assets/index-98it_ulG-wSo8snBa.js +++ /dev/null @@ -1 +0,0 @@ -import{a as o}from"./fabric-Df28hv38-J5FIMqqY.js";import{cB as k,fB as M,fz as y}from"./main-BZaw9FpY.js";class A extends k{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(c){let h=n=>0,s=0;const f='N',t=this.$vApp.$el.querySelector(".inner-shell"),p=this.$iApi.geo.map.getSR();let a=0;if(p.isWebMercator())a=0;else{const n=new M("pole",{x:-96,y:90}),i=await this.$iApi.geo.proj.projectGeometry(p,n),r=this.$iApi.geo.map.mapPointToScreenPoint(i),d={screenX:t.clientWidth/2,screenY:t.clientHeight};a=Math.atan((r.screenX-d.screenX)/(d.screenY-r.screenY))*180/Math.PI;const w=t.clientWidth/2+t.clientHeight*Math.tan(a*Math.PI/180)-50/2,x=Math.round(w/t.clientWidth*100);s=Math.min(Math.max(x,0),100),h=l=>{if(l<0||l>100)throw new Error("Normalized position must be between 0 and 100");const u=t.clientWidth*l/100;return Math.atan((r.screenX-u)/(50/2-r.screenY))*(180/Math.PI)}}const g={top:0,left:0,originX:"center",originY:"center",angle:a},m=[];let e=new o.fabric.Group;return o.fabric.loadSVGFromString(f,()=>{e=new o.fabric.Group(m),e.positionX=s,e.getAngleFromPosition=h},(n,i)=>{m.push(i)}),e.set(y(g,c||{})),Promise.resolve(e)}}export{A as default}; diff --git a/main/assets/index-B0lfXXMz-DhqjpHZu.js b/main/assets/index-B0lfXXMz-DhqjpHZu.js new file mode 100644 index 000000000..fba8303b7 --- /dev/null +++ b/main/assets/index-B0lfXXMz-DhqjpHZu.js @@ -0,0 +1 @@ +import{a as r}from"./fabric-Df28hv38-D454t-UP.js";import{cB as n,fz as s}from"./main-C7yV2j71.js";class m extends n{get config(){return this.$iApi.fixture.get("export").config?.timestamp}make(o){const t=this.config,e={text:new Date().toLocaleString("en-CA"),fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0,left:0,originX:"left"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),a=new r.fabric.Textbox(i.text,i);return Promise.resolve(a)}}export{m as default}; diff --git a/main/assets/index-B0lfXXMz-DzFhF9zr.js b/main/assets/index-B0lfXXMz-DzFhF9zr.js deleted file mode 100644 index 774779123..000000000 --- a/main/assets/index-B0lfXXMz-DzFhF9zr.js +++ /dev/null @@ -1 +0,0 @@ -import{a as r}from"./fabric-Df28hv38-J5FIMqqY.js";import{cB as n,fz as s}from"./main-BZaw9FpY.js";class m extends n{get config(){return this.$iApi.fixture.get("export").config?.timestamp}make(o){const t=this.config,e={text:new Date().toLocaleString("en-CA"),fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0,left:0,originX:"left"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),a=new r.fabric.Textbox(i.text,i);return Promise.resolve(a)}}export{m as default}; diff --git a/main/assets/index-BAU9PUzR-CAchWs54.js b/main/assets/index-BAU9PUzR-CAchWs54.js new file mode 100644 index 000000000..a372dcc77 --- /dev/null +++ b/main/assets/index-BAU9PUzR-CAchWs54.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-x-yg_fPu-Ch2alMId.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); +import{c2 as o,fu as h,_ as c,fw as r,fJ as l,cB as u,c7 as d,c6 as v,c9 as f,ca as g,cb as m,cc as x,cd as s,cf as _,c4 as A}from"./main-C7yV2j71.js";class $ extends u{toggleHelp(e){const t=this.$iApi.panel.get("help");this.$iApi.panel.toggle(t,e)}get config(){return super.config}_parseConfig(e){const t=l(this.$vApp.$pinia);t.location=e?.location??"./help/",this.handlePanelWidths(["help"]),this.handlePanelTeleports(["help"])}}const w=o({__name:"nav-button",setup(i){const e=d("iApi"),{t}=v(),p=()=>e.event.emit(A.HELP_TOGGLE);return(C,n)=>{const a=f("mapnav-button");return g(),m(a,{onClickFunction:p,tooltip:_(t)("help.title")},{default:x(()=>n[0]||(n[0]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[s("path",{d:"M0 0h24v24H0z",fill:"none"}),s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})],-1)])),_:1},8,["tooltip"])}}}),E={en:{"help.title":"Help","help.search":"Search Help","help.section.expand":"Expand section","help.section.collapse":"Collapse section","help.noResults":"Nothing is found. Please try a different search."},fr:{"help.title":"Aide","help.search":"Aide à la recherche","help.section.expand":"Développer une section","help.section.collapse":"Réduire une section","help.noResults":"Aucun résultat. Veuillez essayer une autre recherche."}};class P extends ${added(){this.$iApi.component("help-nav-button",w),this.$iApi.panel.register({help:{screens:{"help-screen":()=>h(c(()=>import("./screen-x-yg_fPu-Ch2alMId.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{"flex-grow":"1","max-width":"750px"},alertName:"help.title"}},{i18n:{messages:E}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("mapnav")&&r(this.$vApp.$pinia).removeItem("help"),l(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("help")}}}export{P as default}; diff --git a/main/assets/index-BAU9PUzR-CeCoKAoi.js b/main/assets/index-BAU9PUzR-CeCoKAoi.js deleted file mode 100644 index 97cd6447a..000000000 --- a/main/assets/index-BAU9PUzR-CeCoKAoi.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-x-yg_fPu-jgspjjII.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); -import{c2 as o,fu as h,_ as c,fw as r,fJ as l,cB as u,c7 as d,c6 as v,c9 as f,ca as g,cb as m,cc as x,cd as s,cf as _,c4 as A}from"./main-BZaw9FpY.js";class $ extends u{toggleHelp(e){const t=this.$iApi.panel.get("help");this.$iApi.panel.toggle(t,e)}get config(){return super.config}_parseConfig(e){const t=l(this.$vApp.$pinia);t.location=e?.location??"./help/",this.handlePanelWidths(["help"]),this.handlePanelTeleports(["help"])}}const w=o({__name:"nav-button",setup(i){const e=d("iApi"),{t}=v(),p=()=>e.event.emit(A.HELP_TOGGLE);return(C,n)=>{const a=f("mapnav-button");return g(),m(a,{onClickFunction:p,tooltip:_(t)("help.title")},{default:x(()=>n[0]||(n[0]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[s("path",{d:"M0 0h24v24H0z",fill:"none"}),s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})],-1)])),_:1},8,["tooltip"])}}}),E={en:{"help.title":"Help","help.search":"Search Help","help.section.expand":"Expand section","help.section.collapse":"Collapse section","help.noResults":"Nothing is found. Please try a different search."},fr:{"help.title":"Aide","help.search":"Aide à la recherche","help.section.expand":"Développer une section","help.section.collapse":"Réduire une section","help.noResults":"Aucun résultat. Veuillez essayer une autre recherche."}};class P extends ${added(){this.$iApi.component("help-nav-button",w),this.$iApi.panel.register({help:{screens:{"help-screen":()=>h(c(()=>import("./screen-x-yg_fPu-jgspjjII.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{"flex-grow":"1","max-width":"750px"},alertName:"help.title"}},{i18n:{messages:E}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("mapnav")&&r(this.$vApp.$pinia).removeItem("help"),l(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("help")}}}export{P as default}; diff --git a/main/assets/index-BCHMro24-DSRXjkAB.js b/main/assets/index-BCHMro24-DSRXjkAB.js deleted file mode 100644 index dfbb5bbd5..000000000 --- a/main/assets/index-BCHMro24-DSRXjkAB.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DOMT-YVI-BLHSGxaA.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./table-state-manager-CQv-OGS1-24xBkGVS.js"])))=>i.map(i=>d[i]); -import{fu as m,_ as u,c5 as x,fI as n,cB as b}from"./main-BZaw9FpY.js";import{a as o}from"./table-state-manager-CQv-OGS1-24xBkGVS.js";class E extends b{gridStore=n(this.$vApp.$pinia);toggleGrid(e,l){const i=this.gridStore.getGridId(e);if(!i){const d=this.getLayerFixtureConfigs();this.gridStore.addGrid({id:e,layerIds:[e],state:new o(d[e]),fieldMap:{}})}const t=this.gridStore.currentId;this.gridStore.currentId=i??e;const s=this.$iApi.panel.get("grid");if(l===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):t!==e||l===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const l=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(i=>{const t=[],{gridId:s,layers:d,fieldMap:p,options:h}=i;d.forEach(r=>{r.sublayers?r.sublayers?.forEach(a=>{t.push(`${r.layerId}-${a}`),delete l[`${r.layerId}-${a}`]}):(t.push(r.layerId),delete l[r.layerId])});const g={};p?.forEach(r=>{r.sources.forEach(a=>{g[a]=r.field})});const f={id:s,layerIds:t,state:new o(h),fieldMap:g};this.gridStore.addGrid(f)}),Object.keys(l).forEach(i=>{const t={id:i,layerIds:[i],state:new o(l[i]),fieldMap:{}};this.gridStore.addGrid(t)})}}const y={en:{"grid.title":"Datatable","grid.alertName":"Grid","grid.splash.error":"Error: Failed to load the layer's data.","grid.splash.loading":"Loading data...","grid.splash.building":"Building table...","grid.splash.cancel":"Cancel","grid.clearAll":"Clear search and filters","grid.layer.loading":"The layer is loading...","grid.label.pinColumns":"Pin columns","grid.label.export":"Export","grid.label.columns":"Hide columns","grid.label.copied":"Copied","grid.label.copy":"Press ctrl + c or double click to copy","grid.label.specialColumn":"Special Column","grid.label.filters.show":"Show filters","grid.label.filters.hide":"Hide filters","grid.label.filters.apply":"Apply filters to map","grid.header.sort.0":"Sort ascending","grid.header.sort.1":"Sort descending","grid.header.sort.2":"Sort default","grid.header.reorder.left":"Move left","grid.header.reorder.right":"Move right","grid.filters.label.global":"Search table","grid.filters.column.label.text":"Search {0}...","grid.filters.clear":"Clear filters","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Max Date","grid.filters.date.min":"Min Date","grid.filters.label.info":"{range} of {total} entries shown","grid.filters.label.filtered":"(filtered from {max} total entries)","grid.filters.label.extent":"Filter by extent","grid.cells.controls":"Use arrow keys to navigate grid cells. Press Tab to proceed","grid.cells.zoom":"Zoom to feature","grid.cells.zoom.zooming":"Zooming...","grid.cells.zoom.error":"Zoom failed","grid.cells.zoom.zoomed":"Zoomed","grid.cells.alert.zoom":"Zoomed into feature","grid.cells.details":"Details","grid.button.title":"Grid"},fr:{"grid.title":"Tableau de données","grid.alertName":"Grille","grid.splash.error":"Erreur : Échec du chargement des données de la couche.","grid.splash.loading":"Chargement des données...","grid.splash.building":"Création du tableau...","grid.splash.cancel":"Annuler","grid.clearAll":"Effacer la recherche et les filtres","grid.layer.loading":"La couche est en cours de téléchargement...","grid.label.pinColumns":"Épingler les colonnes","grid.label.export":"Exporter","grid.label.columns":"Masquer les colonnes","grid.label.copied":"Copié","grid.label.copy":"Appuyez sur Ctrl + C ou double-cliquez pour copier","grid.label.specialColumn":"Colonne spéciale","grid.label.filters.show":"Afficher les filtres","grid.label.filters.hide":"Masquer les filtres","grid.label.filters.apply":"Appliquer les filtres à la carte","grid.header.sort.0":"Tri ascendant","grid.header.sort.1":"Tri descendant","grid.header.sort.2":"Tri par défaut","grid.header.reorder.left":"Déplacer vers la gauche","grid.header.reorder.right":"Déplacer vers la droite","grid.filters.label.global":"Tableau de recherche","grid.filters.column.label.text":"Rechercher {0}...","grid.filters.clear":"Supprimer les filtres","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Date max","grid.filters.date.min":"Date min","grid.filters.label.info":"{range} de {total} saisies affichées","grid.filters.label.filtered":"(filtré à partir d'un total de {max} saisies)","grid.filters.label.extent":"Filtrer par étendue","grid.cells.controls":"Utilisez les flèches pour parcourir les cellules de la grille. Appuyez sur Tab pour continuer","grid.cells.zoom":"Zoom à l'élément","grid.cells.zoom.zooming":"Zoom en cours...","grid.cells.zoom.error":"Échec du zoom","grid.cells.zoom.zoomed":"Zoom terminé","grid.cells.alert.zoom":"Zoom sur la caractéristique","grid.cells.details":"Détails","grid.button.title":"Grille"}};class C extends E{async added(){this.$iApi.panel.register({grid:{screens:{"grid-screen":()=>m(u(()=>import("./screen-DOMT-YVI-BLHSGxaA.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{width:"450px"},controls:{expand:!0},button:{tooltip:"grid.button.title",icon:' '},expanded:!0,alertName:"grid.alertName"}},{i18n:{messages:y}}),this._parseConfig(this.config)}removed(){this.$iApi.fixture.exists("appbar")&&x(this.$vApp.$pinia).removeButton("grid"),n(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("grid")}}export{C as default}; diff --git a/main/assets/index-BCHMro24-DaXV2bZC.js b/main/assets/index-BCHMro24-DaXV2bZC.js new file mode 100644 index 000000000..0bd211c61 --- /dev/null +++ b/main/assets/index-BCHMro24-DaXV2bZC.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DOMT-YVI-nkI6BbEt.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./table-state-manager-CQv-OGS1-24xBkGVS.js"])))=>i.map(i=>d[i]); +import{fu as m,_ as u,c5 as x,fI as n,cB as b}from"./main-C7yV2j71.js";import{a as o}from"./table-state-manager-CQv-OGS1-24xBkGVS.js";class E extends b{gridStore=n(this.$vApp.$pinia);toggleGrid(e,l){const i=this.gridStore.getGridId(e);if(!i){const d=this.getLayerFixtureConfigs();this.gridStore.addGrid({id:e,layerIds:[e],state:new o(d[e]),fieldMap:{}})}const t=this.gridStore.currentId;this.gridStore.currentId=i??e;const s=this.$iApi.panel.get("grid");if(l===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):t!==e||l===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const l=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(i=>{const t=[],{gridId:s,layers:d,fieldMap:p,options:h}=i;d.forEach(r=>{r.sublayers?r.sublayers?.forEach(a=>{t.push(`${r.layerId}-${a}`),delete l[`${r.layerId}-${a}`]}):(t.push(r.layerId),delete l[r.layerId])});const g={};p?.forEach(r=>{r.sources.forEach(a=>{g[a]=r.field})});const f={id:s,layerIds:t,state:new o(h),fieldMap:g};this.gridStore.addGrid(f)}),Object.keys(l).forEach(i=>{const t={id:i,layerIds:[i],state:new o(l[i]),fieldMap:{}};this.gridStore.addGrid(t)})}}const y={en:{"grid.title":"Datatable","grid.alertName":"Grid","grid.splash.error":"Error: Failed to load the layer's data.","grid.splash.loading":"Loading data...","grid.splash.building":"Building table...","grid.splash.cancel":"Cancel","grid.clearAll":"Clear search and filters","grid.layer.loading":"The layer is loading...","grid.label.pinColumns":"Pin columns","grid.label.export":"Export","grid.label.columns":"Hide columns","grid.label.copied":"Copied","grid.label.copy":"Press ctrl + c or double click to copy","grid.label.specialColumn":"Special Column","grid.label.filters.show":"Show filters","grid.label.filters.hide":"Hide filters","grid.label.filters.apply":"Apply filters to map","grid.header.sort.0":"Sort ascending","grid.header.sort.1":"Sort descending","grid.header.sort.2":"Sort default","grid.header.reorder.left":"Move left","grid.header.reorder.right":"Move right","grid.filters.label.global":"Search table","grid.filters.column.label.text":"Search {0}...","grid.filters.clear":"Clear filters","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Max Date","grid.filters.date.min":"Min Date","grid.filters.label.info":"{range} of {total} entries shown","grid.filters.label.filtered":"(filtered from {max} total entries)","grid.filters.label.extent":"Filter by extent","grid.cells.controls":"Use arrow keys to navigate grid cells. Press Tab to proceed","grid.cells.zoom":"Zoom to feature","grid.cells.zoom.zooming":"Zooming...","grid.cells.zoom.error":"Zoom failed","grid.cells.zoom.zoomed":"Zoomed","grid.cells.alert.zoom":"Zoomed into feature","grid.cells.details":"Details","grid.button.title":"Grid"},fr:{"grid.title":"Tableau de données","grid.alertName":"Grille","grid.splash.error":"Erreur : Échec du chargement des données de la couche.","grid.splash.loading":"Chargement des données...","grid.splash.building":"Création du tableau...","grid.splash.cancel":"Annuler","grid.clearAll":"Effacer la recherche et les filtres","grid.layer.loading":"La couche est en cours de téléchargement...","grid.label.pinColumns":"Épingler les colonnes","grid.label.export":"Exporter","grid.label.columns":"Masquer les colonnes","grid.label.copied":"Copié","grid.label.copy":"Appuyez sur Ctrl + C ou double-cliquez pour copier","grid.label.specialColumn":"Colonne spéciale","grid.label.filters.show":"Afficher les filtres","grid.label.filters.hide":"Masquer les filtres","grid.label.filters.apply":"Appliquer les filtres à la carte","grid.header.sort.0":"Tri ascendant","grid.header.sort.1":"Tri descendant","grid.header.sort.2":"Tri par défaut","grid.header.reorder.left":"Déplacer vers la gauche","grid.header.reorder.right":"Déplacer vers la droite","grid.filters.label.global":"Tableau de recherche","grid.filters.column.label.text":"Rechercher {0}...","grid.filters.clear":"Supprimer les filtres","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Date max","grid.filters.date.min":"Date min","grid.filters.label.info":"{range} de {total} saisies affichées","grid.filters.label.filtered":"(filtré à partir d'un total de {max} saisies)","grid.filters.label.extent":"Filtrer par étendue","grid.cells.controls":"Utilisez les flèches pour parcourir les cellules de la grille. Appuyez sur Tab pour continuer","grid.cells.zoom":"Zoom à l'élément","grid.cells.zoom.zooming":"Zoom en cours...","grid.cells.zoom.error":"Échec du zoom","grid.cells.zoom.zoomed":"Zoom terminé","grid.cells.alert.zoom":"Zoom sur la caractéristique","grid.cells.details":"Détails","grid.button.title":"Grille"}};class C extends E{async added(){this.$iApi.panel.register({grid:{screens:{"grid-screen":()=>m(u(()=>import("./screen-DOMT-YVI-nkI6BbEt.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{width:"450px"},controls:{expand:!0},button:{tooltip:"grid.button.title",icon:' '},expanded:!0,alertName:"grid.alertName"}},{i18n:{messages:y}}),this._parseConfig(this.config)}removed(){this.$iApi.fixture.exists("appbar")&&x(this.$vApp.$pinia).removeButton("grid"),n(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("grid")}}export{C as default}; diff --git a/main/assets/index-BSr9u_6r-Ca-hzfZH.js b/main/assets/index-BSr9u_6r-Ca-hzfZH.js new file mode 100644 index 000000000..bf1961834 --- /dev/null +++ b/main/assets/index-BSr9u_6r-Ca-hzfZH.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./fabric-Df28hv38-D454t-UP.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./index-DY4XJa1m-swXVZEPg.js","./index--i98kM5n-BVA2E5cn.js","./index-DLWeBByc-BMplQTGG.js","./index-98it_ulG-C3_-u3sQ.js","./index-7blUq_oP-C1hAWS60.js","./index-B0lfXXMz-DhqjpHZu.js","./index-CWPzg1w2-D_GivIgX.js"])))=>i.map(i=>d[i]); +import{c0 as D,_ as w,fu as M,c4 as S,c5 as k,fC as y,c1 as T,cB as P}from"./main-C7yV2j71.js";import B from"./screen-CmNk4p3g-OqpAi7PC.js";var H={exports:{}},j=H.exports,R;function C(){return R||(R=1,function($,o){(function(n,s){s()})(j,function(){function n(t,e){return typeof e>"u"?e={autoBom:!1}:typeof e!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function s(t,e,d){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){r(i.response,e,d)},i.onerror=function(){console.error("could not download file")},i.send()}function b(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return 200<=e.status&&299>=e.status}function c(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof T=="object"&&T.global===T?T:void 0,_=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),r=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!_?function(t,e,d){var i=a.URL||a.webkitURL,l=document.createElement("a");e=e||t.name||"download",l.download=e,l.rel="noopener",typeof t=="string"?(l.href=t,l.origin===location.origin?c(l):b(l.href)?s(t,e,d):c(l,l.target="_blank")):(l.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(l.href)},4e4),setTimeout(function(){c(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,d){if(e=e||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(n(t,d),e);else if(b(t))s(t,e,d);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){c(i)})}}:function(t,e,d,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return s(t,e,d);var l=t.type==="application/octet-stream",f=/constructor/i.test(a.HTMLElement)||a.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||l&&f||_)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var p=g.result;p=h?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=p:location=p,i=null},g.readAsDataURL(t)}else{var m=a.URL||a.webkitURL,x=m.createObjectURL(t);i?i.location=x:location.href=x,i=null,setTimeout(function(){m.revokeObjectURL(x)},4e4)}});a.saveAs=r.saveAs=r,$.exports=r})}(H)),H.exports}var I=C();const N=D(I),A=1200,u={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class U extends P{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};customRendererFunc=void 0;customRenderer(o){this.customRendererFunc=o}get config(){return super.config}_parseConfig(o){if(!o)return;const n=y(this.$vApp.$pinia);n.componentSelectedState={title:o.title?.selected??!0,map:o.map?.selected??!0,mapElements:o.mapElements?.selected??!0,legend:o.legend?.selected??!0,footnote:o.footnote?.selected??!0,timestamp:o.timestamp?.selected??!0},n.fileName=o.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(o){return this.$iApi.fixture.get(o)}async make(o,n){const{fabric:s}=await w(()=>import("./fabric-Df28hv38-D454t-UP.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(v=>v.f);s.Object.prototype.objectCaching=!1;const b=y(this.$vApp.$pinia),c={};this.fcFabric=new s.StaticCanvas(o,{backgroundColor:"#fff"}),this.fcFabricDownload=new s.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const a=b.componentSelectedState,_=this.getSubFixture("export-title"),r=this.getSubFixture("export-map"),t=this.getSubFixture("export-scalebar"),e=this.getSubFixture("export-northarrow"),d=this.getSubFixture("export-legend"),i=this.getSubFixture("export-footnote"),l=this.getSubFixture("export-timestamp");let f,h,g,m,x,p,F;if(a.title&&_&&(f=await _.make({top:this.options.runningHeight,left:0,originX:"left",width:n,textAlign:"center"}),this.options.runningHeight+=f.height+40,c.title=f),a.map&&r&&(h=await r.make({top:this.options.runningHeight}),f&&(f.left=h.width/2,f.originX="center"),this.options.runningHeight+=h.height+40,c.map=h),!h&&f&&(f.width=A),this.options.scale=n/((h?.width??A)+u.LEFT+u.RIGHT),a.mapElements&&t&&(g=await t.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=g.height+40,c.scaleBar=g,e&&(m=await e.make({top:g.top,left:n/this.options.scale}),m.top+=m.height/2-20,m.left+=-m.width*2,c.northArrow=m)),a.legend&&d&&(x=await d.make({width:d.config?.columnWidth??h?.width??A}),x.top=this.options.runningHeight,this.options.runningHeight+=x.height,c.legend=x),a.timestamp&&l&&(F=await l.make({top:this.options.runningHeight+40,width:n*1.5}),this.options.runningHeight+=!a.footnote||!i?F.height+40:F.height+20,c.timestamp=F),a.footnote&&i&&(p=await i.make({top:this.options.runningHeight-2.5,left:n/this.options.scale+40}),a.timestamp&&l?n-c.timestamp.getMinWidth()<=p.getMinWidth()+30?(p.top+=30,p.left=0,p.originX="left",this.options.runningHeight+=20):p.left+=-p.width*2:(p.top+=20,p.left+=-p.width*2,this.options.runningHeight+=20),this.options.runningHeight+=p.height,c.footnote=p),this.customRendererFunc){this.fcFabric.setWidth(n);const v={panelWidth:n,margin:u,defaultWidth:A,fabric:s};await this.customRendererFunc(this.fcFabric,c,v),this.fcFabric.renderAll(),this.fcFabric.clone(E=>{this.fcFabricDownload=E,this.fcFabricDownload.setDimensions({width:this.fcFabric?.getWidth(),height:this.fcFabric.getHeight()}),this.fcFabricDownload.renderAll()})}else{const v=new s.Group(Object.values(c),{top:u.TOP*this.options.scale,left:u.LEFT*this.options.scale}),E=await new Promise(O=>{v.clone(L=>{O(L)})});E.top=u.TOP,E.left=u.LEFT,this.fcFabricDownload.add(E),v.scale(this.options.scale),this.fcFabric.add(v),this.fcFabric.setDimensions({width:n,height:(this.options.runningHeight+u.TOP+u.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(h?.width??A)+u.LEFT+u.RIGHT,height:this.options.runningHeight+u.TOP+u.BOTTOM}),this.fcFabricDownload.renderAll()}}export(){if(!this.fcFabric)return;const o=new Date,n=this.config?.fileName||`map-carte - ${o.getFullYear()}-${o.getMonth()}-${o.getDay()}, ${o.getHours()}_${o.getMinutes()}`;N.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${n}.png`)}}const W={en:{"export.title":"Export","export.alertName":"Export","export.download":"Download image","export.refresh":"Refresh","export.scaleBar.approx":"{0} approx.","export.menu":"Settings Menu","export.menu.component.title":"Title","export.menu.component.map":"Map","export.menu.component.mapElements":"North arrow and scalebar","export.menu.component.legend":"Legend","export.menu.component.footnote":"Footnote","export.menu.component.timestamp":"Timestamp"},fr:{"export.title":"Exporter","export.alertName":"Exporter","export.download":"Télécharger l'image","export.refresh":"Rafraîchir","export.scaleBar.approx":"Environ {0}","export.menu":"Menu des paramètres","export.menu.component.title":"Titre","export.menu.component.map":"Carte","export.menu.component.mapElements":"Flèche du nord et échelle graphique","export.menu.component.legend":"Légende","export.menu.component.footnote":"Référence","export.menu.component.timestamp":"Horodatage"}};class X extends U{initialized(){}async needed(){const o=(await w(async()=>{const{default:r}=await import("./index-DY4XJa1m-swXVZEPg.js");return{default:r}},__vite__mapDeps([3,0,1,2]),import.meta.url)).default,n=(await w(async()=>{const{default:r}=await import("./index--i98kM5n-BVA2E5cn.js");return{default:r}},__vite__mapDeps([4,0,1,2]),import.meta.url)).default,s=(await w(async()=>{const{default:r}=await import("./index-DLWeBByc-BMplQTGG.js");return{default:r}},__vite__mapDeps([5,1,2,0]),import.meta.url)).default,b=(await w(async()=>{const{default:r}=await import("./index-98it_ulG-C3_-u3sQ.js");return{default:r}},__vite__mapDeps([6,0,1,2]),import.meta.url)).default,c=(await w(async()=>{const{default:r}=await import("./index-7blUq_oP-C1hAWS60.js");return{default:r}},__vite__mapDeps([7,0,1,2]),import.meta.url)).default,a=(await w(async()=>{const{default:r}=await import("./index-B0lfXXMz-DhqjpHZu.js");return{default:r}},__vite__mapDeps([8,0,1,2]),import.meta.url)).default,_=(await w(async()=>{const{default:r}=await import("./index-CWPzg1w2-D_GivIgX.js");return{default:r}},__vite__mapDeps([9,0,1,2]),import.meta.url)).default;this.$iApi.fixture.add("export-title",o),this.$iApi.fixture.add("export-map",n),this.$iApi.fixture.add("export-legend",s),this.$iApi.fixture.add("export-northarrow",b),this.$iApi.fixture.add("export-scalebar",c),this.$iApi.fixture.add("export-timestamp",a),this.$iApi.fixture.add("export-footnote",_)}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":M(B)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:W}});const o=this.$iApi.event.on(S.PANEL_OPENED,async s=>{s.id==="export"&&(this.$iApi.event.off(o),await this.needed(),s.exportMake())});this._parseConfig(this.config);const n=this.$vApp.$watch(()=>this.config,s=>this._parseConfig(s));this.removed=()=>{n(),this.$iApi.fixture.get("export-title")?.remove(),this.$iApi.fixture.get("export-map")?.remove(),this.$iApi.fixture.get("export-legend")?.remove(),this.$iApi.fixture.get("export-northarrow")?.remove(),this.$iApi.fixture.get("export-scalebar")?.remove(),this.$iApi.fixture.get("export-timestamp")?.remove(),this.$iApi.fixture.get("export-footnote")?.remove(),this.$iApi.fixture.exists("appbar")&&k(this.$vApp.$pinia).removeButton("export"),y(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}export{X as default}; diff --git a/main/assets/index-BSr9u_6r-Dy8QdhWp.js b/main/assets/index-BSr9u_6r-Dy8QdhWp.js deleted file mode 100644 index 583d0469a..000000000 --- a/main/assets/index-BSr9u_6r-Dy8QdhWp.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./fabric-Df28hv38-J5FIMqqY.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./index-DY4XJa1m-BzpaGS2E.js","./index--i98kM5n-ftbcqF2Z.js","./index-DLWeBByc-lUlQN2kJ.js","./index-98it_ulG-wSo8snBa.js","./index-7blUq_oP-BarAXEha.js","./index-B0lfXXMz-DzFhF9zr.js","./index-CWPzg1w2-BKAJsH0v.js"])))=>i.map(i=>d[i]); -import{c0 as D,_ as w,fu as M,c4 as S,c5 as k,fC as y,c1 as T,cB as P}from"./main-BZaw9FpY.js";import B from"./screen-CmNk4p3g-TP4639ra.js";var H={exports:{}},j=H.exports,R;function C(){return R||(R=1,function($,o){(function(n,s){s()})(j,function(){function n(t,e){return typeof e>"u"?e={autoBom:!1}:typeof e!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function s(t,e,d){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){r(i.response,e,d)},i.onerror=function(){console.error("could not download file")},i.send()}function b(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return 200<=e.status&&299>=e.status}function c(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof T=="object"&&T.global===T?T:void 0,_=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),r=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!_?function(t,e,d){var i=a.URL||a.webkitURL,l=document.createElement("a");e=e||t.name||"download",l.download=e,l.rel="noopener",typeof t=="string"?(l.href=t,l.origin===location.origin?c(l):b(l.href)?s(t,e,d):c(l,l.target="_blank")):(l.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(l.href)},4e4),setTimeout(function(){c(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,d){if(e=e||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(n(t,d),e);else if(b(t))s(t,e,d);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){c(i)})}}:function(t,e,d,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return s(t,e,d);var l=t.type==="application/octet-stream",f=/constructor/i.test(a.HTMLElement)||a.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||l&&f||_)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var p=g.result;p=h?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=p:location=p,i=null},g.readAsDataURL(t)}else{var m=a.URL||a.webkitURL,x=m.createObjectURL(t);i?i.location=x:location.href=x,i=null,setTimeout(function(){m.revokeObjectURL(x)},4e4)}});a.saveAs=r.saveAs=r,$.exports=r})}(H)),H.exports}var I=C();const N=D(I),A=1200,u={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class U extends P{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};customRendererFunc=void 0;customRenderer(o){this.customRendererFunc=o}get config(){return super.config}_parseConfig(o){if(!o)return;const n=y(this.$vApp.$pinia);n.componentSelectedState={title:o.title?.selected??!0,map:o.map?.selected??!0,mapElements:o.mapElements?.selected??!0,legend:o.legend?.selected??!0,footnote:o.footnote?.selected??!0,timestamp:o.timestamp?.selected??!0},n.fileName=o.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(o){return this.$iApi.fixture.get(o)}async make(o,n){const{fabric:s}=await w(()=>import("./fabric-Df28hv38-J5FIMqqY.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(v=>v.f);s.Object.prototype.objectCaching=!1;const b=y(this.$vApp.$pinia),c={};this.fcFabric=new s.StaticCanvas(o,{backgroundColor:"#fff"}),this.fcFabricDownload=new s.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const a=b.componentSelectedState,_=this.getSubFixture("export-title"),r=this.getSubFixture("export-map"),t=this.getSubFixture("export-scalebar"),e=this.getSubFixture("export-northarrow"),d=this.getSubFixture("export-legend"),i=this.getSubFixture("export-footnote"),l=this.getSubFixture("export-timestamp");let f,h,g,m,x,p,F;if(a.title&&_&&(f=await _.make({top:this.options.runningHeight,left:0,originX:"left",width:n,textAlign:"center"}),this.options.runningHeight+=f.height+40,c.title=f),a.map&&r&&(h=await r.make({top:this.options.runningHeight}),f&&(f.left=h.width/2,f.originX="center"),this.options.runningHeight+=h.height+40,c.map=h),!h&&f&&(f.width=A),this.options.scale=n/((h?.width??A)+u.LEFT+u.RIGHT),a.mapElements&&t&&(g=await t.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=g.height+40,c.scaleBar=g,e&&(m=await e.make({top:g.top,left:n/this.options.scale}),m.top+=m.height/2-20,m.left+=-m.width*2,c.northArrow=m)),a.legend&&d&&(x=await d.make({width:d.config?.columnWidth??h?.width??A}),x.top=this.options.runningHeight,this.options.runningHeight+=x.height,c.legend=x),a.timestamp&&l&&(F=await l.make({top:this.options.runningHeight+40,width:n*1.5}),this.options.runningHeight+=!a.footnote||!i?F.height+40:F.height+20,c.timestamp=F),a.footnote&&i&&(p=await i.make({top:this.options.runningHeight-2.5,left:n/this.options.scale+40}),a.timestamp&&l?n-c.timestamp.getMinWidth()<=p.getMinWidth()+30?(p.top+=30,p.left=0,p.originX="left",this.options.runningHeight+=20):p.left+=-p.width*2:(p.top+=20,p.left+=-p.width*2,this.options.runningHeight+=20),this.options.runningHeight+=p.height,c.footnote=p),this.customRendererFunc){this.fcFabric.setWidth(n);const v={panelWidth:n,margin:u,defaultWidth:A,fabric:s};await this.customRendererFunc(this.fcFabric,c,v),this.fcFabric.renderAll(),this.fcFabric.clone(E=>{this.fcFabricDownload=E,this.fcFabricDownload.setDimensions({width:this.fcFabric?.getWidth(),height:this.fcFabric.getHeight()}),this.fcFabricDownload.renderAll()})}else{const v=new s.Group(Object.values(c),{top:u.TOP*this.options.scale,left:u.LEFT*this.options.scale}),E=await new Promise(O=>{v.clone(L=>{O(L)})});E.top=u.TOP,E.left=u.LEFT,this.fcFabricDownload.add(E),v.scale(this.options.scale),this.fcFabric.add(v),this.fcFabric.setDimensions({width:n,height:(this.options.runningHeight+u.TOP+u.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(h?.width??A)+u.LEFT+u.RIGHT,height:this.options.runningHeight+u.TOP+u.BOTTOM}),this.fcFabricDownload.renderAll()}}export(){if(!this.fcFabric)return;const o=new Date,n=this.config?.fileName||`map-carte - ${o.getFullYear()}-${o.getMonth()}-${o.getDay()}, ${o.getHours()}_${o.getMinutes()}`;N.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${n}.png`)}}const W={en:{"export.title":"Export","export.alertName":"Export","export.download":"Download image","export.refresh":"Refresh","export.scaleBar.approx":"{0} approx.","export.menu":"Settings Menu","export.menu.component.title":"Title","export.menu.component.map":"Map","export.menu.component.mapElements":"North arrow and scalebar","export.menu.component.legend":"Legend","export.menu.component.footnote":"Footnote","export.menu.component.timestamp":"Timestamp"},fr:{"export.title":"Exporter","export.alertName":"Exporter","export.download":"Télécharger l'image","export.refresh":"Rafraîchir","export.scaleBar.approx":"Environ {0}","export.menu":"Menu des paramètres","export.menu.component.title":"Titre","export.menu.component.map":"Carte","export.menu.component.mapElements":"Flèche du nord et échelle graphique","export.menu.component.legend":"Légende","export.menu.component.footnote":"Référence","export.menu.component.timestamp":"Horodatage"}};class X extends U{initialized(){}async needed(){const o=(await w(async()=>{const{default:r}=await import("./index-DY4XJa1m-BzpaGS2E.js");return{default:r}},__vite__mapDeps([3,0,1,2]),import.meta.url)).default,n=(await w(async()=>{const{default:r}=await import("./index--i98kM5n-ftbcqF2Z.js");return{default:r}},__vite__mapDeps([4,0,1,2]),import.meta.url)).default,s=(await w(async()=>{const{default:r}=await import("./index-DLWeBByc-lUlQN2kJ.js");return{default:r}},__vite__mapDeps([5,1,2,0]),import.meta.url)).default,b=(await w(async()=>{const{default:r}=await import("./index-98it_ulG-wSo8snBa.js");return{default:r}},__vite__mapDeps([6,0,1,2]),import.meta.url)).default,c=(await w(async()=>{const{default:r}=await import("./index-7blUq_oP-BarAXEha.js");return{default:r}},__vite__mapDeps([7,0,1,2]),import.meta.url)).default,a=(await w(async()=>{const{default:r}=await import("./index-B0lfXXMz-DzFhF9zr.js");return{default:r}},__vite__mapDeps([8,0,1,2]),import.meta.url)).default,_=(await w(async()=>{const{default:r}=await import("./index-CWPzg1w2-BKAJsH0v.js");return{default:r}},__vite__mapDeps([9,0,1,2]),import.meta.url)).default;this.$iApi.fixture.add("export-title",o),this.$iApi.fixture.add("export-map",n),this.$iApi.fixture.add("export-legend",s),this.$iApi.fixture.add("export-northarrow",b),this.$iApi.fixture.add("export-scalebar",c),this.$iApi.fixture.add("export-timestamp",a),this.$iApi.fixture.add("export-footnote",_)}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":M(B)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:W}});const o=this.$iApi.event.on(S.PANEL_OPENED,async s=>{s.id==="export"&&(this.$iApi.event.off(o),await this.needed(),s.exportMake())});this._parseConfig(this.config);const n=this.$vApp.$watch(()=>this.config,s=>this._parseConfig(s));this.removed=()=>{n(),this.$iApi.fixture.get("export-title")?.remove(),this.$iApi.fixture.get("export-map")?.remove(),this.$iApi.fixture.get("export-legend")?.remove(),this.$iApi.fixture.get("export-northarrow")?.remove(),this.$iApi.fixture.get("export-scalebar")?.remove(),this.$iApi.fixture.get("export-timestamp")?.remove(),this.$iApi.fixture.get("export-footnote")?.remove(),this.$iApi.fixture.exists("appbar")&&k(this.$vApp.$pinia).removeButton("export"),y(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}export{X as default}; diff --git a/main/assets/index-Bo-4afBP-DoegO6wZ.js b/main/assets/index-Bo-4afBP-DoegO6wZ.js new file mode 100644 index 000000000..f5c953269 --- /dev/null +++ b/main/assets/index-Bo-4afBP-DoegO6wZ.js @@ -0,0 +1 @@ +import{c2 as T,c3 as F,c4 as te,c5 as S,c6 as W,c7 as K,c8 as q,c9 as Y,ca as l,cb as k,cc as V,cd as A,ce as I,cf as O,cg as B,ch as E,ci as ae,cj as J,ck as Q,cl as N,cm as g,cn as P,co as ee,cp as ne,cq as ie,cr as se,cs as oe,ct as le,cu as re,cv as R,cw as x,cx as M,cy as Z,cz as j,cA as pe,cB as ce,cC as ue,cD as D,cE as de}from"./main-C7yV2j71.js";class U{id;options;componentId;constructor(a){const r={options:{},...a};({id:this.id,options:this.options,componentId:this.componentId}=r)}}const me=["innerHTML"],H=T({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(f){const{t:a}=W(),r=K("iApi"),n=f,d=q(()=>r?.panel.get(n.panelId)?.button),o=()=>{n.minimize?r?.panel.toggleMinimize(n.panelId):r?.panel.toggle(n.panelId)};return(e,y)=>{const p=Y("appbar-button");return d.value?(l(),k(p,{key:0,onClickFunction:o,tooltip:O(a)(d.value.tooltip),id:f.panelId},{default:V(()=>[A("div",{class:I(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":f.overflow}]),innerHTML:d.value.icon},null,10,me)]),_:1},8,["tooltip","id"])):B("",!0)}}}),ve={},fe={class:"border-b p-0 self-center w-2/3"};function he(f,a){return l(),g("span",fe)}const G=F(ve,[["render",he],["__scopeId","data-v-5d32b715"]]);var ge={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(f){var a=f.state,r=f.name,n=f.options,d=de(a,n),o=a.modifiersData.preventOverflow||{x:0,y:0},e=o.x,y=o.y,p=a.rects.popper,c=p.width,h=p.height,z=a.placement.split("-"),w=z[0],_=w==="left"?"left":"right",v=w==="top"?"top":"bottom";a.modifiersData[r]={width:c-d[_]-e,height:h-d[v]-y}}};const be=["content","aria-label"],$e=T({__name:"more-button",props:{position:{type:String,default:"right-end"},popperOptions:{type:Object,default(){return{}}},numItems:{type:Number,default:1},renderWatch:{type:Number,default:0}},emits:["updateParent"],setup(f,{expose:a,emit:r}){const{t:n}=W(),d=K("iApi"),o=f,e=r;function y(){e("updateParent")}const p=E(!1),c=E(0),h=E(),z=E(),w=E();function _(){y(),R(()=>{v(),p.value=!p.value})}ae(()=>o.renderWatch,()=>{_()});const v=()=>{p.value=!p.value;const u=d.$vApp.$el.querySelector(".inner-shell"),b={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:m}){const{width:i}=m.modifiersData.maxSize;m.styles.popper={...m.styles.popper,maxWidth:`${i}px`,maxHeight:`${u.offsetHeight-45}px`};const $=Math.min(o.numItems<=0?0:55+44*(o.numItems-1),u.offsetHeight-45);m.styles.popper.height=`${$}px`,w?.value?.offsetHeight&&(w.value.style.height=`${$}px`),m.styles.popper.overflowY="auto",m.styles.popper.overflowX="hidden"}};z.value&&w.value&&(c.value++,ue(z.value,w.value,{placement:o.position||"right-end",modifiers:[{...ge,options:{boundary:u}},b,{name:"offset",options:{offset:[0,5]}},{name:"preventOverflow",enabled:!0,options:{boundary:u}}],...o.popperOptions})),c.value===1&&_()};return J(()=>{window.addEventListener("click",u=>{u.target instanceof HTMLElement&&!h.value?.contains(u.target)&&(p.value=!1)},{capture:!0})}),Q(()=>{window.removeEventListener("click",u=>{u.target instanceof HTMLElement&&!h.value?.contains(u.target)&&(p.value=!1)},{capture:!0})}),a({rerender:_}),(u,b)=>{const m=N("focus-item"),i=N("tippy");return l(),g("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:h},[P((l(),g("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:b[0]||(b[0]=$=>v()),content:O(n)("appbar.more"),"aria-label":O(n)("appbar.more"),ref_key:"dropdownTrigger",ref:z},b[1]||(b[1]=[A("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M0 0h24v24H0z",fill:"none"}),A("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)]),8,be)),[[m],[i,{placement:"right-end"}]]),P(A("div",{id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded",ref_key:"dropdown",ref:w},[ne(u.$slots,"default",{},void 0,!0)],512),[[ee,p.value]])],512)}}}),ye=F($e,[["__scopeId","data-v-93661050"]]),we={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},xe=T({__name:"appbar-button",setup(f){const a=ie(),{t:r}=W(),n=K("iApi"),d=q(()=>a.notificationNumber),o=()=>{n.panel.toggle("notifications")};return(e,y)=>{const p=Y("appbar-button",!0);return l(),k(p,{onClickFunction:o,tooltip:O(r)("notifications.title"),class:"notification-button",id:""},{default:V(()=>[y[0]||(y[0]=A("svg",{class:"fill-current w-24 h-24 mx-8 sm:mx-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),d.value&&d.value>0?(l(),g("span",we,se(d.value),1)):B("",!0)]),_:1},8,["tooltip"])}}}),ke=F(xe,[["__scopeId","data-v-787da765"]]),Ee=["content"],Ie=T({__name:"appbar",setup(f){const a=oe(),r=S(),n=E(0),d=E(0),o=q(()=>r.visible),e=q(()=>r.temporary),{t:y}=W(),p=E(!1),c=E({}),h=E(),z=()=>{R(()=>{D()?.proxy?.$forceUpdate()})},w=()=>{h.value._tippy.hide()},_=v=>{v.key==="Tab"&&h.value?.matches(":focus")&&h.value._tippy.show()};return J(()=>{h.value?.addEventListener("blur",w),h.value?.addEventListener("keyup",_)}),le(()=>{const v=D();window.addEventListener("resize",()=>v?.proxy?.$forceUpdate())}),Q(()=>{const v=D();window.removeEventListener("resize",()=>v?.proxy?.$forceUpdate()),h.value?.removeEventListener("blur",w),h.value?.removeEventListener("keyup",_)}),re(()=>{R(()=>{const v=h.value;let u,b=[...v.children],m=b[b.length-2].getBoundingClientRect().top;a.mobileView||(m=v.getBoundingClientRect().bottom-38);let i=v.querySelector("#dropdown");for(let s=b.length-4;s>=0;s--){let C=b[s].getBoundingClientRect().bottom;if(m&&i&&(C>m||p.value&&C+56>m))b[s].classList.forEach(L=>{L.includes("identifier")&&(u=L.slice(11))}),u&&(c.value[u]=!0,u.includes("divider")||n.value++,d.value++),p.value||(p.value=!0);else if(C!==0)break}let $=v.querySelector("#more"),t=$.getBoundingClientRect().bottom;if(u=void 0,p.value&&m&&$&&i&&t!==0&&(t<=m-56||i.childElementCount==1&&t<=m)){let s=i.childElementCount,C=0;for(;t<=m-56||s==1;){let L=i.children[C];if(L&&(L.classList.forEach(X=>{X.includes("identifier")&&(u=X.slice(11))}),u&&(c.value[u]=!1,u.includes("divider")||n.value--),t+=48,s-=1,C+=1),s===0){p.value=!1;break}}}Object.keys(c.value).forEach(s=>{v.querySelector(`.identifier-${s}`)||(delete c.value[s],s.includes("divider")||(n.value=Math.max(0,n.value-1)),d.value++)})})}),(v,u)=>{const b=N("focus-list"),m=N("tippy");return P((l(),g("div",{class:"absolute top-0 left-0 bottom-28 flex flex-col w-40 pointer-events-auto appbar z-50 sm:z-20 bg-black-75 sm:w-64 sm:bottom-38",content:O(y)("panels.controls.items"),ref_key:"el",ref:h},[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,null,[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&c.value[`${t}-${s}`]!==!0?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:I(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["panelId","class"])):c.value[`${t}-${s}`]!==!0?(l(),k(Z(t.componentId),{key:`${t}-${s}-custom`,options:t.options,class:I(["appbar-item h-48",`identifier-${t}-${s}`]),id:t.id},null,8,["options","id","class"])):B("",!0)],64))),256)),c.value[`divider-${$}`]!==!0?(l(),k(G,{class:I(["appbar-item",`identifier-divider-${$}`]),key:`${i}-${$}-default`},null,8,["class"])):B("",!0)],64))),256)),(l(!0),g(x,null,M(e.value?.filter(i=>c.value[`${i}-temp`]!==!0),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:I([`identifier-${i}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),P(j(ye,{id:"more",numItems:n.value,renderWatch:d.value,onUpdateParent:z},{default:V(()=>[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,{key:$},[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&c.value[`${t}-${s}`]?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:I(["text-black hover:bg-gray my-4 h-36",`identifier-${t}-${s}`]),overflow:""},null,8,["panelId","class"])):c.value[`${t}-${s}`]?(l(),k(Z(t.componentId),{key:`${t}-${s}-custom`,options:t.options,id:t.id,class:I(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["options","id","class"])):B("",!0)],64))),256)),c.value[`divider-${$}`]?(l(),k(G,{key:0,class:I(["border-black my-4",`identifier-divider-${$}`])},null,8,["class"])):B("",!0)],64))),128)),(l(!0),g(x,null,M(e.value?.filter(i=>c.value[`${i}-temp`]),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:I([`identifier-${i}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},8,["numItems","renderWatch"]),[[ee,p.value]]),j(ke,{class:"appbar-item bottom-48 h-48 sm:display-none"}),j(pe,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})],8,Ee)),[[b],[m,{trigger:"manual",touch:!1,placement:"top-end",popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}});class _e extends ce{get config(){return super.config}_parseConfig(a){if(!a)return;const r=S(this.$vApp.$pinia);let n;Array.isArray(a.items[0])?n=a.items:n=[a.items];const d=[];n.forEach(o=>{d.push(o.map(e=>typeof e=="string"?e:new U(e)))}),r.items=d.flat().reduce((o,e)=>(o[e instanceof U?e.id:e]=e,o),{}),r.order=d.map(o=>o.map(e=>e instanceof U?e.id:e)),this._validateItems()}_validateItems(){const a=S(this.$vApp.$pinia);a.order.flat().forEach(r=>{typeof a.items[r]!="string"&&[r].some(n=>{this.$iApi.fixture.exists(n)&&!a.items[r]&&(a.items[r].componentId=`${n}-appbar-button`)})})}}const ze={en:{"appbar.navigation":"Navigation","appbar.more":"More","navigation.export":"Export","navigation.map.export":"Export Map"},fr:{"appbar.navigation":"Navigation","appbar.more":"Plus","navigation.export":"Exporter","navigation.map.export":"Exporter la Carte"}};class Ce extends _e{initialized(){}async added(){Object.entries(ze).forEach(e=>this.$iApi.$i18n.mergeLocaleMessage(...e));const{destroy:a,el:r}=this.mount(Ie,{app:this.$element}),n=this.$vApp.$el.getElementsByClassName("inner-shell")[0];n.insertBefore(r.childNodes[0],n.querySelector(".panel-stack")),this._parseConfig(this.config);const d=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e)),o=[];o.push(this.$iApi.event.on(te.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const e=S(this.$vApp.$pinia);d(),o.forEach(c=>this.$iApi.event.off(c));const y={...e.items},p=[...e.temporary];Object.keys(y).forEach(c=>e.removeButton(c)),p.forEach(c=>e.removeButton(c)),a(),e.$reset()}}}export{Ce as default}; diff --git a/main/assets/index-Bo-4afBP-Lk4ytFSu.js b/main/assets/index-Bo-4afBP-Lk4ytFSu.js deleted file mode 100644 index 53d443bf2..000000000 --- a/main/assets/index-Bo-4afBP-Lk4ytFSu.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as T,c3 as F,c4 as te,c5 as S,c6 as W,c7 as K,c8 as q,c9 as Y,ca as l,cb as k,cc as V,cd as A,ce as I,cf as O,cg as B,ch as E,ci as ae,cj as J,ck as Q,cl as N,cm as g,cn as P,co as ee,cp as ne,cq as ie,cr as se,cs as oe,ct as le,cu as re,cv as R,cw as x,cx as M,cy as Z,cz as j,cA as pe,cB as ce,cC as ue,cD as D,cE as de}from"./main-BZaw9FpY.js";class U{id;options;componentId;constructor(a){const r={options:{},...a};({id:this.id,options:this.options,componentId:this.componentId}=r)}}const me=["innerHTML"],H=T({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(f){const{t:a}=W(),r=K("iApi"),n=f,d=q(()=>r?.panel.get(n.panelId)?.button),o=()=>{n.minimize?r?.panel.toggleMinimize(n.panelId):r?.panel.toggle(n.panelId)};return(e,y)=>{const p=Y("appbar-button");return d.value?(l(),k(p,{key:0,onClickFunction:o,tooltip:O(a)(d.value.tooltip),id:f.panelId},{default:V(()=>[A("div",{class:I(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":f.overflow}]),innerHTML:d.value.icon},null,10,me)]),_:1},8,["tooltip","id"])):B("",!0)}}}),ve={},fe={class:"border-b p-0 self-center w-2/3"};function he(f,a){return l(),g("span",fe)}const G=F(ve,[["render",he],["__scopeId","data-v-5d32b715"]]);var ge={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(f){var a=f.state,r=f.name,n=f.options,d=de(a,n),o=a.modifiersData.preventOverflow||{x:0,y:0},e=o.x,y=o.y,p=a.rects.popper,c=p.width,h=p.height,z=a.placement.split("-"),w=z[0],_=w==="left"?"left":"right",v=w==="top"?"top":"bottom";a.modifiersData[r]={width:c-d[_]-e,height:h-d[v]-y}}};const be=["content","aria-label"],$e=T({__name:"more-button",props:{position:{type:String,default:"right-end"},popperOptions:{type:Object,default(){return{}}},numItems:{type:Number,default:1},renderWatch:{type:Number,default:0}},emits:["updateParent"],setup(f,{expose:a,emit:r}){const{t:n}=W(),d=K("iApi"),o=f,e=r;function y(){e("updateParent")}const p=E(!1),c=E(0),h=E(),z=E(),w=E();function _(){y(),R(()=>{v(),p.value=!p.value})}ae(()=>o.renderWatch,()=>{_()});const v=()=>{p.value=!p.value;const u=d.$vApp.$el.querySelector(".inner-shell"),b={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:m}){const{width:i}=m.modifiersData.maxSize;m.styles.popper={...m.styles.popper,maxWidth:`${i}px`,maxHeight:`${u.offsetHeight-45}px`};const $=Math.min(o.numItems<=0?0:55+44*(o.numItems-1),u.offsetHeight-45);m.styles.popper.height=`${$}px`,w?.value?.offsetHeight&&(w.value.style.height=`${$}px`),m.styles.popper.overflowY="auto",m.styles.popper.overflowX="hidden"}};z.value&&w.value&&(c.value++,ue(z.value,w.value,{placement:o.position||"right-end",modifiers:[{...ge,options:{boundary:u}},b,{name:"offset",options:{offset:[0,5]}},{name:"preventOverflow",enabled:!0,options:{boundary:u}}],...o.popperOptions})),c.value===1&&_()};return J(()=>{window.addEventListener("click",u=>{u.target instanceof HTMLElement&&!h.value?.contains(u.target)&&(p.value=!1)},{capture:!0})}),Q(()=>{window.removeEventListener("click",u=>{u.target instanceof HTMLElement&&!h.value?.contains(u.target)&&(p.value=!1)},{capture:!0})}),a({rerender:_}),(u,b)=>{const m=N("focus-item"),i=N("tippy");return l(),g("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:h},[P((l(),g("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:b[0]||(b[0]=$=>v()),content:O(n)("appbar.more"),"aria-label":O(n)("appbar.more"),ref_key:"dropdownTrigger",ref:z},b[1]||(b[1]=[A("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M0 0h24v24H0z",fill:"none"}),A("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)]),8,be)),[[m],[i,{placement:"right-end"}]]),P(A("div",{id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded",ref_key:"dropdown",ref:w},[ne(u.$slots,"default",{},void 0,!0)],512),[[ee,p.value]])],512)}}}),ye=F($e,[["__scopeId","data-v-93661050"]]),we={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},xe=T({__name:"appbar-button",setup(f){const a=ie(),{t:r}=W(),n=K("iApi"),d=q(()=>a.notificationNumber),o=()=>{n.panel.toggle("notifications")};return(e,y)=>{const p=Y("appbar-button",!0);return l(),k(p,{onClickFunction:o,tooltip:O(r)("notifications.title"),class:"notification-button",id:""},{default:V(()=>[y[0]||(y[0]=A("svg",{class:"fill-current w-24 h-24 mx-8 sm:mx-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),d.value&&d.value>0?(l(),g("span",we,se(d.value),1)):B("",!0)]),_:1},8,["tooltip"])}}}),ke=F(xe,[["__scopeId","data-v-787da765"]]),Ee=["content"],Ie=T({__name:"appbar",setup(f){const a=oe(),r=S(),n=E(0),d=E(0),o=q(()=>r.visible),e=q(()=>r.temporary),{t:y}=W(),p=E(!1),c=E({}),h=E(),z=()=>{R(()=>{D()?.proxy?.$forceUpdate()})},w=()=>{h.value._tippy.hide()},_=v=>{v.key==="Tab"&&h.value?.matches(":focus")&&h.value._tippy.show()};return J(()=>{h.value?.addEventListener("blur",w),h.value?.addEventListener("keyup",_)}),le(()=>{const v=D();window.addEventListener("resize",()=>v?.proxy?.$forceUpdate())}),Q(()=>{const v=D();window.removeEventListener("resize",()=>v?.proxy?.$forceUpdate()),h.value?.removeEventListener("blur",w),h.value?.removeEventListener("keyup",_)}),re(()=>{R(()=>{const v=h.value;let u,b=[...v.children],m=b[b.length-2].getBoundingClientRect().top;a.mobileView||(m=v.getBoundingClientRect().bottom-38);let i=v.querySelector("#dropdown");for(let s=b.length-4;s>=0;s--){let C=b[s].getBoundingClientRect().bottom;if(m&&i&&(C>m||p.value&&C+56>m))b[s].classList.forEach(L=>{L.includes("identifier")&&(u=L.slice(11))}),u&&(c.value[u]=!0,u.includes("divider")||n.value++,d.value++),p.value||(p.value=!0);else if(C!==0)break}let $=v.querySelector("#more"),t=$.getBoundingClientRect().bottom;if(u=void 0,p.value&&m&&$&&i&&t!==0&&(t<=m-56||i.childElementCount==1&&t<=m)){let s=i.childElementCount,C=0;for(;t<=m-56||s==1;){let L=i.children[C];if(L&&(L.classList.forEach(X=>{X.includes("identifier")&&(u=X.slice(11))}),u&&(c.value[u]=!1,u.includes("divider")||n.value--),t+=48,s-=1,C+=1),s===0){p.value=!1;break}}}Object.keys(c.value).forEach(s=>{v.querySelector(`.identifier-${s}`)||(delete c.value[s],s.includes("divider")||(n.value=Math.max(0,n.value-1)),d.value++)})})}),(v,u)=>{const b=N("focus-list"),m=N("tippy");return P((l(),g("div",{class:"absolute top-0 left-0 bottom-28 flex flex-col w-40 pointer-events-auto appbar z-50 sm:z-20 bg-black-75 sm:w-64 sm:bottom-38",content:O(y)("panels.controls.items"),ref_key:"el",ref:h},[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,null,[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&c.value[`${t}-${s}`]!==!0?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:I(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["panelId","class"])):c.value[`${t}-${s}`]!==!0?(l(),k(Z(t.componentId),{key:`${t}-${s}-custom`,options:t.options,class:I(["appbar-item h-48",`identifier-${t}-${s}`]),id:t.id},null,8,["options","id","class"])):B("",!0)],64))),256)),c.value[`divider-${$}`]!==!0?(l(),k(G,{class:I(["appbar-item",`identifier-divider-${$}`]),key:`${i}-${$}-default`},null,8,["class"])):B("",!0)],64))),256)),(l(!0),g(x,null,M(e.value?.filter(i=>c.value[`${i}-temp`]!==!0),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:I([`identifier-${i}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),P(j(ye,{id:"more",numItems:n.value,renderWatch:d.value,onUpdateParent:z},{default:V(()=>[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,{key:$},[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&c.value[`${t}-${s}`]?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:I(["text-black hover:bg-gray my-4 h-36",`identifier-${t}-${s}`]),overflow:""},null,8,["panelId","class"])):c.value[`${t}-${s}`]?(l(),k(Z(t.componentId),{key:`${t}-${s}-custom`,options:t.options,id:t.id,class:I(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["options","id","class"])):B("",!0)],64))),256)),c.value[`divider-${$}`]?(l(),k(G,{key:0,class:I(["border-black my-4",`identifier-divider-${$}`])},null,8,["class"])):B("",!0)],64))),128)),(l(!0),g(x,null,M(e.value?.filter(i=>c.value[`${i}-temp`]),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:I([`identifier-${i}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},8,["numItems","renderWatch"]),[[ee,p.value]]),j(ke,{class:"appbar-item bottom-48 h-48 sm:display-none"}),j(pe,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})],8,Ee)),[[b],[m,{trigger:"manual",touch:!1,placement:"top-end",popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}});class _e extends ce{get config(){return super.config}_parseConfig(a){if(!a)return;const r=S(this.$vApp.$pinia);let n;Array.isArray(a.items[0])?n=a.items:n=[a.items];const d=[];n.forEach(o=>{d.push(o.map(e=>typeof e=="string"?e:new U(e)))}),r.items=d.flat().reduce((o,e)=>(o[e instanceof U?e.id:e]=e,o),{}),r.order=d.map(o=>o.map(e=>e instanceof U?e.id:e)),this._validateItems()}_validateItems(){const a=S(this.$vApp.$pinia);a.order.flat().forEach(r=>{typeof a.items[r]!="string"&&[r].some(n=>{this.$iApi.fixture.exists(n)&&!a.items[r]&&(a.items[r].componentId=`${n}-appbar-button`)})})}}const ze={en:{"appbar.navigation":"Navigation","appbar.more":"More","navigation.export":"Export","navigation.map.export":"Export Map"},fr:{"appbar.navigation":"Navigation","appbar.more":"Plus","navigation.export":"Exporter","navigation.map.export":"Exporter la Carte"}};class Ce extends _e{initialized(){}async added(){Object.entries(ze).forEach(e=>this.$iApi.$i18n.mergeLocaleMessage(...e));const{destroy:a,el:r}=this.mount(Ie,{app:this.$element}),n=this.$vApp.$el.getElementsByClassName("inner-shell")[0];n.insertBefore(r.childNodes[0],n.querySelector(".panel-stack")),this._parseConfig(this.config);const d=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e)),o=[];o.push(this.$iApi.event.on(te.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const e=S(this.$vApp.$pinia);d(),o.forEach(c=>this.$iApi.event.off(c));const y={...e.items},p=[...e.temporary];Object.keys(y).forEach(c=>e.removeButton(c)),p.forEach(c=>e.removeButton(c)),a(),e.$reset()}}}export{Ce as default}; diff --git a/main/assets/index-CDhNyq-A-B2KtZCFy.js b/main/assets/index-CDhNyq-A-B2KtZCFy.js deleted file mode 100644 index ad03061e1..000000000 --- a/main/assets/index-CDhNyq-A-B2KtZCFy.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-oq2ZVtwf-DpZgdQz_.js","./main-BZaw9FpY.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); -import{c2 as n,fH as a,fu as l,_ as h,c5 as p,fw as g,cB as v,c6 as f,c7 as u,c9 as d,ca as m,cb as x,cc as b,cd as e,cf as $}from"./main-BZaw9FpY.js";class w extends v{}const A=n({__name:"nav-button",setup(s){const{t}=f(),o=u("iApi"),i=()=>{o?.panel.toggle("geosearch")};return(_,r)=>{const c=d("mapnav-button");return m(),x(c,{onClickFunction:i,tooltip:$(t)("geosearch.title")},{default:b(()=>r[0]||(r[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),e("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["tooltip"])}}}),E={en:{"geosearch.title":"Geolocation Search","geosearch.noResults":"No results to show for ","geosearch.searchText":"Search for a location...","geosearch.visible":"Visible on map","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Clear filters","geosearch.serviceError":"No response from {services} service(s)","geosearch.badChars":"The character(s) {chars} are not supported and will be ignored"},fr:{"geosearch.title":"Recherche géolocalisée","geosearch.noResults":"Aucun résultat à afficher pour ","geosearch.searchText":"Rechercher un emplacement...","geosearch.visible":"Visible sur la carte","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Effacer les filtres","geosearch.serviceError":"Pas de réponse de la part des services de {services}","geosearch.badChars":"Les caractères {chars} ne sont pas pris en charge et seront ignorés"}};class S extends w{async added(){a(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",A),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":()=>l(h(()=>import("./screen-oq2ZVtwf-DpZgdQz_.js"),__vite__mapDeps([0,1,2]),import.meta.url))},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:E}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.exists("appbar")&&p(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.exists("mapnav")&&g(this.$vApp.$pinia).removeItem("geosearch"),a(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}export{S as default}; diff --git a/main/assets/index-CDhNyq-A-wCiXFwDE.js b/main/assets/index-CDhNyq-A-wCiXFwDE.js new file mode 100644 index 000000000..3d201ace6 --- /dev/null +++ b/main/assets/index-CDhNyq-A-wCiXFwDE.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-oq2ZVtwf-Bo-C8Eeg.js","./main-C7yV2j71.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); +import{c2 as n,fH as a,fu as l,_ as h,c5 as p,fw as g,cB as v,c6 as f,c7 as u,c9 as d,ca as m,cb as x,cc as b,cd as e,cf as $}from"./main-C7yV2j71.js";class w extends v{}const A=n({__name:"nav-button",setup(s){const{t}=f(),o=u("iApi"),i=()=>{o?.panel.toggle("geosearch")};return(_,r)=>{const c=d("mapnav-button");return m(),x(c,{onClickFunction:i,tooltip:$(t)("geosearch.title")},{default:b(()=>r[0]||(r[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),e("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["tooltip"])}}}),E={en:{"geosearch.title":"Geolocation Search","geosearch.noResults":"No results to show for ","geosearch.searchText":"Search for a location...","geosearch.visible":"Visible on map","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Clear filters","geosearch.serviceError":"No response from {services} service(s)","geosearch.badChars":"The character(s) {chars} are not supported and will be ignored"},fr:{"geosearch.title":"Recherche géolocalisée","geosearch.noResults":"Aucun résultat à afficher pour ","geosearch.searchText":"Rechercher un emplacement...","geosearch.visible":"Visible sur la carte","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Effacer les filtres","geosearch.serviceError":"Pas de réponse de la part des services de {services}","geosearch.badChars":"Les caractères {chars} ne sont pas pris en charge et seront ignorés"}};class S extends w{async added(){a(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",A),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":()=>l(h(()=>import("./screen-oq2ZVtwf-Bo-C8Eeg.js"),__vite__mapDeps([0,1,2]),import.meta.url))},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:E}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.exists("appbar")&&p(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.exists("mapnav")&&g(this.$vApp.$pinia).removeItem("geosearch"),a(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}export{S as default}; diff --git a/main/assets/index-CMEOtVDx-COGZ8GWt.js b/main/assets/index-CMEOtVDx-COGZ8GWt.js new file mode 100644 index 000000000..31e2798c1 --- /dev/null +++ b/main/assets/index-CMEOtVDx-COGZ8GWt.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-D-fcMt_1-DglvgSVM.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); +import{fu as s,_ as o,c5 as d,fW as i,cB as l}from"./main-C7yV2j71.js";class m extends l{toggleMetadata(a,e){const t=this.$iApi.panel.get("metadata");if(e===!1){t.close();return}!t.isOpen||!t.isVisible?this.$iApi.panel.open({id:"metadata",props:{payload:a}}):t.route.props.payload.layer.uid!==a?.layer?.uid||e?t.show({screen:"metadata-screen-content",props:{payload:a}}):t.close()}}const n={en:{"metadata.title":"Metadata","metadata.loading":"Loading...","metadata.error":"There was an error retrieving this resource. Please try again.","metadata.label.no.layer":"No metadata to show because the layer has been removed","metadata.xslt.Abstract":"Abstract","metadata.xslt.Scope":"Scope","metadata.xslt.hereBeScope":"here be scope","metadata.xslt.timePeriod":"Time Period","metadata.xslt.supplementalData":"Supplemental Data","metadata.xslt.contactInfo":"Contact Information","metadata.xslt.resourceProvider":"Resource Provider","metadata.xslt.custodian":"Custodian","metadata.xslt.owner":"Owner","metadata.xslt.user":"User","metadata.xslt.distributor":"Distributor","metadata.xslt.originator":"Originator","metadata.xslt.pointOfContact":"Point of Contact","metadata.xslt.principalInvestigator":"Principal Investigator","metadata.xslt.processor":"Processor","metadata.xslt.publisher":"Publisher","metadata.xslt.author":"Author","metadata.xslt.collaborator":"Collaborator","metadata.xslt.editor":"Editor","metadata.xslt.mediator":"Mediator","metadata.xslt.rightsHolder":"Rights Holder","metadata.xslt.cataloguePage":"Data Catalogue Page","metadata.xslt.metadataPage":"Raw Metadata","metadata.xslt.metadata":"Metadata"},fr:{"metadata.title":"Métadonnées","metadata.loading":"Chargement en cours...","metadata.error":"Une erreur s'est produite lors du chargement de cette ressource. Veuillez essayer de nouveau.","metadata.label.no.layer":"Aucune métadonnée à afficher","metadata.xslt.Abstract":"Résumé","metadata.xslt.Scope":"Portée","metadata.xslt.hereBeScope":"la portée jusqu'ici","metadata.xslt.timePeriod":"Période","metadata.xslt.supplementalData":"Données supplémentaires","metadata.xslt.contactInfo":"Coordonnées","metadata.xslt.resourceProvider":"Fournisseur de la ressource","metadata.xslt.custodian":"Dépositaire","metadata.xslt.owner":"Propriétaire","metadata.xslt.user":"Utilisateur","metadata.xslt.distributor":"Distributeur","metadata.xslt.originator":"Auteur","metadata.xslt.pointOfContact":"Point de contact","metadata.xslt.principalInvestigator":"Chercheur principal","metadata.xslt.processor":"Préparateur","metadata.xslt.publisher":"Éditeur","metadata.xslt.author":"Auteur","metadata.xslt.collaborator":"Collaborateur","metadata.xslt.editor":"Éditeur","metadata.xslt.mediator":"Médiateur","metadata.xslt.rightsHolder":"Titulaire des droits","metadata.xslt.cataloguePage":"Page des données du catalogue","metadata.xslt.metadataPage":"Métadonnées brutes","metadata.xslt.metadata":"Métadonnées"}};class p extends m{async added(){this.$iApi.panel.register({metadata:{screens:{"metadata-screen-content":()=>s(o(()=>import("./screen-D-fcMt_1-DglvgSVM.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{width:"350px"},button:{tooltip:"metadata.title",icon:''},alertName:"metadata.title"}},{i18n:{messages:n}}),this.handlePanelTeleports(["metadata"]),this.removed=()=>{this.$iApi.fixture.exists("appbar")&&d(this.$vApp.$pinia).removeButton("metadata"),i(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("metadata")}}}export{p as default}; diff --git a/main/assets/index-CMEOtVDx-DFb8p2Q0.js b/main/assets/index-CMEOtVDx-DFb8p2Q0.js deleted file mode 100644 index c63ecf033..000000000 --- a/main/assets/index-CMEOtVDx-DFb8p2Q0.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-D-fcMt_1-YQxyJ36o.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); -import{fu as s,_ as o,c5 as d,fW as i,cB as l}from"./main-BZaw9FpY.js";class m extends l{toggleMetadata(a,e){const t=this.$iApi.panel.get("metadata");if(e===!1){t.close();return}!t.isOpen||!t.isVisible?this.$iApi.panel.open({id:"metadata",props:{payload:a}}):t.route.props.payload.layer.uid!==a?.layer?.uid||e?t.show({screen:"metadata-screen-content",props:{payload:a}}):t.close()}}const n={en:{"metadata.title":"Metadata","metadata.loading":"Loading...","metadata.error":"There was an error retrieving this resource. Please try again.","metadata.label.no.layer":"No metadata to show because the layer has been removed","metadata.xslt.Abstract":"Abstract","metadata.xslt.Scope":"Scope","metadata.xslt.hereBeScope":"here be scope","metadata.xslt.timePeriod":"Time Period","metadata.xslt.supplementalData":"Supplemental Data","metadata.xslt.contactInfo":"Contact Information","metadata.xslt.resourceProvider":"Resource Provider","metadata.xslt.custodian":"Custodian","metadata.xslt.owner":"Owner","metadata.xslt.user":"User","metadata.xslt.distributor":"Distributor","metadata.xslt.originator":"Originator","metadata.xslt.pointOfContact":"Point of Contact","metadata.xslt.principalInvestigator":"Principal Investigator","metadata.xslt.processor":"Processor","metadata.xslt.publisher":"Publisher","metadata.xslt.author":"Author","metadata.xslt.collaborator":"Collaborator","metadata.xslt.editor":"Editor","metadata.xslt.mediator":"Mediator","metadata.xslt.rightsHolder":"Rights Holder","metadata.xslt.cataloguePage":"Data Catalogue Page","metadata.xslt.metadataPage":"Raw Metadata","metadata.xslt.metadata":"Metadata"},fr:{"metadata.title":"Métadonnées","metadata.loading":"Chargement en cours...","metadata.error":"Une erreur s'est produite lors du chargement de cette ressource. Veuillez essayer de nouveau.","metadata.label.no.layer":"Aucune métadonnée à afficher","metadata.xslt.Abstract":"Résumé","metadata.xslt.Scope":"Portée","metadata.xslt.hereBeScope":"la portée jusqu'ici","metadata.xslt.timePeriod":"Période","metadata.xslt.supplementalData":"Données supplémentaires","metadata.xslt.contactInfo":"Coordonnées","metadata.xslt.resourceProvider":"Fournisseur de la ressource","metadata.xslt.custodian":"Dépositaire","metadata.xslt.owner":"Propriétaire","metadata.xslt.user":"Utilisateur","metadata.xslt.distributor":"Distributeur","metadata.xslt.originator":"Auteur","metadata.xslt.pointOfContact":"Point de contact","metadata.xslt.principalInvestigator":"Chercheur principal","metadata.xslt.processor":"Préparateur","metadata.xslt.publisher":"Éditeur","metadata.xslt.author":"Auteur","metadata.xslt.collaborator":"Collaborateur","metadata.xslt.editor":"Éditeur","metadata.xslt.mediator":"Médiateur","metadata.xslt.rightsHolder":"Titulaire des droits","metadata.xslt.cataloguePage":"Page des données du catalogue","metadata.xslt.metadataPage":"Métadonnées brutes","metadata.xslt.metadata":"Métadonnées"}};class p extends m{async added(){this.$iApi.panel.register({metadata:{screens:{"metadata-screen-content":()=>s(o(()=>import("./screen-D-fcMt_1-YQxyJ36o.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{width:"350px"},button:{tooltip:"metadata.title",icon:''},alertName:"metadata.title"}},{i18n:{messages:n}}),this.handlePanelTeleports(["metadata"]),this.removed=()=>{this.$iApi.fixture.exists("appbar")&&d(this.$vApp.$pinia).removeButton("metadata"),i(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("metadata")}}}export{p as default}; diff --git a/main/assets/index-CRabsHaP-BibU_USN.js b/main/assets/index-CRabsHaP-BibU_USN.js deleted file mode 100644 index de340fb1a..000000000 --- a/main/assets/index-CRabsHaP-BibU_USN.js +++ /dev/null @@ -1 +0,0 @@ -import{cB as f,fK as y,fL as m,fM as u,c4 as l,fN as w,fO as A,fP as L}from"./main-BZaw9FpY.js";import{a as h,t as $,l as n,s as c}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";class d extends m{config={};mode=h.NONE;constructor(i,e){super(e),this.config=i,this.mode=i.mode}async add(i){this.notImplementedError("addGraphics")}async remove(i){this.notImplementedError("removeGraphics")}async reloadHilight(i){this.notImplementedError("reloadHilight")}async getHilightLayer(){const i=await this.layerFetcher();if(i){if(i.isLoaded&&i instanceof u)return i;console.warn("Hilight layer exists but is in bad form.");return}else{console.warn("Hilight layer could not be fetched.");return}}notImplementedError(i){console.warn(`Hilight mode method ${i} was not implemented by subclass.`)}layerFetcher(){const i=this.$iApi.geo.layer.getLayer(n);return i?Promise.resolve(i):new Promise(e=>{let t=0;const s=setInterval(()=>{const a=this.$iApi.geo.layer.getLayer(n);if(a)clearInterval(s),e(a);else if(t+=125,t>=1125){clearInterval(s),e(void 0);return}},125)})}}class g extends d{async add(i){const e=await this.getHilightLayer();e&&await e.addGraphic(i)}async remove(i){const e=await this.getHilightLayer();e&&e.removeGraphic(i)}async reloadHilight(i){await this.remove(i),await this.add(i)}}class v extends g{handlers=[];onOpacity;offOpacity;lastAdd=0;constructor(i,e){super(i,e),this.onOpacity=i.options?.onOpacity??.75,this.offOpacity=i.options?.offOpacity>.02?i.options.offOpacity:.02,this.$iApi.geo.map.created?this.hilightSetup():this.handlers.push(this.$iApi.event.on(l.MAP_CREATED,()=>{this.hilightSetup()})),this.handlers.push(this.$iApi.event.on(l.MAP_BASEMAPCHANGE,()=>{this.getHilightLayer().then(t=>{t&&t.graphics.length===0&&this.updateFogLayer()})}))}async hilightSetup(){const i=w(this.$vApp.$pinia).activeBasemapConfig;try{const e=this.$iApi.geo.layer.createLayer({id:c,layerType:y.TILE,cosmetic:!0,url:i.layers[0].url});await this.$iApi.geo.map.addLayer(e),e.opacity=this.offOpacity,await this.reorderFogLayer()}catch{console.error("Something went wrong while setting up the hilighter.")}}async updateFogLayer(){this.$iApi.geo.map.removeLayer(c),await this.hilightSetup()}async reorderFogLayer(){const i=this.getFogLayer(),e=await this.getHilightLayer();if(!e||!i)return;const t=this.$iApi.geo.layer.layerOrderIds(),s=t.indexOf(i.id),a=t.indexOf(e.id);a-1&&s>-1&&this.$iApi.geo.map.reorder(e,s,!1)}async add(i){this.lastAdd=Date.now();const e=this.getFogLayer();e&&(e.opacity=this.onOpacity,await super.add(i))}async remove(i){await super.remove(i);const e=this.getFogLayer();if(!e)return;const t=Date.now(),s=await this.getHilightLayer();s&&setTimeout(()=>{this.lastAdd{this.hilightSetup(i)}))}hilightSetup(i){this.$iApi.geo.map.viewPromise.then(()=>{this.$iApi.geo.map.esriView.highlightOptions=i.options})}async add(i){await super.add(i);const e=this.$iApi.geo.layer.getLayer(n);if(e&&e.esriLayer&&e.isLoaded&&e instanceof L){const t=i instanceof Array?i:[i];this.$iApi.geo.map.esriView?.whenLayerView(e.esriLayer)?.then(function(s){s.highlight(t.map(a=>e.getEsriGraphic(a.id)))})}}async remove(i){await super.remove(i)}}class H extends f{hilightMode=new d({},this.$iApi);initialized(){this.initHilightLayer()}_parseConfig(i){if(i)switch(i.mode){case h.NONE:this.hilightMode=new d(i,this.$iApi);break;case h.GLOW:this.hilightMode=new p(i,this.$iApi);break;case h.LIFT:this.hilightMode=new g(i,this.$iApi);break;case h.FOG:this.hilightMode=new v(i,this.$iApi);break;default:console.error("Could not find hilight mode:",i.mode);break}else this.hilightMode=new p($,this.$iApi)}async initHilightLayer(){const i=this.$iApi.geo.layer.createLayer({id:n,layerType:y.GRAPHIC,cosmetic:!0,url:""});await this.$iApi.geo.map.addLayer(i)}async addHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.add(e)}async removeHilight(i){const e=i?i instanceof Array?i:[i]:void 0;await this.hilightMode.remove(e)}async reloadHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.reloadHilight(e)}async getGraphicsByKey(i,e,t){const s=await this.getHilightLayer();if(!s)return[];let a=s.graphics.map(r=>({...this.deconstructGraphicKey(r.id),og:r}));return i&&(a=a.filter(r=>r.origin===i)),e&&(a=a.filter(r=>r.uid===e)),t&&(a=a.filter(r=>r.oid===t)),a.map(r=>r.og)}constructGraphicKey(i,e,t){return`${n}~${i}~${e}~${t}`}deconstructGraphicKey(i){const e=i.split("~");return e.length!==4&&console.warn("Malformed Hilight Graphic key provided:",i),{origin:e[1],uid:e[2],oid:parseInt(e[3])}}async getHilightLayer(){if(this.hilightMode)return await this.hilightMode.getHilightLayer();console.warn("API get layer request before highlight mode object exists")}}class M extends H{async added(){this._parseConfig(this.config);const i=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e));this.removed=()=>{i()}}}export{M as default}; diff --git a/main/assets/index-CRabsHaP-C6iIBq-c.js b/main/assets/index-CRabsHaP-C6iIBq-c.js new file mode 100644 index 000000000..5b5472ffa --- /dev/null +++ b/main/assets/index-CRabsHaP-C6iIBq-c.js @@ -0,0 +1 @@ +import{cB as f,fK as y,fL as m,fM as u,c4 as l,fN as w,fO as A,fP as L}from"./main-C7yV2j71.js";import{a as h,t as $,l as n,s as c}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";class d extends m{config={};mode=h.NONE;constructor(i,e){super(e),this.config=i,this.mode=i.mode}async add(i){this.notImplementedError("addGraphics")}async remove(i){this.notImplementedError("removeGraphics")}async reloadHilight(i){this.notImplementedError("reloadHilight")}async getHilightLayer(){const i=await this.layerFetcher();if(i){if(i.isLoaded&&i instanceof u)return i;console.warn("Hilight layer exists but is in bad form.");return}else{console.warn("Hilight layer could not be fetched.");return}}notImplementedError(i){console.warn(`Hilight mode method ${i} was not implemented by subclass.`)}layerFetcher(){const i=this.$iApi.geo.layer.getLayer(n);return i?Promise.resolve(i):new Promise(e=>{let t=0;const s=setInterval(()=>{const a=this.$iApi.geo.layer.getLayer(n);if(a)clearInterval(s),e(a);else if(t+=125,t>=1125){clearInterval(s),e(void 0);return}},125)})}}class g extends d{async add(i){const e=await this.getHilightLayer();e&&await e.addGraphic(i)}async remove(i){const e=await this.getHilightLayer();e&&e.removeGraphic(i)}async reloadHilight(i){await this.remove(i),await this.add(i)}}class v extends g{handlers=[];onOpacity;offOpacity;lastAdd=0;constructor(i,e){super(i,e),this.onOpacity=i.options?.onOpacity??.75,this.offOpacity=i.options?.offOpacity>.02?i.options.offOpacity:.02,this.$iApi.geo.map.created?this.hilightSetup():this.handlers.push(this.$iApi.event.on(l.MAP_CREATED,()=>{this.hilightSetup()})),this.handlers.push(this.$iApi.event.on(l.MAP_BASEMAPCHANGE,()=>{this.getHilightLayer().then(t=>{t&&t.graphics.length===0&&this.updateFogLayer()})}))}async hilightSetup(){const i=w(this.$vApp.$pinia).activeBasemapConfig;try{const e=this.$iApi.geo.layer.createLayer({id:c,layerType:y.TILE,cosmetic:!0,url:i.layers[0].url});await this.$iApi.geo.map.addLayer(e),e.opacity=this.offOpacity,await this.reorderFogLayer()}catch{console.error("Something went wrong while setting up the hilighter.")}}async updateFogLayer(){this.$iApi.geo.map.removeLayer(c),await this.hilightSetup()}async reorderFogLayer(){const i=this.getFogLayer(),e=await this.getHilightLayer();if(!e||!i)return;const t=this.$iApi.geo.layer.layerOrderIds(),s=t.indexOf(i.id),a=t.indexOf(e.id);a-1&&s>-1&&this.$iApi.geo.map.reorder(e,s,!1)}async add(i){this.lastAdd=Date.now();const e=this.getFogLayer();e&&(e.opacity=this.onOpacity,await super.add(i))}async remove(i){await super.remove(i);const e=this.getFogLayer();if(!e)return;const t=Date.now(),s=await this.getHilightLayer();s&&setTimeout(()=>{this.lastAdd{this.hilightSetup(i)}))}hilightSetup(i){this.$iApi.geo.map.viewPromise.then(()=>{this.$iApi.geo.map.esriView.highlightOptions=i.options})}async add(i){await super.add(i);const e=this.$iApi.geo.layer.getLayer(n);if(e&&e.esriLayer&&e.isLoaded&&e instanceof L){const t=i instanceof Array?i:[i];this.$iApi.geo.map.esriView?.whenLayerView(e.esriLayer)?.then(function(s){s.highlight(t.map(a=>e.getEsriGraphic(a.id)))})}}async remove(i){await super.remove(i)}}class H extends f{hilightMode=new d({},this.$iApi);initialized(){this.initHilightLayer()}_parseConfig(i){if(i)switch(i.mode){case h.NONE:this.hilightMode=new d(i,this.$iApi);break;case h.GLOW:this.hilightMode=new p(i,this.$iApi);break;case h.LIFT:this.hilightMode=new g(i,this.$iApi);break;case h.FOG:this.hilightMode=new v(i,this.$iApi);break;default:console.error("Could not find hilight mode:",i.mode);break}else this.hilightMode=new p($,this.$iApi)}async initHilightLayer(){const i=this.$iApi.geo.layer.createLayer({id:n,layerType:y.GRAPHIC,cosmetic:!0,url:""});await this.$iApi.geo.map.addLayer(i)}async addHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.add(e)}async removeHilight(i){const e=i?i instanceof Array?i:[i]:void 0;await this.hilightMode.remove(e)}async reloadHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.reloadHilight(e)}async getGraphicsByKey(i,e,t){const s=await this.getHilightLayer();if(!s)return[];let a=s.graphics.map(r=>({...this.deconstructGraphicKey(r.id),og:r}));return i&&(a=a.filter(r=>r.origin===i)),e&&(a=a.filter(r=>r.uid===e)),t&&(a=a.filter(r=>r.oid===t)),a.map(r=>r.og)}constructGraphicKey(i,e,t){return`${n}~${i}~${e}~${t}`}deconstructGraphicKey(i){const e=i.split("~");return e.length!==4&&console.warn("Malformed Hilight Graphic key provided:",i),{origin:e[1],uid:e[2],oid:parseInt(e[3])}}async getHilightLayer(){if(this.hilightMode)return await this.hilightMode.getHilightLayer();console.warn("API get layer request before highlight mode object exists")}}class M extends H{async added(){this._parseConfig(this.config);const i=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e));this.removed=()=>{i()}}}export{M as default}; diff --git a/main/assets/index-CWPzg1w2-BKAJsH0v.js b/main/assets/index-CWPzg1w2-BKAJsH0v.js deleted file mode 100644 index c7f30251b..000000000 --- a/main/assets/index-CWPzg1w2-BKAJsH0v.js +++ /dev/null @@ -1 +0,0 @@ -import{a as s}from"./fabric-Df28hv38-J5FIMqqY.js";import{cB as a,fz as n}from"./main-BZaw9FpY.js";class x extends a{get config(){return this.$iApi.fixture.get("export").config?.footnote}make(i){const t=this.config,e={text:"RAMP-PCAR",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0};t?.value!==void 0&&(e.text=t.value);const o=n(e,i||{}),r=new s.fabric.Textbox(o.text,o);return Promise.resolve(r)}}export{x as default}; diff --git a/main/assets/index-CWPzg1w2-D_GivIgX.js b/main/assets/index-CWPzg1w2-D_GivIgX.js new file mode 100644 index 000000000..1a539856a --- /dev/null +++ b/main/assets/index-CWPzg1w2-D_GivIgX.js @@ -0,0 +1 @@ +import{a as s}from"./fabric-Df28hv38-D454t-UP.js";import{cB as a,fz as n}from"./main-C7yV2j71.js";class x extends a{get config(){return this.$iApi.fixture.get("export").config?.footnote}make(i){const t=this.config,e={text:"RAMP-PCAR",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0};t?.value!==void 0&&(e.text=t.value);const o=n(e,i||{}),r=new s.fabric.Textbox(o.text,o);return Promise.resolve(r)}}export{x as default}; diff --git a/main/assets/index-CfINOE3J-Bg6WapfX.js b/main/assets/index-CfINOE3J-Bg6WapfX.js new file mode 100644 index 000000000..39d3ddf93 --- /dev/null +++ b/main/assets/index-CfINOE3J-Bg6WapfX.js @@ -0,0 +1 @@ +import{fD as c,c4 as o,fE as f,cB as r}from"./main-C7yV2j71.js";class A extends r{_parseConfig(t){if(t){const e=c(this.$vApp.$pinia);t.alwaysOn&&e.setAlwaysOn(!0);const i=t.extentSetIds;i&&Array.isArray(i)&&i.length>0&&e.setExtentSetIds(i)}}get config(){return super.config}}function p(a,t,e,i){const n=a-t,s=t+n/2,h=Math.min(n,e-i);return s>e?{min:e-h,max:e,changed:!0}:sthis.config,e=>this._parseConfig(e));this.removed=()=>{t(),c(this.$vApp.$pinia).$reset(),this.evtOff("schemaEH"),this.evtOff("extentEH")},this.schemaEH=this.$iApi.event.on(o.MAP_BASEMAPCHANGE,e=>{e.schemaChanged&&this.checkActive()}),this.$iApi.geo.map.created?this.checkActive():this.$iApi.event.once(o.MAP_CREATED,()=>{this.checkActive()})}checkActive(){const t=c(this.$vApp.$pinia);t.alwaysOn||t.extentSetIds.includes(this.$iApi.geo.map.getExtentSet().id)?t.active||(t.setActive(!0),this.extentEH=this.$iApi.event.on(o.MAP_EXTENTCHANGE,e=>{t.enforcing||this.enforceBoundary(e,!1)})):t.active&&(t.setActive(!1),this.evtOff("extentEH"))}evtOff(t){this[t]&&(this.$iApi.event.off(this[t]),this[t]="")}enforceBoundary(t,e){const i=this.$iApi.geo.map.getExtentSet().maximumExtent,n=p(t.xmax,t.xmin,i.xmax,i.xmin),s=p(t.ymax,t.ymin,i.ymax,i.ymin);if(s.changed||n.changed){e&&(this.$iApi.geo.map.esriView.extent=i.toESRI());const h=f.fromParams("extguard",n.min,s.min,n.max,s.max,t.sr),m=c(this.$vApp.$pinia);m.setEnforcing(!0),setTimeout(()=>{this.$iApi.geo.map.zoomMapTo(h,void 0,!0,400,"ease-in-out").then(()=>{m.setEnforcing(!1),this.enforceBoundary(this.$iApi.geo.map.getExtent(),!0)})},150)}}}export{g as default}; diff --git a/main/assets/index-CfINOE3J-Dlc8hOFR.js b/main/assets/index-CfINOE3J-Dlc8hOFR.js deleted file mode 100644 index 2deb7928d..000000000 --- a/main/assets/index-CfINOE3J-Dlc8hOFR.js +++ /dev/null @@ -1 +0,0 @@ -import{fD as c,c4 as o,fE as f,cB as r}from"./main-BZaw9FpY.js";class A extends r{_parseConfig(t){if(t){const e=c(this.$vApp.$pinia);t.alwaysOn&&e.setAlwaysOn(!0);const i=t.extentSetIds;i&&Array.isArray(i)&&i.length>0&&e.setExtentSetIds(i)}}get config(){return super.config}}function p(a,t,e,i){const n=a-t,s=t+n/2,h=Math.min(n,e-i);return s>e?{min:e-h,max:e,changed:!0}:sthis.config,e=>this._parseConfig(e));this.removed=()=>{t(),c(this.$vApp.$pinia).$reset(),this.evtOff("schemaEH"),this.evtOff("extentEH")},this.schemaEH=this.$iApi.event.on(o.MAP_BASEMAPCHANGE,e=>{e.schemaChanged&&this.checkActive()}),this.$iApi.geo.map.created?this.checkActive():this.$iApi.event.once(o.MAP_CREATED,()=>{this.checkActive()})}checkActive(){const t=c(this.$vApp.$pinia);t.alwaysOn||t.extentSetIds.includes(this.$iApi.geo.map.getExtentSet().id)?t.active||(t.setActive(!0),this.extentEH=this.$iApi.event.on(o.MAP_EXTENTCHANGE,e=>{t.enforcing||this.enforceBoundary(e,!1)})):t.active&&(t.setActive(!1),this.evtOff("extentEH"))}evtOff(t){this[t]&&(this.$iApi.event.off(this[t]),this[t]="")}enforceBoundary(t,e){const i=this.$iApi.geo.map.getExtentSet().maximumExtent,n=p(t.xmax,t.xmin,i.xmax,i.xmin),s=p(t.ymax,t.ymin,i.ymax,i.ymin);if(s.changed||n.changed){e&&(this.$iApi.geo.map.esriView.extent=i.toESRI());const h=f.fromParams("extguard",n.min,s.min,n.max,s.max,t.sr),m=c(this.$vApp.$pinia);m.setEnforcing(!0),setTimeout(()=>{this.$iApi.geo.map.zoomMapTo(h,void 0,!0,400,"ease-in-out").then(()=>{m.setEnforcing(!1),this.enforceBoundary(this.$iApi.geo.map.getExtent(),!0)})},150)}}}export{g as default}; diff --git a/main/assets/index-ChMe1Rap-BNV_tYQB.js b/main/assets/index-ChMe1Rap-BNV_tYQB.js deleted file mode 100644 index dc5dd2e2e..000000000 --- a/main/assets/index-ChMe1Rap-BNV_tYQB.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-CcinMdyM-DogH0BTu.js","./main-BZaw9FpY.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); -import{c2 as l,cB as o,fu as c,_ as m,c5 as r,fw as b,c6 as v,c7 as d,c9 as h,ca as u,cb as f,cc as g,cd as e,cf as w}from"./main-BZaw9FpY.js";const x=l({__name:"nav-button",setup(t){const{t:s}=v(),i=d("iApi"),p=()=>i?.panel.toggle("basemap");return(A,a)=>{const n=h("mapnav-button");return u(),f(n,{onClickFunction:p,tooltip:w(s)("basemap.title")},{default:g(()=>a[0]||(a[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class $ extends o{added(){this.$iApi.component("basemap-nav-button",x),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":()=>c(m(()=>import("./screen-CcinMdyM-DogH0BTu.js"),__vite__mapDeps([0,1,2]),import.meta.url))},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.exists("appbar")&&r(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.exists("mapnav")&&b(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}export{$ as default}; diff --git a/main/assets/index-ChMe1Rap-C5szTdWl.js b/main/assets/index-ChMe1Rap-C5szTdWl.js new file mode 100644 index 000000000..ae9079a21 --- /dev/null +++ b/main/assets/index-ChMe1Rap-C5szTdWl.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-CcinMdyM-CcFAk0iF.js","./main-C7yV2j71.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); +import{c2 as l,cB as o,fu as c,_ as m,c5 as r,fw as b,c6 as v,c7 as d,c9 as h,ca as u,cb as f,cc as g,cd as e,cf as w}from"./main-C7yV2j71.js";const x=l({__name:"nav-button",setup(t){const{t:s}=v(),i=d("iApi"),p=()=>i?.panel.toggle("basemap");return(A,a)=>{const n=h("mapnav-button");return u(),f(n,{onClickFunction:p,tooltip:w(s)("basemap.title")},{default:g(()=>a[0]||(a[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class $ extends o{added(){this.$iApi.component("basemap-nav-button",x),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":()=>c(m(()=>import("./screen-CcinMdyM-CcFAk0iF.js"),__vite__mapDeps([0,1,2]),import.meta.url))},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.exists("appbar")&&r(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.exists("mapnav")&&b(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}export{$ as default}; diff --git a/main/assets/index-CobT58Py-B6-BeYc6.js b/main/assets/index-CobT58Py-B6-BeYc6.js deleted file mode 100644 index 039ceaefe..000000000 --- a/main/assets/index-CobT58Py-B6-BeYc6.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-NGXXpKUs-Gl0YtMtY.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./vue.esm-bundler-D2erd_gM-JC7rsyps.js"])))=>i.map(i=>d[i]); -import{fu as f,_ as p,g7 as y,cB as g,fL as w,fK as i,g8 as n,g9 as h}from"./main-BZaw9FpY.js";class m extends g{toggleWizard(e){const r=this.$iApi.panel.get("wizard");this.$iApi.panel.toggle(r,e)}}class z extends w{layerCount=0;sublayerCount=0;constructor(e){super(e)}async fetchFileInfo(e,r,a){switch(a||(a=await this.$iApi.geo.layer.files.fetchFileData(e,r)),r){case i.GEOJSON:return this.getGeojsonInfo(e,a);case i.SHAPEFILE:return this.getShapfileInfo(e,a);case i.CSV:return this.getCsvInfo(e,a);default:console.error(`Unsupported file type passed to fetchFileInfo - '${r}'`)}}async getGeojsonInfo(e,r){return r instanceof ArrayBuffer&&(r=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r)))),{config:{id:`geojson#${++this.layerCount}`,layerType:i.GEOJSON,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractGeoJsonFields(r)),configOptions:["name","nameField","tooltipField","colour"]}}async getCsvInfo(e,r){return r instanceof ArrayBuffer&&(r=new TextDecoder("utf-8").decode(new Uint8Array(r))),{config:{id:`csv#${++this.layerCount}`,layerType:i.CSV,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractCsvFields(r)),latLonFields:this.$iApi.geo.layer.files.filterCsvLatLonFields(r),configOptions:["name","nameField","tooltipField","latField","longField","colour"]}}async getShapfileInfo(e,r){const a=await this.$iApi.geo.layer.files.shapefileToGeoJson(r);return this.getGeojsonInfo(e,a)}async fetchServiceInfo(e,r,a){switch(r){case i.FEATURE:return this.getFeatureInfo(e);case i.MAPIMAGE:return this.getMapImageInfo(e,a);case i.TILE:return this.getTileInfo(e);case i.IMAGERY:return this.getImageryInfo(e);case i.WFS:return this.getWfsInfo(e);case i.WMS:return this.getWmsInfo(e,a)}}async getFeatureInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.FEATURE}#${++this.layerCount}`,url:e,layerType:i.FEATURE,name:r.data.name,nameField:r.data.displayField,tooltipField:r.data.displayField,state:{opacity:1,visibility:!0}},fields:r.data.fields,configOptions:["name","nameField","tooltipField"]}}async getMapImageInfo(e,r){const a=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.MAPIMAGE}#${++this.layerCount}`,url:e,layerType:i.MAPIMAGE,name:a.data.mapName,sublayers:[],state:{opacity:1,visibility:!0}},layers:this.createLayerHierarchy(a.data.layers,r),configOptions:["name","sublayers"],layersRaw:a.data.layers}}createLayerHierarchy(e,r){e.sort((l,s)=>l.id-s.id);const a=(l,s)=>{if(s===void 0)return!1;let c;if(s.find(o=>o.id===l))return s.find(o=>o.id===l);for(const o of s)if(c=a(l,o.children),c!==!1)return c;return!1},t=[],d=new Set(e.filter(l=>l.subLayerIds&&l.subLayerIds.length>0).map(l=>l.id));for(const l of e)if(r&&l.parentLayerId===-1)t.push({id:l.id,label:l.name,children:l.subLayerIds?[]:void 0});else if(r){const s=a(l.parentLayerId,t);s.children=[...s.children,{id:l.id,label:l.name,children:l.subLayerIds?[]:void 0}]}else d.has(l.id)||t.push({id:l.id,label:l.name,children:void 0});return t}async getTileInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.TILE}#${++this.layerCount}`,url:e,layerType:i.TILE,name:r.data.mapName,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getImageryInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.IMAGERY}#${++this.layerCount}`,url:e,layerType:i.IMAGERY,name:r.data.name,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getWfsInfo(e){const r=new h(e),{offset:a,limit:t}=r.queryMap,d=await this.$iApi.geo.layer.ogc.loadWfsData(e,-1,parseInt(a)||0,parseInt(t)||1e3);return this.getGeojsonInfo(e.match(/\/([^/]+)\/items/)?.[1]||"Layer",d)}async getWmsInfo(e,r){const a=await this.$iApi.geo.layer.ogc.parseCapabilities(e);return{config:{id:`${i.WMS}#${++this.layerCount}`,url:e,layerType:i.WMS,name:e,featureInfoMimeType:a.queryTypes[0],state:{opacity:1,visibility:!0}},layers:this.mapWmsLayerList(a.layers,r),configOptions:["name","sublayers"],layersRaw:a.layers}}mapWmsLayerList(e,r){let a=[];return e.forEach(t=>{t.name===null&&t.layers?a=[...a,...t.layers]:a.push(t)}),r?a.flatMap(t=>({id:`${t.name}#${++this.sublayerCount}`,label:t.title,children:t.layers.length>0?this.mapWmsLayerList(t.layers,r):void 0})):a.flatMap(t=>t.layers&&t.layers.length>0?this.mapWmsLayerList(t.layers,r):{id:`${t.name}#${++this.sublayerCount}`,label:t.title})}guessFormatFromURL(e){switch(e.match(/\.(zip|csv|geojson|json)$/)?.[1]){case"zip":return i.SHAPEFILE;case"csv":return i.CSV;case"geojson":case"json":return i.GEOJSON}return e.match(/\/ImageServer\/?$/gi)?i.IMAGERY:e.match(/\/collections\//gi)?i.WFS:e.match(/arcgis\/rest\/services\//gi)?e.match(/\/\d+\/?$/g)?i.FEATURE:i.MAPIMAGE:e.match(/service=|version=|\/wms/gi)?i.WMS:""}}const E={en:{"wizard.title":"Import Layer","wizard.upload.title":"Upload data","wizard.upload.or":"or","wizard.upload.file.label":"Upload a file","wizard.upload.file.help":"Drop or select a file to upload","wizard.upload.file.error.failed":"File upload failed","wizard.upload.url.label":"URL to file or service","wizard.upload.url.error.required":"URL is required","wizard.upload.url.error.url":"Please enter a valid URL","wizard.format.title":"Select format","wizard.format.type.service":"Service type","wizard.format.type.file":"File format","wizard.format.type.error.required":"Service or file type is required","wizard.format.type.error.invalid":"Invalid file or service type","wizard.format.type.error.failure":"Failed to load data from file/service","wizard.format.info.cors":"Service needs to be CORS enabled","wizard.format.warn.cors":"Service may not support CORS","wizard.format.warn.vpn":"Service may require a VPN connection","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"zipped Shapefile","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"ESRI Feature Layer","wizard.layerType.esriMapImage":"ESRI Map Image Layer","wizard.layerType.esriImagery":"ESRI Imagery Layer","wizard.layerType.esriTile":"ESRI Tile Layer","wizard.layerType.ogcWms":"OGC Web Map Service","wizard.layerType.ogcWfs":"OGC Web Feature Service","wizard.configure.title":"Configure layer","wizard.configure.name.error.required":"Name is required","wizard.configure.name.label":"Layer Name","wizard.configure.nameField.label":"Primary Field","wizard.configure.tooltipField.label":"Tooltip Field","wizard.configure.latField.label":"Latitude Field","wizard.configure.longField.label":"Longitude Field","wizard.configure.sublayers.error.required":"Sublayers are required","wizard.configure.sublayers.label":"Layers","wizard.configure.sublayers.results":"No results","wizard.configure.sublayers.search":"Search layers","wizard.configure.sublayers.select":"Select layer(s)","wizard.configure.sublayers.clearAll":"Clear all","wizard.configure.sublayers.nested":"Nested","wizard.configure.colour.label":"Colour","wizard.configure.colour.hue":"Hue","wizard.configure.colour.copy":"Copy colour","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Cancel","wizard.step.continue":"Continue","wizard.upload.success":"has been uploaded successfully.","wizard.upload.fail":"failed to upload."},fr:{"wizard.title":"Importer un fichier","wizard.upload.title":"Charger des données","wizard.upload.or":"ou","wizard.upload.file.label":"Télécharger un fichier","wizard.upload.file.help":"Déposer ou sélectionner un fichier à télécharger","wizard.upload.file.error.failed":"Le téléchargement du fichier a échoué","wizard.upload.url.label":"URL vers fichier ou service","wizard.upload.url.error.required":"L'URL est requise","wizard.upload.url.error.url":"Veuillez saisir une adresse URL valide","wizard.format.title":"Choisir un format","wizard.format.type.service":"Type de service","wizard.format.type.file":"Format du fichier","wizard.format.type.error.required":"Le service ou le type de fichier est requis","wizard.format.type.error.invalid":"Type de fichier ou de service non valide","wizard.format.type.error.failure":"Échec du chargement des données à partir du fichier/service","wizard.format.info.cors":"Le service doit être compatible CORS.","wizard.format.warn.cors":"Le service ne pend peut-être pas en charge CORS.","wizard.format.warn.vpn":"Le service peut nécessiter une connexion RPV","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"Shapefile zippé","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"Couche d'éléments d'ESRI","wizard.layerType.esriMapImage":"Couche d'image de la carte ESRI","wizard.layerType.esriImagery":"Couche d'imagerie d'ESRI","wizard.layerType.esriTile":"Couche de tuiles d'ESRI","wizard.layerType.ogcWms":"Couche WMS de l'OGC","wizard.layerType.ogcWfs":"Service d'entités Web OGC","wizard.configure.title":"Configurer la couche","wizard.configure.name.error.required":"Le champ Nom est obligatoire","wizard.configure.name.label":"Nom de la couche","wizard.configure.nameField.label":"Champ clé","wizard.configure.tooltipField.label":"Champ infobulle","wizard.configure.latField.label":"Champ latitude","wizard.configure.longField.label":"Champ longitude","wizard.configure.sublayers.error.required":"Des sous-couches sont requises","wizard.configure.sublayers.label":"Couches","wizard.configure.sublayers.results":"Aucun résultat","wizard.configure.sublayers.search":"Rechercher des couches","wizard.configure.sublayers.select":"Sélectionner les couches","wizard.configure.sublayers.clearAll":"Effacer tout","wizard.configure.sublayers.nested":"Imbriquées","wizard.configure.colour.label":"Couleur","wizard.configure.colour.hue":"Teinte","wizard.configure.colour.copy":"Copier la couleur","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Annuler","wizard.step.continue":"Continuer","wizard.upload.success":"a été téléversé avec succès.","wizard.upload.fail":"n'a pas pu être téléversé."}};class I extends m{added(){this.$iApi.panel.register({wizard:{screens:{"wizard-screen":()=>f(p(()=>import("./screen-NGXXpKUs-Gl0YtMtY.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},button:{tooltip:"wizard.title",icon:''},style:{width:"350px"},alertName:"wizard.title"}},{i18n:{messages:E}}),this.handlePanelTeleports(["wizard"]);let e=new z(this.$iApi);const r=y(this.$vApp.$pinia);r.layerSource=e,this.removed=()=>{this.$iApi.panel.remove("wizard"),e=void 0,r.$reset()}}}export{I as default}; diff --git a/main/assets/index-CobT58Py-CX95iANC.js b/main/assets/index-CobT58Py-CX95iANC.js new file mode 100644 index 000000000..88b114517 --- /dev/null +++ b/main/assets/index-CobT58Py-CX95iANC.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-NGXXpKUs-DYcDTJwr.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./vue.esm-bundler-D2erd_gM-CqXNZMaq.js"])))=>i.map(i=>d[i]); +import{fu as f,_ as p,g7 as y,cB as g,fL as w,fK as i,g8 as n,g9 as h}from"./main-C7yV2j71.js";class m extends g{toggleWizard(e){const r=this.$iApi.panel.get("wizard");this.$iApi.panel.toggle(r,e)}}class z extends w{layerCount=0;sublayerCount=0;constructor(e){super(e)}async fetchFileInfo(e,r,a){switch(a||(a=await this.$iApi.geo.layer.files.fetchFileData(e,r)),r){case i.GEOJSON:return this.getGeojsonInfo(e,a);case i.SHAPEFILE:return this.getShapfileInfo(e,a);case i.CSV:return this.getCsvInfo(e,a);default:console.error(`Unsupported file type passed to fetchFileInfo - '${r}'`)}}async getGeojsonInfo(e,r){return r instanceof ArrayBuffer&&(r=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r)))),{config:{id:`geojson#${++this.layerCount}`,layerType:i.GEOJSON,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractGeoJsonFields(r)),configOptions:["name","nameField","tooltipField","colour"]}}async getCsvInfo(e,r){return r instanceof ArrayBuffer&&(r=new TextDecoder("utf-8").decode(new Uint8Array(r))),{config:{id:`csv#${++this.layerCount}`,layerType:i.CSV,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractCsvFields(r)),latLonFields:this.$iApi.geo.layer.files.filterCsvLatLonFields(r),configOptions:["name","nameField","tooltipField","latField","longField","colour"]}}async getShapfileInfo(e,r){const a=await this.$iApi.geo.layer.files.shapefileToGeoJson(r);return this.getGeojsonInfo(e,a)}async fetchServiceInfo(e,r,a){switch(r){case i.FEATURE:return this.getFeatureInfo(e);case i.MAPIMAGE:return this.getMapImageInfo(e,a);case i.TILE:return this.getTileInfo(e);case i.IMAGERY:return this.getImageryInfo(e);case i.WFS:return this.getWfsInfo(e);case i.WMS:return this.getWmsInfo(e,a)}}async getFeatureInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.FEATURE}#${++this.layerCount}`,url:e,layerType:i.FEATURE,name:r.data.name,nameField:r.data.displayField,tooltipField:r.data.displayField,state:{opacity:1,visibility:!0}},fields:r.data.fields,configOptions:["name","nameField","tooltipField"]}}async getMapImageInfo(e,r){const a=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.MAPIMAGE}#${++this.layerCount}`,url:e,layerType:i.MAPIMAGE,name:a.data.mapName,sublayers:[],state:{opacity:1,visibility:!0}},layers:this.createLayerHierarchy(a.data.layers,r),configOptions:["name","sublayers"],layersRaw:a.data.layers}}createLayerHierarchy(e,r){e.sort((l,s)=>l.id-s.id);const a=(l,s)=>{if(s===void 0)return!1;let c;if(s.find(o=>o.id===l))return s.find(o=>o.id===l);for(const o of s)if(c=a(l,o.children),c!==!1)return c;return!1},t=[],d=new Set(e.filter(l=>l.subLayerIds&&l.subLayerIds.length>0).map(l=>l.id));for(const l of e)if(r&&l.parentLayerId===-1)t.push({id:l.id,label:l.name,children:l.subLayerIds?[]:void 0});else if(r){const s=a(l.parentLayerId,t);s.children=[...s.children,{id:l.id,label:l.name,children:l.subLayerIds?[]:void 0}]}else d.has(l.id)||t.push({id:l.id,label:l.name,children:void 0});return t}async getTileInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.TILE}#${++this.layerCount}`,url:e,layerType:i.TILE,name:r.data.mapName,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getImageryInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.IMAGERY}#${++this.layerCount}`,url:e,layerType:i.IMAGERY,name:r.data.name,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getWfsInfo(e){const r=new h(e),{offset:a,limit:t}=r.queryMap,d=await this.$iApi.geo.layer.ogc.loadWfsData(e,-1,parseInt(a)||0,parseInt(t)||1e3);return this.getGeojsonInfo(e.match(/\/([^/]+)\/items/)?.[1]||"Layer",d)}async getWmsInfo(e,r){const a=await this.$iApi.geo.layer.ogc.parseCapabilities(e);return{config:{id:`${i.WMS}#${++this.layerCount}`,url:e,layerType:i.WMS,name:e,featureInfoMimeType:a.queryTypes[0],state:{opacity:1,visibility:!0}},layers:this.mapWmsLayerList(a.layers,r),configOptions:["name","sublayers"],layersRaw:a.layers}}mapWmsLayerList(e,r){let a=[];return e.forEach(t=>{t.name===null&&t.layers?a=[...a,...t.layers]:a.push(t)}),r?a.flatMap(t=>({id:`${t.name}#${++this.sublayerCount}`,label:t.title,children:t.layers.length>0?this.mapWmsLayerList(t.layers,r):void 0})):a.flatMap(t=>t.layers&&t.layers.length>0?this.mapWmsLayerList(t.layers,r):{id:`${t.name}#${++this.sublayerCount}`,label:t.title})}guessFormatFromURL(e){switch(e.match(/\.(zip|csv|geojson|json)$/)?.[1]){case"zip":return i.SHAPEFILE;case"csv":return i.CSV;case"geojson":case"json":return i.GEOJSON}return e.match(/\/ImageServer\/?$/gi)?i.IMAGERY:e.match(/\/collections\//gi)?i.WFS:e.match(/arcgis\/rest\/services\//gi)?e.match(/\/\d+\/?$/g)?i.FEATURE:i.MAPIMAGE:e.match(/service=|version=|\/wms/gi)?i.WMS:""}}const E={en:{"wizard.title":"Import Layer","wizard.upload.title":"Upload data","wizard.upload.or":"or","wizard.upload.file.label":"Upload a file","wizard.upload.file.help":"Drop or select a file to upload","wizard.upload.file.error.failed":"File upload failed","wizard.upload.url.label":"URL to file or service","wizard.upload.url.error.required":"URL is required","wizard.upload.url.error.url":"Please enter a valid URL","wizard.format.title":"Select format","wizard.format.type.service":"Service type","wizard.format.type.file":"File format","wizard.format.type.error.required":"Service or file type is required","wizard.format.type.error.invalid":"Invalid file or service type","wizard.format.type.error.failure":"Failed to load data from file/service","wizard.format.info.cors":"Service needs to be CORS enabled","wizard.format.warn.cors":"Service may not support CORS","wizard.format.warn.vpn":"Service may require a VPN connection","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"zipped Shapefile","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"ESRI Feature Layer","wizard.layerType.esriMapImage":"ESRI Map Image Layer","wizard.layerType.esriImagery":"ESRI Imagery Layer","wizard.layerType.esriTile":"ESRI Tile Layer","wizard.layerType.ogcWms":"OGC Web Map Service","wizard.layerType.ogcWfs":"OGC Web Feature Service","wizard.configure.title":"Configure layer","wizard.configure.name.error.required":"Name is required","wizard.configure.name.label":"Layer Name","wizard.configure.nameField.label":"Primary Field","wizard.configure.tooltipField.label":"Tooltip Field","wizard.configure.latField.label":"Latitude Field","wizard.configure.longField.label":"Longitude Field","wizard.configure.sublayers.error.required":"Sublayers are required","wizard.configure.sublayers.label":"Layers","wizard.configure.sublayers.results":"No results","wizard.configure.sublayers.search":"Search layers","wizard.configure.sublayers.select":"Select layer(s)","wizard.configure.sublayers.clearAll":"Clear all","wizard.configure.sublayers.nested":"Nested","wizard.configure.colour.label":"Colour","wizard.configure.colour.hue":"Hue","wizard.configure.colour.copy":"Copy colour","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Cancel","wizard.step.continue":"Continue","wizard.upload.success":"has been uploaded successfully.","wizard.upload.fail":"failed to upload."},fr:{"wizard.title":"Importer un fichier","wizard.upload.title":"Charger des données","wizard.upload.or":"ou","wizard.upload.file.label":"Télécharger un fichier","wizard.upload.file.help":"Déposer ou sélectionner un fichier à télécharger","wizard.upload.file.error.failed":"Le téléchargement du fichier a échoué","wizard.upload.url.label":"URL vers fichier ou service","wizard.upload.url.error.required":"L'URL est requise","wizard.upload.url.error.url":"Veuillez saisir une adresse URL valide","wizard.format.title":"Choisir un format","wizard.format.type.service":"Type de service","wizard.format.type.file":"Format du fichier","wizard.format.type.error.required":"Le service ou le type de fichier est requis","wizard.format.type.error.invalid":"Type de fichier ou de service non valide","wizard.format.type.error.failure":"Échec du chargement des données à partir du fichier/service","wizard.format.info.cors":"Le service doit être compatible CORS.","wizard.format.warn.cors":"Le service ne pend peut-être pas en charge CORS.","wizard.format.warn.vpn":"Le service peut nécessiter une connexion RPV","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"Shapefile zippé","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"Couche d'éléments d'ESRI","wizard.layerType.esriMapImage":"Couche d'image de la carte ESRI","wizard.layerType.esriImagery":"Couche d'imagerie d'ESRI","wizard.layerType.esriTile":"Couche de tuiles d'ESRI","wizard.layerType.ogcWms":"Couche WMS de l'OGC","wizard.layerType.ogcWfs":"Service d'entités Web OGC","wizard.configure.title":"Configurer la couche","wizard.configure.name.error.required":"Le champ Nom est obligatoire","wizard.configure.name.label":"Nom de la couche","wizard.configure.nameField.label":"Champ clé","wizard.configure.tooltipField.label":"Champ infobulle","wizard.configure.latField.label":"Champ latitude","wizard.configure.longField.label":"Champ longitude","wizard.configure.sublayers.error.required":"Des sous-couches sont requises","wizard.configure.sublayers.label":"Couches","wizard.configure.sublayers.results":"Aucun résultat","wizard.configure.sublayers.search":"Rechercher des couches","wizard.configure.sublayers.select":"Sélectionner les couches","wizard.configure.sublayers.clearAll":"Effacer tout","wizard.configure.sublayers.nested":"Imbriquées","wizard.configure.colour.label":"Couleur","wizard.configure.colour.hue":"Teinte","wizard.configure.colour.copy":"Copier la couleur","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Annuler","wizard.step.continue":"Continuer","wizard.upload.success":"a été téléversé avec succès.","wizard.upload.fail":"n'a pas pu être téléversé."}};class I extends m{added(){this.$iApi.panel.register({wizard:{screens:{"wizard-screen":()=>f(p(()=>import("./screen-NGXXpKUs-DYcDTJwr.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},button:{tooltip:"wizard.title",icon:''},style:{width:"350px"},alertName:"wizard.title"}},{i18n:{messages:E}}),this.handlePanelTeleports(["wizard"]);let e=new z(this.$iApi);const r=y(this.$vApp.$pinia);r.layerSource=e,this.removed=()=>{this.$iApi.panel.remove("wizard"),e=void 0,r.$reset()}}}export{I as default}; diff --git a/main/assets/index-CuDicHX--BC1E38-6.js b/main/assets/index-CuDicHX--BC1E38-6.js deleted file mode 100644 index 66a16d937..000000000 --- a/main/assets/index-CuDicHX--BC1E38-6.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as I,c3 as P,g1 as m,cB as O,c6 as R,c7 as F,fN as $,ch as y,c8 as l,fY as M,cj as k,c4 as d,fZ as T,ck as z,cl as D,ca as g,cm as f,cd as c,ce as H,cn as N,cf as x,fF as L,g2 as W,fK as j,fu as G,g3 as q,f$ as K,g4 as Z,g5 as Y}from"./main-BZaw9FpY.js";class J extends W{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:j.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=m(this.$vApp.$pinia)}async createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const t=typeof e=="string"?await this.findBasemap(e):e;await this.applyBasemap(t),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const i=this.overviewmapStore.expandFactor;this.esriView=G(await q.MapView({map:this.esriMap,container:this._targetDiv,constraints:{rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this.$iApi.geo.map.getExtent().toESRI().expand(i)})),this.esriView.ui.components=[],this.handlers.push({type:"mouse-wheel",handler:this.esriView.on("mouse-wheel",a=>{a.stopPropagation()})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",a=>{a.stopPropagation()})}),this.handlers.push({type:"drag",handler:this.esriView.on("drag",a=>{a.stopPropagation(),this.mapDrag(a)})}),this.esriView.container.addEventListener("touchmove",a=>{a.preventDefault()}),this.esriView.watch("fatalError",()=>{const a=new IntersectionObserver(h=>{h.forEach(n=>{n.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),a.disconnect())})});a.observe(this.esriView.container)}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new K(this.$iApi.geo.map.getExtent(),"overview-graphic"),t=this.overviewmapStore.borderColour??"#FF0000",i=this.overviewmapStore.borderWidth??1,a=this.overviewmapStore.areaColour??"#000000",h=this.overviewmapStore.areaOpacity??.25,n=`${a}${Math.round(h*255).toString(16)}`;e.style=new Z({fill:{colour:n},outline:{colour:t,width:i}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}async removeMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}if(!this.overviewGraphicLayer.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");this.overviewGraphicLayer.removeGraphic(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer),await this.overviewGraphicLayer.terminate()}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}async findBasemap(e){const t=this._basemapStore.find(i=>i.id===e);if(t)return t;{const i=$(this.$vApp.$pinia).config.map;if(i){const a=i.basemaps.find(h=>h.id===e);if(a)return Y.create(a)}}throw new Error(`Invalid basemap id requested: ${e}`)}async setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=await this.findBasemap(e),i=(this.getCurrentBasemapId()?await this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==t.tileSchemaId;return i?(this.destroyMapView(),await this.createMapView(t)):await this.applyBasemap(t),i}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=G(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const t=this.esriView.toMap(e.origin),i=this.esriView.toMap({x:e.x,y:e.y}),a=this.startExtent.clone().offset(i.x-t.x,i.y-t.y,0);this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry=a,e.action==="end"&&(this.$iApi.geo.map.zoomMapTo(this.$iApi.geo.geom.geomEsriToRamp(a),void 0,!1),this.startExtent=null)}}}updateOverview(e){const t=this.overviewmapStore.expandFactor,i=this.zoomMapTo(e.expand(t),void 0,!1),a=this.overviewGraphicLayer.getLocalGraphic("overview-graphic");return this.overviewGraphicLayer.removeGraphic(a),a.geometry=e,this.overviewGraphicLayer.addGraphic(a),i}async cursorHitTest(e){return(await this.esriView.hitTest(e)).results.length>0}}class U extends O{_parseConfig(e){const t=m(this.$vApp.$pinia);t.basemaps=e?.basemaps||{},t.mapConfig.basemaps=e?Object.values(e.basemaps):[],t.startMinimized=e?.startMinimized??!0,t.expandFactor=e?.expandFactor??1.5,t.borderColour=e?.borderColour??"#FF0000",t.borderWidth=e?.borderWidth??1,t.areaColour=e?.areaColour??"#000000",t.areaOpacity=e?.areaOpacity??.25}get config(){return super.config}}const X={class:"relative h-full w-full overflow-hidden"},Q={class:"absolute h-30 w-30 top-0 right-0"},ee=["content","aria-label"],ae=I({__name:"overviewmap",setup(w){const e=m(),{t}=R(),i=F("iApi"),a=$(),h=y(),n=l(()=>a.activeBasemapConfig),A=l(()=>e.mapConfig),b=l(()=>e.basemaps),S=l(()=>e.startMinimized);let r=M(new J(i));const o=y(!0),E=y(!1),v=M([]);k(async()=>{await i.geo.map.viewPromise,u(),await r.createMap(A.value,h.value.querySelector(".overviewmap")),await r.viewPromise,await r.addMapGraphicLayer(),o.value=S.value;let p=r.updateOverview(i.geo.map.getExtent());v.push(i.event.on(d.MAP_EXTENTCHANGE,T(100,s=>{p.then(()=>{r.updateOverview(s)})}))),v.push(i.event.on(d.MAP_CREATED,()=>{u()})),v.push(i.event.on(d.MAP_REFRESH_END,()=>{u()})),v.push(i.event.on(d.MAP_BASEMAPCHANGE,async s=>{!s.schemaChanged&&r.created&&n.value&&b.value[n.value.tileSchemaId]===void 0&&(await r.removeMapGraphicLayer(),await r.setBasemap(s.basemapId),await r.addMapGraphicLayer())}))}),z(()=>{v.forEach(p=>i.event.off(p)),r.destroyMap()});const C=async p=>{E.value=!o.value&&await r.cursorHitTest(p)},V=()=>({height:`${o.value?48:200}px`,width:`${o.value?48:200}px`}),_=()=>({top:`${o.value?-6:-3}px`,right:`${o.value?-6:-3}px`,transform:`rotate(${o.value?225:45}deg)`}),u=()=>{if(!n.value){console.error("Overview Map could not obtain the basemap config used by the main map");return}try{const p=n.value?.tileSchemaId;if(!p)throw new Error("Overview Map could not obtain the tile schema of the main map");const s=b.value[p];if(!s)throw new Error("Overview Map could not find a suitable basemap that matches the tile schema of the main map");r.created?r.viewPromise.then(()=>r.setBasemap(s.id)):e.updateInitialBasemap(s.id)}catch{r.created||e.updateInitialBasemap(n.value.id),r.viewPromise.then(()=>r.setBasemap(n.value.id))}};return(p,s)=>{const B=D("tippy");return g(),f("div",{class:"relative",ref_key:"el",ref:h},[c("div",{style:L(V()),class:"pointer-events-auto absolute top-0 right-0 mt-12 mr-12 shadow-tm border-4 border-solid border-white bg-white transition-all duration-300 ease-out"},[c("div",X,[c("div",{class:H(["overviewmap absolute top-0 right-0 h-192 w-192",{"cursor-move":E.value}]),onMousemove:C},null,34)]),c("div",Q,[N((g(),f("button",{type:"button",tabindex:"0",class:"cursor-pointer absolute h-full w-full",onClick:s[0]||(s[0]=re=>o.value=!o.value),content:x(t)(o.value?"overviewmap.expand":"overviewmap.minimize"),"aria-label":x(t)(o.value?"overviewmap.expand":"overviewmap.minimize")},[(g(),f("svg",{class:"absolute fill-current text-gray-500 transition-all duration-300 ease-out",style:L(_()),xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},s[1]||(s[1]=[c("g",{id:"apple-keyboard-control"},[c("path",{d:"M 19.7782,11.7782L 18.364,13.1924L 12,6.82843L 5.63604,13.1924L 4.22183,11.7782L 12,4L 19.7782,11.7782 Z "})],-1)]),4))],8,ee)),[[B,{placement:"left",hideOnClick:!1}]])])],4)],512)}}}),te=P(ae,[["__scopeId","data-v-cee79589"]]),ie={en:{"overviewmap.expand":"Expand Overview","overviewmap.minimize":"Minimize Overview"},fr:{"overviewmap.expand":"Développer l'aperçu","overviewmap.minimize":"Réduire l'aperçu"}};class oe extends U{added(){Object.entries(ie).forEach(a=>this.$iApi.$i18n.mergeLocaleMessage(...a)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,a=>this._parseConfig(a)),{destroy:t,el:i}=this.mount(te,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(i.childNodes[0]),this.removed=()=>{e(),t(),m(this.$vApp.$pinia).$reset()}}}export{oe as default}; diff --git a/main/assets/index-CuDicHX--CB4ClPSq.js b/main/assets/index-CuDicHX--CB4ClPSq.js new file mode 100644 index 000000000..f0c23e0a5 --- /dev/null +++ b/main/assets/index-CuDicHX--CB4ClPSq.js @@ -0,0 +1 @@ +import{c2 as I,c3 as P,g1 as m,cB as O,c6 as R,c7 as F,fN as $,ch as y,c8 as l,fY as M,cj as k,c4 as d,fZ as T,ck as z,cl as D,ca as g,cm as f,cd as c,ce as H,cn as N,cf as x,fF as L,g2 as W,fK as j,fu as G,g3 as q,f$ as K,g4 as Z,g5 as Y}from"./main-C7yV2j71.js";class J extends W{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:j.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=m(this.$vApp.$pinia)}async createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const t=typeof e=="string"?await this.findBasemap(e):e;await this.applyBasemap(t),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const i=this.overviewmapStore.expandFactor;this.esriView=G(await q.MapView({map:this.esriMap,container:this._targetDiv,constraints:{rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this.$iApi.geo.map.getExtent().toESRI().expand(i)})),this.esriView.ui.components=[],this.handlers.push({type:"mouse-wheel",handler:this.esriView.on("mouse-wheel",a=>{a.stopPropagation()})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",a=>{a.stopPropagation()})}),this.handlers.push({type:"drag",handler:this.esriView.on("drag",a=>{a.stopPropagation(),this.mapDrag(a)})}),this.esriView.container.addEventListener("touchmove",a=>{a.preventDefault()}),this.esriView.watch("fatalError",()=>{const a=new IntersectionObserver(h=>{h.forEach(n=>{n.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),a.disconnect())})});a.observe(this.esriView.container)}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new K(this.$iApi.geo.map.getExtent(),"overview-graphic"),t=this.overviewmapStore.borderColour??"#FF0000",i=this.overviewmapStore.borderWidth??1,a=this.overviewmapStore.areaColour??"#000000",h=this.overviewmapStore.areaOpacity??.25,n=`${a}${Math.round(h*255).toString(16)}`;e.style=new Z({fill:{colour:n},outline:{colour:t,width:i}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}async removeMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}if(!this.overviewGraphicLayer.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");this.overviewGraphicLayer.removeGraphic(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer),await this.overviewGraphicLayer.terminate()}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}async findBasemap(e){const t=this._basemapStore.find(i=>i.id===e);if(t)return t;{const i=$(this.$vApp.$pinia).config.map;if(i){const a=i.basemaps.find(h=>h.id===e);if(a)return Y.create(a)}}throw new Error(`Invalid basemap id requested: ${e}`)}async setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=await this.findBasemap(e),i=(this.getCurrentBasemapId()?await this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==t.tileSchemaId;return i?(this.destroyMapView(),await this.createMapView(t)):await this.applyBasemap(t),i}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=G(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const t=this.esriView.toMap(e.origin),i=this.esriView.toMap({x:e.x,y:e.y}),a=this.startExtent.clone().offset(i.x-t.x,i.y-t.y,0);this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry=a,e.action==="end"&&(this.$iApi.geo.map.zoomMapTo(this.$iApi.geo.geom.geomEsriToRamp(a),void 0,!1),this.startExtent=null)}}}updateOverview(e){const t=this.overviewmapStore.expandFactor,i=this.zoomMapTo(e.expand(t),void 0,!1),a=this.overviewGraphicLayer.getLocalGraphic("overview-graphic");return this.overviewGraphicLayer.removeGraphic(a),a.geometry=e,this.overviewGraphicLayer.addGraphic(a),i}async cursorHitTest(e){return(await this.esriView.hitTest(e)).results.length>0}}class U extends O{_parseConfig(e){const t=m(this.$vApp.$pinia);t.basemaps=e?.basemaps||{},t.mapConfig.basemaps=e?Object.values(e.basemaps):[],t.startMinimized=e?.startMinimized??!0,t.expandFactor=e?.expandFactor??1.5,t.borderColour=e?.borderColour??"#FF0000",t.borderWidth=e?.borderWidth??1,t.areaColour=e?.areaColour??"#000000",t.areaOpacity=e?.areaOpacity??.25}get config(){return super.config}}const X={class:"relative h-full w-full overflow-hidden"},Q={class:"absolute h-30 w-30 top-0 right-0"},ee=["content","aria-label"],ae=I({__name:"overviewmap",setup(w){const e=m(),{t}=R(),i=F("iApi"),a=$(),h=y(),n=l(()=>a.activeBasemapConfig),A=l(()=>e.mapConfig),b=l(()=>e.basemaps),S=l(()=>e.startMinimized);let r=M(new J(i));const o=y(!0),E=y(!1),v=M([]);k(async()=>{await i.geo.map.viewPromise,u(),await r.createMap(A.value,h.value.querySelector(".overviewmap")),await r.viewPromise,await r.addMapGraphicLayer(),o.value=S.value;let p=r.updateOverview(i.geo.map.getExtent());v.push(i.event.on(d.MAP_EXTENTCHANGE,T(100,s=>{p.then(()=>{r.updateOverview(s)})}))),v.push(i.event.on(d.MAP_CREATED,()=>{u()})),v.push(i.event.on(d.MAP_REFRESH_END,()=>{u()})),v.push(i.event.on(d.MAP_BASEMAPCHANGE,async s=>{!s.schemaChanged&&r.created&&n.value&&b.value[n.value.tileSchemaId]===void 0&&(await r.removeMapGraphicLayer(),await r.setBasemap(s.basemapId),await r.addMapGraphicLayer())}))}),z(()=>{v.forEach(p=>i.event.off(p)),r.destroyMap()});const C=async p=>{E.value=!o.value&&await r.cursorHitTest(p)},V=()=>({height:`${o.value?48:200}px`,width:`${o.value?48:200}px`}),_=()=>({top:`${o.value?-6:-3}px`,right:`${o.value?-6:-3}px`,transform:`rotate(${o.value?225:45}deg)`}),u=()=>{if(!n.value){console.error("Overview Map could not obtain the basemap config used by the main map");return}try{const p=n.value?.tileSchemaId;if(!p)throw new Error("Overview Map could not obtain the tile schema of the main map");const s=b.value[p];if(!s)throw new Error("Overview Map could not find a suitable basemap that matches the tile schema of the main map");r.created?r.viewPromise.then(()=>r.setBasemap(s.id)):e.updateInitialBasemap(s.id)}catch{r.created||e.updateInitialBasemap(n.value.id),r.viewPromise.then(()=>r.setBasemap(n.value.id))}};return(p,s)=>{const B=D("tippy");return g(),f("div",{class:"relative",ref_key:"el",ref:h},[c("div",{style:L(V()),class:"pointer-events-auto absolute top-0 right-0 mt-12 mr-12 shadow-tm border-4 border-solid border-white bg-white transition-all duration-300 ease-out"},[c("div",X,[c("div",{class:H(["overviewmap absolute top-0 right-0 h-192 w-192",{"cursor-move":E.value}]),onMousemove:C},null,34)]),c("div",Q,[N((g(),f("button",{type:"button",tabindex:"0",class:"cursor-pointer absolute h-full w-full",onClick:s[0]||(s[0]=re=>o.value=!o.value),content:x(t)(o.value?"overviewmap.expand":"overviewmap.minimize"),"aria-label":x(t)(o.value?"overviewmap.expand":"overviewmap.minimize")},[(g(),f("svg",{class:"absolute fill-current text-gray-500 transition-all duration-300 ease-out",style:L(_()),xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},s[1]||(s[1]=[c("g",{id:"apple-keyboard-control"},[c("path",{d:"M 19.7782,11.7782L 18.364,13.1924L 12,6.82843L 5.63604,13.1924L 4.22183,11.7782L 12,4L 19.7782,11.7782 Z "})],-1)]),4))],8,ee)),[[B,{placement:"left",hideOnClick:!1}]])])],4)],512)}}}),te=P(ae,[["__scopeId","data-v-cee79589"]]),ie={en:{"overviewmap.expand":"Expand Overview","overviewmap.minimize":"Minimize Overview"},fr:{"overviewmap.expand":"Développer l'aperçu","overviewmap.minimize":"Réduire l'aperçu"}};class oe extends U{added(){Object.entries(ie).forEach(a=>this.$iApi.$i18n.mergeLocaleMessage(...a)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,a=>this._parseConfig(a)),{destroy:t,el:i}=this.mount(te,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(i.childNodes[0]),this.removed=()=>{e(),t(),m(this.$vApp.$pinia).$reset()}}}export{oe as default}; diff --git a/main/assets/index-Czft7XuG-DSp7sWP0.js b/main/assets/index-Czft7XuG-DSp7sWP0.js new file mode 100644 index 000000000..58ed84616 --- /dev/null +++ b/main/assets/index-Czft7XuG-DSp7sWP0.js @@ -0,0 +1 @@ +import{c2 as p,c3 as d,g6 as i,c6 as h,c7 as u,ch as v,c8 as g,cj as $,c4 as m,ck as f,ca as A,cm as w,cd as b,cr as _,cf as C,cB as E}from"./main-C7yV2j71.js";const y={en:{"scrollguard.instructions":"Use ctrl + scroll to zoom the map"},fr:{"scrollguard.instructions":"Utilisez les touches Ctrl et + pour faire un zoom de la carte"}},L={class:"sg-label"},q=p({__name:"map-scrollguard",setup(c){const e=i(),{t:r}=h(),s=u("iApi"),t=v(),o=g(()=>e.enabled);$(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0}),s.event.on(m.MAP_CREATED,()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0})})}),f(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.removeEventListener("wheel",l,{capture:!0})});const l=n=>{if(!o.value)return;const a=t.value.classList;n.ctrlKey?(a.remove("sg-active"),a.add("sg-scrolling")):(n.stopPropagation(),a.remove("sg-scrolling"),a.add("sg-active"),window.setTimeout(()=>a.remove("sg-active"),2e3))};return(n,a)=>(A(),w("div",{class:"sg",ref_key:"scrollGuard",ref:t},[b("p",L,_(C(r)("scrollguard.instructions")),1)],512))}}),x=d(q,[["__scopeId","data-v-bf6386a4"]]);class z extends E{setEnabled(e){i(this.$vApp.$pinia).enabled=e}_parseConfig(e){i(this.$vApp.$pinia).enabled=e?.enabled||!1}get config(){return super.config}}class S extends z{added(){Object.entries(y).forEach(t=>this.$iApi.$i18n.mergeLocaleMessage(...t)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t)),{destroy:r,el:s}=this.mount(x,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e(),r(),i(this.$vApp.$pinia).$reset()}}}export{S as default}; diff --git a/main/assets/index-Czft7XuG-pRfu2ETS.js b/main/assets/index-Czft7XuG-pRfu2ETS.js deleted file mode 100644 index e70d3bd7c..000000000 --- a/main/assets/index-Czft7XuG-pRfu2ETS.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as p,c3 as d,g6 as i,c6 as h,c7 as u,ch as v,c8 as g,cj as $,c4 as m,ck as f,ca as A,cm as w,cd as b,cr as _,cf as C,cB as E}from"./main-BZaw9FpY.js";const y={en:{"scrollguard.instructions":"Use ctrl + scroll to zoom the map"},fr:{"scrollguard.instructions":"Utilisez les touches Ctrl et + pour faire un zoom de la carte"}},L={class:"sg-label"},q=p({__name:"map-scrollguard",setup(c){const e=i(),{t:r}=h(),s=u("iApi"),t=v(),o=g(()=>e.enabled);$(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0}),s.event.on(m.MAP_CREATED,()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0})})}),f(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.removeEventListener("wheel",l,{capture:!0})});const l=n=>{if(!o.value)return;const a=t.value.classList;n.ctrlKey?(a.remove("sg-active"),a.add("sg-scrolling")):(n.stopPropagation(),a.remove("sg-scrolling"),a.add("sg-active"),window.setTimeout(()=>a.remove("sg-active"),2e3))};return(n,a)=>(A(),w("div",{class:"sg",ref_key:"scrollGuard",ref:t},[b("p",L,_(C(r)("scrollguard.instructions")),1)],512))}}),x=d(q,[["__scopeId","data-v-bf6386a4"]]);class z extends E{setEnabled(e){i(this.$vApp.$pinia).enabled=e}_parseConfig(e){i(this.$vApp.$pinia).enabled=e?.enabled||!1}get config(){return super.config}}class S extends z{added(){Object.entries(y).forEach(t=>this.$iApi.$i18n.mergeLocaleMessage(...t)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t)),{destroy:r,el:s}=this.mount(x,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e(),r(),i(this.$vApp.$pinia).$reset()}}}export{S as default}; diff --git a/main/assets/index-DDW2D8Uj-B85UqGQ8.js b/main/assets/index-DDW2D8Uj-B85UqGQ8.js new file mode 100644 index 000000000..aa95ad97f --- /dev/null +++ b/main/assets/index-DDW2D8Uj-B85UqGQ8.js @@ -0,0 +1 @@ +import{fu as r,c5 as a,fv as s,cB as n}from"./main-C7yV2j71.js";import o from"./screen-bYjBkDBU-Dkz9oAH4.js";const p={en:{"areas-of-interest.title":"Areas of Interest","areas-of-interest.select":"Select area of interest"},fr:{"areas-of-interest.title":"Zones d'intérêt","areas-of-interest.select":"Sélectionner la zone d'intérêt"}};class f extends n{get config(){return super.config}_parseConfig(e){if(!e)return;const t=s(this.$vApp.$pinia);t.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class h extends f{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":r(o)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:p}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&a(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),s(this.$vApp.$pinia).$reset()}}}export{h as default}; diff --git a/main/assets/index-DDW2D8Uj-BjwR1abY.js b/main/assets/index-DDW2D8Uj-BjwR1abY.js deleted file mode 100644 index 1176ecce1..000000000 --- a/main/assets/index-DDW2D8Uj-BjwR1abY.js +++ /dev/null @@ -1 +0,0 @@ -import{fu as r,c5 as a,fv as s,cB as n}from"./main-BZaw9FpY.js";import o from"./screen-bYjBkDBU-DX1BIa_V.js";const p={en:{"areas-of-interest.title":"Areas of Interest","areas-of-interest.select":"Select area of interest"},fr:{"areas-of-interest.title":"Zones d'intérêt","areas-of-interest.select":"Sélectionner la zone d'intérêt"}};class f extends n{get config(){return super.config}_parseConfig(e){if(!e)return;const t=s(this.$vApp.$pinia);t.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class h extends f{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":r(o)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:p}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&a(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),s(this.$vApp.$pinia).$reset()}}}export{h as default}; diff --git a/main/assets/index-DH-yVcMF-CZH029EB.js b/main/assets/index-DH-yVcMF-CZH029EB.js deleted file mode 100644 index 83785e2a5..000000000 --- a/main/assets/index-DH-yVcMF-CZH029EB.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as w,c3 as E,cB as y,c6 as _,c7 as M,ch as h,fY as m,cj as T,c4 as r,ck as A,ca as x,cm as R,cd as I,cr as P,cf as $}from"./main-BZaw9FpY.js";const D={en:{"panguard.instructions":"Use two fingers to pan the map"},fr:{"panguard.instructions":"Utilisez deux doigts pour faire un panoramique de la carte"}},L={class:"pg-label"},S=w({__name:"map-panguard",setup(v){const{t:p}=_(),t=M("iApi"),s=h(),c=h(-1),o=m([]),n=m([]);T(()=>{u(),n.push(t.event.on(r.MAP_CREATED,()=>{u()})),n.push(t.event.on(r.MAP_DESTROYED,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(r.MAP_REFRESH_START,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(r.MAP_REFRESH_END,()=>{u()}))}),A(()=>{n.forEach(e=>t.event.off(e)),o.forEach(e=>e.remove())});const u=()=>{const e=new Map;t.geo.map.viewPromise.then(()=>{o.push(t.geo.map.esriView.on("pointer-down",a=>{a.pointerType==="touch"&&e.set(a.pointerId,{x:a.x,y:a.y})})),o.push(t.geo.map.esriView.on(["pointer-up","pointer-leave"],a=>{a.pointerType==="touch"&&window.setTimeout(()=>{e.delete(a.pointerId)},200)})),o.push(t.geo.map.esriView.on("pointer-move",a=>{const{pointerId:f,pointerType:g,x:d,y:l}=a,i=e.get(f);if(!i||g!=="touch"||e.size!==1){s.value.classList.remove("pg-active");return}Math.sqrt(Math.pow(d-i.x,2)+Math.pow(l-i.y,2))<20||(s.value.classList.add("pg-active"),c.value!==-1&&clearTimeout(c.value),c.value=window.setTimeout(()=>{s.value.classList.remove("pg-active")},2e3),window.scrollBy(i.x-d,i.y-l))}))})};return(e,a)=>(x(),R("div",{class:"pg",ref_key:"panGuard",ref:s},[I("p",L,P($(p)("panguard.instructions")),1)],512))}}),C=E(S,[["__scopeId","data-v-e91f9000"]]);class b extends y{added(){Object.entries(D).forEach(s=>this.$iApi.$i18n.mergeLocaleMessage(...s));const{destroy:p,el:t}=this.mount(C,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this.removed=()=>{p()}}}export{b as default}; diff --git a/main/assets/index-DH-yVcMF-DOXKl-TW.js b/main/assets/index-DH-yVcMF-DOXKl-TW.js new file mode 100644 index 000000000..4253d5412 --- /dev/null +++ b/main/assets/index-DH-yVcMF-DOXKl-TW.js @@ -0,0 +1 @@ +import{c2 as w,c3 as E,cB as y,c6 as _,c7 as M,ch as h,fY as m,cj as T,c4 as r,ck as A,ca as x,cm as R,cd as I,cr as P,cf as $}from"./main-C7yV2j71.js";const D={en:{"panguard.instructions":"Use two fingers to pan the map"},fr:{"panguard.instructions":"Utilisez deux doigts pour faire un panoramique de la carte"}},L={class:"pg-label"},S=w({__name:"map-panguard",setup(v){const{t:p}=_(),t=M("iApi"),s=h(),c=h(-1),o=m([]),n=m([]);T(()=>{u(),n.push(t.event.on(r.MAP_CREATED,()=>{u()})),n.push(t.event.on(r.MAP_DESTROYED,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(r.MAP_REFRESH_START,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(r.MAP_REFRESH_END,()=>{u()}))}),A(()=>{n.forEach(e=>t.event.off(e)),o.forEach(e=>e.remove())});const u=()=>{const e=new Map;t.geo.map.viewPromise.then(()=>{o.push(t.geo.map.esriView.on("pointer-down",a=>{a.pointerType==="touch"&&e.set(a.pointerId,{x:a.x,y:a.y})})),o.push(t.geo.map.esriView.on(["pointer-up","pointer-leave"],a=>{a.pointerType==="touch"&&window.setTimeout(()=>{e.delete(a.pointerId)},200)})),o.push(t.geo.map.esriView.on("pointer-move",a=>{const{pointerId:f,pointerType:g,x:d,y:l}=a,i=e.get(f);if(!i||g!=="touch"||e.size!==1){s.value.classList.remove("pg-active");return}Math.sqrt(Math.pow(d-i.x,2)+Math.pow(l-i.y,2))<20||(s.value.classList.add("pg-active"),c.value!==-1&&clearTimeout(c.value),c.value=window.setTimeout(()=>{s.value.classList.remove("pg-active")},2e3),window.scrollBy(i.x-d,i.y-l))}))})};return(e,a)=>(x(),R("div",{class:"pg",ref_key:"panGuard",ref:s},[I("p",L,P($(p)("panguard.instructions")),1)],512))}}),C=E(S,[["__scopeId","data-v-e91f9000"]]);class b extends y{added(){Object.entries(D).forEach(s=>this.$iApi.$i18n.mergeLocaleMessage(...s));const{destroy:p,el:t}=this.mount(C,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this.removed=()=>{p()}}}export{b as default}; diff --git a/main/assets/index-DLWeBByc-BMplQTGG.js b/main/assets/index-DLWeBByc-BMplQTGG.js new file mode 100644 index 000000000..7b3ca334f --- /dev/null +++ b/main/assets/index-DLWeBByc-BMplQTGG.js @@ -0,0 +1 @@ +import{cB as k}from"./main-C7yV2j71.js";import{a}from"./fabric-Df28hv38-D454t-UP.js";const _=30,C=20,T=16,F=12,P=8,f=32,S=32,G=350,w=20,g="Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif";class v extends k{get config(){return this.$iApi.fixture.get("export").config?.legend}async make(r){const n=this.$iApi.geo.layer.allLayersOnMap().filter(o=>!o.isCosmetic);if(n.length===0)return new a.fabric.Group([],{originX:"left"});const t=Math.min(n.length,Math.floor(r.width/(G+w))||1),e=(r.width-(t-1)*w)/t;let i=0;const s=(await Promise.all(this._makeSegments(n,e))).map(({title:o,items:m},c)=>{c>0&&(i+=_),o.top=i,i+=o.height+C;const b=m.map(({title:h,items:u},x)=>{const y=[];return h&&!(m.length===1&&h.text===o.text)&&(x>0&&(i+=T),h.top=i,i+=h.height+F,y.push(h)),u.forEach(p=>{p.top=i,i+=p.height+P}),[...y,...u].filter(p=>p)});return new a.fabric.Group([o,...b.flat()])}).flat(),l=this._makeColumns(s,e,t);return Promise.resolve(l)}_makeColumns(r,n,t){let e=0,i=0,s=0;const l=r[r.length-1].aCoords.bl.y/t;return r.forEach((o,m)=>{const c=m!==r.length-1?r[m+1].top-o.top:o.height,b=s>l*(e+1),h=i!==0&&c>l,u=t-e>r.length-m;(b||h||u)&&e{const e=new a.fabric.Textbox(t.name,{fontSize:24,fontFamily:g,width:n}),i=this._getLayerTreeIds(t);let s=[];return s=t.supportsSublayers?await Promise.all(this._makeSegmentChunks(i,t,n)):await Promise.all(this._makeSegmentChunks([-1],t,n)),{title:e,items:s}})}_makeSegmentChunks(r,n,t){const e=n;return r.map(async i=>{const s=i===-1?e:e.getSublayer(i);if(!s)return{title:new a.fabric.Textbox("ERROR",{fontSize:20,fontFamily:g,width:t}),items:[]};await Promise.all(s.legend.map(c=>c.drawPromise));const l=s.legend,o=new a.fabric.Textbox(s.name,{fontSize:20,fontFamily:g,width:t}),m=await Promise.all(this._makeChunkItems(l,t));return{title:o,items:m}})}_makeChunkItems(r,n){return r.map(async t=>{const e=(await I(a.fabric.loadSVGFromString)(t.svgcode))[0];if(t.esriStandard){e.originY="center",e.top=f/2;const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:S+20,top:f/2,width:n-S-20});return new a.fabric.Group([e,i],{height:f})}else{const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:0,top:f/2,width:n}),s=Number(t.imgWidth),l=Number(t.imgHeight),o=Math.min(1,n/s);return e&&(e.originY="center",e.top=l*o/2+f,e.scaleToHeight(l*o),e.scaleToWidth(s*o)),new a.fabric.Group([i,e].filter(Boolean),{height:l*o+f})}})}_getLayerTreeIds(r){const n=[],t=[...r.sublayers];for(;t.length>0;){const e=t.shift();e&&(e.visibility&&n.push(e.layerIdx),t.push(...e.sublayers))}return n}}const I=d=>r=>new Promise(n=>{d(r,t=>{n(t)})});export{v as default}; diff --git a/main/assets/index-DLWeBByc-lUlQN2kJ.js b/main/assets/index-DLWeBByc-lUlQN2kJ.js deleted file mode 100644 index 6caf68071..000000000 --- a/main/assets/index-DLWeBByc-lUlQN2kJ.js +++ /dev/null @@ -1 +0,0 @@ -import{cB as k}from"./main-BZaw9FpY.js";import{a}from"./fabric-Df28hv38-J5FIMqqY.js";const _=30,C=20,T=16,F=12,P=8,f=32,S=32,G=350,w=20,g="Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif";class v extends k{get config(){return this.$iApi.fixture.get("export").config?.legend}async make(r){const n=this.$iApi.geo.layer.allLayersOnMap().filter(o=>!o.isCosmetic);if(n.length===0)return new a.fabric.Group([],{originX:"left"});const t=Math.min(n.length,Math.floor(r.width/(G+w))||1),e=(r.width-(t-1)*w)/t;let i=0;const s=(await Promise.all(this._makeSegments(n,e))).map(({title:o,items:m},c)=>{c>0&&(i+=_),o.top=i,i+=o.height+C;const b=m.map(({title:h,items:u},x)=>{const y=[];return h&&!(m.length===1&&h.text===o.text)&&(x>0&&(i+=T),h.top=i,i+=h.height+F,y.push(h)),u.forEach(p=>{p.top=i,i+=p.height+P}),[...y,...u].filter(p=>p)});return new a.fabric.Group([o,...b.flat()])}).flat(),l=this._makeColumns(s,e,t);return Promise.resolve(l)}_makeColumns(r,n,t){let e=0,i=0,s=0;const l=r[r.length-1].aCoords.bl.y/t;return r.forEach((o,m)=>{const c=m!==r.length-1?r[m+1].top-o.top:o.height,b=s>l*(e+1),h=i!==0&&c>l,u=t-e>r.length-m;(b||h||u)&&e{const e=new a.fabric.Textbox(t.name,{fontSize:24,fontFamily:g,width:n}),i=this._getLayerTreeIds(t);let s=[];return s=t.supportsSublayers?await Promise.all(this._makeSegmentChunks(i,t,n)):await Promise.all(this._makeSegmentChunks([-1],t,n)),{title:e,items:s}})}_makeSegmentChunks(r,n,t){const e=n;return r.map(async i=>{const s=i===-1?e:e.getSublayer(i);if(!s)return{title:new a.fabric.Textbox("ERROR",{fontSize:20,fontFamily:g,width:t}),items:[]};await Promise.all(s.legend.map(c=>c.drawPromise));const l=s.legend,o=new a.fabric.Textbox(s.name,{fontSize:20,fontFamily:g,width:t}),m=await Promise.all(this._makeChunkItems(l,t));return{title:o,items:m}})}_makeChunkItems(r,n){return r.map(async t=>{const e=(await I(a.fabric.loadSVGFromString)(t.svgcode))[0];if(t.esriStandard){e.originY="center",e.top=f/2;const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:S+20,top:f/2,width:n-S-20});return new a.fabric.Group([e,i],{height:f})}else{const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:0,top:f/2,width:n}),s=Number(t.imgWidth),l=Number(t.imgHeight),o=Math.min(1,n/s);return e&&(e.originY="center",e.top=l*o/2+f,e.scaleToHeight(l*o),e.scaleToWidth(s*o)),new a.fabric.Group([i,e].filter(Boolean),{height:l*o+f})}})}_getLayerTreeIds(r){const n=[],t=[...r.sublayers];for(;t.length>0;){const e=t.shift();e&&(e.visibility&&n.push(e.layerIdx),t.push(...e.sublayers))}return n}}const I=d=>r=>new Promise(n=>{d(r,t=>{n(t)})});export{v as default}; diff --git a/main/assets/index-DMxHNnSm-DUAhihws.js b/main/assets/index-DMxHNnSm-DUAhihws.js deleted file mode 100644 index cb42eda68..000000000 --- a/main/assets/index-DMxHNnSm-DUAhihws.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DTrOvIb7-BGa_mWMv.js","./main-BZaw9FpY.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); -import{c2 as p,fu as y,_ as u,c5 as m,fw as v,fQ as a,cB as f,fR as L,fS as s,fT as x,fU as g,fK as b,c6 as I,c7 as E,c9 as A,ca as $,cb as w,cc as _,cd as h,cf as C}from"./main-BZaw9FpY.js";class S extends f{_parseConfig(e){const l=e?.headerControls?.slice()??["wizard","layerReorder","groupToggle","visibilityToggle"];if(a(this.$vApp.$pinia).headerControls=l,!e||!e.root.children)return;a(this.$vApp.$pinia).multilineItems=e.multilineItems?.enabled??!0;const t=[1,2,3,4,5,6];!e.multilineItems?.maxLines||!t.includes(e.multilineItems?.maxLines)?a(this.$vApp.$pinia).maxLines=3:a(this.$vApp.$pinia).maxLines=e.multilineItems.maxLines,this.handlePanelWidths(["legend"]),this.handlePanelTeleports(["legend"]);const i=this.getLayerFixtureConfigs();e.root.children.forEach(r=>{r.layerLegendConfigs=i,this.addItem(r)}),this.$iApi.geo.layer.allLayers().forEach(r=>{this.updateLegend(r)})}createItem(e,l){let t;e.layerId===void 0?t=new L(this.$iApi,e,l):(e.sublayerIndex!==void 0&&(e.layerId=`${e.layerId}-${e.sublayerIndex}`),t=new s(this.$iApi,e,l));const i=e.children;return i&&i.forEach(r=>{e.layerLegendConfigs!==void 0&&(r.layerLegendConfigs=e.layerLegendConfigs),t.children.push(this.createItem(r,t))}),t}addItem(e,l){const t=e instanceof x?e:this.createItem(e,l);return this._insertItem(t,l),t}async addLayerItem(e,l){const t=new s(this.$iApi,{layerId:e.id,sublayerIndex:e.isSublayer?e.layerIdx:void 0,name:e.name},l);return this._insertItem(t,l),this.updateLegend(e),t}get config(){return super.config}getLegend(){return a(this.$vApp.$pinia).children||[]}getLegendConfig(){return{root:{children:this.getLegend().map(e=>e.getConfig())}}}getItem(e){const l=this.getLegend();let t;return l.some(i=>(t=this.searchTreeFirst(i,r=>r.uid===e),t!==void 0)),t}getLayerItem(e){let l,t,i;return typeof e=="string"?(t=e,l=e):(t=e.id,l=e.uid),this.getLegend().some(r=>(i=this.searchTreeFirst(r,n=>n instanceof s&&(n.layerId===t||n.uid===l)),i!==void 0)),i}getAllExpanded(e){const l=e??!0;return this.searchLegend(t=>t.children.length>0&&t.expanded===l)}getAllVisible(e){const l=e??!0;return this.searchLegend(t=>t.visibility===l)}getLayerBoundItems(e){let l="";const t=e instanceof g?e:this.$iApi.geo.layer.getLayer(e);if(t)l=t.isSublayer?t.parentLayer?.id||"":t.id;else return[];return this.searchLegend(i=>i instanceof s&&(i.layerId===l||i.parentLayerId===l))}updateLegend(e){const l=(t,i)=>{const r=this.getLayerItem(t);i?(r&&t instanceof g&&(r.layer=t),r?.error()):r?.load(t instanceof g?t:void 0)};e.loadPromise().then(()=>{let t=this.getLayerItem(e);if(e.layerType===b.MAPIMAGE){const i=r=>{if(r.isLayerRoot&&!r.isLogicalLayer)t=this.getLayerItem(e),l(e,!1),t&&!t.treeGrown&&(r.children.map(n=>this._treeWalker(e,n)).map(n=>this.addItem(n,t)),t.treeGrown=!0),r.children.forEach(n=>i(n));else if(!r.isLayerRoot&&!r.isLogicalLayer){if(t=this.getLayerItem(`${e.id}-${r.layerIdx}`),t){const n=t.getConfig();delete n.layerId,delete n.sublayerIndex,delete n.children,n.name||delete n.name;const d={...this._treeWalker(e,r),...n},o=this.createItem(d);this._replaceItem(t,o)}r.children.forEach(n=>i(n))}else r.isLogicalLayer&&l(this._treeWalker(e,r).layer,!1)};i(e.getLayerTree())}else l(e,!1)}).catch(()=>{l(e,!0),e.supportsSublayers&&e.config.sublayers.forEach(t=>{l(`${e.id}-${t.index}`,!0)})})}expandItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{expanded:e}),i.forEach(r=>{this._toggleState(r,{expanded:e})})}showItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{visibility:e}),i.forEach(r=>{this._toggleState(r,{visibility:e})})}reloadLayerItem(e){const l=this.getLayerBoundItems(e);return l.forEach(t=>t.reload()),l.length>0}removeItem(e){const l=typeof e=="string"?this.getItem(e):e;return l!==void 0?this._deleteItem(l):!1}removeLayerItem(e){const l=this.getLayerItem(e);return l!==void 0?this._deleteItem(l):!1}searchTreeFirst(e,l){if(l(e))return e;{let t;return e.children.some(i=>(t=this.searchTreeFirst(i,l),t!==void 0)),t}}searchTreeAll(e,l){const t=[],i=[e];for(;i.length>0;){const r=i.shift();r&&l(r)&&t.push(r),r&&i.push(...r.children)}return t}searchLegend(e){return this.getLegend().map(l=>this.searchTreeAll(l,e)).flat()}_toggleState(e,l){const t=l.visibility,i=l.expanded;t!==void 0&&e.toggleVisibility(t),i!==void 0&&e.children.length>0&&e.toggleExpanded(i),e.children&&e.children.length>0&&e.children.forEach(r=>{this._toggleState(r,l)})}_insertItem(e,l){a(this.$vApp.$pinia).addItem({item:e,parent:l})}_deleteItem(e){const l=a(this.$vApp.$pinia),t=i=>{i.children.length>0&&i.children.forEach(r=>{t(r)}),i instanceof s&&i.handlers.forEach(r=>this.$iApi.event.off(r)),l.removeItem(i)};return t(e),!0}_replaceItem(e,l){a(this.$vApp.$pinia).replaceItem({oldItem:e,newItem:l})}_treeWalker(e,l,t){const i=(n=>{const d=[e];for(;d.length>0;){const o=d.shift();if(o&&o.uid===n)return o;o&&d.push(...o.sublayers)}})(l.uid),r={};return l.isLayerRoot&&!l.isLogicalLayer?(r.layer=i,r.name=i.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):!l.isLayerRoot&&!l.isLogicalLayer?(r.name=l.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):l.isLogicalLayer&&(r.layer=i,r.name=i.name,r.layerId=i.id,r.sublayerIndex=e.isSublayer?e.layerIdx:void 0),{...r,...t}}}const T=p({__name:"nav-button",setup(c){const{t:e}=I(),l=E("iApi"),t=()=>{l.panel.toggle("legend")};return(i,r)=>{const n=A("mapnav-button");return $(),w(n,{onClickFunction:t,tooltip:C(e)("legend.title")},{default:_(()=>r[0]||(r[0]=[h("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)])),_:1},8,["tooltip"])}}}),R={en:{"legend.title":"Legend","legend.header.addlayer":"Add Layer","legend.header.reorderlayers":"Reorder Layers","legend.header.groups":"Toggle Groups","legend.header.groups.expand":"Expand All","legend.header.groups.collapse":"Collapse All","legend.header.visible":"Toggle Visibility","legend.header.visible.show":"Show All","legend.header.visible.hide":"Hide All","legend.group.expand":"Expand Group","legend.group.collapse":"Collapse Group","legend.visibility.showLayer":"Show layer","legend.visibility.hideLayer":"Hide layer","legend.visibility.showSymbol":"Show symbol","legend.visibility.hideSymbol":"Hide symbol","legend.visibility.showGroup":"Show group","legend.visibility.hideGroup":"Hide group","legend.symbology.expand":"Expand legend","legend.symbology.hide":"Hide legend","legend.symbology.loading":"Loading...","legend.layer.data":"Show more data","legend.layer.data.only":"Layer not on map","legend.layer.offscale":"Layer out of scale","legend.layer.zoomToVisible":"Zoom to visible scale","legend.layer.options":"More options","legend.layer.controls.metadata":"Metadata","legend.layer.controls.settings":"Settings","legend.layer.controls.datatable":"Datatable","legend.layer.controls.symbology":"Legend","legend.layer.controls.boundaryzoom":"Zoom to Layer Boundary","legend.layer.controls.cancel":"Cancel","legend.layer.controls.remove":"Remove","legend.layer.controls.reload":"Reload","legend.layer.controls.reloadDisabled":"Layer cannot be reloaded","legend.alert.symbologyExpanded":"Layer legend expanded","legend.alert.symbologyCollapsed":"Layer legend collapsed","legend.alert.groupExpanded":"Legend group expanded","legend.alert.groupCollapsed":"Legend group collapsed","legend.alert.layerAdded":"{name} layer added to legend","legend.alert.layerRemoved":"{name} layer removed from legend"},fr:{"legend.title":"Légende","legend.header.addlayer":"Ajouter une couche","legend.header.reorderlayers":"Réorganiser les couches","legend.header.groups":"Basculer les Groupes","legend.header.groups.expand":"Élargir les groupes","legend.header.groups.collapse":"Réduire les groupes","legend.header.visible":"Basculer la Visibilité","legend.header.visible.show":"Montrer tout","legend.header.visible.hide":"Cacher tout","legend.group.expand":"Développer un groupe","legend.group.collapse":"Réduire un groupe","legend.visibility.showLayer":"Afficher la couche","legend.visibility.hideLayer":"Masquer la couche","legend.visibility.showSymbol":"Afficher le symbole","legend.visibility.hideSymbol":"Masquer le symbole","legend.visibility.showGroup":"Afficher le groupe","legend.visibility.hideGroup":"Masquer le groupe","legend.symbology.expand":"Développer la légende","legend.symbology.hide":"Masquer la légende","legend.symbology.loading":"Chargement en cours...","legend.layer.data":"Afficher plus de données","legend.layer.data.only":"Couche non visualisable","legend.layer.offscale":"Couche hors de portée","legend.layer.zoomToVisible":"Zoom sur l'échelle visible","legend.layer.options":"Plus d'options","legend.layer.controls.metadata":"Métadonnées","legend.layer.controls.settings":"Paramètres","legend.layer.controls.datatable":"Tableau de données","legend.layer.controls.symbology":"Légende","legend.layer.controls.boundaryzoom":"Zoomer à la limite","legend.layer.controls.cancel":"Annuler","legend.layer.controls.remove":"Retirer","legend.layer.controls.reload":"Recharger","legend.layer.controls.reloadDisabled":"Le calque ne peut pas être rechargé","legend.alert.symbologyExpanded":"Légende de la couche développée","legend.alert.symbologyCollapsed":"Légende de la couche réduite","legend.alert.groupExpanded":"Groupe de légende développé","legend.alert.groupCollapsed":"Groupe de légende réduit","legend.alert.layerAdded":"{name} couche ajoutée à la légende","legend.alert.layerRemoved":"Couche {name} retiré de la légende"}};class G extends S{added(){this.$iApi.component("legend-nav-button",T),this.$iApi.panel.register({legend:{screens:{"legend-screen":()=>y(u(()=>import("./screen-DTrOvIb7-BGa_mWMv.js"),__vite__mapDeps([0,1,2]),import.meta.url))},style:{width:"350px"},alertName:"legend.title",button:{tooltip:"legend.title",icon:''}}},{i18n:{messages:R}}),this._parseConfig(this.config!==void 0?JSON.parse(JSON.stringify(this.config)):void 0);const e=this.$vApp.$watch(()=>this.config,l=>this._parseConfig(l!==void 0?JSON.parse(JSON.stringify(l)):void 0));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&m(this.$vApp.$pinia).removeButton("legend"),this.$iApi.fixture.exists("mapnav")&&v(this.$vApp.$pinia).removeItem("legend"),a().$reset(),this.$iApi.panel.remove("legend")}}}export{G as default}; diff --git a/main/assets/index-DMxHNnSm-DlqN8v2h.js b/main/assets/index-DMxHNnSm-DlqN8v2h.js new file mode 100644 index 000000000..e4d914fbe --- /dev/null +++ b/main/assets/index-DMxHNnSm-DlqN8v2h.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DTrOvIb7-B00U4KYb.js","./main-C7yV2j71.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); +import{c2 as p,fu as y,_ as u,c5 as m,fw as v,fQ as a,cB as f,fR as L,fS as s,fT as x,fU as g,fK as b,c6 as I,c7 as E,c9 as A,ca as $,cb as w,cc as _,cd as h,cf as C}from"./main-C7yV2j71.js";class S extends f{_parseConfig(e){const l=e?.headerControls?.slice()??["wizard","layerReorder","groupToggle","visibilityToggle"];if(a(this.$vApp.$pinia).headerControls=l,!e||!e.root.children)return;a(this.$vApp.$pinia).multilineItems=e.multilineItems?.enabled??!0;const t=[1,2,3,4,5,6];!e.multilineItems?.maxLines||!t.includes(e.multilineItems?.maxLines)?a(this.$vApp.$pinia).maxLines=3:a(this.$vApp.$pinia).maxLines=e.multilineItems.maxLines,this.handlePanelWidths(["legend"]),this.handlePanelTeleports(["legend"]);const i=this.getLayerFixtureConfigs();e.root.children.forEach(r=>{r.layerLegendConfigs=i,this.addItem(r)}),this.$iApi.geo.layer.allLayers().forEach(r=>{this.updateLegend(r)})}createItem(e,l){let t;e.layerId===void 0?t=new L(this.$iApi,e,l):(e.sublayerIndex!==void 0&&(e.layerId=`${e.layerId}-${e.sublayerIndex}`),t=new s(this.$iApi,e,l));const i=e.children;return i&&i.forEach(r=>{e.layerLegendConfigs!==void 0&&(r.layerLegendConfigs=e.layerLegendConfigs),t.children.push(this.createItem(r,t))}),t}addItem(e,l){const t=e instanceof x?e:this.createItem(e,l);return this._insertItem(t,l),t}async addLayerItem(e,l){const t=new s(this.$iApi,{layerId:e.id,sublayerIndex:e.isSublayer?e.layerIdx:void 0,name:e.name},l);return this._insertItem(t,l),this.updateLegend(e),t}get config(){return super.config}getLegend(){return a(this.$vApp.$pinia).children||[]}getLegendConfig(){return{root:{children:this.getLegend().map(e=>e.getConfig())}}}getItem(e){const l=this.getLegend();let t;return l.some(i=>(t=this.searchTreeFirst(i,r=>r.uid===e),t!==void 0)),t}getLayerItem(e){let l,t,i;return typeof e=="string"?(t=e,l=e):(t=e.id,l=e.uid),this.getLegend().some(r=>(i=this.searchTreeFirst(r,n=>n instanceof s&&(n.layerId===t||n.uid===l)),i!==void 0)),i}getAllExpanded(e){const l=e??!0;return this.searchLegend(t=>t.children.length>0&&t.expanded===l)}getAllVisible(e){const l=e??!0;return this.searchLegend(t=>t.visibility===l)}getLayerBoundItems(e){let l="";const t=e instanceof g?e:this.$iApi.geo.layer.getLayer(e);if(t)l=t.isSublayer?t.parentLayer?.id||"":t.id;else return[];return this.searchLegend(i=>i instanceof s&&(i.layerId===l||i.parentLayerId===l))}updateLegend(e){const l=(t,i)=>{const r=this.getLayerItem(t);i?(r&&t instanceof g&&(r.layer=t),r?.error()):r?.load(t instanceof g?t:void 0)};e.loadPromise().then(()=>{let t=this.getLayerItem(e);if(e.layerType===b.MAPIMAGE){const i=r=>{if(r.isLayerRoot&&!r.isLogicalLayer)t=this.getLayerItem(e),l(e,!1),t&&!t.treeGrown&&(r.children.map(n=>this._treeWalker(e,n)).map(n=>this.addItem(n,t)),t.treeGrown=!0),r.children.forEach(n=>i(n));else if(!r.isLayerRoot&&!r.isLogicalLayer){if(t=this.getLayerItem(`${e.id}-${r.layerIdx}`),t){const n=t.getConfig();delete n.layerId,delete n.sublayerIndex,delete n.children,n.name||delete n.name;const d={...this._treeWalker(e,r),...n},o=this.createItem(d);this._replaceItem(t,o)}r.children.forEach(n=>i(n))}else r.isLogicalLayer&&l(this._treeWalker(e,r).layer,!1)};i(e.getLayerTree())}else l(e,!1)}).catch(()=>{l(e,!0),e.supportsSublayers&&e.config.sublayers.forEach(t=>{l(`${e.id}-${t.index}`,!0)})})}expandItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{expanded:e}),i.forEach(r=>{this._toggleState(r,{expanded:e})})}showItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{visibility:e}),i.forEach(r=>{this._toggleState(r,{visibility:e})})}reloadLayerItem(e){const l=this.getLayerBoundItems(e);return l.forEach(t=>t.reload()),l.length>0}removeItem(e){const l=typeof e=="string"?this.getItem(e):e;return l!==void 0?this._deleteItem(l):!1}removeLayerItem(e){const l=this.getLayerItem(e);return l!==void 0?this._deleteItem(l):!1}searchTreeFirst(e,l){if(l(e))return e;{let t;return e.children.some(i=>(t=this.searchTreeFirst(i,l),t!==void 0)),t}}searchTreeAll(e,l){const t=[],i=[e];for(;i.length>0;){const r=i.shift();r&&l(r)&&t.push(r),r&&i.push(...r.children)}return t}searchLegend(e){return this.getLegend().map(l=>this.searchTreeAll(l,e)).flat()}_toggleState(e,l){const t=l.visibility,i=l.expanded;t!==void 0&&e.toggleVisibility(t),i!==void 0&&e.children.length>0&&e.toggleExpanded(i),e.children&&e.children.length>0&&e.children.forEach(r=>{this._toggleState(r,l)})}_insertItem(e,l){a(this.$vApp.$pinia).addItem({item:e,parent:l})}_deleteItem(e){const l=a(this.$vApp.$pinia),t=i=>{i.children.length>0&&i.children.forEach(r=>{t(r)}),i instanceof s&&i.handlers.forEach(r=>this.$iApi.event.off(r)),l.removeItem(i)};return t(e),!0}_replaceItem(e,l){a(this.$vApp.$pinia).replaceItem({oldItem:e,newItem:l})}_treeWalker(e,l,t){const i=(n=>{const d=[e];for(;d.length>0;){const o=d.shift();if(o&&o.uid===n)return o;o&&d.push(...o.sublayers)}})(l.uid),r={};return l.isLayerRoot&&!l.isLogicalLayer?(r.layer=i,r.name=i.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):!l.isLayerRoot&&!l.isLogicalLayer?(r.name=l.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):l.isLogicalLayer&&(r.layer=i,r.name=i.name,r.layerId=i.id,r.sublayerIndex=e.isSublayer?e.layerIdx:void 0),{...r,...t}}}const T=p({__name:"nav-button",setup(c){const{t:e}=I(),l=E("iApi"),t=()=>{l.panel.toggle("legend")};return(i,r)=>{const n=A("mapnav-button");return $(),w(n,{onClickFunction:t,tooltip:C(e)("legend.title")},{default:_(()=>r[0]||(r[0]=[h("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)])),_:1},8,["tooltip"])}}}),R={en:{"legend.title":"Legend","legend.header.addlayer":"Add Layer","legend.header.reorderlayers":"Reorder Layers","legend.header.groups":"Toggle Groups","legend.header.groups.expand":"Expand All","legend.header.groups.collapse":"Collapse All","legend.header.visible":"Toggle Visibility","legend.header.visible.show":"Show All","legend.header.visible.hide":"Hide All","legend.group.expand":"Expand Group","legend.group.collapse":"Collapse Group","legend.visibility.showLayer":"Show layer","legend.visibility.hideLayer":"Hide layer","legend.visibility.showSymbol":"Show symbol","legend.visibility.hideSymbol":"Hide symbol","legend.visibility.showGroup":"Show group","legend.visibility.hideGroup":"Hide group","legend.symbology.expand":"Expand legend","legend.symbology.hide":"Hide legend","legend.symbology.loading":"Loading...","legend.layer.data":"Show more data","legend.layer.data.only":"Layer not on map","legend.layer.offscale":"Layer out of scale","legend.layer.zoomToVisible":"Zoom to visible scale","legend.layer.options":"More options","legend.layer.controls.metadata":"Metadata","legend.layer.controls.settings":"Settings","legend.layer.controls.datatable":"Datatable","legend.layer.controls.symbology":"Legend","legend.layer.controls.boundaryzoom":"Zoom to Layer Boundary","legend.layer.controls.cancel":"Cancel","legend.layer.controls.remove":"Remove","legend.layer.controls.reload":"Reload","legend.layer.controls.reloadDisabled":"Layer cannot be reloaded","legend.alert.symbologyExpanded":"Layer legend expanded","legend.alert.symbologyCollapsed":"Layer legend collapsed","legend.alert.groupExpanded":"Legend group expanded","legend.alert.groupCollapsed":"Legend group collapsed","legend.alert.layerAdded":"{name} layer added to legend","legend.alert.layerRemoved":"{name} layer removed from legend"},fr:{"legend.title":"Légende","legend.header.addlayer":"Ajouter une couche","legend.header.reorderlayers":"Réorganiser les couches","legend.header.groups":"Basculer les Groupes","legend.header.groups.expand":"Élargir les groupes","legend.header.groups.collapse":"Réduire les groupes","legend.header.visible":"Basculer la Visibilité","legend.header.visible.show":"Montrer tout","legend.header.visible.hide":"Cacher tout","legend.group.expand":"Développer un groupe","legend.group.collapse":"Réduire un groupe","legend.visibility.showLayer":"Afficher la couche","legend.visibility.hideLayer":"Masquer la couche","legend.visibility.showSymbol":"Afficher le symbole","legend.visibility.hideSymbol":"Masquer le symbole","legend.visibility.showGroup":"Afficher le groupe","legend.visibility.hideGroup":"Masquer le groupe","legend.symbology.expand":"Développer la légende","legend.symbology.hide":"Masquer la légende","legend.symbology.loading":"Chargement en cours...","legend.layer.data":"Afficher plus de données","legend.layer.data.only":"Couche non visualisable","legend.layer.offscale":"Couche hors de portée","legend.layer.zoomToVisible":"Zoom sur l'échelle visible","legend.layer.options":"Plus d'options","legend.layer.controls.metadata":"Métadonnées","legend.layer.controls.settings":"Paramètres","legend.layer.controls.datatable":"Tableau de données","legend.layer.controls.symbology":"Légende","legend.layer.controls.boundaryzoom":"Zoomer à la limite","legend.layer.controls.cancel":"Annuler","legend.layer.controls.remove":"Retirer","legend.layer.controls.reload":"Recharger","legend.layer.controls.reloadDisabled":"Le calque ne peut pas être rechargé","legend.alert.symbologyExpanded":"Légende de la couche développée","legend.alert.symbologyCollapsed":"Légende de la couche réduite","legend.alert.groupExpanded":"Groupe de légende développé","legend.alert.groupCollapsed":"Groupe de légende réduit","legend.alert.layerAdded":"{name} couche ajoutée à la légende","legend.alert.layerRemoved":"Couche {name} retiré de la légende"}};class G extends S{added(){this.$iApi.component("legend-nav-button",T),this.$iApi.panel.register({legend:{screens:{"legend-screen":()=>y(u(()=>import("./screen-DTrOvIb7-B00U4KYb.js"),__vite__mapDeps([0,1,2]),import.meta.url))},style:{width:"350px"},alertName:"legend.title",button:{tooltip:"legend.title",icon:''}}},{i18n:{messages:R}}),this._parseConfig(this.config!==void 0?JSON.parse(JSON.stringify(this.config)):void 0);const e=this.$vApp.$watch(()=>this.config,l=>this._parseConfig(l!==void 0?JSON.parse(JSON.stringify(l)):void 0));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&m(this.$vApp.$pinia).removeButton("legend"),this.$iApi.fixture.exists("mapnav")&&v(this.$vApp.$pinia).removeItem("legend"),a().$reset(),this.$iApi.panel.remove("legend")}}}export{G as default}; diff --git a/main/assets/index-DRrktYRZ-CXeJFIAZ.js b/main/assets/index-DRrktYRZ-CXeJFIAZ.js deleted file mode 100644 index f39f2c77e..000000000 --- a/main/assets/index-DRrktYRZ-CXeJFIAZ.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as r,cB as i,ch as p,cj as l,ca as c,cm as m,cd as u,c7 as d,c9 as h,cb as b,cc as v}from"./main-BZaw9FpY.js";const f=["src"],g=r({__name:"snowman",props:{fixture:{type:i,required:!0},message:String},setup(s){const e=s,t=p(),n=p("https://i.imgur.com/p13yknD.png");return l(()=>{setTimeout(()=>{t.value.parentNode.removeChild(t.value),e.fixture.remove()},6e3)}),(a,o)=>(c(),m("div",{class:"absolute top-0 right-0",ref_key:"el",ref:t},[u("img",{style:{width:"250px"},src:n.value,alt:"Snowman",srcset:""},null,8,f)],512))}}),w=r({__name:"appbar-button",setup(s){const e=d("iApi"),t=()=>{e.fixture.add("snowman")};return(n,a)=>{const o=h("appbar-button",!0);return c(),b(o,{onClickFunction:t,tooltip:"⛄"},{default:v(()=>a[0]||(a[0]=[u("span",{class:"block h-24"},"⛄",-1)])),_:1})}}});class _ extends i{added(){this.$iApi.component("snowman-appbar-button",w);const{el:e}=this.mount(g,{app:this.$element,props:{message:"This is a snowman prop.",fixture:this}});this.$vApp.$el.appendChild(e.childNodes[0])}removed(){}}export{_ as default}; diff --git a/main/assets/index-DRrktYRZ-Dmrzk5AW.js b/main/assets/index-DRrktYRZ-Dmrzk5AW.js new file mode 100644 index 000000000..22ae5c17c --- /dev/null +++ b/main/assets/index-DRrktYRZ-Dmrzk5AW.js @@ -0,0 +1 @@ +import{c2 as r,cB as i,ch as p,cj as l,ca as c,cm as m,cd as u,c7 as d,c9 as h,cb as b,cc as v}from"./main-C7yV2j71.js";const f=["src"],g=r({__name:"snowman",props:{fixture:{type:i,required:!0},message:String},setup(s){const e=s,t=p(),n=p("https://i.imgur.com/p13yknD.png");return l(()=>{setTimeout(()=>{t.value.parentNode.removeChild(t.value),e.fixture.remove()},6e3)}),(a,o)=>(c(),m("div",{class:"absolute top-0 right-0",ref_key:"el",ref:t},[u("img",{style:{width:"250px"},src:n.value,alt:"Snowman",srcset:""},null,8,f)],512))}}),w=r({__name:"appbar-button",setup(s){const e=d("iApi"),t=()=>{e.fixture.add("snowman")};return(n,a)=>{const o=h("appbar-button",!0);return c(),b(o,{onClickFunction:t,tooltip:"⛄"},{default:v(()=>a[0]||(a[0]=[u("span",{class:"block h-24"},"⛄",-1)])),_:1})}}});class _ extends i{added(){this.$iApi.component("snowman-appbar-button",w);const{el:e}=this.mount(g,{app:this.$element,props:{message:"This is a snowman prop.",fixture:this}});this.$vApp.$el.appendChild(e.childNodes[0])}removed(){}}export{_ as default}; diff --git a/main/assets/index-DY4XJa1m-BzpaGS2E.js b/main/assets/index-DY4XJa1m-BzpaGS2E.js deleted file mode 100644 index 4693501a0..000000000 --- a/main/assets/index-DY4XJa1m-BzpaGS2E.js +++ /dev/null @@ -1 +0,0 @@ -import{a}from"./fabric-Df28hv38-J5FIMqqY.js";import{cB as n,fz as s}from"./main-BZaw9FpY.js";class x extends n{get config(){return this.$iApi.fixture.get("export").config?.title}make(o){const t=this.config,e={text:"RAMP-Map / PCAR-Carte",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:30,top:0,left:0,originX:"center",originY:"top"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),r=new a.fabric.Textbox(i.text,i);return Promise.resolve(r)}}export{x as default}; diff --git a/main/assets/index-DY4XJa1m-swXVZEPg.js b/main/assets/index-DY4XJa1m-swXVZEPg.js new file mode 100644 index 000000000..8ab65635c --- /dev/null +++ b/main/assets/index-DY4XJa1m-swXVZEPg.js @@ -0,0 +1 @@ +import{a}from"./fabric-Df28hv38-D454t-UP.js";import{cB as n,fz as s}from"./main-C7yV2j71.js";class x extends n{get config(){return this.$iApi.fixture.get("export").config?.title}make(o){const t=this.config,e={text:"RAMP-Map / PCAR-Carte",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:30,top:0,left:0,originX:"center",originY:"top"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),r=new a.fabric.Textbox(i.text,i);return Promise.resolve(r)}}export{x as default}; diff --git a/main/assets/index-DfBq89c3-DYn6SqNC.js b/main/assets/index-DfBq89c3-DYn6SqNC.js new file mode 100644 index 000000000..c9db2111d --- /dev/null +++ b/main/assets/index-DfBq89c3-DYn6SqNC.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-N-CoZlcH-zroEhoJH.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./vue.esm-bundler-D2erd_gM-CqXNZMaq.js"])))=>i.map(i=>d[i]); +import{fu as o,_ as l,c5 as s,cB as d}from"./main-C7yV2j71.js";const t={en:{"layer-reorder.title":"Reorder Layers","layer-reorder.nolayers":"No Layers","layer-reorder.loading":"Loading","layer-reorder.expand":"Expand Sublayers","layer-reorder.expanded":"{name} sublayers expanded","layer-reorder.collapse":"Collapse Sublayers","layer-reorder.collapsed":"{name} sublayers collapsed","layer-reorder.move.up":"Move up","layer-reorder.move.down":"Move down","layer-reorder.layermoved":"{name} moved to index {index}"},fr:{"layer-reorder.title":"Réorganiser les couches","layer-reorder.nolayers":"Aucune couche","layer-reorder.loading":"Chargement","layer-reorder.expand":"Développer les sous-couches","layer-reorder.expanded":"Sous-couches {name} développées","layer-reorder.collapse":"Réduire les sous-couches","layer-reorder.collapsed":"Sous-couches {name} réduites","layer-reorder.move.up":"Déplacer vers le haut","layer-reorder.move.down":"Déplacer vers le bas","layer-reorder.layermoved":"{name} déplacé vers l'index {index}"}};class n extends d{toggleLayerReorder(r){const a=this.$iApi.panel.get("layer-reorder");this.$iApi.panel.toggle(a,r)}}class p extends n{added(){this.$iApi.panel.register({"layer-reorder":{screens:{"layer-reorder-screen":()=>o(l(()=>import("./screen-N-CoZlcH-zroEhoJH.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{width:"350px"},button:{tooltip:"layer-reorder.title",icon:''},alertName:"layer-reorder.title"}},{i18n:{messages:t}}),this.handlePanelTeleports(["layer-reorder"])}removed(){this.$iApi.fixture.exists("appbar")&&s(this.$vApp.$pinia).removeButton("layer-reorder"),this.$iApi.panel.remove("layer-reorder")}}export{p as default}; diff --git a/main/assets/index-DfBq89c3-MDA3Qpqd.js b/main/assets/index-DfBq89c3-MDA3Qpqd.js deleted file mode 100644 index 17da0ebc3..000000000 --- a/main/assets/index-DfBq89c3-MDA3Qpqd.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-N-CoZlcH-BOOrXpPL.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./vue.esm-bundler-D2erd_gM-JC7rsyps.js"])))=>i.map(i=>d[i]); -import{fu as o,_ as l,c5 as s,cB as d}from"./main-BZaw9FpY.js";const t={en:{"layer-reorder.title":"Reorder Layers","layer-reorder.nolayers":"No Layers","layer-reorder.loading":"Loading","layer-reorder.expand":"Expand Sublayers","layer-reorder.expanded":"{name} sublayers expanded","layer-reorder.collapse":"Collapse Sublayers","layer-reorder.collapsed":"{name} sublayers collapsed","layer-reorder.move.up":"Move up","layer-reorder.move.down":"Move down","layer-reorder.layermoved":"{name} moved to index {index}"},fr:{"layer-reorder.title":"Réorganiser les couches","layer-reorder.nolayers":"Aucune couche","layer-reorder.loading":"Chargement","layer-reorder.expand":"Développer les sous-couches","layer-reorder.expanded":"Sous-couches {name} développées","layer-reorder.collapse":"Réduire les sous-couches","layer-reorder.collapsed":"Sous-couches {name} réduites","layer-reorder.move.up":"Déplacer vers le haut","layer-reorder.move.down":"Déplacer vers le bas","layer-reorder.layermoved":"{name} déplacé vers l'index {index}"}};class n extends d{toggleLayerReorder(r){const a=this.$iApi.panel.get("layer-reorder");this.$iApi.panel.toggle(a,r)}}class p extends n{added(){this.$iApi.panel.register({"layer-reorder":{screens:{"layer-reorder-screen":()=>o(l(()=>import("./screen-N-CoZlcH-BOOrXpPL.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{width:"350px"},button:{tooltip:"layer-reorder.title",icon:''},alertName:"layer-reorder.title"}},{i18n:{messages:t}}),this.handlePanelTeleports(["layer-reorder"])}removed(){this.$iApi.fixture.exists("appbar")&&s(this.$vApp.$pinia).removeButton("layer-reorder"),this.$iApi.panel.remove("layer-reorder")}}export{p as default}; diff --git a/main/assets/index-DmuJEjwc-Bf8HfrFf.js b/main/assets/index-DmuJEjwc-Bf8HfrFf.js new file mode 100644 index 000000000..40d44432a --- /dev/null +++ b/main/assets/index-DmuJEjwc-Bf8HfrFf.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./details-screen-DE85sbTV-CVHeA4Eo.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./toggle-switch-control-B4JzuvHa-B22huNUa.js"])))=>i.map(i=>d[i]); +import{fu as h,_ as p,c5 as g,fx as m,cB as u,fy as c}from"./main-C7yV2j71.js";import{a as y}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";class f{id;name;template;priority;fields;componentId;constructor(e){const t={...typeof e=="string"?{id:e,template:"",name:"",priority:50}:e};({template:this.template,id:this.id,name:this.name,fields:this.fields,priority:this.priority}=t)}}const o="details";class x extends u{detailsStore=m(this.$vApp.$pinia);get config(){return super.config}openDetails(e){e.forEach(i=>{this._loadDetailsConfig(this.$iApi.geo.layer.getLayer(i.uid))}),this.detailsStore.payload=e;const t=this.$iApi.panel.get("details");this.detailsStore.origin="identify",t.button.tooltip="details.layers.title.identifyOrigin",this.$iApi.panel.get("details").isOpen||this.$iApi.panel.open({id:"details"})}toggleFeature(e,t){const i=this.$iApi.panel.get("details");if(t===!1){i.close(),this.detailsStore.currentFeatureId=void 0;return}const a=this.$iApi.geo.layer.getLayer(e.uid),s=`${e.uid}-${a?.supportsFeatures?e.data[a?.oidField??""]:JSON.stringify(e.data)}`;if(i.isOpen&&s===this.detailsStore.currentFeatureId&&t!==!0){i.close(),this.detailsStore.currentFeatureId=void 0;return}this.detailsStore.origin="toggleEvent",i.button.tooltip="details.layers.title.gridOrigin",this.detailsStore.currentFeatureId=s,this._loadDetailsConfig(a);const l={items:[c.makeRawItem(e.format,e.data)],uid:e.uid,layerId:e.layerId||a?.id||"error-not-found",loading:Promise.resolve(),loaded:!0,errored:!1,requestTime:Date.now()};this.detailsStore.payload=[l],i.isOpen||i.open()}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details"]),this.handlePanelTeleports(["details"]);const t=this.getLayerFixtureConfigs(),i=[];Object.keys(t).forEach(s=>{i.push({id:s,name:t[s].name,template:t[s].template,fields:t[s].fields,priority:t[s].priority??50})});const a=i.map(s=>new f(s));this.detailsStore.properties=a.reduce((s,l)=>(s[l.id]=l,s),{}),this._validateItems()}_loadDetailsConfig(e){if(e&&this.detailsStore.properties[e.id]===void 0){const t=this.getLayerFixtureConfigs()[e.id];t&&this.detailsStore.addConfigProperty({id:e.id,name:t.name,template:t.template,fields:t.fields,priority:t.priority??50})}}_validateItems(){Object.values(this.detailsStore.properties).forEach(e=>{e.template in this.$vApp.$options.components&&(this.detailsStore.properties[e.id].componentId=e.template)})}async hilightDetailsItems(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await a.getGraphicsByKey(o);await a.removeHilight(s);const l=Date.now();this.detailsStore.lastHilight=l;const r=await this.getHilightGraphics(i,t);this.detailsStore.lastHilight===l&&(await a.addHilight(r),this.detailsStore.lastHilight!==l&&a.removeHilight(r))}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const t=await e.getGraphicsByKey(o);await e.removeHilight(t)}}async reloadDetailsHilight(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await this.getHilightGraphics(i,t);a.reloadHilight(s)}}async getHilightGraphics(e,t){const i=this.$iApi.geo.layer.getLayer(t),a=this.$iApi.fixture.get("hilight"),s=[];return i&&await Promise.all(e.map(async l=>{await l.loading;const r=l.data[i.oidField],n=await i.getGraphic(r,{getGeom:!0,getAttribs:!0,getStyle:!0});n.id=a.constructGraphicKey(o,t,r),s.push(n)})),s}onHilightToggle(e,t,i){this.detailsStore.hilightToggle=e,e&&t&&i?this.hilightDetailsItems(t,i):e||this.removeDetailsHilight()}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==y.NONE}}const v={en:{"details.layers.title.identifyOrigin":"Identify Details","details.layers.title.gridOrigin":"Details","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.error":"Error","details.layers.results.empty":"No results found for any layer.","details.layers.results.empty.currentLayer":"No results found for the selected layer.","details.layers.results.empty.noLayers":"No layers for identification.","details.layers.results.list.tooltip":"Use the arrow keys to navigate the items","details.result.default.name":"Identify Item {0}","details.loading":"Loading...","details.items.title":"Details","details.items.range":"{0} - {1} of {2}","details.items.next":"Next page","details.items.previous":"Previous page","details.items.page":"Items per page","details.item.see.list":"See List","details.item.zoom":"Zoom to feature","details.item.zoom.zooming":"Zooming...","details.item.zoom.error":"Zoom failed","details.item.zoom.zoomed":"Zoomed","details.item.previous.item":"Previous item","details.item.next.item":"Next item","details.item.count":"{0} of {1}","details.item.loading":"Loading results...","details.item.no.data":"No data to show because the layer has been removed","details.item.alert.zoom":"Zoomed into feature","details.item.alert.show.item":"Showing result {itemName}","details.item.alert.show.list":"Showing all results for {layerName}","details.item.alert.defaultAltText":"Image associated with {alias} field","details.togglehilight.title":"Toggle Highlight","details.item.open":"Expand","details.item.collapse":"Collapse"},fr:{"details.layers.title.identifyOrigin":"Identifier les détails","details.layers.title.gridOrigin":"Détails","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.error":"Erreur","details.layers.results.empty":"Aucun résultat trouvé pour aucune couche.","details.layers.results.empty.currentLayer":"Aucun résultat trouvé pour la couche sélectionnée.","details.layers.results.empty.noLayers":"Pas de couches pour l'identification.","details.layers.results.list.tooltip":"Utilisez les touches fléchées pour naviguer entre les éléments","details.result.default.name":"Désigner l'élément {0}","details.loading":"Chargement en cours...","details.items.title":"Détails","details.items.range":"{0} - {1} de {2}","details.items.next":"Page suivante","details.items.previous":"Page précédente","details.items.page":"éléments par page","details.item.see.list":"Voir la liste","details.item.zoom":"Zoom à l'élément","details.item.zoom.zooming":"Zoom en cours...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoom terminé","details.item.previous.item":"Élément précédent","details.item.next.item":"Élément suivant","details.item.count":"{0} de {1}","details.item.loading":"Chargement des résultats...","details.item.no.data":"Aucune donnée à afficher","details.item.alert.zoom":"Zoom sur la caractéristique","details.item.alert.show.item":"Affichage du résultat {itemName}","details.item.alert.show.list":"Affichage de tous les résultats pour {layerName}","details.item.alert.defaultAltText":"Image associée au champ {alias}","details.togglehilight.title":"Basculer vers l'élément principal","details.item.open":"Développer","details.item.collapse":"Réduire"}};class A extends x{async added(){this.$iApi.panel.register({details:{screens:{"details-screen":()=>h(p(()=>import("./details-screen-DE85sbTV-CVHeA4Eo.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{width:"425px"},button:{tooltip:"details.layers.title.identifyOrigin",icon:''},alertName:"details.items.title"}},{i18n:{messages:v}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.panel.remove("details"),this.$iApi.fixture.exists("appbar")&&g(this.$vApp.$pinia).removeButton("details"),m(this.$vApp.$pinia).$reset()}}}export{A as default}; diff --git a/main/assets/index-DmuJEjwc-CDkpM4Gs.js b/main/assets/index-DmuJEjwc-CDkpM4Gs.js deleted file mode 100644 index e32731655..000000000 --- a/main/assets/index-DmuJEjwc-CDkpM4Gs.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./details-screen-DE85sbTV-CnDBzoal.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./toggle-switch-control-B4JzuvHa-CnJ57I53.js"])))=>i.map(i=>d[i]); -import{fu as h,_ as p,c5 as g,fx as m,cB as u,fy as c}from"./main-BZaw9FpY.js";import{a as y}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";class f{id;name;template;priority;fields;componentId;constructor(e){const t={...typeof e=="string"?{id:e,template:"",name:"",priority:50}:e};({template:this.template,id:this.id,name:this.name,fields:this.fields,priority:this.priority}=t)}}const o="details";class x extends u{detailsStore=m(this.$vApp.$pinia);get config(){return super.config}openDetails(e){e.forEach(i=>{this._loadDetailsConfig(this.$iApi.geo.layer.getLayer(i.uid))}),this.detailsStore.payload=e;const t=this.$iApi.panel.get("details");this.detailsStore.origin="identify",t.button.tooltip="details.layers.title.identifyOrigin",this.$iApi.panel.get("details").isOpen||this.$iApi.panel.open({id:"details"})}toggleFeature(e,t){const i=this.$iApi.panel.get("details");if(t===!1){i.close(),this.detailsStore.currentFeatureId=void 0;return}const a=this.$iApi.geo.layer.getLayer(e.uid),s=`${e.uid}-${a?.supportsFeatures?e.data[a?.oidField??""]:JSON.stringify(e.data)}`;if(i.isOpen&&s===this.detailsStore.currentFeatureId&&t!==!0){i.close(),this.detailsStore.currentFeatureId=void 0;return}this.detailsStore.origin="toggleEvent",i.button.tooltip="details.layers.title.gridOrigin",this.detailsStore.currentFeatureId=s,this._loadDetailsConfig(a);const l={items:[c.makeRawItem(e.format,e.data)],uid:e.uid,layerId:e.layerId||a?.id||"error-not-found",loading:Promise.resolve(),loaded:!0,errored:!1,requestTime:Date.now()};this.detailsStore.payload=[l],i.isOpen||i.open()}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details"]),this.handlePanelTeleports(["details"]);const t=this.getLayerFixtureConfigs(),i=[];Object.keys(t).forEach(s=>{i.push({id:s,name:t[s].name,template:t[s].template,fields:t[s].fields,priority:t[s].priority??50})});const a=i.map(s=>new f(s));this.detailsStore.properties=a.reduce((s,l)=>(s[l.id]=l,s),{}),this._validateItems()}_loadDetailsConfig(e){if(e&&this.detailsStore.properties[e.id]===void 0){const t=this.getLayerFixtureConfigs()[e.id];t&&this.detailsStore.addConfigProperty({id:e.id,name:t.name,template:t.template,fields:t.fields,priority:t.priority??50})}}_validateItems(){Object.values(this.detailsStore.properties).forEach(e=>{e.template in this.$vApp.$options.components&&(this.detailsStore.properties[e.id].componentId=e.template)})}async hilightDetailsItems(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await a.getGraphicsByKey(o);await a.removeHilight(s);const l=Date.now();this.detailsStore.lastHilight=l;const r=await this.getHilightGraphics(i,t);this.detailsStore.lastHilight===l&&(await a.addHilight(r),this.detailsStore.lastHilight!==l&&a.removeHilight(r))}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const t=await e.getGraphicsByKey(o);await e.removeHilight(t)}}async reloadDetailsHilight(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await this.getHilightGraphics(i,t);a.reloadHilight(s)}}async getHilightGraphics(e,t){const i=this.$iApi.geo.layer.getLayer(t),a=this.$iApi.fixture.get("hilight"),s=[];return i&&await Promise.all(e.map(async l=>{await l.loading;const r=l.data[i.oidField],n=await i.getGraphic(r,{getGeom:!0,getAttribs:!0,getStyle:!0});n.id=a.constructGraphicKey(o,t,r),s.push(n)})),s}onHilightToggle(e,t,i){this.detailsStore.hilightToggle=e,e&&t&&i?this.hilightDetailsItems(t,i):e||this.removeDetailsHilight()}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==y.NONE}}const v={en:{"details.layers.title.identifyOrigin":"Identify Details","details.layers.title.gridOrigin":"Details","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.error":"Error","details.layers.results.empty":"No results found for any layer.","details.layers.results.empty.currentLayer":"No results found for the selected layer.","details.layers.results.empty.noLayers":"No layers for identification.","details.layers.results.list.tooltip":"Use the arrow keys to navigate the items","details.result.default.name":"Identify Item {0}","details.loading":"Loading...","details.items.title":"Details","details.items.range":"{0} - {1} of {2}","details.items.next":"Next page","details.items.previous":"Previous page","details.items.page":"Items per page","details.item.see.list":"See List","details.item.zoom":"Zoom to feature","details.item.zoom.zooming":"Zooming...","details.item.zoom.error":"Zoom failed","details.item.zoom.zoomed":"Zoomed","details.item.previous.item":"Previous item","details.item.next.item":"Next item","details.item.count":"{0} of {1}","details.item.loading":"Loading results...","details.item.no.data":"No data to show because the layer has been removed","details.item.alert.zoom":"Zoomed into feature","details.item.alert.show.item":"Showing result {itemName}","details.item.alert.show.list":"Showing all results for {layerName}","details.item.alert.defaultAltText":"Image associated with {alias} field","details.togglehilight.title":"Toggle Highlight","details.item.open":"Expand","details.item.collapse":"Collapse"},fr:{"details.layers.title.identifyOrigin":"Identifier les détails","details.layers.title.gridOrigin":"Détails","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.error":"Erreur","details.layers.results.empty":"Aucun résultat trouvé pour aucune couche.","details.layers.results.empty.currentLayer":"Aucun résultat trouvé pour la couche sélectionnée.","details.layers.results.empty.noLayers":"Pas de couches pour l'identification.","details.layers.results.list.tooltip":"Utilisez les touches fléchées pour naviguer entre les éléments","details.result.default.name":"Désigner l'élément {0}","details.loading":"Chargement en cours...","details.items.title":"Détails","details.items.range":"{0} - {1} de {2}","details.items.next":"Page suivante","details.items.previous":"Page précédente","details.items.page":"éléments par page","details.item.see.list":"Voir la liste","details.item.zoom":"Zoom à l'élément","details.item.zoom.zooming":"Zoom en cours...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoom terminé","details.item.previous.item":"Élément précédent","details.item.next.item":"Élément suivant","details.item.count":"{0} de {1}","details.item.loading":"Chargement des résultats...","details.item.no.data":"Aucune donnée à afficher","details.item.alert.zoom":"Zoom sur la caractéristique","details.item.alert.show.item":"Affichage du résultat {itemName}","details.item.alert.show.list":"Affichage de tous les résultats pour {layerName}","details.item.alert.defaultAltText":"Image associée au champ {alias}","details.togglehilight.title":"Basculer vers l'élément principal","details.item.open":"Développer","details.item.collapse":"Réduire"}};class A extends x{async added(){this.$iApi.panel.register({details:{screens:{"details-screen":()=>h(p(()=>import("./details-screen-DE85sbTV-CnDBzoal.js"),__vite__mapDeps([0,1,2,3]),import.meta.url))},style:{width:"425px"},button:{tooltip:"details.layers.title.identifyOrigin",icon:''},alertName:"details.items.title"}},{i18n:{messages:v}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.panel.remove("details"),this.$iApi.fixture.exists("appbar")&&g(this.$vApp.$pinia).removeButton("details"),m(this.$vApp.$pinia).$reset()}}}export{A as default}; diff --git a/main/assets/index-DxH-DOHz-2TyCfRCG.js b/main/assets/index-DxH-DOHz-2TyCfRCG.js new file mode 100644 index 000000000..d4be607f2 --- /dev/null +++ b/main/assets/index-DxH-DOHz-2TyCfRCG.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./p2-screen-1-CQoqpp13-CZXJ5tD2.js","./main-C7yV2j71.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); +import{c2 as i,cB as _,fu as m,_ as v,c7 as x,c9 as b,ca as u,cb as g,cc as s,cd as e,fF as G,fG as c,c6 as y,cr as p,cf as h}from"./main-C7yV2j71.js";const A=i({__name:"appbar-button",props:{options:{type:Object}},setup(l){const a=x("iApi"),t=()=>{a.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(n,r)=>{const d=b("appbar-button",!0);return u(),g(d,{onClickFunction:t,tooltip:"Gazebo"},{default:s(()=>[e("span",{style:G({color:l.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),S={class:"flex flex-col items-center"},j=i({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:s(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen A ")])),controls:s(()=>t[2]||(t[2]=[e("a",{href:"javascript:;"},"Option 1",-1),e("a",{href:"javascript:;"},"Option 2",-1),e("a",{href:"javascript:;"},"Option 3",-1)])),content:s(()=>[e("div",S,[e("button",{type:"button",onClick:t[0]||(t[0]=r=>l.panel.show({screen:"p-1-screen-2"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 2 "),t[3]||(t[3]=e("br",null,null,-1)),t[4]||(t[4]=e("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1))])]),_:1},8,["panel"])}}}),B={class:"flex flex-col items-center"},P=i({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:s(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen B ")])),content:s(()=>[e("div",B,[e("button",{type:"button",onClick:t[0]||(t[0]=r=>l.panel.show({screen:"p-1-screen-1"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 1 "),t[2]||(t[2]=e("br",null,null,-1)),t[3]||(t[3]=e("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1))])]),_:1},8,["panel"])}}}),C={class:"flex flex-row justify-center items-center mt-16"},O={class:"mt-16"},k=i({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(l){const a=l,{t}=y(),n=x("iApi"),r=()=>{a.panel.show("p-2-screen-3"),n.event.emit("gazebo/beholdMyText","I am a cat")};return(d,o)=>{const z=b("panel-screen");return u(),g(z,{panel:l.panel},{header:s(()=>o[2]||(o[2]=[c(" Gazebo/Panel 2/Screen B ")])),content:s(()=>[c(p(h(t)("gz.hello2"))+" ",1),e("div",C,[e("button",{type:"button",onClick:o[0]||(o[0]=w=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen B"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),e("button",{type:"button",onClick:o[1]||(o[1]=w=>r()),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," See a cat ")]),e("p",O,p(l.greeting),1)]),_:1},8,["panel"])}}}),D={class:"flex flex-col items-center mt-16"},T={class:"ml-32 font-bold"},I={class:"ml-32 font-bold"},$={class:"ml-32 font-bold"},q=i({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(l){const{t:a}=y({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(t,n)=>{const r=b("panel-screen");return u(),g(r,{panel:l.panel},{header:s(()=>n[1]||(n[1]=[c(" Gazebo/Panel 2/Screen C ")])),content:s(()=>[e("div",D,[e("button",{type:"button",onClick:n[0]||(n[0]=d=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen C"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),n[5]||(n[5]=e("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1)),n[6]||(n[6]=e("p",null,"Locale merging:",-1)),e("dl",null,[n[2]||(n[2]=e("dt",null,"global locale:",-1)),e("dd",T,p(h(a)("lang_native")),1),n[3]||(n[3]=e("dt",null,"fixture locale:",-1)),e("dd",I,p(h(a)("gz.hello")),1),n[4]||(n[4]=e("dt",null,"common panels locale:",-1)),e("dd",$,p(h(a)("who")),1)])])]),_:1},8,["panel"])}}}),f={en:{"gz.hello":"I'm a simple panel - but from a locale file","gz.hello2":"I'm a simple panel","gz.alert1":"Gazebo","gz.alert2":"Gazebo two"},fr:{"gz.hello":'Bonjour. Je suis un panel"',"gz.hello2":'Bonjour. Je suis un panel"',"gz.alert1":"Gazebo","gz.alert2":"Gazebo deux"}},F="gazebo/beholdMyText";class E extends _{added(){this.$iApi.event.registerEventName(F),this.$iApi.component("gazebo-appbar-button",A),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":m(j),"p-1-screen-2":m(P)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:f}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(a=>setTimeout(()=>v(()=>import("./p2-screen-1-CQoqpp13-CZXJ5tD2.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>{a(t)}),2e3)),"p-2-screen-2":m(k),"p-2-screen-3":()=>new Promise(a=>a(m(q)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:f}}),this.handlePanelTeleports(["p1","p2"])}}export{E as default}; diff --git a/main/assets/index-DxH-DOHz-C6kQPUJT.js b/main/assets/index-DxH-DOHz-C6kQPUJT.js deleted file mode 100644 index e1a8be572..000000000 --- a/main/assets/index-DxH-DOHz-C6kQPUJT.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./p2-screen-1-CQoqpp13-ChnzALvi.js","./main-BZaw9FpY.js","./main-DDePfy-e.css"])))=>i.map(i=>d[i]); -import{c2 as i,cB as _,fu as m,_ as v,c7 as x,c9 as b,ca as u,cb as g,cc as s,cd as e,fF as G,fG as c,c6 as y,cr as p,cf as h}from"./main-BZaw9FpY.js";const A=i({__name:"appbar-button",props:{options:{type:Object}},setup(l){const a=x("iApi"),t=()=>{a.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(n,r)=>{const d=b("appbar-button",!0);return u(),g(d,{onClickFunction:t,tooltip:"Gazebo"},{default:s(()=>[e("span",{style:G({color:l.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),S={class:"flex flex-col items-center"},j=i({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:s(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen A ")])),controls:s(()=>t[2]||(t[2]=[e("a",{href:"javascript:;"},"Option 1",-1),e("a",{href:"javascript:;"},"Option 2",-1),e("a",{href:"javascript:;"},"Option 3",-1)])),content:s(()=>[e("div",S,[e("button",{type:"button",onClick:t[0]||(t[0]=r=>l.panel.show({screen:"p-1-screen-2"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 2 "),t[3]||(t[3]=e("br",null,null,-1)),t[4]||(t[4]=e("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1))])]),_:1},8,["panel"])}}}),B={class:"flex flex-col items-center"},P=i({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:s(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen B ")])),content:s(()=>[e("div",B,[e("button",{type:"button",onClick:t[0]||(t[0]=r=>l.panel.show({screen:"p-1-screen-1"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 1 "),t[2]||(t[2]=e("br",null,null,-1)),t[3]||(t[3]=e("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1))])]),_:1},8,["panel"])}}}),C={class:"flex flex-row justify-center items-center mt-16"},O={class:"mt-16"},k=i({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(l){const a=l,{t}=y(),n=x("iApi"),r=()=>{a.panel.show("p-2-screen-3"),n.event.emit("gazebo/beholdMyText","I am a cat")};return(d,o)=>{const z=b("panel-screen");return u(),g(z,{panel:l.panel},{header:s(()=>o[2]||(o[2]=[c(" Gazebo/Panel 2/Screen B ")])),content:s(()=>[c(p(h(t)("gz.hello2"))+" ",1),e("div",C,[e("button",{type:"button",onClick:o[0]||(o[0]=w=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen B"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),e("button",{type:"button",onClick:o[1]||(o[1]=w=>r()),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," See a cat ")]),e("p",O,p(l.greeting),1)]),_:1},8,["panel"])}}}),D={class:"flex flex-col items-center mt-16"},T={class:"ml-32 font-bold"},I={class:"ml-32 font-bold"},$={class:"ml-32 font-bold"},q=i({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(l){const{t:a}=y({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(t,n)=>{const r=b("panel-screen");return u(),g(r,{panel:l.panel},{header:s(()=>n[1]||(n[1]=[c(" Gazebo/Panel 2/Screen C ")])),content:s(()=>[e("div",D,[e("button",{type:"button",onClick:n[0]||(n[0]=d=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen C"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),n[5]||(n[5]=e("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1)),n[6]||(n[6]=e("p",null,"Locale merging:",-1)),e("dl",null,[n[2]||(n[2]=e("dt",null,"global locale:",-1)),e("dd",T,p(h(a)("lang_native")),1),n[3]||(n[3]=e("dt",null,"fixture locale:",-1)),e("dd",I,p(h(a)("gz.hello")),1),n[4]||(n[4]=e("dt",null,"common panels locale:",-1)),e("dd",$,p(h(a)("who")),1)])])]),_:1},8,["panel"])}}}),f={en:{"gz.hello":"I'm a simple panel - but from a locale file","gz.hello2":"I'm a simple panel","gz.alert1":"Gazebo","gz.alert2":"Gazebo two"},fr:{"gz.hello":'Bonjour. Je suis un panel"',"gz.hello2":'Bonjour. Je suis un panel"',"gz.alert1":"Gazebo","gz.alert2":"Gazebo deux"}},F="gazebo/beholdMyText";class E extends _{added(){this.$iApi.event.registerEventName(F),this.$iApi.component("gazebo-appbar-button",A),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":m(j),"p-1-screen-2":m(P)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:f}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(a=>setTimeout(()=>v(()=>import("./p2-screen-1-CQoqpp13-ChnzALvi.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>{a(t)}),2e3)),"p-2-screen-2":m(k),"p-2-screen-3":()=>new Promise(a=>a(m(q)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:f}}),this.handlePanelTeleports(["p1","p2"])}}export{E as default}; diff --git a/main/assets/index-I3HFsMjx-C-SKSdV5.js b/main/assets/index-I3HFsMjx-C-SKSdV5.js new file mode 100644 index 000000000..81932a5fb --- /dev/null +++ b/main/assets/index-I3HFsMjx-C-SKSdV5.js @@ -0,0 +1 @@ +import{c2 as d,c3 as r,cB as p,c7 as v,ch as h,cj as n,c4 as l,ck as u,ca as f,cm as m,cd as t,ce as w}from"./main-C7yV2j71.js";const M=d({__name:"crosshairs",setup(c){const e=v("iApi"),s=h(!1),a=h([]);return n(()=>{a.value.push(e.event.on(l.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(s.value=!0)})),a.value.push(e.event.on(l.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(s.value=!0)})),a.value.push(e.event.on(l.MAP_MOUSEDOWN,()=>{s.value=!1})),a.value.push(e.event.on(l.MAP_BLUR,()=>{s.value=!1}))}),u(()=>{a.value.forEach(i=>e.event.off(i))}),(i,o)=>(f(),m("div",{class:w(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!s.value}])},o[0]||(o[0]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[t("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[t("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),t("path",{d:"M.045 12.047l6.093.051 4.264.068v-.332l-4.264.067-6.093.064v.039z",id:"rect4632-6","stroke-width":".09"}),t("path",{d:"M12.047 23.955l.051-6.093.068-4.264h-.332l.067 4.264.064 6.093h.039z",id:"rect4632-6-0","stroke-width":".09"}),t("path",{d:"M23.955 11.953l-6.093-.051-4.264-.068v.332l4.264-.067 6.093-.064v-.039z",id:"rect4632-6-4","stroke-width":".09"}),t("path",{d:"M11.953.045l-.051 6.093-.068 4.264h.332l-.067-4.264-.064-6.093h-.039z",id:"rect4632-6-9","stroke-width":".09"})])],-1)]),2))}}),A=r(M,[["__scopeId","data-v-55a2f166"]]);class g extends p{added(){const{destroy:e,el:s}=this.mount(A,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e()}}}export{g as default}; diff --git a/main/assets/index-I3HFsMjx-CG5Sm96R.js b/main/assets/index-I3HFsMjx-CG5Sm96R.js deleted file mode 100644 index dbdfc245d..000000000 --- a/main/assets/index-I3HFsMjx-CG5Sm96R.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as d,c3 as r,cB as p,c7 as v,ch as h,cj as n,c4 as l,ck as u,ca as f,cm as m,cd as t,ce as w}from"./main-BZaw9FpY.js";const M=d({__name:"crosshairs",setup(c){const e=v("iApi"),s=h(!1),a=h([]);return n(()=>{a.value.push(e.event.on(l.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(s.value=!0)})),a.value.push(e.event.on(l.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(s.value=!0)})),a.value.push(e.event.on(l.MAP_MOUSEDOWN,()=>{s.value=!1})),a.value.push(e.event.on(l.MAP_BLUR,()=>{s.value=!1}))}),u(()=>{a.value.forEach(i=>e.event.off(i))}),(i,o)=>(f(),m("div",{class:w(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!s.value}])},o[0]||(o[0]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[t("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[t("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),t("path",{d:"M.045 12.047l6.093.051 4.264.068v-.332l-4.264.067-6.093.064v.039z",id:"rect4632-6","stroke-width":".09"}),t("path",{d:"M12.047 23.955l.051-6.093.068-4.264h-.332l.067 4.264.064 6.093h.039z",id:"rect4632-6-0","stroke-width":".09"}),t("path",{d:"M23.955 11.953l-6.093-.051-4.264-.068v.332l4.264-.067 6.093-.064v-.039z",id:"rect4632-6-4","stroke-width":".09"}),t("path",{d:"M11.953.045l-.051 6.093-.068 4.264h.332l-.067-4.264-.064-6.093h-.039z",id:"rect4632-6-9","stroke-width":".09"})])],-1)]),2))}}),A=r(M,[["__scopeId","data-v-55a2f166"]]);class g extends p{added(){const{destroy:e,el:s}=this.mount(A,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e()}}}export{g as default}; diff --git a/main/assets/index-WLSkOrf3-BPXETI0x.js b/main/assets/index-WLSkOrf3-BPXETI0x.js deleted file mode 100644 index c408ab7be..000000000 --- a/main/assets/index-WLSkOrf3-BPXETI0x.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-BGsID61t-RVI9ARar.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./vue.esm-bundler-D2erd_gM-JC7rsyps.js","./toggle-switch-control-B4JzuvHa-CnJ57I53.js"])))=>i.map(i=>d[i]); -import{fu as a,_ as n,c5 as r,cB as o}from"./main-BZaw9FpY.js";class g extends o{toggleSettings(e,s){const t=this.$iApi.panel.get("settings");if(!t.isOpen&&s!==!1)this.$iApi.panel.open({id:"settings",props:{layer:e}});else{const l=t.route.props.layer.uid;s!==!0&&t.close(),l!==e.uid&&setTimeout(()=>{this.$iApi.panel.open({id:"settings",props:{layer:e}})},100)}}}const c={en:{"settings.title":"Settings","settings.layer.loading":"The layer is loading...","settings.label.display":"Display","settings.label.visibility":"Show layer","settings.label.opacity":"Opacity","settings.label.boundingBox":"Bounding box","settings.label.data":"Data","settings.label.identify":"Toggle identify","settings.label.interval":"Refresh interval","settings.label.refreshHint":"Refresh interval in minutes","settings.label.refreshOff":" Leave blank or 0 to turn off automatic refresh","settings.label.no.layer":"The layer has been removed"},fr:{"settings.title":"Paramètres","settings.layer.loading":"La couche est en cours de chargement...","settings.label.display":"Affichage","settings.label.visibility":"Afficher la couche","settings.label.opacity":"Opacité","settings.label.boundingBox":"Zone de délimitation","settings.label.data":"Données","settings.label.identify":"Basculer vers la désignation","settings.label.interval":"Intervalle d'actualisation","settings.label.refreshHint":"Intervalle d'actualisation en minutes","settings.label.refreshOff":"Laisser le champ vide ou y inscrire 0 pour désactiver l'actualisation automatique","settings.label.no.layer":"La couche a été supprimée."}};class d extends g{async added(){this.$iApi.panel.register({settings:{screens:{"settings-screen-content":()=>a(n(()=>import("./screen-BGsID61t-RVI9ARar.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},style:{width:"350px"},button:{tooltip:"settings.title",icon:''},alertName:"settings.title"}},{i18n:{messages:c}}),this.handlePanelTeleports(["settings"])}removed(){this.$iApi.fixture.exists("appbar")&&r(this.$vApp.$pinia).removeButton("settings"),this.$iApi.panel.remove("settings")}}export{d as default}; diff --git a/main/assets/index-WLSkOrf3-BtO5u2ms.js b/main/assets/index-WLSkOrf3-BtO5u2ms.js new file mode 100644 index 000000000..2d9a612ac --- /dev/null +++ b/main/assets/index-WLSkOrf3-BtO5u2ms.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-BGsID61t-Bmw9OCS0.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./vue.esm-bundler-D2erd_gM-CqXNZMaq.js","./toggle-switch-control-B4JzuvHa-B22huNUa.js"])))=>i.map(i=>d[i]); +import{fu as a,_ as n,c5 as r,cB as o}from"./main-C7yV2j71.js";class g extends o{toggleSettings(e,s){const t=this.$iApi.panel.get("settings");if(!t.isOpen&&s!==!1)this.$iApi.panel.open({id:"settings",props:{layer:e}});else{const l=t.route.props.layer.uid;s!==!0&&t.close(),l!==e.uid&&setTimeout(()=>{this.$iApi.panel.open({id:"settings",props:{layer:e}})},100)}}}const c={en:{"settings.title":"Settings","settings.layer.loading":"The layer is loading...","settings.label.display":"Display","settings.label.visibility":"Show layer","settings.label.opacity":"Opacity","settings.label.boundingBox":"Bounding box","settings.label.data":"Data","settings.label.identify":"Toggle identify","settings.label.interval":"Refresh interval","settings.label.refreshHint":"Refresh interval in minutes","settings.label.refreshOff":" Leave blank or 0 to turn off automatic refresh","settings.label.no.layer":"The layer has been removed"},fr:{"settings.title":"Paramètres","settings.layer.loading":"La couche est en cours de chargement...","settings.label.display":"Affichage","settings.label.visibility":"Afficher la couche","settings.label.opacity":"Opacité","settings.label.boundingBox":"Zone de délimitation","settings.label.data":"Données","settings.label.identify":"Basculer vers la désignation","settings.label.interval":"Intervalle d'actualisation","settings.label.refreshHint":"Intervalle d'actualisation en minutes","settings.label.refreshOff":"Laisser le champ vide ou y inscrire 0 pour désactiver l'actualisation automatique","settings.label.no.layer":"La couche a été supprimée."}};class d extends g{async added(){this.$iApi.panel.register({settings:{screens:{"settings-screen-content":()=>a(n(()=>import("./screen-BGsID61t-Bmw9OCS0.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},style:{width:"350px"},button:{tooltip:"settings.title",icon:''},alertName:"settings.title"}},{i18n:{messages:c}}),this.handlePanelTeleports(["settings"])}removed(){this.$iApi.fixture.exists("appbar")&&r(this.$vApp.$pinia).removeButton("settings"),this.$iApi.panel.remove("settings")}}export{d as default}; diff --git a/main/assets/index-sFd78-sx-BKs49ugm.js b/main/assets/index-sFd78-sx-BKs49ugm.js new file mode 100644 index 000000000..57f69061f --- /dev/null +++ b/main/assets/index-sFd78-sx-BKs49ugm.js @@ -0,0 +1 @@ +import{c3 as z,c2 as _,c4 as I,fw as u,c6 as $,c7 as A,fV as f,c9 as O,ca as r,cm as l,cz as v,cc as g,cd as c,cf as p,ch as M,cj as B,ck as F,c8 as L,cl as b,cn as S,cw as w,cx as H,cb as x,cy as P,cg as V,cB as Z}from"./main-C7yV2j71.js";const j={},N={class:"border-b p-0 self-center w-2/3"};function T(m,a){return r(),l("span",N)}const k=z(j,[["render",T]]),q=_({__name:"zoom-nav",setup(m){const{t:a}=$(),t=A("iApi"),e=f(400,!0,()=>t.geo.map.zoomIn()),s=f(400,!0,()=>t.geo.map.zoomOut());return(o,i)=>{const n=O("mapnav-button");return r(),l("div",null,[v(n,{onClickFunction:p(e),tooltip:p(a)("mapnav.zoomIn")},{default:g(()=>i[0]||(i[0]=[c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[c("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),c("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"]),v(k),v(n,{onClickFunction:p(s),tooltip:p(a)("mapnav.zoomOut")},{default:g(()=>i[1]||(i[1]=[c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[c("path",{d:"M19 13H5v-2h14v2z"}),c("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"])])}}}),W={class:"mapnav absolute right-0 bottom-0 pb-36 sm:pb-48 pr-12"},Y=["content"],D={class:"mapnav-section bg-white-75 hover:bg-white"},G=_({__name:"mapnav",setup(m){const a=u(),{t}=$(),e=M(),s=()=>{e.value._tippy.hide()},o=n=>{n.key==="Tab"&&e.value?.matches(":focus")&&e.value._tippy.show()};B(()=>{e.value?.addEventListener("blur",s),e.value?.addEventListener("keyup",o)}),F(()=>{e.value?.removeEventListener("blur",s),e.value?.removeEventListener("keyup",o)});const i=L(()=>a.order.map(n=>a.items[n]).filter(n=>n.componentId));return(n,h)=>{const y=b("focus-list"),E=b("tippy");return r(),l("div",W,[S((r(),l("div",{class:"flex flex-col",content:p(t)("panels.controls.items"),ref_key:"el",ref:e},[v(q,{class:"mapnav-section bg-white-75 hover:bg-white"}),h[0]||(h[0]=c("span",{class:"py-1"},null,-1)),c("div",D,[(r(!0),l(w,null,H(i.value,(d,C)=>(r(),l(w,{key:d.id+"button"},[(r(),x(P(d.id+"-nav-button"))),C!==i.value.length-1?(r(),x(k,{key:0,class:"mapnav-divider"})):V("",!0)],64))),128))])],8,Y)),[[y],[E,{trigger:"manual",placement:"top-end",touch:!1,maxWidth:190}]])])}}}),J=z(G,[["__scopeId","data-v-41a5c7b7"]]);class K extends Z{mapnavStore=u(this.$vApp.$pinia);get config(){return super.config}_parseConfig(a){if(!a)return;const t=a.items.map(e=>({id:e}));this.mapnavStore.items=t.reduce((e,s)=>(e[s.id]=s,e),{}),this.mapnavStore.order=t.map(e=>e.id),this._validateItems()}_validateItems(){const a=["geolocator","zoom","home","fullscreen"];this.mapnavStore.order.forEach(t=>{(this.$iApi.fixture.exists(t)||a.includes(t))&&(this.mapnavStore.items[t].componentId=`${t}-nav-button`)})}}const Q={en:{"mapnav.zoomIn":"Zoom In","mapnav.zoomOut":"Zoom Out","mapnav.home":"Home","mapnav.fullscreen":"Full Screen","mapnav.geolocator":"Your Location","mapnav.geolocator.error.permission":"The location request was denied. Please check your browser permission settings.","mapnav.geolocator.error.internal":"Your location could not be found."},fr:{"mapnav.zoomIn":"Zoom avant","mapnav.zoomOut":"Zoom arrière","mapnav.home":"Accueil","mapnav.fullscreen":"Plein Écran","mapnav.geolocator":"Votre position","mapnav.geolocator.error.permission":"Demande de localisation refusée. Veuillez vérifier les paramètres d'autorisation de votre navigateur.","mapnav.geolocator.error.internal":"Votre emplacement n'a pu être trouvé."}};class U extends K{async added(){Object.entries(Q).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:a,el:t}=this.mount(J,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,o=>this._parseConfig(o)),s=this.$iApi.event.on(I.COMPONENT,()=>{this._parseConfig(this.config)});this.removed=()=>{e(),this.$iApi.event.off(s);const o=u(this.$vApp.$pinia),i={...o.items};Object.keys(i).forEach(n=>o.removeItem(n)),o.$reset(),a()}}}export{U as default}; diff --git a/main/assets/index-sFd78-sx-DDv34NyC.js b/main/assets/index-sFd78-sx-DDv34NyC.js deleted file mode 100644 index ef643b894..000000000 --- a/main/assets/index-sFd78-sx-DDv34NyC.js +++ /dev/null @@ -1 +0,0 @@ -import{c3 as z,c2 as _,c4 as I,fw as u,c6 as $,c7 as A,fV as f,c9 as O,ca as r,cm as l,cz as v,cc as g,cd as c,cf as p,ch as M,cj as B,ck as F,c8 as L,cl as b,cn as S,cw as w,cx as H,cb as x,cy as P,cg as V,cB as Z}from"./main-BZaw9FpY.js";const j={},N={class:"border-b p-0 self-center w-2/3"};function T(m,a){return r(),l("span",N)}const k=z(j,[["render",T]]),q=_({__name:"zoom-nav",setup(m){const{t:a}=$(),t=A("iApi"),e=f(400,!0,()=>t.geo.map.zoomIn()),s=f(400,!0,()=>t.geo.map.zoomOut());return(o,i)=>{const n=O("mapnav-button");return r(),l("div",null,[v(n,{onClickFunction:p(e),tooltip:p(a)("mapnav.zoomIn")},{default:g(()=>i[0]||(i[0]=[c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[c("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),c("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"]),v(k),v(n,{onClickFunction:p(s),tooltip:p(a)("mapnav.zoomOut")},{default:g(()=>i[1]||(i[1]=[c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[c("path",{d:"M19 13H5v-2h14v2z"}),c("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"])])}}}),W={class:"mapnav absolute right-0 bottom-0 pb-36 sm:pb-48 pr-12"},Y=["content"],D={class:"mapnav-section bg-white-75 hover:bg-white"},G=_({__name:"mapnav",setup(m){const a=u(),{t}=$(),e=M(),s=()=>{e.value._tippy.hide()},o=n=>{n.key==="Tab"&&e.value?.matches(":focus")&&e.value._tippy.show()};B(()=>{e.value?.addEventListener("blur",s),e.value?.addEventListener("keyup",o)}),F(()=>{e.value?.removeEventListener("blur",s),e.value?.removeEventListener("keyup",o)});const i=L(()=>a.order.map(n=>a.items[n]).filter(n=>n.componentId));return(n,h)=>{const y=b("focus-list"),E=b("tippy");return r(),l("div",W,[S((r(),l("div",{class:"flex flex-col",content:p(t)("panels.controls.items"),ref_key:"el",ref:e},[v(q,{class:"mapnav-section bg-white-75 hover:bg-white"}),h[0]||(h[0]=c("span",{class:"py-1"},null,-1)),c("div",D,[(r(!0),l(w,null,H(i.value,(d,C)=>(r(),l(w,{key:d.id+"button"},[(r(),x(P(d.id+"-nav-button"))),C!==i.value.length-1?(r(),x(k,{key:0,class:"mapnav-divider"})):V("",!0)],64))),128))])],8,Y)),[[y],[E,{trigger:"manual",placement:"top-end",touch:!1,maxWidth:190}]])])}}}),J=z(G,[["__scopeId","data-v-41a5c7b7"]]);class K extends Z{mapnavStore=u(this.$vApp.$pinia);get config(){return super.config}_parseConfig(a){if(!a)return;const t=a.items.map(e=>({id:e}));this.mapnavStore.items=t.reduce((e,s)=>(e[s.id]=s,e),{}),this.mapnavStore.order=t.map(e=>e.id),this._validateItems()}_validateItems(){const a=["geolocator","zoom","home","fullscreen"];this.mapnavStore.order.forEach(t=>{(this.$iApi.fixture.exists(t)||a.includes(t))&&(this.mapnavStore.items[t].componentId=`${t}-nav-button`)})}}const Q={en:{"mapnav.zoomIn":"Zoom In","mapnav.zoomOut":"Zoom Out","mapnav.home":"Home","mapnav.fullscreen":"Full Screen","mapnav.geolocator":"Your Location","mapnav.geolocator.error.permission":"The location request was denied. Please check your browser permission settings.","mapnav.geolocator.error.internal":"Your location could not be found."},fr:{"mapnav.zoomIn":"Zoom avant","mapnav.zoomOut":"Zoom arrière","mapnav.home":"Accueil","mapnav.fullscreen":"Plein Écran","mapnav.geolocator":"Votre position","mapnav.geolocator.error.permission":"Demande de localisation refusée. Veuillez vérifier les paramètres d'autorisation de votre navigateur.","mapnav.geolocator.error.internal":"Votre emplacement n'a pu être trouvé."}};class U extends K{async added(){Object.entries(Q).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:a,el:t}=this.mount(J,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,o=>this._parseConfig(o)),s=this.$iApi.event.on(I.COMPONENT,()=>{this._parseConfig(this.config)});this.removed=()=>{e(),this.$iApi.event.off(s);const o=u(this.$vApp.$pinia),i={...o.items};Object.keys(i).forEach(n=>o.removeItem(n)),o.$reset(),a()}}}export{U as default}; diff --git a/main/assets/input2-eOtqu-iO-CInnv9HE.js b/main/assets/input2-eOtqu-iO-CInnv9HE.js deleted file mode 100644 index d7432498f..000000000 --- a/main/assets/input2-eOtqu-iO-CInnv9HE.js +++ /dev/null @@ -1,31 +0,0 @@ -import{p as k,b as w,a as n,D as O,f as N,W as v,n as T}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{b as g,p as A,L as P,w as W,A as E}from"./dom-N58V0tYi-DBU3jlah.js";import{D as $,H as K,y as V,N as j,P as U}from"./form-CRSw616T-Cd5gFTXp.js";import{l as R,p as q}from"./interactive-DqhNilgd-DrUFww1w.js";import{e as _}from"./key-CZySMiwx-kmS7VeUz.js";import{b as G,I as X,M as H}from"./label-Dys24PJn-BCewo2Re.js";import{o as J,r as Q,f as Y}from"./loadable-DbNDKH4r-Cc9Ee-I5.js";import{X as u,h as p,B as Z,T as ee,H as te,K as ie,q as ne,s as ae}from"./locale-Cn_GDVD_-CiwD7jxT.js";import{c as se}from"./observers-BigwqTsw-DJJPVpPW.js";import{l as oe,d as re,M as le,h as ce}from"./t9n-C_hcZMZJ-BmtPt6-4.js";import{e as m}from"./component-CWGf1hug-BASJpoEG.js";import{m as L}from"./icon-BXFbBbop-O5hL8B42.js";const ue={validationContainer:"validation-container"},de=({scale:e,status:t,id:i,icon:s,message:a})=>n("div",{class:ue.validationContainer},n("calcite-input-message",{"aria-live":"polite",icon:s,id:i,scale:e,status:t},a)),he=["date","datetime-local","month","number","range","time","week"],pe=["email","password","search","tel","text","url"],be=["email","password","search","tel","text","textarea","url"];function b(e,t,i,s){const a=i.toLowerCase(),o=e[i];s&&o!=null?t.setAttribute(a,`${o}`):t.removeAttribute(a)}function me(e,t,i){i.type=e==="textarea"?"text":e;const s=he.includes(e),a=t;b(a,i,"min",s),b(a,i,"max",s),b(a,i,"step",s);const o=be.includes(e),l=t;b(l,i,"minLength",o),b(l,i,"maxLength",o);const c=pe.includes(e);b(l,i,"pattern",c)}const C={valid:"check-circle",invalid:"exclamation-mark-triangle",idle:"information"},fe=":host{box-sizing:border-box;display:flex;block-size:auto;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);opacity:1;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;--calcite-input-message-spacing-value:0.25rem;margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([scale=m]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}",ve=fe,ge=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=g(C,this.icon,this.status)}connectedCallback(){this.requestedIcon=g(C,this.icon,this.status)}render(){const e=this.el.hidden;return n(O,{key:"c7d1b37721cec28dee1020b81ff66dee7fc8bc44","calcite-hydrated-hidden":e},this.renderIcon(this.requestedIcon),n("slot",{key:"7147d81e906765c154b4a61e31706a72c1ef3ae0"}))}renderIcon(e){if(e)return n("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:e,scale:"s"})}get el(){return this}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}static get style(){return ve}},[1,"calcite-input-message",{icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],status:[513]},void 0,{status:["handleIconEl"],icon:["handleIconEl"]}]);function B(){typeof customElements>"u"||["calcite-input-message","calcite-icon"].forEach(e=>{switch(e){case"calcite-input-message":customElements.get(e)||customElements.define(e,ge);break;case"calcite-icon":customElements.get(e)||L();break}})}B();const ye=":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-z-index);inline-size:100%;overflow:hidden;background-color:var(--calcite-progress-background-color, var(--calcite-color-border-3))}.bar{z-index:var(--calcite-z-index);background-color:var(--calcite-progress-fill-color, var(--calcite-color-brand))}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-progress-text-color, var(--calcite-color-text-2))}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",xe=ye,ke=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{},t=A(this.el);return n("div",{key:"92597fefec948e4494425db28cd87bfad3cc76f8","aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},n("div",{key:"d2a8ec085909b4bd35f443d0e831d645fb159317",class:"track"},n("div",{key:"2dd26e56a0f344d02f1b4068167f61d9da4d2cbd",class:{bar:!0,indeterminate:this.type==="indeterminate",[N.rtl]:t==="rtl",reversed:this.reversed},style:e})),this.text?n("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return xe}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function M(){typeof customElements>"u"||["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,ke);break}})}M();const r={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},x={validationMessage:"inputValidationMessage"},D={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},we={action:"action"},ze=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}textarea,input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-color-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-1)}input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,textarea{text-overflow:ellipsis;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);color:var(--calcite-color-text-1)}input:placeholder-shown,textarea:placeholder-shown{text-overflow:ellipsis}input:focus,textarea:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-text-1)}input[readonly],textarea[readonly]{background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus,textarea[readonly]:focus{color:var(--calcite-color-text-1)}calcite-icon{color:var(--calcite-color-text-3)}textarea,input{outline-color:transparent}textarea:focus,input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-color-status-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-color-status-danger);outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:var(--calcite-z-index)}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-color-foreground-2);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-color-text-1);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-color-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-color-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.clear-button:disabled{opacity:var(--calcite-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-color-text-2)}.prefix{order:2;border-inline-end-width:0px;inline-size:var(--calcite-input-prefix-size, auto)}.suffix{order:5;border-inline-start-width:0px;inline-size:var(--calcite-input-suffix-size, auto)}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-color-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-color-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-color-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-color-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-color-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-color-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-color-text-1)}.number-button-item:active{background-color:var(--calcite-color-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-color-border-1)}input.inline-child{background-color:transparent;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input.inline-child .editing-enabled{background-color:inherit}input.inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,Ie=ze,Ee=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputFocus=v(this,"calciteInternalInputFocus",6),this.calciteInternalInputBlur=v(this,"calciteInternalInputBlur",6),this.calciteInputInput=v(this,"calciteInputInput",7),this.calciteInputChange=v(this,"calciteInputChange",6),this.childElType="input",this.previousValueOrigin="initial",this.mutationObserver=se("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=e=>{this.readOnly||this.disabled||e.defaultPrevented||(this.isClearable&&e.key==="Escape"&&(this.clearInputValue(e),e.preventDefault()),e.key==="Enter"&&$(this)&&e.preventDefault())},this.clearInputValue=e=>{this.setValue({committing:!0,nativeEvent:e,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputBlurHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId),this.calciteInternalInputBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=e=>{if(this.disabled)return;const t=e.composedPath();!t.includes(this.inputWrapperEl)||t.includes(this.actionWrapperEl)||this.setFocus()},this.inputFocusHandler=()=>{this.calciteInternalInputFocus.emit()},this.inputChangeHandler=()=>{this.type==="file"&&(this.files=this.childEl.files)},this.inputInputHandler=e=>{this.disabled||this.readOnly||this.setValue({nativeEvent:e,origin:"user",value:e.target.value})},this.inputKeyDownHandler=e=>{this.disabled||this.readOnly||e.key==="Enter"&&this.emitChangeIfUserModified()},this.inputNumberInputHandler=e=>{if(this.disabled||this.readOnly||this.value==="Infinity"||this.value==="-Infinity")return;const t=e.target.value;u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=u.delocalize(t);e.inputType==="insertFromPaste"?(p(i)||e.preventDefault(),this.setValue({nativeEvent:e,origin:"user",value:Z(i)}),this.childNumberEl.value=this.displayedValue):this.setValue({nativeEvent:e,origin:"user",value:i})},this.inputNumberKeyDownHandler=e=>{if(this.type!=="number"||this.disabled||this.readOnly)return;if(this.value==="Infinity"||this.value==="-Infinity"){e.preventDefault(),(e.key==="Backspace"||e.key==="Delete")&&this.clearInputValue(e);return}if(e.key==="ArrowUp"){e.preventDefault(),this.nudgeNumberValue("up",e);return}if(e.key==="ArrowDown"){this.nudgeNumberValue("down",e);return}const t=[..._,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&e.key==="Tab";if(t.includes(e.key)||i){e.key==="Enter"&&this.emitChangeIfUserModified();return}u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(e.key===u.decimal&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf(u.decimal)===-1))&&(/[eE]/.test(e.key)&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||e.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||e.preventDefault())},this.nudgeNumberValue=(e,t)=>{if(t instanceof KeyboardEvent&&t.repeat||this.type!=="number")return;const i=this.maxString?parseFloat(this.maxString):null,s=this.minString?parseFloat(this.minString):null,a=150;this.incrementOrDecrementNumberValue(e,i,s,t),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let o=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(o){o=!1;return}this.incrementOrDecrementNumberValue(e,i,s,t)},a)},this.numberButtonPointerUpAndOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.numberButtonPointerDownHandler=e=>{if(!P(e))return;e.preventDefault();const t=e.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(t,e)},this.onHiddenFormInputInput=e=>{e.target.name===this.name&&this.setValue({value:e.target.value,origin:"direct"}),this.setFocus(),e.stopPropagation()},this.setChildElRef=e=>{this.childEl=e},this.setChildNumberElRef=e=>{this.childNumberEl=e},this.setInputValue=e=>{this.type==="text"&&!this.childEl||this.type==="number"&&!this.childNumberEl||(this[`child${this.type==="number"?"Number":""}El`].value=e)},this.setPreviousEmittedValue=e=>{this.previousEmittedValue=this.normalizeValue(e)},this.setPreviousValue=e=>{this.previousValue=this.normalizeValue(e)},this.setValue=({committing:e=!1,nativeEvent:t,origin:i,previousValue:s,value:a})=>{if(this.setPreviousValue(s??this.value),this.previousValueOrigin=i,this.type==="number"){u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator,signDisplay:"never"};const o=this.previousValue?.length>a.length||this.value?.length>a.length,l=a.charAt(a.length-1)===".",c=l&&o?a:ee(a),d=a&&!c?p(this.previousValue)?this.previousValue:"":c;let h=u.localize(d);i!=="connected"&&!l&&(h=te(h,d,u)),this.displayedValue=l&&o?`${h}${u.decimal}`:h,this.userChangedValue=i==="user"&&this.value!==d,this.value=["-","."].includes(d)?"":d}else this.userChangedValue=i==="user"&&this.value!==a,this.value=a;i==="direct"&&(this.setInputValue(a),this.previousEmittedValue=a),t&&(this.calciteInputInput.emit().defaultPrevented?(this.value=this.previousValue,this.displayedValue=this.type==="number"?u.localize(this.previousValue):this.previousValue):e&&this.emitChangeIfUserModified())},this.inputKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=void 0,this.clearable=!1,this.disabled=!1,this.enterKeyHint=void 0,this.form=void 0,this.groupSeparator=!1,this.icon=void 0,this.iconFlipRtl=!1,this.inputMode=void 0,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.validationMessage=void 0,this.validationIcon=void 0,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.pattern=void 0,this.accept=void 0,this.multiple=!1,this.suffixText=void 0,this.editingEnabled=!1,this.type="text",this.value="",this.files=void 0,this.messages=void 0,this.messageOverrides=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.displayedValue=void 0,this.slottedActionElDisabledInternally=!1}handleGlobalAttributesChanged(){T(this)}disabledWatcher(){this.setDisabledAction()}maxWatcher(){this.maxString=this.max?.toString()||null}minWatcher(){this.minString=this.min?.toString()||null}onMessagesChange(){}valueWatcher(e,t){if(!this.userChangedValue){if(this.type==="number"&&(e==="Infinity"||e==="-Infinity")){this.displayedValue=e,this.previousEmittedValue=e;return}this.setValue({origin:"direct",previousValue:t,value:e==null||e==""?"":this.type==="number"?p(e)?e:this.previousValue||"":e}),this.warnAboutInvalidNumberValue(e)}this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=g(D,this.icon,this.type)}get isClearable(){return!this.isTextarea&&(this.clearable||this.type==="search")&&this.value?.length>0}get isTextarea(){return this.childElType==="textarea"}effectiveLocaleChange(){oe(this,this.effectiveLocale)}connectedCallback(){ie(this),re(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),G(this),K(this),this.mutationObserver?.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener(V,this.onHiddenFormInputInput)}disconnectedCallback(){X(this),j(this),ne(this),le(this),this.mutationObserver?.disconnect(),this.el.removeEventListener(V,this.onHiddenFormInputInput)}async componentWillLoad(){J(this),this.childElType=this.type==="textarea"?"textarea":"input",this.maxString=this.max?.toString(),this.minString=this.min?.toString(),this.requestedIcon=g(D,this.icon,this.type),await ce(this),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),this.type==="number"&&(this.value==="Infinity"||this.value==="-Infinity"?(this.displayedValue=this.value,this.previousEmittedValue=this.value):(this.warnAboutInvalidNumberValue(this.value),this.setValue({origin:"connected",value:p(this.value)?this.value:""})))}componentDidLoad(){Q(this)}componentShouldUpdate(e,t,i){return this.type==="number"&&i==="value"&&e&&!p(e)?(this.setValue({origin:"reset",value:t}),!1):!0}componentDidRender(){R(this)}async setFocus(){await Y(this),this.type==="number"?this.childNumberEl?.focus():this.childEl?.focus()}async selectText(){this.type==="number"?this.childNumberEl?.select():this.childEl?.select()}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(e,t,i,s){const{value:a}=this;if(a==="Infinity"||a==="-Infinity")return;const o=e==="up"?1:-1,l=this.step==="any"?1:Math.abs(this.step||1),c=new ae(a!==""?a:"0").add(`${l*o}`),d=()=>typeof i=="number"&&!isNaN(i)&&c.subtract(`${i}`).isNegative,h=()=>typeof t=="number"&&!isNaN(t)&&!c.subtract(`${t}`).isNegative,f=d()?`${i}`:h()?`${t}`:c.toString();this.setValue({committing:!0,nativeEvent:s,origin:"user",value:f})}syncHiddenFormInput(e){me(this.type,this,e)}setDisabledAction(){const e=W(this.el,"action");e&&(this.disabled?(e.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),e.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(e.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(e){return this.type==="number"?p(e)?e:"":e}warnAboutInvalidNumberValue(e){this.type==="number"&&e&&!p(e)&&console.warn(`The specified value "${e}" cannot be parsed, or is out of range.`)}render(){const e=A(this.el),t=n("div",{key:"ed9acea9dbc18f4cfc5e7095c1e2de0b1adfdf35",class:r.loader},n("calcite-progress",{key:"58321a27c25dd848a648d2e3d5ca6dfc3f5fd649",label:this.messages.loading,type:"indeterminate"})),i=n("button",{key:"348d8dee0c032afe986b1e253c9d667256f3d9f0","aria-label":this.messages.clear,class:r.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},n("calcite-icon",{key:"334b68a283b767c0e9bea09ccfd83d09c8c17711",icon:"x",scale:m(this.scale)})),s=n("calcite-icon",{key:"4ab83aa9268277a38449ebe4a6e3db4dc9badcae",class:r.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:m(this.scale)}),a=this.numberButtonType==="horizontal",o=n("button",{key:"2dd700034d38581aaea39c019e626ffa1a2c1c16","aria-hidden":"true",class:{[r.numberButtonItem]:!0,[r.buttonItemHorizontal]:a},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{key:"6ca9a7c93aa14520292ad8c800c4e099bd46f30d",icon:"chevron-up",scale:m(this.scale)})),l=n("button",{key:"cdbd88ddd308bd82b6d239a83f365a2c5e226cfc","aria-hidden":"true",class:{[r.numberButtonItem]:!0,[r.buttonItemHorizontal]:a},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{key:"f1b9cf329da9add564d690c517ddcc414c4fbfa3",icon:"chevron-down",scale:m(this.scale)})),c=n("div",{key:"247efdce33568f219b1bf3bf252b8b19a74d03ea",class:r.numberButtonWrapper},o,l),d=n("div",{key:"01819a850399fb20a29471861e011695bf80af97",class:r.prefix},this.prefixText),h=n("div",{key:"dcc073305f3824a0eb72ef230bd217dabdb72104",class:r.suffix},this.suffixText),f=this.el.autofocus||this.el.hasAttribute("autofocus")?!0:null,z=this.el.enterKeyHint||this.el.getAttribute("enterkeyhint"),I=this.el.inputMode||this.el.getAttribute("inputmode"),S=this.type==="number"?n("input",{accept:this.accept,"aria-errormessage":x.validationMessage,"aria-invalid":E(this.status==="invalid"),"aria-label":H(this),autocomplete:this.autocomplete,autofocus:f,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:z,inputMode:I,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,multiple:this.multiple,name:void 0,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildNumberElRef,type:"text",value:this.displayedValue}):null,F=this.type!=="number"?[n(this.childElType,{accept:this.accept,"aria-errormessage":x.validationMessage,"aria-invalid":E(this.status==="invalid"),"aria-label":H(this),autocomplete:this.autocomplete,autofocus:f,class:{[r.editingEnabled]:this.editingEnabled,[r.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:z,inputMode:I,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,multiple:this.multiple,name:this.name,onBlur:this.inputBlurHandler,onChange:this.inputChangeHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildElRef,required:this.required?!0:null,step:this.step,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:this.type,value:this.value}),this.isTextarea?n("div",{class:r.resizeIconWrapper},n("calcite-icon",{icon:"chevron-down",scale:m(this.scale)})):null]:null;return n(O,{key:"23d6092960315f172a56105b9af75ddc6497874c",onClick:this.clickHandler,onKeyDown:this.keyDownHandler},n(q,{key:"1bb063f39c14a829a376465fa8c2bbc288046ac7",disabled:this.disabled},n("div",{key:"7f3644f002b7cb75d93d9c0218508b502ddcfd0b",class:{[r.inputWrapper]:!0,[N.rtl]:e==="rtl"},ref:y=>this.inputWrapperEl=y},this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?l:null,this.prefixText?d:null,n("div",{key:"0d01898e4949a60e0853c1a72669f5c9d6c91ba5",class:r.wrapper},S,F,this.isClearable?i:null,this.requestedIcon?s:null,this.loading?t:null),n("div",{key:"42e7adec440e417128feb9845c36d0444e6c1ae4",class:r.actionWrapper,ref:y=>this.actionWrapperEl=y},n("slot",{key:"f391b035ad9fc108d1f99c4cedf539425c20a36d",name:we.action})),this.type==="number"&&this.numberButtonType==="vertical"&&!this.readOnly?c:null,this.suffixText?h:null,this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?o:null,n(U,{key:"df415df551b4a9a16565c8f554454d01aa89327e",component:this})),this.validationMessage&&this.status==="invalid"?n(de,{icon:this.validationIcon,id:x.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{autofocus:["handleGlobalAttributesChanged"],enterkeyhint:["handleGlobalAttributesChanged"],inputmode:["handleGlobalAttributesChanged"],disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ie}},[1,"calcite-input",{alignment:[513],autofocus:[4],clearable:[516],disabled:[516],enterKeyHint:[1,"enter-key-hint"],form:[513],groupSeparator:[516,"group-separator"],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],inputMode:[1,"input-mode"],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],validationMessage:[1,"validation-message"],validationIcon:[520,"validation-icon"],validity:[1040],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[513],status:[513],step:[520],autocomplete:[1],pattern:[1],accept:[1],multiple:[4],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],type:[513],value:[1025],files:[16],messages:[1040],messageOverrides:[1040],defaultMessages:[32],effectiveLocale:[32],displayedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64]},void 0,{autofocus:["handleGlobalAttributesChanged"],enterkeyhint:["handleGlobalAttributesChanged"],inputmode:["handleGlobalAttributesChanged"],disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}]);function Ve(){typeof customElements>"u"||["calcite-input","calcite-icon","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-input":customElements.get(e)||customElements.define(e,Ee);break;case"calcite-icon":customElements.get(e)||L();break;case"calcite-input-message":customElements.get(e)||B();break;case"calcite-progress":customElements.get(e)||M();break}})}Ve();export{Ee as F,Ve as M,B as w,M as z}; diff --git a/main/assets/input2-eOtqu-iO-CM6Z_r7O.js b/main/assets/input2-eOtqu-iO-CM6Z_r7O.js new file mode 100644 index 000000000..ccd6b1a1e --- /dev/null +++ b/main/assets/input2-eOtqu-iO-CM6Z_r7O.js @@ -0,0 +1,31 @@ +import{p as k,b as w,a as n,D as O,f as N,W as v,n as T}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{b as g,p as A,L as P,w as W,A as E}from"./dom-N58V0tYi-DBU3jlah.js";import{D as $,H as K,y as V,N as j,P as U}from"./form-CRSw616T-2CDQhr1H.js";import{l as R,p as q}from"./interactive-DqhNilgd-D_Gwwuwg.js";import{e as _}from"./key-CZySMiwx-kmS7VeUz.js";import{b as G,I as X,M as H}from"./label-Dys24PJn-BCewo2Re.js";import{o as J,r as Q,f as Y}from"./loadable-DbNDKH4r-YgUDHAtn.js";import{X as u,h as p,B as Z,T as ee,H as te,K as ie,q as ne,s as ae}from"./locale-Cn_GDVD_-DrOI-_a9.js";import{c as se}from"./observers-BigwqTsw-Du14S4xc.js";import{l as oe,d as re,M as le,h as ce}from"./t9n-C_hcZMZJ-CZmw6XOE.js";import{e as m}from"./component-CWGf1hug-BASJpoEG.js";import{m as L}from"./icon-BXFbBbop-Du8Zws1L.js";const ue={validationContainer:"validation-container"},de=({scale:e,status:t,id:i,icon:s,message:a})=>n("div",{class:ue.validationContainer},n("calcite-input-message",{"aria-live":"polite",icon:s,id:i,scale:e,status:t},a)),he=["date","datetime-local","month","number","range","time","week"],pe=["email","password","search","tel","text","url"],be=["email","password","search","tel","text","textarea","url"];function b(e,t,i,s){const a=i.toLowerCase(),o=e[i];s&&o!=null?t.setAttribute(a,`${o}`):t.removeAttribute(a)}function me(e,t,i){i.type=e==="textarea"?"text":e;const s=he.includes(e),a=t;b(a,i,"min",s),b(a,i,"max",s),b(a,i,"step",s);const o=be.includes(e),l=t;b(l,i,"minLength",o),b(l,i,"maxLength",o);const c=pe.includes(e);b(l,i,"pattern",c)}const C={valid:"check-circle",invalid:"exclamation-mark-triangle",idle:"information"},fe=":host{box-sizing:border-box;display:flex;block-size:auto;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);opacity:1;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;--calcite-input-message-spacing-value:0.25rem;margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([scale=m]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}",ve=fe,ge=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=g(C,this.icon,this.status)}connectedCallback(){this.requestedIcon=g(C,this.icon,this.status)}render(){const e=this.el.hidden;return n(O,{key:"c7d1b37721cec28dee1020b81ff66dee7fc8bc44","calcite-hydrated-hidden":e},this.renderIcon(this.requestedIcon),n("slot",{key:"7147d81e906765c154b4a61e31706a72c1ef3ae0"}))}renderIcon(e){if(e)return n("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:e,scale:"s"})}get el(){return this}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}static get style(){return ve}},[1,"calcite-input-message",{icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],status:[513]},void 0,{status:["handleIconEl"],icon:["handleIconEl"]}]);function B(){typeof customElements>"u"||["calcite-input-message","calcite-icon"].forEach(e=>{switch(e){case"calcite-input-message":customElements.get(e)||customElements.define(e,ge);break;case"calcite-icon":customElements.get(e)||L();break}})}B();const ye=":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-z-index);inline-size:100%;overflow:hidden;background-color:var(--calcite-progress-background-color, var(--calcite-color-border-3))}.bar{z-index:var(--calcite-z-index);background-color:var(--calcite-progress-fill-color, var(--calcite-color-brand))}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-progress-text-color, var(--calcite-color-text-2))}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",xe=ye,ke=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{},t=A(this.el);return n("div",{key:"92597fefec948e4494425db28cd87bfad3cc76f8","aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},n("div",{key:"d2a8ec085909b4bd35f443d0e831d645fb159317",class:"track"},n("div",{key:"2dd26e56a0f344d02f1b4068167f61d9da4d2cbd",class:{bar:!0,indeterminate:this.type==="indeterminate",[N.rtl]:t==="rtl",reversed:this.reversed},style:e})),this.text?n("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return xe}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function M(){typeof customElements>"u"||["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,ke);break}})}M();const r={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},x={validationMessage:"inputValidationMessage"},D={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},we={action:"action"},ze=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}textarea,input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-color-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-1)}input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,textarea{text-overflow:ellipsis;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);color:var(--calcite-color-text-1)}input:placeholder-shown,textarea:placeholder-shown{text-overflow:ellipsis}input:focus,textarea:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-text-1)}input[readonly],textarea[readonly]{background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus,textarea[readonly]:focus{color:var(--calcite-color-text-1)}calcite-icon{color:var(--calcite-color-text-3)}textarea,input{outline-color:transparent}textarea:focus,input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-color-status-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-color-status-danger);outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:var(--calcite-z-index)}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-color-foreground-2);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-color-text-1);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-color-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-color-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.clear-button:disabled{opacity:var(--calcite-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-color-text-2)}.prefix{order:2;border-inline-end-width:0px;inline-size:var(--calcite-input-prefix-size, auto)}.suffix{order:5;border-inline-start-width:0px;inline-size:var(--calcite-input-suffix-size, auto)}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-color-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-color-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-color-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-color-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-color-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-color-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-color-text-1)}.number-button-item:active{background-color:var(--calcite-color-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-color-border-1)}input.inline-child{background-color:transparent;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input.inline-child .editing-enabled{background-color:inherit}input.inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,Ie=ze,Ee=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputFocus=v(this,"calciteInternalInputFocus",6),this.calciteInternalInputBlur=v(this,"calciteInternalInputBlur",6),this.calciteInputInput=v(this,"calciteInputInput",7),this.calciteInputChange=v(this,"calciteInputChange",6),this.childElType="input",this.previousValueOrigin="initial",this.mutationObserver=se("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=e=>{this.readOnly||this.disabled||e.defaultPrevented||(this.isClearable&&e.key==="Escape"&&(this.clearInputValue(e),e.preventDefault()),e.key==="Enter"&&$(this)&&e.preventDefault())},this.clearInputValue=e=>{this.setValue({committing:!0,nativeEvent:e,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputBlurHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId),this.calciteInternalInputBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=e=>{if(this.disabled)return;const t=e.composedPath();!t.includes(this.inputWrapperEl)||t.includes(this.actionWrapperEl)||this.setFocus()},this.inputFocusHandler=()=>{this.calciteInternalInputFocus.emit()},this.inputChangeHandler=()=>{this.type==="file"&&(this.files=this.childEl.files)},this.inputInputHandler=e=>{this.disabled||this.readOnly||this.setValue({nativeEvent:e,origin:"user",value:e.target.value})},this.inputKeyDownHandler=e=>{this.disabled||this.readOnly||e.key==="Enter"&&this.emitChangeIfUserModified()},this.inputNumberInputHandler=e=>{if(this.disabled||this.readOnly||this.value==="Infinity"||this.value==="-Infinity")return;const t=e.target.value;u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=u.delocalize(t);e.inputType==="insertFromPaste"?(p(i)||e.preventDefault(),this.setValue({nativeEvent:e,origin:"user",value:Z(i)}),this.childNumberEl.value=this.displayedValue):this.setValue({nativeEvent:e,origin:"user",value:i})},this.inputNumberKeyDownHandler=e=>{if(this.type!=="number"||this.disabled||this.readOnly)return;if(this.value==="Infinity"||this.value==="-Infinity"){e.preventDefault(),(e.key==="Backspace"||e.key==="Delete")&&this.clearInputValue(e);return}if(e.key==="ArrowUp"){e.preventDefault(),this.nudgeNumberValue("up",e);return}if(e.key==="ArrowDown"){this.nudgeNumberValue("down",e);return}const t=[..._,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&e.key==="Tab";if(t.includes(e.key)||i){e.key==="Enter"&&this.emitChangeIfUserModified();return}u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(e.key===u.decimal&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf(u.decimal)===-1))&&(/[eE]/.test(e.key)&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||e.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||e.preventDefault())},this.nudgeNumberValue=(e,t)=>{if(t instanceof KeyboardEvent&&t.repeat||this.type!=="number")return;const i=this.maxString?parseFloat(this.maxString):null,s=this.minString?parseFloat(this.minString):null,a=150;this.incrementOrDecrementNumberValue(e,i,s,t),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let o=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(o){o=!1;return}this.incrementOrDecrementNumberValue(e,i,s,t)},a)},this.numberButtonPointerUpAndOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.numberButtonPointerDownHandler=e=>{if(!P(e))return;e.preventDefault();const t=e.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(t,e)},this.onHiddenFormInputInput=e=>{e.target.name===this.name&&this.setValue({value:e.target.value,origin:"direct"}),this.setFocus(),e.stopPropagation()},this.setChildElRef=e=>{this.childEl=e},this.setChildNumberElRef=e=>{this.childNumberEl=e},this.setInputValue=e=>{this.type==="text"&&!this.childEl||this.type==="number"&&!this.childNumberEl||(this[`child${this.type==="number"?"Number":""}El`].value=e)},this.setPreviousEmittedValue=e=>{this.previousEmittedValue=this.normalizeValue(e)},this.setPreviousValue=e=>{this.previousValue=this.normalizeValue(e)},this.setValue=({committing:e=!1,nativeEvent:t,origin:i,previousValue:s,value:a})=>{if(this.setPreviousValue(s??this.value),this.previousValueOrigin=i,this.type==="number"){u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator,signDisplay:"never"};const o=this.previousValue?.length>a.length||this.value?.length>a.length,l=a.charAt(a.length-1)===".",c=l&&o?a:ee(a),d=a&&!c?p(this.previousValue)?this.previousValue:"":c;let h=u.localize(d);i!=="connected"&&!l&&(h=te(h,d,u)),this.displayedValue=l&&o?`${h}${u.decimal}`:h,this.userChangedValue=i==="user"&&this.value!==d,this.value=["-","."].includes(d)?"":d}else this.userChangedValue=i==="user"&&this.value!==a,this.value=a;i==="direct"&&(this.setInputValue(a),this.previousEmittedValue=a),t&&(this.calciteInputInput.emit().defaultPrevented?(this.value=this.previousValue,this.displayedValue=this.type==="number"?u.localize(this.previousValue):this.previousValue):e&&this.emitChangeIfUserModified())},this.inputKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=void 0,this.clearable=!1,this.disabled=!1,this.enterKeyHint=void 0,this.form=void 0,this.groupSeparator=!1,this.icon=void 0,this.iconFlipRtl=!1,this.inputMode=void 0,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.validationMessage=void 0,this.validationIcon=void 0,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.pattern=void 0,this.accept=void 0,this.multiple=!1,this.suffixText=void 0,this.editingEnabled=!1,this.type="text",this.value="",this.files=void 0,this.messages=void 0,this.messageOverrides=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.displayedValue=void 0,this.slottedActionElDisabledInternally=!1}handleGlobalAttributesChanged(){T(this)}disabledWatcher(){this.setDisabledAction()}maxWatcher(){this.maxString=this.max?.toString()||null}minWatcher(){this.minString=this.min?.toString()||null}onMessagesChange(){}valueWatcher(e,t){if(!this.userChangedValue){if(this.type==="number"&&(e==="Infinity"||e==="-Infinity")){this.displayedValue=e,this.previousEmittedValue=e;return}this.setValue({origin:"direct",previousValue:t,value:e==null||e==""?"":this.type==="number"?p(e)?e:this.previousValue||"":e}),this.warnAboutInvalidNumberValue(e)}this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=g(D,this.icon,this.type)}get isClearable(){return!this.isTextarea&&(this.clearable||this.type==="search")&&this.value?.length>0}get isTextarea(){return this.childElType==="textarea"}effectiveLocaleChange(){oe(this,this.effectiveLocale)}connectedCallback(){ie(this),re(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),G(this),K(this),this.mutationObserver?.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener(V,this.onHiddenFormInputInput)}disconnectedCallback(){X(this),j(this),ne(this),le(this),this.mutationObserver?.disconnect(),this.el.removeEventListener(V,this.onHiddenFormInputInput)}async componentWillLoad(){J(this),this.childElType=this.type==="textarea"?"textarea":"input",this.maxString=this.max?.toString(),this.minString=this.min?.toString(),this.requestedIcon=g(D,this.icon,this.type),await ce(this),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),this.type==="number"&&(this.value==="Infinity"||this.value==="-Infinity"?(this.displayedValue=this.value,this.previousEmittedValue=this.value):(this.warnAboutInvalidNumberValue(this.value),this.setValue({origin:"connected",value:p(this.value)?this.value:""})))}componentDidLoad(){Q(this)}componentShouldUpdate(e,t,i){return this.type==="number"&&i==="value"&&e&&!p(e)?(this.setValue({origin:"reset",value:t}),!1):!0}componentDidRender(){R(this)}async setFocus(){await Y(this),this.type==="number"?this.childNumberEl?.focus():this.childEl?.focus()}async selectText(){this.type==="number"?this.childNumberEl?.select():this.childEl?.select()}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(e,t,i,s){const{value:a}=this;if(a==="Infinity"||a==="-Infinity")return;const o=e==="up"?1:-1,l=this.step==="any"?1:Math.abs(this.step||1),c=new ae(a!==""?a:"0").add(`${l*o}`),d=()=>typeof i=="number"&&!isNaN(i)&&c.subtract(`${i}`).isNegative,h=()=>typeof t=="number"&&!isNaN(t)&&!c.subtract(`${t}`).isNegative,f=d()?`${i}`:h()?`${t}`:c.toString();this.setValue({committing:!0,nativeEvent:s,origin:"user",value:f})}syncHiddenFormInput(e){me(this.type,this,e)}setDisabledAction(){const e=W(this.el,"action");e&&(this.disabled?(e.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),e.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(e.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(e){return this.type==="number"?p(e)?e:"":e}warnAboutInvalidNumberValue(e){this.type==="number"&&e&&!p(e)&&console.warn(`The specified value "${e}" cannot be parsed, or is out of range.`)}render(){const e=A(this.el),t=n("div",{key:"ed9acea9dbc18f4cfc5e7095c1e2de0b1adfdf35",class:r.loader},n("calcite-progress",{key:"58321a27c25dd848a648d2e3d5ca6dfc3f5fd649",label:this.messages.loading,type:"indeterminate"})),i=n("button",{key:"348d8dee0c032afe986b1e253c9d667256f3d9f0","aria-label":this.messages.clear,class:r.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},n("calcite-icon",{key:"334b68a283b767c0e9bea09ccfd83d09c8c17711",icon:"x",scale:m(this.scale)})),s=n("calcite-icon",{key:"4ab83aa9268277a38449ebe4a6e3db4dc9badcae",class:r.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:m(this.scale)}),a=this.numberButtonType==="horizontal",o=n("button",{key:"2dd700034d38581aaea39c019e626ffa1a2c1c16","aria-hidden":"true",class:{[r.numberButtonItem]:!0,[r.buttonItemHorizontal]:a},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{key:"6ca9a7c93aa14520292ad8c800c4e099bd46f30d",icon:"chevron-up",scale:m(this.scale)})),l=n("button",{key:"cdbd88ddd308bd82b6d239a83f365a2c5e226cfc","aria-hidden":"true",class:{[r.numberButtonItem]:!0,[r.buttonItemHorizontal]:a},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{key:"f1b9cf329da9add564d690c517ddcc414c4fbfa3",icon:"chevron-down",scale:m(this.scale)})),c=n("div",{key:"247efdce33568f219b1bf3bf252b8b19a74d03ea",class:r.numberButtonWrapper},o,l),d=n("div",{key:"01819a850399fb20a29471861e011695bf80af97",class:r.prefix},this.prefixText),h=n("div",{key:"dcc073305f3824a0eb72ef230bd217dabdb72104",class:r.suffix},this.suffixText),f=this.el.autofocus||this.el.hasAttribute("autofocus")?!0:null,z=this.el.enterKeyHint||this.el.getAttribute("enterkeyhint"),I=this.el.inputMode||this.el.getAttribute("inputmode"),S=this.type==="number"?n("input",{accept:this.accept,"aria-errormessage":x.validationMessage,"aria-invalid":E(this.status==="invalid"),"aria-label":H(this),autocomplete:this.autocomplete,autofocus:f,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:z,inputMode:I,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,multiple:this.multiple,name:void 0,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildNumberElRef,type:"text",value:this.displayedValue}):null,F=this.type!=="number"?[n(this.childElType,{accept:this.accept,"aria-errormessage":x.validationMessage,"aria-invalid":E(this.status==="invalid"),"aria-label":H(this),autocomplete:this.autocomplete,autofocus:f,class:{[r.editingEnabled]:this.editingEnabled,[r.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:z,inputMode:I,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,multiple:this.multiple,name:this.name,onBlur:this.inputBlurHandler,onChange:this.inputChangeHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildElRef,required:this.required?!0:null,step:this.step,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:this.type,value:this.value}),this.isTextarea?n("div",{class:r.resizeIconWrapper},n("calcite-icon",{icon:"chevron-down",scale:m(this.scale)})):null]:null;return n(O,{key:"23d6092960315f172a56105b9af75ddc6497874c",onClick:this.clickHandler,onKeyDown:this.keyDownHandler},n(q,{key:"1bb063f39c14a829a376465fa8c2bbc288046ac7",disabled:this.disabled},n("div",{key:"7f3644f002b7cb75d93d9c0218508b502ddcfd0b",class:{[r.inputWrapper]:!0,[N.rtl]:e==="rtl"},ref:y=>this.inputWrapperEl=y},this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?l:null,this.prefixText?d:null,n("div",{key:"0d01898e4949a60e0853c1a72669f5c9d6c91ba5",class:r.wrapper},S,F,this.isClearable?i:null,this.requestedIcon?s:null,this.loading?t:null),n("div",{key:"42e7adec440e417128feb9845c36d0444e6c1ae4",class:r.actionWrapper,ref:y=>this.actionWrapperEl=y},n("slot",{key:"f391b035ad9fc108d1f99c4cedf539425c20a36d",name:we.action})),this.type==="number"&&this.numberButtonType==="vertical"&&!this.readOnly?c:null,this.suffixText?h:null,this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?o:null,n(U,{key:"df415df551b4a9a16565c8f554454d01aa89327e",component:this})),this.validationMessage&&this.status==="invalid"?n(de,{icon:this.validationIcon,id:x.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{autofocus:["handleGlobalAttributesChanged"],enterkeyhint:["handleGlobalAttributesChanged"],inputmode:["handleGlobalAttributesChanged"],disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ie}},[1,"calcite-input",{alignment:[513],autofocus:[4],clearable:[516],disabled:[516],enterKeyHint:[1,"enter-key-hint"],form:[513],groupSeparator:[516,"group-separator"],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],inputMode:[1,"input-mode"],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],validationMessage:[1,"validation-message"],validationIcon:[520,"validation-icon"],validity:[1040],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[513],status:[513],step:[520],autocomplete:[1],pattern:[1],accept:[1],multiple:[4],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],type:[513],value:[1025],files:[16],messages:[1040],messageOverrides:[1040],defaultMessages:[32],effectiveLocale:[32],displayedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64]},void 0,{autofocus:["handleGlobalAttributesChanged"],enterkeyhint:["handleGlobalAttributesChanged"],inputmode:["handleGlobalAttributesChanged"],disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}]);function Ve(){typeof customElements>"u"||["calcite-input","calcite-icon","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-input":customElements.get(e)||customElements.define(e,Ee);break;case"calcite-icon":customElements.get(e)||L();break;case"calcite-input-message":customElements.get(e)||B();break;case"calcite-progress":customElements.get(e)||M();break}})}Ve();export{Ee as F,Ve as M,B as w,M as z}; diff --git a/main/assets/interactive-DqhNilgd-D_Gwwuwg.js b/main/assets/interactive-DqhNilgd-D_Gwwuwg.js new file mode 100644 index 000000000..04cecb5d2 --- /dev/null +++ b/main/assets/interactive-DqhNilgd-D_Gwwuwg.js @@ -0,0 +1 @@ +import{a as r}from"./themeUtils-YjM7iIiX-J3djxNmP.js";function c(){const{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function i(e){e.target.disabled&&e.preventDefault()}const o=["mousedown","mouseup","click"];function a(e){e.target.disabled&&(e.stopImmediatePropagation(),e.preventDefault())}const t={capture:!0};function p(e){if(e.disabled){e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),l(e);return}s(e),e.el.removeAttribute("aria-disabled")}function l(e){e.el.click=c,d(e.el)}function d(e){e.addEventListener("pointerdown",i,t),o.forEach(n=>e.addEventListener(n,a,t))}function s(e){delete e.el.click,u(e.el)}function u(e){e.removeEventListener("pointerdown",i,t),o.forEach(n=>e.removeEventListener(n,a,t))}const f={container:"interaction-container"},v=({disabled:e},n)=>r("div",{class:f.container,inert:e},...n);export{p as l,v as p}; diff --git a/main/assets/interactive-DqhNilgd-DrUFww1w.js b/main/assets/interactive-DqhNilgd-DrUFww1w.js deleted file mode 100644 index 7e27c5726..000000000 --- a/main/assets/interactive-DqhNilgd-DrUFww1w.js +++ /dev/null @@ -1 +0,0 @@ -import{a as r}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";function c(){const{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function i(e){e.target.disabled&&e.preventDefault()}const o=["mousedown","mouseup","click"];function a(e){e.target.disabled&&(e.stopImmediatePropagation(),e.preventDefault())}const t={capture:!0};function p(e){if(e.disabled){e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),l(e);return}s(e),e.el.removeAttribute("aria-disabled")}function l(e){e.el.click=c,d(e.el)}function d(e){e.addEventListener("pointerdown",i,t),o.forEach(n=>e.addEventListener(n,a,t))}function s(e){delete e.el.click,u(e.el)}function u(e){e.removeEventListener("pointerdown",i,t),o.forEach(n=>e.removeEventListener(n,a,t))}const f={container:"interaction-container"},v=({disabled:e},n)=>r("div",{class:f.container,inert:e},...n);export{p as l,v as p}; diff --git a/main/assets/item-DaimTDdD-BMoarTcZ.js b/main/assets/item-DaimTDdD-BMoarTcZ.js new file mode 100644 index 000000000..4aacc3d5a --- /dev/null +++ b/main/assets/item-DaimTDdD-BMoarTcZ.js @@ -0,0 +1 @@ +import{c2 as Y,c6 as ne,ch as H,cj as ce,cl as q,ca as t,cm as n,cn as k,cd as o,cf as l,gb as x,gc as ie,ce as M,fS as v,c7 as ge,cs as me,c8 as U,gy as u,gg as C,c9 as ye,cz as fe,cc as re,fG as Z,cr as w,c3 as oe,cw as te,cx as ae,fF as Le,cg as p,gj as xe,fQ as ke,ci as we,jp as b,jq as j,jr as de,cb as _,fR as Me,js as O,cy as Ce,fT as Te,gr as ze,c4 as W,jt as Se,ju as ee}from"./main-C7yV2j71.js";import{u as He}from"./marked.esm-DgqJBp_S-CCvGNfAT.js";const Ee=["type","aria-label","checked","disabled","content"],le=Y({__name:"checkbox",props:{value:{type:Object,required:!0},legendItem:{type:Object,required:!0},checked:{type:Boolean},label:{type:String},isRadio:{type:Boolean},disabled:{type:Boolean}},setup(e){const{t:y}=ne(),i=e,m=H(i.legendItem.visibility);ce(()=>{i.legendItem.checkVisibilityRules(),m.value=i.legendItem.visibility===i.checked});const I=s=>!s.symbologyStack.some(r=>r.visibility),B=()=>{if(i.value instanceof Te)i.legendItem.toggleVisibility();else if(i.legendItem instanceof v){if(I(i.legendItem)?(i.legendItem.setSymbologyVisibility(void 0,!1),i.legendItem.setSymbologyVisibility(i.value.uid,!0),i.legendItem.toggleVisibility(!0)):i.legendItem.setSymbologyVisibility(i.value.uid,!i.value.lastVisbility),I(i.legendItem)&&i.legendItem.toggleVisibility(!1),i.legendItem.layer?.supportsFeatures){const s=i.legendItem.symbologyStack.filter(z=>z.lastVisbility===!0).map(z=>z.definitionClause||"");let r="";s.length===0?r="1=2":s.length{const z=q("tippy");return t(),n("div",{class:"relative",onMouseover:r[3]||(r[3]=x(()=>{},["stop"]))},[k(o("input",{type:e.isRadio?"radio":"checkbox","aria-label":l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`),onClick:r[0]||(r[0]=x(G=>B(),["stop"])),checked:e.checked&&m.value,onKeypress:r[1]||(r[1]=ie(x(()=>{},["prevent"]),["enter"])),onKeyup:r[2]||(r[2]=ie(x(G=>B(),["stop"]),["enter"])),class:M([[e.disabled?"text-gray-400 border-gray-300":"text-black cursor-pointer border-gray-500 hover:border-black"],"mx-5 h-15 w-15"]),tabindex:"-1",disabled:e.disabled,content:l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`)},null,42,Ee),[[z,{placement:"top-end",hideOnClick:!1}]])],32)}}}),Ve=["aria-label"],Ae=["aria-label"],Ze=["aria-label"],Be=["aria-label"],je=["aria-label"],_e=["aria-label"],Ue=["content","aria-label"],$e=Y({__name:"legend-options",props:{legendItem:v},setup(e){const{t:y}=ne(),i=ge("iApi"),m=H(),I=H(!1),B=me(),s=H(B.mobileView),r=e,z=()=>{r.legendItem.layerControlAvailable(u.Symbology)&&r.legendItem.toggleSymbology()},G=()=>{r.legendItem.layerControlAvailable(u.Datatable)&&A("grid")&&i.event.emit(W.GRID_TOGGLE,r.legendItem.layer)},D=()=>{r.legendItem.layerControlAvailable(u.Settings)&&A("settings")&&i.event.emit(W.SETTINGS_TOGGLE,r.legendItem.layer)},Q=()=>{if(r.legendItem.layerControlAvailable(u.Metadata)&&A("metadata")){const S=r.legendItem?.layer?.config.metadata||r.legendItem?.layer?.parentLayer?.config?.metadata||{},c=S?.name||r.legendItem?.layer?.name||"",f=r.legendItem?.layer?.config?.catalogueUrl||r.legendItem?.layer?.layerType==="sublayer"&&r.legendItem?.layer?.parentLayer?.config?.catalogueUrl||void 0;if(S.url){const $=S.url.split("."),E=$[$.length-1],X=E==="xml"||E==="md"?E:"html";i.event.emit(W.METADATA_TOGGLE,{type:X,layerName:c,url:S.url,catalogueUrl:f,layer:r.legendItem.layer})}else console.warn("Layer does not have a metadata url defined")}},V=()=>{r.legendItem.layerControlAvailable(u.BoundaryZoom)&&r.legendItem?.layer?.zoomToLayerBoundary()},N=()=>{r.legendItem.layerControlAvailable(u.Remove)&&i.geo.map.removeLayer(r.legendItem.layerUid)},P=()=>{R.value&&(C(r.legendItem.layer).reload(),m.value.open=!1)},R=U(()=>r.legendItem.layerControlAvailable(u.Reload)&&r.legendItem instanceof v&&C(r.legendItem.layer)?.canReload),J=S=>{I.value=!0,setTimeout(()=>{I.value&&(s.value||S._tippy?.show())},300)},A=S=>{try{return i.fixture.exists(S)}catch{return!1}};return(S,c)=>{const f=ye("dropdown-menu"),$=q("tippy");return t(),n("div",{onClick:c[2]||(c[2]=x(()=>{},["stop"])),onMouseover:c[3]||(c[3]=x(()=>{},["stop"])),class:"options display-block cursor-auto"},[fe(f,{class:"flex-shrink-0",position:"bottom-end",tooltip:l(y)("legend.layer.options"),tooltipPlacement:"left",tooltipPlacementAlt:"left",ref_key:"dropdown",ref:m},{header:re(()=>c[4]||(c[4]=[o("div",{class:"flex p-4 justify-center items-center"},[o("svg",{class:"inline-block fill-current w-18 h-18 mx-4",viewBox:"0 0 23 21"},[o("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})])],-1)])),default:re(()=>[o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Metadata)||!A("metadata")}]),onClick:Q,role:"button","aria-label":l(y)("legend.layer.controls.metadata")},[c[5]||(c[5]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.metadata")),1)],10,Ve),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Settings)||!A("settings")}]),onClick:D,role:"button","aria-label":l(y)("legend.layer.controls.settings")},[c[6]||(c[6]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("g",null,[o("path",{d:"M 3,17L 3,19L 9,19L 9,17L 3,17 Z M 3,5L 3,7L 13,7L 13,5L 3,5 Z M 13,21L 13,19L 21,19L 21,17L 13,17L 13,15L 11,15L 11,21L 13,21 Z M 7,9L 7,11L 3,11L 3,13L 7,13L 7,15L 9,15L 9,9L 7,9 Z M 21,13L 21,11L 11,11L 11,13L 21,13 Z M 15,9L 17,9L 17,7L 21,7L 21,5L 17,5L 17,3L 15,3L 15,9 Z "})])],-1)),Z(" "+w(l(y)("legend.layer.controls.settings")),1)],10,Ae),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Datatable)||!A("grid")}]),onClick:G,role:"button","aria-label":l(y)("legend.layer.controls.datatable")},[c[7]||(c[7]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M 4.00002,3L 20,3C 21.1046,3 22,3.89543 22,5L 22,20C 22,21.1046 21.1046,22 20,22L 4.00001,22C 2.89544,22 2.00001,21.1046 2.00001,20L 2.00002,5C 2.00002,3.89543 2.89545,3 4.00002,3 Z M 4.00002,7L 4.00001,10L 8,10L 8,7.00001L 4.00002,7 Z M 10,7.00001L 9.99999,10L 14,10L 14,7.00001L 10,7.00001 Z M 20,10L 20,7L 16,7.00001L 16,10L 20,10 Z M 4.00002,12L 4.00002,15L 8,15L 8,12L 4.00002,12 Z M 4.00001,20L 8,20L 8,17L 4.00002,17L 4.00001,20 Z M 9.99999,12L 9.99999,15L 14,15L 14,12L 9.99999,12 Z M 9.99999,20L 14,20L 14,17L 9.99999,17L 9.99999,20 Z M 20,20L 20,17L 16,17L 16,20L 20,20 Z M 20,12L 16,12L 16,15L 20,15L 20,12 Z "})],-1)),Z(" "+w(l(y)("legend.layer.controls.datatable")),1)],10,Ze),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Symbology)}]),onClick:z,role:"button","aria-label":l(y)("legend.layer.controls.symbology")},[c[8]||(c[8]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.symbology")),1)],10,Be),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).BoundaryZoom)}]),onClick:V,role:"button","aria-label":l(y)("legend.layer.controls.boundaryzoom")},[c[9]||(c[9]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.boundaryzoom")),1)],10,je),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Remove)}]),onClick:N,role:"button","aria-label":l(y)("legend.layer.controls.remove")},[c[10]||(c[10]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.remove")),1)],10,_e),k((t(),n("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!R.value}]),content:R.value?"":l(y)("legend.layer.controls.reloadDisabled"),onMouseover:c[0]||(c[0]=x(E=>J(E.currentTarget),["stop"])),onMouseout:c[1]||(c[1]=E=>(s.value||E.currentTarget?._tippy?.hide(),I.value=!1)),onClick:P,role:"button","aria-label":l(y)("legend.layer.controls.reload")},[c[11]||(c[11]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.reload")),1)],42,Ue)),[[$,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]])]),_:1},8,["tooltip"])],32)}}}),Ge=oe($e,[["__scopeId","data-v-9590866e"]]),Pe={key:0},Re={key:0,class:"relative left-3"},Oe=["innerHTML"],qe=["src"],De={key:1,class:"symbologyIcon w-32 h-32"},Ne=["innerHTML"],Fe=["src"],Ke={key:1,class:"h-32 w-32 inline-flex justify-center items-center"},We=Y({__name:"symbology-stack",props:{visible:{type:Boolean,required:!0},legendItem:{type:Object,required:!0}},setup(e){const y=e,i=H([]);return ce(()=>{y.legendItem.loadPromise.then(()=>{y.legendItem.layerUid!==void 0&&Promise.all(C(y.legendItem.symbologyStack).map(m=>m.drawPromise)).then(()=>{i.value=C(y.legendItem).symbologyStack})})}),(m,I)=>e.visible?(t(),n("div",Ke,I[0]||(I[0]=[o("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]))):(t(),n("div",Pe,[i.value.length>1?(t(),n("div",Re,[(t(!0),n(te,null,ae(i.value.slice(0,3).reverse(),(B,s)=>(t(),n("div",{class:M(["absolute",[s==0?"symbol-0":s==1?"left-3 symbol-1":"left-6 symbol-2"]]),style:Le({"z-index":3-s}),key:s},[i.value[s].svgcode?(t(),n("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[s].svgcode},null,8,Oe)):i.value[s].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[s].imgUrl},null,8,qe)):p("",!0)],6))),128))])):i.value.length>0?(t(),n("div",De,[i.value[0].svgcode?(t(),n("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ne)):i.value[0].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Fe)):p("",!0)])):p("",!0)]))}}),Ye=oe(We,[["__scopeId","data-v-34dfeccd"]]),Qe={class:"relative"},Je=["content"],Xe={key:0,class:"flex p-5 mr-[13px]"},el={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},ll={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},tl=["disabled","content","aria-label"],al=["src"],nl={class:"h-auto break-words text-ellipsis"},ol={key:4,class:"flex-1 pointer-events-none p-5"},sl={key:5,class:"flex-1"},il={key:0,class:"text-lg font-bold"},rl={key:1},dl={key:2},cl=["src"],gl=["innerHTML"],ml={key:6,class:"relative"},yl=["content","aria-label"],vl={key:8,class:"relative"},pl=["content","aria-label"],ul={class:"flex p-5"},Il={key:0,class:"fill-current w-18 h-18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},bl={key:1,class:"inline-block fill-current w-18 h-18 mr-1",viewBox:"0 1 23 22"},hl=["content"],fl=["content"],Ll={key:11,class:"relative top-1"},xl=["content"],kl={key:0,class:"h-3 w-full absolute bottom-0"},wl={key:0,class:"symbology-stack default-focus-style"},Ml={key:0},Cl={key:0,class:"m-5"},Tl={key:0,class:"items-center grid-cols-1"},zl={key:0,class:"symbologyIcon w-full p-5"},Sl=["src"],Hl=["innerHTML"],El={key:2,class:"flex-1 p-5 bg-black-75 text-white"},Vl={key:1,class:"flex items-center"},Al={key:0,class:"symbologyIcon"},Zl=["src"],Bl={key:1,class:"symbologyIcon"},jl=["innerHTML"],_l={class:"flex-1 ml-15"},Ul={key:1},$l={class:"flex p-5 ml-48"},Gl={key:0,class:"relative animate-spin spinner h-20 w-20 mr-10 pt-2"},Pl={class:"flex-1 text-gray-500"},Rl={key:1,class:"legend-group border-l-2 ml-4 pl-4"},Ol=Y({__name:"item",props:{legendItem:{type:Object,required:!0}},setup(e){const y=xe(),i=me(),{t:m}=ne(),I=ge("iApi"),B=H(),s=e,r=ke(),z=r.multilineItems,G=(s.legendItem instanceof v&&s.legendItem.maxLines)??r.maxLines,D=H(i.mobileView),Q=U(()=>y.layerConfigs),V=H([]),N=H(!1),P=H(!1),R=U(()=>s.legendItem instanceof v?C(s.legendItem.layer)?.layerType:""),J=U(()=>s.legendItem instanceof v&&C(s.legendItem.layer)?.canModifyLayer),A=U(()=>{if(s.legendItem instanceof v){const d=C(s.legendItem.layer);return d?d.canReload:!0}else return!1}),S=U(()=>I.animate),c=U(()=>s.legendItem.children.length>0||s.legendItem instanceof v&&C(s.legendItem.layer)?.sublayers.length>0),f=d=>d===j.Expand||d===j.Visibility?s.legendItem.controlAvailable(d):s.legendItem.layerControlAvailable(d),$=d=>He(d),E=()=>{s.legendItem.children.length===0||!f(j.Expand)||(s.legendItem.toggleExpanded(),I.updateAlert(m(`legend.alert.group${s.legendItem.expanded?"Expanded":"Collapsed"}`)))},X=()=>{if(f(u.Symbology)){const d=s.legendItem.toggleSymbology();I.updateAlert(m(`legend.alert.symbology${d?"Expanded":"Collapsed"}`))}},ve=()=>{f(u.Datatable)&&F()&&I.event.emit(W.GRID_TOGGLE,s.legendItem.layer)},pe=d=>{const a=document.createElement("span");a.innerHTML=d.svgcode;const h=a.firstElementChild;return h?.classList.add("max-w-full"),h?.classList.add("h-full"),h?.setAttribute("height",d.imgHeight),h?.setAttribute("width",d.imgWidth),a.outerHTML},F=()=>{try{return I.fixture.exists("grid")}catch{return!1}},ue=()=>{s.legendItem.reload(),setTimeout(()=>{const d=s.legendItem;let a=!0;if(d.layer)C(d.layer).reload(),a=!1;else if(d.isSublayer&&d.parentLayerId){const h=I.geo.layer.getLayer(d.parentLayerId);h&&(C(h).reload(),a=!1)}if(a){const h=d.isSublayer?d.parentLayerId:d.layerId,L=Q.value.find(T=>T.id===h);L!==void 0&&Ie(L)}s.legendItem.loadPromise.catch(()=>{})},400)},Ie=async d=>{try{const a=I.geo.layer.getLayer(d.id);if(a){const[h]=await Se(C(a).reload());if(h)throw new Error;return a}else{const h=I.geo.layer.createLayer(d);return await I.geo.map.addLayer(h).catch(()=>{throw new Error}),h}}catch{return}},be=()=>{const d=C(s.legendItem);let a=0;if(d.type===b.Error){s.legendItem.toggleHidden(!0);const h=setInterval(()=>{const L=d.layer;(L&&(L.layerExists||L.initiationState===ee.NEW||L.initiationState===ee.TERMINATING||L.initiationState===ee.TERMINATED)||a>1200)&&(clearInterval(h),L&&I.geo.map.removeLayer(L),y.removeLayerConfig(d.layerId),I.fixture.get("legend")?.removeLayerItem(d.layerId)),a++},250)}else{s.legendItem.error();const h=setInterval(()=>{const L=d.parentLayerId||d.layerId,T=I.geo.layer.getLayer(L);T&&(clearInterval(h),T.cancelLoad(),(I.fixture.get("legend")?.getLayerBoundItems(T)||[]).forEach(K=>K.error())),a>1200&&clearInterval(h),a++},50)}},se=()=>{s.legendItem.loadPromise.then(()=>{if(V.value=[],!s.legendItem.layer){console.warn("Attempted to mount legend item component with undefined layer");return}Promise.all(C(s.legendItem.symbologyStack.map(d=>d.drawPromise))).then(()=>{V.value=s.legendItem.symbologyStack,N.value=!0})}).catch(()=>{})},he=d=>{P.value=!0,setTimeout(()=>{P.value&&(D.value||d._tippy?.show())},300)};return s.legendItem instanceof v&&(se(),we(()=>s.legendItem.symbologyStack,()=>{se()})),(d,a)=>{const h=ye("item",!0),L=q("tippy"),T=q("truncate"),K=q("focus-item");return e.legendItem.hidden?p("",!0):(t(),n("div",{key:`${e.legendItem.uid}-${e.legendItem.visibility}`,ref_key:"el",ref:B},[o("div",Qe,[k((t(),n("div",{class:M(["flex items-center hover:bg-gray-200 default-focus-style !p-5",[e.legendItem.type===l(b).Item?"loaded-item":e.legendItem.type===l(b).Error?"non-loaded-item bg-red-200":"non-loaded-item",c.value&&f(l(j).Expand)||!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?"cursor-pointer":"cursor-default",l(z)?"multilined":"singlelined"]]),onMouseover:a[9]||(a[9]=x(g=>he(g.currentTarget),["stop"])),onMouseout:a[10]||(a[10]=g=>(D.value||g.currentTarget?._tippy?.hide(),P.value=!1)),onClick:a[11]||(a[11]=()=>{!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?ve():c.value&&E()}),content:c.value&&f(l(j).Expand)?l(m)(e.legendItem.expanded?"legend.group.collapse":"legend.group.expand"):e.legendItem instanceof l(v)&&e.legendItem.type===l(b).Item&&f(l(u).Datatable)&&F()?l(m)("legend.layer.data"):"","truncate-trigger":""},[e.legendItem.type!==l(b).Item?(t(),n("div",Xe,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",el,a[12]||(a[12]=[de('',7)]))):(t(),n("svg",ll,a[13]||(a[13]=[de('',7)])))])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layer.legend.length>0?(t(),n("div",{key:1,class:"relative w-32 h-32 mr-15",onMouseover:a[0]||(a[0]=x(()=>{},["stop"]))},[k((t(),n("button",{type:"button",onClick:x(X,["stop"]),class:M([f(l(u).Symbology)?"cursor-pointer":"cursor-default"]),disabled:!f(l(u).Symbology),content:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand"),"aria-label":e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand")},[e.legendItem.coverIcon?(t(),n("img",{key:1,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32 hover:scale-105"]),src:e.legendItem.coverIcon,alt:"Cover icon not found :("},null,10,al)):(t(),_(Ye,{key:0,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32"]),visible:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded,legendItem:e.legendItem},null,8,["class","visible","legendItem"]))],10,tl)),[[L,{placement:"top-start"}]])],32)):p("",!0),c.value&&f(l(j).Expand)?(t(),n("div",{key:2,class:M(["expand-toggle p-8 pointer-events-none",{"rotate-180":e.legendItem.expanded}])},a[14]||(a[14]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)]),2)):p("",!0),e.legendItem instanceof l(v)&&l(z)?k((t(),n("div",{key:3,class:M(["flex-1 pointer-events-none m-5",`line-clamp-${l(G)}`])},[o("span",nl,w(e.legendItem.name??(e.legendItem?.layer?.name?e.legendItem.layer?.name:e.legendItem.layerId)),1)],2)),[[T,{externalTrigger:!0,noTruncateClass:!0}]]):e.legendItem instanceof l(v)?k((t(),n("div",ol,[o("span",null,w(e.legendItem.name??(!e.legendItem.layer||e.legendItem?.layer?.name===""?e.legendItem.layerId:e.legendItem.layer?.name)),1)])),[[T,{externalTrigger:!0}]]):e.legendItem instanceof l(Me)?(t(),n("div",sl,[e.legendItem.infoType===l(O).Title&&e.legendItem.content?(t(),n("h3",il,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Title?(t(),n("h3",rl,w(e.legendItem.name),1)):e.legendItem.infoType===l(O).Text?(t(),n("p",dl,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Image?(t(),n("img",{key:3,src:e.legendItem.content,alt:"InfoType image not found :("},null,8,cl)):e.legendItem.infoType===l(O).Markdown?(t(),n("div",{key:4,class:"ramp-markdown",innerHTML:$(e.legendItem.content)},null,8,gl)):(t(),_(Ce(`${e.legendItem.uid}-info-section`),{key:5}))])):p("",!0),e.legendItem.type===l(b).Error&&A.value?(t(),n("div",ml,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:l(m)("legend.layer.controls.reload"),onMouseover:a[1]||(a[1]=x(()=>{},["stop"])),onClick:x(ue,["stop"]),"aria-label":l(m)("legend.layer.controls.reload")},a[15]||(a[15]=[o("div",{class:"flex p-8"},[o("svg",{class:"inline-block fill-current w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})])],-1)]),40,yl)),[[L,{placement:"top-start"}]])])):p("",!0),(e.legendItem.type===l(b).Item||e.legendItem.type===l(b).Placeholder&&l(z))&&e.legendItem instanceof l(v)?(t(),_(Ge,{key:7,class:M({invisible:e.legendItem.type===l(b).Placeholder}),legendItem:e.legendItem},null,8,["class","legendItem"])):p("",!0),e.legendItem.type!==l(b).Item&&e.legendItem instanceof l(v)?(t(),n("div",vl,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel"),onMouseover:a[2]||(a[2]=x(()=>{},["stop"])),onClick:x(be,["stop"]),"aria-label":e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel")},[o("div",ul,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",Il,a[16]||(a[16]=[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},null,-1)]))):(t(),n("svg",bl,a[17]||(a[17]=[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},null,-1)])))])],40,pl)),[[L,{placement:"top-start"}]])])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?k((t(),n("div",{key:9,class:"relative p-4 cursor-default",content:l(m)("legend.layer.offscale"),onMouseover:a[3]||(a[3]=x(()=>{},["stop"])),onClick:a[4]||(a[4]=x(()=>{},["stop"])),"focus-icon":""},a[18]||(a[18]=[o("svg",{class:"inline-block fill-gray-400 w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M19.81 14.99l1.19-.92-1.43-1.43-1.19.92 1.43 1.43zm-.45-4.72L21 9l-9-7-2.91 2.27 7.87 7.88 2.4-1.88zM3.27 1L2 2.27l4.22 4.22L3 9l1.63 1.27L12 16l2.1-1.63 1.43 1.43L12 18.54l-7.37-5.73L3 14.07l9 7 4.95-3.85L20.73 21 22 19.73 3.27 1z"})],-1)]),40,hl)),[[L,{placement:"top-start"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&!e.legendItem.layer?.mapLayer?k((t(),n("div",{key:10,class:"relative p-4 cursor-default",content:l(m)("legend.layer.data.only"),onMouseover:a[5]||(a[5]=x(()=>{},["stop"])),onClick:a[6]||(a[6]=x(()=>{},["stop"])),"focus-icon":""},a[19]||(a[19]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 -960 960 960",width:"18",class:"inline-block fill-gray-400"},[o("path",{d:"m776.109-63.565-73.435-69.196q-51.302 32.573-106.091 59.145-54.788 26.572-116.255 26.572-88.94 0-167.803-33.893-78.862-33.894-138.052-93.239-59.19-59.346-93.19-138.205-34-78.86-34-167.619 0-64.607 19.12-125.521Q85.521-666.435 120-719.674l-50.848-50.848 68.761-68.761L844.87-132.326l-68.761 68.76Zm-345.392-92.653v-72.5l-52.25-52.086v-50.009l-219.01-218.752q-3 17.015-5 34.031-2 17.015-2 35.136 0 124.449 78.826 214.674 78.826 90.224 199.434 109.506Zm410.392-85.412-76.739-77.74q21.288-37.275 32.35-77.847 11.062-40.572 11.062-84.059 0-95.003-56.304-169.853-56.304-74.849-145.391-108.893v.522l-174.413 76.087v31.348L241.87-842.109q52.483-34.989 113.387-52.918 60.903-17.93 125.159-17.93 89.709 0 168.127 33.869 78.418 33.868 137.435 93.28 59.016 59.413 92.997 137.683 33.982 78.269 33.982 167.993 0 64.203-18.43 125.111-18.429 60.907-53.418 113.391Z"})],-1)]),40,fl)),[[L,{placement:"top-end"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?(t(),n("div",Ll,[k((t(),n("button",{type:"button",class:"p-4",content:l(m)("legend.layer.zoomToVisible"),onMouseover:a[7]||(a[7]=x(()=>{},["stop"])),onClick:a[8]||(a[8]=x(g=>e.legendItem.layer.zoomToVisibleScale(),["stop"]))},a[20]||(a[20]=[o("svg",{class:"m-auto",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)]),40,xl)),[[L,{placement:"top-start"}]])])):e.legendItem.type===l(b).Item&&f(l(j).Visibility)?(t(),_(le,{key:12,checked:e.legendItem.visibility,value:e.legendItem,isRadio:e.legendItem.parent&&e.legendItem.parent.exclusive,legendItem:e.legendItem,disabled:e.legendItem instanceof l(v)&&!e.legendItem.layerControlAvailable(l(u).Visibility),label:c.value?"Group":"Layer"},null,8,["checked","value","isRadio","legendItem","disabled","label"])):p("",!0)],42,Je)),[[K,"show-truncate"],[L,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]]),e.legendItem.type===l(b).Placeholder||e.legendItem instanceof l(v)&&e.legendItem.layerRedrawing&&e.legendItem.visibility?(t(),n("div",kl,a[21]||(a[21]=[o("div",{class:"progress-line"},null,-1)]))):p("",!0)]),e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?k((t(),n("div",wl,[V.value.length>0?(t(),n("div",Ml,[e.legendItem instanceof l(v)&&e.legendItem.description?(t(),n("p",Cl,w(e.legendItem.description),1)):p("",!0),(t(!0),n(te,null,ae(V.value,g=>(t(),n("div",{class:"m-5",key:g.uid},[g.imgUrl&&e.legendItem.symbologyRenderStyle==="images"||!g.imgUrl&&R.value==="ogc-wms"?(t(),n("div",Tl,[g.imgUrl?(t(),n("div",zl,[o("img",{class:"max-w-full",src:g.imgUrl},null,8,Sl)])):g.imgHeight?(t(),n("div",{key:1,class:"symbologyIcon w-full p-5",innerHTML:pe(g)},null,8,Hl)):p("",!0),g.label?k((t(),n("div",El,[o("span",null,w(g.label),1),!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause?(t(),_(le,{key:0,class:"float-right",value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)])),[[T]]):p("",!0)])):(t(),n("div",Vl,[g.imgUrl?(t(),n("div",Al,[o("img",{class:"w-32 h-32",src:g.imgUrl},null,8,Zl)])):g.svgcode?(t(),n("div",Bl,[o("span",{innerHTML:g.svgcode},null,8,jl)])):p("",!0),k((t(),n("div",_l,[Z(w(g.label),1)])),[[T]]),J.value&&e.legendItem.layer.supportsFeatures&&(!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause)?(t(),_(le,{key:2,value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)]))]))),128))])):p("",!0),N.value?p("",!0):(t(),n("div",Ul,[k((t(),n("div",$l,[S.value?(t(),n("div",Gl)):p("",!0),k((t(),n("div",Pl,[o("span",null,w(l(m)("legend.symbology.loading")),1)])),[[T]])])),[[T]])]))])),[[K]]):p("",!0),e.legendItem.expanded?(t(),n("div",Rl,[(t(!0),n(te,null,ae(e.legendItem.children,g=>(t(),_(h,{legendItem:g,key:g.uid},null,8,["legendItem"]))),128))])):p("",!0)]))}}}),Nl=oe(Ol,[["__scopeId","data-v-b1261e08"]]);export{Nl as default}; diff --git a/main/assets/item-DaimTDdD-C_yBjJCy.js b/main/assets/item-DaimTDdD-C_yBjJCy.js deleted file mode 100644 index aa8bcf6bc..000000000 --- a/main/assets/item-DaimTDdD-C_yBjJCy.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as Y,c6 as ne,ch as H,cj as ce,cl as q,ca as t,cm as n,cn as k,cd as o,cf as l,gb as x,gc as ie,ce as M,fS as v,c7 as ge,cs as me,c8 as U,gy as u,gg as C,c9 as ye,cz as fe,cc as re,fG as Z,cr as w,c3 as oe,cw as te,cx as ae,fF as Le,cg as p,gj as xe,fQ as ke,ci as we,jp as b,jq as j,jr as de,cb as _,fR as Me,js as O,cy as Ce,fT as Te,gr as ze,c4 as W,jt as Se,ju as ee}from"./main-BZaw9FpY.js";import{u as He}from"./marked.esm-DgqJBp_S-CCvGNfAT.js";const Ee=["type","aria-label","checked","disabled","content"],le=Y({__name:"checkbox",props:{value:{type:Object,required:!0},legendItem:{type:Object,required:!0},checked:{type:Boolean},label:{type:String},isRadio:{type:Boolean},disabled:{type:Boolean}},setup(e){const{t:y}=ne(),i=e,m=H(i.legendItem.visibility);ce(()=>{i.legendItem.checkVisibilityRules(),m.value=i.legendItem.visibility===i.checked});const I=s=>!s.symbologyStack.some(r=>r.visibility),B=()=>{if(i.value instanceof Te)i.legendItem.toggleVisibility();else if(i.legendItem instanceof v){if(I(i.legendItem)?(i.legendItem.setSymbologyVisibility(void 0,!1),i.legendItem.setSymbologyVisibility(i.value.uid,!0),i.legendItem.toggleVisibility(!0)):i.legendItem.setSymbologyVisibility(i.value.uid,!i.value.lastVisbility),I(i.legendItem)&&i.legendItem.toggleVisibility(!1),i.legendItem.layer?.supportsFeatures){const s=i.legendItem.symbologyStack.filter(z=>z.lastVisbility===!0).map(z=>z.definitionClause||"");let r="";s.length===0?r="1=2":s.length{const z=q("tippy");return t(),n("div",{class:"relative",onMouseover:r[3]||(r[3]=x(()=>{},["stop"]))},[k(o("input",{type:e.isRadio?"radio":"checkbox","aria-label":l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`),onClick:r[0]||(r[0]=x(G=>B(),["stop"])),checked:e.checked&&m.value,onKeypress:r[1]||(r[1]=ie(x(()=>{},["prevent"]),["enter"])),onKeyup:r[2]||(r[2]=ie(x(G=>B(),["stop"]),["enter"])),class:M([[e.disabled?"text-gray-400 border-gray-300":"text-black cursor-pointer border-gray-500 hover:border-black"],"mx-5 h-15 w-15"]),tabindex:"-1",disabled:e.disabled,content:l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`)},null,42,Ee),[[z,{placement:"top-end",hideOnClick:!1}]])],32)}}}),Ve=["aria-label"],Ae=["aria-label"],Ze=["aria-label"],Be=["aria-label"],je=["aria-label"],_e=["aria-label"],Ue=["content","aria-label"],$e=Y({__name:"legend-options",props:{legendItem:v},setup(e){const{t:y}=ne(),i=ge("iApi"),m=H(),I=H(!1),B=me(),s=H(B.mobileView),r=e,z=()=>{r.legendItem.layerControlAvailable(u.Symbology)&&r.legendItem.toggleSymbology()},G=()=>{r.legendItem.layerControlAvailable(u.Datatable)&&A("grid")&&i.event.emit(W.GRID_TOGGLE,r.legendItem.layer)},D=()=>{r.legendItem.layerControlAvailable(u.Settings)&&A("settings")&&i.event.emit(W.SETTINGS_TOGGLE,r.legendItem.layer)},Q=()=>{if(r.legendItem.layerControlAvailable(u.Metadata)&&A("metadata")){const S=r.legendItem?.layer?.config.metadata||r.legendItem?.layer?.parentLayer?.config?.metadata||{},c=S?.name||r.legendItem?.layer?.name||"",f=r.legendItem?.layer?.config?.catalogueUrl||r.legendItem?.layer?.layerType==="sublayer"&&r.legendItem?.layer?.parentLayer?.config?.catalogueUrl||void 0;if(S.url){const $=S.url.split("."),E=$[$.length-1],X=E==="xml"||E==="md"?E:"html";i.event.emit(W.METADATA_TOGGLE,{type:X,layerName:c,url:S.url,catalogueUrl:f,layer:r.legendItem.layer})}else console.warn("Layer does not have a metadata url defined")}},V=()=>{r.legendItem.layerControlAvailable(u.BoundaryZoom)&&r.legendItem?.layer?.zoomToLayerBoundary()},N=()=>{r.legendItem.layerControlAvailable(u.Remove)&&i.geo.map.removeLayer(r.legendItem.layerUid)},P=()=>{R.value&&(C(r.legendItem.layer).reload(),m.value.open=!1)},R=U(()=>r.legendItem.layerControlAvailable(u.Reload)&&r.legendItem instanceof v&&C(r.legendItem.layer)?.canReload),J=S=>{I.value=!0,setTimeout(()=>{I.value&&(s.value||S._tippy?.show())},300)},A=S=>{try{return i.fixture.exists(S)}catch{return!1}};return(S,c)=>{const f=ye("dropdown-menu"),$=q("tippy");return t(),n("div",{onClick:c[2]||(c[2]=x(()=>{},["stop"])),onMouseover:c[3]||(c[3]=x(()=>{},["stop"])),class:"options display-block cursor-auto"},[fe(f,{class:"flex-shrink-0",position:"bottom-end",tooltip:l(y)("legend.layer.options"),tooltipPlacement:"left",tooltipPlacementAlt:"left",ref_key:"dropdown",ref:m},{header:re(()=>c[4]||(c[4]=[o("div",{class:"flex p-4 justify-center items-center"},[o("svg",{class:"inline-block fill-current w-18 h-18 mx-4",viewBox:"0 0 23 21"},[o("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})])],-1)])),default:re(()=>[o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Metadata)||!A("metadata")}]),onClick:Q,role:"button","aria-label":l(y)("legend.layer.controls.metadata")},[c[5]||(c[5]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.metadata")),1)],10,Ve),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Settings)||!A("settings")}]),onClick:D,role:"button","aria-label":l(y)("legend.layer.controls.settings")},[c[6]||(c[6]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("g",null,[o("path",{d:"M 3,17L 3,19L 9,19L 9,17L 3,17 Z M 3,5L 3,7L 13,7L 13,5L 3,5 Z M 13,21L 13,19L 21,19L 21,17L 13,17L 13,15L 11,15L 11,21L 13,21 Z M 7,9L 7,11L 3,11L 3,13L 7,13L 7,15L 9,15L 9,9L 7,9 Z M 21,13L 21,11L 11,11L 11,13L 21,13 Z M 15,9L 17,9L 17,7L 21,7L 21,5L 17,5L 17,3L 15,3L 15,9 Z "})])],-1)),Z(" "+w(l(y)("legend.layer.controls.settings")),1)],10,Ae),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Datatable)||!A("grid")}]),onClick:G,role:"button","aria-label":l(y)("legend.layer.controls.datatable")},[c[7]||(c[7]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M 4.00002,3L 20,3C 21.1046,3 22,3.89543 22,5L 22,20C 22,21.1046 21.1046,22 20,22L 4.00001,22C 2.89544,22 2.00001,21.1046 2.00001,20L 2.00002,5C 2.00002,3.89543 2.89545,3 4.00002,3 Z M 4.00002,7L 4.00001,10L 8,10L 8,7.00001L 4.00002,7 Z M 10,7.00001L 9.99999,10L 14,10L 14,7.00001L 10,7.00001 Z M 20,10L 20,7L 16,7.00001L 16,10L 20,10 Z M 4.00002,12L 4.00002,15L 8,15L 8,12L 4.00002,12 Z M 4.00001,20L 8,20L 8,17L 4.00002,17L 4.00001,20 Z M 9.99999,12L 9.99999,15L 14,15L 14,12L 9.99999,12 Z M 9.99999,20L 14,20L 14,17L 9.99999,17L 9.99999,20 Z M 20,20L 20,17L 16,17L 16,20L 20,20 Z M 20,12L 16,12L 16,15L 20,15L 20,12 Z "})],-1)),Z(" "+w(l(y)("legend.layer.controls.datatable")),1)],10,Ze),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Symbology)}]),onClick:z,role:"button","aria-label":l(y)("legend.layer.controls.symbology")},[c[8]||(c[8]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.symbology")),1)],10,Be),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).BoundaryZoom)}]),onClick:V,role:"button","aria-label":l(y)("legend.layer.controls.boundaryzoom")},[c[9]||(c[9]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.boundaryzoom")),1)],10,je),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Remove)}]),onClick:N,role:"button","aria-label":l(y)("legend.layer.controls.remove")},[c[10]||(c[10]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.remove")),1)],10,_e),k((t(),n("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!R.value}]),content:R.value?"":l(y)("legend.layer.controls.reloadDisabled"),onMouseover:c[0]||(c[0]=x(E=>J(E.currentTarget),["stop"])),onMouseout:c[1]||(c[1]=E=>(s.value||E.currentTarget?._tippy?.hide(),I.value=!1)),onClick:P,role:"button","aria-label":l(y)("legend.layer.controls.reload")},[c[11]||(c[11]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.reload")),1)],42,Ue)),[[$,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]])]),_:1},8,["tooltip"])],32)}}}),Ge=oe($e,[["__scopeId","data-v-9590866e"]]),Pe={key:0},Re={key:0,class:"relative left-3"},Oe=["innerHTML"],qe=["src"],De={key:1,class:"symbologyIcon w-32 h-32"},Ne=["innerHTML"],Fe=["src"],Ke={key:1,class:"h-32 w-32 inline-flex justify-center items-center"},We=Y({__name:"symbology-stack",props:{visible:{type:Boolean,required:!0},legendItem:{type:Object,required:!0}},setup(e){const y=e,i=H([]);return ce(()=>{y.legendItem.loadPromise.then(()=>{y.legendItem.layerUid!==void 0&&Promise.all(C(y.legendItem.symbologyStack).map(m=>m.drawPromise)).then(()=>{i.value=C(y.legendItem).symbologyStack})})}),(m,I)=>e.visible?(t(),n("div",Ke,I[0]||(I[0]=[o("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]))):(t(),n("div",Pe,[i.value.length>1?(t(),n("div",Re,[(t(!0),n(te,null,ae(i.value.slice(0,3).reverse(),(B,s)=>(t(),n("div",{class:M(["absolute",[s==0?"symbol-0":s==1?"left-3 symbol-1":"left-6 symbol-2"]]),style:Le({"z-index":3-s}),key:s},[i.value[s].svgcode?(t(),n("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[s].svgcode},null,8,Oe)):i.value[s].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[s].imgUrl},null,8,qe)):p("",!0)],6))),128))])):i.value.length>0?(t(),n("div",De,[i.value[0].svgcode?(t(),n("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ne)):i.value[0].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Fe)):p("",!0)])):p("",!0)]))}}),Ye=oe(We,[["__scopeId","data-v-34dfeccd"]]),Qe={class:"relative"},Je=["content"],Xe={key:0,class:"flex p-5 mr-[13px]"},el={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},ll={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},tl=["disabled","content","aria-label"],al=["src"],nl={class:"h-auto break-words text-ellipsis"},ol={key:4,class:"flex-1 pointer-events-none p-5"},sl={key:5,class:"flex-1"},il={key:0,class:"text-lg font-bold"},rl={key:1},dl={key:2},cl=["src"],gl=["innerHTML"],ml={key:6,class:"relative"},yl=["content","aria-label"],vl={key:8,class:"relative"},pl=["content","aria-label"],ul={class:"flex p-5"},Il={key:0,class:"fill-current w-18 h-18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},bl={key:1,class:"inline-block fill-current w-18 h-18 mr-1",viewBox:"0 1 23 22"},hl=["content"],fl=["content"],Ll={key:11,class:"relative top-1"},xl=["content"],kl={key:0,class:"h-3 w-full absolute bottom-0"},wl={key:0,class:"symbology-stack default-focus-style"},Ml={key:0},Cl={key:0,class:"m-5"},Tl={key:0,class:"items-center grid-cols-1"},zl={key:0,class:"symbologyIcon w-full p-5"},Sl=["src"],Hl=["innerHTML"],El={key:2,class:"flex-1 p-5 bg-black-75 text-white"},Vl={key:1,class:"flex items-center"},Al={key:0,class:"symbologyIcon"},Zl=["src"],Bl={key:1,class:"symbologyIcon"},jl=["innerHTML"],_l={class:"flex-1 ml-15"},Ul={key:1},$l={class:"flex p-5 ml-48"},Gl={key:0,class:"relative animate-spin spinner h-20 w-20 mr-10 pt-2"},Pl={class:"flex-1 text-gray-500"},Rl={key:1,class:"legend-group border-l-2 ml-4 pl-4"},Ol=Y({__name:"item",props:{legendItem:{type:Object,required:!0}},setup(e){const y=xe(),i=me(),{t:m}=ne(),I=ge("iApi"),B=H(),s=e,r=ke(),z=r.multilineItems,G=(s.legendItem instanceof v&&s.legendItem.maxLines)??r.maxLines,D=H(i.mobileView),Q=U(()=>y.layerConfigs),V=H([]),N=H(!1),P=H(!1),R=U(()=>s.legendItem instanceof v?C(s.legendItem.layer)?.layerType:""),J=U(()=>s.legendItem instanceof v&&C(s.legendItem.layer)?.canModifyLayer),A=U(()=>{if(s.legendItem instanceof v){const d=C(s.legendItem.layer);return d?d.canReload:!0}else return!1}),S=U(()=>I.animate),c=U(()=>s.legendItem.children.length>0||s.legendItem instanceof v&&C(s.legendItem.layer)?.sublayers.length>0),f=d=>d===j.Expand||d===j.Visibility?s.legendItem.controlAvailable(d):s.legendItem.layerControlAvailable(d),$=d=>He(d),E=()=>{s.legendItem.children.length===0||!f(j.Expand)||(s.legendItem.toggleExpanded(),I.updateAlert(m(`legend.alert.group${s.legendItem.expanded?"Expanded":"Collapsed"}`)))},X=()=>{if(f(u.Symbology)){const d=s.legendItem.toggleSymbology();I.updateAlert(m(`legend.alert.symbology${d?"Expanded":"Collapsed"}`))}},ve=()=>{f(u.Datatable)&&F()&&I.event.emit(W.GRID_TOGGLE,s.legendItem.layer)},pe=d=>{const a=document.createElement("span");a.innerHTML=d.svgcode;const h=a.firstElementChild;return h?.classList.add("max-w-full"),h?.classList.add("h-full"),h?.setAttribute("height",d.imgHeight),h?.setAttribute("width",d.imgWidth),a.outerHTML},F=()=>{try{return I.fixture.exists("grid")}catch{return!1}},ue=()=>{s.legendItem.reload(),setTimeout(()=>{const d=s.legendItem;let a=!0;if(d.layer)C(d.layer).reload(),a=!1;else if(d.isSublayer&&d.parentLayerId){const h=I.geo.layer.getLayer(d.parentLayerId);h&&(C(h).reload(),a=!1)}if(a){const h=d.isSublayer?d.parentLayerId:d.layerId,L=Q.value.find(T=>T.id===h);L!==void 0&&Ie(L)}s.legendItem.loadPromise.catch(()=>{})},400)},Ie=async d=>{try{const a=I.geo.layer.getLayer(d.id);if(a){const[h]=await Se(C(a).reload());if(h)throw new Error;return a}else{const h=I.geo.layer.createLayer(d);return await I.geo.map.addLayer(h).catch(()=>{throw new Error}),h}}catch{return}},be=()=>{const d=C(s.legendItem);let a=0;if(d.type===b.Error){s.legendItem.toggleHidden(!0);const h=setInterval(()=>{const L=d.layer;(L&&(L.layerExists||L.initiationState===ee.NEW||L.initiationState===ee.TERMINATING||L.initiationState===ee.TERMINATED)||a>1200)&&(clearInterval(h),L&&I.geo.map.removeLayer(L),y.removeLayerConfig(d.layerId),I.fixture.get("legend")?.removeLayerItem(d.layerId)),a++},250)}else{s.legendItem.error();const h=setInterval(()=>{const L=d.parentLayerId||d.layerId,T=I.geo.layer.getLayer(L);T&&(clearInterval(h),T.cancelLoad(),(I.fixture.get("legend")?.getLayerBoundItems(T)||[]).forEach(K=>K.error())),a>1200&&clearInterval(h),a++},50)}},se=()=>{s.legendItem.loadPromise.then(()=>{if(V.value=[],!s.legendItem.layer){console.warn("Attempted to mount legend item component with undefined layer");return}Promise.all(C(s.legendItem.symbologyStack.map(d=>d.drawPromise))).then(()=>{V.value=s.legendItem.symbologyStack,N.value=!0})}).catch(()=>{})},he=d=>{P.value=!0,setTimeout(()=>{P.value&&(D.value||d._tippy?.show())},300)};return s.legendItem instanceof v&&(se(),we(()=>s.legendItem.symbologyStack,()=>{se()})),(d,a)=>{const h=ye("item",!0),L=q("tippy"),T=q("truncate"),K=q("focus-item");return e.legendItem.hidden?p("",!0):(t(),n("div",{key:`${e.legendItem.uid}-${e.legendItem.visibility}`,ref_key:"el",ref:B},[o("div",Qe,[k((t(),n("div",{class:M(["flex items-center hover:bg-gray-200 default-focus-style !p-5",[e.legendItem.type===l(b).Item?"loaded-item":e.legendItem.type===l(b).Error?"non-loaded-item bg-red-200":"non-loaded-item",c.value&&f(l(j).Expand)||!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?"cursor-pointer":"cursor-default",l(z)?"multilined":"singlelined"]]),onMouseover:a[9]||(a[9]=x(g=>he(g.currentTarget),["stop"])),onMouseout:a[10]||(a[10]=g=>(D.value||g.currentTarget?._tippy?.hide(),P.value=!1)),onClick:a[11]||(a[11]=()=>{!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?ve():c.value&&E()}),content:c.value&&f(l(j).Expand)?l(m)(e.legendItem.expanded?"legend.group.collapse":"legend.group.expand"):e.legendItem instanceof l(v)&&e.legendItem.type===l(b).Item&&f(l(u).Datatable)&&F()?l(m)("legend.layer.data"):"","truncate-trigger":""},[e.legendItem.type!==l(b).Item?(t(),n("div",Xe,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",el,a[12]||(a[12]=[de('',7)]))):(t(),n("svg",ll,a[13]||(a[13]=[de('',7)])))])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layer.legend.length>0?(t(),n("div",{key:1,class:"relative w-32 h-32 mr-15",onMouseover:a[0]||(a[0]=x(()=>{},["stop"]))},[k((t(),n("button",{type:"button",onClick:x(X,["stop"]),class:M([f(l(u).Symbology)?"cursor-pointer":"cursor-default"]),disabled:!f(l(u).Symbology),content:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand"),"aria-label":e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand")},[e.legendItem.coverIcon?(t(),n("img",{key:1,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32 hover:scale-105"]),src:e.legendItem.coverIcon,alt:"Cover icon not found :("},null,10,al)):(t(),_(Ye,{key:0,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32"]),visible:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded,legendItem:e.legendItem},null,8,["class","visible","legendItem"]))],10,tl)),[[L,{placement:"top-start"}]])],32)):p("",!0),c.value&&f(l(j).Expand)?(t(),n("div",{key:2,class:M(["expand-toggle p-8 pointer-events-none",{"rotate-180":e.legendItem.expanded}])},a[14]||(a[14]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)]),2)):p("",!0),e.legendItem instanceof l(v)&&l(z)?k((t(),n("div",{key:3,class:M(["flex-1 pointer-events-none m-5",`line-clamp-${l(G)}`])},[o("span",nl,w(e.legendItem.name??(e.legendItem?.layer?.name?e.legendItem.layer?.name:e.legendItem.layerId)),1)],2)),[[T,{externalTrigger:!0,noTruncateClass:!0}]]):e.legendItem instanceof l(v)?k((t(),n("div",ol,[o("span",null,w(e.legendItem.name??(!e.legendItem.layer||e.legendItem?.layer?.name===""?e.legendItem.layerId:e.legendItem.layer?.name)),1)])),[[T,{externalTrigger:!0}]]):e.legendItem instanceof l(Me)?(t(),n("div",sl,[e.legendItem.infoType===l(O).Title&&e.legendItem.content?(t(),n("h3",il,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Title?(t(),n("h3",rl,w(e.legendItem.name),1)):e.legendItem.infoType===l(O).Text?(t(),n("p",dl,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Image?(t(),n("img",{key:3,src:e.legendItem.content,alt:"InfoType image not found :("},null,8,cl)):e.legendItem.infoType===l(O).Markdown?(t(),n("div",{key:4,class:"ramp-markdown",innerHTML:$(e.legendItem.content)},null,8,gl)):(t(),_(Ce(`${e.legendItem.uid}-info-section`),{key:5}))])):p("",!0),e.legendItem.type===l(b).Error&&A.value?(t(),n("div",ml,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:l(m)("legend.layer.controls.reload"),onMouseover:a[1]||(a[1]=x(()=>{},["stop"])),onClick:x(ue,["stop"]),"aria-label":l(m)("legend.layer.controls.reload")},a[15]||(a[15]=[o("div",{class:"flex p-8"},[o("svg",{class:"inline-block fill-current w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})])],-1)]),40,yl)),[[L,{placement:"top-start"}]])])):p("",!0),(e.legendItem.type===l(b).Item||e.legendItem.type===l(b).Placeholder&&l(z))&&e.legendItem instanceof l(v)?(t(),_(Ge,{key:7,class:M({invisible:e.legendItem.type===l(b).Placeholder}),legendItem:e.legendItem},null,8,["class","legendItem"])):p("",!0),e.legendItem.type!==l(b).Item&&e.legendItem instanceof l(v)?(t(),n("div",vl,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel"),onMouseover:a[2]||(a[2]=x(()=>{},["stop"])),onClick:x(be,["stop"]),"aria-label":e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel")},[o("div",ul,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",Il,a[16]||(a[16]=[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},null,-1)]))):(t(),n("svg",bl,a[17]||(a[17]=[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},null,-1)])))])],40,pl)),[[L,{placement:"top-start"}]])])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?k((t(),n("div",{key:9,class:"relative p-4 cursor-default",content:l(m)("legend.layer.offscale"),onMouseover:a[3]||(a[3]=x(()=>{},["stop"])),onClick:a[4]||(a[4]=x(()=>{},["stop"])),"focus-icon":""},a[18]||(a[18]=[o("svg",{class:"inline-block fill-gray-400 w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M19.81 14.99l1.19-.92-1.43-1.43-1.19.92 1.43 1.43zm-.45-4.72L21 9l-9-7-2.91 2.27 7.87 7.88 2.4-1.88zM3.27 1L2 2.27l4.22 4.22L3 9l1.63 1.27L12 16l2.1-1.63 1.43 1.43L12 18.54l-7.37-5.73L3 14.07l9 7 4.95-3.85L20.73 21 22 19.73 3.27 1z"})],-1)]),40,hl)),[[L,{placement:"top-start"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&!e.legendItem.layer?.mapLayer?k((t(),n("div",{key:10,class:"relative p-4 cursor-default",content:l(m)("legend.layer.data.only"),onMouseover:a[5]||(a[5]=x(()=>{},["stop"])),onClick:a[6]||(a[6]=x(()=>{},["stop"])),"focus-icon":""},a[19]||(a[19]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 -960 960 960",width:"18",class:"inline-block fill-gray-400"},[o("path",{d:"m776.109-63.565-73.435-69.196q-51.302 32.573-106.091 59.145-54.788 26.572-116.255 26.572-88.94 0-167.803-33.893-78.862-33.894-138.052-93.239-59.19-59.346-93.19-138.205-34-78.86-34-167.619 0-64.607 19.12-125.521Q85.521-666.435 120-719.674l-50.848-50.848 68.761-68.761L844.87-132.326l-68.761 68.76Zm-345.392-92.653v-72.5l-52.25-52.086v-50.009l-219.01-218.752q-3 17.015-5 34.031-2 17.015-2 35.136 0 124.449 78.826 214.674 78.826 90.224 199.434 109.506Zm410.392-85.412-76.739-77.74q21.288-37.275 32.35-77.847 11.062-40.572 11.062-84.059 0-95.003-56.304-169.853-56.304-74.849-145.391-108.893v.522l-174.413 76.087v31.348L241.87-842.109q52.483-34.989 113.387-52.918 60.903-17.93 125.159-17.93 89.709 0 168.127 33.869 78.418 33.868 137.435 93.28 59.016 59.413 92.997 137.683 33.982 78.269 33.982 167.993 0 64.203-18.43 125.111-18.429 60.907-53.418 113.391Z"})],-1)]),40,fl)),[[L,{placement:"top-end"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?(t(),n("div",Ll,[k((t(),n("button",{type:"button",class:"p-4",content:l(m)("legend.layer.zoomToVisible"),onMouseover:a[7]||(a[7]=x(()=>{},["stop"])),onClick:a[8]||(a[8]=x(g=>e.legendItem.layer.zoomToVisibleScale(),["stop"]))},a[20]||(a[20]=[o("svg",{class:"m-auto",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)]),40,xl)),[[L,{placement:"top-start"}]])])):e.legendItem.type===l(b).Item&&f(l(j).Visibility)?(t(),_(le,{key:12,checked:e.legendItem.visibility,value:e.legendItem,isRadio:e.legendItem.parent&&e.legendItem.parent.exclusive,legendItem:e.legendItem,disabled:e.legendItem instanceof l(v)&&!e.legendItem.layerControlAvailable(l(u).Visibility),label:c.value?"Group":"Layer"},null,8,["checked","value","isRadio","legendItem","disabled","label"])):p("",!0)],42,Je)),[[K,"show-truncate"],[L,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]]),e.legendItem.type===l(b).Placeholder||e.legendItem instanceof l(v)&&e.legendItem.layerRedrawing&&e.legendItem.visibility?(t(),n("div",kl,a[21]||(a[21]=[o("div",{class:"progress-line"},null,-1)]))):p("",!0)]),e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?k((t(),n("div",wl,[V.value.length>0?(t(),n("div",Ml,[e.legendItem instanceof l(v)&&e.legendItem.description?(t(),n("p",Cl,w(e.legendItem.description),1)):p("",!0),(t(!0),n(te,null,ae(V.value,g=>(t(),n("div",{class:"m-5",key:g.uid},[g.imgUrl&&e.legendItem.symbologyRenderStyle==="images"||!g.imgUrl&&R.value==="ogc-wms"?(t(),n("div",Tl,[g.imgUrl?(t(),n("div",zl,[o("img",{class:"max-w-full",src:g.imgUrl},null,8,Sl)])):g.imgHeight?(t(),n("div",{key:1,class:"symbologyIcon w-full p-5",innerHTML:pe(g)},null,8,Hl)):p("",!0),g.label?k((t(),n("div",El,[o("span",null,w(g.label),1),!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause?(t(),_(le,{key:0,class:"float-right",value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)])),[[T]]):p("",!0)])):(t(),n("div",Vl,[g.imgUrl?(t(),n("div",Al,[o("img",{class:"w-32 h-32",src:g.imgUrl},null,8,Zl)])):g.svgcode?(t(),n("div",Bl,[o("span",{innerHTML:g.svgcode},null,8,jl)])):p("",!0),k((t(),n("div",_l,[Z(w(g.label),1)])),[[T]]),J.value&&e.legendItem.layer.supportsFeatures&&(!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause)?(t(),_(le,{key:2,value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)]))]))),128))])):p("",!0),N.value?p("",!0):(t(),n("div",Ul,[k((t(),n("div",$l,[S.value?(t(),n("div",Gl)):p("",!0),k((t(),n("div",Pl,[o("span",null,w(l(m)("legend.symbology.loading")),1)])),[[T]])])),[[T]])]))])),[[K]]):p("",!0),e.legendItem.expanded?(t(),n("div",Rl,[(t(!0),n(te,null,ae(e.legendItem.children,g=>(t(),_(h,{legendItem:g,key:g.uid},null,8,["legendItem"]))),128))])):p("",!0)]))}}}),Nl=oe(Ol,[["__scopeId","data-v-b1261e08"]]);export{Nl as default}; diff --git a/main/assets/jsonContext-BA8GHqVk-BMETb6sX.js b/main/assets/jsonContext-BA8GHqVk-BMETb6sX.js deleted file mode 100644 index fff75ae25..000000000 --- a/main/assets/jsonContext-BA8GHqVk-BMETb6sX.js +++ /dev/null @@ -1 +0,0 @@ -import{a as o,r as n}from"./main-BZaw9FpY.js";function s(t,r){return{...a(t,r),readResourcePaths:[]}}function u(t,r,l){const e=o(t.itemUrl);return{...a(t,r),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:e?{rootPath:e.path,writtenUrls:[]}:null,resources:l?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function a(t,r){return{origin:r,url:o(t.itemUrl),portal:t.portal||n.getDefault(),portalItem:t}}export{s as a,u as i}; diff --git a/main/assets/jsonContext-BA8GHqVk-DpBf0bCt.js b/main/assets/jsonContext-BA8GHqVk-DpBf0bCt.js new file mode 100644 index 000000000..0b1782960 --- /dev/null +++ b/main/assets/jsonContext-BA8GHqVk-DpBf0bCt.js @@ -0,0 +1 @@ +import{a as o,r as n}from"./main-C7yV2j71.js";function s(t,r){return{...a(t,r),readResourcePaths:[]}}function u(t,r,l){const e=o(t.itemUrl);return{...a(t,r),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:e?{rootPath:e.path,writtenUrls:[]}:null,resources:l?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function a(t,r){return{origin:r,url:o(t.itemUrl),portal:t.portal||n.getDefault(),portalItem:t}}export{s as a,u as i}; diff --git a/main/assets/jsonUtils-C64Zfu7c-BqaK54UK.js b/main/assets/jsonUtils-C64Zfu7c-BqaK54UK.js new file mode 100644 index 000000000..e2e47e307 --- /dev/null +++ b/main/assets/jsonUtils-C64Zfu7c-BqaK54UK.js @@ -0,0 +1 @@ +import{P as a,dL as O,v as t,S as s,ac as X,i as _,ar as w,ad as ae,eB as G,eC as ue,bz as L,bB as pe,aa as K,e as T,eo as W,eD as ee,aq as ye,a1 as M,d4 as ce,b0 as de,aU as he,cN as me,cO as fe,f as Y,ex as ge,o as be,eE as ve,eF as we,ev as Se,ey as xe}from"./main-C7yV2j71.js";import{$ as A,h as je,E as R,L as _e,A as Ie,d as te,o as ie,a as Ee,G as Ve,B as Re}from"./UniqueValueRenderer-fS5V0Ej1-B6HXEsJb.js";import{b as De}from"./LRUCache-C3erQTWv-DhyPlt5p.js";import{m as Ne}from"./Version-CoKzbupV-BKAqCewj.js";import{o as Me}from"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import{c as Pe}from"./OverrideHelper-DWRbVlj1-D6dDt4cu.js";import{V as $e,v as Te}from"./utils-SPbpQbmm-Dl9Ps2XQ.js";import{d as qe,y as Ce,c as Oe}from"./heatmapUtils-seiMkkkR-BSMLb7yQ.js";import{w as Le}from"./RendererLegendOptions-K3md58-X-Bf90N-cx.js";import"./diffUtils-Cz3Fi8Xb-BvD0JNhD.js";import"./colorRamps-q0bZVhs2-DeDskCk_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-5umqHW84.js";import"./compilerUtils-CV1QYWI8-89qN_-l3.js";import"./lengthUtils-DKpMe5qR-E2FfnN85.js";import"./styleUtils-BtpNqZyT-CwQxANzG.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./colorUtils-Cthpxcks-CXgjba3p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-1xSDkBxg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";const Z="esri.renderers.support.DictionaryLoader",Ae={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let se=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new De(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(y){if(he(y))return this._dictionaryPromise=null,null}const o=this._dictionaryVersion?.greaterEqual(4,0),u={};if(this.fieldMap)for(const y of this._symbolFields){const d=$e(this.fieldMap[y],this._fieldIndex);if(d){const n=e.attributes[d];u[y]=o?n:n!=null?""+e.attributes[d]:""}else u[y]=""}let l=null;try{l=r?.(u,i)}catch{return null}if(!l||typeof l!="string"||l==="invalid")return null;const c=l.split(";"),b=[],f=[];for(let y=0;yNumber(v));else if(j==="Color"){const v=new w(g).toRgba();g=[v[0],v[1],v[2],255*v[3]]}else g=Number(g);f.push({primitiveName:x,propertyName:j,value:g,defaultValue:null})}}else if(d.includes("|")){for(const n of d.split("|"))if(this._itemNames.has(n)){b.push(n);break}}else if(this._itemNames.has(d))b.push(d);else if(y===0){b.length=0;let n="Invalid_P";e.geometry!=null&&(me(e.geometry)?n="Invalid_A":fe(e.geometry)&&(n="Invalid_L")),b.push(n);break}}}const D=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point";return this._cimPartsToCIMSymbol(e,b,f,D,i)}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void M.getLogger(Z).error("no valid URL!");const i=Y(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([i,ge()]);if(!r)throw this._dictionaryPromise=null,new be("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:o,dictionary_version:u,expression:l,itemsNames:c}=r,b=l;let f=!1;u&&(this._dictionaryVersion=Ne.parse(u),f=this._dictionaryVersion.greaterEqual(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(c),this._symbolFields=o.symbol;const D={};if(this.config){const n=this.config;for(const x in n)D[x]=n[x]}if(o.configuration)for(const n of o.configuration)D.hasOwnProperty(n.name)||(D[n.name]=n.value);const y=[];if(e?.fields&&this.fieldMap)for(const n in this.fieldMap){const x=this.fieldMap[n],j=e.fields.filter(g=>g.name.toLowerCase()===x?.toLowerCase());j.length>0&&y.push({...j[0],type:f?j[0].type:"esriFieldTypeString"})}y.length>0&&(this._fieldIndex=new Me(y));const d=ve(b,e!=null?e.spatialReference:null,y,D).then(n=>{const x={scale:0};return(j,g)=>{if(n==null)return null;const P=n.repurposeFeature({geometry:null,attributes:j});return x.scale=g!=null?g.scale??void 0:void 0,n.evaluate({$feature:P,$view:x},n.services)}}).catch(n=>(M.getLogger(Z).error("Creating dictionary expression failed:",n),null));return this._dictionaryPromise=d,d}async _cimPartsToCIMSymbol(e,i,r,o,u){const l=new Array(i.length);for(let f=0;fl.data);const o=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),u=Y(o,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,u),u.finally(()=>this._ongoingRequests.delete(e));try{const l=await u;return this._symbolCache.put(e,l.data),l.data}catch(l){throw l}}};function Fe(e,i,r){if(!e||e.length===0)return null;const o={...e[0]};if(e.length>1){o.effects=null,o.symbolLayers=[];for(const u of e){const l=u;if(l.effects!=null)for(const c of l.symbolLayers)c.effects==null?c.effects=l.effects:c.effects.unshift(...l.effects);o.symbolLayers.unshift(...l.symbolLayers)}}return r&&(o.callout=Ae),{type:"CIMSymbolReference",symbol:o,primitiveOverrides:i}}var F;let S=F=class extends A(R){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new se(this.url,this.config,this.fieldMap)}writeData(e,i){e&&(i.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,i,r,o){o?.origin||super.writeVisualVariables(e,i,r,o)}clone(){return new F({config:a(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:a(this.fieldMap),url:a(this.url),visualVariables:a(this.visualVariables)})}async getSymbolAsync(e,i){return this._loader.getSymbolAsync(e,i)}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i),this.scaleExpression&&await O(e,i,this.scaleExpression);for(const r in this.fieldMap){const o=this.fieldMap[r];i.has(o)&&e.add(o)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};t([s({type:se})],S.prototype,"_loader",null),t([s({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],S.prototype,"config",void 0),t([s({type:Object,json:{write:!0}})],S.prototype,"fieldMap",void 0),t([s({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],S.prototype,"scaleExpression",void 0),t([X("scaleExpression")],S.prototype,"writeData",null),t([s({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],S.prototype,"scaleExpressionTitle",void 0),t([s({type:String,json:{write:!0}})],S.prototype,"url",void 0),t([X("visualVariables")],S.prototype,"writeVisualVariables",null),S=F=t([_("esri.renderers.DictionaryRenderer")],S);const He=S;var H;let I=H=class extends T{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(M.getLogger(this).error(".field: field must be a string value"),null):Se(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new H({color:this.color?.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:w,json:{type:[Number],write:!0}})],I.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"field",void 0),t([ae("field")],I.prototype,"castField",null),t([s({type:String,json:{write:!0}})],I.prototype,"label",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpression",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpressionTitle",void 0),I=H=t([_("esri.renderers.support.AttributeColorInfo")],I);const re=I;var k;let q=k=class extends T{constructor(){super(...arguments),this.unit=null}clone(){return new k({unit:this.unit})}};t([s({type:String,json:{write:!0}})],q.prototype,"unit",void 0),q=k=t([_("esri.renderers.support.DotDensityLegendOptions")],q);const ke=q;var z;let h=z=class extends A(R){constructor(e){super(e),this.attributes=null,this.backgroundColor=new w([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new G,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const i=e/this.referenceScale*this.dotValue;return i<1?1:i}getSymbol(){return new ue({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new z({attributes:a(this.attributes),backgroundColor:a(this.backgroundColor),dotBlendingEnabled:a(this.dotBlendingEnabled),dotShape:a(this.dotShape),dotSize:a(this.dotSize),dotValue:a(this.dotValue),legendOptions:a(this.legendOptions),outline:a(this.outline),referenceScale:a(this.referenceScale),seed:a(this.seed),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}getControllerHash(){return`${this.attributes?.map(e=>e.field||e.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes??[])r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],h.prototype,"attributes",void 0),t([s({type:w,json:{write:!0}})],h.prototype,"backgroundColor",void 0),t([s({type:Boolean,json:{write:!0}})],h.prototype,"dotBlendingEnabled",void 0),t([s({type:String,json:{write:!1}})],h.prototype,"dotShape",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotSize",void 0),t([s({type:ke,json:{write:!0}})],h.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],h.prototype,"outline",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotValue",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"referenceScale",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"seed",void 0),t([L({dotDensity:"dot-density"})],h.prototype,"type",void 0),h=z=t([_("esri.renderers.DotDensityRenderer")],h);const ze=h;var B;let $=B=class extends T{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new B({color:this.color&&this.color.clone(),ratio:this.ratio})}};t([s({type:w,json:{type:[pe],default:null,write:!0}})],$.prototype,"color",void 0),t([s({type:Number,json:{write:!0}})],$.prototype,"ratio",void 0),$=B=t([_("esri.renderers.support.HeatmapColorStop")],$);const C=$;let N=class extends K(T){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};t([s({type:String,json:{write:!0}})],N.prototype,"minLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"maxLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"title",void 0),N=t([_("esri.renderers.support.HeatmapLegendOptions")],N);var J;function Q(e){if(e!=null){const{maxDensity:i,minDensity:r,radius:o}=e;if(i!=null||r!=null||o!=null){const{blurRadius:u,maxPixelIntensity:l,minPixelIntensity:c,...b}=e;return b}}return e}let p=J=class extends R{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new C({ratio:0,color:new w("rgba(255, 140, 0, 0)")}),new C({ratio:.75,color:new w("rgba(255, 140, 0, 1)")}),new C({ratio:.9,color:new w("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null}normalizeCtorArgs(e){return Q(e)}get blurRadius(){return qe(this.radius)}set blurRadius(e){const i=this.maxPixelIntensity,r=this.minPixelIntensity;this._set("radius",Ce(e)),this._set("maxDensity",i*this._pixelIntensityToDensity),this._set("minDensity",r*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity)}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity)}get _pixelIntensityToDensity(){return 24/(Oe**2*this.blurRadius**4)}read(e,i){e=Q(e),super.read(e,i)}getSymbol(){return new ee}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,i){const r=this.field,o=this.valueExpression;r&&typeof r=="string"&&xe(e,i,r),o&&typeof o=="string"&&await O(e,i,o)}getAttributeHash(){return""}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new J({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:a(this.colorStops),field:this.field,legendOptions:a(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:je,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],p.prototype,"authoringInfo",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"blurRadius",null),t([s({type:[C],json:{write:!0}})],p.prototype,"colorStops",void 0),t([s({type:String,json:{write:!0}})],p.prototype,"field",void 0),t([s({type:N,json:{write:!0}})],p.prototype,"legendOptions",void 0),t([s({type:Number,json:{write:!0}})],p.prototype,"maxDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"maxPixelIntensity",null),t([s({type:Number,json:{write:!0}})],p.prototype,"minDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"minPixelIntensity",null),t([s({type:Number,cast:W,json:{write:!0}})],p.prototype,"radius",void 0),t([s({type:Number,range:{min:0},json:{default:0,write:!0}})],p.prototype,"referenceScale",void 0),t([L({heatmap:"heatmap"})],p.prototype,"type",void 0),t([s({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"valueExpression",void 0),t([s({type:String})],p.prototype,"valueExpressionTitle",void 0),t([s({readOnly:!0})],p.prototype,"_pixelIntensityToDensity",null),p=J=t([_("esri.renderers.HeatmapRenderer")],p);const oe=p;let V=class extends K(T){constructor(){super(...arguments),this.color=new w([0,0,0,0]),this.label=null,this.threshold=0}};t([s({type:w,json:{write:!0}})],V.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],V.prototype,"label",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],V.prototype,"threshold",void 0),V=t([_("esri.renderers.support.OthersCategory")],V);const Be={base:Ee,key:"type",typeMap:{size:Ve,opacity:Re}};let m=class extends A(K(R)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new w([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new V,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart",this.visualVariables=null}getSymbol(){return new ee({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ye)}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],m.prototype,"attributes",void 0),t([s(_e)],m.prototype,"backgroundFillSymbol",void 0),t([s({type:w,json:{write:!0}})],m.prototype,"defaultColor",void 0),t([s({type:String,json:{write:!0}})],m.prototype,"defaultLabel",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],m.prototype,"holePercentage",void 0),t([s({type:V,json:{write:!0}})],m.prototype,"othersCategory",void 0),t([s({type:Le,json:{write:!0}})],m.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],m.prototype,"outline",void 0),t([s({type:Number,cast:W,json:{write:!0}})],m.prototype,"size",void 0),t([L({pieChart:"pie-chart"})],m.prototype,"type",void 0),t([s({types:[Be]})],m.prototype,"visualVariables",void 0),m=t([_("esri.renderers.PieChartRenderer")],m);const Je=m;var U;let E=U=class extends A(R){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,i){await Promise.all([this.collectSymbolFields(e,i),this.collectVVRequiredFields(e,i)])}async collectSymbolFields(e,i){await Promise.all(this.getSymbols().map(r=>r.collectRequiredFields(e,i)))}getSymbol(e,i){return this.symbol}async getSymbolAsync(e,i){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new U({description:this.description,label:this.label,symbol:a(this.symbol),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}};t([s({type:String,json:{write:!0}})],E.prototype,"description",void 0),t([s({type:String,json:{write:!0}})],E.prototype,"label",void 0),t([s(Ie)],E.prototype,"symbol",void 0),t([L({simple:"simple"})],E.prototype,"type",void 0),E=U=t([_("esri.renderers.SimpleRenderer")],E);const ne=E,Ue={key:"type",base:R,typeMap:{heatmap:oe,simple:ne,"unique-value":te,"class-breaks":ie,"dot-density":ze,dictionary:He,"pie-chart":Je},errorContext:"renderer"},xt={key:"type",base:R,typeMap:{simple:ne,"unique-value":te,"class-breaks":ie,heatmap:oe},errorContext:"renderer",validate:Ge};function Ge(e){switch(e.type){case"simple":return Ke(e);case"unique-value":return Xe(e);case"class-breaks":return Ye(e);case"heatmap":return e}}function Ke(e){if(e.symbol)return e;M.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Xe(e){const i=e.uniqueValueInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.uniqueValueInfos=r),e}function Ye(e){const i=e.classBreakInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.classBreakInfos=r),e}function Ze(e,i){return le(e,null,i)}const Qe=ce({types:Ue});function le(e,i,r){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(r?.messages&&r.messages.push(new de("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):Qe(e,i,r):null}const jt=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:Ze,read:le},Symbol.toStringTag,{value:"Module"}));export{jt as j,C as l,Ue as m,le as o,ne as p,Ze as t,xt as u}; diff --git a/main/assets/jsonUtils-C64Zfu7c-trwRB9M4.js b/main/assets/jsonUtils-C64Zfu7c-trwRB9M4.js deleted file mode 100644 index c13453dbe..000000000 --- a/main/assets/jsonUtils-C64Zfu7c-trwRB9M4.js +++ /dev/null @@ -1 +0,0 @@ -import{P as a,dL as O,v as t,S as s,ac as X,i as _,ar as w,ad as ae,eB as G,eC as ue,bz as L,bB as pe,aa as K,e as T,eo as W,eD as ee,aq as ye,a1 as M,d4 as ce,b0 as de,aU as he,cN as me,cO as fe,f as Y,ex as ge,o as be,eE as ve,eF as we,ev as Se,ey as xe}from"./main-BZaw9FpY.js";import{$ as A,h as je,E as R,L as _e,A as Ie,d as te,o as ie,a as Ee,G as Ve,B as Re}from"./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js";import{b as De}from"./LRUCache-C3erQTWv-CeYLuvL9.js";import{m as Ne}from"./Version-CoKzbupV-BxOJQpf3.js";import{o as Me}from"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import{c as Pe}from"./OverrideHelper-DWRbVlj1-C2SNS5Gu.js";import{V as $e,v as Te}from"./utils-SPbpQbmm-DpAlEmQT.js";import{d as qe,y as Ce,c as Oe}from"./heatmapUtils-seiMkkkR-D9lAE87R.js";import{w as Le}from"./RendererLegendOptions-K3md58-X-B6y5tQg5.js";import"./diffUtils-Cz3Fi8Xb-DBwynpLu.js";import"./colorRamps-q0bZVhs2-Bqen3nIx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js";import"./compilerUtils-CV1QYWI8-Ds7TbAp_.js";import"./lengthUtils-DKpMe5qR-CD-2dB4t.js";import"./styleUtils-BtpNqZyT-B-RFL3S3.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./colorUtils-Cthpxcks-BhGjp9AU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-72T4gbed.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";const Z="esri.renderers.support.DictionaryLoader",Ae={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let se=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new De(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(y){if(he(y))return this._dictionaryPromise=null,null}const o=this._dictionaryVersion?.greaterEqual(4,0),u={};if(this.fieldMap)for(const y of this._symbolFields){const d=$e(this.fieldMap[y],this._fieldIndex);if(d){const n=e.attributes[d];u[y]=o?n:n!=null?""+e.attributes[d]:""}else u[y]=""}let l=null;try{l=r?.(u,i)}catch{return null}if(!l||typeof l!="string"||l==="invalid")return null;const c=l.split(";"),b=[],f=[];for(let y=0;yNumber(v));else if(j==="Color"){const v=new w(g).toRgba();g=[v[0],v[1],v[2],255*v[3]]}else g=Number(g);f.push({primitiveName:x,propertyName:j,value:g,defaultValue:null})}}else if(d.includes("|")){for(const n of d.split("|"))if(this._itemNames.has(n)){b.push(n);break}}else if(this._itemNames.has(d))b.push(d);else if(y===0){b.length=0;let n="Invalid_P";e.geometry!=null&&(me(e.geometry)?n="Invalid_A":fe(e.geometry)&&(n="Invalid_L")),b.push(n);break}}}const D=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point";return this._cimPartsToCIMSymbol(e,b,f,D,i)}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void M.getLogger(Z).error("no valid URL!");const i=Y(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([i,ge()]);if(!r)throw this._dictionaryPromise=null,new be("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:o,dictionary_version:u,expression:l,itemsNames:c}=r,b=l;let f=!1;u&&(this._dictionaryVersion=Ne.parse(u),f=this._dictionaryVersion.greaterEqual(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(c),this._symbolFields=o.symbol;const D={};if(this.config){const n=this.config;for(const x in n)D[x]=n[x]}if(o.configuration)for(const n of o.configuration)D.hasOwnProperty(n.name)||(D[n.name]=n.value);const y=[];if(e?.fields&&this.fieldMap)for(const n in this.fieldMap){const x=this.fieldMap[n],j=e.fields.filter(g=>g.name.toLowerCase()===x?.toLowerCase());j.length>0&&y.push({...j[0],type:f?j[0].type:"esriFieldTypeString"})}y.length>0&&(this._fieldIndex=new Me(y));const d=ve(b,e!=null?e.spatialReference:null,y,D).then(n=>{const x={scale:0};return(j,g)=>{if(n==null)return null;const P=n.repurposeFeature({geometry:null,attributes:j});return x.scale=g!=null?g.scale??void 0:void 0,n.evaluate({$feature:P,$view:x},n.services)}}).catch(n=>(M.getLogger(Z).error("Creating dictionary expression failed:",n),null));return this._dictionaryPromise=d,d}async _cimPartsToCIMSymbol(e,i,r,o,u){const l=new Array(i.length);for(let f=0;fl.data);const o=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),u=Y(o,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,u),u.finally(()=>this._ongoingRequests.delete(e));try{const l=await u;return this._symbolCache.put(e,l.data),l.data}catch(l){throw l}}};function Fe(e,i,r){if(!e||e.length===0)return null;const o={...e[0]};if(e.length>1){o.effects=null,o.symbolLayers=[];for(const u of e){const l=u;if(l.effects!=null)for(const c of l.symbolLayers)c.effects==null?c.effects=l.effects:c.effects.unshift(...l.effects);o.symbolLayers.unshift(...l.symbolLayers)}}return r&&(o.callout=Ae),{type:"CIMSymbolReference",symbol:o,primitiveOverrides:i}}var F;let S=F=class extends A(R){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new se(this.url,this.config,this.fieldMap)}writeData(e,i){e&&(i.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,i,r,o){o?.origin||super.writeVisualVariables(e,i,r,o)}clone(){return new F({config:a(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:a(this.fieldMap),url:a(this.url),visualVariables:a(this.visualVariables)})}async getSymbolAsync(e,i){return this._loader.getSymbolAsync(e,i)}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i),this.scaleExpression&&await O(e,i,this.scaleExpression);for(const r in this.fieldMap){const o=this.fieldMap[r];i.has(o)&&e.add(o)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};t([s({type:se})],S.prototype,"_loader",null),t([s({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],S.prototype,"config",void 0),t([s({type:Object,json:{write:!0}})],S.prototype,"fieldMap",void 0),t([s({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],S.prototype,"scaleExpression",void 0),t([X("scaleExpression")],S.prototype,"writeData",null),t([s({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],S.prototype,"scaleExpressionTitle",void 0),t([s({type:String,json:{write:!0}})],S.prototype,"url",void 0),t([X("visualVariables")],S.prototype,"writeVisualVariables",null),S=F=t([_("esri.renderers.DictionaryRenderer")],S);const He=S;var H;let I=H=class extends T{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(M.getLogger(this).error(".field: field must be a string value"),null):Se(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new H({color:this.color?.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:w,json:{type:[Number],write:!0}})],I.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"field",void 0),t([ae("field")],I.prototype,"castField",null),t([s({type:String,json:{write:!0}})],I.prototype,"label",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpression",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpressionTitle",void 0),I=H=t([_("esri.renderers.support.AttributeColorInfo")],I);const re=I;var k;let q=k=class extends T{constructor(){super(...arguments),this.unit=null}clone(){return new k({unit:this.unit})}};t([s({type:String,json:{write:!0}})],q.prototype,"unit",void 0),q=k=t([_("esri.renderers.support.DotDensityLegendOptions")],q);const ke=q;var z;let h=z=class extends A(R){constructor(e){super(e),this.attributes=null,this.backgroundColor=new w([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new G,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const i=e/this.referenceScale*this.dotValue;return i<1?1:i}getSymbol(){return new ue({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new z({attributes:a(this.attributes),backgroundColor:a(this.backgroundColor),dotBlendingEnabled:a(this.dotBlendingEnabled),dotShape:a(this.dotShape),dotSize:a(this.dotSize),dotValue:a(this.dotValue),legendOptions:a(this.legendOptions),outline:a(this.outline),referenceScale:a(this.referenceScale),seed:a(this.seed),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}getControllerHash(){return`${this.attributes?.map(e=>e.field||e.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes??[])r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],h.prototype,"attributes",void 0),t([s({type:w,json:{write:!0}})],h.prototype,"backgroundColor",void 0),t([s({type:Boolean,json:{write:!0}})],h.prototype,"dotBlendingEnabled",void 0),t([s({type:String,json:{write:!1}})],h.prototype,"dotShape",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotSize",void 0),t([s({type:ke,json:{write:!0}})],h.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],h.prototype,"outline",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotValue",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"referenceScale",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"seed",void 0),t([L({dotDensity:"dot-density"})],h.prototype,"type",void 0),h=z=t([_("esri.renderers.DotDensityRenderer")],h);const ze=h;var B;let $=B=class extends T{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new B({color:this.color&&this.color.clone(),ratio:this.ratio})}};t([s({type:w,json:{type:[pe],default:null,write:!0}})],$.prototype,"color",void 0),t([s({type:Number,json:{write:!0}})],$.prototype,"ratio",void 0),$=B=t([_("esri.renderers.support.HeatmapColorStop")],$);const C=$;let N=class extends K(T){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};t([s({type:String,json:{write:!0}})],N.prototype,"minLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"maxLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"title",void 0),N=t([_("esri.renderers.support.HeatmapLegendOptions")],N);var J;function Q(e){if(e!=null){const{maxDensity:i,minDensity:r,radius:o}=e;if(i!=null||r!=null||o!=null){const{blurRadius:u,maxPixelIntensity:l,minPixelIntensity:c,...b}=e;return b}}return e}let p=J=class extends R{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new C({ratio:0,color:new w("rgba(255, 140, 0, 0)")}),new C({ratio:.75,color:new w("rgba(255, 140, 0, 1)")}),new C({ratio:.9,color:new w("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null}normalizeCtorArgs(e){return Q(e)}get blurRadius(){return qe(this.radius)}set blurRadius(e){const i=this.maxPixelIntensity,r=this.minPixelIntensity;this._set("radius",Ce(e)),this._set("maxDensity",i*this._pixelIntensityToDensity),this._set("minDensity",r*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity)}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity)}get _pixelIntensityToDensity(){return 24/(Oe**2*this.blurRadius**4)}read(e,i){e=Q(e),super.read(e,i)}getSymbol(){return new ee}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,i){const r=this.field,o=this.valueExpression;r&&typeof r=="string"&&xe(e,i,r),o&&typeof o=="string"&&await O(e,i,o)}getAttributeHash(){return""}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new J({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:a(this.colorStops),field:this.field,legendOptions:a(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:je,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],p.prototype,"authoringInfo",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"blurRadius",null),t([s({type:[C],json:{write:!0}})],p.prototype,"colorStops",void 0),t([s({type:String,json:{write:!0}})],p.prototype,"field",void 0),t([s({type:N,json:{write:!0}})],p.prototype,"legendOptions",void 0),t([s({type:Number,json:{write:!0}})],p.prototype,"maxDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"maxPixelIntensity",null),t([s({type:Number,json:{write:!0}})],p.prototype,"minDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"minPixelIntensity",null),t([s({type:Number,cast:W,json:{write:!0}})],p.prototype,"radius",void 0),t([s({type:Number,range:{min:0},json:{default:0,write:!0}})],p.prototype,"referenceScale",void 0),t([L({heatmap:"heatmap"})],p.prototype,"type",void 0),t([s({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"valueExpression",void 0),t([s({type:String})],p.prototype,"valueExpressionTitle",void 0),t([s({readOnly:!0})],p.prototype,"_pixelIntensityToDensity",null),p=J=t([_("esri.renderers.HeatmapRenderer")],p);const oe=p;let V=class extends K(T){constructor(){super(...arguments),this.color=new w([0,0,0,0]),this.label=null,this.threshold=0}};t([s({type:w,json:{write:!0}})],V.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],V.prototype,"label",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],V.prototype,"threshold",void 0),V=t([_("esri.renderers.support.OthersCategory")],V);const Be={base:Ee,key:"type",typeMap:{size:Ve,opacity:Re}};let m=class extends A(K(R)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new w([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new V,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart",this.visualVariables=null}getSymbol(){return new ee({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ye)}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],m.prototype,"attributes",void 0),t([s(_e)],m.prototype,"backgroundFillSymbol",void 0),t([s({type:w,json:{write:!0}})],m.prototype,"defaultColor",void 0),t([s({type:String,json:{write:!0}})],m.prototype,"defaultLabel",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],m.prototype,"holePercentage",void 0),t([s({type:V,json:{write:!0}})],m.prototype,"othersCategory",void 0),t([s({type:Le,json:{write:!0}})],m.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],m.prototype,"outline",void 0),t([s({type:Number,cast:W,json:{write:!0}})],m.prototype,"size",void 0),t([L({pieChart:"pie-chart"})],m.prototype,"type",void 0),t([s({types:[Be]})],m.prototype,"visualVariables",void 0),m=t([_("esri.renderers.PieChartRenderer")],m);const Je=m;var U;let E=U=class extends A(R){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,i){await Promise.all([this.collectSymbolFields(e,i),this.collectVVRequiredFields(e,i)])}async collectSymbolFields(e,i){await Promise.all(this.getSymbols().map(r=>r.collectRequiredFields(e,i)))}getSymbol(e,i){return this.symbol}async getSymbolAsync(e,i){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new U({description:this.description,label:this.label,symbol:a(this.symbol),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}};t([s({type:String,json:{write:!0}})],E.prototype,"description",void 0),t([s({type:String,json:{write:!0}})],E.prototype,"label",void 0),t([s(Ie)],E.prototype,"symbol",void 0),t([L({simple:"simple"})],E.prototype,"type",void 0),E=U=t([_("esri.renderers.SimpleRenderer")],E);const ne=E,Ue={key:"type",base:R,typeMap:{heatmap:oe,simple:ne,"unique-value":te,"class-breaks":ie,"dot-density":ze,dictionary:He,"pie-chart":Je},errorContext:"renderer"},xt={key:"type",base:R,typeMap:{simple:ne,"unique-value":te,"class-breaks":ie,heatmap:oe},errorContext:"renderer",validate:Ge};function Ge(e){switch(e.type){case"simple":return Ke(e);case"unique-value":return Xe(e);case"class-breaks":return Ye(e);case"heatmap":return e}}function Ke(e){if(e.symbol)return e;M.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Xe(e){const i=e.uniqueValueInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.uniqueValueInfos=r),e}function Ye(e){const i=e.classBreakInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.classBreakInfos=r),e}function Ze(e,i){return le(e,null,i)}const Qe=ce({types:Ue});function le(e,i,r){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(r?.messages&&r.messages.push(new de("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):Qe(e,i,r):null}const jt=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:Ze,read:le},Symbol.toStringTag,{value:"Module"}));export{jt as j,C as l,Ue as m,le as o,ne as p,Ze as t,xt as u}; diff --git a/main/assets/jsonUtils-wIllKWI4-DQ36DuUP.js b/main/assets/jsonUtils-wIllKWI4-DQ36DuUP.js deleted file mode 100644 index 41ebcad14..000000000 --- a/main/assets/jsonUtils-wIllKWI4-DQ36DuUP.js +++ /dev/null @@ -1 +0,0 @@ -import{el as f,o}from"./main-BZaw9FpY.js";import{c as u,a as i}from"./parser-DyDJ-rlI-mkgQEqcN.js";function $(t,n,e){try{return p(t)}catch(a){e?.messages?.push(a)}return null}function y(t,n,e,a){try{const s=l(t);f(e,s,n)}catch(s){a.messages&&a.messages.push(s)}}function l(t){const n=u(t);return n?i(n)?n.map(e=>e.toJSON()):n.map(({scale:e,effects:a})=>({scale:e,value:a.map(s=>s.toJSON())})):null}function p(t){if(!t||t.length===0)return null;if(m(t)){const n=[];for(const e of t)n.push({scale:e.scale,value:c(e.value)});return n}return c(t)}function m(t){const n=t[0];return!!n&&"scale"in n}function c(t){if(!t?.length)return"";const n=[];for(const e of t){let a=[];switch(e.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":a=[r(e,"amount")];break;case"blur":a=[r(e,"radius","pt")];break;case"hue-rotate":a=[r(e,"angle","deg")];break;case"drop-shadow":a=[r(e,"xoffset","pt"),r(e,"yoffset","pt"),r(e,"blurRadius","pt"),h(e,"color")];break;case"bloom":a=[r(e,"strength"),r(e,"radius","pt"),r(e,"threshold")]}const s=`${e.type}(${a.filter(Boolean).join(" ")})`;u(s),n.push(s)}return n.join(" ")}function r(t,n,e){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});return e?t[n]+e:""+t[n]}function h(t,n){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});const e=t[n];return`rgba(${e[0]||0}, ${e[1]||0}, ${e[2]||0}, ${e[3]/255||0})`}export{$ as l,y as p}; diff --git a/main/assets/jsonUtils-wIllKWI4-DRJhEzZa.js b/main/assets/jsonUtils-wIllKWI4-DRJhEzZa.js new file mode 100644 index 000000000..eb924e42d --- /dev/null +++ b/main/assets/jsonUtils-wIllKWI4-DRJhEzZa.js @@ -0,0 +1 @@ +import{el as f,o}from"./main-C7yV2j71.js";import{c as u,a as i}from"./parser-DyDJ-rlI-CV6nO3M9.js";function $(t,n,e){try{return p(t)}catch(a){e?.messages?.push(a)}return null}function y(t,n,e,a){try{const s=l(t);f(e,s,n)}catch(s){a.messages&&a.messages.push(s)}}function l(t){const n=u(t);return n?i(n)?n.map(e=>e.toJSON()):n.map(({scale:e,effects:a})=>({scale:e,value:a.map(s=>s.toJSON())})):null}function p(t){if(!t||t.length===0)return null;if(m(t)){const n=[];for(const e of t)n.push({scale:e.scale,value:c(e.value)});return n}return c(t)}function m(t){const n=t[0];return!!n&&"scale"in n}function c(t){if(!t?.length)return"";const n=[];for(const e of t){let a=[];switch(e.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":a=[r(e,"amount")];break;case"blur":a=[r(e,"radius","pt")];break;case"hue-rotate":a=[r(e,"angle","deg")];break;case"drop-shadow":a=[r(e,"xoffset","pt"),r(e,"yoffset","pt"),r(e,"blurRadius","pt"),h(e,"color")];break;case"bloom":a=[r(e,"strength"),r(e,"radius","pt"),r(e,"threshold")]}const s=`${e.type}(${a.filter(Boolean).join(" ")})`;u(s),n.push(s)}return n.join(" ")}function r(t,n,e){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});return e?t[n]+e:""+t[n]}function h(t,n){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});const e=t[n];return`rgba(${e[0]||0}, ${e[1]||0}, ${e[2]||0}, ${e[3]/255||0})`}export{$ as l,y as p}; diff --git a/main/assets/jszip.min-C61Pcz7i-CTMO40hW.js b/main/assets/jszip.min-C61Pcz7i-CTMO40hW.js new file mode 100644 index 000000000..3279e012e --- /dev/null +++ b/main/assets/jszip.min-C61Pcz7i-CTMO40hW.js @@ -0,0 +1,2 @@ +import{c0 as Bt,c1 as vt}from"./main-C7yV2j71.js";import{o as yt}from"./_commonjs-dynamic-modules-BpilXLfW-CQY1QSED.js";function Rt(dt,wt){for(var _=0;_U[w]})}}}return Object.freeze(Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"}))}var St={exports:{}},Et;function Ft(){return Et||(Et=1,function(dt,wt){(function(_){dt.exports=_()})(function(){return function _(U,w,h){function o(g,v){if(!w[g]){if(!U[g]){var m=typeof yt=="function"&&yt;if(!v&&m)return m(g,!0);if(n)return n(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var i=w[g]={exports:{}};U[g][0].call(i.exports,function(c){var r=U[g][1][c];return o(r||c)},i,i.exports,_,U,w,h)}return w[g].exports}for(var n=typeof yt=="function"&&yt,u=0;u>2,i=(3&g)<<4|v>>4,c=1>6:64,r=2>4,v=(15&b)<<4|(i=n.indexOf(u.charAt(r++)))>>2,m=(3&i)<<6|(c=n.indexOf(u.charAt(r++))),d[l++]=g,i!==64&&(d[l++]=v),c!==64&&(d[l++]=m);return d}},{"./support":30,"./utils":32}],2:[function(_,U,w){var h=_("./external"),o=_("./stream/DataWorker"),n=_("./stream/Crc32Probe"),u=_("./stream/DataLengthProbe");function g(v,m,b,i,c){this.compressedSize=v,this.uncompressedSize=m,this.crc32=b,this.compression=i,this.compressedContent=c}g.prototype={getContentWorker:function(){var v=new o(h.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),m=this;return v.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new o(h.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(v,m,b){return v.pipe(new n).pipe(new u("uncompressedSize")).pipe(m.compressWorker(b)).pipe(new u("compressedSize")).withStreamInfo("compression",m)},U.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(_,U,w){var h=_("./stream/GenericWorker");w.STORE={magic:"\0\0",compressWorker:function(){return new h("STORE compression")},uncompressWorker:function(){return new h("STORE decompression")}},w.DEFLATE=_("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(_,U,w){var h=_("./utils"),o=function(){for(var n,u=[],g=0;g<256;g++){n=g;for(var v=0;v<8;v++)n=1&n?3988292384^n>>>1:n>>>1;u[g]=n}return u}();U.exports=function(n,u){return n!==void 0&&n.length?h.getTypeOf(n)!=="string"?function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v[r])];return-1^g}(0|u,n,n.length,0):function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v.charCodeAt(r))];return-1^g}(0|u,n,n.length,0):0}},{"./utils":32}],5:[function(_,U,w){w.base64=!1,w.binary=!1,w.dir=!1,w.createFolders=!0,w.date=null,w.compression=null,w.compressionOptions=null,w.comment=null,w.unixPermissions=null,w.dosPermissions=null},{}],6:[function(_,U,w){var h=null;h=typeof Promise<"u"?Promise:_("lie"),U.exports={Promise:h}},{lie:37}],7:[function(_,U,w){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=_("pako"),n=_("./utils"),u=_("./stream/GenericWorker"),g=h?"uint8array":"array";function v(m,b){u.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=b,this.meta={}}w.magic="\b\0",n.inherits(v,u),v.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(n.transformTo(g,m.data),!1)},v.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(b){m.push({data:b,meta:m.meta})}},w.compressWorker=function(m){return new v("Deflate",m)},w.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(_,U,w){function h(i,c){var r,l="";for(r=0;r>>=8;return l}function o(i,c,r,l,a,d){var y,z,x=i.file,D=i.compression,I=d!==g.utf8encode,j=n.transformTo("string",d(x.name)),C=n.transformTo("string",g.utf8encode(x.name)),W=x.comment,q=n.transformTo("string",d(W)),p=n.transformTo("string",g.utf8encode(W)),B=C.length!==x.name.length,e=p.length!==W.length,F="",X="",N="",$=x.dir,L=x.date,H={crc32:0,compressedSize:0,uncompressedSize:0};c&&!r||(H.crc32=i.crc32,H.compressedSize=i.compressedSize,H.uncompressedSize=i.uncompressedSize);var A=0;c&&(A|=8),I||!B&&!e||(A|=2048);var E=0,J=0;$&&(E|=16),a==="UNIX"?(J=798,E|=function(G,nt){var ot=G;return G||(ot=nt?16893:33204),(65535&ot)<<16}(x.unixPermissions,$)):(J=20,E|=function(G){return 63&(G||0)}(x.dosPermissions)),y=L.getUTCHours(),y<<=6,y|=L.getUTCMinutes(),y<<=5,y|=L.getUTCSeconds()/2,z=L.getUTCFullYear()-1980,z<<=4,z|=L.getUTCMonth()+1,z<<=5,z|=L.getUTCDate(),B&&(X=h(1,1)+h(v(j),4)+C,F+="up"+h(X.length,2)+X),e&&(N=h(1,1)+h(v(q),4)+p,F+="uc"+h(N.length,2)+N);var K="";return K+=` +\0`,K+=h(A,2),K+=D.magic,K+=h(y,2),K+=h(z,2),K+=h(H.crc32,4),K+=h(H.compressedSize,4),K+=h(H.uncompressedSize,4),K+=h(j.length,2),K+=h(F.length,2),{fileRecord:m.LOCAL_FILE_HEADER+K+j+F,dirRecord:m.CENTRAL_FILE_HEADER+h(J,2)+K+h(q.length,2)+"\0\0\0\0"+h(E,4)+h(l,4)+j+F+q}}var n=_("../utils"),u=_("../stream/GenericWorker"),g=_("../utf8"),v=_("../crc32"),m=_("../signature");function b(i,c,r,l){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=c,this.zipPlatform=r,this.encodeFileName=l,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(b,u),b.prototype.push=function(i){var c=i.meta.percent||0,r=this.entriesCount,l=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,u.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:r?(c+100*(r-l-1))/r:100}}))},b.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var c=this.streamFiles&&!i.file.dir;if(c){var r=o(i,c,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(i){this.accumulate=!1;var c=this.streamFiles&&!i.file.dir,r=o(i,c,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),c)this.push({data:function(l){return m.DATA_DESCRIPTOR+h(l.crc32,4)+h(l.compressedSize,4)+h(l.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var i=this.bytesWritten,c=0;c=this.index;u--)g=(g<<8)+this.byteAt(u);return this.index+=n,g},readString:function(n){return h.transformTo("string",this.readData(n))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var n=this.readInt(4);return new Date(Date.UTC(1980+(n>>25&127),(n>>21&15)-1,n>>16&31,n>>11&31,n>>5&63,(31&n)<<1))}},U.exports=o},{"../utils":32}],19:[function(_,U,w){var h=_("./Uint8ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(_,U,w){var h=_("./DataReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.byteAt=function(n){return this.data.charCodeAt(this.zero+n)},o.prototype.lastIndexOfSignature=function(n){return this.data.lastIndexOf(n)-this.zero},o.prototype.readAndCheckSignature=function(n){return n===this.readData(4)},o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./DataReader":18}],21:[function(_,U,w){var h=_("./ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){if(this.checkOffset(n),n===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(_,U,w){var h=_("../utils"),o=_("../support"),n=_("./ArrayReader"),u=_("./StringReader"),g=_("./NodeBufferReader"),v=_("./Uint8ArrayReader");U.exports=function(m){var b=h.getTypeOf(m);return h.checkSupport(b),b!=="string"||o.uint8array?b==="nodebuffer"?new g(m):o.uint8array?new v(h.transformTo("uint8array",m)):new n(h.transformTo("array",m)):new u(m)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(_,U,w){w.LOCAL_FILE_HEADER="PK",w.CENTRAL_FILE_HEADER="PK",w.CENTRAL_DIRECTORY_END="PK",w.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",w.ZIP64_CENTRAL_DIRECTORY_END="PK",w.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(_,U,w){var h=_("./GenericWorker"),o=_("../utils");function n(u){h.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(n,h),n.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},U.exports=n},{"../utils":32,"./GenericWorker":28}],25:[function(_,U,w){var h=_("./GenericWorker"),o=_("../crc32");function n(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}_("../utils").inherits(n,h),n.prototype.processChunk=function(u){this.streamInfo.crc32=o(u.data,this.streamInfo.crc32||0),this.push(u)},U.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}h.inherits(n,o),n.prototype.processChunk=function(u){if(u){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+u.data.length}o.prototype.processChunk.call(this,u)},U.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(v){g.dataIsReady=!0,g.data=v,g.max=v&&v.length||0,g.type=h.getTypeOf(v),g.isPaused||g._tickAndRepeat()},function(v){g.error(v)})}h.inherits(n,o),n.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,h.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(h.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,g);break;case"uint8array":u=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":u=this.data.slice(this.index,g)}return this.index=g,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},U.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(_,U,w){function h(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}h.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,n){return this._listeners[o].push(n),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,n){if(this._listeners[o])for(var u=0;u "+o:o}},U.exports=h},{}],29:[function(_,U,w){var h=_("../utils"),o=_("./ConvertWorker"),n=_("./GenericWorker"),u=_("../base64"),g=_("../support"),v=_("../external"),m=null;if(g.nodestream)try{m=_("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(c,r){return new v.Promise(function(l,a){var d=[],y=c._internalType,z=c._outputType,x=c._mimeType;c.on("data",function(D,I){d.push(D),r&&r(I)}).on("error",function(D){d=[],a(D)}).on("end",function(){try{var D=function(I,j,C){switch(I){case"blob":return h.newBlob(h.transformTo("arraybuffer",j),C);case"base64":return u.encode(j);default:return h.transformTo(I,j)}}(z,function(I,j){var C,W=0,q=null,p=0;for(C=0;C"u")w.blob=!1;else{var h=new ArrayBuffer(0);try{w.blob=new Blob([h],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(h),w.blob=o.getBlob("application/zip").size===0}catch{w.blob=!1}}}try{w.nodestream=!!_("readable-stream").Readable}catch{w.nodestream=!1}},{"readable-stream":16}],31:[function(_,U,w){for(var h=_("./utils"),o=_("./support"),n=_("./nodejsUtils"),u=_("./stream/GenericWorker"),g=new Array(256),v=0;v<256;v++)g[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;g[254]=g[254]=1;function m(){u.call(this,"utf-8 decode"),this.leftOver=null}function b(){u.call(this,"utf-8 encode")}w.utf8encode=function(i){return o.nodebuffer?n.newBufferFrom(i,"utf-8"):function(c){var r,l,a,d,y,z=c.length,x=0;for(d=0;d>>6:(l<65536?r[y++]=224|l>>>12:(r[y++]=240|l>>>18,r[y++]=128|l>>>12&63),r[y++]=128|l>>>6&63),r[y++]=128|63&l);return r}(i)},w.utf8decode=function(i){return o.nodebuffer?h.transformTo("nodebuffer",i).toString("utf-8"):function(c){var r,l,a,d,y=c.length,z=new Array(2*y);for(r=l=0;r>10&1023,z[l++]=56320|1023&a)}return z.length!==l&&(z.subarray?z=z.subarray(0,l):z.length=l),h.applyFromCharCode(z)}(i=h.transformTo(o.uint8array?"uint8array":"array",i))},h.inherits(m,u),m.prototype.processChunk=function(i){var c=h.transformTo(o.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var r=c;(c=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),c.set(r,this.leftOver.length)}else c=this.leftOver.concat(c);this.leftOver=null}var l=function(d,y){var z;for((y=y||d.length)>d.length&&(y=d.length),z=y-1;0<=z&&(192&d[z])==128;)z--;return z<0||z===0?y:z+g[d[z]]>y?z:y}(c),a=c;l!==c.length&&(o.uint8array?(a=c.subarray(0,l),this.leftOver=c.subarray(l,c.length)):(a=c.slice(0,l),this.leftOver=c.slice(l,c.length))),this.push({data:w.utf8decode(a),meta:i.meta})},m.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:w.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},w.Utf8DecodeWorker=m,h.inherits(b,u),b.prototype.processChunk=function(i){this.push({data:w.utf8encode(i.data),meta:i.meta})},w.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(_,U,w){var h=_("./support"),o=_("./base64"),n=_("./nodejsUtils"),u=_("./external");function g(r){return r}function v(r,l){for(var a=0;a>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=h(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var c,r,l,a=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4>>6:(i<65536?b[l++]=224|i>>>12:(b[l++]=240|i>>>18,b[l++]=128|i>>>12&63),b[l++]=128|i>>>6&63),b[l++]=128|63&i);return b},w.buf2binstring=function(m){return v(m,m.length)},w.binstring2buf=function(m){for(var b=new h.Buf8(m.length),i=0,c=b.length;i>10&1023,d[c++]=56320|1023&r)}return v(d,c)},w.utf8border=function(m,b){var i;for((b=b||m.length)>m.length&&(b=m.length),i=b-1;0<=i&&(192&m[i])==128;)i--;return i<0||i===0?b:i+u[m[i]]>b?i:b}},{"./common":41}],43:[function(_,U,w){U.exports=function(h,o,n,u){for(var g=65535&h|0,v=h>>>16&65535|0,m=0;n!==0;){for(n-=m=2e3>>1:o>>>1;n[u]=o}return n}();U.exports=function(o,n,u,g){var v=h,m=g+u;o^=-1;for(var b=g;b>>8^v[255&(o^n[b])];return-1^o}},{}],46:[function(_,U,w){var h,o=_("../utils/common"),n=_("./trees"),u=_("./adler32"),g=_("./crc32"),v=_("./messages"),m=0,b=4,i=0,c=-2,r=-1,l=4,a=2,d=8,y=9,z=286,x=30,D=19,I=2*z+1,j=15,C=3,W=258,q=W+C+1,p=42,B=113,e=1,F=2,X=3,N=4;function $(t,R){return t.msg=v[R],R}function L(t){return(t<<1)-(4t.avail_out&&(O=t.avail_out),O!==0&&(o.arraySet(t.output,R.pending_buf,R.pending_out,O,t.next_out),t.next_out+=O,R.pending_out+=O,t.total_out+=O,t.avail_out-=O,R.pending-=O,R.pending===0&&(R.pending_out=0))}function E(t,R){n._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,R),t.block_start=t.strstart,A(t.strm)}function J(t,R){t.pending_buf[t.pending++]=R}function K(t,R){t.pending_buf[t.pending++]=R>>>8&255,t.pending_buf[t.pending++]=255&R}function G(t,R){var O,f,s=t.max_chain_length,k=t.strstart,T=t.prev_length,P=t.nice_match,S=t.strstart>t.w_size-q?t.strstart-(t.w_size-q):0,Z=t.window,Y=t.w_mask,M=t.prev,V=t.strstart+W,rt=Z[k+T-1],tt=Z[k+T];t.prev_length>=t.good_match&&(s>>=2),P>t.lookahead&&(P=t.lookahead);do if(Z[(O=R)+T]===tt&&Z[O+T-1]===rt&&Z[O]===Z[k]&&Z[++O]===Z[k+1]){k+=2,O++;do;while(Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&kS&&--s!=0);return T<=t.lookahead?T:t.lookahead}function nt(t){var R,O,f,s,k,T,P,S,Z,Y,M=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=M+(M-q)){for(o.arraySet(t.window,t.window,M,M,0),t.match_start-=M,t.strstart-=M,t.block_start-=M,R=O=t.hash_size;f=t.head[--R],t.head[R]=M<=f?f-M:0,--O;);for(R=O=M;f=t.prev[--R],t.prev[R]=M<=f?f-M:0,--O;);s+=M}if(t.strm.avail_in===0)break;if(T=t.strm,P=t.window,S=t.strstart+t.lookahead,Z=s,Y=void 0,Y=T.avail_in,Z=C)for(k=t.strstart-t.insert,t.ins_h=t.window[k],t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C)if(f=n._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-C,f=n._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(O=t.pending_buf_size-5);;){if(t.lookahead<=1){if(nt(t),t.lookahead===0&&R===m)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+O;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,E(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-q&&(E(t,!1),t.strm.avail_out===0))return e}return t.insert=0,R===b?(E(t,!0),t.strm.avail_out===0?X:N):(t.strstart>t.block_start&&(E(t,!1),t.strm.avail_out),e)}),new et(4,4,8,4,ot),new et(4,5,16,8,ot),new et(4,6,32,32,ot),new et(4,4,16,16,Q),new et(8,16,32,32,Q),new et(8,16,128,128,Q),new et(8,32,128,256,Q),new et(32,128,258,1024,Q),new et(32,258,258,4096,Q)],w.deflateInit=function(t,R){return ut(t,R,d,15,8,0)},w.deflateInit2=ut,w.deflateReset=lt,w.deflateResetKeep=it,w.deflateSetHeader=function(t,R){return t&&t.state?t.state.wrap!==2?c:(t.state.gzhead=R,i):c},w.deflate=function(t,R){var O,f,s,k;if(!t||!t.state||5>8&255),J(f,f.gzhead.time>>16&255),J(f,f.gzhead.time>>24&255),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(J(f,255&f.gzhead.extra.length),J(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=g(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(J(f,0),J(f,0),J(f,0),J(f,0),J(f,0),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,3),f.status=B);else{var T=d+(f.w_bits-8<<4)<<8;T|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(T|=32),T+=31-T%31,f.status=B,K(f,T),f.strstart!==0&&(K(f,t.adler>>>16),K(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(s=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending!==f.pending_buf_size));)J(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&A(t),f.pending+2<=f.pending_buf_size&&(J(f,255&t.adler),J(f,t.adler>>8&255),t.adler=0,f.status=B)):f.status=B),f.pending!==0){if(A(t),t.avail_out===0)return f.last_flush=-1,i}else if(t.avail_in===0&&L(R)<=L(O)&&R!==b)return $(t,-5);if(f.status===666&&t.avail_in!==0)return $(t,-5);if(t.avail_in!==0||f.lookahead!==0||R!==m&&f.status!==666){var P=f.strategy===2?function(S,Z){for(var Y;;){if(S.lookahead===0&&(nt(S),S.lookahead===0)){if(Z===m)return e;break}if(S.match_length=0,Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++,Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):f.strategy===3?function(S,Z){for(var Y,M,V,rt,tt=S.window;;){if(S.lookahead<=W){if(nt(S),S.lookahead<=W&&Z===m)return e;if(S.lookahead===0)break}if(S.match_length=0,S.lookahead>=C&&0S.lookahead&&(S.match_length=S.lookahead)}if(S.match_length>=C?(Y=n._tr_tally(S,1,S.match_length-C),S.lookahead-=S.match_length,S.strstart+=S.match_length,S.match_length=0):(Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++),Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):h[f.level].func(f,R);if(P!==X&&P!==N||(f.status=666),P===e||P===X)return t.avail_out===0&&(f.last_flush=-1),i;if(P===F&&(R===1?n._tr_align(f):R!==5&&(n._tr_stored_block(f,0,0,!1),R===3&&(H(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),A(t),t.avail_out===0))return f.last_flush=-1,i}return R!==b?i:f.wrap<=0?1:(f.wrap===2?(J(f,255&t.adler),J(f,t.adler>>8&255),J(f,t.adler>>16&255),J(f,t.adler>>24&255),J(f,255&t.total_in),J(f,t.total_in>>8&255),J(f,t.total_in>>16&255),J(f,t.total_in>>24&255)):(K(f,t.adler>>>16),K(f,65535&t.adler)),A(t),0=O.w_size&&(k===0&&(H(O.head),O.strstart=0,O.block_start=0,O.insert=0),Z=new o.Buf8(O.w_size),o.arraySet(Z,R,Y-O.w_size,O.w_size,0),R=Z,Y=O.w_size),T=t.avail_in,P=t.next_in,S=t.input,t.avail_in=Y,t.next_in=0,t.input=R,nt(O);O.lookahead>=C;){for(f=O.strstart,s=O.lookahead-(C-1);O.ins_h=(O.ins_h<>>=C=j>>>24,y-=C,(C=j>>>16&255)===0)F[v++]=65535&j;else{if(!(16&C)){if(!(64&C)){j=z[(65535&j)+(d&(1<>>=C,y-=C),y<15&&(d+=e[u++]<>>=C=j>>>24,y-=C,!(16&(C=j>>>16&255))){if(!(64&C)){j=x[(65535&j)+(d&(1<>>=C,y-=C,(C=v-m)>3,d&=(1<<(y-=W<<3))-1,h.next_in=u,h.next_out=v,h.avail_in=u>>24&255)+(p>>>8&65280)+((65280&p)<<8)+((255&p)<<24)}function d(){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 h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(p){var B;return p&&p.state?(B=p.state,p.total_in=p.total_out=B.total=0,p.msg="",B.wrap&&(p.adler=1&B.wrap),B.mode=c,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new h.Buf32(r),B.distcode=B.distdyn=new h.Buf32(l),B.sane=1,B.back=-1,b):i}function z(p){var B;return p&&p.state?((B=p.state).wsize=0,B.whave=0,B.wnext=0,y(p)):i}function x(p,B){var e,F;return p&&p.state?(F=p.state,B<0?(e=0,B=-B):(e=1+(B>>4),B<48&&(B&=15)),B&&(B<8||15=N.wsize?(h.arraySet(N.window,B,e-N.wsize,N.wsize,0),N.wnext=0,N.whave=N.wsize):(F<(X=N.wsize-N.wnext)&&(X=F),h.arraySet(N.window,B,e-F,X,N.wnext),(F-=X)?(h.arraySet(N.window,B,e-F,F,0),N.wnext=F,N.whave=N.wsize):(N.wnext+=X,N.wnext===N.wsize&&(N.wnext=0),N.whave>>8&255,e.check=n(e.check,k,2,0),E=A=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&A)<<8)+(A>>8))%31){p.msg="incorrect header check",e.mode=30;break}if((15&A)!=8){p.msg="unknown compression method",e.mode=30;break}if(E-=4,t=8+(15&(A>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){p.msg="invalid window size",e.mode=30;break}e.dmax=1<>8&1),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=3;case 3:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>8&255,k[2]=A>>>16&255,k[3]=A>>>24&255,e.check=n(e.check,k,4,0)),E=A=0,e.mode=4;case 4:for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>8),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=5;case 5:if(1024&e.flags){for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>>8&255,e.check=n(e.check,k,2,0)),E=A=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(L<(G=e.length)&&(G=L),G&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),h.arraySet(e.head.extra,F,N,G,t)),512&e.flags&&(e.check=n(e.check,F,G,N)),L-=G,N+=G,e.length-=G),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(L===0)break t;for(G=0;t=F[N+G++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&G>9&1,e.head.done=!0),p.adler=e.check=0,e.mode=12;break;case 10:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>=7&E,E-=7&E,e.mode=27;break}for(;E<3;){if(L===0)break t;L--,A+=F[N++]<>>=1)){case 0:e.mode=14;break;case 1:if(W(e),e.mode=20,B!==6)break;A>>>=2,E-=2;break t;case 2:e.mode=17;break;case 3:p.msg="invalid block type",e.mode=30}A>>>=2,E-=2;break;case 14:for(A>>>=7&E,E-=7&E;E<32;){if(L===0)break t;L--,A+=F[N++]<>>16^65535)){p.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&A,E=A=0,e.mode=15,B===6)break t;case 15:e.mode=16;case 16:if(G=e.length){if(L>>=5,E-=5,e.ndist=1+(31&A),A>>>=5,E-=5,e.ncode=4+(15&A),A>>>=4,E-=4,286>>=3,E-=3}for(;e.have<19;)e.lens[T[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,O={bits:e.lenbits},R=g(0,e.lens,0,19,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=Q,E-=Q,e.lens[e.have++]=st;else{if(st===16){for(f=Q+2;E>>=Q,E-=Q,e.have===0){p.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],G=3+(3&A),A>>>=2,E-=2}else if(st===17){for(f=Q+3;E>>=Q)),A>>>=3,E-=3}else{for(f=Q+7;E>>=Q)),A>>>=7,E-=7}if(e.have+G>e.nlen+e.ndist){p.msg="invalid bit length repeat",e.mode=30;break}for(;G--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){p.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,O={bits:e.lenbits},R=g(v,e.lens,0,e.nlen,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,O={bits:e.distbits},R=g(m,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,O),e.distbits=O.bits,R){p.msg="invalid distances set",e.mode=30;break}if(e.mode=20,B===6)break t;case 20:e.mode=21;case 21:if(6<=L&&258<=H){p.next_out=$,p.avail_out=H,p.next_in=N,p.avail_in=L,e.hold=A,e.bits=E,u(p,K),$=p.next_out,X=p.output,H=p.avail_out,N=p.next_in,F=p.input,L=p.avail_in,A=e.hold,E=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;et=(s=e.lencode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,e.length=st,et===0){e.mode=26;break}if(32&et){e.back=-1,e.mode=12;break}if(64&et){p.msg="invalid literal/length code",e.mode=30;break}e.extra=15&et,e.mode=22;case 22:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;et=(s=e.distcode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,64&et){p.msg="invalid distance code",e.mode=30;break}e.offset=st,e.extra=15&et,e.mode=24;case 24:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){p.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(H===0)break t;if(G=K-H,e.offset>G){if((G=e.offset-G)>e.whave&&e.sane){p.msg="invalid distance too far back",e.mode=30;break}nt=G>e.wnext?(G-=e.wnext,e.wsize-G):e.wnext-G,G>e.length&&(G=e.length),ot=e.window}else ot=X,nt=$-e.offset,G=e.length;for(HI?(C=nt[ot+l[B]],E[J+l[B]]):(C=96,0),d=1<>$)+(y-=d)]=j<<24|C<<16|W|0,y!==0;);for(d=1<>=1;if(d!==0?(A&=d-1,A+=d):A=0,B++,--K[p]==0){if(p===F)break;p=m[b+l[B]]}if(X>>7)]}function J(s,k){s.pending_buf[s.pending++]=255&k,s.pending_buf[s.pending++]=k>>>8&255}function K(s,k,T){s.bi_valid>a-T?(s.bi_buf|=k<>a-s.bi_valid,s.bi_valid+=T-a):(s.bi_buf|=k<>>=1,T<<=1,0<--k;);return T>>>1}function ot(s,k,T){var P,S,Z=new Array(l+1),Y=0;for(P=1;P<=l;P++)Z[P]=Y=Y+T[P-1]<<1;for(S=0;S<=k;S++){var M=s[2*S+1];M!==0&&(s[2*S]=nt(Z[M]++,M))}}function Q(s){var k;for(k=0;k>1;1<=T;T--)it(s,Z,T);for(S=V;T=s.heap[1],s.heap[1]=s.heap[s.heap_len--],it(s,Z,1),P=s.heap[1],s.heap[--s.heap_max]=T,s.heap[--s.heap_max]=P,Z[2*S]=Z[2*T]+Z[2*P],s.depth[S]=(s.depth[T]>=s.depth[P]?s.depth[T]:s.depth[P])+1,Z[2*T+1]=Z[2*P+1]=S,s.heap[1]=S++,it(s,Z,1),2<=s.heap_len;);s.heap[--s.heap_max]=s.heap[1],function(tt,ht){var pt,ft,mt,at,gt,kt,ct=ht.dyn_tree,xt=ht.max_code,Ot=ht.stat_desc.static_tree,Ct=ht.stat_desc.has_stree,It=ht.stat_desc.extra_bits,zt=ht.stat_desc.extra_base,_t=ht.stat_desc.max_length,bt=0;for(at=0;at<=l;at++)tt.bl_count[at]=0;for(ct[2*tt.heap[tt.heap_max]+1]=0,pt=tt.heap_max+1;pt>=7;S>>=1)if(1&rt&&M.dyn_ltree[2*V]!==0)return o;if(M.dyn_ltree[18]!==0||M.dyn_ltree[20]!==0||M.dyn_ltree[26]!==0)return n;for(V=32;V>>3,(Z=s.static_len+3+7>>>3)<=S&&(S=Z)):S=Z=T+5,T+4<=S&&k!==-1?f(s,k,T,P):s.strategy===4||Z===S?(K(s,2+(P?1:0),3),lt(s,q,p)):(K(s,4+(P?1:0),3),function(M,V,rt,tt){var ht;for(K(M,V-257,5),K(M,rt-1,5),K(M,tt-4,4),ht=0;ht>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&k,s.pending_buf[s.l_buf+s.last_lit]=255&T,s.last_lit++,k===0?s.dyn_ltree[2*T]++:(s.matches++,k--,s.dyn_ltree[2*(e[T]+m+1)]++,s.dyn_dtree[2*E(k)]++),s.last_lit===s.lit_bufsize-1},w._tr_align=function(s){K(s,2,3),G(s,y,q),function(k){k.bi_valid===16?(J(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)}(s)}},{"../utils/common":41}],53:[function(_,U,w){U.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(_,U,w){(function(h){(function(o,n){if(!o.setImmediate){var u,g,v,m,b=1,i={},c=!1,r=o.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(o);l=l&&l.setTimeout?l:o,u={}.toString.call(o.process)==="[object process]"?function(z){process.nextTick(function(){d(z)})}:function(){if(o.postMessage&&!o.importScripts){var z=!0,x=o.onmessage;return o.onmessage=function(){z=!1},o.postMessage("","*"),o.onmessage=x,z}}()?(m="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",y,!1):o.attachEvent("onmessage",y),function(z){o.postMessage(m+z,"*")}):o.MessageChannel?((v=new MessageChannel).port1.onmessage=function(z){d(z.data)},function(z){v.port2.postMessage(z)}):r&&"onreadystatechange"in r.createElement("script")?(g=r.documentElement,function(z){var x=r.createElement("script");x.onreadystatechange=function(){d(z),x.onreadystatechange=null,g.removeChild(x),x=null},g.appendChild(x)}):function(z){setTimeout(d,0,z)},l.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var x=new Array(arguments.length-1),D=0;D"u"?h===void 0?this:h:self)}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(St)),St.exports}var At=Ft();const Dt=Bt(At),Pt=Rt({__proto__:null,default:Dt},[At]);export{Pt as j}; diff --git a/main/assets/jszip.min-C61Pcz7i-DlvfXQ6c.js b/main/assets/jszip.min-C61Pcz7i-DlvfXQ6c.js deleted file mode 100644 index a7ce6516b..000000000 --- a/main/assets/jszip.min-C61Pcz7i-DlvfXQ6c.js +++ /dev/null @@ -1,2 +0,0 @@ -import{c0 as Bt,c1 as vt}from"./main-BZaw9FpY.js";import{o as yt}from"./_commonjs-dynamic-modules-BpilXLfW-CQY1QSED.js";function Rt(dt,wt){for(var _=0;_U[w]})}}}return Object.freeze(Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"}))}var St={exports:{}},Et;function Ft(){return Et||(Et=1,function(dt,wt){(function(_){dt.exports=_()})(function(){return function _(U,w,h){function o(g,v){if(!w[g]){if(!U[g]){var m=typeof yt=="function"&&yt;if(!v&&m)return m(g,!0);if(n)return n(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var i=w[g]={exports:{}};U[g][0].call(i.exports,function(c){var r=U[g][1][c];return o(r||c)},i,i.exports,_,U,w,h)}return w[g].exports}for(var n=typeof yt=="function"&&yt,u=0;u>2,i=(3&g)<<4|v>>4,c=1>6:64,r=2>4,v=(15&b)<<4|(i=n.indexOf(u.charAt(r++)))>>2,m=(3&i)<<6|(c=n.indexOf(u.charAt(r++))),d[l++]=g,i!==64&&(d[l++]=v),c!==64&&(d[l++]=m);return d}},{"./support":30,"./utils":32}],2:[function(_,U,w){var h=_("./external"),o=_("./stream/DataWorker"),n=_("./stream/Crc32Probe"),u=_("./stream/DataLengthProbe");function g(v,m,b,i,c){this.compressedSize=v,this.uncompressedSize=m,this.crc32=b,this.compression=i,this.compressedContent=c}g.prototype={getContentWorker:function(){var v=new o(h.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),m=this;return v.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new o(h.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(v,m,b){return v.pipe(new n).pipe(new u("uncompressedSize")).pipe(m.compressWorker(b)).pipe(new u("compressedSize")).withStreamInfo("compression",m)},U.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(_,U,w){var h=_("./stream/GenericWorker");w.STORE={magic:"\0\0",compressWorker:function(){return new h("STORE compression")},uncompressWorker:function(){return new h("STORE decompression")}},w.DEFLATE=_("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(_,U,w){var h=_("./utils"),o=function(){for(var n,u=[],g=0;g<256;g++){n=g;for(var v=0;v<8;v++)n=1&n?3988292384^n>>>1:n>>>1;u[g]=n}return u}();U.exports=function(n,u){return n!==void 0&&n.length?h.getTypeOf(n)!=="string"?function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v[r])];return-1^g}(0|u,n,n.length,0):function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v.charCodeAt(r))];return-1^g}(0|u,n,n.length,0):0}},{"./utils":32}],5:[function(_,U,w){w.base64=!1,w.binary=!1,w.dir=!1,w.createFolders=!0,w.date=null,w.compression=null,w.compressionOptions=null,w.comment=null,w.unixPermissions=null,w.dosPermissions=null},{}],6:[function(_,U,w){var h=null;h=typeof Promise<"u"?Promise:_("lie"),U.exports={Promise:h}},{lie:37}],7:[function(_,U,w){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=_("pako"),n=_("./utils"),u=_("./stream/GenericWorker"),g=h?"uint8array":"array";function v(m,b){u.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=b,this.meta={}}w.magic="\b\0",n.inherits(v,u),v.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(n.transformTo(g,m.data),!1)},v.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(b){m.push({data:b,meta:m.meta})}},w.compressWorker=function(m){return new v("Deflate",m)},w.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(_,U,w){function h(i,c){var r,l="";for(r=0;r>>=8;return l}function o(i,c,r,l,a,d){var y,z,x=i.file,D=i.compression,I=d!==g.utf8encode,j=n.transformTo("string",d(x.name)),C=n.transformTo("string",g.utf8encode(x.name)),W=x.comment,q=n.transformTo("string",d(W)),p=n.transformTo("string",g.utf8encode(W)),B=C.length!==x.name.length,e=p.length!==W.length,F="",X="",N="",$=x.dir,L=x.date,H={crc32:0,compressedSize:0,uncompressedSize:0};c&&!r||(H.crc32=i.crc32,H.compressedSize=i.compressedSize,H.uncompressedSize=i.uncompressedSize);var A=0;c&&(A|=8),I||!B&&!e||(A|=2048);var E=0,J=0;$&&(E|=16),a==="UNIX"?(J=798,E|=function(G,nt){var ot=G;return G||(ot=nt?16893:33204),(65535&ot)<<16}(x.unixPermissions,$)):(J=20,E|=function(G){return 63&(G||0)}(x.dosPermissions)),y=L.getUTCHours(),y<<=6,y|=L.getUTCMinutes(),y<<=5,y|=L.getUTCSeconds()/2,z=L.getUTCFullYear()-1980,z<<=4,z|=L.getUTCMonth()+1,z<<=5,z|=L.getUTCDate(),B&&(X=h(1,1)+h(v(j),4)+C,F+="up"+h(X.length,2)+X),e&&(N=h(1,1)+h(v(q),4)+p,F+="uc"+h(N.length,2)+N);var K="";return K+=` -\0`,K+=h(A,2),K+=D.magic,K+=h(y,2),K+=h(z,2),K+=h(H.crc32,4),K+=h(H.compressedSize,4),K+=h(H.uncompressedSize,4),K+=h(j.length,2),K+=h(F.length,2),{fileRecord:m.LOCAL_FILE_HEADER+K+j+F,dirRecord:m.CENTRAL_FILE_HEADER+h(J,2)+K+h(q.length,2)+"\0\0\0\0"+h(E,4)+h(l,4)+j+F+q}}var n=_("../utils"),u=_("../stream/GenericWorker"),g=_("../utf8"),v=_("../crc32"),m=_("../signature");function b(i,c,r,l){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=c,this.zipPlatform=r,this.encodeFileName=l,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(b,u),b.prototype.push=function(i){var c=i.meta.percent||0,r=this.entriesCount,l=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,u.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:r?(c+100*(r-l-1))/r:100}}))},b.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var c=this.streamFiles&&!i.file.dir;if(c){var r=o(i,c,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(i){this.accumulate=!1;var c=this.streamFiles&&!i.file.dir,r=o(i,c,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),c)this.push({data:function(l){return m.DATA_DESCRIPTOR+h(l.crc32,4)+h(l.compressedSize,4)+h(l.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var i=this.bytesWritten,c=0;c=this.index;u--)g=(g<<8)+this.byteAt(u);return this.index+=n,g},readString:function(n){return h.transformTo("string",this.readData(n))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var n=this.readInt(4);return new Date(Date.UTC(1980+(n>>25&127),(n>>21&15)-1,n>>16&31,n>>11&31,n>>5&63,(31&n)<<1))}},U.exports=o},{"../utils":32}],19:[function(_,U,w){var h=_("./Uint8ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(_,U,w){var h=_("./DataReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.byteAt=function(n){return this.data.charCodeAt(this.zero+n)},o.prototype.lastIndexOfSignature=function(n){return this.data.lastIndexOf(n)-this.zero},o.prototype.readAndCheckSignature=function(n){return n===this.readData(4)},o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./DataReader":18}],21:[function(_,U,w){var h=_("./ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){if(this.checkOffset(n),n===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(_,U,w){var h=_("../utils"),o=_("../support"),n=_("./ArrayReader"),u=_("./StringReader"),g=_("./NodeBufferReader"),v=_("./Uint8ArrayReader");U.exports=function(m){var b=h.getTypeOf(m);return h.checkSupport(b),b!=="string"||o.uint8array?b==="nodebuffer"?new g(m):o.uint8array?new v(h.transformTo("uint8array",m)):new n(h.transformTo("array",m)):new u(m)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(_,U,w){w.LOCAL_FILE_HEADER="PK",w.CENTRAL_FILE_HEADER="PK",w.CENTRAL_DIRECTORY_END="PK",w.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",w.ZIP64_CENTRAL_DIRECTORY_END="PK",w.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(_,U,w){var h=_("./GenericWorker"),o=_("../utils");function n(u){h.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(n,h),n.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},U.exports=n},{"../utils":32,"./GenericWorker":28}],25:[function(_,U,w){var h=_("./GenericWorker"),o=_("../crc32");function n(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}_("../utils").inherits(n,h),n.prototype.processChunk=function(u){this.streamInfo.crc32=o(u.data,this.streamInfo.crc32||0),this.push(u)},U.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}h.inherits(n,o),n.prototype.processChunk=function(u){if(u){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+u.data.length}o.prototype.processChunk.call(this,u)},U.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(v){g.dataIsReady=!0,g.data=v,g.max=v&&v.length||0,g.type=h.getTypeOf(v),g.isPaused||g._tickAndRepeat()},function(v){g.error(v)})}h.inherits(n,o),n.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,h.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(h.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,g);break;case"uint8array":u=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":u=this.data.slice(this.index,g)}return this.index=g,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},U.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(_,U,w){function h(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}h.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,n){return this._listeners[o].push(n),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,n){if(this._listeners[o])for(var u=0;u "+o:o}},U.exports=h},{}],29:[function(_,U,w){var h=_("../utils"),o=_("./ConvertWorker"),n=_("./GenericWorker"),u=_("../base64"),g=_("../support"),v=_("../external"),m=null;if(g.nodestream)try{m=_("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(c,r){return new v.Promise(function(l,a){var d=[],y=c._internalType,z=c._outputType,x=c._mimeType;c.on("data",function(D,I){d.push(D),r&&r(I)}).on("error",function(D){d=[],a(D)}).on("end",function(){try{var D=function(I,j,C){switch(I){case"blob":return h.newBlob(h.transformTo("arraybuffer",j),C);case"base64":return u.encode(j);default:return h.transformTo(I,j)}}(z,function(I,j){var C,W=0,q=null,p=0;for(C=0;C"u")w.blob=!1;else{var h=new ArrayBuffer(0);try{w.blob=new Blob([h],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(h),w.blob=o.getBlob("application/zip").size===0}catch{w.blob=!1}}}try{w.nodestream=!!_("readable-stream").Readable}catch{w.nodestream=!1}},{"readable-stream":16}],31:[function(_,U,w){for(var h=_("./utils"),o=_("./support"),n=_("./nodejsUtils"),u=_("./stream/GenericWorker"),g=new Array(256),v=0;v<256;v++)g[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;g[254]=g[254]=1;function m(){u.call(this,"utf-8 decode"),this.leftOver=null}function b(){u.call(this,"utf-8 encode")}w.utf8encode=function(i){return o.nodebuffer?n.newBufferFrom(i,"utf-8"):function(c){var r,l,a,d,y,z=c.length,x=0;for(d=0;d>>6:(l<65536?r[y++]=224|l>>>12:(r[y++]=240|l>>>18,r[y++]=128|l>>>12&63),r[y++]=128|l>>>6&63),r[y++]=128|63&l);return r}(i)},w.utf8decode=function(i){return o.nodebuffer?h.transformTo("nodebuffer",i).toString("utf-8"):function(c){var r,l,a,d,y=c.length,z=new Array(2*y);for(r=l=0;r>10&1023,z[l++]=56320|1023&a)}return z.length!==l&&(z.subarray?z=z.subarray(0,l):z.length=l),h.applyFromCharCode(z)}(i=h.transformTo(o.uint8array?"uint8array":"array",i))},h.inherits(m,u),m.prototype.processChunk=function(i){var c=h.transformTo(o.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var r=c;(c=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),c.set(r,this.leftOver.length)}else c=this.leftOver.concat(c);this.leftOver=null}var l=function(d,y){var z;for((y=y||d.length)>d.length&&(y=d.length),z=y-1;0<=z&&(192&d[z])==128;)z--;return z<0||z===0?y:z+g[d[z]]>y?z:y}(c),a=c;l!==c.length&&(o.uint8array?(a=c.subarray(0,l),this.leftOver=c.subarray(l,c.length)):(a=c.slice(0,l),this.leftOver=c.slice(l,c.length))),this.push({data:w.utf8decode(a),meta:i.meta})},m.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:w.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},w.Utf8DecodeWorker=m,h.inherits(b,u),b.prototype.processChunk=function(i){this.push({data:w.utf8encode(i.data),meta:i.meta})},w.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(_,U,w){var h=_("./support"),o=_("./base64"),n=_("./nodejsUtils"),u=_("./external");function g(r){return r}function v(r,l){for(var a=0;a>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=h(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var c,r,l,a=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4>>6:(i<65536?b[l++]=224|i>>>12:(b[l++]=240|i>>>18,b[l++]=128|i>>>12&63),b[l++]=128|i>>>6&63),b[l++]=128|63&i);return b},w.buf2binstring=function(m){return v(m,m.length)},w.binstring2buf=function(m){for(var b=new h.Buf8(m.length),i=0,c=b.length;i>10&1023,d[c++]=56320|1023&r)}return v(d,c)},w.utf8border=function(m,b){var i;for((b=b||m.length)>m.length&&(b=m.length),i=b-1;0<=i&&(192&m[i])==128;)i--;return i<0||i===0?b:i+u[m[i]]>b?i:b}},{"./common":41}],43:[function(_,U,w){U.exports=function(h,o,n,u){for(var g=65535&h|0,v=h>>>16&65535|0,m=0;n!==0;){for(n-=m=2e3>>1:o>>>1;n[u]=o}return n}();U.exports=function(o,n,u,g){var v=h,m=g+u;o^=-1;for(var b=g;b>>8^v[255&(o^n[b])];return-1^o}},{}],46:[function(_,U,w){var h,o=_("../utils/common"),n=_("./trees"),u=_("./adler32"),g=_("./crc32"),v=_("./messages"),m=0,b=4,i=0,c=-2,r=-1,l=4,a=2,d=8,y=9,z=286,x=30,D=19,I=2*z+1,j=15,C=3,W=258,q=W+C+1,p=42,B=113,e=1,F=2,X=3,N=4;function $(t,R){return t.msg=v[R],R}function L(t){return(t<<1)-(4t.avail_out&&(O=t.avail_out),O!==0&&(o.arraySet(t.output,R.pending_buf,R.pending_out,O,t.next_out),t.next_out+=O,R.pending_out+=O,t.total_out+=O,t.avail_out-=O,R.pending-=O,R.pending===0&&(R.pending_out=0))}function E(t,R){n._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,R),t.block_start=t.strstart,A(t.strm)}function J(t,R){t.pending_buf[t.pending++]=R}function K(t,R){t.pending_buf[t.pending++]=R>>>8&255,t.pending_buf[t.pending++]=255&R}function G(t,R){var O,f,s=t.max_chain_length,k=t.strstart,T=t.prev_length,P=t.nice_match,S=t.strstart>t.w_size-q?t.strstart-(t.w_size-q):0,Z=t.window,Y=t.w_mask,M=t.prev,V=t.strstart+W,rt=Z[k+T-1],tt=Z[k+T];t.prev_length>=t.good_match&&(s>>=2),P>t.lookahead&&(P=t.lookahead);do if(Z[(O=R)+T]===tt&&Z[O+T-1]===rt&&Z[O]===Z[k]&&Z[++O]===Z[k+1]){k+=2,O++;do;while(Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&kS&&--s!=0);return T<=t.lookahead?T:t.lookahead}function nt(t){var R,O,f,s,k,T,P,S,Z,Y,M=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=M+(M-q)){for(o.arraySet(t.window,t.window,M,M,0),t.match_start-=M,t.strstart-=M,t.block_start-=M,R=O=t.hash_size;f=t.head[--R],t.head[R]=M<=f?f-M:0,--O;);for(R=O=M;f=t.prev[--R],t.prev[R]=M<=f?f-M:0,--O;);s+=M}if(t.strm.avail_in===0)break;if(T=t.strm,P=t.window,S=t.strstart+t.lookahead,Z=s,Y=void 0,Y=T.avail_in,Z=C)for(k=t.strstart-t.insert,t.ins_h=t.window[k],t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C)if(f=n._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-C,f=n._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(O=t.pending_buf_size-5);;){if(t.lookahead<=1){if(nt(t),t.lookahead===0&&R===m)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+O;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,E(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-q&&(E(t,!1),t.strm.avail_out===0))return e}return t.insert=0,R===b?(E(t,!0),t.strm.avail_out===0?X:N):(t.strstart>t.block_start&&(E(t,!1),t.strm.avail_out),e)}),new et(4,4,8,4,ot),new et(4,5,16,8,ot),new et(4,6,32,32,ot),new et(4,4,16,16,Q),new et(8,16,32,32,Q),new et(8,16,128,128,Q),new et(8,32,128,256,Q),new et(32,128,258,1024,Q),new et(32,258,258,4096,Q)],w.deflateInit=function(t,R){return ut(t,R,d,15,8,0)},w.deflateInit2=ut,w.deflateReset=lt,w.deflateResetKeep=it,w.deflateSetHeader=function(t,R){return t&&t.state?t.state.wrap!==2?c:(t.state.gzhead=R,i):c},w.deflate=function(t,R){var O,f,s,k;if(!t||!t.state||5>8&255),J(f,f.gzhead.time>>16&255),J(f,f.gzhead.time>>24&255),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(J(f,255&f.gzhead.extra.length),J(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=g(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(J(f,0),J(f,0),J(f,0),J(f,0),J(f,0),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,3),f.status=B);else{var T=d+(f.w_bits-8<<4)<<8;T|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(T|=32),T+=31-T%31,f.status=B,K(f,T),f.strstart!==0&&(K(f,t.adler>>>16),K(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(s=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending!==f.pending_buf_size));)J(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&A(t),f.pending+2<=f.pending_buf_size&&(J(f,255&t.adler),J(f,t.adler>>8&255),t.adler=0,f.status=B)):f.status=B),f.pending!==0){if(A(t),t.avail_out===0)return f.last_flush=-1,i}else if(t.avail_in===0&&L(R)<=L(O)&&R!==b)return $(t,-5);if(f.status===666&&t.avail_in!==0)return $(t,-5);if(t.avail_in!==0||f.lookahead!==0||R!==m&&f.status!==666){var P=f.strategy===2?function(S,Z){for(var Y;;){if(S.lookahead===0&&(nt(S),S.lookahead===0)){if(Z===m)return e;break}if(S.match_length=0,Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++,Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):f.strategy===3?function(S,Z){for(var Y,M,V,rt,tt=S.window;;){if(S.lookahead<=W){if(nt(S),S.lookahead<=W&&Z===m)return e;if(S.lookahead===0)break}if(S.match_length=0,S.lookahead>=C&&0S.lookahead&&(S.match_length=S.lookahead)}if(S.match_length>=C?(Y=n._tr_tally(S,1,S.match_length-C),S.lookahead-=S.match_length,S.strstart+=S.match_length,S.match_length=0):(Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++),Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):h[f.level].func(f,R);if(P!==X&&P!==N||(f.status=666),P===e||P===X)return t.avail_out===0&&(f.last_flush=-1),i;if(P===F&&(R===1?n._tr_align(f):R!==5&&(n._tr_stored_block(f,0,0,!1),R===3&&(H(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),A(t),t.avail_out===0))return f.last_flush=-1,i}return R!==b?i:f.wrap<=0?1:(f.wrap===2?(J(f,255&t.adler),J(f,t.adler>>8&255),J(f,t.adler>>16&255),J(f,t.adler>>24&255),J(f,255&t.total_in),J(f,t.total_in>>8&255),J(f,t.total_in>>16&255),J(f,t.total_in>>24&255)):(K(f,t.adler>>>16),K(f,65535&t.adler)),A(t),0=O.w_size&&(k===0&&(H(O.head),O.strstart=0,O.block_start=0,O.insert=0),Z=new o.Buf8(O.w_size),o.arraySet(Z,R,Y-O.w_size,O.w_size,0),R=Z,Y=O.w_size),T=t.avail_in,P=t.next_in,S=t.input,t.avail_in=Y,t.next_in=0,t.input=R,nt(O);O.lookahead>=C;){for(f=O.strstart,s=O.lookahead-(C-1);O.ins_h=(O.ins_h<>>=C=j>>>24,y-=C,(C=j>>>16&255)===0)F[v++]=65535&j;else{if(!(16&C)){if(!(64&C)){j=z[(65535&j)+(d&(1<>>=C,y-=C),y<15&&(d+=e[u++]<>>=C=j>>>24,y-=C,!(16&(C=j>>>16&255))){if(!(64&C)){j=x[(65535&j)+(d&(1<>>=C,y-=C,(C=v-m)>3,d&=(1<<(y-=W<<3))-1,h.next_in=u,h.next_out=v,h.avail_in=u>>24&255)+(p>>>8&65280)+((65280&p)<<8)+((255&p)<<24)}function d(){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 h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(p){var B;return p&&p.state?(B=p.state,p.total_in=p.total_out=B.total=0,p.msg="",B.wrap&&(p.adler=1&B.wrap),B.mode=c,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new h.Buf32(r),B.distcode=B.distdyn=new h.Buf32(l),B.sane=1,B.back=-1,b):i}function z(p){var B;return p&&p.state?((B=p.state).wsize=0,B.whave=0,B.wnext=0,y(p)):i}function x(p,B){var e,F;return p&&p.state?(F=p.state,B<0?(e=0,B=-B):(e=1+(B>>4),B<48&&(B&=15)),B&&(B<8||15=N.wsize?(h.arraySet(N.window,B,e-N.wsize,N.wsize,0),N.wnext=0,N.whave=N.wsize):(F<(X=N.wsize-N.wnext)&&(X=F),h.arraySet(N.window,B,e-F,X,N.wnext),(F-=X)?(h.arraySet(N.window,B,e-F,F,0),N.wnext=F,N.whave=N.wsize):(N.wnext+=X,N.wnext===N.wsize&&(N.wnext=0),N.whave>>8&255,e.check=n(e.check,k,2,0),E=A=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&A)<<8)+(A>>8))%31){p.msg="incorrect header check",e.mode=30;break}if((15&A)!=8){p.msg="unknown compression method",e.mode=30;break}if(E-=4,t=8+(15&(A>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){p.msg="invalid window size",e.mode=30;break}e.dmax=1<>8&1),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=3;case 3:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>8&255,k[2]=A>>>16&255,k[3]=A>>>24&255,e.check=n(e.check,k,4,0)),E=A=0,e.mode=4;case 4:for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>8),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=5;case 5:if(1024&e.flags){for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>>8&255,e.check=n(e.check,k,2,0)),E=A=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(L<(G=e.length)&&(G=L),G&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),h.arraySet(e.head.extra,F,N,G,t)),512&e.flags&&(e.check=n(e.check,F,G,N)),L-=G,N+=G,e.length-=G),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(L===0)break t;for(G=0;t=F[N+G++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&G>9&1,e.head.done=!0),p.adler=e.check=0,e.mode=12;break;case 10:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>=7&E,E-=7&E,e.mode=27;break}for(;E<3;){if(L===0)break t;L--,A+=F[N++]<>>=1)){case 0:e.mode=14;break;case 1:if(W(e),e.mode=20,B!==6)break;A>>>=2,E-=2;break t;case 2:e.mode=17;break;case 3:p.msg="invalid block type",e.mode=30}A>>>=2,E-=2;break;case 14:for(A>>>=7&E,E-=7&E;E<32;){if(L===0)break t;L--,A+=F[N++]<>>16^65535)){p.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&A,E=A=0,e.mode=15,B===6)break t;case 15:e.mode=16;case 16:if(G=e.length){if(L>>=5,E-=5,e.ndist=1+(31&A),A>>>=5,E-=5,e.ncode=4+(15&A),A>>>=4,E-=4,286>>=3,E-=3}for(;e.have<19;)e.lens[T[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,O={bits:e.lenbits},R=g(0,e.lens,0,19,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=Q,E-=Q,e.lens[e.have++]=st;else{if(st===16){for(f=Q+2;E>>=Q,E-=Q,e.have===0){p.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],G=3+(3&A),A>>>=2,E-=2}else if(st===17){for(f=Q+3;E>>=Q)),A>>>=3,E-=3}else{for(f=Q+7;E>>=Q)),A>>>=7,E-=7}if(e.have+G>e.nlen+e.ndist){p.msg="invalid bit length repeat",e.mode=30;break}for(;G--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){p.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,O={bits:e.lenbits},R=g(v,e.lens,0,e.nlen,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,O={bits:e.distbits},R=g(m,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,O),e.distbits=O.bits,R){p.msg="invalid distances set",e.mode=30;break}if(e.mode=20,B===6)break t;case 20:e.mode=21;case 21:if(6<=L&&258<=H){p.next_out=$,p.avail_out=H,p.next_in=N,p.avail_in=L,e.hold=A,e.bits=E,u(p,K),$=p.next_out,X=p.output,H=p.avail_out,N=p.next_in,F=p.input,L=p.avail_in,A=e.hold,E=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;et=(s=e.lencode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,e.length=st,et===0){e.mode=26;break}if(32&et){e.back=-1,e.mode=12;break}if(64&et){p.msg="invalid literal/length code",e.mode=30;break}e.extra=15&et,e.mode=22;case 22:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;et=(s=e.distcode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,64&et){p.msg="invalid distance code",e.mode=30;break}e.offset=st,e.extra=15&et,e.mode=24;case 24:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){p.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(H===0)break t;if(G=K-H,e.offset>G){if((G=e.offset-G)>e.whave&&e.sane){p.msg="invalid distance too far back",e.mode=30;break}nt=G>e.wnext?(G-=e.wnext,e.wsize-G):e.wnext-G,G>e.length&&(G=e.length),ot=e.window}else ot=X,nt=$-e.offset,G=e.length;for(HI?(C=nt[ot+l[B]],E[J+l[B]]):(C=96,0),d=1<>$)+(y-=d)]=j<<24|C<<16|W|0,y!==0;);for(d=1<>=1;if(d!==0?(A&=d-1,A+=d):A=0,B++,--K[p]==0){if(p===F)break;p=m[b+l[B]]}if(X>>7)]}function J(s,k){s.pending_buf[s.pending++]=255&k,s.pending_buf[s.pending++]=k>>>8&255}function K(s,k,T){s.bi_valid>a-T?(s.bi_buf|=k<>a-s.bi_valid,s.bi_valid+=T-a):(s.bi_buf|=k<>>=1,T<<=1,0<--k;);return T>>>1}function ot(s,k,T){var P,S,Z=new Array(l+1),Y=0;for(P=1;P<=l;P++)Z[P]=Y=Y+T[P-1]<<1;for(S=0;S<=k;S++){var M=s[2*S+1];M!==0&&(s[2*S]=nt(Z[M]++,M))}}function Q(s){var k;for(k=0;k>1;1<=T;T--)it(s,Z,T);for(S=V;T=s.heap[1],s.heap[1]=s.heap[s.heap_len--],it(s,Z,1),P=s.heap[1],s.heap[--s.heap_max]=T,s.heap[--s.heap_max]=P,Z[2*S]=Z[2*T]+Z[2*P],s.depth[S]=(s.depth[T]>=s.depth[P]?s.depth[T]:s.depth[P])+1,Z[2*T+1]=Z[2*P+1]=S,s.heap[1]=S++,it(s,Z,1),2<=s.heap_len;);s.heap[--s.heap_max]=s.heap[1],function(tt,ht){var pt,ft,mt,at,gt,kt,ct=ht.dyn_tree,xt=ht.max_code,Ot=ht.stat_desc.static_tree,Ct=ht.stat_desc.has_stree,It=ht.stat_desc.extra_bits,zt=ht.stat_desc.extra_base,_t=ht.stat_desc.max_length,bt=0;for(at=0;at<=l;at++)tt.bl_count[at]=0;for(ct[2*tt.heap[tt.heap_max]+1]=0,pt=tt.heap_max+1;pt>=7;S>>=1)if(1&rt&&M.dyn_ltree[2*V]!==0)return o;if(M.dyn_ltree[18]!==0||M.dyn_ltree[20]!==0||M.dyn_ltree[26]!==0)return n;for(V=32;V>>3,(Z=s.static_len+3+7>>>3)<=S&&(S=Z)):S=Z=T+5,T+4<=S&&k!==-1?f(s,k,T,P):s.strategy===4||Z===S?(K(s,2+(P?1:0),3),lt(s,q,p)):(K(s,4+(P?1:0),3),function(M,V,rt,tt){var ht;for(K(M,V-257,5),K(M,rt-1,5),K(M,tt-4,4),ht=0;ht>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&k,s.pending_buf[s.l_buf+s.last_lit]=255&T,s.last_lit++,k===0?s.dyn_ltree[2*T]++:(s.matches++,k--,s.dyn_ltree[2*(e[T]+m+1)]++,s.dyn_dtree[2*E(k)]++),s.last_lit===s.lit_bufsize-1},w._tr_align=function(s){K(s,2,3),G(s,y,q),function(k){k.bi_valid===16?(J(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)}(s)}},{"../utils/common":41}],53:[function(_,U,w){U.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(_,U,w){(function(h){(function(o,n){if(!o.setImmediate){var u,g,v,m,b=1,i={},c=!1,r=o.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(o);l=l&&l.setTimeout?l:o,u={}.toString.call(o.process)==="[object process]"?function(z){process.nextTick(function(){d(z)})}:function(){if(o.postMessage&&!o.importScripts){var z=!0,x=o.onmessage;return o.onmessage=function(){z=!1},o.postMessage("","*"),o.onmessage=x,z}}()?(m="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",y,!1):o.attachEvent("onmessage",y),function(z){o.postMessage(m+z,"*")}):o.MessageChannel?((v=new MessageChannel).port1.onmessage=function(z){d(z.data)},function(z){v.port2.postMessage(z)}):r&&"onreadystatechange"in r.createElement("script")?(g=r.documentElement,function(z){var x=r.createElement("script");x.onreadystatechange=function(){d(z),x.onreadystatechange=null,g.removeChild(x),x=null},g.appendChild(x)}):function(z){setTimeout(d,0,z)},l.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var x=new Array(arguments.length-1),D=0;D"u"?h===void 0?this:h:self)}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(St)),St.exports}var At=Ft();const Dt=Bt(At),Pt=Rt({__proto__:null,default:Dt},[At]);export{Pt as j}; diff --git a/main/assets/kmlUtils-C5oIEoOy-CLmxrxRw.js b/main/assets/kmlUtils-C5oIEoOy-CLmxrxRw.js deleted file mode 100644 index 724ab45aa..000000000 --- a/main/assets/kmlUtils-C5oIEoOy-CLmxrxRw.js +++ /dev/null @@ -1 +0,0 @@ -import{P as m,V as I,y as b,C as w,f as k,gU as G,gX as S,j9 as p,gY as d,ja as x,J as v,bL as E}from"./main-BZaw9FpY.js";import{t as O}from"./jsonUtils-C64Zfu7c-trwRB9M4.js";import{O as M}from"./FeatureSet-BkVNthuN-D0ikVdR5.js";const j={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function T(r){const s=r.folders||[],t=s.slice(),e=new Map,n=new Map,i=new Map,f=new Map,c=new Map,u={esriGeometryPoint:n,esriGeometryPolyline:i,esriGeometryPolygon:f};(r.featureCollection?.layers||[]).forEach(o=>{const y=m(o);y.featureSet.features=[];const a=o.featureSet.geometryType;e.set(a,y);const g=o.layerDefinition.objectIdField;a==="esriGeometryPoint"?h(n,g,o.featureSet.features):a==="esriGeometryPolyline"?h(i,g,o.featureSet.features):a==="esriGeometryPolygon"&&h(f,g,o.featureSet.features)}),r.groundOverlays&&r.groundOverlays.forEach(o=>{c.set(o.id,o)}),s.forEach(o=>{o.networkLinkIds.forEach(y=>{const a=F(y,o.id,r.networkLinks);a&&t.push(a)})}),t.forEach(o=>{if(o.featureInfos){o.points=m(e.get("esriGeometryPoint")),o.polylines=m(e.get("esriGeometryPolyline")),o.polygons=m(e.get("esriGeometryPolygon")),o.mapImages=[];for(const y of o.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const a=u[y.type].get(y.id);a&&o[j[y.type]]?.featureSet.features.push(a);break}case"GroundOverlay":{const a=c.get(y.id);a&&o.mapImages.push(a);break}}o.fullExtent=P([o])}});const l=P(t);return{folders:s,sublayers:t,extent:l}}function q(r,s,t,e){const n=I?.findCredential(r);r=b(r,{token:n?.token});const i=w.kmlServiceUrl;return k(i,{query:{url:r,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(s)},responseType:"json",signal:e})}function U(r,s,t=null,e=[]){const n=[],i={},f=s.sublayers,c=new Set(s.folders.map(u=>u.id));return f.forEach(u=>{const l=new r;if(t?l.read(u,t):l.read(u),e.length&&c.has(l.id)&&(l.visible=e.includes(l.id)),i[u.id]=l,u.parentFolderId!=null&&u.parentFolderId!==-1){const o=i[u.parentFolderId];o.sublayers||(o.sublayers=[]),o.sublayers?.unshift(l)}else n.unshift(l)}),n}function h(r,s,t){t.forEach(e=>{r.set(e.attributes[s],e)})}function C(r,s){let t;return s.some(e=>e.id===r&&(t=e,!0)),t}function F(r,s,t){const e=C(r,t);return e&&(e.parentFolderId=s,e.networkLink=e),e}async function z(r){const s=M.fromJSON(r.featureSet).features,t=r.layerDefinition,e=O(t.drawingInfo.renderer),n=E.fromJSON(r.popupInfo),i=[];for(const f of s){const c=await e.getSymbolAsync(f);f.symbol=c,f.popupTemplate=n,f.visible=!0,i.push(f)}return i}function P(r){const s=G(S),t=G(S);for(const e of r){if(e.polygons?.featureSet?.features)for(const n of e.polygons.featureSet.features)p(s,n.geometry),d(t,s);if(e.polylines?.featureSet?.features)for(const n of e.polylines.featureSet.features)p(s,n.geometry),d(t,s);if(e.points?.featureSet?.features)for(const n of e.points.featureSet.features)p(s,n.geometry),d(t,s);if(e.mapImages)for(const n of e.mapImages)p(s,n.extent),d(t,s)}return x(t,S)?void 0:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:v.WGS84}}export{P as G,z as L,U as N,T,q as j}; diff --git a/main/assets/kmlUtils-C5oIEoOy-CbWoF4Dn.js b/main/assets/kmlUtils-C5oIEoOy-CbWoF4Dn.js new file mode 100644 index 000000000..b908e6d0f --- /dev/null +++ b/main/assets/kmlUtils-C5oIEoOy-CbWoF4Dn.js @@ -0,0 +1 @@ +import{P as m,V as I,y as b,C as w,f as k,gU as G,gX as S,j9 as p,gY as d,ja as x,J as v,bL as E}from"./main-C7yV2j71.js";import{t as O}from"./jsonUtils-C64Zfu7c-BqaK54UK.js";import{O as M}from"./FeatureSet-BkVNthuN-DDwR53LR.js";const j={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function T(r){const s=r.folders||[],t=s.slice(),e=new Map,n=new Map,i=new Map,f=new Map,c=new Map,u={esriGeometryPoint:n,esriGeometryPolyline:i,esriGeometryPolygon:f};(r.featureCollection?.layers||[]).forEach(o=>{const y=m(o);y.featureSet.features=[];const a=o.featureSet.geometryType;e.set(a,y);const g=o.layerDefinition.objectIdField;a==="esriGeometryPoint"?h(n,g,o.featureSet.features):a==="esriGeometryPolyline"?h(i,g,o.featureSet.features):a==="esriGeometryPolygon"&&h(f,g,o.featureSet.features)}),r.groundOverlays&&r.groundOverlays.forEach(o=>{c.set(o.id,o)}),s.forEach(o=>{o.networkLinkIds.forEach(y=>{const a=F(y,o.id,r.networkLinks);a&&t.push(a)})}),t.forEach(o=>{if(o.featureInfos){o.points=m(e.get("esriGeometryPoint")),o.polylines=m(e.get("esriGeometryPolyline")),o.polygons=m(e.get("esriGeometryPolygon")),o.mapImages=[];for(const y of o.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const a=u[y.type].get(y.id);a&&o[j[y.type]]?.featureSet.features.push(a);break}case"GroundOverlay":{const a=c.get(y.id);a&&o.mapImages.push(a);break}}o.fullExtent=P([o])}});const l=P(t);return{folders:s,sublayers:t,extent:l}}function q(r,s,t,e){const n=I?.findCredential(r);r=b(r,{token:n?.token});const i=w.kmlServiceUrl;return k(i,{query:{url:r,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(s)},responseType:"json",signal:e})}function U(r,s,t=null,e=[]){const n=[],i={},f=s.sublayers,c=new Set(s.folders.map(u=>u.id));return f.forEach(u=>{const l=new r;if(t?l.read(u,t):l.read(u),e.length&&c.has(l.id)&&(l.visible=e.includes(l.id)),i[u.id]=l,u.parentFolderId!=null&&u.parentFolderId!==-1){const o=i[u.parentFolderId];o.sublayers||(o.sublayers=[]),o.sublayers?.unshift(l)}else n.unshift(l)}),n}function h(r,s,t){t.forEach(e=>{r.set(e.attributes[s],e)})}function C(r,s){let t;return s.some(e=>e.id===r&&(t=e,!0)),t}function F(r,s,t){const e=C(r,t);return e&&(e.parentFolderId=s,e.networkLink=e),e}async function z(r){const s=M.fromJSON(r.featureSet).features,t=r.layerDefinition,e=O(t.drawingInfo.renderer),n=E.fromJSON(r.popupInfo),i=[];for(const f of s){const c=await e.getSymbolAsync(f);f.symbol=c,f.popupTemplate=n,f.visible=!0,i.push(f)}return i}function P(r){const s=G(S),t=G(S);for(const e of r){if(e.polygons?.featureSet?.features)for(const n of e.polygons.featureSet.features)p(s,n.geometry),d(t,s);if(e.polylines?.featureSet?.features)for(const n of e.polylines.featureSet.features)p(s,n.geometry),d(t,s);if(e.points?.featureSet?.features)for(const n of e.points.featureSet.features)p(s,n.geometry),d(t,s);if(e.mapImages)for(const n of e.mapImages)p(s,n.extent),d(t,s)}return x(t,S)?void 0:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:v.WGS84}}export{P as G,z as L,U as N,T,q as j}; diff --git a/main/assets/knowledgeGraphService-DOJz0fzA-6E_aD1T8.js b/main/assets/knowledgeGraphService-DOJz0fzA-6E_aD1T8.js deleted file mode 100644 index 67a6ead6f..000000000 --- a/main/assets/knowledgeGraphService-DOJz0fzA-6E_aD1T8.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"])))=>i.map(i=>d[i]); -import{v as i,S as l,i as m,J as U,j as q,e as D,f as O,o as d,V as Ze,a1 as V,K as Je,_ as Ee,bw as Ge,d as ye,G as Me,w as Ce,m as he,l as fe}from"./main-BZaw9FpY.js";import{w as Oe,b as je,x as Xe,k as et}from"./Relationship-Db9GUmYx-DPu3VSRE.js";let x=class extends q{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};i([l()],x.prototype,"headerKeys",void 0),i([l()],x.prototype,"outSpatialReference",void 0),i([l()],x.prototype,"exceededTransferLimit",void 0),x=i([m("esri.rest.knowledgeGraph.GraphQueryResultHeader")],x);const X=x;let F=class extends q{constructor(e){super(e),this.resultRows=[],this.resultHeader=new X}};i([l()],F.prototype,"resultRows",void 0),i([l()],F.prototype,"resultHeader",void 0),F=i([m("esri.rest.knowledgeGraph.GraphQueryResult")],F);const Ie=F;let A=class extends q{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new X}};i([l()],A.prototype,"resultRowsStream",void 0),i([l()],A.prototype,"resultHeader",void 0),A=i([m("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],A);const Se=A;let R=class extends D{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};i([l({type:String,json:{write:!0}})],R.prototype,"name",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"unique",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"ascending",void 0),i([l({type:String,json:{write:!0}})],R.prototype,"description",void 0),i([l({type:[String],json:{write:!0}})],R.prototype,"fieldNames",void 0),R=i([m("esri.rest.knowledgeGraph.FieldIndex")],R);const Fe=R;let _=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};i([l({type:String,json:{write:!0}})],_.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"fieldType",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"geometryType",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasM",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasZ",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"required",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"defaultVisibility",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"systemMaintained",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"role",void 0),i([l({json:{write:!0}})],_.prototype,"defaultValue",void 0),_=i([m("esri.rest.knowledgeGraph.GraphProperty")],_);const Ae=_;let S=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null,this.type=null}};i([l({type:String,json:{write:!0}})],S.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"role",void 0),i([l({type:Boolean,json:{write:!0}})],S.prototype,"strict",void 0),i([l({type:[Ae],json:{write:!0}})],S.prototype,"properties",void 0),i([l({type:[Fe],json:{write:!0}})],S.prototype,"fieldIndexes",void 0),S=i([m("esri.rest.knowledgeGraph.GraphObjectType")],S);const Ne=S;let re=class extends Ne{constructor(e){super(e),this.type="entity"}};re=i([m("esri.rest.knowledgeGraph.EntityType")],re);const ne=re;let B=class extends Ne{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};i([l()],B.prototype,"endPoints",void 0),B=i([m("esri.rest.knowledgeGraph.RelationshipType")],B);const Le=B;let N=class extends D{constructor(e){super(e),this.value=null,this.behavior=null}};i([l({type:String,json:{write:!0}})],N.prototype,"value",void 0),i([l({type:String,json:{write:!0}})],N.prototype,"behavior",void 0),N=i([m("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],N);const ze=N;let w=class extends D{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null,this.metaEntityTypes=null,this.provenanceSourceTypeValues=null}};i([l({type:Date,json:{type:Number,write:{writer:(e,r)=>{r.timestamp=e?.getTime()}}}})],w.prototype,"timestamp",void 0),i([l({type:U,json:{write:!0}})],w.prototype,"spatialReference",void 0),i([l({type:Boolean,json:{write:!0}})],w.prototype,"strict",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"objectIdField",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"globalIdField",void 0),i([l()],w.prototype,"arcgisManaged",void 0),i([l()],w.prototype,"identifierInfo",void 0),i([l()],w.prototype,"searchIndexes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"entityTypes",void 0),i([l({type:[Le],json:{write:!0}})],w.prototype,"relationshipTypes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"metaEntityTypes",void 0),i([l({type:[ze],json:{write:!0}})],w.prototype,"provenanceSourceTypeValues",void 0),w=i([m("esri.rest.knowledgeGraph.DataModel")],w);const Ue=w;let f=class extends D{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};i([l({type:[String],json:{write:!0}})],f.prototype,"capabilities",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsSearch",void 0),i([l({type:[String],json:{write:!0}})],f.prototype,"supportedQueryFormats",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"allowGeometryUpdates",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"searchMaxRecordCount",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"serviceCapabilities",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"maxRecordCount",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"description",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"copyrightText",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"units",void 0),i([l({type:U,json:{write:!0}})],f.prototype,"spatialReference",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"currentVersion",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"dateFieldsTimeReference",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"serviceItemId",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsDocuments",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"dataEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"schemaEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsProvenance",void 0),f=i([m("esri.rest.knowledgeGraph.ServiceDefinition")],f);const qe=f;let M=class extends D{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};i([l({type:String,json:{write:!0}})],M.prototype,"url",void 0),i([l({type:Ue,json:{write:!0}})],M.prototype,"dataModel",void 0),i([l({type:qe,json:{write:!0}})],M.prototype,"serviceDefinition",void 0),M=i([m("esri.rest.knowledgeGraph.KnowledgeGraph")],M);const tt=M;function b(e,r,t){if(e.error_code!==0)throw new d(r,t,{errorCode:e.error_code,errorMessage:e.error_message})}function rt(e,r,t,n=!1){const o=new t.ClientDataFetchRequestEncoder;o.deleteLater();for(const s of e){const p=nt(s,r,t,n);o.add_client_data_fetch_request_parameter(p)}o.encode();const a=o.get_encoding_result();return b(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function nt(e,r,t,n){const o=new t.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new t.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const s=r.get(e);return s&&!n&&(a.v_tag={v_tag:s.version}),a}const Re="esri/rest/knowledgeGraph/wasmInterface/";let ee;async function I(){const e=ee;if(e)return e;const r=!!Je("wasm-simd");return ee=ot(r),ee}async function ot(e){if(e){const{default:t}=await Ee(()=>import("./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.a);return t({locateFile:n=>Ge(Re+n)})}const{default:r}=await Ee(()=>import("./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"),__vite__mapDeps([2,1]),import.meta.url).then(t=>t.a);return r({locateFile:t=>Ge(Re+t)})}var k,be,oe;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"})(k||(k={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(be||(be={})),function(e){e[e.exclude=0]="exclude",e[e.include=1]="include"}(oe||(oe={}));function Ye(e,r){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}function He(e,r){const t=new r.ObjectValue;t.deleteLater();for(const[n,o]of Object.entries(e))t.set_key_value(n,_e(o,r));return t}function ge(e,r){if(e instanceof Me)return pt(e,r);if(e instanceof Ce)return dt(e,r);if(e instanceof he||e instanceof fe)return lt(e,r);throw new d("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function it(e,r){r.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function at(e,r,t){if(!e.extent)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);r.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:t.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function st(e,r){r.provenance_behavior={value:oe[e]}}function _e(e,r){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof ye)return ge(e,r);if(Array.isArray(e)){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}return He(e,r)}function lt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof he?(t.geometry_type=r.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof fe&&(t.geometry_type=r.esriGeometryType.esriGeometryPolygon,a=e.rings);let s=0,p=0;return a.forEach(u=>{let c=0;u.forEach(y=>{c++,y.forEach(h=>{n[p]=h,p++})}),o[s]=c,s++}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function pt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=t.geometry_type=r.esriGeometryType.esriGeometryMultipoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(s=>{s.forEach(p=>{n[a]=p,a++})}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function dt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=r.esriGeometryType.esriGeometryPoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function H(e,r){if(!e.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof Oe){const t=new r.EntityValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),t}if(e instanceof je){const t=new r.RelationshipValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),e.originId&&e.destinationId&&t.set_related_entity_ids(e.originId,e.destinationId),t}throw new d("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function ut(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Pe(e,r){return e==null?null:typeof e!="object"||e instanceof Date?e:e instanceof ye?ge(e,r):null}var ie,ke,W,ae;(function(e){e[e.ClientDataKeyTypeUNSPECIFIED=0]="ClientDataKeyTypeUNSPECIFIED",e[e.ClientDataKeyTypeString=1]="ClientDataKeyTypeString"})(ie||(ie={})),function(e){e[e.ClientDataTypeUNSPECIFIED=0]="ClientDataTypeUNSPECIFIED",e[e.ClientDataTypeString=1]="ClientDataTypeString"}(ke||(ke={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.ClientData=1]="ClientData",e[e.NotModified=2]="NotModified"}(W||(W={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Error=1]="Error",e[e.ClientDataValue=2]="ClientDataValue"}(ae||(ae={}));function ct(e,r,t,n=!1){const o=new Map;for(let a=0;a{const c=[];for(let y=0;yV.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),xt={decodedWasmObjToQueryResponseObj:(e,r,t)=>{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case E.ESRI_GEOMETRY_POINT:return Pt(e,t);case E.ESRI_GEOMETRY_MULTIPOINT:return bt(e,t);case E.ESRI_GEOMETRY_POLYLINE:return kt(e,t);case E.ESRI_GEOMETRY_POLYGON:return Dt(e,t);case E.ESRI_GEOMETRY_ENVELOPE:case E.ESRI_GEOMETRY_MULTI_PATCH:return K().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case E.ESRI_GEOMETRY_NULL:case E.ESRI_GEOMETRY_ANY:default:return K().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return K().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case k.OBJECT:return Ct(e,r,t);case k.ENTITY:return Be(e,r,t);case k.RELATIONSHIP:return Ve(e,r,t);case k.PATH:return Ot(e,r,t);case k.ARRAY:return Mt(e,r,t);default:return K().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function Mt(e,r,t){const n=[],o=e.count();for(let a=0;anew Map(z.entries()),T={fetchKnowledgeGraph:async e=>{const r=new tt({url:e}),t=[];return t.push(Y(r)),t.push(We(r)),await Promise.all(t),r},refreshDataModel:async e=>{e.dataModel=await $e(e)},refreshServiceDefinition:async e=>{const r=(await O(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new qe(r),e.serviceDefinition},executeQueryStreaming:async(e,r,t)=>{const n="include",o=`${e.url}/graph/query`;await te(e);const a=await Q(o,t);if(!e.serviceDefinition?.supportsProvenance&&r.provenanceBehavior===n)throw new d("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");a.data.body=await $t(r,e);const s=await L(a.data.url,a.data);if(e.dataModel){const p=await xe(s,e.dataModel);return new Se({resultRowsStream:p.readableStream,resultHeader:p.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,r,t)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new d("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await te(e);const o=await Q(n,t);return o.data.body=await Wt(r,e),Jt(await L(o.data.url,o.data))},executeQuery:async(e,r,t)=>{const n=`${e.url}/graph/query`,o=await O(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:r.openCypherQuery,...t?.query},signal:t?.signal,timeout:t?.timeout}),a=o.getHeader?.("content-type"),s=o.data;if(a?.includes("application/x-protobuf")){const p=new(await I()).GraphQueryDecoder;if(p.deleteLater(),e.dataModel){const u=ce(p,s,e.dataModel);return new Ie({resultRows:u.resultRows,resultHeader:u.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:o.data})},executeSearch:async(e,r,t)=>{const n=r.typeCategoryFilter,o=`${e.url}/graph/search`,a=await O(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${r.searchQuery}"`,typeCategoryFilter:n,...t?.query},signal:t?.signal,timeout:t?.timeout}),s=a.getHeader?.("content-type"),p=a.data;if(s?.includes("application/x-protobuf")){const u=new(await I()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel){const c=ce(u,p,e.dataModel);return new Ie({resultRows:c.resultRows,resultHeader:c.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearchStreaming:async(e,r,t)=>{const n=`${e.url}/graph/search`;await te(e);const o=await Q(n,t);o.data.body=await Zt(r);const a=await L(o.data.url,o.data);if(e.dataModel){const s=await xe(a,e.dataModel);return new Se({resultRowsStream:s.readableStream,resultHeader:s.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,r,t={ignoreCache:!1})=>{if(!r.length)return new Map;let n=z.get(e.url||"");n||(n=new Map,z.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;r=Array.from(new Set(r));const s=await I(),p=rt(r,n,s,t.ignoreCache),u=await Q(a,t.requestOptions);u.data.body=p;const c=await L(u.data.url,u.data),y=c.headers.get("content-type");if(y?.includes("application/x-protobuf")){const h=new s.ClientDataFetchResponseDecoder;h.deleteLater();const G=await c.arrayBuffer();return h.decode(new Uint8Array(G)),h.has_error()&&b(h.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),ct(h,n,o,t.ignoreCache)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:y,data:c})},fetchAllClientDataKeys:async(e,r)=>{const t=`${e.url}/clientData`,n=await O(t,{responseType:"array-buffer",query:{f:"pbf"},signal:r?.signal,timeout:r?.timeout}),o=n.getHeader?.("content-type"),a=n.data;if(o?.includes("application/x-protobuf")){const s=new(await I()).ClientDataKeysResponseDecoder;return s.deleteLater(),s.decode(new Uint8Array(a)),s.has_error()&&b(s.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),yt(s)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>z.clear(),_fetchWrapper:async(e,r)=>fetch(e,r)};async function Lt(e,r,t){return T.executeApplyEdits(e,r,t)}async function zt(e,r,t){return T.executeQuery(e,r,t)}async function Ut(e,r,t){return T.executeQueryStreaming(e,r,t)}async function qt(e,r,t){return T.executeSearch(e,r,t)}async function Yt(e,r,t){return T.executeSearchStreaming(e,r,t)}function Ht(e,r){return T.fetchAllClientDataKeys(e,r)}function Kt(e,r,t){return T.fetchClientDataAtKeys(e,r,t)}async function Qt(e){return T.fetchKnowledgeGraph(e)}async function Y(e){return T.refreshDataModel(e)}async function We(e){return T.refreshServiceDefinition(e)}function Bt(){return T.clearClientDataCache()}async function L(e,r){return T._fetchWrapper(e,r)}async function te(e){Ze?.findCredential(e.url)||(e.dataModel?await $e(e):await Y(e))}function Vt(e,r,t,n){r==null?t.set_param_key_value(e,""):typeof r!="object"||r instanceof Date?t.set_param_key_value(e,r):r instanceof ye?t.set_param_key_value(e,ge(r,n)):Array.isArray(r)?t.set_param_key_value(e,Ye(r,n)):t.set_param_key_value(e,He(r,n))}async function Wt(e,r){if(r.dataModel||await Y(r),!r.dataModel)throw new d("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const t=await I(),n=!!e.options?.cascadeDelete,o=new t.GraphApplyEditsEncoder(t.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?ut(e.options?.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let s;e.entityAdds?.forEach(p=>{s=o.add_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(p=>{if(!p.originId||!p.destinationId)throw new d("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");s=o.add_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!0);u.deleteLater(),p.ids?.forEach(c=>{u.delete_by_id(c)})}),e.relationshipDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!1);p.ids?.forEach(c=>{u.delete_by_id(c)})}),o.encode()}catch(s){throw new d("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const a=o.get_encoding_result();return b(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(a.get_byte_buffer())}async function $t(e,r){const t=await I(),n=new t.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=t.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[a,s]of Object.entries(e.bindParameters))Vt(a,s,n,t);if(e.bindGeometryQuantizationParameters)it(e.bindGeometryQuantizationParameters,n);else{if(r.dataModel||await Y(r),r.dataModel?.spatialReference?.wkid!==4326)throw new d("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=t.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&at(e.outputQuantizationParameters,n,t),e.provenanceBehavior&&st(e.provenanceBehavior,n);try{n.encode()}catch(a){throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:a})}const o=n.get_encoding_result();if(o.error.error_code!==0)throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Zt(e){const r=await I(),t=new r.GraphSearchRequestEncoder;if(t.deleteLater(),t.search_query=e.searchQuery,t.type_category_filter=r.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(t.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(t.start_index=e.start),e.num!=null&&(t.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{t.set_ids_filter(Ye(e.idsFilter,r))}catch(o){throw new d("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:o})}e.namedTypesFilter?.forEach(o=>{t.add_named_type_filter(o)});try{t.encode()}catch(o){throw new d("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:o})}const n=t.get_encoding_result();if(n.error.error_code!==0)throw new d("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function Q(e,r){return O(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function Jt(e){const r=e.headers.get("content-type");if(r?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new(await I()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(t)),At(n)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}function ce(e,r,t,n){e.push_buffer(new Uint8Array(r));const o=[];let a,s,p=0;for(;e.next_row();){a&&s||(a=n??jt(e),s=a.outSpatialReference??new U({wkid:4326})),p||(p=e.get_header_keys().size());const u=new Array(p);for(let c=0;c{s=y,p=h});let c=!1;return{readableStream:new ReadableStream({async start(y){try{return h()}catch(G){n?.releaseLock(),y.error(new d("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:G})),y.close()}function h(){return n?.read().then(({done:G,value:v})=>{try{if(G){let j;if(o.has_error()?j=new d("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:o.error.error_code,errorMessage:o.error.error_message}):c||s(new X),n.releaseLock(),j)throw y.error(j),p(j),j;return void y.close()}const g=ce(o,v,r,a),Te=g.resultRows;return Te.length>0&&y.enqueue(Te),!a&&g.resultHeader&&(a=g.resultHeader,s(g.resultHeader),c=!0),h()}catch(g){throw V.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(g),p(g),new d("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:g})}})}}}),resultHeader:await u}}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}async function $e(e){const r=`${e.url}/dataModel/queryDataModel`,t=await O(r,{responseType:"array-buffer",query:{f:"pbf"}}),n=t.getHeader?.("content-type"),o=t.data;if(n?.includes("application/x-protobuf")){const a=(await I()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!a)throw new d("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return ft(a)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:t.data})}const tr=Object.freeze(Object.defineProperty({__proto__:null,_fetchWrapper:L,_getClientDataCacheCopy:Nt,clearClientDataCache:Bt,clientDataCache:z,executeApplyEdits:Lt,executeQuery:zt,executeQueryStreaming:Ut,executeSearch:qt,executeSearchStreaming:Yt,fetchAllClientDataKeys:Ht,fetchClientDataAtKeys:Kt,fetchKnowledgeGraph:Qt,kgRestServices:T,refreshDataModel:Y,refreshServiceDefinition:We},Symbol.toStringTag,{value:"Module"}));export{Qt as F,Ut as M,Kt as W,tr as k,I as r}; diff --git a/main/assets/knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js b/main/assets/knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js new file mode 100644 index 000000000..641f4a8c3 --- /dev/null +++ b/main/assets/knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"])))=>i.map(i=>d[i]); +import{v as i,S as l,i as m,J as U,j as q,e as D,f as O,o as d,V as Ze,a1 as V,K as Je,_ as Ee,bw as Ge,d as ye,G as Me,w as Ce,m as he,l as fe}from"./main-C7yV2j71.js";import{w as Oe,b as je,x as Xe,k as et}from"./Relationship-Db9GUmYx-DnaxtAbX.js";let x=class extends q{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};i([l()],x.prototype,"headerKeys",void 0),i([l()],x.prototype,"outSpatialReference",void 0),i([l()],x.prototype,"exceededTransferLimit",void 0),x=i([m("esri.rest.knowledgeGraph.GraphQueryResultHeader")],x);const X=x;let F=class extends q{constructor(e){super(e),this.resultRows=[],this.resultHeader=new X}};i([l()],F.prototype,"resultRows",void 0),i([l()],F.prototype,"resultHeader",void 0),F=i([m("esri.rest.knowledgeGraph.GraphQueryResult")],F);const Ie=F;let A=class extends q{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new X}};i([l()],A.prototype,"resultRowsStream",void 0),i([l()],A.prototype,"resultHeader",void 0),A=i([m("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],A);const Se=A;let R=class extends D{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};i([l({type:String,json:{write:!0}})],R.prototype,"name",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"unique",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"ascending",void 0),i([l({type:String,json:{write:!0}})],R.prototype,"description",void 0),i([l({type:[String],json:{write:!0}})],R.prototype,"fieldNames",void 0),R=i([m("esri.rest.knowledgeGraph.FieldIndex")],R);const Fe=R;let _=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};i([l({type:String,json:{write:!0}})],_.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"fieldType",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"geometryType",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasM",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasZ",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"required",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"defaultVisibility",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"systemMaintained",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"role",void 0),i([l({json:{write:!0}})],_.prototype,"defaultValue",void 0),_=i([m("esri.rest.knowledgeGraph.GraphProperty")],_);const Ae=_;let S=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null,this.type=null}};i([l({type:String,json:{write:!0}})],S.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"role",void 0),i([l({type:Boolean,json:{write:!0}})],S.prototype,"strict",void 0),i([l({type:[Ae],json:{write:!0}})],S.prototype,"properties",void 0),i([l({type:[Fe],json:{write:!0}})],S.prototype,"fieldIndexes",void 0),S=i([m("esri.rest.knowledgeGraph.GraphObjectType")],S);const Ne=S;let re=class extends Ne{constructor(e){super(e),this.type="entity"}};re=i([m("esri.rest.knowledgeGraph.EntityType")],re);const ne=re;let B=class extends Ne{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};i([l()],B.prototype,"endPoints",void 0),B=i([m("esri.rest.knowledgeGraph.RelationshipType")],B);const Le=B;let N=class extends D{constructor(e){super(e),this.value=null,this.behavior=null}};i([l({type:String,json:{write:!0}})],N.prototype,"value",void 0),i([l({type:String,json:{write:!0}})],N.prototype,"behavior",void 0),N=i([m("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],N);const ze=N;let w=class extends D{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null,this.metaEntityTypes=null,this.provenanceSourceTypeValues=null}};i([l({type:Date,json:{type:Number,write:{writer:(e,r)=>{r.timestamp=e?.getTime()}}}})],w.prototype,"timestamp",void 0),i([l({type:U,json:{write:!0}})],w.prototype,"spatialReference",void 0),i([l({type:Boolean,json:{write:!0}})],w.prototype,"strict",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"objectIdField",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"globalIdField",void 0),i([l()],w.prototype,"arcgisManaged",void 0),i([l()],w.prototype,"identifierInfo",void 0),i([l()],w.prototype,"searchIndexes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"entityTypes",void 0),i([l({type:[Le],json:{write:!0}})],w.prototype,"relationshipTypes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"metaEntityTypes",void 0),i([l({type:[ze],json:{write:!0}})],w.prototype,"provenanceSourceTypeValues",void 0),w=i([m("esri.rest.knowledgeGraph.DataModel")],w);const Ue=w;let f=class extends D{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};i([l({type:[String],json:{write:!0}})],f.prototype,"capabilities",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsSearch",void 0),i([l({type:[String],json:{write:!0}})],f.prototype,"supportedQueryFormats",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"allowGeometryUpdates",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"searchMaxRecordCount",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"serviceCapabilities",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"maxRecordCount",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"description",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"copyrightText",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"units",void 0),i([l({type:U,json:{write:!0}})],f.prototype,"spatialReference",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"currentVersion",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"dateFieldsTimeReference",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"serviceItemId",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsDocuments",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"dataEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"schemaEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsProvenance",void 0),f=i([m("esri.rest.knowledgeGraph.ServiceDefinition")],f);const qe=f;let M=class extends D{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};i([l({type:String,json:{write:!0}})],M.prototype,"url",void 0),i([l({type:Ue,json:{write:!0}})],M.prototype,"dataModel",void 0),i([l({type:qe,json:{write:!0}})],M.prototype,"serviceDefinition",void 0),M=i([m("esri.rest.knowledgeGraph.KnowledgeGraph")],M);const tt=M;function b(e,r,t){if(e.error_code!==0)throw new d(r,t,{errorCode:e.error_code,errorMessage:e.error_message})}function rt(e,r,t,n=!1){const o=new t.ClientDataFetchRequestEncoder;o.deleteLater();for(const s of e){const p=nt(s,r,t,n);o.add_client_data_fetch_request_parameter(p)}o.encode();const a=o.get_encoding_result();return b(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function nt(e,r,t,n){const o=new t.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new t.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const s=r.get(e);return s&&!n&&(a.v_tag={v_tag:s.version}),a}const Re="esri/rest/knowledgeGraph/wasmInterface/";let ee;async function I(){const e=ee;if(e)return e;const r=!!Je("wasm-simd");return ee=ot(r),ee}async function ot(e){if(e){const{default:t}=await Ee(()=>import("./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.a);return t({locateFile:n=>Ge(Re+n)})}const{default:r}=await Ee(()=>import("./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"),__vite__mapDeps([2,1]),import.meta.url).then(t=>t.a);return r({locateFile:t=>Ge(Re+t)})}var k,be,oe;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"})(k||(k={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(be||(be={})),function(e){e[e.exclude=0]="exclude",e[e.include=1]="include"}(oe||(oe={}));function Ye(e,r){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}function He(e,r){const t=new r.ObjectValue;t.deleteLater();for(const[n,o]of Object.entries(e))t.set_key_value(n,_e(o,r));return t}function ge(e,r){if(e instanceof Me)return pt(e,r);if(e instanceof Ce)return dt(e,r);if(e instanceof he||e instanceof fe)return lt(e,r);throw new d("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function it(e,r){r.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function at(e,r,t){if(!e.extent)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);r.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:t.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function st(e,r){r.provenance_behavior={value:oe[e]}}function _e(e,r){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof ye)return ge(e,r);if(Array.isArray(e)){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}return He(e,r)}function lt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof he?(t.geometry_type=r.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof fe&&(t.geometry_type=r.esriGeometryType.esriGeometryPolygon,a=e.rings);let s=0,p=0;return a.forEach(u=>{let c=0;u.forEach(y=>{c++,y.forEach(h=>{n[p]=h,p++})}),o[s]=c,s++}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function pt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=t.geometry_type=r.esriGeometryType.esriGeometryMultipoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(s=>{s.forEach(p=>{n[a]=p,a++})}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function dt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=r.esriGeometryType.esriGeometryPoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function H(e,r){if(!e.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof Oe){const t=new r.EntityValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),t}if(e instanceof je){const t=new r.RelationshipValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),e.originId&&e.destinationId&&t.set_related_entity_ids(e.originId,e.destinationId),t}throw new d("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function ut(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Pe(e,r){return e==null?null:typeof e!="object"||e instanceof Date?e:e instanceof ye?ge(e,r):null}var ie,ke,W,ae;(function(e){e[e.ClientDataKeyTypeUNSPECIFIED=0]="ClientDataKeyTypeUNSPECIFIED",e[e.ClientDataKeyTypeString=1]="ClientDataKeyTypeString"})(ie||(ie={})),function(e){e[e.ClientDataTypeUNSPECIFIED=0]="ClientDataTypeUNSPECIFIED",e[e.ClientDataTypeString=1]="ClientDataTypeString"}(ke||(ke={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.ClientData=1]="ClientData",e[e.NotModified=2]="NotModified"}(W||(W={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Error=1]="Error",e[e.ClientDataValue=2]="ClientDataValue"}(ae||(ae={}));function ct(e,r,t,n=!1){const o=new Map;for(let a=0;a{const c=[];for(let y=0;yV.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),xt={decodedWasmObjToQueryResponseObj:(e,r,t)=>{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case E.ESRI_GEOMETRY_POINT:return Pt(e,t);case E.ESRI_GEOMETRY_MULTIPOINT:return bt(e,t);case E.ESRI_GEOMETRY_POLYLINE:return kt(e,t);case E.ESRI_GEOMETRY_POLYGON:return Dt(e,t);case E.ESRI_GEOMETRY_ENVELOPE:case E.ESRI_GEOMETRY_MULTI_PATCH:return K().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case E.ESRI_GEOMETRY_NULL:case E.ESRI_GEOMETRY_ANY:default:return K().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return K().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case k.OBJECT:return Ct(e,r,t);case k.ENTITY:return Be(e,r,t);case k.RELATIONSHIP:return Ve(e,r,t);case k.PATH:return Ot(e,r,t);case k.ARRAY:return Mt(e,r,t);default:return K().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function Mt(e,r,t){const n=[],o=e.count();for(let a=0;anew Map(z.entries()),T={fetchKnowledgeGraph:async e=>{const r=new tt({url:e}),t=[];return t.push(Y(r)),t.push(We(r)),await Promise.all(t),r},refreshDataModel:async e=>{e.dataModel=await $e(e)},refreshServiceDefinition:async e=>{const r=(await O(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new qe(r),e.serviceDefinition},executeQueryStreaming:async(e,r,t)=>{const n="include",o=`${e.url}/graph/query`;await te(e);const a=await Q(o,t);if(!e.serviceDefinition?.supportsProvenance&&r.provenanceBehavior===n)throw new d("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");a.data.body=await $t(r,e);const s=await L(a.data.url,a.data);if(e.dataModel){const p=await xe(s,e.dataModel);return new Se({resultRowsStream:p.readableStream,resultHeader:p.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,r,t)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new d("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await te(e);const o=await Q(n,t);return o.data.body=await Wt(r,e),Jt(await L(o.data.url,o.data))},executeQuery:async(e,r,t)=>{const n=`${e.url}/graph/query`,o=await O(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:r.openCypherQuery,...t?.query},signal:t?.signal,timeout:t?.timeout}),a=o.getHeader?.("content-type"),s=o.data;if(a?.includes("application/x-protobuf")){const p=new(await I()).GraphQueryDecoder;if(p.deleteLater(),e.dataModel){const u=ce(p,s,e.dataModel);return new Ie({resultRows:u.resultRows,resultHeader:u.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:o.data})},executeSearch:async(e,r,t)=>{const n=r.typeCategoryFilter,o=`${e.url}/graph/search`,a=await O(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${r.searchQuery}"`,typeCategoryFilter:n,...t?.query},signal:t?.signal,timeout:t?.timeout}),s=a.getHeader?.("content-type"),p=a.data;if(s?.includes("application/x-protobuf")){const u=new(await I()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel){const c=ce(u,p,e.dataModel);return new Ie({resultRows:c.resultRows,resultHeader:c.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearchStreaming:async(e,r,t)=>{const n=`${e.url}/graph/search`;await te(e);const o=await Q(n,t);o.data.body=await Zt(r);const a=await L(o.data.url,o.data);if(e.dataModel){const s=await xe(a,e.dataModel);return new Se({resultRowsStream:s.readableStream,resultHeader:s.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,r,t={ignoreCache:!1})=>{if(!r.length)return new Map;let n=z.get(e.url||"");n||(n=new Map,z.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;r=Array.from(new Set(r));const s=await I(),p=rt(r,n,s,t.ignoreCache),u=await Q(a,t.requestOptions);u.data.body=p;const c=await L(u.data.url,u.data),y=c.headers.get("content-type");if(y?.includes("application/x-protobuf")){const h=new s.ClientDataFetchResponseDecoder;h.deleteLater();const G=await c.arrayBuffer();return h.decode(new Uint8Array(G)),h.has_error()&&b(h.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),ct(h,n,o,t.ignoreCache)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:y,data:c})},fetchAllClientDataKeys:async(e,r)=>{const t=`${e.url}/clientData`,n=await O(t,{responseType:"array-buffer",query:{f:"pbf"},signal:r?.signal,timeout:r?.timeout}),o=n.getHeader?.("content-type"),a=n.data;if(o?.includes("application/x-protobuf")){const s=new(await I()).ClientDataKeysResponseDecoder;return s.deleteLater(),s.decode(new Uint8Array(a)),s.has_error()&&b(s.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),yt(s)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>z.clear(),_fetchWrapper:async(e,r)=>fetch(e,r)};async function Lt(e,r,t){return T.executeApplyEdits(e,r,t)}async function zt(e,r,t){return T.executeQuery(e,r,t)}async function Ut(e,r,t){return T.executeQueryStreaming(e,r,t)}async function qt(e,r,t){return T.executeSearch(e,r,t)}async function Yt(e,r,t){return T.executeSearchStreaming(e,r,t)}function Ht(e,r){return T.fetchAllClientDataKeys(e,r)}function Kt(e,r,t){return T.fetchClientDataAtKeys(e,r,t)}async function Qt(e){return T.fetchKnowledgeGraph(e)}async function Y(e){return T.refreshDataModel(e)}async function We(e){return T.refreshServiceDefinition(e)}function Bt(){return T.clearClientDataCache()}async function L(e,r){return T._fetchWrapper(e,r)}async function te(e){Ze?.findCredential(e.url)||(e.dataModel?await $e(e):await Y(e))}function Vt(e,r,t,n){r==null?t.set_param_key_value(e,""):typeof r!="object"||r instanceof Date?t.set_param_key_value(e,r):r instanceof ye?t.set_param_key_value(e,ge(r,n)):Array.isArray(r)?t.set_param_key_value(e,Ye(r,n)):t.set_param_key_value(e,He(r,n))}async function Wt(e,r){if(r.dataModel||await Y(r),!r.dataModel)throw new d("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const t=await I(),n=!!e.options?.cascadeDelete,o=new t.GraphApplyEditsEncoder(t.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?ut(e.options?.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let s;e.entityAdds?.forEach(p=>{s=o.add_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(p=>{if(!p.originId||!p.destinationId)throw new d("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");s=o.add_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!0);u.deleteLater(),p.ids?.forEach(c=>{u.delete_by_id(c)})}),e.relationshipDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!1);p.ids?.forEach(c=>{u.delete_by_id(c)})}),o.encode()}catch(s){throw new d("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const a=o.get_encoding_result();return b(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(a.get_byte_buffer())}async function $t(e,r){const t=await I(),n=new t.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=t.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[a,s]of Object.entries(e.bindParameters))Vt(a,s,n,t);if(e.bindGeometryQuantizationParameters)it(e.bindGeometryQuantizationParameters,n);else{if(r.dataModel||await Y(r),r.dataModel?.spatialReference?.wkid!==4326)throw new d("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=t.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&at(e.outputQuantizationParameters,n,t),e.provenanceBehavior&&st(e.provenanceBehavior,n);try{n.encode()}catch(a){throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:a})}const o=n.get_encoding_result();if(o.error.error_code!==0)throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Zt(e){const r=await I(),t=new r.GraphSearchRequestEncoder;if(t.deleteLater(),t.search_query=e.searchQuery,t.type_category_filter=r.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(t.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(t.start_index=e.start),e.num!=null&&(t.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{t.set_ids_filter(Ye(e.idsFilter,r))}catch(o){throw new d("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:o})}e.namedTypesFilter?.forEach(o=>{t.add_named_type_filter(o)});try{t.encode()}catch(o){throw new d("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:o})}const n=t.get_encoding_result();if(n.error.error_code!==0)throw new d("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function Q(e,r){return O(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function Jt(e){const r=e.headers.get("content-type");if(r?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new(await I()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(t)),At(n)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}function ce(e,r,t,n){e.push_buffer(new Uint8Array(r));const o=[];let a,s,p=0;for(;e.next_row();){a&&s||(a=n??jt(e),s=a.outSpatialReference??new U({wkid:4326})),p||(p=e.get_header_keys().size());const u=new Array(p);for(let c=0;c{s=y,p=h});let c=!1;return{readableStream:new ReadableStream({async start(y){try{return h()}catch(G){n?.releaseLock(),y.error(new d("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:G})),y.close()}function h(){return n?.read().then(({done:G,value:v})=>{try{if(G){let j;if(o.has_error()?j=new d("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:o.error.error_code,errorMessage:o.error.error_message}):c||s(new X),n.releaseLock(),j)throw y.error(j),p(j),j;return void y.close()}const g=ce(o,v,r,a),Te=g.resultRows;return Te.length>0&&y.enqueue(Te),!a&&g.resultHeader&&(a=g.resultHeader,s(g.resultHeader),c=!0),h()}catch(g){throw V.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(g),p(g),new d("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:g})}})}}}),resultHeader:await u}}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}async function $e(e){const r=`${e.url}/dataModel/queryDataModel`,t=await O(r,{responseType:"array-buffer",query:{f:"pbf"}}),n=t.getHeader?.("content-type"),o=t.data;if(n?.includes("application/x-protobuf")){const a=(await I()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!a)throw new d("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return ft(a)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:t.data})}const tr=Object.freeze(Object.defineProperty({__proto__:null,_fetchWrapper:L,_getClientDataCacheCopy:Nt,clearClientDataCache:Bt,clientDataCache:z,executeApplyEdits:Lt,executeQuery:zt,executeQueryStreaming:Ut,executeSearch:qt,executeSearchStreaming:Yt,fetchAllClientDataKeys:Ht,fetchClientDataAtKeys:Kt,fetchKnowledgeGraph:Qt,kgRestServices:T,refreshDataModel:Y,refreshServiceDefinition:We},Symbol.toStringTag,{value:"Module"}));export{Qt as F,Ut as M,Kt as W,tr as k,I as r}; diff --git a/main/assets/knowledgegraph-Dt7zfNlJ-BkLDKrPN.js b/main/assets/knowledgegraph-Dt7zfNlJ-BkLDKrPN.js new file mode 100644 index 000000000..ab54dbdbe --- /dev/null +++ b/main/assets/knowledgegraph-Dt7zfNlJ-BkLDKrPN.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js","./main-C7yV2j71.js","./main-DDePfy-e.css","./Relationship-Db9GUmYx-DnaxtAbX.js"])))=>i.map(i=>d[i]); +import{r as _,_ as D,C as E,J as $,d as k,dK as N,b7 as j}from"./main-C7yV2j71.js";import{t as q,N as I}from"./arcadeUtils-DpP0k7IY-BXKRfMc2.js";import{w as P,T as c,n as l,M as T,y as w,F as J,g as K,C as S,e as M,S as C,d as b,c as O,h as V,a as L,R as A,ak as Q}from"./languageUtils-BYxF9hRA-BLoYMqdU.js";import{n as U}from"./portalUtils-CKN9iXwH-D_ZWpoBZ.js";import{_ as z,W as B,K as H}from"./projection-BA9M1R7d-DXrPfsKU.js";import X from"./PortalItem-CctGdnxF-CHPkp6yW.js";import{f as Y,j as Z}from"./project-DQKhruav-BEFloNIO.js";import{j as tt,w as nt,x as rt,b as et,k as it}from"./Relationship-Db9GUmYx-DnaxtAbX.js";import"./TimeOnly-DSMefxKy-C21ZkqlE.js";import"./UnknownTimeZone-C--TOcPG-DfRfNtw8.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-sYSorBK9.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CzzKuIHi.js";import"./number-eRKYXfX9-C213qXfW.js";import"./shared-D1w-26bA-CNuAEz8h.js";import"./Field-C6hA1tZj-C0Sp7XvY.js";import"./fieldType-CD2CL2hr-B1iISniv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DV_czrJX.js";import"./TimeExtent-Cn0Jofqr-5JsvQYX6.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./utils-9sQxfkoa-Bn_d9vXA.js";import"./utils-Bq23Xwmj-Bx2NKKg4.js";let u=null;async function ot(t){const n=E.geometryServiceUrl??"";if(!n){z()||await B();for(const r of t)r.container[r.indexer]=H(r.container[r.indexer],$.WGS84);return}const e=t.map(r=>r.container[r.indexer]),o=new Y({geometries:e,outSpatialReference:$.WGS84}),s=await Z(n,o);for(let r=0;rimport("./knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(o=>o.k)),await u.fetchKnowledgeGraph(e.url)}function R(t,n,e,o,s){if(t===null)return null;if(w(t)||C(t))return t;if(b(t)||b(t))return t.toJSDate();if(O(t))return t.toStorageFormat();if(V(t))return t.toStorageString();if(L(t)){const r={};for(const i of t.keys())r[i]=R(t.field(i),n,e,o,s),r[i]instanceof k&&s.push({container:r,indexer:i});return r}if(S(t)){const r=t.map(i=>R(i,n,e,o,s));for(let i=0;im(e,n)):t instanceof nt?{graphTypeName:t.typeName,id:t.id,graphType:"entity",properties:v(t.properties,n)}:t instanceof rt?{graphType:"object",properties:v(t.properties,n)}:t instanceof et?{graphTypeName:t.typeName,id:t.id,graphType:"relationship",originId:t.originId??null,destinationId:t.destinationId??null,properties:v(t.properties,n)}:t instanceof it?{graphType:"path",path:t.path?t.path.map(e=>m(e,n)):null}:A(t)?at(t,n):w(t)||C(t)||Q(t)?t:null}function Ct(t){t.mode==="async"&&(t.functions.knowledgegraphbyportalitem=function(n,e){return t.standardFunctionAsync(n,e,(o,s,r)=>{if(P(r,2,2,n,e),r[0]===null)throw new c(n,l.PortalRequired,e);if(r[0]instanceof q){const d=T(r[1]);let f;return f=n.services?.portal?n.services.portal:_.getDefault(),W(U(r[0],f),d)}if(w(r[0])===!1)throw new c(n,l.InvalidParameter,e);const i=T(r[0]);return W(n.services?.portal??_.getDefault(),i)})},t.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),t.functions.querygraph=function(n,e){return t.standardFunctionAsync(n,e,async(o,s,r)=>{P(r,2,4,n,e);const i=r[0];if(!J(i))throw new c(n,l.InvalidParameter,e);const d=r[1];if(!w(d))throw new c(n,l.InvalidParameter,e);u===null&&(u=await D(()=>import("./knowledgeGraphService-DOJz0fzA-Dd_Ebjo1.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(a=>a.k));let f=null;const h=K(r[2],null);if(!(h instanceof I||h===null))throw new c(n,l.InvalidParameter,e);if(h){let a=[];f=R(h,!0,!1,n,a),a=a.filter(p=>!p.container[p.indexer].spatialReference.isWGS84),a.length>0&&await ot(a)}const x=new tt({openCypherQuery:d,bindParameters:f});(i?.serviceDefinition?.currentVersion??11.3)>11.2&&(x.outputSpatialReference=n.spatialReference);const F=(await u.executeQueryStreaming(i,x)).resultRowsStream.getReader(),y=[];try{for(;;){const{done:a,value:p}=await F.read();if(a)break;if(S(p))for(const g of p)y.push(m(g,n));else{const g=[];for(const G of p)g.push(m(p[G],n));y.push(g)}}}catch(a){throw a}return I.convertJsonToArcade(y,M(n),!1,!0)})},t.signatures.push({name:"querygraph",min:2,max:4}))}export{Ct as registerFunctions}; diff --git a/main/assets/knowledgegraph-Dt7zfNlJ-CPwlmP6C.js b/main/assets/knowledgegraph-Dt7zfNlJ-CPwlmP6C.js deleted file mode 100644 index e3b773647..000000000 --- a/main/assets/knowledgegraph-Dt7zfNlJ-CPwlmP6C.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./knowledgeGraphService-DOJz0fzA-6E_aD1T8.js","./main-BZaw9FpY.js","./main-DDePfy-e.css","./Relationship-Db9GUmYx-DPu3VSRE.js"])))=>i.map(i=>d[i]); -import{r as _,_ as D,C as E,J as $,d as k,dK as N,b7 as j}from"./main-BZaw9FpY.js";import{t as q,N as I}from"./arcadeUtils-DpP0k7IY-DIwxqttO.js";import{w as P,T as c,n as l,M as T,y as w,F as J,g as K,C as S,e as M,S as C,d as b,c as O,h as V,a as L,R as A,ak as Q}from"./languageUtils-BYxF9hRA-Dig_Awzu.js";import{n as U}from"./portalUtils-CKN9iXwH-AaE_9x6i.js";import{_ as z,W as B,K as H}from"./projection-BA9M1R7d-DoNqITCd.js";import X from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import{f as Y,j as Z}from"./project-DQKhruav-CYVbgcFi.js";import{j as tt,w as nt,x as rt,b as et,k as it}from"./Relationship-Db9GUmYx-DPu3VSRE.js";import"./TimeOnly-DSMefxKy-DBJeVQCe.js";import"./UnknownTimeZone-C--TOcPG-hkNbcn35.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-CkdezteH.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-CiA2Ur00.js";import"./number-eRKYXfX9-B-l8dJUS.js";import"./shared-D1w-26bA-Cy2KeMh-.js";import"./Field-C6hA1tZj-CbELM0zp.js";import"./fieldType-CD2CL2hr-BAgRuESI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-sojFdYaD.js";import"./TimeExtent-Cn0Jofqr-tHuvEXRa.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";import"./utils-9sQxfkoa-Cus_qP6M.js";import"./utils-Bq23Xwmj-sYd6uuv5.js";let u=null;async function ot(t){const n=E.geometryServiceUrl??"";if(!n){z()||await B();for(const r of t)r.container[r.indexer]=H(r.container[r.indexer],$.WGS84);return}const e=t.map(r=>r.container[r.indexer]),o=new Y({geometries:e,outSpatialReference:$.WGS84}),s=await Z(n,o);for(let r=0;rimport("./knowledgeGraphService-DOJz0fzA-6E_aD1T8.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(o=>o.k)),await u.fetchKnowledgeGraph(e.url)}function R(t,n,e,o,s){if(t===null)return null;if(w(t)||C(t))return t;if(b(t)||b(t))return t.toJSDate();if(O(t))return t.toStorageFormat();if(V(t))return t.toStorageString();if(L(t)){const r={};for(const i of t.keys())r[i]=R(t.field(i),n,e,o,s),r[i]instanceof k&&s.push({container:r,indexer:i});return r}if(S(t)){const r=t.map(i=>R(i,n,e,o,s));for(let i=0;im(e,n)):t instanceof nt?{graphTypeName:t.typeName,id:t.id,graphType:"entity",properties:v(t.properties,n)}:t instanceof rt?{graphType:"object",properties:v(t.properties,n)}:t instanceof et?{graphTypeName:t.typeName,id:t.id,graphType:"relationship",originId:t.originId??null,destinationId:t.destinationId??null,properties:v(t.properties,n)}:t instanceof it?{graphType:"path",path:t.path?t.path.map(e=>m(e,n)):null}:A(t)?at(t,n):w(t)||C(t)||Q(t)?t:null}function Ct(t){t.mode==="async"&&(t.functions.knowledgegraphbyportalitem=function(n,e){return t.standardFunctionAsync(n,e,(o,s,r)=>{if(P(r,2,2,n,e),r[0]===null)throw new c(n,l.PortalRequired,e);if(r[0]instanceof q){const d=T(r[1]);let f;return f=n.services?.portal?n.services.portal:_.getDefault(),W(U(r[0],f),d)}if(w(r[0])===!1)throw new c(n,l.InvalidParameter,e);const i=T(r[0]);return W(n.services?.portal??_.getDefault(),i)})},t.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),t.functions.querygraph=function(n,e){return t.standardFunctionAsync(n,e,async(o,s,r)=>{P(r,2,4,n,e);const i=r[0];if(!J(i))throw new c(n,l.InvalidParameter,e);const d=r[1];if(!w(d))throw new c(n,l.InvalidParameter,e);u===null&&(u=await D(()=>import("./knowledgeGraphService-DOJz0fzA-6E_aD1T8.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(a=>a.k));let f=null;const h=K(r[2],null);if(!(h instanceof I||h===null))throw new c(n,l.InvalidParameter,e);if(h){let a=[];f=R(h,!0,!1,n,a),a=a.filter(p=>!p.container[p.indexer].spatialReference.isWGS84),a.length>0&&await ot(a)}const x=new tt({openCypherQuery:d,bindParameters:f});(i?.serviceDefinition?.currentVersion??11.3)>11.2&&(x.outputSpatialReference=n.spatialReference);const F=(await u.executeQueryStreaming(i,x)).resultRowsStream.getReader(),y=[];try{for(;;){const{done:a,value:p}=await F.read();if(a)break;if(S(p))for(const g of p)y.push(m(g,n));else{const g=[];for(const G of p)g.push(m(p[G],n));y.push(g)}}}catch(a){throw a}return I.convertJsonToArcade(y,M(n),!1,!0)})},t.signatures.push({name:"querygraph",min:2,max:4}))}export{Ct as registerFunctions}; diff --git a/main/assets/labelUtils-BW14kBqX-8wHrIU-s.js b/main/assets/labelUtils-BW14kBqX-8wHrIU-s.js deleted file mode 100644 index c1e674f51..000000000 --- a/main/assets/labelUtils-BW14kBqX-8wHrIU-s.js +++ /dev/null @@ -1 +0,0 @@ -import{cF as p}from"./main-BZaw9FpY.js";const s="__begin__",l="__end__",u=new RegExp(s,"ig"),c=new RegExp(l,"ig"),t=new RegExp("^"+s,"i"),o=new RegExp(l+"$","i"),r='"',x=r+" + ",f=" + "+r;function g(n){return n.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function y(n){return n.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function i(n){const e={expression:"",type:"none"};return n.labelExpressionInfo?n.labelExpressionInfo.value?(e.expression=n.labelExpressionInfo.value,e.type="conventional"):n.labelExpressionInfo.expression&&(e.expression=n.labelExpressionInfo.expression,e.type="arcade"):n.labelExpression!=null&&(e.expression=g(n.labelExpression),e.type="conventional"),e}function A(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return E(e.expression);case"arcade":return e.expression}return null}function I(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return $(e.expression);case"arcade":return _(e.expression)}return null}function E(n){let e;return n?(e=p(n,a=>s+'$feature["'+a+'"]'+l),e=t.test(e)?e.replace(t,""):r+e,e=o.test(e)?e.replace(o,""):e+r,e=e.replaceAll(u,x).replaceAll(c,f)):e='""',e}const w=/^\s*\{([^}]+)\}\s*$/i;function $(n){return n?.match(w)?.[1].trim()||null}const b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,R=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function _(n){if(!n)return null;let e=b.exec(n)||m.exec(n);return e?e[1]||e[3]:(e=R.exec(n),e?e[2]:null)}export{y as $,A as b,g as i,I as m,E as p,i as t,_ as u}; diff --git a/main/assets/labelUtils-BW14kBqX-Cu1LInU4.js b/main/assets/labelUtils-BW14kBqX-Cu1LInU4.js new file mode 100644 index 000000000..99abd93f0 --- /dev/null +++ b/main/assets/labelUtils-BW14kBqX-Cu1LInU4.js @@ -0,0 +1 @@ +import{cF as p}from"./main-C7yV2j71.js";const s="__begin__",l="__end__",u=new RegExp(s,"ig"),c=new RegExp(l,"ig"),t=new RegExp("^"+s,"i"),o=new RegExp(l+"$","i"),r='"',x=r+" + ",f=" + "+r;function g(n){return n.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function y(n){return n.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function i(n){const e={expression:"",type:"none"};return n.labelExpressionInfo?n.labelExpressionInfo.value?(e.expression=n.labelExpressionInfo.value,e.type="conventional"):n.labelExpressionInfo.expression&&(e.expression=n.labelExpressionInfo.expression,e.type="arcade"):n.labelExpression!=null&&(e.expression=g(n.labelExpression),e.type="conventional"),e}function A(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return E(e.expression);case"arcade":return e.expression}return null}function I(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return $(e.expression);case"arcade":return _(e.expression)}return null}function E(n){let e;return n?(e=p(n,a=>s+'$feature["'+a+'"]'+l),e=t.test(e)?e.replace(t,""):r+e,e=o.test(e)?e.replace(o,""):e+r,e=e.replaceAll(u,x).replaceAll(c,f)):e='""',e}const w=/^\s*\{([^}]+)\}\s*$/i;function $(n){return n?.match(w)?.[1].trim()||null}const b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,R=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function _(n){if(!n)return null;let e=b.exec(n)||m.exec(n);return e?e[1]||e[3]:(e=R.exec(n),e?e[2]:null)}export{y as $,A as b,g as i,I as m,E as p,i as t,_ as u}; diff --git a/main/assets/labelingInfo-DGVNul26-CXiwzGiu.js b/main/assets/labelingInfo-DGVNul26-CXiwzGiu.js deleted file mode 100644 index fb9a05511..000000000 --- a/main/assets/labelingInfo-DGVNul26-CXiwzGiu.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as s,a0 as x,ac as u,i as S,aK as C,eo as j,eR as I,eS as B,eT as h,e as P,eU as N,eV as $,P as d,o as D,a1 as G}from"./main-BZaw9FpY.js";import{p as g,$ as M,u as O,t as V,b as R,m as U}from"./labelUtils-BW14kBqX-8wHrIU-s.js";var m;let p=m=class extends P{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,r){return r.value?g(r.value):e}writeExpression(e,r,n){this.value!=null&&(e=g(this.value)),e!=null&&(r[n]=e)}clone(){return new m({expression:this.expression,title:this.title,value:this.value})}};i([s({type:String,json:{write:{writerEnsuresNonNull:!0}}})],p.prototype,"expression",void 0),i([x("expression",["expression","value"])],p.prototype,"readExpression",null),i([u("expression")],p.prototype,"writeExpression",null),i([s({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"title",void 0),i([s({json:{read:!1,write:!1}})],p.prototype,"value",void 0),p=m=i([S("esri.layers.support.LabelExpressionInfo")],p);const L=p;var f;const v=new C({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function w(e,r,n){return{enabled:!N(n?.layer)}}function E(e){return!e||e.origin!=="service"&&e.layer?.type!=="map-image"}function z(e){return e?.type==="map-image"}function A(e){return!!z(e)&&!!e.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function J(e){return E(e)||A(e?.layer)}let l=f=class extends P{static evaluateWhere(e,r){const n=(t,o,a)=>{switch(o){case"=":return t==a;case"<>":return t!=a;case">":return t>a;case">=":return t>=a;case"<":return tJ(n)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),i([u("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),i([s({type:v.apiValues,json:{type:v.jsonValues,read:v.read,write:v.write}})],l.prototype,"labelPlacement",void 0),i([s({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),i([s({type:Number})],l.prototype,"maxScale",void 0),i([u("maxScale")],l.prototype,"writeMaxScale",null),i([s({type:Number})],l.prototype,"minScale",void 0),i([u("minScale")],l.prototype,"writeMinScale",null),i([s({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabel",void 0),i([s({type:Number,cast:j,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabelDistance",void 0),i([s({types:I,json:{origins:{"web-scene":{types:B,write:h,default:null}},write:h,default:null}})],l.prototype,"symbol",void 0),i([s({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),i([s({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=f=i([S("esri.layers.support.LabelClass")],l);const Z=l,y=()=>G.getLogger("esri.layers.support.labelingInfo"),F=/\[([^[\]]+)\]/gi;function q(e,r,n){return e?e.map(t=>{const o=new Z;if(o.read(t,n),o.labelExpression){const a=r.fields||r.layerDefinition?.fields||this.fields;o.labelExpression=o.labelExpression.replaceAll(F,(c,b)=>`[${k(b,a)}]`)}return o}):null}function k(e,r){if(!r)return e;const n=e.toLowerCase();for(let t=0;t{switch(o){case"=":return t==a;case"<>":return t!=a;case">":return t>a;case">=":return t>=a;case"<":return tJ(n)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),i([u("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),i([s({type:v.apiValues,json:{type:v.jsonValues,read:v.read,write:v.write}})],l.prototype,"labelPlacement",void 0),i([s({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),i([s({type:Number})],l.prototype,"maxScale",void 0),i([u("maxScale")],l.prototype,"writeMaxScale",null),i([s({type:Number})],l.prototype,"minScale",void 0),i([u("minScale")],l.prototype,"writeMinScale",null),i([s({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabel",void 0),i([s({type:Number,cast:j,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabelDistance",void 0),i([s({types:I,json:{origins:{"web-scene":{types:B,write:h,default:null}},write:h,default:null}})],l.prototype,"symbol",void 0),i([s({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),i([s({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=f=i([S("esri.layers.support.LabelClass")],l);const Z=l,y=()=>G.getLogger("esri.layers.support.labelingInfo"),F=/\[([^[\]]+)\]/gi;function q(e,r,n){return e?e.map(t=>{const o=new Z;if(o.read(t,n),o.labelExpression){const a=r.fields||r.layerDefinition?.fields||this.fields;o.labelExpression=o.labelExpression.replaceAll(F,(c,b)=>`[${k(b,a)}]`)}return o}):null}function k(e,r){if(!r)return e;const n=e.toLowerCase();for(let t=0;tthis.fn(e,{preparsed:!0,arguments:r})}call(e,r){return this.fn(e,r)}marshalledCall(e,r,t,a){return a(e,r,(s,l,u)=>{u=u.map(c=>c instanceof R&&!(c instanceof Y)?un(c,e,a):c);const p=this.call(t,{args:u});return kn(p)?p.then(c=>un(c,t,a)):p})}}class Y extends R{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,r){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}marshalledCall(e,r,t){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}}class O extends F{constructor(e,r,t,a,s,l){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=r,this._hasZ=t,this._hasM=a,this._cacheId=s,this._partId=l}get(e){if(this._lazyPt[e]===void 0){const r=this._elements[e];if(r===void 0)return;const t=this._hasZ,a=this._hasM;let s;s=t&&!a?new M(r[0],r[1],r[2],void 0,this._spRef):a&&!t?new M(r[0],r[1],void 0,r[2],this._spRef):t&&a?new M(r[0],r[1],r[2],r[3],this._spRef):new M(r[0],r[1],this._spRef),s.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=s}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof O&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}class nn extends F{constructor(e,r,t,a,s){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=t,this._hasM=a,this._spRef=r,this._cacheId=s}get(e){if(this._lazyPath[e]===void 0){const r=this._elements[e];if(r===void 0)return;this._lazyPath[e]=new O(r,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof nn&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}class Bn{constructor(e){this.value=e}}class Gn{constructor(e){this.value=e}}const g={type:"VOID"},Yn=Symbol("BREAK"),qn=Symbol("CONTINUE");function w(n,e,r){return e===""||e==null||e===r||e===r?n:n=n.split(e).join(r)}function J(n){return n instanceof R}function en(n){return n instanceof fn}function L(n){return!!y(n)||!!N(n)||!!f(n)||!!m(n)||!!h(n)||!!b(n)||n===null||n===g||typeof n=="number"}function Hn(n,e){return n===void 0?e:n}function Kn(n){return n==null?"":C(n)||Z(n)?"Array":f(n)?"Date":h(n)?"Time":m(n)?"DateOnly":y(n)?"String":b(n)?"Boolean":N(n)?"Number":n?.declaredClass==="esri.arcade.Attachment"?"Attachment":n?.declaredClass==="esri.arcade.Portal"?"Portal":n?.declaredClass==="esri.arcade.Dictionary"?"Dictionary":Nn(n)?"KnowledgeGraph":n instanceof fn?"Module":yn(n)?"Feature":n instanceof M?"Point":n instanceof V?"Polygon":n instanceof W?"Polyline":n instanceof Q?"Multipoint":n instanceof X?"Extent":J(n)?"Function":gn(n)?"FeatureSet":bn(n)?"FeatureSetCollection":n===g?"":typeof n=="number"&&isNaN(n)?"Number":"Unrecognized Type"}function y(n){return typeof n=="string"||n instanceof String}function b(n){return typeof n=="boolean"}function N(n){return typeof n=="number"}function Vn(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n}function Wn(n){return n instanceof k}function C(n){return Array.isArray(n)}function yn(n){return n?.arcadeDeclaredClass==="esri.arcade.Feature"}function Qn(n){return n?.declaredClass==="esri.Graphic"}function Xn(n){return n instanceof zn}function gn(n){return n?.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function $n(n){return n?.declaredClass==="esri.arcade.Dictionary"}function bn(n){return n?.declaredRootClass==="esri.arcade.featureSetCollection"}function Nn(n){return n?.declaredClass==="esri.rest.knowledgeGraph.KnowledgeGraph"}function Z(n){return n instanceof F}function f(n){return n instanceof I}function m(n){return n instanceof _n}function h(n){return n instanceof vn}function q(n){return n!=null&&typeof n=="object"}function P(n){return n instanceof Date}function ne(n,e,r,t,a){if(n.lengthr)throw new T(t,o.WrongNumberOfParameters,a)}function ee(n){return n<0?-Math.round(-n):Math.round(n)}function rn(n,e){return isNaN(n)||e==null||e===""?n.toString():(e=w(e,"‰",""),e=w(e,"¤",""),Ln(n,{pattern:e}))}function j(n,e){return e==null||e===""?n.toISOString(!0):n.toFormat(Sn(e),{locale:cn(),numberingSystem:"latn"})}function Sn(n,e=!1){n=n.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of n.match(t)||[])switch(a){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=e?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=e?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?r+=`'${a.slice(1,-1)}'`:r+=`'${a}'`}return r}function i(n,e,r){switch(r){case">":return n>e;case"<":return n=":return n>=e;case"<=":return n<=e}return!1}function re(n,e,r){if(n===null){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}if(n===g){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}else if(N(n)){if(N(e))return i(n,e,r);if(b(e))return i(n,d(e),r);if(e===null||e===g)return i(n,0,r);if(y(e))return i(n,d(e),r);if(f(e)||h(e)||m(e))return i(n,e.toNumber(),r)}else if(y(n)){if(y(e))return i(x(n),x(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(N(e))return i(d(n),e,r);if(e===null||e===g)return i(d(n),0,r);if(b(e))return i(d(n),d(e),r)}else if(f(n)){if(f(e))return n.timeZone!==e.timeZone&&(n.isUnknownTimeZone?n=I.arcadeDateAndZoneToArcadeDate(n,e.timeZone):e.isUnknownTimeZone&&(e=I.arcadeDateAndZoneToArcadeDate(e,n.timeZone))),i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(b(n)){if(b(e))return i(n,e,r);if(N(e))return i(d(n),d(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(e===null||e===g)return i(d(n),0,r);if(y(e))return i(d(n),d(e),r)}else if(m(n)){if(f(e))return i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(h(n)){if(f(e))throw new T(null,o.CannotCompareDateAndTime,null);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))return i(n.toNumber(),e.toNumber(),r);if(m(e))throw new T(null,o.CannotCompareDateAndTime,null)}return!!Cn(n,e)&&(r==="<="||r===">=")}function Cn(n,e){if(n===e||n===null&&e===g||e===null&&n===g)return!0;if(f(n)&&f(e)||h(n)&&h(e)||m(n)&&m(e))return n.equals(e);if(n instanceof nn||n instanceof O)return n.equalityTest(e);if(n instanceof M&&e instanceof M){const r=n.cache._arcadeCacheId,t=e.cache._arcadeCacheId;if(r!=null)return r===t}return!!(q(n)&&q(e)&&(n._arcadeCacheId===e._arcadeCacheId&&n._arcadeCacheId!==void 0&&n._arcadeCacheId!==null||n._underlyingGraphic===e._underlyingGraphic&&n._underlyingGraphic!==void 0&&n._underlyingGraphic!==null))}function x(n,e){if(y(n))return n;if(n===null)return"";if(N(n))return rn(n,e);if(b(n))return n.toString();if(f(n))return j(n,e);if(h(n)||m(n))return n.toFormat(e);if(n instanceof k)return JSON.stringify(n.toJSON());if(C(n)){const r=[];for(let t=0;tt.key===a.key?0:t.key==="spatialReference"?1:a.key==="spatialReference"||t.keya.key?1:0);if(C(n)){const t=[];for(let a=0;a0)return n;return null}if(n instanceof W){if(n.paths.length===0)return null;for(const e of n.paths)if(e.length>0)return n;return null}return n instanceof Q?n.points.length===0?null:n:n instanceof X?n.xmin==="NaN"||n.xmin===null||isNaN(n.xmin)?null:n:null}function Tn(n,e){if(!n||!n.domain)return e;let r=null,t=null;if(f(e))r=e.toNumber();else if(m(e))r=e.toString();else if(h(e))r=e.toStorageString();else if(n.field.type==="string"||n.field.type==="esriFieldTypeString")r=x(e);else{if(e==null)return null;if(e==="")return e;r=d(e)}for(let a=0;aS[p]===t&&(a=S.domains?.[l.name],a&&a.type==="inherited"&&(a=ln(l.name,e),s=!0),!0)),s||a||(a=ln(n,e)),{field:l,domain:a}}function ln(n,e){let r;return e.fields.some(t=>(t.name.toLowerCase()===n.toLowerCase()&&(r=t.domain),!!r)),r}function H(n,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const r=typeof e.cycles=="boolean"&&e.cycles,t=e.cmp&&(a=e.cmp,function(l){return function(u,p){const c={key:u,value:l[u]},S={key:p,value:l[p]};return a(c,S)}});var a;const s=[];return function l(u){if(u?.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u===void 0)return;if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);let p,c;if(Array.isArray(u)){for(c="[",p=0;p0&&(s=n[0].spatialReference,r=n[0].hasZ,t=n[0].hasM)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else{if(!Z(n))throw new T(null,o.InvalidParameter,null);for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:(Dn(a)||(a=a.slice().reverse()),new V({rings:[a],spatialReference:s,hasZ:r,hasM:t}))}return n}function de(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new W({paths:[a],spatialReference:s,hasZ:r,hasM:t})}return n}function pe(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new Q({points:a,spatialReference:s,hasZ:r,hasM:t})}return n}function me(n,e=!1){const r=[];if(n===null)return r;if(C(n)===!0){for(let t=0;t{setTimeout(()=>{e(n)},0)})):n}function ye(n,e,r){switch(r){case"&":return n&e;case"|":return n|e;case"^":return n^e;case"<<":return n<>":return n>>e;case">>>":return n>>>e}}function _(n,e=null){return n==null?null:b(n)||N(n)||y(n)?n:n instanceof k?e?.keepGeometryType===!0?n:n.toJSON():n instanceof F?n.toArray().map(r=>_(r,e)):Array.isArray(n)?n.map(r=>_(r,e)):P(n)?n:f(n)?n.toJSDate():h(n)?n.toString():m(n)?n.toJSDate():n!==null&&typeof n=="object"&&n.castAsJson!==void 0?n.castAsJson(e):null}async function ge(n,e,r,t,a){const s=await Mn(n,e,r);a[t]=s}async function Mn(n,e=null,r=null){if(n instanceof F&&(n=n.toArray()),n==null)return null;if(L(n)||n instanceof k||P(n)||f(n))return _(n,r);if(Array.isArray(n)){const t=[],a=[];for(const s of n)s===null||L(s)||s instanceof k||P(s)||f(s)?a.push(_(s,r)):(a.push(null),t.push(ge(s,e,r,a.length-1,a)));return t.length>0&&await Promise.all(t),a}return n!==null&&typeof n=="object"&&n.castAsJsonAsync!==void 0?n.castAsJsonAsync(e,r):null}function v(n){return xn(n)?n.parent:n}function xn(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.support.SubtypeSublayer"}function be(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.SubtypeGroupLayer"}function Ne(n,e,r){const t=v(n.fullSchema());return t===null||!t.fields?null:B(e,t,n,r)}function Se(n){const e=v(n.fullSchema());return e===null?null:e.fields?e.subtypeField?{subtypeField:e.subtypeField,subtypes:e.subtypes?e.subtypes.map(r=>({name:r.name,code:r.code})):[]}:e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(r=>({name:r.name,code:r.id})):[]}:null:null}function Ce(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;const s=B(e,a,n,t);if(r===void 0)try{r=n.field(e)}catch{return null}return Tn(s,r)}function Ae(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;if(r===void 0){try{r=n.field(e)}catch{return null}return r}return Fn(B(e,a,n,t),r)}function Te(n){return n?.timeZone??"system"}function Fe(n){const e=v(n.fullSchema());if(e===null||!e.fields)return null;const r=[];for(const t of e.fields)r.push(En(t));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField??"",geometryType:sn[e.geometryType]===void 0?"":sn[e.geometryType],fields:r}}function Me(n,e){return n==="system"&&(n=I.systemTimeZoneCanonicalName),{version:Zn,engineVersion:In,timeZone:n,spatialReference:e instanceof Rn?e.toJSON():e,application:wn.applicationName??"",engine:"web",locale:cn()}}const Zn="1.28",ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:Gn,ReturnResult:Bn,absRound:ee,arcadeVersion:Zn,autoCastArrayOfPointsToMultiPoint:pe,autoCastArrayOfPointsToPolygon:fe,autoCastArrayOfPointsToPolyline:de,autoCastFeatureToGeometry:ce,binaryOperator:ye,breakResult:Yn,castAsJson:_,castAsJsonAsync:Mn,continueResult:qn,defaultExecutingContext:Me,defaultTimeZone:Te,defaultUndefined:Hn,equalityTest:Cn,featureDomainCodeLookup:Ae,featureDomainValueLookup:Ce,featureFullDomain:Ne,featureSchema:Fe,featureSubtypes:Se,fixNullGeometry:le,fixSpatialReference:ue,formatDate:j,formatNumber:rn,getDomain:B,getDomainCode:Fn,getDomainValue:Tn,getType:Kn,greaterThanLessThan:re,isArray:C,isBoolean:b,isDate:f,isDateOnly:m,isDictionary:$n,isFeature:yn,isFeatureSet:gn,isFeatureSetCollection:bn,isFunctionParameter:J,isGeometry:Wn,isGraphic:Qn,isImmutableArray:Z,isInteger:Vn,isJsDate:P,isKnowledgeGraph:Nn,isModule:en,isNumber:N,isObject:q,isQuery:Xn,isSimpleType:L,isString:y,isSubtypeGrouplayer:be,isSubtypeSublayer:xn,isTime:h,multiReplace:w,parseGeometryFromJson:ie,pcCheck:ne,stableStringify:H,standardiseDateFormat:Sn,tick:he,toBoolean:se,toDate:ae,toNumber:d,toNumberArray:te,toString:x,toStringArray:me,toStringExplicit:An,voidOperation:g},Symbol.toStringTag,{value:"Module"}));export{Se as $,Me as A,_e as B,C,bn as D,L as E,Nn as F,nn as G,fn as H,Kn as I,ce as J,pe as K,se as L,x as M,we as N,Vn as O,ae as P,Ce as Q,Wn as R,N as S,T,J as U,re as V,Ne as W,Ae as X,fe as Y,Z,ee as _,$n as a,ye as a0,pn as a1,hn as a2,E as a3,Y as a4,Bn as a5,Yn as a6,qn as a7,Qn as a8,Gn as a9,ve as aa,Re as ab,R as ac,un as ad,he as ae,xn as af,me as ag,B as ah,Tn as ai,Fn as aj,P as ak,b,m as c,f as d,Te as e,d as f,Hn as g,h,Sn as i,le as j,O as k,g as l,Mn as m,o as n,Cn as o,de as p,w as q,gn as r,te as s,yn as t,An as u,_ as v,ne as w,Fe as x,y,ue as z}; diff --git a/main/assets/languageUtils-BYxF9hRA-Dig_Awzu.js b/main/assets/languageUtils-BYxF9hRA-Dig_Awzu.js deleted file mode 100644 index 5d713c12a..000000000 --- a/main/assets/languageUtils-BYxF9hRA-Dig_Awzu.js +++ /dev/null @@ -1 +0,0 @@ -import{cF as K,t as kn,w as M,l as V,m as W,G as Q,n as X,d as k,h as cn,F as on,g as On,D as Dn,cL as In,J as Rn,C as wn}from"./main-BZaw9FpY.js";import{r as I,O as _n,m as vn,u as Un}from"./TimeOnly-DSMefxKy-DBJeVQCe.js";import{n as F}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{b as En,h as sn}from"./shared-D1w-26bA-Cy2KeMh-.js";import{z as Ln,M as Pn}from"./number-eRKYXfX9-B-l8dJUS.js";import{b as zn}from"./Query-BrwMGK8U-sojFdYaD.js";let fn=class{};var o;(function(n){n.AsyncNotEnabled="AsyncNotEnabled",n.ModulesNotSupported="ModulesNotSupported",n.CircularModules="CircularModules",n.CannotCompareDateAndTime="CannotCompareDateAndTime",n.NeverReach="NeverReach",n.UnsupportedHashType="UnsupportedHashType",n.InvalidParameter="InvalidParameter",n.FeatureSetDoesNotHaveSubtypes="FeatureSetDoesNotHaveSubtypes",n.UnexpectedToken="UnexpectedToken",n.Unrecognized="Unrecognized",n.UnrecognizedType="UnrecognizedType",n.MaximumCallDepth="MaximumCallDepth",n.BooleanConditionRequired="BooleanConditionRequired",n.TypeNotAllowedInFeature="TypeNotAllowedInFeature",n.KeyMustBeString="KeyMustBeString",n.WrongNumberOfParameters="WrongNumberOfParameters",n.CallNonFunction="CallNonFunction",n.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",n.NoFunctionInDictionary="NoFunctionInDictionary",n.NoFunctionInArray="NoFunctionInArray",n.AssignModuleFunction="AssignModuleFunction",n.LogicExpressionOrAnd="LogicExpressionOrAnd",n.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",n.FunctionNotFound="FunctionNotFound",n.InvalidMemberAccessKey="InvalidMemberAccessKey",n.UnsupportedUnaryOperator="UnsupportUnaryOperator",n.InvalidIdentifier="InvalidIdentifier",n.MemberOfNull="MemberOfNull",n.UnsupportedOperator="UnsupportedOperator",n.Cancelled="Cancelled",n.ModuleAccessorMustBeString="ModuleAccessorMustBeString",n.ModuleExportNotFound="ModuleExportNotFound",n.Immutable="Immutable",n.OutOfBounds="OutOfBounds",n.IllegalResult="IllegalResult",n.FieldNotFound="FieldNotFound",n.PortalRequired="PortalRequired",n.LogicError="LogicError",n.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",n.KeyAccessorMustBeString="KeyAccessorMustBeString",n.WrongSpatialReference="WrongSpatialReference",n.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",n.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"})(o||(o={}));const dn={[o.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[o.LogicError]:"Logic error - {reason}",[o.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[o.NeverReach]:"Encountered unreachable logic",[o.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[o.ModuleAccessorMustBeString]:"Module accessor must be a string",[o.ModuleExportNotFound]:"Module has no export with provided identifier",[o.ModulesNotSupported]:"Current profile does not support modules",[o.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[o.FunctionNotFound]:"Function not found",[o.FieldNotFound]:"Key not found - {key}",[o.CircularModules]:"Circular module dependencies are not allowed",[o.Cancelled]:"Execution cancelled",[o.UnsupportedHashType]:"Type not supported in hash function",[o.IllegalResult]:"Value is not a supported return type",[o.PortalRequired]:"Portal is required",[o.InvalidParameter]:"Invalid parameter",[o.WrongNumberOfParameters]:"Call with wrong number of parameters",[o.Unrecognized]:"Unrecognized code structure",[o.UnrecognizedType]:"Unrecognized type",[o.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[o.BooleanConditionRequired]:"Conditions must use booleans",[o.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[o.NoFunctionInArray]:"Arrays cannot contain functions.",[o.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[o.KeyAccessorMustBeString]:"Accessor must be a string",[o.KeyMustBeString]:"Object keys must be a string",[o.Immutable]:"Object is immutable",[o.UnexpectedToken]:"Unexpected token",[o.MemberOfNull]:"Cannot access property of null object",[o.MaximumCallDepth]:"Exceeded maximum function depth",[o.OutOfBounds]:"Out of bounds",[o.InvalidIdentifier]:"Identifier not recognized",[o.CallNonFunction]:"Expression is not a function",[o.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[o.AssignModuleFunction]:"Cannot assign function to module variable",[o.UnsupportedUnaryOperator]:"Unsupported unary operator",[o.UnsupportedOperator]:"Unsupported operator",[o.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[o.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[o.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[o.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly",[o.FeatureSetDoesNotHaveSubtypes]:"FeatureSet does not have subtypes"};let Jn=class extends Error{constructor(...n){super(...n)}};class U extends Jn{constructor(e,r){super($(r)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,U),r?.loc&&(this.loc=r.loc)}}class T extends Error{constructor(e,r,t,a){super("Execution error - "+$(t)+K(dn[r],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,T),t?.loc&&(this.loc=t.loc)}}function $(n){return n&&n.loc?`Line : ${n.loc.start?.line}, ${n.loc.start?.column}: `:""}class pn extends Error{constructor(e,r,t,a){super("Compilation error - "+$(t)+K(dn[r],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,pn),t?.loc&&(this.loc=t.loc)}}let Re=class mn extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,mn)}};function we(n,e,r){return r.declaredRootClass==="esri.arcade.arcadeexecutionerror"||r.declaredRootClass==="esri.arcade.arcadecompilationerror"?r.loc===null&&e?.loc?new U(r,{cause:r}):r:(r.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||r.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||r.declaredRootClass,e?.loc?new U(r,{cause:r}):r)}var E;(function(n){n.UnrecognizedUri="UnrecognizedUri",n.UnsupportedUriProtocol="UnsupportedUriProtocol"})(E||(E={}));const jn={[E.UnrecognizedUri]:"Unrecognized uri - {uri}",[E.UnsupportedUriProtocol]:"Unrecognized uri protocol"};class hn extends Error{constructor(e,r){super(K(jn[e],r)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,hn)}}class R{constructor(){}}function un(n,e,r){if(n instanceof R&&!(n instanceof Y)){const t=new Y;return t.fn=n,t.parameterEvaluator=r,t.context=e,t}return n}class _e extends R{constructor(e){super(),this.fn=e}createFunction(e){return(...r)=>this.fn(e,{preparsed:!0,arguments:r})}call(e,r){return this.fn(e,r)}marshalledCall(e,r,t,a){return a(e,r,(s,l,u)=>{u=u.map(c=>c instanceof R&&!(c instanceof Y)?un(c,e,a):c);const p=this.call(t,{args:u});return kn(p)?p.then(c=>un(c,t,a)):p})}}class Y extends R{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,r){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}marshalledCall(e,r,t){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}}class O extends F{constructor(e,r,t,a,s,l){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=r,this._hasZ=t,this._hasM=a,this._cacheId=s,this._partId=l}get(e){if(this._lazyPt[e]===void 0){const r=this._elements[e];if(r===void 0)return;const t=this._hasZ,a=this._hasM;let s;s=t&&!a?new M(r[0],r[1],r[2],void 0,this._spRef):a&&!t?new M(r[0],r[1],void 0,r[2],this._spRef):t&&a?new M(r[0],r[1],r[2],r[3],this._spRef):new M(r[0],r[1],this._spRef),s.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=s}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof O&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}class nn extends F{constructor(e,r,t,a,s){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=t,this._hasM=a,this._spRef=r,this._cacheId=s}get(e){if(this._lazyPath[e]===void 0){const r=this._elements[e];if(r===void 0)return;this._lazyPath[e]=new O(r,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof nn&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}class Bn{constructor(e){this.value=e}}class Gn{constructor(e){this.value=e}}const g={type:"VOID"},Yn=Symbol("BREAK"),qn=Symbol("CONTINUE");function w(n,e,r){return e===""||e==null||e===r||e===r?n:n=n.split(e).join(r)}function J(n){return n instanceof R}function en(n){return n instanceof fn}function L(n){return!!y(n)||!!N(n)||!!f(n)||!!m(n)||!!h(n)||!!b(n)||n===null||n===g||typeof n=="number"}function Hn(n,e){return n===void 0?e:n}function Kn(n){return n==null?"":C(n)||Z(n)?"Array":f(n)?"Date":h(n)?"Time":m(n)?"DateOnly":y(n)?"String":b(n)?"Boolean":N(n)?"Number":n?.declaredClass==="esri.arcade.Attachment"?"Attachment":n?.declaredClass==="esri.arcade.Portal"?"Portal":n?.declaredClass==="esri.arcade.Dictionary"?"Dictionary":Nn(n)?"KnowledgeGraph":n instanceof fn?"Module":yn(n)?"Feature":n instanceof M?"Point":n instanceof V?"Polygon":n instanceof W?"Polyline":n instanceof Q?"Multipoint":n instanceof X?"Extent":J(n)?"Function":gn(n)?"FeatureSet":bn(n)?"FeatureSetCollection":n===g?"":typeof n=="number"&&isNaN(n)?"Number":"Unrecognized Type"}function y(n){return typeof n=="string"||n instanceof String}function b(n){return typeof n=="boolean"}function N(n){return typeof n=="number"}function Vn(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n}function Wn(n){return n instanceof k}function C(n){return Array.isArray(n)}function yn(n){return n?.arcadeDeclaredClass==="esri.arcade.Feature"}function Qn(n){return n?.declaredClass==="esri.Graphic"}function Xn(n){return n instanceof zn}function gn(n){return n?.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function $n(n){return n?.declaredClass==="esri.arcade.Dictionary"}function bn(n){return n?.declaredRootClass==="esri.arcade.featureSetCollection"}function Nn(n){return n?.declaredClass==="esri.rest.knowledgeGraph.KnowledgeGraph"}function Z(n){return n instanceof F}function f(n){return n instanceof I}function m(n){return n instanceof _n}function h(n){return n instanceof vn}function q(n){return n!=null&&typeof n=="object"}function P(n){return n instanceof Date}function ne(n,e,r,t,a){if(n.lengthr)throw new T(t,o.WrongNumberOfParameters,a)}function ee(n){return n<0?-Math.round(-n):Math.round(n)}function rn(n,e){return isNaN(n)||e==null||e===""?n.toString():(e=w(e,"‰",""),e=w(e,"¤",""),Ln(n,{pattern:e}))}function j(n,e){return e==null||e===""?n.toISOString(!0):n.toFormat(Sn(e),{locale:cn(),numberingSystem:"latn"})}function Sn(n,e=!1){n=n.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of n.match(t)||[])switch(a){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=e?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=e?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?r+=`'${a.slice(1,-1)}'`:r+=`'${a}'`}return r}function i(n,e,r){switch(r){case">":return n>e;case"<":return n=":return n>=e;case"<=":return n<=e}return!1}function re(n,e,r){if(n===null){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}if(n===g){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}else if(N(n)){if(N(e))return i(n,e,r);if(b(e))return i(n,d(e),r);if(e===null||e===g)return i(n,0,r);if(y(e))return i(n,d(e),r);if(f(e)||h(e)||m(e))return i(n,e.toNumber(),r)}else if(y(n)){if(y(e))return i(x(n),x(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(N(e))return i(d(n),e,r);if(e===null||e===g)return i(d(n),0,r);if(b(e))return i(d(n),d(e),r)}else if(f(n)){if(f(e))return n.timeZone!==e.timeZone&&(n.isUnknownTimeZone?n=I.arcadeDateAndZoneToArcadeDate(n,e.timeZone):e.isUnknownTimeZone&&(e=I.arcadeDateAndZoneToArcadeDate(e,n.timeZone))),i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(b(n)){if(b(e))return i(n,e,r);if(N(e))return i(d(n),d(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(e===null||e===g)return i(d(n),0,r);if(y(e))return i(d(n),d(e),r)}else if(m(n)){if(f(e))return i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(h(n)){if(f(e))throw new T(null,o.CannotCompareDateAndTime,null);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))return i(n.toNumber(),e.toNumber(),r);if(m(e))throw new T(null,o.CannotCompareDateAndTime,null)}return!!Cn(n,e)&&(r==="<="||r===">=")}function Cn(n,e){if(n===e||n===null&&e===g||e===null&&n===g)return!0;if(f(n)&&f(e)||h(n)&&h(e)||m(n)&&m(e))return n.equals(e);if(n instanceof nn||n instanceof O)return n.equalityTest(e);if(n instanceof M&&e instanceof M){const r=n.cache._arcadeCacheId,t=e.cache._arcadeCacheId;if(r!=null)return r===t}return!!(q(n)&&q(e)&&(n._arcadeCacheId===e._arcadeCacheId&&n._arcadeCacheId!==void 0&&n._arcadeCacheId!==null||n._underlyingGraphic===e._underlyingGraphic&&n._underlyingGraphic!==void 0&&n._underlyingGraphic!==null))}function x(n,e){if(y(n))return n;if(n===null)return"";if(N(n))return rn(n,e);if(b(n))return n.toString();if(f(n))return j(n,e);if(h(n)||m(n))return n.toFormat(e);if(n instanceof k)return JSON.stringify(n.toJSON());if(C(n)){const r=[];for(let t=0;tt.key===a.key?0:t.key==="spatialReference"?1:a.key==="spatialReference"||t.keya.key?1:0);if(C(n)){const t=[];for(let a=0;a0)return n;return null}if(n instanceof W){if(n.paths.length===0)return null;for(const e of n.paths)if(e.length>0)return n;return null}return n instanceof Q?n.points.length===0?null:n:n instanceof X?n.xmin==="NaN"||n.xmin===null||isNaN(n.xmin)?null:n:null}function Tn(n,e){if(!n||!n.domain)return e;let r=null,t=null;if(f(e))r=e.toNumber();else if(m(e))r=e.toString();else if(h(e))r=e.toStorageString();else if(n.field.type==="string"||n.field.type==="esriFieldTypeString")r=x(e);else{if(e==null)return null;if(e==="")return e;r=d(e)}for(let a=0;aS[p]===t&&(a=S.domains?.[l.name],a&&a.type==="inherited"&&(a=ln(l.name,e),s=!0),!0)),s||a||(a=ln(n,e)),{field:l,domain:a}}function ln(n,e){let r;return e.fields.some(t=>(t.name.toLowerCase()===n.toLowerCase()&&(r=t.domain),!!r)),r}function H(n,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const r=typeof e.cycles=="boolean"&&e.cycles,t=e.cmp&&(a=e.cmp,function(l){return function(u,p){const c={key:u,value:l[u]},S={key:p,value:l[p]};return a(c,S)}});var a;const s=[];return function l(u){if(u?.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u===void 0)return;if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);let p,c;if(Array.isArray(u)){for(c="[",p=0;p0&&(s=n[0].spatialReference,r=n[0].hasZ,t=n[0].hasM)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else{if(!Z(n))throw new T(null,o.InvalidParameter,null);for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:(Dn(a)||(a=a.slice().reverse()),new V({rings:[a],spatialReference:s,hasZ:r,hasM:t}))}return n}function de(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new W({paths:[a],spatialReference:s,hasZ:r,hasM:t})}return n}function pe(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new Q({points:a,spatialReference:s,hasZ:r,hasM:t})}return n}function me(n,e=!1){const r=[];if(n===null)return r;if(C(n)===!0){for(let t=0;t{setTimeout(()=>{e(n)},0)})):n}function ye(n,e,r){switch(r){case"&":return n&e;case"|":return n|e;case"^":return n^e;case"<<":return n<>":return n>>e;case">>>":return n>>>e}}function _(n,e=null){return n==null?null:b(n)||N(n)||y(n)?n:n instanceof k?e?.keepGeometryType===!0?n:n.toJSON():n instanceof F?n.toArray().map(r=>_(r,e)):Array.isArray(n)?n.map(r=>_(r,e)):P(n)?n:f(n)?n.toJSDate():h(n)?n.toString():m(n)?n.toJSDate():n!==null&&typeof n=="object"&&n.castAsJson!==void 0?n.castAsJson(e):null}async function ge(n,e,r,t,a){const s=await Mn(n,e,r);a[t]=s}async function Mn(n,e=null,r=null){if(n instanceof F&&(n=n.toArray()),n==null)return null;if(L(n)||n instanceof k||P(n)||f(n))return _(n,r);if(Array.isArray(n)){const t=[],a=[];for(const s of n)s===null||L(s)||s instanceof k||P(s)||f(s)?a.push(_(s,r)):(a.push(null),t.push(ge(s,e,r,a.length-1,a)));return t.length>0&&await Promise.all(t),a}return n!==null&&typeof n=="object"&&n.castAsJsonAsync!==void 0?n.castAsJsonAsync(e,r):null}function v(n){return xn(n)?n.parent:n}function xn(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.support.SubtypeSublayer"}function be(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.SubtypeGroupLayer"}function Ne(n,e,r){const t=v(n.fullSchema());return t===null||!t.fields?null:B(e,t,n,r)}function Se(n){const e=v(n.fullSchema());return e===null?null:e.fields?e.subtypeField?{subtypeField:e.subtypeField,subtypes:e.subtypes?e.subtypes.map(r=>({name:r.name,code:r.code})):[]}:e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(r=>({name:r.name,code:r.id})):[]}:null:null}function Ce(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;const s=B(e,a,n,t);if(r===void 0)try{r=n.field(e)}catch{return null}return Tn(s,r)}function Ae(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;if(r===void 0){try{r=n.field(e)}catch{return null}return r}return Fn(B(e,a,n,t),r)}function Te(n){return n?.timeZone??"system"}function Fe(n){const e=v(n.fullSchema());if(e===null||!e.fields)return null;const r=[];for(const t of e.fields)r.push(En(t));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField??"",geometryType:sn[e.geometryType]===void 0?"":sn[e.geometryType],fields:r}}function Me(n,e){return n==="system"&&(n=I.systemTimeZoneCanonicalName),{version:Zn,engineVersion:In,timeZone:n,spatialReference:e instanceof Rn?e.toJSON():e,application:wn.applicationName??"",engine:"web",locale:cn()}}const Zn="1.28",ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:Gn,ReturnResult:Bn,absRound:ee,arcadeVersion:Zn,autoCastArrayOfPointsToMultiPoint:pe,autoCastArrayOfPointsToPolygon:fe,autoCastArrayOfPointsToPolyline:de,autoCastFeatureToGeometry:ce,binaryOperator:ye,breakResult:Yn,castAsJson:_,castAsJsonAsync:Mn,continueResult:qn,defaultExecutingContext:Me,defaultTimeZone:Te,defaultUndefined:Hn,equalityTest:Cn,featureDomainCodeLookup:Ae,featureDomainValueLookup:Ce,featureFullDomain:Ne,featureSchema:Fe,featureSubtypes:Se,fixNullGeometry:le,fixSpatialReference:ue,formatDate:j,formatNumber:rn,getDomain:B,getDomainCode:Fn,getDomainValue:Tn,getType:Kn,greaterThanLessThan:re,isArray:C,isBoolean:b,isDate:f,isDateOnly:m,isDictionary:$n,isFeature:yn,isFeatureSet:gn,isFeatureSetCollection:bn,isFunctionParameter:J,isGeometry:Wn,isGraphic:Qn,isImmutableArray:Z,isInteger:Vn,isJsDate:P,isKnowledgeGraph:Nn,isModule:en,isNumber:N,isObject:q,isQuery:Xn,isSimpleType:L,isString:y,isSubtypeGrouplayer:be,isSubtypeSublayer:xn,isTime:h,multiReplace:w,parseGeometryFromJson:ie,pcCheck:ne,stableStringify:H,standardiseDateFormat:Sn,tick:he,toBoolean:se,toDate:ae,toNumber:d,toNumberArray:te,toString:x,toStringArray:me,toStringExplicit:An,voidOperation:g},Symbol.toStringTag,{value:"Module"}));export{Se as $,Me as A,_e as B,C,bn as D,L as E,Nn as F,nn as G,fn as H,Kn as I,ce as J,pe as K,se as L,x as M,we as N,Vn as O,ae as P,Ce as Q,Wn as R,N as S,T,J as U,re as V,Ne as W,Ae as X,fe as Y,Z,ee as _,$n as a,ye as a0,pn as a1,hn as a2,E as a3,Y as a4,Bn as a5,Yn as a6,qn as a7,Qn as a8,Gn as a9,ve as aa,Re as ab,R as ac,un as ad,he as ae,xn as af,me as ag,B as ah,Tn as ai,Fn as aj,P as ak,b,m as c,f as d,Te as e,d as f,Hn as g,h,Sn as i,le as j,O as k,g as l,Mn as m,o as n,Cn as o,de as p,w as q,gn as r,te as s,yn as t,An as u,_ as v,ne as w,Fe as x,y,ue as z}; diff --git a/main/assets/layerViewUtils-DURAPenP-BHbJhKE8.js b/main/assets/layerViewUtils-DURAPenP-BHbJhKE8.js deleted file mode 100644 index 18ec639ab..000000000 --- a/main/assets/layerViewUtils-DURAPenP-BHbJhKE8.js +++ /dev/null @@ -1 +0,0 @@ -import"./main-BZaw9FpY.js";function r(t){return t&&typeof t.highlight=="function"}function i(t,n,u){return t==null||t>=u&&(n===0||t<=n)}function a(t,n){if(n&&t){const{minScale:u,maxScale:e}=t;if(c(u,e))return i(n,u,e)}return!0}function c(t,n){return t!=null&&t>0||n!=null&&n>0}function o(t){return!t?.minScale||!t.maxScale||t.minScale>=t.maxScale}export{r as a,a as e,o as l}; diff --git a/main/assets/layerViewUtils-DURAPenP-Eay0s_jy.js b/main/assets/layerViewUtils-DURAPenP-Eay0s_jy.js new file mode 100644 index 000000000..08aedf62b --- /dev/null +++ b/main/assets/layerViewUtils-DURAPenP-Eay0s_jy.js @@ -0,0 +1 @@ +import"./main-C7yV2j71.js";function r(t){return t&&typeof t.highlight=="function"}function i(t,n,u){return t==null||t>=u&&(n===0||t<=n)}function a(t,n){if(n&&t){const{minScale:u,maxScale:e}=t;if(c(u,e))return i(n,u,e)}return!0}function c(t,n){return t!=null&&t>0||n!=null&&n>0}function o(t){return!t?.minScale||!t.maxScale||t.minScale>=t.maxScale}export{r as a,a as e,o as l}; diff --git a/main/assets/layersCreator-CW56kDKc-CK8sXxzK.js b/main/assets/layersCreator-CW56kDKc-CK8sXxzK.js new file mode 100644 index 000000000..4eb85107e --- /dev/null +++ b/main/assets/layersCreator-CW56kDKc-CK8sXxzK.js @@ -0,0 +1 @@ +import{ag as f}from"./main-C7yV2j71.js";import{L as M,e as A}from"./portalLayers-Bh9bAhk4-CIQyh8K9.js";import{p as n}from"./fetchService-DbaKmJhP-DPDp5i2e.js";import d from"./PortalItem-CctGdnxF-CHPkp6yW.js";import{g as b}from"./styleUtils-ChrJTYIw-OCRItq_6.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js";import"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";function w(e){return p(e,"notes")}function v(e){return p(e,"markup")}function h(e){return p(e,"route")}function p(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function C(e,r,y){if(!r)return;const a=r.map(t=>U(t,y)),i=await Promise.allSettled(a);for(const t of i)t.status==="rejected"||t.value&&e.add(t.value)}const F={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},W={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},O={ArcGISFeatureLayer:"FeatureLayer"},V={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},I={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},m={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},k={...I,LinkChartLayer:"LinkChartLayer"},B={...g},D={...m};async function U(e,r){return E(await x(e,r),e,r)}async function E(e,r,y){const a=new e;return a.read(r,y.context),a.type==="group"&&(r.layerType==="GroupLayer"?await K(a,r,y):u(r)?N(a,r,y.context):T(r)&&await $(a,r,y.context)),await b(a,y.context),a}async function x(e,r){const y=r.context,a=R(y);let i=e.layerType||e.type;!i&&r?.defaultLayerType&&(i=r.defaultLayerType);const t=a[i];let L=t?n[t]:n.UnknownLayer;if(u(e)){const l=y?.portal;if(e.itemId){const o=new d({id:e.itemId,portal:l});await o.load();const s=(await M(o,new A)).className||"UnknownLayer";L=n[s]}}else i==="ArcGISFeatureLayer"?w(e)||v(e)?L=n.MapNotesLayer:h(e)?L=n.RouteLayer:T(e)&&(L=n.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?L=n.WMTSLayer:i==="WFS"&&e.wfsInfo?.version!=="2.0.0"&&(L=n.UnsupportedLayer);return L()}function T(e){return e.layerType!=="ArcGISFeatureLayer"||u(e)?!1:(e.featureCollection?.layers?.length??0)>1}function u(e){return e.type==="Feature Collection"}function R(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=V;break;case"ground":r=W;break;case"tables":r=O;break;default:r=F}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=D;break;case"tables":r=B;break;default:r=k}break;default:switch(e.layerContainerType){case"basemap":r=m;break;case"tables":r=g;break;default:r=I}}return r}async function K(e,r,y){const a=new f,i=C(a,Array.isArray(r.layers)?r.layers:[],y);try{try{if(await i,e.type==="group")return e.layers.addMany(a),e}catch(t){e.destroy();for(const L of a)L.destroy();throw t}}catch(t){throw t}}function N(e,r,y){r.itemId&&(e.portalItem=new d({id:r.itemId,portal:y?.portal}),e.when(()=>{const a=i=>{const t=i.layerId;G(i,e,r,t,y);const L=r.featureCollection?.layers?.[t];L&&i.read(L,y)};e.layers?.forEach(a),e.tables?.forEach(a)}))}async function $(e,r,y){const a=n.FeatureLayer,i=await a(),t=r.featureCollection,L=t?.showLegend,l=t?.layers?.map((o,s)=>{const c=new i;c.read(o,y);const S={...y,ignoreDefaults:!0};return G(c,e,r,s,S),L!=null&&c.read({showLegend:L},S),c});e.layers.addMany(l??[])}function G(e,r,y,a,i){e.read({id:`${r.id}-sublayer-${a}`,visibility:y.visibleLayers?.includes(a)??!0},i)}export{K as populateGroupLayer,C as populateOperationalLayers}; diff --git a/main/assets/layersCreator-CW56kDKc-gpROgX1S.js b/main/assets/layersCreator-CW56kDKc-gpROgX1S.js deleted file mode 100644 index 7d7dd17e5..000000000 --- a/main/assets/layersCreator-CW56kDKc-gpROgX1S.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as f}from"./main-BZaw9FpY.js";import{L as M,e as A}from"./portalLayers-Bh9bAhk4-BaKPDASj.js";import{p as n}from"./fetchService-DbaKmJhP-CtznRt8p.js";import d from"./PortalItem-CctGdnxF-DNdsi_Qx.js";import{g as b}from"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js";import"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";function w(e){return p(e,"notes")}function v(e){return p(e,"markup")}function h(e){return p(e,"route")}function p(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function C(e,r,y){if(!r)return;const a=r.map(t=>U(t,y)),i=await Promise.allSettled(a);for(const t of i)t.status==="rejected"||t.value&&e.add(t.value)}const F={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},W={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},O={ArcGISFeatureLayer:"FeatureLayer"},V={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},I={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},m={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},k={...I,LinkChartLayer:"LinkChartLayer"},B={...g},D={...m};async function U(e,r){return E(await x(e,r),e,r)}async function E(e,r,y){const a=new e;return a.read(r,y.context),a.type==="group"&&(r.layerType==="GroupLayer"?await K(a,r,y):u(r)?N(a,r,y.context):T(r)&&await $(a,r,y.context)),await b(a,y.context),a}async function x(e,r){const y=r.context,a=R(y);let i=e.layerType||e.type;!i&&r?.defaultLayerType&&(i=r.defaultLayerType);const t=a[i];let L=t?n[t]:n.UnknownLayer;if(u(e)){const l=y?.portal;if(e.itemId){const o=new d({id:e.itemId,portal:l});await o.load();const s=(await M(o,new A)).className||"UnknownLayer";L=n[s]}}else i==="ArcGISFeatureLayer"?w(e)||v(e)?L=n.MapNotesLayer:h(e)?L=n.RouteLayer:T(e)&&(L=n.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?L=n.WMTSLayer:i==="WFS"&&e.wfsInfo?.version!=="2.0.0"&&(L=n.UnsupportedLayer);return L()}function T(e){return e.layerType!=="ArcGISFeatureLayer"||u(e)?!1:(e.featureCollection?.layers?.length??0)>1}function u(e){return e.type==="Feature Collection"}function R(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=V;break;case"ground":r=W;break;case"tables":r=O;break;default:r=F}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=D;break;case"tables":r=B;break;default:r=k}break;default:switch(e.layerContainerType){case"basemap":r=m;break;case"tables":r=g;break;default:r=I}}return r}async function K(e,r,y){const a=new f,i=C(a,Array.isArray(r.layers)?r.layers:[],y);try{try{if(await i,e.type==="group")return e.layers.addMany(a),e}catch(t){e.destroy();for(const L of a)L.destroy();throw t}}catch(t){throw t}}function N(e,r,y){r.itemId&&(e.portalItem=new d({id:r.itemId,portal:y?.portal}),e.when(()=>{const a=i=>{const t=i.layerId;G(i,e,r,t,y);const L=r.featureCollection?.layers?.[t];L&&i.read(L,y)};e.layers?.forEach(a),e.tables?.forEach(a)}))}async function $(e,r,y){const a=n.FeatureLayer,i=await a(),t=r.featureCollection,L=t?.showLegend,l=t?.layers?.map((o,s)=>{const c=new i;c.read(o,y);const S={...y,ignoreDefaults:!0};return G(c,e,r,s,S),L!=null&&c.read({showLegend:L},S),c});e.layers.addMany(l??[])}function G(e,r,y,a,i){e.read({id:`${r.id}-sublayer-${a}`,visibility:y.visibleLayers?.includes(a)??!0},i)}export{K as populateGroupLayer,C as populateOperationalLayers}; diff --git a/main/assets/layersLoader-CYI-LpLl-BMluujm4.js b/main/assets/layersLoader-CYI-LpLl-BMluujm4.js deleted file mode 100644 index b9556102f..000000000 --- a/main/assets/layersLoader-CYI-LpLl-BMluujm4.js +++ /dev/null @@ -1 +0,0 @@ -import{o as p,r as S}from"./main-BZaw9FpY.js";import{i as T}from"./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js";import{o as L,p as v,d as F}from"./fetchService-DbaKmJhP-CtznRt8p.js";import{l as y,a as $,o as M,u as m,t as f,c as P,n as x,i as D,e as w}from"./portalLayers-Bh9bAhk4-BaKPDASj.js";import{populateGroupLayer as G}from"./layersCreator-CW56kDKc-gpROgX1S.js";import{a as h}from"./jsonContext-BA8GHqVk-BMETb6sX.js";import{o as k}from"./portalItemUtils-B8bw6SAG-D-m1Z1Le.js";import{g as E}from"./styleUtils-ChrJTYIw-BBKqdQ_e.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-CRjEZXvt.js";import"./PortalItem-CctGdnxF-DNdsi_Qx.js";import"./projection-BA9M1R7d-DoNqITCd.js";import"./projectBuffer-CvCBvJ6W-BLRWD7oY.js";async function ne(t,a){const r=t.instance.portalItem;if(r?.id)return await r.load(a),O(t),t.validateItem&&t.validateItem(r),R(t,a)}function O(t){const a=t.instance.portalItem;if(!a?.type||!t.supportedTypes.includes(a.type))throw new p("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a?.type,expectedType:t.supportedTypes.join(", ")})}async function R(t,a){const r=t.instance,e=r.portalItem;if(!e)return;const{url:o,title:s}=e,n=h(e,"portal-item");if(r.type==="group")return j(r,n,t);o&&r.type!=="media"&&r.read({url:o},n);const l=new w,i=await I(t,l,a);return i&&r.read(i,n),r.resourceReferences={portalItem:e,paths:n.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:s},n),E(r,n)}async function j(t,a,r){const e=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:o,type:s}=e;if(s==="Group Layer"){if(!k(e,"Map"))throw new p("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return A(t)}return t.read({title:o},a),C(t,r)}async function A(t){const a=t.portalItem,r=await a.fetchData("json");if(!r)return;const e=h(a,"web-map");t.read(r,e),await G(t,r,{context:e}),t.resourceReferences={portalItem:a,paths:e.readResourcePaths??[]}}async function C(t,a){let r;const{portalItem:e}=t;if(!e)return;const o=e.type,s=a.layerModuleTypeMap;switch(o){case"Feature Service":case"Feature Collection":r=s.FeatureLayer;break;case"Stream Service":r=s.StreamLayer;break;case"Scene Service":r=s.SceneLayer;break;default:throw new p("portal:unsupported-item-type-as-group",`The item type '${o}' is not supported as a 'IGroupLayer'`)}const n=new w;let[l,i]=await Promise.all([r(),I(a,n)]),c=()=>l;if(o==="Feature Service"){const g=y(i)?.customParameters;i=e.url?await $(i,e.url,n):{},c=await K(i,s)||c;const b=await H(e.url,{customParameters:g,loadContext:n});return await u(t,c,i,b)}return o==="Scene Service"&&e.url&&(i=await M(e,i,n)),m(i)>0?await u(t,c,i):await J(t,c)}async function J(t,a){const{portalItem:r}=t;if(!r?.url)return;const e=await L(r.url);e&&u(t,a,{layers:e.layers?.map(f),tables:e.tables?.map(f)})}async function u(t,a,r,e){let o=r.layers||[];const s=r.tables||[];if(t.portalItem?.type==="Feature Collection"?(o.forEach((n,l)=>{n.id=l,n?.layerDefinition?.type==="Table"&&s.push(n)}),o=o.filter(n=>n?.layerDefinition?.type!=="Table")):(o.reverse(),s.reverse()),o.forEach(n=>{const l=e?.(n);if(l||!e){const i=d(t,a(n),r,n,l);t.add(i)}}),s.length){const n=await v.FeatureLayer();s.forEach(l=>{const i=e?.(l);if(i||!e){const c=d(t,n,r,l,i);t.tables.add(c)}})}}function d(t,a,r,e,o){const s=t.portalItem,n={portalItem:s.clone(),layerId:e.id};e.url!=null&&(n.url=e.url);const l=new a(n);if("sourceJSON"in l&&(l.sourceJSON=o),l.type!=="subtype-group"&&l.type!=="catalog"&&(l.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const i={origin:"portal-item",portal:s.portal||S.getDefault()};l.read(e,i);const c=r.showLegend;c!=null&&l.read({showLegend:c},i)}return l}async function I(t,a,r){if(t.supportsData===!1)return;const e=t.instance,o=e.portalItem;if(!o)return;let s=null;try{s=await o.fetchData("json",r)}catch{}if(z(e)){let n=null;const l=await N(o,s,a);if((s?.layers||s?.tables)&&l>0){if(e.layerId==null){const i=P(e.type),c=i?x(s,i)[0]:y(s);c&&(e.layerId=c.id)}n=q(s,e),n?.layerType==="OrientedImageryLayer"&&e.type==="oriented-imagery"&&e.supportedSourceTypes.add("Feature Layer"),n&&s.showLegend!=null&&(n.showLegend=s.showLegend)}return l>1&&"sublayerTitleMode"in e&&e.sublayerTitleMode!=="service-name"&&(e.sublayerTitleMode="item-title-and-service-name"),n}return s}async function N(t,a,r){if(a?.layers&&a?.tables)return m(a);const e=T(t.url);if(!e)return 1;const o=await r.fetchServiceMetadata(e.url.path,{customParameters:y(a)?.customParameters}).catch(()=>null);return(a?.layers?.length??o?.layers?.length??0)+(a?.tables?.length??o?.tables?.length??0)}function q(t,a){const{layerId:r}=a,e=t.layers?.find(o=>o.id===r)||t.tables?.find(o=>o.id===r);return e&&B(e,a)?e:null}function z(t){return t.type!=="stream"&&"layerId"in t}function B(t,a){const r="layerType"in t&&t.layerType,{type:e}=a;return!(e==="feature"&&r&&t.layerType!=="ArcGISFeatureLayer"||e==="catalog"&&!r||e==="oriented-imagery"&&!r||e==="subtype-group"&&!r)}async function H(t,a){const{layersJSON:r}=await F(t,a);if(!r)return null;const e=[...r.layers,...r.tables];return o=>e.find(s=>s.id===o.id)}async function K(t,a){const{layers:r}=t;if(!r?.length)return;const e=new Set,o=[];for(const{layerType:l}of r){const i=l??"ArcGISFeatureLayer";if(e.has(i))continue;e.add(i);const c=a[D(i)];o.push(c())}const s=await Promise.all(o),n=new Map;return Array.from(e).forEach((l,i)=>{n.set(l,s[i])}),({layerType:l})=>{const i=l??"ArcGISFeatureLayer";return n.get(i)}}export{ne as load}; diff --git a/main/assets/layersLoader-CYI-LpLl-Bjk1FanA.js b/main/assets/layersLoader-CYI-LpLl-Bjk1FanA.js new file mode 100644 index 000000000..88caf0fc8 --- /dev/null +++ b/main/assets/layersLoader-CYI-LpLl-Bjk1FanA.js @@ -0,0 +1 @@ +import{o as p,r as S}from"./main-C7yV2j71.js";import{i as T}from"./arcgisLayerUrl-HNYh8jvG-CFz5Q-vD.js";import{o as L,p as v,d as F}from"./fetchService-DbaKmJhP-DPDp5i2e.js";import{l as y,a as $,o as M,u as m,t as f,c as P,n as x,i as D,e as w}from"./portalLayers-Bh9bAhk4-CIQyh8K9.js";import{populateGroupLayer as G}from"./layersCreator-CW56kDKc-CK8sXxzK.js";import{a as h}from"./jsonContext-BA8GHqVk-DpBf0bCt.js";import{o as k}from"./portalItemUtils-B8bw6SAG-DNmyZ8kw.js";import{g as E}from"./styleUtils-ChrJTYIw-OCRItq_6.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-BaRaUid8.js";import"./PortalItem-CctGdnxF-CHPkp6yW.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";async function ne(t,a){const r=t.instance.portalItem;if(r?.id)return await r.load(a),O(t),t.validateItem&&t.validateItem(r),R(t,a)}function O(t){const a=t.instance.portalItem;if(!a?.type||!t.supportedTypes.includes(a.type))throw new p("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a?.type,expectedType:t.supportedTypes.join(", ")})}async function R(t,a){const r=t.instance,e=r.portalItem;if(!e)return;const{url:o,title:s}=e,n=h(e,"portal-item");if(r.type==="group")return j(r,n,t);o&&r.type!=="media"&&r.read({url:o},n);const l=new w,i=await I(t,l,a);return i&&r.read(i,n),r.resourceReferences={portalItem:e,paths:n.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:s},n),E(r,n)}async function j(t,a,r){const e=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:o,type:s}=e;if(s==="Group Layer"){if(!k(e,"Map"))throw new p("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return A(t)}return t.read({title:o},a),C(t,r)}async function A(t){const a=t.portalItem,r=await a.fetchData("json");if(!r)return;const e=h(a,"web-map");t.read(r,e),await G(t,r,{context:e}),t.resourceReferences={portalItem:a,paths:e.readResourcePaths??[]}}async function C(t,a){let r;const{portalItem:e}=t;if(!e)return;const o=e.type,s=a.layerModuleTypeMap;switch(o){case"Feature Service":case"Feature Collection":r=s.FeatureLayer;break;case"Stream Service":r=s.StreamLayer;break;case"Scene Service":r=s.SceneLayer;break;default:throw new p("portal:unsupported-item-type-as-group",`The item type '${o}' is not supported as a 'IGroupLayer'`)}const n=new w;let[l,i]=await Promise.all([r(),I(a,n)]),c=()=>l;if(o==="Feature Service"){const g=y(i)?.customParameters;i=e.url?await $(i,e.url,n):{},c=await K(i,s)||c;const b=await H(e.url,{customParameters:g,loadContext:n});return await u(t,c,i,b)}return o==="Scene Service"&&e.url&&(i=await M(e,i,n)),m(i)>0?await u(t,c,i):await J(t,c)}async function J(t,a){const{portalItem:r}=t;if(!r?.url)return;const e=await L(r.url);e&&u(t,a,{layers:e.layers?.map(f),tables:e.tables?.map(f)})}async function u(t,a,r,e){let o=r.layers||[];const s=r.tables||[];if(t.portalItem?.type==="Feature Collection"?(o.forEach((n,l)=>{n.id=l,n?.layerDefinition?.type==="Table"&&s.push(n)}),o=o.filter(n=>n?.layerDefinition?.type!=="Table")):(o.reverse(),s.reverse()),o.forEach(n=>{const l=e?.(n);if(l||!e){const i=d(t,a(n),r,n,l);t.add(i)}}),s.length){const n=await v.FeatureLayer();s.forEach(l=>{const i=e?.(l);if(i||!e){const c=d(t,n,r,l,i);t.tables.add(c)}})}}function d(t,a,r,e,o){const s=t.portalItem,n={portalItem:s.clone(),layerId:e.id};e.url!=null&&(n.url=e.url);const l=new a(n);if("sourceJSON"in l&&(l.sourceJSON=o),l.type!=="subtype-group"&&l.type!=="catalog"&&(l.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const i={origin:"portal-item",portal:s.portal||S.getDefault()};l.read(e,i);const c=r.showLegend;c!=null&&l.read({showLegend:c},i)}return l}async function I(t,a,r){if(t.supportsData===!1)return;const e=t.instance,o=e.portalItem;if(!o)return;let s=null;try{s=await o.fetchData("json",r)}catch{}if(z(e)){let n=null;const l=await N(o,s,a);if((s?.layers||s?.tables)&&l>0){if(e.layerId==null){const i=P(e.type),c=i?x(s,i)[0]:y(s);c&&(e.layerId=c.id)}n=q(s,e),n?.layerType==="OrientedImageryLayer"&&e.type==="oriented-imagery"&&e.supportedSourceTypes.add("Feature Layer"),n&&s.showLegend!=null&&(n.showLegend=s.showLegend)}return l>1&&"sublayerTitleMode"in e&&e.sublayerTitleMode!=="service-name"&&(e.sublayerTitleMode="item-title-and-service-name"),n}return s}async function N(t,a,r){if(a?.layers&&a?.tables)return m(a);const e=T(t.url);if(!e)return 1;const o=await r.fetchServiceMetadata(e.url.path,{customParameters:y(a)?.customParameters}).catch(()=>null);return(a?.layers?.length??o?.layers?.length??0)+(a?.tables?.length??o?.tables?.length??0)}function q(t,a){const{layerId:r}=a,e=t.layers?.find(o=>o.id===r)||t.tables?.find(o=>o.id===r);return e&&B(e,a)?e:null}function z(t){return t.type!=="stream"&&"layerId"in t}function B(t,a){const r="layerType"in t&&t.layerType,{type:e}=a;return!(e==="feature"&&r&&t.layerType!=="ArcGISFeatureLayer"||e==="catalog"&&!r||e==="oriented-imagery"&&!r||e==="subtype-group"&&!r)}async function H(t,a){const{layersJSON:r}=await F(t,a);if(!r)return null;const e=[...r.layers,...r.tables];return o=>e.find(s=>s.id===o.id)}async function K(t,a){const{layers:r}=t;if(!r?.length)return;const e=new Set,o=[];for(const{layerType:l}of r){const i=l??"ArcGISFeatureLayer";if(e.has(i))continue;e.add(i);const c=a[D(i)];o.push(c())}const s=await Promise.all(o),n=new Map;return Array.from(e).forEach((l,i)=>{n.set(l,s[i])}),({layerType:l})=>{const i=l??"ArcGISFeatureLayer";return n.get(i)}}export{ne as load}; diff --git a/main/assets/lengthUtils-DKpMe5qR-CD-2dB4t.js b/main/assets/lengthUtils-DKpMe5qR-CD-2dB4t.js deleted file mode 100644 index f1a1ba357..000000000 --- a/main/assets/lengthUtils-DKpMe5qR-CD-2dB4t.js +++ /dev/null @@ -1 +0,0 @@ -import{dW as e,dX as s,dY as t}from"./main-BZaw9FpY.js";const r={unknown:1,inches:e(1,"meters","inches"),feet:e(1,"meters","feet"),"us-feet":e(1,"meters","us-feet"),yards:e(1,"meters","yards"),miles:e(1,"meters","miles"),"nautical-miles":e(1,"meters","nautical-miles"),millimeters:e(1,"meters","millimeters"),centimeters:e(1,"meters","centimeters"),decimeters:e(1,"meters","decimeters"),meters:e(1,"meters","meters"),kilometers:e(1,"meters","kilometers"),"decimal-degrees":1/s(1,"meters",t.radius)};export{r as m}; diff --git a/main/assets/lengthUtils-DKpMe5qR-E2FfnN85.js b/main/assets/lengthUtils-DKpMe5qR-E2FfnN85.js new file mode 100644 index 000000000..3c273abcf --- /dev/null +++ b/main/assets/lengthUtils-DKpMe5qR-E2FfnN85.js @@ -0,0 +1 @@ +import{dW as e,dX as s,dY as t}from"./main-C7yV2j71.js";const r={unknown:1,inches:e(1,"meters","inches"),feet:e(1,"meters","feet"),"us-feet":e(1,"meters","us-feet"),yards:e(1,"meters","yards"),miles:e(1,"meters","miles"),"nautical-miles":e(1,"meters","nautical-miles"),millimeters:e(1,"meters","millimeters"),centimeters:e(1,"meters","centimeters"),decimeters:e(1,"meters","decimeters"),meters:e(1,"meters","meters"),kilometers:e(1,"meters","kilometers"),"decimal-degrees":1/s(1,"meters",t.radius)};export{r as m}; diff --git a/main/assets/lineSegment-CcqvCARM-D_SdPttv.js b/main/assets/lineSegment-CcqvCARM-D_SdPttv.js deleted file mode 100644 index 9ef4f62f2..000000000 --- a/main/assets/lineSegment-CcqvCARM-D_SdPttv.js +++ /dev/null @@ -1 +0,0 @@ -import{i8 as v,dU as m,ae as a}from"./main-BZaw9FpY.js";import{X as y}from"./sphere-BenPORjV-CgNvGf8s.js";import{r as u,y as c,L as s,v as d,j as A,A as q}from"./vec32-D9GsKZ1t-D4J2Sth6.js";import{f as g}from"./plane-Dt8R0KeE-fuXvBrPY.js";function p(o){return o?{origin:v(o.origin),vector:v(o.vector)}:{origin:m(),vector:m()}}function X(o,r,t=p()){return q(t.origin,o),u(t.vector,r,o),t}function b(o,r){const t=u(g.get(),r,o.origin),f=c(o.vector,t),i=c(o.vector,o.vector),n=a(f/i,0,1),e=u(g.get(),s(g.get(),o.vector,n),t);return c(e,e)}function h(o,r,t){return w(o,r,0,1,t)}function w(o,r,t,f,i){const{vector:n,origin:e}=o,j=u(g.get(),r,e),x=c(n,j)/d(n);return s(i,n,a(x,t,f)),A(i,i,o.origin)}new y(()=>p());export{w as j,X as q,p as u,b as x,h as y}; diff --git a/main/assets/lineSegment-CcqvCARM-_ZNy9SM-.js b/main/assets/lineSegment-CcqvCARM-_ZNy9SM-.js new file mode 100644 index 000000000..9668718d2 --- /dev/null +++ b/main/assets/lineSegment-CcqvCARM-_ZNy9SM-.js @@ -0,0 +1 @@ +import{i8 as v,dU as m,ae as a}from"./main-C7yV2j71.js";import{X as y}from"./sphere-BenPORjV-CiIWUavi.js";import{r as u,y as c,L as s,v as d,j as A,A as q}from"./vec32-D9GsKZ1t-CXe4l2D-.js";import{f as g}from"./plane-Dt8R0KeE-CdQQbSdq.js";function p(o){return o?{origin:v(o.origin),vector:v(o.vector)}:{origin:m(),vector:m()}}function X(o,r,t=p()){return q(t.origin,o),u(t.vector,r,o),t}function b(o,r){const t=u(g.get(),r,o.origin),f=c(o.vector,t),i=c(o.vector,o.vector),n=a(f/i,0,1),e=u(g.get(),s(g.get(),o.vector,n),t);return c(e,e)}function h(o,r,t){return w(o,r,0,1,t)}function w(o,r,t,f,i){const{vector:n,origin:e}=o,j=u(g.get(),r,e),x=c(n,j)/d(n);return s(i,n,a(x,t,f)),A(i,i,o.origin)}new y(()=>p());export{w as j,X as q,p as u,b as x,h as y}; diff --git a/main/assets/loadAll-e978YItg-CB-7_cng.js b/main/assets/loadAll-e978YItg-CB-7_cng.js deleted file mode 100644 index 69b13e5a6..000000000 --- a/main/assets/loadAll-e978YItg-CB-7_cng.js +++ /dev/null @@ -1 +0,0 @@ -import{dd as c,ag as e,aB as f,b6 as u}from"./main-BZaw9FpY.js";async function p(n,t){return await n.load(),d(n,t)}async function d(n,t){const i=[],l=(...o)=>{for(const a of o)a!=null&&(Array.isArray(a)?l(...a):e.isCollection(a)?a.forEach(s=>l(s)):f.isLoadable(a)&&i.push(a))};t(l);let r=null;if(await c(i,async o=>{const a=await u(y(o)?o.loadAll():o.load());a.ok!==!1||r||(r=a)}),r)throw r.error;return n}function y(n){return"loadAll"in n&&typeof n.loadAll=="function"}export{d as s,p as y}; diff --git a/main/assets/loadAll-e978YItg-NjG3VBGi.js b/main/assets/loadAll-e978YItg-NjG3VBGi.js new file mode 100644 index 000000000..5877ee339 --- /dev/null +++ b/main/assets/loadAll-e978YItg-NjG3VBGi.js @@ -0,0 +1 @@ +import{dd as c,ag as e,aB as f,b6 as u}from"./main-C7yV2j71.js";async function p(n,t){return await n.load(),d(n,t)}async function d(n,t){const i=[],l=(...o)=>{for(const a of o)a!=null&&(Array.isArray(a)?l(...a):e.isCollection(a)?a.forEach(s=>l(s)):f.isLoadable(a)&&i.push(a))};t(l);let r=null;if(await c(i,async o=>{const a=await u(y(o)?o.loadAll():o.load());a.ok!==!1||r||(r=a)}),r)throw r.error;return n}function y(n){return"loadAll"in n&&typeof n.loadAll=="function"}export{d as s,p as y}; diff --git a/main/assets/loadGLTFMesh-C3-0Tu0H-BMXr1y1a.js b/main/assets/loadGLTFMesh-C3-0Tu0H-BMXr1y1a.js new file mode 100644 index 000000000..6275c89ad --- /dev/null +++ b/main/assets/loadGLTFMesh-C3-0Tu0H-BMXr1y1a.js @@ -0,0 +1,8 @@ +import{o as G,f as P,an as j,ar as C,hf as R,hZ as L,B as U}from"./main-C7yV2j71.js";import{U as z,P as k}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as S}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{e as D}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{G as V,m as q,z as N,V as K}from"./Mesh-DLzjDUIO-B17ONcIN.js";import{o as Q}from"./MeshVertexAttributes-CbNpPur2-CbtcTs9d.js";import{x as $}from"./meshVertexSpaceUtils-B4l_Zo0M-BWuHzD91.js";import{X as F,L as I,C as X,g as A,l as O,M as Z,m as H,p as J}from"./BufferView-PQoE3GL7-M6q1od-Y.js";import{q as W,v as Y,R as tt,x as E}from"./vec3-BazNroeq-Cdhfm-VN.js";import{T as et,k as rt,A as M}from"./vec4-DWDdg1fj-DGtcegeJ.js";import{c as ot}from"./types-ChhhI6OU-Cxh6dPlX.js";import{loadGLTF as nt}from"./loader-CkLCe-E_-Cx46HvSP.js";import{U as st,E as it,h as at,g as b,m as lt,_ as ut,b as ct,B as ft,k as mt}from"./DefaultMaterial_COLOR_GAMMA-D0o2czi9-zo16r_JO.js";import{b as pt}from"./vertexSpaceConversion-CiKaVq_u-DYnKklm9.js";import{f as dt}from"./resourceUtils-Ds65naCv-DTjz-__I.js";import{G as v}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./MeshTransform-C--IG09w-QYZk68_K.js";import"./mat4-DX7gBViE-vewreEuZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Dbd8ftOx.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./imageUtils-BA2D6Uf1-DyozB2y5.js";import"./MeshLocalVertexSpace-BqgocsoS-Ljo7TpqL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Cd6y9wum.js";import"./plane-Dt8R0KeE-CdQQbSdq.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-eujRBTUy.js";import"./projectPointToVector-B2UUY9SE-BWg0qYG-.js";import"./projection-BA9M1R7d-DXrPfsKU.js";import"./projectBuffer-CvCBvJ6W-D_Mlrmjj.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DQ4pTUWY.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-D_fiql5f.js";import"./External-D_wl4XAw-Bzqlxz38.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Version-CoKzbupV-BKAqCewj.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function xt(t,e,r){const l=t.typedBuffer,n=t.typedBufferStride,i=e.typedBuffer,c=e.typedBufferStride,a=r?r.count:e.count;let s=(r?.dstIndex??0)*n,m=(r?.srcIndex??0)*c;for(let u=0;uc.set(h,bt(g))),n.materials.forEach((g,h)=>a.set(h,vt(g,c)));const s=ht(i);for(const g of s.parts)wt(s,g,a);const{position:m,normal:u,tangent:o,color:f,texCoord0:p}=s.vertexAttributes,d=$(t,r),w=t.spatialReference.isGeographic?$(t):d,B=pt({vertexAttributes:{position:m.typedBuffer,normal:u?.typedBuffer,tangent:o?.typedBuffer},vertexSpace:w,spatialReference:t.spatialReference},d,{allowBufferReuse:!0,sourceUnit:r?.unitConversionDisabled?void 0:"meters"});if(!B)throw new G("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${w.type} to ${d.type}`);return{transform:null,vertexSpace:d,components:s.components,spatialReference:t.spatialReference,vertexAttributes:new Q({...B,color:f?.typedBuffer,uv:p?.typedBuffer})}}function yt(t){const e=t?.resolveFile;return e?{busy:!1,request:async(r,l,n)=>{const i=e?.(r)??r;return(await P(i,{responseType:l==="image"?"image":l==="binary"||l==="image+type"?"array-buffer":"json",signal:n?.signal,timeout:0})).data}}:null}function T(t,e){if(t==null)return"-";const r=t.typedBuffer;return`${j(e,r.buffer,()=>e.size)}/${r.byteOffset}/${r.byteLength}`}function Tt(t){return t!=null?t.toString():"-"}function ht(t){let e=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},l=new Map,n=new Map,i=[];for(const c of t.parts){const{attributes:{position:a,normal:s,color:m,tangent:u,texCoord0:o}}=c,f=` + ${T(a,l)}/ + ${T(s,l)}/ + ${T(m,l)}/ + ${T(u,l)}/ + ${T(o,l)}/ + ${Tt(c.transform)} + `;let p=!1;const d=j(n,f,()=>(p=!0,{start:e,length:a.count}));p&&(e+=a.count),s&&(r.normal=!0),m&&(r.color=!0),u&&(r.tangent=!0),o&&(r.texCoord0=!0),i.push({gltf:c,writeVertices:p,region:d})}return{vertexAttributes:{position:y(H,e),normal:r.normal?y(O,e):null,tangent:r.tangent?y(F,e):null,color:r.color?y(I,e):null,texCoord0:r.texCoord0?y(J,e):null},parts:i,components:[]}}function bt(t){return new V({data:(dt(t.data),t.data),wrap:Rt(t.parameters.wrap)})}function vt(t,e){const r=new C(St(t.color,t.opacity)),l=t.emissiveFactor?new C($t(t.emissiveFactor)):null,n=i=>i?new K({scale:i.scale?[i.scale[0],i.scale[1]]:[1,1],rotation:U(i.rotation??0),offset:i.offset?[i.offset[0],i.offset[1]]:[0,0]}):null;return new q({color:r,colorTexture:e.get(t.textureColor),normalTexture:e.get(t.textureNormal),emissiveColor:l,emissiveTexture:e.get(t.textureEmissive),occlusionTexture:e.get(t.textureOcclusion),alphaMode:Ct(t.alphaMode),alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,metallic:t.metallicFactor,roughness:t.roughnessFactor,metallicRoughnessTexture:e.get(t.textureMetallicRoughness),colorTextureTransform:n(t.colorTextureTransform),normalTextureTransform:n(t.normalTextureTransform),occlusionTextureTransform:n(t.occlusionTextureTransform),emissiveTextureTransform:n(t.emissiveTextureTransform),metallicRoughnessTextureTransform:n(t.metallicRoughnessTextureTransform)})}function wt(t,e,r){e.writeVertices&&Bt(t,e);const{indices:l,attributes:n,primitiveType:i,material:c}=e.gltf;let a=it(l||n.position.count,i);const s=e.region.start;if(s){const m=new Uint32Array(a);for(let u=0;uc.set(h,bt(g))),n.materials.forEach((g,h)=>a.set(h,vt(g,c)));const s=ht(i);for(const g of s.parts)wt(s,g,a);const{position:m,normal:u,tangent:o,color:f,texCoord0:p}=s.vertexAttributes,d=$(t,r),w=t.spatialReference.isGeographic?$(t):d,B=pt({vertexAttributes:{position:m.typedBuffer,normal:u?.typedBuffer,tangent:o?.typedBuffer},vertexSpace:w,spatialReference:t.spatialReference},d,{allowBufferReuse:!0,sourceUnit:r?.unitConversionDisabled?void 0:"meters"});if(!B)throw new G("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${w.type} to ${d.type}`);return{transform:null,vertexSpace:d,components:s.components,spatialReference:t.spatialReference,vertexAttributes:new Q({...B,color:f?.typedBuffer,uv:p?.typedBuffer})}}function yt(t){const e=t?.resolveFile;return e?{busy:!1,request:async(r,l,n)=>{const i=e?.(r)??r;return(await P(i,{responseType:l==="image"?"image":l==="binary"||l==="image+type"?"array-buffer":"json",signal:n?.signal,timeout:0})).data}}:null}function T(t,e){if(t==null)return"-";const r=t.typedBuffer;return`${j(e,r.buffer,()=>e.size)}/${r.byteOffset}/${r.byteLength}`}function Tt(t){return t!=null?t.toString():"-"}function ht(t){let e=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},l=new Map,n=new Map,i=[];for(const c of t.parts){const{attributes:{position:a,normal:s,color:m,tangent:u,texCoord0:o}}=c,f=` - ${T(a,l)}/ - ${T(s,l)}/ - ${T(m,l)}/ - ${T(u,l)}/ - ${T(o,l)}/ - ${Tt(c.transform)} - `;let p=!1;const d=j(n,f,()=>(p=!0,{start:e,length:a.count}));p&&(e+=a.count),s&&(r.normal=!0),m&&(r.color=!0),u&&(r.tangent=!0),o&&(r.texCoord0=!0),i.push({gltf:c,writeVertices:p,region:d})}return{vertexAttributes:{position:y(H,e),normal:r.normal?y(O,e):null,tangent:r.tangent?y(F,e):null,color:r.color?y(I,e):null,texCoord0:r.texCoord0?y(J,e):null},parts:i,components:[]}}function bt(t){return new V({data:(dt(t.data),t.data),wrap:Rt(t.parameters.wrap)})}function vt(t,e){const r=new C(St(t.color,t.opacity)),l=t.emissiveFactor?new C($t(t.emissiveFactor)):null,n=i=>i?new K({scale:i.scale?[i.scale[0],i.scale[1]]:[1,1],rotation:U(i.rotation??0),offset:i.offset?[i.offset[0],i.offset[1]]:[0,0]}):null;return new q({color:r,colorTexture:e.get(t.textureColor),normalTexture:e.get(t.textureNormal),emissiveColor:l,emissiveTexture:e.get(t.textureEmissive),occlusionTexture:e.get(t.textureOcclusion),alphaMode:Ct(t.alphaMode),alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,metallic:t.metallicFactor,roughness:t.roughnessFactor,metallicRoughnessTexture:e.get(t.textureMetallicRoughness),colorTextureTransform:n(t.colorTextureTransform),normalTextureTransform:n(t.normalTextureTransform),occlusionTextureTransform:n(t.occlusionTextureTransform),emissiveTextureTransform:n(t.emissiveTextureTransform),metallicRoughnessTextureTransform:n(t.metallicRoughnessTextureTransform)})}function wt(t,e,r){e.writeVertices&&Bt(t,e);const{indices:l,attributes:n,primitiveType:i,material:c}=e.gltf;let a=it(l||n.position.count,i);const s=e.region.start;if(s){const m=new Uint32Array(a);for(let u=0;ut.set(e,n)))}function f(e){t.get(e)()}function o(e){return r.get(e)}async function u(e){if(await o(e),!!a())return i(e),new Promise(n=>requestAnimationFrame(()=>n()))}export{u as f,s as o,f as r}; diff --git a/main/assets/loadable-DbNDKH4r-YgUDHAtn.js b/main/assets/loadable-DbNDKH4r-YgUDHAtn.js new file mode 100644 index 000000000..9989f2fa9 --- /dev/null +++ b/main/assets/loadable-DbNDKH4r-YgUDHAtn.js @@ -0,0 +1 @@ +import{c as a,n as i}from"./themeUtils-YjM7iIiX-J3djxNmP.js";const t=new WeakMap,r=new WeakMap;function s(e){r.set(e,new Promise(n=>t.set(e,n)))}function f(e){t.get(e)()}function o(e){return r.get(e)}async function u(e){if(await o(e),!!a())return i(e),new Promise(n=>requestAnimationFrame(()=>n()))}export{u as f,s as o,f as r}; diff --git a/main/assets/loader-Ch7Jr16w-BlGvYEIO.js b/main/assets/loader-Ch7Jr16w-BlGvYEIO.js new file mode 100644 index 000000000..a0fe96edf --- /dev/null +++ b/main/assets/loader-Ch7Jr16w-BlGvYEIO.js @@ -0,0 +1 @@ +import{p as z,b as _,a,D as x}from"./themeUtils-YjM7iIiX-J3djxNmP.js";import{i as w}from"./guid-Dls486Er-CBh637k4.js";import{K as P,q as C}from"./locale-Cn_GDVD_-DrOI-_a9.js";const t={loader:"loader",loaderParts:"loader__svgs",loaderPart:"loader__svg",loaderPartId:e=>`${t.loaderPart}--${e}`,loaderText:"loader__text",loaderPercentage:"loader__percentage"},$='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-color-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem);will-change:contents}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--3);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem;--calcite-internal-loader-value-line-height:0.625rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem;--calcite-internal-loader-value-line-height:1.375rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem;--calcite-internal-loader-value-line-height:1.71875rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{display:block;text-align:center;color:var(--calcite-color-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);line-height:var(--calcite-internal-loader-value-line-height);align-self:center}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise;display:flex}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}:host([type=determinate]),:host([type=determinate-value]){animation:none;stroke:var(--calcite-color-border-3)}:host([type=determinate]) .loader__svgs,:host([type=determinate-value]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3,:host([type=determinate-value]) .loader__svg--3{animation:none;stroke:var(--calcite-color-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-color-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-color-brand)}33%{stroke:var(--calcite-color-brand-press)}66%{stroke:var(--calcite-color-brand-hover)}100%{stroke:var(--calcite-color-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',H=$,L=z(class extends _{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.formatValue=()=>this.type!=="determinate-value"?`${this.value}`:this.formatter.format(this.value/100),this.complete=!1,this.inline=!1,this.label=void 0,this.scale="m",this.type="indeterminate",this.value=0,this.text="",this.effectiveLocale=""}valueChangeHandler(){this.complete=this.type.startsWith("determinate")&&this.value===100}connectedCallback(){P(this),this.updateFormatter()}disconnectedCallback(){C(this)}componentWillLoad(){requestAnimationFrame(()=>this.valueChangeHandler())}render(){const{el:e,inline:f,label:v,scale:n,text:l,type:h,value:s}=this,g=e.id||w(),u=.45,i=f?this.getInlineSize(n):this.getSize(n),c=i*u,p=`0 0 ${i} ${i}`,r=h.startsWith("determinate"),d=2*c*Math.PI,m=s/100*d,k=d-m,y=Math.floor(s),b={"stroke-dasharray":`${m} ${k}`};return a(x,{key:"8272bdfae9fff51b19ed8fa66197eb93b53feb4c","aria-label":v,"aria-valuemax":r?"100":void 0,"aria-valuemin":r?"0":void 0,"aria-valuenow":r?y.toString():void 0,id:g,role:"progressbar"},a("div",{key:"3d410c178af39bb57cc478bdd06c0392f6ba71a3",class:t.loaderParts},[1,2,3].map(o=>a("svg",{"aria-hidden":"true",class:{[t.loaderPart]:!0,[t.loaderPartId(o)]:!0},key:o,style:r&&o===3?b:void 0,viewBox:p},a("circle",{cx:i/2,cy:i/2,r:c}))),r&&a("div",{key:"4ccc633930dee031bf769908d712df39e0677bbb",class:t.loaderPercentage},this.formatValue())),l&&a("div",{key:"6d0d51988bdfafee2a19faed9e14d3bda06d79b5",class:t.loaderText},l))}formatterPropsChange(){this.updateFormatter()}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}updateFormatter(){this.type!=="determinate-value"||this.formatter?.resolvedOptions().locale===this.effectiveLocale||(this.formatter=new Intl.NumberFormat(this.effectiveLocale,{style:"percent"}))}get el(){return this}static get watchers(){return{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}}static get style(){return H}},[1,"calcite-loader",{complete:[1540],inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1],effectiveLocale:[32]},void 0,{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}]);function S(){typeof customElements>"u"||["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,L);break}})}S();export{L as f,S as v}; diff --git a/main/assets/loader-Ch7Jr16w-ztJ2p2Gj.js b/main/assets/loader-Ch7Jr16w-ztJ2p2Gj.js deleted file mode 100644 index 1a5374ed5..000000000 --- a/main/assets/loader-Ch7Jr16w-ztJ2p2Gj.js +++ /dev/null @@ -1 +0,0 @@ -import{p as z,b as _,a,D as x}from"./themeUtils-YjM7iIiX-xQe6qdbF.js";import{i as w}from"./guid-Dls486Er-CBh637k4.js";import{K as P,q as C}from"./locale-Cn_GDVD_-CiwD7jxT.js";const t={loader:"loader",loaderParts:"loader__svgs",loaderPart:"loader__svg",loaderPartId:e=>`${t.loaderPart}--${e}`,loaderText:"loader__text",loaderPercentage:"loader__percentage"},$='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-color-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem);will-change:contents}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--3);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem;--calcite-internal-loader-value-line-height:0.625rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem;--calcite-internal-loader-value-line-height:1.375rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem;--calcite-internal-loader-value-line-height:1.71875rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{display:block;text-align:center;color:var(--calcite-color-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);line-height:var(--calcite-internal-loader-value-line-height);align-self:center}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise;display:flex}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}:host([type=determinate]),:host([type=determinate-value]){animation:none;stroke:var(--calcite-color-border-3)}:host([type=determinate]) .loader__svgs,:host([type=determinate-value]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3,:host([type=determinate-value]) .loader__svg--3{animation:none;stroke:var(--calcite-color-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-color-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-color-brand)}33%{stroke:var(--calcite-color-brand-press)}66%{stroke:var(--calcite-color-brand-hover)}100%{stroke:var(--calcite-color-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',H=$,L=z(class extends _{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.formatValue=()=>this.type!=="determinate-value"?`${this.value}`:this.formatter.format(this.value/100),this.complete=!1,this.inline=!1,this.label=void 0,this.scale="m",this.type="indeterminate",this.value=0,this.text="",this.effectiveLocale=""}valueChangeHandler(){this.complete=this.type.startsWith("determinate")&&this.value===100}connectedCallback(){P(this),this.updateFormatter()}disconnectedCallback(){C(this)}componentWillLoad(){requestAnimationFrame(()=>this.valueChangeHandler())}render(){const{el:e,inline:f,label:v,scale:n,text:l,type:h,value:s}=this,g=e.id||w(),u=.45,i=f?this.getInlineSize(n):this.getSize(n),c=i*u,p=`0 0 ${i} ${i}`,r=h.startsWith("determinate"),d=2*c*Math.PI,m=s/100*d,k=d-m,y=Math.floor(s),b={"stroke-dasharray":`${m} ${k}`};return a(x,{key:"8272bdfae9fff51b19ed8fa66197eb93b53feb4c","aria-label":v,"aria-valuemax":r?"100":void 0,"aria-valuemin":r?"0":void 0,"aria-valuenow":r?y.toString():void 0,id:g,role:"progressbar"},a("div",{key:"3d410c178af39bb57cc478bdd06c0392f6ba71a3",class:t.loaderParts},[1,2,3].map(o=>a("svg",{"aria-hidden":"true",class:{[t.loaderPart]:!0,[t.loaderPartId(o)]:!0},key:o,style:r&&o===3?b:void 0,viewBox:p},a("circle",{cx:i/2,cy:i/2,r:c}))),r&&a("div",{key:"4ccc633930dee031bf769908d712df39e0677bbb",class:t.loaderPercentage},this.formatValue())),l&&a("div",{key:"6d0d51988bdfafee2a19faed9e14d3bda06d79b5",class:t.loaderText},l))}formatterPropsChange(){this.updateFormatter()}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}updateFormatter(){this.type!=="determinate-value"||this.formatter?.resolvedOptions().locale===this.effectiveLocale||(this.formatter=new Intl.NumberFormat(this.effectiveLocale,{style:"percent"}))}get el(){return this}static get watchers(){return{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}}static get style(){return H}},[1,"calcite-loader",{complete:[1540],inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1],effectiveLocale:[32]},void 0,{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}]);function S(){typeof customElements>"u"||["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,L);break}})}S();export{L as f,S as v}; diff --git a/main/assets/loader-CkLCe-E_-Cx46HvSP.js b/main/assets/loader-CkLCe-E_-Cx46HvSP.js new file mode 100644 index 000000000..c6089d0ca --- /dev/null +++ b/main/assets/loader-CkLCe-E_-Cx46HvSP.js @@ -0,0 +1 @@ +import{a1 as N,o as i,d7 as Q,eh as W,k7 as Z,an as ee,Y as te,bf as B}from"./main-C7yV2j71.js";import{t as $,o as A}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{M as E,G as O,I as u,T as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{m as k}from"./Version-CoKzbupV-BKAqCewj.js";import{L as re,B as oe,H as se,V as ne,N as ae}from"./mat4-DX7gBViE-vewreEuZ.js";import{j as ie}from"./quat-BODLR7mS-Dbd8ftOx.js";import{e as ue}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{p as Y,P as le,x as ce,j as fe,S as de,I as pe,N as me,w as he,O as Te,l as R,X as P,L as we,C as ge,g as xe,M as be}from"./BufferView-PQoE3GL7-M6q1od-Y.js";import{h as ye,d as _e,l as Se,f as Ne}from"./resourceUtils-Ds65naCv-DTjz-__I.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec32-D9GsKZ1t-CXe4l2D-.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function S(o,e){const r=o.count;e||(e=new o.TypedArrayConstructor(r));for(let t=0;t{const e={...K,...o.pbrMetallicRoughness},r=Ce({...Ae,...o.extras});return{...Re,...o,pbrMetallicRoughness:e,extras:r}};function Ce(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:o.ESRI_externalColorMixMode="tint"}return o}const ve={magFilter:E.LINEAR,minFilter:E.LINEAR_MIPMAP_LINEAR,wrapS:O.REPEAT,wrapT:O.REPEAT},Ie=o=>({...ve,...o});function Me(o){let e,r;return o.replace(/^(.*\/)?([^/]*)$/,(t,s,n)=>(e=s||"",r=n||"","")),{dirPart:e,filePart:r}}const y={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class h{constructor(e,r,t,s){if(this._context=e,this.uri=r,this.json=t,this._glbBuffer=s,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=Me(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.scenes==null)throw new i("gltf-loader-unsupported-feature","Scenes must be defined.");if(t.meshes==null)throw new i("gltf-loader-unsupported-feature","Meshes must be defined");if(t.nodes==null)throw new i("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,t){if(Q(r)){const a=W(r);if(a&&a.mediaType!=="model/gltf-binary")try{const f=JSON.parse(a.isBase64?atob(a.data):a.data);return new h(e,r,f)}catch{}const c=Z(r);if(h._isGLBData(c))return this._fromGLBData(e,r,c)}if(Pe.test(r)||t?.expectedType==="gltf"){const a=await e.loadJSON(r,t);return new h(e,r,a)}const s=await e.loadBinary(r,t);if(h._isGLBData(s))return this._fromGLBData(e,r,s);if(Ge.test(r)||t?.expectedType==="glb")throw new i("gltf-loader-invalid-glb","This is not a valid glb file.");const n=await e.loadJSON(r,t);return new h(e,r,n)}static _isGLBData(e){if(e==null)return!1;const r=new G(e);return r.remainingBytes()>=4&&r.readUint32()===y.MAGIC}static async _fromGLBData(e,r,t){const s=await h._parseGLBData(t);return new h(e,r,s.json,s.binaryData)}static async _parseGLBData(e){const r=new G(e);if(r.remainingBytes()<12)throw new i("gltf-loader-error","glb binary data is insufficiently large.");const t=r.readUint32(),s=r.readUint32(),n=r.readUint32();if(t!==y.MAGIC)throw new i("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const d=r.readUint32(),p=r.readUint32();if(f===0){if(p!==y.CHUNK_TYPE_JSON)throw new i("gltf-loader-error","First glb chunk must be JSON.");if(d<0)throw new i("gltf-loader-error","No JSON data found.");a=await ye(r.readUint8Array(d))}else if(f===1){if(p!==y.CHUNK_TYPE_BIN)throw new i("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");c=r.readUint8Array(d)}else N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!a)throw new i("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:c}}async getBuffer(e,r){const t=this.json.buffers[e];if(t.uri==null){if(this._glbBuffer==null)throw new i("gltf-loader-error","glb buffer not present");return this._glbBuffer}const s=await this._getBufferLoader(e,r);if(s.byteLength!==t.byteLength)throw new i("gltf-loader-error","Buffer byte lengths should match.");return s}async _getBufferLoader(e,r){const t=this._bufferLoaders.get(e);if(t)return t;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),r).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,n),n}async getAccessor(e,r){if(!this.json.accessors)throw new i("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if(t?.bufferView==null)throw new i("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(t.type in[b.MAT2,b.MAT3,b.MAT4])throw new i("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);const s=this.json.bufferViews[t.bufferView],n=await this.getBuffer(s.buffer,r),a=Ue[t.type],c=De[t.componentType],f=a*c,d=s.byteStride||f;return{raw:n.buffer,byteStride:d,byteOffset:n.byteOffset+(s.byteOffset||0)+(t.byteOffset||0),entryCount:t.count,isDenselyPacked:d===f,componentCount:a,componentByteSize:c,componentType:t.componentType,min:t.min,max:t.max,normalized:!!t.normalized}}async getIndexData(e,r){if(e.indices==null)return;const t=await this.getAccessor(e.indices,r);if(t.isDenselyPacked)switch(t.componentType){case u.UNSIGNED_BYTE:return new Uint8Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_SHORT:return new Uint16Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_INT:return new Uint32Array(t.raw,t.byteOffset,t.entryCount)}else switch(t.componentType){case u.UNSIGNED_BYTE:return S(m(Te,t));case u.UNSIGNED_SHORT:return S(m(he,t));case u.UNSIGNED_INT:return S(m(me,t))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new i("gltf-loader-unsupported-feature","No POSITION vertex data found.");const t=await this.getAccessor(e.attributes.POSITION,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new i("gltf-loader-error","No NORMAL vertex data found.");const t=await this.getAccessor(e.attributes.NORMAL,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new i("gltf-loader-error","No TANGENT vertex data found.");const t=await this.getAccessor(e.attributes.TANGENT,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==4)throw new i("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+t.componentCount.toFixed());return m(P,t)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new i("gltf-loader-error","No TEXCOORD_0 vertex data found.");const t=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(t.componentCount!==2)throw new i("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+t.componentCount.toFixed());if(t.componentType===u.FLOAT)return m(Y,t);if(!t.normalized)throw new i("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Be(t)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new i("gltf-loader-error","No COLOR_0 vertex data found.");const t=await this.getAccessor(e.attributes.COLOR_0,r);if(t.componentCount!==4&&t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+t.componentCount.toFixed());if(t.componentCount===4){if(t.componentType===u.FLOAT)return m(P,t);if(t.componentType===u.UNSIGNED_BYTE)return m(we,t);if(t.componentType===u.UNSIGNED_SHORT)return m(ge,t)}else if(t.componentCount===3){if(t.componentType===u.FLOAT)return m(R,t);if(t.componentType===u.UNSIGNED_BYTE)return m(xe,t);if(t.componentType===u.UNSIGNED_SHORT)return m(be,t)}throw new i("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+u[t.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,r,t){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=e.material!=null?H(this.json.materials[e.material]):H(),a=n.pbrMetallicRoughness,c=this.hasVertexColors(e),f=this.getTexture(a.baseColorTexture,r),d=this.getTexture(n.normalTexture,r),p=t?this.getTexture(n.occlusionTexture,r):void 0,l=t?this.getTexture(n.emissiveTexture,r):void 0,w=t?this.getTexture(a.metallicRoughnessTexture,r):void 0,T=e.material!=null?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:a.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await f,normalTexture:await d,name:n.name,id:T,occlusionTexture:await p,emissiveTexture:await l,emissiveFactor:n.emissiveFactor,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await w,hasVertexColors:c,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:n.extras.ESRI_receiveAmbientOcclusion,receiveShadows:n.extras.ESRI_receiveShadows}}return s}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new i("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const t=e.index,s=this.json.textures[t],n=Ie(s.sampler!=null?this.json.samplers[s.sampler]:{}),a=V(s),c=this.json.images[a],f=await this._loadTextureImageData(t,s,r);return ee(this._textureCache,t,()=>{const d=l=>l===33071||l===33648||l===10497,p=l=>{throw new i("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${l}`)};return{data:f,wrapS:d(n.wrapS)?n.wrapS:p(n.wrapS),wrapT:d(n.wrapT)?n.wrapT:p(n.wrapT),minFilter:n.minFilter,name:c.name,id:t}})}getNodeTransform(e){if(e===void 0)return Le;let r=this._nodeTransformCache.get(e);if(!r){const t=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?r=oe($(),t,s.matrix):s.translation||s.rotation||s.scale?(r=A(t),s.translation&&se(r,r,s.translation),s.rotation&&(_[3]=ie(_,s.rotation),ne(r,r,_[3],_)),s.scale&&ae(r,r,s.scale)):r=A(t),this._nodeTransformCache.set(e,r)}return r}_resolveUri(e){return te(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=k.parse(this.json.asset.version,"glTF");Fe.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new i("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(t=>{this._nodeParentMap.set(t,r)})})}async _loadTextureImageData(e,r,t){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(r,t);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,r){const t=V(e),s=this.json.images[t];if(s.uri){if(s.uri.endsWith(".ktx2")){const f=await this._context.loadBinary(this._resolveUri(s.uri),r);return new _e(new Uint8Array(f))}return this._context.loadImage(this._resolveUri(s.uri),r)}if(s.bufferView==null)throw new i("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(s.mimeType==null)throw new i("gltf-loader-unsupported-feature","Image mimeType must be defined.");const n=this.json.bufferViews[s.bufferView],a=await this.getBuffer(n.buffer,r);if(n.byteStride!=null)throw new i("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const c=a.byteOffset+(n.byteOffset||0);return Se(new Uint8Array(a.buffer,c,n.byteLength),s.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await B(Array.from(this._bufferLoaders.values())),r=await B(Array.from(this._textureLoaders.values()));return e.reduce((t,s)=>t+(s?.byteLength??0),0)+r.reduce((t,s)=>t+(s?Ne(s)?s.data.byteLength:s.width*s.height*4:0),0)}}const Le=re($(),Math.PI/2),Fe=new k(2,0,"glTF"),_=ue(),Ue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={[u.BYTE]:1,[u.UNSIGNED_BYTE]:1,[u.SHORT]:2,[u.UNSIGNED_SHORT]:2,[u.HALF_FLOAT]:2,[u.FLOAT]:4,[u.INT]:4,[u.UNSIGNED_INT]:4};function Be(o){switch(o.componentType){case u.BYTE:return new pe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_BYTE:return new de(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.SHORT:return new fe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_SHORT:return new ce(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_INT:return new le(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.FLOAT:return new Y(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}}function m(o,e){return new o(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*(e.entryCount-1)+e.componentByteSize*e.componentCount)}function V(o){if(o.extensions?.KHR_texture_basisu!=null)return o.extensions.KHR_texture_basisu.source;if(o.source!==null)return o.source;throw new i("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const Pe=/\.gltf$/i,Ge=/\.glb$/i;let je=0;async function it(o,e,r={},t=!0){const s=await h.load(o,e,r),n="gltf_"+je++,a={lods:[],materials:new Map,textures:new Map,meta:He(s)},c=!(!s.json.asset.extras||s.json.asset.extras.ESRI_type!=="symbolResource"),f=s.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;await Ve(s,async(l,w,T,C)=>{const v=d.get(T)??0;d.set(T,v+1);const g=l.mode!==void 0?l.mode:x.TRIANGLES,I=g===x.TRIANGLES||g===x.TRIANGLE_STRIP||g===x.TRIANGLE_FAN?g:null;if(I==null)return void N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+x[g]+"). Skipping primitive.");if(!s.hasPositions(l))return void N.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const z=s.getPositionData(l,r),J=s.getMaterial(l,r,t),M=s.hasNormals(l)?s.getNormalData(l,r):null,L=s.hasTangents(l)?s.getTangentData(l,r):null,F=s.hasTextureCoordinates(l)?s.getTextureCoordinates(l,r):null,U=s.hasVertexColors(l)?s.getVertexColors(l,r):null,X=s.getIndexData(l,r),q={name:C,transform:A(w),attributes:{position:await z,normal:M?await M:null,texCoord0:F?await F:null,color:U?await U:null,tangent:L?await L:null},indices:await X,primitiveType:I,material:ke(a,await J,n)};let D=null;a.meta?.ESRI_lod!=null&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(D=a.meta.ESRI_lod.thresholds[T]),a.lods[T]=a.lods[T]||{parts:[],name:C,lodThreshold:D},a.lods[T].parts[v]=q});for(const l of a.lods)l.parts=l.parts.filter(w=>!!w);const p=await s.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:c,uri:s.uri,ESRI_webstyle:f},customMeta:{},size:p}}function He(o){const e=o.json;let r=null;return e.nodes.forEach(t=>{const s=t.extras;s!=null&&(s.ESRI_proxyEllipsoid||s.ESRI_lod)&&(r=s)}),r}async function Ve(o,e){const r=o.json,t=r.scenes[r.scene||0].nodes,s=t.length>1,n=[];for(const c of t){const f=r.nodes[c];n.push(a(c,0)),$e(f)&&!s&&f.extensions.MSFT_lod.ids.forEach((d,p)=>a(d,p+1))}async function a(c,f){const d=r.nodes[c],p=o.getNodeTransform(c);if(d.weights!=null&&N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),d.mesh!=null){const l=r.meshes[d.mesh];for(const w of l.primitives)n.push(e(w,p,f,l.name))}for(const l of d.children||[])n.push(a(l,f))}await Promise.all(n)}function $e(o){return o.extensions?.MSFT_lod&&Array.isArray(o.extensions.MSFT_lod.ids)}function ke(o,e,r){const t=n=>{const a=`${r}_tex_${n&&n.id}${n?.name?"_"+n.name:""}`;if(n&&!o.textures.has(a)){const c=Oe(n.data,{wrap:{s:n.wrapS,t:n.wrapT},mipmap:Ye.has(n.minFilter),noUnpackFlip:!0});o.textures.set(a,c)}return a},s=`${r}_mat_${e.id}_${e.name}`;if(!o.materials.has(s)){const n=Ee({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?t(e.colorTexture):void 0,textureNormal:e.normalTexture?t(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?t(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?t(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?t(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor,receiveShadows:e.receiveShadows,receiveAmbientOcclustion:e.receiveAmbientOcclusion});o.materials.set(s,n)}return s}const Ye=new Set([E.LINEAR_MIPMAP_LINEAR,E.LINEAR_MIPMAP_NEAREST]);export{it as loadGLTF}; diff --git a/main/assets/loader-CkLCe-E_-eczb4GdW.js b/main/assets/loader-CkLCe-E_-eczb4GdW.js deleted file mode 100644 index 703635e03..000000000 --- a/main/assets/loader-CkLCe-E_-eczb4GdW.js +++ /dev/null @@ -1 +0,0 @@ -import{a1 as N,o as i,d7 as Q,eh as W,k7 as Z,an as ee,Y as te,bf as B}from"./main-BZaw9FpY.js";import{t as $,o as A}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{M as E,G as O,I as u,T as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{m as k}from"./Version-CoKzbupV-BxOJQpf3.js";import{L as re,B as oe,H as se,V as ne,N as ae}from"./mat4-DX7gBViE-CQMXDC3Z.js";import{j as ie}from"./quat-BODLR7mS-Bk09s2KF.js";import{e as ue}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{p as Y,P as le,x as ce,j as fe,S as de,I as pe,N as me,w as he,O as Te,l as R,X as P,L as we,C as ge,g as xe,M as be}from"./BufferView-PQoE3GL7-DXIpDOUe.js";import{h as ye,d as _e,l as Se,f as Ne}from"./resourceUtils-Ds65naCv-erCXStgB.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec32-D9GsKZ1t-D4J2Sth6.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function S(o,e){const r=o.count;e||(e=new o.TypedArrayConstructor(r));for(let t=0;t{const e={...K,...o.pbrMetallicRoughness},r=Ce({...Ae,...o.extras});return{...Re,...o,pbrMetallicRoughness:e,extras:r}};function Ce(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:o.ESRI_externalColorMixMode="tint"}return o}const ve={magFilter:E.LINEAR,minFilter:E.LINEAR_MIPMAP_LINEAR,wrapS:O.REPEAT,wrapT:O.REPEAT},Ie=o=>({...ve,...o});function Me(o){let e,r;return o.replace(/^(.*\/)?([^/]*)$/,(t,s,n)=>(e=s||"",r=n||"","")),{dirPart:e,filePart:r}}const y={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class h{constructor(e,r,t,s){if(this._context=e,this.uri=r,this.json=t,this._glbBuffer=s,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=Me(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.scenes==null)throw new i("gltf-loader-unsupported-feature","Scenes must be defined.");if(t.meshes==null)throw new i("gltf-loader-unsupported-feature","Meshes must be defined");if(t.nodes==null)throw new i("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,t){if(Q(r)){const a=W(r);if(a&&a.mediaType!=="model/gltf-binary")try{const f=JSON.parse(a.isBase64?atob(a.data):a.data);return new h(e,r,f)}catch{}const c=Z(r);if(h._isGLBData(c))return this._fromGLBData(e,r,c)}if(Pe.test(r)||t?.expectedType==="gltf"){const a=await e.loadJSON(r,t);return new h(e,r,a)}const s=await e.loadBinary(r,t);if(h._isGLBData(s))return this._fromGLBData(e,r,s);if(Ge.test(r)||t?.expectedType==="glb")throw new i("gltf-loader-invalid-glb","This is not a valid glb file.");const n=await e.loadJSON(r,t);return new h(e,r,n)}static _isGLBData(e){if(e==null)return!1;const r=new G(e);return r.remainingBytes()>=4&&r.readUint32()===y.MAGIC}static async _fromGLBData(e,r,t){const s=await h._parseGLBData(t);return new h(e,r,s.json,s.binaryData)}static async _parseGLBData(e){const r=new G(e);if(r.remainingBytes()<12)throw new i("gltf-loader-error","glb binary data is insufficiently large.");const t=r.readUint32(),s=r.readUint32(),n=r.readUint32();if(t!==y.MAGIC)throw new i("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const d=r.readUint32(),p=r.readUint32();if(f===0){if(p!==y.CHUNK_TYPE_JSON)throw new i("gltf-loader-error","First glb chunk must be JSON.");if(d<0)throw new i("gltf-loader-error","No JSON data found.");a=await ye(r.readUint8Array(d))}else if(f===1){if(p!==y.CHUNK_TYPE_BIN)throw new i("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");c=r.readUint8Array(d)}else N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!a)throw new i("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:c}}async getBuffer(e,r){const t=this.json.buffers[e];if(t.uri==null){if(this._glbBuffer==null)throw new i("gltf-loader-error","glb buffer not present");return this._glbBuffer}const s=await this._getBufferLoader(e,r);if(s.byteLength!==t.byteLength)throw new i("gltf-loader-error","Buffer byte lengths should match.");return s}async _getBufferLoader(e,r){const t=this._bufferLoaders.get(e);if(t)return t;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),r).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,n),n}async getAccessor(e,r){if(!this.json.accessors)throw new i("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if(t?.bufferView==null)throw new i("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(t.type in[b.MAT2,b.MAT3,b.MAT4])throw new i("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);const s=this.json.bufferViews[t.bufferView],n=await this.getBuffer(s.buffer,r),a=Ue[t.type],c=De[t.componentType],f=a*c,d=s.byteStride||f;return{raw:n.buffer,byteStride:d,byteOffset:n.byteOffset+(s.byteOffset||0)+(t.byteOffset||0),entryCount:t.count,isDenselyPacked:d===f,componentCount:a,componentByteSize:c,componentType:t.componentType,min:t.min,max:t.max,normalized:!!t.normalized}}async getIndexData(e,r){if(e.indices==null)return;const t=await this.getAccessor(e.indices,r);if(t.isDenselyPacked)switch(t.componentType){case u.UNSIGNED_BYTE:return new Uint8Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_SHORT:return new Uint16Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_INT:return new Uint32Array(t.raw,t.byteOffset,t.entryCount)}else switch(t.componentType){case u.UNSIGNED_BYTE:return S(m(Te,t));case u.UNSIGNED_SHORT:return S(m(he,t));case u.UNSIGNED_INT:return S(m(me,t))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new i("gltf-loader-unsupported-feature","No POSITION vertex data found.");const t=await this.getAccessor(e.attributes.POSITION,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new i("gltf-loader-error","No NORMAL vertex data found.");const t=await this.getAccessor(e.attributes.NORMAL,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new i("gltf-loader-error","No TANGENT vertex data found.");const t=await this.getAccessor(e.attributes.TANGENT,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==4)throw new i("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+t.componentCount.toFixed());return m(P,t)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new i("gltf-loader-error","No TEXCOORD_0 vertex data found.");const t=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(t.componentCount!==2)throw new i("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+t.componentCount.toFixed());if(t.componentType===u.FLOAT)return m(Y,t);if(!t.normalized)throw new i("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Be(t)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new i("gltf-loader-error","No COLOR_0 vertex data found.");const t=await this.getAccessor(e.attributes.COLOR_0,r);if(t.componentCount!==4&&t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+t.componentCount.toFixed());if(t.componentCount===4){if(t.componentType===u.FLOAT)return m(P,t);if(t.componentType===u.UNSIGNED_BYTE)return m(we,t);if(t.componentType===u.UNSIGNED_SHORT)return m(ge,t)}else if(t.componentCount===3){if(t.componentType===u.FLOAT)return m(R,t);if(t.componentType===u.UNSIGNED_BYTE)return m(xe,t);if(t.componentType===u.UNSIGNED_SHORT)return m(be,t)}throw new i("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+u[t.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,r,t){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=e.material!=null?H(this.json.materials[e.material]):H(),a=n.pbrMetallicRoughness,c=this.hasVertexColors(e),f=this.getTexture(a.baseColorTexture,r),d=this.getTexture(n.normalTexture,r),p=t?this.getTexture(n.occlusionTexture,r):void 0,l=t?this.getTexture(n.emissiveTexture,r):void 0,w=t?this.getTexture(a.metallicRoughnessTexture,r):void 0,T=e.material!=null?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:a.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await f,normalTexture:await d,name:n.name,id:T,occlusionTexture:await p,emissiveTexture:await l,emissiveFactor:n.emissiveFactor,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await w,hasVertexColors:c,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:n.extras.ESRI_receiveAmbientOcclusion,receiveShadows:n.extras.ESRI_receiveShadows}}return s}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new i("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const t=e.index,s=this.json.textures[t],n=Ie(s.sampler!=null?this.json.samplers[s.sampler]:{}),a=V(s),c=this.json.images[a],f=await this._loadTextureImageData(t,s,r);return ee(this._textureCache,t,()=>{const d=l=>l===33071||l===33648||l===10497,p=l=>{throw new i("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${l}`)};return{data:f,wrapS:d(n.wrapS)?n.wrapS:p(n.wrapS),wrapT:d(n.wrapT)?n.wrapT:p(n.wrapT),minFilter:n.minFilter,name:c.name,id:t}})}getNodeTransform(e){if(e===void 0)return Le;let r=this._nodeTransformCache.get(e);if(!r){const t=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?r=oe($(),t,s.matrix):s.translation||s.rotation||s.scale?(r=A(t),s.translation&&se(r,r,s.translation),s.rotation&&(_[3]=ie(_,s.rotation),ne(r,r,_[3],_)),s.scale&&ae(r,r,s.scale)):r=A(t),this._nodeTransformCache.set(e,r)}return r}_resolveUri(e){return te(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=k.parse(this.json.asset.version,"glTF");Fe.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new i("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(t=>{this._nodeParentMap.set(t,r)})})}async _loadTextureImageData(e,r,t){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(r,t);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,r){const t=V(e),s=this.json.images[t];if(s.uri){if(s.uri.endsWith(".ktx2")){const f=await this._context.loadBinary(this._resolveUri(s.uri),r);return new _e(new Uint8Array(f))}return this._context.loadImage(this._resolveUri(s.uri),r)}if(s.bufferView==null)throw new i("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(s.mimeType==null)throw new i("gltf-loader-unsupported-feature","Image mimeType must be defined.");const n=this.json.bufferViews[s.bufferView],a=await this.getBuffer(n.buffer,r);if(n.byteStride!=null)throw new i("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const c=a.byteOffset+(n.byteOffset||0);return Se(new Uint8Array(a.buffer,c,n.byteLength),s.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await B(Array.from(this._bufferLoaders.values())),r=await B(Array.from(this._textureLoaders.values()));return e.reduce((t,s)=>t+(s?.byteLength??0),0)+r.reduce((t,s)=>t+(s?Ne(s)?s.data.byteLength:s.width*s.height*4:0),0)}}const Le=re($(),Math.PI/2),Fe=new k(2,0,"glTF"),_=ue(),Ue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={[u.BYTE]:1,[u.UNSIGNED_BYTE]:1,[u.SHORT]:2,[u.UNSIGNED_SHORT]:2,[u.HALF_FLOAT]:2,[u.FLOAT]:4,[u.INT]:4,[u.UNSIGNED_INT]:4};function Be(o){switch(o.componentType){case u.BYTE:return new pe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_BYTE:return new de(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.SHORT:return new fe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_SHORT:return new ce(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_INT:return new le(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.FLOAT:return new Y(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}}function m(o,e){return new o(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*(e.entryCount-1)+e.componentByteSize*e.componentCount)}function V(o){if(o.extensions?.KHR_texture_basisu!=null)return o.extensions.KHR_texture_basisu.source;if(o.source!==null)return o.source;throw new i("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const Pe=/\.gltf$/i,Ge=/\.glb$/i;let je=0;async function it(o,e,r={},t=!0){const s=await h.load(o,e,r),n="gltf_"+je++,a={lods:[],materials:new Map,textures:new Map,meta:He(s)},c=!(!s.json.asset.extras||s.json.asset.extras.ESRI_type!=="symbolResource"),f=s.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;await Ve(s,async(l,w,T,C)=>{const v=d.get(T)??0;d.set(T,v+1);const g=l.mode!==void 0?l.mode:x.TRIANGLES,I=g===x.TRIANGLES||g===x.TRIANGLE_STRIP||g===x.TRIANGLE_FAN?g:null;if(I==null)return void N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+x[g]+"). Skipping primitive.");if(!s.hasPositions(l))return void N.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const z=s.getPositionData(l,r),J=s.getMaterial(l,r,t),M=s.hasNormals(l)?s.getNormalData(l,r):null,L=s.hasTangents(l)?s.getTangentData(l,r):null,F=s.hasTextureCoordinates(l)?s.getTextureCoordinates(l,r):null,U=s.hasVertexColors(l)?s.getVertexColors(l,r):null,X=s.getIndexData(l,r),q={name:C,transform:A(w),attributes:{position:await z,normal:M?await M:null,texCoord0:F?await F:null,color:U?await U:null,tangent:L?await L:null},indices:await X,primitiveType:I,material:ke(a,await J,n)};let D=null;a.meta?.ESRI_lod!=null&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(D=a.meta.ESRI_lod.thresholds[T]),a.lods[T]=a.lods[T]||{parts:[],name:C,lodThreshold:D},a.lods[T].parts[v]=q});for(const l of a.lods)l.parts=l.parts.filter(w=>!!w);const p=await s.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:c,uri:s.uri,ESRI_webstyle:f},customMeta:{},size:p}}function He(o){const e=o.json;let r=null;return e.nodes.forEach(t=>{const s=t.extras;s!=null&&(s.ESRI_proxyEllipsoid||s.ESRI_lod)&&(r=s)}),r}async function Ve(o,e){const r=o.json,t=r.scenes[r.scene||0].nodes,s=t.length>1,n=[];for(const c of t){const f=r.nodes[c];n.push(a(c,0)),$e(f)&&!s&&f.extensions.MSFT_lod.ids.forEach((d,p)=>a(d,p+1))}async function a(c,f){const d=r.nodes[c],p=o.getNodeTransform(c);if(d.weights!=null&&N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),d.mesh!=null){const l=r.meshes[d.mesh];for(const w of l.primitives)n.push(e(w,p,f,l.name))}for(const l of d.children||[])n.push(a(l,f))}await Promise.all(n)}function $e(o){return o.extensions?.MSFT_lod&&Array.isArray(o.extensions.MSFT_lod.ids)}function ke(o,e,r){const t=n=>{const a=`${r}_tex_${n&&n.id}${n?.name?"_"+n.name:""}`;if(n&&!o.textures.has(a)){const c=Oe(n.data,{wrap:{s:n.wrapS,t:n.wrapT},mipmap:Ye.has(n.minFilter),noUnpackFlip:!0});o.textures.set(a,c)}return a},s=`${r}_mat_${e.id}_${e.name}`;if(!o.materials.has(s)){const n=Ee({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?t(e.colorTexture):void 0,textureNormal:e.normalTexture?t(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?t(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?t(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?t(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor,receiveShadows:e.receiveShadows,receiveAmbientOcclustion:e.receiveAmbientOcclusion});o.materials.set(s,n)}return s}const Ye=new Set([E.LINEAR_MIPMAP_LINEAR,E.LINEAR_MIPMAP_NEAREST]);export{it as loadGLTF}; diff --git a/main/assets/locale-Cn_GDVD_-CiwD7jxT.js b/main/assets/locale-Cn_GDVD_-CiwD7jxT.js deleted file mode 100644 index 6af7fce51..000000000 --- a/main/assets/locale-Cn_GDVD_-CiwD7jxT.js +++ /dev/null @@ -1 +0,0 @@ -import{v as A,T as v}from"./dom-N58V0tYi-DBU3jlah.js";import{e as I}from"./key-CZySMiwx-kmS7VeUz.js";import{c as D}from"./observers-BigwqTsw-DJJPVpPW.js";const _=new RegExp("\\.(0+)?$"),y=new RegExp("0+$");class s{constructor(e){if(e instanceof s)return e;const[n,r]=T(e).split(".").concat("");this.value=BigInt(n+r.padEnd(s.DECIMALS,"0").slice(0,s.DECIMALS))+BigInt(s.ROUNDED&&r[s.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace("-","").padStart(s.DECIMALS+1,"0"),n=e.slice(0,-s.DECIMALS),r=e.slice(-s.DECIMALS).replace(y,"");return{integers:n,decimals:r}}toString(){const{integers:e,decimals:n}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${n.length?"."+n:""}`}formatToParts(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=e.numberFormatter.formatToParts(BigInt(n));return this.isNegative&&i.unshift({type:"minusSign",value:e.minusSign}),r.length&&(i.push({type:"decimal",value:e.decimal}),r.split("").forEach(a=>i.push({type:"fraction",value:a}))),i}format(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(n))}`,a=r.length?`${e.decimal}${r.split("").map(g=>e.numberFormatter.format(Number(g))).join("")}`:"";return`${i}${a}`}add(e){return s.fromBigInt(this.value+new s(e).value)}subtract(e){return s.fromBigInt(this.value-new s(e).value)}multiply(e){return s._divRound(this.value*new s(e).value,s.SHIFT)}divide(e){return s._divRound(this.value*s.SHIFT,new s(e).value)}}s.DECIMALS=100,s.ROUNDED=!0,s.SHIFT=BigInt("1"+"0".repeat(s.DECIMALS)),s._divRound=(t,e)=>s.fromBigInt(t/e+(s.ROUNDED?t*BigInt(2)/e%BigInt(2):BigInt(0))),s.fromBigInt=t=>Object.assign(Object.create(s.prototype),{value:t,isNegative:t{let n=!1;const r=e.split("").filter((i,a)=>i.match(/\./g)&&!n?(n=!0,!0):i.match(/-/g)&&a===0?!0:I.includes(i)).join("");return d(r)?new s(r).toString():""})}const S=/^([-0])0+(?=\d)/,C=/(?!^\.)\.$/,B=/(?!^-)-/g,R=/^-\b0\b\.?0*$/,x=/0*$/,Q=t=>h(t,e=>{const n=e.replace(B,"").replace(C,"").replace(S,"$1");return d(n)?R.test(n)?n:z(n):e});function z(t){const e=t.split(".")[1],n=new s(t).toString(),[r,i]=n.split(".");return e&&i!==e?`${r}.${e}`:n}function h(t,e){if(!t)return t;const n=t.toLowerCase().indexOf("e")+1;return n?t.replace(/[eE]*$/g,"").substring(0,n).concat(t.slice(n).replace(/[eE]/g,"")).split(/[eE]/).map((r,i)=>e(i===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(t)}function T(t){const e=t.split(/[eE]/);if(e.length===1)return t;const n=+t;if(Number.isSafeInteger(n))return`${n}`;const r=t.charAt(0)==="-",i=+e[1],a=e[0].split("."),g=(r?a[0].substring(1):a[0])||"",f=a[1]||"",O=(o,l)=>{const c=Math.abs(l)-o.length,$=c>0?`${"0".repeat(c)}${o}`:o;return`${$.slice(0,l)}.${$.slice(l)}`},N=(o,l)=>{const c=l>o.length?`${o}${"0".repeat(l-o.length)}`:o;return`${c.slice(0,l)}.${c.slice(l)}`},b=i>0?`${g}${N(f,i)}`:`${O(g,i)}${f}`;return`${r?"-":""}${b.charAt(0)==="."?"0":""}${b.replace(_,"").replace(S,"")}`}function L(t){return I.some(e=>t.includes(e))}function V(t,e,n){const r=e.split(".")[1];if(r){const i=r.match(x)[0];if(i&&n.delocalize(t).length!==e.length&&r.indexOf("e")===-1){const a=n.decimal;return t=t.includes(a)?t:`${t}${a}`,t.padEnd(t.length+i.length,n.localize("0"))}}return t}const u="en",M=["ar","bg","bs","ca","cs","da","de","el",u,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],j=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",u,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],k=["arab","arabext","latn"],E=t=>k.includes(t),p=new Intl.NumberFormat().resolvedOptions().numberingSystem,F=p==="arab"||!E(p)?"latn":p,H=t=>E(t)?t:F;function G(t,e="cldr"){const n=e==="cldr"?j:M;return t?n.includes(t)?t:(t=t.toLowerCase(),t==="nb"?"no":e==="t9n"&&t==="pt"?"pt-BR":(t.includes("-")&&(t=t.replace(/(\w+)-(\w+)/,(r,i,a)=>`${i}-${a.toUpperCase()}`),n.includes(t)||(t=t.split("-")[0])),t==="zh"?"zh-CN":n.includes(t)?t:(console.warn(`Translations for the "${t}" locale are not available and will fall back to the default, English (en).`),u))):u}const m=new Set;function Y(t){P(t),m.size===0&&w?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),m.add(t)}function P(t){t.effectiveLocale=U(t)}function Z(t){m.delete(t),m.size===0&&w.disconnect()}const w=D("mutation",t=>{t.forEach(e=>{const n=e.target;m.forEach(r=>{if(!A(n,r.el))return;const i=v(r.el,"[lang]");if(!i){r.effectiveLocale=u;return}const a=i.lang;r.effectiveLocale=i.hasAttribute("lang")&&a===""?u:a})})});function U(t){return t.el.lang||v(t.el,"[lang]")?.lang||document.documentElement.lang||u}class J{constructor(){this.delocalize=e=>this._numberFormatOptions?h(e,n=>n.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):e,this.localize=e=>this._numberFormatOptions?h(e,n=>d(n.trim())?new s(n.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):n):e}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(e){if(e.locale=G(e?.locale),e.numberingSystem=H(e?.numberingSystem),!this._numberFormatOptions&&e.locale===u&&e.numberingSystem===F&&Object.keys(e).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(e))return;this._numberFormatOptions=e,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const n=new Map(this._digits.map((i,a)=>[i,a])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(i=>i.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(i=>i.type==="decimal").value,this._minusSign=r.find(i=>i.type==="minusSign").value,this._getDigitIndex=i=>n.get(i)}}const tt=new J;export{q as B,V as H,Y as K,Q as T,tt as X,d as h,Z as q,s,G as w}; diff --git a/main/assets/locale-Cn_GDVD_-DrOI-_a9.js b/main/assets/locale-Cn_GDVD_-DrOI-_a9.js new file mode 100644 index 000000000..b7f82c02d --- /dev/null +++ b/main/assets/locale-Cn_GDVD_-DrOI-_a9.js @@ -0,0 +1 @@ +import{v as A,T as v}from"./dom-N58V0tYi-DBU3jlah.js";import{e as I}from"./key-CZySMiwx-kmS7VeUz.js";import{c as D}from"./observers-BigwqTsw-Du14S4xc.js";const _=new RegExp("\\.(0+)?$"),y=new RegExp("0+$");class s{constructor(e){if(e instanceof s)return e;const[n,r]=T(e).split(".").concat("");this.value=BigInt(n+r.padEnd(s.DECIMALS,"0").slice(0,s.DECIMALS))+BigInt(s.ROUNDED&&r[s.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace("-","").padStart(s.DECIMALS+1,"0"),n=e.slice(0,-s.DECIMALS),r=e.slice(-s.DECIMALS).replace(y,"");return{integers:n,decimals:r}}toString(){const{integers:e,decimals:n}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${n.length?"."+n:""}`}formatToParts(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=e.numberFormatter.formatToParts(BigInt(n));return this.isNegative&&i.unshift({type:"minusSign",value:e.minusSign}),r.length&&(i.push({type:"decimal",value:e.decimal}),r.split("").forEach(a=>i.push({type:"fraction",value:a}))),i}format(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(n))}`,a=r.length?`${e.decimal}${r.split("").map(g=>e.numberFormatter.format(Number(g))).join("")}`:"";return`${i}${a}`}add(e){return s.fromBigInt(this.value+new s(e).value)}subtract(e){return s.fromBigInt(this.value-new s(e).value)}multiply(e){return s._divRound(this.value*new s(e).value,s.SHIFT)}divide(e){return s._divRound(this.value*s.SHIFT,new s(e).value)}}s.DECIMALS=100,s.ROUNDED=!0,s.SHIFT=BigInt("1"+"0".repeat(s.DECIMALS)),s._divRound=(t,e)=>s.fromBigInt(t/e+(s.ROUNDED?t*BigInt(2)/e%BigInt(2):BigInt(0))),s.fromBigInt=t=>Object.assign(Object.create(s.prototype),{value:t,isNegative:t{let n=!1;const r=e.split("").filter((i,a)=>i.match(/\./g)&&!n?(n=!0,!0):i.match(/-/g)&&a===0?!0:I.includes(i)).join("");return d(r)?new s(r).toString():""})}const S=/^([-0])0+(?=\d)/,C=/(?!^\.)\.$/,B=/(?!^-)-/g,R=/^-\b0\b\.?0*$/,x=/0*$/,Q=t=>h(t,e=>{const n=e.replace(B,"").replace(C,"").replace(S,"$1");return d(n)?R.test(n)?n:z(n):e});function z(t){const e=t.split(".")[1],n=new s(t).toString(),[r,i]=n.split(".");return e&&i!==e?`${r}.${e}`:n}function h(t,e){if(!t)return t;const n=t.toLowerCase().indexOf("e")+1;return n?t.replace(/[eE]*$/g,"").substring(0,n).concat(t.slice(n).replace(/[eE]/g,"")).split(/[eE]/).map((r,i)=>e(i===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(t)}function T(t){const e=t.split(/[eE]/);if(e.length===1)return t;const n=+t;if(Number.isSafeInteger(n))return`${n}`;const r=t.charAt(0)==="-",i=+e[1],a=e[0].split("."),g=(r?a[0].substring(1):a[0])||"",f=a[1]||"",O=(o,l)=>{const c=Math.abs(l)-o.length,$=c>0?`${"0".repeat(c)}${o}`:o;return`${$.slice(0,l)}.${$.slice(l)}`},N=(o,l)=>{const c=l>o.length?`${o}${"0".repeat(l-o.length)}`:o;return`${c.slice(0,l)}.${c.slice(l)}`},b=i>0?`${g}${N(f,i)}`:`${O(g,i)}${f}`;return`${r?"-":""}${b.charAt(0)==="."?"0":""}${b.replace(_,"").replace(S,"")}`}function L(t){return I.some(e=>t.includes(e))}function V(t,e,n){const r=e.split(".")[1];if(r){const i=r.match(x)[0];if(i&&n.delocalize(t).length!==e.length&&r.indexOf("e")===-1){const a=n.decimal;return t=t.includes(a)?t:`${t}${a}`,t.padEnd(t.length+i.length,n.localize("0"))}}return t}const u="en",M=["ar","bg","bs","ca","cs","da","de","el",u,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],j=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",u,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],k=["arab","arabext","latn"],E=t=>k.includes(t),p=new Intl.NumberFormat().resolvedOptions().numberingSystem,F=p==="arab"||!E(p)?"latn":p,H=t=>E(t)?t:F;function G(t,e="cldr"){const n=e==="cldr"?j:M;return t?n.includes(t)?t:(t=t.toLowerCase(),t==="nb"?"no":e==="t9n"&&t==="pt"?"pt-BR":(t.includes("-")&&(t=t.replace(/(\w+)-(\w+)/,(r,i,a)=>`${i}-${a.toUpperCase()}`),n.includes(t)||(t=t.split("-")[0])),t==="zh"?"zh-CN":n.includes(t)?t:(console.warn(`Translations for the "${t}" locale are not available and will fall back to the default, English (en).`),u))):u}const m=new Set;function Y(t){P(t),m.size===0&&w?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),m.add(t)}function P(t){t.effectiveLocale=U(t)}function Z(t){m.delete(t),m.size===0&&w.disconnect()}const w=D("mutation",t=>{t.forEach(e=>{const n=e.target;m.forEach(r=>{if(!A(n,r.el))return;const i=v(r.el,"[lang]");if(!i){r.effectiveLocale=u;return}const a=i.lang;r.effectiveLocale=i.hasAttribute("lang")&&a===""?u:a})})});function U(t){return t.el.lang||v(t.el,"[lang]")?.lang||document.documentElement.lang||u}class J{constructor(){this.delocalize=e=>this._numberFormatOptions?h(e,n=>n.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):e,this.localize=e=>this._numberFormatOptions?h(e,n=>d(n.trim())?new s(n.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):n):e}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(e){if(e.locale=G(e?.locale),e.numberingSystem=H(e?.numberingSystem),!this._numberFormatOptions&&e.locale===u&&e.numberingSystem===F&&Object.keys(e).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(e))return;this._numberFormatOptions=e,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const n=new Map(this._digits.map((i,a)=>[i,a])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(i=>i.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(i=>i.type==="decimal").value,this._minusSign=r.find(i=>i.type==="minusSign").value,this._getDigitIndex=i=>n.get(i)}}const tt=new J;export{q as B,V as H,Y as K,Q as T,tt as X,d as h,Z as q,s,G as w}; diff --git a/main/assets/main-BZaw9FpY.js b/main/assets/main-BZaw9FpY.js deleted file mode 100644 index a450c8f92..000000000 --- a/main/assets/main-BZaw9FpY.js +++ /dev/null @@ -1,2349 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./IdentityManager-DCHYmv7j-Du2I-Uqb.js","./themeUtils-YjM7iIiX-xQe6qdbF.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./substitute-j49H6mVR-DelduE0n.js","./pe-wasm-tEsgvglo-iUyVeBlJ.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./WhereClause-DxwoyBMS-BIlXG7Pl.js","./TimeOnly-DSMefxKy-DBJeVQCe.js","./UnknownTimeZone-C--TOcPG-hkNbcn35.js","./arcadeUtils-DpP0k7IY-DIwxqttO.js","./languageUtils-BYxF9hRA-Dig_Awzu.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./shared-D1w-26bA-Cy2KeMh-.js","./Field-C6hA1tZj-CbELM0zp.js","./fieldType-CD2CL2hr-BAgRuESI.js","./number-eRKYXfX9-B-l8dJUS.js","./Query-BrwMGK8U-sojFdYaD.js","./TimeExtent-Cn0Jofqr-tHuvEXRa.js","./featureConversionUtils-D6hFQ4Af-CkdezteH.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./FieldsIndex-HmzMbJQG-CiA2Ur00.js","./Basemap-BEqqSTw9-BkQ-c4vY.js","./loadAll-e978YItg-CB-7_cng.js","./PortalItem-CctGdnxF-DNdsi_Qx.js","./writeUtils-D5qlLkwk-DIX6zS6N.js","./ElevationLayer-G6y-P-jo-CgtzrvPg.js","./MultiOriginJSONSupport-DKRh9P6w-BY5l7Fkc.js","./HeightModelInfo-C5vFqzyF-D9ss-Vrr.js","./Layer-ChoECxvZ-C4wLrCej.js","./ArcGISCachedService-C64Ko1TY-YBzt3RaL.js","./TileInfo-CWIRDhZl-BN68IeQv.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./TileInfoTilemapCache-D1SExPij-UDulH8vT.js","./TilemapCache-CRRxws77-B5V8seF0.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./LRUCache-C3erQTWv-CeYLuvL9.js","./ArcGISService-BYA-y6X6-DLcDzG-r.js","./arcgisLayerUrl-HNYh8jvG-Cg2arUj4.js","./OperationalLayer-B5IXiMa2-KEXCVZUA.js","./commonProperties-BtIqvFU_-Brj0aAM1.js","./ElevationInfo-yv2-9tj6-pjIBBQET.js","./lengthUtils-DKpMe5qR-CD-2dB4t.js","./PortalLayer-CElnYuSQ-tfjbIq8z.js","./portalItemUtils-B8bw6SAG-D-m1Z1Le.js","./projection-BA9M1R7d-DoNqITCd.js","./projectBuffer-CvCBvJ6W-BLRWD7oY.js","./workers-PiCjreoO-oGzLvkSt.js","./webStyleSymbolUtils-BxoWoVrm-BMOiB1BB.js","./devEnvironmentUtils-CxrVv3RG-CX5aoxVE.js","./styleUtils-BtpNqZyT-B-RFL3S3.js","./Map-1zd11DKO-DdBAdkuj.js","./compilerUtils-CV1QYWI8-Ds7TbAp_.js","./CollectionFlattener-DkHuHn5E-D3nwGseo.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-CQMXDC3Z.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-DjK1Q1jj.js","./MapView-BGOJJ8ch-Dom5daUl.js","./Cyclical-C_9rKUUQ-CmN6QXv-.js","./UpdatingHandles-CUu3u1ms-D2fDxJPP.js","./signal-CETehA7D-vStzfbaY.js","./GraphicsCollection-CWTXNZOX-8-_pDOZK.js","./ReactiveMap-CFk6jPfN-Dz1UG3IA.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-DprBAZDK.js","./TileKey-C5IL-JBr-0HJjsV9n.js","./QueueProcessor-DbfV9fLy-Bhvo6-Tg.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-DmSw8J5C.js","./normalizeUtilsCommon-CRJlkfEA-CiSuN2gR.js","./utils-9sQxfkoa-Cus_qP6M.js","./utils-Bq23Xwmj-sYd6uuv5.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DXVwwlDm.js","./vec32-D9GsKZ1t-D4J2Sth6.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-D-X9O5uh.js","./imageUtils-BA2D6Uf1-BIs7TUww.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-BxOJQpf3.js","./ColorBackground-gVZldRLm-BDCeusMw.js","./FeatureLayer-BrRKw5Si-CHreUEJ9.js","./UniqueValueRenderer-fS5V0Ej1-BkIGDv8I.js","./RendererLegendOptions-K3md58-X-B6y5tQg5.js","./diffUtils-Cz3Fi8Xb-DBwynpLu.js","./colorRamps-q0bZVhs2-Bqen3nIx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BEwZ8-Z5.js","./jsonUtils-C64Zfu7c-trwRB9M4.js","./OverrideHelper-DWRbVlj1-C2SNS5Gu.js","./colorUtils-Cthpxcks-BhGjp9AU.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-DpAlEmQT.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-72T4gbed.js","./heatmapUtils-seiMkkkR-D9lAE87R.js","./FeatureLayerBase-vvYyZTfh-K4Z036-G.js","./featureLayerUtils-DgfQQyK4-D6z7j0IK.js","./RelationshipQuery-DJsz3K0U-CSUcCWzp.js","./LayerFloorInfo-DRJ8wfwx-IneDnHGB.js","./Relationship-PyhUibYK-Bz6HFiBe.js","./serviceCapabilitiesUtils-rPjN5QBe-x9eO7Kd_.js","./editsZScale-BDsX6vv--CeDyYvz6.js","./queryZScale-BiYV6Pr6-ci22dEZj.js","./FeatureSet-BkVNthuN-D0ikVdR5.js","./APIKeyMixin-BUMSx9ny-xmyEzAt4.js","./BlendLayer-D1WkSmwP-UVXywJXM.js","./jsonUtils-wIllKWI4-DQ36DuUP.js","./parser-DyDJ-rlI-mkgQEqcN.js","./CustomParametersMixin-vdKsTHer-CoiI71pj.js","./EditBusLayer-Df29OyJh-C36maE2j.js","./FeatureEffectLayer-Cro89IEC-BBkfzwg3.js","./FeatureEffect-CDEk9Es7-DK_N6ZYk.js","./FeatureFilter-BCFHgLVU-BSMrX0wh.js","./FeatureReductionLayer-BTZjL0_Z-D0hCluXW.js","./FeatureReductionSelection-BjX3h7Sz-Dy_G6bLJ.js","./labelingInfo-DGVNul26-CXiwzGiu.js","./labelUtils-BW14kBqX-8wHrIU-s.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OrderedLayer-6Qsmrd_l-CGz1PXc3.js","./OrderByInfo-GD2XnU8e-C-uyyo-i.js","./RefreshableLayer-a8BQ58Xh-BbEtxkCL.js","./ScaleRangeLayer-Bz0DcnvM-DHfd9cv8.js","./TemporalLayer-CpOrN_w9-kgJDrMMF.js","./TimeInfo-w_HB2CsF-wq_g9Zh1.js","./FeatureTemplate-SPHPD45f-tAS5Ccaa.js","./FeatureType-C9hJmS6_-pVJc0p7X.js","./fieldProperties-Bq26w7gt-DT6oRGMS.js","./versionUtils-LZYZz-38-xZnsxhiL.js","./styleUtils-ChrJTYIw-BBKqdQ_e.js","./popupUtils-B0uZcXX0-BqljON9c.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js","./ImageryLayer-B-bJb8lU-B5SbVSix.js","./RasterPresetRendererMixin-D6W9pUY6-BpvSTPuo.js","./multidimensionalUtils-BwTugeu7-CpzGLouA.js","./dataUtils-BkPy4R3C-B2SUbyy5.js","./RasterSymbolizer-BVys6HkM-CeBx4Ld8.js","./ClassBreaksDefinition-bYRgYgPp-B2FM3yKo.js","./utils-DPtQ14k3-D1wtSpry.js","./cimSymbolUtils-CKIzBgMU-BHD6i8OW.js","./imageBitmapUtils-DA36kg39-CBVFUZAU.js","./executeForIds-Z1gkLduF-Daa1fnES.js","./query-DFW9-NG_-1nHUNdNu.js","./pbfQueryUtils-F4ZE8-K8-BPAw4ysZ.js","./pbf-D-y3_eZO-BOjQwfR-.js","./executeQueryJSON-CcHnccia-DVecwfbV.js","./MapImageLayer-B_rP0PhA-IiizomG9.js","./scaleUtils-DxsfQwK1-OKeSqBb9.js","./SublayersOwner-DfTaMJ5V-CcYzSRLx.js","./QueryTask-CwHwH2rS-CU-oJwb3.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./executeQueryPBF-o8010HS9-dWp8mQx-.js","./sublayerUtils-CyM0QC5B-BB_azrTi.js","./ExportImageParameters-DxyNGQ57-DAeGZbW_.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./OpenStreetMapLayer-Bx4EhJij-DzFDuY-s.js","./WebTileLayer-CUoicUjK-CD-UQu9P.js","./TileLayer-Be5tWeN5-CfDmVQKc.js","./WMSLayer-C8eYRV4V-ozTC3oB7.js","./crsUtils-BLe27KvG-VS_BXVdj.js","./ExportWMSImageParameters-CMk80WSM-CXXj-iAb.js","./query-BAUG6dav-Cp-sHT6Q.js","./AttachmentInfo-D9RFO8W2-CP6YNuYr.js","./executeBinsQuery-26-59HNS-B-fN88FW.js","./BinsQuery-DjwQZqB8-T-ydjXwz.js","./queryUtils-Brxu6254-DDAvXp_C.js","./json-BI97KiBB-Ce5cWfI2.js","./executeRelationshipQuery-BlX9_g4g-DqUK0EmM.js","./executeTopFeaturesQuery-CjTd36wS-CqZW1hbK.js","./queryTopFeatures-IbhAPJlP-DzgjIri_.js","./TopFeaturesQuery-Ckj_IYM7-C4DPe7YH.js","./executeForTopIds-BWxBZygF-B3N-R4je.js","./executeForTopExtents-3NOTiZTn-BAEfYmuL.js","./executeForTopCount-Dx1gCDe1-Blv1ngys.js","./shp.min-rg-oXwj1-DJmkRAgl.js","./_commonjs-dynamic-modules-BpilXLfW-CQY1QSED.js","./jszip.min-C61Pcz7i-DlvfXQ6c.js","./index-DDW2D8Uj-BjwR1abY.js","./screen-bYjBkDBU-DX1BIa_V.js","./index-DmuJEjwc-CDkpM4Gs.js","./hilight-defs-DzKgjtLG-D-utaUCJ.js","./index-CWPzg1w2-BKAJsH0v.js","./fabric-Df28hv38-J5FIMqqY.js","./index-DLWeBByc-lUlQN2kJ.js","./index--i98kM5n-ftbcqF2Z.js","./index-98it_ulG-wSo8snBa.js","./index-7blUq_oP-BarAXEha.js","./index-B0lfXXMz-DzFhF9zr.js","./index-DY4XJa1m-BzpaGS2E.js","./index-BSr9u_6r-Dy8QdhWp.js","./screen-CmNk4p3g-TP4639ra.js","./index-BCHMro24-DSRXjkAB.js","./table-state-manager-CQv-OGS1-24xBkGVS.js","./index-CRabsHaP-BibU_USN.js","./screen-DOMT-YVI-BLHSGxaA.js","./screen-x-yg_fPu-jgspjjII.js","./marked.esm-DgqJBp_S-CCvGNfAT.js","./screen-N-CoZlcH-BOOrXpPL.js","./vue.esm-bundler-D2erd_gM-JC7rsyps.js","./screen-D-fcMt_1-YQxyJ36o.js","./screen-BGsID61t-RVI9ARar.js","./toggle-switch-control-B4JzuvHa-CnJ57I53.js","./screen-NGXXpKUs-Gl0YtMtY.js"])))=>i.map(i=>d[i]); -(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function s(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=s(l);fetch(l.href,c)}})();/** -* @vue/shared v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function makeMap(r){const o=Object.create(null);for(const s of r.split(","))o[s]=1;return s=>s in o}const EMPTY_OBJ={},EMPTY_ARR=[],NOOP=()=>{},NO$2=()=>!1,isOn=r=>r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&(r.charCodeAt(2)>122||r.charCodeAt(2)<97),isModelListener=r=>r.startsWith("onUpdate:"),extend$3=Object.assign,remove=(r,o)=>{const s=r.indexOf(o);s>-1&&r.splice(s,1)},hasOwnProperty$4=Object.prototype.hasOwnProperty,hasOwn$3=(r,o)=>hasOwnProperty$4.call(r,o),isArray$9=Array.isArray,isMap$1=r=>toTypeString$1(r)==="[object Map]",isSet$1=r=>toTypeString$1(r)==="[object Set]",isDate$4=r=>toTypeString$1(r)==="[object Date]",isRegExp$5=r=>toTypeString$1(r)==="[object RegExp]",isFunction$3=r=>typeof r=="function",isString$5=r=>typeof r=="string",isSymbol$2=r=>typeof r=="symbol",isObject$7=r=>r!==null&&typeof r=="object",isPromise$1=r=>(isObject$7(r)||isFunction$3(r))&&isFunction$3(r.then)&&isFunction$3(r.catch),objectToString$3=Object.prototype.toString,toTypeString$1=r=>objectToString$3.call(r),toRawType=r=>toTypeString$1(r).slice(8,-1),isPlainObject$5=r=>toTypeString$1(r)==="[object Object]",isIntegerKey=r=>isString$5(r)&&r!=="NaN"&&r[0]!=="-"&&""+parseInt(r,10)===r,isReservedProp=makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),cacheStringFunction=r=>{const o=Object.create(null);return s=>o[s]||(o[s]=r(s))},camelizeRE=/-(\w)/g,camelize=cacheStringFunction(r=>r.replace(camelizeRE,(o,s)=>s?s.toUpperCase():"")),hyphenateRE=/\B([A-Z])/g,hyphenate=cacheStringFunction(r=>r.replace(hyphenateRE,"-$1").toLowerCase()),capitalize$1=cacheStringFunction(r=>r.charAt(0).toUpperCase()+r.slice(1)),toHandlerKey=cacheStringFunction(r=>r?`on${capitalize$1(r)}`:""),hasChanged=(r,o)=>!Object.is(r,o),invokeArrayFns=(r,...o)=>{for(let s=0;s{Object.defineProperty(r,o,{configurable:!0,enumerable:!1,writable:a,value:s})},looseToNumber=r=>{const o=parseFloat(r);return isNaN(o)?r:o},toNumber$1=r=>{const o=isString$5(r)?Number(r):NaN;return isNaN(o)?r:o};let _globalThis$1;const getGlobalThis$1=()=>_globalThis$1||(_globalThis$1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),GLOBALS_ALLOWED="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",isGloballyAllowed=makeMap(GLOBALS_ALLOWED);function normalizeStyle(r){if(isArray$9(r)){const o={};for(let s=0;s{if(s){const a=s.split(propertyDelimiterRE);a.length>1&&(o[a[0].trim()]=a[1].trim())}}),o}function normalizeClass(r){let o="";if(isString$5(r))o=r;else if(isArray$9(r))for(let s=0;slooseEqual(s,o))}const isRef$1=r=>!!(r&&r.__v_isRef===!0),toDisplayString$1=r=>isString$5(r)?r:r==null?"":isArray$9(r)||isObject$7(r)&&(r.toString===objectToString$3||!isFunction$3(r.toString))?isRef$1(r)?toDisplayString$1(r.value):JSON.stringify(r,replacer$1,2):String(r),replacer$1=(r,o)=>isRef$1(o)?replacer$1(r,o.value):isMap$1(o)?{[`Map(${o.size})`]:[...o.entries()].reduce((s,[a,l],c)=>(s[stringifySymbol(a,c)+" =>"]=l,s),{})}:isSet$1(o)?{[`Set(${o.size})`]:[...o.values()].map(s=>stringifySymbol(s))}:isSymbol$2(o)?stringifySymbol(o):isObject$7(o)&&!isArray$9(o)&&!isPlainObject$5(o)?String(o):o,stringifySymbol=(r,o="")=>{var s;return isSymbol$2(r)?`Symbol(${(s=r.description)!=null?s:o})`:r};/** -* @vue/reactivity v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let activeEffectScope;class EffectScope{constructor(o=!1){this.detached=o,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=activeEffectScope,!o&&activeEffectScope&&(this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,s;if(this.scopes)for(o=0,s=this.scopes.length;o0)return;if(batchedComputed){let o=batchedComputed;for(batchedComputed=void 0;o;){const s=o.next;o.next=void 0,o.flags&=-9,o=s}}let r;for(;batchedSub;){let o=batchedSub;for(batchedSub=void 0;o;){const s=o.next;if(o.next=void 0,o.flags&=-9,o.flags&1)try{o.trigger()}catch(a){r||(r=a)}o=s}}if(r)throw r}function prepareDeps(r){for(let o=r.deps;o;o=o.nextDep)o.version=-1,o.prevActiveLink=o.dep.activeLink,o.dep.activeLink=o}function cleanupDeps(r){let o,s=r.depsTail,a=s;for(;a;){const l=a.prevDep;a.version===-1?(a===s&&(s=l),removeSub(a),removeDep(a)):o=a,a.dep.activeLink=a.prevActiveLink,a.prevActiveLink=void 0,a=l}r.deps=o,r.depsTail=s}function isDirty(r){for(let o=r.deps;o;o=o.nextDep)if(o.dep.version!==o.version||o.dep.computed&&(refreshComputed(o.dep.computed)||o.dep.version!==o.version))return!0;return!!r._dirty}function refreshComputed(r){if(r.flags&4&&!(r.flags&16)||(r.flags&=-17,r.globalVersion===globalVersion))return;r.globalVersion=globalVersion;const o=r.dep;if(r.flags|=2,o.version>0&&!r.isSSR&&r.deps&&!isDirty(r)){r.flags&=-3;return}const s=activeSub,a=shouldTrack;activeSub=r,shouldTrack=!0;try{prepareDeps(r);const l=r.fn(r._value);(o.version===0||hasChanged(l,r._value))&&(r._value=l,o.version++)}catch(l){throw o.version++,l}finally{activeSub=s,shouldTrack=a,cleanupDeps(r),r.flags&=-3}}function removeSub(r,o=!1){const{dep:s,prevSub:a,nextSub:l}=r;if(a&&(a.nextSub=l,r.prevSub=void 0),l&&(l.prevSub=a,r.nextSub=void 0),s.subs===r&&(s.subs=a,!a&&s.computed)){s.computed.flags&=-5;for(let c=s.computed.deps;c;c=c.nextDep)removeSub(c,!0)}!o&&!--s.sc&&s.map&&s.map.delete(s.key)}function removeDep(r){const{prevDep:o,nextDep:s}=r;o&&(o.nextDep=s,r.prevDep=void 0),s&&(s.prevDep=o,r.nextDep=void 0)}function effect$6(r,o){r.effect instanceof ReactiveEffect&&(r=r.effect.fn);const s=new ReactiveEffect(r);o&&extend$3(s,o);try{s.run()}catch(l){throw s.stop(),l}const a=s.run.bind(s);return a.effect=s,a}function stop(r){r.effect.stop()}let shouldTrack=!0;const trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function resetTracking(){const r=trackStack.pop();shouldTrack=r===void 0?!0:r}function cleanupEffect(r){const{cleanup:o}=r;if(r.cleanup=void 0,o){const s=activeSub;activeSub=void 0;try{o()}finally{activeSub=s}}}let globalVersion=0;class Link{constructor(o,s){this.sub=o,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Dep{constructor(o){this.computed=o,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(o){if(!activeSub||!shouldTrack||activeSub===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==activeSub)s=this.activeLink=new Link(activeSub,this),activeSub.deps?(s.prevDep=activeSub.depsTail,activeSub.depsTail.nextDep=s,activeSub.depsTail=s):activeSub.deps=activeSub.depsTail=s,addSub(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const a=s.nextDep;a.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=a),s.prevDep=activeSub.depsTail,s.nextDep=void 0,activeSub.depsTail.nextDep=s,activeSub.depsTail=s,activeSub.deps===s&&(activeSub.deps=a)}return s}trigger(o){this.version++,globalVersion++,this.notify(o)}notify(o){startBatch();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{endBatch()}}}function addSub(r){if(r.dep.sc++,r.sub.flags&4){const o=r.dep.computed;if(o&&!r.dep.subs){o.flags|=20;for(let a=o.deps;a;a=a.nextDep)addSub(a)}const s=r.dep.subs;s!==r&&(r.prevSub=s,s&&(s.nextSub=r)),r.dep.subs=r}}const targetMap=new WeakMap,ITERATE_KEY=Symbol(""),MAP_KEY_ITERATE_KEY=Symbol(""),ARRAY_ITERATE_KEY=Symbol("");function track(r,o,s){if(shouldTrack&&activeSub){let a=targetMap.get(r);a||targetMap.set(r,a=new Map);let l=a.get(s);l||(a.set(s,l=new Dep),l.map=a,l.key=s),l.track()}}function trigger(r,o,s,a,l,c){const u=targetMap.get(r);if(!u){globalVersion++;return}const d=m=>{m&&m.trigger()};if(startBatch(),o==="clear")u.forEach(d);else{const m=isArray$9(r),g=m&&isIntegerKey(s);if(m&&s==="length"){const y=Number(a);u.forEach((_,E)=>{(E==="length"||E===ARRAY_ITERATE_KEY||!isSymbol$2(E)&&E>=y)&&d(_)})}else switch((s!==void 0||u.has(void 0))&&d(u.get(s)),g&&d(u.get(ARRAY_ITERATE_KEY)),o){case"add":m?g&&d(u.get("length")):(d(u.get(ITERATE_KEY)),isMap$1(r)&&d(u.get(MAP_KEY_ITERATE_KEY)));break;case"delete":m||(d(u.get(ITERATE_KEY)),isMap$1(r)&&d(u.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap$1(r)&&d(u.get(ITERATE_KEY));break}}endBatch()}function getDepFromReactive(r,o){const s=targetMap.get(r);return s&&s.get(o)}function reactiveReadArray(r){const o=toRaw(r);return o===r?o:(track(o,"iterate",ARRAY_ITERATE_KEY),isShallow(r)?o:o.map(toReactive))}function shallowReadArray(r){return track(r=toRaw(r),"iterate",ARRAY_ITERATE_KEY),r}const arrayInstrumentations={__proto__:null,[Symbol.iterator](){return iterator(this,Symbol.iterator,toReactive)},concat(...r){return reactiveReadArray(this).concat(...r.map(o=>isArray$9(o)?reactiveReadArray(o):o))},entries(){return iterator(this,"entries",r=>(r[1]=toReactive(r[1]),r))},every(r,o){return apply$2(this,"every",r,o,void 0,arguments)},filter(r,o){return apply$2(this,"filter",r,o,s=>s.map(toReactive),arguments)},find(r,o){return apply$2(this,"find",r,o,toReactive,arguments)},findIndex(r,o){return apply$2(this,"findIndex",r,o,void 0,arguments)},findLast(r,o){return apply$2(this,"findLast",r,o,toReactive,arguments)},findLastIndex(r,o){return apply$2(this,"findLastIndex",r,o,void 0,arguments)},forEach(r,o){return apply$2(this,"forEach",r,o,void 0,arguments)},includes(...r){return searchProxy(this,"includes",r)},indexOf(...r){return searchProxy(this,"indexOf",r)},join(r){return reactiveReadArray(this).join(r)},lastIndexOf(...r){return searchProxy(this,"lastIndexOf",r)},map(r,o){return apply$2(this,"map",r,o,void 0,arguments)},pop(){return noTracking(this,"pop")},push(...r){return noTracking(this,"push",r)},reduce(r,...o){return reduce(this,"reduce",r,o)},reduceRight(r,...o){return reduce(this,"reduceRight",r,o)},shift(){return noTracking(this,"shift")},some(r,o){return apply$2(this,"some",r,o,void 0,arguments)},splice(...r){return noTracking(this,"splice",r)},toReversed(){return reactiveReadArray(this).toReversed()},toSorted(r){return reactiveReadArray(this).toSorted(r)},toSpliced(...r){return reactiveReadArray(this).toSpliced(...r)},unshift(...r){return noTracking(this,"unshift",r)},values(){return iterator(this,"values",toReactive)}};function iterator(r,o,s){const a=shallowReadArray(r),l=a[o]();return a!==r&&!isShallow(r)&&(l._next=l.next,l.next=()=>{const c=l._next();return c.value&&(c.value=s(c.value)),c}),l}const arrayProto=Array.prototype;function apply$2(r,o,s,a,l,c){const u=shallowReadArray(r),d=u!==r&&!isShallow(r),m=u[o];if(m!==arrayProto[o]){const _=m.apply(r,c);return d?toReactive(_):_}let g=s;u!==r&&(d?g=function(_,E){return s.call(this,toReactive(_),E,r)}:s.length>2&&(g=function(_,E){return s.call(this,_,E,r)}));const y=m.call(u,g,a);return d&&l?l(y):y}function reduce(r,o,s,a){const l=shallowReadArray(r);let c=s;return l!==r&&(isShallow(r)?s.length>3&&(c=function(u,d,m){return s.call(this,u,d,m,r)}):c=function(u,d,m){return s.call(this,u,toReactive(d),m,r)}),l[o](c,...a)}function searchProxy(r,o,s){const a=toRaw(r);track(a,"iterate",ARRAY_ITERATE_KEY);const l=a[o](...s);return(l===-1||l===!1)&&isProxy(s[0])?(s[0]=toRaw(s[0]),a[o](...s)):l}function noTracking(r,o,s=[]){pauseTracking(),startBatch();const a=toRaw(r)[o].apply(r,s);return endBatch(),resetTracking(),a}const isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).filter(r=>r!=="arguments"&&r!=="caller").map(r=>Symbol[r]).filter(isSymbol$2));function hasOwnProperty$3(r){isSymbol$2(r)||(r=String(r));const o=toRaw(this);return track(o,"has",r),o.hasOwnProperty(r)}class BaseReactiveHandler{constructor(o=!1,s=!1){this._isReadonly=o,this._isShallow=s}get(o,s,a){if(s==="__v_skip")return o.__v_skip;const l=this._isReadonly,c=this._isShallow;if(s==="__v_isReactive")return!l;if(s==="__v_isReadonly")return l;if(s==="__v_isShallow")return c;if(s==="__v_raw")return a===(l?c?shallowReadonlyMap:readonlyMap:c?shallowReactiveMap:reactiveMap).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(a)?o:void 0;const u=isArray$9(o);if(!l){let m;if(u&&(m=arrayInstrumentations[s]))return m;if(s==="hasOwnProperty")return hasOwnProperty$3}const d=Reflect.get(o,s,isRef(o)?o:a);return(isSymbol$2(s)?builtInSymbols.has(s):isNonTrackableKeys(s))||(l||track(o,"get",s),c)?d:isRef(d)?u&&isIntegerKey(s)?d:d.value:isObject$7(d)?l?readonly(d):reactive(d):d}}class MutableReactiveHandler extends BaseReactiveHandler{constructor(o=!1){super(!1,o)}set(o,s,a,l){let c=o[s];if(!this._isShallow){const m=isReadonly(c);if(!isShallow(a)&&!isReadonly(a)&&(c=toRaw(c),a=toRaw(a)),!isArray$9(o)&&isRef(c)&&!isRef(a))return m?!1:(c.value=a,!0)}const u=isArray$9(o)&&isIntegerKey(s)?Number(s)r,getProto$1=r=>Reflect.getPrototypeOf(r);function createIterableMethod(r,o,s){return function(...a){const l=this.__v_raw,c=toRaw(l),u=isMap$1(c),d=r==="entries"||r===Symbol.iterator&&u,m=r==="keys"&&u,g=l[r](...a),y=s?toShallow:o?toReadonly:toReactive;return!o&&track(c,"iterate",m?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:_,done:E}=g.next();return E?{value:_,done:E}:{value:d?[y(_[0]),y(_[1])]:y(_),done:E}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(r){return function(...o){return r==="delete"?!1:r==="clear"?void 0:this}}function createInstrumentations(r,o){const s={get(l){const c=this.__v_raw,u=toRaw(c),d=toRaw(l);r||(hasChanged(l,d)&&track(u,"get",l),track(u,"get",d));const{has:m}=getProto$1(u),g=o?toShallow:r?toReadonly:toReactive;if(m.call(u,l))return g(c.get(l));if(m.call(u,d))return g(c.get(d));c!==u&&c.get(l)},get size(){const l=this.__v_raw;return!r&&track(toRaw(l),"iterate",ITERATE_KEY),Reflect.get(l,"size",l)},has(l){const c=this.__v_raw,u=toRaw(c),d=toRaw(l);return r||(hasChanged(l,d)&&track(u,"has",l),track(u,"has",d)),l===d?c.has(l):c.has(l)||c.has(d)},forEach(l,c){const u=this,d=u.__v_raw,m=toRaw(d),g=o?toShallow:r?toReadonly:toReactive;return!r&&track(m,"iterate",ITERATE_KEY),d.forEach((y,_)=>l.call(c,g(y),g(_),u))}};return extend$3(s,r?{add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear")}:{add(l){!o&&!isShallow(l)&&!isReadonly(l)&&(l=toRaw(l));const c=toRaw(this);return getProto$1(c).has.call(c,l)||(c.add(l),trigger(c,"add",l,l)),this},set(l,c){!o&&!isShallow(c)&&!isReadonly(c)&&(c=toRaw(c));const u=toRaw(this),{has:d,get:m}=getProto$1(u);let g=d.call(u,l);g||(l=toRaw(l),g=d.call(u,l));const y=m.call(u,l);return u.set(l,c),g?hasChanged(c,y)&&trigger(u,"set",l,c):trigger(u,"add",l,c),this},delete(l){const c=toRaw(this),{has:u,get:d}=getProto$1(c);let m=u.call(c,l);m||(l=toRaw(l),m=u.call(c,l)),d&&d.call(c,l);const g=c.delete(l);return m&&trigger(c,"delete",l,void 0),g},clear(){const l=toRaw(this),c=l.size!==0,u=l.clear();return c&&trigger(l,"clear",void 0,void 0),u}}),["keys","values","entries",Symbol.iterator].forEach(l=>{s[l]=createIterableMethod(l,r,o)}),s}function createInstrumentationGetter(r,o){const s=createInstrumentations(r,o);return(a,l,c)=>l==="__v_isReactive"?!r:l==="__v_isReadonly"?r:l==="__v_raw"?a:Reflect.get(hasOwn$3(s,l)&&l in a?s:a,l,c)}const mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},shallowCollectionHandlers={get:createInstrumentationGetter(!1,!0)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)},shallowReadonlyCollectionHandlers={get:createInstrumentationGetter(!0,!0)},reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(r){switch(r){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(r){return r.__v_skip||!Object.isExtensible(r)?0:targetTypeMap(toRawType(r))}function reactive(r){return isReadonly(r)?r:createReactiveObject(r,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function shallowReactive(r){return createReactiveObject(r,!1,shallowReactiveHandlers,shallowCollectionHandlers,shallowReactiveMap)}function readonly(r){return createReactiveObject(r,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function shallowReadonly(r){return createReactiveObject(r,!0,shallowReadonlyHandlers,shallowReadonlyCollectionHandlers,shallowReadonlyMap)}function createReactiveObject(r,o,s,a,l){if(!isObject$7(r)||r.__v_raw&&!(o&&r.__v_isReactive))return r;const c=l.get(r);if(c)return c;const u=getTargetType(r);if(u===0)return r;const d=new Proxy(r,u===2?a:s);return l.set(r,d),d}function isReactive(r){return isReadonly(r)?isReactive(r.__v_raw):!!(r&&r.__v_isReactive)}function isReadonly(r){return!!(r&&r.__v_isReadonly)}function isShallow(r){return!!(r&&r.__v_isShallow)}function isProxy(r){return r?!!r.__v_raw:!1}function toRaw(r){const o=r&&r.__v_raw;return o?toRaw(o):r}function markRaw(r){return!hasOwn$3(r,"__v_skip")&&Object.isExtensible(r)&&def(r,"__v_skip",!0),r}const toReactive=r=>isObject$7(r)?reactive(r):r,toReadonly=r=>isObject$7(r)?readonly(r):r;function isRef(r){return r?r.__v_isRef===!0:!1}function ref$1(r){return createRef(r,!1)}function shallowRef(r){return createRef(r,!0)}function createRef(r,o){return isRef(r)?r:new RefImpl(r,o)}class RefImpl{constructor(o,s){this.dep=new Dep,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?o:toRaw(o),this._value=s?o:toReactive(o),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(o){const s=this._rawValue,a=this.__v_isShallow||isShallow(o)||isReadonly(o);o=a?o:toRaw(o),hasChanged(o,s)&&(this._rawValue=o,this._value=a?o:toReactive(o),this.dep.trigger())}}function triggerRef(r){r.dep&&r.dep.trigger()}function unref(r){return isRef(r)?r.value:r}function toValue$2(r){return isFunction$3(r)?r():unref(r)}const shallowUnwrapHandlers={get:(r,o,s)=>o==="__v_raw"?r:unref(Reflect.get(r,o,s)),set:(r,o,s,a)=>{const l=r[o];return isRef(l)&&!isRef(s)?(l.value=s,!0):Reflect.set(r,o,s,a)}};function proxyRefs(r){return isReactive(r)?r:new Proxy(r,shallowUnwrapHandlers)}class CustomRefImpl{constructor(o){this.__v_isRef=!0,this._value=void 0;const s=this.dep=new Dep,{get:a,set:l}=o(s.track.bind(s),s.trigger.bind(s));this._get=a,this._set=l}get value(){return this._value=this._get()}set value(o){this._set(o)}}function customRef(r){return new CustomRefImpl(r)}function toRefs(r){const o=isArray$9(r)?new Array(r.length):{};for(const s in r)o[s]=propertyToRef(r,s);return o}class ObjectRefImpl{constructor(o,s,a){this._object=o,this._key=s,this._defaultValue=a,this.__v_isRef=!0,this._value=void 0}get value(){const o=this._object[this._key];return this._value=o===void 0?this._defaultValue:o}set value(o){this._object[this._key]=o}get dep(){return getDepFromReactive(toRaw(this._object),this._key)}}class GetterRefImpl{constructor(o){this._getter=o,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function toRef(r,o,s){return isRef(r)?r:isFunction$3(r)?new GetterRefImpl(r):isObject$7(r)&&arguments.length>1?propertyToRef(r,o,s):ref$1(r)}function propertyToRef(r,o,s){const a=r[o];return isRef(a)?a:new ObjectRefImpl(r,o,s)}class ComputedRefImpl{constructor(o,s,a){this.fn=o,this.setter=s,this._value=void 0,this.dep=new Dep(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=globalVersion-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=a}notify(){if(this.flags|=16,!(this.flags&8)&&activeSub!==this)return batch(this,!0),!0}get value(){const o=this.dep.track();return refreshComputed(this),o&&(o.version=this.dep.version),this._value}set value(o){this.setter&&this.setter(o)}}function computed$1(r,o,s=!1){let a,l;return isFunction$3(r)?a=r:(a=r.get,l=r.set),new ComputedRefImpl(a,l,s)}const TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},INITIAL_WATCHER_VALUE={},cleanupMap=new WeakMap;let activeWatcher;function getCurrentWatcher(){return activeWatcher}function onWatcherCleanup(r,o=!1,s=activeWatcher){if(s){let a=cleanupMap.get(s);a||cleanupMap.set(s,a=[]),a.push(r)}}function watch$1(r,o,s=EMPTY_OBJ){const{immediate:a,deep:l,once:c,scheduler:u,augmentJob:d,call:m}=s,g=D=>l?D:isShallow(D)||l===!1||l===0?traverse(D,1):traverse(D);let y,_,E,w,T=!1,k=!1;if(isRef(r)?(_=()=>r.value,T=isShallow(r)):isReactive(r)?(_=()=>g(r),T=!0):isArray$9(r)?(k=!0,T=r.some(D=>isReactive(D)||isShallow(D)),_=()=>r.map(D=>{if(isRef(D))return D.value;if(isReactive(D))return g(D);if(isFunction$3(D))return m?m(D,2):D()})):isFunction$3(r)?o?_=m?()=>m(r,2):r:_=()=>{if(E){pauseTracking();try{E()}finally{resetTracking()}}const D=activeWatcher;activeWatcher=y;try{return m?m(r,3,[w]):r(w)}finally{activeWatcher=D}}:_=NOOP,o&&l){const D=_,P=l===!0?1/0:l;_=()=>traverse(D(),P)}const O=getCurrentScope(),R=()=>{y.stop(),O&&O.active&&remove(O.effects,y)};if(c&&o){const D=o;o=(...P)=>{D(...P),R()}}let M=k?new Array(r.length).fill(INITIAL_WATCHER_VALUE):INITIAL_WATCHER_VALUE;const N=D=>{if(!(!(y.flags&1)||!y.dirty&&!D))if(o){const P=y.run();if(l||T||(k?P.some((I,L)=>hasChanged(I,M[L])):hasChanged(P,M))){E&&E();const I=activeWatcher;activeWatcher=y;try{const L=[P,M===INITIAL_WATCHER_VALUE?void 0:k&&M[0]===INITIAL_WATCHER_VALUE?[]:M,w];m?m(o,3,L):o(...L),M=P}finally{activeWatcher=I}}}else y.run()};return d&&d(N),y=new ReactiveEffect(_),y.scheduler=u?()=>u(N,!1):N,w=D=>onWatcherCleanup(D,!1,y),E=y.onStop=()=>{const D=cleanupMap.get(y);if(D){if(m)m(D,4);else for(const P of D)P();cleanupMap.delete(y)}},o?a?N(!0):M=y.run():u?u(N.bind(null,!0),!0):y.run(),R.pause=y.pause.bind(y),R.resume=y.resume.bind(y),R.stop=R,R}function traverse(r,o=1/0,s){if(o<=0||!isObject$7(r)||r.__v_skip||(s=s||new Set,s.has(r)))return r;if(s.add(r),o--,isRef(r))traverse(r.value,o,s);else if(isArray$9(r))for(let a=0;a{traverse(a,o,s)});else if(isPlainObject$5(r)){for(const a in r)traverse(r[a],o,s);for(const a of Object.getOwnPropertySymbols(r))Object.prototype.propertyIsEnumerable.call(r,a)&&traverse(r[a],o,s)}return r}/** -* @vue/runtime-core v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const stack=[];function pushWarningContext(r){stack.push(r)}function popWarningContext(){stack.pop()}let isWarning=!1;function warn$1$1(r,...o){if(isWarning)return;isWarning=!0,pauseTracking();const s=stack.length?stack[stack.length-1].component:null,a=s&&s.appContext.config.warnHandler,l=getComponentTrace();if(a)callWithErrorHandling(a,s,11,[r+o.map(c=>{var u,d;return(d=(u=c.toString)==null?void 0:u.call(c))!=null?d:JSON.stringify(c)}).join(""),s&&s.proxy,l.map(({vnode:c})=>`at <${formatComponentName(s,c.type)}>`).join(` -`),l]);else{const c=[`[Vue warn]: ${r}`,...o];l.length&&c.push(` -`,...formatTrace(l)),console.warn(...c)}resetTracking(),isWarning=!1}function getComponentTrace(){let r=stack[stack.length-1];if(!r)return[];const o=[];for(;r;){const s=o[0];s&&s.vnode===r?s.recurseCount++:o.push({vnode:r,recurseCount:0});const a=r.component&&r.component.parent;r=a&&a.vnode}return o}function formatTrace(r){const o=[];return r.forEach((s,a)=>{o.push(...a===0?[]:[` -`],...formatTraceEntry(s))}),o}function formatTraceEntry({vnode:r,recurseCount:o}){const s=o>0?`... (${o} recursive calls)`:"",a=r.component?r.component.parent==null:!1,l=` at <${formatComponentName(r.component,r.type,a)}`,c=">"+s;return r.props?[l,...formatProps(r.props),c]:[l+c]}function formatProps(r){const o=[],s=Object.keys(r);return s.slice(0,3).forEach(a=>{o.push(...formatProp(a,r[a]))}),s.length>3&&o.push(" ..."),o}function formatProp(r,o,s){return isString$5(o)?(o=JSON.stringify(o),s?o:[`${r}=${o}`]):typeof o=="number"||typeof o=="boolean"||o==null?s?o:[`${r}=${o}`]:isRef(o)?(o=formatProp(r,toRaw(o.value),!0),s?o:[`${r}=Ref<`,o,">"]):isFunction$3(o)?[`${r}=fn${o.name?`<${o.name}>`:""}`]:(o=toRaw(o),s?o:[`${r}=`,o])}function assertNumber(r,o){}const ErrorCodes={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},ErrorTypeStrings$1={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function callWithErrorHandling(r,o,s,a){try{return a?r(...a):r()}catch(l){handleError(l,o,s)}}function callWithAsyncErrorHandling(r,o,s,a){if(isFunction$3(r)){const l=callWithErrorHandling(r,o,s,a);return l&&isPromise$1(l)&&l.catch(c=>{handleError(c,o,s)}),l}if(isArray$9(r)){const l=[];for(let c=0;c>>1,l=queue[a],c=getId(l);c=getId(s)?queue.push(r):queue.splice(findInsertionIndex$1(o),0,r),r.flags|=1,queueFlush()}}function queueFlush(){currentFlushPromise||(currentFlushPromise=resolvedPromise.then(flushJobs))}function queuePostFlushCb(r){isArray$9(r)?pendingPostFlushCbs.push(...r):activePostFlushCbs&&r.id===-1?activePostFlushCbs.splice(postFlushIndex+1,0,r):r.flags&1||(pendingPostFlushCbs.push(r),r.flags|=1),queueFlush()}function flushPreFlushCbs(r,o,s=flushIndex+1){for(;sgetId(s)-getId(a));if(pendingPostFlushCbs.length=0,activePostFlushCbs){activePostFlushCbs.push(...o);return}for(activePostFlushCbs=o,postFlushIndex=0;postFlushIndexr.id==null?r.flags&2?-1:1/0:r.id;function flushJobs(r){try{for(flushIndex=0;flushIndexdevtools$1.emit(l,...c)),buffer=[]):typeof window<"u"&&window.HTMLElement&&!((a=(s=window.navigator)==null?void 0:s.userAgent)!=null&&a.includes("jsdom"))?((o.__VUE_DEVTOOLS_HOOK_REPLAY__=o.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(c=>{setDevtoolsHook$1(c,o)}),setTimeout(()=>{devtools$1||(o.__VUE_DEVTOOLS_HOOK_REPLAY__=null,buffer=[])},3e3)):buffer=[]}let currentRenderingInstance=null,currentScopeId=null;function setCurrentRenderingInstance(r){const o=currentRenderingInstance;return currentRenderingInstance=r,currentScopeId=r&&r.type.__scopeId||null,o}function pushScopeId(r){currentScopeId=r}function popScopeId(){currentScopeId=null}const withScopeId=r=>withCtx;function withCtx(r,o=currentRenderingInstance,s){if(!o||r._n)return r;const a=(...l)=>{a._d&&setBlockTracking(-1);const c=setCurrentRenderingInstance(o);let u;try{u=r(...l)}finally{setCurrentRenderingInstance(c),a._d&&setBlockTracking(1)}return u};return a._n=!0,a._c=!0,a._d=!0,a}function withDirectives(r,o){if(currentRenderingInstance===null)return r;const s=getComponentPublicInstance(currentRenderingInstance),a=r.dirs||(r.dirs=[]);for(let l=0;lr.__isTeleport,isTeleportDisabled=r=>r&&(r.disabled||r.disabled===""),isTeleportDeferred=r=>r&&(r.defer||r.defer===""),isTargetSVG=r=>typeof SVGElement<"u"&&r instanceof SVGElement,isTargetMathML=r=>typeof MathMLElement=="function"&&r instanceof MathMLElement,resolveTarget=(r,o)=>{const s=r&&r.to;return isString$5(s)?o?o(s):null:s},TeleportImpl={name:"Teleport",__isTeleport:!0,process(r,o,s,a,l,c,u,d,m,g){const{mc:y,pc:_,pbc:E,o:{insert:w,querySelector:T,createText:k,createComment:O}}=g,R=isTeleportDisabled(o.props);let{shapeFlag:M,children:N,dynamicChildren:D}=o;if(r==null){const P=o.el=k(""),I=o.anchor=k("");w(P,s,a),w(I,s,a);const L=(U,J)=>{M&16&&(l&&l.isCE&&(l.ce._teleportTarget=U),y(N,U,J,l,c,u,d,m))},F=()=>{const U=o.target=resolveTarget(o.props,T),J=prepareAnchor(U,o,k,w);U&&(u!=="svg"&&isTargetSVG(U)?u="svg":u!=="mathml"&&isTargetMathML(U)&&(u="mathml"),R||(L(U,J),updateCssVars(o,!1)))};R&&(L(s,I),updateCssVars(o,!0)),isTeleportDeferred(o.props)?queuePostRenderEffect(()=>{F(),o.el.__isMounted=!0},c):F()}else{if(isTeleportDeferred(o.props)&&!r.el.__isMounted){queuePostRenderEffect(()=>{TeleportImpl.process(r,o,s,a,l,c,u,d,m,g),delete r.el.__isMounted},c);return}o.el=r.el,o.targetStart=r.targetStart;const P=o.anchor=r.anchor,I=o.target=r.target,L=o.targetAnchor=r.targetAnchor,F=isTeleportDisabled(r.props),U=F?s:I,J=F?P:L;if(u==="svg"||isTargetSVG(I)?u="svg":(u==="mathml"||isTargetMathML(I))&&(u="mathml"),D?(E(r.dynamicChildren,D,U,l,c,u,d),traverseStaticChildren(r,o,!0)):m||_(r,o,U,J,l,c,u,d,!1),R)F?o.props&&r.props&&o.props.to!==r.props.to&&(o.props.to=r.props.to):moveTeleport(o,s,P,g,1);else if((o.props&&o.props.to)!==(r.props&&r.props.to)){const z=o.target=resolveTarget(o.props,T);z&&moveTeleport(o,z,null,g,0)}else F&&moveTeleport(o,I,L,g,1);updateCssVars(o,R)}},remove(r,o,s,{um:a,o:{remove:l}},c){const{shapeFlag:u,children:d,anchor:m,targetStart:g,targetAnchor:y,target:_,props:E}=r;if(_&&(l(g),l(y)),c&&l(m),u&16){const w=c||!isTeleportDisabled(E);for(let T=0;T{r.isMounted=!0}),onBeforeUnmount(()=>{r.isUnmounting=!0}),r}const TransitionHookValidator=[Function,Array],BaseTransitionPropsValidators={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator},recursiveGetSubtree=r=>{const o=r.subTree;return o.component?recursiveGetSubtree(o.component):o},BaseTransitionImpl={name:"BaseTransition",props:BaseTransitionPropsValidators,setup(r,{slots:o}){const s=getCurrentInstance(),a=useTransitionState();return()=>{const l=o.default&&getTransitionRawChildren(o.default(),!0);if(!l||!l.length)return;const c=findNonCommentChild(l),u=toRaw(r),{mode:d}=u;if(a.isLeaving)return emptyPlaceholder(c);const m=getInnerChild$1(c);if(!m)return emptyPlaceholder(c);let g=resolveTransitionHooks(m,u,a,s,_=>g=_);m.type!==Comment$1&&setTransitionHooks(m,g);let y=s.subTree&&getInnerChild$1(s.subTree);if(y&&y.type!==Comment$1&&!isSameVNodeType(m,y)&&recursiveGetSubtree(s).type!==Comment$1){let _=resolveTransitionHooks(y,u,a,s);if(setTransitionHooks(y,_),d==="out-in"&&m.type!==Comment$1)return a.isLeaving=!0,_.afterLeave=()=>{a.isLeaving=!1,s.job.flags&8||s.update(),delete _.afterLeave,y=void 0},emptyPlaceholder(c);d==="in-out"&&m.type!==Comment$1?_.delayLeave=(E,w,T)=>{const k=getLeavingNodesForType(a,y);k[String(y.key)]=y,E[leaveCbKey]=()=>{w(),E[leaveCbKey]=void 0,delete g.delayedLeave,y=void 0},g.delayedLeave=()=>{T(),delete g.delayedLeave,y=void 0}}:y=void 0}else y&&(y=void 0);return c}}};function findNonCommentChild(r){let o=r[0];if(r.length>1){for(const s of r)if(s.type!==Comment$1){o=s;break}}return o}const BaseTransition=BaseTransitionImpl;function getLeavingNodesForType(r,o){const{leavingVNodes:s}=r;let a=s.get(o.type);return a||(a=Object.create(null),s.set(o.type,a)),a}function resolveTransitionHooks(r,o,s,a,l){const{appear:c,mode:u,persisted:d=!1,onBeforeEnter:m,onEnter:g,onAfterEnter:y,onEnterCancelled:_,onBeforeLeave:E,onLeave:w,onAfterLeave:T,onLeaveCancelled:k,onBeforeAppear:O,onAppear:R,onAfterAppear:M,onAppearCancelled:N}=o,D=String(r.key),P=getLeavingNodesForType(s,r),I=(U,J)=>{U&&callWithAsyncErrorHandling(U,a,9,J)},L=(U,J)=>{const z=J[1];I(U,J),isArray$9(U)?U.every(ie=>ie.length<=1)&&z():U.length<=1&&z()},F={mode:u,persisted:d,beforeEnter(U){let J=m;if(!s.isMounted)if(c)J=O||m;else return;U[leaveCbKey]&&U[leaveCbKey](!0);const z=P[D];z&&isSameVNodeType(r,z)&&z.el[leaveCbKey]&&z.el[leaveCbKey](),I(J,[U])},enter(U){let J=g,z=y,ie=_;if(!s.isMounted)if(c)J=R||g,z=M||y,ie=N||_;else return;let ce=!1;const Y=U[enterCbKey$1]=B=>{ce||(ce=!0,B?I(ie,[U]):I(z,[U]),F.delayedLeave&&F.delayedLeave(),U[enterCbKey$1]=void 0)};J?L(J,[U,Y]):Y()},leave(U,J){const z=String(r.key);if(U[enterCbKey$1]&&U[enterCbKey$1](!0),s.isUnmounting)return J();I(E,[U]);let ie=!1;const ce=U[leaveCbKey]=Y=>{ie||(ie=!0,J(),Y?I(k,[U]):I(T,[U]),U[leaveCbKey]=void 0,P[z]===r&&delete P[z])};P[z]=r,w?L(w,[U,ce]):ce()},clone(U){const J=resolveTransitionHooks(U,o,s,a,l);return l&&l(J),J}};return F}function emptyPlaceholder(r){if(isKeepAlive(r))return r=cloneVNode(r),r.children=null,r}function getInnerChild$1(r){if(!isKeepAlive(r))return isTeleport(r.type)&&r.children?findNonCommentChild(r.children):r;const{shapeFlag:o,children:s}=r;if(s){if(o&16)return s[0];if(o&32&&isFunction$3(s.default))return s.default()}}function setTransitionHooks(r,o){r.shapeFlag&6&&r.component?(r.transition=o,setTransitionHooks(r.component.subTree,o)):r.shapeFlag&128?(r.ssContent.transition=o.clone(r.ssContent),r.ssFallback.transition=o.clone(r.ssFallback)):r.transition=o}function getTransitionRawChildren(r,o=!1,s){let a=[],l=0;for(let c=0;c1)for(let c=0;cs.value,set:c=>s.value=c})}return s}function setRef(r,o,s,a,l=!1){if(isArray$9(r)){r.forEach((T,k)=>setRef(T,o&&(isArray$9(o)?o[k]:o),s,a,l));return}if(isAsyncWrapper(a)&&!l){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&setRef(r,o,s,a.component.subTree);return}const c=a.shapeFlag&4?getComponentPublicInstance(a.component):a.el,u=l?null:c,{i:d,r:m}=r,g=o&&o.r,y=d.refs===EMPTY_OBJ?d.refs={}:d.refs,_=d.setupState,E=toRaw(_),w=_===EMPTY_OBJ?()=>!1:T=>hasOwn$3(E,T);if(g!=null&&g!==m&&(isString$5(g)?(y[g]=null,w(g)&&(_[g]=null)):isRef(g)&&(g.value=null)),isFunction$3(m))callWithErrorHandling(m,d,12,[u,y]);else{const T=isString$5(m),k=isRef(m);if(T||k){const O=()=>{if(r.f){const R=T?w(m)?_[m]:y[m]:m.value;l?isArray$9(R)&&remove(R,c):isArray$9(R)?R.includes(c)||R.push(c):T?(y[m]=[c],w(m)&&(_[m]=y[m])):(m.value=[c],r.k&&(y[r.k]=m.value))}else T?(y[m]=u,w(m)&&(_[m]=u)):k&&(m.value=u,r.k&&(y[r.k]=u))};u?(O.id=-1,queuePostRenderEffect(O,s)):O()}}}let hasLoggedMismatchError=!1;const logMismatchError=()=>{hasLoggedMismatchError||(console.error("Hydration completed but contains mismatches."),hasLoggedMismatchError=!0)},isSVGContainer=r=>r.namespaceURI.includes("svg")&&r.tagName!=="foreignObject",isMathMLContainer=r=>r.namespaceURI.includes("MathML"),getContainerType=r=>{if(r.nodeType===1){if(isSVGContainer(r))return"svg";if(isMathMLContainer(r))return"mathml"}},isComment=r=>r.nodeType===8;function createHydrationFunctions(r){const{mt:o,p:s,o:{patchProp:a,createText:l,nextSibling:c,parentNode:u,remove:d,insert:m,createComment:g}}=r,y=(N,D)=>{if(!D.hasChildNodes()){s(null,N,D),flushPostFlushCbs(),D._vnode=N;return}_(D.firstChild,N,null,null,null),flushPostFlushCbs(),D._vnode=N},_=(N,D,P,I,L,F=!1)=>{F=F||!!D.dynamicChildren;const U=isComment(N)&&N.data==="[",J=()=>k(N,D,P,I,L,U),{type:z,ref:ie,shapeFlag:ce,patchFlag:Y}=D;let B=N.nodeType;D.el=N,Y===-2&&(F=!1,D.dynamicChildren=null);let V=null;switch(z){case Text$1:B!==3?D.children===""?(m(D.el=l(""),u(N),N),V=N):V=J():(N.data!==D.children&&(logMismatchError(),N.data=D.children),V=c(N));break;case Comment$1:M(N)?(V=c(N),R(D.el=N.content.firstChild,N,P)):B!==8||U?V=J():V=c(N);break;case Static:if(U&&(N=c(N),B=N.nodeType),B===1||B===3){V=N;const Ge=!D.children.length;for(let St=0;St{F=F||!!D.dynamicChildren;const{type:U,props:J,patchFlag:z,shapeFlag:ie,dirs:ce,transition:Y}=D,B=U==="input"||U==="option";if(B||z!==-1){ce&&invokeDirectiveHook(D,null,P,"created");let V=!1;if(M(N)){V=needTransition(null,Y)&&P&&P.vnode.props&&P.vnode.props.appear;const St=N.content.firstChild;V&&Y.beforeEnter(St),R(St,N,P),D.el=N=St}if(ie&16&&!(J&&(J.innerHTML||J.textContent))){let St=w(N.firstChild,D,N,P,I,L,F);for(;St;){isMismatchAllowed(N,1)||logMismatchError();const Dee=St;St=St.nextSibling,d(Dee)}}else if(ie&8){let St=D.children;St[0]===` -`&&(N.tagName==="PRE"||N.tagName==="TEXTAREA")&&(St=St.slice(1)),N.textContent!==St&&(isMismatchAllowed(N,0)||logMismatchError(),N.textContent=D.children)}if(J){if(B||!F||z&48){const St=N.tagName.includes("-");for(const Dee in J)(B&&(Dee.endsWith("value")||Dee==="indeterminate")||isOn(Dee)&&!isReservedProp(Dee)||Dee[0]==="."||St)&&a(N,Dee,null,J[Dee],void 0,P)}else if(J.onClick)a(N,"onClick",null,J.onClick,void 0,P);else if(z&4&&isReactive(J.style))for(const St in J.style)J.style[St]}let Ge;(Ge=J&&J.onVnodeBeforeMount)&&invokeVNodeHook(Ge,P,D),ce&&invokeDirectiveHook(D,null,P,"beforeMount"),((Ge=J&&J.onVnodeMounted)||ce||V)&&queueEffectWithSuspense(()=>{Ge&&invokeVNodeHook(Ge,P,D),V&&Y.enter(N),ce&&invokeDirectiveHook(D,null,P,"mounted")},I)}return N.nextSibling},w=(N,D,P,I,L,F,U)=>{U=U||!!D.dynamicChildren;const J=D.children,z=J.length;for(let ie=0;ie{const{slotScopeIds:U}=D;U&&(L=L?L.concat(U):U);const J=u(N),z=w(c(N),D,J,P,I,L,F);return z&&isComment(z)&&z.data==="]"?c(D.anchor=z):(logMismatchError(),m(D.anchor=g("]"),J,z),z)},k=(N,D,P,I,L,F)=>{if(isMismatchAllowed(N.parentElement,1)||logMismatchError(),D.el=null,F){const z=O(N);for(;;){const ie=c(N);if(ie&&ie!==z)d(ie);else break}}const U=c(N),J=u(N);return d(N),s(null,D,J,U,P,I,getContainerType(J),L),P&&(P.vnode.el=D.el,updateHOCHostEl(P,D.el)),U},O=(N,D="[",P="]")=>{let I=0;for(;N;)if(N=c(N),N&&isComment(N)&&(N.data===D&&I++,N.data===P)){if(I===0)return c(N);I--}return N},R=(N,D,P)=>{const I=D.parentNode;I&&I.replaceChild(N,D);let L=P;for(;L;)L.vnode.el===D&&(L.vnode.el=L.subTree.el=N),L=L.parent},M=N=>N.nodeType===1&&N.tagName==="TEMPLATE";return[y,_]}const allowMismatchAttr="data-allow-mismatch",MismatchTypeString={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function isMismatchAllowed(r,o){if(o===0||o===1)for(;r&&!r.hasAttribute(allowMismatchAttr);)r=r.parentElement;const s=r&&r.getAttribute(allowMismatchAttr);if(s==null)return!1;if(s==="")return!0;{const a=s.split(",");return o===0&&a.includes("children")?!0:s.split(",").includes(MismatchTypeString[o])}}const requestIdleCallback$1=getGlobalThis$1().requestIdleCallback||(r=>setTimeout(r,1)),cancelIdleCallback$1=getGlobalThis$1().cancelIdleCallback||(r=>clearTimeout(r)),hydrateOnIdle=(r=1e4)=>o=>{const s=requestIdleCallback$1(o,{timeout:r});return()=>cancelIdleCallback$1(s)};function elementIsVisibleInViewport(r){const{top:o,left:s,bottom:a,right:l}=r.getBoundingClientRect(),{innerHeight:c,innerWidth:u}=window;return(o>0&&o0&&a0&&s0&&l(o,s)=>{const a=new IntersectionObserver(l=>{for(const c of l)if(c.isIntersecting){a.disconnect(),o();break}},r);return s(l=>{if(l instanceof Element){if(elementIsVisibleInViewport(l))return o(),a.disconnect(),!1;a.observe(l)}}),()=>a.disconnect()},hydrateOnMediaQuery=r=>o=>{if(r){const s=matchMedia(r);if(s.matches)o();else return s.addEventListener("change",o,{once:!0}),()=>s.removeEventListener("change",o)}},hydrateOnInteraction=(r=[])=>(o,s)=>{isString$5(r)&&(r=[r]);let a=!1;const l=u=>{a||(a=!0,c(),o(),u.target.dispatchEvent(new u.constructor(u.type,u)))},c=()=>{s(u=>{for(const d of r)u.removeEventListener(d,l)})};return s(u=>{for(const d of r)u.addEventListener(d,l,{once:!0})}),c};function forEachElement(r,o){if(isComment(r)&&r.data==="["){let s=1,a=r.nextSibling;for(;a;){if(a.nodeType===1){if(o(a)===!1)break}else if(isComment(a))if(a.data==="]"){if(--s===0)break}else a.data==="["&&s++;a=a.nextSibling}}else o(r)}const isAsyncWrapper=r=>!!r.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function defineAsyncComponent(r){isFunction$3(r)&&(r={loader:r});const{loader:o,loadingComponent:s,errorComponent:a,delay:l=200,hydrate:c,timeout:u,suspensible:d=!0,onError:m}=r;let g=null,y,_=0;const E=()=>(_++,g=null,w()),w=()=>{let T;return g||(T=g=o().catch(k=>{if(k=k instanceof Error?k:new Error(String(k)),m)return new Promise((O,R)=>{m(k,()=>O(E()),()=>R(k),_+1)});throw k}).then(k=>T!==g&&g?g:(k&&(k.__esModule||k[Symbol.toStringTag]==="Module")&&(k=k.default),y=k,k)))};return defineComponent({name:"AsyncComponentWrapper",__asyncLoader:w,__asyncHydrate(T,k,O){const R=c?()=>{const M=c(O,N=>forEachElement(T,N));M&&(k.bum||(k.bum=[])).push(M)}:O;y?R():w().then(()=>!k.isUnmounted&&R())},get __asyncResolved(){return y},setup(){const T=currentInstance;if(markAsyncBoundary(T),y)return()=>createInnerComp(y,T);const k=N=>{g=null,handleError(N,T,13,!a)};if(d&&T.suspense||isInSSRComponentSetup)return w().then(N=>()=>createInnerComp(N,T)).catch(N=>(k(N),()=>a?createVNode(a,{error:N}):null));const O=ref$1(!1),R=ref$1(),M=ref$1(!!l);return l&&setTimeout(()=>{M.value=!1},l),u!=null&&setTimeout(()=>{if(!O.value&&!R.value){const N=new Error(`Async component timed out after ${u}ms.`);k(N),R.value=N}},u),w().then(()=>{O.value=!0,T.parent&&isKeepAlive(T.parent.vnode)&&T.parent.update()}).catch(N=>{k(N),R.value=N}),()=>{if(O.value&&y)return createInnerComp(y,T);if(R.value&&a)return createVNode(a,{error:R.value});if(s&&!M.value)return createVNode(s)}}})}function createInnerComp(r,o){const{ref:s,props:a,children:l,ce:c}=o.vnode,u=createVNode(r,a,l);return u.ref=s,u.ce=c,delete o.vnode.ce,u}const isKeepAlive=r=>r.type.__isKeepAlive,KeepAliveImpl={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(r,{slots:o}){const s=getCurrentInstance(),a=s.ctx;if(!a.renderer)return()=>{const M=o.default&&o.default();return M&&M.length===1?M[0]:M};const l=new Map,c=new Set;let u=null;const d=s.suspense,{renderer:{p:m,m:g,um:y,o:{createElement:_}}}=a,E=_("div");a.activate=(M,N,D,P,I)=>{const L=M.component;g(M,N,D,0,d),m(L.vnode,M,N,D,L,d,P,M.slotScopeIds,I),queuePostRenderEffect(()=>{L.isDeactivated=!1,L.a&&invokeArrayFns(L.a);const F=M.props&&M.props.onVnodeMounted;F&&invokeVNodeHook(F,L.parent,M)},d)},a.deactivate=M=>{const N=M.component;invalidateMount(N.m),invalidateMount(N.a),g(M,E,null,1,d),queuePostRenderEffect(()=>{N.da&&invokeArrayFns(N.da);const D=M.props&&M.props.onVnodeUnmounted;D&&invokeVNodeHook(D,N.parent,M),N.isDeactivated=!0},d)};function w(M){resetShapeFlag(M),y(M,s,d,!0)}function T(M){l.forEach((N,D)=>{const P=getComponentName(N.type);P&&!M(P)&&k(D)})}function k(M){const N=l.get(M);N&&(!u||!isSameVNodeType(N,u))?w(N):u&&resetShapeFlag(u),l.delete(M),c.delete(M)}watch(()=>[r.include,r.exclude],([M,N])=>{M&&T(D=>matches$2(M,D)),N&&T(D=>!matches$2(N,D))},{flush:"post",deep:!0});let O=null;const R=()=>{O!=null&&(isSuspense(s.subTree.type)?queuePostRenderEffect(()=>{l.set(O,getInnerChild(s.subTree))},s.subTree.suspense):l.set(O,getInnerChild(s.subTree)))};return onMounted(R),onUpdated(R),onBeforeUnmount(()=>{l.forEach(M=>{const{subTree:N,suspense:D}=s,P=getInnerChild(N);if(M.type===P.type&&M.key===P.key){resetShapeFlag(P);const I=P.component.da;I&&queuePostRenderEffect(I,D);return}w(M)})}),()=>{if(O=null,!o.default)return u=null;const M=o.default(),N=M[0];if(M.length>1)return u=null,M;if(!isVNode$1(N)||!(N.shapeFlag&4)&&!(N.shapeFlag&128))return u=null,N;let D=getInnerChild(N);if(D.type===Comment$1)return u=null,D;const P=D.type,I=getComponentName(isAsyncWrapper(D)?D.type.__asyncResolved||{}:P),{include:L,exclude:F,max:U}=r;if(L&&(!I||!matches$2(L,I))||F&&I&&matches$2(F,I))return D.shapeFlag&=-257,u=D,N;const J=D.key==null?P:D.key,z=l.get(J);return D.el&&(D=cloneVNode(D),N.shapeFlag&128&&(N.ssContent=D)),O=J,z?(D.el=z.el,D.component=z.component,D.transition&&setTransitionHooks(D,D.transition),D.shapeFlag|=512,c.delete(J),c.add(J)):(c.add(J),U&&c.size>parseInt(U,10)&&k(c.values().next().value)),D.shapeFlag|=256,u=D,isSuspense(N.type)?N:D}}},KeepAlive=KeepAliveImpl;function matches$2(r,o){return isArray$9(r)?r.some(s=>matches$2(s,o)):isString$5(r)?r.split(",").includes(o):isRegExp$5(r)?(r.lastIndex=0,r.test(o)):!1}function onActivated(r,o){registerKeepAliveHook(r,"a",o)}function onDeactivated(r,o){registerKeepAliveHook(r,"da",o)}function registerKeepAliveHook(r,o,s=currentInstance){const a=r.__wdc||(r.__wdc=()=>{let l=s;for(;l;){if(l.isDeactivated)return;l=l.parent}return r()});if(injectHook(o,a,s),s){let l=s.parent;for(;l&&l.parent;)isKeepAlive(l.parent.vnode)&&injectToKeepAliveRoot(a,o,s,l),l=l.parent}}function injectToKeepAliveRoot(r,o,s,a){const l=injectHook(o,r,a,!0);onUnmounted(()=>{remove(a[o],l)},s)}function resetShapeFlag(r){r.shapeFlag&=-257,r.shapeFlag&=-513}function getInnerChild(r){return r.shapeFlag&128?r.ssContent:r}function injectHook(r,o,s=currentInstance,a=!1){if(s){const l=s[r]||(s[r]=[]),c=o.__weh||(o.__weh=(...u)=>{pauseTracking();const d=setCurrentInstance(s),m=callWithAsyncErrorHandling(o,s,r,u);return d(),resetTracking(),m});return a?l.unshift(c):l.push(c),c}}const createHook=r=>(o,s=currentInstance)=>{(!isInSSRComponentSetup||r==="sp")&&injectHook(r,(...a)=>o(...a),s)},onBeforeMount=createHook("bm"),onMounted=createHook("m"),onBeforeUpdate=createHook("bu"),onUpdated=createHook("u"),onBeforeUnmount=createHook("bum"),onUnmounted=createHook("um"),onServerPrefetch=createHook("sp"),onRenderTriggered=createHook("rtg"),onRenderTracked=createHook("rtc");function onErrorCaptured(r,o=currentInstance){injectHook("ec",r,o)}const COMPONENTS="components",DIRECTIVES="directives";function resolveComponent(r,o){return resolveAsset(COMPONENTS,r,!0,o)||r}const NULL_DYNAMIC_COMPONENT=Symbol.for("v-ndc");function resolveDynamicComponent(r){return isString$5(r)?resolveAsset(COMPONENTS,r,!1)||r:r||NULL_DYNAMIC_COMPONENT}function resolveDirective(r){return resolveAsset(DIRECTIVES,r)}function resolveAsset(r,o,s=!0,a=!1){const l=currentRenderingInstance||currentInstance;if(l){const c=l.type;if(r===COMPONENTS){const d=getComponentName(c,!1);if(d&&(d===o||d===camelize(o)||d===capitalize$1(camelize(o))))return c}const u=resolve(l[r]||c[r],o)||resolve(l.appContext[r],o);return!u&&a?c:u}}function resolve(r,o){return r&&(r[o]||r[camelize(o)]||r[capitalize$1(camelize(o))])}function renderList(r,o,s,a){let l;const c=s&&s[a],u=isArray$9(r);if(u||isString$5(r)){const d=u&&isReactive(r);let m=!1;d&&(m=!isShallow(r),r=shallowReadArray(r)),l=new Array(r.length);for(let g=0,y=r.length;go(d,m,void 0,c&&c[m]));else{const d=Object.keys(r);l=new Array(d.length);for(let m=0,g=d.length;m{const c=a.fn(...l);return c&&(c.key=a.key),c}:a.fn)}return r}function renderSlot(r,o,s={},a,l){if(currentRenderingInstance.ce||currentRenderingInstance.parent&&isAsyncWrapper(currentRenderingInstance.parent)&¤tRenderingInstance.parent.ce)return o!=="default"&&(s.name=o),openBlock(),createBlock(Fragment,null,[createVNode("slot",s,a&&a())],64);let c=r[o];c&&c._c&&(c._d=!1),openBlock();const u=c&&ensureValidVNode(c(s)),d=s.key||u&&u.key,m=createBlock(Fragment,{key:(d&&!isSymbol$2(d)?d:`_${o}`)+(!u&&a?"_fb":"")},u||(a?a():[]),u&&r._===1?64:-2);return!l&&m.scopeId&&(m.slotScopeIds=[m.scopeId+"-s"]),c&&c._c&&(c._d=!0),m}function ensureValidVNode(r){return r.some(o=>isVNode$1(o)?!(o.type===Comment$1||o.type===Fragment&&!ensureValidVNode(o.children)):!0)?r:null}function toHandlers(r,o){const s={};for(const a in r)s[o&&/[A-Z]/.test(a)?`on:${a}`:toHandlerKey(a)]=r[a];return s}const getPublicInstance=r=>r?isStatefulComponent(r)?getComponentPublicInstance(r):getPublicInstance(r.parent):null,publicPropertiesMap=extend$3(Object.create(null),{$:r=>r,$el:r=>r.vnode.el,$data:r=>r.data,$props:r=>r.props,$attrs:r=>r.attrs,$slots:r=>r.slots,$refs:r=>r.refs,$parent:r=>getPublicInstance(r.parent),$root:r=>getPublicInstance(r.root),$host:r=>r.ce,$emit:r=>r.emit,$options:r=>resolveMergedOptions(r),$forceUpdate:r=>r.f||(r.f=()=>{queueJob(r.update)}),$nextTick:r=>r.n||(r.n=nextTick.bind(r.proxy)),$watch:r=>instanceWatch.bind(r)}),hasSetupBinding=(r,o)=>r!==EMPTY_OBJ&&!r.__isScriptSetup&&hasOwn$3(r,o),PublicInstanceProxyHandlers={get({_:r},o){if(o==="__v_skip")return!0;const{ctx:s,setupState:a,data:l,props:c,accessCache:u,type:d,appContext:m}=r;let g;if(o[0]!=="$"){const w=u[o];if(w!==void 0)switch(w){case 1:return a[o];case 2:return l[o];case 4:return s[o];case 3:return c[o]}else{if(hasSetupBinding(a,o))return u[o]=1,a[o];if(l!==EMPTY_OBJ&&hasOwn$3(l,o))return u[o]=2,l[o];if((g=r.propsOptions[0])&&hasOwn$3(g,o))return u[o]=3,c[o];if(s!==EMPTY_OBJ&&hasOwn$3(s,o))return u[o]=4,s[o];shouldCacheAccess&&(u[o]=0)}}const y=publicPropertiesMap[o];let _,E;if(y)return o==="$attrs"&&track(r.attrs,"get",""),y(r);if((_=d.__cssModules)&&(_=_[o]))return _;if(s!==EMPTY_OBJ&&hasOwn$3(s,o))return u[o]=4,s[o];if(E=m.config.globalProperties,hasOwn$3(E,o))return E[o]},set({_:r},o,s){const{data:a,setupState:l,ctx:c}=r;return hasSetupBinding(l,o)?(l[o]=s,!0):a!==EMPTY_OBJ&&hasOwn$3(a,o)?(a[o]=s,!0):hasOwn$3(r.props,o)||o[0]==="$"&&o.slice(1)in r?!1:(c[o]=s,!0)},has({_:{data:r,setupState:o,accessCache:s,ctx:a,appContext:l,propsOptions:c}},u){let d;return!!s[u]||r!==EMPTY_OBJ&&hasOwn$3(r,u)||hasSetupBinding(o,u)||(d=c[0])&&hasOwn$3(d,u)||hasOwn$3(a,u)||hasOwn$3(publicPropertiesMap,u)||hasOwn$3(l.config.globalProperties,u)},defineProperty(r,o,s){return s.get!=null?r._.accessCache[o]=0:hasOwn$3(s,"value")&&this.set(r,o,s.value,null),Reflect.defineProperty(r,o,s)}},RuntimeCompiledPublicInstanceProxyHandlers=extend$3({},PublicInstanceProxyHandlers,{get(r,o){if(o!==Symbol.unscopables)return PublicInstanceProxyHandlers.get(r,o,r)},has(r,o){return o[0]!=="_"&&!isGloballyAllowed(o)}});function defineProps(){return null}function defineEmits(){return null}function defineExpose(r){}function defineOptions(r){}function defineSlots(){return null}function defineModel(){}function withDefaults(r,o){return null}function useSlots(){return getContext().slots}function useAttrs(){return getContext().attrs}function getContext(){const r=getCurrentInstance();return r.setupContext||(r.setupContext=createSetupContext(r))}function normalizePropsOrEmits(r){return isArray$9(r)?r.reduce((o,s)=>(o[s]=null,o),{}):r}function mergeDefaults(r,o){const s=normalizePropsOrEmits(r);for(const a in o){if(a.startsWith("__skip"))continue;let l=s[a];l?isArray$9(l)||isFunction$3(l)?l=s[a]={type:l,default:o[a]}:l.default=o[a]:l===null&&(l=s[a]={default:o[a]}),l&&o[`__skip_${a}`]&&(l.skipFactory=!0)}return s}function mergeModels(r,o){return!r||!o?r||o:isArray$9(r)&&isArray$9(o)?r.concat(o):extend$3({},normalizePropsOrEmits(r),normalizePropsOrEmits(o))}function createPropsRestProxy(r,o){const s={};for(const a in r)o.includes(a)||Object.defineProperty(s,a,{enumerable:!0,get:()=>r[a]});return s}function withAsyncContext(r){const o=getCurrentInstance();let s=r();return unsetCurrentInstance(),isPromise$1(s)&&(s=s.catch(a=>{throw setCurrentInstance(o),a})),[s,()=>setCurrentInstance(o)]}let shouldCacheAccess=!0;function applyOptions(r){const o=resolveMergedOptions(r),s=r.proxy,a=r.ctx;shouldCacheAccess=!1,o.beforeCreate&&callHook$1(o.beforeCreate,r,"bc");const{data:l,computed:c,methods:u,watch:d,provide:m,inject:g,created:y,beforeMount:_,mounted:E,beforeUpdate:w,updated:T,activated:k,deactivated:O,beforeDestroy:R,beforeUnmount:M,destroyed:N,unmounted:D,render:P,renderTracked:I,renderTriggered:L,errorCaptured:F,serverPrefetch:U,expose:J,inheritAttrs:z,components:ie,directives:ce,filters:Y}=o;if(g&&resolveInjections(g,a,null),u)for(const Ge in u){const St=u[Ge];isFunction$3(St)&&(a[Ge]=St.bind(s))}if(l){const Ge=l.call(s,s);isObject$7(Ge)&&(r.data=reactive(Ge))}if(shouldCacheAccess=!0,c)for(const Ge in c){const St=c[Ge],Dee=isFunction$3(St)?St.bind(s,s):isFunction$3(St.get)?St.get.bind(s,s):NOOP,pee=!isFunction$3(St)&&isFunction$3(St.set)?St.set.bind(s):NOOP,jr=computed({get:Dee,set:pee});Object.defineProperty(a,Ge,{enumerable:!0,configurable:!0,get:()=>jr.value,set:Tee=>jr.value=Tee})}if(d)for(const Ge in d)createWatcher(d[Ge],a,s,Ge);if(m){const Ge=isFunction$3(m)?m.call(s):m;Reflect.ownKeys(Ge).forEach(St=>{provide(St,Ge[St])})}y&&callHook$1(y,r,"c");function V(Ge,St){isArray$9(St)?St.forEach(Dee=>Ge(Dee.bind(s))):St&&Ge(St.bind(s))}if(V(onBeforeMount,_),V(onMounted,E),V(onBeforeUpdate,w),V(onUpdated,T),V(onActivated,k),V(onDeactivated,O),V(onErrorCaptured,F),V(onRenderTracked,I),V(onRenderTriggered,L),V(onBeforeUnmount,M),V(onUnmounted,D),V(onServerPrefetch,U),isArray$9(J))if(J.length){const Ge=r.exposed||(r.exposed={});J.forEach(St=>{Object.defineProperty(Ge,St,{get:()=>s[St],set:Dee=>s[St]=Dee})})}else r.exposed||(r.exposed={});P&&r.render===NOOP&&(r.render=P),z!=null&&(r.inheritAttrs=z),ie&&(r.components=ie),ce&&(r.directives=ce),U&&markAsyncBoundary(r)}function resolveInjections(r,o,s=NOOP){isArray$9(r)&&(r=normalizeInject(r));for(const a in r){const l=r[a];let c;isObject$7(l)?"default"in l?c=inject(l.from||a,l.default,!0):c=inject(l.from||a):c=inject(l),isRef(c)?Object.defineProperty(o,a,{enumerable:!0,configurable:!0,get:()=>c.value,set:u=>c.value=u}):o[a]=c}}function callHook$1(r,o,s){callWithAsyncErrorHandling(isArray$9(r)?r.map(a=>a.bind(o.proxy)):r.bind(o.proxy),o,s)}function createWatcher(r,o,s,a){let l=a.includes(".")?createPathGetter(s,a):()=>s[a];if(isString$5(r)){const c=o[r];isFunction$3(c)&&watch(l,c)}else if(isFunction$3(r))watch(l,r.bind(s));else if(isObject$7(r))if(isArray$9(r))r.forEach(c=>createWatcher(c,o,s,a));else{const c=isFunction$3(r.handler)?r.handler.bind(s):o[r.handler];isFunction$3(c)&&watch(l,c,r)}}function resolveMergedOptions(r){const o=r.type,{mixins:s,extends:a}=o,{mixins:l,optionsCache:c,config:{optionMergeStrategies:u}}=r.appContext,d=c.get(o);let m;return d?m=d:!l.length&&!s&&!a?m=o:(m={},l.length&&l.forEach(g=>mergeOptions$1(m,g,u,!0)),mergeOptions$1(m,o,u)),isObject$7(o)&&c.set(o,m),m}function mergeOptions$1(r,o,s,a=!1){const{mixins:l,extends:c}=o;c&&mergeOptions$1(r,c,s,!0),l&&l.forEach(u=>mergeOptions$1(r,u,s,!0));for(const u in o)if(!(a&&u==="expose")){const d=internalOptionMergeStrats[u]||s&&s[u];r[u]=d?d(r[u],o[u]):o[u]}return r}const internalOptionMergeStrats={data:mergeDataFn,props:mergeEmitsOrPropsOptions,emits:mergeEmitsOrPropsOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray,created:mergeAsArray,beforeMount:mergeAsArray,mounted:mergeAsArray,beforeUpdate:mergeAsArray,updated:mergeAsArray,beforeDestroy:mergeAsArray,beforeUnmount:mergeAsArray,destroyed:mergeAsArray,unmounted:mergeAsArray,activated:mergeAsArray,deactivated:mergeAsArray,errorCaptured:mergeAsArray,serverPrefetch:mergeAsArray,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject};function mergeDataFn(r,o){return o?r?function(){return extend$3(isFunction$3(r)?r.call(this,this):r,isFunction$3(o)?o.call(this,this):o)}:o:r}function mergeInject(r,o){return mergeObjectOptions(normalizeInject(r),normalizeInject(o))}function normalizeInject(r){if(isArray$9(r)){const o={};for(let s=0;s1)return s&&isFunction$3(o)?o.call(a&&a.proxy):o}}function hasInjectionContext(){return!!(currentInstance||currentRenderingInstance||currentApp)}const internalObjectProto={},createInternalObject=()=>Object.create(internalObjectProto),isInternalObject=r=>Object.getPrototypeOf(r)===internalObjectProto;function initProps(r,o,s,a=!1){const l={},c=createInternalObject();r.propsDefaults=Object.create(null),setFullProps(r,o,l,c);for(const u in r.propsOptions[0])u in l||(l[u]=void 0);s?r.props=a?l:shallowReactive(l):r.type.props?r.props=l:r.props=c,r.attrs=c}function updateProps(r,o,s,a){const{props:l,attrs:c,vnode:{patchFlag:u}}=r,d=toRaw(l),[m]=r.propsOptions;let g=!1;if((a||u>0)&&!(u&16)){if(u&8){const y=r.vnode.dynamicProps;for(let _=0;_{m=!0;const[E,w]=normalizePropsOptions(_,o,!0);extend$3(u,E),w&&d.push(...w)};!s&&o.mixins.length&&o.mixins.forEach(y),r.extends&&y(r.extends),r.mixins&&r.mixins.forEach(y)}if(!c&&!m)return isObject$7(r)&&a.set(r,EMPTY_ARR),EMPTY_ARR;if(isArray$9(c))for(let y=0;yr[0]==="_"||r==="$stable",normalizeSlotValue=r=>isArray$9(r)?r.map(normalizeVNode):[normalizeVNode(r)],normalizeSlot$1=(r,o,s)=>{if(o._n)return o;const a=withCtx((...l)=>normalizeSlotValue(o(...l)),s);return a._c=!1,a},normalizeObjectSlots=(r,o,s)=>{const a=r._ctx;for(const l in r){if(isInternalKey(l))continue;const c=r[l];if(isFunction$3(c))o[l]=normalizeSlot$1(l,c,a);else if(c!=null){const u=normalizeSlotValue(c);o[l]=()=>u}}},normalizeVNodeSlots=(r,o)=>{const s=normalizeSlotValue(o);r.slots.default=()=>s},assignSlots=(r,o,s)=>{for(const a in o)(s||a!=="_")&&(r[a]=o[a])},initSlots=(r,o,s)=>{const a=r.slots=createInternalObject();if(r.vnode.shapeFlag&32){const l=o._;l?(assignSlots(a,o,s),s&&def(a,"_",l,!0)):normalizeObjectSlots(o,a)}else o&&normalizeVNodeSlots(r,o)},updateSlots=(r,o,s)=>{const{vnode:a,slots:l}=r;let c=!0,u=EMPTY_OBJ;if(a.shapeFlag&32){const d=o._;d?s&&d===1?c=!1:assignSlots(l,o,s):(c=!o.$stable,normalizeObjectSlots(o,l)),u=o}else o&&(normalizeVNodeSlots(r,o),u={default:1});if(c)for(const d in l)!isInternalKey(d)&&u[d]==null&&delete l[d]},queuePostRenderEffect=queueEffectWithSuspense;function createRenderer(r){return baseCreateRenderer(r)}function createHydrationRenderer(r){return baseCreateRenderer(r,createHydrationFunctions)}function baseCreateRenderer(r,o){const s=getGlobalThis$1();s.__VUE__=!0;const{insert:a,remove:l,patchProp:c,createElement:u,createText:d,createComment:m,setText:g,setElementText:y,parentNode:_,nextSibling:E,setScopeId:w=NOOP,insertStaticContent:T}=r,k=(_ee,st,Lee,$te=null,Kee=null,Iee=null,Rte=void 0,dee=null,fee=!!st.dynamicChildren)=>{if(_ee===st)return;_ee&&!isSameVNodeType(_ee,st)&&($te=xte(_ee),Tee(_ee,Kee,Iee,!0),_ee=null),st.patchFlag===-2&&(fee=!1,st.dynamicChildren=null);const{type:Oee,ref:xee,shapeFlag:kee}=st;switch(Oee){case Text$1:O(_ee,st,Lee,$te);break;case Comment$1:R(_ee,st,Lee,$te);break;case Static:_ee==null&&M(st,Lee,$te,Rte);break;case Fragment:ie(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee);break;default:kee&1?P(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee):kee&6?ce(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee):(kee&64||kee&128)&&Oee.process(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee,Wee)}xee!=null&&Kee&&setRef(xee,_ee&&_ee.ref,Iee,st||_ee,!st)},O=(_ee,st,Lee,$te)=>{if(_ee==null)a(st.el=d(st.children),Lee,$te);else{const Kee=st.el=_ee.el;st.children!==_ee.children&&g(Kee,st.children)}},R=(_ee,st,Lee,$te)=>{_ee==null?a(st.el=m(st.children||""),Lee,$te):st.el=_ee.el},M=(_ee,st,Lee,$te)=>{[_ee.el,_ee.anchor]=T(_ee.children,st,Lee,$te,_ee.el,_ee.anchor)},N=({el:_ee,anchor:st},Lee,$te)=>{let Kee;for(;_ee&&_ee!==st;)Kee=E(_ee),a(_ee,Lee,$te),_ee=Kee;a(st,Lee,$te)},D=({el:_ee,anchor:st})=>{let Lee;for(;_ee&&_ee!==st;)Lee=E(_ee),l(_ee),_ee=Lee;l(st)},P=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{st.type==="svg"?Rte="svg":st.type==="math"&&(Rte="mathml"),_ee==null?I(st,Lee,$te,Kee,Iee,Rte,dee,fee):U(_ee,st,Kee,Iee,Rte,dee,fee)},I=(_ee,st,Lee,$te,Kee,Iee,Rte,dee)=>{let fee,Oee;const{props:xee,shapeFlag:kee,transition:Dte,dirs:Ite}=_ee;if(fee=_ee.el=u(_ee.type,Iee,xee&&xee.is,xee),kee&8?y(fee,_ee.children):kee&16&&F(_ee.children,fee,null,$te,Kee,resolveChildrenNamespace(_ee,Iee),Rte,dee),Ite&&invokeDirectiveHook(_ee,null,$te,"created"),L(fee,_ee,_ee.scopeId,Rte,$te),xee){for(const Vte in xee)Vte!=="value"&&!isReservedProp(Vte)&&c(fee,Vte,null,xee[Vte],Iee,$te);"value"in xee&&c(fee,"value",null,xee.value,Iee),(Oee=xee.onVnodeBeforeMount)&&invokeVNodeHook(Oee,$te,_ee)}Ite&&invokeDirectiveHook(_ee,null,$te,"beforeMount");const Lte=needTransition(Kee,Dte);Lte&&Dte.beforeEnter(fee),a(fee,st,Lee),((Oee=xee&&xee.onVnodeMounted)||Lte||Ite)&&queuePostRenderEffect(()=>{Oee&&invokeVNodeHook(Oee,$te,_ee),Lte&&Dte.enter(fee),Ite&&invokeDirectiveHook(_ee,null,$te,"mounted")},Kee)},L=(_ee,st,Lee,$te,Kee)=>{if(Lee&&w(_ee,Lee),$te)for(let Iee=0;Iee<$te.length;Iee++)w(_ee,$te[Iee]);if(Kee){let Iee=Kee.subTree;if(st===Iee||isSuspense(Iee.type)&&(Iee.ssContent===st||Iee.ssFallback===st)){const Rte=Kee.vnode;L(_ee,Rte,Rte.scopeId,Rte.slotScopeIds,Kee.parent)}}},F=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee=0)=>{for(let Oee=fee;Oee<_ee.length;Oee++){const xee=_ee[Oee]=dee?cloneIfMounted(_ee[Oee]):normalizeVNode(_ee[Oee]);k(null,xee,st,Lee,$te,Kee,Iee,Rte,dee)}},U=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=st.el=_ee.el;let{patchFlag:fee,dynamicChildren:Oee,dirs:xee}=st;fee|=_ee.patchFlag&16;const kee=_ee.props||EMPTY_OBJ,Dte=st.props||EMPTY_OBJ;let Ite;if(Lee&&toggleRecurse(Lee,!1),(Ite=Dte.onVnodeBeforeUpdate)&&invokeVNodeHook(Ite,Lee,st,_ee),xee&&invokeDirectiveHook(st,_ee,Lee,"beforeUpdate"),Lee&&toggleRecurse(Lee,!0),(kee.innerHTML&&Dte.innerHTML==null||kee.textContent&&Dte.textContent==null)&&y(dee,""),Oee?J(_ee.dynamicChildren,Oee,dee,Lee,$te,resolveChildrenNamespace(st,Kee),Iee):Rte||St(_ee,st,dee,null,Lee,$te,resolveChildrenNamespace(st,Kee),Iee,!1),fee>0){if(fee&16)z(dee,kee,Dte,Lee,Kee);else if(fee&2&&kee.class!==Dte.class&&c(dee,"class",null,Dte.class,Kee),fee&4&&c(dee,"style",kee.style,Dte.style,Kee),fee&8){const Lte=st.dynamicProps;for(let Vte=0;Vte{Ite&&invokeVNodeHook(Ite,Lee,st,_ee),xee&&invokeDirectiveHook(st,_ee,Lee,"updated")},$te)},J=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{for(let dee=0;dee{if(st!==Lee){if(st!==EMPTY_OBJ)for(const Iee in st)!isReservedProp(Iee)&&!(Iee in Lee)&&c(_ee,Iee,st[Iee],null,Kee,$te);for(const Iee in Lee){if(isReservedProp(Iee))continue;const Rte=Lee[Iee],dee=st[Iee];Rte!==dee&&Iee!=="value"&&c(_ee,Iee,dee,Rte,Kee,$te)}"value"in Lee&&c(_ee,"value",st.value,Lee.value,Kee)}},ie=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{const Oee=st.el=_ee?_ee.el:d(""),xee=st.anchor=_ee?_ee.anchor:d("");let{patchFlag:kee,dynamicChildren:Dte,slotScopeIds:Ite}=st;Ite&&(dee=dee?dee.concat(Ite):Ite),_ee==null?(a(Oee,Lee,$te),a(xee,Lee,$te),F(st.children||[],Lee,xee,Kee,Iee,Rte,dee,fee)):kee>0&&kee&64&&Dte&&_ee.dynamicChildren?(J(_ee.dynamicChildren,Dte,Lee,Kee,Iee,Rte,dee),(st.key!=null||Kee&&st===Kee.subTree)&&traverseStaticChildren(_ee,st,!0)):St(_ee,st,Lee,xee,Kee,Iee,Rte,dee,fee)},ce=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{st.slotScopeIds=dee,_ee==null?st.shapeFlag&512?Kee.ctx.activate(st,Lee,$te,Rte,fee):Y(st,Lee,$te,Kee,Iee,Rte,fee):B(_ee,st,fee)},Y=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=_ee.component=createComponentInstance(_ee,$te,Kee);if(isKeepAlive(_ee)&&(dee.ctx.renderer=Wee),setupComponent(dee,!1,Rte),dee.asyncDep){if(Kee&&Kee.registerDep(dee,V,Rte),!_ee.el){const fee=dee.subTree=createVNode(Comment$1);R(null,fee,st,Lee)}}else V(dee,_ee,st,Lee,Kee,Iee,Rte)},B=(_ee,st,Lee)=>{const $te=st.component=_ee.component;if(shouldUpdateComponent(_ee,st,Lee))if($te.asyncDep&&!$te.asyncResolved){Ge($te,st,Lee);return}else $te.next=st,$te.update();else st.el=_ee.el,$te.vnode=st},V=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=()=>{if(_ee.isMounted){let{next:kee,bu:Dte,u:Ite,parent:Lte,vnode:Vte}=_ee;{const jte=locateNonHydratedAsyncRoot(_ee);if(jte){kee&&(kee.el=Vte.el,Ge(_ee,kee,Rte)),jte.asyncDep.then(()=>{_ee.isUnmounted||dee()});return}}let Pte=kee,Fte;toggleRecurse(_ee,!1),kee?(kee.el=Vte.el,Ge(_ee,kee,Rte)):kee=Vte,Dte&&invokeArrayFns(Dte),(Fte=kee.props&&kee.props.onVnodeBeforeUpdate)&&invokeVNodeHook(Fte,Lte,kee,Vte),toggleRecurse(_ee,!0);const Ute=renderComponentRoot(_ee),Gte=_ee.subTree;_ee.subTree=Ute,k(Gte,Ute,_(Gte.el),xte(Gte),_ee,Kee,Iee),kee.el=Ute.el,Pte===null&&updateHOCHostEl(_ee,Ute.el),Ite&&queuePostRenderEffect(Ite,Kee),(Fte=kee.props&&kee.props.onVnodeUpdated)&&queuePostRenderEffect(()=>invokeVNodeHook(Fte,Lte,kee,Vte),Kee)}else{let kee;const{el:Dte,props:Ite}=st,{bm:Lte,m:Vte,parent:Pte,root:Fte,type:Ute}=_ee,Gte=isAsyncWrapper(st);if(toggleRecurse(_ee,!1),Lte&&invokeArrayFns(Lte),!Gte&&(kee=Ite&&Ite.onVnodeBeforeMount)&&invokeVNodeHook(kee,Pte,st),toggleRecurse(_ee,!0),Dte&&Nte){const jte=()=>{_ee.subTree=renderComponentRoot(_ee),Nte(Dte,_ee.subTree,_ee,Kee,null)};Gte&&Ute.__asyncHydrate?Ute.__asyncHydrate(Dte,_ee,jte):jte()}else{Fte.ce&&Fte.ce._injectChildStyle(Ute);const jte=_ee.subTree=renderComponentRoot(_ee);k(null,jte,Lee,$te,_ee,Kee,Iee),st.el=jte.el}if(Vte&&queuePostRenderEffect(Vte,Kee),!Gte&&(kee=Ite&&Ite.onVnodeMounted)){const jte=st;queuePostRenderEffect(()=>invokeVNodeHook(kee,Pte,jte),Kee)}(st.shapeFlag&256||Pte&&isAsyncWrapper(Pte.vnode)&&Pte.vnode.shapeFlag&256)&&_ee.a&&queuePostRenderEffect(_ee.a,Kee),_ee.isMounted=!0,st=Lee=$te=null}};_ee.scope.on();const fee=_ee.effect=new ReactiveEffect(dee);_ee.scope.off();const Oee=_ee.update=fee.run.bind(fee),xee=_ee.job=fee.runIfDirty.bind(fee);xee.i=_ee,xee.id=_ee.uid,fee.scheduler=()=>queueJob(xee),toggleRecurse(_ee,!0),Oee()},Ge=(_ee,st,Lee)=>{st.component=_ee;const $te=_ee.vnode.props;_ee.vnode=st,_ee.next=null,updateProps(_ee,st.props,$te,Lee),updateSlots(_ee,st.children,Lee),pauseTracking(),flushPreFlushCbs(_ee),resetTracking()},St=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee=!1)=>{const Oee=_ee&&_ee.children,xee=_ee?_ee.shapeFlag:0,kee=st.children,{patchFlag:Dte,shapeFlag:Ite}=st;if(Dte>0){if(Dte&128){pee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee);return}else if(Dte&256){Dee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee);return}}Ite&8?(xee&16&&ete(Oee,Kee,Iee),kee!==Oee&&y(Lee,kee)):xee&16?Ite&16?pee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee):ete(Oee,Kee,Iee,!0):(xee&8&&y(Lee,""),Ite&16&&F(kee,Lee,$te,Kee,Iee,Rte,dee,fee))},Dee=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{_ee=_ee||EMPTY_ARR,st=st||EMPTY_ARR;const Oee=_ee.length,xee=st.length,kee=Math.min(Oee,xee);let Dte;for(Dte=0;Dtexee?ete(_ee,Kee,Iee,!0,!1,kee):F(st,Lee,$te,Kee,Iee,Rte,dee,fee,kee)},pee=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{let Oee=0;const xee=st.length;let kee=_ee.length-1,Dte=xee-1;for(;Oee<=kee&&Oee<=Dte;){const Ite=_ee[Oee],Lte=st[Oee]=fee?cloneIfMounted(st[Oee]):normalizeVNode(st[Oee]);if(isSameVNodeType(Ite,Lte))k(Ite,Lte,Lee,null,Kee,Iee,Rte,dee,fee);else break;Oee++}for(;Oee<=kee&&Oee<=Dte;){const Ite=_ee[kee],Lte=st[Dte]=fee?cloneIfMounted(st[Dte]):normalizeVNode(st[Dte]);if(isSameVNodeType(Ite,Lte))k(Ite,Lte,Lee,null,Kee,Iee,Rte,dee,fee);else break;kee--,Dte--}if(Oee>kee){if(Oee<=Dte){const Ite=Dte+1,Lte=IteDte)for(;Oee<=kee;)Tee(_ee[Oee],Kee,Iee,!0),Oee++;else{const Ite=Oee,Lte=Oee,Vte=new Map;for(Oee=Lte;Oee<=Dte;Oee++){const zte=st[Oee]=fee?cloneIfMounted(st[Oee]):normalizeVNode(st[Oee]);zte.key!=null&&Vte.set(zte.key,Oee)}let Pte,Fte=0;const Ute=Dte-Lte+1;let Gte=!1,jte=0;const Bte=new Array(Ute);for(Oee=0;Oee=Ute){Tee(zte,Kee,Iee,!0);continue}let qte;if(zte.key!=null)qte=Vte.get(zte.key);else for(Pte=Lte;Pte<=Dte;Pte++)if(Bte[Pte-Lte]===0&&isSameVNodeType(zte,st[Pte])){qte=Pte;break}qte===void 0?Tee(zte,Kee,Iee,!0):(Bte[qte-Lte]=Oee+1,qte>=jte?jte=qte:Gte=!0,k(zte,st[qte],Lee,null,Kee,Iee,Rte,dee,fee),Fte++)}const Hte=Gte?getSequence(Bte):EMPTY_ARR;for(Pte=Hte.length-1,Oee=Ute-1;Oee>=0;Oee--){const zte=Lte+Oee,qte=st[zte],Wte=zte+1{const{el:Iee,type:Rte,transition:dee,children:fee,shapeFlag:Oee}=_ee;if(Oee&6){jr(_ee.component.subTree,st,Lee,$te);return}if(Oee&128){_ee.suspense.move(st,Lee,$te);return}if(Oee&64){Rte.move(_ee,st,Lee,Wee);return}if(Rte===Fragment){a(Iee,st,Lee);for(let kee=0;keedee.enter(Iee),Kee);else{const{leave:kee,delayLeave:Dte,afterLeave:Ite}=dee,Lte=()=>a(Iee,st,Lee),Vte=()=>{kee(Iee,()=>{Lte(),Ite&&Ite()})};Dte?Dte(Iee,Lte,Vte):Vte()}else a(Iee,st,Lee)},Tee=(_ee,st,Lee,$te=!1,Kee=!1)=>{const{type:Iee,props:Rte,ref:dee,children:fee,dynamicChildren:Oee,shapeFlag:xee,patchFlag:kee,dirs:Dte,cacheIndex:Ite}=_ee;if(kee===-2&&(Kee=!1),dee!=null&&setRef(dee,null,Lee,_ee,!0),Ite!=null&&(st.renderCache[Ite]=void 0),xee&256){st.ctx.deactivate(_ee);return}const Lte=xee&1&&Dte,Vte=!isAsyncWrapper(_ee);let Pte;if(Vte&&(Pte=Rte&&Rte.onVnodeBeforeUnmount)&&invokeVNodeHook(Pte,st,_ee),xee&6)yee(_ee.component,Lee,$te);else{if(xee&128){_ee.suspense.unmount(Lee,$te);return}Lte&&invokeDirectiveHook(_ee,null,st,"beforeUnmount"),xee&64?_ee.type.remove(_ee,st,Lee,Wee,$te):Oee&&!Oee.hasOnce&&(Iee!==Fragment||kee>0&&kee&64)?ete(Oee,st,Lee,!1,!0):(Iee===Fragment&&kee&384||!Kee&&xee&16)&&ete(fee,st,Lee),$te&&et(_ee)}(Vte&&(Pte=Rte&&Rte.onVnodeUnmounted)||Lte)&&queuePostRenderEffect(()=>{Pte&&invokeVNodeHook(Pte,st,_ee),Lte&&invokeDirectiveHook(_ee,null,st,"unmounted")},Lee)},et=_ee=>{const{type:st,el:Lee,anchor:$te,transition:Kee}=_ee;if(st===Fragment){ft(Lee,$te);return}if(st===Static){D(_ee);return}const Iee=()=>{l(Lee),Kee&&!Kee.persisted&&Kee.afterLeave&&Kee.afterLeave()};if(_ee.shapeFlag&1&&Kee&&!Kee.persisted){const{leave:Rte,delayLeave:dee}=Kee,fee=()=>Rte(Lee,Iee);dee?dee(_ee.el,Iee,fee):fee()}else Iee()},ft=(_ee,st)=>{let Lee;for(;_ee!==st;)Lee=E(_ee),l(_ee),_ee=Lee;l(st)},yee=(_ee,st,Lee)=>{const{bum:$te,scope:Kee,job:Iee,subTree:Rte,um:dee,m:fee,a:Oee}=_ee;invalidateMount(fee),invalidateMount(Oee),$te&&invokeArrayFns($te),Kee.stop(),Iee&&(Iee.flags|=8,Tee(Rte,_ee,st,Lee)),dee&&queuePostRenderEffect(dee,st),queuePostRenderEffect(()=>{_ee.isUnmounted=!0},st),st&&st.pendingBranch&&!st.isUnmounted&&_ee.asyncDep&&!_ee.asyncResolved&&_ee.suspenseId===st.pendingId&&(st.deps--,st.deps===0&&st.resolve())},ete=(_ee,st,Lee,$te=!1,Kee=!1,Iee=0)=>{for(let Rte=Iee;Rte<_ee.length;Rte++)Tee(_ee[Rte],st,Lee,$te,Kee)},xte=_ee=>{if(_ee.shapeFlag&6)return xte(_ee.component.subTree);if(_ee.shapeFlag&128)return _ee.suspense.next();const st=E(_ee.anchor||_ee.el),Lee=st&&st[TeleportEndKey];return Lee?E(Lee):st};let Ote=!1;const nee=(_ee,st,Lee)=>{_ee==null?st._vnode&&Tee(st._vnode,null,null,!0):k(st._vnode||null,_ee,st,null,null,null,Lee),st._vnode=_ee,Ote||(Ote=!0,flushPreFlushCbs(),flushPostFlushCbs(),Ote=!1)},Wee={p:k,um:Tee,m:jr,r:et,mt:Y,mc:F,pc:St,pbc:J,n:xte,o:r};let Bee,Nte;return o&&([Bee,Nte]=o(Wee)),{render:nee,hydrate:Bee,createApp:createAppAPI(nee,Bee)}}function resolveChildrenNamespace({type:r,props:o},s){return s==="svg"&&r==="foreignObject"||s==="mathml"&&r==="annotation-xml"&&o&&o.encoding&&o.encoding.includes("html")?void 0:s}function toggleRecurse({effect:r,job:o},s){s?(r.flags|=32,o.flags|=4):(r.flags&=-33,o.flags&=-5)}function needTransition(r,o){return(!r||r&&!r.pendingBranch)&&o&&!o.persisted}function traverseStaticChildren(r,o,s=!1){const a=r.children,l=o.children;if(isArray$9(a)&&isArray$9(l))for(let c=0;c>1,r[s[d]]0&&(o[a]=s[c-1]),s[c]=a)}}for(c=s.length,u=s[c-1];c-- >0;)s[c]=u,u=o[u];return s}function locateNonHydratedAsyncRoot(r){const o=r.subTree.component;if(o)return o.asyncDep&&!o.asyncResolved?o:locateNonHydratedAsyncRoot(o)}function invalidateMount(r){if(r)for(let o=0;oinject(ssrContextKey);function watchEffect(r,o){return doWatch(r,null,o)}function watchPostEffect(r,o){return doWatch(r,null,{flush:"post"})}function watchSyncEffect(r,o){return doWatch(r,null,{flush:"sync"})}function watch(r,o,s){return doWatch(r,o,s)}function doWatch(r,o,s=EMPTY_OBJ){const{immediate:a,deep:l,flush:c,once:u}=s,d=extend$3({},s),m=o&&a||!o&&c!=="post";let g;if(isInSSRComponentSetup){if(c==="sync"){const w=useSSRContext();g=w.__watcherHandles||(w.__watcherHandles=[])}else if(!m){const w=()=>{};return w.stop=NOOP,w.resume=NOOP,w.pause=NOOP,w}}const y=currentInstance;d.call=(w,T,k)=>callWithAsyncErrorHandling(w,y,T,k);let _=!1;c==="post"?d.scheduler=w=>{queuePostRenderEffect(w,y&&y.suspense)}:c!=="sync"&&(_=!0,d.scheduler=(w,T)=>{T?w():queueJob(w)}),d.augmentJob=w=>{o&&(w.flags|=4),_&&(w.flags|=2,y&&(w.id=y.uid,w.i=y))};const E=watch$1(r,o,d);return isInSSRComponentSetup&&(g?g.push(E):m&&E()),E}function instanceWatch(r,o,s){const a=this.proxy,l=isString$5(r)?r.includes(".")?createPathGetter(a,r):()=>a[r]:r.bind(a,a);let c;isFunction$3(o)?c=o:(c=o.handler,s=o);const u=setCurrentInstance(this),d=doWatch(l,c.bind(a),s);return u(),d}function createPathGetter(r,o){const s=o.split(".");return()=>{let a=r;for(let l=0;l{let y,_=EMPTY_OBJ,E;return watchSyncEffect(()=>{const w=r[l];hasChanged(y,w)&&(y=w,g())}),{get(){return m(),s.get?s.get(y):y},set(w){const T=s.set?s.set(w):w;if(!hasChanged(T,y)&&!(_!==EMPTY_OBJ&&hasChanged(w,_)))return;const k=a.vnode.props;k&&(o in k||l in k||c in k)&&(`onUpdate:${o}`in k||`onUpdate:${l}`in k||`onUpdate:${c}`in k)||(y=w,g()),a.emit(`update:${o}`,T),hasChanged(w,T)&&hasChanged(w,_)&&!hasChanged(T,E)&&g(),_=w,E=T}}});return d[Symbol.iterator]=()=>{let m=0;return{next(){return m<2?{value:m++?u||EMPTY_OBJ:d,done:!1}:{done:!0}}}},d}const getModelModifiers=(r,o)=>o==="modelValue"||o==="model-value"?r.modelModifiers:r[`${o}Modifiers`]||r[`${camelize(o)}Modifiers`]||r[`${hyphenate(o)}Modifiers`];function emit(r,o,...s){if(r.isUnmounted)return;const a=r.vnode.props||EMPTY_OBJ;let l=s;const c=o.startsWith("update:"),u=c&&getModelModifiers(a,o.slice(7));u&&(u.trim&&(l=s.map(y=>isString$5(y)?y.trim():y)),u.number&&(l=s.map(looseToNumber)));let d,m=a[d=toHandlerKey(o)]||a[d=toHandlerKey(camelize(o))];!m&&c&&(m=a[d=toHandlerKey(hyphenate(o))]),m&&callWithAsyncErrorHandling(m,r,6,l);const g=a[d+"Once"];if(g){if(!r.emitted)r.emitted={};else if(r.emitted[d])return;r.emitted[d]=!0,callWithAsyncErrorHandling(g,r,6,l)}}function normalizeEmitsOptions(r,o,s=!1){const a=o.emitsCache,l=a.get(r);if(l!==void 0)return l;const c=r.emits;let u={},d=!1;if(!isFunction$3(r)){const m=g=>{const y=normalizeEmitsOptions(g,o,!0);y&&(d=!0,extend$3(u,y))};!s&&o.mixins.length&&o.mixins.forEach(m),r.extends&&m(r.extends),r.mixins&&r.mixins.forEach(m)}return!c&&!d?(isObject$7(r)&&a.set(r,null),null):(isArray$9(c)?c.forEach(m=>u[m]=null):extend$3(u,c),isObject$7(r)&&a.set(r,u),u)}function isEmitListener(r,o){return!r||!isOn(o)?!1:(o=o.slice(2).replace(/Once$/,""),hasOwn$3(r,o[0].toLowerCase()+o.slice(1))||hasOwn$3(r,hyphenate(o))||hasOwn$3(r,o))}function markAttrsAccessed(){}function renderComponentRoot(r){const{type:o,vnode:s,proxy:a,withProxy:l,propsOptions:[c],slots:u,attrs:d,emit:m,render:g,renderCache:y,props:_,data:E,setupState:w,ctx:T,inheritAttrs:k}=r,O=setCurrentRenderingInstance(r);let R,M;try{if(s.shapeFlag&4){const D=l||a,P=D;R=normalizeVNode(g.call(P,D,y,_,w,E,T)),M=d}else{const D=o;R=normalizeVNode(D.length>1?D(_,{attrs:d,slots:u,emit:m}):D(_,null)),M=o.props?d:getFunctionalFallthrough(d)}}catch(D){blockStack.length=0,handleError(D,r,1),R=createVNode(Comment$1)}let N=R;if(M&&k!==!1){const D=Object.keys(M),{shapeFlag:P}=N;D.length&&P&7&&(c&&D.some(isModelListener)&&(M=filterModelListeners(M,c)),N=cloneVNode(N,M,!1,!0))}return s.dirs&&(N=cloneVNode(N,null,!1,!0),N.dirs=N.dirs?N.dirs.concat(s.dirs):s.dirs),s.transition&&setTransitionHooks(N,s.transition),R=N,setCurrentRenderingInstance(O),R}function filterSingleRoot(r,o=!0){let s;for(let a=0;a{let o;for(const s in r)(s==="class"||s==="style"||isOn(s))&&((o||(o={}))[s]=r[s]);return o},filterModelListeners=(r,o)=>{const s={};for(const a in r)(!isModelListener(a)||!(a.slice(9)in o))&&(s[a]=r[a]);return s};function shouldUpdateComponent(r,o,s){const{props:a,children:l,component:c}=r,{props:u,children:d,patchFlag:m}=o,g=c.emitsOptions;if(o.dirs||o.transition)return!0;if(s&&m>=0){if(m&1024)return!0;if(m&16)return a?hasPropsChanged(a,u,g):!!u;if(m&8){const y=o.dynamicProps;for(let _=0;_r.__isSuspense;let suspenseId=0;const SuspenseImpl={name:"Suspense",__isSuspense:!0,process(r,o,s,a,l,c,u,d,m,g){if(r==null)mountSuspense(o,s,a,l,c,u,d,m,g);else{if(c&&c.deps>0&&!r.suspense.isInFallback){o.suspense=r.suspense,o.suspense.vnode=o,o.el=r.el;return}patchSuspense(r,o,s,a,l,u,d,m,g)}},hydrate:hydrateSuspense,normalize:normalizeSuspenseChildren},Suspense=SuspenseImpl;function triggerEvent(r,o){const s=r.props&&r.props[o];isFunction$3(s)&&s()}function mountSuspense(r,o,s,a,l,c,u,d,m){const{p:g,o:{createElement:y}}=m,_=y("div"),E=r.suspense=createSuspenseBoundary(r,l,a,o,_,s,c,u,d,m);g(null,E.pendingBranch=r.ssContent,_,null,a,E,c,u),E.deps>0?(triggerEvent(r,"onPending"),triggerEvent(r,"onFallback"),g(null,r.ssFallback,o,s,a,null,c,u),setActiveBranch(E,r.ssFallback)):E.resolve(!1,!0)}function patchSuspense(r,o,s,a,l,c,u,d,{p:m,um:g,o:{createElement:y}}){const _=o.suspense=r.suspense;_.vnode=o,o.el=r.el;const E=o.ssContent,w=o.ssFallback,{activeBranch:T,pendingBranch:k,isInFallback:O,isHydrating:R}=_;if(k)_.pendingBranch=E,isSameVNodeType(E,k)?(m(k,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0?_.resolve():O&&(R||(m(T,w,s,a,l,null,c,u,d),setActiveBranch(_,w)))):(_.pendingId=suspenseId++,R?(_.isHydrating=!1,_.activeBranch=k):g(k,l,_),_.deps=0,_.effects.length=0,_.hiddenContainer=y("div"),O?(m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0?_.resolve():(m(T,w,s,a,l,null,c,u,d),setActiveBranch(_,w))):T&&isSameVNodeType(E,T)?(m(T,E,s,a,l,_,c,u,d),_.resolve(!0)):(m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0&&_.resolve()));else if(T&&isSameVNodeType(E,T))m(T,E,s,a,l,_,c,u,d),setActiveBranch(_,E);else if(triggerEvent(o,"onPending"),_.pendingBranch=E,E.shapeFlag&512?_.pendingId=E.component.suspenseId:_.pendingId=suspenseId++,m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0)_.resolve();else{const{timeout:M,pendingId:N}=_;M>0?setTimeout(()=>{_.pendingId===N&&_.fallback(w)},M):M===0&&_.fallback(w)}}function createSuspenseBoundary(r,o,s,a,l,c,u,d,m,g,y=!1){const{p:_,m:E,um:w,n:T,o:{parentNode:k,remove:O}}=g;let R;const M=isVNodeSuspensible(r);M&&o&&o.pendingBranch&&(R=o.pendingId,o.deps++);const N=r.props?toNumber$1(r.props.timeout):void 0,D=c,P={vnode:r,parent:o,parentComponent:s,namespace:u,container:a,hiddenContainer:l,deps:0,pendingId:suspenseId++,timeout:typeof N=="number"?N:-1,activeBranch:null,pendingBranch:null,isInFallback:!y,isHydrating:y,isUnmounted:!1,effects:[],resolve(I=!1,L=!1){const{vnode:F,activeBranch:U,pendingBranch:J,pendingId:z,effects:ie,parentComponent:ce,container:Y}=P;let B=!1;P.isHydrating?P.isHydrating=!1:I||(B=U&&J.transition&&J.transition.mode==="out-in",B&&(U.transition.afterLeave=()=>{z===P.pendingId&&(E(J,Y,c===D?T(U):c,0),queuePostFlushCb(ie))}),U&&(k(U.el)===Y&&(c=T(U)),w(U,ce,P,!0)),B||E(J,Y,c,0)),setActiveBranch(P,J),P.pendingBranch=null,P.isInFallback=!1;let V=P.parent,Ge=!1;for(;V;){if(V.pendingBranch){V.effects.push(...ie),Ge=!0;break}V=V.parent}!Ge&&!B&&queuePostFlushCb(ie),P.effects=[],M&&o&&o.pendingBranch&&R===o.pendingId&&(o.deps--,o.deps===0&&!L&&o.resolve()),triggerEvent(F,"onResolve")},fallback(I){if(!P.pendingBranch)return;const{vnode:L,activeBranch:F,parentComponent:U,container:J,namespace:z}=P;triggerEvent(L,"onFallback");const ie=T(F),ce=()=>{P.isInFallback&&(_(null,I,J,ie,U,null,z,d,m),setActiveBranch(P,I))},Y=I.transition&&I.transition.mode==="out-in";Y&&(F.transition.afterLeave=ce),P.isInFallback=!0,w(F,U,null,!0),Y||ce()},move(I,L,F){P.activeBranch&&E(P.activeBranch,I,L,F),P.container=I},next(){return P.activeBranch&&T(P.activeBranch)},registerDep(I,L,F){const U=!!P.pendingBranch;U&&P.deps++;const J=I.vnode.el;I.asyncDep.catch(z=>{handleError(z,I,0)}).then(z=>{if(I.isUnmounted||P.isUnmounted||P.pendingId!==I.suspenseId)return;I.asyncResolved=!0;const{vnode:ie}=I;handleSetupResult(I,z,!1),J&&(ie.el=J);const ce=!J&&I.subTree.el;L(I,ie,k(J||I.subTree.el),J?null:T(I.subTree),P,u,F),ce&&O(ce),updateHOCHostEl(I,ie.el),U&&--P.deps===0&&P.resolve()})},unmount(I,L){P.isUnmounted=!0,P.activeBranch&&w(P.activeBranch,s,I,L),P.pendingBranch&&w(P.pendingBranch,s,I,L)}};return P}function hydrateSuspense(r,o,s,a,l,c,u,d,m){const g=o.suspense=createSuspenseBoundary(o,a,s,r.parentNode,document.createElement("div"),null,l,c,u,d,!0),y=m(r,g.pendingBranch=o.ssContent,s,g,c,u);return g.deps===0&&g.resolve(!1,!0),y}function normalizeSuspenseChildren(r){const{shapeFlag:o,children:s}=r,a=o&32;r.ssContent=normalizeSuspenseSlot(a?s.default:s),r.ssFallback=a?normalizeSuspenseSlot(s.fallback):createVNode(Comment$1)}function normalizeSuspenseSlot(r){let o;if(isFunction$3(r)){const s=isBlockTreeEnabled&&r._c;s&&(r._d=!1,openBlock()),r=r(),s&&(r._d=!0,o=currentBlock,closeBlock())}return isArray$9(r)&&(r=filterSingleRoot(r)),r=normalizeVNode(r),o&&!r.dynamicChildren&&(r.dynamicChildren=o.filter(s=>s!==r)),r}function queueEffectWithSuspense(r,o){o&&o.pendingBranch?isArray$9(r)?o.effects.push(...r):o.effects.push(r):queuePostFlushCb(r)}function setActiveBranch(r,o){r.activeBranch=o;const{vnode:s,parentComponent:a}=r;let l=o.el;for(;!l&&o.component;)o=o.component.subTree,l=o.el;s.el=l,a&&a.subTree===s&&(a.vnode.el=l,updateHOCHostEl(a,l))}function isVNodeSuspensible(r){const o=r.props&&r.props.suspensible;return o!=null&&o!==!1}const Fragment=Symbol.for("v-fgt"),Text$1=Symbol.for("v-txt"),Comment$1=Symbol.for("v-cmt"),Static=Symbol.for("v-stc"),blockStack=[];let currentBlock=null;function openBlock(r=!1){blockStack.push(currentBlock=r?null:[])}function closeBlock(){blockStack.pop(),currentBlock=blockStack[blockStack.length-1]||null}let isBlockTreeEnabled=1;function setBlockTracking(r,o=!1){isBlockTreeEnabled+=r,r<0&¤tBlock&&o&&(currentBlock.hasOnce=!0)}function setupBlock(r){return r.dynamicChildren=isBlockTreeEnabled>0?currentBlock||EMPTY_ARR:null,closeBlock(),isBlockTreeEnabled>0&¤tBlock&¤tBlock.push(r),r}function createElementBlock(r,o,s,a,l,c){return setupBlock(createBaseVNode(r,o,s,a,l,c,!0))}function createBlock(r,o,s,a,l){return setupBlock(createVNode(r,o,s,a,l,!0))}function isVNode$1(r){return r?r.__v_isVNode===!0:!1}function isSameVNodeType(r,o){return r.type===o.type&&r.key===o.key}function transformVNodeArgs(r){}const normalizeKey=({key:r})=>r??null,normalizeRef=({ref:r,ref_key:o,ref_for:s})=>(typeof r=="number"&&(r=""+r),r!=null?isString$5(r)||isRef(r)||isFunction$3(r)?{i:currentRenderingInstance,r,k:o,f:!!s}:r:null);function createBaseVNode(r,o=null,s=null,a=0,l=null,c=r===Fragment?0:1,u=!1,d=!1){const m={__v_isVNode:!0,__v_skip:!0,type:r,props:o,key:o&&normalizeKey(o),ref:o&&normalizeRef(o),scopeId:currentScopeId,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:a,dynamicProps:l,dynamicChildren:null,appContext:null,ctx:currentRenderingInstance};return d?(normalizeChildren(m,s),c&128&&r.normalize(m)):s&&(m.shapeFlag|=isString$5(s)?8:16),isBlockTreeEnabled>0&&!u&¤tBlock&&(m.patchFlag>0||c&6)&&m.patchFlag!==32&¤tBlock.push(m),m}const createVNode=_createVNode;function _createVNode(r,o=null,s=null,a=0,l=null,c=!1){if((!r||r===NULL_DYNAMIC_COMPONENT)&&(r=Comment$1),isVNode$1(r)){const d=cloneVNode(r,o,!0);return s&&normalizeChildren(d,s),isBlockTreeEnabled>0&&!c&¤tBlock&&(d.shapeFlag&6?currentBlock[currentBlock.indexOf(r)]=d:currentBlock.push(d)),d.patchFlag=-2,d}if(isClassComponent(r)&&(r=r.__vccOpts),o){o=guardReactiveProps(o);let{class:d,style:m}=o;d&&!isString$5(d)&&(o.class=normalizeClass(d)),isObject$7(m)&&(isProxy(m)&&!isArray$9(m)&&(m=extend$3({},m)),o.style=normalizeStyle(m))}const u=isString$5(r)?1:isSuspense(r)?128:isTeleport(r)?64:isObject$7(r)?4:isFunction$3(r)?2:0;return createBaseVNode(r,o,s,a,l,u,c,!0)}function guardReactiveProps(r){return r?isProxy(r)||isInternalObject(r)?extend$3({},r):r:null}function cloneVNode(r,o,s=!1,a=!1){const{props:l,ref:c,patchFlag:u,children:d,transition:m}=r,g=o?mergeProps(l||{},o):l,y={__v_isVNode:!0,__v_skip:!0,type:r.type,props:g,key:g&&normalizeKey(g),ref:o&&o.ref?s&&c?isArray$9(c)?c.concat(normalizeRef(o)):[c,normalizeRef(o)]:normalizeRef(o):c,scopeId:r.scopeId,slotScopeIds:r.slotScopeIds,children:d,target:r.target,targetStart:r.targetStart,targetAnchor:r.targetAnchor,staticCount:r.staticCount,shapeFlag:r.shapeFlag,patchFlag:o&&r.type!==Fragment?u===-1?16:u|16:u,dynamicProps:r.dynamicProps,dynamicChildren:r.dynamicChildren,appContext:r.appContext,dirs:r.dirs,transition:m,component:r.component,suspense:r.suspense,ssContent:r.ssContent&&cloneVNode(r.ssContent),ssFallback:r.ssFallback&&cloneVNode(r.ssFallback),el:r.el,anchor:r.anchor,ctx:r.ctx,ce:r.ce};return m&&a&&setTransitionHooks(y,m.clone(y)),y}function createTextVNode(r=" ",o=0){return createVNode(Text$1,null,r,o)}function createStaticVNode(r,o){const s=createVNode(Static,null,r);return s.staticCount=o,s}function createCommentVNode(r="",o=!1){return o?(openBlock(),createBlock(Comment$1,null,r)):createVNode(Comment$1,null,r)}function normalizeVNode(r){return r==null||typeof r=="boolean"?createVNode(Comment$1):isArray$9(r)?createVNode(Fragment,null,r.slice()):isVNode$1(r)?cloneIfMounted(r):createVNode(Text$1,null,String(r))}function cloneIfMounted(r){return r.el===null&&r.patchFlag!==-1||r.memo?r:cloneVNode(r)}function normalizeChildren(r,o){let s=0;const{shapeFlag:a}=r;if(o==null)o=null;else if(isArray$9(o))s=16;else if(typeof o=="object")if(a&65){const l=o.default;l&&(l._c&&(l._d=!1),normalizeChildren(r,l()),l._c&&(l._d=!0));return}else{s=32;const l=o._;!l&&!isInternalObject(o)?o._ctx=currentRenderingInstance:l===3&¤tRenderingInstance&&(currentRenderingInstance.slots._===1?o._=1:(o._=2,r.patchFlag|=1024))}else isFunction$3(o)?(o={default:o,_ctx:currentRenderingInstance},s=32):(o=String(o),a&64?(s=16,o=[createTextVNode(o)]):s=8);r.children=o,r.shapeFlag|=s}function mergeProps(...r){const o={};for(let s=0;scurrentInstance||currentRenderingInstance;let internalSetCurrentInstance,setInSSRSetupState;{const r=getGlobalThis$1(),o=(s,a)=>{let l;return(l=r[s])||(l=r[s]=[]),l.push(a),c=>{l.length>1?l.forEach(u=>u(c)):l[0](c)}};internalSetCurrentInstance=o("__VUE_INSTANCE_SETTERS__",s=>currentInstance=s),setInSSRSetupState=o("__VUE_SSR_SETTERS__",s=>isInSSRComponentSetup=s)}const setCurrentInstance=r=>{const o=currentInstance;return internalSetCurrentInstance(r),r.scope.on(),()=>{r.scope.off(),internalSetCurrentInstance(o)}},unsetCurrentInstance=()=>{currentInstance&¤tInstance.scope.off(),internalSetCurrentInstance(null)};function isStatefulComponent(r){return r.vnode.shapeFlag&4}let isInSSRComponentSetup=!1;function setupComponent(r,o=!1,s=!1){o&&setInSSRSetupState(o);const{props:a,children:l}=r.vnode,c=isStatefulComponent(r);initProps(r,a,c,o),initSlots(r,l,s);const u=c?setupStatefulComponent(r,o):void 0;return o&&setInSSRSetupState(!1),u}function setupStatefulComponent(r,o){const s=r.type;r.accessCache=Object.create(null),r.proxy=new Proxy(r.ctx,PublicInstanceProxyHandlers);const{setup:a}=s;if(a){pauseTracking();const l=r.setupContext=a.length>1?createSetupContext(r):null,c=setCurrentInstance(r),u=callWithErrorHandling(a,r,0,[r.props,l]),d=isPromise$1(u);if(resetTracking(),c(),(d||r.sp)&&!isAsyncWrapper(r)&&markAsyncBoundary(r),d){if(u.then(unsetCurrentInstance,unsetCurrentInstance),o)return u.then(m=>{handleSetupResult(r,m,o)}).catch(m=>{handleError(m,r,0)});r.asyncDep=u}else handleSetupResult(r,u,o)}else finishComponentSetup(r,o)}function handleSetupResult(r,o,s){isFunction$3(o)?r.type.__ssrInlineRender?r.ssrRender=o:r.render=o:isObject$7(o)&&(r.setupState=proxyRefs(o)),finishComponentSetup(r,s)}let compile$3,installWithProxy;function registerRuntimeCompiler(r){compile$3=r,installWithProxy=o=>{o.render._rc&&(o.withProxy=new Proxy(o.ctx,RuntimeCompiledPublicInstanceProxyHandlers))}}const isRuntimeOnly=()=>!compile$3;function finishComponentSetup(r,o,s){const a=r.type;if(!r.render){if(!o&&compile$3&&!a.render){const l=a.template||resolveMergedOptions(r).template;if(l){const{isCustomElement:c,compilerOptions:u}=r.appContext.config,{delimiters:d,compilerOptions:m}=a,g=extend$3(extend$3({isCustomElement:c,delimiters:d},u),m);a.render=compile$3(l,g)}}r.render=a.render||NOOP,installWithProxy&&installWithProxy(r)}{const l=setCurrentInstance(r);pauseTracking();try{applyOptions(r)}finally{resetTracking(),l()}}}const attrsProxyHandlers={get(r,o){return track(r,"get",""),r[o]}};function createSetupContext(r){const o=s=>{r.exposed=s||{}};return{attrs:new Proxy(r.attrs,attrsProxyHandlers),slots:r.slots,emit:r.emit,expose:o}}function getComponentPublicInstance(r){return r.exposed?r.exposeProxy||(r.exposeProxy=new Proxy(proxyRefs(markRaw(r.exposed)),{get(o,s){if(s in o)return o[s];if(s in publicPropertiesMap)return publicPropertiesMap[s](r)},has(o,s){return s in o||s in publicPropertiesMap}})):r.proxy}const classifyRE=/(?:^|[-_])(\w)/g,classify=r=>r.replace(classifyRE,o=>o.toUpperCase()).replace(/[-_]/g,"");function getComponentName(r,o=!0){return isFunction$3(r)?r.displayName||r.name:r.name||o&&r.__name}function formatComponentName(r,o,s=!1){let a=getComponentName(o);if(!a&&o.__file){const l=o.__file.match(/([^/\\]+)\.\w+$/);l&&(a=l[1])}if(!a&&r&&r.parent){const l=c=>{for(const u in c)if(c[u]===o)return u};a=l(r.components||r.parent.type.components)||l(r.appContext.components)}return a?classify(a):s?"App":"Anonymous"}function isClassComponent(r){return isFunction$3(r)&&"__vccOpts"in r}const computed=(r,o)=>computed$1(r,o,isInSSRComponentSetup);function h$1(r,o,s){const a=arguments.length;return a===2?isObject$7(o)&&!isArray$9(o)?isVNode$1(o)?createVNode(r,null,[o]):createVNode(r,o):createVNode(r,null,o):(a>3?s=Array.prototype.slice.call(arguments,2):a===3&&isVNode$1(s)&&(s=[s]),createVNode(r,o,s))}function initCustomFormatter(){}function withMemo(r,o,s,a){const l=s[a];if(l&&isMemoSame(l,r))return l;const c=o();return c.memo=r.slice(),c.cacheIndex=a,s[a]=c}function isMemoSame(r,o){const s=r.memo;if(s.length!=o.length)return!1;for(let a=0;a0&¤tBlock&¤tBlock.push(r),!0}const version$3="3.5.13",warn$2=NOOP,ErrorTypeStrings=ErrorTypeStrings$1,devtools$2=devtools$1,setDevtoolsHook=setDevtoolsHook$1,_ssrUtils={createComponentInstance,setupComponent,renderComponentRoot,setCurrentRenderingInstance,isVNode:isVNode$1,normalizeVNode,getComponentPublicInstance,ensureValidVNode,pushWarningContext,popWarningContext},ssrUtils=_ssrUtils,resolveFilter=null,compatUtils=null,DeprecationTypes=null;/** -* @vue/runtime-dom v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let policy;const tt$4=typeof window<"u"&&window.trustedTypes;if(tt$4)try{policy=tt$4.createPolicy("vue",{createHTML:r=>r})}catch{}const unsafeToTrustedHTML=policy?r=>policy.createHTML(r):r=>r,svgNS="http://www.w3.org/2000/svg",mathmlNS="http://www.w3.org/1998/Math/MathML",doc=typeof document<"u"?document:null,templateContainer=doc&&doc.createElement("template"),nodeOps={insert:(r,o,s)=>{o.insertBefore(r,s||null)},remove:r=>{const o=r.parentNode;o&&o.removeChild(r)},createElement:(r,o,s,a)=>{const l=o==="svg"?doc.createElementNS(svgNS,r):o==="mathml"?doc.createElementNS(mathmlNS,r):s?doc.createElement(r,{is:s}):doc.createElement(r);return r==="select"&&a&&a.multiple!=null&&l.setAttribute("multiple",a.multiple),l},createText:r=>doc.createTextNode(r),createComment:r=>doc.createComment(r),setText:(r,o)=>{r.nodeValue=o},setElementText:(r,o)=>{r.textContent=o},parentNode:r=>r.parentNode,nextSibling:r=>r.nextSibling,querySelector:r=>doc.querySelector(r),setScopeId(r,o){r.setAttribute(o,"")},insertStaticContent(r,o,s,a,l,c){const u=s?s.previousSibling:o.lastChild;if(l&&(l===c||l.nextSibling))for(;o.insertBefore(l.cloneNode(!0),s),!(l===c||!(l=l.nextSibling)););else{templateContainer.innerHTML=unsafeToTrustedHTML(a==="svg"?`${r}`:a==="mathml"?`${r}`:r);const d=templateContainer.content;if(a==="svg"||a==="mathml"){const m=d.firstChild;for(;m.firstChild;)d.appendChild(m.firstChild);d.removeChild(m)}o.insertBefore(d,s)}return[u?u.nextSibling:o.firstChild,s?s.previousSibling:o.lastChild]}},TRANSITION="transition",ANIMATION="animation",vtcKey=Symbol("_vtc"),DOMTransitionPropsValidators={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TransitionPropsValidators=extend$3({},BaseTransitionPropsValidators,DOMTransitionPropsValidators),decorate$1=r=>(r.displayName="Transition",r.props=TransitionPropsValidators,r),Transition=decorate$1((r,{slots:o})=>h$1(BaseTransition,resolveTransitionProps(r),o)),callHook=(r,o=[])=>{isArray$9(r)?r.forEach(s=>s(...o)):r&&r(...o)},hasExplicitCallback=r=>r?isArray$9(r)?r.some(o=>o.length>1):r.length>1:!1;function resolveTransitionProps(r){const o={};for(const ie in r)ie in DOMTransitionPropsValidators||(o[ie]=r[ie]);if(r.css===!1)return o;const{name:s="v",type:a,duration:l,enterFromClass:c=`${s}-enter-from`,enterActiveClass:u=`${s}-enter-active`,enterToClass:d=`${s}-enter-to`,appearFromClass:m=c,appearActiveClass:g=u,appearToClass:y=d,leaveFromClass:_=`${s}-leave-from`,leaveActiveClass:E=`${s}-leave-active`,leaveToClass:w=`${s}-leave-to`}=r,T=normalizeDuration(l),k=T&&T[0],O=T&&T[1],{onBeforeEnter:R,onEnter:M,onEnterCancelled:N,onLeave:D,onLeaveCancelled:P,onBeforeAppear:I=R,onAppear:L=M,onAppearCancelled:F=N}=o,U=(ie,ce,Y,B)=>{ie._enterCancelled=B,removeTransitionClass(ie,ce?y:d),removeTransitionClass(ie,ce?g:u),Y&&Y()},J=(ie,ce)=>{ie._isLeaving=!1,removeTransitionClass(ie,_),removeTransitionClass(ie,w),removeTransitionClass(ie,E),ce&&ce()},z=ie=>(ce,Y)=>{const B=ie?L:M,V=()=>U(ce,ie,Y);callHook(B,[ce,V]),nextFrame(()=>{removeTransitionClass(ce,ie?m:c),addTransitionClass(ce,ie?y:d),hasExplicitCallback(B)||whenTransitionEnds(ce,a,k,V)})};return extend$3(o,{onBeforeEnter(ie){callHook(R,[ie]),addTransitionClass(ie,c),addTransitionClass(ie,u)},onBeforeAppear(ie){callHook(I,[ie]),addTransitionClass(ie,m),addTransitionClass(ie,g)},onEnter:z(!1),onAppear:z(!0),onLeave(ie,ce){ie._isLeaving=!0;const Y=()=>J(ie,ce);addTransitionClass(ie,_),ie._enterCancelled?(addTransitionClass(ie,E),forceReflow()):(forceReflow(),addTransitionClass(ie,E)),nextFrame(()=>{ie._isLeaving&&(removeTransitionClass(ie,_),addTransitionClass(ie,w),hasExplicitCallback(D)||whenTransitionEnds(ie,a,O,Y))}),callHook(D,[ie,Y])},onEnterCancelled(ie){U(ie,!1,void 0,!0),callHook(N,[ie])},onAppearCancelled(ie){U(ie,!0,void 0,!0),callHook(F,[ie])},onLeaveCancelled(ie){J(ie),callHook(P,[ie])}})}function normalizeDuration(r){if(r==null)return null;if(isObject$7(r))return[NumberOf(r.enter),NumberOf(r.leave)];{const o=NumberOf(r);return[o,o]}}function NumberOf(r){return toNumber$1(r)}function addTransitionClass(r,o){o.split(/\s+/).forEach(s=>s&&r.classList.add(s)),(r[vtcKey]||(r[vtcKey]=new Set)).add(o)}function removeTransitionClass(r,o){o.split(/\s+/).forEach(a=>a&&r.classList.remove(a));const s=r[vtcKey];s&&(s.delete(o),s.size||(r[vtcKey]=void 0))}function nextFrame(r){requestAnimationFrame(()=>{requestAnimationFrame(r)})}let endId=0;function whenTransitionEnds(r,o,s,a){const l=r._endId=++endId,c=()=>{l===r._endId&&a()};if(s!=null)return setTimeout(c,s);const{type:u,timeout:d,propCount:m}=getTransitionInfo(r,o);if(!u)return a();const g=u+"end";let y=0;const _=()=>{r.removeEventListener(g,E),c()},E=w=>{w.target===r&&++y>=m&&_()};setTimeout(()=>{y(s[T]||"").split(", "),l=a(`${TRANSITION}Delay`),c=a(`${TRANSITION}Duration`),u=getTimeout(l,c),d=a(`${ANIMATION}Delay`),m=a(`${ANIMATION}Duration`),g=getTimeout(d,m);let y=null,_=0,E=0;o===TRANSITION?u>0&&(y=TRANSITION,_=u,E=c.length):o===ANIMATION?g>0&&(y=ANIMATION,_=g,E=m.length):(_=Math.max(u,g),y=_>0?u>g?TRANSITION:ANIMATION:null,E=y?y===TRANSITION?c.length:m.length:0);const w=y===TRANSITION&&/\b(transform|all)(,|$)/.test(a(`${TRANSITION}Property`).toString());return{type:y,timeout:_,propCount:E,hasTransform:w}}function getTimeout(r,o){for(;r.lengthtoMs(s)+toMs(r[a])))}function toMs(r){return r==="auto"?0:Number(r.slice(0,-1).replace(",","."))*1e3}function forceReflow(){return document.body.offsetHeight}function patchClass(r,o,s){const a=r[vtcKey];a&&(o=(o?[o,...a]:[...a]).join(" ")),o==null?r.removeAttribute("class"):s?r.setAttribute("class",o):r.className=o}const vShowOriginalDisplay=Symbol("_vod"),vShowHidden=Symbol("_vsh"),vShow={beforeMount(r,{value:o},{transition:s}){r[vShowOriginalDisplay]=r.style.display==="none"?"":r.style.display,s&&o?s.beforeEnter(r):setDisplay(r,o)},mounted(r,{value:o},{transition:s}){s&&o&&s.enter(r)},updated(r,{value:o,oldValue:s},{transition:a}){!o!=!s&&(a?o?(a.beforeEnter(r),setDisplay(r,!0),a.enter(r)):a.leave(r,()=>{setDisplay(r,!1)}):setDisplay(r,o))},beforeUnmount(r,{value:o}){setDisplay(r,o)}};function setDisplay(r,o){r.style.display=o?r[vShowOriginalDisplay]:"none",r[vShowHidden]=!o}function initVShowForSSR(){vShow.getSSRProps=({value:r})=>{if(!r)return{style:{display:"none"}}}}const CSS_VAR_TEXT=Symbol("");function useCssVars(r){const o=getCurrentInstance();if(!o)return;const s=o.ut=(l=r(o.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${o.uid}"]`)).forEach(c=>setVarsOnNode(c,l))},a=()=>{const l=r(o.proxy);o.ce?setVarsOnNode(o.ce,l):setVarsOnVNode(o.subTree,l),s(l)};onBeforeUpdate(()=>{queuePostFlushCb(a)}),onMounted(()=>{watch(a,NOOP,{flush:"post"});const l=new MutationObserver(a);l.observe(o.subTree.el.parentNode,{childList:!0}),onUnmounted(()=>l.disconnect())})}function setVarsOnVNode(r,o){if(r.shapeFlag&128){const s=r.suspense;r=s.activeBranch,s.pendingBranch&&!s.isHydrating&&s.effects.push(()=>{setVarsOnVNode(s.activeBranch,o)})}for(;r.component;)r=r.component.subTree;if(r.shapeFlag&1&&r.el)setVarsOnNode(r.el,o);else if(r.type===Fragment)r.children.forEach(s=>setVarsOnVNode(s,o));else if(r.type===Static){let{el:s,anchor:a}=r;for(;s&&(setVarsOnNode(s,o),s!==a);)s=s.nextSibling}}function setVarsOnNode(r,o){if(r.nodeType===1){const s=r.style;let a="";for(const l in o)s.setProperty(`--${l}`,o[l]),a+=`--${l}: ${o[l]};`;s[CSS_VAR_TEXT]=a}}const displayRE=/(^|;)\s*display\s*:/;function patchStyle(r,o,s){const a=r.style,l=isString$5(s);let c=!1;if(s&&!l){if(o)if(isString$5(o))for(const u of o.split(";")){const d=u.slice(0,u.indexOf(":")).trim();s[d]==null&&setStyle(a,d,"")}else for(const u in o)s[u]==null&&setStyle(a,u,"");for(const u in s)u==="display"&&(c=!0),setStyle(a,u,s[u])}else if(l){if(o!==s){const u=a[CSS_VAR_TEXT];u&&(s+=";"+u),a.cssText=s,c=displayRE.test(s)}}else o&&r.removeAttribute("style");vShowOriginalDisplay in r&&(r[vShowOriginalDisplay]=c?a.display:"",r[vShowHidden]&&(a.display="none"))}const importantRE=/\s*!important$/;function setStyle(r,o,s){if(isArray$9(s))s.forEach(a=>setStyle(r,o,a));else if(s==null&&(s=""),o.startsWith("--"))r.setProperty(o,s);else{const a=autoPrefix(r,o);importantRE.test(s)?r.setProperty(hyphenate(a),s.replace(importantRE,""),"important"):r[a]=s}}const prefixes=["Webkit","Moz","ms"],prefixCache={};function autoPrefix(r,o){const s=prefixCache[o];if(s)return s;let a=camelize(o);if(a!=="filter"&&a in r)return prefixCache[o]=a;a=capitalize$1(a);for(let l=0;lcachedNow||(p.then(()=>cachedNow=0),cachedNow=Date.now());function createInvoker(r,o){const s=a=>{if(!a._vts)a._vts=Date.now();else if(a._vts<=s.attached)return;callWithAsyncErrorHandling(patchStopImmediatePropagation(a,s.value),o,5,[a])};return s.value=r,s.attached=getNow(),s}function patchStopImmediatePropagation(r,o){if(isArray$9(o)){const s=r.stopImmediatePropagation;return r.stopImmediatePropagation=()=>{s.call(r),r._stopped=!0},o.map(a=>l=>!l._stopped&&a&&a(l))}else return o}const isNativeOn=r=>r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&r.charCodeAt(2)>96&&r.charCodeAt(2)<123,patchProp=(r,o,s,a,l,c)=>{const u=l==="svg";o==="class"?patchClass(r,a,u):o==="style"?patchStyle(r,s,a):isOn(o)?isModelListener(o)||patchEvent(r,o,s,a,c):(o[0]==="."?(o=o.slice(1),!0):o[0]==="^"?(o=o.slice(1),!1):shouldSetAsProp(r,o,a,u))?(patchDOMProp(r,o,a),!r.tagName.includes("-")&&(o==="value"||o==="checked"||o==="selected")&&patchAttr(r,o,a,u,c,o!=="value")):r._isVueCE&&(/[A-Z]/.test(o)||!isString$5(a))?patchDOMProp(r,camelize(o),a,c,o):(o==="true-value"?r._trueValue=a:o==="false-value"&&(r._falseValue=a),patchAttr(r,o,a,u))};function shouldSetAsProp(r,o,s,a){if(a)return!!(o==="innerHTML"||o==="textContent"||o in r&&isNativeOn(o)&&isFunction$3(s));if(o==="spellcheck"||o==="draggable"||o==="translate"||o==="form"||o==="list"&&r.tagName==="INPUT"||o==="type"&&r.tagName==="TEXTAREA")return!1;if(o==="width"||o==="height"){const l=r.tagName;if(l==="IMG"||l==="VIDEO"||l==="CANVAS"||l==="SOURCE")return!1}return isNativeOn(o)&&isString$5(s)?!1:o in r}const REMOVAL={};/*! #__NO_SIDE_EFFECTS__ */function defineCustomElement(r,o,s){const a=defineComponent(r,o);isPlainObject$5(a)&&extend$3(a,o);class l extends VueElement{constructor(u){super(a,u,s)}}return l.def=a,l}/*! #__NO_SIDE_EFFECTS__ */const defineSSRCustomElement=(r,o)=>defineCustomElement(r,o,createSSRApp),BaseClass=typeof HTMLElement<"u"?HTMLElement:class{};class VueElement extends BaseClass{constructor(o,s={},a=createApp){super(),this._def=o,this._props=s,this._createApp=a,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&a!==createApp?this._root=this.shadowRoot:o.shadowRoot!==!1?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let o=this;for(;o=o&&(o.parentNode||o.host);)if(o instanceof VueElement){this._parent=o;break}this._instance||(this._resolved?(this._setParent(),this._update()):o&&o._pendingResolve?this._pendingResolve=o._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(o=this._parent){o&&(this._instance.parent=o._instance,this._instance.provides=o._instance.provides)}disconnectedCallback(){this._connected=!1,nextTick(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let a=0;a{for(const l of a)this._setAttr(l.attributeName)}),this._ob.observe(this,{attributes:!0});const o=(a,l=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:c,styles:u}=a;let d;if(c&&!isArray$9(c))for(const m in c){const g=c[m];(g===Number||g&&g.type===Number)&&(m in this._props&&(this._props[m]=toNumber$1(this._props[m])),(d||(d=Object.create(null)))[camelize(m)]=!0)}this._numberProps=d,l&&this._resolveProps(a),this.shadowRoot&&this._applyStyles(u),this._mount(a)},s=this._def.__asyncLoader;s?this._pendingResolve=s().then(a=>o(this._def=a,!0)):o(this._def)}_mount(o){this._app=this._createApp(o),o.configureApp&&o.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const s=this._instance&&this._instance.exposed;if(s)for(const a in s)hasOwn$3(this,a)||Object.defineProperty(this,a,{get:()=>unref(s[a])})}_resolveProps(o){const{props:s}=o,a=isArray$9(s)?s:Object.keys(s||{});for(const l of Object.keys(this))l[0]!=="_"&&a.includes(l)&&this._setProp(l,this[l]);for(const l of a.map(camelize))Object.defineProperty(this,l,{get(){return this._getProp(l)},set(c){this._setProp(l,c,!0,!0)}})}_setAttr(o){if(o.startsWith("data-v-"))return;const s=this.hasAttribute(o);let a=s?this.getAttribute(o):REMOVAL;const l=camelize(o);s&&this._numberProps&&this._numberProps[l]&&(a=toNumber$1(a)),this._setProp(l,a,!1,!0)}_getProp(o){return this._props[o]}_setProp(o,s,a=!0,l=!1){if(s!==this._props[o]&&(s===REMOVAL?delete this._props[o]:(this._props[o]=s,o==="key"&&this._app&&(this._app._ceVNode.key=s)),l&&this._instance&&this._update(),a)){const c=this._ob;c&&c.disconnect(),s===!0?this.setAttribute(hyphenate(o),""):typeof s=="string"||typeof s=="number"?this.setAttribute(hyphenate(o),s+""):s||this.removeAttribute(hyphenate(o)),c&&c.observe(this,{attributes:!0})}}_update(){render$1(this._createVNode(),this._root)}_createVNode(){const o={};this.shadowRoot||(o.onVnodeMounted=o.onVnodeUpdated=this._renderSlots.bind(this));const s=createVNode(this._def,extend$3(o,this._props));return this._instance||(s.ce=a=>{this._instance=a,a.ce=this,a.isCE=!0;const l=(c,u)=>{this.dispatchEvent(new CustomEvent(c,isPlainObject$5(u[0])?extend$3({detail:u},u[0]):{detail:u}))};a.emit=(c,...u)=>{l(c,u),hyphenate(c)!==c&&l(hyphenate(c),u)},this._setParent()}),s}_applyStyles(o,s){if(!o)return;if(s){if(s===this._def||this._styleChildren.has(s))return;this._styleChildren.add(s)}const a=this._nonce;for(let l=o.length-1;l>=0;l--){const c=document.createElement("style");a&&c.setAttribute("nonce",a),c.textContent=o[l],this.shadowRoot.prepend(c)}}_parseSlots(){const o=this._slots={};let s;for(;s=this.firstChild;){const a=s.nodeType===1&&s.getAttribute("slot")||"default";(o[a]||(o[a]=[])).push(s),this.removeChild(s)}}_renderSlots(){const o=(this._teleportTarget||this).querySelectorAll("slot"),s=this._instance.type.__scopeId;for(let a=0;a(delete r.props.mode,r),TransitionGroupImpl=decorate({name:"TransitionGroup",props:extend$3({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(r,{slots:o}){const s=getCurrentInstance(),a=useTransitionState();let l,c;return onUpdated(()=>{if(!l.length)return;const u=r.moveClass||`${r.name||"v"}-move`;if(!hasCSSTransform(l[0].el,s.vnode.el,u))return;l.forEach(callPendingCbs),l.forEach(recordPosition);const d=l.filter(applyTranslation);forceReflow(),d.forEach(m=>{const g=m.el,y=g.style;addTransitionClass(g,u),y.transform=y.webkitTransform=y.transitionDuration="";const _=g[moveCbKey]=E=>{E&&E.target!==g||(!E||/transform$/.test(E.propertyName))&&(g.removeEventListener("transitionend",_),g[moveCbKey]=null,removeTransitionClass(g,u))};g.addEventListener("transitionend",_)})}),()=>{const u=toRaw(r),d=resolveTransitionProps(u);let m=u.tag||Fragment;if(l=[],c)for(let g=0;g{d.split(/\s+/).forEach(m=>m&&a.classList.remove(m))}),s.split(/\s+/).forEach(d=>d&&a.classList.add(d)),a.style.display="none";const c=o.nodeType===1?o:o.parentNode;c.appendChild(a);const{hasTransform:u}=getTransitionInfo(a);return c.removeChild(a),u}const getModelAssigner=r=>{const o=r.props["onUpdate:modelValue"]||!1;return isArray$9(o)?s=>invokeArrayFns(o,s):o};function onCompositionStart(r){r.target.composing=!0}function onCompositionEnd(r){const o=r.target;o.composing&&(o.composing=!1,o.dispatchEvent(new Event("input")))}const assignKey=Symbol("_assign"),vModelText={created(r,{modifiers:{lazy:o,trim:s,number:a}},l){r[assignKey]=getModelAssigner(l);const c=a||l.props&&l.props.type==="number";addEventListener(r,o?"change":"input",u=>{if(u.target.composing)return;let d=r.value;s&&(d=d.trim()),c&&(d=looseToNumber(d)),r[assignKey](d)}),s&&addEventListener(r,"change",()=>{r.value=r.value.trim()}),o||(addEventListener(r,"compositionstart",onCompositionStart),addEventListener(r,"compositionend",onCompositionEnd),addEventListener(r,"change",onCompositionEnd))},mounted(r,{value:o}){r.value=o??""},beforeUpdate(r,{value:o,oldValue:s,modifiers:{lazy:a,trim:l,number:c}},u){if(r[assignKey]=getModelAssigner(u),r.composing)return;const d=(c||r.type==="number")&&!/^0\d/.test(r.value)?looseToNumber(r.value):r.value,m=o??"";d!==m&&(document.activeElement===r&&r.type!=="range"&&(a&&o===s||l&&r.value.trim()===m)||(r.value=m))}},vModelCheckbox={deep:!0,created(r,o,s){r[assignKey]=getModelAssigner(s),addEventListener(r,"change",()=>{const a=r._modelValue,l=getValue(r),c=r.checked,u=r[assignKey];if(isArray$9(a)){const d=looseIndexOf(a,l),m=d!==-1;if(c&&!m)u(a.concat(l));else if(!c&&m){const g=[...a];g.splice(d,1),u(g)}}else if(isSet$1(a)){const d=new Set(a);c?d.add(l):d.delete(l),u(d)}else u(getCheckboxValue(r,c))})},mounted:setChecked,beforeUpdate(r,o,s){r[assignKey]=getModelAssigner(s),setChecked(r,o,s)}};function setChecked(r,{value:o,oldValue:s},a){r._modelValue=o;let l;if(isArray$9(o))l=looseIndexOf(o,a.props.value)>-1;else if(isSet$1(o))l=o.has(a.props.value);else{if(o===s)return;l=looseEqual(o,getCheckboxValue(r,!0))}r.checked!==l&&(r.checked=l)}const vModelRadio={created(r,{value:o},s){r.checked=looseEqual(o,s.props.value),r[assignKey]=getModelAssigner(s),addEventListener(r,"change",()=>{r[assignKey](getValue(r))})},beforeUpdate(r,{value:o,oldValue:s},a){r[assignKey]=getModelAssigner(a),o!==s&&(r.checked=looseEqual(o,a.props.value))}},vModelSelect={deep:!0,created(r,{value:o,modifiers:{number:s}},a){const l=isSet$1(o);addEventListener(r,"change",()=>{const c=Array.prototype.filter.call(r.options,u=>u.selected).map(u=>s?looseToNumber(getValue(u)):getValue(u));r[assignKey](r.multiple?l?new Set(c):c:c[0]),r._assigning=!0,nextTick(()=>{r._assigning=!1})}),r[assignKey]=getModelAssigner(a)},mounted(r,{value:o}){setSelected(r,o)},beforeUpdate(r,o,s){r[assignKey]=getModelAssigner(s)},updated(r,{value:o}){r._assigning||setSelected(r,o)}};function setSelected(r,o){const s=r.multiple,a=isArray$9(o);if(!(s&&!a&&!isSet$1(o))){for(let l=0,c=r.options.length;lString(g)===String(d)):u.selected=looseIndexOf(o,d)>-1}else u.selected=o.has(d);else if(looseEqual(getValue(u),o)){r.selectedIndex!==l&&(r.selectedIndex=l);return}}!s&&r.selectedIndex!==-1&&(r.selectedIndex=-1)}}function getValue(r){return"_value"in r?r._value:r.value}function getCheckboxValue(r,o){const s=o?"_trueValue":"_falseValue";return s in r?r[s]:o}const vModelDynamic={created(r,o,s){callModelHook(r,o,s,null,"created")},mounted(r,o,s){callModelHook(r,o,s,null,"mounted")},beforeUpdate(r,o,s,a){callModelHook(r,o,s,a,"beforeUpdate")},updated(r,o,s,a){callModelHook(r,o,s,a,"updated")}};function resolveDynamicModel(r,o){switch(r){case"SELECT":return vModelSelect;case"TEXTAREA":return vModelText;default:switch(o){case"checkbox":return vModelCheckbox;case"radio":return vModelRadio;default:return vModelText}}}function callModelHook(r,o,s,a,l){const u=resolveDynamicModel(r.tagName,s.props&&s.props.type)[l];u&&u(r,o,s,a)}function initVModelForSSR(){vModelText.getSSRProps=({value:r})=>({value:r}),vModelRadio.getSSRProps=({value:r},o)=>{if(o.props&&looseEqual(o.props.value,r))return{checked:!0}},vModelCheckbox.getSSRProps=({value:r},o)=>{if(isArray$9(r)){if(o.props&&looseIndexOf(r,o.props.value)>-1)return{checked:!0}}else if(isSet$1(r)){if(o.props&&r.has(o.props.value))return{checked:!0}}else if(r)return{checked:!0}},vModelDynamic.getSSRProps=(r,o)=>{if(typeof o.type!="string")return;const s=resolveDynamicModel(o.type.toUpperCase(),o.props&&o.props.type);if(s.getSSRProps)return s.getSSRProps(r,o)}}const systemModifiers=["ctrl","shift","alt","meta"],modifierGuards={stop:r=>r.stopPropagation(),prevent:r=>r.preventDefault(),self:r=>r.target!==r.currentTarget,ctrl:r=>!r.ctrlKey,shift:r=>!r.shiftKey,alt:r=>!r.altKey,meta:r=>!r.metaKey,left:r=>"button"in r&&r.button!==0,middle:r=>"button"in r&&r.button!==1,right:r=>"button"in r&&r.button!==2,exact:(r,o)=>systemModifiers.some(s=>r[`${s}Key`]&&!o.includes(s))},withModifiers=(r,o)=>{const s=r._withMods||(r._withMods={}),a=o.join(".");return s[a]||(s[a]=(l,...c)=>{for(let u=0;u{const s=r._withKeys||(r._withKeys={}),a=o.join(".");return s[a]||(s[a]=l=>{if(!("key"in l))return;const c=hyphenate(l.key);if(o.some(u=>u===c||keyNames[u]===c))return r(l)})},rendererOptions=extend$3({patchProp},nodeOps);let renderer$1,enabledHydration=!1;function ensureRenderer(){return renderer$1||(renderer$1=createRenderer(rendererOptions))}function ensureHydrationRenderer(){return renderer$1=enabledHydration?renderer$1:createHydrationRenderer(rendererOptions),enabledHydration=!0,renderer$1}const render$1=(...r)=>{ensureRenderer().render(...r)},hydrate=(...r)=>{ensureHydrationRenderer().hydrate(...r)},createApp=(...r)=>{const o=ensureRenderer().createApp(...r),{mount:s}=o;return o.mount=a=>{const l=normalizeContainer(a);if(!l)return;const c=o._component;!isFunction$3(c)&&!c.render&&!c.template&&(c.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const u=s(l,!1,resolveRootNamespace(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),u},o},createSSRApp=(...r)=>{const o=ensureHydrationRenderer().createApp(...r),{mount:s}=o;return o.mount=a=>{const l=normalizeContainer(a);if(l)return s(l,!0,resolveRootNamespace(l))},o};function resolveRootNamespace(r){if(r instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&r instanceof MathMLElement)return"mathml"}function normalizeContainer(r){return isString$5(r)?document.querySelector(r):r}let ssrDirectiveInitialized=!1;const initDirectivesForSSR=()=>{ssrDirectiveInitialized||(ssrDirectiveInitialized=!0,initVModelForSSR(),initVShowForSSR())};/** -* vue v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const compile$2=()=>{},vue_runtime_esmBundler=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition,BaseTransitionPropsValidators,Comment:Comment$1,DeprecationTypes,EffectScope,ErrorCodes,ErrorTypeStrings,Fragment,KeepAlive,ReactiveEffect,Static,Suspense,Teleport,Text:Text$1,TrackOpTypes,Transition,TransitionGroup,TriggerOpTypes,VueElement,assertNumber,callWithAsyncErrorHandling,callWithErrorHandling,camelize,capitalize:capitalize$1,cloneVNode,compatUtils,compile:compile$2,computed,createApp,createBlock,createCommentVNode,createElementBlock,createElementVNode:createBaseVNode,createHydrationRenderer,createPropsRestProxy,createRenderer,createSSRApp,createSlots,createStaticVNode,createTextVNode,createVNode,customRef,defineAsyncComponent,defineComponent,defineCustomElement,defineEmits,defineExpose,defineModel,defineOptions,defineProps,defineSSRCustomElement,defineSlots,devtools:devtools$2,effect:effect$6,effectScope,getCurrentInstance,getCurrentScope,getCurrentWatcher,getTransitionRawChildren,guardReactiveProps,h:h$1,handleError,hasInjectionContext,hydrate,hydrateOnIdle,hydrateOnInteraction,hydrateOnMediaQuery,hydrateOnVisible,initCustomFormatter,initDirectivesForSSR,inject,isMemoSame,isProxy,isReactive,isReadonly,isRef,isRuntimeOnly,isShallow,isVNode:isVNode$1,markRaw,mergeDefaults,mergeModels,mergeProps,nextTick,normalizeClass,normalizeProps,normalizeStyle,onActivated,onBeforeMount,onBeforeUnmount,onBeforeUpdate,onDeactivated,onErrorCaptured,onMounted,onRenderTracked,onRenderTriggered,onScopeDispose,onServerPrefetch,onUnmounted,onUpdated,onWatcherCleanup,openBlock,popScopeId,provide,proxyRefs,pushScopeId,queuePostFlushCb,reactive,readonly,ref:ref$1,registerRuntimeCompiler,render:render$1,renderList,renderSlot,resolveComponent,resolveDirective,resolveDynamicComponent,resolveFilter,resolveTransitionHooks,setBlockTracking,setDevtoolsHook,setTransitionHooks,shallowReactive,shallowReadonly,shallowRef,ssrContextKey,ssrUtils,stop,toDisplayString:toDisplayString$1,toHandlerKey,toHandlers,toRaw,toRef,toRefs,toValue:toValue$2,transformVNodeArgs,triggerRef,unref,useAttrs,useCssModule,useCssVars,useHost,useId,useModel,useSSRContext,useShadowRoot,useSlots,useTemplateRef,useTransitionState,vModelCheckbox,vModelDynamic,vModelRadio,vModelSelect,vModelText,vShow,version:version$3,warn:warn$2,watch,watchEffect,watchPostEffect,watchSyncEffect,withAsyncContext,withCtx,withDefaults,withDirectives,withKeys,withMemo,withModifiers,withScopeId},Symbol.toStringTag,{value:"Module"}));/** - * vue-class-component v8.0.0-rc.1 - * (c) 2015-present Evan You - * @license MIT - */function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var s=0;s"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _assertThisInitialized(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function _possibleConstructorReturn(r,o){return o&&(typeof o=="object"||typeof o=="function")?o:_assertThisInitialized(r)}function _createSuper(r){var o=_isNativeReflectConstruct();return function(){var a=_getPrototypeOf(r),l;if(o){var c=_getPrototypeOf(this).constructor;l=Reflect.construct(a,arguments,c)}else l=a.apply(this,arguments);return _possibleConstructorReturn(this,l)}}function _toConsumableArray$1(r){return _arrayWithoutHoles$1(r)||_iterableToArray$1(r)||_unsupportedIterableToArray$1(r)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(r){if(Array.isArray(r))return _arrayLikeToArray$1(r)}function _iterableToArray$1(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function _unsupportedIterableToArray$1(r,o){if(r){if(typeof r=="string")return _arrayLikeToArray$1(r,o);var s=Object.prototype.toString.call(r).slice(8,-1);if(s==="Object"&&r.constructor&&(s=r.constructor.name),s==="Map"||s==="Set")return Array.from(r);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return _arrayLikeToArray$1(r,o)}}function _arrayLikeToArray$1(r,o){(o==null||o>r.length)&&(o=r.length);for(var s=0,a=new Array(o);s-1){l[y]=d[y];return}var _=Object.getOwnPropertyDescriptor(d,y);if(typeof _.value=="function"){l.methods[y]=_.value;return}if(_.get||_.set){l.computed[y]={get:_.get,set:_.set};return}}}),l.setup=function(y,_){var E,w=new s(y,_),T=Object.keys(w),k={},O=null;return T.forEach(function(R){w[R]===void 0||w[R]&&w[R].__s||(k[R]=ref$1(w[R]),defineProxy(w,R,k))}),T.forEach(function(R){if(w[R]&&w[R].__s){var M=w[R].__s();M instanceof Promise?(O||(O=Promise.resolve(k)),O=O.then(function(){return M.then(function(N){return k[R]=proxyRefs(N),k})})):k[R]=proxyRefs(M)}}),(E=O)!==null&&E!==void 0?E:k};var m=getOwn(s,"__d");m&&m.forEach(function(y){return y(l)});var g=["render","ssrRender","__file","__cssModules","__scopeId","__hmrId"];return g.forEach(function(y){s[y]&&(l[y]=s[y])}),l}}]),r}();VueImpl.__h=["data","beforeCreate","created","beforeMount","mounted","beforeUnmount","unmounted","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];var Vue=VueImpl;function Options$1(r){return function(o){return o.__o=r,o}}function createDecorator(r){return function(o,s,a){var l=typeof o=="function"?o:o.constructor;l.__d||(l.__d=[]),typeof a!="number"&&(a=void 0),l.__d.push(function(c){return r(c,s,a)})}}function Prop(r){return createDecorator((o,s)=>{o.props||(o.props=Object.create(null)),o.props[s]=r})}function Watch(r,o){return createDecorator((s,a)=>{s.watch||(s.watch=Object.create(null));const l=s.watch;typeof l[r]=="object"&&!Array.isArray(l[r])?l[r]=[l[r]]:typeof l[r]>"u"&&(l[r]=[]),l[r].push(Object.assign({handler:a},o))})}var isVue2=!1;/*! - * pinia v2.2.2 - * (c) 2024 Eduardo San Martin Morote - * @license MIT - */let activePinia;const setActivePinia=r=>activePinia=r,piniaSymbol=Symbol();function isPlainObject$4(r){return r&&typeof r=="object"&&Object.prototype.toString.call(r)==="[object Object]"&&typeof r.toJSON!="function"}var MutationType;(function(r){r.direct="direct",r.patchObject="patch object",r.patchFunction="patch function"})(MutationType||(MutationType={}));function createPinia(){const r=effectScope(!0),o=r.run(()=>ref$1({}));let s=[],a=[];const l=markRaw({install(c){setActivePinia(l),l._a=c,c.provide(piniaSymbol,l),c.config.globalProperties.$pinia=l,a.forEach(u=>s.push(u)),a=[]},use(c){return!this._a&&!isVue2?a.push(c):s.push(c),this},_p:s,_a:null,_e:r,_s:new Map,state:o});return l}const noop$6=()=>{};function addSubscription(r,o,s,a=noop$6){r.push(o);const l=()=>{const c=r.indexOf(o);c>-1&&(r.splice(c,1),a())};return!s&&getCurrentScope()&&onScopeDispose(l),l}function triggerSubscriptions(r,...o){r.slice().forEach(s=>{s(...o)})}const fallbackRunWithContext=r=>r(),ACTION_MARKER=Symbol(),ACTION_NAME=Symbol();function mergeReactiveObjects(r,o){r instanceof Map&&o instanceof Map?o.forEach((s,a)=>r.set(a,s)):r instanceof Set&&o instanceof Set&&o.forEach(r.add,r);for(const s in o){if(!o.hasOwnProperty(s))continue;const a=o[s],l=r[s];isPlainObject$4(l)&&isPlainObject$4(a)&&r.hasOwnProperty(s)&&!isRef(a)&&!isReactive(a)?r[s]=mergeReactiveObjects(l,a):r[s]=a}return r}const skipHydrateSymbol=Symbol();function shouldHydrate(r){return!isPlainObject$4(r)||!r.hasOwnProperty(skipHydrateSymbol)}const{assign:assign$7}=Object;function isComputed(r){return!!(isRef(r)&&r.effect)}function createOptionsStore(r,o,s,a){const{state:l,actions:c,getters:u}=o,d=s.state.value[r];let m;function g(){d||(s.state.value[r]=l?l():{});const y=toRefs(s.state.value[r]);return assign$7(y,c,Object.keys(u||{}).reduce((_,E)=>(_[E]=markRaw(computed(()=>{setActivePinia(s);const w=s._s.get(r);return u[E].call(w,w)})),_),{}))}return m=createSetupStore(r,g,o,s,a,!0),m}function createSetupStore(r,o,s={},a,l,c){let u;const d=assign$7({actions:{}},s),m={deep:!0};let g,y,_=[],E=[],w;const T=a.state.value[r];!c&&!T&&(a.state.value[r]={}),ref$1({});let k;function O(F){let U;g=y=!1,typeof F=="function"?(F(a.state.value[r]),U={type:MutationType.patchFunction,storeId:r,events:w}):(mergeReactiveObjects(a.state.value[r],F),U={type:MutationType.patchObject,payload:F,storeId:r,events:w});const J=k=Symbol();nextTick().then(()=>{k===J&&(g=!0)}),y=!0,triggerSubscriptions(_,U,a.state.value[r])}const R=c?function(){const{state:U}=s,J=U?U():{};this.$patch(z=>{assign$7(z,J)})}:noop$6;function M(){u.stop(),_=[],E=[],a._s.delete(r)}const N=(F,U="")=>{if(ACTION_MARKER in F)return F[ACTION_NAME]=U,F;const J=function(){setActivePinia(a);const z=Array.from(arguments),ie=[],ce=[];function Y(Ge){ie.push(Ge)}function B(Ge){ce.push(Ge)}triggerSubscriptions(E,{args:z,name:J[ACTION_NAME],store:P,after:Y,onError:B});let V;try{V=F.apply(this&&this.$id===r?this:P,z)}catch(Ge){throw triggerSubscriptions(ce,Ge),Ge}return V instanceof Promise?V.then(Ge=>(triggerSubscriptions(ie,Ge),Ge)).catch(Ge=>(triggerSubscriptions(ce,Ge),Promise.reject(Ge))):(triggerSubscriptions(ie,V),V)};return J[ACTION_MARKER]=!0,J[ACTION_NAME]=U,J},D={_p:a,$id:r,$onAction:addSubscription.bind(null,E),$patch:O,$reset:R,$subscribe(F,U={}){const J=addSubscription(_,F,U.detached,()=>z()),z=u.run(()=>watch(()=>a.state.value[r],ie=>{(U.flush==="sync"?y:g)&&F({storeId:r,type:MutationType.direct,events:w},ie)},assign$7({},m,U)));return J},$dispose:M},P=reactive(D);a._s.set(r,P);const L=(a._a&&a._a.runWithContext||fallbackRunWithContext)(()=>a._e.run(()=>(u=effectScope()).run(()=>o({action:N}))));for(const F in L){const U=L[F];if(isRef(U)&&!isComputed(U)||isReactive(U))c||(T&&shouldHydrate(U)&&(isRef(U)?U.value=T[F]:mergeReactiveObjects(U,T[F])),a.state.value[r][F]=U);else if(typeof U=="function"){const J=N(U,F);L[F]=J,d.actions[F]=U}}return assign$7(P,L),assign$7(toRaw(P),L),Object.defineProperty(P,"$state",{get:()=>a.state.value[r],set:F=>{O(U=>{assign$7(U,F)})}}),a._p.forEach(F=>{assign$7(P,u.run(()=>F({store:P,app:a._a,pinia:a,options:d})))}),T&&c&&s.hydrate&&s.hydrate(P.$state,T),g=!0,y=!0,P}function defineStore(r,o,s){let a,l;const c=typeof o=="function";typeof r=="string"?(a=r,l=c?s:o):(l=r,a=r.id);function u(d,m){const g=hasInjectionContext();return d=d||(g?inject(piniaSymbol,null):null),d&&setActivePinia(d),d=activePinia,d._s.has(a)||(c?createSetupStore(a,o,l,d):createOptionsStore(a,l,d)),d._s.get(a)}return u.$id=a,u}const useUserStore=defineStore("user",{state:()=>({userProfile:{}}),actions:{async fetchUserProfile(){const r="http://localhost:6040";try{const o=await fetch(r+"/api/user/profile",{method:"GET",credentials:"include"});if(o.ok){const s=await o.json();this.userProfile=s}else console.error("Failed to fetch the user profile.")}catch(o){console.error("Error fetching user profile: ",o)}}}}),useLockStore=defineStore("lock",{state:()=>({socket:void 0,uuid:"",secret:"",connected:!1,received:!1,timeInterval:void 0,timeRemaining:1e14,result:{},broadcast:void 0,confirmationTimeout:void 0,endTimeout:void 0}),actions:{initConnection(){const r="http://localhost:6040";this.socket=new WebSocket(r),this.socket.onopen=()=>(this.connected=!0,!1),this.socket.onmessage=o=>{const s=JSON.parse(o.data);this.received=!0,this.result=s}},lockStoryline(r){return clearInterval(this.timeInterval),new Promise((o,s)=>{const a=setInterval(()=>{if(this.connected){clearInterval(a),this.received=!1,this.socket?.send(JSON.stringify({uuid:r,lock:!0}));const l=setInterval(()=>{this.received&&(clearInterval(l),this.result.status==="fail"?s():(this.uuid=r,this.secret=this.result.secret,this.broadcast=new BroadcastChannel(this.result.secret),o()))})}},100)})},unlockStoryline(){clearInterval(this.timeInterval),this.connected&&(this.socket.send(JSON.stringify({uuid:this.uuid,lock:!1})),this.uuid="",this.secret="",this.broadcast?.postMessage({action:"end"}))},resetSession(r){this.timeRemaining=r!==void 0?r:1800,clearInterval(this.timeInterval),this.timeInterval=setInterval(()=>{this.timeRemaining===0?clearInterval(this.timeInterval):this.timeRemaining-=1},1e3)}}});var __defProp$s=Object.defineProperty,__getOwnPropDesc$j=Object.getOwnPropertyDescriptor,__decorateClass$r=(r,o,s,a)=>{for(var l=__getOwnPropDesc$j(o,s),c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=u(o,s,l)||l);return l&&__defProp$s(o,s,l),l};let App$1=class extends Vue{onRouteUpdate(o){this.$i18n.locale=o.params.lang??"en",o.params.lang&&(document.title=this.$t(o.meta.title))}mounted(){useUserStore(this.$pinia),useLockStore().initConnection()}};__decorateClass$r([Watch("$route",{immediate:!0})],App$1.prototype,"onRouteUpdate");const _export_sfc$1=(r,o)=>{const s=r.__vccOpts||r;for(const[a,l]of o)s[a]=l;return s},_hoisted_1$u={id:"app",class:"storyramp-app bg-white"};function _sfc_render$t(r,o,s,a,l,c){const u=resolveComponent("router-view");return openBlock(),createElementBlock("div",_hoisted_1$u,[(openBlock(),createBlock(u,{key:r.$route.path}))])}const App=_export_sfc$1(App$1,[["render",_sfc_render$t]]);Vue.registerHooks(["beforeRouterEnter","beforeRouteLeave","beforeRouteUpdate"]);let LandingV$1=class extends Vue{title=document.title;get userName(){return useUserStore().userProfile?.userName||"Guest"}};const _hoisted_1$t={class:"relative"},_hoisted_2$q={class:"absolute top-0 right-0 bg-white text-black p-2"},_hoisted_3$p={class:"flex flex-col items-center"},_hoisted_4$m={class:"text-2xl font-bold mt-4"},_hoisted_5$k={class:"flex justify-center mt-12 mb-32"},_hoisted_6$i={class:"lang-selector border-4 border-gray-400 border-solid mx-8"},_hoisted_7$i={class:"lang-selector border-4 border-gray-400 border-solid mx-8"};function _sfc_render$s(r,o,s,a,l,c){const u=resolveComponent("router-link");return openBlock(),createElementBlock("div",_hoisted_1$t,[createBaseVNode("div",_hoisted_2$q,toDisplayString$1(r.$t("editor.landing.greeting"))+" "+toDisplayString$1(r.userName)+"! ",1),createBaseVNode("div",_hoisted_3$p,[createBaseVNode("h1",_hoisted_4$m,toDisplayString$1(r.title),1),createBaseVNode("div",_hoisted_5$k,[createBaseVNode("div",_hoisted_6$i,[createVNode(u,{to:{name:"home",params:{lang:"en"}},class:"flex justify-center h-full w-full",target:""},{default:withCtx(()=>o[0]||(o[0]=[createBaseVNode("button",{class:"text-2xl text-white font-bold"},"English",-1)])),_:1})]),createBaseVNode("div",_hoisted_7$i,[createVNode(u,{to:{name:"home",params:{lang:"fr"}},class:"flex justify-center h-full w-full",target:""},{default:withCtx(()=>o[1]||(o[1]=[createBaseVNode("button",{class:"text-2xl text-white font-bold"},"Français",-1)])),_:1})])])])])}const LandingV=_export_sfc$1(LandingV$1,[["render",_sfc_render$s]]);var __defProp$r=Object.defineProperty,__decorateClass$q=(r,o,s,a)=>{for(var l=void 0,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=u(o,s,l)||l);return l&&__defProp$r(o,s,l),l};let HomeV$1=class extends Vue{sessionExpired;userStore=useUserStore();currLang="en";sourceFile="index.html#";profile={};showExpired=!1;mounted(){this.currLang=this.$route.params.lang||"en",this.sourceFile=window.location.href.split("/").find(o=>o.includes("#")),this.sessionExpired&&(this.showExpired=!0),this.userStore.fetchUserProfile().then(()=>{this.userStore.userProfile&&(this.profile=JSON.parse(JSON.stringify(this.userStore.userProfile)))}).catch(o=>{console.error(o)})}get userName(){return this.profile?.userName||"Guest"}get userStorylines(){return this.profile?.storylines?.sort((o,s)=>new Date(s.lastModified)-new Date(o.lastModified))||{}}dateFormatter(o){if(o){const s=new Date(o),a=[this.$t("editor.month.january"),this.$t("editor.month.february"),this.$t("editor.month.march"),this.$t("editor.month.april"),this.$t("editor.month.may"),this.$t("editor.month.june"),this.$t("editor.month.july"),this.$t("editor.month.august"),this.$t("editor.month.september"),this.$t("editor.month.october"),this.$t("editor.month.november"),this.$t("editor.month.december")];return this.currLang==="en"?a[s.getMonth()]+" "+s.getDate()+", "+s.getFullYear():s.getDate()+" "+a[s.getMonth()]+" "+s.getFullYear()}}editProduct(o){this.$router.push({name:"editor",params:{uid:o}})}};__decorateClass$q([Prop({default:!1})],HomeV$1.prototype,"sessionExpired");const _hoisted_1$s={class:"flex justify-between items-center p-8 border-b border-solid border-black"},_hoisted_2$p={class:"text-4xl"},_hoisted_3$o={class:"underline"},_hoisted_4$l={class:"relative",style:{"margin-right":"10%","margin-left":"10%"}},_hoisted_5$j={key:0,class:"w-full rounded-md bg-red-100 p-2 mt-5"},_hoisted_6$h={class:"flex flex-row items-center"},_hoisted_7$h={version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",style:{color:"rgb(245, 108, 108)"},class:"w-10 h-10 pr-2"},_hoisted_8$g={class:"pt-10 text-4xl font-semibold"},_hoisted_9$f={class:"text-xl font-semibold text-right pt-2 pb-2"},_hoisted_10$e={class:"mb-5 text-2xl font-semibold"},_hoisted_11$e={class:"flex justify-center"},_hoisted_12$d={class:"home-btn-container border border-gray-400 border-solid mr-5 flex-1 home-buttons"},_hoisted_13$c={class:"dashboard-option-button flex items-center text-xl font-bold px-2",tabindex:"-1"},_hoisted_14$a={style:{"font-size":"calc(60% + 0.25vw)"}},_hoisted_15$9={class:"home-btn-container border border-gray-400 border-solid flex-1 home-buttons"},_hoisted_16$8={class:"dashboard-option-button flex items-center text-xl font-bold",tabindex:"-1"},_hoisted_17$7={style:{"font-size":"calc(60% + 0.25vw)"}},_hoisted_18$7={class:"pt-8 pb-5 text-2xl font-semibold"},_hoisted_19$7={class:"shadow-lg bg-white w-full pr-0 mr-0"},_hoisted_20$6={style:{"background-color":"#e7e7e7"},class:"font-bold border-b border-solid border-black"},_hoisted_21$6={style:{"font-size":"calc(70% + 0.25vw)"},class:"m-2 mr-0 ml-3"},_hoisted_22$6={style:{"background-color":"#e7e7e7"},class:"font-bold border-b border-solid border-black"},_hoisted_23$6={style:{"font-size":"calc(70% + 0.25vw)"}},_hoisted_24$5={style:{"background-color":"#e7e7e7"},class:"font-bold border-b border-solid border-black"},_hoisted_25$4={style:{"font-size":"calc(70% + 0.25vw)"},class:"ml-2"},_hoisted_26$4={class:"m-2 mt-4 ml-3"},_hoisted_27$4={class:"m-2 mb-4 ml-3"},_hoisted_28$4=["onClick"];function _sfc_render$r(r,o,s,a,l,c){const u=resolveComponent("router-link");return openBlock(),createElementBlock("div",null,[createBaseVNode("div",_hoisted_1$s,[createBaseVNode("h1",_hoisted_2$p,toDisplayString$1(r.$t("editor.respectTitle")),1),r.sourceFile!=="index-ca-en.html#"&&r.sourceFile!=="index-ca-fr.html#"?(openBlock(),createBlock(u,{key:0,to:{name:"home",params:{lang:r.currLang==="en"?"fr":"en"}}},{default:withCtx(()=>[createBaseVNode("div",_hoisted_3$o,toDisplayString$1(`${r.currLang==="en"?"Français":"English"}`),1)]),_:1},8,["to"])):createCommentVNode("",!0)]),createBaseVNode("div",_hoisted_4$l,[r.showExpired?(openBlock(),createElementBlock("div",_hoisted_5$j,[createBaseVNode("span",_hoisted_6$h,[(openBlock(),createElementBlock("svg",_hoisted_7$h,o[1]||(o[1]=[createBaseVNode("path",{fill:"currentColor",d:"M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z"},null,-1)]))),createTextVNode(" "+toDisplayString$1(r.$t("editor.session.ended"))+" ",1),createBaseVNode("button",{onClick:o[0]||(o[0]=withModifiers(()=>{r.showExpired=!1},["stop"])),class:"editor-button bg-black text-white hover:bg-gray-800 ml-auto"},toDisplayString$1(r.$t("editor.ok")),1)])])):createCommentVNode("",!0),createBaseVNode("h2",_hoisted_8$g,toDisplayString$1(r.$t("editor.dashboard")),1),createBaseVNode("div",_hoisted_9$f,toDisplayString$1(r.$t("editor.landing.greeting"))+" "+toDisplayString$1(r.userName)+"! ",1),createBaseVNode("div",_hoisted_10$e,toDisplayString$1(r.$t("editor.chooseOption")),1),createBaseVNode("div",_hoisted_11$e,[createBaseVNode("div",_hoisted_12$d,[createVNode(u,{to:{name:"metadataNew"},class:"flex justify-center h-full",target:""},{default:withCtx(()=>[createBaseVNode("button",_hoisted_13$c,[o[2]||(o[2]=createBaseVNode("svg",{height:"50",width:"50",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 pr-3"},[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})],-1)),createBaseVNode("div",_hoisted_14$a,toDisplayString$1(r.$t("editor.createProduct")),1)])]),_:1})]),createBaseVNode("div",_hoisted_15$9,[createVNode(u,{to:{name:"metadataExisting"},class:"flex justify-center h-full",target:""},{default:withCtx(()=>[createBaseVNode("button",_hoisted_16$8,[o[3]||(o[3]=createBaseVNode("span",{class:"pr-3"},[createBaseVNode("svg",{width:"55",height:"55",viewBox:"0 0 55 55",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[createBaseVNode("path",{d:"M6.875 9.16675H48.125",stroke:"#33363F","stroke-width":"2","stroke-linecap":"round"}),createBaseVNode("path",{d:"M11.4585 9.16675H43.5418V40.3417C43.5418 41.4619 43.5418 42.0219 43.3238 42.4497C43.1321 42.8261 42.8261 43.132 42.4498 43.3238C42.022 43.5417 41.4619 43.5417 40.3418 43.5417H14.6585C13.5384 43.5417 12.9783 43.5417 12.5505 43.3238C12.1742 43.132 11.8682 42.8261 11.6765 42.4497C11.4585 42.0219 11.4585 41.4619 11.4585 40.3417V9.16675Z",stroke:"#33363F","stroke-width":"2","stroke-linecap":"round"}),createBaseVNode("path",{d:"M27.5 34.375V20.625",stroke:"#33363F","stroke-width":"2","stroke-linecap":"round"}),createBaseVNode("path",{d:"M20.625 27.5L27.3939 20.7311C27.4525 20.6725 27.5475 20.6725 27.6061 20.7311L34.375 27.5",stroke:"#33363F","stroke-width":"2","stroke-linecap":"round"})])],-1)),createBaseVNode("div",_hoisted_17$7,toDisplayString$1(r.$t("editor.loadProduct")),1)])]),_:1})])]),createBaseVNode("h2",_hoisted_18$7,toDisplayString$1(r.$t("editor.previousProducts")),1),createBaseVNode("table",_hoisted_19$7,[o[5]||(o[5]=createBaseVNode("colgroup",null,[createBaseVNode("col",{class:"w-3/5"}),createBaseVNode("col",{span:"2"})],-1)),createBaseVNode("tr",null,[createBaseVNode("td",_hoisted_20$6,[createBaseVNode("div",_hoisted_21$6,toDisplayString$1(r.$t("editor.previousProducts.productInfo")),1)]),createBaseVNode("td",_hoisted_22$6,[createBaseVNode("div",_hoisted_23$6,toDisplayString$1(r.$t("editor.previousProducts.lastModified")),1)]),createBaseVNode("td",_hoisted_24$5,[createBaseVNode("div",_hoisted_25$4,toDisplayString$1(r.$t("editor.previousProducts.actions")),1)])]),(openBlock(!0),createElementBlock(Fragment,null,renderList(r.userStorylines,(d,m)=>(openBlock(),createElementBlock("tr",{key:m},[createBaseVNode("td",{style:{"background-color":"#f9f9f9","padding-right":"1vw"},class:normalizeClass(["border-b border-solid",m===r.userStorylines.length-1?"border-black":"border-gray-200"])},[createBaseVNode("div",_hoisted_26$4,"UUID: "+toDisplayString$1(d.uuid),1),createBaseVNode("div",_hoisted_27$4,toDisplayString$1(r.$t("editor.previousProducts.productInfo.title")+": "+d.titleEN),1)],2),createBaseVNode("td",{style:{"background-color":"#f9f9f9","padding-right":"1vw"},class:normalizeClass(["border-b border-solid",m===r.userStorylines.length-1?"border-black":"border-gray-200"])},toDisplayString$1(r.dateFormatter(d.lastModified)),3),createBaseVNode("td",{style:{"background-color":"#f9f9f9","padding-right":"1vw"},class:normalizeClass(["border-b border-solid",m===r.userStorylines.length-1?"border-black":"border-gray-200"])},[createBaseVNode("button",{class:"flex items-center font-semibold rounded-sm py-2 border border-solid border-black home-buttons",style:{"padding-right":"1vw","padding-left":"1vw","word-wrap":"break-word","overflow-wrap":"break-word",display:"flex","flex-wrap":"wrap","white-space":"normal","min-width":"0","max-width":"100%"},onClick:g=>r.editProduct(d.uuid)},[o[4]||(o[4]=createBaseVNode("span",{class:"pr-1"},[createBaseVNode("svg",{height:"20",width:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"size-6"},[createBaseVNode("path",{d:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32L19.513 8.2Z"})])],-1)),createBaseVNode("span",null,toDisplayString$1(r.$t("editor.chart.label.edit")),1)],8,_hoisted_28$4)],2)]))),128))])])])}const HomeV=_export_sfc$1(HomeV$1,[["render",_sfc_render$r]]);function tryOnScopeDispose(r){return getCurrentScope()?(onScopeDispose(r),!0):!1}function toValue$1(r){return typeof r=="function"?r():unref(r)}const isClient=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const toString$4=Object.prototype.toString,isObject$6=r=>toString$4.call(r)==="[object Object]",noop$5=()=>{};function unrefElement$1(r){var o;const s=toValue$1(r);return(o=s?.$el)!=null?o:s}const defaultWindow=isClient?window:void 0;function useEventListener(...r){let o,s,a,l;if(typeof r[0]=="string"||Array.isArray(r[0])?([s,a,l]=r,o=defaultWindow):[o,s,a,l]=r,!o)return noop$5;Array.isArray(s)||(s=[s]),Array.isArray(a)||(a=[a]);const c=[],u=()=>{c.forEach(y=>y()),c.length=0},d=(y,_,E,w)=>(y.addEventListener(_,E,w),()=>y.removeEventListener(_,E,w)),m=watch(()=>[unrefElement$1(o),toValue$1(l)],([y,_])=>{if(u(),!y)return;const E=isObject$6(_)?{..._}:_;c.push(...s.flatMap(w=>a.map(T=>d(y,w,T,E))))},{immediate:!0,flush:"post"}),g=()=>{m(),u()};return tryOnScopeDispose(g),g}/*! -* tabbable 6.2.0 -* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE -*/var candidateSelectors=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],candidateSelector=candidateSelectors.join(","),NoElement=typeof Element>"u",matches$1=NoElement?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,getRootNode=!NoElement&&Element.prototype.getRootNode?function(r){var o;return r==null||(o=r.getRootNode)===null||o===void 0?void 0:o.call(r)}:function(r){return r?.ownerDocument},isInert=function r(o,s){var a;s===void 0&&(s=!0);var l=o==null||(a=o.getAttribute)===null||a===void 0?void 0:a.call(o,"inert"),c=l===""||l==="true",u=c||s&&o&&r(o.parentNode);return u},isContentEditable=function(o){var s,a=o==null||(s=o.getAttribute)===null||s===void 0?void 0:s.call(o,"contenteditable");return a===""||a==="true"},getCandidates=function(o,s,a){if(isInert(o))return[];var l=Array.prototype.slice.apply(o.querySelectorAll(candidateSelector));return s&&matches$1.call(o,candidateSelector)&&l.unshift(o),l=l.filter(a),l},getCandidatesIteratively=function r(o,s,a){for(var l=[],c=Array.from(o);c.length;){var u=c.shift();if(!isInert(u,!1))if(u.tagName==="SLOT"){var d=u.assignedElements(),m=d.length?d:u.children,g=r(m,!0,a);a.flatten?l.push.apply(l,g):l.push({scopeParent:u,candidates:g})}else{var y=matches$1.call(u,candidateSelector);y&&a.filter(u)&&(s||!o.includes(u))&&l.push(u);var _=u.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(u),E=!isInert(_,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(u));if(_&&E){var w=r(_===!0?u.children:_.children,!0,a);a.flatten?l.push.apply(l,w):l.push({scopeParent:u,candidates:w})}else c.unshift.apply(c,u.children)}}return l},hasTabIndex=function(o){return!isNaN(parseInt(o.getAttribute("tabindex"),10))},getTabIndex=function(o){if(!o)throw new Error("No node provided");return o.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(o.tagName)||isContentEditable(o))&&!hasTabIndex(o)?0:o.tabIndex},getSortOrderTabIndex=function(o,s){var a=getTabIndex(o);return a<0&&s&&!hasTabIndex(o)?0:a},sortOrderedTabbables=function(o,s){return o.tabIndex===s.tabIndex?o.documentOrder-s.documentOrder:o.tabIndex-s.tabIndex},isInput=function(o){return o.tagName==="INPUT"},isHiddenInput=function(o){return isInput(o)&&o.type==="hidden"},isDetailsWithSummary=function(o){var s=o.tagName==="DETAILS"&&Array.prototype.slice.apply(o.children).some(function(a){return a.tagName==="SUMMARY"});return s},getCheckedRadio=function(o,s){for(var a=0;asummary:first-of-type"),u=c?o.parentElement:o;if(matches$1.call(u,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="legacy-full"){if(typeof l=="function"){for(var d=o;o;){var m=o.parentElement,g=getRootNode(o);if(m&&!m.shadowRoot&&l(m)===!0)return isZeroArea(o);o.assignedSlot?o=o.assignedSlot:!m&&g!==o.ownerDocument?o=g.host:o=m}o=d}if(isNodeAttached(o))return!o.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return isZeroArea(o);return!1},isDisabledFromFieldset=function(o){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(o.tagName))for(var s=o.parentElement;s;){if(s.tagName==="FIELDSET"&&s.disabled){for(var a=0;a=0)},sortByOrder=function r(o){var s=[],a=[];return o.forEach(function(l,c){var u=!!l.scopeParent,d=u?l.scopeParent:l,m=getSortOrderTabIndex(d,u),g=u?r(l.candidates):d;m===0?u?s.push.apply(s,g):s.push(d):a.push({documentOrder:c,tabIndex:m,item:l,isScope:u,content:g})}),a.sort(sortOrderedTabbables).reduce(function(l,c){return c.isScope?l.push.apply(l,c.content):l.push(c.content),l},[]).concat(s)},tabbable=function(o,s){s=s||{};var a;return s.getShadowRoot?a=getCandidatesIteratively([o],s.includeContainer,{filter:isNodeMatchingSelectorTabbable.bind(null,s),flatten:!1,getShadowRoot:s.getShadowRoot,shadowRootFilter:isValidShadowRootTabbable}):a=getCandidates(o,s.includeContainer,isNodeMatchingSelectorTabbable.bind(null,s)),sortByOrder(a)},focusable=function(o,s){s=s||{};var a;return s.getShadowRoot?a=getCandidatesIteratively([o],s.includeContainer,{filter:isNodeMatchingSelectorFocusable.bind(null,s),flatten:!0,getShadowRoot:s.getShadowRoot}):a=getCandidates(o,s.includeContainer,isNodeMatchingSelectorFocusable.bind(null,s)),a},isTabbable=function(o,s){if(s=s||{},!o)throw new Error("No node provided");return matches$1.call(o,candidateSelector)===!1?!1:isNodeMatchingSelectorTabbable(s,o)},focusableCandidateSelector=candidateSelectors.concat("iframe").join(","),isFocusable=function(o,s){if(s=s||{},!o)throw new Error("No node provided");return matches$1.call(o,focusableCandidateSelector)===!1?!1:isNodeMatchingSelectorFocusable(s,o)};/*! -* focus-trap 7.6.0 -* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE -*/function _defineProperty$1(r,o,s){return(o=_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s,r}function ownKeys$2(r,o){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),s.push.apply(s,a)}return s}function _objectSpread2$1(r){for(var o=1;o0){var a=o[o.length-1];a!==s&&a.pause()}var l=o.indexOf(s);l===-1||o.splice(l,1),o.push(s)},deactivateTrap:function(o,s){var a=o.indexOf(s);a!==-1&&o.splice(a,1),o.length>0&&o[o.length-1].unpause()}},isSelectableInput=function(o){return o.tagName&&o.tagName.toLowerCase()==="input"&&typeof o.select=="function"},isEscapeEvent=function(o){return o?.key==="Escape"||o?.key==="Esc"||o?.keyCode===27},isTabEvent=function(o){return o?.key==="Tab"||o?.keyCode===9},isKeyForward=function(o){return isTabEvent(o)&&!o.shiftKey},isKeyBackward=function(o){return isTabEvent(o)&&o.shiftKey},delay=function(o){return setTimeout(o,0)},findIndex=function(o,s){var a=-1;return o.every(function(l,c){return s(l)?(a=c,!1):!0}),a},valueOrHandler=function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l1?B-1:0),Ge=1;Ge=0)ce=a.activeElement;else{var Y=u.tabbableGroups[0],B=Y&&Y.firstTabbableNode;ce=B||y("fallbackFocus")}if(!ce)throw new Error("Your focus-trap needs to have at least one focusable element");return ce},E=function(){if(u.containerGroups=u.containers.map(function(ce){var Y=tabbable(ce,c.tabbableOptions),B=focusable(ce,c.tabbableOptions),V=Y.length>0?Y[0]:void 0,Ge=Y.length>0?Y[Y.length-1]:void 0,St=B.find(function(jr){return isTabbable(jr)}),Dee=B.slice().reverse().find(function(jr){return isTabbable(jr)}),pee=!!Y.find(function(jr){return getTabIndex(jr)>0});return{container:ce,tabbableNodes:Y,focusableNodes:B,posTabIndexesFound:pee,firstTabbableNode:V,lastTabbableNode:Ge,firstDomTabbableNode:St,lastDomTabbableNode:Dee,nextTabbableNode:function(Tee){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ft=Y.indexOf(Tee);return ft<0?et?B.slice(B.indexOf(Tee)+1).find(function(yee){return isTabbable(yee)}):B.slice(0,B.indexOf(Tee)).reverse().find(function(yee){return isTabbable(yee)}):Y[ft+(et?1:-1)]}}}),u.tabbableGroups=u.containerGroups.filter(function(ce){return ce.tabbableNodes.length>0}),u.tabbableGroups.length<=0&&!y("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(u.containerGroups.find(function(ce){return ce.posTabIndexesFound})&&u.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},w=function(ce){var Y=ce.activeElement;if(Y)return Y.shadowRoot&&Y.shadowRoot.activeElement!==null?w(Y.shadowRoot):Y},T=function(ce){if(ce!==!1&&ce!==w(document)){if(!ce||!ce.focus){T(_());return}ce.focus({preventScroll:!!c.preventScroll}),u.mostRecentlyFocusedNode=ce,isSelectableInput(ce)&&ce.select()}},k=function(ce){var Y=y("setReturnFocus",ce);return Y||(Y===!1?!1:ce)},O=function(ce){var Y=ce.target,B=ce.event,V=ce.isBackward,Ge=V===void 0?!1:V;Y=Y||getActualTarget(B),E();var St=null;if(u.tabbableGroups.length>0){var Dee=g(Y,B),pee=Dee>=0?u.containerGroups[Dee]:void 0;if(Dee<0)Ge?St=u.tabbableGroups[u.tabbableGroups.length-1].lastTabbableNode:St=u.tabbableGroups[0].firstTabbableNode;else if(Ge){var jr=findIndex(u.tabbableGroups,function(xte){var Ote=xte.firstTabbableNode;return Y===Ote});if(jr<0&&(pee.container===Y||isFocusable(Y,c.tabbableOptions)&&!isTabbable(Y,c.tabbableOptions)&&!pee.nextTabbableNode(Y,!1))&&(jr=Dee),jr>=0){var Tee=jr===0?u.tabbableGroups.length-1:jr-1,et=u.tabbableGroups[Tee];St=getTabIndex(Y)>=0?et.lastTabbableNode:et.lastDomTabbableNode}else isTabEvent(B)||(St=pee.nextTabbableNode(Y,!1))}else{var ft=findIndex(u.tabbableGroups,function(xte){var Ote=xte.lastTabbableNode;return Y===Ote});if(ft<0&&(pee.container===Y||isFocusable(Y,c.tabbableOptions)&&!isTabbable(Y,c.tabbableOptions)&&!pee.nextTabbableNode(Y))&&(ft=Dee),ft>=0){var yee=ft===u.tabbableGroups.length-1?0:ft+1,ete=u.tabbableGroups[yee];St=getTabIndex(Y)>=0?ete.firstTabbableNode:ete.firstDomTabbableNode}else isTabEvent(B)||(St=pee.nextTabbableNode(Y))}}else St=y("fallbackFocus");return St},R=function(ce){var Y=getActualTarget(ce);if(!(g(Y,ce)>=0)){if(valueOrHandler(c.clickOutsideDeactivates,ce)){d.deactivate({returnFocus:c.returnFocusOnDeactivate});return}valueOrHandler(c.allowOutsideClick,ce)||ce.preventDefault()}},M=function(ce){var Y=getActualTarget(ce),B=g(Y,ce)>=0;if(B||Y instanceof Document)B&&(u.mostRecentlyFocusedNode=Y);else{ce.stopImmediatePropagation();var V,Ge=!0;if(u.mostRecentlyFocusedNode)if(getTabIndex(u.mostRecentlyFocusedNode)>0){var St=g(u.mostRecentlyFocusedNode),Dee=u.containerGroups[St].tabbableNodes;if(Dee.length>0){var pee=Dee.findIndex(function(jr){return jr===u.mostRecentlyFocusedNode});pee>=0&&(c.isKeyForward(u.recentNavEvent)?pee+1=0&&(V=Dee[pee-1],Ge=!1))}}else u.containerGroups.some(function(jr){return jr.tabbableNodes.some(function(Tee){return getTabIndex(Tee)>0})})||(Ge=!1);else Ge=!1;Ge&&(V=O({target:u.mostRecentlyFocusedNode,isBackward:c.isKeyBackward(u.recentNavEvent)})),T(V||u.mostRecentlyFocusedNode||_())}u.recentNavEvent=void 0},N=function(ce){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;u.recentNavEvent=ce;var B=O({event:ce,isBackward:Y});B&&(isTabEvent(ce)&&ce.preventDefault(),T(B))},D=function(ce){(c.isKeyForward(ce)||c.isKeyBackward(ce))&&N(ce,c.isKeyBackward(ce))},P=function(ce){isEscapeEvent(ce)&&valueOrHandler(c.escapeDeactivates,ce)!==!1&&(ce.preventDefault(),d.deactivate())},I=function(ce){var Y=getActualTarget(ce);g(Y,ce)>=0||valueOrHandler(c.clickOutsideDeactivates,ce)||valueOrHandler(c.allowOutsideClick,ce)||(ce.preventDefault(),ce.stopImmediatePropagation())},L=function(){if(u.active)return activeFocusTraps.activateTrap(l,d),u.delayInitialFocusTimer=c.delayInitialFocus?delay(function(){T(_())}):T(_()),a.addEventListener("focusin",M,!0),a.addEventListener("mousedown",R,{capture:!0,passive:!1}),a.addEventListener("touchstart",R,{capture:!0,passive:!1}),a.addEventListener("click",I,{capture:!0,passive:!1}),a.addEventListener("keydown",D,{capture:!0,passive:!1}),a.addEventListener("keydown",P),d},F=function(){if(u.active)return a.removeEventListener("focusin",M,!0),a.removeEventListener("mousedown",R,!0),a.removeEventListener("touchstart",R,!0),a.removeEventListener("click",I,!0),a.removeEventListener("keydown",D,!0),a.removeEventListener("keydown",P),d},U=function(ce){var Y=ce.some(function(B){var V=Array.from(B.removedNodes);return V.some(function(Ge){return Ge===u.mostRecentlyFocusedNode})});Y&&T(_())},J=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(U):void 0,z=function(){J&&(J.disconnect(),u.active&&!u.paused&&u.containers.map(function(ce){J.observe(ce,{subtree:!0,childList:!0})}))};return d={get active(){return u.active},get paused(){return u.paused},activate:function(ce){if(u.active)return this;var Y=m(ce,"onActivate"),B=m(ce,"onPostActivate"),V=m(ce,"checkCanFocusTrap");V||E(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=a.activeElement,Y?.();var Ge=function(){V&&E(),L(),z(),B?.()};return V?(V(u.containers.concat()).then(Ge,Ge),this):(Ge(),this)},deactivate:function(ce){if(!u.active)return this;var Y=_objectSpread2$1({onDeactivate:c.onDeactivate,onPostDeactivate:c.onPostDeactivate,checkCanReturnFocus:c.checkCanReturnFocus},ce);clearTimeout(u.delayInitialFocusTimer),u.delayInitialFocusTimer=void 0,F(),u.active=!1,u.paused=!1,z(),activeFocusTraps.deactivateTrap(l,d);var B=m(Y,"onDeactivate"),V=m(Y,"onPostDeactivate"),Ge=m(Y,"checkCanReturnFocus"),St=m(Y,"returnFocus","returnFocusOnDeactivate");B?.();var Dee=function(){delay(function(){St&&T(k(u.nodeFocusedBeforeActivation)),V?.()})};return St&&Ge?(Ge(k(u.nodeFocusedBeforeActivation)).then(Dee,Dee),this):(Dee(),this)},pause:function(ce){if(u.paused||!u.active)return this;var Y=m(ce,"onPause"),B=m(ce,"onPostPause");return u.paused=!0,Y?.(),F(),z(),B?.(),this},unpause:function(ce){if(!u.paused||!u.active)return this;var Y=m(ce,"onUnpause"),B=m(ce,"onPostUnpause");return u.paused=!1,Y?.(),E(),L(),z(),B?.(),this},updateContainerElements:function(ce){var Y=[].concat(ce).filter(Boolean);return u.containers=Y.map(function(B){return typeof B=="string"?a.querySelector(B):B}),u.active&&E(),z(),this}},d.updateContainerElements(o),d};function useFocusTrap(r,o={}){let s;const{immediate:a,...l}=o,c=ref$1(!1),u=ref$1(!1),d=_=>s&&s.activate(_),m=_=>s&&s.deactivate(_),g=()=>{s&&(s.pause(),u.value=!0)},y=()=>{s&&(s.unpause(),u.value=!1)};return watch(()=>unrefElement$1(r),_=>{_&&(s=createFocusTrap(_,{...l,onActivate(){c.value=!0,o.onActivate&&o.onActivate()},onDeactivate(){c.value=!1,o.onDeactivate&&o.onDeactivate()}}),a&&d())},{flush:"post"}),tryOnScopeDispose(()=>m()),{hasFocus:c,isPaused:u,activate:d,deactivate:m,pause:g,unpause:y}}const uo$3=r=>(...o)=>{r&&(r?.(...o),r=null)},q=()=>{};function oe$1(r,o,s){return r>s?s:r["if","show","visible"].includes(r)},hideOverlay:{type:Boolean,default:void 0},overlayBehavior:{type:String,default:"auto",validator:r=>["auto","persist"].includes(r)},overlayTransition:{type:[String,Object],default:void 0},contentTransition:{type:[String,Object],default:void 0},overlayClass:{type:void 0,default:void 0},contentClass:{type:void 0,default:void 0},overlayStyle:{type:[String,Object,Array],default:void 0},contentStyle:{type:[String,Object,Array],default:void 0},clickToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},background:{type:String,default:"non-interactive",validator:r=>["interactive","non-interactive"].includes(r)},focusTrap:{type:[Boolean,Object],default:()=>({allowOutsideClick:!0})},lockScroll:{type:Boolean,default:!0},reserveScrollBarGap:{type:Boolean,default:!0},zIndexFn:{type:Function,default:({index:r})=>1e3+2*r},swipeToClose:{type:String,default:"none",validator:r=>["none","up","right","down","left"].includes(r)},threshold:{type:Number,default:0},showSwipeBanner:{type:Boolean,default:void 0},preventNavigationGestures:{type:Boolean,default:void 0}};function Oe$1(r=!1){const o=ref$1(r),s=ref$1(o.value?0:void 0);return[o,s,{beforeEnter(){s.value=1},afterEnter(){s.value=0},beforeLeave(){s.value=3},afterLeave(){s.value=2}}]}function fo$3(r,o){const{modelValueLocal:s,onEntering:a,onEnter:l,onLeaving:c,onLeave:u}=o,d=ref$1(s.value),[m,g,y]=Oe$1(d.value),[_,E,w]=Oe$1(d.value),T=computed(()=>typeof r.contentTransition=="string"?{name:r.contentTransition,appear:!0}:{appear:!0,...r.contentTransition}),k=computed(()=>typeof r.overlayTransition=="string"?{name:r.overlayTransition,appear:!0}:{appear:!0,...r.overlayTransition}),O=computed(()=>(r.hideOverlay||E.value===2)&&g.value===2);watch(O,N=>{N&&(d.value=!1)}),watch(g,N=>{if(N===1){if(!d.value)return;a?.()}else if(N===0){if(!d.value)return;l?.()}else N===3?c?.():N===2&&u?.()});async function R(){d.value=!0,await nextTick(),m.value=!0,_.value=!0}function M(){m.value=!1,_.value=!1}return{visible:d,contentVisible:m,contentListeners:y,contentTransition:T,overlayVisible:_,overlayListeners:w,overlayTransition:k,enterTransition:R,leaveTransition:M}}function vo$3(r,o,s){const{vfmRootEl:a,vfmContentEl:l,visible:c,modelValueLocal:u}=s,d=ref$1();function m(){c.value&&r.escToClose&&(u.value=!1)}function g(_){d.value=_?.target}function y(){var _;d.value===a.value&&(r.clickToClose?u.value=!1:((_=l.value)==null||_.focus(),o("clickOutside")))}return{onEsc:m,onMouseupRoot:y,onMousedown:g}}function po$3(r,o,s){let a=!1;const{open:l,close:c}=s,u=ref$1(!1),d={get value(){return u.value},set value(g){m(g)}};function m(g){(g?l():c())?(u.value=g,g!==r.modelValue&&o("update:modelValue",g)):(a=!0,o("update:modelValue",!g),nextTick(()=>{a=!1}))}return watch(()=>r.modelValue,g=>{a||(d.value=!!g)}),{modelValueLocal:d}}function yo$1(r,o){if(r.focusTrap===!1)return{focus(){},blur(){}};const{focusEl:s}=o,{hasFocus:a,activate:l,deactivate:c}=useFocusTrap(s,r.focusTrap);function u(){requestAnimationFrame(()=>{l()})}function d(){a.value&&c()}return{focus:u,blur:d}}let be$2=!1;if(typeof window<"u"){const r={get passive(){be$2=!0}};window.addEventListener("testPassive",null,r),window.removeEventListener("testPassive",null,r)}const He$1=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1);let j$1=[],le$2=!1,ne$2=0,je$3=-1,W,X$2;const ho$3=r=>{if(!r||r.nodeType!==Node.ELEMENT_NODE)return!1;const o=window.getComputedStyle(r);return["auto","scroll"].includes(o.overflowY)&&r.scrollHeight>r.clientHeight},mo$3=(r,o)=>!(r.scrollTop===0&&o<0||r.scrollTop+r.clientHeight+o>=r.scrollHeight&&o>0),wo$3=r=>{const o=[];for(;r;){if(o.push(r),r.classList.contains("vfm"))return o;r=r.parentElement}return o},bo$3=(r,o)=>{let s=!1;return wo$3(r).forEach(a=>{ho$3(a)&&mo$3(a,o)&&(s=!0)}),s},Ne=r=>j$1.some(()=>bo$3(r,-ne$2)),se$1=r=>{const o=r||window.event;return Ne(o.target)||o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)},To$3=r=>{if(X$2===void 0){const o=!!r&&r.reserveScrollBarGap===!0,s=window.innerWidth-document.documentElement.clientWidth;if(o&&s>0){const a=parseInt(getComputedStyle(document.body).getPropertyValue("padding-right"),10);X$2=document.body.style.paddingRight,document.body.style.paddingRight=`${a+s}px`}}W===void 0&&(W=document.body.style.overflow,document.body.style.overflow="hidden")},So$2=()=>{X$2!==void 0&&(document.body.style.paddingRight=X$2,X$2=void 0),W!==void 0&&(document.body.style.overflow=W,W=void 0)},Mo$2=r=>r?r.scrollHeight-r.scrollTop<=r.clientHeight:!1,go$3=(r,o)=>(ne$2=r.targetTouches[0].clientY-je$3,Ne(r.target)?!1:o&&o.scrollTop===0&&ne$2>0||Mo$2(o)&&ne$2<0?se$1(r):(r.stopPropagation(),!0)),Co$3=(r,o)=>{if(!r){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(j$1.some(a=>a.targetElement===r))return;const s={targetElement:r,options:o||{}};j$1=[...j$1,s],He$1?(r.ontouchstart=a=>{a.targetTouches.length===1&&(je$3=a.targetTouches[0].clientY)},r.ontouchmove=a=>{a.targetTouches.length===1&&go$3(a,r)},le$2||(document.addEventListener("touchmove",se$1,be$2?{passive:!1}:void 0),le$2=!0)):To$3(o)},ko$3=r=>{if(!r){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}j$1=j$1.filter(o=>o.targetElement!==r),He$1?(r.ontouchstart=null,r.ontouchmove=null,le$2&&j$1.length===0&&(document.removeEventListener("touchmove",se$1,be$2?{passive:!1}:void 0),le$2=!1)):j$1.length||So$2()};function Vo$2(r,o){const{lockScrollEl:s,modelValueLocal:a}=o;let l;watch(s,d=>{d&&(l=d)},{immediate:!0}),watch(()=>r.lockScroll,d=>{d?u():c()}),onBeforeUnmount(()=>{c()});function c(){l&&ko$3(l)}function u(){a.value&&r.lockScroll&&l&&Co$3(l,{reserveScrollBarGap:r.reserveScrollBarGap,allowTouchMove:d=>{for(;d&&d!==document.body;){if(d.getAttribute("vfm-scroll-lock-ignore")!==null)return!0;d=d.parentElement}return!1}})}return{enableBodyScroll:c,disableBodyScroll:u}}function Eo$3(r){const o=ref$1();function s(l){var c;o.value=(c=r.zIndexFn)==null?void 0:c.call(r,{index:l<=-1?0:l})}function a(){o.value=void 0}return{zIndex:o,refreshZIndex:s,resetZIndex:a}}const ve$2={beforeMount(r,{value:o},{transition:s}){r._vov=r.style.visibility==="hidden"?"":r.style.visibility,s&&o?s.beforeEnter(r):G(r,o)},mounted(r,{value:o},{transition:s}){s&&o&&s.enter(r)},updated(r,{value:o,oldValue:s},{transition:a}){!o!=!s&&(a?o?(a.beforeEnter(r),G(r,!0),a.enter(r)):a.leave(r,()=>{G(r,!1)}):G(r,o))},beforeUnmount(r,{value:o}){G(r,o)}};function G(r,o){r.style.visibility=o?r._vov:"hidden"}const De$2=r=>{if(r instanceof MouseEvent){const{clientX:o,clientY:s}=r;return{x:o,y:s}}else{const{clientX:o,clientY:s}=r.targetTouches[0];return{x:o,y:s}}};function Bo$3(r){if(!r)return!1;let o=!1;const s={get passive(){return o=!0,!1}};return r.addEventListener("x",q,s),r.removeEventListener("x",q),o}function Oo$2(r,{threshold:o=0,onSwipeStart:s,onSwipe:a,onSwipeEnd:l,passive:c=!0}){const u=reactive({x:0,y:0}),d=reactive({x:0,y:0}),m=computed(()=>u.x-d.x),g=computed(()=>u.y-d.y),{max:y,abs:_}=Math,E=computed(()=>y(_(m.value),_(g.value))>=o),w=ref$1(!1),T=computed(()=>E.value?_(m.value)>_(g.value)?m.value>0?"left":"right":g.value>0?"up":"down":"none"),k=(L,F)=>{u.x=L,u.y=F},O=(L,F)=>{d.x=L,d.y=F};let R,M;function N(L){R.capture&&!R.passive&&L.preventDefault();const{x:F,y:U}=De$2(L);k(F,U),O(F,U),s?.(L),M=[useEventListener(r,"mousemove",D,R),useEventListener(r,"touchmove",D,R),useEventListener(r,"mouseup",P,R),useEventListener(r,"touchend",P,R),useEventListener(r,"touchcancel",P,R)]}function D(L){const{x:F,y:U}=De$2(L);O(F,U),!w.value&&E.value&&(w.value=!0),w.value&&a?.(L)}function P(L){w.value&&l?.(L,T.value),w.value=!1,M.forEach(F=>F())}let I=[];return onMounted(()=>{const L=Bo$3(window?.document);c?R=L?{passive:!0}:{capture:!1}:R=L?{passive:!1,capture:!0}:{capture:!0},I=[useEventListener(r,"mousedown",N,R),useEventListener(r,"touchstart",N,R)]}),{isSwiping:w,direction:T,coordsStart:u,coordsEnd:d,lengthX:m,lengthY:g,stop:()=>{I.forEach(L=>L()),M.forEach(L=>L())}}}function Do$3(r,o){const{vfmContentEl:s,modelValueLocal:a}=o,l=.1,c=300,u=ref$1(),d=computed(()=>{if(!(r.swipeToClose===void 0||r.swipeToClose==="none"))return r.showSwipeBanner?u.value:s.value}),m=ref$1(0),g=ref$1(!0);let y=q,_=!0,E,w=!1;const{lengthX:T,lengthY:k,direction:O,isSwiping:R}=Oo$2(d,{threshold:r.threshold,onSwipeStart(P){y=useEventListener(document,"selectionchange",()=>{var I;g.value=(I=window.getSelection())==null?void 0:I.isCollapsed}),E=new Date().getTime(),w=D(P?.target)},onSwipe(){var P,I,L,F;if(w&&g.value&&O.value===r.swipeToClose){if(O.value==="up"){const U=oe$1(Math.abs(k.value||0),0,((P=d.value)==null?void 0:P.offsetHeight)||0)-(r.threshold||0);m.value=U}else if(O.value==="down"){const U=oe$1(Math.abs(k.value||0),0,((I=d.value)==null?void 0:I.offsetHeight)||0)-(r.threshold||0);m.value=-U}else if(O.value==="right"){const U=oe$1(Math.abs(T.value||0),0,((L=d.value)==null?void 0:L.offsetWidth)||0)-(r.threshold||0);m.value=-U}else if(O.value==="left"){const U=oe$1(Math.abs(T.value||0),0,((F=d.value)==null?void 0:F.offsetWidth)||0)-(r.threshold||0);m.value=U}}},onSwipeEnd(P,I){if(y(),!g.value){g.value=!0;return}const L=new Date().getTime(),F=I===r.swipeToClose,U=(()=>{var z,ie;if(I==="up"||I==="down")return Math.abs(k?.value||0)>l*(((z=d.value)==null?void 0:z.offsetHeight)||0);if(I==="left"||I==="right")return Math.abs(T?.value||0)>l*(((ie=d.value)==null?void 0:ie.offsetWidth)||0)})(),J=L-E<=c;if(_&&w&&F&&(U||J)){a.value=!1;return}m.value=0}}),M=computed(()=>{if(r.swipeToClose==="none")return;const P=(()=>{switch(r.swipeToClose){case"up":case"down":return"translateY";case"left":case"right":return"translateX"}})();return{class:{"vfm-bounce-back":!R.value},style:{transform:`${P}(${-m.value}px)`}}});watch(()=>g.value,P=>{P||(m.value=0)}),watch(()=>a.value,P=>{P&&(m.value=0)}),watch(()=>m.value,(P,I)=>{switch(r.swipeToClose){case"down":case"right":_=PI;break}});function N(P){r.preventNavigationGestures&&P.preventDefault()}function D(P){const I=P?.tagName;if(!I||["INPUT","TEXTAREA"].includes(I))return!1;const L=(()=>{switch(r.swipeToClose){case"up":return P?.scrollTop+P?.clientHeight===P?.scrollHeight;case"left":return P?.scrollLeft+P?.clientWidth===P?.scrollWidth;case"down":return P?.scrollTop===0;case"right":return P?.scrollLeft===0;default:return!1}})();return P===d.value?L:L&&D(P?.parentElement)}return{vfmContentEl:s,swipeBannerEl:u,bindSwipe:M,onTouchStartSwipeBanner:N}}const Ye$3=Symbol("vfm");let H$1;const Lo$3=r=>H$1=r,Po$3={install:q,modals:[],openedModals:[],openedModalOverlays:[],dynamicModals:[],modalsContainers:ref$1([]),get:()=>{},toggle:()=>{},open:()=>{},close:()=>{},closeAll:()=>Promise.allSettled([])},Ao$2=()=>getCurrentInstance()&&inject(Ye$3,Po$3)||H$1;function zo$2(){const r=shallowReactive([]),o=shallowReactive([]),s=shallowReactive([]),a=shallowReactive([]),l=ref$1([]),c=markRaw({install(u){u.provide(Ye$3,c),u.config.globalProperties.$vfm=c},modals:r,openedModals:o,openedModalOverlays:s,dynamicModals:a,modalsContainers:l,get(u){return r.find(d=>{var m,g;return((g=(m=Z(d))==null?void 0:m.value.modalId)==null?void 0:g.value)===u})},toggle(u,d){var m;const g=c.get(u);return(m=Z(g))==null?void 0:m.value.toggle(d)},open(u){return c.toggle(u,!0)},close(u){return c.toggle(u,!1)},closeAll(){return Promise.allSettled(o.reduce((u,d)=>{const m=Z(d),g=m?.value.toggle(!1);return g&&u.push(g),u},[]))}});return Lo$3(c),c}function Z(r){var o;return(o=r?.exposed)==null?void 0:o.modalExposed}const Io$1=defineComponent({inheritAttrs:!1}),Ro$3=defineComponent({...Io$1,__name:"VueFinalModal",props:co$3,emits:["update:modelValue","beforeOpen","opened","beforeClose","closed","clickOutside"],setup(r,{expose:o,emit:s}){const a=r,l=s,c=useAttrs(),u=getCurrentInstance(),{modals:d,openedModals:m,openedModalOverlays:g}=K(),y=ref$1(),_=ref$1(),{focus:E,blur:w}=yo$1(a,{focusEl:y}),{zIndex:T,refreshZIndex:k,resetZIndex:O}=Eo$3(a),{modelValueLocal:R}=po$3(a,l,{open:jr,close:Tee}),{enableBodyScroll:M,disableBodyScroll:N}=Vo$2(a,{lockScrollEl:y,modelValueLocal:R});let D=q;const{visible:P,contentVisible:I,contentListeners:L,contentTransition:F,overlayVisible:U,overlayListeners:J,overlayTransition:z,enterTransition:ie,leaveTransition:ce}=fo$3(a,{modelValueLocal:R,onEntering(){nextTick(()=>{N(),E()})},onEnter(){l("opened"),D("opened")},onLeave(){$(m,u),O(),M(),l("closed"),D("closed")}}),{onEsc:Y,onMouseupRoot:B,onMousedown:V}=vo$3(a,l,{vfmRootEl:y,vfmContentEl:_,visible:P,modelValueLocal:R}),{swipeBannerEl:Ge,bindSwipe:St,onTouchStartSwipeBanner:Dee}=Do$3(a,{vfmContentEl:_,modelValueLocal:R}),pee=computed(()=>u?m.indexOf(u):-1);watch([()=>a.zIndexFn,pee],()=>{P.value&&k(pee.value)}),onMounted(()=>{fe(d,u)}),a.modelValue&&(R.value=!0);function jr(){let nee=!1;return l("beforeOpen",{stop:()=>nee=!0}),nee?!1:(fe(m,u),fe(g,u),ft(),ie(),!0)}function Tee(){let nee=!1;return l("beforeClose",{stop:()=>nee=!0}),nee?!1:($(g,u),ft(),w(),ce(),!0)}function et(){R.value=!1}onBeforeUnmount(()=>{M(),$(d,u),$(m,u),w(),ft()});async function ft(){await nextTick();const nee=g.filter(Wee=>{var Bee;const Nte=Z(Wee);return Nte?.value.overlayBehavior.value==="auto"&&!((Bee=Nte?.value.hideOverlay)!=null&&Bee.value)});nee.forEach((Wee,Bee)=>{const Nte=Z(Wee);Nte!=null&&Nte.value&&(Nte.value.overlayVisible.value=Bee===nee.length-1)})}const yee=toRef(()=>a.modalId),ete=toRef(()=>a.hideOverlay),xte=toRef(()=>a.overlayBehavior),Ote=computed(()=>({modalId:yee,hideOverlay:ete,overlayBehavior:xte,overlayVisible:U,toggle(nee){return new Promise(Wee=>{D=uo$3(Nte=>Wee(Nte));const Bee=typeof nee=="boolean"?nee:!R.value;R.value=Bee})}}));return o({modalExposed:Ote}),(nee,Wee)=>(openBlock(),createBlock(Teleport,{to:nee.teleportTo?nee.teleportTo:void 0,disabled:!nee.teleportTo},[nee.displayDirective!=="if"||unref(P)?withDirectives((openBlock(),createElementBlock("div",mergeProps({key:0},unref(c),{ref_key:"vfmRootEl",ref:y,class:["vfm vfm--fixed vfm--inset",{"vfm--prevent-none":nee.background==="interactive"}],style:{zIndex:unref(T)},role:"dialog","aria-modal":"true",onKeydown:Wee[7]||(Wee[7]=withKeys(()=>unref(Y)(),["esc"])),onMouseup:Wee[8]||(Wee[8]=withModifiers(()=>unref(B)(),["self"])),onMousedown:Wee[9]||(Wee[9]=withModifiers(Bee=>unref(V)(Bee),["self"]))}),[ete.value?createCommentVNode("",!0):(openBlock(),createBlock(Transition,mergeProps({key:0},unref(z),toHandlers(unref(J))),{default:withCtx(()=>[nee.displayDirective!=="if"||unref(U)?withDirectives((openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["vfm__overlay vfm--overlay vfm--absolute vfm--inset vfm--prevent-none",nee.overlayClass]),style:normalizeStyle(nee.overlayStyle),"aria-hidden":"true"},null,6)),[[vShow,nee.displayDirective!=="show"||unref(U)],[unref(ve$2),nee.displayDirective!=="visible"||unref(U)]]):createCommentVNode("",!0)]),_:1},16)),createVNode(Transition,mergeProps(unref(F),toHandlers(unref(L))),{default:withCtx(()=>[nee.displayDirective!=="if"||unref(I)?withDirectives((openBlock(),createElementBlock("div",mergeProps({key:0,ref_key:"vfmContentEl",ref:_,class:["vfm__content vfm--outline-none",[nee.contentClass,{"vfm--prevent-auto":nee.background==="interactive"}]],style:nee.contentStyle,tabindex:"0"},unref(St),{onMousedown:Wee[6]||(Wee[6]=()=>unref(V)())}),[renderSlot(nee.$slots,"default",normalizeProps(guardReactiveProps({close:et}))),nee.showSwipeBanner?(openBlock(),createElementBlock("div",{key:0,ref_key:"swipeBannerEl",ref:Ge,class:"vfm-swipe-banner-container",onTouchstart:Wee[2]||(Wee[2]=Bee=>unref(Dee)(Bee))},[renderSlot(nee.$slots,"swipe-banner",{},()=>[createBaseVNode("div",{class:"vfm-swipe-banner-back",onTouchstart:Wee[0]||(Wee[0]=Bee=>nee.swipeToClose==="left"&&Bee.preventDefault())},null,32),createBaseVNode("div",{class:"vfm-swipe-banner-forward",onTouchstart:Wee[1]||(Wee[1]=Bee=>nee.swipeToClose==="right"&&Bee.preventDefault())},null,32)])],544)):!nee.showSwipeBanner&&nee.preventNavigationGestures?(openBlock(),createElementBlock("div",{key:1,class:"vfm-swipe-banner-container",onTouchstart:Wee[5]||(Wee[5]=Bee=>unref(Dee)(Bee))},[createBaseVNode("div",{class:"vfm-swipe-banner-back",onTouchstart:Wee[3]||(Wee[3]=Bee=>nee.swipeToClose==="left"&&Bee.preventDefault())},null,32),createBaseVNode("div",{class:"vfm-swipe-banner-forward",onTouchstart:Wee[4]||(Wee[4]=Bee=>nee.swipeToClose==="right"&&Bee.preventDefault())},null,32)],32)):createCommentVNode("",!0)],16)),[[vShow,nee.displayDirective!=="show"||unref(I)],[unref(ve$2),nee.displayDirective!=="visible"||unref(I)]]):createCommentVNode("",!0)]),_:3},16)],16)),[[vShow,nee.displayDirective!=="show"||unref(P)],[unref(ve$2),nee.displayDirective!=="visible"||unref(P)]]):createCommentVNode("",!0)],8,["to","disabled"]))}});function K(){const r=Ao$2();if(!r)throw new Error(`[Vue Final Modal]: getActiveVfm was called with no active Vfm. Did you forget to install vfm? - const vfm = createVfm() - app.use(vfm) -This will fail in production.`);return r}var __defProp$q=Object.defineProperty,__getOwnPropDesc$i=Object.getOwnPropertyDescriptor,__decorateClass$p=(r,o,s,a)=>{for(var l=a>1?void 0:a?__getOwnPropDesc$i(o,s):o,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=(a?u(o,s,l):u(l))||l);return a&&l&&__defProp$q(o,s,l),l};let MetadataEditorV$5=class extends Vue{name;title;message;onOk(){this.$emit("ok"),this.$vfm.close(this.name)}onCancel(){this.$emit("Cancel"),this.$vfm.close(this.name)}};__decorateClass$p([Prop()],MetadataEditorV$5.prototype,"name",2);__decorateClass$p([Prop()],MetadataEditorV$5.prototype,"title",2);__decorateClass$p([Prop()],MetadataEditorV$5.prototype,"message",2);MetadataEditorV$5=__decorateClass$p([Options$1({components:{"vue-final-modal":Ro$3}})],MetadataEditorV$5);const _hoisted_1$r={class:"mx-5 my-2"},_hoisted_2$o={slot:"header",class:"text-2xl font-bold mb-1"},_hoisted_3$n={class:"w-full flex justify-end mt-3"};function _sfc_render$q(r,o,s,a,l,c){const u=resolveComponent("vue-final-modal");return openBlock(),createBlock(u,{modalId:r.name,clickToClose:!1,"content-class":"flex flex-col max-h-full overflow-y-auto max-w-xl mx-4 p-4 bg-white border rounded-lg space-y-2",class:"flex justify-center items-center"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$r,[createBaseVNode("h2",_hoisted_2$o,toDisplayString$1(r.title),1),createBaseVNode("p",null,toDisplayString$1(r.message),1),createBaseVNode("div",_hoisted_3$n,[createBaseVNode("button",{class:"editor-button bg-black text-white hover:bg-gray-800",onClick:o[0]||(o[0]=(...d)=>r.onOk&&r.onOk(...d))},toDisplayString$1(r.$t("editor.slides.continue")),1),createBaseVNode("button",{class:"editor-button hover:bg-gray-800",onClick:o[1]||(o[1]=(...d)=>r.onCancel&&r.onCancel(...d))},toDisplayString$1(r.$t("editor.cancel")),1)])])]),_:1},8,["modalId"])}const ActionModal=_export_sfc$1(MetadataEditorV$5,[["render",_sfc_render$q],["__scopeId","data-v-340c884d"]]);function throttle$2(r,o,s){var a={},l=a.noTrailing,c=l===void 0?!1:l,u=a.noLeading,d=u===void 0?!1:u,m=a.debounceMode,g=m===void 0?void 0:m,y,_=!1,E=0;function w(){y&&clearTimeout(y)}function T(O){var R=O||{},M=R.upcomingOnly,N=M===void 0?!1:M;w(),_=!N}function k(){for(var O=arguments.length,R=new Array(O),M=0;Mr?d?(E=Date.now(),c||(y=setTimeout(g?I:P,r))):P():c!==!0&&(y=setTimeout(g?I:P,g===void 0?r-D:r))}return k.cancel=T,k}var PanelType=(r=>(r.Text="text",r.Image="image",r.Map="map",r.Chart="chart",r.Video="video",r.Audio="audio",r.Slideshow="slideshow",r.Dynamic="dynamic",r.Loading="loading",r))(PanelType||{});const BaseStartingConfig={text:{type:"text",title:"",content:""},dynamic:{type:"dynamic",title:"",titleTag:"",content:"",children:[]},slideshow:{type:"slideshow",items:[],caption:"",userCreated:!0},image:{type:"image",src:""},chart:{type:"chart",src:""},map:{type:"map",config:"",title:"",scrollguard:!1},video:{type:"video",title:"",videoType:"",src:""}};function noop$4(){}function createWeakMap(){return typeof WeakMap<"u"?new WeakMap:fakeSetOrMap()}function fakeSetOrMap(){return{add:noop$4,delete:noop$4,get:noop$4,set:noop$4,has:function(r){return!1}}}var hop=Object.prototype.hasOwnProperty,has$6=function(r,o){return hop.call(r,o)};function extend$2(r,o){for(var s in o)has$6(o,s)&&(r[s]=o[s]);return r}var reLeadingNewline=/^[ \t]*(?:\r\n|\r|\n)/,reTrailingNewline=/(?:\r\n|\r|\n)[ \t]*$/,reStartsWithNewlineOrIsEmpty=/^(?:[\r\n]|$)/,reDetectIndentation=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,reOnlyWhitespaceWithAtLeastOneNewline=/^[ \t]*[\r\n][ \t\r\n]*$/;function _outdentArray(r,o,s){var a=0,l=r[0].match(reDetectIndentation);l&&(a=l[1].length);var c="(\\r\\n|\\r|\\n).{0,"+a+"}",u=new RegExp(c,"g");o&&(r=r.slice(1));var d=s.newline,m=s.trimLeadingNewline,g=s.trimTrailingNewline,y=typeof d=="string",_=r.length,E=r.map(function(w,T){return w=w.replace(u,"$1"),T===0&&m&&(w=w.replace(reLeadingNewline,"")),T===_-1&&g&&(w=w.replace(reTrailingNewline,"")),y&&(w=w.replace(/\r\n|\n|\r/g,function(k){return d})),w});return E}function concatStringsAndValues(r,o){for(var s="",a=0,l=r.length;a"u")){var a=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",s==="top"&&a.firstChild?a.insertBefore(l,a.firstChild):a.appendChild(l),l.styleSheet?l.styleSheet.cssText=r:l.appendChild(document.createTextNode(r))}}const spinnerProps={size:{type:[Number,String],default:"1em"},color:String};let isStyleInjected=!1;function useSpinner(r){if(!isStyleInjected){const o=defaultOutdent` - .vue-spinner { - vertical-align: middle; - } - `;styleInject$1(o),isStyleInjected=!0}return{cSize:computed(()=>r.size),classes:computed(()=>"vue-spinner"),style:computed(()=>({color:r.color}))}}var e$k=[],t$k=[];function n$k(r,o){if(r&&typeof document<"u"){var s,a=o.prepend===!0?"prepend":"append",l=o.singleTag===!0,c=typeof o.container=="string"?document.querySelector(o.container):document.getElementsByTagName("head")[0];if(l){var u=e$k.indexOf(c);u===-1&&(u=e$k.push(c)-1,t$k[u]={}),s=t$k[u]&&t$k[u][a]?t$k[u][a]:t$k[u][a]=d()}else s=d();r.charCodeAt(0)===65279&&(r=r.substring(1)),s.styleSheet?s.styleSheet.cssText+=r:s.appendChild(document.createTextNode(r))}function d(){var m=document.createElement("style");if(m.setAttribute("type","text/css"),o.attributes)for(var g=Object.keys(o.attributes),y=0;y{let s="";const a=toHex(r);if(a!==void 0?s=a.slice(1):r.startsWith("#")&&(s=r.slice(1)),s.length===3){let u="";for(const d of s)u+=d,u+=d;s=u}const l=s.match(/.{2}/g);if(l===null)throw new Error(`Could not identify RGB value of color \`${r}\``);return`rgba(${l.map(u=>Number.parseInt(u,16)).join(", ")}, ${o})`};var parseUnit=function(o,s){s||(s=[0,""]),o=String(o);var a=parseFloat(o,10);return s[0]=a,s[1]=o.match(/[\d.\-\+]*\s*(.*)/)[1]||"",s};const parseUnit$1=getDefaultExportFromCjs(parseUnit);function useSize(r){return computed(()=>{const o=r();let[s,a]=parseUnit$1(String(o));return a=a===void 0||a===""?"px":a,{value:s,unit:a,string:`${s}${a}`}})}var e$j=[],t$j=[];function n$j(r,o){if(r&&typeof document<"u"){var s,a=o.prepend===!0?"prepend":"append",l=o.singleTag===!0,c=typeof o.container=="string"?document.querySelector(o.container):document.getElementsByTagName("head")[0];if(l){var u=e$j.indexOf(c);u===-1&&(u=e$j.push(c)-1,t$j[u]={}),s=t$j[u]&&t$j[u][a]?t$j[u][a]:t$j[u][a]=d()}else s=d();r.charCodeAt(0)===65279&&(r=r.substring(1)),s.styleSheet?s.styleSheet.cssText+=r:s.appendChild(document.createTextNode(r))}function d(){var m=document.createElement("style");if(m.setAttribute("type","text/css"),o.attributes)for(var g=Object.keys(o.attributes),y=0;yh$1("svg",{style:a.value,class:s.value,stroke:"currentColor",width:o.value,height:o.value,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg"},svg)}});var arrayRange=range$2;function range$2(r,o,s){if(r!=null&&typeof r!="number")throw new Error("start must be a number or null");if(o!=null&&typeof o!="number")throw new Error("stop must be a number or null");if(s!=null&&typeof s!="number")throw new Error("step must be a number or null");o==null&&(o=r||0,r=0),s==null&&(s=o>r?1:-1);for(var a=[],l=ro;r+=s)a.push(r);return a}var e$9=[],t$9=[];function n$9(r,o){if(r&&typeof document<"u"){var s,a=o.prepend===!0?"prepend":"append",l=o.singleTag===!0,c=typeof o.container=="string"?document.querySelector(o.container):document.getElementsByTagName("head")[0];if(l){var u=e$9.indexOf(c);u===-1&&(u=e$9.push(c)-1,t$9[u]={}),s=t$9[u]&&t$9[u][a]?t$9[u][a]:t$9[u][a]=d()}else s=d();r.charCodeAt(0)===65279&&(r=r.substring(1)),s.styleSheet?s.styleSheet.cssText+=r:s.appendChild(document.createTextNode(r))}function d(){var m=document.createElement("style");if(m.setAttribute("type","text/css"),o.attributes)for(var g=Object.keys(o.attributes),y=0;y - -(c) 2009-2016 Stuart Knightley -Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - -JSZip uses the library pako released under the MIT license : -https://github.com/nodeca/pako/blob/main/LICENSE -*/(function(r,o){(function(s){r.exports=s()})(function(){return function s(a,l,c){function u(g,y){if(!l[g]){if(!a[g]){var _=typeof commonjsRequire=="function"&&commonjsRequire;if(!y&&_)return _(g,!0);if(d)return d(g,!0);var E=new Error("Cannot find module '"+g+"'");throw E.code="MODULE_NOT_FOUND",E}var w=l[g]={exports:{}};a[g][0].call(w.exports,function(T){var k=a[g][1][T];return u(k||T)},w,w.exports,s,a,l,c)}return l[g].exports}for(var d=typeof commonjsRequire=="function"&&commonjsRequire,m=0;m>2,w=(3&g)<<4|y>>4,T=1>6:64,k=2>4,y=(15&E)<<4|(w=d.indexOf(m.charAt(k++)))>>2,_=(3&w)<<6|(T=d.indexOf(m.charAt(k++))),M[O++]=g,w!==64&&(M[O++]=y),T!==64&&(M[O++]=_);return M}},{"./support":30,"./utils":32}],2:[function(s,a,l){var c=s("./external"),u=s("./stream/DataWorker"),d=s("./stream/Crc32Probe"),m=s("./stream/DataLengthProbe");function g(y,_,E,w,T){this.compressedSize=y,this.uncompressedSize=_,this.crc32=E,this.compression=w,this.compressedContent=T}g.prototype={getContentWorker:function(){var y=new u(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new m("data_length")),_=this;return y.on("end",function(){if(this.streamInfo.data_length!==_.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new u(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(y,_,E){return y.pipe(new d).pipe(new m("uncompressedSize")).pipe(_.compressWorker(E)).pipe(new m("compressedSize")).withStreamInfo("compression",_)},a.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(s,a,l){var c=s("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},l.DEFLATE=s("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(s,a,l){var c=s("./utils"),u=function(){for(var d,m=[],g=0;g<256;g++){d=g;for(var y=0;y<8;y++)d=1&d?3988292384^d>>>1:d>>>1;m[g]=d}return m}();a.exports=function(d,m){return d!==void 0&&d.length?c.getTypeOf(d)!=="string"?function(g,y,_,E){var w=u,T=E+_;g^=-1;for(var k=E;k>>8^w[255&(g^y[k])];return-1^g}(0|m,d,d.length,0):function(g,y,_,E){var w=u,T=E+_;g^=-1;for(var k=E;k>>8^w[255&(g^y.charCodeAt(k))];return-1^g}(0|m,d,d.length,0):0}},{"./utils":32}],5:[function(s,a,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(s,a,l){var c=null;c=typeof Promise<"u"?Promise:s("lie"),a.exports={Promise:c}},{lie:37}],7:[function(s,a,l){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",u=s("pako"),d=s("./utils"),m=s("./stream/GenericWorker"),g=c?"uint8array":"array";function y(_,E){m.call(this,"FlateWorker/"+_),this._pako=null,this._pakoAction=_,this._pakoOptions=E,this.meta={}}l.magic="\b\0",d.inherits(y,m),y.prototype.processChunk=function(_){this.meta=_.meta,this._pako===null&&this._createPako(),this._pako.push(d.transformTo(g,_.data),!1)},y.prototype.flush=function(){m.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){m.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new u[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var _=this;this._pako.onData=function(E){_.push({data:E,meta:_.meta})}},l.compressWorker=function(_){return new y("Deflate",_)},l.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(s,a,l){function c(w,T){var k,O="";for(k=0;k>>=8;return O}function u(w,T,k,O,R,M){var N,D,P=w.file,I=w.compression,L=M!==g.utf8encode,F=d.transformTo("string",M(P.name)),U=d.transformTo("string",g.utf8encode(P.name)),J=P.comment,z=d.transformTo("string",M(J)),ie=d.transformTo("string",g.utf8encode(J)),ce=U.length!==P.name.length,Y=ie.length!==J.length,B="",V="",Ge="",St=P.dir,Dee=P.date,pee={crc32:0,compressedSize:0,uncompressedSize:0};T&&!k||(pee.crc32=w.crc32,pee.compressedSize=w.compressedSize,pee.uncompressedSize=w.uncompressedSize);var jr=0;T&&(jr|=8),L||!ce&&!Y||(jr|=2048);var Tee=0,et=0;St&&(Tee|=16),R==="UNIX"?(et=798,Tee|=function(yee,ete){var xte=yee;return yee||(xte=ete?16893:33204),(65535&xte)<<16}(P.unixPermissions,St)):(et=20,Tee|=function(yee){return 63&(yee||0)}(P.dosPermissions)),N=Dee.getUTCHours(),N<<=6,N|=Dee.getUTCMinutes(),N<<=5,N|=Dee.getUTCSeconds()/2,D=Dee.getUTCFullYear()-1980,D<<=4,D|=Dee.getUTCMonth()+1,D<<=5,D|=Dee.getUTCDate(),ce&&(V=c(1,1)+c(y(F),4)+U,B+="up"+c(V.length,2)+V),Y&&(Ge=c(1,1)+c(y(z),4)+ie,B+="uc"+c(Ge.length,2)+Ge);var ft="";return ft+=` -\0`,ft+=c(jr,2),ft+=I.magic,ft+=c(N,2),ft+=c(D,2),ft+=c(pee.crc32,4),ft+=c(pee.compressedSize,4),ft+=c(pee.uncompressedSize,4),ft+=c(F.length,2),ft+=c(B.length,2),{fileRecord:_.LOCAL_FILE_HEADER+ft+F+B,dirRecord:_.CENTRAL_FILE_HEADER+c(et,2)+ft+c(z.length,2)+"\0\0\0\0"+c(Tee,4)+c(O,4)+F+B+z}}var d=s("../utils"),m=s("../stream/GenericWorker"),g=s("../utf8"),y=s("../crc32"),_=s("../signature");function E(w,T,k,O){m.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=T,this.zipPlatform=k,this.encodeFileName=O,this.streamFiles=w,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}d.inherits(E,m),E.prototype.push=function(w){var T=w.meta.percent||0,k=this.entriesCount,O=this._sources.length;this.accumulate?this.contentBuffer.push(w):(this.bytesWritten+=w.data.length,m.prototype.push.call(this,{data:w.data,meta:{currentFile:this.currentFile,percent:k?(T+100*(k-O-1))/k:100}}))},E.prototype.openedSource=function(w){this.currentSourceOffset=this.bytesWritten,this.currentFile=w.file.name;var T=this.streamFiles&&!w.file.dir;if(T){var k=u(w,T,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:k.fileRecord,meta:{percent:0}})}else this.accumulate=!0},E.prototype.closedSource=function(w){this.accumulate=!1;var T=this.streamFiles&&!w.file.dir,k=u(w,T,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(k.dirRecord),T)this.push({data:function(O){return _.DATA_DESCRIPTOR+c(O.crc32,4)+c(O.compressedSize,4)+c(O.uncompressedSize,4)}(w),meta:{percent:100}});else for(this.push({data:k.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},E.prototype.flush=function(){for(var w=this.bytesWritten,T=0;T=this.index;m--)g=(g<<8)+this.byteAt(m);return this.index+=d,g},readString:function(d){return c.transformTo("string",this.readData(d))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var d=this.readInt(4);return new Date(Date.UTC(1980+(d>>25&127),(d>>21&15)-1,d>>16&31,d>>11&31,d>>5&63,(31&d)<<1))}},a.exports=u},{"../utils":32}],19:[function(s,a,l){var c=s("./Uint8ArrayReader");function u(d){c.call(this,d)}s("../utils").inherits(u,c),u.prototype.readData=function(d){this.checkOffset(d);var m=this.data.slice(this.zero+this.index,this.zero+this.index+d);return this.index+=d,m},a.exports=u},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(s,a,l){var c=s("./DataReader");function u(d){c.call(this,d)}s("../utils").inherits(u,c),u.prototype.byteAt=function(d){return this.data.charCodeAt(this.zero+d)},u.prototype.lastIndexOfSignature=function(d){return this.data.lastIndexOf(d)-this.zero},u.prototype.readAndCheckSignature=function(d){return d===this.readData(4)},u.prototype.readData=function(d){this.checkOffset(d);var m=this.data.slice(this.zero+this.index,this.zero+this.index+d);return this.index+=d,m},a.exports=u},{"../utils":32,"./DataReader":18}],21:[function(s,a,l){var c=s("./ArrayReader");function u(d){c.call(this,d)}s("../utils").inherits(u,c),u.prototype.readData=function(d){if(this.checkOffset(d),d===0)return new Uint8Array(0);var m=this.data.subarray(this.zero+this.index,this.zero+this.index+d);return this.index+=d,m},a.exports=u},{"../utils":32,"./ArrayReader":17}],22:[function(s,a,l){var c=s("../utils"),u=s("../support"),d=s("./ArrayReader"),m=s("./StringReader"),g=s("./NodeBufferReader"),y=s("./Uint8ArrayReader");a.exports=function(_){var E=c.getTypeOf(_);return c.checkSupport(E),E!=="string"||u.uint8array?E==="nodebuffer"?new g(_):u.uint8array?new y(c.transformTo("uint8array",_)):new d(c.transformTo("array",_)):new m(_)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(s,a,l){l.LOCAL_FILE_HEADER="PK",l.CENTRAL_FILE_HEADER="PK",l.CENTRAL_DIRECTORY_END="PK",l.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",l.ZIP64_CENTRAL_DIRECTORY_END="PK",l.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(s,a,l){var c=s("./GenericWorker"),u=s("../utils");function d(m){c.call(this,"ConvertWorker to "+m),this.destType=m}u.inherits(d,c),d.prototype.processChunk=function(m){this.push({data:u.transformTo(this.destType,m.data),meta:m.meta})},a.exports=d},{"../utils":32,"./GenericWorker":28}],25:[function(s,a,l){var c=s("./GenericWorker"),u=s("../crc32");function d(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}s("../utils").inherits(d,c),d.prototype.processChunk=function(m){this.streamInfo.crc32=u(m.data,this.streamInfo.crc32||0),this.push(m)},a.exports=d},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(s,a,l){var c=s("../utils"),u=s("./GenericWorker");function d(m){u.call(this,"DataLengthProbe for "+m),this.propName=m,this.withStreamInfo(m,0)}c.inherits(d,u),d.prototype.processChunk=function(m){if(m){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+m.data.length}u.prototype.processChunk.call(this,m)},a.exports=d},{"../utils":32,"./GenericWorker":28}],27:[function(s,a,l){var c=s("../utils"),u=s("./GenericWorker");function d(m){u.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,m.then(function(y){g.dataIsReady=!0,g.data=y,g.max=y&&y.length||0,g.type=c.getTypeOf(y),g.isPaused||g._tickAndRepeat()},function(y){g.error(y)})}c.inherits(d,u),d.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this.data=null},d.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},d.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},d.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var m=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":m=this.data.substring(this.index,g);break;case"uint8array":m=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":m=this.data.slice(this.index,g)}return this.index=g,this.push({data:m,meta:{percent:this.max?this.index/this.max*100:0}})},a.exports=d},{"../utils":32,"./GenericWorker":28}],28:[function(s,a,l){function c(u){this.name=u||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(u){this.emit("data",u)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(u){this.emit("error",u)}return!0},error:function(u){return!this.isFinished&&(this.isPaused?this.generatedError=u:(this.isFinished=!0,this.emit("error",u),this.previous&&this.previous.error(u),this.cleanUp()),!0)},on:function(u,d){return this._listeners[u].push(d),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(u,d){if(this._listeners[u])for(var m=0;m "+u:u}},a.exports=c},{}],29:[function(s,a,l){var c=s("../utils"),u=s("./ConvertWorker"),d=s("./GenericWorker"),m=s("../base64"),g=s("../support"),y=s("../external"),_=null;if(g.nodestream)try{_=s("../nodejs/NodejsStreamOutputAdapter")}catch{}function E(T,k){return new y.Promise(function(O,R){var M=[],N=T._internalType,D=T._outputType,P=T._mimeType;T.on("data",function(I,L){M.push(I),k&&k(L)}).on("error",function(I){M=[],R(I)}).on("end",function(){try{var I=function(L,F,U){switch(L){case"blob":return c.newBlob(c.transformTo("arraybuffer",F),U);case"base64":return m.encode(F);default:return c.transformTo(L,F)}}(D,function(L,F){var U,J=0,z=null,ie=0;for(U=0;U"u")l.blob=!1;else{var c=new ArrayBuffer(0);try{l.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);u.append(c),l.blob=u.getBlob("application/zip").size===0}catch{l.blob=!1}}}try{l.nodestream=!!s("readable-stream").Readable}catch{l.nodestream=!1}},{"readable-stream":16}],31:[function(s,a,l){for(var c=s("./utils"),u=s("./support"),d=s("./nodejsUtils"),m=s("./stream/GenericWorker"),g=new Array(256),y=0;y<256;y++)g[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;g[254]=g[254]=1;function _(){m.call(this,"utf-8 decode"),this.leftOver=null}function E(){m.call(this,"utf-8 encode")}l.utf8encode=function(w){return u.nodebuffer?d.newBufferFrom(w,"utf-8"):function(T){var k,O,R,M,N,D=T.length,P=0;for(M=0;M>>6:(O<65536?k[N++]=224|O>>>12:(k[N++]=240|O>>>18,k[N++]=128|O>>>12&63),k[N++]=128|O>>>6&63),k[N++]=128|63&O);return k}(w)},l.utf8decode=function(w){return u.nodebuffer?c.transformTo("nodebuffer",w).toString("utf-8"):function(T){var k,O,R,M,N=T.length,D=new Array(2*N);for(k=O=0;k>10&1023,D[O++]=56320|1023&R)}return D.length!==O&&(D.subarray?D=D.subarray(0,O):D.length=O),c.applyFromCharCode(D)}(w=c.transformTo(u.uint8array?"uint8array":"array",w))},c.inherits(_,m),_.prototype.processChunk=function(w){var T=c.transformTo(u.uint8array?"uint8array":"array",w.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var k=T;(T=new Uint8Array(k.length+this.leftOver.length)).set(this.leftOver,0),T.set(k,this.leftOver.length)}else T=this.leftOver.concat(T);this.leftOver=null}var O=function(M,N){var D;for((N=N||M.length)>M.length&&(N=M.length),D=N-1;0<=D&&(192&M[D])==128;)D--;return D<0||D===0?N:D+g[M[D]]>N?D:N}(T),R=T;O!==T.length&&(u.uint8array?(R=T.subarray(0,O),this.leftOver=T.subarray(O,T.length)):(R=T.slice(0,O),this.leftOver=T.slice(O,T.length))),this.push({data:l.utf8decode(R),meta:w.meta})},_.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:l.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},l.Utf8DecodeWorker=_,c.inherits(E,m),E.prototype.processChunk=function(w){this.push({data:l.utf8encode(w.data),meta:w.meta})},l.Utf8EncodeWorker=E},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(s,a,l){var c=s("./support"),u=s("./base64"),d=s("./nodejsUtils"),m=s("./external");function g(k){return k}function y(k,O){for(var R=0;R>8;this.dir=!!(16&this.externalFileAttributes),w==0&&(this.dosPermissions=63&this.externalFileAttributes),w==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var w=c(this.extraFields[1].value);this.uncompressedSize===u.MAX_VALUE_32BITS&&(this.uncompressedSize=w.readInt(8)),this.compressedSize===u.MAX_VALUE_32BITS&&(this.compressedSize=w.readInt(8)),this.localHeaderOffset===u.MAX_VALUE_32BITS&&(this.localHeaderOffset=w.readInt(8)),this.diskNumberStart===u.MAX_VALUE_32BITS&&(this.diskNumberStart=w.readInt(4))}},readExtraFields:function(w){var T,k,O,R=w.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});w.index+4>>6:(w<65536?E[O++]=224|w>>>12:(E[O++]=240|w>>>18,E[O++]=128|w>>>12&63),E[O++]=128|w>>>6&63),E[O++]=128|63&w);return E},l.buf2binstring=function(_){return y(_,_.length)},l.binstring2buf=function(_){for(var E=new c.Buf8(_.length),w=0,T=E.length;w>10&1023,M[T++]=56320|1023&k)}return y(M,T)},l.utf8border=function(_,E){var w;for((E=E||_.length)>_.length&&(E=_.length),w=E-1;0<=w&&(192&_[w])==128;)w--;return w<0||w===0?E:w+m[_[w]]>E?w:E}},{"./common":41}],43:[function(s,a,l){a.exports=function(c,u,d,m){for(var g=65535&c|0,y=c>>>16&65535|0,_=0;d!==0;){for(d-=_=2e3>>1:u>>>1;d[m]=u}return d}();a.exports=function(u,d,m,g){var y=c,_=g+m;u^=-1;for(var E=g;E<_;E++)u=u>>>8^y[255&(u^d[E])];return-1^u}},{}],46:[function(s,a,l){var c,u=s("../utils/common"),d=s("./trees"),m=s("./adler32"),g=s("./crc32"),y=s("./messages"),_=0,E=4,w=0,T=-2,k=-1,O=4,R=2,M=8,N=9,D=286,P=30,I=19,L=2*D+1,F=15,U=3,J=258,z=J+U+1,ie=42,ce=113,Y=1,B=2,V=3,Ge=4;function St(st,Lee){return st.msg=y[Lee],Lee}function Dee(st){return(st<<1)-(4st.avail_out&&($te=st.avail_out),$te!==0&&(u.arraySet(st.output,Lee.pending_buf,Lee.pending_out,$te,st.next_out),st.next_out+=$te,Lee.pending_out+=$te,st.total_out+=$te,st.avail_out-=$te,Lee.pending-=$te,Lee.pending===0&&(Lee.pending_out=0))}function Tee(st,Lee){d._tr_flush_block(st,0<=st.block_start?st.block_start:-1,st.strstart-st.block_start,Lee),st.block_start=st.strstart,jr(st.strm)}function et(st,Lee){st.pending_buf[st.pending++]=Lee}function ft(st,Lee){st.pending_buf[st.pending++]=Lee>>>8&255,st.pending_buf[st.pending++]=255&Lee}function yee(st,Lee){var $te,Kee,Iee=st.max_chain_length,Rte=st.strstart,dee=st.prev_length,fee=st.nice_match,Oee=st.strstart>st.w_size-z?st.strstart-(st.w_size-z):0,xee=st.window,kee=st.w_mask,Dte=st.prev,Ite=st.strstart+J,Lte=xee[Rte+dee-1],Vte=xee[Rte+dee];st.prev_length>=st.good_match&&(Iee>>=2),fee>st.lookahead&&(fee=st.lookahead);do if(xee[($te=Lee)+dee]===Vte&&xee[$te+dee-1]===Lte&&xee[$te]===xee[Rte]&&xee[++$te]===xee[Rte+1]){Rte+=2,$te++;do;while(xee[++Rte]===xee[++$te]&&xee[++Rte]===xee[++$te]&&xee[++Rte]===xee[++$te]&&xee[++Rte]===xee[++$te]&&xee[++Rte]===xee[++$te]&&xee[++Rte]===xee[++$te]&&xee[++Rte]===xee[++$te]&&xee[++Rte]===xee[++$te]&&RteOee&&--Iee!=0);return dee<=st.lookahead?dee:st.lookahead}function ete(st){var Lee,$te,Kee,Iee,Rte,dee,fee,Oee,xee,kee,Dte=st.w_size;do{if(Iee=st.window_size-st.lookahead-st.strstart,st.strstart>=Dte+(Dte-z)){for(u.arraySet(st.window,st.window,Dte,Dte,0),st.match_start-=Dte,st.strstart-=Dte,st.block_start-=Dte,Lee=$te=st.hash_size;Kee=st.head[--Lee],st.head[Lee]=Dte<=Kee?Kee-Dte:0,--$te;);for(Lee=$te=Dte;Kee=st.prev[--Lee],st.prev[Lee]=Dte<=Kee?Kee-Dte:0,--$te;);Iee+=Dte}if(st.strm.avail_in===0)break;if(dee=st.strm,fee=st.window,Oee=st.strstart+st.lookahead,xee=Iee,kee=void 0,kee=dee.avail_in,xee=U)for(Rte=st.strstart-st.insert,st.ins_h=st.window[Rte],st.ins_h=(st.ins_h<=U&&(st.ins_h=(st.ins_h<=U)if(Kee=d._tr_tally(st,st.strstart-st.match_start,st.match_length-U),st.lookahead-=st.match_length,st.match_length<=st.max_lazy_match&&st.lookahead>=U){for(st.match_length--;st.strstart++,st.ins_h=(st.ins_h<=U&&(st.ins_h=(st.ins_h<=U&&st.match_length<=st.prev_length){for(Iee=st.strstart+st.lookahead-U,Kee=d._tr_tally(st,st.strstart-1-st.prev_match,st.prev_length-U),st.lookahead-=st.prev_length-1,st.prev_length-=2;++st.strstart<=Iee&&(st.ins_h=(st.ins_h<st.pending_buf_size-5&&($te=st.pending_buf_size-5);;){if(st.lookahead<=1){if(ete(st),st.lookahead===0&&Lee===_)return Y;if(st.lookahead===0)break}st.strstart+=st.lookahead,st.lookahead=0;var Kee=st.block_start+$te;if((st.strstart===0||st.strstart>=Kee)&&(st.lookahead=st.strstart-Kee,st.strstart=Kee,Tee(st,!1),st.strm.avail_out===0)||st.strstart-st.block_start>=st.w_size-z&&(Tee(st,!1),st.strm.avail_out===0))return Y}return st.insert=0,Lee===E?(Tee(st,!0),st.strm.avail_out===0?V:Ge):(st.strstart>st.block_start&&(Tee(st,!1),st.strm.avail_out),Y)}),new nee(4,4,8,4,xte),new nee(4,5,16,8,xte),new nee(4,6,32,32,xte),new nee(4,4,16,16,Ote),new nee(8,16,32,32,Ote),new nee(8,16,128,128,Ote),new nee(8,32,128,256,Ote),new nee(32,128,258,1024,Ote),new nee(32,258,258,4096,Ote)],l.deflateInit=function(st,Lee){return _ee(st,Lee,M,15,8,0)},l.deflateInit2=_ee,l.deflateReset=Nte,l.deflateResetKeep=Bee,l.deflateSetHeader=function(st,Lee){return st&&st.state?st.state.wrap!==2?T:(st.state.gzhead=Lee,w):T},l.deflate=function(st,Lee){var $te,Kee,Iee,Rte;if(!st||!st.state||5>8&255),et(Kee,Kee.gzhead.time>>16&255),et(Kee,Kee.gzhead.time>>24&255),et(Kee,Kee.level===9?2:2<=Kee.strategy||Kee.level<2?4:0),et(Kee,255&Kee.gzhead.os),Kee.gzhead.extra&&Kee.gzhead.extra.length&&(et(Kee,255&Kee.gzhead.extra.length),et(Kee,Kee.gzhead.extra.length>>8&255)),Kee.gzhead.hcrc&&(st.adler=g(st.adler,Kee.pending_buf,Kee.pending,0)),Kee.gzindex=0,Kee.status=69):(et(Kee,0),et(Kee,0),et(Kee,0),et(Kee,0),et(Kee,0),et(Kee,Kee.level===9?2:2<=Kee.strategy||Kee.level<2?4:0),et(Kee,3),Kee.status=ce);else{var dee=M+(Kee.w_bits-8<<4)<<8;dee|=(2<=Kee.strategy||Kee.level<2?0:Kee.level<6?1:Kee.level===6?2:3)<<6,Kee.strstart!==0&&(dee|=32),dee+=31-dee%31,Kee.status=ce,ft(Kee,dee),Kee.strstart!==0&&(ft(Kee,st.adler>>>16),ft(Kee,65535&st.adler)),st.adler=1}if(Kee.status===69)if(Kee.gzhead.extra){for(Iee=Kee.pending;Kee.gzindex<(65535&Kee.gzhead.extra.length)&&(Kee.pending!==Kee.pending_buf_size||(Kee.gzhead.hcrc&&Kee.pending>Iee&&(st.adler=g(st.adler,Kee.pending_buf,Kee.pending-Iee,Iee)),jr(st),Iee=Kee.pending,Kee.pending!==Kee.pending_buf_size));)et(Kee,255&Kee.gzhead.extra[Kee.gzindex]),Kee.gzindex++;Kee.gzhead.hcrc&&Kee.pending>Iee&&(st.adler=g(st.adler,Kee.pending_buf,Kee.pending-Iee,Iee)),Kee.gzindex===Kee.gzhead.extra.length&&(Kee.gzindex=0,Kee.status=73)}else Kee.status=73;if(Kee.status===73)if(Kee.gzhead.name){Iee=Kee.pending;do{if(Kee.pending===Kee.pending_buf_size&&(Kee.gzhead.hcrc&&Kee.pending>Iee&&(st.adler=g(st.adler,Kee.pending_buf,Kee.pending-Iee,Iee)),jr(st),Iee=Kee.pending,Kee.pending===Kee.pending_buf_size)){Rte=1;break}Rte=Kee.gzindexIee&&(st.adler=g(st.adler,Kee.pending_buf,Kee.pending-Iee,Iee)),Rte===0&&(Kee.gzindex=0,Kee.status=91)}else Kee.status=91;if(Kee.status===91)if(Kee.gzhead.comment){Iee=Kee.pending;do{if(Kee.pending===Kee.pending_buf_size&&(Kee.gzhead.hcrc&&Kee.pending>Iee&&(st.adler=g(st.adler,Kee.pending_buf,Kee.pending-Iee,Iee)),jr(st),Iee=Kee.pending,Kee.pending===Kee.pending_buf_size)){Rte=1;break}Rte=Kee.gzindexIee&&(st.adler=g(st.adler,Kee.pending_buf,Kee.pending-Iee,Iee)),Rte===0&&(Kee.status=103)}else Kee.status=103;if(Kee.status===103&&(Kee.gzhead.hcrc?(Kee.pending+2>Kee.pending_buf_size&&jr(st),Kee.pending+2<=Kee.pending_buf_size&&(et(Kee,255&st.adler),et(Kee,st.adler>>8&255),st.adler=0,Kee.status=ce)):Kee.status=ce),Kee.pending!==0){if(jr(st),st.avail_out===0)return Kee.last_flush=-1,w}else if(st.avail_in===0&&Dee(Lee)<=Dee($te)&&Lee!==E)return St(st,-5);if(Kee.status===666&&st.avail_in!==0)return St(st,-5);if(st.avail_in!==0||Kee.lookahead!==0||Lee!==_&&Kee.status!==666){var fee=Kee.strategy===2?function(Oee,xee){for(var kee;;){if(Oee.lookahead===0&&(ete(Oee),Oee.lookahead===0)){if(xee===_)return Y;break}if(Oee.match_length=0,kee=d._tr_tally(Oee,0,Oee.window[Oee.strstart]),Oee.lookahead--,Oee.strstart++,kee&&(Tee(Oee,!1),Oee.strm.avail_out===0))return Y}return Oee.insert=0,xee===E?(Tee(Oee,!0),Oee.strm.avail_out===0?V:Ge):Oee.last_lit&&(Tee(Oee,!1),Oee.strm.avail_out===0)?Y:B}(Kee,Lee):Kee.strategy===3?function(Oee,xee){for(var kee,Dte,Ite,Lte,Vte=Oee.window;;){if(Oee.lookahead<=J){if(ete(Oee),Oee.lookahead<=J&&xee===_)return Y;if(Oee.lookahead===0)break}if(Oee.match_length=0,Oee.lookahead>=U&&0Oee.lookahead&&(Oee.match_length=Oee.lookahead)}if(Oee.match_length>=U?(kee=d._tr_tally(Oee,1,Oee.match_length-U),Oee.lookahead-=Oee.match_length,Oee.strstart+=Oee.match_length,Oee.match_length=0):(kee=d._tr_tally(Oee,0,Oee.window[Oee.strstart]),Oee.lookahead--,Oee.strstart++),kee&&(Tee(Oee,!1),Oee.strm.avail_out===0))return Y}return Oee.insert=0,xee===E?(Tee(Oee,!0),Oee.strm.avail_out===0?V:Ge):Oee.last_lit&&(Tee(Oee,!1),Oee.strm.avail_out===0)?Y:B}(Kee,Lee):c[Kee.level].func(Kee,Lee);if(fee!==V&&fee!==Ge||(Kee.status=666),fee===Y||fee===V)return st.avail_out===0&&(Kee.last_flush=-1),w;if(fee===B&&(Lee===1?d._tr_align(Kee):Lee!==5&&(d._tr_stored_block(Kee,0,0,!1),Lee===3&&(pee(Kee.head),Kee.lookahead===0&&(Kee.strstart=0,Kee.block_start=0,Kee.insert=0))),jr(st),st.avail_out===0))return Kee.last_flush=-1,w}return Lee!==E?w:Kee.wrap<=0?1:(Kee.wrap===2?(et(Kee,255&st.adler),et(Kee,st.adler>>8&255),et(Kee,st.adler>>16&255),et(Kee,st.adler>>24&255),et(Kee,255&st.total_in),et(Kee,st.total_in>>8&255),et(Kee,st.total_in>>16&255),et(Kee,st.total_in>>24&255)):(ft(Kee,st.adler>>>16),ft(Kee,65535&st.adler)),jr(st),0=$te.w_size&&(Rte===0&&(pee($te.head),$te.strstart=0,$te.block_start=0,$te.insert=0),xee=new u.Buf8($te.w_size),u.arraySet(xee,Lee,kee-$te.w_size,$te.w_size,0),Lee=xee,kee=$te.w_size),dee=st.avail_in,fee=st.next_in,Oee=st.input,st.avail_in=kee,st.next_in=0,st.input=Lee,ete($te);$te.lookahead>=U;){for(Kee=$te.strstart,Iee=$te.lookahead-(U-1);$te.ins_h=($te.ins_h<<$te.hash_shift^$te.window[Kee+U-1])&$te.hash_mask,$te.prev[Kee&$te.w_mask]=$te.head[$te.ins_h],$te.head[$te.ins_h]=Kee,Kee++,--Iee;);$te.strstart=Kee,$te.lookahead=U-1,ete($te)}return $te.strstart+=$te.lookahead,$te.block_start=$te.strstart,$te.insert=$te.lookahead,$te.lookahead=0,$te.match_length=$te.prev_length=U-1,$te.match_available=0,st.next_in=fee,st.input=Oee,st.avail_in=dee,$te.wrap=Rte,w},l.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(s,a,l){a.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(s,a,l){a.exports=function(c,u){var d,m,g,y,_,E,w,T,k,O,R,M,N,D,P,I,L,F,U,J,z,ie,ce,Y,B;d=c.state,m=c.next_in,Y=c.input,g=m+(c.avail_in-5),y=c.next_out,B=c.output,_=y-(u-c.avail_out),E=y+(c.avail_out-257),w=d.dmax,T=d.wsize,k=d.whave,O=d.wnext,R=d.window,M=d.hold,N=d.bits,D=d.lencode,P=d.distcode,I=(1<>>=U=F>>>24,N-=U,(U=F>>>16&255)===0)B[y++]=65535&F;else{if(!(16&U)){if(!(64&U)){F=D[(65535&F)+(M&(1<>>=U,N-=U),N<15&&(M+=Y[m++]<>>=U=F>>>24,N-=U,!(16&(U=F>>>16&255))){if(!(64&U)){F=P[(65535&F)+(M&(1<>>=U,N-=U,(U=y-_)>3,M&=(1<<(N-=J<<3))-1,c.next_in=m,c.next_out=y,c.avail_in=m>>24&255)+(ie>>>8&65280)+((65280&ie)<<8)+((255&ie)<<24)}function M(){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 c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function N(ie){var ce;return ie&&ie.state?(ce=ie.state,ie.total_in=ie.total_out=ce.total=0,ie.msg="",ce.wrap&&(ie.adler=1&ce.wrap),ce.mode=T,ce.last=0,ce.havedict=0,ce.dmax=32768,ce.head=null,ce.hold=0,ce.bits=0,ce.lencode=ce.lendyn=new c.Buf32(k),ce.distcode=ce.distdyn=new c.Buf32(O),ce.sane=1,ce.back=-1,E):w}function D(ie){var ce;return ie&&ie.state?((ce=ie.state).wsize=0,ce.whave=0,ce.wnext=0,N(ie)):w}function P(ie,ce){var Y,B;return ie&&ie.state?(B=ie.state,ce<0?(Y=0,ce=-ce):(Y=1+(ce>>4),ce<48&&(ce&=15)),ce&&(ce<8||15=Ge.wsize?(c.arraySet(Ge.window,ce,Y-Ge.wsize,Ge.wsize,0),Ge.wnext=0,Ge.whave=Ge.wsize):(B<(V=Ge.wsize-Ge.wnext)&&(V=B),c.arraySet(Ge.window,ce,Y-B,V,Ge.wnext),(B-=V)?(c.arraySet(Ge.window,ce,Y-B,B,0),Ge.wnext=B,Ge.whave=Ge.wsize):(Ge.wnext+=V,Ge.wnext===Ge.wsize&&(Ge.wnext=0),Ge.whave>>8&255,Y.check=d(Y.check,Rte,2,0),Tee=jr=0,Y.mode=2;break}if(Y.flags=0,Y.head&&(Y.head.done=!1),!(1&Y.wrap)||(((255&jr)<<8)+(jr>>8))%31){ie.msg="incorrect header check",Y.mode=30;break}if((15&jr)!=8){ie.msg="unknown compression method",Y.mode=30;break}if(Tee-=4,st=8+(15&(jr>>>=4)),Y.wbits===0)Y.wbits=st;else if(st>Y.wbits){ie.msg="invalid window size",Y.mode=30;break}Y.dmax=1<>8&1),512&Y.flags&&(Rte[0]=255&jr,Rte[1]=jr>>>8&255,Y.check=d(Y.check,Rte,2,0)),Tee=jr=0,Y.mode=3;case 3:for(;Tee<32;){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>>8&255,Rte[2]=jr>>>16&255,Rte[3]=jr>>>24&255,Y.check=d(Y.check,Rte,4,0)),Tee=jr=0,Y.mode=4;case 4:for(;Tee<16;){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>8),512&Y.flags&&(Rte[0]=255&jr,Rte[1]=jr>>>8&255,Y.check=d(Y.check,Rte,2,0)),Tee=jr=0,Y.mode=5;case 5:if(1024&Y.flags){for(;Tee<16;){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>>8&255,Y.check=d(Y.check,Rte,2,0)),Tee=jr=0}else Y.head&&(Y.head.extra=null);Y.mode=6;case 6:if(1024&Y.flags&&(Dee<(yee=Y.length)&&(yee=Dee),yee&&(Y.head&&(st=Y.head.extra_len-Y.length,Y.head.extra||(Y.head.extra=new Array(Y.head.extra_len)),c.arraySet(Y.head.extra,B,Ge,yee,st)),512&Y.flags&&(Y.check=d(Y.check,B,yee,Ge)),Dee-=yee,Ge+=yee,Y.length-=yee),Y.length))break e;Y.length=0,Y.mode=7;case 7:if(2048&Y.flags){if(Dee===0)break e;for(yee=0;st=B[Ge+yee++],Y.head&&st&&Y.length<65536&&(Y.head.name+=String.fromCharCode(st)),st&&yee>9&1,Y.head.done=!0),ie.adler=Y.check=0,Y.mode=12;break;case 10:for(;Tee<32;){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>>=7&Tee,Tee-=7&Tee,Y.mode=27;break}for(;Tee<3;){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>>=1)){case 0:Y.mode=14;break;case 1:if(J(Y),Y.mode=20,ce!==6)break;jr>>>=2,Tee-=2;break e;case 2:Y.mode=17;break;case 3:ie.msg="invalid block type",Y.mode=30}jr>>>=2,Tee-=2;break;case 14:for(jr>>>=7&Tee,Tee-=7&Tee;Tee<32;){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>>16^65535)){ie.msg="invalid stored block lengths",Y.mode=30;break}if(Y.length=65535&jr,Tee=jr=0,Y.mode=15,ce===6)break e;case 15:Y.mode=16;case 16:if(yee=Y.length){if(Dee>>=5,Tee-=5,Y.ndist=1+(31&jr),jr>>>=5,Tee-=5,Y.ncode=4+(15&jr),jr>>>=4,Tee-=4,286>>=3,Tee-=3}for(;Y.have<19;)Y.lens[dee[Y.have++]]=0;if(Y.lencode=Y.lendyn,Y.lenbits=7,$te={bits:Y.lenbits},Lee=g(0,Y.lens,0,19,Y.lencode,0,Y.work,$te),Y.lenbits=$te.bits,Lee){ie.msg="invalid code lengths set",Y.mode=30;break}Y.have=0,Y.mode=19;case 19:for(;Y.have>>16&255,Wee=65535&Iee,!((Ote=Iee>>>24)<=Tee);){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>>=Ote,Tee-=Ote,Y.lens[Y.have++]=Wee;else{if(Wee===16){for(Kee=Ote+2;Tee>>=Ote,Tee-=Ote,Y.have===0){ie.msg="invalid bit length repeat",Y.mode=30;break}st=Y.lens[Y.have-1],yee=3+(3&jr),jr>>>=2,Tee-=2}else if(Wee===17){for(Kee=Ote+3;Tee>>=Ote)),jr>>>=3,Tee-=3}else{for(Kee=Ote+7;Tee>>=Ote)),jr>>>=7,Tee-=7}if(Y.have+yee>Y.nlen+Y.ndist){ie.msg="invalid bit length repeat",Y.mode=30;break}for(;yee--;)Y.lens[Y.have++]=st}}if(Y.mode===30)break;if(Y.lens[256]===0){ie.msg="invalid code -- missing end-of-block",Y.mode=30;break}if(Y.lenbits=9,$te={bits:Y.lenbits},Lee=g(y,Y.lens,0,Y.nlen,Y.lencode,0,Y.work,$te),Y.lenbits=$te.bits,Lee){ie.msg="invalid literal/lengths set",Y.mode=30;break}if(Y.distbits=6,Y.distcode=Y.distdyn,$te={bits:Y.distbits},Lee=g(_,Y.lens,Y.nlen,Y.ndist,Y.distcode,0,Y.work,$te),Y.distbits=$te.bits,Lee){ie.msg="invalid distances set",Y.mode=30;break}if(Y.mode=20,ce===6)break e;case 20:Y.mode=21;case 21:if(6<=Dee&&258<=pee){ie.next_out=St,ie.avail_out=pee,ie.next_in=Ge,ie.avail_in=Dee,Y.hold=jr,Y.bits=Tee,m(ie,ft),St=ie.next_out,V=ie.output,pee=ie.avail_out,Ge=ie.next_in,B=ie.input,Dee=ie.avail_in,jr=Y.hold,Tee=Y.bits,Y.mode===12&&(Y.back=-1);break}for(Y.back=0;nee=(Iee=Y.lencode[jr&(1<>>16&255,Wee=65535&Iee,!((Ote=Iee>>>24)<=Tee);){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>Bee)])>>>16&255,Wee=65535&Iee,!(Bee+(Ote=Iee>>>24)<=Tee);){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>>=Bee,Tee-=Bee,Y.back+=Bee}if(jr>>>=Ote,Tee-=Ote,Y.back+=Ote,Y.length=Wee,nee===0){Y.mode=26;break}if(32&nee){Y.back=-1,Y.mode=12;break}if(64&nee){ie.msg="invalid literal/length code",Y.mode=30;break}Y.extra=15&nee,Y.mode=22;case 22:if(Y.extra){for(Kee=Y.extra;Tee>>=Y.extra,Tee-=Y.extra,Y.back+=Y.extra}Y.was=Y.length,Y.mode=23;case 23:for(;nee=(Iee=Y.distcode[jr&(1<>>16&255,Wee=65535&Iee,!((Ote=Iee>>>24)<=Tee);){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>Bee)])>>>16&255,Wee=65535&Iee,!(Bee+(Ote=Iee>>>24)<=Tee);){if(Dee===0)break e;Dee--,jr+=B[Ge++]<>>=Bee,Tee-=Bee,Y.back+=Bee}if(jr>>>=Ote,Tee-=Ote,Y.back+=Ote,64&nee){ie.msg="invalid distance code",Y.mode=30;break}Y.offset=Wee,Y.extra=15&nee,Y.mode=24;case 24:if(Y.extra){for(Kee=Y.extra;Tee>>=Y.extra,Tee-=Y.extra,Y.back+=Y.extra}if(Y.offset>Y.dmax){ie.msg="invalid distance too far back",Y.mode=30;break}Y.mode=25;case 25:if(pee===0)break e;if(yee=ft-pee,Y.offset>yee){if((yee=Y.offset-yee)>Y.whave&&Y.sane){ie.msg="invalid distance too far back",Y.mode=30;break}ete=yee>Y.wnext?(yee-=Y.wnext,Y.wsize-yee):Y.wnext-yee,yee>Y.length&&(yee=Y.length),xte=Y.window}else xte=V,ete=St-Y.offset,yee=Y.length;for(peeL?(U=ete[xte+O[ce]],Tee[et+O[ce]]):(U=96,0),M=1<>St)+(N-=M)]=F<<24|U<<16|J|0,N!==0;);for(M=1<>=1;if(M!==0?(jr&=M-1,jr+=M):jr=0,ce++,--ft[ie]==0){if(ie===B)break;ie=_[E+O[ce]]}if(V>>7)]}function et(Iee,Rte){Iee.pending_buf[Iee.pending++]=255&Rte,Iee.pending_buf[Iee.pending++]=Rte>>>8&255}function ft(Iee,Rte,dee){Iee.bi_valid>R-dee?(Iee.bi_buf|=Rte<>R-Iee.bi_valid,Iee.bi_valid+=dee-R):(Iee.bi_buf|=Rte<>>=1,dee<<=1,0<--Rte;);return dee>>>1}function xte(Iee,Rte,dee){var fee,Oee,xee=new Array(O+1),kee=0;for(fee=1;fee<=O;fee++)xee[fee]=kee=kee+dee[fee-1]<<1;for(Oee=0;Oee<=Rte;Oee++){var Dte=Iee[2*Oee+1];Dte!==0&&(Iee[2*Oee]=ete(xee[Dte]++,Dte))}}function Ote(Iee){var Rte;for(Rte=0;Rte>1;1<=dee;dee--)Bee(Iee,xee,dee);for(Oee=Ite;dee=Iee.heap[1],Iee.heap[1]=Iee.heap[Iee.heap_len--],Bee(Iee,xee,1),fee=Iee.heap[1],Iee.heap[--Iee.heap_max]=dee,Iee.heap[--Iee.heap_max]=fee,xee[2*Oee]=xee[2*dee]+xee[2*fee],Iee.depth[Oee]=(Iee.depth[dee]>=Iee.depth[fee]?Iee.depth[dee]:Iee.depth[fee])+1,xee[2*dee+1]=xee[2*fee+1]=Oee,Iee.heap[1]=Oee++,Bee(Iee,xee,1),2<=Iee.heap_len;);Iee.heap[--Iee.heap_max]=Iee.heap[1],function(Vte,Pte){var Fte,Ute,Gte,jte,Bte,Hte,zte=Pte.dyn_tree,qte=Pte.max_code,Wte=Pte.stat_desc.static_tree,Zte=Pte.stat_desc.has_stree,Qte=Pte.stat_desc.extra_bits,rne=Pte.stat_desc.extra_base,cne=Pte.stat_desc.max_length,une=0;for(jte=0;jte<=O;jte++)Vte.bl_count[jte]=0;for(zte[2*Vte.heap[Vte.heap_max]+1]=0,Fte=Vte.heap_max+1;Fte>=7;Oee>>=1)if(1&Lte&&Dte.dyn_ltree[2*Ite]!==0)return u;if(Dte.dyn_ltree[18]!==0||Dte.dyn_ltree[20]!==0||Dte.dyn_ltree[26]!==0)return d;for(Ite=32;Ite<_;Ite++)if(Dte.dyn_ltree[2*Ite]!==0)return d;return u}(Iee)),_ee(Iee,Iee.l_desc),_ee(Iee,Iee.d_desc),kee=function(Dte){var Ite;for(st(Dte,Dte.dyn_ltree,Dte.l_desc.max_code),st(Dte,Dte.dyn_dtree,Dte.d_desc.max_code),_ee(Dte,Dte.bl_desc),Ite=T-1;3<=Ite&&Dte.bl_tree[2*J[Ite]+1]===0;Ite--);return Dte.opt_len+=3*(Ite+1)+5+5+4,Ite}(Iee),Oee=Iee.opt_len+3+7>>>3,(xee=Iee.static_len+3+7>>>3)<=Oee&&(Oee=xee)):Oee=xee=dee+5,dee+4<=Oee&&Rte!==-1?Kee(Iee,Rte,dee,fee):Iee.strategy===4||xee===Oee?(ft(Iee,2+(fee?1:0),3),Nte(Iee,z,ie)):(ft(Iee,4+(fee?1:0),3),function(Dte,Ite,Lte,Vte){var Pte;for(ft(Dte,Ite-257,5),ft(Dte,Lte-1,5),ft(Dte,Vte-4,4),Pte=0;Pte>>8&255,Iee.pending_buf[Iee.d_buf+2*Iee.last_lit+1]=255&Rte,Iee.pending_buf[Iee.l_buf+Iee.last_lit]=255&dee,Iee.last_lit++,Rte===0?Iee.dyn_ltree[2*dee]++:(Iee.matches++,Rte--,Iee.dyn_ltree[2*(Y[dee]+_+1)]++,Iee.dyn_dtree[2*Tee(Rte)]++),Iee.last_lit===Iee.lit_bufsize-1},l._tr_align=function(Iee){ft(Iee,2,3),yee(Iee,N,z),function(Rte){Rte.bi_valid===16?(et(Rte,Rte.bi_buf),Rte.bi_buf=0,Rte.bi_valid=0):8<=Rte.bi_valid&&(Rte.pending_buf[Rte.pending++]=255&Rte.bi_buf,Rte.bi_buf>>=8,Rte.bi_valid-=8)}(Iee)}},{"../utils/common":41}],53:[function(s,a,l){a.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(s,a,l){(function(c){(function(u,d){if(!u.setImmediate){var m,g,y,_,E=1,w={},T=!1,k=u.document,O=Object.getPrototypeOf&&Object.getPrototypeOf(u);O=O&&O.setTimeout?O:u,m={}.toString.call(u.process)==="[object process]"?function(D){process.nextTick(function(){M(D)})}:function(){if(u.postMessage&&!u.importScripts){var D=!0,P=u.onmessage;return u.onmessage=function(){D=!1},u.postMessage("","*"),u.onmessage=P,D}}()?(_="setImmediate$"+Math.random()+"$",u.addEventListener?u.addEventListener("message",N,!1):u.attachEvent("onmessage",N),function(D){u.postMessage(_+D,"*")}):u.MessageChannel?((y=new MessageChannel).port1.onmessage=function(D){M(D.data)},function(D){y.port2.postMessage(D)}):k&&"onreadystatechange"in k.createElement("script")?(g=k.documentElement,function(D){var P=k.createElement("script");P.onreadystatechange=function(){M(D),P.onreadystatechange=null,g.removeChild(P),P=null},g.appendChild(P)}):function(D){setTimeout(M,0,D)},O.setImmediate=function(D){typeof D!="function"&&(D=new Function(""+D));for(var P=new Array(arguments.length-1),I=0;I"u"?c===void 0?this:c:self)}).call(this,typeof commonjsGlobal$1<"u"?commonjsGlobal$1:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jszip_min);var jszip_minExports=jszip_min.exports;const JSZip=getDefaultExportFromCjs(jszip_minExports);function bind$3(r,o){return function(){return r.apply(o,arguments)}}const{toString:toString$3}=Object.prototype,{getPrototypeOf}=Object,kindOf$1=(r=>o=>{const s=toString$3.call(o);return r[s]||(r[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=r=>(r=r.toLowerCase(),o=>kindOf$1(o)===r),typeOfTest=r=>o=>typeof o===r,{isArray:isArray$8}=Array,isUndefined=typeOfTest("undefined");function isBuffer$2(r){return r!==null&&!isUndefined(r)&&r.constructor!==null&&!isUndefined(r.constructor)&&isFunction$2(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(r){let o;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?o=ArrayBuffer.isView(r):o=r&&r.buffer&&isArrayBuffer(r.buffer),o}const isString$4=typeOfTest("string"),isFunction$2=typeOfTest("function"),isNumber$2=typeOfTest("number"),isObject$5=r=>r!==null&&typeof r=="object",isBoolean$2=r=>r===!0||r===!1,isPlainObject$3=r=>{if(kindOf$1(r)!=="object")return!1;const o=getPrototypeOf(r);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},isDate$3=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=r=>isObject$5(r)&&isFunction$2(r.pipe),isFormData=r=>{let o;return r&&(typeof FormData=="function"&&r instanceof FormData||isFunction$2(r.append)&&((o=kindOf$1(r))==="formdata"||o==="object"&&isFunction$2(r.toString)&&r.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim$1=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(r,o,{allOwnKeys:s=!1}={}){if(r===null||typeof r>"u")return;let a,l;if(typeof r!="object"&&(r=[r]),isArray$8(r))for(a=0,l=r.length;a0;)if(l=s[a],o===l.toLowerCase())return l;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=r=>!isUndefined(r)&&r!==_global;function merge$2(){const{caseless:r}=isContextDefined(this)&&this||{},o={},s=(a,l)=>{const c=r&&findKey(o,l)||l;isPlainObject$3(o[c])&&isPlainObject$3(a)?o[c]=merge$2(o[c],a):isPlainObject$3(a)?o[c]=merge$2({},a):isArray$8(a)?o[c]=a.slice():o[c]=a};for(let a=0,l=arguments.length;a(forEach(o,(l,c)=>{s&&isFunction$2(l)?r[c]=bind$3(l,s):r[c]=l},{allOwnKeys:a}),r),stripBOM=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),inherits=(r,o,s,a)=>{r.prototype=Object.create(o.prototype,a),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:o.prototype}),s&&Object.assign(r.prototype,s)},toFlatObject=(r,o,s,a)=>{let l,c,u;const d={};if(o=o||{},r==null)return o;do{for(l=Object.getOwnPropertyNames(r),c=l.length;c-- >0;)u=l[c],(!a||a(u,r,o))&&!d[u]&&(o[u]=r[u],d[u]=!0);r=s!==!1&&getPrototypeOf(r)}while(r&&(!s||s(r,o))&&r!==Object.prototype);return o},endsWith=(r,o,s)=>{r=String(r),(s===void 0||s>r.length)&&(s=r.length),s-=o.length;const a=r.indexOf(o,s);return a!==-1&&a===s},toArray=r=>{if(!r)return null;if(isArray$8(r))return r;let o=r.length;if(!isNumber$2(o))return null;const s=new Array(o);for(;o-- >0;)s[o]=r[o];return s},isTypedArray=(r=>o=>r&&o instanceof r)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(r,o)=>{const a=(r&&r[Symbol.iterator]).call(r);let l;for(;(l=a.next())&&!l.done;){const c=l.value;o.call(r,c[0],c[1])}},matchAll=(r,o)=>{let s;const a=[];for(;(s=r.exec(o))!==null;)a.push(s);return a},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,a,l){return a.toUpperCase()+l}),hasOwnProperty$2=(({hasOwnProperty:r})=>(o,s)=>r.call(o,s))(Object.prototype),isRegExp$4=kindOfTest("RegExp"),reduceDescriptors=(r,o)=>{const s=Object.getOwnPropertyDescriptors(r),a={};forEach(s,(l,c)=>{let u;(u=o(l,c,r))!==!1&&(a[c]=u||l)}),Object.defineProperties(r,a)},freezeMethods=r=>{reduceDescriptors(r,(o,s)=>{if(isFunction$2(r)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const a=r[s];if(isFunction$2(a)){if(o.enumerable=!1,"writable"in o){o.writable=!1;return}o.set||(o.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},toObjectSet=(r,o)=>{const s={},a=l=>{l.forEach(c=>{s[c]=!0})};return isArray$8(r)?a(r):a(String(r).split(o)),s},noop$3=()=>{},toFiniteNumber=(r,o)=>r!=null&&Number.isFinite(r=+r)?r:o,ALPHA$2="abcdefghijklmnopqrstuvwxyz",DIGIT$2="0123456789",ALPHABET={DIGIT:DIGIT$2,ALPHA:ALPHA$2,ALPHA_DIGIT:ALPHA$2+ALPHA$2.toUpperCase()+DIGIT$2},generateString=(r=16,o=ALPHABET.ALPHA_DIGIT)=>{let s="";const{length:a}=o;for(;r--;)s+=o[Math.random()*a|0];return s};function isSpecCompliantForm(r){return!!(r&&isFunction$2(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const toJSONObject=r=>{const o=new Array(10),s=(a,l)=>{if(isObject$5(a)){if(o.indexOf(a)>=0)return;if(!("toJSON"in a)){o[l]=a;const c=isArray$8(a)?[]:{};return forEach(a,(u,d)=>{const m=s(u,l+1);!isUndefined(m)&&(c[d]=m)}),o[l]=void 0,c}}return a};return s(r,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=r=>r&&(isObject$5(r)||isFunction$2(r))&&isFunction$2(r.then)&&isFunction$2(r.catch),_setImmediate=((r,o)=>r?setImmediate:o?((s,a)=>(_global.addEventListener("message",({source:l,data:c})=>{l===_global&&c===s&&a.length&&a.shift()()},!1),l=>{a.push(l),_global.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",isFunction$2(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,utils$6={isArray:isArray$8,isArrayBuffer,isBuffer:isBuffer$2,isFormData,isArrayBufferView,isString:isString$4,isNumber:isNumber$2,isBoolean:isBoolean$2,isObject:isObject$5,isPlainObject:isPlainObject$3,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate:isDate$3,isFile,isBlob,isRegExp:isRegExp$4,isFunction:isFunction$2,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge:merge$2,extend:extend$1,trim:trim$1,stripBOM,inherits,toFlatObject,kindOf:kindOf$1,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$2,hasOwnProp:hasOwnProperty$2,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$3,toFiniteNumber,findKey,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap};function AxiosError(r,o,s,a,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",o&&(this.code=o),s&&(this.config=s),a&&(this.request=a),l&&(this.response=l,this.status=l.status?l.status:null)}utils$6.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$6.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError.prototype,descriptors$1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{descriptors$1[r]={value:r}});Object.defineProperties(AxiosError,descriptors$1);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(r,o,s,a,l,c)=>{const u=Object.create(prototype$1);return utils$6.toFlatObject(r,u,function(m){return m!==Error.prototype},d=>d!=="isAxiosError"),AxiosError.call(u,r.message,o,s,a,l),u.cause=r,u.name=r.name,c&&Object.assign(u,c),u};const httpAdapter=null;function isVisitable(r){return utils$6.isPlainObject(r)||utils$6.isArray(r)}function removeBrackets(r){return utils$6.endsWith(r,"[]")?r.slice(0,-2):r}function renderKey(r,o,s){return r?r.concat(o).map(function(l,c){return l=removeBrackets(l),!s&&c?"["+l+"]":l}).join(s?".":""):o}function isFlatArray(r){return utils$6.isArray(r)&&!r.some(isVisitable)}const predicates=utils$6.toFlatObject(utils$6,{},null,function(o){return/^is[A-Z]/.test(o)});function toFormData(r,o,s){if(!utils$6.isObject(r))throw new TypeError("target must be an object");o=o||new FormData,s=utils$6.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,O){return!utils$6.isUndefined(O[k])});const a=s.metaTokens,l=s.visitor||y,c=s.dots,u=s.indexes,m=(s.Blob||typeof Blob<"u"&&Blob)&&utils$6.isSpecCompliantForm(o);if(!utils$6.isFunction(l))throw new TypeError("visitor must be a function");function g(T){if(T===null)return"";if(utils$6.isDate(T))return T.toISOString();if(!m&&utils$6.isBlob(T))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$6.isArrayBuffer(T)||utils$6.isTypedArray(T)?m&&typeof Blob=="function"?new Blob([T]):Buffer.from(T):T}function y(T,k,O){let R=T;if(T&&!O&&typeof T=="object"){if(utils$6.endsWith(k,"{}"))k=a?k:k.slice(0,-2),T=JSON.stringify(T);else if(utils$6.isArray(T)&&isFlatArray(T)||(utils$6.isFileList(T)||utils$6.endsWith(k,"[]"))&&(R=utils$6.toArray(T)))return k=removeBrackets(k),R.forEach(function(N,D){!(utils$6.isUndefined(N)||N===null)&&o.append(u===!0?renderKey([k],D,c):u===null?k:k+"[]",g(N))}),!1}return isVisitable(T)?!0:(o.append(renderKey(O,k,c),g(T)),!1)}const _=[],E=Object.assign(predicates,{defaultVisitor:y,convertValue:g,isVisitable});function w(T,k){if(!utils$6.isUndefined(T)){if(_.indexOf(T)!==-1)throw Error("Circular reference detected in "+k.join("."));_.push(T),utils$6.forEach(T,function(R,M){(!(utils$6.isUndefined(R)||R===null)&&l.call(o,R,utils$6.isString(M)?M.trim():M,k,E))===!0&&w(R,k?k.concat(M):[M])}),_.pop()}}if(!utils$6.isObject(r))throw new TypeError("data must be an object");return w(r),o}function encode$5(r){const o={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(a){return o[a]})}function AxiosURLSearchParams(r,o){this._pairs=[],r&&toFormData(r,this,o)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(o,s){this._pairs.push([o,s])};prototype.toString=function(o){const s=o?function(a){return o.call(this,a,encode$5)}:encode$5;return this._pairs.map(function(l){return s(l[0])+"="+s(l[1])},"").join("&")};function encode$4(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(r,o,s){if(!o)return r;const a=s&&s.encode||encode$4,l=s&&s.serialize;let c;if(l?c=l(o,s):c=utils$6.isURLSearchParams(o)?o.toString():new AxiosURLSearchParams(o,s).toString(a),c){const u=r.indexOf("#");u!==-1&&(r=r.slice(0,u)),r+=(r.indexOf("?")===-1?"?":"&")+c}return r}class InterceptorManager{constructor(){this.handlers=[]}use(o,s,a){return this.handlers.push({fulfilled:o,rejected:s,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(o){this.handlers[o]&&(this.handlers[o]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(o){utils$6.forEach(this.handlers,function(a){a!==null&&o(a)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$2=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$2,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils$5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils$5,...platform$1};function toURLEncodedForm(r,o){return toFormData(r,new platform.classes.URLSearchParams,Object.assign({visitor:function(s,a,l,c){return platform.isNode&&utils$6.isBuffer(s)?(this.append(a,s.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)}},o))}function parsePropPath(r){return utils$6.matchAll(/\w+|\[(\w*)]/g,r).map(o=>o[0]==="[]"?"":o[1]||o[0])}function arrayToObject$1(r){const o={},s=Object.keys(r);let a;const l=s.length;let c;for(a=0;a=s.length;return u=!u&&utils$6.isArray(l)?l.length:u,m?(utils$6.hasOwnProp(l,u)?l[u]=[l[u],a]:l[u]=a,!d):((!l[u]||!utils$6.isObject(l[u]))&&(l[u]=[]),o(s,a,l[u],c)&&utils$6.isArray(l[u])&&(l[u]=arrayToObject$1(l[u])),!d)}if(utils$6.isFormData(r)&&utils$6.isFunction(r.entries)){const s={};return utils$6.forEachEntry(r,(a,l)=>{o(parsePropPath(a),l,s,0)}),s}return null}function stringifySafely(r,o,s){if(utils$6.isString(r))try{return(o||JSON.parse)(r),utils$6.trim(r)}catch(a){if(a.name!=="SyntaxError")throw a}return(s||JSON.stringify)(r)}const defaults$5={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const a=s.getContentType()||"",l=a.indexOf("application/json")>-1,c=utils$6.isObject(o);if(c&&utils$6.isHTMLForm(o)&&(o=new FormData(o)),utils$6.isFormData(o))return l?JSON.stringify(formDataToJSON(o)):o;if(utils$6.isArrayBuffer(o)||utils$6.isBuffer(o)||utils$6.isStream(o)||utils$6.isFile(o)||utils$6.isBlob(o)||utils$6.isReadableStream(o))return o;if(utils$6.isArrayBufferView(o))return o.buffer;if(utils$6.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let d;if(c){if(a.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(o,this.formSerializer).toString();if((d=utils$6.isFileList(o))||a.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return toFormData(d?{"files[]":o}:o,m&&new m,this.formSerializer)}}return c||l?(s.setContentType("application/json",!1),stringifySafely(o)):o}],transformResponse:[function(o){const s=this.transitional||defaults$5.transitional,a=s&&s.forcedJSONParsing,l=this.responseType==="json";if(utils$6.isResponse(o)||utils$6.isReadableStream(o))return o;if(o&&utils$6.isString(o)&&(a&&!this.responseType||l)){const u=!(s&&s.silentJSONParsing)&&l;try{return JSON.parse(o)}catch(d){if(u)throw d.name==="SyntaxError"?AxiosError.from(d,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):d}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$6.forEach(["delete","get","head","post","put","patch"],r=>{defaults$5.headers[r]={}});const ignoreDuplicateOf=utils$6.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=r=>{const o={};let s,a,l;return r&&r.split(` -`).forEach(function(u){l=u.indexOf(":"),s=u.substring(0,l).trim().toLowerCase(),a=u.substring(l+1).trim(),!(!s||o[s]&&ignoreDuplicateOf[s])&&(s==="set-cookie"?o[s]?o[s].push(a):o[s]=[a]:o[s]=o[s]?o[s]+", "+a:a)}),o},$internals=Symbol("internals");function normalizeHeader(r){return r&&String(r).trim().toLowerCase()}function normalizeValue(r){return r===!1||r==null?r:utils$6.isArray(r)?r.map(normalizeValue):String(r)}function parseTokens(r){const o=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=s.exec(r);)o[a[1]]=a[2];return o}const isValidHeaderName=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function matchHeaderValue(r,o,s,a,l){if(utils$6.isFunction(a))return a.call(this,o,s);if(l&&(o=s),!!utils$6.isString(o)){if(utils$6.isString(a))return o.indexOf(a)!==-1;if(utils$6.isRegExp(a))return a.test(o)}}function formatHeader(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(o,s,a)=>s.toUpperCase()+a)}function buildAccessors(r,o){const s=utils$6.toCamelCase(" "+o);["get","set","has"].forEach(a=>{Object.defineProperty(r,a+s,{value:function(l,c,u){return this[a].call(this,o,l,c,u)},configurable:!0})})}class AxiosHeaders{constructor(o){o&&this.set(o)}set(o,s,a){const l=this;function c(d,m,g){const y=normalizeHeader(m);if(!y)throw new Error("header name must be a non-empty string");const _=utils$6.findKey(l,y);(!_||l[_]===void 0||g===!0||g===void 0&&l[_]!==!1)&&(l[_||m]=normalizeValue(d))}const u=(d,m)=>utils$6.forEach(d,(g,y)=>c(g,y,m));if(utils$6.isPlainObject(o)||o instanceof this.constructor)u(o,s);else if(utils$6.isString(o)&&(o=o.trim())&&!isValidHeaderName(o))u(parseHeaders(o),s);else if(utils$6.isHeaders(o))for(const[d,m]of o.entries())c(m,d,a);else o!=null&&c(s,o,a);return this}get(o,s){if(o=normalizeHeader(o),o){const a=utils$6.findKey(this,o);if(a){const l=this[a];if(!s)return l;if(s===!0)return parseTokens(l);if(utils$6.isFunction(s))return s.call(this,l,a);if(utils$6.isRegExp(s))return s.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(o,s){if(o=normalizeHeader(o),o){const a=utils$6.findKey(this,o);return!!(a&&this[a]!==void 0&&(!s||matchHeaderValue(this,this[a],a,s)))}return!1}delete(o,s){const a=this;let l=!1;function c(u){if(u=normalizeHeader(u),u){const d=utils$6.findKey(a,u);d&&(!s||matchHeaderValue(a,a[d],d,s))&&(delete a[d],l=!0)}}return utils$6.isArray(o)?o.forEach(c):c(o),l}clear(o){const s=Object.keys(this);let a=s.length,l=!1;for(;a--;){const c=s[a];(!o||matchHeaderValue(this,this[c],c,o,!0))&&(delete this[c],l=!0)}return l}normalize(o){const s=this,a={};return utils$6.forEach(this,(l,c)=>{const u=utils$6.findKey(a,c);if(u){s[u]=normalizeValue(l),delete s[c];return}const d=o?formatHeader(c):String(c).trim();d!==c&&delete s[c],s[d]=normalizeValue(l),a[d]=!0}),this}concat(...o){return this.constructor.concat(this,...o)}toJSON(o){const s=Object.create(null);return utils$6.forEach(this,(a,l)=>{a!=null&&a!==!1&&(s[l]=o&&utils$6.isArray(a)?a.join(", "):a)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([o,s])=>o+": "+s).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(o){return o instanceof this?o:new this(o)}static concat(o,...s){const a=new this(o);return s.forEach(l=>a.set(l)),a}static accessor(o){const a=(this[$internals]=this[$internals]={accessors:{}}).accessors,l=this.prototype;function c(u){const d=normalizeHeader(u);a[d]||(buildAccessors(l,u),a[d]=!0)}return utils$6.isArray(o)?o.forEach(c):c(o),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$6.reduceDescriptors(AxiosHeaders.prototype,({value:r},o)=>{let s=o[0].toUpperCase()+o.slice(1);return{get:()=>r,set(a){this[s]=a}}});utils$6.freezeMethods(AxiosHeaders);function transformData(r,o){const s=this||defaults$5,a=o||s,l=AxiosHeaders.from(a.headers);let c=a.data;return utils$6.forEach(r,function(d){c=d.call(s,c,l.normalize(),o?o.status:void 0)}),l.normalize(),c}function isCancel(r){return!!(r&&r.__CANCEL__)}function CanceledError(r,o,s){AxiosError.call(this,r??"canceled",AxiosError.ERR_CANCELED,o,s),this.name="CanceledError"}utils$6.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(r,o,s){const a=s.config.validateStatus;!s.status||!a||a(s.status)?r(s):o(new AxiosError("Request failed with status code "+s.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function parseProtocol(r){const o=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return o&&o[1]||""}function speedometer(r,o){r=r||10;const s=new Array(r),a=new Array(r);let l=0,c=0,u;return o=o!==void 0?o:1e3,function(m){const g=Date.now(),y=a[c];u||(u=g),s[l]=m,a[l]=g;let _=c,E=0;for(;_!==l;)E+=s[_++],_=_%r;if(l=(l+1)%r,l===c&&(c=(c+1)%r),g-u{s=y,l=null,c&&(clearTimeout(c),c=null),r.apply(null,g)};return[(...g)=>{const y=Date.now(),_=y-s;_>=a?u(g,y):(l=g,c||(c=setTimeout(()=>{c=null,u(l)},a-_)))},()=>l&&u(l)]}const progressEventReducer=(r,o,s=3)=>{let a=0;const l=speedometer(50,250);return throttle$1(c=>{const u=c.loaded,d=c.lengthComputable?c.total:void 0,m=u-a,g=l(m),y=u<=d;a=u;const _={loaded:u,total:d,progress:d?u/d:void 0,bytes:m,rate:g||void 0,estimated:g&&d&&y?(d-u)/g:void 0,event:c,lengthComputable:d!=null,[o?"download":"upload"]:!0};r(_)},s)},progressEventDecorator=(r,o)=>{const s=r!=null;return[a=>o[0]({lengthComputable:s,total:r,loaded:a}),o[1]]},asyncDecorator=r=>(...o)=>utils$6.asap(()=>r(...o)),isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const o=platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent),s=document.createElement("a");let a;function l(c){let u=c;return o&&(s.setAttribute("href",u),u=s.href),s.setAttribute("href",u),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return a=l(window.location.href),function(u){const d=utils$6.isString(u)?l(u):u;return d.protocol===a.protocol&&d.host===a.host}}():function(){return function(){return!0}}(),cookies=platform.hasStandardBrowserEnv?{write(r,o,s,a,l,c){const u=[r+"="+encodeURIComponent(o)];utils$6.isNumber(s)&&u.push("expires="+new Date(s).toGMTString()),utils$6.isString(a)&&u.push("path="+a),utils$6.isString(l)&&u.push("domain="+l),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read(r){const o=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function combineURLs(r,o){return o?r.replace(/\/?\/$/,"")+"/"+o.replace(/^\/+/,""):r}function buildFullPath(r,o){return r&&!isAbsoluteURL(o)?combineURLs(r,o):o}const headersToObject=r=>r instanceof AxiosHeaders?{...r}:r;function mergeConfig(r,o){o=o||{};const s={};function a(g,y,_){return utils$6.isPlainObject(g)&&utils$6.isPlainObject(y)?utils$6.merge.call({caseless:_},g,y):utils$6.isPlainObject(y)?utils$6.merge({},y):utils$6.isArray(y)?y.slice():y}function l(g,y,_){if(utils$6.isUndefined(y)){if(!utils$6.isUndefined(g))return a(void 0,g,_)}else return a(g,y,_)}function c(g,y){if(!utils$6.isUndefined(y))return a(void 0,y)}function u(g,y){if(utils$6.isUndefined(y)){if(!utils$6.isUndefined(g))return a(void 0,g)}else return a(void 0,y)}function d(g,y,_){if(_ in o)return a(g,y);if(_ in r)return a(void 0,g)}const m={url:c,method:c,data:c,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:d,headers:(g,y)=>l(headersToObject(g),headersToObject(y),!0)};return utils$6.forEach(Object.keys(Object.assign({},r,o)),function(y){const _=m[y]||l,E=_(r[y],o[y],y);utils$6.isUndefined(E)&&_!==d||(s[y]=E)}),s}const resolveConfig=r=>{const o=mergeConfig({},r);let{data:s,withXSRFToken:a,xsrfHeaderName:l,xsrfCookieName:c,headers:u,auth:d}=o;o.headers=u=AxiosHeaders.from(u),o.url=buildURL(buildFullPath(o.baseURL,o.url),r.params,r.paramsSerializer),d&&u.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let m;if(utils$6.isFormData(s)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((m=u.getContentType())!==!1){const[g,...y]=m?m.split(";").map(_=>_.trim()).filter(Boolean):[];u.setContentType([g||"multipart/form-data",...y].join("; "))}}if(platform.hasStandardBrowserEnv&&(a&&utils$6.isFunction(a)&&(a=a(o)),a||a!==!1&&isURLSameOrigin(o.url))){const g=l&&c&&cookies.read(c);g&&u.set(l,g)}return o},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(r){return new Promise(function(s,a){const l=resolveConfig(r);let c=l.data;const u=AxiosHeaders.from(l.headers).normalize();let{responseType:d,onUploadProgress:m,onDownloadProgress:g}=l,y,_,E,w,T;function k(){w&&w(),T&&T(),l.cancelToken&&l.cancelToken.unsubscribe(y),l.signal&&l.signal.removeEventListener("abort",y)}let O=new XMLHttpRequest;O.open(l.method.toUpperCase(),l.url,!0),O.timeout=l.timeout;function R(){if(!O)return;const N=AxiosHeaders.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),P={data:!d||d==="text"||d==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:N,config:r,request:O};settle(function(L){s(L),k()},function(L){a(L),k()},P),O=null}"onloadend"in O?O.onloadend=R:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(R)},O.onabort=function(){O&&(a(new AxiosError("Request aborted",AxiosError.ECONNABORTED,r,O)),O=null)},O.onerror=function(){a(new AxiosError("Network Error",AxiosError.ERR_NETWORK,r,O)),O=null},O.ontimeout=function(){let D=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const P=l.transitional||transitionalDefaults;l.timeoutErrorMessage&&(D=l.timeoutErrorMessage),a(new AxiosError(D,P.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,r,O)),O=null},c===void 0&&u.setContentType(null),"setRequestHeader"in O&&utils$6.forEach(u.toJSON(),function(D,P){O.setRequestHeader(P,D)}),utils$6.isUndefined(l.withCredentials)||(O.withCredentials=!!l.withCredentials),d&&d!=="json"&&(O.responseType=l.responseType),g&&([E,T]=progressEventReducer(g,!0),O.addEventListener("progress",E)),m&&O.upload&&([_,w]=progressEventReducer(m),O.upload.addEventListener("progress",_),O.upload.addEventListener("loadend",w)),(l.cancelToken||l.signal)&&(y=N=>{O&&(a(!N||N.type?new CanceledError(null,r,O):N),O.abort(),O=null)},l.cancelToken&&l.cancelToken.subscribe(y),l.signal&&(l.signal.aborted?y():l.signal.addEventListener("abort",y)));const M=parseProtocol(l.url);if(M&&platform.protocols.indexOf(M)===-1){a(new AxiosError("Unsupported protocol "+M+":",AxiosError.ERR_BAD_REQUEST,r));return}O.send(c||null)})},composeSignals=(r,o)=>{let s=new AbortController,a;const l=function(m){if(!a){a=!0,u();const g=m instanceof Error?m:this.reason;s.abort(g instanceof AxiosError?g:new CanceledError(g instanceof Error?g.message:g))}};let c=o&&setTimeout(()=>{l(new AxiosError(`timeout ${o} of ms exceeded`,AxiosError.ETIMEDOUT))},o);const u=()=>{r&&(c&&clearTimeout(c),c=null,r.forEach(m=>{m&&(m.removeEventListener?m.removeEventListener("abort",l):m.unsubscribe(l))}),r=null)};r.forEach(m=>m&&m.addEventListener&&m.addEventListener("abort",l));const{signal:d}=s;return d.unsubscribe=u,[d,()=>{c&&clearTimeout(c),c=null}]},streamChunk=function*(r,o){let s=r.byteLength;if(!o||s{const c=readBytes(r,o,l);let u=0,d,m=g=>{d||(d=!0,a&&a(g))};return new ReadableStream({async pull(g){try{const{done:y,value:_}=await c.next();if(y){m(),g.close();return}let E=_.byteLength;if(s){let w=u+=E;s(w)}g.enqueue(new Uint8Array(_))}catch(y){throw m(y),y}},cancel(g){return m(g),c.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(r=>o=>r.encode(o))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),test$2=(r,...o)=>{try{return!!r(...o)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test$2(()=>{let r=!1;const o=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!o}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test$2(()=>utils$6.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(r=>r.body)};isFetchSupported&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(o=>{!resolvers[o]&&(resolvers[o]=utils$6.isFunction(r[o])?s=>s[o]():(s,a)=>{throw new AxiosError(`Response type '${o}' is not supported`,AxiosError.ERR_NOT_SUPPORT,a)})})})(new Response);const getBodyLength=async r=>{if(r==null)return 0;if(utils$6.isBlob(r))return r.size;if(utils$6.isSpecCompliantForm(r))return(await new Request(r).arrayBuffer()).byteLength;if(utils$6.isArrayBufferView(r)||utils$6.isArrayBuffer(r))return r.byteLength;if(utils$6.isURLSearchParams(r)&&(r=r+""),utils$6.isString(r))return(await encodeText(r)).byteLength},resolveBodyLength=async(r,o)=>{const s=utils$6.toFiniteNumber(r.getContentLength());return s??getBodyLength(o)},fetchAdapter=isFetchSupported&&(async r=>{let{url:o,method:s,data:a,signal:l,cancelToken:c,timeout:u,onDownloadProgress:d,onUploadProgress:m,responseType:g,headers:y,withCredentials:_="same-origin",fetchOptions:E}=resolveConfig(r);g=g?(g+"").toLowerCase():"text";let[w,T]=l||c||u?composeSignals([l,c],u):[],k,O;const R=()=>{!k&&setTimeout(()=>{w&&w.unsubscribe()}),k=!0};let M;try{if(m&&supportsRequestStream&&s!=="get"&&s!=="head"&&(M=await resolveBodyLength(y,a))!==0){let L=new Request(o,{method:"POST",body:a,duplex:"half"}),F;if(utils$6.isFormData(a)&&(F=L.headers.get("content-type"))&&y.setContentType(F),L.body){const[U,J]=progressEventDecorator(M,progressEventReducer(asyncDecorator(m)));a=trackStream(L.body,DEFAULT_CHUNK_SIZE,U,J,encodeText)}}utils$6.isString(_)||(_=_?"include":"omit");const N="credentials"in Request.prototype;O=new Request(o,{...E,signal:w,method:s.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:N?_:void 0});let D=await fetch(O);const P=supportsResponseStream&&(g==="stream"||g==="response");if(supportsResponseStream&&(d||P)){const L={};["status","statusText","headers"].forEach(z=>{L[z]=D[z]});const F=utils$6.toFiniteNumber(D.headers.get("content-length")),[U,J]=d&&progressEventDecorator(F,progressEventReducer(asyncDecorator(d),!0))||[];D=new Response(trackStream(D.body,DEFAULT_CHUNK_SIZE,U,()=>{J&&J(),P&&R()},encodeText),L)}g=g||"text";let I=await resolvers[utils$6.findKey(resolvers,g)||"text"](D,r);return!P&&R(),T&&T(),await new Promise((L,F)=>{settle(L,F,{data:I,headers:AxiosHeaders.from(D.headers),status:D.status,statusText:D.statusText,config:r,request:O})})}catch(N){throw R(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new AxiosError("Network Error",AxiosError.ERR_NETWORK,r,O),{cause:N.cause||N}):AxiosError.from(N,N&&N.code,r,O)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$6.forEach(knownAdapters,(r,o)=>{if(r){try{Object.defineProperty(r,"name",{value:o})}catch{}Object.defineProperty(r,"adapterName",{value:o})}});const renderReason=r=>`- ${r}`,isResolvedHandle=r=>utils$6.isFunction(r)||r===null||r===!1,adapters={getAdapter:r=>{r=utils$6.isArray(r)?r:[r];const{length:o}=r;let s,a;const l={};for(let c=0;c`adapter ${d} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=o?c.length>1?`since : -`+c.map(renderReason).join(` -`):" "+renderReason(c[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a},adapters:knownAdapters};function throwIfCancellationRequested(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new CanceledError(null,r)}function dispatchRequest(r){return throwIfCancellationRequested(r),r.headers=AxiosHeaders.from(r.headers),r.data=transformData.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(r.adapter||defaults$5.adapter)(r).then(function(a){return throwIfCancellationRequested(r),a.data=transformData.call(r,r.transformResponse,a),a.headers=AxiosHeaders.from(a.headers),a},function(a){return isCancel(a)||(throwIfCancellationRequested(r),a&&a.response&&(a.response.data=transformData.call(r,r.transformResponse,a.response),a.response.headers=AxiosHeaders.from(a.response.headers))),Promise.reject(a)})}const VERSION$2="1.7.5",validators$2={};["object","boolean","number","function","string","symbol"].forEach((r,o)=>{validators$2[r]=function(a){return typeof a===r||"a"+(o<1?"n ":" ")+r}});const deprecatedWarnings={};validators$2.transitional=function(o,s,a){function l(c,u){return"[Axios v"+VERSION$2+"] Transitional option '"+c+"'"+u+(a?". "+a:"")}return(c,u,d)=>{if(o===!1)throw new AxiosError(l(u," has been removed"+(s?" in "+s:"")),AxiosError.ERR_DEPRECATED);return s&&!deprecatedWarnings[u]&&(deprecatedWarnings[u]=!0,console.warn(l(u," has been deprecated since v"+s+" and will be removed in the near future"))),o?o(c,u,d):!0}};function assertOptions(r,o,s){if(typeof r!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const a=Object.keys(r);let l=a.length;for(;l-- >0;){const c=a[l],u=o[c];if(u){const d=r[c],m=d===void 0||u(d,c,r);if(m!==!0)throw new AxiosError("option "+c+" must be "+m,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new AxiosError("Unknown option "+c,AxiosError.ERR_BAD_OPTION)}}const validator$1={assertOptions,validators:validators$2},validators$1=validator$1.validators;class Axios{constructor(o){this.defaults=o,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(o,s){try{return await this._request(o,s)}catch(a){if(a instanceof Error){let l;Error.captureStackTrace?Error.captureStackTrace(l={}):l=new Error;const c=l.stack?l.stack.replace(/^.+\n/,""):"";try{a.stack?c&&!String(a.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(a.stack+=` -`+c):a.stack=c}catch{}}throw a}}_request(o,s){typeof o=="string"?(s=s||{},s.url=o):s=o||{},s=mergeConfig(this.defaults,s);const{transitional:a,paramsSerializer:l,headers:c}=s;a!==void 0&&validator$1.assertOptions(a,{silentJSONParsing:validators$1.transitional(validators$1.boolean),forcedJSONParsing:validators$1.transitional(validators$1.boolean),clarifyTimeoutError:validators$1.transitional(validators$1.boolean)},!1),l!=null&&(utils$6.isFunction(l)?s.paramsSerializer={serialize:l}:validator$1.assertOptions(l,{encode:validators$1.function,serialize:validators$1.function},!0)),s.method=(s.method||this.defaults.method||"get").toLowerCase();let u=c&&utils$6.merge(c.common,c[s.method]);c&&utils$6.forEach(["delete","get","head","post","put","patch","common"],T=>{delete c[T]}),s.headers=AxiosHeaders.concat(u,c);const d=[];let m=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(s)===!1||(m=m&&k.synchronous,d.unshift(k.fulfilled,k.rejected))});const g=[];this.interceptors.response.forEach(function(k){g.push(k.fulfilled,k.rejected)});let y,_=0,E;if(!m){const T=[dispatchRequest.bind(this),void 0];for(T.unshift.apply(T,d),T.push.apply(T,g),E=T.length,y=Promise.resolve(s);_{if(!a._listeners)return;let c=a._listeners.length;for(;c-- >0;)a._listeners[c](l);a._listeners=null}),this.promise.then=l=>{let c;const u=new Promise(d=>{a.subscribe(d),c=d}).then(l);return u.cancel=function(){a.unsubscribe(c)},u},o(function(c,u,d){a.reason||(a.reason=new CanceledError(c,u,d),s(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(o){if(this.reason){o(this.reason);return}this._listeners?this._listeners.push(o):this._listeners=[o]}unsubscribe(o){if(!this._listeners)return;const s=this._listeners.indexOf(o);s!==-1&&this._listeners.splice(s,1)}static source(){let o;return{token:new CancelToken(function(l){o=l}),cancel:o}}}function spread(r){return function(s){return r.apply(null,s)}}function isAxiosError(r){return utils$6.isObject(r)&&r.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([r,o])=>{HttpStatusCode[o]=r});function createInstance(r){const o=new Axios(r),s=bind$3(Axios.prototype.request,o);return utils$6.extend(s,Axios.prototype,o,{allOwnKeys:!0}),utils$6.extend(s,o,null,{allOwnKeys:!0}),s.create=function(l){return createInstance(mergeConfig(r,l))},s}const axios=createInstance(defaults$5);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION$2;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(o){return Promise.all(o)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=r=>formDataToJSON(utils$6.isHTMLForm(r)?new FormData(r):r);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const byteToHex=[];for(let r=0;r<256;++r)byteToHex.push((r+256).toString(16).slice(1));function unsafeStringify(r,o=0){return byteToHex[r[o+0]]+byteToHex[r[o+1]]+byteToHex[r[o+2]]+byteToHex[r[o+3]]+"-"+byteToHex[r[o+4]]+byteToHex[r[o+5]]+"-"+byteToHex[r[o+6]]+byteToHex[r[o+7]]+"-"+byteToHex[r[o+8]]+byteToHex[r[o+9]]+"-"+byteToHex[r[o+10]]+byteToHex[r[o+11]]+byteToHex[r[o+12]]+byteToHex[r[o+13]]+byteToHex[r[o+14]]+byteToHex[r[o+15]]}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4$2(r,o,s){if(native.randomUUID&&!o&&!r)return native.randomUUID();r=r||{};const a=r.random||(r.rng||rng)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,unsafeStringify(a)}var FileSaver_min={exports:{}};(function(r,o){(function(s,a){a()})(commonjsGlobal$1,function(){function s(g,y){return typeof y>"u"?y={autoBom:!1}:typeof y!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),y={autoBom:!y}),y.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(g.type)?new Blob(["\uFEFF",g],{type:g.type}):g}function a(g,y,_){var E=new XMLHttpRequest;E.open("GET",g),E.responseType="blob",E.onload=function(){m(E.response,y,_)},E.onerror=function(){console.error("could not download file")},E.send()}function l(g){var y=new XMLHttpRequest;y.open("HEAD",g,!1);try{y.send()}catch{}return 200<=y.status&&299>=y.status}function c(g){try{g.dispatchEvent(new MouseEvent("click"))}catch{var y=document.createEvent("MouseEvents");y.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),g.dispatchEvent(y)}}var u=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof commonjsGlobal$1=="object"&&commonjsGlobal$1.global===commonjsGlobal$1?commonjsGlobal$1:void 0,d=u.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),m=u.saveAs||(typeof window!="object"||window!==u?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(g,y,_){var E=u.URL||u.webkitURL,w=document.createElement("a");y=y||g.name||"download",w.download=y,w.rel="noopener",typeof g=="string"?(w.href=g,w.origin===location.origin?c(w):l(w.href)?a(g,y,_):c(w,w.target="_blank")):(w.href=E.createObjectURL(g),setTimeout(function(){E.revokeObjectURL(w.href)},4e4),setTimeout(function(){c(w)},0))}:"msSaveOrOpenBlob"in navigator?function(g,y,_){if(y=y||g.name||"download",typeof g!="string")navigator.msSaveOrOpenBlob(s(g,_),y);else if(l(g))a(g,y,_);else{var E=document.createElement("a");E.href=g,E.target="_blank",setTimeout(function(){c(E)})}}:function(g,y,_,E){if(E=E||open("","_blank"),E&&(E.document.title=E.document.body.innerText="downloading..."),typeof g=="string")return a(g,y,_);var w=g.type==="application/octet-stream",T=/constructor/i.test(u.HTMLElement)||u.safari,k=/CriOS\/[\d]+/.test(navigator.userAgent);if((k||w&&T||d)&&typeof FileReader<"u"){var O=new FileReader;O.onloadend=function(){var N=O.result;N=k?N:N.replace(/^data:[^;]*;/,"data:attachment/file;"),E?E.location.href=N:location=N,E=null},O.readAsDataURL(g)}else{var R=u.URL||u.webkitURL,M=R.createObjectURL(g);E?E.location=M:location.href=M,E=null,setTimeout(function(){R.revokeObjectURL(M)},4e4)}});u.saveAs=m.saveAs=m,r.exports=m})})(FileSaver_min);var FileSaver_minExports=FileSaver_min.exports,__defProp$p=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,o,s)=>o in r?__defProp$p(r,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[o]=s,__spreadValues=(r,o)=>{for(var s in o||(o={}))__hasOwnProp.call(o,s)&&__defNormalProp(r,s,o[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(o))__propIsEnum.call(o,s)&&__defNormalProp(r,s,o[s]);return r},__spreadProps=(r,o)=>__defProps(r,__getOwnPropDescs(o));const icons={},addIcon=function(r,o){icons[r]=o},Icon=defineComponent({name:"Icon",props:{name:String,color:String},computed:{svg(){if(this.name)return icons[this.name]}},render(r){const o=this.svg;if(!o)return console.warn(`The name of '${this.name}' could not be found.`),createVNode("span",{class:"m-svg-icon"},null);const s={color:this.color?this.color:o.fill?o.fill:null};return createVNode("span",{class:["m-svg-icon","m-svg-icon--"+this.name]},[createVNode("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:o.viewBox,style:s,class:o.class},[o.defs&&createVNode("defs",{innerHTML:o.defs},null),o.path&&createVNode("path",{fill:"currentColor",d:o.path},null),o.html&&createVNode("g",{innerHTML:o.html},null),this.$slots.default])])}});Icon.add=addIcon;const error$2={name:"error",fill:"#F56C6C",viewBox:"0 0 1024 1024",path:"M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z"},info={name:"info",fill:"#1CADF2",viewBox:"0 0 1024 1024",path:"M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72z M581,673.9 c-33.2,49.9-67,88.3-123.8,88.3c-38.8-6.3-54.7-34.1-46.3-62.4L484,457.6c1.8-5.9-1.2-12.3-6.6-14.2c-5.4-1.9-15.9,5.1-25.1,15.1 l-44.2,53.2c-1.2-8.9-0.1-23.7-0.1-29.6c33.2-49.9,87.8-89.2,124.8-89.2c35.2,3.6,51.8,31.7,45.7,62.6l-73.6,243.3 c-1,5.5,1.9,11.1,6.9,12.8c5.4,1.9,16.8-5.1,26-15.1l44.2-53.1C583,652.3,581,667.9,581,673.9z M571.2,357.6 c-28,0-50.6-20.4-50.6-50.4c0-30,22.7-50.3,50.6-50.3c28,0,50.6,20.4,50.6,50.3C621.8,337.3,599.1,357.6,571.2,357.6z"},success={name:"success",fill:"#17B77E",viewBox:"0 0 1024 1024",path:"M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72L512,72z M758.9,374 c-48.5,48.6-81.2,76.9-172.3,186.8c-52.6,63.4-102.3,131.5-102.7,132L462.1,720c-4.6,6.1-13.5,6.8-19.1,1.6L267.9,558.9 c-17.8-16.5-18.8-44.4-2.3-62.2s44.4-18.8,62.2-2.3l104.9,97.5c5.5,5.1,14.1,4.5,18.9-1.3c16.2-20.1,38.4-44.5,62.4-68.6 c90.2-90.9,145.6-139.7,175.2-161.3c36-26.2,77.3-48.6,87.3-36.2C792,343.9,782.5,350.3,758.9,374L758.9,374z"},warning={name:"warning",fill:"#FFC603",viewBox:"0 0 1024 1024",path:"M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M510,770.8 c30.4,0,55-24.6,55-55s-24.6-55-55-55s-55,24.6-55,55S479.6,770.8,510,770.8z M509.8,255.3c-39.3,0-71.2,31.9-71.2,71.2 c0,3.1,0.2,6.2,0.6,9.3L472.4,588c2.5,19.3,18.9,33.7,38.4,33.7c19.4,0,35.8-14.4,38.2-33.7l31.8-252.2c5-39.2-22.8-75-62-79.9 C515.9,255.5,512.8,255.3,509.8,255.3z"},loading={name:"loading",viewBox:"0 0 50 50",html:''};Icon.add(error$2.name,error$2);Icon.add(info.name,info);Icon.add(success.name,success);Icon.add(warning.name,warning);Icon.add(loading.name,loading);var _export_sfc=(r,o)=>{const s=r.__vccOpts||r;for(const[a,l]of o)s[a]=l;return s};function useTimeout(r,o){const s=ref$1(0);return s.value=window.setTimeout(r,o),{stop(){window.clearTimeout(s.value)}}}const _sfc_main$1=defineComponent({components:{Icon},name:"m-message",emits:["close","destroy","collapsed"],props:{id:String,type:{type:String,default:"info"},title:String,message:String,iconURL:String,duration:{type:Number,default:3e3},isCollapsed:Boolean,collapsable:Boolean,supportHTML:Boolean,width:String,className:String,wrapperClassName:String,closable:Boolean,stopTimerOnHover:{type:Boolean,default:!0}},setup(r,{expose:o,emit:s}){const a=reactive({visible:!0,collapsed:r.isCollapsed,timer:null});let l;const c=()=>{r.duration<0||({stop:l}=useTimeout(()=>{d()},r.duration))},u=()=>{l?.()},d=()=>{a.visible=!1},m=()=>{a.collapsed=!a.collapsed,s("collapsed",a.collapsed)},g=()=>{a.visible=!1},y=()=>{r.stopTimerOnHover&&u()},_=()=>{r.stopTimerOnHover&&c()};return onBeforeMount(()=>{u()}),onMounted(()=>{c()}),o({close:d}),{state:a,handleClearTimer:y,handleStartTimer:_,triggerCollapse:m,handleClose:g}}}),_hoisted_1$q=["id"],_hoisted_2$n={key:0,class:"m-message-icons"},_hoisted_3$m=["src"],_hoisted_4$k={class:"m-message-content"},_hoisted_5$i={key:0,class:"m-message--title"},_hoisted_6$g=["innerHTML"],_hoisted_7$g={key:0,class:"m-message--description"},_hoisted_8$f={class:"m-message--control"},_hoisted_9$e=createBaseVNode("svg",{viewBox:"0 0 35 35",width:"20",height:"20",version:"1.1",fill:"currentColor"},[createBaseVNode("path",{d:"M9.4,13.9c-0.2,0.2-0.2,0.6,0,0.8l8.1,8.1l0,0l0,0l8.1-8.1c0.2-0.2,0.2-0.6,0-0.8l-1.3-1.3 c-0.2-0.2-0.6-0.2-0.8,0l-5.5,5.5c-0.2,0.2-0.6,0.2-0.8,0l-5.5-5.5c-0.2-0.2-0.6-0.2-0.8,0L9.4,13.9z"})],-1),_hoisted_10$d=[_hoisted_9$e],_hoisted_11$d=createBaseVNode("svg",{viewBox:"0 0 35 35",width:"20",height:"20",version:"1.1",fill:"currentColor"},[createBaseVNode("path",{d:"M19.5,17.5l5.1,5.1l-2,2l-5.1-5.1l-5.1,5.1l-2-2l5.1-5.1l-5.1-5.1l2-2l5.1,5.1l5.1-5.1l2,2L19.5,17.5z"})],-1),_hoisted_12$c=[_hoisted_11$d];function _sfc_render$p(r,o,s,a,l,c){const u=resolveComponent("icon");return openBlock(),createBlock(Transition,{name:"m-message-fade",appear:"",mode:"in-out",onBeforeLeave:o[4]||(o[4]=d=>r.$emit("close")),onAfterLeave:o[5]||(o[5]=d=>r.$emit("destroy"))},{default:withCtx(()=>[r.state.visible?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["m-message-wrapper",r.wrapperClassName]),id:r.id,style:normalizeStyle({width:r.width})},[createBaseVNode("div",{class:normalizeClass(["m-message",r.className]),onMouseenter:o[2]||(o[2]=(...d)=>r.handleClearTimer&&r.handleClearTimer(...d)),onMouseleave:o[3]||(o[3]=(...d)=>r.handleStartTimer&&r.handleStartTimer(...d))},[r.iconURL||r.type?(openBlock(),createElementBlock("div",_hoisted_2$n,[r.iconURL?(openBlock(),createElementBlock("img",{key:0,src:r.iconURL,class:"m-message--icon"},null,8,_hoisted_3$m)):r.type?(openBlock(),createBlock(u,{key:1,name:r.type,class:"m-message--icon"},null,8,["name"])):createCommentVNode("",!0)])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_4$k,[r.title||r.$slots.title?(openBlock(),createElementBlock("div",_hoisted_5$i,[renderSlot(r.$slots,"title",{},()=>[createTextVNode(toDisplayString$1(r.title),1)])])):createCommentVNode("",!0),r.supportHTML&&r.message?(openBlock(),createElementBlock(Fragment,{key:1},[r.state.collapsed?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:0,class:"m-message--description",innerHTML:r.message},null,8,_hoisted_6$g))],64)):(openBlock(),createElementBlock(Fragment,{key:2},[r.state.collapsed?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_7$g,[renderSlot(r.$slots,"default",{},()=>[createTextVNode(toDisplayString$1(r.message),1)])]))],64))]),createBaseVNode("div",_hoisted_8$f,[r.collapsable&&(r.title||r.$slots.title)?(openBlock(),createElementBlock("button",{key:0,class:normalizeClass(["m-message--button m-message--arrow-down",{"is-collapsed":r.state.collapsed}]),onClick:o[0]||(o[0]=(...d)=>r.triggerCollapse&&r.triggerCollapse(...d))},_hoisted_10$d,2)):createCommentVNode("",!0),r.closable?(openBlock(),createElementBlock("button",{key:1,class:"m-message--button m-message--close",onClick:o[1]||(o[1]=(...d)=>r.handleClose&&r.handleClose(...d))},_hoisted_12$c)):createCommentVNode("",!0)])],34)],14,_hoisted_1$q)):createCommentVNode("",!0)]),_:3})}var MessageComponent=_export_sfc(_sfc_main$1,[["render",_sfc_render$p]]);const instances=[];let seed=0;const containers={};let globalsOptions={};const defaultOptions$1={stopTimerOnHover:!0,duration:3e3},message=r=>{const o="m-message-"+seed++,s=__spreadProps(__spreadValues(__spreadValues(__spreadValues({},defaultOptions$1),globalsOptions),r),{id:o});delete s.hasMask,delete s.position,delete s.zIndex;const a=r.position||"top-center",l=r.hasMask||!1,c=a+(l?"-mask":"");let u=containers[c];u?u.count++:(u=containers[c]={el:document.createElement("div"),count:1},u.el.className=["m-message-container","is-"+a,l?"has-mask":""].filter(function(_){return!!_}).join(" "),document.body.appendChild(u.el)),r.zIndex&&(u.el.style.zIndex=String(r.zIndex));let d=null;isVNode$1(r.message)?(d={default:()=>r.message},s.message=""):typeof r.message=="function"&&(d={default:r.message},s.message="");const m=createVNode(MessageComponent,s,d),g=document.createElement("div");m.appContext=r.ctx||message._context||null,m.props.onClose=r.onClose,m.props.onDestroy=()=>{u.count--,u.count===0&&(delete containers[c],u.el.remove()),render$1(null,g)},render$1(m,g),a.indexOf("bottom")===0&&u.el.firstChild?u.el.insertBefore(g.firstElementChild,u.el.firstChild):u.el.appendChild(g.firstElementChild);const y={id:o,close(){var _,E;(E=(_=m?.component)==null?void 0:_.exposed)==null||E.close()}};return instances.push(y),y};message.success=(r,o)=>message(__spreadProps(__spreadValues({},o),{type:"success",message:r}));message.info=(r,o)=>message(__spreadProps(__spreadValues({},o),{type:"info",message:r}));message.warning=(r,o)=>message(__spreadProps(__spreadValues({},o),{type:"warning",message:r}));message.error=(r,o)=>message(__spreadProps(__spreadValues({},o),{type:"error",message:r}));message.loading=(r,o)=>message(__spreadProps(__spreadValues({},o),{type:"loading",message:r}));message.closeAll=function(){for(let r=instances.length-1;r>=0;r--)instances[r].close()};message.setDefault=r=>{globalsOptions=__spreadValues({},r)};const withInstall=(r,o)=>(r.install=o,r);var index$2=withInstall(message,function(r,o={}){message._context=r._context,r.config.globalProperties["$"+(o.name||"mmessage")]=message,o.defaultOptions&&message.setDefault(o.defaultOptions)}),__defProp$o=Object.defineProperty,__getOwnPropDesc$h=Object.getOwnPropertyDescriptor,__decorateClass$o=(r,o,s,a)=>{for(var l=a>1?void 0:a?__getOwnPropDesc$h(o,s):o,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=(a?u(o,s,l):u(l))||l);return a&&l&&__defProp$o(o,s,l),l};let MetadataEditorV$4=class extends Vue{name;title;message;options;cancelAllowed;onCancel(){this.$emit("Cancel"),this.$vfm.close(this.name)}};__decorateClass$o([Prop()],MetadataEditorV$4.prototype,"name",2);__decorateClass$o([Prop()],MetadataEditorV$4.prototype,"title",2);__decorateClass$o([Prop()],MetadataEditorV$4.prototype,"message",2);__decorateClass$o([Prop()],MetadataEditorV$4.prototype,"options",2);__decorateClass$o([Prop({default:!1})],MetadataEditorV$4.prototype,"cancelAllowed",2);MetadataEditorV$4=__decorateClass$o([Options$1({components:{"vue-final-modal":Ro$3}})],MetadataEditorV$4);const _hoisted_1$p={class:"mx-5 my-2"},_hoisted_2$m={key:0,slot:"header",class:"text-2xl font-bold mb-1"},_hoisted_3$l={key:1},_hoisted_4$j={class:"w-full flex justify-end mt-3"},_hoisted_5$h=["onClick"];function _sfc_render$o(r,o,s,a,l,c){const u=resolveComponent("vue-final-modal");return openBlock(),createBlock(u,{modalId:r.name,clickToClose:!1,"content-class":"flex flex-col max-h-full overflow-y-auto max-w-xl mx-4 p-4 bg-white border rounded-lg space-y-2",class:"flex justify-center items-center"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$p,[r.title?(openBlock(),createElementBlock("h2",_hoisted_2$m,toDisplayString$1(r.title),1)):createCommentVNode("",!0),r.message?(openBlock(),createElementBlock("p",_hoisted_3$l,toDisplayString$1(r.message),1)):createCommentVNode("",!0),createBaseVNode("div",_hoisted_4$j,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.options,d=>(openBlock(),createElementBlock("button",{class:"editor-button bg-black text-white hover:bg-gray-800",onClick:()=>{d.action(),this.$vfm.close(this.name)}},toDisplayString$1(d.label),9,_hoisted_5$h))),256)),r.cancelAllowed?(openBlock(),createElementBlock("button",{key:0,class:"editor-button hover:bg-gray-800",onClick:o[0]||(o[0]=(...d)=>r.onCancel&&r.onCancel(...d))},toDisplayString$1(r.$t("editor.cancel")),1)):createCommentVNode("",!0)])])]),_:1},8,["modalId"])}const MultiOptionModal=_export_sfc$1(MetadataEditorV$4,[["render",_sfc_render$o],["__scopeId","data-v-7d0a2bab"]]);var highcharts={exports:{}},hasRequiredHighcharts;function requireHighcharts(){return hasRequiredHighcharts||(hasRequiredHighcharts=1,function(r){(function(o,s){r.exports?(s.default=s,r.exports=o.document?s(o):s):(o.Highcharts&&o.Highcharts.error(16,!0),o.Highcharts=s(o))})(typeof window<"u"?window:commonjsGlobal$1,function(o){function s(l,c,u,d){l.hasOwnProperty(c)||(l[c]=d.apply(null,u))}var a={};return s(a,"Core/Globals.js",[],function(){var l=typeof o<"u"?o:typeof window<"u"?window:{},c;return function(u){u.SVG_NS="http://www.w3.org/2000/svg",u.product="Highcharts",u.version="9.3.3",u.win=l,u.doc=u.win.document,u.svg=u.doc&&u.doc.createElementNS&&!!u.doc.createElementNS(u.SVG_NS,"svg").createSVGRect,u.userAgent=u.win.navigator&&u.win.navigator.userAgent||"",u.isChrome=u.userAgent.indexOf("Chrome")!==-1,u.isFirefox=u.userAgent.indexOf("Firefox")!==-1,u.isMS=/(edge|msie|trident)/i.test(u.userAgent)&&!u.win.opera,u.isSafari=!u.isChrome&&u.userAgent.indexOf("Safari")!==-1,u.isTouchDevice=/(Mobile|Android|Windows Phone)/.test(u.userAgent),u.isWebKit=u.userAgent.indexOf("AppleWebKit")!==-1,u.deg2rad=2*Math.PI/360,u.hasBidiBug=u.isFirefox&&4>parseInt(u.userAgent.split("Firefox/")[1],10),u.hasTouch=!!u.win.TouchEvent,u.marginNames=["plotTop","marginRight","marginBottom","plotLeft"],u.noop=function(){},u.supportsPassiveEvents=function(){var d=!1;if(!u.isMS){var m=Object.defineProperty({},"passive",{get:function(){d=!0}});u.win.addEventListener&&u.win.removeEventListener&&(u.win.addEventListener("testPassive",u.noop,m),u.win.removeEventListener("testPassive",u.noop,m))}return d}(),u.charts=[],u.dateFormats={},u.seriesTypes={},u.symbolSizes={},u.chartCount=0}(c||(c={})),c}),s(a,"Core/Utilities.js",[a["Core/Globals.js"]],function(l){function c(Y,B,V,Ge){var St=B?"Highcharts error":"Highcharts warning";Y===32&&(Y=St+": Deprecated member");var Dee=w(Y),pee=Dee?St+" #"+Y+": www.highcharts.com/errors/"+Y+"/":Y.toString();if(typeof Ge<"u"){var jr="";Dee&&(pee+="?"),P(Ge,function(Tee,et){jr+=` - - `+et+": "+Tee,Dee&&(pee+=encodeURI(et)+"="+encodeURI(Tee))}),pee+=jr}L(l,"displayError",{chart:V,code:Y,message:pee,params:Ge},function(){if(B)throw Error(pee);J.console&&c.messages.indexOf(pee)===-1&&console.warn(pee)}),c.messages.push(pee)}function u(Y,B){var V={};return P(Y,function(Ge,St){y(Y[St],!0)&&!Y.nodeType&&B[St]?(Ge=u(Y[St],B[St]),Object.keys(Ge).length&&(V[St]=Ge)):(y(Y[St])||Y[St]!==B[St])&&(V[St]=Y[St])}),V}function d(Y,B){return parseInt(Y,B||10)}function m(Y){return typeof Y=="string"}function g(Y){return Y=Object.prototype.toString.call(Y),Y==="[object Array]"||Y==="[object Array Iterator]"}function y(Y,B){return!!Y&&typeof Y=="object"&&(!B||!g(Y))}function _(Y){return y(Y)&&typeof Y.nodeType=="number"}function E(Y){var B=Y&&Y.constructor;return!(!y(Y,!0)||_(Y)||!B||!B.name||B.name==="Object")}function w(Y){return typeof Y=="number"&&!isNaN(Y)&&1/0>Y&&-1/0=B-1&&(B=Math.floor(V)),Math.max(0,B-(Ge(Y,"padding-left",!0)||0)-(Ge(Y,"padding-right",!0)||0));if(B==="height")return Math.max(0,Math.min(Y.offsetHeight,Y.scrollHeight)-(Ge(Y,"padding-top",!0)||0)-(Ge(Y,"padding-bottom",!0)||0));if(J.getComputedStyle||c(27,!0),Y=J.getComputedStyle(Y,void 0)){var St=Y.getPropertyValue(B);R(V,B!=="opacity")&&(St=d(St))}return St}function P(Y,B,V){for(var Ge in Y)Object.hasOwnProperty.call(Y,Ge)&&B.call(V||Y[Ge],Y[Ge],Ge,Y)}function I(Y,B,V){function Ge(jr,Tee){var et=Y.removeEventListener||l.removeEventListenerPolyfill;et&&et.call(Y,jr,Tee,!1)}function St(jr){var Tee;if(Y.nodeName){if(B){var et={};et[B]=!0}else et=jr;P(et,function(ft,yee){if(jr[yee])for(Tee=jr[yee].length;Tee--;)Ge(yee,jr[yee][Tee].fn)})}}var Dee=typeof Y=="function"&&Y.prototype||Y;if(Object.hasOwnProperty.call(Dee,"hcEvents")){var pee=Dee.hcEvents;B?(Dee=pee[B]||[],V?(pee[B]=Dee.filter(function(jr){return V!==jr.fn}),Ge(B,V)):(St(pee),pee[B]=[])):(St(pee),delete Dee.hcEvents)}}function L(Y,B,V,Ge){if(V=V||{},U.createEvent&&(Y.dispatchEvent||Y.fireEvent&&Y!==l)){var St=U.createEvent("Events");St.initEvent(B,!0,!0),V=O(St,V),Y.dispatchEvent?Y.dispatchEvent(V):Y.fireEvent(B,V)}else if(Y.hcEvents){V.target||O(V,{preventDefault:function(){V.defaultPrevented=!0},target:Y,type:B}),St=[];for(var Dee=Y,pee=!1;Dee.hcEvents;)Object.hasOwnProperty.call(Dee,"hcEvents")&&Dee.hcEvents[B]&&(St.length&&(pee=!0),St.unshift.apply(St,Dee.hcEvents[B])),Dee=Object.getPrototypeOf(Dee);pee&&St.sort(function(jr,Tee){return jr.order-Tee.order}),St.forEach(function(jr){jr.fn.call(Y,V)===!1&&V.preventDefault()})}Ge&&!V.defaultPrevented&&Ge.call(Y,V)}var F=l.charts,U=l.doc,J=l.win;(c||(c={})).messages=[],Math.easeInOutSine=function(Y){return-.5*(Math.cos(Math.PI*Y)-1)};var z=Array.prototype.find?function(Y,B){return Y.find(B)}:function(Y,B){var V,Ge=Y.length;for(V=0;VV&&(V=Y[B]);return V},arrayMin:function(Y){for(var B=Y.length,V=Y[0];B--;)Y[B]B?Y"u"||V==="__proto__"||(B=B[V],!T(B)||typeof B=="function"||typeof B.nodeType=="number"||B===J))return}return B},getStyle:D,inArray:function(Y,B,V){return c(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"}),B.indexOf(Y,V)},isArray:g,isClass:E,isDOMElement:_,isFunction:function(Y){return typeof Y=="function"},isNumber:w,isObject:y,isString:m,keys:function(Y){return c(32,!1,void 0,{"Highcharts.keys":"use Object.keys"}),Object.keys(Y)},merge:function(){var Y,B=arguments,V={},Ge=function(Dee,pee){return typeof Dee!="object"&&(Dee={}),P(pee,function(jr,Tee){Tee!=="__proto__"&&Tee!=="constructor"&&(!y(jr,!0)||E(jr)||_(jr)?Dee[Tee]=pee[Tee]:Dee[Tee]=Ge(Dee[Tee]||{},jr))}),Dee};B[0]===!0&&(V=B[1],B=Array.prototype.slice.call(B,2));var St=B.length;for(Y=0;Y=V&&(B=[1/V]))),Ge=0;Ge=Y||!St&&pee<=(B[Ge]+(B[Ge+1]||B[Ge]))/2));Ge++);return Dee=N(Dee*V,-Math.round(Math.log(.001)/Math.LN10))},objectEach:P,offset:function(Y){var B=U.documentElement;return Y=Y.parentElement||Y.parentNode?Y.getBoundingClientRect():{top:0,left:0,width:0,height:0},{top:Y.top+(J.pageYOffset||B.scrollTop)-(B.clientTop||0),left:Y.left+(J.pageXOffset||B.scrollLeft)-(B.clientLeft||0),width:Y.width,height:Y.height}},pad:function(Y,B,V){return Array((B||2)+1-String(Y).replace("-","").length).join(V||"0")+Y},pick:R,pInt:d,relativeLength:function(Y,B,V){return/%$/.test(Y)?B*parseFloat(Y)/100+(V||0):parseFloat(Y)},removeEvent:I,splat:function(Y){return g(Y)?Y:[Y]},stableSort:function(Y,B){var V=Y.length,Ge,St;for(St=0;St>16,(w&65280)>>8,w&255,1]:E===4&&(_=[(w&3840)>>4|(w&3840)>>8,(w&240)>>4|w&240,(w&15)<<4|w&15,1])}if(!_)for(w=g.parsers.length;w--&&!_;){var T=g.parsers[w];(E=T.regex.exec(y))&&(_=T.parse(E))}}_&&(this.rgba=_)},g.prototype.get=function(y){var _=this.input,E=this.rgba;if(typeof _=="object"&&typeof this.stops<"u"){var w=d(_);return w.stops=[].slice.call(w.stops),this.stops.forEach(function(T,k){w.stops[k]=[w.stops[k][0],T.get(y)]}),w}return E&&u(E[0])?y==="rgb"||!y&&E[3]===1?"rgb("+E[0]+","+E[1]+","+E[2]+")":y==="a"?""+E[3]:"rgba("+E.join(",")+")":_},g.prototype.brighten=function(y){var _=this.rgba;if(this.stops)this.stops.forEach(function(w){w.brighten(y)});else if(u(y)&&y!==0)for(var E=0;3>E;E++)_[E]+=m(255*y),0>_[E]&&(_[E]=0),255<_[E]&&(_[E]=255);return this},g.prototype.setOpacity=function(y){return this.rgba[3]=y,this},g.prototype.tweenTo=function(y,_){var E=this.rgba,w=y.rgba;return!u(E[0])||!u(w[0])?y.input||"none":(y=w[3]!==1||E[3]!==1,(y?"rgba(":"rgb(")+Math.round(w[0]+(E[0]-w[0])*(1-_))+","+Math.round(w[1]+(E[1]-w[1])*(1-_))+","+Math.round(w[2]+(E[2]-w[2])*(1-_))+(y?","+(w[3]+(E[3]-w[3])*(1-_)):"")+")")},g.names={white:"#ffffff",black:"#000000"},g.parsers=[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(y){return[m(y[1]),m(y[2]),m(y[3]),parseFloat(y[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(y){return[m(y[1]),m(y[2]),m(y[3]),1]}}],g.None=new g(""),g}(),c}),s(a,"Core/Color/Palettes.js",[],function(){return{colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" ")}}),s(a,"Core/Time.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(l,c){var u=l.win,d=c.defined,m=c.error,g=c.extend,y=c.isObject,_=c.merge,E=c.objectEach,w=c.pad,T=c.pick,k=c.splat,O=c.timeUnits,R=l.isSafari&&u.Intl&&u.Intl.DateTimeFormat.prototype.formatRange,M=l.isSafari&&u.Intl&&!u.Intl.DateTimeFormat.prototype.formatRange;return c=function(){function N(D){this.options={},this.variableTimezone=this.useUTC=!1,this.Date=u.Date,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.update(D)}return N.prototype.get=function(D,P){if(this.variableTimezone||this.timezoneOffset){var I=P.getTime(),L=I-this.getTimezoneOffset(P);return P.setTime(L),D=P["getUTC"+D](),P.setTime(I),D}return this.useUTC?P["getUTC"+D]():P["get"+D]()},N.prototype.set=function(D,P,I){if(this.variableTimezone||this.timezoneOffset){if(D==="Milliseconds"||D==="Seconds"||D==="Minutes"&&this.getTimezoneOffset(P)%36e5===0)return P["setUTC"+D](I);var L=this.getTimezoneOffset(P);return L=P.getTime()-L,P.setTime(L),P["setUTC"+D](I),D=this.getTimezoneOffset(P),L=P.getTime()+D,P.setTime(L)}return this.useUTC||R&&D==="FullYear"?P["setUTC"+D](I):P["set"+D](I)},N.prototype.update=function(D){var P=T(D&&D.useUTC,!0);this.options=D=_(!0,this.options||{},D),this.Date=D.Date||u.Date||Date,this.timezoneOffset=(this.useUTC=P)&&D.timezoneOffset,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.variableTimezone=P&&!(!D.getTimezoneOffset&&!D.timezone)},N.prototype.makeTime=function(D,P,I,L,F,U){if(this.useUTC){var J=this.Date.UTC.apply(0,arguments),z=this.getTimezoneOffset(J);J+=z;var ie=this.getTimezoneOffset(J);z!==ie?J+=ie-z:z-36e5!==this.getTimezoneOffset(J-36e5)||M||(J-=36e5)}else J=new this.Date(D,P,T(I,1),T(L,0),T(F,0),T(U,0)).getTime();return J},N.prototype.timezoneOffsetFunction=function(){var D=this,P=this.options,I=P.getTimezoneOffset,L=P.moment||u.moment;if(!this.useUTC)return function(F){return 6e4*new Date(F.toString()).getTimezoneOffset()};if(P.timezone){if(L)return function(F){return 6e4*-L.tz(F,P.timezone).utcOffset()};m(25)}return this.useUTC&&I?function(F){return 6e4*I(F.valueOf())}:function(){return 6e4*(D.timezoneOffset||0)}},N.prototype.dateFormat=function(D,P,I){if(!d(P)||isNaN(P))return l.defaultOptions.lang&&l.defaultOptions.lang.invalidDate||"";D=T(D,"%Y-%m-%d %H:%M:%S");var L=this,F=new this.Date(P),U=this.get("Hours",F),J=this.get("Day",F),z=this.get("Date",F),ie=this.get("Month",F),ce=this.get("FullYear",F),Y=l.defaultOptions.lang,B=Y&&Y.weekdays,V=Y&&Y.shortWeekdays;return F=g({a:V?V[J]:B[J].substr(0,3),A:B[J],d:w(z),e:w(z,2," "),w:J,b:Y.shortMonths[ie],B:Y.months[ie],m:w(ie+1),o:ie+1,y:ce.toString().substr(2,2),Y:ce,H:w(U),k:U,I:w(U%12||12),l:U%12||12,M:w(this.get("Minutes",F)),p:12>U?"AM":"PM",P:12>U?"am":"pm",S:w(F.getSeconds()),L:w(Math.floor(P%1e3),3)},l.dateFormats),E(F,function(Ge,St){for(;D.indexOf("%"+St)!==-1;)D=D.replace("%"+St,typeof Ge=="function"?Ge.call(L,P):Ge)}),I?D.substr(0,1).toUpperCase()+D.substr(1):D},N.prototype.resolveDTLFormat=function(D){return y(D,!0)?D:(D=k(D),{main:D[0],from:D[1],to:D[2]})},N.prototype.getTimeTicks=function(D,P,I,L){var F=this,U=[],J={},z=new F.Date(P),ie=D.unitRange,ce=D.count||1,Y;if(L=T(L,1),d(P)){if(F.set("Milliseconds",z,ie>=O.second?0:ce*Math.floor(F.get("Milliseconds",z)/ce)),ie>=O.second&&F.set("Seconds",z,ie>=O.minute?0:ce*Math.floor(F.get("Seconds",z)/ce)),ie>=O.minute&&F.set("Minutes",z,ie>=O.hour?0:ce*Math.floor(F.get("Minutes",z)/ce)),ie>=O.hour&&F.set("Hours",z,ie>=O.day?0:ce*Math.floor(F.get("Hours",z)/ce)),ie>=O.day&&F.set("Date",z,ie>=O.month?1:Math.max(1,ce*Math.floor(F.get("Date",z)/ce))),ie>=O.month){F.set("Month",z,ie>=O.year?0:ce*Math.floor(F.get("Month",z)/ce));var B=F.get("FullYear",z)}ie>=O.year&&F.set("FullYear",z,B-B%ce),ie===O.week&&(B=F.get("Day",z),F.set("Date",z,F.get("Date",z)-B+L+(B4*O.month||F.getTimezoneOffset(P)!==F.getTimezoneOffset(I)),P=z.getTime(),z=1;PU.length&&U.forEach(function(St){St%18e5===0&&F.dateFormat("%H%M%S%L",St)==="000000000"&&(J[St]="day")})}return U.info=g(D,{higherRanks:J,totalRange:ie*ce}),U},N.prototype.getDateFormat=function(D,P,I,L){var F=this.dateFormat("%m-%d %H:%M:%S.%L",P),U={millisecond:15,second:12,minute:9,hour:6,day:3},J="millisecond";for(z in O){if(D===O.week&&+this.dateFormat("%w",P)===I&&F.substr(6)==="00:00:00.000"){var z="week";break}if(O[z]>D){z=J;break}if(U[z]&&F.substr(U[z])!=="01-01 00:00:00.000".substr(U[z]))break;z!=="week"&&(J=z)}if(z)var ie=this.resolveDTLFormat(L[z]).main;return ie},N}(),c}),s(a,"Core/DefaultOptions.js",[a["Core/Chart/ChartDefaults.js"],a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Color/Palettes.js"],a["Core/Time.js"],a["Core/Utilities.js"]],function(l,c,u,d,m,g){c=c.parse;var y=g.merge,_={colors:d.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:l,title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,className:"highcharts-no-tooltip",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:u.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,shape:"callout",shared:!1,snap:u.isTouchDevice?25:10,headerFormat:'{point.key}
',pointFormat:' {series.name}: {point.y}
',backgroundColor:c("#f7f7f7").setOpacity(.85).get(),borderWidth:1,shadow:!0,stickOnContact:!1,style:{color:"#333333",cursor:"default",fontSize:"12px",whiteSpace:"nowrap"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};_.chart.styledMode=!1;var E=new m(y(_.global,_.time));return l={defaultOptions:_,defaultTime:E,getOptions:function(){return _},setOptions:function(w){return y(!0,_,w),(w.time||w.global)&&(u.time?u.time.update(y(_.global,_.time,w.global,w.time)):u.time=E),_}},l}),s(a,"Core/Animation/Fx.js",[a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(l,c,u){var d=l.parse,m=c.win,g=u.isNumber,y=u.objectEach;return function(){function _(E,w,T){this.pos=NaN,this.options=w,this.elem=E,this.prop=T}return _.prototype.dSetter=function(){var E=this.paths,w=E&&E[0];E=E&&E[1];var T=this.now||0,k=[];if(T!==1&&w&&E)if(w.length===E.length&&1>T)for(var O=0;O=R+this.startTime){this.now=this.end,this.pos=1,this.update();var N=M[this.prop]=!0;y(M,function(D){D!==!0&&(N=!1)}),N&&O&&O.call(k),E=!1}else this.pos=T.easing((w-this.startTime)/R),this.now=this.start+(this.end-this.start)*this.pos,this.update(),E=!0;return E},_.prototype.initPath=function(E,w,T){function k(F,U){for(;F.length"u"&&(w=[])}if(w.length&&g(P)){var L=T.length+P*D;I?(k(w,T),O(T,w)):(k(T,w),O(w,T))}return[w,T]},_.prototype.fillSetter=function(){_.prototype.strokeSetter.apply(this,arguments)},_.prototype.strokeSetter=function(){this.elem.attr(this.prop,d(this.start).tweenTo(d(this.end),this.pos),void 0,!0)},_.timers=[],_}()}),s(a,"Core/Animation/AnimationUtilities.js",[a["Core/Animation/Fx.js"],a["Core/Utilities.js"]],function(l,c){function u(O){return E(O)?w({duration:500,defer:0},O):{duration:O?500:0,defer:0}}function d(O,R){for(var M=l.timers.length;M--;)l.timers[M].elem!==O||R&&R!==l.timers[M].prop||(l.timers[M].stopped=!0)}var m=c.defined,g=c.getStyle,y=c.isArray,_=c.isNumber,E=c.isObject,w=c.merge,T=c.objectEach,k=c.pick;return{animate:function(O,R,M){var N,D="",P,I;if(!E(M)){var L=arguments;M={duration:L[2],easing:L[3],complete:L[4]}}_(M.duration)||(M.duration=400),M.easing=typeof M.easing=="function"?M.easing:Math[M.easing]||Math.easeInOutSine,M.curAnim=w(R),T(R,function(F,U){d(O,U),I=new l(O,M,U),P=void 0,U==="d"&&y(R.d)?(I.paths=I.initPath(O,O.pathArray,R.d),I.toD=R.d,N=0,P=1):O.attr?N=O.attr(U):(N=parseFloat(g(O,U))||0,U!=="opacity"&&(D="px")),P||(P=F),typeof P=="string"&&P.match("px")&&(P=P.replace(/px/g,"")),I.run(N,P,D)})},animObject:u,getDeferredAnimation:function(O,R,M){var N=u(R),D=0,P=0;return(M?[M]:O.series).forEach(function(I){I=u(I.options.animation),D=R&&m(R.defer)?N.defer:Math.max(D,I.duration+I.defer),P=Math.min(N.duration,I.duration)}),O.renderer.forExport&&(D=0),{defer:Math.max(0,D-P),duration:Math.min(D,P)}},setAnimation:function(O,R){R.renderer.globalAnimation=k(O,R.options.chart.animation,!0)},stop:d}}),s(a,"Core/Renderer/HTML/AST.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(l,c){var u=l.SVG_NS,d=c.attr,m=c.createElement,g=c.error,y=c.isFunction,_=c.isString,E=c.objectEach,w=c.splat,T=(c=l.win.trustedTypes)&&y(c.createPolicy)&&c.createPolicy("highcharts",{createHTML:function(R){return R}}),k=T?T.createHTML(""):"";try{var O=!!new DOMParser().parseFromString(k,"text/html")}catch{O=!1}return y=function(){function R(M){this.nodes=typeof M=="string"?this.parseMarkup(M):M}return R.filterUserAttributes=function(M){return E(M,function(N,D){var P=!0;R.allowedAttributes.indexOf(D)===-1&&(P=!1),["background","dynsrc","href","lowsrc","src"].indexOf(D)!==-1&&(P=_(N)&&R.allowedReferences.some(function(I){return N.indexOf(I)===0})),P||(g("Highcharts warning: Invalid attribute '"+D+"' in config"),delete M[D])}),M},R.setElementHTML=function(M,N){M.innerHTML=R.emptyHTML,N&&new R(N).addToDOM(M)},R.prototype.addToDOM=function(M){function N(D,P){var I;return w(D).forEach(function(L){var F=L.tagName,U=L.textContent?l.doc.createTextNode(L.textContent):void 0;if(F)if(F==="#text")var J=U;else if(R.allowedTags.indexOf(F)!==-1){F=l.doc.createElementNS(F==="svg"?u:P.namespaceURI||u,F);var z=L.attributes||{};E(L,function(ie,ce){ce!=="tagName"&&ce!=="attributes"&&ce!=="children"&&ce!=="textContent"&&(z[ce]=ie)}),d(F,R.filterUserAttributes(z)),U&&F.appendChild(U),N(L.children||[],F),J=F}else g("Highcharts warning: Invalid tagName "+F+" in config");J&&P.appendChild(J),I=J}),I}return N(this.nodes,M)},R.prototype.parseMarkup=function(M){var N=[];if(M=M.trim(),O)M=new DOMParser().parseFromString(T?T.createHTML(M):M,"text/html");else{var D=m("div");D.innerHTML=M,M={body:D}}var P=function(I,L){var F=I.nodeName.toLowerCase(),U={tagName:F};if(F==="#text"&&(U.textContent=I.textContent||""),F=I.attributes){var J={};[].forEach.call(F,function(ie){J[ie.name]=ie.value}),U.attributes=J}if(I.childNodes.length){var z=[];[].forEach.call(I.childNodes,function(ie){P(ie,z)}),z.length&&(U.children=z)}L.push(U)};return[].forEach.call(M.body.childNodes,function(I){return P(I,N)}),N},R.allowedAttributes="aria-controls aria-describedby aria-expanded aria-haspopup aria-hidden aria-label aria-labelledby aria-live aria-pressed aria-readonly aria-roledescription aria-selected class clip-path color colspan cx cy d dx dy disabled fill height href id in markerHeight markerWidth offset opacity orient padding paddingLeft paddingRight patternUnits r refX refY role scope slope src startOffset stdDeviation stroke stroke-linecap stroke-width style tableValues result rowspan summary target tabindex text-align textAnchor textLength title type valign width x x1 x2 y y1 y2 zIndex".split(" "),R.allowedReferences="https:// http:// mailto: / ../ ./ #".split(" "),R.allowedTags="a abbr b br button caption circle clipPath code dd defs div dl dt em feComponentTransfer feFuncA feFuncB feFuncG feFuncR feGaussianBlur feOffset feMerge feMergeNode filter h1 h2 h3 h4 h5 h6 hr i img li linearGradient marker ol p path pattern pre rect small span stop strong style sub sup svg table text thead tbody tspan td th tr u ul #text".split(" "),R.emptyHTML=k,R}(),y}),s(a,"Core/FormatUtilities.js",[a["Core/DefaultOptions.js"],a["Core/Utilities.js"]],function(l,c){function u(w,T,k,O){w=+w||0,T=+T;var R=d.lang,M=(w.toString().split(".")[1]||"").split("e")[0].length,N=w.toString().split("e"),D=T;if(T===-1)T=Math.min(M,20);else if(!y(T))T=2;else if(T&&N[1]&&0>N[1]){var P=T+ +N[1];0<=P?(N[0]=(+N[0]).toExponential(P).split("e")[0],T=P):(N[0]=N[0].split(".")[0]||0,w=20>T?(N[0]*Math.pow(10,N[1])).toFixed(T):0,N[1]=0)}P=(Math.abs(N[1]?N[0]:w)+Math.pow(10,-Math.max(T,M)-1)).toFixed(T),M=String(E(P));var I=3w?"-":"")+(I?M.substr(0,I)+O:""),w=0>+N[1]&&!D?"0":w+M.substr(I).replace(/(\d{3})(?=\d)/g,"$1"+O),T&&(w+=k+P.slice(-T)),N[1]&&+w!=0&&(w+="e"+N[1]),w}var d=l.defaultOptions,m=l.defaultTime,g=c.getNestedProperty,y=c.isNumber,_=c.pick,E=c.pInt;return{dateFormat:function(w,T,k){return m.dateFormat(w,T,k)},format:function(w,T,k){var O="{",R=!1,M=/f$/,N=/\.([0-9])/,D=d.lang,P=k&&k.time||m;k=k&&k.numberFormatter||u;for(var I=[];w;){var L=w.indexOf(O);if(L===-1)break;var F=w.slice(0,L);if(R){if(F=F.split(":"),O=g(F.shift()||"",T),F.length&&typeof O=="number")if(F=F.join(":"),M.test(F)){var U=parseInt((F.match(N)||["","-1"])[1],10);O!==null&&(O=k(O,U,D.decimalPoint,-1k){for(d(_,O),P=M=0;P<=k;)P+=_[M].size,M++;D=_.splice(M-1,_.length)}for(d(_,R),_=_.map(function(I){return{size:I.size,targets:[I.target],align:u(I.align,.5)}});N;){for(M=_.length;M--;)k=_[M],O=(Math.min.apply(0,k.targets)+Math.max.apply(0,k.targets))/2,k.pos=c(O-k.size*k.align,0,E-k.size);for(M=_.length,N=!1;M--;)0_[M].pos&&(_[M-1].size+=_[M].size,_[M-1].targets=_[M-1].targets.concat(_[M].targets),_[M-1].align=.5,_[M-1].pos+_[M-1].size>E&&(_[M-1].pos=E-_[M-1].size),_.splice(M,1),N=!0)}return T.push.apply(T,D),M=0,_.some(function(I){var L=0;return(I.targets||[]).some(function(){return T[M].pos=I.pos+L,typeof w<"u"&&Math.abs(T[M].pos-T[M].target)>w?(T.slice(0,M+1).forEach(function(F){return delete F.pos}),T.reducedLen=(T.reducedLen||E)-.1*E,T.reducedLen>.1*E&&y(T,E,w),!0):(L+=T[M].size,M++,!1)})}),d(T,R),T}g.distribute=y}(m||(m={})),m}),s(a,"Core/Renderer/SVG/SVGElement.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Renderer/HTML/AST.js"],a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(l,c,u,d,m){var g=l.animate,y=l.animObject,_=l.stop,E=d.deg2rad,w=d.doc,T=d.noop,k=d.svg,O=d.SVG_NS,R=d.win,M=m.addEvent,N=m.attr,D=m.createElement,P=m.css,I=m.defined,L=m.erase,F=m.extend,U=m.fireEvent,J=m.isArray,z=m.isFunction,ie=m.isNumber,ce=m.isString,Y=m.merge,B=m.objectEach,V=m.pick,Ge=m.pInt,St=m.syncTimeout,Dee=m.uniqueKey;return l=function(){function pee(){this.element=void 0,this.onEvents={},this.opacity=1,this.renderer=void 0,this.SVG_NS=O,this.symbolCustomAttribs="x y width height r start end innerR anchorX anchorY rounded".split(" ")}return pee.prototype._defaultGetter=function(jr){return jr=V(this[jr+"Value"],this[jr],this.element?this.element.getAttribute(jr):null,0),/^[\-0-9\.]+$/.test(jr)&&(jr=parseFloat(jr)),jr},pee.prototype._defaultSetter=function(jr,Tee,et){et.setAttribute(Tee,jr)},pee.prototype.add=function(jr){var Tee=this.renderer,et=this.element;if(jr&&(this.parentGroup=jr),this.parentInverted=jr&&jr.inverted,typeof this.textStr<"u"&&this.element.nodeName==="text"&&Tee.buildText(this),this.added=!0,!jr||jr.handleZ||this.zIndex)var ft=this.zIndexSetter();return ft||(jr?jr.element:Tee.box).appendChild(et),this.onAdd&&this.onAdd(),this},pee.prototype.addClass=function(jr,Tee){var et=Tee?"":this.attr("class")||"";return jr=(jr||"").split(/ /g).reduce(function(ft,yee){return et.indexOf(yee)===-1&&ft.push(yee),ft},et?[et]:[]).join(" "),jr!==et&&this.attr("class",jr),this},pee.prototype.afterSetters=function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)},pee.prototype.align=function(jr,Tee,et){var ft={},yee=this.renderer,ete=yee.alignedObjects,xte,Ote,nee;jr?(this.alignOptions=jr,this.alignByTranslate=Tee,(!et||ce(et))&&(this.alignTo=xte=et||"renderer",L(ete,this),ete.push(this),et=void 0)):(jr=this.alignOptions,Tee=this.alignByTranslate,xte=this.alignTo),et=V(et,yee[xte],xte==="scrollablePlotBox"?yee.plotBox:void 0,yee),xte=jr.align;var Wee=jr.verticalAlign;return yee=(et.x||0)+(jr.x||0),ete=(et.y||0)+(jr.y||0),xte==="right"?Ote=1:xte==="center"&&(Ote=2),Ote&&(yee+=(et.width-(jr.width||0))/Ote),ft[Tee?"translateX":"x"]=Math.round(yee),Wee==="bottom"?nee=1:Wee==="middle"&&(nee=2),nee&&(ete+=(et.height-(jr.height||0))/nee),ft[Tee?"translateY":"y"]=Math.round(ete),this[this.placed?"animate":"attr"](ft),this.placed=!0,this.alignAttr=ft,this},pee.prototype.alignSetter=function(jr){var Tee={left:"start",center:"middle",right:"end"};Tee[jr]&&(this.alignValue=jr,this.element.setAttribute("text-anchor",Tee[jr]))},pee.prototype.animate=function(jr,Tee,et){var ft=this,yee=y(V(Tee,this.renderer.globalAnimation,!0));return Tee=yee.defer,V(w.hidden,w.msHidden,w.webkitHidden,!1)&&(yee.duration=0),yee.duration!==0?(et&&(yee.complete=et),St(function(){ft.element&&g(ft,jr,yee)},Tee)):(this.attr(jr,void 0,et),B(jr,function(ete,xte){yee.step&&yee.step.call(this,ete,{prop:xte,pos:1,elem:this})},this)),this},pee.prototype.applyTextOutline=function(jr){var Tee=this.element;jr.indexOf("contrast")!==-1&&(jr=jr.replace(/contrast/g,this.renderer.getContrast(Tee.style.fill)));var et=jr.split(" ");if(jr=et[et.length-1],(et=et[0])&&et!=="none"&&d.svg){this.fakeTS=!0,this.ySetter=this.xSetter,et=et.replace(/(^[\d\.]+)(.*?)$/g,function(ete,xte,Ote){return 2*Number(xte)+Ote}),this.removeTextOutline();var ft=w.createElementNS(O,"tspan");N(ft,{class:"highcharts-text-outline",fill:jr,stroke:jr,"stroke-width":et,"stroke-linejoin":"round"}),[].forEach.call(Tee.childNodes,function(ete){var xte=ete.cloneNode(!0);xte.removeAttribute&&["fill","stroke","stroke-width","stroke"].forEach(function(Ote){return xte.removeAttribute(Ote)}),ft.appendChild(xte)});var yee=w.createElementNS(O,"tspan");yee.textContent="​",["x","y"].forEach(function(ete){var xte=Tee.getAttribute(ete);xte&&yee.setAttribute(ete,xte)}),ft.appendChild(yee),Tee.insertBefore(ft,Tee.firstChild)}},pee.prototype.attr=function(jr,Tee,et,ft){var yee=this.element,ete=this.symbolCustomAttribs,xte,Ote=this,nee,Wee;if(typeof jr=="string"&&typeof Tee<"u"){var Bee=jr;jr={},jr[Bee]=Tee}return typeof jr=="string"?Ote=(this[jr+"Getter"]||this._defaultGetter).call(this,jr,yee):(B(jr,function(Nte,_ee){nee=!1,ft||_(this,_ee),this.symbolName&&ete.indexOf(_ee)!==-1&&(xte||(this.symbolAttr(jr),xte=!0),nee=!0),!this.rotation||_ee!=="x"&&_ee!=="y"||(this.doTransform=!0),nee||(Wee=this[_ee+"Setter"]||this._defaultSetter,Wee.call(this,Nte,_ee,yee),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(_ee)&&this.updateShadows(_ee,Nte,Wee))},this),this.afterSetters()),et&&et.call(this),Ote},pee.prototype.clip=function(jr){return this.attr("clip-path",jr?"url("+this.renderer.url+"#"+jr.id+")":"none")},pee.prototype.crisp=function(jr,Tee){Tee=Tee||jr.strokeWidth||0;var et=Math.round(Tee)%2/2;return jr.x=Math.floor(jr.x||this.x||0)+et,jr.y=Math.floor(jr.y||this.y||0)+et,jr.width=Math.floor((jr.width||this.width||0)-2*et),jr.height=Math.floor((jr.height||this.height||0)-2*et),I(jr.strokeWidth)&&(jr.strokeWidth=Tee),jr},pee.prototype.complexColor=function(jr,Tee,et){var ft=this.renderer,yee,ete,xte,Ote,nee,Wee,Bee,Nte,_ee,st,Lee=[],$te;U(this.renderer,"complexColor",{args:arguments},function(){if(jr.radialGradient?ete="radialGradient":jr.linearGradient&&(ete="linearGradient"),ete){if(xte=jr[ete],nee=ft.gradients,Wee=jr.stops,_ee=et.radialReference,J(xte)&&(jr[ete]=xte={x1:xte[0],y1:xte[1],x2:xte[2],y2:xte[3],gradientUnits:"userSpaceOnUse"}),ete==="radialGradient"&&_ee&&!I(xte.gradientUnits)&&(Ote=xte,xte=Y(xte,ft.getRadialAttr(_ee,Ote),{gradientUnits:"userSpaceOnUse"})),B(xte,function(Iee,Rte){Rte!=="id"&&Lee.push(Rte,Iee)}),B(Wee,function(Iee){Lee.push(Iee)}),Lee=Lee.join(","),nee[Lee])st=nee[Lee].attr("id");else{xte.id=st=Dee();var Kee=nee[Lee]=ft.createElement(ete).attr(xte).add(ft.defs);Kee.radAttr=Ote,Kee.stops=[],Wee.forEach(function(Iee){Iee[1].indexOf("rgba")===0?(yee=u.parse(Iee[1]),Bee=yee.get("rgb"),Nte=yee.get("a")):(Bee=Iee[1],Nte=1),Iee=ft.createElement("stop").attr({offset:Iee[0],"stop-color":Bee,"stop-opacity":Nte}).add(Kee),Kee.stops.push(Iee)})}$te="url("+ft.url+"#"+st+")",et.setAttribute(Tee,$te),et.gradient=Lee,jr.toString=function(){return $te}}})},pee.prototype.css=function(jr){var Tee=this.styles,et={},ft=this.element,yee=["textOutline","textOverflow","width"],ete="",xte=!Tee;if(jr&&jr.color&&(jr.fill=jr.color),Tee&&B(jr,function(Wee,Bee){Tee&&Tee[Bee]!==Wee&&(et[Bee]=Wee,xte=!0)}),xte){if(Tee&&(jr=F(Tee,et)),jr){if(jr.width===null||jr.width==="auto")delete this.textWidth;else if(ft.nodeName.toLowerCase()==="text"&&jr.width)var Ote=this.textWidth=Ge(jr.width)}if(this.styles=jr,Ote&&!k&&this.renderer.forExport&&delete jr.width,ft.namespaceURI===this.SVG_NS){var nee=function(Wee,Bee){return"-"+Bee.toLowerCase()};B(jr,function(Wee,Bee){yee.indexOf(Bee)===-1&&(ete+=Bee.replace(/([A-Z])/g,nee)+":"+Wee+";")}),ete&&N(ft,"style",ete)}else P(ft,jr);this.added&&(this.element.nodeName==="text"&&this.renderer.buildText(this),jr&&jr.textOutline&&this.applyTextOutline(jr.textOutline))}return this},pee.prototype.dashstyleSetter=function(jr){var Tee=this["stroke-width"];if(Tee==="inherit"&&(Tee=1),jr=jr&&jr.toLowerCase()){var et=jr.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(jr=et.length;jr--;)et[jr]=""+Ge(et[jr])*V(Tee,NaN);jr=et.join(",").replace(/NaN/g,"none"),this.element.setAttribute("stroke-dasharray",jr)}},pee.prototype.destroy=function(){var jr=this,Tee=jr.element||{},et=jr.renderer,ft=Tee.ownerSVGElement,yee=et.isSVG&&Tee.nodeName==="SPAN"&&jr.parentGroup||void 0;if(Tee.onclick=Tee.onmouseout=Tee.onmouseover=Tee.onmousemove=Tee.point=null,_(jr),jr.clipPath&&ft){var ete=jr.clipPath;[].forEach.call(ft.querySelectorAll("[clip-path],[CLIP-PATH]"),function(xte){-1Bee.width)&&(Bee={width:0,height:0})}else Bee=this.htmlGetBBox();if(et.isSVG&&(jr=Bee.width,et=Bee.height,nee&&(Bee.height=et={"11px,17":14,"13px,20":16}[(Wee||"")+","+Math.round(et)]||et),Tee&&(nee=Tee*E,Bee.width=Math.abs(et*Math.sin(nee))+Math.abs(jr*Math.cos(nee)),Bee.height=Math.abs(et*Math.cos(nee))+Math.abs(jr*Math.sin(nee)))),Nte&&(ete===""||0]*>/g,"").replace(/</g,"<").replace(/>/g,">")},pee.prototype.toFront=function(){var jr=this.element;return jr.parentNode.appendChild(jr),this},pee.prototype.translate=function(jr,Tee){return this.attr({translateX:jr,translateY:Tee})},pee.prototype.updateShadows=function(jr,Tee,et){var ft=this.shadows;if(ft)for(var yee=ft.length;yee--;)et.call(ft[yee],jr==="height"?Math.max(Tee-(ft[yee].cutHeight||0),0):jr==="d"?this.d:Tee,jr,ft[yee])},pee.prototype.updateTransform=function(){var jr=this.scaleX,Tee=this.scaleY,et=this.inverted,ft=this.rotation,yee=this.matrix,ete=this.element,xte=this.translateX||0,Ote=this.translateY||0;et&&(xte+=this.width,Ote+=this.height),xte=["translate("+xte+","+Ote+")"],I(yee)&&xte.push("matrix("+yee.join(",")+")"),et?xte.push("rotate(90) scale(-1,1)"):ft&&xte.push("rotate("+ft+" "+V(this.rotationOriginX,ete.getAttribute("x"),0)+" "+V(this.rotationOriginY,ete.getAttribute("y")||0)+")"),(I(jr)||I(Tee))&&xte.push("scale("+V(jr,1)+" "+V(Tee,1)+")"),xte.length&&ete.setAttribute("transform",xte.join(" "))},pee.prototype.visibilitySetter=function(jr,Tee,et){jr==="inherit"?et.removeAttribute(Tee):this[Tee]!==jr&&et.setAttribute(Tee,jr),this[Tee]=jr},pee.prototype.xGetter=function(jr){return this.element.nodeName==="circle"&&(jr==="x"?jr="cx":jr==="y"&&(jr="cy")),this._defaultGetter(jr)},pee.prototype.zIndexSetter=function(jr,Tee){var et=this.renderer,ft=this.parentGroup,yee=(ft||et).element||et.box,ete=this.element;et=yee===et.box;var xte=!1,Ote=this.added,nee;if(I(jr)?(ete.setAttribute("data-z-index",jr),jr=+jr,this[Tee]===jr&&(Ote=!1)):I(this[Tee])&&ete.removeAttribute("data-z-index"),this[Tee]=jr,Ote){for((jr=this.zIndex)&&ft&&(ft.handleZ=!0),Tee=yee.childNodes,nee=Tee.length-1;0<=nee&&!xte;nee--){ft=Tee[nee],Ote=ft.getAttribute("data-z-index");var Wee=!I(Ote);ft!==ete&&(0>jr&&Wee&&!et&&!nee?(yee.insertBefore(ete,Tee[nee]),xte=!0):(Ge(Ote)<=jr||Wee&&(!I(jr)||0<=jr))&&(yee.insertBefore(ete,Tee[nee+1]||null),xte=!0))}xte||(yee.insertBefore(ete,Tee[et?3:0]||null),xte=!0)}return xte},pee}(),l.prototype["stroke-widthSetter"]=l.prototype.strokeSetter,l.prototype.yGetter=l.prototype.xGetter,l.prototype.matrixSetter=l.prototype.rotationOriginXSetter=l.prototype.rotationOriginYSetter=l.prototype.rotationSetter=l.prototype.scaleXSetter=l.prototype.scaleYSetter=l.prototype.translateXSetter=l.prototype.translateYSetter=l.prototype.verticalAlignSetter=function(pee,jr){this[jr]=pee,this.doTransform=!0},l}),s(a,"Core/Renderer/RendererRegistry.js",[a["Core/Globals.js"]],function(l){var c;return function(u){u.rendererTypes={};var d;u.getRendererType=function(m){return m===void 0&&(m=d),u.rendererTypes[m]||u.rendererTypes[d]},u.registerRendererType=function(m,g,y){u.rendererTypes[m]=g,(!d||y)&&(d=m,l.Renderer=g)}}(c||(c={})),c}),s(a,"Core/Renderer/SVG/SVGLabel.js",[a["Core/Renderer/SVG/SVGElement.js"],a["Core/Utilities.js"]],function(l,c){var u=this&&this.__extends||function(){var w=function(T,k){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var M in R)R.hasOwnProperty(M)&&(O[M]=R[M])},w(T,k)};return function(T,k){function O(){this.constructor=T}w(T,k),T.prototype=k===null?Object.create(k):(O.prototype=k.prototype,new O)}}(),d=c.defined,m=c.extend,g=c.isNumber,y=c.merge,_=c.pick,E=c.removeEvent;return function(w){function T(k,O,R,M,N,D,P,I,L,F){var U=w.call(this)||this;U.paddingLeftSetter=U.paddingSetter,U.paddingRightSetter=U.paddingSetter,U.init(k,"g"),U.textStr=O,U.x=R,U.y=M,U.anchorX=D,U.anchorY=P,U.baseline=L,U.className=F,U.addClass(F==="button"?"highcharts-no-tooltip":"highcharts-label"),F&&U.addClass("highcharts-"+F),U.text=k.text(void 0,0,0,I).attr({zIndex:1});var J;return typeof N=="string"&&((J=/^url\((.*?)\)$/.test(N))||U.renderer.symbols[N])&&(U.symbolKey=N),U.bBox=T.emptyBBox,U.padding=3,U.baselineOffset=0,U.needsBox=k.styledMode||J,U.deferredAttr={},U.alignFactor=0,U}return u(T,w),T.prototype.alignSetter=function(k){k={left:0,center:.5,right:1}[k],k!==this.alignFactor&&(this.alignFactor=k,this.bBox&&g(this.xSetting)&&this.attr({x:this.xSetting}))},T.prototype.anchorXSetter=function(k,O){this.anchorX=k,this.boxAttr(O,Math.round(k)-this.getCrispAdjust()-this.xSetting)},T.prototype.anchorYSetter=function(k,O){this.anchorY=k,this.boxAttr(O,k-this.ySetting)},T.prototype.boxAttr=function(k,O){this.box?this.box.attr(k,O):this.deferredAttr[k]=O},T.prototype.css=function(k){if(k){var O={};k=y(k),T.textProps.forEach(function(M){typeof k[M]<"u"&&(O[M]=k[M],delete k[M])}),this.text.css(O);var R="width"in O;"fontSize"in O||"fontWeight"in O?this.updateTextPadding():R&&this.updateBoxSize()}return l.prototype.css.call(this,k)},T.prototype.destroy=function(){E(this.element,"mouseenter"),E(this.element,"mouseleave"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),l.prototype.destroy.call(this)},T.prototype.fillSetter=function(k,O){k&&(this.needsBox=!0),this.fill=k,this.boxAttr(O,k)},T.prototype.getBBox=function(){this.textStr&&this.bBox.width===0&&this.bBox.height===0&&this.updateBoxSize();var k=this.padding,O=_(this.paddingLeft,k);return{width:this.width,height:this.height,x:this.bBox.x-O,y:this.bBox.y-k}},T.prototype.getCrispAdjust=function(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2},T.prototype.heightSetter=function(k){this.heightSetting=k},T.prototype.onAdd=function(){var k=this.textStr;this.text.add(this),this.attr({text:d(k)?k:"",x:this.x,y:this.y}),this.box&&d(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})},T.prototype.paddingSetter=function(k,O){g(k)?k!==this[O]&&(this[O]=k,this.updateTextPadding()):this[O]=void 0},T.prototype.rSetter=function(k,O){this.boxAttr(O,k)},T.prototype.shadow=function(k){return k&&!this.renderer.styledMode&&(this.updateBoxSize(),this.box&&this.box.shadow(k)),this},T.prototype.strokeSetter=function(k,O){this.stroke=k,this.boxAttr(O,k)},T.prototype["stroke-widthSetter"]=function(k,O){k&&(this.needsBox=!0),this["stroke-width"]=k,this.boxAttr(O,k)},T.prototype["text-alignSetter"]=function(k){this.textAlign=k},T.prototype.textSetter=function(k){typeof k<"u"&&this.text.attr({text:k}),this.updateTextPadding()},T.prototype.updateBoxSize=function(){var k=this.text.element.style,O={},R=this.padding,M=this.bBox=g(this.widthSetting)&&g(this.heightSetting)&&!this.textAlign||!d(this.text.textStr)?T.emptyBBox:this.text.getBBox();this.width=this.getPaddedWidth(),this.height=(this.heightSetting||M.height||0)+2*R,k=this.renderer.fontMetrics(k&&k.fontSize,this.text),this.baselineOffset=R+Math.min((this.text.firstLineMetrics||k).b,M.height||1/0),this.heightSetting&&(this.baselineOffset+=(this.heightSetting-k.h)/2),this.needsBox&&(this.box||(R=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect(),R.addClass((this.className==="button"?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),R.add(this)),R=this.getCrispAdjust(),O.x=R,O.y=(this.baseline?-this.baselineOffset:0)+R,O.width=Math.round(this.width),O.height=Math.round(this.height),this.box.attr(m(O,this.deferredAttr)),this.deferredAttr={})},T.prototype.updateTextPadding=function(){var k=this.text;this.updateBoxSize();var O=this.baseline?0:this.baselineOffset,R=_(this.paddingLeft,this.padding);d(this.widthSetting)&&this.bBox&&(this.textAlign==="center"||this.textAlign==="right")&&(R+={center:.5,right:1}[this.textAlign]*(this.widthSetting-this.bBox.width)),(R!==k.x||O!==k.y)&&(k.attr("x",R),k.hasBoxWidthChanged&&(this.bBox=k.getBBox(!0)),typeof O<"u"&&k.attr("y",O)),k.x=R,k.y=O},T.prototype.widthSetter=function(k){this.widthSetting=g(k)?k:void 0},T.prototype.getPaddedWidth=function(){var k=this.padding,O=_(this.paddingLeft,k);return k=_(this.paddingRight,k),(this.widthSetting||this.bBox.width||0)+O+k},T.prototype.xSetter=function(k){this.x=k,this.alignFactor&&(k-=this.alignFactor*this.getPaddedWidth(),this["forceAnimate:x"]=!0),this.xSetting=Math.round(k),this.attr("translateX",this.xSetting)},T.prototype.ySetter=function(k){this.ySetting=this.y=Math.round(k),this.attr("translateY",this.ySetting)},T.emptyBBox={width:0,height:0,x:0,y:0},T.textProps="color direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" "),T}(l)}),s(a,"Core/Renderer/SVG/Symbols.js",[a["Core/Utilities.js"]],function(l){function c(_,E,w,T,k){var O=[];if(k){var R=k.start||0,M=y(k.r,w);w=y(k.r,T||w);var N=(k.end||0)-.001;T=k.innerR;var D=y(k.open,.001>Math.abs((k.end||0)-R-2*Math.PI)),P=Math.cos(R),I=Math.sin(R),L=Math.cos(N),F=Math.sin(N);R=y(k.longArc,.001>N-R-Math.PI?0:1),O.push(["M",_+M*P,E+w*I],["A",M,w,0,R,y(k.clockwise,1),_+M*L,E+w*F]),m(T)&&O.push(D?["M",_+T*L,E+T*F]:["L",_+T*L,E+T*F],["A",T,T,0,R,m(k.clockwise)?1-k.clockwise:0,_+T*P,E+T*I]),D||O.push(["Z"])}return O}function u(_,E,w,T,k){return k&&k.r?d(_,E,w,T,k):[["M",_,E],["L",_+w,E],["L",_+w,E+T],["L",_,E+T],["Z"]]}function d(_,E,w,T,k){return k=k&&k.r||0,[["M",_+k,E],["L",_+w-k,E],["C",_+w,E,_+w,E,_+w,E+k],["L",_+w,E+T-k],["C",_+w,E+T,_+w,E+T,_+w-k,E+T],["L",_+k,E+T],["C",_,E+T,_,E+T,_,E+T-k],["L",_,E+k],["C",_,E,_,E,_+k,E]]}var m=l.defined,g=l.isNumber,y=l.pick;return{arc:c,callout:function(_,E,w,T,k){var O=Math.min(k&&k.r||0,w,T),R=O+6,M=k&&k.anchorX;k=k&&k.anchorY||0;var N=d(_,E,w,T,{r:O});return g(M)&&(_+M>=w?k>E+R&&k=_+M?k>E+R&&kT&&M>_+R&&M<_+w-R?N.splice(5,1,["L",M+6,E+T],["L",M,E+T+6],["L",M-6,E+T],["L",_+O,E+T]):k&&0>k&&M>_+R&&M<_+w-R&&N.splice(1,1,["L",M-6,E],["L",M,E-6],["L",M+6,E],["L",w-O,E])),N},circle:function(_,E,w,T){return c(_+w/2,E+T/2,w/2,T/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},diamond:function(_,E,w,T){return[["M",_+w/2,E],["L",_+w,E+T/2],["L",_+w/2,E+T],["L",_,E+T/2],["Z"]]},rect:u,roundedRect:d,square:u,triangle:function(_,E,w,T){return[["M",_+w/2,E],["L",_+w,E+T],["L",_,E+T],["Z"]]},"triangle-down":function(_,E,w,T){return[["M",_,E],["L",_+w,E],["L",_+w/2,E+T],["Z"]]}}}),s(a,"Core/Renderer/SVG/TextBuilder.js",[a["Core/Renderer/HTML/AST.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(l,c,u){var d=c.doc,m=c.SVG_NS,g=c.win,y=u.attr,_=u.isString,E=u.objectEach,w=u.pick;return function(){function T(k){var O=k.styles;this.renderer=k.renderer,this.svgElement=k,this.width=k.textWidth,this.textLineHeight=O&&O.lineHeight,this.textOutline=O&&O.textOutline,this.ellipsis=!(!O||O.textOverflow!=="ellipsis"),this.noWrap=!(!O||O.whiteSpace!=="nowrap"),this.fontSize=O&&O.fontSize}return T.prototype.buildSVG=function(){var k=this.svgElement,O=k.element,R=k.renderer,M=w(k.textStr,"").toString(),N=M.indexOf("<")!==-1,D=O.childNodes;R=this.width&&!k.added&&R.box;var P=//g,I=[M,this.ellipsis,this.noWrap,this.textLineHeight,this.textOutline,this.fontSize,this.width].join();if(I!==k.textCache){for(k.textCache=I,delete k.actualWidth,I=D.length;I--;)O.removeChild(D[I]);N||this.ellipsis||this.width||M.indexOf(" ")!==-1&&(!this.noWrap||P.test(M))?M!==""&&(R&&R.appendChild(O),M=new l(M),this.modifyTree(M.nodes),M.addToDOM(k.element),this.modifyDOM(),this.ellipsis&&(O.textContent||"").indexOf("…")!==-1&&k.attr("title",this.unescapeEntities(k.textStr||"",["<",">"])),R&&R.removeChild(O)):O.appendChild(d.createTextNode(this.unescapeEntities(M))),_(this.textOutline)&&k.applyTextOutline&&k.applyTextOutline(this.textOutline)}},T.prototype.modifyDOM=function(){var k=this,O=this.svgElement,R=y(O.element,"x");O.firstLineMetrics=void 0;for(var M;(M=O.element.firstChild)&&/^[\s\u200B]*$/.test(M.textContent||" ");)O.element.removeChild(M);[].forEach.call(O.element.querySelectorAll("tspan.highcharts-br"),function(I,L){I.nextSibling&&I.previousSibling&&(L===0&&I.previousSibling.nodeType===1&&(O.firstLineMetrics=O.renderer.fontMetrics(void 0,I.previousSibling)),y(I,{dy:k.getLineHeight(I.nextSibling),x:R}))});var N=this.width||0;if(N){var D=function(I,L){var F=I.textContent||"",U=F.replace(/([^\^])-/g,"$1- ").split(" "),J=!k.noWrap&&(1"u")if(Ge.getSubStringLength)try{F[V]=M+Ge.getSubStringLength(0,R?V+1:V)}catch{}else I.getSpanWidth&&(k.textContent=D(O||R,B),F[V]=M+I.getSpanWidth(P,k));return F[V]};P.rotation=0;var Y=ce(k.textContent.length);if(M+Y>N){for(;U<=J;)z=Math.ceil((U+J)/2),R&&(ie=D(R,z)),Y=ce(z,ie&&ie.length-1),U===J?U=J+1:Y>N?J=z-1:U=z;J===0?k.textContent="":O&&J===O.length-1||(k.textContent=ie||D(O||R,z))}R&&R.splice(0,z),P.actualWidth=Y,P.rotation=L},T.prototype.unescapeEntities=function(k,O){return E(this.renderer.escapes,function(R,M){O&&O.indexOf(R)!==-1||(k=k.toString().replace(new RegExp(R,"g"),M))}),k},T}()}),s(a,"Core/Renderer/SVG/SVGRenderer.js",[a["Core/Renderer/HTML/AST.js"],a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Renderer/RendererRegistry.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Renderer/SVG/SVGLabel.js"],a["Core/Renderer/SVG/Symbols.js"],a["Core/Renderer/SVG/TextBuilder.js"],a["Core/Utilities.js"]],function(l,c,u,d,m,g,y,_,E){var w=u.charts,T=u.deg2rad,k=u.doc,O=u.isFirefox,R=u.isMS,M=u.isWebKit,N=u.noop,D=u.SVG_NS,P=u.symbolSizes,I=u.win,L=E.addEvent,F=E.attr,U=E.createElement,J=E.css,z=E.defined,ie=E.destroyObjectProperties,ce=E.extend,Y=E.isArray,B=E.isNumber,V=E.isObject,Ge=E.isString,St=E.merge,Dee=E.pick,pee=E.pInt,jr=E.uniqueKey,Tee;return u=function(){function et(ft,yee,ete,xte,Ote,nee,Wee){this.width=this.url=this.style=this.isSVG=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex=this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0,this.init(ft,yee,ete,xte,Ote,nee,Wee)}return et.prototype.init=function(ft,yee,ete,xte,Ote,nee,Wee){var Bee=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"}),Nte=Bee.element;Wee||Bee.css(this.getStyle(xte)),ft.appendChild(Nte),F(ft,"dir","ltr"),ft.innerHTML.indexOf("xmlns")===-1&&F(Nte,"xmlns",this.SVG_NS),this.isSVG=!0,this.box=Nte,this.boxWrapper=Bee,this.alignedObjects=[],this.url=this.getReferenceURL(),this.createElement("desc").add().element.appendChild(k.createTextNode("Created with Highcharts 9.3.3")),this.defs=this.createElement("defs").add(),this.allowHTML=nee,this.forExport=Ote,this.styledMode=Wee,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(yee,ete,!1);var _ee;O&&ft.getBoundingClientRect&&(yee=function(){J(ft,{left:0,top:0}),_ee=ft.getBoundingClientRect(),J(ft,{left:Math.ceil(_ee.left)-_ee.left+"px",top:Math.ceil(_ee.top)-_ee.top+"px"})},yee(),this.unSubPixelFix=L(I,"resize",yee))},et.prototype.definition=function(ft){return new l([ft]).addToDOM(this.defs.element)},et.prototype.getReferenceURL=function(){if((O||M)&&k.getElementsByTagName("base").length){if(!z(Tee)){var ft=jr();ft=new l([{tagName:"svg",attributes:{width:8,height:8},children:[{tagName:"defs",children:[{tagName:"clipPath",attributes:{id:ft},children:[{tagName:"rect",attributes:{width:4,height:4}}]}]},{tagName:"rect",attributes:{id:"hitme",width:8,height:8,"clip-path":"url(#"+ft+")",fill:"rgba(0,0,0,0.001)"}}]}]).addToDOM(k.body),J(ft,{position:"fixed",top:0,left:0,zIndex:9e5});var yee=k.elementFromPoint(6,6);Tee=(yee&&yee.id)==="hitme",k.body.removeChild(ft)}if(Tee)return I.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20")}return""},et.prototype.getStyle=function(ft){return this.style=ce({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},ft)},et.prototype.setStyle=function(ft){this.boxWrapper.css(this.getStyle(ft))},et.prototype.isHidden=function(){return!this.boxWrapper.getBBox().width},et.prototype.destroy=function(){var ft=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),ie(this.gradients||{}),this.gradients=null,ft&&(this.defs=ft.destroy()),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null},et.prototype.createElement=function(ft){var yee=new this.Element;return yee.init(this,ft),yee},et.prototype.getRadialAttr=function(ft,yee){return{cx:ft[0]-ft[2]/2+(yee.cx||0)*ft[2],cy:ft[1]-ft[2]/2+(yee.cy||0)*ft[2],r:(yee.r||0)*ft[2]}},et.prototype.buildText=function(ft){new _(ft).buildSVG()},et.prototype.getContrast=function(ft){return ft=c.parse(ft).rgba,ft[0]*=1,ft[1]*=1.2,ft[2]*=.5,459"u"?{}:{x:ft,y:yee,r:ete},yee=this.createElement("circle"),yee.xSetter=yee.ySetter=function(xte,Ote,nee){nee.setAttribute("c"+Ote,xte)},yee.attr(ft)},et.prototype.arc=function(ft,yee,ete,xte,Ote,nee){return V(ft)?(xte=ft,yee=xte.y,ete=xte.r,ft=xte.x):xte={innerR:xte,start:Ote,end:nee},ft=this.symbol("arc",ft,yee,ete,ete,xte),ft.r=ete,ft},et.prototype.rect=function(ft,yee,ete,xte,Ote,nee){Ote=V(ft)?ft.r:Ote;var Wee=this.createElement("rect");return ft=V(ft)?ft:typeof ft>"u"?{}:{x:ft,y:yee,width:Math.max(ete,0),height:Math.max(xte,0)},this.styledMode||(typeof nee<"u"&&(ft["stroke-width"]=nee,ft=Wee.crisp(ft)),ft.fill="none"),Ote&&(ft.r=Ote),Wee.rSetter=function(Bee,Nte,_ee){Wee.r=Bee,F(_ee,{rx:Bee,ry:Bee})},Wee.rGetter=function(){return Wee.r||0},Wee.attr(ft)},et.prototype.setSize=function(ft,yee,ete){this.width=ft,this.height=yee,this.boxWrapper.animate({width:ft,height:yee},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:Dee(ete,!0)?void 0:0}),this.alignElements()},et.prototype.g=function(ft){var yee=this.createElement("g");return ft?yee.attr({class:"highcharts-"+ft}):yee},et.prototype.image=function(ft,yee,ete,xte,Ote,nee){var Wee={preserveAspectRatio:"none"},Bee=function(_ee,st){_ee.setAttributeNS?_ee.setAttributeNS("http://www.w3.org/1999/xlink","href",st):_ee.setAttribute("hc-svg-href",st)};B(yee)&&(Wee.x=yee),B(ete)&&(Wee.y=ete),B(xte)&&(Wee.width=xte),B(Ote)&&(Wee.height=Ote);var Nte=this.createElement("image").attr(Wee);return yee=function(_ee){Bee(Nte.element,ft),nee.call(Nte,_ee)},nee?(Bee(Nte.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ete=new I.Image,L(ete,"load",yee),ete.src=ft,ete.complete&&yee({})):Bee(Nte.element,ft),Nte},et.prototype.symbol=function(ft,yee,ete,xte,Ote,nee){var Wee=this,Bee=/^url\((.*?)\)$/,Nte=Bee.test(ft),_ee=!Nte&&(this.symbols[ft]?ft:"circle"),st=_ee&&this.symbols[_ee],Lee;if(st){typeof yee=="number"&&(Lee=st.call(this.symbols,Math.round(yee||0),Math.round(ete||0),xte||0,Ote||0,nee));var $te=this.path(Lee);Wee.styledMode||$te.attr("fill","none"),ce($te,{symbolName:_ee||void 0,x:yee,y:ete,width:xte,height:Ote}),nee&&ce($te,nee)}else if(Nte){var Kee=ft.match(Bee)[1],Iee=$te=this.image(Kee);Iee.imgwidth=Dee(P[Kee]&&P[Kee].width,nee&&nee.width),Iee.imgheight=Dee(P[Kee]&&P[Kee].height,nee&&nee.height);var Rte=function(dee){return dee.attr({width:dee.width,height:dee.height})};["width","height"].forEach(function(dee){Iee[dee+"Setter"]=function(fee,Oee){var xee=this["img"+Oee];this[Oee]=fee,z(xee)&&(nee&&nee.backgroundSize==="within"&&this.width&&this.height&&(xee=Math.round(xee*Math.min(this.width/this.imgwidth,this.height/this.imgheight))),this.element&&this.element.setAttribute(Oee,xee),this.alignByTranslate||(fee=((this[Oee]||0)-xee)/2,this.attr(Oee==="width"?{translateX:fee}:{translateY:fee})))}}),z(yee)&&Iee.attr({x:yee,y:ete}),Iee.isImg=!0,z(Iee.imgwidth)&&z(Iee.imgheight)?Rte(Iee):(Iee.attr({width:0,height:0}),U("img",{onload:function(){var dee=w[Wee.chartIndex];this.width===0&&(J(this,{position:"absolute",top:"-999em"}),k.body.appendChild(this)),P[Kee]={width:this.width,height:this.height},Iee.imgwidth=this.width,Iee.imgheight=this.height,Iee.element&&Rte(Iee),this.parentNode&&this.parentNode.removeChild(this),Wee.imgCount--,!Wee.imgCount&&dee&&!dee.hasLoaded&&dee.onload()},src:Kee}),this.imgCount++)}return $te},et.prototype.clipRect=function(ft,yee,ete,xte){var Ote=jr()+"-",nee=this.createElement("clipPath").attr({id:Ote}).add(this.defs);return ft=this.rect(ft,yee,ete,xte,0).add(nee),ft.id=Ote,ft.clipPath=nee,ft.count=0,ft},et.prototype.text=function(ft,yee,ete,xte){var Ote={};return xte&&(this.allowHTML||!this.forExport)?this.html(ft,yee,ete):(Ote.x=Math.round(yee||0),ete&&(Ote.y=Math.round(ete)),z(ft)&&(Ote.text=ft),ft=this.createElement("text").attr(Ote),(!xte||this.forExport&&!this.allowHTML)&&(ft.xSetter=function(nee,Wee,Bee){for(var Nte=Bee.getElementsByTagName("tspan"),_ee=Bee.getAttribute(Wee),st=0,Lee;stft?ft+3:Math.round(1.2*ft),{h:yee,b:Math.round(.8*yee),f:ft}},et.prototype.rotCorr=function(ft,yee,ete){var xte=ft;return yee&&ete&&(xte=Math.max(xte*Math.cos(yee*T),4)),{x:-ft/3*Math.sin(yee*T),y:xte}},et.prototype.pathToSegments=function(ft){for(var yee=[],ete=[],xte={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},Ote=0;Ote":">","'":"'",'"':"""},symbols:y,draw:N}),d.registerRendererType("svg",u,!0),u}),s(a,"Core/Renderer/HTML/HTMLElement.js",[a["Core/Globals.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Utilities.js"]],function(l,c,u){var d=this&&this.__extends||function(){var R=function(M,N){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,P){D.__proto__=P}||function(D,P){for(var I in P)P.hasOwnProperty(I)&&(D[I]=P[I])},R(M,N)};return function(M,N){function D(){this.constructor=M}R(M,N),M.prototype=N===null?Object.create(N):(D.prototype=N.prototype,new D)}}(),m=l.isFirefox,g=l.isMS,y=l.isWebKit,_=l.win,E=u.css,w=u.defined,T=u.extend,k=u.pick,O=u.pInt;return function(R){function M(){return R!==null&&R.apply(this,arguments)||this}return d(M,R),M.compose=function(N){if(M.composedClasses.indexOf(N)===-1){M.composedClasses.push(N);var D=M.prototype,P=N.prototype;P.getSpanCorrection=D.getSpanCorrection,P.htmlCss=D.htmlCss,P.htmlGetBBox=D.htmlGetBBox,P.htmlUpdateTransform=D.htmlUpdateTransform,P.setSpanRotation=D.setSpanRotation}return N},M.prototype.getSpanCorrection=function(N,D,P){this.xCorr=-N*P,this.yCorr=-D},M.prototype.htmlCss=function(N){var D=this.element.tagName==="SPAN"&&N&&"width"in N,P=k(D&&N.width,void 0);if(D){delete N.width,this.textWidth=P;var I=!0}return N&&N.textOverflow==="ellipsis"&&(N.whiteSpace="nowrap",N.overflow="hidden"),this.styles=T(this.styles,N),E(this.element,N),I&&this.htmlUpdateTransform(),this},M.prototype.htmlGetBBox=function(){var N=this.element;return{x:N.offsetLeft,y:N.offsetTop,width:N.offsetWidth,height:N.offsetHeight}},M.prototype.htmlUpdateTransform=function(){if(this.added){var N=this.renderer,D=this.element,P=this.translateX||0,I=this.translateY||0,L=this.x||0,F=this.y||0,U=this.textAlign||"left",J={left:0,center:.5,right:1}[U],z=this.styles;if(z=z&&z.whiteSpace,E(D,{marginLeft:P,marginTop:I}),!N.styledMode&&this.shadows&&this.shadows.forEach(function(Ge){E(Ge,{marginLeft:P+1,marginTop:I+1})}),this.inverted&&[].forEach.call(D.childNodes,function(Ge){N.invertChild(Ge,D)}),D.tagName==="SPAN"){var ie=this.rotation,ce=this.textWidth&&O(this.textWidth),Y=[ie,U,D.innerHTML,this.textWidth,this.textAlign].join(),B=void 0;if(B=!1,ce!==this.oldTextWidth){if(this.textPxLength)var V=this.textPxLength;else E(D,{width:"",whiteSpace:z||"nowrap"}),V=D.offsetWidth;(ce>this.oldTextWidth||V>ce)&&(/[ \-]/.test(D.textContent||D.innerText)||D.style.textOverflow==="ellipsis")&&(E(D,{width:V>ce||ie?ce+"px":"auto",display:"block",whiteSpace:z||"normal"}),this.oldTextWidth=ce,B=!0)}this.hasBoxWidthChanged=B,Y!==this.cTT&&(B=N.fontMetrics(D.style.fontSize,D).b,!w(ie)||ie===(this.oldRotation||0)&&U===this.oldAlign||this.setSpanRotation(ie,J,B),this.getSpanCorrection(!w(ie)&&this.textPxLength||D.offsetWidth,B,J,ie,U)),E(D,{left:L+(this.xCorr||0)+"px",top:F+(this.yCorr||0)+"px"}),this.cTT=Y,this.oldRotation=ie,this.oldAlign=U}}else this.alignOnAdd=!0},M.prototype.setSpanRotation=function(N,D,P){var I={},L=g&&!/Edge/.test(_.navigator.userAgent)?"-ms-transform":y?"-webkit-transform":m?"MozTransform":_.opera?"-o-transform":void 0;L&&(I[L]=I.transform="rotate("+N+"deg)",I[L+(m?"Origin":"-origin")]=I.transformOrigin=100*D+"% "+P+"px",E(this.element,I))},M.composedClasses=[],M}(c)}),s(a,"Core/Renderer/HTML/HTMLRenderer.js",[a["Core/Renderer/HTML/AST.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Utilities.js"]],function(l,c,u,d){var m=this&&this.__extends||function(){var w=function(T,k){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var M in R)R.hasOwnProperty(M)&&(O[M]=R[M])},w(T,k)};return function(T,k){function O(){this.constructor=T}w(T,k),T.prototype=k===null?Object.create(k):(O.prototype=k.prototype,new O)}}(),g=d.attr,y=d.createElement,_=d.extend,E=d.pick;return function(w){function T(){return w!==null&&w.apply(this,arguments)||this}return m(T,w),T.compose=function(k){return T.composedClasses.indexOf(k)===-1&&(T.composedClasses.push(k),k.prototype.html=T.prototype.html),k},T.prototype.html=function(k,O,R){var M=this.createElement("span"),N=M.element,D=M.renderer,P=D.isSVG,I=function(L,F){["opacity","visibility"].forEach(function(U){L[U+"Setter"]=function(J,z,ie){var ce=L.div?L.div.style:F;c.prototype[U+"Setter"].call(this,J,z,ie),ce&&(ce[z]=J)}}),L.addedSetters=!0};return M.textSetter=function(L){L!==this.textStr&&(delete this.bBox,delete this.oldTextWidth,l.setElementHTML(this.element,E(L,"")),this.textStr=L,M.doTransform=!0)},P&&I(M,M.element.style),M.xSetter=M.ySetter=M.alignSetter=M.rotationSetter=function(L,F){F==="align"?M.alignValue=M.textAlign=L:M[F]=L,M.doTransform=!0},M.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)},M.attr({text:k,x:Math.round(O),y:Math.round(R)}).css({position:"absolute"}),D.styledMode||M.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),N.style.whiteSpace="nowrap",M.css=M.htmlCss,P&&(M.add=function(L){var F=D.box.parentNode,U=[];if(this.parentGroup=L){var J=L.div;if(!J){for(;L;)U.push(L),L=L.parentGroup;U.reverse().forEach(function(z){function ie(V,Ge){z[Ge]=V,Ge==="translateX"?B.left=V+"px":B.top=V+"px",z.doTransform=!0}var ce=g(z.element,"class"),Y=z.styles||{};J=z.div=z.div||y("div",ce?{className:ce}:void 0,{position:"absolute",left:(z.translateX||0)+"px",top:(z.translateY||0)+"px",display:z.display,opacity:z.opacity,cursor:Y.cursor,pointerEvents:Y.pointerEvents,visibility:z.visibility},J||F);var B=J.style;_(z,{classSetter:function(V){return function(Ge){this.element.setAttribute("class",Ge),V.className=Ge}}(J),on:function(){return U[0].div&&M.on.apply({element:U[0].div,onEvents:z.onEvents},arguments),z},translateXSetter:ie,translateYSetter:ie}),z.addedSetters||I(z)})}}else J=F;return J.appendChild(N),M.added=!0,M.alignOnAdd&&M.htmlUpdateTransform(),M}),M},T.composedClasses=[],T}(u)}),s(a,"Core/Axis/AxisDefaults.js",[],function(){var l;return function(c){c.defaultXAxisOptions={alignTicks:!0,allowDecimals:void 0,panningEnabled:!0,zIndex:2,zoomEnabled:!0,dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,gridLineDashStyle:"Solid",gridZIndex:1,labels:{autoRotation:void 0,autoRotationLimit:80,distance:void 0,enabled:!0,indentation:10,overflow:"justify",padding:5,reserveSpace:void 0,rotation:void 0,staggerLines:0,step:0,useHTML:!1,x:0,zIndex:7,style:{color:"#666666",cursor:"default",fontSize:"11px"}},maxPadding:.01,minorGridLineDashStyle:"Solid",minorTickLength:2,minorTickPosition:"outside",minPadding:.01,offset:void 0,opposite:!1,reversed:void 0,reversedStacks:!1,showEmpty:!0,showFirstLabel:!0,showLastLabel:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",rotation:0,useHTML:!1,x:0,y:0,style:{color:"#666666"}},type:"linear",uniqueNames:!0,visible:!0,minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",gridLineWidth:void 0,tickColor:"#ccd6eb"},c.defaultYAxisOptions={reversedStacks:!0,endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){var u=this.axis.chart.numberFormatter;return u(this.total,-1)},style:{color:"#000000",fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},c.defaultLeftAxisOptions={labels:{x:-15},title:{rotation:270}},c.defaultRightAxisOptions={labels:{x:15},title:{rotation:90}},c.defaultBottomAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},c.defaultTopAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}}}(l||(l={})),l}),s(a,"Core/Foundation.js",[a["Core/Utilities.js"]],function(l){var c=l.addEvent,u=l.isFunction,d=l.objectEach,m=l.removeEvent,g;return function(y){y.registerEventOptions=function(_,E){_.eventOptions=_.eventOptions||{},d(E.events,function(w,T){_.eventOptions[T]!==w&&(_.eventOptions[T]&&(m(_,T,_.eventOptions[T]),delete _.eventOptions[T]),u(w)&&(_.eventOptions[T]=w,c(_,T,w)))})}}(g||(g={})),g}),s(a,"Core/Axis/Tick.js",[a["Core/FormatUtilities.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(l,c,u){var d=c.deg2rad,m=u.clamp,g=u.correctFloat,y=u.defined,_=u.destroyObjectProperties,E=u.extend,w=u.fireEvent,T=u.isNumber,k=u.merge,O=u.objectEach,R=u.pick;return c=function(){function M(N,D,P,I,L){this.isNewLabel=this.isNew=!0,this.axis=N,this.pos=D,this.type=P||"",this.parameters=L||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,w(this,"init"),P||I||this.addLabel()}return M.prototype.addLabel=function(){var N=this,D=N.axis,P=D.options,I=D.chart,L=D.categories,F=D.logarithmic,U=D.names,J=N.pos,z=R(N.options&&N.options.labels,P.labels),ie=D.tickPositions,ce=J===ie[0],Y=J===ie[ie.length-1],B=(!z.step||z.step===1)&&D.tickInterval===1;ie=ie.info;var V=N.label,Ge;if(L=this.parameters.category||(L?R(L[J],U[J],J):J),F&&T(L)&&(L=g(F.lin2log(L))),D.dateTime)if(ie)var St=I.time.resolveDTLFormat(P.dateTimeLabelFormats[!P.grid&&ie.higherRanks[J]||ie.unitName]),Dee=St.main;else T(L)&&(Dee=D.dateTime.getXDateFormat(L,P.dateTimeLabelFormats||{}));N.isFirst=ce,N.isLast=Y;var pee={axis:D,chart:I,dateTimeLabelFormat:Dee,isFirst:ce,isLast:Y,pos:J,tick:N,tickPositionInfo:ie,value:L};w(this,"labelFormat",pee);var jr=function(et){return z.formatter?z.formatter.call(et,et):z.format?(et.text=D.defaultLabelFormatter.call(et),l.format(z.format,et,I)):D.defaultLabelFormatter.call(et,et)};P=jr.call(pee,pee);var Tee=St&&St.list;N.shortenLabel=Tee?function(){for(Ge=0;Gez&&I-ie*ceF&&(St=Math.round((L-I)/Math.cos(z*d))):(L=I+(1-ie)*ce,I-ie*ceF&&(V=F-N.x+V*ie,Ge=-1),V=Math.min(Y,V),VV||D.autoRotation&&(J.styles||{}).width)&&(St=V)),St&&(this.shortenLabel?this.shortenLabel():(B.width=Math.floor(St)+"px",(P.style||{}).textOverflow||(B.textOverflow="ellipsis"),J.css(B)))},M.prototype.moveLabel=function(N,D){var P=this,I=P.label,L=P.axis,F=L.reversed,U=!1;if(I&&I.textStr===N?(P.movedLabel=I,U=!0,delete P.label):O(L.ticks,function(z){U||z.isNew||z===P||!z.label||z.label.textStr!==N||(P.movedLabel=z.label,U=!0,z.labelPos=P.movedLabel.xy,delete z.label)}),!U&&(P.labelPos||I)){var J=P.labelPos||I.xy;I=L.horiz?F?0:L.width+L.left:J.x,L=L.horiz?J.y:F?L.width+L.left:0,P.movedLabel=P.createLabel({x:I,y:L},N,D),P.movedLabel&&P.movedLabel.attr({opacity:0})}},M.prototype.render=function(N,D,P){var I=this.axis,L=I.horiz,F=this.pos,U=R(this.tickmarkOffset,I.tickmarkOffset);F=this.getPosition(L,F,U,D),U=F.x;var J=F.y;I=L&&U===I.pos+I.len||!L&&J===I.pos?-1:1,L=R(P,this.label&&this.label.newOpacity,1),P=R(P,1),this.isActive=!0,this.renderGridLine(D,P,I),this.renderMark(F,P,I),this.renderLabel(F,D,L,N),this.isNew=!1,w(this,"afterRender")},M.prototype.renderGridLine=function(N,D,P){var I=this.axis,L=I.options,F={},U=this.pos,J=this.type,z=R(this.tickmarkOffset,I.tickmarkOffset),ie=I.chart.renderer,ce=this.gridLine,Y=L.gridLineWidth,B=L.gridLineColor,V=L.gridLineDashStyle;this.type==="minor"&&(Y=L.minorGridLineWidth,B=L.minorGridLineColor,V=L.minorGridLineDashStyle),ce||(I.chart.styledMode||(F.stroke=B,F["stroke-width"]=Y||0,F.dashstyle=V),J||(F.zIndex=1),N&&(D=0),this.gridLine=ce=ie.path().attr(F).addClass("highcharts-"+(J?J+"-":"")+"grid-line").add(I.gridGroup)),ce&&(P=I.getPlotLinePath({value:U+z,lineWidth:ce.strokeWidth()*P,force:"pass",old:N}))&&ce[N||this.isNew?"attr":"animate"]({d:P,opacity:D})},M.prototype.renderMark=function(N,D,P){var I=this.axis,L=I.options,F=I.chart.renderer,U=this.type,J=I.tickSize(U?U+"Tick":"tick"),z=N.x;N=N.y;var ie=R(L[U!=="minor"?"tickWidth":"minorTickWidth"],!U&&I.isXAxis?1:0);L=L[U!=="minor"?"tickColor":"minorTickColor"];var ce=this.mark,Y=!ce;J&&(I.opposite&&(J[0]=-J[0]),ce||(this.mark=ce=F.path().addClass("highcharts-"+(U?U+"-":"")+"tick").add(I.axisGroup),I.chart.styledMode||ce.attr({stroke:L,"stroke-width":ie})),ce[Y?"attr":"animate"]({d:this.getMarkPath(z,N,J[0],ce.strokeWidth()*P,I.horiz,F),opacity:D}))},M.prototype.renderLabel=function(N,D,P,I){var L=this.axis,F=L.horiz,U=L.options,J=this.label,z=U.labels,ie=z.step;L=R(this.tickmarkOffset,L.tickmarkOffset);var ce=N.x;N=N.y;var Y=!0;J&&T(ce)&&(J.xy=N=this.getLabelPosition(ce,N,J,F,z,L,I,ie),this.isFirst&&!this.isLast&&!U.showFirstLabel||this.isLast&&!this.isFirst&&!U.showLastLabel?Y=!1:!F||z.step||z.rotation||D||P===0||this.handleOverflow(N),ie&&I%ie&&(Y=!1),Y&&T(N.y)?(N.opacity=P,J[this.isNewLabel?"attr":"animate"](N),this.isNewLabel=!1):(J.attr("y",-9999),this.isNewLabel=!0))},M.prototype.replaceMovedLabel=function(){var N=this.label,D=this.axis,P=D.reversed;if(N&&!this.isNew){var I=D.horiz?P?D.left:D.width+D.left:N.xy.x;P=D.horiz?N.xy.y:P?D.width+D.top:D.top,N.animate({x:I,y:P,opacity:0},void 0,N.destroy),delete this.label}D.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel},M}(),c}),s(a,"Core/Axis/Axis.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Axis/AxisDefaults.js"],a["Core/Color/Color.js"],a["Core/DefaultOptions.js"],a["Core/Foundation.js"],a["Core/Globals.js"],a["Core/Axis/Tick.js"],a["Core/Utilities.js"]],function(l,c,u,d,m,g,y,_){var E=l.animObject,w=d.defaultOptions,T=m.registerEventOptions,k=g.deg2rad,O=_.arrayMax,R=_.arrayMin,M=_.clamp,N=_.correctFloat,D=_.defined,P=_.destroyObjectProperties,I=_.erase,L=_.error,F=_.extend,U=_.fireEvent,J=_.getMagnitude,z=_.isArray,ie=_.isNumber,ce=_.isString,Y=_.merge,B=_.normalizeTickInterval,V=_.objectEach,Ge=_.pick,St=_.relativeLength,Dee=_.removeEvent,pee=_.splat,jr=_.syncTimeout;return l=function(){function Tee(et,ft){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.eventOptions=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0,this.init(et,ft)}return Tee.prototype.init=function(et,ft){var yee=ft.isX;this.chart=et,this.horiz=et.inverted&&!this.isZAxis?!yee:yee,this.isXAxis=yee,this.coll=this.coll||(yee?"xAxis":"yAxis"),U(this,"init",{userOptions:ft}),this.opposite=Ge(ft.opposite,this.opposite),this.side=Ge(ft.side,this.side,this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(ft);var ete=this.options,xte=ete.labels,Ote=ete.type;this.userOptions=ft,this.minPixelPadding=0,this.reversed=Ge(ete.reversed,this.reversed),this.visible=ete.visible,this.zoomEnabled=ete.zoomEnabled,this.hasNames=Ote==="category"||ete.categories===!0,this.categories=ete.categories||this.hasNames,this.names||(this.names=[],this.names.keys={}),this.plotLinesAndBandsGroups={},this.positiveValuesOnly=!!this.logarithmic,this.isLinked=D(ete.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=ete.minRange||ete.maxZoom,this.range=ete.range,this.offset=ete.offset||0,this.min=this.max=null,ft=Ge(ete.crosshair,pee(et.options.tooltip.crosshairs)[yee?0:1]),this.crosshair=ft===!0?{}:ft,et.axes.indexOf(this)===-1&&(yee?et.axes.splice(et.xAxis.length,0,this):et.axes.push(this),et[this.coll].push(this)),this.series=this.series||[],et.inverted&&!this.isZAxis&&yee&&typeof this.reversed>"u"&&(this.reversed=!0),this.labelRotation=ie(xte.rotation)?xte.rotation:void 0,T(this,ete),U(this,"afterInit")},Tee.prototype.setOptions=function(et){this.options=Y(c.defaultXAxisOptions,this.coll==="yAxis"&&c.defaultYAxisOptions,[c.defaultTopAxisOptions,c.defaultRightAxisOptions,c.defaultBottomAxisOptions,c.defaultLeftAxisOptions][this.side],Y(w[this.coll],et)),U(this,"afterSetOptions",{userOptions:et})},Tee.prototype.defaultLabelFormatter=function(et){var ft=this.axis;et=this.chart.numberFormatter;var yee=ie(this.value)?this.value:NaN,ete=ft.chart.time,xte=this.dateTimeLabelFormat,Ote=w.lang,nee=Ote.numericSymbols;Ote=Ote.numericSymbolMagnitude||1e3;var Wee=ft.logarithmic?Math.abs(yee):ft.tickInterval,Bee=nee&&nee.length;if(ft.categories)var Nte=""+this.value;else if(xte)Nte=ete.dateFormat(xte,yee);else if(Bee&&1e3<=Wee)for(;Bee--&&typeof Nte>"u";)ft=Math.pow(Ote,Bee+1),Wee>=ft&&10*yee%ft===0&&nee[Bee]!==null&&yee!==0&&(Nte=et(yee/ft,-1)+nee[Bee]);return typeof Nte>"u"&&(Nte=1e4<=Math.abs(yee)?et(yee,-1):et(yee,-1,void 0,"")),Nte},Tee.prototype.getSeriesExtremes=function(){var et=this,ft=et.chart,yee;U(this,"getSeriesExtremes",null,function(){et.hasVisibleSeries=!1,et.dataMin=et.dataMax=et.threshold=null,et.softThreshold=!et.isXAxis,et.stacking&&et.stacking.buildStacks(),et.series.forEach(function(ete){if(ete.visible||!ft.options.chart.ignoreHiddenSeries){var xte=ete.options,Ote=xte.threshold;if(et.hasVisibleSeries=!0,et.positiveValuesOnly&&0>=Ote&&(Ote=null),et.isXAxis){if(xte=ete.xData,xte.length){xte=et.logarithmic?xte.filter(et.validatePositiveValue):xte,yee=ete.getXExtremes(xte);var nee=yee.min,Wee=yee.max;ie(nee)||nee instanceof Date||(xte=xte.filter(ie),yee=ete.getXExtremes(xte),nee=yee.min,Wee=yee.max),xte.length&&(et.dataMin=Math.min(Ge(et.dataMin,nee),nee),et.dataMax=Math.max(Ge(et.dataMax,Wee),Wee))}}else ete=ete.applyExtremes(),ie(ete.dataMin)&&(nee=ete.dataMin,et.dataMin=Math.min(Ge(et.dataMin,nee),nee)),ie(ete.dataMax)&&(Wee=ete.dataMax,et.dataMax=Math.max(Ge(et.dataMax,Wee),Wee)),D(Ote)&&(et.threshold=Ote),(!xte.softThreshold||et.positiveValuesOnly)&&(et.softThreshold=!1)}})}),U(this,"afterGetSeriesExtremes")},Tee.prototype.translate=function(et,ft,yee,ete,xte,Ote){var nee=this.linkedParent||this,Wee=ete&&nee.old?nee.old.min:nee.min,Bee=nee.minPixelPadding;xte=(nee.isOrdinal||nee.brokenAxis&&nee.brokenAxis.hasBreaks||nee.logarithmic&&xte)&&nee.lin2val;var Nte=1,_ee=0;return ete=ete&&nee.old?nee.old.transA:nee.transA,ete||(ete=nee.transA),yee&&(Nte*=-1,_ee=nee.len),nee.reversed&&(Nte*=-1,_ee-=Nte*(nee.sector||nee.len)),ft?(et=(et*Nte+_ee-Bee)/ete+Wee,xte&&(et=nee.lin2val(et))):(xte&&(et=nee.val2lin(et)),et=ie(Wee)?Nte*(et-Wee)*ete+_ee+Nte*Bee+(ie(Ote)?ete*Ote:0):void 0),et},Tee.prototype.toPixels=function(et,ft){return this.translate(et,!1,!this.horiz,null,!0)+(ft?0:this.pos)},Tee.prototype.toValue=function(et,ft){return this.translate(et-(ft?0:this.pos),!0,!this.horiz,null,!0)},Tee.prototype.getPlotLinePath=function(et){function ft(Oee,xee,kee){return($te!=="pass"&&Oeekee)&&($te?Oee=M(Oee,xee,kee):fee=!0),Oee}var yee=this,ete=yee.chart,xte=yee.left,Ote=yee.top,nee=et.old,Wee=et.value,Bee=et.lineWidth,Nte=nee&&ete.oldChartHeight||ete.chartHeight,_ee=nee&&ete.oldChartWidth||ete.chartWidth,st=yee.transB,Lee=et.translatedValue,$te=et.force,Kee,Iee,Rte,dee,fee;return et={value:Wee,lineWidth:Bee,old:nee,force:$te,acrossPanes:et.acrossPanes,translatedValue:Lee},U(this,"getPlotLinePath",et,function(Oee){Lee=Ge(Lee,yee.translate(Wee,null,null,nee)),Lee=M(Lee,-1e5,1e5),Kee=Rte=Math.round(Lee+st),Iee=dee=Math.round(Nte-Lee-st),ie(Lee)?yee.horiz?(Iee=Ote,dee=Nte-yee.bottom,Kee=Rte=ft(Kee,xte,xte+yee.width)):(Kee=xte,Rte=_ee-yee.right,Iee=dee=ft(Iee,Ote,Ote+yee.height)):(fee=!0,$te=!1),Oee.path=fee&&!$te?null:ete.renderer.crispLine([["M",Kee,Iee],["L",Rte,dee]],Bee||1)}),et.path},Tee.prototype.getLinearTickPositions=function(et,ft,yee){var ete=N(Math.floor(ft/et)*et);yee=N(Math.ceil(yee/et)*et);var xte=[],Ote;if(N(ete+et)===ete&&(Ote=20),this.single)return[ft];for(ft=ete;ft<=yee&&(xte.push(ft),ft=N(ft+et,Ote),ft!==nee);)var nee=ft;return xte},Tee.prototype.getMinorTickInterval=function(){var et=this.options;return et.minorTicks===!0?Ge(et.minorTickInterval,"auto"):et.minorTicks===!1?null:et.minorTickInterval},Tee.prototype.getMinorTickPositions=function(){var et=this.options,ft=this.tickPositions,yee=this.minorTickInterval,ete=this.pointRangePadding||0,xte=this.min-ete;ete=this.max+ete;var Ote=ete-xte,nee=[];if(Ote&&Ote/yee"u"&&!ft&&(D(et.min)||D(et.max)||D(et.floor)||D(et.ceiling)?this.minRange=null:(this.series.forEach(function(Lee){if(Wee=Lee.xData,Bee=Lee.xIncrement?1:Wee.length-1,1=this.minRange,_ee=this.minRange,st=(_ee-ete+yee)/2;st=[yee-st,Ge(et.min,yee-st)],Nte&&(st[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin),yee=O(st),ete=[yee+_ee,Ge(et.max,yee+_ee)],Nte&&(ete[2]=ft?ft.log2lin(this.dataMax):this.dataMax),ete=R(ete),ete-yee<_ee&&(st[0]=ete-_ee,st[1]=Ge(et.min,ete-_ee),yee=O(st))}this.min=yee,this.max=ete},Tee.prototype.getClosest=function(){var et;return this.categories?et=1:this.series.forEach(function(ft){var yee=ft.closestPointRange,ete=ft.visible||!ft.chart.options.chart.ignoreHiddenSeries;!ft.noSharedTooltip&&D(yee)&&ete&&(et=D(et)?Math.min(et,yee):yee)}),et},Tee.prototype.nameToX=function(et){var ft=z(this.categories),yee=ft?this.categories:this.names,ete=et.options.x;if(et.series.requireSorting=!1,D(ete)||(ete=this.options.uniqueNames?ft?yee.indexOf(et.name):Ge(yee.keys[et.name],-1):et.series.autoIncrement()),ete===-1){if(!ft)var xte=yee.length}else xte=ete;return typeof xte<"u"&&(this.names[xte]=et.name,this.names.keys[et.name]=xte),xte},Tee.prototype.updateNames=function(){var et=this,ft=this.names;0=Lee)Iee=Lee,_ee=0;else if(this.dataMax<=Lee){var Rte=Lee;Nte=0}}this.min=Ge($te,Iee,this.dataMin),this.max=Ge(Kee,Rte,this.dataMax)}if(yee&&(this.positiveValuesOnly&&!et&&0>=Math.min(this.min,Ge(this.dataMin,this.min))&&L(10,1,ft),this.min=N(yee.log2lin(this.min),16),this.max=N(yee.log2lin(this.max),16)),this.range&&D(this.max)&&(this.userMin=this.min=$te=Math.max(this.dataMin,this.minFromRange()),this.userMax=Kee=this.max,this.range=null),U(this,"foundExtremes"),this.beforePadding&&this.beforePadding(),this.adjustForMinRange(),!(Wee||this.axisPointRange||this.stacking&&this.stacking.usePercentage||Ote)&&D(this.min)&&D(this.max)&&(ft=this.max-this.min)&&(!D($te)&&_ee&&(this.min-=ft*_ee),!D(Kee)&&Nte&&(this.max+=ft*Nte)),ie(this.userMin)||(ie(ete.softMin)&&ete.softMinthis.max&&(this.max=Kee=ete.softMax),ie(ete.ceiling)&&(this.max=Math.min(this.max,ete.ceiling))),Bee&&D(this.dataMin)&&(Lee=Lee||0,!D($te)&&this.min=Lee?this.min=this.options.minRange?Math.min(Lee,this.max-this.minRange):Lee:!D(Kee)&&this.max>Lee&&this.dataMax<=Lee&&(this.max=this.options.minRange?Math.max(Lee,this.min+this.minRange):Lee)),ie(this.min)&&ie(this.max)&&!this.chart.polar&&this.min>this.max&&(D(this.options.min)?this.max=this.min:D(this.options.max)&&(this.min=this.max)),this.tickInterval=this.min===this.max||typeof this.min>"u"||typeof this.max>"u"?1:Ote&&this.linkedParent&&!st&&nee===this.linkedParent.options.tickPixelInterval?st=this.linkedParent.tickInterval:Ge(st,this.tickAmount?(this.max-this.min)/Math.max(this.tickAmount-1,1):void 0,Wee?1:(this.max-this.min)*nee/Math.max(this.len,nee)),xte&&!et){var dee=this.min!==(this.old&&this.old.min)||this.max!==(this.old&&this.old.max);this.series.forEach(function(fee){fee.forceCrop=fee.forceCropping&&fee.forceCropping(),fee.processData(dee)}),U(this,"postProcessData",{hasExtemesChanged:dee})}this.setAxisTranslation(),U(this,"initialAxisTranslation"),this.pointRange&&!st&&(this.tickInterval=Math.max(this.pointRange,this.tickInterval)),et=Ge(ete.minTickInterval,this.dateTime&&!this.series.some(function(fee){return fee.noSharedTooltip})?this.closestPointRange:0),!st&&this.tickIntervalthis.tickInterval||this.tickAmount!==void 0),!!this.tickAmount)),this.tickAmount||(this.tickInterval=this.unsquish()),this.setTickPositions()},Tee.prototype.setTickPositions=function(){var et=this.options,ft=et.tickPositions,yee=this.getMinorTickInterval(),ete=this.hasVerticalPanning(),xte=this.coll==="colorAxis",Ote=(xte||!ete)&&et.startOnTick;ete=(xte||!ete)&&et.endOnTick,xte=et.tickPositioner,this.tickmarkOffset=this.categories&&et.tickmarkPlacement==="between"&&this.tickInterval===1?.5:0,this.minorTickInterval=yee==="auto"&&this.tickInterval?this.tickInterval/5:yee,this.single=this.min===this.max&&D(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||et.allowDecimals!==!1),this.tickPositions=yee=ft&&ft.slice(),!yee&&(this.ordinal&&this.ordinal.positions||!((this.max-this.min)/this.tickInterval>Math.max(2*this.len,200))?yee=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,et.units),this.min,this.max,et.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(yee=[this.min,this.max],L(19,!1,this.chart)),yee.length>this.len&&(yee=[yee[0],yee.pop()],yee[0]===yee[1]&&(yee.length=1)),this.tickPositions=yee,xte&&(xte=xte.apply(this,[this.min,this.max])))&&(this.tickPositions=yee=xte),this.paddedTicks=yee.slice(0),this.trimTicks(yee,Ote,ete),this.isLinked||(this.single&&2>yee.length&&!this.categories&&!this.series.some(function(nee){return nee.is("heatmap")&&nee.options.pointPlacement==="between"})&&(this.min-=.5,this.max+=.5),ft||xte||this.adjustTickAmount()),U(this,"afterSetTickPositions")},Tee.prototype.trimTicks=function(et,ft,yee){var ete=et[0],xte=et[et.length-1],Ote=!this.isOrdinal&&this.minPointOffset||0;if(U(this,"trimTicks"),!this.isLinked){if(ft&&ete!==-1/0)this.min=ete;else for(;this.min-Ote>et[0];)et.shift();if(yee)this.max=xte;else for(;this.max+Oteyee&&(this.finalTickAmt=yee,yee=5),this.tickAmount=yee},Tee.prototype.adjustTickAmount=function(){var et=this.options,ft=this.tickInterval,yee=this.tickPositions,ete=this.tickAmount,xte=this.finalTickAmt,Ote=yee&&yee.length,nee=Ge(this.threshold,this.softThreshold?0:null);if(this.hasData()&&ie(this.min)&&ie(this.max)){if(Oteete&&(this.tickInterval*=2,this.setTickPositions());if(D(xte)){for(ft=et=yee.length;ft--;)(xte===3&&ft%2===1||2>=xte&&0Wee&&(Nte=Wee)),D(xte)&&(_eeWee&&(_ee=Wee))),yee.displayBtn=typeof Nte<"u"||typeof _ee<"u",yee.setExtremes(Nte,_ee,!1,void 0,{trigger:"zoom"})),Bee.zoomed=!0}),et.zoomed},Tee.prototype.setAxisSize=function(){var et=this.chart,ft=this.options,yee=ft.offsets||[0,0,0,0],ete=this.horiz,xte=this.width=Math.round(St(Ge(ft.width,et.plotWidth-yee[3]+yee[1]),et.plotWidth)),Ote=this.height=Math.round(St(Ge(ft.height,et.plotHeight-yee[0]+yee[2]),et.plotHeight)),nee=this.top=Math.round(St(Ge(ft.top,et.plotTop+yee[0]),et.plotHeight,et.plotTop));ft=this.left=Math.round(St(Ge(ft.left,et.plotLeft+yee[3]),et.plotWidth,et.plotLeft)),this.bottom=et.chartHeight-Ote-nee,this.right=et.chartWidth-xte-ft,this.len=Math.max(ete?xte:Ote,0),this.pos=ete?ft:nee},Tee.prototype.getExtremes=function(){var et=this.logarithmic;return{min:et?N(et.lin2log(this.min)):this.min,max:et?N(et.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},Tee.prototype.getThreshold=function(et){var ft=this.logarithmic,yee=ft?ft.lin2log(this.min):this.min;return ft=ft?ft.lin2log(this.max):this.max,et===null||et===-1/0?et=yee:et===1/0?et=ft:yee>et?et=yee:ftft?yee.align="right":195ft&&(yee.align="left")}),et.align},Tee.prototype.tickSize=function(et){var ft=this.options,yee=Ge(ft[et==="tick"?"tickWidth":"minorTickWidth"],et==="tick"&&this.isXAxis&&!this.categories?1:0),ete=ft[et==="tick"?"tickLength":"minorTickLength"];if(yee&&ete){ft[et+"Position"]==="inside"&&(ete=-ete);var xte=[ete,yee]}return et={tickSize:xte},U(this,"afterTickSize",et),et.tickSize},Tee.prototype.labelMetrics=function(){var et=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style.fontSize,this.ticks[et]&&this.ticks[et].label)},Tee.prototype.unsquish=function(){var et=this.options.labels,ft=this.horiz,yee=this.tickInterval,ete=this.len/(((this.categories?1:0)+this.max-this.min)/yee),xte=et.rotation,Ote=this.labelMetrics(),nee=Math.max(this.max-this.min,0),Wee=function($te){var Kee=$te/(ete||1);return Kee=1nee&&$te!==1/0&&ete!==1/0&&nee&&(Kee=Math.ceil(nee/yee)),N(Kee*yee)},Bee=yee,Nte,_ee,st=Number.MAX_VALUE;if(ft){if(!et.staggerLines&&!et.step)if(ie(xte))var Lee=[xte];else ete=$te){_ee=Wee(Math.abs(Ote.h/Math.sin(k*$te)));var Kee=_ee+Math.abs($te/360);Keeete.step)return ete.rotation?0:(this.staggerLines||1)*this.len/xte;if(!yee){if(et=ete.style.width,et!==void 0)return parseInt(String(et),10);if(Ote)return Ote-ft.spacing[3]}return .33*ft.chartWidth},Tee.prototype.renderUnsquish=function(){var et=this.chart,ft=et.renderer,yee=this.tickPositions,ete=this.ticks,xte=this.options.labels,Ote=xte.style,nee=this.horiz,Wee=this.getSlotWidth(),Bee=Math.max(1,Math.round(Wee-2*xte.padding)),Nte={},_ee=this.labelMetrics(),st=Ote.textOverflow,Lee=0;if(ce(xte.rotation)||(Nte.rotation=xte.rotation||0),yee.forEach(function(Rte){Rte=ete[Rte],Rte.movedLabel&&Rte.replaceMovedLabel(),Rte&&Rte.label&&Rte.label.textPxLength>Lee&&(Lee=Rte.label.textPxLength)}),this.maxLabelLength=Lee,this.autoRotation)Lee>Bee&&Lee>_ee.h?Nte.rotation=this.labelRotation:this.labelRotation=0;else if(Wee){var $te=Bee;if(!st){var Kee="clip";for(Bee=yee.length;!nee&&Bee--;){var Iee=yee[Bee];(Iee=ete[Iee].label)&&(Iee.styles&&Iee.styles.textOverflow==="ellipsis"?Iee.css({textOverflow:"clip"}):Iee.textPxLength>Wee&&Iee.css({width:Wee+"px"}),Iee.getBBox().height>this.len/yee.length-(_ee.h-_ee.f)&&(Iee.specificTextOverflow="ellipsis"))}}}Nte.rotation&&($te=Lee>.5*et.chartHeight?.33*et.chartHeight:Lee,st||(Kee="ellipsis")),(this.labelAlign=xte.align||this.autoLabelAlign(this.labelRotation))&&(Nte.align=this.labelAlign),yee.forEach(function(Rte){var dee=(Rte=ete[Rte])&&Rte.label,fee=Ote.width,Oee={};dee&&(dee.attr(Nte),Rte.shortenLabel?Rte.shortenLabel():$te&&!fee&&Ote.whiteSpace!=="nowrap"&&($te=this.min&&et<=this.max||this.grid&&this.grid.isColumn)&&(ete[et]||(ete[et]=new y(this,et)),yee&&ete[et].isNew&&ete[et].render(ft,!0,-1),ete[et].render(ft))},Tee.prototype.render=function(){var et=this,ft=et.chart,yee=et.logarithmic,ete=et.options,xte=et.isLinked,Ote=et.tickPositions,nee=et.axisTitle,Wee=et.ticks,Bee=et.minorTicks,Nte=et.alternateBands,_ee=ete.stackLabels,st=ete.alternateGridColor,Lee=et.tickmarkOffset,$te=et.axisLine,Kee=et.showAxis,Iee=E(ft.renderer.globalAnimation),Rte,dee;if(et.labelEdge.length=0,et.overlap=!1,[Wee,Bee,Nte].forEach(function(Oee){V(Oee,function(xee){xee.isActive=!1})}),et.hasData()||xte){var fee=et.chart.hasRendered&&et.old&&ie(et.old.min);et.minorTickInterval&&!et.categories&&et.getMinorTickPositions().forEach(function(Oee){et.renderMinorTick(Oee,fee)}),Ote.length&&(Ote.forEach(function(Oee,xee){et.renderTick(Oee,xee,fee)}),Lee&&(et.min===0||et.single)&&(Wee[-1]||(Wee[-1]=new y(et,-1,null,!0)),Wee[-1].render(-1))),st&&Ote.forEach(function(Oee,xee){dee=typeof Ote[xee+1]<"u"?Ote[xee+1]+Lee:et.max-Lee,xee%2===0&&OeeR&&(!N||I<=M)&&typeof I<"u"&&L.push(I),I>M&&(J=!0),I=ie}}}else R=this.lin2log(R),M=this.lin2log(M),O=N?D.getMinorTickInterval():I.tickInterval,O=m(O==="auto"?null:O,this.minorAutoInterval,I.tickPixelInterval/(N?5:1)*(M-R)/((N?P/D.tickPositions.length:P)||1)),O=d(O,void 0,u(O)),L=D.getLinearTickPositions(O,R,M).map(this.log2lin),N||(this.minorAutoInterval=O/5);return N||(D.tickInterval=O),L},k.prototype.lin2log=function(O){return Math.pow(10,O)},k.prototype.log2lin=function(O){return Math.log(O)/Math.LN10},k}();y.Additions=T}(g||(g={})),g}),s(a,"Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js",[a["Core/Utilities.js"]],function(l){var c=l.erase,u=l.extend,d=l.isNumber,m;return function(g){var y=[],_;g.compose=function(w,T){return _||(_=w),y.indexOf(T)===-1&&(y.push(T),u(T.prototype,E.prototype)),T};var E=function(){function w(){}return w.prototype.getPlotBandPath=function(T,k,O){O===void 0&&(O=this.options);var R=this.getPlotLinePath({value:k,force:!0,acrossPanes:O.acrossPanes}),M=[],N=this.horiz;if(k=!d(this.min)||!d(this.max)||Tthis.max&&k>this.max,T=this.getPlotLinePath({value:T,force:!0,acrossPanes:O.acrossPanes}),O=1,T&&R){if(k){var D=T.toString()===R.toString();O=0}for(k=0;k"u"&&(ie=Y.normalize(ie)),Y=[ie.chartX-Ge,ie.chartY-V]):z[0].tooltipPos?Y=z[0].tooltipPos:(z.forEach(function(Tee){St=Tee.series.yAxis,Dee=Tee.series.xAxis,pee+=Tee.plotX||0,jr+=Tee.plotLow?(Tee.plotLow+(Tee.plotHigh||0))/2:Tee.plotY||0,Dee&&St&&(B?(pee+=V+ce.plotHeight-Dee.len-Dee.pos,jr+=Ge+ce.plotWidth-St.len-St.pos):(pee+=Dee.pos-Ge,jr+=St.pos-V))}),pee/=z.length,jr/=z.length,Y=[B?ce.plotWidth-jr:pee,B?ce.plotHeight-pee:jr],this.shared&&1Oee-Ge?Oee:Oee-Ge);else if(fee)V[Bee]=Math.max($te,Lee+Ge+_ee>Nte?Lee:Lee+Ge);else return!1},Ote=function(Bee,Nte,_ee,st,Lee){var $te;return LeeNte-B?$te=!1:V[Bee]=Lee<_ee/2?1:Lee>Nte-st/2?Nte-st-2:Lee-_ee/2,$te},nee=function(Bee){var Nte=et;et=ft,ft=Nte,yee=Bee},Wee=function(){xte.apply(0,et)!==!1?Ote.apply(0,ft)!==!1||yee||(nee(!0),Wee()):yee?V.x=V.y=0:(nee(!0),Wee())};return(Y.inverted||1Oee})&&(z=z.map(function(fee){var Oee=ce(fee.anchorX,fee.anchorY,fee.point.isHeader,fee.boxWidth,!1);return R(fee,{target:Oee.y,x:Oee.x})})),Y.cleanSplit(),_(z,Iee);var Rte=Lee,dee=Lee;z.forEach(function(fee){var Oee=fee.x,xee=fee.boxWidth;fee=fee.isHeader,fee||(Y.outside&&Lee+Oeedee&&(dee=Lee+Oee))}),z.forEach(function(fee){var Oee=fee.x,xee=fee.anchorX,kee=fee.pos,Dte=fee.point.isHeader;if(kee={visibility:typeof kee>"u"?"hidden":"inherit",x:Oee,y:kee+$te,anchorX:xee,anchorY:fee.anchorY},Y.outside&&Oeece[0]?Math.max(Math.abs(ce[0]),B.width-ce[0]):Math.max(Math.abs(ce[0]),B.width),Y.height=0>ce[1]?Math.max(Math.abs(ce[1]),B.height-Math.abs(ce[1])):Math.max(Math.abs(ce[1]),B.height),this.tracker?this.tracker.attr(Y):(this.tracker=ie.renderer.rect(Y).addClass("highcharts-tracker").add(ie),z.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}},J.prototype.styledModeFormat=function(z){return z.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')},J.prototype.tooltipFooterHeaderFormatter=function(z,ie){var ce=z.series,Y=ce.tooltipOptions,B=ce.xAxis,V=B&&B.dateTime;B={isFooter:ie,labelConfig:z};var Ge=Y.xDateFormat,St=Y[ie?"footerFormat":"headerFormat"];return M(this,"headerFormatter",B,function(Dee){V&&!Ge&&D(z.key)&&(Ge=V.getXDateFormat(z.key,Y.dateTimeLabelFormats)),V&&Ge&&(z.point&&z.point.tooltipDateKeys||["key"]).forEach(function(pee){St=St.replace("{point."+pee+"}","{point."+pee+":"+Ge+"}")}),ce.chart.styledMode&&(St=this.styledModeFormat(St)),Dee.text=g(St,{point:z,series:ce},this.chart)}),B.text},J.prototype.update=function(z){this.destroy(),I(!0,this.chart.options.tooltip.userOptions,z),this.init(this.chart,I(!0,this.options,z))},J.prototype.updatePosition=function(z){var ie=this.chart,ce=this.options,Y=ie.pointer,B=this.getLabel();Y=Y.getChartPosition();var V=(ce.positioner||this.getPosition).call(this,B.width,B.height,z),Ge=z.plotX+ie.plotLeft;z=z.plotY+ie.plotTop,this.outside&&(ce=ce.borderWidth+2*this.distance,this.renderer.setSize(B.width+ce,B.height+ce,!1),(Y.scaleX!==1||Y.scaleY!==1)&&(T(this.container,{transform:"scale("+Y.scaleX+", "+Y.scaleY+")"}),Ge*=Y.scaleX,z*=Y.scaleY),Ge+=Y.left-V.x,z+=Y.top-V.y),this.move(Math.round(V.x),Math.round(V.y||0),Ge,z)},J}(),l}),s(a,"Core/Series/Point.js",[a["Core/Renderer/HTML/AST.js"],a["Core/Animation/AnimationUtilities.js"],a["Core/DefaultOptions.js"],a["Core/FormatUtilities.js"],a["Core/Utilities.js"]],function(l,c,u,d,m){var g=c.animObject,y=u.defaultOptions,_=d.format,E=m.addEvent,w=m.defined,T=m.erase,k=m.extend,O=m.fireEvent,R=m.getNestedProperty,M=m.isArray,N=m.isFunction,D=m.isNumber,P=m.isObject,I=m.merge,L=m.objectEach,F=m.pick,U=m.syncTimeout,J=m.removeEvent,z=m.uniqueKey;return c=function(){function ie(){this.colorIndex=this.category=void 0,this.formatPrefix="point",this.id=void 0,this.isNull=!1,this.percentage=this.options=this.name=void 0,this.selected=!1,this.total=this.series=void 0,this.visible=!0,this.x=void 0}return ie.prototype.animateBeforeDestroy=function(){var ce=this,Y={x:ce.startXPos,opacity:0},B=ce.getGraphicalProps();B.singular.forEach(function(V){ce[V]=ce[V].animate(V==="dataLabel"?{x:ce[V].startXPos,y:ce[V].startYPos,opacity:0}:Y)}),B.plural.forEach(function(V){ce[V].forEach(function(Ge){Ge.element&&Ge.animate(k({x:ce.startXPos},Ge.startYPos?{x:Ge.startXPos,y:Ge.startYPos}:{}))})})},ie.prototype.applyOptions=function(ce,Y){var B=this.series,V=B.options.pointValKey||B.pointValKey;return ce=ie.prototype.optionsToObject.call(this,ce),k(this,ce),this.options=this.options?k(this.options,ce):ce,ce.group&&delete this.group,ce.dataLabels&&delete this.dataLabels,V&&(this.y=ie.prototype.getNestedProperty.call(this,V)),this.formatPrefix=(this.isNull=F(this.isValid&&!this.isValid(),this.x===null||!D(this.y)))?"null":"point",this.selected&&(this.state="select"),"name"in this&&typeof Y>"u"&&B.xAxis&&B.xAxis.hasNames&&(this.x=B.xAxis.nameToX(this)),typeof this.x>"u"&&B?this.x=typeof Y>"u"?B.autoIncrement():Y:D(ce.x)&&B.options.relativeXValue&&(this.x=B.autoIncrement(ce.x)),this},ie.prototype.destroy=function(){function ce(){(Y.graphic||Y.dataLabel||Y.dataLabels)&&(J(Y),Y.destroyElements());for(Dee in Y)Y[Dee]=null}var Y=this,B=Y.series,V=B.chart;B=B.options.dataSorting;var Ge=V.hoverPoints,St=g(Y.series.chart.renderer.globalAnimation),Dee;Y.legendItem&&V.legend.destroyItem(Y),Ge&&(Y.setState(),T(Ge,Y),Ge.length||(V.hoverPoints=null)),Y===V.hoverPoint&&Y.onMouseOut(),B&&B.enabled?(this.animateBeforeDestroy(),U(ce,St.duration)):ce(),V.pointCount--},ie.prototype.destroyElements=function(ce){var Y=this;ce=Y.getGraphicalProps(ce),ce.singular.forEach(function(B){Y[B]=Y[B].destroy()}),ce.plural.forEach(function(B){Y[B].forEach(function(V){V.element&&V.destroy()}),delete Y[B]})},ie.prototype.firePointEvent=function(ce,Y,B){var V=this,Ge=this.series.options;(Ge.point.events[ce]||V.options&&V.options.events&&V.options.events[ce])&&V.importEvents(),ce==="click"&&Ge.allowPointSelect&&(B=function(St){V.select&&V.select(null,St.ctrlKey||St.metaKey||St.shiftKey)}),O(V,ce,Y,B)},ie.prototype.getClassName=function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+(typeof this.colorIndex<"u"?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")},ie.prototype.getGraphicalProps=function(ce){var Y=this,B=[],V={singular:[],plural:[]},Ge;for(ce=ce||{graphic:1,dataLabel:1},ce.graphic&&B.push("graphic","upperGraphic","shadowGroup"),ce.dataLabel&&B.push("dataLabel","dataLabelUpper","connector"),Ge=B.length;Ge--;){var St=B[Ge];Y[St]&&V.singular.push(St)}return["dataLabel","connector"].forEach(function(Dee){var pee=Dee+"s";ce[Dee]&&Y[pee]&&V.plural.push(pee)}),V},ie.prototype.getLabelConfig=function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},ie.prototype.getNestedProperty=function(ce){if(ce)return ce.indexOf("custom.")===0?R(ce,this.options):this[ce]},ie.prototype.getZone=function(){var ce=this.series,Y=ce.zones;ce=ce.zoneAxis||"y";var B,V=0;for(B=Y[V];this[ce]>=B.value;)B=Y[++V];return this.nonZonedColor||(this.nonZonedColor=this.color),this.color=B&&B.color&&!this.options.color?B.color:this.nonZonedColor,B},ie.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType},ie.prototype.init=function(ce,Y,B){return this.series=ce,this.applyOptions(Y,B),this.id=w(this.id)?this.id:z(),this.resolveColor(),ce.chart.pointCount++,O(this,"afterInit"),this},ie.prototype.optionsToObject=function(ce){var Y=this.series,B=Y.options.keys,V=B||Y.pointArrayMap||["y"],Ge=V.length,St={},Dee=0,pee=0;if(D(ce)||ce===null)St[V[0]]=ce;else if(M(ce))for(!B&&ce.length>Ge&&(Y=typeof ce[0],Y==="string"?St.name=ce[0]:Y==="number"&&(St.x=ce[0]),Dee++);pee"u"||(0Y+V&&(Tee=Y+V),etB+Ge&&(et=B+Ge),this.hasDragged=Math.sqrt(Math.pow(St-Tee,2)+Math.pow(Dee-et,2)),10B.options.findNearestPointBy.indexOf("y");if(B=B.searchPoint(z,V),(V=N(B,!0)&&B.series)&&!(V=!N(Y,!0))){V=Y.distX-B.distX;var Ge=Y.dist-B.dist,St=(B.series.group&&B.series.group.zIndex)-(Y.series.group&&Y.series.group.zIndex);V=0<(V!==0&&J?V:Ge!==0?Ge:St!==0?St:Y.series.index>B.series.index?-1:1)}V&&(Y=B)}),Y},F.prototype.getChartCoordinatesFromPoint=function(U,J){var z=U.series,ie=z.xAxis;z=z.yAxis;var ce=U.shapeArgs;if(ie&&z){var Y=I(U.clientX,U.plotX),B=U.plotY||0;return U.isNode&&ce&&M(ce.x)&&M(ce.y)&&(Y=ce.x,B=ce.y),J?{chartX:z.len+z.pos-B,chartY:ie.len+ie.pos-Y}:{chartX:Y+ie.pos,chartY:B+z.pos}}if(ce&&ce.x&&ce.y)return{chartX:ce.x,chartY:ce.y}},F.prototype.getChartPosition=function(){if(this.chartPosition)return this.chartPosition;var U=this.chart.container,J=P(U);this.chartPosition={left:J.left,top:J.top,scaleX:1,scaleY:1};var z=U.offsetWidth;return U=U.offsetHeight,2"u"||J)&&(this.zoomOption(U),J&&U.preventDefault&&U.preventDefault(),this.dragStart(U))},F.prototype.onContainerMouseLeave=function(U){var J=g[I(F.hoverChartIndex,-1)],z=this.chart.tooltip;z&&z.shouldStickOnContact()&&this.inClass(U.relatedTarget,"highcharts-tooltip-container")||(U=this.normalize(U),J&&(U.relatedTarget||U.toElement)&&(J.pointer.reset(),J.pointer.chartPosition=void 0),z&&!z.isHidden&&this.reset())},F.prototype.onContainerMouseEnter=function(U){delete this.chartPosition},F.prototype.onContainerMouseMove=function(U){var J=this.chart;U=this.normalize(U),this.setHoverChartIndex(),U.preventDefault||(U.returnValue=!1),(J.mouseIsDown==="mousedown"||this.touchSelect(U))&&this.drag(U),J.openMenu||!this.inClass(U.target,"highcharts-tracker")&&!J.isInsidePlot(U.chartX-J.plotLeft,U.chartY-J.plotTop,{visiblePlotOnly:!0})||(this.inClass(U.target,"highcharts-no-tooltip")?this.reset(!1,0):this.runPointActions(U))},F.prototype.onDocumentTouchEnd=function(U){var J=g[I(F.hoverChartIndex,-1)];J&&J.pointer.drop(U)},F.prototype.onContainerTouchMove=function(U){this.touchSelect(U)?this.onContainerMouseMove(U):this.touch(U)},F.prototype.onContainerTouchStart=function(U){this.touchSelect(U)?this.onContainerMouseDown(U):(this.zoomOption(U),this.touch(U,!0))},F.prototype.onDocumentMouseMove=function(U){var J=this.chart,z=this.chartPosition;U=this.normalize(U,z);var ie=J.tooltip;!z||ie&&ie.isStickyOnContact()||J.isInsidePlot(U.chartX-J.plotLeft,U.chartY-J.plotTop,{visiblePlotOnly:!0})||this.inClass(U.target,"highcharts-tracker")||this.reset()},F.prototype.onDocumentMouseUp=function(U){var J=g[I(F.hoverChartIndex,-1)];J&&J.pointer.drop(U)},F.prototype.pinch=function(U){var J=this,z=J.chart,ie=J.pinchDown,ce=U.touches||[],Y=ce.length,B=J.lastValidTouch,V=J.hasZoom,Ge={},St=Y===1&&(J.inClass(U.target,"highcharts-tracker")&&z.runTrackerClick||J.runChartClick),Dee={},pee=J.selectionMarker;1ft.max&&(z=ft.max-Ote,_ee=!0);_ee?(Bee-=.8*(Bee-B[St][0]),typeof Nte=="number"&&(Nte-=.8*(Nte-B[St][1])),J()):B[St]=[Bee,Nte],et||(Y[St]=nee-Tee,Y[jr]=Ote),Y=et?1/Wee:Wee,ce[jr]=Ote,ce[St]=z,ie[et?U?"scaleY":"scaleX":"scale"+Dee]=Wee,ie["translate"+Dee]=Y*Tee+(Bee-Y*ete)},F.prototype.reset=function(U,J){var z=this.chart,ie=z.hoverSeries,ce=z.hoverPoint,Y=z.hoverPoints,B=z.tooltip,V=B&&B.shared?Y:ce;U&&V&&L(V).forEach(function(Ge){Ge.series.isCartesian&&typeof Ge.plotX>"u"&&(U=!1)}),U?B&&V&&L(V).length&&(B.refresh(V),B.shared&&Y?Y.forEach(function(Ge){Ge.setState(Ge.state,!0),Ge.series.isCartesian&&(Ge.series.xAxis.crosshair&&Ge.series.xAxis.drawCrosshair(null,Ge),Ge.series.yAxis.crosshair&&Ge.series.yAxis.drawCrosshair(null,Ge))}):ce&&(ce.setState(ce.state,!0),z.axes.forEach(function(Ge){Ge.crosshair&&ce.series[Ge.coll]===Ge&&Ge.drawCrosshair(null,ce)}))):(ce&&ce.onMouseOut(),Y&&Y.forEach(function(Ge){Ge.setState()}),ie&&ie.onMouseOut(),B&&B.hide(J),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),z.axes.forEach(function(Ge){Ge.hideCrosshair()}),this.hoverX=z.hoverPoints=z.hoverPoint=null)},F.prototype.runPointActions=function(U,J){var z=this.chart,ie=z.tooltip&&z.tooltip.options.enabled?z.tooltip:void 0,ce=ie?ie.shared:!1,Y=J||z.hoverPoint,B=Y&&Y.series||z.hoverSeries;J=this.getHoverData(Y,B,z.series,(!U||U.type!=="touchmove")&&(!!J||B&&B.directTouch&&this.isDirectTouch),ce,U),Y=J.hoverPoint,B=J.hoverSeries;var V=J.hoverPoints;if(J=B&&B.tooltipOptions.followPointer&&!B.tooltipOptions.split,ce=ce&&B&&!B.noSharedTooltip,Y&&(Y!==z.hoverPoint||ie&&ie.isHidden)){if((z.hoverPoints||[]).forEach(function(Ge){V.indexOf(Ge)===-1&&Ge.setState()}),z.hoverSeries!==B&&B.onMouseOver(),this.applyInactiveState(V),(V||[]).forEach(function(Ge){Ge.setState("hover")}),z.hoverPoint&&z.hoverPoint.firePointEvent("mouseOut"),!Y.series)return;z.hoverPoints=V,z.hoverPoint=Y,Y.firePointEvent("mouseOver"),ie&&ie.refresh(ce?V:Y,U)}else J&&ie&&!ie.isHidden&&(Y=ie.getAnchor([{}],U),z.isInsidePlot(Y[0],Y[1],{visiblePlotOnly:!0})&&ie.updatePosition({plotX:Y[0],plotY:Y[1]}));this.unDocMouseMove||(this.unDocMouseMove=_(z.container.ownerDocument,"mousemove",function(Ge){var St=g[F.hoverChartIndex];St&&St.pointer.onDocumentMouseMove(Ge)}),this.eventsToUnbind.push(this.unDocMouseMove)),z.axes.forEach(function(Ge){var St=I((Ge.crosshair||{}).snap,!0),Dee;St&&((Dee=z.hoverPoint)&&Dee.series[Ge.coll]===Ge||(Dee=O(V,function(pee){return pee.series[Ge.coll]===Ge}))),Dee||!St?Ge.drawCrosshair(U,Dee):Ge.hideCrosshair()})},F.prototype.scaleGroups=function(U,J){var z=this.chart;z.series.forEach(function(ie){var ce=U||ie.getPlotBox();ie.group&&(ie.xAxis&&ie.xAxis.zoomEnabled||z.mapView)&&(ie.group.attr(ce),ie.markerGroup&&(ie.markerGroup.attr(ce),ie.markerGroup.clip(J?z.clipRect:null)),ie.dataLabelsGroup&&ie.dataLabelsGroup.attr(ce))}),z.clipRect.attr(J||z.clipBox)},F.prototype.setDOMEvents=function(){var U=this,J=this.chart.container,z=J.ownerDocument;J.onmousedown=this.onContainerMouseDown.bind(this),J.onmousemove=this.onContainerMouseMove.bind(this),J.onclick=this.onContainerClick.bind(this),this.eventsToUnbind.push(_(J,"mouseenter",this.onContainerMouseEnter.bind(this))),this.eventsToUnbind.push(_(J,"mouseleave",this.onContainerMouseLeave.bind(this))),F.unbindDocumentMouseUp||(F.unbindDocumentMouseUp=_(z,"mouseup",this.onDocumentMouseUp.bind(this)));for(var ie=this.chart.renderTo.parentElement;ie&&ie.tagName!=="BODY";)this.eventsToUnbind.push(_(ie,"scroll",function(){delete U.chartPosition})),ie=ie.parentElement;c.hasTouch&&(this.eventsToUnbind.push(_(J,"touchstart",this.onContainerTouchStart.bind(this),{passive:!1})),this.eventsToUnbind.push(_(J,"touchmove",this.onContainerTouchMove.bind(this),{passive:!1})),F.unbindDocumentTouchEnd||(F.unbindDocumentTouchEnd=_(z,"touchend",this.onDocumentTouchEnd.bind(this),{passive:!1})))},F.prototype.setHoverChartIndex=function(){var U=this.chart,J=c.charts[I(F.hoverChartIndex,-1)];J&&J!==U&&J.pointer.onContainerMouseLeave({relatedTarget:!0}),J&&J.mouseIsDown||(F.hoverChartIndex=U.index)},F.prototype.touch=function(U,J){var z=this.chart;if(this.setHoverChartIndex(),U.touches.length===1)if(U=this.normalize(U),z.isInsidePlot(U.chartX-z.plotLeft,U.chartY-z.plotTop,{visiblePlotOnly:!0})&&!z.openMenu){if(J&&this.runPointActions(U),U.type==="touchmove"){J=this.pinchDown;var ie=J[0]?4<=Math.sqrt(Math.pow(J[0].chartX-U.chartX,2)+Math.pow(J[0].chartY-U.chartY,2)):!1}I(ie,!0)&&this.pinch(U)}else J&&this.reset();else U.touches.length===2&&this.pinch(U)},F.prototype.touchSelect=function(U){return!(!this.chart.options.chart.zoomBySingleTouch||!U.touches||U.touches.length!==1)},F.prototype.zoomOption=function(U){var J=this.chart,z=J.options.chart;J=J.inverted;var ie=z.zoomType||"";/touch/.test(U.type)&&(ie=I(z.pinchType,ie)),this.zoomX=U=/x/.test(ie),this.zoomY=z=/y/.test(ie),this.zoomHor=U&&!J||z&&J,this.zoomVert=z&&!J||U&&J,this.hasZoom=U||z},F}(),l}),s(a,"Core/MSPointer.js",[a["Core/Globals.js"],a["Core/Pointer.js"],a["Core/Utilities.js"]],function(l,c,u){function d(){var D=[];return D.item=function(P){return this[P]},O(M,function(P){D.push({pageX:P.pageX,pageY:P.pageY,target:P.target})}),D}function m(D,P,I,L){var F=y[c.hoverChartIndex||NaN];D.pointerType!=="touch"&&D.pointerType!==D.MSPOINTER_TYPE_TOUCH||!F||(F=F.pointer,L(D),F[P]({type:I,target:D.currentTarget,preventDefault:E,touches:d()}))}var g=this&&this.__extends||function(){var D=function(P,I){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,F){L.__proto__=F}||function(L,F){for(var U in F)F.hasOwnProperty(U)&&(L[U]=F[U])},D(P,I)};return function(P,I){function L(){this.constructor=P}D(P,I),P.prototype=I===null?Object.create(I):(L.prototype=I.prototype,new L)}}(),y=l.charts,_=l.doc,E=l.noop,w=l.win,T=u.addEvent,k=u.css,O=u.objectEach,R=u.removeEvent,M={},N=!!w.PointerEvent;return function(D){function P(){return D!==null&&D.apply(this,arguments)||this}return g(P,D),P.isRequired=function(){return!(l.hasTouch||!w.PointerEvent&&!w.MSPointerEvent)},P.prototype.batchMSEvents=function(I){I(this.chart.container,N?"pointerdown":"MSPointerDown",this.onContainerPointerDown),I(this.chart.container,N?"pointermove":"MSPointerMove",this.onContainerPointerMove),I(_,N?"pointerup":"MSPointerUp",this.onDocumentPointerUp)},P.prototype.destroy=function(){this.batchMSEvents(R),D.prototype.destroy.call(this)},P.prototype.init=function(I,L){D.prototype.init.call(this,I,L),this.hasZoom&&k(I.container,{"-ms-touch-action":"none","touch-action":"none"})},P.prototype.onContainerPointerDown=function(I){m(I,"onContainerTouchStart","touchstart",function(L){M[L.pointerId]={pageX:L.pageX,pageY:L.pageY,target:L.currentTarget}})},P.prototype.onContainerPointerMove=function(I){m(I,"onContainerTouchMove","touchmove",function(L){M[L.pointerId]={pageX:L.pageX,pageY:L.pageY},M[L.pointerId].target||(M[L.pointerId].target=L.currentTarget)})},P.prototype.onDocumentPointerUp=function(I){m(I,"onDocumentTouchEnd","touchend",function(L){delete M[L.pointerId]})},P.prototype.setDOMEvents=function(){D.prototype.setDOMEvents.call(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(T)},P}(c)}),s(a,"Core/Legend/Legend.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/FormatUtilities.js"],a["Core/Globals.js"],a["Core/Series/Point.js"],a["Core/Renderer/RendererUtilities.js"],a["Core/Utilities.js"]],function(l,c,u,d,m,g){var y=l.animObject,_=l.setAnimation,E=c.format;l=u.isFirefox;var w=u.marginNames;u=u.win;var T=m.distribute,k=g.addEvent,O=g.createElement,R=g.css,M=g.defined,N=g.discardElement,D=g.find,P=g.fireEvent,I=g.isNumber,L=g.merge,F=g.pick,U=g.relativeLength,J=g.stableSort,z=g.syncTimeout;return m=g.wrap,g=function(){function ie(ce,Y){this.allItems=[],this.contentGroup=this.box=void 0,this.display=!1,this.group=void 0,this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0,this.options={},this.padding=0,this.pages=[],this.proximate=!1,this.scrollGroup=void 0,this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0,this.chart=ce,this.init(ce,Y)}return ie.prototype.init=function(ce,Y){this.chart=ce,this.setOptions(Y),Y.enabled&&(this.render(),k(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=k(this.chart,"render",function(){this.legend.proximatePositions(),this.legend.positionItems()}):this.unchartrender&&this.unchartrender())},ie.prototype.setOptions=function(ce){var Y=F(ce.padding,8);this.options=ce,this.chart.styledMode||(this.itemStyle=ce.itemStyle,this.itemHiddenStyle=L(this.itemStyle,ce.itemHiddenStyle)),this.itemMarginTop=ce.itemMarginTop||0,this.itemMarginBottom=ce.itemMarginBottom||0,this.padding=Y,this.initialItemY=Y-5,this.symbolWidth=F(ce.symbolWidth,16),this.pages=[],this.proximate=ce.layout==="proximate"&&!this.chart.inverted,this.baseline=void 0},ie.prototype.update=function(ce,Y){var B=this.chart;this.setOptions(L(!0,this.options,ce)),this.destroy(),B.isDirtyLegend=B.isDirtyBox=!0,F(Y,!0)&&B.redraw(),P(this,"afterUpdate")},ie.prototype.colorizeItem=function(ce,Y){if(ce.legendGroup[Y?"removeClass":"addClass"]("highcharts-legend-item-hidden"),!this.chart.styledMode){var B=this.options,V=ce.legendItem,Ge=ce.legendLine,St=ce.legendSymbol,Dee=this.itemHiddenStyle.color;B=Y?B.itemStyle.color:Dee;var pee=Y&&ce.color||Dee,jr=ce.options&&ce.options.marker,Tee={fill:pee};V&&V.css({fill:B,color:B}),Ge&&Ge.attr({stroke:pee}),St&&(jr&&St.isMarker&&(Tee=ce.pointAttribs(),Y||(Tee.stroke=Tee.fill=Dee)),St.attr(Tee))}P(this,"afterColorizeItem",{item:ce,visible:Y})},ie.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()},ie.prototype.positionItem=function(ce){var Y=this,B=this.options,V=B.symbolPadding,Ge=!B.rtl,St=ce._legendItemPos;B=St[0],St=St[1];var Dee=ce.checkbox,pee=ce.legendGroup;pee&&pee.element&&(V={translateX:Ge?B:this.legendWidth-B-2*V-4,translateY:St},Ge=function(){P(Y,"afterPositionItem",{item:ce})},M(pee.translateY)?pee.animate(V,void 0,Ge):(pee.attr(V),Ge())),Dee&&(Dee.x=B,Dee.y=St)},ie.prototype.destroyItem=function(ce){var Y=ce.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach(function(B){ce[B]&&(ce[B]=ce[B].destroy())}),Y&&N(ce.checkbox)},ie.prototype.destroy=function(){function ce(Y){this[Y]&&(this[Y]=this[Y].destroy())}this.getAllItems().forEach(function(Y){["legendItem","legendGroup"].forEach(ce,Y)}),"clipRect up down pager nav box title group".split(" ").forEach(ce,this),this.display=null},ie.prototype.positionCheckboxes=function(){var ce=this.group&&this.group.alignAttr,Y=this.clipHeight||this.legendHeight,B=this.titleHeight;if(ce){var V=ce.translateY;this.allItems.forEach(function(Ge){var St=Ge.checkbox;if(St){var Dee=V+B+St.y+(this.scrollOffset||0)+3;R(St,{left:ce.translateX+Ge.checkboxOffset+St.x-20+"px",top:Dee+"px",display:this.proximate||Dee>V-6&&Dee1.5*B?Y.height:B))},ie.prototype.layoutItem=function(ce){var Y=this.options,B=this.padding,V=Y.layout==="horizontal",Ge=ce.itemHeight,St=this.itemMarginBottom,Dee=this.itemMarginTop,pee=V?F(Y.itemDistance,20):0,jr=this.maxLegendWidth;Y=Y.alignColumns&&this.totalItemWidth>jr?this.maxItemWidth:ce.itemWidth,V&&this.itemX-B+Y>jr&&(this.itemX=B,this.lastLineHeight&&(this.itemY+=Dee+this.lastLineHeight+St),this.lastLineHeight=0),this.lastItemY=Dee+this.itemY+St,this.lastLineHeight=Math.max(Ge,this.lastLineHeight),ce._legendItemPos=[this.itemX,this.itemY],V?this.itemX+=Y:(this.itemY+=Dee+Ge+St,this.lastLineHeight=Ge),this.offsetWidth=this.widthOption||Math.max((V?this.itemX-B-(ce.checkbox?0:pee):Y)+B,this.offsetWidth)},ie.prototype.getAllItems=function(){var ce=[];return this.chart.series.forEach(function(Y){var B=Y&&Y.options;Y&&F(B.showInLegend,M(B.linkedTo)?!1:void 0,!0)&&(ce=ce.concat(Y.legendItems||(B.legendType==="point"?Y.data:Y)))}),P(this,"afterGetAllItems",{allItems:ce}),ce},ie.prototype.getAlignment=function(){var ce=this.options;return this.proximate?ce.align.charAt(0)+"tv":ce.floating?"":ce.align.charAt(0)+ce.verticalAlign.charAt(0)+ce.layout.charAt(0)},ie.prototype.adjustMargins=function(ce,Y){var B=this.chart,V=this.options,Ge=this.getAlignment();Ge&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function(St,Dee){St.test(Ge)&&!M(ce[Dee])&&(B[w[Dee]]=Math.max(B[w[Dee]],B.legend[(Dee+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][Dee]*V[Dee%2?"x":"y"]+F(V.margin,12)+Y[Dee]+(B.titleOffset[Dee]||0)))})},ie.prototype.proximatePositions=function(){var ce=this.chart,Y=[],B=this.options.align==="left";this.allItems.forEach(function(V){var Ge,St=B;if(V.yAxis){V.xAxis.options.reversed&&(St=!St),V.points&&(Ge=D(St?V.points:V.points.slice(0).reverse(),function(pee){return I(pee.plotY)})),St=this.itemMarginTop+V.legendItem.getBBox().height+this.itemMarginBottom;var Dee=V.yAxis.top-ce.plotTop;V.visible?(Ge=Ge?Ge.plotY:V.yAxis.height,Ge+=Dee-.3*St):Ge=Dee+V.yAxis.height,Y.push({target:Ge,size:St,item:V})}},this),T(Y,ce.plotHeight).forEach(function(V){V.item._legendItemPos&&(V.item._legendItemPos[1]=ce.plotTop-ce.spacing[0]+V.pos)})},ie.prototype.render=function(){var ce=this.chart,Y=ce.renderer,B=this.options,V=this.padding,Ge=this.getAllItems(),St=this.group,Dee=this.box;this.itemX=V,this.itemY=this.initialItemY,this.lastItemY=this.offsetWidth=0,this.widthOption=U(B.width,ce.spacingBox.width-V);var pee=ce.spacingBox.width-2*V-B.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(pee/=2),this.maxLegendWidth=this.widthOption||pee,St||(this.group=St=Y.g("legend").addClass(B.className||"").attr({zIndex:7}).add(),this.contentGroup=Y.g().attr({zIndex:1}).add(St),this.scrollGroup=Y.g().add(this.contentGroup)),this.renderTitle(),J(Ge,function(Tee,et){return(Tee.options&&Tee.options.legendIndex||0)-(et.options&&et.options.legendIndex||0)}),B.reversed&&Ge.reverse(),this.allItems=Ge,this.display=pee=!!Ge.length,this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0,Ge.forEach(this.renderItem,this),Ge.forEach(this.layoutItem,this),Ge=(this.widthOption||this.offsetWidth)+V;var jr=this.lastItemY+this.lastLineHeight+this.titleHeight;jr=this.handleOverflow(jr),jr+=V,Dee||(this.box=Dee=Y.rect().addClass("highcharts-legend-box").attr({r:B.borderRadius}).add(St),Dee.isNew=!0),ce.styledMode||Dee.attr({stroke:B.borderColor,"stroke-width":B.borderWidth||0,fill:B.backgroundColor||"none"}).shadow(B.shadow),0St&&Tee.enabled!==!1?(this.clipHeight=nee=Math.max(St-20-this.titleHeight-pee,0),this.currentPage=F(this.currentPage,1),this.fullHeight=ce,ete.forEach(function(_ee,st){var Lee=_ee._legendItemPos[1],$te=Math.round(_ee.legendItem.getBBox().height),Kee=yee.length;(!Kee||Lee-yee[Kee-1]>nee&&(Wee||Lee)!==yee[Kee-1])&&(yee.push(Wee||Lee),Kee++),_ee.pageIx=Kee-1,Wee&&(ete[st-1].pageIx=Kee-1),st===ete.length-1&&Lee+$te-yee[Kee-1]>nee&&$te<=nee&&(yee.push(Lee),_ee.pageIx=Kee),Lee!==Wee&&(Wee=Lee)}),Nte||(Nte=Y.clipRect=V.clipRect(0,pee,9999,0),Y.contentGroup.clip(Nte)),xte(nee),Bee||(this.nav=Bee=V.g().attr({zIndex:1}).add(this.group),this.up=V.symbol("triangle",0,0,ft,ft).add(Bee),Ote("upTracker").on("click",function(){Y.scroll(-1,et)}),this.pager=V.text("",15,10).addClass("highcharts-legend-navigation"),B.styledMode||this.pager.css(Tee.style),this.pager.add(Bee),this.down=V.symbol("triangle-down",0,0,ft,ft).add(Bee),Ote("downTracker").on("click",function(){Y.scroll(1,et)})),Y.scroll(0),ce=St):Bee&&(xte(),this.nav=Bee.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),ce},ie.prototype.scroll=function(ce,Y){var B=this,V=this.chart,Ge=this.pages,St=Ge.length,Dee=this.clipHeight,pee=this.options.navigation,jr=this.pager,Tee=this.padding,et=this.currentPage+ce;et>St&&(et=St),0=Math.max(Ute+Vte,Bte.pos)&&Fte<=Math.min(Ute+Vte+Lte.width,Bte.pos+Bte.len)||(xee.isInsidePlot=!1)}return!Dte.ignoreY&&xee.isInsidePlot&&(Ite=jte&&(Ite?jte.xAxis:jte.yAxis)||{pos:Pte,len:1/0},Dte=Dte.paneCoordinates?Ite.pos+kee:Pte+kee,Dte>=Math.max(Gte+Pte,Ite.pos)&&Dte<=Math.min(Gte+Pte+Lte.height,Ite.pos+Ite.len)||(xee.isInsidePlot=!1)),xte(this,"afterIsInsidePlot",xee),xee.isInsidePlot},Oee.prototype.redraw=function(xee){xte(this,"beforeRedraw");var kee=this.hasCartesianSeries?this.axes:this.colorAxis||[],Dte=this.series,Ite=this.pointer,Lte=this.legend,Vte=this.userOptions.legend,Pte=this.renderer,Fte=Pte.isHidden(),Ute=[],Gte=this.isDirtyBox,jte=this.isDirtyLegend;for(this.setResponsive&&this.setResponsive(!1),P(this.hasRendered?xee:!1,this),Fte&&this.temporaryDisplay(),this.layOutTitles(),xee=Dte.length;xee--;){var Bte=Dte[xee];if(Bte.options.stacking||Bte.options.centerInCategory){var Hte=!0;if(Bte.isDirty){var zte=!0;break}}}if(zte)for(xee=Dte.length;xee--;)Bte=Dte[xee],Bte.options.stacking&&(Bte.isDirty=!0);Dte.forEach(function(qte){qte.isDirty&&(qte.options.legendType==="point"?(typeof qte.updateTotals=="function"&&qte.updateTotals(),jte=!0):Vte&&(Vte.labelFormatter||Vte.labelFormat)&&(jte=!0)),qte.isDirtyData&&xte(qte,"updatedData")}),jte&&Lte&&Lte.options.enabled&&(Lte.render(),this.isDirtyLegend=!1),Hte&&this.getStacks(),kee.forEach(function(qte){qte.updateNames(),qte.setScale()}),this.getMargins(),kee.forEach(function(qte){qte.isDirty&&(Gte=!0)}),kee.forEach(function(qte){var Wte=qte.min+","+qte.max;qte.extKey!==Wte&&(qte.extKey=Wte,Ute.push(function(){xte(qte,"afterSetExtremes",yee(qte.eventArgs,qte.getExtremes())),delete qte.eventArgs})),(Gte||Hte)&&qte.redraw()}),Gte&&this.drawChartBox(),xte(this,"predraw"),Dte.forEach(function(qte){(Gte||qte.isDirty)&&qte.visible&&qte.redraw(),qte.isDirtyData=!1}),Ite&&Ite.reset(!0),Pte.draw(),xte(this,"redraw"),xte(this,"render"),Fte&&this.temporaryDisplay(!0),Ute.forEach(function(qte){qte.call()})},Oee.prototype.get=function(xee){function kee(Vte){return Vte.id===xee||Vte.options&&Vte.options.id===xee}for(var Dte=this.series,Ite=ete(this.axes,kee)||ete(this.series,kee),Lte=0;!Ite&&Lte=Gte&&Ite<=jte||Bte||!jr(Ite))&&(Hte=!0),Dte[Bte?"zoomX":"zoomY"]&&Hte&&(Vte=Ute.zoom(Fte.min,Fte.max),Ute.displayBtn&&(Lte=!0))});var Pte=kee.resetZoomButton;Lte&&!Pte?kee.showResetZoom():!Lte&&Bee(Pte)&&(kee.resetZoomButton=Pte.destroy()),Vte&&kee.redraw(Lee(kee.options.chart.animation,xee&&xee.animation,100>kee.pointCount))},Oee.prototype.pan=function(xee,kee){var Dte=this,Ite=Dte.hoverPoints;kee=typeof kee=="object"?kee:{enabled:kee,type:"x"};var Lte=Dte.options.chart,Vte=Dte.options.mapNavigation&&Dte.options.mapNavigation.enabled;Lte&&Lte.panning&&(Lte.panning=kee);var Pte=kee.type,Fte;xte(this,"pan",{originalEvent:xee},function(){Ite&&Ite.forEach(function(jte){jte.setState()});var Ute=Dte.xAxis;Pte==="xy"?Ute=Ute.concat(Dte.yAxis):Pte==="y"&&(Ute=Dte.yAxis);var Gte={};Ute.forEach(function(jte){if(jte.options.panningEnabled&&!jte.options.isInternal){var Bte=jte.horiz,Hte=xee[Bte?"chartX":"chartY"];Bte=Bte?"mouseDownX":"mouseDownY";var zte=Dte[Bte],qte=jte.minPointOffset||0,Wte=jte.reversed&&!Dte.inverted||!jte.reversed&&Dte.inverted?-1:1,Zte=jte.getExtremes(),Qte=jte.toValue(zte-Hte,!0)+qte*Wte,rne=jte.toValue(zte+jte.len-Hte,!0)-(qte*Wte||jte.isXAxis&&jte.pointRangePadding||0),cne=rne=Wte&&Qte<=rne&&(jte.setExtremes(zte,Qte,!1,!1,{trigger:"pan"}),Dte.resetZoomButton||Vte||zte===Wte||Qte===rne||!Pte.match("y")||(Dte.showResetZoom(),jte.displayBtn=!1),Fte=!0),Gte[Bte]=Hte)}}),st(Gte,function(jte,Bte){Dte[Bte]=jte}),Fte&&Dte.redraw(!1),pee(Dte.container,{cursor:"move"})})},Oee}(),yee(l.prototype,{callbacks:[],collectionsWithInit:{xAxis:[l.prototype.addAxis,[!0]],yAxis:[l.prototype.addAxis,[!1]],series:[l.prototype.addSeries]},collectionsWithUpdate:["xAxis","yAxis","series"],propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" ")}),l}),s(a,"Core/Legend/LegendSymbol.js",[a["Core/Utilities.js"]],function(l){var c=l.merge,u=l.pick,d;return function(m){m.drawLineMarker=function(g){var y=this.options,_=g.symbolWidth,E=g.symbolHeight,w=E/2,T=this.chart.renderer,k=this.legendGroup;g=g.baseline-Math.round(.3*g.fontMetrics.b);var O={},R=y.marker;this.chart.styledMode||(O={"stroke-width":y.lineWidth||0},y.dashStyle&&(O.dashstyle=y.dashStyle)),this.legendLine=T.path([["M",0,g],["L",_,g]]).addClass("highcharts-graph").attr(O).add(k),R&&R.enabled!==!1&&_&&(y=Math.min(u(R.radius,w),w),this.symbol.indexOf("url")===0&&(R=c(R,{width:E,height:E}),y=0),this.legendSymbol=_=T.symbol(this.symbol,_/2-y,g-y,2*y,2*y,R).addClass("highcharts-point").add(k),_.isMarker=!0)},m.drawRectangle=function(g,y){var _=g.symbolHeight,E=g.options.squareSymbol;y.legendSymbol=this.chart.renderer.rect(E?(g.symbolWidth-_)/2:0,g.baseline-_+1,E?_:g.symbolWidth,_,u(g.options.symbolRadius,_/2)).addClass("highcharts-point").attr({zIndex:3}).add(y.legendGroup)}}(d||(d={})),d}),s(a,"Core/Series/SeriesDefaults.js",[],function(){return{lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",defer:!0,formatter:function(){var l=this.series.chart.numberFormatter;return typeof this.y!="number"?"":l(this.y,-1)},padding:5,style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:"x"}}),s(a,"Core/Series/Series.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/DefaultOptions.js"],a["Core/Foundation.js"],a["Core/Globals.js"],a["Core/Legend/LegendSymbol.js"],a["Core/Series/Point.js"],a["Core/Series/SeriesDefaults.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Utilities.js"]],function(l,c,u,d,m,g,y,_,E,w){var T=l.animObject,k=l.setAnimation,O=c.defaultOptions,R=u.registerEventOptions,M=d.hasTouch,N=d.svg,D=d.win,P=_.seriesTypes,I=w.addEvent,L=w.arrayMax,F=w.arrayMin,U=w.clamp,J=w.cleanRecursively,z=w.correctFloat,ie=w.defined,ce=w.erase,Y=w.error,B=w.extend,V=w.find,Ge=w.fireEvent,St=w.getNestedProperty,Dee=w.isArray,pee=w.isNumber,jr=w.isString,Tee=w.merge,et=w.objectEach,ft=w.pick,yee=w.removeEvent,ete=w.splat,xte=w.syncTimeout;return l=function(){function Ote(){this.zones=this.yAxis=this.xAxis=this.userOptions=this.tooltipOptions=this.processedYData=this.processedXData=this.points=this.options=this.linkedSeries=this.index=this.eventsToUnbind=this.eventOptions=this.data=this.chart=this._i=void 0}return Ote.prototype.init=function(nee,Wee){Ge(this,"init",{options:Wee});var Bee=this,Nte=nee.series;this.eventsToUnbind=[],Bee.chart=nee,Bee.options=Bee.setOptions(Wee),Wee=Bee.options,Bee.linkedSeries=[],Bee.bindAxes(),B(Bee,{name:Wee.name,state:"",visible:Wee.visible!==!1,selected:Wee.selected===!0}),R(this,Wee);var _ee=Wee.events;(_ee&&_ee.click||Wee.point&&Wee.point.events&&Wee.point.events.click||Wee.allowPointSelect)&&(nee.runTrackerClick=!0),Bee.getColor(),Bee.getSymbol(),Bee.parallelArrays.forEach(function(Lee){Bee[Lee+"Data"]||(Bee[Lee+"Data"]=[])}),Bee.isCartesian&&(nee.hasCartesianSeries=!0);var st;Nte.length&&(st=Nte[Nte.length-1]),Bee._i=ft(st&&st._i,-1)+1,Bee.opacity=Bee.options.opacity,nee.orderSeries(this.insert(Nte)),Wee.dataSorting&&Wee.dataSorting.enabled?Bee.setDataSortingOptions():Bee.points||Bee.data||Bee.setData(Wee.data,!1),Ge(this,"afterInit")},Ote.prototype.is=function(nee){return P[nee]&&this instanceof P[nee]},Ote.prototype.insert=function(nee){var Wee=this.options.index,Bee;if(pee(Wee)){for(Bee=nee.length;Bee--;)if(Wee>=ft(nee[Bee].options.index,nee[Bee]._i)){nee.splice(Bee+1,0,this);break}Bee===-1&&nee.unshift(this),Bee+=1}else nee.push(this);return ft(Bee,nee.length-1)},Ote.prototype.bindAxes=function(){var nee=this,Wee=nee.options,Bee=nee.chart,Nte;Ge(this,"bindAxes",null,function(){(nee.axisTypes||[]).forEach(function(_ee){var st=0;Bee[_ee].forEach(function(Lee){Nte=Lee.options,(Wee[_ee]===st&&!Nte.isInternal||typeof Wee[_ee]<"u"&&Wee[_ee]===Nte.id||typeof Wee[_ee]>"u"&&Nte.index===0)&&(nee.insert(Lee.series),nee[_ee]=Lee,Lee.isDirty=!0),Nte.isInternal||st++}),nee[_ee]||nee.optionalAxis===_ee||Y(18,!0,Bee)})}),Ge(this,"afterBindAxes")},Ote.prototype.updateParallelArrays=function(nee,Wee){var Bee=nee.series,Nte=arguments,_ee=pee(Wee)?function(st){var Lee=st==="y"&&Bee.toYData?Bee.toYData(nee):nee[st];Bee[st+"Data"][Wee]=Lee}:function(st){Array.prototype[Wee].apply(Bee[st+"Data"],Array.prototype.slice.call(Nte,2))};Bee.parallelArrays.forEach(_ee)},Ote.prototype.hasData=function(){return this.visible&&typeof this.dataMax<"u"&&typeof this.dataMin<"u"||this.visible&&this.yData&&0"u"&&pee(Nte)&&(Kee=this.xData.indexOf(Nte,Wee)),Kee!==-1&&typeof Kee<"u"&&this.cropped&&(Kee=Kee>=this.cropStart?Kee-this.cropStart:Kee),!$te&&pee(Kee)&&_ee[Kee]&&_ee[Kee].touched&&(Kee=void 0),Kee},Ote.prototype.updateData=function(nee,Wee){var Bee=this.options,Nte=Bee.dataSorting,_ee=this.points,st=[],Lee=this.requireSorting,$te=nee.length===_ee.length,Kee,Iee,Rte,dee=!0;if(this.xIncrement=null,nee.forEach(function(fee,Oee){var xee=ie(fee)&&this.pointClass.prototype.optionsToObject.call({series:this},fee)||{},kee=xee.x;xee.id||pee(kee)?(xee=this.findPointIndex(xee,Rte),xee===-1||typeof xee>"u"?st.push(fee):_ee[xee]&&fee!==Bee.data[xee]?(_ee[xee].update(fee,!1,null,!1),_ee[xee].touched=!0,Lee&&(Rte=xee+1)):_ee[xee]&&(_ee[xee].touched=!0),(!$te||Oee!==xee||Nte&&Nte.enabled||this.hasDerivedData)&&(Kee=!0)):st.push(fee)},this),Kee)for(nee=_ee.length;nee--;)(Iee=_ee[nee])&&!Iee.touched&&Iee.remove&&Iee.remove(!1,Wee);else!$te||Nte&&Nte.enabled?dee=!1:(nee.forEach(function(fee,Oee){fee!==_ee[Oee].y&&_ee[Oee].update&&_ee[Oee].update(fee,!1,null,!1)}),st.length=0);return _ee.forEach(function(fee){fee&&(fee.touched=!1)}),dee?(st.forEach(function(fee){this.addPoint(fee,!1,null,null,!1)},this),this.xIncrement===null&&this.xData&&this.xData.length&&(this.xIncrement=L(this.xData),this.autoIncrement()),!0):!1},Ote.prototype.setData=function(nee,Wee,Bee,Nte){var _ee=this,st=_ee.points,Lee=st&&st.length||0,$te=_ee.options,Kee=_ee.chart,Iee=$te.dataSorting,Rte=_ee.xAxis,dee=$te.turboThreshold,fee=this.xData,Oee=this.yData,xee=_ee.pointArrayMap;xee=xee&&xee.length;var kee=$te.keys,Dte,Ite=0,Lte=1,Vte=null;nee=nee||[];var Pte=nee.length;if(Wee=ft(Wee,!0),Iee&&Iee.enabled&&(nee=this.sortData(nee)),Nte!==!1&&Pte&&Lee&&!_ee.cropped&&!_ee.hasGroupedData&&_ee.visible&&!_ee.isSeriesBoosting&&(Dte=this.updateData(nee,Bee)),!Dte){if(_ee.xIncrement=null,_ee.colorCounter=0,this.parallelArrays.forEach(function(Fte){_ee[Fte+"Data"].length=0}),dee&&Pte>dee)if(Vte=_ee.getFirstValidPoint(nee),pee(Vte))for(Bee=0;Bee_ee?1:0}).forEach(function(_ee,st){_ee.x=st},this),Wee.linkedSeries&&Wee.linkedSeries.forEach(function(_ee){var st=_ee.options,Lee=st.data;st.dataSorting&&st.dataSorting.enabled||!Lee||(Lee.forEach(function($te,Kee){Lee[Kee]=Nte(_ee,$te),nee[Kee]&&(Lee[Kee].x=nee[Kee].x,Lee[Kee].index=Kee)}),_ee.setData(Lee,!1))}),nee},Ote.prototype.getProcessedData=function(nee){var Wee=this.xAxis,Bee=this.options,Nte=Bee.cropThreshold,_ee=nee||this.getExtremesFromAll||Bee.getExtremesFromAll,st=this.isCartesian;nee=Wee&&Wee.val2lin,Bee=!(!Wee||!Wee.logarithmic);var Lee=0,$te=this.xData,Kee=this.yData,Iee=this.requireSorting,Rte=!1,dee=$te.length;if(Wee){Rte=Wee.getExtremes();var fee=Rte.min,Oee=Rte.max;Rte=Wee.categories&&!Wee.names.length}if(st&&this.sorted&&!_ee&&(!Nte||dee>Nte||this.forceCrop)){if($te[dee-1]Oee)$te=[],Kee=[];else if(this.yData&&($te[0]Oee)){var xee=this.cropData(this.xData,this.yData,fee,Oee);$te=xee.xData,Kee=xee.yData,Lee=xee.start,xee=!0}}for(Nte=$te.length||1;--Nte;)if(Wee=Bee?nee($te[Nte])-nee($te[Nte-1]):$te[Nte]-$te[Nte-1],0"u"||WeeWee&&Iee&&!Rte&&(Y(15,!1,this.chart),Iee=!1);return{xData:$te,yData:Kee,cropped:xee,cropStart:Lee,closestPointRange:kee}},Ote.prototype.processData=function(nee){var Wee=this.xAxis;if(this.isCartesian&&!this.isDirty&&!Wee.isDirty&&!this.yAxis.isDirty&&!nee)return!1;nee=this.getProcessedData(),this.cropped=nee.cropped,this.cropStart=nee.cropStart,this.processedXData=nee.xData,this.processedYData=nee.yData,this.closestPointRange=this.basePointRange=nee.closestPointRange,Ge(this,"afterProcessData")},Ote.prototype.cropData=function(nee,Wee,Bee,Nte,_ee){var st=nee.length,Lee,$te=0,Kee=st;for(_ee=ft(_ee,this.cropShoulder),Lee=0;Lee=Bee){$te=Math.max(0,Lee-_ee);break}for(Bee=Lee;BeeNte){Kee=Bee+_ee;break}return{xData:nee.slice($te,Kee),yData:Wee.slice($te,Kee),start:$te,end:Kee}},Ote.prototype.generatePoints=function(){var nee=this.options,Wee=nee.data,Bee=this.processedXData,Nte=this.processedYData,_ee=this.pointClass,st=Bee.length,Lee=this.cropStart||0,$te=this.hasGroupedData,Kee=nee.keys,Iee=[];nee=nee.dataGrouping&&nee.dataGrouping.groupAll?Lee:0;var Rte,dee,fee=this.data;if(!fee&&!$te){var Oee=[];Oee.length=Wee.length,fee=this.data=Oee}for(Kee&&$te&&(this.options.keys=!1),dee=0;dee"u"||(fee[Oee]=xee=new _ee().init(this,Wee[Oee],Bee[dee]));xee&&(xee.index=$te?nee+dee:Oee,Iee[dee]=xee)}if(this.options.keys=Kee,fee&&(st!==(Rte=fee.length)||$te))for(dee=0;dee=Kee&&(_ee[$te-Lee]||Oee)<=Iee,xee&&Oee)if(xee=fee.length)for(;xee--;)pee(fee[xee])&&(st[Rte++]=fee[xee]);else st[Rte++]=fee}return nee={activeYData:st,dataMin:F(st),dataMax:L(st)},Ge(this,"afterGetExtremes",{dataExtremes:nee}),nee},Ote.prototype.applyExtremes=function(){var nee=this.getExtremes();return this.dataMin=nee.dataMin,this.dataMax=nee.dataMax,nee},Ote.prototype.getFirstValidPoint=function(nee){for(var Wee=nee.length,Bee=0,Nte=null;Nte===null&&Bee=Fte&&(Fte=null),Dte.total=Dte.stackTotal=Lte.total,Dte.percentage=Lte.total&&Dte.y/Lte.total*100,Dte.stackY=Pte,this.irregularWidths||Lte.setOffset(this.pointXOffset||0,this.barW||0)),Dte.yBottom=ie(Fte)?U(st.translate(Fte,0,1,0,1),-1e5,1e5):null,this.dataModify&&(Pte=this.dataModify.modifyValue(Pte,Oee)),Dte.plotY=void 0,pee(Pte)&&(Lte=st.translate(Pte,!1,!0,!1,!0),typeof Lte<"u"&&(Dte.plotY=U(Lte,-1e5,1e5))),Dte.isInside=this.isPointInside(Dte),Dte.clientX=Iee?z(Bee.translate(Ite,0,0,0,1,Kee)):xee,Dte.negative=Dte[fee]<(nee[fee+"Threshold"]||Rte||0),Dte.category=Nte&&typeof Nte[Dte.x]<"u"?Nte[Dte.x]:Dte.x,!Dte.isNull&&Dte.visible!==!1){typeof jte<"u"&&(kee=Math.min(kee,Math.abs(xee-jte)));var jte=xee}Dte.zone=this.zones.length?Dte.getZone():void 0,!Dte.graphic&&this.group&&_ee&&(Dte.isNew=!0)}this.closestPointRangePx=kee,Ge(this,"afterTranslate")},Ote.prototype.getValidPoints=function(nee,Wee,Bee){var Nte=this.chart;return(nee||this.points||[]).filter(function(_ee){return Wee&&!Nte.isInsidePlot(_ee.plotX,_ee.plotY,{inverted:Nte.inverted})?!1:_ee.visible!==!1&&(Bee||!_ee.isNull)})},Ote.prototype.getClipBox=function(){var nee=this.chart,Wee=this.xAxis,Bee=this.yAxis,Nte=Tee(nee.clipBox);return Wee&&Wee.len!==nee.plotSizeX&&(Nte.width=Wee.len),Bee&&Bee.len!==nee.plotSizeY&&(Nte.height=Bee.len),Nte},Ote.prototype.getSharedClipKey=function(){return this.sharedClipKey=(this.options.xAxis||0)+","+(this.options.yAxis||0)},Ote.prototype.setClip=function(){var nee=this.chart,Wee=this.group,Bee=this.markerGroup,Nte=nee.sharedClips;nee=nee.renderer;var _ee=this.getClipBox(),st=this.getSharedClipKey(),Lee=Nte[st];Lee?Lee.animate(_ee):Nte[st]=Lee=nee.clipRect(_ee),Wee&&Wee.clip(this.options.clip===!1?void 0:Lee),Bee&&Bee.clip()},Ote.prototype.animate=function(nee){var Wee=this.chart,Bee=this.group,Nte=this.markerGroup,_ee=Wee.inverted,st=T(this.options.animation),Lee=[this.getSharedClipKey(),st.duration,st.easing,st.defer].join(),$te=Wee.sharedClips[Lee],Kee=Wee.sharedClips[Lee+"m"];if(nee&&Bee)st=this.getClipBox(),$te?$te.attr("height",st.height):(st.width=0,_ee&&(st.x=Wee.plotHeight),$te=Wee.renderer.clipRect(st),Wee.sharedClips[Lee]=$te,Kee=Wee.renderer.clipRect({x:_ee?(Wee.plotSizeX||0)+99:-99,y:_ee?-Wee.plotLeft:-Wee.plotTop,width:99,height:_ee?Wee.chartWidth:Wee.chartHeight}),Wee.sharedClips[Lee+"m"]=Kee),Bee.clip($te),Nte&&Nte.clip(Kee);else if($te&&!$te.hasClass("highcharts-animating")){Wee=this.getClipBox();var Iee=st.step;Nte&&Nte.element.childNodes.length&&(st.step=function(Rte,dee){Iee&&Iee.apply(dee,arguments),Kee&&Kee.element&&Kee.attr(dee.prop,dee.prop==="width"?Rte+99:Rte)}),$te.addClass("highcharts-animating").animate(Wee,st)}},Ote.prototype.afterAnimate=function(){var nee=this;this.setClip(),et(this.chart.sharedClips,function(Wee,Bee,Nte){Wee&&!nee.chart.container.querySelector('[clip-path="url(#'+Wee.id+')"]')&&(Wee.destroy(),delete Nte[Bee])}),this.finishedAnimating=!0,Ge(this,"afterAnimate")},Ote.prototype.drawPoints=function(){var nee=this.points,Wee=this.chart,Bee=this.options.marker,Nte=this[this.specialGroup]||this.markerGroup,_ee=this.xAxis,st=ft(Bee.enabled,!_ee||_ee.isRadial?!0:null,this.closestPointRangePx>=Bee.enabledThreshold*Bee.radius),Lee,$te;if(Bee.enabled!==!1||this._hasPointMarkers)for(Lee=0;Lee"u"||Rte.enabled)&&!Kee.isNull&&Kee.visible!==!1){var fee=ft(Rte.symbol,this.symbol,"rect"),Oee=this.markerAttribs(Kee,Kee.selected&&"select");this.enabledDataSorting&&(Kee.startXPos=_ee.reversed?-(Oee.width||0):_ee.width);var xee=Kee.isInside!==!1;$te?$te[xee?"show":"hide"](xee).animate(Oee):xee&&(0<(Oee.width||0)||Kee.hasImage)&&(Kee.graphic=$te=Wee.renderer.symbol(fee,Oee.x,Oee.y,Oee.width,Oee.height,dee?Rte:Bee).add(Nte),this.enabledDataSorting&&Wee.hasRendered&&($te.attr({x:Kee.startXPos}),Iee="animate")),$te&&Iee==="animate"&&$te[xee?"show":"hide"](xee).animate(Oee),$te&&!Wee.styledMode&&$te[Iee](this.pointAttribs(Kee,Kee.selected&&"select")),$te&&$te.addClass(Kee.getClassName(),!0)}else $te&&(Kee.graphic=$te.destroy())}},Ote.prototype.markerAttribs=function(nee,Wee){var Bee=this.options,Nte=Bee.marker,_ee=nee.marker||{},st=_ee.symbol||Nte.symbol,Lee=ft(_ee.radius,Nte.radius);return Wee&&(Nte=Nte.states[Wee],Wee=_ee.states&&_ee.states[Wee],Lee=ft(Wee&&Wee.radius,Nte&&Nte.radius,Lee+(Nte&&Nte.radiusPlus||0))),nee.hasImage=st&&st.indexOf("url")===0,nee.hasImage&&(Lee=0),nee={x:Bee.crisp?Math.floor(nee.plotX-Lee):nee.plotX-Lee,y:nee.plotY-Lee},Lee&&(nee.width=nee.height=2*Lee),nee},Ote.prototype.pointAttribs=function(nee,Wee){var Bee=this.options.marker,Nte=nee&&nee.options,_ee=Nte&&Nte.marker||{},st=Nte&&Nte.color,Lee=nee&&nee.color,$te=nee&&nee.zone&&nee.zone.color,Kee=this.color;return nee=ft(_ee.lineWidth,Bee.lineWidth),Nte=1,Kee=st||$te||Lee||Kee,st=_ee.fillColor||Bee.fillColor||Kee,Lee=_ee.lineColor||Bee.lineColor||Kee,Wee=Wee||"normal",Bee=Bee.states[Wee]||{},Wee=_ee.states&&_ee.states[Wee]||{},nee=ft(Wee.lineWidth,Bee.lineWidth,nee+ft(Wee.lineWidthPlus,Bee.lineWidthPlus,0)),st=Wee.fillColor||Bee.fillColor||st,Lee=Wee.lineColor||Bee.lineColor||Lee,Nte=ft(Wee.opacity,Bee.opacity,Nte),{stroke:Lee,"stroke-width":nee,fill:st,opacity:Nte}},Ote.prototype.destroy=function(nee){var Wee=this,Bee=Wee.chart,Nte=/AppleWebKit\/533/.test(D.navigator.userAgent),_ee=Wee.data||[],st,Lee,$te,Kee;for(Ge(Wee,"destroy"),this.removeEvents(nee),(Wee.axisTypes||[]).forEach(function(Iee){(Kee=Wee[Iee])&&Kee.series&&(ce(Kee.series,Wee),Kee.isDirty=Kee.forceRedraw=!0)}),Wee.legendItem&&Wee.chart.legend.destroyItem(Wee),Lee=_ee.length;Lee--;)($te=_ee[Lee])&&$te.destroy&&$te.destroy();Wee.clips&&Wee.clips.forEach(function(Iee){return Iee.destroy()}),w.clearTimeout(Wee.animationTimeout),et(Wee,function(Iee,Rte){Iee instanceof E&&!Iee.survive&&(st=Nte&&Rte==="group"?"hide":"destroy",Iee[st]())}),Bee.hoverSeries===Wee&&(Bee.hoverSeries=void 0),ce(Bee.series,Wee),Bee.orderSeries(),et(Wee,function(Iee,Rte){nee&&Rte==="hcEvents"||delete Wee[Rte]})},Ote.prototype.applyZones=function(){var nee=this,Wee=this.chart,Bee=Wee.renderer,Nte=this.zones,_ee=this.clips||[],st=this.graph,Lee=this.area,$te=Math.max(Wee.chartWidth,Wee.chartHeight),Kee=this[(this.zoneAxis||"y")+"Axis"],Iee=Wee.inverted,Rte,dee,fee,Oee,xee,kee,Dte,Ite,Lte=!1;if(Nte.length&&(st||Lee)&&Kee&&typeof Kee.min<"u"){var Vte=Kee.reversed,Pte=Kee.horiz;st&&!this.showLine&&st.hide(),Lee&&Lee.hide();var Fte=Kee.getExtremes();Nte.forEach(function(Ute,Gte){Rte=Vte?Pte?Wee.plotWidth:0:Pte?0:Kee.toPixels(Fte.min)||0,Rte=U(ft(dee,Rte),0,$te),dee=U(Math.round(Kee.toPixels(ft(Ute.value,Fte.max),!0)||0),0,$te),Lte&&(Rte=dee=Kee.toPixels(Fte.max)),Oee=Math.abs(Rte-dee),xee=Math.min(Rte,dee),kee=Math.max(Rte,dee),Kee.isXAxis?(fee={x:Iee?kee:xee,y:0,width:Oee,height:$te},Pte||(fee.x=Wee.plotHeight-fee.x)):(fee={x:0,y:Iee?kee:xee,width:$te,height:Oee},Pte&&(fee.y=Wee.plotWidth-fee.y)),Iee&&Bee.isVML&&(fee=Kee.isXAxis?{x:0,y:Vte?xee:kee,height:fee.width,width:Wee.chartWidth}:{x:fee.y-Wee.plotLeft-Wee.spacingBox.x,y:0,width:fee.height,height:Wee.chartHeight}),_ee[Gte]?_ee[Gte].animate(fee):_ee[Gte]=Bee.clipRect(fee),Dte=nee["zone-area-"+Gte],Ite=nee["zone-graph-"+Gte],st&&Ite&&Ite.clip(_ee[Gte]),Lee&&Dte&&Dte.clip(_ee[Gte]),Lte=Ute.value>Fte.max,nee.resetZones&&dee===0&&(dee=void 0)}),this.clips=_ee}else nee.visible&&(st&&st.show(!0),Lee&&Lee.show(!0))},Ote.prototype.invertGroups=function(nee){function Wee(){["group","markerGroup"].forEach(function(_ee){Bee[_ee]&&(Nte.renderer.isVML&&Bee[_ee].attr({width:Bee.yAxis.len,height:Bee.xAxis.len}),Bee[_ee].width=Bee.yAxis.len,Bee[_ee].height=Bee.xAxis.len,Bee[_ee].invert(Bee.isRadialSeries?!1:nee))})}var Bee=this,Nte=Bee.chart;Bee.xAxis&&(Bee.eventsToUnbind.push(I(Nte,"resize",Wee)),Wee(),Bee.invertGroups=Wee)},Ote.prototype.plotGroup=function(nee,Wee,Bee,Nte,_ee){var st=this[nee],Lee=!st;return Bee={visibility:Bee,zIndex:Nte||.1},typeof this.opacity>"u"||this.chart.styledMode||this.state==="inactive"||(Bee.opacity=this.opacity),Lee&&(this[nee]=st=this.chart.renderer.g().add(_ee)),st.addClass("highcharts-"+Wee+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(ie(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(st.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0),st.attr(Bee)[Lee?"attr":"animate"](this.getPlotBox()),st},Ote.prototype.getPlotBox=function(){var nee=this.chart,Wee=this.xAxis,Bee=this.yAxis;return nee.inverted&&(Wee=Bee,Bee=this.xAxis),{translateX:Wee?Wee.left:nee.plotLeft,translateY:Bee?Bee.top:nee.plotTop,scaleX:1,scaleY:1}},Ote.prototype.removeEvents=function(nee){nee||yee(this),this.eventsToUnbind.length&&(this.eventsToUnbind.forEach(function(Wee){Wee()}),this.eventsToUnbind.length=0)},Ote.prototype.render=function(){var nee=this,Wee=nee.chart,Bee=nee.options,Nte=T(Bee.animation),_ee=nee.visible?"inherit":"hidden",st=Bee.zIndex,Lee=nee.hasRendered,$te=Wee.seriesGroup,Kee=Wee.inverted;Wee=!nee.finishedAnimating&&Wee.renderer.isSVG?Nte.duration:0,Ge(this,"render");var Iee=nee.plotGroup("group","series",_ee,st,$te);nee.markerGroup=nee.plotGroup("markerGroup","markers",_ee,st,$te),Bee.clip!==!1&&nee.setClip(),nee.animate&&Wee&&nee.animate(!0),Iee.inverted=ft(nee.invertible,nee.isCartesian)?Kee:!1,nee.drawGraph&&(nee.drawGraph(),nee.applyZones()),nee.visible&&nee.drawPoints(),nee.drawDataLabels&&nee.drawDataLabels(),nee.redrawPoints&&nee.redrawPoints(),nee.drawTracker&&nee.options.enableMouseTracking!==!1&&nee.drawTracker(),nee.invertGroups(Kee),nee.animate&&Wee&&nee.animate(),Lee||(Wee&&Nte.defer&&(Wee+=Nte.defer),nee.animationTimeout=xte(function(){nee.afterAnimate()},Wee||0)),nee.isDirty=!1,nee.hasRendered=!0,Ge(nee,"afterRender")},Ote.prototype.redraw=function(){var nee=this.chart,Wee=this.isDirty||this.isDirtyData,Bee=this.group,Nte=this.xAxis,_ee=this.yAxis;Bee&&(nee.inverted&&Bee.attr({width:nee.plotWidth,height:nee.plotHeight}),Bee.animate({translateX:ft(Nte&&Nte.left,nee.plotLeft),translateY:ft(_ee&&_ee.top,nee.plotTop)})),this.translate(),this.render(),Wee&&delete this.kdTree},Ote.prototype.searchPoint=function(nee,Wee){var Bee=this.xAxis,Nte=this.yAxis,_ee=this.chart.inverted;return this.searchKDTree({clientX:_ee?Bee.len-nee.chartY+Bee.pos:nee.chartX-Bee.pos,plotY:_ee?Nte.len-nee.chartX+Nte.pos:nee.chartY-Nte.pos},Wee,nee)},Ote.prototype.buildKDTree=function(nee){function Wee(_ee,st,Lee){var $te=_ee&&_ee.length;if($te){var Kee=Bee.kdAxisArray[st%Lee];return _ee.sort(function(Iee,Rte){return Iee[Kee]-Rte[Kee]}),$te=Math.floor($te/2),{point:_ee[$te],left:Wee(_ee.slice(0,$te),st+1,Lee),right:Wee(_ee.slice($te+1),st+1,Lee)}}}this.buildingKdTree=!0;var Bee=this,Nte=-1Oee?"left":"right",kee=0>Oee?"right":"left",Iee[Dte]&&(Dte=Nte(Kee,Iee[Dte],Rte+1,dee),xee=Dte[$te]Oee;)xee--;this.updateParallelArrays(fee,"splice",xee,0,0),this.updateParallelArrays(fee,xee),Kee&&fee.name&&(Kee[Oee]=fee.name),Iee.splice(xee,0,nee),dee&&(this.data.splice(xee,0,null),this.processData()),st.legendType==="point"&&this.generatePoints(),Bee&&(Lee[0]&&Lee[0].remove?Lee[0].remove(!1):(Lee.shift(),this.updateParallelArrays(fee,"shift"),Iee.shift())),_ee!==!1&&Ge(this,"addPoint",{point:fee}),this.isDirtyData=this.isDirty=!0,Wee&&$te.redraw(Nte)},Ote.prototype.removePoint=function(nee,Wee,Bee){var Nte=this,_ee=Nte.data,st=_ee[nee],Lee=Nte.points,$te=Nte.chart,Kee=function(){Lee&&Lee.length===_ee.length&&Lee.splice(nee,1),_ee.splice(nee,1),Nte.options.data.splice(nee,1),Nte.updateParallelArrays(st||{series:Nte},"splice",nee,1),st&&st.destroy(),Nte.isDirty=!0,Nte.isDirtyData=!0,Wee&&$te.redraw()};k(Bee,$te),Wee=ft(Wee,!0),st?st.firePointEvent("remove",null,Kee):Kee()},Ote.prototype.remove=function(nee,Wee,Bee,Nte){function _ee(){st.destroy(Nte),Lee.isDirtyLegend=Lee.isDirtyBox=!0,Lee.linkSeries(),ft(nee,!0)&&Lee.redraw(Wee)}var st=this,Lee=st.chart;Bee!==!1?Ge(st,"remove",null,_ee):_ee()},Ote.prototype.update=function(nee,Wee){nee=J(nee,this.userOptions),Ge(this,"update",{options:nee});var Bee=this,Nte=Bee.chart,_ee=Bee.userOptions,st=Bee.initialType||Bee.type,Lee=Nte.options.plotOptions,$te=P[st].prototype,Kee=Bee.finishedAnimating&&{animation:!1},Iee={},Rte,dee=["eventOptions","navigatorSeries","baseSeries"],fee=nee.type||_ee.type||Nte.options.chart.type,Oee=!(this.hasDerivedData||fee&&fee!==this.type||typeof nee.pointStart<"u"||typeof nee.pointInterval<"u"||typeof nee.relativeXValue<"u"||Bee.hasOptionChanged("dataGrouping")||Bee.hasOptionChanged("pointStart")||Bee.hasOptionChanged("pointInterval")||Bee.hasOptionChanged("pointIntervalUnit")||Bee.hasOptionChanged("keys"));if(fee=fee||st,Oee&&(dee.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","_hasPointLabels","clips","nodes","layout","mapMap","mapData","minY","maxY","minX","maxX"),nee.visible!==!1&&dee.push("area","graph"),Bee.parallelArrays.forEach(function(kee){dee.push(kee+"Data")}),nee.data&&(nee.dataSorting&&B(Bee.options.dataSorting,nee.dataSorting),this.setData(nee.data,!1))),nee=Tee(_ee,Kee,{index:typeof _ee.index>"u"?Bee.index:_ee.index,pointStart:ft(Lee&&Lee.series&&Lee.series.pointStart,_ee.pointStart,Bee.xData[0])},!Oee&&{data:Bee.options.data},nee),Oee&&nee.data&&(nee.data=Bee.options.data),dee=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(dee),dee.forEach(function(kee){dee[kee]=Bee[kee],delete Bee[kee]}),Lee=!1,P[fee]){if(Lee=fee!==Bee.type,Bee.remove(!1,!1,!1,!0),Lee)if(Object.setPrototypeOf)Object.setPrototypeOf(Bee,P[fee].prototype);else{Kee=Object.hasOwnProperty.call(Bee,"hcEvents")&&Bee.hcEvents;for(Rte in $te)Bee[Rte]=void 0;B(Bee,P[fee].prototype),Kee?Bee.hcEvents=Kee:delete Bee.hcEvents}}else Y(17,!0,Nte,{missingModuleFor:fee});if(dee.forEach(function(kee){Bee[kee]=dee[kee]}),Bee.init(Nte,nee),Oee&&this.points){var xee=Bee.options;xee.visible===!1?(Iee.graphic=1,Iee.dataLabel=1):Bee._hasPointLabels||(nee=xee.marker,$te=xee.dataLabels,!nee||nee.enabled!==!1&&(_ee.marker&&_ee.marker.symbol)===nee.symbol||(Iee.graphic=1),$te&&$te.enabled===!1&&(Iee.dataLabel=1)),this.points.forEach(function(kee){kee&&kee.series&&(kee.resolveColor(),Object.keys(Iee).length&&kee.destroyElements(Iee),xee.showInLegend===!1&&kee.legendItem&&Nte.legend.destroyItem(kee))},this)}Bee.initialType=st,Nte.linkSeries(),Lee&&Bee.linkedSeries.length&&(Bee.isDirtyData=!0),Ge(this,"afterUpdate"),ft(Wee,!0)&&Nte.redraw(Oee?void 0:!1)},Ote.prototype.setName=function(nee){this.name=this.options.name=this.userOptions.name=nee,this.chart.isDirtyLegend=!0},Ote.prototype.hasOptionChanged=function(nee){var Wee=this.options[nee],Bee=this.chart.options.plotOptions,Nte=this.userOptions[nee];return Nte?Wee!==Nte:Wee!==ft(Bee&&Bee[this.type]&&Bee[this.type][nee],Bee&&Bee.series&&Bee.series[nee],Wee)},Ote.prototype.onMouseOver=function(){var nee=this.chart,Wee=nee.hoverSeries;nee.pointer.setHoverChartIndex(),Wee&&Wee!==this&&Wee.onMouseOut(),this.options.events.mouseOver&&Ge(this,"mouseOver"),this.setState("hover"),nee.hoverSeries=this},Ote.prototype.onMouseOut=function(){var nee=this.options,Wee=this.chart,Bee=Wee.tooltip,Nte=Wee.hoverPoint;Wee.hoverSeries=null,Nte&&Nte.onMouseOut(),this&&nee.events.mouseOut&&Ge(this,"mouseOut"),!Bee||this.stickyTracking||Bee.shared&&!this.noSharedTooltip||Bee.hide(),Wee.series.forEach(function(_ee){_ee.setState("",!0)})},Ote.prototype.setState=function(nee,Wee){var Bee=this,Nte=Bee.options,_ee=Bee.graph,st=Nte.inactiveOtherPoints,Lee=Nte.states,$te=ft(Lee[nee||"normal"]&&Lee[nee||"normal"].animation,Bee.chart.options.chart.animation),Kee=Nte.lineWidth,Iee=0,Rte=Nte.opacity;if(nee=nee||"",Bee.state!==nee&&([Bee.group,Bee.markerGroup,Bee.dataLabelsGroup].forEach(function(dee){dee&&(Bee.state&&dee.removeClass("highcharts-series-"+Bee.state),nee&&dee.addClass("highcharts-series-"+nee))}),Bee.state=nee,!Bee.chart.styledMode)){if(Lee[nee]&&Lee[nee].enabled===!1)return;if(nee&&(Kee=Lee[nee].lineWidth||Kee+(Lee[nee].lineWidthPlus||0),Rte=ft(Lee[nee].opacity,Rte)),_ee&&!_ee.dashstyle)for(Nte={"stroke-width":Kee},_ee.animate(Nte,$te);Bee["zone-graph-"+Iee];)Bee["zone-graph-"+Iee].animate(Nte,$te),Iee+=1;st||[Bee.group,Bee.markerGroup,Bee.dataLabelsGroup,Bee.labelBySeries].forEach(function(dee){dee&&dee.animate({opacity:Rte},$te)})}Wee&&st&&Bee.points&&Bee.setAllPointsToState(nee||void 0)},Ote.prototype.setAllPointsToState=function(nee){this.points.forEach(function(Wee){Wee.setState&&Wee.setState(nee)})},Ote.prototype.setVisible=function(nee,Wee){var Bee=this,Nte=Bee.chart,_ee=Bee.legendItem,st=Nte.options.chart.ignoreHiddenSeries,Lee=Bee.visible,$te=(Bee.visible=nee=Bee.options.visible=Bee.userOptions.visible=typeof nee>"u"?!Lee:nee)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach(function(Kee){Bee[Kee]&&Bee[Kee][$te]()}),(Nte.hoverSeries===Bee||(Nte.hoverPoint&&Nte.hoverPoint.series)===Bee)&&Bee.onMouseOut(),_ee&&Nte.legend.colorizeItem(Bee,nee),Bee.isDirty=!0,Bee.options.stacking&&Nte.series.forEach(function(Kee){Kee.options.stacking&&Kee.visible&&(Kee.isDirty=!0)}),Bee.linkedSeries.forEach(function(Kee){Kee.setVisible(nee,!1)}),st&&(Nte.isDirtyBox=!0),Ge(Bee,$te),Wee!==!1&&Nte.redraw()},Ote.prototype.show=function(){this.setVisible(!0)},Ote.prototype.hide=function(){this.setVisible(!1)},Ote.prototype.select=function(nee){this.selected=nee=this.options.selected=typeof nee>"u"?!this.selected:nee,this.checkbox&&(this.checkbox.checked=nee),Ge(this,nee?"select":"unselect")},Ote.prototype.shouldShowTooltip=function(nee,Wee,Bee){return Bee===void 0&&(Bee={}),Bee.series=this,Bee.visiblePlotOnly=!0,this.chart.isInsidePlot(nee,Wee,Bee)},Ote.defaultOptions=y,Ote}(),B(l.prototype,{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,drawLegendSymbol:m.drawLineMarker,isCartesian:!0,kdAxisArray:["clientX","plotY"],parallelArrays:["x","y"],pointClass:g,requireSorting:!0,sorted:!0}),_.series=l,l}),s(a,"Extensions/ScrollablePlotArea.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Axis/Axis.js"],a["Core/Chart/Chart.js"],a["Core/Series/Series.js"],a["Core/Renderer/RendererRegistry.js"],a["Core/Utilities.js"]],function(l,c,u,d,m,g){var y=l.stop,_=g.addEvent,E=g.createElement,w=g.merge,T=g.pick;_(u,"afterSetChartSize",function(k){var O=this.options.chart.scrollablePlotArea,R=O&&O.minWidth;if(O=O&&O.minHeight,!this.renderer.forExport){if(R){if(this.scrollablePixelsX=R=Math.max(0,R-this.chartWidth)){this.scrollablePlotBox=this.renderer.scrollablePlotBox=w(this.plotBox),this.plotBox.width=this.plotWidth+=R,this.inverted?this.clipBox.height+=R:this.clipBox.width+=R;var M={1:{name:"right",value:R}}}}else O&&(this.scrollablePixelsY=R=Math.max(0,O-this.chartHeight))&&(this.scrollablePlotBox=this.renderer.scrollablePlotBox=w(this.plotBox),this.plotBox.height=this.plotHeight+=R,this.inverted?this.clipBox.width+=R:this.clipBox.height+=R,M={2:{name:"bottom",value:R}});M&&!k.skipAxes&&this.axes.forEach(function(N){M[N.side]?N.getPlotLinePath=function(){var D=M[N.side].name,P=this[D];this[D]=P-M[N.side].value;var I=c.prototype.getPlotLinePath.apply(this,arguments);return this[D]=P,I}:(N.setAxisSize(),N.setAxisTranslation())})}}),_(u,"render",function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()}),u.prototype.setUpScrolling=function(){var k=this,O={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(O.overflowX="auto"),this.scrollablePixelsY&&(O.overflowY="auto"),this.scrollingParent=E("div",{className:"highcharts-scrolling-parent"},{position:"relative"},this.renderTo),this.scrollingContainer=E("div",{className:"highcharts-scrolling"},O,this.scrollingParent),_(this.scrollingContainer,"scroll",function(){k.pointer&&delete k.pointer.chartPosition}),this.innerContainer=E("div",{className:"highcharts-inner-container"},null,this.scrollingContainer),this.innerContainer.appendChild(this.container),this.setUpScrolling=null},u.prototype.moveFixedElements=function(){var k=this.container,O=this.fixedRenderer,R=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-drillup-button .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" "),M;this.scrollablePixelsX&&!this.inverted?M=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted||this.scrollablePixelsY&&!this.inverted?M=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(M=".highcharts-yaxis"),M&&R.push(M+":not(.highcharts-radial-axis)",M+"-labels:not(.highcharts-radial-axis-labels)"),R.forEach(function(N){[].forEach.call(k.querySelectorAll(N),function(D){(D.namespaceURI===O.SVG_NS?O.box:O.box.parentNode).appendChild(D),D.style.pointerEvents="auto"})})},u.prototype.applyFixed=function(){var k=!this.fixedDiv,O=this.options.chart,R=O.scrollablePlotArea,M=m.getRendererType();k?(this.fixedDiv=E("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:(O.style&&O.style.zIndex||0)+2,top:0},null,!0),this.scrollingContainer&&this.scrollingContainer.parentNode.insertBefore(this.fixedDiv,this.scrollingContainer),this.renderTo.style.overflow="visible",this.fixedRenderer=O=new M(this.fixedDiv,this.chartWidth,this.chartHeight,this.options.chart.style),this.scrollableMask=O.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":T(R.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),_(this,"afterShowResetZoom",this.moveFixedElements),_(this,"afterDrilldown",this.moveFixedElements),_(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight),(this.scrollableDirty||k)&&(this.scrollableDirty=!1,this.moveFixedElements()),O=this.chartWidth+(this.scrollablePixelsX||0),M=this.chartHeight+(this.scrollablePixelsY||0),y(this.container),this.container.style.width=O+"px",this.container.style.height=M+"px",this.renderer.boxWrapper.attr({width:O,height:M,viewBox:[0,0,O,M].join(" ")}),this.chartBackground.attr({width:O,height:M}),this.scrollingContainer.style.height=this.chartHeight+"px",k&&(R.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*R.scrollPositionX),R.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*R.scrollPositionY)),M=this.axisOffset,k=this.plotTop-M[0]-1,R=this.plotLeft-M[3]-1,O=this.plotTop+this.plotHeight+M[2]+1,M=this.plotLeft+this.plotWidth+M[1]+1;var N=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),D=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);k=this.scrollablePixelsX?[["M",0,k],["L",this.plotLeft-1,k],["L",this.plotLeft-1,O],["L",0,O],["Z"],["M",N,k],["L",this.chartWidth,k],["L",this.chartWidth,O],["L",N,O],["Z"]]:this.scrollablePixelsY?[["M",R,0],["L",R,this.plotTop-1],["L",M,this.plotTop-1],["L",M,0],["Z"],["M",R,D],["L",R,this.chartHeight],["L",M,this.chartHeight],["L",M,D],["Z"]]:[["M",0,0]],this.redrawTrigger!=="adjustHeight"&&this.scrollableMask.attr({d:k})},_(c,"afterInit",function(){this.chart.scrollableDirty=!0}),_(d,"show",function(){this.chart.scrollableDirty=!0})}),s(a,"Core/Axis/StackingAxis.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Axis/Axis.js"],a["Core/Utilities.js"]],function(l,c,u){var d=l.getDeferredAnimation,m=u.addEvent,g=u.destroyObjectProperties,y=u.fireEvent,_=u.isNumber,E=u.objectEach,w;return function(T){function k(){var N=this.stacking;if(N){var D=N.stacks;E(D,function(P,I){g(P),D[I]=null}),N&&N.stackTotalGroup&&N.stackTotalGroup.destroy()}}function O(){this.stacking||(this.stacking=new M(this))}var R=[];T.compose=function(N){return R.indexOf(N)===-1&&(R.push(N),m(N,"init",O),m(N,"destroy",k)),N};var M=function(){function N(D){this.oldStacks={},this.stacks={},this.stacksTouched=0,this.axis=D}return N.prototype.buildStacks=function(){var D=this.axis,P=D.series,I=D.options.reversedStacks,L=P.length,F;if(!D.isXAxis){for(this.usePercentage=!1,F=L;F--;){var U=P[I?F:L-F-1];U.setStackedPoints(),U.setGroupedPoints()}for(F=0;FM&&w.shadow)),D&&(D.startX=T.xMap,D.isArea=T.isArea)})},_.prototype.getGraphPath=function(E,w,T){var k=this,O=k.options,R=[],M=[],N,D=O.step;E=E||k.points;var P=E.reversed;return P&&E.reverse(),(D={right:1,center:2}[D]||D&&3)&&P&&(D=4-D),E=this.getValidPoints(E,!1,!(O.connectNulls&&!w&&!T)),E.forEach(function(I,L){var F=I.plotX,U=I.plotY,J=E[L-1];(I.leftCliff||J&&J.rightCliff)&&!T&&(N=!0),I.isNull&&!m(w)&&0E&&P>O?(P=Math.max(E,O),I=2*O-P):PT&&I>O?(I=Math.max(T,O),P=2*O-I):I"u"&&(V[Ge]=St++);var yee=V[Ge]}else ft.grouping!==!1&&(yee=St++);Tee.columnIndex=yee}});var Dee=Math.min(Math.abs(ce.transA)*(ce.ordinal&&ce.ordinal.slope||ie.pointRange||ce.closestPointRange||ce.tickInterval||1),ce.len),pee=Dee*ie.groupPadding,jr=(Dee-2*pee)/(St||1);return ie=Math.min(ie.maxPointWidth||ce.len,L(ie.pointWidth,jr*(1-2*ie.pointPadding))),z.columnMetrics={width:ie,offset:(jr-ie)/2+(pee+((z.columnIndex||0)+(B?1:0))*jr-Dee/2)*(B?-1:1),paddedWidth:jr,columnCount:St},z.columnMetrics},J.prototype.crispCol=function(z,ie,ce,Y){var B=this.chart,V=this.borderWidth,Ge=-(V%2?.5:0);return V=V%2?.5:1,B.inverted&&B.renderer.isVML&&(V+=1),this.options.crisp&&(ce=Math.round(z+ce)+Ge,z=Math.round(z)+Ge,ce-=z),Y=Math.round(ie+Y)+V,Ge=.5>=Math.abs(ie)&&.5z.closestPointRange*z.xAxis.transA;Y=z.borderWidth=L(ce.borderWidth,Y?0:1);var B=z.xAxis,V=z.yAxis,Ge=ce.threshold,St=z.translatedThreshold=V.getThreshold(Ge),Dee=L(ce.minPointLength,5),pee=z.getColumnMetrics(),jr=pee.width,Tee=z.pointXOffset=pee.offset,et=z.dataMin,ft=z.dataMax,yee=z.barW=Math.max(jr,1+2*Y);ie.inverted&&(St-=.5),ce.pointPadding&&(yee=Math.ceil(yee)),m.prototype.translate.apply(z),z.points.forEach(function(ete){var xte=L(ete.yBottom,St),Ote=999+Math.abs(xte),nee=ete.plotX||0;Ote=k(ete.plotY,-Ote,V.len+Ote);var Wee=Math.min(Ote,xte),Bee=Math.max(Ote,xte)-Wee,Nte=jr,_ee=nee+Tee,st=yee;Dee&&Math.abs(Bee)Dee?xte-Dee:St-(nee?Dee:0)),R(ete.options.pointWidth)&&(Nte=st=Math.ceil(ete.options.pointWidth),_ee-=Math.round((Nte-jr)/2)),ce.centerInCategory&&(_ee=z.adjustForMissingColumns(_ee,Nte,ete,pee)),ete.barX=_ee,ete.pointWidth=Nte,ete.tooltipPos=ie.inverted?[k(V.len+V.pos-ie.plotLeft-Ote,V.pos-ie.plotLeft,V.len+V.pos-ie.plotLeft),B.len+B.pos-ie.plotTop-_ee-st/2,Bee]:[B.left-ie.plotLeft+_ee+st/2,k(Ote+V.pos-ie.plotTop,V.pos-ie.plotTop,V.len+V.pos-ie.plotTop),Bee],ete.shapeType=z.pointClass.prototype.shapeType||"rect",ete.shapeArgs=z.crispCol.apply(z,ete.isNull?[_ee,St,st,0]:[_ee,Wee,st,Bee])})},J.prototype.drawGraph=function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},J.prototype.pointAttribs=function(z,ie){var ce=this.options,Y=this.pointAttrToOptions||{},B=Y.stroke||"borderColor",V=Y["stroke-width"]||"borderWidth",Ge=z&&z.color||this.color,St=z&&z[B]||ce[B]||Ge;Y=z&&z.options.dashStyle||ce.dashStyle;var Dee=z&&z[V]||ce[V]||this[V]||0,pee=L(z&&z.opacity,ce.opacity,1);if(z&&this.zones.length){var jr=z.getZone();Ge=z.options.color||jr&&(jr.color||z.nonZonedColor)||this.color,jr&&(St=jr.borderColor||St,Y=jr.dashStyle||Y,Dee=jr.borderWidth||Dee)}return ie&&z&&(z=I(ce.states[ie],z.options.states&&z.options.states[ie]||{}),ie=z.brightness,Ge=z.color||typeof ie<"u"&&w(Ge).brighten(z.brightness).get()||Ge,St=z[B]||St,Dee=z[V]||Dee,Y=z.dashStyle||Y,pee=L(z.opacity,pee)),B={fill:Ge,stroke:St,"stroke-width":Dee,opacity:pee},Y&&(B.dashstyle=Y),B},J.prototype.drawPoints=function(){var z=this,ie=this.chart,ce=z.options,Y=ie.renderer,B=ce.animationLimit||250,V;z.points.forEach(function(Ge){var St=Ge.graphic,Dee=!!St,pee=St&&ie.pointCountyee,et==="left"?Dee.y-=yee?jr.height:0:et==="center"?(Dee.x-=jr.width/2,Dee.y-=jr.height/2):et==="right"&&(Dee.x-=jr.width,Dee.y-=yee?0:jr.height),z.placed=!0,z.alignAttr=Dee):(yee(ce),z.align(ie,void 0,ce),Dee=z.alignAttr),ete&&0<=ce.height?this.justifyDataLabel(z,ie,Dee,jr,ce,Y):k(ie.crop,!0)&&(xte=V.isInsidePlot(Dee.x,Dee.y,{paneCoordinates:!0,series:B})&&V.isInsidePlot(Dee.x+jr.width,Dee.y+jr.height,{paneCoordinates:!0,series:B})),ie.shape&&!Tee&&z[Y?"attr":"animate"]({anchorX:Ge?V.plotWidth-J.plotY:J.plotX,anchorY:Ge?V.plotHeight-J.plotX:J.plotY})}Y&&St&&(z.placed=!1),xte||St&&!ete||(z.hide(!0),z.placed=!1)}function D(J,z){var ie=z.filter;return ie?(z=ie.operator,J=J[ie.property],ie=ie.value,z===">"&&J>ie||z==="<"&&J="&&J>=ie||z==="<="&&J<=ie||z==="=="&&J==ie||z==="==="&&J===ie):!0}function P(){var J=this,z=J.chart,ie=J.options,ce=J.points,Y=J.hasRendered||0,B=z.renderer,V=ie.dataLabels,Ge,St=V.animation;if(St=V.defer?d(z,St,J):{defer:0,duration:0},V=L(L(z.options.plotOptions&&z.options.plotOptions.series&&z.options.plotOptions.series.dataLabels,z.options.plotOptions&&z.options.plotOptions[J.type]&&z.options.plotOptions[J.type].dataLabels),V),_(this,"drawDataLabels"),E(V)||V.enabled||J._hasPointLabels){var Dee=J.plotGroup("dataLabelsGroup","data-labels",Y?"inherit":"hidden",V.zIndex||6);Dee.attr({opacity:+Y}),!Y&&(Y=J.dataLabelsGroup)&&(J.visible&&Dee.show(!0),Y[ie.animation?"animate":"attr"]({opacity:1},St)),ce.forEach(function(pee){Ge=O(L(V,pee.dlOptions||pee.options&&pee.options.dataLabels)),Ge.forEach(function(jr,Tee){var et=jr.enabled&&(!pee.isNull||pee.dataLabelOnNull)&&D(pee,jr),ft=pee.connectors?pee.connectors[Tee]:pee.connector,yee=pee.dataLabels?pee.dataLabels[Tee]:pee.dataLabel,ete=k(jr.distance,pee.labelDistance),xte=!yee;if(et){var Ote=pee.getLabelConfig(),nee=k(jr[pee.formatPrefix+"Format"],jr.format);Ote=g(nee)?m(nee,Ote,z):(jr[pee.formatPrefix+"Formatter"]||jr.formatter).call(Ote,jr),nee=jr.style;var Wee=jr.rotation;z.styledMode||(nee.color=k(jr.color,nee.color,J.color,"#000000"),nee.color==="contrast"?(pee.contrastColor=B.getContrast(pee.color||J.color),nee.color=!g(ete)&&jr.inside||0>ete||ie.stacking?pee.contrastColor:"#000000"):delete pee.contrastColor,ie.cursor&&(nee.cursor=ie.cursor));var Bee={r:jr.borderRadius||0,rotation:Wee,padding:jr.padding,zIndex:1};z.styledMode||(Bee.fill=jr.backgroundColor,Bee.stroke=jr.borderColor,Bee["stroke-width"]=jr.borderWidth),T(Bee,function(Nte,_ee){typeof Nte>"u"&&delete Bee[_ee]})}!yee||et&&g(Ote)&&!!yee.div==!!jr.useHTML||(pee.dataLabel=yee=pee.dataLabel&&pee.dataLabel.destroy(),pee.dataLabels&&(pee.dataLabels.length===1?delete pee.dataLabels:delete pee.dataLabels[Tee]),Tee||delete pee.dataLabel,ft&&(pee.connector=pee.connector.destroy(),pee.connectors&&(pee.connectors.length===1?delete pee.connectors:delete pee.connectors[Tee]))),et&&g(Ote)&&(yee?Bee.text=Ote:(pee.dataLabels=pee.dataLabels||[],yee=pee.dataLabels[Tee]=Wee?B.text(Ote,0,-9999,jr.useHTML).addClass("highcharts-data-label"):B.label(Ote,0,-9999,jr.shape,null,null,jr.useHTML,null,"data-label"),Tee||(pee.dataLabel=yee),yee.addClass(" highcharts-data-label-color-"+pee.colorIndex+" "+(jr.className||"")+(jr.useHTML?" highcharts-tracker":""))),yee.options=jr,yee.attr(Bee),z.styledMode||yee.css(nee).shadow(jr.shadow),yee.added||yee.add(Dee),jr.textPath&&!jr.useHTML&&(yee.setTextPath(pee.getDataLabelPath&&pee.getDataLabelPath(yee)||pee.graphic,jr.textPath),pee.dataLabelPath&&!jr.textPath.enabled&&(pee.dataLabelPath=pee.dataLabelPath.destroy())),J.alignDataLabel(pee,yee,jr,null,xte))})})}_(this,"afterDrawDataLabels")}function I(J,z,ie,ce,Y,B){var V=this.chart,Ge=z.align,St=z.verticalAlign,Dee=J.box?0:J.padding||0,pee=z.x;pee=pee===void 0?0:pee;var jr=z.y;jr=jr===void 0?0:jr;var Tee=(ie.x||0)+Dee;if(0>Tee){Ge==="right"&&0<=pee?(z.align="left",z.inside=!0):pee-=Tee;var et=!0}return Tee=(ie.x||0)+ce.width-Dee,Tee>V.plotWidth&&(Ge==="left"&&0>=pee?(z.align="right",z.inside=!0):pee+=V.plotWidth-Tee,et=!0),Tee=ie.y+Dee,0>Tee&&(St==="bottom"&&0<=jr?(z.verticalAlign="top",z.inside=!0):jr-=Tee,et=!0),Tee=(ie.y||0)+ce.height-Dee,Tee>V.plotHeight&&(St==="top"&&0>=jr?(z.verticalAlign="bottom",z.inside=!0):jr+=V.plotHeight-Tee,et=!0),et&&(z.x=pee,z.y=jr,J.placed=!B,J.align(z,void 0,Y)),et}function L(J,z){var ie=[],ce;if(E(J)&&!E(z))ie=J.map(function(Y){return w(Y,z)});else if(E(z)&&!E(J))ie=z.map(function(Y){return w(J,Y)});else if(E(J)||E(z))for(ce=Math.max(J.length,z.length);ce--;)ie[ce]=w(J[ce],z[ce]);else ie=w(J,z);return ie}function F(J,z,ie,ce,Y){var B=this.chart,V=B.inverted,Ge=this.xAxis,St=Ge.reversed,Dee=V?z.height/2:z.width/2;J=(J=J.pointWidth)?J/2:0,z.startXPos=V?Y.x:St?-Dee-J:Ge.width-Dee+J,z.startYPos=V?St?this.yAxis.height-Dee+J:-Dee-J:Y.y,ce?z.visibility==="hidden"&&(z.show(),z.attr({opacity:0}).animate({opacity:1})):z.attr({opacity:1}).animate({opacity:0},void 0,z.hide),B.hasRendered&&(ie&&z.attr({x:z.startXPos,y:z.startYPos}),z.placed=!0)}var U=[];M.compose=function(J){if(U.indexOf(J)===-1){var z=J.prototype;U.push(J),z.alignDataLabel=N,z.drawDataLabels=P,z.justifyDataLabel=I,z.setDataLabelStartPos=F}}}(R||(R={})),R}),s(a,"Series/Column/ColumnDataLabel.js",[a["Core/Series/DataLabel.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(l,c,u){var d=c.series,m=u.merge,g=u.pick,y;return function(_){function E(T,k,O,R,M){var N=this.chart.inverted,D=T.series,P=(D.xAxis?D.xAxis.len:this.chart.plotSizeX)||0;D=(D.yAxis?D.yAxis.len:this.chart.plotSizeY)||0;var I=T.dlBox||T.shapeArgs,L=g(T.below,T.plotY>g(this.translatedThreshold,D)),F=g(O.inside,!!this.options.stacking);I&&(R=m(I),0>R.y&&(R.height+=R.y,R.y=0),I=R.y+R.height-D,0 {series.name}
',pointFormat:"x: {point.x}
y: {point.y}
"}}),w}(c),y(d.prototype,{drawTracker:l.prototype.drawTracker,sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1}),g(d,"afterTranslate",function(){this.applyJitter()}),u.registerSeriesType("scatter",d),d}),s(a,"Series/CenteredUtilities.js",[a["Core/Globals.js"],a["Core/Series/Series.js"],a["Core/Utilities.js"]],function(l,c,u){var d=l.deg2rad,m=u.isNumber,g=u.pick,y=u.relativeLength,_;return function(E){E.getCenter=function(){var w=this.options,T=this.chart,k=2*(w.slicedOffset||0),O=T.plotWidth-2*k,R=T.plotHeight-2*k,M=w.center,N=Math.min(O,R),D=w.size,P=w.innerSize||0;for(typeof D=="string"&&(D=parseFloat(D)),typeof P=="string"&&(P=parseFloat(P)),w=[g(M[0],"50%"),g(M[1],"50%"),g(D&&0>D?void 0:w.size,"100%"),g(P&&0>P?void 0:w.innerSize||0,"0%")],!T.angular||this instanceof c||(w[3]=0),M=0;4>M;++M)D=w[M],T=2>M||M===2&&/%$/.test(D),w[M]=y(D,[O,R,N,w[2]][M])+(T?k:0);return w[3]>w[2]&&(w[3]=w[2]),w},E.getStartAndEndRadians=function(w,T){return w=m(w)?w:0,T=m(T)&&T>w&&360>T-w?T:w+360,{start:d*(w+-90),end:d*(T+-90)}}}(_||(_={})),_}),s(a,"Series/Pie/PiePoint.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Series/Point.js"],a["Core/Utilities.js"]],function(l,c,u){var d=this&&this.__extends||function(){var T=function(k,O){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,M){R.__proto__=M}||function(R,M){for(var N in M)M.hasOwnProperty(N)&&(R[N]=M[N])},T(k,O)};return function(k,O){function R(){this.constructor=k}T(k,O),k.prototype=O===null?Object.create(O):(R.prototype=O.prototype,new R)}}(),m=l.setAnimation,g=u.addEvent,y=u.defined;l=u.extend;var _=u.isNumber,E=u.pick,w=u.relativeLength;return c=function(T){function k(){var O=T!==null&&T.apply(this,arguments)||this;return O.labelDistance=void 0,O.options=void 0,O.series=void 0,O}return d(k,T),k.prototype.getConnectorPath=function(){var O=this.labelPosition,R=this.series.options.dataLabels,M=this.connectorShapes,N=R.connectorShape;return M[N]&&(N=M[N]),N.call(this,{x:O.final.x,y:O.final.y,alignment:O.alignment},O.connectorPosition,R)},k.prototype.getTranslate=function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},k.prototype.haloPath=function(O){var R=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(R.x,R.y,R.r+O,R.r+O,{innerR:R.r-1,start:R.start,end:R.end})},k.prototype.init=function(){var O=this;T.prototype.init.apply(this,arguments),this.name=E(this.name,"Slice");var R=function(M){O.slice(M.type==="select")};return g(this,"select",R),g(this,"unselect",R),this},k.prototype.isValid=function(){return _(this.y)&&0<=this.y},k.prototype.setVisible=function(O,R){var M=this,N=this.series,D=N.chart,P=N.options.ignoreHiddenPoint;R=E(R,P),O!==this.visible&&(this.visible=this.options.visible=O=typeof O>"u"?!this.visible:O,N.options.data[N.data.indexOf(this)]=this.options,["graphic","dataLabel","connector","shadowGroup"].forEach(function(I){M[I]&&M[I][O?"show":"hide"](O)}),this.legendItem&&D.legend.colorizeItem(this,O),O||this.state!=="hover"||this.setState(""),P&&(N.isDirty=!0),R&&D.redraw())},k.prototype.slice=function(O,R,M){var N=this.series;m(M,N.chart),E(R,!0),this.sliced=this.options.sliced=y(O)?O:!this.sliced,N.options.data[N.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate()),this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},k}(c),l(c.prototype,{connectorShapes:{fixedOffset:function(T,k,O){var R=k.breakAt;return k=k.touchingSliceAt,[["M",T.x,T.y],O.softConnector?["C",T.x+(T.alignment==="left"?-5:5),T.y,2*R.x-k.x,2*R.y-k.y,R.x,R.y]:["L",R.x,R.y],["L",k.x,k.y]]},straight:function(T,k){return k=k.touchingSliceAt,[["M",T.x,T.y],["L",k.x,k.y]]},crookedLine:function(T,k,O){k=k.touchingSliceAt;var R=this.series,M=R.center[0],N=R.chart.plotWidth,D=R.chart.plotLeft;R=T.alignment;var P=this.shapeArgs.r;return O=w(O.crookDistance,1),N=R==="left"?M+P+(N+D-M-P)*(1-O):D+(M-P)*O,O=["L",N,T.y],M=!0,(R==="left"?N>T.x||Nk.x)&&(M=!1),T=[["M",T.x,T.y]],M&&T.push(O),T.push(["L",k.x,k.y]),T}}}),c}),s(a,"Series/Pie/PieSeries.js",[a["Series/CenteredUtilities.js"],a["Series/Column/ColumnSeries.js"],a["Core/Globals.js"],a["Core/Legend/LegendSymbol.js"],a["Series/Pie/PiePoint.js"],a["Core/Series/Series.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Renderer/SVG/Symbols.js"],a["Core/Utilities.js"]],function(l,c,u,d,m,g,y,_,E){var w=this&&this.__extends||function(){var P=function(I,L){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,U){F.__proto__=U}||function(F,U){for(var J in U)U.hasOwnProperty(J)&&(F[J]=U[J])},P(I,L)};return function(I,L){function F(){this.constructor=I}P(I,L),I.prototype=L===null?Object.create(L):(F.prototype=L.prototype,new F)}}(),T=l.getStartAndEndRadians;u=u.noop;var k=E.clamp,O=E.extend,R=E.fireEvent,M=E.merge,N=E.pick,D=E.relativeLength;return E=function(P){function I(){var L=P!==null&&P.apply(this,arguments)||this;return L.center=void 0,L.data=void 0,L.maxLabelDistance=void 0,L.options=void 0,L.points=void 0,L}return w(I,P),I.prototype.animate=function(L){var F=this,U=F.points,J=F.startAngleRad;L||U.forEach(function(z){var ie=z.graphic,ce=z.shapeArgs;ie&&ce&&(ie.attr({r:N(z.startR,F.center&&F.center[3]/2),start:J,end:J}),ie.animate({r:ce.r,start:ce.start,end:ce.end},F.options.animation))})},I.prototype.drawEmpty=function(){var L=this.startAngleRad,F=this.endAngleRad,U=this.options;if(this.total===0&&this.center){var J=this.center[0],z=this.center[1];this.graph||(this.graph=this.chart.renderer.arc(J,z,this.center[1]/2,0,L,F).addClass("highcharts-empty-series").add(this.group)),this.graph.attr({d:_.arc(J,z,this.center[2]/2,0,{start:L,end:F,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({"stroke-width":U.borderWidth,fill:U.fillColor||"none",stroke:U.color||"#cccccc"})}else this.graph&&(this.graph=this.graph.destroy())},I.prototype.drawPoints=function(){var L=this.chart.renderer;this.points.forEach(function(F){F.graphic&&F.hasNewShapeType()&&(F.graphic=F.graphic.destroy()),F.graphic||(F.graphic=L[F.shapeType](F.shapeArgs).add(F.series.group),F.delayedRendering=!0)})},I.prototype.generatePoints=function(){P.prototype.generatePoints.call(this),this.updateTotals()},I.prototype.getX=function(L,F,U){var J=this.center,z=this.radii?this.radii[U.index]||0:J[2]/2;return L=Math.asin(k((L-J[1])/(z+U.labelDistance),-1,1)),J[0]+(F?-1:1)*Math.cos(L)*(z+U.labelDistance)+(01.5*Math.PI?pee-=2*Math.PI:pee<-Math.PI/2&&(pee+=2*Math.PI),St.slicedTranslation={translateX:Math.round(Math.cos(pee)*U),translateY:Math.round(Math.sin(pee)*U)},jr=Math.cos(pee)*L[2]/2;var Tee=Math.sin(pee)*L[2]/2;St.tooltipPos=[L[0]+.7*jr,L[1]+.7*Tee],St.half=pee<-Math.PI/2||pee>Math.PI/2?1:0,St.angle=pee,Dee=Math.min(J,St.labelDistance/5),St.labelPosition={natural:{x:L[0]+jr+Math.cos(pee)*St.labelDistance,y:L[1]+Tee+Math.sin(pee)*St.labelDistance},final:{},alignment:0>St.labelDistance?"center":St.half?"right":"left",connectorPosition:{breakAt:{x:L[0]+jr+Math.cos(pee)*Dee,y:L[1]+Tee+Math.sin(pee)*Dee},touchingSliceAt:{x:L[0]+jr,y:L[1]+Tee}}}}R(this,"afterTranslate")},I.prototype.updateTotals=function(){var L=this.points,F=L.length,U=this.options.ignoreHiddenPoint,J,z=0;for(J=0;JGe&&($te.dataLabel.css({width:Math.round(.7*Ge)+"px"}),$te.dataLabel.shortened=!0)):($te.dataLabel=$te.dataLabel.destroy(),$te.dataLabels&&$te.dataLabels.length===1&&delete $te.dataLabels))}),jr.forEach(function($te,Kee){var Iee=$te.length,Rte=[],dee;if(Iee){if(U.sortByAngle($te,Kee-.5),0"u"?_ee="hidden":(Wee=ft.distributeBox.size,Nte=et.radialDistributionY(ft))),delete ft.positionIndex,ie.justify)Bee=et.justify(ft,Dee,St);else switch(ie.alignTo){case"connectors":Bee=et.alignToConnectors($te,Kee,Y,V);break;case"plotEdges":Bee=et.alignToPlotEdges(xte,Kee,Y,V);break;default:Bee=et.radialDistributionX(U,ft,Nte,fee)}xte._attr={visibility:_ee,align:nee.alignment},Lee=ft.options.dataLabels||{},xte._pos={x:Bee+O(Lee.x,ie.x)+({left:ce,right:-ce}[nee.alignment]||0),y:Nte+O(Lee.y,ie.y)-10},nee.final.x=Bee,nee.final.y=Nte,O(ie.crop,!0)&&(Ote=xte.getBBox().width,fee=null,Bee-OteY-ce&&Kee===0&&(fee=Math.round(Bee+Ote-Y+ce),Tee[1]=Math.max(fee,Tee[1])),0>Nte-Wee/2?Tee[0]=Math.max(Math.round(-Nte+Wee/2),Tee[0]):Nte+Wee/2>B&&(Tee[2]=Math.max(Math.round(Nte+Wee/2-B),Tee[2])),xte.sideOverflow=fee)}}}),E(Tee)===0||this.verifyDataLabelOverflow(Tee))&&(this.placeDataLabels(),this.points.forEach(function($te){if(Lee=k(ie,$te.options.dataLabels),yee=O(Lee.connectorWidth,1)){var Kee;ete=$te.connector,(xte=$te.dataLabel)&&xte._pos&&$te.visible&&0<$te.labelDistance?(_ee=xte._attr.visibility,(Kee=!ete)&&($te.connector=ete=z.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+$te.colorIndex+($te.className?" "+$te.className:"")).add(U.dataLabelsGroup),z.styledMode||ete.attr({"stroke-width":yee,stroke:Lee.connectorColor||$te.color||"#666666"})),ete[Kee?"attr":"animate"]({d:$te.getConnectorPath()}),ete.attr("visibility",_ee)):ete&&($te.connector=ete.destroy())}}))}function P(){this.points.forEach(function(U){var J=U.dataLabel,z;J&&U.visible&&((z=J._pos)?(J.sideOverflow&&(J._attr.width=Math.max(J.getBBox().width-J.sideOverflow,0),J.css({width:J._attr.width+"px",textOverflow:(this.options.dataLabels.style||{}).textOverflow||"ellipsis"}),J.shortened=!0),J.attr(J._attr),J[J.moved?"animate":"attr"](z),J.moved=!0):J&&J.attr({y:-9999})),delete U.distributeBox},this)}function I(U){var J=this.center,z=this.options,ie=z.center,ce=z.minSize||80,Y=z.size!==null;if(!Y){if(ie[0]!==null)var B=Math.max(J[2]-Math.max(U[1],U[3]),ce);else B=Math.max(J[2]-U[1]-U[3],ce),J[0]+=(U[3]-U[1])/2;ie[1]!==null?B=w(B,ce,J[2]-Math.max(U[0],U[2])):(B=w(B,ce,J[2]-U[0]-U[2]),J[1]+=(U[0]-U[2])/2),BJ.bottom-2?ie:z,J.half,J)},justify:function(U,J,z){return z[0]+(U.half?-1:1)*(J+U.labelDistance)},alignToPlotEdges:function(U,J,z,ie){return U=U.getBBox().width,J?U+ie:z-U-ie},alignToConnectors:function(U,J,z,ie){var ce=0,Y;return U.forEach(function(B){Y=B.dataLabel.getBBox().width,Y>ce&&(ce=Y)}),J?ce+ie:z-ce-ie}};N.compose=function(U){l.compose(_),L.indexOf(U)===-1&&(L.push(U),U=U.prototype,U.dataLabelPositioners=F,U.alignDataLabel=g,U.drawDataLabels=D,U.placeDataLabels=P,U.verifyDataLabelOverflow=I)}}(M||(M={})),M}),s(a,"Extensions/OverlappingDataLabels.js",[a["Core/Chart/Chart.js"],a["Core/Utilities.js"]],function(l,c){function u(w,T){var k=!1;if(w){var O=w.newOpacity;w.oldOpacity!==O&&(w.alignAttr&&w.placed?(w[O?"removeClass":"addClass"]("highcharts-data-label-hidden"),k=!0,w.alignAttr.opacity=O,w[w.isOld?"animate":"attr"](w.alignAttr,null,function(){T.styledMode||w.css({pointerEvents:O?"auto":"none"})}),m(T,"afterHideOverlappingLabel")):w.attr({opacity:O})),w.isOld=!0}return k}var d=c.addEvent,m=c.fireEvent,g=c.isArray,y=c.isNumber,_=c.objectEach,E=c.pick;d(l,"render",function(){var w=this,T=[];(this.labelCollectors||[]).forEach(function(k){T=T.concat(k())}),(this.yAxis||[]).forEach(function(k){k.stacking&&k.options.stackLabels&&!k.options.stackLabels.allowOverlap&&_(k.stacking.stacks,function(O){_(O,function(R){R.label&&R.label.visibility!=="hidden"&&T.push(R.label)})})}),(this.series||[]).forEach(function(k){var O=k.options.dataLabels;k.visible&&(O.enabled!==!1||k._hasPointLabels)&&(O=function(R){return R.forEach(function(M){M.visible&&(g(M.dataLabels)?M.dataLabels:M.dataLabel?[M.dataLabel]:[]).forEach(function(N){var D=N.options;N.labelrank=E(D.labelrank,M.labelrank,M.shapeArgs&&M.shapeArgs.height),D.allowOverlap?(N.oldOpacity=N.opacity,N.newOpacity=1,u(N,w)):T.push(N)})})},O(k.nodes||[]),O(k.points))}),this.hideOverlappingLabels(T)}),l.prototype.hideOverlappingLabels=function(w){var T=this,k=w.length,O=T.renderer,R,M,N,D=!1,P=function(F){var U,J=F.box?0:F.padding||0,z=U=0,ie;if(F&&(!F.alignAttr||F.placed)){var ce=F.alignAttr||{x:F.attr("x"),y:F.attr("y")},Y=F.parentGroup;F.width||(U=F.getBBox(),F.width=U.width,F.height=U.height,U=O.fontMetrics(null,F.element).h);var B=F.width-2*J;return(ie={left:"0",center:"0.5",right:"1"}[F.alignValue])?z=+ie*B:y(F.x)&&Math.round(F.x)!==F.translateX&&(z=F.x-F.translateX),{x:ce.x+(Y.translateX||0)+J-(z||0),y:ce.y+(Y.translateY||0)+J-U,width:F.width-2*J,height:F.height-2*J}}};for(M=0;M=I.x+I.width||L.x+L.width<=I.x||L.y>=I.y+I.height||L.y+L.height<=I.y||((P.labelrank"u"?null:F[ce]})}var P=this,I={};return D(N,this.options,I,0),I},M.prototype.matchResponsiveRule=function(N,D){var P=N.condition;(P.callback||function(){return this.chartWidth<=_(P.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=_(P.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=_(P.minWidth,0)&&this.chartHeight>=_(P.minHeight,0)}).call(this)&&D.push(N._id)},M.prototype.setResponsive=function(N,D){var P=this,I=this.options.responsive,L=this.currentResponsive,F=[];!D&&I&&I.rules&&I.rules.forEach(function(U){typeof U._id>"u"&&(U._id=w()),P.matchResponsiveRule(U,F)},this),D=g.apply(void 0,F.map(function(U){return u((I||{}).rules||[],function(J){return J._id===U})}).map(function(U){return U&&U.chartOptions})),D.isResponsiveOptions=!0,F=F.toString()||void 0,F!==(L&&L.ruleIds)&&(L&&this.update(L.undoOptions,N,!0),F?(L=this.currentOptions(D),L.isResponsiveOptions=!0,this.currentResponsive={ruleIds:F,mergedOptions:D,undoOptions:L},this.update(D,N,!0)):this.currentResponsive=void 0)},M}()}(T||(T={})),T}),s(a,"masters/highcharts.src.js",[a["Core/Globals.js"],a["Core/Utilities.js"],a["Core/DefaultOptions.js"],a["Core/Animation/Fx.js"],a["Core/Animation/AnimationUtilities.js"],a["Core/Renderer/HTML/AST.js"],a["Core/FormatUtilities.js"],a["Core/Renderer/RendererUtilities.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Renderer/HTML/HTMLElement.js"],a["Core/Renderer/HTML/HTMLRenderer.js"],a["Core/Axis/Axis.js"],a["Core/Axis/DateTimeAxis.js"],a["Core/Axis/LogarithmicAxis.js"],a["Core/Axis/PlotLineOrBand/PlotLineOrBand.js"],a["Core/Axis/Tick.js"],a["Core/Tooltip.js"],a["Core/Series/Point.js"],a["Core/Pointer.js"],a["Core/MSPointer.js"],a["Core/Legend/Legend.js"],a["Core/Chart/Chart.js"],a["Core/Series/Series.js"],a["Core/Series/SeriesRegistry.js"],a["Series/Column/ColumnSeries.js"],a["Series/Column/ColumnDataLabel.js"],a["Series/Pie/PieSeries.js"],a["Series/Pie/PieDataLabel.js"],a["Core/Series/DataLabel.js"],a["Core/Responsive.js"],a["Core/Color/Color.js"],a["Core/Time.js"]],function(l,c,u,d,m,g,y,_,E,w,T,k,O,R,M,N,D,P,I,L,F,U,J,z,ie,ce,Y,B,V,Ge,St,Dee,pee){return l.animate=m.animate,l.animObject=m.animObject,l.getDeferredAnimation=m.getDeferredAnimation,l.setAnimation=m.setAnimation,l.stop=m.stop,l.timers=d.timers,l.AST=g,l.Axis=O,l.Chart=J,l.chart=J.chart,l.Fx=d,l.Legend=U,l.PlotLineOrBand=N,l.Point=I,l.Pointer=F.isRequired()?F:L,l.Series=z,l.SVGElement=E,l.SVGRenderer=w,l.Tick=D,l.Time=pee,l.Tooltip=P,l.Color=Dee,l.color=Dee.parse,k.compose(w),T.compose(E),l.defaultOptions=u.defaultOptions,l.getOptions=u.getOptions,l.time=u.defaultTime,l.setOptions=u.setOptions,l.dateFormat=y.dateFormat,l.format=y.format,l.numberFormat=y.numberFormat,l.addEvent=c.addEvent,l.arrayMax=c.arrayMax,l.arrayMin=c.arrayMin,l.attr=c.attr,l.clearTimeout=c.clearTimeout,l.correctFloat=c.correctFloat,l.createElement=c.createElement,l.css=c.css,l.defined=c.defined,l.destroyObjectProperties=c.destroyObjectProperties,l.discardElement=c.discardElement,l.distribute=_.distribute,l.erase=c.erase,l.error=c.error,l.extend=c.extend,l.extendClass=c.extendClass,l.find=c.find,l.fireEvent=c.fireEvent,l.getMagnitude=c.getMagnitude,l.getStyle=c.getStyle,l.inArray=c.inArray,l.isArray=c.isArray,l.isClass=c.isClass,l.isDOMElement=c.isDOMElement,l.isFunction=c.isFunction,l.isNumber=c.isNumber,l.isObject=c.isObject,l.isString=c.isString,l.keys=c.keys,l.merge=c.merge,l.normalizeTickInterval=c.normalizeTickInterval,l.objectEach=c.objectEach,l.offset=c.offset,l.pad=c.pad,l.pick=c.pick,l.pInt=c.pInt,l.relativeLength=c.relativeLength,l.removeEvent=c.removeEvent,l.seriesType=ie.seriesType,l.splat=c.splat,l.stableSort=c.stableSort,l.syncTimeout=c.syncTimeout,l.timeUnits=c.timeUnits,l.uniqueKey=c.uniqueKey,l.useSerialIds=c.useSerialIds,l.wrap=c.wrap,Y.compose(ce),Ge.compose(z),R.compose(O),M.compose(O),V.compose(B),N.compose(O),St.compose(J),l}),a["masters/highcharts.src.js"]._modules=a,a["masters/highcharts.src.js"]})}(highcharts)),highcharts.exports}var highchartsExports=requireHighcharts();const Highcharts$1=getDefaultExportFromCjs(highchartsExports);var data$1={exports:{}};(function(r){(function(o){r.exports?(o.default=o,r.exports=o):o(typeof Highcharts<"u"?Highcharts:void 0)})(function(o){function s(a,l,c,u){a.hasOwnProperty(l)||(a[l]=u.apply(null,c))}o=o?o._modules:{},s(o,"Core/HttpUtilities.js",[o["Core/Globals.js"],o["Core/Utilities.js"]],function(a,l){var c=a.doc,u=l.createElement,d=l.discardElement,m=l.merge,g=l.objectEach,y={ajax:function(_){var E=m(!0,{url:!1,type:"get",dataType:"json",success:!1,error:!1,data:!1,headers:{}},_);_={json:"application/json",xml:"application/xml",text:"text/plain",octet:"application/octet-stream"};var w=new XMLHttpRequest;if(!E.url)return!1;w.open(E.type.toUpperCase(),E.url,!0),E.headers["Content-Type"]||w.setRequestHeader("Content-Type",_[E.dataType]||_.text),g(E.headers,function(T,k){w.setRequestHeader(k,T)}),w.onreadystatechange=function(){if(w.readyState===4){if(w.status===200){var T=w.responseText;if(E.dataType==="json")try{T=JSON.parse(T)}catch(k){E.error&&E.error(w,k);return}return E.success&&E.success(T)}E.error&&E.error(w,w.responseText)}};try{E.data=JSON.stringify(E.data)}catch{}w.send(E.data||!0)},getJSON:function(_,E){y.ajax({url:_,success:E,dataType:"json",headers:{"Content-Type":"text/plain"}})},post:function(_,E,w){var T=u("form",m({method:"post",action:_,enctype:"multipart/form-data"},w),{display:"none"},c.body);g(E,function(k,O){u("input",{type:"hidden",name:O,value:k},null,T)}),T.submit(),d(T)}};return y}),s(o,"Extensions/Data.js",[o["Core/Chart/Chart.js"],o["Core/Globals.js"],o["Core/HttpUtilities.js"],o["Core/Series/Point.js"],o["Core/Series/SeriesRegistry.js"],o["Core/Utilities.js"]],function(a,l,c,u,d,m){var g=l.doc,y=c.ajax,_=d.seriesTypes;c=m.addEvent;var E=m.defined,w=m.extend,T=m.fireEvent,k=m.isNumber,O=m.merge,R=m.objectEach,M=m.pick,N=m.splat;m=function(){function P(I,L,F){this.options=this.rawColumns=this.firstRowAsNames=this.chartOptions=this.chart=void 0,this.dateFormats={"YYYY/mm/dd":{regex:/^([0-9]{4})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{1,2})$/,parser:function(U){return U?Date.UTC(+U[1],U[2]-1,+U[3]):NaN}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(U){return U?Date.UTC(+U[3],U[2]-1,+U[1]):NaN},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(U){return U?Date.UTC(+U[3],U[1]-1,+U[2]):NaN}},"dd/mm/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(U){if(!U)return NaN;var J=+U[3];return J=J>new Date().getFullYear()-2e3?J+1900:J+2e3,Date.UTC(J,U[2]-1,+U[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(U){return U?Date.UTC(+U[3]+2e3,U[1]-1,+U[2]):NaN}}},this.init(I,L,F)}return P.prototype.init=function(I,L,F){var U=I.decimalPoint;if(L&&(this.chartOptions=L),F&&(this.chart=F),U!=="."&&U!==","&&(U=void 0),this.options=I,this.columns=I.columns||this.rowsToColumns(I.rows)||[],this.firstRowAsNames=M(I.firstRowAsNames,this.firstRowAsNames,!0),this.decimalRegex=U&&new RegExp("^(-?[0-9]+)"+U+"([0-9]+)$"),this.rawColumns=[],this.columns.length){this.dataFound();var J=!0}this.hasURLOption(I)&&(clearTimeout(this.liveDataTimeout),J=!1),J||(J=this.fetchLiveData()),J||(J=!!this.parseCSV().length),J||(J=!!this.parseTable().length),J||(J=this.parseGoogleSpreadsheet()),!J&&I.afterComplete&&I.afterComplete()},P.prototype.hasURLOption=function(I){return!(!I||!(I.rowsURL||I.csvURL||I.columnsURL))},P.prototype.getColumnDistribution=function(){var I=this.chartOptions,L=this.options,F=[],U=function(B){return(_[B||"line"].prototype.pointArrayMap||[0]).length},J=I&&I.chart&&I.chart.type,z=[],ie=[],ce=0;L=L&&L.seriesMapping||I&&I.series&&I.series.map(function(){return{x:0}})||[];var Y;(I&&I.series||[]).forEach(function(B){z.push(U(B.type||J))}),L.forEach(function(B){F.push(B.x||0)}),F.length===0&&F.push(0),L.forEach(function(B){var V=new D,Ge=z[ce]||U(J),St=(I&&I.series||[])[ce]||{},Dee=_[St.type||J||"line"].prototype.pointArrayMap,pee=Dee||["y"];for((E(B.x)||St.isCartesian||!Dee)&&V.addColumnReader(B.x,"x"),R(B,function(jr,Tee){Tee!=="x"&&V.addColumnReader(jr,Tee)}),Y=0;Y"u"&&(L=["y"]),this.valueCount={global:U(J),xColumns:F,individual:z,seriesBuilders:ie,globalPointArrayMap:L}},P.prototype.dataFound=function(){this.options.switchRowsAndColumns&&(this.columns=this.rowsToColumns(this.columns)),this.getColumnDistribution(),this.parseTypes(),this.parsed()!==!1&&this.complete()},P.prototype.parseCSV=function(I){function L(Tee,et,ft,yee){function ete($te){Wee=Tee[$te],Bee=Tee[$te-1],Nte=Tee[$te+1]}function xte($te){Ge.lengthst||st>B?(++st,_ee=""):(!isNaN(parseFloat(_ee))&&isFinite(_ee)?(_ee=parseFloat(_ee),xte("number")):isNaN(Date.parse(_ee))?xte("string"):(_ee=_ee.replace(/\//g,"-"),xte("date")),Dee.lengthSt[","]?";":",",z.decimalPoint||(z.decimalPoint=et>ft?".":",",J.decimalRegex=new RegExp("^(-?[0-9]+)"+z.decimalPoint+"([0-9]+)$")),yee}function U(Tee,et){var ft=[],yee=0,ete=!1,xte=[],Ote=[],nee;for((!et||et>Tee.length)&&(et=Tee.length);yeeWee[nee]?"YY":"YYYY":12=Wee[nee]?(ft[nee]="dd",ete=!0):ft[nee].length||(ft[nee]="mm")))}if(ete){for(nee=0;neeI)&&(I=0),(!ce||ce>=ie.length)&&(ce=ie.length-1),z.itemDelimiter)var pee=z.itemDelimiter;else pee=null,pee=F(ie);var jr=0;for(V=I;V<=ce;V++)ie[V][0]==="#"?jr++:L(ie[V],V-I-jr);z.columnTypes&&z.columnTypes.length!==0||!Ge.length||!Ge[0].length||Ge[0][1]!=="date"||z.dateFormat||(z.dateFormat=U(Dee[0])),this.dataFound()}return Dee},P.prototype.parseTable=function(){var I=this.options,L=I.table,F=this.columns||[],U=I.startRow||0,J=I.endRow||Number.MAX_VALUE,z=I.startColumn||0,ie=I.endColumn||Number.MAX_VALUE;return L&&(typeof L=="string"&&(L=g.getElementById(L)),[].forEach.call(L.getElementsByTagName("tr"),function(ce,Y){Y>=U&&Y<=J&&[].forEach.call(ce.children,function(B,V){var Ge=F[V-z],St=1;if((B.tagName==="TD"||B.tagName==="TH")&&V>=z&&V<=ie)for(F[V-z]||(F[V-z]=[]),F[V-z][Y-U]=B.innerHTML;Y-U>=St&&Ge[Y-U-St]===void 0;)Ge[Y-U-St]=null,St++})}),this.dataFound()),F},P.prototype.fetchLiveData=function(){function I(Y){function B(V,Ge,St){function Dee(){z&&F.liveDataURL===V&&(L.liveDataTimeout=setTimeout(I,ie))}return!V||!/^(http|\/|\.\/|\.\.\/)/.test(V)?(V&&U.error&&U.error("Invalid URL"),!1):(Y&&(clearTimeout(L.liveDataTimeout),F.liveDataURL=V),y({url:V,dataType:St||"json",success:function(pee){F&&F.series&&Ge(pee),Dee()},error:function(pee,jr){return 3>++J&&Dee(),U.error&&U.error(jr,pee)}}),!0)}B(ce.csvURL,function(V){F.update({data:{csv:V}})},"text")||B(ce.rowsURL,function(V){F.update({data:{rows:V}})})||B(ce.columnsURL,function(V){F.update({data:{columns:V}})})}var L=this,F=this.chart,U=this.options,J=0,z=U.enablePolling,ie=1e3*(U.dataRefreshRate||2),ce=O(U);return this.hasURLOption(U)?(1e3>ie&&(ie=1e3),delete U.csvURL,delete U.rowsURL,delete U.columnsURL,I(!0),this.hasURLOption(U)):!1},P.prototype.parseGoogleSpreadsheet=function(){function I(ce){var Y=["https://sheets.googleapis.com/v4/spreadsheets",U,"values",ie(),"?alt=json&majorDimension=COLUMNS&valueRenderOption=UNFORMATTED_VALUE&dateTimeRenderOption=FORMATTED_STRING&key="+F.googleAPIKey].join("/");y({url:Y,dataType:"json",success:function(B){ce(B),F.enablePolling&&setTimeout(function(){I(ce)},z)},error:function(B,V){return F.error&&F.error(V,B)}})}var L=this,F=this.options,U=F.googleSpreadsheetKey,J=this.chart,z=Math.max(1e3*(F.dataRefreshRate||2),4e3),ie=function(){if(F.googleSpreadsheetRange)return F.googleSpreadsheetRange;var ce=("ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(F.startColumn||0)||"A")+((F.startRow||0)+1),Y="ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(M(F.endColumn,-1))||"ZZ";return E(F.endRow)&&(Y+=F.endRow+1),ce+":"+Y};return U&&(delete F.googleSpreadsheetKey,I(function(ce){if(ce=ce.values,!ce||ce.length===0)return!1;var Y=ce.reduce(function(B,V){return Math.max(B,V.length)},0);ce.forEach(function(B){for(var V=0;V"u"&&(B[V]=null)}),J&&J.series?J.update({data:{columns:ce}}):(L.columns=ce,L.dataFound())})),!1},P.prototype.trim=function(I,L){return typeof I=="string"&&(I=I.replace(/^\s+|\s+$/g,""),L&&/^[0-9\s]+$/.test(I)&&(I=I.replace(/\s/g,"")),this.decimalRegex&&(I=I.replace(this.decimalRegex,"$1.$2"))),I},P.prototype.parseTypes=function(){for(var I=this.columns,L=I.length;L--;)this.parseColumn(I[L],L)},P.prototype.parseColumn=function(I,L){var F=this.rawColumns,U=this.columns,J=I.length,z=this.firstRowAsNames,ie=this.valueCount.xColumns.indexOf(L)!==-1,ce,Y=[],B=this.chartOptions,V,Ge=(this.options.columnTypes||[])[L];for(B=ie&&(B&&B.xAxis&&N(B.xAxis)[0].type==="category"||Ge==="string"),F[L]||(F[L]=[]);J--;){var St=Y[J]||I[J],Dee=this.trim(St),pee=this.trim(St,!0),jr=parseFloat(pee);typeof F[L][J]>"u"&&(F[L][J]=Dee),B||J===0&&z?I[J]=""+Dee:+pee===jr?(I[J]=jr,31536e6I[J+1])):(Dee&&Dee.length&&(ce=this.parseDate(St)),ie&&k(ce)&&Ge!=="float"?(Y[J]=St,I[J]=ce,I.isDatetime=!0,typeof I[J+1]<"u"&&(St=ce>I[J+1],St!==V&&typeof V<"u"&&(this.alternativeFormat?(this.dateFormat=this.alternativeFormat,J=I.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):I.unsorted=!0),V=St)):(I[J]=Dee===""?null:Dee,J!==0&&(I.isDatetime||I.isNumeric)&&(I.mixed=!0)))}if(ie&&I.mixed&&(U[L]=F[L]),ie&&V&&this.options.sort)for(L=0;L"u"&&(F.columnIndex=I.shift())}),this.readers.forEach(function(F){typeof F.columnIndex>"u"&&(L=!1)}),L},P.prototype.read=function(I,L){var F=this.pointIsArray,U=F?[]:{};if(this.readers.forEach(function(z){var ie=I[z.columnIndex][L];F?U.push(ie):0"u"&&2<=this.readers.length){var J=this.getReferencedColumnIndexes();2<=J.length&&(J.shift(),J.sort(function(z,ie){return z-ie}),this.name=I[J.shift()].name)}return U},P.prototype.addColumnReader=function(I,L){this.readers.push({columnIndex:I,configName:L}),L!=="x"&&L!=="y"&&typeof L<"u"&&(this.pointIsArray=!1)},P.prototype.getReferencedColumnIndexes=function(){var I,L=[];for(I=0;IKee&&(Iee.resetParams=[this.options.chart.width,void 0,!1],this.setSize(Kee,void 0,!1)),[].forEach.call(Iee.childNodes,function(Rte,dee){Rte.nodeType===1&&(Iee.origDisplay[dee]=Rte.style.display,Rte.style.display="none")}),this.moveContainers($te),this.printReverseInfo=Iee}function V($te){$te.renderExporting(),T($te,"redraw",$te.renderExporting),T($te,"destroy",$te.destroyExport)}function Ge($te,Kee,Iee,Rte,dee,fee,Oee){var xee=this,kee=xee.options.navigation,Dte=xee.chartWidth,Ite=xee.chartHeight,Lte="cache-"+$te,Vte=Math.max(dee,fee),Pte=xee[Lte];if(!Pte){xee.exportContextMenu=xee[Lte]=Pte=O("div",{className:$te},{position:"absolute",zIndex:1e3,padding:Vte+"px",pointerEvents:"auto"},xee.fixedDiv||xee.container);var Fte=O("ul",{className:"highcharts-menu"},{listStyle:"none",margin:0,padding:0},Pte);xee.styledMode||k(Fte,M({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},kee.menuStyle)),Pte.hideMenu=function(){k(Pte,{display:"none"}),Oee&&Oee.setState(0),xee.openMenu=!1,k(xee.renderTo,{overflow:"hidden"}),k(xee.container,{overflow:"hidden"}),_.clearTimeout(Pte.hideTimer),D(xee,"exportMenuHidden")},xee.exportEvents.push(T(Pte,"mouseleave",function(){Pte.hideTimer=w.setTimeout(Pte.hideMenu,500)}),T(Pte,"mouseenter",function(){_.clearTimeout(Pte.hideTimer)}),T(E,"mouseup",function(Ute){xee.pointer.inClass(Ute.target,$te)||Pte.hideMenu()}),T(Pte,"click",function(){xee.openMenu&&Pte.hideMenu()})),Kee.forEach(function(Ute){if(typeof Ute=="string"&&(Ute=xee.options.exporting.menuItemDefinitions[Ute]),P(Ute,!0)){var Gte=void 0;Ute.separator?Gte=O("hr",void 0,void 0,Fte):(Ute.textKey==="viewData"&&xee.isDataTableVisible&&(Ute.textKey="hideData"),Gte=O("li",{className:"highcharts-menu-item",onclick:function(jte){jte&&jte.stopPropagation(),Pte.hideMenu(),Ute.onclick&&Ute.onclick.apply(xee,arguments)}},void 0,Fte),a.setElementHTML(Gte,Ute.text||xee.options.lang[Ute.textKey]),xee.styledMode||(Gte.onmouseover=function(){k(this,kee.menuItemHoverStyle)},Gte.onmouseout=function(){k(this,kee.menuItemStyle)},k(Gte,M({cursor:"pointer"},kee.menuItemStyle)))),xee.exportDivElements.push(Gte)}}),xee.exportDivElements.push(Fte,Pte),xee.exportMenuWidth=Pte.offsetWidth,xee.exportMenuHeight=Pte.offsetHeight}Kee={display:"block"},Iee+xee.exportMenuWidth>Dte?Kee.right=Dte-Iee-dee-Vte+"px":Kee.left=Iee-Vte+"px",Rte+fee+xee.exportMenuHeight>Ite&&Oee.alignOptions.verticalAlign!=="top"?Kee.bottom=Ite-Rte-Vte+"px":Kee.top=Rte+fee-Vte+"px",k(Pte,Kee),k(xee.renderTo,{overflow:""}),k(xee.container,{overflow:""}),xee.openMenu=!0,D(xee,"exportMenuShown")}function St($te){var Kee=$te?$te.target:this,Iee=Kee.exportSVGElements,Rte=Kee.exportDivElements;$te=Kee.exportEvents;var dee;Iee&&(Iee.forEach(function(fee,Oee){fee&&(fee.onclick=fee.ontouchstart=null,dee="cache-"+fee.menuClassName,Kee[dee]&&delete Kee[dee],Iee[Oee]=fee.destroy())}),Iee.length=0),Kee.exportingGroup&&(Kee.exportingGroup.destroy(),delete Kee.exportingGroup),Rte&&(Rte.forEach(function(fee,Oee){fee&&(_.clearTimeout(fee.hideTimer),U(fee,"mouseleave"),Rte[Oee]=fee.onmouseout=fee.onmouseover=fee.ontouchstart=fee.onclick=null,R(fee))}),Rte.length=0),$te&&($te.forEach(function(fee){fee()}),$te.length=0)}function Dee($te,Kee){Kee=this.getSVGForExport($te,Kee),$te=I(this.options.exporting,$te),y.post($te.url,{filename:$te.filename?$te.filename.replace(/\//g,"-"):this.getFilename(),type:$te.type,width:$te.width||0,scale:$te.scale,svg:Kee},$te.formAttributes)}function pee(){return this.styledMode&&this.inlineStyles(),this.container.innerHTML}function jr(){var $te=this.userOptions.title&&this.userOptions.title.text,Kee=this.options.exporting.filename;return Kee?Kee.replace(/\//g,"-"):(typeof $te=="string"&&(Kee=$te.toLowerCase().replace(/<\/?[^>]+(>|$)/g,"").replace(/[\s_]+/g,"-").replace(/[^a-z0-9\-]/g,"").replace(/^[\-]+/g,"").replace(/[\-]+/g,"-").substr(0,24).replace(/[\-]+$/g,"")),(!Kee||5>Kee.length)&&(Kee="chart"),Kee)}function Tee($te){var Kee,Iee=I(this.options,$te);Iee.plotOptions=I(this.userOptions.plotOptions,$te&&$te.plotOptions),Iee.time=I(this.userOptions.time,$te&&$te.time);var Rte=O("div",null,{position:"absolute",top:"-9999em",width:this.chartWidth+"px",height:this.chartHeight+"px"},E.body),dee=this.renderTo.style.width,fee=this.renderTo.style.height;dee=Iee.exporting.sourceWidth||Iee.chart.width||/px$/.test(dee)&&parseInt(dee,10)||(Iee.isGantt?800:600),fee=Iee.exporting.sourceHeight||Iee.chart.height||/px$/.test(fee)&&parseInt(fee,10)||400,M(Iee.chart,{animation:!1,renderTo:Rte,forExport:!0,renderer:"SVGRenderer",width:dee,height:fee}),Iee.exporting.enabled=!1,delete Iee.data,Iee.series=[],this.series.forEach(function(kee){Kee=I(kee.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:kee.visible}),Kee.isInternal||Iee.series.push(Kee)});var Oee={};this.axes.forEach(function(kee){kee.userOptions.internalKey||(kee.userOptions.internalKey=J()),kee.options.isInternal||(Oee[kee.coll]||(Oee[kee.coll]=!0,Iee[kee.coll]=[]),Iee[kee.coll].push(I(kee.userOptions,{visible:kee.visible})))});var xee=new this.constructor(Iee,this.callback);return $te&&["xAxis","yAxis","series"].forEach(function(kee){var Dte={};$te[kee]&&(Dte[kee]=$te[kee],xee.update(Dte))}),this.axes.forEach(function(kee){var Dte=N(xee.axes,function(Vte){return Vte.options.internalKey===kee.userOptions.internalKey}),Ite=kee.getExtremes(),Lte=Ite.userMin;Ite=Ite.userMax,Dte&&(typeof Lte<"u"&&Lte!==Dte.min||typeof Ite<"u"&&Ite!==Dte.max)&&Dte.setExtremes(Lte,Ite,!0,!1)}),fee=xee.getChartHTML(),D(this,"getSVG",{chartCopy:xee}),fee=this.sanitizeSVG(fee,Iee),Iee=null,xee.destroy(),R(Rte),fee}function et($te,Kee){var Iee=this.options.exporting;return this.getSVG(I({chart:{borderRadius:0}},Iee.chartOptions,Kee,{exporting:{sourceWidth:$te&&$te.sourceWidth||Iee.sourceWidth,sourceHeight:$te&&$te.sourceHeight||Iee.sourceHeight}}))}function ft($te){return $te.replace(/([A-Z])/g,function(Kee,Iee){return"-"+Iee.toLowerCase()})}function yee(){function $te(xee){function kee(jte,Bte){if(Ite=Lte=!1,Iee.length){for(Vte=Iee.length;Vte--&&!Lte;)Lte=Iee[Vte].test(Bte);Ite=!Lte}for(Bte==="transform"&&jte==="none"&&(Ite=!0),Vte=Kee.length;Vte--&&!Ite;)Ite=Kee[Vte].test(Bte)||typeof jte=="function";Ite||Fte[Bte]===jte&&xee.nodeName!=="svg"||Rte[xee.nodeName][Bte]===jte||(_ee&&_ee.indexOf(Bte)===-1?Dte+=ft(Bte)+":"+jte+";":jte&&xee.setAttribute(ft(Bte),jte))}var Dte="",Ite,Lte,Vte;if(xee.nodeType===1&&st.indexOf(xee.nodeName)===-1){var Pte=w.getComputedStyle(xee,null),Fte=xee.nodeName==="svg"?{}:w.getComputedStyle(xee.parentNode,null);if(!Rte[xee.nodeName]){dee=Oee.getElementsByTagName("svg")[0];var Ute=Oee.createElementNS(xee.namespaceURI,xee.nodeName);dee.appendChild(Ute),Rte[xee.nodeName]=I(w.getComputedStyle(Ute,null)),xee.nodeName==="text"&&delete Rte.text.fill,dee.removeChild(Ute)}if(g.isFirefox||g.isMS)for(var Gte in Pte)kee(Pte[Gte],Gte);else L(Pte,kee);Dte&&(Pte=xee.getAttribute("style"),xee.setAttribute("style",(Pte?Pte+";":"")+Dte)),xee.nodeName==="svg"&&xee.setAttribute("stroke-width","1px"),xee.nodeName!=="text"&&[].forEach.call(xee.children||xee.childNodes,$te)}}var Kee=Nte,Iee=ie.inlineWhitelist,Rte={},dee,fee=E.createElement("iframe");k(fee,{width:"1px",height:"1px",visibility:"hidden"}),E.body.appendChild(fee);var Oee=fee.contentWindow.document;Oee.open(),Oee.write(''),Oee.close(),$te(this.container.querySelector("svg")),dee.parentNode.removeChild(dee),fee.parentNode.removeChild(fee)}function ete($te){(this.fixedDiv?[this.fixedDiv,this.scrollingContainer]:[this.container]).forEach(function(Kee){$te.appendChild(Kee)})}function xte(){var $te=this;$te.exporting={update:function(Kee,Iee){$te.isDirtyExporting=!0,I(!0,$te.options.exporting,Kee),F(Iee,!0)&&$te.redraw()}},c.compose($te).navigation.addUpdate(function(Kee,Iee){$te.isDirtyExporting=!0,I(!0,$te.options.navigation,Kee),F(Iee,!0)&&$te.redraw()})}function Ote(){var $te=this;$te.isPrinting||(Lee=$te,g.isSafari||$te.beforePrint(),setTimeout(function(){w.focus(),w.print(),g.isSafari||setTimeout(function(){$te.afterPrint()},1e3)},1))}function nee(){var $te=this,Kee=$te.options.exporting,Iee=Kee.buttons,Rte=$te.isDirtyExporting||!$te.exportSVGElements;$te.buttonOffset=0,$te.isDirtyExporting&&$te.destroyExport(),Rte&&Kee.enabled!==!1&&($te.exportEvents=[],$te.exportingGroup=$te.exportingGroup||$te.renderer.g("exporting-group").attr({zIndex:3}).add(),L(Iee,function(dee){$te.addButton(dee)}),$te.isDirtyExporting=!1)}function Wee($te,Kee){var Iee=$te.indexOf("")+6,Rte=$te.substr(Iee);return $te=$te.substr(0,Iee),Kee&&Kee.exporting&&Kee.exporting.allowHTML&&Rte&&(Rte=''+Rte.replace(/(<(?:img|br).*?(?=>))>/g,"$1 />")+"",$te=$te.replace("",Rte+"")),$te=$te.replace(/zIndex="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(.*?)("|");?\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/"u"||w===null)throw Error("Failed to open window")}catch{c.location.href=g}}else _.msSaveOrOpenBlob(g,y)},{dataURLtoBlob:m,downloadURL:a}}),s(o,"Extensions/ExportData.js",[o["Core/Axis/Axis.js"],o["Core/Chart/Chart.js"],o["Core/Renderer/HTML/AST.js"],o["Core/Globals.js"],o["Core/DefaultOptions.js"],o["Core/Utilities.js"],o["Extensions/DownloadURL.js"]],function(a,l,c,u,d,m,g){function y(L,F){var U=w.navigator,J=-1U.userAgent.indexOf("Chrome"),z=w.URL||w.webkitURL||w;try{if(U.msSaveOrOpenBlob&&w.MSBlobBuilder){var ie=new w.MSBlobBuilder;return ie.append(L),ie.getBlob("image/svg+xml")}if(!J)return z.createObjectURL(new w.Blob(["\uFEFF"+L],{type:F}))}catch{}}var _=u.doc,E=u.seriesTypes,w=u.win;u=d.getOptions,d=d.setOptions;var T=m.addEvent,k=m.defined,O=m.extend,R=m.find,M=m.fireEvent,N=m.isNumber,D=m.pick,P=g.downloadURL;d({exporting:{csv:{annotations:{itemDelimiter:"; ",join:!1},columnHeaderFormatter:null,dateFormat:"%Y-%m-%d %H:%M:%S",decimalPoint:null,itemDelimiter:null,lineDelimiter:` -`},showTable:!1,useMultiLevelHeaders:!0,useRowspanHeaders:!0},lang:{downloadCSV:"Download CSV",downloadXLS:"Download XLS",exportData:{annotationHeader:"Annotations",categoryHeader:"Category",categoryDatetimeHeader:"DateTime"},viewData:"View data table",hideData:"Hide data table"}}),T(l,"render",function(){this.options&&this.options.exporting&&this.options.exporting.showTable&&!this.options.chart.forExport&&!this.dataTableDiv&&this.viewData()}),l.prototype.setUpKeyToAxis=function(){E.arearange&&(E.arearange.prototype.keyToAxis={low:"y",high:"y"}),E.gantt&&(E.gantt.prototype.keyToAxis={start:"x",end:"x"})},l.prototype.getDataRows=function(L){var F=this.hasParallelCoordinates,U=this.time,J=this.options.exporting&&this.options.exporting.csv||{},z=this.xAxis,ie={},ce=[],Y=[],B=[],V,Ge=this.options.lang.exportData,St=Ge.categoryHeader,Dee=Ge.categoryDatetimeHeader,pee=function(nee,Wee,Bee){if(J.columnHeaderFormatter){var Nte=J.columnHeaderFormatter(nee,Wee,Bee);if(Nte!==!1)return Nte}return nee?nee instanceof a?nee.options.title&&nee.options.title.text||(nee.dateTime?Dee:St):L?{columnTitle:1"};return L=this.getTableAST(L),F(L)},l.prototype.getTableAST=function(L){var F=0,U=[],J=this.options,z=L?1.1.toLocaleString()[1]:".",ie=D(J.exporting.useMultiLevelHeaders,!0);L=this.getDataRows(ie);var ce=ie?L.shift():null,Y=L.shift(),B=function(Dee,pee,jr,Tee){var et=D(Tee,"");return pee="text"+(pee?" "+pee:""),typeof et=="number"?(et=et.toString(),z===","&&(et=et.replace(".",z)),pee="number"):Tee||(pee="empty"),jr=O({class:pee},jr),{tagName:Dee,attributes:jr,textContent:et}};J.exporting.tableCaption!==!1&&U.push({tagName:"caption",attributes:{class:"highcharts-table-caption"},textContent:D(J.exporting.tableCaption,J.title.text?J.title.text:"Chart")});for(var V=0,Ge=L.length;VF&&(F=L[V].length);U.push(function(Dee,pee,jr){var Tee=[],et=0;jr=jr||pee&&pee.length;var ft=0,yee;if(yee=ie&&Dee&&pee){e:if(yee=Dee.length,pee.length===yee){for(;yee--;)if(Dee[yee]!==pee[yee]){yee=!1;break e}yee=!0}else yee=!1;yee=!yee}if(yee){for(yee=[];et";P(y(L,"application/vnd.ms-excel")||"data:application/vnd.ms-excel;base64,"+w.btoa(unescape(encodeURIComponent(L))),this.getFilename()+".xls")},l.prototype.viewData=function(){this.toggleDataTable(!0)},l.prototype.hideData=function(){this.toggleDataTable(!1)},l.prototype.toggleDataTable=function(L){(L=D(L,!this.isDataTableVisible))&&!this.dataTableDiv&&(this.dataTableDiv=_.createElement("div"),this.dataTableDiv.className="highcharts-data-table",this.renderTo.parentNode.insertBefore(this.dataTableDiv,this.renderTo.nextSibling)),this.dataTableDiv&&(this.dataTableDiv.style.display=L?"block":"none",L&&(this.dataTableDiv.innerHTML=c.emptyHTML,new c([this.getTableAST()]).addToDOM(this.dataTableDiv),M(this,"afterViewData",this.dataTableDiv))),this.isDataTableVisible=L,L=this.exportDivElements;var F=this.options.exporting,U=F&&F.buttons&&F.buttons.contextButton.menuItems;F=this.options.lang,I&&I.menuItemDefinitions&&F&&F.viewData&&F.hideData&&U&&L&&(L=L[U.indexOf("viewData")])&&c.setElementHTML(L,this.isDataTableVisible?F.hideData:F.viewData)};var I=u().exporting;I&&(O(I.menuItemDefinitions,{downloadCSV:{textKey:"downloadCSV",onclick:function(){this.downloadCSV()}},downloadXLS:{textKey:"downloadXLS",onclick:function(){this.downloadXLS()}},viewData:{textKey:"viewData",onclick:function(){this.toggleDataTable()}}}),I.buttons&&I.buttons.contextButton.menuItems.push("separator","downloadCSV","downloadXLS","viewData")),E.map&&(E.map.prototype.exportKey="name"),E.mapbubble&&(E.mapbubble.prototype.exportKey="name"),E.treemap&&(E.treemap.prototype.exportKey="name")}),s(o,"masters/modules/export-data.src.js",[],function(){})})})(exportData$1);var exportDataExports=exportData$1.exports;const exportData=getDefaultExportFromCjs(exportDataExports);var __defProp$n=Object.defineProperty,__decorateClass$n=(r,o,s,a)=>{for(var l=void 0,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=u(o,s,l)||l);return l&&__defProp$n(o,s,l),l};dataModule(Highcharts$1);exporting(Highcharts$1);exportData(Highcharts$1);let ChartPreviewV$1=class extends Vue{chart;configFileStructure;sourceCounts;lang;index;loading=!0;chartIdx=0;chartConfig={};chartName="";modalEditor=void 0;mounted(){this.chartConfig=this.chart,this.chartName=this.chart.name||"",this.loading=!1}loadChart(o){if(!this.modalEditor){if(this.modalEditor=highed.ModalEditor(`edit-${this.chartName}-btn`,{allowDone:!0,features:"import templates customize done",importer:{options:"plugins csv json"},defaultChartOptions:o},s=>{const a=JSON.parse(s),l=`${this.configFileStructure.uuid}/charts/${this.lang}/${a.title.text}.json`;if(this.sourceCounts[l]>0&&a.title.text!=this.chart.name)alert(this.$t("editor.chart.label.nameExists",{name:a.title.text})),setTimeout(()=>this.modalEditor.show(),100);else{const c={name:a.title.text,config:a,src:""};this.$emit("edit",{oldChart:this.chart,newChart:c}),this.chartConfig=c,this.chartName=c.name,this.chartIdx+=1}}),o.data?.csv!==void 0){const s=o.data.csv;this.modalEditor.editor.dataTable.loadCSV({csv:s})}else this.convertSeriesToCSV(o);this.modalEditor.editor.chart.options.setAll(o)}}convertSeriesToCSV(o){if(o.chart?.type==="pie"){const s=(o?.series).data;if(s){const a=[`${(o?.series).name};${o?.yAxis?.title.text}`,...s.map(l=>`${l.name};${l.y}`)];this.modalEditor.editor.dataTable.loadCSV({csv:a.join(` -`)})}}else if(o?.series&&(o?.series).length){let s=(o?.series).map(l=>[l.name,...l.data]);if(o.xAxis!==void 0){const l=[o.xAxis?.title?.text].concat(o.xAxis?.categories);s.unshift(l)}let a=s[0].map((l,c)=>s.map(u=>u[c]).join(";"));this.modalEditor.editor.dataTable.loadCSV({csv:a.join(` -`)})}}};__decorateClass$n([Prop()],ChartPreviewV$1.prototype,"chart");__decorateClass$n([Prop()],ChartPreviewV$1.prototype,"configFileStructure");__decorateClass$n([Prop()],ChartPreviewV$1.prototype,"sourceCounts");__decorateClass$n([Prop()],ChartPreviewV$1.prototype,"lang");__decorateClass$n([Prop()],ChartPreviewV$1.prototype,"index");const _hoisted_1$o={class:"chart-item items-center mt-8 mx-5 overflow-hidden"},_hoisted_2$l={class:"relative border-solid border-2 items-center justify-center text-center w-full"},_hoisted_3$k=["content","aria-label"],_hoisted_4$i=["aria-label"],_hoisted_5$g={class:"flex flex-col-reverse lg:flex-row mt-4 items-start flex-wrap gap-2 gap-x-2 px-1 pb-1"},_hoisted_6$f={class:"flex-1 flex flex-col w-full"},_hoisted_7$f={class:"editor-label"},_hoisted_8$e={class:"name-label font-bold"},_hoisted_9$d={class:"font-normal break-all"},_hoisted_10$c=["for"],_hoisted_11$c=["id","placeholder"],_hoisted_12$b=["id"],_hoisted_13$b={class:"flex items-center"},_hoisted_14$9={class:"px-2"};function _sfc_render$n(r,o,s,a,l,c){const u=resolveComponent("storylines-chart"),d=resolveDirective("tippy");return openBlock(),createElementBlock("li",_hoisted_1$o,[createBaseVNode("div",_hoisted_2$l,[withDirectives((openBlock(),createElementBlock("button",{class:"editor-button bg-white absolute h-6 w-6 leading-5 rounded-full top-2 left-2 p-0 z-10 cursor-pointer",onClick:o[0]||(o[0]=()=>r.$emit("delete",r.chart)),content:r.$t("editor.chart.delete"),"aria-label":r.$t("editor.chart.delete")},o[3]||(o[3]=[createBaseVNode("svg",{height:"22px",width:"22px",viewBox:"0 0 352 512",xmlns:"http://www.w3.org/2000/svg"},[createBaseVNode("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]),8,_hoisted_3$k)),[[d,{placement:"top",hideOnClick:!1,animateFill:!0}]]),createBaseVNode("button",{class:"editor-button bg-white absolute h-6 w-6 leading-5 rounded-full bottom-2 right-2 p-0 z-10 handle","aria-label":r.$t("editor.chart.delete")},o[4]||(o[4]=[createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#000000",width:"22px",height:"22px",viewBox:"0 0 24 24"},[createBaseVNode("path",{"fill-rule":"evenodd",d:"M8,18 C9.1045695,18 10,18.8954305 10,20 C10,21.1045695 9.1045695,22 8,22 C6.8954305,22 6,21.1045695 6,20 C6,18.8954305 6.8954305,18 8,18 Z M16,18 C17.1045695,18 18,18.8954305 18,20 C18,21.1045695 17.1045695,22 16,22 C14.8954305,22 14,21.1045695 14,20 C14,18.8954305 14.8954305,18 16,18 Z M8,10 C9.1045695,10 10,10.8954305 10,12 C10,13.1045695 9.1045695,14 8,14 C6.8954305,14 6,13.1045695 6,12 C6,10.8954305 6.8954305,10 8,10 Z M16,10 C17.1045695,10 18,10.8954305 18,12 C18,13.1045695 17.1045695,14 16,14 C14.8954305,14 14,13.1045695 14,12 C14,10.8954305 14.8954305,10 16,10 Z M8,2 C9.1045695,2 10,2.8954305 10,4 C10,5.1045695 9.1045695,6 8,6 C6.8954305,6 6,5.1045695 6,4 C6,2.8954305 6.8954305,2 8,2 Z M16,2 C17.1045695,2 18,2.8954305 18,4 C18,5.1045695 17.1045695,6 16,6 C14.8954305,6 14,5.1045695 14,4 C14,2.8954305 14.8954305,2 16,2 Z"})],-1)]),8,_hoisted_4$i),r.loading?createCommentVNode("",!0):(openBlock(),createBlock(u,{class:"w-full h-full",config:r.chartConfig,key:r.chartIdx,configFileStructure:r.configFileStructure,onLoaded:r.loadChart},null,8,["config","configFileStructure","onLoaded"]))]),createBaseVNode("div",_hoisted_5$g,[createBaseVNode("div",_hoisted_6$f,[createBaseVNode("label",_hoisted_7$f,toDisplayString$1(r.$t("editor.chart.label.name")),1),createBaseVNode("label",_hoisted_8$e,[createBaseVNode("span",_hoisted_9$d,toDisplayString$1(r.chartName),1)]),createBaseVNode("label",{for:"chartPreviewCaption"+r.index,class:"editor-label mt-2"},toDisplayString$1(r.$t("editor.image.label.caption")),9,_hoisted_10$c),withDirectives(createBaseVNode("input",{id:"chartPreviewCaption"+r.index,class:"editor-input w-full",type:"text","onUpdate:modelValue":o[1]||(o[1]=m=>r.chart.caption=m),placeholder:r.$t("editor.caption.placeholder"),onInput:o[2]||(o[2]=m=>r.$emit("captionEdit"))},null,40,_hoisted_11$c),[[vModelText,r.chart.caption]])]),createBaseVNode("button",{class:"editor-button chart-btn bg-gray-100 cursor-pointer hover:bg-gray-200",id:`edit-${r.chart.name}-btn`},[createBaseVNode("div",_hoisted_13$b,[o[5]||(o[5]=createBaseVNode("svg",{height:"18px",width:"18px",viewBox:"0 0 23 21",xmlns:"http://www.w3.org/2000/svg"},[createBaseVNode("path",{d:"M 18 2 L 15.585938 4.4140625 L 19.585938 8.4140625 L 22 6 L 18 2 z M 14.076172 5.9238281 L 3 17 L 3 21 L 7 21 L 18.076172 9.9238281 L 14.076172 5.9238281 z"})],-1)),createBaseVNode("span",_hoisted_14$9,toDisplayString$1(r.$t("editor.chart.label.edit")),1)])],8,_hoisted_12$b)])])}const ChartPreviewV=_export_sfc$1(ChartPreviewV$1,[["render",_sfc_render$n],["__scopeId","data-v-9afb210a"]]);var __defProp$m=Object.defineProperty,__getOwnPropDesc$g=Object.getOwnPropertyDescriptor,__decorateClass$m=(r,o,s,a)=>{for(var l=a>1?void 0:a?__getOwnPropDesc$g(o,s):o,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=(a?u(o,s,l):u(l))||l);return a&&l&&__defProp$m(o,s,l),l};let MetadataEditorV$3=class extends Vue{message;name;messageClass;onOk(){this.$emit("ok"),this.$vfm.close(this.name)}onCancel(){this.$emit("Cancel"),this.$vfm.close(this.name)}};__decorateClass$m([Prop()],MetadataEditorV$3.prototype,"message",2);__decorateClass$m([Prop()],MetadataEditorV$3.prototype,"name",2);__decorateClass$m([Prop()],MetadataEditorV$3.prototype,"messageClass",2);MetadataEditorV$3=__decorateClass$m([Options$1({components:{"vue-final-modal":Ro$3}})],MetadataEditorV$3);const _hoisted_1$n={class:"w-full flex justify-end"};function _sfc_render$m(r,o,s,a,l,c){const u=resolveComponent("vue-final-modal");return openBlock(),createBlock(u,{clickToClose:!1,escToClose:!1,modalId:r.name,class:"flex justify-center items-center","content-class":"flex flex-col max-w-xl mx-4 p-4 bg-white dark:bg-gray-900 border dark:border-gray-700 rounded-lg space-y-2"},{default:withCtx(()=>[createBaseVNode("h2",{slot:"header",class:normalizeClass(r.messageClass??"text-lg font-bold")},toDisplayString$1(r.message),3),createBaseVNode("div",_hoisted_1$n,[createBaseVNode("button",{class:"editor-button confirm-button hover:bg-gray-800",onClick:o[0]||(o[0]=withModifiers((...d)=>r.onOk&&r.onOk(...d),["stop"]))},toDisplayString$1(r.$t("editor.confirm")),1),createBaseVNode("button",{class:"editor-button cancel-button hover:bg-gray-100",onClick:o[1]||(o[1]=withModifiers((...d)=>r.onCancel&&r.onCancel(...d),["stop"]))},toDisplayString$1(r.$t("editor.cancel")),1)])]),_:1},8,["modalId"])}const ConfirmationModalV=_export_sfc$1(MetadataEditorV$3,[["render",_sfc_render$m],["__scopeId","data-v-cad636d8"]]);var vuedraggable_umd={exports:{}};const require$$1$1=getAugmentedNamespace(vue_runtime_esmBundler);/**! - * Sortable 1.14.0 - * @author RubaXa - * @author owenm - * @license MIT - */function ownKeys$1(r,o){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),s.push.apply(s,a)}return s}function _objectSpread2(r){for(var o=1;o=0)&&(s[l]=r[l]);return s}function _objectWithoutProperties(r,o){if(r==null)return{};var s=_objectWithoutPropertiesLoose(r,o),a,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(r,a)&&(s[a]=r[a])}return s}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _iterableToArray(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function _unsupportedIterableToArray(r,o){if(r){if(typeof r=="string")return _arrayLikeToArray(r,o);var s=Object.prototype.toString.call(r).slice(8,-1);if(s==="Object"&&r.constructor&&(s=r.constructor.name),s==="Map"||s==="Set")return Array.from(r);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return _arrayLikeToArray(r,o)}}function _arrayLikeToArray(r,o){(o==null||o>r.length)&&(o=r.length);for(var s=0,a=new Array(o);s"&&(o=o.substring(1)),r)try{if(r.matches)return r.matches(o);if(r.msMatchesSelector)return r.msMatchesSelector(o);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(o)}catch{return!1}return!1}}function getParentOrHost(r){return r.host&&r!==document&&r.host.nodeType?r.host:r.parentNode}function closest(r,o,s,a){if(r){s=s||document;do{if(o!=null&&(o[0]===">"?r.parentNode===s&&matches(r,o):matches(r,o))||a&&r===s)return r;if(r===s)break}while(r=getParentOrHost(r))}return null}var R_SPACE=/\s+/g;function toggleClass(r,o,s){if(r&&o)if(r.classList)r.classList[s?"add":"remove"](o);else{var a=(" "+r.className+" ").replace(R_SPACE," ").replace(" "+o+" "," ");r.className=(a+(s?" "+o:"")).replace(R_SPACE," ")}}function css(r,o,s){var a=r&&r.style;if(a){if(s===void 0)return document.defaultView&&document.defaultView.getComputedStyle?s=document.defaultView.getComputedStyle(r,""):r.currentStyle&&(s=r.currentStyle),o===void 0?s:s[o];!(o in a)&&o.indexOf("webkit")===-1&&(o="-webkit-"+o),a[o]=s+(typeof s=="string"?"":"px")}}function matrix(r,o){var s="";if(typeof r=="string")s=r;else do{var a=css(r,"transform");a&&a!=="none"&&(s=a+" "+s)}while(!o&&(r=r.parentNode));var l=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return l&&new l(s)}function find$1(r,o,s){if(r){var a=r.getElementsByTagName(o),l=0,c=a.length;if(s)for(;l=c,!u)return a;if(a===getWindowScrollingElement())break;a=getParentAutoScrollElement(a,!1)}return!1}function getChild(r,o,s,a){for(var l=0,c=0,u=r.children;c2&&arguments[2]!==void 0?arguments[2]:{},l=a.evt,c=_objectWithoutProperties(a,_excluded);PluginManager.pluginEvent.bind(Sortable)(o,s,_objectSpread2({dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,dragStarted:moved,putSortable,activeSortable:Sortable.active,originalEvent:l,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex,hideGhostForTarget:_hideGhostForTarget,unhideGhostForTarget:_unhideGhostForTarget,cloneNowHidden:function(){cloneHidden=!0},cloneNowShown:function(){cloneHidden=!1},dispatchSortableEvent:function(d){_dispatchEvent({sortable:s,name:d,originalEvent:l})}},c))};function _dispatchEvent(r){dispatchEvent(_objectSpread2({putSortable,cloneEl,targetEl:dragEl,rootEl,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex},r))}var dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,oldIndex,newIndex,oldDraggableIndex,newDraggableIndex,activeGroup,putSortable,awaitingDragStarted=!1,ignoreNextClick=!1,sortables=[],tapEvt,touchEvt,lastDx,lastDy,tapDistanceLeft,tapDistanceTop,moved,lastTarget,lastDirection,pastFirstInvertThresh=!1,isCircumstantialInvert=!1,targetMoveDistance,ghostRelativeParent,ghostRelativeParentInitialScroll=[],_silent=!1,savedInputChecked=[],documentExists=typeof document<"u",PositionGhostAbsolutely=IOS,CSSFloatProperty=Edge||IE11OrLess?"cssFloat":"float",supportDraggable=documentExists&&!ChromeForAndroid&&!IOS&&"draggable"in document.createElement("div"),supportCssPointerEvents=function(){if(documentExists){if(IE11OrLess)return!1;var r=document.createElement("x");return r.style.cssText="pointer-events:auto",r.style.pointerEvents==="auto"}}(),_detectDirection=function(o,s){var a=css(o),l=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),c=getChild(o,0,s),u=getChild(o,1,s),d=c&&css(c),m=u&&css(u),g=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+getRect(c).width,y=m&&parseInt(m.marginLeft)+parseInt(m.marginRight)+getRect(u).width;if(a.display==="flex")return a.flexDirection==="column"||a.flexDirection==="column-reverse"?"vertical":"horizontal";if(a.display==="grid")return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(c&&d.float&&d.float!=="none"){var _=d.float==="left"?"left":"right";return u&&(m.clear==="both"||m.clear===_)?"vertical":"horizontal"}return c&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||g>=l&&a[CSSFloatProperty]==="none"||u&&a[CSSFloatProperty]==="none"&&g+y>l)?"vertical":"horizontal"},_dragElInRowColumn=function(o,s,a){var l=a?o.left:o.top,c=a?o.right:o.bottom,u=a?o.width:o.height,d=a?s.left:s.top,m=a?s.right:s.bottom,g=a?s.width:s.height;return l===d||c===m||l+u/2===d+g/2},_detectNearestEmptySortable=function(o,s){var a;return sortables.some(function(l){var c=l[expando].options.emptyInsertThreshold;if(!(!c||lastChild(l))){var u=getRect(l),d=o>=u.left-c&&o<=u.right+c,m=s>=u.top-c&&s<=u.bottom+c;if(d&&m)return a=l}}),a},_prepareGroup=function(o){function s(c,u){return function(d,m,g,y){var _=d.options.group.name&&m.options.group.name&&d.options.group.name===m.options.group.name;if(c==null&&(u||_))return!0;if(c==null||c===!1)return!1;if(u&&c==="clone")return c;if(typeof c=="function")return s(c(d,m,g,y),u)(d,m,g,y);var E=(u?d:m).options.group.name;return c===!0||typeof c=="string"&&c===E||c.join&&c.indexOf(E)>-1}}var a={},l=o.group;(!l||_typeof$1(l)!="object")&&(l={name:l}),a.name=l.name,a.checkPull=s(l.pull,!0),a.checkPut=s(l.put),a.revertClone=l.revertClone,o.group=a},_hideGhostForTarget=function(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","none")},_unhideGhostForTarget=function(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","")};documentExists&&document.addEventListener("click",function(r){if(ignoreNextClick)return r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.stopImmediatePropagation&&r.stopImmediatePropagation(),ignoreNextClick=!1,!1},!0);var nearestEmptyInsertDetectEvent=function(o){if(dragEl){o=o.touches?o.touches[0]:o;var s=_detectNearestEmptySortable(o.clientX,o.clientY);if(s){var a={};for(var l in o)o.hasOwnProperty(l)&&(a[l]=o[l]);a.target=a.rootEl=s,a.preventDefault=void 0,a.stopPropagation=void 0,s[expando]._onDragOver(a)}}},_checkOutsideTargetEl=function(o){dragEl&&dragEl.parentNode[expando]._isOutsideThisEl(o.target)};function Sortable(r,o){if(!(r&&r.nodeType&&r.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(r));this.el=r,this.options=o=_extends({},o),r[expando]=this;var s={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(r.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return _detectDirection(r,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(u,d){u.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Sortable.supportPointer!==!1&&"PointerEvent"in window&&!Safari,emptyInsertThreshold:5};PluginManager.initializePlugins(this,r,s);for(var a in s)!(a in o)&&(o[a]=s[a]);_prepareGroup(o);for(var l in this)l.charAt(0)==="_"&&typeof this[l]=="function"&&(this[l]=this[l].bind(this));this.nativeDraggable=o.forceFallback?!1:supportDraggable,this.nativeDraggable&&(this.options.touchStartThreshold=1),o.supportPointer?on$3(r,"pointerdown",this._onTapStart):(on$3(r,"mousedown",this._onTapStart),on$3(r,"touchstart",this._onTapStart)),this.nativeDraggable&&(on$3(r,"dragover",this),on$3(r,"dragenter",this)),sortables.push(this.el),o.store&&o.store.get&&this.sort(o.store.get(this)||[]),_extends(this,AnimationStateManager())}Sortable.prototype={constructor:Sortable,_isOutsideThisEl:function(o){!this.el.contains(o)&&o!==this.el&&(lastTarget=null)},_getDirection:function(o,s){return typeof this.options.direction=="function"?this.options.direction.call(this,o,s,dragEl):this.options.direction},_onTapStart:function(o){if(o.cancelable){var s=this,a=this.el,l=this.options,c=l.preventOnFilter,u=o.type,d=o.touches&&o.touches[0]||o.pointerType&&o.pointerType==="touch"&&o,m=(d||o).target,g=o.target.shadowRoot&&(o.path&&o.path[0]||o.composedPath&&o.composedPath()[0])||m,y=l.filter;if(_saveInputCheckedState(a),!dragEl&&!(/mousedown|pointerdown/.test(u)&&o.button!==0||l.disabled)&&!g.isContentEditable&&!(!this.nativeDraggable&&Safari&&m&&m.tagName.toUpperCase()==="SELECT")&&(m=closest(m,l.draggable,a,!1),!(m&&m.animated)&&lastDownEl!==m)){if(oldIndex=index$1(m),oldDraggableIndex=index$1(m,l.draggable),typeof y=="function"){if(y.call(this,o,m,this)){_dispatchEvent({sortable:s,rootEl:g,name:"filter",targetEl:m,toEl:a,fromEl:a}),pluginEvent("filter",s,{evt:o}),c&&o.cancelable&&o.preventDefault();return}}else if(y&&(y=y.split(",").some(function(_){if(_=closest(g,_.trim(),a,!1),_)return _dispatchEvent({sortable:s,rootEl:_,name:"filter",targetEl:m,fromEl:a,toEl:a}),pluginEvent("filter",s,{evt:o}),!0}),y)){c&&o.cancelable&&o.preventDefault();return}l.handle&&!closest(g,l.handle,a,!1)||this._prepareDragStart(o,d,m)}}},_prepareDragStart:function(o,s,a){var l=this,c=l.el,u=l.options,d=c.ownerDocument,m;if(a&&!dragEl&&a.parentNode===c){var g=getRect(a);if(rootEl=c,dragEl=a,parentEl=dragEl.parentNode,nextEl=dragEl.nextSibling,lastDownEl=a,activeGroup=u.group,Sortable.dragged=dragEl,tapEvt={target:dragEl,clientX:(s||o).clientX,clientY:(s||o).clientY},tapDistanceLeft=tapEvt.clientX-g.left,tapDistanceTop=tapEvt.clientY-g.top,this._lastX=(s||o).clientX,this._lastY=(s||o).clientY,dragEl.style["will-change"]="all",m=function(){if(pluginEvent("delayEnded",l,{evt:o}),Sortable.eventCanceled){l._onDrop();return}l._disableDelayedDragEvents(),!FireFox&&l.nativeDraggable&&(dragEl.draggable=!0),l._triggerDragStart(o,s),_dispatchEvent({sortable:l,name:"choose",originalEvent:o}),toggleClass(dragEl,u.chosenClass,!0)},u.ignore.split(",").forEach(function(y){find$1(dragEl,y.trim(),_disableDraggable)}),on$3(d,"dragover",nearestEmptyInsertDetectEvent),on$3(d,"mousemove",nearestEmptyInsertDetectEvent),on$3(d,"touchmove",nearestEmptyInsertDetectEvent),on$3(d,"mouseup",l._onDrop),on$3(d,"touchend",l._onDrop),on$3(d,"touchcancel",l._onDrop),FireFox&&this.nativeDraggable&&(this.options.touchStartThreshold=4,dragEl.draggable=!0),pluginEvent("delayStart",this,{evt:o}),u.delay&&(!u.delayOnTouchOnly||s)&&(!this.nativeDraggable||!(Edge||IE11OrLess))){if(Sortable.eventCanceled){this._onDrop();return}on$3(d,"mouseup",l._disableDelayedDrag),on$3(d,"touchend",l._disableDelayedDrag),on$3(d,"touchcancel",l._disableDelayedDrag),on$3(d,"mousemove",l._delayedDragTouchMoveHandler),on$3(d,"touchmove",l._delayedDragTouchMoveHandler),u.supportPointer&&on$3(d,"pointermove",l._delayedDragTouchMoveHandler),l._dragStartTimer=setTimeout(m,u.delay)}else m()}},_delayedDragTouchMoveHandler:function(o){var s=o.touches?o.touches[0]:o;Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){dragEl&&_disableDraggable(dragEl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var o=this.el.ownerDocument;off(o,"mouseup",this._disableDelayedDrag),off(o,"touchend",this._disableDelayedDrag),off(o,"touchcancel",this._disableDelayedDrag),off(o,"mousemove",this._delayedDragTouchMoveHandler),off(o,"touchmove",this._delayedDragTouchMoveHandler),off(o,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(o,s){s=s||o.pointerType=="touch"&&o,!this.nativeDraggable||s?this.options.supportPointer?on$3(document,"pointermove",this._onTouchMove):s?on$3(document,"touchmove",this._onTouchMove):on$3(document,"mousemove",this._onTouchMove):(on$3(dragEl,"dragend",this),on$3(rootEl,"dragstart",this._onDragStart));try{document.selection?_nextTick(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(o,s){if(awaitingDragStarted=!1,rootEl&&dragEl){pluginEvent("dragStarted",this,{evt:s}),this.nativeDraggable&&on$3(document,"dragover",_checkOutsideTargetEl);var a=this.options;!o&&toggleClass(dragEl,a.dragClass,!1),toggleClass(dragEl,a.ghostClass,!0),Sortable.active=this,o&&this._appendGhost(),_dispatchEvent({sortable:this,name:"start",originalEvent:s})}else this._nulling()},_emulateDragOver:function(){if(touchEvt){this._lastX=touchEvt.clientX,this._lastY=touchEvt.clientY,_hideGhostForTarget();for(var o=document.elementFromPoint(touchEvt.clientX,touchEvt.clientY),s=o;o&&o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(touchEvt.clientX,touchEvt.clientY),o!==s);)s=o;if(dragEl.parentNode[expando]._isOutsideThisEl(o),s)do{if(s[expando]){var a=void 0;if(a=s[expando]._onDragOver({clientX:touchEvt.clientX,clientY:touchEvt.clientY,target:o,rootEl:s}),a&&!this.options.dragoverBubble)break}o=s}while(s=s.parentNode);_unhideGhostForTarget()}},_onTouchMove:function(o){if(tapEvt){var s=this.options,a=s.fallbackTolerance,l=s.fallbackOffset,c=o.touches?o.touches[0]:o,u=ghostEl&&matrix(ghostEl,!0),d=ghostEl&&u&&u.a,m=ghostEl&&u&&u.d,g=PositionGhostAbsolutely&&ghostRelativeParent&&getRelativeScrollOffset(ghostRelativeParent),y=(c.clientX-tapEvt.clientX+l.x)/(d||1)+(g?g[0]-ghostRelativeParentInitialScroll[0]:0)/(d||1),_=(c.clientY-tapEvt.clientY+l.y)/(m||1)+(g?g[1]-ghostRelativeParentInitialScroll[1]:0)/(m||1);if(!Sortable.active&&!awaitingDragStarted){if(a&&Math.max(Math.abs(c.clientX-this._lastX),Math.abs(c.clientY-this._lastY))=0&&(_dispatchEvent({rootEl:parentEl,name:"add",toEl:parentEl,fromEl:rootEl,originalEvent:o}),_dispatchEvent({sortable:this,name:"remove",toEl:parentEl,originalEvent:o}),_dispatchEvent({rootEl:parentEl,name:"sort",toEl:parentEl,fromEl:rootEl,originalEvent:o}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:o})),putSortable&&putSortable.save()):newIndex!==oldIndex&&newIndex>=0&&(_dispatchEvent({sortable:this,name:"update",toEl:parentEl,originalEvent:o}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:o})),Sortable.active&&((newIndex==null||newIndex===-1)&&(newIndex=oldIndex,newDraggableIndex=oldDraggableIndex),_dispatchEvent({sortable:this,name:"end",toEl:parentEl,originalEvent:o}),this.save()))),this._nulling()},_nulling:function(){pluginEvent("nulling",this),rootEl=dragEl=parentEl=ghostEl=nextEl=cloneEl=lastDownEl=cloneHidden=tapEvt=touchEvt=moved=newIndex=newDraggableIndex=oldIndex=oldDraggableIndex=lastTarget=lastDirection=putSortable=activeGroup=Sortable.dragged=Sortable.ghost=Sortable.clone=Sortable.active=null,savedInputChecked.forEach(function(o){o.checked=!0}),savedInputChecked.length=lastDx=lastDy=0},handleEvent:function(o){switch(o.type){case"drop":case"dragend":this._onDrop(o);break;case"dragenter":case"dragover":dragEl&&(this._onDragOver(o),_globalDragOver(o));break;case"selectstart":o.preventDefault();break}},toArray:function(){for(var o=[],s,a=this.el.children,l=0,c=a.length,u=this.options;la.right+l||r.clientX<=a.right&&r.clientY>a.bottom&&r.clientX>=a.left:r.clientX>a.right&&r.clientY>a.top||r.clientX<=a.right&&r.clientY>a.bottom+l}function _getSwapDirection(r,o,s,a,l,c,u,d){var m=a?r.clientY:r.clientX,g=a?s.height:s.width,y=a?s.top:s.left,_=a?s.bottom:s.right,E=!1;if(!u){if(d&&targetMoveDistancey+g*c/2:m<_-g*c/2)&&(pastFirstInvertThresh=!0),pastFirstInvertThresh)E=!0;else if(lastDirection===1?m_-targetMoveDistance)return-lastDirection}else if(m>y+g*(1-l)/2&&m<_-g*(1-l)/2)return _getInsertDirection(o)}return E=E||u,E&&(m_-g*c/2)?m>y+g/2?1:-1:0}function _getInsertDirection(r){return index$1(dragEl)1&&(multiDragElements.forEach(function(d){c.addAnimationState({target:d,rect:folding?getRect(d):u}),unsetRect(d),d.fromRect=u,a.removeAnimationState(d)}),folding=!1,insertMultiDragElements(!this.options.removeCloneOnHide,l))},dragOverCompleted:function(s){var a=s.sortable,l=s.isOwner,c=s.insertion,u=s.activeSortable,d=s.parentEl,m=s.putSortable,g=this.options;if(c){if(l&&u._hideClone(),initialFolding=!1,g.animation&&multiDragElements.length>1&&(folding||!l&&!u.options.sort&&!m)){var y=getRect(dragEl$1,!1,!0,!0);multiDragElements.forEach(function(E){E!==dragEl$1&&(setRect(E,y),d.appendChild(E))}),folding=!0}if(!l)if(folding||removeMultiDragElements(),multiDragElements.length>1){var _=clonesHidden;u._showClone(a),u.options.animation&&!clonesHidden&&_&&multiDragClones.forEach(function(E){u.addAnimationState({target:E,rect:clonesFromRect}),E.fromRect=clonesFromRect,E.thisAnimationDuration=null})}else u._showClone(a)}},dragOverAnimationCapture:function(s){var a=s.dragRect,l=s.isOwner,c=s.activeSortable;if(multiDragElements.forEach(function(d){d.thisAnimationDuration=null}),c.options.animation&&!l&&c.multiDrag.isMultiDrag){clonesFromRect=_extends({},a);var u=matrix(dragEl$1,!0);clonesFromRect.top-=u.f,clonesFromRect.left-=u.e}},dragOverAnimationComplete:function(){folding&&(folding=!1,removeMultiDragElements())},drop:function(s){var a=s.originalEvent,l=s.rootEl,c=s.parentEl,u=s.sortable,d=s.dispatchSortableEvent,m=s.oldIndex,g=s.putSortable,y=g||this.sortable;if(a){var _=this.options,E=c.children;if(!dragStarted)if(_.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),toggleClass(dragEl$1,_.selectedClass,!~multiDragElements.indexOf(dragEl$1)),~multiDragElements.indexOf(dragEl$1))multiDragElements.splice(multiDragElements.indexOf(dragEl$1),1),lastMultiDragSelect=null,dispatchEvent({sortable:u,rootEl:l,name:"deselect",targetEl:dragEl$1,originalEvt:a});else{if(multiDragElements.push(dragEl$1),dispatchEvent({sortable:u,rootEl:l,name:"select",targetEl:dragEl$1,originalEvt:a}),a.shiftKey&&lastMultiDragSelect&&u.el.contains(lastMultiDragSelect)){var w=index$1(lastMultiDragSelect),T=index$1(dragEl$1);if(~w&&~T&&w!==T){var k,O;for(T>w?(O=w,k=T):(O=T,k=w+1);O1){var R=getRect(dragEl$1),M=index$1(dragEl$1,":not(."+this.options.selectedClass+")");if(!initialFolding&&_.animation&&(dragEl$1.thisAnimationDuration=null),y.captureAnimationState(),!initialFolding&&(_.animation&&(dragEl$1.fromRect=R,multiDragElements.forEach(function(D){if(D.thisAnimationDuration=null,D!==dragEl$1){var P=folding?getRect(D):R;D.fromRect=P,y.addAnimationState({target:D,rect:P})}})),removeMultiDragElements(),multiDragElements.forEach(function(D){E[M]?c.insertBefore(D,E[M]):c.appendChild(D),M++}),m===index$1(dragEl$1))){var N=!1;multiDragElements.forEach(function(D){if(D.sortableIndex!==index$1(D)){N=!0;return}}),N&&d("update")}multiDragElements.forEach(function(D){unsetRect(D)}),y.animateAll()}multiDragSortable=y}(l===c||g&&g.lastPutMode!=="clone")&&multiDragClones.forEach(function(D){D.parentNode&&D.parentNode.removeChild(D)})}},nullingGlobal:function(){this.isMultiDrag=dragStarted=!1,multiDragClones.length=0},destroyGlobal:function(){this._deselectMultiDrag(),off(document,"pointerup",this._deselectMultiDrag),off(document,"mouseup",this._deselectMultiDrag),off(document,"touchend",this._deselectMultiDrag),off(document,"keydown",this._checkKeyDown),off(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(s){if(!(typeof dragStarted<"u"&&dragStarted)&&multiDragSortable===this.sortable&&!(s&&closest(s.target,this.options.draggable,this.sortable.el,!1))&&!(s&&s.button!==0))for(;multiDragElements.length;){var a=multiDragElements[0];toggleClass(a,this.options.selectedClass,!1),multiDragElements.shift(),dispatchEvent({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:a,originalEvt:s})}},_checkKeyDown:function(s){s.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(s){s.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},_extends(r,{pluginName:"multiDrag",utils:{select:function(s){var a=s.parentNode[expando];!a||!a.options.multiDrag||~multiDragElements.indexOf(s)||(multiDragSortable&&multiDragSortable!==a&&(multiDragSortable.multiDrag._deselectMultiDrag(),multiDragSortable=a),toggleClass(s,a.options.selectedClass,!0),multiDragElements.push(s))},deselect:function(s){var a=s.parentNode[expando],l=multiDragElements.indexOf(s);!a||!a.options.multiDrag||!~l||(toggleClass(s,a.options.selectedClass,!1),multiDragElements.splice(l,1))}},eventProperties:function(){var s=this,a=[],l=[];return multiDragElements.forEach(function(c){a.push({multiDragElement:c,index:c.sortableIndex});var u;folding&&c!==dragEl$1?u=-1:folding?u=index$1(c,":not(."+s.options.selectedClass+")"):u=index$1(c),l.push({multiDragElement:c,index:u})}),{items:_toConsumableArray(multiDragElements),clones:[].concat(multiDragClones),oldIndicies:a,newIndicies:l}},optionListeners:{multiDragKey:function(s){return s=s.toLowerCase(),s==="ctrl"?s="Control":s.length>1&&(s=s.charAt(0).toUpperCase()+s.substr(1)),s}}})}function insertMultiDragElements(r,o){multiDragElements.forEach(function(s,a){var l=o.children[s.sortableIndex+(r?Number(a):0)];l?o.insertBefore(s,l):o.appendChild(s)})}function insertMultiDragClones(r,o){multiDragClones.forEach(function(s,a){var l=o.children[s.sortableIndex+(r?Number(a):0)];l?o.insertBefore(s,l):o.appendChild(s)})}function removeMultiDragElements(){multiDragElements.forEach(function(r){r!==dragEl$1&&r.parentNode&&r.parentNode.removeChild(r)})}Sortable.mount(new AutoScrollPlugin);Sortable.mount(Remove,Revert);const sortable_esm=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:MultiDragPlugin,Sortable,Swap:SwapPlugin,default:Sortable},Symbol.toStringTag,{value:"Module"})),require$$1=getAugmentedNamespace(sortable_esm);(function(r,o){(function(a,l){r.exports=l(require$$1$1,require$$1)})(typeof self<"u"?self:commonjsGlobal$1,function(s,a){return function(l){var c={};function u(d){if(c[d])return c[d].exports;var m=c[d]={i:d,l:!1,exports:{}};return l[d].call(m.exports,m,m.exports,u),m.l=!0,m.exports}return u.m=l,u.c=c,u.d=function(d,m,g){u.o(d,m)||Object.defineProperty(d,m,{enumerable:!0,get:g})},u.r=function(d){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},u.t=function(d,m){if(m&1&&(d=u(d)),m&8||m&4&&typeof d=="object"&&d&&d.__esModule)return d;var g=Object.create(null);if(u.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:d}),m&2&&typeof d!="string")for(var y in d)u.d(g,y,function(_){return d[_]}.bind(null,y));return g},u.n=function(d){var m=d&&d.__esModule?function(){return d.default}:function(){return d};return u.d(m,"a",m),m},u.o=function(d,m){return Object.prototype.hasOwnProperty.call(d,m)},u.p="",u(u.s="fb15")}({"00ee":function(l,c,u){var d=u("b622"),m=d("toStringTag"),g={};g[m]="z",l.exports=String(g)==="[object z]"},"0366":function(l,c,u){var d=u("1c0b");l.exports=function(m,g,y){if(d(m),g===void 0)return m;switch(y){case 0:return function(){return m.call(g)};case 1:return function(_){return m.call(g,_)};case 2:return function(_,E){return m.call(g,_,E)};case 3:return function(_,E,w){return m.call(g,_,E,w)}}return function(){return m.apply(g,arguments)}}},"057f":function(l,c,u){var d=u("fc6a"),m=u("241c").f,g={}.toString,y=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],_=function(E){try{return m(E)}catch{return y.slice()}};l.exports.f=function(w){return y&&g.call(w)=="[object Window]"?_(w):m(d(w))}},"06cf":function(l,c,u){var d=u("83ab"),m=u("d1e7"),g=u("5c6c"),y=u("fc6a"),_=u("c04e"),E=u("5135"),w=u("0cfb"),T=Object.getOwnPropertyDescriptor;c.f=d?T:function(O,R){if(O=y(O),R=_(R,!0),w)try{return T(O,R)}catch{}if(E(O,R))return g(!m.f.call(O,R),O[R])}},"0cfb":function(l,c,u){var d=u("83ab"),m=u("d039"),g=u("cc12");l.exports=!d&&!m(function(){return Object.defineProperty(g("div"),"a",{get:function(){return 7}}).a!=7})},"13d5":function(l,c,u){var d=u("23e7"),m=u("d58f").left,g=u("a640"),y=u("ae40"),_=g("reduce"),E=y("reduce",{1:0});d({target:"Array",proto:!0,forced:!_||!E},{reduce:function(T){return m(this,T,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(l,c,u){var d=u("c6b6"),m=u("9263");l.exports=function(g,y){var _=g.exec;if(typeof _=="function"){var E=_.call(g,y);if(typeof E!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return E}if(d(g)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return m.call(g,y)}},"159b":function(l,c,u){var d=u("da84"),m=u("fdbc"),g=u("17c2"),y=u("9112");for(var _ in m){var E=d[_],w=E&&E.prototype;if(w&&w.forEach!==g)try{y(w,"forEach",g)}catch{w.forEach=g}}},"17c2":function(l,c,u){var d=u("b727").forEach,m=u("a640"),g=u("ae40"),y=m("forEach"),_=g("forEach");l.exports=!y||!_?function(w){return d(this,w,arguments.length>1?arguments[1]:void 0)}:[].forEach},"1be4":function(l,c,u){var d=u("d066");l.exports=d("document","documentElement")},"1c0b":function(l,c){l.exports=function(u){if(typeof u!="function")throw TypeError(String(u)+" is not a function");return u}},"1c7e":function(l,c,u){var d=u("b622"),m=d("iterator"),g=!1;try{var y=0,_={next:function(){return{done:!!y++}},return:function(){g=!0}};_[m]=function(){return this},Array.from(_,function(){throw 2})}catch{}l.exports=function(E,w){if(!w&&!g)return!1;var T=!1;try{var k={};k[m]=function(){return{next:function(){return{done:T=!0}}}},E(k)}catch{}return T}},"1d80":function(l,c){l.exports=function(u){if(u==null)throw TypeError("Can't call method on "+u);return u}},"1dde":function(l,c,u){var d=u("d039"),m=u("b622"),g=u("2d00"),y=m("species");l.exports=function(_){return g>=51||!d(function(){var E=[],w=E.constructor={};return w[y]=function(){return{foo:1}},E[_](Boolean).foo!==1})}},"23cb":function(l,c,u){var d=u("a691"),m=Math.max,g=Math.min;l.exports=function(y,_){var E=d(y);return E<0?m(E+_,0):g(E,_)}},"23e7":function(l,c,u){var d=u("da84"),m=u("06cf").f,g=u("9112"),y=u("6eeb"),_=u("ce4e"),E=u("e893"),w=u("94ca");l.exports=function(T,k){var O=T.target,R=T.global,M=T.stat,N,D,P,I,L,F;if(R?D=d:M?D=d[O]||_(O,{}):D=(d[O]||{}).prototype,D)for(P in k){if(L=k[P],T.noTargetGet?(F=m(D,P),I=F&&F.value):I=D[P],N=w(R?P:O+(M?".":"#")+P,T.forced),!N&&I!==void 0){if(typeof L==typeof I)continue;E(L,I)}(T.sham||I&&I.sham)&&g(L,"sham",!0),y(D,P,L,T)}}},"241c":function(l,c,u){var d=u("ca84"),m=u("7839"),g=m.concat("length","prototype");c.f=Object.getOwnPropertyNames||function(_){return d(_,g)}},"25f0":function(l,c,u){var d=u("6eeb"),m=u("825a"),g=u("d039"),y=u("ad6d"),_="toString",E=RegExp.prototype,w=E[_],T=g(function(){return w.call({source:"a",flags:"b"})!="/a/b"}),k=w.name!=_;(T||k)&&d(RegExp.prototype,_,function(){var R=m(this),M=String(R.source),N=R.flags,D=String(N===void 0&&R instanceof RegExp&&!("flags"in E)?y.call(R):N);return"/"+M+"/"+D},{unsafe:!0})},"2ca0":function(l,c,u){var d=u("23e7"),m=u("06cf").f,g=u("50c4"),y=u("5a34"),_=u("1d80"),E=u("ab13"),w=u("c430"),T="".startsWith,k=Math.min,O=E("startsWith"),R=!w&&!O&&!!function(){var M=m(String.prototype,"startsWith");return M&&!M.writable}();d({target:"String",proto:!0,forced:!R&&!O},{startsWith:function(N){var D=String(_(this));y(N);var P=g(k(arguments.length>1?arguments[1]:void 0,D.length)),I=String(N);return T?T.call(D,I,P):D.slice(P,P+I.length)===I}})},"2d00":function(l,c,u){var d=u("da84"),m=u("342f"),g=d.process,y=g&&g.versions,_=y&&y.v8,E,w;_?(E=_.split("."),w=E[0]+E[1]):m&&(E=m.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=m.match(/Chrome\/(\d+)/),E&&(w=E[1]))),l.exports=w&&+w},"342f":function(l,c,u){var d=u("d066");l.exports=d("navigator","userAgent")||""},"35a1":function(l,c,u){var d=u("f5df"),m=u("3f8c"),g=u("b622"),y=g("iterator");l.exports=function(_){if(_!=null)return _[y]||_["@@iterator"]||m[d(_)]}},"37e8":function(l,c,u){var d=u("83ab"),m=u("9bf2"),g=u("825a"),y=u("df75");l.exports=d?Object.defineProperties:function(E,w){g(E);for(var T=y(w),k=T.length,O=0,R;k>O;)m.f(E,R=T[O++],w[R]);return E}},"3bbe":function(l,c,u){var d=u("861d");l.exports=function(m){if(!d(m)&&m!==null)throw TypeError("Can't set "+String(m)+" as a prototype");return m}},"3ca3":function(l,c,u){var d=u("6547").charAt,m=u("69f3"),g=u("7dd0"),y="String Iterator",_=m.set,E=m.getterFor(y);g(String,"String",function(w){_(this,{type:y,string:String(w),index:0})},function(){var T=E(this),k=T.string,O=T.index,R;return O>=k.length?{value:void 0,done:!0}:(R=d(k,O),T.index+=R.length,{value:R,done:!1})})},"3f8c":function(l,c){l.exports={}},4160:function(l,c,u){var d=u("23e7"),m=u("17c2");d({target:"Array",proto:!0,forced:[].forEach!=m},{forEach:m})},"428f":function(l,c,u){var d=u("da84");l.exports=d},"44ad":function(l,c,u){var d=u("d039"),m=u("c6b6"),g="".split;l.exports=d(function(){return!Object("z").propertyIsEnumerable(0)})?function(y){return m(y)=="String"?g.call(y,""):Object(y)}:Object},"44d2":function(l,c,u){var d=u("b622"),m=u("7c73"),g=u("9bf2"),y=d("unscopables"),_=Array.prototype;_[y]==null&&g.f(_,y,{configurable:!0,value:m(null)}),l.exports=function(E){_[y][E]=!0}},"44e7":function(l,c,u){var d=u("861d"),m=u("c6b6"),g=u("b622"),y=g("match");l.exports=function(_){var E;return d(_)&&((E=_[y])!==void 0?!!E:m(_)=="RegExp")}},4930:function(l,c,u){var d=u("d039");l.exports=!!Object.getOwnPropertySymbols&&!d(function(){return!String(Symbol())})},"4d64":function(l,c,u){var d=u("fc6a"),m=u("50c4"),g=u("23cb"),y=function(_){return function(E,w,T){var k=d(E),O=m(k.length),R=g(T,O),M;if(_&&w!=w){for(;O>R;)if(M=k[R++],M!=M)return!0}else for(;O>R;R++)if((_||R in k)&&k[R]===w)return _||R||0;return!_&&-1}};l.exports={includes:y(!0),indexOf:y(!1)}},"4de4":function(l,c,u){var d=u("23e7"),m=u("b727").filter,g=u("1dde"),y=u("ae40"),_=g("filter"),E=y("filter");d({target:"Array",proto:!0,forced:!_||!E},{filter:function(T){return m(this,T,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(l,c,u){var d=u("0366"),m=u("7b0b"),g=u("9bdd"),y=u("e95a"),_=u("50c4"),E=u("8418"),w=u("35a1");l.exports=function(k){var O=m(k),R=typeof this=="function"?this:Array,M=arguments.length,N=M>1?arguments[1]:void 0,D=N!==void 0,P=w(O),I=0,L,F,U,J,z,ie;if(D&&(N=d(N,M>2?arguments[2]:void 0,2)),P!=null&&!(R==Array&&y(P)))for(J=P.call(O),z=J.next,F=new R;!(U=z.call(J)).done;I++)ie=D?g(J,N,[U.value,I],!0):U.value,E(F,I,ie);else for(L=_(O.length),F=new R(L);L>I;I++)ie=D?N(O[I],I):O[I],E(F,I,ie);return F.length=I,F}},"4fad":function(l,c,u){var d=u("23e7"),m=u("6f53").entries;d({target:"Object",stat:!0},{entries:function(y){return m(y)}})},"50c4":function(l,c,u){var d=u("a691"),m=Math.min;l.exports=function(g){return g>0?m(d(g),9007199254740991):0}},5135:function(l,c){var u={}.hasOwnProperty;l.exports=function(d,m){return u.call(d,m)}},5319:function(l,c,u){var d=u("d784"),m=u("825a"),g=u("7b0b"),y=u("50c4"),_=u("a691"),E=u("1d80"),w=u("8aa5"),T=u("14c3"),k=Math.max,O=Math.min,R=Math.floor,M=/\$([$&'`]|\d\d?|<[^>]*>)/g,N=/\$([$&'`]|\d\d?)/g,D=function(P){return P===void 0?P:String(P)};d("replace",2,function(P,I,L,F){var U=F.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,J=F.REPLACE_KEEPS_$0,z=U?"$":"$0";return[function(Y,B){var V=E(this),Ge=Y?.[P];return Ge!==void 0?Ge.call(Y,V,B):I.call(String(V),Y,B)},function(ce,Y){if(!U&&J||typeof Y=="string"&&Y.indexOf(z)===-1){var B=L(I,ce,this,Y);if(B.done)return B.value}var V=m(ce),Ge=String(this),St=typeof Y=="function";St||(Y=String(Y));var Dee=V.global;if(Dee){var pee=V.unicode;V.lastIndex=0}for(var jr=[];;){var Tee=T(V,Ge);if(Tee===null||(jr.push(Tee),!Dee))break;var et=String(Tee[0]);et===""&&(V.lastIndex=w(Ge,y(V.lastIndex),pee))}for(var ft="",yee=0,ete=0;ete=yee&&(ft+=Ge.slice(yee,Ote)+_ee,yee=Ote+xte.length)}return ft+Ge.slice(yee)}];function ie(ce,Y,B,V,Ge,St){var Dee=B+ce.length,pee=V.length,jr=N;return Ge!==void 0&&(Ge=g(Ge),jr=M),I.call(St,jr,function(Tee,et){var ft;switch(et.charAt(0)){case"$":return"$";case"&":return ce;case"`":return Y.slice(0,B);case"'":return Y.slice(Dee);case"<":ft=Ge[et.slice(1,-1)];break;default:var yee=+et;if(yee===0)return Tee;if(yee>pee){var ete=R(yee/10);return ete===0?Tee:ete<=pee?V[ete-1]===void 0?et.charAt(1):V[ete-1]+et.charAt(1):Tee}ft=V[yee-1]}return ft===void 0?"":ft})}})},5692:function(l,c,u){var d=u("c430"),m=u("c6cd");(l.exports=function(g,y){return m[g]||(m[g]=y!==void 0?y:{})})("versions",[]).push({version:"3.6.5",mode:d?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(l,c,u){var d=u("d066"),m=u("241c"),g=u("7418"),y=u("825a");l.exports=d("Reflect","ownKeys")||function(E){var w=m.f(y(E)),T=g.f;return T?w.concat(T(E)):w}},"5a34":function(l,c,u){var d=u("44e7");l.exports=function(m){if(d(m))throw TypeError("The method doesn't accept regular expressions");return m}},"5c6c":function(l,c){l.exports=function(u,d){return{enumerable:!(u&1),configurable:!(u&2),writable:!(u&4),value:d}}},"5db7":function(l,c,u){var d=u("23e7"),m=u("a2bf"),g=u("7b0b"),y=u("50c4"),_=u("1c0b"),E=u("65f0");d({target:"Array",proto:!0},{flatMap:function(T){var k=g(this),O=y(k.length),R;return _(T),R=E(k,0),R.length=m(R,k,k,O,0,1,T,arguments.length>1?arguments[1]:void 0),R}})},6547:function(l,c,u){var d=u("a691"),m=u("1d80"),g=function(y){return function(_,E){var w=String(m(_)),T=d(E),k=w.length,O,R;return T<0||T>=k?y?"":void 0:(O=w.charCodeAt(T),O<55296||O>56319||T+1===k||(R=w.charCodeAt(T+1))<56320||R>57343?y?w.charAt(T):O:y?w.slice(T,T+2):(O-55296<<10)+(R-56320)+65536)}};l.exports={codeAt:g(!1),charAt:g(!0)}},"65f0":function(l,c,u){var d=u("861d"),m=u("e8b5"),g=u("b622"),y=g("species");l.exports=function(_,E){var w;return m(_)&&(w=_.constructor,typeof w=="function"&&(w===Array||m(w.prototype))?w=void 0:d(w)&&(w=w[y],w===null&&(w=void 0))),new(w===void 0?Array:w)(E===0?0:E)}},"69f3":function(l,c,u){var d=u("7f9a"),m=u("da84"),g=u("861d"),y=u("9112"),_=u("5135"),E=u("f772"),w=u("d012"),T=m.WeakMap,k,O,R,M=function(U){return R(U)?O(U):k(U,{})},N=function(U){return function(J){var z;if(!g(J)||(z=O(J)).type!==U)throw TypeError("Incompatible receiver, "+U+" required");return z}};if(d){var D=new T,P=D.get,I=D.has,L=D.set;k=function(U,J){return L.call(D,U,J),J},O=function(U){return P.call(D,U)||{}},R=function(U){return I.call(D,U)}}else{var F=E("state");w[F]=!0,k=function(U,J){return y(U,F,J),J},O=function(U){return _(U,F)?U[F]:{}},R=function(U){return _(U,F)}}l.exports={set:k,get:O,has:R,enforce:M,getterFor:N}},"6eeb":function(l,c,u){var d=u("da84"),m=u("9112"),g=u("5135"),y=u("ce4e"),_=u("8925"),E=u("69f3"),w=E.get,T=E.enforce,k=String(String).split("String");(l.exports=function(O,R,M,N){var D=N?!!N.unsafe:!1,P=N?!!N.enumerable:!1,I=N?!!N.noTargetGet:!1;if(typeof M=="function"&&(typeof R=="string"&&!g(M,"name")&&m(M,"name",R),T(M).source=k.join(typeof R=="string"?R:"")),O===d){P?O[R]=M:y(R,M);return}else D?!I&&O[R]&&(P=!0):delete O[R];P?O[R]=M:m(O,R,M)})(Function.prototype,"toString",function(){return typeof this=="function"&&w(this).source||_(this)})},"6f53":function(l,c,u){var d=u("83ab"),m=u("df75"),g=u("fc6a"),y=u("d1e7").f,_=function(E){return function(w){for(var T=g(w),k=m(T),O=k.length,R=0,M=[],N;O>R;)N=k[R++],(!d||y.call(T,N))&&M.push(E?[N,T[N]]:T[N]);return M}};l.exports={entries:_(!0),values:_(!1)}},"73d9":function(l,c,u){var d=u("44d2");d("flatMap")},7418:function(l,c){c.f=Object.getOwnPropertySymbols},"746f":function(l,c,u){var d=u("428f"),m=u("5135"),g=u("e538"),y=u("9bf2").f;l.exports=function(_){var E=d.Symbol||(d.Symbol={});m(E,_)||y(E,_,{value:g.f(_)})}},7839:function(l,c){l.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(l,c,u){var d=u("1d80");l.exports=function(m){return Object(d(m))}},"7c73":function(l,c,u){var d=u("825a"),m=u("37e8"),g=u("7839"),y=u("d012"),_=u("1be4"),E=u("cc12"),w=u("f772"),T=">",k="<",O="prototype",R="script",M=w("IE_PROTO"),N=function(){},D=function(U){return k+R+T+U+k+"/"+R+T},P=function(U){U.write(D("")),U.close();var J=U.parentWindow.Object;return U=null,J},I=function(){var U=E("iframe"),J="java"+R+":",z;return U.style.display="none",_.appendChild(U),U.src=String(J),z=U.contentWindow.document,z.open(),z.write(D("document.F=Object")),z.close(),z.F},L,F=function(){try{L=document.domain&&new ActiveXObject("htmlfile")}catch{}F=L?P(L):I();for(var U=g.length;U--;)delete F[O][g[U]];return F()};y[M]=!0,l.exports=Object.create||function(J,z){var ie;return J!==null?(N[O]=d(J),ie=new N,N[O]=null,ie[M]=J):ie=F(),z===void 0?ie:m(ie,z)}},"7dd0":function(l,c,u){var d=u("23e7"),m=u("9ed3"),g=u("e163"),y=u("d2bb"),_=u("d44e"),E=u("9112"),w=u("6eeb"),T=u("b622"),k=u("c430"),O=u("3f8c"),R=u("ae93"),M=R.IteratorPrototype,N=R.BUGGY_SAFARI_ITERATORS,D=T("iterator"),P="keys",I="values",L="entries",F=function(){return this};l.exports=function(U,J,z,ie,ce,Y,B){m(z,J,ie);var V=function(ete){if(ete===ce&&jr)return jr;if(!N&&ete in Dee)return Dee[ete];switch(ete){case P:return function(){return new z(this,ete)};case I:return function(){return new z(this,ete)};case L:return function(){return new z(this,ete)}}return function(){return new z(this)}},Ge=J+" Iterator",St=!1,Dee=U.prototype,pee=Dee[D]||Dee["@@iterator"]||ce&&Dee[ce],jr=!N&&pee||V(ce),Tee=J=="Array"&&Dee.entries||pee,et,ft,yee;if(Tee&&(et=g(Tee.call(new U)),M!==Object.prototype&&et.next&&(!k&&g(et)!==M&&(y?y(et,M):typeof et[D]!="function"&&E(et,D,F)),_(et,Ge,!0,!0),k&&(O[Ge]=F))),ce==I&&pee&&pee.name!==I&&(St=!0,jr=function(){return pee.call(this)}),(!k||B)&&Dee[D]!==jr&&E(Dee,D,jr),O[J]=jr,ce)if(ft={values:V(I),keys:Y?jr:V(P),entries:V(L)},B)for(yee in ft)(N||St||!(yee in Dee))&&w(Dee,yee,ft[yee]);else d({target:J,proto:!0,forced:N||St},ft);return ft}},"7f9a":function(l,c,u){var d=u("da84"),m=u("8925"),g=d.WeakMap;l.exports=typeof g=="function"&&/native code/.test(m(g))},"825a":function(l,c,u){var d=u("861d");l.exports=function(m){if(!d(m))throw TypeError(String(m)+" is not an object");return m}},"83ab":function(l,c,u){var d=u("d039");l.exports=!d(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},8418:function(l,c,u){var d=u("c04e"),m=u("9bf2"),g=u("5c6c");l.exports=function(y,_,E){var w=d(_);w in y?m.f(y,w,g(0,E)):y[w]=E}},"861d":function(l,c){l.exports=function(u){return typeof u=="object"?u!==null:typeof u=="function"}},8875:function(l,c,u){var d,m,g;(function(y,_){m=[],d=_,g=typeof d=="function"?d.apply(c,m):d,g!==void 0&&(l.exports=g)})(typeof self<"u"?self:this,function(){function y(){var _=Object.getOwnPropertyDescriptor(document,"currentScript");if(!_&&"currentScript"in document&&document.currentScript||_&&_.get!==y&&document.currentScript)return document.currentScript;try{throw new Error}catch(L){var E=/.*at [^(]*\((.*):(.+):(.+)\)$/ig,w=/@([^@]*):(\d+):(\d+)\s*$/ig,T=E.exec(L.stack)||w.exec(L.stack),k=T&&T[1]||!1,O=T&&T[2]||!1,R=document.location.href.replace(document.location.hash,""),M,N,D,P=document.getElementsByTagName("script");k===R&&(M=document.documentElement.outerHTML,N=new RegExp("(?:[^\\n]+?\\n){0,"+(O-2)+"}[^<]*
',P.appendChild(U),M.submenuTitle&&(U.title=M.submenuTitle),L=U}else{var J=document.createElement("div");J.className="jsoneditor-expand",I.appendChild(J),L=I}L.onclick=function(ce){ce.preventDefault(),d._onExpandItem(D),L.focus()};var z=[];D.subItems=z;var ie=document.createElement("ul");D.ul=ie,ie.className="jsoneditor-menu",ie.style.height="0",P.appendChild(ie),T(ie,z,M.submenu)}else I.innerHTML='
'+M.text;O.push(D)}})}(_,this.dom.items,c),this.maxHeight=0,c.forEach(function(T){var k=24*(c.length+(T.submenu?T.submenu.length:0));d.maxHeight=Math.max(d.maxHeight,k)})}l.prototype._getVisibleButtons=function(){var c=[],u=this;return this.dom.items.forEach(function(d){c.push(d.button),d.buttonExpand&&c.push(d.buttonExpand),d.subItems&&d==u.expandedItem&&d.subItems.forEach(function(m){c.push(m.button),m.buttonExpand&&c.push(m.buttonExpand)})}),c},l.visibleMenu=void 0,l.prototype.show=function(c,u){this.hide();var d=!0;if(u){var m=c.getBoundingClientRect(),g=u.getBoundingClientRect();m.bottom+this.maxHeightg.top&&(d=!1)}if(d){var y=c.offsetHeight;this.dom.menu.style.left="0px",this.dom.menu.style.top=y+"px",this.dom.menu.style.bottom=""}else this.dom.menu.style.left="0px",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px";var _=c.parentNode;_.insertBefore(this.dom.root,_.firstChild);var E=this,w=this.dom.list;this.eventListeners.mousedown=a.addEventListener(window,"mousedown",function(T){var k=T.target;k==w||E._isChildOf(k,w)||(E.hide(),T.stopPropagation(),T.preventDefault())}),this.eventListeners.keydown=a.addEventListener(window,"keydown",function(T){E._onKeyDown(T)}),this.selection=a.getSelection(),this.anchor=c,setTimeout(function(){E.dom.focusButton.focus()},0),l.visibleMenu&&l.visibleMenu.hide(),l.visibleMenu=this},l.prototype.hide=function(){for(var c in this.dom.root.parentNode&&(this.dom.root.parentNode.removeChild(this.dom.root),this.onClose&&this.onClose()),this.eventListeners)if(this.eventListeners.hasOwnProperty(c)){var u=this.eventListeners[c];u&&a.removeEventListener(window,c,u),delete this.eventListeners[c]}l.visibleMenu==this&&(l.visibleMenu=void 0)},l.prototype._onExpandItem=function(c){var u=this,d=c==this.expandedItem,m=this.expandedItem;if(m&&(m.ul.style.height="0",m.ul.style.padding="",setTimeout(function(){u.expandedItem!=m&&(m.ul.style.display="",a.removeClassName(m.ul.parentNode,"jsoneditor-selected"))},300),this.expandedItem=void 0),!d){var g=c.ul;g.style.display="block",g.clientHeight,setTimeout(function(){u.expandedItem==c&&(g.style.height=24*g.childNodes.length+"px",g.style.padding="5px 10px")},0),a.addClassName(g.parentNode,"jsoneditor-selected"),this.expandedItem=c}},l.prototype._onKeyDown=function(c){var u,d,m,g,y=c.target,_=c.which,E=!1;_==27?(this.selection&&a.setSelection(this.selection),this.anchor&&this.anchor.focus(),this.hide(),E=!0):_==9?c.shiftKey?(d=(u=this._getVisibleButtons()).indexOf(y))==0&&(u[u.length-1].focus(),E=!0):(d=(u=this._getVisibleButtons()).indexOf(y))==u.length-1&&(u[0].focus(),E=!0):_==37?(y.className=="jsoneditor-expand"&&(d=(u=this._getVisibleButtons()).indexOf(y),(m=u[d-1])&&m.focus()),E=!0):_==38?(d=(u=this._getVisibleButtons()).indexOf(y),(m=u[d-1])&&m.className=="jsoneditor-expand"&&(m=u[d-2]),m||(m=u[u.length-1]),m&&m.focus(),E=!0):_==39?(d=(u=this._getVisibleButtons()).indexOf(y),(g=u[d+1])&&g.className=="jsoneditor-expand"&&g.focus(),E=!0):_==40&&(d=(u=this._getVisibleButtons()).indexOf(y),(g=u[d+1])&&g.className=="jsoneditor-expand"&&(g=u[d+2]),g||(g=u[0]),g&&(g.focus(),E=!0),E=!0),E&&(c.stopPropagation(),c.preventDefault())},l.prototype._isChildOf=function(c,u){for(var d=c.parentNode;d;){if(d==u)return!0;d=d.parentNode}return!1},r.exports=l},function(r,o,s){var a=s(59),l=s(57),c=s(60),u=s(54);function d(g,y){this.editor=g,this.dom={},this.expanded=!1,y&&y instanceof Object?(this.setField(y.field,y.fieldEditable),this.setValue(y.value,y.type)):(this.setField(""),this.setValue(null)),this._debouncedOnChangeValue=u.debounce(this._onChangeValue.bind(this),d.prototype.DEBOUNCE_INTERVAL),this._debouncedOnChangeField=u.debounce(this._onChangeField.bind(this),d.prototype.DEBOUNCE_INTERVAL)}d.prototype.DEBOUNCE_INTERVAL=150,d.prototype._updateEditability=function(){if(this.editable={field:!0,value:!0},this.editor&&(this.editable.field=this.editor.options.mode==="tree",this.editable.value=this.editor.options.mode!=="view",(this.editor.options.mode==="tree"||this.editor.options.mode==="form")&&typeof this.editor.options.onEditable=="function")){var g=this.editor.options.onEditable({field:this.field,value:this.value,path:this.getPath()});typeof g=="boolean"?(this.editable.field=g,this.editable.value=g):(typeof g.field=="boolean"&&(this.editable.field=g.field),typeof g.value=="boolean"&&(this.editable.value=g.value))}},d.prototype.getPath=function(){for(var g=this,y=[];g;){var _=g.parent?g.parent.type!="array"?g.field:g.index:void 0;_!==void 0&&y.unshift(_),g=g.parent}return y},d.prototype.findNode=function(g){for(var y=u.parsePath(g),_=this;_&&y.length>0;){var E=y.shift();if(typeof E=="number"){if(_.type!=="array")throw new Error("Cannot get child node at index "+E+": node is no array");_=_.childs[E]}else{if(_.type!=="object")throw new Error("Cannot get child node "+E+": node is no object");_=_.childs.filter(function(w){return w.field===E})[0]}}return _},d.prototype.findParents=function(){for(var g=[],y=this.parent;y;)g.unshift(y),y=y.parent;return g},d.prototype.setError=function(g,y){this.getDom(),this.error=g;var _=this.dom.tdError;if(g){_||(_=document.createElement("td"),this.dom.tdError=_,this.dom.tdValue.parentNode.appendChild(_));var E=document.createElement("div");E.className="jsoneditor-popover jsoneditor-right",E.appendChild(document.createTextNode(g.message));var w=document.createElement("button");for(w.type="button",w.className="jsoneditor-schema-error",w.appendChild(E),w.onmouseover=w.onfocus=function(){for(var T=["right","above","below","left"],k=0;k0&&(g=this.childs.filter(function(k){return _.indexOf(k.field)!==-1}).map(function(k){return{node:k,error:{message:'duplicate key "'+k.field+'"'}}}))}if(this.childs)for(E=0;E0&&(g=g.concat(T))}return g},d.prototype.clearDom=function(){this.dom={}},d.prototype.getDom=function(){var g=this.dom;if(g.tr)return g.tr;if(this._updateEditability(),g.tr=document.createElement("tr"),g.tr.node=this,this.editor.options.mode==="tree"){var y=document.createElement("td");if(this.editable.field&&this.parent){var _=document.createElement("button");_.type="button",g.drag=_,_.className="jsoneditor-dragarea",_.title="Drag to move this field (Alt+Shift+Arrows)",y.appendChild(_)}g.tr.appendChild(y);var E=document.createElement("td"),w=document.createElement("button");w.type="button",g.menu=w,w.className="jsoneditor-contextmenu",w.title="Click to open the actions menu (Ctrl+M)",E.appendChild(g.menu),g.tr.appendChild(E)}var T=document.createElement("td");return g.tr.appendChild(T),g.tree=this._createDomTree(),T.appendChild(g.tree),this.updateDom({updateIndexes:!0}),g.tr},d.onDragStart=function(g,y){if(!Array.isArray(g))return d.onDragStart([g],y);if(g.length!==0){var _=g[0],E=g[g.length-1],w=d.getNodeFromTarget(y.target),T=E._nextSibling(),k=_.editor,O=u.getAbsoluteTop(w.dom.tr)-u.getAbsoluteTop(_.dom.tr);k.mousemove||(k.mousemove=u.addEventListener(window,"mousemove",function(R){d.onDrag(g,R)})),k.mouseup||(k.mouseup=u.addEventListener(window,"mouseup",function(R){d.onDragEnd(g,R)})),k.highlighter.lock(),k.drag={oldCursor:document.body.style.cursor,oldSelection:k.getSelection(),oldBeforeNode:T,mouseX:y.pageX,offsetY:O,level:_.getLevel()},document.body.style.cursor="move",y.preventDefault()}},d.onDrag=function(g,y){if(!Array.isArray(g))return d.onDrag([g],y);if(g.length!==0){var _,E,w,T,k,O,R,M,N,D,P,I,L,F,U=g[0].editor,J=y.pageY-U.drag.offsetY,z=y.pageX,ie=!1,ce=g[0];if(_=ce.dom.tr,N=u.getAbsoluteTop(_),I=_.offsetHeight,J(D=(E=R.dom.tr)?u.getAbsoluteTop(E):0)+I&&(R=void 0),R&&(g.forEach(function(pee){R.parent.moveBefore(pee,R)}),ie=!0)}else{var Y=g[g.length-1];if(T=(k=Y.expanded&&Y.append?Y.append.getDom():Y.dom.tr)?k.nextSibling:void 0){P=u.getAbsoluteTop(T),w=T;do M=d.getNodeFromTarget(w),w&&(L=w.nextSibling?u.getAbsoluteTop(w.nextSibling):0,F=w?L-P:0,M.parent.childs.length==g.length&&M.parent.childs[g.length-1]==Y&&(N+=27)),w=w.nextSibling;while(w&&J>N+F);if(M&&M.parent){var B=z-U.drag.mouseX,V=Math.round(B/24/2),Ge=U.drag.level+V,St=M.getLevel();for(E=M.dom.tr.previousSibling;St0)return _[0].enum}return null},d._findSchema=function(g,y){for(var _=g,E=0;E0?this.editor.multiselection.nodes:[this],J=U[0],z=U[U.length-1];if(M==13){if(N==this.dom.value)this.editable.value&&!g.ctrlKey||u.isUrl(this.value)&&(window.open(this.value,"_blank"),L=!0);else if(N==this.dom.expand&&this._hasChilds()){var ie=g.ctrlKey;this._onExpand(ie),N.focus(),L=!0}}else if(M==68)D&&F&&(d.onDuplicate(U),L=!0);else if(M==69)D&&(this._onExpand(P),N.focus(),L=!0);else if(M==77&&F)D&&(this.showContextMenu(N),L=!0);else if(M==46&&F)D&&(d.onRemove(U),L=!0);else if(M==45&&F)D&&!P?(this._onInsertBefore(),L=!0):D&&P&&(this._onInsertAfter(),L=!0);else if(M==35){if(I){var ce=this._lastNode();ce&&ce.focus(d.focusElement||this._getElementName(N)),L=!0}}else if(M==36){if(I){var Y=this._firstNode();Y&&Y.focus(d.focusElement||this._getElementName(N)),L=!0}}else if(M==37){if(I&&!P){var B=this._previousElement(N);B&&this.focus(this._getElementName(B)),L=!0}else if(I&&P&&F){if(z.expanded){var V=z.getAppend();E=V?V.nextSibling:void 0}else{var Ge=z.getDom();E=Ge.nextSibling}E&&(_=d.getNodeFromTarget(E),w=E.nextSibling,pee=d.getNodeFromTarget(w),_&&_ instanceof m&&z.parent.childs.length!=1&&pee&&pee.parent&&(T=this.editor.getSelection(),k=z._nextSibling(),U.forEach(function(jr){pee.parent.moveBefore(jr,pee)}),this.focus(d.focusElement||this._getElementName(N)),this.editor._onAction("moveNodes",{nodes:U,oldBeforeNode:k,newBeforeNode:pee,oldSelection:T,newSelection:this.editor.getSelection()})))}}else if(M==38)I&&!P?((y=this._previousNode())&&(this.editor.deselect(!0),y.focus(d.focusElement||this._getElementName(N))),L=!0):!I&&D&&P&&F?((y=this._previousNode())&&((R=this.editor.multiselection).start=R.start||this,R.end=y,O=this.editor._findTopLevelNodes(R.start,R.end),this.editor.select(O),y.focus("field")),L=!0):I&&P&&F&&((y=J._previousNode())&&y.parent&&(T=this.editor.getSelection(),k=z._nextSibling(),U.forEach(function(jr){y.parent.moveBefore(jr,y)}),this.focus(d.focusElement||this._getElementName(N)),this.editor._onAction("moveNodes",{nodes:U,oldBeforeNode:k,newBeforeNode:y,oldSelection:T,newSelection:this.editor.getSelection()})),L=!0);else if(M==39){if(I&&!P){var St=this._nextElement(N);St&&this.focus(this._getElementName(St)),L=!0}else if(I&&P&&F){var Dee=(Ge=J.getDom()).previousSibling;Dee&&(y=d.getNodeFromTarget(Dee))&&y.parent&&y instanceof m&&!y.isVisible()&&(T=this.editor.getSelection(),k=z._nextSibling(),U.forEach(function(jr){y.parent.moveBefore(jr,y)}),this.focus(d.focusElement||this._getElementName(N)),this.editor._onAction("moveNodes",{nodes:U,oldBeforeNode:k,newBeforeNode:y,oldSelection:T,newSelection:this.editor.getSelection()}))}}else if(M==40){if(I&&!P)(_=this._nextNode())&&(this.editor.deselect(!0),_.focus(d.focusElement||this._getElementName(N))),L=!0;else if(!I&&D&&P&&F)(_=this._nextNode())&&((R=this.editor.multiselection).start=R.start||this,R.end=_,O=this.editor._findTopLevelNodes(R.start,R.end),this.editor.select(O),_.focus("field")),L=!0;else if(I&&P&&F){var pee=(_=z.expanded?z.append?z.append._nextNode():void 0:z._nextNode())&&(_._nextNode()||_.parent.append);pee&&pee.parent&&(T=this.editor.getSelection(),k=z._nextSibling(),U.forEach(function(jr){pee.parent.moveBefore(jr,pee)}),this.focus(d.focusElement||this._getElementName(N)),this.editor._onAction("moveNodes",{nodes:U,oldBeforeNode:k,newBeforeNode:pee,oldSelection:T,newSelection:this.editor.getSelection()})),L=!0}}L&&(g.preventDefault(),g.stopPropagation())},d.prototype._onExpand=function(g){if(g){var y=this.dom.tr.parentNode,_=y.parentNode,E=_.scrollTop;_.removeChild(y)}this.expanded?this.collapse(g):this.expand(g),g&&(_.appendChild(y),_.scrollTop=E)},d.onRemove=function(g){if(!Array.isArray(g))return d.onRemove([g]);if(g&&g.length>0){var y=g[0],_=y.parent,E=y.editor,w=y.getIndex();E.highlighter.unhighlight();var T=E.getSelection();d.blurNodes(g);var k=E.getSelection();g.forEach(function(O){O.parent._remove(O)}),E._onAction("removeNodes",{nodes:g.slice(0),parent:_,index:w,oldSelection:T,newSelection:k})}},d.onDuplicate=function(g){if(!Array.isArray(g))return d.onDuplicate([g]);if(g&&g.length>0){var y=g[g.length-1],_=y.parent,E=y.editor;E.deselect(E.multiselection.nodes);var w=E.getSelection(),T=y,k=g.map(function(R){var M=R.clone();return _.insertAfter(M,T),T=M,M});g.length===1?k[0].focus():E.select(k);var O=E.getSelection();E._onAction("duplicateNodes",{afterNode:y,nodes:k,parent:_,oldSelection:w,newSelection:O})}},d.prototype._onInsertBefore=function(g,y,_){var E=this.editor.getSelection(),w=new d(this.editor,{field:g??"",value:y??"",type:_});w.expand(!0),this.parent.insertBefore(w,this),this.editor.highlighter.unhighlight(),w.focus("field");var T=this.editor.getSelection();this.editor._onAction("insertBeforeNodes",{nodes:[w],beforeNode:this,parent:this.parent,oldSelection:E,newSelection:T})},d.prototype._onInsertAfter=function(g,y,_){var E=this.editor.getSelection(),w=new d(this.editor,{field:g??"",value:y??"",type:_});w.expand(!0),this.parent.insertAfter(w,this),this.editor.highlighter.unhighlight(),w.focus("field");var T=this.editor.getSelection();this.editor._onAction("insertAfterNodes",{nodes:[w],afterNode:this,parent:this.parent,oldSelection:E,newSelection:T})},d.prototype._onAppend=function(g,y,_){var E=this.editor.getSelection(),w=new d(this.editor,{field:g??"",value:y??"",type:_});w.expand(!0),this.parent.appendChild(w),this.editor.highlighter.unhighlight(),w.focus("field");var T=this.editor.getSelection();this.editor._onAction("appendNodes",{nodes:[w],parent:this.parent,oldSelection:E,newSelection:T})},d.prototype._onChangeType=function(g){var y=this.type;if(g!=y){var _=this.editor.getSelection();this.changeType(g);var E=this.editor.getSelection();this.editor._onAction("changeType",{node:this,oldType:y,newType:g,oldSelection:_,newSelection:E})}},d.prototype.sort=function(g){if(this._hasChilds()){var y=g=="desc"?-1:1,_=this.type=="array"?"value":"field";this.hideChilds();var E=this.childs,w=this.sortOrder;this.childs=this.childs.concat(),this.childs.sort(function(T,k){return y*a(T[_],k[_])}),this.sortOrder=y==1?"asc":"desc",this.editor._onAction("sort",{node:this,oldChilds:E,oldSort:w,newChilds:this.childs,newSort:this.sortOrder}),this.showChilds()}},d.prototype.getAppend=function(){return this.append||(this.append=new m(this.editor),this.append.setParent(this)),this.append.getDom()},d.getNodeFromTarget=function(g){for(;g;){if(g.node)return g.node;g=g.parentNode}},d.blurNodes=function(g){if(Array.isArray(g)){var y=g[0],_=y.parent,E=y.getIndex();_.childs[E+g.length]?_.childs[E+g.length].focus():_.childs[E-1]?_.childs[E-1].focus():_.focus()}else d.blurNodes([g])},d.prototype._nextSibling=function(){var g=this.parent.childs.indexOf(this);return this.parent.childs[g+1]||this.parent.append},d.prototype._previousNode=function(){var g=null,y=this.getDom();if(y&&y.parentNode){var _=y;do _=_.previousSibling,g=d.getNodeFromTarget(_);while(_&&g instanceof m&&!g.isVisible())}return g},d.prototype._nextNode=function(){var g=null,y=this.getDom();if(y&&y.parentNode){var _=y;do _=_.nextSibling,g=d.getNodeFromTarget(_);while(_&&g instanceof m&&!g.isVisible())}return g},d.prototype._firstNode=function(){var g=null,y=this.getDom();if(y&&y.parentNode){var _=y.parentNode.firstChild;g=d.getNodeFromTarget(_)}return g},d.prototype._lastNode=function(){var g=null,y=this.getDom();if(y&&y.parentNode){var _=y.parentNode.lastChild;for(g=d.getNodeFromTarget(_);_&&g instanceof m&&!g.isVisible();)_=_.previousSibling,g=d.getNodeFromTarget(_)}return g},d.prototype._previousElement=function(g){var y=this.dom;switch(g){case y.value:if(this.fieldEditable)return y.field;case y.field:if(this._hasChilds())return y.expand;case y.expand:return y.menu;case y.menu:if(y.drag)return y.drag;default:return null}},d.prototype._nextElement=function(g){var y=this.dom;switch(g){case y.drag:return y.menu;case y.menu:if(this._hasChilds())return y.expand;case y.expand:if(this.fieldEditable)return y.field;case y.field:if(!this._hasChilds())return y.value;default:return null}},d.prototype._getElementName=function(g){var y=this.dom;for(var _ in y)if(y.hasOwnProperty(_)&&y[_]==g)return _;return null},d.prototype._hasChilds=function(){return this.type=="array"||this.type=="object"},d.TYPE_TITLES={auto:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',object:'Field type "object". An object contains an unordered set of key/value pairs.',array:'Field type "array". An array contains an ordered collection of values.',string:'Field type "string". Field type is not determined from the value, but always returned as string.'},d.prototype.showContextMenu=function(g,y){var _=this,E=d.TYPE_TITLES,w=[];if(this.editable.value&&w.push({text:"Type",title:"Change the type of this field",className:"jsoneditor-type-"+this.type,submenu:[{text:"Auto",className:"jsoneditor-type-auto"+(this.type=="auto"?" jsoneditor-selected":""),title:E.auto,click:function(){_._onChangeType("auto")}},{text:"Array",className:"jsoneditor-type-array"+(this.type=="array"?" jsoneditor-selected":""),title:E.array,click:function(){_._onChangeType("array")}},{text:"Object",className:"jsoneditor-type-object"+(this.type=="object"?" jsoneditor-selected":""),title:E.object,click:function(){_._onChangeType("object")}},{text:"String",className:"jsoneditor-type-string"+(this.type=="string"?" jsoneditor-selected":""),title:E.string,click:function(){_._onChangeType("string")}}]}),this._hasChilds()){var T=this.sortOrder=="asc"?"desc":"asc";w.push({text:"Sort",title:"Sort the childs of this "+this.type,className:"jsoneditor-sort-"+T,click:function(){_.sort(T)},submenu:[{text:"Ascending",className:"jsoneditor-sort-asc",title:"Sort the childs of this "+this.type+" in ascending order",click:function(){_.sort("asc")}},{text:"Descending",className:"jsoneditor-sort-desc",title:"Sort the childs of this "+this.type+" in descending order",click:function(){_.sort("desc")}}]})}if(this.parent&&this.parent._hasChilds()){w.length&&w.push({type:"separator"});var k=_.parent.childs;_==k[k.length-1]&&w.push({text:"Append",title:"Append a new field with type 'auto' after this field (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"jsoneditor-append",click:function(){_._onAppend("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:E.auto,click:function(){_._onAppend("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:E.array,click:function(){_._onAppend("",[])}},{text:"Object",className:"jsoneditor-type-object",title:E.object,click:function(){_._onAppend("",{})}},{text:"String",className:"jsoneditor-type-string",title:E.string,click:function(){_._onAppend("","","string")}}]}),w.push({text:"Insert",title:"Insert a new field with type 'auto' before this field (Ctrl+Ins)",submenuTitle:"Select the type of the field to be inserted",className:"jsoneditor-insert",click:function(){_._onInsertBefore("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:E.auto,click:function(){_._onInsertBefore("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:E.array,click:function(){_._onInsertBefore("",[])}},{text:"Object",className:"jsoneditor-type-object",title:E.object,click:function(){_._onInsertBefore("",{})}},{text:"String",className:"jsoneditor-type-string",title:E.string,click:function(){_._onInsertBefore("","","string")}}]}),this.editable.field&&(w.push({text:"Duplicate",title:"Duplicate this field (Ctrl+D)",className:"jsoneditor-duplicate",click:function(){d.onDuplicate(_)}}),w.push({text:"Remove",title:"Remove this field (Ctrl+Del)",className:"jsoneditor-remove",click:function(){d.onRemove(_)}}))}new l(w,{close:y}).show(g,this.editor.content)},d.prototype._getType=function(g){return g instanceof Array?"array":g instanceof Object?"object":typeof g=="string"&&typeof this._stringCast(g)!="string"?"string":"auto"},d.prototype._stringCast=function(g){var y=g.toLowerCase(),_=Number(g),E=parseFloat(g);return g==""?"":y=="null"?null:y=="true"||y!="false"&&(isNaN(_)||isNaN(E)?g:_)},d.prototype._escapeHTML=function(g){if(typeof g!="string")return String(g);var y=String(g).replace(/&/g,"&").replace(//g,">").replace(/ /g,"  ").replace(/^ /," ").replace(/ $/," "),_=JSON.stringify(y),E=_.substring(1,_.length-1);return this.editor.options.escapeUnicode===!0&&(E=u.escapeUnicodeChars(E)),E},d.prototype._unescapeHTML=function(g){var y='"'+this._escapeJSON(g)+'"';return u.parse(y).replace(/</g,"<").replace(/>/g,">").replace(/ |\u00A0/g," ").replace(/&/g,"&")},d.prototype._escapeJSON=function(g){for(var y="",_=0;_M)return 1}for(var N=0,D=Math.max(k.length,O.length);Nu)return 1}return 0}},function(r,o,s){var a=s(54),l=s(57);r.exports=function(c){function u(d){this.editor=d,this.dom={}}return u.prototype=new c,u.prototype.getDom=function(){var d=this.dom;if(d.tr)return d.tr;this._updateEditability();var m=document.createElement("tr");if(m.node=this,d.tr=m,this.editor.options.mode==="tree"){d.tdDrag=document.createElement("td");var g=document.createElement("td");d.tdMenu=g;var y=document.createElement("button");y.type="button",y.className="jsoneditor-contextmenu",y.title="Click to open the actions menu (Ctrl+M)",d.menu=y,g.appendChild(d.menu)}var _=document.createElement("td"),E=document.createElement("div");return E.innerHTML="(empty)",E.className="jsoneditor-readonly",_.appendChild(E),d.td=_,d.text=E,this.updateDom(),m},u.prototype.updateDom=function(){var d=this.dom,m=d.td;m&&(m.style.paddingLeft=24*this.getLevel()+26+"px");var g=d.text;g&&(g.innerHTML="(empty "+this.parent.type+")");var y=d.tr;this.isVisible()?d.tr.firstChild||(d.tdDrag&&y.appendChild(d.tdDrag),d.tdMenu&&y.appendChild(d.tdMenu),y.appendChild(m)):d.tr.firstChild&&(d.tdDrag&&y.removeChild(d.tdDrag),d.tdMenu&&y.removeChild(d.tdMenu),y.removeChild(m))},u.prototype.isVisible=function(){return this.parent.childs.length==0},u.prototype.showContextMenu=function(d,m){var g=this,y=c.TYPE_TITLES,_=[{text:"Append",title:"Append a new field with type 'auto' (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"jsoneditor-insert",click:function(){g._onAppend("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:y.auto,click:function(){g._onAppend("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:y.array,click:function(){g._onAppend("",[])}},{text:"Object",className:"jsoneditor-type-object",title:y.object,click:function(){g._onAppend("",{})}},{text:"String",className:"jsoneditor-type-string",title:y.string,click:function(){g._onAppend("","","string")}}]}];new l(_,{close:m}).show(d,this.editor.content)},u.prototype.onEvent=function(d){var m=d.type,g=d.target||d.srcElement,y=this.dom;if(g==y.menu&&(m=="mouseover"?this.editor.highlighter.highlight(this.parent):m=="mouseout"&&this.editor.highlighter.unhighlight()),m=="click"&&g==y.menu){var _=this.editor.highlighter;_.highlight(this.parent),_.lock(),a.addClassName(y.menu,"jsoneditor-selected"),this.showContextMenu(y.menu,function(){a.removeClassName(y.menu,"jsoneditor-selected"),_.unlock(),_.unhighlight()})}m=="keydown"&&this.onKeyDown(d)},u}},function(r,o,s){var a=s(57);function l(c,u,d,m){for(var g={code:{text:"Code",title:"Switch to code highlighter",click:function(){m("code")}},form:{text:"Form",title:"Switch to form editor",click:function(){m("form")}},text:{text:"Text",title:"Switch to plain text editor",click:function(){m("text")}},tree:{text:"Tree",title:"Switch to tree editor",click:function(){m("tree")}},view:{text:"View",title:"Switch to tree view",click:function(){m("view")}}},y=[],_=0;_0){if(y.length>3){y=y.slice(0,3);var _=this.validateSchema.errors.length-3;y.push("("+_+" more errors...)")}var E=document.createElement("div");E.innerHTML=''+y.map(function(T){return''+(typeof T=="string"?'":"")+""}).join("")+"
'+T+"
"+T.dataPath+""+T.message+"
",this.dom.validationErrors=E,this.frame.appendChild(E);var w=E.clientHeight;this.content.style.marginBottom=-w+"px",this.content.style.paddingBottom=w+"px"}this.aceEditor&&this.aceEditor.resize(!1)},r.exports=[{mode:"text",mixin:u,data:"text",load:u.format},{mode:"code",mixin:u,data:"text",load:u.format}]},function(r,o,s){var a=s(64);s(67),s(69),r.exports=a},function(r,o,s){(function(){var a=function(){return this}();a||typeof window>"u"||(a=window);var l=function _(E,w,T){typeof E=="string"?(arguments.length==2&&(T=w),_.modules[E]||(_.payloads[E]=T,_.modules[E]=null)):_.original?_.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};l.modules={},l.payloads={};var c,u,d=function(_,E,w){if(typeof E=="string"){var T=y(_,E);if(T!=null)return w&&w(),T}else if(Object.prototype.toString.call(E)==="[object Array]"){for(var k=[],O=0,R=E.length;O1&&_(k,"")>-1&&(T=RegExp(this.source,d.replace.call(y(this),"g","")),d.replace.call(E.slice(k.index),T,function(){for(var R=1;Rk.index&&this.lastIndex--}return k},g||(RegExp.prototype.test=function(E){var w=d.exec.call(this,E);return w&&this.global&&!w[0].length&&this.lastIndex>w.index&&this.lastIndex--,!!w}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(a,l,c){function u(){}Function.prototype.bind||(Function.prototype.bind=function(pee){var jr=this;if(typeof jr!="function")throw new TypeError("Function.prototype.bind called on incompatible "+jr);var Tee=k.call(arguments,1),et=function ft(){if(this instanceof ft){var yee=jr.apply(this,Tee.concat(k.call(arguments)));return Object(yee)===yee?yee:this}return jr.apply(pee,Tee.concat(k.call(arguments)))};return jr.prototype&&(u.prototype=jr.prototype,et.prototype=new u,u.prototype=null),et});var d,m,g,y,_,E=Function.prototype.call,w=Array.prototype,T=Object.prototype,k=w.slice,O=E.bind(T.toString),R=E.bind(T.hasOwnProperty);if((_=R(T,"__defineGetter__"))&&(d=E.bind(T.__defineGetter__),m=E.bind(T.__defineSetter__),g=E.bind(T.__lookupGetter__),y=E.bind(T.__lookupSetter__)),[1,2].splice(0).length!=2)if(function(){function pee(et){var ft=new Array(et+2);return ft[0]=ft[1]=0,ft}var jr,Tee=[];if(Tee.splice.apply(Tee,pee(20)),Tee.splice.apply(Tee,pee(26)),jr=Tee.length,Tee.splice(5,0,"XXX"),jr+1==Tee.length)return!0}()){var M=Array.prototype.splice;Array.prototype.splice=function(pee,jr){return arguments.length?M.apply(this,[pee===void 0?0:pee,jr===void 0?this.length-pee:jr].concat(k.call(arguments,2))):[]}}else Array.prototype.splice=function(pee,jr){var Tee=this.length;pee>0?pee>Tee&&(pee=Tee):pee==null?pee=0:pee<0&&(pee=Math.max(Tee+pee,0)),pee+jrxte)for(Bee=nee;Bee--;)this[Ote+Bee]=this[xte+Bee];if(yee&&pee===Wee)this.length=Wee,this.push.apply(this,ft);else for(this.length=Wee+yee,Bee=0;Bee>>0;if(O(pee)!="[object Function]")throw new TypeError;for(;++ft>>0,ft=Array(et),yee=arguments[1];if(O(pee)!="[object Function]")throw new TypeError(pee+" is not a function");for(var ete=0;ete>>0,yee=[],ete=arguments[1];if(O(pee)!="[object Function]")throw new TypeError(pee+" is not a function");for(var xte=0;xte>>0,ft=arguments[1];if(O(pee)!="[object Function]")throw new TypeError(pee+" is not a function");for(var yee=0;yee>>0,ft=arguments[1];if(O(pee)!="[object Function]")throw new TypeError(pee+" is not a function");for(var yee=0;yee>>0;if(O(pee)!="[object Function]")throw new TypeError(pee+" is not a function");if(!et&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var ft,yee=0;if(arguments.length>=2)ft=arguments[1];else for(;;){if(yee in Tee){ft=Tee[yee++];break}if(++yee>=et)throw new TypeError("reduce of empty array with no initial value")}for(;yee>>0;if(O(pee)!="[object Function]")throw new TypeError(pee+" is not a function");if(!et&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var ft,yee=et-1;if(arguments.length>=2)ft=arguments[1];else for(;;){if(yee in Tee){ft=Tee[yee--];break}if(--yee<0)throw new TypeError("reduceRight of empty array with no initial value")}do yee in this&&(ft=pee.call(void 0,ft,Tee[yee],yee,jr));while(yee--);return ft}),Array.prototype.indexOf&&[0,1].indexOf(1,2)==-1||(Array.prototype.indexOf=function(pee){var jr=I&&O(this)=="[object String]"?this.split(""):Dee(this),Tee=jr.length>>>0;if(!Tee)return-1;var et=0;for(arguments.length>1&&(et=St(arguments[1])),et=et>=0?et:Math.max(0,Tee+et);et>>0;if(!Tee)return-1;var et=Tee-1;for(arguments.length>1&&(et=Math.min(et,St(arguments[1]))),et=et>=0?et:Tee-Math.abs(et);et>=0;et--)if(et in jr&&pee===jr[et])return et;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(pee){return pee.__proto__||(pee.constructor?pee.constructor.prototype:T)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(pee,jr){if(_typeof(pee)!="object"&&typeof pee!="function"||pee===null)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+pee);if(R(pee,jr)){var Tee;if(Tee={enumerable:!0,configurable:!0},_){var et=pee.__proto__;pee.__proto__=T;var ft=g(pee,jr),yee=y(pee,jr);if(pee.__proto__=et,ft||yee)return ft&&(Tee.get=ft),yee&&(Tee.set=yee),Tee}return Tee.value=pee[jr],Tee}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(pee){return Object.keys(pee)}),Object.create||(N=Object.prototype.__proto__===null?function(){return{__proto__:null}}:function(){var pee={};for(var jr in pee)pee[jr]=null;return pee.constructor=pee.hasOwnProperty=pee.propertyIsEnumerable=pee.isPrototypeOf=pee.toLocaleString=pee.toString=pee.valueOf=pee.__proto__=null,pee},Object.create=function(pee,jr){var Tee;if(pee===null)Tee=N();else{if(_typeof(pee)!="object")throw new TypeError("typeof prototype["+_typeof(pee)+"] != 'object'");var et=function(){};et.prototype=pee,(Tee=new et).__proto__=pee}return jr!==void 0&&Object.defineProperties(Tee,jr),Tee}),Object.defineProperty){var F=L({}),U=typeof document>"u"||L(document.createElement("div"));if(!F||!U)var J=Object.defineProperty}Object.defineProperty&&!J||(Object.defineProperty=function(pee,jr,Tee){if(_typeof(pee)!="object"&&typeof pee!="function"||pee===null)throw new TypeError("Object.defineProperty called on non-object: "+pee);if(_typeof(Tee)!="object"&&typeof Tee!="function"||Tee===null)throw new TypeError("Property description must be an object: "+Tee);if(J)try{return J.call(Object,pee,jr,Tee)}catch{}if(R(Tee,"value"))if(_&&(g(pee,jr)||y(pee,jr))){var et=pee.__proto__;pee.__proto__=T,delete pee[jr],pee[jr]=Tee.value,pee.__proto__=et}else pee[jr]=Tee.value;else{if(!_)throw new TypeError("getters & setters can not be defined on this javascript engine");R(Tee,"get")&&d(pee,jr,Tee.get),R(Tee,"set")&&m(pee,jr,Tee.set)}return pee}),Object.defineProperties||(Object.defineProperties=function(pee,jr){for(var Tee in jr)R(jr,Tee)&&Object.defineProperty(pee,Tee,jr[Tee]);return pee}),Object.seal||(Object.seal=function(pee){return pee}),Object.freeze||(Object.freeze=function(pee){return pee});try{Object.freeze(function(){})}catch{Object.freeze=(D=Object.freeze,function(jr){return typeof jr=="function"?jr:D(jr)})}if(Object.preventExtensions||(Object.preventExtensions=function(pee){return pee}),Object.isSealed||(Object.isSealed=function(pee){return!1}),Object.isFrozen||(Object.isFrozen=function(pee){return!1}),Object.isExtensible||(Object.isExtensible=function(pee){if(Object(pee)===pee)throw new TypeError;for(var jr="";R(pee,jr);)jr+="?";pee[jr]=!0;var Tee=R(pee,jr);return delete pee[jr],Tee}),!Object.keys){var z=!0,ie=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ce=ie.length;for(var Y in{toString:null})z=!1;Object.keys=function(pee){if(_typeof(pee)!="object"&&typeof pee!="function"||pee===null)throw new TypeError("Object.keys called on a non-object");var jr=[];for(var Tee in pee)R(pee,Tee)&&jr.push(Tee);if(z)for(var et=0,ft=ce;et0||-1)*Math.floor(Math.abs(pee))),pee}var Dee=function(pee){if(pee==null)throw new TypeError("can't convert "+pee+" to object");return Object(pee)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(a,l,c){a("./regexp"),a("./es5-shim")}),ace.define("ace/lib/dom",["require","exports","module"],function(a,l,c){l.getDocumentHead=function(u){return u||(u=document),u.head||u.getElementsByTagName("head")[0]||u.documentElement},l.createElement=function(u,d){return document.createElementNS?document.createElementNS(d||"http://www.w3.org/1999/xhtml",u):document.createElement(u)},l.hasCssClass=function(u,d){return(u.className||"").split(/\s+/g).indexOf(d)!==-1},l.addCssClass=function(u,d){l.hasCssClass(u,d)||(u.className+=" "+d)},l.removeCssClass=function(u,d){for(var m=u.className.split(/\s+/g);;){var g=m.indexOf(d);if(g==-1)break;m.splice(g,1)}u.className=m.join(" ")},l.toggleCssClass=function(u,d){for(var m=u.className.split(/\s+/g),g=!0;;){var y=m.indexOf(d);if(y==-1)break;g=!1,m.splice(y,1)}return g&&m.push(d),u.className=m.join(" "),g},l.setCssClass=function(u,d,m){m?l.addCssClass(u,d):l.removeCssClass(u,d)},l.hasCssString=function(u,d){var m,g=0;if((d=d||document).createStyleSheet&&(m=d.styleSheets)){for(;g"u"?"undefined":_typeof(navigator))=="object"){var u=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),d=navigator.userAgent;l.isWin=u=="win",l.isMac=u=="mac",l.isLinux=u=="linux",l.isIE=navigator.appName=="Microsoft Internet Explorer"||navigator.appName.indexOf("MSAppHost")>=0?parseFloat((d.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((d.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),l.isOldIE=l.isIE&&l.isIE<9,l.isGecko=l.isMozilla=(window.Controllers||window.controllers)&&window.navigator.product==="Gecko",l.isOldGecko=l.isGecko&&parseInt((d.match(/rv\:(\d+)/)||[])[1],10)<4,l.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",l.isWebKit=parseFloat(d.split("WebKit/")[1])||void 0,l.isChrome=parseFloat(d.split(" Chrome/")[1])||void 0,l.isAIR=d.indexOf("AdobeAIR")>=0,l.isIPad=d.indexOf("iPad")>=0,l.isTouchPad=d.indexOf("TouchPad")>=0,l.isChromeOS=d.indexOf(" CrOS ")>=0}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(a,l,c){var u=a("./keys"),d=a("./useragent"),m=null,g=0;l.addListener=function(w,T,k){if(w.addEventListener)return w.addEventListener(T,k,!1);if(w.attachEvent){var O=function(){k.call(w,window.event)};k._wrapper=O,w.attachEvent("on"+T,O)}},l.removeListener=function(w,T,k){if(w.removeEventListener)return w.removeEventListener(T,k,!1);w.detachEvent&&w.detachEvent("on"+T,k._wrapper||k)},l.stopEvent=function(w){return l.stopPropagation(w),l.preventDefault(w),!1},l.stopPropagation=function(w){w.stopPropagation?w.stopPropagation():w.cancelBubble=!0},l.preventDefault=function(w){w.preventDefault?w.preventDefault():w.returnValue=!1},l.getButton=function(w){return w.type=="dblclick"?0:w.type=="contextmenu"||d.isMac&&w.ctrlKey&&!w.altKey&&!w.shiftKey?2:w.preventDefault?w.button:{1:0,2:2,4:1}[w.button]},l.capture=function(w,T,k){function O(R){T&&T(R),k&&k(R),l.removeListener(document,"mousemove",T,!0),l.removeListener(document,"mouseup",O,!0),l.removeListener(document,"dragstart",O,!0)}return l.addListener(document,"mousemove",T,!0),l.addListener(document,"mouseup",O,!0),l.addListener(document,"dragstart",O,!0),O},l.addTouchMoveListener=function(w,T){var k,O;"ontouchmove"in w&&(l.addListener(w,"touchstart",function(R){var M=R.changedTouches[0];k=M.clientX,O=M.clientY}),l.addListener(w,"touchmove",function(R){var M=R.changedTouches[0];R.wheelX=-(M.clientX-k)/1,R.wheelY=-(M.clientY-O)/1,k=M.clientX,O=M.clientY,T(R)}))},l.addMouseWheelListener=function(w,T){"onmousewheel"in w?l.addListener(w,"mousewheel",function(k){k.wheelDeltaX!==void 0?(k.wheelX=-k.wheelDeltaX/8,k.wheelY=-k.wheelDeltaY/8):(k.wheelX=0,k.wheelY=-k.wheelDelta/8),T(k)}):"onwheel"in w?l.addListener(w,"wheel",function(k){switch(k.deltaMode){case k.DOM_DELTA_PIXEL:k.wheelX=.35*k.deltaX||0,k.wheelY=.35*k.deltaY||0;break;case k.DOM_DELTA_LINE:case k.DOM_DELTA_PAGE:k.wheelX=5*(k.deltaX||0),k.wheelY=5*(k.deltaY||0)}T(k)}):l.addListener(w,"DOMMouseScroll",function(k){k.axis&&k.axis==k.HORIZONTAL_AXIS?(k.wheelX=5*(k.detail||0),k.wheelY=0):(k.wheelX=0,k.wheelY=5*(k.detail||0)),T(k)})},l.addMultiMouseDownListener=function(w,T,k,O){var R,M,N,D=0,P={2:"dblclick",3:"tripleclick",4:"quadclick"};function I(F){if(l.getButton(F)!==0?D=0:F.detail>1?++D>4&&(D=1):D=1,d.isIE){var U=Math.abs(F.clientX-R)>5||Math.abs(F.clientY-M)>5;N&&!U||(D=1),N&&clearTimeout(N),N=setTimeout(function(){N=null},T[D-1]||600),D==1&&(R=F.clientX,M=F.clientY)}if(F._clicks=D,k[O]("mousedown",F),D>4)D=0;else if(D>1)return k[O](P[D],F)}function L(F){D=2,N&&clearTimeout(N),N=setTimeout(function(){N=null},T[D-1]||600),k[O]("mousedown",F),k[O](P[D],F)}Array.isArray(w)||(w=[w]),w.forEach(function(F){l.addListener(F,"mousedown",I),d.isOldIE&&l.addListener(F,"dblclick",L)})};var y=d.isMac&&d.isOpera&&!("KeyboardEvent"in window)?function(w){return 0|(w.metaKey?1:0)|(w.altKey?2:0)|(w.shiftKey?4:0)|(w.ctrlKey?8:0)}:function(w){return 0|(w.ctrlKey?1:0)|(w.altKey?2:0)|(w.shiftKey?4:0)|(w.metaKey?8:0)};function _(w,T,k){var O=y(T);if(!d.isMac&&m){if(m.OSKey&&(O|=8),m.altGr){if((3&O)==3)return;m.altGr=0}if(k===18||k===17){var R="location"in T?T.location:T.keyLocation;k===17&&R===1?m[k]==1&&(g=T.timeStamp):k===18&&O===3&&R===2&&T.timeStamp-g<50&&(m.altGr=!0)}}if(k in u.MODIFIER_KEYS&&(k=-1),8&O&&k>=91&&k<=93&&(k=-1),O||k!==13||(R="location"in T?T.location:T.keyLocation)!==3||(w(T,O,-k),!T.defaultPrevented)){if(d.isChromeOS&&8&O){if(w(T,O,k),T.defaultPrevented)return;O&=-9}return!!(O||k in u.FUNCTION_KEYS||k in u.PRINTABLE_KEYS)&&w(T,O,k)}}function E(){(m=Object.create(null)).count=0,m.lastT=0}l.getModifierString=function(w){return u.KEY_MODS[y(w)]},l.addCommandKeyListener=function(w,T){var k=l.addListener;if(d.isOldGecko||d.isOpera&&!("KeyboardEvent"in window)){var O=null;k(w,"keydown",function(M){O=M.keyCode}),k(w,"keypress",function(M){return _(T,M,O)})}else{var R=null;k(w,"keydown",function(M){var N=M.keyCode;m[N]=(m[N]||0)+1,N==91||N==92?m.OSKey=!0:m.OSKey&&M.timeStamp-m.lastT>200&&m.count==1&&E(),m[N]==1&&m.count++,m.lastT=M.timeStamp;var D=_(T,M,N);return R=M.defaultPrevented,D}),k(w,"keypress",function(M){R&&(M.ctrlKey||M.altKey||M.shiftKey||M.metaKey)&&(l.stopEvent(M),R=null)}),k(w,"keyup",function(M){var N=M.keyCode;m[N]?m.count=Math.max(m.count-1,0):E(),N!=91&&N!=92||(m.OSKey=!1),m[N]=null}),m||(E(),k(window,"focus",E))}},(typeof window>"u"?"undefined":_typeof(window))=="object"&&window.postMessage&&!d.isOldIE&&(l.nextTick=function(w,T){T=T||window;var k="zero-timeout-message-1";l.addListener(T,"message",function O(R){R.data==k&&(l.stopPropagation(R),l.removeListener(T,"message",O),w())}),T.postMessage(k,"*")}),l.nextFrame=(typeof window>"u"?"undefined":_typeof(window))=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),l.nextFrame?l.nextFrame=l.nextFrame.bind(window):l.nextFrame=function(w){setTimeout(w,17)}}),ace.define("ace/lib/lang",["require","exports","module"],function(a,l,c){l.last=function(m){return m[m.length-1]},l.stringReverse=function(m){return m.split("").reverse().join("")},l.stringRepeat=function(m,g){for(var y="";g>0;)1&g&&(y+=m),(g>>=1)&&(m+=m);return y};var u=/^\s\s*/,d=/\s\s*$/;l.stringTrimLeft=function(m){return m.replace(u,"")},l.stringTrimRight=function(m){return m.replace(d,"")},l.copyObject=function(m){var g={};for(var y in m)g[y]=m[y];return g},l.copyArray=function(m){for(var g=[],y=0,_=m.length;y<_;y++)m[y]&&_typeof(m[y])=="object"?g[y]=this.copyObject(m[y]):g[y]=m[y];return g},l.deepCopy=function m(g){if(_typeof(g)!=="object"||!g)return g;var y;if(Array.isArray(g)){y=[];for(var _=0;_1),m.preventDefault()):(this.setState("focusWait"),void this.captureMouse(m))},this.startSelect=function(m,g){m=m||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var y=this.editor;y.$blockScrolling++,this.mousedownEvent.getShiftKey()?y.selection.selectToPosition(m):g||y.selection.moveToPosition(m),g||this.select(),y.renderer.scroller.setCapture&&y.renderer.scroller.setCapture(),y.setStyle("ace_selecting"),this.setState("select"),y.$blockScrolling--},this.select=function(){var m,g=this.editor,y=g.renderer.screenToTextCoordinates(this.x,this.y);if(g.$blockScrolling++,this.$clickSelection){var _=this.$clickSelection.comparePoint(y);if(_==-1)m=this.$clickSelection.end;else if(_==1)m=this.$clickSelection.start;else{var E=d(this.$clickSelection,y);y=E.cursor,m=E.anchor}g.selection.setSelectionAnchor(m.row,m.column)}g.selection.selectToPosition(y),g.$blockScrolling--,g.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(m){var g,y=this.editor,_=y.renderer.screenToTextCoordinates(this.x,this.y),E=y.selection[m](_.row,_.column);if(y.$blockScrolling++,this.$clickSelection){var w=this.$clickSelection.comparePoint(E.start),T=this.$clickSelection.comparePoint(E.end);if(w==-1&&T<=0)g=this.$clickSelection.end,E.end.row==_.row&&E.end.column==_.column||(_=E.start);else if(T==1&&w>=0)g=this.$clickSelection.start,E.start.row==_.row&&E.start.column==_.column||(_=E.end);else if(w==-1&&T==1)_=E.end,g=E.start;else{var k=d(this.$clickSelection,_);_=k.cursor,g=k.anchor}y.selection.setSelectionAnchor(g.row,g.column)}y.selection.selectToPosition(_),y.$blockScrolling--,y.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var m,g,y,_,E=(m=this.mousedownEvent.x,g=this.mousedownEvent.y,y=this.x,_=this.y,Math.sqrt(Math.pow(y-m,2)+Math.pow(_-g,2))),w=Date.now();(E>0||w-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(m){var g=m.getDocumentPosition(),y=this.editor,_=y.session.getBracketRange(g);_?(_.isEmpty()&&(_.start.column--,_.end.column++),this.setState("select")):(_=y.selection.getWordRange(g.row,g.column),this.setState("selectByWords")),this.$clickSelection=_,this.select()},this.onTripleClick=function(m){var g=m.getDocumentPosition(),y=this.editor;this.setState("selectByLines");var _=y.getSelectionRange();_.isMultiLine()&&_.contains(g.row,g.column)?(this.$clickSelection=y.selection.getLineRange(_.start.row),this.$clickSelection.end=y.selection.getLineRange(_.end.row).end):this.$clickSelection=y.selection.getLineRange(g.row),this.select()},this.onQuadClick=function(m){var g=this.editor;g.selectAll(),this.$clickSelection=g.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(m){if(!m.getAccelKey()){m.getShiftKey()&&m.wheelY&&!m.wheelX&&(m.wheelX=m.wheelY,m.wheelY=0);var g=m.domEvent.timeStamp,y=g-(this.$lastScrollTime||0),_=this.editor;return _.renderer.isScrollableBy(m.wheelX*m.speed,m.wheelY*m.speed)||y<200?(this.$lastScrollTime=g,_.renderer.scrollBy(m.wheelX*m.speed,m.wheelY*m.speed),m.stop()):void 0}},this.onTouchMove=function(m){var g=m.domEvent.timeStamp,y=g-(this.$lastScrollTime||0),_=this.editor;if(_.renderer.isScrollableBy(m.wheelX*m.speed,m.wheelY*m.speed)||y<200)return this.$lastScrollTime=g,_.renderer.scrollBy(m.wheelX*m.speed,m.wheelY*m.speed),m.stop()}}.call(u.prototype),l.DefaultHandlers=u}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(a,l,c){a("./lib/oop");var u=a("./lib/dom");function d(m){this.isOpen=!1,this.$element=null,this.$parentNode=m}(function(){this.$init=function(){return this.$element=u.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(m){u.setInnerText(this.getElement(),m)},this.setHtml=function(m){this.getElement().innerHTML=m},this.setPosition=function(m,g){this.getElement().style.left=m+"px",this.getElement().style.top=g+"px"},this.setClassName=function(m){u.addCssClass(this.getElement(),m)},this.show=function(m,g,y){m!=null&&this.setText(m),g!=null&&y!=null&&this.setPosition(g,y),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth}}).call(d.prototype),l.Tooltip=d}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(a,l,c){var u=a("../lib/dom"),d=a("../lib/oop"),m=a("../lib/event"),g=a("../tooltip").Tooltip;function y(_){g.call(this,_)}d.inherits(y,g),function(){this.setPosition=function(_,E){var w=window.innerWidth||document.documentElement.clientWidth,T=window.innerHeight||document.documentElement.clientHeight,k=this.getWidth(),O=this.getHeight();(_+=15)+k>w&&(_-=_+k-w),(E+=15)+O>T&&(E-=20+O),g.prototype.setPosition.call(this,_,E)}}.call(y.prototype),l.GutterHandler=function(_){var E,w,T,k=_.editor,O=k.renderer.$gutterLayer,R=new y(k.container);function M(){E&&(E=clearTimeout(E)),T&&(R.hide(),T=null,k.removeEventListener("mousewheel",M))}function N(D){R.setPosition(D.x,D.y)}_.editor.setDefaultHandler("guttermousedown",function(D){if(k.isFocused()&&D.getButton()==0&&O.getRegion(D)!="foldWidgets"){var P=D.getDocumentPosition().row,I=k.session.selection;if(D.getShiftKey())I.selectTo(P,0);else{if(D.domEvent.detail==2)return k.selectAll(),D.preventDefault();_.$clickSelection=k.selection.getLineRange(P)}return _.setState("selectByLines"),_.captureMouse(D),D.preventDefault()}}),_.editor.setDefaultHandler("guttermousemove",function(D){var P=D.domEvent.target||D.domEvent.srcElement;if(u.hasCssClass(P,"ace_fold-widget"))return M();T&&_.$tooltipFollowsMouse&&N(D),w=D,E||(E=setTimeout(function(){E=null,w&&!_.isMousePressed?function(){var I=w.getDocumentPosition().row,L=O.$annotations[I];if(!L)return M();if(I==k.session.getLength()){var F=k.renderer.pixelToScreenCoordinates(0,w.y).row,U=w.$pos;if(F>k.session.documentToScreenRow(U.row,U.column))return M()}if(T!=L)if(T=L.text.join("
"),R.setHtml(T),R.show(),k.on("mousewheel",M),_.$tooltipFollowsMouse)N(w);else{var J=w.domEvent.target.getBoundingClientRect(),z=R.getElement().style;z.left=J.right+"px",z.top=J.bottom+"px"}}():M()},50))}),m.addListener(k.renderer.$gutter,"mouseout",function(D){w=null,T&&!E&&(E=setTimeout(function(){E=null,M()},50))}),k.on("changeSession",M)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(a,l,c){var u=a("../lib/event"),d=a("../lib/useragent"),m=l.MouseEvent=function(g,y){this.domEvent=g,this.editor=y,this.x=this.clientX=g.clientX,this.y=this.clientY=g.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){u.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){u.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var g=this.editor.getSelectionRange();if(g.isEmpty())this.$inSelection=!1;else{var y=this.getDocumentPosition();this.$inSelection=g.contains(y.row,y.column)}return this.$inSelection},this.getButton=function(){return u.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=d.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(m.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(a,l,c){var u=a("../lib/dom"),d=a("../lib/event"),m=a("../lib/useragent");function g(_){var E=_.editor,w=u.createElement("img");w.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m.isOpera&&(w.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(St){_[St]=this[St]},this),E.addEventListener("mousedown",this.onMouseDown.bind(_));var T,k,O,R,M,N,D,P,I,L,F,U=E.container,J=0;function z(){var St=N;(function(Dee,pee){var jr=Date.now(),Tee=!pee||Dee.row!=pee.row,et=!pee||Dee.column!=pee.column;!L||Tee||et?(E.$blockScrolling+=1,E.moveCursorToPosition(Dee),E.$blockScrolling-=1,L=jr,F={x:k,y:O}):y(F.x,F.y,k,O)>5?L=null:jr-L>=200&&(E.renderer.scrollCursorIntoView(),L=null)})(N=E.renderer.screenToTextCoordinates(k,O),St),function(Dee,pee){var jr=Date.now(),Tee=E.renderer.layerConfig.lineHeight,et=E.renderer.layerConfig.characterWidth,ft=E.renderer.scroller.getBoundingClientRect(),yee={x:{left:k-ft.left,right:ft.right-k},y:{top:O-ft.top,bottom:ft.bottom-O}},ete=Math.min(yee.x.left,yee.x.right),xte=Math.min(yee.y.top,yee.y.bottom),Ote={row:Dee.row,column:Dee.column};ete/et<=2&&(Ote.column+=yee.x.left=200&&E.renderer.scrollCursorIntoView(Ote):I=jr:I=null}(N,St)}function ie(){M=E.selection.toOrientedRange(),T=E.session.addMarker(M,"ace_selection",E.getSelectionStyle()),E.clearSelection(),E.isFocused()&&E.renderer.$cursorLayer.setBlinking(!1),clearInterval(R),z(),R=setInterval(z,20),J=0,d.addListener(document,"mousemove",B)}function ce(){clearInterval(R),E.session.removeMarker(T),T=null,E.$blockScrolling+=1,E.selection.fromOrientedRange(M),E.$blockScrolling-=1,E.isFocused()&&!P&&E.renderer.$cursorLayer.setBlinking(!E.getReadOnly()),M=null,N=null,J=0,I=null,L=null,d.removeListener(document,"mousemove",B)}this.onDragStart=function(St){if(this.cancelDrag||!U.draggable){var Dee=this;return setTimeout(function(){Dee.startSelect(),Dee.captureMouse(St)},0),St.preventDefault()}M=E.getSelectionRange();var pee=St.dataTransfer;pee.effectAllowed=E.getReadOnly()?"copy":"copyMove",m.isOpera&&(E.container.appendChild(w),w.scrollTop=0),pee.setDragImage&&pee.setDragImage(w,0,0),m.isOpera&&E.container.removeChild(w),pee.clearData(),pee.setData("Text",E.session.getTextRange()),P=!0,this.setState("drag")},this.onDragEnd=function(St){if(U.draggable=!1,P=!1,this.setState(null),!E.getReadOnly()){var Dee=St.dataTransfer.dropEffect;D||Dee!="move"||E.session.remove(E.getSelectionRange()),E.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(St){if(!E.getReadOnly()&&V(St.dataTransfer))return k=St.clientX,O=St.clientY,T||ie(),J++,St.dataTransfer.dropEffect=D=Ge(St),d.preventDefault(St)},this.onDragOver=function(St){if(!E.getReadOnly()&&V(St.dataTransfer))return k=St.clientX,O=St.clientY,T||(ie(),J++),Y!==null&&(Y=null),St.dataTransfer.dropEffect=D=Ge(St),d.preventDefault(St)},this.onDragLeave=function(St){if(--J<=0&&T)return ce(),D=null,d.preventDefault(St)},this.onDrop=function(St){if(N){var Dee=St.dataTransfer;if(P)switch(D){case"move":M=M.contains(N.row,N.column)?{start:N,end:N}:E.moveText(M,N);break;case"copy":M=E.moveText(M,N,!0)}else{var pee=Dee.getData("Text");M={start:N,end:E.session.insert(N,pee)},E.focus(),D=null}return ce(),d.preventDefault(St)}},d.addListener(U,"dragstart",this.onDragStart.bind(_)),d.addListener(U,"dragend",this.onDragEnd.bind(_)),d.addListener(U,"dragenter",this.onDragEnter.bind(_)),d.addListener(U,"dragover",this.onDragOver.bind(_)),d.addListener(U,"dragleave",this.onDragLeave.bind(_)),d.addListener(U,"drop",this.onDrop.bind(_));var Y=null;function B(){Y==null&&(Y=setTimeout(function(){Y!=null&&T&&ce()},20))}function V(St){var Dee=St.types;return!Dee||Array.prototype.some.call(Dee,function(pee){return pee=="text/plain"||pee=="Text"})}function Ge(St){var Dee=["copy","copymove","all","uninitialized"],pee=m.isMac?St.altKey:St.ctrlKey,jr="uninitialized";try{jr=St.dataTransfer.effectAllowed.toLowerCase()}catch{}var Tee="none";return pee&&Dee.indexOf(jr)>=0?Tee="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(jr)>=0?Tee="move":Dee.indexOf(jr)>=0&&(Tee="copy"),Tee}}function y(_,E,w,T){return Math.sqrt(Math.pow(w-_,2)+Math.pow(T-E,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(_){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var _=this.editor;_.container.draggable=!0,_.renderer.$cursorLayer.setBlinking(!1),_.setStyle("ace_dragging");var E=m.isWin?"default":"move";_.renderer.setCursorStyle(E),this.setState("dragReady")},this.onMouseDrag=function(_){var E=this.editor.container;m.isIE&&this.state=="dragReady"&&y(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&E.dragDrop(),this.state==="dragWait"&&y(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(E.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(_){if(this.$dragEnabled){this.mousedownEvent=_;var E=this.editor,w=_.inSelection(),T=_.getButton();if((_.domEvent.detail||1)===1&&T===0&&w){if(_.editor.inMultiSelectMode&&(_.getAccelKey()||_.getShiftKey()))return;this.mousedownEvent.time=Date.now();var k=_.domEvent.target||_.domEvent.srcElement;"unselectable"in k&&(k.unselectable="on"),E.getDragDelay()?(m.isWebKit&&(this.cancelDrag=!0,E.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(_,this.onMouseDrag.bind(this)),_.defaultPrevented=!0}}}}).call(g.prototype),l.DragdropHandler=g}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(a,l,c){var u=a("./dom");l.get=function(d,m){var g=new XMLHttpRequest;g.open("GET",d,!0),g.onreadystatechange=function(){g.readyState===4&&m(g.responseText)},g.send(null)},l.loadScript=function(d,m){var g=u.getDocumentHead(),y=document.createElement("script");y.src=d,g.appendChild(y),y.onload=y.onreadystatechange=function(_,E){!E&&y.readyState&&y.readyState!="loaded"&&y.readyState!="complete"||(y=y.onload=y.onreadystatechange=null,E||m())}},l.qualifyURL=function(d){var m=document.createElement("a");return m.href=d,m.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(a,l,c){var u={},d=function(){this.propagationStopped=!0},m=function(){this.defaultPrevented=!0};u._emit=u._dispatchEvent=function(g,y){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var _=this._eventRegistry[g]||[],E=this._defaultHandlers[g];if(_.length||E){_typeof(y)=="object"&&y||(y={}),y.type||(y.type=g),y.stopPropagation||(y.stopPropagation=d),y.preventDefault||(y.preventDefault=m),_=_.slice();for(var w=0;w<_.length&&(_[w](y,this),!y.propagationStopped);w++);return E&&!y.defaultPrevented?E(y,this):void 0}},u._signal=function(g,y){var _=(this._eventRegistry||{})[g];if(_){_=_.slice();for(var E=0;E<_.length;E++)_[E](y,this)}},u.once=function(g,y){var _=this;y&&this.addEventListener(g,function E(){_.removeEventListener(g,E),y.apply(null,arguments)})},u.setDefaultHandler=function(g,y){var _=this._defaultHandlers;if(_||(_=this._defaultHandlers={_disabled_:{}}),_[g]){var E=_[g],w=_._disabled_[g];w||(_._disabled_[g]=w=[]),w.push(E);var T=w.indexOf(y);T!=-1&&w.splice(T,1)}_[g]=y},u.removeDefaultHandler=function(g,y){var _=this._defaultHandlers;if(_){var E=_._disabled_[g];if(_[g]==y)_[g],E&&this.setDefaultHandler(g,E.pop());else if(E){var w=E.indexOf(y);w!=-1&&E.splice(w,1)}}},u.on=u.addEventListener=function(g,y,_){this._eventRegistry=this._eventRegistry||{};var E=this._eventRegistry[g];return E||(E=this._eventRegistry[g]=[]),E.indexOf(y)==-1&&E[_?"unshift":"push"](y),y},u.off=u.removeListener=u.removeEventListener=function(g,y){this._eventRegistry=this._eventRegistry||{};var _=this._eventRegistry[g];if(_){var E=_.indexOf(y);E!==-1&&_.splice(E,1)}},u.removeAllListeners=function(g){this._eventRegistry&&(this._eventRegistry[g]=[])},l.EventEmitter=u}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,l,c){var u=a("./oop"),d=a("./event_emitter").EventEmitter,m={setOptions:function(E){Object.keys(E).forEach(function(w){this.setOption(w,E[w])},this)},getOptions:function(E){var w={};return E?Array.isArray(E)||(w=E,E=Object.keys(w)):E=Object.keys(this.$options),E.forEach(function(T){w[T]=this.getOption(T)},this),w},setOption:function(E,w){if(this["$"+E]!==w){var T=this.$options[E];if(!T)return g('misspelled option "'+E+'"');if(T.forwardTo)return this[T.forwardTo]&&this[T.forwardTo].setOption(E,w);T.handlesSet||(this["$"+E]=w),T&&T.set&&T.set.call(this,w)}},getOption:function(E){var w=this.$options[E];return w?w.forwardTo?this[w.forwardTo]&&this[w.forwardTo].getOption(E):w&&w.get?w.get.call(this):this["$"+E]:g('misspelled option "'+E+'"')}};function g(E){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}function y(E,w){var T=new Error(E);T.data=w,(typeof console>"u"?"undefined":_typeof(console))=="object"&&console.error&&console.error(T),setTimeout(function(){throw T})}var _=function(){this.$defaultOptions={}};(function(){u.implement(this,d),this.defineOptions=function(E,w,T){return E.$options||(this.$defaultOptions[w]=E.$options={}),Object.keys(T).forEach(function(k){var O=T[k];typeof O=="string"&&(O={forwardTo:O}),O.name||(O.name=k),E.$options[O.name]=O,"initialValue"in O&&(E["$"+O.name]=O.initialValue)}),u.implement(E,m),this},this.resetOptions=function(E){Object.keys(E.$options).forEach(function(w){var T=E.$options[w];"value"in T&&E.setOption(w,T.value)})},this.setDefaultValue=function(E,w,T){var k=this.$defaultOptions[E]||(this.$defaultOptions[E]={});k[w]&&(k.forwardTo?this.setDefaultValue(k.forwardTo,w,T):k[w].value=T)},this.setDefaultValues=function(E,w){Object.keys(w).forEach(function(T){this.setDefaultValue(E,T,w[T])},this)},this.warn=g,this.reportError=y}).call(_.prototype),l.AppConfig=_}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(a,l,c){var u=a("./lib/lang");a("./lib/oop");var d=a("./lib/net"),m=a("./lib/app_config").AppConfig;c.exports=l=new m;var g=function(){return this||typeof window<"u"&&window}(),y={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}};function _(E){if(g&&g.document){y.packaged=E||a.packaged||c.packaged||g.define&&s(65).packaged;for(var w,T={},k="",O=document.currentScript||document._currentScript,R=(O&&O.ownerDocument||document).getElementsByTagName("script"),M=0;M1&&(O=T[T.length-2]);var M=y[w+"Path"];return M==null?M=y.basePath:k=="/"&&(w=k=""),M&&M.slice(-1)!="/"&&(M+="/"),M+w+k+O+this.get("suffix")},l.setModuleUrl=function(E,w){return y.$moduleUrls[E]=w},l.$loading={},l.loadModule=function(E,w){var T,k;Array.isArray(E)&&(k=E[0],E=E[1]);try{T=a(E)}catch{}if(T&&!l.$loading[E])return w&&w(T);if(l.$loading[E]||(l.$loading[E]=[]),l.$loading[E].push(w),!(l.$loading[E].length>1)){var O=function(){a([E],function(R){l._emit("load.module",{name:E,module:R});var M=l.$loading[E];l.$loading[E]=null,M.forEach(function(N){N&&N(R)})})};if(!l.get("packaged"))return O();d.loadScript(l.moduleUrl(E,k),O)}},_(!0),l.init=_}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(a,l,c){var u=a("../lib/event"),d=a("../lib/useragent"),m=a("./default_handlers").DefaultHandlers,g=a("./default_gutter_handler").GutterHandler,y=a("./mouse_event").MouseEvent,_=a("./dragdrop_handler").DragdropHandler,E=a("../config"),w=function(T){var k=this;this.editor=T,new m(this),new g(this),new _(this);var O=function(N){(!document.hasFocus||!document.hasFocus()||!T.isFocused()&&document.activeElement==(T.textInput&&T.textInput.getElement()))&&window.focus(),T.focus()},R=T.renderer.getMouseEventTarget();u.addListener(R,"click",this.onMouseEvent.bind(this,"click")),u.addListener(R,"mousemove",this.onMouseMove.bind(this,"mousemove")),u.addMultiMouseDownListener([R,T.renderer.scrollBarV&&T.renderer.scrollBarV.inner,T.renderer.scrollBarH&&T.renderer.scrollBarH.inner,T.textInput&&T.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),u.addMouseWheelListener(T.container,this.onMouseWheel.bind(this,"mousewheel")),u.addTouchMoveListener(T.container,this.onTouchMove.bind(this,"touchmove"));var M=T.renderer.$gutter;u.addListener(M,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),u.addListener(M,"click",this.onMouseEvent.bind(this,"gutterclick")),u.addListener(M,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),u.addListener(M,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),u.addListener(R,"mousedown",O),u.addListener(M,"mousedown",O),d.isIE&&T.renderer.scrollBarV&&(u.addListener(T.renderer.scrollBarV.element,"mousedown",O),u.addListener(T.renderer.scrollBarH.element,"mousedown",O)),T.on("mousemove",function(N){if(!k.state&&!k.$dragDelay&&k.$dragEnabled){var D=T.renderer.screenToTextCoordinates(N.x,N.y),P=T.session.selection.getRange(),I=T.renderer;!P.isEmpty()&&P.insideStart(D.row,D.column)?I.setCursorStyle("default"):I.setCursorStyle("")}})};(function(){this.onMouseEvent=function(T,k){this.editor._emit(T,new y(k,this.editor))},this.onMouseMove=function(T,k){var O=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;O&&O.length&&this.editor._emit(T,new y(k,this.editor))},this.onMouseWheel=function(T,k){var O=new y(k,this.editor);O.speed=2*this.$scrollSpeed,O.wheelX=k.wheelX,O.wheelY=k.wheelY,this.editor._emit(T,O)},this.onTouchMove=function(T,k){var O=new y(k,this.editor);O.speed=1,O.wheelX=k.wheelX,O.wheelY=k.wheelY,this.editor._emit(T,O)},this.setState=function(T){this.state=T},this.captureMouse=function(T,k){this.x=T.x,this.y=T.y,this.isMousePressed=!0;var O=this.editor.renderer;O.$keepTextAreaAtCursor&&(O.$keepTextAreaAtCursor=null);var R=this,M=function(I){if(I){if(d.isWebKit&&!I.which&&R.releaseMouse)return R.releaseMouse();R.x=I.clientX,R.y=I.clientY,k&&k(I),R.mouseEvent=new y(I,R.editor),R.$mouseMoved=!0}},N=function(I){clearInterval(P),D(),R[R.state+"End"]&&R[R.state+"End"](I),R.state="",O.$keepTextAreaAtCursor==null&&(O.$keepTextAreaAtCursor=!0,O.$moveTextAreaToCursor()),R.isMousePressed=!1,R.$onCaptureMouseMove=R.releaseMouse=null,I&&R.onMouseEvent("mouseup",I)},D=function(){R[R.state]&&R[R.state](),R.$mouseMoved=!1};if(d.isOldIE&&T.domEvent.type=="dblclick")return setTimeout(function(){N(T)});R.$onCaptureMouseMove=M,R.releaseMouse=u.capture(this.editor.container,M,N);var P=setInterval(D,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var T=function(k){k&&k.domEvent&&k.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",T),k&&k.domEvent&&u.stopEvent(k.domEvent))}.bind(this);setTimeout(T,10),this.editor.on("nativecontextmenu",T)}}).call(w.prototype),E.defineOptions(w.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:d.isMac?150:0},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),l.MouseHandler=w}),ace.define("ace/mouse/fold_handler",["require","exports","module"],function(a,l,c){l.FoldHandler=function(u){u.on("click",function(d){var m=d.getDocumentPosition(),g=u.session,y=g.getFoldAt(m.row,m.column,1);y&&(d.getAccelKey()?g.removeFold(y):g.expandFold(y),d.stop())}),u.on("gutterclick",function(d){if(u.renderer.$gutterLayer.getRegion(d)=="foldWidgets"){var m=d.getDocumentPosition().row,g=u.session;g.foldWidgets&&g.foldWidgets[m]&&u.session.onFoldWidgetClick(m,d),u.isFocused()||u.focus(),d.stop()}}),u.on("gutterdblclick",function(d){if(u.renderer.$gutterLayer.getRegion(d)=="foldWidgets"){var m=d.getDocumentPosition().row,g=u.session,y=g.getParentFoldRangeData(m,!0),_=y.range||y.firstRange;if(_){m=_.start.row;var E=g.getFoldAt(m,g.getLine(m).length,1);E?g.removeFold(E):(g.addFold("...",_),u.renderer.scrollCursorIntoView({row:_.start.row,column:0}))}d.stop()}})}}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(a,l,c){var u=a("../lib/keys"),d=a("../lib/event"),m=function(g){this.$editor=g,this.$data={editor:g},this.$handlers=[],this.setDefaultHandler(g.commands)};(function(){this.setDefaultHandler=function(g){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=g,this.addKeyboardHandler(g,0)},this.setKeyboardHandler=function(g){var y=this.$handlers;if(y[y.length-1]!=g){for(;y[y.length-1]&&y[y.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(y[y.length-1]);this.addKeyboardHandler(g,1)}},this.addKeyboardHandler=function(g,y){if(g){typeof g!="function"||g.handleKeyboard||(g.handleKeyboard=g);var _=this.$handlers.indexOf(g);_!=-1&&this.$handlers.splice(_,1),y==null?this.$handlers.push(g):this.$handlers.splice(y,0,g),_==-1&&g.attach&&g.attach(this.$editor)}},this.removeKeyboardHandler=function(g){var y=this.$handlers.indexOf(g);return y!=-1&&(this.$handlers.splice(y,1),g.detach&&g.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var g=this.$data,y=g.editor;return this.$handlers.map(function(_){return _.getStatusText&&_.getStatusText(y,g)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(g,y,_,E){for(var w,T=!1,k=this.$editor.commands,O=this.$handlers.length;O--&&!((w=this.$handlers[O].handleKeyboard(this.$data,g,y,_,E))&&w.command&&((T=w.command=="null"||k.exec(w.command,this.$editor,w.args,E))&&E&&g!=-1&&w.passEvent!=1&&w.command.passEvent!=1&&d.stopEvent(E),T)););return T||g!=-1||(w={command:"insertstring"},T=k.exec("insertstring",this.$editor,y)),T&&this.$editor._signal("keyboardActivity",w),T},this.onCommandKey=function(g,y,_){var E=u.keyCodeToString(_);this.$callKeyboardHandlers(y,E,_,g)},this.onTextInput=function(g){this.$callKeyboardHandlers(-1,g)}}).call(m.prototype),l.KeyBinding=m}),ace.define("ace/range",["require","exports","module"],function(a,l,c){var u=function(d,m,g,y){this.start={row:d,column:m},this.end={row:g,column:y}};(function(){this.isEqual=function(d){return this.start.row===d.start.row&&this.end.row===d.end.row&&this.start.column===d.start.column&&this.end.column===d.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(d,m){return this.compare(d,m)==0},this.compareRange=function(d){var m,g=d.end,y=d.start;return(m=this.compare(g.row,g.column))==1?(m=this.compare(y.row,y.column))==1?2:m==0?1:0:m==-1?-2:(m=this.compare(y.row,y.column))==-1?-1:m==1?42:0},this.comparePoint=function(d){return this.compare(d.row,d.column)},this.containsRange=function(d){return this.comparePoint(d.start)==0&&this.comparePoint(d.end)==0},this.intersects=function(d){var m=this.compareRange(d);return m==-1||m==0||m==1},this.isEnd=function(d,m){return this.end.row==d&&this.end.column==m},this.isStart=function(d,m){return this.start.row==d&&this.start.column==m},this.setStart=function(d,m){_typeof(d)=="object"?(this.start.column=d.column,this.start.row=d.row):(this.start.row=d,this.start.column=m)},this.setEnd=function(d,m){_typeof(d)=="object"?(this.end.column=d.column,this.end.row=d.row):(this.end.row=d,this.end.column=m)},this.inside=function(d,m){return this.compare(d,m)==0&&!this.isEnd(d,m)&&!this.isStart(d,m)},this.insideStart=function(d,m){return this.compare(d,m)==0&&!this.isEnd(d,m)},this.insideEnd=function(d,m){return this.compare(d,m)==0&&!this.isStart(d,m)},this.compare=function(d,m){return this.isMultiLine()||d!==this.start.row?dthis.end.row?1:this.start.row===d?m>=this.start.column?0:-1:this.end.row===d?m<=this.end.column?0:1:0:mthis.end.column?1:0},this.compareStart=function(d,m){return this.start.row==d&&this.start.column==m?-1:this.compare(d,m)},this.compareEnd=function(d,m){return this.end.row==d&&this.end.column==m?1:this.compare(d,m)},this.compareInside=function(d,m){return this.end.row==d&&this.end.column==m?1:this.start.row==d&&this.start.column==m?-1:this.compare(d,m)},this.clipRows=function(d,m){if(this.end.row>m)var g={row:m+1,column:0};else this.end.rowm)var y={row:m+1,column:0};else this.start.rowE.row||_.row==E.row&&_.column>E.column},this.getRange=function(){var _=this.anchor,E=this.lead;return this.isEmpty()?g.fromPoints(E,E):this.isBackwards()?g.fromPoints(E,_):g.fromPoints(_,E)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var _=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(_,this.doc.getLine(_).length)},this.setRange=this.setSelectionRange=function(_,E){E?(this.setSelectionAnchor(_.end.row,_.end.column),this.selectTo(_.start.row,_.start.column)):(this.setSelectionAnchor(_.start.row,_.start.column),this.selectTo(_.end.row,_.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(_){var E=this.lead;this.$isEmpty&&this.setSelectionAnchor(E.row,E.column),_.call(this)},this.selectTo=function(_,E){this.$moveSelection(function(){this.moveCursorTo(_,E)})},this.selectToPosition=function(_){this.$moveSelection(function(){this.moveCursorToPosition(_)})},this.moveTo=function(_,E){this.clearSelection(),this.moveCursorTo(_,E)},this.moveToPosition=function(_){this.clearSelection(),this.moveCursorToPosition(_)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(_,E){if(E===void 0){var w=_||this.lead;_=w.row,E=w.column}return this.session.getWordRange(_,E)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var _=this.getCursor(),E=this.session.getAWordRange(_.row,_.column);this.setSelectionRange(E)},this.getLineRange=function(_,E){var w,T=typeof _=="number"?_:this.lead.row,k=this.session.getFoldLine(T);return k?(T=k.start.row,w=k.end.row):w=T,E===!0?new g(T,0,w,this.session.getLine(w).length):new g(T,0,w+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var _,E=this.lead.getPosition();if(_=this.session.getFoldAt(E.row,E.column,-1))this.moveCursorTo(_.start.row,_.start.column);else if(E.column===0)E.row>0&&this.moveCursorTo(E.row-1,this.doc.getLine(E.row-1).length);else{var w=this.session.getTabSize();this.session.isTabStop(E)&&this.doc.getLine(E.row).slice(E.column-w,E.column).split(" ").length-1==w?this.moveCursorBy(0,-w):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var _,E=this.lead.getPosition();if(_=this.session.getFoldAt(E.row,E.column,1))this.moveCursorTo(_.end.row,_.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(E.column=T)}}this.moveCursorTo(E.row,E.column)},this.moveCursorFileEnd=function(){var _=this.doc.getLength()-1,E=this.doc.getLine(_).length;this.moveCursorTo(_,E)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var _=this.lead.row,E=this.lead.column,w=this.doc.getLine(_),T=w.substring(E);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var k=this.session.getFoldAt(_,E,1);if(k)this.moveCursorTo(k.end.row,k.end.column);else{if(this.session.nonTokenRe.exec(T)&&(E+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,T=w.substring(E)),E>=w.length)return this.moveCursorTo(_,w.length),this.moveCursorRight(),void(_0&&this.moveCursorWordLeft());this.session.tokenRe.exec(k)&&(w-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(E,w)}},this.$shortWordEndIndex=function(_){var E,w=0,T=/\s/,k=this.session.tokenRe;if(k.lastIndex=0,this.session.tokenRe.exec(_))w=this.session.tokenRe.lastIndex;else{for(;(E=_[w])&&T.test(E);)w++;if(w<1){for(k.lastIndex=0;(E=_[w])&&!k.test(E);)if(k.lastIndex=0,w++,T.test(E)){if(w>2){w--;break}for(;(E=_[w])&&T.test(E);)w++;if(w>2)break}}}return k.lastIndex=0,w},this.moveCursorShortWordRight=function(){var _=this.lead.row,E=this.lead.column,w=this.doc.getLine(_),T=w.substring(E),k=this.session.getFoldAt(_,E,1);if(k)return this.moveCursorTo(k.end.row,k.end.column);if(E==w.length){var O=this.doc.getLength();do _++,T=this.doc.getLine(_);while(_0&&/^\s*$/.test(T));w=T.length,/\s+$/.test(T)||(T="")}var k=d.stringReverse(T),O=this.$shortWordEndIndex(k);return this.moveCursorTo(E,w-O)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(_,E){var w=this.session.documentToScreenPosition(this.lead.row,this.lead.column);E===0&&(this.$desiredColumn?w.column=this.$desiredColumn:this.$desiredColumn=w.column);var T=this.session.screenToDocumentPosition(w.row+_,w.column);_!==0&&E===0&&T.row===this.lead.row&&T.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[T.row]&&(T.row>0||_>0)&&T.row++,this.moveCursorTo(T.row,T.column+E,E===0)},this.moveCursorToPosition=function(_){this.moveCursorTo(_.row,_.column)},this.moveCursorTo=function(_,E,w){var T=this.session.getFoldAt(_,E,1);T&&(_=T.start.row,E=T.start.column),this.$keepDesiredColumnOnChange=!0,this.lead.setPosition(_,E),this.$keepDesiredColumnOnChange=!1,w||(this.$desiredColumn=null)},this.moveCursorToScreen=function(_,E,w){var T=this.session.screenToDocumentPosition(_,E);this.moveCursorTo(T.row,T.column,w)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(_){this.setSelectionRange(_,_.cursor==_.start),this.$desiredColumn=_.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(_){var E=this.getRange();return _?(_.start.column=E.start.column,_.start.row=E.start.row,_.end.column=E.end.column,_.end.row=E.end.row):_=E,_.cursor=this.isBackwards()?_.start:_.end,_.desiredColumn=this.$desiredColumn,_},this.getRangeOfMovements=function(_){var E=this.getCursor();try{_(this);var w=this.getCursor();return g.fromPoints(E,w)}catch{return g.fromPoints(E,E)}finally{this.moveCursorToPosition(E)}},this.toJSON=function(){if(this.rangeCount)var _=this.ranges.map(function(E){var w=E.clone();return w.isBackwards=E.cursor==E.start,w});else(_=this.getRange()).isBackwards=this.isBackwards();return _},this.fromJSON=function(_){if(_.start==null){if(this.rangeList){this.toSingleRange(_[0]);for(var E=_.length;E--;){var w=g.fromPoints(_[E].start,_[E].end);_[E].isBackwards&&(w.cursor=w.start),this.addRange(w,!0)}return}_=_[0]}this.rangeList&&this.toSingleRange(_),this.setSelectionRange(_,_.isBackwards)},this.isEqual=function(_){if((_.length||this.rangeCount)&&_.length!=this.rangeCount)return!1;if(!_.length||!this.ranges)return this.getRange().isEqual(_);for(var E=this.ranges.length;E--;)if(!this.ranges[E].isEqual(_[E]))return!1;return!0}}).call(y.prototype),l.Selection=y}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(a,l,c){var u=a("./config"),d=2e3,m=function(g){for(var y in this.states=g,this.regExps={},this.matchMappings={},this.states){for(var _=this.states[y],E=[],w=0,T=this.matchMappings[y]={defaultToken:"text"},k="g",O=[],R=0;R<_.length;R++){var M=_[R];if(M.defaultToken&&(T.defaultToken=M.defaultToken),M.caseInsensitive&&(k="gi"),M.regex!=null){M.regex instanceof RegExp&&(M.regex=M.regex.toString().slice(1,-1));var N=M.regex,D=new RegExp("(?:("+N+")|(.))").exec("a").length-2;Array.isArray(M.token)?M.token.length==1||D==1?M.token=M.token[0]:D-1!=M.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:M,groupCount:D-1}),M.token=M.token[0]):(M.tokenArray=M.token,M.token=null,M.onMatch=this.$arrayTokens):typeof M.token!="function"||M.onMatch||(M.onMatch=D>1?this.$applyToken:M.token),D>1&&(/\\\d/.test(M.regex)?N=M.regex.replace(/\\([0-9]+)/g,function(P,I){return"\\"+(parseInt(I,10)+w+1)}):(D=1,N=this.removeCapturingGroups(M.regex)),M.splitRegex||typeof M.token=="string"||O.push(M)),T[w]=R,w+=D,E.push(N),M.onMatch||(M.onMatch=null)}}E.length||(T[0]=0,E.push("$")),O.forEach(function(P){P.splitRegex=this.createSplitterRegexp(P.regex,k)},this),this.regExps[y]=new RegExp("("+E.join(")|(")+")|($)",k)}};(function(){this.$setMaxTokenCount=function(g){d=0|g},this.$applyToken=function(g){var y=this.splitRegex.exec(g).slice(1),_=this.token.apply(this,y);if(typeof _=="string")return[{type:_,value:g}];for(var E=[],w=0,T=_.length;wM){var U=g.substring(M,F-L.length);D.type==P?D.value+=U:(D.type&&R.push(D),D={type:P,value:U})}for(var J=0;Jd){for(N>2*g.length&&this.reportError("infinite loop with in ace tokenizer",{startState:y,line:g});M1&&_[0]!==E&&_.unshift("#tmp",E),{tokens:R,state:_.length?_:E}},this.reportError=u.reportError}).call(m.prototype),l.Tokenizer=m}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(a,l,c){var u=a("../lib/lang"),d=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(y,_){if(_)for(var E in y){for(var w=y[E],T=0;T=this.$rowTokens.length;){if(this.$row+=1,d||(d=this.$session.getLength()),this.$row>=d)return this.$row=d-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var d=this.$rowTokens,m=this.$tokenIndex,g=d[m].start;if(g!==void 0)return g;for(g=0;m>0;)g+=d[m-=1].value.length;return g},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}}}).call(u.prototype),l.TokenIterator=u}),ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(a,l,c){var u=a("../tokenizer").Tokenizer,d=a("./text_highlight_rules").TextHighlightRules,m=a("./behaviour").Behaviour,g=a("../unicode"),y=a("../lib/lang"),_=a("../token_iterator").TokenIterator,E=a("../range").Range,w=function(){this.HighlightRules=d,this.$behaviour=new m};(function(){this.tokenRe=new RegExp("^["+g.packages.L+g.packages.Mn+g.packages.Mc+g.packages.Nd+g.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+g.packages.L+g.packages.Mn+g.packages.Mc+g.packages.Nd+g.packages.Pc+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules,this.$tokenizer=new u(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(T,k,O,R){var M=k.doc,N=!0,D=!0,P=1/0,I=k.getTabSize(),L=!1;if(this.lineCommentStart){Array.isArray(this.lineCommentStart)?(ie=this.lineCommentStart.map(y.escapeRegExp).join("|"),J=this.lineCommentStart[0]):(ie=y.escapeRegExp(this.lineCommentStart),J=this.lineCommentStart),ie=new RegExp("^(\\s*)(?:"+ie+") ?"),L=k.getUseSoftTabs(),B=function(Dee,pee){var jr=Dee.match(ie);if(jr){var Tee=jr[1].length,et=jr[0].length;U(Dee,Tee,et)||jr[0][et-1]!=" "||et--,M.removeInLine(pee,Tee,et)}};var F=J+" ",U=(Y=function(Dee,pee){N&&!/\S/.test(Dee)||(U(Dee,P,P)?M.insertInLine({row:pee,column:P},F):M.insertInLine({row:pee,column:P},J))},V=function(Dee,pee){return ie.test(Dee)},function(Dee,pee,jr){for(var Tee=0;pee--&&Dee.charAt(pee)==" ";)Tee++;if(Tee%I!=0)return!1;for(Tee=0;Dee.charAt(jr++)==" ";)Tee++;return I>2?Tee%I!=I-1:Tee%I==0})}else{if(!this.blockComment)return!1;var J=this.blockComment.start,z=this.blockComment.end,ie=new RegExp("^(\\s*)(?:"+y.escapeRegExp(J)+")"),ce=new RegExp("(?:"+y.escapeRegExp(z)+")\\s*$"),Y=function(Dee,pee){V(Dee,pee)||N&&!/\S/.test(Dee)||(M.insertInLine({row:pee,column:Dee.length},z),M.insertInLine({row:pee,column:P},J))},B=function(Dee,pee){var jr;(jr=Dee.match(ce))&&M.removeInLine(pee,Dee.length-jr[0].length,Dee.length),(jr=Dee.match(ie))&&M.removeInLine(pee,jr[1].length,jr[0].length)},V=function(Dee,pee){if(ie.test(Dee))return!0;for(var jr=k.getTokens(pee),Tee=0;TeeDee.length&&(St=Dee.length)}),P==1/0&&(P=St,N=!1,D=!1),L&&P%I!=0&&(P=Math.floor(P/I)*I),Ge(D?B:Y)},this.toggleBlockComment=function(T,k,O,R){var M=this.blockComment;if(M){!M.start&&M[0]&&(M=M[0]);var N=(z=new _(k,R.row,R.column)).getCurrentToken();k.selection;var D,P,I=k.selection.toOrientedRange();if(N&&/comment/.test(N.type)){for(var L,F;N&&/comment/.test(N.type);){if((ie=N.value.indexOf(M.start))!=-1){var U=z.getCurrentTokenRow(),J=z.getCurrentTokenColumn()+ie;L=new E(U,J,U,J+M.start.length);break}N=z.stepBackward()}var z;for(N=(z=new _(k,R.row,R.column)).getCurrentToken();N&&/comment/.test(N.type);){var ie;if((ie=N.value.indexOf(M.end))!=-1){U=z.getCurrentTokenRow(),J=z.getCurrentTokenColumn()+ie,F=new E(U,J,U,J+M.end.length);break}N=z.stepForward()}F&&k.remove(F),L&&(k.remove(L),D=L.start.row,P=-M.start.length)}else P=M.start.length,D=O.start.row,k.insert(O.end,M.end),k.insert(O.start,M.start);I.start.row==D&&(I.start.column+=P),I.end.row==D&&(I.end.column+=P),k.selection.fromOrientedRange(I)}},this.getNextLineIndent=function(T,k,O){return this.$getIndent(k)},this.checkOutdent=function(T,k,O){return!1},this.autoOutdent=function(T,k,O){},this.$getIndent=function(T){return T.match(/^\s*/)[0]},this.createWorker=function(T){return null},this.createModeDelegates=function(T){for(var k in this.$embeds=[],this.$modes={},T)T[k]&&(this.$embeds.push(k),this.$modes[k]=new T[k]);var O=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(k=0;kthis.row)){var _=function(E,w,T){var k=E.action=="insert",O=(k?1:-1)*(E.end.row-E.start.row),R=(k?1:-1)*(E.end.column-E.start.column),M=E.start,N=k?M:E.end;return g(w,M,T)?{row:w.row,column:w.column}:g(N,w,!T)?{row:w.row+O,column:w.column+(w.row==N.row?R:0)}:{row:M.row,column:M.column}}(y,{row:this.row,column:this.column},this.$insertRight);this.setPosition(_.row,_.column,!0)}},this.setPosition=function(y,_,E){var w;if(w=E?{row:y,column:_}:this.$clipPositionToDocument(y,_),this.row!=w.row||this.column!=w.column){var T={row:this.row,column:this.column};this.row=w.row,this.column=w.column,this._signal("change",{old:T,value:w})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(y){this.document=y||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(y,_){var E={};return y>=this.document.getLength()?(E.row=Math.max(0,this.document.getLength()-1),E.column=this.document.getLine(E.row).length):y<0?(E.row=0,E.column=0):(E.row=y,E.column=Math.min(this.document.getLine(E.row).length,Math.max(0,_))),_<0&&(E.column=0),E}}).call(m.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(a,l,c){var u=a("./lib/oop"),d=a("./apply_delta").applyDelta,m=a("./lib/event_emitter").EventEmitter,g=a("./range").Range,y=a("./anchor").Anchor,_=function(E){this.$lines=[""],E.length===0?this.$lines=[""]:Array.isArray(E)?this.insertMergedLines({row:0,column:0},E):this.insert({row:0,column:0},E)};(function(){u.implement(this,m),this.setValue=function(E){var w=this.getLength()-1;this.remove(new g(0,0,w,this.getLine(w).length)),this.insert({row:0,column:0},E)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(E,w){return new y(this,E,w)},"aaa".split(/a/).length===0?this.$split=function(E){return E.replace(/\r\n|\r/g,` -`).split(` -`)}:this.$split=function(E){return E.split(/\r\n|\r|\n/)},this.$detectNewLine=function(E){var w=E.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=w?w[1]:` -`,this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r -`;case"unix":return` -`;default:return this.$autoNewLine||` -`}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(E){this.$newLineMode!==E&&(this.$newLineMode=E,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(E){return E==`\r -`||E=="\r"||E==` -`},this.getLine=function(E){return this.$lines[E]||""},this.getLines=function(E,w){return this.$lines.slice(E,w+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(E){return this.getLinesForRange(E).join(this.getNewLineCharacter())},this.getLinesForRange=function(E){var w;if(E.start.row===E.end.row)w=[this.getLine(E.start.row).substring(E.start.column,E.end.column)];else{(w=this.getLines(E.start.row,E.end.row))[0]=(w[0]||"").substring(E.start.column);var T=w.length-1;E.end.row-E.start.row==T&&(w[T]=w[T].substring(0,E.end.column))}return w},this.insertLines=function(E,w){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(E,w)},this.removeLines=function(E,w){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(E,w)},this.insertNewLine=function(E){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(E,["",""])},this.insert=function(E,w){return this.getLength()<=1&&this.$detectNewLine(w),this.insertMergedLines(E,this.$split(w))},this.insertInLine=function(E,w){var T=this.clippedPos(E.row,E.column),k=this.pos(E.row,E.column+w.length);return this.applyDelta({start:T,end:k,action:"insert",lines:[w]},!0),this.clonePos(k)},this.clippedPos=function(E,w){var T=this.getLength();E===void 0?E=T:E<0?E=0:E>=T&&(E=T-1,w=void 0);var k=this.getLine(E);return w==null&&(w=k.length),{row:E,column:w=Math.min(Math.max(w,0),k.length)}},this.clonePos=function(E){return{row:E.row,column:E.column}},this.pos=function(E,w){return{row:E,column:w}},this.$clipPosition=function(E){var w=this.getLength();return E.row>=w?(E.row=Math.max(0,w-1),E.column=this.getLine(w-1).length):(E.row=Math.max(0,E.row),E.column=Math.min(Math.max(E.column,0),this.getLine(E.row).length)),E},this.insertFullLines=function(E,w){var T=0;(E=Math.min(Math.max(E,0),this.getLength()))0,k=w=0&&this.applyDelta({start:this.pos(E,this.getLine(E).length),end:this.pos(E+1,0),action:"remove",lines:["",""]})},this.replace=function(E,w){return E instanceof g||(E=g.fromPoints(E.start,E.end)),w.length===0&&E.isEmpty()?E.start:w==this.getTextRange(E)?E.end:(this.remove(E),w?this.insert(E.start,w):E.start)},this.applyDeltas=function(E){for(var w=0;w=0;w--)this.revertDelta(E[w])},this.applyDelta=function(E,w){var T=E.action=="insert";(T?E.lines.length<=1&&!E.lines[0]:!g.comparePoints(E.start,E.end))||(T&&E.lines.length>2e4&&this.$splitAndapplyLargeDelta(E,2e4),d(this.$lines,E,w),this._signal("change",E))},this.$splitAndapplyLargeDelta=function(E,w){for(var T=E.lines,k=T.length,O=E.start.row,R=E.start.column,M=0,N=0;;){M=N,N+=w-1;var D=T.slice(M,N);if(N>k){E.lines=D,E.start.row=O+M,E.start.column=R;break}D.push(""),this.applyDelta({start:this.pos(O+M,R),end:this.pos(O+N,R=0),action:E.action,lines:D},!0)}},this.revertDelta=function(E){this.applyDelta({start:this.clonePos(E.start),end:this.clonePos(E.end),action:E.action=="insert"?"remove":"insert",lines:E.lines.slice()})},this.indexToPosition=function(E,w){for(var T=this.$lines||this.getAllLines(),k=this.getNewLineCharacter().length,O=w||0,R=T.length;O20){_.running=setTimeout(_.$worker,20);break}}_.currentLine=w,O<=T&&_.fireUpdateEvent(O,T)}}};(function(){u.implement(this,d),this.setTokenizer=function(g){this.tokenizer=g,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(g){this.doc=g,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(g,y){var _={first:g,last:y};this._signal("update",{data:_})},this.start=function(g){this.currentLine=Math.min(g||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(g){var y=g.start.row,_=g.end.row-y;if(_===0)this.lines[y]=null;else if(g.action=="remove")this.lines.splice(y,_+1,null),this.states.splice(y,_+1,null);else{var E=Array(_+1);E.unshift(y,1),this.lines.splice.apply(this.lines,E),this.states.splice.apply(this.states,E)}this.currentLine=Math.min(y,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(g){return this.lines[g]||this.$tokenizeRow(g)},this.getState=function(g){return this.currentLine==g&&this.$tokenizeRow(g),this.states[g]||"start"},this.$tokenizeRow=function(g){var y=this.doc.getLine(g),_=this.states[g-1],E=this.tokenizer.getLineTokens(y,_,g);return this.states[g]+""!=E.state+""?(this.states[g]=E.state,this.lines[g+1]=null,this.currentLine>g+1&&(this.currentLine=g+1)):this.currentLine==g&&(this.currentLine=g+1),this.lines[g]=E.tokens}}).call(m.prototype),l.BackgroundTokenizer=m}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(a,l,c){var u=a("./lib/lang");a("./lib/oop");var d=a("./range").Range,m=function(g,y,_){this.setRegexp(g),this.clazz=y,this.type=_||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(g){this.regExp+""!=g+""&&(this.regExp=g,this.cache=[])},this.update=function(g,y,_,E){if(this.regExp)for(var w=E.firstRow,T=E.lastRow,k=w;k<=T;k++){var O=this.cache[k];O==null&&((O=u.getMatchOffsets(_.getLine(k),this.regExp)).length>this.MAX_RANGES&&(O=O.slice(0,this.MAX_RANGES)),O=O.map(function(M){return new d(k,M.offset,k,M.offset+M.length)}),this.cache[k]=O.length?O:"");for(var R=O.length;R--;)y.drawSingleLineMarker(g,O[R].toScreenRange(_),this.clazz,E)}}}).call(m.prototype),l.SearchHighlight=m}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(a,l,c){var u=a("../range").Range;function d(m,g){this.foldData=m,Array.isArray(g)?this.folds=g:g=this.folds=[g];var y=g[g.length-1];this.range=new u(g[0].start.row,g[0].start.column,y.end.row,y.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(_){_.setFoldLine(this)},this)}(function(){this.shiftRow=function(m){this.start.row+=m,this.end.row+=m,this.folds.forEach(function(g){g.start.row+=m,g.end.row+=m})},this.addFold=function(m){if(m.sameRow){if(m.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(m),this.folds.sort(function(g,y){return-g.range.compareEnd(y.start.row,y.start.column)}),this.range.compareEnd(m.start.row,m.start.column)>0?(this.end.row=m.end.row,this.end.column=m.end.column):this.range.compareStart(m.end.row,m.end.column)<0&&(this.start.row=m.start.row,this.start.column=m.start.column)}else if(m.start.row==this.end.row)this.folds.push(m),this.end.row=m.end.row,this.end.column=m.end.column;else{if(m.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(m),this.start.row=m.start.row,this.start.column=m.start.column}m.foldLine=this},this.containsRow=function(m){return m>=this.start.row&&m<=this.end.row},this.walk=function(m,g,y){var _,E,w=0,T=this.folds,k=!0;g==null&&(g=this.end.row,y=this.end.column);for(var O=0;O0)){var k=u(m,w.start);return T===0?g&&k!==0?-E-2:E:k>0||k===0&&!g?E:-E-1}}return-E-1},this.add=function(m){var g=!m.isEmpty(),y=this.pointIndex(m.start,g);y<0&&(y=-y-1);var _=this.pointIndex(m.end,g,y);return _<0?_=-_-1:_++,this.ranges.splice(y,_-y,m)},this.addList=function(m){for(var g=[],y=m.length;y--;)g.push.apply(g,this.add(m[y]));return g},this.substractPoint=function(m){var g=this.pointIndex(m);if(g>=0)return this.ranges.splice(g,1)},this.merge=function(){for(var m,g=[],y=this.ranges,_=(y=y.sort(function(T,k){return u(T.start,k.start)}))[0],E=1;E=0},this.containsPoint=function(m){return this.pointIndex(m)>=0},this.rangeAtPoint=function(m){var g=this.pointIndex(m);if(g>=0)return this.ranges[g]},this.clipRows=function(m,g){var y=this.ranges;if(y[0].start.row>g||y[y.length-1].start.row_)break;if(R.start.row==_&&R.start.column>=g.column&&(R.start.column==g.column&&this.$insertRight||(R.start.column+=w,R.start.row+=E)),R.end.row==_&&R.end.column>=g.column){if(R.end.column==g.column&&this.$insertRight)continue;R.end.column==g.column&&w>0&&kR.start.column&&R.end.column==T[k+1].start.column&&(R.end.column-=w),R.end.column+=w,R.end.row+=E}}if(E!=0&&k=y)return T;if(T.end.row>y)return null}return null},this.getNextFoldLine=function(y,_){var E=this.$foldData,w=0;for(_&&(w=E.indexOf(_)),w==-1&&(w=0);w=y)return T}return null},this.getFoldedRowCount=function(y,_){for(var E=this.$foldData,w=_-y+1,T=0;T=_){R<_&&(R>=y?w-=_-R:w=0);break}O>=y&&(w-=R>=y?O-R:O-y+1)}return w},this.$addFoldLine=function(y){return this.$foldData.push(y),this.$foldData.sort(function(_,E){return _.start.row-E.start.row}),y},this.addFold=function(y,_){var E,w=this.$foldData,T=!1;y instanceof m?E=y:(E=new m(_,y)).collapseChildren=_.collapseChildren,this.$clipRangeToDocument(E.range);var k=E.start.row,O=E.start.column,R=E.end.row,M=E.end.column;if(!(k0&&(this.removeFolds(P),P.forEach(function(U){E.addSubFold(U)}));for(var I=0;I0&&this.foldAll(y.start.row+1,y.end.row,y.collapseChildren-1),y.subFolds=[]},this.expandFolds=function(y){y.forEach(function(_){this.expandFold(_)},this)},this.unfold=function(y,_){var E,w;if(y==null?(E=new u(0,0,this.getLength(),0),_=!0):E=typeof y=="number"?new u(y,0,y,this.getLine(y).length):"row"in y?u.fromPoints(y,y):y,w=this.getFoldsInRangeList(E),_)this.removeFolds(w);else for(var T=w;T.length;)this.expandFolds(T),T=this.getFoldsInRangeList(E);if(w.length)return w},this.isRowFolded=function(y,_){return!!this.getFoldLine(y,_)},this.getRowFoldEnd=function(y,_){var E=this.getFoldLine(y,_);return E?E.end.row:y},this.getRowFoldStart=function(y,_){var E=this.getFoldLine(y,_);return E?E.start.row:y},this.getFoldDisplayLine=function(y,_,E,w,T){w==null&&(w=y.start.row),T==null&&(T=0),_==null&&(_=y.end.row),E==null&&(E=this.getLine(_).length);var k=this.doc,O="";return y.walk(function(R,M,N,D){if(!(M=y){T=k.end.row;try{var O=this.addFold("...",k);O&&(O.collapseChildren=E)}catch{}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(y){if(!this.$foldStyles[y])throw new Error("invalid fold style: "+y+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=y){this.$foldStyle=y,y=="manual"&&this.unfold();var _=this.$foldMode;this.$setFolding(null),this.$setFolding(_)}},this.$setFolding=function(y){this.$foldMode!=y&&(this.$foldMode=y,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),y&&this.$foldStyle!="manual"?(this.foldWidgets=[],this.getFoldWidget=y.getFoldWidget.bind(y,this,this.$foldStyle),this.getFoldWidgetRange=y.getFoldWidgetRange.bind(y,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(y,_){var E=this.foldWidgets;if(!E||_&&E[y])return{};for(var w,T=y-1;T>=0;){var k=E[T];if(k==null&&(k=E[T]=this.getFoldWidget(T)),k=="start"){var O=this.getFoldWidgetRange(T);if(w||(w=O),O&&O.end.row>=y)break}T--}return{range:T!==-1&&O,firstRange:w}},this.onFoldWidgetClick=function(y,_){var E={children:(_=_.domEvent).shiftKey,all:_.ctrlKey||_.metaKey,siblings:_.altKey};if(!this.$toggleFoldWidget(y,E)){var w=_.target||_.srcElement;w&&/ace_fold-widget/.test(w.className)&&(w.className+=" ace_invalid")}},this.$toggleFoldWidget=function(y,_){if(this.getFoldWidget){var E=this.getFoldWidget(y),w=this.getLine(y),T=E==="end"?-1:1,k=this.getFoldAt(y,T===-1?0:w.length,T);if(k)_.children||_.all?this.removeFold(k):this.expandFold(k);else{var O=this.getFoldWidgetRange(y,!0);if(!O||O.isMultiLine()||!(k=this.getFoldAt(O.start.row,O.start.column,1))||!O.isEqual(k.range)){if(_.siblings){var R=this.getParentFoldRangeData(y);if(R.range)var M=R.range.start.row+1,N=R.range.end.row;this.foldAll(M,N,_.all?1e4:0)}else _.children?(N=O?O.end.row:this.getLength(),this.foldAll(y+1,N,_.all?1e4:0)):O&&(_.all&&(O.collapseChildren=1e4),this.addFold("...",O));return O}this.removeFold(k)}}},this.toggleFoldWidget=function(y){var _=this.selection.getCursor().row;_=this.getRowFoldStart(_);var E=this.$toggleFoldWidget(_,{});if(!E){var w=this.getParentFoldRangeData(_,!0);if(E=w.range||w.firstRange){_=E.start.row;var T=this.getFoldAt(_,this.getLine(_).length,1);T?this.removeFold(T):this.addFold("...",E)}}},this.updateFoldWidgets=function(y){var _=y.start.row,E=y.end.row-_;if(E===0)this.foldWidgets[_]=null;else if(y.action=="remove")this.foldWidgets.splice(_,E+1,null);else{var w=Array(E+1);w.unshift(_,1),this.foldWidgets.splice.apply(this.foldWidgets,w)}},this.tokenizerUpdateFoldWidgets=function(y){var _=y.data;_.first!=_.last&&this.foldWidgets.length>_.first&&this.foldWidgets.splice(_.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(a,l,c){var u=a("../token_iterator").TokenIterator,d=a("../range").Range;l.BracketMatch=function(){this.findMatchingBracket=function(m,g){if(m.column==0)return null;var y=g||this.getLine(m.row).charAt(m.column-1);if(y=="")return null;var _=y.match(/([\(\[\{])|([\)\]\}])/);return _?_[1]?this.$findClosingBracket(_[1],m):this.$findOpeningBracket(_[2],m):null},this.getBracketRange=function(m){var g,y=this.getLine(m.row),_=!0,E=y.charAt(m.column-1),w=E&&E.match(/([\(\[\{])|([\)\]\}])/);if(w||(E=y.charAt(m.column),m={row:m.row,column:m.column+1},w=E&&E.match(/([\(\[\{])|([\)\]\}])/),_=!1),!w)return null;if(w[1]){if(!(T=this.$findClosingBracket(w[1],m)))return null;g=d.fromPoints(m,T),_||(g.end.column++,g.start.column--),g.cursor=g.end}else{var T;if(!(T=this.$findOpeningBracket(w[2],m)))return null;g=d.fromPoints(T,m),_||(g.start.column++,g.end.column--),g.cursor=g.start}return g},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(m,g,y){var _=this.$brackets[m],E=1,w=new u(this,g.row,g.column),T=w.getCurrentToken();if(T||(T=w.stepForward()),T){y||(y=new RegExp("(\\.?"+T.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var k=g.column-w.getCurrentTokenColumn()-2,O=T.value;;){for(;k>=0;){var R=O.charAt(k);if(R==_){if((E-=1)==0)return{row:w.getCurrentTokenRow(),column:k+w.getCurrentTokenColumn()}}else R==m&&(E+=1);k-=1}do T=w.stepBackward();while(T&&!y.test(T.type));if(T==null)break;k=(O=T.value).length-1}return null}},this.$findClosingBracket=function(m,g,y){var _=this.$brackets[m],E=1,w=new u(this,g.row,g.column),T=w.getCurrentToken();if(T||(T=w.stepForward()),T){y||(y=new RegExp("(\\.?"+T.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var k=g.column-w.getCurrentTokenColumn();;){for(var O=T.value,R=O.length;kI&&(this.$docRowCache.splice(I,P),this.$screenRowCache.splice(I,P))},this.$getRowCacheIndex=function(D,P){for(var I=0,L=D.length-1;I<=L;){var F=I+L>>1,U=D[F];if(P>U)I=F+1;else{if(!(P=P);U++);return(I=L[U])?(I.index=U,I.start=F-I.value.length,I):null},this.setUndoManager=function(D){if(this.$undoManager=D,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel(),D){var P=this;this.$syncInformUndoManager=function(){P.$informUndoManager.cancel(),P.$deltasFold.length&&(P.$deltas.push({group:"fold",deltas:P.$deltasFold}),P.$deltasFold=[]),P.$deltasDoc.length&&(P.$deltas.push({group:"doc",deltas:P.$deltasDoc}),P.$deltasDoc=[]),P.$deltas.length>0&&D.execute({action:"aceupdate",args:[P.$deltas,P],merge:P.mergeUndoDeltas}),P.mergeUndoDeltas=!1,P.$deltas=[]},this.$informUndoManager=d.delayedCall(this.$syncInformUndoManager)}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?d.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(D){this.setOption("useSoftTabs",D)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(D){this.setOption("tabSize",D)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(D){return this.$useSoftTabs&&D.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(D){this.setOption("overwrite",D)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(D,P){this.$decorations[D]||(this.$decorations[D]=""),this.$decorations[D]+=" "+P,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(D,P){this.$decorations[D]=(this.$decorations[D]||"").replace(" "+P,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(D){this.$breakpoints=[];for(var P=0;P0&&(L=!!I.charAt(P-1).match(this.tokenRe)),L||(L=!!I.charAt(P).match(this.tokenRe)),L)var F=this.tokenRe;else F=/^\s+$/.test(I.slice(P-1,P+1))?/\s/:this.nonTokenRe;var U=P;if(U>0){do U--;while(U>=0&&I.charAt(U).match(F));U++}for(var J=P;JD&&(D=P.screenWidth)}),this.lineWidgetWidth=D},this.$computeWidth=function(D){if(this.$modified||D){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var P=this.doc.getAllLines(),I=this.$rowLengthCache,L=0,F=0,U=this.$foldData[F],J=U?U.start.row:1/0,z=P.length,ie=0;ieJ){if((ie=U.end.row+1)>=z)break;J=(U=this.$foldData[F++])?U.start.row:1/0}I[ie]==null&&(I[ie]=this.$getStringScreenWidth(P[ie])[0]),I[ie]>L&&(L=I[ie])}this.screenWidth=L}},this.getLine=function(D){return this.doc.getLine(D)},this.getLines=function(D,P){return this.doc.getLines(D,P)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(D){return this.doc.getTextRange(D||this.selection.getRange())},this.insert=function(D,P){return this.doc.insert(D,P)},this.remove=function(D){return this.doc.remove(D)},this.removeFullLines=function(D,P){return this.doc.removeFullLines(D,P)},this.undoChanges=function(D,P){if(D.length){this.$fromUndo=!0;for(var I=null,L=D.length-1;L!=-1;L--){var F=D[L];F.group=="doc"?(this.doc.revertDeltas(F.deltas),I=this.$getUndoSelection(F.deltas,!0,I)):F.deltas.forEach(function(U){this.addFolds(U.folds)},this)}return this.$fromUndo=!1,I&&this.$undoSelect&&!P&&this.selection.setSelectionRange(I),I}},this.redoChanges=function(D,P){if(D.length){this.$fromUndo=!0;for(var I=null,L=0;LD.end.column&&(U.start.column+=ce),U.end.row==D.end.row&&U.end.column>D.end.column&&(U.end.column+=ce)),J&&U.start.row>=D.end.row&&(U.start.row+=J,U.end.row+=J)}if(U.end=this.insert(U.start,L),F.length){var z=D.start,ie=U.start,ce=(J=ie.row-z.row,ie.column-z.column);this.addFolds(F.map(function(Y){return(Y=Y.clone()).start.row==z.row&&(Y.start.column+=ce),Y.end.row==z.row&&(Y.end.column+=ce),Y.start.row+=J,Y.end.row+=J,Y}))}return U},this.indentRows=function(D,P,I){I=I.replace(/\t/g,this.getTabString());for(var L=D;L<=P;L++)this.doc.insertInLine({row:L,column:0},I)},this.outdentRows=function(D){for(var P=D.collapseRows(),I=new E(0,0,0,0),L=this.getTabSize(),F=P.start.row;F<=P.end.row;++F){var U=this.getLine(F);I.start.row=F,I.end.row=F;for(var J=0;J0){var F;if((F=this.getRowFoldEnd(P+I))>this.doc.getLength()-1)return 0;L=F-P}else D=this.$clipRowToDocument(D),L=(P=this.$clipRowToDocument(P))-D+1;var U=new E(D,0,P,Number.MAX_VALUE),J=this.getFoldsInRange(U).map(function(ie){return(ie=ie.clone()).start.row+=L,ie.end.row+=L,ie}),z=I==0?this.doc.getLines(D,P):this.doc.removeFullLines(D,P);return this.doc.insertFullLines(D+L,z),J.length&&this.addFolds(J),L},this.moveLinesUp=function(D,P){return this.$moveLines(D,P,-1)},this.moveLinesDown=function(D,P){return this.$moveLines(D,P,1)},this.duplicateLines=function(D,P){return this.$moveLines(D,P,0)},this.$clipRowToDocument=function(D){return Math.max(0,Math.min(D,this.doc.getLength()-1))},this.$clipColumnToRow=function(D,P){return P<0?0:Math.min(this.doc.getLine(D).length,P)},this.$clipPositionToDocument=function(D,P){if(P=Math.max(0,P),D<0)D=0,P=0;else{var I=this.doc.getLength();D>=I?(D=I-1,P=this.doc.getLine(I-1).length):P=Math.min(this.doc.getLine(D).length,P)}return{row:D,column:P}},this.$clipRangeToDocument=function(D){D.start.row<0?(D.start.row=0,D.start.column=0):D.start.column=this.$clipColumnToRow(D.start.row,D.start.column);var P=this.doc.getLength()-1;return D.end.row>P?(D.end.row=P,D.end.column=this.doc.getLine(P).length):D.end.column=this.$clipColumnToRow(D.end.row,D.end.column),D},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(D){if(D!=this.$useWrapMode){if(this.$useWrapMode=D,this.$modified=!0,this.$resetRowCache(0),D){var P=this.getLength();this.$wrapData=Array(P),this.$updateWrapData(0,P-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(D,P){this.$wrapLimitRange.min===D&&this.$wrapLimitRange.max===P||(this.$wrapLimitRange={min:D,max:P},this.$modified=!0,this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(D,P){var I=this.$wrapLimitRange;I.max<0&&(I={min:P,max:P});var L=this.$constrainWrapLimit(D,I.min,I.max);return L!=this.$wrapLimit&&L>1&&(this.$wrapLimit=L,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(D,P,I){return P&&(D=Math.max(P,D)),I&&(D=Math.min(I,D)),D},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(D){this.setWrapLimitRange(D,D)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(D){var P=this.$useWrapMode,I=D.action,L=D.start,F=D.end,U=L.row,J=F.row,z=J-U,ie=null;if(this.$updating=!0,z!=0)if(I==="remove"){this[P?"$wrapData":"$rowLengthCache"].splice(U,z);var ce=this.$foldData;ie=this.getFoldsInRange(D),this.removeFolds(ie);var Y=0;if(Dee=this.getFoldLine(F.row)){Dee.addRemoveChars(F.row,F.column,L.column-F.column),Dee.shiftRow(-z);var B=this.getFoldLine(U);B&&B!==Dee&&(B.merge(Dee),Dee=B),Y=ce.indexOf(Dee)+1}for(;Y=F.row&&Dee.shiftRow(-z);J=U}else{var V=Array(z);V.unshift(U,0);var Ge=P?this.$wrapData:this.$rowLengthCache;if(Ge.splice.apply(Ge,V),ce=this.$foldData,Y=0,Dee=this.getFoldLine(U)){var St=Dee.range.compareInside(L.row,L.column);St==0?(Dee=Dee.split(L.row,L.column))&&(Dee.shiftRow(z),Dee.addRemoveChars(J,0,F.column-L.column)):St==-1&&(Dee.addRemoveChars(U,0,F.column-L.column),Dee.shiftRow(z)),Y=ce.indexOf(Dee)+1}for(;Y=U&&Dee.shiftRow(z)}}else z=Math.abs(D.start.column-D.end.column),I==="remove"&&(ie=this.getFoldsInRange(D),this.removeFolds(ie),z=-z),(Dee=this.getFoldLine(U))&&Dee.addRemoveChars(U,L.column,z);return P&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,P?this.$updateWrapData(U,J):this.$updateRowLengthCache(U,J),ie},this.$updateRowLengthCache=function(D,P,I){this.$rowLengthCache[D]=null,this.$rowLengthCache[P]=null},this.$updateWrapData=function(D,P){var I,L,F=this.doc.getAllLines(),U=this.getTabSize(),J=this.$wrapData,z=this.$wrapLimit,ie=D;for(P=Math.min(P,F.length-1);ie<=P;)(L=this.getFoldLine(ie,L))?(I=[],L.walk(function(ce,Y,B,V){var Ge;if(ce!=null){(Ge=this.$getDisplayTokens(ce,I.length))[0]=R;for(var St=1;St=4352&&D<=4447||D>=4515&&D<=4519||D>=4602&&D<=4607||D>=9001&&D<=9002||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12283||D>=12288&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12589||D>=12593&&D<=12686||D>=12688&&D<=12730||D>=12736&&D<=12771||D>=12784&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=13054||D>=13056&&D<=19903||D>=19968&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=55216&&D<=55238||D>=55243&&D<=55291||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=65281&&D<=65376||D>=65504&&D<=65510)}this.$computeWrapSplits=function(D,P,I){if(D.length==0)return[];var L=[],F=D.length,U=0,J=0,z=this.$wrapAsCode,ie=this.$indentedSoftWrap,ce=P<=Math.max(2*I,8)||ie===!1?0:Math.floor(P/2);function Y(St){var Dee=D.slice(U,St),pee=Dee.length;Dee.join("").replace(/12/g,function(){pee-=1}).replace(/2/g,function(){pee-=1}),L.length||(B=function(){var jr=0;if(ce===0)return jr;if(ie)for(var Tee=0;TeeP-B;){var V=U+P-B;if(D[V-1]>=10&&D[V]>=10)Y(V);else if(D[V]!=R&&D[V]!=M){for(var Ge=Math.max(V-(P-(P>>2)),U-1);V>Ge&&D[V]Ge&&D[V]Ge&&D[V]==9;)V--}else for(;V>Ge&&D[V]<10;)V--;V>Ge?Y(++V):(D[V=U+P]==2&&V--,Y(V-B))}else{for(;V!=U-1&&D[V]!=R;V--);if(V>U){Y(V);continue}for(V=U+P;V39&&U<48||U>57&&U<64?L.push(9):U>=4352&&N(U)?L.push(1,2):L.push(1)}return L},this.$getStringScreenWidth=function(D,P,I){if(P==0)return[0,0];var L,F;for(P==null&&(P=1/0),I=I||0,F=0;F=4352&&N(L)?I+=2:I+=1,!(I>P));F++);return[I,F]},this.lineWidgets=null,this.getRowLength=function(D){if(this.lineWidgets)var P=this.lineWidgets[D]&&this.lineWidgets[D].rowCount||0;else P=0;return this.$useWrapMode&&this.$wrapData[D]?this.$wrapData[D].length+1+P:1+P},this.getRowLineCount=function(D){return this.$useWrapMode&&this.$wrapData[D]?this.$wrapData[D].length+1:1},this.getRowWrapIndent=function(D){if(this.$useWrapMode){var P=this.screenToDocumentPosition(D,Number.MAX_VALUE),I=this.$wrapData[P.row];return I.length&&I[0]=0){J=ie[ce],F=this.$docRowCache[ce];var B=D>ie[Y-1]}else B=!Y;for(var V=this.getLength()-1,Ge=this.getNextFoldLine(F),St=Ge?Ge.start.row:1/0;J<=D&&!(J+(z=this.getRowLength(F))>D||F>=V);)J+=z,++F>St&&(F=Ge.end.row+1,St=(Ge=this.getNextFoldLine(F,Ge))?Ge.start.row:1/0),B&&(this.$docRowCache.push(F),this.$screenRowCache.push(J));if(Ge&&Ge.start.row<=F)I=this.getFoldDisplayLine(Ge),F=Ge.start.row;else{if(J+z<=D||F>V)return{row:V,column:this.getLine(V).length};I=this.getLine(F),Ge=null}var Dee=0;if(this.$useWrapMode){var pee=this.$wrapData[F];if(pee){var jr=Math.floor(D-J);L=pee[jr],jr>0&&pee.length&&(Dee=pee.indent,U=pee[jr-1]||pee[pee.length-1],I=I.substring(U))}}return U+=this.$getStringScreenWidth(I,P-Dee)[1],this.$useWrapMode&&U>=L&&(U=L-1),Ge?Ge.idxToPosition(U):{row:F,column:U}},this.documentToScreenPosition=function(D,P){if(P===void 0)var I=this.$clipPositionToDocument(D.row,D.column);else I=this.$clipPositionToDocument(D,P);D=I.row,P=I.column;var L,F=0,U=null;(L=this.getFoldAt(D,P,1))&&(D=L.start.row,P=L.start.column);var J,z=0,ie=this.$docRowCache,ce=this.$getRowCacheIndex(ie,D),Y=ie.length;if(Y&&ce>=0){z=ie[ce],F=this.$screenRowCache[ce];var B=D>ie[Y-1]}else B=!Y;for(var V=this.getNextFoldLine(z),Ge=V?V.start.row:1/0;z=Ge){if((J=V.end.row+1)>D)break;Ge=(V=this.getNextFoldLine(J,V))?V.start.row:1/0}else J=z+1;F+=this.getRowLength(z),z=J,B&&(this.$docRowCache.push(z),this.$screenRowCache.push(F))}var St="";V&&z>=Ge?(St=this.getFoldDisplayLine(V,D,P),U=V.start.row):(St=this.getLine(D).substring(0,P),U=D);var Dee=0;if(this.$useWrapMode){var pee=this.$wrapData[U];if(pee){for(var jr=0;St.length>=pee[jr];)F++,jr++;St=St.substring(pee[jr-1]||0,St.length),Dee=jr>0?pee.indent:0}}return{row:F,column:Dee+this.$getStringScreenWidth(St)[0]}},this.documentToScreenColumn=function(D,P){return this.documentToScreenPosition(D,P).column},this.documentToScreenRow=function(D,P){return this.documentToScreenPosition(D,P).row},this.getScreenLength=function(){var D=0,P=null;if(this.$useWrapMode)for(var I=this.$wrapData.length,L=0,F=(z=0,(P=this.$foldData[z++])?P.start.row:1/0);LF&&(L=P.end.row+1,F=(P=this.$foldData[z++])?P.start.row:1/0)}else{D=this.getLength();for(var J=this.$foldData,z=0;zI);U++);return[L,U]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()}}).call(O.prototype),a("./edit_session/folding").Folding.call(O.prototype),a("./edit_session/bracket_match").BracketMatch.call(O.prototype),m.defineOptions(O.prototype,"session",{wrap:{set:function(R){if(R&&R!="off"?R=="free"?R=!0:R=="printMargin"?R=-1:typeof R=="string"&&(R=parseInt(R,10)||!1):R=!1,this.$wrap!=R)if(this.$wrap=R,R){var M=typeof R=="number"?R:null;this.setWrapLimitRange(M,M),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(R){(R=R=="auto"?this.$mode.type!="text":R!="text")!=this.$wrapAsCode&&(this.$wrapAsCode=R,this.$useWrapMode&&(this.$modified=!0,this.$resetRowCache(0),this.$updateWrapData(0,this.getLength()-1)))},initialValue:"auto"},indentedSoftWrap:{initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(R){this.$useWorker=R,this.$stopWorker(),R&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(R){isNaN(R)||this.$tabSize===R||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=R,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},overwrite:{set:function(R){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(R){this.doc.setNewLineMode(R)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(R){this.setMode(R)},get:function(){return this.$modeId}}}),l.EditSession=O}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(a,l,c){var u=a("./lib/lang"),d=a("./lib/oop"),m=a("./range").Range,g=function(){this.$options={}};(function(){this.set=function(y){return d.mixin(this.$options,y),this},this.getOptions=function(){return u.copyObject(this.$options)},this.setOptions=function(y){this.$options=y},this.find=function(y){var _=this.$options,E=this.$matchIterator(y,_);if(!E)return!1;var w=null;return E.forEach(function(T,k,O){if(T.start)w=T;else{var R=T.offset+(O||0);if(w=new m(k,R,k,R+T.length),!T.length&&_.start&&_.start.start&&_.skipCurrent!=0&&w.isEqual(_.start))return w=null,!1}return!0}),w},this.findAll=function(y){var _=this.$options;if(!_.needle)return[];this.$assembleRegExp(_);var E=_.range,w=E?y.getLines(E.start.row,E.end.row):y.doc.getAllLines(),T=[],k=_.re;if(_.$isMultiLine){var O,R=k.length,M=w.length-R;e:for(var N=k.offset||0;N<=M;N++){for(var D=0;DL||(T.push(O=new m(N,L,N+R-1,F)),R>2&&(N=N+R-2))}}else for(var U=0;Uce&&T[D].end.row==E.end.row;)D--;for(T=T.slice(U,D+1),U=0,D=T.length;U=0;P--)if(E(D[P],M,N))return!0}:function(R,M,N){for(var D=u.getMatchOffsets(R,w),P=0;P=O;N--)if(M(y.getLine(N),N))return;if(_.wrap!=0){for(N=R,O=k.row;N>=O;N--)if(M(y.getLine(N),N))return}}}:function(M){var N=k.row;if(!M(y.getLine(N).substr(k.column),N,k.column)){for(N+=1;N<=R;N++)if(M(y.getLine(N),N))return;if(_.wrap!=0){for(N=O,R=k.row;N<=R;N++)if(M(y.getLine(N),N))return}}}}}}).call(g.prototype),l.Search=g}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(a,l,c){var u=a("../lib/keys"),d=a("../lib/useragent"),m=u.KEY_MODS;function g(_,E){this.platform=E||(d.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(_),this.$singleCommand=!0}function y(_,E){g.call(this,_,E),this.$singleCommand=!1}y.prototype=g.prototype,function(){function _(E){return _typeof(E)=="object"&&E.bindKey&&E.bindKey.position||0}this.addCommand=function(E){this.commands[E.name]&&this.removeCommand(E),this.commands[E.name]=E,E.bindKey&&this._buildKeyHash(E)},this.removeCommand=function(E,w){var T=E&&(typeof E=="string"?E:E.name);E=this.commands[T],w||delete this.commands[T];var k=this.commandKeyBinding;for(var O in k){var R=k[O];if(R==E)delete k[O];else if(Array.isArray(R)){var M=R.indexOf(E);M!=-1&&(R.splice(M,1),R.length==1&&(k[O]=R[0]))}}},this.bindKey=function(E,w,T){if(_typeof(E)=="object"&&E&&(T==null&&(T=E.position),E=E[this.platform]),E)return typeof w=="function"?this.addCommand({exec:w,bindKey:E,name:w.name||E}):void E.split("|").forEach(function(k){var O="";if(k.indexOf(" ")!=-1){var R=k.split(/\s+/);k=R.pop(),R.forEach(function(D){var P=this.parseKeys(D),I=m[P.hashId]+P.key;O+=(O?" ":"")+I,this._addCommandToBinding(O,"chainKeys")},this),O+=" "}var M=this.parseKeys(k),N=m[M.hashId]+M.key;this._addCommandToBinding(O+N,w,T)},this)},this._addCommandToBinding=function(E,w,T){var k,O=this.commandKeyBinding;if(w)if(!O[E]||this.$singleCommand)O[E]=w;else{Array.isArray(O[E])?(k=O[E].indexOf(w))!=-1&&O[E].splice(k,1):O[E]=[O[E]],typeof T!="number"&&(T=T||w.isDefault?-100:_(w));var R=O[E];for(k=0;kT);k++);R.splice(k,0,w)}else delete O[E]},this.addCommands=function(E){E&&Object.keys(E).forEach(function(w){var T=E[w];if(T){if(typeof T=="string")return this.bindKey(T,w);typeof T=="function"&&(T={exec:T}),_typeof(T)==="object"&&(T.name||(T.name=w),this.addCommand(T))}},this)},this.removeCommands=function(E){Object.keys(E).forEach(function(w){this.removeCommand(E[w])},this)},this.bindKeys=function(E){Object.keys(E).forEach(function(w){this.bindKey(w,E[w])},this)},this._buildKeyHash=function(E){this.bindKey(E.bindKey,E)},this.parseKeys=function(E){var w=E.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(N){return N}),T=w.pop(),k=u[T];if(u.FUNCTION_KEYS[k])T=u.FUNCTION_KEYS[k].toLowerCase();else{if(!w.length)return{key:T,hashId:-1};if(w.length==1&&w[0]=="shift")return{key:T.toUpperCase(),hashId:-1}}for(var O=0,R=w.length;R--;){var M=u.KEY_MODS[w[R]];if(M==null)return typeof console<"u"&&console.error("invalid modifier "+w[R]+" in "+E),!1;O|=M}return{key:T,hashId:O}},this.findKeyCommand=function(E,w){var T=m[E]+w;return this.commandKeyBinding[T]},this.handleKeyboard=function(E,w,T,k){if(!(k<0)){var O=m[w]+T,R=this.commandKeyBinding[O];return E.$keyChain&&(E.$keyChain+=" "+O,R=this.commandKeyBinding[E.$keyChain]||R),!R||R!="chainKeys"&&R[R.length-1]!="chainKeys"?(E.$keyChain&&(w&&w!=4||T.length!=1?(w==-1||k>0)&&(E.$keyChain=""):E.$keyChain=E.$keyChain.slice(0,-O.length-1)),{command:R}):(E.$keyChain=E.$keyChain||O,{command:"null"})}},this.getStatusText=function(E,w){return w.$keyChain||""}}.call(g.prototype),l.HashHandler=g,l.MultiHashHandler=y}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(a,l,c){var u=a("../lib/oop"),d=a("../keyboard/hash_handler").MultiHashHandler,m=a("../lib/event_emitter").EventEmitter,g=function(y,_){d.call(this,_,y),this.byName=this.commands,this.setDefaultHandler("exec",function(E){return E.command.exec(E.editor,E.args||{})})};u.inherits(g,d),function(){u.implement(this,m),this.exec=function(y,_,E){if(Array.isArray(y)){for(var w=y.length;w--;)if(this.exec(y[w],_,E))return!0;return!1}if(typeof y=="string"&&(y=this.commands[y]),!y||_&&_.$readOnly&&!y.readOnly)return!1;var T={editor:_,command:y,args:E};return T.returnValue=this._emit("exec",T),this._signal("afterExec",T),T.returnValue!==!1},this.toggleRecording=function(y){if(!this.$inReplay)return y&&y._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(_){this.macro.push([_.command,_.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(y){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(y);try{this.$inReplay=!0,this.macro.forEach(function(_){typeof _=="string"?this.exec(_,y):this.exec(_[0],y,_[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(y){return y.map(function(_){return typeof _[0]!="string"&&(_[0]=_[0].name),_[1]||(_=_[0]),_})}}.call(g.prototype),l.CommandManager=g}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(a,l,c){var u=a("../lib/lang"),d=a("../config"),m=a("../range").Range;function g(y,_){return{win:y,mac:_}}l.commands=[{name:"showSettingsMenu",bindKey:g("Ctrl-,","Command-,"),exec:function(y){d.loadModule("ace/ext/settings_menu",function(_){_.init(y),y.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:g("Alt-E","Ctrl-E"),exec:function(y){d.loadModule("ace/ext/error_marker",function(_){_.showErrorMarker(y,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:g("Alt-Shift-E","Ctrl-Shift-E"),exec:function(y){d.loadModule("ace/ext/error_marker",function(_){_.showErrorMarker(y,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",bindKey:g("Ctrl-A","Command-A"),exec:function(y){y.selectAll()},readOnly:!0},{name:"centerselection",bindKey:g(null,"Ctrl-L"),exec:function(y){y.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:g("Ctrl-L","Command-L"),exec:function(y){var _=parseInt(prompt("Enter line number:"),10);isNaN(_)||y.gotoLine(_)},readOnly:!0},{name:"fold",bindKey:g("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(y){y.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:g("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(y){y.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:g("F2","F2"),exec:function(y){y.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:g("Alt-F2","Alt-F2"),exec:function(y){y.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",bindKey:g(null,"Ctrl-Command-Option-0"),exec:function(y){y.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",bindKey:g("Alt-0","Command-Option-0"),exec:function(y){y.session.foldAll(),y.session.unfold(y.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",bindKey:g("Alt-Shift-0","Command-Option-Shift-0"),exec:function(y){y.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",bindKey:g("Ctrl-K","Command-G"),exec:function(y){y.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",bindKey:g("Ctrl-Shift-K","Command-Shift-G"),exec:function(y){y.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",bindKey:g("Alt-K","Ctrl-G"),exec:function(y){y.selection.isEmpty()?y.selection.selectWord():y.findNext()},readOnly:!0},{name:"selectOrFindPrevious",bindKey:g("Alt-Shift-K","Ctrl-Shift-G"),exec:function(y){y.selection.isEmpty()?y.selection.selectWord():y.findPrevious()},readOnly:!0},{name:"find",bindKey:g("Ctrl-F","Command-F"),exec:function(y){d.loadModule("ace/ext/searchbox",function(_){_.Search(y)})},readOnly:!0},{name:"overwrite",bindKey:"Insert",exec:function(y){y.toggleOverwrite()},readOnly:!0},{name:"selecttostart",bindKey:g("Ctrl-Shift-Home","Command-Shift-Up"),exec:function(y){y.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",bindKey:g("Ctrl-Home","Command-Home|Command-Up"),exec:function(y){y.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",bindKey:g("Shift-Up","Shift-Up"),exec:function(y){y.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",bindKey:g("Up","Up|Ctrl-P"),exec:function(y,_){y.navigateUp(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",bindKey:g("Ctrl-Shift-End","Command-Shift-Down"),exec:function(y){y.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",bindKey:g("Ctrl-End","Command-End|Command-Down"),exec:function(y){y.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",bindKey:g("Shift-Down","Shift-Down"),exec:function(y){y.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",bindKey:g("Down","Down|Ctrl-N"),exec:function(y,_){y.navigateDown(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",bindKey:g("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(y){y.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",bindKey:g("Ctrl-Left","Option-Left"),exec:function(y){y.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",bindKey:g("Alt-Shift-Left","Command-Shift-Left"),exec:function(y){y.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",bindKey:g("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(y){y.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",bindKey:g("Shift-Left","Shift-Left"),exec:function(y){y.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",bindKey:g("Left","Left|Ctrl-B"),exec:function(y,_){y.navigateLeft(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",bindKey:g("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(y){y.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",bindKey:g("Ctrl-Right","Option-Right"),exec:function(y){y.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",bindKey:g("Alt-Shift-Right","Command-Shift-Right"),exec:function(y){y.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",bindKey:g("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(y){y.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",bindKey:g("Shift-Right","Shift-Right"),exec:function(y){y.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",bindKey:g("Right","Right|Ctrl-F"),exec:function(y,_){y.navigateRight(_.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(y){y.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:g(null,"Option-PageDown"),exec:function(y){y.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:g("PageDown","PageDown|Ctrl-V"),exec:function(y){y.gotoPageDown()},readOnly:!0},{name:"selectpageup",bindKey:"Shift-PageUp",exec:function(y){y.selectPageUp()},readOnly:!0},{name:"pageup",bindKey:g(null,"Option-PageUp"),exec:function(y){y.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(y){y.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:g("Ctrl-Up",null),exec:function(y){y.renderer.scrollBy(0,-2*y.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:g("Ctrl-Down",null),exec:function(y){y.renderer.scrollBy(0,2*y.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",bindKey:"Shift-Home",exec:function(y){y.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(y){y.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",bindKey:g("Ctrl-Alt-E","Command-Option-E"),exec:function(y){y.commands.toggleRecording(y)},readOnly:!0},{name:"replaymacro",bindKey:g("Ctrl-Shift-E","Command-Shift-E"),exec:function(y){y.commands.replay(y)},readOnly:!0},{name:"jumptomatching",bindKey:g("Ctrl-P","Ctrl-P"),exec:function(y){y.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",bindKey:g("Ctrl-Shift-P","Ctrl-Shift-P"),exec:function(y){y.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",bindKey:g("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(y){y.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",bindKey:g(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",exec:function(y){},readOnly:!0},{name:"cut",exec:function(y){var _=y.getSelectionRange();y._emit("cut",_),y.selection.isEmpty()||(y.session.remove(_),y.clearSelection())},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",exec:function(y,_){y.$handlePaste(_)},scrollIntoView:"cursor"},{name:"removeline",bindKey:g("Ctrl-D","Command-D"),exec:function(y){y.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",bindKey:g("Ctrl-Shift-D","Command-Shift-D"),exec:function(y){y.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",bindKey:g("Ctrl-Alt-S","Command-Alt-S"),exec:function(y){y.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",bindKey:g("Ctrl-/","Command-/"),exec:function(y){y.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",bindKey:g("Ctrl-Shift-/","Command-Shift-/"),exec:function(y){y.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",bindKey:g("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(y){y.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:g("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(y){y.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",bindKey:g("Ctrl-H","Command-Option-F"),exec:function(y){d.loadModule("ace/ext/searchbox",function(_){_.Search(y,!0)})}},{name:"undo",bindKey:g("Ctrl-Z","Command-Z"),exec:function(y){y.undo()}},{name:"redo",bindKey:g("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(y){y.redo()}},{name:"copylinesup",bindKey:g("Alt-Shift-Up","Command-Option-Up"),exec:function(y){y.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",bindKey:g("Alt-Up","Option-Up"),exec:function(y){y.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",bindKey:g("Alt-Shift-Down","Command-Option-Down"),exec:function(y){y.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",bindKey:g("Alt-Down","Option-Down"),exec:function(y){y.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",bindKey:g("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(y){y.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",bindKey:g("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(y){y.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",bindKey:g("Shift-Delete",null),exec:function(y){if(!y.selection.isEmpty())return!1;y.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",bindKey:g("Alt-Backspace","Command-Backspace"),exec:function(y){y.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",bindKey:g("Alt-Delete","Ctrl-K"),exec:function(y){y.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",bindKey:g("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(y){y.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",bindKey:g("Ctrl-Delete","Alt-Delete"),exec:function(y){y.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",bindKey:g("Shift-Tab","Shift-Tab"),exec:function(y){y.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",bindKey:g("Tab","Tab"),exec:function(y){y.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",bindKey:g("Ctrl-[","Ctrl-["),exec:function(y){y.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",bindKey:g("Ctrl-]","Ctrl-]"),exec:function(y){y.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",exec:function(y,_){y.insert(_)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",exec:function(y,_){y.insert(u.stringRepeat(_.text||"",_.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",bindKey:g(null,"Ctrl-O"),exec:function(y){y.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",bindKey:g("Ctrl-T","Ctrl-T"),exec:function(y){y.transposeLetters()},multiSelectAction:function(y){y.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",bindKey:g("Ctrl-U","Ctrl-U"),exec:function(y){y.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",bindKey:g("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(y){y.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",bindKey:g("Ctrl-Shift-L","Command-Shift-L"),exec:function(y){var _=y.selection.getRange();_.start.column=_.end.column=0,_.end.row++,y.selection.setRange(_,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",bindKey:g(null,null),exec:function(y){for(var _=y.selection.isBackwards(),E=_?y.selection.getSelectionLead():y.selection.getSelectionAnchor(),w=_?y.selection.getSelectionAnchor():y.selection.getSelectionLead(),T=y.session.doc.getLine(E.row).length,k=y.session.doc.getTextRange(y.selection.getRange()).replace(/\n\s*/," ").length,O=y.session.doc.getLine(E.row),R=E.row+1;R<=w.row+1;R++){var M=u.stringTrimLeft(u.stringTrimRight(y.session.doc.getLine(R)));M.length!==0&&(M=" "+M),O+=M}w.row+10?(y.selection.moveCursorTo(E.row,E.column),y.selection.selectTo(E.row,E.column+k)):(T=y.session.doc.getLine(E.row).length>T?T+1:T,y.selection.moveCursorTo(E.row,T))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",bindKey:g(null,null),exec:function(y){var _=y.session.doc.getLength()-1,E=y.session.doc.getLine(_).length,w=y.selection.rangeList.ranges,T=[];w.length<1&&(w=[y.selection.getRange()]);for(var k=0;k0&&this.$blockScrolling--;var U=F&&F.scrollIntoView;if(U){switch(U){case"center-animate":U="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var J=this.selection.getRange(),z=this.renderer.layerConfig;(J.start.row>=z.lastRow||J.end.row<=z.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}U=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(L){if(this.$mergeUndoDeltas){var F=this.prevOp,U=this.$mergeableCommands,J=F.command&&L.command.name==F.command.name;if(L.command.name=="insertstring"){var z=L.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),J=J&&this.mergeNextCommand&&(!/\s/.test(z)||/\s/.test(F.args)),this.mergeNextCommand=!0}else J=J&&U.indexOf(L.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(J=!1),J?this.session.mergeUndoDeltas=!0:U.indexOf(L.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(L,F){if(L&&typeof L=="string"){this.$keybindingId=L;var U=this;D.loadModule(["keybinding",L],function(J){U.$keybindingId==L&&U.keyBinding.setKeyboardHandler(J&&J.handler),F&&F()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(L),F&&F()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(L){if(this.session!=L){this.curOp&&this.endOperation(),this.curOp={};var F=this.session;if(F){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var U=this.session.getSelection();U.off("changeCursor",this.$onCursorChange),U.off("changeSelection",this.$onSelectionChange)}this.session=L,L?(this.$onDocumentChange=this.onDocumentChange.bind(this),L.on("change",this.$onDocumentChange),this.renderer.setSession(L),this.$onChangeMode=this.onChangeMode.bind(this),L.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),L.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),L.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),L.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),L.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),L.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=L.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(L)),this._signal("changeSession",{session:L,oldSession:F}),this.curOp=null,F&&F._signal("changeEditor",{oldEditor:this}),L&&L._signal("changeEditor",{editor:this})}},this.getSession=function(){return this.session},this.setValue=function(L,F){return this.session.doc.setValue(L),F?F==1?this.navigateFileEnd():F==-1&&this.navigateFileStart():this.selectAll(),L},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(L){this.renderer.onResize(L)},this.setTheme=function(L,F){this.renderer.setTheme(L,F)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(L){this.renderer.setStyle(L)},this.unsetStyle=function(L){this.renderer.unsetStyle(L)},this.getFontSize=function(){return this.getOption("fontSize")||d.computedStyle(this.container,"fontSize")},this.setFontSize=function(L){this.setOption("fontSize",L)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var L=this;this.$highlightPending=!0,setTimeout(function(){L.$highlightPending=!1;var F=L.session;if(F&&F.bgTokenizer){var U=F.findMatchingBracket(L.getCursorPosition());if(U)var J=new O(U.row,U.column,U.row,U.column+1);else F.$mode.getMatching&&(J=F.$mode.getMatching(L.session));J&&(F.$bracketHighlight=F.addMarker(J,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var L=this;this.$highlightTagPending=!0,setTimeout(function(){L.$highlightTagPending=!1;var F=L.session;if(F&&F.bgTokenizer){var U=L.getCursorPosition(),J=new P(L.session,U.row,U.column),z=J.getCurrentToken();if(!z||!/\b(?:tag-open|tag-name)/.test(z.type))return F.removeMarker(F.$tagHighlight),void(F.$tagHighlight=null);if(z.type.indexOf("tag-open")==-1||(z=J.stepForward())){var ie=z.value,ce=0,Y=J.stepBackward();if(Y.value=="<")do Y=z,(z=J.stepForward())&&z.value===ie&&z.type.indexOf("tag-name")!==-1&&(Y.value==="<"?ce++:Y.value==="=0);else{do z=Y,Y=J.stepBackward(),z&&z.value===ie&&z.type.indexOf("tag-name")!==-1&&(Y.value==="<"?ce++:Y.value==="1||(L=!1)),F.$highlightLineMarker&&!L)F.removeMarker(F.$highlightLineMarker.id),F.$highlightLineMarker=null;else if(!F.$highlightLineMarker&&L){var U=new O(L.row,L.column,L.row,1/0);U.id=F.addMarker(U,"ace_active-line","screenLine"),F.$highlightLineMarker=U}else L&&(F.$highlightLineMarker.start.row=L.row,F.$highlightLineMarker.end.row=L.row,F.$highlightLineMarker.start.column=L.column,F._signal("changeBackMarker"))},this.onSelectionChange=function(L){var F=this.session;if(F.$selectionMarker&&F.removeMarker(F.$selectionMarker),F.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var U=this.selection.getRange(),J=this.getSelectionStyle();F.$selectionMarker=F.addMarker(U,"ace_selection",J)}var z=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(z),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var L=this.session,F=this.getSelectionRange();if(!F.isEmpty()&&!F.isMultiLine()){var U=F.start.column-1,J=F.end.column+1,z=L.getLine(F.start.row),ie=z.length,ce=z.substring(Math.max(U,0),Math.min(J,ie));if(!(U>=0&&/^[\w\d]/.test(ce)||J<=ie&&/[\w\d]$/.test(ce))&&(ce=z.substring(F.start.column,F.end.column),/^[\w\d]+$/.test(ce)))return this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:ce})}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(L){this.renderer.updateText(),this._emit("changeMode",L)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var L=this.getSelectedText();return this._signal("copy",L),L},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(L,F){var U={text:L,event:F};this.commands.exec("paste",this,U)},this.$handlePaste=function(L){typeof L=="string"&&(L={text:L}),this._signal("paste",L);var F=L.text;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)this.insert(F);else{var U=F.split(/\r\n|\r|\n/),J=this.selection.rangeList.ranges;if(U.length>J.length||U.length<2||!U[1])return this.commands.exec("insertstring",this,F);for(var z=J.length;z--;){var ie=J[z];ie.isEmpty()||this.session.remove(ie),this.session.insert(ie.start,U[z])}}},this.execCommand=function(L,F){return this.commands.exec(L,this,F)},this.insert=function(L,F){var U=this.session,J=U.getMode(),z=this.getCursorPosition();if(this.getBehavioursEnabled()&&!F){var ie=J.transformAction(U.getState(z.row),"insertion",this,U,L);ie&&(L!==ie.text&&(this.session.mergeUndoDeltas=!1,this.$mergeNextCommand=!1),L=ie.text)}if(L==" "&&(L=this.session.getTabString()),this.selection.isEmpty())this.session.getOverwrite()&&((ce=new O.fromPoints(z,z)).end.column+=L.length,this.session.remove(ce));else{var ce=this.getSelectionRange();z=this.session.remove(ce),this.clearSelection()}if(L==` -`||L==`\r -`){var Y=U.getLine(z.row);if(z.column>Y.search(/\S|$/)){var B=Y.substr(z.column).search(/\S|$/);U.doc.removeInLine(z.row,z.column,z.column+B)}}this.clearSelection();var V=z.column,Ge=U.getState(z.row),St=(Y=U.getLine(z.row),J.checkOutdent(Ge,Y,L));if(U.insert(z,L),ie&&ie.selection&&(ie.selection.length==2?this.selection.setSelectionRange(new O(z.row,V+ie.selection[0],z.row,V+ie.selection[1])):this.selection.setSelectionRange(new O(z.row+ie.selection[0],ie.selection[1],z.row+ie.selection[2],ie.selection[3]))),U.getDocument().isNewLine(L)){var Dee=J.getNextLineIndent(Ge,Y.slice(0,z.column),U.getTabString());U.insert({row:z.row+1,column:0},Dee)}St&&J.autoOutdent(Ge,U,z.row)},this.onTextInput=function(L){this.keyBinding.onTextInput(L)},this.onCommandKey=function(L,F,U){this.keyBinding.onCommandKey(L,F,U)},this.setOverwrite=function(L){this.session.setOverwrite(L)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(L){this.setOption("scrollSpeed",L)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(L){this.setOption("dragDelay",L)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(L){this.setOption("selectionStyle",L)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(L){this.setOption("highlightActiveLine",L)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(L){this.setOption("highlightGutterLine",L)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(L){this.setOption("highlightSelectedWord",L)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(L){this.renderer.setAnimatedScroll(L)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(L){this.renderer.setShowInvisibles(L)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(L){this.renderer.setDisplayIndentGuides(L)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(L){this.renderer.setShowPrintMargin(L)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(L){this.renderer.setPrintMarginColumn(L)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(L){this.setOption("readOnly",L)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(L){this.setOption("behavioursEnabled",L)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(L){this.setOption("wrapBehavioursEnabled",L)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(L){this.setOption("showFoldWidgets",L)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(L){this.setOption("fadeFoldWidgets",L)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(L){this.selection.isEmpty()&&(L=="left"?this.selection.selectLeft():this.selection.selectRight());var F=this.getSelectionRange();if(this.getBehavioursEnabled()){var U=this.session,J=U.getState(F.start.row),z=U.getMode().transformAction(J,"deletion",this,U,F);if(F.end.column===0){var ie=U.getTextRange(F);if(ie[ie.length-1]==` -`){var ce=U.getLine(F.end.row);/^\s+$/.test(ce)&&(F.end.column=ce.length)}}z&&(F=z)}this.session.remove(F),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var L=this.getSelectionRange();L.start.column==L.end.column&&L.start.row==L.end.row&&(L.end.column=0,L.end.row++),this.session.remove(L),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var L=this.getCursorPosition();this.insert(` -`),this.moveCursorToPosition(L)},this.transposeLetters=function(){if(this.selection.isEmpty()){var L=this.getCursorPosition(),F=L.column;if(F!==0){var U,J,z=this.session.getLine(L.row);FY.toLowerCase()?1:0});for(var J=new O(0,0,0,0),z=L.first;z<=L.last;z++){var ie=F.getLine(z);J.start.row=z,J.end.row=z,J.end.column=ie.length,F.replace(J,U[z-L.first])}},this.toggleCommentLines=function(){var L=this.session.getState(this.getCursorPosition().row),F=this.$getSelectedRows();this.session.getMode().toggleCommentLines(L,this.session,F.first,F.last)},this.toggleBlockComment=function(){var L=this.getCursorPosition(),F=this.session.getState(L.row),U=this.getSelectionRange();this.session.getMode().toggleBlockComment(F,this.session,U,L)},this.getNumberAt=function(L,F){var U=/[\-]?[0-9]+(?:\.[0-9]+)?/g;U.lastIndex=0;for(var J=this.session.getLine(L);U.lastIndex=F)return{value:z[0],start:z.index,end:z.index+z[0].length}}return null},this.modifyNumber=function(L){var F=this.selection.getCursor().row,U=this.selection.getCursor().column,J=new O(F,U-1,F,U),z=this.session.getTextRange(J);if(!isNaN(parseFloat(z))&&isFinite(z)){var ie=this.getNumberAt(F,U);if(ie){var ce=ie.value.indexOf(".")>=0?ie.start+ie.value.indexOf(".")+1:ie.end,Y=ie.start+ie.value.length-ce,B=parseFloat(ie.value);B*=Math.pow(10,Y),ce!==ie.end&&Upee+1)break;pee=jr.last}for(Ge--,Y=this.session.$moveLines(Dee,pee,F?0:L),F&&L==-1&&(St=Ge+1);St<=Ge;)ce[St].moveBy(Y,0),St++;F||(Y=0),B+=Y}z.fromOrientedRange(z.ranges[0]),z.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(L){return L=(L||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(L.start.row),last:this.session.getRowFoldEnd(L.end.row)}},this.onCompositionStart=function(L){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(L){this.renderer.setCompositionText(L)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(L){return L>=this.getFirstVisibleRow()&&L<=this.getLastVisibleRow()},this.isRowFullyVisible=function(L){return L>=this.renderer.getFirstFullyVisibleRow()&&L<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(L,F){var U=this.renderer,J=this.renderer.layerConfig,z=L*Math.floor(J.height/J.lineHeight);this.$blockScrolling++,F===!0?this.selection.$moveSelection(function(){this.moveCursorBy(z,0)}):F===!1&&(this.selection.moveCursorBy(z,0),this.selection.clearSelection()),this.$blockScrolling--;var ie=U.scrollTop;U.scrollBy(0,z*J.lineHeight),F!=null&&U.scrollCursorIntoView(null,.5),U.animateScrolling(ie)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(L){this.renderer.scrollToRow(L)},this.scrollToLine=function(L,F,U,J){this.renderer.scrollToLine(L,F,U,J)},this.centerSelection=function(){var L=this.getSelectionRange(),F={row:Math.floor(L.start.row+(L.end.row-L.start.row)/2),column:Math.floor(L.start.column+(L.end.column-L.start.column)/2)};this.renderer.alignCursor(F,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(L,F){this.selection.moveCursorTo(L,F)},this.moveCursorToPosition=function(L){this.selection.moveCursorToPosition(L)},this.jumpToMatching=function(L,F){var U=this.getCursorPosition(),J=new P(this.session,U.row,U.column),z=J.getCurrentToken(),ie=z||J.stepForward();if(ie){var ce,Y,B=!1,V={},Ge=U.column-ie.start,St={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(ie.value.match(/[{}()\[\]]/g)){for(;Ge=0;--ie)this.$tryReplace(U[ie],L)&&J++;return this.selection.setSelectionRange(z),this.$blockScrolling-=1,J},this.$tryReplace=function(L,F){var U=this.session.getTextRange(L);return(F=this.$search.replace(U,F))!==null?(L.end=this.session.replace(L,F),L):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(L,F,U){F||(F={}),typeof L=="string"||L instanceof RegExp?F.needle=L:_typeof(L)=="object"&&u.mixin(F,L);var J=this.selection.getRange();F.needle==null&&((L=this.session.getTextRange(J)||this.$search.$options.needle)||(J=this.session.getWordRange(J.start.row,J.start.column),L=this.session.getTextRange(J)),this.$search.set({needle:L})),this.$search.set(F),F.start||this.$search.set({start:J});var z=this.$search.find(this.session);return F.preventScroll?z:z?(this.revealRange(z,U),z):(F.backwards?J.start=J.end:J.end=J.start,void this.selection.setRange(J))},this.findNext=function(L,F){this.find({skipCurrent:!0,backwards:!1},L,F)},this.findPrevious=function(L,F){this.find(L,{skipCurrent:!0,backwards:!0},F)},this.revealRange=function(L,F){this.$blockScrolling+=1,this.session.unfold(L),this.selection.setSelectionRange(L),this.$blockScrolling-=1;var U=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(L.start,L.end,.5),F!==!1&&this.renderer.animateScrolling(U)},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(L){if(L){var F,U=this,J=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var z=this.$scrollAnchor;z.style.cssText="position:absolute",this.container.insertBefore(z,this.container.firstChild);var ie=this.on("changeSelection",function(){J=!0}),ce=this.renderer.on("beforeRender",function(){J&&(F=U.renderer.container.getBoundingClientRect())}),Y=this.renderer.on("afterRender",function(){if(J&&F&&(U.isFocused()||U.searchBox&&U.searchBox.isFocused())){var B=U.renderer,V=B.$cursorLayer.$pixelPos,Ge=B.layerConfig,St=V.top-Ge.offset;(J=V.top>=0&&St+F.top<0||!(V.topwindow.innerHeight)&&null)!=null&&(z.style.top=St+"px",z.style.left=V.left+"px",z.style.height=Ge.lineHeight+"px",z.scrollIntoView(J)),J=F=null}});this.setAutoScrollEditorIntoView=function(B){B||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",ie),this.renderer.off("afterRender",Y),this.renderer.off("beforeRender",ce))}}},this.$resetCursorStyle=function(){var L=this.$cursorStyle||"ace",F=this.renderer.$cursorLayer;F&&(F.setSmoothBlinking(/smooth/.test(L)),F.isBlinking=!this.$readOnly&&L!="wide",d.setCssClass(F.element,"ace_slim-cursors",/slim/.test(L)))}}).call(I.prototype),D.defineOptions(I.prototype,"editor",{selectionStyle:{set:function(L){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:L})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(L){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(L){this.$resetCursorStyle()},initialValue:!1},cursorStyle:{set:function(L){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(L){this.setAutoScrollEditorIntoView(L)}},keyboardHandler:{set:function(L){this.setKeyboardHandler(L)},get:function(){return this.keybindingId},handlesSet:!0},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",showLineNumbers:"renderer",showGutter:"renderer",displayIndentGuides:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"}),l.Editor=I}),ace.define("ace/undomanager",["require","exports","module"],function(a,l,c){var u=function(){this.reset()};(function(){function d(y){return{action:y.action,start:y.start,end:y.end,lines:y.lines.length==1?null:y.lines,text:y.lines.length==1?y.lines[0]:null}}function m(y){return{action:y.action,start:y.start,end:y.end,lines:y.lines||[y.text]}}function g(y,_){for(var E=new Array(y.length),w=0;w0},this.hasRedo=function(){return this.$redoStack.length>0},this.markClean=function(){this.dirtyCounter=0},this.isClean=function(){return this.dirtyCounter===0},this.$serializeDeltas=function(y){return g(y,d)},this.$deserializeDeltas=function(y){return g(y,m)}}).call(u.prototype),l.UndoManager=u}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter"],function(a,l,c){var u=a("../lib/dom"),d=a("../lib/oop"),m=a("../lib/lang"),g=a("../lib/event_emitter").EventEmitter,y=function(_){this.element=u.createElement("div"),this.element.className="ace_layer ace_gutter-layer",_.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$cells=[]};(function(){d.implement(this,g),this.setSession=function(_){this.session&&this.session.removeEventListener("change",this.$updateAnnotations),this.session=_,_&&_.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(_,E){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(_,E)},this.removeGutterDecoration=function(_,E){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(_,E)},this.setAnnotations=function(_){this.$annotations=[];for(var E=0;E<_.length;E++){var w=_[E],T=w.row,k=this.$annotations[T];k||(k=this.$annotations[T]={text:[]});var O=w.text;O=O?m.escapeHTML(O):w.html||"",k.text.indexOf(O)===-1&&k.text.push(O);var R=w.type;R=="error"?k.className=" ace_error":R=="warning"&&k.className!=" ace_error"?k.className=" ace_warning":R!="info"||k.className||(k.className=" ace_info")}},this.$updateAnnotations=function(_){if(this.$annotations.length){var E=_.start.row,w=_.end.row-E;if(w!==0)if(_.action=="remove")this.$annotations.splice(E,w+1,null);else{var T=new Array(w+1);T.unshift(E,1),this.$annotations.splice.apply(this.$annotations,T)}}},this.update=function(_){for(var E=this.session,w=_.firstRow,T=Math.min(_.lastRow+_.gutterOffset,E.getLength()-1),k=E.getNextFoldLine(w),O=k?k.start.row:1/0,R=this.$showFoldWidgets&&E.foldWidgets,M=E.$breakpoints,N=E.$decorations,D=E.$firstLineNumber,P=0,I=E.gutterRenderer||this.$renderer,L=null,F=-1,U=w;;){if(U>O&&(U=k.end.row+1,O=(k=E.getNextFoldLine(U,k))?k.start.row:1/0),U>T){for(;this.$cells.length>F+1;)L=this.$cells.pop(),this.element.removeChild(L.element);break}(L=this.$cells[++F])||((L={element:null,textNode:null,foldWidget:null}).element=u.createElement("div"),L.textNode=document.createTextNode(""),L.element.appendChild(L.textNode),this.element.appendChild(L.element),this.$cells[F]=L);var J="ace_gutter-cell ";if(M[U]&&(J+=M[U]),N[U]&&(J+=N[U]),this.$annotations[U]&&(J+=this.$annotations[U].className),L.element.className!=J&&(L.element.className=J),(ie=E.getRowLength(U)*_.lineHeight+"px")!=L.element.style.height&&(L.element.style.height=ie),R){var z=R[U];z==null&&(z=R[U]=E.getFoldWidget(U))}if(z){L.foldWidget||(L.foldWidget=u.createElement("span"),L.element.appendChild(L.foldWidget)),J="ace_fold-widget ace_"+z,z=="start"&&U==O&&Uw.right-E.right?"foldWidgets":void 0}}).call(y.prototype),l.Gutter=y}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(a,l,c){var u=a("../range").Range,d=a("../lib/dom"),m=function(g){this.element=d.createElement("div"),this.element.className="ace_layer ace_marker-layer",g.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(g){this.$padding=g},this.setSession=function(g){this.session=g},this.setMarkers=function(g){this.markers=g},this.update=function(g){if(g=g||this.config){this.config=g;var y=[];for(var _ in this.markers){var E=this.markers[_];if(E.range){var w=E.range.clipRows(g.firstRow,g.lastRow);if(!w.isEmpty())if(w=w.toScreenRange(this.session),E.renderer){var T=this.$getTop(w.start.row,g),k=this.$padding+w.start.column*g.characterWidth;E.renderer(y,w,k,T,g)}else E.type=="fullLine"?this.drawFullLineMarker(y,w,E.clazz,g):E.type=="screenLine"?this.drawScreenLineMarker(y,w,E.clazz,g):w.isMultiLine()?E.type=="text"?this.drawTextMarker(y,w,E.clazz,g):this.drawMultiLineMarker(y,w,E.clazz,g):this.drawSingleLineMarker(y,w,E.clazz+" ace_start ace_br15",g)}else E.update(y,this,this.session,g)}this.element.innerHTML=y.join("")}},this.$getTop=function(g,y){return(g-y.firstRowScreen)*y.lineHeight},this.drawTextMarker=function(g,y,_,E,w){for(var T=this.session,k=y.start.row,O=y.end.row,R=k,M=0,N=0,D=T.getScreenLastRowColumn(R),P=new u(R,y.start.column,R,N);R<=O;R++)P.start.row=P.end.row=R,P.start.column=R==k?y.start.column:T.getRowWrapIndent(R),P.end.column=D,M=N,N=D,D=R+1D?4:0)|(R==O?8:0)),E,R==O?0:1,w)},this.drawMultiLineMarker=function(g,y,_,E,w){var T=this.$padding,k=E.lineHeight,O=this.$getTop(y.start.row,E),R=T+y.start.column*E.characterWidth;w=w||"",g.push("
"),O=this.$getTop(y.end.row,E);var M=y.end.column*E.characterWidth;if(g.push("
"),!((k=(y.end.row-y.start.row-1)*E.lineHeight)<=0)){O=this.$getTop(y.start.row+1,E);var N=(y.start.column?1:0)|(y.end.column?0:8);g.push("
")}},this.drawSingleLineMarker=function(g,y,_,E,w,T){var k=E.lineHeight,O=(y.end.column+(w||0)-y.start.column)*E.characterWidth,R=this.$getTop(y.start.row,E),M=this.$padding+y.start.column*E.characterWidth;g.push("
")},this.drawFullLineMarker=function(g,y,_,E,w){var T=this.$getTop(y.start.row,E),k=E.lineHeight;y.start.row!=y.end.row&&(k+=this.$getTop(y.end.row,E)-T),g.push("
")},this.drawScreenLineMarker=function(g,y,_,E,w){var T=this.$getTop(y.start.row,E),k=E.lineHeight;g.push("
")}}).call(m.prototype),l.Marker=m}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(a,l,c){var u=a("../lib/oop"),d=a("../lib/dom"),m=a("../lib/lang");a("../lib/useragent");var g=a("../lib/event_emitter").EventEmitter,y=function(_){this.element=d.createElement("div"),this.element.className="ace_layer ace_text-layer",_.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this)};(function(){u.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.$updateEolChar=function(){var _=this.session.doc.getNewLineCharacter()==` -`?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=_)return this.EOL_CHAR=_,!0},this.setPadding=function(_){this.$padding=_,this.element.style.padding="0 "+_+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(_){this.$fontMetrics=_,this.$fontMetrics.on("changeCharacterSize",function(E){this._signal("changeCharacterSize",E)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(_){this.session=_,_&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(_){return this.showInvisibles!=_&&(this.showInvisibles=_,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(_){return this.displayIndentGuides!=_&&(this.displayIndentGuides=_,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var _=this.session.getTabSize();this.tabSize=_;for(var E=this.$tabStrings=[0],w=1;w<_+1;w++)this.showInvisibles?E.push(""+m.stringRepeat(this.TAB_CHAR,w)+""):E.push(m.stringRepeat(" ",w));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var T="ace_indent-guide",k="",O="";if(this.showInvisibles){T+=" ace_invisible",k=" ace_invisible_space",O=" ace_invisible_tab";var R=m.stringRepeat(this.SPACE_CHAR,this.tabSize),M=m.stringRepeat(this.TAB_CHAR,this.tabSize)}else M=R=m.stringRepeat(" ",this.tabSize);this.$tabStrings[" "]=""+R+"",this.$tabStrings[" "]=""+M+""}},this.updateLines=function(_,E,w){this.config.lastRow==_.lastRow&&this.config.firstRow==_.firstRow||this.scrollLines(_),this.config=_;for(var T=Math.max(E,_.firstRow),k=Math.min(w,_.lastRow),O=this.element.childNodes,R=0,M=_.firstRow;MD&&(M=N.end.row+1,D=(N=this.session.getNextFoldLine(M,N))?N.start.row:1/0),!(M>k);){var P=O[R++];if(P){var I=[];this.$renderLine(I,M,!this.$useLineGroups(),M==D&&N),P.style.height=_.lineHeight*this.session.getRowLength(M)+"px",P.innerHTML=I.join("")}M++}},this.scrollLines=function(_){var E=this.config;if(this.config=_,!E||E.lastRow<_.firstRow)return this.update(_);if(_.lastRow0;T--)w.removeChild(w.firstChild);if(E.lastRow>_.lastRow)for(T=this.session.getFoldedRowCount(_.lastRow+1,E.lastRow);T>0;T--)w.removeChild(w.lastChild);if(_.firstRowE.lastRow&&(k=this.$renderLinesFragment(_,E.lastRow+1,_.lastRow),w.appendChild(k))},this.$renderLinesFragment=function(_,E,w){for(var T=this.element.ownerDocument.createDocumentFragment(),k=E,O=this.session.getNextFoldLine(k),R=O?O.start.row:1/0;k>R&&(k=O.end.row+1,R=(O=this.session.getNextFoldLine(k,O))?O.start.row:1/0),!(k>w);){var M=d.createElement("div"),N=[];if(this.$renderLine(N,k,!1,k==R&&O),M.innerHTML=N.join(""),this.$useLineGroups())M.className="ace_line_group",T.appendChild(M),M.style.height=_.lineHeight*this.session.getRowLength(k)+"px";else for(;M.firstChild;)T.appendChild(M.firstChild);k++}return T},this.update=function(_){this.config=_;for(var E=[],w=_.firstRow,T=_.lastRow,k=w,O=this.session.getNextFoldLine(k),R=O?O.start.row:1/0;k>R&&(k=O.end.row+1,R=(O=this.session.getNextFoldLine(k,O))?O.start.row:1/0),!(k>T);)this.$useLineGroups()&&E.push("
"),this.$renderLine(E,k,!1,k==R&&O),this.$useLineGroups()&&E.push("
"),k++;this.element.innerHTML=E.join("")},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(_,E,w,T){var k=this,O=T.replace(/\t|&|<|>|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF\uFFF9-\uFFFC])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g,function(N,D,P,I,L){if(D)return k.showInvisibles?""+m.stringRepeat(k.SPACE_CHAR,N.length)+"":N;if(N=="&")return"&";if(N=="<")return"<";if(N==">")return">";if(N==" "){var F=k.session.getScreenTabSize(E+I);return E+=F-1,k.$tabStrings[F]}if(N==" "){var U=k.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",J=k.showInvisibles?k.SPACE_CHAR:"";return E+=1,""+J+""}return P?""+k.SPACE_CHAR+"":(E+=1,""+N+"")});if(this.$textToken[w.type])_.push(O);else{var R="ace_"+w.type.replace(/\./g," ace_"),M="";w.type=="fold"&&(M=" style='width:"+w.value.length*this.config.characterWidth+"px;' "),_.push("",O,"")}return E+T.length},this.renderIndentGuide=function(_,E,w){var T=E.search(this.$indentGuideRe);return T<=0||T>=w?E:E[0]==" "?(T-=T%this.tabSize,_.push(m.stringRepeat(this.$tabStrings[" "],T/this.tabSize)),E.substr(T)):E[0]==" "?(_.push(m.stringRepeat(this.$tabStrings[" "],T)),E.substr(T)):E},this.$renderWrappedLine=function(_,E,w,T){for(var k=0,O=0,R=w[0],M=0,N=0;N=R;)M=this.$renderToken(_,M,D,P.substring(0,R-k)),P=P.substring(R-k),k=R,T||_.push("","
"),_.push(m.stringRepeat(" ",w.indent)),M=0,R=w[++O]||Number.MAX_VALUE;P.length!=0&&(k+=P.length,M=this.$renderToken(_,M,D,P))}}},this.$renderSimpleLine=function(_,E){var w=0,T=E[0],k=T.value;this.displayIndentGuides&&(k=this.renderIndentGuide(_,k)),k&&(w=this.$renderToken(_,w,T,k));for(var O=1;O"),k.length){var O=this.session.getRowSplitData(E);O&&O.length?this.$renderWrappedLine(_,k,O,w):this.$renderSimpleLine(_,k)}this.showInvisibles&&(T&&(E=T.end.row),_.push("",E==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,"")),w||_.push("
")},this.$getFoldLineTokens=function(_,E){var w=this.session,T=[],k=w.getTokens(_);return E.walk(function(O,R,M,N,D){O!=null?T.push({type:"fold",value:O}):(D&&(k=w.getTokens(R)),k.length&&function(P,I,L){for(var F=0,U=0;U+P[F].value.lengthL-I&&(J=J.substring(0,L-I)),T.push({type:P[F].type,value:J}),U=I+J.length,F+=1);UL?T.push({type:P[F].type,value:J.substring(0,L-U)}):T.push(P[F]),U+=J.length,F+=1}}(k,N,M))},E.end.row,this.session.getLine(E.end.row).length),T},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(y.prototype),l.Text=y}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(a,l,c){var u,d=a("../lib/dom"),m=function(g){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",g.appendChild(this.element),u===void 0&&(u=!("opacity"in this.element.style)),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),d.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=(u?this.$updateVisibility:this.$updateOpacity).bind(this)};(function(){this.$updateVisibility=function(g){for(var y=this.cursors,_=y.length;_--;)y[_].style.visibility=g?"":"hidden"},this.$updateOpacity=function(g){for(var y=this.cursors,_=y.length;_--;)y[_].style.opacity=g?"":"0"},this.$padding=0,this.setPadding=function(g){this.$padding=g},this.setSession=function(g){this.session=g},this.setBlinking=function(g){g!=this.isBlinking&&(this.isBlinking=g,this.restartTimer())},this.setBlinkInterval=function(g){g!=this.blinkInterval&&(this.blinkInterval=g,this.restartTimer())},this.setSmoothBlinking=function(g){g==this.smoothBlinking||u||(this.smoothBlinking=g,d.setCssClass(this.element,"ace_smooth-blinking",g),this.$updateCursors(!0),this.$updateCursors=this.$updateOpacity.bind(this),this.restartTimer())},this.addCursor=function(){var g=d.createElement("div");return g.className="ace_cursor",this.element.appendChild(g),this.cursors.push(g),g},this.removeCursor=function(){if(this.cursors.length>1){var g=this.cursors.pop();return g.parentNode.removeChild(g),g}},this.hideCursor=function(){this.isVisible=!1,d.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,d.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var g=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.smoothBlinking&&d.removeCssClass(this.element,"ace_smooth-blinking"),g(!0),this.isBlinking&&this.blinkInterval&&this.isVisible){this.smoothBlinking&&setTimeout(function(){d.addCssClass(this.element,"ace_smooth-blinking")}.bind(this));var y=function(){this.timeoutId=setTimeout(function(){g(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){g(!0),y()},this.blinkInterval),y()}},this.getPixelPosition=function(g,y){if(!this.config||!this.session)return{left:0,top:0};g||(g=this.session.selection.getCursor());var _=this.session.documentToScreenPosition(g);return{left:this.$padding+_.column*this.config.characterWidth,top:(_.row-(y?this.config.firstRowScreen:0))*this.config.lineHeight}},this.update=function(g){this.config=g;var y=this.session.$selectionMarkers,_=0,E=0;y!==void 0&&y.length!==0||(y=[{cursor:null}]),_=0;for(var w=y.length;_g.height+g.offset||T.top<0)&&_>1)){var k=(this.cursors[E++]||this.addCursor()).style;this.drawCursor?this.drawCursor(k,T,g,y[_],this.session):(k.left=T.left+"px",k.top=T.top+"px",k.width=g.characterWidth+"px",k.height=g.lineHeight+"px")}}for(;this.cursors.length>E;)this.removeCursor();var O=this.session.getOverwrite();this.$setOverwrite(O),this.$pixelPos=T,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(g){g!=this.overwrite&&(this.overwrite=g,g?d.addCssClass(this.element,"ace_overwrite-cursors"):d.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(m.prototype),l.Cursor=m}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(a,l,c){var u=a("./lib/oop"),d=a("./lib/dom"),m=a("./lib/event"),g=a("./lib/event_emitter").EventEmitter,y=function(w){this.element=d.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=d.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),w.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,m.addListener(this.element,"scroll",this.onScroll.bind(this)),m.addListener(this.element,"mousedown",m.preventDefault)};(function(){u.implement(this,g),this.setVisible=function(w){this.element.style.display=w?"":"none",this.isVisible=w}}).call(y.prototype);var _=function(w,T){y.call(this,w),this.scrollTop=0,T.$scrollbarWidth=this.width=d.scrollbarWidth(w.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px"};u.inherits(_,y),function(){this.classSuffix="-v",this.onScroll=function(){this.skipEvent||(this.scrollTop=this.element.scrollTop,this._emit("scroll",{data:this.scrollTop})),this.skipEvent=!1},this.getWidth=function(){return this.isVisible?this.width:0},this.setHeight=function(w){this.element.style.height=w+"px"},this.setInnerHeight=function(w){this.inner.style.height=w+"px"},this.setScrollHeight=function(w){this.inner.style.height=w+"px"},this.setScrollTop=function(w){this.scrollTop!=w&&(this.skipEvent=!0,this.scrollTop=this.element.scrollTop=w)}}.call(_.prototype);var E=function(w,T){y.call(this,w),this.scrollLeft=0,this.height=T.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};u.inherits(E,y),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(w){this.element.style.width=w+"px"},this.setInnerWidth=function(w){this.inner.style.width=w+"px"},this.setScrollWidth=function(w){this.inner.style.width=w+"px"},this.setScrollLeft=function(w){this.scrollLeft!=w&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=w)}}.call(E.prototype),l.ScrollBar=_,l.ScrollBarV=_,l.ScrollBarH=E,l.VScrollBar=_,l.HScrollBar=E}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(a,l,c){var u=a("./lib/event"),d=function(m,g){this.onRender=m,this.pending=!1,this.changes=0,this.window=g||window};(function(){this.schedule=function(m){if(this.changes=this.changes|m,!this.pending&&this.changes){this.pending=!0;var g=this;u.nextFrame(function(){var y;for(g.pending=!1;y=g.changes;)g.changes=0,g.onRender(y)},this.window)}}}).call(d.prototype),l.RenderLoop=d}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(a,l,c){var u=a("../lib/oop"),d=a("../lib/dom"),m=a("../lib/lang"),g=a("../lib/useragent"),y=a("../lib/event_emitter").EventEmitter,_=0,E=l.FontMetrics=function(w){this.el=d.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=d.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=d.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),w.appendChild(this.el),_||this.$testFractionalRect(),this.$measureNode.innerHTML=m.stringRepeat("X",_),this.$characterSize={width:0,height:0},this.checkForSizeChanges()};(function(){u.implement(this,y),this.$characterSize={width:0,height:0},this.$testFractionalRect=function(){var w=d.createElement("div");this.$setMeasureNodeStyles(w.style),w.style.width="0.2px",document.documentElement.appendChild(w);var T=w.getBoundingClientRect().width;_=T>0&&T<1?50:100,w.parentNode.removeChild(w)},this.$setMeasureNodeStyles=function(w,T){w.width=w.height="auto",w.left=w.top="0px",w.visibility="hidden",w.position="absolute",w.whiteSpace="pre",g.isIE<8?w["font-family"]="inherit":w.font="inherit",w.overflow=T?"hidden":"visible"},this.checkForSizeChanges=function(){var w=this.$measureSizes();if(w&&(this.$characterSize.width!==w.width||this.$characterSize.height!==w.height)){this.$measureNode.style.fontWeight="bold";var T=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=w,this.charSizes=Object.create(null),this.allowBoldFonts=T&&T.width===w.width&&T.height===w.height,this._emit("changeCharacterSize",{data:w})}},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer)return this.$pollSizeChangesTimer;var w=this;return this.$pollSizeChangesTimer=setInterval(function(){w.checkForSizeChanges()},500)},this.setPolling=function(w){w?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(){if(_===50){var w=null;try{w=this.$measureNode.getBoundingClientRect()}catch{w={width:0,height:0}}var T={height:w.height,width:w.width/_}}else T={height:this.$measureNode.clientHeight,width:this.$measureNode.clientWidth/_};return T.width===0||T.height===0?null:T},this.$measureCharWidth=function(w){return this.$main.innerHTML=m.stringRepeat(w,_),this.$main.getBoundingClientRect().width/_},this.getCharacterWidth=function(w){var T=this.charSizes[w];return T===void 0&&(T=this.charSizes[w]=this.$measureCharWidth(w)/this.$characterSize.width),T},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)}}).call(E.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/lib/useragent","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter"],function(a,l,c){var u=a("./lib/oop"),d=a("./lib/dom"),m=a("./config"),g=a("./lib/useragent"),y=a("./layer/gutter").Gutter,_=a("./layer/marker").Marker,E=a("./layer/text").Text,w=a("./layer/cursor").Cursor,T=a("./scrollbar").HScrollBar,k=a("./scrollbar").VScrollBar,O=a("./renderloop").RenderLoop,R=a("./layer/font_metrics").FontMetrics,M=a("./lib/event_emitter").EventEmitter;d.importCssString(`.ace_editor { position: relative; overflow: hidden; font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; direction: ltr; } .ace_scroller { position: absolute; overflow: hidden; top: 0; bottom: 0; background-color: inherit; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; cursor: text; } .ace_content { position: absolute; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; min-width: 100%; } .ace_dragging .ace_scroller:before{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; content: ''; background: rgba(250, 250, 250, 0.01); z-index: 1000; } .ace_dragging.ace_dark .ace_scroller:before{ background: rgba(0, 0, 0, 0.01); } .ace_selecting, .ace_selecting * { cursor: text !important; } .ace_gutter { position: absolute; overflow : hidden; width: auto; top: 0; bottom: 0; left: 0; cursor: default; z-index: 4; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; } .ace_gutter-active-line { position: absolute; left: 0; right: 0; } .ace_scroller.ace_scroll-left { box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset; } .ace_gutter-cell { padding-left: 19px; padding-right: 6px; background-repeat: no-repeat; } .ace_gutter-cell.ace_error { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: 2px center; } .ace_gutter-cell.ace_warning { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg=="); background-position: 2px center; } .ace_gutter-cell.ace_info { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII="); background-position: 2px center; } .ace_dark .ace_gutter-cell.ace_info { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC"); } .ace_scrollbar { position: absolute; right: 0; bottom: 0; z-index: 6; } .ace_scrollbar-inner { position: absolute; cursor: text; left: 0; top: 0; } .ace_scrollbar-v{ overflow-x: hidden; overflow-y: scroll; top: 0; } .ace_scrollbar-h { overflow-x: scroll; overflow-y: hidden; left: 0; } .ace_print-margin { position: absolute; height: 100%; } .ace_text-input { position: absolute; z-index: 0; width: 0.5em; height: 1em; opacity: 0; background: transparent; -moz-appearance: none; appearance: none; border: none; resize: none; outline: none; overflow: hidden; font: inherit; padding: 0 1px; margin: 0 -1px; text-indent: -1em; -ms-user-select: text; -moz-user-select: text; -webkit-user-select: text; user-select: text; white-space: pre!important; } .ace_text-input.ace_composition { background: inherit; color: inherit; z-index: 1000; opacity: 1; text-indent: 0; } .ace_layer { z-index: 1; position: absolute; overflow: hidden; word-wrap: normal; white-space: pre; height: 100%; width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; pointer-events: none; } .ace_gutter-layer { position: relative; width: auto; text-align: right; pointer-events: auto; } .ace_text-layer { font: inherit !important; } .ace_cjk { display: inline-block; text-align: center; } .ace_cursor-layer { z-index: 4; } .ace_cursor { z-index: 4; position: absolute; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; border-left: 2px solid; transform: translatez(0); } .ace_slim-cursors .ace_cursor { border-left-width: 1px; } .ace_overwrite-cursors .ace_cursor { border-left-width: 0; border-bottom: 1px solid; } .ace_hidden-cursors .ace_cursor { opacity: 0.2; } .ace_smooth-blinking .ace_cursor { -webkit-transition: opacity 0.18s; transition: opacity 0.18s; } .ace_editor.ace_multiselect .ace_cursor { border-left-width: 1px; } .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack { position: absolute; z-index: 3; } .ace_marker-layer .ace_selection { position: absolute; z-index: 5; } .ace_marker-layer .ace_bracket { position: absolute; z-index: 6; } .ace_marker-layer .ace_active-line { position: absolute; z-index: 2; } .ace_marker-layer .ace_selected-word { position: absolute; z-index: 4; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ace_line .ace_fold { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; display: inline-block; height: 11px; margin-top: -2px; vertical-align: middle; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII="); background-repeat: no-repeat, repeat-x; background-position: center center, top left; color: transparent; border: 1px solid black; border-radius: 2px; cursor: pointer; pointer-events: auto; } .ace_dark .ace_fold { } .ace_fold:hover{ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC"); } .ace_tooltip { background-color: #FFF; background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1)); background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1)); border: 1px solid gray; border-radius: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); color: black; max-width: 100%; padding: 3px 4px; position: fixed; z-index: 999999; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: default; white-space: pre; word-wrap: break-word; line-height: normal; font-style: normal; font-weight: normal; letter-spacing: normal; pointer-events: none; } .ace_folding-enabled > .ace_gutter-cell { padding-right: 13px; } .ace_fold-widget { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; margin: 0 -12px 0 1px; display: none; width: 11px; vertical-align: top; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: center; border-radius: 3px; border: 1px solid transparent; cursor: pointer; } .ace_folding-enabled .ace_fold-widget { display: inline-block; } .ace_fold-widget.ace_end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg=="); } .ace_fold-widget.ace_closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA=="); } .ace_fold-widget:hover { border: 1px solid rgba(0, 0, 0, 0.3); background-color: rgba(255, 255, 255, 0.2); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); } .ace_fold-widget:active { border: 1px solid rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); } .ace_dark .ace_fold-widget { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC"); } .ace_dark .ace_fold-widget.ace_end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget.ace_closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget:hover { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.1); } .ace_dark .ace_fold-widget:active { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); } .ace_fold-widget.ace_invalid { background-color: #FFB4B4; border-color: #DE5555; } .ace_fade-fold-widgets .ace_fold-widget { -webkit-transition: opacity 0.4s ease 0.05s; transition: opacity 0.4s ease 0.05s; opacity: 0; } .ace_fade-fold-widgets:hover .ace_fold-widget { -webkit-transition: opacity 0.05s ease 0.05s; transition: opacity 0.05s ease 0.05s; opacity:1; } .ace_underline { text-decoration: underline; } .ace_bold { font-weight: bold; } .ace_nobold .ace_bold { font-weight: normal; } .ace_italic { font-style: italic; } .ace_error-marker { background-color: rgba(255, 0, 0,0.2); position: absolute; z-index: 9; } .ace_highlight-marker { background-color: rgba(255, 255, 0,0.2); position: absolute; z-index: 8; } .ace_br1 {border-top-left-radius : 3px;} .ace_br2 {border-top-right-radius : 3px;} .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;} .ace_br4 {border-bottom-right-radius: 3px;} .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;} .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;} .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;} .ace_br8 {border-bottom-left-radius : 3px;} .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;} .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;} .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} `,"ace_editor.css");var N=function(D,P){var I=this;this.container=D||d.createElement("div"),this.$keepTextAreaAtCursor=!g.isOldIE,d.addCssClass(this.container,"ace_editor"),this.setTheme(P),this.$gutter=d.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=d.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=d.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new y(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new _(this.content);var L=this.$textLayer=new E(this.content);this.canvas=L.element,this.$markerFront=new _(this.content),this.$cursorLayer=new w(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new k(this.container,this),this.scrollBarH=new T(this.container,this),this.scrollBarV.addEventListener("scroll",function(F){I.$scrollAnimation||I.session.setScrollTop(F.data-I.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(F){I.$scrollAnimation||I.session.setScrollLeft(F.data-I.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new R(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(F){I.updateCharacterSize(),I.onResize(!0,I.gutterWidth,I.$size.width,I.$size.height),I._signal("changeCharacterSize",F)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$loop=new O(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),m.resetOptions(this),m._emit("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,u.implement(this,M),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(D){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=D,D&&this.scrollMargin.top&&D.getScrollTop()<=0&&D.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(D),this.$markerBack.setSession(D),this.$markerFront.setSession(D),this.$gutterLayer.setSession(D),this.$textLayer.setSession(D),D&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(D,P,I){if(P===void 0&&(P=1/0),this.$changedLines?(this.$changedLines.firstRow>D&&(this.$changedLines.firstRow=D),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar()},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(D){D?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(D,P,I,L){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=D?1:0;var F=this.container;L||(L=F.clientHeight||F.scrollHeight),I||(I=F.clientWidth||F.scrollWidth);var U=this.$updateCachedSize(D,P,I,L);if(!this.$size.scrollerHeight||!I&&!L)return this.resizing=0;D&&(this.$gutterLayer.$padding=null),D?this.$renderChanges(U|this.$changes,!0):this.$loop.schedule(U|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(D,P,I,L){L-=this.$extraHeight||0;var F=0,U=this.$size,J={width:U.width,height:U.height,scrollerHeight:U.scrollerHeight,scrollerWidth:U.scrollerWidth};return L&&(D||U.height!=L)&&(U.height=L,F|=this.CHANGE_SIZE,U.scrollerHeight=U.height,this.$horizScroll&&(U.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",F|=this.CHANGE_SCROLL),I&&(D||U.width!=I)&&(F|=this.CHANGE_SIZE,U.width=I,P==null&&(P=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=P,this.scrollBarH.element.style.left=this.scroller.style.left=P+"px",U.scrollerWidth=Math.max(0,I-P-this.scrollBarV.getWidth()),this.scrollBarH.element.style.right=this.scroller.style.right=this.scrollBarV.getWidth()+"px",this.scroller.style.bottom=this.scrollBarH.getHeight()+"px",(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||D)&&(F|=this.CHANGE_FULL)),U.$dirty=!I||!L,F&&this._signal("resize",J),F},this.onGutterResize=function(){var D=this.$showGutter?this.$gutter.offsetWidth:0;D!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,D,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):(this.$computeLayerConfig(),this.$loop.schedule(this.CHANGE_MARKER))},this.adjustWrapLimit=function(){var D=this.$size.scrollerWidth-2*this.$padding,P=Math.floor(D/this.characterWidth);return this.session.adjustWrapLimit(P,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(D){this.setOption("animatedScroll",D)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(D){this.setOption("showInvisibles",D)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(D){this.setOption("displayIndentGuides",D)},this.setShowPrintMargin=function(D){this.setOption("showPrintMargin",D)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(D){this.setOption("printMarginColumn",D)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(D){return this.setOption("showGutter",D)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(D){this.setOption("fadeFoldWidgets",D)},this.setHighlightGutterLine=function(D){this.setOption("highlightGutterLine",D)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updateGutterLineHighlight=function(){var D=this.$cursorLayer.$pixelPos,P=this.layerConfig.lineHeight;if(this.session.getUseWrapMode()){var I=this.session.selection.getCursor();I.column=0,D=this.$cursorLayer.getPixelPosition(I,!0),P*=this.session.getRowLength(I.row)}this.$gutterLineHighlight.style.top=D.top-this.layerConfig.offset+"px",this.$gutterLineHighlight.style.height=P+"px"},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var D=d.createElement("div");D.className="ace_layer ace_print-margin-layer",this.$printMarginEl=d.createElement("div"),this.$printMarginEl.className="ace_print-margin",D.appendChild(this.$printMarginEl),this.content.insertBefore(D,this.content.firstChild)}var P=this.$printMarginEl.style;P.left=this.characterWidth*this.$printMarginColumn+this.$padding+"px",P.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(this.$keepTextAreaAtCursor){var D=this.layerConfig,P=this.$cursorLayer.$pixelPos.top,I=this.$cursorLayer.$pixelPos.left;P-=D.offset;var L=this.textarea.style,F=this.lineHeight;if(P<0||P>D.height-F)L.top=L.left="0";else{var U=this.characterWidth;if(this.$composition){var J=this.textarea.value.replace(/^\x01+/,"");U*=this.session.$getStringScreenWidth(J)[0]+2,F+=2}(I-=this.scrollLeft)>this.$size.scrollerWidth-U&&(I=this.$size.scrollerWidth-U),I+=this.gutterWidth,L.height=F+"px",L.width=U+"px",L.left=Math.min(I,this.$size.scrollerWidth-U)+"px",L.top=Math.min(P,this.$size.height-F)+"px"}}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var D=this.layerConfig,P=D.lastRow;return this.session.documentToScreenRow(P,0)*D.lineHeight-this.session.getScrollTop()>D.height-D.lineHeight?P-1:P},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(D){this.$padding=D,this.$textLayer.setPadding(D),this.$cursorLayer.setPadding(D),this.$markerFront.setPadding(D),this.$markerBack.setPadding(D),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(D,P,I,L){var F=this.scrollMargin;F.top=0|D,F.bottom=0|P,F.right=0|L,F.left=0|I,F.v=F.top+F.bottom,F.h=F.left+F.right,F.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-F.top),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(D){this.setOption("hScrollBarAlwaysVisible",D)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(D){this.setOption("vScrollBarAlwaysVisible",D)},this.$updateScrollBarV=function(){var D=this.layerConfig.maxHeight,P=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(D-=(P-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>D-P&&(D=this.scrollTop+P,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(D+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(D,P){if(this.$changes&&(D|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(D||P)){if(this.$size.$dirty)return this.$changes|=D,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender");var I=this.layerConfig;if(D&this.CHANGE_FULL||D&this.CHANGE_SIZE||D&this.CHANGE_TEXT||D&this.CHANGE_LINES||D&this.CHANGE_SCROLL||D&this.CHANGE_H_SCROLL){if(D|=this.$computeLayerConfig(),I.firstRow!=this.layerConfig.firstRow&&I.firstRowScreen==this.layerConfig.firstRowScreen){var L=this.scrollTop+(I.firstRow-this.layerConfig.firstRow)*this.lineHeight;L>0&&(this.scrollTop=L,D|=this.CHANGE_SCROLL,D|=this.$computeLayerConfig())}I=this.layerConfig,this.$updateScrollBarV(),D&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),this.$gutterLayer.element.style.marginTop=-I.offset+"px",this.content.style.marginTop=-I.offset+"px",this.content.style.width=I.width+2*this.$padding+"px",this.content.style.height=I.minHeight+"px"}if(D&this.CHANGE_H_SCROLL&&(this.content.style.marginLeft=-this.scrollLeft+"px",this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),D&this.CHANGE_FULL)return this.$textLayer.update(I),this.$showGutter&&this.$gutterLayer.update(I),this.$markerBack.update(I),this.$markerFront.update(I),this.$cursorLayer.update(I),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),void this._signal("afterRender");if(D&this.CHANGE_SCROLL)return D&this.CHANGE_TEXT||D&this.CHANGE_LINES?this.$textLayer.update(I):this.$textLayer.scrollLines(I),this.$showGutter&&this.$gutterLayer.update(I),this.$markerBack.update(I),this.$markerFront.update(I),this.$cursorLayer.update(I),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),this.$moveTextAreaToCursor(),void this._signal("afterRender");D&this.CHANGE_TEXT?(this.$textLayer.update(I),this.$showGutter&&this.$gutterLayer.update(I)):D&this.CHANGE_LINES?(this.$updateLines()||D&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(I):(D&this.CHANGE_TEXT||D&this.CHANGE_GUTTER)&&this.$showGutter&&this.$gutterLayer.update(I),D&this.CHANGE_CURSOR&&(this.$cursorLayer.update(I),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight()),D&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(I),D&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(I),this._signal("afterRender")}else this.$changes|=D},this.$autosize=function(){var D=this.session.getScreenLength()*this.lineHeight,P=this.$maxLines*this.lineHeight,I=Math.max((this.$minLines||1)*this.lineHeight,Math.min(P,D))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(I+=this.scrollBarH.getHeight());var L=D>P;if(I!=this.desiredHeight||this.$size.height!=this.desiredHeight||L!=this.$vScroll){L!=this.$vScroll&&(this.$vScroll=L,this.scrollBarV.setVisible(L));var F=this.container.clientWidth;this.container.style.height=I+"px",this.$updateCachedSize(!0,this.$gutterWidth,F,I),this.desiredHeight=I,this._signal("autosize")}},this.$computeLayerConfig=function(){var D=this.session,P=this.$size,I=P.height<=2*this.lineHeight,L=this.session.getScreenLength()*this.lineHeight,F=this.$getLongestLine(),U=!I&&(this.$hScrollBarAlwaysVisible||P.scrollerWidth-F-2*this.$padding<0),J=this.$horizScroll!==U;J&&(this.$horizScroll=U,this.scrollBarH.setVisible(U));var z=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var ie=this.scrollTop%this.lineHeight,ce=P.scrollerHeight+this.lineHeight,Y=!this.$maxLines&&this.$scrollPastEnd?(P.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;L+=Y;var B=this.scrollMargin;this.session.setScrollTop(Math.max(-B.top,Math.min(this.scrollTop,L-P.scrollerHeight+B.bottom))),this.session.setScrollLeft(Math.max(-B.left,Math.min(this.scrollLeft,F+2*this.$padding-P.scrollerWidth+B.right)));var V=!I&&(this.$vScrollBarAlwaysVisible||P.scrollerHeight-L+Y<0||this.scrollTop>B.top),Ge=z!==V;Ge&&(this.$vScroll=V,this.scrollBarV.setVisible(V));var St,Dee,pee=Math.ceil(ce/this.lineHeight)-1,jr=Math.max(0,Math.round((this.scrollTop-ie)/this.lineHeight)),Tee=jr+pee,et=this.lineHeight;jr=D.screenToDocumentRow(jr,0);var ft=D.getFoldLine(jr);ft&&(jr=ft.start.row),St=D.documentToScreenRow(jr,0),Dee=D.getRowLength(jr)*et,Tee=Math.min(D.screenToDocumentRow(Tee,0),D.getLength()-1),ce=P.scrollerHeight+D.getRowLength(Tee)*et+Dee,ie=this.scrollTop-St*et;var yee=0;return this.layerConfig.width!=F&&(yee=this.CHANGE_H_SCROLL),(J||Ge)&&(yee=this.$updateCachedSize(!0,this.gutterWidth,P.width,P.height),this._signal("scrollbarVisibilityChanged"),Ge&&(F=this.$getLongestLine())),this.layerConfig={width:F,padding:this.$padding,firstRow:jr,firstRowScreen:St,lastRow:Tee,lineHeight:et,characterWidth:this.characterWidth,minHeight:ce,maxHeight:L,offset:ie,gutterOffset:Math.max(0,Math.ceil((ie+P.height-P.scrollerHeight)/et)),height:this.$size.scrollerHeight},yee},this.$updateLines=function(){var D=this.$changedLines.firstRow,P=this.$changedLines.lastRow;this.$changedLines=null;var I=this.layerConfig;if(!(D>I.lastRow+1||PU?(P&&ie+J>U+this.lineHeight&&(U-=P*this.$size.scrollerHeight),U===0&&(U=-this.scrollMargin.top),this.session.setScrollTop(U)):ie+this.$size.scrollerHeight-zF?(F=1-this.scrollMargin.top||P>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||D<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||D>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(D,P){var I=this.scroller.getBoundingClientRect(),L=(D+this.scrollLeft-I.left-this.$padding)/this.characterWidth,F=Math.floor((P+this.scrollTop-I.top)/this.lineHeight),U=Math.round(L);return{row:F,column:U,side:L-U>0?1:-1}},this.screenToTextCoordinates=function(D,P){var I=this.scroller.getBoundingClientRect(),L=Math.round((D+this.scrollLeft-I.left-this.$padding)/this.characterWidth),F=(P+this.scrollTop-I.top)/this.lineHeight;return this.session.screenToDocumentPosition(F,Math.max(L,0))},this.textToScreenCoordinates=function(D,P){var I=this.scroller.getBoundingClientRect(),L=this.session.documentToScreenPosition(D,P),F=this.$padding+Math.round(L.column*this.characterWidth),U=L.row*this.lineHeight;return{pageX:I.left+F-this.scrollLeft,pageY:I.top+U-this.scrollTop}},this.visualizeFocus=function(){d.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){d.removeCssClass(this.container,"ace_focus")},this.showComposition=function(D){this.$composition||(this.$composition={keepTextAreaAtCursor:this.$keepTextAreaAtCursor,cssText:this.textarea.style.cssText}),this.$keepTextAreaAtCursor=!0,d.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor()},this.setCompositionText=function(D){this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(d.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null)},this.setTheme=function(D,P){var I=this;if(this.$themeId=D,I._dispatchEvent("themeChange",{theme:D}),D&&typeof D!="string")F(D);else{var L=D||this.$options.theme.initialValue;m.loadModule(["theme",L],F)}function F(U){if(I.$themeId!=D)return P&&P();if(U.cssClass){d.importCssString(U.cssText,U.cssClass,I.container.ownerDocument),I.theme&&d.removeCssClass(I.container,I.theme.cssClass);var J="padding"in U?U.padding:"padding"in(I.theme||{})?4:I.$padding;I.$padding&&J!=I.$padding&&I.setPadding(J),I.$theme=U.cssClass,I.theme=U,d.addCssClass(I.container,U.cssClass),d.setCssClass(I.container,"ace_dark",U.isDark),I.$size&&(I.$size.width=0,I.$updateSizeAsync()),I._dispatchEvent("themeLoaded",{theme:U}),P&&P()}}},this.getTheme=function(){return this.$themeId},this.setStyle=function(D,P){d.setCssClass(this.container,D,P!==!1)},this.unsetStyle=function(D){d.removeCssClass(this.container,D)},this.setCursorStyle=function(D){this.scroller.style.cursor!=D&&(this.scroller.style.cursor=D)},this.setMouseCursor=function(D){this.scroller.style.cursor=D},this.destroy=function(){this.$textLayer.destroy(),this.$cursorLayer.destroy()}}).call(N.prototype),m.defineOptions(N.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(D){this.$textLayer.setShowInvisibles(D)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(D){typeof D=="number"&&(this.$printMarginColumn=D),this.$showPrintMargin=!!D,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(D){this.$gutter.style.display=D?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(D){d.setCssClass(this.$gutter,"ace_fade-fold-widgets",D)},initialValue:!1},showFoldWidgets:{set:function(D){this.$gutterLayer.setShowFoldWidgets(D)},initialValue:!0},showLineNumbers:{set:function(D){this.$gutterLayer.setShowLineNumbers(D),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(D){this.$textLayer.setDisplayIndentGuides(D)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(D){if(!this.$gutterLineHighlight)return this.$gutterLineHighlight=d.createElement("div"),this.$gutterLineHighlight.className="ace_gutter-active-line",void this.$gutter.appendChild(this.$gutterLineHighlight);this.$gutterLineHighlight.style.display=D?"":"none",this.$cursorLayer.$pixelPos&&this.$updateGutterLineHighlight()},initialValue:!1,value:!0},hScrollBarAlwaysVisible:{set:function(D){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(D){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(D){typeof D=="number"&&(D+="px"),this.container.style.fontSize=D,this.updateFontSize()},initialValue:12},fontFamily:{set:function(D){this.container.style.fontFamily=D,this.updateFontSize()}},maxLines:{set:function(D){this.updateFull()}},minLines:{set:function(D){this.updateFull()}},scrollPastEnd:{set:function(D){D=+D||0,this.$scrollPastEnd!=D&&(this.$scrollPastEnd=D,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(D){this.$gutterLayer.$fixedWidth=!!D,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(D){this.setTheme(D)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0}}),l.VirtualRenderer=N}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(a,l,c){var u=a("../lib/oop"),d=a("../lib/net"),m=a("../lib/event_emitter").EventEmitter,g=a("../config"),y=function(E,w,T,k){if(this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),a.nameToUrl&&!a.toUrl&&(a.toUrl=a.nameToUrl),g.get("packaged")||!a.toUrl)k=k||g.moduleUrl(w.id,"worker");else{var O=this.$normalizePath;k=k||O(a.toUrl("ace/worker/worker.js",null,"_"));var R={};E.forEach(function(L){R[L]=O(a.toUrl(L,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}try{var M=w.src,N=new(s(66))([M],{type:"application/javascript"}),D=(window.URL||window.webkitURL).createObjectURL(N);this.$worker=new Worker(D)}catch(L){if(!(L instanceof window.DOMException))throw L;N=this.$workerBlob(k);var P=window.URL||window.webkitURL,I=P.createObjectURL(N);this.$worker=new Worker(I),P.revokeObjectURL(I)}this.$worker.postMessage({init:!0,tlns:R,module:w.id,classname:T}),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){u.implement(this,m),this.onMessage=function(E){var w=E.data;switch(w.type){case"event":this._signal(w.name,{data:w.data});break;case"call":var T=this.callbacks[w.id];T&&(T(w.data),delete this.callbacks[w.id]);break;case"error":this.reportError(w.data);break;case"log":window.console&&console.log&&console.log.apply(console,w.data)}},this.reportError=function(E){window.console&&console.error&&console.error(E)},this.$normalizePath=function(E){return d.qualifyURL(E)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(E,w){this.$worker.postMessage({command:E,args:w})},this.call=function(E,w,T){if(T){var k=this.callbackId++;this.callbacks[k]=T,w.push(k)}this.send(E,w)},this.emit=function(E,w){try{this.$worker.postMessage({event:E,data:{data:w.data}})}catch(T){console.error(T.stack)}},this.attachToDocument=function(E){this.$doc&&this.terminate(),this.$doc=E,this.call("setValue",[E.getValue()]),E.on("change",this.changeListener)},this.changeListener=function(E){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),E.action=="insert"?this.deltaQueue.push(E.start,E.lines):this.deltaQueue.push(E.start,E.end)},this.$sendDeltaQueue=function(){var E=this.deltaQueue;E&&(this.deltaQueue=null,E.length>50&&E.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:E}))},this.$workerBlob=function(E){var w="importScripts('"+d.qualifyURL(E)+"');";try{return new Blob([w],{type:"application/javascript"})}catch{var T=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return T.append(w),T.getBlob("application/javascript")}}}).call(y.prototype);var _=function(E,w,T){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var k=null,O=!1,R=Object.create(m),M=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(D){M.messageBuffer.push(D),k&&(O?setTimeout(N):N())},this.setEmitSync=function(D){O=D};var N=function(){var D=M.messageBuffer.shift();D.command?k[D.command].apply(k,D.args):D.event&&R._signal(D.event,D.data)};R.postMessage=function(D){M.onMessage({data:D})},R.callback=function(D,P){this.postMessage({type:"call",id:P,data:D})},R.emit=function(D,P){this.postMessage({type:"event",name:D,data:P})},g.loadModule(["worker",w],function(D){for(k=new D[T](R);M.messageBuffer.length;)N()})};_.prototype=y.prototype,l.UIWorkerClient=_,l.WorkerClient=y}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(a,l,c){var u=a("./range").Range,d=a("./lib/event_emitter").EventEmitter,m=a("./lib/oop"),g=function(y,_,E,w,T,k){var O=this;this.length=_,this.session=y,this.doc=y.getDocument(),this.mainClass=T,this.othersClass=k,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=w,this.$onCursorChange=function(){setTimeout(function(){O.onCursorChange()})},this.$pos=E;var R=y.getUndoManager().$undoStack||y.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=R.length,this.setup(),y.selection.on("changeCursor",this.$onCursorChange)};(function(){m.implement(this,d),this.setup=function(){var y=this,_=this.doc,E=this.session;this.selectionBefore=E.selection.toJSON(),E.selection.inMultiSelectMode&&E.selection.toSingleRange(),this.pos=_.createAnchor(this.$pos.row,this.$pos.column);var w=this.pos;w.$insertRight=!0,w.detach(),w.markerId=E.addMarker(new u(w.row,w.column,w.row,w.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(T){var k=_.createAnchor(T.row,T.column);k.$insertRight=!0,k.detach(),y.others.push(k)}),E.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var y=this.session,_=this;this.othersActive=!0,this.others.forEach(function(E){E.markerId=y.addMarker(new u(E.row,E.column,E.row,E.column+_.length),_.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var y=0;y=this.pos.column&&_.start.column<=this.pos.column+this.length+1,T=_.start.column-this.pos.column;if(this.updateAnchors(y),w&&(this.length+=E),w&&!this.session.$fromUndo){if(y.action==="insert")for(var k=this.others.length-1;k>=0;k--){var O={row:(R=this.others[k]).row,column:R.column+T};this.doc.insertMergedLines(O,y.lines)}else if(y.action==="remove")for(k=this.others.length-1;k>=0;k--){var R;O={row:(R=this.others[k]).row,column:R.column+T},this.doc.remove(new u(O.row,O.column,O.row,O.column-E))}}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(y){this.pos.onChange(y);for(var _=this.others.length;_--;)this.others[_].onChange(y);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var y=this,_=this.session,E=function(T,k){_.removeMarker(T.markerId),T.markerId=_.addMarker(new u(T.row,T.column,T.row,T.column+y.length),k,null,!1)};E(this.pos,this.mainClass);for(var w=this.others.length;w--;)E(this.others[w],this.othersClass)}},this.onCursorChange=function(y){if(!this.$updating&&this.session){var _=this.session.selection.getCursor();_.row===this.pos.row&&_.column>=this.pos.column&&_.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",y)):(this.hideOtherMarkers(),this._emit("cursorLeave",y))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(this.$undoStackDepth!==-1){for(var y=this.session.getUndoManager(),_=(y.$undoStack||y.$undostack).length-this.$undoStackDepth,E=0;E<_;E++)y.undo(!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}}).call(g.prototype),l.PlaceHolder=g}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(a,l,c){var u=a("../lib/event"),d=a("../lib/useragent");function m(g,y){return g.row==y.row&&g.column==y.column}l.onMouseDown=function(g){var y=g.domEvent,_=y.altKey,E=y.shiftKey,w=y.ctrlKey,T=g.getAccelKey(),k=g.getButton();if(w&&d.isMac&&(k=y.button),g.editor.inMultiSelectMode&&k==2)g.editor.textInput.onContextMenu(g.domEvent);else if(w||_||T){if(k===0){var O,R=g.editor,M=R.selection,N=R.inMultiSelectMode,D=g.getDocumentPosition(),P=M.getCursor(),I=g.inSelection()||M.isEmpty()&&m(D,P),L=g.x,F=g.y,U=R.session,J=R.renderer.pixelToScreenCoordinates(L,F),z=J;if(R.$mouseHandler.$enableJumpToDef)w&&_||T&&_?O=E?"block":"add":_&&R.$blockSelectEnabled&&(O="block");else if(T&&!_){if(O="add",!N&&E)return}else _&&R.$blockSelectEnabled&&(O="block");if(O&&d.isMac&&y.ctrlKey&&R.$mouseHandler.cancelContextMenu(),O=="add"){if(!N&&I)return;if(!N){var ie=M.toOrientedRange();R.addSelectionMarker(ie)}var ce=M.rangeList.rangeAtPoint(D);R.$blockScrolling++,R.inVirtualSelectionMode=!0,E&&(ce=null,ie=M.ranges[0]||ie,R.removeSelectionMarker(ie)),R.once("mouseup",function(){var St=M.toOrientedRange();ce&&St.isEmpty()&&m(ce.cursor,St.cursor)?M.substractPoint(St.cursor):(E?M.substractPoint(ie.cursor):ie&&(R.removeSelectionMarker(ie),M.addRange(ie)),M.addRange(St)),R.$blockScrolling--,R.inVirtualSelectionMode=!1})}else if(O=="block"){var Y;g.stop(),R.inVirtualSelectionMode=!0;var B=[];R.$blockScrolling++,N&&!T?M.toSingleRange():!N&&T&&(Y=M.toOrientedRange(),R.addSelectionMarker(Y)),E?J=U.documentToScreenPosition(M.lead):M.moveToPosition(D),R.$blockScrolling--,z={row:-1,column:-1};var V=function(){var St=R.renderer.pixelToScreenCoordinates(L,F),Dee=U.screenToDocumentPosition(St.row,St.column);m(z,St)&&m(Dee,M.lead)||(z=St,R.$blockScrolling++,R.selection.moveToPosition(Dee),R.renderer.scrollCursorIntoView(),R.removeSelectionMarkers(B),B=M.rectangularRangeBlock(z,J),R.$mouseHandler.$clickSelection&&B.length==1&&B[0].isEmpty()&&(B[0]=R.$mouseHandler.$clickSelection.clone()),B.forEach(R.addSelectionMarker,R),R.updateSelectionMarkers(),R.$blockScrolling--)};u.capture(R.container,function(St){L=St.clientX,F=St.clientY},function(St){clearInterval(Ge),R.removeSelectionMarkers(B),B.length||(B=[M.toOrientedRange()]),R.$blockScrolling++,Y&&(R.removeSelectionMarker(Y),M.toSingleRange(Y));for(var Dee=0;Dee1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),M||this.fromOrientedRange(R)}},this.toSingleRange=function(R){R=R||this.ranges[0];var M=this.rangeList.removeAll();M.length&&this.$onRemoveRange(M),R&&this.fromOrientedRange(R)},this.substractPoint=function(R){var M=this.rangeList.substractPoint(R);if(M)return this.$onRemoveRange(M),M[0]},this.mergeOverlappingRanges=function(){var R=this.rangeList.merge();R.length?this.$onRemoveRange(R):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(R){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(R),this._signal("addRange",{range:R})},this.$onRemoveRange=function(R){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var M=this.rangeList.ranges.pop();R.push(M),this.rangeCount=0}for(var N=R.length;N--;){var D=this.ranges.indexOf(R[N]);this.ranges.splice(D,1)}this._signal("removeRange",{ranges:R}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(M=M||this.ranges[0])&&!M.isEqual(this.getRange())&&this.fromOrientedRange(M)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new u,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var R=this.rangeList.ranges,M=R[R.length-1],N=d.fromPoints(R[0].start,M.end);this.toSingleRange(),this.setSelectionRange(N,M.cursor==M.start)}else{N=this.getRange();var D=this.isBackwards(),P=N.start.row,I=N.end.row;if(P==I){if(D)var L=N.end,F=N.start;else L=N.start,F=N.end;return this.addRange(d.fromPoints(F,F)),void this.addRange(d.fromPoints(L,L))}var U=[],J=this.getLineRange(P,!0);J.start.column=N.start.column,U.push(J);for(var z=P+1;z1){var R=this.rangeList.ranges,M=R[R.length-1],N=d.fromPoints(R[0].start,M.end);this.toSingleRange(),this.setSelectionRange(N,M.cursor==M.start)}else{var D=this.session.documentToScreenPosition(this.selectionLead),P=this.session.documentToScreenPosition(this.selectionAnchor);this.rectangularRangeBlock(D,P).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(R,M,N){var D=[],P=R.column0;)V--;if(V>0)for(var Ge=0;D[Ge].isEmpty();)Ge++;for(var St=V;St>=Ge;St--)D[St].isEmpty()&&D.splice(St,1)}return D}}.call(m.prototype);var k=a("./editor").Editor;function O(R){R.$multiselectOnSessionChange||(R.$onAddRange=R.$onAddRange.bind(R),R.$onRemoveRange=R.$onRemoveRange.bind(R),R.$onMultiSelect=R.$onMultiSelect.bind(R),R.$onSingleSelect=R.$onSingleSelect.bind(R),R.$multiselectOnSessionChange=l.onSessionChange.bind(R),R.$checkMultiselectChange=R.$checkMultiselectChange.bind(R),R.$multiselectOnSessionChange(R),R.on("changeSession",R.$multiselectOnSessionChange),R.on("mousedown",g),R.commands.addCommands(E.defaultCommands),function(M){var N=M.textInput.getElement(),D=!1;function P(I){D&&(M.renderer.setMouseCursor(""),D=!1)}y.addListener(N,"keydown",function(I){var L=I.keyCode==18&&!(I.ctrlKey||I.shiftKey||I.metaKey);M.$blockSelectEnabled&&L?D||(M.renderer.setMouseCursor("crosshair"),D=!0):D&&P()}),y.addListener(N,"keyup",P),y.addListener(N,"blur",P)}(R))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(R){R.cursor||(R.cursor=R.end);var M=this.getSelectionStyle();return R.marker=this.session.addMarker(R,"ace_selection",M),this.session.$selectionMarkers.push(R),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,R},this.removeSelectionMarker=function(R){if(R.marker){this.session.removeMarker(R.marker);var M=this.session.$selectionMarkers.indexOf(R);M!=-1&&this.session.$selectionMarkers.splice(M,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(R){for(var M=this.session.$selectionMarkers,N=R.length;N--;){var D=R[N];if(D.marker){this.session.removeMarker(D.marker);var P=M.indexOf(D);P!=-1&&M.splice(P,1)}}this.session.selectionMarkerCount=M.length},this.$onAddRange=function(R){this.addSelectionMarker(R.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(R){this.removeSelectionMarkers(R.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(R){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(E.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(R){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(E.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(R){var M=R.command,N=R.editor;if(N.multiSelect){if(M.multiSelectAction)M.multiSelectAction=="forEach"?D=N.forEachSelection(M,R.args):M.multiSelectAction=="forEachLine"?D=N.forEachSelection(M,R.args,!0):M.multiSelectAction=="single"?(N.exitMultiSelectMode(),D=M.exec(N,R.args||{})):D=M.multiSelectAction(N,R.args||{});else{var D=M.exec(N,R.args||{});N.multiSelect.addRange(N.multiSelect.toOrientedRange()),N.multiSelect.mergeOverlappingRanges()}return D}},this.forEachSelection=function(R,M,N){if(!this.inVirtualSelectionMode){var D,P=N&&N.keepOrder,I=N==1||N&&N.$byLines,L=this.session,F=this.selection,U=F.rangeList,J=(P?F:U).ranges;if(!J.length)return R.exec?R.exec(this,M||{}):R(this,M||{});var z=F._eventRegistry;F._eventRegistry={};var ie=new m(L);this.inVirtualSelectionMode=!0;for(var ce=J.length;ce--;){if(I)for(;ce>0&&J[ce].start.row==J[ce-1].end.row;)ce--;ie.fromOrientedRange(J[ce]),ie.index=ce,this.selection=L.selection=ie;var Y=R.exec?R.exec(this,M||{}):R(this,M||{});D||Y===void 0||(D=Y),ie.toOrientedRange(J[ce])}ie.detach(),this.selection=L.selection=F,this.inVirtualSelectionMode=!1,F._eventRegistry=z,F.mergeOverlappingRanges();var B=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),B&&B.from==B.to&&this.renderer.animateScrolling(B.from),D}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var R="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var M=this.multiSelect.rangeList.ranges,N=[],D=0;DI&&(I=Ge.column),Stpee?R.insert(St,_.stringRepeat(" ",Dee-pee)):R.remove(new d(St.row,St.column,St.row,St.column-Dee+pee)),V.start.column=V.end.column=I,V.start.row=V.end.row=St.row,V.cursor=V.end}),M.fromOrientedRange(N[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var U=this.selection.getRange(),J=U.start.row,z=U.end.row,ie=J==z;if(ie){var ce,Y=this.session.getLength();do ce=this.session.getLine(z);while(/[=:]/.test(ce)&&++z0);J<0&&(J=0),z>=Y&&(z=Y-1)}var B=this.session.removeFullLines(J,z);B=this.$reAlignText(B,ie),this.session.insert({row:J,column:0},B.join(` -`)+` -`),ie||(U.start.column=0,U.end.column=B[B.length-1].length),this.selection.setRange(U)}},this.$reAlignText=function(R,M){var N,D,P,I=!0,L=!0;return R.map(function(J){var z=J.match(/(\s*)(.*?)(\s*)([=:].*)/);return z?N==null?(N=z[1].length,D=z[2].length,P=z[3].length,z):(N+D+P!=z[1].length+z[2].length+z[3].length&&(L=!1),N!=z[1].length&&(I=!1),N>z[1].length&&(N=z[1].length),Dz[3].length&&(P=z[3].length),z):[J]}).map(M?U:I?L?function(J){return J[2]?F(N+D-J[2].length)+J[2]+F(P)+J[4].replace(/^([=:])\s+/,"$1 "):J[0]}:U:function(J){return J[2]?F(N)+J[2]+F(P)+J[4].replace(/^([=:])\s+/,"$1 "):J[0]});function F(J){return _.stringRepeat(" ",J)}function U(J){return J[2]?F(N)+J[2]+F(D-J[2].length+P)+J[4].replace(/^([=:])\s+/,"$1 "):J[0]}}}).call(k.prototype),l.onSessionChange=function(R){var M=R.session;M&&!M.multiSelect&&(M.$selectionMarkers=[],M.selection.$initRangeList(),M.multiSelect=M.selection),this.multiSelect=M&&M.multiSelect;var N=R.oldSession;N&&(N.multiSelect.off("addRange",this.$onAddRange),N.multiSelect.off("removeRange",this.$onRemoveRange),N.multiSelect.off("multiSelect",this.$onMultiSelect),N.multiSelect.off("singleSelect",this.$onSingleSelect),N.multiSelect.lead.off("change",this.$checkMultiselectChange),N.multiSelect.anchor.off("change",this.$checkMultiselectChange)),M&&(M.multiSelect.on("addRange",this.$onAddRange),M.multiSelect.on("removeRange",this.$onRemoveRange),M.multiSelect.on("multiSelect",this.$onMultiSelect),M.multiSelect.on("singleSelect",this.$onSingleSelect),M.multiSelect.lead.on("change",this.$checkMultiselectChange),M.multiSelect.anchor.on("change",this.$checkMultiselectChange)),M&&this.inMultiSelectMode!=M.selection.inMultiSelectMode&&(M.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},l.MultiSelect=O,a("./config").defineOptions(k.prototype,"editor",{enableMultiselect:{set:function(R){O(this),R?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",g)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",g))},value:!0},enableBlockSelect:{set:function(R){this.$blockSelectEnabled=R},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(a,l,c){var u=a("../../range").Range,d=l.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(m,g,y){var _=m.getLine(y);return this.foldingStartMarker.test(_)?"start":g=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(_)?"end":""},this.getFoldWidgetRange=function(m,g,y){return null},this.indentationBlock=function(m,g,y){var _=/\S/,E=m.getLine(g),w=E.search(_);if(w!=-1){for(var T=y||E.length,k=m.getLength(),O=g,R=g;++gO){var N=m.getLine(R).length;return new u(O,T,R,N)}}},this.openingBracketBlock=function(m,g,y,_,E){var w={row:y,column:_+1},T=m.$findClosingBracket(g,w,E);if(T){var k=m.foldWidgets[T.row];return k==null&&(k=m.getFoldWidget(T.row)),k=="start"&&T.row>w.row&&(T.row--,T.column=m.getLine(T.row).length),u.fromPoints(w,T)}},this.closingBracketBlock=function(m,g,y,_,E){var w={row:y,column:_},T=m.$findOpeningBracket(g,w);if(T)return T.column++,w.column--,u.fromPoints(T,w)}}).call(d.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(a,l,c){l.isDark=!1,l.cssClass="ace-tm",l.cssText='.ace-tm .ace_gutter { background: #f0f0f0; color: #333; } .ace-tm .ace_print-margin { width: 1px; background: #e8e8e8; } .ace-tm .ace_fold { background-color: #6B72E6; } .ace-tm { background-color: #FFFFFF; color: black; } .ace-tm .ace_cursor { color: black; } .ace-tm .ace_invisible { color: rgb(191, 191, 191); } .ace-tm .ace_storage, .ace-tm .ace_keyword { color: blue; } .ace-tm .ace_constant { color: rgb(197, 6, 11); } .ace-tm .ace_constant.ace_buildin { color: rgb(88, 72, 246); } .ace-tm .ace_constant.ace_language { color: rgb(88, 92, 246); } .ace-tm .ace_constant.ace_library { color: rgb(6, 150, 14); } .ace-tm .ace_invalid { background-color: rgba(255, 0, 0, 0.1); color: red; } .ace-tm .ace_support.ace_function { color: rgb(60, 76, 114); } .ace-tm .ace_support.ace_constant { color: rgb(6, 150, 14); } .ace-tm .ace_support.ace_type, .ace-tm .ace_support.ace_class { color: rgb(109, 121, 222); } .ace-tm .ace_keyword.ace_operator { color: rgb(104, 118, 135); } .ace-tm .ace_string { color: rgb(3, 106, 7); } .ace-tm .ace_comment { color: rgb(76, 136, 107); } .ace-tm .ace_comment.ace_doc { color: rgb(0, 102, 255); } .ace-tm .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191); } .ace-tm .ace_constant.ace_numeric { color: rgb(0, 0, 205); } .ace-tm .ace_variable { color: rgb(49, 132, 149); } .ace-tm .ace_xml-pe { color: rgb(104, 104, 91); } .ace-tm .ace_entity.ace_name.ace_function { color: #0000A2; } .ace-tm .ace_heading { color: rgb(12, 7, 255); } .ace-tm .ace_list { color:rgb(185, 6, 144); } .ace-tm .ace_meta.ace_tag { color:rgb(0, 22, 142); } .ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) } .ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255); } .ace-tm.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px white; } .ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0); } .ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101); } .ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192); } .ace-tm .ace_marker-layer .ace_active-line { background: rgba(0, 0, 0, 0.07); } .ace-tm .ace_gutter-active-line { background-color : #dcdcdc; } .ace-tm .ace_marker-layer .ace_selected-word { background: rgb(250, 250, 255); border: 1px solid rgb(200, 200, 250); } .ace-tm .ace_indent-guide { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; } ',a("../lib/dom").importCssString(l.cssText,l.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(a,l,c){a("./lib/oop");var u=a("./lib/dom");function d(m){this.session=m,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}a("./range").Range,function(){this.getRowLength=function(m){var g;return g=this.lineWidgets&&this.lineWidgets[m]&&this.lineWidgets[m].rowCount||0,this.$useWrapMode&&this.$wrapData[m]?this.$wrapData[m].length+1+g:1+g},this.$getWidgetScreenLength=function(){var m=0;return this.lineWidgets.forEach(function(g){g&&g.rowCount&&!g.hidden&&(m+=g.rowCount)}),m},this.$onChangeEditor=function(m){this.attach(m.editor)},this.attach=function(m){m&&m.widgetManager&&m.widgetManager!=this&&m.widgetManager.detach(),this.editor!=m&&(this.detach(),this.editor=m,m&&(m.widgetManager=this,m.renderer.on("beforeRender",this.measureWidgets),m.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(m){var g=this.editor;if(g){this.editor=null,g.widgetManager=null,g.renderer.off("beforeRender",this.measureWidgets),g.renderer.off("afterRender",this.renderWidgets);var y=this.session.lineWidgets;y&&y.forEach(function(_){_&&_.el&&_.el.parentNode&&(_._inDocument=!1,_.el.parentNode.removeChild(_.el))})}},this.updateOnFold=function(m,g){var y=g.lineWidgets;if(y&&m.action){for(var _=m.data,E=_.start.row,w=_.end.row,T=m.action=="add",k=E+1;k0&&!_[E];)E--;this.firstRow=y.firstRow,this.lastRow=y.lastRow,g.$cursorLayer.config=y;for(var T=E;T<=w;T++){var k=_[T];if(k&&k.el)if(k.hidden)k.el.style.top=-100-(k.pixelHeight||0)+"px";else{k._inDocument||(k._inDocument=!0,g.container.appendChild(k.el));var O=g.$cursorLayer.getPixelPosition({row:T,column:0},!0).top;k.coverLine||(O+=y.lineHeight*this.session.getRowLineCount(k.row)),k.el.style.top=O-y.offset+"px";var R=k.coverGutter?0:g.gutterWidth;k.fixedWidth||(R-=g.scrollLeft),k.el.style.left=R+"px",k.fullWidth&&k.screenWidth&&(k.el.style.minWidth=y.width+2*y.padding+"px"),k.fixedWidth?k.el.style.right=g.scrollBar.getWidth()+"px":k.el.style.right=""}}}}}.call(d.prototype),l.LineWidgets=d}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(a,l,c){var u=a("../line_widgets").LineWidgets,d=a("../lib/dom"),m=a("../range").Range;l.showErrorMarker=function(g,y){var _=g.session;_.widgetManager||(_.widgetManager=new u(_),_.widgetManager.attach(g));var E=g.getCursorPosition(),w=E.row,T=_.widgetManager.getWidgetsAtRow(w).filter(function(L){return L.type=="errorMarker"})[0];T?T.destroy():w-=y;var k,O=function(L,F,U){var J=L.getAnnotations().sort(m.comparePoints);if(J.length){var z=function(Y,B,V){for(var Ge=0,St=Y.length-1;Ge<=St;){var Dee=Ge+St>>1,pee=V(B,Y[Dee]);if(pee>0)Ge=Dee+1;else{if(!(pee<0))return Dee;St=Dee-1}}return-(Ge+1)}(J,{row:F,column:-1},m.comparePoints);z<0&&(z=-z-1),z>=J.length?z=U>0?0:J.length-1:z===0&&U<0&&(z=J.length-1);var ie=J[z];if(ie&&U){if(ie.row===F){do ie=J[z+=U];while(ie&&ie.row===F);if(!ie)return J.slice()}var ce=[];F=ie.row;do ce[U<0?"unshift":"push"](ie),ie=J[z+=U];while(ie&&ie.row==F);return ce.length&&ce}}}(_,w,y);if(O){var R=O[0];E.column=(R.pos&&typeof R.column!="number"?R.pos.sc:R.column)||0,E.row=R.row,k=g.renderer.$gutterLayer.$annotations[E.row]}else{if(T)return;k={text:["Looks good!"],className:"ace_ok"}}g.session.unfold(E.row),g.selection.moveToPosition(E);var M={row:E.row,fixedWidth:!0,coverGutter:!0,el:d.createElement("div"),type:"errorMarker"},N=M.el.appendChild(d.createElement("div")),D=M.el.appendChild(d.createElement("div"));D.className="error_widget_arrow "+k.className;var P=g.renderer.$cursorLayer.getPixelPosition(E).left;D.style.left=P+g.renderer.gutterWidth-5+"px",M.el.className="error_widget_wrapper",N.className="error_widget "+k.className,N.innerHTML=k.text.join("
"),N.appendChild(d.createElement("div"));var I=function(L,F,U){if(F===0&&(U==="esc"||U==="return"))return M.destroy(),{command:"null"}};M.destroy=function(){g.$mouseHandler.isMousePressed||(g.keyBinding.removeKeyboardHandler(I),_.widgetManager.removeLineWidget(M),g.off("changeSelection",M.destroy),g.off("changeSession",M.destroy),g.off("mouseup",M.destroy),g.off("change",M.destroy))},g.keyBinding.addKeyboardHandler(I),g.on("changeSelection",M.destroy),g.on("changeSession",M.destroy),g.on("mouseup",M.destroy),g.on("change",M.destroy),g.session.widgetManager.addLineWidget(M),M.el.onmousedown=g.focus.bind(g),g.renderer.scrollCursorIntoView(null,.5,{bottom:M.el.offsetHeight})},d.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; } ","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(a,l,c){a("./lib/fixoldbrowsers");var u=a("./lib/dom"),d=a("./lib/event"),m=a("./editor").Editor,g=a("./edit_session").EditSession,y=a("./undomanager").UndoManager,_=a("./virtual_renderer").VirtualRenderer;a("./worker/worker_client"),a("./keyboard/hash_handler"),a("./placeholder"),a("./multi_select"),a("./mode/folding/fold_mode"),a("./theme/textmate"),a("./ext/error_marker"),l.config=a("./config"),l.acequire=a,l.edit=function(E){if(typeof E=="string"){var w=E;if(!(E=document.getElementById(w)))throw new Error("ace.edit can't find div #"+w)}if(E&&E.env&&E.env.editor instanceof m)return E.env.editor;var T="";if(E&&/input|textarea/i.test(E.tagName)){var k=E;T=k.value,E=u.createElement("pre"),k.parentNode.replaceChild(E,k)}else E&&(T=u.getInnerText(E),E.innerHTML="");var O=l.createEditSession(T),R=new m(new _(E));R.setSession(O);var M={document:O,editor:R,onResize:R.resize.bind(R,null)};return k&&(M.textarea=k),d.addListener(window,"resize",M.onResize),R.on("destroy",function(){d.removeListener(window,"resize",M.onResize),M.editor.container.env=null}),R.container.env=R.env=M,R},l.createEditSession=function(E,w){var T=new g(E,w);return T.setUndoManager(new y),T},l.EditSession=g,l.UndoManager=y,l.version="1.2.3"}),ace.acequire(["ace/ace"],function(a){for(var l in a&&a.config.init(!0),window.ace||(window.ace=a),a)a.hasOwnProperty(l)&&(window.ace[l]=a[l])}),r.exports=window.ace.acequire("ace/ace")},function(r,o){r.exports=function(){throw new Error("define cannot be used indirect")}},function(r,o){(function(s){r.exports=function(){if(s.Blob)try{return new Blob(["asdf"],{type:"text/plain"}),Blob}catch{}var a=s.WebKitBlobBuilder||s.MozBlobBuilder||s.MSBlobBuilder;return function(l,c){var u=new a,d=c.endings,m=c.type;if(d)for(var g=0,y=l.length;g-1},O.recordAutoInsert=function(R,M,N){var D=R.getCursorPosition(),P=M.doc.getLine(D.row);this.isAutoInsertedClosing(D,P,u.autoInsertedLineEnd[0])||(u.autoInsertedBrackets=0),u.autoInsertedRow=D.row,u.autoInsertedLineEnd=N+P.substr(D.column),u.autoInsertedBrackets++},O.recordMaybeInsert=function(R,M,N){var D=R.getCursorPosition(),P=M.doc.getLine(D.row);this.isMaybeInsertedClosing(D,P)||(u.maybeInsertedBrackets=0),u.maybeInsertedRow=D.row,u.maybeInsertedLineStart=P.substr(0,D.column)+N,u.maybeInsertedLineEnd=P.substr(D.column),u.maybeInsertedBrackets++},O.isAutoInsertedClosing=function(R,M,N){return u.autoInsertedBrackets>0&&R.row===u.autoInsertedRow&&N===u.autoInsertedLineEnd[0]&&M.substr(R.column)===u.autoInsertedLineEnd},O.isMaybeInsertedClosing=function(R,M){return u.maybeInsertedBrackets>0&&R.row===u.maybeInsertedRow&&M.substr(R.column)===u.maybeInsertedLineEnd&&M.substr(0,R.column)==u.maybeInsertedLineStart},O.popAutoInsertedClosing=function(){u.autoInsertedLineEnd=u.autoInsertedLineEnd.substr(1),u.autoInsertedBrackets--},O.clearMaybeInsertedClosing=function(){u&&(u.maybeInsertedBrackets=0,u.maybeInsertedRow=-1)},d.inherits(O,m),l.CstyleBehaviour=O}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(a,l,c){var u=a("../../lib/oop"),d=a("../../range").Range,m=a("./fold_mode").FoldMode,g=l.FoldMode=function(y){y&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+y.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+y.end)))};u.inherits(g,m),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(y,_,E){var w=y.getLine(E);if(this.singleLineBlockCommentRe.test(w)&&!this.startRegionRe.test(w)&&!this.tripleStarBlockCommentRe.test(w))return"";var T=this._getFoldWidgetBase(y,_,E);return!T&&this.startRegionRe.test(w)?"start":T},this.getFoldWidgetRange=function(y,_,E,w){var T,k=y.getLine(E);if(this.startRegionRe.test(k))return this.getCommentRegionBlock(y,k,E);if(T=k.match(this.foldingStartMarker)){var O=T.index;if(T[1])return this.openingBracketBlock(y,T[1],E,O);var R=y.getCommentFoldRange(E,O+T[0].length,1);return R&&!R.isMultiLine()&&(w?R=this.getSectionRange(y,E):_!="all"&&(R=null)),R}return _!=="markbegin"&&(T=k.match(this.foldingStopMarker))?(O=T.index+T[0].length,T[1]?this.closingBracketBlock(y,T[1],E,O):y.getCommentFoldRange(E,O,-1)):void 0},this.getSectionRange=function(y,_){for(var E=y.getLine(_),w=E.search(/\S/),T=_,k=E.length,O=_+=1,R=y.getLength();++_M)break;var N=this.getFoldWidgetRange(y,"all",_);if(N){if(N.start.row<=T)break;if(N.isMultiLine())_=N.end.row;else if(w==M)break}O=_}}return new d(T,k,O,y.getLine(O).length)},this.getCommentRegionBlock=function(y,_,E){for(var w=_.search(/\s*$/),T=y.getLength(),k=E,O=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,R=1;++Ek)return new d(k,w,E,_.length)}}.call(g.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],function(a,l,c){var u=a("../lib/oop"),d=a("./text").Mode,m=a("./json_highlight_rules").JsonHighlightRules,g=a("./matching_brace_outdent").MatchingBraceOutdent,y=a("./behaviour/cstyle").CstyleBehaviour,_=a("./folding/cstyle").FoldMode,E=a("../worker/worker_client").WorkerClient,w=function(){this.HighlightRules=m,this.$outdent=new g,this.$behaviour=new y,this.foldingRules=new _};u.inherits(w,d),function(){this.getNextLineIndent=function(T,k,O){var R=this.$getIndent(k);return T=="start"&&k.match(/^.*[\{\(\[]\s*$/)&&(R+=O),R},this.checkOutdent=function(T,k,O){return this.$outdent.checkOutdent(k,O)},this.autoOutdent=function(T,k,O){this.$outdent.autoOutdent(k,O)},this.createWorker=function(T){var k=new E(["ace"],s(68),"JsonWorker");return k.attachToDocument(T.getDocument()),k.on("annotate",function(O){T.setAnnotations(O.data)}),k.on("terminate",function(){T.clearAnnotations()}),k},this.$id="ace/mode/json"}.call(w.prototype),l.Mode=w})},function(r,o){r.exports.id="ace/mode/json_worker",r.exports.src=`"no use strict";(function(window){function resolveModuleId(id,paths){for(var testPath=id,tail="";testPath;){var alias=paths[testPath];if("string"==typeof alias)return alias+tail;if(alias)return alias.location.replace(/\\/*$/,"/")+(tail||alias.main||alias.name);if(alias===!1)return"";var i=testPath.lastIndexOf("/");if(-1===i)break;tail=testPath.substr(i)+tail,testPath=testPath.slice(0,i)}return id}if(!(void 0!==window.window&&window.document||window.acequire&&window.define)){window.console||(window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console),window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:"error",data:{message:message,data:err.data,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf("!")){var chunks=moduleName.split("!");return window.normalizeModule(parentId,chunks[0])+"!"+window.normalizeModule(parentId,chunks[1])}if("."==moduleName.charAt(0)){var base=parentId.split("/").slice(0,-1).join("/");for(moduleName=(base?base+"/":"")+moduleName;-1!==moduleName.indexOf(".")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\.\\//,"").replace(/\\/\\.\\//,"/").replace(/[^\\/]+\\/\\.\\.\\//,"")}}return moduleName},window.acequire=function acequire(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error("worker.js acequire() accepts only (parentId, id) as arguments");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;if(!window.acequire.tlns)return console.log("unable to load "+id);var path=resolveModuleId(id,window.acequire.tlns);return".js"!=path.slice(-3)&&(path+=".js"),window.acequire.id=id,window.acequire.modules[id]={},importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,"string"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),"function"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=["require","exports","module"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case"require":return req;case"exports":return module.exports;case"module":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},acequire.tlns={},window.initBaseUrls=function(topLevelNamespaces){for(var i in topLevelNamespaces)acequire.tlns[i]=topLevelNamespaces[i]},window.initSender=function(){var EventEmitter=window.acequire("ace/lib/event_emitter").EventEmitter,oop=window.acequire("ace/lib/oop"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:"call",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:"event",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.event&&sender)sender._signal(msg.event,msg.data);else if(msg.command)if(main[msg.command])main[msg.command].apply(main,msg.args);else{if(!window[msg.command])throw Error("Unknown command:"+msg.command);window[msg.command].apply(window,msg.args)}else if(msg.init){window.initBaseUrls(msg.tlns),acequire("ace/lib/es5-shim"),sender=window.sender=window.initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}}}})(this),ace.define("ace/lib/oop",["require","exports","module"],function(acequire,exports){"use strict";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define("ace/range",["require","exports","module"],function(acequire,exports){"use strict";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){"object"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){"object"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define("ace/apply_delta",["require","exports","module"],function(acequire,exports){"use strict";exports.applyDelta=function(docLines,delta){var row=delta.start.row,startColumn=delta.start.column,line=docLines[row]||"";switch(delta.action){case"insert":var lines=delta.lines;if(1===lines.length)docLines[row]=line.substring(0,startColumn)+delta.lines[0]+line.substring(startColumn);else{var args=[row,1].concat(delta.lines);docLines.splice.apply(docLines,args),docLines[row]=line.substring(0,startColumn)+docLines[row],docLines[row+delta.lines.length-1]+=line.substring(startColumn)}break;case"remove":var endColumn=delta.end.column,endRow=delta.end.row;row===endRow?docLines[row]=line.substring(0,startColumn)+line.substring(endColumn):docLines.splice(row,endRow-row+1,line.substring(0,startColumn)+docLines[endRow].substring(endColumn))}}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(acequire,exports){"use strict";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){"object"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?"unshift":"push"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),EventEmitter=acequire("./lib/event_emitter").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){function $pointsInOrder(point1,point2,equalPointsInOrder){var bColIsAfter=equalPointsInOrder?point1.column<=point2.column:point1.columnthis.row)){var point=$getTransformedPoint(delta,{row:this.row,column:this.column},this.$insertRight);this.setPosition(point.row,point.column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal("change",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),applyDelta=acequire("./apply_delta").applyDelta,EventEmitter=acequire("./lib/event_emitter").EventEmitter,Range=acequire("./range").Range,Anchor=acequire("./anchor").Anchor,Document=function(textOrLines){this.$lines=[""],0===textOrLines.length?this.$lines=[""]:Array.isArray(textOrLines)?this.insertMergedLines({row:0,column:0},textOrLines):this.insert({row:0,column:0},textOrLines)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength()-1;this.remove(new Range(0,0,len,this.getLine(len).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0==="aaa".split(/a/).length?function(text){return text.replace(/\\r\\n|\\r/g,"\\n").split("\\n")}:function(text){return text.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=match?match[1]:"\\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\\r\\n";case"unix":return"\\n";default:return this.$autoNewLine||"\\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return"\\r\\n"==text||"\\r"==text||"\\n"==text},this.getLine=function(row){return this.$lines[row]||""},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter())},this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row)lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];else{lines=this.getLines(range.start.row,range.end.row),lines[0]=(lines[0]||"").substring(range.start.column);var l=lines.length-1;range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column))}return lines},this.insertLines=function(row,lines){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(row,lines)},this.removeLines=function(firstRow,lastRow){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(firstRow,lastRow)},this.insertNewLine=function(position){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(position,["",""])},this.insert=function(position,text){return 1>=this.getLength()&&this.$detectNewLine(text),this.insertMergedLines(position,this.$split(text))},this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column),end=this.pos(position.row,position.column+text.length);return this.applyDelta({start:start,end:end,action:"insert",lines:[text]},!0),this.clonePos(end)},this.clippedPos=function(row,column){var length=this.getLength();void 0===row?row=length:0>row?row=0:row>=length&&(row=length-1,column=void 0);var line=this.getLine(row);return void 0==column&&(column=line.length),column=Math.min(Math.max(column,0),line.length),{row:row,column:column}},this.clonePos=function(pos){return{row:pos.row,column:pos.column}},this.pos=function(row,column){return{row:row,column:column}},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):(position.row=Math.max(0,position.row),position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length)),position},this.insertFullLines=function(row,lines){row=Math.min(Math.max(row,0),this.getLength());var column=0;this.getLength()>row?(lines=lines.concat([""]),column=0):(lines=[""].concat(lines),row--,column=this.$lines[row].length),this.insertMergedLines({row:row,column:column},lines)},this.insertMergedLines=function(position,lines){var start=this.clippedPos(position.row,position.column),end={row:start.row+lines.length-1,column:(1==lines.length?start.column:0)+lines[lines.length-1].length};return this.applyDelta({start:start,end:end,action:"insert",lines:lines}),this.clonePos(end)},this.remove=function(range){var start=this.clippedPos(range.start.row,range.start.column),end=this.clippedPos(range.end.row,range.end.column);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})}),this.clonePos(start)},this.removeInLine=function(row,startColumn,endColumn){var start=this.clippedPos(row,startColumn),end=this.clippedPos(row,endColumn);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})},!0),this.clonePos(start)},this.removeFullLines=function(firstRow,lastRow){firstRow=Math.min(Math.max(0,firstRow),this.getLength()-1),lastRow=Math.min(Math.max(0,lastRow),this.getLength()-1);var deleteFirstNewLine=lastRow==this.getLength()-1&&firstRow>0,deleteLastNewLine=this.getLength()-1>lastRow,startRow=deleteFirstNewLine?firstRow-1:firstRow,startCol=deleteFirstNewLine?this.getLine(startRow).length:0,endRow=deleteLastNewLine?lastRow+1:lastRow,endCol=deleteLastNewLine?0:this.getLine(endRow).length,range=new Range(startRow,startCol,endRow,endCol),deletedLines=this.$lines.slice(firstRow,lastRow+1);return this.applyDelta({start:range.start,end:range.end,action:"remove",lines:this.getLinesForRange(range)}),deletedLines},this.removeNewLine=function(row){this.getLength()-1>row&&row>=0&&this.applyDelta({start:this.pos(row,this.getLine(row).length),end:this.pos(row+1,0),action:"remove",lines:["",""]})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0===text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;this.remove(range);var end;return end=text?this.insert(range.start,text):range.start},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++)this.applyDelta(deltas[i])},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--)this.revertDelta(deltas[i])},this.applyDelta=function(delta,doNotValidate){var isInsert="insert"==delta.action;(isInsert?1>=delta.lines.length&&!delta.lines[0]:!Range.comparePoints(delta.start,delta.end))||(isInsert&&delta.lines.length>2e4&&this.$splitAndapplyLargeDelta(delta,2e4),applyDelta(this.$lines,delta,doNotValidate),this._signal("change",delta))},this.$splitAndapplyLargeDelta=function(delta,MAX){for(var lines=delta.lines,l=lines.length,row=delta.start.row,column=delta.start.column,from=0,to=0;;){from=to,to+=MAX-1;var chunk=lines.slice(from,to);if(to>l){delta.lines=chunk,delta.start.row=row+from,delta.start.column=column;break}chunk.push(""),this.applyDelta({start:this.pos(row+from,column),end:this.pos(row+to,column=0),action:delta.action,lines:chunk},!0)}},this.revertDelta=function(delta){this.applyDelta({start:this.clonePos(delta.start),end:this.clonePos(delta.end),action:"insert"==delta.action?"remove":"insert",lines:delta.lines.slice()})},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define("ace/lib/lang",["require","exports","module"],function(acequire,exports){"use strict";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split("").reverse().join("")},exports.stringRepeat=function(string,count){for(var result="";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\s\\s*/,trimEndRegexp=/\\s\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,"")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,"")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&"object"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function deepCopy(obj){if("object"!=typeof obj||!obj)return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;obj.length>key;key++)copy[key]=deepCopy(obj[key]);return copy}var cons=obj.constructor;if(cons===RegExp)return obj;copy=cons();for(var key in obj)copy[key]=deepCopy(obj[key]);return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^\${}()|[\\]\\/\\\\])/g,"\\\\$1")},exports.escapeHTML=function(str){return str.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/i;i+=2){if(Array.isArray(data[i+1]))var d={action:"insert",start:data[i],lines:data[i+1]};else var d={action:"remove",start:data[i],end:data[i+1]};doc.applyDelta(d,!0)}return _self.$timeout?deferredUpdate.schedule(_self.$timeout):(_self.onUpdate(),void 0)})};(function(){this.$timeout=500,this.setTimeout=function(timeout){this.$timeout=timeout},this.setValue=function(value){this.doc.setValue(value),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(callbackId){this.sender.callback(this.doc.getValue(),callbackId)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(Mirror.prototype)}),ace.define("ace/mode/json/json_parse",["require","exports","module"],function(){"use strict";var at,ch,text,value,escapee={'"':'"',"\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:"\\n",r:"\\r",t:" "},error=function(m){throw{name:"SyntaxError",message:m,at:at,text:text}},next=function(c){return c&&c!==ch&&error("Expected '"+c+"' instead of '"+ch+"'"),ch=text.charAt(at),at+=1,ch},number=function(){var number,string="";for("-"===ch&&(string="-",next("-"));ch>="0"&&"9">=ch;)string+=ch,next();if("."===ch)for(string+=".";next()&&ch>="0"&&"9">=ch;)string+=ch;if("e"===ch||"E"===ch)for(string+=ch,next(),("-"===ch||"+"===ch)&&(string+=ch,next());ch>="0"&&"9">=ch;)string+=ch,next();return number=+string,isNaN(number)?(error("Bad number"),void 0):number},string=function(){var hex,i,uffff,string="";if('"'===ch)for(;next();){if('"'===ch)return next(),string;if("\\\\"===ch)if(next(),"u"===ch){for(uffff=0,i=0;4>i&&(hex=parseInt(next(),16),isFinite(hex));i+=1)uffff=16*uffff+hex;string+=String.fromCharCode(uffff)}else{if("string"!=typeof escapee[ch])break;string+=escapee[ch]}else string+=ch}error("Bad string")},white=function(){for(;ch&&" ">=ch;)next()},word=function(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null}error("Unexpected '"+ch+"'")},array=function(){var array=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),array;for(;ch;){if(array.push(value()),white(),"]"===ch)return next("]"),array;next(","),white()}}error("Bad array")},object=function(){var key,object={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),object;for(;ch;){if(key=string(),white(),next(":"),Object.hasOwnProperty.call(object,key)&&error('Duplicate key "'+key+'"'),object[key]=value(),white(),"}"===ch)return next("}"),object;next(","),white()}}error("Bad object")};return value=function(){switch(white(),ch){case"{":return object();case"[":return array();case'"':return string();case"-":return number();default:return ch>="0"&&"9">=ch?number():word()}},function(source,reviver){var result;return text=source,at=0,ch=" ",result=value(),white(),ch&&error("Syntax error"),"function"==typeof reviver?function walk(holder,key){var k,v,value=holder[key];if(value&&"object"==typeof value)for(k in value)Object.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}({"":result},""):result}}),ace.define("ace/mode/json_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/json/json_parse"],function(acequire,exports){"use strict";var oop=acequire("../lib/oop"),Mirror=acequire("../worker/mirror").Mirror,parse=acequire("./json/json_parse"),JsonWorker=exports.JsonWorker=function(sender){Mirror.call(this,sender),this.setTimeout(200)};oop.inherits(JsonWorker,Mirror),function(){this.onUpdate=function(){var value=this.doc.getValue(),errors=[];try{value&&parse(value)}catch(e){var pos=this.doc.indexToPosition(e.at-1);errors.push({row:pos.row,column:pos.column,text:e.message,type:"error"})}this.sender.emit("annotate",errors)}}.call(JsonWorker.prototype)}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,"sentinel",{}),"sentinel"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if("function"!=typeof target)throw new TypeError("Function.prototype.bind called on incompatible "+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,"__defineGetter__"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,"XXX"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0 -}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return"[object Array]"==_toString(obj)});var boxedString=Object("a"),splitString="a"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,thisp=arguments[1],i=-1,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError;for(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=[],thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError("reduce of empty array with no initial value")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError("reduceRight of empty array with no initial value")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(object,property){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if("object"!=typeof prototype)throw new TypeError("typeof prototype["+typeof prototype+"] != 'object'");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom="undefined"==typeof document||doesDefinePropertyWork(document.createElement("div"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR="Property description must be an object: ",ERR_NON_OBJECT_TARGET="Object.defineProperty called on non-object: ",ERR_ACCESSORS_NOT_SUPPORTED="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(object,property,descriptor){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if("object"!=typeof descriptor&&"function"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,"value"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,"get")&&defineGetter(object,property,descriptor.get),owns(descriptor,"set")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return"function"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name="";owns(object,name);)name+="?";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError("Object.keys called on a non-object");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws=" \\n\v\\f\\r   ᠎              \\u2028\\u2029\uFEFF";if(!String.prototype.trim||ws.trim()){ws="["+ws+"]";var trimBeginRegexp=RegExp("^"+ws+ws+"*"),trimEndRegexp=RegExp(ws+ws+"*$");String.prototype.trim=function(){return(this+"").replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}}var toObject=function(o){if(null==o)throw new TypeError("can't convert "+o+" to object");return Object(o)}});`},function(r,o){ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(s,a,l){var c=s("../lib/dom"),u=s("../lib/lang"),d=s("../lib/event"),m=s("../keyboard/hash_handler").HashHandler,g=s("../lib/keys");c.importCssString(" .ace_search { background-color: #ddd; border: 1px solid #cbcbcb; border-top: 0 none; max-width: 325px; overflow: hidden; margin: 0; padding: 4px; padding-right: 6px; padding-bottom: 0; position: absolute; top: 0px; z-index: 99; white-space: normal; } .ace_search.left { border-left: 0 none; border-radius: 0px 0px 5px 0px; left: 0; } .ace_search.right { border-radius: 0px 0px 0px 5px; border-right: 0 none; right: 0; } .ace_search_form, .ace_replace_form { border-radius: 3px; border: 1px solid #cbcbcb; float: left; margin-bottom: 4px; overflow: hidden; } .ace_search_form.ace_nomatch { outline: 1px solid red; } .ace_search_field { background-color: white; border-right: 1px solid #cbcbcb; border: 0 none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; height: 22px; outline: 0; padding: 0 7px; width: 214px; margin: 0; } .ace_searchbtn, .ace_replacebtn { background: #fff; border: 0 none; border-left: 1px solid #dcdcdc; cursor: pointer; float: left; height: 22px; margin: 0; position: relative; } .ace_searchbtn:last-child, .ace_replacebtn:last-child { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .ace_searchbtn:disabled { background: none; cursor: default; } .ace_searchbtn { background-position: 50% 50%; background-repeat: no-repeat; width: 27px; } .ace_searchbtn.prev { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); } .ace_searchbtn.next { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); } .ace_searchbtn_close { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0; border-radius: 50%; border: 0 none; color: #656565; cursor: pointer; float: right; font: 16px/16px Arial; height: 14px; margin: 5px 1px 9px 5px; padding: 0; text-align: center; width: 14px; } .ace_searchbtn_close:hover { background-color: #656565; background-position: 50% 100%; color: white; } .ace_replacebtn.prev { width: 54px } .ace_replacebtn.next { width: 27px } .ace_button { margin-left: 2px; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -o-user-select: none; -ms-user-select: none; user-select: none; overflow: hidden; opacity: 0.7; border: 1px solid rgba(100,100,100,0.23); padding: 1px; -moz-box-sizing: border-box; box-sizing: border-box; color: black; } .ace_button:hover { background-color: #eee; opacity:1; } .ace_button:active { background-color: #ddd; } .ace_button.checked { border-color: #3399ff; opacity:1; } .ace_search_options{ margin-bottom: 3px; text-align: right; -webkit-user-select: none; -moz-user-select: none; -o-user-select: none; -ms-user-select: none; user-select: none; }","ace_searchbox");var y=''.replace(/>\s+/g,">"),_=function(E,w,T){var k=c.createElement("div");k.innerHTML=y,this.element=k.firstChild,this.$init(),this.setEditor(E)};(function(){this.setEditor=function(E){E.searchBox=this,E.container.appendChild(this.element),this.editor=E},this.$initElements=function(E){this.searchBox=E.querySelector(".ace_search_form"),this.replaceBox=E.querySelector(".ace_replace_form"),this.searchOptions=E.querySelector(".ace_search_options"),this.regExpOption=E.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=E.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=E.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field")},this.$init=function(){var E=this.element;this.$initElements(E);var w=this;d.addListener(E,"mousedown",function(T){setTimeout(function(){w.activeInput.focus()},0),d.stopPropagation(T)}),d.addListener(E,"click",function(T){var k=(T.target||T.srcElement).getAttribute("action");k&&w[k]?w[k]():w.$searchBarKb.commands[k]&&w.$searchBarKb.commands[k].exec(w),d.stopPropagation(T)}),d.addCommandKeyListener(E,function(T,k,O){var R=g.keyCodeToString(O),M=w.$searchBarKb.findKeyCommand(k,R);M&&M.exec&&(M.exec(w),d.stopEvent(T))}),this.$onChange=u.delayedCall(function(){w.find(!1,!1)}),d.addListener(this.searchInput,"input",function(){w.$onChange.schedule(20)}),d.addListener(this.searchInput,"focus",function(){w.activeInput=w.searchInput,w.searchInput.value&&w.highlight()}),d.addListener(this.replaceInput,"focus",function(){w.activeInput=w.replaceInput,w.searchInput.value&&w.highlight()})},this.$closeSearchBarKb=new m([{bindKey:"Esc",name:"closeSearchBar",exec:function(E){E.searchBox.hide()}}]),this.$searchBarKb=new m,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(E){var w=E.isReplace=!E.isReplace;E.replaceBox.style.display=w?"":"none",E.searchInput.focus()},"Ctrl-H|Command-Option-F":function(E){E.replaceBox.style.display="",E.replaceInput.focus()},"Ctrl-G|Command-G":function(E){E.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(E){E.findPrev()},esc:function(E){setTimeout(function(){E.hide()})},Return:function(E){E.activeInput==E.replaceInput&&E.replace(),E.findNext()},"Shift-Return":function(E){E.activeInput==E.replaceInput&&E.replace(),E.findPrev()},"Alt-Return":function(E){E.activeInput==E.replaceInput&&E.replaceAll(),E.findAll()},Tab:function(E){(E.activeInput==E.replaceInput?E.searchInput:E.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(E){E.regExpOption.checked=!E.regExpOption.checked,E.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(E){E.caseSensitiveOption.checked=!E.caseSensitiveOption.checked,E.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(E){E.wholeWordOption.checked=!E.wholeWordOption.checked,E.$syncOptions()}}]),this.$syncOptions=function(){c.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),c.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),c.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked),this.find(!1,!1)},this.highlight=function(E){this.editor.session.highlight(E||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(E,w,T){var k=!this.editor.find(this.searchInput.value,{skipCurrent:E,backwards:w,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:T})&&this.searchInput.value;c.setCssClass(this.searchBox,"ace_nomatch",k),this.editor._emit("findSearchBox",{match:!k}),this.highlight()},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var E=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;c.setCssClass(this.searchBox,"ace_nomatch",E),this.editor._emit("findSearchBox",{match:!E}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(E,w){this.element.style.display="",this.replaceBox.style.display=w?"":"none",this.isReplace=w,E&&(this.searchInput.value=E),this.find(!1,!1,!0),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb)},this.isFocused=function(){var E=document.activeElement;return E==this.searchInput||E==this.replaceInput}}).call(_.prototype),a.SearchBox=_,a.Search=function(E,w){(E.searchBox||new _(E)).show(E.session.getTextRange(),w)}}),ace.acequire(["ace/ext/searchbox"],function(){})},function(r,o){ace.define("ace/theme/jsoneditor",["require","exports","module","ace/lib/dom"],function(s,a,l){a.isDark=!1,a.cssClass="ace-jsoneditor",a.cssText='.ace-jsoneditor .ace_gutter { background: #ebebeb; color: #333 } .ace-jsoneditor.ace_editor { font-family: droid sans mono, consolas, monospace, courier new, courier, sans-serif; line-height: 1.3; } .ace-jsoneditor .ace_print-margin { width: 1px; background: #e8e8e8 } .ace-jsoneditor .ace_scroller { background-color: #FFFFFF } .ace-jsoneditor .ace_text-layer { color: gray } .ace-jsoneditor .ace_variable { color: #1a1a1a } .ace-jsoneditor .ace_cursor { border-left: 2px solid #000000 } .ace-jsoneditor .ace_overwrite-cursors .ace_cursor { border-left: 0px; border-bottom: 1px solid #000000 } .ace-jsoneditor .ace_marker-layer .ace_selection { background: lightgray } .ace-jsoneditor.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #FFFFFF; border-radius: 2px } .ace-jsoneditor .ace_marker-layer .ace_step { background: rgb(255, 255, 0) } .ace-jsoneditor .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF } .ace-jsoneditor .ace_marker-layer .ace_active-line { background: #FFFBD1 } .ace-jsoneditor .ace_gutter-active-line { background-color : #dcdcdc } .ace-jsoneditor .ace_marker-layer .ace_selected-word { border: 1px solid lightgray } .ace-jsoneditor .ace_invisible { color: #BFBFBF } .ace-jsoneditor .ace_keyword, .ace-jsoneditor .ace_meta, .ace-jsoneditor .ace_support.ace_constant.ace_property-value { color: #AF956F } .ace-jsoneditor .ace_keyword.ace_operator { color: #484848 } .ace-jsoneditor .ace_keyword.ace_other.ace_unit { color: #96DC5F } .ace-jsoneditor .ace_constant.ace_language { color: darkorange } .ace-jsoneditor .ace_constant.ace_numeric { color: red } .ace-jsoneditor .ace_constant.ace_character.ace_entity { color: #BF78CC } .ace-jsoneditor .ace_invalid { color: #FFFFFF; background-color: #FF002A; } .ace-jsoneditor .ace_fold { background-color: #AF956F; border-color: #000000 } .ace-jsoneditor .ace_storage, .ace-jsoneditor .ace_support.ace_class, .ace-jsoneditor .ace_support.ace_function, .ace-jsoneditor .ace_support.ace_other, .ace-jsoneditor .ace_support.ace_type { color: #C52727 } .ace-jsoneditor .ace_string { color: green } .ace-jsoneditor .ace_comment { color: #BCC8BA } .ace-jsoneditor .ace_entity.ace_name.ace_tag, .ace-jsoneditor .ace_entity.ace_other.ace_attribute-name { color: #606060 } .ace-jsoneditor .ace_markup.ace_underline { text-decoration: underline } .ace-jsoneditor .ace_indent-guide { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y }',s("../lib/dom").importCssString(a.cssText,a.cssClass)})}])},module.exports=factory()});function styleInject(r,o){o===void 0&&(o={});var s=o.insertAt;if(r&&typeof document<"u"){var a=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",s==="top"&&a.firstChild?a.insertBefore(l,a.firstChild):a.appendChild(l),l.styleSheet?l.styleSheet.cssText=r:l.appendChild(document.createTextNode(r))}}var css_248z$1=`/* reset styling (prevent conflicts with bootstrap, materialize.css, etc.) */ - -div.jsoneditor .jsoneditor-search input { - height: auto; - border: inherit; -} - -div.jsoneditor .jsoneditor-search input:focus { - border: none !important; - box-shadow: none !important; -} - -div.jsoneditor table { - border-collapse: collapse; - width: auto; -} - -div.jsoneditor td, -div.jsoneditor th { - padding: 0; - display: table-cell; - text-align: left; - vertical-align: inherit; - border-radius: inherit; -} - - -div.jsoneditor-field, -div.jsoneditor-value, -div.jsoneditor-readonly { - border: 1px solid transparent; - min-height: 16px; - min-width: 32px; - padding: 2px; - margin: 1px; - word-wrap: break-word; - float: left; -} - -/* adjust margin of p elements inside editable divs, needed for Opera, IE */ - -div.jsoneditor-field p, -div.jsoneditor-value p { - margin: 0; -} - -div.jsoneditor-value { - word-break: break-word; -} - -div.jsoneditor-readonly { - min-width: 16px; - color: gray; -} - -div.jsoneditor-empty { - border-color: lightgray; - border-style: dashed; - border-radius: 2px; -} - -div.jsoneditor-field.jsoneditor-empty::after, -div.jsoneditor-value.jsoneditor-empty::after { - pointer-events: none; - color: lightgray; - font-size: 8pt; -} - -div.jsoneditor-field.jsoneditor-empty::after { - content: "field"; -} - -div.jsoneditor-value.jsoneditor-empty::after { - content: "value"; -} - -div.jsoneditor-value.jsoneditor-url, -a.jsoneditor-value.jsoneditor-url { - color: green; - text-decoration: underline; -} - -a.jsoneditor-value.jsoneditor-url { - display: inline-block; - padding: 2px; - margin: 2px; -} - -a.jsoneditor-value.jsoneditor-url:hover, -a.jsoneditor-value.jsoneditor-url:focus { - color: #ee422e; -} - -div.jsoneditor td.jsoneditor-separator { - padding: 3px 0; - vertical-align: top; - color: gray; -} - -div.jsoneditor-field[contenteditable=true]:focus, -div.jsoneditor-field[contenteditable=true]:hover, -div.jsoneditor-value[contenteditable=true]:focus, -div.jsoneditor-value[contenteditable=true]:hover, -div.jsoneditor-field.jsoneditor-highlight, -div.jsoneditor-value.jsoneditor-highlight { - background-color: #FFFFAB; - border: 1px solid yellow; - border-radius: 2px; -} - -div.jsoneditor-field.jsoneditor-highlight-active, -div.jsoneditor-field.jsoneditor-highlight-active:focus, -div.jsoneditor-field.jsoneditor-highlight-active:hover, -div.jsoneditor-value.jsoneditor-highlight-active, -div.jsoneditor-value.jsoneditor-highlight-active:focus, -div.jsoneditor-value.jsoneditor-highlight-active:hover { - background-color: #ffee00; - border: 1px solid #ffc700; - border-radius: 2px; -} - -div.jsoneditor-value.jsoneditor-string { - color: #008000; -} - -div.jsoneditor-value.jsoneditor-object, -div.jsoneditor-value.jsoneditor-array { - min-width: 16px; - color: #808080; -} - -div.jsoneditor-value.jsoneditor-number { - color: #ee422e; -} - -div.jsoneditor-value.jsoneditor-boolean { - color: #ff8c00; -} - -div.jsoneditor-value.jsoneditor-null { - color: #004ED0; -} - -div.jsoneditor-value.jsoneditor-invalid { - color: #000000; -} - -div.jsoneditor-tree button { - width: 24px; - height: 24px; - padding: 0; - margin: 0; - border: none; - cursor: pointer; - background: transparent url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22 xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22 xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22 xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22 xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22 width%3D%22216%22 height%3D%22144%22 id%3D%22svg4136%22 version%3D%221.1%22 inkscape%3Aversion%3D%220.91 r%22 sodipodi%3Adocname%3D%22jsoneditor-icons.svg%22%3E %3Ctitle id%3D%22title6512%22%3EJSON Editor Icons%3C%2Ftitle%3E %3Cmetadata id%3D%22metadata4148%22%3E %3Crdf%3ARDF%3E %3Ccc%3AWork rdf%3Aabout%3D%22%22%3E %3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E %3Cdc%3Atype rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22 %2F%3E %3Cdc%3Atitle%3EJSON Editor Icons%3C%2Fdc%3Atitle%3E %3C%2Fcc%3AWork%3E %3C%2Frdf%3ARDF%3E %3C%2Fmetadata%3E %3Cdefs id%3D%22defs4146%22 %2F%3E %3Csodipodi%3Anamedview pagecolor%3D%22%23ffffff%22 bordercolor%3D%22%23666666%22 borderopacity%3D%221%22 objecttolerance%3D%2210%22 gridtolerance%3D%2210%22 guidetolerance%3D%2210%22 inkscape%3Apageopacity%3D%220%22 inkscape%3Apageshadow%3D%222%22 inkscape%3Awindow-width%3D%221920%22 inkscape%3Awindow-height%3D%221028%22 id%3D%22namedview4144%22 showgrid%3D%22true%22 inkscape%3Azoom%3D%224%22 inkscape%3Acx%3D%2297.217248%22 inkscape%3Acy%3D%2259.950227%22 inkscape%3Awindow-x%3D%220%22 inkscape%3Awindow-y%3D%220%22 inkscape%3Awindow-maximized%3D%221%22 inkscape%3Acurrent-layer%3D%22svg4136%22 showguides%3D%22false%22 borderlayer%3D%22false%22 inkscape%3Ashowpageshadow%3D%22true%22 showborder%3D%22true%22%3E %3Cinkscape%3Agrid type%3D%22xygrid%22 id%3D%22grid4640%22 empspacing%3D%2224%22 %2F%3E %3C%2Fsodipodi%3Anamedview%3E %3C!-- Created with SVG-edit - http%3A%2F%2Fsvg-edit.googlecode.com%2F --%3E %3Cg id%3D%22g4394%22%3E %3Crect x%3D%224%22 y%3D%224%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1%22 style%3D%22fill%3A%231aae1c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ec3f29%3Bfill-opacity%3A0.94117647%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1-7%22 %2F%3E %3Crect id%3D%22rect4165%22 height%3D%2216%22 width%3D%2216%22 y%3D%223.999995%22 x%3D%2252.000004%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%223.9999852%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175-3%22 %2F%3E %3Cg style%3D%22stroke%3Anone%22 id%3D%22g4299%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg style%3D%22stroke%3Anone%22 transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C12.000001)%22 id%3D%22g4299-3%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-0%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1-9%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%227.0000048%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5%22 %2F%3E %3Crect id%3D%22rect4354%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2210.00001%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%233c80df%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A0.94117647%22 x%3D%2258.000004%22 y%3D%2210.000005%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5-7%22 %2F%3E %3Cg id%3D%22g4378%22%3E %3Crect id%3D%22svg_1-7-5-3%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4374%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4376%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4383%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4385%22 %2F%3E %3Crect id%3D%22rect4387%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4389%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect y%3D%223.9999199%22 x%3D%2276%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-4%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351%22 d%3D%22m 85.10447%2C6.0157384 -0.0156%2C1.4063 c 3.02669%2C-0.2402 0.33008%2C3.6507996 2.48438%2C4.5780996 -2.18694%2C1.0938 0.49191%2C4.9069 -2.45313%2C4.5781 l -0.0156%2C1.4219 c 5.70828%2C0.559 1.03264%2C-5.1005 4.70313%2C-5.2656 l 0%2C-1.4063 c -3.61303%2C-0.027 1.11893%2C-5.7069996 -4.70313%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351-9%22 d%3D%22m 82.78125%2C5.9984384 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33007%2C3.6506996 -2.48437%2C4.5780996 2.18694%2C1.0938 -0.49192%2C4.9069 2.45312%2C4.5781 l 0.0156%2C1.4219 c -5.70827%2C0.559 -1.03263%2C-5.1004 -4.70312%2C-5.2656 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11894%2C-5.7070996 4.70312%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22100%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-25%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987%22 d%3D%22m 103.719%2C5.6719384 0%2C12.7187996 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.6249996 1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987-1%22 d%3D%22m 112.2185%2C5.6721984 0%2C12.7187996 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.6249996 -1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22124%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-73%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3780%22 d%3D%22m 126.2824%2C17.602938 1.78957%2C0 1.14143%2C-2.8641 5.65364%2C0 1.14856%2C2.8641 1.76565%2C0 -4.78687%2C-11.1610996 -1.91903%2C0 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3782%22 d%3D%22m 129.72704%2C13.478838 4.60852%2C0.01 -2.30426%2C-5.5497996 z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22148%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-35%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2%22 d%3D%22m 156.47655%2C5.8917384 0%2C2.1797 0.46093%2C2.3983996 1.82813%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2-8%22 d%3D%22m 152.51561%2C5.8906384 0%2C2.1797 0.46094%2C2.3983996 1.82812%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3C%2Fg%3E %3Crect x%3D%224%22 y%3D%2227.999994%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4432%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4434%22 %2F%3E %3Crect id%3D%22rect4436%22 height%3D%2216%22 width%3D%2216%22 y%3D%2227.99999%22 x%3D%2252.000004%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%2227.999981%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4446%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4448%22 %2F%3E %3Cg id%3D%22g4466%22 style%3D%22stroke%3Anone%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4468%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4470%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C35.999996)%22 id%3D%22g4472%22 style%3D%22stroke%3Anone%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4474%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4476%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%2231%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4478%22 %2F%3E %3Crect id%3D%22rect4480%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2234.000008%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 x%3D%2258.000004%22 y%3D%2234.000004%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4482%22 %2F%3E %3Cg id%3D%22g4484%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect id%3D%22rect4486%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4488%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4490%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4492%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C47.99999)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4494%22 %2F%3E %3Crect id%3D%22rect4496%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4498%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-8%22 width%3D%2216%22 height%3D%2216%22 x%3D%2276%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 85.10448%2C30.015537 -0.0156%2C1.4063 c 3.02668%2C-0.2402 0.33007%2C3.6508 2.48438%2C4.5781 -2.18695%2C1.0938 0.49191%2C4.90688 -2.45313%2C4.57808 l -0.0156%2C1.4219 c 5.70827%2C0.559 1.03263%2C-5.10048 4.70313%2C-5.26558 l 0%2C-1.4063 c -3.61304%2C-0.027 1.11893%2C-5.707 -4.70313%2C-5.3125 z%22 id%3D%22path4351-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 82.78126%2C29.998237 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33008%2C3.6507 -2.48438%2C4.5781 2.18694%2C1.0938 -0.49191%2C4.90688 2.45313%2C4.57808 l 0.0156%2C1.4219 c -5.70828%2C0.559 -1.03264%2C-5.10038 -4.70313%2C-5.26558 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11893%2C-5.7071 4.70313%2C-5.3125 z%22 id%3D%22path4351-9-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-65%22 width%3D%2216%22 height%3D%2216%22 x%3D%22100%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 103.719%2C29.671937 0%2C12.71878 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.62498 1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-8%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 112.2185%2C29.671937 0%2C12.71878 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.62498 -1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-1-9%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-92%22 width%3D%2216%22 height%3D%2216%22 x%3D%22124%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 126.2824%2C41.602917 1.78957%2C0 1.14143%2C-2.86408 5.65364%2C0 1.14856%2C2.86408 1.76565%2C0 -4.78687%2C-11.16108 -1.91902%2C0 z%22 id%3D%22path3780-9%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 129.72704%2C37.478837 4.60852%2C0.01 -2.30426%2C-5.5498 z%22 id%3D%22path3782-2%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-47%22 width%3D%2216%22 height%3D%2216%22 x%3D%22148%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 156.47656%2C29.891737 0%2C2.1797 0.46093%2C2.3984 1.82813%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 152.51562%2C29.890637 0%2C2.1797 0.46094%2C2.3984 1.82812%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-8-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Crect id%3D%22svg_1-7-2%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2264%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22svg_1-7-2-2%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2252%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2252%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4561%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2280.000008%22 y%3D%2258%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4563%22 %2F%3E %3Crect id%3D%22rect4565%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2258%22 x%3D%2285.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4567%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2264%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2264%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4569%22 %2F%3E %3Ccircle style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4571%22 cx%3D%22110.06081%22 cy%3D%2257.939209%22 r%3D%224.7438836%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22116.64566%22 y%3D%22-31.79752%22 width%3D%224.229713%22 height%3D%226.4053884%22 id%3D%22rect4563-2%22 transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 %2F%3E %3Cpath style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 125%2C56 138.77027%2C56.095 132%2C64 Z%22 id%3D%22path4613%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615%22 d%3D%22M 149%2C64 162.77027%2C63.905 156%2C56 Z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2254%22 y%3D%2253%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4638%22 %2F%3E %3Crect id%3D%22svg_1-7-2-24%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-56%22 x%3D%2253%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2253%22 y%3D%22-66%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4657%22 %2F%3E %3Crect id%3D%22rect4659%22 height%3D%220.99999291%22 width%3D%2211.999999%22 y%3D%2257%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2288.000122%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4661%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2276.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4663%22 %2F%3E %3Crect id%3D%22rect4665%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2276.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect id%3D%22rect4667%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2282.000122%22 x%3D%2280.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2285.000008%22 y%3D%2282.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4669%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2288.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4671%22 %2F%3E %3Crect id%3D%22rect4673%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2288.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Ccircle r%3D%224.7438836%22 cy%3D%2281.939331%22 cx%3D%22110.06081%22 id%3D%22circle4675%22 style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 id%3D%22rect4677%22 height%3D%226.4053884%22 width%3D%224.229713%22 y%3D%22-14.826816%22 x%3D%22133.6163%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4679%22 d%3D%22m 125%2C80.000005 13.77027%2C0.09499 L 132%2C87.999992 Z%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 149%2C88.0002 162.77027%2C87.9052 156%2C80.0002 Z%22 id%3D%22path4681%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Crect id%3D%22rect4683%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2277.000122%22 x%3D%2254%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2277.000122%22 y%3D%22-56%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4685%22 %2F%3E %3Crect id%3D%22rect4687%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-66%22 x%3D%2277.000122%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2281.000122%22 width%3D%2211.999999%22 height%3D%220.99999291%22 id%3D%22rect4689%22 %2F%3E %3Crect id%3D%22rect4761-1%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22101%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-0%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22105%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-7%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22109%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1%22 height%3D%221.9999945%22 width%3D%2212%22 y%3D%22125%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22137%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22129%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4-3%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22133%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C100.0254 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C100.5991 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1452 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533865%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550756%2C0 6.710442%2C-2.4113 7.650391%2C-5.9414 0.939949%2C-3.5301 -0.618463%2C-7.2736 -3.710938%2C-9.0703 -1.159678%2C-0.6738 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C99.9629 c -1.270084%2C0.039 -2.541493%2C0.3887 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5402 -3.710937%2C9.0703 0.939949%2C3.5301 4.09768%2C5.9414 7.648437%2C5.9414 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4056 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C100 0%2C2 -2.4999996%2C0 L 12%2C107 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 id%3D%22path3055-0-77%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9850574%2C108.015 14.0298856%2C-0.03%22 id%3D%22path5244-5-0-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9849874%2C132.015 14.0298866%2C-0.03%22 id%3D%22path5244-5-0-5-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C123.9629 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C124.5366 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1453 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533864%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550757%2C0 6.710442%2C-2.4093 7.650391%2C-5.9394 0.939949%2C-3.5301 -0.618463%2C-7.2756 -3.710938%2C-9.0723 -1.159678%2C-0.6737 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138-12%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C123.9629 c -1.270084%2C0.039 -2.541493%2C0.3888 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5422 -3.710937%2C9.0723 0.939949%2C3.5301 4.09768%2C5.9394 7.648437%2C5.9394 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4055 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1-3%22 %2F%3E %3Cpath id%3D%22path6191%22 d%3D%22m 10.5%2C116 0%2C-2 -2.4999996%2C0 L 12%2C109 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C129 0%2C-2 -2.4999996%2C0 L 12%2C122 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 id%3D%22path6193%22 %2F%3E %3Cpath id%3D%22path6195%22 d%3D%22m 10.5%2C135 0%2C2 -2.4999996%2C0 L 12%2C142 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4500%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073242 -3.833708%2C2.213392 -3.8337072%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.8337082%2C2.213392 z%22 inkscape%3Atransform-center-x%3D%22-1.2779026%22 %2F%3E %3Cpath inkscape%3Atransform-center-x%3D%221.277902%22 d%3D%22m -31.500004%2C60.073242 -3.833708%2C2.213392 -3.833707%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.833707%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Acx%3D%22-36.611614%22 sodipodi%3Asides%3D%223%22 id%3D%22path4502%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22scale(-1%2C1)%22 %2F%3E %3Cpath d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Asides%3D%223%22 id%3D%22path4504%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C72.0074%2C71.7877)%22 inkscape%3Atransform-center-y%3D%221.2779029%22 %2F%3E %3Cpath inkscape%3Atransform-center-y%3D%22-1.2779026%22 transform%3D%22matrix(0%2C-1%2C-1%2C0%2C96%2C96)%22 sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4506%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615-5%22 d%3D%22m 171.82574%2C65.174193 16.34854%2C0 -8.17427%2C-13.348454 z%22 style%3D%22fill%3A%23fbb917%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23fbb917%3Bstroke-width%3A1.65161395%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C55 0%2C6 2%2C0 0%2C-6%22 id%3D%22path4300%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C62 0%2C2 2%2C0 0%2C-2%22 id%3D%22path4300-6%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E%3C%2Fsvg%3E"); -} - -div.jsoneditor-mode-view tr.jsoneditor-expandable td.jsoneditor-tree, -div.jsoneditor-mode-form tr.jsoneditor-expandable td.jsoneditor-tree { - cursor: pointer; -} - -div.jsoneditor-tree button.jsoneditor-collapsed { - background-position: 0 -48px; -} - -div.jsoneditor-tree button.jsoneditor-expanded { - background-position: 0 -72px; -} - -div.jsoneditor-tree button.jsoneditor-contextmenu { - background-position: -48px -72px; -} - -div.jsoneditor-tree button.jsoneditor-contextmenu:hover, -div.jsoneditor-tree button.jsoneditor-contextmenu:focus, -div.jsoneditor-tree button.jsoneditor-contextmenu.jsoneditor-selected, -tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-contextmenu { - background-position: -48px -48px; -} - -div.jsoneditor-tree *:focus { - outline: none; -} - -div.jsoneditor-tree button:focus { - /* TODO: nice outline for buttons with focus - outline: #97B0F8 solid 2px; - box-shadow: 0 0 8px #97B0F8; - */ - background-color: #f5f5f5; - outline: #e5e5e5 solid 1px; -} - -div.jsoneditor-tree button.jsoneditor-invisible { - visibility: hidden; - background: none; -} - -div.jsoneditor { - color: #1A1A1A; - border: 1px solid #3883fa; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - width: 100%; - height: 100%; - overflow: hidden; - position: relative; - padding: 0; - line-height: 100%; -} - -div.jsoneditor-tree table.jsoneditor-tree { - border-collapse: collapse; - border-spacing: 0; - width: 100%; - margin: 0; -} - -div.jsoneditor-outer { - position: static; - width: 100%; - height: 100%; - margin: -35px 0 0 0; - padding: 35px 0 0 0; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -textarea.jsoneditor-text, -.ace-jsoneditor { - min-height: 150px; -} - -div.jsoneditor-tree { - width: 100%; - height: 100%; - position: relative; - overflow: auto; -} - -textarea.jsoneditor-text { - width: 100%; - height: 100%; - margin: 0; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - outline-width: 0; - border: none; - background-color: white; - resize: none; -} - -tr.jsoneditor-highlight, -tr.jsoneditor-selected { - background-color: #e6e6e6; -} - -tr.jsoneditor-selected button.jsoneditor-dragarea, -tr.jsoneditor-selected button.jsoneditor-contextmenu { - visibility: hidden; -} - -tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-dragarea, -tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-contextmenu { - visibility: visible; -} - -div.jsoneditor-tree button.jsoneditor-dragarea { - background: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22 xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22 xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22 xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22 xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22 width%3D%22216%22 height%3D%22144%22 id%3D%22svg4136%22 version%3D%221.1%22 inkscape%3Aversion%3D%220.91 r%22 sodipodi%3Adocname%3D%22jsoneditor-icons.svg%22%3E %3Ctitle id%3D%22title6512%22%3EJSON Editor Icons%3C%2Ftitle%3E %3Cmetadata id%3D%22metadata4148%22%3E %3Crdf%3ARDF%3E %3Ccc%3AWork rdf%3Aabout%3D%22%22%3E %3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E %3Cdc%3Atype rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22 %2F%3E %3Cdc%3Atitle%3EJSON Editor Icons%3C%2Fdc%3Atitle%3E %3C%2Fcc%3AWork%3E %3C%2Frdf%3ARDF%3E %3C%2Fmetadata%3E %3Cdefs id%3D%22defs4146%22 %2F%3E %3Csodipodi%3Anamedview pagecolor%3D%22%23ffffff%22 bordercolor%3D%22%23666666%22 borderopacity%3D%221%22 objecttolerance%3D%2210%22 gridtolerance%3D%2210%22 guidetolerance%3D%2210%22 inkscape%3Apageopacity%3D%220%22 inkscape%3Apageshadow%3D%222%22 inkscape%3Awindow-width%3D%221920%22 inkscape%3Awindow-height%3D%221028%22 id%3D%22namedview4144%22 showgrid%3D%22true%22 inkscape%3Azoom%3D%224%22 inkscape%3Acx%3D%2297.217248%22 inkscape%3Acy%3D%2259.950227%22 inkscape%3Awindow-x%3D%220%22 inkscape%3Awindow-y%3D%220%22 inkscape%3Awindow-maximized%3D%221%22 inkscape%3Acurrent-layer%3D%22svg4136%22 showguides%3D%22false%22 borderlayer%3D%22false%22 inkscape%3Ashowpageshadow%3D%22true%22 showborder%3D%22true%22%3E %3Cinkscape%3Agrid type%3D%22xygrid%22 id%3D%22grid4640%22 empspacing%3D%2224%22 %2F%3E %3C%2Fsodipodi%3Anamedview%3E %3C!-- Created with SVG-edit - http%3A%2F%2Fsvg-edit.googlecode.com%2F --%3E %3Cg id%3D%22g4394%22%3E %3Crect x%3D%224%22 y%3D%224%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1%22 style%3D%22fill%3A%231aae1c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ec3f29%3Bfill-opacity%3A0.94117647%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1-7%22 %2F%3E %3Crect id%3D%22rect4165%22 height%3D%2216%22 width%3D%2216%22 y%3D%223.999995%22 x%3D%2252.000004%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%223.9999852%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175-3%22 %2F%3E %3Cg style%3D%22stroke%3Anone%22 id%3D%22g4299%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg style%3D%22stroke%3Anone%22 transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C12.000001)%22 id%3D%22g4299-3%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-0%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1-9%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%227.0000048%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5%22 %2F%3E %3Crect id%3D%22rect4354%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2210.00001%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%233c80df%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A0.94117647%22 x%3D%2258.000004%22 y%3D%2210.000005%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5-7%22 %2F%3E %3Cg id%3D%22g4378%22%3E %3Crect id%3D%22svg_1-7-5-3%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4374%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4376%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4383%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4385%22 %2F%3E %3Crect id%3D%22rect4387%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4389%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect y%3D%223.9999199%22 x%3D%2276%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-4%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351%22 d%3D%22m 85.10447%2C6.0157384 -0.0156%2C1.4063 c 3.02669%2C-0.2402 0.33008%2C3.6507996 2.48438%2C4.5780996 -2.18694%2C1.0938 0.49191%2C4.9069 -2.45313%2C4.5781 l -0.0156%2C1.4219 c 5.70828%2C0.559 1.03264%2C-5.1005 4.70313%2C-5.2656 l 0%2C-1.4063 c -3.61303%2C-0.027 1.11893%2C-5.7069996 -4.70313%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351-9%22 d%3D%22m 82.78125%2C5.9984384 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33007%2C3.6506996 -2.48437%2C4.5780996 2.18694%2C1.0938 -0.49192%2C4.9069 2.45312%2C4.5781 l 0.0156%2C1.4219 c -5.70827%2C0.559 -1.03263%2C-5.1004 -4.70312%2C-5.2656 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11894%2C-5.7070996 4.70312%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22100%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-25%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987%22 d%3D%22m 103.719%2C5.6719384 0%2C12.7187996 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.6249996 1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987-1%22 d%3D%22m 112.2185%2C5.6721984 0%2C12.7187996 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.6249996 -1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22124%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-73%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3780%22 d%3D%22m 126.2824%2C17.602938 1.78957%2C0 1.14143%2C-2.8641 5.65364%2C0 1.14856%2C2.8641 1.76565%2C0 -4.78687%2C-11.1610996 -1.91903%2C0 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3782%22 d%3D%22m 129.72704%2C13.478838 4.60852%2C0.01 -2.30426%2C-5.5497996 z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22148%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-35%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2%22 d%3D%22m 156.47655%2C5.8917384 0%2C2.1797 0.46093%2C2.3983996 1.82813%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2-8%22 d%3D%22m 152.51561%2C5.8906384 0%2C2.1797 0.46094%2C2.3983996 1.82812%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3C%2Fg%3E %3Crect x%3D%224%22 y%3D%2227.999994%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4432%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4434%22 %2F%3E %3Crect id%3D%22rect4436%22 height%3D%2216%22 width%3D%2216%22 y%3D%2227.99999%22 x%3D%2252.000004%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%2227.999981%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4446%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4448%22 %2F%3E %3Cg id%3D%22g4466%22 style%3D%22stroke%3Anone%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4468%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4470%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C35.999996)%22 id%3D%22g4472%22 style%3D%22stroke%3Anone%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4474%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4476%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%2231%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4478%22 %2F%3E %3Crect id%3D%22rect4480%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2234.000008%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 x%3D%2258.000004%22 y%3D%2234.000004%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4482%22 %2F%3E %3Cg id%3D%22g4484%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect id%3D%22rect4486%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4488%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4490%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4492%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C47.99999)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4494%22 %2F%3E %3Crect id%3D%22rect4496%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4498%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-8%22 width%3D%2216%22 height%3D%2216%22 x%3D%2276%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 85.10448%2C30.015537 -0.0156%2C1.4063 c 3.02668%2C-0.2402 0.33007%2C3.6508 2.48438%2C4.5781 -2.18695%2C1.0938 0.49191%2C4.90688 -2.45313%2C4.57808 l -0.0156%2C1.4219 c 5.70827%2C0.559 1.03263%2C-5.10048 4.70313%2C-5.26558 l 0%2C-1.4063 c -3.61304%2C-0.027 1.11893%2C-5.707 -4.70313%2C-5.3125 z%22 id%3D%22path4351-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 82.78126%2C29.998237 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33008%2C3.6507 -2.48438%2C4.5781 2.18694%2C1.0938 -0.49191%2C4.90688 2.45313%2C4.57808 l 0.0156%2C1.4219 c -5.70828%2C0.559 -1.03264%2C-5.10038 -4.70313%2C-5.26558 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11893%2C-5.7071 4.70313%2C-5.3125 z%22 id%3D%22path4351-9-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-65%22 width%3D%2216%22 height%3D%2216%22 x%3D%22100%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 103.719%2C29.671937 0%2C12.71878 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.62498 1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-8%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 112.2185%2C29.671937 0%2C12.71878 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.62498 -1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-1-9%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-92%22 width%3D%2216%22 height%3D%2216%22 x%3D%22124%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 126.2824%2C41.602917 1.78957%2C0 1.14143%2C-2.86408 5.65364%2C0 1.14856%2C2.86408 1.76565%2C0 -4.78687%2C-11.16108 -1.91902%2C0 z%22 id%3D%22path3780-9%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 129.72704%2C37.478837 4.60852%2C0.01 -2.30426%2C-5.5498 z%22 id%3D%22path3782-2%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-47%22 width%3D%2216%22 height%3D%2216%22 x%3D%22148%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 156.47656%2C29.891737 0%2C2.1797 0.46093%2C2.3984 1.82813%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 152.51562%2C29.890637 0%2C2.1797 0.46094%2C2.3984 1.82812%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-8-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Crect id%3D%22svg_1-7-2%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2264%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22svg_1-7-2-2%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2252%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2252%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4561%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2280.000008%22 y%3D%2258%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4563%22 %2F%3E %3Crect id%3D%22rect4565%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2258%22 x%3D%2285.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4567%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2264%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2264%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4569%22 %2F%3E %3Ccircle style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4571%22 cx%3D%22110.06081%22 cy%3D%2257.939209%22 r%3D%224.7438836%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22116.64566%22 y%3D%22-31.79752%22 width%3D%224.229713%22 height%3D%226.4053884%22 id%3D%22rect4563-2%22 transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 %2F%3E %3Cpath style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 125%2C56 138.77027%2C56.095 132%2C64 Z%22 id%3D%22path4613%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615%22 d%3D%22M 149%2C64 162.77027%2C63.905 156%2C56 Z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2254%22 y%3D%2253%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4638%22 %2F%3E %3Crect id%3D%22svg_1-7-2-24%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-56%22 x%3D%2253%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2253%22 y%3D%22-66%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4657%22 %2F%3E %3Crect id%3D%22rect4659%22 height%3D%220.99999291%22 width%3D%2211.999999%22 y%3D%2257%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2288.000122%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4661%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2276.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4663%22 %2F%3E %3Crect id%3D%22rect4665%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2276.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect id%3D%22rect4667%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2282.000122%22 x%3D%2280.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2285.000008%22 y%3D%2282.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4669%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2288.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4671%22 %2F%3E %3Crect id%3D%22rect4673%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2288.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Ccircle r%3D%224.7438836%22 cy%3D%2281.939331%22 cx%3D%22110.06081%22 id%3D%22circle4675%22 style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 id%3D%22rect4677%22 height%3D%226.4053884%22 width%3D%224.229713%22 y%3D%22-14.826816%22 x%3D%22133.6163%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4679%22 d%3D%22m 125%2C80.000005 13.77027%2C0.09499 L 132%2C87.999992 Z%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 149%2C88.0002 162.77027%2C87.9052 156%2C80.0002 Z%22 id%3D%22path4681%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Crect id%3D%22rect4683%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2277.000122%22 x%3D%2254%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2277.000122%22 y%3D%22-56%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4685%22 %2F%3E %3Crect id%3D%22rect4687%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-66%22 x%3D%2277.000122%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2281.000122%22 width%3D%2211.999999%22 height%3D%220.99999291%22 id%3D%22rect4689%22 %2F%3E %3Crect id%3D%22rect4761-1%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22101%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-0%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22105%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-7%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22109%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1%22 height%3D%221.9999945%22 width%3D%2212%22 y%3D%22125%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22137%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22129%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4-3%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22133%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C100.0254 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C100.5991 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1452 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533865%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550756%2C0 6.710442%2C-2.4113 7.650391%2C-5.9414 0.939949%2C-3.5301 -0.618463%2C-7.2736 -3.710938%2C-9.0703 -1.159678%2C-0.6738 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C99.9629 c -1.270084%2C0.039 -2.541493%2C0.3887 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5402 -3.710937%2C9.0703 0.939949%2C3.5301 4.09768%2C5.9414 7.648437%2C5.9414 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4056 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C100 0%2C2 -2.4999996%2C0 L 12%2C107 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 id%3D%22path3055-0-77%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9850574%2C108.015 14.0298856%2C-0.03%22 id%3D%22path5244-5-0-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9849874%2C132.015 14.0298866%2C-0.03%22 id%3D%22path5244-5-0-5-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C123.9629 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C124.5366 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1453 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533864%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550757%2C0 6.710442%2C-2.4093 7.650391%2C-5.9394 0.939949%2C-3.5301 -0.618463%2C-7.2756 -3.710938%2C-9.0723 -1.159678%2C-0.6737 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138-12%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C123.9629 c -1.270084%2C0.039 -2.541493%2C0.3888 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5422 -3.710937%2C9.0723 0.939949%2C3.5301 4.09768%2C5.9394 7.648437%2C5.9394 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4055 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1-3%22 %2F%3E %3Cpath id%3D%22path6191%22 d%3D%22m 10.5%2C116 0%2C-2 -2.4999996%2C0 L 12%2C109 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C129 0%2C-2 -2.4999996%2C0 L 12%2C122 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 id%3D%22path6193%22 %2F%3E %3Cpath id%3D%22path6195%22 d%3D%22m 10.5%2C135 0%2C2 -2.4999996%2C0 L 12%2C142 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4500%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073242 -3.833708%2C2.213392 -3.8337072%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.8337082%2C2.213392 z%22 inkscape%3Atransform-center-x%3D%22-1.2779026%22 %2F%3E %3Cpath inkscape%3Atransform-center-x%3D%221.277902%22 d%3D%22m -31.500004%2C60.073242 -3.833708%2C2.213392 -3.833707%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.833707%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Acx%3D%22-36.611614%22 sodipodi%3Asides%3D%223%22 id%3D%22path4502%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22scale(-1%2C1)%22 %2F%3E %3Cpath d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Asides%3D%223%22 id%3D%22path4504%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C72.0074%2C71.7877)%22 inkscape%3Atransform-center-y%3D%221.2779029%22 %2F%3E %3Cpath inkscape%3Atransform-center-y%3D%22-1.2779026%22 transform%3D%22matrix(0%2C-1%2C-1%2C0%2C96%2C96)%22 sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4506%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615-5%22 d%3D%22m 171.82574%2C65.174193 16.34854%2C0 -8.17427%2C-13.348454 z%22 style%3D%22fill%3A%23fbb917%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23fbb917%3Bstroke-width%3A1.65161395%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C55 0%2C6 2%2C0 0%2C-6%22 id%3D%22path4300%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C62 0%2C2 2%2C0 0%2C-2%22 id%3D%22path4300-6%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E%3C%2Fsvg%3E") -72px -72px; - cursor: move; -} - -div.jsoneditor-tree button.jsoneditor-dragarea:hover, -div.jsoneditor-tree button.jsoneditor-dragarea:focus, -tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-dragarea { - background-position: -72px -48px; -} - -div.jsoneditor tr, -div.jsoneditor th, -div.jsoneditor td { - padding: 0; - margin: 0; -} - -div.jsoneditor td { - vertical-align: top; -} - -div.jsoneditor td.jsoneditor-tree { - vertical-align: top; -} - -div.jsoneditor-field, -div.jsoneditor-value, -div.jsoneditor td, -div.jsoneditor th, -div.jsoneditor textarea, -.jsoneditor-schema-error { - font-family: droid sans mono, consolas, monospace, courier new, courier, sans-serif; - font-size: 10pt; - color: #1A1A1A; -} - -/* popover */ - -.jsoneditor-schema-error { - cursor: default; - display: inline-block; - /*font-family: arial, sans-serif;*/ - height: 24px; - line-height: 24px; - position: relative; - text-align: center; - width: 24px; -} - -div.jsoneditor-tree .jsoneditor-schema-error { - width: 24px; - height: 24px; - padding: 0; - margin: 0 4px 0 0; - background: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22 xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22 xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22 xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22 xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22 width%3D%22216%22 height%3D%22144%22 id%3D%22svg4136%22 version%3D%221.1%22 inkscape%3Aversion%3D%220.91 r%22 sodipodi%3Adocname%3D%22jsoneditor-icons.svg%22%3E %3Ctitle id%3D%22title6512%22%3EJSON Editor Icons%3C%2Ftitle%3E %3Cmetadata id%3D%22metadata4148%22%3E %3Crdf%3ARDF%3E %3Ccc%3AWork rdf%3Aabout%3D%22%22%3E %3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E %3Cdc%3Atype rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22 %2F%3E %3Cdc%3Atitle%3EJSON Editor Icons%3C%2Fdc%3Atitle%3E %3C%2Fcc%3AWork%3E %3C%2Frdf%3ARDF%3E %3C%2Fmetadata%3E %3Cdefs id%3D%22defs4146%22 %2F%3E %3Csodipodi%3Anamedview pagecolor%3D%22%23ffffff%22 bordercolor%3D%22%23666666%22 borderopacity%3D%221%22 objecttolerance%3D%2210%22 gridtolerance%3D%2210%22 guidetolerance%3D%2210%22 inkscape%3Apageopacity%3D%220%22 inkscape%3Apageshadow%3D%222%22 inkscape%3Awindow-width%3D%221920%22 inkscape%3Awindow-height%3D%221028%22 id%3D%22namedview4144%22 showgrid%3D%22true%22 inkscape%3Azoom%3D%224%22 inkscape%3Acx%3D%2297.217248%22 inkscape%3Acy%3D%2259.950227%22 inkscape%3Awindow-x%3D%220%22 inkscape%3Awindow-y%3D%220%22 inkscape%3Awindow-maximized%3D%221%22 inkscape%3Acurrent-layer%3D%22svg4136%22 showguides%3D%22false%22 borderlayer%3D%22false%22 inkscape%3Ashowpageshadow%3D%22true%22 showborder%3D%22true%22%3E %3Cinkscape%3Agrid type%3D%22xygrid%22 id%3D%22grid4640%22 empspacing%3D%2224%22 %2F%3E %3C%2Fsodipodi%3Anamedview%3E %3C!-- Created with SVG-edit - http%3A%2F%2Fsvg-edit.googlecode.com%2F --%3E %3Cg id%3D%22g4394%22%3E %3Crect x%3D%224%22 y%3D%224%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1%22 style%3D%22fill%3A%231aae1c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ec3f29%3Bfill-opacity%3A0.94117647%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1-7%22 %2F%3E %3Crect id%3D%22rect4165%22 height%3D%2216%22 width%3D%2216%22 y%3D%223.999995%22 x%3D%2252.000004%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%223.9999852%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175-3%22 %2F%3E %3Cg style%3D%22stroke%3Anone%22 id%3D%22g4299%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg style%3D%22stroke%3Anone%22 transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C12.000001)%22 id%3D%22g4299-3%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-0%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1-9%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%227.0000048%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5%22 %2F%3E %3Crect id%3D%22rect4354%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2210.00001%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%233c80df%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A0.94117647%22 x%3D%2258.000004%22 y%3D%2210.000005%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5-7%22 %2F%3E %3Cg id%3D%22g4378%22%3E %3Crect id%3D%22svg_1-7-5-3%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4374%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4376%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4383%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4385%22 %2F%3E %3Crect id%3D%22rect4387%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4389%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect y%3D%223.9999199%22 x%3D%2276%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-4%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351%22 d%3D%22m 85.10447%2C6.0157384 -0.0156%2C1.4063 c 3.02669%2C-0.2402 0.33008%2C3.6507996 2.48438%2C4.5780996 -2.18694%2C1.0938 0.49191%2C4.9069 -2.45313%2C4.5781 l -0.0156%2C1.4219 c 5.70828%2C0.559 1.03264%2C-5.1005 4.70313%2C-5.2656 l 0%2C-1.4063 c -3.61303%2C-0.027 1.11893%2C-5.7069996 -4.70313%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351-9%22 d%3D%22m 82.78125%2C5.9984384 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33007%2C3.6506996 -2.48437%2C4.5780996 2.18694%2C1.0938 -0.49192%2C4.9069 2.45312%2C4.5781 l 0.0156%2C1.4219 c -5.70827%2C0.559 -1.03263%2C-5.1004 -4.70312%2C-5.2656 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11894%2C-5.7070996 4.70312%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22100%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-25%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987%22 d%3D%22m 103.719%2C5.6719384 0%2C12.7187996 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.6249996 1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987-1%22 d%3D%22m 112.2185%2C5.6721984 0%2C12.7187996 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.6249996 -1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22124%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-73%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3780%22 d%3D%22m 126.2824%2C17.602938 1.78957%2C0 1.14143%2C-2.8641 5.65364%2C0 1.14856%2C2.8641 1.76565%2C0 -4.78687%2C-11.1610996 -1.91903%2C0 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3782%22 d%3D%22m 129.72704%2C13.478838 4.60852%2C0.01 -2.30426%2C-5.5497996 z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22148%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-35%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2%22 d%3D%22m 156.47655%2C5.8917384 0%2C2.1797 0.46093%2C2.3983996 1.82813%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2-8%22 d%3D%22m 152.51561%2C5.8906384 0%2C2.1797 0.46094%2C2.3983996 1.82812%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3C%2Fg%3E %3Crect x%3D%224%22 y%3D%2227.999994%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4432%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4434%22 %2F%3E %3Crect id%3D%22rect4436%22 height%3D%2216%22 width%3D%2216%22 y%3D%2227.99999%22 x%3D%2252.000004%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%2227.999981%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4446%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4448%22 %2F%3E %3Cg id%3D%22g4466%22 style%3D%22stroke%3Anone%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4468%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4470%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C35.999996)%22 id%3D%22g4472%22 style%3D%22stroke%3Anone%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4474%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4476%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%2231%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4478%22 %2F%3E %3Crect id%3D%22rect4480%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2234.000008%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 x%3D%2258.000004%22 y%3D%2234.000004%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4482%22 %2F%3E %3Cg id%3D%22g4484%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect id%3D%22rect4486%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4488%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4490%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4492%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C47.99999)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4494%22 %2F%3E %3Crect id%3D%22rect4496%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4498%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-8%22 width%3D%2216%22 height%3D%2216%22 x%3D%2276%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 85.10448%2C30.015537 -0.0156%2C1.4063 c 3.02668%2C-0.2402 0.33007%2C3.6508 2.48438%2C4.5781 -2.18695%2C1.0938 0.49191%2C4.90688 -2.45313%2C4.57808 l -0.0156%2C1.4219 c 5.70827%2C0.559 1.03263%2C-5.10048 4.70313%2C-5.26558 l 0%2C-1.4063 c -3.61304%2C-0.027 1.11893%2C-5.707 -4.70313%2C-5.3125 z%22 id%3D%22path4351-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 82.78126%2C29.998237 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33008%2C3.6507 -2.48438%2C4.5781 2.18694%2C1.0938 -0.49191%2C4.90688 2.45313%2C4.57808 l 0.0156%2C1.4219 c -5.70828%2C0.559 -1.03264%2C-5.10038 -4.70313%2C-5.26558 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11893%2C-5.7071 4.70313%2C-5.3125 z%22 id%3D%22path4351-9-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-65%22 width%3D%2216%22 height%3D%2216%22 x%3D%22100%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 103.719%2C29.671937 0%2C12.71878 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.62498 1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-8%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 112.2185%2C29.671937 0%2C12.71878 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.62498 -1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-1-9%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-92%22 width%3D%2216%22 height%3D%2216%22 x%3D%22124%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 126.2824%2C41.602917 1.78957%2C0 1.14143%2C-2.86408 5.65364%2C0 1.14856%2C2.86408 1.76565%2C0 -4.78687%2C-11.16108 -1.91902%2C0 z%22 id%3D%22path3780-9%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 129.72704%2C37.478837 4.60852%2C0.01 -2.30426%2C-5.5498 z%22 id%3D%22path3782-2%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-47%22 width%3D%2216%22 height%3D%2216%22 x%3D%22148%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 156.47656%2C29.891737 0%2C2.1797 0.46093%2C2.3984 1.82813%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 152.51562%2C29.890637 0%2C2.1797 0.46094%2C2.3984 1.82812%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-8-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Crect id%3D%22svg_1-7-2%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2264%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22svg_1-7-2-2%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2252%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2252%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4561%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2280.000008%22 y%3D%2258%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4563%22 %2F%3E %3Crect id%3D%22rect4565%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2258%22 x%3D%2285.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4567%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2264%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2264%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4569%22 %2F%3E %3Ccircle style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4571%22 cx%3D%22110.06081%22 cy%3D%2257.939209%22 r%3D%224.7438836%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22116.64566%22 y%3D%22-31.79752%22 width%3D%224.229713%22 height%3D%226.4053884%22 id%3D%22rect4563-2%22 transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 %2F%3E %3Cpath style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 125%2C56 138.77027%2C56.095 132%2C64 Z%22 id%3D%22path4613%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615%22 d%3D%22M 149%2C64 162.77027%2C63.905 156%2C56 Z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2254%22 y%3D%2253%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4638%22 %2F%3E %3Crect id%3D%22svg_1-7-2-24%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-56%22 x%3D%2253%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2253%22 y%3D%22-66%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4657%22 %2F%3E %3Crect id%3D%22rect4659%22 height%3D%220.99999291%22 width%3D%2211.999999%22 y%3D%2257%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2288.000122%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4661%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2276.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4663%22 %2F%3E %3Crect id%3D%22rect4665%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2276.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect id%3D%22rect4667%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2282.000122%22 x%3D%2280.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2285.000008%22 y%3D%2282.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4669%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2288.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4671%22 %2F%3E %3Crect id%3D%22rect4673%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2288.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Ccircle r%3D%224.7438836%22 cy%3D%2281.939331%22 cx%3D%22110.06081%22 id%3D%22circle4675%22 style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 id%3D%22rect4677%22 height%3D%226.4053884%22 width%3D%224.229713%22 y%3D%22-14.826816%22 x%3D%22133.6163%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4679%22 d%3D%22m 125%2C80.000005 13.77027%2C0.09499 L 132%2C87.999992 Z%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 149%2C88.0002 162.77027%2C87.9052 156%2C80.0002 Z%22 id%3D%22path4681%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Crect id%3D%22rect4683%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2277.000122%22 x%3D%2254%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2277.000122%22 y%3D%22-56%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4685%22 %2F%3E %3Crect id%3D%22rect4687%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-66%22 x%3D%2277.000122%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2281.000122%22 width%3D%2211.999999%22 height%3D%220.99999291%22 id%3D%22rect4689%22 %2F%3E %3Crect id%3D%22rect4761-1%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22101%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-0%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22105%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-7%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22109%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1%22 height%3D%221.9999945%22 width%3D%2212%22 y%3D%22125%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22137%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22129%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4-3%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22133%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C100.0254 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C100.5991 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1452 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533865%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550756%2C0 6.710442%2C-2.4113 7.650391%2C-5.9414 0.939949%2C-3.5301 -0.618463%2C-7.2736 -3.710938%2C-9.0703 -1.159678%2C-0.6738 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C99.9629 c -1.270084%2C0.039 -2.541493%2C0.3887 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5402 -3.710937%2C9.0703 0.939949%2C3.5301 4.09768%2C5.9414 7.648437%2C5.9414 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4056 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C100 0%2C2 -2.4999996%2C0 L 12%2C107 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 id%3D%22path3055-0-77%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9850574%2C108.015 14.0298856%2C-0.03%22 id%3D%22path5244-5-0-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9849874%2C132.015 14.0298866%2C-0.03%22 id%3D%22path5244-5-0-5-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C123.9629 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C124.5366 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1453 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533864%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550757%2C0 6.710442%2C-2.4093 7.650391%2C-5.9394 0.939949%2C-3.5301 -0.618463%2C-7.2756 -3.710938%2C-9.0723 -1.159678%2C-0.6737 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138-12%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C123.9629 c -1.270084%2C0.039 -2.541493%2C0.3888 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5422 -3.710937%2C9.0723 0.939949%2C3.5301 4.09768%2C5.9394 7.648437%2C5.9394 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4055 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1-3%22 %2F%3E %3Cpath id%3D%22path6191%22 d%3D%22m 10.5%2C116 0%2C-2 -2.4999996%2C0 L 12%2C109 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C129 0%2C-2 -2.4999996%2C0 L 12%2C122 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 id%3D%22path6193%22 %2F%3E %3Cpath id%3D%22path6195%22 d%3D%22m 10.5%2C135 0%2C2 -2.4999996%2C0 L 12%2C142 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4500%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073242 -3.833708%2C2.213392 -3.8337072%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.8337082%2C2.213392 z%22 inkscape%3Atransform-center-x%3D%22-1.2779026%22 %2F%3E %3Cpath inkscape%3Atransform-center-x%3D%221.277902%22 d%3D%22m -31.500004%2C60.073242 -3.833708%2C2.213392 -3.833707%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.833707%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Acx%3D%22-36.611614%22 sodipodi%3Asides%3D%223%22 id%3D%22path4502%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22scale(-1%2C1)%22 %2F%3E %3Cpath d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Asides%3D%223%22 id%3D%22path4504%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C72.0074%2C71.7877)%22 inkscape%3Atransform-center-y%3D%221.2779029%22 %2F%3E %3Cpath inkscape%3Atransform-center-y%3D%22-1.2779026%22 transform%3D%22matrix(0%2C-1%2C-1%2C0%2C96%2C96)%22 sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4506%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615-5%22 d%3D%22m 171.82574%2C65.174193 16.34854%2C0 -8.17427%2C-13.348454 z%22 style%3D%22fill%3A%23fbb917%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23fbb917%3Bstroke-width%3A1.65161395%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C55 0%2C6 2%2C0 0%2C-6%22 id%3D%22path4300%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C62 0%2C2 2%2C0 0%2C-2%22 id%3D%22path4300-6%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E%3C%2Fsvg%3E") -168px -48px; -} - -.jsoneditor-schema-error .jsoneditor-popover { - background-color: #4c4c4c; - border-radius: 3px; - box-shadow: 0 0 5px rgba(0,0,0,0.4); - color: #fff; - display: none; - padding: 7px 10px; - position: absolute; - width: 200px; - z-index: 4; -} - -.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-above { - bottom: 32px; - left: -98px; -} - -.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-below { - top: 32px; - left: -98px; -} - -.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-left { - top: -7px; - right: 32px; -} - -.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-right { - top: -7px; - left: 32px; -} - -.jsoneditor-schema-error .jsoneditor-popover:before { - border-right: 7px solid transparent; - border-left: 7px solid transparent; - content: ''; - display: block; - left: 50%; - margin-left: -7px; - position: absolute; -} - -.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-above:before { - border-top: 7px solid #4c4c4c; - bottom: -7px; -} - -.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-below:before { - border-bottom: 7px solid #4c4c4c; - top: -7px; -} - -.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-left:before { - border-left: 7px solid #4c4c4c; - border-top: 7px solid transparent; - border-bottom: 7px solid transparent; - content: ''; - top: 19px; - right: -14px; - left: inherit; - margin-left: inherit; - margin-top: -7px; - position: absolute; -} - -.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-right:before { - border-right: 7px solid #4c4c4c; - border-top: 7px solid transparent; - border-bottom: 7px solid transparent; - content: ''; - top: 19px; - left: -14px; - margin-left: inherit; - margin-top: -7px; - position: absolute; -} - -.jsoneditor-schema-error:hover .jsoneditor-popover, -.jsoneditor-schema-error:focus .jsoneditor-popover { - display: block; - -webkit-animation: fade-in .3s linear 1, move-up .3s linear 1; - -moz-animation: fade-in .3s linear 1, move-up .3s linear 1; - -ms-animation: fade-in .3s linear 1, move-up .3s linear 1; -} - -@-webkit-keyframes fade-in { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} - -@-moz-keyframes fade-in { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} - -@-ms-keyframes fade-in { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} - -/*@-webkit-keyframes move-up {*/ - -/*from { bottom: 24px; }*/ - -/*to { bottom: 32px; }*/ - -/*}*/ - -/*@-moz-keyframes move-up {*/ - -/*from { bottom: 24px; }*/ - -/*to { bottom: 32px; }*/ - -/*}*/ - -/*@-ms-keyframes move-up {*/ - -/*from { bottom: 24px; }*/ - -/*to { bottom: 32px; }*/ - -/*}*/ - -/* JSON schema errors displayed at the bottom of the editor in mode text and code */ - -.jsoneditor .jsoneditor-text-errors { - width: 100%; - border-collapse: collapse; - background-color: #ffef8b; - border-top: 1px solid #ffd700; -} - -.jsoneditor .jsoneditor-text-errors td { - padding: 3px 6px; - vertical-align: middle; -} - -.jsoneditor-text-errors .jsoneditor-schema-error { - border: none; - width: 24px; - height: 24px; - padding: 0; - margin: 0 4px 0 0; - background: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22 xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22 xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22 xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22 xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22 width%3D%22216%22 height%3D%22144%22 id%3D%22svg4136%22 version%3D%221.1%22 inkscape%3Aversion%3D%220.91 r%22 sodipodi%3Adocname%3D%22jsoneditor-icons.svg%22%3E %3Ctitle id%3D%22title6512%22%3EJSON Editor Icons%3C%2Ftitle%3E %3Cmetadata id%3D%22metadata4148%22%3E %3Crdf%3ARDF%3E %3Ccc%3AWork rdf%3Aabout%3D%22%22%3E %3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E %3Cdc%3Atype rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22 %2F%3E %3Cdc%3Atitle%3EJSON Editor Icons%3C%2Fdc%3Atitle%3E %3C%2Fcc%3AWork%3E %3C%2Frdf%3ARDF%3E %3C%2Fmetadata%3E %3Cdefs id%3D%22defs4146%22 %2F%3E %3Csodipodi%3Anamedview pagecolor%3D%22%23ffffff%22 bordercolor%3D%22%23666666%22 borderopacity%3D%221%22 objecttolerance%3D%2210%22 gridtolerance%3D%2210%22 guidetolerance%3D%2210%22 inkscape%3Apageopacity%3D%220%22 inkscape%3Apageshadow%3D%222%22 inkscape%3Awindow-width%3D%221920%22 inkscape%3Awindow-height%3D%221028%22 id%3D%22namedview4144%22 showgrid%3D%22true%22 inkscape%3Azoom%3D%224%22 inkscape%3Acx%3D%2297.217248%22 inkscape%3Acy%3D%2259.950227%22 inkscape%3Awindow-x%3D%220%22 inkscape%3Awindow-y%3D%220%22 inkscape%3Awindow-maximized%3D%221%22 inkscape%3Acurrent-layer%3D%22svg4136%22 showguides%3D%22false%22 borderlayer%3D%22false%22 inkscape%3Ashowpageshadow%3D%22true%22 showborder%3D%22true%22%3E %3Cinkscape%3Agrid type%3D%22xygrid%22 id%3D%22grid4640%22 empspacing%3D%2224%22 %2F%3E %3C%2Fsodipodi%3Anamedview%3E %3C!-- Created with SVG-edit - http%3A%2F%2Fsvg-edit.googlecode.com%2F --%3E %3Cg id%3D%22g4394%22%3E %3Crect x%3D%224%22 y%3D%224%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1%22 style%3D%22fill%3A%231aae1c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ec3f29%3Bfill-opacity%3A0.94117647%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1-7%22 %2F%3E %3Crect id%3D%22rect4165%22 height%3D%2216%22 width%3D%2216%22 y%3D%223.999995%22 x%3D%2252.000004%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%223.9999852%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175-3%22 %2F%3E %3Cg style%3D%22stroke%3Anone%22 id%3D%22g4299%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg style%3D%22stroke%3Anone%22 transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C12.000001)%22 id%3D%22g4299-3%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-0%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1-9%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%227.0000048%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5%22 %2F%3E %3Crect id%3D%22rect4354%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2210.00001%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%233c80df%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A0.94117647%22 x%3D%2258.000004%22 y%3D%2210.000005%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5-7%22 %2F%3E %3Cg id%3D%22g4378%22%3E %3Crect id%3D%22svg_1-7-5-3%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4374%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4376%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4383%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4385%22 %2F%3E %3Crect id%3D%22rect4387%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4389%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect y%3D%223.9999199%22 x%3D%2276%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-4%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351%22 d%3D%22m 85.10447%2C6.0157384 -0.0156%2C1.4063 c 3.02669%2C-0.2402 0.33008%2C3.6507996 2.48438%2C4.5780996 -2.18694%2C1.0938 0.49191%2C4.9069 -2.45313%2C4.5781 l -0.0156%2C1.4219 c 5.70828%2C0.559 1.03264%2C-5.1005 4.70313%2C-5.2656 l 0%2C-1.4063 c -3.61303%2C-0.027 1.11893%2C-5.7069996 -4.70313%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351-9%22 d%3D%22m 82.78125%2C5.9984384 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33007%2C3.6506996 -2.48437%2C4.5780996 2.18694%2C1.0938 -0.49192%2C4.9069 2.45312%2C4.5781 l 0.0156%2C1.4219 c -5.70827%2C0.559 -1.03263%2C-5.1004 -4.70312%2C-5.2656 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11894%2C-5.7070996 4.70312%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22100%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-25%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987%22 d%3D%22m 103.719%2C5.6719384 0%2C12.7187996 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.6249996 1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987-1%22 d%3D%22m 112.2185%2C5.6721984 0%2C12.7187996 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.6249996 -1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22124%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-73%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3780%22 d%3D%22m 126.2824%2C17.602938 1.78957%2C0 1.14143%2C-2.8641 5.65364%2C0 1.14856%2C2.8641 1.76565%2C0 -4.78687%2C-11.1610996 -1.91903%2C0 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3782%22 d%3D%22m 129.72704%2C13.478838 4.60852%2C0.01 -2.30426%2C-5.5497996 z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22148%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-35%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2%22 d%3D%22m 156.47655%2C5.8917384 0%2C2.1797 0.46093%2C2.3983996 1.82813%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2-8%22 d%3D%22m 152.51561%2C5.8906384 0%2C2.1797 0.46094%2C2.3983996 1.82812%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3C%2Fg%3E %3Crect x%3D%224%22 y%3D%2227.999994%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4432%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4434%22 %2F%3E %3Crect id%3D%22rect4436%22 height%3D%2216%22 width%3D%2216%22 y%3D%2227.99999%22 x%3D%2252.000004%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%2227.999981%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4446%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4448%22 %2F%3E %3Cg id%3D%22g4466%22 style%3D%22stroke%3Anone%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4468%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4470%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C35.999996)%22 id%3D%22g4472%22 style%3D%22stroke%3Anone%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4474%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4476%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%2231%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4478%22 %2F%3E %3Crect id%3D%22rect4480%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2234.000008%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 x%3D%2258.000004%22 y%3D%2234.000004%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4482%22 %2F%3E %3Cg id%3D%22g4484%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect id%3D%22rect4486%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4488%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4490%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4492%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C47.99999)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4494%22 %2F%3E %3Crect id%3D%22rect4496%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4498%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-8%22 width%3D%2216%22 height%3D%2216%22 x%3D%2276%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 85.10448%2C30.015537 -0.0156%2C1.4063 c 3.02668%2C-0.2402 0.33007%2C3.6508 2.48438%2C4.5781 -2.18695%2C1.0938 0.49191%2C4.90688 -2.45313%2C4.57808 l -0.0156%2C1.4219 c 5.70827%2C0.559 1.03263%2C-5.10048 4.70313%2C-5.26558 l 0%2C-1.4063 c -3.61304%2C-0.027 1.11893%2C-5.707 -4.70313%2C-5.3125 z%22 id%3D%22path4351-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 82.78126%2C29.998237 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33008%2C3.6507 -2.48438%2C4.5781 2.18694%2C1.0938 -0.49191%2C4.90688 2.45313%2C4.57808 l 0.0156%2C1.4219 c -5.70828%2C0.559 -1.03264%2C-5.10038 -4.70313%2C-5.26558 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11893%2C-5.7071 4.70313%2C-5.3125 z%22 id%3D%22path4351-9-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-65%22 width%3D%2216%22 height%3D%2216%22 x%3D%22100%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 103.719%2C29.671937 0%2C12.71878 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.62498 1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-8%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 112.2185%2C29.671937 0%2C12.71878 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.62498 -1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-1-9%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-92%22 width%3D%2216%22 height%3D%2216%22 x%3D%22124%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 126.2824%2C41.602917 1.78957%2C0 1.14143%2C-2.86408 5.65364%2C0 1.14856%2C2.86408 1.76565%2C0 -4.78687%2C-11.16108 -1.91902%2C0 z%22 id%3D%22path3780-9%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 129.72704%2C37.478837 4.60852%2C0.01 -2.30426%2C-5.5498 z%22 id%3D%22path3782-2%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-47%22 width%3D%2216%22 height%3D%2216%22 x%3D%22148%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 156.47656%2C29.891737 0%2C2.1797 0.46093%2C2.3984 1.82813%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 152.51562%2C29.890637 0%2C2.1797 0.46094%2C2.3984 1.82812%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-8-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Crect id%3D%22svg_1-7-2%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2264%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22svg_1-7-2-2%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2252%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2252%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4561%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2280.000008%22 y%3D%2258%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4563%22 %2F%3E %3Crect id%3D%22rect4565%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2258%22 x%3D%2285.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4567%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2264%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2264%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4569%22 %2F%3E %3Ccircle style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4571%22 cx%3D%22110.06081%22 cy%3D%2257.939209%22 r%3D%224.7438836%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22116.64566%22 y%3D%22-31.79752%22 width%3D%224.229713%22 height%3D%226.4053884%22 id%3D%22rect4563-2%22 transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 %2F%3E %3Cpath style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 125%2C56 138.77027%2C56.095 132%2C64 Z%22 id%3D%22path4613%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615%22 d%3D%22M 149%2C64 162.77027%2C63.905 156%2C56 Z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2254%22 y%3D%2253%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4638%22 %2F%3E %3Crect id%3D%22svg_1-7-2-24%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-56%22 x%3D%2253%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2253%22 y%3D%22-66%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4657%22 %2F%3E %3Crect id%3D%22rect4659%22 height%3D%220.99999291%22 width%3D%2211.999999%22 y%3D%2257%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2288.000122%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4661%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2276.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4663%22 %2F%3E %3Crect id%3D%22rect4665%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2276.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect id%3D%22rect4667%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2282.000122%22 x%3D%2280.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2285.000008%22 y%3D%2282.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4669%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2288.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4671%22 %2F%3E %3Crect id%3D%22rect4673%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2288.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Ccircle r%3D%224.7438836%22 cy%3D%2281.939331%22 cx%3D%22110.06081%22 id%3D%22circle4675%22 style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 id%3D%22rect4677%22 height%3D%226.4053884%22 width%3D%224.229713%22 y%3D%22-14.826816%22 x%3D%22133.6163%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4679%22 d%3D%22m 125%2C80.000005 13.77027%2C0.09499 L 132%2C87.999992 Z%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 149%2C88.0002 162.77027%2C87.9052 156%2C80.0002 Z%22 id%3D%22path4681%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Crect id%3D%22rect4683%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2277.000122%22 x%3D%2254%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2277.000122%22 y%3D%22-56%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4685%22 %2F%3E %3Crect id%3D%22rect4687%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-66%22 x%3D%2277.000122%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2281.000122%22 width%3D%2211.999999%22 height%3D%220.99999291%22 id%3D%22rect4689%22 %2F%3E %3Crect id%3D%22rect4761-1%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22101%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-0%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22105%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-7%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22109%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1%22 height%3D%221.9999945%22 width%3D%2212%22 y%3D%22125%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22137%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22129%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4-3%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22133%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C100.0254 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C100.5991 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1452 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533865%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550756%2C0 6.710442%2C-2.4113 7.650391%2C-5.9414 0.939949%2C-3.5301 -0.618463%2C-7.2736 -3.710938%2C-9.0703 -1.159678%2C-0.6738 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C99.9629 c -1.270084%2C0.039 -2.541493%2C0.3887 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5402 -3.710937%2C9.0703 0.939949%2C3.5301 4.09768%2C5.9414 7.648437%2C5.9414 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4056 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C100 0%2C2 -2.4999996%2C0 L 12%2C107 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 id%3D%22path3055-0-77%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9850574%2C108.015 14.0298856%2C-0.03%22 id%3D%22path5244-5-0-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9849874%2C132.015 14.0298866%2C-0.03%22 id%3D%22path5244-5-0-5-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C123.9629 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C124.5366 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1453 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533864%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550757%2C0 6.710442%2C-2.4093 7.650391%2C-5.9394 0.939949%2C-3.5301 -0.618463%2C-7.2756 -3.710938%2C-9.0723 -1.159678%2C-0.6737 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138-12%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C123.9629 c -1.270084%2C0.039 -2.541493%2C0.3888 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5422 -3.710937%2C9.0723 0.939949%2C3.5301 4.09768%2C5.9394 7.648437%2C5.9394 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4055 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1-3%22 %2F%3E %3Cpath id%3D%22path6191%22 d%3D%22m 10.5%2C116 0%2C-2 -2.4999996%2C0 L 12%2C109 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C129 0%2C-2 -2.4999996%2C0 L 12%2C122 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 id%3D%22path6193%22 %2F%3E %3Cpath id%3D%22path6195%22 d%3D%22m 10.5%2C135 0%2C2 -2.4999996%2C0 L 12%2C142 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4500%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073242 -3.833708%2C2.213392 -3.8337072%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.8337082%2C2.213392 z%22 inkscape%3Atransform-center-x%3D%22-1.2779026%22 %2F%3E %3Cpath inkscape%3Atransform-center-x%3D%221.277902%22 d%3D%22m -31.500004%2C60.073242 -3.833708%2C2.213392 -3.833707%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.833707%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Acx%3D%22-36.611614%22 sodipodi%3Asides%3D%223%22 id%3D%22path4502%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22scale(-1%2C1)%22 %2F%3E %3Cpath d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Asides%3D%223%22 id%3D%22path4504%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C72.0074%2C71.7877)%22 inkscape%3Atransform-center-y%3D%221.2779029%22 %2F%3E %3Cpath inkscape%3Atransform-center-y%3D%22-1.2779026%22 transform%3D%22matrix(0%2C-1%2C-1%2C0%2C96%2C96)%22 sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4506%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615-5%22 d%3D%22m 171.82574%2C65.174193 16.34854%2C0 -8.17427%2C-13.348454 z%22 style%3D%22fill%3A%23fbb917%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23fbb917%3Bstroke-width%3A1.65161395%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C55 0%2C6 2%2C0 0%2C-6%22 id%3D%22path4300%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C62 0%2C2 2%2C0 0%2C-2%22 id%3D%22path4300-6%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E%3C%2Fsvg%3E") -168px -48px; -} -/* ContextMenu - main menu */ - -div.jsoneditor-contextmenu-root { - position: relative; - width: 0; - height: 0; -} - -div.jsoneditor-contextmenu { - position: absolute; - box-sizing: content-box; - z-index: 99999; -} - -div.jsoneditor-contextmenu ul, -div.jsoneditor-contextmenu li { - box-sizing: content-box; -} - -div.jsoneditor-contextmenu ul { - position: relative; - left: 0; - top: 0; - width: 124px; - background: white; - border: 1px solid #d3d3d3; - box-shadow: 2px 2px 12px rgba(128, 128, 128, 0.3); - list-style: none; - margin: 0; - padding: 0; -} - -div.jsoneditor-contextmenu ul li button { - padding: 0; - margin: 0; - width: 124px; - height: 24px; - border: none; - cursor: pointer; - color: #4d4d4d; - background: transparent; - font-size: 10pt; - font-family: arial, sans-serif; - box-sizing: border-box; - line-height: 26px; - text-align: left; -} - -/* Fix button padding in firefox */ - -div.jsoneditor-contextmenu ul li button::-moz-focus-inner { - padding: 0; - border: 0; -} - -div.jsoneditor-contextmenu ul li button:hover, -div.jsoneditor-contextmenu ul li button:focus { - color: #1a1a1a; - background-color: #f5f5f5; - outline: none; -} - -div.jsoneditor-contextmenu ul li button.jsoneditor-default { - width: 92px; -} - -div.jsoneditor-contextmenu ul li button.jsoneditor-expand { - float: right; - width: 32px; - height: 24px; - border-left: 1px solid #e5e5e5; -} - -div.jsoneditor-contextmenu div.jsoneditor-icon { - float: left; - width: 24px; - height: 24px; - border: none; - padding: 0; - margin: 0; - background-image: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22 xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22 xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22 xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22 xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22 width%3D%22216%22 height%3D%22144%22 id%3D%22svg4136%22 version%3D%221.1%22 inkscape%3Aversion%3D%220.91 r%22 sodipodi%3Adocname%3D%22jsoneditor-icons.svg%22%3E %3Ctitle id%3D%22title6512%22%3EJSON Editor Icons%3C%2Ftitle%3E %3Cmetadata id%3D%22metadata4148%22%3E %3Crdf%3ARDF%3E %3Ccc%3AWork rdf%3Aabout%3D%22%22%3E %3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E %3Cdc%3Atype rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22 %2F%3E %3Cdc%3Atitle%3EJSON Editor Icons%3C%2Fdc%3Atitle%3E %3C%2Fcc%3AWork%3E %3C%2Frdf%3ARDF%3E %3C%2Fmetadata%3E %3Cdefs id%3D%22defs4146%22 %2F%3E %3Csodipodi%3Anamedview pagecolor%3D%22%23ffffff%22 bordercolor%3D%22%23666666%22 borderopacity%3D%221%22 objecttolerance%3D%2210%22 gridtolerance%3D%2210%22 guidetolerance%3D%2210%22 inkscape%3Apageopacity%3D%220%22 inkscape%3Apageshadow%3D%222%22 inkscape%3Awindow-width%3D%221920%22 inkscape%3Awindow-height%3D%221028%22 id%3D%22namedview4144%22 showgrid%3D%22true%22 inkscape%3Azoom%3D%224%22 inkscape%3Acx%3D%2297.217248%22 inkscape%3Acy%3D%2259.950227%22 inkscape%3Awindow-x%3D%220%22 inkscape%3Awindow-y%3D%220%22 inkscape%3Awindow-maximized%3D%221%22 inkscape%3Acurrent-layer%3D%22svg4136%22 showguides%3D%22false%22 borderlayer%3D%22false%22 inkscape%3Ashowpageshadow%3D%22true%22 showborder%3D%22true%22%3E %3Cinkscape%3Agrid type%3D%22xygrid%22 id%3D%22grid4640%22 empspacing%3D%2224%22 %2F%3E %3C%2Fsodipodi%3Anamedview%3E %3C!-- Created with SVG-edit - http%3A%2F%2Fsvg-edit.googlecode.com%2F --%3E %3Cg id%3D%22g4394%22%3E %3Crect x%3D%224%22 y%3D%224%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1%22 style%3D%22fill%3A%231aae1c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ec3f29%3Bfill-opacity%3A0.94117647%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1-7%22 %2F%3E %3Crect id%3D%22rect4165%22 height%3D%2216%22 width%3D%2216%22 y%3D%223.999995%22 x%3D%2252.000004%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%223.9999852%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175-3%22 %2F%3E %3Cg style%3D%22stroke%3Anone%22 id%3D%22g4299%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg style%3D%22stroke%3Anone%22 transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C12.000001)%22 id%3D%22g4299-3%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-0%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1-9%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%227.0000048%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5%22 %2F%3E %3Crect id%3D%22rect4354%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2210.00001%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%233c80df%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A0.94117647%22 x%3D%2258.000004%22 y%3D%2210.000005%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5-7%22 %2F%3E %3Cg id%3D%22g4378%22%3E %3Crect id%3D%22svg_1-7-5-3%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4374%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4376%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4383%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4385%22 %2F%3E %3Crect id%3D%22rect4387%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4389%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect y%3D%223.9999199%22 x%3D%2276%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-4%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351%22 d%3D%22m 85.10447%2C6.0157384 -0.0156%2C1.4063 c 3.02669%2C-0.2402 0.33008%2C3.6507996 2.48438%2C4.5780996 -2.18694%2C1.0938 0.49191%2C4.9069 -2.45313%2C4.5781 l -0.0156%2C1.4219 c 5.70828%2C0.559 1.03264%2C-5.1005 4.70313%2C-5.2656 l 0%2C-1.4063 c -3.61303%2C-0.027 1.11893%2C-5.7069996 -4.70313%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351-9%22 d%3D%22m 82.78125%2C5.9984384 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33007%2C3.6506996 -2.48437%2C4.5780996 2.18694%2C1.0938 -0.49192%2C4.9069 2.45312%2C4.5781 l 0.0156%2C1.4219 c -5.70827%2C0.559 -1.03263%2C-5.1004 -4.70312%2C-5.2656 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11894%2C-5.7070996 4.70312%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22100%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-25%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987%22 d%3D%22m 103.719%2C5.6719384 0%2C12.7187996 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.6249996 1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987-1%22 d%3D%22m 112.2185%2C5.6721984 0%2C12.7187996 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.6249996 -1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22124%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-73%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3780%22 d%3D%22m 126.2824%2C17.602938 1.78957%2C0 1.14143%2C-2.8641 5.65364%2C0 1.14856%2C2.8641 1.76565%2C0 -4.78687%2C-11.1610996 -1.91903%2C0 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3782%22 d%3D%22m 129.72704%2C13.478838 4.60852%2C0.01 -2.30426%2C-5.5497996 z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22148%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-35%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2%22 d%3D%22m 156.47655%2C5.8917384 0%2C2.1797 0.46093%2C2.3983996 1.82813%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2-8%22 d%3D%22m 152.51561%2C5.8906384 0%2C2.1797 0.46094%2C2.3983996 1.82812%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3C%2Fg%3E %3Crect x%3D%224%22 y%3D%2227.999994%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4432%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4434%22 %2F%3E %3Crect id%3D%22rect4436%22 height%3D%2216%22 width%3D%2216%22 y%3D%2227.99999%22 x%3D%2252.000004%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%2227.999981%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4446%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4448%22 %2F%3E %3Cg id%3D%22g4466%22 style%3D%22stroke%3Anone%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4468%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4470%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C35.999996)%22 id%3D%22g4472%22 style%3D%22stroke%3Anone%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4474%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4476%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%2231%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4478%22 %2F%3E %3Crect id%3D%22rect4480%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2234.000008%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 x%3D%2258.000004%22 y%3D%2234.000004%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4482%22 %2F%3E %3Cg id%3D%22g4484%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect id%3D%22rect4486%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4488%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4490%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4492%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C47.99999)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4494%22 %2F%3E %3Crect id%3D%22rect4496%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4498%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-8%22 width%3D%2216%22 height%3D%2216%22 x%3D%2276%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 85.10448%2C30.015537 -0.0156%2C1.4063 c 3.02668%2C-0.2402 0.33007%2C3.6508 2.48438%2C4.5781 -2.18695%2C1.0938 0.49191%2C4.90688 -2.45313%2C4.57808 l -0.0156%2C1.4219 c 5.70827%2C0.559 1.03263%2C-5.10048 4.70313%2C-5.26558 l 0%2C-1.4063 c -3.61304%2C-0.027 1.11893%2C-5.707 -4.70313%2C-5.3125 z%22 id%3D%22path4351-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 82.78126%2C29.998237 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33008%2C3.6507 -2.48438%2C4.5781 2.18694%2C1.0938 -0.49191%2C4.90688 2.45313%2C4.57808 l 0.0156%2C1.4219 c -5.70828%2C0.559 -1.03264%2C-5.10038 -4.70313%2C-5.26558 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11893%2C-5.7071 4.70313%2C-5.3125 z%22 id%3D%22path4351-9-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-65%22 width%3D%2216%22 height%3D%2216%22 x%3D%22100%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 103.719%2C29.671937 0%2C12.71878 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.62498 1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-8%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 112.2185%2C29.671937 0%2C12.71878 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.62498 -1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-1-9%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-92%22 width%3D%2216%22 height%3D%2216%22 x%3D%22124%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 126.2824%2C41.602917 1.78957%2C0 1.14143%2C-2.86408 5.65364%2C0 1.14856%2C2.86408 1.76565%2C0 -4.78687%2C-11.16108 -1.91902%2C0 z%22 id%3D%22path3780-9%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 129.72704%2C37.478837 4.60852%2C0.01 -2.30426%2C-5.5498 z%22 id%3D%22path3782-2%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-47%22 width%3D%2216%22 height%3D%2216%22 x%3D%22148%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 156.47656%2C29.891737 0%2C2.1797 0.46093%2C2.3984 1.82813%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 152.51562%2C29.890637 0%2C2.1797 0.46094%2C2.3984 1.82812%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-8-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Crect id%3D%22svg_1-7-2%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2264%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22svg_1-7-2-2%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2252%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2252%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4561%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2280.000008%22 y%3D%2258%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4563%22 %2F%3E %3Crect id%3D%22rect4565%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2258%22 x%3D%2285.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4567%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2264%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2264%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4569%22 %2F%3E %3Ccircle style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4571%22 cx%3D%22110.06081%22 cy%3D%2257.939209%22 r%3D%224.7438836%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22116.64566%22 y%3D%22-31.79752%22 width%3D%224.229713%22 height%3D%226.4053884%22 id%3D%22rect4563-2%22 transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 %2F%3E %3Cpath style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 125%2C56 138.77027%2C56.095 132%2C64 Z%22 id%3D%22path4613%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615%22 d%3D%22M 149%2C64 162.77027%2C63.905 156%2C56 Z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2254%22 y%3D%2253%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4638%22 %2F%3E %3Crect id%3D%22svg_1-7-2-24%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-56%22 x%3D%2253%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2253%22 y%3D%22-66%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4657%22 %2F%3E %3Crect id%3D%22rect4659%22 height%3D%220.99999291%22 width%3D%2211.999999%22 y%3D%2257%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2288.000122%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4661%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2276.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4663%22 %2F%3E %3Crect id%3D%22rect4665%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2276.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect id%3D%22rect4667%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2282.000122%22 x%3D%2280.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2285.000008%22 y%3D%2282.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4669%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2288.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4671%22 %2F%3E %3Crect id%3D%22rect4673%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2288.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Ccircle r%3D%224.7438836%22 cy%3D%2281.939331%22 cx%3D%22110.06081%22 id%3D%22circle4675%22 style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 id%3D%22rect4677%22 height%3D%226.4053884%22 width%3D%224.229713%22 y%3D%22-14.826816%22 x%3D%22133.6163%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4679%22 d%3D%22m 125%2C80.000005 13.77027%2C0.09499 L 132%2C87.999992 Z%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 149%2C88.0002 162.77027%2C87.9052 156%2C80.0002 Z%22 id%3D%22path4681%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Crect id%3D%22rect4683%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2277.000122%22 x%3D%2254%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2277.000122%22 y%3D%22-56%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4685%22 %2F%3E %3Crect id%3D%22rect4687%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-66%22 x%3D%2277.000122%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2281.000122%22 width%3D%2211.999999%22 height%3D%220.99999291%22 id%3D%22rect4689%22 %2F%3E %3Crect id%3D%22rect4761-1%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22101%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-0%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22105%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-7%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22109%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1%22 height%3D%221.9999945%22 width%3D%2212%22 y%3D%22125%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22137%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22129%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4-3%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22133%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C100.0254 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C100.5991 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1452 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533865%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550756%2C0 6.710442%2C-2.4113 7.650391%2C-5.9414 0.939949%2C-3.5301 -0.618463%2C-7.2736 -3.710938%2C-9.0703 -1.159678%2C-0.6738 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C99.9629 c -1.270084%2C0.039 -2.541493%2C0.3887 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5402 -3.710937%2C9.0703 0.939949%2C3.5301 4.09768%2C5.9414 7.648437%2C5.9414 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4056 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C100 0%2C2 -2.4999996%2C0 L 12%2C107 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 id%3D%22path3055-0-77%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9850574%2C108.015 14.0298856%2C-0.03%22 id%3D%22path5244-5-0-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9849874%2C132.015 14.0298866%2C-0.03%22 id%3D%22path5244-5-0-5-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C123.9629 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C124.5366 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1453 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533864%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550757%2C0 6.710442%2C-2.4093 7.650391%2C-5.9394 0.939949%2C-3.5301 -0.618463%2C-7.2756 -3.710938%2C-9.0723 -1.159678%2C-0.6737 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138-12%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C123.9629 c -1.270084%2C0.039 -2.541493%2C0.3888 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5422 -3.710937%2C9.0723 0.939949%2C3.5301 4.09768%2C5.9394 7.648437%2C5.9394 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4055 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1-3%22 %2F%3E %3Cpath id%3D%22path6191%22 d%3D%22m 10.5%2C116 0%2C-2 -2.4999996%2C0 L 12%2C109 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C129 0%2C-2 -2.4999996%2C0 L 12%2C122 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 id%3D%22path6193%22 %2F%3E %3Cpath id%3D%22path6195%22 d%3D%22m 10.5%2C135 0%2C2 -2.4999996%2C0 L 12%2C142 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4500%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073242 -3.833708%2C2.213392 -3.8337072%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.8337082%2C2.213392 z%22 inkscape%3Atransform-center-x%3D%22-1.2779026%22 %2F%3E %3Cpath inkscape%3Atransform-center-x%3D%221.277902%22 d%3D%22m -31.500004%2C60.073242 -3.833708%2C2.213392 -3.833707%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.833707%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Acx%3D%22-36.611614%22 sodipodi%3Asides%3D%223%22 id%3D%22path4502%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22scale(-1%2C1)%22 %2F%3E %3Cpath d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Asides%3D%223%22 id%3D%22path4504%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C72.0074%2C71.7877)%22 inkscape%3Atransform-center-y%3D%221.2779029%22 %2F%3E %3Cpath inkscape%3Atransform-center-y%3D%22-1.2779026%22 transform%3D%22matrix(0%2C-1%2C-1%2C0%2C96%2C96)%22 sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4506%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615-5%22 d%3D%22m 171.82574%2C65.174193 16.34854%2C0 -8.17427%2C-13.348454 z%22 style%3D%22fill%3A%23fbb917%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23fbb917%3Bstroke-width%3A1.65161395%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C55 0%2C6 2%2C0 0%2C-6%22 id%3D%22path4300%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C62 0%2C2 2%2C0 0%2C-2%22 id%3D%22path4300-6%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E%3C%2Fsvg%3E"); -} - -div.jsoneditor-contextmenu ul li button div.jsoneditor-expand { - float: right; - width: 24px; - height: 24px; - padding: 0; - margin: 0 4px 0 0; - background: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22 xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22 xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22 xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22 xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22 width%3D%22216%22 height%3D%22144%22 id%3D%22svg4136%22 version%3D%221.1%22 inkscape%3Aversion%3D%220.91 r%22 sodipodi%3Adocname%3D%22jsoneditor-icons.svg%22%3E %3Ctitle id%3D%22title6512%22%3EJSON Editor Icons%3C%2Ftitle%3E %3Cmetadata id%3D%22metadata4148%22%3E %3Crdf%3ARDF%3E %3Ccc%3AWork rdf%3Aabout%3D%22%22%3E %3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E %3Cdc%3Atype rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22 %2F%3E %3Cdc%3Atitle%3EJSON Editor Icons%3C%2Fdc%3Atitle%3E %3C%2Fcc%3AWork%3E %3C%2Frdf%3ARDF%3E %3C%2Fmetadata%3E %3Cdefs id%3D%22defs4146%22 %2F%3E %3Csodipodi%3Anamedview pagecolor%3D%22%23ffffff%22 bordercolor%3D%22%23666666%22 borderopacity%3D%221%22 objecttolerance%3D%2210%22 gridtolerance%3D%2210%22 guidetolerance%3D%2210%22 inkscape%3Apageopacity%3D%220%22 inkscape%3Apageshadow%3D%222%22 inkscape%3Awindow-width%3D%221920%22 inkscape%3Awindow-height%3D%221028%22 id%3D%22namedview4144%22 showgrid%3D%22true%22 inkscape%3Azoom%3D%224%22 inkscape%3Acx%3D%2297.217248%22 inkscape%3Acy%3D%2259.950227%22 inkscape%3Awindow-x%3D%220%22 inkscape%3Awindow-y%3D%220%22 inkscape%3Awindow-maximized%3D%221%22 inkscape%3Acurrent-layer%3D%22svg4136%22 showguides%3D%22false%22 borderlayer%3D%22false%22 inkscape%3Ashowpageshadow%3D%22true%22 showborder%3D%22true%22%3E %3Cinkscape%3Agrid type%3D%22xygrid%22 id%3D%22grid4640%22 empspacing%3D%2224%22 %2F%3E %3C%2Fsodipodi%3Anamedview%3E %3C!-- Created with SVG-edit - http%3A%2F%2Fsvg-edit.googlecode.com%2F --%3E %3Cg id%3D%22g4394%22%3E %3Crect x%3D%224%22 y%3D%224%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1%22 style%3D%22fill%3A%231aae1c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ec3f29%3Bfill-opacity%3A0.94117647%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1-7%22 %2F%3E %3Crect id%3D%22rect4165%22 height%3D%2216%22 width%3D%2216%22 y%3D%223.999995%22 x%3D%2252.000004%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%223.9999852%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175-3%22 %2F%3E %3Cg style%3D%22stroke%3Anone%22 id%3D%22g4299%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg style%3D%22stroke%3Anone%22 transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C12.000001)%22 id%3D%22g4299-3%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-0%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1-9%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%227.0000048%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5%22 %2F%3E %3Crect id%3D%22rect4354%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2210.00001%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%233c80df%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A0.94117647%22 x%3D%2258.000004%22 y%3D%2210.000005%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5-7%22 %2F%3E %3Cg id%3D%22g4378%22%3E %3Crect id%3D%22svg_1-7-5-3%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4374%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4376%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4383%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4385%22 %2F%3E %3Crect id%3D%22rect4387%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4389%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect y%3D%223.9999199%22 x%3D%2276%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-4%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351%22 d%3D%22m 85.10447%2C6.0157384 -0.0156%2C1.4063 c 3.02669%2C-0.2402 0.33008%2C3.6507996 2.48438%2C4.5780996 -2.18694%2C1.0938 0.49191%2C4.9069 -2.45313%2C4.5781 l -0.0156%2C1.4219 c 5.70828%2C0.559 1.03264%2C-5.1005 4.70313%2C-5.2656 l 0%2C-1.4063 c -3.61303%2C-0.027 1.11893%2C-5.7069996 -4.70313%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351-9%22 d%3D%22m 82.78125%2C5.9984384 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33007%2C3.6506996 -2.48437%2C4.5780996 2.18694%2C1.0938 -0.49192%2C4.9069 2.45312%2C4.5781 l 0.0156%2C1.4219 c -5.70827%2C0.559 -1.03263%2C-5.1004 -4.70312%2C-5.2656 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11894%2C-5.7070996 4.70312%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22100%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-25%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987%22 d%3D%22m 103.719%2C5.6719384 0%2C12.7187996 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.6249996 1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987-1%22 d%3D%22m 112.2185%2C5.6721984 0%2C12.7187996 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.6249996 -1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22124%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-73%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3780%22 d%3D%22m 126.2824%2C17.602938 1.78957%2C0 1.14143%2C-2.8641 5.65364%2C0 1.14856%2C2.8641 1.76565%2C0 -4.78687%2C-11.1610996 -1.91903%2C0 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3782%22 d%3D%22m 129.72704%2C13.478838 4.60852%2C0.01 -2.30426%2C-5.5497996 z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22148%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-35%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2%22 d%3D%22m 156.47655%2C5.8917384 0%2C2.1797 0.46093%2C2.3983996 1.82813%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2-8%22 d%3D%22m 152.51561%2C5.8906384 0%2C2.1797 0.46094%2C2.3983996 1.82812%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3C%2Fg%3E %3Crect x%3D%224%22 y%3D%2227.999994%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4432%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4434%22 %2F%3E %3Crect id%3D%22rect4436%22 height%3D%2216%22 width%3D%2216%22 y%3D%2227.99999%22 x%3D%2252.000004%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%2227.999981%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4446%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4448%22 %2F%3E %3Cg id%3D%22g4466%22 style%3D%22stroke%3Anone%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4468%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4470%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C35.999996)%22 id%3D%22g4472%22 style%3D%22stroke%3Anone%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4474%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4476%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%2231%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4478%22 %2F%3E %3Crect id%3D%22rect4480%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2234.000008%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 x%3D%2258.000004%22 y%3D%2234.000004%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4482%22 %2F%3E %3Cg id%3D%22g4484%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect id%3D%22rect4486%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4488%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4490%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4492%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C47.99999)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4494%22 %2F%3E %3Crect id%3D%22rect4496%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4498%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-8%22 width%3D%2216%22 height%3D%2216%22 x%3D%2276%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 85.10448%2C30.015537 -0.0156%2C1.4063 c 3.02668%2C-0.2402 0.33007%2C3.6508 2.48438%2C4.5781 -2.18695%2C1.0938 0.49191%2C4.90688 -2.45313%2C4.57808 l -0.0156%2C1.4219 c 5.70827%2C0.559 1.03263%2C-5.10048 4.70313%2C-5.26558 l 0%2C-1.4063 c -3.61304%2C-0.027 1.11893%2C-5.707 -4.70313%2C-5.3125 z%22 id%3D%22path4351-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 82.78126%2C29.998237 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33008%2C3.6507 -2.48438%2C4.5781 2.18694%2C1.0938 -0.49191%2C4.90688 2.45313%2C4.57808 l 0.0156%2C1.4219 c -5.70828%2C0.559 -1.03264%2C-5.10038 -4.70313%2C-5.26558 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11893%2C-5.7071 4.70313%2C-5.3125 z%22 id%3D%22path4351-9-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-65%22 width%3D%2216%22 height%3D%2216%22 x%3D%22100%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 103.719%2C29.671937 0%2C12.71878 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.62498 1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-8%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 112.2185%2C29.671937 0%2C12.71878 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.62498 -1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-1-9%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-92%22 width%3D%2216%22 height%3D%2216%22 x%3D%22124%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 126.2824%2C41.602917 1.78957%2C0 1.14143%2C-2.86408 5.65364%2C0 1.14856%2C2.86408 1.76565%2C0 -4.78687%2C-11.16108 -1.91902%2C0 z%22 id%3D%22path3780-9%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 129.72704%2C37.478837 4.60852%2C0.01 -2.30426%2C-5.5498 z%22 id%3D%22path3782-2%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-47%22 width%3D%2216%22 height%3D%2216%22 x%3D%22148%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 156.47656%2C29.891737 0%2C2.1797 0.46093%2C2.3984 1.82813%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 152.51562%2C29.890637 0%2C2.1797 0.46094%2C2.3984 1.82812%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-8-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Crect id%3D%22svg_1-7-2%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2264%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22svg_1-7-2-2%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2252%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2252%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4561%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2280.000008%22 y%3D%2258%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4563%22 %2F%3E %3Crect id%3D%22rect4565%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2258%22 x%3D%2285.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4567%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2264%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2264%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4569%22 %2F%3E %3Ccircle style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4571%22 cx%3D%22110.06081%22 cy%3D%2257.939209%22 r%3D%224.7438836%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22116.64566%22 y%3D%22-31.79752%22 width%3D%224.229713%22 height%3D%226.4053884%22 id%3D%22rect4563-2%22 transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 %2F%3E %3Cpath style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 125%2C56 138.77027%2C56.095 132%2C64 Z%22 id%3D%22path4613%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615%22 d%3D%22M 149%2C64 162.77027%2C63.905 156%2C56 Z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2254%22 y%3D%2253%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4638%22 %2F%3E %3Crect id%3D%22svg_1-7-2-24%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-56%22 x%3D%2253%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2253%22 y%3D%22-66%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4657%22 %2F%3E %3Crect id%3D%22rect4659%22 height%3D%220.99999291%22 width%3D%2211.999999%22 y%3D%2257%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2288.000122%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4661%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2276.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4663%22 %2F%3E %3Crect id%3D%22rect4665%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2276.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect id%3D%22rect4667%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2282.000122%22 x%3D%2280.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2285.000008%22 y%3D%2282.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4669%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2288.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4671%22 %2F%3E %3Crect id%3D%22rect4673%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2288.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Ccircle r%3D%224.7438836%22 cy%3D%2281.939331%22 cx%3D%22110.06081%22 id%3D%22circle4675%22 style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 id%3D%22rect4677%22 height%3D%226.4053884%22 width%3D%224.229713%22 y%3D%22-14.826816%22 x%3D%22133.6163%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4679%22 d%3D%22m 125%2C80.000005 13.77027%2C0.09499 L 132%2C87.999992 Z%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 149%2C88.0002 162.77027%2C87.9052 156%2C80.0002 Z%22 id%3D%22path4681%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Crect id%3D%22rect4683%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2277.000122%22 x%3D%2254%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2277.000122%22 y%3D%22-56%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4685%22 %2F%3E %3Crect id%3D%22rect4687%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-66%22 x%3D%2277.000122%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2281.000122%22 width%3D%2211.999999%22 height%3D%220.99999291%22 id%3D%22rect4689%22 %2F%3E %3Crect id%3D%22rect4761-1%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22101%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-0%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22105%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-7%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22109%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1%22 height%3D%221.9999945%22 width%3D%2212%22 y%3D%22125%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22137%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22129%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4-3%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22133%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C100.0254 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C100.5991 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1452 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533865%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550756%2C0 6.710442%2C-2.4113 7.650391%2C-5.9414 0.939949%2C-3.5301 -0.618463%2C-7.2736 -3.710938%2C-9.0703 -1.159678%2C-0.6738 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C99.9629 c -1.270084%2C0.039 -2.541493%2C0.3887 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5402 -3.710937%2C9.0703 0.939949%2C3.5301 4.09768%2C5.9414 7.648437%2C5.9414 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4056 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C100 0%2C2 -2.4999996%2C0 L 12%2C107 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 id%3D%22path3055-0-77%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9850574%2C108.015 14.0298856%2C-0.03%22 id%3D%22path5244-5-0-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9849874%2C132.015 14.0298866%2C-0.03%22 id%3D%22path5244-5-0-5-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C123.9629 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C124.5366 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1453 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533864%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550757%2C0 6.710442%2C-2.4093 7.650391%2C-5.9394 0.939949%2C-3.5301 -0.618463%2C-7.2756 -3.710938%2C-9.0723 -1.159678%2C-0.6737 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138-12%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C123.9629 c -1.270084%2C0.039 -2.541493%2C0.3888 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5422 -3.710937%2C9.0723 0.939949%2C3.5301 4.09768%2C5.9394 7.648437%2C5.9394 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4055 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1-3%22 %2F%3E %3Cpath id%3D%22path6191%22 d%3D%22m 10.5%2C116 0%2C-2 -2.4999996%2C0 L 12%2C109 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C129 0%2C-2 -2.4999996%2C0 L 12%2C122 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 id%3D%22path6193%22 %2F%3E %3Cpath id%3D%22path6195%22 d%3D%22m 10.5%2C135 0%2C2 -2.4999996%2C0 L 12%2C142 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4500%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073242 -3.833708%2C2.213392 -3.8337072%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.8337082%2C2.213392 z%22 inkscape%3Atransform-center-x%3D%22-1.2779026%22 %2F%3E %3Cpath inkscape%3Atransform-center-x%3D%221.277902%22 d%3D%22m -31.500004%2C60.073242 -3.833708%2C2.213392 -3.833707%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.833707%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Acx%3D%22-36.611614%22 sodipodi%3Asides%3D%223%22 id%3D%22path4502%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22scale(-1%2C1)%22 %2F%3E %3Cpath d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Asides%3D%223%22 id%3D%22path4504%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C72.0074%2C71.7877)%22 inkscape%3Atransform-center-y%3D%221.2779029%22 %2F%3E %3Cpath inkscape%3Atransform-center-y%3D%22-1.2779026%22 transform%3D%22matrix(0%2C-1%2C-1%2C0%2C96%2C96)%22 sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4506%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615-5%22 d%3D%22m 171.82574%2C65.174193 16.34854%2C0 -8.17427%2C-13.348454 z%22 style%3D%22fill%3A%23fbb917%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23fbb917%3Bstroke-width%3A1.65161395%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C55 0%2C6 2%2C0 0%2C-6%22 id%3D%22path4300%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C62 0%2C2 2%2C0 0%2C-2%22 id%3D%22path4300-6%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E%3C%2Fsvg%3E") 0 -72px; - opacity: 0.4; -} - -div.jsoneditor-contextmenu ul li button:hover div.jsoneditor-expand, -div.jsoneditor-contextmenu ul li button:focus div.jsoneditor-expand, -div.jsoneditor-contextmenu ul li.jsoneditor-selected div.jsoneditor-expand, -div.jsoneditor-contextmenu ul li button.jsoneditor-expand:hover div.jsoneditor-expand, -div.jsoneditor-contextmenu ul li button.jsoneditor-expand:focus div.jsoneditor-expand { - opacity: 1; -} - -div.jsoneditor-contextmenu div.jsoneditor-separator { - height: 0; - border-top: 1px solid #e5e5e5; - padding-top: 5px; - margin-top: 5px; -} - -div.jsoneditor-contextmenu button.jsoneditor-remove > div.jsoneditor-icon { - background-position: -24px -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-remove:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-remove:focus > div.jsoneditor-icon { - background-position: -24px 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-append > div.jsoneditor-icon { - background-position: 0 -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-append:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-append:focus > div.jsoneditor-icon { - background-position: 0 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-insert > div.jsoneditor-icon { - background-position: 0 -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-insert:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-insert:focus > div.jsoneditor-icon { - background-position: 0 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-duplicate > div.jsoneditor-icon { - background-position: -48px -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-duplicate:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-duplicate:focus > div.jsoneditor-icon { - background-position: -48px 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-sort-asc > div.jsoneditor-icon { - background-position: -168px -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-sort-asc:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-sort-asc:focus > div.jsoneditor-icon { - background-position: -168px 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-sort-desc > div.jsoneditor-icon { - background-position: -192px -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-sort-desc:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-sort-desc:focus > div.jsoneditor-icon { - background-position: -192px 0; -} - -/* ContextMenu - sub menu */ - -div.jsoneditor-contextmenu ul li button.jsoneditor-selected, -div.jsoneditor-contextmenu ul li button.jsoneditor-selected:hover, -div.jsoneditor-contextmenu ul li button.jsoneditor-selected:focus { - color: white; - background-color: #ee422e; -} - -div.jsoneditor-contextmenu ul li { - overflow: hidden; -} - -div.jsoneditor-contextmenu ul li ul { - display: none; - position: relative; - left: -10px; - top: 0; - border: none; - box-shadow: inset 0 0 10px rgba(128, 128, 128, 0.5); - padding: 0 10px; - /* TODO: transition is not supported on IE8-9 */ - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; -} - - - -div.jsoneditor-contextmenu ul li ul li button { - padding-left: 24px; - animation: all ease-in-out 1s; -} - -div.jsoneditor-contextmenu ul li ul li button:hover, -div.jsoneditor-contextmenu ul li ul li button:focus { - background-color: #f5f5f5; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-string > div.jsoneditor-icon { - background-position: -144px -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-string:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-type-string:focus > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-type-string.jsoneditor-selected > div.jsoneditor-icon { - background-position: -144px 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-auto > div.jsoneditor-icon { - background-position: -120px -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-auto:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-type-auto:focus > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-type-auto.jsoneditor-selected > div.jsoneditor-icon { - background-position: -120px 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-object > div.jsoneditor-icon { - background-position: -72px -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-object:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-type-object:focus > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-type-object.jsoneditor-selected > div.jsoneditor-icon { - background-position: -72px 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-array > div.jsoneditor-icon { - background-position: -96px -24px; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-array:hover > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-type-array:focus > div.jsoneditor-icon, -div.jsoneditor-contextmenu button.jsoneditor-type-array.jsoneditor-selected > div.jsoneditor-icon { - background-position: -96px 0; -} - -div.jsoneditor-contextmenu button.jsoneditor-type-modes > div.jsoneditor-icon { - background-image: none; - width: 6px; -} -div.jsoneditor-menu { - width: 100%; - height: 35px; - padding: 2px; - margin: 0; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: white; - background-color: #3883fa; - border-bottom: 1px solid #3883fa; -} - -div.jsoneditor-menu > button, -div.jsoneditor-menu > div.jsoneditor-modes > button { - width: 26px; - height: 26px; - margin: 2px; - padding: 0; - border-radius: 2px; - border: 1px solid transparent; - background: transparent url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22 xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22 xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22 xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22 xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22 width%3D%22216%22 height%3D%22144%22 id%3D%22svg4136%22 version%3D%221.1%22 inkscape%3Aversion%3D%220.91 r%22 sodipodi%3Adocname%3D%22jsoneditor-icons.svg%22%3E %3Ctitle id%3D%22title6512%22%3EJSON Editor Icons%3C%2Ftitle%3E %3Cmetadata id%3D%22metadata4148%22%3E %3Crdf%3ARDF%3E %3Ccc%3AWork rdf%3Aabout%3D%22%22%3E %3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E %3Cdc%3Atype rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22 %2F%3E %3Cdc%3Atitle%3EJSON Editor Icons%3C%2Fdc%3Atitle%3E %3C%2Fcc%3AWork%3E %3C%2Frdf%3ARDF%3E %3C%2Fmetadata%3E %3Cdefs id%3D%22defs4146%22 %2F%3E %3Csodipodi%3Anamedview pagecolor%3D%22%23ffffff%22 bordercolor%3D%22%23666666%22 borderopacity%3D%221%22 objecttolerance%3D%2210%22 gridtolerance%3D%2210%22 guidetolerance%3D%2210%22 inkscape%3Apageopacity%3D%220%22 inkscape%3Apageshadow%3D%222%22 inkscape%3Awindow-width%3D%221920%22 inkscape%3Awindow-height%3D%221028%22 id%3D%22namedview4144%22 showgrid%3D%22true%22 inkscape%3Azoom%3D%224%22 inkscape%3Acx%3D%2297.217248%22 inkscape%3Acy%3D%2259.950227%22 inkscape%3Awindow-x%3D%220%22 inkscape%3Awindow-y%3D%220%22 inkscape%3Awindow-maximized%3D%221%22 inkscape%3Acurrent-layer%3D%22svg4136%22 showguides%3D%22false%22 borderlayer%3D%22false%22 inkscape%3Ashowpageshadow%3D%22true%22 showborder%3D%22true%22%3E %3Cinkscape%3Agrid type%3D%22xygrid%22 id%3D%22grid4640%22 empspacing%3D%2224%22 %2F%3E %3C%2Fsodipodi%3Anamedview%3E %3C!-- Created with SVG-edit - http%3A%2F%2Fsvg-edit.googlecode.com%2F --%3E %3Cg id%3D%22g4394%22%3E %3Crect x%3D%224%22 y%3D%224%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1%22 style%3D%22fill%3A%231aae1c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ec3f29%3Bfill-opacity%3A0.94117647%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1-7%22 %2F%3E %3Crect id%3D%22rect4165%22 height%3D%2216%22 width%3D%2216%22 y%3D%223.999995%22 x%3D%2252.000004%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%223.9999852%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175-3%22 %2F%3E %3Cg style%3D%22stroke%3Anone%22 id%3D%22g4299%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg style%3D%22stroke%3Anone%22 transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C12.000001)%22 id%3D%22g4299-3%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-0%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1-9%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%227.0000048%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5%22 %2F%3E %3Crect id%3D%22rect4354%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2210.00001%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%233c80df%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A0.94117647%22 x%3D%2258.000004%22 y%3D%2210.000005%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5-7%22 %2F%3E %3Cg id%3D%22g4378%22%3E %3Crect id%3D%22svg_1-7-5-3%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4374%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4376%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4383%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4385%22 %2F%3E %3Crect id%3D%22rect4387%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4389%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect y%3D%223.9999199%22 x%3D%2276%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-4%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351%22 d%3D%22m 85.10447%2C6.0157384 -0.0156%2C1.4063 c 3.02669%2C-0.2402 0.33008%2C3.6507996 2.48438%2C4.5780996 -2.18694%2C1.0938 0.49191%2C4.9069 -2.45313%2C4.5781 l -0.0156%2C1.4219 c 5.70828%2C0.559 1.03264%2C-5.1005 4.70313%2C-5.2656 l 0%2C-1.4063 c -3.61303%2C-0.027 1.11893%2C-5.7069996 -4.70313%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351-9%22 d%3D%22m 82.78125%2C5.9984384 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33007%2C3.6506996 -2.48437%2C4.5780996 2.18694%2C1.0938 -0.49192%2C4.9069 2.45312%2C4.5781 l 0.0156%2C1.4219 c -5.70827%2C0.559 -1.03263%2C-5.1004 -4.70312%2C-5.2656 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11894%2C-5.7070996 4.70312%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22100%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-25%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987%22 d%3D%22m 103.719%2C5.6719384 0%2C12.7187996 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.6249996 1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987-1%22 d%3D%22m 112.2185%2C5.6721984 0%2C12.7187996 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.6249996 -1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22124%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-73%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3780%22 d%3D%22m 126.2824%2C17.602938 1.78957%2C0 1.14143%2C-2.8641 5.65364%2C0 1.14856%2C2.8641 1.76565%2C0 -4.78687%2C-11.1610996 -1.91903%2C0 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3782%22 d%3D%22m 129.72704%2C13.478838 4.60852%2C0.01 -2.30426%2C-5.5497996 z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22148%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-35%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2%22 d%3D%22m 156.47655%2C5.8917384 0%2C2.1797 0.46093%2C2.3983996 1.82813%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2-8%22 d%3D%22m 152.51561%2C5.8906384 0%2C2.1797 0.46094%2C2.3983996 1.82812%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3C%2Fg%3E %3Crect x%3D%224%22 y%3D%2227.999994%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4432%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4434%22 %2F%3E %3Crect id%3D%22rect4436%22 height%3D%2216%22 width%3D%2216%22 y%3D%2227.99999%22 x%3D%2252.000004%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%2227.999981%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4446%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4448%22 %2F%3E %3Cg id%3D%22g4466%22 style%3D%22stroke%3Anone%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4468%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4470%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C35.999996)%22 id%3D%22g4472%22 style%3D%22stroke%3Anone%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4474%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4476%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%2231%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4478%22 %2F%3E %3Crect id%3D%22rect4480%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2234.000008%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 x%3D%2258.000004%22 y%3D%2234.000004%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4482%22 %2F%3E %3Cg id%3D%22g4484%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect id%3D%22rect4486%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4488%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4490%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4492%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C47.99999)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4494%22 %2F%3E %3Crect id%3D%22rect4496%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4498%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-8%22 width%3D%2216%22 height%3D%2216%22 x%3D%2276%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 85.10448%2C30.015537 -0.0156%2C1.4063 c 3.02668%2C-0.2402 0.33007%2C3.6508 2.48438%2C4.5781 -2.18695%2C1.0938 0.49191%2C4.90688 -2.45313%2C4.57808 l -0.0156%2C1.4219 c 5.70827%2C0.559 1.03263%2C-5.10048 4.70313%2C-5.26558 l 0%2C-1.4063 c -3.61304%2C-0.027 1.11893%2C-5.707 -4.70313%2C-5.3125 z%22 id%3D%22path4351-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 82.78126%2C29.998237 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33008%2C3.6507 -2.48438%2C4.5781 2.18694%2C1.0938 -0.49191%2C4.90688 2.45313%2C4.57808 l 0.0156%2C1.4219 c -5.70828%2C0.559 -1.03264%2C-5.10038 -4.70313%2C-5.26558 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11893%2C-5.7071 4.70313%2C-5.3125 z%22 id%3D%22path4351-9-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-65%22 width%3D%2216%22 height%3D%2216%22 x%3D%22100%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 103.719%2C29.671937 0%2C12.71878 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.62498 1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-8%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 112.2185%2C29.671937 0%2C12.71878 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.62498 -1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-1-9%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-92%22 width%3D%2216%22 height%3D%2216%22 x%3D%22124%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 126.2824%2C41.602917 1.78957%2C0 1.14143%2C-2.86408 5.65364%2C0 1.14856%2C2.86408 1.76565%2C0 -4.78687%2C-11.16108 -1.91902%2C0 z%22 id%3D%22path3780-9%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 129.72704%2C37.478837 4.60852%2C0.01 -2.30426%2C-5.5498 z%22 id%3D%22path3782-2%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-47%22 width%3D%2216%22 height%3D%2216%22 x%3D%22148%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 156.47656%2C29.891737 0%2C2.1797 0.46093%2C2.3984 1.82813%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 152.51562%2C29.890637 0%2C2.1797 0.46094%2C2.3984 1.82812%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-8-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Crect id%3D%22svg_1-7-2%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2264%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22svg_1-7-2-2%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2252%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2252%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4561%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2280.000008%22 y%3D%2258%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4563%22 %2F%3E %3Crect id%3D%22rect4565%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2258%22 x%3D%2285.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4567%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2264%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2264%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4569%22 %2F%3E %3Ccircle style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4571%22 cx%3D%22110.06081%22 cy%3D%2257.939209%22 r%3D%224.7438836%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22116.64566%22 y%3D%22-31.79752%22 width%3D%224.229713%22 height%3D%226.4053884%22 id%3D%22rect4563-2%22 transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 %2F%3E %3Cpath style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 125%2C56 138.77027%2C56.095 132%2C64 Z%22 id%3D%22path4613%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615%22 d%3D%22M 149%2C64 162.77027%2C63.905 156%2C56 Z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2254%22 y%3D%2253%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4638%22 %2F%3E %3Crect id%3D%22svg_1-7-2-24%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-56%22 x%3D%2253%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2253%22 y%3D%22-66%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4657%22 %2F%3E %3Crect id%3D%22rect4659%22 height%3D%220.99999291%22 width%3D%2211.999999%22 y%3D%2257%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2288.000122%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4661%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2276.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4663%22 %2F%3E %3Crect id%3D%22rect4665%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2276.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect id%3D%22rect4667%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2282.000122%22 x%3D%2280.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2285.000008%22 y%3D%2282.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4669%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2288.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4671%22 %2F%3E %3Crect id%3D%22rect4673%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2288.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Ccircle r%3D%224.7438836%22 cy%3D%2281.939331%22 cx%3D%22110.06081%22 id%3D%22circle4675%22 style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 id%3D%22rect4677%22 height%3D%226.4053884%22 width%3D%224.229713%22 y%3D%22-14.826816%22 x%3D%22133.6163%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4679%22 d%3D%22m 125%2C80.000005 13.77027%2C0.09499 L 132%2C87.999992 Z%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 149%2C88.0002 162.77027%2C87.9052 156%2C80.0002 Z%22 id%3D%22path4681%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Crect id%3D%22rect4683%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2277.000122%22 x%3D%2254%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2277.000122%22 y%3D%22-56%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4685%22 %2F%3E %3Crect id%3D%22rect4687%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-66%22 x%3D%2277.000122%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2281.000122%22 width%3D%2211.999999%22 height%3D%220.99999291%22 id%3D%22rect4689%22 %2F%3E %3Crect id%3D%22rect4761-1%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22101%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-0%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22105%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-7%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22109%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1%22 height%3D%221.9999945%22 width%3D%2212%22 y%3D%22125%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22137%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22129%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4-3%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22133%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C100.0254 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C100.5991 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1452 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533865%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550756%2C0 6.710442%2C-2.4113 7.650391%2C-5.9414 0.939949%2C-3.5301 -0.618463%2C-7.2736 -3.710938%2C-9.0703 -1.159678%2C-0.6738 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C99.9629 c -1.270084%2C0.039 -2.541493%2C0.3887 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5402 -3.710937%2C9.0703 0.939949%2C3.5301 4.09768%2C5.9414 7.648437%2C5.9414 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4056 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C100 0%2C2 -2.4999996%2C0 L 12%2C107 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 id%3D%22path3055-0-77%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9850574%2C108.015 14.0298856%2C-0.03%22 id%3D%22path5244-5-0-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9849874%2C132.015 14.0298866%2C-0.03%22 id%3D%22path5244-5-0-5-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C123.9629 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C124.5366 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1453 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533864%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550757%2C0 6.710442%2C-2.4093 7.650391%2C-5.9394 0.939949%2C-3.5301 -0.618463%2C-7.2756 -3.710938%2C-9.0723 -1.159678%2C-0.6737 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138-12%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C123.9629 c -1.270084%2C0.039 -2.541493%2C0.3888 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5422 -3.710937%2C9.0723 0.939949%2C3.5301 4.09768%2C5.9394 7.648437%2C5.9394 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4055 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1-3%22 %2F%3E %3Cpath id%3D%22path6191%22 d%3D%22m 10.5%2C116 0%2C-2 -2.4999996%2C0 L 12%2C109 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C129 0%2C-2 -2.4999996%2C0 L 12%2C122 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 id%3D%22path6193%22 %2F%3E %3Cpath id%3D%22path6195%22 d%3D%22m 10.5%2C135 0%2C2 -2.4999996%2C0 L 12%2C142 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4500%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073242 -3.833708%2C2.213392 -3.8337072%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.8337082%2C2.213392 z%22 inkscape%3Atransform-center-x%3D%22-1.2779026%22 %2F%3E %3Cpath inkscape%3Atransform-center-x%3D%221.277902%22 d%3D%22m -31.500004%2C60.073242 -3.833708%2C2.213392 -3.833707%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.833707%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Acx%3D%22-36.611614%22 sodipodi%3Asides%3D%223%22 id%3D%22path4502%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22scale(-1%2C1)%22 %2F%3E %3Cpath d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Asides%3D%223%22 id%3D%22path4504%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C72.0074%2C71.7877)%22 inkscape%3Atransform-center-y%3D%221.2779029%22 %2F%3E %3Cpath inkscape%3Atransform-center-y%3D%22-1.2779026%22 transform%3D%22matrix(0%2C-1%2C-1%2C0%2C96%2C96)%22 sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4506%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615-5%22 d%3D%22m 171.82574%2C65.174193 16.34854%2C0 -8.17427%2C-13.348454 z%22 style%3D%22fill%3A%23fbb917%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23fbb917%3Bstroke-width%3A1.65161395%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C55 0%2C6 2%2C0 0%2C-6%22 id%3D%22path4300%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C62 0%2C2 2%2C0 0%2C-2%22 id%3D%22path4300-6%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E%3C%2Fsvg%3E"); - color: white; - opacity: 0.8; - font-family: arial, sans-serif; - font-size: 10pt; - float: left; -} - -div.jsoneditor-menu > button:hover, -div.jsoneditor-menu > div.jsoneditor-modes > button:hover { - background-color: rgba(255,255,255,0.2); - border: 1px solid rgba(255,255,255,0.4); -} - -div.jsoneditor-menu > button:focus, -div.jsoneditor-menu > button:active, -div.jsoneditor-menu > div.jsoneditor-modes > button:focus, -div.jsoneditor-menu > div.jsoneditor-modes > button:active { - background-color: rgba(255,255,255,0.3); -} - -div.jsoneditor-menu > button:disabled, -div.jsoneditor-menu > div.jsoneditor-modes > button:disabled { - opacity: 0.5; -} - -div.jsoneditor-menu > button.jsoneditor-collapse-all { - background-position: 0 -96px; -} - -div.jsoneditor-menu > button.jsoneditor-expand-all { - background-position: 0 -120px; -} - -div.jsoneditor-menu > button.jsoneditor-undo { - background-position: -24px -96px; -} - -div.jsoneditor-menu > button.jsoneditor-undo:disabled { - background-position: -24px -120px; -} - -div.jsoneditor-menu > button.jsoneditor-redo { - background-position: -48px -96px; -} - -div.jsoneditor-menu > button.jsoneditor-redo:disabled { - background-position: -48px -120px; -} - -div.jsoneditor-menu > button.jsoneditor-compact { - background-position: -72px -96px; -} - -div.jsoneditor-menu > button.jsoneditor-format { - background-position: -72px -120px; -} - -div.jsoneditor-menu > div.jsoneditor-modes { - display: inline-block; - float: left; -} - -div.jsoneditor-menu > div.jsoneditor-modes > button { - background-image: none; - width: auto; - padding-left: 6px; - padding-right: 6px; -} - -div.jsoneditor-menu > button.jsoneditor-separator, -div.jsoneditor-menu > div.jsoneditor-modes > button.jsoneditor-separator { - margin-left: 10px; -} - -div.jsoneditor-menu a { - font-family: arial, sans-serif; - font-size: 10pt; - color: white; - opacity: 0.8; - vertical-align: middle; -} - -div.jsoneditor-menu a:hover { - opacity: 1; -} - -div.jsoneditor-menu a.jsoneditor-poweredBy { - font-size: 8pt; - position: absolute; - right: 0; - top: 0; - padding: 10px; -} -table.jsoneditor-search input, -table.jsoneditor-search div.jsoneditor-results { - font-family: arial, sans-serif; - font-size: 10pt; - color: #1A1A1A; - background: transparent; - /* For Firefox */ -} - -table.jsoneditor-search div.jsoneditor-results { - color: white; - padding-right: 5px; - line-height: 24px; -} - -table.jsoneditor-search { - position: absolute; - right: 4px; - top: 4px; - border-collapse: collapse; - border-spacing: 0; -} - -table.jsoneditor-search div.jsoneditor-frame { - border: 1px solid transparent; - background-color: white; - padding: 0 2px; - margin: 0; -} - -table.jsoneditor-search div.jsoneditor-frame table { - border-collapse: collapse; -} - -table.jsoneditor-search input { - width: 120px; - border: none; - outline: none; - margin: 1px; - line-height: 20px; -} - -table.jsoneditor-search button { - width: 16px; - height: 24px; - padding: 0; - margin: 0; - border: none; - background: url("data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22 standalone%3D%22no%22%3F%3E%3Csvg xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22 xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22 xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22 xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22 xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22 width%3D%22216%22 height%3D%22144%22 id%3D%22svg4136%22 version%3D%221.1%22 inkscape%3Aversion%3D%220.91 r%22 sodipodi%3Adocname%3D%22jsoneditor-icons.svg%22%3E %3Ctitle id%3D%22title6512%22%3EJSON Editor Icons%3C%2Ftitle%3E %3Cmetadata id%3D%22metadata4148%22%3E %3Crdf%3ARDF%3E %3Ccc%3AWork rdf%3Aabout%3D%22%22%3E %3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E %3Cdc%3Atype rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22 %2F%3E %3Cdc%3Atitle%3EJSON Editor Icons%3C%2Fdc%3Atitle%3E %3C%2Fcc%3AWork%3E %3C%2Frdf%3ARDF%3E %3C%2Fmetadata%3E %3Cdefs id%3D%22defs4146%22 %2F%3E %3Csodipodi%3Anamedview pagecolor%3D%22%23ffffff%22 bordercolor%3D%22%23666666%22 borderopacity%3D%221%22 objecttolerance%3D%2210%22 gridtolerance%3D%2210%22 guidetolerance%3D%2210%22 inkscape%3Apageopacity%3D%220%22 inkscape%3Apageshadow%3D%222%22 inkscape%3Awindow-width%3D%221920%22 inkscape%3Awindow-height%3D%221028%22 id%3D%22namedview4144%22 showgrid%3D%22true%22 inkscape%3Azoom%3D%224%22 inkscape%3Acx%3D%2297.217248%22 inkscape%3Acy%3D%2259.950227%22 inkscape%3Awindow-x%3D%220%22 inkscape%3Awindow-y%3D%220%22 inkscape%3Awindow-maximized%3D%221%22 inkscape%3Acurrent-layer%3D%22svg4136%22 showguides%3D%22false%22 borderlayer%3D%22false%22 inkscape%3Ashowpageshadow%3D%22true%22 showborder%3D%22true%22%3E %3Cinkscape%3Agrid type%3D%22xygrid%22 id%3D%22grid4640%22 empspacing%3D%2224%22 %2F%3E %3C%2Fsodipodi%3Anamedview%3E %3C!-- Created with SVG-edit - http%3A%2F%2Fsvg-edit.googlecode.com%2F --%3E %3Cg id%3D%22g4394%22%3E %3Crect x%3D%224%22 y%3D%224%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1%22 style%3D%22fill%3A%231aae1c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ec3f29%3Bfill-opacity%3A0.94117647%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22svg_1-7%22 %2F%3E %3Crect id%3D%22rect4165%22 height%3D%2216%22 width%3D%2216%22 y%3D%223.999995%22 x%3D%2252.000004%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%223.9999852%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%223.999995%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4175-3%22 %2F%3E %3Cg style%3D%22stroke%3Anone%22 id%3D%22g4299%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg style%3D%22stroke%3Anone%22 transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C12.000001)%22 id%3D%22g4299-3%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-0%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22svg_1-1-1-9%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%227.0000048%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5%22 %2F%3E %3Crect id%3D%22rect4354%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2210.00001%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%233c80df%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A0.94117647%22 x%3D%2258.000004%22 y%3D%2210.000005%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22svg_1-7-5-7%22 %2F%3E %3Cg id%3D%22g4378%22%3E %3Crect id%3D%22svg_1-7-5-3%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4374%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4376%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4383%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4385%22 %2F%3E %3Crect id%3D%22rect4387%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4389%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect y%3D%223.9999199%22 x%3D%2276%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-4%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351%22 d%3D%22m 85.10447%2C6.0157384 -0.0156%2C1.4063 c 3.02669%2C-0.2402 0.33008%2C3.6507996 2.48438%2C4.5780996 -2.18694%2C1.0938 0.49191%2C4.9069 -2.45313%2C4.5781 l -0.0156%2C1.4219 c 5.70828%2C0.559 1.03264%2C-5.1005 4.70313%2C-5.2656 l 0%2C-1.4063 c -3.61303%2C-0.027 1.11893%2C-5.7069996 -4.70313%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4351-9%22 d%3D%22m 82.78125%2C5.9984384 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33007%2C3.6506996 -2.48437%2C4.5780996 2.18694%2C1.0938 -0.49192%2C4.9069 2.45312%2C4.5781 l 0.0156%2C1.4219 c -5.70827%2C0.559 -1.03263%2C-5.1004 -4.70312%2C-5.2656 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11894%2C-5.7070996 4.70312%2C-5.3124996 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22100%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-25%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987%22 d%3D%22m 103.719%2C5.6719384 0%2C12.7187996 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.6249996 1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path2987-1%22 d%3D%22m 112.2185%2C5.6721984 0%2C12.7187996 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.6249996 -1.375%2C0 0%2C-1.5625 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22124%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-73%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3780%22 d%3D%22m 126.2824%2C17.602938 1.78957%2C0 1.14143%2C-2.8641 5.65364%2C0 1.14856%2C2.8641 1.76565%2C0 -4.78687%2C-11.1610996 -1.91903%2C0 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path3782%22 d%3D%22m 129.72704%2C13.478838 4.60852%2C0.01 -2.30426%2C-5.5497996 z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Crect y%3D%223.9999199%22 x%3D%22148%22 height%3D%2216%22 width%3D%2216%22 id%3D%22rect3754-35%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2%22 d%3D%22m 156.47655%2C5.8917384 0%2C2.1797 0.46093%2C2.3983996 1.82813%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22ccccccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path5008-2-8%22 d%3D%22m 152.51561%2C5.8906384 0%2C2.1797 0.46094%2C2.3983996 1.82812%2C0 0.39844%2C-2.3983996 0%2C-2.1797 z%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 %2F%3E %3C%2Fg%3E %3Crect x%3D%224%22 y%3D%2227.999994%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4432%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2228.000006%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4434%22 %2F%3E %3Crect id%3D%22rect4436%22 height%3D%2216%22 width%3D%2216%22 y%3D%2227.99999%22 x%3D%2252.000004%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22172.00002%22 y%3D%2227.999981%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4446%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22196%22 y%3D%2227.99999%22 width%3D%2216%22 height%3D%2216%22 id%3D%22rect4448%22 %2F%3E %3Cg id%3D%22g4466%22 style%3D%22stroke%3Anone%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4468%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4470%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Cg transform%3D%22matrix(0.70710678%2C-0.70710678%2C0.70710678%2C0.70710678%2C19.029435%2C35.999996)%22 id%3D%22g4472%22 style%3D%22stroke%3Anone%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4474%22 height%3D%221.9999986%22 width%3D%229.9999924%22 y%3D%2210.999998%22 x%3D%227.0000048%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%22 id%3D%22rect4476%22 height%3D%229.9999838%22 width%3D%221.9999955%22 y%3D%227.0000114%22 x%3D%2211.000005%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%2255.000004%22 y%3D%2231%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4478%22 %2F%3E %3Crect id%3D%22rect4480%22 height%3D%226.9999905%22 width%3D%226.9999909%22 y%3D%2234.000008%22 x%3D%2258%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 x%3D%2258.000004%22 y%3D%2234.000004%22 width%3D%226.9999909%22 height%3D%226.9999905%22 id%3D%22rect4482%22 %2F%3E %3Cg id%3D%22g4484%22 transform%3D%22translate(0%2C23.999995)%22%3E %3Crect id%3D%22rect4486%22 height%3D%221.9999965%22 width%3D%227.9999909%22 y%3D%2210.999999%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%227.0000005%22 width%3D%2211.999995%22 height%3D%221.9999946%22 id%3D%22rect4488%22 %2F%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2214.999996%22 width%3D%223.9999928%22 height%3D%221.9999995%22 id%3D%22rect4490%22 %2F%3E %3C%2Fg%3E %3Cg id%3D%22g4492%22 transform%3D%22matrix(1%2C0%2C0%2C-1%2C-23.999995%2C47.99999)%22%3E %3Crect style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 x%3D%22198%22 y%3D%2210.999999%22 width%3D%227.9999909%22 height%3D%221.9999965%22 id%3D%22rect4494%22 %2F%3E %3Crect id%3D%22rect4496%22 height%3D%221.9999946%22 width%3D%2211.999995%22 y%3D%227.0000005%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4498%22 height%3D%221.9999995%22 width%3D%223.9999928%22 y%3D%2214.999996%22 x%3D%22198%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23000000%3Bstroke-width%3A0%22 %2F%3E %3C%2Fg%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-8%22 width%3D%2216%22 height%3D%2216%22 x%3D%2276%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 85.10448%2C30.015537 -0.0156%2C1.4063 c 3.02668%2C-0.2402 0.33007%2C3.6508 2.48438%2C4.5781 -2.18695%2C1.0938 0.49191%2C4.90688 -2.45313%2C4.57808 l -0.0156%2C1.4219 c 5.70827%2C0.559 1.03263%2C-5.10048 4.70313%2C-5.26558 l 0%2C-1.4063 c -3.61304%2C-0.027 1.11893%2C-5.707 -4.70313%2C-5.3125 z%22 id%3D%22path4351-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3A%23ffffff%3Bstroke-width%3A0.2%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 82.78126%2C29.998237 0.0156%2C1.4063 c -3.02668%2C-0.2402 -0.33008%2C3.6507 -2.48438%2C4.5781 2.18694%2C1.0938 -0.49191%2C4.90688 2.45313%2C4.57808 l 0.0156%2C1.4219 c -5.70828%2C0.559 -1.03264%2C-5.10038 -4.70313%2C-5.26558 l 0%2C-1.4063 c 3.61303%2C-0.027 -1.11893%2C-5.7071 4.70313%2C-5.3125 z%22 id%3D%22path4351-9-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccccccc%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-65%22 width%3D%2216%22 height%3D%2216%22 x%3D%22100%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 103.719%2C29.671937 0%2C12.71878 3.03125%2C0 0%2C-1.5313 -1.34375%2C0 0%2C-9.62498 1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-8%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 112.2185%2C29.671937 0%2C12.71878 -3.03125%2C0 0%2C-1.5313 1.34375%2C0 0%2C-9.62498 -1.375%2C0 0%2C-1.5625 z%22 id%3D%22path2987-1-9%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-92%22 width%3D%2216%22 height%3D%2216%22 x%3D%22124%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 126.2824%2C41.602917 1.78957%2C0 1.14143%2C-2.86408 5.65364%2C0 1.14856%2C2.86408 1.76565%2C0 -4.78687%2C-11.16108 -1.91902%2C0 z%22 id%3D%22path3780-9%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 129.72704%2C37.478837 4.60852%2C0.01 -2.30426%2C-5.5498 z%22 id%3D%22path3782-2%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%22 id%3D%22rect3754-47%22 width%3D%2216%22 height%3D%2216%22 x%3D%22148%22 y%3D%2227.99992%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 156.47656%2C29.891737 0%2C2.1797 0.46093%2C2.3984 1.82813%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-1%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Cpath style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%22 d%3D%22m 152.51562%2C29.890637 0%2C2.1797 0.46094%2C2.3984 1.82812%2C0 0.39844%2C-2.3984 0%2C-2.1797 z%22 id%3D%22path5008-2-8-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22ccccccc%22 %2F%3E %3Crect id%3D%22svg_1-7-2%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2264%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22svg_1-7-2-2%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2252%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2252%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4561%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2280.000008%22 y%3D%2258%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4563%22 %2F%3E %3Crect id%3D%22rect4565%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2258%22 x%3D%2285.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4567%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2264%22 x%3D%2280.000008%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2285.000008%22 y%3D%2264%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4569%22 %2F%3E %3Ccircle style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%234c4c4c%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4571%22 cx%3D%22110.06081%22 cy%3D%2257.939209%22 r%3D%224.7438836%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%22116.64566%22 y%3D%22-31.79752%22 width%3D%224.229713%22 height%3D%226.4053884%22 id%3D%22rect4563-2%22 transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 %2F%3E %3Cpath style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 125%2C56 138.77027%2C56.095 132%2C64 Z%22 id%3D%22path4613%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615%22 d%3D%22M 149%2C64 162.77027%2C63.905 156%2C56 Z%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2254%22 y%3D%2253%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4638%22 %2F%3E %3Crect id%3D%22svg_1-7-2-24%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-56%22 x%3D%2253%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 x%3D%2253%22 y%3D%22-66%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4657%22 %2F%3E %3Crect id%3D%22rect4659%22 height%3D%220.99999291%22 width%3D%2211.999999%22 y%3D%2257%22 x%3D%2254%22 style%3D%22fill%3A%234c4c4c%3Bfill-opacity%3A0.98431373%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2288.000122%22 width%3D%2211.999996%22 height%3D%221.9999961%22 id%3D%22rect4661%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2276.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4663%22 %2F%3E %3Crect id%3D%22rect4665%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2276.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect id%3D%22rect4667%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2282.000122%22 x%3D%2280.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2285.000008%22 y%3D%2282.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4669%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2280.000008%22 y%3D%2288.000122%22 width%3D%222.9999907%22 height%3D%222.9999905%22 id%3D%22rect4671%22 %2F%3E %3Crect id%3D%22rect4673%22 height%3D%222.9999905%22 width%3D%222.9999907%22 y%3D%2288.000122%22 x%3D%2285.000008%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Ccircle r%3D%224.7438836%22 cy%3D%2281.939331%22 cx%3D%22110.06081%22 id%3D%22circle4675%22 style%3D%22opacity%3A1%3Bfill%3Anone%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0.70710678%2C0.70710678%2C-0.70710678%2C0.70710678%2C0%2C0)%22 id%3D%22rect4677%22 height%3D%226.4053884%22 width%3D%224.229713%22 y%3D%22-14.826816%22 x%3D%22133.6163%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4679%22 d%3D%22m 125%2C80.000005 13.77027%2C0.09499 L 132%2C87.999992 Z%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22M 149%2C88.0002 162.77027%2C87.9052 156%2C80.0002 Z%22 id%3D%22path4681%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Crect id%3D%22rect4683%22 height%3D%221.9999961%22 width%3D%2211.999996%22 y%3D%2277.000122%22 x%3D%2254%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 %2F%3E %3Crect transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2277.000122%22 y%3D%22-56%22 width%3D%2212.99999%22 height%3D%221.9999957%22 id%3D%22rect4685%22 %2F%3E %3Crect id%3D%22rect4687%22 height%3D%221.9999957%22 width%3D%2212.99999%22 y%3D%22-66%22 x%3D%2277.000122%22 style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C0%2C0)%22 %2F%3E %3Crect style%3D%22fill%3A%23d3d3d3%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A0%3Bstroke-opacity%3A1%22 x%3D%2254%22 y%3D%2281.000122%22 width%3D%2211.999999%22 height%3D%220.99999291%22 id%3D%22rect4689%22 %2F%3E %3Crect id%3D%22rect4761-1%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22101%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-0%22 height%3D%221.9999945%22 width%3D%2215.99999%22 y%3D%22105%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-7%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22109%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1%22 height%3D%221.9999945%22 width%3D%2212%22 y%3D%22125%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22137%22 x%3D%2276.000008%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4%22 height%3D%221.9999945%22 width%3D%2210%22 y%3D%22129%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Crect id%3D%22rect4761-1-1-4-4-3%22 height%3D%221.9999945%22 width%3D%229%22 y%3D%22133%22 x%3D%2282%22 style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.80000007%3Bstroke%3Anone%3Bstroke-width%3A0%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C100.0254 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C100.5991 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1452 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533865%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550756%2C0 6.710442%2C-2.4113 7.650391%2C-5.9414 0.939949%2C-3.5301 -0.618463%2C-7.2736 -3.710938%2C-9.0703 -1.159678%2C-0.6738 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.8%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C99.9629 c -1.270084%2C0.039 -2.541493%2C0.3887 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5402 -3.710937%2C9.0703 0.939949%2C3.5301 4.09768%2C5.9414 7.648437%2C5.9414 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4056 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C100 0%2C2 -2.4999996%2C0 L 12%2C107 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 id%3D%22path3055-0-77%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9850574%2C108.015 14.0298856%2C-0.03%22 id%3D%22path5244-5-0-5%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath style%3D%22opacity%3A0.8%3Bfill%3Anone%3Bstroke%3A%23ffffff%3Bstroke-width%3A1.966%3Bstroke-linecap%3Asquare%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 d%3D%22m 4.9849874%2C132.015 14.0298866%2C-0.03%22 id%3D%22path5244-5-0-5-8%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cc%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 36.398438%2C123.9629 c -0.423362%2C-0.013 -0.846847%2C0.01 -1.265626%2C0.062 -1.656562%2C0.2196 -3.244567%2C0.9739 -4.507812%2C2.2266 L 29%2C124.5366 l -2.324219%2C7.7129 7.826172%2C-1.9062 -1.804687%2C-1.9063 c 1.597702%2C-1.5308 4.048706%2C-1.8453 5.984375%2C-0.7207 1.971162%2C1.1453 2.881954%2C3.3975 2.308593%2C5.5508 -0.573361%2C2.1533 -2.533864%2C3.6953 -4.830078%2C3.6953 l 0%2C3.0742 c 3.550757%2C0 6.710442%2C-2.4093 7.650391%2C-5.9394 0.939949%2C-3.5301 -0.618463%2C-7.2756 -3.710938%2C-9.0723 -1.159678%2C-0.6737 -2.431087%2C-1.0231 -3.701171%2C-1.0625 z%22 id%3D%22path4138-12%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22color%3A%23000000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3Anormal%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bdirection%3Altr%3Bblock-progression%3Atb%3Bwriting-mode%3Alr-tb%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bclip-rule%3Anonzero%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A0.4%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000000%3Bsolid-opacity%3A1%3Bfill%3A%234d4d4d%3Bfill-opacity%3A1%3Bfill-rule%3Anonzero%3Bstroke%3Anone%3Bstroke-width%3A2.66157866%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%3Benable-background%3Aaccumulate%22 d%3D%22m 59.722656%2C123.9629 c -1.270084%2C0.039 -2.541493%2C0.3888 -3.701172%2C1.0625 -3.092475%2C1.7967 -4.650886%2C5.5422 -3.710937%2C9.0723 0.939949%2C3.5301 4.09768%2C5.9394 7.648437%2C5.9394 l 0%2C-3.0742 c -2.296214%2C0 -4.256717%2C-1.542 -4.830078%2C-3.6953 -0.573361%2C-2.1533 0.337432%2C-4.4055 2.308594%2C-5.5508 1.935731%2C-1.1246 4.38863%2C-0.8102 5.986326%2C0.7207 l -1.806638%2C1.9063 7.828128%2C1.9062 -2.32422%2C-7.7129 -1.62696%2C1.7168 c -1.26338%2C-1.2531 -2.848917%2C-2.0088 -4.505855%2C-2.2285 -0.418778%2C-0.055 -0.842263%2C-0.076 -1.265625%2C-0.062 z%22 id%3D%22path4138-1-3%22 %2F%3E %3Cpath id%3D%22path6191%22 d%3D%22m 10.5%2C116 0%2C-2 -2.4999996%2C0 L 12%2C109 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath inkscape%3Aconnector-curvature%3D%220%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 d%3D%22m 10.5%2C129 0%2C-2 -2.4999996%2C0 L 12%2C122 l 4%2C5 -2.5%2C0 0%2C2 -3%2C0 z%22 id%3D%22path6193%22 %2F%3E %3Cpath id%3D%22path6195%22 d%3D%22m 10.5%2C135 0%2C2 -2.4999996%2C0 L 12%2C142 l 4%2C-5 -2.5%2C0 0%2C-2 -3%2C0 z%22 style%3D%22opacity%3A0.8%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bstroke%3Anone%3Bstroke-width%3A1.966%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 inkscape%3Aconnector-curvature%3D%220%22 %2F%3E %3Cpath sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4500%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073242 -3.833708%2C2.213392 -3.8337072%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.8337082%2C2.213392 z%22 inkscape%3Atransform-center-x%3D%22-1.2779026%22 %2F%3E %3Cpath inkscape%3Atransform-center-x%3D%221.277902%22 d%3D%22m -31.500004%2C60.073242 -3.833708%2C2.213392 -3.833707%2C2.213393 0%2C-4.426785 0%2C-4.426784 3.833707%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073242%22 sodipodi%3Acx%3D%22-36.611614%22 sodipodi%3Asides%3D%223%22 id%3D%22path4502%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22scale(-1%2C1)%22 %2F%3E %3Cpath d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 inkscape%3Arandomized%3D%220%22 inkscape%3Arounded%3D%220%22 inkscape%3Aflatsided%3D%22false%22 sodipodi%3Aarg2%3D%221.0471976%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Asides%3D%223%22 id%3D%22path4504%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 sodipodi%3Atype%3D%22star%22 transform%3D%22matrix(0%2C1%2C-1%2C0%2C72.0074%2C71.7877)%22 inkscape%3Atransform-center-y%3D%221.2779029%22 %2F%3E %3Cpath inkscape%3Atransform-center-y%3D%22-1.2779026%22 transform%3D%22matrix(0%2C-1%2C-1%2C0%2C96%2C96)%22 sodipodi%3Atype%3D%22star%22 style%3D%22fill%3A%234d4d4d%3Bfill-opacity%3A0.90196078%3Bstroke%3A%23d3d3d3%3Bstroke-width%3A0%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%22 id%3D%22path4506%22 sodipodi%3Asides%3D%223%22 sodipodi%3Acx%3D%2211.55581%22 sodipodi%3Acy%3D%2260.073212%22 sodipodi%3Ar1%3D%225.1116104%22 sodipodi%3Ar2%3D%222.5558052%22 sodipodi%3Aarg1%3D%220%22 sodipodi%3Aarg2%3D%221.0471976%22 inkscape%3Aflatsided%3D%22false%22 inkscape%3Arounded%3D%220%22 inkscape%3Arandomized%3D%220%22 d%3D%22m 16.66742%2C60.073212 -3.833708%2C2.213392 -3.8337072%2C2.213392 0%2C-4.426784 0%2C-4.426785 3.8337082%2C2.213392 z%22 %2F%3E %3Cpath sodipodi%3Anodetypes%3D%22cccc%22 inkscape%3Aconnector-curvature%3D%220%22 id%3D%22path4615-5%22 d%3D%22m 171.82574%2C65.174193 16.34854%2C0 -8.17427%2C-13.348454 z%22 style%3D%22fill%3A%23fbb917%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3A%23fbb917%3Bstroke-width%3A1.65161395%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A1%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C55 0%2C6 2%2C0 0%2C-6%22 id%3D%22path4300%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E %3Cpath style%3D%22opacity%3A1%3Bfill%3A%23ffffff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A1px%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-opacity%3A1%22 d%3D%22m 179%2C62 0%2C2 2%2C0 0%2C-2%22 id%3D%22path4300-6%22 inkscape%3Aconnector-curvature%3D%220%22 sodipodi%3Anodetypes%3D%22cccc%22 %2F%3E%3C%2Fsvg%3E"); - vertical-align: top; -} - -table.jsoneditor-search button:hover { - background-color: transparent; -} - -table.jsoneditor-search button.jsoneditor-refresh { - width: 18px; - background-position: -99px -73px; -} - -table.jsoneditor-search button.jsoneditor-next { - cursor: pointer; - background-position: -124px -73px; -} - -table.jsoneditor-search button.jsoneditor-next:hover { - background-position: -124px -49px; -} - -table.jsoneditor-search button.jsoneditor-previous { - cursor: pointer; - background-position: -148px -73px; - margin-right: 2px; -} - -table.jsoneditor-search button.jsoneditor-previous:hover { - background-position: -148px -49px; -}`;styleInject(css_248z$1);var css_248z=`.ace_line_group { - text-align: left; -} -.json-editor-container { - display: flex; - width: 100%; -} -.json-editor-container .tree-mode { - width: 50%; -} -.json-editor-container .code-mode { - flex-grow: 1; -} -.jsoneditor-btns { - text-align: center; - margin-top: 10px; -} -.jsoneditor-vue .jsoneditor-outer { - min-height: 150px; -} -.jsoneditor-vue div.jsoneditor-tree { - min-height: 350px; -} -.json-save-btn { - background-color: #20a0ff; - border: none; - color: #fff; - padding: 5px 10px; - border-radius: 5px; - cursor: pointer; -} -.json-save-btn:focus { - outline: none; -} -.json-save-btn[disabled] { - background-color: #1d8ce0; - cursor: not-allowed; -} -code { - background-color: #f5f5f5; -} -`;styleInject(css_248z);var Vue3JsonEditor=defineComponent({props:{modelValue:[String,Boolean,Object,Array],showBtns:[Boolean],expandedOnStart:{type:Boolean,default:!1},mode:{type:String,default:"tree"},modes:{type:Array,default:function(){return["tree","code","form","text","view"]}},lang:{type:String,default:"en"}},setup:function(r,o){var s,a,l=o.emit,c=(s=getCurrentInstance())===null||s===void 0?void 0:s.root.proxy,u=reactive({editor:null,error:!1,json:{},internalChange:!1,expandedModes:["tree","view","form"],locale:{it:{save:"SALVA"},en:{save:"SAVE"},zh:{save:"保存"}},uid:"jsoneditor-vue-".concat((a=getCurrentInstance())===null||a===void 0?void 0:a.uid)});function d(){r.expandedOnStart&&u.expandedModes.includes(r.mode)&&u.editor.expandAll()}function m(g){u.editor&&u.editor.set(g)}return watch(function(){return r.modelValue},function(){var g=_asyncToGenerator(regeneratorRuntime.mark(function y(_){return regeneratorRuntime.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(u.internalChange){E.next=6;break}return u.json=_,E.next=4,m(_);case 4:u.error=!1,d();case 6:case"end":return E.stop()}},y)}));return function(y){return g.apply(this,arguments)}}(),{immediate:!0}),onMounted(function(){var g={mode:r.mode,modes:r.modes,onChange:function(){try{var y=u.editor.get();u.json=y,u.error=!1,l("json-change",y),u.internalChange=!0,l("input",y),c.$nextTick(function(){u.internalChange=!1})}catch(_){u.error=!0,l("has-error",_)}},onModeChange:function(){d()}};u.editor=new jsoneditor(document.querySelector("#".concat(u.uid)),g,u.json)}),function(){return createVNode("div",null,[createVNode("div",{id:u.uid,class:"jsoneditor-vue"},null),r.showBtns!==!1&&createVNode("div",{class:"jsoneditor-btns"},[createVNode("button",{class:"json-save-btn",type:"button",onClick:function(){l("json-save",u.json)},disabled:u.error},[u.locale[r.lang].save])])])}}}),url={},punycode$3={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */punycode$3.exports;(function(r,o){(function(s){var a=o&&!o.nodeType&&o,l=r&&!r.nodeType&&r,c=typeof commonjsGlobal$1=="object"&&commonjsGlobal$1;(c.global===c||c.window===c||c.self===c)&&(s=c);var u,d=2147483647,m=36,g=1,y=26,_=38,E=700,w=72,T=128,k="-",O=/^xn--/,R=/[^\x20-\x7E]/,M=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},D=m-g,P=Math.floor,I=String.fromCharCode,L;function F(pee){throw new RangeError(N[pee])}function U(pee,jr){for(var Tee=pee.length,et=[];Tee--;)et[Tee]=jr(pee[Tee]);return et}function J(pee,jr){var Tee=pee.split("@"),et="";Tee.length>1&&(et=Tee[0]+"@",pee=Tee[1]),pee=pee.replace(M,".");var ft=pee.split("."),yee=U(ft,jr).join(".");return et+yee}function z(pee){for(var jr=[],Tee=0,et=pee.length,ft,yee;Tee=55296&&ft<=56319&&Tee65535&&(jr-=65536,Tee+=I(jr>>>10&1023|55296),jr=56320|jr&1023),Tee+=I(jr),Tee}).join("")}function ce(pee){return pee-48<10?pee-22:pee-65<26?pee-65:pee-97<26?pee-97:m}function Y(pee,jr){return pee+22+75*(pee<26)-((jr!=0)<<5)}function B(pee,jr,Tee){var et=0;for(pee=Tee?P(pee/E):pee>>1,pee+=P(pee/jr);pee>D*y>>1;et+=m)pee=P(pee/D);return P(et+(D+1)*pee/(pee+_))}function V(pee){var jr=[],Tee=pee.length,et,ft=0,yee=T,ete=w,xte,Ote,nee,Wee,Bee,Nte,_ee,st,Lee;for(xte=pee.lastIndexOf(k),xte<0&&(xte=0),Ote=0;Ote=128&&F("not-basic"),jr.push(pee.charCodeAt(Ote));for(nee=xte>0?xte+1:0;nee=Tee&&F("invalid-input"),_ee=ce(pee.charCodeAt(nee++)),(_ee>=m||_ee>P((d-ft)/Bee))&&F("overflow"),ft+=_ee*Bee,st=Nte<=ete?g:Nte>=ete+y?y:Nte-ete,!(_eeP(d/Lee)&&F("overflow"),Bee*=Lee;et=jr.length+1,ete=B(ft-Wee,et,Wee==0),P(ft/et)>d-yee&&F("overflow"),yee+=P(ft/et),ft%=et,jr.splice(ft++,0,yee)}return ie(jr)}function Ge(pee){var jr,Tee,et,ft,yee,ete,xte,Ote,nee,Wee,Bee,Nte=[],_ee,st,Lee,$te;for(pee=z(pee),_ee=pee.length,jr=T,Tee=0,yee=w,ete=0;ete<_ee;++ete)Bee=pee[ete],Bee<128&&Nte.push(I(Bee));for(et=ft=Nte.length,ft&&Nte.push(k);et<_ee;){for(xte=d,ete=0;ete<_ee;++ete)Bee=pee[ete],Bee>=jr&&BeeP((d-Tee)/st)&&F("overflow"),Tee+=(xte-jr)*st,jr=xte,ete=0;ete<_ee;++ete)if(Bee=pee[ete],Beed&&F("overflow"),Bee==jr){for(Ote=Tee,nee=m;Wee=nee<=yee?g:nee>=yee+y?y:nee-yee,!(Ote"u"||!getProto?undefined$1:getProto(Uint8Array),INTRINSICS={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$3,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":$URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function r(o){var s;if(o==="%AsyncFunction%")s=getEvalledConstructor("async function () {}");else if(o==="%GeneratorFunction%")s=getEvalledConstructor("function* () {}");else if(o==="%AsyncGeneratorFunction%")s=getEvalledConstructor("async function* () {}");else if(o==="%AsyncGenerator%"){var a=r("%AsyncGeneratorFunction%");a&&(s=a.prototype)}else if(o==="%AsyncIteratorPrototype%"){var l=r("%AsyncGenerator%");l&&getProto&&(s=getProto(l.prototype))}return INTRINSICS[o]=s,s},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn$2=hasown,$concat$1=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace$1=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function r(o){var s=$strSlice(o,0,1),a=$strSlice(o,-1);if(s==="%"&&a!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&s!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var l=[];return $replace$1(o,rePropName,function(c,u,d,m){l[l.length]=d?$replace$1(m,reEscapeChar,"$1"):u||c}),l},getBaseIntrinsic=function r(o,s){var a=o,l;if(hasOwn$2(LEGACY_ALIASES,a)&&(l=LEGACY_ALIASES[a],a="%"+l[0]+"%"),hasOwn$2(INTRINSICS,a)){var c=INTRINSICS[a];if(c===needsEval&&(c=doEval(a)),typeof c>"u"&&!s)throw new $TypeError$3("intrinsic "+o+" exists, but is not available. Please file an issue!");return{alias:l,name:a,value:c}}throw new $SyntaxError$1("intrinsic "+o+" does not exist!")},getIntrinsic=function r(o,s){if(typeof o!="string"||o.length===0)throw new $TypeError$3("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!="boolean")throw new $TypeError$3('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,o)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=stringToPath(o),l=a.length>0?a[0]:"",c=getBaseIntrinsic("%"+l+"%",s),u=c.name,d=c.value,m=!1,g=c.alias;g&&(l=g[0],$spliceApply(a,$concat$1([0,1],g)));for(var y=1,_=!0;y=a.length){var k=$gOPD$1(d,E);_=!!k,_&&"get"in k&&!("originalValue"in k.get)?d=k.get:d=d[E]}else _=hasOwn$2(d,E),d=d[E];_&&!m&&(INTRINSICS[u]=d)}}return d},callBind$1={exports:{}},esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var r=getIntrinsic,o=r("%Object.defineProperty%",!0)||!1;if(o)try{o({},"a",{value:1})}catch{o=!1}return esDefineProperty=o,esDefineProperty}var GetIntrinsic$3=getIntrinsic,$gOPD=GetIntrinsic$3("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd$1=$gOPD,$defineProperty$1=requireEsDefineProperty(),$SyntaxError=syntax,$TypeError$2=type,gopd=gopd$1,defineDataProperty=function r(o,s,a){if(!o||typeof o!="object"&&typeof o!="function")throw new $TypeError$2("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new $TypeError$2("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $TypeError$2("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $TypeError$2("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $TypeError$2("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $TypeError$2("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,m=!!gopd&&gopd(o,s);if($defineProperty$1)$defineProperty$1(o,s,{configurable:u===null&&m?m.configurable:!u,enumerable:l===null&&m?m.enumerable:!l,value:a,writable:c===null&&m?m.writable:!c});else if(d||!l&&!c&&!u)o[s]=a;else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},$defineProperty=requireEsDefineProperty(),hasPropertyDescriptors=function r(){return!!$defineProperty};hasPropertyDescriptors.hasArrayLengthDefineBug=function r(){if(!$defineProperty)return null;try{return $defineProperty([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors,GetIntrinsic$2=getIntrinsic,define=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD=gopd$1,$TypeError$1=type,$floor$1=GetIntrinsic$2("%Math.floor%"),setFunctionLength=function r(o,s){if(typeof o!="function")throw new $TypeError$1("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||$floor$1(s)!==s)throw new $TypeError$1("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in o&&gOPD){var u=gOPD(o,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!a)&&(hasDescriptors?define(o,"length",s,!0,!0):define(o,"length",s)),o};(function(r){var o=functionBind,s=getIntrinsic,a=setFunctionLength,l=type,c=s("%Function.prototype.apply%"),u=s("%Function.prototype.call%"),d=s("%Reflect.apply%",!0)||o.call(u,c),m=requireEsDefineProperty(),g=s("%Math.max%");r.exports=function(E){if(typeof E!="function")throw new l("a function is required");var w=d(o,u,arguments);return a(w,1+g(0,E.length-(arguments.length-1)),!0)};var y=function(){return d(o,c,arguments)};m?m(r.exports,"apply",{value:y}):r.exports.apply=y})(callBind$1);var callBindExports=callBind$1.exports,GetIntrinsic$1=getIntrinsic,callBind=callBindExports,$indexOf=callBind(GetIntrinsic$1("String.prototype.indexOf")),callBound$1=function r(o,s){var a=GetIntrinsic$1(o,!!s);return typeof a=="function"&&$indexOf(o,".prototype.")>-1?callBind(a):a};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var hasMap=typeof Map=="function"&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get=="function"?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet=typeof Set=="function"&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get=="function"?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,hasWeakMap=typeof WeakMap=="function"&&WeakMap.prototype,weakMapHas=hasWeakMap?WeakMap.prototype.has:null,hasWeakSet=typeof WeakSet=="function"&&WeakSet.prototype,weakSetHas=hasWeakSet?WeakSet.prototype.has:null,hasWeakRef=typeof WeakRef=="function"&&WeakRef.prototype,weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString$1=Object.prototype.toString,functionToString=Function.prototype.toString,$match=String.prototype.match,$slice=String.prototype.slice,$replace=String.prototype.replace,$toUpperCase=String.prototype.toUpperCase,$toLowerCase=String.prototype.toLowerCase,$test=RegExp.prototype.test,$concat=Array.prototype.concat,$join=Array.prototype.join,$arrSlice=Array.prototype.slice,$floor=Math.floor,bigIntValueOf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hasShammedSymbols=typeof Symbol=="function"&&typeof Symbol.iterator=="object",toStringTag=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols||!0)?Symbol.toStringTag:null,isEnumerable=Object.prototype.propertyIsEnumerable,gPO=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function addNumericSeparator(r,o){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||$test.call(/e/,o))return o;var s=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var a=r<0?-$floor(-r):$floor(r);if(a!==r){var l=String(a),c=$slice.call(o,l.length+1);return $replace.call(l,s,"$&_")+"."+$replace.call($replace.call(c,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(o,s,"$&_")}var utilInspect=require$$0$1,inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,objectInspect=function r(o,s,a,l){var c=s||{};if(has$4(c,"quoteStyle")&&c.quoteStyle!=="single"&&c.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$4(c,"maxStringLength")&&(typeof c.maxStringLength=="number"?c.maxStringLength<0&&c.maxStringLength!==1/0:c.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=has$4(c,"customInspect")?c.customInspect:!0;if(typeof u!="boolean"&&u!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$4(c,"indent")&&c.indent!==null&&c.indent!==" "&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$4(c,"numericSeparator")&&typeof c.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=c.numericSeparator;if(typeof o>"u")return"undefined";if(o===null)return"null";if(typeof o=="boolean")return o?"true":"false";if(typeof o=="string")return inspectString(o,c);if(typeof o=="number"){if(o===0)return 1/0/o>0?"0":"-0";var m=String(o);return d?addNumericSeparator(o,m):m}if(typeof o=="bigint"){var g=String(o)+"n";return d?addNumericSeparator(o,g):g}var y=typeof c.depth>"u"?5:c.depth;if(typeof a>"u"&&(a=0),a>=y&&y>0&&typeof o=="object")return isArray$6(o)?"[Array]":"[Object]";var _=getIndent(c,a);if(typeof l>"u")l=[];else if(indexOf(l,o)>=0)return"[Circular]";function E(ce,Y,B){if(Y&&(l=$arrSlice.call(l),l.push(Y)),B){var V={depth:c.depth};return has$4(c,"quoteStyle")&&(V.quoteStyle=c.quoteStyle),r(ce,V,a+1,l)}return r(ce,c,a+1,l)}if(typeof o=="function"&&!isRegExp$3(o)){var w=nameOf(o),T=arrObjKeys(o,E);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(T.length>0?" { "+$join.call(T,", ")+" }":"")}if(isSymbol(o)){var k=hasShammedSymbols?$replace.call(String(o),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(o);return typeof o=="object"&&!hasShammedSymbols?markBoxed(k):k}if(isElement$3(o)){for(var O="<"+$toLowerCase.call(String(o.nodeName)),R=o.attributes||[],M=0;M",O}if(isArray$6(o)){if(o.length===0)return"[]";var N=arrObjKeys(o,E);return _&&!singleLineValues(N)?"["+indentedJoin(N,_)+"]":"[ "+$join.call(N,", ")+" ]"}if(isError$1(o)){var D=arrObjKeys(o,E);return!("cause"in Error.prototype)&&"cause"in o&&!isEnumerable.call(o,"cause")?"{ ["+String(o)+"] "+$join.call($concat.call("[cause]: "+E(o.cause),D),", ")+" }":D.length===0?"["+String(o)+"]":"{ ["+String(o)+"] "+$join.call(D,", ")+" }"}if(typeof o=="object"&&u){if(inspectSymbol&&typeof o[inspectSymbol]=="function"&&utilInspect)return utilInspect(o,{depth:y-a});if(u!=="symbol"&&typeof o.inspect=="function")return o.inspect()}if(isMap(o)){var P=[];return mapForEach&&mapForEach.call(o,function(ce,Y){P.push(E(Y,o,!0)+" => "+E(ce,o))}),collectionOf("Map",mapSize.call(o),P,_)}if(isSet(o)){var I=[];return setForEach&&setForEach.call(o,function(ce){I.push(E(ce,o))}),collectionOf("Set",setSize.call(o),I,_)}if(isWeakMap(o))return weakCollectionOf("WeakMap");if(isWeakSet(o))return weakCollectionOf("WeakSet");if(isWeakRef(o))return weakCollectionOf("WeakRef");if(isNumber$1(o))return markBoxed(E(Number(o)));if(isBigInt(o))return markBoxed(E(bigIntValueOf.call(o)));if(isBoolean$1(o))return markBoxed(booleanValueOf.call(o));if(isString$3(o))return markBoxed(E(String(o)));if(typeof window<"u"&&o===window)return"{ [object Window] }";if(typeof globalThis<"u"&&o===globalThis||typeof commonjsGlobal$1<"u"&&o===commonjsGlobal$1)return"{ [object globalThis] }";if(!isDate$2(o)&&!isRegExp$3(o)){var L=arrObjKeys(o,E),F=gPO?gPO(o)===Object.prototype:o instanceof Object||o.constructor===Object,U=o instanceof Object?"":"null prototype",J=!F&&toStringTag&&Object(o)===o&&toStringTag in o?$slice.call(toStr(o),8,-1):U?"Object":"",z=F||typeof o.constructor!="function"?"":o.constructor.name?o.constructor.name+" ":"",ie=z+(J||U?"["+$join.call($concat.call([],J||[],U||[]),": ")+"] ":"");return L.length===0?ie+"{}":_?ie+"{"+indentedJoin(L,_)+"}":ie+"{ "+$join.call(L,", ")+" }"}return String(o)};function wrapQuotes(r,o,s){var a=(s.quoteStyle||o)==="double"?'"':"'";return a+r+a}function quote(r){return $replace.call(String(r),/"/g,""")}function isArray$6(r){return toStr(r)==="[object Array]"&&(!toStringTag||!(typeof r=="object"&&toStringTag in r))}function isDate$2(r){return toStr(r)==="[object Date]"&&(!toStringTag||!(typeof r=="object"&&toStringTag in r))}function isRegExp$3(r){return toStr(r)==="[object RegExp]"&&(!toStringTag||!(typeof r=="object"&&toStringTag in r))}function isError$1(r){return toStr(r)==="[object Error]"&&(!toStringTag||!(typeof r=="object"&&toStringTag in r))}function isString$3(r){return toStr(r)==="[object String]"&&(!toStringTag||!(typeof r=="object"&&toStringTag in r))}function isNumber$1(r){return toStr(r)==="[object Number]"&&(!toStringTag||!(typeof r=="object"&&toStringTag in r))}function isBoolean$1(r){return toStr(r)==="[object Boolean]"&&(!toStringTag||!(typeof r=="object"&&toStringTag in r))}function isSymbol(r){if(hasShammedSymbols)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!symToString)return!1;try{return symToString.call(r),!0}catch{}return!1}function isBigInt(r){if(!r||typeof r!="object"||!bigIntValueOf)return!1;try{return bigIntValueOf.call(r),!0}catch{}return!1}var hasOwn$1=Object.prototype.hasOwnProperty||function(r){return r in this};function has$4(r,o){return hasOwn$1.call(r,o)}function toStr(r){return objectToString$1.call(r)}function nameOf(r){if(r.name)return r.name;var o=$match.call(functionToString.call(r),/^function\s*([\w$]+)/);return o?o[1]:null}function indexOf(r,o){if(r.indexOf)return r.indexOf(o);for(var s=0,a=r.length;so.maxStringLength){var s=r.length-o.maxStringLength,a="... "+s+" more character"+(s>1?"s":"");return inspectString($slice.call(r,0,o.maxStringLength),o)+a}var l=$replace.call($replace.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(l,"single",o)}function lowbyte(r){var o=r.charCodeAt(0),s={8:"b",9:"t",10:"n",12:"f",13:"r"}[o];return s?"\\"+s:"\\x"+(o<16?"0":"")+$toUpperCase.call(o.toString(16))}function markBoxed(r){return"Object("+r+")"}function weakCollectionOf(r){return r+" { ? }"}function collectionOf(r,o,s,a){var l=a?indentedJoin(s,a):$join.call(s,", ");return r+" ("+o+") {"+l+"}"}function singleLineValues(r){for(var o=0;o=0)return!1;return!0}function getIndent(r,o){var s;if(r.indent===" ")s=" ";else if(typeof r.indent=="number"&&r.indent>0)s=$join.call(Array(r.indent+1)," ");else return null;return{base:s,prev:$join.call(Array(o+1),s)}}function indentedJoin(r,o){if(r.length===0)return"";var s=` -`+o.prev+o.base;return s+$join.call(r,","+s)+` -`+o.prev}function arrObjKeys(r,o){var s=isArray$6(r),a=[];if(s){a.length=r.length;for(var l=0;l1;){var s=o.pop(),a=s.obj[s.prop];if(isArray$5(a)){for(var l=[],c=0;c=limit?u.slice(m,m+limit):u,y=[],_=0;_=48&&E<=57||E>=65&&E<=90||E>=97&&E<=122||c===formats$2.RFC1738&&(E===40||E===41)){y[y.length]=g.charAt(_);continue}if(E<128){y[y.length]=hexTable[E];continue}if(E<2048){y[y.length]=hexTable[192|E>>6]+hexTable[128|E&63];continue}if(E<55296||E>=57344){y[y.length]=hexTable[224|E>>12]+hexTable[128|E>>6&63]+hexTable[128|E&63];continue}_+=1,E=65536+((E&1023)<<10|g.charCodeAt(_)&1023),y[y.length]=hexTable[240|E>>18]+hexTable[128|E>>12&63]+hexTable[128|E>>6&63]+hexTable[128|E&63]}d+=y.join("")}return d},compact=function r(o){for(var s=[{obj:{o},prop:"o"}],a=[],l=0;l"u"&&(P=0)}if(typeof y=="function"?N=y(s,N):N instanceof Date?N=w(N):a==="comma"&&isArray$4(N)&&(N=utils$3.maybeMap(N,function(pee){return pee instanceof Date?w(pee):pee})),N===null){if(u)return g&&!O?g(s,defaults$3.encoder,R,"key",T):s;N=""}if(isNonNullishPrimitive(N)||utils$3.isBuffer(N)){if(g){var F=O?s:g(s,defaults$3.encoder,R,"key",T);return[k(F)+"="+k(g(N,defaults$3.encoder,R,"value",T))]}return[k(s)+"="+k(String(N))]}var U=[];if(typeof N>"u")return U;var J;if(a==="comma"&&isArray$4(N))O&&g&&(N=utils$3.maybeMap(N,g)),J=[{value:N.length>0?N.join(",")||null:void 0}];else if(isArray$4(y))J=y;else{var z=Object.keys(N);J=_?z.sort(_):z}var ie=m?s.replace(/\./g,"%2E"):s,ce=l&&isArray$4(N)&&N.length===1?ie+"[]":ie;if(c&&isArray$4(N)&&N.length===0)return ce+"[]";for(var Y=0;Y"u"?o.encodeDotInKeys===!0?!0:defaults$3.allowDots:!!o.allowDots;return{addQueryPrefix:typeof o.addQueryPrefix=="boolean"?o.addQueryPrefix:defaults$3.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof o.allowEmptyArrays=="boolean"?!!o.allowEmptyArrays:defaults$3.allowEmptyArrays,arrayFormat:u,charset:s,charsetSentinel:typeof o.charsetSentinel=="boolean"?o.charsetSentinel:defaults$3.charsetSentinel,commaRoundTrip:o.commaRoundTrip,delimiter:typeof o.delimiter>"u"?defaults$3.delimiter:o.delimiter,encode:typeof o.encode=="boolean"?o.encode:defaults$3.encode,encodeDotInKeys:typeof o.encodeDotInKeys=="boolean"?o.encodeDotInKeys:defaults$3.encodeDotInKeys,encoder:typeof o.encoder=="function"?o.encoder:defaults$3.encoder,encodeValuesOnly:typeof o.encodeValuesOnly=="boolean"?o.encodeValuesOnly:defaults$3.encodeValuesOnly,filter:c,format:a,formatter:l,serializeDate:typeof o.serializeDate=="function"?o.serializeDate:defaults$3.serializeDate,skipNulls:typeof o.skipNulls=="boolean"?o.skipNulls:defaults$3.skipNulls,sort:typeof o.sort=="function"?o.sort:null,strictNullHandling:typeof o.strictNullHandling=="boolean"?o.strictNullHandling:defaults$3.strictNullHandling}},stringify_1=function(r,o){var s=r,a=normalizeStringifyOptions(o),l,c;typeof a.filter=="function"?(c=a.filter,s=c("",s)):isArray$4(a.filter)&&(c=a.filter,l=c);var u=[];if(typeof s!="object"||s===null)return"";var d=arrayPrefixGenerators[a.arrayFormat],m=d==="comma"&&a.commaRoundTrip;l||(l=Object.keys(s)),a.sort&&l.sort(a.sort);for(var g=getSideChannel(),y=0;y0?w+E:""},utils$2=utils$4,has$1=Object.prototype.hasOwnProperty,isArray$3=Array.isArray,defaults$2={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:utils$2.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},interpretNumericEntities=function(r){return r.replace(/&#(\d+);/g,function(o,s){return String.fromCharCode(parseInt(s,10))})},parseArrayValue=function(r,o){return r&&typeof r=="string"&&o.comma&&r.indexOf(",")>-1?r.split(","):r},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function r(o,s){var a={__proto__:null},l=s.ignoreQueryPrefix?o.replace(/^\?/,""):o;l=l.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=s.parameterLimit===1/0?void 0:s.parameterLimit,u=l.split(s.delimiter,c),d=-1,m,g=s.charset;if(s.charsetSentinel)for(m=0;m-1&&(T=isArray$3(T)?[T]:T);var k=has$1.call(a,w);k&&s.duplicates==="combine"?a[w]=utils$2.combine(a[w],T):(!k||s.duplicates==="last")&&(a[w]=T)}return a},parseObject=function(r,o,s,a){for(var l=a?o:parseArrayValue(o,s),c=r.length-1;c>=0;--c){var u,d=r[c];if(d==="[]"&&s.parseArrays)u=s.allowEmptyArrays&&(l===""||s.strictNullHandling&&l===null)?[]:[].concat(l);else{u=s.plainObjects?Object.create(null):{};var m=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,g=s.decodeDotInKeys?m.replace(/%2E/g,"."):m,y=parseInt(g,10);!s.parseArrays&&g===""?u={0:l}:!isNaN(y)&&d!==g&&String(y)===g&&y>=0&&s.parseArrays&&y<=s.arrayLimit?(u=[],u[y]=l):g!=="__proto__"&&(u[g]=l)}l=u}return l},parseKeys=function r(o,s,a,l){if(o){var c=a.allowDots?o.replace(/\.([^.[]+)/g,"[$1]"):o,u=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,m=a.depth>0&&u.exec(c),g=m?c.slice(0,m.index):c,y=[];if(g){if(!a.plainObjects&&has$1.call(Object.prototype,g)&&!a.allowPrototypes)return;y.push(g)}for(var _=0;a.depth>0&&(m=d.exec(c))!==null&&_"u"?defaults$2.charset:o.charset,a=typeof o.duplicates>"u"?defaults$2.duplicates:o.duplicates;if(a!=="combine"&&a!=="first"&&a!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var l=typeof o.allowDots>"u"?o.decodeDotInKeys===!0?!0:defaults$2.allowDots:!!o.allowDots;return{allowDots:l,allowEmptyArrays:typeof o.allowEmptyArrays=="boolean"?!!o.allowEmptyArrays:defaults$2.allowEmptyArrays,allowPrototypes:typeof o.allowPrototypes=="boolean"?o.allowPrototypes:defaults$2.allowPrototypes,allowSparse:typeof o.allowSparse=="boolean"?o.allowSparse:defaults$2.allowSparse,arrayLimit:typeof o.arrayLimit=="number"?o.arrayLimit:defaults$2.arrayLimit,charset:s,charsetSentinel:typeof o.charsetSentinel=="boolean"?o.charsetSentinel:defaults$2.charsetSentinel,comma:typeof o.comma=="boolean"?o.comma:defaults$2.comma,decodeDotInKeys:typeof o.decodeDotInKeys=="boolean"?o.decodeDotInKeys:defaults$2.decodeDotInKeys,decoder:typeof o.decoder=="function"?o.decoder:defaults$2.decoder,delimiter:typeof o.delimiter=="string"||utils$2.isRegExp(o.delimiter)?o.delimiter:defaults$2.delimiter,depth:typeof o.depth=="number"||o.depth===!1?+o.depth:defaults$2.depth,duplicates:a,ignoreQueryPrefix:o.ignoreQueryPrefix===!0,interpretNumericEntities:typeof o.interpretNumericEntities=="boolean"?o.interpretNumericEntities:defaults$2.interpretNumericEntities,parameterLimit:typeof o.parameterLimit=="number"?o.parameterLimit:defaults$2.parameterLimit,parseArrays:o.parseArrays!==!1,plainObjects:typeof o.plainObjects=="boolean"?o.plainObjects:defaults$2.plainObjects,strictDepth:typeof o.strictDepth=="boolean"?!!o.strictDepth:defaults$2.strictDepth,strictNullHandling:typeof o.strictNullHandling=="boolean"?o.strictNullHandling:defaults$2.strictNullHandling}},parse$3=function(r,o){var s=normalizeParseOptions(o);if(r===""||r===null||typeof r>"u")return s.plainObjects?Object.create(null):{};for(var a=typeof r=="string"?parseValues(r,s):r,l=s.plainObjects?Object.create(null):{},c=Object.keys(a),u=0;u",'"',"`"," ","\r",` -`," "],unwise$1=["{","}","|","\\","^","`"].concat(delims$1),autoEscape$1=["'"].concat(unwise$1),nonHostChars$1=["%","/","?",";","#"].concat(autoEscape$1),hostEndingChars$1=["/","?","#"],hostnameMaxLen$1=255,hostnamePartPattern$1=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart$1=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol$1={javascript:!0,"javascript:":!0},slashedProtocol$1={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=lib$2;function urlParse$1(r,o,s){if(r&&typeof r=="object"&&r instanceof Url$2)return r;var a=new Url$2;return a.parse(r,o,s),a}Url$2.prototype.parse=function(r,o,s){if(typeof r!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var a=r.indexOf("?"),l=a!==-1&&a127?P+="x":P+=D[I];if(!P.match(hostnamePartPattern$1)){var F=M.slice(0,w),U=M.slice(w+1),J=D.match(hostnamePartStart$1);J&&(F.push(J[1]),U.unshift(J[2])),U.length&&(d="/"+U.join(".")+d),this.hostname=F.join(".");break}}}this.hostname.length>hostnameMaxLen$1?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=punycode$2.toASCII(this.hostname));var z=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+z,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),d[0]!=="/"&&(d="/"+d))}if(!unsafeProtocol[y])for(var w=0,N=autoEscape$1.length;w0?s.host.split("@"):!1;P&&(s.auth=P.shift(),s.hostname=P.shift(),s.host=s.hostname)}return s.search=r.search,s.query=r.query,(s.pathname!==null||s.search!==null)&&(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.href=s.format(),s}if(!M.length)return s.pathname=null,s.search?s.path="/"+s.search:s.path=null,s.href=s.format(),s;for(var I=M.slice(-1)[0],L=(s.host||r.host||M.length>1)&&(I==="."||I==="..")||I==="",F=0,U=M.length;U>=0;U--)I=M[U],I==="."?M.splice(U,1):I===".."?(M.splice(U,1),F++):F&&(M.splice(U,1),F--);if(!O&&!R)for(;F--;F)M.unshift("..");O&&M[0]!==""&&(!M[0]||M[0].charAt(0)!=="/")&&M.unshift(""),L&&M.join("/").substr(-1)!=="/"&&M.push("");var J=M[0]===""||M[0]&&M[0].charAt(0)==="/";if(D){s.hostname=J?"":M.length?M.shift():"",s.host=s.hostname;var P=s.host&&s.host.indexOf("@")>0?s.host.split("@"):!1;P&&(s.auth=P.shift(),s.hostname=P.shift(),s.host=s.hostname)}return O=O||s.host&&M.length,O&&!J&&M.unshift(""),M.length>0?s.pathname=M.join("/"):(s.pathname=null,s.path=null),(s.pathname!==null||s.search!==null)&&(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.auth=r.auth||s.auth,s.slashes=s.slashes||r.slashes,s.href=s.format(),s};Url$2.prototype.parseHost=function(){var r=this.host,o=portPattern$1.exec(r);o&&(o=o[0],o!==":"&&(this.port=o.substr(1)),r=r.substr(0,r.length-o.length)),r&&(this.hostname=r)};url.parse=urlParse$1;url.resolve=urlResolve;url.resolveObject=urlResolveObject;url.format=urlFormat;url.Url=Url$2;var helpers$5={},uri=url,ValidationError=helpers$5.ValidationError=function r(o,s,a,l,c,u){if(Array.isArray(l)?(this.path=l,this.property=l.reduce(function(m,g){return m+makeSuffix(g)},"instance")):l!==void 0&&(this.property=l),o&&(this.message=o),a){var d=a.$id||a.id;this.schema=d||a}s!==void 0&&(this.instance=s),this.name=c,this.argument=u,this.stack=this.toString()};ValidationError.prototype.toString=function r(){return this.property+" "+this.message};var ValidatorResult$2=helpers$5.ValidatorResult=function r(o,s,a,l){this.instance=o,this.schema=s,this.options=a,this.path=l.path,this.propertyPath=l.propertyPath,this.errors=[],this.throwError=a&&a.throwError,this.throwFirst=a&&a.throwFirst,this.throwAll=a&&a.throwAll,this.disableFormat=a&&a.disableFormat===!0};ValidatorResult$2.prototype.addError=function r(o){var s;if(typeof o=="string")s=new ValidationError(o,this.instance,this.schema,this.path);else{if(!o)throw new Error("Missing error detail");if(!o.message)throw new Error("Missing error message");if(!o.name)throw new Error("Missing validator type");s=new ValidationError(o.message,this.instance,this.schema,this.path,o.name,o.argument)}if(this.errors.push(s),this.throwFirst)throw new ValidatorResultError$1(this);if(this.throwError)throw s;return s};ValidatorResult$2.prototype.importErrors=function r(o){typeof o=="string"||o&&o.validatorType?this.addError(o):o&&o.errors&&(this.errors=this.errors.concat(o.errors))};function stringizer(r,o){return o+": "+r.toString()+` -`}ValidatorResult$2.prototype.toString=function r(o){return this.errors.map(stringizer).join("")};Object.defineProperty(ValidatorResult$2.prototype,"valid",{get:function(){return!this.errors.length}});helpers$5.ValidatorResultError=ValidatorResultError$1;function ValidatorResultError$1(r){Error.captureStackTrace&&Error.captureStackTrace(this,ValidatorResultError$1),this.instance=r.instance,this.schema=r.schema,this.options=r.options,this.errors=r.errors}ValidatorResultError$1.prototype=new Error;ValidatorResultError$1.prototype.constructor=ValidatorResultError$1;ValidatorResultError$1.prototype.name="Validation Error";var SchemaError$2=helpers$5.SchemaError=function r(o,s){this.message=o,this.schema=s,Error.call(this,o),Error.captureStackTrace(this,r)};SchemaError$2.prototype=Object.create(Error.prototype,{constructor:{value:SchemaError$2,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var SchemaContext$1=helpers$5.SchemaContext=function r(o,s,a,l,c){this.schema=o,this.options=s,Array.isArray(a)?(this.path=a,this.propertyPath=a.reduce(function(u,d){return u+makeSuffix(d)},"instance")):this.propertyPath=a,this.base=l,this.schemas=c};SchemaContext$1.prototype.resolve=function r(o){return uri.resolve(this.base,o)};SchemaContext$1.prototype.makeChild=function r(o,s){var a=s===void 0?this.path:this.path.concat([s]),l=o.$id||o.id,c=uri.resolve(this.base,l||""),u=new SchemaContext$1(o,this.options,a,c,Object.create(this.schemas));return l&&!u.schemas[c]&&(u.schemas[c]=o),u};var FORMAT_REGEXPS=helpers$5.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(r){return typeof r=="string"&&parseFloat(r)===parseInt(r,10)&&!isNaN(r)},regex:function(r){var o=!0;try{new RegExp(r)}catch{o=!1}return o},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};FORMAT_REGEXPS.regexp=FORMAT_REGEXPS.regex;FORMAT_REGEXPS.pattern=FORMAT_REGEXPS.regex;FORMAT_REGEXPS.ipv4=FORMAT_REGEXPS["ip-address"];helpers$5.isFormat=function r(o,s,a){if(typeof o=="string"&&FORMAT_REGEXPS[s]!==void 0){if(FORMAT_REGEXPS[s]instanceof RegExp)return FORMAT_REGEXPS[s].test(o);if(typeof FORMAT_REGEXPS[s]=="function")return FORMAT_REGEXPS[s](o)}else if(a&&a.customFormats&&typeof a.customFormats[s]=="function")return a.customFormats[s](o);return!0};var makeSuffix=helpers$5.makeSuffix=function r(o){return o=o.toString(),!o.match(/[.\s\[\]]/)&&!o.match(/^[\d]/)?"."+o:o.match(/^\d+$/)?"["+o+"]":"["+JSON.stringify(o)+"]"};helpers$5.deepCompareStrict=function r(o,s){if(typeof o!=typeof s)return!1;if(Array.isArray(o))return!Array.isArray(s)||o.length!==s.length?!1:o.every(function(c,u){return r(o[u],s[u])});if(typeof o=="object"){if(!o||!s)return o===s;var a=Object.keys(o),l=Object.keys(s);return a.length!==l.length?!1:a.every(function(c){return r(o[c],s[c])})}return o===s};function deepMerger(r,o,s,a){typeof s=="object"?o[a]=deepMerge(r[a],s):r.indexOf(s)===-1&&o.push(s)}function copyist(r,o,s){o[s]=r[s]}function copyistWithDeepMerge(r,o,s,a){typeof o[a]!="object"||!o[a]?s[a]=o[a]:r[a]?s[a]=deepMerge(r[a],o[a]):s[a]=o[a]}function deepMerge(r,o){var s=Array.isArray(o),a=s&&[]||{};return s?(r=r||[],a=a.concat(r),o.forEach(deepMerger.bind(null,r,a))):(r&&typeof r=="object"&&Object.keys(r).forEach(copyist.bind(null,r,a)),Object.keys(o).forEach(copyistWithDeepMerge.bind(null,r,o,a))),a}helpers$5.deepMerge=deepMerge;helpers$5.objectGetPath=function r(o,s){for(var a=s.split("/").slice(1),l;typeof(l=a.shift())=="string";){var c=decodeURIComponent(l.replace(/~0/,"~").replace(/~1/g,"/"));if(!(c in o))return;o=o[c]}return o};function pathEncoder(r){return"/"+encodeURIComponent(r).replace(/~/g,"%7E")}helpers$5.encodePath=function r(o){return o.map(pathEncoder).join("")};helpers$5.getDecimalPlaces=function r(o){var s=0;if(isNaN(o))return s;typeof o!="number"&&(o=Number(o));var a=o.toString().split("e");if(a.length===2){if(a[1][0]!=="-")return s;s=Number(a[1].slice(1))}var l=a[0].split(".");return l.length===2&&(s+=l[1].length),s};helpers$5.isSchema=function r(o){return typeof o=="object"&&o||typeof o=="boolean"};var helpers$4=helpers$5,ValidatorResult$1=helpers$4.ValidatorResult,SchemaError$1=helpers$4.SchemaError,attribute$2={};attribute$2.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var validators=attribute$2.validators={};validators.type=function r(o,s,a,l){if(o===void 0)return null;var c=new ValidatorResult$1(o,s,a,l),u=Array.isArray(s.type)?s.type:[s.type];if(!u.some(this.testType.bind(this,o,s,a,l))){var d=u.map(function(m){if(m){var g=m.$id||m.id;return g?"<"+g+">":m+""}});c.addError({name:"type",argument:d,message:"is not of a type(s) "+d})}return c};function testSchemaNoThrow(r,o,s,a,l){var c=o.throwError,u=o.throwAll;o.throwError=!1,o.throwAll=!1;var d=this.validateSchema(r,l,o,s);return o.throwError=c,o.throwAll=u,!d.valid&&a instanceof Function&&a(d),d.valid}validators.anyOf=function r(o,s,a,l){if(o===void 0)return null;var c=new ValidatorResult$1(o,s,a,l),u=new ValidatorResult$1(o,s,a,l);if(!Array.isArray(s.anyOf))throw new SchemaError$1("anyOf must be an array");if(!s.anyOf.some(testSchemaNoThrow.bind(this,o,a,l,function(m){u.importErrors(m)}))){var d=s.anyOf.map(function(m,g){var y=m.$id||m.id;return y?"<"+y+">":m.title&&JSON.stringify(m.title)||m.$ref&&"<"+m.$ref+">"||"[subschema "+g+"]"});a.nestedErrors&&c.importErrors(u),c.addError({name:"anyOf",argument:d,message:"is not any of "+d.join(",")})}return c};validators.allOf=function r(o,s,a,l){if(o===void 0)return null;if(!Array.isArray(s.allOf))throw new SchemaError$1("allOf must be an array");var c=new ValidatorResult$1(o,s,a,l),u=this;return s.allOf.forEach(function(d,m){var g=u.validateSchema(o,d,a,l);if(!g.valid){var y=d.$id||d.id,_=y||d.title&&JSON.stringify(d.title)||d.$ref&&"<"+d.$ref+">"||"[subschema "+m+"]";c.addError({name:"allOf",argument:{id:_,length:g.errors.length,valid:g},message:"does not match allOf schema "+_+" with "+g.errors.length+" error[s]:"}),c.importErrors(g)}}),c};validators.oneOf=function r(o,s,a,l){if(o===void 0)return null;if(!Array.isArray(s.oneOf))throw new SchemaError$1("oneOf must be an array");var c=new ValidatorResult$1(o,s,a,l),u=new ValidatorResult$1(o,s,a,l),d=s.oneOf.filter(testSchemaNoThrow.bind(this,o,a,l,function(g){u.importErrors(g)})).length,m=s.oneOf.map(function(g,y){var _=g.$id||g.id;return _||g.title&&JSON.stringify(g.title)||g.$ref&&"<"+g.$ref+">"||"[subschema "+y+"]"});return d!==1&&(a.nestedErrors&&c.importErrors(u),c.addError({name:"oneOf",argument:m,message:"is not exactly one from "+m.join(",")})),c};validators.if=function r(o,s,a,l){if(o===void 0)return null;if(!helpers$4.isSchema(s.if))throw new Error('Expected "if" keyword to be a schema');var c=testSchemaNoThrow.call(this,o,a,l,null,s.if),u=new ValidatorResult$1(o,s,a,l),d;if(c){if(s.then===void 0)return;if(!helpers$4.isSchema(s.then))throw new Error('Expected "then" keyword to be a schema');d=this.validateSchema(o,s.then,a,l.makeChild(s.then)),u.importErrors(d)}else{if(s.else===void 0)return;if(!helpers$4.isSchema(s.else))throw new Error('Expected "else" keyword to be a schema');d=this.validateSchema(o,s.else,a,l.makeChild(s.else)),u.importErrors(d)}return u};function getEnumerableProperty(r,o){if(Object.hasOwnProperty.call(r,o))return r[o];if(o in r){for(;r=Object.getPrototypeOf(r);)if(Object.propertyIsEnumerable.call(r,o))return r[o]}}validators.propertyNames=function r(o,s,a,l){if(this.types.object(o)){var c=new ValidatorResult$1(o,s,a,l),u=s.propertyNames!==void 0?s.propertyNames:{};if(!helpers$4.isSchema(u))throw new SchemaError$1('Expected "propertyNames" to be a schema (object or boolean)');for(var d in o)if(getEnumerableProperty(o,d)!==void 0){var m=this.validateSchema(d,u,a,l.makeChild(u));c.importErrors(m)}return c}};validators.properties=function r(o,s,a,l){if(this.types.object(o)){var c=new ValidatorResult$1(o,s,a,l),u=s.properties||{};for(var d in u){var m=u[d];if(m!==void 0){if(m===null)throw new SchemaError$1('Unexpected null, expected schema in "properties"');typeof a.preValidateProperty=="function"&&a.preValidateProperty(o,d,m,a,l);var g=getEnumerableProperty(o,d),y=this.validateSchema(g,m,a,l.makeChild(m,d));y.instance!==c.instance[d]&&(c.instance[d]=y.instance),c.importErrors(y)}}return c}};function testAdditionalProperty(r,o,s,a,l,c){if(this.types.object(r)&&!(o.properties&&o.properties[l]!==void 0))if(o.additionalProperties===!1)c.addError({name:"additionalProperties",argument:l,message:"is not allowed to have the additional property "+JSON.stringify(l)});else{var u=o.additionalProperties||{};typeof s.preValidateProperty=="function"&&s.preValidateProperty(r,l,u,s,a);var d=this.validateSchema(r[l],u,s,a.makeChild(u,l));d.instance!==c.instance[l]&&(c.instance[l]=d.instance),c.importErrors(d)}}validators.patternProperties=function r(o,s,a,l){if(this.types.object(o)){var c=new ValidatorResult$1(o,s,a,l),u=s.patternProperties||{};for(var d in o){var m=!0;for(var g in u){var y=u[g];if(y!==void 0){if(y===null)throw new SchemaError$1('Unexpected null, expected schema in "patternProperties"');try{var _=new RegExp(g,"u")}catch{_=new RegExp(g)}if(_.test(d)){m=!1,typeof a.preValidateProperty=="function"&&a.preValidateProperty(o,d,y,a,l);var E=this.validateSchema(o[d],y,a,l.makeChild(y,d));E.instance!==c.instance[d]&&(c.instance[d]=E.instance),c.importErrors(E)}}}m&&testAdditionalProperty.call(this,o,s,a,l,d,c)}return c}};validators.additionalProperties=function r(o,s,a,l){if(this.types.object(o)){if(s.patternProperties)return null;var c=new ValidatorResult$1(o,s,a,l);for(var u in o)testAdditionalProperty.call(this,o,s,a,l,u,c);return c}};validators.minProperties=function r(o,s,a,l){if(this.types.object(o)){var c=new ValidatorResult$1(o,s,a,l),u=Object.keys(o);return u.length>=s.minProperties||c.addError({name:"minProperties",argument:s.minProperties,message:"does not meet minimum property length of "+s.minProperties}),c}};validators.maxProperties=function r(o,s,a,l){if(this.types.object(o)){var c=new ValidatorResult$1(o,s,a,l),u=Object.keys(o);return u.length<=s.maxProperties||c.addError({name:"maxProperties",argument:s.maxProperties,message:"does not meet maximum property length of "+s.maxProperties}),c}};validators.items=function r(o,s,a,l){var c=this;if(this.types.array(o)&&s.items!==void 0){var u=new ValidatorResult$1(o,s,a,l);return o.every(function(d,m){if(Array.isArray(s.items))var g=s.items[m]===void 0?s.additionalItems:s.items[m];else var g=s.items;if(g===void 0)return!0;if(g===!1)return u.addError({name:"items",message:"additionalItems not permitted"}),!1;var y=c.validateSchema(d,g,a,l.makeChild(g,m));return y.instance!==u.instance[m]&&(u.instance[m]=y.instance),u.importErrors(y),!0}),u}};validators.contains=function r(o,s,a,l){var c=this;if(this.types.array(o)&&s.contains!==void 0){if(!helpers$4.isSchema(s.contains))throw new Error('Expected "contains" keyword to be a schema');var u=new ValidatorResult$1(o,s,a,l),d=o.some(function(m,g){var y=c.validateSchema(m,s.contains,a,l.makeChild(s.contains,g));return y.errors.length===0});return d===!1&&u.addError({name:"contains",argument:s.contains,message:"must contain an item matching given schema"}),u}};validators.minimum=function r(o,s,a,l){if(this.types.number(o)){var c=new ValidatorResult$1(o,s,a,l);return s.exclusiveMinimum&&s.exclusiveMinimum===!0?o>s.minimum||c.addError({name:"minimum",argument:s.minimum,message:"must be greater than "+s.minimum}):o>=s.minimum||c.addError({name:"minimum",argument:s.minimum,message:"must be greater than or equal to "+s.minimum}),c}};validators.maximum=function r(o,s,a,l){if(this.types.number(o)){var c=new ValidatorResult$1(o,s,a,l);return s.exclusiveMaximum&&s.exclusiveMaximum===!0?os.exclusiveMinimum;return u||c.addError({name:"exclusiveMinimum",argument:s.exclusiveMinimum,message:"must be strictly greater than "+s.exclusiveMinimum}),c}};validators.exclusiveMaximum=function r(o,s,a,l){if(typeof s.exclusiveMaximum!="boolean"&&this.types.number(o)){var c=new ValidatorResult$1(o,s,a,l),u=o=s.minLength||c.addError({name:"minLength",argument:s.minLength,message:"does not meet minimum length of "+s.minLength}),c}};validators.maxLength=function r(o,s,a,l){if(this.types.string(o)){var c=new ValidatorResult$1(o,s,a,l),u=o.match(/[\uDC00-\uDFFF]/g),d=o.length-(u?u.length:0);return d<=s.maxLength||c.addError({name:"maxLength",argument:s.maxLength,message:"does not meet maximum length of "+s.maxLength}),c}};validators.minItems=function r(o,s,a,l){if(this.types.array(o)){var c=new ValidatorResult$1(o,s,a,l);return o.length>=s.minItems||c.addError({name:"minItems",argument:s.minItems,message:"does not meet minimum length of "+s.minItems}),c}};validators.maxItems=function r(o,s,a,l){if(this.types.array(o)){var c=new ValidatorResult$1(o,s,a,l);return o.length<=s.maxItems||c.addError({name:"maxItems",argument:s.maxItems,message:"does not meet maximum length of "+s.maxItems}),c}};function testArrays(r,o,s){var a,l=s.length;for(a=o+1,l;a already exists with different definition");return u[E]}u[E]=g,E[E.length-1]=="#"&&(u[E.substring(0,E.length-1)]=g)}l(E+"/items",Array.isArray(g.items)?g.items:[g.items]),l(E+"/extends",Array.isArray(g.extends)?g.extends:[g.extends]),a(E+"/additionalItems",g.additionalItems),c(E+"/properties",g.properties),a(E+"/additionalProperties",g.additionalProperties),c(E+"/definitions",g.definitions),c(E+"/patternProperties",g.patternProperties),c(E+"/dependencies",g.dependencies),l(E+"/disallow",g.disallow),l(E+"/allOf",g.allOf),l(E+"/anyOf",g.anyOf),l(E+"/oneOf",g.oneOf),a(E+"/not",g.not)}}function l(m,g){if(Array.isArray(g))for(var y=0;y"u"}),this.schemas[c]};Validator.prototype.addSubSchemaArray=function r(o,s){if(Array.isArray(s))for(var a=0;a",o);var d=helpers$2.objectGetPath(a.schemas[u],c.substr(1));if(d===void 0)throw new SchemaError("no such schema "+c+" located in <"+u+">",o);return{subschema:d,switchSchema:s}};Validator.prototype.testType=function r(o,s,a,l,c){if(c!==void 0){if(c===null)throw new SchemaError('Unexpected null in "type" keyword');if(typeof this.types[c]=="function")return this.types[c].call(this,o);if(c&&typeof c=="object"){var u=this.validateSchema(o,c,a,l);return u===void 0||!(u&&u.errors.length)}return!0}};var types=Validator.prototype.types={};types.string=function r(o){return typeof o=="string"};types.number=function r(o){return typeof o=="number"&&isFinite(o)};types.integer=function r(o){return typeof o=="number"&&o%1===0};types.boolean=function r(o){return typeof o=="boolean"};types.array=function r(o){return Array.isArray(o)};types.null=function r(o){return o===null};types.date=function r(o){return o instanceof Date};types.any=function r(o){return!0};types.object=function r(o){return o&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)};var validator=Validator,Validator_1;Validator_1=validator;helpers$5.ValidatorResult;helpers$5.ValidatorResultError;helpers$5.ValidationError;helpers$5.SchemaError;var __defProp$k=Object.defineProperty,__getOwnPropDesc$e=Object.getOwnPropertyDescriptor,__decorateClass$k=(r,o,s,a)=>{for(var l=a>1?void 0:a?__getOwnPropDesc$e(o,s):o,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=(a?u(o,s,l):u(l))||l);return a&&l&&__defProp$k(o,s,l),l};let CustomEditorV$1=class extends Vue{config;schemaUrl="./StorylinesSlideSchema.json";updatedConfig="";edited=!1;jsonError="";validator=new Validator_1;validatorErrors=[];showErrors=!1;storylinesSchema="";mounted(){fetch(this.schemaUrl).then(o=>{o.json().then(s=>{this.storylinesSchema=s,this.validate()},s=>{console.error(s)})}),this.updatedConfig=this.config}validate(){const o=this.validator.validate(this.updatedConfig,this.storylinesSchema);return this.validatorErrors=o.errors,this.jsonError?(this.validatorErrors.push(this.jsonError),!1):!0}onJsonChange(o){this.updatedConfig=o,this.edited=!0,this.jsonError="",this.$emit("slide-edit"),this.validate()&&this.$emit("config-edited",this.updatedConfig)}saveChanges(){this.$emit("config-edited",this.updatedConfig),this.edited=!1,this.validatorErrors.length!==0&&alert(this.$t("editor.slides.advanced.error"))}};__decorateClass$k([Prop()],CustomEditorV$1.prototype,"config",2);CustomEditorV$1=__decorateClass$k([Options$1({components:{"json-editor":Vue3JsonEditor}})],CustomEditorV$1);const _hoisted_1$l={class:"mt-4"},_hoisted_2$j={key:0,class:"flex flex-row items-center"},_hoisted_3$i={version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",style:{color:"rgb(23, 183, 126)"},class:"w-10 h-10 pr-2"},_hoisted_4$g={key:1,class:"flex flex-row items-center"},_hoisted_5$e={version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",style:{color:"rgb(245, 108, 108)"},class:"w-10 h-10 pr-2"},_hoisted_6$d={key:2},_hoisted_7$d={class:"list-disc ml-8"};function _sfc_render$k(r,o,s,a,l,c){const u=resolveComponent("json-editor");return openBlock(),createElementBlock("div",_hoisted_1$l,[createBaseVNode("div",{class:normalizeClass(["w-full rounded-md bg-red-100 p-2 mb-3",r.validatorErrors.length===0?"bg-green-200":"bg-red-100"])},[r.validatorErrors.length===0?(openBlock(),createElementBlock("span",_hoisted_2$j,[(openBlock(),createElementBlock("svg",_hoisted_3$i,o[4]||(o[4]=[createBaseVNode("path",{fill:"currentColor",d:"M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72L512,72z M758.9,374 c-48.5,48.6-81.2,76.9-172.3,186.8c-52.6,63.4-102.3,131.5-102.7,132L462.1,720c-4.6,6.1-13.5,6.8-19.1,1.6L267.9,558.9 c-17.8-16.5-18.8-44.4-2.3-62.2s44.4-18.8,62.2-2.3l104.9,97.5c5.5,5.1,14.1,4.5,18.9-1.3c16.2-20.1,38.4-44.5,62.4-68.6 c90.2-90.9,145.6-139.7,175.2-161.3c36-26.2,77.3-48.6,87.3-36.2C792,343.9,782.5,350.3,758.9,374L758.9,374z"},null,-1)]))),createTextVNode(" "+toDisplayString$1(r.$t("editor.slides.advanced.good")),1)])):(openBlock(),createElementBlock("span",_hoisted_4$g,[(openBlock(),createElementBlock("svg",_hoisted_5$e,o[5]||(o[5]=[createBaseVNode("path",{fill:"currentColor",d:"M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z"},null,-1)]))),createTextVNode(" "+toDisplayString$1(r.$t("editor.slides.advanced.broken"))+" ",1),createBaseVNode("button",{class:"underline ml-1",onClick:o[0]||(o[0]=()=>r.showErrors=!r.showErrors)},toDisplayString$1(r.$t("editor.slides.advanced.details")),1)])),r.showErrors?(openBlock(),createElementBlock("div",_hoisted_6$d,[createBaseVNode("ul",_hoisted_7$d,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.validatorErrors,(d,m)=>(openBlock(),createElementBlock("li",{key:m},toDisplayString$1(d),1))),128))])])):createCommentVNode("",!0)],2),createVNode(u,{modelValue:r.updatedConfig,"onUpdate:modelValue":o[1]||(o[1]=d=>r.updatedConfig=d),lang:"en",mode:"text","show-btns":!1,expandedOnStart:!0,onHasError:o[2]||(o[2]=d=>{r.jsonError=d,r.validate()}),onJsonChange:o[3]||(o[3]=d=>r.onJsonChange(d))},null,8,["modelValue"])])}const CustomEditorV=_export_sfc$1(CustomEditorV$1,[["render",_sfc_render$k],["__scopeId","data-v-e6e37f4e"]]);var __defProp$j=Object.defineProperty,__decorateClass$j=(r,o,s,a)=>{for(var l=void 0,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=u(o,s,l)||l);return l&&__defProp$j(o,s,l),l};let ImagePreviewV$1=class extends Vue{imageFile};__decorateClass$j([Prop()],ImagePreviewV$1.prototype,"imageFile");const _hoisted_1$k={class:"image-item items-center my-8 mx-4 overflow-hidden"},_hoisted_2$i={class:"relative items-center justify-center text-center w-full grabbable"},_hoisted_3$h=["content","aria-label"],_hoisted_4$f={class:"flex-grow image-container"},_hoisted_5$d=["title","src","alt"];function _sfc_render$j(r,o,s,a,l,c){const u=resolveDirective("tippy");return openBlock(),createElementBlock("li",_hoisted_1$k,[createBaseVNode("div",_hoisted_2$i,[withDirectives((openBlock(),createElementBlock("button",{class:"editor-button bg-white absolute h-6 w-6 leading-5 rounded-full top-0 right-0 p-0 cursor-pointer",onClick:o[0]||(o[0]=()=>r.$emit("delete",r.imageFile)),content:r.$t("editor.image.delete"),"aria-label":r.$t("editor.image.delete")},o[1]||(o[1]=[createBaseVNode("svg",{height:"24px",width:"24px",viewBox:"0 0 352 512",xmlns:"http://www.w3.org/2000/svg"},[createBaseVNode("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]),8,_hoisted_3$h)),[[u,{placement:"top",hideOnClick:!1,animateFill:!0}]]),createBaseVNode("div",_hoisted_4$f,[createBaseVNode("img",{class:"image-file object-cover",title:r.imageFile.id,src:r.imageFile.src,alt:r.imageFile.altText},null,8,_hoisted_5$d)])]),renderSlot(r.$slots,"default",{},void 0,!0)])}const ImagePreviewV=_export_sfc$1(ImagePreviewV$1,[["render",_sfc_render$j],["__scopeId","data-v-943df047"]]);var __defProp$i=Object.defineProperty,__getOwnPropDesc$d=Object.getOwnPropertyDescriptor,__decorateClass$i=(r,o,s,a)=>{for(var l=a>1?void 0:a?__getOwnPropDesc$d(o,s):o,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=(a?u(o,s,l):u(l))||l);return a&&l&&__defProp$i(o,s,l),l};let ImageEditorV$1=class extends Vue{panel;configFileStructure;lang;sourceCounts;allowMany;centerSlide;dynamicSelected;dragging=!1;edited=!1;imagePreviewsLoading=!1;imagePreviewPromises=[];imagePreviews=[];slideshowCaption="";get isDragging(){return this.dragging}mounted(){const o=this.panel.type===PanelType.Slideshow?this.panel.items:this.panel.src?[this.panel]:[];if(this.centerSlide&&this.dynamicSelected)for(const s in o)o[s].customStyles+="text-align: left;";else if(!this.centerSlide&&this.dynamicSelected)for(const s in o)o[s].customStyles=(o[s].customStyles||"").replace("text-align: left;","");o!==void 0&&o.length&&(this.imagePreviewsLoading=!0,o.map(s=>{const a=`${s.src.substring(s.src.indexOf("/")+1)}`,l=s.src.replace(/^.*[\\/]/,""),c=this.configFileStructure.zip.file(a),u=a.split(".").at(-1);c&&(u!="svg"?this.imagePreviewPromises.push(c.async("blob").then(d=>({...s,id:l||s.src,src:URL.createObjectURL(d)}))):this.imagePreviewPromises.push(c.async("text").then(d=>{const m=new File([d],l,{type:"image/svg+xml"});return{...s,id:l||s.src,src:URL.createObjectURL(m)}})))}),Promise.all(this.imagePreviewPromises).then(s=>{this.imagePreviews=s,this.imagePreviewsLoading=!1}),this.slideshowCaption=this.panel.caption)}onFileChange(o){const s=Array.from(o.target.files);this.imagePreviews.push(...s.map(a=>{const l=`${this.configFileStructure.uuid}/assets/${this.lang}/${a.name}`;this.configFileStructure.assets[this.lang].file(a.name,a),this.sourceCounts[l]?this.sourceCounts[l]+=1:this.sourceCounts[l]=1;let c=URL.createObjectURL(a);return{id:a.name,altText:"",caption:"",src:c}})),this.onImagesEdited()}dropImages(o){if(o.dataTransfer!==null){let s=[...o.dataTransfer.files];this.allowMany||(s=[s[0]]),this.imagePreviews.push(...s.map(a=>{const l=`${this.configFileStructure.uuid}/assets/${this.lang}/${a.name}`;this.configFileStructure.assets[this.lang].file(a.name,a),this.sourceCounts[l]?this.sourceCounts[l]+=1:this.sourceCounts[l]=1;let c=URL.createObjectURL(a);return{id:a.name,altText:"",caption:"",src:c}})),this.dragging=!1}this.onImagesEdited()}deleteImage(o){const s=this.imagePreviews.findIndex(a=>a.id===o.id);if(s!==-1){const a=`${this.configFileStructure.uuid}/assets/${this.lang}/${this.imagePreviews[s].id}`;this.sourceCounts[a]-=1,this.sourceCounts[a]===0&&(this.configFileStructure.assets[this.lang].remove(this.imagePreviews[s].id),URL.revokeObjectURL(this.imagePreviews[s].src)),this.imagePreviews.splice(s,1)}this.onImagesEdited()}saveChanges(){if(this.edited)if(Object.keys(this.panel).forEach(o=>{delete this.panel[o]}),this.imagePreviews.length===0)this.panel.type=PanelType.Image,this.panel.src="";else if(this.imagePreviews.length===1){this.panel.type=PanelType.Image;const o=this.imagePreviews[0];Object.keys(o).forEach(s=>{s!=="id"&&(this.panel[s]=o[s])}),this.panel.src=`${this.configFileStructure.uuid}/assets/${this.lang}/${o.id}`}else this.panel.type=PanelType.Slideshow,this.panel.caption=this.slideshowCaption??void 0,this.panel.items=this.imagePreviews.map(o=>({...o,src:`${this.configFileStructure.uuid}/assets/${this.lang}/${o.id}`,type:PanelType.Image}));this.edited=!1}onImagesEdited(){this.edited=!0,this.$emit("slide-edit",this.imagePreviews.length!==0)}};__decorateClass$i([Prop()],ImageEditorV$1.prototype,"panel",2);__decorateClass$i([Prop()],ImageEditorV$1.prototype,"configFileStructure",2);__decorateClass$i([Prop()],ImageEditorV$1.prototype,"lang",2);__decorateClass$i([Prop()],ImageEditorV$1.prototype,"sourceCounts",2);__decorateClass$i([Prop({default:!0})],ImageEditorV$1.prototype,"allowMany",2);__decorateClass$i([Prop({default:!1})],ImageEditorV$1.prototype,"centerSlide",2);__decorateClass$i([Prop({default:!1})],ImageEditorV$1.prototype,"dynamicSelected",2);ImageEditorV$1=__decorateClass$i([Options$1({components:{ImagePreview:ImagePreviewV,draggable}})],ImageEditorV$1);const _hoisted_1$j={class:"block"},_hoisted_2$h={class:"editor-label flex drag-label cursor-pointer"},_hoisted_3$g={class:"align-middle inline-block"},_hoisted_4$e={class:"text-blue-700 font-bold"},_hoisted_5$c=["multiple"],_hoisted_6$c={class:"flex flex-col w-full text-left mb-4"},_hoisted_7$c={class:"editor-label",for:"imageSlideshowCaption"},_hoisted_8$c={key:1,class:"flex justify-center"},_hoisted_9$b={class:"px-2 pb-2"},_hoisted_10$b={class:"flex flex-col mt-4 w-full text-left self-center"},_hoisted_11$b=["for"],_hoisted_12$a=["id","onUpdate:modelValue"],_hoisted_13$a={class:"flex flex-col mt-4 w-full text-left self-center"},_hoisted_14$8=["for"],_hoisted_15$8=["id","onUpdate:modelValue"],_hoisted_16$7={class:"lg:flex gap-2 mt-4"},_hoisted_17$6={class:"flex flex-col text-left self-center"},_hoisted_18$6=["for"],_hoisted_19$6=["id","onUpdate:modelValue"],_hoisted_20$5={class:"flex flex-col mt-4 lg:mt-0 text-left self-center"},_hoisted_21$5={class:"flex flex-row gap-1.5 justify-start items-center"},_hoisted_22$5=["for"],_hoisted_23$5=["content"],_hoisted_24$4=["id","onUpdate:modelValue"];function _sfc_render$i(r,o,s,a,l,c){const u=resolveComponent("ImagePreview"),d=resolveComponent("draggable"),m=resolveDirective("tippy");return openBlock(),createElementBlock("div",_hoisted_1$j,[r.allowMany||!r.allowMany&&r.imagePreviews.length===0?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["upload-image flex items-center justify-center m-5 p-12 bg-blue-100 border-4 border-dashed border-blue-300",{dragging:r.isDragging}]),onDragover:o[1]||(o[1]=withModifiers(()=>r.dragging=!0,["prevent"])),onDragleave:o[2]||(o[2]=withModifiers(()=>r.dragging=!1,["prevent"])),onDrop:o[3]||(o[3]=withModifiers(g=>r.dropImages(g),["prevent"]))},[createBaseVNode("label",_hoisted_2$h,[o[11]||(o[11]=createBaseVNode("span",{class:"align-middle inline-block pr-4"},[createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24"},[createBaseVNode("path",{d:"M14 9l-2.519 4-2.481-1.96-5 6.96h16l-6-9zm8-5v16h-20v-16h20zm2-2h-24v20h24v-20zm-20 6c0-1.104.896-2 2-2s2 .896 2 2c0 1.105-.896 2-2 2s-2-.895-2-2z"})])],-1)),createBaseVNode("span",_hoisted_3$g,[createBaseVNode("span",null,[createBaseVNode("div",null,toDisplayString$1(r.$t("editor.image.label.drag")),1),createBaseVNode("div",null,[createTextVNode(toDisplayString$1(r.$t("editor.label.or"))+" ",1),createBaseVNode("span",_hoisted_4$e,toDisplayString$1(r.$t("editor.label.browse")),1),createTextVNode(" "+toDisplayString$1(r.$t("editor.label.upload")),1)])]),createBaseVNode("input",{type:"file",class:"cursor-pointer",onChange:o[0]||(o[0]=(...g)=>r.onFileChange&&r.onFileChange(...g)),multiple:!!r.allowMany},null,40,_hoisted_5$c)])])],34)):createCommentVNode("",!0),withDirectives(createBaseVNode("div",_hoisted_6$c,[createBaseVNode("label",_hoisted_7$c,toDisplayString$1(r.$t("editor.image.slideshowCaption")),1),withDirectives(createBaseVNode("input",{id:"imageSlideshowCaption",class:"editor-input w-full lg:w-2/3",type:"text","onUpdate:modelValue":o[4]||(o[4]=g=>r.slideshowCaption=g),onChange:o[5]||(o[5]=(...g)=>r.onImagesEdited&&r.onImagesEdited(...g))},null,544),[[vModelText,r.slideshowCaption]])],512),[[vShow,r.imagePreviews.length>1]]),r.allowMany||!r.allowMany&&r.imagePreviews.length===0?withDirectives((openBlock(),createElementBlock("span",_hoisted_8$c,[createBaseVNode("i",null,toDisplayString$1(r.$t("editor.image.reorder")),1)],512)),[[vShow,!r.imagePreviewsLoading&&r.imagePreviews.length]]):createCommentVNode("",!0),withDirectives(createVNode(d,{modelValue:r.imagePreviews,"onUpdate:modelValue":o[10]||(o[10]=g=>r.imagePreviews=g),class:"flex flex-wrap list-none border my-4 rounded-md",onUpdate:r.onImagesEdited,"item-key":"id"},{item:withCtx(({element:g,index:y})=>[(openBlock(),createBlock(u,{key:`${g.id}-${y}`,imageFile:g,onDelete:r.deleteImage,class:"border border-gray-200 rounded-md p-3"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_9$b,[createBaseVNode("div",_hoisted_10$b,[createBaseVNode("label",{class:"editor-label",for:"altTag"+y},toDisplayString$1(r.$t("editor.image.altTag")),9,_hoisted_11$b),withDirectives(createBaseVNode("input",{id:"altTag"+y,class:"editor-input",type:"text","onUpdate:modelValue":_=>g.altText=_,onChange:o[6]||(o[6]=(..._)=>r.onImagesEdited&&r.onImagesEdited(..._))},null,40,_hoisted_12$a),[[vModelText,g.altText]])]),createBaseVNode("div",_hoisted_13$a,[createBaseVNode("label",{class:"editor-label",for:"imgCaption"+y},toDisplayString$1(r.$t("editor.image.label.caption")),9,_hoisted_14$8),withDirectives(createBaseVNode("input",{id:"imgCaption"+y,class:"editor-input",type:"text","onUpdate:modelValue":_=>g.caption=_,onChange:o[7]||(o[7]=(..._)=>r.onImagesEdited&&r.onImagesEdited(..._))},null,40,_hoisted_15$8),[[vModelText,g.caption]])]),createBaseVNode("div",_hoisted_16$7,[createBaseVNode("div",_hoisted_17$6,[createBaseVNode("label",{class:"editor-label",for:"imgHeight"+y},toDisplayString$1(r.$t("editor.image.label.height")),9,_hoisted_18$6),withDirectives(createBaseVNode("input",{id:"imgHeight"+y,class:"editor-input w-full",type:"text","onUpdate:modelValue":_=>g.height=_,onChange:o[8]||(o[8]=(..._)=>r.onImagesEdited&&r.onImagesEdited(..._))},null,40,_hoisted_19$6),[[vModelText,g.height]])]),createBaseVNode("div",_hoisted_20$5,[createBaseVNode("div",_hoisted_21$5,[createBaseVNode("label",{class:"editor-label",for:"imgWidth"+y},toDisplayString$1(r.$t("editor.image.label.width")),9,_hoisted_22$5),withDirectives((openBlock(),createElementBlock("span",{content:r.$t("editor.image.label.widthWarning"),tabindex:"0"},o[12]||(o[12]=[createBaseVNode("svg",{class:"fill-current",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"16",height:"16",viewBox:"0 0 416.979 416.979","xml:space":"preserve"},[createBaseVNode("g",null,[createBaseVNode("path",{d:"M356.004,61.156c-81.37-81.47-213.377-81.551-294.848-0.182c-81.47,81.371-81.552,213.379-0.181,294.85 c81.369,81.47,213.378,81.551,294.849,0.181C437.293,274.636,437.375,142.626,356.004,61.156z M237.6,340.786 c0,3.217-2.607,5.822-5.822,5.822h-46.576c-3.215,0-5.822-2.605-5.822-5.822V167.885c0-3.217,2.607-5.822,5.822-5.822h46.576 c3.215,0,5.822,2.604,5.822,5.822V340.786z M208.49,137.901c-18.618,0-33.766-15.146-33.766-33.765 c0-18.617,15.147-33.766,33.766-33.766c18.619,0,33.766,15.148,33.766,33.766C242.256,122.755,227.107,137.901,208.49,137.901z"})])],-1)]),8,_hoisted_23$5)),[[m,{placement:"top",hideOnClick:!1,animateFill:!0}]])]),withDirectives(createBaseVNode("input",{id:"imgWidth"+y,class:"editor-input w-full",type:"text","onUpdate:modelValue":_=>g.width=_,onChange:o[9]||(o[9]=(..._)=>r.onImagesEdited&&r.onImagesEdited(..._))},null,40,_hoisted_24$4),[[vModelText,g.width]])])])])]),_:2},1032,["imageFile","onDelete"]))]),_:1},8,["modelValue","onUpdate"]),[[vShow,!r.imagePreviewsLoading&&r.imagePreviews.length]])])}const ImageEditorV=_export_sfc$1(ImageEditorV$1,[["render",_sfc_render$i],["__scopeId","data-v-f072e6a7"]]);var __defProp$h=Object.defineProperty,__decorateClass$h=(r,o,s,a)=>{for(var l=void 0,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=u(o,s,l)||l);return l&&__defProp$h(o,s,l),l};let TextEditorV$1=class extends Vue{panel;centerSlide;dynamicSelected;fontSizes=[5,5.5,6.5,7.5,8,9,10,10.5,11,12,14,18,20,22,24,26,28,36,48,72];toolbar={fontSize:{title:"Font Size",text:"Aa",menus:{itemWidth:"42px",rowNum:10,items:this.fontSizes.map(o=>({name:`${o}`,text:`${o}`,action(s){s.insert(a=>{const l=a||"resize";return{text:l.split(` -`).map(u=>u?u.charAt(0)==="|"||u.charAt(0)==="!"||u.charAt(0)==="`"||u==="------------------------------------"?u:`${u}`:"").join(` -`),selected:l}})}}))}},subsuper:{title:"Superscript/Subscript",text:"T",menus:[{name:"Superscript",text:"Superscript",action(o){o.insert(s=>{const a=s||"superscript";return{text:`${a}`,selected:a}})}},{name:"Subscript",text:"Subscript",action(o){o.insert(s=>{const a=s||"subscript";return{text:`${a}`,selected:a}})}}]},addLink:{title:"Insert Link",icon:"v-md-icon-link",menus:[{name:"Add External Link (New Tab)",text:"Add External Link (New Tab)",action(o){o.insert(s=>{const a=s||"link text";return{text:`${a}`,selected:a}})}},{name:"Add External Link (Same Tab)",text:"Add External Link (Same Tab)",action(o){o.insert(s=>{const a=s||"link text";return{text:`${a}`,selected:a}})}},{name:"Add Dynamic Link",text:"Add Dynamic Link",action(o){o.insert(s=>{const a=s||"link text";return{text:`${a}`,selected:a}})}}]}};toolbarTooltipAdjust(o){const s=document.querySelector("#slideEditor"),a=s.scrollHeight>s.clientHeight||document.documentElement.scrollHeight>document.documentElement.clientHeight,l=s.getBoundingClientRect().right-o.getBoundingClientRect().right,c=document.documentElement.clientWidth*1.3*.01;a&&l<=90?o.children[0].style.right=`${Math.max(Math.min(-40,-l+c),-65)}px`:o.children[0].style.right=`${-l}px`}mounted(){this.centerSlide&&this.dynamicSelected?this.panel.customStyles+="text-align: left !important;":!this.centerSlide&&this.dynamicSelected&&(this.panel.customStyles=(this.panel.customStyles||"").replace("text-align: left !important;","")),Array.from(document.querySelectorAll(".v-md-editor__toolbar-right > .v-md-editor__toolbar-item")).forEach(s=>{s.addEventListener("mouseover",()=>{this.toolbarTooltipAdjust(s)})})}unmounted(){Array.from(document.querySelectorAll(".v-md-editor__toolbar-right > .v-md-editor__toolbar-item")).forEach(s=>{s.removeEventListener("mouseover",()=>{this.toolbarTooltipAdjust(s)})})}};__decorateClass$h([Prop()],TextEditorV$1.prototype,"panel");__decorateClass$h([Prop({default:!1})],TextEditorV$1.prototype,"centerSlide");__decorateClass$h([Prop({default:!1})],TextEditorV$1.prototype,"dynamicSelected");const _hoisted_1$i={class:"flex flex-col mt-4"},_hoisted_2$g={class:"editor-label",for:"panelTitle"},_hoisted_3$f={class:"editor-label text-left mt-4 mb-1"};function _sfc_render$h(r,o,s,a,l,c){const u=resolveComponent("v-md-editor");return openBlock(),createElementBlock("div",_hoisted_1$i,[createBaseVNode("label",_hoisted_2$g,toDisplayString$1(r.$t("editor.slides.panel.title")),1),withDirectives(createBaseVNode("input",{class:"editor-input",type:"text",id:"panelTitle","onUpdate:modelValue":o[0]||(o[0]=d=>r.panel.title=d)},null,512),[[vModelText,r.panel.title]]),createBaseVNode("div",_hoisted_3$f,toDisplayString$1(r.$t("editor.slides.panel.body")),1),createVNode(u,{modelValue:r.panel.content,"onUpdate:modelValue":o[1]||(o[1]=d=>r.panel.content=d),height:"400px","left-toolbar":"undo redo clear | h bold italic strikethrough quote subsuper fontSize | ul ol table hr | addLink image code | save",toolbar:r.toolbar},null,8,["modelValue","toolbar"])])}const TextEditorV=_export_sfc$1(TextEditorV$1,[["render",_sfc_render$h],["__scopeId","data-v-8a28f2b6"]]),startingFixtures=["export","geosearch","overviewmap","basemap","legend","mapnav","help","appbar","help","grid","crosshairs","scrollguard","panguard","wizard","layer-reorder","details"],configs={en:{version:"4.0",fixtures:{geosearch:{serviceUrls:{geoNames:"https://geogratis.gc.ca/services/geoname/en/geonames.json",geoLocation:"https://geogratis.gc.ca/services/geolocation/en/locate?q=",geoProvince:"https://geogratis.gc.ca/services/geoname/en/codes/province.json",geoTypes:"https://geogratis.gc.ca/services/geoname/en/codes/concise.json"},settings:{categories:["CITY","HAM","IR","LTM","MUN1","MUN2","PROV","STM","TERR","TOWN","UTM","VILG","UNP"],sortOrder:["CITY","HAM","IR","LTM","MUN1","MUN2","PROV","STM","TERR","TOWN","UTM","VILG","UNP"],maxResults:1e3,officialOnly:!0}},export:{title:{selected:!0,selectable:!0,value:""},map:{selected:!0,selectable:!0},mapElements:{selected:!0,selectable:!0},legend:{selected:!0,selectable:!0},footnote:{selected:!0,selectable:!0,value:""}},overviewmap:{basemaps:{},startMinimized:!0,expandFactor:1.5},legend:{root:{name:"I'm root",children:[]},headerControls:["groupToggle","visibilityToggle"]},mapnav:{zoomOption:"buttons",items:["fullscreen","geolocator","home","help"]},help:{location:"./help",panelWidth:350},appbar:{items:["legend","geosearch","basemap","export","help"]}},layers:[],map:{initialBasemapId:"baseNrCan",caption:{mapCoords:{disabled:!1,formatter:"LAT_LONG_DMS"},scaleBar:{disabled:!1,imperialScale:!1}},extentSets:[{id:"EXT_NRCAN_Lambert_3978",default:{xmin:-5281457,xmax:3049492,ymin:-983440,ymax:4482193,spatialReference:{wkid:3978}}},{id:"EXT_ESRI_World_AuxMerc_3857",default:{xmin:-16632697354854e-6,xmax:-5007771626060756e-9,ymin:5022907964742964e-9,ymax:10015875184845109e-9,spatialReference:{wkid:102100,latestWkid:3857}}}],lodSets:[{id:"LOD_NRCAN_Lambert_3978",lods:[{level:0,resolution:38364.660062653464,scale:145e6},{level:1,resolution:22489.62831258996,scale:85e6},{level:2,resolution:13229.193125052918,scale:5e7},{level:3,resolution:7937.5158750317505,scale:3e7},{level:4,resolution:4630.2175937685215,scale:175e5},{level:5,resolution:2645.8386250105837,scale:1e7},{level:6,resolution:1587.5031750063501,scale:6e6},{level:7,resolution:926.0435187537042,scale:35e5},{level:8,resolution:529.1677250021168,scale:2e6},{level:9,resolution:317.50063500127004,scale:12e5},{level:10,resolution:185.20870375074085,scale:7e5},{level:11,resolution:111.12522225044451,scale:42e4},{level:12,resolution:66.1459656252646,scale:25e4},{level:13,resolution:38.36466006265346,scale:145e3},{level:14,resolution:22.48962831258996,scale:85e3},{level:15,resolution:13.229193125052918,scale:5e4},{level:16,resolution:7.9375158750317505,scale:3e4},{level:17,resolution:4.6302175937685215,scale:17500}]},{id:"LOD_ESRI_World_AuxMerc_3857",lods:[{level:0,resolution:19567.87924099992,scale:73957190948944e-6},{level:1,resolution:9783.93962049996,scale:36978595474472e-6},{level:2,resolution:4891.96981024998,scale:18489297737236e-6},{level:3,resolution:2445.98490512499,scale:9244648868618e-6},{level:4,resolution:1222.992452562495,scale:4622324434309e-6},{level:5,resolution:611.4962262813797,scale:2311162217155e-6},{level:6,resolution:305.74811314055756,scale:1155581108577e-6},{level:7,resolution:152.87405657041106,scale:577790.554289},{level:8,resolution:76.43702828507324,scale:288895.277144},{level:9,resolution:38.21851414253662,scale:144447.638572},{level:10,resolution:19.10925707126831,scale:72223.819286},{level:11,resolution:9.554628535634155,scale:36111.909643},{level:12,resolution:4.77731426794937,scale:18055.954822},{level:13,resolution:2.388657133974685,scale:9027.977411},{level:14,resolution:1.1943285668550503,scale:4513.988705},{level:15,resolution:.5971642835598172,scale:2256.994353},{level:16,resolution:.29858214164761665,scale:1128.497176},{level:17,resolution:.14929107082380833,scale:564.248588},{level:18,resolution:.07464553541190416,scale:282.124294},{level:19,resolution:.03732276770595208,scale:141.062147},{level:20,resolution:.01866138385297604,scale:70.5310735}]}],tileSchemas:[{id:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Lambert Maps",extentSetId:"EXT_NRCAN_Lambert_3978",lodSetId:"LOD_NRCAN_Lambert_3978",thumbnailTileUrls:["/tile/8/285/268","/tile/8/285/269"],hasNorthPole:!0},{id:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"Web Mercator Maps",extentSetId:"EXT_ESRI_World_AuxMerc_3857",lodSetId:"LOD_ESRI_World_AuxMerc_3857",thumbnailTileUrls:["/tile/8/91/74","/tile/8/91/75"],hasNorthPole:!1}],basemaps:[{id:"baseNrCan",tileSchemaId:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Canada Base Map - Transportation (CBMT)",description:"The Canada Base Map - Transportation (CBMT) web mapping services of the Earth Sciences Sector at Natural Resources Canada, are intended primarily for online mapping application users and developers.",altText:"The Canada Base Map - Transportation (CBMT)",layers:[{id:"CBMT",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/CBMT3978/MapServer",opacity:1}]},{id:"baseSimple",tileSchemaId:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Canada Base Map - Simple",description:"Canada Base Map - Simple",altText:"Canada base map - Simple",layers:[{id:"SMR",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/Simple/MapServer",opacity:1}]},{id:"baseCBME_CBCE_HS_RO_3978",tileSchemaId:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Canada Base Map - Elevation (CBME)",description:"The Canada Base Map - Elevation (CBME) web mapping services of the Earth Sciences Sector at Natural Resources Canada, is intended primarily for online mapping application users and developers.",altText:"Canada Base Map - Elevation (CBME)",layers:[{id:"CBME_CBCE_HS_RO_3978",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/CBME_CBCE_HS_RO_3978/MapServer",opacity:1}]},{id:"baseCBMT_CBCT_GEOM_3978",tileSchemaId:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Canada Base Map - Transportation (CBMT)",description:" The Canada Base Map - Transportation (CBMT) web mapping services of the Earth Sciences Sector at Natural Resources Canada, are intended primarily for online mapping application users and developers.",altText:"Canada Base Map - Transportation (CBMT)",layers:[{id:"CBMT_CBCT_GEOM_3978",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/CBMT_CBCT_GEOM_3978/MapServer",opacity:1}]},{id:"baseEsriWorld",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"World Imagery",description:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide.",altText:"World Imagery",layers:[{id:"World_Imagery",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer",opacity:1}]},{id:"baseEsriPhysical",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"World Physical Map",description:"This map presents the Natural Earth physical map at 1.24km per pixel for the world and 500m for the coterminous United States.",altText:"World Physical Map",layers:[{id:"World_Physical_Map",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer",opacity:1}]},{id:"baseEsriRelief",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"World Shaded Relief",description:"This map portrays surface elevation as shaded relief. This map is used as a basemap layer to add shaded relief to other GIS maps, such as the ArcGIS Online World Street Map.",altText:"World Shaded Relief",layers:[{id:"World_Shaded_Relief",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer",opacity:1}]},{id:"baseEsriStreet",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"World Street Map",description:"This worldwide street map presents highway-level data for the world.",altText:"ESWorld Street Map",layers:[{id:"World_Street_Map",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer",opacity:1}]},{id:"baseEsriTerrain",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"World Terrain Base",description:"This map is designed to be used as a base map by GIS professionals to overlay other thematic layers such as demographics or land cover.",altText:"World Terrain Base",layers:[{id:"World_Terrain_Base",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer",opacity:1}]},{id:"baseEsriTopo",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"World Topographic Map",description:"This map is designed to be used as a basemap by GIS professionals and as a reference map by anyone.",altText:"World Topographic Map",layers:[{id:"World_Topo_Map",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer",opacity:1}]}]},panels:{open:[{id:"legend"}]},system:{animate:!0,exposeOid:!1,exposeMeasurements:!0,proxyUrl:"https://maps.canada.ca/wmsproxy/ws/wmsproxy/executeFromProxy"}},fr:{version:"4.0",fixtures:{geosearch:{serviceUrls:{geoNames:"https://geogratis.gc.ca/services/geoname/fr/geonames.json",geoLocation:"https://geogratis.gc.ca/services/geolocation/fr/locate?q=",geoProvince:"https://geogratis.gc.ca/services/geoname/fr/codes/province.json",geoTypes:"https://geogratis.gc.ca/services/geoname/fr/codes/concise.json"},settings:{categories:["CITY","HAM","IR","LTM","MUN1","MUN2","PROV","STM","TERR","TOWN","UTM","VILG","UNP"],sortOrder:["CITY","HAM","IR","LTM","MUN1","MUN2","PROV","STM","TERR","TOWN","UTM","VILG","UNP"],maxResults:1e3,officialOnly:!0}},export:{title:{selected:!0,selectable:!0,value:""},map:{selected:!0,selectable:!0},mapElements:{selected:!0,selectable:!0},legend:{selected:!0,selectable:!0},footnote:{selected:!0,selectable:!0,value:""}},overviewmap:{basemaps:{},startMinimized:!0,expandFactor:1.5},legend:{root:{name:"I'm root",children:[]},headerControls:["groupToggle","visibilityToggle"]},mapnav:{zoomOption:"buttons",items:["fullscreen","geolocator","home","help"]},help:{location:"./help",panelWidth:350},appbar:{items:["legend","geosearch","basemap","export","help"]}},layers:[],map:{initialBasemapId:"baseNrCan",caption:{mapCoords:{disabled:!1,formatter:"LAT_LONG_DMS"},scaleBar:{disabled:!1,imperialScale:!1}},extentSets:[{id:"EXT_NRCAN_Lambert_3978",default:{xmin:-5281457,xmax:3049492,ymin:-983440,ymax:4482193,spatialReference:{wkid:3978}}},{id:"EXT_ESRI_World_AuxMerc_3857",default:{xmin:-16632697354854e-6,xmax:-5007771626060756e-9,ymin:5022907964742964e-9,ymax:10015875184845109e-9,spatialReference:{wkid:102100,latestWkid:3857}}}],lodSets:[{id:"LOD_NRCAN_Lambert_3978",lods:[{level:0,resolution:38364.660062653464,scale:145e6},{level:1,resolution:22489.62831258996,scale:85e6},{level:2,resolution:13229.193125052918,scale:5e7},{level:3,resolution:7937.5158750317505,scale:3e7},{level:4,resolution:4630.2175937685215,scale:175e5},{level:5,resolution:2645.8386250105837,scale:1e7},{level:6,resolution:1587.5031750063501,scale:6e6},{level:7,resolution:926.0435187537042,scale:35e5},{level:8,resolution:529.1677250021168,scale:2e6},{level:9,resolution:317.50063500127004,scale:12e5},{level:10,resolution:185.20870375074085,scale:7e5},{level:11,resolution:111.12522225044451,scale:42e4},{level:12,resolution:66.1459656252646,scale:25e4},{level:13,resolution:38.36466006265346,scale:145e3},{level:14,resolution:22.48962831258996,scale:85e3},{level:15,resolution:13.229193125052918,scale:5e4},{level:16,resolution:7.9375158750317505,scale:3e4},{level:17,resolution:4.6302175937685215,scale:17500}]},{id:"LOD_ESRI_World_AuxMerc_3857",lods:[{level:0,resolution:19567.87924099992,scale:73957190948944e-6},{level:1,resolution:9783.93962049996,scale:36978595474472e-6},{level:2,resolution:4891.96981024998,scale:18489297737236e-6},{level:3,resolution:2445.98490512499,scale:9244648868618e-6},{level:4,resolution:1222.992452562495,scale:4622324434309e-6},{level:5,resolution:611.4962262813797,scale:2311162217155e-6},{level:6,resolution:305.74811314055756,scale:1155581108577e-6},{level:7,resolution:152.87405657041106,scale:577790.554289},{level:8,resolution:76.43702828507324,scale:288895.277144},{level:9,resolution:38.21851414253662,scale:144447.638572},{level:10,resolution:19.10925707126831,scale:72223.819286},{level:11,resolution:9.554628535634155,scale:36111.909643},{level:12,resolution:4.77731426794937,scale:18055.954822},{level:13,resolution:2.388657133974685,scale:9027.977411},{level:14,resolution:1.1943285668550503,scale:4513.988705},{level:15,resolution:.5971642835598172,scale:2256.994353},{level:16,resolution:.29858214164761665,scale:1128.497176},{level:17,resolution:.14929107082380833,scale:564.248588},{level:18,resolution:.07464553541190416,scale:282.124294},{level:19,resolution:.03732276770595208,scale:141.062147},{level:20,resolution:.01866138385297604,scale:70.5310735}]}],tileSchemas:[{id:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Lambert Maps",extentSetId:"EXT_NRCAN_Lambert_3978",lodSetId:"LOD_NRCAN_Lambert_3978",thumbnailTileUrls:[],hasNorthPole:!0},{id:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"Web Mercator Maps",extentSetId:"EXT_ESRI_World_AuxMerc_3857",lodSetId:"LOD_ESRI_World_AuxMerc_3857",thumbnailTileUrls:[],hasNorthPole:!1}],basemaps:[{id:"baseNrCan",tileSchemaId:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Carte de base du Canada – transport (CBCT) avec étiquettes",description:"La carte de base du Canada – transport (CBCT) du Secteur des sciences de la Terre de Ressources naturelles Canada est un service Internet qui s'adresse principalement aux utilisateurs et développeurs d'applications cartographiques en ligne.",altText:"La carte de base du Canada – transport (CBCT)",layers:[{id:"CBCT",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/CBCT3978/MapServer",opacity:1}]},{id:"baseSimple",tileSchemaId:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Carte de base du Canada - simple",description:"La carte de base du Canada - simple",altText:"La carte de base du Canada - simple",layers:[{id:"SMR",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/Simple/MapServer",opacity:1},{id:"SMW",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/CBMT_TXT_3978/MapServer",opacity:1}]},{id:"baseCBME_CBCE_HS_RO_3978",tileSchemaId:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Carte de base du Canada - élevation (CBCE)",description:"La carte de base du Canada - élevation (CBCE) du Secteur des sciences de la Terre de Ressources naturelles Canada est un service Internet qui s'adresse principalement aux utilisateurs et développeurs d'applications cartographiques en ligne.",altText:"La carte de base du Canada - élevation (CBCE)",layers:[{id:"CBME_CBCE_HS_RO_3978",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/CBME_CBCE_HS_RO_3978/MapServer",opacity:1}]},{id:"baseCBMT_CBCT_GEOM_3978",tileSchemaId:"EXT_NRCAN_Lambert_3978#LOD_NRCAN_Lambert_3978",name:"Carte de base du Canada - transport (CBCT)",description:"La carte de base du Canada - transport (CBCT) du Secteur des sciences de la Terre de Ressources naturelles Canada est un service Internet qui s'adresse principalement aux utilisateurs et développeurs d'applications cartographiques en ligne.",altText:"La carte de base du Canada - transport (CBCT)",layers:[{id:"CBMT_CBCT_GEOM_3978",layerType:"esri-tile",url:"https://maps-cartes.services.geo.ca/server2_serveur2/rest/services/BaseMaps/CBMT_CBCT_GEOM_3978/MapServer",opacity:1}]},{id:"baseEsriWorld",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"Imagerie mondiale",description:"L'imagerie mondiale fournit une imagerie satellitaire et aérienne dans de nombreuses régions du monde avec une résolution de 1 mètres et moins et des images satellitaires de résolution inférieure dans le monde entier.",altText:"L'imagerie mondiale",layers:[{id:"World_Imagery",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer",opacity:1}]},{id:"baseEsriPhysical",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"Monde physique",description:"La carte du monde physique représente l'aspect physique naturel de la Terre à 1.24 kilomètres par pixel pour le monde et à 500 mètres pour les États-Unis.",altText:"La carte du monde physique",layers:[{id:"World_Physical_Map",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer",opacity:1}]},{id:"baseEsriRelief",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"Monde en relief ombragé",description:"La carte du monde en relief ombragé représente l'élévation de la surface de la terre comme un relief ombragé. Cette carte est utilisée comme couche de fond afin d'ajouter un relief ombragé à d'autres cartes SIG, comme la carte ArcGIS Online World Street Map.",altText:"La carte du monde en relief ombragé",layers:[{id:"World_Shaded_Relief",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer",opacity:1}]},{id:"baseEsriStreet",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"Monde routier",description:"La carte du monde routier présente des données au niveau des autoroutes pour le monde.",altText:"La carte du monde routier",layers:[{id:"World_Street_Map",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer",opacity:1}]},{id:"baseEsriTerrain",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"Monde terrain",description:"La carte du monde terrain est conçue pour être utilisée comme une carte de base par les professionnels du SIG pour superposer d'autres couches thématiques comme la démographie ou la couverture terrestre.",altText:"La carte du monde terrain",layers:[{id:"World_Terrain_Base",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer",opacity:1}]},{id:"baseEsriTopo",tileSchemaId:"EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",name:"Monde topographique",description:"La carte du monde topographique est conçue pour être utilisé comme une carte de base par les professionnels du SIG et comme une carte de référence par quiconque.",altText:"La carte du monde topographique",layers:[{id:"World_Topo_Map",layerType:"esri-tile",url:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer",opacity:1}]}]},panels:{open:[{id:"legend"}]},system:{animate:!0,exposeOid:!1,exposeMeasurements:!0,proxyUrl:"https://maps.canada.ca/wmsproxy/ws/wmsproxy/executeFromProxy"}}},defaultConfig={startingFixtures,configs};var __defProp$g=Object.defineProperty,__decorateClass$g=(r,o,s,a)=>{for(var l=void 0,c=r.length-1,u;c>=0;c--)(u=r[c])&&(l=u(o,s,l)||l);return l&&__defProp$g(o,s,l),l};let TimeSliderEditorV$1=class extends Vue{config;error};__decorateClass$g([Prop()],TimeSliderEditorV$1.prototype,"config");__decorateClass$g([Prop()],TimeSliderEditorV$1.prototype,"error");const _hoisted_1$h={class:"px-5"},_hoisted_2$f={class:"flex items-center"},_hoisted_3$e={class:"editor-label"},_hoisted_4$d=["value"],_hoisted_5$b={class:"mx-3"},_hoisted_6$b=["value"],_hoisted_7$b={class:"flex items-center"},_hoisted_8$b={class:"editor-label"},_hoisted_9$a=["value"],_hoisted_10$a={class:"mx-3"},_hoisted_11$a=["value"],_hoisted_12$9={key:0,class:"border-black border-2 p-3 w-2/3"},_hoisted_13$9={class:"editor-label w-full"},_hoisted_14$7={class:"list-disc my-2 ml-8"},_hoisted_15$7={key:1},_hoisted_16$6={class:"editor-label"},_hoisted_17$5=["value"],_hoisted_18$5={class:"editor-label"},_hoisted_19$5=["value"];function _sfc_render$g(r,o,s,a,l,c){return openBlock(),createElementBlock("div",_hoisted_1$h,[createBaseVNode("div",_hoisted_2$f,[createBaseVNode("label",_hoisted_3$e,toDisplayString$1(r.$t("editor.map.timeslider.range")),1),createBaseVNode("input",{class:"editor-input",type:"number",value:r.config.range[0],onInput:o[0]||(o[0]=u=>r.$emit("time-slider-changed","range",0,u.target.value))},null,40,_hoisted_4$d),createBaseVNode("span",_hoisted_5$b,toDisplayString$1(r.$t("editor.map.timeslider.to")),1),createBaseVNode("input",{class:"editor-input",type:"number",value:r.config.range[1],onInput:o[1]||(o[1]=u=>r.$emit("time-slider-changed","range",1,u.target.value))},null,40,_hoisted_6$b)]),o[8]||(o[8]=createBaseVNode("br",null,null,-1)),createBaseVNode("div",_hoisted_7$b,[createBaseVNode("label",_hoisted_8$b,toDisplayString$1(r.$t("editor.map.timeslider.start")),1),createBaseVNode("input",{class:"editor-input ml-3",type:"number",value:r.config.start[0],onInput:o[2]||(o[2]=u=>r.$emit("time-slider-changed","start",0,u.target.value))},null,40,_hoisted_9$a),createBaseVNode("span",_hoisted_10$a,toDisplayString$1(r.$t("editor.map.timeslider.to")),1),createBaseVNode("input",{class:"editor-input",type:"number",value:r.config.start[1],onInput:o[3]||(o[3]=u=>r.$emit("time-slider-changed","start",1,u.target.value))},null,40,_hoisted_11$a)]),o[9]||(o[9]=createBaseVNode("br",null,null,-1)),r.error?(openBlock(),createElementBlock("div",_hoisted_12$9,[createBaseVNode("label",_hoisted_13$9,toDisplayString$1(r.$t("editor.map.timeslider.warning")),1),o[6]||(o[6]=createBaseVNode("br",null,null,-1)),createBaseVNode("ul",_hoisted_14$7,[createBaseVNode("li",null,toDisplayString$1(r.$t("editor.map.timeslider.warning.bullet1")),1),createBaseVNode("li",null,toDisplayString$1(r.$t("editor.map.timeslider.warning.bullet2")),1)]),createBaseVNode("span",null,toDisplayString$1(r.$t("editor.map.timeslider.warning.end")),1)])):createCommentVNode("",!0),r.error?(openBlock(),createElementBlock("br",_hoisted_15$7)):createCommentVNode("",!0),createBaseVNode("div",null,[createBaseVNode("label",_hoisted_16$6,toDisplayString$1(r.$t("editor.map.timeslider.attribute")),1),createBaseVNode("input",{class:"editor-input",value:r.config.attribute,onInput:o[4]||(o[4]=u=>r.$emit("time-slider-changed","attribute",void 0,u.target.value))},null,40,_hoisted_17$5)]),o[10]||(o[10]=createBaseVNode("br",null,null,-1)),createBaseVNode("div",null,[createBaseVNode("label",_hoisted_18$5,toDisplayString$1(r.$t("editor.map.timeslider.layers")),1),o[7]||(o[7]=createBaseVNode("br",null,null,-1)),createBaseVNode("input",{class:"editor-input w-full",value:r.config.layers||"",onInput:o[5]||(o[5]=u=>r.$emit("time-slider-changed","layers",void 0,u.target.value))},null,40,_hoisted_19$5)]),o[11]||(o[11]=createBaseVNode("br",null,null,-1)),o[12]||(o[12]=createBaseVNode("br",null,null,-1))])}const TimeSliderEditorV=_export_sfc$1(TimeSliderEditorV$1,[["render",_sfc_render$g],["__scopeId","data-v-c72cbb85"]]),scriptRel="modulepreload",assetsURL=function(r,o){return new URL(r,o).href},seen={},__vitePreload=function r(o,s,a){let l=Promise.resolve();if(s&&s.length>0){const c=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");l=Promise.all(s.map(m=>{if(m=assetsURL(m,a),m in seen)return;seen[m]=!0;const g=m.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(!!a)for(let w=c.length-1;w>=0;w--){const T=c[w];if(T.href===m&&(!g||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${y}`))return;const E=document.createElement("link");if(E.rel=g?"stylesheet":scriptRel,g||(E.as="script",E.crossOrigin=""),E.href=m,d&&E.setAttribute("nonce",d),document.head.appendChild(E),g)return new Promise((w,T)=>{E.addEventListener("load",w),E.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}return l.then(()=>o()).catch(c=>{const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c})};var Gs$2=(r=>(r.BLOB="blob",r.DATE="date",r.DOUBLE="double",r.GEOMETRY="geometry",r.GLOBAL_ID="global-id",r.GUID="guid",r.INTEGER="integer",r.LONG="long",r.OID="oid",r.RASTER="raster",r.SINGLE="single",r.SMALL_INTEGER="small-integer",r.STRING="string",r.XML="xml",r))(Gs$2||{}),Fs$1=(r=>(r.CIRCLE="circle",r.CROSS="cross",r.DIAMOND="diamond",r.ICON="icon",r.PATH="path",r.SQUARE="square",r.TRIANGLE="triangle",r.X="x",r))(Fs$1||{}),Ur$2=(r=>(r.DASH="dash",r.DASHDOT="dash-dot",r.DASHDOTDOT="short-dash-dot-dot",r.DOT="dot",r.LONGDASH="long-dash",r.LONGDASHDOT="long-dash-dot",r.LONGDASHDOTDOT="long-dash-dot-dot",r.NONE="none",r.NULL="none",r.SHORTDASH="short-dash",r.SHORTDASHDOT="short-dash-dot",r.SHORTDASHDOTDOT="short-dash-dot-dot",r.SHORTDOT="short-dot",r.SOLID="solid",r))(Ur$2||{}),H4$1=(r=>(r.BEVEL="bevel",r.MITER="miter",r.ROUND="round",r))(H4$1||{}),W4$1=(r=>(r.ROUND="round",r.BUTT="butt",r.SQUARE="square",r))(W4$1||{}),X4$1=(r=>(r.BDIAG="backward-diagonal",r.CROSS="cross",r.DIAG_CROSS="diagonal-cross",r.FDIAG="forward-diagonal",r.HORIZONTAL="horizontal",r.NONE="none",r.NULL="none",r.SOLID="solid",r.VERTICAL="vertical",r))(X4$1||{}),qt$2=(r=>(r.POINT="Point",r.MULTIPOINT="MultiPoint",r.LINESTRING="LineString",r.MULTILINESTRING="MultiLineString",r.POLYGON="Polygon",r.MULTIPOLYGON="MultiPolygon",r.LINEARRING="LinearRing",r.EXTENT="Extent",r.NONE="None",r.UNKNOWN="Unknown",r))(qt$2||{}),b0$2=(r=>(r.Simple="simple",r.Unique="uniqueValue",r.ClassBreaks="classBreaks",r.Unknown="unknown",r))(b0$2||{}),Ct$1=(r=>(r.FEATURE="esri-feature",r.MAPIMAGE="esri-map-image",r.TILE="esri-tile",r.IMAGERY="esri-imagery",r.GRAPHIC="esri-graphic",r.WMS="ogc-wms",r.WFS="ogc-wfs",r.GEOJSON="file-geojson",r.GEOJSONZIPPED="file-zip-geojson",r.CSV="file-csv",r.SHAPEFILE="file-shape",r.FLATGEOBUF="file-fgb",r.FLATGEOBUFZIPPED="file-zip-fgb",r.OSM="osm-tile",r.DATACSV="data-csv",r.DATAJSON="data-json",r.DATATABLE="data-esri-table",r.UNKNOWN="unknown",r.SUBLAYER="sublayer",r))(Ct$1||{}),ui$1=(r=>(r.FEATURE="feature",r.GRAPHIC="graphic",r.IMAGERY="imagery",r.MAPIMAGE="map-image",r.NOLAYER="no-layer",r.OSM="osm-tile",r.TILE="tile",r.UNKNOWN="unknown",r.WMS="wms",r))(ui$1||{}),nr$2=(r=>(r.ESRI_FEATURE="esriFeature",r.ESRI_RASTER="esriRaster",r.ESRI_TILE="esriTile",r.OSM_TILE="osmTile",r.OGC_RASTER="ogcRaster",r.UNKNOWN="unknown",r))(nr$2||{}),hn$2=(r=>(r.POINT="Point",r.MULTIPOINT="MultiPoint",r.LINESTRING="LineString",r.MULTILINESTRING="MultiLineString",r.POLYGON="Polygon",r.MULTIPOLYGON="MultiPolygon",r))(hn$2||{}),Fn$1=(r=>(r.GEOMETRIC="geometric",r.SYMBOLIC="symbolic",r.HYBRID="hybrid",r.NONE="none",r))(Fn$1||{}),Ye$2=(r=>(r.NEW="new",r.INITIATING="initiating",r.INITIATED="initiated",r.TERMINATING="terminating",r.TERMINATED="terminated",r))(Ye$2||{}),sn$2=(r=>(r.NEW="new",r.LOADING="loading",r.LOADED="loaded",r.ERROR="error",r))(sn$2||{}),$r$2=(r=>(r.NOT_LOADED="not-loaded",r.NOT_VISUAL="not-visual",r.REFRESH="refresh",r.UP_TO_DATE="up-to-date",r))($r$2||{}),Ql$2=(r=>(r.ESRI="esri",r.TEXT="text",r.IMAGE="image",r.HTML="html",r.XML="xml",r.JSON="json",r.UNKNOWN="unknown",r))(Ql$2||{}),dr$2=(r=>(r.SYMBOL="symbol",r.GRID="grid",r.EXTENT="extent",r.INITIAL="initial",r.API="api",r.PERMANENT="permanent",r))(dr$2||{}),pn$2=(r=>(r.BoundaryZoom="boundaryZoom",r.Datatable="datatable",r.Identify="identify",r.Metadata="metadata",r.Opacity="opacity",r.Refresh="refresh",r.Reload="reload",r.Remove="remove",r.Settings="settings",r.Symbology="symbology",r.Visibility="visibility",r))(pn$2||{});let Si$1=class{attributes;geometry;style;id;constructor(o,s,a){this.geometry=o,s?this.id=s:this.id=Ou$2.sharedUtils.generateUUID(),a?this.attributes=a:this.attributes={}}_hover;get hover(){return this._hover}set hover(o){o&&this._hover&&this._hover.id!==o.id&&this.removeHover(),this._hover=o}removeHover(){this._hover&&(this._hover=void 0)}};const _0$1={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function Y4$1(r){return!!_0$1[r]||!!_0$1[r.toLowerCase()]}function Hb$2(r){return _0$1[r]??_0$1[r.toLowerCase()]}function ZF$1(r){return[...Hb$2(r)]}function Wb$2(r,o,s){s<0&&++s,s>1&&--s;const a=6*s;return a<1?r+(o-r)*a:2*s<1?o:3*s<2?r+(o-r)*(2/3-s)*6:r}function J4$1(r,o,s,a=1){const l=(r%360+360)%360/360,c=s<=.5?s*(o+1):s+o-s*o,u=2*s-c;return[Math.round(255*Wb$2(u,c,l+1/3)),Math.round(255*Wb$2(u,c,l)),Math.round(255*Wb$2(u,c,l-1/3)),a]}function QF$1(r){const o=r.length>5,s=o?8:4,a=(1<>=s,d[3]=l*m/255),m=u&a,u>>=s,d[2]=l*m,m=u&a,u>>=s,d[1]=l*m,m=u&a,u>>=s,d[0]=l*m,d}const q4$1=new Float32Array(1);function KF$1(r){--r;for(let o=1;o<32;o<<=1)r|=r>>o;return r+1}function ad$2(r,o,s){return Math.min(Math.max(r,o),s)}function tj$1(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,++r}function Z4$1(r,o,s){return r+(o-r)*s}function ej$1(r,o,s,a,l){return Z4$1(a,l,(r-o)/(s-o))}function nj$1(r){return r*Math.PI/180}function rj$1(r){return 180*r/Math.PI}function ij$1(r){return Math.acos(ad$2(r,-1,1))}function sj$1(r){return Math.asin(ad$2(r,-1,1))}function w0$2(r,o,s=1e-6){return r===o?!0:!Number.isFinite(r)||!Number.isFinite(o)?!1:(r>o?r-o:o-r)<=s}const x0$1=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function Xb$2(r){return x0$1.setFloat64(0,r),x0$1.getBigInt64(0)}function oj$1(r){return x0$1.setBigInt64(0,r),x0$1.getFloat64(0)}const E0$2=BigInt("1000000"),aj$1=Q4$1(1);function Q4$1(r){const o=Xb$2(r=Math.abs(r)),s=oj$1(o<=E0$2?E0$2:o-E0$2);return Math.abs(r-s)}function lj$1(r,o,s=aj$1){if(r===o)return!0;if(!Number.isFinite(r)||!Number.isFinite(o))return!1;if(s!=null&&Q4$1(Math.min(Math.abs(r),Math.abs(o)))E0$2)}function cj$1(r){return K4$1(Math.max(-Yb$2,Math.min(r,Yb$2)))}function K4$1(r){return q4$1[0]=r,q4$1[0]}function uj$1(r){const o=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],s=r[3]*r[3]+r[4]*r[4]+r[5]*r[5],a=r[6]*r[6]+r[7]*r[7]+r[8]*r[8];return!(w0$2(o,1)&&w0$2(s,1)&&w0$2(a,1))}const Yb$2=K4$1(34028234663852886e22);function hj$1(r,o,s){if(s===void 0||+s==0)return Math[r](o);if(o=+o,s=+s,isNaN(o)||typeof s!="number"||s%1!=0)return NaN;let a=o.toString().split("e");return a=(o=Math[r](+(a[0]+"e"+(a[1]?+a[1]-s:-s)))).toString().split("e"),+(a[0]+"e"+(a[1]?+a[1]+s:s))}let ba$2;function ut$1(r){return typeof ba$2[r]=="function"?ba$2[r]=ba$2[r](globalThis):ba$2[r]}ba$2=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},ut$1.add=(r,o,s,a)=>{(a||ba$2[r]===void 0)&&(ba$2[r]=o),s&&ut$1(r)},ut$1.cache=ba$2,ut$1.add("big-integer-warning-enabled",!0),ut$1.add("esri-deprecation-warnings",!0),ut$1.add("esri-tests-disable-screenshots",!1),ut$1.add("esri-tests-use-full-window",!1),ut$1.add("esri-tests-post-to-influx",!0),ut$1.add("esri-cim-animations-enable-status","enabled"),ut$1.add("esri-cim-animations-spotlight",!1),ut$1.add("esri-cim-animations-freeze-time",!1),ut$1.add("enable-feature:multiple-highlights",!1),(()=>{ut$1.add("host-webworker",globalThis.WorkerGlobalScope!==void 0&&self instanceof globalThis.WorkerGlobalScope);const r=typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document;if(ut$1.add("host-browser",r),ut$1.add("host-node",typeof globalThis.process=="object"&&globalThis.process.versions?.node&&globalThis.process.versions.v8),ut$1.add("dom",r),ut$1("host-browser")){const o=navigator,s=o.userAgent,a=o.appVersion,l=parseFloat(a);if(ut$1.add("wp",parseFloat(s.split("Windows Phone")[1])||void 0),ut$1.add("msapp",parseFloat(s.split("MSAppHost/")[1])||void 0),ut$1.add("khtml",a.includes("Konqueror")?l:void 0),ut$1.add("edge",parseFloat(s.split("Edge/")[1])||void 0),ut$1.add("opr",parseFloat(s.split("OPR/")[1])||void 0),ut$1.add("webkit",!ut$1("wp")&&!ut$1("edge")&&parseFloat(s.split("WebKit/")[1])||void 0),ut$1.add("chrome",!ut$1("edge")&&!ut$1("opr")&&parseFloat(s.split("Chrome/")[1])||void 0),ut$1.add("android",!ut$1("wp")&&parseFloat(s.split("Android ")[1])||void 0),ut$1.add("safari",!a.includes("Safari")||ut$1("wp")||ut$1("chrome")||ut$1("android")||ut$1("edge")||ut$1("opr")?void 0:parseFloat(a.split("Version/")[1])),ut$1.add("mac",a.includes("Macintosh")),!ut$1("wp")&&/(iPhone|iPod|iPad)/.test(s)){const c=RegExp.$1.replace(/P/,"p"),u=/OS ([\d_]+)/.test(s)?RegExp.$1:"1",d=parseFloat(u.replace(/_/,".").replaceAll("_",""));ut$1.add(c,d),ut$1.add("ios",d)}ut$1("webkit")||(!s.includes("Gecko")||ut$1("wp")||ut$1("khtml")||ut$1("edge")||ut$1.add("mozilla",l),ut$1("mozilla")&&ut$1.add("ff",parseFloat(s.split("Firefox/")[1]||s.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const r=navigator.userAgent,o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(r),s=/iPhone/i.test(r);o&&ut$1.add("esri-mobile",o),s&&ut$1.add("esri-iPhone",s),ut$1.add("esri-geolocation",!!navigator.geolocation)}ut$1.add("esri-wasm","WebAssembly"in globalThis),ut$1.add("esri-performance-mode-frames-between-render",20),ut$1.add("esri-force-performance-mode",!1),ut$1.add("esri-shared-array-buffer",()=>{const r="SharedArrayBuffer"in globalThis,o=globalThis.crossOriginIsolated===!1;return r&&!o}),ut$1.add("wasm-simd",()=>{const r=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(r))}),ut$1.add("esri-atomics","Atomics"in globalThis),ut$1.add("esri-workers","Worker"in globalThis),ut$1.add("web-feat:cache","caches"in globalThis),ut$1.add("esri-workers-arraybuffer-transfer",!ut$1("safari")||Number(ut$1("safari"))>=12),ut$1.add("workers-pool-size",8),ut$1.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),ut$1.add("featurelayer-simplify-payload-size-factors",[1,1,4]),ut$1.add("featurelayer-fast-triangulation-enabled",!0),ut$1.add("featurelayer-animation-enabled",!0),ut$1.add("featurelayer-snapshot-enabled",!0),ut$1.add("featurelayer-snapshot-point-min-threshold",8e4),ut$1.add("featurelayer-snapshot-point-max-threshold",4e5),ut$1.add("featurelayer-snapshot-point-coverage",.1),ut$1.add("featurelayer-query-max-depth",4),ut$1.add("featurelayer-query-pausing-enabled",!1),ut$1.add("featurelayer-advanced-symbols",!1),ut$1.add("featurelayer-pbf",!0),ut$1.add("featurelayer-pbf-statistics",!1),ut$1.add("feature-layers-workers",!0),ut$1.add("feature-polyline-generalization-factor",1),ut$1.add("mapview-transitions-duration",200),ut$1.add("mapview-essential-goto-duration",200),ut$1.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),ut$1.add("mapserver-pbf-version-support",10.81),ut$1.add("mapservice-popup-identify-max-tolerance",20),ut$1("host-webworker")||ut$1("host-browser")&&(ut$1.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),ut$1.add("esri-image-decode",()=>{if("decode"in new Image){const r=new Image;return r.src='data:image/svg+xml;charset=UTF-8,',void r.decode().then(()=>{ut$1.add("esri-image-decode",!0,!0,!0)}).catch(()=>{ut$1.add("esri-image-decode",!1,!0,!0)})}return!1}),ut$1.add("esri-url-encodes-apostrophe",()=>{const r=window.document.createElement("a");return r.href="?'",r.href.includes("?%27")}))})();let ld$2=class lre{constructor(o=1){this._seed=o}set seed(o){this._seed=o??Math.random()*lre._m}getInt(){return this._seed=(lre._a*this._seed+lre._c)%lre._m,this._seed}getFloat(){return this.getInt()/(lre._m-1)}getIntRange(o,s){return Math.round(this.getFloatRange(o,s))}getFloatRange(o,s){const a=s-o;return o+this.getInt()/lre._m*a}};ld$2._m=2147483647,ld$2._a=48271,ld$2._c=0;const tA$2=1.5,pj$1=1/tA$2,dj$1=.5;function fj$1(r,o){return o?r.filter((s,a,l)=>l.findIndex(o.bind(null,s))===a):Array.from(new Set(r))}function cd$1(r,o,s){if(r==null&&o==null)return!0;if(r==null||o==null||r.length!==o.length)return!1;if(s){for(let a=0;a!r.some(u=>s(u,c))),l=r.filter(c=>!o.some(u=>s(u,c)))):(a=o.filter(c=>!r.includes(c)),l=r.filter(c=>!o.includes(c))),{added:a,removed:l}}function yj$1(r){return r&&typeof r.length=="number"}let Jb$2=class{constructor(){this.last=0}};const eA$2=new Jb$2;function T0$1(r,o,s,a){a=a||eA$2;const l=Math.max(0,a.last-10);for(let u=l;urA$2.getFloat()):Math.random}function _j$1(r,o){const s=nA$2(o);for(let a=r.length-1;a>0;a--){const l=Math.floor(s()*(a+1)),c=r[a];r[a]=r[l],r[l]=c}return r}const rA$2=new ld$2;function iA$2(r,o){const s=r.indexOf(o);return s!==-1?(r.splice(s,1),o):null}function sA$2(r,o){return r!=null}function oA$2(r){return 32+r.length}function qb$2(){return 16}function wj$1(r){if(!r)return 0;let o=uA$2;for(const s in r)if(r.hasOwnProperty(s)){const a=r[s];switch(typeof a){case"string":o+=oA$2(a);break;case"number":o+=qb$2();break;case"boolean":o+=4}}return o}function aA$2(r){if(!r)return 0;if(Array.isArray(r))return xj$1(r);let o=uA$2;for(const s in r)r.hasOwnProperty(s)&&(o+=lA$2(r[s]));return o}function xj$1(r){const o=r.length;if(o===0||typeof r[0]=="number")return 32+8*o;let s=hA$2;for(let a=0;ao+(s?n2$2(s)?cA$2(s,qb$2()):s.byteLength+pA$2:0),0)}const pA$2=145,r2$2=1024;function Sj$1(r){return M0$2(r)||I0$2(r)||A0$2(r)||S0$1(r)||Zb$2(r)}function Aj$1(r){return M0$2(r)||I0$2(r)}function Ij$1(r){return M0$2(r)?179769e303:I0$2(r)?3402823e32:e2$2(r)?4294967295:t2$2(r)?65535:Qb$1(r)||Kb$2(r)?255:A0$2(r)?2147483647:S0$1(r)?32767:Zb$2(r)?127:256}function Mj$1(r,o){let s;for(s in r)r.hasOwnProperty(s)&&r[s]===void 0&&delete r[s];return r}function gt$3(r){if(!r||typeof r!="object"||typeof r=="function")return r;const o=yA$2(r);if(o!=null)return o;if(s2$2(r))return r.clone();if(dA$2(r))return r.map(gt$3);if(fA$2(r))return r.clone();const s={};for(const a of Object.getOwnPropertyNames(r))s[a]=gt$3(r[a]);return s}function i2$2(r){if(!r||typeof r!="object"||typeof r=="function"||"HTMLElement"in globalThis&&r instanceof HTMLElement)return r;const o=yA$2(r);if(o!=null)return o;if(dA$2(r)){let s=!0;const a=r.map(l=>{const c=i2$2(l);return l!=null&&c==null&&(s=!1),c});return s?a:null}if(s2$2(r))return r.clone();if(r instanceof File||r instanceof Blob)return r;if(!fA$2(r)){const s=new(Object.getPrototypeOf(r)).constructor;for(const a of Object.getOwnPropertyNames(r)){const l=r[a],c=i2$2(l);if(l!=null&&c==null)return null;s[a]=c}return s}return null}function s2$2(r){return typeof r.clone=="function"}function dA$2(r){return typeof r.map=="function"&&typeof r.forEach=="function"}function fA$2(r){return typeof r.notifyChange=="function"&&typeof r.watch=="function"}function mA$2(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;const o=Object.getPrototypeOf(r);return o===null||o===Object.prototype}function yA$2(r){if(Zb$2(r)||Qb$1(r)||Kb$2(r)||S0$1(r)||t2$2(r)||A0$2(r)||e2$2(r)||I0$2(r)||M0$2(r))return r.slice();if(r instanceof Date)return new Date(r.getTime());if(r instanceof ArrayBuffer)return r.slice(0,r.byteLength);if(r instanceof Map){const o=new Map;for(const[s,a]of r)o.set(s,gt$3(a));return o}if(r instanceof Set){const o=new Set;for(const s of r)o.add(gt$3(s));return o}return null}function o2$2(r,o){return r===o||typeof r=="number"&&isNaN(r)&&typeof o=="number"&&isNaN(o)||typeof r?.getTime=="function"&&typeof o?.getTime=="function"&&r.getTime()===o.getTime()||!1}function gA$2(r,o){return r===o||(r==null||typeof r=="string"?r===o:typeof r=="number"?r===o||typeof o=="number"&&isNaN(r)&&isNaN(o):r instanceof Date?o instanceof Date&&r.getTime()===o.getTime():Array.isArray(r)?Array.isArray(o)&&cd$1(r,o):r instanceof Set?o instanceof Set&&Oj$1(r,o):r instanceof Map?o instanceof Map&&Cj$1(r,o):!!mA$2(r)&&mA$2(o)&&Nj$1(r,o))}function Nj$1(r,o){if(r===null||o===null)return!1;const s=Object.keys(r);if(o===null||Object.keys(o).length!==s.length)return!1;for(const a of s)if(r[a]!==o[a]||!Object.prototype.hasOwnProperty.call(o,a))return!1;return!0}function Oj$1(r,o){if(r.size!==o.size)return!1;for(const s of r)if(!o.has(s))return!1;return!0}function Cj$1(r,o){if(r.size!==o.size)return!1;for(const[s,a]of r){const l=o.get(s);if(l!==a||l===void 0&&!o.has(s))return!1}return!0}function vA$2(r,o,s=!1){return _A$2(r,o,s)}function N0$1(r,o){if(o!=null)return o[r]||bA$2(r.split("."),!1,o)}function Kl$2(r,o,s){const a=r.split("."),l=a.pop(),c=bA$2(a,!0,s);c&&l&&(c[l]=o)}function a2$2(r,o){if(r==null&&o==null)return!1;if(r==null||o==null)return!0;if(typeof r=="object"){if(Array.isArray(r)){const s=o;if(r.length!==s.length)return!0;for(let a=0;a{let c=a[l],u=o[l];return c===u?a:c===void 0?(a[l]=gt$3(u),a):(Array.isArray(u)||Array.isArray(a)?(c=c?Array.isArray(c)?a[l]=c.slice():a[l]=[c]:a[l]=[],u&&(Array.isArray(u)||(u=[u]),s?u.forEach(d=>{c.includes(d)||c.push(d)}):a[l]=u.slice())):u&&typeof u=="object"?a[l]=_A$2(c,u,s):a.hasOwnProperty(l)&&!o.hasOwnProperty(l)||(a[l]=u),a)},r||{}):r}const Ce$1={apiKey:void 0,applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(vA$2(Ce$1,globalThis.esriConfig,!0),delete Ce$1.has),!Ce$1.assetsPath){{const r="4.31";Ce$1.assetsPath=`https://js.arcgis.com/${r}/@arcgis/core/assets`}Ce$1.defaultAssetsPath=Ce$1.assetsPath}const Rj$1=/\{([^}]+)\}/g;function wA$2(r){return r??""}function l2$2(r,o){return o?r.replaceAll(Rj$1,typeof o=="object"?(s,a)=>wA$2(N0$1(a,o)):(s,a)=>wA$2(o(a))):r}function kj$1(r,o){return r.replaceAll(/([.$?*|{}()[\]\\/+\-^])/g,s=>o?.includes(s)?s:`\\${s}`)}function c2$2(r){let o=0;for(let s=0;s=Wne._tickCounter)return;this._loggedMessages[o].set(l,Wne._tickCounter),Wne._scheduleTickCounterIncrement()}for(const l of Ce$1.log.interceptors)if(l(o,this.module,...a))return;this._inheritedWriter()(o,this.module,...a)}}_parentWithMember(o,s){let a=this;for(;a!=null;){const l=a[o];if(l!=null)return l;a=a.parent}return s}_inheritedWriter(){return this._parentWithMember("writer",Dj$1)}_matchLevel(o){const s=Ce$1.log.level||"warn";return EA$2[this._parentWithMember("level",s)]<=EA$2[o]}static _scheduleTickCounterIncrement(){Wne._tickCounterScheduled||(Wne._tickCounterScheduled=!0,Promise.resolve().then(()=>{Wne._tickCounter++,Wne._tickCounterScheduled=!1}))}};function Dj$1(r,o,...s){console[r](`[${o}]`,...s)}function Gj$1(...r){return c2$2(JSON.stringify(r,(o,s)=>typeof s!="object"||Array.isArray(s)?s:"[Object]"))}Le$1._loggers=new Map,Le$1._tickCounter=0,Le$1._tickCounterScheduled=!1,Le$1._throttlingDisabled=!1;function Fj$1(r,o){for(const s of r.values())if(o(s))return!0;return!1}function TA$2(r,o,s){const a=r.get(o);if(a!==void 0)return a;const l=s();return r.set(o,l),l}function jj$1(r){const o=new Map;return s=>(o.has(s)||o.set(s,r(s)),o.get(s))}const Fu$2=()=>Le$1.getLogger("esri.core.accessorSupport.ensureTypes");function Uj$1(r){return r==null?r:new Date(r)}function $j$1(r){return r==null?r:!!r}function SA$2(r){return r==null?r:r.toString()}function ud$2(r,o=0){return r==null?r:(r=parseFloat(r),isNaN(r)?o:r)}function O0$1(r){return r==null?r:Math.round(parseFloat(r))}function Bj$1(r){return null}function AA$2(r,o){return s=>{let a=r(s);return o.step!=null&&(a=Math.round(a/o.step)*o.step),o.min!=null&&(a=Math.max(o.min,a)),o.max!=null&&(a=Math.min(o.max,a)),a}}function IA$2(r){return r?.constructor&&r.constructor.__accessorMetadata__!==void 0}function C0$2(r,o){return o!=null&&r&&!(o instanceof r)}function MA$2(r){return r&&"isCollection"in r}function NA$2(r){return r?.Type?typeof r.Type=="function"?r.Type:r.Type.base:null}function Vj$1(r,o){if(!o?.constructor||!MA$2(o.constructor))return u2$2(r,o)?o:new r(o);const s=NA$2(r.prototype.itemType),a=NA$2(o.constructor.prototype.itemType);return s?a?s===a?o:s.prototype.isPrototypeOf(a.prototype)?new r(o):(u2$2(r,o),o):new r(o):o}function u2$2(r,o){return!!IA$2(o)&&(Fu$2().error("Accessor#set","Assigning an instance of '"+(o.declaredClass||"unknown")+"' which is not a subclass of '"+R0$2(r)+"'"),!0)}function OA$2(r,o){return o==null?o:MA$2(r)?Vj$1(r,o):C0$2(r,o)?u2$2(r,o)?o:new r(o):o}function R0$2(r){return r?.prototype?.declaredClass||"unknown"}const zj$1=new WeakMap;function Hj$1(r){switch(r){case Number:return o=>ud$2(o);case On$2:return O0$1;case Boolean:return $j$1;case String:return SA$2;case Date:return Uj$1;case L0$2:return Bj$1;default:return TA$2(zj$1,r,()=>OA$2.bind(null,r))}}function Ai$1(r,o){const s=Hj$1(r);return arguments.length===1?s:s(o)}function hd$1(r,o,s){return arguments.length===1?hd$1.bind(null,r):o&&(Array.isArray(o)?o.map(a=>r(a,s)):[r(o,s)])}function Wj$1(r,o){return arguments.length===1?hd$1(s=>Ai$1(r,s)):hd$1(s=>Ai$1(r,s),o)}function CA$2(r,o,s){return o!==0&&Array.isArray(s)?s.map(a=>CA$2(r,o-1,a)):r(s)}function k0$2(r,o,s){if(arguments.length===2)return c=>k0$2(r,o,c);if(!s)return s;s=CA$2(r,o,s);let a=o,l=s;for(;a>0&&Array.isArray(l);)a--,l=l[0];if(l!==void 0)for(let c=0;cAi$1(r,a),o):k0$2(a=>Ai$1(r,a),o,s)}function RA$2(r){return!!Array.isArray(r)&&!r.some(o=>{const s=typeof o;return!(s==="string"||s==="number"||s==="function"&&r.length>1)})}function h2$2(r,o){if(arguments.length===2)return h2$2(r).call(null,o);const s=new Set,a=r.filter(d=>typeof d!="function"),l=r.filter(d=>typeof d=="function");for(const d of r)typeof d!="string"&&typeof d!="number"||s.add(d);let c=null,u=null;return(d,m)=>{if(d==null)return d;const g=typeof d,y=g==="string"||g==="number";return y&&(s.has(d)||l.some(_=>g==="string"&&_===String||g==="number"&&_===Number))||g==="object"&&l.some(_=>!C0$2(d,_))?d:(y&&a.length?(c||(c=a.map(_=>typeof _=="string"?`'${_}'`:`${_}`).join(", ")),Fu$2().error("Accessor#set",`'${d}' is not a valid value for this property, only the following values are valid: ${c}`)):typeof d=="object"&&l.length?(u||(u=l.map(_=>R0$2(_)).join(", ")),Fu$2().error("Accessor#set",`'${d}' is not a valid value for this property, value must be one of ${u}`)):Fu$2().error("Accessor#set",`'${d}' is not a valid value for this property`),m&&(m.valid=!1),null)}}function _a$2(r,o){if(arguments.length===2)return _a$2(r).call(null,o);const s={},a=[],l=[];for(const m in r.typeMap){const g=r.typeMap[m];s[m]=Ai$1(g),a.push(R0$2(g)),l.push(m)}const c=()=>`'${a.join("', '")}'`,u=()=>`'${l.join("', '")}'`,d=typeof r.key=="string"?m=>m[r.key]:r.key;return m=>{if(r.base&&!C0$2(r.base,m)||m==null)return m;const g=d(m)||r.defaultKeyValue,y=s[g];if(!y)return Fu$2().error("Accessor#set",`Invalid property value, value needs to be one of ${c()}, or a plain object that can autocast (having .type = ${u()})`),null;if(!C0$2(r.typeMap[g],m))return m;if(typeof r.key=="string"&&!IA$2(m)){const _={};for(const E in m)E!==r.key&&(_[E]=m[E]);return y(_)}return y(m)}}let On$2=class{},L0$2=class{};const Yj$1={native:r=>({type:"native",value:r}),array:r=>({type:"array",value:r}),oneOf:r=>({type:"one-of",values:r})};function Jj$1(r){if(!r||!("type"in r))return!1;switch(r.type){case"native":case"array":case"one-of":return!0}return!1}function kA$2(r){switch(r.type){case"native":return Ai$1(r.value);case"array":return hd$1(kA$2(r.value));case"one-of":return qj$1(r);default:return null}}function qj$1(r){let o=null;return(s,a)=>d2$2(s,r)?s:(o==null&&(o=p2$2(r)),Fu$2().error("Accessor#set",`Invalid property value, value needs to be of type ${o}`),a&&(a.valid=!1),null)}function p2$2(r){switch(r.type){case"native":switch(r.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case On$2:return"integer";case Date:return"date";case L0$2:return"null";default:return R0$2(r.value)}case"array":return`array of ${p2$2(r.value)}`;case"one-of":{const o=r.values.map(s=>p2$2(s));return`one of ${o.slice(0,-1)} or ${o[o.length-1]}`}}return"unknown"}function d2$2(r,o){if(r==null)return!0;switch(o.type){case"native":switch(o.value){case Number:case On$2:return typeof r=="number";case Boolean:return typeof r=="boolean";case String:return typeof r=="string";case L0$2:return r===null}return r instanceof o.value;case"array":return!!Array.isArray(r)&&!r.some(s=>!d2$2(s,o.value));case"one-of":return o.values.some(s=>d2$2(r,s))}}function P0$2(r){return ad$2(O0$1(r),0,255)}function D0$2(r,o,s){return r=Number(r),isNaN(r)?s:rs?s:r}function G0$2(r,o){const s=r.toString(16).padStart(2,"0");return o?s.slice(0,1):s}let F0$2=class Lne{static blendColors(o,s,a,l=new Lne){return l.r=Math.round(o.r+(s.r-o.r)*a),l.g=Math.round(o.g+(s.g-o.g)*a),l.b=Math.round(o.b+(s.b-o.b)*a),l.a=o.a+(s.a-o.a)*a,l._sanitize()}static fromRgb(o,s){const a=o.toLowerCase().match(/^(rgba?|hsla?)\(([\s.\-,%0-9]+)\)/);if(a){const l=a[2].split(/\s*,\s*/),c=a[1];if(c==="rgb"&&l.length===3||c==="rgba"&&l.length===4){const u=l[0];if(u.charAt(u.length-1)==="%"){const d=l.map(m=>2.56*parseFloat(m));return l.length===4&&(d[3]=parseFloat(l[3])),Lne.fromArray(d,s)}return Lne.fromArray(l.map(d=>parseFloat(d)),s)}if(c==="hsl"&&l.length===3||c==="hsla"&&l.length===4)return Lne.fromArray(J4$1(parseFloat(l[0]),parseFloat(l[1])/100,parseFloat(l[2])/100,parseFloat(l[3])),s)}return null}static fromHex(o,s=new Lne){if(o[0]!=="#"||isNaN(+`0x${o.slice(1)}`))return null;switch(o.length){case 4:case 5:{const a=parseInt(o.slice(1,2),16),l=parseInt(o.slice(2,3),16),c=parseInt(o.slice(3,4),16),u=o.length===5?15:parseInt(o.slice(4),16);return Lne.fromArray([a+16*a,l+16*l,c+16*c,(u+16*u)/255],s)}case 7:case 9:{const a=parseInt(o.slice(1,3),16),l=parseInt(o.slice(3,5),16),c=parseInt(o.slice(5,7),16),u=o.length===7?255:parseInt(o.slice(7),16);return Lne.fromArray([a,l,c,u/255],s)}default:return null}}static fromArray(o,s=new Lne){return s._set(Number(o[0]),Number(o[1]),Number(o[2]),Number(o[3])),isNaN(s.a)&&(s.a=1),s._sanitize()}static fromString(o,s){const a=Y4$1(o)?Hb$2(o):null;return a&&Lne.fromArray(a,s)||Lne.fromRgb(o,s)||Lne.fromHex(o,s)}static fromJSON(o){return o!=null?new Lne([o[0],o[1],o[2],(o[3]??255)/255]):void 0}static toUnitRGB(o){return o!=null?[o.r/255,o.g/255,o.b/255]:null}static toUnitRGBA(o){return o!=null?[o.r/255,o.g/255,o.b/255,o.a!=null?o.a:1]:null}constructor(o){this.r=255,this.g=255,this.b=255,this.a=1,o&&this.setColor(o)}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(o){return typeof o=="string"?Lne.fromString(o,this):Array.isArray(o)?Lne.fromArray(o,this):(this._set(o.r??0,o.g??0,o.b??0,o.a??1),o instanceof Lne||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(o){const s=o?.capitalize??!1,a=o?.digits??6,l=a===3||a===4,c=a===4||a===8,u=`#${G0$2(this.r,l)}${G0$2(this.g,l)}${G0$2(this.b,l)}${c?G0$2(Math.round(255*this.a),l):""}`;return s?u.toUpperCase():u}toCss(o=!1){const s=this.r+", "+this.g+", "+this.b;return o?`rgba(${s}, ${this.a})`:`rgb(${s})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(o=Lne.AlphaMode.ALWAYS){const s=P0$2(this.r),a=P0$2(this.g),l=P0$2(this.b);return o===Lne.AlphaMode.ALWAYS||this.a!==1?[s,a,l,P0$2(255*this.a)]:[s,a,l]}clone(){return new Lne(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(o){return o!=null&&o.r===this.r&&o.g===this.g&&o.b===this.b&&o.a===this.a}_sanitize(){return this.r=Math.round(D0$2(this.r,0,255)),this.g=Math.round(D0$2(this.g,0,255)),this.b=Math.round(D0$2(this.b,0,255)),this.a=D0$2(this.a,0,1),this}_set(o,s,a,l){this.r=o,this.g=s,this.b=a,this.a=l}};F0$2.prototype.declaredClass="esri.Color",function(r){var o;(o=r.AlphaMode||(r.AlphaMode={}))[o.ALWAYS=0]="ALWAYS",o[o.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(F0$2||(F0$2={}));const me$1=F0$2;function v(r,o,s,a){var l,c=arguments.length,u=c<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,s):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(r,o,s,a);else for(var d=r.length-1;d>=0;d--)(l=r[d])&&(u=(c<3?l(u):c>3?l(o,s,u):l(o,s))||u);return c>3&&u&&Object.defineProperty(o,s,u),u}function Zj$1(r,o){return function(s,a){o(s,a,r)}}function Qj$1(r,o,s,a){function l(c){return c instanceof s?c:new s(function(u){u(c)})}return new(s||(s=Promise))(function(c,u){function d(y){try{g(a.next(y))}catch(_){u(_)}}function m(y){try{g(a.throw(y))}catch(_){u(_)}}function g(y){y.done?c(y.value):l(y.value).then(d,m)}g((a=a.apply(r,[])).next())})}const Kj$1={remove:()=>{}};function dn$1(r){return r?{remove(){r&&(r(),r=void 0)}}:Kj$1}function tU$1(r){r.forEach(o=>o?.remove())}function j0$2(r){return dn$1(()=>tU$1(r))}function eU$1(r){return dn$1(()=>r?.abort())}function nU$1(r){return dn$1(r!=null?()=>r.destroy():void 0)}function No$2(r){return r.__accessor__??null}function rU$1(r,o){return r?.metadata?.[o]!=null}function U0$1(r,o,s){return s?$0$2(r,o,{policy:s,path:""}):$0$2(r,o,null)}function $0$2(r,o,s){return o?Object.keys(o).reduce((a,l)=>{const c=l;let u=null,d="merge";if(s&&(u=s.path?`${s.path}.${l}`:l,d=s.policy(u)),d==="replace"||d==="replace-arrays"&&Array.isArray(a[c]))return a[c]=o[c],a;if(a[c]===void 0)return a[c]=gt$3(o[c]),a;let m=a[c],g=o[c];if(m===g)return a;if(Array.isArray(g)||Array.isArray(a))m=m?Array.isArray(m)?a[c]=m.slice():a[c]=[m]:a[c]=[],g&&(Array.isArray(g)||(g=[g]),g.forEach(y=>{m.includes(y)||m.push(y)}));else if(g&&typeof g=="object")if(s){const y=s.path;s.path=u,a[c]=$0$2(m,g,s),s.path=y}else a[c]=$0$2(m,g,null);else a.hasOwnProperty(l)&&!o.hasOwnProperty(l)||(a[c]=g);return a},r||{}):r}function LA$2(r){return Array.isArray(r)?r:r.split(".")}function PA$2(r){return r.includes(",")?r.split(",").map(o=>o.trim()):[r.trim()]}function iU$1(r){if(Array.isArray(r)){const o=[];for(const s of r)o.push(...PA$2(s));return o}return PA$2(r)}function DA$2(r,o,s,a){const l=iU$1(o);if(l.length!==1){const c=l.map(u=>a(r,u,s));return j0$2(c)}return a(r,l[0],s)}function GA$2(r,o){const s=r[r.length-1]==="?"?r.slice(0,-1):r;if(o.getItemAt!=null||Array.isArray(o)){const l=parseInt(s,10);if(!isNaN(l))return Array.isArray(o)?o[l]:o.at(l)}const a=No$2(o);return rU$1(a,s)?a.get(s):o[s]}function FA$2(r,o,s){if(r==null)return r;const a=GA$2(o[s],r);return!a&&sa===""?"$":(N0$1(a,o)??"").toString())}let UA$2=class{constructor(o,s,a=void 0){this.name=o,this.details=a,this.message=(s&&lU$1(s,a))??""}toString(){return"["+this.name+"]: "+this.message}},oe=class uie extends UA$2{constructor(o,s,a){super(o,s,a)}toJSON(){if(this.details!=null)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(o,s)=>{if(s&&typeof s=="object"&&typeof s.toJSON=="function")return s;try{return gt$3(s)}catch{return"[object]"}}))}}catch(o){throw Le$1.getLogger("esri.core.Error").error(o),o}return{name:this.name,message:this.message,details:this.details}}static fromJSON(o){return new uie(o.name,o.message,o.details)}};oe.prototype.type="error";function B0$2(r,o,s){if(r&&o)if(typeof o=="object")for(const a of Object.getOwnPropertyNames(o))B0$2(r,a,o[a]);else{if(o.includes(".")){const l=o.split("."),c=l.splice(-1,1)[0];return void B0$2(wa$2(r,l),c,s)}const a=r.__accessor__;a!=null&&cU$1(o,a),r[o]=s}}function cU$1(r,o){if(ut$1("esri-unknown-property-errors")&&!uU$1(r,o))throw new oe("set:unknown-property",hU$1(r,o))}function uU$1(r,o){return o.metadata[r]!=null}function hU$1(r,o){return"setting unknown property '"+r+"' on instance of "+o.host.declaredClass}function S(r={}){return(o,s)=>{if(o===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${o.name}.${s}. Accessor does not support static properties.`);const a=Object.getOwnPropertyDescriptor(o,s),l=fd$1(o,s);a&&(a.get||a.set?(l.get=a.get||l.get,l.set=a.set||l.set):"value"in a&&("value"in r&&Le$1.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${s}" on "${o.constructor.name}" already defined in the metadata`,r),l.value=r.value=a.value)),r.readOnly!=null&&(l.readOnly=r.readOnly);const c=r.aliasOf;if(c){const m=typeof c=="string"?c:c.source,g=typeof c=="string"?null:c.overridable===!0;let y;l.dependsOn=[m],l.get=function(){let _=wa$2(this,m);if(typeof _=="function"){y||(y=m.split(".").slice(0,-1).join("."));const E=wa$2(this,y);E&&(_=_.bind(E))}return _},l.readOnly||(l.set=g?function(_){this._override(s,_)}:function(_){B0$2(this,m,_)})}const u=r.type,d=r.types;if(!l.cast){let m;u?m=pU$1(u):d&&(m=Array.isArray(d)?hd$1(_a$2(d[0])):_a$2(d)),r.cast=dU$1(r.cast,m)}sU$1(l,r),r.range&&(l.cast=AA$2(l.cast,r.range))}}function f2$2(r,o,s){const a=fd$1(r,s);a.json||(a.json={});let l=a.json;return o!==void 0&&(l.origins||(l.origins={}),l.origins[o]||(l.origins[o]={}),l=l.origins[o]),l}function pU$1(r){let o=0,s=r;if(Jj$1(r))return kA$2(r);for(;Array.isArray(s)&&s.length===1&&typeof s[0]!="string"&&typeof s[0]!="number";)s=s[0],o++;const a=s;if(RA$2(a))return o===0?h2$2(a):k0$2(h2$2(a),o);if(o===1)return Wj$1(a);if(o>1)return Xj$1(a,o);const l=r;return l.from?l.from:Ai$1(l)}function dU$1(r,o){if(r||o)return r?o?(s,a)=>o(r(s,a),a):r:o}const $A$2=Symbol("Accessor-beforeDestroy");var Br;(function(r){r[r.INITIALIZING=0]="INITIALIZING",r[r.CONSTRUCTING=1]="CONSTRUCTING",r[r.CONSTRUCTED=2]="CONSTRUCTED",r[r.DESTROYED=3]="DESTROYED"})(Br||(Br={}));var be$1;(function(r){r[r.Dirty=1]="Dirty",r[r.Overridden=2]="Overridden",r[r.Computing=4]="Computing",r[r.NonNullable=8]="NonNullable",r[r.HasDefaultValue=16]="HasDefaultValue",r[r.DepTrackingInitialized=32]="DepTrackingInitialized",r[r.AutoTracked=64]="AutoTracked",r[r.ExplicitlyTracking=128]="ExplicitlyTracking"})(be$1||(be$1={}));let V0$2=class{constructor(o){this.accessed=void 0,this._handles=void 0,this._observer=o}destroy(){this.accessed?.clear(),this.clear()}onAccessed(o){this._observer!=null&&o!==this._observer&&(this.accessed==null&&(this.accessed=new Set),this.accessed.add(o))}onTrackingEnd(){this._observer!=null&&(this.clear(),this.accessed!=null&&(this._handles==null&&(this._handles=[]),this.accessed.forEach(o=>{this._handles.push(o.observe(this._observer))}),this.accessed.clear()))}clear(){if(this._handles!=null){for(let o=0;o1){const o=md$2.pop();yd$2=md$2[r-2],o.onTrackingEnd()}else if(r===1){const o=md$2.pop();yd$2=z0$2,o.onTrackingEnd()}else yd$2=z0$2}function zA$2(r,o){if(o.flags&be$1.DepTrackingInitialized)return;o.flags|=be$1.DepTrackingInitialized;const s=W0$2;W0$2=!1,o.flags&be$1.AutoTracked?m2$2(o.trackingTarget,o.metadata.get,r):HA$2(r,o),W0$2=s}const mU$1=[];function HA$2(r,o){o.flags&be$1.ExplicitlyTracking||(o.flags|=be$1.ExplicitlyTracking,m2$2(o.trackingTarget,()=>{const s=o.metadata.dependsOn||mU$1;for(const a of s)if(typeof a!="string"||a.includes(".")){const l=LA$2(a);for(let c=0,u=r;c{o[c]=l}),delete o[a]}}}let ju$2=class extends UA$2{constructor(o,s,a){super(o,s,a)}};ju$2.prototype.type="warning";function XA$2(r){return!!r&&r.prototype?.declaredClass&&r.prototype.declaredClass.indexOf("esri.core.Collection")===0}const y2$2=()=>Le$1.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function YA$2(r,o,s){r&&(!s&&!o.read||o.read?.reader||o.read?.enabled===!1||bU$1(r)&&Kl$2("read.reader",g2$2(r),o))}function g2$2(r){const o=r.ndimArray??0;if(o>1)return vU$1(r);if(o===1)return qA$2(r);if("type"in r&&ZA$2(r.type)){const s=r.type.prototype?.itemType?.Type,a=qA$2(typeof s=="function"?{type:s}:{types:s});return(l,c,u)=>{const d=a(l,c,u);return d&&new r.type(d)}}return v2$2(r)}function v2$2(r){return"type"in r?gU$1(r.type):_U$1(r.types)}function gU$1(r){return r.prototype.read?(o,s,a)=>{if(o==null)return o;const l=typeof o;if(l!=="object")return void y2$2().error(`Expected JSON value of type 'object' to deserialize type '${r.prototype.declaredClass}', but got '${l}'`);const c=new r;return c.read(o,a),c}:r.fromJSON}function JA$2(r,o,s,a){return a!==0&&Array.isArray(o)?o.map(l=>JA$2(r,l,s,a-1)):r(o,void 0,s)}function vU$1(r){const o=v2$2(r),s=JA$2.bind(null,o),a=r.ndimArray??0;return(l,c,u)=>{if(l==null)return l;l=s(l,u,a);let d=a,m=l;for(;d>0&&Array.isArray(m);)d--,m=m[0];if(m!==void 0)for(let g=0;g{if(s==null)return s;if(Array.isArray(s)){const u=[];for(const d of s){const m=o(d,void 0,l);m!==void 0&&u.push(m)}return u}const c=o(s,void 0,l);return c!==void 0?[c]:void 0}}function ZA$2(r){if(!XA$2(r))return!1;const o=r.prototype.itemType;return!(!o||!o.Type)&&(typeof o.Type=="function"?b2$2(o.Type):QA$2(o.Type))}function bU$1(r){return"types"in r?QA$2(r.types):b2$2(r.type)}function b2$2(r){return!Array.isArray(r)&&!!r&&r.prototype&&("read"in r.prototype||"fromJSON"in r||ZA$2(r))}function QA$2(r){for(const o in r.typeMap)if(!b2$2(r.typeMap[o]))return!1;return!0}function _U$1(r){let o=null;const s=r.errorContext??"type",a=r.validate;return(l,c,u)=>{if(l==null)return l;const d=typeof l;if(d!=="object")return void y2$2().error(`Expected JSON value of type 'object' to deserialize, but got '${d}'`);o||(o=wU$1(r));const m=r.key;if(typeof m!="string")return;const g=l[m],y=g?o[g]:r.defaultKeyValue?r.typeMap[r.defaultKeyValue]:void 0;if(!y){const E=`Type '${g||"unknown"}' is not supported`;return u?.messages&&l&&u.messages.push(new ju$2(`${s}:unsupported`,E,{definition:l,context:u})),void y2$2().error(E)}const _=new y;return _.read(l,u),a?a(_):_}}function wU$1(r){const o={};for(const s in r.typeMap){const a=r.typeMap[s],l=dd$3(a.prototype);if(typeof r.key=="function")continue;const c=l[r.key];if(!c)continue;if(c.json?.type&&Array.isArray(c.json.type)&&c.json.type.length===1&&typeof c.json.type[0]=="string"){o[c.json.type[0]]=a;continue}const u=c.json?.write;if(!u?.writer){o[s]=a;continue}const d=u.target,m=typeof d=="string"?d:r.key,g={};u.writer(s,g,m),g[m]&&(o[g[m]]=a)}return o}function xU$1(r){if(r.json||(r.json={}),tI$1(r.json),eI$1(r.json),KA$2(r.json),r.json.origins)for(const o in r.json.origins)tI$1(r.json.origins[o]),eI$1(r.json.origins[o]),KA$2(r.json.origins[o]);return!0}function KA$2(r){r.name&&(r.read&&typeof r.read=="object"?r.read.source===void 0&&(r.read.source=r.name):r.read={source:r.name},r.write&&typeof r.write=="object"?r.write.target===void 0&&(r.write.target=r.name):r.write={target:r.name})}function tI$1(r){typeof r.read=="boolean"?r.read={enabled:r.read}:typeof r.read=="function"?r.read={enabled:!0,reader:r.read}:r.read&&typeof r.read=="object"&&r.read.enabled===void 0&&(r.read.enabled=!0)}function eI$1(r){typeof r.write=="boolean"?r.write={enabled:r.write}:typeof r.write=="function"?r.write={enabled:!0,writer:r.write}:r.write&&typeof r.write=="object"&&r.write.enabled===void 0&&(r.write.enabled=!0)}function nI$1(r,o){if(!o.write||o.write.writer||o.write.enabled===!1&&!o.write.overridePolicy)return;const s=r?.ndimArray??0;r&&(s===1||"type"in r&&XA$2(r.type))?o.write.writer=SU$1:s>1?o.write.writer=AU$1(s):o.types?Array.isArray(o.types)?o.write.writer=TU$1(o.types[0]):o.write.writer=EU$1(o.types):o.write.writer=gd$2}function EU$1(r){return(o,s,a,l)=>o?rI$1(o,r,l)?gd$2(o,s,a,l):void 0:gd$2(o,s,a,l)}function rI$1(r,o,s){for(const a in o.typeMap)if(r instanceof o.typeMap[a])return!0;if(s?.messages){const a=o.errorContext??"type",l=`Values of type '${(typeof o.key!="function"?r[o.key]:r.declaredClass)??"Unknown"}' cannot be written`;s&&s.messages&&r&&s.messages.push(new oe(`${a}:unsupported`,l,{definition:r,context:s})),Le$1.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(l)}return!1}function TU$1(r){return(o,s,a,l)=>!o||!Array.isArray(o)?gd$2(o,s,a,l):gd$2(o.filter(c=>rI$1(c,r,l)),s,a,l)}function gd$2(r,o,s,a){Kl$2(s,X0$2(r,a),o)}function X0$2(r,o){return r&&typeof r.write=="function"?r.write({},o):r&&typeof r.toJSON=="function"?r.toJSON():typeof r=="number"?iI$1(r):r}function iI$1(r){return r===-1/0?-Number.MAX_VALUE:r===1/0?Number.MAX_VALUE:isNaN(r)?null:r}function SU$1(r,o,s,a){let l;r===null?l=null:r&&typeof r.map=="function"?(l=r.map(c=>X0$2(c,a)),typeof l.toArray=="function"&&(l=l.toArray())):l=[X0$2(r,a)],Kl$2(s,l,o)}function sI$1(r,o,s){return s!==0&&Array.isArray(r)?r.map(a=>sI$1(a,o,s-1)):X0$2(r,o)}function AU$1(r){return(o,s,a,l)=>{let c;if(o===null)c=null;else{c=sI$1(o,l,r);let u=r,d=c;for(;u>0&&Array.isArray(d);)u--,d=d[0];if(d!==void 0)for(let m=0;m{r??="esri.core.Accessor",o.prototype.declaredClass=r,kU$1(o);const s=[],a=[];let l=o.prototype;for(;l;)l.hasOwnProperty("initialize")&&!E2$2.has(l.initialize)&&(E2$2.add(l.initialize),s.push(l.initialize)),l.hasOwnProperty("destroy")&&!T2$1.has(l.destroy)&&(T2$1.add(l.destroy),a.push(l.destroy)),l=Object.getPrototypeOf(l);E2$2.clear(),T2$1.clear();const c=class extends o{constructor(...d){if(super(...d),this.constructor===c&&typeof this.postscript=="function"){if(s.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let m=s.length-1;m>=0;m--)s[m].call(this)}}),a.length){let m=!1;const g=this[$A$2];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!m){m=!0,g.call(this);for(let y=0;y{Le$1.getLogger("esri.core.Accessor").error(`cannot assign to ${r} property '${o}'`)},cI$1=new WeakMap;function LU$1(r,o,s=!1){const a=`🛑 DEPRECATED - ${o}`;if(!s)return void r.warn(a);let l=cI$1.get(r);l||(l=new Set,cI$1.set(r,l)),l.has(o)||(l.add(o),r.warn(a))}function uI$2(r,o,s={}){if(ut$1("esri-deprecation-warnings")){const{moduleName:a}=s;Uu$2(r,`Function: ${(a?a+"::":"")+o+"()"}`,s)}}function PU$1(r,o,s={}){if(ut$1("esri-deprecation-warnings")){const{moduleName:a}=s;Uu$2(r,`Property: ${(a?a+"::":"")+o}`,s)}}function DU$1(r,o,s={}){ut$1("esri-deprecation-warnings")&&Uu$2(r,`Multiple argument constructor: ${o}`,{warnOnce:!0,replacement:`new ${o}({ })`,...s})}function Uu$2(r,o,s={}){if(ut$1("esri-deprecation-warnings")){const{replacement:a,version:l,see:c,warnOnce:u}=s;let d=o;a&&(d+=` - 🛠️ Replacement: ${a}`),l&&(d+=` - ⚙️ Version: ${l}`),c&&(d+=` - 🔗 See ${c} for more details.`),LU$1(r,d,u)}}function GU$1(r){const o=[];return function*(){yield*o;for(const s of r)o.push(s),yield s}}function FU$1(r,o){for(const s of r)if(s!=null&&o(s))return s}function S2$1(r){return r!=null&&typeof r[Symbol.iterator]=="function"}let Y0$2=class{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let o=0;return this._groups.forEach(s=>{o+=s.length}),o}add(o,s){if(S2$1(o)){const a=this._getOrCreateGroup(s);for(const l of o)pI$2(l)&&a.push(l)}else pI$2(o)&&this._getOrCreateGroup(s).push(o);return this}forEach(o,s){if(typeof o=="function")this._groups.forEach(a=>a.forEach(o));else{const a=this._getGroup(o);a&&s&&a.forEach(s)}}has(o){return this._groups.has(J0$2(o))}remove(o){if(typeof o!="string"&&S2$1(o)){for(const s of o)this.remove(s);return this}return this.has(o)?(hI$2(this._getGroup(o)),this._groups.delete(J0$2(o)),this):this}removeAll(){return this._groups.forEach(hI$2),this._groups.clear(),this}removeReference(o){return this._groups.delete(o),this}_getOrCreateGroup(o){if(this.has(o))return this._getGroup(o);const s=[];return this._groups.set(J0$2(o),s),s}_getGroup(o){return this._groups.get(J0$2(o))}};function J0$2(r){return r||"_default_"}function hI$2(r){for(const o of r)o instanceof Y0$2?o.removeAll():o.remove()}function pI$2(r){return r!=null&&(!!r.remove||r instanceof Y0$2)}function dI$2(r,o){if(r==null)throw new Error(o??"value is None")}function vd$2(r){return r?.destroy(),null}function jU$1(r){return r?.dispose(),null}function tc$2(r){return r?.remove(),null}function A2$1(r){return r?.abort(),null}function UU$1(r){return r?.release(),null}function $U$1(r,o,s){return r!=null&&o!=null?s!=null?s(r,o):r.equals(o):r===o}function BU$1(r,o){let s;return r.some((a,l)=>(s=o(a,l),s!=null)),s??void 0}function VU$1(r){return r?.release&&typeof r.release=="function"}function zU$1(r){return r?.acquire&&typeof r.acquire=="function"}let $u$2=class Kre{constructor(o,s,a,l=1,c=0){this._ctor=o,this._acquireFunction=s,this._releaseFunction=a,this.allocationSize=l,this._pool=new Array(c),this._initialSize=c;for(let u=0;u=this._pool.length)){for(let s=o;s0){if(!(l+a0)for(const s of o)s.onInvalidated()}onCommitted(){const o=this._observers;if(o&&o.length>0){const s=o.slice();for(const a of s)a.onCommitted()}}},JU$1=class hie{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(o){const s=new hie;return this._values.forEach((a,l)=>{o&&o.has(l)||s.set(l,gt$3(a))}),s}get(o){return this._values.get(o)}originOf(){return ue.USER}keys(){return[...this._values.keys()]}set(o,s){this._values.set(o,s)}delete(o){this._values.delete(o)}has(o){return this._values.has(o)}forEach(o){this._values.forEach(o)}};function Z0$1(r,o,s){return r!==void 0}function yI$2(r,o,s,a){return r!==void 0&&(!(s==null&&r.flags&be$1.NonNullable)||(a.lifecycle,Br.INITIALIZING,!1))}let qU$1=class{constructor(o){this.host=o,this.propertiesByName=new Map,this.ctorArgs=null,this.lifecycle=Br.INITIALIZING,this.store=new JU$1,this.mutable=!0,this._origin=ue.USER;const s=this.host.constructor.__accessorMetadata__;for(const a in s){const l=new mI$2(a,s[a]);this.propertiesByName.set(a,l)}this.metadata=s}initialize(){this.lifecycle=Br.CONSTRUCTING}constructed(){this.lifecycle=Br.CONSTRUCTED}destroy(){this.lifecycle=Br.DESTROYED,this.propertiesByName.forEach(o=>o.destroy())}get initialized(){return this.lifecycle!==Br.INITIALIZING}get(o){const s=this.propertiesByName.get(o);if(s.metadata.get)return s.getComputed(this);this.mutable&&zt$1(s);const a=this.store;return a.has(o)?a.get(o):s.metadata.value}originOf(o){const s=this.store.originOf(o);if(s===void 0){const a=this.propertiesByName.get(o);if(a!==void 0&&a.flags&be$1.HasDefaultValue)return"defaults"}return q0$2(s)}has(o){return this.propertiesByName.has(o)&&this.store.has(o)}keys(){return[...this.propertiesByName.keys()]}internalGet(o){const s=this.propertiesByName.get(o);if(Z0$1(s))return this.store.has(o)?this.store.get(o):s.metadata.value}internalSet(o,s){const a=this.propertiesByName.get(o);Z0$1(a)&&this._internalSet(a,s)}getDependsInfo(o,s,a){const l=this.propertiesByName.get(s);if(!Z0$1(l))return"";const c=new V0$2,u=Oo$1(c,()=>l.metadata.get?.call(o));let d=`${a}${o.declaredClass.split(".").pop()}.${s}: ${u} -`;const m=c.accessed??new Set;if(m.size===0)return d;a+=" ";for(const g of m)g instanceof mI$2&&(d+=`${a}${g.propertyName}: undefined -`);return d}setAtOrigin(o,s,a){const l=this.propertiesByName.get(o);if(Z0$1(l))return this._setAtOrigin(l,s,a)}isOverridden(o){const s=this.propertiesByName.get(o);return s!==void 0&&!!(s.flags&be$1.Overridden)}clearOverride(o){const s=this.propertiesByName.get(o);s&&s.flags&be$1.Overridden&&(s.flags&=~be$1.Overridden,s.notifyChange())}override(o,s){const a=this.propertiesByName.get(o);if(!yI$2(a,o,s,this))return;const l=a.metadata.cast;if(l){const c=this._cast(l,s),{valid:u,value:d}=c;if(M2$1.release(c),!u)return;s=d}a.flags|=be$1.Overridden,this._internalSet(a,s)}set(o,s){const a=this.propertiesByName.get(o);if(!yI$2(a,o,s,this))return;const l=a.metadata.cast;if(l){const u=this._cast(l,s),{valid:d,value:m}=u;if(M2$1.release(u),!d)return;s=m}const c=a.metadata.set;c?c.call(this.host,s):this._internalSet(a,s)}setDefaultOrigin(o){this._origin=I2$1(o)}getDefaultOrigin(){return q0$2(this._origin)}notifyChange(o){const s=this.propertiesByName.get(o);s!==void 0&&s.notifyChange()}invalidate(o){const s=this.propertiesByName.get(o);s!==void 0&&s.invalidate()}commit(o){const s=this.propertiesByName.get(o);s!==void 0&&s.commit()}_internalSet(o,s){const a=this.lifecycle!==Br.INITIALIZING?this._origin:ue.DEFAULTS;this._setAtOrigin(o,s,a)}_setAtOrigin(o,s,a){const l=this.store,c=o.propertyName;l.has(c,a)&&o2$2(s,l.get(c))&&~o.flags&be$1.Overridden&&a===l.originOf(c)||(o.invalidate(),l.set(c,s,a),o.commit(),zA$2(this.host,o))}_cast(o,s){const a=M2$1.acquire();return a.valid=!0,a.value=s,o&&(a.value=o.call(this.host,s,a)),a}},ZU$1=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const M2$1=new $u$2(ZU$1);let QU$1;function KU$1(){return QU$1}var gI$2;(function(r){r[r.Ignore=0]="Ignore",r[r.Destroy=1]="Destroy",r[r.ThrowError=2]="ThrowError"})(gI$2||(gI$2={}));function t$$2(r){r.length=0}let Co$2=class{constructor(o=50,s=50){this._pool=new $u$2(Array,void 0,t$$2,s,o)}acquire(){return this._pool.acquire()}release(o){this._pool.release(o)}prune(){this._pool.prune(0)}static acquire(){return N2$1.acquire()}static release(o){return N2$1.release(o)}static prune(){N2$1.prune()}};const N2$1=new Co$2(100);let vI$2=class extends $u$2{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...o){const s=super.acquire(...o);return this._set.delete(s),s}release(o){o&&!this._set.has(o)&&(super.release(o),this._set.add(o))}_dispose(o){this._set.delete(o),super._dispose(o)}};const Q0$2=[];function O2$2(r){Q0$2.push(r),Q0$2.length===1&&queueMicrotask(()=>{const o=Q0$2.slice();Q0$2.length=0;for(const s of o)s()})}let C2$1=class{constructor(o,s=30){this.name=o,this._counter=0,this._samples=new Array(s)}push(o){o!=null&&(this._samples[++this._counter%this._samples.length]=o)}set(o){o!=null&&(this._samples[this._counter%this._samples.length]=o)}get median(){return this._samples.slice().sort((o,s)=>o-s)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((o,s)=>o+s,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var R2$1;(function(r){const o=(c,u,d,m)=>{let g=u,y=u;const _=d>>>1,E=c[g-1];for(;y<=_;){y=g<<1,ycu?1:0;function a(c,u,d,m){u===void 0&&(u=0),d===void 0&&(d=c.length),m===void 0&&(m=s);for(let y=d>>>1;y>u;y--)o(c,y,d,m);const g=u+1;for(let y=d-1;y>u;y--){const _=c[u];c[u]=c[y],c[y]=_,o(c,g,y,m)}}function*l(c,u,d,m){u===void 0&&(u=0),d===void 0&&(d=c.length),m===void 0&&(m=s);for(let y=d>>>1;y>u;y--)o(c,y,d,m),yield;const g=u+1;for(let y=d-1;y>u;y--){const _=c[u];c[u]=c[y],c[y]=_,o(c,g,y,m),yield}}r.sort=a,r.iterableSort=l})(R2$1||(R2$1={}));const bI$2=R2$1,e$$2=1.5,n$$2=1.1;let k2$1=class{constructor(o){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new Jb$2,o&&(o.initialSize&&(this.data=new Array(o.initialSize)),o.allocator&&(this._allocator=o.allocator),o.deallocator!==void 0&&(this._deallocator=o.deallocator),o.shrink&&(this._shrink=()=>_I$2(this)))}toArray(){return this.data.slice(0,this.length)}filter(o){const s=new Array;for(let a=0;a=this._length))return this.data[o]}includes(o,s){const a=this.data.indexOf(o,s);return a!==-1&&athis._length){if(this._allocator){for(;this._length=this.length||o<0))return this.swapElements(o,this.length-1),this.pop()}removeUnorderedMany(o,s=o.length,a){this.length=vj$1(this.data,o,this.length,s,this._hint,a),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(o,s){if(o>=this.length||s>=this.length||o===s)return;const a=this.data[o];this.data[o]=this.data[s],this.data[s]=a}sort(o){bI$2.sort(this.data,0,this.length,o)}iterableSort(o){return bI$2.iterableSort(this.data,0,this.length,o)}some(o,s){for(let a=0;ae$$2*r.length&&(r.data.length=Math.floor(r.length*n$$2))}function r$$2(r){return{setTimeout:(o,s)=>{const a=r.setTimeout(o,s);return dn$1(()=>r.clearTimeout(a))}}}const wI$2=r$$2(globalThis);function K0$2(r){return i$$2(r)||xI$2(r)}function i$$2(r){return r!=null&&typeof r=="object"&&"on"in r&&typeof r.on=="function"}function xI$2(r){return r!=null&&typeof r=="object"&&"addEventListener"in r&&typeof r.addEventListener=="function"}function L2$1(r,o,s){if(!K0$2(r))throw new TypeError("target is not a Evented or EventTarget object");return xI$2(r)?s$$2(r,o,s):r.on(o,s)}function s$$2(r,o,s,a){if(Array.isArray(o)){const l=o.slice();for(const c of l)r.addEventListener(c,s,a);return dn$1(()=>{for(const c of l)r.removeEventListener(c,s,a)})}return r.addEventListener(o,s,a),dn$1(()=>r.removeEventListener(o,s,a))}function P2$1(r,o,s){if(!K0$2(r))throw new TypeError("target is not a Evented or EventTarget object");if("once"in r)return r.once(o,s);const a=L2$1(r,o,l=>{a.remove(),s.call(r,l)});return a}function Vr$2(r="Aborted"){return new oe("AbortError",r)}function Bu$2(r,o="Aborted"){if(xa$2(r))throw Vr$2(o)}function bd$2(r){return r instanceof AbortSignal?r:r?.signal??void 0}function xa$2(r){const o=bd$2(r);return o!=null&&o.aborted}function D2$1(r){if(Vu$1(r))throw r}function o$$2(r){if(!Vu$1(r))throw r}function Ea$1(r,o){const s=bd$2(r);if(s!=null){if(!s.aborted)return P2$1(s,"abort",()=>o());o()}}function EI$2(r,o){const s=bd$2(r);if(s!=null)return Bu$2(s),P2$1(s,"abort",()=>o(Vr$2()))}function a$$2(r,o){return bd$2(o)==null?r:new Promise((s,a)=>{let l=Ea$1(o,()=>a(Vr$2()));const c=()=>{l=tc$2(l)};r.then(c,c),r.then(s,a)})}function Vu$1(r){return r?.name==="AbortError"}async function l$$2(r){try{return await r}catch(o){if(!Vu$1(o))throw o;return}}async function ty$2(r){if(!r)return;if(typeof r.forEach!="function"){const s=Object.keys(r),a=s.map(u=>r[u]),l=await ty$2(a),c={};return s.map((u,d)=>c[u]=l[d]),c}const o=r;return Promise.allSettled(o).then(s=>Array.from(o,(a,l)=>{const c=s[l];return c.status==="fulfilled"?{promise:a,value:c.value}:{promise:a,error:c.reason}}))}async function c$$2(r){return(await Promise.allSettled(r)).filter(o=>o.status==="fulfilled").map(o=>o.value)}async function u$$2(r){return(await Promise.allSettled(r)).filter(o=>o.status==="rejected").map(o=>o.reason)}function TI$2(r,o=void 0,s){const a=new AbortController;return Ea$1(s,()=>a.abort()),new Promise((l,c)=>{let u=setTimeout(()=>{u=0,l(o)},r);Ea$1(a,()=>{u&&(clearTimeout(u),c(Vr$2()))})})}function h$$2(r,o){const s=new AbortController,a=setTimeout(()=>s.abort(),o);return Ea$1(r,()=>{s.abort(),clearTimeout(a)}),{...r,signal:s.signal}}function G2$1(r){return r&&typeof r.then=="function"}function F2$1(r){return G2$1(r)?r:Promise.resolve(r)}function p$$2(r,o=-1){let s,a,l,c,u=null;const d=(...m)=>{if(s){a=m,c&&c.reject(Vr$2()),c=ec$2();const E=c.promise;if(u){const w=u;u=null,w.abort()}return E}if(l=c||ec$2(),c=null,o>0){const E=new AbortController;s=F2$1(r(...m,E.signal));const w=s;TI$2(o).then(()=>{s===w&&(c?E.abort():u=E)})}else s=1,s=F2$1(r(...m));const g=()=>{const E=a;a=l=s=u=null,E!=null&&d(...E)},y=s,_=l;return y.then(g,g),y.then(_.resolve,_.reject),_.promise};return d}function ec$2(){let r,o;const s=new Promise((l,c)=>{r=l,o=c}),a=l=>{r(l)};return a.resolve=l=>r(l),a.reject=l=>o(l),a.timeout=(l,c)=>wI$2.setTimeout(()=>a.reject(c),l),a.promise=s,a}async function d$$2(r){await Promise.resolve(),Bu$2(r)}function f$$2(r){return r}function m$$2(r){return 1e3*r}function y$$2(r){return r}let g$$2=class{constructor(o){this.phases=o,this.paused=!1,this.ticks=-1,this.removed=!1}},v$$2=class{constructor(o){this.callback=o,this.isActive=!0}remove(){this.isActive=!1}},j2$1=0;const _d$2={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},U2$1=["prepare","preRender","render","postRender","update","finish"],$2$1=[],nc$2=new k2$1;let b$$2=class{constructor(o){this._task=o}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};function _$$2(){rc$2!=null&&(cancelAnimationFrame(rc$2),rc$2=requestAnimationFrame(V2$1))}const ey$2={frameTasks:nc$2,willDispatch:!1,clearFrameTasks:x$$2,dispatch:AI$2,executeFrameTasks:E$$2,reschedule:_$$2};function B2$1(r){const o=new v$$2(r);return $2$1.push(o),ey$2.willDispatch||(ey$2.willDispatch=!0,O2$2(AI$2)),o}function w$$2(r){const o=new g$$2(r);return nc$2.push(o),rc$2==null&&(j2$1=performance.now(),rc$2=requestAnimationFrame(V2$1)),new b$$2(o)}let rc$2=null;function x$$2(r=!1){nc$2.forAll(o=>{o.removed=!0}),r&&SI$2()}function V2$1(){const r=performance.now();rc$2=null,rc$2=nc$2.length>0?requestAnimationFrame(V2$1):null,ey$2.executeFrameTasks(r)}function E$$2(r){const o=r-j2$1;j2$1=r;const s=1e3/60,a=Math.max(0,o-s);_d$2.time=r,_d$2.frameDuration=s-a;for(let l=0;l{d.paused||d.removed||(l===0&&d.ticks++,d.phases[u]&&(_d$2.elapsedFrameTime=performance.now()-r,_d$2.deltaTime=d.ticks===0?0:o,d.phases[u]?.call(d,_d$2)))}),S$$2[l].push(performance.now()-c)}SI$2(),A$$2.push(performance.now()-r)}const ny$2=new k2$1;function SI$2(){nc$2.forAll(r=>{r.removed&&ny$2.push(r)}),nc$2.removeUnorderedMany(ny$2.data,ny$2.length),ny$2.clear()}function AI$2(){for(;$2$1.length;){const r=$2$1.shift();r.isActive&&r.callback()}ey$2.willDispatch=!1}function II$2(r=1,o){const s=ec$2(),a=()=>{xa$2(o)?s.reject(Vr$2()):r===0?s():(--r,O2$2(()=>a()))};return a(),s.promise}function MI$2(r){return II$2(1,r)}async function T$$2(r){await MI$2(r),await new Promise(o=>requestAnimationFrame(()=>{r?.aborted||o()}))}const S$$2=U2$1.map(r=>new C2$1(r)),A$$2=new C2$1("total");function NI$2(r,o){for(const s of r.values())if(o(s))return!0;return!1}function z2$1(r,o){if(!o)return r;for(const s of o)s!=null&&r.add(s);return r}function I$$2(r,o){return o!=null&&r.add(o),r}function H2$1(r,o){const s=new Set;return z2$1(s,r),z2$1(s,o),s}function OI$2(r,o){const s=new Set;for(const a of o)r.has(a)&&s.add(a);return s}function M$$2(r,o){if(!r||!o)return!1;if(r===o)return!0;for(const s of r)if(!o.has(s))return!1;return!0}function N$$2(r,o){if(r==null&&o==null)return!0;if(r==null||o==null||r.size!==o.size)return!1;for(const s of r)if(!o.has(s))return!1;return!0}function CI$2(r,o){const s=new Set(r);for(const a of o)s.delete(a);return s}function O$$2(r,o){return CI$2(H2$1(r,o),OI$2(r,o))}let C$$2=0;function wd$2(){return++C$$2}let ry$2=class extends V0$2{constructor(o){super(new R$$2(o)),this._observer&&RI$2.register(this,new WeakRef(this._observer),this)}destroy(){this._observer&&RI$2.unregister(this._observer),this.accessed?.clear(),this.clear(),this._observer?.destroy()}},R$$2=class{constructor(o){this._notify=o,this._invalidCount=0,this.destroyed=!1}onInvalidated(){this._invalidCount++}onCommitted(){if(this.destroyed)return;const o=this._invalidCount;if(o===1)return this._invalidCount=0,void this._notify();this._invalidCount=o>0?o-1:0}destroy(){this.destroyed=!0,this._notify=k$$2}};const RI$2=new FinalizationRegistry(r=>{r.deref()?.destroy()});function k$$2(){}let zu$2=!1;const iy$2=[];function kI$2(r,o){let s=new ry$2(c),a=null,l=!1;function c(){if(!s||l)return;if(zu$2)return void PI$2(c);const d=a;s.clear(),zu$2=!0,l=!0,a=Oo$1(s,r),l=!1,zu$2=!1,o(a,d),DI$2()}function u(){s&&(s.destroy(),s=null,a=null)}return l=!0,a=Oo$1(s,r),l=!1,dn$1(u)}function LI$2(r,o){let s=new ry$2(l),a=null;function l(){o(a,u)}function c(){s&&(s.destroy(),s=null),a=null}function u(){return s?(s.clear(),a=Oo$1(s,r),a):null}return u(),dn$1(c)}function L$$2(r,o){let s=!1,a=!1;const l=!!o?.sync;let c=new ry$2(()=>{s||a||(a=!0,l?u():queueMicrotask(u))});function u(){a=!1,c&&!s&&(zu$2?PI$2(u):(c.clear(),zu$2=!0,s=!0,Oo$1(c,r),s=!1,zu$2=!1,DI$2()))}function d(){c&&(c.destroy(),c=null)}return s=!0,Oo$1(c,r),s=!1,dn$1(d)}function PI$2(r){iy$2.includes(r)||iy$2.unshift(r)}function DI$2(){for(;iy$2.length;)iy$2.pop()()}var xd$2;(function(r){r[r.Untracked=0]="Untracked",r[r.Tracked=1]="Tracked"})(xd$2||(xd$2={}));let Ed$2=class{constructor(){this.uid=wd$2(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(o,s,a,l,c){return this.pool.acquire(xd$2.Untracked,o,s,a,l,c,o2$2)}static acquireTracked(o,s,a,l){return this.pool.acquire(xd$2.Tracked,o,s,a,null,null,l)}notify(o,s){this.type===xd$2.Untracked?this.callback.call(this.target,o,s,this.path,this.target):this.callback.call(null,o,s,void 0,void 0)}acquire(o,s,a,l,c,u,d){this.uid=wd$2(),this.removed=!1,this.type=o,this.oldValue=s,this.callback=a,this.getValue=l,this.target=c,this.path=u,this.equals=d}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=wd$2(),this.removed=!0}};Ed$2.pool=new vI$2(Ed$2);const sy$1=new Co$2,Ro$2=new Set;let oy$2;function ay$2(r){Ro$2.delete(r),Ro$2.add(r),oy$2||(oy$2=B2$1(G$$2))}function P$$2(r){if(r.removed)return;const o=r.oldValue,s=r.getValue();r.equals(o,s)||(r.oldValue=s,r.notify(s,o))}function D$$2(r){for(const o of Ro$2.values())o.target===r&&(o.removed=!0)}function G$$2(){let r=10;for(;oy$2&&r--;){oy$2=null;const o=F$$2(),s=sy$1.acquire();for(const a of o){const l=a.uid;P$$2(a),l===a.uid&&a.removed&&s.push(a)}for(const a of Ro$2)a.removed&&(s.push(a),Ro$2.delete(a));for(const a of s)Ed$2.pool.release(a);sy$1.release(s),sy$1.release(o),W2$1.forEach(a=>a())}}function F$$2(){const r=sy$1.acquire();r.length=Ro$2.size;let o=0;for(const s of Ro$2)r[o]=s,++o;return Ro$2.clear(),r}const W2$1=new Set;function j$$2(r){return W2$1.add(r),dn$1(()=>W2$1.delete(r))}function U$$2(r,o,s){let a=DA$2(r,o,s,(l,c,u)=>{let d,m,g=LI$2(()=>pd$2(l,c),(y,_)=>{l.__accessor__?.lifecycle===Br.DESTROYED||d&&d.uid!==m?a.remove():(d||(d=Ed$2.acquireUntracked(y,u,_,l,c),m=d.uid),ay$2(d))});return dn$1(()=>{g.remove(),d&&(d.uid!==m||d.removed||(d.removed=!0,ay$2(d)),d=null),a=g=null})});return a}function $$$2(r,o,s){const a=DA$2(r,o,s,(l,c,u)=>{let d=!1;return kI$2(()=>pd$2(l,c),(m,g)=>{l.__accessor__.lifecycle!==Br.DESTROYED?d||(d=!0,o2$2(g,m)||u.call(l,m,g,c,l),d=!1):a.remove()})});return a}function B$$2(r,o,s,a=!1){return r.__accessor__&&r.__accessor__.lifecycle!==Br.DESTROYED?a?$$$2(r,o,s):U$$2(r,o,s):dn$1()}function V$$2(r,o,s){let a,l,c=LI$2(r,(u,d)=>{a&&a.uid!==l?c.remove():(a||(a=Ed$2.acquireTracked(u,o,d,s),l=a.uid),ay$2(a))});return dn$1(()=>{c.remove(),a&&(a.uid!==l||a.removed||(a.removed=!0,ay$2(a)),a=null),c=null})}function z$$2(r,o,s){let a=!1;return kI$2(r,(l,c)=>{a||(a=!0,s(c,l)||o(l,c),a=!1)})}function H$$2(r,o,s=!1,a=gA$2){return s?z$$2(r,o,a):V$$2(r,o,a)}function W$$2(r){return NI$2(Ro$2,o=>o.oldValue===r)}var GI$2,FI$2;function X$$2(r){if(r==null)return{value:r};if(Array.isArray(r))return{type:[r[0]],value:null};switch(typeof r){case"object":return r.constructor?.__accessorMetadata__||r instanceof Date?{type:r.constructor,value:r}:r;case"boolean":return{type:Boolean,value:r};case"string":return{type:String,value:r};case"number":return{type:Number,value:r};case"function":return{type:r,value:null};default:return}}const Ta$2=Symbol("Accessor-Handles"),X2$1=Symbol("Accessor-Initialized");let jn$2=class Ure{static createSubclass(o={}){if(Array.isArray(o))throw new Error("Multi-inheritance unsupported since 4.16");const{properties:s,declaredClass:a,constructor:l}=o;delete o.declaredClass,delete o.properties,delete o.constructor;const c=this;class u extends c{constructor(...m){super(...m),this.inherited=null,l&&l.apply(this,m)}}dd$3(u.prototype);for(const d in o){const m=o[d];u.prototype[d]=typeof m=="function"?function(...g){const y=this.inherited;let _;this.inherited=function(...E){if(c.prototype[d])return c.prototype[d].apply(this,E)};try{_=m.apply(this,g)}catch(E){throw this.inherited=y,E}return this.inherited=y,_}:o[d]}for(const d in s){const m=X$$2(s[d]);S(m)(u.prototype,d)}return it$1(a)(u)}static freeze(o){return o instanceof Ure?o.__accessor__.mutable=!1:Object.freeze(o),o}static isFrozen(o){return o instanceof Ure?!o.__accessor__.mutable:Object.isFrozen(o)}constructor(...o){if(this[GI$2]=null,this[FI$2]=!1,this.constructor===Ure)throw new Error("[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor");const s=new qU$1(this);Object.defineProperty(this,"__accessor__",{enumerable:!1,value:s}),o.length>0&&(s.ctorArgs=this.normalizeCtorArgs?.apply(this,o)??o[0])}postscript(){const o=this.__accessor__,s=o.ctorArgs;o.initialize(),s&&(this.set(s),o.ctorArgs=null),o.constructed(),this.initialize(),this[X2$1]=!0}initialize(){}[$A$2](){this[Ta$2]=vd$2(this[Ta$2])}destroy(){this.destroyed||(D$$2(this),this.__accessor__.destroy(),KU$1()?.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[X2$1]}get destroyed(){return this.__accessor__?.lifecycle===Br.DESTROYED||!1}commitProperty(o){wa$2(this,o)}get(o){return uI$2(Le$1.getLogger(this),"`Accessor.get` is deprecated in favor of using optional chaining",{version:"4.28",see:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining"}),wa$2(this,o)}hasOwnProperty(o){return this.__accessor__?this.__accessor__.has(o):Object.prototype.hasOwnProperty.call(this,o)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(o,s){return B0$2(this,o,s),this}watch(o,s,a){return B$$2(this,o,s,a)}addHandles(o,s){if(this.destroyed){const a=Array.isArray(o)?o:[o];for(const l of a)l.remove();return}(this[Ta$2]??=new Y0$2).add(o,s)}removeHandles(o){this[Ta$2]?.remove(o)}removeAllHandles(){this[Ta$2]?.removeAll()}removeHandlesReference(o){this[Ta$2]?.removeReference(o)}hasHandles(o){return this[Ta$2]?.has(o)===!0}_override(o,s){s===void 0?this.__accessor__.clearOverride(o):this.__accessor__.override(o,s)}_clearOverride(o){return this.__accessor__.clearOverride(o)}_overrideIfSome(o,s){s==null?this.__accessor__.clearOverride(o):this.__accessor__.override(o,s)}_isOverridden(o){return this.__accessor__.isOverridden(o)}notifyChange(o){this.__accessor__.notifyChange(o)}_get(o){return this.__accessor__.internalGet(o)}_set(o,s){return this.__accessor__.internalSet(o,s),this}};GI$2=Ta$2,FI$2=X2$1;let Y$$2=class pie{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(o){const s=new pie;return this._values.forEach((a,l)=>{o&&o.has(l)||s.set(l,gt$3(a.value),a.origin)}),s}get(o,s){s=this._normalizeOrigin(s);const a=this._values.get(o);return s==null||a?.origin===s?a?.value:void 0}originOf(o){return this._values.get(o)?.origin??ue.USER}keys(o){o=this._normalizeOrigin(o);const s=[...this._values.keys()];return o==null?s:s.filter(a=>this._values.get(a)?.origin===o)}set(o,s,a){if((a=this._normalizeOrigin(a))===ue.DEFAULTS){const l=this._values.get(o);if(l?.origin!=null&&l.origin>a)return}this._values.set(o,new J$$2(s,a))}delete(o,s){(s=this._normalizeOrigin(s))!=null&&this._values.get(o)?.origin!==s||this._values.delete(o)}has(o,s){return(s=this._normalizeOrigin(s))!=null?this._values.get(o)?.origin===s:this._values.has(o)}forEach(o){this._values.forEach(({value:s},a)=>o(s,a))}_normalizeOrigin(o){if(o!=null)return o===ue.DEFAULTS?o:ue.USER}},J$$2=class{constructor(o,s){this.value=o,this.origin=s}};function jI$2(r,o,s){o.keys().forEach(l=>{s.set(l,o.get(l),ue.DEFAULTS)});const a=r.metadata;Object.keys(a).forEach(l=>{r.internalGet(l)&&s.set(l,r.internalGet(l),ue.DEFAULTS)})}function q$$2(r,o,s){if(!r?.read||r.read.enabled===!1||!r.read.source)return!1;const a=r.read.source;if(typeof a=="string"){if(a===o||a.includes(".")&&a.indexOf(o)===0&&jA$2(a,s))return!0}else for(const l of a)if(l===o||l.includes(".")&&l.indexOf(o)===0&&jA$2(l,s))return!0;return!1}function Z$$2(r){return r&&(!r.read||r.read.enabled!==!1&&!r.read.source)}function Q$$2(r,o,s,a,l){let c=_2$1(o[s],l);Z$$2(c)&&(r[s]=!0);for(const u of Object.getOwnPropertyNames(o))c=_2$1(o[u],l),q$$2(c,s,a)&&(r[u]=!0)}function K$$2(r,o,s,a){const l=s.metadata,c=IU$1(l[o],a),u=c?.default;if(u===void 0)return;const d=typeof u=="function"?u.call(r,o,a):u;d!==void 0&&s.set(o,d)}const UI$2={origin:"service"};function $I$2(r,o,s=UI$2){if(!o||typeof o!="object")return;const a=No$2(r),l=a.metadata,c={};for(const u of Object.getOwnPropertyNames(o))Q$$2(c,l,u,o,s);a.setDefaultOrigin(s.origin);for(const u of Object.getOwnPropertyNames(c)){const d=_2$1(l[u],s).read,m=d?.source;let g;g=m&&typeof m=="string"?pd$2(o,m):o[u],d?.reader&&(g=d.reader.call(r,g,o,s)),g!==void 0&&a.set(u,g)}if(!s||!s.ignoreDefaults){a.setDefaultOrigin("defaults");for(const u of Object.getOwnPropertyNames(l))c[u]||K$$2(r,u,a,s)}a.setDefaultOrigin("user")}function tB$1(r,o,s,a=UI$2){const l={...a,messages:[]};s(l),l.messages?.forEach(c=>{c.type!=="warning"||r.loaded?a?.messages&&a.messages.push(c):r.loadWarnings.push(c)})}function eB$1(r,o,s,a,l){const c={};return o.write?.writer?.call(r,a,c,s,l),c}function BI$2(r,o,s,a,l,c){if(!a?.write)return!1;const u=wa$2(r,s);if(!l&&a.write.overridePolicy){const d=a.write.overridePolicy.call(r,u,s,c??void 0);d!==void 0&&(l=d)}if(l||(l=a.write),!l||l.enabled===!1||l.layerContainerTypes&&c?.layerContainerType&&!l.layerContainerTypes.includes(c.layerContainerType))return!1;if((u===null&&!l.allowNull&&!l.writerEnsuresNonNull||u===void 0)&&l.isRequired){const d=new oe("web-document-write:property-required",`Missing value for required property '${s}' on '${r.declaredClass}'`,{propertyName:s,target:r});return d&&c?.messages?c.messages.push(d):d&&!c&&Le$1.getLogger("esri.core.accessorSupport.write").error(d.name,d.message),!1}return!(u===void 0||u===null&&!l.allowNull&&!l.writerEnsuresNonNull||!l.alwaysWriteDefaults&&(!o.store.multipleOriginsSupported||o.store.originOf(s)===ue.DEFAULTS)&&nB$1(r,s,c,a,u)||!l.ignoreOrigin&&c?.origin&&o.store.multipleOriginsSupported&&o.store.originOf(s)0&&(o=U0$1(o,m),s?.resources?.pendingOperations?.length&&s.resources.pendingOperations.push(Promise.all(s.resources.pendingOperations).then(()=>U0$1(o,m,()=>"replace-arrays"))),s?.writtenProperties&&s.writtenProperties.push({target:r,propName:c,oldOrigin:YU$1(a.store.originOf(c)),newOrigin:s.origin}))}return o}const Y2$1=r=>{let o=class extends r{constructor(...s){super(...s);const a=No$2(this),l=a.store,c=new Y$$2;a.store=c,jI$2(a,l,c)}read(s,a){$I$2(this,s,a)}write(s,a){return VI$2(this,s??{},a)}toJSON(s){return this.write({},s)}static fromJSON(s,a){return iB$1.call(this,s,a)}};return o=v([it$1("esri.core.JSONSupport")],o),o.prototype.toJSON.isDefaultToJSON=!0,o};function iB$1(r,o){if(!r)return null;if(r.declaredClass)throw new Error("JSON object is already hydrated");const s=new this;return s.read(r,o),s}function ly$2(r){return r&&typeof r=="object"&&"toJSON"in r&&typeof r.toJSON=="function"}let ee$1=class extends Y2$1(jn$2){};ee$1=v([it$1("esri.core.JSONSupport")],ee$1);function Un$2(r,o,s){let a,l;return o===void 0||Array.isArray(o)?(l=r,s=o,a=[void 0]):(l=o,a=Array.isArray(r)?r:[r]),(c,u)=>{const d=c.constructor.prototype;a.forEach(m=>{const g=f2$2(c,m,l);g.read&&typeof g.read=="object"||(g.read={}),g.read.reader=d[u],s&&(g.read.source=(g.read.source||[]).concat(s))})}}let js$2=class{constructor(o,s={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=o,this._options=s,this.apiValues=[],this.jsonValues=[],this._apiToJSON=sB$1(o),this.apiValues=zI$2(this._apiToJSON),this.jsonValues=zI$2(this._jsonToAPI),this.read=a=>this.fromJSON(a),this.write=(a,l,c)=>{const u=this.toJSON(a);u!==void 0&&Kl$2(c,u,l)},this.write.isJSONMapWriter=!0}toJSON(o){if(o==null)return null;if(this._apiToJSON.hasOwnProperty(o)){const s=this._apiToJSON[o];return this._options.useNumericKeys?+s:s}return this._options.ignoreUnknown?void 0:o}fromJSON(o){return o!=null&&this._jsonToAPI.hasOwnProperty(o)?this._jsonToAPI[o]:this._options.ignoreUnknown?void 0:o}};function sB$1(r){const o={};for(const s in r)o[r[s]]=s;return o}function zI$2(r){const o=[];for(const s in r)o.push(s);return o.sort(),o}function Ii$2(){return function(r,o){return new js$2(r,{ignoreUnknown:!0,...o})}}let J2$1=class{constructor(o,s,a,l,c,u){this.semiMajorAxis=o,this.flattening=s,this.outerAtmosphereRimWidth=a,this.atmosphereHeight=l,this.scaleHeight=c;const d=1-this.flattening;this.semiMinorAxis=this.semiMajorAxis*d,this.halfSemiMajorAxis=this.semiMajorAxis/2,this.halfCircumference=Math.PI*this.semiMajorAxis,this.metersPerDegree=this.halfCircumference/180,this.inverseFlattening=1/(1-this.flattening)-1,this.eccentricitySquared=u||2*this.flattening-this.flattening*this.flattening,this.meanRadiusSemiAxes=(2*this.semiMajorAxis+this.semiMinorAxis)/3}get radius(){return this.semiMajorAxis}};const Mi$2=new J2$1(6378137,1/298.257223563,3e5,1e5,.085,.006694379990137799),Hu$2=new J2$1(3396190,1/169.8944472236118,23e4,6e4,.111),Td$2=new J2$1(1737400,0,0,0,0),oB$1=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,aB$1={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function q2$1(r){const o=r?.match(oB$1);if(!o)return null;const[,s,a,l]=o;if(!s)return null;let c=null,u=null,d=null;const{devext:m,qaext:g,www:y}=aB$1;if(a)if(c=s,l)switch(l.toLowerCase()){case"devext":({customBaseUrl:u,portalHostname:d}=m);break;case"qa":({customBaseUrl:u,portalHostname:d}=g);break;default:return null}else({customBaseUrl:u,portalHostname:d}=y);else switch(s.toLowerCase()){case"devext":({customBaseUrl:u,portalHostname:d}=m);break;case"qaext":({customBaseUrl:u,portalHostname:d}=g);break;case"www":({customBaseUrl:u,portalHostname:d}=y);break;default:return null}return{customBaseUrl:u,isPortal:!1,portalHostname:d,urlKey:c}}function HI$2(r){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(r)}function Z2$1(r){const o=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,s=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,a=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return o.test(r)?r=r.replace(o,"https://www.arcgis.com"):s.test(r)?r=r.replace(s,"https://devext.arcgis.com"):a.test(r)&&(r=r.replace(a,"https://qaext.arcgis.com")),r}function WI$2(r){const o=atob(r),s=new Uint8Array(o.length);for(let a=0;aLe$1.getLogger("esri.core.urlUtils"),Wu$2=Ce$1.request,XI$2="esri/config: esriConfig.request.proxyUrl is not set.",YI$2=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,JI$2=/^\s*http:/i,uB$1=/^\s*https:/i,hB$1=/^\s*file:/i,pB$1=/:\d+$/,dB$1=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,fB$1=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),mB$1=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");let ic$3=class{constructor(o=""){this.uri=o,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let s=this.uri.match(fB$1);this.scheme=s[2]||(s[1]?"":null),this.authority=s[4]||(s[3]?"":null),this.path=s[5],this.query=s[7]||(s[6]?"":null),this.fragment=s[9]||(s[8]?"":null),this.authority!=null&&(s=this.authority.match(mB$1),this.user=s[3]||null,this.password=s[4]||null,this.host=s[6]||s[7],this.port=s[9]||null)}toString(){return this.uri}};const cy$2={},yB$1=new ic$3(Ce$1.applicationUrl);let fr$2=yB$1;const gB$1=bB$1();let Q2$1=gB$1;const K2$1=()=>fr$2,vB$1=()=>Q2$1;function bB$1(){const r=fr$2.path,o=r.slice(0,r.lastIndexOf("/")+1);return`${`${fr$2.scheme}://${fr$2.host}${fr$2.port!=null?`:${fr$2.port}`:""}`}${o}`}function Sa$2(r){if(!r)return null;const o={path:null,query:null},s=new ic$3(r),a=r.indexOf("?");return s.query===null?o.path=r:(o.path=r.slice(0,a),o.query=uy$2(s.query)),s.fragment&&(o.hash=s.fragment,s.query===null&&(o.path=o.path.slice(0,o.path.length-(s.fragment.length+1)))),o}function uy$2(r){const o=r.split("&"),s={};for(const a of o){if(!a)continue;const l=a.indexOf("=");let c,u;l<0?(c=decodeURIComponent(a),u=""):(c=decodeURIComponent(a.slice(0,l)),u=decodeURIComponent(a.slice(l+1)));let d=s[c];typeof d=="string"&&(d=s[c]=[d]),Array.isArray(d)?d.push(u):s[c]=u}return s}function Xu$2(r,o){return r?Object.keys(r).map(s=>{const a=r[s];if(a==null)return"";const l=encodeURIComponent(s)+"=",c=o?.[s];return c?l+encodeURIComponent(c(a)):Array.isArray(a)?a.map(u=>ly$2(u)?l+encodeURIComponent(JSON.stringify(u)):l+encodeURIComponent(u)).join("&"):ly$2(a)?l+encodeURIComponent(JSON.stringify(a)):l+encodeURIComponent(a)}).filter(s=>s).join("&"):""}function qI$2(r=!1){let o,s=Wu$2.proxyUrl;if(typeof r=="string"){o=eM$2(r);const a=Ad$2(r);a&&(s=a.proxyUrl)}else o=!!r;if(!s)throw cB$1().warn(XI$2),new oe("urlUtils:proxy-not-set",XI$2);return o&&s_$2()&&(s=fy$2(s)),Sa$2(s)}function _B$1(r,o=!1){const s=Ad$2(r);let a,l;if(s){const c=t_$2(s.proxyUrl);a=c.path,l=c.query?uy$2(c.query):null}else if(o){const c=qI$2(r);a=c.path,l=c.query}if(a){const c=Sa$2(r);r=a+"?"+c.path;const u=Xu$2({...l,...c.query});u&&(r=`${r}?${u}`)}return r}const Sd$2={path:"",query:""};function t_$2(r){const o=r.indexOf("?");return o!==-1?(Sd$2.path=r.slice(0,o),Sd$2.query=r.slice(o+1)):(Sd$2.path=r,Sd$2.query=null),Sd$2}function ZI$2(r){return r=(r=my$1(r=nM$2(r=t_$2(r).path),!0)).toLowerCase()}function wB$1(r){const o={proxyUrl:r.proxyUrl,urlPrefix:ZI$2(r.urlPrefix)},s=Wu$2.proxyRules,a=o.urlPrefix;let l=s.length;for(let c=0;c0?r.slice(0,o):r.replace(/\/+$/,"")}function e_$2(r,o=Wu$2.interceptors){const s=a=>a==null||a instanceof RegExp&&a.test(r)||typeof a=="string"&&r.startsWith(a);if(o){for(const a of o)if(Array.isArray(a.urls)){if(a.urls.some(s))return a}else if(s(a.urls))return a}return null}function sc$3(r,o,s=!1){if(!r||!o)return!1;const a=a_$2(r),l=a_$2(o);return!(!s&&a.scheme!==l.scheme)&&a.host!=null&&l.host!=null&&a.host.toLowerCase()===l.host.toLowerCase()&&a.port===l.port}function n_$2(r){if(typeof r=="string"){if(!Oi$2(r))return!0;r=a_$2(r)}if(sc$3(r,fr$2))return!0;const o=Wu$2.trustedServers||[];for(let s=0;s(w=_.indexOf(E,w))===-1?_.length:w;let m=d(l,"/",l.indexOf("//")+2),g=-1;for(;l.slice(0,m+1)===c.slice(0,m)+"/"&&(g=m+1,m!==l.length);)m=d(l,"/",m+1);if(g===-1||u&&g0)for(let _=0;_c?l.concat(c.split("/")):l,[]);for(let l=0;l0&&s[s.length-1]!==".."?s.pop():(!c&&l===a.length-1||c&&(c!=="."||s.length===0))&&s.push(c)}return s.join("/")}function Ni$2(r,o=!1){if(r==null||dy$2(r)||oc$2(r))return null;let s=r.indexOf("://");if(s===-1&&Lo$2(r))s=2;else{if(s===-1)return null;s+=3}const a=r.indexOf("/",s);return a!==-1&&(r=r.slice(0,a)),o&&(r=my$1(r,!0)),r}function Oi$2(r){return Lo$2(r)||i_$2(r)}function dy$2(r){return r!=null&&r.slice(0,5)==="blob:"}function oc$2(r){return r!=null&&r.slice(0,5)==="data:"}function KI$2(r){const o=Ju$2(r);return o?.isBase64?WI$2(o.data):null}function TB$1(r){return lB$1(r).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const SB$1=/^data:(.*?)(;base64)?,(.*)$/;function Ju$2(r){const o=r.match(SB$1);if(!o)return null;const[,s,a,l]=o;return{mediaType:s,isBase64:!!a,data:l}}function tM$2(r){return r.isBase64?`data:${r.mediaType};base64,${r.data}`:`data:${r.mediaType},${r.data}`}async function AB$1(r){return(await fetch(r)).blob()}function IB$1(r){const o=KI$2(r);if(!o)return null;const s=Ju$2(r);return new Blob([o],{type:s.mediaType})}function Lo$2(r){return r!=null&&r[0]==="/"&&r[1]==="/"}function i_$2(r){return r!=null&&YI$2.test(r)}function eM$2(r){return r!=null&&uB$1.test(r)||fr$2.scheme==="https"&&Lo$2(r)}function MB$1(r){return r!=null&&JI$2.test(r)||fr$2.scheme==="http"&&Lo$2(r)}function NB$1(r){return r!=null&&hB$1.test(r)}function fy$2(r){return Lo$2(r)?`https:${r}`:r.replace(JI$2,"https:")}function OB$1(){return fr$2.scheme==="http"}function s_$2(){return fr$2.scheme==="https"}function my$1(r,o=!1){return Lo$2(r)?r.slice(2):(r=r.replace(YI$2,""),o&&r.length>1&&r[0]==="/"&&r[1]==="/"&&(r=r.slice(2)),r)}function CB$1(r){const o=r.indexOf("//"),s=r.indexOf("/",o+2);return s===-1?r:r.slice(0,s)}function RB$1(r){let o=0;if(Oi$2(r)){const a=r.indexOf("//");a!==-1&&(o=a+2)}const s=r.lastIndexOf("/");return sa===l||a.endsWith(`.${l}`))||s_$2()&&!Ad$2(r))&&(r=fy$2(r)),r}function o_$2(r,o,s){if(!(o&&s&&r&&Oi$2(r)))return r;const a=r.indexOf("//"),l=r.indexOf("/",a+2),c=r.indexOf(":",a+2),u=Math.min(l<0?r.length:l,c<0?r.length:c);return r.slice(a+2,u).toLowerCase()!==o.toLowerCase()?r:`${r.slice(0,a+2)}${s}${r.slice(u)}`}function a_$2(r){return typeof r=="string"?new ic$3(Yu$2(r)):(r.scheme||(r.scheme=fr$2.scheme),r)}function FB$1(r){return VB$1.test(r)}function jB$1(r,o){const s=Sa$2(r),a=Object.keys(s.query||{});return a.length>0&&o&&o.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${a.join(", ")}.`),s.path}function UB$1(r,o,s){const a=Sa$2(r),l=a.query||{};return l[o]=String(s),`${a.path}?${Xu$2(l)}`}function yy$2(r,o){if(!o)return r;const s=Sa$2(r),a=s.query||{};for(const[c,u]of Object.entries(o))u!=null&&(a[c]=u);const l=Xu$2(a);return l?`${s.path}?${l}`:s.path}function $B$1(r){if(r==null)return null;const o=r.match(iM$2);return o?o[2]:null}function rM$2(r){if(r==null)return null;const o=r.match(iM$2);return o?{path:o[1],extension:o[2]}:{path:r,extension:null}}async function BB$1(r){return typeof r=="string"?Ju$2(r)??{data:r}:new Promise((o,s)=>{const a=new FileReader;a.readAsDataURL(r),a.onload=()=>o(Ju$2(a.result)),a.onerror=l=>s(l)})}const iM$2=/([^.]*)\.([^/]*)$/,VB$1=/(^data:image\/svg|\.svg$)/i;Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const sM$2="4.31";let Ve$2,oM$2=sM$2;oM$2="4.31.6";function zB$1(r){Ve$2=r}function HB$1(r){const o=Ve$2?.findCredential(r);return o?.token?UB$1(r,"token",o.token):r}ut$1("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),ut$1("host-webworker");const WB$1=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]);function XB$1(r){const o=Ni$2(r,!0);return!!o&&o.endsWith(".arcgis.com")&&!WB$1.has(o)&&!r.endsWith("/sharing/rest/generateToken")}function aM$2(r,o){return!(!Ce$1.apiKey||!XB$1(r))}function lM$2(r,o,s=!1,a){return new Promise((l,c)=>{if(xa$2(a))return void c(cM$2());let u=()=>{g(),c(new Error(`Unable to load ${o}`))},d=()=>{const y=r;g(),l(y)},m=()=>{if(!r)return;const y=r;g(),y.src="",c(cM$2())};const g=()=>{ut$1("esri-image-decode")||(r.removeEventListener("error",u),r.removeEventListener("load",d)),u=null,d=null,r=null,a?.removeEventListener("abort",m),m=null,s&&URL.revokeObjectURL(o)};a?.addEventListener("abort",m),ut$1("esri-image-decode")?r.decode().then(d,u):(r.addEventListener("error",u),r.addEventListener("load",d))})}function cM$2(){try{return new DOMException("Aborted","AbortError")}catch{const r=new Error;return r.name="AbortError",r}}const uM$2="Timeout exceeded";function YB$1(){return new Error(uM$2)}function JB$1(r){return typeof r=="object"&&!!r&&"message"in r&&r.message===uM$2}function qB$1(r){Ce$1.request.crossOriginNoCorsDomains||(Ce$1.request.crossOriginNoCorsDomains={});const o=Ce$1.request.crossOriginNoCorsDomains;for(let s of r)s=s.toLowerCase(),/^https?:\/\//.test(s)?o[Ni$2(s)??""]=0:(o[Ni$2("http://"+s)??""]=0,o[Ni$2("https://"+s)??""]=0)}function ZB$1(r){const o=Ce$1.request.crossOriginNoCorsDomains;if(o){let s=Ni$2(r);if(s)return s=s.toLowerCase(),!sc$3(s,K2$1())&&o[s]({data:E,getAllHeaders:qu$2,getHeader:qu$2,httpStatus:200,requestOptions:l.requestOptions,url:l.url}),u=e_$2(r,Ci$1.internalInterceptors);if(u){const E=await fM$2(u,l);if(E!=null)return c(E)}let d=e_$2(r);if(d){const E=await fM$2(d,l);if(E!=null)return c(E);d.after||d.error||(d=null)}if(r=l.url,(o=l.requestOptions).responseType==="image"&&(ut$1("host-webworker")||ut$1("host-node")))throw Us$2("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),l);if(o.method==="head"){if(o.body)throw Us$2("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),l);if(s||a)throw Us$2("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),l)}if(await rV$2(),gy$2)return gy$2.execute(r,o);const m=new AbortController,g=Ea$1(o,()=>m.abort()),y={controller:m,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:d,params:l,redoRequest:!1,useIdentity:Ci$1.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},_=await aV$2(y).finally(()=>g?.remove());return d?.after?.(_),_}let gy$2;const Ci$1=Ce$1.request,hM$2="FormData"in globalThis,KB$1=new Set([499,498,403,401]),tV$2=new Set(["COM_0056","COM_0057","SB_0008"]),eV$2=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],qu$2=()=>null,vy$2=Symbol();function nV$2(r){const o=Ni$2(r);o&&!fn$2._corsServers.includes(o)&&fn$2._corsServers.push(o)}function pM$2(r){const o=Ni$2(r);return!o||o.endsWith(".arcgis.com")||fn$2._corsServers.includes(o)||n_$2(o)}function Us$2(r,o,s,a){let l="Error";const c={url:s.url,requestOptions:s.requestOptions,getAllHeaders:qu$2,getHeader:qu$2,ssl:!1};if(o instanceof oe)return o.details?(o.details=gt$3(o.details),o.details.url=s.url,o.details.requestOptions=s.requestOptions):o.details=c,o;if(o){const u=a&&(()=>Array.from(a.headers)),d=a&&(y=>a.headers.get(y)),m=a?.status,g=o.message;g&&(l=g),u&&d&&(c.getAllHeaders=u,c.getHeader=d),c.httpStatus=(o.httpCode!=null?o.httpCode:o.code)||m||0,c.subCode=o.subcode,c.messageCode=o.messageCode,typeof o.details=="string"?c.messages=[o.details]:c.messages=o.details,c.raw=vy$2 in o?o[vy$2]:o}return Vu$1(o)?Vr$2():new oe(r,l,c)}async function rV$2(){ut$1("host-webworker")&&!gy$2&&(gy$2=await __vitePreload(()=>import("./request-5gjwL9xx-Dmln4FAp.js"),[],import.meta.url))}async function l_$2(){Ve$2||await __vitePreload(()=>import("./IdentityManager-DCHYmv7j-Du2I-Uqb.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)}async function iV$2(r){const o=r.params.url,s=r.params.requestOptions,a=r.controller.signal,l=s.body;let c=null,u=null;if(hM$2&&"HTMLFormElement"in globalThis&&(l instanceof FormData?c=l:l instanceof HTMLFormElement&&(c=new FormData(l))),typeof l=="string"&&(u=l),r.fetchOptions={cache:s.cacheBust?"no-cache":"default",credentials:"same-origin",headers:s.headers||{},method:s.method==="head"?"HEAD":"GET",mode:"cors",priority:Ci$1.priority,redirect:"follow",signal:a},(c||u)&&(r.fetchOptions.body=c||u),s.authMode==="anonymous"&&(r.useIdentity=!1),r.hasToken=!!(/token=/i.test(o)||s.query?.token||c?.get("token")),!r.hasToken&&aM$2(o)&&(s.query||(s.query={}),s.query.token=Ce$1.apiKey,r.hasToken=!0),r.useIdentity&&!r.hasToken&&!r.credentialToken&&!dM$2(o)&&!xa$2(a)){let d;s.authMode==="immediate"?(await l_$2(),d=await Ve$2.getCredential(o,{signal:a}),r.credential=d):s.authMode==="no-prompt"?(await l_$2(),d=await Ve$2.getCredential(o,{prompt:!1,signal:a}).catch(()=>{}),r.credential=d):Ve$2&&(d=Ve$2.findCredential(o)),d&&(r.credentialToken=d.token,r.useSSL=!!d.ssl)}}function dM$2(r){return eV$2.some(o=>o.test(r))}async function sV$2(r){let o=r.params.url;const s=r.params.requestOptions,a=r.fetchOptions??{},l=dy$2(o)||oc$2(o),c=s.responseType||"json",u=l?0:s.timeout!=null?s.timeout:Ci$1.timeout;let d=!1;if(!l){r.useSSL&&(o=fy$2(o));let E={...s.query};r.credentialToken&&(E.token=r.credentialToken);let w=Xu$2(E);ut$1("esri-url-encodes-apostrophe")&&(w=w.replaceAll("'","%27"));const T=o.length+1+w.length;let k;d=s.method==="delete"||s.method==="post"||s.method==="put"||!!s.body||T>Ci$1.maxUrlLength;const O=s.useProxy||!!Ad$2(o);if(O){const R=qI$2(o);k=R.path,!d&&k.length+1+T>Ci$1.maxUrlLength&&(d=!0),R.query&&(E={...R.query,...E})}if(a.method==="HEAD"&&(d||O)){if(d)throw T>Ci$1.maxUrlLength?Us$2("request:invalid-parameters",new Error("URL exceeds maximum length"),r.params):Us$2("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),r.params);if(O)throw Us$2("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),r.params)}d?(a.method=s.method==="delete"?"DELETE":s.method==="put"?"PUT":"POST",s.body?o=yy$2(o,E):(a.body=Xu$2(E),a.headers||(a.headers={}),a.headers["Content-Type"]="application/x-www-form-urlencoded")):o=yy$2(o,E),O&&(r.useProxy=!0,o=`${k}?${o}`),E.token&&hM$2&&a.body instanceof FormData&&!HI$2(o)&&a.body.set("token",E.token),s.hasOwnProperty("withCredentials")?r.withCredentials=s.withCredentials:sc$3(o,K2$1())||(n_$2(o)||Ve$2&&Ve$2.findServerInfo(o)?.webTierAuth)&&(r.withCredentials=!0),r.withCredentials&&(a.credentials="include",ZB$1(o)&&await QB$1(d?yy$2(o,E):o))}let m,g,y=0,_=!1;u>0&&(y=setTimeout(()=>{_=!0,r.controller.abort()},u));try{if(s.responseType==="native-request-init")g=a,g.url=o,s.signal?g.signal=s.signal:delete g.signal;else if(s.responseType!=="image"||a.cache!=="default"||a.method!=="GET"||d||oV$2(s.headers)||!l&&!r.useProxy&&Ci$1.proxyUrl&&!pM$2(o)){if(fn$2._beforeFetch&&await fn$2._beforeFetch(o,a),m=await fetch(o,a),fn$2._afterFetch&&await fn$2._afterFetch(m),r.useProxy||nV$2(o),s.responseType==="native")g=m;else if(a.method!=="HEAD")if(m.ok){switch(c){case"array-buffer":g=await m.arrayBuffer();break;case"blob":case"image":g=await m.blob();break;default:g=await m.text()}if(y&&(clearTimeout(y),y=0),c==="json"||c==="xml"||c==="document")if(g)switch(c){case"json":g=JSON.parse(g);break;case"xml":g=mM$2(g,"application/xml");break;case"document":g=mM$2(g,"text/html")}else g=null;if(g){if(c==="array-buffer"||c==="blob"){const E=m.headers.get("Content-Type");if(E&&/application\/json|text\/plain/i.test(E)&&g[c==="blob"?"size":"byteLength"]<=750)try{const w=await new Response(g).json();w.error&&(g=w)}catch{}}c==="image"&&g instanceof Blob&&(g=await yM$2(URL.createObjectURL(g),r,!0))}}else{g=await m.text();try{g=JSON.parse(g)}catch{}}}else g=await yM$2(o,r)}catch(E){if(E.name==="AbortError")throw _?YB$1():Vr$2("Request canceled");if(!(!m&&E instanceof TypeError&&Ci$1.proxyUrl)||s.body||s.method==="delete"||s.method==="head"||s.method==="post"||s.method==="put"||r.useProxy||pM$2(o))throw E;r.redoRequest=!0,wB$1({proxyUrl:Ci$1.proxyUrl,urlPrefix:Ni$2(o)??""})}finally{y&&clearTimeout(y)}return[m,g]}async function fM$2(r,o){if(r.responseData!=null)return r.responseData;if(r.headers&&(o.requestOptions.headers={...o.requestOptions.headers,...r.headers}),r.query&&(o.requestOptions.query={...o.requestOptions.query,...r.query}),r.before){let s,a;try{a=await r.before(o)}catch(l){s=Us$2("request:interceptor",l,o)}if((a instanceof Error||a instanceof oe)&&(s=Us$2("request:interceptor",a,o)),s)throw r.error&&r.error(s),s;return a}}function oV$2(r){if(r){for(const o of Object.getOwnPropertyNames(r))if(r[o])return!0}return!1}function mM$2(r,o){let s;try{s=new DOMParser().parseFromString(r,o)}catch{}if(!s||s.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return s}async function aV$2(r){let o,s;await iV$2(r);try{do[o,s]=await sV$2(r);while(!await lV$2(r,o,s))}catch(c){const u=Us$2("request:server",c,r.params,o);throw u.details.ssl=r.useSSL,r.interceptor?.error&&r.interceptor.error(u),u}const a=r.params.url;if(s&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(a)){if(!r.hasToken&&!r.credentialToken&&s.user?.username&&!n_$2(a)){const c=Ni$2(a,!0);c&&Ci$1.trustedServers.push(c)}Array.isArray(s.authorizedCrossOriginNoCorsDomains)&&qB$1(s.authorizedCrossOriginNoCorsDomains)}const l=r.credential;if(l&&Ve$2){let c=Ve$2.findServerInfo(l.server)?.owningSystemUrl;if(c){c=c.replace(/\/?$/,"/sharing");const u=Ve$2.findCredential(c,l.userId);u&&Ve$2._getIdenticalSvcIdx(c,u)===-1&&u.resources.unshift(c)}}return{data:s,getAllHeaders:o?()=>Array.from(o.headers):qu$2,getHeader:o?c=>o.headers.get(c):qu$2,httpStatus:o?.status??200,requestOptions:r.params.requestOptions,ssl:r.useSSL,url:r.params.url}}async function lV$2(r,o,s){if(r.redoRequest)return r.redoRequest=!1,!1;const a=r.params.requestOptions;if(!o||a.responseType==="native"||a.responseType==="native-request-init")return!0;let l,c;if(s&&(s.error&&typeof s.error=="object"?l=s.error:s.status==="error"&&Array.isArray(s.messages)&&(l={...s},l[vy$2]=s,l.details=s.messages)),!l&&!o.ok)throw l=new Error(`Unable to load ${o.url} status: ${o.status}`),l[vy$2]=s,l;let u,d=null;l&&(c=Number(l.code),d=l.hasOwnProperty("subcode")?Number(l.subcode):null,u=l.messageCode,u=u?.toUpperCase());const m=a.authMode;if(c===403&&(d===4||l.message?.toLowerCase().includes("ssl")&&!l.message.toLowerCase().includes("permission"))){if(!r.useSSL)return r.useSSL=!0,!1}else if(!r.hasToken&&r.useIdentity&&(m!=="no-prompt"||c===498)&&c!==void 0&&KB$1.has(c)&&!dM$2(r.params.url)&&(c!==403||(!u||!tV$2.has(u))&&(d==null||d===2&&r.credentialToken))){await l_$2();try{const g=await Ve$2.getCredential(r.params.url,{error:Us$2("request:server",l,r.params),prompt:m!=="no-prompt",signal:r.controller.signal,token:r.credentialToken});return r.credential=g,r.credentialToken=g.token,r.useSSL=r.useSSL||g.ssl,!1}catch(g){if(m==="no-prompt")return r.credential=void 0,r.credentialToken=void 0,!1;l=g}}if(l)throw l;return!0}function yM$2(r,o,s=!1){const a=o.controller.signal,l=new Image;return o.withCredentials?l.crossOrigin="use-credentials":l.crossOrigin="anonymous",l.alt="",l.fetchPriority=Ci$1.priority,l.src=r,lM$2(l,r,s,a)}fn$2._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"],fn$2._beforeFetch=void 0,fn$2._afterFetch=void 0;function c_$2(r){if(!Ce$1.assetsPath)throw Le$1.getLogger("esri.assets").errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new oe("assets:path-not-set","config.assetsPath is not set");return py$2(Ce$1.assetsPath,r)}let u_$2,X$1=null;function gM$2(){return!!X$1}function cV$2(){return!!ut$1("esri-wasm")}function vM$2(){return u_$2||(u_$2=__vitePreload(()=>import("./pe-wasm-tEsgvglo-iUyVeBlJ.js"),__vite__mapDeps([4,5]),import.meta.url).then(r=>r.p).then(({default:r})=>r({locateFile:o=>c_$2(`esri/geometry/support/${o}`)})).then(r=>{wM$2(r)}),u_$2)}var by$2,ze$1;(function(r){function o(c,u,d){X$1.ensureCache.prepare();const m=ac$3(d),g=d===m,y=X$1.ensureFloat64(m),_=X$1._pe_geog_to_proj(X$1.getPointer(c),u,y);return _&&Aa$1(d,u,y,g),_}function s(c,u,d,m){switch(m){case ze$1.PE_TRANSFORM_P_TO_G:return a(c,u,d);case ze$1.PE_TRANSFORM_G_TO_P:return o(c,u,d)}return 0}function a(c,u,d){return l(c,u,d,0)}function l(c,u,d,m){X$1.ensureCache.prepare();const g=ac$3(d),y=d===g,_=X$1.ensureFloat64(g),E=X$1._pe_proj_to_geog_center(X$1.getPointer(c),u,_,m);return E&&Aa$1(d,u,_,y),E}r.geogToProj=o,r.projGeog=s,r.projToGeog=a,r.projToGeogCenter=l})(by$2||(by$2={})),function(r){function o(){r.PE_BUFFER_MAX=X$1.PeDefs.prototype.PE_BUFFER_MAX,r.PE_NAME_MAX=X$1.PeDefs.prototype.PE_NAME_MAX,r.PE_MGRS_MAX=X$1.PeDefs.prototype.PE_MGRS_MAX,r.PE_USNG_MAX=X$1.PeDefs.prototype.PE_USNG_MAX,r.PE_DD_MAX=X$1.PeDefs.prototype.PE_DD_MAX,r.PE_DDM_MAX=X$1.PeDefs.prototype.PE_DDM_MAX,r.PE_DMS_MAX=X$1.PeDefs.prototype.PE_DMS_MAX,r.PE_UTM_MAX=X$1.PeDefs.prototype.PE_UTM_MAX,r.PE_PARM_MAX=X$1.PeDefs.prototype.PE_PARM_MAX,r.PE_TYPE_NONE=X$1.PeDefs.prototype.PE_TYPE_NONE,r.PE_TYPE_GEOGCS=X$1.PeDefs.prototype.PE_TYPE_GEOGCS,r.PE_TYPE_PROJCS=X$1.PeDefs.prototype.PE_TYPE_PROJCS,r.PE_TYPE_GEOGTRAN=X$1.PeDefs.prototype.PE_TYPE_GEOGTRAN,r.PE_TYPE_COORDSYS=X$1.PeDefs.prototype.PE_TYPE_COORDSYS,r.PE_TYPE_UNIT=X$1.PeDefs.prototype.PE_TYPE_UNIT,r.PE_TYPE_LINUNIT=X$1.PeDefs.prototype.PE_TYPE_LINUNIT,r.PE_STR_OPTS_NONE=X$1.PeDefs.prototype.PE_STR_OPTS_NONE,r.PE_STR_AUTH_NONE=X$1.PeDefs.prototype.PE_STR_AUTH_NONE,r.PE_STR_AUTH_TOP=X$1.PeDefs.prototype.PE_STR_AUTH_TOP,r.PE_STR_NAME_CANON=X$1.PeDefs.prototype.PE_STR_NAME_CANON,r.PE_STR_FMT_WKT=X$1.PeDefs.prototype.PE_STR_FMT_WKT,r.PE_STR_FMT_WKT2=X$1.PeDefs.prototype.PE_STR_FMT_WKT2,r.PE_PARM_X0=X$1.PeDefs.prototype.PE_PARM_X0,r.PE_PARM_ND=X$1.PeDefs.prototype.PE_PARM_ND,r.PE_TRANSFORM_1_TO_2=X$1.PeDefs.prototype.PE_TRANSFORM_1_TO_2,r.PE_TRANSFORM_2_TO_1=X$1.PeDefs.prototype.PE_TRANSFORM_2_TO_1,r.PE_TRANSFORM_P_TO_G=X$1.PeDefs.prototype.PE_TRANSFORM_P_TO_G,r.PE_TRANSFORM_G_TO_P=X$1.PeDefs.prototype.PE_TRANSFORM_G_TO_P,r.PE_HORIZON_RECT=X$1.PeDefs.prototype.PE_HORIZON_RECT,r.PE_HORIZON_POLY=X$1.PeDefs.prototype.PE_HORIZON_POLY,r.PE_HORIZON_LINE=X$1.PeDefs.prototype.PE_HORIZON_LINE,r.PE_HORIZON_DELTA=X$1.PeDefs.prototype.PE_HORIZON_DELTA}r.init=o}(ze$1||(ze$1={}));let bM$2=null;var _y$2;(function(r){const o={},s={},a=w=>{const T=w.getType();switch(T){case ze$1.PE_TYPE_GEOGCS:w=X$1.castObject(w,X$1.PeGeogcs);break;case ze$1.PE_TYPE_PROJCS:w=X$1.castObject(w,X$1.PeProjcs);break;case ze$1.PE_TYPE_GEOGTRAN:w=X$1.castObject(w,X$1.PeGeogtran);break;default:T&ze$1.PE_TYPE_UNIT&&(w=X$1.castObject(w,X$1.PeUnit))}return w};function l(){X$1.PeFactory.prototype.initialize(null)}function c(w){return u(ze$1.PE_TYPE_COORDSYS,w)}function u(w,T){let k=null,O=o[w];if(O||(O={},o[w]=O),O.hasOwnProperty(String(T))&&(k=O[T],X$1.compare(k,X$1.NULL)&&(k=null)),!k){const R=X$1.PeFactory.prototype.factoryByType(w,T);X$1.compare(R,X$1.NULL)||(k=a(R),O[T]=k)}return k}function d(w,T){let k=null,O=s[w];if(O||(O={},s[w]=O),O.hasOwnProperty(T)&&(k=O[T],X$1.compare(k,X$1.NULL)&&(k=null)),!k){const R=X$1.PeFactory.prototype.fromString(w,T);X$1.compare(R,X$1.NULL)||(k=a(R),O[T]=k)}return k}function m(w){return u(ze$1.PE_TYPE_GEOGCS,w)}function g(w){return u(ze$1.PE_TYPE_GEOGTRAN,w)}function y(w){return X$1.PeFactory.prototype.getCode(w)}function _(w){return u(ze$1.PE_TYPE_PROJCS,w)}function E(w){return u(ze$1.PE_TYPE_UNIT,w)}r.initialize=l,r.coordsys=c,r.factoryByType=u,r.fromString=d,r.geogcs=m,r.geogtran=g,r.getCode=y,r.projcs=_,r.unit=E})(_y$2||(_y$2={}));let _M$2=null;var wy$2,h_$2,xy$2,p_$2,d_$2,Ey$2,Ty$2,f_$2,Sy$2,Id$1,m_$2;function wM$2(r){function o(c,u,d){c[u]=d(c[u])}X$1=r,ze$1.init(),wy$2.init(),Ty$2.init(),Sy$2.init(),Id$1.init(),bM$2=class extends X$1.PeDouble{constructor(c=NaN){super(c)}destroy(){X$1.destroy(this)}[Symbol.dispose](){this.destroy()}},_M$2=class extends X$1.PeGCSExtent{destroy(){X$1.destroy(this)}[Symbol.dispose](){this.destroy()}};const s=[X$1.PeAngunit,X$1.PeDatum,X$1.PeGeogcs,X$1.PeGeogtran,X$1.PeObject,X$1.PeParameter,X$1.PePrimem,X$1.PeProjcs,X$1.PeSpheroid,X$1.PeUnit];for(const c of s)o(c.prototype,"getName",u=>function(){return u.call(this,new Array(ze$1.PE_NAME_MAX))});for(const c of[X$1.PeGeogtran,X$1.PeProjcs])o(c.prototype,"getParameters",u=>function(){const d=new Array(ze$1.PE_PARM_MAX);let m=u.call(this);for(let g=0;gfunction(u=!1){const d=this.getSize();if(!d)return null;const m=[];return Aa$1(m,d,c.call(this),u),m}),o(X$1.PeGTlistExtendedEntry.prototype,"getEntries",c=>{const u=X$1._pe_getPeGTlistExtendedGTsSize();return function(){let d=null;const m=c.call(this);if(!X$1.compare(m,X$1.NULL)){d=[m];const g=this.getSteps();if(g>1){const y=X$1.getPointer(m);for(let _=1;_function(){let u=this._cache;if(u||(u=new Map,this._cache=u),u.has(c))return u.get(c);let d=null;const m=c.call(this);if(!X$1.compare(m,X$1.NULL)){d=[m];const g=m.getNump();if(g>1){const y=X$1.getPointer(m);for(let _=1;_1)){const w=X$1.getPointer(E);for(let T=1;T{ss$2(l);const c=l.getGeogtran();ss$2(c),c.getParameters().forEach(ss$2),[c.getGeogcs1(),c.getGeogcs2()].forEach(u=>{ss$2(u);const d=u.getDatum();ss$2(d),ss$2(d.getSpheroid()),ss$2(u.getPrimem()),ss$2(u.getUnit())})});X$1.PeGTlistExtendedEntry.prototype.Delete(s[0])}}r.destroy=o}(h_$2||(h_$2={})),function(r){function o(s,a,l,c,u){X$1.ensureCache.prepare();const d=ac$3(l),m=l===d,g=X$1.ensureFloat64(d);let y=0;c&&(y=X$1.ensureFloat64(c));const _=X$1._pe_geog_to_geog(X$1.getPointer(s),a,g,y,u);return _&&Aa$1(l,a,g,m),_}r.geogToGeog=o}(xy$2||(xy$2={})),function(r){function o(c,u,d,m,g,y,_,E){X$1.PeLineType.prototype.geodesic_coordinate(c,u,d,m,g,y,_,E)}function s(c,u,d,m,g,y,_,E,w){X$1.PeLineType.prototype.geodetic_coordinate(c,u,d,m,g,y,_,E,w)}function a(c,u,d,m,g,y,_,E,w,T){X$1.PeLineType.prototype.geodetic_distance(c,u,d,m,g,y,_,E,w,T)}function l(c,u,d,m,g,y,_,E,w){X$1.PeLineType.prototype.great_elliptic_distance(c,u,d,m,g,y,_,E,w)}r.geodesicCoordinate=o,r.geodeticCoordinate=s,r.geodeticDistance=a,r.greatEllipticDistance=l}(p_$2||(p_$2={})),function(r){function o(u,d){return X$1.PeMath.prototype.phi_to_eta(u,d)}function s(u,d){return X$1.PeMath.prototype.eta_to_phi(u,d)}function a(u,d){return X$1.PeMath.prototype.phi_to_phig(u,d)}function l(u,d,m){return X$1.PeMath.prototype.q(u,d,m)}function c(u,d){return X$1.PeMath.prototype.q90(u,d)}r.phiToEta=o,r.etaToPhi=s,r.phiToPhig=a,r.q=l,r.q90=c}(d_$2||(d_$2={})),function(r){const o=(g,y,_,E,w,T)=>{let k,O;switch(X$1.ensureCache.prepare(),g){case"dd":k=X$1._pe_geog_to_dd,O=ze$1.PE_DD_MAX;break;case"ddm":k=X$1._pe_geog_to_ddm,O=ze$1.PE_DDM_MAX;break;case"dms":k=X$1._pe_geog_to_dms,O=ze$1.PE_DMS_MAX}let R=0;y&&(R=X$1.getPointer(y));const M=ac$3(E),N=X$1.ensureFloat64(M),D=Ay$2(_,O),P=k(R,_,N,w,X$1.ensureInt32(D));if(P)for(let I=0;I<_;I++)T[I]=X$1.UTF8ToString(D[I]);return P},s=(g,y,_,E,w)=>{let T;switch(X$1.ensureCache.prepare(),g){case"dd":T=X$1._pe_dd_to_geog;break;case"ddm":T=X$1._pe_ddm_to_geog;break;case"dms":T=X$1._pe_dms_to_geog}let k=0;y&&(k=X$1.getPointer(y));const O=E.map(D=>X$1.ensureString(D)),R=X$1.ensureInt32(O),M=X$1.ensureFloat64(new Array(2*_)),N=T(k,_,R,M);return N&&Aa$1(w,_,M),N};function a(g,y,_,E,w){return o("dms",g,y,_,E,w)}function l(g,y,_,E){return s("dms",g,y,_,E)}function c(g,y,_,E,w){return o("ddm",g,y,_,E,w)}function u(g,y,_,E){return s("ddm",g,y,_,E)}function d(g,y,_,E,w){return o("dd",g,y,_,E,w)}function m(g,y,_,E){return s("dd",g,y,_,E)}r.geogToDms=a,r.dmsToGeog=l,r.geogToDdm=c,r.ddmToGeog=u,r.geogToDd=d,r.ddToGeog=m}(Ey$2||(Ey$2={})),function(r){function o(){r.PE_MGRS_STYLE_NEW=X$1.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,r.PE_MGRS_STYLE_OLD=X$1.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,r.PE_MGRS_STYLE_AUTO=X$1.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,r.PE_MGRS_180_ZONE_1_PLUS=X$1.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,r.PE_MGRS_ADD_SPACES=X$1.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function s(l,c,u,d,m,g,y){X$1.ensureCache.prepare();let _=0;l&&(_=X$1.getPointer(l));const E=ac$3(u),w=X$1.ensureFloat64(E),T=Ay$2(c,ze$1.PE_MGRS_MAX),k=X$1.ensureInt32(T),O=X$1._pe_geog_to_mgrs_extended(_,c,w,d,m,g,k);if(O)for(let R=0;RX$1.ensureString(T)),_=X$1.ensureInt32(y),E=X$1.ensureFloat64(new Array(2*c)),w=X$1._pe_mgrs_to_geog_extended(g,c,_,d,E);return w&&Aa$1(m,c,E),w}r.init=o,r.geogToMgrsExtended=s,r.mgrsToGeogExtended=a}(Ty$2||(Ty$2={})),function(r){function o(a,l,c,u,d,m,g){X$1.ensureCache.prepare();let y=0;a&&(y=X$1.getPointer(a));const _=ac$3(c),E=X$1.ensureFloat64(_),w=Ay$2(l,ze$1.PE_MGRS_MAX),T=X$1.ensureInt32(w),k=X$1._pe_geog_to_usng(y,l,E,u,d,m,T);if(k)for(let O=0;OX$1.ensureString(E)),g=X$1.ensureInt32(m),y=X$1.ensureFloat64(new Array(2*l)),_=X$1._pe_usng_to_geog(d,l,g,y);return _&&Aa$1(u,l,y),_}r.geogToUsng=o,r.usngToGeog=s}(f_$2||(f_$2={})),function(r){function o(){r.PE_UTM_OPTS_NONE=X$1.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,r.PE_UTM_OPTS_ADD_SPACES=X$1.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,r.PE_UTM_OPTS_NS=X$1.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function s(l,c,u,d,m){X$1.ensureCache.prepare();let g=0;l&&(g=X$1.getPointer(l));const y=ac$3(u),_=X$1.ensureFloat64(y),E=Ay$2(c,ze$1.PE_UTM_MAX),w=X$1.ensureInt32(E),T=X$1._pe_geog_to_utm(g,c,_,d,w);if(T)for(let k=0;kX$1.ensureString(T)),_=X$1.ensureInt32(y),E=X$1.ensureFloat64(new Array(2*c)),w=X$1._pe_utm_to_geog(g,c,_,d,E);return w&&Aa$1(m,c,E),w}r.init=o,r.geogToUtm=s,r.utmToGeog=a}(Sy$2||(Sy$2={})),function(r){const o=new Map;function s(){r.PE_PCSINFO_OPTION_NONE=X$1.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,r.PE_PCSINFO_OPTION_DOMAIN=X$1.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,r.PE_POLE_OUTSIDE_BOUNDARY=X$1.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,r.PE_POLE_POINT=X$1.PePCSInfo.prototype.PE_POLE_POINT}function a(l,c=r.PE_PCSINFO_OPTION_DOMAIN){let u=null,d=null;return o.has(l)&&(d=o.get(l),d[c]&&(u=d[c])),u||(u=X$1.PePCSInfo.prototype.generate(l,c),d||(d=[],o.set(l,d)),d[c]=u),u}r.init=s,r.generate=a}(Id$1||(Id$1={})),function(r){function o(){return X$1.PeVersion.prototype.version_string()}r.versionString=o}(m_$2||(m_$2={}));const uV$2=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return by$2},get PeDefs(){return ze$1},get PeDouble(){return bM$2},get PeFactory(){return _y$2},get PeGCSExtent(){return _M$2},get PeGTTransformations(){return xy$2},get PeGTlistExtended(){return wy$2},get PeGTlistExtendedEntry(){return h_$2},get PeLineType(){return p_$2},get PeMath(){return d_$2},get PeNotationDms(){return Ey$2},get PeNotationMgrs(){return Ty$2},get PeNotationUsng(){return f_$2},get PeNotationUtm(){return Sy$2},get PePCSInfo(){return Id$1},get PeVersion(){return m_$2},_init:wM$2,get _pe(){return X$1},isLoaded:gM$2,isSupported:cV$2,load:vM$2},Symbol.toStringTag,{value:"Module"}));var lc$2;(function(r){r[r.CGCS2000=4490]="CGCS2000",r[r.GCSMARS2000=104971]="GCSMARS2000",r[r.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",r[r.GCSMOON2000=104903]="GCSMOON2000"})(lc$2||(lc$2={}));let h;const C={values:[1,.3048,.3048006096012192,.3047972654,.9143917962,.201166195164,.9143984146160287,.3047994715386762,20.11676512155263,20.11678249437587,.9143985307444408,.91439523,.3047997101815088,20.1168,20.116756,5e4,15e4],units:["Meter","Foot","Foot_US","Foot_Clarke","Yard_Clarke","Link_Clarke","Yard_Sears","Foot_Sears","Chain_Sears","Chain_Benoit_1895_B","Yard_Indian","Yard_Indian_1937","Foot_Gold_Coast","Chain","Chain_Sears_1922_Truncated","50_Kilometers","150_Kilometers"],2066:5,2136:12,2155:2,2157:0,2158:0,2159:12,2160:12,2204:2,2219:0,2220:0,2254:2,2255:2,2256:1,2265:1,2266:1,2267:2,2268:2,2269:1,2270:1,2271:2,2272:2,2273:1,2294:0,2295:0,2314:3,2899:2,2900:2,2901:1,2909:1,2910:1,2911:2,2912:2,2913:1,2914:1,2992:1,2993:0,2994:1,3080:1,3089:2,3090:0,3091:2,3102:2,3141:0,3142:0,3167:14,3359:2,3360:0,3361:1,3362:0,3363:2,3364:0,3365:2,3366:3,3404:2,3405:0,3406:0,3407:3,3439:0,3440:0,3479:1,3480:0,3481:1,3482:0,3483:1,3484:0,3485:2,3486:0,3487:2,3488:0,3489:0,3490:2,3491:0,3492:2,3493:0,3494:2,3495:0,3496:2,3497:0,3498:2,3499:0,3500:2,3501:0,3502:2,3503:0,3504:2,3505:0,3506:2,3507:0,3508:2,3509:0,3510:2,3511:0,3512:2,3513:0,3514:0,3515:2,3516:0,3517:2,3518:0,3519:2,3520:0,3521:2,3522:0,3523:2,3524:0,3525:2,3526:0,3527:2,3528:0,3529:2,3530:0,3531:2,3532:0,3533:2,3534:0,3535:2,3536:0,3537:2,3538:0,3539:2,3540:0,3541:2,3542:0,3543:2,3544:0,3545:2,3546:0,3547:2,3548:0,3549:2,3550:0,3551:2,3552:0,3553:2,3582:2,3583:0,3584:2,3585:0,3586:2,3587:0,3588:1,3589:0,3590:1,3591:0,3592:0,3593:1,3598:2,3599:0,3600:2,3605:1,3606:0,3607:0,3608:2,3609:0,3610:2,3611:0,3612:2,3613:0,3614:2,3615:0,3616:2,3617:0,3618:2,3619:0,3620:2,3621:0,3622:2,3623:0,3624:2,3625:0,3626:2,3627:0,3628:2,3629:0,3630:2,3631:0,3632:2,3633:0,3634:1,3635:0,3636:1,3640:2,3641:0,3642:2,3643:0,3644:1,3645:0,3646:1,3647:0,3648:1,3649:0,3650:2,3651:0,3652:2,3653:0,3654:2,3655:0,3656:1,3657:0,3658:2,3659:0,3660:2,3661:0,3662:2,3663:0,3664:2,3668:2,3669:0,3670:2,3671:0,3672:2,3673:0,3674:2,3675:0,3676:1,3677:2,3678:0,3679:1,3680:2,3681:0,3682:1,3683:2,3684:0,3685:0,3686:2,3687:0,3688:2,3689:0,3690:2,3691:0,3692:2,3696:2,3697:0,3698:2,3699:0,3700:2,3793:0,3794:0,3812:0,3854:0,3857:0,3920:0,3978:0,3979:0,3991:2,3992:2,4026:0,4037:0,4038:0,4071:0,4082:0,4083:0,4087:0,4088:0,4217:2,4414:0,4415:0,4417:0,4434:0,4437:0,4438:2,4439:2,4462:0,4467:0,4471:0,4474:0,4559:0,4647:0,4822:0,4826:0,4839:0,5018:0,5041:0,5042:0,5048:0,5221:0,5223:0,5234:0,5235:0,5243:0,5247:0,5266:0,5316:0,5320:0,5321:0,5325:0,5337:0,5361:0,5362:0,5367:0,5382:0,5383:0,5396:0,5456:0,5457:0,5469:0,5472:4,5490:0,5513:0,5514:0,5523:0,5559:0,5588:1,5589:3,5596:0,5627:0,5629:0,5641:0,5643:0,5644:0,5646:2,5654:2,5655:2,5659:0,5700:0,5825:0,5836:0,5837:0,5839:0,5842:0,5844:0,5858:0,5879:0,5880:0,5887:0,5890:0,6128:1,6129:1,6141:1,6204:0,6210:0,6211:0,6307:0,6312:0,6316:0,6362:0,6391:1,6405:1,6406:0,6407:1,6408:0,6409:1,6410:0,6411:2,6412:0,6413:2,6414:0,6415:0,6416:2,6417:0,6418:2,6419:0,6420:2,6421:0,6422:2,6423:0,6424:2,6425:0,6426:2,6427:0,6428:2,6429:0,6430:2,6431:0,6432:2,6433:0,6434:2,6435:0,6436:2,6437:0,6438:2,6439:0,6440:0,6441:2,6442:0,6443:2,6444:0,6445:2,6446:0,6447:2,6448:0,6449:2,6450:0,6451:2,6452:0,6453:2,6454:0,6455:2,6456:0,6457:2,6458:0,6459:2,6460:0,6461:2,6462:0,6463:2,6464:0,6465:2,6466:0,6467:2,6468:0,6469:2,6470:0,6471:2,6472:0,6473:2,6474:0,6475:2,6476:0,6477:2,6478:0,6479:2,6484:2,6485:0,6486:2,6487:0,6488:2,6489:0,6490:2,6491:0,6492:2,6493:0,6494:1,6495:0,6496:1,6497:0,6498:0,6499:1,6500:0,6501:2,6502:0,6503:2,6504:0,6505:2,6506:0,6507:2,6508:0,6509:0,6510:2,6515:1,6516:0,6518:0,6519:2,6520:0,6521:2,6522:0,6523:2,6524:0,6525:2,6526:0,6527:2,6528:0,6529:2,6530:0,6531:2,6532:0,6533:2,6534:0,6535:2,6536:0,6537:2,6538:0,6539:2,6540:0,6541:2,6542:0,6543:2,6544:0,6545:1,6546:0,6547:1,6548:0,6549:2,6550:0,6551:2,6552:0,6553:2,6554:0,6555:2,6556:0,6557:1,6558:0,6559:1,6560:0,6561:1,6562:0,6563:2,6564:0,6565:2,6566:0,6567:0,6568:2,6569:0,6570:1,6571:0,6572:2,6573:0,6574:2,6575:0,6576:2,6577:0,6578:2,6582:2,6583:0,6584:2,6585:0,6586:2,6587:0,6588:2,6589:0,6590:2,6591:0,6592:0,6593:2,6594:0,6595:2,6596:0,6597:2,6598:0,6599:2,6600:0,6601:2,6602:0,6603:2,6605:2,6606:0,6607:2,6608:0,6609:2,6610:0,6611:0,6612:2,6613:0,6614:2,6615:0,6616:2,6617:0,6618:2,6633:2,6646:0,6703:0,6784:0,6785:1,6786:0,6787:1,6788:0,6789:1,6790:0,6791:1,6792:0,6793:1,6794:0,6795:1,6796:0,6797:1,6798:0,6799:1,6800:0,6801:1,6802:0,6803:1,6804:0,6805:1,6806:0,6807:1,6808:0,6809:1,6810:0,6811:1,6812:0,6813:1,6814:0,6815:1,6816:0,6817:1,6818:0,6819:1,6820:0,6821:1,6822:0,6823:1,6824:0,6825:1,6826:0,6827:1,6828:0,6829:1,6830:0,6831:1,6832:0,6833:1,6834:0,6835:1,6836:0,6837:1,6838:0,6839:1,6840:0,6841:1,6842:0,6843:1,6844:0,6845:1,6846:0,6847:1,6848:0,6849:1,6850:0,6851:1,6852:0,6853:1,6854:0,6855:1,6856:0,6857:1,6858:0,6859:1,6860:0,6861:1,6862:0,6863:1,6867:0,6868:1,6870:0,6875:0,6876:0,6879:0,6880:2,6884:0,6885:1,6886:0,6887:1,6915:0,6922:0,6923:2,6924:0,6925:2,6962:0,6984:0,6991:0,7128:2,7131:0,7132:2,7142:0,7257:0,7258:2,7259:0,7260:2,7261:0,7262:2,7263:0,7264:2,7265:0,7266:2,7267:0,7268:2,7269:0,7270:2,7271:0,7272:2,7273:0,7274:2,7275:0,7276:2,7277:0,7278:2,7279:0,7280:2,7281:0,7282:2,7283:0,7284:2,7285:0,7286:2,7287:0,7288:2,7289:0,7290:2,7291:0,7292:2,7293:0,7294:2,7295:0,7296:2,7297:0,7298:2,7299:0,7300:2,7301:0,7302:2,7303:0,7304:2,7305:0,7306:2,7307:0,7308:2,7309:0,7310:2,7311:0,7312:2,7313:0,7314:2,7315:0,7316:2,7317:0,7318:2,7319:0,7320:2,7321:0,7322:2,7323:0,7324:2,7325:0,7326:2,7327:0,7328:2,7329:0,7330:2,7331:0,7332:2,7333:0,7334:2,7335:0,7336:2,7337:0,7338:2,7339:0,7340:2,7341:0,7342:2,7343:0,7344:2,7345:0,7346:2,7347:0,7348:2,7349:0,7350:2,7351:0,7352:2,7353:0,7354:2,7355:0,7356:2,7357:0,7358:2,7359:0,7360:2,7361:0,7362:2,7363:0,7364:2,7365:0,7366:2,7367:0,7368:2,7369:0,7370:2,7877:0,7878:0,7882:0,7883:0,7887:0,7899:0,7991:0,7992:0,8035:2,8036:2,8058:0,8059:0,8082:0,8083:0,8088:0,8090:0,8091:2,8092:0,8093:2,8095:0,8096:2,8097:0,8098:2,8099:0,8100:2,8101:0,8102:2,8103:0,8104:2,8105:0,8106:2,8107:0,8108:2,8109:0,8110:2,8111:0,8112:2,8113:0,8114:2,8115:0,8116:2,8117:0,8118:2,8119:0,8120:2,8121:0,8122:2,8123:0,8124:2,8125:0,8126:2,8127:0,8128:2,8129:0,8130:2,8131:0,8132:2,8133:0,8134:2,8135:0,8136:2,8137:0,8138:2,8139:0,8140:2,8141:0,8142:2,8143:0,8144:2,8145:0,8146:2,8147:0,8148:2,8149:0,8150:2,8151:0,8152:2,8153:0,8154:2,8155:0,8156:2,8157:0,8158:2,8159:0,8160:2,8161:0,8162:2,8163:0,8164:2,8165:0,8166:2,8167:0,8168:2,8169:0,8170:2,8171:0,8172:2,8173:0,8177:2,8179:0,8180:2,8181:0,8182:2,8184:0,8185:2,8187:0,8189:2,8191:0,8193:2,8196:0,8197:2,8198:0,8200:2,8201:0,8202:2,8203:0,8204:2,8205:0,8206:2,8207:0,8208:2,8209:0,8210:2,8212:0,8213:2,8214:0,8216:2,8218:0,8220:2,8222:0,8224:2,8225:0,8226:2,8311:0,8312:1,8313:0,8314:1,8315:0,8316:1,8317:0,8318:1,8319:0,8320:1,8321:0,8322:1,8323:0,8324:1,8325:0,8326:1,8327:0,8328:1,8329:0,8330:1,8331:0,8332:1,8333:0,8334:1,8335:0,8336:1,8337:0,8338:1,8339:0,8340:1,8341:0,8342:1,8343:0,8344:1,8345:0,8346:1,8347:0,8348:1,8352:0,8353:0,8379:0,8380:2,8381:0,8382:2,8383:0,8384:2,8385:0,8387:2,8391:0,8395:0,8433:0,8441:0,8455:0,8456:0,8531:2,8682:0,8686:0,8687:0,8692:0,8693:0,8826:0,8903:0,8950:0,8951:0,9039:0,9040:0,9141:0,9149:0,9150:0,9191:0,9221:0,9222:0,9249:0,9250:0,9252:0,9254:0,9265:0,9284:0,9285:0,9300:0,9354:0,9367:0,9373:0,9377:0,9387:0,9391:0,9456:0,9473:0,9498:0,9674:0,9678:0,9680:0,9709:0,9712:0,9713:0,9716:0,9741:0,9748:2,9749:2,9761:0,9766:0,9793:0,9794:0,9869:0,9874:0,9875:0,9880:0,9895:0,9943:0,9945:0,9947:0,9967:0,9972:0,9977:0,10160:0,10183:0,10188:0,10194:0,10199:0,10207:0,10212:0,10217:0,10222:0,10227:0,10235:0,10240:0,10250:0,10254:0,10270:0,10275:0,10280:0,10306:0,10329:0,10471:0,10477:0,10481:2,10516:2,20002:0,20042:0,20050:1,20499:0,20538:0,20539:0,20790:0,20791:0,21291:0,21292:0,21500:0,21817:0,21818:0,22032:0,22033:0,22091:0,22092:0,22239:0,22240:0,22332:0,22337:0,22338:0,22391:0,22392:0,22639:0,22700:0,22739:0,22770:0,22780:0,22832:0,23090:0,23095:0,23239:0,23240:0,23433:0,23700:0,24047:0,24048:0,24100:3,24200:0,24305:0,24306:0,24382:10,24383:0,24500:0,24547:0,24548:0,24571:9,24600:0,25e3:0,25231:0,25884:0,25932:0,26237:0,26331:0,26332:0,26432:0,26591:0,26592:0,26632:0,26692:0,27120:0,27200:0,27291:6,27292:6,27429:0,27492:0,27493:0,27500:0,28232:0,28600:0,28991:0,28992:0,29100:0,29101:0,29220:0,29221:0,29333:0,29635:0,29636:0,29701:0,29738:0,29739:0,29849:0,29850:0,29871:8,29872:7,29873:0,29874:0,30200:5,30339:0,30340:0,30591:0,30592:0,30791:0,30792:0,30800:0,31028:0,31121:0,31154:0,31170:0,31171:0,31370:0,31528:0,31529:0,31600:0,31700:0,31838:0,31839:0,31900:0,31901:0,32061:0,32062:0,32098:0,32099:2,32100:0,32104:0,32161:0,32766:0,53048:0,53049:0,54090:0,54091:0,65061:2,65062:2,65161:0,65163:0,102041:2,102064:11,102068:15,102069:16,102118:2,102119:1,102120:2,102121:2,102217:2,102218:0,102219:2,102220:2,102378:1,102379:1,102380:0,102381:1,102589:2,102599:2,102600:2,102604:2,102647:0,102704:2,102705:2,102706:0,102731:0,102732:0,102759:1,102760:1,102761:2,102762:0,102763:2,102764:0,102765:0,102766:2,102970:1,102974:2,102993:0,102994:0,102995:2,102996:2,103015:0,103016:2,103017:0,103018:2,103025:0,103026:0,103027:2,103028:2,103035:0,103036:0,103037:2,103038:2,103039:0,103040:0,103041:2,103042:2,103043:0,103044:0,103045:2,103046:2,103047:0,103048:0,103049:2,103050:2,103051:0,103052:2,103053:0,103054:2,103055:0,103056:2,103057:0,103058:0,103059:2,103060:2,103061:0,103062:0,103063:2,103064:2,103069:2,103070:0,103071:0,103072:2,103073:2,103086:0,103087:0,103088:2,103089:2,103094:1,103095:0,103096:2,103103:0,103104:2,103105:0,103106:2,103121:0,103122:2,103123:0,103124:0,103125:1,103126:1,103127:0,103128:0,103129:2,103130:2,103131:0,103132:0,103133:2,103134:2,103135:0,103136:0,103137:1,103138:1,103139:0,103140:2,103141:0,103142:2,103143:0,103144:2,103145:0,103146:1,103147:0,103148:0,103149:2,103150:2,103151:0,103152:2,103172:0,103173:2,103174:0,103175:0,103176:2,103177:2,103178:0,103179:0,103180:2,103181:2,103182:0,103183:0,103184:2,103185:2,103228:0,103229:0,103230:2,103231:2,103250:0,103251:2,103252:0,103253:2,103260:0,103261:0,103262:2,103263:2,103270:0,103271:0,103272:2,103273:2,103274:0,103275:0,103276:2,103277:2,103278:0,103279:0,103280:2,103281:2,103282:0,103283:0,103284:2,103285:2,103286:0,103287:2,103288:0,103289:2,103290:0,103291:2,103292:0,103293:0,103294:2,103295:2,103296:0,103297:0,103298:2,103299:2,103376:2,103377:0,103378:0,103379:2,103380:2,103393:0,103394:0,103395:2,103396:2,103472:0,103473:1,103474:0,103475:2,103482:0,103483:2,103484:0,103485:2,103500:0,103501:2,103502:0,103503:0,103504:1,103505:1,103506:0,103507:0,103508:2,103509:2,103510:0,103511:0,103512:2,103513:2,103514:0,103515:2,103516:0,103517:2,103518:0,103519:2,103520:0,103521:1,103522:0,103523:0,103524:2,103525:2,103526:0,103527:2,103561:2,103562:2,103563:0,103564:0,103565:2,103566:2,103567:0,103568:0,103569:2,103570:2,103584:0,103585:2,103586:0,103587:2,103588:1,103589:0,103590:2,103591:1,103592:0,103593:2,103594:1,103695:2,103897:1};for(h=2e3;h<=2045;h++)C[h]=0;for(h=2056;h<=2065;h++)C[h]=0;for(h=2067;h<=2135;h++)C[h]=0;for(h=2137;h<=2154;h++)C[h]=0;for(h=2161;h<=2170;h++)C[h]=0;for(h=2172;h<=2193;h++)C[h]=0;for(h=2195;h<=2198;h++)C[h]=0;for(h=2200;h<=2203;h++)C[h]=0;for(h=2205;h<=2217;h++)C[h]=0;for(h=2222;h<=2224;h++)C[h]=1;for(h=2225;h<=2250;h++)C[h]=2;for(h=2251;h<=2253;h++)C[h]=1;for(h=2257;h<=2264;h++)C[h]=2;for(h=2274;h<=2279;h++)C[h]=2;for(h=2280;h<=2282;h++)C[h]=1;for(h=2283;h<=2289;h++)C[h]=2;for(h=2290;h<=2292;h++)C[h]=0;for(h=2308;h<=2313;h++)C[h]=0;for(h=2315;h<=2491;h++)C[h]=0;for(h=2494;h<=2866;h++)C[h]=0;for(h=2867;h<=2869;h++)C[h]=1;for(h=2870;h<=2888;h++)C[h]=2;for(h=2891;h<=2895;h++)C[h]=2;for(h=2896;h<=2898;h++)C[h]=1;for(h=2902;h<=2908;h++)C[h]=2;for(h=2915;h<=2920;h++)C[h]=2;for(h=2921;h<=2923;h++)C[h]=1;for(h=2924;h<=2930;h++)C[h]=2;for(h=2931;h<=2962;h++)C[h]=0;for(h=2964;h<=2968;h++)C[h]=2;for(h=2969;h<=2973;h++)C[h]=0;for(h=2975;h<=2991;h++)C[h]=0;for(h=2995;h<=3051;h++)C[h]=0;for(h=3054;h<=3079;h++)C[h]=0;for(h=3081;h<=3088;h++)C[h]=0;for(h=3092;h<=3101;h++)C[h]=0;for(h=3106;h<=3138;h++)C[h]=0;for(h=3146;h<=3151;h++)C[h]=0;for(h=3153;h<=3166;h++)C[h]=0;for(h=3168;h<=3172;h++)C[h]=0;for(h=3174;h<=3203;h++)C[h]=0;for(h=3294;h<=3358;h++)C[h]=0;for(h=3367;h<=3403;h++)C[h]=0;for(h=3408;h<=3416;h++)C[h]=0;for(h=3417;h<=3438;h++)C[h]=2;for(h=3441;h<=3446;h++)C[h]=2;for(h=3447;h<=3450;h++)C[h]=0;for(h=3451;h<=3459;h++)C[h]=2;for(h=3460;h<=3478;h++)C[h]=0;for(h=3554;h<=3559;h++)C[h]=0;for(h=3560;h<=3570;h++)C[h]=2;for(h=3571;h<=3581;h++)C[h]=0;for(h=3594;h<=3597;h++)C[h]=0;for(h=3601;h<=3604;h++)C[h]=0;for(h=3637;h<=3639;h++)C[h]=0;for(h=3665;h<=3667;h++)C[h]=0;for(h=3693;h<=3695;h++)C[h]=0;for(h=3701;h<=3727;h++)C[h]=0;for(h=3728;h<=3739;h++)C[h]=2;for(h=3740;h<=3751;h++)C[h]=0;for(h=3753;h<=3760;h++)C[h]=2;for(h=3761;h<=3773;h++)C[h]=0;for(h=3775;h<=3777;h++)C[h]=0;for(h=3779;h<=3781;h++)C[h]=0;for(h=3783;h<=3785;h++)C[h]=0;for(h=3788;h<=3791;h++)C[h]=0;for(h=3797;h<=3802;h++)C[h]=0;for(h=3814;h<=3816;h++)C[h]=0;for(h=3825;h<=3829;h++)C[h]=0;for(h=3832;h<=3841;h++)C[h]=0;for(h=3844;h<=3852;h++)C[h]=0;for(h=3873;h<=3885;h++)C[h]=0;for(h=3890;h<=3893;h++)C[h]=0;for(h=3907;h<=3912;h++)C[h]=0;for(h=3942;h<=3950;h++)C[h]=0;for(h=3968;h<=3970;h++)C[h]=0;for(h=3973;h<=3976;h++)C[h]=0;for(h=3986;h<=3989;h++)C[h]=0;for(h=3994;h<=3997;h++)C[h]=0;for(h=4048;h<=4051;h++)C[h]=0;for(h=4056;h<=4063;h++)C[h]=0;for(h=4093;h<=4096;h++)C[h]=0;for(h=4390;h<=4398;h++)C[h]=0;for(h=4399;h<=4413;h++)C[h]=2;for(h=4418;h<=4433;h++)C[h]=2;for(h=4455;h<=4457;h++)C[h]=2;for(h=4484;h<=4489;h++)C[h]=0;for(h=4491;h<=4554;h++)C[h]=0;for(h=4568;h<=4589;h++)C[h]=0;for(h=4652;h<=4656;h++)C[h]=0;for(h=4766;h<=4800;h++)C[h]=0;for(h=5014;h<=5016;h++)C[h]=0;for(h=5069;h<=5072;h++)C[h]=0;for(h=5105;h<=5130;h++)C[h]=0;for(h=5167;h<=5188;h++)C[h]=0;for(h=5253;h<=5259;h++)C[h]=0;for(h=5269;h<=5275;h++)C[h]=0;for(h=5292;h<=5311;h++)C[h]=0;for(h=5329;h<=5331;h++)C[h]=0;for(h=5343;h<=5349;h++)C[h]=0;for(h=5355;h<=5357;h++)C[h]=0;for(h=5387;h<=5389;h++)C[h]=0;for(h=5459;h<=5463;h++)C[h]=0;for(h=5479;h<=5482;h++)C[h]=0;for(h=5518;h<=5520;h++)C[h]=0;for(h=5530;h<=5539;h++)C[h]=0;for(h=5550;h<=5552;h++)C[h]=0;for(h=5562;h<=5583;h++)C[h]=0;for(h=5623;h<=5625;h++)C[h]=2;for(h=5631;h<=5639;h++)C[h]=0;for(h=5649;h<=5653;h++)C[h]=0;for(h=5663;h<=5680;h++)C[h]=0;for(h=5682;h<=5685;h++)C[h]=0;for(h=5875;h<=5877;h++)C[h]=0;for(h=5896;h<=5899;h++)C[h]=0;for(h=5921;h<=5940;h++)C[h]=0;for(h=6050;h<=6125;h++)C[h]=0;for(h=6244;h<=6275;h++)C[h]=0;for(h=6328;h<=6348;h++)C[h]=0;for(h=6350;h<=6356;h++)C[h]=0;for(h=6366;h<=6372;h++)C[h]=0;for(h=6381;h<=6387;h++)C[h]=0;for(h=6393;h<=6404;h++)C[h]=0;for(h=6480;h<=6483;h++)C[h]=0;for(h=6511;h<=6514;h++)C[h]=0;for(h=6579;h<=6581;h++)C[h]=0;for(h=6619;h<=6624;h++)C[h]=0;for(h=6625;h<=6627;h++)C[h]=2;for(h=6628;h<=6632;h++)C[h]=0;for(h=6634;h<=6637;h++)C[h]=0;for(h=6669;h<=6692;h++)C[h]=0;for(h=6707;h<=6709;h++)C[h]=0;for(h=6720;h<=6723;h++)C[h]=0;for(h=6732;h<=6738;h++)C[h]=0;for(h=6931;h<=6933;h++)C[h]=0;for(h=6956;h<=6959;h++)C[h]=0;for(h=7005;h<=7007;h++)C[h]=0;for(h=7057;h<=7070;h++)C[h]=2;for(h=7074;h<=7082;h++)C[h]=0;for(h=7109;h<=7118;h++)C[h]=0;for(h=7119;h<=7127;h++)C[h]=1;for(h=7374;h<=7376;h++)C[h]=0;for(h=7528;h<=7586;h++)C[h]=0;for(h=7587;h<=7645;h++)C[h]=2;for(h=7692;h<=7696;h++)C[h]=0;for(h=7755;h<=7787;h++)C[h]=0;for(h=7791;h<=7795;h++)C[h]=0;for(h=7799;h<=7801;h++)C[h]=0;for(h=7803;h<=7805;h++)C[h]=0;for(h=7825;h<=7831;h++)C[h]=0;for(h=7845;h<=7859;h++)C[h]=0;for(h=8013;h<=8032;h++)C[h]=0;for(h=8065;h<=8068;h++)C[h]=1;for(h=8518;h<=8529;h++)C[h]=2;for(h=8533;h<=8536;h++)C[h]=2;for(h=8538;h<=8540;h++)C[h]=2;for(h=8677;h<=8679;h++)C[h]=0;for(h=8836;h<=8840;h++)C[h]=0;for(h=8857;h<=8859;h++)C[h]=0;for(h=8908;h<=8910;h++)C[h]=0;for(h=9154;h<=9159;h++)C[h]=0;for(h=9205;h<=9218;h++)C[h]=0;for(h=9271;h<=9273;h++)C[h]=0;for(h=9295;h<=9297;h++)C[h]=0;for(h=9356;h<=9360;h++)C[h]=0;for(h=9404;h<=9407;h++)C[h]=0;for(h=9476;h<=9482;h++)C[h]=0;for(h=9487;h<=9494;h++)C[h]=0;for(h=9697;h<=9699;h++)C[h]=0;for(h=9821;h<=9865;h++)C[h]=0;for(h=10285;h<=10291;h++)C[h]=0;for(h=10314;h<=10317;h++)C[h]=0;for(h=10448;h<=10465;h++)C[h]=0;for(h=10731;h<=10733;h++)C[h]=0;for(h=11114;h<=11118;h++)C[h]=0;for(h=20004;h<=20032;h++)C[h]=0;for(h=20047;h<=20049;h++)C[h]=0;for(h=20062;h<=20092;h++)C[h]=0;for(h=20135;h<=20138;h++)C[h]=0;for(h=20248;h<=20258;h++)C[h]=0;for(h=20348;h<=20358;h++)C[h]=0;for(h=20436;h<=20440;h++)C[h]=0;for(h=20822;h<=20824;h++)C[h]=0;for(h=20904;h<=20932;h++)C[h]=0;for(h=20934;h<=20936;h++)C[h]=0;for(h=21004;h<=21032;h++)C[h]=0;for(h=21035;h<=21037;h++)C[h]=0;for(h=21095;h<=21097;h++)C[h]=0;for(h=21148;h<=21150;h++)C[h]=0;for(h=21207;h<=21264;h++)C[h]=0;for(h=21307;h<=21364;h++)C[h]=0;for(h=21413;h<=21423;h++)C[h]=0;for(h=21453;h<=21463;h++)C[h]=0;for(h=21473;h<=21483;h++)C[h]=0;for(h=21780;h<=21782;h++)C[h]=0;for(h=21891;h<=21894;h++)C[h]=0;for(h=21896;h<=21899;h++)C[h]=0;for(h=22171;h<=22177;h++)C[h]=0;for(h=22181;h<=22187;h++)C[h]=0;for(h=22191;h<=22197;h++)C[h]=0;for(h=22207;h<=22222;h++)C[h]=0;for(h=22229;h<=22232;h++)C[h]=0;for(h=22234;h<=22236;h++)C[h]=0;for(h=22243;h<=22250;h++)C[h]=0;for(h=22262;h<=22265;h++)C[h]=0;for(h=22307;h<=22322;h++)C[h]=0;for(h=22348;h<=22357;h++)C[h]=0;for(h=22407;h<=22422;h++)C[h]=0;for(h=22462;h<=22465;h++)C[h]=0;for(h=22521;h<=22525;h++)C[h]=0;for(h=22607;h<=22622;h++)C[h]=0;for(h=22641;h<=22646;h++)C[h]=0;for(h=22648;h<=22657;h++)C[h]=0;for(h=22707;h<=22722;h++)C[h]=0;for(h=22762;h<=22765;h++)C[h]=0;for(h=22807;h<=22822;h++)C[h]=0;for(h=22991;h<=22994;h++)C[h]=0;for(h=23028;h<=23038;h++)C[h]=0;for(h=23301;h<=23333;h++)C[h]=2;for(h=23830;h<=23853;h++)C[h]=0;for(h=23866;h<=23872;h++)C[h]=0;for(h=23877;h<=23884;h++)C[h]=0;for(h=23886;h<=23894;h++)C[h]=0;for(h=23946;h<=23948;h++)C[h]=0;for(h=24311;h<=24313;h++)C[h]=0;for(h=24342;h<=24347;h++)C[h]=0;for(h=24370;h<=24374;h++)C[h]=10;for(h=24375;h<=24381;h++)C[h]=0;for(h=24718;h<=24721;h++)C[h]=0;for(h=24817;h<=24821;h++)C[h]=0;for(h=24877;h<=24882;h++)C[h]=0;for(h=24891;h<=24893;h++)C[h]=0;for(h=25391;h<=25395;h++)C[h]=0;for(h=25828;h<=25838;h++)C[h]=0;for(h=26191;h<=26195;h++)C[h]=0;for(h=26391;h<=26393;h++)C[h]=0;for(h=26701;h<=26722;h++)C[h]=0;for(h=26729;h<=26799;h++)C[h]=2;for(h=26801;h<=26803;h++)C[h]=2;for(h=26811;h<=26813;h++)C[h]=2;for(h=26847;h<=26870;h++)C[h]=2;for(h=26891;h<=26899;h++)C[h]=0;for(h=26901;h<=26923;h++)C[h]=0;for(h=26929;h<=26946;h++)C[h]=0;for(h=26948;h<=26998;h++)C[h]=0;for(h=27037;h<=27040;h++)C[h]=0;for(h=27205;h<=27232;h++)C[h]=0;for(h=27258;h<=27260;h++)C[h]=0;for(h=27391;h<=27398;h++)C[h]=0;for(h=27561;h<=27564;h++)C[h]=0;for(h=27571;h<=27574;h++)C[h]=0;for(h=27581;h<=27584;h++)C[h]=0;for(h=27591;h<=27594;h++)C[h]=0;for(h=27700;h<=27707;h++)C[h]=0;for(h=28191;h<=28193;h++)C[h]=0;for(h=28348;h<=28358;h++)C[h]=0;for(h=28402;h<=28432;h++)C[h]=0;for(h=28462;h<=28492;h++)C[h]=0;for(h=29118;h<=29122;h++)C[h]=0;for(h=29168;h<=29172;h++)C[h]=0;for(h=29177;h<=29185;h++)C[h]=0;for(h=29187;h<=29195;h++)C[h]=0;for(h=29900;h<=29903;h++)C[h]=0;for(h=30161;h<=30179;h++)C[h]=0;for(h=30491;h<=30494;h++)C[h]=0;for(h=30729;h<=30732;h++)C[h]=0;for(h=31251;h<=31259;h++)C[h]=0;for(h=31265;h<=31268;h++)C[h]=0;for(h=31275;h<=31279;h++)C[h]=0;for(h=31281;h<=31297;h++)C[h]=0;for(h=31461;h<=31469;h++)C[h]=0;for(h=31491;h<=31495;h++)C[h]=0;for(h=31917;h<=31922;h++)C[h]=0;for(h=31965;h<=32e3;h++)C[h]=0;for(h=32001;h<=32003;h++)C[h]=2;for(h=32005;h<=32031;h++)C[h]=2;for(h=32033;h<=32060;h++)C[h]=2;for(h=32064;h<=32067;h++)C[h]=2;for(h=32074;h<=32077;h++)C[h]=2;for(h=32081;h<=32086;h++)C[h]=0;for(h=32107;h<=32130;h++)C[h]=0;for(h=32133;h<=32159;h++)C[h]=0;for(h=32164;h<=32167;h++)C[h]=2;for(h=32180;h<=32199;h++)C[h]=0;for(h=32201;h<=32260;h++)C[h]=0;for(h=32301;h<=32360;h++)C[h]=0;for(h=32401;h<=32460;h++)C[h]=0;for(h=32501;h<=32560;h++)C[h]=0;for(h=32601;h<=32662;h++)C[h]=0;for(h=32664;h<=32667;h++)C[h]=2;for(h=32701;h<=32761;h++)C[h]=0;for(h=53001;h<=53004;h++)C[h]=0;for(h=53008;h<=53019;h++)C[h]=0;for(h=53021;h<=53032;h++)C[h]=0;for(h=53034;h<=53037;h++)C[h]=0;for(h=53042;h<=53046;h++)C[h]=0;for(h=53074;h<=53080;h++)C[h]=0;for(h=54001;h<=54004;h++)C[h]=0;for(h=54008;h<=54019;h++)C[h]=0;for(h=54021;h<=54032;h++)C[h]=0;for(h=54034;h<=54037;h++)C[h]=0;for(h=54042;h<=54046;h++)C[h]=0;for(h=54048;h<=54053;h++)C[h]=0;for(h=54074;h<=54080;h++)C[h]=0;for(h=54098;h<=54101;h++)C[h]=0;for(h=102001;h<=102040;h++)C[h]=0;for(h=102042;h<=102063;h++)C[h]=0;for(h=102065;h<=102067;h++)C[h]=0;for(h=102070;h<=102117;h++)C[h]=0;for(h=102122;h<=102216;h++)C[h]=0;for(h=102221;h<=102377;h++)C[h]=0;for(h=102382;h<=102388;h++)C[h]=0;for(h=102389;h<=102398;h++)C[h]=2;for(h=102399;h<=102444;h++)C[h]=0;for(h=102445;h<=102447;h++)C[h]=2;for(h=102448;h<=102458;h++)C[h]=0;for(h=102459;h<=102468;h++)C[h]=2;for(h=102469;h<=102499;h++)C[h]=0;for(h=102500;h<=102519;h++)C[h]=1;for(h=102520;h<=102524;h++)C[h]=0;for(h=102525;h<=102529;h++)C[h]=2;for(h=102530;h<=102588;h++)C[h]=0;for(h=102590;h<=102598;h++)C[h]=0;for(h=102601;h<=102603;h++)C[h]=0;for(h=102605;h<=102628;h++)C[h]=0;for(h=102629;h<=102646;h++)C[h]=2;for(h=102648;h<=102700;h++)C[h]=2;for(h=102701;h<=102703;h++)C[h]=0;for(h=102707;h<=102730;h++)C[h]=2;for(h=102733;h<=102758;h++)C[h]=2;for(h=102767;h<=102900;h++)C[h]=0;for(h=102901;h<=102933;h++)C[h]=2;for(h=102934;h<=102950;h++)C[h]=13;for(h=102951;h<=102963;h++)C[h]=0;for(h=102965;h<=102969;h++)C[h]=0;for(h=102971;h<=102973;h++)C[h]=0;for(h=102975;h<=102989;h++)C[h]=0;for(h=102990;h<=102992;h++)C[h]=1;for(h=102997;h<=103002;h++)C[h]=0;for(h=103003;h<=103008;h++)C[h]=2;for(h=103009;h<=103011;h++)C[h]=0;for(h=103012;h<=103014;h++)C[h]=2;for(h=103019;h<=103021;h++)C[h]=0;for(h=103022;h<=103024;h++)C[h]=2;for(h=103029;h<=103031;h++)C[h]=0;for(h=103032;h<=103034;h++)C[h]=2;for(h=103065;h<=103068;h++)C[h]=0;for(h=103074;h<=103076;h++)C[h]=0;for(h=103077;h<=103079;h++)C[h]=1;for(h=103080;h<=103082;h++)C[h]=0;for(h=103083;h<=103085;h++)C[h]=2;for(h=103090;h<=103093;h++)C[h]=0;for(h=103097;h<=103099;h++)C[h]=0;for(h=103100;h<=103102;h++)C[h]=2;for(h=103107;h<=103109;h++)C[h]=0;for(h=103110;h<=103112;h++)C[h]=2;for(h=103113;h<=103116;h++)C[h]=0;for(h=103117;h<=103120;h++)C[h]=2;for(h=103153;h<=103157;h++)C[h]=0;for(h=103158;h<=103162;h++)C[h]=2;for(h=103163;h<=103165;h++)C[h]=0;for(h=103166;h<=103168;h++)C[h]=1;for(h=103169;h<=103171;h++)C[h]=2;for(h=103186;h<=103188;h++)C[h]=0;for(h=103189;h<=103191;h++)C[h]=2;for(h=103192;h<=103195;h++)C[h]=0;for(h=103196;h<=103199;h++)C[h]=2;for(h=103200;h<=103224;h++)C[h]=0;for(h=103225;h<=103227;h++)C[h]=1;for(h=103232;h<=103237;h++)C[h]=0;for(h=103238;h<=103243;h++)C[h]=2;for(h=103244;h<=103246;h++)C[h]=0;for(h=103247;h<=103249;h++)C[h]=2;for(h=103254;h<=103256;h++)C[h]=0;for(h=103257;h<=103259;h++)C[h]=2;for(h=103264;h<=103266;h++)C[h]=0;for(h=103267;h<=103269;h++)C[h]=2;for(h=103300;h<=103375;h++)C[h]=0;for(h=103381;h<=103383;h++)C[h]=0;for(h=103384;h<=103386;h++)C[h]=1;for(h=103387;h<=103389;h++)C[h]=0;for(h=103390;h<=103392;h++)C[h]=2;for(h=103397;h<=103399;h++)C[h]=0;for(h=103400;h<=103471;h++)C[h]=2;for(h=103476;h<=103478;h++)C[h]=0;for(h=103479;h<=103481;h++)C[h]=2;for(h=103486;h<=103488;h++)C[h]=0;for(h=103489;h<=103491;h++)C[h]=2;for(h=103492;h<=103495;h++)C[h]=0;for(h=103496;h<=103499;h++)C[h]=2;for(h=103528;h<=103543;h++)C[h]=0;for(h=103544;h<=103548;h++)C[h]=2;for(h=103549;h<=103551;h++)C[h]=0;for(h=103552;h<=103554;h++)C[h]=1;for(h=103555;h<=103557;h++)C[h]=2;for(h=103558;h<=103560;h++)C[h]=0;for(h=103571;h<=103573;h++)C[h]=0;for(h=103574;h<=103576;h++)C[h]=2;for(h=103577;h<=103580;h++)C[h]=0;for(h=103581;h<=103583;h++)C[h]=2;for(h=103595;h<=103694;h++)C[h]=0;for(h=103696;h<=103699;h++)C[h]=0;for(h=103700;h<=103793;h++)C[h]=2;for(h=103794;h<=103890;h++)C[h]=0;for(h=103891;h<=103896;h++)C[h]=2;for(h=103900;h<=103971;h++)C[h]=2;for(h=103972;h<=103977;h++)C[h]=0;for(h=112e3;h<=112101;h++)C[h]=0;const xM$2=[102100,102113,3857,3785,900913],hV$2=[104905,104971],pV$2=[4326,...xM$2,...hV$2],Md$2=[-20037508342788905e-9,20037508342788905e-9],y_$2=[-20037508342787e-6,20037508342787e-6],g_$2={wkTemplate:'PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]',valid:Md$2,origin:y_$2,dx:1e-5},EM$2={102113:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:Md$2,origin:y_$2,dx:1e-5},102100:g_$2,3785:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:Md$2,origin:y_$2,dx:1e-5},3857:g_$2,4326:{wkTemplate:'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",{Central_Meridian}],UNIT["Degree",0.0174532925199433]]',altTemplate:'PROJCS["WGS_1984_Plate_Carree",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Plate_Carree"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],UNIT["Degrees",111319.491]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104971:{wkTemplate:'GEOGCS["Mars_2000_(Sphere)",DATUM["Mars_2000_(Sphere)",SPHEROID["Mars_2000_(Sphere)",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104905:{wkTemplate:'GEOGCS["GCS_Mars_2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190.0,169.8944472236118]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},900913:g_$2};function Ia$2(r,o){if(r===o)return!0;if(r==null||o==null)return!1;const s=r.wkid,a=o.wkid;if(s!=null||a!=null){if(s===a||Ma$2(r)&&Ma$2(o))return!0;const u=r.latestWkid;if(u!=null&&a===u)return!0;const d=o.latestWkid;return d!=null&&s===d}let l,c;return r.wkt2&&o.wkt2?(l=r.wkt2,c=o.wkt2):r.wkt&&o.wkt&&(l=r.wkt,c=o.wkt),!(!l||!c)&&l.toUpperCase()===c.toUpperCase()}function Zu$2(r){const o=r?.wkid;return o!=null&&o>=2e3&&EM$2[o]||null}function dV$2(r){if(!r)return;const{wkid:o,vcsWkid:s}=r;if(o)return s?JSON.stringify({wkid:o,vcsWkid:s}):String(o);const a=r.wkt||r.wkt2;return JSON.stringify(a?s?{wkt:a,vcsWkid:s}:{wkt:a}:{})}function Iy$2(r){if(!v_$2(r))return!1;const{wkid:o}=r;if(o)return C[o]==null;const s=r.wkt2||r.wkt;return!!s&&/^\s*(?:GEOGCS|GEOGCRS|GEOGRAPHICCRS)/i.test(s)}function TM$2(r){return!(SM$2(r)||AM$2(r))}function Nd$1(r){return r?.wkid===4326}function fV$2(r){return/^\s*(?:GEOD|GEODETIC|GEOG|GEOGRAPHIC|PROJ|PROJECTED|VERT|VERTICAL|ENG|ENGINEERING|PARAMETRIC|TIME|DERIVEDPROJ|COMPOUND|BOUND)CRS/i.test(r)}function mV$2(r){return r?.wkid===lc$2.CGCS2000}function Ma$2(r){const o=r?.wkid;return o!=null&&o>=2e3&&xM$2.includes(o)}function yV$2(r){return r?.wkid===32662}function Od$2(r){return r===lc$2.GCSMARS2000||r===lc$2.GCSMARS2000_SPHERE}function SM$2(r){return Od$2(r?.wkid)}function Cd$2(r){return r===lc$2.GCSMOON2000}function AM$2(r){return Cd$2(r?.wkid)}function IM$2(r){const o=r?.wkid;return o!=null&&o>=2e3&&pV$2.includes(o)}function v_$2(r){if(r==null)return!1;const o=r.wkid;return o!=null&&o>=2e3||r.wkt2!=null||r.wkt!=null}const b_$2={wkid:4326,wkt:l2$2(EM$2[4326].wkTemplate,{Central_Meridian:"0.0"})},__$2={wkid:102100,latestWkid:3857},gV$2={wkid:32662};function w_$2(r){return{wkt:`GEOCCS["Spherical geocentric", - DATUM["Not specified", - SPHEROID["Sphere",${r.radius},0]], - PRIMEM["Greenwich",0.0, - AUTHORITY["EPSG","8901"]], - UNIT["m",1.0], - AXIS["Geocentric X",OTHER], - AXIS["Geocentric Y",EAST], - AXIS["Geocentric Z",NORTH] - ]`}}const MM$2=w_$2(Mi$2),x_$2=w_$2(Hu$2),E_$2=w_$2(Td$2),vV$2={wkt:`GEOCCS["WGS 84", - DATUM["WGS_1984", - SPHEROID["WGS 84",${Mi$2.radius},298.257223563, - AUTHORITY["EPSG","7030"]], - AUTHORITY["EPSG","6326"]], - PRIMEM["Greenwich",0, - AUTHORITY["EPSG","8901"]], - UNIT["m",1.0, - AUTHORITY["EPSG","9001"]], - AXIS["Geocentric X",OTHER], - AXIS["Geocentric Y",OTHER], - AXIS["Geocentric Z",NORTH], - AUTHORITY["EPSG","4978"] -]`},bV$2=x_$2.wkt.toUpperCase(),_V$2=E_$2.wkt.toUpperCase();function NM$2(r){if(r!=null&&v_$2(r)){const o=r.wkid,s=r.wkt2??r.wkt;if(Od$2(o))return Hu$2;const a=s?.toUpperCase();if(s&&a===bV$2)return Hu$2;if(Cd$2(o)||a&&a===_V$2)return Td$2}return Mi$2}function wV$2(r){return Od$2(r)?Hu$2:Cd$2(r)?Td$2:Mi$2}function OM$2(r){return Ia$2(r,MM$2)}function xV$2(r){return OM$2(r)||Ia$2(r,x_$2)||Ia$2(r,E_$2)}const EV$2=39.37,TV$2=Mi$2.radius*Math.PI/200,CM$2=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,cc$2=C,RM$2=/UNIT\[([^\]]+)]/i,SV$2=new Set([4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104025,104026,104139,104140]),AV$2=Ii$2()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain:"chains",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),$s$2=r=>r*r,Na$2=r=>r*r*r,Rd$1={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937},"clarke-feet":{inBaseUnits:.3047972654},"clarke-yards":{inBaseUnits:.9143917962},"clarke-links":{inBaseUnits:.201166195164},"sears-yards":{inBaseUnits:.9143984146160287},"sears-feet":{inBaseUnits:.3047994715386762},"sears-chains":{inBaseUnits:20.11676512155263},"benoit-1895-b-chains":{inBaseUnits:20.11678249437587},"indian-yards":{inBaseUnits:.9143985307444408},"indian-1937-yards":{inBaseUnits:.91439523},"gold-coast-feet":{inBaseUnits:.3047997101815088},chains:{inBaseUnits:20.1168},"sears-1922-truncated-chains":{inBaseUnits:20.116756},"50-kilometers":{inBaseUnits:5e4},"150-kilometers":{inBaseUnits:15e4}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:$s$2(.001)},"square-centimeters":{inBaseUnits:$s$2(.01)},"square-decimeters":{inBaseUnits:$s$2(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:$s$2(1e3)},"square-inches":{inBaseUnits:$s$2(.0254)},"square-feet":{inBaseUnits:$s$2(.3048)},"square-yards":{inBaseUnits:$s$2(.9144)},"square-miles":{inBaseUnits:$s$2(1609.344)},"square-us-feet":{inBaseUnits:$s$2(1200/3937)},acres:{inBaseUnits:.0015625*$s$2(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*Na$2(.001)},"cubic-centimeters":{inBaseUnits:1e3*Na$2(.01)},"cubic-decimeters":{inBaseUnits:1e3*Na$2(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*Na$2(1e3)},"cubic-inches":{inBaseUnits:1e3*Na$2(.0254)},"cubic-feet":{inBaseUnits:1e3*Na$2(.3048)},"cubic-yards":{inBaseUnits:1e3*Na$2(.9144)},"cubic-miles":{inBaseUnits:1e3*Na$2(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},IV$2=(()=>{const r={};for(const o in Rd$1)for(const s in Rd$1[o].units)r[s]=o;return r})();function MV$2(r,o,s){return r*Rd$1[s].units[o].inBaseUnits}function NV$2(r,o,s){return r/Rd$1[s].units[o].inBaseUnits}const kM$2=["metric","imperial","inches","feet","yards","miles","nautical-miles","us-feet","meters","kilometers"],OV$2=new Map([["meters","square-meters"],["feet","square-feet"],["us-feet","square-us-feet"]]);function My$2(r){const o=IV$2[r];if(!o)throw new Error("unknown type");return o}function LM$2(r,o=null){return o=o||My$2(r),Rd$1[o].baseUnit===r}function Oa$2(r,o,s){if(o===s)return r;const a=My$2(o);if(a!==My$2(s))throw new Error("incompatible units");const l=LM$2(o,a)?r:MV$2(r,o,a);return LM$2(s,a)?l:NV$2(l,s,a)}function PM$2(r){switch(r){case"metric":return"meters";case"imperial":return"feet";default:return r}}function CV$2(r){return PM$2(r)}function RV$2(r){switch(r){case"metric":return"square-meters";case"imperial":return"square-feet";default:return r}}function kV$2(r,o){const s=Oa$2(r,o,"meters");return Math.abs(s)<3e3?"meters":"kilometers"}function LV$2(r,o){const s=Oa$2(r,o,"meters");return Math.abs(s)<1e5?"meters":"kilometers"}function PV$2(r,o){const s=Oa$2(r,o,"feet");return Math.abs(s)<1e3?"feet":"miles"}function DV$2(r,o){const s=Oa$2(r,o,"feet");return Math.abs(s)<1e5?"feet":"miles"}function GV$2(r,o){const s=Oa$2(r,o,"square-meters");return Math.abs(s)<3e6?"square-meters":"square-kilometers"}function FV$2(r,o){const s=Oa$2(r,o,"square-feet");return Math.abs(s)<1e6?"square-feet":"square-miles"}function jV$2(r,o,s){return Oa$2(r,o,"meters")/(s*Math.PI/180)}function DM$2(r){return AV$2.fromJSON(r.toLowerCase())||null}function UV$2(r){if(r!=null&&!TM$2(r))return 1;const o=kd$2(r);return o>1e5?1:o}function GM$2(r){return kd$2(r)>=NM$2(r).metersPerDegree?"meters":Qu$2(r)}function kd$2(r,o=Mi$2.metersPerDegree){return FM$2(r,!0)??o}function FM$2(r,o=!1){const s=r?.wkid??null,a=r?.wkt2??r?.wkt??null;let l=null;if(s){if(Od$2(s))return Hu$2.metersPerDegree;if(Cd$2(s))return Td$2.metersPerDegree;l=cc$2.values[cc$2[s]],!l&&o&&SV$2.has(s)&&(l=TV$2)}else a&&(T_$2(a)?l=jM$2(CM$2.exec(a),l):$M$2(a)&&(l=jM$2(RM$2.exec(a),l)));return l}function $V$2(r){return Iy$2(r)?1:kd$2(r)}function jM$2(r,o){return r?.[1]?UM$2(r[1]):o}function UM$2(r){return parseFloat(r.split(",")[1])}function Qu$2(r){const o=r?.wkid??null,s=r?.wkt2??r?.wkt??null;let a=null;if(o)a=cc$2.units[cc$2[o]];else if(s){const l=T_$2(s)?CM$2:$M$2(s)?RM$2:null;if(l){const c=l.exec(s);c?.[1]&&(a=WV$2(c[1]))}}return a!=null?DM$2(a):null}function BV$2(r){const o=Qu$2(r);return o!=null&&kM$2.includes(o)?o:null}function VV$2(r){const o=GM$2(r);return o!=null&&kM$2.includes(o)?o:null}function zV$2(r){const o=Qu$2(r);return o==null?null:OV$2.get(o)}function $M$2(r){return/^GEOCCS/i.test(r)}function T_$2(r){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(r)}const HV$2=1e-7;function WV$2(r){let o=/[\\"']{1}([^\\"']+)/.exec(r)?.[1];if(!o||!cc$2.units.includes(o)){const s=UM$2(r);o=null;const a=cc$2.values;for(let l=0;l{const d=c.constructor.prototype;for(const m of a){const g=f2$2(c,m,l);g.write&&typeof g.write=="object"||(g.write={}),s&&(g.write.target=s),g.write.writer=d[u]}}}var Bs$2;let Ee$1=Bs$2=class extends ee$1{static fromJSON(r){if(!r)return null;if(r?.wkid===102100)return Bs$2.WebMercator;if(r?.wkid===4326)return Bs$2.WGS84;const o=new Bs$2;return o.read(r),o}constructor(r){super(r),this.latestWkid=null,this.wkid=null,this.wkt=null,this.wkt2=null,this.vcsWkid=null,this.latestVcsWkid=null,this.imageCoordinateSystem=null}normalizeCtorArgs(r){return r&&typeof r=="object"?r:{[typeof r=="string"?"wkt":"wkid"]:r}}get isWGS84(){return Nd$1(this)}get isWebMercator(){return Ma$2(this)}get isGeographic(){return Iy$2(this)}get isWrappable(){return IM$2(this)}get metersPerUnit(){return kd$2(this)}get unit(){return Qu$2(this)||(this.isGeographic?"degrees":null)}writeWkt(r,o){this.wkid||(o.wkt=r)}clone(){if(this===Bs$2.WGS84)return new Bs$2(b_$2);if(this===Bs$2.WebMercator)return new Bs$2(__$2);const r=new Bs$2;return this.wkid!=null?(r.wkid=this.wkid,this.latestWkid!=null&&(r.latestWkid=this.latestWkid),this.vcsWkid!=null&&(r.vcsWkid=this.vcsWkid),this.latestVcsWkid!=null&&(r.latestVcsWkid=this.latestVcsWkid)):(this.wkt!=null&&(r.wkt=this.wkt),this.wkt2!=null&&(r.wkt2=this.wkt2)),this.imageCoordinateSystem&&(r.imageCoordinateSystem=gt$3(this.imageCoordinateSystem)),r}equals(r){if(r==null)return!1;if(this.imageCoordinateSystem||r.imageCoordinateSystem){if(this.imageCoordinateSystem==null||r.imageCoordinateSystem==null)return!1;const{id:o,referenceServiceName:s}=r.imageCoordinateSystem,{geodataXform:a}=r.imageCoordinateSystem,l=this.imageCoordinateSystem;return o==null||a?JSON.stringify(l)===JSON.stringify(r.imageCoordinateSystem):s?l.id===o&&l.referenceServiceName===s:l.id===o}return Ia$2(this,r)}toJSON(r){return this.write(void 0,r)}};Ee$1.GCS_NAD_1927=null,Ee$1.WGS84=null,Ee$1.WebMercator=null,Ee$1.PlateCarree=null,v([S({readOnly:!0})],Ee$1.prototype,"isWGS84",null),v([S({readOnly:!0})],Ee$1.prototype,"isWebMercator",null),v([S({readOnly:!0})],Ee$1.prototype,"isGeographic",null),v([S({readOnly:!0})],Ee$1.prototype,"isWrappable",null),v([S({type:On$2,json:{write:!0}})],Ee$1.prototype,"latestWkid",void 0),v([S({readOnly:!0})],Ee$1.prototype,"metersPerUnit",null),v([S({readOnly:!0})],Ee$1.prototype,"unit",null),v([S({type:On$2,json:{write:!0,origins:{"web-scene":{write:{overridePolicy(){return{isRequired:this.wkt==null}}}}}}})],Ee$1.prototype,"wkid",void 0),v([S({type:String,json:{origins:{"web-scene":{write:{overridePolicy(){return{isRequired:this.wkid==null}}}}}}})],Ee$1.prototype,"wkt",void 0),v([en$2("wkt"),en$2("web-scene","wkt")],Ee$1.prototype,"writeWkt",null),v([S({type:String,json:{write:!1}})],Ee$1.prototype,"wkt2",void 0),v([S({type:On$2,json:{write:!0}})],Ee$1.prototype,"vcsWkid",void 0),v([S({type:On$2,json:{write:!0}})],Ee$1.prototype,"latestVcsWkid",void 0),v([S()],Ee$1.prototype,"imageCoordinateSystem",void 0),Ee$1=Bs$2=v([it$1("esri.geometry.SpatialReference")],Ee$1),Ee$1.prototype.toJSON.isDefaultToJSON=!0,Ee$1.GCS_NAD_1927=jn$2.freeze(new Ee$1({wkid:4267,wkt:'GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'})),Ee$1.WGS84=jn$2.freeze(new Ee$1(b_$2)),Ee$1.WebMercator=jn$2.freeze(new Ee$1(__$2)),Ee$1.PlateCarree=jn$2.freeze(new Ee$1(gV$2));const Cn$2=Ee$1;let Vs$2=class extends ee$1{constructor(...o){super(...o),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=Cn$2.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(o,s){if(o instanceof Cn$2)return o;if(o!=null){const a=new Cn$2;return a.read(o,s),a}return o}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(o){return this.cache[o]}setCacheValue(o,s){this.cache[o]=s}};v([S()],Vs$2.prototype,"type",void 0),v([S({readOnly:!0})],Vs$2.prototype,"cache",null),v([S({readOnly:!0})],Vs$2.prototype,"extent",null),v([S({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],Vs$2.prototype,"hasM",void 0),v([S({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],Vs$2.prototype,"hasZ",void 0),v([S({type:Cn$2,json:{write:!0},value:Cn$2.WGS84})],Vs$2.prototype,"spatialReference",void 0),v([Un$2("spatialReference")],Vs$2.prototype,"readSpatialReference",null),Vs$2=v([it$1("esri.geometry.Geometry")],Vs$2);const Ca$2=Vs$2,tz$1=Object.prototype.toString;function ez$1(r){const o="__accessorMetadata__"in r?Ai$1(r):r;return function(...s){if(s.push(o),typeof s[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return nz$1.apply(this,s)}}function nz$1(r,o,s,a){fd$1(r,o).cast=a}function rz$1(r){return(o,s)=>{fd$1(o,r).cast=o[s]}}function Ku$2(...r){if(r.length!==3||typeof r[1]!="string")return r.length===1&&tz$1.call(r[0])==="[object Function]"?ez$1(r[0]):r.length===1&&typeof r[0]=="string"?rz$1(r[0]):void 0}const iz$1=57.29577951308232,sz$1=.017453292519943;function BM$2(r){return r*iz$1}function VM$2(r){return r*sz$1}function oz$1(r){return Math.PI/2-2*Math.atan(Math.exp(-r/Mi$2.radius))}function S_$2(r){return r.wkid!=null||r.wkt!=null}const A_$2=[0,0];function Ny$1(r,o,s,a,l){const c=r,u=l;if(u.spatialReference=s,"x"in c&&"x"in u)[u.x,u.y]=o(c.x,c.y,A_$2,a);else if("xmin"in c&&"xmin"in u)[u.xmin,u.ymin]=o(c.xmin,c.ymin,A_$2,a),[u.xmax,u.ymax]=o(c.xmax,c.ymax,A_$2,a);else if("paths"in c&&"paths"in u||"rings"in c&&"rings"in u){const d="paths"in c?c.paths:c.rings,m=[];let g;for(let y=0;y2&&g[E].push(_[E][2]),_[E].length>3&&g[E].push(_[E][3])}"paths"in u?u.paths=m:u.rings=m}else if("points"in c&&"points"in u){const d=c.points,m=[];for(let g=0;g2&&m[g].push(d[g][2]),d[g].length>3&&m[g].push(d[g][3]);u.points=m}return l}function Ld$2(r,o){const s=r&&(S_$2(r)?r:r.spatialReference),a=o&&(S_$2(o)?o:o.spatialReference);return!(r&&"type"in r&&r.type==="mesh"||o&&"type"in o&&o.type==="mesh"||!s||!a)&&(!!Ia$2(a,s)||Ma$2(a)&&Nd$1(s)||Ma$2(s)&&Nd$1(a))}function I_$2(r,o){if(r==null)return null;const s=r.spatialReference,a=o&&(S_$2(o)?o:o.spatialReference);return Ld$2(s,a)?Ia$2(s,a)?gt$3(r):Ma$2(a)?Ny$1(r,uc$2,Cn$2.WebMercator,!1,gt$3(r)):Nd$1(a)?Ny$1(r,Pd$2,Cn$2.WGS84,!1,gt$3(r)):null:null}function uc$2(r,o,s=[0,0]){o>89.99999?o=89.99999:o<-89.99999&&(o=-89.99999);const a=VM$2(o);return s[0]=VM$2(r)*Mi$2.radius,s[1]=Mi$2.halfSemiMajorAxis*Math.log((1+Math.sin(a))/(1-Math.sin(a))),s}function Pd$2(r,o,s=[0,0],a=!1){if(r===Md$2[0])s[0]=-180;else if(r===Md$2[1])s[0]=180;else{const l=BM$2(r/Mi$2.radius);s[0]=a?l:l-360*Math.floor((l+180)/360)}return s[1]=BM$2(Math.PI/2-2*Math.atan(Math.exp(-o/Mi$2.radius))),s}function Oy$2(r,o=!1,s=gt$3(r)){return Ny$1(r,uc$2,Cn$2.WebMercator,o,s)}function Dd$2(r,o=!1,s=gt$3(r)){return Ny$1(r,Pd$2,Cn$2.WGS84,o,s)}function zM$2(r,o){const s=r.x-o.x,a=r.y-o.y,l=r.z!=null&&o.z!=null?r.z-o.z:0;return Math.sqrt(s*s+a*a+l*l)}function az$1(r){return M_$2(r,HM$2)?.[0]??null}function lz$1(r){return M_$2(r,HM$2)?.[1]??null}function M_$2({x:r,y:o,spatialReference:s},a=[0,0]){if(s){if(Ma$2(s))return Pd$2(r,o,a);if(Iy$2(s))return a[0]=r,a[1]=o,a}return null}const HM$2=[0,0];var Cy$2;const N_$2=[0,0];function WM$2(r){return r&&(r.declaredClass==="esri.geometry.SpatialReference"||r.wkid!=null)}let Ir$2=Cy$2=class extends Ca$2{static copy(r,o){o._set("x",r._get("x")),o._set("y",r._get("y")),o._set("z",r._get("z")),o._set("m",r._get("m"));const s=r._get("spatialReference");o._set("spatialReference",jn$2.isFrozen(s)?s:s.clone())}constructor(...r){super(...r),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(r,o,s,a,l){let c;if(Array.isArray(r))c=r,l=o,r=c[0],o=c[1],s=c[2],a=c[3];else if(r&&typeof r=="object"){if(c=r,r=c.x!=null?c.x:c.longitude,o=c.y!=null?c.y:c.latitude,s=c.z,a=c.m,(l=c.spatialReference)&&l.declaredClass!=="esri.geometry.SpatialReference"&&(l=new Cn$2(l)),c.longitude!=null||c.latitude!=null){if(c.longitude==null)Le$1.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(c.latitude==null)Le$1.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!c.declaredClass&&l?.isWebMercator){const d=uc$2(c.longitude,c.latitude,N_$2);r=d[0],o=d[1]}}}else WM$2(s)?(l=s,s=null):WM$2(a)&&(l=a,a=null);const u={x:r,y:o};return u.x==null&&u.y!=null?Le$1.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):u.y==null&&u.x!=null&&Le$1.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),l!=null&&(u.spatialReference=l),s!=null&&(u.z=s),a!=null&&(u.m=a),u}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(r){r!==(this._get("m")!==void 0)&&(this._set("m",r?0:void 0),this._set("hasM",r))}get hasZ(){return this.z!==void 0}set hasZ(r){r!==(this._get("z")!==void 0)&&(this._set("z",r?0:void 0),this._set("hasZ",r))}get latitude(){return lz$1(this)}set latitude(r){const{spatialReference:o,x:s}=this;r!=null&&o&&(o.isWebMercator?this._set("y",uc$2(s,r,N_$2)[1]):o.isGeographic&&this._set("y",r),this._set("latitude",r))}get longitude(){return az$1(this)}set longitude(r){const{y:o,spatialReference:s}=this;r!=null&&s&&(s.isWebMercator?this._set("x",uc$2(r,o,N_$2)[0]):s.isGeographic&&this._set("x",r),this._set("longitude",r))}writeX(r,o,s){o[s]=isNaN(r)?"NaN":r}readX(r){return typeof r=="string"?NaN:r}clone(){const r=new Cy$2;return r.x=this.x,r.y=this.y,r.z=this.z,r.m=this.m,r.spatialReference=this.spatialReference,r}copy(r){return Cy$2.copy(r,this),this}equals(r){if(r==null)return!1;const{x:o,y:s,z:a,m:l,spatialReference:c}=this,{z:u,m:d}=r;let{x:m,y:g,spatialReference:y}=r;if(!c.equals(y))if(c.isWebMercator&&y.isWGS84)[m,g]=uc$2(m,g),y=c;else{if(!c.isWGS84||!y.isWebMercator)return!1;[m,g]=Pd$2(m,g),y=c}return o===m&&s===g&&a===u&&l===d&&c.wkid===y.wkid}offset(r,o,s){return this.x+=r,this.y+=o,s!=null&&(this.z=(this.z??0)+s),this}normalize(){if(!this.spatialReference)return this;const r=Zu$2(this.spatialReference);if(!r)return this;let o=this.x;const[s,a]=r.valid,l=2*a;let c;return o>a?(c=Math.ceil(Math.abs(o-a)/l),o-=c*l):oisNaN(r)?r:ud$2(r))],Ir$2.prototype,"x",void 0),v([en$2("x")],Ir$2.prototype,"writeX",null),v([Un$2("x")],Ir$2.prototype,"readX",null),v([S({type:Number,json:{write:!0}})],Ir$2.prototype,"y",void 0),v([S({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],Ir$2.prototype,"z",void 0),v([S({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],Ir$2.prototype,"m",void 0),Ir$2=Cy$2=v([it$1("esri.geometry.Point")],Ir$2),Ir$2.prototype.toJSON.isDefaultToJSON=!0;const wn$1=Ir$2,O_$2=[0,0];function C_$2(r,o){return o!=null&&Mr$2(r,o.x,o.y,o.z)}function cz$1(r,o){if(!o.points||o.points.length)return!1;for(const s of o.points)if(!th$2(r,s))return!1;return!0}function uz$1(r,o){const{xmin:s,ymin:a,zmin:l,xmax:c,ymax:u,zmax:d}=o;return r.hasZ&&o.hasZ?Mr$2(r,s,a,l)&&Mr$2(r,s,u,l)&&Mr$2(r,c,u,l)&&Mr$2(r,c,a,l)&&Mr$2(r,s,a,d)&&Mr$2(r,s,u,d)&&Mr$2(r,c,u,d)&&Mr$2(r,c,a,d):Mr$2(r,s,a)&&Mr$2(r,s,u)&&Mr$2(r,c,u)&&Mr$2(r,c,a)}function th$2(r,o){return Mr$2(r,o[0],o[1])}function hz$1(r,o){return Mr$2(r,o[0],o[1],o[2])}function Mr$2(r,o,s,a){return o>=r.xmin&&o<=r.xmax&&s>=r.ymin&&s<=r.ymax&&(a==null||!r.hasZ||a>=r.zmin&&a<=r.zmax)}function XM$2(r,o){return O_$2[1]=o.y,O_$2[0]=o.x,pz$1(r,O_$2)}function pz$1(r,o){return R_$2(r.rings,o)}function R_$2(r,o){if(!r)return!1;if(dz$1(r))return YM$2(!1,r,o);let s=!1;for(let a=0,l=r.length;a=l||E=l)&&g+(l-y)/(E-y)*(_-g)=0&&D<=1&&P>=0&&P<=1&&(l&&(l[0]=c+D*(d-c),l[1]=u+D*(m-u)),!0)}function KM$2(r){switch(r){case"esriGeometryEnvelope":case"extent":return JM$2;case"esriGeometryMultipoint":case"multipoint":return mz$1;case"esriGeometryPoint":case"point":return fz$1;case"esriGeometryMultiPatch":case"multipatch":case"esriGeometryPolygon":case"polygon":return ZM$2;case"esriGeometryPolyline":case"polyline":return vz$1}}var Ri$2;function _z$1(r){return r&&(r.declaredClass==="esri.geometry.SpatialReference"||r.wkid!=null)}function Ra$2(r,o,s){return o==null?s:s==null?o:r(o,s)}let $n$2=Ri$2=class extends Ca$2{constructor(...r){super(...r),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(r,o,s,a,l){return _z$1(r)?{spatialReference:r,xmin:0,ymin:0,xmax:0,ymax:0}:typeof r=="object"?(r.spatialReference=r.spatialReference==null?Cn$2.WGS84:r.spatialReference,r):{xmin:r,ymin:o,xmax:s,ymax:a,spatialReference:l??Cn$2.WGS84}}static fromBounds(r,o){return new Ri$2({xmin:r[0],ymin:r[1],xmax:r[2],ymax:r[3],spatialReference:o})}static fromPoint(r){return new Ri$2({xmin:r.x,ymin:r.y,zmin:r.z,xmax:r.x,ymax:r.y,zmax:r.z,spatialReference:r.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const r=new wn$1({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(r.z=.5*(this.zmin+this.zmax)),this.hasM&&(r.m=.5*(this.mmin+this.mmax)),r}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(r){const o=this.center;return r.z!=null&&this.hasZ?this.offset(r.x-o.x,r.y-o.y,r.z-o.z):this.offset(r.x-o.x,r.y-o.y)}clone(){const r=new Ri$2;return r.xmin=this.xmin,r.ymin=this.ymin,r.xmax=this.xmax,r.ymax=this.ymax,r.spatialReference=this.spatialReference,this.zmin!=null&&(r.zmin=this.zmin,r.zmax=this.zmax),this.mmin!=null&&(r.mmin=this.mmin,r.mmax=this.mmax),r}contains(r){if(!r)return!1;const o=this.spatialReference,s=r.spatialReference;return o&&s&&!o.equals(s)&&Ld$2(o,s)&&(r=o.isWebMercator?Oy$2(r):Dd$2(r,!0)),r.type==="point"?C_$2(this,r):r.type==="extent"&&uz$1(this,r)}equals(r){if(this===r)return!0;if(r==null)return!1;const o=this.spatialReference,s=r.spatialReference;return o&&s&&!o.equals(s)&&Ld$2(o,s)&&(r=o.isWebMercator?Oy$2(r):Dd$2(r,!0)),this.xmin===r.xmin&&this.ymin===r.ymin&&this.zmin===r.zmin&&this.mmin===r.mmin&&this.xmax===r.xmax&&this.ymax===r.ymax&&this.zmax===r.zmax&&this.mmax===r.mmax}expand(r){const o=.5*(1-r),s=this.width*o,a=this.height*o;if(this.xmin+=s,this.ymin+=a,this.xmax-=s,this.ymax-=a,this.hasZ){const l=(this.zmax-this.zmin)*o;this.zmin+=l,this.zmax-=l}if(this.hasM){const l=(this.mmax-this.mmin)*o;this.mmin+=l,this.mmax-=l}return this}intersects(r){if(r==null)return!1;r.type==="mesh"&&(r=r.extent);const o=this.spatialReference,s=r.spatialReference;return o&&s&&!Ia$2(o,s)&&Ld$2(o,s)&&(r=o.isWebMercator?Oy$2(r):Dd$2(r,!0)),KM$2(r.type)(this,r)}normalize(){const r=this._normalize(!1,!0);return Array.isArray(r)?r:[r]}offset(r,o,s){return this.xmin+=r,this.ymin+=o,this.xmax+=r,this.ymax+=o,s!=null&&(this.zmin+=s,this.zmax+=s),this}shiftCentralMeridian(){return this._normalize(!0)}union(r){return this===r||(this.xmin=Math.min(this.xmin,r.xmin),this.ymin=Math.min(this.ymin,r.ymin),this.xmax=Math.max(this.xmax,r.xmax),this.ymax=Math.max(this.ymax,r.ymax),(this.hasZ||r.hasZ)&&(this.zmin=Ra$2(Math.min,this.zmin,r.zmin),this.zmax=Ra$2(Math.max,this.zmax,r.zmax)),(this.hasM||r.hasM)&&(this.mmin=Ra$2(Math.min,this.mmin,r.mmin),this.mmax=Ra$2(Math.max,this.mmax,r.mmax))),this}intersection(r){return this===r?this:r!=null&&this.intersects(r)?(this.xmin=Math.max(this.xmin,r.xmin),this.ymin=Math.max(this.ymin,r.ymin),this.xmax=Math.min(this.xmax,r.xmax),this.ymax=Math.min(this.ymax,r.ymax),(this.hasZ||r.hasZ)&&(this.zmin=Ra$2(Math.max,this.zmin,r.zmin),this.zmax=Ra$2(Math.min,this.zmax,r.zmax)),(this.hasM||r.hasM)&&(this.mmin=Ra$2(Math.max,this.mmin,r.mmin),this.mmax=Ra$2(Math.min,this.mmax,r.mmax)),this):null}toJSON(r){return this.write({},r)}_shiftCM(r=Zu$2(this.spatialReference)){if(!r||!this.spatialReference)return this;const o=this.spatialReference,s=this._getCM(r);if(s){const a=o.isWebMercator?Dd$2(s):s;this.xmin-=s.x,this.xmax-=s.x,o.isWebMercator||(a.x=k_$2(a.x,r).x),this.spatialReference=new Cn$2(l2$2((o.isWGS84?r.altTemplate:null)??r.wkTemplate,{Central_Meridian:a.x}))}return this}_getCM(r){let o=null;const[s,a]=r.valid,l=this.xmin,c=this.xmax;return l>=s&&l<=a&&c>=s&&c<=a||(o=this.center),o}_normalize(r,o,s){const a=this.spatialReference;if(!a)return this;const l=s??Zu$2(a);if(l==null)return this;const c=this._getParts(l).map(m=>m.extent);if(c.length<2)return c[0]||this;if(c.length>2)return r?this._shiftCM(l):this.set({xmin:l.valid[0],xmax:l.valid[1]});if(r)return this._shiftCM(l);if(o)return c;let u=!0,d=!0;return c.forEach(m=>{m.hasZ||(u=!1),m.hasM||(d=!1)}),{rings:c.map(m=>{const g=[[m.xmin,m.ymin],[m.xmin,m.ymax],[m.xmax,m.ymax],[m.xmax,m.ymin],[m.xmin,m.ymin]];if(u){const y=(m.zmax-m.zmin)/2;for(let _=0;_0;if(d>2*E){const M=new Ri$2(mk||R?o.push({extent:new Ri$2(w,l,E,c,u),frameIds:[T]},{extent:new Ri$2(_,l,k,c,u),frameIds:[O]}):o.push({extent:new Ri$2(w,l,k,c,u),frameIds:[T]});this.cache._parts=o}const s=this.hasZ,a=this.hasM;if(s||a){const l={};s&&(l.zmin=this.zmin,l.zmax=this.zmax),a&&(l.mmin=this.mmin,l.mmax=this.mmax);for(let c=0;ca?(c=Math.ceil(Math.abs(r-a)/l),r-=c*l,u=c):ro==null?s:s==null?o:r(o,s)}function wz$1(r){return r&&(r.declaredClass==="esri.geometry.SpatialReference"||r.wkid!=null)}let ka$2=L_$2=class extends Ca$2{constructor(...r){super(...r),this.points=[],this.type="multipoint"}normalizeCtorArgs(r,o){if(!r&&!o)return{};const s={};Array.isArray(r)?(s.points=r,s.spatialReference=o):wz$1(r)?s.spatialReference=r:(r.points&&(s.points=r.points),r.spatialReference&&(s.spatialReference=r.spatialReference),r.hasZ&&(s.hasZ=r.hasZ),r.hasM&&(s.hasM=r.hasM));const a=s.points?.[0];return a&&(s.hasZ===void 0&&s.hasM===void 0?(s.hasZ=a.length>2,s.hasM=!1):s.hasZ===void 0?s.hasZ=a.length>3:s.hasM===void 0&&(s.hasM=a.length>3)),s}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const r=this.points;if(!r.length)return null;const o=new hi$2,s=this.hasZ,a=this.hasM,l=s?3:2,c=r[0],u=tN$1(Math.min),d=tN$1(Math.max);let m,g,y,_,[E,w]=c,[T,k]=c;for(let O=0,R=r.length;O2){const P=M[2];m=u(m,P),y=d(y,P)}if(a&&M.length>l){const P=M[l];g=u(g,P),_=d(_,P)}}return o.xmin=E,o.ymin=w,o.xmax=T,o.ymax=k,o.spatialReference=this.spatialReference,s?(o.zmin=m,o.zmax=y):(o.zmin=void 0,o.zmax=void 0),a?(o.mmin=g,o.mmax=_):(o.mmin=void 0,o.mmax=void 0),o}writePoints(r,o){o.points=gt$3(this.points)}addPoint(r){return eh$2(this,r),Array.isArray(r)?this.points.push(r):this.points.push(r.toArray()),this.notifyChange("points"),this}clone(){const r={points:gt$3(this.points),spatialReference:this.spatialReference};return this.hasZ&&(r.hasZ=!0),this.hasM&&(r.hasM=!0),new L_$2(r)}getPoint(r){if(!this._validateInputs(r))return null;const o=this.points[r],s={x:o[0],y:o[1],spatialReference:this.spatialReference};let a=2;return this.hasZ&&(s.z=o[2],a=3),this.hasM&&(s.m=o[a]),new wn$1(s)}removePoint(r){if(!this._validateInputs(r))return null;const o=new wn$1(this.points.splice(r,1)[0],this.spatialReference);return this.notifyChange("points"),o}setPoint(r,o){return this._validateInputs(r)?(eh$2(this,o),Array.isArray(o)||(o=o.toArray()),this.points[r]=o,this.notifyChange("points"),this):this}toJSON(r){return this.write({},r)}_validateInputs(r){return r!=null&&r>=0&&r2&&o.length>2){const l=r[2]-o[2];return Math.sqrt(s*s+a*a+l*l)}return Math.sqrt(s*s+a*a)}function Ez$1(r,o,s){const a=r[0]+s*(o[0]-r[0]),l=r[1]+s*(o[1]-r[1]);return r.length>2&&o.length>2?[a,l,r[2]+s*(o[2]-r[2])]:[a,l]}function Tz$1(r,o,s,a){return nN$1(r,o,s[a],s[a+1])}function nN$1(r,o,s,a){const[l,c]=o,[u,d]=s,[m,g]=a,y=m-u,_=g-d,E=y*y+_*_,w=(l-u)*y+(c-d)*_,T=Math.min(1,Math.max(0,w/E));return r[0]=u+y*T,r[1]=d+_*T,r}function Sz$1(r,o,s,a,l,c){let u=s,d=a,m=l-u,g=c-d;if(m!==0||g!==0){const y=((r-u)*m+(o-d)*g)/(m*m+g*g);y>1?(u=l,d=c):y>0&&(u+=m*y,d+=g*y)}return m=r-u,g=o-d,m*m+g*g}function rN$1(r,o){return Ez$1(r,o,.5)}function Az$1(r){const o=r.length;let s=0;for(let a=0;a=0}function iN$1(r){const o=r.length;return o<3||cd$1(r[0],r[o-1])}function Iz$1(r){"rings"in r&&(sN$1(r),Mz$1(r))}function sN$1(r){if(!("rings"in r))return!1;let o=!1;for(const s of r.rings)iN$1(s)||(s.push(s[0].slice()),o=!0);return o}function Mz$1(r){if(!("rings"in r)||r.rings.length===0||D_$2(r.rings[0]))return!1;for(const o of r.rings)o.reverse();return!0}function Nz$1(r){return r.type!=="polygon"&&r.type!=="polyline"||oN$1(r.type==="polygon"?r.rings:r.paths,r.spatialReference),r}function oN$1(r,o){const s=Zu$2(o);if(!s)return;const a=s.valid[0],l=s.valid[1],c=l-a;for(const u of r){let d=1/0,m=-1/0;for(const y of u){const _=Oz$1(y[0],a,l);d=Math.min(d,_),m=Math.max(m,_),y[0]=_}const g=m-d;c-g{y[0]<0&&(y[0]+=c)})}}function Oz$1(r,o,s){const a=s-o;return rs?o+(r-o)%a:r}function Cz$1(r,o){if(r===o)return!0;if(r.type!==o.type)return!1;if(r.type==="point"||r.type==="mesh"||r.type==="extent")return!0;if(r.type==="multipoint")return r.points.length===o.points.length;const[s,a]=r.type==="polyline"?[r.paths,o.paths]:[r.rings,o.rings];return s.length===a.length&&s.every((l,c)=>l.length===a[c].length)}function Rz$1(r){return r?r.hasZ?[r.xmax-r.xmin/2,r.ymax-r.ymin/2,r.zmax-r.zmin/2]:[r.xmax-r.xmin/2,r.ymax-r.ymin/2]:null}function aN$2(r){return r?lN$2(r.rings,r.hasZ??!1):null}function lN$2(r,o){if(!r?.length)return null;const s=[],a=[],l=o?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let c=0,u=r.length;c{let d=c[2]-u[2];return d===0&&o&&(d=c[4]-u[4]),d}),a.length&&(s[0]=a[0][0],s[1]=a[0][1],o&&(s[2]=a[0][3]),(s[0]l[1]||s[1]l[3]||o&&(s[2]l[5]))&&(s.length=0)),!s.length){const c=r[0]&&r[0].length?Lz$1(r[0],o):null;if(!c)return null;s[0]=c[0],s[1]=c[1],o&&c.length>2&&(s[2]=c[2])}return s}function cN$2(r,o,s){let a=0,l=0,c=0,u=0,d=0;const m=r.length?r[0][0]:0,g=r.length?r[0][1]:0,y=r.length&&o?r[0][2]:0;for(let E=0;E2&&T.length>2){const J=R-y,z=I-y,ie=M*z-L*J;c+=(J+z)*ie,d+=ie}ks[1]&&(s[1]=k),Os[3]&&(s[3]=O),o&&(Rs[5]&&(s[5]=R))}if(u>0&&(u*=-1),d>0&&(d*=-1),!u)return null;u*=.5,d*=.5;const _=[a/(6*u)+m,l/(6*u)+g,u];return o&&(s[4]===s[5]||d===0?(_[3]=(s[4]+s[5])/2,_[4]=0):(_[3]=c/(6*d)+y,_[4]=d)),_}function kz$1(r,o){let s=0,a=0,l=0;r.nextPoint();const c=r.pathSize?r.x:0,u=r.pathSize?r.y:0;for(let d=0;do[1]&&(o[1]=y),_o[3]&&(o[3]=_)}return l>0&&(l*=-1),l?(l*=.5,[s/(6*l)+c,a/(6*l)+u,l]):null}function Lz$1(r,o){const s=o?[0,0,0]:[0,0],a=o?[0,0,0]:[0,0];let l=0,c=0,u=0,d=0;for(let m=0,g=r.length;m2&&_.length>2&&(s[2]=y[2],a[2]=_[2]);const E=P_$2(s,a);if(E){l+=E;const w=rN$1(y,_);c+=E*w[0],u+=E*w[1],o&&w.length>2&&(d+=E*w[2])}}}return l>0?o?[c/l,u/l,d/l]:[c/l,u/l]:r.length?r[0]:null}function Pz$1(r){const{hasZ:o,totalSize:s}=r;if(s===0)return null;const a=[],l=[],c=o?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(r.reset();r.nextPath();){const u=cN$2(eN$1(r),r.hasZ,c);u&&l.push(u)}if(l.sort((u,d)=>{let m=u[2]-d[2];return m===0&&o&&(m=u[4]-d[4]),m}),l.length&&(a[0]=l[0][0],a[1]=l[0][1],o&&(a[2]=l[0][3]),(a[0]c[1]||a[1]c[3]||o&&(a[2]c[5]))&&(a.length=0)),!a.length){r.reset(),r.nextPath();const u=r.pathSize?Dz$1(r):null;if(!u)return null;a[0]=u[0],a[1]=u[1],o&&u.length>2&&(a[2]=u[2])}return a}function Dz$1(r){const{hasZ:o}=r,s=o?[0,0,0]:[0,0],a=o?[0,0,0]:[0,0];let l=0,c=0,u=0,d=0;if(r.nextPoint()){let m=r.x,g=r.y,y=r.z;for(;r.nextPoint();){const _=r.x,E=r.y,w=r.z;s[0]=m,s[1]=g,a[0]=_,a[1]=E,o&&(s[2]=y,a[2]=w);const T=P_$2(s,a);if(T){l+=T;const k=rN$1(s,a);c+=T*k[0],u+=T*k[1],o&&k.length>2&&(d+=T*k[2])}m=_,g=E,y=w}}return l>0?o?[c/l,u/l,d/l]:[c/l,u/l]:r.pathSize?(r.seekPathStart(),r.nextPoint(),[r.x,r.y]):null}const Gz$1=1e-6;function Fz$1(r){let o=0;for(r.reset();r.nextPath();)o+=r.getCurrentRingArea();if(or[2]&&(r[2]=o[0]),o[1]r[3]&&(r[3]=o[1])}function Hz$1(r,o,s){if(o!=null)if("length"in o)G_$1(o)?(s[0]=Math.min(r[0],o[0]),s[1]=Math.min(r[1],o[1]),s[2]=Math.max(r[2],o[2]),s[3]=Math.max(r[3],o[3])):o.length!==2&&o.length!==3||(s[0]=Math.min(r[0],o[0]),s[1]=Math.min(r[1],o[1]),s[2]=Math.max(r[2],o[0]),s[3]=Math.max(r[3],o[1]));else switch(o.type){case"extent":s[0]=Math.min(r[0],o.xmin),s[1]=Math.min(r[1],o.ymin),s[2]=Math.max(r[2],o.xmax),s[3]=Math.max(r[3],o.ymax);break;case"point":s[0]=Math.min(r[0],o.x),s[1]=Math.min(r[1],o.y),s[2]=Math.max(r[2],o.x),s[3]=Math.max(r[3],o.y)}else uN$2(s,r)}function hN$1(r){return r==null||r[0]>=r[2]?0:r[2]-r[0]}function pN$1(r){return r==null||r[1]>=r[3]?0:r[3]-r[1]}function Wz$1(r){return hN$1(r)*pN$1(r)}function Xz$1(r,o=[0,0]){return o[0]=(r[0]+r[2])/2,o[1]=(r[1]+r[3])/2,o}function Yz$1(r,o,s){return o>=r[0]&&s>=r[1]&&o<=r[2]&&s<=r[3]}function Jz$1(r,o){return Math.max(o[0],r[0])<=Math.min(o[2],r[2])&&Math.max(o[1],r[1])<=Math.min(o[3],r[3])}function qz$1(r,o){return o[0]>=r[0]&&o[2]<=r[2]&&o[1]>=r[1]&&o[3]<=r[3]}function Zz$1(r){return r?uN$2(r,F_$1):nh$2(F_$1)}function G_$1(r){return r!=null&&r.length===4}function Qz$1(r,o){return G_$1(r)&&G_$1(o)?r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]&&r[3]===o[3]:r===o}const F_$1=[1/0,1/0,-1/0,-1/0],Kz$1=[0,0,0,0];function dN$2(r){return r.xmin!==void 0&&r.ymin!==void 0&&r.xmax!==void 0&&r.ymax!==void 0}function fN$1(r){return r.points!==void 0}function mN$1(r){return r.x!==void 0&&r.y!==void 0}function yN$2(r){return r.paths!==void 0}function gN$2(r){return r.rings!==void 0}function vN$2(r){function o(s,a){return s==null?a:a==null?s:r(s,a)}return o}const La$2=vN$2(Math.min),Pa$2=vN$2(Math.max);function tH$1(r,o){return yN$2(o)?rh$2(r,o.paths,!1,!1):gN$2(o)?rh$2(r,o.rings,!1,!1):fN$1(o)?j_$2(r,o.points,!1,!1,!1,!1):dN$2(o)?_N$2(r,o):(mN$1(o)&&(r[0]=o.x,r[1]=o.y,r[2]=o.x,r[3]=o.y),r)}function eH$1(r){let o,s,a,l;for(r.reset(),o=a=1/0,s=l=-1/0;r.nextPath();){const c=bN$2(r);o=Math.min(c[0],o),a=Math.min(c[1],a),s=Math.max(c[2],s),l=Math.max(c[3],l)}return nh$2([o,a,s,l])}function bN$2(r){let o,s,a,l;for(o=a=1/0,s=l=-1/0;r.nextPoint();)o=Math.min(r.x,o),a=Math.min(r.y,a),s=Math.max(r.x,s),l=Math.max(r.y,l);return nh$2([o,a,s,l])}function nH$1(r,o){return yN$2(o)?rh$2(r,o.paths,!0,!1):gN$2(o)?rh$2(r,o.rings,!0,!1):fN$1(o)?j_$2(r,o.points,!0,!1,!0,!1):dN$2(o)?_N$2(r,o,!0,!1,!0,!1):(mN$1(o)&&(r[0]=o.x,r[1]=o.y,r[2]=o.z,r[3]=o.x,r[4]=o.y,r[5]=o.z),r)}function rh$2(r,o,s,a){const l=s?3:2;if(!o.length||!o[0].length)return null;let c,u,d,m,[g,y]=o[0][0],[_,E]=o[0][0];for(let w=0;w2){const N=O[2];c=La$2(c,N),u=Pa$2(u,N)}if(a&&O.length>l){const N=O[l];d=La$2(c,N),m=Pa$2(u,N)}}}return s?a?(r[0]=g,r[1]=y,r[2]=c,r[3]=d,r[4]=_,r[5]=E,r[6]=u,r[7]=m,r.length=8,r):(r[0]=g,r[1]=y,r[2]=c,r[3]=_,r[4]=E,r[5]=u,r.length=6,r):a?(r[0]=g,r[1]=y,r[2]=d,r[3]=_,r[4]=E,r[5]=m,r.length=6,r):(r[0]=g,r[1]=y,r[2]=_,r[3]=E,r.length=4,r)}function _N$2(r,o,s,a,l,c){const u=o.xmin,d=o.xmax,m=o.ymin,g=o.ymax;let y=o.zmin,_=o.zmax,E=o.mmin,w=o.mmax;return l?(y=y||0,_=_||0,c?(E=E||0,w=w||0,r[0]=u,r[1]=m,r[2]=y,r[3]=E,r[4]=d,r[5]=g,r[6]=_,r[7]=w,r):(r[0]=u,r[1]=m,r[2]=y,r[3]=d,r[4]=g,r[5]=_,r)):c?(E=E||0,w=w||0,r[0]=u,r[1]=m,r[2]=E,r[3]=d,r[4]=g,r[5]=w,r):(r[0]=u,r[1]=m,r[2]=d,r[3]=g,r)}function j_$2(r,o,s,a,l,c){const u=s?3:2,d=a&&c,m=s&&l;if(!o.length||!o[0].length)return null;let g,y,_,E,[w,T]=o[0],[k,O]=o[0];for(let R=0;R2){const P=M[2];g=La$2(g,P),y=Pa$2(y,P)}if(d&&M.length>u){const P=M[u];_=La$2(g,P),E=Pa$2(y,P)}}return l?(g=g||0,y=y||0,c?(_=_||0,E=E||0,r[0]=w,r[1]=T,r[2]=g,r[3]=_,r[4]=k,r[5]=O,r[6]=y,r[7]=E,r):(r[0]=w,r[1]=T,r[2]=g,r[3]=k,r[4]=O,r[5]=y,r)):c?(_=_||0,E=E||0,r[0]=w,r[1]=T,r[2]=_,r[3]=k,r[4]=O,r[5]=E,r):(r[0]=w,r[1]=T,r[2]=k,r[3]=O,r)}function rH$1(r){return r.xmin!==void 0&&r.ymin!==void 0&&r.xmax!==void 0&&r.ymax!==void 0}function iH$1(r){return r.points!==void 0}function sH$1(r){return r.x!==void 0&&r.y!==void 0}function oH$1(r){return r.paths!==void 0}function aH$1(r){return r.rings!==void 0}const U_$2=[];function wN$1(r,o,s,a){return{xmin:r,ymin:o,xmax:s,ymax:a}}function xN$2(r,o,s,a,l,c){return{xmin:r,ymin:o,zmin:s,xmax:a,ymax:l,zmax:c}}function EN$2(r,o,s,a,l,c){return{xmin:r,ymin:o,mmin:s,xmax:a,ymax:l,mmax:c}}function TN$2(r,o,s,a,l,c,u,d){return{xmin:r,ymin:o,zmin:s,mmin:a,xmax:l,ymax:c,zmax:u,mmax:d}}function $_$2(r,o=!1,s=!1){return o?s?TN$2(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]):xN$2(r[0],r[1],r[2],r[3],r[4],r[5]):s?EN$2(r[0],r[1],r[2],r[3],r[4],r[5]):wN$1(r[0],r[1],r[2],r[3])}function lH$1(r){return r?rH$1(r)?r:sH$1(r)?uH$1(r):aH$1(r)?B_$2(r):oH$1(r)?SN$1(r):iH$1(r)?cH$1(r):null:null}function cH$1(r){const{hasZ:o,hasM:s,points:a}=r;return $_$2(j_$2(U_$2,a,o??!1,s??!1),o,s)}function uH$1(r){const{x:o,y:s,z:a,m:l}=r,c=l!=null;return a!=null?c?TN$2(o,s,a,l,o,s,a,l):xN$2(o,s,a,o,s,a):c?EN$2(o,s,l,o,s,l):wN$1(o,s,o,s)}function B_$2(r){const{hasZ:o,hasM:s,rings:a}=r,l=rh$2(U_$2,a,o??!1,s??!1);return l?$_$2(l,o,s):null}function SN$1(r){const{hasZ:o,hasM:s,paths:a}=r,l=rh$2(U_$2,a,o??!1,s??!1);return l?$_$2(l,o,s):null}var ky$2;function AN$1(r){return!Array.isArray(r[0])}function hH$1(r){return typeof r[0]?.[0]=="number"}function pH$1(r){if(!r)return;let{rings:o,hasM:s,hasZ:a,spatialReference:l}=r;switch(o??=[],hH$1(o)&&(o=[o]),o[0]?.[0]?.length){case 4:a??=!0,s??=!0;break;case 3:a??=s!==!0,s??=!a;break;default:a??=!1,s??=!1}return l??=Cn$2.WGS84,{...r,hasM:s,hasZ:a,rings:o,spatialReference:l}}let zs$2=ky$2=class extends Ca$2{static fromExtent(r){const o=r.clone().normalize(),{spatialReference:s}=r;let a=!1,l=!1;for(const u of o)u.hasZ&&(a=!0),u.hasM&&(l=!0);const c={rings:o.map(u=>{const d=[[u.xmin,u.ymin],[u.xmin,u.ymax],[u.xmax,u.ymax],[u.xmax,u.ymin],[u.xmin,u.ymin]];if(a&&u.hasZ){const m=u.zmin+.5*(u.zmax-u.zmin);for(let g=0;gl===m&&c===g&&(u==null&&y==null||u===y)&&(d==null&&_==null||d===_);for(let l=0;lthis.hasZ?this.hasM?[s.x,s.y,s.z,s.m]:[s.x,s.y,s.z]:[s.x,s.y]):r;return D_$2(o)}getPoint(r,o){if(!this._validateInputs(r,o))return null;const s=this.rings[r][o],a=this.hasZ,l=this.hasM;return a&&!l?new wn$1(s[0],s[1],s[2],void 0,this.spatialReference):l&&!a?new wn$1(s[0],s[1],void 0,s[2],this.spatialReference):a&&l?new wn$1(s[0],s[1],s[2],s[3],this.spatialReference):new wn$1(s[0],s[1],this.spatialReference)}insertPoint(r,o,s){return this._validateInputs(r,o,!0)?(eh$2(this,s),Array.isArray(s)||(s=s.toArray()),this.rings[r].splice(o,0,s),this.notifyChange("rings"),this):this}removePoint(r,o){if(!this._validateInputs(r,o))return null;const s=new wn$1(this.rings[r].splice(o,1)[0],this.spatialReference);return this.notifyChange("rings"),s}removeRing(r){if(!this._validateInputs(r,null))return null;const o=this.rings.splice(r,1)[0],s=this.spatialReference,a=o.map(l=>new wn$1(l,s));return this.notifyChange("rings"),a}setPoint(r,o,s){return this._validateInputs(r,o)?(eh$2(this,s),Array.isArray(s)||(s=s.toArray()),this.rings[r][o]=s,this.notifyChange("rings"),this):this}_validateInputs(r,o,s=!1){if(r==null||r<0||r>=this.rings.length)return!1;if(o!=null){const a=this.rings[r];if(s&&(o<0||o>a.length)||!s&&(o<0||o>=a.length))return!1}return!0}toJSON(r){return this.write({},r)}};v([S({readOnly:!0})],zs$2.prototype,"cache",null),v([S({readOnly:!0})],zs$2.prototype,"centroid",null),v([S({readOnly:!0})],zs$2.prototype,"extent",null),v([S({readOnly:!0})],zs$2.prototype,"isSelfIntersecting",null),v([S({type:[[[Number]]],json:{write:{isRequired:!0}}})],zs$2.prototype,"rings",void 0),v([en$2("rings")],zs$2.prototype,"writeRings",null),zs$2=ky$2=v([it$1("esri.geometry.Polygon")],zs$2);const Da$2=zs$2;zs$2.prototype.toJSON.isDefaultToJSON=!0;var V_$2;function dH$1(r){return!Array.isArray(r[0])}function fH$1(r){return typeof r[0]?.[0]=="number"}function mH$1(r){if(!r)return;let{paths:o,hasM:s,hasZ:a,spatialReference:l}=r;switch(o??=[],fH$1(o)&&(o=[o]),o[0]?.[0]?.length){case 4:a??=!0,s??=!0;break;case 3:a??=s!==!0,s??=!a;break;default:a??=!1,s??=!1}return l??=Cn$2.WGS84,{...r,hasM:s,hasZ:a,paths:o,spatialReference:l}}let Ga$2=V_$2=class extends Ca$2{constructor(r){super(mH$1(r)),this.paths=[],this.type="polyline"}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:r}=this,o=SN$1(this);if(!o)return null;const s=new hi$2(o);return s.spatialReference=r,s}writePaths(r,o){o.paths=gt$3(this.paths)}addPath(r){if(!r)return;const o=this.paths,s=o.length;if(dH$1(r)){const a=[];for(let l=0,c=r.length;lnew wn$1(l,s));return this.notifyChange("paths"),a}removePoint(r,o){if(!this._validateInputs(r,o))return null;const s=new wn$1(this.paths[r].splice(o,1)[0],this.spatialReference);return this.notifyChange("paths"),s}setPoint(r,o,s){return this._validateInputs(r,o)?(eh$2(this,s),Array.isArray(s)||(s=s.toArray()),this.paths[r][o]=s,this.notifyChange("paths"),this):this}_validateInputs(r,o,s=!1){if(r==null||r<0||r>=this.paths.length)return!1;if(o!=null){const a=this.paths[r];if(s&&(o<0||o>a.length)||!s&&(o<0||o>=a.length))return!1}return!0}toJSON(r){return this.write({},r)}};v([S({readOnly:!0})],Ga$2.prototype,"cache",null),v([S({readOnly:!0})],Ga$2.prototype,"extent",null),v([S({type:[[[Number]]],json:{write:{isRequired:!0}}})],Ga$2.prototype,"paths",void 0),v([en$2("paths")],Ga$2.prototype,"writePaths",null),Ga$2=V_$2=v([it$1("esri.geometry.Polyline")],Ga$2);const ih$2=Ga$2;Ga$2.prototype.toJSON.isDefaultToJSON=!0;function z_$2(r){return r.xmin!==void 0&&r.ymin!==void 0&&r.xmax!==void 0&&r.ymax!==void 0}function H_$2(r){return r.points!==void 0}function W_$1(r){return r.x!==void 0&&r.y!==void 0}function X_$2(r){return r.paths!==void 0}function Y_$2(r){return r.rings!==void 0}function Ly$2(r){return r==null?null:r instanceof Ca$2?r:W_$1(r)?wn$1.fromJSON(r):X_$2(r)?ih$2.fromJSON(r):Y_$2(r)?Da$2.fromJSON(r):H_$2(r)?Gd$2.fromJSON(r):z_$2(r)?hi$2.fromJSON(r):null}function yH$1(r){return r?W_$1(r)?"esriGeometryPoint":X_$2(r)?"esriGeometryPolyline":Y_$2(r)?"esriGeometryPolygon":z_$2(r)?"esriGeometryEnvelope":H_$2(r)?"esriGeometryMultipoint":null:null}const gH$1={esriGeometryPoint:wn$1,esriGeometryPolyline:ih$2,esriGeometryPolygon:Da$2,esriGeometryEnvelope:hi$2,esriGeometryMultipoint:Gd$2,esriGeometryMultiPatch:Da$2};function vH$1(r){return r&&gH$1[r]||null}const bH$1=Ii$2()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),_H$1=Ii$2()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),J_$2={base:Ca$2,key:"type",typeMap:{extent:hi$2,multipoint:Gd$2,point:wn$1,polyline:ih$2,polygon:Da$2}};_a$2(J_$2);const Hs$2=r=>{let o=class extends r{clone(){const s=No$2(this);dI$2(s,"unable to clone instance of non-accessor class");const a=s.metadata,l=s.store,c={},u=new Map;for(const m in a){const g=a[m],y=l?.originOf(m),_=g.clonable;if(g.readOnly||_===!1||y!==ue.USER&&y!==ue.DEFAULTS&&y!==ue.WEB_MAP&&y!==ue.WEB_SCENE)continue;const E=this[m];let w=null;w=typeof _=="function"?_(E):_==="reference"?E:i2$2(E),E!=null&&w==null||(y===ue.DEFAULTS?u.set(m,w):c[m]=w)}const d=new(Object.getPrototypeOf(this)).constructor(c);if(u.size){const m=No$2(d)?.store;if(m)for(const[g,y]of u)m.set(g,y,ue.DEFAULTS)}return d}};return o=v([it$1("esri.core.Clonable")],o),o};let q_$2=class extends Hs$2(jn$2){};q_$2=v([it$1("esri.core.Clonable")],q_$2);let Py$2=class fie{constructor(){this._emitter=new fie.EventEmitter(this)}emit(o,s){return this._emitter.emit(o,s)}on(o,s){return this._emitter.on(o,s)}once(o,s){return this._emitter.once(o,s)}hasEventListener(o){return this._emitter.hasEventListener(o)}};(function(r){class o{constructor(l=null){this._target=l,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(l,c){let u=this._listenersMap?.get(l);if(!u)return!1;const d=this._target||this;let m=!1;for(const g of u.slice()){const y="deref"in g?g.deref():g;y?y?.call(d,c):m=!0}return m&&(u=u.filter(g=>!("deref"in g)||g.deref()!=null),this._listenersMap.set(l,u)),u.length>0}on(l,c){if(Array.isArray(l)){const d=l.map(m=>this.on(m,c));return j0$2(d)}if(l.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const u=this._listenersMap.get(l)||[];return u.push(c),this._listenersMap.set(l,u),dn$1(()=>{const d=this._listenersMap?.get(l),m=d?.indexOf(c)??-1;m>=0&&d.splice(m,1)})}once(l,c){const u=this.on(l,d=>{u.remove(),("deref"in c?c.deref():c)?.call(null,d)});return u}hasEventListener(l){const c=this._listenersMap?.get(l);return c!=null&&c.length>0}}r.EventEmitter=o,r.EventedMixin=a=>{let l=class extends a{constructor(){super(...arguments),this._emitter=new o}destroy(){this._emitter.clear()}emit(c,u){return this._emitter.emit(c,u)}on(c,u){return this._emitter.on(c,u)}once(c,u){return this._emitter.once(c,u)}hasEventListener(c){return this._emitter.hasEventListener(c)}};return l=v([it$1("esri.core.Evented")],l),l};let s=class extends jn$2{constructor(){super(...arguments),this._emitter=new Py$2.EventEmitter(this)}destroy(){this._emitter.clear()}emit(a,l){return this._emitter.emit(a,l)}on(a,l){return this._emitter.on(a,l)}once(a,l){return this._emitter.once(a,l)}hasEventListener(a){return this._emitter.hasEventListener(a)}};s=v([it$1("esri.core.Evented.EventedAccessor")],s),r.EventedAccessor=s})(Py$2||(Py$2={}));const IN$1=Py$2;var ge$1;(function(r){r[r.ADD=1]="ADD",r[r.REMOVE=2]="REMOVE",r[r.MOVE=4]="MOVE"})(ge$1||(ge$1={}));function MN$2(r){return(o,s)=>{o[s]=r}}let NN$2=class extends fI$2{notify(){const o=this._observers;if(o&&o.length>0){const s=o.slice();for(const a of s)a.onInvalidated(),a.onCommitted()}}};var Po$2;let wH$1=class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(o){this.defaultPrevented=!1,this.item=o}},xH$1=class{constructor(o,s,a,l,c){this.target=o,this.added=s,this.removed=a,this.start=l,this.deleteCount=c}};const ki$2=new $u$2(wH$1,void 0,r=>{r.item=null,r.target=null,r.defaultPrevented=!1,r.cancellable=!1});function ON$2(r){r&&typeof r=="object"&&"destroy"in r&&typeof r.destroy=="function"&&r.destroy()}function Z_$2(r){return r?r instanceof Do$2?r.toArray():r.length?Array.prototype.slice.apply(r):[]:[]}function Q_$2(r){if(r?.length)return r[0]}function EH$1(r,o,s,a){const l=Math.min(r.length-s,o.length-a);let c=0;for(;c{r.push(l),CN$1(r,s.call(a,l,c,u),s,a)})}const Fa$2=new Set,ja$2=new Set,Ua$2=new Set,K_$2=new Map;let TH$1=0,Do$2=Po$2=class extends IN$1.EventedAccessor{static isCollection(r){return r!=null&&r instanceof Po$2}constructor(r){super(r),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new NN$2,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:TH$1++})}normalizeCtorArgs(r){return r?Array.isArray(r)||r instanceof Po$2?{items:r}:r:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return zt$1(this._observable),this._items}set items(r){this._emitBeforeChanges(ge$1.ADD)||(this._splice(0,this.length,Z_$2(r)),this._emitAfterChanges(ge$1.ADD))}hasEventListener(r){return!this.destroyed&&(r==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(r))}on(r,o){if(this.destroyed)return dn$1();if(r==="change"){const s=this._chgListeners,a={removed:!1,callback:o};return s.push(a),this._notifications&&this._notifications.push({listeners:s.slice(),items:this._items.slice(),changes:[]}),dn$1(()=>{a.removed=!0,s.splice(s.indexOf(a),1)})}return this._emitter.on(r,o)}once(r,o){const s="deref"in o?()=>o.deref():()=>o,a=this.on(r,l=>{s()?.call(null,l),a.remove()});return a}add(r,o){if(zt$1(this._observable),this._emitBeforeChanges(ge$1.ADD))return this;const s=this.getNextIndex(o??null);return this._splice(s,0,[r]),this._emitAfterChanges(ge$1.ADD),this}addMany(r,o=this._items.length){if(zt$1(this._observable),!r?.length)return this;if(this._emitBeforeChanges(ge$1.ADD))return this;const s=this.getNextIndex(o);return this._splice(s,0,Z_$2(r)),this._emitAfterChanges(ge$1.ADD),this}at(r){if(zt$1(this._observable),(r=Math.trunc(r)||0)<0&&(r+=this.length),!(r<0||r>=this.length))return this._items[r]}removeAll(){if(zt$1(this._observable),!this.length||this._emitBeforeChanges(ge$1.REMOVE))return[];const r=this._removeAllRaw();return this._emitAfterChanges(ge$1.REMOVE),r}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return zt$1(this._observable),this._createNewInstance({items:this._items.map(gt$3)})}concat(...r){zt$1(this._observable);const o=r.map(Z_$2);return this._createNewInstance({items:this._items.concat(...o)})}drain(r,o){if(zt$1(this._observable),!this.length||this._emitBeforeChanges(ge$1.REMOVE))return;const s=this._splice(0,this.length),a=s.length;for(let l=0;lo&&(r=o),r}includes(r,o=0){return zt$1(this._observable),this._items.includes(r,o)}indexOf(r,o=0){return zt$1(this._observable),this._items.indexOf(r,o)}join(r=","){return zt$1(this._observable),this._items.join(r)}lastIndexOf(r,o=this.length-1){return zt$1(this._observable),this._items.lastIndexOf(r,o)}map(r,o){zt$1(this._observable);const s=this._items.map(r,o);return new Po$2({items:s})}reorder(r,o=this.length-1){zt$1(this._observable);const s=this.indexOf(r);if(s!==-1){if(o<0?o=0:o>=this.length&&(o=this.length-1),s!==o){if(this._emitBeforeChanges(ge$1.MOVE))return r;this._splice(s,1),this._splice(o,0,[r]),this._emitAfterChanges(ge$1.MOVE)}return r}}pop(){if(zt$1(this._observable),!this.length||this._emitBeforeChanges(ge$1.REMOVE))return;const r=Q_$2(this._splice(this.length-1,1));return this._emitAfterChanges(ge$1.REMOVE),r}push(...r){return zt$1(this._observable),this._emitBeforeChanges(ge$1.ADD)||(this._splice(this.length,0,r),this._emitAfterChanges(ge$1.ADD)),this.length}reduce(r,o){zt$1(this._observable);const s=this._items;return arguments.length===2?s.reduce(r,o):s.reduce(r)}reduceRight(r,o){zt$1(this._observable);const s=this._items;return arguments.length===2?s.reduceRight(r,o):s.reduceRight(r)}remove(r){return zt$1(this._observable),this.removeAt(this.indexOf(r))}removeAt(r){if(zt$1(this._observable),r<0||r>=this.length||this._emitBeforeChanges(ge$1.REMOVE))return;const o=Q_$2(this._splice(r,1));return this._emitAfterChanges(ge$1.REMOVE),o}removeMany(r){if(zt$1(this._observable),!r?.length||this._emitBeforeChanges(ge$1.REMOVE))return[];const o=r instanceof Po$2?r.toArray():r,s=this._items,a=[],l=o.length;for(let c=0;c-1){const m=1+EH$1(o,s,c+1,d+1),g=this._splice(d,m);g&&g.length>0&&a.push.apply(a,g),c+=m-1}}return this._emitAfterChanges(ge$1.REMOVE),a}reverse(){if(zt$1(this._observable),this._emitBeforeChanges(ge$1.MOVE))return this;const r=this._splice(0,this.length);return r&&(r.reverse(),this._splice(0,0,r)),this._emitAfterChanges(ge$1.MOVE),this}shift(){if(zt$1(this._observable),!this.length||this._emitBeforeChanges(ge$1.REMOVE))return;const r=Q_$2(this._splice(0,1));return this._emitAfterChanges(ge$1.REMOVE),r}slice(r=0,o=this.length){return zt$1(this._observable),this._createNewInstance({items:this._items.slice(r,o)})}some(r,o){return zt$1(this._observable),this._items.some(r,o)}sort(r){if(zt$1(this._observable),!this.length||this._emitBeforeChanges(ge$1.MOVE))return this;const o=this._splice(0,this.length);return arguments.length?o.sort(r):o.sort(),this._splice(0,0,o),this._emitAfterChanges(ge$1.MOVE),this}splice(r,o,...s){zt$1(this._observable);const a=(o?ge$1.REMOVE:0)|(s.length?ge$1.ADD:0);if(this._emitBeforeChanges(a))return[];const l=this._splice(r,o,s)||[];return this._emitAfterChanges(a),l}toArray(){return zt$1(this._observable),this._items.slice()}toJSON(){return zt$1(this._observable),this.toArray()}toLocaleString(){return zt$1(this._observable),this._items.toLocaleString()}toString(){return zt$1(this._observable),this._items.toString()}unshift(...r){return zt$1(this._observable),!r.length||this._emitBeforeChanges(ge$1.ADD)||(this._splice(0,0,r),this._emitAfterChanges(ge$1.ADD)),this.length}_createNewInstance(r){return new this.constructor(r)}_splice(r,o,s){const a=this._items,l=this.itemType;let c,u;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=B2$1(()=>this._dispatchChange())),r<0&&(r+=this.length),o){if(u=a.splice(r,o),this.hasEventListener("before-remove")){const d=ki$2.acquire();d.target=this,d.cancellable=!0;for(let m=0,g=u.length;m{a.push(m)});const l=Co$2.acquire();ja$2.forEach(m=>{l.push(m)});const c=this._items,u=o.items,d=Co$2.acquire();if(Ua$2.forEach(m=>{u.indexOf(m)!==c.indexOf(m)&&d.push(m)}),o.listeners&&(a.length||l.length||d.length)){const m={target:this,added:a,removed:l,moved:d},g=o.listeners.length;for(let y=0;y{if(!r)return Po$2;if(K_$2.has(r))return K_$2.get(r);let o=null;if(typeof r=="function")o=r.prototype.declaredClass;else if(r.base)o=r.base.prototype.declaredClass;else for(const a in r.typeMap){const l=r.typeMap[a].prototype.declaredClass;o?o+=` | ${l}`:o=l}let s=class extends Po$2{};return v([MN$2({Type:r,ensureType:typeof r=="function"?Ai$1(r):_a$2(r)})],s.prototype,"itemType",void 0),s=v([it$1(`esri.core.Collection<${o}>`)],s),K_$2.set(r,s),s},v([S()],Do$2.prototype,"_updating",void 0),v([S()],Do$2.prototype,"length",void 0),v([S()],Do$2.prototype,"items",null),v([S({readOnly:!0})],Do$2.prototype,"updating",null),Do$2=Po$2=v([it$1("esri.core.Collection")],Do$2);const Fe=Do$2;async function RN$2(r,o){const{WhereClause:s}=await __vitePreload(()=>import("./WhereClause-DxwoyBMS-BIlXG7Pl.js"),__vite__mapDeps([6,7,8]),import.meta.url).then(a=>a.W);return s.create(r,{fieldsIndex:o})}function SH$1(r,o){return r==="1=1"?o??r:o==="1=1"?r??o:r!=null&&r!==""?o!=null&&o!==""?`(${r}) AND (${o})`:r:o}let jd$2;const AH$1=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale,tw$2=globalThis.document?.documentElement;function kN$2(){const r=tw$2?.getAttribute("lang"),o=globalThis.navigator?.language;return AH$1??r??o??"en"}function os$2(){return jd$2===void 0&&(jd$2=kN$2()),jd$2}function IH$1(r=os$2()){return/^([a-zA-Z]{2,3})(?:[_-][a-zA-Z0-9]+)*$/.exec(r)?.[1].toLowerCase()}const Dy$2=[];function MH$1(r){return Dy$2.push(r),dn$1(()=>Dy$2.splice(Dy$2.indexOf(r),1))}const Gy$2=[];function ew$2(r){return Gy$2.push(r),dn$1(()=>Gy$2.splice(Gy$2.indexOf(r),1))}function LN$2(){const r=kN$2();jd$2!==r&&([...Gy$2].forEach(o=>o(r)),jd$2=r,[...Dy$2].forEach(o=>o(r)))}globalThis.addEventListener?.("languagechange",LN$2),tw$2&&new MutationObserver(()=>{LN$2()}).observe(tw$2,{attributeFilter:["lang"]});const PN$2=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Bishkek"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);let mc$2=class extends Error{},NH$1=class extends mc$2{constructor(o){super(`Invalid DateTime: ${o.toMessage()}`)}},OH$1=class extends mc$2{constructor(o){super(`Invalid Interval: ${o.toMessage()}`)}},CH$1=class extends mc$2{constructor(o){super(`Invalid Duration: ${o.toMessage()}`)}},sh$2=class extends mc$2{},DN$1=class extends mc$2{constructor(o){super(`Invalid unit ${o}`)}},mr$2=class extends mc$2{},$a$2=class extends mc$2{constructor(){super("Zone is an abstract class")}};const vt$1="numeric",as$2="short",pi$3="long",Fy$2={year:vt$1,month:vt$1,day:vt$1},GN$1={year:vt$1,month:as$2,day:vt$1},RH$1={year:vt$1,month:as$2,day:vt$1,weekday:as$2},FN$2={year:vt$1,month:pi$3,day:vt$1},jN$2={year:vt$1,month:pi$3,day:vt$1,weekday:pi$3},UN$2={hour:vt$1,minute:vt$1},$N$2={hour:vt$1,minute:vt$1,second:vt$1},BN$1={hour:vt$1,minute:vt$1,second:vt$1,timeZoneName:as$2},VN$1={hour:vt$1,minute:vt$1,second:vt$1,timeZoneName:pi$3},zN$2={hour:vt$1,minute:vt$1,hourCycle:"h23"},HN$1={hour:vt$1,minute:vt$1,second:vt$1,hourCycle:"h23"},WN$1={hour:vt$1,minute:vt$1,second:vt$1,hourCycle:"h23",timeZoneName:as$2},XN$2={hour:vt$1,minute:vt$1,second:vt$1,hourCycle:"h23",timeZoneName:pi$3},YN$2={year:vt$1,month:vt$1,day:vt$1,hour:vt$1,minute:vt$1},JN$2={year:vt$1,month:vt$1,day:vt$1,hour:vt$1,minute:vt$1,second:vt$1},qN$2={year:vt$1,month:as$2,day:vt$1,hour:vt$1,minute:vt$1},ZN$2={year:vt$1,month:as$2,day:vt$1,hour:vt$1,minute:vt$1,second:vt$1},kH$1={year:vt$1,month:as$2,day:vt$1,weekday:as$2,hour:vt$1,minute:vt$1},QN$2={year:vt$1,month:pi$3,day:vt$1,hour:vt$1,minute:vt$1,timeZoneName:as$2},KN$2={year:vt$1,month:pi$3,day:vt$1,hour:vt$1,minute:vt$1,second:vt$1,timeZoneName:as$2},tO$2={year:vt$1,month:pi$3,day:vt$1,weekday:pi$3,hour:vt$1,minute:vt$1,timeZoneName:pi$3},eO$2={year:vt$1,month:pi$3,day:vt$1,weekday:pi$3,hour:vt$1,minute:vt$1,second:vt$1,timeZoneName:pi$3};let oh$2=class{get type(){throw new $a$2}get name(){throw new $a$2}get ianaName(){return this.name}get isUniversal(){throw new $a$2}offsetName(o,s){throw new $a$2}formatOffset(o,s){throw new $a$2}offset(o){throw new $a$2}equals(o){throw new $a$2}get isValid(){throw new $a$2}},nw$2=null,Db$2=class mie extends oh$2{static get instance(){return nw$2===null&&(nw$2=new mie),nw$2}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(o,{format:s,locale:a}){return AO$2(o,s,a)}formatOffset(o,s){return Bd$2(this.offset(o),s)}offset(o){return-new Date(o).getTimezoneOffset()}equals(o){return o.type==="system"}get isValid(){return!0}},jy$2={};function LH$1(r){return jy$2[r]||(jy$2[r]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),jy$2[r]}const PH$1={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function DH$1(r,o){const s=r.format(o).replace(/\u200E/g,""),a=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(s),[,l,c,u,d,m,g,y]=a;return[u,l,c,d,m,g,y]}function GH$1(r,o){const s=r.formatToParts(o),a=[];for(let l=0;l=0?w:1e3+w,(_-E)/(60*1e3)}equals(o){return o.type==="iana"&&o.name===this.name}get isValid(){return this.valid}},nO$2={};function FH$1(r,o={}){const s=JSON.stringify([r,o]);let a=nO$2[s];return a||(a=new Intl.ListFormat(r,o),nO$2[s]=a),a}let rw$2={};function iw$2(r,o={}){const s=JSON.stringify([r,o]);let a=rw$2[s];return a||(a=new Intl.DateTimeFormat(r,o),rw$2[s]=a),a}let sw$2={};function jH$1(r,o={}){const s=JSON.stringify([r,o]);let a=sw$2[s];return a||(a=new Intl.NumberFormat(r,o),sw$2[s]=a),a}let ow$2={};function UH$1(r,o={}){const{base:s,...a}=o,l=JSON.stringify([r,a]);let c=ow$2[l];return c||(c=new Intl.RelativeTimeFormat(r,o),ow$2[l]=c),c}let $y$2=null;function $H$1(){return $y$2||($y$2=new Intl.DateTimeFormat().resolvedOptions().locale,$y$2)}let rO$2={};function BH$1(r){let o=rO$2[r];if(!o){const s=new Intl.Locale(r);o="getWeekInfo"in s?s.getWeekInfo():s.weekInfo,rO$2[r]=o}return o}function VH$1(r){const o=r.indexOf("-x-");o!==-1&&(r=r.substring(0,o));const s=r.indexOf("-u-");if(s===-1)return[r];{let a,l;try{a=iw$2(r).resolvedOptions(),l=r}catch{const d=r.substring(0,s);a=iw$2(d).resolvedOptions(),l=d}const{numberingSystem:c,calendar:u}=a;return[l,c,u]}}function zH$1(r,o,s){return(s||o)&&(r.includes("-u-")||(r+="-u"),s&&(r+=`-ca-${s}`),o&&(r+=`-nu-${o}`)),r}function HH$1(r){const o=[];for(let s=1;s<=12;s++){const a=Ft$2.utc(2009,s,1);o.push(r(a))}return o}function WH$1(r){const o=[];for(let s=1;s<=7;s++){const a=Ft$2.utc(2016,11,13+s);o.push(r(a))}return o}function By$2(r,o,s,a){const l=r.listingMode();return l==="error"?null:l==="en"?s(o):a(o)}function XH$1(r){return r.numberingSystem&&r.numberingSystem!=="latn"?!1:r.numberingSystem==="latn"||!r.locale||r.locale.startsWith("en")||new Intl.DateTimeFormat(r.intl).resolvedOptions().numberingSystem==="latn"}let YH$1=class{constructor(o,s,a){this.padTo=a.padTo||0,this.floor=a.floor||!1;const{padTo:l,floor:c,...u}=a;if(!s||Object.keys(u).length>0){const d={useGrouping:!1,...a};a.padTo>0&&(d.minimumIntegerDigits=a.padTo),this.inf=jH$1(o,d)}}format(o){if(this.inf){const s=this.floor?Math.floor(o):o;return this.inf.format(s)}else{const s=this.floor?Math.floor(o):fw$2(o,3);return Rn$2(s,this.padTo)}}},JH$1=class{constructor(o,s,a){this.opts=a,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=o;else if(o.zone.type==="fixed"){const u=-1*(o.offset/60),d=u>=0?`Etc/GMT+${u}`:`Etc/GMT${u}`;o.offset!==0&&To$2.create(d).valid?(l=d,this.dt=o):(l="UTC",this.dt=o.offset===0?o:o.setZone("UTC").plus({minutes:o.offset}),this.originalZone=o.zone)}else o.zone.type==="system"?this.dt=o:o.zone.type==="iana"?(this.dt=o,l=o.zone.name):(l="UTC",this.dt=o.setZone("UTC").plus({minutes:o.offset}),this.originalZone=o.zone);const c={...this.opts};c.timeZone=c.timeZone||l,this.dtf=iw$2(s,c)}format(){return this.originalZone?this.formatToParts().map(({value:o})=>o).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const o=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?o.map(s=>{if(s.type==="timeZoneName"){const a=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...s,value:a}}else return s}):o}resolvedOptions(){return this.dtf.resolvedOptions()}},qH$1=class{constructor(o,s,a){this.opts={style:"long",...a},!s&&xO$2()&&(this.rtf=UH$1(o,a))}format(o,s){return this.rtf?this.rtf.format(o,s):bW$1(s,o,this.opts.numeric,this.opts.style!=="long")}formatToParts(o,s){return this.rtf?this.rtf.formatToParts(o,s):[]}};const ZH$1={firstDay:1,minimalDays:4,weekend:[6,7]};let Me$2=class Are{static fromOpts(o){return Are.create(o.locale,o.numberingSystem,o.outputCalendar,o.weekSettings,o.defaultToEN)}static create(o,s,a,l,c=!1){const u=o||mn$2.defaultLocale,d=u||(c?"en-US":$H$1()),m=s||mn$2.defaultNumberingSystem,g=a||mn$2.defaultOutputCalendar,y=pw$1(l)||mn$2.defaultWeekSettings;return new Are(d,m,g,y,u)}static resetCache(){$y$2=null,rw$2={},sw$2={},ow$2={}}static fromObject({locale:o,numberingSystem:s,outputCalendar:a,weekSettings:l}={}){return Are.create(o,s,a,l)}constructor(o,s,a,l,c){const[u,d,m]=VH$1(o);this.locale=u,this.numberingSystem=s||d||null,this.outputCalendar=a||m||null,this.weekSettings=l,this.intl=zH$1(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=c,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=XH$1(this)),this.fastNumbersCached}listingMode(){const o=this.isEnglish(),s=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return o&&s?"en":"intl"}clone(o){return!o||Object.getOwnPropertyNames(o).length===0?this:Are.create(o.locale||this.specifiedLocale,o.numberingSystem||this.numberingSystem,o.outputCalendar||this.outputCalendar,pw$1(o.weekSettings)||this.weekSettings,o.defaultToEN||!1)}redefaultToEN(o={}){return this.clone({...o,defaultToEN:!0})}redefaultToSystem(o={}){return this.clone({...o,defaultToEN:!1})}months(o,s=!1){return By$2(this,o,NO$1,()=>{const a=s?{month:o,day:"numeric"}:{month:o},l=s?"format":"standalone";return this.monthsCache[l][o]||(this.monthsCache[l][o]=HH$1(c=>this.extract(c,a,"month"))),this.monthsCache[l][o]})}weekdays(o,s=!1){return By$2(this,o,RO$1,()=>{const a=s?{weekday:o,year:"numeric",month:"long",day:"numeric"}:{weekday:o},l=s?"format":"standalone";return this.weekdaysCache[l][o]||(this.weekdaysCache[l][o]=WH$1(c=>this.extract(c,a,"weekday"))),this.weekdaysCache[l][o]})}meridiems(){return By$2(this,void 0,()=>kO$1,()=>{if(!this.meridiemCache){const o={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ft$2.utc(2016,11,13,9),Ft$2.utc(2016,11,13,19)].map(s=>this.extract(s,o,"dayperiod"))}return this.meridiemCache})}eras(o){return By$2(this,o,LO$2,()=>{const s={era:o};return this.eraCache[o]||(this.eraCache[o]=[Ft$2.utc(-40,1,1),Ft$2.utc(2017,1,1)].map(a=>this.extract(a,s,"era"))),this.eraCache[o]})}extract(o,s,a){const l=this.dtFormatter(o,s),c=l.formatToParts(),u=c.find(d=>d.type.toLowerCase()===a);return u?u.value:null}numberFormatter(o={}){return new YH$1(this.intl,o.forceSimple||this.fastNumbers,o)}dtFormatter(o,s={}){return new JH$1(o,this.intl,s)}relFormatter(o={}){return new qH$1(this.intl,this.isEnglish(),o)}listFormatter(o={}){return FH$1(this.intl,o)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:EO$2()?BH$1(this.locale):ZH$1}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(o){return this.locale===o.locale&&this.numberingSystem===o.numberingSystem&&this.outputCalendar===o.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},aw$2=null,cr$2=class Cre extends oh$2{static get utcInstance(){return aw$2===null&&(aw$2=new Cre(0)),aw$2}static instance(o){return o===0?Cre.utcInstance:new Cre(o)}static parseSpecifier(o){if(o){const s=o.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(s)return new Cre(Xy$2(s[1],s[2]))}return null}constructor(o){super(),this.fixed=o}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Bd$2(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Bd$2(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(o,s){return Bd$2(this.fixed,s)}get isUniversal(){return!0}offset(){return this.fixed}equals(o){return o.type==="fixed"&&o.fixed===this.fixed}get isValid(){return!0}},QH$1=class extends oh$2{constructor(o){super(),this.zoneName=o}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Ba$2(r,o){if(Vt$1(r)||r===null)return o;if(r instanceof oh$2)return r;if(iW$1(r)){const s=r.toLowerCase();return s==="default"?o:s==="local"||s==="system"?Db$2.instance:s==="utc"||s==="gmt"?cr$2.utcInstance:cr$2.parseSpecifier(s)||To$2.create(r)}else return Va$2(r)?cr$2.instance(r):typeof r=="object"&&"offset"in r&&typeof r.offset=="function"?r:new QH$1(r)}const lw$2={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},iO$2={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},KH$1=lw$2.hanidec.replace(/[\[|\]]/g,"").split("");function tW$1(r){let o=parseInt(r,10);if(isNaN(o)){o="";for(let s=0;s=c&&a<=u&&(o+=a-c)}}return parseInt(o,10)}else return o}let ah$2={};function eW$1(){ah$2={}}function ls$2({numberingSystem:r},o=""){const s=r||"latn";return ah$2[s]||(ah$2[s]={}),ah$2[s][o]||(ah$2[s][o]=new RegExp(`${lw$2[s]}${o}`)),ah$2[s][o]}let sO$2=()=>Date.now(),oO$2="system",aO$2=null,lO$2=null,cO$2=null,uO$2=60,hO$2,pO$1=null,mn$2=class{static get now(){return sO$2}static set now(o){sO$2=o}static set defaultZone(o){oO$2=o}static get defaultZone(){return Ba$2(oO$2,Db$2.instance)}static get defaultLocale(){return aO$2}static set defaultLocale(o){aO$2=o}static get defaultNumberingSystem(){return lO$2}static set defaultNumberingSystem(o){lO$2=o}static get defaultOutputCalendar(){return cO$2}static set defaultOutputCalendar(o){cO$2=o}static get defaultWeekSettings(){return pO$1}static set defaultWeekSettings(o){pO$1=pw$1(o)}static get twoDigitCutoffYear(){return uO$2}static set twoDigitCutoffYear(o){uO$2=o%100}static get throwOnInvalid(){return hO$2}static set throwOnInvalid(o){hO$2=o}static resetCaches(){Me$2.resetCache(),To$2.resetCache(),Ft$2.resetCache(),eW$1()}},cs$2=class{constructor(o,s){this.reason=o,this.explanation=s}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};const dO$2=[0,31,59,90,120,151,181,212,243,273,304,334],fO$2=[0,31,60,91,121,152,182,213,244,274,305,335];function Li$2(r,o){return new cs$2("unit out of range",`you specified ${o} (of type ${typeof o}) as a ${r}, which is invalid`)}function cw$2(r,o,s){const a=new Date(Date.UTC(r,o-1,s));r<100&&r>=0&&a.setUTCFullYear(a.getUTCFullYear()-1900);const l=a.getUTCDay();return l===0?7:l}function mO$2(r,o,s){return s+(Ud$2(r)?fO$2:dO$2)[o-1]}function yO$2(r,o){const s=Ud$2(r)?fO$2:dO$2,a=s.findIndex(c=>c$d$2(a,o,s)?(g=a+1,m=1):g=a,{weekYear:g,weekNumber:m,weekday:d,...Jy$2(r)}}function gO$2(r,o=4,s=1){const{weekYear:a,weekNumber:l,weekday:c}=r,u=uw$2(cw$2(a,1,o),s),d=ch$2(a);let m=l*7+c-u-7+o,g;m<1?(g=a-1,m+=ch$2(g)):m>d?(g=a+1,m-=ch$2(a)):g=a;const{month:y,day:_}=yO$2(g,m);return{year:g,month:y,day:_,...Jy$2(r)}}function hw$2(r){const{year:o,month:s,day:a}=r,l=mO$2(o,s,a);return{year:o,ordinal:l,...Jy$2(r)}}function vO$2(r){const{year:o,ordinal:s}=r,{month:a,day:l}=yO$2(o,s);return{year:o,month:a,day:l,...Jy$2(r)}}function bO$2(r,o){if(!Vt$1(r.localWeekday)||!Vt$1(r.localWeekNumber)||!Vt$1(r.localWeekYear)){if(!Vt$1(r.weekday)||!Vt$1(r.weekNumber)||!Vt$1(r.weekYear))throw new sh$2("Cannot mix locale-based week fields with ISO-based week fields");return Vt$1(r.localWeekday)||(r.weekday=r.localWeekday),Vt$1(r.localWeekNumber)||(r.weekNumber=r.localWeekNumber),Vt$1(r.localWeekYear)||(r.weekYear=r.localWeekYear),delete r.localWeekday,delete r.localWeekNumber,delete r.localWeekYear,{minDaysInFirstWeek:o.getMinDaysInFirstWeek(),startOfWeek:o.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function nW$1(r,o=4,s=1){const a=zy$2(r.weekYear),l=Pi$3(r.weekNumber,1,$d$2(r.weekYear,o,s)),c=Pi$3(r.weekday,1,7);return a?l?c?!1:Li$2("weekday",r.weekday):Li$2("week",r.weekNumber):Li$2("weekYear",r.weekYear)}function rW$1(r){const o=zy$2(r.year),s=Pi$3(r.ordinal,1,ch$2(r.year));return o?s?!1:Li$2("ordinal",r.ordinal):Li$2("year",r.year)}function _O$2(r){const o=zy$2(r.year),s=Pi$3(r.month,1,12),a=Pi$3(r.day,1,Hy$2(r.year,r.month));return o?s?a?!1:Li$2("day",r.day):Li$2("month",r.month):Li$2("year",r.year)}function wO$2(r){const{hour:o,minute:s,second:a,millisecond:l}=r,c=Pi$3(o,0,23)||o===24&&s===0&&a===0&&l===0,u=Pi$3(s,0,59),d=Pi$3(a,0,59),m=Pi$3(l,0,999);return c?u?d?m?!1:Li$2("millisecond",l):Li$2("second",a):Li$2("minute",s):Li$2("hour",o)}function Vt$1(r){return typeof r>"u"}function Va$2(r){return typeof r=="number"}function zy$2(r){return typeof r=="number"&&r%1===0}function iW$1(r){return typeof r=="string"}function sW$1(r){return Object.prototype.toString.call(r)==="[object Date]"}function xO$2(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function EO$2(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function oW$1(r){return Array.isArray(r)?r:[r]}function TO$2(r,o,s){if(r.length!==0)return r.reduce((a,l)=>{const c=[o(l),l];return a&&s(a[0],c[0])===a[0]?a:c},null)[1]}function aW$1(r,o){return o.reduce((s,a)=>(s[a]=r[a],s),{})}function lh$2(r,o){return Object.prototype.hasOwnProperty.call(r,o)}function pw$1(r){if(r==null)return null;if(typeof r!="object")throw new mr$2("Week settings must be an object");if(!Pi$3(r.firstDay,1,7)||!Pi$3(r.minimalDays,1,7)||!Array.isArray(r.weekend)||r.weekend.some(o=>!Pi$3(o,1,7)))throw new mr$2("Invalid week settings");return{firstDay:r.firstDay,minimalDays:r.minimalDays,weekend:Array.from(r.weekend)}}function Pi$3(r,o,s){return zy$2(r)&&r>=o&&r<=s}function lW$1(r,o){return r-o*Math.floor(r/o)}function Rn$2(r,o=2){const s=r<0;let a;return s?a="-"+(""+-r).padStart(o,"0"):a=(""+r).padStart(o,"0"),a}function za$2(r){if(!(Vt$1(r)||r===null||r===""))return parseInt(r,10)}function yc$1(r){if(!(Vt$1(r)||r===null||r===""))return parseFloat(r)}function dw$2(r){if(!(Vt$1(r)||r===null||r==="")){const o=parseFloat("0."+r)*1e3;return Math.floor(o)}}function fw$2(r,o,s=!1){const a=10**o;return(s?Math.trunc:Math.round)(r*a)/a}function Ud$2(r){return r%4===0&&(r%100!==0||r%400===0)}function ch$2(r){return Ud$2(r)?366:365}function Hy$2(r,o){const s=lW$1(o-1,12)+1,a=r+(o-s)/12;return s===2?Ud$2(a)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][s-1]}function Wy$2(r){let o=Date.UTC(r.year,r.month-1,r.day,r.hour,r.minute,r.second,r.millisecond);return r.year<100&&r.year>=0&&(o=new Date(o),o.setUTCFullYear(r.year,r.month-1,r.day)),+o}function SO$1(r,o,s){return-uw$2(cw$2(r,1,o),s)+o-1}function $d$2(r,o=4,s=1){const a=SO$1(r,o,s),l=SO$1(r+1,o,s);return(ch$2(r)-a+l)/7}function mw$1(r){return r>99?r:r>mn$2.twoDigitCutoffYear?1900+r:2e3+r}function AO$2(r,o,s,a=null){const l=new Date(r),c={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};a&&(c.timeZone=a);const u={timeZoneName:o,...c},d=new Intl.DateTimeFormat(s,u).formatToParts(l).find(m=>m.type.toLowerCase()==="timezonename");return d?d.value:null}function Xy$2(r,o){let s=parseInt(r,10);Number.isNaN(s)&&(s=0);const a=parseInt(o,10)||0,l=s<0||Object.is(s,-0)?-a:a;return s*60+l}function IO$2(r){const o=Number(r);if(typeof r=="boolean"||r===""||Number.isNaN(o))throw new mr$2(`Invalid unit value ${r}`);return o}function Yy$2(r,o){const s={};for(const a in r)if(lh$2(r,a)){const l=r[a];if(l==null)continue;s[o(a)]=IO$2(l)}return s}function Bd$2(r,o){const s=Math.trunc(Math.abs(r/60)),a=Math.trunc(Math.abs(r%60)),l=r>=0?"+":"-";switch(o){case"short":return`${l}${Rn$2(s,2)}:${Rn$2(a,2)}`;case"narrow":return`${l}${s}${a>0?`:${a}`:""}`;case"techie":return`${l}${Rn$2(s,2)}${Rn$2(a,2)}`;default:throw new RangeError(`Value format ${o} is out of range for property format`)}}function Jy$2(r){return aW$1(r,["hour","minute","second","millisecond"])}const cW$1=["January","February","March","April","May","June","July","August","September","October","November","December"],MO$1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],uW$1=["J","F","M","A","M","J","J","A","S","O","N","D"];function NO$1(r){switch(r){case"narrow":return[...uW$1];case"short":return[...MO$1];case"long":return[...cW$1];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const OO$2=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],CO$2=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],hW$1=["M","T","W","T","F","S","S"];function RO$1(r){switch(r){case"narrow":return[...hW$1];case"short":return[...CO$2];case"long":return[...OO$2];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const kO$1=["AM","PM"],pW$1=["Before Christ","Anno Domini"],dW$1=["BC","AD"],fW$1=["B","A"];function LO$2(r){switch(r){case"narrow":return[...fW$1];case"short":return[...dW$1];case"long":return[...pW$1];default:return null}}function mW$1(r){return kO$1[r.hour<12?0:1]}function yW$1(r,o){return RO$1(o)[r.weekday-1]}function gW$1(r,o){return NO$1(o)[r.month-1]}function vW$1(r,o){return LO$2(o)[r.year<0?0:1]}function bW$1(r,o,s="always",a=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},c=["hours","minutes","seconds"].indexOf(r)===-1;if(s==="auto"&&c){const _=r==="days";switch(o){case 1:return _?"tomorrow":`next ${l[r][0]}`;case-1:return _?"yesterday":`last ${l[r][0]}`;case 0:return _?"today":`this ${l[r][0]}`}}const u=Object.is(o,-0)||o<0,d=Math.abs(o),m=d===1,g=l[r],y=a?m?g[1]:g[2]||g[1]:m?l[r][0]:r;return u?`${d} ${y} ago`:`in ${d} ${y}`}function PO$2(r,o){let s="";for(const a of r)a.literal?s+=a.val:s+=o(a.val);return s}const _W$1={D:Fy$2,DD:GN$1,DDD:FN$2,DDDD:jN$2,t:UN$2,tt:$N$2,ttt:BN$1,tttt:VN$1,T:zN$2,TT:HN$1,TTT:WN$1,TTTT:XN$2,f:YN$2,ff:qN$2,fff:QN$2,ffff:tO$2,F:JN$2,FF:ZN$2,FFF:KN$2,FFFF:eO$2};let Ar$1=class wre{static create(o,s={}){return new wre(o,s)}static parseFormat(o){let s=null,a="",l=!1;const c=[];for(let u=0;u0&&c.push({literal:l||/^\s+$/.test(a),val:a}),s=null,a="",l=!l):l||d===s?a+=d:(a.length>0&&c.push({literal:/^\s+$/.test(a),val:a}),a=d,s=d)}return a.length>0&&c.push({literal:l||/^\s+$/.test(a),val:a}),c}static macroTokenToFormatOpts(o){return _W$1[o]}constructor(o,s){this.opts=s,this.loc=o,this.systemLoc=null}formatWithSystemDefault(o,s){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(o,{...this.opts,...s}).format()}dtFormatter(o,s={}){return this.loc.dtFormatter(o,{...this.opts,...s})}formatDateTime(o,s){return this.dtFormatter(o,s).format()}formatDateTimeParts(o,s){return this.dtFormatter(o,s).formatToParts()}formatInterval(o,s){return this.dtFormatter(o.start,s).dtf.formatRange(o.start.toJSDate(),o.end.toJSDate())}resolvedOptions(o,s){return this.dtFormatter(o,s).resolvedOptions()}num(o,s=0){if(this.opts.forceSimple)return Rn$2(o,s);const a={...this.opts};return s>0&&(a.padTo=s),this.loc.numberFormatter(a).format(o)}formatDateTimeFromString(o,s){const a=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",c=(w,T)=>this.loc.extract(o,w,T),u=w=>o.isOffsetFixed&&o.offset===0&&w.allowZ?"Z":o.isValid?o.zone.formatOffset(o.ts,w.format):"",d=()=>a?mW$1(o):c({hour:"numeric",hourCycle:"h12"},"dayperiod"),m=(w,T)=>a?gW$1(o,w):c(T?{month:w}:{month:w,day:"numeric"},"month"),g=(w,T)=>a?yW$1(o,w):c(T?{weekday:w}:{weekday:w,month:"long",day:"numeric"},"weekday"),y=w=>{const T=wre.macroTokenToFormatOpts(w);return T?this.formatWithSystemDefault(o,T):w},_=w=>a?vW$1(o,w):c({era:w},"era"),E=w=>{switch(w){case"S":return this.num(o.millisecond);case"u":case"SSS":return this.num(o.millisecond,3);case"s":return this.num(o.second);case"ss":return this.num(o.second,2);case"uu":return this.num(Math.floor(o.millisecond/10),2);case"uuu":return this.num(Math.floor(o.millisecond/100));case"m":return this.num(o.minute);case"mm":return this.num(o.minute,2);case"h":return this.num(o.hour%12===0?12:o.hour%12);case"hh":return this.num(o.hour%12===0?12:o.hour%12,2);case"H":return this.num(o.hour);case"HH":return this.num(o.hour,2);case"Z":return u({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return u({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return u({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return o.zone.offsetName(o.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return o.zone.offsetName(o.ts,{format:"long",locale:this.loc.locale});case"z":return o.zoneName;case"a":return d();case"d":return l?c({day:"numeric"},"day"):this.num(o.day);case"dd":return l?c({day:"2-digit"},"day"):this.num(o.day,2);case"c":return this.num(o.weekday);case"ccc":return g("short",!0);case"cccc":return g("long",!0);case"ccccc":return g("narrow",!0);case"E":return this.num(o.weekday);case"EEE":return g("short",!1);case"EEEE":return g("long",!1);case"EEEEE":return g("narrow",!1);case"L":return l?c({month:"numeric",day:"numeric"},"month"):this.num(o.month);case"LL":return l?c({month:"2-digit",day:"numeric"},"month"):this.num(o.month,2);case"LLL":return m("short",!0);case"LLLL":return m("long",!0);case"LLLLL":return m("narrow",!0);case"M":return l?c({month:"numeric"},"month"):this.num(o.month);case"MM":return l?c({month:"2-digit"},"month"):this.num(o.month,2);case"MMM":return m("short",!1);case"MMMM":return m("long",!1);case"MMMMM":return m("narrow",!1);case"y":return l?c({year:"numeric"},"year"):this.num(o.year);case"yy":return l?c({year:"2-digit"},"year"):this.num(o.year.toString().slice(-2),2);case"yyyy":return l?c({year:"numeric"},"year"):this.num(o.year,4);case"yyyyyy":return l?c({year:"numeric"},"year"):this.num(o.year,6);case"G":return _("short");case"GG":return _("long");case"GGGGG":return _("narrow");case"kk":return this.num(o.weekYear.toString().slice(-2),2);case"kkkk":return this.num(o.weekYear,4);case"W":return this.num(o.weekNumber);case"WW":return this.num(o.weekNumber,2);case"n":return this.num(o.localWeekNumber);case"nn":return this.num(o.localWeekNumber,2);case"ii":return this.num(o.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(o.localWeekYear,4);case"o":return this.num(o.ordinal);case"ooo":return this.num(o.ordinal,3);case"q":return this.num(o.quarter);case"qq":return this.num(o.quarter,2);case"X":return this.num(Math.floor(o.ts/1e3));case"x":return this.num(o.ts);default:return y(w)}};return PO$2(wre.parseFormat(s),E)}formatDurationFromString(o,s){const a=m=>{switch(m[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=m=>g=>{const y=a(g);return y?this.num(m.get(y),g.length):g},c=wre.parseFormat(s),u=c.reduce((m,{literal:g,val:y})=>g?m:m.concat(y),[]),d=o.shiftTo(...u.map(a).filter(m=>m));return PO$2(c,l(d))}};const DO$2=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function uh$2(...r){const o=r.reduce((s,a)=>s+a.source,"");return RegExp(`^${o}$`)}function hh$1(...r){return o=>r.reduce(([s,a,l],c)=>{const[u,d,m]=c(o,l);return[{...s,...u},d||a,m]},[{},null,1]).slice(0,2)}function ph$1(r,...o){if(r==null)return[null,null];for(const[s,a]of o){const l=s.exec(r);if(l)return a(l)}return[null,null]}function GO$2(...r){return(o,s)=>{const a={};let l;for(l=0;lw!==void 0&&(T||w&&y)?-w:w;return[{years:E(yc$1(s)),months:E(yc$1(a)),weeks:E(yc$1(l)),days:E(yc$1(c)),hours:E(yc$1(u)),minutes:E(yc$1(d)),seconds:E(yc$1(m),m==="-0"),milliseconds:E(dw$2(g),_)}]}const kW$1={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function vw$2(r,o,s,a,l,c,u){const d={year:o.length===2?mw$1(za$2(o)):za$2(o),month:MO$1.indexOf(s)+1,day:za$2(a),hour:za$2(l),minute:za$2(c)};return u&&(d.second=za$2(u)),r&&(d.weekday=r.length>3?OO$2.indexOf(r)+1:CO$2.indexOf(r)+1),d}const LW$1=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function PW$1(r){const[,o,s,a,l,c,u,d,m,g,y,_]=r,E=vw$2(o,l,a,s,c,u,d);let w;return m?w=kW$1[m]:g?w=0:w=Xy$2(y,_),[E,new cr$2(w)]}function DW$1(r){return r.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const GW$1=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,FW$1=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,jW$1=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function $O$1(r){const[,o,s,a,l,c,u,d]=r;return[vw$2(o,l,a,s,c,u,d),cr$2.utcInstance]}function UW$1(r){const[,o,s,a,l,c,u,d]=r;return[vw$2(o,d,s,a,l,c,u),cr$2.utcInstance]}const $W$1=uh$2(xW$1,gw$2),BW$1=uh$2(EW$1,gw$2),VW$1=uh$2(TW$1,gw$2),zW$1=uh$2(jO$2),BO$2=hh$1(NW$1,fh$1,Vd$2,zd$2),HW$1=hh$1(SW$1,fh$1,Vd$2,zd$2),WW$1=hh$1(AW$1,fh$1,Vd$2,zd$2),XW$1=hh$1(fh$1,Vd$2,zd$2);function YW$1(r){return ph$1(r,[$W$1,BO$2],[BW$1,HW$1],[VW$1,WW$1],[zW$1,XW$1])}function JW$1(r){return ph$1(DW$1(r),[LW$1,PW$1])}function qW$1(r){return ph$1(r,[GW$1,$O$1],[FW$1,$O$1],[jW$1,UW$1])}function ZW$1(r){return ph$1(r,[CW$1,RW$1])}const QW$1=hh$1(fh$1);function KW$1(r){return ph$1(r,[OW$1,QW$1])}const tX$1=uh$2(IW$1,MW$1),eX$1=uh$2(UO$1),nX$1=hh$1(fh$1,Vd$2,zd$2);function rX$1(r){return ph$1(r,[tX$1,BO$2],[eX$1,nX$1])}const VO$2="Invalid Duration",zO$2={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},iX$1={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...zO$2},Di$2=146097/400,mh=146097/4800,sX$1={years:{quarters:4,months:12,weeks:Di$2/7,days:Di$2,hours:Di$2*24,minutes:Di$2*24*60,seconds:Di$2*24*60*60,milliseconds:Di$2*24*60*60*1e3},quarters:{months:3,weeks:Di$2/28,days:Di$2/4,hours:Di$2*24/4,minutes:Di$2*24*60/4,seconds:Di$2*24*60*60/4,milliseconds:Di$2*24*60*60*1e3/4},months:{weeks:mh/7,days:mh,hours:mh*24,minutes:mh*24*60,seconds:mh*24*60*60,milliseconds:mh*24*60*60*1e3},...zO$2},gc$2=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],oX$1=gc$2.slice(0).reverse();function Ha$2(r,o,s=!1){const a={values:s?o.values:{...r.values,...o.values||{}},loc:r.loc.clone(o.loc),conversionAccuracy:o.conversionAccuracy||r.conversionAccuracy,matrix:o.matrix||r.matrix};return new ye$1(a)}function HO$2(r,o){let s=o.milliseconds??0;for(const a of oX$1.slice(1))o[a]&&(s+=o[a]*r[a].milliseconds);return s}function WO$2(r,o){const s=HO$2(r,o)<0?-1:1;gc$2.reduceRight((a,l)=>{if(Vt$1(o[l]))return a;if(a){const c=o[a]*s,u=r[l][a],d=Math.floor(c/u);o[l]+=d*s,o[a]-=d*u*s}return l},null),gc$2.reduce((a,l)=>{if(Vt$1(o[l]))return a;if(a){const c=o[a]%1;o[a]-=c,o[l]+=c*r[a][l]}return l},null)}function aX$1(r){const o={};for(const[s,a]of Object.entries(r))a!==0&&(o[s]=a);return o}let ye$1=class Vne{constructor(o){const s=o.conversionAccuracy==="longterm"||!1;let a=s?sX$1:iX$1;o.matrix&&(a=o.matrix),this.values=o.values,this.loc=o.loc||Me$2.create(),this.conversionAccuracy=s?"longterm":"casual",this.invalid=o.invalid||null,this.matrix=a,this.isLuxonDuration=!0}static fromMillis(o,s){return Vne.fromObject({milliseconds:o},s)}static fromObject(o,s={}){if(o==null||typeof o!="object")throw new mr$2(`Duration.fromObject: argument expected to be an object, got ${o===null?"null":typeof o}`);return new Vne({values:Yy$2(o,Vne.normalizeUnit),loc:Me$2.fromObject(s),conversionAccuracy:s.conversionAccuracy,matrix:s.matrix})}static fromDurationLike(o){if(Va$2(o))return Vne.fromMillis(o);if(Vne.isDuration(o))return o;if(typeof o=="object")return Vne.fromObject(o);throw new mr$2(`Unknown duration argument ${o} of type ${typeof o}`)}static fromISO(o,s){const[a]=ZW$1(o);return a?Vne.fromObject(a,s):Vne.invalid("unparsable",`the input "${o}" can't be parsed as ISO 8601`)}static fromISOTime(o,s){const[a]=KW$1(o);return a?Vne.fromObject(a,s):Vne.invalid("unparsable",`the input "${o}" can't be parsed as ISO 8601`)}static invalid(o,s=null){if(!o)throw new mr$2("need to specify a reason the Duration is invalid");const a=o instanceof cs$2?o:new cs$2(o,s);if(mn$2.throwOnInvalid)throw new CH$1(a);return new Vne({invalid:a})}static normalizeUnit(o){const s={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[o&&o.toLowerCase()];if(!s)throw new DN$1(o);return s}static isDuration(o){return o&&o.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(o,s={}){const a={...s,floor:s.round!==!1&&s.floor!==!1};return this.isValid?Ar$1.create(this.loc,a).formatDurationFromString(this,o):VO$2}toHuman(o={}){if(!this.isValid)return VO$2;const s=gc$2.map(a=>{const l=this.values[a];return Vt$1(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...o,unit:a.slice(0,-1)}).format(l)}).filter(a=>a);return this.loc.listFormatter({type:"conjunction",style:o.listStyle||"narrow",...o}).format(s)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let o="P";return this.years!==0&&(o+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(o+=this.months+this.quarters*3+"M"),this.weeks!==0&&(o+=this.weeks+"W"),this.days!==0&&(o+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(o+="T"),this.hours!==0&&(o+=this.hours+"H"),this.minutes!==0&&(o+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(o+=fw$2(this.seconds+this.milliseconds/1e3,3)+"S"),o==="P"&&(o+="T0S"),o}toISOTime(o={}){if(!this.isValid)return null;const s=this.toMillis();return s<0||s>=864e5?null:(o={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...o,includeOffset:!1},Ft$2.fromMillis(s,{zone:"UTC"}).toISOTime(o))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?HO$2(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(o){if(!this.isValid)return this;const s=Vne.fromDurationLike(o),a={};for(const l of gc$2)(lh$2(s.values,l)||lh$2(this.values,l))&&(a[l]=s.get(l)+this.get(l));return Ha$2(this,{values:a},!0)}minus(o){if(!this.isValid)return this;const s=Vne.fromDurationLike(o);return this.plus(s.negate())}mapUnits(o){if(!this.isValid)return this;const s={};for(const a of Object.keys(this.values))s[a]=IO$2(o(this.values[a],a));return Ha$2(this,{values:s},!0)}get(o){return this[Vne.normalizeUnit(o)]}set(o){if(!this.isValid)return this;const s={...this.values,...Yy$2(o,Vne.normalizeUnit)};return Ha$2(this,{values:s})}reconfigure({locale:o,numberingSystem:s,conversionAccuracy:a,matrix:l}={}){const c={loc:this.loc.clone({locale:o,numberingSystem:s}),matrix:l,conversionAccuracy:a};return Ha$2(this,c)}as(o){return this.isValid?this.shiftTo(o).get(o):NaN}normalize(){if(!this.isValid)return this;const o=this.toObject();return WO$2(this.matrix,o),Ha$2(this,{values:o},!0)}rescale(){if(!this.isValid)return this;const o=aX$1(this.normalize().shiftToAll().toObject());return Ha$2(this,{values:o},!0)}shiftTo(...o){if(!this.isValid)return this;if(o.length===0)return this;o=o.map(u=>Vne.normalizeUnit(u));const s={},a={},l=this.toObject();let c;for(const u of gc$2)if(o.indexOf(u)>=0){c=u;let d=0;for(const g in a)d+=this.matrix[g][u]*a[g],a[g]=0;Va$2(l[u])&&(d+=l[u]);const m=Math.trunc(d);s[u]=m,a[u]=(d*1e3-m*1e3)/1e3}else Va$2(l[u])&&(a[u]=l[u]);for(const u in a)a[u]!==0&&(s[c]+=u===c?a[u]:a[u]/this.matrix[c][u]);return WO$2(this.matrix,s),Ha$2(this,{values:s},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const o={};for(const s of Object.keys(this.values))o[s]=this.values[s]===0?0:-this.values[s];return Ha$2(this,{values:o},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(o){if(!this.isValid||!o.isValid||!this.loc.equals(o.loc))return!1;function s(a,l){return a===void 0||a===0?l===void 0||l===0:a===l}for(const a of gc$2)if(!s(this.values[a],o.values[a]))return!1;return!0}};const yh$1="Invalid Interval";function lX$1(r,o){return!r||!r.isValid?_n$2.invalid("missing or invalid start"):!o||!o.isValid?_n$2.invalid("missing or invalid end"):oo:!1}isBefore(o){return this.isValid?this.e<=o:!1}contains(o){return this.isValid?this.s<=o&&this.e>o:!1}set({start:o,end:s}={}){return this.isValid?Pne.fromDateTimes(o||this.s,s||this.e):this}splitAt(...o){if(!this.isValid)return[];const s=o.map(Wd$2).filter(u=>this.contains(u)).sort((u,d)=>u.toMillis()-d.toMillis()),a=[];let{s:l}=this,c=0;for(;l+this.e?this.e:u;a.push(Pne.fromDateTimes(l,d)),l=d,c+=1}return a}splitBy(o){const s=ye$1.fromDurationLike(o);if(!this.isValid||!s.isValid||s.as("milliseconds")===0)return[];let{s:a}=this,l=1,c;const u=[];for(;am*l));c=+d>+this.e?this.e:d,u.push(Pne.fromDateTimes(a,c)),a=c,l+=1}return u}divideEqually(o){return this.isValid?this.splitBy(this.length()/o).slice(0,o):[]}overlaps(o){return this.e>o.s&&this.s=o.e:!1}equals(o){return!this.isValid||!o.isValid?!1:this.s.equals(o.s)&&this.e.equals(o.e)}intersection(o){if(!this.isValid)return this;const s=this.s>o.s?this.s:o.s,a=this.e=a?null:Pne.fromDateTimes(s,a)}union(o){if(!this.isValid)return this;const s=this.so.e?this.e:o.e;return Pne.fromDateTimes(s,a)}static merge(o){const[s,a]=o.sort((l,c)=>l.s-c.s).reduce(([l,c],u)=>c?c.overlaps(u)||c.abutsStart(u)?[l,c.union(u)]:[l.concat([c]),u]:[l,u],[[],null]);return a&&s.push(a),s}static xor(o){let s=null,a=0;const l=[],c=o.map(m=>[{time:m.s,type:"s"},{time:m.e,type:"e"}]),u=Array.prototype.concat(...c),d=u.sort((m,g)=>m.time-g.time);for(const m of d)a+=m.type==="s"?1:-1,a===1?s=m.time:(s&&+s!=+m.time&&l.push(Pne.fromDateTimes(s,m.time)),s=null);return Pne.merge(l)}difference(...o){return Pne.xor([this].concat(o)).map(s=>this.intersection(s)).filter(s=>s&&!s.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:yh$1}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(o=Fy$2,s={}){return this.isValid?Ar$1.create(this.s.loc.clone(s),o).formatInterval(this):yh$1}toISO(o){return this.isValid?`${this.s.toISO(o)}/${this.e.toISO(o)}`:yh$1}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:yh$1}toISOTime(o){return this.isValid?`${this.s.toISOTime(o)}/${this.e.toISOTime(o)}`:yh$1}toFormat(o,{separator:s=" – "}={}){return this.isValid?`${this.s.toFormat(o)}${s}${this.e.toFormat(o)}`:yh$1}toDuration(o,s){return this.isValid?this.e.diff(this.s,o,s):ye$1.invalid(this.invalidReason)}mapEndpoints(o){return Pne.fromDateTimes(o(this.s),o(this.e))}},qy$2=class{static hasDST(o=mn$2.defaultZone){const s=Ft$2.now().setZone(o).set({month:12});return!o.isUniversal&&s.offset!==s.set({month:6}).offset}static isValidIANAZone(o){return To$2.isValidZone(o)}static normalizeZone(o){return Ba$2(o,mn$2.defaultZone)}static getStartOfWeek({locale:o=null,locObj:s=null}={}){return(s||Me$2.create(o)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:o=null,locObj:s=null}={}){return(s||Me$2.create(o)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:o=null,locObj:s=null}={}){return(s||Me$2.create(o)).getWeekendDays().slice()}static months(o="long",{locale:s=null,numberingSystem:a=null,locObj:l=null,outputCalendar:c="gregory"}={}){return(l||Me$2.create(s,a,c)).months(o)}static monthsFormat(o="long",{locale:s=null,numberingSystem:a=null,locObj:l=null,outputCalendar:c="gregory"}={}){return(l||Me$2.create(s,a,c)).months(o,!0)}static weekdays(o="long",{locale:s=null,numberingSystem:a=null,locObj:l=null}={}){return(l||Me$2.create(s,a,null)).weekdays(o)}static weekdaysFormat(o="long",{locale:s=null,numberingSystem:a=null,locObj:l=null}={}){return(l||Me$2.create(s,a,null)).weekdays(o,!0)}static meridiems({locale:o=null}={}){return Me$2.create(o).meridiems()}static eras(o="short",{locale:s=null}={}){return Me$2.create(s,null,"gregory").eras(o)}static features(){return{relative:xO$2(),localeWeek:EO$2()}}};function XO$2(r,o){const s=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),a=s(o)-s(r);return Math.floor(ye$1.fromMillis(a).as("days"))}function cX$1(r,o,s){const a=[["years",(m,g)=>g.year-m.year],["quarters",(m,g)=>g.quarter-m.quarter+(g.year-m.year)*4],["months",(m,g)=>g.month-m.month+(g.year-m.year)*12],["weeks",(m,g)=>{const y=XO$2(m,g);return(y-y%7)/7}],["days",XO$2]],l={},c=r;let u,d;for(const[m,g]of a)s.indexOf(m)>=0&&(u=m,l[m]=g(r,o),d=c.plus(l),d>o?(l[m]--,r=c.plus(l),r>o&&(d=r,l[m]--,r=c.plus(l))):r=d);return[r,l,d,u]}function uX$1(r,o,s,a){let[l,c,u,d]=cX$1(r,o,s);const m=o-l,g=s.filter(_=>["hours","minutes","seconds","milliseconds"].indexOf(_)>=0);g.length===0&&(u0?ye$1.fromMillis(m,a).shiftTo(...g).plus(y):y}const hX$1="missing Intl.DateTimeFormat.formatToParts support";function _e(r,o=s=>s){return{regex:r,deser:([s])=>o(tW$1(s))}}const pX$1=" ",YO$2=`[ ${pX$1}]`,JO$1=new RegExp(YO$2,"g");function dX$1(r){return r.replace(/\./g,"\\.?").replace(JO$1,YO$2)}function qO$1(r){return r.replace(/\./g,"").replace(JO$1," ").toLowerCase()}function us$2(r,o){return r===null?null:{regex:RegExp(r.map(dX$1).join("|")),deser:([s])=>r.findIndex(a=>qO$1(s)===qO$1(a))+o}}function ZO$1(r,o){return{regex:r,deser:([,s,a])=>Xy$2(s,a),groups:o}}function Zy$2(r){return{regex:r,deser:([o])=>o}}function fX$1(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function mX$1(r,o){const s=ls$2(o),a=ls$2(o,"{2}"),l=ls$2(o,"{3}"),c=ls$2(o,"{4}"),u=ls$2(o,"{6}"),d=ls$2(o,"{1,2}"),m=ls$2(o,"{1,3}"),g=ls$2(o,"{1,6}"),y=ls$2(o,"{1,9}"),_=ls$2(o,"{2,4}"),E=ls$2(o,"{4,6}"),w=k=>({regex:RegExp(fX$1(k.val)),deser:([O])=>O,literal:!0}),T=(k=>{if(r.literal)return w(k);switch(k.val){case"G":return us$2(o.eras("short"),0);case"GG":return us$2(o.eras("long"),0);case"y":return _e(g);case"yy":return _e(_,mw$1);case"yyyy":return _e(c);case"yyyyy":return _e(E);case"yyyyyy":return _e(u);case"M":return _e(d);case"MM":return _e(a);case"MMM":return us$2(o.months("short",!0),1);case"MMMM":return us$2(o.months("long",!0),1);case"L":return _e(d);case"LL":return _e(a);case"LLL":return us$2(o.months("short",!1),1);case"LLLL":return us$2(o.months("long",!1),1);case"d":return _e(d);case"dd":return _e(a);case"o":return _e(m);case"ooo":return _e(l);case"HH":return _e(a);case"H":return _e(d);case"hh":return _e(a);case"h":return _e(d);case"mm":return _e(a);case"m":return _e(d);case"q":return _e(d);case"qq":return _e(a);case"s":return _e(d);case"ss":return _e(a);case"S":return _e(m);case"SSS":return _e(l);case"u":return Zy$2(y);case"uu":return Zy$2(d);case"uuu":return _e(s);case"a":return us$2(o.meridiems(),0);case"kkkk":return _e(c);case"kk":return _e(_,mw$1);case"W":return _e(d);case"WW":return _e(a);case"E":case"c":return _e(s);case"EEE":return us$2(o.weekdays("short",!1),1);case"EEEE":return us$2(o.weekdays("long",!1),1);case"ccc":return us$2(o.weekdays("short",!0),1);case"cccc":return us$2(o.weekdays("long",!0),1);case"Z":case"ZZ":return ZO$1(new RegExp(`([+-]${d.source})(?::(${a.source}))?`),2);case"ZZZ":return ZO$1(new RegExp(`([+-]${d.source})(${a.source})?`),2);case"z":return Zy$2(/[a-z_+-/]{1,256}?/i);case" ":return Zy$2(/[^\S\n\r]/);default:return w(k)}})(r)||{invalidReason:hX$1};return T.token=r,T}const yX$1={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function gX$1(r,o,s){const{type:a,value:l}=r;if(a==="literal"){const m=/^\s+$/.test(l);return{literal:!m,val:m?" ":l}}const c=o[a];let u=a;a==="hour"&&(o.hour12!=null?u=o.hour12?"hour12":"hour24":o.hourCycle!=null?o.hourCycle==="h11"||o.hourCycle==="h12"?u="hour12":u="hour24":u=s.hour12?"hour12":"hour24");let d=yX$1[u];if(typeof d=="object"&&(d=d[c]),d)return{literal:!1,val:d}}function vX$1(r){return[`^${r.map(o=>o.regex).reduce((o,s)=>`${o}(${s.source})`,"")}$`,r]}function bX$1(r,o,s){const a=r.match(o);if(a){const l={};let c=1;for(const u in s)if(lh$2(s,u)){const d=s[u],m=d.groups?d.groups+1:1;!d.literal&&d.token&&(l[d.token.val[0]]=d.deser(a.slice(c,c+m))),c+=m}return[a,l]}else return[a,{}]}function _X$1(r){const o=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let s=null,a;return Vt$1(r.z)||(s=To$2.create(r.z)),Vt$1(r.Z)||(s||(s=new cr$2(r.Z)),a=r.Z),Vt$1(r.q)||(r.M=(r.q-1)*3+1),Vt$1(r.h)||(r.h<12&&r.a===1?r.h+=12:r.h===12&&r.a===0&&(r.h=0)),r.G===0&&r.y&&(r.y=-r.y),Vt$1(r.u)||(r.S=dw$2(r.u)),[Object.keys(r).reduce((l,c)=>{const u=o(c);return u&&(l[u]=r[c]),l},{}),s,a]}let bw$2=null;function wX$1(){return bw$2||(bw$2=Ft$2.fromMillis(1555555555555)),bw$2}function xX$1(r,o){if(r.literal)return r;const s=Ar$1.macroTokenToFormatOpts(r.val),a=eC$2(s,o);return a==null||a.includes(void 0)?r:a}function QO$1(r,o){return Array.prototype.concat(...r.map(s=>xX$1(s,o)))}let KO$1=class{constructor(o,s){if(this.locale=o,this.format=s,this.tokens=QO$1(Ar$1.parseFormat(s),o),this.units=this.tokens.map(a=>mX$1(a,o)),this.disqualifyingUnit=this.units.find(a=>a.invalidReason),!this.disqualifyingUnit){const[a,l]=vX$1(this.units);this.regex=RegExp(a,"i"),this.handlers=l}}explainFromTokens(o){if(this.isValid){const[s,a]=bX$1(o,this.regex,this.handlers),[l,c,u]=a?_X$1(a):[null,null,void 0];if(lh$2(a,"a")&&lh$2(a,"H"))throw new sh$2("Can't include meridiem when specifying 24-hour format");return{input:o,tokens:this.tokens,regex:this.regex,rawMatches:s,matches:a,result:l,zone:c,specificOffset:u}}else return{input:o,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function tC$2(r,o,s){return new KO$1(r,s).explainFromTokens(o)}function EX$1(r,o,s){const{result:a,zone:l,specificOffset:c,invalidReason:u}=tC$2(r,o,s);return[a,l,c,u]}function eC$2(r,o){if(!r)return null;const s=Ar$1.create(o,r).dtFormatter(wX$1()),a=s.formatToParts(),l=s.resolvedOptions();return a.map(c=>gX$1(c,r,l))}const _w$2="Invalid DateTime",nC$2=864e13;function Hd$2(r){return new cs$2("unsupported zone",`the zone "${r.name}" is not supported`)}function ww$2(r){return r.weekData===null&&(r.weekData=Vy$2(r.c)),r.weekData}function xw$2(r){return r.localWeekData===null&&(r.localWeekData=Vy$2(r.c,r.loc.getMinDaysInFirstWeek(),r.loc.getStartOfWeek())),r.localWeekData}function vc$2(r,o){const s={ts:r.ts,zone:r.zone,c:r.c,o:r.o,loc:r.loc,invalid:r.invalid};return new Ft$2({...s,...o,old:s})}function rC$2(r,o,s){let a=r-o*60*1e3;const l=s.offset(a);if(o===l)return[a,o];a-=(l-o)*60*1e3;const c=s.offset(a);return l===c?[a,l]:[r-Math.min(l,c)*60*1e3,Math.max(l,c)]}function Qy$2(r,o){r+=o*60*1e3;const s=new Date(r);return{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate(),hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),millisecond:s.getUTCMilliseconds()}}function Ky$2(r,o,s){return rC$2(Wy$2(r),o,s)}function iC$2(r,o){const s=r.o,a=r.c.year+Math.trunc(o.years),l=r.c.month+Math.trunc(o.months)+Math.trunc(o.quarters)*3,c={...r.c,year:a,month:l,day:Math.min(r.c.day,Hy$2(a,l))+Math.trunc(o.days)+Math.trunc(o.weeks)*7},u=ye$1.fromObject({years:o.years-Math.trunc(o.years),quarters:o.quarters-Math.trunc(o.quarters),months:o.months-Math.trunc(o.months),weeks:o.weeks-Math.trunc(o.weeks),days:o.days-Math.trunc(o.days),hours:o.hours,minutes:o.minutes,seconds:o.seconds,milliseconds:o.milliseconds}).as("milliseconds"),d=Wy$2(c);let[m,g]=rC$2(d,s,r.zone);return u!==0&&(m+=u,g=r.zone.offset(m)),{ts:m,o:g}}function gh$1(r,o,s,a,l,c){const{setZone:u,zone:d}=s;if(r&&Object.keys(r).length!==0||o){const m=o||d,g=Ft$2.fromObject(r,{...s,zone:m,specificOffset:c});return u?g:g.setZone(d)}else return Ft$2.invalid(new cs$2("unparsable",`the input "${l}" can't be parsed as ${a}`))}function tg$2(r,o,s=!0){return r.isValid?Ar$1.create(Me$2.create("en-US"),{allowZ:s,forceSimple:!0}).formatDateTimeFromString(r,o):null}function Ew$2(r,o){const s=r.c.year>9999||r.c.year<0;let a="";return s&&r.c.year>=0&&(a+="+"),a+=Rn$2(r.c.year,s?6:4),o?(a+="-",a+=Rn$2(r.c.month),a+="-",a+=Rn$2(r.c.day)):(a+=Rn$2(r.c.month),a+=Rn$2(r.c.day)),a}function sC$2(r,o,s,a,l,c){let u=Rn$2(r.c.hour);return o?(u+=":",u+=Rn$2(r.c.minute),(r.c.millisecond!==0||r.c.second!==0||!s)&&(u+=":")):u+=Rn$2(r.c.minute),(r.c.millisecond!==0||r.c.second!==0||!s)&&(u+=Rn$2(r.c.second),(r.c.millisecond!==0||!a)&&(u+=".",u+=Rn$2(r.c.millisecond,3))),l&&(r.isOffsetFixed&&r.offset===0&&!c?u+="Z":r.o<0?(u+="-",u+=Rn$2(Math.trunc(-r.o/60)),u+=":",u+=Rn$2(Math.trunc(-r.o%60))):(u+="+",u+=Rn$2(Math.trunc(r.o/60)),u+=":",u+=Rn$2(Math.trunc(r.o%60)))),c&&(u+="["+r.zone.ianaName+"]"),u}const oC$2={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},TX$1={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},SX$1={ordinal:1,hour:0,minute:0,second:0,millisecond:0},aC$2=["year","month","day","hour","minute","second","millisecond"],AX$1=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],IX$1=["year","ordinal","hour","minute","second","millisecond"];function MX$1(r){const o={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[r.toLowerCase()];if(!o)throw new DN$1(r);return o}function lC$2(r){switch(r.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return MX$1(r)}}function NX$1(r){return ng$2[r]||(eg$3===void 0&&(eg$3=mn$2.now()),ng$2[r]=r.offset(eg$3)),ng$2[r]}function cC$2(r,o){const s=Ba$2(o.zone,mn$2.defaultZone);if(!s.isValid)return Ft$2.invalid(Hd$2(s));const a=Me$2.fromObject(o);let l,c;if(Vt$1(r.year))l=mn$2.now();else{for(const m of aC$2)Vt$1(r[m])&&(r[m]=oC$2[m]);const u=_O$2(r)||wO$2(r);if(u)return Ft$2.invalid(u);const d=NX$1(s);[l,c]=Ky$2(r,d,s)}return new Ft$2({ts:l,zone:s,loc:a,o:c})}function uC$2(r,o,s){const a=Vt$1(s.round)?!0:s.round,l=(u,d)=>(u=fw$2(u,a||s.calendary?0:2,!0),o.loc.clone(s).relFormatter(s).format(u,d)),c=u=>s.calendary?o.hasSame(r,u)?0:o.startOf(u).diff(r.startOf(u),u).get(u):o.diff(r,u).get(u);if(s.unit)return l(c(s.unit),s.unit);for(const u of s.units){const d=c(u);if(Math.abs(d)>=1)return l(d,u)}return l(r>o?-0:0,s.units[s.units.length-1])}function hC$2(r){let o={},s;return r.length>0&&typeof r[r.length-1]=="object"?(o=r[r.length-1],s=Array.from(r).slice(0,r.length-1)):s=Array.from(r),[o,s]}let eg$3,ng$2={},Ft$2=class One{constructor(o){const s=o.zone||mn$2.defaultZone;let a=o.invalid||(Number.isNaN(o.ts)?new cs$2("invalid input"):null)||(s.isValid?null:Hd$2(s));this.ts=Vt$1(o.ts)?mn$2.now():o.ts;let l=null,c=null;if(!a)if(o.old&&o.old.ts===this.ts&&o.old.zone.equals(s))[l,c]=[o.old.c,o.old.o];else{const u=Va$2(o.o)&&!o.old?o.o:s.offset(this.ts);l=Qy$2(this.ts,u),a=Number.isNaN(l.year)?new cs$2("invalid input"):null,l=a?null:l,c=a?null:u}this._zone=s,this.loc=o.loc||Me$2.create(),this.invalid=a,this.weekData=null,this.localWeekData=null,this.c=l,this.o=c,this.isLuxonDateTime=!0}static now(){return new One({})}static local(){const[o,s]=hC$2(arguments),[a,l,c,u,d,m,g]=s;return cC$2({year:a,month:l,day:c,hour:u,minute:d,second:m,millisecond:g},o)}static utc(){const[o,s]=hC$2(arguments),[a,l,c,u,d,m,g]=s;return o.zone=cr$2.utcInstance,cC$2({year:a,month:l,day:c,hour:u,minute:d,second:m,millisecond:g},o)}static fromJSDate(o,s={}){const a=sW$1(o)?o.valueOf():NaN;if(Number.isNaN(a))return One.invalid("invalid input");const l=Ba$2(s.zone,mn$2.defaultZone);return l.isValid?new One({ts:a,zone:l,loc:Me$2.fromObject(s)}):One.invalid(Hd$2(l))}static fromMillis(o,s={}){if(Va$2(o))return o<-nC$2||o>nC$2?One.invalid("Timestamp out of range"):new One({ts:o,zone:Ba$2(s.zone,mn$2.defaultZone),loc:Me$2.fromObject(s)});throw new mr$2(`fromMillis requires a numerical input, but received a ${typeof o} with value ${o}`)}static fromSeconds(o,s={}){if(Va$2(o))return new One({ts:o*1e3,zone:Ba$2(s.zone,mn$2.defaultZone),loc:Me$2.fromObject(s)});throw new mr$2("fromSeconds requires a numerical input")}static fromObject(o,s={}){o=o||{};const a=Ba$2(s.zone,mn$2.defaultZone);if(!a.isValid)return One.invalid(Hd$2(a));const l=Me$2.fromObject(s),c=Yy$2(o,lC$2),{minDaysInFirstWeek:u,startOfWeek:d}=bO$2(c,l),m=mn$2.now(),g=Vt$1(s.specificOffset)?a.offset(m):s.specificOffset,y=!Vt$1(c.ordinal),_=!Vt$1(c.year),E=!Vt$1(c.month)||!Vt$1(c.day),w=_||E,T=c.weekYear||c.weekNumber;if((w||y)&&T)throw new sh$2("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(E&&y)throw new sh$2("Can't mix ordinal dates with month/day");const k=T||c.weekday&&!w;let O,R,M=Qy$2(m,g);k?(O=AX$1,R=TX$1,M=Vy$2(M,u,d)):y?(O=IX$1,R=SX$1,M=hw$2(M)):(O=aC$2,R=oC$2);let N=!1;for(const J of O){const z=c[J];Vt$1(z)?N?c[J]=R[J]:c[J]=M[J]:N=!0}const D=k?nW$1(c,u,d):y?rW$1(c):_O$2(c),P=D||wO$2(c);if(P)return One.invalid(P);const I=k?gO$2(c,u,d):y?vO$2(c):c,[L,F]=Ky$2(I,g,a),U=new One({ts:L,zone:a,o:F,loc:l});return c.weekday&&w&&o.weekday!==U.weekday?One.invalid("mismatched weekday",`you can't specify both a weekday of ${c.weekday} and a date of ${U.toISO()}`):U.isValid?U:One.invalid(U.invalid)}static fromISO(o,s={}){const[a,l]=YW$1(o);return gh$1(a,l,s,"ISO 8601",o)}static fromRFC2822(o,s={}){const[a,l]=JW$1(o);return gh$1(a,l,s,"RFC 2822",o)}static fromHTTP(o,s={}){const[a,l]=qW$1(o);return gh$1(a,l,s,"HTTP",s)}static fromFormat(o,s,a={}){if(Vt$1(o)||Vt$1(s))throw new mr$2("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:c=null}=a,u=Me$2.fromOpts({locale:l,numberingSystem:c,defaultToEN:!0}),[d,m,g,y]=EX$1(u,o,s);return y?One.invalid(y):gh$1(d,m,a,`format ${s}`,o,g)}static fromString(o,s,a={}){return One.fromFormat(o,s,a)}static fromSQL(o,s={}){const[a,l]=rX$1(o);return gh$1(a,l,s,"SQL",o)}static invalid(o,s=null){if(!o)throw new mr$2("need to specify a reason the DateTime is invalid");const a=o instanceof cs$2?o:new cs$2(o,s);if(mn$2.throwOnInvalid)throw new NH$1(a);return new One({invalid:a})}static isDateTime(o){return o&&o.isLuxonDateTime||!1}static parseFormatForOpts(o,s={}){const a=eC$2(o,Me$2.fromObject(s));return a?a.map(l=>l?l.val:null).join(""):null}static expandFormat(o,s={}){return QO$1(Ar$1.parseFormat(o),Me$2.fromObject(s)).map(a=>a.val).join("")}static resetCache(){eg$3=void 0,ng$2={}}get(o){return this[o]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ww$2(this).weekYear:NaN}get weekNumber(){return this.isValid?ww$2(this).weekNumber:NaN}get weekday(){return this.isValid?ww$2(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?xw$2(this).weekday:NaN}get localWeekNumber(){return this.isValid?xw$2(this).weekNumber:NaN}get localWeekYear(){return this.isValid?xw$2(this).weekYear:NaN}get ordinal(){return this.isValid?hw$2(this.c).ordinal:NaN}get monthShort(){return this.isValid?qy$2.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qy$2.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qy$2.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qy$2.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const o=864e5,s=6e4,a=Wy$2(this.c),l=this.zone.offset(a-o),c=this.zone.offset(a+o),u=this.zone.offset(a-l*s),d=this.zone.offset(a-c*s);if(u===d)return[this];const m=a-u*s,g=a-d*s,y=Qy$2(m,u),_=Qy$2(g,d);return y.hour===_.hour&&y.minute===_.minute&&y.second===_.second&&y.millisecond===_.millisecond?[vc$2(this,{ts:m}),vc$2(this,{ts:g})]:[this]}get isInLeapYear(){return Ud$2(this.year)}get daysInMonth(){return Hy$2(this.year,this.month)}get daysInYear(){return this.isValid?ch$2(this.year):NaN}get weeksInWeekYear(){return this.isValid?$d$2(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?$d$2(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(o={}){const{locale:s,numberingSystem:a,calendar:l}=Ar$1.create(this.loc.clone(o),o).resolvedOptions(this);return{locale:s,numberingSystem:a,outputCalendar:l}}toUTC(o=0,s={}){return this.setZone(cr$2.instance(o),s)}toLocal(){return this.setZone(mn$2.defaultZone)}setZone(o,{keepLocalTime:s=!1,keepCalendarTime:a=!1}={}){if(o=Ba$2(o,mn$2.defaultZone),o.equals(this.zone))return this;if(o.isValid){let l=this.ts;if(s||a){const c=o.offset(this.ts),u=this.toObject();[l]=Ky$2(u,c,o)}return vc$2(this,{ts:l,zone:o})}else return One.invalid(Hd$2(o))}reconfigure({locale:o,numberingSystem:s,outputCalendar:a}={}){const l=this.loc.clone({locale:o,numberingSystem:s,outputCalendar:a});return vc$2(this,{loc:l})}setLocale(o){return this.reconfigure({locale:o})}set(o){if(!this.isValid)return this;const s=Yy$2(o,lC$2),{minDaysInFirstWeek:a,startOfWeek:l}=bO$2(s,this.loc),c=!Vt$1(s.weekYear)||!Vt$1(s.weekNumber)||!Vt$1(s.weekday),u=!Vt$1(s.ordinal),d=!Vt$1(s.year),m=!Vt$1(s.month)||!Vt$1(s.day),g=d||m,y=s.weekYear||s.weekNumber;if((g||u)&&y)throw new sh$2("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&u)throw new sh$2("Can't mix ordinal dates with month/day");let _;c?_=gO$2({...Vy$2(this.c,a,l),...s},a,l):Vt$1(s.ordinal)?(_={...this.toObject(),...s},Vt$1(s.day)&&(_.day=Math.min(Hy$2(_.year,_.month),_.day))):_=vO$2({...hw$2(this.c),...s});const[E,w]=Ky$2(_,this.o,this.zone);return vc$2(this,{ts:E,o:w})}plus(o){if(!this.isValid)return this;const s=ye$1.fromDurationLike(o);return vc$2(this,iC$2(this,s))}minus(o){if(!this.isValid)return this;const s=ye$1.fromDurationLike(o).negate();return vc$2(this,iC$2(this,s))}startOf(o,{useLocaleWeeks:s=!1}={}){if(!this.isValid)return this;const a={},l=ye$1.normalizeUnit(o);switch(l){case"years":a.month=1;case"quarters":case"months":a.day=1;case"weeks":case"days":a.hour=0;case"hours":a.minute=0;case"minutes":a.second=0;case"seconds":a.millisecond=0;break}if(l==="weeks")if(s){const c=this.loc.getStartOfWeek(),{weekday:u}=this;uthis.valueOf(),d=u?this:o,m=u?o:this,g=uX$1(d,m,c,l);return u?g.negate():g}diffNow(o="milliseconds",s={}){return this.diff(One.now(),o,s)}until(o){return this.isValid?_n$2.fromDateTimes(this,o):this}hasSame(o,s,a){if(!this.isValid)return!1;const l=o.valueOf(),c=this.setZone(o.zone,{keepLocalTime:!0});return c.startOf(s,a)<=l&&l<=c.endOf(s,a)}equals(o){return this.isValid&&o.isValid&&this.valueOf()===o.valueOf()&&this.zone.equals(o.zone)&&this.loc.equals(o.loc)}toRelative(o={}){if(!this.isValid)return null;const s=o.base||One.fromObject({},{zone:this.zone}),a=o.padding?thiss.valueOf(),Math.min)}static max(...o){if(!o.every(One.isDateTime))throw new mr$2("max requires all arguments be DateTimes");return TO$2(o,s=>s.valueOf(),Math.max)}static fromFormatExplain(o,s,a={}){const{locale:l=null,numberingSystem:c=null}=a,u=Me$2.fromOpts({locale:l,numberingSystem:c,defaultToEN:!0});return tC$2(u,o,s)}static fromStringExplain(o,s,a={}){return One.fromFormatExplain(o,s,a)}static buildFormatParser(o,s={}){const{locale:a=null,numberingSystem:l=null}=s,c=Me$2.fromOpts({locale:a,numberingSystem:l,defaultToEN:!0});return new KO$1(c,o)}static fromFormatParser(o,s,a={}){if(Vt$1(o)||Vt$1(s))throw new mr$2("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:c=null}=a,u=Me$2.fromOpts({locale:l,numberingSystem:c,defaultToEN:!0});if(!u.equals(s.locale))throw new mr$2(`fromFormatParser called with a locale of ${u}, but the format parser was created for ${s.locale}`);const{result:d,zone:m,specificOffset:g,invalidReason:y}=s.explainFromTokens(o);return y?One.invalid(y):gh$1(d,m,a,`format ${s.format}`,o,g)}static get DATE_SHORT(){return Fy$2}static get DATE_MED(){return GN$1}static get DATE_MED_WITH_WEEKDAY(){return RH$1}static get DATE_FULL(){return FN$2}static get DATE_HUGE(){return jN$2}static get TIME_SIMPLE(){return UN$2}static get TIME_WITH_SECONDS(){return $N$2}static get TIME_WITH_SHORT_OFFSET(){return BN$1}static get TIME_WITH_LONG_OFFSET(){return VN$1}static get TIME_24_SIMPLE(){return zN$2}static get TIME_24_WITH_SECONDS(){return HN$1}static get TIME_24_WITH_SHORT_OFFSET(){return WN$1}static get TIME_24_WITH_LONG_OFFSET(){return XN$2}static get DATETIME_SHORT(){return YN$2}static get DATETIME_SHORT_WITH_SECONDS(){return JN$2}static get DATETIME_MED(){return qN$2}static get DATETIME_MED_WITH_SECONDS(){return ZN$2}static get DATETIME_MED_WITH_WEEKDAY(){return kH$1}static get DATETIME_FULL(){return QN$2}static get DATETIME_FULL_WITH_SECONDS(){return KN$2}static get DATETIME_HUGE(){return tO$2}static get DATETIME_HUGE_WITH_SECONDS(){return eO$2}};function Wd$2(r){if(Ft$2.isDateTime(r))return r;if(r&&r.valueOf&&Va$2(r.valueOf()))return Ft$2.fromJSDate(r);if(r&&typeof r=="object")return Ft$2.fromObject(r);throw new mr$2(`Unknown datetime argument: ${r}, of type ${typeof r}`)}const vh$3="system",rg$2="unknown",bh$1="UTC",OX$1=Intl.DateTimeFormat().resolvedOptions().timeZone,CX$1="shortOffset";function RX$1(r){return"timeZoneIANA"in r}function kX$1(r){return r.startsWith("UTC")}function LX$1(r,o=!1){return{json:{read:{source:r,reader:(s,a)=>a[r]?pC$2(a[r]):null},write:!!o&&{allowNull:!0,writer(s,a){a[r]=s?PX$1(s):null}}}}}function pC$2(r,o=vh$3){return r?RX$1(r)?r.timeZoneIANA:DX$1(r,o):o}function PX$1(r){return{timeZoneIANA:r}}function DX$1(r,o=vh$3){if(!r||!PN$2.has(r.timeZone))return o;const s=PN$2.get(r.timeZone);return kX$1(r.timeZone)||r.respectsDaylightSaving?s:GX$1(s)}function GX$1(r){const o=Ft$2.local().setZone(r),s=Math.min(o.set({month:1,day:1}).offset,o.set({month:5}).offset);return s===0?"Etc/UTC":`Etc/GMT${cr$2.instance(-s).formatOffset(0,"narrow")}`}function FX$1(r,o,s,a,l){if(o&&l==="date")return{timeZone:bh$1,timeZoneName:void 0};const c=a.timeStyle||a.hour,u=s===rg$2;return{timeZone:u?l==="timestamp-offset"?void 0:r??bh$1:s,timeZoneName:u&&c?CX$1:void 0}}function jX$1(r){const o=new Set(["etc/utc","etc/gmt","gmt"]),s=new Set(Intl.supportedValuesOf("timeZone").map(a=>a.toLowerCase()));return r===vh$3||r===rg$2||o.has(r.toLowerCase())||s.has(r.toLowerCase())}const UX$1={year:void 0,month:void 0,day:void 0,weekday:void 0},$X$1={hour:void 0,minute:void 0,second:void 0},dC$2={timeZone:bh$1},Ws$2={year:"numeric",month:"numeric",day:"numeric"},Xd$2={year:"numeric",month:"long",day:"numeric"},Yd$1={year:"numeric",month:"short",day:"numeric"},Jd$1={year:"numeric",month:"long",weekday:"long",day:"numeric"},Wa$2={hour:"numeric",minute:"numeric"},bc$2={...Wa$2,second:"numeric"},fC$2={hourCycle:"h23"},qd$2={...Wa$2,...fC$2},Zd$2={...bc$2,...fC$2},mC$2={"short-date":Ws$2,"short-date-short-time":{...Ws$2,...Wa$2},"short-date-short-time-24":{...Ws$2,...qd$2},"short-date-long-time":{...Ws$2,...bc$2},"short-date-long-time-24":{...Ws$2,...Zd$2},"short-date-le":Ws$2,"short-date-le-short-time":{...Ws$2,...Wa$2},"short-date-le-short-time-24":{...Ws$2,...qd$2},"short-date-le-long-time":{...Ws$2,...bc$2},"short-date-le-long-time-24":{...Ws$2,...Zd$2},"long-month-day-year":Xd$2,"long-month-day-year-short-time":{...Xd$2,...Wa$2},"long-month-day-year-short-time-24":{...Xd$2,...qd$2},"long-month-day-year-long-time":{...Xd$2,...bc$2},"long-month-day-year-long-time-24":{...Xd$2,...Zd$2},"day-short-month-year":Yd$1,"day-short-month-year-short-time":{...Yd$1,...Wa$2},"day-short-month-year-short-time-24":{...Yd$1,...qd$2},"day-short-month-year-long-time":{...Yd$1,...bc$2},"day-short-month-year-long-time-24":{...Yd$1,...Zd$2},"long-date":Jd$1,"long-date-short-time":{...Jd$1,...Wa$2},"long-date-short-time-24":{...Jd$1,...qd$2},"long-date-long-time":{...Jd$1,...bc$2},"long-date-long-time-24":{...Jd$1,...Zd$2},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":Wa$2,"long-time":bc$2},BX$1=Ii$2()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),yC$2={ar:"ar-u-nu-latn-ca-gregory"};let Tw$2=new WeakMap;const ig$2=mC$2["short-date-short-time"];function VX$1(r){let o=Tw$2.get(r);if(!o){const s=os$2(),a=yC$2[s]||s,l=gC$2(r.timeZone??vh$3),c={...r,timeZone:l};o=new Intl.DateTimeFormat(a,c),Tw$2.set(r,o)}return o}function zX$1(r){return mC$2[r]}function sg$2(r,o=ig$2){return VX$1(o).format(r)}function HX$1(r,o=ig$2){return sg$2(new Date(r),{...o,...dC$2,...$X$1})}function WX$1(r,o=ig$2){return sg$2(new Date(`1970-01-01T${r}Z`),{...o,...dC$2,...UX$1})}function XX$1(r,o=ig$2){if(o.timeZone)return sg$2(new Date(r),o);const s=Ft$2.fromISO(r,{setZone:!0}),a=os$2(),l=yC$2[a]??a,c=s.offset===0?bh$1:o.timeZone,u={...o,timeZone:c};return s.toLocaleString(u,{locale:l})}function gC$2(r){switch(r){case vh$3:return OX$1;case rg$2:return bh$1;default:return r}}ew$2(()=>{Tw$2=new WeakMap});const YX$1={ar:"ar-u-nu-latn"};let og$2=new WeakMap,vC$2={};function Sw$2(r){const o=r||vC$2;if(!og$2.has(o)){const s=os$2(),a=YX$1[os$2()]||s;og$2.set(o,new Intl.NumberFormat(a,r))}return og$2.get(o)}function JX$1(r={}){const o={};return r.digitSeparator!=null&&(o.useGrouping=r.digitSeparator),r.places!=null&&(o.minimumFractionDigits=o.maximumFractionDigits=r.places),o}function qX$1(r,o){return Object.is(r,-0)&&(r=0),Sw$2(o).format(r)}function ZX$1(r,o=os$2()){if(!r)return null;let s=bC$2.get(o);if(!s){const a=Sw$2().formatToParts(12345.6),l=[...Sw$2({useGrouping:!1}).format(9876543210)].reverse(),c=new Map(l.map((_,E)=>[_,E])),u=new RegExp(`[${a.find(_=>_.type==="group")?.value}]`,"g"),d=new RegExp(`[${a.find(_=>_.type==="decimal")?.value}]`),m=new RegExp(`[${l.join("")}]`,"g"),g=/[\u200E\u200F\u202A\u202B\u202C\u202D\u202E\u2066\u2067\u2068\u2069\u061C]/g,y=/[-\u2212\u2013\u2014\u2015]/g;s=_=>{if((_=_.trim().replaceAll(u,"").replace(d,".").replace(m,w=>String(c.get(w))).replaceAll(g,"").replaceAll(y,"-"))==="")return null;const E=Number(_);return isNaN(E)?null:E},bC$2.set(o,s)}return s(r)}ew$2(()=>{og$2=new WeakMap,vC$2={}});const bC$2=new Map,_C$2=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,QX$1={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function wC$2(r){return r in QX$1}const Qd$2=[],_h$1=new Map;function xC$2(r){for(const o of _h$1.keys())EC$2(r.pattern,o)&&_h$1.delete(o)}function KX$1(r){return Qd$2.includes(r)||(xC$2(r),Qd$2.unshift(r)),dn$1(()=>{const o=Qd$2.indexOf(r);o>-1&&(Qd$2.splice(o,1),xC$2(r))})}async function tY$1(r){const o=os$2();_h$1.has(r)||_h$1.set(r,nY$1(r,o));const s=_h$1.get(r);return s&&await rY$1.add(s),s}function eY$1(r){if(!_C$2.test(r))return null;const o=_C$2.exec(r);if(o===null)return null;const[,s,a]=o,l=s+(a?"-"+a.toUpperCase():"");return wC$2(l)?l:wC$2(s)?s:null}async function nY$1(r,o){const s=[];for(const a of Qd$2)if(EC$2(a.pattern,r))try{return await a.fetchMessageBundle(r,o)}catch(l){s.push(l)}throw s.length?new oe("intl:message-bundle-error",`Errors occurred while loading "${r}"`,{errors:s}):new oe("intl:no-message-bundle-loader",`No loader found for message bundle "${r}"`)}function EC$2(r,o){return typeof r=="string"?o.startsWith(r):r.test(o)}ew$2(()=>{_h$1.clear()});const rY$1=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(r){return this._increase(),r.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=ec$2())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};async function iY$1(r,o,s,a){const l=o.exec(s);if(!l)throw new oe("esri-intl:invalid-bundle",`Bundle id "${s}" is not compatible with the pattern "${o}"`);const c=l[1]?`${l[1]}/`:"",u=l[2],d=eY$1(a),m=`${c}${u}.json`,g=d?`${c}${u}_${d}.json`:m;let y;try{y=await TC$2(r(g))}catch(_){if(g===m)throw new oe("intl:unknown-bundle",`Bundle "${s}" cannot be loaded`,{error:_});try{y=await TC$2(r(m))}catch(E){throw new oe("intl:unknown-bundle",`Bundle "${s}" cannot be loaded`,{error:E})}}return y}async function TC$2(r){if(SC$2.fetchBundleAsset!=null)return SC$2.fetchBundleAsset(r);const o=await fn$2(r,{responseType:"text"});return JSON.parse(o.data)}let sY$1=class{constructor({base:o="",pattern:s,location:a=new URL(window.location.href)}){let l;l=typeof a=="string"?c=>new URL(c,new URL(a,window.location.href)).href:a instanceof URL?c=>new URL(c,a).href:a,this.pattern=typeof s=="string"?new RegExp(`^${s}`):s,this.getAssetUrl=l,o=o?o.endsWith("/")?o:o+"/":"",this.matcher=new RegExp(`^${o}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(o,s){return iY$1(this.getAssetUrl,this.matcher,o,s)}};function oY$1(r){return new sY$1(r)}const SC$2={};KX$1(oY$1({pattern:"esri/",location:c_$2}));function Aw$2(r){return typeof r=="string"||r instanceof String}var wh$2;(function(r){r.HM="HH:mm",r.HMS="HH:mm:ss",r.HMS_MS="HH:mm:ss.SSS"})(wh$2||(wh$2={}));const aY$1=[wh$2.HMS_MS,wh$2.HMS,wh$2.HM,"TT"],lY$1="yyyy-MM-dd";wh$2.HMS;function AC$2(r){if(!r||!Aw$2(r))return null;const o=Ft$2.fromFormat(r,lY$1);return o.isValid?o:null}function IC$2(r){return r&&Aw$2(r)?BU$1(aY$1,o=>{const s=Ft$2.fromFormat(r,o);return s.isValid?s:null})??null:null}function MC$2(r){if(!r||!Aw$2(r))return null;const o=Ft$2.fromISO(r);return o.isValid?o:null}var xh$1;(function(r){r.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",r.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(xh$1||(xh$1={}));const cY$1=new Set(["integer","small-integer","big-integer","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"]);function uY$1(r){return r!=null&&cY$1.has(r.type)}function NC$2(r){return r!=null&&(r.type==="date-only"||r.type==="esriFieldTypeDateOnly")}function OC$2(r){return r!=null&&(r.type==="timestamp-offset"||r.type==="esriFieldTypeTimestampOffset")}function CC$2(r){return r!=null&&(r.type==="time-only"||r.type==="esriFieldTypeTimeOnly")}function hY$1(r,o,s){const a=r?.domain;if(!a)return null;switch(a.type){case"range":{const{min:l,max:c}=RC$2(r);if(l!=null&&+oc)return xh$1.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(a.codedValues==null||a.codedValues.every(l=>l==null||l.code!==o))return xh$1.INVALID_CODED_VALUE}return null}function RC$2(r,o){const s=r?.domain;if(!s||s.type!=="range")return;const a="range"in s?s.range[0]:s.minValue,l="range"in s?s.range[1]:s.maxValue,c=uY$1(r);return NC$2(r)||CC$2(r)||OC$2(r)?{...pY$1(r,l,a),isInteger:c}:{min:a!=null&&typeof a=="number"?a:null,max:l!=null&&typeof l=="number"?l:null,rawMin:a,rawMax:l,isInteger:c}}function pY$1(r,o,s){return NC$2(r)?{min:AC$2(s)?.toMillis(),max:AC$2(o)?.toMillis(),rawMin:s,rawMax:o}:CC$2(r)?{min:IC$2(s)?.toMillis(),max:IC$2(o)?.toMillis(),rawMin:s,rawMax:o}:OC$2(r)?{min:MC$2(s)?.toMillis(),max:MC$2(o)?.toMillis(),rawMin:s,rawMax:o}:{max:null,min:null}}const dY$1=()=>Le$1.getLogger("esri.support.arcadeOnDemand");let Iw$1;function Mw$2(){return Iw$1||(Iw$1=(async()=>{const r=await __vitePreload(()=>import("./arcadeUtils-DpP0k7IY-DIwxqttO.js"),__vite__mapDeps([9,10,7,8,11,12,13,14,15,16,17,18,19,20,21,2]),import.meta.url).then(o=>o.i);return{arcade:r.arcade,arcadeUtils:r,Dictionary:r.Dictionary,Feature:r.arcadeFeature}})()),Iw$1}const fY$1=(r,o,s)=>kC$2.create(r,o,s,null,["$feature","$view"],[]),mY$1=(r,o,s,a)=>kC$2.create(r,o,s,a,["$feature","$view"],[]);let kC$2=class gie{constructor(o,s,a,l,c,u,d){this.services=null,this.script=o,this.evaluate=l;const m=Array.isArray(u)?u:u?.fields;this.fields=m??[],this._syntaxTree=a,this._arcade=s,this._arcadeFeature=c,this._spatialReference=d,this._referencesGeometry=s.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(o,s,a,l,c,u){const{arcade:d,Feature:m,Dictionary:g}=await Mw$2(),y=s instanceof Cn$2?s:Cn$2.fromJSON(s);let _;try{_=d.parseScript(o,u)}catch(F){return dY$1().error(new oe("arcade-bad-expression","Failed to parse arcade script",{script:o,error:F})),null}const E=c.reduce((F,U)=>({...F,[U]:null}),{});let w=null;l!=null&&(w=new g(l),w.immutable=!0,E.$config=null);const T=d.scriptUsesGeometryEngine(_),k=T&&d.enableGeometrySupport(),O=d.scriptUsesFeatureSet(_)&&d.enableFeatureSetSupport(),R=d.scriptIsAsync(_),M=R&&d.enableAsyncSupport(),N={vars:E,spatialReference:y,useAsync:!!M};await Promise.all([k,O,M]);const D=new Set;await d.loadDependentModules(D,_,null,R,T);const P=new g;P.immutable=!1,P.setField("scale",0);const I=d.compileScript(_,N),L=(F,U)=>{const J=F.$view?.timeZone;return"$view"in F&&F.$view&&(P.setField("scale",typeof F.$view=="object"&&"scale"in F.$view?F.$view.scale:void 0),F.$view=P),w&&(F.$config=w),I({vars:F,spatialReference:y,services:U,timeZone:J})};return new gie(o,d,_,L,new m,a,y)}repurposeFeature(o){return o.geometry&&!o.geometry.spatialReference&&(o.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(o.geometry,o.attributes,{fields:this.fields}),this._arcadeFeature}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}};const yY$1=/^([0-9_])/,gY$1=/[^a-z0-9_\u0080-\uffff]+/gi;function vY$1(r){return r==null?null:r.trim().replaceAll(gY$1,"_").replace(yY$1,"F$1")||null}const bY$1=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],_Y$1=["field","normalizationField"];function wY$1(r,o){if(r!=null&&o!=null){for(const s of Array.isArray(r)?r:[r])if(LC$2(bY$1,s,o),"visualVariables"in s&&s.visualVariables)for(const a of s.visualVariables)LC$2(_Y$1,a,o)}}function LC$2(r,o,s){if(r)for(const a of r){const l=N0$1(a,o),c=l&&typeof l!="function"&&s.get(l);c&&Kl$2(a,c.name,o)}}function xY$1(r,o){if(r!=null&&o?.fields?.length)if("startField"in r){const s=o.get(r.startField),a=o.get(r.endField);r.startField=s?.name??null,r.endField=a?.name??null}else{const s=o.get(r.startTimeField),a=o.get(r.endTimeField);r.startTimeField=s?.name??null,r.endTimeField=a?.name??null}}const Nw$1=new Set;function ag$2(r,o){return r&&o?(Nw$1.clear(),Eh$2(Nw$1,r,o),Array.from(Nw$1).sort()):[]}function Eh$2(r,o,s){if(s)if(o?.fields?.length)if(s.includes("*"))for(const{name:a}of o.fields)r.add(a);else for(const a of s)Kd$2(r,o,a);else{if(s.includes("*"))return r.clear(),void r.add("*");for(const a of s)a!=null&&r.add(a)}}function Kd$2(r,o,s){if(typeof s=="string")if(o){const a=o.get(s);a&&r.add(a.name)}else r.add(s)}function EY$1(r,o){return o==null||r==null?[]:o.includes("*")?(r.fields??[]).map(s=>s.name):o}function TY$1(r,o,s=1){if(!o||!r)return[];if(o.includes("*"))return["*"];const a=ag$2(r,o);return a.length/r.fields.length>=s?["*"]:a}async function Xa$2(r,o,s){if(!s)return;const{arcadeUtils:a}=await Mw$2(),l=a.extractFieldNames(s,o?.fields?.map(c=>c.name));for(const c of l)Kd$2(r,o,c)}async function PC$2(r,o,s){if(s&&s!=="1=1"){const a=await RN$2(s,o);if(!a.isStandardized)throw new oe("fieldUtils:collectFilterFields","Where clause is not standardized",{where:s});Eh$2(r,o,a.fieldNames)}}function SY$1({displayField:r,fields:o}){return r||(o?.length?Ow$1(o,"name-or-title")||Ow$1(o,"unique-identifier")||Ow$1(o,"type-or-category")||AY$1(o):null)}function AY$1(r){for(const o of r){if(!o?.name)continue;const s=o.name.toLowerCase();if(s.includes("name")||s.includes("title"))return o.name}return null}function Ow$1(r,o){for(const s of r)if(s?.valueType&&s.valueType===o)return s.name;return null}async function IY$1(r,o){if(!o)return;const s=o.elevationInfo?.featureExpressionInfo;return s?s.collectRequiredFields(r,o.fieldsIndex):void 0}function MY$1(r,o,s){s.onStatisticExpression?Xa$2(r,o,s.onStatisticExpression.expression):r.add(s.onStatisticField)}async function NY$1(r,o,s){if(!o||!s||!("fields"in s))return;const a=[],l=s.popupTemplate;a.push(OY$1(r,o,l)),s.fields&&a.push(...s.fields.map(async c=>MY$1(r,o.fieldsIndex,c))),await Promise.all(a)}async function OY$1(r,o,s){const a=[];s?.expressionInfos&&a.push(...s.expressionInfos.map(c=>Xa$2(r,o.fieldsIndex,c.expression)));const l=s?.content;if(Array.isArray(l))for(const c of l)c.type==="expression"&&c.expressionInfo&&a.push(Xa$2(r,o.fieldsIndex,c.expressionInfo.expression));await Promise.all(a)}async function CY$1(r,o,s){o&&(o.timeInfo&&s?.timeExtent&&Eh$2(r,o.fieldsIndex,[o.timeInfo.startField,o.timeInfo.endField]),o.floorInfo&&Eh$2(r,o.fieldsIndex,[o.floorInfo.floorField]),s?.where!=null&&await PC$2(r,o.fieldsIndex,s.where))}async function RY$1(r,o,s){o&&s&&await Promise.all(s.map(a=>kY$1(r,o,a)))}async function kY$1(r,o,s){o&&s&&(s.valueExpression?await Xa$2(r,o.fieldsIndex,s.valueExpression):s.field&&Kd$2(r,o.fieldsIndex,s.field))}function LY$1(r){return r?ag$2(r.fieldsIndex,DC$2(r)):[]}function PY$1(r){if(!r)return[];const o=r.geometryFieldsInfo;return o?ag$2(r.fieldsIndex,[o.shapeAreaField,o.shapeLengthField]):[]}const DY$1=new Set(["oid","global-id","guid"]),GY$1=new Set(["oid","global-id"]),FY$1=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function jY$1(r){const o=new Set;GC$2(r).forEach(a=>o.add(a)),PY$1(r).forEach(a=>o.add(a.toLowerCase()));const s=r&&"infoFor3D"in r?r.infoFor3D:void 0;return s&&(Object.values(s.assetMapFieldRoles).forEach(a=>o.add(a.toLowerCase())),Object.values(s.transformFieldRoles).forEach(a=>o.add(a.toLowerCase()))),Array.from(o)}function DC$2(r){if(!r)return[];const o="editFieldsInfo"in r&&r.editFieldsInfo;if(!o)return[];const{creationDateField:s,creatorField:a,editDateField:l,editorField:c}=o;return[s,a,l,c].filter(Boolean)}function GC$2(r){return DC$2(r).map(o=>o.toLowerCase())}function UY$1(r,o){return r.editable&&!DY$1.has(r.type)&&!GC$2(o).includes(r.name?.toLowerCase()??"")}function $Y$1(r,o){const s=r.name?.toLowerCase()??"";return!(o?.objectIdField!=null&&s===o.objectIdField.toLowerCase()||o?.globalIdField!=null&&s===o.globalIdField.toLowerCase()||jY$1(o).includes(s)||GY$1.has(r.type)||FY$1.some(a=>a.test(s)))}async function BY$1(r,o){const{labelingInfo:s,fieldsIndex:a}=o;s?.length&&await Promise.all(s.map(l=>VY$1(r,a,l)))}async function VY$1(r,o,s){if(!s)return;const a=s.getLabelExpression(),l=s.where;if(a.type==="arcade")await Xa$2(r,o,a.expression);else{const c=a.expression.match(/{[^}]*}/g);c&&c.forEach(u=>{Kd$2(r,o,u.slice(1,-1))})}await PC$2(r,o,l)}function zY$1(r){const o=r.defaultValue;return o!==void 0&&UC$2(r,o)?o:r.nullable?null:void 0}function HY$1(r){const o=typeof r=="string"?{type:r}:r;return VC$2(o)?255:o.type==="esriFieldTypeDate"||o.type==="date"?8:void 0}function FC$2(r){return typeof r=="number"&&!isNaN(r)&&isFinite(r)}function WY$1(r){return r===null||FC$2(r)}function XY$1(r){return r===null||Number.isInteger(r)}function jC$2(r){return r!=null&&typeof r=="string"}function YY$1(r){return r===null||jC$2(r)}function JY$1(){return!0}function UC$2(r,o){let s;switch(r.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":s=r.nullable?XY$1:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":s=r.nullable?WY$1:FC$2;break;case"string":case"esriFieldTypeString":s=r.nullable?YY$1:jC$2;break;default:s=JY$1}return arguments.length===1?s:s(o)}const qY$1=["integer","small-integer","big-integer"],ZY$1=["single","double"],QY$1=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"],KY$1=["esriFieldTypeSingle","esriFieldTypeDouble"],$C$2=new Set([...qY$1,...QY$1]),tJ$1=new Set([...ZY$1,...KY$1]),eJ$1=H2$1($C$2,tJ$1);function nJ$1(r){return r!=null&&$C$2.has(r.type)}function BC$2(r){return r!=null&&eJ$1.has(r.type)}function VC$2(r){return r!=null&&(r.type==="string"||r.type==="esriFieldTypeString")}function rJ$1(r){return r!=null&&(r.type==="date"||r.type==="esriFieldTypeDate")}function iJ$1(r){return r!=null&&(r.type==="date-only"||r.type==="esriFieldTypeDateOnly")}function sJ$1(r){return r!=null&&(r.type==="timestamp-offset"||r.type==="esriFieldTypeTimestampOffset")}function oJ$1(r){return r!=null&&(r.type==="time-only"||r.type==="esriFieldTypeTimeOnly")}function aJ$1(r){return r!=null&&(r.type==="oid"||r.type==="esriFieldTypeOID")}function lJ$1(r){return r!=null&&(r.type==="global-id"||r.type==="esriFieldTypeGlobalID")}function cJ$1(r,o){return zC$2(r,o)===null}var lg$3,cg$2;function uJ$1(r){return r==null||typeof r=="number"&&isNaN(r)?null:r}function zC$2(r,o){return r==null||r.nullable&&o===null?null:BC$2(r)&&!hJ$1(r.type,Number(o))?lg$3.OUT_OF_RANGE:UC$2(r,o)?r.domain?hY$1(r,o):null:cg$2.INVALID_TYPE}function hJ$1(r,o){const s=typeof r=="string"?HC$2(r):r;if(!s)return!1;const a=s.min,l=s.max;return s.isInteger?Number.isInteger(o)&&o>=a&&o<=l:o>=a&&o<=l}function HC$2(r){switch(r){case"esriFieldTypeSmallInteger":case"small-integer":return pJ$1;case"esriFieldTypeInteger":case"integer":return dJ$1;case"esriFieldTypeBigInteger":case"big-integer":return fJ$1;case"esriFieldTypeSingle":case"single":return mJ$1;case"esriFieldTypeDouble":case"double":return yJ$1}}(function(r){r.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(lg$3||(lg$3={})),function(r){r.INVALID_TYPE="type-validation-error::invalid-type"}(cg$2||(cg$2={}));const pJ$1={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},dJ$1={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},fJ$1={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},mJ$1={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},yJ$1={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function gJ$1(r,o,s){switch(r){case xh$1.INVALID_CODED_VALUE:return`Value ${s} is not in the coded domain - field: ${o.name}, domain: ${JSON.stringify(o.domain)}`;case xh$1.VALUE_OUT_OF_RANGE:return`Value ${s} is out of the range of valid values - field: ${o.name}, domain: ${JSON.stringify(o.domain)}`;case cg$2.INVALID_TYPE:return`Value ${s} is not a valid value for the field type - field: ${o.name}, type: ${o.type}, nullable: ${o.nullable}`;case lg$3.OUT_OF_RANGE:{const{min:a,max:l}=HC$2(o.type);return`Value ${s} is out of range for the number type - field: ${o.name}, type: ${o.type}, value range is ${a} to ${l}`}}}function vJ$1(r,o){return!bJ$1(r,o,null)}function bJ$1(r,o,s){if(!o?.attributes||!r)return!0;const a=new Set(Object.keys(o.attributes));let l=!1;for(const c of r)if(!a.has(c)&&(l=!0,s==null))break;return l}function _J$1(r){return!!r&&["raster.itempixelvalue","raster.servicepixelvalue"].some(o=>r.toLowerCase().startsWith(o))}function WC$2(r){const o=r?.match(/{[^}]+}/g);return o?o.map(s=>s.slice(1,-1).split(":")[0].trim()):[]}let ug$2=class extends ee$1{constructor(o){super(o),this.type=null}};v([S({type:["attachments","custom","fields","media","text","expression","relationship","utility-network-associations"],readOnly:!0,json:{read:!1,write:!0}})],ug$2.prototype,"type",void 0),ug$2=v([it$1("esri.popup.content.Content")],ug$2);const Go$1=ug$2;var Cw$2;let _c$2=Cw$2=class extends Go$1{constructor(r){super(r),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new Cw$2({description:this.description,displayType:this.displayType,title:this.title})}};v([S({type:String,json:{write:!0}})],_c$2.prototype,"description",void 0),v([S({type:["auto","preview","list"],json:{write:!0}})],_c$2.prototype,"displayType",void 0),v([S({type:String,json:{write:!0}})],_c$2.prototype,"title",void 0),v([S({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],_c$2.prototype,"type",void 0),_c$2=Cw$2=v([it$1("esri.popup.content.AttachmentsContent")],_c$2);const Th$2=_c$2;var Rw$2;let wc$2=Rw$2=class extends Go$1{constructor(r){super(r),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new Rw$2({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?gt$3(this.outFields):null})}};v([S()],wc$2.prototype,"creator",void 0),v([S()],wc$2.prototype,"destroyer",void 0),v([S()],wc$2.prototype,"outFields",void 0),v([S({type:["custom"],readOnly:!0})],wc$2.prototype,"type",void 0),wc$2=Rw$2=v([it$1("esri.popup.content.CustomContent")],wc$2);const wJ$1=wc$2;var kw$1;let Sh$2=kw$1=class extends ee$1{constructor(r){super(r),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new kw$1({title:this.title,expression:this.expression})}};v([S({type:String,json:{write:!0}})],Sh$2.prototype,"title",void 0),v([S({type:String,json:{write:!0}})],Sh$2.prototype,"expression",void 0),v([S({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],Sh$2.prototype,"returnType",void 0),Sh$2=kw$1=v([it$1("esri.popup.ElementExpressionInfo")],Sh$2);const XC$2=Sh$2;var Lw$2;let tf$2=Lw$2=class extends Go$1{constructor(r){super(r),this.expressionInfo=null,this.type="expression"}clone(){return new Lw$2({expressionInfo:this.expressionInfo?.clone()})}};v([S({type:XC$2,json:{write:!0}})],tf$2.prototype,"expressionInfo",void 0),v([S({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],tf$2.prototype,"type",void 0),tf$2=Lw$2=v([it$1("esri.popup.content.ExpressionContent")],tf$2);const hg$2=tf$2;function ae$1(r,o={}){const s=r instanceof js$2?r:new js$2(r,o),{alwaysWriteDefaults:a,default:l,ignoreUnknown:c=!0,name:u,nonNullable:d,readOnly:m=!1}=o;return S({type:c?s.apiValues:String,json:{type:s.jsonValues,default:l,name:u,read:!m&&{reader:s.read},write:{writer:s.write,alwaysWriteDefaults:a}},nonNullable:d,readOnly:m})}let Ah$2=class extends Hs$2(ee$1){constructor(o){super(o),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};v([ae$1(BX$1)],Ah$2.prototype,"dateFormat",void 0),v([S({type:Boolean,json:{write:!0}})],Ah$2.prototype,"digitSeparator",void 0),v([S({type:On$2,json:{write:!0}})],Ah$2.prototype,"places",void 0),Ah$2=v([it$1("esri.popup.support.FieldInfoFormat")],Ah$2);const YC$2=Ah$2;var Pw$1;let hs$2=Pw$1=class extends ee$1{constructor(r){super(r),this.fieldName=null,this.format=void 0,this.isEditable=!0,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new Pw$1({fieldName:this.fieldName,format:this.format?.clone(),isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};v([S({type:String,json:{write:!0}})],hs$2.prototype,"fieldName",void 0),v([S({type:YC$2,json:{write:!0}})],hs$2.prototype,"format",void 0),v([S({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],hs$2.prototype,"isEditable",void 0),v([S({type:String,json:{write:!0}})],hs$2.prototype,"label",void 0),v([ae$1(new js$2({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],hs$2.prototype,"stringFieldOption",void 0),v([S({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],hs$2.prototype,"statisticType",void 0),v([S({type:String,json:{write:!0}})],hs$2.prototype,"tooltip",void 0),v([S({type:Boolean,json:{write:!0}})],hs$2.prototype,"visible",void 0),hs$2=Pw$1=v([it$1("esri.popup.FieldInfo")],hs$2);const Dw$2=hs$2;var Gw$2;let Fo$2=Gw$2=class extends Go$1{constructor(r){super(r),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(r,o){o.fieldInfos=r&&r.map(s=>s.toJSON())}clone(){return new Gw$2(gt$3({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};v([S({type:Object,json:{write:!0}})],Fo$2.prototype,"attributes",void 0),v([S({type:String,json:{write:!0}})],Fo$2.prototype,"description",void 0),v([S({type:[Dw$2]})],Fo$2.prototype,"fieldInfos",void 0),v([en$2("fieldInfos")],Fo$2.prototype,"writeFieldInfos",null),v([S({type:String,json:{write:!0}})],Fo$2.prototype,"title",void 0),v([S({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],Fo$2.prototype,"type",void 0),Fo$2=Gw$2=v([it$1("esri.popup.content.FieldsContent")],Fo$2);const Ih$2=Fo$2;let xc$2=class extends ee$1{constructor(o){super(o),this.altText=null,this.caption="",this.title="",this.type=null}};v([S({type:String,json:{write:!0}})],xc$2.prototype,"altText",void 0),v([S({type:String,json:{write:!0}})],xc$2.prototype,"caption",void 0),v([S({type:String,json:{write:!0}})],xc$2.prototype,"title",void 0),v([S({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],xc$2.prototype,"type",void 0),xc$2=v([it$1("esri.popup.content.mixins.MediaInfo")],xc$2);const Fw$1=xc$2;var jw$1;let Ec$2=jw$1=class extends jn$2{constructor(r){super(r),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new jw$1({color:this.color?.clone(),fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};v([S()],Ec$2.prototype,"color",void 0),v([S()],Ec$2.prototype,"fieldName",void 0),v([S()],Ec$2.prototype,"tooltip",void 0),v([S()],Ec$2.prototype,"value",void 0),Ec$2=jw$1=v([it$1("esri.popup.content.support.ChartMediaInfoValueSeries")],Ec$2);const JC$2=Ec$2;var Uw$2;let Ya$2=Uw$2=class extends ee$1{constructor(r){super(r),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new Uw$2({colors:gt$3(this.colors),fields:gt$3(this.fields),normalizeField:this.normalizeField,series:gt$3(this.series),tooltipField:this.tooltipField})}};v([S({type:[me$1],json:{type:[[On$2]],write:!0}})],Ya$2.prototype,"colors",void 0),v([S({type:[String],json:{write:!0}})],Ya$2.prototype,"fields",void 0),v([S({type:String,json:{write:!0}})],Ya$2.prototype,"normalizeField",void 0),v([S({type:[JC$2],json:{read:!1}})],Ya$2.prototype,"series",void 0),v([S({type:String,json:{write:!0}})],Ya$2.prototype,"tooltipField",void 0),Ya$2=Uw$2=v([it$1("esri.popup.content.support.ChartMediaInfoValue")],Ya$2);const xJ$1=Ya$2;let ef$2=class extends Fw$1{constructor(o){super(o),this.type=null,this.value=void 0}};v([S({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],ef$2.prototype,"type",void 0),v([S({type:xJ$1,json:{write:!0}})],ef$2.prototype,"value",void 0),ef$2=v([it$1("esri.popup.content.mixins.ChartMediaInfo")],ef$2);const pg$2=ef$2,dg$2=Ii$2()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var $w$2;let fg$2=$w$2=class extends pg$2{constructor(r){super(r),this.type="bar-chart"}clone(){return new $w$2({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};v([S({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:dg$2.write}})],fg$2.prototype,"type",void 0),fg$2=$w$2=v([it$1("esri.popup.content.BarChartMediaInfo")],fg$2);const qC$2=fg$2;var Bw$2;let mg$2=Bw$2=class extends pg$2{constructor(r){super(r),this.type="column-chart"}clone(){return new Bw$2({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};v([S({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:dg$2.write}})],mg$2.prototype,"type",void 0),mg$2=Bw$2=v([it$1("esri.popup.content.ColumnChartMediaInfo")],mg$2);const ZC$2=mg$2;var Vw$2;let nf$2=Vw$2=class extends ee$1{constructor(r){super(r),this.linkURL=null,this.sourceURL=null}clone(){return new Vw$2({linkURL:this.linkURL,sourceURL:this.sourceURL})}};v([S({type:String,json:{write:!0}})],nf$2.prototype,"linkURL",void 0),v([S({type:String,json:{write:!0}})],nf$2.prototype,"sourceURL",void 0),nf$2=Vw$2=v([it$1("esri.popup.content.support.ImageMediaInfoValue")],nf$2);const EJ$1=nf$2;var zw$2;let Mh$2=zw$2=class extends Fw$1{constructor(r){super(r),this.refreshInterval=0,this.type="image",this.value=void 0}clone(){return new zw$2({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?.clone()})}};v([S({type:Number,json:{write:!0}})],Mh$2.prototype,"refreshInterval",void 0),v([S({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],Mh$2.prototype,"type",void 0),v([S({type:EJ$1,json:{write:!0}})],Mh$2.prototype,"value",void 0),Mh$2=zw$2=v([it$1("esri.popup.content.ImageMediaInfo")],Mh$2);const QC$2=Mh$2;var Hw$2;let yg$2=Hw$2=class extends pg$2{constructor(r){super(r),this.type="line-chart"}clone(){return new Hw$2({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};v([S({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:dg$2.write}})],yg$2.prototype,"type",void 0),yg$2=Hw$2=v([it$1("esri.popup.content.LineChartMediaInfo")],yg$2);const KC$2=yg$2;var Ww$2;let gg$3=Ww$2=class extends pg$2{constructor(r){super(r),this.type="pie-chart"}clone(){return new Ww$2({altText:this.altText,title:this.title,caption:this.caption,value:this.value?.clone()})}};v([S({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:dg$2.write}})],gg$3.prototype,"type",void 0),gg$3=Ww$2=v([it$1("esri.popup.content.PieChartMediaInfo")],gg$3);const t5$1=gg$3,Xw$2={base:Fw$1,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":qC$2,"column-chart":ZC$2,"line-chart":KC$2,"pie-chart":t5$1,image:QC$2}};var Yw$2;let ps$2=Yw$2=class extends Go$1{constructor(r){super(r),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(r){return r&&r.map(o=>o.type==="image"?QC$2.fromJSON(o):o.type==="barchart"?qC$2.fromJSON(o):o.type==="columnchart"?ZC$2.fromJSON(o):o.type==="linechart"?KC$2.fromJSON(o):o.type==="piechart"?t5$1.fromJSON(o):void 0).filter(Boolean)}writeMediaInfos(r,o){o.mediaInfos=r&&r.map(s=>s.toJSON())}clone(){return new Yw$2(gt$3({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};v([S()],ps$2.prototype,"activeMediaInfoIndex",void 0),v([S({type:Object,json:{write:!0}})],ps$2.prototype,"attributes",void 0),v([S({type:String,json:{write:!0}})],ps$2.prototype,"description",void 0),v([S({types:[Xw$2]})],ps$2.prototype,"mediaInfos",void 0),v([Un$2("mediaInfos")],ps$2.prototype,"readMediaInfos",null),v([en$2("mediaInfos")],ps$2.prototype,"writeMediaInfos",null),v([S({type:String,json:{write:!0}})],ps$2.prototype,"title",void 0),v([S({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],ps$2.prototype,"type",void 0),ps$2=Yw$2=v([it$1("esri.popup.content.MediaContent")],ps$2);const Nh$2=ps$2;var Jw$2;let rf$2=Jw$2=class extends ee$1{constructor(r){super(r),this.field=null,this.order=null}clone(){return new Jw$2({field:this.field,order:this.order})}};v([S({type:String,json:{write:!0}})],rf$2.prototype,"field",void 0),v([S({type:["asc","desc"],json:{write:!0}})],rf$2.prototype,"order",void 0),rf$2=Jw$2=v([it$1("esri.popup.support.RelatedRecordsInfoFieldOrder")],rf$2);const qw$1=rf$2;let Xs$2=class extends Hs$2(Go$1){constructor(o){super(o),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};v([S({type:String,json:{write:!0}})],Xs$2.prototype,"description",void 0),v([S({type:Number,json:{type:On$2,write:!0}})],Xs$2.prototype,"displayCount",void 0),v([S({type:["list"],json:{write:!0}})],Xs$2.prototype,"displayType",void 0),v([S({type:[qw$1],json:{write:!0}})],Xs$2.prototype,"orderByFields",void 0),v([S({type:Number,json:{type:On$2,write:!0}})],Xs$2.prototype,"relationshipId",void 0),v([S({type:String,json:{write:!0}})],Xs$2.prototype,"title",void 0),v([S({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],Xs$2.prototype,"type",void 0),Xs$2=v([it$1("esri.popup.content.RelationshipContent")],Xs$2);const sf$2=Xs$2;var Zw$1;let of$2=Zw$1=class extends Go$1{constructor(r){super(r),this.text=null,this.type="text"}clone(){return new Zw$1({text:this.text})}};v([S({type:String,json:{write:!0}})],of$2.prototype,"text",void 0),v([S({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],of$2.prototype,"type",void 0),of$2=Zw$1=v([it$1("esri.popup.content.TextContent")],of$2);const Oh$1=of$2;let Ys$2=class extends Hs$2(ee$1){constructor(o){super(o),this.title=null,this.description=null,this.type=null,this.open=!1,this.associatedNetworkSourceId=null,this.associatedAssetGroup=null,this.associatedAssetType=null}};v([S({type:String,json:{write:!0}})],Ys$2.prototype,"title",void 0),v([S({type:String,json:{write:!0}})],Ys$2.prototype,"description",void 0),v([S({type:["attachment","connectivity","container","content","structure"],json:{write:!0}})],Ys$2.prototype,"type",void 0),v([S({type:Boolean,json:{read:!1}})],Ys$2.prototype,"open",void 0),v([S({type:Number,json:{type:On$2,write:!0}})],Ys$2.prototype,"associatedNetworkSourceId",void 0),v([S({type:Number,json:{type:On$2,write:!0}})],Ys$2.prototype,"associatedAssetGroup",void 0),v([S({type:Number,json:{type:On$2,write:!0}})],Ys$2.prototype,"associatedAssetType",void 0),Ys$2=v([it$1("esri.popup.support.UtilityNetworkAssociationType")],Ys$2);const TJ$1=Ys$2;let Tc$2=class extends Hs$2(Go$1){constructor(o){super(o),this.description=null,this.title=null,this.associationTypes=[],this.type="utility-network-associations"}};v([S({type:String,json:{write:!0}})],Tc$2.prototype,"description",void 0),v([S({type:String,json:{write:!0}})],Tc$2.prototype,"title",void 0),v([S({type:[TJ$1],json:{write:!0}})],Tc$2.prototype,"associationTypes",void 0),v([ae$1({utilityNetworkAssociations:"utility-network-associations"})],Tc$2.prototype,"type",void 0),Tc$2=v([it$1("esri.popup.content.UtilityNetworkAssociationsContent")],Tc$2);const Qw$1=Tc$2,SJ$1={base:null,key:"type",typeMap:{attachment:Th$2,media:Nh$2,text:Oh$1,expression:hg$2,field:Ih$2,relationship:sf$2,utilityNetworkAssociations:Qw$1}},AJ$1={base:null,key:"type",typeMap:{attachment:Th$2,media:Nh$2,text:Oh$1,expression:hg$2,field:Ih$2,relationship:sf$2}};var Kw$2;let Sc$2=Kw$2=class extends ee$1{constructor(r){super(r),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new Kw$2({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};v([S({type:String,json:{write:!0}})],Sc$2.prototype,"name",void 0),v([S({type:String,json:{write:!0}})],Sc$2.prototype,"title",void 0),v([S({type:String,json:{write:!0}})],Sc$2.prototype,"expression",void 0),v([S({type:["string","number"],json:{write:!0}})],Sc$2.prototype,"returnType",void 0),Sc$2=Kw$2=v([it$1("esri.popup.ExpressionInfo")],Sc$2);const e5$1=Sc$2;var tx$2;let af$3=tx$2=class extends ee$1{constructor(r){super(r),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new tx$2({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};v([S({type:Boolean,json:{write:!0}})],af$3.prototype,"returnTopmostRaster",void 0),v([S({type:Boolean,json:{write:!0}})],af$3.prototype,"showNoDataRecords",void 0),af$3=tx$2=v([it$1("esri.popup.LayerOptions")],af$3);const IJ$1=af$3;var ex$2;let lf$2=ex$2=class extends ee$1{constructor(r){super(r),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new ex$2({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?gt$3(this.orderByFields):null})}};v([S({type:Boolean,json:{write:!0}})],lf$2.prototype,"showRelatedRecords",void 0),v([S({type:[qw$1],json:{write:!0}})],lf$2.prototype,"orderByFields",void 0),lf$2=ex$2=v([it$1("esri.popup.RelatedRecordsInfo")],lf$2);const n5$1=lf$2;let r5$1=0;const nx$2=r=>{let o=class extends r{constructor(...s){super(...s),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+r5$1++})}};return o=v([it$1("esri.core.Identifiable")],o),o},MJ$1=r=>{let o=class extends r{constructor(...s){super(...s),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:r5$1++})}};return o=v([it$1("esri.core.Identifiable.NumericIdentifiable")],o),o};let i5$1=class extends nx$2(class{}){};i5$1=v([it$1("esri.core.Identifiable")],i5$1);var rx$3;let Gi$2=rx$3=class extends nx$2(jn$2){constructor(r){super(r),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new rx$3({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};v([S()],Gi$2.prototype,"active",void 0),v([S()],Gi$2.prototype,"className",void 0),v([S()],Gi$2.prototype,"disabled",void 0),v([S()],Gi$2.prototype,"icon",void 0),v([S()],Gi$2.prototype,"id",void 0),v([S()],Gi$2.prototype,"indicator",void 0),v([S()],Gi$2.prototype,"title",void 0),v([S()],Gi$2.prototype,"type",void 0),v([S()],Gi$2.prototype,"visible",void 0),Gi$2=rx$3=v([it$1("esri.support.actions.ActionBase")],Gi$2);const vg$2=Gi$2;var ix$1;let bg$2=ix$1=class extends vg$2{constructor(r){super(r),this.image=null,this.type="button"}clone(){return new ix$1({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};v([S()],bg$2.prototype,"image",void 0),bg$2=ix$1=v([it$1("esri.support.actions.ActionButton")],bg$2);const s5$1=bg$2;var sx$2;let cf$2=sx$2=class extends vg$2{constructor(r){super(r),this.image=null,this.type="toggle",this.value=!1}clone(){return new sx$2({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};v([S()],cf$2.prototype,"image",void 0),v([S()],cf$2.prototype,"value",void 0),cf$2=sx$2=v([it$1("esri.support.actions.ActionToggle")],cf$2);const o5$1=cf$2,uf$2="relationships/",a5$1="expression/",NJ$1=Fe.ofType({key:"type",defaultKeyValue:"button",base:vg$2,typeMap:{button:s5$1,toggle:o5$1}}),OJ$1={base:Go$1,key:"type",typeMap:{media:Nh$2,custom:wJ$1,text:Oh$1,attachments:Th$2,fields:Ih$2,expression:hg$2,relationship:sf$2,utilityNetworkAssociations:Qw$1}},l5$1=new Set(["attachments","fields","media","text","expression","relationship"]),CJ$1=new Set([...l5$1,"utility-network-associations"]);let kn$2=class extends Hs$2(ee$1){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(o){return Array.isArray(o)?o.map(s=>_a$2(OJ$1,s)):typeof o=="string"||typeof o=="function"||o instanceof HTMLElement||G2$1(o)?o:(Le$1.getLogger(this).error("content error","unsupported content value",{value:o}),null)}readContent(o,s){const{popupElements:a}=s;return Array.isArray(a)&&a.length>0?this._readPopupInfoElements(s.description,s.mediaInfos,a):this._readPopupInfo(s)}writeWebSceneContent(o,s,a,l){this._writePopupTemplateContent(o,s,l)}writeWebMapContent(o,s,a,l){this._writePopupTemplateContent(o,s,l)}writeFieldInfos(o,s,a,l){const{content:c}=this,u=Array.isArray(c)?c:null;if(o){const d=u?u.filter(g=>g.type==="fields"):[],m=d.length&&d.every(g=>g.fieldInfos?.length);s.fieldInfos=o.filter(Boolean).map(g=>{const y=g.toJSON(l);return m&&(y.visible=!1),y})}if(u)for(const d of u)d.type==="fields"&&this._writeFieldsContent(d,s)}writeLayerOptions(o,s,a,l){s[a]=!o||o.showNoDataRecords===null&&o.returnTopmostRaster===null?null:o.toJSON(l)}writeTitle(o,s){s.title=o||""}async collectRequiredFields(o,s){const a=this.expressionInfos||[];await this._collectExpressionInfoFields(o,s,[...a,...this._getContentExpressionInfos(this.content,a)]),Eh$2(o,s,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(o){const s=new Set;return await this.collectRequiredFields(s,o),[...s].sort()}_writePopupTemplateContent(o,s,a){typeof o!="string"?Array.isArray(o)&&(s.popupElements=o.filter(l=>a?.origin==="web-scene"?l5$1.has(l.type):CJ$1.has(l.type)).map(l=>l?.toJSON(a)),s.popupElements.forEach(l=>{l.type==="attachments"?this._writeAttachmentContent(s):l.type==="media"?this._writeMediaContent(l,s):l.type==="text"?this._writeTextContent(l,s):l.type==="relationship"&&this._writeRelationshipContent(l,s)})):s.description=o}_writeFieldsContent(o,s){if(!Array.isArray(o.fieldInfos)||!o.fieldInfos.length)return;const a=gt$3(o.fieldInfos);Array.isArray(s.fieldInfos)?a.forEach(l=>{const c=s.fieldInfos.find(u=>u.fieldName?.toLowerCase()===l.fieldName?.toLowerCase());c?c.visible=!0:s.fieldInfos.push(l)}):s.fieldInfos=a}_writeAttachmentContent(o){o.showAttachments||(o.showAttachments=!0)}_writeRelationshipContent(o,s){const a=o.orderByFields?.map(c=>this._toFieldOrderJSON(c,o.relationshipId))||[],l=[...s.relatedRecordsInfo?.orderByFields||[],...a];s.relatedRecordsInfo={showRelatedRecords:!0,...l?.length&&{orderByFields:l}}}_writeTextContent(o,s){!s.description&&o.text&&(s.description=o.text)}_writeMediaContent(o,s){if(!Array.isArray(o.mediaInfos)||!o.mediaInfos.length)return;const a=gt$3(o.mediaInfos);Array.isArray(s.mediaInfos)?s.mediaInfos=[...s.mediaInfos,...a]:s.mediaInfos=a}_readPopupInfoElements(o,s,a){const l={description:!1,mediaInfos:!1};return a.map(c=>c.type==="media"?(c.mediaInfos||!s||l.mediaInfos||(c.mediaInfos=s,l.mediaInfos=!0),Nh$2.fromJSON(c)):c.type==="text"?(c.text||!o||l.description||(c.text=o,l.description=!0),Oh$1.fromJSON(c)):c.type==="attachments"?Th$2.fromJSON(c):c.type==="fields"?Ih$2.fromJSON(c):c.type==="expression"?hg$2.fromJSON(c):c.type==="relationship"?sf$2.fromJSON(c):c.type==="utilityNetworkAssociations"?Qw$1.fromJSON(c):void 0).filter(Boolean)}_toRelationshipContent(o){const{field:s,order:a}=o;if(!s?.startsWith(uf$2))return null;const l=s.replace(uf$2,"").split("/");if(l.length!==2)return null;const c=parseInt(l[0],10),u=l[1];return typeof c=="number"&&u?sf$2.fromJSON({relationshipId:c,orderByFields:[{field:u,order:a}]}):null}_toFieldOrderJSON(o,s){const{order:a,field:l}=o;return{field:`${uf$2}${s}/${l}`,order:a}}_readPopupInfo({description:o,mediaInfos:s,showAttachments:a,relatedRecordsInfo:l={showRelatedRecords:!1}}){const c=[];o?c.push(new Oh$1({text:o})):c.push(new Ih$2),Array.isArray(s)&&s.length&&c.push(Nh$2.fromJSON({mediaInfos:s})),a&&c.push(Th$2.fromJSON({displayType:"auto"}));const{showRelatedRecords:u,orderByFields:d}=l;return u&&d?.length&&d.forEach(m=>{const g=this._toRelationshipContent(m);g&&c.push(g)}),c.length?c:o}_getContentElementFields(o){const s=o?.type;if(s==="attachments")return[...this._extractFieldNames(o.title),...this._extractFieldNames(o.description)];if(s==="custom")return o.outFields||[];if(s==="fields")return[...this._extractFieldNames(o.title),...this._extractFieldNames(o.description),...this._getFieldInfoFields(o.fieldInfos??this.fieldInfos)];if(s==="media"){const a=o.mediaInfos||[];return[...this._extractFieldNames(o.title),...this._extractFieldNames(o.description),...a.reduce((l,c)=>[...l,...this._getMediaInfoFields(c)],[])]}return s==="text"?this._extractFieldNames(o.text):s==="relationship"||s==="utility-network-associations"?[...this._extractFieldNames(o.title),...this._extractFieldNames(o.description)]:[]}_getMediaInfoFields(o){const{caption:s,title:a,value:l}=o,c=l||{},{fields:u,normalizeField:d,tooltipField:m,sourceURL:g,linkURL:y}=c,_=[...this._extractFieldNames(a),...this._extractFieldNames(s),...this._extractFieldNames(g),...this._extractFieldNames(y),...u??[]];return d&&_.push(d),m&&_.push(m),_}_getContentExpressionInfos(o,s){return Array.isArray(o)?o.reduce((a,l)=>[...a,...l.type==="expression"&&l.expressionInfo?[l.expressionInfo]:[]],s):[]}_getContentFields(o){return typeof o=="string"?this._extractFieldNames(o):Array.isArray(o)?o.reduce((s,a)=>[...s,...this._getContentElementFields(a)],[]):[]}async _collectExpressionInfoFields(o,s,a){a&&await Promise.all(a.map(l=>Xa$2(o,s,l.expression)))}_getFieldInfoFields(o){return o?o.filter(({fieldName:s,visible:a})=>!(a!==void 0&&!a||!s||s.startsWith(uf$2)||s.startsWith(a5$1))).map(s=>s.fieldName):[]}_getActionsFields(o){return o?o.toArray().reduce((s,a)=>[...s,...this._getActionFields(a)],[]):[]}_getActionFields(o){const{className:s,title:a,type:l}=o,c=l==="button"||l==="toggle"?o.image:"";return[...this._extractFieldNames(a),...this._extractFieldNames(s),...this._extractFieldNames(c)]}_getTitleFields(o){return typeof o=="string"?this._extractFieldNames(o):[]}_extractFieldNames(o){return WC$2(o).filter(s=>!(s.indexOf(uf$2)===0||s.indexOf(a5$1)===0))}};v([S({type:NJ$1})],kn$2.prototype,"actions",void 0),v([S()],kn$2.prototype,"content",void 0),v([Ku$2("content")],kn$2.prototype,"castContent",null),v([Un$2("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],kn$2.prototype,"readContent",null),v([en$2("web-scene","content",{popupElements:{type:Fe.ofType(AJ$1)},showAttachments:{type:Boolean},mediaInfos:{type:Fe.ofType(Xw$2)},description:{type:String},relatedRecordsInfo:{type:n5$1}})],kn$2.prototype,"writeWebSceneContent",null),v([en$2("content",{popupElements:{type:Fe.ofType(SJ$1)},showAttachments:{type:Boolean},mediaInfos:{type:Fe.ofType(Xw$2)},description:{type:String},relatedRecordsInfo:{type:n5$1}})],kn$2.prototype,"writeWebMapContent",null),v([S({type:[e5$1],json:{write:!0}})],kn$2.prototype,"expressionInfos",void 0),v([S({type:[Dw$2]})],kn$2.prototype,"fieldInfos",void 0),v([en$2("fieldInfos")],kn$2.prototype,"writeFieldInfos",null),v([S({type:IJ$1})],kn$2.prototype,"layerOptions",void 0),v([en$2("layerOptions")],kn$2.prototype,"writeLayerOptions",null),v([S({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],kn$2.prototype,"lastEditInfoEnabled",void 0),v([S()],kn$2.prototype,"outFields",void 0),v([S()],kn$2.prototype,"overwriteActions",void 0),v([S()],kn$2.prototype,"returnGeometry",void 0),v([S({json:{type:String}})],kn$2.prototype,"title",void 0),v([en$2("title")],kn$2.prototype,"writeTitle",null),kn$2=v([it$1("esri.PopupTemplate")],kn$2);const c5$1=kn$2,u5$1=new js$2({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let RJ$1=0,Ch$2=class extends ee$1{constructor(o){super(o),this.id="sym"+RJ$1++,this.type=null,this.color=new me$1([0,0,0,1])}readColor(o){return o?.[0]!=null?[o[0],o[1],o[2],o[3]/255]:o}async collectRequiredFields(o,s){}hash(){return JSON.stringify(this.toJSON())}clone(){}};v([S({type:u5$1.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:u5$1.write}}})],Ch$2.prototype,"type",void 0),v([S({type:me$1,json:{write:{allowNull:!0}}})],Ch$2.prototype,"color",void 0),v([Un$2("color")],Ch$2.prototype,"readColor",null),Ch$2=v([it$1("esri.symbols.Symbol")],Ch$2);const rr$1=Ch$2;var ox$2;let Ja$2=ox$2=class extends rr$1{constructor(r){super(r),this.data=null,this.type="cim"}readData(r,o){return o}writeData(r,o){Object.assign(o,r)}async collectRequiredFields(r,o){if(this.data?.type==="CIMSymbolReference"){const s=this.data.primitiveOverrides;if(s){const a=s.map(l=>{const c=l.valueExpressionInfo;return c?Xa$2(r,o,c.expression):null});await Promise.all(a)}}}clone(){return new ox$2({data:gt$3(this.data)})}hash(){return c2$2(JSON.stringify(this.data)).toString()}};v([S({json:{write:!1}})],Ja$2.prototype,"color",void 0),v([S({json:{write:!0}})],Ja$2.prototype,"data",void 0),v([Un$2("data",["symbol"])],Ja$2.prototype,"readData",null),v([en$2("data",{})],Ja$2.prototype,"writeData",null),v([ae$1({CIMSymbolReference:"cim"},{readOnly:!0})],Ja$2.prototype,"type",void 0),Ja$2=ox$2=v([it$1("esri.symbols.CIMSymbol")],Ja$2);const qa$1=Ja$2;let Rh$2=class extends ee$1{constructor(o){super(o),this.enabled=!0,this.type=null,this.ignoreDrivers=!1}writeEnabled(o,s,a){o||(s[a]=o)}};v([S({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],Rh$2.prototype,"enabled",void 0),v([en$2("enabled")],Rh$2.prototype,"writeEnabled",null),v([S({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],Rh$2.prototype,"type",void 0),Rh$2=v([it$1("esri.symbols.Symbol3DLayer")],Rh$2);const Js$2=Rh$2,kJ$1=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,LJ$1="screenUtils.toPt: input not recognized!",h5$1=96;function PJ$1(r){return r?r/72*h5$1:0}function ds$2(r){return r?72*r/h5$1:0}function Je$1(r){if(typeof r=="string"){const o=r.match(kJ$1);if(o){const s=Number(o[1]),a=o[3]&&o[3].toLowerCase(),l=r.charAt(0)==="-",c=a==="px"?ds$2(s):s;return l?-c:c}return console.warn(LJ$1),null}return r}function p5$1(r=0,o=0){return{x:r,y:o}}function DJ$1(r){return r?p5$1(r.x,r.y):null}function GJ$1(r=0,o=0){return[r,o]}function FJ$1(r=0,o=0,s=0){return[r,o,s]}function jJ$1(r,o){return o?(o[0]=r.x,o[1]=r.y,o.length>2&&(o[2]=0),o):[r.x,r.y]}function d5$1(r){const o=O0$1(100*(1-r));return Math.max(0,Math.min(o,100))}function f5$1(r){const o=1-r/100;return Math.max(0,Math.min(o,1))}function UJ$1(r,o){const s=o.transparency!=null?f5$1(o.transparency):1,a=o.color;return a&&Array.isArray(a)?new me$1([a[0]||0,a[1]||0,a[2]||0,s]):null}function $J$1(r,o){o.color=r.toJSON().slice(0,3);const s=d5$1(r.a);s!==0&&(o.transparency=s)}const Za$2={type:me$1,json:{type:[On$2],default:null,read:{source:["color","transparency"],reader:UJ$1},write:{target:{color:{type:[On$2]},transparency:{type:On$2}},writer:$J$1}}},qs$2={type:Number,cast:Je$1,json:{write:!0}};let Ac$2=class extends ee$1{constructor(o){super(o),this.color=new me$1([0,0,0,1]),this.extensionLength=0,this.size=ds$2(1)}clone(){}cloneProperties(){return{color:gt$3(this.color),size:this.size,extensionLength:this.extensionLength}}};v([S({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Ac$2.prototype,"type",void 0),v([S(Za$2)],Ac$2.prototype,"color",void 0),v([S({...qs$2,json:{write:{overridePolicy:r=>({enabled:!!r})}}})],Ac$2.prototype,"extensionLength",void 0),v([S(qs$2)],Ac$2.prototype,"size",void 0),Ac$2=v([it$1("esri.symbols.edges.Edges3D")],Ac$2);const ax$2=Ac$2;var lx$2;let _g$2=lx$2=class extends ax$2{constructor(r){super(r),this.type="sketch"}clone(){return new lx$2(this.cloneProperties())}};v([ae$1({sketch:"sketch"},{readOnly:!0})],_g$2.prototype,"type",void 0),_g$2=lx$2=v([it$1("esri.symbols.edges.SketchEdges3D")],_g$2);const BJ$1=_g$2;var cx$2;let wg$2=cx$2=class extends ax$2{constructor(r){super(r),this.type="solid"}clone(){return new cx$2(this.cloneProperties())}};v([ae$1({solid:"solid"},{readOnly:!0})],wg$2.prototype,"type",void 0),wg$2=cx$2=v([it$1("esri.symbols.edges.SolidEdges3D")],wg$2);const m5$1=wg$2,ux$2={types:{key:"type",base:ax$2,typeMap:{solid:m5$1,sketch:BJ$1}},json:{write:!0}};function xg$2(){return[0,0,0]}function Eg$2(r){return[r[0],r[1],r[2]]}function Ic$2(r,o,s){return[r,o,s]}function y5$1(r,o,s){return[r,o,s]}function g5$1(r,o=xg$2()){const s=Math.min(3,r.length);for(let a=0;a({enabled:r!=="round"&&s?.origin==null})}}})],jo$1.prototype,"cap",void 0),v([S({type:["miter","round","bevel"],json:{write:{overridePolicy:(r,o,s)=>({enabled:r!=="round"&&s?.origin==null})}}})],jo$1.prototype,"join",void 0),v([S({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":WJ$1}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],jo$1.prototype,"marker",void 0),v([S({type:Number,json:{read:!1,write:!1}})],jo$1.prototype,"miterLimit",void 0),jo$1=fx$2=v([it$1("esri.symbols.SimpleLineSymbol")],jo$1);const Fi$2=jo$1;let pf$2=class extends rr$1{constructor(o){super(o),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline?.hash()}`}};v([S({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Fi$2}},json:{default:null,write:!0}})],pf$2.prototype,"outline",void 0),v([S({type:["simple-fill","picture-fill"],readOnly:!0})],pf$2.prototype,"type",void 0),pf$2=v([it$1("esri.symbols.FillSymbol")],pf$2);const O5$1=pf$2;let Tg$2=class extends ee$1{constructor(o){super(o)}clone(){throw new Error("Subclasses of LinePattern3D should implement their own clone method.")}};v([S({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Tg$2.prototype,"type",void 0),Tg$2=v([it$1("esri.symbols.patterns.LinePattern3D")],Tg$2);const C5$1=Tg$2,XJ$1=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var yx$2;const YJ$1=Ii$2()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let df$2=yx$2=class extends C5$1{constructor(r){super(r),this.type="style",this.style="solid"}clone(){const r={style:this.style};return new yx$2(r)}};v([S({type:["style"]})],df$2.prototype,"type",void 0),v([ae$1(YJ$1),S({type:XJ$1})],df$2.prototype,"style",void 0),df$2=yx$2=v([it$1("esri.symbols.patterns.LineStylePattern3D")],df$2);const gx$2=df$2;let Sg$2=class extends ee$1{constructor(o){super(o),this.type="style"}clone(){throw new Error("Subclasses of Pattern3D should implement their own clone method.")}};v([S({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Sg$2.prototype,"type",void 0),Sg$2=v([it$1("esri.symbols.patterns.Pattern3D")],Sg$2);const R5$1=Sg$2,JJ$1=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var vx$2;let ff$2=vx$2=class extends R5$1{constructor(r){super(r),this.type="style",this.style="solid"}clone(){return new vx$2({style:this.style})}};v([S({type:["style"]})],ff$2.prototype,"type",void 0),v([S({type:JJ$1,json:{read:!0,write:!0}})],ff$2.prototype,"style",void 0),ff$2=vx$2=v([it$1("esri.symbols.patterns.StylePattern3D")],ff$2);const k5$1=ff$2,qJ$1={types:{key:"type",base:R5$1,typeMap:{style:k5$1}},json:{write:!0}},L5$1={types:{key:"type",base:C5$1,typeMap:{style:gx$2}},json:{write:!0}},mf$2=new me$1("white");new me$1("black");const ZJ$1=new me$1([255,255,255,0]);function QJ$1(r){return r.r===0&&r.g===0&&r.b===0}var bx$2;let yf$2=bx$2=class extends zr$2{constructor(r){super(r),this.colorMixMode=null}clone(){const r={color:this.color?.clone()??null,emissiveFactor:this.emissiveFactor?Eg$2(this.emissiveFactor):null,colorMixMode:this.colorMixMode};return new bx$2(r)}};v([ae$1({multiply:"multiply",replace:"replace",tint:"tint"})],yf$2.prototype,"colorMixMode",void 0),yf$2=bx$2=v([it$1("esri.symbols.support.Symbol3DFillMaterial")],yf$2);function P5$1(r,o=!1){return r<=r2$2?o?new Array(r).fill(0):new Array(r):new Float64Array(r)}function KJ$1(r){return(n2$2(r)?r.length:r.byteLength/8)<=r2$2?Array.from(r):new Float64Array(r)}function tq$1(r,o,s){return Array.isArray(r)?r.slice(o,o+s):r.subarray(o,o+s)}function kh$1(r=D5$1){return[r[0],r[1],r[2],r[3],r[4],r[5]]}function Ag$1(r,o,s,a,l,c,u=kh$1()){return u[0]=r,u[1]=o,u[2]=s,u[3]=a,u[4]=l,u[5]=c,u}function eq$1(r,o=kh$1()){return nq$1(r,0,r.length/3,o)}function nq$1(r,o,s,a=kh$1()){return Ex$2(a,Ig$2),aq$1(a,r,o,s),a}function rq$1(r,o=P5$1(24)){const[s,a,l,c,u,d]=r;return o[0]=s,o[1]=a,o[2]=l,o[3]=s,o[4]=a,o[5]=d,o[6]=s,o[7]=u,o[8]=l,o[9]=s,o[10]=u,o[11]=d,o[12]=c,o[13]=a,o[14]=l,o[15]=c,o[16]=a,o[17]=d,o[18]=c,o[19]=u,o[20]=l,o[21]=c,o[22]=u,o[23]=d,o}function iq$1(r,o){const s=isFinite(r[2])||isFinite(r[5]);return new hi$2(s?{xmin:r[0],xmax:r[3],ymin:r[1],ymax:r[4],zmin:r[2],zmax:r[5],spatialReference:o}:{xmin:r[0],xmax:r[3],ymin:r[1],ymax:r[4],spatialReference:o})}function sq$1(r,o){r[0]=Math.min(r[0],o[0]),r[1]=Math.min(r[1],o[1]),r[2]=Math.min(r[2],o[2]),r[3]=Math.max(r[3],o[3]),r[4]=Math.max(r[4],o[4]),r[5]=Math.max(r[5],o[5])}function oq$1(r,o){r[0]=Math.min(r[0],o[0]),r[1]=Math.min(r[1],o[1]),r[2]=Math.min(r[2],o[2]),r[3]=Math.max(r[3],o[0]),r[4]=Math.max(r[4],o[1]),r[5]=Math.max(r[5],o[2])}function aq$1(r,o,s=0,a=o.length/3){let l=r[0],c=r[1],u=r[2],d=r[3],m=r[4],g=r[5];for(let y=0;y=r[3]?0:r[3]-r[0]}function wx$1(r){return r[1]>=r[4]?0:r[4]-r[1]}function xx$2(r){return r[2]>=r[5]?0:r[5]-r[2]}function lq$1(r){const o=_x$1(r),s=xx$2(r),a=wx$1(r);return Math.sqrt(o*o+s*s+a*a)}function cq$1(r,o=[0,0,0]){return o[0]=r[0]+_x$1(r)/2,o[1]=r[1]+wx$1(r)/2,o[2]=r[2]+xx$2(r)/2,o}function uq$1(r,o=[0,0,0]){return o[0]=_x$1(r),o[1]=wx$1(r),o[2]=xx$2(r),o}function hq$1(r,o,s=r){return s[0]=o[0],s[1]=o[1],s[2]=o[2],s!==r&&(s[3]=r[3],s[4]=r[4],s[5]=r[5]),s}function pq$1(r,o,s=r){return s[3]=o[0],s[4]=o[1],s[5]=o[2],s!==r&&(s[0]=r[0],s[1]=r[1],s[2]=r[2]),r}function Ex$2(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r[4]=o[4],r[5]=o[5],r}function dq$1(r){return r?Ex$2(r,Ig$2):kh$1(Ig$2)}function fq$1(r,o){return r[0]=o[0],r[1]=o[1],r[2]=Number.NEGATIVE_INFINITY,r[3]=o[2],r[4]=o[3],r[5]=Number.POSITIVE_INFINITY,r}function mq$1(r,o,s,a,l){return r[0]=o,r[1]=s,r[2]=Number.NEGATIVE_INFINITY,r[3]=a,r[4]=l,r[5]=Number.POSITIVE_INFINITY,r}function Tx$2(r){return r.length===6}function yq$1(r,o,s){if(r==null||o==null)return r===o;if(!Tx$2(r)||!Tx$2(o))return!1;for(let a=0;a{const o=ud$2(r);return o===0?1:ad$2(o,.1,4)},nonNullable:!0},Aq$1=["left","right","center"],Iq$1=["baseline","top","middle","bottom"],j5$1={type:Aq$1,nonNullable:!0},U5$1={type:Iq$1,nonNullable:!0},Mq$1=8;var Ix$2;let $o$2=Ix$2=class extends ee$1{constructor(r){super(r),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(r){return Je$1(r)}clone(){return new Ix$2({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};v([S({type:Eq$1,json:{default:"none",write:!0}})],$o$2.prototype,"decoration",void 0),v([S({type:String,json:{write:!0}})],$o$2.prototype,"family",void 0),v([S({type:Number,json:{write:{overridePolicy:(r,o,s)=>({enabled:!s||!s.textSymbol3D})}}})],$o$2.prototype,"size",void 0),v([Ku$2("size")],$o$2.prototype,"castSize",null),v([S({type:Tq$1,json:{default:"normal",write:!0}})],$o$2.prototype,"style",void 0),v([S({type:Sq$1,json:{default:"normal",write:!0}})],$o$2.prototype,"weight",void 0),$o$2=Ix$2=v([it$1("esri.symbols.Font")],$o$2);const gf$2=$o$2;function Lh$2(r,o){const s=o?.url?.path;if(r&&s&&(r=Yu$2(r,s,{preserveProtocolRelative:!0}),o.portalItem&&o.readResourcePaths)){const a=r_$2(r,o.portalItem.itemUrl);a!=null&&Nq$1.test(a)&&o.readResourcePaths.push(o.portalItem.resourceFromPath(a).path)}return(r=Nx$2(r,o?.portal))&&Og$2.test(r)?Ox$1(r):r}function vf$2(r,o,s=Dh$2.YES){if((r=r&&Og$2.test(r)?V5$1(r):r)==null)return r;!Oi$2(r)&&o?.blockedRelativeUrls&&o.blockedRelativeUrls.push(r);let a=Yu$2(r);if(o){const l=o.verifyItemRelativeUrls?.rootPath||o.url?.path;if(l){const c=Nx$2(l,o.portal),u=Nx$2(a,o.portal);a=r_$2(u,c,c),a!=null&&a!==u&&a!==r&&o.verifyItemRelativeUrls&&o.verifyItemRelativeUrls.writtenUrls.push(a)}}return a=Mx$2(a,o?.portal),Oi$2(a)&&(a=ko$2(a)),o?.resources&&o?.portalItem&&!Oi$2(a)&&!oc$2(a)&&s===Dh$2.YES&&o.resources.toKeep.push({resource:o.portalItem.resourceFromPath(a),compress:!1}),a}function Ng$2(r,o,s){return Lh$2(r,s)}function Ph$2(r,o,s,a){const l=vf$2(r,a);l!==void 0&&(o[s]=l)}const Og$2=/\/items\/([^/]+)\/resources\/(.*)/,Nq$1=/^\.\/resources\//;function $5$1(r){return(r?.match(Og$2)??null)?.[1]??null}function B5$1(r){const o=r?.match(Og$2)??null;if(o==null)return null;const s=o[2],a=s.lastIndexOf("/");if(a===-1){const{path:u,extension:d}=rM$2(s);return{prefix:null,filename:u,extension:d}}const{path:l,extension:c}=rM$2(s.slice(a+1));return{prefix:s.slice(0,a),filename:l,extension:c}}function Mx$2(r,o){return o&&!o.isPortal&&o.urlKey&&o.customBaseUrl?o_$2(r,`${o.urlKey}.${o.customBaseUrl}`,o.portalHostname):r}function Nx$2(r,o){if(!o||o.isPortal||!o.urlKey||!o.customBaseUrl)return r;const s=`${o.urlKey}.${o.customBaseUrl}`,a=K2$1();return sc$3(a,`${a.scheme}://${s}`)?o_$2(r,o.portalHostname,s):o_$2(r,s,o.portalHostname)}function Ox$1(r){if(!r)return r||null;let o=r;return o&&Ve$2&&!Ve$2.findCredential(o)&&(o=Z2$1(o),o=o.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),o=o.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),o=o.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),o}function V5$1(r){if(!r)return r||null;let o=r;return o=o.replace(/^https?:\/\/cdn\.arcgis\.com/,"https://www.arcgis.com"),o=o.replace(/^https?:\/\/cdndev\.arcgis\.com/,"https://devext.arcgis.com"),o=o.replace(/^https?:\/\/cdnqa\.arcgis\.com/,"https://qaext.arcgis.com"),o&&Ve$2&&!Ve$2.findCredential(o)&&(o=Z2$1(o)),o}var Dh$2;(function(r){r[r.YES=0]="YES",r[r.NO=1]="NO"})(Dh$2||(Dh$2={}));const Oq$1=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return Dh$2},ensureMainOnlineDomain:Mx$2,fromCDNUrl:V5$1,fromJSON:Lh$2,itemIdFromResourceUrl:$5$1,prefixAndFilenameFromResourceUrl:B5$1,read:Ng$2,toCDNUrl:Ox$1,toJSON:vf$2,write:Ph$2},Symbol.toStringTag,{value:"Module"}));var Cx$2;const Cq$1=Ii$2()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let Oc$2=Cx$2=class extends ee$1{constructor(r){super(r)}readHref(r,o,s){return r?Lh$2(r,s):o.dataURI}writeHref(r,o,s,a){r&&(oc$2(r)?o.dataURI=r:(o.href=vf$2(r,a),Oi$2(o.href)&&(o.href=ko$2(o.href))))}clone(){return new Cx$2({href:this.href,primitive:this.primitive})}};v([S({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],Oc$2.prototype,"href",void 0),v([Un$2("href")],Oc$2.prototype,"readHref",null),v([en$2("href",{href:{type:String},dataURI:{type:String}})],Oc$2.prototype,"writeHref",null),v([ae$1(Cq$1)],Oc$2.prototype,"primitive",void 0),Oc$2=Cx$2=v([it$1("esri.symbols.support.IconSymbol3DLayerResource")],Oc$2);var Rx$2;let Gh$2=Rx$2=class extends jn$2{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new Rx$2({x:this.x,y:this.y})}};v([S({type:Number})],Gh$2.prototype,"x",void 0),v([S({type:Number})],Gh$2.prototype,"y",void 0),Gh$2=Rx$2=v([it$1("esri.symbols.support.Symbol3DAnchorPosition2D")],Gh$2);var kx$2;let bf$1=kx$2=class extends ee$1{constructor(r){super(r),this.color=new me$1([0,0,0,1]),this.size=ds$2(1)}clone(){const r={color:this.color!=null?this.color.clone():null,size:this.size};return new kx$2(r)}};v([S(Za$2)],bf$1.prototype,"color",void 0),v([S(qs$2)],bf$1.prototype,"size",void 0),bf$1=kx$2=v([it$1("esri.symbols.support.Symbol3DIconOutline")],bf$1);var Fh$2;const z5$1="esri.symbols.IconSymbol3DLayer";let fs$2=Fh$2=class extends Js$2{constructor(r){super(r),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null,this.angle=0}clone(){return new Fh$2({anchor:this.anchor,anchorPosition:gt$3(this.anchorPosition),enabled:this.enabled,material:gt$3(this.material),outline:gt$3(this.outline),resource:gt$3(this.resource),angle:this.angle,size:this.size})}static fromSimpleMarkerSymbol(r){const o=r.color||mf$2,s=H5$1(r),a=r.outline&&r.outline.width>0?{size:r.outline.width,color:(r.outline.color||mf$2).clone()}:null;return new Fh$2({size:r.size,angle:r.angle,resource:{primitive:kq$1(r.style)},material:{color:o},outline:a,anchor:s?"relative":void 0,anchorPosition:s})}static fromPictureMarkerSymbol(r){const o=!r.color||QJ$1(r.color)?mf$2:r.color,s=H5$1(r);return new Fh$2({size:r.width<=r.height?r.height:r.width,angle:r.angle,resource:{href:r.url},material:{color:o.clone()},anchor:s?"relative":void 0,anchorPosition:s})}static fromCIMSymbol(r){return new Fh$2({resource:{href:tM$2({mediaType:"application/json",data:JSON.stringify(r.data)})}})}};v([S({type:zr$2,json:{write:!0}})],fs$2.prototype,"material",void 0),v([S({type:Oc$2,json:{write:!0}})],fs$2.prototype,"resource",void 0),v([ae$1({Icon:"icon"},{readOnly:!0})],fs$2.prototype,"type",void 0),v([S(qs$2)],fs$2.prototype,"size",void 0),v([ae$1({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"},{default:"center"})],fs$2.prototype,"anchor",void 0),v([S({type:Gh$2,json:{type:[Number],read:{reader:r=>new Gh$2({x:r[0],y:r[1]})},write:{writer:(r,o)=>{o.anchorPosition=[r.x,r.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],fs$2.prototype,"anchorPosition",void 0),v([S({type:bf$1,json:{write:!0}})],fs$2.prototype,"outline",void 0),v([S({type:Number,json:{write:!0,default:0}})],fs$2.prototype,"angle",void 0),fs$2=Fh$2=v([it$1(z5$1)],fs$2);const Cc$2=fs$2;function H5$1(r){const o="width"in r?r.width:r.size,s="height"in r?r.height:r.size,a=W5$1(r.xoffset),l=W5$1(r.yoffset);return(a||l)&&o&&s?{x:-a/o,y:l/s}:null}function W5$1(r){return isFinite(r)?r:0}const Rq$1={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function kq$1(r){return Rq$1[r]||(Le$1.getLogger(z5$1).warn(`${r} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}function X5$1(r,o,s=Fe){return o||(o=new s),o===r||(o.removeAll(),Lq$1(r)?o.addMany(r):r&&o.add(r)),o}function Y5$1(r){return r}function Lq$1(r){return r&&(Array.isArray(r)||"items"in r&&Array.isArray(r.items))}var Ka$2;(function(r){r[r.PENDING=0]="PENDING",r[r.RESOLVED=1]="RESOLVED",r[r.REJECTED=2]="REJECTED"})(Ka$2||(Ka$2={}));let Pq$1=class{constructor(){this._resolver=ec$2(),this._status=Ka$2.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=Ka$2.RESOLVED,this._cleanUp()},()=>{this._status=Ka$2.REJECTED,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(o){this._resolvingPromises.push(o),this._tryResolve()}isResolved(){return this._status===Ka$2.RESOLVED}isRejected(){return this._status===Ka$2.REJECTED}isFulfilled(){return this._status!==Ka$2.PENDING}abort(){this._resolver.reject(Vr$2())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const o=ec$2(),s=[...this._resolvingPromises,o.promise],a=this._allPromise=Promise.all(s);a.then(()=>{this.isFulfilled()||this._allPromise!==a||this._resolver.resolve()},l=>{this.isFulfilled()||this._allPromise!==a||Vu$1(l)||this._resolver.reject(l)}),o.resolve()}};const J5$1=r=>{let o=class extends r{constructor(...s){super(...s),this._promiseProps=new Pq$1,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(s,a){return this._promiseProps.promise.then(()=>this).then(s,a)}catch(s){return this.when(null,s)}addResolvingPromise(s){s&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in s?s.when():s)}};return o=v([it$1("esri.core.Promise")],o),o};let Cg$2=class extends J5$1(jn$2){};Cg$2=v([it$1("esri.core.Promise")],Cg$2);const Dq$1="not-loaded",Gq$1="loading",Fq$1="failed",q5$1="loaded",Z5$1=r=>{let o=class extends r{constructor(...s){super(...s),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(a=>{const l=this.load.bind(this);this.load=c=>{const u=new Promise((d,m)=>{const g=EI$2(c,m);this.destroyed&&m(new oe("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(d,m).finally(()=>{g&&g.remove()})});if(this.loadStatus===Dq$1){this._set("loadStatus",Gq$1);const d=this._loadController=new AbortController;l({signal:d.signal})}return a(),u}})),this.when(()=>{this._set("loadStatus",q5$1),this._loadController=null},a=>{this._set("loadStatus",Fq$1),this._set("loadError",a),this._loadController=null})}destroy(){this._loadController&&(this._loadController=A2$1(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===q5$1}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new oe("load:cancelled","Cancelled")),this._loadController?.abort(),this._promiseProps.abort()),this}};return v([S({readOnly:!0})],o.prototype,"loaded",null),v([S({readOnly:!0})],o.prototype,"loadError",void 0),v([S({clonable:!1})],o.prototype,"loadStatus",void 0),v([S({type:[ju$2],readOnly:!0})],o.prototype,"loadWarnings",null),o=v([it$1("esri.core.Loadable")],o),o};let _f$1=class extends Z5$1(Cg$2){};_f$1=v([it$1("esri.core.Loadable")],_f$1),function(r){function o(s){return!(!s||!s.load)}r.LoadableMixin=Z5$1,r.isLoadable=o}(_f$1||(_f$1={}));const Q5$1=_f$1;let Rg$2;function jq$1(r){return Rg$2&&!Rg$2.destroyed||(Rg$2=r()),Rg$2}var Lx$2;const Uq$1=new js$2({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let ji$1=Lx$2=class extends jn$2{constructor(r){super(r),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(r){r!=="asc"&&r!=="desc"||this._set("sortOrder",r)}clone(){return new Lx$2({categories:this.categories?gt$3(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(r,o){let s=[];this.categories&&(s=this.categories.map(u=>Array.isArray(u)?JSON.stringify(u):u));let a="";if(this.extent){const u=I_$2(this.extent,Cn$2.WGS84);u!=null&&(a=`${u.xmin},${u.ymin},${u.xmax},${u.ymax}`)}let l=this.query;!this.disableExtraQuery&&r.extraQuery&&(l="("+l+")"+r.extraQuery);const c={categories:s,bbox:a,q:l,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(c.sortField=this.sortField.split(",").map(u=>Uq$1.toJSON(u.trim())).join(","),c.sortOrder=this.sortOrder),{query:{...o,...c}}}};v([S()],ji$1.prototype,"categories",void 0),v([S()],ji$1.prototype,"disableExtraQuery",void 0),v([S({type:hi$2})],ji$1.prototype,"extent",void 0),v([S()],ji$1.prototype,"filter",void 0),v([S()],ji$1.prototype,"num",void 0),v([S()],ji$1.prototype,"query",void 0),v([S()],ji$1.prototype,"sortField",void 0),v([S()],ji$1.prototype,"sortOrder",null),v([S()],ji$1.prototype,"start",void 0),ji$1=Lx$2=v([it$1("esri.portal.PortalQueryParams")],ji$1);const ms$2=ji$1;var Px$2;let Ln$2=Px$2=class extends ee$1{constructor(r){super(r),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){const r=this.url,o=this.thumbnail;return r&&o&&this.portal?this.portal?.normalizeUrl(`${r}/info/${o}?f=json`):null}get url(){const r=this.portal?.restUrl;return r?r+"/community/groups/"+this.id:null}fetchCategorySchema(r){return this.portal.request(this.url+"/categorySchema",r).then(o=>{const s=o.categorySchema||[];return s.some(a=>a.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",r):s})}fetchMembers(r){return this.portal.request(this.url+"/users",r)}getThumbnailUrl(r){let o=this.thumbnailUrl;return o&&r&&(o+=`&w=${r}`),o}toJSON(){throw new oe("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(r){if(!r)return null;if(r.declaredClass)throw new Error("JSON object is already hydrated");const o=new Px$2({sourceJSON:r});return o.read(r),o}queryItems(r,o){let s=Ai$1(ms$2,r);const a=this.portal;return parseFloat(a.currentVersion)>5?(s=s||new ms$2,a.queryPortal(`/content/groups/${this.id}/search`,s,"PortalItem",o)):(s=s?s.clone():new ms$2,s.query="group:"+this.id+(s.query?" "+s.query:""),a.queryItems(s,o))}_fetchCategorySchemaSet(r,o){const s=this.portal;return s.fetchSelf(s.authMode,!0,o).then(a=>{const l=a.contentCategorySetsGroupQuery;if(l){const c=new ms$2({disableExtraQuery:!0,num:1,query:l});return s.queryGroups(c,o)}throw new oe("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(a=>{if(a.total){const l=a.results[0],c=new ms$2({num:1,query:`typekeywords:"${r}"`});return l.queryItems(c,o)}throw new oe("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(a=>a.total?a.results[0].fetchData("json",o).then(l=>{const c=l?.categorySchema;return c?.length?c:[]}):[])}};v([S()],Ln$2.prototype,"access",void 0),v([S({type:Date})],Ln$2.prototype,"created",void 0),v([S()],Ln$2.prototype,"description",void 0),v([S()],Ln$2.prototype,"id",void 0),v([S()],Ln$2.prototype,"isInvitationOnly",void 0),v([S({type:Date})],Ln$2.prototype,"modified",void 0),v([S()],Ln$2.prototype,"owner",void 0),v([S()],Ln$2.prototype,"portal",void 0),v([S()],Ln$2.prototype,"snippet",void 0),v([S()],Ln$2.prototype,"sortField",void 0),v([S()],Ln$2.prototype,"sortOrder",void 0),v([S()],Ln$2.prototype,"sourceJSON",void 0),v([S()],Ln$2.prototype,"tags",void 0),v([S()],Ln$2.prototype,"thumbnail",void 0),v([S({readOnly:!0})],Ln$2.prototype,"thumbnailUrl",null),v([S()],Ln$2.prototype,"title",void 0),v([S({readOnly:!0})],Ln$2.prototype,"url",null),Ln$2=Px$2=v([it$1("esri.portal.PortalGroup")],Ln$2);const Dx$2=Ln$2;let Rc$2=class extends jn$2{constructor(o){super(o),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};v([S()],Rc$2.prototype,"nextQueryParams",void 0),v([S()],Rc$2.prototype,"queryParams",void 0),v([S()],Rc$2.prototype,"results",void 0),v([S()],Rc$2.prototype,"total",void 0),Rc$2=v([it$1("esri.portal.PortalQueryResult")],Rc$2);const $q$1=Rc$2;let Bo$2=class extends ee$1{constructor(o){super(o),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const o=this.portal?.restUrl;return o?`${o}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new oe("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};v([S({type:Date})],Bo$2.prototype,"created",void 0),v([S()],Bo$2.prototype,"id",void 0),v([S()],Bo$2.prototype,"portal",void 0),v([S()],Bo$2.prototype,"title",void 0),v([S({readOnly:!0})],Bo$2.prototype,"url",null),v([S()],Bo$2.prototype,"username",void 0),Bo$2=v([it$1("esri.portal.PortalFolder")],Bo$2);const Bq$1=Bo$2;var Gx$2;let je$2=Gx$2=class extends ee$1{constructor(r){super(r),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userLicenseTypeId=null,this.userType=null}get thumbnailUrl(){const r=this.url,o=this.thumbnail;return r&&o?this.portal.normalizeUrl(`${r}/info/${o}?f=json`):null}get userContentUrl(){const r=this.portal?.restUrl;return r?`${r}/content/users/${this.username}`:null}get url(){const r=this.portal?.restUrl;return r?`${r}/community/users/${this.username}`:null}addItem(r){const o=r&&r.item,s=r?.data,a=r?.folder,l={method:"post"};o&&(l.query=o.createPostQuery(),s!=null&&(typeof s=="string"?l.query.text=s:typeof s=="object"&&(l.query.text=JSON.stringify(s))));let c=this.userContentUrl;return a&&(c+="/"+(typeof a=="string"?a:a.id)),this.portal.request(c+"/addItem",l).then(u=>(o.id=u.id,o.portal=this.portal,o.loaded?o.reload():o.load()))}async deleteItem(r,o=!1){let s=this.userContentUrl;r.ownerFolder&&(s+="/"+r.ownerFolder);const a=o?{permanentDelete:!0}:{};await this.portal.request(s+`/items/${r.id}/delete`,{method:"post",query:a}),r.id=null,r.portal=null}async deleteItems(r,o=!1){r=r.slice();const s=this.userContentUrl+"/deleteItems",a=[],l=r.map(c=>c.id);if(l.length){const c={method:"post",query:{items:l.join(","),permanentDelete:o}},u=await this.portal.request(s,c);for(const d of u.results){const m=r.find(_=>d.itemId===_.id),g=d.success;let y=null;g?(m.id=null,m.portal=null):d.error&&(y=new oe("portal:delete-item-failed",d.error.message,d.error)),a.push({item:m,success:g,error:y})}}return a}fetchFolders(){const r={query:{num:1}};return this.portal.request(this.userContentUrl??"",r).then(o=>{let s;return s=o&&o.folders?o.folders.map(a=>{const l=Bq$1.fromJSON(a);return l.portal=this.portal,l}):[],s})}fetchGroups(){return this.portal.request(this.url??"").then(r=>{let o;return o=r&&r.groups?r.groups.map(s=>{const a=Dx$2.fromJSON(s);return a.portal=this.portal,a}):[],o})}async fetchItems(r){r??={};let o=this.userContentUrl??"";r.folder&&(o+="/"+r.folder.id);const{default:s}=await __vitePreload(()=>import("./PortalItem-CctGdnxF-DNdsi_Qx.js"),[],import.meta.url),a={folders:!1,inRecycleBin:!!r.inRecycleBin||null,foldersContent:!(r.folder||!r.includeSubfolderItems)||null,num:r.num||10,start:r.start||1,sortField:r.sortField||"created",sortOrder:r.sortOrder||"asc"},l=await this.portal.request(o,{query:a});let c;return l?.items?(c=l.items.map(u=>{const d=s.fromJSON(u);return d.portal=this.portal,d}),await Promise.all(c.map(u=>u.load())),{items:c,nextStart:l.nextStart,total:l.total}):{items:[],nextStart:-1,total:0}}fetchTags(){return this.portal.request(this.url+"/tags").then(r=>r.tags)}getThumbnailUrl(r){let o=this.thumbnailUrl;return o&&r&&(o+=`&w=${r}`),o}queryFavorites(r){return this.favGroupId?(this._favGroup||(this._favGroup=new Dx$2({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(r)):Promise.reject(new oe("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}async restoreItem(r,o){const s=this.userContentUrl,a=o?{folderID:typeof o=="string"?o:o.id}:null;await this.portal.request(s+`/items/${r.id}/restore`,{method:"post",query:a})}toJSON(){throw new oe("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(r){if(!r)return null;if(r.declaredClass)throw new Error("JSON object is already hydrated");const o=new Gx$2({sourceJSON:r});return o.read(r),o}};v([S()],je$2.prototype,"access",void 0),v([S({type:Date})],je$2.prototype,"created",void 0),v([S()],je$2.prototype,"culture",void 0),v([S()],je$2.prototype,"description",void 0),v([S()],je$2.prototype,"email",void 0),v([S()],je$2.prototype,"favGroupId",void 0),v([S()],je$2.prototype,"fullName",void 0),v([S({type:Date})],je$2.prototype,"modified",void 0),v([S()],je$2.prototype,"orgId",void 0),v([S()],je$2.prototype,"portal",void 0),v([S()],je$2.prototype,"preferredView",void 0),v([S()],je$2.prototype,"privileges",void 0),v([S()],je$2.prototype,"region",void 0),v([S()],je$2.prototype,"role",void 0),v([S()],je$2.prototype,"roleId",void 0),v([S()],je$2.prototype,"sourceJSON",void 0),v([S()],je$2.prototype,"thumbnail",void 0),v([S({readOnly:!0})],je$2.prototype,"thumbnailUrl",null),v([S()],je$2.prototype,"units",void 0),v([S({readOnly:!0})],je$2.prototype,"userContentUrl",null),v([S({readOnly:!0})],je$2.prototype,"url",null),v([S()],je$2.prototype,"username",void 0),v([S()],je$2.prototype,"userLicenseTypeId",void 0),v([S()],je$2.prototype,"userType",void 0),je$2=Gx$2=v([it$1("esri.portal.PortalUser")],je$2);const Fx$2=je$2;var di$2;let wf$2;const K5$1={PortalGroup:()=>Promise.resolve({default:Dx$2}),PortalItem:()=>__vitePreload(()=>import("./PortalItem-CctGdnxF-DNdsi_Qx.js"),[],import.meta.url),PortalUser:()=>Promise.resolve({default:Fx$2})};let dt$1=di$2=class extends Y2$1(Q5$1){constructor(r){super(r),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.default3DBasemapQuery=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.hasClassificationSchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.recycleBinEnabled=!1,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=Ce$1.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useDefault3dBasemap=!1,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(r){return typeof r=="string"?{url:r}:r}destroy(){tR$2.unregister(this),this.defaultBasemap=vd$2(this.defaultBasemap),this.defaultDevBasemap=vd$2(this.defaultDevBasemap),this.defaultVectorBasemap=vd$2(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=tc$2(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(r){if(r)for(const o of r)Ce$1.request.trustedServers.includes(o)||Ce$1.request.trustedServers.push(o);return r}readDefaultBasemap(r){return this._readBasemap(r)}readDefaultDevBasemap(r){return this._readBasemap(r)}readDefaultVectorBasemap(r){return this._readBasemap(r)}get extraQuery(){const r=this.user?.orgId,o=!r||this.canSearchPublic;return this.id&&!o?` AND orgid:${this.id}`:null}get hasAPIKey(){return aM$2(this.url)}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let r=this.url;if(r){const o=r.indexOf("/sharing");r=o>0?r.slice(0,o):this.url.replace(/\/+$/,""),r+="/sharing/rest"}return r}get thumbnailUrl(){const r=this.restUrl,o=this.thumbnail;return r&&o?this._normalizeSSL(r+"/portals/self/resources/"+o):null}readUrlKey(r){return r&&r.toLowerCase()}readUser(r){let o=null;return r&&(o=Fx$2.fromJSON(r),o.portal=this),o}load(r){const o=__vitePreload(()=>import("./Basemap-BEqqSTw9-BkQ-c4vY.js"),__vite__mapDeps([22,23,24,25]),import.meta.url).then(s=>s.B).then(({default:s})=>{Bu$2(r),wf$2=s}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,r)).then(s=>{if(!this.hasAPIKey&&Ve$2){const a=Ve$2;this.credential=a.findCredential(this.restUrl),this.credential||this.authMode!==di$2.AUTH_MODE_AUTO&&this.authMode!==di$2.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=a.on("credential-create",Vq$1(new WeakRef(this))),tR$2.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=s,this.read(s)});return this.addResolvingPromise(o),Promise.resolve(this)}async createElevationLayers(){await this.load();const r=this._getHelperService("defaultElevationLayers"),o=(await __vitePreload(async()=>{const{default:s}=await import("./ElevationLayer-G6y-P-jo-CgtzrvPg.js");return{default:s}},__vite__mapDeps([26,27,28,29,17,30,31,32,33,34,35,36,37,38,39,40,41,42,43,24,44,45,46,47]),import.meta.url)).default;return r?r.map(s=>new o({id:s.id,url:s.url})):[]}async fetchBasemaps(r,o){const s=await this._fetchBasemaps(r,o);if(o?.include3d===!0&&this.use3dBasemaps!==!1){const a=await this._fetchBasemaps3D(r,o);s.unshift(...a)}return s}async fetchDefault3DBasemap(r){if(!this.useDefault3dBasemap||!this.default3DBasemapQuery||this.default3DBasemapQuery==="none")return null;const o=new ms$2;o.query=this.default3DBasemapQuery,o.disableExtraQuery=!0;const s=(await this.queryItems(o,r)).results.find(a=>a.type==="Web Scene");return s?new wf$2({portalItem:s}):null}fetchCategorySchema(r){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",r).then(o=>o.categorySchema):xa$2(r)?Promise.reject(Vr$2()):Promise.resolve([])}fetchFeaturedGroups(r){const o=this.featuredGroups,s=new ms$2({num:100,sortField:"title"});if(o?.length){const a=[];for(const l of o)a.push(`(title:"${l.title}" AND owner:${l.owner})`);return s.query=a.join(" OR "),this.queryGroups(s,r).then(l=>l.results)}return xa$2(r)?Promise.reject(Vr$2()):Promise.resolve([])}fetchRegions(r){const o=this.user?.culture||this.culture||os$2();return this.request(this.restUrl+"/portals/regions",{...r,query:{culture:o}})}fetchSettings(r){const o=this.user?.culture||this.culture||os$2();return this.request(this.restUrl+"/portals/self/settings",{...r,query:{culture:o}})}static getDefault(){return jq$1(()=>new di$2)}queryGroups(r,o){return this.queryPortal("/community/groups",r,"PortalGroup",o)}queryItems(r,o){return this.queryPortal("/search",r,"PortalItem",o)}queryUsers(r,o){return r.sortField||(r.sortField="username"),this.queryPortal("/community/users",r,"PortalUser",o)}fetchSelf(r=this.authMode,o=!1,s){const a=this.restUrl+"/portals/self",l={authMode:r,query:{culture:os$2().toLowerCase()},withCredentials:!0,...s};return l.authMode==="auto"&&(l.authMode="no-prompt"),o&&(l.query.default=!0),this.request(a,l)}queryPortal(r,o,s,a){const l=Ai$1(ms$2,o),c=u=>this.request(this.restUrl+r,{...l.toRequestOptions(this),...a}).then(d=>{const m=l.clone();return m.start=d.nextStart,new $q$1({nextQueryParams:m,queryParams:l,total:d.total,results:di$2._resultsToTypedArray(u,{portal:this},d,a)})}).then(d=>Promise.all(d.results.map(m=>typeof m.when=="function"?m.when():d)).then(()=>d,m=>(D2$1(m),d)));return s&&K5$1[s]?K5$1[s]().then(({default:u})=>(Bu$2(a),c(u))):c()}signIn(){if(this.hasAPIKey)return this.load().then(()=>{if(!this.user)throw new oe("portal:not-authenticated","Unable to authenticate user. Portal.user is missing")});if(this.authMode===di$2.AUTH_MODE_ANONYMOUS||this.authMode===di$2.AUTH_MODE_NO_PROMPT&&!Ve$2)return Promise.reject(new oe("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const r=o=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(o||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=o,this.fetchSelf("immediate"))):this.user&&this.credential===o?null:(this.credential=o,this.fetchSelf("immediate"))).then(s=>{s&&(this.sourceJSON=s,this.read(s))});return Ve$2?Ve$2.getCredential(this.restUrl,{prompt:this.authMode!==di$2.AUTH_MODE_NO_PROMPT}).then(o=>r(o)):r(this.credential)}normalizeUrl(r){const o=this.credential?.token;return this._normalizeSSL(o?r+(r.includes("?")?"&":"?")+"token="+o:r)}requestToTypedArray(r,o,s){return this.request(r,o).then(a=>{const l=di$2._resultsToTypedArray(s,{portal:this},a);return Promise.all(l.map(c=>typeof c.when=="function"?c.when():a)).then(()=>l,()=>l)})}request(r,o={}){const s={f:"json",...o.query},{authMode:a=this.authMode===di$2.AUTH_MODE_ANONYMOUS||this.authMode===di$2.AUTH_MODE_NO_PROMPT?this.authMode:"auto",body:l=null,cacheBust:c=!1,method:u="auto",responseType:d="json",signal:m}=o,g={authMode:a,body:l,cacheBust:c,method:u,query:s,responseType:d,timeout:0,signal:m};return o.withCredentials&&(g.withCredentials=!0),fn$2(this._normalizeSSL(r),g).then(y=>y.data)}toJSON(){throw new oe("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(r){if(!r)return null;if(r.declaredClass)throw new Error("JSON object is already hydrated");return new di$2({sourceJSON:r})}_getHelperService(r){const o=this.helperServices&&this.helperServices[r];if(!o)throw new oe("portal:service-not-found",`The \`helperServices\` do not include an entry named "${r}"`);return o}async _fetchBasemaps(r,o){const s=new ms$2;s.query=r||(this.hasAPIKey?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),s.disableExtraQuery=!0;const a=await this.queryGroups(s,o);if(!a.total)return[];const l=a.results[0];s.num=100,s.query='type:"Web Map" -type:"Web Application"',s.sortField=l.sortField||"name",s.sortOrder=l.sortOrder||"desc";const c=await l.queryItems(s,o);return c.total?c.results.filter(u=>u.type==="Web Map").map(u=>new wf$2({portalItem:u})):[]}async _fetchBasemaps3D(r,o){const s=r||this.basemapGalleryGroupQuery3D;if(!s)return[];const a=new ms$2({query:s,disableExtraQuery:!0}),l=await this.queryGroups(a,o);if(!l.total)return[];const c=l.results[0];a.num=100,a.query='type:"Web Scene"',a.sortField=c.sortField||"name",a.sortOrder=c.sortOrder||"desc";const u=await c.queryItems(a,o);return u.total?u.results.filter(d=>d.type==="Web Scene").map(d=>new wf$2({portalItem:d})):[]}_normalizeSSL(r){return r.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(r){if(r){const o=wf$2.fromJSON(r);return o.portalItem={portal:this},o}return null}static _resultsToTypedArray(r,o,s,a){let l;if(s){const c=a!=null?a.signal:null;l=s.listings||s.notifications||s.userInvitations||s.tags||s.items||s.groups||s.comments||s.provisions||s.results||s.relatedItems||s,(r||o)&&(l=l.map(u=>{const d=Object.assign(r?r.fromJSON(u):u,o);return typeof d.load=="function"&&d.load(c),d}))}else l=[];return l}};dt$1.AUTH_MODE_ANONYMOUS="anonymous",dt$1.AUTH_MODE_AUTO="auto",dt$1.AUTH_MODE_IMMEDIATE="immediate",dt$1.AUTH_MODE_NO_PROMPT="no-prompt",v([S()],dt$1.prototype,"access",void 0),v([S()],dt$1.prototype,"allSSL",void 0),v([S()],dt$1.prototype,"authMode",void 0),v([S()],dt$1.prototype,"authorizedCrossOriginDomains",void 0),v([Un$2("authorizedCrossOriginDomains")],dt$1.prototype,"readAuthorizedCrossOriginDomains",null),v([S()],dt$1.prototype,"basemapGalleryGroupQuery",void 0),v([S({json:{name:"3DBasemapGalleryGroupQuery"}})],dt$1.prototype,"basemapGalleryGroupQuery3D",void 0),v([S()],dt$1.prototype,"bingKey",void 0),v([S()],dt$1.prototype,"canListApps",void 0),v([S()],dt$1.prototype,"canListData",void 0),v([S()],dt$1.prototype,"canListPreProvisionedItems",void 0),v([S()],dt$1.prototype,"canProvisionDirectPurchase",void 0),v([S()],dt$1.prototype,"canSearchPublic",void 0),v([S()],dt$1.prototype,"canShareBingPublic",void 0),v([S()],dt$1.prototype,"canSharePublic",void 0),v([S()],dt$1.prototype,"canSignInArcGIS",void 0),v([S()],dt$1.prototype,"canSignInIDP",void 0),v([S()],dt$1.prototype,"colorSetsGroupQuery",void 0),v([S()],dt$1.prototype,"commentsEnabled",void 0),v([S({type:Date})],dt$1.prototype,"created",void 0),v([S()],dt$1.prototype,"credential",void 0),v([S()],dt$1.prototype,"culture",void 0),v([S()],dt$1.prototype,"currentVersion",void 0),v([S()],dt$1.prototype,"customBaseUrl",void 0),v([S()],dt$1.prototype,"default3DBasemapQuery",void 0),v([S()],dt$1.prototype,"defaultBasemap",void 0),v([Un$2("defaultBasemap")],dt$1.prototype,"readDefaultBasemap",null),v([S()],dt$1.prototype,"defaultDevBasemap",void 0),v([Un$2("defaultDevBasemap")],dt$1.prototype,"readDefaultDevBasemap",null),v([S({type:hi$2})],dt$1.prototype,"defaultExtent",void 0),v([S()],dt$1.prototype,"defaultVectorBasemap",void 0),v([Un$2("defaultVectorBasemap")],dt$1.prototype,"readDefaultVectorBasemap",null),v([S()],dt$1.prototype,"description",void 0),v([S()],dt$1.prototype,"devBasemapGalleryGroupQuery",void 0),v([S()],dt$1.prototype,"eueiEnabled",void 0),v([S({readOnly:!0})],dt$1.prototype,"extraQuery",null),v([S()],dt$1.prototype,"featuredGroups",void 0),v([S()],dt$1.prototype,"featuredItemsGroupQuery",void 0),v([S()],dt$1.prototype,"galleryTemplatesGroupQuery",void 0),v([S()],dt$1.prototype,"layoutGroupQuery",void 0),v([S()],dt$1.prototype,"livingAtlasGroupQuery",void 0),v([S({readOnly:!0})],dt$1.prototype,"hasAPIKey",null),v([S()],dt$1.prototype,"hasCategorySchema",void 0),v([S()],dt$1.prototype,"hasClassificationSchema",void 0),v([S()],dt$1.prototype,"helpBase",void 0),v([S()],dt$1.prototype,"helperServices",void 0),v([S()],dt$1.prototype,"helpMap",void 0),v([S()],dt$1.prototype,"homePageFeaturedContent",void 0),v([S()],dt$1.prototype,"homePageFeaturedContentCount",void 0),v([S()],dt$1.prototype,"httpPort",void 0),v([S()],dt$1.prototype,"httpsPort",void 0),v([S()],dt$1.prototype,"id",void 0),v([S()],dt$1.prototype,"ipCntryCode",void 0),v([S({readOnly:!0})],dt$1.prototype,"isOrganization",null),v([S()],dt$1.prototype,"isPortal",void 0),v([S()],dt$1.prototype,"isReadOnly",void 0),v([S({readOnly:!0})],dt$1.prototype,"itemPageUrl",null),v([S()],dt$1.prototype,"layerTemplatesGroupQuery",void 0),v([S()],dt$1.prototype,"maxTokenExpirationMinutes",void 0),v([S({type:Date})],dt$1.prototype,"modified",void 0),v([S()],dt$1.prototype,"name",void 0),v([S()],dt$1.prototype,"portalHostname",void 0),v([S()],dt$1.prototype,"portalMode",void 0),v([S()],dt$1.prototype,"portalProperties",void 0),v([S()],dt$1.prototype,"region",void 0),v([S()],dt$1.prototype,"recycleBinEnabled",void 0),v([S({readOnly:!0})],dt$1.prototype,"restUrl",null),v([S()],dt$1.prototype,"rotatorPanels",void 0),v([S()],dt$1.prototype,"showHomePageDescription",void 0),v([S()],dt$1.prototype,"sourceJSON",void 0),v([S()],dt$1.prototype,"staticImagesUrl",void 0),v([S({json:{name:"2DStylesGroupQuery"}})],dt$1.prototype,"stylesGroupQuery2d",void 0),v([S({json:{name:"stylesGroupQuery"}})],dt$1.prototype,"stylesGroupQuery3d",void 0),v([S()],dt$1.prototype,"supportsHostedServices",void 0),v([S()],dt$1.prototype,"symbolSetsGroupQuery",void 0),v([S()],dt$1.prototype,"templatesGroupQuery",void 0),v([S()],dt$1.prototype,"thumbnail",void 0),v([S({readOnly:!0})],dt$1.prototype,"thumbnailUrl",null),v([S()],dt$1.prototype,"units",void 0),v([S()],dt$1.prototype,"url",void 0),v([S()],dt$1.prototype,"urlKey",void 0),v([Un$2("urlKey")],dt$1.prototype,"readUrlKey",null),v([S()],dt$1.prototype,"user",void 0),v([Un$2("user")],dt$1.prototype,"readUser",null),v([S()],dt$1.prototype,"use3dBasemaps",void 0),v([S()],dt$1.prototype,"useDefault3dBasemap",void 0),v([S()],dt$1.prototype,"useStandardizedQuery",void 0),v([S()],dt$1.prototype,"useVectorBasemaps",void 0),v([S()],dt$1.prototype,"vectorBasemapGalleryGroupQuery",void 0),dt$1=di$2=v([it$1("esri.portal.Portal")],dt$1);const xf$2=dt$1,tR$2=new FinalizationRegistry(r=>{r.remove()});function Vq$1(r){const o=Ve$2;return()=>{const s=r.deref();s&&o.findCredential(s.restUrl)&&s.signIn().catch(()=>{})}}let kc$2=class extends Hs$2(ee$1){constructor(o){super(o),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(o){return o!=null&&o.placement===this.placement&&o.style===this.style&&(this.color==null&&o.color==null||this.color!=null&&o.color!=null&&this.color.toJSON()===o.color.toJSON())}};v([S({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],kc$2.prototype,"type",void 0),v([S({type:HJ$1,json:{default:"begin-end",write:!0}})],kc$2.prototype,"placement",void 0),v([S({type:N5$1,json:{default:"arrow",write:!0}})],kc$2.prototype,"style",void 0),v([S({type:me$1,json:{type:[On$2],default:null,write:!0}})],kc$2.prototype,"color",void 0),kc$2=v([it$1("esri.symbols.LineStyleMarker3D")],kc$2);const jx$2=kc$2;var kg$2;let Qs$1=kg$2=class extends Js$2{constructor(r){super(r),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=ds$2(1),this.pattern=null,this.marker=null}clone(){const r={enabled:this.enabled,material:this.material!=null?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:this.pattern!=null?this.pattern.clone():null,marker:this.marker!=null?this.marker.clone():null};return new kg$2(r)}static fromSimpleLineSymbol(r){const o={enabled:!0,size:r.width??ds$2(1),cap:r.cap||"butt",join:r.join||"miter",pattern:r.style?new gx$2({style:r.style}):null,material:new zr$2({color:(r.color||mf$2).clone()}),marker:r.marker?new jx$2({placement:r.marker.placement,style:r.marker.style,color:r.marker.color?.clone()??null}):null};return new kg$2(o)}};v([S({type:zr$2,json:{write:!0}})],Qs$1.prototype,"material",void 0),v([ae$1({Line:"line"},{readOnly:!0})],Qs$1.prototype,"type",void 0),v([S({type:G5$1,json:{write:!0,default:"miter"}})],Qs$1.prototype,"join",void 0),v([S({type:Sx$2,json:{write:!0,default:"butt"}})],Qs$1.prototype,"cap",void 0),v([S(qs$2)],Qs$1.prototype,"size",void 0),v([S(L5$1)],Qs$1.prototype,"pattern",void 0),v([S({types:{key:"type",base:jx$2,typeMap:{style:jx$2}},json:{write:!0}})],Qs$1.prototype,"marker",void 0),Qs$1=kg$2=v([it$1("esri.symbols.LineSymbol3DLayer")],Qs$1);const jh$2=Qs$1;var Ux$2;const zq$1=Ii$2()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let Ef$2=Ux$2=class extends ee$1{clone(){return new Ux$2({href:this.href,primitive:this.primitive})}};v([S({type:String,json:{read:Ng$2,write:Ph$2}})],Ef$2.prototype,"href",void 0),v([ae$1(zq$1)],Ef$2.prototype,"primitive",void 0),Ef$2=Ux$2=v([it$1("esri.symbols.support.ObjectSymbol3DLayerResource")],Ef$2);var $x$2;let Lc$2=$x$2=class extends jn$2{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new $x$2({x:this.x,y:this.y,z:this.z})}};v([S({type:Number})],Lc$2.prototype,"x",void 0),v([S({type:Number})],Lc$2.prototype,"y",void 0),v([S({type:Number})],Lc$2.prototype,"z",void 0),Lc$2=$x$2=v([it$1("esri.symbols.support.Symbol3DAnchorPosition3D")],Lc$2);var Bx$2;let yr$2=Bx$2=class extends Js$2{constructor(r){super(r),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){return new Bx$2({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition?.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:this.material?.clone()??null,castShadows:this.castShadows,resource:this.resource?.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};v([S({type:zr$2,json:{write:!0}})],yr$2.prototype,"material",void 0),v([S({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],yr$2.prototype,"castShadows",void 0),v([S({type:Ef$2,json:{write:!0}})],yr$2.prototype,"resource",void 0),v([ae$1({Object:"object"},{readOnly:!0})],yr$2.prototype,"type",void 0),v([S({type:Number,json:{write:!0}})],yr$2.prototype,"width",void 0),v([S({type:Number,json:{write:!0}})],yr$2.prototype,"height",void 0),v([S({type:Number,json:{write:!0}})],yr$2.prototype,"depth",void 0),v([ae$1({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"},{default:"origin"})],yr$2.prototype,"anchor",void 0),v([S({type:Lc$2,json:{type:[Number],read:{reader:r=>new Lc$2({x:r[0],y:r[1],z:r[2]})},write:{writer:(r,o)=>{o.anchorPosition=[r.x,r.y,r.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],yr$2.prototype,"anchorPosition",void 0),v([S({type:Number,json:{write:!0}})],yr$2.prototype,"heading",void 0),v([S({type:Number,json:{write:!0}})],yr$2.prototype,"tilt",void 0),v([S({type:Number,json:{write:!0}})],yr$2.prototype,"roll",void 0),v([S({readOnly:!0})],yr$2.prototype,"isPrimitive",null),yr$2=Bx$2=v([it$1("esri.symbols.ObjectSymbol3DLayer")],yr$2);const Vx$2=yr$2;var zx$2;let Nr$2=zx$2=class extends Js$2{constructor(r){super(r),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(r,o){return r??(o.height==null&&o.size!=null?o.size:void 0)}readHeight(r,o){return r??(o.width==null&&o.size!=null?o.size:void 0)}clone(){return new zx$2({enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};v([S({type:zr$2,json:{write:!0}})],Nr$2.prototype,"material",void 0),v([S({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Nr$2.prototype,"castShadows",void 0),v([ae$1({Path:"path"},{readOnly:!0})],Nr$2.prototype,"type",void 0),v([S({type:["circle","quad"],json:{write:!0,default:"circle"}})],Nr$2.prototype,"profile",void 0),v([S({type:G5$1,json:{write:!0,default:"miter"}})],Nr$2.prototype,"join",void 0),v([S({type:xq$1,json:{write:!0,default:"butt"}})],Nr$2.prototype,"cap",void 0),v([S({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],Nr$2.prototype,"width",void 0),v([Un$2("width",["width","size","height"])],Nr$2.prototype,"readWidth",null),v([S({type:Number,json:{write:!0}})],Nr$2.prototype,"height",void 0),v([Un$2("height",["height","size","width"])],Nr$2.prototype,"readHeight",null),v([S({type:["center","bottom","top"],json:{write:!0,default:"center"}})],Nr$2.prototype,"anchor",void 0),v([S({type:["heading","all"],json:{write:!0,default:"all"}})],Nr$2.prototype,"profileRotation",void 0),Nr$2=zx$2=v([it$1("esri.symbols.PathSymbol3DLayer")],Nr$2);const Hx$2=Nr$2;var Wx$2;let Uh$1=Wx$2=class extends ee$1{constructor(){super(...arguments),this.color=new me$1([0,0,0,1]),this.size=0}clone(){const r={color:gt$3(this.color),size:this.size};return new Wx$2(r)}};v([S(Za$2)],Uh$1.prototype,"color",void 0),v([S(qs$2)],Uh$1.prototype,"size",void 0),Uh$1=Wx$2=v([it$1("esri.symbols.support.Symbol3DHalo")],Uh$1);let Tf$2=class extends Hs$2(ee$1){constructor(o){super(o),this.color=null}};v([S(Za$2)],Tf$2.prototype,"color",void 0),Tf$2=v([it$1("esri.symbols.support.Symbol3DTextBackground")],Tf$2);var Lg$2;let Hr$2=Lg$2=class extends Js$2{constructor(r){super(r),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(r){r!=null&&this._userSize!=null&&(r.size=this._userSize),this._set("font",r)}writeFont(r,o,s,a){const l={...a,textSymbol3D:!0};o.font=r.write({},l),delete o.font.size}get size(){return this._userSize!=null?this._userSize:this.font?.size!=null?this.font.size:9}set size(r){this._userSize=r,this.font!=null&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const r=new Lg$2({enabled:this.enabled,font:this.font&>$3(this.font),halo:this.halo&>$3(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:this.material!=null?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:gt$3(this.background)});return r._userSize=this._userSize,r}static fromTextSymbol(r){return new Lg$2({font:r.font!=null?r.font.clone():new gf$2,halo:Hq$1(r.haloColor,r.haloSize),horizontalAlignment:r.horizontalAlignment,lineHeight:r.lineHeight,material:r.color?new zr$2({color:r.color.clone()}):null,text:r.text,verticalAlignment:r.verticalAlignment,background:r.backgroundColor?new Tf$2({color:r.backgroundColor.clone()}):null})}};function Hq$1(r,o){return r&&o!=null&&o>0?new Uh$1({color:gt$3(r),size:o}):null}v([S({type:gf$2,json:{write:!0}})],Hr$2.prototype,"font",null),v([en$2("font")],Hr$2.prototype,"writeFont",null),v([S({type:Uh$1,json:{write:!0}})],Hr$2.prototype,"halo",void 0),v([S({...j5$1,json:{default:"center",write:!0}})],Hr$2.prototype,"horizontalAlignment",void 0),v([S({...F5$1,json:{default:1,write:!0}})],Hr$2.prototype,"lineHeight",void 0),v([S({type:zr$2,json:{write:!0}})],Hr$2.prototype,"material",void 0),v([S({type:Tf$2,json:{write:!0}})],Hr$2.prototype,"background",void 0),v([S(qs$2)],Hr$2.prototype,"size",null),v([S({type:String,json:{write:!0}})],Hr$2.prototype,"text",void 0),v([ae$1({Text:"text"},{readOnly:!0})],Hr$2.prototype,"type",void 0),v([S({...U5$1,json:{default:"baseline",write:!0}})],Hr$2.prototype,"verticalAlignment",void 0),Hr$2=Lg$2=v([it$1("esri.symbols.TextSymbol3DLayer")],Hr$2);const $h$2=Hr$2;var Xx$2;let tl$2=Xx$2=class extends Js$2{constructor(r){super(r),this.color=Yx$2.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new Xx$2({color:gt$3(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};v([S({type:me$1,nonNullable:!0,json:{type:[On$2],write:(r,o,s)=>o[s]=r.toArray(me$1.AlphaMode.UNLESS_OPAQUE),default:()=>Yx$2.clone(),defaultEquals:r=>r.toCss(!0)===Yx$2.toCss(!0)}})],tl$2.prototype,"color",void 0),v([ae$1({Water:"water"},{readOnly:!0})],tl$2.prototype,"type",void 0),v([S({type:["small","medium","large"],json:{write:!0,default:"medium"}})],tl$2.prototype,"waterbodySize",void 0),v([S({type:Number,json:{write:!0,default:null}})],tl$2.prototype,"waveDirection",void 0),v([S({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],tl$2.prototype,"waveStrength",void 0),tl$2=Xx$2=v([it$1("esri.symbols.WaterSymbol3DLayer")],tl$2);const eR$2=tl$2,Yx$2=new me$1([0,119,190]);var Jx$2;let Pc$2=Jx$2=class extends jn$2{constructor(r){super(r),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new Jx$2({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};v([S({type:String})],Pc$2.prototype,"name",void 0),v([S({type:String})],Pc$2.prototype,"styleUrl",void 0),v([S({type:String})],Pc$2.prototype,"styleName",void 0),v([S({type:xf$2})],Pc$2.prototype,"portal",void 0),Pc$2=Jx$2=v([it$1("esri.symbols.support.StyleOrigin")],Pc$2);const Pg$2=Pc$2;var qx$2;let Bh$2=qx$2=class extends jn$2{constructor(){super(...arguments),this.url=""}clone(){return new qx$2({url:this.url})}};v([S({type:String})],Bh$2.prototype,"url",void 0),Bh$2=qx$2=v([it$1("esri.symbols.support.Thumbnail")],Bh$2);const nR$2={icon:Cc$2,object:Vx$2,line:jh$2,path:Hx$2,fill:Nc$2,extrude:M5$1,text:$h$2,water:eR$2},Wq$1=Fe.ofType({base:Js$2,key:"type",typeMap:nR$2,errorContext:"symbol-layer"});let Ks$2=class extends rr$1{constructor(o){super(o),this.styleOrigin=null,this.thumbnail=null,this.type=null;const s=this.__accessor__&&this.__accessor__.metadata&&this.__accessor__.metadata.symbolLayers,a=s?.type,l=a||Fe;this._set("symbolLayers",new l)}get color(){return null}set color(o){this.constructed&&Le$1.getLogger(this).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(o){X5$1(o,this._get("symbolLayers"))}readStyleOrigin(o,s,a){if(o.styleUrl&&o.name){const l=Lh$2(o.styleUrl,a);return new Pg$2({styleUrl:l,name:o.name})}if(o.styleName&&o.name)return new Pg$2({portal:a?.portal||xf$2.getDefault(),styleName:o.styleName,name:o.name});a?.messages&&a.messages.push(new ju$2("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:a,definition:o}))}writeStyleOrigin(o,s,a,l){if(o.styleUrl&&o.name){let c=vf$2(o.styleUrl,l);Oi$2(c)&&(c=ko$2(c)),s.styleOrigin={styleUrl:c,name:o.name}}else o.styleName&&o.name&&(o.portal&&l?.portal&&!QI$2(o.portal.restUrl,l.portal.restUrl)?l?.messages&&l.messages.push(new ju$2("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):s.styleOrigin={styleName:o.styleName,name:o.name})}normalizeCtorArgs(o){return o instanceof Js$2||o&&nR$2[o.type]?{symbolLayers:[o]}:Array.isArray(o)?{symbolLayers:o}:o}};v([S({json:{read:!1,write:!1}})],Ks$2.prototype,"color",null),v([S({type:Wq$1,nonNullable:!0,json:{write:!0}}),Ku$2(Y5$1)],Ks$2.prototype,"symbolLayers",null),v([S({type:Pg$2})],Ks$2.prototype,"styleOrigin",void 0),v([Un$2("styleOrigin")],Ks$2.prototype,"readStyleOrigin",null),v([en$2("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],Ks$2.prototype,"writeStyleOrigin",null),v([S({type:Bh$2,json:{read:!1}})],Ks$2.prototype,"thumbnail",void 0),v([S({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],Ks$2.prototype,"type",void 0),Ks$2=v([it$1("esri.symbols.Symbol3D")],Ks$2);const Dc$2=Ks$2;let Sf$2=class extends ee$1{constructor(o){super(o),this.visible=!0}clone(){throw new Error("Subclasses of Callout3D should implement their own clone method.")}};v([S({type:["line"],constructOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],Sf$2.prototype,"type",void 0),v([S({readOnly:!0})],Sf$2.prototype,"visible",void 0),Sf$2=v([it$1("esri.symbols.callouts.Callout3D")],Sf$2);const rR$2=Sf$2;var Zx$2;let Dg$2=Zx$2=class extends ee$1{constructor(r){super(r),this.color=new me$1("white")}clone(){return new Zx$2({color:gt$3(this.color)})}};v([S(Za$2)],Dg$2.prototype,"color",void 0),Dg$2=Zx$2=v([it$1("esri.symbols.callouts.LineCallout3DBorder")],Dg$2);const Xq$1=Dg$2;var Qx$2;let el$3=Qx$2=class extends rR$2{constructor(r){super(r),this.type="line",this.color=new me$1([0,0,0,1]),this.size=ds$2(1),this.border=null}get visible(){return this.size>0&&this.color!=null&&this.color.a>0}clone(){return new Qx$2({color:gt$3(this.color),size:this.size,border:gt$3(this.border)})}};v([ae$1({line:"line"})],el$3.prototype,"type",void 0),v([S(Za$2)],el$3.prototype,"color",void 0),v([S(qs$2)],el$3.prototype,"size",void 0),v([S({type:Xq$1,json:{write:!0}})],el$3.prototype,"border",void 0),v([S({readOnly:!0})],el$3.prototype,"visible",null),el$3=Qx$2=v([it$1("esri.symbols.callouts.LineCallout3D")],el$3);const iR$2=el$3;function Kx$2(r){if(!r)return!1;const o=r.verticalOffset;return!!o&&!(o.screenLength<=0||o.maxWorldLength!=null&&o.maxWorldLength<=0)}function sR$2(r){if(!r||!r.supportsCallout||!r.supportsCallout())return!1;const o=r.callout;return!!o&&!!o.visible&&!!Kx$2(r)}const oR$2={types:{key:"type",base:rR$2,typeMap:{line:iR$2}},json:{write:!0}};var tE$2;let Vh$2=tE$2=class extends ee$1{constructor(r){super(r),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new tE$2({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};v([S(qs$2)],Vh$2.prototype,"screenLength",void 0),v([S({type:Number,nonNullable:!0,json:{write:!0,default:0}})],Vh$2.prototype,"minWorldLength",void 0),v([S({type:Number,json:{write:!0}})],Vh$2.prototype,"maxWorldLength",void 0),Vh$2=tE$2=v([it$1("esri.symbols.support.Symbol3DVerticalOffset")],Vh$2);const eE$1=Vh$2;var Gg$3;const aR$2=Fe.ofType({base:null,key:"type",typeMap:{text:$h$2}});let nl$2=Gg$3=class extends Dc$2{constructor(r){super(r),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new aR$2,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return sR$2(this)}hasVisibleVerticalOffset(){return Kx$2(this)}clone(){return new Gg$3({styleOrigin:gt$3(this.styleOrigin),symbolLayers:gt$3(this.symbolLayers),thumbnail:gt$3(this.thumbnail),callout:gt$3(this.callout),verticalOffset:gt$3(this.verticalOffset)})}static fromTextSymbol(r){return new Gg$3({symbolLayers:new Fe([$h$2.fromTextSymbol(r)])})}};v([S({type:eE$1,json:{write:!0}})],nl$2.prototype,"verticalOffset",void 0),v([S(oR$2)],nl$2.prototype,"callout",void 0),v([S({json:{read:!1,write:!1}})],nl$2.prototype,"styleOrigin",void 0),v([S({type:aR$2})],nl$2.prototype,"symbolLayers",void 0),v([ae$1({LabelSymbol3D:"label-3d"},{readOnly:!0})],nl$2.prototype,"type",void 0),nl$2=Gg$3=v([it$1("esri.symbols.LabelSymbol3D")],nl$2);const Fg$2=nl$2;var jg$2;const lR$2=Fe.ofType({base:null,key:"type",typeMap:{line:jh$2,path:Hx$2}}),Yq$1=Fe.ofType({base:null,key:"type",typeMap:{line:jh$2,path:Hx$2}});let Af$2=jg$2=class extends Dc$2{constructor(r){super(r),this.symbolLayers=new lR$2,this.type="line-3d"}clone(){return new jg$2({styleOrigin:gt$3(this.styleOrigin),symbolLayers:gt$3(this.symbolLayers),thumbnail:gt$3(this.thumbnail)})}static fromSimpleLineSymbol(r){return new jg$2({symbolLayers:new Fe([jh$2.fromSimpleLineSymbol(r)])})}};v([S({type:lR$2,json:{type:Yq$1}})],Af$2.prototype,"symbolLayers",void 0),v([ae$1({LineSymbol3D:"line-3d"},{readOnly:!0})],Af$2.prototype,"type",void 0),Af$2=jg$2=v([it$1("esri.symbols.LineSymbol3D")],Af$2);const Gc$2=Af$2;let rl$2=class extends rr$1{constructor(o){super(o),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};v([S({type:Number,json:{read:r=>r&&-1*r,write:(r,o)=>o.angle=r&&-1*r}})],rl$2.prototype,"angle",void 0),v([S({type:["simple-marker","picture-marker"],readOnly:!0})],rl$2.prototype,"type",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],rl$2.prototype,"xoffset",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],rl$2.prototype,"yoffset",void 0),v([S({cast:r=>r==="auto"?r:ud$2(Je$1(r)),json:{write:!0}})],rl$2.prototype,"size",void 0),rl$2=v([it$1("esri.symbols.MarkerSymbol")],rl$2);const cR$2=rl$2;var Ug$2;const uR$2=Fe.ofType({base:null,key:"type",typeMap:{fill:Nc$2}});let If$2=Ug$2=class extends Dc$2{constructor(r){super(r),this.symbolLayers=new uR$2,this.type="mesh-3d"}clone(){return new Ug$2({styleOrigin:gt$3(this.styleOrigin),symbolLayers:gt$3(this.symbolLayers),thumbnail:gt$3(this.thumbnail)})}static fromSimpleFillSymbol(r){return new Ug$2({symbolLayers:new Fe([Nc$2.fromSimpleFillSymbol(r)])})}};v([S({type:uR$2})],If$2.prototype,"symbolLayers",void 0),v([ae$1({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],If$2.prototype,"type",void 0),If$2=Ug$2=v([it$1("esri.symbols.MeshSymbol3D")],If$2);const Mf$2=If$2;function Jq$1(r,o,s){return o.imageData?tM$2({mediaType:o.contentType||"image/png",isBase64:!0,data:o.imageData}):hR$2(o.url,s)}function hR$2(r,o){if(!Oi$2(r)){const s=Zq$1(o);if(s)return py$2(s,"images",r)}return Lh$2(r,o)}function qq$1(r,o,s,a){if(oc$2(r)){const l=Ju$2(r);if(!l)return;o.contentType=l.mediaType,o.imageData=l.data,s&&s.imageData===o.imageData&&s.url&&Ph$2(s.url,o,"url",a)}else Ph$2(r,o,"url",a)}const pR$2={json:{read:{source:["imageData","url"],reader:Jq$1},write:{writer(r,o,s,a){qq$1(r,o,this.source,a)}}}},dR$2={readOnly:!0,json:{read:{source:["imageData","url"],reader(r,o,s){const a={};return o.imageData&&(a.imageData=o.imageData),o.contentType&&(a.contentType=o.contentType),o.url&&(a.url=hR$2(o.url,s)),a}}}};function Zq$1(r){if(!r)return null;const{origin:o,layer:s}=r;if(o!=="service"&&o!=="portal-item")return null;const a=s?.type;return a==="feature"||a==="stream"?s.parsedUrl?.path:a==="map-image"||a==="tile"?r.url?.path:null}var nE$1;let Ui=nE$1=class extends O5$1{constructor(...r){super(...r),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(r,o,s,a){if(r&&typeof r!="string"&&r.imageData==null)return r;const l={};return r&&(l.url=r),o&&(l.outline=o),s!=null&&(l.width=Je$1(s)),a!=null&&(l.height=Je$1(a)),l}clone(){const r=new nE$1({color:gt$3(this.color),height:this.height,outline:gt$3(this.outline),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return r._set("source",gt$3(this.source)),r}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};v([ae$1({esriPFS:"picture-fill"},{readOnly:!0})],Ui.prototype,"type",void 0),v([S(pR$2)],Ui.prototype,"url",void 0),v([S({type:Number,json:{write:!0}})],Ui.prototype,"xscale",void 0),v([S({type:Number,json:{write:!0}})],Ui.prototype,"yscale",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],Ui.prototype,"width",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],Ui.prototype,"height",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],Ui.prototype,"xoffset",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],Ui.prototype,"yoffset",void 0),v([S(dR$2)],Ui.prototype,"source",void 0),Ui=nE$1=v([it$1("esri.symbols.PictureFillSymbol")],Ui);const rE$1=Ui;var iE$1;let ys$2=iE$1=class extends cR$2{constructor(...r){super(...r),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(r,o,s){if(r&&typeof r!="string"&&r.imageData==null)return r;const a={};return r&&(a.url=r),o!=null&&(a.width=Je$1(o)),s!=null&&(a.height=Je$1(s)),a}readHeight(r,o){return o.size||r}readWidth(r,o){return o.size||r}clone(){const r=new iE$1({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return r._set("source",gt$3(this.source)),r}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};v([S({json:{write:!1}})],ys$2.prototype,"color",void 0),v([ae$1({esriPMS:"picture-marker"},{readOnly:!0})],ys$2.prototype,"type",void 0),v([S(pR$2)],ys$2.prototype,"url",void 0),v([S(dR$2)],ys$2.prototype,"source",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],ys$2.prototype,"height",void 0),v([Un$2("height",["height","size"])],ys$2.prototype,"readHeight",null),v([S({type:Number,cast:Je$1,json:{write:!0}})],ys$2.prototype,"width",void 0),v([S({json:{write:!1}})],ys$2.prototype,"size",void 0),ys$2=iE$1=v([it$1("esri.symbols.PictureMarkerSymbol")],ys$2);const Fc$2=ys$2;var jc$2;const fR$2=Fe.ofType({base:null,key:"type",typeMap:{icon:Cc$2,object:Vx$2,text:$h$2}});let Uc$2=jc$2=class extends Dc$2{constructor(r){super(r),this.verticalOffset=null,this.callout=null,this.symbolLayers=new fR$2,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const r of this.symbolLayers.items)switch(r.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return sR$2(this)}hasVisibleVerticalOffset(){return Kx$2(this)}clone(){return new jc$2({verticalOffset:gt$3(this.verticalOffset),callout:gt$3(this.callout),styleOrigin:gt$3(this.styleOrigin),symbolLayers:gt$3(this.symbolLayers),thumbnail:gt$3(this.thumbnail)})}static fromSimpleMarkerSymbol(r){return new jc$2({symbolLayers:new Fe([Cc$2.fromSimpleMarkerSymbol(r)])})}static fromPictureMarkerSymbol(r){return new jc$2({symbolLayers:new Fe([Cc$2.fromPictureMarkerSymbol(r)])})}static fromCIMSymbol(r){if(r.data?.symbol?.type!=="CIMPointSymbol")return null;const o=r.data.symbol;return new jc$2(o?.callout?{symbolLayers:new Fe([Cc$2.fromCIMSymbol(r)]),callout:new iR$2({size:.5,color:new me$1([0,0,0])}),verticalOffset:new eE$1({screenLength:40})}:{symbolLayers:new Fe([Cc$2.fromCIMSymbol(r)])})}static fromTextSymbol(r){return new jc$2({symbolLayers:new Fe([$h$2.fromTextSymbol(r)])})}};v([S({type:eE$1,json:{write:!0}})],Uc$2.prototype,"verticalOffset",void 0),v([S(oR$2)],Uc$2.prototype,"callout",void 0),v([S({type:fR$2,json:{origins:{"web-scene":{write:!0}}}})],Uc$2.prototype,"symbolLayers",void 0),v([ae$1({PointSymbol3D:"point-3d"},{readOnly:!0})],Uc$2.prototype,"type",void 0),Uc$2=jc$2=v([it$1("esri.symbols.PointSymbol3D")],Uc$2);const Vo$1=Uc$2;function Qq$1(r,o,s){return ty$2(r.map((a,l)=>o.apply(s,[a,l])))}async function Kq$1(r,o,s){return(await ty$2(r.map((a,l)=>o.apply(s,[a,l])))).map(a=>a.value)}function sE$1(r){return{ok:!0,value:r}}function oE$1(r){return{ok:!1,error:r}}function tZ$1(r){return r!=null&&r.ok===!0?r.value:null}function eZ$1(r){return r!=null&&r.ok===!1?r.error:null}async function nZ$1(r){if(r==null)return{ok:!1,error:new Error("no promise provided")};try{return sE$1(await r)}catch(o){return oE$1(o)}}async function rZ$1(r){try{return sE$1(await r)}catch(o){return D2$1(o),oE$1(o)}}function iZ$1(r,o){return new il$2(r,o)}let il$2=class extends jn$2{get value(){return tZ$1(this._result)}get error(){return eZ$1(this._result)}get finished(){return this._result!=null}constructor(o,s){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=A2$1(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:a}=this._abortController;this.promise=o(a),this.promise.then(l=>{this._result=sE$1(l),this._cleanup()},l=>{this._result=oE$1(l),this._cleanup()}),this._abortHandle=Ea$1(s,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=tc$2(this._abortHandle),this._abortController=null}};v([S()],il$2.prototype,"value",null),v([S()],il$2.prototype,"error",null),v([S()],il$2.prototype,"finished",null),v([S()],il$2.prototype,"promise",void 0),v([S()],il$2.prototype,"_result",void 0),il$2=v([it$1("esri.core.asyncUtils.ReactiveTask")],il$2);function mR$2(r,o,s={}){return lE$2(r,o,s,gR$2)}function aE$1(r,o,s={}){return lE$2(r,o,s,vR$2)}function lE$2(r,o,s={},a){let l=null;const c=s.once?(u,d)=>{a(u)&&(tc$2(l),o(u,d))}:(u,d)=>{a(u)&&o(u,d)};if(l=H$$2(r,c,s.sync,s.equals),s.initial){const u=r();c(u,u)}return l}function yR$2(r,o,s,a={}){let l=null,c=null,u=null;function d(){l&&c&&(c.remove(),a.onListenerRemove?.(l),l=null,c=null)}function m(y){a.once&&a.once&&tc$2(u),s(y)}const g=mR$2(r,(y,_)=>{d(),K0$2(y)&&(l=y,c=L2$1(y,o,m),a.onListenerAdd?.(y))},{sync:a.sync,initial:!0});return u=dn$1(()=>{g.remove(),d()}),u}function sZ$1(r,o){return oZ$1(r,vR$2,o)}function oZ$1(r,o,s){if(xa$2(s))return Promise.reject(Vr$2());const a=r();if(o?.(a))return Promise.resolve(a);let l=null;function c(){l=tc$2(l)}return new Promise((u,d)=>{l=j0$2([Ea$1(s,()=>{c(),d(Vr$2())}),lE$2(r,m=>{c(),u(m)},{sync:!1,once:!0},o??gR$2)])})}function gR$2(r){return!0}function vR$2(r){return!!r}const bR$2={sync:!0},aZ$1={initial:!0},lZ$1={sync:!0,initial:!0};var Nf$2;const _R$2=Fe.ofType({base:null,key:"type",typeMap:{extrude:M5$1,fill:Nc$2,icon:Cc$2,line:jh$2,object:Vx$2,text:$h$2,water:eR$2}});let Of$2=Nf$2=class extends Dc$2{constructor(r){super(r),this.symbolLayers=new _R$2,this.type="polygon-3d"}initialize(){const r=o=>{o.type==="line"&&Uu$2(Le$1.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),o.type==="text"&&Uu$2(Le$1.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const o of this.symbolLayers)r(o);this.addHandles(yR$2(()=>this.symbolLayers,"after-add",({item:o})=>r(o),bR$2))}clone(){return new Nf$2({styleOrigin:gt$3(this.styleOrigin),symbolLayers:gt$3(this.symbolLayers),thumbnail:gt$3(this.thumbnail)})}static fromJSON(r){const o=new Nf$2;if(o.read(r),o.symbolLayers.length===2&&o.symbolLayers.at(0).type==="fill"&&o.symbolLayers.at(1).type==="line"){const s=o.symbolLayers.at(0),a=o.symbolLayers.at(1);!a.enabled||r.symbolLayers?.[1]&&r.symbolLayers[1].enable===!1||(s.outline={size:a.size,color:a.material!=null?a.material.color:null}),o.symbolLayers.removeAt(1)}return o}static fromSimpleFillSymbol(r){return new Nf$2({symbolLayers:new Fe([Nc$2.fromSimpleFillSymbol(r)])})}};v([S({type:_R$2,json:{write:!0}})],Of$2.prototype,"symbolLayers",void 0),v([ae$1({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],Of$2.prototype,"type",void 0),Of$2=Nf$2=v([it$1("esri.symbols.PolygonSymbol3D")],Of$2);const sl$2=Of$2;var cE$1;const uE$1=new js$2({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let $c$2=cE$1=class extends O5$1{constructor(...r){super(...r),this.color=new me$1([0,0,0,.25]),this.outline=new Fi$2,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(r,o,s){if(r&&typeof r!="string")return r;const a={};return r&&(a.style=r),o&&(a.outline=o),s&&(a.color=s),a}clone(){return new cE$1({color:gt$3(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};v([S()],$c$2.prototype,"color",void 0),v([S()],$c$2.prototype,"outline",void 0),v([ae$1({esriSFS:"simple-fill"},{readOnly:!0})],$c$2.prototype,"type",void 0),v([S({type:uE$1.apiValues,json:{read:uE$1.read,write:uE$1.write}})],$c$2.prototype,"style",void 0),$c$2=cE$1=v([it$1("esri.symbols.SimpleFillSymbol")],$c$2);const ol$2=$c$2;var hE$2;const pE$2=new js$2({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let to$2=hE$2=class extends cR$2{constructor(...r){super(...r),this.color=new me$1([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new Fi$2}normalizeCtorArgs(r,o,s,a){if(r&&typeof r!="string")return r;const l={};return r&&(l.style=r),o!=null&&(l.size=Je$1(o)),s&&(l.outline=s),a&&(l.color=a),l}writeColor(r,o){r&&this.style!=="x"&&this.style!=="cross"&&(o.color=r.toJSON()),r===null&&(o.color=null)}set path(r){this.style="path",this._set("path",r)}clone(){return new hE$2({angle:this.angle,color:gt$3(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${this.outline?.hash()}`}};v([S()],to$2.prototype,"color",void 0),v([en$2("color")],to$2.prototype,"writeColor",null),v([ae$1({esriSMS:"simple-marker"},{readOnly:!0})],to$2.prototype,"type",void 0),v([S()],to$2.prototype,"size",void 0),v([S({type:pE$2.apiValues,json:{read:pE$2.read,write:pE$2.write}})],to$2.prototype,"style",void 0),v([S({type:String,json:{write:!0}})],to$2.prototype,"path",null),v([S({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Fi$2}},json:{default:null,write:!0}})],to$2.prototype,"outline",void 0),to$2=hE$2=v([it$1("esri.symbols.SimpleMarkerSymbol")],to$2);const gs$2=to$2;var dE$2;let qe$1=dE$2=class extends rr$1{constructor(...r){super(...r),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new gf$2,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(r,o,s){if(r&&typeof r!="string")return r;const a={};return r&&(a.text=r),o&&(a.font=o),s&&(a.color=s),a}writeLineWidth(r,o,s,a){a&&typeof a!="string"?a.origin:o[s]=r}castLineWidth(r){return Je$1(r)}writeLineHeight(r,o,s,a){a&&typeof a!="string"?a.origin:o[s]=r}clone(){return new dE$2({angle:this.angle,backgroundColor:gt$3(this.backgroundColor),borderLineColor:gt$3(this.borderLineColor),borderLineSize:this.borderLineSize,color:gt$3(this.color),font:this.font&&this.font.clone(),haloColor:gt$3(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${this.backgroundColor?.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor?.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};v([S({type:me$1,json:{write:!0}})],qe$1.prototype,"backgroundColor",void 0),v([S({type:me$1,json:{write:!0}})],qe$1.prototype,"borderLineColor",void 0),v([S({type:Number,json:{write:!0},cast:Je$1})],qe$1.prototype,"borderLineSize",void 0),v([S({type:gf$2,json:{write:!0}})],qe$1.prototype,"font",void 0),v([S({...j5$1,json:{write:!0}})],qe$1.prototype,"horizontalAlignment",void 0),v([S({type:Boolean,json:{write:!0}})],qe$1.prototype,"kerning",void 0),v([S({type:me$1,json:{write:!0}})],qe$1.prototype,"haloColor",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],qe$1.prototype,"haloSize",void 0),v([S({type:Boolean,json:{write:!0}})],qe$1.prototype,"rightToLeft",void 0),v([S({type:Boolean,json:{write:!0}})],qe$1.prototype,"rotated",void 0),v([S({type:String,json:{write:!0}})],qe$1.prototype,"text",void 0),v([ae$1({esriTS:"text"},{readOnly:!0})],qe$1.prototype,"type",void 0),v([S({...U5$1,json:{write:!0}})],qe$1.prototype,"verticalAlignment",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],qe$1.prototype,"xoffset",void 0),v([S({type:Number,cast:Je$1,json:{write:!0}})],qe$1.prototype,"yoffset",void 0),v([S({type:Number,json:{read:r=>r&&-1*r,write:(r,o)=>o.angle=r&&-1*r}})],qe$1.prototype,"angle",void 0),v([S({type:Number,json:{write:!0}})],qe$1.prototype,"width",void 0),v([S({type:Number})],qe$1.prototype,"lineWidth",void 0),v([en$2("lineWidth")],qe$1.prototype,"writeLineWidth",null),v([Ku$2("lineWidth")],qe$1.prototype,"castLineWidth",null),v([S(F5$1)],qe$1.prototype,"lineHeight",void 0),v([en$2("lineHeight")],qe$1.prototype,"writeLineHeight",null),qe$1=dE$2=v([it$1("esri.symbols.TextSymbol")],qe$1);const Bc$2=qe$1;var fE$2;let vs$2=fE$2=class extends rr$1{constructor(r){super(r),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const r=this.portal!=null?this.portal:xf$2.getDefault(),o=r.user?r.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${o}:${r.url}`}read(r,o){this.portal=o?.portal,super.read(r,o)}clone(){return new fE$2({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(r){return this._fetchSymbol("webRef",r)}fetchCIMSymbol(r){return this._fetchSymbol("cimRef",r)}async _fetchSymbol(r,o){const s=o!=null?o.cache:null,a=s?this._fetchCacheKey:null;if(s!=null){const d=a&&s.get(a);if(d)return d.clone()}const{resolveWebStyleSymbol:l}=await __vitePreload(()=>import("./webStyleSymbolUtils-BxoWoVrm-BMOiB1BB.js"),__vite__mapDeps([48,49,50]),import.meta.url);Bu$2(o);const c=l(this,{portal:this.portal},r,o);c.catch(d=>{Le$1.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",d)});const u=await c;return r==="webRef"&&u.type==="point-3d"||r==="cimRef"&&u.type==="cim"?(s?.set(a,u.clone()),u):null}};v([S({json:{write:!1}})],vs$2.prototype,"color",void 0),v([S({type:String,json:{write:!0}})],vs$2.prototype,"styleName",void 0),v([S({type:xf$2,json:{write:!1}})],vs$2.prototype,"portal",void 0),v([S({type:String,json:{read:Ng$2,write:Ph$2}})],vs$2.prototype,"styleUrl",void 0),v([S({type:Bh$2,json:{read:!1}})],vs$2.prototype,"thumbnail",void 0),v([S({type:String,json:{write:!0}})],vs$2.prototype,"name",void 0),v([ae$1({styleSymbolReference:"web-style"},{readOnly:!0})],vs$2.prototype,"type",void 0),v([S()],vs$2.prototype,"_fetchCacheKey",null),vs$2=fE$2=v([it$1("esri.symbols.WebStyleSymbol")],vs$2);const Vc$2=vs$2;function cZ$1(r){if(!r)return!1;switch(r.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function mE$1(r){if(!r)return!1;switch(r.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const $g$2={base:rr$1,key:"type",typeMap:{"simple-fill":ol$2,"picture-fill":rE$1,"picture-marker":Fc$2,"simple-line":Fi$2,"simple-marker":gs$2,text:Bc$2,"label-3d":Fg$2,"line-3d":Gc$2,"mesh-3d":Mf$2,"point-3d":Vo$1,"polygon-3d":sl$2,"web-style":Vc$2,cim:qa$1},errorContext:"symbol"},uZ$1={base:rr$1,key:"type",typeMap:{"picture-marker":Fc$2,"simple-marker":gs$2,"point-3d":Vo$1,cim:qa$1},errorContext:"symbol"},hZ$1={base:rr$1,key:"type",typeMap:{"simple-line":Fi$2,"line-3d":Gc$2,cim:qa$1},errorContext:"symbol"},pZ$1={base:rr$1,key:"type",typeMap:{"simple-fill":ol$2,"picture-fill":rE$1,"polygon-3d":sl$2,cim:qa$1},errorContext:"symbol"},dZ$1={base:rr$1,key:"type",typeMap:{"picture-marker":Fc$2,"simple-marker":gs$2,text:Bc$2,"web-style":Vc$2,cim:qa$1},errorContext:"symbol"},fZ$1=g2$2({types:$g$2}),mZ$1={base:rr$1,key:"type",typeMap:{"simple-fill":ol$2,"picture-fill":rE$1,"picture-marker":Fc$2,"simple-line":Fi$2,"simple-marker":gs$2,text:Bc$2,"line-3d":Gc$2,"mesh-3d":Mf$2,"point-3d":Vo$1,"polygon-3d":sl$2,"web-style":Vc$2,cim:qa$1},errorContext:"symbol"},yZ$1={base:rr$1,key:"type",typeMap:{text:Bc$2,"label-3d":Fg$2},errorContext:"symbol"},gZ$1={base:rr$1,key:"type",typeMap:{"line-3d":Gc$2,"mesh-3d":Mf$2,"point-3d":Vo$1,"polygon-3d":sl$2,"web-style":Vc$2,cim:qa$1},errorContext:"symbol"},vZ$1={base:rr$1,key:"type",typeMap:{"label-3d":Fg$2},errorContext:"symbol"},bZ$1=_a$2($g$2);var yE$2;function _Z$1(r){if(!r)return null;const o={};for(const s in r){const a=Ly$2(r[s]);a&&(o[s]=a)}return Object.keys(o).length!==0?o:null}function wZ$1(r){if(r==null)return null;const o={};for(const s in r){const a=r[s];a&&(o[s]=a.toJSON())}return Object.keys(o).length!==0?o:null}let Wr$2=yE$2=class extends Hs$2(ee$1){constructor(r){super(r),this.isAggregate=!1,this.layer=null,this.origin=null,this.popupTemplate=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:wd$2(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&DU$1(Le$1.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(r){const o=this._get("aggregateGeometries");JSON.stringify(o)!==JSON.stringify(r)&&this._set("aggregateGeometries",r)}set attributes(r){const o=this._get("attributes");o!==r&&(this._set("attributes",r),this._notifyLayer("attributes",o,r))}set geometry(r){const o=this._get("geometry");o!==r&&(this._set("geometry",r),r?.type!=="mesh"&&this._notifyLayer("geometry",o,r))}set symbol(r){const o=this._get("symbol");o!==r&&(this._set("symbol",r),this._notifyLayer("symbol",o,r))}get version(){return this._version}set visible(r){const o=this._get("visible");o!==r&&(this._set("visible",r),this._notifyLayer("visible",o,r))}cloneShallow(){return new yE$2({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(r=!1){if(this.popupTemplate)return this.popupTemplate;const o=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const s of[o,this.sourceLayer,this.layer])if(s){if("popupTemplate"in s&&s.popupTemplate)return s.popupTemplate;if(r&&"defaultPopupTemplate"in s&&s.defaultPopupTemplate!=null)return s.defaultPopupTemplate}return null}getAttribute(r){return this.attributes?.[r]}setAttribute(r,o){if(this.attributes){const s=this.getAttribute(r);this.attributes[r]=o,this._notifyLayer("attributes",s,o,r)}else this.attributes={[r]:o},this._notifyLayer("attributes",void 0,o,r)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{aggregateGeometries:wZ$1(this.aggregateGeometries),geometry:this.geometry!=null?this.geometry.toJSON():null,symbol:this.symbol!=null?this.symbol.toJSON():null,attributes:ly$2(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(r={}){const{geometry:o}=this;if(o?.type==="mesh"){const s={origin:o.origin,transform:o.transform};this._notifyLayer("origin-transform",s,s,r.action)}}_notifyLayer(r,o,s,a){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const l={graphic:this,property:r,oldValue:o,newValue:s};r==="origin-transform"&&(l.action=a),r==="attributes"&&(l.attributeName=a),this.layer.graphicChanged(l)}_watchMeshGeometryChanges(){this.addHandles([aE$1(()=>this.geometry?.type==="mesh"&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:r,origin:o})=>{this._lastMeshTransform.localMatrix===r&&this._lastMeshTransform.origin===o||(this._lastMeshTransform.localMatrix=r,this._lastMeshTransform.origin=o,this.notifyMeshTransformChanged())}),aE$1(()=>this.geometry?.type==="mesh"?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const r=this.geometry;r?.type==="mesh"&&r.vertexSpace.origin?(this._lastMeshTransform.localMatrix=r.transform?.localMatrix,this._lastMeshTransform.origin=r.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(r,o)=>r===o,sync:!0})])}};v([S({value:null,json:{read:_Z$1}})],Wr$2.prototype,"aggregateGeometries",null),v([S({value:null})],Wr$2.prototype,"attributes",null),v([S({value:null,types:J_$2,json:{read:Ly$2}})],Wr$2.prototype,"geometry",null),v([S({type:Boolean})],Wr$2.prototype,"isAggregate",void 0),v([S({clonable:"reference"})],Wr$2.prototype,"layer",void 0),v([S({clonable:"reference"})],Wr$2.prototype,"origin",void 0),v([S({type:c5$1})],Wr$2.prototype,"popupTemplate",void 0),v([S({clonable:"reference"})],Wr$2.prototype,"sourceLayer",void 0),v([S({value:null,types:$g$2})],Wr$2.prototype,"symbol",null),v([S({clonable:!1,json:{read:!1,write:!1}})],Wr$2.prototype,"_version",void 0),v([S({type:Boolean,value:!0})],Wr$2.prototype,"visible",null),Wr$2=yE$2=v([it$1("esri.Graphic")],Wr$2);const wR$2=Wr$2;function xZ$1(r){return r!=null&&typeof r=="object"&&"type"in r&&r.type==="subtype-group"&&"sublayers"in r}function EZ$1(r){return r?.type==="subtype-sublayer"}const TZ$1={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function gE$3(r){const o=r?.type;return o==="building-scene"||o==="integrated-mesh"||o==="point-cloud"||o==="scene"}function SZ$1(r){return r?.type==="feature"&&!r.url&&r.source?.type==="memory"}function AZ$1(r){const o=r?.type;return(o==="feature"||o==="subtype-group"||o==="oriented-imagery")&&r.source?.type==="feature-layer"}async function IZ$1(r,o){const s=Ve$2?.findServerInfo(r);if(s?.currentVersion!=null)return s.owningSystemUrl||null;const a=r.toLowerCase().indexOf("/rest/services");if(a===-1)return null;const l=`${r.slice(0,a)}/rest/info`,c=o!=null?o.signal:null,{data:u}=await fn$2(l,{query:{f:"json"},responseType:"json",signal:c});return u?.owningSystemUrl||null}function MZ$1(r){if(!("capabilities"in r))return!1;switch(r.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function NZ$1(r){return MZ$1(r)?"effectiveCapabilities"in r?r.effectiveCapabilities:r.capabilities:null}function OZ$1(r){if(!("editingEnabled"in r))return!1;switch(r.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function CZ$1(r){return!!OZ$1(r)&&("effectiveEditingEnabled"in r?r.effectiveEditingEnabled:r.editingEnabled)}const vE$2=[252,146,31,255],RZ$1=[153,153,153,255],xR$2={type:"esriSMS",style:"esriSMSCircle",size:6,color:vE$2,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},ER$2={type:"esriSLS",style:"esriSLSSolid",width:.75,color:vE$2},TR$2={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},kZ$1={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},LZ$1={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},PZ$1={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},DZ$1={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},bE$2=gs$2.fromJSON(xR$2),_E$2=Fi$2.fromJSON(ER$2),wE$2=ol$2.fromJSON(TR$2),GZ$1=Bc$2.fromJSON(kZ$1);function FZ$1(r){if(r==null)return null;switch(r.type){case"mesh":return null;case"point":case"multipoint":return bE$2;case"polyline":return _E$2;case"polygon":case"extent":return wE$2}return null}const jZ$1=gs$2.fromJSON(LZ$1),UZ$1=Fi$2.fromJSON(PZ$1),$Z$1=ol$2.fromJSON(DZ$1);Vo$1.fromSimpleMarkerSymbol(bE$2),Gc$2.fromSimpleLineSymbol(_E$2),sl$2.fromSimpleFillSymbol(wE$2),new Mf$2({symbolLayers:new Fe([new Nc$2({material:{color:vE$2},edges:new m5$1({size:ds$2(1),color:new me$1(RZ$1)})})])});const BZ$1=new Gc$2({symbolLayers:new Fe([new jh$2({material:{color:new me$1([0,0,0])},size:ds$2(1)})])}),VZ$1=new sl$2({symbolLayers:new Fe([new Nc$2({outline:{color:new me$1([0,0,0]),size:ds$2(1)}})])}),SR$2="#useCIMFallbackSymbology()",zh$2={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function zZ$1(r,o=zh$2){if(!r)return{symbol:null};const{retainId:s=zh$2.retainId,ignoreDrivers:a=zh$2.ignoreDrivers,hasLabelingContext:l=zh$2.hasLabelingContext,retainCIM:c=zh$2.retainCIM,cimFallbackEnabled:u=zh$2.cimFallbackEnabled}=o;let d=null;if(mE$1(r)||r instanceof Vc$2)d=r.clone();else if(r.type==="cim"){const m=r.data?.symbol?.type;switch(m){case"CIMPointSymbol":d=c?r.clone():Vo$1.fromCIMSymbol(r);break;case"CIMLineSymbol":u&&(d=BZ$1.clone(),o?.logWarning?.(SR$2,"Unsupported CIM line symbology converted to fallback 3D line symbology"));break;case"CIMPolygonSymbol":u&&(d=VZ$1.clone(),o?.logWarning?.(SR$2,"Unsupported CIM polygon symbology converted to fallback 3D polygon symbology"))}if(!d)return{error:new oe("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${m||"unknown"}' is unsupported in 3D`,{symbol:r})}}else if(r instanceof Fi$2)d=Gc$2.fromSimpleLineSymbol(r);else if(r instanceof gs$2)d=Vo$1.fromSimpleMarkerSymbol(r);else if(r instanceof Fc$2)d=Vo$1.fromPictureMarkerSymbol(r);else if(r instanceof ol$2)d=o.geometryType&&o.geometryType==="mesh"?Mf$2.fromSimpleFillSymbol(r):sl$2.fromSimpleFillSymbol(r);else{if(!(r instanceof Bc$2))return{error:new oe("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${r.type||r.declaredClass}' is unsupported in 3D`,{symbol:r})};d=l?Fg$2.fromTextSymbol(r):Vo$1.fromTextSymbol(r)}return s&&d&&d.type!=="cim"&&(d.id=r.id),a&&mE$1(d)&&d.symbolLayers.forEach(m=>m.ignoreDrivers=!0),{symbol:d}}function HZ$1(r,o,s,a){const l=IR$2(r,{},{context:a,isLabelSymbol:!1});l!=null&&(o[s]=l)}function WZ$1(r,o,s,a){const l=IR$2(r,{},{context:a,isLabelSymbol:!0});l!=null&&(o[s]=l)}function AR$2(r){return r instanceof Dc$2||r instanceof Vc$2}function XZ$1(r){return r instanceof Dc$2&&(r.type==="polygon-3d"||r.type==="line-3d")}function IR$2(r,o,s){if(r==null)return null;const{context:a,isLabelSymbol:l}=s,c=a?.origin,u=a?.messages;if(c==="web-scene"&&!AR$2(r)){const d=zZ$1(r,{retainCIM:!0,hasLabelingContext:l});return d.symbol!=null?d.symbol.write(o,a):(u?.push(new oe("symbol:unsupported",`Symbols of type '${r.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:r,context:a,error:d.error})),null)}return gE$3(a?.layer)&&XZ$1(r)?(u?.push(new oe("symbol:unsupported",`Symbols of type '${r.declaredClass}' are not supported on layers of type '${a?.layer?.declaredClass}'.`,{symbol:r,context:a})),null):(c==="web-map"||c==="portal-item"&&!gE$3(a?.layer))&&AR$2(r)?(u?.push(new oe("symbol:unsupported",`Symbols of type '${r.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:r,context:a})),null):r.write(o,a)}function Bg$2(r,o){return fZ$1(r,null,o)}class Pe{static async Basemap(o){const s=await __vitePreload(()=>import("./Basemap-BEqqSTw9-BkQ-c4vY.js"),__vite__mapDeps([22,23,24,25]),import.meta.url).then(a=>a.B);return Reflect.construct(s.default,[o])}static async Map(o){const s=await __vitePreload(()=>import("./Map-1zd11DKO-DdBAdkuj.js"),__vite__mapDeps([51,22,23,24,25,52,53,54,55,56,57,29,17]),import.meta.url);return Reflect.construct(s.default,[o])}static async MapView(o){const s=await __vitePreload(()=>import("./MapView-BGOJJ8ch-Dom5daUl.js"),__vite__mapDeps([58,59,53,47,45,46,31,32,1,2,60,61,51,22,23,24,25,52,54,55,56,57,29,17,62,28,63,16,13,14,38,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86]),import.meta.url).then(a=>a.V);return Reflect.construct(s.default,[o])}static async FeatureLayer(o){const s=await __vitePreload(()=>import("./FeatureLayer-BrRKw5Si-CHreUEJ9.js"),__vite__mapDeps([87,88,89,90,91,92,93,52,42,50,94,36,85,21,8,95,96,97,56,98,99,100,101,102,27,40,41,103,13,14,28,38,104,2,16,17,105,106,107,108,29,47,109,110,45,46,111,112,37,113,114,115,54,55,116,117,118,119,120,121,122,123,124,125,39,126,127,43,24,44,128,129,130,131,132,133,134,135,136,137,138,139]),import.meta.url);return Reflect.construct(s.default,[o])}static async GraphicsLayer(o){const s=await __vitePreload(()=>import("./GraphicsLayer-DfeGaYc1-Dg7ASGSC.js"),__vite__mapDeps([140,62,29,17,113,114,115,54,55,56,129,41,42]),import.meta.url);return Reflect.construct(s.default,[o])}static async ImageryLayer(o){const s=await __vitePreload(()=>import("./ImageryLayer-B-bJb8lU-B5SbVSix.js"),__vite__mapDeps([141,27,29,17,142,143,47,144,13,14,88,89,90,91,92,93,52,42,50,145,5,96,97,56,98,146,73,111,71,72,74,147,115,54,55,148,99,100,36,40,41,21,8,149,16,150,151,152,153,19,20,110,45,46,154,37,38,113,114,116,39,43,24,44,128,129,130,131,135,137,139]),import.meta.url);return Reflect.construct(s.default,[o])}static async MapImageLayer(o){const s=await __vitePreload(()=>import("./MapImageLayer-B_rP0PhA-IiizomG9.js"),__vite__mapDeps([155,23,27,156,29,17,112,157,85,38,40,41,42,44,45,46,53,88,89,90,91,92,93,52,50,94,36,21,8,95,96,97,56,98,99,100,101,102,158,159,16,13,14,73,150,151,71,72,74,152,153,19,20,110,160,18,111,154,104,2,105,133,132,123,124,106,107,108,137,161,37,113,114,115,54,55,116,39,43,24,128,129,130,131,162,163,149,135]),import.meta.url);return Reflect.construct(s.default,[o])}static async OpenStreetMapLayer(o){const s=await __vitePreload(()=>import("./OpenStreetMapLayer-Bx4EhJij-DzFDuY-s.js"),__vite__mapDeps([164,165,27,29,17,113,114,115,54,55,56,39,40,41,42,43,24,44,45,46,128,129,149,31,32]),import.meta.url);return Reflect.construct(s.default,[o])}static async TileLayer(o){const s=await __vitePreload(()=>import("./TileLayer-Be5tWeN5-CfDmVQKc.js"),__vite__mapDeps([166,23,27,29,17,112,30,31,32,33,34,35,36,157,85,38,40,41,42,44,45,46,53,88,89,90,91,92,93,52,50,94,21,8,95,96,97,56,98,99,100,101,102,158,159,16,13,14,73,150,151,71,72,74,152,153,19,20,110,160,18,111,154,104,2,105,133,132,123,124,106,107,108,137,161,37,113,114,115,54,55,116,39,43,24,128,129,149]),import.meta.url);return Reflect.construct(s.default,[o])}static async WMSLayer(o){const s=await __vitePreload(()=>import("./WMSLayer-C8eYRV4V-ozTC3oB7.js"),__vite__mapDeps([167,53,27,156,29,17,113,114,115,54,55,56,39,40,41,42,43,24,44,45,46,128,129,130,131,168,38,169,149]),import.meta.url);return Reflect.construct(s.default,[o])}static async ColorBackground(o){const s=await __vitePreload(()=>import("./ColorBackground-gVZldRLm-BDCeusMw.js"),[],import.meta.url);return Reflect.construct(s.default,[o])}static async FeatureFilter(o){const s=await __vitePreload(()=>import("./FeatureFilter-BCFHgLVU-BSMrX0wh.js"),__vite__mapDeps([120,16,13,14,17]),import.meta.url);return Reflect.construct(s.default,[o])}static async FieldFromJson(o){return(await __vitePreload(()=>import("./Field-C6hA1tZj-CbELM0zp.js"),__vite__mapDeps([13,14]),import.meta.url).then(s=>s.F)).default.fromJSON(o)}static async Query(){const o=await __vitePreload(()=>import("./Query-BrwMGK8U-sojFdYaD.js"),__vite__mapDeps([16,13,14,17]),import.meta.url).then(s=>s.Q);return Reflect.construct(o.default,[])}static async QueryByIds(o,s,a){const{executeForIds:l}=await __vitePreload(()=>import("./query-BAUG6dav-Cp-sHT6Q.js"),__vite__mapDeps([170,16,13,14,17,154,73,151,71,72,74,152,153,19,20,110,45,46,111,160,18,171,105,172,173,174,175,150,176,177,178,179,180,181,182]),import.meta.url);return l(o,s,a)}static async RendererFromJson(o){const{fromJSON:s}=await __vitePreload(()=>import("./jsonUtils-C64Zfu7c-trwRB9M4.js"),__vite__mapDeps([94,88,89,90,91,92,93,52,42,50,36,85,21,8,95,96,97,56,98,99,100,101,102]),import.meta.url).then(a=>a.j);return s(o)}}let Bt$2=class Hne{wkid;latestWkid;wkt;constructor(o,s){typeof o=="string"?this.wkt=o:(this.wkid=o,this.latestWkid=s)}isEqual(o){return!!(this.isWebMercator()&&o.isWebMercator()||this.wkid&&o.wkid&&this.wkid===o.wkid||this.wkt&&o.wkt&&this.wkt===o.wkt||this.latestWkid&&o.latestWkid&&this.latestWkid===o.latestWkid)}clone(){const o=new Hne("");return o.latestWkid=this.latestWkid,o.wkid=this.wkid,o.wkt=this.wkt,o}lean(){const o={};return this.wkt?o.wkt=this.wkt:(o.wkid=this.wkid,this.latestWkid&&(o.latestWkid=this.latestWkid)),o}isWebMercator(){const o=[900913,3587,54004,41001,102113,102100,3785];return!!(this.wkid&&o.includes(this.wkid)||this.latestWkid&&o.includes(this.latestWkid))}static latLongSR(){return new Hne(4326)}static fromConfig(o){if(o.wkt)return new Hne(o.wkt);if(o.wkid)return new Hne(o.wkid,o.latestWkid);throw new Error("Could not parse config spatial reference object")}static parseSR(o){return o?o instanceof Hne?o.clone():typeof o=="string"&&o.startsWith("EPSG:")?new Hne(parseInt(o.substring(5).trim())):new Hne(o):Hne.latLongSR()}static fromESRI(o){if(o.wkt)return new Hne(o.wkt);{const s=o.toJSON().latestWkid,a=new Hne(o.wkid);return s&&(a.latestWkid=s),a}}toESRI(){return new Cn$2(this.lean())}static fromGeoJSON(o){const s=Hne.parseGeoJsonCrs(o);return s.substring(0,5)==="EPSG:"?new Hne(parseInt(s.slice(5))):new Hne(s)}static parseGeoJsonCrs(o){if(o){if(o.type==="name"){const s=/urn:ogc:def:crs:EPSG::(\d+)/,a=o.properties.name,l=a.match(s);if(l)return"EPSG:"+l[1];if(a.substring(0,7)!=="urn:ogc")return a}}else return"EPSG:4326";return console.error("Encountered unsupported GeoJSON CRS format. Defaulting to lat-long, resuling conversion is likely wrong",o),"EPSG:4326"}toGeoJSON(){const o={type:"name",properties:{name:""}};return this.wkt?o.properties.name=this.wkt:o.properties.name="urn:ogc:def:crs:EPSG::"+(this.latestWkid||this.wkid),o}},zc$2=class{sr;id;constructor(o,s){this.id=o?o.toString():"",this.sr=Bt$2.parseSR(s)}get type(){return qt$2.UNKNOWN}childIdGenerator(o){return`${this.id}-${o}`}toESRI(){throw new Error(`.toESRI not implemented on geometry type ${this.type}`)}toGeoJSON(){throw new Error(`.toGeoJSON not implemented on geometry type ${this.type}`)}invalid(){return this.type===qt$2.NONE||this.type===qt$2.UNKNOWN}geoJsonFactory(o,s){const a={type:o,coordinates:s};return this.sr&&(a.crs=this.sr.toGeoJSON()),a}},al$2=class extends zc$2{constructor(){super("no_geometry")}get type(){return qt$2.NONE}},gr$2=class xre extends zc$2{rawArray;constructor(o,s,a,l){super(o,s.sr||a),l?this.rawArray=s.slice():this.rawArray=xre.parseXY(s)}get type(){return qt$2.POINT}get x(){return this.rawArray[0]}set x(o){this.rawArray[0]=o}get y(){return this.rawArray[1]}set y(o){this.rawArray[1]=o}toArray(){return this.rawArray.slice()}static parseXY(o){let s;if(Array.isArray(o)&&o.length===2)s=o;else{if(o instanceof xre)return o.toArray();s=[o.x,o.y]}if(isNaN(s[0])||isNaN(s[1]))throw new Error("Unsupported point format detected. Supported formats are two element array of numbers, or object with x and y properties containing numbers");return[parseFloat(s[0]),parseFloat(s[1])]}static fromESRI(o,s){return new xre(s,[o.x,o.y],Bt$2.fromESRI(o.spatialReference),!0)}toESRI(){return new wn$1({x:this.x,y:this.y,spatialReference:this.sr.toESRI()})}static fromGeoJSON(o,s){return new xre(s,o.coordinates,Bt$2.fromGeoJSON(o.crs),!0)}toGeoJSON(){return this.geoJsonFactory(hn$2.POINT,this.toArray())}},ci$2=class Tre extends zc$2{rawArray;constructor(o,s,a,l){super(o,s.sr||a),l?this.rawArray=Tre.arrayDeepCopy(s):s instanceof Tre?this.rawArray=s.toArray():this.rawArray=Tre.parsePointSet(s)}get pointArray(){return this.rawArray.map((o,s)=>new gr$2(this.childIdGenerator(s),o,this.sr,!0))}getAt(o){return new gr$2(this.childIdGenerator(o),this.rawArray[o],this.sr,!0)}updateAt(o,s){this.rawArray[s]=gr$2.parseXY(o)}get length(){return this.rawArray.length}toArray(){return Tre.arrayDeepCopy(this.rawArray)}static parsePointSet(o){if(Array.isArray(o)){if(o.length===0)throw new Error("no verticies provided");return o.map(s=>gr$2.parseXY(s))}else throw new Error("Bad geometry input encountered")}static arrayDeepCopy(o){return o.map(s=>s.slice())}},id$2=class Qre extends ci$2{constructor(o,s,a,l){super(o,s,a,l)}get type(){return qt$2.MULTIPOINT}static fromESRI(o,s){return new Qre(s,o.points,Bt$2.fromESRI(o.spatialReference),!0)}toESRI(){return new Gd$2({points:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(o,s){return new Qre(s,o.coordinates,Bt$2.fromGeoJSON(o.crs),!0)}toGeoJSON(){return this.geoJsonFactory(hn$2.MULTIPOINT,this.toArray())}},Xl$1=class Jre extends ci$2{constructor(o,s,a,l){if(super(o,s,a,l),this.rawArray.length<2)throw new Error("lines require at least two verticies")}get type(){return qt$2.LINESTRING}static fromESRI(o,s){return new Jre(s,o.paths[0],Bt$2.fromESRI(o.spatialReference),!0)}toESRI(){return new ih$2({paths:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(o,s){return new Jre(s,o.coordinates,Bt$2.fromGeoJSON(o.crs),!0)}toGeoJSON(){return this.geoJsonFactory(hn$2.LINESTRING,this.toArray())}},Ls$2=class yre extends zc$2{rawArray;constructor(o,s,a,l){if(super(o,s.sr||a),l)this.rawArray=yre.arrayDeepCopy(s);else if(s instanceof yre)this.rawArray=s.toArray();else if(s instanceof ci$2)this.rawArray=[s.toArray()];else if(Array.isArray(s)){if(s.length===0)throw new Error("no lines provided");this.rawArray=s.map(c=>ci$2.parsePointSet(c))}else throw new Error("invalid lines format for MulitLineString")}get lineArray(){return this.rawArray.map((o,s)=>new Xl$1(this.childIdGenerator(s),o,this.sr,!0))}getAt(o){return new Xl$1(this.childIdGenerator(o),this.rawArray[o],this.sr,!0)}updateAt(o,s){this.rawArray[s]=ci$2.parsePointSet(o)}get length(){return this.rawArray.length}get type(){return qt$2.MULTILINESTRING}toArray(){return yre.arrayDeepCopy(this.rawArray)}static arrayDeepCopy(o){return o.map(s=>s.map(a=>a.slice()))}static fromESRI(o,s){return new yre(s,o.paths,Bt$2.fromESRI(o.spatialReference),!0)}toESRI(){return new ih$2({paths:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(o,s){return new yre(s,o.coordinates,Bt$2.fromGeoJSON(o.crs),!0)}toGeoJSON(){return this.geoJsonFactory(hn$2.MULTILINESTRING,this.toArray())}},Ru$1=class Vre extends ci$2{constructor(o,s,a,l){if(super(o,s,a,l),Vre.closeRing(this.rawArray),this.length<4)throw new Error("Linear Ring must have at least 3 distinct vertices.")}get type(){return qt$2.LINEARRING}updateAt(o,s){const a=this.length-1;s===0?super.updateAt(o,a):s===a&&super.updateAt(o,0),super.updateAt(o,s)}static closeRing(o){const s=o[0],a=o[o.length-1];(s[0]!==a[0]||s[1]!==a[1])&&o.push(s.slice())}static fromESRI(o,s){return new Vre(s,o.rings[0],Bt$2.fromESRI(o.spatialReference),!0)}toESRI(){return new Da$2({rings:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(o,s){return new Vre(s,o.coordinates,Bt$2.fromGeoJSON(o.crs),!0)}toGeoJSON(){return this.geoJsonFactory(hn$2.POLYGON,[this.toArray()])}},ur$2=class cre extends zc$2{rawArray;constructor(o,s,a,l){super(o,s.sr||a),l?this.rawArray=cre.arrayDeepCopy(s):this.rawArray=cre.parsePolygon(s)}addLinearRings(o){o.forEach(s=>this.rawArray.push(s.toArray()))}get ringArray(){return this.rawArray.map((o,s)=>new Ru$1(this.childIdGenerator(s),o,this.sr,!0))}get type(){return qt$2.POLYGON}toArray(){return cre.arrayDeepCopy(this.rawArray)}static parsePolygon(o){let s=[];if(o instanceof cre)return o.toArray();if(o instanceof Ls$2)s=o.toArray();else if(o instanceof ci$2)s=[o.toArray()];else if(Array.isArray(o)){if(o.length===0)throw new Error("no rings provided");s=o.map(a=>ci$2.parsePointSet(a))}else throw new Error("invalid input format for parsePolygon");return s.forEach(a=>Ru$1.closeRing(a)),s}static arrayDeepCopy(o){return o.map(s=>s.map(a=>a.slice()))}static fromESRI(o,s){return new cre(s,o.rings,Bt$2.fromESRI(o.spatialReference),!0)}toESRI(){return new Da$2({rings:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(o,s){return new cre(s,o.coordinates,Bt$2.fromGeoJSON(o.crs),!0)}toGeoJSON(){return this.geoJsonFactory(hn$2.POLYGON,this.toArray())}},ma$2=class ure extends zc$2{rawArray;constructor(o,s,a,l){super(o,s.sr||a),l?this.rawArray=ure.arrayDeepCopy(s):this.rawArray=ure.parseMultiPolygon(s)}addPolygon(o){this.rawArray.push(o.toArray())}get polygonArray(){return this.rawArray.map((o,s)=>new ur$2(this.childIdGenerator(s),o,this.sr,!0))}get type(){return qt$2.MULTIPOLYGON}toArray(){return ure.arrayDeepCopy(this.rawArray)}static parseMultiPolygon(o){if(o instanceof ure)return o.toArray();if(o instanceof ur$2)return[o.toArray()];if(o instanceof Ls$2||o instanceof ci$2)return[ur$2.parsePolygon(o)];if(Array.isArray(o)){if(o.length===0)throw new Error("no polygons provided");return o.map(s=>ur$2.parsePolygon(s))}else throw new Error("invalid input format for parseMultiPolygon")}static arrayDeepCopy(o){return o.map(s=>s.map(a=>a.map(l=>l.slice())))}static fromESRI(o,s){return new ure(s,[o.rings],Bt$2.fromESRI(o.spatialReference),!0)}toESRI(){const o=[];return this.toArray().forEach(s=>{s.forEach(a=>o.push(a))}),new Da$2({rings:o,spatialReference:this.sr.toESRI()})}static fromGeoJSON(o,s){return new ure(s,o.coordinates,Bt$2.fromGeoJSON(o.crs),!0)}toGeoJSON(){return this.geoJsonFactory(hn$2.MULTIPOLYGON,this.toArray())}},tn$2=class ire extends zc$2{rawMin;rawMax;constructor(o,s,a,l){super(o,s.sr||l),this.rawMin=gr$2.parseXY(s),this.rawMax=gr$2.parseXY(a)}get type(){return qt$2.EXTENT}get xmin(){return this.rawMin[0]}get ymin(){return this.rawMin[1]}get xmax(){return this.rawMax[0]}get ymax(){return this.rawMax[1]}center(){return new gr$2(this.id+"_centerPoint",[(this.xmax-this.xmin)/2+this.xmin,(this.ymax-this.ymin)/2+this.ymin],this.sr,!0)}expand(o){return ire.fromESRI(this.toESRI().expand(o),`${this.id}-expanded`)}clone(){return new ire(this.id,this.rawMin,this.rawMax,this.sr)}contains(o){return this.sr.isEqual(o.sr)?this.xmin<=o.x&&this.xmax>=o.x&&this.ymin<=o.y&&this.ymax>=o.y:(console.error("Extent.contains(point) must have point in same spatial reference as the extent."),!1)}toArray(){return[this.rawMin.slice(),this.rawMax.slice()]}toPolygonArray(){return[[this.rawMin.slice(),[this.xmin,this.ymax],this.rawMax.slice(),[this.xmax,this.ymin],this.rawMin.slice()]]}toPolygon(){return new ur$2(this.id,this.toPolygonArray(),this.sr,!0)}static fromParams(o,s,a,l,c,u){return new ire(o,[s,a],[l,c],u)}static fromConfig(o,s){return new ire(o,[s.xmin,s.ymin],[s.xmax,s.ymax],Bt$2.fromConfig(s.spatialReference))}isEqual(o){return o?this.xmin===o.xmin&&this.ymin===o.ymin&&this.xmax===o.xmax&&this.ymax===o.ymax:!1}static fromESRI(o,s){return ire.fromParams(s,o.xmin,o.ymin,o.xmax,o.ymax,Bt$2.fromESRI(o.spatialReference))}toESRI(){return new hi$2({xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax,spatialReference:this.sr.toESRI()})}static fromArcServer(o,s){return ire.fromESRI(hi$2.fromJSON(o),s)}static fromGeoJSON(o,s){if(o.coordinates.length!==5)throw new Error("Extent expected a four vertex polygon from GeoJSON");const a=o.coordinates[0].slice(),l=a.slice();return[1,2,3].forEach(c=>{[0,1].forEach(u=>{const d=o.coordinates[c];a[u]>d[u]&&(a[u]=d[u]),l[u]4){console.error("Invalid colour value array passed to Colour class"),this.c=[0,0,0,1];return}this.c=o.map((a,l)=>l===3?a:parseInt(a)),s===3&&this.c.push(1)}else if(typeof o=="string"){const s=o.substring(0,1)==="#"?o.substring(1):o;this.c=[0,2,4,6].map(a=>{const l=s.substring(a,a+2);return eie.hexToInt(l)})}else this.c=[o.r,o.g,o.b,o.a??1];this.c.forEach((s,a)=>{s<0&&(console.error("Negative value passed to colour"),this.c[a]=0),s>255&&(console.error("Rotund value passed to colour"),this.c[a]=255)}),this.c[3]>1&&(this.c[3]=this.c[3]/255)}get rgba(){return this.c.slice()}get hex(){const o=this.rgba;return o[3]=o[3]*255,`#${o.map(s=>eie.intToHex(s)).join("")}`}get r(){return this.c[0]}get g(){return this.c[1]}get b(){return this.c[2]}get a(){return this.c[3]}toESRI(){return new me$1(this.rgba)}toArcServer(){return[this.c[0],this.c[1],this.c[2],255*this.c[3]]}static hexToInt(o){return o.length===0?255:parseInt(o,16)}static intToHex(o){const s=o.toString(16);return s.length===1?`0${s}`:s}},zo$1=class{toOptions(){throw new Error(".toOptions called on BaseStyle. Likely was not implemented on subclass.")}toESRI(){throw new Error(".toESRI called on BaseStyle. Likely was not implemented on subclass.")}static convToPoints(o){if(!(typeof o>"u"))if(typeof o=="string"){let s;const a=o.length;if(a===0)return;const l=o.substring(a-2);return l==="px"?s=parseFloat(o.substring(0,a-2))*1.333333:l==="pt"?s=parseFloat(o.substring(0,a-2)):s=parseFloat(o),s}else return o}},ga$2=class jre extends zo$1{_height;_xOffset;_yOffset;_icon;_width;_size;_colour;_style;_outline;_path;_angle;constructor(o){if(o=o||{style:Fs$1.CIRCLE},super(),this._style=o.style||Fs$1.CIRCLE,o.style===Fs$1.ICON){const s=o;this._icon=s.icon||"",this._height=zo$1.convToPoints(s.height)||16.5,this._width=zo$1.convToPoints(s.width)||16.5,this._size=0,this._colour=new ya$1,this._outline=new So$1,this._path=""}else{const s=o;this._size=zo$1.convToPoints(s.size)||12,this._colour=new ya$1(s.colour??"#ffffff40"),this._outline=new So$1(s.outline),this._path=this._style===Fs$1.PATH&&s.path||"",this._height=0,this._width=0,this._icon=""}this._xOffset=zo$1.convToPoints(o.xOffset)||0,this._yOffset=zo$1.convToPoints(o.yOffset)||0,this._angle=o.angle||0}get colour(){return this.propGrouse(!1),this._colour}get styleType(){return this._style}get width(){return this.propGrouse(!0),this._width}get height(){return this.propGrouse(!0),this._height}get size(){return this.propGrouse(!1),this._size}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}get angle(){return this._angle}get icon(){return this.propGrouse(!0),this._icon}get outline(){return this.propGrouse(!1),this._outline}get path(){return this.propGrouse(!1),this._path}propGrouse(o){this._style===Fs$1.ICON!==o&&console.warn(`Accessed a point style property that is invalid for the style type ${this._style}`)}toOptions(){const o={style:this.styleType,yOffset:this.yOffset,xOffset:this.xOffset,angle:this.angle};return this._style===Fs$1.ICON?{...o,icon:this.icon,width:this.width,height:this.height}:{...o,size:this.size,colour:this.colour.hex,path:this.path}}toESRI(){let o;return this.styleType===Fs$1.ICON?jre.isImageUrl(this.icon)?(o=new Fc$2,o.url=this.icon,o.width=this.width,o.height=this.height,o.xoffset=this.xOffset,o.yoffset=this.yOffset,o.angle=this.angle):(o=new gs$2,o.color=new me$1(this.colour.rgba),o.size=this.width,o.xoffset=this.xOffset,o.yoffset=this.yOffset,o.angle=this.angle):(o=new gs$2,o.color=new me$1(this.colour.rgba),o.size=this.size,o.xoffset=this.xOffset,o.yoffset=this.yOffset,o.angle=this.angle,o.path=this.path,o.style=this.styleType,o.outline=this.outline.toESRI()),o}static fromESRI(o){const s={xOffset:o.xoffset,yOffset:o.yoffset,angle:o.angle};if(o.type==="simple-marker"){const a=s;a.style=o.style,a.colour=o.color.toRgba(),a.size=o.size,a.path=o.path,a.outline=So$1.fromESRI(o.outline).toOptions()}else{const a=s;a.style=Fs$1.ICON,a.width=o.width,a.height=o.height,a.icon=o.url}return new jre(s)}static fromArcServer(o){return jre.fromESRI(Bg$2(o))}static isImageUrl(o){return!!o.match(/\.(jpeg|jpg|gif|png|swf|svg)$/)||!!o.match(/^\s*data:([a-z]+\/[a-z0-9\-\+]+(;[a-z\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i)}},So$1=class tie extends zo$1{_style;_width;_miter;_cap;_join;_colour;constructor(o){o=o||{},super(),this._style=o.style||Ur$2.SOLID;const s=zo$1.convToPoints(o.width);this._width=typeof s>"u"||s<0?.75:s,this._colour=new ya$1(o.colour),this._miter=o.miter??2,this._cap=o.cap||W4$1.ROUND,this._join=o.join||H4$1.ROUND}get styleType(){return this._style}get width(){return this._width}get colour(){return this._colour}get miter(){return this._miter}get cap(){return this._cap}get join(){return this._join}toOptions(){return{style:this.styleType,width:this.width,colour:this.colour.hex,miter:this.miter,cap:this.cap,join:this.join}}toESRI(){const o=new Fi$2;return o.width=this.width,o.color=this.colour.toESRI(),o.style=this.styleType,o.cap=this.cap,o.miterLimit=this.miter,o.join=this.join,o}static fromESRI(o){const s={width:o.width,colour:o.color.toRgba(),style:o.style};return new tie(s)}static fromArcServer(o){return tie.fromESRI(Bg$2(o))}},sd$2=class nie extends zo$1{_outlineStyle;_fillColour;_fillStyle;constructor(o){super(),o=o||{},o.fill||(o.fill={}),this._fillColour=new ya$1(o.fill.colour),this._fillStyle=o.fill.style||X4$1.SOLID,this._outlineStyle=new So$1(o.outline)}get fillColour(){return this._fillColour}get fillStyleType(){return this._fillStyle}get outline(){return this._outlineStyle}toOptions(){return{fill:{style:this.fillStyleType,colour:this.fillColour.hex},outline:this.outline.toOptions()}}toESRI(){const o=this.outline.toESRI(),s=new me$1(this.fillColour.rgba),a=new ol$2;return a.style=this.fillStyleType,a.color=s,a.outline=o,a}static fromESRI(o){const s={fill:{colour:o.color.toRgba(),style:o.style},outline:So$1.fromESRI(o.outline).toOptions()};return new nie(s)}static fromArcServer(o){return nie.fromESRI(Bg$2(o))}},YZ$1=class{Extent=tn$2;Graphic=Si$1;LineString=Xl$1;LineStyle=So$1;LinearRing=Ru$1;MultiLineString=Ls$2;MultiPoint=id$2;MultiPolygon=ma$2;Point=gr$2;PointStyle=ga$2;Polygon=ur$2;PolygonStyle=sd$2;SpatialReference=Bt$2;esriMapClickToRamp(o,s){return{mapPoint:gr$2.fromESRI(o.mapPoint,s),screenX:o.x,screenY:o.y,button:o.button,input:o.native.pointerType,clickTime:o.timestamp}}esriMapMouseToRamp(o){return{screenX:o.x,screenY:o.y,button:o.button,moveTime:o.timestamp}}geomRampToEsri(o){return o.toESRI()}geomEsriToRamp(o,s){switch(o.type){case"point":return gr$2.fromESRI(o,s);case"polyline":{const a=o;return a.paths.length===1?Xl$1.fromESRI(a,s):Ls$2.fromESRI(a,s)}case"polygon":return ur$2.fromESRI(o,s);case"extent":return tn$2.fromESRI(o,s);case"multipoint":return id$2.fromESRI(o,s);default:throw new Error(`Encountered unhandled geometry type ${o.type}`)}}geomGeoJsonToRamp(o,s){switch(o.type){case hn$2.POINT:return gr$2.fromGeoJSON(o,s);case hn$2.LINESTRING:return Xl$1.fromGeoJSON(o,s);case hn$2.POLYGON:return ur$2.fromGeoJSON(o,s);case hn$2.MULTIPOINT:return id$2.fromGeoJSON(o,s);case hn$2.MULTILINESTRING:return Ls$2.fromGeoJSON(o,s);case hn$2.MULTIPOLYGON:return ma$2.fromGeoJSON(o,s);default:throw new Error(`Encountered unhandled geometry type ${o.type}`)}}geomRampToGeoJson(o){return o.toGeoJSON()}graphicRampToGeoJson(o){const s={},a={type:"Feature",geometry:this.geomRampToGeoJson(o.geometry),properties:s};return Object.keys(o.attributes).forEach(l=>a.properties[l]=o.attributes[l]),a}graphicGeoJsonToRamp(o,s){if(o.type!=="Feature")throw new Error("Expected input parameter of graphicGeoJsonToRamp to be a GeoJson feature");const a=this.geomGeoJsonToRamp(o.geometry,s),l={};return Object.keys(o.properties.forEach(c=>l[c]=o.properties[c])),new Si$1(a,"",l)}graphicRampToEsri(o){const s={attributes:{},id:o.id};return s.geometry=this.geomRampToEsri(o.geometry),Object.keys(o.attributes).forEach(a=>s.attributes[a]=o.attributes[a]),o.style&&(s.symbol=this.styleRampToEsri(o.style)),new wR$2(s)}styleRampToEsri(o){return o.toESRI()}styleEsriToRamp(o){switch(o.type){case"picture-marker":case"simple-marker":return ga$2.fromESRI(o);case"simple-line":return So$1.fromESRI(o);case"simple-fill":return sd$2.fromESRI(o);default:return console.error(`Unsupported ESRI symbol type encountered: ${o.type}`),new ga$2}}serverGeomTypeToRampGeomType(o){if(!o)return qt$2.NONE;switch(o){case"esriGeometryPolygon":return qt$2.POLYGON;case"esriGeometryPolyline":return qt$2.LINESTRING;case"esriGeometryPoint":return qt$2.POINT;case"esriGeometryMultipoint":return qt$2.MULTIPOINT;case"esriGeometryEnvelope":return qt$2.EXTENT;default:return console.error(`Unrecognized server geometry type encountered: ${o}`),qt$2.UNKNOWN}}clientGeomTypeToRampGeomType(o){if(!o)return qt$2.NONE;switch(o){case"polygon":return qt$2.POLYGON;case"polyline":return qt$2.LINESTRING;case"point":return qt$2.POINT;case"multipoint":return qt$2.MULTIPOINT;default:return console.error(`Unrecognized client geometry type encountered: ${o}`),qt$2.UNKNOWN}}geoJsonGeomTypeToEsriGeomType(o){switch(o){case hn$2.POINT:return"point";case hn$2.LINESTRING:case hn$2.MULTILINESTRING:return"polyline";case hn$2.POLYGON:case hn$2.MULTIPOLYGON:return"polygon";case hn$2.MULTIPOINT:return"multipoint";default:throw new Error(`Encountered unhandled geometry type ${o}`)}}isImageUrl(o){return ga$2.isImageUrl(o)}},Vg$2=class{layerIdx;name;children;uid;isRoot;constructor(o,s,a="",l=!0){this.layerIdx=o,this.name=a,this.isRoot=l,this.children=[],this.uid=s}findChildByUid(o){if(this.uid===o)return this;{let s;return this.children.some(a=>s=a.findChildByUid(o)),s}}findChildByIdx(o){if(this.layerIdx===o)return this;{let s;return this.children.some(a=>s=a.findChildByIdx(o)),s}}get isLogicalLayer(){return this.layerIdx>-1&&this.children.length===0}get isLayerRoot(){return this.isRoot}},MR$2=class{minScale;maxScale;constructor(o=0,s=0){this.minScale=o,this.maxScale=s}isOffScale(o){const s={offScale:!1,zoomIn:!1};return othis.minScale&&this.minScale!==0&&(s.offScale=!0,s.zoomIn=!0),s}},NR$2=class{sql;cache;extent;constructor(o="",s=""){this.sql={[dr$2.PERMANENT]:o,[dr$2.INITIAL]:s},this.extent=void 0,this.cache={}}sqlActiveFilters(o=[]){const s=this.sql,a=Object.keys(s).filter(l=>s[l]);return o.length===0?a:a.filter(l=>o.indexOf(l)===-1)}isActive(){return this.sqlActiveFilters([dr$2.PERMANENT]).length>0}getCombinedSql(o=[]){const s=this.sqlActiveFilters(o),a=s.length;return a===0?"":a===1?this.sql[s[0]]:s.map(l=>`(${this.sql[l]})`).join(" AND ")}setSql(o,s){o===dr$2.PERMANENT?console.error("Attempted to overwrite a permanent filter. Not allowed."):(this.sql[o]=s,this.clearCacheSet(o))}getSql(o){return this.sql[o]||""}setExtent(o){o.isEqual(this.extent)||(this.extent=o,this.clearCacheSet(dr$2.EXTENT))}getCacheKey(o,s){return`_cache$${o.sort().join("$")}${s?"$"+dr$2.EXTENT:""}$`}getCache(o,s){const a=this.getCacheKey(o,s);return this.cache[a]}setCache(o,s,a){const l=this.getCacheKey(s,a);this.cache[l]=o}cacheActiveKeys(){const o=this.cache;return Object.keys(o).filter(s=>o[s])}clearAllCaches(){this.cache={}}clearCacheSet(o){this.cacheActiveKeys().forEach(s=>{s.indexOf(`$${o}$`)>-1&&delete this.cache[s]})}clearAll(){this.sql={[dr$2.PERMANENT]:this.sql[dr$2.PERMANENT]},this.extent=void 0,this.clearAllCaches()}},f0$2=class rie{id;sr;_defaultExtent;_fullExtent;_maximumExtent;constructor(o,s,a=void 0,l=void 0){this.id=o,this.sr=s.sr.clone(),this._defaultExtent=s.clone(),this._fullExtent=a?.clone(),this._maximumExtent=l?.clone(),a&&!a.sr.isEqual(this.sr)&&console.error(`Full extent provided in extent set has a mismatching spatial reference: ${a.sr}`),l&&!l.sr.isEqual(this.sr)&&console.error(`Maximum extent provided in extent set has a mismatching spatial reference: ${l.sr}`)}get defaultExtent(){return this._defaultExtent}set defaultExtent(o){this._defaultExtent=o.clone()}get fullExtent(){return this._fullExtent?this._fullExtent:this.defaultExtent}set fullExtent(o){this._fullExtent=o.clone()}get maximumExtent(){return this._maximumExtent?this._maximumExtent:this.fullExtent}set maximumExtent(o){this._maximumExtent=o.clone()}static fromConfig(o){return new rie(o.id,tn$2.fromConfig(`${o.id}-extent-default`,o.default),o.full!==void 0?tn$2.fromConfig(`${o.id}-extent-full`,o.full):void 0,o.maximum!==void 0?tn$2.fromConfig(`${o.id}-extent-maximum`,o.maximum):void 0)}clone(){return new rie(this.id,this._defaultExtent,this._fullExtent,this._maximumExtent)}},xn$2=class{realPromise;resolveMe(o){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((o,s)=>{this.resolveMe=a=>{o(a)},this.rejectMe=s})}};var Cf$2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hh$2(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function OR$2(r){if(r.__esModule)return r;var o=r.default;if(typeof o=="function"){var s=function a(){return this instanceof a?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};s.prototype=o.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(r).forEach(function(a){var l=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(s,a,l.get?l:{enumerable:!0,get:function(){return r[a]}})}),s}var xE$1,CR$2;function JZ$1(){if(CR$2)return xE$1;CR$2=1;var r=function(R){return o(R)&&!s(R)};function o(R){return!!R&&typeof R=="object"}function s(R){var M=Object.prototype.toString.call(R);return M==="[object RegExp]"||M==="[object Date]"||c(R)}var a=typeof Symbol=="function"&&Symbol.for,l=a?Symbol.for("react.element"):60103;function c(R){return R.$$typeof===l}function u(R){return Array.isArray(R)?[]:{}}function d(R,M){return M.clone!==!1&&M.isMergeableObject(R)?k(u(R),R,M):R}function m(R,M,N){return R.concat(M).map(function(D){return d(D,N)})}function g(R,M){if(!M.customMerge)return k;var N=M.customMerge(R);return typeof N=="function"?N:k}function y(R){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(R).filter(function(M){return Object.propertyIsEnumerable.call(R,M)}):[]}function _(R){return Object.keys(R).concat(y(R))}function E(R,M){try{return M in R}catch{return!1}}function w(R,M){return E(R,M)&&!(Object.hasOwnProperty.call(R,M)&&Object.propertyIsEnumerable.call(R,M))}function T(R,M,N){var D={};return N.isMergeableObject(R)&&_(R).forEach(function(P){D[P]=d(R[P],N)}),_(M).forEach(function(P){w(R,P)||(E(R,P)&&N.isMergeableObject(M[P])?D[P]=g(P,N)(R[P],M[P],N):D[P]=d(M[P],N))}),D}function k(R,M,N){N=N||{},N.arrayMerge=N.arrayMerge||m,N.isMergeableObject=N.isMergeableObject||r,N.cloneUnlessOtherwiseSpecified=d;var D=Array.isArray(M),P=Array.isArray(R),I=D===P;return I?D?N.arrayMerge(R,M,N):T(R,M,N):d(M,N)}k.all=function(R,M){if(!Array.isArray(R))throw new Error("first argument should be an array");return R.reduce(function(N,D){return k(N,D,M)},{})};var O=k;return xE$1=O,xE$1}var qZ$1=JZ$1();const EE$2=Hh$2(qZ$1);let ZZ$1=class{generateUUID(){let o=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const a=(o+Math.random()*16)%16|0;return o=Math.floor(o/16),(s==="x"?a:a&3|8).toString(16)})}convertImageToCanvas(o,s,a=!0){const l=s??document.createElement("canvas"),c=document.createElement("img");a&&(c.crossOrigin="anonymous");const u=new Promise((d,m)=>{c.addEventListener("load",()=>{l.width=c.width,l.height=c.height,l.getContext("2d")?.drawImage(c,0,0),d(l)}),c.addEventListener("error",g=>m(g))});return c.src=o,u}async convertImagetoDataURL(o,s="image/png"){return o.startsWith("data")?o:this.convertImageToCanvas(o).then(a=>a.toDataURL(s)).catch(a=>(console.error("Failed to load crossorigin image",o,a),o))}parseUrlIndex(o){const s={rootUrl:o,index:0},a=/\/(\d+)\/?$/,l=o.match(a);if(l){const c=l[1];s.index=isNaN(parseInt(c))?void 0:parseInt(c),s.rootUrl=o.substr(0,o.length-l[0].length)}else console.warn("Cannot extract layer index from url "+o);return s}controlAvailable(o,s){return s?.disabledControls?.includes(o)?!1:s?.controls?s?.controls?.includes(o):!0}},Rf$1=class{_url;_base;_query;_queryMap={};constructor(o){this._url=o,[this._base,this._query]=o.split("?").concat(""),this._queryMap=this._query.split("&").reduce((s,a)=>{const[l,c]=a.split("=");return s[l]=c,s},{})}get query(){return this._query}get base(){return this._base}get queryMap(){return this._queryMap}updateQuery(o){const s=EE$2.all([{},this.queryMap,o]);return`${this.base}${Object.entries(s).filter(([,a])=>a!==void 0).map(([a,l],c)=>`${c===0?"?":""}${a}=${l}`).join("&")}`}};var TE$2={exports:{}},QZ$1=TE$2.exports,RR$2;function kR$2(){return RR$2||(RR$2=1,function(r,o){(function(s,a){r.exports=a(),typeof window=="object"&&(s.Terraformer=a())})(QZ$1,function(){var s={},a=6378137,l=57.29577951308232,c=.017453292519943,u={type:"link",properties:{href:"http://spatialreference.org/ref/sr-org/6928/ogcwkt/",type:"ogcwkt"}},d={type:"link",properties:{href:"http://spatialreference.org/ref/epsg/4326/ogcwkt/",type:"ogcwkt"}};function m(Iee){return Object.prototype.toString.call(Iee)==="[object Array]"}function g(){var Iee=Array.prototype.slice.apply(arguments);typeof console!==void 0&&console.warn&&console.warn.apply(console,Iee)}function y(Iee,Rte){for(var dee in Rte)Rte.hasOwnProperty(dee)&&(Iee[dee]=Rte[dee]);return Iee}function _(Iee){if(Iee.type)switch(Iee.type){case"Point":return[Iee.coordinates[0],Iee.coordinates[1],Iee.coordinates[0],Iee.coordinates[1]];case"MultiPoint":return T(Iee.coordinates);case"LineString":return T(Iee.coordinates);case"MultiLineString":return E(Iee.coordinates);case"Polygon":return E(Iee.coordinates);case"MultiPolygon":return w(Iee.coordinates);case"Feature":return Iee.geometry?_(Iee.geometry):null;case"FeatureCollection":return k(Iee);case"GeometryCollection":return O(Iee);default:throw new Error("Unknown type: "+Iee.type)}return null}function E(Iee){for(var Rte=null,dee=null,fee=null,Oee=null,xee=0;xeedee)&&(dee=Lte),(fee===null||VteOee)&&(Oee=Vte)}return[Rte,fee,dee,Oee]}function w(Iee){for(var Rte=null,dee=null,fee=null,Oee=null,xee=0;xeedee)&&(dee=Pte),(fee===null||FteOee)&&(Oee=Fte)}return[Rte,fee,dee,Oee]}function T(Iee){for(var Rte=null,dee=null,fee=null,Oee=null,xee=0;xeedee)&&(dee=Dte),(fee===null||IteOee)&&(Oee=Ite)}return[Rte,fee,dee,Oee]}function k(Iee){for(var Rte=[],dee,fee=Iee.features.length-1;fee>=0;fee--)dee=_(Iee.features[fee].geometry),Rte.push([dee[0],dee[1]]),Rte.push([dee[2],dee[3]]);return T(Rte)}function O(Iee){for(var Rte=[],dee,fee=Iee.geometries.length-1;fee>=0;fee--)dee=_(Iee.geometries[fee]),Rte.push([dee[0],dee[1]]),Rte.push([dee[2],dee[3]]);return T(Rte)}function R(Iee){var Rte=_(Iee);return{x:Rte[0],y:Rte[1],w:Math.abs(Rte[0]-Rte[2]),h:Math.abs(Rte[1]-Rte[3])}}function M(Iee){return Iee*l}function N(Iee){return Iee*c}function D(Iee,Rte){for(var dee=0;deeRte?1:0}function z(Iee,Rte){return Iee[0]>Rte[0]?-1:Iee[0]Rte[1]?-1:Iee[1]ce(Rte,dee))&&(dee=Iee[fee])}return dee}function B(Iee){if(Iee.length===0)return[];if(Iee.length===1)return Iee;for(var Rte=[Iee.sort(z)[0]],dee=0;dee0||!Rte&&Dte<0)return!1}return!0}function Ge(Iee,Rte){for(var dee=!1,fee=-1,Oee=Iee.length,xee=Oee-1;++fee=3)Iee=this.coordinates;else return null;else if(this.type==="Polygon"||this.type==="MultiLineString")if(this.coordinates&&this.coordinates.length>0){for(Rte=0;Rte0){for(Rte=0;Rte=2)this.coordinates=Rte;else throw"Terraformer: invalid input for Terraformer.Point";this.type="Point"}xte.prototype=new ete,xte.prototype.constructor=xte;function Ote(Iee){if(Iee&&Iee.type==="MultiPoint"&&Iee.coordinates)y(this,Iee);else if(m(Iee))this.coordinates=Iee;else throw"Terraformer: invalid input for Terraformer.MultiPoint";this.type="MultiPoint"}Ote.prototype=new ete,Ote.prototype.constructor=Ote,Ote.prototype.forEach=function(Iee){for(var Rte=0;Rte1},Bee.prototype.holes=function(){var Iee=[];if(this.hasHoles())for(var Rte=1;Rte=this.text.length)return;r=this.text[this.place++]}switch(this.state){case Pf$2:return this.neutral(r);case GR$2:return this.keyword(r);case zg$2:return this.quoted(r);case jR$2:return this.afterquote(r);case FR$2:return this.number(r);case IE$1:return}},Ho$1.prototype.afterquote=function(r){if(r==='"'){this.word+='"',this.state=zg$2;return}if(Hg$2.test(r)){this.word=this.word.trim(),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in afterquote yet, index '+this.place)},Ho$1.prototype.afterItem=function(r){if(r===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Pf$2;return}if(r==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Pf$2,this.currentObject=this.stack.pop(),this.currentObject||(this.state=IE$1);return}},Ho$1.prototype.number=function(r){if(UR$2.test(r)){this.word+=r;return}if(Hg$2.test(r)){this.word=parseFloat(this.word),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in number yet, index '+this.place)},Ho$1.prototype.quoted=function(r){if(r==='"'){this.state=jR$2;return}this.word+=r},Ho$1.prototype.keyword=function(r){if(cQ$1.test(r)){this.word+=r;return}if(r==="["){var o=[];o.push(this.word),this.level++,this.root===null?this.root=o:this.currentObject.push(o),this.stack.push(this.currentObject),this.currentObject=o,this.state=Pf$2;return}if(Hg$2.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in keyword yet, index '+this.place)},Ho$1.prototype.neutral=function(r){if(lQ$1.test(r)){this.word=r,this.state=GR$2;return}if(r==='"'){this.word="",this.state=zg$2;return}if(UR$2.test(r)){this.word=r,this.state=FR$2;return}if(Hg$2.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in neutral yet, index '+this.place)},Ho$1.prototype.output=function(){for(;this.place0?90:-90),r.lat_ts=r.lat1):!r.lat_ts&&r.lat0&&r.projName==="Polar_Stereographic"&&(r.lat_ts=r.lat0,r.lat0=no$2(r.lat0>0?90:-90))}function BR$2(r){var o=uQ$1(r),s=o.shift(),a=o.shift();o.unshift(["name",a]),o.unshift(["type",s]);var l={};return Xh$2(o,l),dQ$1(l),l}function Or$3(r){var o=this;if(arguments.length===2){var s=arguments[1];typeof s=="string"?s.charAt(0)==="+"?Or$3[r]=AE$2(arguments[1]):Or$3[r]=BR$2(arguments[1]):Or$3[r]=s}else if(arguments.length===1){if(Array.isArray(r))return r.map(function(a){Array.isArray(a)?Or$3.apply(o,a):Or$3(a)});if(typeof r=="string"){if(r in Or$3)return Or$3[r]}else"EPSG"in r?Or$3["EPSG:"+r.EPSG]=r:"ESRI"in r?Or$3["ESRI:"+r.ESRI]=r:"IAU2000"in r?Or$3["IAU2000:"+r.IAU2000]=r:console.log(r);return}}tQ$1(Or$3);function fQ$1(r){return typeof r=="string"}function mQ$1(r){return r in Or$3}var yQ$1=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function gQ$1(r){return yQ$1.some(function(o){return r.indexOf(o)>-1})}var vQ$1=["3857","900913","3785","102113"];function bQ$1(r){var o=ll$3(r,"authority");if(o){var s=ll$3(o,"epsg");return s&&vQ$1.indexOf(s)>-1}}function _Q$1(r){var o=ll$3(r,"extension");if(o)return ll$3(o,"proj4")}function wQ$1(r){return r[0]==="+"}function xQ$1(r){if(fQ$1(r)){if(mQ$1(r))return Or$3[r];if(gQ$1(r)){var o=BR$2(r);if(bQ$1(o))return Or$3["EPSG:3857"];var s=_Q$1(o);return s?AE$2(s):o}if(wQ$1(r))return AE$2(r)}else return r}function VR$2(r,o){r=r||{};var s,a;if(!o)return r;for(a in o)s=o[a],s!==void 0&&(r[a]=s);return r}function ro$2(r,o,s){var a=r*o;return s/Math.sqrt(1-a*a)}function Df$2(r){return r<0?-1:1}function _t$2(r){return Math.abs(r)<=En$2?r:r-Df$2(r)*Lf$2}function bs$2(r,o,s){var a=r*s,l=.5*r;return a=Math.pow((1-a)/(1+a),l),Math.tan(.5*(ht$1-o))/a}function Gf$2(r,o){for(var s=.5*r,a,l,c=ht$1-2*Math.atan(o),u=0;u<=15;u++)if(a=r*Math.sin(c),l=ht$1-2*Math.atan(o*Math.pow((1-a)/(1+a),s))-c,c+=l,Math.abs(l)<=1e-10)return c;return-9999}function EQ$1(){var r=this.b/this.a;this.es=1-r*r,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=ro$2(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function TQ$1(r){var o=r.x,s=r.y;if(s*eo$2>90&&s*eo$2<-90&&o*eo$2>180&&o*eo$2<-180)return null;var a,l;if(Math.abs(Math.abs(s)-ht$1)<=bt$2)return null;if(this.sphere)a=this.x0+this.a*this.k0*_t$2(o-this.long0),l=this.y0+this.a*this.k0*Math.log(Math.tan(Te+.5*s));else{var c=Math.sin(s),u=bs$2(this.e,s,c);a=this.x0+this.a*this.k0*_t$2(o-this.long0),l=this.y0-this.a*this.k0*Math.log(u)}return r.x=a,r.y=l,r}function SQ$1(r){var o=r.x-this.x0,s=r.y-this.y0,a,l;if(this.sphere)l=ht$1-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var c=Math.exp(-s/(this.a*this.k0));if(l=Gf$2(this.e,c),l===-9999)return null}return a=_t$2(this.long0+o/(this.a*this.k0)),r.x=a,r.y=l,r}var AQ$1=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const IQ$1={init:EQ$1,forward:TQ$1,inverse:SQ$1,names:AQ$1};function MQ$1(){}function zR$2(r){return r}var NQ$1=["longlat","identity"];const OQ$1={init:MQ$1,forward:zR$2,inverse:zR$2,names:NQ$1};var CQ$1=[IQ$1,OQ$1],Wg$2={},Xg$1=[];function HR$2(r,o){var s=Xg$1.length;return r.names?(Xg$1[s]=r,r.names.forEach(function(a){Wg$2[a.toLowerCase()]=s}),this):(console.log(o),!0)}function RQ$1(r){if(!r)return!1;var o=r.toLowerCase();if(typeof Wg$2[o]<"u"&&Xg$1[Wg$2[o]])return Xg$1[Wg$2[o]]}function kQ$1(){CQ$1.forEach(HR$2)}const LQ$1={start:kQ$1,add:HR$2,get:RQ$1};var Ht$2={};Ht$2.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},Ht$2.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},Ht$2.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},Ht$2.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},Ht$2.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},Ht$2.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},Ht$2.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},Ht$2.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},Ht$2.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},Ht$2.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},Ht$2.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},Ht$2.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},Ht$2.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},Ht$2.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},Ht$2.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},Ht$2.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},Ht$2.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},Ht$2.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},Ht$2.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},Ht$2.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},Ht$2.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},Ht$2.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},Ht$2.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},Ht$2.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},Ht$2.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},Ht$2.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},Ht$2.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},Ht$2.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},Ht$2.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},Ht$2.hough={a:6378270,rf:297,ellipseName:"Hough"},Ht$2.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},Ht$2.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},Ht$2.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},Ht$2.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},Ht$2.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},Ht$2.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},Ht$2.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},Ht$2.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},Ht$2.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},Ht$2.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},Ht$2.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},Ht$2.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var PQ$1=Ht$2.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Ht$2.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function DQ$1(r,o,s,a){var l=r*r,c=o*o,u=(l-c)/l,d=0;a?(r*=1-u*(rQ$1+u*(iQ$1+u*sQ$1)),l=r*r,u=0):d=Math.sqrt(u);var m=(l-c)/c;return{es:u,e:d,ep2:m}}function GQ(r,o,s,a,l){if(!r){var c=ll$3(Ht$2,a);c||(c=PQ$1),r=c.a,o=c.b,s=c.rf}return s&&!o&&(o=(1-1/s)*r),(s===0||Math.abs(r-o)3&&(d.datum_params[3]!==0||d.datum_params[4]!==0||d.datum_params[5]!==0||d.datum_params[6]!==0)&&(d.datum_type=Wc$2,d.datum_params[3]*=kf$2,d.datum_params[4]*=kf$2,d.datum_params[5]*=kf$2,d.datum_params[6]=d.datum_params[6]/1e6+1)),u&&(d.datum_type=Wh$1,d.grids=u),d.a=s,d.b=a,d.es=l,d.ep2=c,d}var WR$2={};function jQ(r,o){var s=new DataView(o),a=BQ$1(s),l=VQ(s,a),c=zQ(s,l,a),u={header:l,subgrids:c};return WR$2[r]=u,u}function UQ(r){if(r===void 0)return null;var o=r.split(",");return o.map($Q$1)}function $Q$1(r){if(r.length===0)return null;var o=r[0]==="@";return o&&(r=r.slice(1)),r==="null"?{name:"null",mandatory:!o,grid:null,isNull:!0}:{name:r,mandatory:!o,grid:WR$2[r]||null,isNull:!1}}function Yh$2(r){return r/3600*Math.PI/180}function BQ$1(r){var o=r.getInt32(8,!1);return o===11?!1:(o=r.getInt32(8,!0),o!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function VQ(r,o){return{nFields:r.getInt32(8,o),nSubgridFields:r.getInt32(24,o),nSubgrids:r.getInt32(40,o),shiftType:ME$2(r,56,64).trim(),fromSemiMajorAxis:r.getFloat64(120,o),fromSemiMinorAxis:r.getFloat64(136,o),toSemiMajorAxis:r.getFloat64(152,o),toSemiMinorAxis:r.getFloat64(168,o)}}function ME$2(r,o,s){return String.fromCharCode.apply(null,new Uint8Array(r.buffer.slice(o,s)))}function zQ(r,o,s){for(var a=176,l=[],c=0;c5e-11?!1:r.datum_type===Hc$2?r.datum_params[0]===o.datum_params[0]&&r.datum_params[1]===o.datum_params[1]&&r.datum_params[2]===o.datum_params[2]:r.datum_type===Wc$2?r.datum_params[0]===o.datum_params[0]&&r.datum_params[1]===o.datum_params[1]&&r.datum_params[2]===o.datum_params[2]&&r.datum_params[3]===o.datum_params[3]&&r.datum_params[4]===o.datum_params[4]&&r.datum_params[5]===o.datum_params[5]&&r.datum_params[6]===o.datum_params[6]:!0}function XR$2(r,o,s){var a=r.x,l=r.y,c=r.z?r.z:0,u,d,m,g;if(l<-ht$1&&l>-1.001*ht$1)l=-ht$1;else if(l>ht$1&&l<1.001*ht$1)l=ht$1;else{if(l<-ht$1)return{x:-1/0,y:-1/0,z:r.z};if(l>ht$1)return{x:1/0,y:1/0,z:r.z}}return a>Math.PI&&(a-=2*Math.PI),d=Math.sin(l),g=Math.cos(l),m=d*d,u=s/Math.sqrt(1-o*m),{x:(u+c)*g*Math.cos(a),y:(u+c)*g*Math.sin(a),z:(u*(1-o)+c)*d}}function YR$2(r,o,s,a){var l=1e-12,c=l*l,u=30,d,m,g,y,_,E,w,T,k,O,R,M,N,D=r.x,P=r.y,I=r.z?r.z:0,L,F,U;if(d=Math.sqrt(D*D+P*P),m=Math.sqrt(D*D+P*P+I*I),d/sc&&Na.y||w>a.x||Od&&Math.abs(m.y)>d);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=_t$2(c.x+s.ll[0]),a.y=c.y+s.ll[1]}else isNaN(c.x)||(a.x=r.x+c.x,a.y=r.y+c.y);return a}function qR$2(r,o){var s={x:r.x/o.del[0],y:r.y/o.del[1]},a={x:Math.floor(s.x),y:Math.floor(s.y)},l={x:s.x-1*a.x,y:s.y-1*a.y},c={x:Number.NaN,y:Number.NaN},u;if(a.x<0||a.x>=o.lim[0]||a.y<0||a.y>=o.lim[1])return c;u=a.y*o.lim[0]+a.x;var d={x:o.cvs[u][0],y:o.cvs[u][1]};u++;var m={x:o.cvs[u][0],y:o.cvs[u][1]};u+=o.lim[0];var g={x:o.cvs[u][0],y:o.cvs[u][1]};u--;var y={x:o.cvs[u][0],y:o.cvs[u][1]},_=l.x*l.y,E=l.x*(1-l.y),w=(1-l.x)*(1-l.y),T=(1-l.x)*l.y;return c.x=w*d.x+E*m.x+T*y.x+_*g.x,c.y=w*d.y+E*m.y+T*y.y+_*g.y,c}function ZR$2(r,o,s){var a=s.x,l=s.y,c=s.z||0,u,d,m,g={};for(m=0;m<3;m++)if(!(o&&m===2&&s.z===void 0))switch(m===0?(u=a,"ew".indexOf(r.axis[m])!==-1?d="x":d="y"):m===1?(u=l,"ns".indexOf(r.axis[m])!==-1?d="y":d="x"):(u=c,d="z"),r.axis[m]){case"e":g[d]=u;break;case"w":g[d]=-u;break;case"n":g[d]=u;break;case"s":g[d]=-u;break;case"u":s[d]!==void 0&&(g.z=u);break;case"d":s[d]!==void 0&&(g.z=-u);break;default:return null}return g}function QR$2(r){var o={x:r[0],y:r[1]};return r.length>2&&(o.z=r[2]),r.length>3&&(o.m=r[3]),o}function KQ(r){KR$2(r.x),KR$2(r.y)}function KR$2(r){if(typeof Number.isFinite=="function"){if(Number.isFinite(r))return;throw new TypeError("coordinates must be finite numbers")}if(typeof r!="number"||r!==r||!isFinite(r))throw new TypeError("coordinates must be finite numbers")}function tK$1(r,o){return(r.datum.datum_type===Hc$2||r.datum.datum_type===Wc$2||r.datum.datum_type===Wh$1)&&o.datumCode!=="WGS84"||(o.datum.datum_type===Hc$2||o.datum.datum_type===Wc$2||o.datum.datum_type===Wh$1)&&r.datumCode!=="WGS84"}function Jg$2(r,o,s,a){var l;Array.isArray(s)?s=QR$2(s):s={x:s.x,y:s.y,z:s.z,m:s.m};var c=s.z!==void 0;if(KQ(s),r.datum&&o.datum&&tK$1(r,o)&&(l=new io$2("WGS84"),s=Jg$2(r,l,s,a),r=l),a&&r.axis!=="enu"&&(s=ZR$2(r,!1,s)),r.projName==="longlat")s={x:s.x*ir$2,y:s.y*ir$2,z:s.z||0};else if(r.to_meter&&(s={x:s.x*r.to_meter,y:s.y*r.to_meter,z:s.z||0}),s=r.inverse(s),!s)return;if(r.from_greenwich&&(s.x+=r.from_greenwich),s=ZQ$1(r.datum,o.datum,s),!!s)return o.from_greenwich&&(s={x:s.x-o.from_greenwich,y:s.y,z:s.z||0}),o.projName==="longlat"?s={x:s.x*eo$2,y:s.y*eo$2,z:s.z||0}:(s=o.forward(s),o.to_meter&&(s={x:s.x/o.to_meter,y:s.y/o.to_meter,z:s.z||0})),a&&o.axis!=="enu"?ZR$2(o,!0,s):(s&&!c&&delete s.z,s)}var tk$3=io$2("WGS84");function NE$2(r,o,s,a){var l,c,u;return Array.isArray(s)?(l=Jg$2(r,o,s,a)||{x:NaN,y:NaN},s.length>2?typeof r.name<"u"&&r.name==="geocent"||typeof o.name<"u"&&o.name==="geocent"?typeof l.z=="number"?[l.x,l.y,l.z].concat(s.slice(3)):[l.x,l.y,s[2]].concat(s.slice(3)):[l.x,l.y].concat(s.slice(2)):[l.x,l.y]):(c=Jg$2(r,o,s,a),u=Object.keys(s),u.length===2||u.forEach(function(d){if(typeof r.name<"u"&&r.name==="geocent"||typeof o.name<"u"&&o.name==="geocent"){if(d==="x"||d==="y"||d==="z")return}else if(d==="x"||d==="y")return;c[d]=s[d]}),c)}function ek$2(r){return r instanceof io$2?r:r.oProj?r.oProj:io$2(r)}function Ue$1(r,o,s){r=ek$2(r);var a=!1,l;return typeof o>"u"?(o=r,r=tk$3,a=!0):(typeof o.x<"u"||Array.isArray(o))&&(s=o,o=r,r=tk$3,a=!0),o=ek$2(o),s?NE$2(r,o,s):(l={forward:function(c,u){return NE$2(r,o,c,u)},inverse:function(c,u){return NE$2(o,r,c,u)}},a&&(l.oProj=o),l)}var nk$2=6,rk$2="AJSAJS",ik$2="AFAFAF",Jh$2=65,Yr$2=73,$i$1=79,Ff$2=86,jf$2=90;const eK$1={forward:sk$2,inverse:nK$1,toPoint:ok$2};function sk$2(r,o){return o=o||5,sK$1(rK$1({lat:r[1],lon:r[0]}),o)}function nK$1(r){var o=CE$2(ck$2(r.toUpperCase()));return o.lat&&o.lon?[o.lon,o.lat,o.lon,o.lat]:[o.left,o.bottom,o.right,o.top]}function ok$2(r){var o=CE$2(ck$2(r.toUpperCase()));return o.lat&&o.lon?[o.lon,o.lat]:[(o.left+o.right)/2,(o.top+o.bottom)/2]}function OE$2(r){return r*(Math.PI/180)}function ak$2(r){return 180*(r/Math.PI)}function rK$1(r){var o=r.lat,s=r.lon,a=6378137,l=.00669438,c=.9996,u,d,m,g,y,_,E,w=OE$2(o),T=OE$2(s),k,O;O=Math.floor((s+180)/6)+1,s===180&&(O=60),o>=56&&o<64&&s>=3&&s<12&&(O=32),o>=72&&o<84&&(s>=0&&s<9?O=31:s>=9&&s<21?O=33:s>=21&&s<33?O=35:s>=33&&s<42&&(O=37)),u=(O-1)*6-180+3,k=OE$2(u),d=l/(1-l),m=a/Math.sqrt(1-l*Math.sin(w)*Math.sin(w)),g=Math.tan(w)*Math.tan(w),y=d*Math.cos(w)*Math.cos(w),_=Math.cos(w)*(T-k),E=a*((1-l/4-3*l*l/64-5*l*l*l/256)*w-(3*l/8+3*l*l/32+45*l*l*l/1024)*Math.sin(2*w)+(15*l*l/256+45*l*l*l/1024)*Math.sin(4*w)-35*l*l*l/3072*Math.sin(6*w));var R=c*m*(_+(1-g+y)*_*_*_/6+(5-18*g+g*g+72*y-58*d)*_*_*_*_*_/120)+5e5,M=c*(E+m*Math.tan(w)*(_*_/2+(5-g+9*y+4*y*y)*_*_*_*_/24+(61-58*g+g*g+600*y-330*d)*_*_*_*_*_*_/720));return o<0&&(M+=1e7),{northing:Math.round(M),easting:Math.round(R),zoneNumber:O,zoneLetter:iK$1(o)}}function CE$2(r){var o=r.northing,s=r.easting,a=r.zoneLetter,l=r.zoneNumber;if(l<0||l>60)return null;var c=.9996,u=6378137,d=.00669438,m,g=(1-Math.sqrt(1-d))/(1+Math.sqrt(1-d)),y,_,E,w,T,k,O,R,M,N=s-5e5,D=o;a<"N"&&(D-=1e7),O=(l-1)*6-180+3,m=d/(1-d),k=D/c,R=k/(u*(1-d/4-3*d*d/64-5*d*d*d/256)),M=R+(3*g/2-27*g*g*g/32)*Math.sin(2*R)+(21*g*g/16-55*g*g*g*g/32)*Math.sin(4*R)+151*g*g*g/96*Math.sin(6*R),y=u/Math.sqrt(1-d*Math.sin(M)*Math.sin(M)),_=Math.tan(M)*Math.tan(M),E=m*Math.cos(M)*Math.cos(M),w=u*(1-d)/Math.pow(1-d*Math.sin(M)*Math.sin(M),1.5),T=N/(y*c);var P=M-y*Math.tan(M)/w*(T*T/2-(5+3*_+10*E-4*E*E-9*m)*T*T*T*T/24+(61+90*_+298*E+45*_*_-252*m-3*E*E)*T*T*T*T*T*T/720);P=ak$2(P);var I=(T-(1+2*_+E)*T*T*T/6+(5-2*E+28*_-3*E*E+8*m+24*_*_)*T*T*T*T*T/120)/Math.cos(M);I=O+ak$2(I);var L;if(r.accuracy){var F=CE$2({northing:r.northing+r.accuracy,easting:r.easting+r.accuracy,zoneLetter:r.zoneLetter,zoneNumber:r.zoneNumber});L={top:F.lat,right:F.lon,bottom:P,left:I}}else L={lat:P,lon:I};return L}function iK$1(r){var o="Z";return 84>=r&&r>=72?o="X":72>r&&r>=64?o="W":64>r&&r>=56?o="V":56>r&&r>=48?o="U":48>r&&r>=40?o="T":40>r&&r>=32?o="S":32>r&&r>=24?o="R":24>r&&r>=16?o="Q":16>r&&r>=8?o="P":8>r&&r>=0?o="N":0>r&&r>=-8?o="M":-8>r&&r>=-16?o="L":-16>r&&r>=-24?o="K":-24>r&&r>=-32?o="J":-32>r&&r>=-40?o="H":-40>r&&r>=-48?o="G":-48>r&&r>=-56?o="F":-56>r&&r>=-64?o="E":-64>r&&r>=-72?o="D":-72>r&&r>=-80&&(o="C"),o}function sK$1(r,o){var s="00000"+r.easting,a="00000"+r.northing;return r.zoneNumber+r.zoneLetter+oK$1(r.easting,r.northing,r.zoneNumber)+s.substr(s.length-5,o)+a.substr(a.length-5,o)}function oK$1(r,o,s){var a=lk$2(s),l=Math.floor(r/1e5),c=Math.floor(o/1e5)%20;return aK$1(l,c,a)}function lk$2(r){var o=r%nk$2;return o===0&&(o=nk$2),o}function aK$1(r,o,s){var a=s-1,l=rk$2.charCodeAt(a),c=ik$2.charCodeAt(a),u=l+r-1,d=c+o,m=!1;u>jf$2&&(u=u-jf$2+Jh$2-1,m=!0),(u===Yr$2||lYr$2||(u>Yr$2||l$i$1||(u>$i$1||l<$i$1)&&m)&&(u++,u===Yr$2&&u++),u>jf$2&&(u=u-jf$2+Jh$2-1),d>Ff$2?(d=d-Ff$2+Jh$2-1,m=!0):m=!1,(d===Yr$2||cYr$2||(d>Yr$2||c$i$1||(d>$i$1||c<$i$1)&&m)&&(d++,d===Yr$2&&d++),d>Ff$2&&(d=d-Ff$2+Jh$2-1);var g=String.fromCharCode(u)+String.fromCharCode(d);return g}function ck$2(r){if(r&&r.length===0)throw"MGRSPoint coverting from nothing";for(var o=r.length,s=null,a="",l,c=0;!/[A-Z]/.test(l=r.charAt(c));){if(c>=2)throw"MGRSPoint bad conversion from: "+r;a+=l,c++}var u=parseInt(a,10);if(c===0||c+3>o)throw"MGRSPoint bad conversion from: "+r;var d=r.charAt(c++);if(d<="A"||d==="B"||d==="Y"||d>="Z"||d==="I"||d==="O")throw"MGRSPoint zone letter "+d+" not handled: "+r;s=r.substring(c,c+=2);for(var m=lk$2(u),g=lK$1(s.charAt(0),m),y=cK$1(s.charAt(1),m);y0&&(k=1e5/Math.pow(10,E),O=r.substring(c,c+E),w=parseFloat(O)*k,R=r.substring(c+E),T=parseFloat(R)*k),M=w+g,N=T+y,{easting:M,northing:N,zoneLetter:d,zoneNumber:u,accuracy:k}}function lK$1(r,o){for(var s=rk$2.charCodeAt(o-1),a=1e5,l=!1;s!==r.charCodeAt(0);){if(s++,s===Yr$2&&s++,s===$i$1&&s++,s>jf$2){if(l)throw"Bad character: "+r;s=Jh$2,l=!0}a+=1e5}return a}function cK$1(r,o){if(r>"V")throw"MGRSPoint given invalid Northing "+r;for(var s=ik$2.charCodeAt(o-1),a=0,l=!1;s!==r.charCodeAt(0);){if(s++,s===Yr$2&&s++,s===$i$1&&s++,s>Ff$2){if(l)throw"Bad character: "+r;s=Jh$2,l=!0}a+=1e5}return a}function uK$1(r){var o;switch(r){case"C":o=11e5;break;case"D":o=2e6;break;case"E":o=28e5;break;case"F":o=37e5;break;case"G":o=46e5;break;case"H":o=55e5;break;case"J":o=64e5;break;case"K":o=73e5;break;case"L":o=82e5;break;case"M":o=91e5;break;case"N":o=0;break;case"P":o=8e5;break;case"Q":o=17e5;break;case"R":o=26e5;break;case"S":o=35e5;break;case"T":o=44e5;break;case"U":o=53e5;break;case"V":o=62e5;break;case"W":o=7e6;break;case"X":o=79e5;break;default:o=-1}if(o>=0)return o;throw"Invalid zone letter: "+r}function qh$1(r,o,s){if(!(this instanceof qh$1))return new qh$1(r,o,s);if(Array.isArray(r))this.x=r[0],this.y=r[1],this.z=r[2]||0;else if(typeof r=="object")this.x=r.x,this.y=r.y,this.z=r.z||0;else if(typeof r=="string"&&typeof o>"u"){var a=r.split(",");this.x=parseFloat(a[0],10),this.y=parseFloat(a[1],10),this.z=parseFloat(a[2],10)||0}else this.x=r,this.y=o,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}qh$1.fromMGRS=function(r){return new qh$1(ok$2(r))},qh$1.prototype.toMGRS=function(r){return sk$2([this.x,this.y],r)};var hK$1=1,pK$1=.25,uk$2=.046875,hk$2=.01953125,pk$2=.01068115234375,dK$1=.75,fK$1=.46875,mK$1=.013020833333333334,yK$1=.007120768229166667,gK$1=.3645833333333333,vK$1=.005696614583333333,bK$1=.3076171875;function RE$2(r){var o=[];o[0]=hK$1-r*(pK$1+r*(uk$2+r*(hk$2+r*pk$2))),o[1]=r*(dK$1-r*(uk$2+r*(hk$2+r*pk$2)));var s=r*r;return o[2]=s*(fK$1-r*(mK$1+r*yK$1)),s*=r,o[3]=s*(gK$1-r*vK$1),o[4]=s*r*bK$1,o}function Zh$2(r,o,s,a){return s*=o,o*=o,a[0]*r-s*(a[1]+o*(a[2]+o*(a[3]+o*a[4])))}var _K$1=20;function kE$2(r,o,s){for(var a=1/(1-o),l=r,c=_K$1;c;--c){var u=Math.sin(l),d=1-o*u*u;if(d=(Zh$2(l,u,Math.cos(l),s)-r)*(d*Math.sqrt(d))*a,l-=d,Math.abs(d)bt$2?Math.tan(s):0,T=Math.pow(w,2),k=Math.pow(T,2);l=1-this.es*Math.pow(d,2),g=g/Math.sqrt(l);var O=Zh$2(s,d,m,this.en);c=this.a*(this.k0*g*(1+y/6*(1-T+_+y/20*(5-18*T+k+14*_-58*T*_+y/42*(61+179*k-k*T-479*T)))))+this.x0,u=this.a*(this.k0*(O-this.ml0+d*a*g/2*(1+y/12*(5-T+9*_+4*E+y/30*(61+k-58*T+270*_-330*T*_+y/56*(1385+543*k-k*T-3111*T))))))+this.y0}else{var R=m*Math.sin(a);if(Math.abs(Math.abs(R)-1)=1){if(R-1>bt$2)return 93;u=0}else u=Math.acos(u);s<0&&(u=-u),u=this.a*this.k0*(u-this.lat0)+this.y0}return r.x=c,r.y=u,r}function EK$1(r){var o,s,a,l,c=(r.x-this.x0)*(1/this.a),u=(r.y-this.y0)*(1/this.a);if(this.es)if(o=this.ml0+u/this.k0,s=kE$2(o,this.es,this.en),Math.abs(s)bt$2?Math.tan(s):0,y=this.ep2*Math.pow(m,2),_=Math.pow(y,2),E=Math.pow(g,2),w=Math.pow(E,2);o=1-this.es*Math.pow(d,2);var T=c*Math.sqrt(o)/this.k0,k=Math.pow(T,2);o=o*g,a=s-o*k/(1-this.es)*.5*(1-k/12*(5+3*E-9*y*E+y-4*_-k/30*(61+90*E-252*y*E+45*w+46*y-k/56*(1385+3633*E+4095*w+1574*w*E)))),l=_t$2(this.long0+T*(1-k/6*(1+2*E+y-k/20*(5+28*E+24*w+8*y*E+6*y-k/42*(61+662*E+1320*w+720*w*E))))/m)}else a=ht$1*Df$2(u),l=0;else{var O=Math.exp(c/this.k0),R=.5*(O-1/O),M=this.lat0+u/this.k0,N=Math.cos(M);o=Math.sqrt((1-Math.pow(N,2))/(1+Math.pow(R,2))),a=Math.asin(o),u<0&&(a=-a),R===0&&N===0?l=0:l=_t$2(Math.atan2(R,N)+this.long0)}return r.x=l,r.y=a,r}var TK$1=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const qg$2={init:wK$1,forward:xK$1,inverse:EK$1,names:TK$1};function dk$2(r){var o=Math.exp(r);return o=(o-1/o)/2,o}function Jr$2(r,o){r=Math.abs(r),o=Math.abs(o);var s=Math.max(r,o),a=Math.min(r,o)/(s||1);return s*Math.sqrt(1+Math.pow(a,2))}function SK$1(r){var o=1+r,s=o-1;return s===0?r:r*Math.log(o)/s}function AK$1(r){var o=Math.abs(r);return o=SK$1(o*(1+o/(Jr$2(1,o)+1))),r<0?-o:o}function LE$2(r,o){for(var s=2*Math.cos(2*o),a=r.length-1,l=r[a],c=0,u;--a>=0;)u=-c+s*l+r[a],c=l,l=u;return o+u*Math.sin(2*o)}function IK$1(r,o){for(var s=2*Math.cos(o),a=r.length-1,l=r[a],c=0,u;--a>=0;)u=-c+s*l+r[a],c=l,l=u;return Math.sin(o)*u}function MK$1(r){var o=Math.exp(r);return o=(o+1/o)/2,o}function fk$2(r,o,s){for(var a=Math.sin(o),l=Math.cos(o),c=dk$2(s),u=MK$1(s),d=2*l*u,m=-2*a*c,g=r.length-1,y=r[g],_=0,E=0,w=0,T,k;--g>=0;)T=E,k=_,E=y,_=w,y=-T+d*E-m*_+r[g],w=-k+m*E+d*_;return d=a*u,m=l*c,[d*y-m*w,d*w+m*y]}function NK$1(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(qg$2.init.apply(this),this.forward=qg$2.forward,this.inverse=qg$2.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var r=this.es/(1+Math.sqrt(1-this.es)),o=r/(2-r),s=o;this.cgb[0]=o*(2+o*(-2/3+o*(-2+o*(116/45+o*(26/45+o*(-2854/675)))))),this.cbg[0]=o*(-2+o*(2/3+o*(4/3+o*(-82/45+o*(32/45+o*(4642/4725)))))),s=s*o,this.cgb[1]=s*(7/3+o*(-8/5+o*(-227/45+o*(2704/315+o*(2323/945))))),this.cbg[1]=s*(5/3+o*(-16/15+o*(-13/9+o*(904/315+o*(-1522/945))))),s=s*o,this.cgb[2]=s*(56/15+o*(-136/35+o*(-1262/105+o*(73814/2835)))),this.cbg[2]=s*(-26/15+o*(34/21+o*(8/5+o*(-12686/2835)))),s=s*o,this.cgb[3]=s*(4279/630+o*(-332/35+o*(-399572/14175))),this.cbg[3]=s*(1237/630+o*(-12/5+o*(-24832/14175))),s=s*o,this.cgb[4]=s*(4174/315+o*(-144838/6237)),this.cbg[4]=s*(-734/315+o*(109598/31185)),s=s*o,this.cgb[5]=s*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(o,2),this.Qn=this.k0/(1+o)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=o*(-.5+o*(2/3+o*(-37/96+o*(1/360+o*(81/512+o*(-96199/604800)))))),this.gtu[0]=o*(.5+o*(-2/3+o*(5/16+o*(41/180+o*(-127/288+o*(7891/37800)))))),this.utg[1]=s*(-1/48+o*(-1/15+o*(437/1440+o*(-46/105+o*(1118711/3870720))))),this.gtu[1]=s*(13/48+o*(-3/5+o*(557/1440+o*(281/630+o*(-1983433/1935360))))),s=s*o,this.utg[2]=s*(-17/480+o*(37/840+o*(209/4480+o*(-5569/90720)))),this.gtu[2]=s*(61/240+o*(-103/140+o*(15061/26880+o*(167603/181440)))),s=s*o,this.utg[3]=s*(-4397/161280+o*(11/504+o*(830251/7257600))),this.gtu[3]=s*(49561/161280+o*(-179/168+o*(6601661/7257600))),s=s*o,this.utg[4]=s*(-4583/161280+o*(108847/3991680)),this.gtu[4]=s*(34729/80640+o*(-3418889/1995840)),s=s*o,this.utg[5]=s*(-20648693/638668800),this.gtu[5]=s*(212378941/319334400);var a=LE$2(this.cbg,this.lat0);this.Zb=-this.Qn*(a+IK$1(this.gtu,2*a))}function OK$1(r){var o=_t$2(r.x-this.long0),s=r.y;s=LE$2(this.cbg,s);var a=Math.sin(s),l=Math.cos(s),c=Math.sin(o),u=Math.cos(o);s=Math.atan2(a,u*l),o=Math.atan2(c*l,Jr$2(a,l*u)),o=AK$1(Math.tan(o));var d=fk$2(this.gtu,2*s,2*o);s=s+d[0],o=o+d[1];var m,g;return Math.abs(o)<=2.623395162778?(m=this.a*(this.Qn*o)+this.x0,g=this.a*(this.Qn*s+this.Zb)+this.y0):(m=1/0,g=1/0),r.x=m,r.y=g,r}function CK$1(r){var o=(r.x-this.x0)*(1/this.a),s=(r.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn,o=o/this.Qn;var a,l;if(Math.abs(o)<=2.623395162778){var c=fk$2(this.utg,2*s,2*o);s=s+c[0],o=o+c[1],o=Math.atan(dk$2(o));var u=Math.sin(s),d=Math.cos(s),m=Math.sin(o),g=Math.cos(o);s=Math.atan2(u*g,Jr$2(m,g*d)),o=Math.atan2(m,g*d),a=_t$2(o+this.long0),l=LE$2(this.cgb,s)}else a=1/0,l=1/0;return r.x=a,r.y=l,r}var RK$1=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Zg$2={init:NK$1,forward:OK$1,inverse:CK$1,names:RK$1};function kK$1(r,o){if(r===void 0){if(r=Math.floor((_t$2(o)+Math.PI)*30/Math.PI)+1,r<0)return 0;if(r>60)return 60}return r}var LK$1="etmerc";function PK$1(){var r=kK$1(this.zone,this.long0);if(r===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(r)-183)*ir$2,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Zg$2.init.apply(this),this.forward=Zg$2.forward,this.inverse=Zg$2.inverse}var DK$1=["Universal Transverse Mercator System","utm"];const GK$1={init:PK$1,names:DK$1,dependsOn:LK$1};function PE$1(r,o){return Math.pow((1-r)/(1+r),o)}var FK$1=20;function jK$1(){var r=Math.sin(this.lat0),o=Math.cos(this.lat0);o*=o,this.rc=Math.sqrt(1-this.es)/(1-this.es*r*r),this.C=Math.sqrt(1+this.es*o*o/(1-this.es)),this.phic0=Math.asin(r/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Te)/(Math.pow(Math.tan(.5*this.lat0+Te),this.C)*PE$1(this.e*r,this.ratexp))}function UK$1(r){var o=r.x,s=r.y;return r.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+Te),this.C)*PE$1(this.e*Math.sin(s),this.ratexp))-ht$1,r.x=this.C*o,r}function $K$1(r){for(var o=1e-14,s=r.x/this.C,a=r.y,l=Math.pow(Math.tan(.5*a+Te)/this.K,1/this.C),c=FK$1;c>0&&(a=2*Math.atan(l*PE$1(this.e*Math.sin(r.y),-.5*this.e))-ht$1,!(Math.abs(a-r.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=bt$2&&Math.abs(Math.cos(this.lat_ts))>bt$2&&(this.k0=.5*this.cons*ro$2(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/bs$2(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=ro$2(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-ht$1,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function qK$1(r){var o=r.x,s=r.y,a=Math.sin(s),l=Math.cos(s),c,u,d,m,g,y,_=_t$2(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=bt$2&&Math.abs(s+this.lat0)<=bt$2?(r.x=NaN,r.y=NaN,r):this.sphere?(c=2*this.k0/(1+this.sinlat0*a+this.coslat0*l*Math.cos(_)),r.x=this.a*c*l*Math.sin(_)+this.x0,r.y=this.a*c*(this.coslat0*a-this.sinlat0*l*Math.cos(_))+this.y0,r):(u=2*Math.atan(this.ssfn_(s,a,this.e))-ht$1,m=Math.cos(u),d=Math.sin(u),Math.abs(this.coslat0)<=bt$2?(g=bs$2(this.e,s*this.con,this.con*a),y=2*this.a*this.k0*g/this.cons,r.x=this.x0+y*Math.sin(o-this.long0),r.y=this.y0-this.con*y*Math.cos(o-this.long0),r):(Math.abs(this.sinlat0)0?o=_t$2(this.long0+Math.atan2(r.x,-1*r.y)):o=_t$2(this.long0+Math.atan2(r.x,r.y)):o=_t$2(this.long0+Math.atan2(r.x*Math.sin(d),u*this.coslat0*Math.cos(d)-r.y*this.sinlat0*Math.sin(d))),r.x=o,r.y=s,r)}else if(Math.abs(this.coslat0)<=bt$2){if(u<=bt$2)return s=this.lat0,o=this.long0,r.x=o,r.y=s,r;r.x*=this.con,r.y*=this.con,a=u*this.cons/(2*this.a*this.k0),s=this.con*Gf$2(this.e,a),o=this.con*_t$2(this.con*this.long0+Math.atan2(r.x,-1*r.y))}else l=2*Math.atan(u*this.cosX0/(2*this.a*this.k0*this.ms1)),o=this.long0,u<=bt$2?c=this.X0:(c=Math.asin(Math.cos(l)*this.sinX0+r.y*Math.sin(l)*this.cosX0/u),o=_t$2(this.long0+Math.atan2(r.x*Math.sin(l),u*this.cosX0*Math.cos(l)-r.y*this.sinX0*Math.sin(l)))),s=-1*Gf$2(this.e,Math.tan(.5*(ht$1+c)));return r.x=o,r.y=s,r}var QK$1=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const KK$1={init:JK$1,forward:qK$1,inverse:ZK$1,names:QK$1,ssfn_:YK$1};function ttt(){var r=this.lat0;this.lambda0=this.long0;var o=Math.sin(r),s=this.a,a=this.rf,l=1/a,c=2*l-Math.pow(l,2),u=this.e=Math.sqrt(c);this.R=this.k0*s*Math.sqrt(1-c)/(1-c*Math.pow(o,2)),this.alpha=Math.sqrt(1+c/(1-c)*Math.pow(Math.cos(r),4)),this.b0=Math.asin(o/this.alpha);var d=Math.log(Math.tan(Math.PI/4+this.b0/2)),m=Math.log(Math.tan(Math.PI/4+r/2)),g=Math.log((1+u*o)/(1-u*o));this.K=d-this.alpha*m+this.alpha*u/2*g}function ett(r){var o=Math.log(Math.tan(Math.PI/4-r.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(r.y))/(1-this.e*Math.sin(r.y))),a=-this.alpha*(o+s)+this.K,l=2*(Math.atan(Math.exp(a))-Math.PI/4),c=this.alpha*(r.x-this.lambda0),u=Math.atan(Math.sin(c)/(Math.sin(this.b0)*Math.tan(l)+Math.cos(this.b0)*Math.cos(c))),d=Math.asin(Math.cos(this.b0)*Math.sin(l)-Math.sin(this.b0)*Math.cos(l)*Math.cos(c));return r.y=this.R/2*Math.log((1+Math.sin(d))/(1-Math.sin(d)))+this.y0,r.x=this.R*u+this.x0,r}function ntt(r){for(var o=r.x-this.x0,s=r.y-this.y0,a=o/this.R,l=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4),c=Math.asin(Math.cos(this.b0)*Math.sin(l)+Math.sin(this.b0)*Math.cos(l)*Math.cos(a)),u=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(l))),d=this.lambda0+u/this.alpha,m=0,g=c,y=-1e3,_=0;Math.abs(g-y)>1e-7;){if(++_>20)return;m=1/this.alpha*(Math.log(Math.tan(Math.PI/4+c/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(g))/2)),y=g,g=2*Math.atan(Math.exp(m))-Math.PI/2}return r.x=d,r.y=g,r}var rtt=["somerc"];const itt={init:ttt,forward:ett,inverse:ntt,names:rtt};var Qh$2=1e-7;function stt(r){var o=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],s=typeof r.PROJECTION=="object"?Object.keys(r.PROJECTION)[0]:r.PROJECTION;return"no_uoff"in r||"no_off"in r||o.indexOf(s)!==-1}function ott(){var r,o,s,a,l,c,u,d,m,g,y=0,_,E=0,w=0,T=0,k=0,O=0,R=0;this.no_off=stt(this),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var N=!1;if("rectified_grid_angle"in this&&(N=!0),M&&(R=this.alpha),N&&(y=this.rectified_grid_angle*ir$2),M||N)E=this.longc;else if(w=this.long1,k=this.lat1,T=this.long2,O=this.lat2,Math.abs(k-O)<=Qh$2||(r=Math.abs(k))<=Qh$2||Math.abs(r-ht$1)<=Qh$2||Math.abs(Math.abs(this.lat0)-ht$1)<=Qh$2||Math.abs(Math.abs(O)-ht$1)<=Qh$2)throw new Error;var D=1-this.es;o=Math.sqrt(D),Math.abs(this.lat0)>bt$2?(d=Math.sin(this.lat0),s=Math.cos(this.lat0),r=1-this.es*d*d,this.B=s*s,this.B=Math.sqrt(1+this.es*this.B*this.B/D),this.A=this.B*this.k0*o/r,a=this.B*o/(s*Math.sqrt(r)),l=a*a-1,l<=0?l=0:(l=Math.sqrt(l),this.lat0<0&&(l=-l)),this.E=l+=a,this.E*=Math.pow(bs$2(this.e,this.lat0,d),this.B)):(this.B=1/o,this.A=this.k0,this.E=a=l=1),M||N?(M?(_=Math.asin(Math.sin(R)/a),N||(y=R)):(_=y,R=Math.asin(a*Math.sin(_))),this.lam0=E-Math.asin(.5*(l-1/l)*Math.tan(_))/this.B):(c=Math.pow(bs$2(this.e,k,Math.sin(k)),this.B),u=Math.pow(bs$2(this.e,O,Math.sin(O)),this.B),l=this.E/c,m=(u-c)/(u+c),g=this.E*this.E,g=(g-u*c)/(g+u*c),r=w-T,r<-Math.pi?T-=Lf$2:r>Math.pi&&(T+=Lf$2),this.lam0=_t$2(.5*(w+T)-Math.atan(g*Math.tan(.5*this.B*(w-T))/m)/this.B),_=Math.atan(2*Math.sin(this.B*_t$2(w-this.lam0))/(l-1/l)),y=R=Math.asin(a*Math.sin(_))),this.singam=Math.sin(_),this.cosgam=Math.cos(_),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(a*a-1)/Math.cos(R))),this.lat0<0&&(this.u_0=-this.u_0)),l=.5*_,this.v_pole_n=this.ArB*Math.log(Math.tan(Te-l)),this.v_pole_s=this.ArB*Math.log(Math.tan(Te+l))}function att(r){var o={},s,a,l,c,u,d,m,g;if(r.x=r.x-this.lam0,Math.abs(Math.abs(r.y)-ht$1)>bt$2){if(u=this.E/Math.pow(bs$2(this.e,r.y,Math.sin(r.y)),this.B),d=1/u,s=.5*(u-d),a=.5*(u+d),c=Math.sin(this.B*r.x),l=(s*this.singam-c*this.cosgam)/a,Math.abs(Math.abs(l)-1)0?this.v_pole_n:this.v_pole_s,m=this.ArB*r.y;return this.no_rot?(o.x=m,o.y=g):(m-=this.u_0,o.x=g*this.cosrot+m*this.sinrot,o.y=m*this.cosrot-g*this.sinrot),o.x=this.a*o.x+this.x0,o.y=this.a*o.y+this.y0,o}function ltt(r){var o,s,a,l,c,u,d,m={};if(r.x=(r.x-this.x0)*(1/this.a),r.y=(r.y-this.y0)*(1/this.a),this.no_rot?(s=r.y,o=r.x):(s=r.x*this.cosrot-r.y*this.sinrot,o=r.y*this.cosrot+r.x*this.sinrot+this.u_0),a=Math.exp(-this.BrA*s),l=.5*(a-1/a),c=.5*(a+1/a),u=Math.sin(this.BrA*o),d=(u*this.cosgam+l*this.singam)/c,Math.abs(Math.abs(d)-1)bt$2?this.ns=Math.log(a/d)/Math.log(l/m):this.ns=o,isNaN(this.ns)&&(this.ns=o),this.f0=a/(this.ns*Math.pow(l,this.ns)),this.rh=this.a*this.f0*Math.pow(g,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function ptt(r){var o=r.x,s=r.y;Math.abs(2*Math.abs(s)-Math.PI)<=bt$2&&(s=Df$2(s)*(ht$1-2*bt$2));var a=Math.abs(Math.abs(s)-ht$1),l,c;if(a>bt$2)l=bs$2(this.e,s,Math.sin(s)),c=this.a*this.f0*Math.pow(l,this.ns);else{if(a=s*this.ns,a<=0)return null;c=0}var u=this.ns*_t$2(o-this.long0);return r.x=this.k0*(c*Math.sin(u))+this.x0,r.y=this.k0*(this.rh-c*Math.cos(u))+this.y0,r}function dtt(r){var o,s,a,l,c,u=(r.x-this.x0)/this.k0,d=this.rh-(r.y-this.y0)/this.k0;this.ns>0?(o=Math.sqrt(u*u+d*d),s=1):(o=-Math.sqrt(u*u+d*d),s=-1);var m=0;if(o!==0&&(m=Math.atan2(s*u,s*d)),o!==0||this.ns>0){if(s=1/this.ns,a=Math.pow(o/(this.a*this.f0),s),l=Gf$2(this.e,a),l===-9999)return null}else l=-ht$1;return c=_t$2(m/this.ns+this.long0),r.x=c,r.y=l,r}var ftt=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const mtt={init:htt,forward:ptt,inverse:dtt,names:ftt};function ytt(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function gtt(r){var o,s,a,l,c,u,d,m=r.x,g=r.y,y=_t$2(m-this.long0);return o=Math.pow((1+this.e*Math.sin(g))/(1-this.e*Math.sin(g)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(g/2+this.s45),this.alfa)/o)-this.s45),a=-y*this.alfa,l=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),c=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(l)),u=this.n*c,d=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(l/2+this.s45),this.n),r.y=d*Math.cos(u)/1,r.x=d*Math.sin(u)/1,this.czech||(r.y*=-1,r.x*=-1),r}function vtt(r){var o,s,a,l,c,u,d,m,g=r.x;r.x=r.y,r.y=g,this.czech||(r.y*=-1,r.x*=-1),u=Math.sqrt(r.x*r.x+r.y*r.y),c=Math.atan2(r.y,r.x),l=c/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/u,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),o=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(l)),s=Math.asin(Math.cos(a)*Math.sin(l)/Math.cos(o)),r.x=this.long0-s/this.alfa,d=o,m=0;var y=0;do r.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(o/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(d))/(1-this.e*Math.sin(d)),this.e/2))-this.s45),Math.abs(d-r.y)<1e-10&&(m=1),d=r.y,y+=1;while(m===0&&y<15);return y>=15?null:r}var btt=["Krovak","krovak"];const _tt={init:ytt,forward:gtt,inverse:vtt,names:btt};function Cr$2(r,o,s,a,l){return r*l-o*Math.sin(2*l)+s*Math.sin(4*l)-a*Math.sin(6*l)}function Uf$2(r){return 1-.25*r*(1+r/16*(3+1.25*r))}function $f$2(r){return .375*r*(1+.25*r*(1+.46875*r))}function Bf$2(r){return .05859375*r*r*(1+.75*r)}function Vf$2(r){return r*r*r*(35/3072)}function Kh$2(r,o,s){var a=o*s;return r/Math.sqrt(1-a*a)}function cl$2(r){return Math.abs(r)1e-7?(s=r*o,(1-r*r)*(o/(1-s*s)-.5/r*Math.log((1-s)/(1+s)))):2*o}var Att=1,Itt=2,Mtt=3,Ntt=4;function Ott(){var r=Math.abs(this.lat0);if(Math.abs(r-ht$1)0){var o;switch(this.qp=ul$2(this.e,1),this.mmf=.5/(1-this.es),this.apa=jtt(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),o=Math.sin(this.lat0),this.sinb1=ul$2(this.e,o)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*o*o)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Ctt(r){var o,s,a,l,c,u,d,m,g,y,_=r.x,E=r.y;if(_=_t$2(_-this.long0),this.sphere){if(c=Math.sin(E),y=Math.cos(E),a=Math.cos(_),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(s=this.mode===this.EQUIT?1+y*a:1+this.sinph0*c+this.cosph0*y*a,s<=bt$2)return null;s=Math.sqrt(2/s),o=s*y*Math.sin(_),s*=this.mode===this.EQUIT?c:this.cosph0*c-this.sinph0*y*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(E+this.lat0)=0?(o=(g=Math.sqrt(u))*l,s=a*(this.mode===this.S_POLE?g:-g)):o=s=0;break}}return r.x=this.a*o+this.x0,r.y=this.a*s+this.y0,r}function Rtt(r){r.x-=this.x0,r.y-=this.y0;var o=r.x/this.a,s=r.y/this.a,a,l,c,u,d,m,g;if(this.sphere){var y=0,_,E=0;if(_=Math.sqrt(o*o+s*s),l=_*.5,l>1)return null;switch(l=2*Math.asin(l),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(E=Math.sin(l),y=Math.cos(l)),this.mode){case this.EQUIT:l=Math.abs(_)<=bt$2?0:Math.asin(s*E/_),o*=E,s=y*_;break;case this.OBLIQ:l=Math.abs(_)<=bt$2?this.lat0:Math.asin(y*this.sinph0+s*E*this.cosph0/_),o*=E*this.cosph0,s=(y-Math.sin(l)*this.sinph0)*_;break;case this.N_POLE:s=-s,l=ht$1-l;break;case this.S_POLE:l-=ht$1;break}a=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(o,s)}else{if(g=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(o/=this.dd,s*=this.dd,m=Math.sqrt(o*o+s*s),m1&&(r=r>1?1:-1),Math.asin(r)}function Vtt(){Math.abs(this.lat1+this.lat2)bt$2?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function ztt(r){var o=r.x,s=r.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var a=ul$2(this.e3,this.sin_phi),l=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,c=this.ns0*_t$2(o-this.long0),u=l*Math.sin(c)+this.x0,d=this.rh-l*Math.cos(c)+this.y0;return r.x=u,r.y=d,r}function Htt(r){var o,s,a,l,c,u;return r.x-=this.x0,r.y=this.rh-r.y+this.y0,this.ns0>=0?(o=Math.sqrt(r.x*r.x+r.y*r.y),a=1):(o=-Math.sqrt(r.x*r.x+r.y*r.y),a=-1),l=0,o!==0&&(l=Math.atan2(a*r.x,a*r.y)),a=o*this.ns0/this.a,this.sphere?u=Math.asin((this.c-a*a)/(2*this.ns0)):(s=(this.c-a*a)/this.ns0,u=this.phi1z(this.e3,s)),c=_t$2(l/this.ns0+this.long0),r.x=c,r.y=u,r}function Wtt(r,o){var s,a,l,c,u,d=hl$2(.5*o);if(r0||Math.abs(u)<=bt$2?(d=this.x0+this.a*c*s*Math.sin(a)/u,m=this.y0+this.a*c*(this.cos_p14*o-this.sin_p14*s*l)/u):(d=this.x0+this.infinity_dist*s*Math.sin(a),m=this.y0+this.infinity_dist*(this.cos_p14*o-this.sin_p14*s*l)),r.x=d,r.y=m,r}function Ztt(r){var o,s,a,l,c,u;return r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,(o=Math.sqrt(r.x*r.x+r.y*r.y))?(l=Math.atan2(o,this.rc),s=Math.sin(l),a=Math.cos(l),u=hl$2(a*this.sin_p14+r.y*s*this.cos_p14/o),c=Math.atan2(r.x*s,o*this.cos_p14*a-r.y*this.sin_p14*s),c=_t$2(this.long0+c)):(u=this.phic0,c=0),r.x=c,r.y=u,r}var Qtt=["gnom"];const Ktt={init:Jtt,forward:qtt,inverse:Ztt,names:Qtt};function tet(r,o){var s=1-(1-r*r)/(2*r)*Math.log((1-r)/(1+r));if(Math.abs(Math.abs(o)-s)<1e-6)return o<0?-1*ht$1:ht$1;for(var a=Math.asin(.5*o),l,c,u,d,m=0;m<30;m++)if(c=Math.sin(a),u=Math.cos(a),d=r*c,l=Math.pow(1-d*d,2)/(2*u)*(o/(1-r*r)-c/(1-d*d)+.5/r*Math.log((1-d)/(1+d))),a+=l,Math.abs(l)<=1e-10)return a;return NaN}function eet(){this.sphere||(this.k0=ro$2(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function net(r){var o=r.x,s=r.y,a,l,c=_t$2(o-this.long0);if(this.sphere)a=this.x0+this.a*c*Math.cos(this.lat_ts),l=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var u=ul$2(this.e,Math.sin(s));a=this.x0+this.a*this.k0*c,l=this.y0+this.a*u*.5/this.k0}return r.x=a,r.y=l,r}function ret(r){r.x-=this.x0,r.y-=this.y0;var o,s;return this.sphere?(o=_t$2(this.long0+r.x/this.a/Math.cos(this.lat_ts)),s=Math.asin(r.y/this.a*Math.cos(this.lat_ts))):(s=tet(this.e,2*r.y*this.k0/this.a),o=_t$2(this.long0+r.x/(this.a*this.k0))),r.x=o,r.y=s,r}var iet=["cea"];const set={init:eet,forward:net,inverse:ret,names:iet};function oet(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function aet(r){var o=r.x,s=r.y,a=_t$2(o-this.long0),l=cl$2(s-this.lat0);return r.x=this.x0+this.a*a*this.rc,r.y=this.y0+this.a*l,r}function cet(r){var o=r.x,s=r.y;return r.x=_t$2(this.long0+(o-this.x0)/(this.a*this.rc)),r.y=cl$2(this.lat0+(s-this.y0)/this.a),r}var uet=["Equirectangular","Equidistant_Cylindrical","eqc"];const het={init:oet,forward:aet,inverse:cet,names:uet};var mk$2=20;function pet(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Uf$2(this.es),this.e1=$f$2(this.es),this.e2=Bf$2(this.es),this.e3=Vf$2(this.es),this.ml0=this.a*Cr$2(this.e0,this.e1,this.e2,this.e3,this.lat0)}function det(r){var o=r.x,s=r.y,a,l,c,u=_t$2(o-this.long0);if(c=u*Math.sin(s),this.sphere)Math.abs(s)<=bt$2?(a=this.a*u,l=-1*this.a*this.lat0):(a=this.a*Math.sin(c)/Math.tan(s),l=this.a*(cl$2(s-this.lat0)+(1-Math.cos(c))/Math.tan(s)));else if(Math.abs(s)<=bt$2)a=this.a*u,l=-1*this.ml0;else{var d=Kh$2(this.a,this.e,Math.sin(s))/Math.tan(s);a=d*Math.sin(c),l=this.a*Cr$2(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+d*(1-Math.cos(c))}return r.x=a+this.x0,r.y=l+this.y0,r}function fet(r){var o,s,a,l,c,u,d,m,g;if(a=r.x-this.x0,l=r.y-this.y0,this.sphere)if(Math.abs(l+this.a*this.lat0)<=bt$2)o=_t$2(a/this.a+this.long0),s=0;else{u=this.lat0+l/this.a,d=a*a/this.a/this.a+u*u,m=u;var y;for(c=mk$2;c;--c)if(y=Math.tan(m),g=-1*(u*(m*y+1)-m-.5*(m*m+d)*y)/((m-u)/y-1),m+=g,Math.abs(g)<=bt$2){s=m;break}o=_t$2(this.long0+Math.asin(a*Math.tan(m)/this.a)/Math.sin(s))}else if(Math.abs(l+this.ml0)<=bt$2)s=0,o=_t$2(this.long0+a/this.a);else{u=(this.ml0+l)/this.a,d=a*a/this.a/this.a+u*u,m=u;var _,E,w,T,k;for(c=mk$2;c;--c)if(k=this.e*Math.sin(m),_=Math.sqrt(1-k*k)*Math.tan(m),E=this.a*Cr$2(this.e0,this.e1,this.e2,this.e3,m),w=this.e0-2*this.e1*Math.cos(2*m)+4*this.e2*Math.cos(4*m)-6*this.e3*Math.cos(6*m),T=E/this.a,g=(u*(_*T+1)-T-.5*_*(T*T+d))/(this.es*Math.sin(2*m)*(T*T+d-2*u*T)/(4*_)+(u-T)*(_*w-2/Math.sin(2*m))-w),m-=g,Math.abs(g)<=bt$2){s=m;break}_=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),o=_t$2(this.long0+Math.asin(a*_/this.a)/Math.sin(s))}return r.x=o,r.y=s,r}var met=["Polyconic","poly"];const yet={init:pet,forward:det,inverse:fet,names:met};function get(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function vet(r){var o,s=r.x,a=r.y,l=a-this.lat0,c=s-this.long0,u=l/kf$2*1e-5,d=c,m=1,g=0;for(o=1;o<=10;o++)m=m*u,g=g+this.A[o]*m;var y=g,_=d,E=1,w=0,T,k,O=0,R=0;for(o=1;o<=6;o++)T=E*y-w*_,k=w*y+E*_,E=T,w=k,O=O+this.B_re[o]*E-this.B_im[o]*w,R=R+this.B_im[o]*E+this.B_re[o]*w;return r.x=R*this.a+this.x0,r.y=O*this.a+this.y0,r}function bet(r){var o,s=r.x,a=r.y,l=s-this.x0,c=a-this.y0,u=c/this.a,d=l/this.a,m=1,g=0,y,_,E=0,w=0;for(o=1;o<=6;o++)y=m*u-g*d,_=g*u+m*d,m=y,g=_,E=E+this.C_re[o]*m-this.C_im[o]*g,w=w+this.C_im[o]*m+this.C_re[o]*g;for(var T=0;T.999999999999&&(s=.999999999999),o=Math.asin(s);var a=_t$2(this.long0+r.x/(.900316316158*this.a*Math.cos(o)));a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),s=(2*o+Math.sin(2*o))/Math.PI,Math.abs(s)>1&&(s=1);var l=Math.asin(s);return r.x=a,r.y=l,r}var Get=["Mollweide","moll"];const Fet={init:Let,forward:Pet,inverse:Det,names:Get};function jet(){Math.abs(this.lat1+this.lat2)=0?(s=Math.sqrt(r.x*r.x+r.y*r.y),o=1):(s=-Math.sqrt(r.x*r.x+r.y*r.y),o=-1);var c=0;if(s!==0&&(c=Math.atan2(o*r.x,o*r.y)),this.sphere)return l=_t$2(this.long0+c/this.ns),a=cl$2(this.g-s/this.a),r.x=l,r.y=a,r;var u=this.g-s/this.a;return a=Qg$2(u,this.e0,this.e1,this.e2,this.e3),l=_t$2(this.long0+c/this.ns),r.x=l,r.y=a,r}var Bet=["Equidistant_Conic","eqdc"];const Vet={init:jet,forward:Uet,inverse:$et,names:Bet};function zet(){this.R=this.a}function Het(r){var o=r.x,s=r.y,a=_t$2(o-this.long0),l,c;Math.abs(s)<=bt$2&&(l=this.x0+this.R*a,c=this.y0);var u=hl$2(2*Math.abs(s/Math.PI));(Math.abs(a)<=bt$2||Math.abs(Math.abs(s)-ht$1)<=bt$2)&&(l=this.x0,s>=0?c=this.y0+Math.PI*this.R*Math.tan(.5*u):c=this.y0+Math.PI*this.R*-Math.tan(.5*u));var d=.5*Math.abs(Math.PI/a-a/Math.PI),m=d*d,g=Math.sin(u),y=Math.cos(u),_=y/(g+y-1),E=_*_,w=_*(2/g-1),T=w*w,k=Math.PI*this.R*(d*(_-T)+Math.sqrt(m*(_-T)*(_-T)-(T+m)*(E-T)))/(T+m);a<0&&(k=-k),l=this.x0+k;var O=m+_;return k=Math.PI*this.R*(w*O-d*Math.sqrt((T+m)*(m+1)-O*O))/(T+m),s>=0?c=this.y0+k:c=this.y0-k,r.x=l,r.y=c,r}function Wet(r){var o,s,a,l,c,u,d,m,g,y,_,E,w;return r.x-=this.x0,r.y-=this.y0,_=Math.PI*this.R,a=r.x/_,l=r.y/_,c=a*a+l*l,u=-Math.abs(l)*(1+c),d=u-2*l*l+a*a,m=-2*u+1+2*l*l+c*c,w=l*l/m+(2*d*d*d/m/m/m-9*u*d/m/m)/27,g=(u-d*d/3/m)/m,y=2*Math.sqrt(-g/3),_=3*w/g/y,Math.abs(_)>1&&(_>=0?_=1:_=-1),E=Math.acos(_)/3,r.y>=0?s=(-y*Math.cos(E+Math.PI/3)-d/3/m)*Math.PI:s=-(-y*Math.cos(E+Math.PI/3)-d/3/m)*Math.PI,Math.abs(a)2*ht$1*this.a?void 0:(s=o/this.a,a=Math.sin(s),l=Math.cos(s),c=this.long0,Math.abs(o)<=bt$2?u=this.lat0:(u=hl$2(l*this.sin_p12+r.y*a*this.cos_p12/o),d=Math.abs(this.lat0)-ht$1,Math.abs(d)<=bt$2?this.lat0>=0?c=_t$2(this.long0+Math.atan2(r.x,-r.y)):c=_t$2(this.long0-Math.atan2(-r.x,r.y)):c=_t$2(this.long0+Math.atan2(r.x*a,o*this.cos_p12*l-r.y*this.sin_p12*a))),r.x=c,r.y=u,r)):(m=Uf$2(this.es),g=$f$2(this.es),y=Bf$2(this.es),_=Vf$2(this.es),Math.abs(this.sin_p12-1)<=bt$2?(E=this.a*Cr$2(m,g,y,_,ht$1),o=Math.sqrt(r.x*r.x+r.y*r.y),w=E-o,u=Qg$2(w/this.a,m,g,y,_),c=_t$2(this.long0+Math.atan2(r.x,-1*r.y)),r.x=c,r.y=u,r):Math.abs(this.sin_p12+1)<=bt$2?(E=this.a*Cr$2(m,g,y,_,ht$1),o=Math.sqrt(r.x*r.x+r.y*r.y),w=o-E,u=Qg$2(w/this.a,m,g,y,_),c=_t$2(this.long0+Math.atan2(r.x,r.y)),r.x=c,r.y=u,r):(o=Math.sqrt(r.x*r.x+r.y*r.y),O=Math.atan2(r.x,r.y),T=Kh$2(this.a,this.e,this.sin_p12),R=Math.cos(O),M=this.e*this.cos_p12*R,N=-M*M/(1-this.es),D=3*this.es*(1-N)*this.sin_p12*this.cos_p12*R/(1-this.es),P=o/T,I=P-N*(1+N)*Math.pow(P,3)/6-D*(1+3*N)*Math.pow(P,4)/24,L=1-N*I*I/2-P*I*I*I/6,k=Math.asin(this.sin_p12*Math.cos(I)+this.cos_p12*Math.sin(I)*R),c=_t$2(this.long0+Math.asin(Math.sin(O)*Math.sin(I)/Math.cos(k))),F=Math.sin(k),u=Math.atan2((F-this.es*L*this.sin_p12)*Math.tan(k),F*(1-this.es)),r.x=c,r.y=u,r))}var Qet=["Azimuthal_Equidistant","aeqd"];const Ket={init:Jet,forward:qet,inverse:Zet,names:Qet};function tnt(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function ent(r){var o,s,a,l,c,u,d,m,g=r.x,y=r.y;return a=_t$2(g-this.long0),o=Math.sin(y),s=Math.cos(y),l=Math.cos(a),u=this.sin_p14*o+this.cos_p14*s*l,c=1,(u>0||Math.abs(u)<=bt$2)&&(d=this.a*c*s*Math.sin(a),m=this.y0+this.a*c*(this.cos_p14*o-this.sin_p14*s*l)),r.x=d,r.y=m,r}function nnt(r){var o,s,a,l,c,u,d;return r.x-=this.x0,r.y-=this.y0,o=Math.sqrt(r.x*r.x+r.y*r.y),s=hl$2(o/this.a),a=Math.sin(s),l=Math.cos(s),u=this.long0,Math.abs(o)<=bt$2?(d=this.lat0,r.x=u,r.y=d,r):(d=hl$2(l*this.sin_p14+r.y*a*this.cos_p14/o),c=Math.abs(this.lat0)-ht$1,Math.abs(c)<=bt$2?(this.lat0>=0?u=_t$2(this.long0+Math.atan2(r.x,-r.y)):u=_t$2(this.long0-Math.atan2(-r.x,r.y)),r.x=u,r.y=d,r):(u=_t$2(this.long0+Math.atan2(r.x*a,o*this.cos_p14*l-r.y*this.sin_p14*a)),r.x=u,r.y=d,r))}var rnt=["ortho"];const int$1={init:tnt,forward:ent,inverse:nnt,names:rnt};var on$2={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Se$1={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function snt(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=ht$1-Te/2?this.face=on$2.TOP:this.lat0<=-(ht$1-Te/2)?this.face=on$2.BOTTOM:Math.abs(this.long0)<=Te?this.face=on$2.FRONT:Math.abs(this.long0)<=ht$1+Te?this.face=this.long0>0?on$2.RIGHT:on$2.LEFT:this.face=on$2.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function ont(r){var o={x:0,y:0},s,a,l,c,u,d,m={value:0};if(r.x-=this.long0,this.es!==0?s=Math.atan(this.one_minus_f_squared*Math.tan(r.y)):s=r.y,a=r.x,this.face===on$2.TOP)c=ht$1-s,a>=Te&&a<=ht$1+Te?(m.value=Se$1.AREA_0,l=a-ht$1):a>ht$1+Te||a<=-(ht$1+Te)?(m.value=Se$1.AREA_1,l=a>0?a-En$2:a+En$2):a>-(ht$1+Te)&&a<=-Te?(m.value=Se$1.AREA_2,l=a+ht$1):(m.value=Se$1.AREA_3,l=a);else if(this.face===on$2.BOTTOM)c=ht$1+s,a>=Te&&a<=ht$1+Te?(m.value=Se$1.AREA_0,l=-a+ht$1):a=-Te?(m.value=Se$1.AREA_1,l=-a):a<-Te&&a>=-(ht$1+Te)?(m.value=Se$1.AREA_2,l=-a-ht$1):(m.value=Se$1.AREA_3,l=a>0?-a+En$2:-a-En$2);else{var g,y,_,E,w,T,k;this.face===on$2.RIGHT?a=tp$2(a,+ht$1):this.face===on$2.BACK?a=tp$2(a,+En$2):this.face===on$2.LEFT&&(a=tp$2(a,-ht$1)),E=Math.sin(s),w=Math.cos(s),T=Math.sin(a),k=Math.cos(a),g=w*k,y=w*T,_=E,this.face===on$2.FRONT?(c=Math.acos(g),l=Kg$2(c,_,y,m)):this.face===on$2.RIGHT?(c=Math.acos(y),l=Kg$2(c,_,-g,m)):this.face===on$2.BACK?(c=Math.acos(-g),l=Kg$2(c,_,-y,m)):this.face===on$2.LEFT?(c=Math.acos(-y),l=Kg$2(c,_,g,m)):(c=l=0,m.value=Se$1.AREA_0)}return d=Math.atan(12/En$2*(l+Math.acos(Math.sin(l)*Math.cos(Te))-ht$1)),u=Math.sqrt((1-Math.cos(c))/(Math.cos(d)*Math.cos(d))/(1-Math.cos(Math.atan(1/Math.cos(l))))),m.value===Se$1.AREA_1?d+=ht$1:m.value===Se$1.AREA_2?d+=En$2:m.value===Se$1.AREA_3&&(d+=1.5*En$2),o.x=u*Math.cos(d),o.y=u*Math.sin(d),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,r.x=o.x,r.y=o.y,r}function ant(r){var o={lam:0,phi:0},s,a,l,c,u,d,m,g,y,_={value:0};if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,a=Math.atan(Math.sqrt(r.x*r.x+r.y*r.y)),s=Math.atan2(r.y,r.x),r.x>=0&&r.x>=Math.abs(r.y)?_.value=Se$1.AREA_0:r.y>=0&&r.y>=Math.abs(r.x)?(_.value=Se$1.AREA_1,s-=ht$1):r.x<0&&-r.x>=Math.abs(r.y)?(_.value=Se$1.AREA_2,s=s<0?s+En$2:s-En$2):(_.value=Se$1.AREA_3,s+=ht$1),y=En$2/12*Math.tan(s),u=Math.sin(y)/(Math.cos(y)-1/Math.sqrt(2)),d=Math.atan(u),l=Math.cos(s),c=Math.tan(a),m=1-l*l*c*c*(1-Math.cos(Math.atan(1/Math.cos(d)))),m<-1?m=-1:m>1&&(m=1),this.face===on$2.TOP)g=Math.acos(m),o.phi=ht$1-g,_.value===Se$1.AREA_0?o.lam=d+ht$1:_.value===Se$1.AREA_1?o.lam=d<0?d+En$2:d-En$2:_.value===Se$1.AREA_2?o.lam=d-ht$1:o.lam=d;else if(this.face===on$2.BOTTOM)g=Math.acos(m),o.phi=g-ht$1,_.value===Se$1.AREA_0?o.lam=-d+ht$1:_.value===Se$1.AREA_1?o.lam=-d:_.value===Se$1.AREA_2?o.lam=-d-ht$1:o.lam=d<0?-d-En$2:-d+En$2;else{var E,w,T;E=m,y=E*E,y>=1?T=0:T=Math.sqrt(1-y)*Math.sin(d),y+=T*T,y>=1?w=0:w=Math.sqrt(1-y),_.value===Se$1.AREA_1?(y=w,w=-T,T=y):_.value===Se$1.AREA_2?(w=-w,T=-T):_.value===Se$1.AREA_3&&(y=w,w=T,T=-y),this.face===on$2.RIGHT?(y=E,E=-w,w=y):this.face===on$2.BACK?(E=-E,w=-w):this.face===on$2.LEFT&&(y=E,E=w,w=-y),o.phi=Math.acos(-T)-ht$1,o.lam=Math.atan2(w,E),this.face===on$2.RIGHT?o.lam=tp$2(o.lam,-ht$1):this.face===on$2.BACK?o.lam=tp$2(o.lam,-En$2):this.face===on$2.LEFT&&(o.lam=tp$2(o.lam,+ht$1))}if(this.es!==0){var k,O,R;k=o.phi<0?1:0,O=Math.tan(o.phi),R=this.b/Math.sqrt(O*O+this.one_minus_f_squared),o.phi=Math.atan(Math.sqrt(this.a*this.a-R*R)/(this.one_minus_f*R)),k&&(o.phi=-o.phi)}return o.lam+=this.long0,r.x=o.lam,r.y=o.phi,r}function Kg$2(r,o,s,a){var l;return rTe&&l<=ht$1+Te?(a.value=Se$1.AREA_1,l-=ht$1):l>ht$1+Te||l<=-(ht$1+Te)?(a.value=Se$1.AREA_2,l=l>=0?l-En$2:l+En$2):(a.value=Se$1.AREA_3,l+=ht$1)),l}function tp$2(r,o){var s=r+o;return s<-En$2?s+=Lf$2:s>+En$2&&(s-=Lf$2),s}var lnt=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const cnt={init:snt,forward:ont,inverse:ant,names:lnt};var GE$1=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],zf$2=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],yk$2=.8487,gk$2=1.3523,vk$2=eo$2/5,unt=1/vk$2,ep$2=18,t1$2=function(r,o){return r[0]+o*(r[1]+o*(r[2]+o*r[3]))},hnt=function(r,o){return r[1]+o*(2*r[2]+o*3*r[3])};function pnt(r,o,s,a){for(var l=o;a;--a){var c=r(l);if(l-=c,Math.abs(c)=ep$2&&(a=ep$2-1),s=eo$2*(s-unt*a);var l={x:t1$2(GE$1[a],s)*o,y:t1$2(zf$2[a],s)};return r.y<0&&(l.y=-l.y),l.x=l.x*this.a*yk$2+this.x0,l.y=l.y*this.a*gk$2+this.y0,l}function mnt(r){var o={x:(r.x-this.x0)/(this.a*yk$2),y:Math.abs(r.y-this.y0)/(this.a*gk$2)};if(o.y>=1)o.x/=GE$1[ep$2][0],o.y=r.y<0?-ht$1:ht$1;else{var s=Math.floor(o.y*ep$2);for(s<0?s=0:s>=ep$2&&(s=ep$2-1);;)if(zf$2[s][0]>o.y)--s;else if(zf$2[s+1][0]<=o.y)++s;else break;var a=zf$2[s],l=5*(o.y-a[0])/(zf$2[s+1][0]-a[0]);l=pnt(function(c){return(t1$2(a,c)-o.y)/hnt(a,c)},l,bt$2,100),o.x/=t1$2(GE$1[s],l),o.y=(5*s+l)*ir$2,r.y<0&&(o.y=-o.y)}return o.x=_t$2(o.x+this.long0),o}var ynt=["Robinson","robin"];const gnt={init:dnt,forward:fnt,inverse:mnt,names:ynt};function vnt(){this.name="geocent"}function bnt(r){var o=XR$2(r,this.es,this.a);return o}function _nt(r){var o=YR$2(r,this.es,this.a,this.b);return o}var wnt=["Geocentric","geocentric","geocent","Geocent"];const xnt={init:vnt,forward:bnt,inverse:_nt,names:wnt};var vr$2={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Hf$2={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Ent(){if(Object.keys(Hf$2).forEach(function(s){if(typeof this[s]>"u")this[s]=Hf$2[s].def;else{if(Hf$2[s].num&&isNaN(this[s]))throw new Error("Invalid parameter value, must be numeric "+s+" = "+this[s]);Hf$2[s].num&&(this[s]=parseFloat(this[s]))}Hf$2[s].degrees&&(this[s]=this[s]*ir$2)}.bind(this)),Math.abs(Math.abs(this.lat0)-ht$1)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var r=this.tilt,o=this.azi;this.cg=Math.cos(o),this.sg=Math.sin(o),this.cw=Math.cos(r),this.sw=Math.sin(r)}function Tnt(r){r.x-=this.long0;var o=Math.sin(r.y),s=Math.cos(r.y),a=Math.cos(r.x),l,c;switch(this.mode){case vr$2.OBLIQ:c=this.sinph0*o+this.cosph0*s*a;break;case vr$2.EQUIT:c=s*a;break;case vr$2.S_POLE:c=-o;break;case vr$2.N_POLE:c=o;break}switch(c=this.pn1/(this.p-c),l=c*s*Math.sin(r.x),this.mode){case vr$2.OBLIQ:c*=this.cosph0*o-this.sinph0*s*a;break;case vr$2.EQUIT:c*=o;break;case vr$2.N_POLE:c*=-(s*a);break;case vr$2.S_POLE:c*=s*a;break}var u,d;return u=c*this.cg+l*this.sg,d=1/(u*this.sw*this.h1+this.cw),l=(l*this.cg-c*this.sg)*this.cw*d,c=u*d,r.x=l*this.a,r.y=c*this.a,r}function Snt(r){r.x/=this.a,r.y/=this.a;var o={x:r.x,y:r.y},s,a,l;l=1/(this.pn1-r.y*this.sw),s=this.pn1*r.x*l,a=this.pn1*r.y*this.cw*l,r.x=s*this.cg+a*this.sg,r.y=a*this.cg-s*this.sg;var c=Jr$2(r.x,r.y);if(Math.abs(c)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var r=1-this.es,o=1/r;this.radius_p=Math.sqrt(r),this.radius_p2=r,this.radius_p_inv2=o,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function Nnt(r){var o=r.x,s=r.y,a,l,c,u;if(o=o-this.long0,this.shape==="ellipse"){s=Math.atan(this.radius_p2*Math.tan(s));var d=this.radius_p/Jr$2(this.radius_p*Math.cos(s),Math.sin(s));if(l=d*Math.cos(o)*Math.cos(s),c=d*Math.sin(o)*Math.cos(s),u=d*Math.sin(s),(this.radius_g-l)*l-c*c-u*u*this.radius_p_inv2<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=this.radius_g-l,this.flip_axis?(r.x=this.radius_g_1*Math.atan(c/Jr$2(u,a)),r.y=this.radius_g_1*Math.atan(u/a)):(r.x=this.radius_g_1*Math.atan(c/a),r.y=this.radius_g_1*Math.atan(u/Jr$2(c,a)))}else this.shape==="sphere"&&(a=Math.cos(s),l=Math.cos(o)*a,c=Math.sin(o)*a,u=Math.sin(s),a=this.radius_g-l,this.flip_axis?(r.x=this.radius_g_1*Math.atan(c/Jr$2(u,a)),r.y=this.radius_g_1*Math.atan(u/a)):(r.x=this.radius_g_1*Math.atan(c/a),r.y=this.radius_g_1*Math.atan(u/Jr$2(c,a))));return r.x=r.x*this.a,r.y=r.y*this.a,r}function Ont(r){var o=-1,s=0,a=0,l,c,u,d;if(r.x=r.x/this.a,r.y=r.y/this.a,this.shape==="ellipse"){this.flip_axis?(a=Math.tan(r.y/this.radius_g_1),s=Math.tan(r.x/this.radius_g_1)*Jr$2(1,a)):(s=Math.tan(r.x/this.radius_g_1),a=Math.tan(r.y/this.radius_g_1)*Jr$2(1,s));var m=a/this.radius_p;if(l=s*s+m*m+o*o,c=2*this.radius_g*o,u=c*c-4*l*this.C,u<0)return r.x=Number.NaN,r.y=Number.NaN,r;d=(-c-Math.sqrt(u))/(2*l),o=this.radius_g+d*o,s*=d,a*=d,r.x=Math.atan2(s,o),r.y=Math.atan(a*Math.cos(r.x)/o),r.y=Math.atan(this.radius_p_inv2*Math.tan(r.y))}else if(this.shape==="sphere"){if(this.flip_axis?(a=Math.tan(r.y/this.radius_g_1),s=Math.tan(r.x/this.radius_g_1)*Math.sqrt(1+a*a)):(s=Math.tan(r.x/this.radius_g_1),a=Math.tan(r.y/this.radius_g_1)*Math.sqrt(1+s*s)),l=s*s+a*a+o*o,c=2*this.radius_g*o,u=c*c-4*l*this.C,u<0)return r.x=Number.NaN,r.y=Number.NaN,r;d=(-c-Math.sqrt(u))/(2*l),o=this.radius_g+d*o,s*=d,a*=d,r.x=Math.atan2(s,o),r.y=Math.atan(a*Math.cos(r.x)/o)}return r.x=r.x+this.long0,r}var Cnt=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Rnt={init:Mnt,forward:Nnt,inverse:Ont,names:Cnt};var Wf$2=1.340264,Xf$2=-.081106,Yf$2=893e-6,Jf$2=.003796,e1$2=Math.sqrt(3)/2;function knt(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function Lnt(r){var o=_t$2(r.x-this.long0),s=r.y,a=Math.asin(e1$2*Math.sin(s)),l=a*a,c=l*l*l;return r.x=o*Math.cos(a)/(e1$2*(Wf$2+3*Xf$2*l+c*(7*Yf$2+9*Jf$2*l))),r.y=a*(Wf$2+Xf$2*l+c*(Yf$2+Jf$2*l)),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function Pnt(r){r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a;var o=1e-9,s=12,a=r.y,l,c,u,d,m,g;for(g=0;g=ht$1?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Bnt,this.forward=$nt)}function jnt(r){var o=_t$2(r.x-(this.long0||0)),s=r.y,a,l,c;return a=this.am1+this.m1-Zh$2(s,l=Math.sin(s),c=Math.cos(s),this.en),l=c*o/(a*Math.sqrt(1-this.es*l*l)),r.x=a*Math.sin(l),r.y=this.am1-a*Math.cos(l),r.x=this.a*r.x+(this.x0||0),r.y=this.a*r.y+(this.y0||0),r}function Unt(r){r.x=(r.x-(this.x0||0))/this.a,r.y=(r.y-(this.y0||0))/this.a;var o,s,a,l;if(s=Jr$2(r.x,r.y=this.am1-r.y),l=kE$2(this.am1+this.m1-s,this.es,this.en),(o=Math.abs(l))qf$2?(r.x=l*Math.sin(a=o*Math.cos(s)/l),r.y=this.cphi1-l*Math.cos(a)):r.x=r.y=0,r.x=this.a*r.x+(this.x0||0),r.y=this.a*r.y+(this.y0||0),r}function Bnt(r){r.x=(r.x-(this.x0||0))/this.a,r.y=(r.y-(this.y0||0))/this.a;var o,s,a=Jr$2(r.x,r.y=this.cphi1-r.y);if(s=this.cphi1+this.phi1-a,Math.abs(s)>ht$1)throw new Error;return Math.abs(Math.abs(s)-ht$1)<=qf$2?o=0:o=a*Math.atan2(r.x,r.y)/Math.cos(s),r.x=_t$2(o+(this.long0||0)),r.y=cl$2(s),r}var Vnt=["bonne","Bonne (Werner lat_1=90)"];const znt={init:Fnt,names:Vnt};function Hnt(r){r.Proj.projections.add(qg$2),r.Proj.projections.add(Zg$2),r.Proj.projections.add(GK$1),r.Proj.projections.add(XK$1),r.Proj.projections.add(KK$1),r.Proj.projections.add(itt),r.Proj.projections.add(utt),r.Proj.projections.add(mtt),r.Proj.projections.add(_tt),r.Proj.projections.add(Stt),r.Proj.projections.add(Btt),r.Proj.projections.add(Ytt),r.Proj.projections.add(Ktt),r.Proj.projections.add(set),r.Proj.projections.add(het),r.Proj.projections.add(yet),r.Proj.projections.add(wet),r.Proj.projections.add(Iet),r.Proj.projections.add(ket),r.Proj.projections.add(Fet),r.Proj.projections.add(Vet),r.Proj.projections.add(Yet),r.Proj.projections.add(Ket),r.Proj.projections.add(int$1),r.Proj.projections.add(cnt),r.Proj.projections.add(gnt),r.Proj.projections.add(xnt),r.Proj.projections.add(Int$1),r.Proj.projections.add(Rnt),r.Proj.projections.add(Gnt),r.Proj.projections.add(znt)}Ue$1.defaultDatum="WGS84",Ue$1.Proj=io$2,Ue$1.WGS84=new Ue$1.Proj("WGS84"),Ue$1.Point=qh$1,Ue$1.toPoint=QR$2,Ue$1.defs=Or$3,Ue$1.nadgrid=jQ,Ue$1.transform=Jg$2,Ue$1.mgrs=eK$1,Ue$1.version="__VERSION__",Hnt(Ue$1);const Wnt="EPSG:4326";class Xnt{espgWorker;constructor(){this.espgWorker=this.defaultEpsgLookup,Ue$1.defs("EPSG:3978","+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"),Ue$1.defs("EPSG:3979","+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"),Ue$1.defs("EPSG:54004","+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"),Ue$1.defs("EPSG:102100",Ue$1.defs("EPSG:3857")),Ue$1.defs("EPSG:102187","+proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"),Ue$1.defs("EPSG:102190","+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");let o=1;for(;o<=60;){const s=o<10?`0${o}`:o;Ue$1.defs(`EPSG:326${s}`,`+proj=utm +zone=${o} +ellps=WGS84 +datum=WGS84 +units=m +no_defs`),o++}}addProjection(o,s){o=typeof o=="number"?`EPSG:${o}`:o,Ue$1.defs(o,s)}defaultEpsgLookup(o){const s=/urn:ogc:def:crs:EPSG::(\d+)/,a=/EPSG:(\d+)/,l=String(o).match(s)||String(o).match(a)||[];if(l.length<2)throw new Error("Invalid code provided.");return new Promise((c,u)=>{const d=`https://epsg.io/${l[1]}.proj4`;fn$2(d,{responseType:"text"}).then(m=>{m.data?c(m.data):u()},m=>{u(m)})})}epsgLookup(o){return this.espgWorker(o)}setEpsgLookup(o){this.espgWorker=o}normalizeProj(o){if(typeof o=="object"){if(o.wkid)return"EPSG:"+o.wkid;if(o.wkt)return o.wkt}else{if(typeof o=="number")return"EPSG:"+o;if(typeof o=="string")return o}throw new Error("Bad argument type, please provide a string, integer or SpatialReference object.")}async checkProj(o){let s,a="";try{s=this.normalizeProj(o)}catch{return!1}if(!s.startsWith("EPSG:"))return!0;typeof o=="object"&&o.latestWkid&&(a=this.normalizeProj(o.latestWkid));const l=(u,d)=>{u!==d&&Ue$1.defs(d,Ue$1.defs(u))};if(Ue$1.defs(s))return!0;if(a&&Ue$1.defs(a))return l(a,s),!0;const c=async u=>{try{const d=await this.epsgLookup(u);return d===null||d===""?!1:(Ue$1.defs(u,d),!0)}catch{return!1}};return await(a?c(a):Promise.resolve(!1))?(l(a,s),!0):c(s)}async checkProjBomber(o){if(o.length>0){const s=o.pop();if(await this.checkProj(s))return this.checkProjBomber(o);throw console.error("Unable to parse or locate projection information for this item:",s),new Error("Could not find projection information, see console for details")}}async projectGeoJson(o,s,a){let l,c;if(s?l=this.normalizeProj(s):l=Bt$2.parseGeoJsonCrs(o.crs),a?c=this.normalizeProj(a):c=Wnt,c===l)return o;await this.checkProjBomber([l,c]);const u=Ue$1(l,c).forward;return KZ$1.Tools.applyConverter(o,u)}async projectGeometry(o,s){if(s.type===qt$2.EXTENT)return this.projectExtent(o,s);await this.checkProjBomber([o,s.sr]);const a=s.toGeoJSON(),l=await this.projectGeoJson(a,this.normalizeProj(s.sr),this.normalizeProj(o)),c=Ou$2.geom.geomGeoJsonToRamp(l,s.id);return c.sr=Bt$2.parseSR(o),c}async projectExtent(o,s){const a=(k,O,R)=>{if(R===0)return[k,O];const M=[(k[0]+O[0])/2,(k[1]+O[1])/2];if(R===1)return[k,M,O];if(R>1){const N=a(k,M,R-1),D=a(M,O,R-1);return N.concat(D.slice(1))}return[[]]},l=s.toPolygonArray().pop()||[];let c=[];[0,1,2,3].map(k=>a(l[k],l[k+1],3).slice(1)).forEach(k=>c=c.concat(k));const u=new ur$2("warpy",[c],s.sr,!0),d=await this.projectGeometry(o,u),m=d.toArray().pop()||[],g=m.map(k=>k[0]),y=m.map(k=>k[1]),_=Math.min.apply(null,g),E=Math.max.apply(null,g),w=Math.min.apply(null,y),T=Math.max.apply(null,y);return tn$2.fromParams(s.id+"_projected",_,w,E,T,d.sr)}}class Ynt{DEFAULT_MERCATOR="DEFAULT_ESRI_World_AuxMerc_3857";DEFAULT_LAMBERT="DEFAULT_NRCAN_Lambert_3978";proj;geom;sharedUtils;constructor(){this.proj=new Xnt,this.geom=new YZ$1,this.sharedUtils=new ZZ$1}defaultTileSchemas(){return[this.DEFAULT_LAMBERT,this.DEFAULT_MERCATOR]}defaultLODs(o){const s=a=>a.map(l=>({level:l[0],resolution:l[1],scale:l[2]}));if(o===this.DEFAULT_LAMBERT)return s([[0,38364.660062653464,145e6],[1,22489.62831258996,85e6],[2,13229.193125052918,5e7],[3,7937.5158750317505,3e7],[4,4630.2175937685215,175e5],[5,2645.8386250105837,1e7],[6,1587.5031750063501,6e6],[7,926.0435187537042,35e5],[8,529.1677250021168,2e6],[9,317.50063500127004,12e5],[10,185.20870375074085,7e5],[11,111.12522225044451,42e4],[12,66.1459656252646,25e4],[13,38.36466006265346,145e3],[14,22.48962831258996,85e3],[15,13.229193125052918,5e4],[16,7.9375158750317505,3e4],[17,4.6302175937685215,17500]]);if(o===this.DEFAULT_MERCATOR)return s([[0,19567.87924099992,73957190948944e-6],[1,9783.93962049996,36978595474472e-6],[2,4891.96981024998,18489297737236e-6],[3,2445.98490512499,9244648868618e-6],[4,1222.992452562495,4622324434309e-6],[5,611.4962262813797,2311162217155e-6],[6,305.74811314055756,1155581108577e-6],[7,152.87405657041106,577790.554289],[8,76.43702828507324,288895.277144],[9,38.21851414253662,144447.638572],[10,19.10925707126831,72223.819286],[11,9.554628535634155,36111.909643],[12,4.77731426794937,18055.954822],[13,2.388657133974685,9027.977411],[14,1.1943285668550503,4513.988705],[15,.5971642835598172,2256.994353],[16,.29858214164761665,1128.497176],[17,.14929107082380833,564.248588],[18,.07464553541190416,282.124294],[19,.03732276770595208,141.062147],[20,.01866138385297604,70.5310735]]);throw new Error(`Unknown tile schema key passed to LOD defaulter ${o}`)}}let Tn$2=class{$iApi;get $vApp(){return this.$iApi.$vApp}get $element(){return this.$iApi.$element}constructor(o){this.$iApi=o}};function Jnt(r){return typeof r=="function"&&r.render&&typeof r.render=="function"}function qnt(r){const o=["data","props","propsData","computed","methods","watch","template","render","components","model"];return typeof r=="object"&&!r.functional&&o.some(s=>r[s]!==void 0)}function bk$2(r){return typeof r=="object"&&Object.keys(r).every(o=>typeof o=="string")&&Object.values(r).every(o=>o instanceof HTMLElement)}function Znt(r){return typeof r=="object"&&r.default!==void 0}var n1$2={exports:{}},_k$2;function Qnt(){if(_k$2)return n1$2.exports;_k$2=1;function r(){}return r.prototype={on:function(o,s,a){var l=this.e||(this.e={});return(l[o]||(l[o]=[])).push({fn:s,ctx:a}),this},once:function(o,s,a){var l=this;function c(){l.off(o,c),s.apply(a,arguments)}return c._=s,this.on(o,c,a)},emit:function(o){var s=[].slice.call(arguments,1),a=((this.e||(this.e={}))[o]||[]).slice(),l=0,c=a.length;for(l;ls in o}const le$1={},np$2=[],sr$2=()=>{},Zf$2=()=>!1,Xc$2=r=>r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&(r.charCodeAt(2)>122||r.charCodeAt(2)<97),FE$2=r=>r.startsWith("onUpdate:"),he=Object.assign,jE$2=(r,o)=>{const s=r.indexOf(o);s>-1&&r.splice(s,1)},trt=Object.prototype.hasOwnProperty,we$1=(r,o)=>trt.call(r,o),Et$1=Array.isArray,rp$2=r=>ip$2(r)==="[object Map]",Yc$2=r=>ip$2(r)==="[object Set]",wk$2=r=>ip$2(r)==="[object Date]",ert=r=>ip$2(r)==="[object RegExp]",Gt$3=r=>typeof r=="function",Wt$2=r=>typeof r=="string",mi$2=r=>typeof r=="symbol",Re$3=r=>r!==null&&typeof r=="object",UE$2=r=>(Re$3(r)||Gt$3(r))&&Gt$3(r.then)&&Gt$3(r.catch),xk$2=Object.prototype.toString,ip$2=r=>xk$2.call(r),nrt=r=>ip$2(r).slice(8,-1),r1$2=r=>ip$2(r)==="[object Object]",$E$2=r=>Wt$2(r)&&r!=="NaN"&&r[0]!=="-"&&""+parseInt(r,10)===r,pl$1=fi$2(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),rrt=fi$2("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),i1$2=r=>{const o=Object.create(null);return s=>o[s]||(o[s]=r(s))},irt=/-(\w)/g,Ze$1=i1$2(r=>r.replace(irt,(o,s)=>s?s.toUpperCase():"")),srt=/\B([A-Z])/g,qr$2=i1$2(r=>r.replace(srt,"-$1").toLowerCase()),dl$2=i1$2(r=>r.charAt(0).toUpperCase()+r.slice(1)),Jc$2=i1$2(r=>r?`on${dl$2(r)}`:""),Rr$2=(r,o)=>!Object.is(r,o),sp$2=(r,...o)=>{for(let s=0;s{Object.defineProperty(r,o,{configurable:!0,enumerable:!1,writable:a,value:s})},s1$2=r=>{const o=parseFloat(r);return isNaN(o)?r:o},o1$2=r=>{const o=Wt$2(r)?Number(r):NaN;return isNaN(o)?r:o};let Tk$2;const Sk$2=()=>Tk$2||(Tk$2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ort(r,o){return r+JSON.stringify(o,(s,a)=>typeof a=="function"?a.toString():a)}const art="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",lrt=fi$2(art);function Wo$1(r){if(Et$1(r)){const o={};for(let s=0;s{if(s){const a=s.split(urt);a.length>1&&(o[a[0].trim()]=a[1].trim())}}),o}function an$2(r){let o="";if(Wt$2(r))o=r;else if(Et$1(r))for(let s=0;sfl$2(s,o))}const Nk$2=r=>!!(r&&r.__v_isRef===!0),$e$1=r=>Wt$2(r)?r:r==null?"":Et$1(r)||Re$3(r)&&(r.toString===xk$2||!Gt$3(r.toString))?Nk$2(r)?$e$1(r.value):JSON.stringify(r,Ok$2,2):String(r),Ok$2=(r,o)=>Nk$2(o)?Ok$2(r,o.value):rp$2(o)?{[`Map(${o.size})`]:[...o.entries()].reduce((s,[a,l],c)=>(s[BE$2(a,c)+" =>"]=l,s),{})}:Yc$2(o)?{[`Set(${o.size})`]:[...o.values()].map(s=>BE$2(s))}:mi$2(o)?BE$2(o):Re$3(o)&&!Et$1(o)&&!r1$2(o)?String(o):o,BE$2=(r,o="")=>{var s;return mi$2(r)?`Symbol(${(s=r.description)!=null?s:o})`:r};var Ert={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_970c9b9c-9c28-4e11-91fe-3899b82e4149",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"",npm_config_user_agent:"npm/10.9.0 node/v22.12.0 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_970c9b9c-9c28-4e11-91fe-3899b82e4149",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",OLDPWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"ramp4-pcar4",npm_package_engines_node:"=22.12.0",GRADLE_HOME:"/usr/share/gradle-8.11.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"57148724",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_local_prefix:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",SYSTEMD_EXEC_PID:"834",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20241215.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.10/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.4/x64",JOURNAL_STREAM:"8:6781",GITHUB_WORKFLOW:"Build demo site and deploy to GitHub Pages",_:"/opt/hostedtoolcache/node/22.12.0/x64/bin/npm",npm_config_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",npm_config_npm_version:"10.9.0",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/runner-provisioner.service/memory.pressure",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"12600631880",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"tag",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_BASE_REF:"",ImageOS:"ubuntu24",GITHUB_WORKFLOW_REF:"ramp4-pcar4/ramp4-pcar4/.github/workflows/demo-build.yml@refs/tags/v4.10.2",ACTIONS_ID_TOKEN_REQUEST_TOKEN:"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ikh5cTROQVRBanNucUM3bWRydEFoaHJDUjJfUSJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zLkdlbmVyaWNSZWFkOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCBBY3Rpb25zLlJlc3VsdHM6MTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCBBY3Rpb25zLlVwbG9hZEFydGlmYWN0czowMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAvMTpCdWlsZC9CdWlsZC8xMTg1NiBEaXN0cmlidXRlZFRhc2suR2VuZXJhdGVJZFRva2VuOjEyMjcwNGU1LWRkNWItNGM3Zi04MWM2LTFjNjRjZWI0ZDE2YTpjYTM5NTA4NS0wNDBhLTUyNmItMmNlOC1iZGM4NWY2OTI3NzQgTG9jYXRpb25TZXJ2aWNlLkNvbm5lY3QgUmVhZEFuZFVwZGF0ZUJ1aWxkQnlVcmk6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwLzE6QnVpbGQvQnVpbGQvMTE4NTYiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiJkMmFlN2M1OS1lYjk5LTRhNGMtOGQxOS05N2EwZGY2ZDBhZDkiLCJzaWQiOiIwMWNhN2I4NC03YmZmLTRjYTMtOTM2Mi1iOWI4ODc5ZjFjN2QiLCJhYyI6Ilt7XCJTY29wZVwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcIlBlcm1pc3Npb25cIjozfSx7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9tYWluXCIsXCJQZXJtaXNzaW9uXCI6MX1dIiwiYWNzbCI6IjEwIiwib2lkY19leHRyYSI6IntcInJlZlwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcInNoYVwiOlwiZmEwZjEwYzk5OTgxNWMyZDA0YzJhMjk5NWFkOTA4YTFhMTgzNjMxYlwiLFwicmVwb3NpdG9yeVwiOlwicmFtcDQtcGNhcjQvcmFtcDQtcGNhcjRcIixcInJlcG9zaXRvcnlfb3duZXJcIjpcInJhbXA0LXBjYXI0XCIsXCJyZXBvc2l0b3J5X293bmVyX2lkXCI6XCI1NzE0ODcyNFwiLFwicnVuX2lkXCI6XCIxMjYwMDYzMTg4MFwiLFwicnVuX251bWJlclwiOlwiMTQyXCIsXCJydW5fYXR0ZW1wdFwiOlwiMVwiLFwicmVwb3NpdG9yeV92aXNpYmlsaXR5XCI6XCJwdWJsaWNcIixcInJlcG9zaXRvcnlfaWRcIjpcIjIxODM1NjA1N1wiLFwiYWN0b3JfaWRcIjpcIjc1ODUyNDVcIixcImFjdG9yXCI6XCJqYW1lcy1yYWVcIixcIndvcmtmbG93XCI6XCJCdWlsZCBkZW1vIHNpdGUgYW5kIGRlcGxveSB0byBHaXRIdWIgUGFnZXNcIixcImhlYWRfcmVmXCI6XCJcIixcImJhc2VfcmVmXCI6XCJcIixcImV2ZW50X25hbWVcIjpcInB1c2hcIixcInJlZl9wcm90ZWN0ZWRcIjpcImZhbHNlXCIsXCJyZWZfdHlwZVwiOlwidGFnXCIsXCJ3b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJ3b3JrZmxvd19zaGFcIjpcImZhMGYxMGM5OTk4MTVjMmQwNGMyYTI5OTVhZDkwOGExYTE4MzYzMWJcIixcImVudmlyb25tZW50XCI6XCJnaXRodWItcGFnZXNcIixcImVudmlyb25tZW50X25vZGVfaWRcIjpcIkVOX2t3RE9EUVBaV2M0ZUV4MlpcIixcImpvYl93b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJqb2Jfd29ya2Zsb3dfc2hhXCI6XCJmYTBmMTBjOTk5ODE1YzJkMDRjMmEyOTk1YWQ5MDhhMWExODM2MzFiXCIsXCJydW5uZXJfZW52aXJvbm1lbnRcIjpcImdpdGh1Yi1ob3N0ZWRcIn0iLCJvaWRjX3N1YiI6InJlcG86cmFtcDQtcGNhcjQvcmFtcDQtcGNhcjQ6ZW52aXJvbm1lbnQ6Z2l0aHViLXBhZ2VzIiwib3JjaGlkIjoiMTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhLmJ1aWxkLl9fZGVmYXVsdCIsImlzcyI6InZzdG9rZW4uYWN0aW9ucy5naXRodWJ1c2VyY29udGVudC5jb20iLCJhdWQiOiJ2c3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tfHZzbzpkYzhlN2U0ZC00ZDQ1LTQ4ZDAtYmY4YS02YmQ0YzZjMjQ2MDciLCJuYmYiOjE3MzU5MjA2NTEsImV4cCI6MTczNTk0MzQ1MX0.GDIMaHnR4BV7DsiZYljQVjH7maAY2oeT19GbL0fBsVgnLSFwh82jS97tSwainj2WAOKfT53NDCKgBCLyJEMNXgCLkesDDmaWKNr7E93N8EpiWWaeHC0gWfNng4854FKwe-2rSolRxMqjICH-MEL9daqiLdkvfT1Am5LvlA5gqUJfcXvG1ghyIplZrr_i8EovHetZNOIKC7V8TemKrUnogzxWmWjfE7jkyS6ER92v7Gb7pGnLtjNXoXrsuyXTaUDs6WJQEisuX3DyAlIMTGH35Y_GKb4TZzfcxQzGSIRH6wdbZPPrGnK0bt9mwM846IL1Bg6JmdG8McfmiAWr_xllxg",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_921a48f6-5b8e-4cc8-aff5-dc8fc3bbf3f7",INVOCATION_ID:"819722273f2741acab86958091275df4",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",npm_package_name:"ramp-pcar",GITHUB_ACTION:"__run_4",GITHUB_RUN_NUMBER:"142",GITHUB_TRIGGERING_ACTOR:"james-rae",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 6",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",GITHUB_REF_NAME:"v4.10.2",GITHUB_REPOSITORY:"ramp4-pcar4/ramp4-pcar4",STATS_D_D:"true",npm_lifecycle_script:"vite build --mode esDynamic",npm_config_loglevel:"silent",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"218356057",GITHUB_ACTIONS:"true",STATS_PIP:"false",npm_package_version:"4.10.2",npm_lifecycle_event:"build:esDynamic",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",ACCEPT_EULA:"Y",GITHUB_JOB:"build",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_RUN_ATTEMPT:"1",STATS_D_TC:"true",GITHUB_REF:"refs/tags/v4.10.2",GITHUB_ACTOR:"james-rae",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",npm_config_globalconfig:"/opt/hostedtoolcache/node/22.12.0/x64/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_970c9b9c-9c28-4e11-91fe-3899b82e4149",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",GITHUB_ACTOR_ID:"7585245",RUNNER_WORKSPACE:"/home/runner/work/ramp4-pcar4",npm_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"push",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",ACTIONS_ID_TOKEN_REQUEST_URL:"https://pipelinesghubeus2.actions.githubusercontent.com/CYYZq0bGEiBG5XjoYFUt7ZUW3UppKtccmRBdNq2vSmlX4E20ap/00000000-0000-0000-0000-000000000000/_apis/distributedtask/hubs/Actions/plans/122704e5-dd5b-4c7f-81c6-1c64ceb4d16a/jobs/ca395085-040a-526b-2ce8-bdc85f692774/idtoken?api-version=2.0",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_970c9b9c-9c28-4e11-91fe-3899b82e4149",npm_config_global_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.2.12479018",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",STATS_EXTP:"https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_970c9b9c-9c28-4e11-91fe-3899b82e4149",INIT_CWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",EDITOR:"vi",NODE_ENV:"production"};let kr$1,l1$2=class{constructor(o=!1){this.detached=o,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=kr$1,!o&&kr$1&&(this.index=(kr$1.scopes||(kr$1.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,s;if(this.scopes)for(o=0,s=this.scopes.length;o0)return;let r;for(;ap$3;){let o=ap$3,s;for(;o;)o.flags&=-9,o=o.next;for(o=ap$3,ap$3=void 0;o;){if(o.flags&1)try{o.trigger()}catch(a){r||(r=a)}s=o.next,o.next=void 0,o=s}}if(r)throw r}function kk$2(r){for(let o=r.deps;o;o=o.nextDep)o.version=-1,o.prevActiveLink=o.dep.activeLink,o.dep.activeLink=o}function Lk$2(r){let o,s=r.depsTail,a=s;for(;a;){const l=a.prevDep;a.version===-1?(a===s&&(s=l),YE$1(a),Trt(a)):o=a,a.dep.activeLink=a.prevActiveLink,a.prevActiveLink=void 0,a=l}r.deps=o,r.depsTail=s}function XE$2(r){for(let o=r.deps;o;o=o.nextDep)if(o.dep.version!==o.version||o.dep.computed&&(Pk$2(o.dep.computed)||o.dep.version!==o.version))return!0;return!!r._dirty}function Pk$2(r){if(r.flags&4&&!(r.flags&16)||(r.flags&=-17,r.globalVersion===Kf$2))return;r.globalVersion=Kf$2;const o=r.dep;if(r.flags|=2,o.version>0&&!r.isSSR&&r.deps&&!XE$2(r)){r.flags&=-3;return}const s=He,a=_s$2;He=r,_s$2=!0;try{kk$2(r);const l=r.fn(r._value);(o.version===0||Rr$2(l,r._value))&&(r._value=l,o.version++)}catch(l){throw o.version++,l}finally{He=s,_s$2=a,Lk$2(r),r.flags&=-3}}function YE$1(r,o=!1){const{dep:s,prevSub:a,nextSub:l}=r;if(a&&(a.nextSub=l,r.prevSub=void 0),l&&(l.prevSub=a,r.nextSub=void 0),s.subs===r&&(s.subs=a),!s.subs&&s.computed){s.computed.flags&=-5;for(let c=s.computed.deps;c;c=c.nextDep)YE$1(c,!0)}!o&&!--s.sc&&s.map&&s.map.delete(s.key)}function Trt(r){const{prevDep:o,nextDep:s}=r;o&&(o.nextDep=s,r.prevDep=void 0),s&&(s.prevDep=o,r.nextDep=void 0)}function Dk$2(r,o){r.effect instanceof op$2&&(r=r.effect.fn);const s=new op$2(r);o&&he(s,o);try{s.run()}catch(l){throw s.stop(),l}const a=s.run.bind(s);return a.effect=s,a}function Gk$2(r){r.effect.stop()}let _s$2=!0;const Fk$2=[];function Xo$2(){Fk$2.push(_s$2),_s$2=!1}function Yo$1(){const r=Fk$2.pop();_s$2=r===void 0?!0:r}function jk$2(r){const{cleanup:o}=r;if(r.cleanup=void 0,o){const s=He;He=void 0;try{o()}finally{He=s}}}let Kf$2=0;class Srt{constructor(o,s){this.sub=o,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}let u1$2=class{constructor(o){this.computed=o,this.version=0,this.activeLink=void 0,this.subs=void 0,this.target=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(o){if(!He||!_s$2||He===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==He)s=this.activeLink=new Srt(He,this),He.deps?(s.prevDep=He.depsTail,He.depsTail.nextDep=s,He.depsTail=s):He.deps=He.depsTail=s,Uk$2(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const a=s.nextDep;a.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=a),s.prevDep=He.depsTail,s.nextDep=void 0,He.depsTail.nextDep=s,He.depsTail=s,He.deps===s&&(He.deps=a)}return s}trigger(o){this.version++,Kf$2++,this.notify(o)}notify(o){HE$2();try{Ert.NODE_ENV;for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{WE$2()}}};function Uk$2(r){if(r.dep.sc++,r.sub.flags&4){const o=r.dep.computed;if(o&&!r.dep.subs){o.flags|=20;for(let a=o.deps;a;a=a.nextDep)Uk$2(a)}const s=r.dep.subs;s!==r&&(r.prevSub=s,s&&(s.nextSub=r)),r.dep.subs=r}}const h1$2=new WeakMap,qc$2=Symbol(""),JE$2=Symbol(""),tm$2=Symbol("");function br$2(r,o,s){if(_s$2&&He){let a=h1$2.get(r);a||h1$2.set(r,a=new Map);let l=a.get(s);l||(a.set(s,l=new u1$2),l.target=r,l.map=a,l.key=s),l.track()}}function Jo$1(r,o,s,a,l,c){const u=h1$2.get(r);if(!u){Kf$2++;return}const d=m=>{m&&m.trigger()};if(HE$2(),o==="clear")u.forEach(d);else{const m=Et$1(r),g=m&&$E$2(s);if(m&&s==="length"){const y=Number(a);u.forEach((_,E)=>{(E==="length"||E===tm$2||!mi$2(E)&&E>=y)&&d(_)})}else switch(s!==void 0&&d(u.get(s)),g&&d(u.get(tm$2)),o){case"add":m?g&&d(u.get("length")):(d(u.get(qc$2)),rp$2(r)&&d(u.get(JE$2)));break;case"delete":m||(d(u.get(qc$2)),rp$2(r)&&d(u.get(JE$2)));break;case"set":rp$2(r)&&d(u.get(qc$2));break}}WE$2()}function Art(r,o){const s=h1$2.get(r);return s&&s.get(o)}function lp$2(r){const o=Ut$2(r);return o===r?o:(br$2(o,"iterate",tm$2),Zr$2(r)?o:o.map(_r$2))}function p1$2(r){return br$2(r=Ut$2(r),"iterate",tm$2),r}const Irt={__proto__:null,[Symbol.iterator](){return qE$2(this,Symbol.iterator,_r$2)},concat(...r){return lp$2(this).concat(...r.map(o=>Et$1(o)?lp$2(o):o))},entries(){return qE$2(this,"entries",r=>(r[1]=_r$2(r[1]),r))},every(r,o){return qo$1(this,"every",r,o,void 0,arguments)},filter(r,o){return qo$1(this,"filter",r,o,s=>s.map(_r$2),arguments)},find(r,o){return qo$1(this,"find",r,o,_r$2,arguments)},findIndex(r,o){return qo$1(this,"findIndex",r,o,void 0,arguments)},findLast(r,o){return qo$1(this,"findLast",r,o,_r$2,arguments)},findLastIndex(r,o){return qo$1(this,"findLastIndex",r,o,void 0,arguments)},forEach(r,o){return qo$1(this,"forEach",r,o,void 0,arguments)},includes(...r){return ZE$2(this,"includes",r)},indexOf(...r){return ZE$2(this,"indexOf",r)},join(r){return lp$2(this).join(r)},lastIndexOf(...r){return ZE$2(this,"lastIndexOf",r)},map(r,o){return qo$1(this,"map",r,o,void 0,arguments)},pop(){return em$2(this,"pop")},push(...r){return em$2(this,"push",r)},reduce(r,...o){return $k$2(this,"reduce",r,o)},reduceRight(r,...o){return $k$2(this,"reduceRight",r,o)},shift(){return em$2(this,"shift")},some(r,o){return qo$1(this,"some",r,o,void 0,arguments)},splice(...r){return em$2(this,"splice",r)},toReversed(){return lp$2(this).toReversed()},toSorted(r){return lp$2(this).toSorted(r)},toSpliced(...r){return lp$2(this).toSpliced(...r)},unshift(...r){return em$2(this,"unshift",r)},values(){return qE$2(this,"values",_r$2)}};function qE$2(r,o,s){const a=p1$2(r),l=a[o]();return a!==r&&!Zr$2(r)&&(l._next=l.next,l.next=()=>{const c=l._next();return c.value&&(c.value=s(c.value)),c}),l}const Mrt=Array.prototype;function qo$1(r,o,s,a,l,c){const u=p1$2(r),d=u!==r&&!Zr$2(r),m=u[o];if(m!==Mrt[o]){const _=m.apply(r,c);return d?_r$2(_):_}let g=s;u!==r&&(d?g=function(_,E){return s.call(this,_r$2(_),E,r)}:s.length>2&&(g=function(_,E){return s.call(this,_,E,r)}));const y=m.call(u,g,a);return d&&l?l(y):y}function $k$2(r,o,s,a){const l=p1$2(r);let c=s;return l!==r&&(Zr$2(r)?s.length>3&&(c=function(u,d,m){return s.call(this,u,d,m,r)}):c=function(u,d,m){return s.call(this,u,_r$2(d),m,r)}),l[o](c,...a)}function ZE$2(r,o,s){const a=Ut$2(r);br$2(a,"iterate",tm$2);const l=a[o](...s);return(l===-1||l===!1)&&nm$2(s[0])?(s[0]=Ut$2(s[0]),a[o](...s)):l}function em$2(r,o,s=[]){Xo$2(),HE$2();const a=Ut$2(r)[o].apply(r,s);return WE$2(),Yo$1(),a}const Nrt=fi$2("__proto__,__v_isRef,__isVue"),Bk$2=new Set(Object.getOwnPropertyNames(Symbol).filter(r=>r!=="arguments"&&r!=="caller").map(r=>Symbol[r]).filter(mi$2));function Ort(r){mi$2(r)||(r=String(r));const o=Ut$2(this);return br$2(o,"has",r),o.hasOwnProperty(r)}let Vk$2=class{constructor(o=!1,s=!1){this._isReadonly=o,this._isShallow=s}get(o,s,a){const l=this._isReadonly,c=this._isShallow;if(s==="__v_isReactive")return!l;if(s==="__v_isReadonly")return l;if(s==="__v_isShallow")return c;if(s==="__v_raw")return a===(l?c?Kk$2:Qk$2:c?Zk$2:qk$2).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(a)?o:void 0;const u=Et$1(o);if(!l){let m;if(u&&(m=Irt[s]))return m;if(s==="hasOwnProperty")return Ort}const d=Reflect.get(o,s,pe$1(o)?o:a);return(mi$2(s)?Bk$2.has(s):Nrt(s))||(l||br$2(o,"get",s),c)?d:pe$1(d)?u&&$E$2(s)?d:d.value:Re$3(d)?l?_1$2(d):Vn$1(d):d}},zk$2=class extends Vk$2{constructor(o=!1){super(!1,o)}set(o,s,a,l){let c=o[s];if(!this._isShallow){const m=Zo$2(c);if(!Zr$2(a)&&!Zo$2(a)&&(c=Ut$2(c),a=Ut$2(a)),!Et$1(o)&&pe$1(c)&&!pe$1(a))return m?!1:(c.value=a,!0)}const u=Et$1(o)&&$E$2(s)?Number(s)r,d1$2=r=>Reflect.getPrototypeOf(r);function f1$2(r,o,s=!1,a=!1){r=r.__v_raw;const l=Ut$2(r),c=Ut$2(o);s||(Rr$2(o,c)&&br$2(l,"get",o),br$2(l,"get",c));const{has:u}=d1$2(l),d=a?QE$2:s?tT$2:_r$2;if(u.call(l,o))return d(r.get(o));if(u.call(l,c))return d(r.get(c));r!==l&&r.get(o)}function m1$2(r,o=!1){const s=this.__v_raw,a=Ut$2(s),l=Ut$2(r);return o||(Rr$2(r,l)&&br$2(a,"has",r),br$2(a,"has",l)),r===l?s.has(r):s.has(r)||s.has(l)}function y1$1(r,o=!1){return r=r.__v_raw,!o&&br$2(Ut$2(r),"iterate",qc$2),Reflect.get(r,"size",r)}function Wk$2(r,o=!1){!o&&!Zr$2(r)&&!Zo$2(r)&&(r=Ut$2(r));const s=Ut$2(this);return d1$2(s).has.call(s,r)||(s.add(r),Jo$1(s,"add",r,r)),this}function Xk$2(r,o,s=!1){!s&&!Zr$2(o)&&!Zo$2(o)&&(o=Ut$2(o));const a=Ut$2(this),{has:l,get:c}=d1$2(a);let u=l.call(a,r);u||(r=Ut$2(r),u=l.call(a,r));const d=c.call(a,r);return a.set(r,o),u?Rr$2(o,d)&&Jo$1(a,"set",r,o):Jo$1(a,"add",r,o),this}function Yk$2(r){const o=Ut$2(this),{has:s,get:a}=d1$2(o);let l=s.call(o,r);l||(r=Ut$2(r),l=s.call(o,r)),a&&a.call(o,r);const c=o.delete(r);return l&&Jo$1(o,"delete",r,void 0),c}function Jk$2(){const r=Ut$2(this),o=r.size!==0,s=r.clear();return o&&Jo$1(r,"clear",void 0,void 0),s}function g1$2(r,o){return function(s,a){const l=this,c=l.__v_raw,u=Ut$2(c),d=o?QE$2:r?tT$2:_r$2;return!r&&br$2(u,"iterate",qc$2),c.forEach((m,g)=>s.call(a,d(m),d(g),l))}}function v1$2(r,o,s){return function(...a){const l=this.__v_raw,c=Ut$2(l),u=rp$2(c),d=r==="entries"||r===Symbol.iterator&&u,m=r==="keys"&&u,g=l[r](...a),y=s?QE$2:o?tT$2:_r$2;return!o&&br$2(c,"iterate",m?JE$2:qc$2),{next(){const{value:_,done:E}=g.next();return E?{value:_,done:E}:{value:d?[y(_[0]),y(_[1])]:y(_),done:E}},[Symbol.iterator](){return this}}}}function ml$2(r){return function(...o){return r==="delete"?!1:r==="clear"?void 0:this}}function Prt(){const r={get(l){return f1$2(this,l)},get size(){return y1$1(this)},has:m1$2,add:Wk$2,set:Xk$2,delete:Yk$2,clear:Jk$2,forEach:g1$2(!1,!1)},o={get(l){return f1$2(this,l,!1,!0)},get size(){return y1$1(this)},has:m1$2,add(l){return Wk$2.call(this,l,!0)},set(l,c){return Xk$2.call(this,l,c,!0)},delete:Yk$2,clear:Jk$2,forEach:g1$2(!1,!0)},s={get(l){return f1$2(this,l,!0)},get size(){return y1$1(this,!0)},has(l){return m1$2.call(this,l,!0)},add:ml$2("add"),set:ml$2("set"),delete:ml$2("delete"),clear:ml$2("clear"),forEach:g1$2(!0,!1)},a={get(l){return f1$2(this,l,!0,!0)},get size(){return y1$1(this,!0)},has(l){return m1$2.call(this,l,!0)},add:ml$2("add"),set:ml$2("set"),delete:ml$2("delete"),clear:ml$2("clear"),forEach:g1$2(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(l=>{r[l]=v1$2(l,!1,!1),s[l]=v1$2(l,!0,!1),o[l]=v1$2(l,!1,!0),a[l]=v1$2(l,!0,!0)}),[r,s,o,a]}const[Drt,Grt,Frt,jrt]=Prt();function b1$2(r,o){const s=o?r?jrt:Frt:r?Grt:Drt;return(a,l,c)=>l==="__v_isReactive"?!r:l==="__v_isReadonly"?r:l==="__v_raw"?a:Reflect.get(we$1(s,l)&&l in a?s:a,l,c)}const Urt={get:b1$2(!1,!1)},$rt={get:b1$2(!1,!0)},Brt={get:b1$2(!0,!1)},Vrt={get:b1$2(!0,!0)},qk$2=new WeakMap,Zk$2=new WeakMap,Qk$2=new WeakMap,Kk$2=new WeakMap;function zrt(r){switch(r){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Hrt(r){return r.__v_skip||!Object.isExtensible(r)?0:zrt(nrt(r))}function Vn$1(r){return Zo$2(r)?r:w1$2(r,!1,Crt,Urt,qk$2)}function KE$1(r){return w1$2(r,!1,krt,$rt,Zk$2)}function _1$2(r){return w1$2(r,!0,Rrt,Brt,Qk$2)}function cp$2(r){return w1$2(r,!0,Lrt,Vrt,Kk$2)}function w1$2(r,o,s,a,l){if(!Re$3(r)||r.__v_raw&&!(o&&r.__v_isReactive))return r;const c=l.get(r);if(c)return c;const u=Hrt(r);if(u===0)return r;const d=new Proxy(r,u===2?a:s);return l.set(r,d),d}function yi$2(r){return Zo$2(r)?yi$2(r.__v_raw):!!(r&&r.__v_isReactive)}function Zo$2(r){return!!(r&&r.__v_isReadonly)}function Zr$2(r){return!!(r&&r.__v_isShallow)}function nm$2(r){return r?!!r.__v_raw:!1}function Ut$2(r){const o=r&&r.__v_raw;return o?Ut$2(o):r}function yn$2(r){return!we$1(r,"__v_skip")&&Object.isExtensible(r)&&Ek$2(r,"__v_skip",!0),r}const _r$2=r=>Re$3(r)?Vn$1(r):r,tT$2=r=>Re$3(r)?_1$2(r):r;function pe$1(r){return r?r.__v_isRef===!0:!1}function tt$3(r){return t6$1(r,!1)}function up$2(r){return t6$1(r,!0)}function t6$1(r,o){return pe$1(r)?r:new Wrt(r,o)}class Wrt{constructor(o,s){this.dep=new u1$2,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?o:Ut$2(o),this._value=s?o:_r$2(o),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(o){const s=this._rawValue,a=this.__v_isShallow||Zr$2(o)||Zo$2(o);o=a?o:Ut$2(o),Rr$2(o,s)&&(this._rawValue=o,this._value=a?o:_r$2(o),this.dep.trigger())}}function e6$1(r){r.dep&&r.dep.trigger()}function It$2(r){return pe$1(r)?r.value:r}function n6$1(r){return Gt$3(r)?r():It$2(r)}const Xrt={get:(r,o,s)=>o==="__v_raw"?r:It$2(Reflect.get(r,o,s)),set:(r,o,s,a)=>{const l=r[o];return pe$1(l)&&!pe$1(s)?(l.value=s,!0):Reflect.set(r,o,s,a)}};function x1$2(r){return yi$2(r)?r:new Proxy(r,Xrt)}class Yrt{constructor(o){this.__v_isRef=!0,this._value=void 0;const s=this.dep=new u1$2,{get:a,set:l}=o(s.track.bind(s),s.trigger.bind(s));this._get=a,this._set=l}get value(){return this._value=this._get()}set value(o){this._set(o)}}function eT$2(r){return new Yrt(r)}function E1$2(r){const o=Et$1(r)?new Array(r.length):{};for(const s in r)o[s]=r6$1(r,s);return o}class Jrt{constructor(o,s,a){this._object=o,this._key=s,this._defaultValue=a,this.__v_isRef=!0,this._value=void 0}get value(){const o=this._object[this._key];return this._value=o===void 0?this._defaultValue:o}set value(o){this._object[this._key]=o}get dep(){return Art(Ut$2(this._object),this._key)}}class qrt{constructor(o){this._getter=o,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function nT$2(r,o,s){return pe$1(r)?r:Gt$3(r)?new qrt(r):Re$3(r)&&arguments.length>1?r6$1(r,o,s):tt$3(r)}function r6$1(r,o,s){const a=r[o];return pe$1(a)?a:new Jrt(r,o,s)}class Zrt{constructor(o,s,a){this.fn=o,this.setter=s,this._value=void 0,this.dep=new u1$2(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Kf$2-1,this.effect=this,this.__v_isReadonly=!s,this.isSSR=a}notify(){if(this.flags|=16,!(this.flags&8)&&He!==this)return Rk$2(this),!0}get value(){const o=this.dep.track();return Pk$2(this),o&&(o.version=this.dep.version),this._value}set value(o){this.setter&&this.setter(o)}}function Qrt(r,o,s=!1){let a,l;return Gt$3(r)?a=r:(a=r.get,l=r.set),new Zrt(a,l,s)}const i6$1={GET:"get",HAS:"has",ITERATE:"iterate"},s6$1={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},T1$2={},S1$2=new WeakMap;let yl$2;function o6$1(){return yl$2}function rT$2(r,o=!1,s=yl$2){if(s){let a=S1$2.get(s);a||S1$2.set(s,a=[]),a.push(r)}}function Krt(r,o,s=le$1){const{immediate:a,deep:l,once:c,scheduler:u,augmentJob:d,call:m}=s,g=D=>l?D:Zr$2(D)||l===!1||l===0?Qo$2(D,1):Qo$2(D);let y,_,E,w,T=!1,k=!1;if(pe$1(r)?(_=()=>r.value,T=Zr$2(r)):yi$2(r)?(_=()=>g(r),T=!0):Et$1(r)?(k=!0,T=r.some(D=>yi$2(D)||Zr$2(D)),_=()=>r.map(D=>{if(pe$1(D))return D.value;if(yi$2(D))return g(D);if(Gt$3(D))return m?m(D,2):D()})):Gt$3(r)?o?_=m?()=>m(r,2):r:_=()=>{if(E){Xo$2();try{E()}finally{Yo$1()}}const D=yl$2;yl$2=y;try{return m?m(r,3,[w]):r(w)}finally{yl$2=D}}:_=sr$2,o&&l){const D=_,P=l===!0?1/0:l;_=()=>Qo$2(D(),P)}const O=c1$2(),R=()=>{y.stop(),O&&jE$2(O.effects,y)};if(c&&o){const D=o;o=(...P)=>{D(...P),R()}}let M=k?new Array(r.length).fill(T1$2):T1$2;const N=D=>{if(!(!(y.flags&1)||!y.dirty&&!D))if(o){const P=y.run();if(l||T||(k?P.some((I,L)=>Rr$2(I,M[L])):Rr$2(P,M))){E&&E();const I=yl$2;yl$2=y;try{const L=[P,M===T1$2?void 0:k&&M[0]===T1$2?[]:M,w];m?m(o,3,L):o(...L),M=P}finally{yl$2=I}}}else y.run()};return d&&d(N),y=new op$2(_),y.scheduler=u?()=>u(N,!1):N,w=D=>rT$2(D,!1,y),E=y.onStop=()=>{const D=S1$2.get(y);if(D){if(m)m(D,4);else for(const P of D)P();S1$2.delete(y)}},o?a?N(!0):M=y.run():u?u(N.bind(null,!0),!0):y.run(),R.pause=y.pause.bind(y),R.resume=y.resume.bind(y),R.stop=R,R}function Qo$2(r,o=1/0,s){if(o<=0||!Re$3(r)||r.__v_skip||(s=s||new Set,s.has(r)))return r;if(s.add(r),o--,pe$1(r))Qo$2(r.value,o,s);else if(Et$1(r))for(let a=0;a{Qo$2(a,o,s)});else if(r1$2(r)){for(const a in r)Qo$2(r[a],o,s);for(const a of Object.getOwnPropertySymbols(r))Object.prototype.propertyIsEnumerable.call(r,a)&&Qo$2(r[a],o,s)}return r}var gl$3={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_970c9b9c-9c28-4e11-91fe-3899b82e4149",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"",npm_config_user_agent:"npm/10.9.0 node/v22.12.0 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_970c9b9c-9c28-4e11-91fe-3899b82e4149",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",OLDPWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"ramp4-pcar4",npm_package_engines_node:"=22.12.0",GRADLE_HOME:"/usr/share/gradle-8.11.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"57148724",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_local_prefix:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",SYSTEMD_EXEC_PID:"834",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20241215.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.10/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.4/x64",JOURNAL_STREAM:"8:6781",GITHUB_WORKFLOW:"Build demo site and deploy to GitHub Pages",_:"/opt/hostedtoolcache/node/22.12.0/x64/bin/npm",npm_config_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",npm_config_npm_version:"10.9.0",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/runner-provisioner.service/memory.pressure",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"12600631880",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"tag",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_BASE_REF:"",ImageOS:"ubuntu24",GITHUB_WORKFLOW_REF:"ramp4-pcar4/ramp4-pcar4/.github/workflows/demo-build.yml@refs/tags/v4.10.2",ACTIONS_ID_TOKEN_REQUEST_TOKEN:"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ikh5cTROQVRBanNucUM3bWRydEFoaHJDUjJfUSJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zLkdlbmVyaWNSZWFkOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCBBY3Rpb25zLlJlc3VsdHM6MTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCBBY3Rpb25zLlVwbG9hZEFydGlmYWN0czowMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAvMTpCdWlsZC9CdWlsZC8xMTg1NiBEaXN0cmlidXRlZFRhc2suR2VuZXJhdGVJZFRva2VuOjEyMjcwNGU1LWRkNWItNGM3Zi04MWM2LTFjNjRjZWI0ZDE2YTpjYTM5NTA4NS0wNDBhLTUyNmItMmNlOC1iZGM4NWY2OTI3NzQgTG9jYXRpb25TZXJ2aWNlLkNvbm5lY3QgUmVhZEFuZFVwZGF0ZUJ1aWxkQnlVcmk6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwLzE6QnVpbGQvQnVpbGQvMTE4NTYiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiJkMmFlN2M1OS1lYjk5LTRhNGMtOGQxOS05N2EwZGY2ZDBhZDkiLCJzaWQiOiIwMWNhN2I4NC03YmZmLTRjYTMtOTM2Mi1iOWI4ODc5ZjFjN2QiLCJhYyI6Ilt7XCJTY29wZVwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcIlBlcm1pc3Npb25cIjozfSx7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9tYWluXCIsXCJQZXJtaXNzaW9uXCI6MX1dIiwiYWNzbCI6IjEwIiwib2lkY19leHRyYSI6IntcInJlZlwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcInNoYVwiOlwiZmEwZjEwYzk5OTgxNWMyZDA0YzJhMjk5NWFkOTA4YTFhMTgzNjMxYlwiLFwicmVwb3NpdG9yeVwiOlwicmFtcDQtcGNhcjQvcmFtcDQtcGNhcjRcIixcInJlcG9zaXRvcnlfb3duZXJcIjpcInJhbXA0LXBjYXI0XCIsXCJyZXBvc2l0b3J5X293bmVyX2lkXCI6XCI1NzE0ODcyNFwiLFwicnVuX2lkXCI6XCIxMjYwMDYzMTg4MFwiLFwicnVuX251bWJlclwiOlwiMTQyXCIsXCJydW5fYXR0ZW1wdFwiOlwiMVwiLFwicmVwb3NpdG9yeV92aXNpYmlsaXR5XCI6XCJwdWJsaWNcIixcInJlcG9zaXRvcnlfaWRcIjpcIjIxODM1NjA1N1wiLFwiYWN0b3JfaWRcIjpcIjc1ODUyNDVcIixcImFjdG9yXCI6XCJqYW1lcy1yYWVcIixcIndvcmtmbG93XCI6XCJCdWlsZCBkZW1vIHNpdGUgYW5kIGRlcGxveSB0byBHaXRIdWIgUGFnZXNcIixcImhlYWRfcmVmXCI6XCJcIixcImJhc2VfcmVmXCI6XCJcIixcImV2ZW50X25hbWVcIjpcInB1c2hcIixcInJlZl9wcm90ZWN0ZWRcIjpcImZhbHNlXCIsXCJyZWZfdHlwZVwiOlwidGFnXCIsXCJ3b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJ3b3JrZmxvd19zaGFcIjpcImZhMGYxMGM5OTk4MTVjMmQwNGMyYTI5OTVhZDkwOGExYTE4MzYzMWJcIixcImVudmlyb25tZW50XCI6XCJnaXRodWItcGFnZXNcIixcImVudmlyb25tZW50X25vZGVfaWRcIjpcIkVOX2t3RE9EUVBaV2M0ZUV4MlpcIixcImpvYl93b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJqb2Jfd29ya2Zsb3dfc2hhXCI6XCJmYTBmMTBjOTk5ODE1YzJkMDRjMmEyOTk1YWQ5MDhhMWExODM2MzFiXCIsXCJydW5uZXJfZW52aXJvbm1lbnRcIjpcImdpdGh1Yi1ob3N0ZWRcIn0iLCJvaWRjX3N1YiI6InJlcG86cmFtcDQtcGNhcjQvcmFtcDQtcGNhcjQ6ZW52aXJvbm1lbnQ6Z2l0aHViLXBhZ2VzIiwib3JjaGlkIjoiMTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhLmJ1aWxkLl9fZGVmYXVsdCIsImlzcyI6InZzdG9rZW4uYWN0aW9ucy5naXRodWJ1c2VyY29udGVudC5jb20iLCJhdWQiOiJ2c3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tfHZzbzpkYzhlN2U0ZC00ZDQ1LTQ4ZDAtYmY4YS02YmQ0YzZjMjQ2MDciLCJuYmYiOjE3MzU5MjA2NTEsImV4cCI6MTczNTk0MzQ1MX0.GDIMaHnR4BV7DsiZYljQVjH7maAY2oeT19GbL0fBsVgnLSFwh82jS97tSwainj2WAOKfT53NDCKgBCLyJEMNXgCLkesDDmaWKNr7E93N8EpiWWaeHC0gWfNng4854FKwe-2rSolRxMqjICH-MEL9daqiLdkvfT1Am5LvlA5gqUJfcXvG1ghyIplZrr_i8EovHetZNOIKC7V8TemKrUnogzxWmWjfE7jkyS6ER92v7Gb7pGnLtjNXoXrsuyXTaUDs6WJQEisuX3DyAlIMTGH35Y_GKb4TZzfcxQzGSIRH6wdbZPPrGnK0bt9mwM846IL1Bg6JmdG8McfmiAWr_xllxg",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_921a48f6-5b8e-4cc8-aff5-dc8fc3bbf3f7",INVOCATION_ID:"819722273f2741acab86958091275df4",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",npm_package_name:"ramp-pcar",GITHUB_ACTION:"__run_4",GITHUB_RUN_NUMBER:"142",GITHUB_TRIGGERING_ACTOR:"james-rae",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 6",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",GITHUB_REF_NAME:"v4.10.2",GITHUB_REPOSITORY:"ramp4-pcar4/ramp4-pcar4",STATS_D_D:"true",npm_lifecycle_script:"vite build --mode esDynamic",npm_config_loglevel:"silent",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"218356057",GITHUB_ACTIONS:"true",STATS_PIP:"false",npm_package_version:"4.10.2",npm_lifecycle_event:"build:esDynamic",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",ACCEPT_EULA:"Y",GITHUB_JOB:"build",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_RUN_ATTEMPT:"1",STATS_D_TC:"true",GITHUB_REF:"refs/tags/v4.10.2",GITHUB_ACTOR:"james-rae",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",npm_config_globalconfig:"/opt/hostedtoolcache/node/22.12.0/x64/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_970c9b9c-9c28-4e11-91fe-3899b82e4149",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",GITHUB_ACTOR_ID:"7585245",RUNNER_WORKSPACE:"/home/runner/work/ramp4-pcar4",npm_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"push",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",ACTIONS_ID_TOKEN_REQUEST_URL:"https://pipelinesghubeus2.actions.githubusercontent.com/CYYZq0bGEiBG5XjoYFUt7ZUW3UppKtccmRBdNq2vSmlX4E20ap/00000000-0000-0000-0000-000000000000/_apis/distributedtask/hubs/Actions/plans/122704e5-dd5b-4c7f-81c6-1c64ceb4d16a/jobs/ca395085-040a-526b-2ce8-bdc85f692774/idtoken?api-version=2.0",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_970c9b9c-9c28-4e11-91fe-3899b82e4149",npm_config_global_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.2.12479018",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",STATS_EXTP:"https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_970c9b9c-9c28-4e11-91fe-3899b82e4149",INIT_CWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",EDITOR:"vi",NODE_ENV:"production"};const Zc$2=[];function tit(r){Zc$2.push(r)}function eit(){Zc$2.pop()}let iT$2=!1;function nit(r,...o){if(iT$2)return;iT$2=!0,Xo$2();const s=Zc$2.length?Zc$2[Zc$2.length-1].component:null,a=s&&s.appContext.config.warnHandler,l=rit();if(a)vl$2(a,s,11,[r+o.map(c=>{var u,d;return(d=(u=c.toString)==null?void 0:u.call(c))!=null?d:JSON.stringify(c)}).join(""),s&&s.proxy,l.map(({vnode:c})=>`at <${FL$2(s,c.type)}>`).join(` -`),l]);else{const c=[`[Vue warn]: ${r}`,...o];l.length&&c.push(` -`,...iit(l)),console.warn(...c)}Yo$1(),iT$2=!1}function rit(){let r=Zc$2[Zc$2.length-1];if(!r)return[];const o=[];for(;r;){const s=o[0];s&&s.vnode===r?s.recurseCount++:o.push({vnode:r,recurseCount:0});const a=r.component&&r.component.parent;r=a&&a.vnode}return o}function iit(r){const o=[];return r.forEach((s,a)=>{o.push(...a===0?[]:[` -`],...sit(s))}),o}function sit({vnode:r,recurseCount:o}){const s=o>0?`... (${o} recursive calls)`:"",a=r.component?r.component.parent==null:!1,l=` at <${FL$2(r.component,r.type,a)}`,c=">"+s;return r.props?[l,...oit(r.props),c]:[l+c]}function oit(r){const o=[],s=Object.keys(r);return s.slice(0,3).forEach(a=>{o.push(...a6$1(a,r[a]))}),s.length>3&&o.push(" ..."),o}function a6$1(r,o,s){return Wt$2(o)?(o=JSON.stringify(o),s?o:[`${r}=${o}`]):typeof o=="number"||typeof o=="boolean"||o==null?s?o:[`${r}=${o}`]:pe$1(o)?(o=a6$1(r,Ut$2(o.value),!0),s?o:[`${r}=Ref<`,o,">"]):Gt$3(o)?[`${r}=fn${o.name?`<${o.name}>`:""}`]:(o=Ut$2(o),s?o:[`${r}=`,o])}function l6$1(r,o){}const c6$1={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},ait={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function vl$2(r,o,s,a){try{return a?r(...a):r()}catch(l){bl$2(l,o,s)}}function gi$2(r,o,s,a){if(Gt$3(r)){const l=vl$2(r,o,s,a);return l&&UE$2(l)&&l.catch(c=>{bl$2(c,o,s)}),l}if(Et$1(r)){const l=[];for(let c=0;c>>1,l=Lr$2[a],c=sm$2(l);c=sm$2(s)?Lr$2.push(r):Lr$2.splice(cit(o),0,r),r.flags|=1,h6$1()}}function h6$1(){!rm$2&&!sT$2&&(sT$2=!0,oT$2=u6$1.then(d6$1))}function im$1(r){Et$1(r)?hp$2.push(...r):_l$2&&r.id===-1?_l$2.splice(pp$2+1,0,r):r.flags&1||(hp$2.push(r),r.flags|=1),h6$1()}function p6$1(r,o,s=rm$2?so$2+1:0){for(;ssm$2(s)-sm$2(a));if(hp$2.length=0,_l$2){_l$2.push(...o);return}for(_l$2=o,pp$2=0;pp$2<_l$2.length;pp$2++){const s=_l$2[pp$2];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}_l$2=null,pp$2=0}}const sm$2=r=>r.id==null?r.flags&2?-1:1/0:r.id;function d6$1(r){sT$2=!1,rm$2=!0;const o=sr$2;try{for(so$2=0;so$2dp$2.emit(l,...c)),I1$2=[]):typeof window<"u"&&window.HTMLElement&&!((a=(s=window.navigator)==null?void 0:s.userAgent)!=null&&a.includes("jsdom"))?((o.__VUE_DEVTOOLS_HOOK_REPLAY__=o.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(l=>{f6$1(l,o)}),setTimeout(()=>{dp$2||(o.__VUE_DEVTOOLS_HOOK_REPLAY__=null,I1$2=[])},3e3)):I1$2=[]}let zn$2=null,M1$1=null;function om$2(r){const o=zn$2;return zn$2=r,M1$1=r&&r.type.__scopeId||null,o}function m6$1(r){M1$1=r}function y6$1(){M1$1=null}const g6$1=r=>gn$1;function gn$1(r,o=zn$2,s){if(!o||r._n)return r;const a=(...l)=>{a._d&&Y1$2(-1);const c=om$2(o);let u;try{u=r(...l)}finally{om$2(c),a._d&&Y1$2(1)}return u};return a._n=!0,a._c=!0,a._d=!0,a}function Ae$1(r,o){if(zn$2===null)return r;const s=_m$1(zn$2),a=r.dirs||(r.dirs=[]);for(let l=0;lr.__isTeleport,am$1=r=>r&&(r.disabled||r.disabled===""),uit=r=>r&&(r.defer||r.defer===""),_6$1=r=>typeof SVGElement<"u"&&r instanceof SVGElement,w6$1=r=>typeof MathMLElement=="function"&&r instanceof MathMLElement,lT$2=(r,o)=>{const s=r&&r.to;return Wt$2(s)?o?o(s):null:s},hit={name:"Teleport",__isTeleport:!0,process(r,o,s,a,l,c,u,d,m,g){const{mc:y,pc:_,pbc:E,o:{insert:w,querySelector:T,createText:k,createComment:O}}=g,R=am$1(o.props);let{shapeFlag:M,children:N,dynamicChildren:D}=o;if(r==null){const P=o.el=k(""),I=o.anchor=k("");w(P,s,a),w(I,s,a);const L=(U,J)=>{M&16&&(l&&l.isCE&&(l.ce._teleportTarget=U),y(N,U,J,l,c,u,d,m))},F=()=>{const U=o.target=lT$2(o.props,T),J=x6$1(U,o,k,w);U&&(u!=="svg"&&_6$1(U)?u="svg":u!=="mathml"&&w6$1(U)&&(u="mathml"),R||(L(U,J),O1$2(o)))};R&&(L(s,I),O1$2(o)),uit(o.props)?Zn$2(F,c):F()}else{o.el=r.el,o.targetStart=r.targetStart;const P=o.anchor=r.anchor,I=o.target=r.target,L=o.targetAnchor=r.targetAnchor,F=am$1(r.props),U=F?s:I,J=F?P:L;if(u==="svg"||_6$1(I)?u="svg":(u==="mathml"||w6$1(I))&&(u="mathml"),D?(E(r.dynamicChildren,D,U,l,c,u,d),DT$1(r,o,!0)):m||_(r,o,U,J,l,c,u,d,!1),R)F?o.props&&r.props&&o.props.to!==r.props.to&&(o.props.to=r.props.to):N1$2(o,s,P,g,1);else if((o.props&&o.props.to)!==(r.props&&r.props.to)){const z=o.target=lT$2(o.props,T);z&&N1$2(o,z,null,g,0)}else F&&N1$2(o,I,L,g,1);O1$2(o)}},remove(r,o,s,{um:a,o:{remove:l}},c){const{shapeFlag:u,children:d,anchor:m,targetStart:g,targetAnchor:y,target:_,props:E}=r;if(_&&(l(g),l(y)),c&&l(m),u&16){const w=c||!am$1(E);for(let T=0;T{r.isMounted=!0}),zi$1(()=>{r.isUnmounting=!0}),r}const Vi=[Function,Array],k1$2={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Vi,onEnter:Vi,onAfterEnter:Vi,onEnterCancelled:Vi,onBeforeLeave:Vi,onLeave:Vi,onAfterLeave:Vi,onLeaveCancelled:Vi,onBeforeAppear:Vi,onAppear:Vi,onAfterAppear:Vi,onAppearCancelled:Vi},E6$1=r=>{const o=r.subTree;return o.component?E6$1(o.component):o},dit={name:"BaseTransition",props:k1$2,setup(r,{slots:o}){const s=In$2(),a=R1$2();return()=>{const l=o.default&&lm$2(o.default(),!0);if(!l||!l.length)return;const c=T6$1(l),u=Ut$2(r),{mode:d}=u;if(a.isLeaving)return hT$2(c);const m=A6$1(c);if(!m)return hT$2(c);let g=Qc$2(m,u,a,s,E=>g=E);m.type!==Sn$2&&ao$2(m,g);const y=s.subTree,_=y&&A6$1(y);if(_&&_.type!==Sn$2&&!xs$2(m,_)&&E6$1(s).type!==Sn$2){const E=Qc$2(_,u,a,s);if(ao$2(_,E),d==="out-in"&&m.type!==Sn$2)return a.isLeaving=!0,E.afterLeave=()=>{a.isLeaving=!1,s.job.flags&8||s.update(),delete E.afterLeave},hT$2(c);d==="in-out"&&m.type!==Sn$2&&(E.delayLeave=(w,T,k)=>{const O=S6$1(a,_);O[String(_.key)]=_,w[wl$2]=()=>{T(),w[wl$2]=void 0,delete g.delayedLeave},g.delayedLeave=k})}return c}}};function T6$1(r){let o=r[0];if(r.length>1){for(const s of r)if(s.type!==Sn$2){o=s;break}}return o}const uT$2=dit;function S6$1(r,o){const{leavingVNodes:s}=r;let a=s.get(o.type);return a||(a=Object.create(null),s.set(o.type,a)),a}function Qc$2(r,o,s,a,l){const{appear:c,mode:u,persisted:d=!1,onBeforeEnter:m,onEnter:g,onAfterEnter:y,onEnterCancelled:_,onBeforeLeave:E,onLeave:w,onAfterLeave:T,onLeaveCancelled:k,onBeforeAppear:O,onAppear:R,onAfterAppear:M,onAppearCancelled:N}=o,D=String(r.key),P=S6$1(s,r),I=(U,J)=>{U&&gi$2(U,a,9,J)},L=(U,J)=>{const z=J[1];I(U,J),Et$1(U)?U.every(ie=>ie.length<=1)&&z():U.length<=1&&z()},F={mode:u,persisted:d,beforeEnter(U){let J=m;if(!s.isMounted)if(c)J=O||m;else return;U[wl$2]&&U[wl$2](!0);const z=P[D];z&&xs$2(r,z)&&z.el[wl$2]&&z.el[wl$2](),I(J,[U])},enter(U){let J=g,z=y,ie=_;if(!s.isMounted)if(c)J=R||g,z=M||y,ie=N||_;else return;let ce=!1;const Y=U[C1$2]=B=>{ce||(ce=!0,B?I(ie,[U]):I(z,[U]),F.delayedLeave&&F.delayedLeave(),U[C1$2]=void 0)};J?L(J,[U,Y]):Y()},leave(U,J){const z=String(r.key);if(U[C1$2]&&U[C1$2](!0),s.isUnmounting)return J();I(E,[U]);let ie=!1;const ce=U[wl$2]=Y=>{ie||(ie=!0,J(),Y?I(k,[U]):I(T,[U]),U[wl$2]=void 0,P[z]===r&&delete P[z])};P[z]=r,w?L(w,[U,ce]):ce()},clone(U){const J=Qc$2(U,o,s,a,l);return l&&l(J),J}};return F}function hT$2(r){if(um$2(r))return r=Es(r),r.children=null,r}function A6$1(r){if(!um$2(r))return b6$1(r.type)&&r.children?T6$1(r.children):r;const{shapeFlag:o,children:s}=r;if(s){if(o&16)return s[0];if(o&32&&Gt$3(s.default))return s.default()}}function ao$2(r,o){r.shapeFlag&6&&r.component?(r.transition=o,ao$2(r.component.subTree,o)):r.shapeFlag&128?(r.ssContent.transition=o.clone(r.ssContent),r.ssFallback.transition=o.clone(r.ssFallback)):r.transition=o}function lm$2(r,o=!1,s){let a=[],l=0;for(let c=0;c1)for(let c=0;cs.value,set:l=>s.value=l})}return s}function L1$1(r,o,s,a,l=!1){if(Et$1(r)){r.forEach((T,k)=>L1$1(T,o&&(Et$1(o)?o[k]:o),s,a,l));return}if(xl$2(a)&&!l)return;const c=a.shapeFlag&4?_m$1(a.component):a.el,u=l?null:c,{i:d,r:m}=r,g=o&&o.r,y=d.refs===le$1?d.refs={}:d.refs,_=d.setupState,E=Ut$2(_),w=_===le$1?()=>!1:T=>we$1(E,T);if(g!=null&&g!==m&&(Wt$2(g)?(y[g]=null,w(g)&&(_[g]=null)):pe$1(g)&&(g.value=null)),Gt$3(m))vl$2(m,d,12,[u,y]);else{const T=Wt$2(m),k=pe$1(m);if(T||k){const O=()=>{if(r.f){const R=T?w(m)?_[m]:y[m]:m.value;l?Et$1(R)&&jE$2(R,c):Et$1(R)?R.includes(c)||R.push(c):T?(y[m]=[c],w(m)&&(_[m]=y[m])):(m.value=[c],r.k&&(y[r.k]=m.value))}else T?(y[m]=u,w(m)&&(_[m]=u)):k&&(m.value=u,r.k&&(y[r.k]=u))};u?(O.id=-1,Zn$2(O,s)):O()}}}let M6$1=!1;const fp$2=()=>{M6$1||(console.error("Hydration completed but contains mismatches."),M6$1=!0)},fit=r=>r.namespaceURI.includes("svg")&&r.tagName!=="foreignObject",mit=r=>r.namespaceURI.includes("MathML"),P1$2=r=>{if(r.nodeType===1){if(fit(r))return"svg";if(mit(r))return"mathml"}},mp$3=r=>r.nodeType===8;function yit(r){const{mt:o,p:s,o:{patchProp:a,createText:l,nextSibling:c,parentNode:u,remove:d,insert:m,createComment:g}}=r,y=(N,D)=>{if(!D.hasChildNodes()){s(null,N,D),A1$1(),D._vnode=N;return}_(D.firstChild,N,null,null,null),A1$1(),D._vnode=N},_=(N,D,P,I,L,F=!1)=>{F=F||!!D.dynamicChildren;const U=mp$3(N)&&N.data==="[",J=()=>k(N,D,P,I,L,U),{type:z,ref:ie,shapeFlag:ce,patchFlag:Y}=D;let B=N.nodeType;D.el=N,Y===-2&&(F=!1,D.dynamicChildren=null);let V=null;switch(z){case lo$2:B!==3?D.children===""?(m(D.el=l(""),u(N),N),V=N):V=J():(N.data!==D.children&&(fp$2(),N.data=D.children),V=c(N));break;case Sn$2:M(N)?(V=c(N),R(D.el=N.content.firstChild,N,P)):B!==8||U?V=J():V=c(N);break;case El$2:if(U&&(N=c(N),B=N.nodeType),B===1||B===3){V=N;const Ge=!D.children.length;for(let St=0;St{F=F||!!D.dynamicChildren;const{type:U,props:J,patchFlag:z,shapeFlag:ie,dirs:ce,transition:Y}=D,B=U==="input"||U==="option";if(B||z!==-1){ce&&oo$2(D,null,P,"created");let V=!1;if(M(N)){V=yL$2(I,Y)&&P&&P.vnode.props&&P.vnode.props.appear;const St=N.content.firstChild;V&&Y.beforeEnter(St),R(St,N,P),D.el=N=St}if(ie&16&&!(J&&(J.innerHTML||J.textContent))){let St=w(N.firstChild,D,N,P,I,L,F);for(;St;){D1$1(N,1)||fp$2();const Dee=St;St=St.nextSibling,d(Dee)}}else if(ie&8){let St=D.children;St[0]===` -`&&(N.tagName==="PRE"||N.tagName==="TEXTAREA")&&(St=St.slice(1)),N.textContent!==St&&(D1$1(N,0)||fp$2(),N.textContent=D.children)}if(J){if(B||!F||z&48){const St=N.tagName.includes("-");for(const Dee in J)(B&&(Dee.endsWith("value")||Dee==="indeterminate")||Xc$2(Dee)&&!pl$1(Dee)||Dee[0]==="."||St)&&a(N,Dee,null,J[Dee],void 0,P)}else if(J.onClick)a(N,"onClick",null,J.onClick,void 0,P);else if(z&4&&yi$2(J.style))for(const St in J.style)J.style[St]}let Ge;(Ge=J&&J.onVnodeBeforeMount)&&Kr$2(Ge,P,D),ce&&oo$2(D,null,P,"beforeMount"),((Ge=J&&J.onVnodeMounted)||ce||V)&&IL$2(()=>{Ge&&Kr$2(Ge,P,D),V&&Y.enter(N),ce&&oo$2(D,null,P,"mounted")},I)}return N.nextSibling},w=(N,D,P,I,L,F,U)=>{U=U||!!D.dynamicChildren;const J=D.children,z=J.length;for(let ie=0;ie{const{slotScopeIds:U}=D;U&&(L=L?L.concat(U):U);const J=u(N),z=w(c(N),D,J,P,I,L,F);return z&&mp$3(z)&&z.data==="]"?c(D.anchor=z):(fp$2(),m(D.anchor=g("]"),J,z),z)},k=(N,D,P,I,L,F)=>{if(D1$1(N.parentElement,1)||fp$2(),D.el=null,F){const z=O(N);for(;;){const ie=c(N);if(ie&&ie!==z)d(ie);else break}}const U=c(N),J=u(N);return d(N),s(null,D,J,U,P,I,P1$2(J),L),U},O=(N,D="[",P="]")=>{let I=0;for(;N;)if(N=c(N),N&&mp$3(N)&&(N.data===D&&I++,N.data===P)){if(I===0)return c(N);I--}return N},R=(N,D,P)=>{const I=D.parentNode;I&&I.replaceChild(N,D);let L=P;for(;L;)L.vnode.el===D&&(L.vnode.el=L.subTree.el=N),L=L.parent},M=N=>N.nodeType===1&&N.tagName==="TEMPLATE";return[y,_]}const N6$1="data-allow-mismatch",git={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function D1$1(r,o){if(o===0||o===1)for(;r&&!r.hasAttribute(N6$1);)r=r.parentElement;const s=r&&r.getAttribute(N6$1);if(s==null)return!1;if(s==="")return!0;{const a=s.split(",");return o===0&&a.includes("children")?!0:s.split(",").includes(git[o])}}const O6$1=(r=1e4)=>o=>{const s=requestIdleCallback(o,{timeout:r});return()=>cancelIdleCallback(s)};function vit(r){const{top:o,left:s,bottom:a,right:l}=r.getBoundingClientRect(),{innerHeight:c,innerWidth:u}=window;return(o>0&&o0&&a0&&s0&&l(o,s)=>{const a=new IntersectionObserver(l=>{for(const c of l)if(c.isIntersecting){a.disconnect(),o();break}},r);return s(l=>{if(l instanceof Element){if(vit(l))return o(),a.disconnect(),!1;a.observe(l)}}),()=>a.disconnect()},R6$1=r=>o=>{if(r){const s=matchMedia(r);if(s.matches)o();else return s.addEventListener("change",o,{once:!0}),()=>s.removeEventListener("change",o)}},k6$1=(r=[])=>(o,s)=>{Wt$2(r)&&(r=[r]);let a=!1;const l=u=>{a||(a=!0,c(),o(),u.target.dispatchEvent(new u.constructor(u.type,u)))},c=()=>{s(u=>{for(const d of r)u.removeEventListener(d,l)})};return s(u=>{for(const d of r)u.addEventListener(d,l,{once:!0})}),c};function bit(r,o){if(mp$3(r)&&r.data==="["){let s=1,a=r.nextSibling;for(;a;){if(a.nodeType===1){if(o(a)===!1)break}else if(mp$3(a))if(a.data==="]"){if(--s===0)break}else a.data==="["&&s++;a=a.nextSibling}}else o(r)}const xl$2=r=>!!r.type.__asyncLoader;function G1$2(r){Gt$3(r)&&(r={loader:r});const{loader:o,loadingComponent:s,errorComponent:a,delay:l=200,hydrate:c,timeout:u,suspensible:d=!0,onError:m}=r;let g=null,y,_=0;const E=()=>(_++,g=null,w()),w=()=>{let T;return g||(T=g=o().catch(k=>{if(k=k instanceof Error?k:new Error(String(k)),m)return new Promise((O,R)=>{m(k,()=>O(E()),()=>R(k),_+1)});throw k}).then(k=>T!==g&&g?g:(k&&(k.__esModule||k[Symbol.toStringTag]==="Module")&&(k=k.default),y=k,k)))};return ne$1({name:"AsyncComponentWrapper",__asyncLoader:w,__asyncHydrate(T,k,O){const R=c?()=>{const M=c(O,N=>bit(T,N));M&&(k.bum||(k.bum=[])).push(M)}:O;y?R():w().then(()=>!k.isUnmounted&&R())},get __asyncResolved(){return y},setup(){const T=An$2;if(pT$2(T),y)return()=>dT$2(y,T);const k=N=>{g=null,bl$2(N,T,13,!a)};if(d&&T.suspense||bm$1)return w().then(N=>()=>dT$2(N,T)).catch(N=>(k(N),()=>a?Zt$2(a,{error:N}):null));const O=tt$3(!1),R=tt$3(),M=tt$3(!!l);return l&&setTimeout(()=>{M.value=!1},l),u!=null&&setTimeout(()=>{if(!O.value&&!R.value){const N=new Error(`Async component timed out after ${u}ms.`);k(N),R.value=N}},u),w().then(()=>{O.value=!0,T.parent&&um$2(T.parent.vnode)&&T.parent.update()}).catch(N=>{k(N),R.value=N}),()=>{if(O.value&&y)return dT$2(y,T);if(R.value&&a)return Zt$2(a,{error:R.value});if(s&&!M.value)return Zt$2(s)}}})}function dT$2(r,o){const{ref:s,props:a,children:l,ce:c}=o.vnode,u=Zt$2(r,a,l);return u.ref=s,u.ce=c,delete o.vnode.ce,u}const um$2=r=>r.type.__isKeepAlive,_it={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(r,{slots:o}){const s=In$2(),a=s.ctx;if(!a.renderer)return()=>{const M=o.default&&o.default();return M&&M.length===1?M[0]:M};const l=new Map,c=new Set;let u=null;const d=s.suspense,{renderer:{p:m,m:g,um:y,o:{createElement:_}}}=a,E=_("div");a.activate=(M,N,D,P,I)=>{const L=M.component;g(M,N,D,0,d),m(L.vnode,M,N,D,L,d,P,M.slotScopeIds,I),Zn$2(()=>{L.isDeactivated=!1,L.a&&sp$2(L.a);const F=M.props&&M.props.onVnodeMounted;F&&Kr$2(F,L.parent,M)},d)},a.deactivate=M=>{const N=M.component;z1$2(N.m),z1$2(N.a),g(M,E,null,1,d),Zn$2(()=>{N.da&&sp$2(N.da);const D=M.props&&M.props.onVnodeUnmounted;D&&Kr$2(D,N.parent,M),N.isDeactivated=!0},d)};function w(M){yT$2(M),y(M,s,d,!0)}function T(M){l.forEach((N,D)=>{const P=Q1$2(N.type);P&&!M(P)&&k(D)})}function k(M){const N=l.get(M);N&&(!u||!xs$2(N,u))?w(N):u&&yT$2(u),l.delete(M),c.delete(M)}Hn$2(()=>[r.include,r.exclude],([M,N])=>{M&&T(D=>hm$1(M,D)),N&&T(D=>!hm$1(N,D))},{flush:"post",deep:!0});let O=null;const R=()=>{O!=null&&(X1$2(s.subTree.type)?Zn$2(()=>{l.set(O,F1$2(s.subTree))},s.subTree.suspense):l.set(O,F1$2(s.subTree)))};return qn$2(R),Kc$2(R),zi$1(()=>{l.forEach(M=>{const{subTree:N,suspense:D}=s,P=F1$2(N);if(M.type===P.type&&M.key===P.key){yT$2(P);const I=P.component.da;I&&Zn$2(I,D);return}w(M)})}),()=>{if(O=null,!o.default)return u=null;const M=o.default(),N=M[0];if(M.length>1)return u=null,M;if(!ws$2(N)||!(N.shapeFlag&4)&&!(N.shapeFlag&128))return u=null,N;let D=F1$2(N);if(D.type===Sn$2)return u=null,D;const P=D.type,I=Q1$2(xl$2(D)?D.type.__asyncResolved||{}:P),{include:L,exclude:F,max:U}=r;if(L&&(!I||!hm$1(L,I))||F&&I&&hm$1(F,I))return D.shapeFlag&=-257,u=D,N;const J=D.key==null?P:D.key,z=l.get(J);return D.el&&(D=Es(D),N.shapeFlag&128&&(N.ssContent=D)),O=J,z?(D.el=z.el,D.component=z.component,D.transition&&ao$2(D,D.transition),D.shapeFlag|=512,c.delete(J),c.add(J)):(c.add(J),U&&c.size>parseInt(U,10)&&k(c.values().next().value)),D.shapeFlag|=256,u=D,X1$2(N.type)?N:D}}},L6$1=_it;function hm$1(r,o){return Et$1(r)?r.some(s=>hm$1(s,o)):Wt$2(r)?r.split(",").includes(o):ert(r)?(r.lastIndex=0,r.test(o)):!1}function fT$1(r,o){P6$1(r,"a",o)}function mT$2(r,o){P6$1(r,"da",o)}function P6$1(r,o,s=An$2){const a=r.__wdc||(r.__wdc=()=>{let l=s;for(;l;){if(l.isDeactivated)return;l=l.parent}return r()});if(j1$2(o,a,s),s){let l=s.parent;for(;l&&l.parent;)um$2(l.parent.vnode)&&wit(a,o,s,l),l=l.parent}}function wit(r,o,s,a){const l=j1$2(o,r,a,!0);tu$2(()=>{jE$2(a[o],l)},s)}function yT$2(r){r.shapeFlag&=-257,r.shapeFlag&=-513}function F1$2(r){return r.shapeFlag&128?r.ssContent:r}function j1$2(r,o,s=An$2,a=!1){if(s){const l=s[r]||(s[r]=[]),c=o.__weh||(o.__weh=(...u)=>{Xo$2();const d=iu$2(s),m=gi$2(o,s,r,u);return d(),Yo$1(),m});return a?l.unshift(c):l.push(c),c}}const Ko$2=r=>(o,s=An$2)=>{(!bm$1||r==="sp")&&j1$2(r,(...a)=>o(...a),s)},yp$2=Ko$2("bm"),qn$2=Ko$2("m"),gT$2=Ko$2("bu"),Kc$2=Ko$2("u"),zi$1=Ko$2("bum"),tu$2=Ko$2("um"),vT$2=Ko$2("sp"),bT$2=Ko$2("rtg"),_T$2=Ko$2("rtc");function U1$2(r,o=An$2){j1$2("ec",r,o)}const wT$1="components",xit="directives";function vn$2(r,o){return xT$2(wT$1,r,!0,o)||r}const D6$1=Symbol.for("v-ndc");function $1$2(r){return Wt$2(r)?xT$2(wT$1,r,!1)||r:r||D6$1}function Ie$2(r){return xT$2(xit,r)}function xT$2(r,o,s=!0,a=!1){const l=zn$2||An$2;if(l){const c=l.type;if(r===wT$1){const d=Q1$2(c,!1);if(d&&(d===o||d===Ze$1(o)||d===dl$2(Ze$1(o))))return c}const u=G6$1(l[r]||c[r],o)||G6$1(l.appContext[r],o);return!u&&a?c:u}}function G6$1(r,o){return r&&(r[o]||r[Ze$1(o)]||r[dl$2(Ze$1(o))])}function ta$3(r,o,s,a){let l;const c=s&&s[a],u=Et$1(r);if(u||Wt$2(r)){const d=u&&yi$2(r);let m=!1;d&&(m=!Zr$2(r),r=p1$2(r)),l=new Array(r.length);for(let g=0,y=r.length;go(d,m,void 0,c&&c[m]));else{const d=Object.keys(r);l=new Array(d.length);for(let m=0,g=d.length;m{const c=a.fn(...l);return c&&(c.key=a.key),c}:a.fn)}return r}function Hi$2(r,o,s={},a,l){if(zn$2.ce||zn$2.parent&&xl$2(zn$2.parent)&&zn$2.parent.ce)return o!=="default"&&(s.name=o),pt$1(),Be(ke$1,null,[Zt$2("slot",s,a&&a())],64);let c=r[o];c&&c._c&&(c._d=!1),pt$1();const u=c&&ET$2(c(s)),d=Be(ke$1,{key:(s.key||u&&u.key||`_${o}`)+(!u&&a?"_fb":"")},u||(a?a():[]),u&&r._===1?64:-2);return!l&&d.scopeId&&(d.slotScopeIds=[d.scopeId+"-s"]),c&&c._c&&(c._d=!0),d}function ET$2(r){return r.some(o=>ws$2(o)?!(o.type===Sn$2||o.type===ke$1&&!ET$2(o.children)):!0)?r:null}function j6$1(r,o){const s={};for(const a in r)s[o&&/[A-Z]/.test(a)?`on:${a}`:Jc$2(a)]=r[a];return s}const TT$2=r=>r?kL$2(r)?_m$1(r):TT$2(r.parent):null,pm$3=he(Object.create(null),{$:r=>r,$el:r=>r.vnode.el,$data:r=>r.data,$props:r=>r.props,$attrs:r=>r.attrs,$slots:r=>r.slots,$refs:r=>r.refs,$parent:r=>TT$2(r.parent),$root:r=>TT$2(r.root),$host:r=>r.ce,$emit:r=>r.emit,$options:r=>MT$1(r),$forceUpdate:r=>r.f||(r.f=()=>{aT$2(r.update)}),$nextTick:r=>r.n||(r.n=Bi$2.bind(r.proxy)),$watch:r=>Fit.bind(r)}),ST$2=(r,o)=>r!==le$1&&!r.__isScriptSetup&&we$1(r,o),AT$2={get({_:r},o){if(o==="__v_skip")return!0;const{ctx:s,setupState:a,data:l,props:c,accessCache:u,type:d,appContext:m}=r;let g;if(o[0]!=="$"){const w=u[o];if(w!==void 0)switch(w){case 1:return a[o];case 2:return l[o];case 4:return s[o];case 3:return c[o]}else{if(ST$2(a,o))return u[o]=1,a[o];if(l!==le$1&&we$1(l,o))return u[o]=2,l[o];if((g=r.propsOptions[0])&&we$1(g,o))return u[o]=3,c[o];if(s!==le$1&&we$1(s,o))return u[o]=4,s[o];IT$2&&(u[o]=0)}}const y=pm$3[o];let _,E;if(y)return o==="$attrs"&&br$2(r.attrs,"get",""),y(r);if((_=d.__cssModules)&&(_=_[o]))return _;if(s!==le$1&&we$1(s,o))return u[o]=4,s[o];if(E=m.config.globalProperties,we$1(E,o))return E[o]},set({_:r},o,s){const{data:a,setupState:l,ctx:c}=r;return ST$2(l,o)?(l[o]=s,!0):a!==le$1&&we$1(a,o)?(a[o]=s,!0):we$1(r.props,o)||o[0]==="$"&&o.slice(1)in r?!1:(c[o]=s,!0)},has({_:{data:r,setupState:o,accessCache:s,ctx:a,appContext:l,propsOptions:c}},u){let d;return!!s[u]||r!==le$1&&we$1(r,u)||ST$2(o,u)||(d=c[0])&&we$1(d,u)||we$1(a,u)||we$1(pm$3,u)||we$1(l.config.globalProperties,u)},defineProperty(r,o,s){return s.get!=null?r._.accessCache[o]=0:we$1(s,"value")&&this.set(r,o,s.value,null),Reflect.defineProperty(r,o,s)}},Eit=he({},AT$2,{get(r,o){if(o!==Symbol.unscopables)return AT$2.get(r,o,r)},has(r,o){return o[0]!=="_"&&!lrt(o)}});function U6$1(){return null}function $6$1(){return null}function B6$1(r){}function V6$1(r){}function z6$1(){return null}function H6$1(){}function W6$1(r,o){return null}function X6$1(){return J6$1().slots}function Y6$1(){return J6$1().attrs}function J6$1(){const r=In$2();return r.setupContext||(r.setupContext=GL$2(r))}function dm$2(r){return Et$1(r)?r.reduce((o,s)=>(o[s]=null,o),{}):r}function q6$1(r,o){const s=dm$2(r);for(const a in o){if(a.startsWith("__skip"))continue;let l=s[a];l?Et$1(l)||Gt$3(l)?l=s[a]={type:l,default:o[a]}:l.default=o[a]:l===null&&(l=s[a]={default:o[a]}),l&&o[`__skip_${a}`]&&(l.skipFactory=!0)}return s}function Z6$1(r,o){return!r||!o?r||o:Et$1(r)&&Et$1(o)?r.concat(o):he({},dm$2(r),dm$2(o))}function Q6$1(r,o){const s={};for(const a in r)o.includes(a)||Object.defineProperty(s,a,{enumerable:!0,get:()=>r[a]});return s}function K6$1(r){const o=In$2();let s=r();return XT$1(),UE$2(s)&&(s=s.catch(a=>{throw iu$2(o),a})),[s,()=>iu$2(o)]}let IT$2=!0;function Tit(r){const o=MT$1(r),s=r.proxy,a=r.ctx;IT$2=!1,o.beforeCreate&&tL$2(o.beforeCreate,r,"bc");const{data:l,computed:c,methods:u,watch:d,provide:m,inject:g,created:y,beforeMount:_,mounted:E,beforeUpdate:w,updated:T,activated:k,deactivated:O,beforeDestroy:R,beforeUnmount:M,destroyed:N,unmounted:D,render:P,renderTracked:I,renderTriggered:L,errorCaptured:F,serverPrefetch:U,expose:J,inheritAttrs:z,components:ie,directives:ce,filters:Y}=o;if(g&&Sit(g,a,null),u)for(const V in u){const Ge=u[V];Gt$3(Ge)&&(a[V]=Ge.bind(s))}if(l){const V=l.call(s,s);Re$3(V)&&(r.data=Vn$1(V))}if(IT$2=!0,c)for(const V in c){const Ge=c[V],St=Gt$3(Ge)?Ge.bind(s,s):Gt$3(Ge.get)?Ge.get.bind(s,s):sr$2,Dee=!Gt$3(Ge)&&Gt$3(Ge.set)?Ge.set.bind(s):sr$2,pee=te({get:St,set:Dee});Object.defineProperty(a,V,{enumerable:!0,configurable:!0,get:()=>pee.value,set:jr=>pee.value=jr})}if(d)for(const V in d)eL$2(d[V],a,s,V);if(m){const V=Gt$3(m)?m.call(s):m;Reflect.ownKeys(V).forEach(Ge=>{V1$2(Ge,V[Ge])})}y&&tL$2(y,r,"c");function B(V,Ge){Et$1(Ge)?Ge.forEach(St=>V(St.bind(s))):Ge&&V(Ge.bind(s))}if(B(yp$2,_),B(qn$2,E),B(gT$2,w),B(Kc$2,T),B(fT$1,k),B(mT$2,O),B(U1$2,F),B(_T$2,I),B(bT$2,L),B(zi$1,M),B(tu$2,D),B(vT$2,U),Et$1(J))if(J.length){const V=r.exposed||(r.exposed={});J.forEach(Ge=>{Object.defineProperty(V,Ge,{get:()=>s[Ge],set:St=>s[Ge]=St})})}else r.exposed||(r.exposed={});P&&r.render===sr$2&&(r.render=P),z!=null&&(r.inheritAttrs=z),ie&&(r.components=ie),ce&&(r.directives=ce),U&&pT$2(r)}function Sit(r,o,s=sr$2){Et$1(r)&&(r=NT$2(r));for(const a in r){const l=r[a];let c;Re$3(l)?"default"in l?c=Pn$2(l.from||a,l.default,!0):c=Pn$2(l.from||a):c=Pn$2(l),pe$1(c)?Object.defineProperty(o,a,{enumerable:!0,configurable:!0,get:()=>c.value,set:u=>c.value=u}):o[a]=c}}function tL$2(r,o,s){gi$2(Et$1(r)?r.map(a=>a.bind(o.proxy)):r.bind(o.proxy),o,s)}function eL$2(r,o,s,a){let l=a.includes(".")?bL$2(s,a):()=>s[a];if(Wt$2(r)){const c=o[r];Gt$3(c)&&Hn$2(l,c)}else if(Gt$3(r))Hn$2(l,r.bind(s));else if(Re$3(r))if(Et$1(r))r.forEach(c=>eL$2(c,o,s,a));else{const c=Gt$3(r.handler)?r.handler.bind(s):o[r.handler];Gt$3(c)&&Hn$2(l,c,r)}}function MT$1(r){const o=r.type,{mixins:s,extends:a}=o,{mixins:l,optionsCache:c,config:{optionMergeStrategies:u}}=r.appContext,d=c.get(o);let m;return d?m=d:!l.length&&!s&&!a?m=o:(m={},l.length&&l.forEach(g=>B1$2(m,g,u,!0)),B1$2(m,o,u)),Re$3(o)&&c.set(o,m),m}function B1$2(r,o,s,a=!1){const{mixins:l,extends:c}=o;c&&B1$2(r,c,s,!0),l&&l.forEach(u=>B1$2(r,u,s,!0));for(const u in o)if(!(a&&u==="expose")){const d=Ait[u]||s&&s[u];r[u]=d?d(r[u],o[u]):o[u]}return r}const Ait={data:nL$2,props:rL$2,emits:rL$2,methods:fm$2,computed:fm$2,beforeCreate:Pr$3,created:Pr$3,beforeMount:Pr$3,mounted:Pr$3,beforeUpdate:Pr$3,updated:Pr$3,beforeDestroy:Pr$3,beforeUnmount:Pr$3,destroyed:Pr$3,unmounted:Pr$3,activated:Pr$3,deactivated:Pr$3,errorCaptured:Pr$3,serverPrefetch:Pr$3,components:fm$2,directives:fm$2,watch:Mit,provide:nL$2,inject:Iit};function nL$2(r,o){return o?r?function(){return he(Gt$3(r)?r.call(this,this):r,Gt$3(o)?o.call(this,this):o)}:o:r}function Iit(r,o){return fm$2(NT$2(r),NT$2(o))}function NT$2(r){if(Et$1(r)){const o={};for(let s=0;s1)return s&&Gt$3(o)?o.call(a&&a.proxy):o}}function OT$1(){return!!(An$2||zn$2||eu$2)}const sL$2={},oL$2=()=>Object.create(sL$2),aL$2=r=>Object.getPrototypeOf(r)===sL$2;function Cit(r,o,s,a=!1){const l={},c=oL$2();r.propsDefaults=Object.create(null),lL$2(r,o,l,c);for(const u in r.propsOptions[0])u in l||(l[u]=void 0);s?r.props=a?l:KE$1(l):r.type.props?r.props=l:r.props=c,r.attrs=c}function Rit(r,o,s,a){const{props:l,attrs:c,vnode:{patchFlag:u}}=r,d=Ut$2(l),[m]=r.propsOptions;let g=!1;if((a||u>0)&&!(u&16)){if(u&8){const y=r.vnode.dynamicProps;for(let _=0;_{m=!0;const[E,w]=cL$2(_,o,!0);he(u,E),w&&d.push(...w)};!s&&o.mixins.length&&o.mixins.forEach(y),r.extends&&y(r.extends),r.mixins&&r.mixins.forEach(y)}if(!c&&!m)return Re$3(r)&&a.set(r,np$2),np$2;if(Et$1(c))for(let y=0;yr[0]==="_"||r==="$stable",RT$1=r=>Et$1(r)?r.map(Qr$2):[Qr$2(r)],Lit=(r,o,s)=>{if(o._n)return o;const a=gn$1((...l)=>(gl$3.NODE_ENV!=="production"&&An$2&&(!s||(s.root,An$2.root)),RT$1(o(...l))),s);return a._c=!1,a},pL$2=(r,o,s)=>{const a=r._ctx;for(const l in r){if(hL$2(l))continue;const c=r[l];if(Gt$3(c))o[l]=Lit(l,c,a);else if(c!=null){const u=RT$1(c);o[l]=()=>u}}},dL$2=(r,o)=>{const s=RT$1(o);r.slots.default=()=>s},fL$2=(r,o,s)=>{for(const a in o)(s||a!=="_")&&(r[a]=o[a])},Pit=(r,o,s)=>{const a=r.slots=oL$2();if(r.vnode.shapeFlag&32){const l=o._;l?(fL$2(a,o,s),s&&Ek$2(a,"_",l,!0)):pL$2(o,a)}else o&&dL$2(r,o)},Dit=(r,o,s)=>{const{vnode:a,slots:l}=r;let c=!0,u=le$1;if(a.shapeFlag&32){const d=o._;d?s&&d===1?c=!1:fL$2(l,o,s):(c=!o.$stable,pL$2(o,l)),u=o}else o&&(dL$2(r,o),u={default:1});if(c)for(const d in l)!hL$2(d)&&u[d]==null&&delete l[d]},Zn$2=IL$2;function kT$1(r){return mL$2(r)}function LT$2(r){return mL$2(r,yit)}function mL$2(r,o){const s=Sk$2();s.__VUE__=!0;const{insert:a,remove:l,patchProp:c,createElement:u,createText:d,createComment:m,setText:g,setElementText:y,parentNode:_,nextSibling:E,setScopeId:w=sr$2,insertStaticContent:T}=r,k=(_ee,st,Lee,$te=null,Kee=null,Iee=null,Rte=void 0,dee=null,fee=!!st.dynamicChildren)=>{if(_ee===st)return;_ee&&!xs$2(_ee,st)&&($te=xte(_ee),Tee(_ee,Kee,Iee,!0),_ee=null),st.patchFlag===-2&&(fee=!1,st.dynamicChildren=null);const{type:Oee,ref:xee,shapeFlag:kee}=st;switch(Oee){case lo$2:O(_ee,st,Lee,$te);break;case Sn$2:R(_ee,st,Lee,$te);break;case El$2:_ee==null&&M(st,Lee,$te,Rte);break;case ke$1:ie(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee);break;default:kee&1?P(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee):kee&6?ce(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee):(kee&64||kee&128)&&Oee.process(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee,Wee)}xee!=null&&Kee&&L1$1(xee,_ee&&_ee.ref,Iee,st||_ee,!st)},O=(_ee,st,Lee,$te)=>{if(_ee==null)a(st.el=d(st.children),Lee,$te);else{const Kee=st.el=_ee.el;st.children!==_ee.children&&g(Kee,st.children)}},R=(_ee,st,Lee,$te)=>{_ee==null?a(st.el=m(st.children||""),Lee,$te):st.el=_ee.el},M=(_ee,st,Lee,$te)=>{[_ee.el,_ee.anchor]=T(_ee.children,st,Lee,$te,_ee.el,_ee.anchor)},N=({el:_ee,anchor:st},Lee,$te)=>{let Kee;for(;_ee&&_ee!==st;)Kee=E(_ee),a(_ee,Lee,$te),_ee=Kee;a(st,Lee,$te)},D=({el:_ee,anchor:st})=>{let Lee;for(;_ee&&_ee!==st;)Lee=E(_ee),l(_ee),_ee=Lee;l(st)},P=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{st.type==="svg"?Rte="svg":st.type==="math"&&(Rte="mathml"),_ee==null?I(st,Lee,$te,Kee,Iee,Rte,dee,fee):U(_ee,st,Kee,Iee,Rte,dee,fee)},I=(_ee,st,Lee,$te,Kee,Iee,Rte,dee)=>{let fee,Oee;const{props:xee,shapeFlag:kee,transition:Dte,dirs:Ite}=_ee;if(fee=_ee.el=u(_ee.type,Iee,xee&&xee.is,xee),kee&8?y(fee,_ee.children):kee&16&&F(_ee.children,fee,null,$te,Kee,PT$1(_ee,Iee),Rte,dee),Ite&&oo$2(_ee,null,$te,"created"),L(fee,_ee,_ee.scopeId,Rte,$te),xee){for(const Vte in xee)Vte!=="value"&&!pl$1(Vte)&&c(fee,Vte,null,xee[Vte],Iee,$te);"value"in xee&&c(fee,"value",null,xee.value,Iee),(Oee=xee.onVnodeBeforeMount)&&Kr$2(Oee,$te,_ee)}Ite&&oo$2(_ee,null,$te,"beforeMount");const Lte=yL$2(Kee,Dte);Lte&&Dte.beforeEnter(fee),a(fee,st,Lee),((Oee=xee&&xee.onVnodeMounted)||Lte||Ite)&&Zn$2(()=>{Oee&&Kr$2(Oee,$te,_ee),Lte&&Dte.enter(fee),Ite&&oo$2(_ee,null,$te,"mounted")},Kee)},L=(_ee,st,Lee,$te,Kee)=>{if(Lee&&w(_ee,Lee),$te)for(let Iee=0;Iee<$te.length;Iee++)w(_ee,$te[Iee]);if(Kee){let Iee=Kee.subTree;if(st===Iee||X1$2(Iee.type)&&(Iee.ssContent===st||Iee.ssFallback===st)){const Rte=Kee.vnode;L(_ee,Rte,Rte.scopeId,Rte.slotScopeIds,Kee.parent)}}},F=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee=0)=>{for(let Oee=fee;Oee<_ee.length;Oee++){const xee=_ee[Oee]=dee?Tl$2(_ee[Oee]):Qr$2(_ee[Oee]);k(null,xee,st,Lee,$te,Kee,Iee,Rte,dee)}},U=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=st.el=_ee.el;let{patchFlag:fee,dynamicChildren:Oee,dirs:xee}=st;fee|=_ee.patchFlag&16;const kee=_ee.props||le$1,Dte=st.props||le$1;let Ite;if(Lee&&nu$3(Lee,!1),(Ite=Dte.onVnodeBeforeUpdate)&&Kr$2(Ite,Lee,st,_ee),xee&&oo$2(st,_ee,Lee,"beforeUpdate"),Lee&&nu$3(Lee,!0),(kee.innerHTML&&Dte.innerHTML==null||kee.textContent&&Dte.textContent==null)&&y(dee,""),Oee?J(_ee.dynamicChildren,Oee,dee,Lee,$te,PT$1(st,Kee),Iee):Rte||St(_ee,st,dee,null,Lee,$te,PT$1(st,Kee),Iee,!1),fee>0){if(fee&16)z(dee,kee,Dte,Lee,Kee);else if(fee&2&&kee.class!==Dte.class&&c(dee,"class",null,Dte.class,Kee),fee&4&&c(dee,"style",kee.style,Dte.style,Kee),fee&8){const Lte=st.dynamicProps;for(let Vte=0;Vte{Ite&&Kr$2(Ite,Lee,st,_ee),xee&&oo$2(st,_ee,Lee,"updated")},$te)},J=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{for(let dee=0;dee{if(st!==Lee){if(st!==le$1)for(const Iee in st)!pl$1(Iee)&&!(Iee in Lee)&&c(_ee,Iee,st[Iee],null,Kee,$te);for(const Iee in Lee){if(pl$1(Iee))continue;const Rte=Lee[Iee],dee=st[Iee];Rte!==dee&&Iee!=="value"&&c(_ee,Iee,dee,Rte,Kee,$te)}"value"in Lee&&c(_ee,"value",st.value,Lee.value,Kee)}},ie=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{const Oee=st.el=_ee?_ee.el:d(""),xee=st.anchor=_ee?_ee.anchor:d("");let{patchFlag:kee,dynamicChildren:Dte,slotScopeIds:Ite}=st;Ite&&(dee=dee?dee.concat(Ite):Ite),_ee==null?(a(Oee,Lee,$te),a(xee,Lee,$te),F(st.children||[],Lee,xee,Kee,Iee,Rte,dee,fee)):kee>0&&kee&64&&Dte&&_ee.dynamicChildren?(J(_ee.dynamicChildren,Dte,Lee,Kee,Iee,Rte,dee),(st.key!=null||Kee&&st===Kee.subTree)&&DT$1(_ee,st,!0)):St(_ee,st,Lee,xee,Kee,Iee,Rte,dee,fee)},ce=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{st.slotScopeIds=dee,_ee==null?st.shapeFlag&512?Kee.ctx.activate(st,Lee,$te,Rte,fee):Y(st,Lee,$te,Kee,Iee,Rte,fee):B(_ee,st,fee)},Y=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=_ee.component=RL$2(_ee,$te,Kee);if(um$2(_ee)&&(dee.ctx.renderer=Wee),LL$2(dee,!1,Rte),dee.asyncDep){if(Kee&&Kee.registerDep(dee,V,Rte),!_ee.el){const fee=dee.subTree=Zt$2(Sn$2);R(null,fee,st,Lee)}}else V(dee,_ee,st,Lee,Kee,Iee,Rte)},B=(_ee,st,Lee)=>{const $te=st.component=_ee.component;if(Vit(_ee,st,Lee))if($te.asyncDep&&!$te.asyncResolved){Ge($te,st,Lee);return}else $te.next=st,$te.update();else st.el=_ee.el,$te.vnode=st},V=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=()=>{if(_ee.isMounted){let{next:kee,bu:Dte,u:Ite,parent:Lte,vnode:Vte}=_ee;{const jte=gL$2(_ee);if(jte){kee&&(kee.el=Vte.el,Ge(_ee,kee,Rte)),jte.asyncDep.then(()=>{_ee.isUnmounted||dee()});return}}let Pte=kee,Fte;nu$3(_ee,!1),kee?(kee.el=Vte.el,Ge(_ee,kee,Rte)):kee=Vte,Dte&&sp$2(Dte),(Fte=kee.props&&kee.props.onVnodeBeforeUpdate)&&Kr$2(Fte,Lte,kee,Vte),nu$3(_ee,!0);const Ute=W1$2(_ee),Gte=_ee.subTree;_ee.subTree=Ute,k(Gte,Ute,_(Gte.el),xte(Gte),_ee,Kee,Iee),kee.el=Ute.el,Pte===null&&$T$1(_ee,Ute.el),Ite&&Zn$2(Ite,Kee),(Fte=kee.props&&kee.props.onVnodeUpdated)&&Zn$2(()=>Kr$2(Fte,Lte,kee,Vte),Kee)}else{let kee;const{el:Dte,props:Ite}=st,{bm:Lte,m:Vte,parent:Pte,root:Fte,type:Ute}=_ee,Gte=xl$2(st);if(nu$3(_ee,!1),Lte&&sp$2(Lte),!Gte&&(kee=Ite&&Ite.onVnodeBeforeMount)&&Kr$2(kee,Pte,st),nu$3(_ee,!0),Dte&&Nte){const jte=()=>{_ee.subTree=W1$2(_ee),Nte(Dte,_ee.subTree,_ee,Kee,null)};Gte&&Ute.__asyncHydrate?Ute.__asyncHydrate(Dte,_ee,jte):jte()}else{Fte.ce&&Fte.ce._injectChildStyle(Ute);const jte=_ee.subTree=W1$2(_ee);k(null,jte,Lee,$te,_ee,Kee,Iee),st.el=jte.el}if(Vte&&Zn$2(Vte,Kee),!Gte&&(kee=Ite&&Ite.onVnodeMounted)){const jte=st;Zn$2(()=>Kr$2(kee,Pte,jte),Kee)}(st.shapeFlag&256||Pte&&xl$2(Pte.vnode)&&Pte.vnode.shapeFlag&256)&&_ee.a&&Zn$2(_ee.a,Kee),_ee.isMounted=!0,st=Lee=$te=null}};_ee.scope.on();const fee=_ee.effect=new op$2(dee);_ee.scope.off();const Oee=_ee.update=fee.run.bind(fee),xee=_ee.job=fee.runIfDirty.bind(fee);xee.i=_ee,xee.id=_ee.uid,fee.scheduler=()=>aT$2(xee),nu$3(_ee,!0),Oee()},Ge=(_ee,st,Lee)=>{st.component=_ee;const $te=_ee.vnode.props;_ee.vnode=st,_ee.next=null,Rit(_ee,st.props,$te,Lee),Dit(_ee,st.children,Lee),Xo$2(),p6$1(_ee),Yo$1()},St=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee=!1)=>{const Oee=_ee&&_ee.children,xee=_ee?_ee.shapeFlag:0,kee=st.children,{patchFlag:Dte,shapeFlag:Ite}=st;if(Dte>0){if(Dte&128){pee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee);return}else if(Dte&256){Dee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee);return}}Ite&8?(xee&16&&ete(Oee,Kee,Iee),kee!==Oee&&y(Lee,kee)):xee&16?Ite&16?pee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee):ete(Oee,Kee,Iee,!0):(xee&8&&y(Lee,""),Ite&16&&F(kee,Lee,$te,Kee,Iee,Rte,dee,fee))},Dee=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{_ee=_ee||np$2,st=st||np$2;const Oee=_ee.length,xee=st.length,kee=Math.min(Oee,xee);let Dte;for(Dte=0;Dtexee?ete(_ee,Kee,Iee,!0,!1,kee):F(st,Lee,$te,Kee,Iee,Rte,dee,fee,kee)},pee=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{let Oee=0;const xee=st.length;let kee=_ee.length-1,Dte=xee-1;for(;Oee<=kee&&Oee<=Dte;){const Ite=_ee[Oee],Lte=st[Oee]=fee?Tl$2(st[Oee]):Qr$2(st[Oee]);if(xs$2(Ite,Lte))k(Ite,Lte,Lee,null,Kee,Iee,Rte,dee,fee);else break;Oee++}for(;Oee<=kee&&Oee<=Dte;){const Ite=_ee[kee],Lte=st[Dte]=fee?Tl$2(st[Dte]):Qr$2(st[Dte]);if(xs$2(Ite,Lte))k(Ite,Lte,Lee,null,Kee,Iee,Rte,dee,fee);else break;kee--,Dte--}if(Oee>kee){if(Oee<=Dte){const Ite=Dte+1,Lte=IteDte)for(;Oee<=kee;)Tee(_ee[Oee],Kee,Iee,!0),Oee++;else{const Ite=Oee,Lte=Oee,Vte=new Map;for(Oee=Lte;Oee<=Dte;Oee++){const zte=st[Oee]=fee?Tl$2(st[Oee]):Qr$2(st[Oee]);zte.key!=null&&Vte.set(zte.key,Oee)}let Pte,Fte=0;const Ute=Dte-Lte+1;let Gte=!1,jte=0;const Bte=new Array(Ute);for(Oee=0;Oee=Ute){Tee(zte,Kee,Iee,!0);continue}let qte;if(zte.key!=null)qte=Vte.get(zte.key);else for(Pte=Lte;Pte<=Dte;Pte++)if(Bte[Pte-Lte]===0&&xs$2(zte,st[Pte])){qte=Pte;break}qte===void 0?Tee(zte,Kee,Iee,!0):(Bte[qte-Lte]=Oee+1,qte>=jte?jte=qte:Gte=!0,k(zte,st[qte],Lee,null,Kee,Iee,Rte,dee,fee),Fte++)}const Hte=Gte?Git(Bte):np$2;for(Pte=Hte.length-1,Oee=Ute-1;Oee>=0;Oee--){const zte=Lte+Oee,qte=st[zte],Wte=zte+1{const{el:Iee,type:Rte,transition:dee,children:fee,shapeFlag:Oee}=_ee;if(Oee&6){jr(_ee.component.subTree,st,Lee,$te);return}if(Oee&128){_ee.suspense.move(st,Lee,$te);return}if(Oee&64){Rte.move(_ee,st,Lee,Wee);return}if(Rte===ke$1){a(Iee,st,Lee);for(let xee=0;xeedee.enter(Iee),Kee);else{const{leave:xee,delayLeave:kee,afterLeave:Dte}=dee,Ite=()=>a(Iee,st,Lee),Lte=()=>{xee(Iee,()=>{Ite(),Dte&&Dte()})};kee?kee(Iee,Ite,Lte):Lte()}else a(Iee,st,Lee)},Tee=(_ee,st,Lee,$te=!1,Kee=!1)=>{const{type:Iee,props:Rte,ref:dee,children:fee,dynamicChildren:Oee,shapeFlag:xee,patchFlag:kee,dirs:Dte,cacheIndex:Ite}=_ee;if(kee===-2&&(Kee=!1),dee!=null&&L1$1(dee,null,Lee,_ee,!0),Ite!=null&&(st.renderCache[Ite]=void 0),xee&256){st.ctx.deactivate(_ee);return}const Lte=xee&1&&Dte,Vte=!xl$2(_ee);let Pte;if(Vte&&(Pte=Rte&&Rte.onVnodeBeforeUnmount)&&Kr$2(Pte,st,_ee),xee&6)yee(_ee.component,Lee,$te);else{if(xee&128){_ee.suspense.unmount(Lee,$te);return}Lte&&oo$2(_ee,null,st,"beforeUnmount"),xee&64?_ee.type.remove(_ee,st,Lee,Wee,$te):Oee&&!Oee.hasOnce&&(Iee!==ke$1||kee>0&&kee&64)?ete(Oee,st,Lee,!1,!0):(Iee===ke$1&&kee&384||!Kee&&xee&16)&&ete(fee,st,Lee),$te&&et(_ee)}(Vte&&(Pte=Rte&&Rte.onVnodeUnmounted)||Lte)&&Zn$2(()=>{Pte&&Kr$2(Pte,st,_ee),Lte&&oo$2(_ee,null,st,"unmounted")},Lee)},et=_ee=>{const{type:st,el:Lee,anchor:$te,transition:Kee}=_ee;if(st===ke$1){ft(Lee,$te);return}if(st===El$2){D(_ee);return}const Iee=()=>{l(Lee),Kee&&!Kee.persisted&&Kee.afterLeave&&Kee.afterLeave()};if(_ee.shapeFlag&1&&Kee&&!Kee.persisted){const{leave:Rte,delayLeave:dee}=Kee,fee=()=>Rte(Lee,Iee);dee?dee(_ee.el,Iee,fee):fee()}else Iee()},ft=(_ee,st)=>{let Lee;for(;_ee!==st;)Lee=E(_ee),l(_ee),_ee=Lee;l(st)},yee=(_ee,st,Lee)=>{const{bum:$te,scope:Kee,job:Iee,subTree:Rte,um:dee,m:fee,a:Oee}=_ee;z1$2(fee),z1$2(Oee),$te&&sp$2($te),Kee.stop(),Iee&&(Iee.flags|=8,Tee(Rte,_ee,st,Lee)),dee&&Zn$2(dee,st),Zn$2(()=>{_ee.isUnmounted=!0},st),st&&st.pendingBranch&&!st.isUnmounted&&_ee.asyncDep&&!_ee.asyncResolved&&_ee.suspenseId===st.pendingId&&(st.deps--,st.deps===0&&st.resolve())},ete=(_ee,st,Lee,$te=!1,Kee=!1,Iee=0)=>{for(let Rte=Iee;Rte<_ee.length;Rte++)Tee(_ee[Rte],st,Lee,$te,Kee)},xte=_ee=>{if(_ee.shapeFlag&6)return xte(_ee.component.subTree);if(_ee.shapeFlag&128)return _ee.suspense.next();const st=E(_ee.anchor||_ee.el),Lee=st&&st[v6$1];return Lee?E(Lee):st};let Ote=!1;const nee=(_ee,st,Lee)=>{_ee==null?st._vnode&&Tee(st._vnode,null,null,!0):k(st._vnode||null,_ee,st,null,null,null,Lee),st._vnode=_ee,Ote||(Ote=!0,p6$1(),A1$1(),Ote=!1)},Wee={p:k,um:Tee,m:jr,r:et,mt:Y,mc:F,pc:St,pbc:J,n:xte,o:r};let Bee,Nte;return o&&([Bee,Nte]=o(Wee)),{render:nee,hydrate:Bee,createApp:Oit(nee,Bee)}}function PT$1({type:r,props:o},s){return s==="svg"&&r==="foreignObject"||s==="mathml"&&r==="annotation-xml"&&o&&o.encoding&&o.encoding.includes("html")?void 0:s}function nu$3({effect:r,job:o},s){s?(r.flags|=32,o.flags|=4):(r.flags&=-33,o.flags&=-5)}function yL$2(r,o){return(!r||r&&!r.pendingBranch)&&o&&!o.persisted}function DT$1(r,o,s=!1){const a=r.children,l=o.children;if(Et$1(a)&&Et$1(l))for(let c=0;c>1,r[s[d]]0&&(o[a]=s[c-1]),s[c]=a)}}for(c=s.length,u=s[c-1];c-- >0;)s[c]=u,u=o[u];return s}function gL$2(r){const o=r.subTree.component;if(o)return o.asyncDep&&!o.asyncResolved?o:gL$2(o)}function z1$2(r){if(r)for(let o=0;oPn$2(GT$2);function vL$2(r,o){return mm$1(r,null,o)}function jT$1(r,o){return mm$1(r,null,{flush:"post"})}function UT$1(r,o){return mm$1(r,null,{flush:"sync"})}function Hn$2(r,o,s){return mm$1(r,o,s)}function mm$1(r,o,s=le$1){const{immediate:a,deep:l,flush:c,once:u}=s,d=he({},s);let m;if(bm$1)if(c==="sync"){const E=FT$1();m=E.__watcherHandles||(E.__watcherHandles=[])}else if(!o||a)d.once=!0;else{const E=()=>{};return E.stop=sr$2,E.resume=sr$2,E.pause=sr$2,E}const g=An$2;d.call=(E,w,T)=>gi$2(E,g,w,T);let y=!1;c==="post"?d.scheduler=E=>{Zn$2(E,g&&g.suspense)}:c!=="sync"&&(y=!0,d.scheduler=(E,w)=>{w?E():aT$2(E)}),d.augmentJob=E=>{o&&(E.flags|=4),y&&(E.flags|=2,g&&(E.id=g.uid,E.i=g))};const _=Krt(r,o,d);return m&&m.push(_),_}function Fit(r,o,s){const a=this.proxy,l=Wt$2(r)?r.includes(".")?bL$2(a,r):()=>a[r]:r.bind(a,a);let c;Gt$3(o)?c=o:(c=o.handler,s=o);const u=iu$2(this),d=mm$1(l,c.bind(a),s);return u(),d}function bL$2(r,o){const s=o.split(".");return()=>{let a=r;for(let l=0;l{let y,_=le$1,E;return UT$1(()=>{const w=r[o];Rr$2(y,w)&&(y=w,g())}),{get(){return m(),s.get?s.get(y):y},set(w){const T=s.set?s.set(w):w;if(!Rr$2(T,y)&&!(_!==le$1&&Rr$2(w,_)))return;const k=a.vnode.props;k&&(o in k||l in k||c in k)&&(`onUpdate:${o}`in k||`onUpdate:${l}`in k||`onUpdate:${c}`in k)||(y=w,g()),a.emit(`update:${o}`,T),Rr$2(w,T)&&Rr$2(w,_)&&!Rr$2(T,E)&&g(),_=w,E=T}}});return d[Symbol.iterator]=()=>{let m=0;return{next(){return m<2?{value:m++?u||le$1:d,done:!1}:{done:!0}}}},d}const wL$2=(r,o)=>o==="modelValue"||o==="model-value"?r.modelModifiers:r[`${o}Modifiers`]||r[`${Ze$1(o)}Modifiers`]||r[`${qr$2(o)}Modifiers`];function jit(r,o,...s){if(r.isUnmounted)return;const a=r.vnode.props||le$1;let l=s;const c=o.startsWith("update:"),u=c&&wL$2(a,o.slice(7));u&&(u.trim&&(l=s.map(y=>Wt$2(y)?y.trim():y)),u.number&&(l=s.map(s1$2)));let d,m=a[d=Jc$2(o)]||a[d=Jc$2(Ze$1(o))];!m&&c&&(m=a[d=Jc$2(qr$2(o))]),m&&gi$2(m,r,6,l);const g=a[d+"Once"];if(g){if(!r.emitted)r.emitted={};else if(r.emitted[d])return;r.emitted[d]=!0,gi$2(g,r,6,l)}}function xL$2(r,o,s=!1){const a=o.emitsCache,l=a.get(r);if(l!==void 0)return l;const c=r.emits;let u={},d=!1;if(!Gt$3(r)){const m=g=>{const y=xL$2(g,o,!0);y&&(d=!0,he(u,y))};!s&&o.mixins.length&&o.mixins.forEach(m),r.extends&&m(r.extends),r.mixins&&r.mixins.forEach(m)}return!c&&!d?(Re$3(r)&&a.set(r,null),null):(Et$1(c)?c.forEach(m=>u[m]=null):he(u,c),Re$3(r)&&a.set(r,u),u)}function H1$2(r,o){return!r||!Xc$2(o)?!1:(o=o.slice(2).replace(/Once$/,""),we$1(r,o[0].toLowerCase()+o.slice(1))||we$1(r,qr$2(o))||we$1(r,o))}function W1$2(r){const{type:o,vnode:s,proxy:a,withProxy:l,propsOptions:[c],slots:u,attrs:d,emit:m,render:g,renderCache:y,props:_,data:E,setupState:w,ctx:T,inheritAttrs:k}=r,O=om$2(r);let R,M;try{if(s.shapeFlag&4){const D=l||a,P=gl$3.NODE_ENV!=="production"&&w.__isScriptSetup?new Proxy(D,{get(I,L,F){return nit(`Property '${String(L)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(I,L,F)}}):D;R=Qr$2(g.call(P,D,y,gl$3.NODE_ENV!=="production"?cp$2(_):_,w,E,T)),M=d}else{const D=o;gl$3.NODE_ENV,R=Qr$2(D.length>1?D(gl$3.NODE_ENV!=="production"?cp$2(_):_,gl$3.NODE_ENV!=="production"?{get attrs(){return cp$2(d)},slots:u,emit:m}:{attrs:d,slots:u,emit:m}):D(gl$3.NODE_ENV!=="production"?cp$2(_):_,null)),M=o.props?d:$it(d)}}catch(D){gm$2.length=0,bl$2(D,r,1),R=Zt$2(Sn$2)}let N=R;if(M&&k!==!1){const D=Object.keys(M),{shapeFlag:P}=N;D.length&&P&7&&(c&&D.some(FE$2)&&(M=Bit(M,c)),N=Es(N,M,!1,!0))}return s.dirs&&(N=Es(N,null,!1,!0),N.dirs=N.dirs?N.dirs.concat(s.dirs):s.dirs),s.transition&&ao$2(N,s.transition),R=N,om$2(O),R}function Uit(r,o=!0){let s;for(let a=0;a{let o;for(const s in r)(s==="class"||s==="style"||Xc$2(s))&&((o||(o={}))[s]=r[s]);return o},Bit=(r,o)=>{const s={};for(const a in r)(!FE$2(a)||!(a.slice(9)in o))&&(s[a]=r[a]);return s};function Vit(r,o,s){const{props:a,children:l,component:c}=r,{props:u,children:d,patchFlag:m}=o,g=c.emitsOptions;if(o.dirs||o.transition)return!0;if(s&&m>=0){if(m&1024)return!0;if(m&16)return a?EL$2(a,u,g):!!u;if(m&8){const y=o.dynamicProps;for(let _=0;_r.__isSuspense;let BT$1=0;const zit={name:"Suspense",__isSuspense:!0,process(r,o,s,a,l,c,u,d,m,g){if(r==null)Hit(o,s,a,l,c,u,d,m,g);else{if(c&&c.deps>0&&!r.suspense.isInFallback){o.suspense=r.suspense,o.suspense.vnode=o,o.el=r.el;return}Wit(r,o,s,a,l,u,d,m,g)}},hydrate:Xit,normalize:Yit},TL$2=zit;function ym$2(r,o){const s=r.props&&r.props[o];Gt$3(s)&&s()}function Hit(r,o,s,a,l,c,u,d,m){const{p:g,o:{createElement:y}}=m,_=y("div"),E=r.suspense=SL$2(r,l,a,o,_,s,c,u,d,m);g(null,E.pendingBranch=r.ssContent,_,null,a,E,c,u),E.deps>0?(ym$2(r,"onPending"),ym$2(r,"onFallback"),g(null,r.ssFallback,o,s,a,null,c,u),gp$2(E,r.ssFallback)):E.resolve(!1,!0)}function Wit(r,o,s,a,l,c,u,d,{p:m,um:g,o:{createElement:y}}){const _=o.suspense=r.suspense;_.vnode=o,o.el=r.el;const E=o.ssContent,w=o.ssFallback,{activeBranch:T,pendingBranch:k,isInFallback:O,isHydrating:R}=_;if(k)_.pendingBranch=E,xs$2(E,k)?(m(k,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0?_.resolve():O&&(R||(m(T,w,s,a,l,null,c,u,d),gp$2(_,w)))):(_.pendingId=BT$1++,R?(_.isHydrating=!1,_.activeBranch=k):g(k,l,_),_.deps=0,_.effects.length=0,_.hiddenContainer=y("div"),O?(m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0?_.resolve():(m(T,w,s,a,l,null,c,u,d),gp$2(_,w))):T&&xs$2(E,T)?(m(T,E,s,a,l,_,c,u,d),_.resolve(!0)):(m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0&&_.resolve()));else if(T&&xs$2(E,T))m(T,E,s,a,l,_,c,u,d),gp$2(_,E);else if(ym$2(o,"onPending"),_.pendingBranch=E,E.shapeFlag&512?_.pendingId=E.component.suspenseId:_.pendingId=BT$1++,m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0)_.resolve();else{const{timeout:M,pendingId:N}=_;M>0?setTimeout(()=>{_.pendingId===N&&_.fallback(w)},M):M===0&&_.fallback(w)}}function SL$2(r,o,s,a,l,c,u,d,m,g,y=!1){const{p:_,m:E,um:w,n:T,o:{parentNode:k,remove:O}}=g;let R;const M=Jit(r);M&&o&&o.pendingBranch&&(R=o.pendingId,o.deps++);const N=r.props?o1$2(r.props.timeout):void 0,D=c,P={vnode:r,parent:o,parentComponent:s,namespace:u,container:a,hiddenContainer:l,deps:0,pendingId:BT$1++,timeout:typeof N=="number"?N:-1,activeBranch:null,pendingBranch:null,isInFallback:!y,isHydrating:y,isUnmounted:!1,effects:[],resolve(I=!1,L=!1){const{vnode:F,activeBranch:U,pendingBranch:J,pendingId:z,effects:ie,parentComponent:ce,container:Y}=P;let B=!1;P.isHydrating?P.isHydrating=!1:I||(B=U&&J.transition&&J.transition.mode==="out-in",B&&(U.transition.afterLeave=()=>{z===P.pendingId&&(E(J,Y,c===D?T(U):c,0),im$1(ie))}),U&&(k(U.el)===Y&&(c=T(U)),w(U,ce,P,!0)),B||E(J,Y,c,0)),gp$2(P,J),P.pendingBranch=null,P.isInFallback=!1;let V=P.parent,Ge=!1;for(;V;){if(V.pendingBranch){V.effects.push(...ie),Ge=!0;break}V=V.parent}!Ge&&!B&&im$1(ie),P.effects=[],M&&o&&o.pendingBranch&&R===o.pendingId&&(o.deps--,o.deps===0&&!L&&o.resolve()),ym$2(F,"onResolve")},fallback(I){if(!P.pendingBranch)return;const{vnode:L,activeBranch:F,parentComponent:U,container:J,namespace:z}=P;ym$2(L,"onFallback");const ie=T(F),ce=()=>{P.isInFallback&&(_(null,I,J,ie,U,null,z,d,m),gp$2(P,I))},Y=I.transition&&I.transition.mode==="out-in";Y&&(F.transition.afterLeave=ce),P.isInFallback=!0,w(F,U,null,!0),Y||ce()},move(I,L,F){P.activeBranch&&E(P.activeBranch,I,L,F),P.container=I},next(){return P.activeBranch&&T(P.activeBranch)},registerDep(I,L,F){const U=!!P.pendingBranch;U&&P.deps++;const J=I.vnode.el;I.asyncDep.catch(z=>{bl$2(z,I,0)}).then(z=>{if(I.isUnmounted||P.isUnmounted||P.pendingId!==I.suspenseId)return;I.asyncResolved=!0;const{vnode:ie}=I;YT$1(I,z,!1),J&&(ie.el=J);const ce=!J&&I.subTree.el;L(I,ie,k(J||I.subTree.el),J?null:T(I.subTree),P,u,F),ce&&O(ce),$T$1(I,ie.el),U&&--P.deps===0&&P.resolve()})},unmount(I,L){P.isUnmounted=!0,P.activeBranch&&w(P.activeBranch,s,I,L),P.pendingBranch&&w(P.pendingBranch,s,I,L)}};return P}function Xit(r,o,s,a,l,c,u,d,m){const g=o.suspense=SL$2(o,a,s,r.parentNode,document.createElement("div"),null,l,c,u,d,!0),y=m(r,g.pendingBranch=o.ssContent,s,g,c,u);return g.deps===0&&g.resolve(!1,!0),y}function Yit(r){const{shapeFlag:o,children:s}=r,a=o&32;r.ssContent=AL$2(a?s.default:s),r.ssFallback=a?AL$2(s.fallback):Zt$2(Sn$2)}function AL$2(r){let o;if(Gt$3(r)){const s=ru$2&&r._c;s&&(r._d=!1,pt$1()),r=r(),s&&(r._d=!0,o=wr$3,ML$2())}return Et$1(r)&&(r=Uit(r)),r=Qr$2(r),o&&!r.dynamicChildren&&(r.dynamicChildren=o.filter(s=>s!==r)),r}function IL$2(r,o){o&&o.pendingBranch?Et$1(r)?o.effects.push(...r):o.effects.push(r):im$1(r)}function gp$2(r,o){r.activeBranch=o;const{vnode:s,parentComponent:a}=r;let l=o.el;for(;!l&&o.component;)o=o.component.subTree,l=o.el;s.el=l,a&&a.subTree===s&&(a.vnode.el=l,$T$1(a,l))}function Jit(r){const o=r.props&&r.props.suspensible;return o!=null&&o!==!1}const ke$1=Symbol.for("v-fgt"),lo$2=Symbol.for("v-txt"),Sn$2=Symbol.for("v-cmt"),El$2=Symbol.for("v-stc"),gm$2=[];let wr$3=null;function pt$1(r=!1){gm$2.push(wr$3=r?null:[])}function ML$2(){gm$2.pop(),wr$3=gm$2[gm$2.length-1]||null}let ru$2=1;function Y1$2(r){ru$2+=r,r<0&&wr$3&&(wr$3.hasOnce=!0)}function NL$4(r){return r.dynamicChildren=ru$2>0?wr$3||np$2:null,ML$2(),ru$2>0&&wr$3&&wr$3.push(r),r}function wt(r,o,s,a,l,c){return NL$4(lt$3(r,o,s,a,l,c,!0))}function Be(r,o,s,a,l){return NL$4(Zt$2(r,o,s,a,l,!0))}function ws$2(r){return r?r.__v_isVNode===!0:!1}function xs$2(r,o){return r.type===o.type&&r.key===o.key}function OL$2(r){}const CL$2=({key:r})=>r??null,J1$2=({ref:r,ref_key:o,ref_for:s})=>(typeof r=="number"&&(r=""+r),r!=null?Wt$2(r)||pe$1(r)||Gt$3(r)?{i:zn$2,r,k:o,f:!!s}:r:null);function lt$3(r,o=null,s=null,a=0,l=null,c=r===ke$1?0:1,u=!1,d=!1){const m={__v_isVNode:!0,__v_skip:!0,type:r,props:o,key:o&&CL$2(o),ref:o&&J1$2(o),scopeId:M1$1,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:a,dynamicProps:l,dynamicChildren:null,appContext:null,ctx:zn$2};return d?(HT$1(m,s),c&128&&r.normalize(m)):s&&(m.shapeFlag|=Wt$2(s)?8:16),ru$2>0&&!u&&wr$3&&(m.patchFlag>0||c&6)&&m.patchFlag!==32&&wr$3.push(m),m}const Zt$2=qit;function qit(r,o=null,s=null,a=0,l=null,c=!1){if((!r||r===D6$1)&&(r=Sn$2),ws$2(r)){const d=Es(r,o,!0);return s&&HT$1(d,s),ru$2>0&&!c&&wr$3&&(d.shapeFlag&6?wr$3[wr$3.indexOf(r)]=d:wr$3.push(d)),d.patchFlag=-2,d}if(rst(r)&&(r=r.__vccOpts),o){o=VT$1(o);let{class:d,style:m}=o;d&&!Wt$2(d)&&(o.class=an$2(d)),Re$3(m)&&(nm$2(m)&&!Et$1(m)&&(m=he({},m)),o.style=Wo$1(m))}const u=Wt$2(r)?1:X1$2(r)?128:b6$1(r)?64:Re$3(r)?4:Gt$3(r)?2:0;return lt$3(r,o,s,a,l,u,c,!0)}function VT$1(r){return r?nm$2(r)||aL$2(r)?he({},r):r:null}function Es(r,o,s=!1,a=!1){const{props:l,ref:c,patchFlag:u,children:d,transition:m}=r,g=o?vm$2(l||{},o):l,y={__v_isVNode:!0,__v_skip:!0,type:r.type,props:g,key:g&&CL$2(g),ref:o&&o.ref?s&&c?Et$1(c)?c.concat(J1$2(o)):[c,J1$2(o)]:J1$2(o):c,scopeId:r.scopeId,slotScopeIds:r.slotScopeIds,children:d,target:r.target,targetStart:r.targetStart,targetAnchor:r.targetAnchor,staticCount:r.staticCount,shapeFlag:r.shapeFlag,patchFlag:o&&r.type!==ke$1?u===-1?16:u|16:u,dynamicProps:r.dynamicProps,dynamicChildren:r.dynamicChildren,appContext:r.appContext,dirs:r.dirs,transition:m,component:r.component,suspense:r.suspense,ssContent:r.ssContent&&Es(r.ssContent),ssFallback:r.ssFallback&&Es(r.ssFallback),el:r.el,anchor:r.anchor,ctx:r.ctx,ce:r.ce};return m&&a&&ao$2(y,m.clone(y)),y}function Ts$1(r=" ",o=0){return Zt$2(lo$2,null,r,o)}function zT$1(r,o){const s=Zt$2(El$2,null,r);return s.staticCount=o,s}function We$1(r="",o=!1){return o?(pt$1(),Be(Sn$2,null,r)):Zt$2(Sn$2,null,r)}function Qr$2(r){return r==null||typeof r=="boolean"?Zt$2(Sn$2):Et$1(r)?Zt$2(ke$1,null,r.slice()):ws$2(r)?Tl$2(r):Zt$2(lo$2,null,String(r))}function Tl$2(r){return r.el===null&&r.patchFlag!==-1||r.memo?r:Es(r)}function HT$1(r,o){let s=0;const{shapeFlag:a}=r;if(o==null)o=null;else if(Et$1(o))s=16;else if(typeof o=="object")if(a&65){const l=o.default;l&&(l._c&&(l._d=!1),HT$1(r,l()),l._c&&(l._d=!0));return}else{s=32;const l=o._;!l&&!aL$2(o)?o._ctx=zn$2:l===3&&zn$2&&(zn$2.slots._===1?o._=1:(o._=2,r.patchFlag|=1024))}else Gt$3(o)?(o={default:o,_ctx:zn$2},s=32):(o=String(o),a&64?(s=16,o=[Ts$1(o)]):s=8);r.children=o,r.shapeFlag|=s}function vm$2(...r){const o={};for(let s=0;sAn$2||zn$2;let q1$2,WT$1;{const r=Sk$2(),o=(s,a)=>{let l;return(l=r[s])||(l=r[s]=[]),l.push(a),c=>{l.length>1?l.forEach(u=>u(c)):l[0](c)}};q1$2=o("__VUE_INSTANCE_SETTERS__",s=>An$2=s),WT$1=o("__VUE_SSR_SETTERS__",s=>bm$1=s)}const iu$2=r=>{const o=An$2;return q1$2(r),r.scope.on(),()=>{r.scope.off(),q1$2(o)}},XT$1=()=>{An$2&&An$2.scope.off(),q1$2(null)};function kL$2(r){return r.vnode.shapeFlag&4}let bm$1=!1;function LL$2(r,o=!1,s=!1){o&&WT$1(o);const{props:a,children:l}=r.vnode,c=kL$2(r);Cit(r,a,c,o),Pit(r,l,s);const u=c?Kit(r,o):void 0;return o&&WT$1(!1),u}function Kit(r,o){const s=r.type;r.accessCache=Object.create(null),r.proxy=new Proxy(r.ctx,AT$2);const{setup:a}=s;if(a){const l=r.setupContext=a.length>1?GL$2(r):null,c=iu$2(r);Xo$2();const u=vl$2(a,r,0,[r.props,l]);if(Yo$1(),c(),UE$2(u)){if(xl$2(r)||pT$2(r),u.then(XT$1,XT$1),o)return u.then(d=>{YT$1(r,d,o)}).catch(d=>{bl$2(d,r,0)});r.asyncDep=u}else YT$1(r,u,o)}else DL$2(r,o)}function YT$1(r,o,s){Gt$3(o)?r.type.__ssrInlineRender?r.ssrRender=o:r.render=o:Re$3(o)&&(r.setupState=x1$2(o)),DL$2(r,s)}let Z1$2,JT$1;function qT$1(r){Z1$2=r,JT$1=o=>{o.render._rc&&(o.withProxy=new Proxy(o.ctx,Eit))}}const PL$2=()=>!Z1$2;function DL$2(r,o,s){const a=r.type;if(!r.render){if(!o&&Z1$2&&!a.render){const l=a.template||MT$1(r).template;if(l){const{isCustomElement:c,compilerOptions:u}=r.appContext.config,{delimiters:d,compilerOptions:m}=a,g=he(he({isCustomElement:c,delimiters:d},u),m);a.render=Z1$2(l,g)}}r.render=a.render||sr$2,JT$1&&JT$1(r)}{const l=iu$2(r);Xo$2();try{Tit(r)}finally{Yo$1(),l()}}}const tst={get(r,o){return br$2(r,"get",""),r[o]}};function GL$2(r){const o=s=>{r.exposed=s||{}};return{attrs:new Proxy(r.attrs,tst),slots:r.slots,emit:r.emit,expose:o}}function _m$1(r){return r.exposed?r.exposeProxy||(r.exposeProxy=new Proxy(x1$2(yn$2(r.exposed)),{get(o,s){if(s in o)return o[s];if(s in pm$3)return pm$3[s](r)},has(o,s){return s in o||s in pm$3}})):r.proxy}const est=/(?:^|[-_])(\w)/g,nst=r=>r.replace(est,o=>o.toUpperCase()).replace(/[-_]/g,"");function Q1$2(r,o=!0){return Gt$3(r)?r.displayName||r.name:r.name||o&&r.__name}function FL$2(r,o,s=!1){let a=Q1$2(o);if(!a&&o.__file){const l=o.__file.match(/([^/\\]+)\.\w+$/);l&&(a=l[1])}if(!a&&r&&r.parent){const l=c=>{for(const u in c)if(c[u]===o)return u};a=l(r.components||r.parent.type.components)||l(r.appContext.components)}return a?nst(a):s?"App":"Anonymous"}function rst(r){return Gt$3(r)&&"__vccOpts"in r}const te=(r,o)=>Qrt(r,o,bm$1);function vi$1(r,o,s){const a=arguments.length;return a===2?Re$3(o)&&!Et$1(o)?ws$2(o)?Zt$2(r,null,[o]):Zt$2(r,o):Zt$2(r,null,o):(a>3?s=Array.prototype.slice.call(arguments,2):a===3&&ws$2(s)&&(s=[s]),Zt$2(r,o,s))}function jL$2(){}function UL$2(r,o,s,a){const l=s[a];if(l&&ZT$1(l,r))return l;const c=o();return c.memo=r.slice(),c.cacheIndex=a,s[a]=c}function ZT$1(r,o){const s=r.memo;if(s.length!=o.length)return!1;for(let a=0;a0&&wr$3&&wr$3.push(r),!0}const QT$1="3.5.9",$L$2=sr$2,BL$2=ait,VL$2=dp$2,zL$2=f6$1,ist={createComponentInstance:RL$2,setupComponent:LL$2,renderComponentRoot:W1$2,setCurrentRenderingInstance:om$2,isVNode:ws$2,normalizeVNode:Qr$2,getComponentPublicInstance:_m$1,ensureValidVNode:ET$2,pushWarningContext:tit,popWarningContext:eit},HL$2=ist,WL$2=null,XL$2=null,YL$2=null;let KT$1;const JL$2=typeof window<"u"&&window.trustedTypes;if(JL$2)try{KT$1=JL$2.createPolicy("vue",{createHTML:r=>r})}catch{}const qL$2=KT$1?r=>KT$1.createHTML(r):r=>r,sst="http://www.w3.org/2000/svg",ost="http://www.w3.org/1998/Math/MathML",ea$2=typeof document<"u"?document:null,ZL$2=ea$2&&ea$2.createElement("template"),ast$1={insert:(r,o,s)=>{o.insertBefore(r,s||null)},remove:r=>{const o=r.parentNode;o&&o.removeChild(r)},createElement:(r,o,s,a)=>{const l=o==="svg"?ea$2.createElementNS(sst,r):o==="mathml"?ea$2.createElementNS(ost,r):s?ea$2.createElement(r,{is:s}):ea$2.createElement(r);return r==="select"&&a&&a.multiple!=null&&l.setAttribute("multiple",a.multiple),l},createText:r=>ea$2.createTextNode(r),createComment:r=>ea$2.createComment(r),setText:(r,o)=>{r.nodeValue=o},setElementText:(r,o)=>{r.textContent=o},parentNode:r=>r.parentNode,nextSibling:r=>r.nextSibling,querySelector:r=>ea$2.querySelector(r),setScopeId(r,o){r.setAttribute(o,"")},insertStaticContent(r,o,s,a,l,c){const u=s?s.previousSibling:o.lastChild;if(l&&(l===c||l.nextSibling))for(;o.insertBefore(l.cloneNode(!0),s),!(l===c||!(l=l.nextSibling)););else{ZL$2.innerHTML=qL$2(a==="svg"?`${r}`:a==="mathml"?`${r}`:r);const d=ZL$2.content;if(a==="svg"||a==="mathml"){const m=d.firstChild;for(;m.firstChild;)d.appendChild(m.firstChild);d.removeChild(m)}o.insertBefore(d,s)}return[u?u.nextSibling:o.firstChild,s?s.previousSibling:o.lastChild]}},Sl$1="transition",wm$2="animation",vp$2=Symbol("_vtc"),QL$2={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},KL$2=he({},k1$2,QL$2),lst=r=>(r.displayName="Transition",r.props=KL$2,r),xm$2=lst((r,{slots:o})=>vi$1(uT$2,e9$1(r),o)),su$2=(r,o=[])=>{Et$1(r)?r.forEach(s=>s(...o)):r&&r(...o)},t9$1=r=>r?Et$1(r)?r.some(o=>o.length>1):r.length>1:!1;function e9$1(r){const o={};for(const ie in r)ie in QL$2||(o[ie]=r[ie]);if(r.css===!1)return o;const{name:s="v",type:a,duration:l,enterFromClass:c=`${s}-enter-from`,enterActiveClass:u=`${s}-enter-active`,enterToClass:d=`${s}-enter-to`,appearFromClass:m=c,appearActiveClass:g=u,appearToClass:y=d,leaveFromClass:_=`${s}-leave-from`,leaveActiveClass:E=`${s}-leave-active`,leaveToClass:w=`${s}-leave-to`}=r,T=cst(l),k=T&&T[0],O=T&&T[1],{onBeforeEnter:R,onEnter:M,onEnterCancelled:N,onLeave:D,onLeaveCancelled:P,onBeforeAppear:I=R,onAppear:L=M,onAppearCancelled:F=N}=o,U=(ie,ce,Y)=>{Al$2(ie,ce?y:d),Al$2(ie,ce?g:u),Y&&Y()},J=(ie,ce)=>{ie._isLeaving=!1,Al$2(ie,_),Al$2(ie,w),Al$2(ie,E),ce&&ce()},z=ie=>(ce,Y)=>{const B=ie?L:M,V=()=>U(ce,ie,Y);su$2(B,[ce,V]),n9$1(()=>{Al$2(ce,ie?m:c),na$2(ce,ie?y:d),t9$1(B)||r9$1(ce,a,k,V)})};return he(o,{onBeforeEnter(ie){su$2(R,[ie]),na$2(ie,c),na$2(ie,u)},onBeforeAppear(ie){su$2(I,[ie]),na$2(ie,m),na$2(ie,g)},onEnter:z(!1),onAppear:z(!0),onLeave(ie,ce){ie._isLeaving=!0;const Y=()=>J(ie,ce);na$2(ie,_),na$2(ie,E),a9$1(),n9$1(()=>{ie._isLeaving&&(Al$2(ie,_),na$2(ie,w),t9$1(D)||r9$1(ie,a,O,Y))}),su$2(D,[ie,Y])},onEnterCancelled(ie){U(ie,!1),su$2(N,[ie])},onAppearCancelled(ie){U(ie,!0),su$2(F,[ie])},onLeaveCancelled(ie){J(ie),su$2(P,[ie])}})}function cst(r){if(r==null)return null;if(Re$3(r))return[t3$1(r.enter),t3$1(r.leave)];{const o=t3$1(r);return[o,o]}}function t3$1(r){return o1$2(r)}function na$2(r,o){o.split(/\s+/).forEach(s=>s&&r.classList.add(s)),(r[vp$2]||(r[vp$2]=new Set)).add(o)}function Al$2(r,o){o.split(/\s+/).forEach(a=>a&&r.classList.remove(a));const s=r[vp$2];s&&(s.delete(o),s.size||(r[vp$2]=void 0))}function n9$1(r){requestAnimationFrame(()=>{requestAnimationFrame(r)})}let ust=0;function r9$1(r,o,s,a){const l=r._endId=++ust,c=()=>{l===r._endId&&a()};if(s!=null)return setTimeout(c,s);const{type:u,timeout:d,propCount:m}=i9$1(r,o);if(!u)return a();const g=u+"end";let y=0;const _=()=>{r.removeEventListener(g,E),c()},E=w=>{w.target===r&&++y>=m&&_()};setTimeout(()=>{y(s[T]||"").split(", "),l=a(`${Sl$1}Delay`),c=a(`${Sl$1}Duration`),u=s9$1(l,c),d=a(`${wm$2}Delay`),m=a(`${wm$2}Duration`),g=s9$1(d,m);let y=null,_=0,E=0;o===Sl$1?u>0&&(y=Sl$1,_=u,E=c.length):o===wm$2?g>0&&(y=wm$2,_=g,E=m.length):(_=Math.max(u,g),y=_>0?u>g?Sl$1:wm$2:null,E=y?y===Sl$1?c.length:m.length:0);const w=y===Sl$1&&/\b(transform|all)(,|$)/.test(a(`${Sl$1}Property`).toString());return{type:y,timeout:_,propCount:E,hasTransform:w}}function s9$1(r,o){for(;r.lengtho9$1(s)+o9$1(r[a])))}function o9$1(r){return r==="auto"?0:Number(r.slice(0,-1).replace(",","."))*1e3}function a9$1(){return document.body.offsetHeight}function hst(r,o,s){const a=r[vp$2];a&&(o=(o?[o,...a]:[...a]).join(" ")),o==null?r.removeAttribute("class"):s?r.setAttribute("class",o):r.className=o}const K1$2=Symbol("_vod"),l9$1=Symbol("_vsh"),Em$1={beforeMount(r,{value:o},{transition:s}){r[K1$2]=r.style.display==="none"?"":r.style.display,s&&o?s.beforeEnter(r):Tm$2(r,o)},mounted(r,{value:o},{transition:s}){s&&o&&s.enter(r)},updated(r,{value:o,oldValue:s},{transition:a}){!o!=!s&&(a?o?(a.beforeEnter(r),Tm$2(r,!0),a.enter(r)):a.leave(r,()=>{Tm$2(r,!1)}):Tm$2(r,o))},beforeUnmount(r,{value:o}){Tm$2(r,o)}};function Tm$2(r,o){r.style.display=o?r[K1$2]:"none",r[l9$1]=!o}function pst(){Em$1.getSSRProps=({value:r})=>{if(!r)return{style:{display:"none"}}}}const c9$1=Symbol("");function u9$1(r){const o=In$2();if(!o)return;const s=o.ut=(l=r(o.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${o.uid}"]`)).forEach(c=>tv$2(c,l))},a=()=>{const l=r(o.proxy);o.ce?tv$2(o.ce,l):e3$1(o.subTree,l),s(l)};yp$2(()=>{jT$1(a)}),qn$2(()=>{const l=new MutationObserver(a);l.observe(o.subTree.el.parentNode,{childList:!0}),tu$2(()=>l.disconnect())})}function e3$1(r,o){if(r.shapeFlag&128){const s=r.suspense;r=s.activeBranch,s.pendingBranch&&!s.isHydrating&&s.effects.push(()=>{e3$1(s.activeBranch,o)})}for(;r.component;)r=r.component.subTree;if(r.shapeFlag&1&&r.el)tv$2(r.el,o);else if(r.type===ke$1)r.children.forEach(s=>e3$1(s,o));else if(r.type===El$2){let{el:s,anchor:a}=r;for(;s&&(tv$2(s,o),s!==a);)s=s.nextSibling}}function tv$2(r,o){if(r.nodeType===1){const s=r.style;let a="";for(const l in o)s.setProperty(`--${l}`,o[l]),a+=`--${l}: ${o[l]};`;s[c9$1]=a}}const dst=/(^|;)\s*display\s*:/;function fst(r,o,s){const a=r.style,l=Wt$2(s);let c=!1;if(s&&!l){if(o)if(Wt$2(o))for(const u of o.split(";")){const d=u.slice(0,u.indexOf(":")).trim();s[d]==null&&ev$2(a,d,"")}else for(const u in o)s[u]==null&&ev$2(a,u,"");for(const u in s)u==="display"&&(c=!0),ev$2(a,u,s[u])}else if(l){if(o!==s){const u=a[c9$1];u&&(s+=";"+u),a.cssText=s,c=dst.test(s)}}else o&&r.removeAttribute("style");K1$2 in r&&(r[K1$2]=c?a.display:"",r[l9$1]&&(a.display="none"))}const h9$1=/\s*!important$/;function ev$2(r,o,s){if(Et$1(s))s.forEach(a=>ev$2(r,o,a));else if(s==null&&(s=""),o.startsWith("--"))r.setProperty(o,s);else{const a=mst(r,o);h9$1.test(s)?r.setProperty(qr$2(a),s.replace(h9$1,""),"important"):r[a]=s}}const p9$1=["Webkit","Moz","ms"],n3$1={};function mst(r,o){const s=n3$1[o];if(s)return s;let a=Ze$1(o);if(a!=="filter"&&a in r)return n3$1[o]=a;a=dl$2(a);for(let l=0;lr3$1||(_st.then(()=>r3$1=0),r3$1=Date.now());function xst(r,o){const s=a=>{if(!a._vts)a._vts=Date.now();else if(a._vts<=s.attached)return;gi$2(Est(a,s.value),o,5,[a])};return s.value=r,s.attached=wst(),s}function Est(r,o){if(Et$1(o)){const s=r.stopImmediatePropagation;return r.stopImmediatePropagation=()=>{s.call(r),r._stopped=!0},o.map(a=>l=>!l._stopped&&a&&a(l))}else return o}const g9$1=r=>r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&r.charCodeAt(2)>96&&r.charCodeAt(2)<123,Tst=(r,o,s,a,l,c)=>{const u=l==="svg";o==="class"?hst(r,a,u):o==="style"?fst(r,s,a):Xc$2(o)?FE$2(o)||vst(r,o,s,a,c):(o[0]==="."?(o=o.slice(1),!0):o[0]==="^"?(o=o.slice(1),!1):Sst(r,o,a,u))?(yst(r,o,a),!r.tagName.includes("-")&&(o==="value"||o==="checked"||o==="selected")&&f9$1(r,o,a,u,c,o!=="value")):(o==="true-value"?r._trueValue=a:o==="false-value"&&(r._falseValue=a),f9$1(r,o,a,u))};function Sst(r,o,s,a){if(a)return!!(o==="innerHTML"||o==="textContent"||o in r&&g9$1(o)&&Gt$3(s));if(o==="spellcheck"||o==="draggable"||o==="translate"||o==="form"||o==="list"&&r.tagName==="INPUT"||o==="type"&&r.tagName==="TEXTAREA")return!1;if(o==="width"||o==="height"){const l=r.tagName;if(l==="IMG"||l==="VIDEO"||l==="CANVAS"||l==="SOURCE")return!1}return g9$1(o)&&Wt$2(s)?!1:!!(o in r||r._isVueCE&&(/[A-Z]/.test(o)||!Wt$2(s)))}const v9$1={};function i3$1(r,o,s){const a=ne$1(r,o);r1$2(a)&&he(a,o);class l extends d0$2{constructor(u){super(a,u,s)}}return l.def=a,l}const b9$1=(r,o)=>i3$1(r,o,a3$1),Ast=typeof HTMLElement<"u"?HTMLElement:class{};let d0$2=class yie extends Ast{constructor(o,s={},a=Ml$1){super(),this._def=o,this._props=s,this._createApp=a,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&a!==Ml$1?this._root=this.shadowRoot:o.shadowRoot!==!1?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let o=this;for(;o=o&&(o.parentNode||o.host);)if(o instanceof yie){this._parent=o;break}this._instance||(this._resolved?(this._setParent(),this._update()):o&&o._pendingResolve?this._pendingResolve=o._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(o=this._parent){o&&(this._instance.parent=o._instance,this._instance.provides=o._instance.provides)}disconnectedCallback(){this._connected=!1,Bi$2(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let a=0;a{for(const l of a)this._setAttr(l.attributeName)}),this._ob.observe(this,{attributes:!0});const o=(a,l=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:c,styles:u}=a;let d;if(c&&!Et$1(c))for(const m in c){const g=c[m];(g===Number||g&&g.type===Number)&&(m in this._props&&(this._props[m]=o1$2(this._props[m])),(d||(d=Object.create(null)))[Ze$1(m)]=!0)}this._numberProps=d,l&&this._resolveProps(a),this.shadowRoot&&this._applyStyles(u),this._mount(a)},s=this._def.__asyncLoader;s?this._pendingResolve=s().then(a=>o(this._def=a,!0)):o(this._def)}_mount(o){this._app=this._createApp(o),o.configureApp&&o.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const s=this._instance&&this._instance.exposed;if(s)for(const a in s)we$1(this,a)||Object.defineProperty(this,a,{get:()=>It$2(s[a])})}_resolveProps(o){const{props:s}=o,a=Et$1(s)?s:Object.keys(s||{});for(const l of Object.keys(this))l[0]!=="_"&&a.includes(l)&&this._setProp(l,this[l]);for(const l of a.map(Ze$1))Object.defineProperty(this,l,{get(){return this._getProp(l)},set(c){this._setProp(l,c,!0,!0)}})}_setAttr(o){if(o.startsWith("data-v-"))return;const s=this.hasAttribute(o);let a=s?this.getAttribute(o):v9$1;const l=Ze$1(o);s&&this._numberProps&&this._numberProps[l]&&(a=o1$2(a)),this._setProp(l,a,!1,!0)}_getProp(o){return this._props[o]}_setProp(o,s,a=!0,l=!1){s!==this._props[o]&&(s===v9$1?delete this._props[o]:(this._props[o]=s,o==="key"&&this._app&&(this._app._ceVNode.key=s)),l&&this._instance&&this._update(),a&&(s===!0?this.setAttribute(qr$2(o),""):typeof s=="string"||typeof s=="number"?this.setAttribute(qr$2(o),s+""):s||this.removeAttribute(qr$2(o))))}_update(){ou$2(this._createVNode(),this._root)}_createVNode(){const o={};this.shadowRoot||(o.onVnodeMounted=o.onVnodeUpdated=this._renderSlots.bind(this));const s=Zt$2(this._def,he(o,this._props));return this._instance||(s.ce=a=>{this._instance=a,a.ce=this,a.isCE=!0;const l=(c,u)=>{this.dispatchEvent(new CustomEvent(c,r1$2(u[0])?he({detail:u},u[0]):{detail:u}))};a.emit=(c,...u)=>{l(c,u),qr$2(c)!==c&&l(qr$2(c),u)},this._setParent()}),s}_applyStyles(o,s){if(!o)return;if(s){if(s===this._def||this._styleChildren.has(s))return;this._styleChildren.add(s)}const a=this._nonce;for(let l=o.length-1;l>=0;l--){const c=document.createElement("style");a&&c.setAttribute("nonce",a),c.textContent=o[l],this.shadowRoot.prepend(c)}}_parseSlots(){const o=this._slots={};let s;for(;s=this.firstChild;){const a=s.nodeType===1&&s.getAttribute("slot")||"default";(o[a]||(o[a]=[])).push(s),this.removeChild(s)}}_renderSlots(){const o=(this._teleportTarget||this).querySelectorAll("slot"),s=this._instance.type.__scopeId;for(let a=0;a(delete r.props.mode,r),Mst=Ist({name:"TransitionGroup",props:he({},KL$2,{tag:String,moveClass:String}),setup(r,{slots:o}){const s=In$2(),a=R1$2();let l,c;return Kc$2(()=>{if(!l.length)return;const u=r.moveClass||`${r.name||"v"}-move`;if(!Rst(l[0].el,s.vnode.el,u))return;l.forEach(Nst),l.forEach(Ost);const d=l.filter(Cst);a9$1(),d.forEach(m=>{const g=m.el,y=g.style;na$2(g,u),y.transform=y.webkitTransform=y.transitionDuration="";const _=g[nv$2]=E=>{E&&E.target!==g||(!E||/transform$/.test(E.propertyName))&&(g.removeEventListener("transitionend",_),g[nv$2]=null,Al$2(g,u))};g.addEventListener("transitionend",_)})}),()=>{const u=Ut$2(r),d=e9$1(u);let m=u.tag||ke$1;if(l=[],c)for(let g=0;g{d.split(/\s+/).forEach(m=>m&&a.classList.remove(m))}),s.split(/\s+/).forEach(d=>d&&a.classList.add(d)),a.style.display="none";const c=o.nodeType===1?o:o.parentNode;c.appendChild(a);const{hasTransform:u}=i9$1(a);return c.removeChild(a),u}const Il$1=r=>{const o=r.props["onUpdate:modelValue"]||!1;return Et$1(o)?s=>sp$2(o,s):o};function kst(r){r.target.composing=!0}function S9$1(r){const o=r.target;o.composing&&(o.composing=!1,o.dispatchEvent(new Event("input")))}const Wi$2=Symbol("_assign"),bp$2={created(r,{modifiers:{lazy:o,trim:s,number:a}},l){r[Wi$2]=Il$1(l);const c=a||l.props&&l.props.type==="number";ra$2(r,o?"change":"input",u=>{if(u.target.composing)return;let d=r.value;s&&(d=d.trim()),c&&(d=s1$2(d)),r[Wi$2](d)}),s&&ra$2(r,"change",()=>{r.value=r.value.trim()}),o||(ra$2(r,"compositionstart",kst),ra$2(r,"compositionend",S9$1),ra$2(r,"change",S9$1))},mounted(r,{value:o}){r.value=o??""},beforeUpdate(r,{value:o,oldValue:s,modifiers:{lazy:a,trim:l,number:c}},u){if(r[Wi$2]=Il$1(u),r.composing)return;const d=(c||r.type==="number")&&!/^0\d/.test(r.value)?s1$2(r.value):r.value,m=o??"";d!==m&&(document.activeElement===r&&r.type!=="range"&&(a&&o===s||l&&r.value.trim()===m)||(r.value=m))}},iv$2={deep:!0,created(r,o,s){r[Wi$2]=Il$1(s),ra$2(r,"change",()=>{const a=r._modelValue,l=_p$2(r),c=r.checked,u=r[Wi$2];if(Et$1(a)){const d=a1$2(a,l),m=d!==-1;if(c&&!m)u(a.concat(l));else if(!c&&m){const g=[...a];g.splice(d,1),u(g)}}else if(Yc$2(a)){const d=new Set(a);c?d.add(l):d.delete(l),u(d)}else u(M9$1(r,c))})},mounted:A9$1,beforeUpdate(r,o,s){r[Wi$2]=Il$1(s),A9$1(r,o,s)}};function A9$1(r,{value:o},s){r._modelValue=o;let a;Et$1(o)?a=a1$2(o,s.props.value)>-1:Yc$2(o)?a=o.has(s.props.value):a=fl$2(o,M9$1(r,!0)),r.checked!==a&&(r.checked=a)}const sv$2={created(r,{value:o},s){r.checked=fl$2(o,s.props.value),r[Wi$2]=Il$1(s),ra$2(r,"change",()=>{r[Wi$2](_p$2(r))})},beforeUpdate(r,{value:o,oldValue:s},a){r[Wi$2]=Il$1(a),o!==s&&(r.checked=fl$2(o,a.props.value))}},ov$2={deep:!0,created(r,{value:o,modifiers:{number:s}},a){const l=Yc$2(o);ra$2(r,"change",()=>{const c=Array.prototype.filter.call(r.options,u=>u.selected).map(u=>s?s1$2(_p$2(u)):_p$2(u));r[Wi$2](r.multiple?l?new Set(c):c:c[0]),r._assigning=!0,Bi$2(()=>{r._assigning=!1})}),r[Wi$2]=Il$1(a)},mounted(r,{value:o}){I9$1(r,o)},beforeUpdate(r,o,s){r[Wi$2]=Il$1(s)},updated(r,{value:o}){r._assigning||I9$1(r,o)}};function I9$1(r,o){const s=r.multiple,a=Et$1(o);if(!(s&&!a&&!Yc$2(o))){for(let l=0,c=r.options.length;lString(g)===String(d)):u.selected=a1$2(o,d)>-1}else u.selected=o.has(d);else if(fl$2(_p$2(u),o)){r.selectedIndex!==l&&(r.selectedIndex=l);return}}!s&&r.selectedIndex!==-1&&(r.selectedIndex=-1)}}function _p$2(r){return"_value"in r?r._value:r.value}function M9$1(r,o){const s=o?"_trueValue":"_falseValue";return s in r?r[s]:o}const o3$1={created(r,o,s){av$2(r,o,s,null,"created")},mounted(r,o,s){av$2(r,o,s,null,"mounted")},beforeUpdate(r,o,s,a){av$2(r,o,s,a,"beforeUpdate")},updated(r,o,s,a){av$2(r,o,s,a,"updated")}};function N9$1(r,o){switch(r){case"SELECT":return ov$2;case"TEXTAREA":return bp$2;default:switch(o){case"checkbox":return iv$2;case"radio":return sv$2;default:return bp$2}}}function av$2(r,o,s,a,l){const c=N9$1(r.tagName,s.props&&s.props.type)[l];c&&c(r,o,s,a)}function Lst(){bp$2.getSSRProps=({value:r})=>({value:r}),sv$2.getSSRProps=({value:r},o)=>{if(o.props&&fl$2(o.props.value,r))return{checked:!0}},iv$2.getSSRProps=({value:r},o)=>{if(Et$1(r)){if(o.props&&a1$2(r,o.props.value)>-1)return{checked:!0}}else if(Yc$2(r)){if(o.props&&r.has(o.props.value))return{checked:!0}}else if(r)return{checked:!0}},o3$1.getSSRProps=(r,o)=>{if(typeof o.type!="string")return;const s=N9$1(o.type.toUpperCase(),o.props&&o.props.type);if(s.getSSRProps)return s.getSSRProps(r,o)}}const Pst=["ctrl","shift","alt","meta"],Dst={stop:r=>r.stopPropagation(),prevent:r=>r.preventDefault(),self:r=>r.target!==r.currentTarget,ctrl:r=>!r.ctrlKey,shift:r=>!r.shiftKey,alt:r=>!r.altKey,meta:r=>!r.metaKey,left:r=>"button"in r&&r.button!==0,middle:r=>"button"in r&&r.button!==1,right:r=>"button"in r&&r.button!==2,exact:(r,o)=>Pst.some(s=>r[`${s}Key`]&&!o.includes(s))},wp$3=(r,o)=>{const s=r._withMods||(r._withMods={}),a=o.join(".");return s[a]||(s[a]=(l,...c)=>{for(let u=0;u{const s=r._withKeys||(r._withKeys={}),a=o.join(".");return s[a]||(s[a]=l=>{if(!("key"in l))return;const c=qr$2(l.key);if(o.some(u=>u===c||Gst[u]===c))return r(l)})},O9$1=he({patchProp:Tst},ast$1);let Sm$2,C9$1=!1;function R9$1(){return Sm$2||(Sm$2=kT$1(O9$1))}function k9$1(){return Sm$2=C9$1?Sm$2:LT$2(O9$1),C9$1=!0,Sm$2}const ou$2=(...r)=>{R9$1().render(...r)},L9$1=(...r)=>{k9$1().hydrate(...r)},Ml$1=(...r)=>{const o=R9$1().createApp(...r),{mount:s}=o;return o.mount=a=>{const l=D9$1(a);if(!l)return;const c=o._component;!Gt$3(c)&&!c.render&&!c.template&&(c.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const u=s(l,!1,P9$1(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),u},o},a3$1=(...r)=>{const o=k9$1().createApp(...r),{mount:s}=o;return o.mount=a=>{const l=D9$1(a);if(l)return s(l,!0,P9$1(l))},o};function P9$1(r){if(r instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&r instanceof MathMLElement)return"mathml"}function D9$1(r){return Wt$2(r)?document.querySelector(r):r}let G9$1=!1;const F9$1=()=>{G9$1||(G9$1=!0,Lst(),pst())},Fst=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:uT$2,BaseTransitionPropsValidators:k1$2,Comment:Sn$2,DeprecationTypes:YL$2,EffectScope:l1$2,ErrorCodes:c6$1,ErrorTypeStrings:BL$2,Fragment:ke$1,KeepAlive:L6$1,ReactiveEffect:op$2,Static:El$2,Suspense:TL$2,Teleport:cT$2,Text:lo$2,TrackOpTypes:i6$1,Transition:xm$2,TransitionGroup:rv$2,TriggerOpTypes:s6$1,VueElement:d0$2,assertNumber:l6$1,callWithAsyncErrorHandling:gi$2,callWithErrorHandling:vl$2,camelize:Ze$1,capitalize:dl$2,cloneVNode:Es,compatUtils:XL$2,computed:te,createApp:Ml$1,createBlock:Be,createCommentVNode:We$1,createElementBlock:wt,createElementVNode:lt$3,createHydrationRenderer:LT$2,createPropsRestProxy:Q6$1,createRenderer:kT$1,createSSRApp:a3$1,createSlots:F6$1,createStaticVNode:zT$1,createTextVNode:Ts$1,createVNode:Zt$2,customRef:eT$2,defineAsyncComponent:G1$2,defineComponent:ne$1,defineCustomElement:i3$1,defineEmits:$6$1,defineExpose:B6$1,defineModel:H6$1,defineOptions:V6$1,defineProps:U6$1,defineSSRCustomElement:b9$1,defineSlots:z6$1,devtools:VL$2,effect:Dk$2,effectScope:Qf$2,getCurrentInstance:In$2,getCurrentScope:c1$2,getCurrentWatcher:o6$1,getTransitionRawChildren:lm$2,guardReactiveProps:VT$1,h:vi$1,handleError:bl$2,hasInjectionContext:OT$1,hydrate:L9$1,hydrateOnIdle:O6$1,hydrateOnInteraction:k6$1,hydrateOnMediaQuery:R6$1,hydrateOnVisible:C6$1,initCustomFormatter:jL$2,initDirectivesForSSR:F9$1,inject:Pn$2,isMemoSame:ZT$1,isProxy:nm$2,isReactive:yi$2,isReadonly:Zo$2,isRef:pe$1,isRuntimeOnly:PL$2,isShallow:Zr$2,isVNode:ws$2,markRaw:yn$2,mergeDefaults:q6$1,mergeModels:Z6$1,mergeProps:vm$2,nextTick:Bi$2,normalizeClass:an$2,normalizeProps:Ik$2,normalizeStyle:Wo$1,onActivated:fT$1,onBeforeMount:yp$2,onBeforeUnmount:zi$1,onBeforeUpdate:gT$2,onDeactivated:mT$2,onErrorCaptured:U1$2,onMounted:qn$2,onRenderTracked:_T$2,onRenderTriggered:bT$2,onScopeDispose:VE$1,onServerPrefetch:vT$2,onUnmounted:tu$2,onUpdated:Kc$2,onWatcherCleanup:rT$2,openBlock:pt$1,popScopeId:y6$1,provide:V1$2,proxyRefs:x1$2,pushScopeId:m6$1,queuePostFlushCb:im$1,reactive:Vn$1,readonly:_1$2,ref:tt$3,registerRuntimeCompiler:qT$1,render:ou$2,renderList:ta$3,renderSlot:Hi$2,resolveComponent:vn$2,resolveDirective:Ie$2,resolveDynamicComponent:$1$2,resolveFilter:WL$2,resolveTransitionHooks:Qc$2,setBlockTracking:Y1$2,setDevtoolsHook:zL$2,setTransitionHooks:ao$2,shallowReactive:KE$1,shallowReadonly:cp$2,shallowRef:up$2,ssrContextKey:GT$2,ssrUtils:HL$2,stop:Gk$2,toDisplayString:$e$1,toHandlerKey:Jc$2,toHandlers:j6$1,toRaw:Ut$2,toRef:nT$2,toRefs:E1$2,toValue:n6$1,transformVNodeArgs:OL$2,triggerRef:e6$1,unref:It$2,useAttrs:Y6$1,useCssModule:w9$1,useCssVars:u9$1,useHost:s3$1,useId:I6$1,useModel:_L$2,useSSRContext:FT$1,useShadowRoot:_9$1,useSlots:X6$1,useTemplateRef:cm$2,useTransitionState:R1$2,vModelCheckbox:iv$2,vModelDynamic:o3$1,vModelRadio:sv$2,vModelSelect:ov$2,vModelText:bp$2,vShow:Em$1,version:QT$1,warn:$L$2,watch:Hn$2,watchEffect:vL$2,watchPostEffect:jT$1,watchSyncEffect:UT$1,withAsyncContext:K6$1,withCtx:gn$1,withDefaults:W6$1,withDirectives:Ae$1,withKeys:lv$2,withMemo:UL$2,withModifiers:wp$3,withScopeId:g6$1},Symbol.toStringTag,{value:"Module"}));var l3$1={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_970c9b9c-9c28-4e11-91fe-3899b82e4149",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"",npm_config_user_agent:"npm/10.9.0 node/v22.12.0 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_970c9b9c-9c28-4e11-91fe-3899b82e4149",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",OLDPWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"ramp4-pcar4",npm_package_engines_node:"=22.12.0",GRADLE_HOME:"/usr/share/gradle-8.11.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"57148724",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_local_prefix:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",SYSTEMD_EXEC_PID:"834",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20241215.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.10/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.4/x64",JOURNAL_STREAM:"8:6781",GITHUB_WORKFLOW:"Build demo site and deploy to GitHub Pages",_:"/opt/hostedtoolcache/node/22.12.0/x64/bin/npm",npm_config_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",npm_config_npm_version:"10.9.0",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/runner-provisioner.service/memory.pressure",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"12600631880",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"tag",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_BASE_REF:"",ImageOS:"ubuntu24",GITHUB_WORKFLOW_REF:"ramp4-pcar4/ramp4-pcar4/.github/workflows/demo-build.yml@refs/tags/v4.10.2",ACTIONS_ID_TOKEN_REQUEST_TOKEN:"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ikh5cTROQVRBanNucUM3bWRydEFoaHJDUjJfUSJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zLkdlbmVyaWNSZWFkOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCBBY3Rpb25zLlJlc3VsdHM6MTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCBBY3Rpb25zLlVwbG9hZEFydGlmYWN0czowMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAvMTpCdWlsZC9CdWlsZC8xMTg1NiBEaXN0cmlidXRlZFRhc2suR2VuZXJhdGVJZFRva2VuOjEyMjcwNGU1LWRkNWItNGM3Zi04MWM2LTFjNjRjZWI0ZDE2YTpjYTM5NTA4NS0wNDBhLTUyNmItMmNlOC1iZGM4NWY2OTI3NzQgTG9jYXRpb25TZXJ2aWNlLkNvbm5lY3QgUmVhZEFuZFVwZGF0ZUJ1aWxkQnlVcmk6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwLzE6QnVpbGQvQnVpbGQvMTE4NTYiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiJkMmFlN2M1OS1lYjk5LTRhNGMtOGQxOS05N2EwZGY2ZDBhZDkiLCJzaWQiOiIwMWNhN2I4NC03YmZmLTRjYTMtOTM2Mi1iOWI4ODc5ZjFjN2QiLCJhYyI6Ilt7XCJTY29wZVwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcIlBlcm1pc3Npb25cIjozfSx7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9tYWluXCIsXCJQZXJtaXNzaW9uXCI6MX1dIiwiYWNzbCI6IjEwIiwib2lkY19leHRyYSI6IntcInJlZlwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcInNoYVwiOlwiZmEwZjEwYzk5OTgxNWMyZDA0YzJhMjk5NWFkOTA4YTFhMTgzNjMxYlwiLFwicmVwb3NpdG9yeVwiOlwicmFtcDQtcGNhcjQvcmFtcDQtcGNhcjRcIixcInJlcG9zaXRvcnlfb3duZXJcIjpcInJhbXA0LXBjYXI0XCIsXCJyZXBvc2l0b3J5X293bmVyX2lkXCI6XCI1NzE0ODcyNFwiLFwicnVuX2lkXCI6XCIxMjYwMDYzMTg4MFwiLFwicnVuX251bWJlclwiOlwiMTQyXCIsXCJydW5fYXR0ZW1wdFwiOlwiMVwiLFwicmVwb3NpdG9yeV92aXNpYmlsaXR5XCI6XCJwdWJsaWNcIixcInJlcG9zaXRvcnlfaWRcIjpcIjIxODM1NjA1N1wiLFwiYWN0b3JfaWRcIjpcIjc1ODUyNDVcIixcImFjdG9yXCI6XCJqYW1lcy1yYWVcIixcIndvcmtmbG93XCI6XCJCdWlsZCBkZW1vIHNpdGUgYW5kIGRlcGxveSB0byBHaXRIdWIgUGFnZXNcIixcImhlYWRfcmVmXCI6XCJcIixcImJhc2VfcmVmXCI6XCJcIixcImV2ZW50X25hbWVcIjpcInB1c2hcIixcInJlZl9wcm90ZWN0ZWRcIjpcImZhbHNlXCIsXCJyZWZfdHlwZVwiOlwidGFnXCIsXCJ3b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJ3b3JrZmxvd19zaGFcIjpcImZhMGYxMGM5OTk4MTVjMmQwNGMyYTI5OTVhZDkwOGExYTE4MzYzMWJcIixcImVudmlyb25tZW50XCI6XCJnaXRodWItcGFnZXNcIixcImVudmlyb25tZW50X25vZGVfaWRcIjpcIkVOX2t3RE9EUVBaV2M0ZUV4MlpcIixcImpvYl93b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJqb2Jfd29ya2Zsb3dfc2hhXCI6XCJmYTBmMTBjOTk5ODE1YzJkMDRjMmEyOTk1YWQ5MDhhMWExODM2MzFiXCIsXCJydW5uZXJfZW52aXJvbm1lbnRcIjpcImdpdGh1Yi1ob3N0ZWRcIn0iLCJvaWRjX3N1YiI6InJlcG86cmFtcDQtcGNhcjQvcmFtcDQtcGNhcjQ6ZW52aXJvbm1lbnQ6Z2l0aHViLXBhZ2VzIiwib3JjaGlkIjoiMTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhLmJ1aWxkLl9fZGVmYXVsdCIsImlzcyI6InZzdG9rZW4uYWN0aW9ucy5naXRodWJ1c2VyY29udGVudC5jb20iLCJhdWQiOiJ2c3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tfHZzbzpkYzhlN2U0ZC00ZDQ1LTQ4ZDAtYmY4YS02YmQ0YzZjMjQ2MDciLCJuYmYiOjE3MzU5MjA2NTEsImV4cCI6MTczNTk0MzQ1MX0.GDIMaHnR4BV7DsiZYljQVjH7maAY2oeT19GbL0fBsVgnLSFwh82jS97tSwainj2WAOKfT53NDCKgBCLyJEMNXgCLkesDDmaWKNr7E93N8EpiWWaeHC0gWfNng4854FKwe-2rSolRxMqjICH-MEL9daqiLdkvfT1Am5LvlA5gqUJfcXvG1ghyIplZrr_i8EovHetZNOIKC7V8TemKrUnogzxWmWjfE7jkyS6ER92v7Gb7pGnLtjNXoXrsuyXTaUDs6WJQEisuX3DyAlIMTGH35Y_GKb4TZzfcxQzGSIRH6wdbZPPrGnK0bt9mwM846IL1Bg6JmdG8McfmiAWr_xllxg",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_921a48f6-5b8e-4cc8-aff5-dc8fc3bbf3f7",INVOCATION_ID:"819722273f2741acab86958091275df4",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",npm_package_name:"ramp-pcar",GITHUB_ACTION:"__run_4",GITHUB_RUN_NUMBER:"142",GITHUB_TRIGGERING_ACTOR:"james-rae",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 6",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",GITHUB_REF_NAME:"v4.10.2",GITHUB_REPOSITORY:"ramp4-pcar4/ramp4-pcar4",STATS_D_D:"true",npm_lifecycle_script:"vite build --mode esDynamic",npm_config_loglevel:"silent",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"218356057",GITHUB_ACTIONS:"true",STATS_PIP:"false",npm_package_version:"4.10.2",npm_lifecycle_event:"build:esDynamic",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",ACCEPT_EULA:"Y",GITHUB_JOB:"build",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_RUN_ATTEMPT:"1",STATS_D_TC:"true",GITHUB_REF:"refs/tags/v4.10.2",GITHUB_ACTOR:"james-rae",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",npm_config_globalconfig:"/opt/hostedtoolcache/node/22.12.0/x64/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_970c9b9c-9c28-4e11-91fe-3899b82e4149",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",GITHUB_ACTOR_ID:"7585245",RUNNER_WORKSPACE:"/home/runner/work/ramp4-pcar4",npm_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"push",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",ACTIONS_ID_TOKEN_REQUEST_URL:"https://pipelinesghubeus2.actions.githubusercontent.com/CYYZq0bGEiBG5XjoYFUt7ZUW3UppKtccmRBdNq2vSmlX4E20ap/00000000-0000-0000-0000-000000000000/_apis/distributedtask/hubs/Actions/plans/122704e5-dd5b-4c7f-81c6-1c64ceb4d16a/jobs/ca395085-040a-526b-2ce8-bdc85f692774/idtoken?api-version=2.0",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_970c9b9c-9c28-4e11-91fe-3899b82e4149",npm_config_global_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.2.12479018",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",STATS_EXTP:"https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_970c9b9c-9c28-4e11-91fe-3899b82e4149",INIT_CWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",EDITOR:"vi",NODE_ENV:"production"};const Am$2=Symbol(""),Im$3=Symbol(""),c3$1=Symbol(""),cv$2=Symbol(""),j9$1=Symbol(""),au$1=Symbol(""),U9$1=Symbol(""),$9$1=Symbol(""),u3$1=Symbol(""),h3$1=Symbol(""),Mm$2=Symbol(""),p3$1=Symbol(""),B9$1=Symbol(""),d3$1=Symbol(""),f3$1=Symbol(""),m3$1=Symbol(""),y3$1=Symbol(""),g3$1=Symbol(""),v3$1=Symbol(""),V9$1=Symbol(""),z9$1=Symbol(""),uv$2=Symbol(""),hv$2=Symbol(""),b3$1=Symbol(""),_3$1=Symbol(""),Nm$1=Symbol(""),Om$2=Symbol(""),w3$1=Symbol(""),x3$1=Symbol(""),jst=Symbol(""),E3$1=Symbol(""),pv$2=Symbol(""),Ust=Symbol(""),$st=Symbol(""),T3$1=Symbol(""),Bst=Symbol(""),Vst=Symbol(""),S3$1=Symbol(""),H9$1=Symbol(""),xp$2={[Am$2]:"Fragment",[Im$3]:"Teleport",[c3$1]:"Suspense",[cv$2]:"KeepAlive",[j9$1]:"BaseTransition",[au$1]:"openBlock",[U9$1]:"createBlock",[$9$1]:"createElementBlock",[u3$1]:"createVNode",[h3$1]:"createElementVNode",[Mm$2]:"createCommentVNode",[p3$1]:"createTextVNode",[B9$1]:"createStaticVNode",[d3$1]:"resolveComponent",[f3$1]:"resolveDynamicComponent",[m3$1]:"resolveDirective",[y3$1]:"resolveFilter",[g3$1]:"withDirectives",[v3$1]:"renderList",[V9$1]:"renderSlot",[z9$1]:"createSlots",[uv$2]:"toDisplayString",[hv$2]:"mergeProps",[b3$1]:"normalizeClass",[_3$1]:"normalizeStyle",[Nm$1]:"normalizeProps",[Om$2]:"guardReactiveProps",[w3$1]:"toHandlers",[x3$1]:"camelize",[jst]:"capitalize",[E3$1]:"toHandlerKey",[pv$2]:"setBlockTracking",[Ust]:"pushScopeId",[$st]:"popScopeId",[T3$1]:"withCtx",[Bst]:"unref",[Vst]:"isRef",[S3$1]:"withMemo",[H9$1]:"isMemoSame"};function zst(r){Object.getOwnPropertySymbols(r).forEach(o=>{xp$2[o]=r[o]})}const bi$2={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function Hst(r,o=""){return{type:0,source:o,children:r,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:bi$2}}function Cm$2(r,o,s,a,l,c,u,d=!1,m=!1,g=!1,y=bi$2){return r&&(d?(r.helper(au$1),r.helper(Sp$2(r.inSSR,g))):r.helper(Tp$2(r.inSSR,g)),u&&r.helper(g3$1)),{type:13,tag:o,props:s,children:a,patchFlag:l,dynamicProps:c,directives:u,isBlock:d,disableTracking:m,isComponent:g,loc:y}}function lu$2(r,o=bi$2){return{type:17,loc:o,elements:r}}function Xi$3(r,o=bi$2){return{type:15,loc:o,properties:r}}function Mn$2(r,o){return{type:16,loc:bi$2,key:Wt$2(r)?Kt$2(r,!0):r,value:o}}function Kt$2(r,o=!1,s=bi$2,a=0){return{type:4,loc:s,content:r,isStatic:o,constType:o?3:a}}function Ss$1(r,o=bi$2){return{type:8,loc:o,children:r}}function Wn$2(r,o=[],s=bi$2){return{type:14,loc:s,callee:r,arguments:o}}function Ep$2(r,o=void 0,s=!1,a=!1,l=bi$2){return{type:18,params:r,returns:o,newline:s,isSlot:a,loc:l}}function A3$1(r,o,s,a=!0){return{type:19,test:r,consequent:o,alternate:s,newline:a,loc:bi$2}}function Wst(r,o,s=!1){return{type:20,index:r,value:o,needPauseTracking:s,needArraySpread:!1,loc:bi$2}}function Xst(r){return{type:21,body:r,loc:bi$2}}function Tp$2(r,o){return r||o?u3$1:h3$1}function Sp$2(r,o){return r||o?U9$1:$9$1}function I3$1(r,{helper:o,removeHelper:s,inSSR:a}){r.isBlock||(r.isBlock=!0,s(Tp$2(a,r.isComponent)),o(au$1),o(Sp$2(a,r.isComponent)))}const W9$1=new Uint8Array([123,123]),X9$1=new Uint8Array([125,125]);function Y9$1(r){return r>=97&&r<=122||r>=65&&r<=90}function _i$2(r){return r===32||r===10||r===9||r===12||r===13}function Nl$3(r){return r===47||r===62||_i$2(r)}function dv$2(r){const o=new Uint8Array(r.length);for(let s=0;s=0;a--){const l=this.newlines[a];if(r>l){o=a+2,s=r-l;break}}return{column:s,line:o,offset:r}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(r){r===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&r===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(r))}stateInterpolationOpen(r){if(r===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const o=this.index+1-this.delimiterOpen.length;o>this.sectionStart&&this.cbs.ontext(this.sectionStart,o),this.state=3,this.sectionStart=o}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(r)):(this.state=1,this.stateText(r))}stateInterpolation(r){r===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(r))}stateInterpolationClose(r){r===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(r))}stateSpecialStartSequence(r){const o=this.sequenceIndex===this.currentSequence.length;if(!(o?Nl$3(r):(r|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!o){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(r)}stateInRCDATA(r){if(this.sequenceIndex===this.currentSequence.length){if(r===62||_i$2(r)){const o=this.index-this.currentSequence.length;if(this.sectionStart=r||(this.state===28?this.currentSequence===xr$2.CdataEnd?this.cbs.oncdata(this.sectionStart,r):this.cbs.oncomment(this.sectionStart,r):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,r))}emitCodePoint(r,o){}};function J9$1(r,{compatConfig:o}){const s=o&&o[r];return r==="MODE"?s||3:s}function cu$2(r,o){const s=J9$1("MODE",o),a=J9$1(r,o);return s===3?a===!0:a!==!1}function Rm$2(r,o,s,...a){return cu$2(r,o)}function M3$1(r){throw r}function q9$1(r){}function nn$2(r,o,s,a){const l=`https://vuejs.org/error-reference/#compiler-${r}`,c=new SyntaxError(String(l));return c.code=r,c.loc=o,c}const ti$2=r=>r.type===4&&r.isStatic;function Z9$1(r){switch(r){case"Teleport":case"teleport":return Im$3;case"Suspense":case"suspense":return c3$1;case"KeepAlive":case"keep-alive":return cv$2;case"BaseTransition":case"base-transition":return j9$1}}const Jst=/^\d|[^\$\w\xA0-\uFFFF]/,N3$1=r=>!Jst.test(r),qst=/[A-Za-z_$\xA0-\uFFFF]/,Zst=/[\.\?\w$\xA0-\uFFFF]/,Qst=/\s+[.[]\s*|\s*[.[]\s+/g,Q9$1=r=>r.type===4?r.content:r.loc.source,Kst=r=>{const o=Q9$1(r).trim().replace(Qst,d=>d.trim());let s=0,a=[],l=0,c=0,u=null;for(let d=0;d|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,eot=r=>tot.test(Q9$1(r)),not$1=eot;function Yi$2(r,o,s=!1){for(let a=0;ao.type===7&&o.name==="bind"&&(!o.arg||o.arg.type!==4||!o.arg.isStatic))}function O3$1(r){return r.type===5||r.type===2}function iot(r){return r.type===7&&r.name==="slot"}function mv$2(r){return r.type===1&&r.tagType===3}function yv$2(r){return r.type===1&&r.tagType===2}const sot=new Set([Nm$1,Om$2]);function t8$1(r,o=[]){if(r&&!Wt$2(r)&&r.type===14){const s=r.callee;if(!Wt$2(s)&&sot.has(s))return t8$1(r.arguments[0],o.concat(r))}return[r,o]}function gv$2(r,o,s){let a,l=r.type===13?r.props:r.arguments[2],c=[],u;if(l&&!Wt$2(l)&&l.type===14){const d=t8$1(l);l=d[0],c=d[1],u=c[c.length-1]}if(l==null||Wt$2(l))a=Xi$3([o]);else if(l.type===14){const d=l.arguments[0];!Wt$2(d)&&d.type===15?e8$1(o,d)||d.properties.unshift(o):l.callee===w3$1?a=Wn$2(s.helper(hv$2),[Xi$3([o]),l]):l.arguments.unshift(Xi$3([o])),!a&&(a=l)}else l.type===15?(e8$1(o,l)||l.properties.unshift(o),a=l):(a=Wn$2(s.helper(hv$2),[Xi$3([o]),l]),u&&u.callee===Om$2&&(u=c[c.length-2]));r.type===13?u?u.arguments[0]=a:r.props=a:u?u.arguments[0]=a:r.arguments[2]=a}function e8$1(r,o){let s=!1;if(r.key.type===4){const a=r.key.content;s=o.properties.some(l=>l.key.type===4&&l.key.content===a)}return s}function km$2(r,o){return`_${o}_${r.replace(/[^\w]/g,(s,a)=>s==="-"?"_":r.charCodeAt(a).toString())}`}function oot(r){return r.type===14&&r.callee===S3$1?r.arguments[1].returns:r}const aot=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,n8$1={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:Zf$2,isPreTag:Zf$2,isIgnoreNewlineTag:Zf$2,isCustomElement:Zf$2,onError:M3$1,onWarn:q9$1,comments:l3$1.NODE_ENV!=="production",prefixIdentifiers:!1};let xe$1=n8$1,Lm$2=null,ia$2="",Er$2=null,de=null,ei$2="",sa$2=-1,hu$1=-1,C3$1=0,Ol$2=!1,R3$1=null;const rn$2=[],bn$2=new Yst(rn$2,{onerr:oa$2,ontext(r,o){vv$2(or$3(r,o),r,o)},ontextentity(r,o,s){vv$2(r,o,s)},oninterpolation(r,o){if(Ol$2)return vv$2(or$3(r,o),r,o);let s=r+bn$2.delimiterOpen.length,a=o-bn$2.delimiterClose.length;for(;_i$2(ia$2.charCodeAt(s));)s++;for(;_i$2(ia$2.charCodeAt(a-1));)a--;let l=or$3(s,a);l.includes("&")&&(l=xe$1.decodeEntities(l,!1)),k3$1({type:5,content:_v$1(l,!1,Dn$2(s,a)),loc:Dn$2(r,o)})},onopentagname(r,o){const s=or$3(r,o);Er$2={type:1,tag:s,ns:xe$1.getNamespace(s,rn$2[0],xe$1.ns),tagType:0,props:[],children:[],loc:Dn$2(r-1,o),codegenNode:void 0}},onopentagend(r){i8$1(r)},onclosetag(r,o){const s=or$3(r,o);if(!xe$1.isVoidTag(s)){let a=!1;for(let l=0;l0&&oa$2(24,rn$2[0].loc.start.offset);for(let c=0;c<=l;c++){const u=rn$2.shift();bv$1(u,o,c(a.type===7?a.rawName:a.name)===s)&&oa$2(2,o)},onattribend(r,o){if(Er$2&&de){if(pu$2(de.loc,o),r!==0)if(ei$2.includes("&")&&(ei$2=xe$1.decodeEntities(ei$2,!0)),de.type===6)de.name==="class"&&(ei$2=l8$1(ei$2).trim()),r===1&&!ei$2&&oa$2(13,o),de.value={type:2,content:ei$2,loc:r===1?Dn$2(sa$2,hu$1):Dn$2(sa$2-1,hu$1+1)},bn$2.inSFCRoot&&Er$2.tag==="template"&&de.name==="lang"&&ei$2&&ei$2!=="html"&&bn$2.enterRCDATA(dv$2("l.content==="sync"))>-1&&Rm$2("COMPILER_V_BIND_SYNC",xe$1,de.loc,de.rawName)&&(de.name="model",de.modifiers.splice(a,1))}(de.type!==7||de.name!=="pre")&&Er$2.props.push(de)}ei$2="",sa$2=hu$1=-1},oncomment(r,o){xe$1.comments&&k3$1({type:3,content:or$3(r,o),loc:Dn$2(r-4,o+3)})},onend(){const r=ia$2.length;for(let o=0;o{const T=o.start.offset+E,k=T+_.length;return _v$1(_,!1,Dn$2(T,k),0,w?1:0)},d={source:u(c.trim(),s.indexOf(c,l.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let m=l.trim().replace(lot,"").trim();const g=l.indexOf(m),y=m.match(r8$1);if(y){m=m.replace(r8$1,"").trim();const _=y[1].trim();let E;if(_&&(E=s.indexOf(_,g+m.length),d.key=u(_,E,!0)),y[2]){const w=y[2].trim();w&&(d.index=u(w,s.indexOf(w,d.key?E+_.length:g+m.length),!0))}}return m&&(d.value=u(m,g,!0)),d}function or$3(r,o){return ia$2.slice(r,o)}function i8$1(r){bn$2.inSFCRoot&&(Er$2.innerLoc=Dn$2(r+1,r+1)),k3$1(Er$2);const{tag:o,ns:s}=Er$2;s===0&&xe$1.isPreTag(o)&&C3$1++,xe$1.isVoidTag(o)?bv$1(Er$2,r):(rn$2.unshift(Er$2),(s===1||s===2)&&(bn$2.inXML=!0)),Er$2=null}function vv$2(r,o,s){{const c=rn$2[0]&&rn$2[0].tag;c!=="script"&&c!=="style"&&r.includes("&")&&(r=xe$1.decodeEntities(r,!1))}const a=rn$2[0]||Lm$2,l=a.children[a.children.length-1];l&&l.type===2?(l.content+=r,pu$2(l.loc,s)):a.children.push({type:2,content:r,loc:Dn$2(o,s)})}function bv$1(r,o,s=!1){s?pu$2(r.loc,s8$1(o,60)):pu$2(r.loc,uot(o,62)+1),bn$2.inSFCRoot&&(r.children.length?r.innerLoc.end=he({},r.children[r.children.length-1].loc.end):r.innerLoc.end=he({},r.innerLoc.start),r.innerLoc.source=or$3(r.innerLoc.start.offset,r.innerLoc.end.offset));const{tag:a,ns:l,children:c}=r;if(Ol$2||(a==="slot"?r.tagType=2:o8$1(r)?r.tagType=3:pot(r)&&(r.tagType=1)),bn$2.inRCDATA||(r.children=a8$1(c)),l===0&&xe$1.isIgnoreNewlineTag(a)){const u=c[0];u&&u.type===2&&(u.content=u.content.replace(/^\r?\n/,""))}l===0&&xe$1.isPreTag(a)&&C3$1--,R3$1===r&&(Ol$2=bn$2.inVPre=!1,R3$1=null),bn$2.inXML&&(rn$2[0]?rn$2[0].ns:xe$1.ns)===0&&(bn$2.inXML=!1);{const u=r.props;if(!bn$2.inSFCRoot&&cu$2("COMPILER_NATIVE_TEMPLATE",xe$1)&&r.tag==="template"&&!o8$1(r)){const m=rn$2[0]||Lm$2,g=m.children.indexOf(r);m.children.splice(g,1,...r.children)}const d=u.find(m=>m.type===6&&m.name==="inline-template");d&&Rm$2("COMPILER_INLINE_TEMPLATE",xe$1,d.loc)&&r.children.length&&(d.value={type:2,content:or$3(r.children[0].loc.start.offset,r.children[r.children.length-1].loc.end.offset),loc:d.loc})}}function uot(r,o){let s=r;for(;ia$2.charCodeAt(s)!==o&&s=0;)s--;return s}const hot=new Set(["if","else","else-if","for","slot"]);function o8$1({tag:r,props:o}){if(r==="template"){for(let s=0;s64&&r<91}const fot=/\r\n/g;function a8$1(r,o){const s=xe$1.whitespace!=="preserve";let a=!1;for(let l=0;l0){if(E>=2){_.codegenNode.patchFlag=-1,u.push(_);continue}}else{const w=_.codegenNode;if(w.type===13){const T=w.patchFlag;if((T===void 0||T===512||T===1)&&h8$1(_,s)>=2){const k=p8$1(_);k&&(w.props=s.hoist(k))}w.dynamicProps&&(w.dynamicProps=s.hoist(w.dynamicProps))}}}else if(_.type===12&&(a?0:wi$2(_,s))>=2){u.push(_);continue}if(_.type===1){const E=_.tagType===1;E&&s.scopes.vSlot++,wv$2(_,r,s,!1,l),E&&s.scopes.vSlot--}else if(_.type===11)wv$2(_,r,s,_.children.length===1,!0);else if(_.type===9)for(let E=0;E<_.branches.length;E++)wv$2(_.branches[E],r,s,_.branches[E].children.length===1,l)}let d=!1;if(u.length===c.length&&r.type===1){if(r.tagType===0&&r.codegenNode&&r.codegenNode.type===13&&Et$1(r.codegenNode.children))r.codegenNode.children=m(lu$2(r.codegenNode.children)),d=!0;else if(r.tagType===1&&r.codegenNode&&r.codegenNode.type===13&&r.codegenNode.children&&!Et$1(r.codegenNode.children)&&r.codegenNode.children.type===15){const y=g(r.codegenNode,"default");y&&(y.returns=m(lu$2(y.returns)),d=!0)}else if(r.tagType===3&&o&&o.type===1&&o.tagType===1&&o.codegenNode&&o.codegenNode.type===13&&o.codegenNode.children&&!Et$1(o.codegenNode.children)&&o.codegenNode.children.type===15){const y=Yi$2(r,"slot",!0),_=y&&y.arg&&g(o.codegenNode,y.arg);_&&(_.returns=m(lu$2(_.returns)),d=!0)}}if(!d)for(const y of u)y.codegenNode=s.cache(y.codegenNode);function m(y){const _=s.cache(y);return l&&s.hmr&&(_.needArraySpread=!0),_}function g(y,_){if(y.children&&!Et$1(y.children)&&y.children.type===15){const E=y.children.properties.find(w=>w.key===_||w.key.content===_);return E&&E.value}}u.length&&s.transformHoist&&s.transformHoist(c,s,r)}function wi$2(r,o){const{constantCache:s}=o;switch(r.type){case 1:if(r.tagType!==0)return 0;const a=s.get(r);if(a!==void 0)return a;const l=r.codegenNode;if(l.type!==13||l.isBlock&&r.tag!=="svg"&&r.tag!=="foreignObject"&&r.tag!=="math")return 0;if(l.patchFlag===void 0){let u=3;const d=h8$1(r,o);if(d===0)return s.set(r,0),0;d1)for(let m=0;mz&&(F.childIndex--,F.onNodeRemoved()),F.parent.children.splice(z,1)},onNodeRemoved:sr$2,addIdentifiers(U){},removeIdentifiers(U){},hoist(U){Wt$2(U)&&(U=Kt$2(U)),F.hoists.push(U);const J=Kt$2(`_hoisted_${F.hoists.length}`,!1,U.loc,2);return J.hoisted=U,J},cache(U,J=!1){const z=Wst(F.cached.length,U,J);return F.cached.push(z),z}};return F.filters=new Set,F}function Eot(r,o){const s=xot(r,o);xv$2(r,s),o.hoistStatic&&_ot(r,s),o.ssr||Tot(r,s),r.helpers=new Set([...s.helpers.keys()]),r.components=[...s.components],r.directives=[...s.directives],r.imports=s.imports,r.hoists=s.hoists,r.temps=s.temps,r.cached=s.cached,r.transformed=!0,r.filters=[...s.filters]}function Tot(r,o){const{helper:s}=o,{children:a}=r;if(a.length===1){const l=a[0];if(c8$1(r,l)&&l.codegenNode){const c=l.codegenNode;c.type===13&&I3$1(c,o),r.codegenNode=c}else r.codegenNode=l}else if(a.length>1){let l=64;r.codegenNode=Cm$2(o,s(Am$2),void 0,r.children,l,void 0,void 0,!0,void 0,!1)}}function Sot(r,o){let s=0;const a=()=>{s--};for(;sa===r:a=>r.test(a);return(a,l)=>{if(a.type===1){const{props:c}=a;if(a.tagType===3&&c.some(iot))return;const u=[];for(let d=0;d`${xp$2[r]}: _${xp$2[r]}`;function Aot(r,{mode:o="function",prefixIdentifiers:s=o==="module",sourceMap:a=!1,filename:l="template.vue.html",scopeId:c=null,optimizeImports:u=!1,runtimeGlobalName:d="Vue",runtimeModuleName:m="vue",ssrRuntimeModuleName:g="vue/server-renderer",ssr:y=!1,isTS:_=!1,inSSR:E=!1}){const w={mode:o,prefixIdentifiers:s,sourceMap:a,filename:l,scopeId:c,optimizeImports:u,runtimeGlobalName:d,runtimeModuleName:m,ssrRuntimeModuleName:g,ssr:y,isTS:_,inSSR:E,source:r.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(k){return`_${xp$2[k]}`},push(k,O=-2,R){w.code+=k},indent(){T(++w.indentLevel)},deindent(k=!1){k?--w.indentLevel:T(--w.indentLevel)},newline(){T(w.indentLevel)}};function T(k){w.push(` -`+" ".repeat(k),0)}return w}function Iot(r,o={}){const s=Aot(r,o);o.onContextCreated&&o.onContextCreated(s);const{mode:a,push:l,prefixIdentifiers:c,indent:u,deindent:d,newline:m,scopeId:g,ssr:y}=s,_=Array.from(r.helpers),E=_.length>0,w=!c&&a!=="module";Mot(r,s);const T=y?"ssrRender":"render",k=(y?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(l(`function ${T}(${k}) {`),u(),w&&(l("with (_ctx) {"),u(),E&&(l(`const { ${_.map(f8$1).join(", ")} } = _Vue -`,-1),m())),r.components.length&&(L3$1(r.components,"component",s),(r.directives.length||r.temps>0)&&m()),r.directives.length&&(L3$1(r.directives,"directive",s),r.temps>0&&m()),r.filters&&r.filters.length&&(m(),L3$1(r.filters,"filter",s),m()),r.temps>0){l("let ");for(let O=0;O0?", ":""}_temp${O}`)}return(r.components.length||r.directives.length||r.temps)&&(l(` -`,0),m()),y||l("return "),r.codegenNode?Tr$2(r.codegenNode,s):l("null"),w&&(d(),l("}")),d(),l("}"),{ast:r,code:s.code,preamble:"",map:s.map?s.map.toJSON():void 0}}function Mot(r,o){const{ssr:s,prefixIdentifiers:a,push:l,newline:c,runtimeModuleName:u,runtimeGlobalName:d,ssrRuntimeModuleName:m}=o,g=d,y=Array.from(r.helpers);if(y.length>0&&(l(`const _Vue = ${g} -`,-1),r.hoists.length)){const _=[u3$1,h3$1,Mm$2,p3$1,B9$1].filter(E=>y.includes(E)).map(f8$1).join(", ");l(`const { ${_} } = _Vue -`,-1)}Not$1(r.hoists,o),c(),l("return ")}function L3$1(r,o,{helper:s,push:a,newline:l,isTS:c}){const u=s(o==="filter"?y3$1:o==="component"?d3$1:m3$1);for(let d=0;d3||l3$1.NODE_ENV!=="production";o.push("["),s&&o.indent(),Pm$2(r,o,s),s&&o.deindent(),o.push("]")}function Pm$2(r,o,s=!1,a=!0){const{push:l,newline:c}=o;for(let u=0;us||"null")}function Dot$1(r,o){const{push:s,helper:a,pure:l}=o,c=Wt$2(r.callee)?r.callee:a(r.callee);l&&s(Ev$1),s(c+"(",-2,r),Pm$2(r.arguments,o),s(")")}function Got(r,o){const{push:s,indent:a,deindent:l,newline:c}=o,{properties:u}=r;if(!u.length){s("{}",-2,r);return}const d=u.length>1||l3$1.NODE_ENV!=="production";s(d?"{":"{ "),d&&a();for(let m=0;m "),(m||d)&&(s("{"),a()),u?(m&&s("return "),Et$1(u)?P3$1(u,o):Tr$2(u,o)):d&&Tr$2(d,o),(m||d)&&(l(),s("}")),g&&(r.isNonScopedSlot&&s(", undefined, true"),s(")"))}function Uot(r,o){const{test:s,consequent:a,alternate:l,newline:c}=r,{push:u,indent:d,deindent:m,newline:g}=o;if(s.type===4){const _=!N3$1(s.content);_&&u("("),m8$1(s,o),_&&u(")")}else u("("),Tr$2(s,o),u(")");c&&d(),o.indentLevel++,c||u(" "),u("? "),Tr$2(a,o),o.indentLevel--,c&&g(),c||u(" "),u(": ");const y=l.type===19;y||o.indentLevel++,Tr$2(l,o),y||o.indentLevel--,c&&m(!0)}function $ot(r,o){const{push:s,helper:a,indent:l,deindent:c,newline:u}=o,{needPauseTracking:d,needArraySpread:m}=r;m&&s("[...("),s(`_cache[${r.index}] || (`),d&&(l(),s(`${a(pv$2)}(-1),`),u(),s("(")),s(`_cache[${r.index}] = `),Tr$2(r.value,o),d&&(s(`).cacheIndex = ${r.index},`),u(),s(`${a(pv$2)}(1),`),u(),s(`_cache[${r.index}]`),c()),s(")"),m&&s(")]")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const Bot=d8$1(/^(if|else|else-if)$/,(r,o,s)=>Vot(r,o,s,(a,l,c)=>{const u=s.parent.children;let d=u.indexOf(a),m=0;for(;d-->=0;){const g=u[d];g&&g.type===9&&(m+=g.branches.length)}return()=>{if(c)a.codegenNode=v8$1(l,m,s);else{const g=zot(a.codegenNode);g.alternate=v8$1(l,m+a.branches.length-1,s)}}}));function Vot(r,o,s,a){if(o.name!=="else"&&(!o.exp||!o.exp.content.trim())){const l=o.exp?o.exp.loc:r.loc;s.onError(nn$2(28,o.loc)),o.exp=Kt$2("true",!1,l)}if(o.name==="if"){const l=g8$1(r,o),c={type:9,loc:r.loc,branches:[l]};if(s.replaceNode(c),a)return a(c,l,!0)}else{const l=s.parent.children;let c=l.indexOf(r);for(;c-->=-1;){const u=l[c];if(u&&u.type===3){s.removeNode(u);continue}if(u&&u.type===2&&!u.content.trim().length){s.removeNode(u);continue}if(u&&u.type===9){o.name==="else-if"&&u.branches[u.branches.length-1].condition===void 0&&s.onError(nn$2(30,r.loc)),s.removeNode();const d=g8$1(r,o);u.branches.push(d);const m=a&&a(u,d,!1);xv$2(d,s),m&&m(),s.currentNode=null}else s.onError(nn$2(30,r.loc));break}}}function g8$1(r,o){const s=r.tagType===3;return{type:10,loc:r.loc,condition:o.name==="else"?void 0:o.exp,children:s&&!Yi$2(r,"for")?r.children:[r],userKey:fv$2(r,"key"),isTemplateIf:s}}function v8$1(r,o,s){return r.condition?A3$1(r.condition,b8$1(r,o,s),Wn$2(s.helper(Mm$2),['""',"true"])):b8$1(r,o,s)}function b8$1(r,o,s){const{helper:a}=s,l=Mn$2("key",Kt$2(`${o}`,!1,bi$2,2)),{children:c}=r,u=c[0];if(c.length!==1||u.type!==1)if(c.length===1&&u.type===11){const d=u.codegenNode;return gv$2(d,l,s),d}else return Cm$2(s,a(Am$2),Xi$3([l]),c,64,void 0,void 0,!0,!1,!1,r.loc);else{const d=u.codegenNode,m=oot(d);return m.type===13&&I3$1(m,s),gv$2(m,l,s),d}}function zot(r){for(;;)if(r.type===19)if(r.alternate.type===19)r=r.alternate;else return r;else r.type===20&&(r=r.value)}const Hot=(r,o,s)=>{const{modifiers:a,loc:l}=r,c=r.arg;let{exp:u}=r;if(u&&u.type===4&&!u.content.trim()&&(u=void 0),!u){if(c.type!==4||!c.isStatic)return s.onError(nn$2(52,c.loc)),{props:[Mn$2(c,Kt$2("",!0,l))]};_8$1(r),u=r.exp}return c.type!==4?(c.children.unshift("("),c.children.push(') || ""')):c.isStatic||(c.content=`${c.content} || ""`),a.some(d=>d.content==="camel")&&(c.type===4?c.isStatic?c.content=Ze$1(c.content):c.content=`${s.helperString(x3$1)}(${c.content})`:(c.children.unshift(`${s.helperString(x3$1)}(`),c.children.push(")"))),s.inSSR||(a.some(d=>d.content==="prop")&&w8$1(c,"."),a.some(d=>d.content==="attr")&&w8$1(c,"^")),{props:[Mn$2(c,u)]}},_8$1=(r,o)=>{const s=r.arg,a=Ze$1(s.content);r.exp=Kt$2(a,!1,s.loc)},w8$1=(r,o)=>{r.type===4?r.isStatic?r.content=o+r.content:r.content=`\`${o}\${${r.content}}\``:(r.children.unshift(`'${o}' + (`),r.children.push(")"))},Wot=d8$1("for",(r,o,s)=>{const{helper:a,removeHelper:l}=s;return Xot(r,o,s,c=>{const u=Wn$2(a(v3$1),[c.source]),d=mv$2(r),m=Yi$2(r,"memo"),g=fv$2(r,"key",!1,!0);g&&g.type===7&&!g.exp&&_8$1(g);const y=g&&(g.type===6?g.value?Kt$2(g.value.content,!0):void 0:g.exp),_=g&&y?Mn$2("key",y):null,E=c.source.type===4&&c.source.constType>0,w=E?64:g?128:256;return c.codegenNode=Cm$2(s,a(Am$2),void 0,u,w,void 0,void 0,!0,!E,!1,r.loc),()=>{let T;const{children:k}=c,O=k.length!==1||k[0].type!==1,R=yv$2(r)?r:d&&r.children.length===1&&yv$2(r.children[0])?r.children[0]:null;if(R?(T=R.codegenNode,d&&_&&gv$2(T,_,s)):O?T=Cm$2(s,a(Am$2),_?Xi$3([_]):void 0,r.children,64,void 0,void 0,!0,void 0,!1):(T=k[0].codegenNode,d&&_&&gv$2(T,_,s),T.isBlock!==!E&&(T.isBlock?(l(au$1),l(Sp$2(s.inSSR,T.isComponent))):l(Tp$2(s.inSSR,T.isComponent))),T.isBlock=!E,T.isBlock?(a(au$1),a(Sp$2(s.inSSR,T.isComponent))):a(Tp$2(s.inSSR,T.isComponent))),m){const M=Ep$2(D3$1(c.parseResult,[Kt$2("_cached")]));M.body=Xst([Ss$1(["const _memo = (",m.exp,")"]),Ss$1(["if (_cached",...y?[" && _cached.key === ",y]:[],` && ${s.helperString(H9$1)}(_cached, _memo)) return _cached`]),Ss$1(["const _item = ",T]),Kt$2("_item.memo = _memo"),Kt$2("return _item")]),u.arguments.push(M,Kt$2("_cache"),Kt$2(String(s.cached.length))),s.cached.push(null)}else u.arguments.push(Ep$2(D3$1(c.parseResult),T,!0))}})});function Xot(r,o,s,a){if(!o.exp){s.onError(nn$2(31,o.loc));return}const l=o.forParseResult;if(!l){s.onError(nn$2(32,o.loc));return}x8$1(l);const{addIdentifiers:c,removeIdentifiers:u,scopes:d}=s,{source:m,value:g,key:y,index:_}=l,E={type:11,loc:o.loc,source:m,valueAlias:g,keyAlias:y,objectIndexAlias:_,parseResult:l,children:mv$2(r)?r.children:[r]};s.replaceNode(E),d.vFor++;const w=a&&a(E);return()=>{d.vFor--,w&&w()}}function x8$1(r,o){r.finalized||(r.finalized=!0)}function D3$1({value:r,key:o,index:s},a=[]){return Yot([r,o,s,...a])}function Yot(r){let o=r.length;for(;o--&&!r[o];);return r.slice(0,o+1).map((s,a)=>s||Kt$2("_".repeat(a+1),!1))}const E8$1=Kt$2("undefined",!1),Jot=(r,o)=>{if(r.type===1&&(r.tagType===1||r.tagType===3)){const s=Yi$2(r,"slot");if(s)return s.exp,o.scopes.vSlot++,()=>{o.scopes.vSlot--}}},qot=(r,o,s,a)=>Ep$2(r,s,!1,!0,s.length?s[0].loc:a);function Zot(r,o,s=qot){o.helper(T3$1);const{children:a,loc:l}=r,c=[],u=[];let d=o.scopes.vSlot>0||o.scopes.vFor>0;const m=Yi$2(r,"slot",!0);if(m){const{arg:O,exp:R}=m;O&&!ti$2(O)&&(d=!0),c.push(Mn$2(O||Kt$2("default",!0),s(R,void 0,a,l)))}let g=!1,y=!1;const _=[],E=new Set;let w=0;for(let O=0;O{const N=s(R,void 0,M,l);return o.compatConfig&&(N.isNonScopedSlot=!0),Mn$2("default",N)};g?_.length&&_.some(R=>T8$1(R))&&(y?o.onError(nn$2(39,_[0].loc)):c.push(O(void 0,_))):c.push(O(void 0,a))}const T=d?2:Sv$2(r.children)?3:1;let k=Xi$3(c.concat(Mn$2("_",Kt$2(T+"",!1))),l);return u.length&&(k=Wn$2(o.helper(z9$1),[k,lu$2(u)])),{slots:k,hasDynamicSlots:d}}function Tv$1(r,o,s){const a=[Mn$2("name",r),Mn$2("fn",o)];return s!=null&&a.push(Mn$2("key",Kt$2(String(s),!0))),Xi$3(a)}function Sv$2(r){for(let o=0;ofunction(){if(r=o.currentNode,!(r.type===1&&(r.tagType===0||r.tagType===1)))return;const{tag:s,props:a}=r,l=r.tagType===1;let c=l?Kot(r,o):`"${s}"`;const u=Re$3(c)&&c.callee===f3$1;let d,m,g=0,y,_,E,w=u||c===Im$3||c===c3$1||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(a.length>0){const T=A8$1(r,o,void 0,l,u);d=T.props,g=T.patchFlag,_=T.dynamicPropNames;const k=T.directives;E=k&&k.length?lu$2(k.map(O=>eat(O,o))):void 0,T.shouldUseBlock&&(w=!0)}if(r.children.length>0)if(c===cv$2&&(w=!0,g|=1024),l&&c!==Im$3&&c!==cv$2){const{slots:T,hasDynamicSlots:k}=Zot(r,o);m=T,k&&(g|=1024)}else if(r.children.length===1&&c!==Im$3){const T=r.children[0],k=T.type,O=k===5||k===8;O&&wi$2(T,o)===0&&(g|=1),O||k===2?m=T:m=r.children}else m=r.children;_&&_.length&&(y=nat(_)),r.codegenNode=Cm$2(o,c,d,m,g===0?void 0:g,y,E,!!w,!1,l,r.loc)};function Kot(r,o,s=!1){let{tag:a}=r;const l=G3$1(a),c=fv$2(r,"is",!1,!0);if(c)if(l||cu$2("COMPILER_IS_ON_ELEMENT",o)){let d;if(c.type===6?d=c.value&&Kt$2(c.value.content,!0):(d=c.exp,d||(d=Kt$2("is",!1,c.arg.loc))),d)return Wn$2(o.helper(f3$1),[d])}else c.type===6&&c.value.content.startsWith("vue:")&&(a=c.value.content.slice(4));const u=Z9$1(a)||o.isBuiltInComponent(a);return u?(s||o.helper(u),u):(o.helper(d3$1),o.components.add(a),km$2(a,"component"))}function A8$1(r,o,s=r.props,a,l,c=!1){const{tag:u,loc:d,children:m}=r;let g=[];const y=[],_=[],E=m.length>0;let w=!1,T=0,k=!1,O=!1,R=!1,M=!1,N=!1,D=!1;const P=[],I=J=>{g.length&&(y.push(Xi$3(I8$1(g),d)),g=[]),J&&y.push(J)},L=()=>{o.scopes.vFor>0&&g.push(Mn$2(Kt$2("ref_for",!0),Kt$2("true")))},F=({key:J,value:z})=>{if(ti$2(J)){const ie=J.content,ce=Xc$2(ie);if(ce&&(!a||l)&&ie.toLowerCase()!=="onclick"&&ie!=="onUpdate:modelValue"&&!pl$1(ie)&&(M=!0),ce&&pl$1(ie)&&(D=!0),ce&&z.type===14&&(z=z.arguments[0]),z.type===20||(z.type===4||z.type===8)&&wi$2(z,o)>0)return;ie==="ref"?k=!0:ie==="class"?O=!0:ie==="style"?R=!0:ie!=="key"&&!P.includes(ie)&&P.push(ie),a&&(ie==="class"||ie==="style")&&!P.includes(ie)&&P.push(ie)}else N=!0};for(let J=0;Jpee.content==="prop")&&(T|=32);const Dee=o.directiveTransforms[ie];if(Dee){const{props:pee,needRuntime:jr}=Dee(z,r,o);!c&&pee.forEach(F),St&&ce&&!ti$2(ce)?I(Xi$3(pee,d)):g.push(...pee),jr&&(_.push(z),mi$2(jr)&&S8$1.set(z,jr))}else rrt(ie)||(_.push(z),E&&(w=!0))}}let U;if(y.length?(I(),y.length>1?U=Wn$2(o.helper(hv$2),y,d):U=y[0]):g.length&&(U=Xi$3(I8$1(g),d)),N?T|=16:(O&&!a&&(T|=2),R&&!a&&(T|=4),P.length&&(T|=8),M&&(T|=32)),!w&&(T===0||T===32)&&(k||D||_.length>0)&&(T|=512),!o.inSSR&&U)switch(U.type){case 15:let J=-1,z=-1,ie=!1;for(let B=0;BMn$2(u,c)),l))}return lu$2(s,r.loc)}function nat(r){let o="[";for(let s=0,a=r.length;s{if(yv$2(r)){const{children:s,loc:a}=r,{slotName:l,slotProps:c}=iat(r,o),u=[o.prefixIdentifiers?"_ctx.$slots":"$slots",l,"{}","undefined","true"];let d=2;c&&(u[2]=c,d=3),s.length&&(u[3]=Ep$2([],s,!1,!1,a),d=4),o.scopeId&&!o.slotted&&(d=5),u.splice(d),r.codegenNode=Wn$2(o.helper(V9$1),u,a)}};function iat(r,o){let s='"default"',a;const l=[];for(let c=0;c0){const{props:c,directives:u}=A8$1(r,o,l,!1,!1);a=c,u.length&&o.onError(nn$2(36,u[0].loc))}return{slotName:s,slotProps:a}}const M8$1=(r,o,s,a)=>{const{loc:l,modifiers:c,arg:u}=r;!r.exp&&!c.length&&s.onError(nn$2(35,l));let d;if(u.type===4)if(u.isStatic){let _=u.content;_.startsWith("vue:")&&(_=`vnode-${_.slice(4)}`);const E=o.tagType!==0||_.startsWith("vnode")||!/[A-Z]/.test(_)?Jc$2(Ze$1(_)):`on:${_}`;d=Kt$2(E,!0,u.loc)}else d=Ss$1([`${s.helperString(E3$1)}(`,u,")"]);else d=u,d.children.unshift(`${s.helperString(E3$1)}(`),d.children.push(")");let m=r.exp;m&&!m.content.trim()&&(m=void 0);let g=s.cacheHandlers&&!m&&!s.inVOnce;if(m){const _=K9$1(m),E=!(_||not$1(m)),w=m.content.includes(";");(E||g&&_)&&(m=Ss$1([`${E?"$event":"(...args)"} => ${w?"{":"("}`,m,w?"}":")"]))}let y={props:[Mn$2(d,m||Kt$2("() => {}",!1,l))]};return a&&(y=a(y)),g&&(y.props[0].value=s.cache(y.props[0].value)),y.props.forEach(_=>_.key.isHandlerKey=!0),y},sat=(r,o)=>{if(r.type===0||r.type===1||r.type===11||r.type===10)return()=>{const s=r.children;let a,l=!1;for(let c=0;cc.type===7&&!o.directiveTransforms[c.name])&&r.tag!=="template")))for(let c=0;c{if(r.type===1&&Yi$2(r,"once",!0))return N8$1.has(r)||o.inVOnce||o.inSSR?void 0:(N8$1.add(r),o.inVOnce=!0,o.helper(pv$2),()=>{o.inVOnce=!1;const s=o.currentNode;s.codegenNode&&(s.codegenNode=o.cache(s.codegenNode,!0))})},O8$1=(r,o,s)=>{const{exp:a,arg:l}=r;if(!a)return s.onError(nn$2(41,r.loc)),Av$2();const c=a.loc.source.trim(),u=a.type===4?a.content:c,d=s.bindingMetadata[c];if(d==="props"||d==="props-aliased")return s.onError(nn$2(44,a.loc)),Av$2();if(!u.trim()||!K9$1(a))return s.onError(nn$2(42,a.loc)),Av$2();const m=l||Kt$2("modelValue",!0),g=l?ti$2(l)?`onUpdate:${Ze$1(l.content)}`:Ss$1(['"onUpdate:" + ',l]):"onUpdate:modelValue";let y;const _=s.isTS?"($event: any)":"$event";y=Ss$1([`${_} => ((`,a,") = $event)"]);const E=[Mn$2(m,r.exp),Mn$2(g,y)];if(r.modifiers.length&&o.tagType===1){const w=r.modifiers.map(k=>k.content).map(k=>(N3$1(k)?k:JSON.stringify(k))+": true").join(", "),T=l?ti$2(l)?`${l.content}Modifiers`:Ss$1([l,' + "Modifiers"']):"modelModifiers";E.push(Mn$2(T,Kt$2(`{ ${w} }`,!1,r.loc,2)))}return Av$2(E)};function Av$2(r=[]){return{props:r}}const aat=/[\w).+\-_$\]]/,lat$1=(r,o)=>{cu$2("COMPILER_FILTERS",o)&&(r.type===5?Iv$2(r.content,o):r.type===1&&r.props.forEach(s=>{s.type===7&&s.name!=="for"&&s.exp&&Iv$2(s.exp,o)}))};function Iv$2(r,o){if(r.type===4)C8$1(r,o);else for(let s=0;s=0&&(M=s.charAt(R),M===" ");R--);(!M||!aat.test(M))&&(u=!0)}}T===void 0?T=s.slice(0,w).trim():y!==0&&O();function O(){k.push(s.slice(y,w).trim()),y=w+1}if(k.length){for(w=0;w{if(r.type===1){const s=Yi$2(r,"memo");return!s||R8$1.has(r)?void 0:(R8$1.add(r),()=>{const a=r.codegenNode||o.currentNode.codegenNode;a&&a.type===13&&(r.tagType!==1&&I3$1(a,o),r.codegenNode=Wn$2(o.helper(S3$1),[s.exp,Ep$2(void 0,a),"_cache",String(o.cached.length)]),o.cached.push(null))})}};function hat(r){return[[oat,Bot,uat,Wot,lat$1,rat,Qot,Jot,sat],{on:M8$1,bind:Hot,model:O8$1}]}function pat(r,o={}){const s=o.onError||M3$1,a=o.mode==="module";o.prefixIdentifiers===!0?s(nn$2(47)):a&&s(nn$2(48));const l=!1;o.cacheHandlers&&s(nn$2(49)),o.scopeId&&!a&&s(nn$2(50));const c=he({},o,{prefixIdentifiers:l}),u=Wt$2(r)?bot$1(r,c):r,[d,m]=hat();return Eot(u,he({},c,{nodeTransforms:[...d,...o.nodeTransforms||[]],directiveTransforms:he({},m,o.directiveTransforms||{})})),Iot(u,c)}const dat=()=>({props:[]}),k8$1=Symbol(""),L8$1=Symbol(""),P8$1=Symbol(""),D8$1=Symbol(""),F3$1=Symbol(""),G8$1=Symbol(""),F8$1=Symbol(""),j8$1=Symbol(""),U8$1=Symbol(""),$8$1=Symbol("");zst({[k8$1]:"vModelRadio",[L8$1]:"vModelCheckbox",[P8$1]:"vModelText",[D8$1]:"vModelSelect",[F3$1]:"vModelDynamic",[G8$1]:"withModifiers",[F8$1]:"withKeys",[j8$1]:"vShow",[U8$1]:"Transition",[$8$1]:"TransitionGroup"});let Ap$1;function fat(r,o=!1){return Ap$1||(Ap$1=document.createElement("div")),o?(Ap$1.innerHTML=`
`,Ap$1.children[0].getAttribute("foo")):(Ap$1.innerHTML=r,Ap$1.textContent)}const mat={parseMode:"html",isVoidTag:brt,isNativeTag:r=>yrt(r)||grt(r)||vrt(r),isPreTag:r=>r==="pre",isIgnoreNewlineTag:r=>r==="pre"||r==="textarea",decodeEntities:fat,isBuiltInComponent:r=>{if(r==="Transition"||r==="transition")return U8$1;if(r==="TransitionGroup"||r==="transition-group")return $8$1},getNamespace(r,o,s){let a=o?o.ns:s;if(o&&a===2)if(o.tag==="annotation-xml"){if(r==="svg")return 1;o.props.some(l=>l.type===6&&l.name==="encoding"&&l.value!=null&&(l.value.content==="text/html"||l.value.content==="application/xhtml+xml"))&&(a=0)}else/^m(?:[ions]|text)$/.test(o.tag)&&r!=="mglyph"&&r!=="malignmark"&&(a=0);else o&&a===1&&(o.tag==="foreignObject"||o.tag==="desc"||o.tag==="title")&&(a=0);if(a===0){if(r==="svg")return 1;if(r==="math")return 2}return a}},yat=r=>{r.type===1&&r.props.forEach((o,s)=>{o.type===6&&o.name==="style"&&o.value&&(r.props[s]={type:7,name:"bind",arg:Kt$2("style",!0,o.loc),exp:gat(o.value.content,o.loc),modifiers:[],loc:o.loc})})},gat=(r,o)=>{const s=Ak$2(r);return Kt$2(JSON.stringify(s),!1,o,3)};function Cl$2(r,o){return nn$2(r,o)}const vat=(r,o,s)=>{const{exp:a,loc:l}=r;return a||s.onError(Cl$2(53,l)),o.children.length&&(s.onError(Cl$2(54,l)),o.children.length=0),{props:[Mn$2(Kt$2("innerHTML",!0,l),a||Kt$2("",!0))]}},bat=(r,o,s)=>{const{exp:a,loc:l}=r;return a||s.onError(Cl$2(55,l)),o.children.length&&(s.onError(Cl$2(56,l)),o.children.length=0),{props:[Mn$2(Kt$2("textContent",!0),a?wi$2(a,s)>0?a:Wn$2(s.helperString(uv$2),[a],l):Kt$2("",!0))]}},_at=(r,o,s)=>{const a=O8$1(r,o,s);if(!a.props.length||o.tagType===1)return a;r.arg&&s.onError(Cl$2(58,r.arg.loc));const{tag:l}=o,c=s.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||c){let u=P8$1,d=!1;if(l==="input"||c){const m=fv$2(o,"type");if(m){if(m.type===7)u=F3$1;else if(m.value)switch(m.value.content){case"radio":u=k8$1;break;case"checkbox":u=L8$1;break;case"file":d=!0,s.onError(Cl$2(59,r.loc));break}}else rot(o)&&(u=F3$1)}else l==="select"&&(u=D8$1);d||(a.needRuntime=s.helper(u))}else s.onError(Cl$2(57,r.loc));return a.props=a.props.filter(u=>!(u.key.type===4&&u.key.content==="modelValue")),a},wat=fi$2("passive,once,capture"),xat=fi$2("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Eat=fi$2("left,right"),B8$1=fi$2("onkeyup,onkeydown,onkeypress"),Tat=(r,o,s,a)=>{const l=[],c=[],u=[];for(let d=0;dti$2(r)&&r.content.toLowerCase()==="onclick"?Kt$2(o,!0):r.type!==4?Ss$1(["(",r,`) === "onClick" ? "${o}" : (`,r,")"]):r,Sat=(r,o,s)=>M8$1(r,o,s,a=>{const{modifiers:l}=r;if(!l.length)return a;let{key:c,value:u}=a.props[0];const{keyModifiers:d,nonKeyModifiers:m,eventOptionModifiers:g}=Tat(c,l,s,r.loc);if(m.includes("right")&&(c=V8$1(c,"onContextmenu")),m.includes("middle")&&(c=V8$1(c,"onMouseup")),m.length&&(u=Wn$2(s.helper(G8$1),[u,JSON.stringify(m)])),d.length&&(!ti$2(c)||B8$1(c.content.toLowerCase()))&&(u=Wn$2(s.helper(F8$1),[u,JSON.stringify(d)])),g.length){const y=g.map(dl$2).join("");c=ti$2(c)?Kt$2(`${c.content}${y}`,!0):Ss$1(["(",c,`) + "${y}"`])}return{props:[Mn$2(c,u)]}}),Aat=(r,o,s)=>{const{exp:a,loc:l}=r;return a||s.onError(Cl$2(61,l)),{props:[],needRuntime:s.helper(j8$1)}},Iat=(r,o)=>{r.type===1&&r.tagType===0&&(r.tag==="script"||r.tag==="style")&&o.removeNode()},Mat=[yat],Nat={cloak:dat,html:vat,text:bat,model:_at,on:Sat,show:Aat};function Oat(r,o={}){return pat(r,he({},mat,o,{nodeTransforms:[Iat,...Mat,...o.nodeTransforms||[]],directiveTransforms:he({},Nat,o.directiveTransforms||{}),transformHoist:null}))}const z8$1=Object.create(null);function H8$1(r,o){if(!Wt$2(r))if(r.nodeType)r=r.innerHTML;else return sr$2;const s=ort(r,o),a=z8$1[s];if(a)return a;if(r[0]==="#"){const d=document.querySelector(r);r=d?d.innerHTML:""}const l=he({hoistStatic:!0,onError:void 0,onWarn:sr$2},o);!l.isCustomElement&&typeof customElements<"u"&&(l.isCustomElement=d=>!!customElements.get(d));const{code:c}=Oat(r,l),u=new Function("Vue",c)(Fst);return u._rc=!0,z8$1[s]=u}qT$1(H8$1);const Cat=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:uT$2,BaseTransitionPropsValidators:k1$2,Comment:Sn$2,DeprecationTypes:YL$2,EffectScope:l1$2,ErrorCodes:c6$1,ErrorTypeStrings:BL$2,Fragment:ke$1,KeepAlive:L6$1,ReactiveEffect:op$2,Static:El$2,Suspense:TL$2,Teleport:cT$2,Text:lo$2,TrackOpTypes:i6$1,Transition:xm$2,TransitionGroup:rv$2,TriggerOpTypes:s6$1,VueElement:d0$2,assertNumber:l6$1,callWithAsyncErrorHandling:gi$2,callWithErrorHandling:vl$2,camelize:Ze$1,capitalize:dl$2,cloneVNode:Es,compatUtils:XL$2,compile:H8$1,computed:te,createApp:Ml$1,createBlock:Be,createCommentVNode:We$1,createElementBlock:wt,createElementVNode:lt$3,createHydrationRenderer:LT$2,createPropsRestProxy:Q6$1,createRenderer:kT$1,createSSRApp:a3$1,createSlots:F6$1,createStaticVNode:zT$1,createTextVNode:Ts$1,createVNode:Zt$2,customRef:eT$2,defineAsyncComponent:G1$2,defineComponent:ne$1,defineCustomElement:i3$1,defineEmits:$6$1,defineExpose:B6$1,defineModel:H6$1,defineOptions:V6$1,defineProps:U6$1,defineSSRCustomElement:b9$1,defineSlots:z6$1,devtools:VL$2,effect:Dk$2,effectScope:Qf$2,getCurrentInstance:In$2,getCurrentScope:c1$2,getCurrentWatcher:o6$1,getTransitionRawChildren:lm$2,guardReactiveProps:VT$1,h:vi$1,handleError:bl$2,hasInjectionContext:OT$1,hydrate:L9$1,hydrateOnIdle:O6$1,hydrateOnInteraction:k6$1,hydrateOnMediaQuery:R6$1,hydrateOnVisible:C6$1,initCustomFormatter:jL$2,initDirectivesForSSR:F9$1,inject:Pn$2,isMemoSame:ZT$1,isProxy:nm$2,isReactive:yi$2,isReadonly:Zo$2,isRef:pe$1,isRuntimeOnly:PL$2,isShallow:Zr$2,isVNode:ws$2,markRaw:yn$2,mergeDefaults:q6$1,mergeModels:Z6$1,mergeProps:vm$2,nextTick:Bi$2,normalizeClass:an$2,normalizeProps:Ik$2,normalizeStyle:Wo$1,onActivated:fT$1,onBeforeMount:yp$2,onBeforeUnmount:zi$1,onBeforeUpdate:gT$2,onDeactivated:mT$2,onErrorCaptured:U1$2,onMounted:qn$2,onRenderTracked:_T$2,onRenderTriggered:bT$2,onScopeDispose:VE$1,onServerPrefetch:vT$2,onUnmounted:tu$2,onUpdated:Kc$2,onWatcherCleanup:rT$2,openBlock:pt$1,popScopeId:y6$1,provide:V1$2,proxyRefs:x1$2,pushScopeId:m6$1,queuePostFlushCb:im$1,reactive:Vn$1,readonly:_1$2,ref:tt$3,registerRuntimeCompiler:qT$1,render:ou$2,renderList:ta$3,renderSlot:Hi$2,resolveComponent:vn$2,resolveDirective:Ie$2,resolveDynamicComponent:$1$2,resolveFilter:WL$2,resolveTransitionHooks:Qc$2,setBlockTracking:Y1$2,setDevtoolsHook:zL$2,setTransitionHooks:ao$2,shallowReactive:KE$1,shallowReadonly:cp$2,shallowRef:up$2,ssrContextKey:GT$2,ssrUtils:HL$2,stop:Gk$2,toDisplayString:$e$1,toHandlerKey:Jc$2,toHandlers:j6$1,toRaw:Ut$2,toRef:nT$2,toRefs:E1$2,toValue:n6$1,transformVNodeArgs:OL$2,triggerRef:e6$1,unref:It$2,useAttrs:Y6$1,useCssModule:w9$1,useCssVars:u9$1,useHost:s3$1,useId:I6$1,useModel:_L$2,useSSRContext:FT$1,useShadowRoot:_9$1,useSlots:X6$1,useTemplateRef:cm$2,useTransitionState:R1$2,vModelCheckbox:iv$2,vModelDynamic:o3$1,vModelRadio:sv$2,vModelSelect:ov$2,vModelText:bp$2,vShow:Em$1,version:QT$1,warn:$L$2,watch:Hn$2,watchEffect:vL$2,watchPostEffect:jT$1,watchSyncEffect:UT$1,withAsyncContext:K6$1,withCtx:gn$1,withDefaults:W6$1,withDirectives:Ae$1,withKeys:lv$2,withMemo:UL$2,withModifiers:wp$3,withScopeId:g6$1},Symbol.toStringTag,{value:"Module"}));var Rat=!1,W8$1={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_970c9b9c-9c28-4e11-91fe-3899b82e4149",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"",npm_config_user_agent:"npm/10.9.0 node/v22.12.0 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_970c9b9c-9c28-4e11-91fe-3899b82e4149",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",OLDPWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"ramp4-pcar4",npm_package_engines_node:"=22.12.0",GRADLE_HOME:"/usr/share/gradle-8.11.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"57148724",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_local_prefix:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",SYSTEMD_EXEC_PID:"834",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20241215.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.10/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.4/x64",JOURNAL_STREAM:"8:6781",GITHUB_WORKFLOW:"Build demo site and deploy to GitHub Pages",_:"/opt/hostedtoolcache/node/22.12.0/x64/bin/npm",npm_config_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",npm_config_npm_version:"10.9.0",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/runner-provisioner.service/memory.pressure",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"12600631880",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"tag",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_BASE_REF:"",ImageOS:"ubuntu24",GITHUB_WORKFLOW_REF:"ramp4-pcar4/ramp4-pcar4/.github/workflows/demo-build.yml@refs/tags/v4.10.2",ACTIONS_ID_TOKEN_REQUEST_TOKEN:"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ikh5cTROQVRBanNucUM3bWRydEFoaHJDUjJfUSJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zLkdlbmVyaWNSZWFkOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCBBY3Rpb25zLlJlc3VsdHM6MTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCBBY3Rpb25zLlVwbG9hZEFydGlmYWN0czowMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAvMTpCdWlsZC9CdWlsZC8xMTg1NiBEaXN0cmlidXRlZFRhc2suR2VuZXJhdGVJZFRva2VuOjEyMjcwNGU1LWRkNWItNGM3Zi04MWM2LTFjNjRjZWI0ZDE2YTpjYTM5NTA4NS0wNDBhLTUyNmItMmNlOC1iZGM4NWY2OTI3NzQgTG9jYXRpb25TZXJ2aWNlLkNvbm5lY3QgUmVhZEFuZFVwZGF0ZUJ1aWxkQnlVcmk6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwLzE6QnVpbGQvQnVpbGQvMTE4NTYiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiJkMmFlN2M1OS1lYjk5LTRhNGMtOGQxOS05N2EwZGY2ZDBhZDkiLCJzaWQiOiIwMWNhN2I4NC03YmZmLTRjYTMtOTM2Mi1iOWI4ODc5ZjFjN2QiLCJhYyI6Ilt7XCJTY29wZVwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcIlBlcm1pc3Npb25cIjozfSx7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9tYWluXCIsXCJQZXJtaXNzaW9uXCI6MX1dIiwiYWNzbCI6IjEwIiwib2lkY19leHRyYSI6IntcInJlZlwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcInNoYVwiOlwiZmEwZjEwYzk5OTgxNWMyZDA0YzJhMjk5NWFkOTA4YTFhMTgzNjMxYlwiLFwicmVwb3NpdG9yeVwiOlwicmFtcDQtcGNhcjQvcmFtcDQtcGNhcjRcIixcInJlcG9zaXRvcnlfb3duZXJcIjpcInJhbXA0LXBjYXI0XCIsXCJyZXBvc2l0b3J5X293bmVyX2lkXCI6XCI1NzE0ODcyNFwiLFwicnVuX2lkXCI6XCIxMjYwMDYzMTg4MFwiLFwicnVuX251bWJlclwiOlwiMTQyXCIsXCJydW5fYXR0ZW1wdFwiOlwiMVwiLFwicmVwb3NpdG9yeV92aXNpYmlsaXR5XCI6XCJwdWJsaWNcIixcInJlcG9zaXRvcnlfaWRcIjpcIjIxODM1NjA1N1wiLFwiYWN0b3JfaWRcIjpcIjc1ODUyNDVcIixcImFjdG9yXCI6XCJqYW1lcy1yYWVcIixcIndvcmtmbG93XCI6XCJCdWlsZCBkZW1vIHNpdGUgYW5kIGRlcGxveSB0byBHaXRIdWIgUGFnZXNcIixcImhlYWRfcmVmXCI6XCJcIixcImJhc2VfcmVmXCI6XCJcIixcImV2ZW50X25hbWVcIjpcInB1c2hcIixcInJlZl9wcm90ZWN0ZWRcIjpcImZhbHNlXCIsXCJyZWZfdHlwZVwiOlwidGFnXCIsXCJ3b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJ3b3JrZmxvd19zaGFcIjpcImZhMGYxMGM5OTk4MTVjMmQwNGMyYTI5OTVhZDkwOGExYTE4MzYzMWJcIixcImVudmlyb25tZW50XCI6XCJnaXRodWItcGFnZXNcIixcImVudmlyb25tZW50X25vZGVfaWRcIjpcIkVOX2t3RE9EUVBaV2M0ZUV4MlpcIixcImpvYl93b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJqb2Jfd29ya2Zsb3dfc2hhXCI6XCJmYTBmMTBjOTk5ODE1YzJkMDRjMmEyOTk1YWQ5MDhhMWExODM2MzFiXCIsXCJydW5uZXJfZW52aXJvbm1lbnRcIjpcImdpdGh1Yi1ob3N0ZWRcIn0iLCJvaWRjX3N1YiI6InJlcG86cmFtcDQtcGNhcjQvcmFtcDQtcGNhcjQ6ZW52aXJvbm1lbnQ6Z2l0aHViLXBhZ2VzIiwib3JjaGlkIjoiMTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhLmJ1aWxkLl9fZGVmYXVsdCIsImlzcyI6InZzdG9rZW4uYWN0aW9ucy5naXRodWJ1c2VyY29udGVudC5jb20iLCJhdWQiOiJ2c3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tfHZzbzpkYzhlN2U0ZC00ZDQ1LTQ4ZDAtYmY4YS02YmQ0YzZjMjQ2MDciLCJuYmYiOjE3MzU5MjA2NTEsImV4cCI6MTczNTk0MzQ1MX0.GDIMaHnR4BV7DsiZYljQVjH7maAY2oeT19GbL0fBsVgnLSFwh82jS97tSwainj2WAOKfT53NDCKgBCLyJEMNXgCLkesDDmaWKNr7E93N8EpiWWaeHC0gWfNng4854FKwe-2rSolRxMqjICH-MEL9daqiLdkvfT1Am5LvlA5gqUJfcXvG1ghyIplZrr_i8EovHetZNOIKC7V8TemKrUnogzxWmWjfE7jkyS6ER92v7Gb7pGnLtjNXoXrsuyXTaUDs6WJQEisuX3DyAlIMTGH35Y_GKb4TZzfcxQzGSIRH6wdbZPPrGnK0bt9mwM846IL1Bg6JmdG8McfmiAWr_xllxg",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_921a48f6-5b8e-4cc8-aff5-dc8fc3bbf3f7",INVOCATION_ID:"819722273f2741acab86958091275df4",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",npm_package_name:"ramp-pcar",GITHUB_ACTION:"__run_4",GITHUB_RUN_NUMBER:"142",GITHUB_TRIGGERING_ACTOR:"james-rae",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 6",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",GITHUB_REF_NAME:"v4.10.2",GITHUB_REPOSITORY:"ramp4-pcar4/ramp4-pcar4",STATS_D_D:"true",npm_lifecycle_script:"vite build --mode esDynamic",npm_config_loglevel:"silent",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"218356057",GITHUB_ACTIONS:"true",STATS_PIP:"false",npm_package_version:"4.10.2",npm_lifecycle_event:"build:esDynamic",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",ACCEPT_EULA:"Y",GITHUB_JOB:"build",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_RUN_ATTEMPT:"1",STATS_D_TC:"true",GITHUB_REF:"refs/tags/v4.10.2",GITHUB_ACTOR:"james-rae",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",npm_config_globalconfig:"/opt/hostedtoolcache/node/22.12.0/x64/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_970c9b9c-9c28-4e11-91fe-3899b82e4149",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",GITHUB_ACTOR_ID:"7585245",RUNNER_WORKSPACE:"/home/runner/work/ramp4-pcar4",npm_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"push",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",ACTIONS_ID_TOKEN_REQUEST_URL:"https://pipelinesghubeus2.actions.githubusercontent.com/CYYZq0bGEiBG5XjoYFUt7ZUW3UppKtccmRBdNq2vSmlX4E20ap/00000000-0000-0000-0000-000000000000/_apis/distributedtask/hubs/Actions/plans/122704e5-dd5b-4c7f-81c6-1c64ceb4d16a/jobs/ca395085-040a-526b-2ce8-bdc85f692774/idtoken?api-version=2.0",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_970c9b9c-9c28-4e11-91fe-3899b82e4149",npm_config_global_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.2.12479018",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",STATS_EXTP:"https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_970c9b9c-9c28-4e11-91fe-3899b82e4149",INIT_CWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",EDITOR:"vi",NODE_ENV:"production"};let X8$1;const Mv$2=r=>X8$1=r,Y8$1=Symbol();function j3$1(r){return r&&typeof r=="object"&&Object.prototype.toString.call(r)==="[object Object]"&&typeof r.toJSON!="function"}var Dm$2;(function(r){r.direct="direct",r.patchObject="patch object",r.patchFunction="patch function"})(Dm$2||(Dm$2={}));function kat(){const r=Qf$2(!0),o=r.run(()=>tt$3({}));let s=[],a=[];const l=yn$2({install(c){Mv$2(l),l._a=c,c.provide(Y8$1,l),c.config.globalProperties.$pinia=l,a.forEach(u=>s.push(u)),a=[]},use(c){return!this._a&&!Rat?a.push(c):s.push(c),this},_p:s,_a:null,_e:r,_s:new Map,state:o});return l}const J8$1=()=>{};function q8$1(r,o,s,a=J8$1){r.push(o);const l=()=>{const c=r.indexOf(o);c>-1&&(r.splice(c,1),a())};return!s&&c1$2()&&VE$1(l),l}function Ip$1(r,...o){r.slice().forEach(s=>{s(...o)})}const Lat=r=>r();function U3$1(r,o){r instanceof Map&&o instanceof Map&&o.forEach((s,a)=>r.set(a,s)),r instanceof Set&&o instanceof Set&&o.forEach(r.add,r);for(const s in o){if(!o.hasOwnProperty(s))continue;const a=o[s],l=r[s];j3$1(l)&&j3$1(a)&&r.hasOwnProperty(s)&&!pe$1(a)&&!yi$2(a)?r[s]=U3$1(l,a):r[s]=a}return r}const Pat=Symbol();function Dat(r){return!j3$1(r)||!r.hasOwnProperty(Pat)}const{assign:Rl$1}=Object;function Gat(r){return!!(pe$1(r)&&r.effect)}function Fat(r,o,s,a){const{state:l,actions:c,getters:u}=o,d=s.state.value[r];let m;function g(){!d&&W8$1.NODE_ENV==="production"&&(s.state.value[r]=l?l():{});const y=E1$2(s.state.value[r]);return Rl$1(y,c,Object.keys(u||{}).reduce((_,E)=>(_[E]=yn$2(te(()=>{Mv$2(s);const w=s._s.get(r);return u[E].call(w,w)})),_),{}))}return m=Z8$1(r,g,o,s,a,!0),m}function Z8$1(r,o,s={},a,l,c){let u;const d=Rl$1({actions:{}},s),m={deep:!0};let g,y,_=[],E=[],w;const T=a.state.value[r];!c&&!T&&W8$1.NODE_ENV==="production"&&(a.state.value[r]={}),tt$3({});let k;function O(L){let F;g=y=!1,typeof L=="function"?(L(a.state.value[r]),F={type:Dm$2.patchFunction,storeId:r,events:w}):(U3$1(a.state.value[r],L),F={type:Dm$2.patchObject,payload:L,storeId:r,events:w});const U=k=Symbol();Bi$2().then(()=>{k===U&&(g=!0)}),y=!0,Ip$1(_,F,a.state.value[r])}const R=c?function(){const{state:L}=s,F=L?L():{};this.$patch(U=>{Rl$1(U,F)})}:J8$1;function M(){u.stop(),_=[],E=[],a._s.delete(r)}function N(L,F){return function(){Mv$2(a);const U=Array.from(arguments),J=[],z=[];function ie(B){J.push(B)}function ce(B){z.push(B)}Ip$1(E,{args:U,name:L,store:P,after:ie,onError:ce});let Y;try{Y=F.apply(this&&this.$id===r?this:P,U)}catch(B){throw Ip$1(z,B),B}return Y instanceof Promise?Y.then(B=>(Ip$1(J,B),B)).catch(B=>(Ip$1(z,B),Promise.reject(B))):(Ip$1(J,Y),Y)}}const D={_p:a,$id:r,$onAction:q8$1.bind(null,E),$patch:O,$reset:R,$subscribe(L,F={}){const U=q8$1(_,L,F.detached,()=>J()),J=u.run(()=>Hn$2(()=>a.state.value[r],z=>{(F.flush==="sync"?y:g)&&L({storeId:r,type:Dm$2.direct,events:w},z)},Rl$1({},m,F)));return U},$dispose:M},P=Vn$1(D);a._s.set(r,P);const I=(a._a&&a._a.runWithContext||Lat)(()=>a._e.run(()=>(u=Qf$2()).run(o)));for(const L in I){const F=I[L];if(pe$1(F)&&!Gat(F)||yi$2(F))c||(T&&Dat(F)&&(pe$1(F)?F.value=T[L]:U3$1(F,T[L])),a.state.value[r][L]=F);else if(typeof F=="function"){const U=N(L,F);I[L]=U,d.actions[L]=F}}return Rl$1(P,I),Rl$1(Ut$2(P),I),Object.defineProperty(P,"$state",{get:()=>a.state.value[r],set:L=>{O(F=>{Rl$1(F,L)})}}),a._p.forEach(L=>{Rl$1(P,u.run(()=>L({store:P,app:a._a,pinia:a,options:d})))}),T&&c&&s.hydrate&&s.hydrate(P.$state,T),g=!0,y=!0,P}function ln$1(r,o,s){let a,l;const c=typeof o=="function";typeof r=="string"?(a=r,l=c?s:o):(l=r,a=r.id);function u(d,m){const g=OT$1();return d=d||(g?Pn$2(Y8$1,null):null),d&&Mv$2(d),d=X8$1,d._s.has(a)||(c?Z8$1(a,o,l,d):Fat(a,l,d)),d._s.get(a)}return u.$id=a,u}const Gm$2=ln$1("appbar",()=>{const r=tt$3({}),o=tt$3([]),s=tt$3([]),a=te(()=>o.value.map(u=>u.map(d=>r.value[d]).filter(d=>{if(typeof d=="string"||d.componentId)return!0})).filter(u=>u.length>0));function l(u){s.value.includes(u)||s.value.push(u)}function c(u){const d=s.value.indexOf(u);d!==-1&&s.value.splice(d,1),u in r.value&&delete r.value[u],o.value.forEach(m=>{const g=m.indexOf(u);g!==-1&&m.splice(g,1)})}return{items:r,order:o,temporary:s,visible:a,addTempButton:l,removeButton:c}}),Nv$2=ln$1("grid",()=>{const r=tt$3({}),o=tt$3(),s=tt$3();function a(d){r.value={...r.value,[d.id]:d}}function l(d){r.value[d]!==void 0&&delete r.value[d]}function c(d){return Object.keys(r.value).find(m=>r.value[m].layerIds.includes(d))}function u(d,m){r.value[d].layerIds=r.value[d].layerIds.filter(g=>g!==m)}return{grids:r,panel:o,currentId:s,addGrid:a,removeGrid:l,getGridId:c,removeLayer:u}});function kl$2(r,o,s,a){var l,c=!1,u=0;function d(){l&&clearTimeout(l)}function m(){d(),c=!0}typeof o!="boolean"&&(a=s,s=o,o=void 0);function g(){for(var y=arguments.length,_=new Array(y),E=0;Er?k():o!==!0&&(l=setTimeout(a?O:k,a===void 0?r-T:r))}return g.cancel=m,g}function Fm$1(r,o,s){return s===void 0?kl$2(r,o,!1):kl$2(r,s,o!==!1)}const Ll$2=ln$1("map-caption",()=>{const r=tt$3({text:{},logo:{}}),o=tt$3({}),s=tt$3({}),a=tt$3({});function l(u){u!==void 0?o.value.isImperialScale=u:o.value.isImperialScale=!o.value.isImperialScale}function c(u){r.value.text.value=u.text.value,r.value.text.disabled=u.text.disabled,r.value.logo.altText=u.logo.altText,r.value.logo.link=u.logo.link,r.value.logo.value=u.logo.value,r.value.logo.disabled=u.logo.disabled}return{attribution:r,scale:o,coords:s,langtoggle:a,toggleScale:l,setAttribution:c}}),$3$1=(r,o)=>{const s=[...r];for(;s.length>0;){const a=s.shift();if(o(a))return a;a&&s.push(...a.sublayers)}},As$1=ln$1("layer",()=>{const r=tt$3([]),o=tt$3([]),s=tt$3([]);function a(_){return $3$1(r.value,E=>E?.uid===_)}function l(_){return $3$1(r.value,E=>E?.id===_)}function c(_){return $3$1(r.value,E=>E!==void 0&&(E.id===_||E.uid===_))}function u(_){o.value=[...o.value,_]}function d(_,E=void 0){r.value=[...r.value,_],_.mapLayer&&((E===void 0||E<0)&&(console.error("Map layer added to store with invalid index!"),E=s.value.length),s.value.splice(E,0,_.id),s.value=[...s.value])}function m(_,E){if(!_.mapLayer){console.error("Data layer passed to layer store reorder");return}if(E<0){console.error("Negative index passed to layer store reorder");return}E>=s.value.length&&(E=s.value.length-1);const w=s.value.findIndex(T=>T===_.id);w!==-1&&w!==E&&(s.value.splice(w,1),s.value.splice(E,0,_.id),s.value=[...s.value])}function g(_){const E=r.value.filter(w=>w.id!==_.id||w.uid!==_.uid);if(r.value=E,_.mapLayer){const w=s.value.filter(T=>T!==_.id);s.value=w}}function y(_){const E=o.value.filter(w=>w.id!==_);o.value=E}return{layers:r,mapOrder:s,layerConfigs:o,getLayerByUid:a,getLayerById:l,getLayerByAny:c,addLayerConfig:u,addLayer:d,reorderLayer:m,removeLayer:g,removeLayerConfig:y}}),Dr$2=ln$1("config",()=>{const r=tt$3({map:{lodSets:[],extentSets:[],tileSchemas:[],basemaps:[],initialBasemapId:""},fixtures:{},layers:[]}),o=tt$3([]),s=tt$3(),a=tt$3({}),l=tt$3({});function c(m){if(a.value[l.value[m]]===void 0)throw new Error("Unsupported language or no registered config exists for requested language");return a.value[l.value[m]]}function u(m){const g={...r.value,...m};if(r.value=g,Array.isArray(r.value.layers)){const y=As$1();y.layerConfigs=[...y.layerConfigs,r.value.layers]}}function d(m){const g=m.configLangs,y=m.config,_=m.allLangs;g!==void 0&&g.length>0&&g.forEach(E=>{a.value[E]=y,l.value[E]=E}),_!==void 0&&_.length>0&&_.forEach(E=>{l.value[E]=Object.keys(a.value)[0]})}return{config:r,startingFixtures:o,activeBasemapConfig:s,registeredConfigs:a,registeredLangs:l,getActiveConfig:c,newConfig:u,registerConfig:d}}),B3$1=ln$1("details",()=>{const r=tt$3([]),o=tt$3({}),s=tt$3({}),a=tt$3(),l=tt$3(0),c=tt$3(0),u=tt$3(!0),d=tt$3();function m(y){const _=r.value.findIndex(E=>E.uid===y.uid);_!==-1&&r.value.splice(_,1)}function g(y){o.value={...o.value,[y.id]:y}}return{payload:r,properties:o,defaultTemplates:s,currentFeatureId:a,activeGreedy:l,lastHilight:c,hilightToggle:u,origin:d,removeLayer:m,addConfigProperty:g}}),Ji$2=ln$1("fixture",()=>{const r=tt$3({}),o=tt$3({});function s(u){return u.map(d=>o.value[d].getPromise())}function a(u){if(r.value={...r.value,[u.id]:yn$2(u)},u.id in o.value)o.value[u.id].resolveMe(yn$2(u));else{const d=new xn$2;d.resolveMe(yn$2(u)),o.value={...o.value,[u.id]:d}}typeof u.added=="function"&&u.added()}function l(u){delete r.value[u.id],r.value={...r.value},delete o.value[u.id],o.value={...o.value},typeof u.removed=="function"&&u.removed()}function c(u){o.value={...o.value,[u]:new xn$2}}return{items:r,loadPromises:o,getLoadPromises:s,addFixture:a,removeFixture:l,addLoadPromise:c}});var Mt$2=(r=>(r.APPBAR_BUTTON_CLICK="appbar/click",r.COMPONENT="ramp/component",r.CONFIG_CHANGE="config/configchanged",r.DETAILS_TOGGLE="details/toggle",r.FILTER_CHANGE="filter/change",r.FIXTURE_ADDED="fixture/added",r.FIXTURE_REMOVED="fixture/removed",r.GRID_TOGGLE="grid/toggle",r.HELP_TOGGLE="help/toggle",r.LANG_CHANGE="lang/change",r.LAYER_DRAWSTATECHANGE="layer/drawstatechange",r.LAYER_INITIATIONSTATECHANGE="layer/initiationStatechange",r.LAYER_LAYERSTATECHANGE="layer/layerstatechange",r.LAYER_OPACITYCHANGE="layer/opacitychange",r.LAYER_REGISTERED="layer/registered",r.LAYER_RELOAD_END="layer/reloadend",r.LAYER_RELOAD_START="layer/reloadstart",r.LAYER_REMOVE="layer/remove",r.LAYER_VISIBILITYCHANGE="layer/visibilitychange",r.MAP_BASEMAPCHANGE="map/basemapchanged",r.MAP_BLUR="map/blur",r.MAP_CLICK="map/click",r.MAP_CREATED="map/created",r.MAP_DESTROYED="map/destroyed",r.MAP_DOUBLECLICK="map/doubleclick",r.MAP_EXTENTCHANGE="map/extentchanged",r.MAP_FOCUS="map/focus",r.MAP_GRAPHICHIT="map/graphichit",r.MAP_IDENTIFY="map/identify",r.MAP_KEYDOWN="map/keydown",r.MAP_KEYUP="map/keyup",r.MAP_MOUSEDOWN="map/mousedown",r.MAP_MOUSELEAVE="map/mouseleave",r.MAP_MOUSEMOVE="map/mousemove",r.MAP_MOUSEMOVE_END="map/mousemoveend",r.MAP_MOUSEMOVE_START="map/mousemovestart",r.MAP_REFRESH_END="map/refreshend",r.MAP_REFRESH_START="map/refreshstart",r.MAP_REORDER="map/reorder",r.MAP_RESIZED="map/resized",r.MAP_SCALECHANGE="map/scalechanged",r.MAP_START="map/start",r.METADATA_TOGGLE="metadata/toggle",r.PANEL_CLOSED="panel/closed",r.PANEL_MINIMIZED="panel/minimized",r.PANEL_OPENED="panel/opened",r.RAMP_MOBILEVIEW_CHANGE="ramp/mobileviewchange",r.REORDER_TOGGLE="reorder/toggle",r.SETTINGS_TOGGLE="settings/toggle",r.USER_LAYER_ADDED="user/layeradded",r.WIZARD_TOGGLE="wizard/toggle",r))(Mt$2||{}),V3$1=(r=>(r.CONFIG_CHANGE_UPDATES_MAP_ATTRIBS="ramp_config_change_updates_map_attribs",r.LAYER_ERROR_UPDATES_LEGEND="ramp_layer_error_updates_legend",r.LAYER_REGISTER_BINDS_LEGEND="ramp_layer_register_binds_legend",r.LAYER_RELOAD_END_BINDS_LEGEND="ramp_layer_reload_end_binds_legend",r.LAYER_RELOAD_START_UPDATES_LEGEND="ramp_layer_reload_start_updates_legend",r.LAYER_REMOVE_UPDATES_DETAILS="ramp_layer_remove_updates_details",r.LAYER_REMOVE_CHECKS_GRID="ramp_layer_remove_checks_grid",r.LAYER_REMOVE_UPDATES_LEGEND="ramp_layer_remove_updates_legend",r.LAYER_USERADD_UPDATES_LEGEND="ramp_layer_useradd_updates_legend",r.MAP_BASEMAP_CHECKS_TILE_PROJ="ramp_map_basemap_checks_tile_proj",r.MAP_BASEMAP_UPDATES_MAP_ATTRIBS="ramp_map_basemap_updates_map_attribs",r.MAP_BLUR_UPDATES_KEY_HANDLER="ramp_map_blur_updates_key_handler",r.MAP_CLICK_RUNS_IDENTIFY="ramp_map_click_runs_identify",r.MAP_CREATED_INITIALIZES_FIXTURES="ramp_map_created_initializes_fixtures",r.MAP_CREATED_UPDATES_MAP_ATTRIBS="ramp_map_created_updates_map_attribs",r.MAP_EXTENT_UPDATES_MAPTIP="ramp_map_extent_updates_maptip",r.MAP_GRAPHICHIT_CREATES_MAPTIP="ramp_map_graphichit_creates_maptip",r.MAP_IDENTIFY_OPENS_IDENTIFY_RESULTS="ramp_map_identify_opens_identify_results",r.MAP_KEYDOWN_UPDATES_COORDS="ramp_map_keydown_updates_coords",r.MAP_KEYDOWN_UPDATES_KEY_HANDLER="ramp_map_keydown_updates_key_handler",r.MAP_KEYUP_UPDATES_KEY_HANDLER="ramp_map_keyup_updates_key_handler",r.MAP_MOUSE_UPDATES_COORDS="ramp_map_mouse_updates_coords",r.MAP_MOUSE_UPDATES_MAPTIP="ramp_map_mouse_updates_maptip",r.MAP_MOUSELEAVE_REMOVES_MAPTIP="ramp_map_mouseleave_removes_maptip",r.MAP_RESIZE_UPDATES_SCALEBAR="ramp_map_resize_updates_scalebar",r.MAP_SCALE_UPDATES_SCALEBAR="ramp_map_scale_updates_scalebar",r.PANEL_CLOSE_UPDATES_APPBAR="ramp_panel_close_updates_appbar",r.PANEL_OPEN_UPDATES_APPBAR="ramp_panel_open_updates_appbar",r.TOGGLE_DETAILS="ramp_toggle_details",r.TOGGLE_GRID="ramp_toggle_grid",r.TOGGLE_HELP="ramp_toggle_help",r.TOGGLE_METADATA="ramp_toggle_metadata",r.TOGGLE_REORDER="ramp_toggle_reorder",r.TOGGLE_SETTINGS="ramp_toggle_settings",r.TOGGLE_WIZARD="ramp_toggle_wizard",r))(V3$1||{});class jat{eventName;handlerName;handlerFunc;constructor(o,s,a){this.eventName=o,this.handlerName=s,this.handlerFunc=a}}class Uat extends Tn$2{_eventBus;_eventRegister;_nameRegister;_funCounter;constructor(o){super(o),this._eventBus=new Knt.TinyEmitter,this._eventRegister=[],this._funCounter=1,this._nameRegister=Object.values(Mt$2).filter(s=>typeof s=="string"&&s.indexOf("/")>-1)}findHandler(o){return this._eventRegister.find(s=>s.handlerName===o)}handlerNamer(o){return this._funCounter++,o.replace(/\//g,"_")+this._funCounter.toString()}registerEventName(o){(Array.isArray(o)?o:[o]).forEach(s=>{this._nameRegister.indexOf(s)===-1&&this._nameRegister.push(s)})}eventNames(){return this._nameRegister.slice()}on(o,s,a=""){if(this.findHandler(a))throw new Error("Duplicate handler name registration: "+a);a||(a=this.handlerNamer(o));const l=new jat(o,a,s);return this._eventRegister.push(l),this._eventBus.on(o,s),a}off(o){const s=this.findHandler(o);s&&(this._eventRegister.splice(this._eventRegister.indexOf(s),1),this._eventBus.off(s.eventName,s.handlerFunc))}offAll(o=""){this.activeHandlers(o).forEach(s=>this.off(s))}removeDefaultEvents(){Object.values(V3$1).forEach(o=>{this.off(o)})}emit(o,...s){this._eventBus.emit(o,...s)}once(o,s,a=""){a||(a=this.handlerNamer(o));const l=(...c)=>{s(...c),this.off(a)};return this.on(o,l,a)}activeHandlers(o=""){return o===""?this._eventRegister.map(s=>s.handlerName):this._eventRegister.filter(s=>s.eventName===o).map(s=>s.handlerName)}addDefaultEvents(o){return(!Array.isArray(o)||o.length===0)&&(o=Object.values(V3$1)),o.map(s=>this.defaultHandlerFactory(s))}defaultHandlerFactory(o){let s;switch(o){case"ramp_config_change_updates_map_attribs":s=a=>{const l=a.map.basemaps.find(c=>c.id===this.$iApi.geo.map.getCurrentBasemapId());this.$iApi.geo.map.caption.updateAttribution(l?.attribution)},this.$iApi.event.on("config/configchanged",s,o);break;case"ramp_layer_error_updates_legend":s=a=>{if(a.layer.layerState===sn$2.ERROR){const l=this.$iApi.fixture.get("legend");l&&l.updateLegend(a.layer)}},this.$iApi.event.on("layer/layerstatechange",s,o);break;case"ramp_layer_register_binds_legend":s=a=>{const l=this.$iApi.fixture.get("legend");l&&l.updateLegend(a)},this.$iApi.event.on("layer/registered",s,o);break;case"ramp_layer_reload_end_binds_legend":s=a=>{const l=this.$iApi.fixture.get("legend");l&&l.updateLegend(a)},this.$iApi.event.on("layer/reloadend",s,o);break;case"ramp_layer_reload_start_updates_legend":s=a=>{if(!a.isSublayer){const l=this.$iApi.fixture.get("legend");l&&l.reloadLayerItem(a.uid)}},this.$iApi.event.on("layer/reloadstart",s,o);break;case"ramp_layer_remove_checks_grid":s=a=>{if(this.$iApi.fixture.get("grid")){const l=Nv$2(this.$vApp.$pinia),c=l.getGridId(a.id);if(c===void 0)return;if(l.removeLayer(c,a.id),l.grids[c].layerIds.length===0){l.removeGrid(c);const u=l.currentId;if(c===u){const d=this.$iApi.panel.get("grid");this.$iApi.panel.close(d),l.currentId=void 0}}}},this.$iApi.event.on("layer/remove",s,o);break;case"ramp_layer_remove_updates_details":s=a=>{const l=B3$1(this.$vApp.$pinia);this.$iApi.fixture.get("details")&&l.removeLayer(a)},this.$iApi.event.on("layer/remove",s,o);break;case"ramp_layer_remove_updates_legend":s=a=>{const l=this.$iApi.fixture.get("legend");l&&(l.removeLayerItem(a),this.$iApi.updateAlert(this.$iApi.$i18n.t("legend.alert.layerRemoved",{name:a.name})))},this.$iApi.event.on("layer/remove",s,o);break;case"ramp_layer_useradd_updates_legend":s=a=>{const l=this.$iApi.fixture.get("legend");l&&l.addLayerItem(a)},this.$iApi.event.on("user/layeradded",s,o);break;case"ramp_map_basemap_checks_tile_proj":s=a=>{a.schemaChanged&&this.$iApi.geo.layer.allLayers().filter(l=>l.layerType===Ct$1.TILE).forEach(l=>{l.checkProj()})},this.$iApi.event.on("map/basemapchanged",s,o);break;case"ramp_map_basemap_updates_map_attribs":s=()=>{this.$iApi.geo.map.caption.updateAttribution(Dr$2(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.event.on("map/basemapchanged",s,o);break;case"ramp_map_blur_updates_key_handler":s=()=>{this.$iApi.geo.map.stopKeyPan()},this.$iApi.event.on("map/blur",s,o);break;case"ramp_map_click_runs_identify":s=a=>{a.button===0&&this.$iApi.geo.map.runIdentify(a)},this.on("map/click",s,o);break;case"ramp_map_created_initializes_fixtures":s=()=>{const a=Ji$2(this.$vApp.$pinia).items;Object.keys(a).forEach(l=>{a[l].initialized?.()})},this.$iApi.geo.map.created&&s(),this.$iApi.event.on("map/created",s,o);break;case"ramp_map_created_updates_map_attribs":s=()=>{this.$iApi.geo.map.caption.updateAttribution(Dr$2(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.geo.map.created&&s(),this.$iApi.event.on("map/created",s,o);break;case"ramp_map_extent_updates_maptip":s=()=>{if(this.$iApi.geo.map.keysActive){const a=this.$iApi.geo.map.mapPointToScreenPoint(this.$iApi.geo.map.getExtent().center());this.$iApi.geo.map.maptip.checkAtCoord(a)}else this.$iApi.geo.map.maptip.clear()},this.$iApi.event.on("map/extentchanged",kl$2(50,!0,()=>s()),o);break;case"ramp_map_graphichit_creates_maptip":s=a=>{this.$iApi.geo.map.maptip.generateDefaultMaptip(a)},this.$iApi.event.on("map/graphichit",s,o);break;case"ramp_map_identify_opens_identify_results":s=a=>{const l=this.$iApi.fixture.get("details");l&&l.openDetails(a.results)},this.on("map/identify",s,o);break;case"ramp_map_keydown_updates_coords":this.$iApi.event.on("map/keydown",kl$2(50,()=>{const a=Ll$2(this.$vApp.$pinia);a.coords?.disabled||!this.$iApi.geo.map.keysActive||this.$iApi.geo.map.caption.formatPoint(this.$iApi.geo.map.getExtent().center()).then(l=>{a.coords={formattedString:l}})}),o);break;case"ramp_map_keydown_updates_key_handler":s=a=>{this.$iApi.geo.map.mapKeyDown(a)},this.$iApi.event.on("map/keydown",s,o);break;case"ramp_map_keyup_updates_key_handler":s=a=>{this.$iApi.geo.map.mapKeyUp(a)},this.$iApi.event.on("map/keyup",s,o);break;case"ramp_map_mouse_updates_coords":this.$iApi.event.on("map/mousemove",kl$2(50,a=>{const l=Ll$2(this.$vApp.$pinia);l.coords?.disabled||this.$iApi.geo.map.caption.formatPoint(this.$iApi.geo.map.screenPointToMapPoint(a)).then(c=>{l.coords={formattedString:c}})}),o);break;case"ramp_map_mouse_updates_maptip":s=a=>{this.$iApi.geo.map.maptip.checkAtCoord({screenX:a.screenX,screenY:a.screenY})},this.$iApi.event.on("map/mousemove",kl$2(50,a=>s(a)),o);break;case"ramp_map_mouseleave_removes_maptip":s=()=>{this.$iApi.geo.map.maptip.clear()},this.$iApi.event.on("map/mouseleave",s);break;case"ramp_map_resize_updates_scalebar":this.$iApi.event.on("map/resized",Fm$1(100,()=>this.$iApi.geo.map.caption.updateScale()),o);break;case"ramp_map_scale_updates_scalebar":this.$iApi.event.on("map/scalechanged",Fm$1(300,()=>this.$iApi.geo.map.caption.updateScale()),o);break;case"ramp_panel_close_updates_appbar":s=a=>{const l=Gm$2(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&!l.order.flat().find(c=>c===a.id)&&l.removeButton(a.id)},this.on("panel/closed",s,o);break;case"ramp_panel_open_updates_appbar":s=a=>{const l=Gm$2(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&(!a.teleport||a.teleport?.showAppbarButton)&&!l.order.flat().find(c=>c===a.id)&&l.addTempButton(a.id)},this.on("panel/opened",s,o);break;case"ramp_toggle_details":s=(a,l)=>{const c=this.$iApi.fixture.get("details");c&&c.toggleFeature(a,l)},this.$iApi.event.on("details/toggle",s,o);break;case"ramp_toggle_grid":s=(a,l)=>{const c=this.$iApi.fixture.get("grid");c&&c.toggleGrid(a.id,l)},this.$iApi.event.on("grid/toggle",s,o);break;case"ramp_toggle_help":s=a=>{const l=this.$iApi.fixture.get("help");l&&l.toggleHelp(a)},this.$iApi.event.on("help/toggle",s,o);break;case"ramp_toggle_metadata":s=(a,l)=>{const c=this.$iApi.fixture.get("metadata");c&&c.toggleMetadata(a,l)},this.$iApi.event.on("metadata/toggle",s,o);break;case"ramp_toggle_reorder":s=a=>{const l=this.$iApi.fixture.get("layer-reorder");l&&l.toggleLayerReorder(a)},this.$iApi.event.on("reorder/toggle",s,o);break;case"ramp_toggle_settings":s=(a,l)=>{const c=this.$iApi.fixture.get("settings");c&&c.toggleSettings(a,l)},this.$iApi.event.on("settings/toggle",s,o);break;case"ramp_toggle_wizard":s=a=>{const l=this.$iApi.fixture.get("wizard");l&&l.toggleWizard(a)},this.$iApi.event.on("wizard/toggle",s,o);break;default:return console.error(`Unrecognized default event handler name encountered: ${o}`),`ERROR_NOT_REGISTERED__${o}`}return o}}const Ov$2=typeof window<"u",Pl$1=(r,o=!1)=>o?Symbol.for(r):Symbol(r),$at=(r,o,s)=>Bat({l:r,k:o,s}),Bat=r=>JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Nn$2=r=>typeof r=="number"&&isFinite(r),Vat=r=>eP$2(r)==="[object Date]",Dl$2=r=>eP$2(r)==="[object RegExp]",Cv$2=r=>Xt$2(r)&&Object.keys(r).length===0,ar$1=Object.assign,zat=Object.create,De$1=(r=null)=>zat(r);let Q8$1;const aa$2=()=>Q8$1||(Q8$1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:De$1());function K8$1(r){return r.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const Hat$1=Object.prototype.hasOwnProperty;function Is$2(r,o){return Hat$1.call(r,o)}const Qe$1=Array.isArray,Xe=r=>typeof r=="function",xt$2=r=>typeof r=="string",se=r=>typeof r=="boolean",ve$1=r=>r!==null&&typeof r=="object",Wat=r=>ve$1(r)&&Xe(r.then)&&Xe(r.catch),tP$2=Object.prototype.toString,eP$2=r=>tP$2.call(r),Xt$2=r=>{if(!ve$1(r))return!1;const o=Object.getPrototypeOf(r);return o===null||o.constructor===Object},Xat=r=>r==null?"":Qe$1(r)||Xt$2(r)&&r.toString===tP$2?JSON.stringify(r,null,2):String(r);function Yat(r,o=""){return r.reduce((s,a,l)=>l===0?s+a:s+o+a,"")}function Rv$2(r){let o=r;return()=>++o}function Jat(r,o){typeof console<"u"&&(console.warn("[intlify] "+r),o&&console.warn(o.stack))}const kv$2=r=>!ve$1(r)||Qe$1(r);function Lv$2(r,o){if(kv$2(r)||kv$2(o))throw new Error("Invalid value");const s=[{src:r,des:o}];for(;s.length;){const{src:a,des:l}=s.pop();Object.keys(a).forEach(c=>{c!=="__proto__"&&(ve$1(a[c])&&!ve$1(l[c])&&(l[c]=Array.isArray(a[c])?[]:De$1()),kv$2(l[c])||kv$2(a[c])?l[c]=a[c]:s.push({src:a[c],des:l[c]}))})}}function qat(r,o,s){return{line:r,column:o,offset:s}}function Pv$2(r,o,s){return{start:r,end:o}}const Zat=/\{([0-9a-zA-Z]+)\}/g;function nP$2(r,...o){return o.length===1&&Qat(o[0])&&(o=o[0]),(!o||!o.hasOwnProperty)&&(o={}),r.replace(Zat,(s,a)=>o.hasOwnProperty(a)?o[a]:"")}const rP$2=Object.assign,iP$2=r=>typeof r=="string",Qat=r=>r!==null&&typeof r=="object";function sP$2(r,o=""){return r.reduce((s,a,l)=>l===0?s+a:s+o+a,"")}const z3$1={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},Kat={[z3$1.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function tlt(r,o,...s){const a=nP$2(Kat[r],...s||[]),l={message:String(a),code:r};return o&&(l.location=o),l}const $t$2={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},elt={[$t$2.EXPECTED_TOKEN]:"Expected token: '{0}'",[$t$2.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[$t$2.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[$t$2.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[$t$2.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[$t$2.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[$t$2.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[$t$2.EMPTY_PLACEHOLDER]:"Empty placeholder",[$t$2.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[$t$2.INVALID_LINKED_FORMAT]:"Invalid linked format",[$t$2.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[$t$2.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[$t$2.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[$t$2.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[$t$2.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[$t$2.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function Mp$2(r,o,s={}){const{domain:a,messages:l,args:c}=s,u=nP$2((l||elt)[r]||"",...c||[]),d=new SyntaxError(String(u));return d.code=r,o&&(d.location=o),d.domain=a,d}function nlt$1(r){throw r}const la$2=" ",rlt="\r",ni$3=` -`,ilt="\u2028",slt="\u2029";function olt$1(r){const o=r;let s=0,a=1,l=1,c=0;const u=L=>o[L]===rlt&&o[L+1]===ni$3,d=L=>o[L]===ni$3,m=L=>o[L]===slt,g=L=>o[L]===ilt,y=L=>u(L)||d(L)||m(L)||g(L),_=()=>s,E=()=>a,w=()=>l,T=()=>c,k=L=>u(L)||m(L)||g(L)?ni$3:o[L],O=()=>k(s),R=()=>k(s+c);function M(){return c=0,y(s)&&(a++,l=0),u(s)&&s++,s++,l++,o[s]}function N(){return u(s+c)&&c++,c++,o[s+c]}function D(){s=0,a=1,l=1,c=0}function P(L=0){c=L}function I(){const L=s+c;for(;L!==s;)M();c=0}return{index:_,line:E,column:w,peekOffset:T,charAt:k,currentChar:O,currentPeek:R,next:M,peek:N,reset:D,resetPeek:P,skipToPeek:I}}const Gl$2=void 0,oP$2="'",alt="tokenizer";function llt(r,o={}){const s=o.location!==!1,a=olt$1(r),l=()=>a.index(),c=()=>qat(a.line(),a.column(),a.index()),u=c(),d=l(),m={currentType:14,offset:d,startLoc:u,endLoc:u,lastType:14,lastOffset:d,lastStartLoc:u,lastEndLoc:u,braceNest:0,inLinked:!1,text:""},g=()=>m,{onError:y}=o;function _(dee,fee,Oee,...xee){const kee=g();if(fee.column+=Oee,fee.offset+=Oee,y){const Dte=s?Pv$2(kee.startLoc,fee):null,Ite=Mp$2(dee,Dte,{domain:alt,args:xee});y(Ite)}}function E(dee,fee,Oee){dee.endLoc=c(),dee.currentType=fee;const xee={type:fee};return s&&(xee.loc=Pv$2(dee.startLoc,dee.endLoc)),Oee!=null&&(xee.value=Oee),xee}const w=dee=>E(dee,14);function T(dee,fee){return dee.currentChar()===fee?(dee.next(),fee):(_($t$2.EXPECTED_TOKEN,c(),0,fee),"")}function k(dee){let fee="";for(;dee.currentPeek()===la$2||dee.currentPeek()===ni$3;)fee+=dee.currentPeek(),dee.peek();return fee}function O(dee){const fee=k(dee);return dee.skipToPeek(),fee}function R(dee){if(dee===Gl$2)return!1;const fee=dee.charCodeAt(0);return fee>=97&&fee<=122||fee>=65&&fee<=90||fee===95}function M(dee){if(dee===Gl$2)return!1;const fee=dee.charCodeAt(0);return fee>=48&&fee<=57}function N(dee,fee){const{currentType:Oee}=fee;if(Oee!==2)return!1;k(dee);const xee=R(dee.currentPeek());return dee.resetPeek(),xee}function D(dee,fee){const{currentType:Oee}=fee;if(Oee!==2)return!1;k(dee);const xee=dee.currentPeek()==="-"?dee.peek():dee.currentPeek(),kee=M(xee);return dee.resetPeek(),kee}function P(dee,fee){const{currentType:Oee}=fee;if(Oee!==2)return!1;k(dee);const xee=dee.currentPeek()===oP$2;return dee.resetPeek(),xee}function I(dee,fee){const{currentType:Oee}=fee;if(Oee!==8)return!1;k(dee);const xee=dee.currentPeek()===".";return dee.resetPeek(),xee}function L(dee,fee){const{currentType:Oee}=fee;if(Oee!==9)return!1;k(dee);const xee=R(dee.currentPeek());return dee.resetPeek(),xee}function F(dee,fee){const{currentType:Oee}=fee;if(!(Oee===8||Oee===12))return!1;k(dee);const xee=dee.currentPeek()===":";return dee.resetPeek(),xee}function U(dee,fee){const{currentType:Oee}=fee;if(Oee!==10)return!1;const xee=()=>{const Dte=dee.currentPeek();return Dte==="{"?R(dee.peek()):Dte==="@"||Dte==="%"||Dte==="|"||Dte===":"||Dte==="."||Dte===la$2||!Dte?!1:Dte===ni$3?(dee.peek(),xee()):ie(dee,!1)},kee=xee();return dee.resetPeek(),kee}function J(dee){k(dee);const fee=dee.currentPeek()==="|";return dee.resetPeek(),fee}function z(dee){const fee=k(dee),Oee=dee.currentPeek()==="%"&&dee.peek()==="{";return dee.resetPeek(),{isModulo:Oee,hasSpace:fee.length>0}}function ie(dee,fee=!0){const Oee=(kee=!1,Dte="",Ite=!1)=>{const Lte=dee.currentPeek();return Lte==="{"?Dte==="%"?!1:kee:Lte==="@"||!Lte?Dte==="%"?!0:kee:Lte==="%"?(dee.peek(),Oee(kee,"%",!0)):Lte==="|"?Dte==="%"||Ite?!0:!(Dte===la$2||Dte===ni$3):Lte===la$2?(dee.peek(),Oee(!0,la$2,Ite)):Lte===ni$3?(dee.peek(),Oee(!0,ni$3,Ite)):!0},xee=Oee();return fee&&dee.resetPeek(),xee}function ce(dee,fee){const Oee=dee.currentChar();return Oee===Gl$2?Gl$2:fee(Oee)?(dee.next(),Oee):null}function Y(dee){const fee=dee.charCodeAt(0);return fee>=97&&fee<=122||fee>=65&&fee<=90||fee>=48&&fee<=57||fee===95||fee===36}function B(dee){return ce(dee,Y)}function V(dee){const fee=dee.charCodeAt(0);return fee>=97&&fee<=122||fee>=65&&fee<=90||fee>=48&&fee<=57||fee===95||fee===36||fee===45}function Ge(dee){return ce(dee,V)}function St(dee){const fee=dee.charCodeAt(0);return fee>=48&&fee<=57}function Dee(dee){return ce(dee,St)}function pee(dee){const fee=dee.charCodeAt(0);return fee>=48&&fee<=57||fee>=65&&fee<=70||fee>=97&&fee<=102}function jr(dee){return ce(dee,pee)}function Tee(dee){let fee="",Oee="";for(;fee=Dee(dee);)Oee+=fee;return Oee}function et(dee){O(dee);const fee=dee.currentChar();return fee!=="%"&&_($t$2.EXPECTED_TOKEN,c(),0,fee),dee.next(),"%"}function ft(dee){let fee="";for(;;){const Oee=dee.currentChar();if(Oee==="{"||Oee==="}"||Oee==="@"||Oee==="|"||!Oee)break;if(Oee==="%")if(ie(dee))fee+=Oee,dee.next();else break;else if(Oee===la$2||Oee===ni$3)if(ie(dee))fee+=Oee,dee.next();else{if(J(dee))break;fee+=Oee,dee.next()}else fee+=Oee,dee.next()}return fee}function yee(dee){O(dee);let fee="",Oee="";for(;fee=Ge(dee);)Oee+=fee;return dee.currentChar()===Gl$2&&_($t$2.UNTERMINATED_CLOSING_BRACE,c(),0),Oee}function ete(dee){O(dee);let fee="";return dee.currentChar()==="-"?(dee.next(),fee+=`-${Tee(dee)}`):fee+=Tee(dee),dee.currentChar()===Gl$2&&_($t$2.UNTERMINATED_CLOSING_BRACE,c(),0),fee}function xte(dee){return dee!==oP$2&&dee!==ni$3}function Ote(dee){O(dee),T(dee,"'");let fee="",Oee="";for(;fee=ce(dee,xte);)fee==="\\"?Oee+=nee(dee):Oee+=fee;const xee=dee.currentChar();return xee===ni$3||xee===Gl$2?(_($t$2.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,c(),0),xee===ni$3&&(dee.next(),T(dee,"'")),Oee):(T(dee,"'"),Oee)}function nee(dee){const fee=dee.currentChar();switch(fee){case"\\":case"'":return dee.next(),`\\${fee}`;case"u":return Wee(dee,fee,4);case"U":return Wee(dee,fee,6);default:return _($t$2.UNKNOWN_ESCAPE_SEQUENCE,c(),0,fee),""}}function Wee(dee,fee,Oee){T(dee,fee);let xee="";for(let kee=0;kee{const xee=dee.currentChar();return xee==="{"||xee==="%"||xee==="@"||xee==="|"||xee==="("||xee===")"||!xee||xee===la$2?Oee:(Oee+=xee,dee.next(),fee(Oee))};return fee("")}function Lee(dee){O(dee);const fee=T(dee,"|");return O(dee),fee}function $te(dee,fee){let Oee=null;switch(dee.currentChar()){case"{":return fee.braceNest>=1&&_($t$2.NOT_ALLOW_NEST_PLACEHOLDER,c(),0),dee.next(),Oee=E(fee,2,"{"),O(dee),fee.braceNest++,Oee;case"}":return fee.braceNest>0&&fee.currentType===2&&_($t$2.EMPTY_PLACEHOLDER,c(),0),dee.next(),Oee=E(fee,3,"}"),fee.braceNest--,fee.braceNest>0&&O(dee),fee.inLinked&&fee.braceNest===0&&(fee.inLinked=!1),Oee;case"@":return fee.braceNest>0&&_($t$2.UNTERMINATED_CLOSING_BRACE,c(),0),Oee=Kee(dee,fee)||w(fee),fee.braceNest=0,Oee;default:{let xee=!0,kee=!0,Dte=!0;if(J(dee))return fee.braceNest>0&&_($t$2.UNTERMINATED_CLOSING_BRACE,c(),0),Oee=E(fee,1,Lee(dee)),fee.braceNest=0,fee.inLinked=!1,Oee;if(fee.braceNest>0&&(fee.currentType===5||fee.currentType===6||fee.currentType===7))return _($t$2.UNTERMINATED_CLOSING_BRACE,c(),0),fee.braceNest=0,Iee(dee,fee);if(xee=N(dee,fee))return Oee=E(fee,5,yee(dee)),O(dee),Oee;if(kee=D(dee,fee))return Oee=E(fee,6,ete(dee)),O(dee),Oee;if(Dte=P(dee,fee))return Oee=E(fee,7,Ote(dee)),O(dee),Oee;if(!xee&&!kee&&!Dte)return Oee=E(fee,13,Nte(dee)),_($t$2.INVALID_TOKEN_IN_PLACEHOLDER,c(),0,Oee.value),O(dee),Oee;break}}return Oee}function Kee(dee,fee){const{currentType:Oee}=fee;let xee=null;const kee=dee.currentChar();switch((Oee===8||Oee===9||Oee===12||Oee===10)&&(kee===ni$3||kee===la$2)&&_($t$2.INVALID_LINKED_FORMAT,c(),0),kee){case"@":return dee.next(),xee=E(fee,8,"@"),fee.inLinked=!0,xee;case".":return O(dee),dee.next(),E(fee,9,".");case":":return O(dee),dee.next(),E(fee,10,":");default:return J(dee)?(xee=E(fee,1,Lee(dee)),fee.braceNest=0,fee.inLinked=!1,xee):I(dee,fee)||F(dee,fee)?(O(dee),Kee(dee,fee)):L(dee,fee)?(O(dee),E(fee,12,_ee(dee))):U(dee,fee)?(O(dee),kee==="{"?$te(dee,fee)||xee:E(fee,11,st(dee))):(Oee===8&&_($t$2.INVALID_LINKED_FORMAT,c(),0),fee.braceNest=0,fee.inLinked=!1,Iee(dee,fee))}}function Iee(dee,fee){let Oee={type:14};if(fee.braceNest>0)return $te(dee,fee)||w(fee);if(fee.inLinked)return Kee(dee,fee)||w(fee);switch(dee.currentChar()){case"{":return $te(dee,fee)||w(fee);case"}":return _($t$2.UNBALANCED_CLOSING_BRACE,c(),0),dee.next(),E(fee,3,"}");case"@":return Kee(dee,fee)||w(fee);default:{if(J(dee))return Oee=E(fee,1,Lee(dee)),fee.braceNest=0,fee.inLinked=!1,Oee;const{isModulo:xee,hasSpace:kee}=z(dee);if(xee)return kee?E(fee,0,ft(dee)):E(fee,4,et(dee));if(ie(dee))return E(fee,0,ft(dee));break}}return Oee}function Rte(){const{currentType:dee,offset:fee,startLoc:Oee,endLoc:xee}=m;return m.lastType=dee,m.lastOffset=fee,m.lastStartLoc=Oee,m.lastEndLoc=xee,m.offset=l(),m.startLoc=c(),a.currentChar()===Gl$2?E(m,14):Iee(a,m)}return{nextToken:Rte,currentOffset:l,currentPosition:c,context:g}}const clt="parser",ult=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function hlt(r,o,s){switch(r){case"\\\\":return"\\";case"\\'":return"'";default:{const a=parseInt(o||s,16);return a<=55295||a>=57344?String.fromCodePoint(a):"�"}}}function plt(r={}){const o=r.location!==!1,{onError:s,onWarn:a}=r;function l(N,D,P,I,...L){const F=N.currentPosition();if(F.offset+=I,F.column+=I,s){const U=o?Pv$2(P,F):null,J=Mp$2(D,U,{domain:clt,args:L});s(J)}}function c(N,D,P,I,...L){const F=N.currentPosition();if(F.offset+=I,F.column+=I,a){const U=o?Pv$2(P,F):null;a(tlt(D,U,L))}}function u(N,D,P){const I={type:N};return o&&(I.start=D,I.end=D,I.loc={start:P,end:P}),I}function d(N,D,P,I){o&&(N.end=D,N.loc&&(N.loc.end=P))}function m(N,D){const P=N.context(),I=u(3,P.offset,P.startLoc);return I.value=D,d(I,N.currentOffset(),N.currentPosition()),I}function g(N,D){const P=N.context(),{lastOffset:I,lastStartLoc:L}=P,F=u(5,I,L);return F.index=parseInt(D,10),N.nextToken(),d(F,N.currentOffset(),N.currentPosition()),F}function y(N,D,P){const I=N.context(),{lastOffset:L,lastStartLoc:F}=I,U=u(4,L,F);return U.key=D,P===!0&&(U.modulo=!0),N.nextToken(),d(U,N.currentOffset(),N.currentPosition()),U}function _(N,D){const P=N.context(),{lastOffset:I,lastStartLoc:L}=P,F=u(9,I,L);return F.value=D.replace(ult,hlt),N.nextToken(),d(F,N.currentOffset(),N.currentPosition()),F}function E(N){const D=N.nextToken(),P=N.context(),{lastOffset:I,lastStartLoc:L}=P,F=u(8,I,L);return D.type!==12?(l(N,$t$2.UNEXPECTED_EMPTY_LINKED_MODIFIER,P.lastStartLoc,0),F.value="",d(F,I,L),{nextConsumeToken:D,node:F}):(D.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,P.lastStartLoc,0,Ms$2(D)),F.value=D.value||"",d(F,N.currentOffset(),N.currentPosition()),{node:F})}function w(N,D){const P=N.context(),I=u(7,P.offset,P.startLoc);return I.value=D,d(I,N.currentOffset(),N.currentPosition()),I}function T(N){const D=N.context(),P=u(6,D.offset,D.startLoc);let I=N.nextToken();if(I.type===9){const L=E(N);P.modifier=L.node,I=L.nextConsumeToken||N.nextToken()}switch(I.type!==10&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(I)),I=N.nextToken(),I.type===2&&(I=N.nextToken()),I.type){case 11:I.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(I)),P.key=w(N,I.value||"");break;case 5:I.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(I)),P.key=y(N,I.value||"");break;case 6:I.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(I)),P.key=g(N,I.value||"");break;case 7:I.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(I)),P.key=_(N,I.value||"");break;default:{l(N,$t$2.UNEXPECTED_EMPTY_LINKED_KEY,D.lastStartLoc,0);const L=N.context(),F=u(7,L.offset,L.startLoc);return F.value="",d(F,L.offset,L.startLoc),P.key=F,d(P,L.offset,L.startLoc),{nextConsumeToken:I,node:P}}}return d(P,N.currentOffset(),N.currentPosition()),{node:P}}function k(N){const D=N.context(),P=D.currentType===1?N.currentOffset():D.offset,I=D.currentType===1?D.endLoc:D.startLoc,L=u(2,P,I);L.items=[];let F=null,U=null;do{const ie=F||N.nextToken();switch(F=null,ie.type){case 0:ie.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(ie)),L.items.push(m(N,ie.value||""));break;case 6:ie.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(ie)),L.items.push(g(N,ie.value||""));break;case 4:U=!0;break;case 5:ie.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(ie)),L.items.push(y(N,ie.value||"",!!U)),U&&(c(N,z3$1.USE_MODULO_SYNTAX,D.lastStartLoc,0,Ms$2(ie)),U=null);break;case 7:ie.value==null&&l(N,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,Ms$2(ie)),L.items.push(_(N,ie.value||""));break;case 8:{const ce=T(N);L.items.push(ce.node),F=ce.nextConsumeToken||null;break}}}while(D.currentType!==14&&D.currentType!==1);const J=D.currentType===1?D.lastOffset:N.currentOffset(),z=D.currentType===1?D.lastEndLoc:N.currentPosition();return d(L,J,z),L}function O(N,D,P,I){const L=N.context();let F=I.items.length===0;const U=u(1,D,P);U.cases=[],U.cases.push(I);do{const J=k(N);F||(F=J.items.length===0),U.cases.push(J)}while(L.currentType!==14);return F&&l(N,$t$2.MUST_HAVE_MESSAGES_IN_PLURAL,P,0),d(U,N.currentOffset(),N.currentPosition()),U}function R(N){const D=N.context(),{offset:P,startLoc:I}=D,L=k(N);return D.currentType===14?L:O(N,P,I,L)}function M(N){const D=llt(N,rP$2({},r)),P=D.context(),I=u(0,P.offset,P.startLoc);return o&&I.loc&&(I.loc.source=N),I.body=R(D),r.onCacheKey&&(I.cacheKey=r.onCacheKey(N)),P.currentType!==14&&l(D,$t$2.UNEXPECTED_LEXICAL_ANALYSIS,P.lastStartLoc,0,N[P.offset]||""),d(I,D.currentOffset(),D.currentPosition()),I}return{parse:M}}function Ms$2(r){if(r.type===14)return"EOF";const o=(r.value||"").replace(/\r?\n/gu,"\\n");return o.length>10?o.slice(0,9)+"…":o}function dlt(r,o={}){const s={ast:r,helpers:new Set};return{context:()=>s,helper:a=>(s.helpers.add(a),a)}}function aP$2(r,o){for(let s=0;slP$2(s)),r}function lP$2(r){if(r.items.length===1){const o=r.items[0];(o.type===3||o.type===9)&&(r.static=o.value,delete o.value)}else{const o=[];for(let s=0;sd;function g(T,k){d.code+=T}function y(T,k=!0){const O=k?l:"";g(c?O+" ".repeat(T):O)}function _(T=!0){const k=++d.indentLevel;T&&y(k)}function E(T=!0){const k=--d.indentLevel;T&&y(k)}function w(){y(d.indentLevel)}return{context:m,push:g,indent:_,deindent:E,newline:w,helper:T=>`_${T}`,needIndent:()=>d.needIndent}}function blt(r,o){const{helper:s}=r;r.push(`${s("linked")}(`),Op$2(r,o.key),o.modifier?(r.push(", "),Op$2(r,o.modifier),r.push(", _type")):r.push(", undefined, _type"),r.push(")")}function _lt(r,o){const{helper:s,needIndent:a}=r;r.push(`${s("normalize")}([`),r.indent(a());const l=o.items.length;for(let c=0;c1){r.push(`${s("plural")}([`),r.indent(a());const l=o.cases.length;for(let c=0;c{const s=iP$2(o.mode)?o.mode:"normal",a=iP$2(o.filename)?o.filename:"message.intl",l=!!o.sourceMap,c=o.breakLineCode!=null?o.breakLineCode:s==="arrow"?";":` -`,u=o.needIndent?o.needIndent:s!=="arrow",d=r.helpers||[],m=vlt(r,{mode:s,filename:a,sourceMap:l,breakLineCode:c,needIndent:u});m.push(s==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),m.indent(u),d.length>0&&(m.push(`const { ${sP$2(d.map(_=>`${_}: _${_}`),", ")} } = ctx`),m.newline()),m.push("return "),Op$2(m,r),m.deindent(u),m.push("}"),delete r.helpers;const{code:g,map:y}=m.context();return{ast:r,code:g,map:y?y.toJSON():void 0}};function Tlt(r,o={}){const s=rP$2({},o),a=!!s.jit,l=!!s.minify,c=s.optimize==null?!0:s.optimize,u=plt(s).parse(r);return a?(c&&mlt(u),l&&Np$2(u),{ast:u,code:""}):(flt(u,s),Elt(u,s))}var Slt={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_970c9b9c-9c28-4e11-91fe-3899b82e4149",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"",npm_config_user_agent:"npm/10.9.0 node/v22.12.0 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_970c9b9c-9c28-4e11-91fe-3899b82e4149",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",OLDPWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"ramp4-pcar4",npm_package_engines_node:"=22.12.0",GRADLE_HOME:"/usr/share/gradle-8.11.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"57148724",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_local_prefix:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",SYSTEMD_EXEC_PID:"834",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20241215.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.10/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.4/x64",JOURNAL_STREAM:"8:6781",GITHUB_WORKFLOW:"Build demo site and deploy to GitHub Pages",_:"/opt/hostedtoolcache/node/22.12.0/x64/bin/npm",npm_config_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",npm_config_npm_version:"10.9.0",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/runner-provisioner.service/memory.pressure",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"12600631880",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"tag",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_BASE_REF:"",ImageOS:"ubuntu24",GITHUB_WORKFLOW_REF:"ramp4-pcar4/ramp4-pcar4/.github/workflows/demo-build.yml@refs/tags/v4.10.2",ACTIONS_ID_TOKEN_REQUEST_TOKEN:"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ikh5cTROQVRBanNucUM3bWRydEFoaHJDUjJfUSJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zLkdlbmVyaWNSZWFkOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCBBY3Rpb25zLlJlc3VsdHM6MTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCBBY3Rpb25zLlVwbG9hZEFydGlmYWN0czowMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAvMTpCdWlsZC9CdWlsZC8xMTg1NiBEaXN0cmlidXRlZFRhc2suR2VuZXJhdGVJZFRva2VuOjEyMjcwNGU1LWRkNWItNGM3Zi04MWM2LTFjNjRjZWI0ZDE2YTpjYTM5NTA4NS0wNDBhLTUyNmItMmNlOC1iZGM4NWY2OTI3NzQgTG9jYXRpb25TZXJ2aWNlLkNvbm5lY3QgUmVhZEFuZFVwZGF0ZUJ1aWxkQnlVcmk6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwLzE6QnVpbGQvQnVpbGQvMTE4NTYiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiJkMmFlN2M1OS1lYjk5LTRhNGMtOGQxOS05N2EwZGY2ZDBhZDkiLCJzaWQiOiIwMWNhN2I4NC03YmZmLTRjYTMtOTM2Mi1iOWI4ODc5ZjFjN2QiLCJhYyI6Ilt7XCJTY29wZVwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcIlBlcm1pc3Npb25cIjozfSx7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9tYWluXCIsXCJQZXJtaXNzaW9uXCI6MX1dIiwiYWNzbCI6IjEwIiwib2lkY19leHRyYSI6IntcInJlZlwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcInNoYVwiOlwiZmEwZjEwYzk5OTgxNWMyZDA0YzJhMjk5NWFkOTA4YTFhMTgzNjMxYlwiLFwicmVwb3NpdG9yeVwiOlwicmFtcDQtcGNhcjQvcmFtcDQtcGNhcjRcIixcInJlcG9zaXRvcnlfb3duZXJcIjpcInJhbXA0LXBjYXI0XCIsXCJyZXBvc2l0b3J5X293bmVyX2lkXCI6XCI1NzE0ODcyNFwiLFwicnVuX2lkXCI6XCIxMjYwMDYzMTg4MFwiLFwicnVuX251bWJlclwiOlwiMTQyXCIsXCJydW5fYXR0ZW1wdFwiOlwiMVwiLFwicmVwb3NpdG9yeV92aXNpYmlsaXR5XCI6XCJwdWJsaWNcIixcInJlcG9zaXRvcnlfaWRcIjpcIjIxODM1NjA1N1wiLFwiYWN0b3JfaWRcIjpcIjc1ODUyNDVcIixcImFjdG9yXCI6XCJqYW1lcy1yYWVcIixcIndvcmtmbG93XCI6XCJCdWlsZCBkZW1vIHNpdGUgYW5kIGRlcGxveSB0byBHaXRIdWIgUGFnZXNcIixcImhlYWRfcmVmXCI6XCJcIixcImJhc2VfcmVmXCI6XCJcIixcImV2ZW50X25hbWVcIjpcInB1c2hcIixcInJlZl9wcm90ZWN0ZWRcIjpcImZhbHNlXCIsXCJyZWZfdHlwZVwiOlwidGFnXCIsXCJ3b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJ3b3JrZmxvd19zaGFcIjpcImZhMGYxMGM5OTk4MTVjMmQwNGMyYTI5OTVhZDkwOGExYTE4MzYzMWJcIixcImVudmlyb25tZW50XCI6XCJnaXRodWItcGFnZXNcIixcImVudmlyb25tZW50X25vZGVfaWRcIjpcIkVOX2t3RE9EUVBaV2M0ZUV4MlpcIixcImpvYl93b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJqb2Jfd29ya2Zsb3dfc2hhXCI6XCJmYTBmMTBjOTk5ODE1YzJkMDRjMmEyOTk1YWQ5MDhhMWExODM2MzFiXCIsXCJydW5uZXJfZW52aXJvbm1lbnRcIjpcImdpdGh1Yi1ob3N0ZWRcIn0iLCJvaWRjX3N1YiI6InJlcG86cmFtcDQtcGNhcjQvcmFtcDQtcGNhcjQ6ZW52aXJvbm1lbnQ6Z2l0aHViLXBhZ2VzIiwib3JjaGlkIjoiMTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhLmJ1aWxkLl9fZGVmYXVsdCIsImlzcyI6InZzdG9rZW4uYWN0aW9ucy5naXRodWJ1c2VyY29udGVudC5jb20iLCJhdWQiOiJ2c3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tfHZzbzpkYzhlN2U0ZC00ZDQ1LTQ4ZDAtYmY4YS02YmQ0YzZjMjQ2MDciLCJuYmYiOjE3MzU5MjA2NTEsImV4cCI6MTczNTk0MzQ1MX0.GDIMaHnR4BV7DsiZYljQVjH7maAY2oeT19GbL0fBsVgnLSFwh82jS97tSwainj2WAOKfT53NDCKgBCLyJEMNXgCLkesDDmaWKNr7E93N8EpiWWaeHC0gWfNng4854FKwe-2rSolRxMqjICH-MEL9daqiLdkvfT1Am5LvlA5gqUJfcXvG1ghyIplZrr_i8EovHetZNOIKC7V8TemKrUnogzxWmWjfE7jkyS6ER92v7Gb7pGnLtjNXoXrsuyXTaUDs6WJQEisuX3DyAlIMTGH35Y_GKb4TZzfcxQzGSIRH6wdbZPPrGnK0bt9mwM846IL1Bg6JmdG8McfmiAWr_xllxg",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_921a48f6-5b8e-4cc8-aff5-dc8fc3bbf3f7",INVOCATION_ID:"819722273f2741acab86958091275df4",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",npm_package_name:"ramp-pcar",GITHUB_ACTION:"__run_4",GITHUB_RUN_NUMBER:"142",GITHUB_TRIGGERING_ACTOR:"james-rae",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 6",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",GITHUB_REF_NAME:"v4.10.2",GITHUB_REPOSITORY:"ramp4-pcar4/ramp4-pcar4",STATS_D_D:"true",npm_lifecycle_script:"vite build --mode esDynamic",npm_config_loglevel:"silent",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"218356057",GITHUB_ACTIONS:"true",STATS_PIP:"false",npm_package_version:"4.10.2",npm_lifecycle_event:"build:esDynamic",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",ACCEPT_EULA:"Y",GITHUB_JOB:"build",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_RUN_ATTEMPT:"1",STATS_D_TC:"true",GITHUB_REF:"refs/tags/v4.10.2",GITHUB_ACTOR:"james-rae",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",npm_config_globalconfig:"/opt/hostedtoolcache/node/22.12.0/x64/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_970c9b9c-9c28-4e11-91fe-3899b82e4149",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",GITHUB_ACTOR_ID:"7585245",RUNNER_WORKSPACE:"/home/runner/work/ramp4-pcar4",npm_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"push",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",ACTIONS_ID_TOKEN_REQUEST_URL:"https://pipelinesghubeus2.actions.githubusercontent.com/CYYZq0bGEiBG5XjoYFUt7ZUW3UppKtccmRBdNq2vSmlX4E20ap/00000000-0000-0000-0000-000000000000/_apis/distributedtask/hubs/Actions/plans/122704e5-dd5b-4c7f-81c6-1c64ceb4d16a/jobs/ca395085-040a-526b-2ce8-bdc85f692774/idtoken?api-version=2.0",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_970c9b9c-9c28-4e11-91fe-3899b82e4149",npm_config_global_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.2.12479018",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",STATS_EXTP:"https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_970c9b9c-9c28-4e11-91fe-3899b82e4149",INIT_CWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",EDITOR:"vi",NODE_ENV:"production"};function Alt(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(aa$2().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(aa$2().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(aa$2().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}const Fl$2=[];Fl$2[0]={w:[0],i:[3,0],"[":[4],o:[7]},Fl$2[1]={w:[1],".":[2],"[":[4],o:[7]},Fl$2[2]={w:[2],i:[3,0],0:[3,0]},Fl$2[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Fl$2[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Fl$2[5]={"'":[4,0],o:8,l:[5,0]},Fl$2[6]={'"':[4,0],o:8,l:[6,0]};const Ilt=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Mlt(r){return Ilt.test(r)}function Nlt(r){const o=r.charCodeAt(0),s=r.charCodeAt(r.length-1);return o===s&&(o===34||o===39)?r.slice(1,-1):r}function Olt(r){if(r==null)return"o";switch(r.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return r;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Clt(r){const o=r.trim();return r.charAt(0)==="0"&&isNaN(parseInt(r))?!1:Mlt(o)?Nlt(o):"*"+o}function Rlt(r){const o=[];let s=-1,a=0,l=0,c,u,d,m,g,y,_;const E=[];E[0]=()=>{u===void 0?u=d:u+=d},E[1]=()=>{u!==void 0&&(o.push(u),u=void 0)},E[2]=()=>{E[0](),l++},E[3]=()=>{if(l>0)l--,a=4,E[0]();else{if(l=0,u===void 0||(u=Clt(u),u===!1))return!1;E[1]()}};function w(){const T=r[s+1];if(a===5&&T==="'"||a===6&&T==='"')return s++,d="\\"+T,E[0](),!0}for(;a!==null;)if(s++,c=r[s],!(c==="\\"&&w())){if(m=Olt(c),_=Fl$2[a],g=_[m]||_.l||8,g===8||(a=g[0],g[1]!==void 0&&(y=E[g[1]],y&&(d=c,y()===!1))))return;if(a===7)return o}}const cP$2=new Map;function klt(r,o){return ve$1(r)?r[o]:null}function Llt(r,o){if(!ve$1(r))return null;let s=cP$2.get(o);if(s||(s=Rlt(o),s&&cP$2.set(o,s)),!s)return null;const a=s.length;let l=r,c=0;for(;cr,Dlt=r=>"",Glt="text",Flt=r=>r.length===0?"":Yat(r),jlt=Xat;function uP$2(r,o){return r=Math.abs(r),o===2?r?r>1?1:0:1:r?Math.min(r,2):0}function Ult(r){const o=Nn$2(r.pluralIndex)?r.pluralIndex:-1;return r.named&&(Nn$2(r.named.count)||Nn$2(r.named.n))?Nn$2(r.named.count)?r.named.count:Nn$2(r.named.n)?r.named.n:o:o}function $lt(r,o){o.count||(o.count=r),o.n||(o.n=r)}function Blt(r={}){const o=r.locale,s=Ult(r),a=ve$1(r.pluralRules)&&xt$2(o)&&Xe(r.pluralRules[o])?r.pluralRules[o]:uP$2,l=ve$1(r.pluralRules)&&xt$2(o)&&Xe(r.pluralRules[o])?uP$2:void 0,c=O=>O[a(s,O.length,l)],u=r.list||[],d=O=>u[O],m=r.named||De$1();Nn$2(r.pluralIndex)&&$lt(s,m);const g=O=>m[O];function y(O){return(Xe(r.messages)?r.messages(O):ve$1(r.messages)?r.messages[O]:!1)||(r.parent?r.parent.message(O):Dlt)}const _=O=>r.modifiers?r.modifiers[O]:Plt,E=Xt$2(r.processor)&&Xe(r.processor.normalize)?r.processor.normalize:Flt,w=Xt$2(r.processor)&&Xe(r.processor.interpolate)?r.processor.interpolate:jlt,T=Xt$2(r.processor)&&xt$2(r.processor.type)?r.processor.type:Glt,k={list:d,named:g,plural:c,linked:(O,...R)=>{const[M,N]=R;let D="text",P="";R.length===1?ve$1(M)?(P=M.modifier||P,D=M.type||D):xt$2(M)&&(P=M||P):R.length===2&&(xt$2(M)&&(P=M||P),xt$2(N)&&(D=N||D));const I=y(O)(k),L=D==="vnode"&&Qe$1(I)&&P?I[0]:I;return P?_(P)(L,D):L},message:y,type:T,interpolate:w,normalize:E,values:ar$1(De$1(),u,m)};return k}let jm$2=null;function Vlt(r){jm$2=r}function zlt(r,o,s){jm$2&&jm$2.emit("i18n:init",{timestamp:Date.now(),i18n:r,version:o,meta:s})}const Hlt=Wlt("function:translate");function Wlt(r){return o=>jm$2&&jm$2.emit(r,o)}const hP$2=z3$1.__EXTEND_POINT__,du$2=Rv$2(hP$2),Xlt={NOT_FOUND_KEY:hP$2,FALLBACK_TO_TRANSLATE:du$2(),CANNOT_FORMAT_NUMBER:du$2(),FALLBACK_TO_NUMBER_FORMAT:du$2(),CANNOT_FORMAT_DATE:du$2(),FALLBACK_TO_DATE_FORMAT:du$2(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:du$2(),__EXTEND_POINT__:du$2()},pP$2=$t$2.__EXTEND_POINT__,fu$1=Rv$2(pP$2),Ns$2={INVALID_ARGUMENT:pP$2,INVALID_DATE_ARGUMENT:fu$1(),INVALID_ISO_DATE_ARGUMENT:fu$1(),NOT_SUPPORT_NON_STRING_MESSAGE:fu$1(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:fu$1(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:fu$1(),NOT_SUPPORT_LOCALE_TYPE:fu$1(),__EXTEND_POINT__:fu$1()};function co$2(r){return Mp$2(r,null,void 0)}function W3$1(r,o){return o.locale!=null?dP$2(o.locale):dP$2(r.locale)}let X3$1;function dP$2(r){if(xt$2(r))return r;if(Xe(r)){if(r.resolvedOnce&&X3$1!=null)return X3$1;if(r.constructor.name==="Function"){const o=r();if(Wat(o))throw co$2(Ns$2.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return X3$1=o}else throw co$2(Ns$2.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw co$2(Ns$2.NOT_SUPPORT_LOCALE_TYPE)}function Ylt(r,o,s){return[...new Set([s,...Qe$1(o)?o:ve$1(o)?Object.keys(o):xt$2(o)?[o]:[s]])]}function fP$2(r,o,s){const a=xt$2(s)?s:Cp$1,l=r;l.__localeChainCache||(l.__localeChainCache=new Map);let c=l.__localeChainCache.get(a);if(!c){c=[];let u=[s];for(;Qe$1(u);)u=mP$2(c,u,o);const d=Qe$1(o)||!Xt$2(o)?o:o.default?o.default:null;u=xt$2(d)?[d]:d,Qe$1(u)&&mP$2(c,u,!1),l.__localeChainCache.set(a,c)}return c}function mP$2(r,o,s){let a=!0;for(let l=0;l`${r.charAt(0).toLocaleUpperCase()}${r.substr(1)}`;function Qlt(){return{upper:(r,o)=>o==="text"&&xt$2(r)?r.toUpperCase():o==="vnode"&&ve$1(r)&&"__v_isVNode"in r?r.children.toUpperCase():r,lower:(r,o)=>o==="text"&&xt$2(r)?r.toLowerCase():o==="vnode"&&ve$1(r)&&"__v_isVNode"in r?r.children.toLowerCase():r,capitalize:(r,o)=>o==="text"&&xt$2(r)?gP$2(r):o==="vnode"&&ve$1(r)&&"__v_isVNode"in r?gP$2(r.children):r}}let vP$2;function bP$2(r){vP$2=r}let _P$2;function Klt(r){_P$2=r}let wP$2;function tct(r){wP$2=r}let EP$2=null;const TP$2=r=>{EP$2=r},nct=()=>EP$2;let SP$2=0;function rct(r={}){const o=Xe(r.onWarn)?r.onWarn:Jat,s=xt$2(r.version)?r.version:Zlt,a=xt$2(r.locale)||Xe(r.locale)?r.locale:Cp$1,l=Xe(a)?Cp$1:a,c=Qe$1(r.fallbackLocale)||Xt$2(r.fallbackLocale)||xt$2(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:l,u=Xt$2(r.messages)?r.messages:Y3$1(l),d=Xt$2(r.datetimeFormats)?r.datetimeFormats:Y3$1(l),m=Xt$2(r.numberFormats)?r.numberFormats:Y3$1(l),g=ar$1(De$1(),r.modifiers,Qlt()),y=r.pluralRules||De$1(),_=Xe(r.missing)?r.missing:null,E=se(r.missingWarn)||Dl$2(r.missingWarn)?r.missingWarn:!0,w=se(r.fallbackWarn)||Dl$2(r.fallbackWarn)?r.fallbackWarn:!0,T=!!r.fallbackFormat,k=!!r.unresolving,O=Xe(r.postTranslation)?r.postTranslation:null,R=Xt$2(r.processor)?r.processor:null,M=se(r.warnHtmlMessage)?r.warnHtmlMessage:!0,N=!!r.escapeParameter,D=Xe(r.messageCompiler)?r.messageCompiler:vP$2,P=Xe(r.messageResolver)?r.messageResolver:_P$2||klt,I=Xe(r.localeFallbacker)?r.localeFallbacker:wP$2||Ylt,L=ve$1(r.fallbackContext)?r.fallbackContext:void 0,F=r,U=ve$1(F.__datetimeFormatters)?F.__datetimeFormatters:new Map,J=ve$1(F.__numberFormatters)?F.__numberFormatters:new Map,z=ve$1(F.__meta)?F.__meta:{};SP$2++;const ie={version:s,cid:SP$2,locale:a,fallbackLocale:c,messages:u,modifiers:g,pluralRules:y,missing:_,missingWarn:E,fallbackWarn:w,fallbackFormat:T,unresolving:k,postTranslation:O,processor:R,warnHtmlMessage:M,escapeParameter:N,messageCompiler:D,messageResolver:P,localeFallbacker:I,fallbackContext:L,onWarn:o,__meta:z};return ie.datetimeFormats=d,ie.numberFormats=m,ie.__datetimeFormatters=U,ie.__numberFormatters=J,__INTLIFY_PROD_DEVTOOLS__&&zlt(ie,s,z),ie}const Y3$1=r=>({[r]:De$1()});function J3$1(r,o,s,a,l){const{missing:c,onWarn:u}=r;if(c!==null){const d=c(r,s,o,l);return xt$2(d)?d:o}else return o}function Um$2(r,o,s){const a=r;a.__localeChainCache=new Map,r.localeFallbacker(r,s,o)}function ict(r,o){return r===o?!1:r.split("-")[0]===o.split("-")[0]}function sct(r,o){const s=o.indexOf(r);if(s===-1)return!1;for(let a=s+1;aoct(o,r)}function oct(r,o){const s=lct(o);if(s==null)throw $m$2(0);if(Q3$1(s)===1){const a=uct(s);return r.plural(a.reduce((l,c)=>[...l,AP$2(r,c)],[]))}else return AP$2(r,s)}const act=["b","body"];function lct(r){return jl$2(r,act)}const cct=["c","cases"];function uct(r){return jl$2(r,cct,[])}function AP$2(r,o){const s=pct(o);if(s!=null)return r.type==="text"?s:r.normalize([s]);{const a=fct(o).reduce((l,c)=>[...l,Z3$1(r,c)],[]);return r.normalize(a)}}const hct=["s","static"];function pct(r){return jl$2(r,hct)}const dct=["i","items"];function fct(r){return jl$2(r,dct,[])}function Z3$1(r,o){const s=Q3$1(o);switch(s){case 3:return Gv$2(o,s);case 9:return Gv$2(o,s);case 4:{const a=o;if(Is$2(a,"k")&&a.k)return r.interpolate(r.named(a.k));if(Is$2(a,"key")&&a.key)return r.interpolate(r.named(a.key));throw $m$2(s)}case 5:{const a=o;if(Is$2(a,"i")&&Nn$2(a.i))return r.interpolate(r.list(a.i));if(Is$2(a,"index")&&Nn$2(a.index))return r.interpolate(r.list(a.index));throw $m$2(s)}case 6:{const a=o,l=vct(a),c=_ct(a);return r.linked(Z3$1(r,c),l?Z3$1(r,l):void 0,r.type)}case 7:return Gv$2(o,s);case 8:return Gv$2(o,s);default:throw new Error(`unhandled node on format message part: ${s}`)}}const mct=["t","type"];function Q3$1(r){return jl$2(r,mct)}const yct=["v","value"];function Gv$2(r,o){const s=jl$2(r,yct);if(s)return s;throw $m$2(o)}const gct=["m","modifier"];function vct(r){return jl$2(r,gct)}const bct=["k","key"];function _ct(r){const o=jl$2(r,bct);if(o)return o;throw $m$2(6)}function jl$2(r,o,s){for(let a=0;ar;let Rp$2=De$1();function kp$1(r){return ve$1(r)&&Q3$1(r)===0&&(Is$2(r,"b")||Is$2(r,"body"))}function MP$2(r,o={}){let s=!1;const a=o.onError||nlt$1;return o.onError=l=>{s=!0,a(l)},{...Tlt(r,o),detectError:s}}const wct=(r,o)=>{if(!xt$2(r))throw co$2(Ns$2.NOT_SUPPORT_NON_STRING_MESSAGE);{se(o.warnHtmlMessage)&&o.warnHtmlMessage;const s=(o.onCacheKey||IP$2)(r),a=Rp$2[s];if(a)return a;const{code:l,detectError:c}=MP$2(r,o),u=new Function(`return ${l}`)();return c?u:Rp$2[s]=u}};function xct(r,o){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&xt$2(r)){se(o.warnHtmlMessage)&&o.warnHtmlMessage;const s=(o.onCacheKey||IP$2)(r),a=Rp$2[s];if(a)return a;const{ast:l,detectError:c}=MP$2(r,{...o,location:Slt.NODE_ENV!=="production",jit:!0}),u=q3$1(l);return c?u:Rp$2[s]=u}else{const s=r.cacheKey;return s?Rp$2[s]||(Rp$2[s]=q3$1(r)):q3$1(r)}}const NP$2=()=>"",qi$2=r=>Xe(r);function OP$2(r,...o){const{fallbackFormat:s,postTranslation:a,unresolving:l,messageCompiler:c,fallbackLocale:u,messages:d}=r,[m,g]=K3$1(...o),y=se(g.missingWarn)?g.missingWarn:r.missingWarn,_=se(g.fallbackWarn)?g.fallbackWarn:r.fallbackWarn,E=se(g.escapeParameter)?g.escapeParameter:r.escapeParameter,w=!!g.resolvedMessage,T=xt$2(g.default)||se(g.default)?se(g.default)?c?m:()=>m:g.default:s?c?m:()=>m:"",k=s||T!=="",O=W3$1(r,g);E&&Ect(g);let[R,M,N]=w?[m,O,d[O]||De$1()]:CP$2(r,m,O,u,_,y),D=R,P=m;if(!w&&!(xt$2(D)||kp$1(D)||qi$2(D))&&k&&(D=T,P=D),!w&&(!(xt$2(D)||kp$1(D)||qi$2(D))||!xt$2(M)))return l?Dv$2:m;let I=!1;const L=()=>{I=!0},F=qi$2(D)?D:RP$2(r,m,M,D,P,L);if(I)return D;const U=Act(r,M,N,g),J=Blt(U),z=Tct(r,F,J),ie=a?a(z,m):z;if(__INTLIFY_PROD_DEVTOOLS__){const ce={timestamp:Date.now(),key:xt$2(m)?m:qi$2(D)?D.key:"",locale:M||(qi$2(D)?D.locale:""),format:xt$2(D)?D:qi$2(D)?D.source:"",message:ie};ce.meta=ar$1({},r.__meta,{}),Hlt(ce)}return ie}function Ect(r){Qe$1(r.list)?r.list=r.list.map(o=>xt$2(o)?K8$1(o):o):ve$1(r.named)&&Object.keys(r.named).forEach(o=>{xt$2(r.named[o])&&(r.named[o]=K8$1(r.named[o]))})}function CP$2(r,o,s,a,l,c){const{messages:u,onWarn:d,messageResolver:m,localeFallbacker:g}=r,y=g(r,a,s);let _=De$1(),E,w=null;const T="translate";for(let k=0;ka;return g.locale=s,g.key=o,g}const m=u(a,Sct(r,s,l,a,d,c));return m.locale=s,m.key=o,m.source=a,m}function Tct(r,o,s){return o(s)}function K3$1(...r){const[o,s,a]=r,l=De$1();if(!xt$2(o)&&!Nn$2(o)&&!qi$2(o)&&!kp$1(o))throw co$2(Ns$2.INVALID_ARGUMENT);const c=Nn$2(o)?String(o):o;return Nn$2(s)?l.plural=s:xt$2(s)?l.default=s:Xt$2(s)&&!Cv$2(s)?l.named=s:Qe$1(s)&&(l.list=s),Nn$2(a)?l.plural=a:xt$2(a)?l.default=a:Xt$2(a)&&ar$1(l,a),[c,l]}function Sct(r,o,s,a,l,c){return{locale:o,key:s,warnHtmlMessage:l,onError:u=>{throw c&&c(u),u},onCacheKey:u=>$at(o,s,u)}}function Act(r,o,s,a){const{modifiers:l,pluralRules:c,messageResolver:u,fallbackLocale:d,fallbackWarn:m,missingWarn:g,fallbackContext:y}=r,_={locale:o,modifiers:l,pluralRules:c,messages:E=>{let w=u(s,E);if(w==null&&y){const[,,T]=CP$2(y,E,o,d,m,g);w=u(T,E)}if(xt$2(w)||kp$1(w)){let T=!1;const k=RP$2(r,E,o,w,E,()=>{T=!0});return T?NP$2:k}else return qi$2(w)?w:NP$2}};return r.processor&&(_.processor=r.processor),a.list&&(_.list=a.list),a.named&&(_.named=a.named),Nn$2(a.plural)&&(_.pluralIndex=a.plural),_}function kP$2(r,...o){const{datetimeFormats:s,unresolving:a,fallbackLocale:l,onWarn:c,localeFallbacker:u}=r,{__datetimeFormatters:d}=r,[m,g,y,_]=tS$2(...o),E=se(y.missingWarn)?y.missingWarn:r.missingWarn;se(y.fallbackWarn)?y.fallbackWarn:r.fallbackWarn;const w=!!y.part,T=W3$1(r,y),k=u(r,l,T);if(!xt$2(m)||m==="")return new Intl.DateTimeFormat(T,_).format(g);let O={},R,M=null;const N="datetime format";for(let I=0;I{LP$2.includes(m)?u[m]=s[m]:c[m]=s[m]}),xt$2(a)?c.locale=a:Xt$2(a)&&(u=a),Xt$2(l)&&(u=l),[c.key||"",d,c,u]}function PP$2(r,o,s){const a=r;for(const l in s){const c=`${o}__${l}`;a.__datetimeFormatters.has(c)&&a.__datetimeFormatters.delete(c)}}function DP$2(r,...o){const{numberFormats:s,unresolving:a,fallbackLocale:l,onWarn:c,localeFallbacker:u}=r,{__numberFormatters:d}=r,[m,g,y,_]=eS$2(...o),E=se(y.missingWarn)?y.missingWarn:r.missingWarn;se(y.fallbackWarn)?y.fallbackWarn:r.fallbackWarn;const w=!!y.part,T=W3$1(r,y),k=u(r,l,T);if(!xt$2(m)||m==="")return new Intl.NumberFormat(T,_).format(g);let O={},R,M=null;const N="number format";for(let I=0;I{GP$2.includes(m)?u[m]=s[m]:c[m]=s[m]}),xt$2(a)?c.locale=a:Xt$2(a)&&(u=a),Xt$2(l)&&(u=l),[c.key||"",d,c,u]}function FP$2(r,o,s){const a=r;for(const l in s){const c=`${o}__${l}`;a.__numberFormatters.has(c)&&a.__numberFormatters.delete(c)}}Alt();var Ict={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_970c9b9c-9c28-4e11-91fe-3899b82e4149",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"",npm_config_user_agent:"npm/10.9.0 node/v22.12.0 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_970c9b9c-9c28-4e11-91fe-3899b82e4149",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",OLDPWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"ramp4-pcar4",npm_package_engines_node:"=22.12.0",GRADLE_HOME:"/usr/share/gradle-8.11.1",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"57148724",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_local_prefix:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",SYSTEMD_EXEC_PID:"834",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20241215.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.10/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.4/x64",JOURNAL_STREAM:"8:6781",GITHUB_WORKFLOW:"Build demo site and deploy to GitHub Pages",_:"/opt/hostedtoolcache/node/22.12.0/x64/bin/npm",npm_config_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",npm_config_npm_version:"10.9.0",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/runner-provisioner.service/memory.pressure",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"12600631880",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"tag",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_BASE_REF:"",ImageOS:"ubuntu24",GITHUB_WORKFLOW_REF:"ramp4-pcar4/ramp4-pcar4/.github/workflows/demo-build.yml@refs/tags/v4.10.2",ACTIONS_ID_TOKEN_REQUEST_TOKEN:"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ikh5cTROQVRBanNucUM3bWRydEFoaHJDUjJfUSJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zLkdlbmVyaWNSZWFkOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCBBY3Rpb25zLlJlc3VsdHM6MTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCBBY3Rpb25zLlVwbG9hZEFydGlmYWN0czowMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAvMTpCdWlsZC9CdWlsZC8xMTg1NiBEaXN0cmlidXRlZFRhc2suR2VuZXJhdGVJZFRva2VuOjEyMjcwNGU1LWRkNWItNGM3Zi04MWM2LTFjNjRjZWI0ZDE2YTpjYTM5NTA4NS0wNDBhLTUyNmItMmNlOC1iZGM4NWY2OTI3NzQgTG9jYXRpb25TZXJ2aWNlLkNvbm5lY3QgUmVhZEFuZFVwZGF0ZUJ1aWxkQnlVcmk6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwLzE6QnVpbGQvQnVpbGQvMTE4NTYiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiJkMmFlN2M1OS1lYjk5LTRhNGMtOGQxOS05N2EwZGY2ZDBhZDkiLCJzaWQiOiIwMWNhN2I4NC03YmZmLTRjYTMtOTM2Mi1iOWI4ODc5ZjFjN2QiLCJhYyI6Ilt7XCJTY29wZVwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcIlBlcm1pc3Npb25cIjozfSx7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9tYWluXCIsXCJQZXJtaXNzaW9uXCI6MX1dIiwiYWNzbCI6IjEwIiwib2lkY19leHRyYSI6IntcInJlZlwiOlwicmVmcy90YWdzL3Y0LjEwLjJcIixcInNoYVwiOlwiZmEwZjEwYzk5OTgxNWMyZDA0YzJhMjk5NWFkOTA4YTFhMTgzNjMxYlwiLFwicmVwb3NpdG9yeVwiOlwicmFtcDQtcGNhcjQvcmFtcDQtcGNhcjRcIixcInJlcG9zaXRvcnlfb3duZXJcIjpcInJhbXA0LXBjYXI0XCIsXCJyZXBvc2l0b3J5X293bmVyX2lkXCI6XCI1NzE0ODcyNFwiLFwicnVuX2lkXCI6XCIxMjYwMDYzMTg4MFwiLFwicnVuX251bWJlclwiOlwiMTQyXCIsXCJydW5fYXR0ZW1wdFwiOlwiMVwiLFwicmVwb3NpdG9yeV92aXNpYmlsaXR5XCI6XCJwdWJsaWNcIixcInJlcG9zaXRvcnlfaWRcIjpcIjIxODM1NjA1N1wiLFwiYWN0b3JfaWRcIjpcIjc1ODUyNDVcIixcImFjdG9yXCI6XCJqYW1lcy1yYWVcIixcIndvcmtmbG93XCI6XCJCdWlsZCBkZW1vIHNpdGUgYW5kIGRlcGxveSB0byBHaXRIdWIgUGFnZXNcIixcImhlYWRfcmVmXCI6XCJcIixcImJhc2VfcmVmXCI6XCJcIixcImV2ZW50X25hbWVcIjpcInB1c2hcIixcInJlZl9wcm90ZWN0ZWRcIjpcImZhbHNlXCIsXCJyZWZfdHlwZVwiOlwidGFnXCIsXCJ3b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJ3b3JrZmxvd19zaGFcIjpcImZhMGYxMGM5OTk4MTVjMmQwNGMyYTI5OTVhZDkwOGExYTE4MzYzMWJcIixcImVudmlyb25tZW50XCI6XCJnaXRodWItcGFnZXNcIixcImVudmlyb25tZW50X25vZGVfaWRcIjpcIkVOX2t3RE9EUVBaV2M0ZUV4MlpcIixcImpvYl93b3JrZmxvd19yZWZcIjpcInJhbXA0LXBjYXI0L3JhbXA0LXBjYXI0Ly5naXRodWIvd29ya2Zsb3dzL2RlbW8tYnVpbGQueW1sQHJlZnMvdGFncy92NC4xMC4yXCIsXCJqb2Jfd29ya2Zsb3dfc2hhXCI6XCJmYTBmMTBjOTk5ODE1YzJkMDRjMmEyOTk1YWQ5MDhhMWExODM2MzFiXCIsXCJydW5uZXJfZW52aXJvbm1lbnRcIjpcImdpdGh1Yi1ob3N0ZWRcIn0iLCJvaWRjX3N1YiI6InJlcG86cmFtcDQtcGNhcjQvcmFtcDQtcGNhcjQ6ZW52aXJvbm1lbnQ6Z2l0aHViLXBhZ2VzIiwib3JjaGlkIjoiMTIyNzA0ZTUtZGQ1Yi00YzdmLTgxYzYtMWM2NGNlYjRkMTZhLmJ1aWxkLl9fZGVmYXVsdCIsImlzcyI6InZzdG9rZW4uYWN0aW9ucy5naXRodWJ1c2VyY29udGVudC5jb20iLCJhdWQiOiJ2c3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tfHZzbzpkYzhlN2U0ZC00ZDQ1LTQ4ZDAtYmY4YS02YmQ0YzZjMjQ2MDciLCJuYmYiOjE3MzU5MjA2NTEsImV4cCI6MTczNTk0MzQ1MX0.GDIMaHnR4BV7DsiZYljQVjH7maAY2oeT19GbL0fBsVgnLSFwh82jS97tSwainj2WAOKfT53NDCKgBCLyJEMNXgCLkesDDmaWKNr7E93N8EpiWWaeHC0gWfNng4854FKwe-2rSolRxMqjICH-MEL9daqiLdkvfT1Am5LvlA5gqUJfcXvG1ghyIplZrr_i8EovHetZNOIKC7V8TemKrUnogzxWmWjfE7jkyS6ER92v7Gb7pGnLtjNXoXrsuyXTaUDs6WJQEisuX3DyAlIMTGH35Y_GKb4TZzfcxQzGSIRH6wdbZPPrGnK0bt9mwM846IL1Bg6JmdG8McfmiAWr_xllxg",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp/node_modules/.bin:/home/runner/work/ramp4-pcar4/ramp4-pcar4/node_modules/.bin:/home/runner/work/ramp4-pcar4/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_921a48f6-5b8e-4cc8-aff5-dc8fc3bbf3f7",INVOCATION_ID:"819722273f2741acab86958091275df4",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/opt/hostedtoolcache/node/22.12.0/x64/bin/node",npm_package_name:"ramp-pcar",GITHUB_ACTION:"__run_4",GITHUB_RUN_NUMBER:"142",GITHUB_TRIGGERING_ACTOR:"james-rae",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 6",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",GITHUB_REF_NAME:"v4.10.2",GITHUB_REPOSITORY:"ramp4-pcar4/ramp4-pcar4",STATS_D_D:"true",npm_lifecycle_script:"vite build --mode esDynamic",npm_config_loglevel:"silent",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"218356057",GITHUB_ACTIONS:"true",STATS_PIP:"false",npm_package_version:"4.10.2",npm_lifecycle_event:"build:esDynamic",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/ramp4-pcar4/ramp4-pcar4",ACCEPT_EULA:"Y",GITHUB_JOB:"build",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"fa0f10c999815c2d04c2a2995ad908a1a183631b",GITHUB_RUN_ATTEMPT:"1",STATS_D_TC:"true",GITHUB_REF:"refs/tags/v4.10.2",GITHUB_ACTOR:"james-rae",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",npm_config_globalconfig:"/opt/hostedtoolcache/node/22.12.0/x64/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_970c9b9c-9c28-4e11-91fe-3899b82e4149",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",GITHUB_ACTOR_ID:"7585245",RUNNER_WORKSPACE:"/home/runner/work/ramp4-pcar4",npm_execpath:"/opt/hostedtoolcache/node/22.12.0/x64/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"push",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",ACTIONS_ID_TOKEN_REQUEST_URL:"https://pipelinesghubeus2.actions.githubusercontent.com/CYYZq0bGEiBG5XjoYFUt7ZUW3UppKtccmRBdNq2vSmlX4E20ap/00000000-0000-0000-0000-000000000000/_apis/distributedtask/hubs/Actions/plans/122704e5-dd5b-4c7f-81c6-1c64ceb4d16a/jobs/ca395085-040a-526b-2ce8-bdc85f692774/idtoken?api-version=2.0",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_970c9b9c-9c28-4e11-91fe-3899b82e4149",npm_config_global_prefix:"/opt/hostedtoolcache/node/22.12.0/x64",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.2.12479018",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",STATS_EXTP:"https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_970c9b9c-9c28-4e11-91fe-3899b82e4149",INIT_CWD:"/home/runner/work/ramp4-pcar4/ramp4-pcar4/ramp",EDITOR:"vi",NODE_ENV:"production"};const Mct="9.14.2";function Nct(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(aa$2().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(aa$2().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(aa$2().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(aa$2().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(aa$2().__INTLIFY_PROD_DEVTOOLS__=!1)}const Oct=Xlt.__EXTEND_POINT__,ca$2=Rv$2(Oct);ca$2(),ca$2(),ca$2(),ca$2(),ca$2(),ca$2(),ca$2(),ca$2(),ca$2();const jP$2=Ns$2.__EXTEND_POINT__,ri$1=Rv$2(jP$2),Xn$2={UNEXPECTED_RETURN_TYPE:jP$2,INVALID_ARGUMENT:ri$1(),MUST_BE_CALL_SETUP_TOP:ri$1(),NOT_INSTALLED:ri$1(),NOT_AVAILABLE_IN_LEGACY_MODE:ri$1(),REQUIRED_VALUE:ri$1(),INVALID_VALUE:ri$1(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:ri$1(),NOT_INSTALLED_WITH_PROVIDE:ri$1(),UNEXPECTED_ERROR:ri$1(),NOT_COMPATIBLE_LEGACY_VUE_I18N:ri$1(),BRIDGE_SUPPORT_VUE_2_ONLY:ri$1(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:ri$1(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:ri$1(),__EXTEND_POINT__:ri$1()};function Qn$2(r,...o){return Mp$2(r,null,void 0)}const nS$2=Pl$1("__translateVNode"),rS$2=Pl$1("__datetimeParts"),iS$2=Pl$1("__numberParts"),UP$2=Pl$1("__setPluralRules"),$P$2=Pl$1("__injectWithOption"),sS$2=Pl$1("__dispose");function Bm$2(r){if(!ve$1(r))return r;for(const o in r)if(Is$2(r,o))if(!o.includes("."))ve$1(r[o])&&Bm$2(r[o]);else{const s=o.split("."),a=s.length-1;let l=r,c=!1;for(let u=0;u{if("locale"in d&&"resource"in d){const{locale:m,resource:g}=d;m?(u[m]=u[m]||De$1(),Lv$2(g,u[m])):Lv$2(g,u)}else xt$2(d)&&Lv$2(JSON.parse(d),u)}),l==null&&c)for(const d in u)Is$2(u,d)&&Bm$2(u[d]);return u}function BP$2(r){return r.type}function VP$2(r,o,s){let a=ve$1(o.messages)?o.messages:De$1();"__i18nGlobal"in s&&(a=Fv$2(r.locale.value,{messages:a,__i18n:s.__i18nGlobal}));const l=Object.keys(a);l.length&&l.forEach(c=>{r.mergeLocaleMessage(c,a[c])});{if(ve$1(o.datetimeFormats)){const c=Object.keys(o.datetimeFormats);c.length&&c.forEach(u=>{r.mergeDateTimeFormat(u,o.datetimeFormats[u])})}if(ve$1(o.numberFormats)){const c=Object.keys(o.numberFormats);c.length&&c.forEach(u=>{r.mergeNumberFormat(u,o.numberFormats[u])})}}}function zP$2(r){return Zt$2(lo$2,null,r,0)}const WP$2=()=>[],Cct=()=>!1;let XP$2=0;function YP$2(r){return(o,s,a,l)=>r(s,a,In$2()||void 0,l)}function oS$3(r={},o){const{__root:s,__injectWithOption:a}=r,l=s===void 0,c=r.flatJson,u=Ov$2?tt$3:up$2,d=!!r.translateExistCompatible;let m=se(r.inheritLocale)?r.inheritLocale:!0;const g=u(s&&m?s.locale.value:xt$2(r.locale)?r.locale:Cp$1),y=u(s&&m?s.fallbackLocale.value:xt$2(r.fallbackLocale)||Qe$1(r.fallbackLocale)||Xt$2(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:g.value),_=u(Fv$2(g.value,r)),E=u(Xt$2(r.datetimeFormats)?r.datetimeFormats:{[g.value]:{}}),w=u(Xt$2(r.numberFormats)?r.numberFormats:{[g.value]:{}});let T=s?s.missingWarn:se(r.missingWarn)||Dl$2(r.missingWarn)?r.missingWarn:!0,k=s?s.fallbackWarn:se(r.fallbackWarn)||Dl$2(r.fallbackWarn)?r.fallbackWarn:!0,O=s?s.fallbackRoot:se(r.fallbackRoot)?r.fallbackRoot:!0,R=!!r.fallbackFormat,M=Xe(r.missing)?r.missing:null,N=Xe(r.missing)?YP$2(r.missing):null,D=Xe(r.postTranslation)?r.postTranslation:null,P=s?s.warnHtmlMessage:se(r.warnHtmlMessage)?r.warnHtmlMessage:!0,I=!!r.escapeParameter;const L=s?s.modifiers:Xt$2(r.modifiers)?r.modifiers:{};let F=r.pluralRules||s&&s.pluralRules,U;U=(()=>{l&&TP$2(null);const kee={version:Mct,locale:g.value,fallbackLocale:y.value,messages:_.value,modifiers:L,pluralRules:F,missing:N===null?void 0:N,missingWarn:T,fallbackWarn:k,fallbackFormat:R,unresolving:!0,postTranslation:D===null?void 0:D,warnHtmlMessage:P,escapeParameter:I,messageResolver:r.messageResolver,messageCompiler:r.messageCompiler,__meta:{framework:"vue"}};kee.datetimeFormats=E.value,kee.numberFormats=w.value,kee.__datetimeFormatters=Xt$2(U)?U.__datetimeFormatters:void 0,kee.__numberFormatters=Xt$2(U)?U.__numberFormatters:void 0;const Dte=rct(kee);return l&&TP$2(Dte),Dte})(),Um$2(U,g.value,y.value);function J(){return[g.value,y.value,_.value,E.value,w.value]}const z=te({get:()=>g.value,set:kee=>{g.value=kee,U.locale=g.value}}),ie=te({get:()=>y.value,set:kee=>{y.value=kee,U.fallbackLocale=y.value,Um$2(U,g.value,kee)}}),ce=te(()=>_.value),Y=te(()=>E.value),B=te(()=>w.value);function V(){return Xe(D)?D:null}function Ge(kee){D=kee,U.postTranslation=kee}function St(){return M}function Dee(kee){kee!==null&&(N=YP$2(kee)),M=kee,U.missing=N}const pee=(kee,Dte,Ite,Lte,Vte,Pte)=>{J();let Fte;try{Ict.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,l||(U.fallbackContext=s?nct():void 0),Fte=kee(U)}finally{__INTLIFY_PROD_DEVTOOLS__,l||(U.fallbackContext=void 0)}if(Ite!=="translate exists"&&Nn$2(Fte)&&Fte===Dv$2||Ite==="translate exists"&&!Fte){const[Ute,Gte]=Dte();return s&&O?Lte(s):Vte(Ute)}else{if(Pte(Fte))return Fte;throw Qn$2(Xn$2.UNEXPECTED_RETURN_TYPE)}};function jr(...kee){return pee(Dte=>Reflect.apply(OP$2,null,[Dte,...kee]),()=>K3$1(...kee),"translate",Dte=>Reflect.apply(Dte.t,Dte,[...kee]),Dte=>Dte,Dte=>xt$2(Dte))}function Tee(...kee){const[Dte,Ite,Lte]=kee;if(Lte&&!ve$1(Lte))throw Qn$2(Xn$2.INVALID_ARGUMENT);return jr(Dte,Ite,ar$1({resolvedMessage:!0},Lte||{}))}function et(...kee){return pee(Dte=>Reflect.apply(kP$2,null,[Dte,...kee]),()=>tS$2(...kee),"datetime format",Dte=>Reflect.apply(Dte.d,Dte,[...kee]),()=>yP$2,Dte=>xt$2(Dte))}function ft(...kee){return pee(Dte=>Reflect.apply(DP$2,null,[Dte,...kee]),()=>eS$2(...kee),"number format",Dte=>Reflect.apply(Dte.n,Dte,[...kee]),()=>yP$2,Dte=>xt$2(Dte))}function yee(kee){return kee.map(Dte=>xt$2(Dte)||Nn$2(Dte)||se(Dte)?zP$2(String(Dte)):Dte)}const ete={normalize:yee,interpolate:kee=>kee,type:"vnode"};function xte(...kee){return pee(Dte=>{let Ite;const Lte=Dte;try{Lte.processor=ete,Ite=Reflect.apply(OP$2,null,[Lte,...kee])}finally{Lte.processor=null}return Ite},()=>K3$1(...kee),"translate",Dte=>Dte[nS$2](...kee),Dte=>[zP$2(Dte)],Dte=>Qe$1(Dte))}function Ote(...kee){return pee(Dte=>Reflect.apply(DP$2,null,[Dte,...kee]),()=>eS$2(...kee),"number format",Dte=>Dte[iS$2](...kee),WP$2,Dte=>xt$2(Dte)||Qe$1(Dte))}function nee(...kee){return pee(Dte=>Reflect.apply(kP$2,null,[Dte,...kee]),()=>tS$2(...kee),"datetime format",Dte=>Dte[rS$2](...kee),WP$2,Dte=>xt$2(Dte)||Qe$1(Dte))}function Wee(kee){F=kee,U.pluralRules=F}function Bee(kee,Dte){return pee(()=>{if(!kee)return!1;const Ite=xt$2(Dte)?Dte:g.value,Lte=st(Ite),Vte=U.messageResolver(Lte,kee);return d?Vte!=null:kp$1(Vte)||qi$2(Vte)||xt$2(Vte)},()=>[kee],"translate exists",Ite=>Reflect.apply(Ite.te,Ite,[kee,Dte]),Cct,Ite=>se(Ite))}function Nte(kee){let Dte=null;const Ite=fP$2(U,y.value,g.value);for(let Lte=0;Lte{m&&(g.value=kee,U.locale=kee,Um$2(U,g.value,y.value))}),Hn$2(s.fallbackLocale,kee=>{m&&(y.value=kee,U.fallbackLocale=kee,Um$2(U,g.value,y.value))}));const xee={id:XP$2,locale:z,fallbackLocale:ie,get inheritLocale(){return m},set inheritLocale(kee){m=kee,kee&&s&&(g.value=s.locale.value,y.value=s.fallbackLocale.value,Um$2(U,g.value,y.value))},get availableLocales(){return Object.keys(_.value).sort()},messages:ce,get modifiers(){return L},get pluralRules(){return F||{}},get isGlobal(){return l},get missingWarn(){return T},set missingWarn(kee){T=kee,U.missingWarn=T},get fallbackWarn(){return k},set fallbackWarn(kee){k=kee,U.fallbackWarn=k},get fallbackRoot(){return O},set fallbackRoot(kee){O=kee},get fallbackFormat(){return R},set fallbackFormat(kee){R=kee,U.fallbackFormat=R},get warnHtmlMessage(){return P},set warnHtmlMessage(kee){P=kee,U.warnHtmlMessage=kee},get escapeParameter(){return I},set escapeParameter(kee){I=kee,U.escapeParameter=kee},t:jr,getLocaleMessage:st,setLocaleMessage:Lee,mergeLocaleMessage:$te,getPostTranslationHandler:V,setPostTranslationHandler:Ge,getMissingHandler:St,setMissingHandler:Dee,[UP$2]:Wee};return xee.datetimeFormats=Y,xee.numberFormats=B,xee.rt=Tee,xee.te=Bee,xee.tm=_ee,xee.d=et,xee.n=ft,xee.getDateTimeFormat=Kee,xee.setDateTimeFormat=Iee,xee.mergeDateTimeFormat=Rte,xee.getNumberFormat=dee,xee.setNumberFormat=fee,xee.mergeNumberFormat=Oee,xee[$P$2]=a,xee[nS$2]=xte,xee[rS$2]=nee,xee[iS$2]=Ote,xee}function Rct(r){const o=xt$2(r.locale)?r.locale:Cp$1,s=xt$2(r.fallbackLocale)||Qe$1(r.fallbackLocale)||Xt$2(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:o,a=Xe(r.missing)?r.missing:void 0,l=se(r.silentTranslationWarn)||Dl$2(r.silentTranslationWarn)?!r.silentTranslationWarn:!0,c=se(r.silentFallbackWarn)||Dl$2(r.silentFallbackWarn)?!r.silentFallbackWarn:!0,u=se(r.fallbackRoot)?r.fallbackRoot:!0,d=!!r.formatFallbackMessages,m=Xt$2(r.modifiers)?r.modifiers:{},g=r.pluralizationRules,y=Xe(r.postTranslation)?r.postTranslation:void 0,_=xt$2(r.warnHtmlInMessage)?r.warnHtmlInMessage!=="off":!0,E=!!r.escapeParameterHtml,w=se(r.sync)?r.sync:!0;let T=r.messages;if(Xt$2(r.sharedMessages)){const I=r.sharedMessages;T=Object.keys(I).reduce((L,F)=>{const U=L[F]||(L[F]={});return ar$1(U,I[F]),L},T||{})}const{__i18n:k,__root:O,__injectWithOption:R}=r,M=r.datetimeFormats,N=r.numberFormats,D=r.flatJson,P=r.translateExistCompatible;return{locale:o,fallbackLocale:s,messages:T,flatJson:D,datetimeFormats:M,numberFormats:N,missing:a,missingWarn:l,fallbackWarn:c,fallbackRoot:u,fallbackFormat:d,modifiers:m,pluralRules:g,postTranslation:y,warnHtmlMessage:_,escapeParameter:E,messageResolver:r.messageResolver,inheritLocale:w,translateExistCompatible:P,__i18n:k,__root:O,__injectWithOption:R}}function aS$2(r={},o){{const s=oS$3(Rct(r)),{__extender:a}=r,l={id:s.id,get locale(){return s.locale.value},set locale(c){s.locale.value=c},get fallbackLocale(){return s.fallbackLocale.value},set fallbackLocale(c){s.fallbackLocale.value=c},get messages(){return s.messages.value},get datetimeFormats(){return s.datetimeFormats.value},get numberFormats(){return s.numberFormats.value},get availableLocales(){return s.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(c){},get missing(){return s.getMissingHandler()},set missing(c){s.setMissingHandler(c)},get silentTranslationWarn(){return se(s.missingWarn)?!s.missingWarn:s.missingWarn},set silentTranslationWarn(c){s.missingWarn=se(c)?!c:c},get silentFallbackWarn(){return se(s.fallbackWarn)?!s.fallbackWarn:s.fallbackWarn},set silentFallbackWarn(c){s.fallbackWarn=se(c)?!c:c},get modifiers(){return s.modifiers},get formatFallbackMessages(){return s.fallbackFormat},set formatFallbackMessages(c){s.fallbackFormat=c},get postTranslation(){return s.getPostTranslationHandler()},set postTranslation(c){s.setPostTranslationHandler(c)},get sync(){return s.inheritLocale},set sync(c){s.inheritLocale=c},get warnHtmlInMessage(){return s.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(c){s.warnHtmlMessage=c!=="off"},get escapeParameterHtml(){return s.escapeParameter},set escapeParameterHtml(c){s.escapeParameter=c},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(c){},get pluralizationRules(){return s.pluralRules||{}},__composer:s,t(...c){const[u,d,m]=c,g={};let y=null,_=null;if(!xt$2(u))throw Qn$2(Xn$2.INVALID_ARGUMENT);const E=u;return xt$2(d)?g.locale=d:Qe$1(d)?y=d:Xt$2(d)&&(_=d),Qe$1(m)?y=m:Xt$2(m)&&(_=m),Reflect.apply(s.t,s,[E,y||_||{},g])},rt(...c){return Reflect.apply(s.rt,s,[...c])},tc(...c){const[u,d,m]=c,g={plural:1};let y=null,_=null;if(!xt$2(u))throw Qn$2(Xn$2.INVALID_ARGUMENT);const E=u;return xt$2(d)?g.locale=d:Nn$2(d)?g.plural=d:Qe$1(d)?y=d:Xt$2(d)&&(_=d),xt$2(m)?g.locale=m:Qe$1(m)?y=m:Xt$2(m)&&(_=m),Reflect.apply(s.t,s,[E,y||_||{},g])},te(c,u){return s.te(c,u)},tm(c){return s.tm(c)},getLocaleMessage(c){return s.getLocaleMessage(c)},setLocaleMessage(c,u){s.setLocaleMessage(c,u)},mergeLocaleMessage(c,u){s.mergeLocaleMessage(c,u)},d(...c){return Reflect.apply(s.d,s,[...c])},getDateTimeFormat(c){return s.getDateTimeFormat(c)},setDateTimeFormat(c,u){s.setDateTimeFormat(c,u)},mergeDateTimeFormat(c,u){s.mergeDateTimeFormat(c,u)},n(...c){return Reflect.apply(s.n,s,[...c])},getNumberFormat(c){return s.getNumberFormat(c)},setNumberFormat(c,u){s.setNumberFormat(c,u)},mergeNumberFormat(c,u){s.mergeNumberFormat(c,u)},getChoiceIndex(c,u){return-1}};return l.__extender=a,l}}const lS$2={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:r=>r==="parent"||r==="global",default:"parent"},i18n:{type:Object}};function kct({slots:r},o){return o.length===1&&o[0]==="default"?(r.default?r.default():[]).reduce((s,a)=>[...s,...a.type===ke$1?a.children:[a]],[]):o.reduce((s,a)=>{const l=r[a];return l&&(s[a]=l()),s},De$1())}function JP$2(r){return ke$1}const Lct=ne$1({name:"i18n-t",props:ar$1({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:r=>Nn$2(r)||!isNaN(r)}},lS$2),setup(r,o){const{slots:s,attrs:a}=o,l=r.i18n||Ke$1({useScope:r.scope,__useComponent:!0});return()=>{const c=Object.keys(s).filter(_=>_!=="_"),u=De$1();r.locale&&(u.locale=r.locale),r.plural!==void 0&&(u.plural=xt$2(r.plural)?+r.plural:r.plural);const d=kct(o,c),m=l[nS$2](r.keypath,d,u),g=ar$1(De$1(),a),y=xt$2(r.tag)||ve$1(r.tag)?r.tag:JP$2();return vi$1(y,g,m)}}}),qP$2=Lct;function Pct(r){return Qe$1(r)&&!xt$2(r[0])}function ZP$2(r,o,s,a){const{slots:l,attrs:c}=o;return()=>{const u={part:!0};let d=De$1();r.locale&&(u.locale=r.locale),xt$2(r.format)?u.key=r.format:ve$1(r.format)&&(xt$2(r.format.key)&&(u.key=r.format.key),d=Object.keys(r.format).reduce((E,w)=>s.includes(w)?ar$1(De$1(),E,{[w]:r.format[w]}):E,De$1()));const m=a(r.value,u,d);let g=[u.key];Qe$1(m)?g=m.map((E,w)=>{const T=l[E.type],k=T?T({[E.type]:E.value,index:w,parts:m}):[E.value];return Pct(k)&&(k[0].key=`${E.type}-${w}`),k}):xt$2(m)&&(g=[m]);const y=ar$1(De$1(),c),_=xt$2(r.tag)||ve$1(r.tag)?r.tag:JP$2();return vi$1(_,y,g)}}const Dct=ne$1({name:"i18n-n",props:ar$1({value:{type:Number,required:!0},format:{type:[String,Object]}},lS$2),setup(r,o){const s=r.i18n||Ke$1({useScope:r.scope,__useComponent:!0});return ZP$2(r,o,GP$2,(...a)=>s[iS$2](...a))}}),QP$2=Dct,Gct=ne$1({name:"i18n-d",props:ar$1({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},lS$2),setup(r,o){const s=r.i18n||Ke$1({useScope:r.scope,__useComponent:!0});return ZP$2(r,o,LP$2,(...a)=>s[rS$2](...a))}}),KP$2=Gct;function Fct(r,o){const s=r;if(r.mode==="composition")return s.__getInstance(o)||r.global;{const a=s.__getInstance(o);return a!=null?a.__composer:r.global.__composer}}function jct(r){const o=s=>{const{instance:a,modifiers:l,value:c}=s;if(!a||!a.$)throw Qn$2(Xn$2.UNEXPECTED_ERROR);const u=Fct(r,a.$),d=tD$2(c);return[Reflect.apply(u.t,u,[...eD$2(d)]),u]};return{created:(s,a)=>{const[l,c]=o(a);Ov$2&&r.global===c&&(s.__i18nWatcher=Hn$2(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),s.__composer=c,s.textContent=l},unmounted:s=>{Ov$2&&s.__i18nWatcher&&(s.__i18nWatcher(),s.__i18nWatcher=void 0,delete s.__i18nWatcher),s.__composer&&(s.__composer=void 0,delete s.__composer)},beforeUpdate:(s,{value:a})=>{if(s.__composer){const l=s.__composer,c=tD$2(a);s.textContent=Reflect.apply(l.t,l,[...eD$2(c)])}},getSSRProps:s=>{const[a]=o(s);return{textContent:a}}}}function tD$2(r){if(xt$2(r))return{path:r};if(Xt$2(r)){if(!("path"in r))throw Qn$2(Xn$2.REQUIRED_VALUE,"path");return r}else throw Qn$2(Xn$2.INVALID_VALUE)}function eD$2(r){const{path:o,locale:s,args:a,choice:l,plural:c}=r,u={},d=a||{};return xt$2(s)&&(u.locale=s),Nn$2(l)&&(u.plural=l),Nn$2(c)&&(u.plural=c),[o,d,u]}function Uct(r,o,...s){const a=Xt$2(s[0])?s[0]:{},l=!!a.useI18nComponentName;(!se(a.globalInstall)||a.globalInstall)&&([l?"i18n":qP$2.name,"I18nT"].forEach(c=>r.component(c,qP$2)),[QP$2.name,"I18nN"].forEach(c=>r.component(c,QP$2)),[KP$2.name,"I18nD"].forEach(c=>r.component(c,KP$2))),r.directive("t",jct(o))}function $ct(r,o,s){return{beforeCreate(){const a=In$2();if(!a)throw Qn$2(Xn$2.UNEXPECTED_ERROR);const l=this.$options;if(l.i18n){const c=l.i18n;if(l.__i18n&&(c.__i18n=l.__i18n),c.__root=o,this===this.$root)this.$i18n=nD$2(r,c);else{c.__injectWithOption=!0,c.__extender=s.__vueI18nExtend,this.$i18n=aS$2(c);const u=this.$i18n;u.__extender&&(u.__disposer=u.__extender(this.$i18n))}}else if(l.__i18n)if(this===this.$root)this.$i18n=nD$2(r,l);else{this.$i18n=aS$2({__i18n:l.__i18n,__injectWithOption:!0,__extender:s.__vueI18nExtend,__root:o});const c=this.$i18n;c.__extender&&(c.__disposer=c.__extender(this.$i18n))}else this.$i18n=r;l.__i18nGlobal&&VP$2(o,l,l),this.$t=(...c)=>this.$i18n.t(...c),this.$rt=(...c)=>this.$i18n.rt(...c),this.$tc=(...c)=>this.$i18n.tc(...c),this.$te=(c,u)=>this.$i18n.te(c,u),this.$d=(...c)=>this.$i18n.d(...c),this.$n=(...c)=>this.$i18n.n(...c),this.$tm=c=>this.$i18n.tm(c),s.__setInstance(a,this.$i18n)},mounted(){},unmounted(){const a=In$2();if(!a)throw Qn$2(Xn$2.UNEXPECTED_ERROR);const l=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,l.__disposer&&(l.__disposer(),delete l.__disposer,delete l.__extender),s.__deleteInstance(a),delete this.$i18n}}}function nD$2(r,o){r.locale=o.locale||r.locale,r.fallbackLocale=o.fallbackLocale||r.fallbackLocale,r.missing=o.missing||r.missing,r.silentTranslationWarn=o.silentTranslationWarn||r.silentFallbackWarn,r.silentFallbackWarn=o.silentFallbackWarn||r.silentFallbackWarn,r.formatFallbackMessages=o.formatFallbackMessages||r.formatFallbackMessages,r.postTranslation=o.postTranslation||r.postTranslation,r.warnHtmlInMessage=o.warnHtmlInMessage||r.warnHtmlInMessage,r.escapeParameterHtml=o.escapeParameterHtml||r.escapeParameterHtml,r.sync=o.sync||r.sync,r.__composer[UP$2](o.pluralizationRules||r.pluralizationRules);const s=Fv$2(r.locale,{messages:o.messages,__i18n:o.__i18n});return Object.keys(s).forEach(a=>r.mergeLocaleMessage(a,s[a])),o.datetimeFormats&&Object.keys(o.datetimeFormats).forEach(a=>r.mergeDateTimeFormat(a,o.datetimeFormats[a])),o.numberFormats&&Object.keys(o.numberFormats).forEach(a=>r.mergeNumberFormat(a,o.numberFormats[a])),r}const Bct=Pl$1("global-vue-i18n");function Vct(r={},o){const s=__VUE_I18N_LEGACY_API__&&se(r.legacy)?r.legacy:__VUE_I18N_LEGACY_API__,a=se(r.globalInjection)?r.globalInjection:!0,l=__VUE_I18N_LEGACY_API__&&s?!!r.allowComposition:!0,c=new Map,[u,d]=zct(r,s),m=Pl$1("");function g(E){return c.get(E)||null}function y(E,w){c.set(E,w)}function _(E){c.delete(E)}{const E={get mode(){return __VUE_I18N_LEGACY_API__&&s?"legacy":"composition"},get allowComposition(){return l},async install(w,...T){if(w.__VUE_I18N_SYMBOL__=m,w.provide(w.__VUE_I18N_SYMBOL__,E),Xt$2(T[0])){const R=T[0];E.__composerExtend=R.__composerExtend,E.__vueI18nExtend=R.__vueI18nExtend}let k=null;!s&&a&&(k=Kct(w,E.global)),__VUE_I18N_FULL_INSTALL__&&Uct(w,E,...T),__VUE_I18N_LEGACY_API__&&s&&w.mixin($ct(d,d.__composer,E));const O=w.unmount;w.unmount=()=>{k&&k(),E.dispose(),O()}},get global(){return d},dispose(){u.stop()},__instances:c,__getInstance:g,__setInstance:y,__deleteInstance:_};return E}}function Ke$1(r={}){const o=In$2();if(o==null)throw Qn$2(Xn$2.MUST_BE_CALL_SETUP_TOP);if(!o.isCE&&o.appContext.app!=null&&!o.appContext.app.__VUE_I18N_SYMBOL__)throw Qn$2(Xn$2.NOT_INSTALLED);const s=Hct(o),a=Xct(s),l=BP$2(o),c=Wct(r,l);if(__VUE_I18N_LEGACY_API__&&s.mode==="legacy"&&!r.__useComponent){if(!s.allowComposition)throw Qn$2(Xn$2.NOT_AVAILABLE_IN_LEGACY_MODE);return Zct(o,c,a,r)}if(c==="global")return VP$2(a,r,l),a;if(c==="parent"){let m=Yct(s,o,r.__useComponent);return m==null&&(m=a),m}const u=s;let d=u.__getInstance(o);if(d==null){const m=ar$1({},r);"__i18n"in l&&(m.__i18n=l.__i18n),a&&(m.__root=a),d=oS$3(m),u.__composerExtend&&(d[sS$2]=u.__composerExtend(d)),qct(u,o,d),u.__setInstance(o,d)}return d}function zct(r,o,s){const a=Qf$2();{const l=__VUE_I18N_LEGACY_API__&&o?a.run(()=>aS$2(r)):a.run(()=>oS$3(r));if(l==null)throw Qn$2(Xn$2.UNEXPECTED_ERROR);return[a,l]}}function Hct(r){{const o=Pn$2(r.isCE?Bct:r.appContext.app.__VUE_I18N_SYMBOL__);if(!o)throw Qn$2(r.isCE?Xn$2.NOT_INSTALLED_WITH_PROVIDE:Xn$2.UNEXPECTED_ERROR);return o}}function Wct(r,o){return Cv$2(r)?"__i18n"in o?"local":"global":r.useScope?r.useScope:"local"}function Xct(r){return r.mode==="composition"?r.global:r.global.__composer}function Yct(r,o,s=!1){let a=null;const l=o.root;let c=Jct(o,s);for(;c!=null;){const u=r;if(r.mode==="composition")a=u.__getInstance(c);else if(__VUE_I18N_LEGACY_API__){const d=u.__getInstance(c);d!=null&&(a=d.__composer,s&&a&&!a[$P$2]&&(a=null))}if(a!=null||l===c)break;c=c.parent}return a}function Jct(r,o=!1){return r==null?null:o&&r.vnode.ctx||r.parent}function qct(r,o,s){qn$2(()=>{},o),tu$2(()=>{const a=s;r.__deleteInstance(o);const l=a[sS$2];l&&(l(),delete a[sS$2])},o)}function Zct(r,o,s,a={}){const l=o==="local",c=up$2(null);if(l&&r.proxy&&!(r.proxy.$options.i18n||r.proxy.$options.__i18n))throw Qn$2(Xn$2.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const u=se(a.inheritLocale)?a.inheritLocale:!xt$2(a.locale),d=tt$3(!l||u?s.locale.value:xt$2(a.locale)?a.locale:Cp$1),m=tt$3(!l||u?s.fallbackLocale.value:xt$2(a.fallbackLocale)||Qe$1(a.fallbackLocale)||Xt$2(a.fallbackLocale)||a.fallbackLocale===!1?a.fallbackLocale:d.value),g=tt$3(Fv$2(d.value,a)),y=tt$3(Xt$2(a.datetimeFormats)?a.datetimeFormats:{[d.value]:{}}),_=tt$3(Xt$2(a.numberFormats)?a.numberFormats:{[d.value]:{}}),E=l?s.missingWarn:se(a.missingWarn)||Dl$2(a.missingWarn)?a.missingWarn:!0,w=l?s.fallbackWarn:se(a.fallbackWarn)||Dl$2(a.fallbackWarn)?a.fallbackWarn:!0,T=l?s.fallbackRoot:se(a.fallbackRoot)?a.fallbackRoot:!0,k=!!a.fallbackFormat,O=Xe(a.missing)?a.missing:null,R=Xe(a.postTranslation)?a.postTranslation:null,M=l?s.warnHtmlMessage:se(a.warnHtmlMessage)?a.warnHtmlMessage:!0,N=!!a.escapeParameter,D=l?s.modifiers:Xt$2(a.modifiers)?a.modifiers:{},P=a.pluralRules||l&&s.pluralRules;function I(){return[d.value,m.value,g.value,y.value,_.value]}const L=te({get:()=>c.value?c.value.locale.value:d.value,set:st=>{c.value&&(c.value.locale.value=st),d.value=st}}),F=te({get:()=>c.value?c.value.fallbackLocale.value:m.value,set:st=>{c.value&&(c.value.fallbackLocale.value=st),m.value=st}}),U=te(()=>c.value?c.value.messages.value:g.value),J=te(()=>y.value),z=te(()=>_.value);function ie(){return c.value?c.value.getPostTranslationHandler():R}function ce(st){c.value&&c.value.setPostTranslationHandler(st)}function Y(){return c.value?c.value.getMissingHandler():O}function B(st){c.value&&c.value.setMissingHandler(st)}function V(st){return I(),st()}function Ge(...st){return c.value?V(()=>Reflect.apply(c.value.t,null,[...st])):V(()=>"")}function St(...st){return c.value?Reflect.apply(c.value.rt,null,[...st]):""}function Dee(...st){return c.value?V(()=>Reflect.apply(c.value.d,null,[...st])):V(()=>"")}function pee(...st){return c.value?V(()=>Reflect.apply(c.value.n,null,[...st])):V(()=>"")}function jr(st){return c.value?c.value.tm(st):{}}function Tee(st,Lee){return c.value?c.value.te(st,Lee):!1}function et(st){return c.value?c.value.getLocaleMessage(st):{}}function ft(st,Lee){c.value&&(c.value.setLocaleMessage(st,Lee),g.value[st]=Lee)}function yee(st,Lee){c.value&&c.value.mergeLocaleMessage(st,Lee)}function ete(st){return c.value?c.value.getDateTimeFormat(st):{}}function xte(st,Lee){c.value&&(c.value.setDateTimeFormat(st,Lee),y.value[st]=Lee)}function Ote(st,Lee){c.value&&c.value.mergeDateTimeFormat(st,Lee)}function nee(st){return c.value?c.value.getNumberFormat(st):{}}function Wee(st,Lee){c.value&&(c.value.setNumberFormat(st,Lee),_.value[st]=Lee)}function Bee(st,Lee){c.value&&c.value.mergeNumberFormat(st,Lee)}const Nte={get id(){return c.value?c.value.id:-1},locale:L,fallbackLocale:F,messages:U,datetimeFormats:J,numberFormats:z,get inheritLocale(){return c.value?c.value.inheritLocale:u},set inheritLocale(st){c.value&&(c.value.inheritLocale=st)},get availableLocales(){return c.value?c.value.availableLocales:Object.keys(g.value)},get modifiers(){return c.value?c.value.modifiers:D},get pluralRules(){return c.value?c.value.pluralRules:P},get isGlobal(){return c.value?c.value.isGlobal:!1},get missingWarn(){return c.value?c.value.missingWarn:E},set missingWarn(st){c.value&&(c.value.missingWarn=st)},get fallbackWarn(){return c.value?c.value.fallbackWarn:w},set fallbackWarn(st){c.value&&(c.value.missingWarn=st)},get fallbackRoot(){return c.value?c.value.fallbackRoot:T},set fallbackRoot(st){c.value&&(c.value.fallbackRoot=st)},get fallbackFormat(){return c.value?c.value.fallbackFormat:k},set fallbackFormat(st){c.value&&(c.value.fallbackFormat=st)},get warnHtmlMessage(){return c.value?c.value.warnHtmlMessage:M},set warnHtmlMessage(st){c.value&&(c.value.warnHtmlMessage=st)},get escapeParameter(){return c.value?c.value.escapeParameter:N},set escapeParameter(st){c.value&&(c.value.escapeParameter=st)},t:Ge,getPostTranslationHandler:ie,setPostTranslationHandler:ce,getMissingHandler:Y,setMissingHandler:B,rt:St,d:Dee,n:pee,tm:jr,te:Tee,getLocaleMessage:et,setLocaleMessage:ft,mergeLocaleMessage:yee,getDateTimeFormat:ete,setDateTimeFormat:xte,mergeDateTimeFormat:Ote,getNumberFormat:nee,setNumberFormat:Wee,mergeNumberFormat:Bee};function _ee(st){st.locale.value=d.value,st.fallbackLocale.value=m.value,Object.keys(g.value).forEach(Lee=>{st.mergeLocaleMessage(Lee,g.value[Lee])}),Object.keys(y.value).forEach(Lee=>{st.mergeDateTimeFormat(Lee,y.value[Lee])}),Object.keys(_.value).forEach(Lee=>{st.mergeNumberFormat(Lee,_.value[Lee])}),st.escapeParameter=N,st.fallbackFormat=k,st.fallbackRoot=T,st.fallbackWarn=w,st.missingWarn=E,st.warnHtmlMessage=M}return yp$2(()=>{if(r.proxy==null||r.proxy.$i18n==null)throw Qn$2(Xn$2.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const st=c.value=r.proxy.$i18n.__composer;o==="global"?(d.value=st.locale.value,m.value=st.fallbackLocale.value,g.value=st.messages.value,y.value=st.datetimeFormats.value,_.value=st.numberFormats.value):l&&_ee(st)}),Nte}const Qct=["locale","fallbackLocale","availableLocales"],rD$2=["t","rt","d","n","tm","te"];function Kct(r,o){const s=Object.create(null);return Qct.forEach(a=>{const l=Object.getOwnPropertyDescriptor(o,a);if(!l)throw Qn$2(Xn$2.UNEXPECTED_ERROR);const c=pe$1(l.value)?{get(){return l.value.value},set(u){l.value.value=u}}:{get(){return l.get&&l.get()}};Object.defineProperty(s,a,c)}),r.config.globalProperties.$i18n=s,rD$2.forEach(a=>{const l=Object.getOwnPropertyDescriptor(o,a);if(!l||!l.value)throw Qn$2(Xn$2.UNEXPECTED_ERROR);Object.defineProperty(r.config.globalProperties,`$${a}`,l)}),()=>{delete r.config.globalProperties.$i18n,rD$2.forEach(a=>{delete r.config.globalProperties[`$${a}`]})}}if(Nct(),__INTLIFY_JIT_COMPILATION__?bP$2(xct):bP$2(wct),Klt(Llt),tct(fP$2),__INTLIFY_PROD_DEVTOOLS__){const r=aa$2();r.__INTLIFY__=!0,Vlt(r.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const tut={en:{"lang-code":"en","lang-dir":"ltr","lang-en":"English","lang-fr":"anglais","lang-native":"English","ramp.about.open":"Open About RAMP","ramp.about":"About RAMP","keyboardInstructions.title":"Keyboard Instructions","keyboardInstructions.open":"Open keyboard instructions","keyboardInstructions.app":"Use 'Tab' to navigate between sections of the application.","keyboardInstructions.lists":"Use the arrow keys to move between items in lists. With a list item selected you can press 'Space' or 'Enter' to click the item. You can also navigate within the list item using 'Tab'.","keyboardInstructions.map":"When the map is selected, use the arrow keys to move around and 'Enter' to select a point.","keyboardInstructions.OK":"OK","map.toggleScaleToMetric":"Switch to metric map scale","map.toggleScaleToImperial":"Switch to imperial map scale","map.coordinates.east":"E","map.coordinates.west":"W","map.coordinates.north":"N","map.coordinates.south":"S","map.changeLanguage":"Change Language","map.language.short":"EN-CA","map.language.en":"English","map.language.fr":"Français","map.language.curr":"current","map.export":"export map","notifications.open":"Open Notifications Panel","notifications.title":"Notifications","notifications.empty":"No new notifications.","notifications.controls.dismiss":"Dismiss","notifications.controls.expand":"Expand","notifications.controls.collapse":"Collapse","notifications.controls.clearAll":"Clear All","panels.access":"Press enter or space to access the panel","panels.controls.close":"Close","panels.controls.pin":"Pin","panels.controls.unpin":"Unpin","panels.controls.back":"Back","panels.controls.optionsMenu":"More","panels.controls.minimize":"Minimize","panels.controls.expand":"Expand","panels.controls.collapse":"Collapse","panels.controls.moveRight":"Move Right","panels.controls.moveLeft":"Move Left","panels.controls.items":"Use the arrow keys to navigate the items","panels.alert.open":"{name} panel opened","panels.alert.close":"{name} panel closed","panels.alert.minimize":"{name} panel minimized","layer.error":"{id} failed to load","layer.longload":"{id} is taking longer than expected to load","layer.longdraw":"{id} is taking longer than expected to draw","layer.mismatch":"{name} cannot be displayed in the current projection","layer.filtersdisabled":"Filters have been disabled for {name}","layer.filterwarning":"You are attempting to use a grid that contains unmodifiable layers. Filtering will be partially disabled.","layer.noexportmap":"{name} was attempted to be added as a Map Image Layer but Map Export is not enabled for the service","caption.attributionDefaultText":"Powered by ESRI","caption.attributionLogoAltText":"ESRI logo","caption.attributionLink":"https://www.esri.com/","select.items":" Use Arrow-up/down to select a value. Use Alt+Shift+Arrow-up/down to toggle the select menu"},fr:{"lang-code":"fr","lang-dir":"ltr","lang-en":"French","lang-fr":"français","lang-native":"Français","ramp.about.open":"Ouvrir À propos de PCAR","ramp.about":"À propos de PCAR","keyboardInstructions.title":"Instructions clavier","keyboardInstructions.open":"Instructions clavier ouvert","keyboardInstructions.app":"Utilisez la touche Tab pour vous déplacer entre les sections de l'application.","keyboardInstructions.lists":"Lorsqu'un élément de la liste est sélectionné, vous pouvez appuyer sur « Espace » ou « Entrée » pour cliquer sur l'élément. Vous pouvez également vous déplacer au sein de l'élément de la liste au moyen de la touche « Tab ».","keyboardInstructions.map":"Lorsque la carte est sélectionnée, utilisez le pavé curseur pour vous déplacer et appuyez sur « Entrée » pour sélectionner un point.","keyboardInstructions.OK":"OK","map.toggleScaleToMetric":"Passer à l'échelle métrique","map.toggleScaleToImperial":"Passer à l'échelle impériale","map.coordinates.east":"E","map.coordinates.west":"O","map.coordinates.north":"N","map.coordinates.south":"S","map.changeLanguage":"Changer de langue","map.language.short":"FR-CA","map.language.en":"English","map.language.fr":"Français","map.language.curr":"actuel","map.export":"exporter la carte","notifications.open":"Ouvrir la fenêtre des notifications","notifications.title":"Notifications","notifications.empty":"Aucune nouvelle notification.","notifications.controls.dismiss":"Rejeter","notifications.controls.expand":"Développer","notifications.controls.collapse":"Réduire","notifications.controls.clearAll":"Effacer tout","panels.access":"Appuyez sur Entrée ou sur la barre d'espacement pour accéder au panneau","panels.controls.close":"Fermer","panels.controls.pin":"Épingler","panels.controls.unpin":"Désépingler","panels.controls.back":"Retour","panels.controls.optionsMenu":"Plus","panels.controls.minimize":"Réduire","panels.controls.expand":"Développer","panels.controls.collapse":"Réduire","panels.controls.moveRight":"Aller à droite","panels.controls.moveLeft":"Aller à gauche","panels.controls.items":"Utilisez les touches fléchées pour naviguer entre les éléments","panels.alert.open":"Fenêtre {name} ouverte","panels.alert.close":"Fenêtre {name} fermée","panels.alert.minimize":"Fenêtre {name} réduite","layer.error":"Échec du chargement de {id}","layer.longload":"Le chargement de {id} met plus de temps que prévu","layer.longdraw":"{id} prend plus de temps que prévu à extraire","layer.mismatch":"{id} ne peut pas s'afficher dans la projection actuelle","layer.filtersdisabled":"Les filtres ont été désactivés pour {name}","layer.filterwarning":"Vous essayez d'utiliser une grille qui contient des couches non modifiables. Le filtrage sera partiellement désactivé.","layer.noexportmap":"La tentative d’ajouter {name} comme couche d’imagerie cartographique a échouée car elle n’a pu être activé pour ce service","caption.attributionDefaultText":"Propulsé par ESRI","caption.attributionLogoAltText":"Logo ESRI","caption.attributionLink":"https://www.esri.com/fr-fr/home","select.items":"Utilisez Flèche haut/bas pour sélectionner une valeur. Utilisez Alt+Shift+Flèche haut/bas pour basculer le menu de sélection"}},iD$2="en",eut={en:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}},fr:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}}};function nut(){return Vct({legacy:!1,locale:document.documentElement.getAttribute("lang")||iD$2,fallbackLocale:iD$2,globalInjection:!0,messages:tut,numberFormats:eut})}var sD$2={exports:{}},oD$2;function rut(){return oD$2||(oD$2=1,function(r){(function(){var o=typeof window<"u"&&typeof window.document<"u"?window.document:{},s=r.exports,a=function(){for(var u,d=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],m=0,g=d.length,y={};m-1}function Nne(Xte,ine){var ane=this.__data__,vne=sne(ane,Xte);return vne<0?ane.push([Xte,ine]):ane[vne][1]=ine,this}Sne.prototype.clear=Ene,Sne.prototype.delete=kne,Sne.prototype.get=Ine,Sne.prototype.has=Rne,Sne.prototype.set=Nne;function zne(Xte){var ine=-1,ane=Xte?Xte.length:0;for(this.clear();++ine-1&&Xte%1==0&&Xte-1&&Xte%1==0&&Xte<=l}function Bre(Xte){var ine=typeof Xte;return!!Xte&&(ine=="object"||ine=="function")}function Sie(Xte){return!!Xte&&typeof Xte=="object"}function Yre(Xte){return qre(Xte)?Kte(Xte):Bne(Xte)}function Aie(){return[]}function Cie(){return!1}r.exports=Ere}(jv$2,jv$2.exports)),jv$2.exports}var out=sut();const lD$2=Hh$2(out),Uv$2=ln$1("maptip",()=>{const r=tt$3(void 0),o=tt$3(void 0),s=tt$3("");function a(u){r.value=u}function l(u){o.value=u}function c(u){s.value=u}return{maptipInstance:r,maptipPoint:o,content:s,setMaptipInstance:a,setMaptipPoint:l,setMaptipContent:c}}),aut=ne$1({__name:"esri-map",setup(r){const o=Uv$2(),s=Pn$2("iApi"),a=te(()=>o.maptipPoint),l=te(()=>o.maptipInstance),c=te(()=>o.content),u=Vn$1([]);u.push(Hn$2(a,()=>{if(a.value){let m,g;const y=s.geo.map.getPixelWidth()/2,_=0,E=s.geo.map.mapPointToScreenPoint(a.value);m=E.screenX-y,g=_-E.screenY,l.value.setProps({offset:[m,g]}),c.value&&c.value!==""&&l.value.show()}else l.value.hide()})),u.push(Hn$2(c,m=>{m&&m!==""&&a?(l.value.setContent(m),l.value.show()):l.value.hide()})),zi$1(()=>{u.forEach(m=>m())});const d=()=>{s.geo.map.setMouseFocus()};return(m,g)=>{const y=Ie$2("tippy");return Ae$1((pt$1(),wt("div",{name:"esriMap",id:"esriMap",class:"h-full overflow-hidden",onMousedown:d,onKeydown:g[0]||(g[0]=lv$2(wp$3(()=>{},["prevent"]),["up","down","left","right"]))},null,544)),[[y,{allowHTML:!0,zIndex:150,theme:"ramp4",trigger:"manual",appendTo:"parent",arrow:!1,delay:200,duration:[200,200]}]])}}});var cD$2={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},cS$2={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},lut=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],$v$2={CSS:{},springs:{}};function ho$2(r,o,s){return Math.min(Math.max(r,o),s)}function Vm$2(r,o){return r.indexOf(o)>-1}function uS$2(r,o){return r.apply(null,o)}var Lt$3={arr:function(r){return Array.isArray(r)},obj:function(r){return Vm$2(Object.prototype.toString.call(r),"Object")},pth:function(r){return Lt$3.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return r.nodeType||Lt$3.svg(r)},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r>"u"},nil:function(r){return Lt$3.und(r)||r===null},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return Lt$3.hex(r)||Lt$3.rgb(r)||Lt$3.hsl(r)},key:function(r){return!cD$2.hasOwnProperty(r)&&!cS$2.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function uD$2(r){var o=/\(([^)]+)\)/.exec(r);return o?o[1].split(",").map(function(s){return parseFloat(s)}):[]}function hD$2(r,o){var s=uD$2(r),a=ho$2(Lt$3.und(s[0])?1:s[0],.1,100),l=ho$2(Lt$3.und(s[1])?100:s[1],.1,100),c=ho$2(Lt$3.und(s[2])?10:s[2],.1,100),u=ho$2(Lt$3.und(s[3])?0:s[3],.1,100),d=Math.sqrt(l/a),m=c/(2*Math.sqrt(l*a)),g=m<1?d*Math.sqrt(1-m*m):0,y=1,_=m<1?(m*d+-u)/g:-u+d;function E(T){var k=o?o*T/1e3:T;return m<1?k=Math.exp(-k*m*d)*(y*Math.cos(g*k)+_*Math.sin(g*k)):k=(y+_*k)*Math.exp(-k*d),T===0||T===1?T:1-k}function w(){var T=$v$2.springs[r];if(T)return T;for(var k=1/6,O=0,R=0;;)if(O+=k,E(O)===1){if(R++,R>=16)break}else R=0;var M=O*k*1e3;return $v$2.springs[r]=M,M}return o?E:w}function cut(r){return r===void 0&&(r=10),function(o){return Math.ceil(ho$2(o,1e-6,1)*r)*(1/r)}}var uut=function(){var r=11,o=1/(r-1);function s(y,_){return 1-3*_+3*y}function a(y,_){return 3*_-6*y}function l(y){return 3*y}function c(y,_,E){return((s(_,E)*y+a(_,E))*y+l(_))*y}function u(y,_,E){return 3*s(_,E)*y*y+2*a(_,E)*y+l(_)}function d(y,_,E,w,T){var k,O,R=0;do O=_+(E-_)/2,k=c(O,w,T)-y,k>0?E=O:_=O;while(Math.abs(k)>1e-7&&++R<10);return O}function m(y,_,E,w){for(var T=0;T<4;++T){var k=u(_,E,w);if(k===0)return _;var O=c(_,E,w)-y;_-=O/k}return _}function g(y,_,E,w){if(!(0<=y&&y<=1&&0<=E&&E<=1))return;var T=new Float32Array(r);if(y!==_||E!==w)for(var k=0;k=.001?m(R,I,y,E):L===0?I:d(R,M,M+o,y,E)}return function(R){return y===_&&E===w||R===0||R===1?R:c(O(R),_,w)}}return g}(),pD$2=function(){var r={linear:function(){return function(a){return a}}},o={Sine:function(){return function(a){return 1-Math.cos(a*Math.PI/2)}},Circ:function(){return function(a){return 1-Math.sqrt(1-a*a)}},Back:function(){return function(a){return a*a*(3*a-2)}},Bounce:function(){return function(a){for(var l,c=4;a<((l=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((l*3-2)/22-a,2)}},Elastic:function(a,l){a===void 0&&(a=1),l===void 0&&(l=.5);var c=ho$2(a,1,10),u=ho$2(l,.1,2);return function(d){return d===0||d===1?d:-c*Math.pow(2,10*(d-1))*Math.sin((d-1-u/(Math.PI*2)*Math.asin(1/c))*(Math.PI*2)/u)}}},s=["Quad","Cubic","Quart","Quint","Expo"];return s.forEach(function(a,l){o[a]=function(){return function(c){return Math.pow(c,l+2)}}}),Object.keys(o).forEach(function(a){var l=o[a];r["easeIn"+a]=l,r["easeOut"+a]=function(c,u){return function(d){return 1-l(c,u)(1-d)}},r["easeInOut"+a]=function(c,u){return function(d){return d<.5?l(c,u)(d*2)/2:1-l(c,u)(d*-2+2)/2}},r["easeOutIn"+a]=function(c,u){return function(d){return d<.5?(1-l(c,u)(1-d*2))/2:(l(c,u)(d*2-1)+1)/2}}}),r}();function hS$1(r,o){if(Lt$3.fnc(r))return r;var s=r.split("(")[0],a=pD$2[s],l=uD$2(r);switch(s){case"spring":return hD$2(r,o);case"cubicBezier":return uS$2(uut,l);case"steps":return uS$2(cut,l);default:return uS$2(a,l)}}function dD$2(r){try{var o=document.querySelectorAll(r);return o}catch{return}}function Bv$2(r,o){for(var s=r.length,a=arguments.length>=2?arguments[1]:void 0,l=[],c=0;c1&&(T-=1),T<1/6?E+(w-E)*6*T:T<1/2?w:T<2/3?E+(w-E)*(2/3-T)*6:E}var d,m,g;if(a==0)d=m=g=l;else{var y=l<.5?l*(1+a):l+a-l*a,_=2*l-y;d=u(_,y,s+1/3),m=u(_,y,s),g=u(_,y,s-1/3)}return"rgba("+d*255+","+m*255+","+g*255+","+c+")"}function fut(r){if(Lt$3.rgb(r))return hut(r);if(Lt$3.hex(r))return put(r);if(Lt$3.hsl(r))return dut(r)}function ua$2(r){var o=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(o)return o[1]}function mut(r){if(Vm$2(r,"translate")||r==="perspective")return"px";if(Vm$2(r,"rotate")||Vm$2(r,"skew"))return"deg"}function mS$1(r,o){return Lt$3.fnc(r)?r(o.target,o.id,o.total):r}function po$2(r,o){return r.getAttribute(o)}function yS$2(r,o,s){var a=ua$2(o);if(pS$2([s,"deg","rad","turn"],a))return o;var l=$v$2.CSS[o+s];if(!Lt$3.und(l))return l;var c=100,u=document.createElement(r.tagName),d=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;d.appendChild(u),u.style.position="absolute",u.style.width=c+s;var m=c/u.offsetWidth;d.removeChild(u);var g=m*parseFloat(o);return $v$2.CSS[o+s]=g,g}function mD$2(r,o,s){if(o in r.style){var a=o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),l=r.style[o]||getComputedStyle(r).getPropertyValue(a)||"0";return s?yS$2(r,l,s):l}}function gS$2(r,o){if(Lt$3.dom(r)&&!Lt$3.inp(r)&&(!Lt$3.nil(po$2(r,o))||Lt$3.svg(r)&&r[o]))return"attribute";if(Lt$3.dom(r)&&pS$2(lut,o))return"transform";if(Lt$3.dom(r)&&o!=="transform"&&mD$2(r,o))return"css";if(r[o]!=null)return"object"}function yD$2(r){if(Lt$3.dom(r)){for(var o=r.style.transform||"",s=/(\w+)\(([^)]*)\)/g,a=new Map,l;l=s.exec(o);)a.set(l[1],l[2]);return a}}function yut(r,o,s,a){var l=Vm$2(o,"scale")?1:0+mut(o),c=yD$2(r).get(o)||l;return s&&(s.transforms.list.set(o,c),s.transforms.last=o),a?yS$2(r,c,a):c}function vS$2(r,o,s,a){switch(gS$2(r,o)){case"transform":return yut(r,o,a,s);case"css":return mD$2(r,o,s);case"attribute":return po$2(r,o);default:return r[o]||0}}function bS$2(r,o){var s=/^(\*=|\+=|-=)/.exec(r);if(!s)return r;var a=ua$2(r)||0,l=parseFloat(o),c=parseFloat(r.replace(s[0],""));switch(s[0][0]){case"+":return l+c+a;case"-":return l-c+a;case"*":return l*c+a}}function gD$2(r,o){if(Lt$3.col(r))return fut(r);if(/\s/g.test(r))return r;var s=ua$2(r),a=s?r.substr(0,r.length-s.length):r;return o?a+o:a}function _S$2(r,o){return Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2))}function gut(r){return Math.PI*2*po$2(r,"r")}function vut(r){return po$2(r,"width")*2+po$2(r,"height")*2}function but(r){return _S$2({x:po$2(r,"x1"),y:po$2(r,"y1")},{x:po$2(r,"x2"),y:po$2(r,"y2")})}function vD$2(r){for(var o=r.points,s=0,a,l=0;l0&&(s+=_S$2(a,c)),a=c}return s}function _ut(r){var o=r.points;return vD$2(r)+_S$2(o.getItem(o.numberOfItems-1),o.getItem(0))}function bD$2(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return gut(r);case"rect":return vut(r);case"line":return but(r);case"polyline":return vD$2(r);case"polygon":return _ut(r)}}function wut(r){var o=bD$2(r);return r.setAttribute("stroke-dasharray",o),o}function xut(r){for(var o=r.parentNode;Lt$3.svg(o)&&Lt$3.svg(o.parentNode);)o=o.parentNode;return o}function _D$2(r,o){var s=o||{},a=s.el||xut(r),l=a.getBoundingClientRect(),c=po$2(a,"viewBox"),u=l.width,d=l.height,m=s.viewBox||(c?c.split(" "):[0,0,u,d]);return{el:a,viewBox:m,x:m[0]/1,y:m[1]/1,w:u,h:d,vW:m[2],vH:m[3]}}function Eut(r,o){var s=Lt$3.str(r)?dD$2(r)[0]:r,a=o||100;return function(l){return{property:l,el:s,svg:_D$2(s),totalLength:bD$2(s)*(a/100)}}}function Tut(r,o,s){function a(y){y===void 0&&(y=0);var _=o+y>=1?o+y:0;return r.el.getPointAtLength(_)}var l=_D$2(r.el,r.svg),c=a(),u=a(-1),d=a(1),m=s?1:l.w/l.vW,g=s?1:l.h/l.vH;switch(r.property){case"x":return(c.x-l.x)*m;case"y":return(c.y-l.y)*g;case"angle":return Math.atan2(d.y-u.y,d.x-u.x)*180/Math.PI}}function wD$2(r,o){var s=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,a=gD$2(Lt$3.pth(r)?r.totalLength:r,o)+"";return{original:a,numbers:a.match(s)?a.match(s).map(Number):[0],strings:Lt$3.str(r)||o?a.split(s):[]}}function wS$2(r){var o=r?Vv$2(Lt$3.arr(r)?r.map(fD$2):fD$2(r)):[];return Bv$2(o,function(s,a,l){return l.indexOf(s)===a})}function xD$2(r){var o=wS$2(r);return o.map(function(s,a){return{target:s,id:a,total:o.length,transforms:{list:yD$2(s)}}})}function Sut(r,o){var s=dS$2(o);if(/^spring/.test(s.easing)&&(s.duration=hD$2(s.easing)),Lt$3.arr(r)){var a=r.length,l=a===2&&!Lt$3.obj(r[0]);l?r={value:r}:Lt$3.fnc(o.duration)||(s.duration=o.duration/a)}var c=Lt$3.arr(r)?r:[r];return c.map(function(u,d){var m=Lt$3.obj(u)&&!Lt$3.pth(u)?u:{value:u};return Lt$3.und(m.delay)&&(m.delay=d?0:o.delay),Lt$3.und(m.endDelay)&&(m.endDelay=d===c.length-1?o.endDelay:0),m}).map(function(u){return zv$2(u,s)})}function Aut(r){for(var o=Bv$2(Vv$2(r.map(function(c){return Object.keys(c)})),function(c){return Lt$3.key(c)}).reduce(function(c,u){return c.indexOf(u)<0&&c.push(u),c},[]),s={},a=function(c){var u=o[c];s[u]=r.map(function(d){var m={};for(var g in d)Lt$3.key(g)?g==u&&(m.value=d[g]):m[g]=d[g];return m})},l=0;l0&&(r=requestAnimationFrame(s))}function s(l){for(var c=Os$1.length,u=0;u0?requestAnimationFrame(s):void 0}function a(){cn$1.suspendWhenDocumentHidden&&(MD$2()?r=cancelAnimationFrame(r):(Os$1.forEach(function(l){return l._onDocumentVisibility()}),ID$2()))}return typeof document<"u"&&document.addEventListener("visibilitychange",a),o}();function MD$2(){return!!document&&document.hidden}function cn$1(r){r===void 0&&(r={});var o=0,s=0,a=0,l,c=0,u=null;function d(M){var N=window.Promise&&new Promise(function(D){return u=D});return M.finished=N,N}var m=Rut(r);d(m);function g(){var M=m.direction;M!=="alternate"&&(m.direction=M!=="normal"?"normal":"reverse"),m.reversed=!m.reversed,l.forEach(function(N){return N.reversed=m.reversed})}function y(M){return m.reversed?m.duration-M:M}function _(){o=0,s=y(m.currentTime)*(1/cn$1.speed)}function E(M,N){N&&N.seek(M-N.timelineOffset)}function w(M){if(m.reversePlayback)for(var N=c;N--;)E(M,l[N]);else for(var D=0;D2||(Dee=Math.round(Dee*Y)/Y)),B.push(Dee)}var Tee=ce.length;if(!Tee)Ge=B[0];else{Ge=ce[0];for(var et=0;et0&&(m.began=!0,k("begin")),!m.loopBegan&&m.currentTime>0&&(m.loopBegan=!0,k("loopBegin")),I<=D&&m.currentTime!==0&&T(0),(I>=P&&m.currentTime!==N||!N)&&T(N),I>D&&I=N&&(s=0,O(),m.remaining?(o=a,k("loopComplete"),m.loopBegan=!1,m.direction==="alternate"&&g()):(m.paused=!0,m.completed||(m.completed=!0,k("loopComplete"),k("complete"),!m.passThrough&&"Promise"in window&&(u(),d(m)))))}return m.reset=function(){var M=m.direction;m.passThrough=!1,m.currentTime=0,m.progress=0,m.paused=!0,m.began=!1,m.loopBegan=!1,m.changeBegan=!1,m.completed=!1,m.changeCompleted=!1,m.reversePlayback=!1,m.reversed=M==="reverse",m.remaining=m.loop,l=m.children,c=l.length;for(var N=c;N--;)m.children[N].reset();(m.reversed&&m.loop!==!0||M==="alternate"&&m.loop===1)&&m.remaining++,T(m.reversed?m.duration:0)},m._onDocumentVisibility=_,m.set=function(M,N){return TD$2(M,N),m},m.tick=function(M){a=M,o||(o=a),R((a+(s-o))*cn$1.speed)},m.seek=function(M){R(y(M))},m.pause=function(){m.paused=!0,_()},m.play=function(){m.paused&&(m.completed&&m.reset(),m.paused=!1,Os$1.push(m),_(),ID$2())},m.reverse=function(){g(),m.completed=!m.reversed,_()},m.restart=function(){m.reset(),m.play()},m.remove=function(M){var N=wS$2(M);OD$2(N,m)},m.reset(),m.autoplay&&m.play(),m}function ND$2(r,o){for(var s=o.length;s--;)pS$2(r,o[s].animatable.target)&&o.splice(s,1)}function OD$2(r,o){var s=o.animations,a=o.children;ND$2(r,s);for(var l=a.length;l--;){var c=a[l],u=c.animations;ND$2(r,u),!u.length&&!c.children.length&&a.splice(l,1)}!s.length&&!a.length&&o.pause()}function kut(r){for(var o=wS$2(r),s=Os$1.length;s--;){var a=Os$1[s];OD$2(o,a)}}function Lut(r,o){o===void 0&&(o={});var s=o.direction||"normal",a=o.easing?hS$1(o.easing):null,l=o.grid,c=o.axis,u=o.from||0,d=u==="first",m=u==="center",g=u==="last",y=Lt$3.arr(r),_=parseFloat(y?r[0]:r),E=y?parseFloat(r[1]):0,w=ua$2(y?r[1]:r)||0,T=o.start||0+(y?_:0),k=[],O=0;return function(R,M,N){if(d&&(u=0),m&&(u=(N-1)/2),g&&(u=N-1),!k.length){for(var D=0;D-1&&Os$1.splice(l,1);function u(E){E.passThrough=!0}for(var d=0;d=d?l.target.classList.add(u):l.target.classList.remove(u)})})}):void 0}observe(o){this.resizeObserver?.observe(o)}};const Dut=["data-cy"],RD$2=ne$1({__name:"panel-container",props:{panel:{type:Object,required:!0}},setup(r){const o=tt$3(null),s=r,a=tt$3(!1);qn$2(()=>{s.panel.teleport&&new CD$2({xs:0,sm:461,...s.panel.teleport.breakpoints}).observe(o.value)});const l=(m,g,y)=>{if(a.value)return g();cn$1({targets:m,opacity:{value:y,duration:400,easing:"cubicBezier(.5, .05, .1, .3)"},complete:g})},c=(m,g)=>{l(m,g,[0,1])},u=m=>{m.classList.contains("screen-spinner")||(a.value=s.panel.isScreenLoaded(s.panel.route.screen),o.value.querySelectorAll("[focus-item").forEach(g=>g.classList.remove("default-focus-style")))},d=(m,g)=>{l(m,g,[0,1])};return(m,g)=>{const y=Ie$2("focus-container");return pt$1(),wt("div",{class:an$2(["shadow-tm bg-white h-full xs:mr-0 sm:mr-12 last:mr-0 pointer-events-auto min-w-0 shrink-0",r.panel.expanded?"flex-grow max-w-full":""]),style:Wo$1(r.panel.style),"data-cy":r.panel.id,ref_key:"componentEl",ref:o},[Zt$2(xm$2,{onBeforeLeave:u,onLeave:d,onEnter:c},{default:gn$1(()=>[Ae$1((pt$1(),Be($1$2(r.panel.route.screen),vm$2({class:"h-full"},r.panel.route.props,{panel:r.panel}),null,16,["panel"])),[[y]])]),_:1})],14,Dut)}}}),Ul$2=ln$1("panel",()=>{const r=tt$3(void 0),o=tt$3(void 0),s=tt$3(0),a=tt$3(0),l=tt$3(!1),c=tt$3(!0),u=tt$3({}),d=tt$3({}),m=tt$3([]),g=tt$3([]),y=tt$3([]),_=te(()=>a.value);function E(z){return z==="xs"&&y.value.length>0?[y.value.slice().pop()]:y.value}function w(z){const ie=[];return z.forEach(ce=>{ce in d.value&&ie.push(d.value[ce].getPromise())}),ie}function T(z){I(z),D(),o.value=void 0}function k(z){L(z),D()}function O(z,ie){F(z,ie),D()}function R(z){U(z),D()}function M(z){s.value=z,D()}function N(z){l.value=z}function D(){let z=s.value;const ie=[],ce=350,Y=12,B=600;for(let V=m.value.length-1;V>=0;V--){const Ge=m.value[V];let St=Ge.width||ce;if(l.value?St=z:St+=Y,Ge.id==="grid"&&(St=Math.max(Math.min(St,z),B)),(z>=St&&!l.value||ie.length===0)&&(z-=St,ie.unshift(Ge)),Ge.id==="grid"&&z=(r.value.width||ce)?ie.unshift(r.value):o.value||(V=ie.shift(),ie.unshift(r.value));const Ge=m.value.indexOf(r.value),St=m.value.indexOf(V),Dee=m.value.slice();St>-1&&(Dee.splice(Ge,1),Dee.splice(St,0,r.value)),m.value=Dee}a.value=z,y.value=ie}function P(z){if(u.value={...u.value,[z.id]:z},z.id in d.value)d.value[z.id].resolveMe(z);else{const ie=new xn$2;ie.resolveMe(z),d.value={...d.value,[z.id]:ie}}}function I(z){z.teleport?g.value=[...g.value,z]:(m.value=[...m.value,z],o.value=z)}function L(z){if(z.teleport){const ie=g.value.indexOf(z);ie!==-1&&(g.value=[...g.value.slice(0,ie),...g.value.slice(ie+1)])}else{const ie=m.value.indexOf(z);ie!==-1&&(m.value=[...m.value.slice(0,ie),...m.value.slice(ie+1)])}}function F(z,ie){const ce=m.value.indexOf(z),Y=ie==="right"?1:-1;y.value.includes(m.value[ce+Y])&&([m.value[ce],m.value[ce+Y]]=[m.value[ce+Y],m.value[ce]])}function U(z){u.value[z.id]!==void 0&&delete u.value[z.id],d.value[z.id]!==void 0&&delete d.value[z.id];const ie=y.value.indexOf(z);ie!==-1&&(y.value=[...y.value.slice(0,ie),...y.value.slice(ie+1)]),r.value&&r.value.id==z.id&&(r.value=void 0)}function J(z){d.value={...d.value,[z]:new xn$2}}return{items:u,regPromises:d,orderedItems:m,pinned:r,priority:o,visible:y,stackWidth:s,remWidth:a,mobileView:l,reorderable:c,teleported:g,getRemainingWidth:_,getVisible:E,getRegPromises:w,openPanel:T,closePanel:k,movePanel:O,removePanel:R,setStackWidth:M,setMobileView:N,updateVisible:D,registerPanel:P,addRegPromise:J}}),Gut=ne$1({__name:"panel-stack",setup(r){const o=Ul$2(),s=Pn$2("iApi"),a=tt$3(),l=te(()=>o.mobileView);qn$2(()=>{new ResizeObserver(g=>{const y=!(s?.$vApp.$root?.$refs["app-size"]).classList.contains("sm");l.value!==y&&(o.mobileView=y,s?.event.emit(Mt$2.RAMP_MOBILEVIEW_CHANGE,y)),o.setStackWidth(g[0].contentRect.width)}).observe(a.value?.$el)});const c=g=>o.getVisible(g),u=(g,y)=>{m(g,y,[[6,0],[0,1]])},d=(g,y)=>{const[_,E]=[g.children[0].getBoundingClientRect(),g.parentElement.getBoundingClientRect()];g.style.width=`${_.width}px`,g.style.height=`${_.height}px`,g.style.left=`${_.left-E.left}px`,g.style.position="absolute",m(g,y,[[0,-6],[1,0]])},m=(g,y,_)=>{cn$1({targets:g,duration:300,translateY:{value:_[0],easing:"cubicBezier(.5, .05, .1, .3)"},opacity:{value:_[1],duration:250,easing:"cubicBezier(.5, .05, .1, .3)"},complete:y})};return(g,y)=>(pt$1(),Be(rv$2,{onEnter:u,onLeave:d,name:"panel-container",tag:"div",ref_key:"el",ref:a},{default:gn$1(()=>[(pt$1(!0),wt(ke$1,null,ta$3(c(It$2(s).screenSize),_=>(pt$1(),Be(RD$2,{key:`${_.id}`,panel:_},null,8,["panel"]))),128))]),_:1},512))}}),fo$2=(r,o)=>{const s=r.__vccOpts||r;for(const[a,l]of o)s[a]=l;return s},Fut=fo$2(Gut,[["__scopeId","data-v-11f38702"]]);var ii$3="top",Zi$2="bottom",Qi$2="right",si$2="left",xS$2="auto",zm$2=[ii$3,Zi$2,Qi$2,si$2],Lp$2="start",Hm$2="end",jut="clippingParents",kD$2="viewport",Wm$2="popper",Uut="reference",LD$2=zm$2.reduce(function(r,o){return r.concat([o+"-"+Lp$2,o+"-"+Hm$2])},[]),PD$2=[].concat(zm$2,[xS$2]).reduce(function(r,o){return r.concat([o,o+"-"+Lp$2,o+"-"+Hm$2])},[]),$ut="beforeRead",But="read",Vut="afterRead",zut="beforeMain",Hut="main",Wut="afterMain",Xut="beforeWrite",Yut="write",Jut="afterWrite",qut=[$ut,But,Vut,zut,Hut,Wut,Xut,Yut,Jut];function mo$2(r){return r?(r.nodeName||"").toLowerCase():null}function xi$2(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var o=r.ownerDocument;return o&&o.defaultView||window}return r}function mu$3(r){var o=xi$2(r).Element;return r instanceof o||r instanceof Element}function Ki$2(r){var o=xi$2(r).HTMLElement;return r instanceof o||r instanceof HTMLElement}function ES$2(r){if(typeof ShadowRoot>"u")return!1;var o=xi$2(r).ShadowRoot;return r instanceof o||r instanceof ShadowRoot}function Zut(r){var o=r.state;Object.keys(o.elements).forEach(function(s){var a=o.styles[s]||{},l=o.attributes[s]||{},c=o.elements[s];!Ki$2(c)||!mo$2(c)||(Object.assign(c.style,a),Object.keys(l).forEach(function(u){var d=l[u];d===!1?c.removeAttribute(u):c.setAttribute(u,d===!0?"":d)}))})}function Qut(r){var o=r.state,s={popper:{position:o.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(o.elements.popper.style,s.popper),o.styles=s,o.elements.arrow&&Object.assign(o.elements.arrow.style,s.arrow),function(){Object.keys(o.elements).forEach(function(a){var l=o.elements[a],c=o.attributes[a]||{},u=Object.keys(o.styles.hasOwnProperty(a)?o.styles[a]:s[a]),d=u.reduce(function(m,g){return m[g]="",m},{});!Ki$2(l)||!mo$2(l)||(Object.assign(l.style,d),Object.keys(c).forEach(function(m){l.removeAttribute(m)}))})}}const Kut={name:"applyStyles",enabled:!0,phase:"write",fn:Zut,effect:Qut,requires:["computeStyles"]};function yo(r){return r.split("-")[0]}var yu$2=Math.max,Hv$2=Math.min,Pp$2=Math.round;function TS$2(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(o){return o.brand+"/"+o.version}).join(" "):navigator.userAgent}function DD$3(){return!/^((?!chrome|android).)*safari/i.test(TS$2())}function Dp$1(r,o,s){o===void 0&&(o=!1),s===void 0&&(s=!1);var a=r.getBoundingClientRect(),l=1,c=1;o&&Ki$2(r)&&(l=r.offsetWidth>0&&Pp$2(a.width)/r.offsetWidth||1,c=r.offsetHeight>0&&Pp$2(a.height)/r.offsetHeight||1);var u=mu$3(r)?xi$2(r):window,d=u.visualViewport,m=!DD$3()&&s,g=(a.left+(m&&d?d.offsetLeft:0))/l,y=(a.top+(m&&d?d.offsetTop:0))/c,_=a.width/l,E=a.height/c;return{width:_,height:E,top:y,right:g+_,bottom:y+E,left:g,x:g,y}}function SS$2(r){var o=Dp$1(r),s=r.offsetWidth,a=r.offsetHeight;return Math.abs(o.width-s)<=1&&(s=o.width),Math.abs(o.height-a)<=1&&(a=o.height),{x:r.offsetLeft,y:r.offsetTop,width:s,height:a}}function GD$2(r,o){var s=o.getRootNode&&o.getRootNode();if(r.contains(o))return!0;if(s&&ES$2(s)){var a=o;do{if(a&&r.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function ha$2(r){return xi$2(r).getComputedStyle(r)}function tht(r){return["table","td","th"].indexOf(mo$2(r))>=0}function $l$2(r){return((mu$3(r)?r.ownerDocument:r.document)||window.document).documentElement}function Wv$2(r){return mo$2(r)==="html"?r:r.assignedSlot||r.parentNode||(ES$2(r)?r.host:null)||$l$2(r)}function FD$2(r){return!Ki$2(r)||ha$2(r).position==="fixed"?null:r.offsetParent}function eht(r){var o=/firefox/i.test(TS$2()),s=/Trident/i.test(TS$2());if(s&&Ki$2(r)){var a=ha$2(r);if(a.position==="fixed")return null}var l=Wv$2(r);for(ES$2(l)&&(l=l.host);Ki$2(l)&&["html","body"].indexOf(mo$2(l))<0;){var c=ha$2(l);if(c.transform!=="none"||c.perspective!=="none"||c.contain==="paint"||["transform","perspective"].indexOf(c.willChange)!==-1||o&&c.willChange==="filter"||o&&c.filter&&c.filter!=="none")return l;l=l.parentNode}return null}function Xm$1(r){for(var o=xi$2(r),s=FD$2(r);s&&tht(s)&&ha$2(s).position==="static";)s=FD$2(s);return s&&(mo$2(s)==="html"||mo$2(s)==="body"&&ha$2(s).position==="static")?o:s||eht(r)||o}function AS$2(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function Ym$2(r,o,s){return yu$2(r,Hv$2(o,s))}function nht(r,o,s){var a=Ym$2(r,o,s);return a>s?s:a}function jD$2(){return{top:0,right:0,bottom:0,left:0}}function UD$2(r){return Object.assign({},jD$2(),r)}function $D$2(r,o){return o.reduce(function(s,a){return s[a]=r,s},{})}var rht=function(r,o){return r=typeof r=="function"?r(Object.assign({},o.rects,{placement:o.placement})):r,UD$2(typeof r!="number"?r:$D$2(r,zm$2))};function iht(r){var o,s=r.state,a=r.name,l=r.options,c=s.elements.arrow,u=s.modifiersData.popperOffsets,d=yo(s.placement),m=AS$2(d),g=[si$2,Qi$2].indexOf(d)>=0,y=g?"height":"width";if(!(!c||!u)){var _=rht(l.padding,s),E=SS$2(c),w=m==="y"?ii$3:si$2,T=m==="y"?Zi$2:Qi$2,k=s.rects.reference[y]+s.rects.reference[m]-u[m]-s.rects.popper[y],O=u[m]-s.rects.reference[m],R=Xm$1(c),M=R?m==="y"?R.clientHeight||0:R.clientWidth||0:0,N=k/2-O/2,D=_[w],P=M-E[y]-_[T],I=M/2-E[y]/2+N,L=Ym$2(D,I,P),F=m;s.modifiersData[a]=(o={},o[F]=L,o.centerOffset=L-I,o)}}function sht(r){var o=r.state,s=r.options,a=s.element,l=a===void 0?"[data-popper-arrow]":a;l!=null&&(typeof l=="string"&&(l=o.elements.popper.querySelector(l),!l)||GD$2(o.elements.popper,l)&&(o.elements.arrow=l))}const oht={name:"arrow",enabled:!0,phase:"main",fn:iht,effect:sht,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gp$2(r){return r.split("-")[1]}var aht={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lht(r,o){var s=r.x,a=r.y,l=o.devicePixelRatio||1;return{x:Pp$2(s*l)/l||0,y:Pp$2(a*l)/l||0}}function BD$2(r){var o,s=r.popper,a=r.popperRect,l=r.placement,c=r.variation,u=r.offsets,d=r.position,m=r.gpuAcceleration,g=r.adaptive,y=r.roundOffsets,_=r.isFixed,E=u.x,w=E===void 0?0:E,T=u.y,k=T===void 0?0:T,O=typeof y=="function"?y({x:w,y:k}):{x:w,y:k};w=O.x,k=O.y;var R=u.hasOwnProperty("x"),M=u.hasOwnProperty("y"),N=si$2,D=ii$3,P=window;if(g){var I=Xm$1(s),L="clientHeight",F="clientWidth";if(I===xi$2(s)&&(I=$l$2(s),ha$2(I).position!=="static"&&d==="absolute"&&(L="scrollHeight",F="scrollWidth")),I=I,l===ii$3||(l===si$2||l===Qi$2)&&c===Hm$2){D=Zi$2;var U=_&&I===P&&P.visualViewport?P.visualViewport.height:I[L];k-=U-a.height,k*=m?1:-1}if(l===si$2||(l===ii$3||l===Zi$2)&&c===Hm$2){N=Qi$2;var J=_&&I===P&&P.visualViewport?P.visualViewport.width:I[F];w-=J-a.width,w*=m?1:-1}}var z=Object.assign({position:d},g&&aht),ie=y===!0?lht({x:w,y:k},xi$2(s)):{x:w,y:k};if(w=ie.x,k=ie.y,m){var ce;return Object.assign({},z,(ce={},ce[D]=M?"0":"",ce[N]=R?"0":"",ce.transform=(P.devicePixelRatio||1)<=1?"translate("+w+"px, "+k+"px)":"translate3d("+w+"px, "+k+"px, 0)",ce))}return Object.assign({},z,(o={},o[D]=M?k+"px":"",o[N]=R?w+"px":"",o.transform="",o))}function cht(r){var o=r.state,s=r.options,a=s.gpuAcceleration,l=a===void 0?!0:a,c=s.adaptive,u=c===void 0?!0:c,d=s.roundOffsets,m=d===void 0?!0:d,g={placement:yo(o.placement),variation:Gp$2(o.placement),popper:o.elements.popper,popperRect:o.rects.popper,gpuAcceleration:l,isFixed:o.options.strategy==="fixed"};o.modifiersData.popperOffsets!=null&&(o.styles.popper=Object.assign({},o.styles.popper,BD$2(Object.assign({},g,{offsets:o.modifiersData.popperOffsets,position:o.options.strategy,adaptive:u,roundOffsets:m})))),o.modifiersData.arrow!=null&&(o.styles.arrow=Object.assign({},o.styles.arrow,BD$2(Object.assign({},g,{offsets:o.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:m})))),o.attributes.popper=Object.assign({},o.attributes.popper,{"data-popper-placement":o.placement})}const uht={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cht,data:{}};var Xv$2={passive:!0};function hht(r){var o=r.state,s=r.instance,a=r.options,l=a.scroll,c=l===void 0?!0:l,u=a.resize,d=u===void 0?!0:u,m=xi$2(o.elements.popper),g=[].concat(o.scrollParents.reference,o.scrollParents.popper);return c&&g.forEach(function(y){y.addEventListener("scroll",s.update,Xv$2)}),d&&m.addEventListener("resize",s.update,Xv$2),function(){c&&g.forEach(function(y){y.removeEventListener("scroll",s.update,Xv$2)}),d&&m.removeEventListener("resize",s.update,Xv$2)}}const pht={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:hht,data:{}};var dht={left:"right",right:"left",bottom:"top",top:"bottom"};function Yv$2(r){return r.replace(/left|right|bottom|top/g,function(o){return dht[o]})}var fht={start:"end",end:"start"};function VD$2(r){return r.replace(/start|end/g,function(o){return fht[o]})}function IS$2(r){var o=xi$2(r),s=o.pageXOffset,a=o.pageYOffset;return{scrollLeft:s,scrollTop:a}}function MS$2(r){return Dp$1($l$2(r)).left+IS$2(r).scrollLeft}function mht(r,o){var s=xi$2(r),a=$l$2(r),l=s.visualViewport,c=a.clientWidth,u=a.clientHeight,d=0,m=0;if(l){c=l.width,u=l.height;var g=DD$3();(g||!g&&o==="fixed")&&(d=l.offsetLeft,m=l.offsetTop)}return{width:c,height:u,x:d+MS$2(r),y:m}}function yht(r){var o,s=$l$2(r),a=IS$2(r),l=(o=r.ownerDocument)==null?void 0:o.body,c=yu$2(s.scrollWidth,s.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),u=yu$2(s.scrollHeight,s.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),d=-a.scrollLeft+MS$2(r),m=-a.scrollTop;return ha$2(l||s).direction==="rtl"&&(d+=yu$2(s.clientWidth,l?l.clientWidth:0)-c),{width:c,height:u,x:d,y:m}}function NS$2(r){var o=ha$2(r),s=o.overflow,a=o.overflowX,l=o.overflowY;return/auto|scroll|overlay|hidden/.test(s+l+a)}function zD$2(r){return["html","body","#document"].indexOf(mo$2(r))>=0?r.ownerDocument.body:Ki$2(r)&&NS$2(r)?r:zD$2(Wv$2(r))}function Jm$2(r,o){var s;o===void 0&&(o=[]);var a=zD$2(r),l=a===((s=r.ownerDocument)==null?void 0:s.body),c=xi$2(a),u=l?[c].concat(c.visualViewport||[],NS$2(a)?a:[]):a,d=o.concat(u);return l?d:d.concat(Jm$2(Wv$2(u)))}function OS$2(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function ght(r,o){var s=Dp$1(r,!1,o==="fixed");return s.top=s.top+r.clientTop,s.left=s.left+r.clientLeft,s.bottom=s.top+r.clientHeight,s.right=s.left+r.clientWidth,s.width=r.clientWidth,s.height=r.clientHeight,s.x=s.left,s.y=s.top,s}function HD$2(r,o,s){return o===kD$2?OS$2(mht(r,s)):mu$3(o)?ght(o,s):OS$2(yht($l$2(r)))}function vht(r){var o=Jm$2(Wv$2(r)),s=["absolute","fixed"].indexOf(ha$2(r).position)>=0,a=s&&Ki$2(r)?Xm$1(r):r;return mu$3(a)?o.filter(function(l){return mu$3(l)&&GD$2(l,a)&&mo$2(l)!=="body"}):[]}function bht(r,o,s,a){var l=o==="clippingParents"?vht(r):[].concat(o),c=[].concat(l,[s]),u=c[0],d=c.reduce(function(m,g){var y=HD$2(r,g,a);return m.top=yu$2(y.top,m.top),m.right=Hv$2(y.right,m.right),m.bottom=Hv$2(y.bottom,m.bottom),m.left=yu$2(y.left,m.left),m},HD$2(r,u,a));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}function WD$2(r){var o=r.reference,s=r.element,a=r.placement,l=a?yo(a):null,c=a?Gp$2(a):null,u=o.x+o.width/2-s.width/2,d=o.y+o.height/2-s.height/2,m;switch(l){case ii$3:m={x:u,y:o.y-s.height};break;case Zi$2:m={x:u,y:o.y+o.height};break;case Qi$2:m={x:o.x+o.width,y:d};break;case si$2:m={x:o.x-s.width,y:d};break;default:m={x:o.x,y:o.y}}var g=l?AS$2(l):null;if(g!=null){var y=g==="y"?"height":"width";switch(c){case Lp$2:m[g]=m[g]-(o[y]/2-s[y]/2);break;case Hm$2:m[g]=m[g]+(o[y]/2-s[y]/2);break}}return m}function gu$2(r,o){o===void 0&&(o={});var s=o,a=s.placement,l=a===void 0?r.placement:a,c=s.strategy,u=c===void 0?r.strategy:c,d=s.boundary,m=d===void 0?jut:d,g=s.rootBoundary,y=g===void 0?kD$2:g,_=s.elementContext,E=_===void 0?Wm$2:_,w=s.altBoundary,T=w===void 0?!1:w,k=s.padding,O=k===void 0?0:k,R=UD$2(typeof O!="number"?O:$D$2(O,zm$2)),M=E===Wm$2?Uut:Wm$2,N=r.rects.popper,D=r.elements[T?M:E],P=bht(mu$3(D)?D:D.contextElement||$l$2(r.elements.popper),m,y,u),I=Dp$1(r.elements.reference),L=WD$2({reference:I,element:N,strategy:"absolute",placement:l}),F=OS$2(Object.assign({},N,L)),U=E===Wm$2?F:I,J={top:P.top-U.top+R.top,bottom:U.bottom-P.bottom+R.bottom,left:P.left-U.left+R.left,right:U.right-P.right+R.right},z=r.modifiersData.offset;if(E===Wm$2&&z){var ie=z[l];Object.keys(J).forEach(function(ce){var Y=[Qi$2,Zi$2].indexOf(ce)>=0?1:-1,B=[ii$3,Zi$2].indexOf(ce)>=0?"y":"x";J[ce]+=ie[B]*Y})}return J}function _ht(r,o){o===void 0&&(o={});var s=o,a=s.placement,l=s.boundary,c=s.rootBoundary,u=s.padding,d=s.flipVariations,m=s.allowedAutoPlacements,g=m===void 0?PD$2:m,y=Gp$2(a),_=y?d?LD$2:LD$2.filter(function(T){return Gp$2(T)===y}):zm$2,E=_.filter(function(T){return g.indexOf(T)>=0});E.length===0&&(E=_);var w=E.reduce(function(T,k){return T[k]=gu$2(r,{placement:k,boundary:l,rootBoundary:c,padding:u})[yo(k)],T},{});return Object.keys(w).sort(function(T,k){return w[T]-w[k]})}function wht(r){if(yo(r)===xS$2)return[];var o=Yv$2(r);return[VD$2(r),o,VD$2(o)]}function xht(r){var o=r.state,s=r.options,a=r.name;if(!o.modifiersData[a]._skip){for(var l=s.mainAxis,c=l===void 0?!0:l,u=s.altAxis,d=u===void 0?!0:u,m=s.fallbackPlacements,g=s.padding,y=s.boundary,_=s.rootBoundary,E=s.altBoundary,w=s.flipVariations,T=w===void 0?!0:w,k=s.allowedAutoPlacements,O=o.options.placement,R=yo(O),M=R===O,N=m||(M||!T?[Yv$2(O)]:wht(O)),D=[O].concat(N).reduce(function(ft,yee){return ft.concat(yo(yee)===xS$2?_ht(o,{placement:yee,boundary:y,rootBoundary:_,padding:g,flipVariations:T,allowedAutoPlacements:k}):yee)},[]),P=o.rects.reference,I=o.rects.popper,L=new Map,F=!0,U=D[0],J=0;J=0,B=Y?"width":"height",V=gu$2(o,{placement:z,boundary:y,rootBoundary:_,altBoundary:E,padding:g}),Ge=Y?ce?Qi$2:si$2:ce?Zi$2:ii$3;P[B]>I[B]&&(Ge=Yv$2(Ge));var St=Yv$2(Ge),Dee=[];if(c&&Dee.push(V[ie]<=0),d&&Dee.push(V[Ge]<=0,V[St]<=0),Dee.every(function(ft){return ft})){U=z,F=!1;break}L.set(z,Dee)}if(F)for(var pee=T?3:1,jr=function(ft){var yee=D.find(function(ete){var xte=L.get(ete);if(xte)return xte.slice(0,ft).every(function(Ote){return Ote})});if(yee)return U=yee,"break"},Tee=pee;Tee>0;Tee--){var et=jr(Tee);if(et==="break")break}o.placement!==U&&(o.modifiersData[a]._skip=!0,o.placement=U,o.reset=!0)}}const Eht={name:"flip",enabled:!0,phase:"main",fn:xht,requiresIfExists:["offset"],data:{_skip:!1}};function XD$2(r,o,s){return s===void 0&&(s={x:0,y:0}),{top:r.top-o.height-s.y,right:r.right-o.width+s.x,bottom:r.bottom-o.height+s.y,left:r.left-o.width-s.x}}function YD$2(r){return[ii$3,Qi$2,Zi$2,si$2].some(function(o){return r[o]>=0})}function Tht(r){var o=r.state,s=r.name,a=o.rects.reference,l=o.rects.popper,c=o.modifiersData.preventOverflow,u=gu$2(o,{elementContext:"reference"}),d=gu$2(o,{altBoundary:!0}),m=XD$2(u,a),g=XD$2(d,l,c),y=YD$2(m),_=YD$2(g);o.modifiersData[s]={referenceClippingOffsets:m,popperEscapeOffsets:g,isReferenceHidden:y,hasPopperEscaped:_},o.attributes.popper=Object.assign({},o.attributes.popper,{"data-popper-reference-hidden":y,"data-popper-escaped":_})}const Sht={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Tht};function Aht(r,o,s){var a=yo(r),l=[si$2,ii$3].indexOf(a)>=0?-1:1,c=typeof s=="function"?s(Object.assign({},o,{placement:r})):s,u=c[0],d=c[1];return u=u||0,d=(d||0)*l,[si$2,Qi$2].indexOf(a)>=0?{x:d,y:u}:{x:u,y:d}}function Iht(r){var o=r.state,s=r.options,a=r.name,l=s.offset,c=l===void 0?[0,0]:l,u=PD$2.reduce(function(y,_){return y[_]=Aht(_,o.rects,c),y},{}),d=u[o.placement],m=d.x,g=d.y;o.modifiersData.popperOffsets!=null&&(o.modifiersData.popperOffsets.x+=m,o.modifiersData.popperOffsets.y+=g),o.modifiersData[a]=u}const Mht={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Iht};function Nht(r){var o=r.state,s=r.name;o.modifiersData[s]=WD$2({reference:o.rects.reference,element:o.rects.popper,strategy:"absolute",placement:o.placement})}const Oht={name:"popperOffsets",enabled:!0,phase:"read",fn:Nht,data:{}};function Cht(r){return r==="x"?"y":"x"}function Rht(r){var o=r.state,s=r.options,a=r.name,l=s.mainAxis,c=l===void 0?!0:l,u=s.altAxis,d=u===void 0?!1:u,m=s.boundary,g=s.rootBoundary,y=s.altBoundary,_=s.padding,E=s.tether,w=E===void 0?!0:E,T=s.tetherOffset,k=T===void 0?0:T,O=gu$2(o,{boundary:m,rootBoundary:g,padding:_,altBoundary:y}),R=yo(o.placement),M=Gp$2(o.placement),N=!M,D=AS$2(R),P=Cht(D),I=o.modifiersData.popperOffsets,L=o.rects.reference,F=o.rects.popper,U=typeof k=="function"?k(Object.assign({},o.rects,{placement:o.placement})):k,J=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),z=o.modifiersData.offset?o.modifiersData.offset[o.placement]:null,ie={x:0,y:0};if(I){if(c){var ce,Y=D==="y"?ii$3:si$2,B=D==="y"?Zi$2:Qi$2,V=D==="y"?"height":"width",Ge=I[D],St=Ge+O[Y],Dee=Ge-O[B],pee=w?-F[V]/2:0,jr=M===Lp$2?L[V]:F[V],Tee=M===Lp$2?-F[V]:-L[V],et=o.elements.arrow,ft=w&&et?SS$2(et):{width:0,height:0},yee=o.modifiersData["arrow#persistent"]?o.modifiersData["arrow#persistent"].padding:jD$2(),ete=yee[Y],xte=yee[B],Ote=Ym$2(0,L[V],ft[V]),nee=N?L[V]/2-pee-Ote-ete-J.mainAxis:jr-Ote-ete-J.mainAxis,Wee=N?-L[V]/2+pee+Ote+xte+J.mainAxis:Tee+Ote+xte+J.mainAxis,Bee=o.elements.arrow&&Xm$1(o.elements.arrow),Nte=Bee?D==="y"?Bee.clientTop||0:Bee.clientLeft||0:0,_ee=(ce=z?.[D])!=null?ce:0,st=Ge+nee-_ee-Nte,Lee=Ge+Wee-_ee,$te=Ym$2(w?Hv$2(St,st):St,Ge,w?yu$2(Dee,Lee):Dee);I[D]=$te,ie[D]=$te-Ge}if(d){var Kee,Iee=D==="x"?ii$3:si$2,Rte=D==="x"?Zi$2:Qi$2,dee=I[P],fee=P==="y"?"height":"width",Oee=dee+O[Iee],xee=dee-O[Rte],kee=[ii$3,si$2].indexOf(R)!==-1,Dte=(Kee=z?.[P])!=null?Kee:0,Ite=kee?Oee:dee-L[fee]-F[fee]-Dte+J.altAxis,Lte=kee?dee+L[fee]+F[fee]-Dte-J.altAxis:xee,Vte=w&&kee?nht(Ite,dee,Lte):Ym$2(w?Ite:Oee,dee,w?Lte:xee);I[P]=Vte,ie[P]=Vte-dee}o.modifiersData[a]=ie}}const kht={name:"preventOverflow",enabled:!0,phase:"main",fn:Rht,requiresIfExists:["offset"]};function Lht(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Pht(r){return r===xi$2(r)||!Ki$2(r)?IS$2(r):Lht(r)}function Dht(r){var o=r.getBoundingClientRect(),s=Pp$2(o.width)/r.offsetWidth||1,a=Pp$2(o.height)/r.offsetHeight||1;return s!==1||a!==1}function Ght(r,o,s){s===void 0&&(s=!1);var a=Ki$2(o),l=Ki$2(o)&&Dht(o),c=$l$2(o),u=Dp$1(r,l,s),d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(a||!a&&!s)&&((mo$2(o)!=="body"||NS$2(c))&&(d=Pht(o)),Ki$2(o)?(m=Dp$1(o,!0),m.x+=o.clientLeft,m.y+=o.clientTop):c&&(m.x=MS$2(c))),{x:u.left+d.scrollLeft-m.x,y:u.top+d.scrollTop-m.y,width:u.width,height:u.height}}function Fht(r){var o=new Map,s=new Set,a=[];r.forEach(function(c){o.set(c.name,c)});function l(c){s.add(c.name);var u=[].concat(c.requires||[],c.requiresIfExists||[]);u.forEach(function(d){if(!s.has(d)){var m=o.get(d);m&&l(m)}}),a.push(c)}return r.forEach(function(c){s.has(c.name)||l(c)}),a}function jht(r){var o=Fht(r);return qut.reduce(function(s,a){return s.concat(o.filter(function(l){return l.phase===a}))},[])}function Uht(r){var o;return function(){return o||(o=new Promise(function(s){Promise.resolve().then(function(){o=void 0,s(r())})})),o}}function $ht(r){var o=r.reduce(function(s,a){var l=s[a.name];return s[a.name]=l?Object.assign({},l,a,{options:Object.assign({},l.options,a.options),data:Object.assign({},l.data,a.data)}):a,s},{});return Object.keys(o).map(function(s){return o[s]})}var JD$2={placement:"bottom",modifiers:[],strategy:"absolute"};function qD$2(){for(var r=arguments.length,o=new Array(r),s=0;s{s.value.update()}));const m=()=>{o.value=!o.value,u.value._tippy.hide()},g=()=>{u.value._tippy.setProps({placement:o.value?d.tooltipPlacementAlt:d.tooltipPlacement}),u.value._tippy.show()},y=()=>{u.value._tippy.hide()};return qn$2(()=>{window.addEventListener("click",_=>{(!l.value||!l.value.contains(_.target))&&(o.value=!1)},{capture:!0}),window.addEventListener("blur",()=>{o.value=!1}),window.addEventListener("focusin",_=>{(!l.value||!l.value.contains(_.target))&&(o.value=!1)}),u.value.addEventListener("focus",g),u.value.addEventListener("blur",y),u.value.addEventListener("mouseover",g),u.value.addEventListener("mouseleave",y),Bi$2(()=>{const _={name:"overflowScroll",enabled:!0,phase:"main",fn({state:E}){const{bottom:w}=gu$2(E);w>0?(E.styles.popper.overflowY=w>100?"auto":void 0,E.styles.popper.overflowX="hidden",E.styles.popper.height=`${E.rects.popper.height-w-8}px`):E.styles.popper.height="auto"}};u.value&&c.value&&(s.value=ZD$2(u.value,c.value,{placement:d.position||"bottom",modifiers:[_,{name:"offset",options:{offset:[0,5]}}],...d.popperOptions}))})}),zi$1(()=>{a.forEach(_=>_()),window.removeEventListener("click",_=>{(!l.value||!l.value.contains(_.target))&&(o.value=!1)},{capture:!0}),window.removeEventListener("blur",()=>{o.value=!1}),window.removeEventListener("focusin",_=>{(!l.value||!l.value.contains(_.target))&&(o.value=!1)}),u.value.removeEventListener("focus",g),u.value.removeEventListener("blur",y),u.value.removeEventListener("mouseover",g),u.value.removeEventListener("mouseleave",y),o.value=!1}),(_,E)=>{const w=Ie$2("tippy");return pt$1(),wt("div",{ref_key:"el",ref:l},[Ae$1((pt$1(),wt("button",{type:"button",class:"text-gray-500 hover:text-black dropdown-button",onClick:m,content:r.tooltip,"aria-label":r.ariaLabel?String(r.ariaLabel):String(r.tooltip),ref_key:"dropdownTrigger",ref:u},[Hi$2(_.$slots,"header")],8,zht)),[[w,{placement:r.tooltipPlacement,theme:r.tooltipTheme,animation:r.tooltipAnimation,appendTo:"parent",trigger:"manual"}]]),Ae$1(lt$3("div",{onClick:E[0]||(E[0]=T=>s.value.update()),class:an$2(["rv-dropdown shadow-md border border-gray:200 py-8 bg-white rounded z-10",{"text-center":r.centered}]),ref_key:"dropdown",ref:c},[Hi$2(_.$slots,"default",{close:()=>o.value=!o.value})],2),[[Em$1,o.value]])],512)}}}),Cs$2=ln$1("notification",()=>{const r=tt$3([]),o=tt$3({}),s=te(()=>r.value.length>=99?99:r.value.length);function a(g){r.value=[g,...r.value]}function l(g){if(r.value.includes(g)){const y=r.value.indexOf(g);g instanceof QD$2&&m(g),y>-1&&r.value.splice(y,1)}}function c(g){o.value[g.id]=g}function u(g,y){o.value[g]&&(o.value[g].messageList.push(y),r.value.includes(o.value[g])||(r.value=[o.value[g],...r.value]))}function d(){Object.values(o.value).forEach(g=>m(g)),r.value=[]}function m(g){const y=r.value.indexOf(g);y>-1&&r.value.splice(y,1),g.messageList=[]}return{notificationStack:r,groups:o,notificationNumber:s,showNotification:a,removeNotification:l,registerGroup:c,addToGroup:u,clearAll:d}}),Hht={class:"h-full flex flex-col"},Wht={class:"w-full flex mb-6"},Xht=["content","aria-label"],Yht=ne$1({__name:"screen",props:{panel:{type:Object,required:!0}},setup(r){const o=Cs$2(),{t:s}=Ke$1(),a=te(()=>o.notificationNumber),l=()=>o.clearAll();return(c,u)=>{const d=vn$2("panel-screen"),m=Ie$2("tippy");return pt$1(),Be(d,{panel:r.panel},{header:gn$1(()=>[Ts$1($e$1(It$2(s)("notifications.title")),1)]),content:gn$1(()=>[lt$3("div",Hht,[lt$3("div",Wht,[Ae$1((pt$1(),wt("button",{type:"button",onClick:l,class:an$2(["p-4 ml-auto",[a.value?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:It$2(s)("notifications.controls.clearAll"),"aria-label":It$2(s)("notifications.controls.clearAll")},u[0]||(u[0]=[lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fill-current h-20 w-20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[lt$3("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),lt$3("path",{d:"M13 17h-9a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6a2 2 0 1 1 4 0a7 7 0 0 1 4 6v2"}),lt$3("path",{d:"M9 17v1a3 3 0 0 0 4.194 2.753"}),lt$3("path",{d:"M22 22l-5 -5"}),lt$3("path",{d:"M17 22l5 -5"})],-1)]),10,Xht)),[[m,{placement:"bottom",theme:"ramp4",animation:"scale"}]])]),Zt$2(KD$2,{class:"overflow-y-auto"})])]),_:1},8,["panel"])}}});var oi$1=(r=>(r.ERROR="error",r.INFO="info",r.WARNING="warning",r))(oi$1||{});class Jht extends Tn$2{notificationStore;constructor(o){super(o),this.$iApi.panel.register({id:"notifications",config:{screens:{"notifications-screen":yn$2(Yht)},alertName:"notifications.title"}}),this.notificationStore=Cs$2(this.$vApp.$pinia)}show(o,s){this.notificationStore.showNotification({type:o,message:s})}addGroup(o,s,a){if(this.getGroup(o))throw new Error("Duplicate notification group id registration: "+o);const l=new QD$2(this.$iApi,o,s,a);return this.notificationStore.registerGroup(l),l}getGroup(o){return this.notificationStore.groups[o]}}let QD$2=class extends Tn$2{notificationStore=Cs$2(this.$vApp.$pinia);id;message;type;messageList=[];constructor(o,s,a,l){super(o),this.id=s,this.type=a,this.message=l}show(o){this.notificationStore.addToGroup(this.id,o)}};const qht=["content"],Zht={class:"flex items-center text-left"},Qht={class:"select-text cursor-text"},Kht=["content"],tpt={key:0,class:"text-left"},ept=ne$1({__name:"notification-item",props:{notification:{type:Object,required:!0}},setup(r){const o=Cs$2(),{t:s}=Ke$1(),a=r,l=tt$3(!1),c=Vn$1({[oi$1.WARNING]:"⚠",[oi$1.INFO]:"ℹ️",[oi$1.ERROR]:"❌"}),u=m=>{o.removeNotification(m)},d=()=>{if(!a.notification.messageList)return!1};return(m,g)=>{const y=Ie$2("tippy");return Ae$1((pt$1(),wt("li",{class:an$2(["flex-col default-focus-style p-4",r.notification.messageList?"cursor-pointer":""]),content:It$2(s)(l.value?"notifications.controls.collapse":"notifications.controls.expand"),onClick:g[1]||(g[1]=_=>l.value=!l.value)},[lt$3("div",Zht,[lt$3("span",null,[Ts$1($e$1(c[r.notification.type])+" ",1),lt$3("span",Qht,$e$1(r.notification.message),1)]),g[4]||(g[4]=lt$3("span",{class:"flex-grow"},null,-1)),r.notification.messageList?(pt$1(),wt("div",{key:0,class:an$2(["dropdown-icon p-4 pointer-events-none",{"transform -rotate-180":l.value}])},g[2]||(g[2]=[lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[lt$3("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)]),2)):We$1("",!0),Ae$1((pt$1(),wt("button",{type:"button",onClick:g[0]||(g[0]=wp$3(_=>u(r.notification),["stop"])),class:"mx-4 p-4 text-gray-500 hover:text-black",content:It$2(s)("notifications.controls.dismiss")},g[3]||(g[3]=[lt$3("svg",{class:"fill-current",height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 105.16 122.88","fill-rule":"evenodd"},[lt$3("path",{d:"M11.17,37.16H94.65a8.4,8.4,0,0,1,2,.16,5.93,5.93,0,0,1,2.88,1.56,5.43,5.43,0,0,1,1.64,3.34,7.65,7.65,0,0,1-.06,1.44L94,117.31v0l0,.13,0,.28v0a7.06,7.06,0,0,1-.2.9v0l0,.06v0a5.89,5.89,0,0,1-5.47,4.07H17.32a6.17,6.17,0,0,1-1.25-.19,6.17,6.17,0,0,1-1.16-.48h0a6.18,6.18,0,0,1-3.08-4.88l-7-73.49a7.69,7.69,0,0,1-.06-1.66,5.37,5.37,0,0,1,1.63-3.29,6,6,0,0,1,3-1.58,8.94,8.94,0,0,1,1.79-.13ZM5.65,8.8H37.12V6h0a2.44,2.44,0,0,1,0-.27,6,6,0,0,1,1.76-4h0A6,6,0,0,1,43.09,0H62.46l.3,0a6,6,0,0,1,5.7,6V6h0V8.8h32l.39,0a4.7,4.7,0,0,1,4.31,4.43c0,.18,0,.32,0,.5v9.86a2.59,2.59,0,0,1-2.59,2.59H2.59A2.59,2.59,0,0,1,0,23.62V13.53H0a1.56,1.56,0,0,1,0-.31v0A4.72,4.72,0,0,1,3.88,8.88,10.4,10.4,0,0,1,5.65,8.8Zm42.1,52.7a4.77,4.77,0,0,1,9.49,0v37a4.77,4.77,0,0,1-9.49,0v-37Zm23.73-.2a4.58,4.58,0,0,1,5-4.06,4.47,4.47,0,0,1,4.51,4.46l-2,37a4.57,4.57,0,0,1-5,4.06,4.47,4.47,0,0,1-4.51-4.46l2-37ZM25,61.7a4.46,4.46,0,0,1,4.5-4.46,4.58,4.58,0,0,1,5,4.06l2,37a4.47,4.47,0,0,1-4.51,4.46,4.57,4.57,0,0,1-5-4.06l-2-37Z"})],-1)]),8,Kht)),[[y,{theme:"ramp4",animation:"scale"}]])]),r.notification.messageList&&l.value?(pt$1(),wt("div",tpt,[(pt$1(!0),wt(ke$1,null,ta$3(r.notification.messageList,(_,E)=>(pt$1(),wt("p",{key:r.notification.id+_+E},$e$1(_),1))),128))])):We$1("",!0)],10,qht)),[[y,{onShow:d,theme:"ramp4",animation:"scale"}]])}}}),npt=["content"],rpt={key:0,class:"w-full border-b border-black"},ipt={key:1,class:"flex flex-col items-center h-full"},KD$2=ne$1({__name:"notification-list",setup(r){const o=Cs$2(),{t:s}=Ke$1(),a=tt$3(),l=()=>{a.value._tippy.hide()},c=d=>{d.key==="Tab"&&a.value?.matches(":focus")&&a.value._tippy.show()};qn$2(()=>{a.value?.addEventListener("blur",l),a.value?.addEventListener("keyup",c)}),zi$1(()=>{a.value?.removeEventListener("blur",l),a.value?.removeEventListener("keyup",c)});const u=te(()=>o.notificationStack);return(d,m)=>{const g=Ie$2("focus-item"),y=Ie$2("focus-list"),_=Ie$2("tippy");return pt$1(),wt("div",null,[u.value.length>0?Ae$1((pt$1(),wt("ul",{key:0,content:It$2(s)("panels.controls.items"),ref_key:"el",ref:a},[(pt$1(!0),wt(ke$1,null,ta$3(u.value,(E,w)=>(pt$1(),wt(ke$1,{key:E.message+w},[w>0?(pt$1(),wt("div",rpt)):We$1("",!0),Ae$1(Zt$2(ept,{class:an$2([E.type]),notification:E},null,8,["class","notification"]),[[g]])],64))),128))],8,npt)),[[y],[_,{trigger:"manual",placement:"top-start",touch:!1}]]):(pt$1(),wt("div",ipt,[m[0]||(m[0]=lt$3("span",{class:"flex-grow"},null,-1)),m[1]||(m[1]=lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-48 w-48 fill-current"},[lt$3("path",{d:"M0 0h24v24H0z",fill:"none"}),lt$3("path",{d:"M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"})],-1)),lt$3("span",null,$e$1(It$2(s)("notifications.empty")),1),m[2]||(m[2]=lt$3("span",{style:{"flex-grow":"6"}},null,-1))]))])}}}),spt={class:"flex items-center hover:text-white"},opt=["aria-label"],apt={key:0,class:"number rounded-full w-18 text-white"},lpt={class:"notification-dropdown pointer-events-auto bg-white rounded text-center text-black w-500 h-256 flex flex-col p-0"},cpt={class:"pb-8 border-b border-gray-600"},upt={class:"absolute flex right-3 top-3"},hpt=["content","aria-label"],ppt=ne$1({__name:"caption-button",setup(r){const o=Cs$2(),{t:s}=Ke$1(),a=te(()=>o.notificationNumber),l=()=>o.clearAll();return(c,u)=>{const d=vn$2("close"),m=Ie$2("tippy");return pt$1(),Be(CS$2,{position:"top-start",tooltip:It$2(s)("notifications.title"),tooltipPlacement:"top",class:"pointer-events-auto sm:flex ml-4 mr-8"},{header:gn$1(()=>[lt$3("div",spt,[(pt$1(),wt("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-label":It$2(s)("notifications.open")},u[0]||(u[0]=[lt$3("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"},null,-1)]),8,opt)),a.value&&a.value>0?(pt$1(),wt("span",apt,$e$1(a.value),1)):We$1("",!0)])]),default:gn$1(g=>[lt$3("div",lpt,[lt$3("div",null,[lt$3("h4",cpt,$e$1(It$2(s)("notifications.title")),1),lt$3("div",upt,[Ae$1((pt$1(),wt("button",{type:"button",onClick:l,class:an$2(["p-4 mr-6",[a.value?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:It$2(s)("notifications.controls.clearAll"),"aria-label":It$2(s)("notifications.controls.clearAll")},u[1]||(u[1]=[lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fill-current h-20 w-20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[lt$3("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),lt$3("path",{d:"M13 17h-9a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6a2 2 0 1 1 4 0a7 7 0 0 1 4 6v2"}),lt$3("path",{d:"M9 17v1a3 3 0 0 0 4.194 2.753"}),lt$3("path",{d:"M22 22l-5 -5"}),lt$3("path",{d:"M17 22l5 -5"})],-1)]),10,hpt)),[[m,{placement:"bottom",theme:"ramp4",animation:"scale",appendTo:"parent"}]]),Zt$2(d,{onClick:g.close},null,8,["onClick"])])]),Zt$2(KD$2,{class:"overflow-y-auto h-230"})])]),_:1},8,["tooltip"])}}}),dpt=fo$2(ppt,[["__scopeId","data-v-3623a7d2"]]),fpt={class:"flex hover:text-white"},mpt=["aria-label"],ypt={class:"about-ramp-dropdown pointer-events-auto bg-white rounded w-256 h-50"},gpt={class:"pb-8 border-b border-gray-600 mb-10"},vpt={class:"absolute right-5 top-5"},bpt={class:"select-text"},_pt={class:"font-bold cursor-text"},wpt={class:"text-sm cursor-text"},xpt={class:"text-sm cursor-text"},Ept=ne$1({__name:"about-ramp-dropdown",props:{position:{type:String,default:"top-start"}},setup(r){const{t:o}=Ke$1(),s=te(()=>`${rd$2.major}.${rd$2.minor}.${rd$2.patch}`),a=te(()=>rd$2.hash.slice(0,9)),l=te(()=>{let c=new Date(rd$2.timestamp);if(isNaN(c))return"dev mode, no date";{const u=d=>d<10?"0"+d.toString():d.toString();return`${c.getFullYear()}-${c.getMonth()+1}-${c.getDate()} ${c.getHours()}:${u(c.getMinutes())}:${u(c.getSeconds())}`}});return(c,u)=>{const d=vn$2("close"),m=vn$2("dropdown-menu"),g=Ie$2("focus-item");return Ae$1((pt$1(),Be(m,{class:"pointer-events-auto sm:flex",position:r.position,tooltip:It$2(o)("ramp.about"),tooltipPlacement:r.position},{header:gn$1(()=>[lt$3("div",fpt,[(pt$1(),wt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20","aria-label":It$2(o)("ramp.about.open")},u[0]||(u[0]=[lt$3("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"},null,-1)]),8,mpt))])]),default:gn$1(y=>[lt$3("div",ypt,[lt$3("div",null,[lt$3("h4",gpt,$e$1(It$2(o)("ramp.about")),1),lt$3("div",vpt,[Zt$2(d,{onClick:y.close},null,8,["onClick"])]),lt$3("div",bpt,[lt$3("div",null,[lt$3("span",_pt,$e$1(s.value),1),lt$3("span",wpt," ["+$e$1(a.value)+"] ",1)]),lt$3("div",null,[lt$3("span",xpt,$e$1(l.value),1)]),u[1]||(u[1]=lt$3("div",{class:"mt-5"},[lt$3("a",{class:"text-sm underline text-blue-600",href:"https://github.com/ramp4-pcar4/ramp4-pcar4",target:"_blank"},[lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"inline-block fill-black w-16 h-16"},[lt$3("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})]),Ts$1(" ramp4-pcar4 ")])],-1))])])])]),_:1},8,["position","tooltip","tooltipPlacement"])),[[g]])}}}),t7$1=fo$2(Ept,[["__scopeId","data-v-dd0345a4"]]),Tpt={class:"map-caption absolute bottom-0 h-29 sm:h-38 flex justify-end pointer-events-auto cursor-default select-none text-gray-200 bg-black-75 left-0 right-0 py-2 sm:py-6"},Spt={key:0,class:"relative top-2 sm:top-1 ml-4 sm:ml-0 shrink-0"},Apt=["href","aria-label"],Ipt=["src","alt"],Mpt={key:1,class:"relative ml-10 top-2 text-sm sm:text-base"},Npt={class:"flex min-w-fit justify-end"},Opt={key:0,class:"pl-8 px-14 sm:block display-none relative top-2"},Cpt=["aria-pressed","aria-label","content"],Rpt={class:"relative top-1 text-sm sm:text-base"},kpt={class:"text-gray-200 hover:text-white text-sm sm:text-base pb-5"},Lpt=["onClick"],Ppt={key:0,class:"sr-only"},Dpt=ne$1({__name:"map-caption",setup(r){const o=Ll$2(),s=Dr$2(),{t:a}=Ke$1(),l=Pn$2("iApi"),c=te(()=>o.scale),u=te(()=>o.attribution),d=te(()=>o.coords),m=te(()=>o.langtoggle),g=te(()=>s.config.map),y=tt$3([]),_=Vn$1([]);_.push(Hn$2(g,k=>{k&&l.geo.map.caption.createCaption(g.value?.caption)})),zi$1(()=>{_.forEach(k=>k())}),Kc$2(()=>{Bi$2(()=>{l.$i18n.locale.value&&y.value.length==0&&(y.value=l.$i18n.availableLocales)})});const E=k=>{l.$i18n.locale.value!=k&&l.setLanguage(k)},w=()=>{o.toggleScale(),l.geo.map.caption.updateScale()},T=(k=!1)=>a(k?"map.toggleScaleToMetric":"map.toggleScaleToImperial");return(k,O)=>{const R=vn$2("dropdown-menu"),M=Ie$2("truncate"),N=Ie$2("tippy");return pt$1(),wt("div",Tpt,[Zt$2(t7$1,{class:"sm:block display-none ml-8 mr-4",position:"top-end"}),Zt$2(dpt,{class:"sm:block display-none"}),u.value?.logo.disabled?We$1("",!0):(pt$1(),wt("span",Spt,[lt$3("a",{class:"pointer-events-auto cursor-pointer",href:u.value?.logo.link,target:"_blank","aria-label":u.value?.logo.altText},[lt$3("img",{class:"object-contain h-18 sm:h-26",src:u.value?.logo.value,alt:u.value?.logo.altText},null,8,Ipt)],8,Apt)])),u.value?.text.disabled?We$1("",!0):Ae$1((pt$1(),wt("span",Mpt,[Ts$1($e$1(u.value?.text.value),1)])),[[M,{options:{placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),O[0]||(O[0]=lt$3("span",{class:"flex-grow w-15"},null,-1)),lt$3("div",Npt,[d.value?.disabled?We$1("",!0):Ae$1((pt$1(),wt("div",Opt,[Ts$1($e$1(d.value?.formattedString),1)])),[[M,{options:{hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),c.value?.disabled?We$1("",!0):Ae$1((pt$1(),wt("button",{key:1,type:"button",class:"flex-shrink-0 mx-2 sm:mx-10 px-4 pointer-events-auto cursor-pointer border-none",onClick:w,"aria-pressed":c.value?.isImperialScale,"aria-label":` - ${c.value?.label} - ${T(c.value?.isImperialScale)} - `,content:T(c.value?.isImperialScale)},[lt$3("span",{class:"border-solid border-2 border-white border-t-0 h-5 mr-4 inline-block",style:Wo$1({width:c.value?.width})},null,4),lt$3("span",Rpt,$e$1(c.value?.label),1)],8,Cpt)),[[N,{delay:[300,0],placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale",touch:["hold",200]}]]),m.value?.disabled?We$1("",!0):(pt$1(),Be(R,{key:2,class:"flex-shrink-0 pointer-events-auto focus:outline-none px-4 mr-4 relative top-2",position:"top-end",tooltip:It$2(a)("map.changeLanguage"),ariaLabel:`${It$2(a)("map.language.short")} - ${It$2(a)("map.changeLanguage")}`,tooltipPlacement:"top-start",tooltipPlacementAlt:"left-end"},{header:gn$1(()=>[lt$3("span",kpt,$e$1(It$2(a)("map.language.short")),1)]),default:gn$1(()=>[(pt$1(!0),wt(ke$1,null,ta$3(y.value,(D,P)=>(pt$1(),wt("a",{key:`${D}-${P}`,class:an$2(["flex-auto items-center text-sm sm:text-base cursor-pointer",{"font-bold":D===It$2(l).$i18n.locale.value}]),href:"javascript:;",onClick:I=>E(D)},[Ts$1($e$1(It$2(a)("map.language."+D))+" ",1),D===It$2(l).$i18n.locale.value?(pt$1(),wt("span",Ppt,$e$1(It$2(a)("map.language.curr")),1)):We$1("",!0)],10,Lpt))),128))]),_:1},8,["tooltip","ariaLabel"]))])])}}}),Gpt=["content","aria-label"],Fpt={key:0,class:"number absolute -top-2 -right-2 text-white w-18 rounded-full"},jpt=ne$1({__name:"floating-button",setup(r){const o=Cs$2(),s=Pn$2("iApi"),{t:a}=Ke$1(),l=te(()=>o.notificationNumber);return(c,u)=>{const d=Ie$2("tippy");return Ae$1((pt$1(),wt("button",{type:"button",onClick:u[0]||(u[0]=m=>It$2(s).panel.get("notifications").open()),class:"pointer-events-auto items-center absolute left-8 bottom-36 p-6 block sm:display-none bg-black-75 rounded-full text-gray-400 hover:text-white",content:It$2(a)("notifications.title"),"aria-label":It$2(a)("notifications.title")},[u[1]||(u[1]=lt$3("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[lt$3("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),l.value&&l.value>0?(pt$1(),wt("span",Fpt,$e$1(l.value),1)):We$1("",!0)],8,Gpt)),[[d]])}}}),Upt=fo$2(jpt,[["__scopeId","data-v-a451db5c"]]),$pt={class:"flex items-center mb-20"},Bpt={class:"text-xl"},Vpt=ne$1({__name:"keyboard-instructions",setup(r){const o=Pn$2("iApi"),{t:s}=Ke$1(),a=tt$3(!1),l=tt$3(["app","lists","map"]),c=tt$3([]),u=tt$3(null),d=tt$3(null);qn$2(()=>{c.value.push(o.event.on("openKeyboardInstructions",()=>{a.value=!0,Bi$2(()=>{u.value.focus()})}))}),zi$1(()=>{c.value.forEach(g=>o?.event.off(g))});const m=g=>{g.key==="Tab"?g.shiftKey&&g.target===u.value?(g.preventDefault(),d.value.focus()):!g.shiftKey&&g.target===d.value&&(g.preventDefault(),u.value.focus()):g.key==="Escape"&&(g.preventDefault(),a.value=!1)};return(g,y)=>{const _=vn$2("close");return a.value?(pt$1(),wt("div",{key:0,class:"absolute inset-0 flex justify-center items-center bg-opacity-30 bg-black z-50 pointer-events-auto",onClick:y[3]||(y[3]=E=>a.value=!1),onKeydown:m},[lt$3("div",{class:"bg-white w-500 pointer-events-auto shadow-2xl p-20 flex flex-col",onClick:y[2]||(y[2]=wp$3(()=>{},["stop","prevent"])),tabindex:"0",ref_key:"firstEl",ref:u},[lt$3("div",$pt,[lt$3("h2",Bpt,$e$1(It$2(s)("keyboardInstructions.title")),1),Zt$2(_,{class:"ml-auto",onClick:y[0]||(y[0]=E=>a.value=!1)})]),(pt$1(!0),wt(ke$1,null,ta$3(l.value,E=>(pt$1(),wt("p",{class:"whitespace-pre-line pb-10",key:E},$e$1(It$2(s)(`keyboardInstructions.${E}`)),1))),128)),lt$3("button",{type:"button",class:"mt-auto self-end mr-10 mb-10 px-20 py-10",onClick:y[1]||(y[1]=E=>a.value=!1),ref_key:"lastEl",ref:d},$e$1(It$2(s)("keyboardInstructions.OK")),513)],512)],32)):We$1("",!0)}}}),Fp$2=ln$1("instance",()=>({started:tt$3(!1)})),zpt={class:"h-full relative"},Hpt={class:"inner-shell absolute top-0 left-0 h-full w-full pointer-events-none"},Wpt={class:"absolute top-8 w-full flex justify-center"},Xpt={key:1,class:"w-full h-full"},Ypt=ne$1({__name:"shell",setup(r){const o=Pn$2("iApi"),s=Fp$2(),a=Ji$2(),l=Ul$2(),{t:c}=Ke$1(),u=te(()=>a.items.appbar),d=()=>{o?.event.emit("openKeyboardInstructions")},m=()=>l.teleported;return(g,y)=>(pt$1(),wt("div",zpt,[lt$3("div",Hpt,[y[0]||(y[0]=lt$3("div",{class:"sr-only screen-reader-alert"},null,-1)),lt$3("div",Wpt,[lt$3("button",{type:"button",class:"bg-white hidden-until-focus z-50 shadow-md px-10",onClick:d},$e$1(It$2(c)("keyboardInstructions.open")),1)]),Zt$2(Vpt),Zt$2(Fut,{class:"panel-stack sm:flex absolute inset-0 overflow-hidden sm:p-12 z-10 sm:pl-80 xs:pl-40 sm:pb-48 xs:pb-28 xs:pr-0 sm:pr-40"}),u.value?We$1("",!0):(pt$1(),Be(Upt,{key:0})),Zt$2(Dpt,{class:"z-30"})]),It$2(s).started?(pt$1(),Be(aut,{key:0})):(pt$1(),wt("div",Xpt,y[1]||(y[1]=[lt$3("div",{class:"spinner relative inset-x-1/2 inset-y-9/20"},null,-1)]))),(pt$1(!0),wt(ke$1,null,ta$3(m(),_=>(pt$1(),Be(cT$2,{to:_.teleport?.target,key:_.id},[(pt$1(),Be(RD$2,{key:`${_.id}`,panel:_},null,8,["panel"]))],8,["to"]))),128))]))}}),Jpt=fo$2(Ypt,[["__scopeId","data-v-6c131943"]]);var ai$2="top",ts$3="bottom",es$2="right",li$2="left",RS$2="auto",qm$1=[ai$2,ts$3,es$2,li$2],jp$2="start",Zm$2="end",qpt="clippingParents",e7$1="viewport",Qm$2="popper",Zpt="reference",n7$1=qm$1.reduce(function(r,o){return r.concat([o+"-"+jp$2,o+"-"+Zm$2])},[]),r7$1=[].concat(qm$1,[RS$2]).reduce(function(r,o){return r.concat([o,o+"-"+jp$2,o+"-"+Zm$2])},[]),Qpt="beforeRead",Kpt="read",tdt="afterRead",edt="beforeMain",ndt="main",rdt="afterMain",idt="beforeWrite",sdt="write",odt="afterWrite",adt=[Qpt,Kpt,tdt,edt,ndt,rdt,idt,sdt,odt];function go$2(r){return r?(r.nodeName||"").toLowerCase():null}function Rs$2(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var o=r.ownerDocument;return o&&o.defaultView||window}return r}function Up$2(r){var o=Rs$2(r).Element;return r instanceof o||r instanceof Element}function ns$2(r){var o=Rs$2(r).HTMLElement;return r instanceof o||r instanceof HTMLElement}function i7$1(r){if(typeof ShadowRoot>"u")return!1;var o=Rs$2(r).ShadowRoot;return r instanceof o||r instanceof ShadowRoot}function ldt(r){var o=r.state;Object.keys(o.elements).forEach(function(s){var a=o.styles[s]||{},l=o.attributes[s]||{},c=o.elements[s];!ns$2(c)||!go$2(c)||(Object.assign(c.style,a),Object.keys(l).forEach(function(u){var d=l[u];d===!1?c.removeAttribute(u):c.setAttribute(u,d===!0?"":d)}))})}function cdt(r){var o=r.state,s={popper:{position:o.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(o.elements.popper.style,s.popper),o.styles=s,o.elements.arrow&&Object.assign(o.elements.arrow.style,s.arrow),function(){Object.keys(o.elements).forEach(function(a){var l=o.elements[a],c=o.attributes[a]||{},u=Object.keys(o.styles.hasOwnProperty(a)?o.styles[a]:s[a]),d=u.reduce(function(m,g){return m[g]="",m},{});!ns$2(l)||!go$2(l)||(Object.assign(l.style,d),Object.keys(c).forEach(function(m){l.removeAttribute(m)}))})}}var s7$1={name:"applyStyles",enabled:!0,phase:"write",fn:ldt,effect:cdt,requires:["computeStyles"]};function vo$2(r){return r.split("-")[0]}var vu$2=Math.max,Jv$2=Math.min,$p$2=Math.round;function Bp$2(r,o){o===void 0&&(o=!1);var s=r.getBoundingClientRect(),a=1,l=1;if(ns$2(r)&&o){var c=r.offsetHeight,u=r.offsetWidth;u>0&&(a=$p$2(s.width)/u||1),c>0&&(l=$p$2(s.height)/c||1)}return{width:s.width/a,height:s.height/l,top:s.top/l,right:s.right/a,bottom:s.bottom/l,left:s.left/a,x:s.left/a,y:s.top/l}}function kS$1(r){var o=Bp$2(r),s=r.offsetWidth,a=r.offsetHeight;return Math.abs(o.width-s)<=1&&(s=o.width),Math.abs(o.height-a)<=1&&(a=o.height),{x:r.offsetLeft,y:r.offsetTop,width:s,height:a}}function o7$1(r,o){var s=o.getRootNode&&o.getRootNode();if(r.contains(o))return!0;if(s&&i7$1(s)){var a=o;do{if(a&&r.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function bo$2(r){return Rs$2(r).getComputedStyle(r)}function udt(r){return["table","td","th"].indexOf(go$2(r))>=0}function Bl$2(r){return((Up$2(r)?r.ownerDocument:r.document)||window.document).documentElement}function qv$1(r){return go$2(r)==="html"?r:r.assignedSlot||r.parentNode||(i7$1(r)?r.host:null)||Bl$2(r)}function a7$1(r){return!ns$2(r)||bo$2(r).position==="fixed"?null:r.offsetParent}function hdt(r){var o=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,s=navigator.userAgent.indexOf("Trident")!==-1;if(s&&ns$2(r)){var a=bo$2(r);if(a.position==="fixed")return null}for(var l=qv$1(r);ns$2(l)&&["html","body"].indexOf(go$2(l))<0;){var c=bo$2(l);if(c.transform!=="none"||c.perspective!=="none"||c.contain==="paint"||["transform","perspective"].indexOf(c.willChange)!==-1||o&&c.willChange==="filter"||o&&c.filter&&c.filter!=="none")return l;l=l.parentNode}return null}function Km$2(r){for(var o=Rs$2(r),s=a7$1(r);s&&udt(s)&&bo$2(s).position==="static";)s=a7$1(s);return s&&(go$2(s)==="html"||go$2(s)==="body"&&bo$2(s).position==="static")?o:s||hdt(r)||o}function LS$2(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function t0$2(r,o,s){return vu$2(r,Jv$2(o,s))}function pdt(r,o,s){var a=t0$2(r,o,s);return a>s?s:a}function l7$1(){return{top:0,right:0,bottom:0,left:0}}function c7$1(r){return Object.assign({},l7$1(),r)}function u7$1(r,o){return o.reduce(function(s,a){return s[a]=r,s},{})}var ddt=function(r,o){return r=typeof r=="function"?r(Object.assign({},o.rects,{placement:o.placement})):r,c7$1(typeof r!="number"?r:u7$1(r,qm$1))};function fdt(r){var o,s=r.state,a=r.name,l=r.options,c=s.elements.arrow,u=s.modifiersData.popperOffsets,d=vo$2(s.placement),m=LS$2(d),g=[li$2,es$2].indexOf(d)>=0,y=g?"height":"width";if(!(!c||!u)){var _=ddt(l.padding,s),E=kS$1(c),w=m==="y"?ai$2:li$2,T=m==="y"?ts$3:es$2,k=s.rects.reference[y]+s.rects.reference[m]-u[m]-s.rects.popper[y],O=u[m]-s.rects.reference[m],R=Km$2(c),M=R?m==="y"?R.clientHeight||0:R.clientWidth||0:0,N=k/2-O/2,D=_[w],P=M-E[y]-_[T],I=M/2-E[y]/2+N,L=t0$2(D,I,P),F=m;s.modifiersData[a]=(o={},o[F]=L,o.centerOffset=L-I,o)}}function mdt(r){var o=r.state,s=r.options,a=s.element,l=a===void 0?"[data-popper-arrow]":a;l!=null&&(typeof l=="string"&&(l=o.elements.popper.querySelector(l),!l)||o7$1(o.elements.popper,l)&&(o.elements.arrow=l))}var ydt={name:"arrow",enabled:!0,phase:"main",fn:fdt,effect:mdt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Vp$1(r){return r.split("-")[1]}var gdt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function vdt(r){var o=r.x,s=r.y,a=window,l=a.devicePixelRatio||1;return{x:$p$2(o*l)/l||0,y:$p$2(s*l)/l||0}}function h7$1(r){var o,s=r.popper,a=r.popperRect,l=r.placement,c=r.variation,u=r.offsets,d=r.position,m=r.gpuAcceleration,g=r.adaptive,y=r.roundOffsets,_=r.isFixed,E=y===!0?vdt(u):typeof y=="function"?y(u):u,w=E.x,T=w===void 0?0:w,k=E.y,O=k===void 0?0:k,R=u.hasOwnProperty("x"),M=u.hasOwnProperty("y"),N=li$2,D=ai$2,P=window;if(g){var I=Km$2(s),L="clientHeight",F="clientWidth";if(I===Rs$2(s)&&(I=Bl$2(s),bo$2(I).position!=="static"&&d==="absolute"&&(L="scrollHeight",F="scrollWidth")),I=I,l===ai$2||(l===li$2||l===es$2)&&c===Zm$2){D=ts$3;var U=_&&P.visualViewport?P.visualViewport.height:I[L];O-=U-a.height,O*=m?1:-1}if(l===li$2||(l===ai$2||l===ts$3)&&c===Zm$2){N=es$2;var J=_&&P.visualViewport?P.visualViewport.width:I[F];T-=J-a.width,T*=m?1:-1}}var z=Object.assign({position:d},g&&gdt);if(m){var ie;return Object.assign({},z,(ie={},ie[D]=M?"0":"",ie[N]=R?"0":"",ie.transform=(P.devicePixelRatio||1)<=1?"translate("+T+"px, "+O+"px)":"translate3d("+T+"px, "+O+"px, 0)",ie))}return Object.assign({},z,(o={},o[D]=M?O+"px":"",o[N]=R?T+"px":"",o.transform="",o))}function bdt(r){var o=r.state,s=r.options,a=s.gpuAcceleration,l=a===void 0?!0:a,c=s.adaptive,u=c===void 0?!0:c,d=s.roundOffsets,m=d===void 0?!0:d,g={placement:vo$2(o.placement),variation:Vp$1(o.placement),popper:o.elements.popper,popperRect:o.rects.popper,gpuAcceleration:l,isFixed:o.options.strategy==="fixed"};o.modifiersData.popperOffsets!=null&&(o.styles.popper=Object.assign({},o.styles.popper,h7$1(Object.assign({},g,{offsets:o.modifiersData.popperOffsets,position:o.options.strategy,adaptive:u,roundOffsets:m})))),o.modifiersData.arrow!=null&&(o.styles.arrow=Object.assign({},o.styles.arrow,h7$1(Object.assign({},g,{offsets:o.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:m})))),o.attributes.popper=Object.assign({},o.attributes.popper,{"data-popper-placement":o.placement})}var _dt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:bdt,data:{}},Zv$2={passive:!0};function wdt(r){var o=r.state,s=r.instance,a=r.options,l=a.scroll,c=l===void 0?!0:l,u=a.resize,d=u===void 0?!0:u,m=Rs$2(o.elements.popper),g=[].concat(o.scrollParents.reference,o.scrollParents.popper);return c&&g.forEach(function(y){y.addEventListener("scroll",s.update,Zv$2)}),d&&m.addEventListener("resize",s.update,Zv$2),function(){c&&g.forEach(function(y){y.removeEventListener("scroll",s.update,Zv$2)}),d&&m.removeEventListener("resize",s.update,Zv$2)}}var xdt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wdt,data:{}},Edt={left:"right",right:"left",bottom:"top",top:"bottom"};function Qv$2(r){return r.replace(/left|right|bottom|top/g,function(o){return Edt[o]})}var Tdt={start:"end",end:"start"};function p7$1(r){return r.replace(/start|end/g,function(o){return Tdt[o]})}function PS$2(r){var o=Rs$2(r),s=o.pageXOffset,a=o.pageYOffset;return{scrollLeft:s,scrollTop:a}}function DS$2(r){return Bp$2(Bl$2(r)).left+PS$2(r).scrollLeft}function Sdt(r){var o=Rs$2(r),s=Bl$2(r),a=o.visualViewport,l=s.clientWidth,c=s.clientHeight,u=0,d=0;return a&&(l=a.width,c=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(u=a.offsetLeft,d=a.offsetTop)),{width:l,height:c,x:u+DS$2(r),y:d}}function Adt(r){var o,s=Bl$2(r),a=PS$2(r),l=(o=r.ownerDocument)==null?void 0:o.body,c=vu$2(s.scrollWidth,s.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),u=vu$2(s.scrollHeight,s.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),d=-a.scrollLeft+DS$2(r),m=-a.scrollTop;return bo$2(l||s).direction==="rtl"&&(d+=vu$2(s.clientWidth,l?l.clientWidth:0)-c),{width:c,height:u,x:d,y:m}}function GS$2(r){var o=bo$2(r),s=o.overflow,a=o.overflowX,l=o.overflowY;return/auto|scroll|overlay|hidden/.test(s+l+a)}function d7$1(r){return["html","body","#document"].indexOf(go$2(r))>=0?r.ownerDocument.body:ns$2(r)&&GS$2(r)?r:d7$1(qv$1(r))}function e0$2(r,o){var s;o===void 0&&(o=[]);var a=d7$1(r),l=a===((s=r.ownerDocument)==null?void 0:s.body),c=Rs$2(a),u=l?[c].concat(c.visualViewport||[],GS$2(a)?a:[]):a,d=o.concat(u);return l?d:d.concat(e0$2(qv$1(u)))}function FS$1(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function Idt(r){var o=Bp$2(r);return o.top=o.top+r.clientTop,o.left=o.left+r.clientLeft,o.bottom=o.top+r.clientHeight,o.right=o.left+r.clientWidth,o.width=r.clientWidth,o.height=r.clientHeight,o.x=o.left,o.y=o.top,o}function f7$1(r,o){return o===e7$1?FS$1(Sdt(r)):Up$2(o)?Idt(o):FS$1(Adt(Bl$2(r)))}function Mdt(r){var o=e0$2(qv$1(r)),s=["absolute","fixed"].indexOf(bo$2(r).position)>=0,a=s&&ns$2(r)?Km$2(r):r;return Up$2(a)?o.filter(function(l){return Up$2(l)&&o7$1(l,a)&&go$2(l)!=="body"&&(s?bo$2(l).position!=="static":!0)}):[]}function Ndt(r,o,s){var a=o==="clippingParents"?Mdt(r):[].concat(o),l=[].concat(a,[s]),c=l[0],u=l.reduce(function(d,m){var g=f7$1(r,m);return d.top=vu$2(g.top,d.top),d.right=Jv$2(g.right,d.right),d.bottom=Jv$2(g.bottom,d.bottom),d.left=vu$2(g.left,d.left),d},f7$1(r,c));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function m7$1(r){var o=r.reference,s=r.element,a=r.placement,l=a?vo$2(a):null,c=a?Vp$1(a):null,u=o.x+o.width/2-s.width/2,d=o.y+o.height/2-s.height/2,m;switch(l){case ai$2:m={x:u,y:o.y-s.height};break;case ts$3:m={x:u,y:o.y+o.height};break;case es$2:m={x:o.x+o.width,y:d};break;case li$2:m={x:o.x-s.width,y:d};break;default:m={x:o.x,y:o.y}}var g=l?LS$2(l):null;if(g!=null){var y=g==="y"?"height":"width";switch(c){case jp$2:m[g]=m[g]-(o[y]/2-s[y]/2);break;case Zm$2:m[g]=m[g]+(o[y]/2-s[y]/2);break}}return m}function n0$2(r,o){o===void 0&&(o={});var s=o,a=s.placement,l=a===void 0?r.placement:a,c=s.boundary,u=c===void 0?qpt:c,d=s.rootBoundary,m=d===void 0?e7$1:d,g=s.elementContext,y=g===void 0?Qm$2:g,_=s.altBoundary,E=_===void 0?!1:_,w=s.padding,T=w===void 0?0:w,k=c7$1(typeof T!="number"?T:u7$1(T,qm$1)),O=y===Qm$2?Zpt:Qm$2,R=r.rects.popper,M=r.elements[E?O:y],N=Ndt(Up$2(M)?M:M.contextElement||Bl$2(r.elements.popper),u,m),D=Bp$2(r.elements.reference),P=m7$1({reference:D,element:R,strategy:"absolute",placement:l}),I=FS$1(Object.assign({},R,P)),L=y===Qm$2?I:D,F={top:N.top-L.top+k.top,bottom:L.bottom-N.bottom+k.bottom,left:N.left-L.left+k.left,right:L.right-N.right+k.right},U=r.modifiersData.offset;if(y===Qm$2&&U){var J=U[l];Object.keys(F).forEach(function(z){var ie=[es$2,ts$3].indexOf(z)>=0?1:-1,ce=[ai$2,ts$3].indexOf(z)>=0?"y":"x";F[z]+=J[ce]*ie})}return F}function Odt(r,o){o===void 0&&(o={});var s=o,a=s.placement,l=s.boundary,c=s.rootBoundary,u=s.padding,d=s.flipVariations,m=s.allowedAutoPlacements,g=m===void 0?r7$1:m,y=Vp$1(a),_=y?d?n7$1:n7$1.filter(function(T){return Vp$1(T)===y}):qm$1,E=_.filter(function(T){return g.indexOf(T)>=0});E.length===0&&(E=_);var w=E.reduce(function(T,k){return T[k]=n0$2(r,{placement:k,boundary:l,rootBoundary:c,padding:u})[vo$2(k)],T},{});return Object.keys(w).sort(function(T,k){return w[T]-w[k]})}function Cdt(r){if(vo$2(r)===RS$2)return[];var o=Qv$2(r);return[p7$1(r),o,p7$1(o)]}function Rdt(r){var o=r.state,s=r.options,a=r.name;if(!o.modifiersData[a]._skip){for(var l=s.mainAxis,c=l===void 0?!0:l,u=s.altAxis,d=u===void 0?!0:u,m=s.fallbackPlacements,g=s.padding,y=s.boundary,_=s.rootBoundary,E=s.altBoundary,w=s.flipVariations,T=w===void 0?!0:w,k=s.allowedAutoPlacements,O=o.options.placement,R=vo$2(O),M=R===O,N=m||(M||!T?[Qv$2(O)]:Cdt(O)),D=[O].concat(N).reduce(function(ft,yee){return ft.concat(vo$2(yee)===RS$2?Odt(o,{placement:yee,boundary:y,rootBoundary:_,padding:g,flipVariations:T,allowedAutoPlacements:k}):yee)},[]),P=o.rects.reference,I=o.rects.popper,L=new Map,F=!0,U=D[0],J=0;J=0,B=Y?"width":"height",V=n0$2(o,{placement:z,boundary:y,rootBoundary:_,altBoundary:E,padding:g}),Ge=Y?ce?es$2:li$2:ce?ts$3:ai$2;P[B]>I[B]&&(Ge=Qv$2(Ge));var St=Qv$2(Ge),Dee=[];if(c&&Dee.push(V[ie]<=0),d&&Dee.push(V[Ge]<=0,V[St]<=0),Dee.every(function(ft){return ft})){U=z,F=!1;break}L.set(z,Dee)}if(F)for(var pee=T?3:1,jr=function(ft){var yee=D.find(function(ete){var xte=L.get(ete);if(xte)return xte.slice(0,ft).every(function(Ote){return Ote})});if(yee)return U=yee,"break"},Tee=pee;Tee>0;Tee--){var et=jr(Tee);if(et==="break")break}o.placement!==U&&(o.modifiersData[a]._skip=!0,o.placement=U,o.reset=!0)}}var kdt={name:"flip",enabled:!0,phase:"main",fn:Rdt,requiresIfExists:["offset"],data:{_skip:!1}};function y7$1(r,o,s){return s===void 0&&(s={x:0,y:0}),{top:r.top-o.height-s.y,right:r.right-o.width+s.x,bottom:r.bottom-o.height+s.y,left:r.left-o.width-s.x}}function g7$1(r){return[ai$2,es$2,ts$3,li$2].some(function(o){return r[o]>=0})}function Ldt(r){var o=r.state,s=r.name,a=o.rects.reference,l=o.rects.popper,c=o.modifiersData.preventOverflow,u=n0$2(o,{elementContext:"reference"}),d=n0$2(o,{altBoundary:!0}),m=y7$1(u,a),g=y7$1(d,l,c),y=g7$1(m),_=g7$1(g);o.modifiersData[s]={referenceClippingOffsets:m,popperEscapeOffsets:g,isReferenceHidden:y,hasPopperEscaped:_},o.attributes.popper=Object.assign({},o.attributes.popper,{"data-popper-reference-hidden":y,"data-popper-escaped":_})}var Pdt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ldt};function Ddt(r,o,s){var a=vo$2(r),l=[li$2,ai$2].indexOf(a)>=0?-1:1,c=typeof s=="function"?s(Object.assign({},o,{placement:r})):s,u=c[0],d=c[1];return u=u||0,d=(d||0)*l,[li$2,es$2].indexOf(a)>=0?{x:d,y:u}:{x:u,y:d}}function Gdt(r){var o=r.state,s=r.options,a=r.name,l=s.offset,c=l===void 0?[0,0]:l,u=r7$1.reduce(function(y,_){return y[_]=Ddt(_,o.rects,c),y},{}),d=u[o.placement],m=d.x,g=d.y;o.modifiersData.popperOffsets!=null&&(o.modifiersData.popperOffsets.x+=m,o.modifiersData.popperOffsets.y+=g),o.modifiersData[a]=u}var Fdt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Gdt};function jdt(r){var o=r.state,s=r.name;o.modifiersData[s]=m7$1({reference:o.rects.reference,element:o.rects.popper,strategy:"absolute",placement:o.placement})}var Udt={name:"popperOffsets",enabled:!0,phase:"read",fn:jdt,data:{}};function $dt(r){return r==="x"?"y":"x"}function Bdt(r){var o=r.state,s=r.options,a=r.name,l=s.mainAxis,c=l===void 0?!0:l,u=s.altAxis,d=u===void 0?!1:u,m=s.boundary,g=s.rootBoundary,y=s.altBoundary,_=s.padding,E=s.tether,w=E===void 0?!0:E,T=s.tetherOffset,k=T===void 0?0:T,O=n0$2(o,{boundary:m,rootBoundary:g,padding:_,altBoundary:y}),R=vo$2(o.placement),M=Vp$1(o.placement),N=!M,D=LS$2(R),P=$dt(D),I=o.modifiersData.popperOffsets,L=o.rects.reference,F=o.rects.popper,U=typeof k=="function"?k(Object.assign({},o.rects,{placement:o.placement})):k,J=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),z=o.modifiersData.offset?o.modifiersData.offset[o.placement]:null,ie={x:0,y:0};if(I){if(c){var ce,Y=D==="y"?ai$2:li$2,B=D==="y"?ts$3:es$2,V=D==="y"?"height":"width",Ge=I[D],St=Ge+O[Y],Dee=Ge-O[B],pee=w?-F[V]/2:0,jr=M===jp$2?L[V]:F[V],Tee=M===jp$2?-F[V]:-L[V],et=o.elements.arrow,ft=w&&et?kS$1(et):{width:0,height:0},yee=o.modifiersData["arrow#persistent"]?o.modifiersData["arrow#persistent"].padding:l7$1(),ete=yee[Y],xte=yee[B],Ote=t0$2(0,L[V],ft[V]),nee=N?L[V]/2-pee-Ote-ete-J.mainAxis:jr-Ote-ete-J.mainAxis,Wee=N?-L[V]/2+pee+Ote+xte+J.mainAxis:Tee+Ote+xte+J.mainAxis,Bee=o.elements.arrow&&Km$2(o.elements.arrow),Nte=Bee?D==="y"?Bee.clientTop||0:Bee.clientLeft||0:0,_ee=(ce=z?.[D])!=null?ce:0,st=Ge+nee-_ee-Nte,Lee=Ge+Wee-_ee,$te=t0$2(w?Jv$2(St,st):St,Ge,w?vu$2(Dee,Lee):Dee);I[D]=$te,ie[D]=$te-Ge}if(d){var Kee,Iee=D==="x"?ai$2:li$2,Rte=D==="x"?ts$3:es$2,dee=I[P],fee=P==="y"?"height":"width",Oee=dee+O[Iee],xee=dee-O[Rte],kee=[ai$2,li$2].indexOf(R)!==-1,Dte=(Kee=z?.[P])!=null?Kee:0,Ite=kee?Oee:dee-L[fee]-F[fee]-Dte+J.altAxis,Lte=kee?dee+L[fee]+F[fee]-Dte-J.altAxis:xee,Vte=w&&kee?pdt(Ite,dee,Lte):t0$2(w?Ite:Oee,dee,w?Lte:xee);I[P]=Vte,ie[P]=Vte-dee}o.modifiersData[a]=ie}}var Vdt={name:"preventOverflow",enabled:!0,phase:"main",fn:Bdt,requiresIfExists:["offset"]};function zdt(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Hdt(r){return r===Rs$2(r)||!ns$2(r)?PS$2(r):zdt(r)}function Wdt(r){var o=r.getBoundingClientRect(),s=$p$2(o.width)/r.offsetWidth||1,a=$p$2(o.height)/r.offsetHeight||1;return s!==1||a!==1}function Xdt(r,o,s){s===void 0&&(s=!1);var a=ns$2(o),l=ns$2(o)&&Wdt(o),c=Bl$2(o),u=Bp$2(r,l),d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(a||!a&&!s)&&((go$2(o)!=="body"||GS$2(c))&&(d=Hdt(o)),ns$2(o)?(m=Bp$2(o,!0),m.x+=o.clientLeft,m.y+=o.clientTop):c&&(m.x=DS$2(c))),{x:u.left+d.scrollLeft-m.x,y:u.top+d.scrollTop-m.y,width:u.width,height:u.height}}function Ydt(r){var o=new Map,s=new Set,a=[];r.forEach(function(c){o.set(c.name,c)});function l(c){s.add(c.name);var u=[].concat(c.requires||[],c.requiresIfExists||[]);u.forEach(function(d){if(!s.has(d)){var m=o.get(d);m&&l(m)}}),a.push(c)}return r.forEach(function(c){s.has(c.name)||l(c)}),a}function Jdt(r){var o=Ydt(r);return adt.reduce(function(s,a){return s.concat(o.filter(function(l){return l.phase===a}))},[])}function qdt(r){var o;return function(){return o||(o=new Promise(function(s){Promise.resolve().then(function(){o=void 0,s(r())})})),o}}function Zdt(r){var o=r.reduce(function(s,a){var l=s[a.name];return s[a.name]=l?Object.assign({},l,a,{options:Object.assign({},l.options,a.options),data:Object.assign({},l.data,a.data)}):a,s},{});return Object.keys(o).map(function(s){return o[s]})}var v7$1={placement:"bottom",modifiers:[],strategy:"absolute"};function b7$1(){for(var r=arguments.length,o=new Array(r),s=0;s-1}function S7$1(r,o){return typeof r=="function"?r.apply(void 0,o):r}function A7$1(r,o){if(o===0)return r;var s;return function(a){clearTimeout(s),s=setTimeout(function(){r(a)},o)}}function nft(r,o){var s=Object.assign({},r);return o.forEach(function(a){delete s[a]}),s}function rft(r){return r.split(/\s+/).filter(Boolean)}function _u$2(r){return[].concat(r)}function I7$1(r,o){r.indexOf(o)===-1&&r.push(o)}function ift(r){return r.filter(function(o,s){return r.indexOf(o)===s})}function M7$1(r){return r.split("-")[0]}function zp$2(r){return[].slice.call(r)}function N7$1(r){return Object.keys(r).reduce(function(o,s){return r[s]!==void 0&&(o[s]=r[s]),o},{})}function wu$2(){return document.createElement("div")}function Kv$2(r){return["Element","Fragment"].some(function(o){return US$2(r,o)})}function sft(r){return US$2(r,"NodeList")}function $S$2(r){return US$2(r,"MouseEvent")}function oft(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function aft(r){return Kv$2(r)?[r]:sft(r)?zp$2(r):Array.isArray(r)?r:zp$2(document.querySelectorAll(r))}function BS$2(r,o){r.forEach(function(s){s&&(s.style.transitionDuration=o+"ms")})}function r0$2(r,o){r.forEach(function(s){s&&s.setAttribute("data-state",o)})}function O7$1(r){var o,s=_u$2(r),a=s[0];return a!=null&&(o=a.ownerDocument)!=null&&o.body?a.ownerDocument:document}function lft(r,o){var s=o.clientX,a=o.clientY;return r.every(function(l){var c=l.popperRect,u=l.popperState,d=l.props,m=d.interactiveBorder,g=M7$1(u.placement),y=u.modifiersData.offset;if(!y)return!0;var _=g==="bottom"?y.top.y:0,E=g==="top"?y.bottom.y:0,w=g==="right"?y.left.x:0,T=g==="left"?y.right.x:0,k=c.top-a+_>m,O=a-c.bottom-E>m,R=c.left-s+w>m,M=s-c.right-T>m;return k||O||R||M})}function VS$2(r,o,s){var a=o+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(l){r[a](l,s)})}function C7$1(r,o){for(var s=o;s;){var a;if(r.contains(s))return!0;s=s.getRootNode==null||(a=s.getRootNode())==null?void 0:a.host}return!1}var _o$2={isTouch:!1},R7$1=0;function cft(){_o$2.isTouch||(_o$2.isTouch=!0,window.performance&&document.addEventListener("mousemove",k7$1))}function k7$1(){var r=performance.now();r-R7$1<20&&(_o$2.isTouch=!1,document.removeEventListener("mousemove",k7$1)),R7$1=r}function uft(){var r=document.activeElement;if(oft(r)){var o=r._tippy;r.blur&&!o.state.isVisible&&r.blur()}}function hft(){document.addEventListener("touchstart",cft,bu$2),window.addEventListener("blur",uft)}var pft=typeof window<"u"&&typeof document<"u",dft=pft?!!window.msCrypto:!1,fft={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},mft={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ks$1=Object.assign({appendTo:T7$1,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},fft,mft),yft=Object.keys(ks$1),gft=function(r){var o=Object.keys(r);o.forEach(function(s){ks$1[s]=r[s]})};function L7$1(r){var o=r.plugins||[],s=o.reduce(function(a,l){var c=l.name,u=l.defaultValue;if(c){var d;a[c]=r[c]!==void 0?r[c]:(d=ks$1[c])!=null?d:u}return a},{});return Object.assign({},r,s)}function vft(r,o){var s=o?Object.keys(L7$1(Object.assign({},ks$1,{plugins:o}))):yft,a=s.reduce(function(l,c){var u=(r.getAttribute("data-tippy-"+c)||"").trim();if(!u)return l;if(c==="content")l[c]=u;else try{l[c]=JSON.parse(u)}catch{l[c]=u}return l},{});return a}function P7$1(r,o){var s=Object.assign({},o,{content:S7$1(o.content,[r])},o.ignoreAttributes?{}:vft(r,o.plugins));return s.aria=Object.assign({},ks$1.aria,s.aria),s.aria={expanded:s.aria.expanded==="auto"?o.interactive:s.aria.expanded,content:s.aria.content==="auto"?o.interactive?null:"describedby":s.aria.content},s}var bft=function(){return"innerHTML"};function zS$2(r,o){r[bft()]=o}function D7$1(r){var o=wu$2();return r===!0?o.className=x7$1:(o.className=E7$1,Kv$2(r)?o.appendChild(r):zS$2(o,r)),o}function G7$1(r,o){Kv$2(o.content)?(zS$2(r,""),r.appendChild(o.content)):typeof o.content!="function"&&(o.allowHTML?zS$2(r,o.content):r.textContent=o.content)}function tb$2(r){var o=r.firstElementChild,s=zp$2(o.children);return{box:o,content:s.find(function(a){return a.classList.contains(_7$1)}),arrow:s.find(function(a){return a.classList.contains(x7$1)||a.classList.contains(E7$1)}),backdrop:s.find(function(a){return a.classList.contains(w7$1)})}}function F7$1(r){var o=wu$2(),s=wu$2();s.className=eft,s.setAttribute("data-state","hidden"),s.setAttribute("tabindex","-1");var a=wu$2();a.className=_7$1,a.setAttribute("data-state","hidden"),G7$1(a,r.props),o.appendChild(s),s.appendChild(a),l(r.props,r.props);function l(c,u){var d=tb$2(o),m=d.box,g=d.content,y=d.arrow;u.theme?m.setAttribute("data-theme",u.theme):m.removeAttribute("data-theme"),typeof u.animation=="string"?m.setAttribute("data-animation",u.animation):m.removeAttribute("data-animation"),u.inertia?m.setAttribute("data-inertia",""):m.removeAttribute("data-inertia"),m.style.maxWidth=typeof u.maxWidth=="number"?u.maxWidth+"px":u.maxWidth,u.role?m.setAttribute("role",u.role):m.removeAttribute("role"),(c.content!==u.content||c.allowHTML!==u.allowHTML)&&G7$1(g,r.props),u.arrow?y?c.arrow!==u.arrow&&(m.removeChild(y),m.appendChild(D7$1(u.arrow))):m.appendChild(D7$1(u.arrow)):y&&m.removeChild(y)}return{popper:o,onUpdate:l}}F7$1.$$tippy=!0;var _ft=1,eb$2=[],HS$2=[];function wft(r,o){var s=P7$1(r,Object.assign({},ks$1,L7$1(N7$1(o)))),a,l,c,u=!1,d=!1,m=!1,g=!1,y,_,E,w=[],T=A7$1(st,s.interactiveDebounce),k,O=_ft++,R=null,M=ift(s.plugins),N={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},D={id:O,reference:r,popper:wu$2(),popperInstance:R,props:s,state:N,plugins:M,clearDelayTimeouts:Ite,setProps:Lte,setContent:Vte,show:Pte,hide:Fte,hideWithInteractivity:Ute,enable:kee,disable:Dte,unmount:Gte,destroy:jte};if(!s.render)return D;var P=s.render(D),I=P.popper,L=P.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+D.id,D.popper=I,r._tippy=D,I._tippy=D;var F=M.map(function(Bte){return Bte.fn(D)}),U=r.hasAttribute("aria-expanded");return Bee(),pee(),Ge(),St("onCreate",[D]),s.showOnCreate&&Oee(),I.addEventListener("mouseenter",function(){D.props.interactive&&D.state.isVisible&&D.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){D.props.interactive&&D.props.trigger.indexOf("mouseenter")>=0&&Y().addEventListener("mousemove",T)}),D;function J(){var Bte=D.props.touch;return Array.isArray(Bte)?Bte:[Bte,0]}function z(){return J()[0]==="hold"}function ie(){var Bte;return!!((Bte=D.props.render)!=null&&Bte.$$tippy)}function ce(){return k||r}function Y(){var Bte=ce().parentNode;return Bte?O7$1(Bte):document}function B(){return tb$2(I)}function V(Bte){return D.state.isMounted&&!D.state.isVisible||_o$2.isTouch||y&&y.type==="focus"?0:jS$2(D.props.delay,Bte?0:1,ks$1.delay)}function Ge(Bte){Bte===void 0&&(Bte=!1),I.style.pointerEvents=D.props.interactive&&!Bte?"":"none",I.style.zIndex=""+D.props.zIndex}function St(Bte,Hte,zte){if(zte===void 0&&(zte=!0),F.forEach(function(Wte){Wte[Bte]&&Wte[Bte].apply(Wte,Hte)}),zte){var qte;(qte=D.props)[Bte].apply(qte,Hte)}}function Dee(){var Bte=D.props.aria;if(Bte.content){var Hte="aria-"+Bte.content,zte=I.id,qte=_u$2(D.props.triggerTarget||r);qte.forEach(function(Wte){var Zte=Wte.getAttribute(Hte);if(D.state.isVisible)Wte.setAttribute(Hte,Zte?Zte+" "+zte:zte);else{var Qte=Zte&&Zte.replace(zte,"").trim();Qte?Wte.setAttribute(Hte,Qte):Wte.removeAttribute(Hte)}})}}function pee(){if(!(U||!D.props.aria.expanded)){var Bte=_u$2(D.props.triggerTarget||r);Bte.forEach(function(Hte){D.props.interactive?Hte.setAttribute("aria-expanded",D.state.isVisible&&Hte===ce()?"true":"false"):Hte.removeAttribute("aria-expanded")})}}function jr(){Y().removeEventListener("mousemove",T),eb$2=eb$2.filter(function(Bte){return Bte!==T})}function Tee(Bte){if(!(_o$2.isTouch&&(m||Bte.type==="mousedown"))){var Hte=Bte.composedPath&&Bte.composedPath()[0]||Bte.target;if(!(D.props.interactive&&C7$1(I,Hte))){if(_u$2(D.props.triggerTarget||r).some(function(zte){return C7$1(zte,Hte)})){if(_o$2.isTouch||D.state.isVisible&&D.props.trigger.indexOf("click")>=0)return}else St("onClickOutside",[D,Bte]);D.props.hideOnClick===!0&&(D.clearDelayTimeouts(),D.hide(),d=!0,setTimeout(function(){d=!1}),D.state.isMounted||ete())}}}function et(){m=!0}function ft(){m=!1}function yee(){var Bte=Y();Bte.addEventListener("mousedown",Tee,!0),Bte.addEventListener("touchend",Tee,bu$2),Bte.addEventListener("touchstart",ft,bu$2),Bte.addEventListener("touchmove",et,bu$2)}function ete(){var Bte=Y();Bte.removeEventListener("mousedown",Tee,!0),Bte.removeEventListener("touchend",Tee,bu$2),Bte.removeEventListener("touchstart",ft,bu$2),Bte.removeEventListener("touchmove",et,bu$2)}function xte(Bte,Hte){nee(Bte,function(){!D.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&Hte()})}function Ote(Bte,Hte){nee(Bte,Hte)}function nee(Bte,Hte){var zte=B().box;function qte(Wte){Wte.target===zte&&(VS$2(zte,"remove",qte),Hte())}if(Bte===0)return Hte();VS$2(zte,"remove",_),VS$2(zte,"add",qte),_=qte}function Wee(Bte,Hte,zte){zte===void 0&&(zte=!1);var qte=_u$2(D.props.triggerTarget||r);qte.forEach(function(Wte){Wte.addEventListener(Bte,Hte,zte),w.push({node:Wte,eventType:Bte,handler:Hte,options:zte})})}function Bee(){z()&&(Wee("touchstart",_ee,{passive:!0}),Wee("touchend",Lee,{passive:!0})),rft(D.props.trigger).forEach(function(Bte){if(Bte!=="manual")switch(Wee(Bte,_ee),Bte){case"mouseenter":Wee("mouseleave",Lee);break;case"focus":Wee(dft?"focusout":"blur",$te);break;case"focusin":Wee("focusout",$te);break}})}function Nte(){w.forEach(function(Bte){var Hte=Bte.node,zte=Bte.eventType,qte=Bte.handler,Wte=Bte.options;Hte.removeEventListener(zte,qte,Wte)}),w=[]}function _ee(Bte){var Hte,zte=!1;if(!(!D.state.isEnabled||Kee(Bte)||d)){var qte=((Hte=y)==null?void 0:Hte.type)==="focus";y=Bte,k=Bte.currentTarget,pee(),!D.state.isVisible&&$S$2(Bte)&&eb$2.forEach(function(Wte){return Wte(Bte)}),Bte.type==="click"&&(D.props.trigger.indexOf("mouseenter")<0||u)&&D.props.hideOnClick!==!1&&D.state.isVisible?zte=!0:Oee(Bte),Bte.type==="click"&&(u=!zte),zte&&!qte&&xee(Bte)}}function st(Bte){var Hte=Bte.target,zte=ce().contains(Hte)||I.contains(Hte);if(!(Bte.type==="mousemove"&&zte)){var qte=fee().concat(I).map(function(Wte){var Zte,Qte=Wte._tippy,rne=(Zte=Qte.popperInstance)==null?void 0:Zte.state;return rne?{popperRect:Wte.getBoundingClientRect(),popperState:rne,props:s}:null}).filter(Boolean);lft(qte,Bte)&&(jr(),xee(Bte))}}function Lee(Bte){var Hte=Kee(Bte)||D.props.trigger.indexOf("click")>=0&&u;if(!Hte){if(D.props.interactive){D.hideWithInteractivity(Bte);return}xee(Bte)}}function $te(Bte){D.props.trigger.indexOf("focusin")<0&&Bte.target!==ce()||D.props.interactive&&Bte.relatedTarget&&I.contains(Bte.relatedTarget)||xee(Bte)}function Kee(Bte){return _o$2.isTouch?z()!==Bte.type.indexOf("touch")>=0:!1}function Iee(){Rte();var Bte=D.props,Hte=Bte.popperOptions,zte=Bte.placement,qte=Bte.offset,Wte=Bte.getReferenceClientRect,Zte=Bte.moveTransition,Qte=ie()?tb$2(I).arrow:null,rne=Wte?{getBoundingClientRect:Wte,contextElement:Wte.contextElement||ce()}:r,cne={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(yne){var Yte=yne.state;if(ie()){var Jte=B(),nne=Jte.box;["placement","reference-hidden","escaped"].forEach(function(one){one==="placement"?nne.setAttribute("data-placement",Yte.placement):Yte.attributes.popper["data-popper-"+one]?nne.setAttribute("data-"+one,""):nne.removeAttribute("data-"+one)}),Yte.attributes.popper={}}}},une=[{name:"offset",options:{offset:qte}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Zte}},cne];ie()&&Qte&&une.push({name:"arrow",options:{element:Qte,padding:3}}),une.push.apply(une,Hte?.modifiers||[]),D.popperInstance=tft(rne,I,Object.assign({},Hte,{placement:zte,onFirstUpdate:E,modifiers:une}))}function Rte(){D.popperInstance&&(D.popperInstance.destroy(),D.popperInstance=null)}function dee(){var Bte=D.props.appendTo,Hte,zte=ce();D.props.interactive&&Bte===T7$1||Bte==="parent"?Hte=zte.parentNode:Hte=S7$1(Bte,[zte]),Hte.contains(I)||Hte.appendChild(I),D.state.isMounted=!0,Iee()}function fee(){return zp$2(I.querySelectorAll("[data-tippy-root]"))}function Oee(Bte){D.clearDelayTimeouts(),Bte&&St("onTrigger",[D,Bte]),yee();var Hte=V(!0),zte=J(),qte=zte[0],Wte=zte[1];_o$2.isTouch&&qte==="hold"&&Wte&&(Hte=Wte),Hte?a=setTimeout(function(){D.show()},Hte):D.show()}function xee(Bte){if(D.clearDelayTimeouts(),St("onUntrigger",[D,Bte]),!D.state.isVisible){ete();return}if(!(D.props.trigger.indexOf("mouseenter")>=0&&D.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(Bte.type)>=0&&u)){var Hte=V(!1);Hte?l=setTimeout(function(){D.state.isVisible&&D.hide()},Hte):c=requestAnimationFrame(function(){D.hide()})}}function kee(){D.state.isEnabled=!0}function Dte(){D.hide(),D.state.isEnabled=!1}function Ite(){clearTimeout(a),clearTimeout(l),cancelAnimationFrame(c)}function Lte(Bte){if(!D.state.isDestroyed){St("onBeforeUpdate",[D,Bte]),Nte();var Hte=D.props,zte=P7$1(r,Object.assign({},Hte,N7$1(Bte),{ignoreAttributes:!0}));D.props=zte,Bee(),Hte.interactiveDebounce!==zte.interactiveDebounce&&(jr(),T=A7$1(st,zte.interactiveDebounce)),Hte.triggerTarget&&!zte.triggerTarget?_u$2(Hte.triggerTarget).forEach(function(qte){qte.removeAttribute("aria-expanded")}):zte.triggerTarget&&r.removeAttribute("aria-expanded"),pee(),Ge(),L&&L(Hte,zte),D.popperInstance&&(Iee(),fee().forEach(function(qte){requestAnimationFrame(qte._tippy.popperInstance.forceUpdate)})),St("onAfterUpdate",[D,Bte])}}function Vte(Bte){D.setProps({content:Bte})}function Pte(){var Bte=D.state.isVisible,Hte=D.state.isDestroyed,zte=!D.state.isEnabled,qte=_o$2.isTouch&&!D.props.touch,Wte=jS$2(D.props.duration,0,ks$1.duration);if(!(Bte||Hte||zte||qte)&&!ce().hasAttribute("disabled")&&(St("onShow",[D],!1),D.props.onShow(D)!==!1)){if(D.state.isVisible=!0,ie()&&(I.style.visibility="visible"),Ge(),yee(),D.state.isMounted||(I.style.transition="none"),ie()){var Zte=B(),Qte=Zte.box,rne=Zte.content;BS$2([Qte,rne],0)}E=function(){var cne;if(!(!D.state.isVisible||g)){if(g=!0,I.offsetHeight,I.style.transition=D.props.moveTransition,ie()&&D.props.animation){var une=B(),yne=une.box,Yte=une.content;BS$2([yne,Yte],Wte),r0$2([yne,Yte],"visible")}Dee(),pee(),I7$1(HS$2,D),(cne=D.popperInstance)==null||cne.forceUpdate(),St("onMount",[D]),D.props.animation&&ie()&&Ote(Wte,function(){D.state.isShown=!0,St("onShown",[D])})}},dee()}}function Fte(){var Bte=!D.state.isVisible,Hte=D.state.isDestroyed,zte=!D.state.isEnabled,qte=jS$2(D.props.duration,1,ks$1.duration);if(!(Bte||Hte||zte)&&(St("onHide",[D],!1),D.props.onHide(D)!==!1)){if(D.state.isVisible=!1,D.state.isShown=!1,g=!1,u=!1,ie()&&(I.style.visibility="hidden"),jr(),ete(),Ge(!0),ie()){var Wte=B(),Zte=Wte.box,Qte=Wte.content;D.props.animation&&(BS$2([Zte,Qte],qte),r0$2([Zte,Qte],"hidden"))}Dee(),pee(),D.props.animation?ie()&&xte(qte,D.unmount):D.unmount()}}function Ute(Bte){Y().addEventListener("mousemove",T),I7$1(eb$2,T),T(Bte)}function Gte(){D.state.isVisible&&D.hide(),D.state.isMounted&&(Rte(),fee().forEach(function(Bte){Bte._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),HS$2=HS$2.filter(function(Bte){return Bte!==D}),D.state.isMounted=!1,St("onHidden",[D]))}function jte(){D.state.isDestroyed||(D.clearDelayTimeouts(),D.unmount(),Nte(),delete r._tippy,D.state.isDestroyed=!0,St("onDestroy",[D]))}}function Rt$1(r,o){o===void 0&&(o={});var s=ks$1.plugins.concat(o.plugins||[]);hft();var a=Object.assign({},o,{plugins:s}),l=aft(r),c=l.reduce(function(u,d){var m=d&&wft(d,a);return m&&u.push(m),u},[]);return Kv$2(r)?c[0]:c}Rt$1.defaultProps=ks$1,Rt$1.setDefaultProps=gft,Rt$1.currentInput=_o$2;var xft=Object.assign({},s7$1,{effect:function(r){var o=r.state,s={popper:{position:o.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(o.elements.popper.style,s.popper),o.styles=s,o.elements.arrow&&Object.assign(o.elements.arrow.style,s.arrow)}}),Eft=function(r,o){var s;o===void 0&&(o={});var a=r,l=[],c=[],u,d=o.overrides,m=[],g=!1;function y(){c=a.map(function(N){return _u$2(N.props.triggerTarget||N.reference)}).reduce(function(N,D){return N.concat(D)},[])}function _(){l=a.map(function(N){return N.reference})}function E(N){a.forEach(function(D){N?D.enable():D.disable()})}function w(N){return a.map(function(D){var P=D.setProps;return D.setProps=function(I){P(I),D.reference===u&&N.setProps(I)},function(){D.setProps=P}})}function T(N,D){var P=c.indexOf(D);if(D!==u){u=D;var I=(d||[]).concat("content").reduce(function(L,F){return L[F]=a[P].props[F],L},{});N.setProps(Object.assign({},I,{getReferenceClientRect:typeof I.getReferenceClientRect=="function"?I.getReferenceClientRect:function(){var L;return(L=l[P])==null?void 0:L.getBoundingClientRect()}}))}}E(!1),_(),y();var k={fn:function(){return{onDestroy:function(){E(!0)},onHidden:function(){u=null},onClickOutside:function(N){N.props.showOnCreate&&!g&&(g=!0,u=null)},onShow:function(N){N.props.showOnCreate&&!g&&(g=!0,T(N,l[0]))},onTrigger:function(N,D){T(N,D.currentTarget)}}}},O=Rt$1(wu$2(),Object.assign({},nft(o,["overrides"]),{plugins:[k].concat(o.plugins||[]),triggerTarget:c,popperOptions:Object.assign({},o.popperOptions,{modifiers:[].concat(((s=o.popperOptions)==null?void 0:s.modifiers)||[],[xft])})})),R=O.show;O.show=function(N){if(R(),!u&&N==null)return T(O,l[0]);if(!(u&&N==null)){if(typeof N=="number")return l[N]&&T(O,l[N]);if(a.indexOf(N)>=0){var D=N.reference;return T(O,D)}if(l.indexOf(N)>=0)return T(O,N)}},O.showNext=function(){var N=l[0];if(!u)return O.show(0);var D=l.indexOf(u);O.show(l[D+1]||N)},O.showPrevious=function(){var N=l[l.length-1];if(!u)return O.show(N);var D=l.indexOf(u),P=l[D-1]||N;O.show(P)};var M=O.setProps;return O.setProps=function(N){d=N.overrides||d,M(N)},O.setInstances=function(N){E(!0),m.forEach(function(D){return D()}),a=N,E(!1),_(),y(),m=w(O),O.setProps({triggerTarget:c})},m=w(O),O},Tft={name:"animateFill",defaultValue:!1,fn:function(r){var o;if(!((o=r.props.render)!=null&&o.$$tippy))return{};var s=tb$2(r.popper),a=s.box,l=s.content,c=r.props.animateFill?Sft():null;return{onCreate:function(){c&&(a.insertBefore(c,a.firstElementChild),a.setAttribute("data-animatefill",""),a.style.overflow="hidden",r.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(c){var u=a.style.transitionDuration,d=Number(u.replace("ms",""));l.style.transitionDelay=Math.round(d/10)+"ms",c.style.transitionDuration=u,r0$2([c],"visible")}},onShow:function(){c&&(c.style.transitionDuration="0ms")},onHide:function(){c&&r0$2([c],"hidden")}}}};function Sft(){var r=wu$2();return r.className=w7$1,r0$2([r],"hidden"),r}var WS$3={clientX:0,clientY:0},nb$2=[];function j7$1(r){var o=r.clientX,s=r.clientY;WS$3={clientX:o,clientY:s}}function Aft(r){r.addEventListener("mousemove",j7$1)}function Ift(r){r.removeEventListener("mousemove",j7$1)}var Mft={name:"followCursor",defaultValue:!1,fn:function(r){var o=r.reference,s=O7$1(r.props.triggerTarget||o),a=!1,l=!1,c=!0,u=r.props;function d(){return r.props.followCursor==="initial"&&r.state.isVisible}function m(){s.addEventListener("mousemove",_)}function g(){s.removeEventListener("mousemove",_)}function y(){a=!0,r.setProps({getReferenceClientRect:null}),a=!1}function _(T){var k=T.target?o.contains(T.target):!0,O=r.props.followCursor,R=T.clientX,M=T.clientY,N=o.getBoundingClientRect(),D=R-N.left,P=M-N.top;(k||!r.props.interactive)&&r.setProps({getReferenceClientRect:function(){var I=o.getBoundingClientRect(),L=R,F=M;O==="initial"&&(L=I.left+D,F=I.top+P);var U=O==="horizontal"?I.top:F,J=O==="vertical"?I.right:L,z=O==="horizontal"?I.bottom:F,ie=O==="vertical"?I.left:L;return{width:J-ie,height:z-U,top:U,right:J,bottom:z,left:ie}}})}function E(){r.props.followCursor&&(nb$2.push({instance:r,doc:s}),Aft(s))}function w(){nb$2=nb$2.filter(function(T){return T.instance!==r}),nb$2.filter(function(T){return T.doc===s}).length===0&&Ift(s)}return{onCreate:E,onDestroy:w,onBeforeUpdate:function(){u=r.props},onAfterUpdate:function(T,k){var O=k.followCursor;a||O!==void 0&&u.followCursor!==O&&(w(),O?(E(),r.state.isMounted&&!l&&!d()&&m()):(g(),y()))},onMount:function(){r.props.followCursor&&!l&&(c&&(_(WS$3),c=!1),d()||m())},onTrigger:function(T,k){$S$2(k)&&(WS$3={clientX:k.clientX,clientY:k.clientY}),l=k.type==="focus"},onHidden:function(){r.props.followCursor&&(y(),g(),c=!0)}}}};function Nft(r,o){var s;return{popperOptions:Object.assign({},r.popperOptions,{modifiers:[].concat((((s=r.popperOptions)==null?void 0:s.modifiers)||[]).filter(function(a){var l=a.name;return l!==o.name}),[o])})}}var Oft={name:"inlinePositioning",defaultValue:!1,fn:function(r){var o=r.reference;function s(){return!!r.props.inlinePositioning}var a,l=-1,c=!1,u=[],d={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(_){var E=_.state;s()&&(u.indexOf(E.placement)!==-1&&(u=[]),a!==E.placement&&u.indexOf(E.placement)===-1&&(u.push(E.placement),r.setProps({getReferenceClientRect:function(){return m(E.placement)}})),a=E.placement)}};function m(_){return Cft(M7$1(_),o.getBoundingClientRect(),zp$2(o.getClientRects()),l)}function g(_){c=!0,r.setProps(_),c=!1}function y(){c||g(Nft(r.props,d))}return{onCreate:y,onAfterUpdate:y,onTrigger:function(_,E){if($S$2(E)){var w=zp$2(r.reference.getClientRects()),T=w.find(function(O){return O.left-2<=E.clientX&&O.right+2>=E.clientX&&O.top-2<=E.clientY&&O.bottom+2>=E.clientY}),k=w.indexOf(T);l=k>-1?k:l}},onHidden:function(){l=-1}}}};function Cft(r,o,s,a){if(s.length<2||r===null)return o;if(s.length===2&&a>=0&&s[0].left>s[1].right)return s[a]||o;switch(r){case"top":case"bottom":{var l=s[0],c=s[s.length-1],u=r==="top",d=l.top,m=c.bottom,g=u?l.left:c.left,y=u?l.right:c.right,_=y-g,E=m-d;return{top:d,bottom:m,left:g,right:y,width:_,height:E}}case"left":case"right":{var w=Math.min.apply(Math,s.map(function(I){return I.left})),T=Math.max.apply(Math,s.map(function(I){return I.right})),k=s.filter(function(I){return r==="left"?I.left===w:I.right===T}),O=k[0].top,R=k[k.length-1].bottom,M=w,N=T,D=N-M,P=R-O;return{top:O,bottom:R,left:M,right:N,width:D,height:P}}default:return o}}var Rft={name:"sticky",defaultValue:!1,fn:function(r){var o=r.reference,s=r.popper;function a(){return r.popperInstance?r.popperInstance.state.elements.reference:o}function l(m){return r.props.sticky===!0||r.props.sticky===m}var c=null,u=null;function d(){var m=l("reference")?a().getBoundingClientRect():null,g=l("popper")?s.getBoundingClientRect():null;(m&&U7$1(c,m)||g&&U7$1(u,g))&&r.popperInstance&&r.popperInstance.update(),c=m,u=g,r.state.isMounted&&requestAnimationFrame(d)}return{onMount:function(){r.props.sticky&&d()}}}};function U7$1(r,o){return r&&o?r.top!==o.top||r.right!==o.right||r.bottom!==o.bottom||r.left!==o.left:!0}Rt$1.setDefaultProps({render:F7$1}),Rt$1.setDefaultProps({onShow:r=>{if(!r.props.content)return!1}});function XS$2(r,o={},s={mount:!0,appName:"Tippy"}){s=Object.assign({mount:!0,appName:"Tippy"},s);const a=In$2(),l=tt$3(),c=tt$3({isEnabled:!1,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1}),u=up$2();let d=null;const m=()=>d||(d=document.createDocumentFragment(),d),g=L=>{let F,U=pe$1(L)?L.value:L;return ws$2(U)?(u.value||(u.value=Ml$1({name:s.appName,setup:()=>()=>pe$1(L)?L.value:L}),a&&Object.assign(u.value._context,a.appContext),u.value.mount(m())),F=()=>m()):typeof U=="object"?(u.value||(u.value=Ml$1({name:s.appName,setup:()=>()=>vi$1(pe$1(L)?L.value:L)}),a&&Object.assign(u.value._context,a.appContext),u.value.mount(m())),F=()=>m()):F=U,F},y=L=>{let F={};return pe$1(L)?F=L.value||{}:yi$2(L)?F={...L}:F={...L},F.content&&(F.content=g(F.content)),F.triggerTarget&&(F.triggerTarget=pe$1(F.triggerTarget)?F.triggerTarget.value:F.triggerTarget),(!F.plugins||!Array.isArray(F.plugins))&&(F.plugins=[]),F.plugins=F.plugins.filter(U=>U.name!=="vueTippyReactiveState"),F.plugins.push({name:"vueTippyReactiveState",fn:()=>({onCreate(){c.value.isEnabled=!0},onMount(){c.value.isMounted=!0},onShow(){c.value.isMounted=!0,c.value.isVisible=!0},onShown(){c.value.isShown=!0},onHide(){c.value.isMounted=!1,c.value.isVisible=!1},onHidden(){c.value.isShown=!1},onUnmounted(){c.value.isMounted=!1},onDestroy(){c.value.isDestroyed=!0}})}),F},_=()=>{l.value&&l.value.setProps(y(o))},E=()=>{!l.value||!o.content||l.value.setContent(g(o.content))},w=L=>{var F;(F=l.value)===null||F===void 0||F.setContent(g(L))},T=L=>{var F;(F=l.value)===null||F===void 0||F.setProps(y(L))},k=()=>{var L;l.value&&(l.value.destroy(),l.value=void 0),d=null,(L=u.value)===null||L===void 0||L.unmount(),u.value=void 0},O=()=>{var L;(L=l.value)===null||L===void 0||L.show()},R=()=>{var L;(L=l.value)===null||L===void 0||L.hide()},M=()=>{var L;(L=l.value)===null||L===void 0||L.disable(),c.value.isEnabled=!1},N=()=>{var L;(L=l.value)===null||L===void 0||L.enable(),c.value.isEnabled=!0},D=()=>{var L;(L=l.value)===null||L===void 0||L.unmount()},P=()=>{if(!r)return;let L=pe$1(r)?r.value:r;typeof L=="function"&&(L=L()),L&&(l.value=Rt$1(L,y(o)),L.$tippy=I)},I={tippy:l,refresh:_,refreshContent:E,setContent:w,setProps:T,destroy:k,hide:R,show:O,disable:M,enable:N,unmount:D,mount:P,state:c};return s.mount&&(a?a.isMounted?P():qn$2(P):P()),a&&tu$2(()=>{k()}),pe$1(o)||yi$2(o)?Hn$2(o,_,{immediate:!1}):pe$1(o.content)&&Hn$2(o.content,E,{immediate:!1}),I}function kft(r,o){const s=tt$3();return qn$2(()=>{const a=(Array.isArray(r)?r.map(l=>l.value):typeof r=="function"?r():r.value).map(l=>l instanceof Element?l._tippy:l).filter(Boolean);s.value=Eft(a,o?{allowHTML:!0,...o}:{allowHTML:!0})}),{singleton:s}}function Lft(r){return typeof r=="function"?r():It$2(r)}function Pft(r){var o,s;const a=Lft(r);return(s=(o=a)===null||o===void 0?void 0:o.$el)!==null&&s!==void 0?s:a}const Dft=ne$1({props:{to:{type:[String,Function]},tag:{type:[String,Object],default:"span"},contentTag:{type:[String,Object],default:"span"},contentClass:{type:String,default:null},appendTo:{default:()=>Rt$1.defaultProps.appendTo},aria:{default:()=>Rt$1.defaultProps.aria},delay:{default:()=>Rt$1.defaultProps.delay},duration:{default:()=>Rt$1.defaultProps.duration},getReferenceClientRect:{default:()=>Rt$1.defaultProps.getReferenceClientRect},hideOnClick:{type:[Boolean,String],default:()=>Rt$1.defaultProps.hideOnClick},ignoreAttributes:{type:Boolean,default:()=>Rt$1.defaultProps.ignoreAttributes},interactive:{type:Boolean,default:()=>Rt$1.defaultProps.interactive},interactiveBorder:{default:()=>Rt$1.defaultProps.interactiveBorder},interactiveDebounce:{default:()=>Rt$1.defaultProps.interactiveDebounce},moveTransition:{default:()=>Rt$1.defaultProps.moveTransition},offset:{default:()=>Rt$1.defaultProps.offset},onAfterUpdate:{default:()=>Rt$1.defaultProps.onAfterUpdate},onBeforeUpdate:{default:()=>Rt$1.defaultProps.onBeforeUpdate},onCreate:{default:()=>Rt$1.defaultProps.onCreate},onDestroy:{default:()=>Rt$1.defaultProps.onDestroy},onHidden:{default:()=>Rt$1.defaultProps.onHidden},onHide:{default:()=>Rt$1.defaultProps.onHide},onMount:{default:()=>Rt$1.defaultProps.onMount},onShow:{default:()=>Rt$1.defaultProps.onShow},onShown:{default:()=>Rt$1.defaultProps.onShown},onTrigger:{default:()=>Rt$1.defaultProps.onTrigger},onUntrigger:{default:()=>Rt$1.defaultProps.onUntrigger},onClickOutside:{default:()=>Rt$1.defaultProps.onClickOutside},placement:{default:()=>Rt$1.defaultProps.placement},plugins:{default:()=>Rt$1.defaultProps.plugins},popperOptions:{default:()=>Rt$1.defaultProps.popperOptions},render:{default:()=>Rt$1.defaultProps.render},showOnCreate:{type:Boolean,default:()=>Rt$1.defaultProps.showOnCreate},touch:{type:[Boolean,String,Array],default:()=>Rt$1.defaultProps.touch},trigger:{default:()=>Rt$1.defaultProps.trigger},triggerTarget:{default:()=>Rt$1.defaultProps.triggerTarget},animateFill:{type:Boolean,default:()=>Rt$1.defaultProps.animateFill},followCursor:{type:[Boolean,String],default:()=>Rt$1.defaultProps.followCursor},inlinePositioning:{type:Boolean,default:()=>Rt$1.defaultProps.inlinePositioning},sticky:{type:[Boolean,String],default:()=>Rt$1.defaultProps.sticky},allowHTML:{type:Boolean,default:()=>Rt$1.defaultProps.allowHTML},animation:{default:()=>Rt$1.defaultProps.animation},arrow:{default:()=>Rt$1.defaultProps.arrow},content:{default:()=>Rt$1.defaultProps.content},inertia:{default:()=>Rt$1.defaultProps.inertia},maxWidth:{default:()=>Rt$1.defaultProps.maxWidth},role:{default:()=>Rt$1.defaultProps.role},theme:{default:()=>Rt$1.defaultProps.theme},zIndex:{default:()=>Rt$1.defaultProps.zIndex}},emits:["state"],setup(r,{slots:o,emit:s,expose:a}){const l=tt$3(),c=tt$3(),u=tt$3(),d=tt$3(!1),m=()=>{let w={...r};for(const T of["to","tag","contentTag","contentClass"])w.hasOwnProperty(T)&&delete w[T];return w};let g=()=>Pft(l);r.to&&(typeof Element<"u"&&r.to instanceof Element?g=()=>r.to:r.to==="parent"?g=()=>{let w=l.value;return w||(w=l.value=c.value.parentElement),w}:(typeof r.to=="string"||r.to instanceof String)&&(g=()=>document.querySelector(r.to)));const y=XS$2(g,m());let _=o.content;!_&&r.to==="parent"&&(_=o.default),qn$2(()=>{d.value=!0,Bi$2(()=>{_&&y.setContent(()=>u.value)})}),Hn$2(y.state,()=>{s("state",It$2(y.state))},{immediate:!0,deep:!0}),Hn$2(()=>r,()=>{y.setProps(m()),_&&y.setContent(()=>u.value)},{deep:!0});let E=Vn$1({elem:l,contentElem:u,mounted:d,...y});return a(E),()=>{const w=(r.contentTag,r.contentTag),T=_?vi$1(w,{ref:u,style:{display:d.value?"inherit":"none"},class:r.contentClass},_(E)):null;if(r.to==="parent"){const R=[];if(!l.value){const M=vi$1("span",{ref:c,"data-v-tippy":"",style:{display:"none"}});R.push(M)}return T&&R.push(T),R}const k=o.default?o.default(E):[];if(!r.tag){const R=vi$1(k[0],{ref:l,"data-v-tippy":""});return T?[R,T]:R}const O=(r.tag,r.tag);return vi$1(O,{ref:l,"data-v-tippy":""},T?[k,T]:k)}}}),Gft=["a11y","allowHTML","arrow","flip","flipOnUpdate","hideOnClick","ignoreAttributes","inertia","interactive","lazy","multiple","showOnInit","touch","touchHold"];let YS$2={};Object.keys(Rt$1.defaultProps).forEach(r=>{Gft.includes(r)?YS$2[r]={type:Boolean,default:function(){return Rt$1.defaultProps[r]}}:YS$2[r]={default:function(){return Rt$1.defaultProps[r]}}});const Fft=ne$1({props:YS$2,setup(r){const o=tt$3([]),{singleton:s}=kft(o,r);return{instances:o,singleton:s}},mounted(){var r;const o=this.$el.parentElement.querySelectorAll("[data-v-tippy]");this.instances=Array.from(o).map(s=>s._tippy).filter(Boolean),(r=this.singleton)===null||r===void 0||r.setInstances(this.instances)},render(){let r=this.$slots.default?this.$slots.default():[];return vi$1(()=>r)}}),jft={mounted(r,o,s){const a=typeof o.value=="string"?{content:o.value}:o.value||{},l=Object.keys(o.modifiers||{}),c=l.find(d=>d!=="arrow"),u=l.findIndex(d=>d==="arrow")!==-1;c&&(a.placement=a.placement||c),u&&(a.arrow=a.arrow!==void 0?a.arrow:!0),s.props&&s.props.onTippyShow&&(a.onShow=function(...d){var m;return(m=s.props)===null||m===void 0?void 0:m.onTippyShow(...d)}),s.props&&s.props.onTippyShown&&(a.onShown=function(...d){var m;return(m=s.props)===null||m===void 0?void 0:m.onTippyShown(...d)}),s.props&&s.props.onTippyHidden&&(a.onHidden=function(...d){var m;return(m=s.props)===null||m===void 0?void 0:m.onTippyHidden(...d)}),s.props&&s.props.onTippyHide&&(a.onHide=function(...d){var m;return(m=s.props)===null||m===void 0?void 0:m.onTippyHide(...d)}),s.props&&s.props.onTippyMount&&(a.onMount=function(...d){var m;return(m=s.props)===null||m===void 0?void 0:m.onTippyMount(...d)}),r.getAttribute("title")&&!a.content&&(a.content=r.getAttribute("title"),r.removeAttribute("title")),r.getAttribute("content")&&!a.content&&(a.content=r.getAttribute("content")),XS$2(r,a)},unmounted(r){r.$tippy?r.$tippy.destroy():r._tippy&&r._tippy.destroy()},updated(r,o){const s=typeof o.value=="string"?{content:o.value}:o.value||{};r.getAttribute("title")&&!s.content&&(s.content=r.getAttribute("title"),r.removeAttribute("title")),r.getAttribute("content")&&!s.content&&(s.content=r.getAttribute("content")),r.$tippy?r.$tippy.setProps(s||{}):r._tippy&&r._tippy.setProps(s||{})}},Uft={install(r,o={}){Rt$1.setDefaultProps(o.defaultProps||{}),r.directive(o.directive||"tippy",jft),r.component(o.component||"tippy",Dft),r.component(o.componentSingleton||"tippy-singleton",Fft)}},$7$1=Rt$1.setDefaultProps;$7$1({ignoreAttributes:!0,plugins:[Rft,Oft,Mft,Tft]});const $ft=ne$1({name:"App",components:{Shell:Jpt},setup(){const r=In$2();qn$2(()=>{new CD$2().observe(r?.proxy?.$refs["app-size"]),$7$1({aria:{content:"labelledby"},theme:"ramp4",animation:"scale",inertia:!0,trigger:"mouseenter manual focus",touch:["hold",200],delay:[300,0],appendTo:()=>document.fullscreenElement||document.body})})}}),Bft=["lang"],Vft={class:"h-full",ref:"app-size"};function zft(r,o,s,a,l,c){const u=vn$2("shell");return pt$1(),wt("div",{class:"ramp-app ramp-styles animation-enabled",lang:r.$i18n.locale},[lt$3("div",Vft,[Zt$2(u)],512)],8,Bft)}const Hft=fo$2($ft,[["render",zft]]),wo$2="focus-list",xu$2="focus-item",Wft="focus-icon",Xft="focus-container",Hp$2=`[${wo$2}],[${Xft}]`,rb$2="truncate-text",ib$2="show-truncate",Wp$2="focused",JS$2=`button,input,select,a,textarea,[contenteditable],[${wo$2}],[${Wft}],[tabIndex]`,Yft={mounted(r,o){+r.getAttribute("tabindex")<=0&&r.setAttribute("tabindex","0"),r.toggleAttribute(wo$2,!0),new Jft(r,o.value)},updated(r){B7$1(r)}};function B7$1(r){r.querySelectorAll(JS$2).forEach(o=>{if(o.closest(Hp$2)===r||o.closest(Hp$2)===o&&o.parentElement.closest(Hp$2)===r)if(o.closest(`[${wo$2}],.${Wp$2}`).classList.contains(Wp$2))o.setAttribute("tabindex","0");else{o.setAttribute("tabindex","-1");return}})}class Jft{element;highlightedItem;isHorizontal;isClicked;isTapped;constructor(o,s){this.element=o,this.highlightedItem=this.element,this.isHorizontal=s==="horizontal",this.isClicked=!1,this.isTapped=!1,this.setTabIndex(-1),this.element.setAttribute("role","group");const a=this;o.addEventListener("keydown",function(l){a.onKeydown(l)}),o.addEventListener("focus",function(){a.onFocus()}),o.addEventListener("blur",function(){a.onBlur()}),o.addEventListener("mousedown",function(){a.onMousedown()}),o.addEventListener("touchstart",function(){a.onTouchstart()}),document.addEventListener("click",function(l){o.contains(l.target)?a.onClick(l):a.defocusItem(a.highlightedItem)})}setTabIndex(o,s=this.element){s.querySelectorAll(JS$2).forEach(a=>{(o===-1||a.closest(Hp$2)===this.element||a.closest(Hp$2)===a&&a.parentElement.closest(Hp$2)===this.element||a.closest(`[${wo$2}],.${Wp$2}`).classList.contains(Wp$2))&&a.setAttribute("tabindex",o.toString())})}defocusItem(o){o.classList.remove(Wp$2),this.setTabIndex(-1,o),o._tippy&&o._tippy.hide(),o.getAttribute(xu$2)===ib$2&&o.querySelector(`[${rb$2}]`)?._tippy?.hide()}focusItem(o){o.classList.add(Wp$2),this.setAriaActiveDescendant(o),this.setTabIndex(0,o),o.scrollIntoView({block:"nearest"}),o._tippy&&!this.isTapped&&o._tippy.show(),o.getAttribute(xu$2)===ib$2&&o.querySelector(`[${rb$2}]`)?._tippy?.show(),this.isTapped=!1}setAriaActiveDescendant(o){this.element.setAttribute("aria-activedescendant",o.getAttribute("id"))}shiftHighlight(o,s=!1){if(this.defocusItem(this.highlightedItem),s)if(this.highlightedItem===this.element)this.highlightedItem=o[o.length-1];else{const a=Array.prototype.indexOf.call(o,this.highlightedItem);this.highlightedItem=o[a-1]||o[o.length-1]}else if(this.highlightedItem===this.element)this.highlightedItem=o[0];else{const a=Array.prototype.indexOf.call(o,this.highlightedItem);this.highlightedItem=o[a+1]||o[0]}this.element.focus(),this.focusItem(this.highlightedItem)}onKeydown(o){const s=this,a=Array.prototype.filter.call(this.element.querySelectorAll(`[${xu$2}]`),l=>l.closest(`[${wo$2}]`)===s.element&&!!l.offsetParent);if(a.length!==0)switch(o.key){case"Up":case"ArrowUp":if(this.isHorizontal)break;o.preventDefault(),o.stopPropagation(),this.shiftHighlight(a,!0);break;case"Down":case"ArrowDown":if(this.isHorizontal)break;o.preventDefault(),o.stopPropagation(),this.shiftHighlight(a);break;case"Left":case"ArrowLeft":if(!this.isHorizontal)break;o.preventDefault(),o.stopPropagation(),this.shiftHighlight(a,!0);break;case"Right":case"ArrowRight":if(!this.isHorizontal)break;o.preventDefault(),o.stopPropagation(),this.shiftHighlight(a);break;case"Esc":case"Escape":this.highlightedItem!==this.element&&(o.preventDefault(),o.stopPropagation(),this.defocusItem(this.highlightedItem),this.highlightedItem=this.element,this.element.removeAttribute("aria-activedescendant"),this.element.focus());break;case"Enter":case" ":o.target===this.element&&this.highlightedItem!==this.element&&(o.preventDefault(),o.stopPropagation(),this.highlightedItem.click());break;case"Tab":this.highlightedItem!==this.element&&(this.highlightedItem.querySelectorAll(JS$2).length===0&&this.defocusItem(this.highlightedItem),o.shiftKey&&(o.preventDefault(),o.stopPropagation(),this.defocusItem(this.highlightedItem),this.highlightedItem=this.element,this.element.removeAttribute("aria-activedescendant"),this.element.focus()))}}onClick(o){this.defocusItem(this.highlightedItem);let s=o.target;if(!s.hasAttribute(wo$2))for(;s.parentElement.closest(`[${wo$2}]`)!==this.element;)s=s.parentElement.closest(`[${wo$2}]`);this.highlightedItem=s.closest(`[${xu$2}]`)||s.closest(`[${wo$2}]`)||this.highlightedItem,s.hasAttribute(`${xu$2}`)&&this.element.focus(),this.highlightedItem!==this.element?this.focusItem(this.highlightedItem):this.element.removeAttribute("aria-activedescendant")}onFocus(){this.highlightedItem&&!this.isClicked&&(this.highlightedItem._tippy&&this.highlightedItem._tippy.show(),this.highlightedItem.getAttribute(xu$2)===ib$2&&this.highlightedItem.querySelector(`[${rb$2}]`)?._tippy?.show()),this.isClicked=!1,this.element.hasAttribute("aria-activedescendant")||this.highlightedItem===this.element?this.highlightedItem!==this.element&&this.focusItem(this.highlightedItem):this.setAriaActiveDescendant(this.highlightedItem),B7$1(this.element),this.highlightedItem&&this.highlightedItem!==this.element&&this.highlightedItem.setAttribute("tabindex","-1")}onBlur(){this.highlightedItem&&(this.highlightedItem._tippy&&this.highlightedItem._tippy.hide(),this.highlightedItem.getAttribute(xu$2)===ib$2&&this.highlightedItem.querySelector(`[${rb$2}]`)?._tippy?.hide())}onMousedown(){this.isClicked=!0}onTouchstart(){this.isTapped=!0}}const V7$1="focus-item",qft={beforeMount(r,o){r.hasAttribute("id")||r.setAttribute("id",Zft()),o.value?r.setAttribute(V7$1,o.value):r.toggleAttribute(V7$1,!0)}};function Zft(){let r;do r="focus-item-"+Math.random().toString(36).substring(2,9);while(document.getElementById(r)!==null);return r}const qS$2="focus-container",z7$1="focus-list",Qft="focus-icon",ZS$2=`[${z7$1}],[${qS$2}]`,H7$1=`button,input,select,a,textarea,[contenteditable],.ag-tab-guard,[${z7$1}],[${qS$2}],[${Qft}],[tabIndex]`;let QS$2=[];const Kft={mounted(r){[...document.querySelectorAll(".inner-shell")].some(o=>o.contains(r))&&QS$2.push(new tmt(r))},beforeUnmount(r){QS$2=QS$2.filter(o=>o.element===r?(o.removeEventListeners(),!1):!0)}};class tmt{element;constructor(o){this.element=o,this.element.toggleAttribute(qS$2,!0),this.element.tabIndex=0,setTimeout(()=>this.disableTabbing(),600);const s=this;this.element.addEventListener("keypress",function(a){s.onKeypress(a)}),this.element.addEventListener("click",function(){s.onClick()}),this.element.addEventListener("focusout",function(a){s.onFocusOut(a)}),this.element.addEventListener("focus",function(){s.onFocus()})}removeEventListeners(){const o=this;this.element.removeEventListener("keypress",function(s){o.onKeypress(s)}),this.element.removeEventListener("click",function(){o.onClick()}),this.element.removeEventListener("focusout",function(s){o.onFocusOut(s)}),this.element.removeEventListener("focus",function(){o.onFocus()})}onKeypress(o){o.target===this.element&&(o.key==="Enter"||o.key===" ")&&this.enableTabbing().focus()}onClick(){this.enableTabbing()}onFocusOut(o){this.element.contains(o.relatedTarget)||this.disableTabbing()}onFocus(){this.disableTabbing()}disableTabbing(){Array.prototype.filter.call(this.element.querySelectorAll(H7$1),()=>!0).forEach(o=>{o.tabIndex=-1})}enableTabbing(){let o;return Array.prototype.map.call(this.element.querySelectorAll(H7$1),s=>{(s.closest(ZS$2)===this.element||s.closest(ZS$2)===s&&s.parentElement.closest(ZS$2)===this.element)&&s.offsetParent&&(s.tabIndex=0,o===void 0&&(o=s))}),o}}const emt="aaa1rp3barth4b_ott3vie4c1le2ogado5udhabi7c_ademy5centure6ountant_s9o1tor4d_s1ult4e_g1ro2tna4f_l1rica5g_akhan5ency5i_g1rbus3force5tel5kdn3l_faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m_azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o_l2partments8p_le4q_uarelle8r_ab1mco4chi3my2pa2t_e3s_da2ia2sociates9t_hleta5torney7u_ction5di_ble3o3spost5thor3o_s4vianca6w_s2x_a2z_ure5ba_by2idu3namex3narepublic11d1k2r_celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b_c1t1va3cg1n2d1e_ats2uty4er2ntley5rlin4st_buy5t2f1g1h_arti5i_ble3d1ke2ng_o3o1z2j1lack_friday9ockbuster8g1omberg7ue3m_s1w2n_pparibas9o_ats3ehringer8fa2m1nd2o_k_ing5sch2tik2on4t1utique6x2r_adesco6idgestone9oadway5ker3ther5ussels7s1t1uild_ers6siness6y1zz3v1w1y1z_h3ca_b1fe2l_l1vinklein9m_era3p2non3petown5ital_one8r_avan4ds2e_er_s4s2sa1e1h1ino4t_ering5holic7ba1n1re2s2c1d1enter4o1rn3f_a1d2g1h_anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i_priani6rcle4sco3tadel4i_c2y_eats7k1l_aims4eaning6ick2nic1que6othing5ud3ub_med6m1n1o_ach3des3ffee4llege4ogne5m_cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking_channel11l1p2rsica5untry4pon_s4rses6pa2r_edit_card4union9icket5own3s1uise_s6u_isinella9v1w1x1y_mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e_al_er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si_gn4v2hl2iamonds6et2gital5rect_ory7scount3ver5h2y2j1k1m1np2o_cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c_o2deka3u_cation8e1g1mail3erck5nergy4gineer_ing9terprises10pson4quipment8r_icsson6ni3s_q1tate5t_isalat7u_rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n_s2rm_ers5shion4t3edex3edback6rrari3ero6i_at2delity5o2lm2nal1nce1ial7re_stone6mdale6sh_ing5t_ness6j1k1lickr3ghts4r2orist4wers5y2m1o_o_d_network8tball6rd1ex2sale4um3undation8x2r_ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n_d2rniture7tbol5yi3ga_l_lery3o1up4me_s3p1rden4y2b_iz3d_n2e_a1nt_ing5orge5f1g_ee3h1i_ft_s3ves2ing5l_ass3e1obal2o4m_ail3bh2o1x2n1odaddy5ld_point6f2o_dyear5g_le4p1t1v2p1q1r_ainger5phics5tis4een3ipe3ocery4up4s1t1u_ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc_bank7ealth_care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k_t2m1n1ockey4ldings5iday5medepot5goods5s_ense7nda3rse3spital5t_ing5t_eles2s3mail5use3w2r1sbc3t1u_ghes5yatt3undai7ibm2cbc2e1u2d1e_ee3fm2kano4l1m_amat4db2mo_bilien9n_c1dustries8finiti5o2g1k1stitute6urance4e4t_ernational10uit4vestments10o1piranga7q1r_ish4s_maili5t_anbul7t_au2v3jaguar4va3cb2e_ep2tzt3welry6io2ll2m_p2nj2o_bs1urg4t1y2p_morgan6rs3uegos4niper7kaufen5ddi3e_rryhotels6logistics9properties14fh2g1h1i_a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p_mg2n2r_d1ed3uokgroup8w1y_oto4z2la_caixa5mborghini8er3ncaster5ia3d_rover6xess5salle5t_ino3robe5w_yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i_dl2fe_insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan_s3cker3us3l1ndon4tte1o3ve3pl_financial11r1s1t_d_a3u_ndbeck6xe1ury5v1y2ma_cys3drid4if1son4keup4n_agement7go3p1rket_ing3s4riott5shalls7serati6ttel5ba2c_kinsey7d1e_d_ia3et2lbourne7me1orial6n_u2rckmsd7g1h1iami3crosoft7l1ni1t2t_subishi9k1l_b1s2m_a2n1o_bi_le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to_rcycles9v_ie4p1q1r1s_d2t_n1r2u_seum3ic3tual5v1w1x1y1z2na_b1goya4me2tura4vy3ba2c1e_c1t_bank4flix4work5ustar5w_s2xt_direct7us4f_l2g_o2hk2i_co2ke1on3nja3ssan1y5l1o_kia3rthwesternmutual14on4w_ruz3tv4p1r_a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan_group9dnavy5lo3m_ega4ne1g1l_ine5oo2pen3racle3nge4g_anic5igins6saka4tsuka4t2vh3pa_ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e_t2f_izer5g1h_armacy6d1ilips5one2to_graphy6s4ysio5ics1tet2ures6d1n_g1k2oneer5zza4k1l_ace2y_station9umbing5s3m1n_c2ohl2ker3litie5rn2st3r_america6xi3ess3ime3o_d_uctions8f1gressive8mo2perties3y5tection8u_dential9s1t1ub2w_c2y2qa1pon3uebec3st5racing4dio4e_ad1lestate6tor2y4cipes5d_stone5umbrella9hab3ise_n3t2liance6n_t_als5pair3ort3ublican8st_aurant8view_s5xroth6ich_ardli6oh3l1o1p2o_cher3ks3deo3gers4om3s_vp3u_gby3hr2n2w_e2yukyu6sa_arland6fe_ty4kura4le1on3msclub4ung5ndvik_coromant12ofi4p1rl2s1ve2xo3b_i1s2c_a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e_arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x_y3fr2g1h_angrila6rp2w2ell3ia1ksha5oes2p_ping5uji3w_time7i_lk2na1gles5te3j1k_i_n2y_pe4l_ing4m_art3ile4n_cf3o_ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa_ce3ort2t3r_l2s1t_ada2ples4r1tebank4farm7c_group6ockholm6rage3e3ream4udio2y3yle4u_cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y_dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x_i3c_i2d_k2eam2ch_nology8l1masek5nnis4va3f1g1h_d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j_maxx4x2k_maxx5l1m_all4n1o_day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r_ade1ing4ining5vel_channel7ers_insurance16ust3v2t1ube2i1nes3shu4v_s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va_cations7na1guard7c1e_gas3ntures6risign5mögensberater2ung14sicherung10t2g1i_ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u_elos6wales2mart4ter4ng_gou5tch_es6eather_channel12bcam3er2site5d_ding5ibo2r3f1hoswho6ien2ki2lliamhill9n_dows4e1ners6me2olterskluwer11odside6rk_s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u_tube6t1un3za_ppos4ra3ero3ip2m1one3uerich6w2",nmt="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत_म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里_大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Xp$2=(r,o)=>{for(const s in o)r[s]=o[s];return r},KS$2="numeric",t4$1="ascii",e4$1="alpha",sb$2="asciinumeric",ob$2="alphanumeric",n4$1="domain",W7$1="emoji",rmt="scheme",imt="slashscheme",X7$1="whitespace";function smt$1(r,o){return r in o||(o[r]=[]),o[r]}function Eu$2(r,o,s){o[KS$2]&&(o[sb$2]=!0,o[ob$2]=!0),o[t4$1]&&(o[sb$2]=!0,o[e4$1]=!0),o[sb$2]&&(o[ob$2]=!0),o[e4$1]&&(o[ob$2]=!0),o[ob$2]&&(o[n4$1]=!0),o[W7$1]&&(o[n4$1]=!0);for(const a in o){const l=smt$1(a,s);l.indexOf(r)<0&&l.push(r)}}function omt(r,o){const s={};for(const a in o)o[a].indexOf(r)>=0&&(s[a]=!0);return s}function Ei$2(r){r===void 0&&(r=null),this.j={},this.jr=[],this.jd=null,this.t=r}Ei$2.groups={},Ei$2.prototype={accepts(){return!!this.t},go(r){const o=this,s=o.j[r];if(s)return s;for(let a=0;ar.ta(o,s,a,l),rs$2=(r,o,s,a,l)=>r.tr(o,s,a,l),Y7$1=(r,o,s,a,l)=>r.ts(o,s,a,l),mt=(r,o,s,a,l)=>r.tt(o,s,a,l),pa$2="WORD",r4$1="UWORD",i0$2="LOCALHOST",i4$1="TLD",s4$1="UTLD",ab$2="SCHEME",Yp$2="SLASH_SCHEME",lb$1="NUM",J7$1="WS",o4$1="NL",Jp$2="OPENBRACE",s0$2="OPENBRACKET",o0$1="OPENANGLEBRACKET",a0$1="OPENPAREN",Tu$2="CLOSEBRACE",qp$2="CLOSEBRACKET",Zp$2="CLOSEANGLEBRACKET",Su$2="CLOSEPAREN",cb$1="AMPERSAND",ub$2="APOSTROPHE",hb$2="ASTERISK",Vl$2="AT",pb$2="BACKSLASH",db$2="BACKTICK",fb$2="CARET",zl$2="COLON",a4$1="COMMA",mb$2="DOLLAR",xo$2="DOT",yb$2="EQUALS",l4$1="EXCLAMATION",Eo$2="HYPHEN",gb$2="PERCENT",vb$2="PIPE",bb$2="PLUS",_b$2="POUND",wb$2="QUERY",c4$1="QUOTE",u4$1="SEMI",da$2="SLASH",l0$2="TILDE",xb$2="UNDERSCORE",q7$1="EMOJI",Eb$2="SYM";var Z7$1=Object.freeze({__proto__:null,WORD:pa$2,UWORD:r4$1,LOCALHOST:i0$2,TLD:i4$1,UTLD:s4$1,SCHEME:ab$2,SLASH_SCHEME:Yp$2,NUM:lb$1,WS:J7$1,NL:o4$1,OPENBRACE:Jp$2,OPENBRACKET:s0$2,OPENANGLEBRACKET:o0$1,OPENPAREN:a0$1,CLOSEBRACE:Tu$2,CLOSEBRACKET:qp$2,CLOSEANGLEBRACKET:Zp$2,CLOSEPAREN:Su$2,AMPERSAND:cb$1,APOSTROPHE:ub$2,ASTERISK:hb$2,AT:Vl$2,BACKSLASH:pb$2,BACKTICK:db$2,CARET:fb$2,COLON:zl$2,COMMA:a4$1,DOLLAR:mb$2,DOT:xo$2,EQUALS:yb$2,EXCLAMATION:l4$1,HYPHEN:Eo$2,PERCENT:gb$2,PIPE:vb$2,PLUS:bb$2,POUND:_b$2,QUERY:wb$2,QUOTE:c4$1,SEMI:u4$1,SLASH:da$2,TILDE:l0$2,UNDERSCORE:xb$2,EMOJI:q7$1,SYM:Eb$2});const Qp$2=/[a-z]/,h4$1=/\p{L}/u,p4$1=/\p{Emoji}/u,d4$1=/\d/,Q7$1=/\s/,K7$1=` -`,amt="️",lmt="‍";let Tb$2=null,Sb$2=null;function cmt(r){r===void 0&&(r=[]);const o={};Ei$2.groups=o;const s=new Ei$2;Tb$2==null&&(Tb$2=tG$1(emt)),Sb$2==null&&(Sb$2=tG$1(nmt)),mt(s,"'",ub$2),mt(s,"{",Jp$2),mt(s,"[",s0$2),mt(s,"<",o0$1),mt(s,"(",a0$1),mt(s,"}",Tu$2),mt(s,"]",qp$2),mt(s,">",Zp$2),mt(s,")",Su$2),mt(s,"&",cb$1),mt(s,"*",hb$2),mt(s,"@",Vl$2),mt(s,"`",db$2),mt(s,"^",fb$2),mt(s,":",zl$2),mt(s,",",a4$1),mt(s,"$",mb$2),mt(s,".",xo$2),mt(s,"=",yb$2),mt(s,"!",l4$1),mt(s,"-",Eo$2),mt(s,"%",gb$2),mt(s,"|",vb$2),mt(s,"+",bb$2),mt(s,"#",_b$2),mt(s,"?",wb$2),mt(s,'"',c4$1),mt(s,"/",da$2),mt(s,";",u4$1),mt(s,"~",l0$2),mt(s,"_",xb$2),mt(s,"\\",pb$2);const a=rs$2(s,d4$1,lb$1,{[KS$2]:!0});rs$2(a,d4$1,a);const l=rs$2(s,Qp$2,pa$2,{[t4$1]:!0});rs$2(l,Qp$2,l);const c=rs$2(s,h4$1,r4$1,{[e4$1]:!0});rs$2(c,Qp$2),rs$2(c,h4$1,c);const u=rs$2(s,Q7$1,J7$1,{[X7$1]:!0});mt(s,K7$1,o4$1,{[X7$1]:!0}),mt(u,K7$1),rs$2(u,Q7$1,u);const d=rs$2(s,p4$1,q7$1,{[W7$1]:!0});rs$2(d,p4$1,d),mt(d,amt,d);const m=mt(d,lmt);rs$2(m,p4$1,d);const g=[[Qp$2,l]],y=[[Qp$2,null],[h4$1,c]];for(let _=0;__[0]>E[0]?1:-1);for(let _=0;_=0?w[n4$1]=!0:Qp$2.test(E)?d4$1.test(E)?w[sb$2]=!0:w[t4$1]=!0:w[KS$2]=!0,Y7$1(s,E,E,w)}return Y7$1(s,"localhost",i0$2,{ascii:!0}),s.jd=new Ei$2(Eb$2),{start:s,tokens:Xp$2({groups:o},Z7$1)}}function umt(r,o){const s=hmt(o.replace(/[A-Z]/g,d=>d.toLowerCase())),a=s.length,l=[];let c=0,u=0;for(;u=0&&(_+=s[u].length,E++),g+=s[u].length,c+=s[u].length,u++;c-=_,u-=E,g-=_,l.push({t:y.t,v:o.slice(c-g,c),s:c-g,e:c})}return l}function hmt(r){const o=[],s=r.length;let a=0;for(;a56319||a+1===s||(c=r.charCodeAt(a+1))<56320||c>57343?r[a]:r.slice(a,a+2);o.push(u),a+=u.length}return o}function Hl$2(r,o,s,a,l){let c;const u=o.length;for(let d=0;d=0;)c++;if(c>0){o.push(s.join(""));let u=parseInt(r.substring(a,a+c),10);for(;u>0;u--)s.pop();a+=c}else r[a]==="_"?(o.push(s.join("")),a++):(s.push(r[a]),a++)}return o}const c0$1={defaultProtocol:"http",events:null,format:eG$1,formatHref:eG$1,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function f4$1(r,o){o===void 0&&(o=null);let s=Xp$2({},c0$1);r&&(s=Xp$2(s,r instanceof f4$1?r.o:r));const a=s.ignoreTags,l=[];for(let c=0;cs?a.substring(0,s)+"…":a},toFormattedHref(r){return r.get("formatHref",this.toHref(r.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(r){return r===void 0&&(r=c0$1.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(r),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(r){return{type:this.t,value:this.toFormattedString(r),isLink:this.isLink,href:this.toFormattedHref(r),start:this.startIndex(),end:this.endIndex()}},validate(r){return r.get("validate",this.toString(),this)},render(r){const o=this,s=this.toFormattedHref(r),a=r.get("tagName",s,o),l=this.toFormattedString(r),c={},u=r.get("className",s,o),d=r.get("target",s,o),m=r.get("rel",s,o),g=r.getObj("attributes",s,o),y=r.getObj("events",s,o);return c.href=s,u&&(c.class=u),d&&(c.target=d),m&&(c.rel=m),g&&Xp$2(c,g),{tagName:a,attributes:c,content:l,eventListeners:y}}};function Ab$2(r,o){class s extends nG$1{constructor(l,c){super(l,c),this.t=r}}for(const a in o)s.prototype[a]=o[a];return s.t=r,s}const rG$1=Ab$2("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),iG$1=Ab$2("text"),pmt=Ab$2("nl"),Au$2=Ab$2("url",{isLink:!0,toHref(r){return r===void 0&&(r=c0$1.defaultProtocol),this.hasProtocol()?this.v:`${r}://${this.v}`},hasProtocol(){const r=this.tk;return r.length>=2&&r[0].t!==i0$2&&r[1].t===zl$2}}),Kn$2=r=>new Ei$2(r);function dmt(r){let{groups:o}=r;const s=o.domain.concat([cb$1,hb$2,Vl$2,pb$2,db$2,fb$2,mb$2,yb$2,Eo$2,lb$1,gb$2,vb$2,bb$2,_b$2,da$2,Eb$2,l0$2,xb$2]),a=[ub$2,Zp$2,Tu$2,qp$2,Su$2,zl$2,a4$1,xo$2,l4$1,o0$1,Jp$2,s0$2,a0$1,wb$2,c4$1,u4$1],l=[cb$1,ub$2,hb$2,pb$2,db$2,fb$2,Tu$2,mb$2,yb$2,Eo$2,lb$1,Jp$2,gb$2,vb$2,bb$2,_b$2,wb$2,da$2,Eb$2,l0$2,xb$2],c=Kn$2(),u=mt(c,l0$2);kt$2(u,l,u),kt$2(u,o.domain,u);const d=Kn$2(),m=Kn$2(),g=Kn$2();kt$2(c,o.domain,d),kt$2(c,o.scheme,m),kt$2(c,o.slashscheme,g),kt$2(d,l,u),kt$2(d,o.domain,d);const y=mt(d,Vl$2);mt(u,Vl$2,y),mt(m,Vl$2,y),mt(g,Vl$2,y);const _=mt(u,xo$2);kt$2(_,l,u),kt$2(_,o.domain,u);const E=Kn$2();kt$2(y,o.domain,E),kt$2(E,o.domain,E);const w=mt(E,xo$2);kt$2(w,o.domain,E);const T=Kn$2(rG$1);kt$2(w,o.tld,T),kt$2(w,o.utld,T),mt(y,i0$2,T);const k=mt(E,Eo$2);kt$2(k,o.domain,E),kt$2(T,o.domain,E),mt(T,xo$2,w),mt(T,Eo$2,k);const O=mt(T,zl$2);kt$2(O,o.numeric,rG$1);const R=mt(d,Eo$2),M=mt(d,xo$2);kt$2(R,o.domain,d),kt$2(M,l,u),kt$2(M,o.domain,d);const N=Kn$2(Au$2);kt$2(M,o.tld,N),kt$2(M,o.utld,N),kt$2(N,o.domain,d),kt$2(N,l,u),mt(N,xo$2,M),mt(N,Eo$2,R),mt(N,Vl$2,y);const D=mt(N,zl$2),P=Kn$2(Au$2);kt$2(D,o.numeric,P);const I=Kn$2(Au$2),L=Kn$2();kt$2(I,s,I),kt$2(I,a,L),kt$2(L,s,I),kt$2(L,a,L),mt(N,da$2,I),mt(P,da$2,I);const F=mt(m,zl$2),U=mt(g,zl$2),J=mt(U,da$2);mt(J,da$2,F),kt$2(m,o.domain,d),mt(m,xo$2,M),mt(m,Eo$2,R),kt$2(g,o.domain,d),mt(g,xo$2,M),mt(g,Eo$2,R),kt$2(F,o.domain,I),mt(F,da$2,I);const z=mt(I,Jp$2),ie=mt(I,s0$2),ce=mt(I,o0$1),Y=mt(I,a0$1);mt(L,Jp$2,z),mt(L,s0$2,ie),mt(L,o0$1,ce),mt(L,a0$1,Y),mt(z,Tu$2,I),mt(ie,qp$2,I),mt(ce,Zp$2,I),mt(Y,Su$2,I),mt(z,Tu$2,I);const B=Kn$2(Au$2),V=Kn$2(Au$2),Ge=Kn$2(Au$2),St=Kn$2(Au$2);kt$2(z,s,B),kt$2(ie,s,V),kt$2(ce,s,Ge),kt$2(Y,s,St);const Dee=Kn$2(),pee=Kn$2(),jr=Kn$2(),Tee=Kn$2();return kt$2(z,a),kt$2(ie,a),kt$2(ce,a),kt$2(Y,a),kt$2(B,s,B),kt$2(V,s,V),kt$2(Ge,s,Ge),kt$2(St,s,St),kt$2(B,a,B),kt$2(V,a,V),kt$2(Ge,a,Ge),kt$2(St,a,St),kt$2(Dee,s,Dee),kt$2(pee,s,V),kt$2(jr,s,Ge),kt$2(Tee,s,St),kt$2(Dee,a,Dee),kt$2(pee,a,pee),kt$2(jr,a,jr),kt$2(Tee,a,Tee),mt(V,qp$2,I),mt(Ge,Zp$2,I),mt(St,Su$2,I),mt(B,Tu$2,I),mt(pee,qp$2,I),mt(jr,Zp$2,I),mt(Tee,Su$2,I),mt(Dee,Su$2,I),mt(c,i0$2,N),mt(c,o4$1,pmt),{start:c,tokens:Z7$1}}function fmt(r,o,s){let a=s.length,l=0,c=[],u=[];for(;l=0&&E++,l++,y++;if(E<0)l-=y,l0&&(c.push(m4$1(iG$1,o,u)),u=[]),l-=E,y-=E;const w=_.t,T=s.slice(l-y,l);c.push(m4$1(w,o,T))}}return u.length>0&&c.push(m4$1(iG$1,o,u)),c}function m4$1(r,o,s){const a=s[0].s,l=s[s.length-1].e,c=o.slice(a,l);return new r(c,s)}const Gr$2={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function mmt(){Gr$2.scanner=cmt(Gr$2.customSchemes);for(let r=0;r",lt:"<",nbsp:" ",quot:'"'},vmt=/^#[xX]([A-Fa-f0-9]+)$/,bmt=/^#([0-9]+)$/,_mt=/^([A-Za-z0-9]+)$/,wmt=function(){function r(o){this.named=o}return r.prototype.parse=function(o){if(o){var s=o.match(vmt);if(s)return String.fromCharCode(parseInt(s[1],16));if(s=o.match(bmt),s)return String.fromCharCode(parseInt(s[1],10));if(s=o.match(_mt),s)return this.named[s[1]]||"&"+s[1]+";"}},r}(),xmt=/[\t\n\f ]/,Emt=/[A-Za-z]/,Tmt=/\r\n?/g;function Sr$2(r){return xmt.test(r)}function sG$1(r){return Emt.test(r)}function Smt(r){return r.replace(Tmt,` -`)}var Amt=function(){function r(o,s,a){a===void 0&&(a="precompile"),this.delegate=o,this.entityParser=s,this.mode=a,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var l=this.peek();if(l==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&l===` -`){var c=this.tagNameBuffer.toLowerCase();(c==="pre"||c==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var l=this.peek(),c=this.tagNameBuffer;l==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):l==="&"&&c!=="script"&&c!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(l))},tagOpen:function(){var l=this.consume();l==="!"?this.transitionTo("markupDeclarationOpen"):l==="/"?this.transitionTo("endTagOpen"):(l==="@"||l===":"||sG$1(l))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(l))},markupDeclarationOpen:function(){var l=this.consume();if(l==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var c=l.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();c==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var l=this.consume();Sr$2(l)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var l=this.consume();Sr$2(l)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(l.toLowerCase()))},doctypeName:function(){var l=this.consume();Sr$2(l)?this.transitionTo("afterDoctypeName"):l===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(l.toLowerCase())},afterDoctypeName:function(){var l=this.consume();if(!Sr$2(l))if(l===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var c=l.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),u=c.toUpperCase()==="PUBLIC",d=c.toUpperCase()==="SYSTEM";(u||d)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),u?this.transitionTo("afterDoctypePublicKeyword"):d&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var l=this.peek();Sr$2(l)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):l==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):l==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):l===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var l=this.consume();l==='"'?this.transitionTo("afterDoctypePublicIdentifier"):l===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(l)},doctypePublicIdentifierSingleQuoted:function(){var l=this.consume();l==="'"?this.transitionTo("afterDoctypePublicIdentifier"):l===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(l)},afterDoctypePublicIdentifier:function(){var l=this.consume();Sr$2(l)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):l===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):l==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):l==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var l=this.consume();Sr$2(l)||(l===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):l==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):l==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var l=this.consume();l==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):l===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(l)},doctypeSystemIdentifierSingleQuoted:function(){var l=this.consume();l==="'"?this.transitionTo("afterDoctypeSystemIdentifier"):l===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(l)},afterDoctypeSystemIdentifier:function(){var l=this.consume();Sr$2(l)||l===">"&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var l=this.consume();l==="-"?this.transitionTo("commentStartDash"):l===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(l),this.transitionTo("comment"))},commentStartDash:function(){var l=this.consume();l==="-"?this.transitionTo("commentEnd"):l===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var l=this.consume();l==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(l)},commentEndDash:function(){var l=this.consume();l==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+l),this.transitionTo("comment"))},commentEnd:function(){var l=this.consume();l===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+l),this.transitionTo("comment"))},tagName:function(){var l=this.consume();Sr$2(l)?this.transitionTo("beforeAttributeName"):l==="/"?this.transitionTo("selfClosingStartTag"):l===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(l)},endTagName:function(){var l=this.consume();Sr$2(l)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):l==="/"?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):l===">"?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(l)},beforeAttributeName:function(){var l=this.peek();if(Sr$2(l)){this.consume();return}else l==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):l===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):l==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(l)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var l=this.peek();Sr$2(l)?(this.transitionTo("afterAttributeName"),this.consume()):l==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):l==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):l===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):l==='"'||l==="'"||l==="<"?(this.delegate.reportSyntaxError(l+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(l)):(this.consume(),this.delegate.appendToAttributeName(l))},afterAttributeName:function(){var l=this.peek();if(Sr$2(l)){this.consume();return}else l==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):l==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):l===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(l))},beforeAttributeValue:function(){var l=this.peek();Sr$2(l)?this.consume():l==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):l==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):l===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(l))},attributeValueDoubleQuoted:function(){var l=this.consume();l==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):l==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(l)},attributeValueSingleQuoted:function(){var l=this.consume();l==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):l==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(l)},attributeValueUnquoted:function(){var l=this.peek();Sr$2(l)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):l==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):l==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):l===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(l))},afterAttributeValueQuoted:function(){var l=this.peek();Sr$2(l)?(this.consume(),this.transitionTo("beforeAttributeName")):l==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):l===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){var l=this.peek();l===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var l=this.consume();(l==="@"||l===":"||sG$1(l))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(l))}},this.reset()}return r.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},r.prototype.transitionTo=function(o){this.state=o},r.prototype.tokenize=function(o){this.reset(),this.tokenizePart(o),this.tokenizeEOF()},r.prototype.tokenizePart=function(o){for(this.input+=Smt(o);this.index"||o==="style"&&this.input.substring(this.index,this.index+8)!==""||o==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},r}(),Imt=function(){function r(o,s){s===void 0&&(s={}),this.options=s,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new Amt(this,o,s.mode),this._currentAttribute=void 0}return r.prototype.tokenize=function(o){return this.tokens=[],this.tokenizer.tokenize(o),this.tokens},r.prototype.tokenizePart=function(o){return this.tokens=[],this.tokenizer.tokenizePart(o),this.tokens},r.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},r.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},r.prototype.current=function(){var o=this.token;if(o===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return o;for(var s=0;s=0))continue;let g=a.length;Rmt(m,s,++u,a),u+=a.length-g-1}else if(d.type!==y4$1)a.push(d);else{const m=Cmt(d.chars,c);a.push.apply(a,m)}}for(let u=0;u0&&(m+=" "+Pmt(d.attributes).join(" ")),d.selfClosing&&(m+=" /"),m+=">",l.push(m);break}case aG$1:l.push(``);break;case y4$1:l.push(g4$1(d.chars));break;case Nmt:l.push(``);break;case Omt:{let m=`",l.push(m);break}}}return l.join("")}function Cmt(r,o){const s=ymt(r),a=[];for(let l=0;l0;){let c=o[s];c.type===Ib$2&&c.tagName.toUpperCase()===r?l++:c.type===aG$1&&c.tagName.toUpperCase()===r&&l--,a.push(c),s++}return a}function kmt(r){let{tagName:o,attributes:s,content:a}=r;return`<${o} ${Lmt(s)}>${g4$1(a)}`}function g4$1(r){return r.replace(/&/g,"&").replace(//g,">")}function cG$1(r){return r.replace(/"/g,""")}function Lmt(r){const o=[];for(const s in r){const a=r[s]+"";o.push(`${s}="${cG$1(a)}"`)}return o.join(" ")}function Pmt(r){const o=[];for(let s=0;s/^https?:\/\//.test(s)}});return o=`
${o}
`,o}const Umt=["content"],$mt={key:0,class:"flex flex-shrink-0 items-center border-b border-solid border-gray-600 px-8 h-48 overflow-hidden"},Bmt={class:"flex-grow text-lg py-16 pl-8 min-w-0",tabIndex:"0"},Vmt={key:1},zmt={key:0,class:"flex"},Hmt=["innerHTML"],Wmt={key:2,class:"px-8 py-16 border-t border-gray-400 default-focus-style"},Xmt=ne$1({__name:"panel-screen",props:{header:{type:Boolean,default:!0},content:{type:Boolean,default:!0},footer:{type:Boolean,default:!1},panel:{type:Object,required:!0},screenId:{type:String,required:!1}},setup(r,{expose:o}){const{t:s}=Ke$1(),a=Ul$2(),l=Gm$2(),c=Pn$2("iApi"),u=cm$2("el"),d=cm$2("contentEl"),m=tt$3();o({el:u});const g=r,y=te(()=>c?.fixture.get("appbar")?l.temporary:[]),_=te(()=>a.mobileView),E=te(()=>a.reorderable),w=R=>R.scrollHeight>R.clientHeight,T=()=>!_.value&&!g.panel.teleport,k=R=>{g.panel.move(R),R==="left"&&Bi$2(()=>{(u.value?.querySelector(".move-left")).focus()})},O=te(()=>g.screenId?g.panel.screens[g.screenId][c?.$i18n.locale.value??"en"]:null);return qn$2(()=>{u.value?.addEventListener("blur",()=>{u.value._tippy.hide()}),u.value?.addEventListener("keyup",R=>{R.key==="Tab"&&u.value?.matches(":focus")&&u.value._tippy.show()}),m.value=new ResizeObserver(()=>{w(d.value)?d.value?.setAttribute("tabIndex","0"):d.value?.removeAttribute("tabIndex")}),m.value.observe(d.value)}),zi$1(()=>{u.value?.removeEventListener("blur",()=>{u.value._tippy.hide()}),u.value?.removeEventListener("keyup",R=>{R.key==="Tab"&&u.value?.matches(":focus")&&u.value._tippy.show()}),m.value.disconnect()}),(R,M)=>{const N=vn$2("back"),D=vn$2("panel-options-menu"),P=vn$2("left"),I=vn$2("right"),L=vn$2("pin"),F=vn$2("expand"),U=vn$2("minimize"),J=vn$2("close"),z=Ie$2("truncate"),ie=Ie$2("focus-item"),ce=Ie$2("tippy");return Ae$1((pt$1(),wt("div",{class:"h-full flex flex-col items-stretch",content:`
${It$2(s)(r.panel.alertName)+". "+It$2(s)("panels.access")}
`,ref_key:"el",ref:u},[r.header?(pt$1(),wt("header",$mt,[Zt$2(N,{class:an$2(r.panel.teleport?"display-none":"block sm:display-none"),onClick:M[0]||(M[0]=Y=>r.panel.close())},null,8,["class"]),Ae$1((pt$1(),wt("h2",Bmt,[R.$slots.header?Hi$2(R.$slots,"header",{key:0}):(pt$1(),wt("div",Vmt,$e$1(It$2(s)(r.panel.alertName)),1))])),[[z]]),R.$slots.controls?(pt$1(),Be(D,{key:0},{default:gn$1(()=>[Hi$2(R.$slots,"controls")]),_:3})):We$1("",!0),lt$3("div",{class:an$2(r.panel.teleport?"flex":"display-none sm:flex")},[r.panel.teleport?We$1("",!0):(pt$1(),wt("div",zmt,[E.value?(pt$1(),Be(P,{key:0,onClick:M[1]||(M[1]=Y=>k("left")),active:!r.panel.isLeftMostPanel},null,8,["active"])):We$1("",!0),E.value?(pt$1(),Be(I,{key:1,onClick:M[2]||(M[2]=Y=>k("right")),active:!r.panel.isRightMostPanel},null,8,["active"])):We$1("",!0),Zt$2(L,{onClick:M[3]||(M[3]=Y=>r.panel.pin()),active:r.panel.isPinned},null,8,["active"]),r.panel.controls&&r.panel.controls.expand?(pt$1(),Be(F,{key:2,onClick:M[4]||(M[4]=Y=>r.panel.expand()),active:r.panel.expanded},null,8,["active"])):We$1("",!0)])),r.panel.button&&y.value?.includes(r.panel.id)?(pt$1(),Be(U,{key:1,onClick:M[5]||(M[5]=Y=>r.panel.minimize())})):We$1("",!0),Zt$2(J,{onClick:M[6]||(M[6]=Y=>r.panel.close())})],2)])):We$1("",!0),r.content?(pt$1(),wt("div",{key:1,class:"p-8 flex-grow overflow-y-auto",ref_key:"contentEl",ref:d},[R.$slots.content?Hi$2(R.$slots,"content",{key:0}):O.value?(pt$1(),wt("div",{key:1,innerHTML:O.value.innerHTML},null,8,Hmt)):We$1("",!0)],512)):We$1("",!0),r.footer?Ae$1((pt$1(),wt("div",Wmt,[Hi$2(R.$slots,"footer")])),[[ie]]):We$1("",!0)],8,Umt)),[[ce,{trigger:"manual",touch:!1,onShow:T,allowHTML:!0,maxWidth:r.panel.style["flex-basis"]??350,popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}}),Ymt={class:"relative"},Jmt=["content","aria-label"],qmt=["transform"],Zmt=ne$1({__name:"pin",props:{active:Boolean},setup(r){const{t:o}=Ke$1();return(s,a)=>{const l=Ie$2("tippy");return pt$1(),wt("div",Ymt,[Ae$1((pt$1(),wt("button",{type:"button",class:an$2(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":r.active}]),content:It$2(o)(r.active?"panels.controls.unpin":"panels.controls.pin"),"aria-label":It$2(o)(r.active?"panels.controls.unpin":"panels.controls.pin")},[(pt$1(),wt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",transform:`rotate(${r.active?30:0})`},a[0]||(a[0]=[lt$3("path",{d:"M298.028 214.267L285.793 96H328c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24H56C42.745 0 32 10.745 32 24v48c0 13.255 10.745 24 24 24h42.207L85.972 214.267C37.465 236.82 0 277.261 0 328c0 13.255 10.745 24 24 24h136v104.007c0 1.242.289 2.467.845 3.578l24 48c2.941 5.882 11.364 5.893 14.311 0l24-48a8.008 8.008 0 0 0 .845-3.578V352h136c13.255 0 24-10.745 24-24-.001-51.183-37.983-91.42-85.973-113.733z"},null,-1)]),8,qmt))],10,Jmt)),[[l,{placement:"bottom",hideOnClick:!1}]])])}}}),Qmt={class:"relative"},Kmt=["content","aria-label"],t0t=ne$1({__name:"close",props:{active:Boolean},setup(r){const{t:o}=Ke$1();return(s,a)=>{const l=Ie$2("tippy");return pt$1(),wt("div",Qmt,[Ae$1((pt$1(),wt("button",{type:"button",class:an$2(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":r.active}]),content:It$2(o)("panels.controls.close"),"aria-label":It$2(o)("panels.controls.close")},a[0]||(a[0]=[lt$3("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[lt$3("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]),10,Kmt)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),e0t={class:"relative"},n0t=["content","aria-label"],r0t=ne$1({__name:"back",props:{active:Boolean},setup(r){const{t:o}=Ke$1();return(s,a)=>{const l=Ie$2("tippy");return pt$1(),wt("div",e0t,[Ae$1((pt$1(),wt("button",{type:"button",class:an$2(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":r.active}]),content:It$2(o)("panels.controls.back"),"aria-label":It$2(o)("panels.controls.back")},a[0]||(a[0]=[lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fill-current w-16 h-16",viewBox:"0 0 16 16"},[lt$3("path",{d:"M20.485784919653916,7.578491965389372h-14.170000000000005l3.5800000000000054,-3.589999999999997l-1.409999999999993,-1.4099999999999984l-6.000000000000008,6.0000000000000275l6.000000000000008,6l1.409999999999993,-1.4100000000000001l-3.58,-3.59h14.170000000000007Z",transform:"matrix(0.865803 0 0 0.865803 -1.99071 0.638058)"})],-1)]),10,n0t)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),i0t={class:"w-32 h-32"},s0t=["content"],o0t={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},a0t={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},l0t=ne$1({__name:"expand",props:{active:Boolean},setup(r){const{t:o}=Ke$1();return(s,a)=>{const l=Ie$2("tippy");return pt$1(),wt("div",i0t,[Ae$1((pt$1(),wt("button",{type:"button",class:"text-gray-500 hover:text-black focus:text-black w-full h-full flex justify-center items-center",content:It$2(o)(`panels.controls.${r.active?"collapse":"expand"}`)},[r.active?(pt$1(),wt("svg",a0t,a[1]||(a[1]=[lt$3("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),lt$3("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),lt$3("path",{d:"M8 19h3v3h2v-3h3l-4-4-4 4zm8-15h-3V1h-2v3H8l4 4 4-4zM4 9v2h16V9H4z"},null,-1),lt$3("path",{d:"M4 12h16v2H4z"},null,-1)]))):(pt$1(),wt("svg",o0t,a[0]||(a[0]=[lt$3("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),lt$3("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),lt$3("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"},null,-1)])))],8,s0t)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale",hideOnClick:!1}]])])}}}),c0t={class:"relative"},u0t=["content","aria-label"],h0t=ne$1({__name:"minimize",props:{active:Boolean},setup(r){const{t:o}=Ke$1();return(s,a)=>{const l=Ie$2("tippy");return pt$1(),wt("div",c0t,[Ae$1((pt$1(),wt("button",{type:"button",class:an$2(["text-gray-500 hover:text-black focus:text-black p-6",{"text-gray-700":r.active}]),content:It$2(o)("panels.controls.minimize"),"aria-label":It$2(o)("panels.controls.minimize")},a[0]||(a[0]=[lt$3("svg",{class:"fill-current w-20 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[lt$3("path",{d:"M0 0h24v24H0V0z",fill:"none"}),lt$3("path",{d:"M6 19h12v2H6z"})],-1)]),10,u0t)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),p0t={class:"relative"},d0t=["content","aria-label"],f0t=ne$1({__name:"right",props:{active:Boolean},setup(r){const{t:o}=Ke$1();return(s,a)=>{const l=Ie$2("tippy");return pt$1(),wt("div",p0t,[Ae$1((pt$1(),wt("button",{type:"button",class:an$2(["p-8",{"text-gray-500 hover:text-black focus:text-black":r.active,"text-gray-300":!r.active}]),content:It$2(o)("panels.controls.moveRight"),"aria-label":It$2(o)("panels.controls.moveRight")},a[0]||(a[0]=[lt$3("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16"},[lt$3("path",{d:"M 8.59 16.34 L 13.17 11.75 L 8.59 7.16 L 10 5.75 L 16 11.75 L 10 17.75 Z"})],-1)]),10,d0t)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),m0t={class:"relative"},y0t=["content","aria-label"],g0t=ne$1({__name:"left",props:{active:Boolean},setup(r){const{t:o}=Ke$1();return(s,a)=>{const l=Ie$2("tippy");return pt$1(),wt("div",m0t,[Ae$1((pt$1(),wt("button",{type:"button",class:an$2(["p-8 move-left",{"text-gray-500 hover:text-black focus:text-black":r.active,"text-gray-300":!r.active}]),content:It$2(o)("panels.controls.moveLeft"),"aria-label":It$2(o)("panels.controls.moveLeft")},a[0]||(a[0]=[lt$3("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16"},[lt$3("path",{d:"M 15.41 16.09 L 10.83 11.5 L 15.41 6.91 L 14 5.5 L 8 11.5 L 14 17.5 Z"})],-1)]),10,y0t)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),v0t=ne$1({__name:"panel-options-menu",setup(r){const{t:o}=Ke$1();return(s,a)=>(pt$1(),Be(CS$2,{class:"flex",tooltip:It$2(o)("panels.controls.optionsMenu"),popperOptions:{strategy:"fixed"},position:"bottom-end"},{header:gn$1(()=>a[0]||(a[0]=[lt$3("div",{class:"p-6"},[lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20"},[lt$3("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"})])],-1)])),default:gn$1(()=>[Hi$2(s.$slots,"default",{},void 0,!0)]),_:3},8,["tooltip"]))}}),b0t=fo$2(v0t,[["__scopeId","data-v-51e22a4a"]]),_0t={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},w0t={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},x0t=ne$1({__name:"fullscreen-nav",setup(r){const{t:o}=Ke$1(),s=Pn$2("iApi"),a=()=>{s.toggleFullscreen()};return(l,c)=>{const u=vn$2("mapnav-button");return pt$1(),Be(u,{onClickFunction:a,tooltip:It$2(o)("mapnav.fullscreen")},{default:gn$1(()=>[It$2(s).isFullscreen?(pt$1(),wt("svg",_0t,c[0]||(c[0]=[lt$3("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),lt$3("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},null,-1)]))):(pt$1(),wt("svg",w0t,c[1]||(c[1]=[lt$3("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),lt$3("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},null,-1)])))]),_:1},8,["tooltip"])}}}),E0t=ne$1({__name:"geolocator-nav",setup(r){const{t:o}=Ke$1(),s=Pn$2("iApi");let a=Vn$1([]);const l=async()=>{if(a.length)c(a);else{const d=await u({maximumAge:1/0,timeout:5e3}).catch(m=>{m.code===GeolocationPositionError.PERMISSION_DENIED?s.notify.show(oi$1.ERROR,o("mapnav.geolocator.error.permission")):s.notify.show(oi$1.ERROR,o("mapnav.geolocator.error.internal"))});d&&(a=[d.coords.longitude,d.coords.latitude],c(a))}},c=d=>{let m=new gr$2("geolocation",d,Bt$2.latLongSR(),!0);s.geo.map.zoomMapTo(m)},u=d=>new Promise((m,g)=>navigator.geolocation.getCurrentPosition(m,g,d));return(d,m)=>{const g=vn$2("mapnav-button");return pt$1(),Be(g,{onClickFunction:l,tooltip:It$2(o)("mapnav.geolocator")},{default:gn$1(()=>m[0]||(m[0]=[lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[lt$3("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})],-1)])),_:1},8,["tooltip"])}}}),T0t=ne$1({__name:"home-nav",setup(r){const{t:o}=Ke$1(),s=Pn$2("iApi"),a=()=>{const l=s.geo.map.getExtentSet();s.geo.map.zoomMapTo(l.fullExtent)};return(l,c)=>{const u=vn$2("mapnav-button");return pt$1(),Be(u,{onClickFunction:a,tooltip:It$2(o)("mapnav.home")},{default:gn$1(()=>c[0]||(c[0]=[lt$3("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[lt$3("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),lt$3("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["tooltip"])}}}),S0t={class:"relative w-32 h-32 text-gray-600 hover:text-black",tabindex:"-1"},A0t=["content","aria-label"],I0t=ne$1({__name:"button",props:{onClickFunction:{type:Function,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(r){return(o,s)=>{const a=Ie$2("focus-item"),l=Ie$2("tippy");return pt$1(),wt("div",S0t,[Ae$1((pt$1(),wt("button",{type:"button",class:"w-full h-full default-focus-style focus:outline-none",onClick:s[0]||(s[0]=c=>r.onClickFunction()),content:r.tooltip,"aria-label":typeof r.tooltip=="string"?r.tooltip:""},[Hi$2(o.$slots,"default")],8,A0t)),[[a],[l,{placement:"left"}]])])}}}),M0t={class:"relative",tabindex:"-1"},N0t=["aria-label","content"],O0t=ne$1({__name:"button",props:{onClickFunction:{type:Function,required:!0},id:{type:String,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(r){const o=Pn$2("iApi"),s=r,a=()=>o?.event.emit(Mt$2.APPBAR_BUTTON_CLICK,s.id);return(l,c)=>{const u=Ie$2("focus-item"),d=Ie$2("tippy");return pt$1(),wt("div",M0t,[Ae$1((pt$1(),wt("button",{type:"button",class:"py-6 w-full h-full",onClick:c[0]||(c[0]=()=>{r.onClickFunction(),a()}),"aria-label":String(r.tooltip),content:`
${r.tooltip}
`},[Hi$2(l.$slots,"default",{},void 0,!0)],8,N0t)),[[u],[d,{allowHTML:!0,placement:"right"}]])])}}}),C0t=fo$2(O0t,[["__scopeId","data-v-457cd2d4"]]),hG$1=ln$1("areas-of-interest",()=>({areas:tt$3([])})),pG$1=ln$1("export",()=>{const r=tt$3({title:!0,map:!0,mapElements:!0,legend:!0,footnote:!0,timestamp:!0}),o=tt$3("");function s(a){if(r.value[a.name]!==void 0){const l=r.value[a.name];r.value[a.name]=a.selected!==void 0?a.selected:!l}}return{componentSelectedState:r,fileName:o,toggleSelected:s}}),dG$1=ln$1("extentguard",()=>{const r=tt$3(!1);function o(m){r.value=m}const s=tt$3(!1);function a(m){s.value=m}const l=tt$3(!1);function c(m){l.value=m}const u=tt$3([]);function d(m){u.value=m}return{active:r,setActive:o,enforcing:s,setEnforcing:a,alwaysOn:l,setAlwaysOn:c,extentSetIds:u,setExtentSetIds:d}}),u0$2=function r(o){function s(l,c,u){var d,m={};if(Array.isArray(l))return l.concat(c);for(d in l)m[u?d.toLowerCase():d]=l[d];for(d in c){var g=u?d.toLowerCase():d,y=c[d];m[g]=g in m&&typeof y=="object"?s(m[g],y,g=="headers"):y}return m}function a(l,c,u,d,m){var g=typeof l!="string"?(c=l).url:l,y={config:c},_=s(o,c),E={};d=d||_.data,(_.transformRequest||[]).map(function(w){d=w(d,_.headers)||d}),_.auth&&(E.authorization=_.auth),d&&typeof d=="object"&&typeof d.append!="function"&&typeof d.text!="function"&&(d=JSON.stringify(d),E["content-type"]="application/json");try{E[_.xsrfHeaderName]=decodeURIComponent(document.cookie.match(RegExp("(^|; )"+_.xsrfCookieName+"=([^;]*)"))[2])}catch{}return _.baseURL&&(g=g.replace(/^(?!.*\/\/)\/?/,_.baseURL+"/")),_.params&&(g+=(~g.indexOf("?")?"&":"?")+(_.paramsSerializer?_.paramsSerializer(_.params):new URLSearchParams(_.params))),(_.fetch||fetch)(g,{method:(u||_.method||"get").toUpperCase(),body:d,headers:s(_.headers,E,!0),credentials:_.withCredentials?"include":m}).then(function(w){for(var T in w)typeof w[T]!="function"&&(y[T]=w[T]);return _.responseType=="stream"?(y.data=w.body,y):w[_.responseType||"text"]().then(function(k){y.data=k,y.data=JSON.parse(k)}).catch(Object).then(function(){return(_.validateStatus?_.validateStatus(w.status):w.ok)?y:Promise.reject(y)})})}return o=o||{},a.request=a,a.get=function(l,c){return a(l,c,"get")},a.delete=function(l,c){return a(l,c,"delete")},a.head=function(l,c){return a(l,c,"head")},a.options=function(l,c){return a(l,c,"options")},a.post=function(l,c,u){return a(l,u,"post",c)},a.put=function(l,c,u){return a(l,u,"put",c)},a.patch=function(l,c,u){return a(l,u,"patch",c)},a.all=Promise.all.bind(Promise),a.spread=function(l){return l.apply.bind(l,l)},a.CancelToken=typeof AbortController=="function"?AbortController:Object,a.defaults=o,a.create=r,a}(),R0t={A:10,B:12,C:11,E:13,G:24,H:24,J:24,K:35,L:35,M:35,N:35,P:35,R:46,S:47,T:48,V:59,X:[62,61],Y:60},v4$1={en:{},fr:{}};class k0t{list={};listFetched=!1;constructor(o,s){u0$2.get(s).then(a=>{a.data.definitions.forEach(l=>v4$1[o][l.code]=l.description),Object.keys(v4$1[o]).forEach(l=>{this.list[l]=v4$1[o][l]}),this.listFetched=!0})}fsaToProvinces(o){const s={};let a=R0t[o.substring(0,1).toUpperCase()];return typeof a=="number"&&(a=[a]),a.forEach(l=>{s[l]=this.list[l]}),s}}function L0t(r,o){return new k0t(r,o)}const Mb$2={en:{ADDRESS:"Street Address",FSA:"Forward Sortation Area",NTS:"National Topographic System",COORD:"Latitude/Longitude",SCALE:"Scale"},fr:{ADDRESS:"Adresse Municipale",FSA:"Région De Tri D'Acheminement",NTS:"Système National De Référence Cartographique",COORD:"Latitude/Longitude",SCALE:"Échelle"}};class P0t{allTypes={};validTypes={};filterComplete=!1;typesFetched=!1;constructor(o,s){u0$2.get(s).then(a=>{a.data.definitions.forEach(l=>{Mb$2[o][l.code]=l.term.split(`${l.code}-`)[1]}),Object.keys(Mb$2[o]).forEach(l=>{this.allTypes[l]=Mb$2[o][l],this.validTypes[l]=Mb$2[o][l]}),this.typesFetched=!0})}filterValidTypes(o){if(this.filterComplete)return this.validTypes;if(o=typeof o=="string"?[o]:o,o&&o.length>0)for(const s of o)delete this.validTypes[s];return this.filterComplete=!0,this.validTypes}}function D0t(r,o){return new P0t(r,o)}function G0t(r,o){const s=/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)(\s*[,|;\s]\s*)[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)[*]$/,a=/^\d{2,3}[A-P]/,l=/^[ABCEGHJKLMNPRSTVXY]\d[A-Z]/;if(s.test(o)&&!r.disabledSearchTypes.includes("LAT/LNG")){const c=o.slice(0,-1);return new F0t(r,c)}else return l.test(o)&&!r.disabledSearchTypes.includes("FSA")?new j0t(r,o):a.test(o)&&!r.disabledSearchTypes.includes("NTS")?new U0t(r,o.substring(0,6).toUpperCase()):new $0t(r,o)}let Nb$2=class{config;query;failedServs=[];results=[];onComplete;latLongResult;featureResults=[];resultType="geoname";constructor(o,s){this.query=s,this.config=o}search(){return this.jsonRequest(this.getUrl()).then(o=>this.normalizeNameItems(o.items)).catch(()=>(console.error("Geoname service failed"),this.failedServs.push("geoname"),this.normalizeNameItems([])))}getUrl(o,s,a,l){let c="";return o?c=this.config.geoLocateUrl+"?q="+this.query:(a&&l?c=`${this.config.geoNameUrl}?lat=${a}&lon=${l}&num=${this.config.maxResults}`:c=`${this.config.geoNameUrl}?q=${this.query}&num=${this.config.maxResults}`,this.config.categories.length>0&&(c+=`&concise=${this.config.categories.join(",")}`),this.config.officialOnly&&(c+="&category=O")),c}normalizeNameItems(o){return o.filter(s=>this.config.types.validTypes[s.concise.code]).map(s=>({name:s.name,location:s.location,province:this.config.provinces.list[s.province.code],type:this.config.types.allTypes[s.concise.code],LatLon:{lat:s.latitude,lon:s.longitude},bbox:s.bbox,order:this.config.sortOrder.indexOf(s.concise.code)>=0?this.config.sortOrder.indexOf(s.concise.code):this.config.sortOrder.length}))}jsonRequest(o){return new Promise((s,a)=>{const l=new XMLHttpRequest;l.open("GET",o,!0),l.responseType="json",l.onload=()=>{if(l.status===200){const c=typeof l.response=="string"?JSON.parse(l.response):l.response;s(c)}else a("Could not load results from remote service.")},l.send()})}locateByQuery(){return this.jsonRequest(this.getUrl(!0,void 0))}nameByLatLon(o,s,a){return this.jsonRequest(this.getUrl(!1,a,o,s)).then(l=>this.normalizeNameItems(l.items)).catch(()=>(console.error("LatLon service failed"),this.failedServs.push("geoname"),this.normalizeNameItems([])))}};class F0t extends Nb$2{constructor(o,s){super(o,s),this.resultType="latlong";const a=s.split(/[\s|,|;|]/).filter(u=>!isNaN(u)&&u!=="").map(u=>parseFloat(u)),l=.015,c=[a[1]-l,a[0]-l,a[1]+l,a[0]+l];this.latLongResult={name:`${a[0]},${a[1]}`,location:{latitude:a[0],longitude:a[1]},type:"Latitude/Longitude",position:[a[1],a[0]],bbox:c},this.onComplete=new Promise((u,d)=>{this.nameByLatLon(a[0],a[1]).then(m=>{m?(this.results=m,u(this)):d("Given lat lon coordinates cannot be found")})})}}class j0t extends Nb$2{constructor(o,s){s=s.substring(0,3).toUpperCase(),super(o,s),this.resultType="fsa",this.onComplete=new Promise(a=>{this.formatLocationResult().then(l=>{l?(this.featureResults.push(l),this.nameByLatLon(l.LatLon.lat,l.LatLon.lon,Object.keys(l._provinces).map(c=>parseInt(c))).then(c=>{this.results=c,a(this)})):(console.log("FSA code given cannot be found."),a(this))})})}formatLocationResult(){return this.locateByQuery().then(o=>{if(o.length===1&&this.query){const s=this.config.provinces.fsaToProvinces(this.query);return{fsa:this.query,code:"FSA",desc:this.config.types.allTypes.FSA,province:Object.keys(s).map(a=>s[a]).join(","),_provinces:s,LatLon:{lat:o[0].geometry.coordinates[1],lon:o[0].geometry.coordinates[0]}}}}).catch(()=>{console.error("FSA service failed"),this.failedServs.push("geolocation")})}}class U0t extends Nb$2{unitName;unit;mapSheets=[];constructor(o,s){super(o,s),this.resultType="nts",s=isNaN(parseInt(s[2]))?"0"+s:s,this.unitName=s,this.onComplete=new Promise(a=>{this.locateByQuery().then(l=>{if(l.length>0&&this.query){const c=this.locateToResult(l);this.unit=c[0],this.mapSheets=c,this.featureResults.push(this.unit),this.nameByLatLon(this.unit.LatLon.lat,this.unit.LatLon.lon).then(u=>{this.results=u,a(this)})}else console.log("Given NTS code not found"),a(this)}).catch(()=>{console.error("NTS service failed"),this.failedServs.push("geolocation"),a(this)})})}locateToResult(o){return o.map(s=>{const a=s.title.split(" ");return{nts:a.shift()||"",location:a.join(" "),code:"NTS",desc:this.config.types.allTypes.NTS,LatLon:{lat:s.geometry.coordinates[1],lon:s.geometry.coordinates[0]},bbox:s.bbox}})}equals(o){return this.unitName===o.unitName}}class $0t extends Nb$2{constructor(o,s){s=encodeURIComponent(s.trim()),super(o,s),this.resultType="address",this.onComplete=new Promise(a=>{this.locateByQuery().then(l=>{this.featureResults=this.locateToResult(l),this.search().then(c=>{this.results=c,a(this)})}).catch(()=>{this.failedServs.push("geolocation"),console.error("Address service failed"),this.search().then(l=>{this.results=l,a(this)})})})}locateToResult(o){return this.config.categories.length>0&&!this.config.categories.includes("ADDR")?[]:o.filter(s=>s.type?.includes("Street")).map(s=>{const[a,l,c]=s.title.split(", ");return{name:a,city:l.split(" Of ").pop(),province:c,desc:this.config.types.allTypes.ADDRESS,LatLon:{lat:s.geometry.coordinates[1],lon:s.geometry.coordinates[0]}}})}}const fG$1="https://geogratis.gc.ca/services/geolocation/@{language}/locate",mG$1="https://geogratis.gc.ca/services/geoname/@{language}/geonames.json",yG$1="https://geogratis.gc.ca/services/geoname/@{language}/codes/province.json",gG$1="https://geogratis.gc.ca/services/geoname/@{language}/codes/concise.json",B0t={10:"NL",11:"PE",12:"NS",13:"NB",24:"QC",35:"ON",46:"MB",47:"SK",48:"AB",59:"BC",60:"YU",61:"NT",62:"NU",72:"UF",73:"IW"};let vG$1=class{config;constructor(o,s){let a,l,c,u;const d=s?.serviceUrls;d?(a=d.geoLocation?d.geoLocation:fG$1,l=d.geoNames?d.geoNames:mG$1,c=d.geoProvince?d.geoProvince:yG$1,u=d.geoTypes?d.geoTypes:gG$1):(a=fG$1,l=mG$1,c=yG$1,u=gG$1),a=a.replace("@{language}",o),l=l.replace("@{language}",o),c=c.replace("@{language}",o),u=u.replace("@{language}",o);const m=s?.settings;let g,y,_,E,w;m?(g=m.categories?m.categories:[],y=m.sortOrder?m.sortOrder:[],_=m.disabledSearchTypes?m.disabledSearchTypes:[],E=m.maxResults>0?m.maxResults:100,w=!!m.officialOnly):(g=[],y=[],_=[],E=100,w=!1),this.config={language:o,geoNameUrl:l,geoLocateUrl:a,types:D0t(o,u),provinces:L0t(o,c),categories:g,sortOrder:y,disabledSearchTypes:_,maxResults:E,officialOnly:w},this.config.types.filterValidTypes(s?.excludeTypes),this._provinceList=[],this._typeList=[],this._excludedTypes=s?.excludeTypes||[]}get provinceList(){return this._provinceList}get typeList(){return this._typeList}set provinceList(o){this._provinceList=o}set typeList(o){this._typeList=o}levenshteinDistance(o,s){s=s.toLowerCase().trim();const a=decodeURI(o.query.toLowerCase().replace("*","")),l=[];for(let c=0;c<=s.length;c++){l[c]=[c];for(let u=1;u<=a.length;u++)l[c][u]=c===0?u:Math.min(l[c][u-1]+1,l[c-1][u]+.2,l[c-1][u-1]+(a[u-1]===s[c-1]?0:1))}return l[s.length][a.length]}findProvinceObj(o){return this.provinceList.find(s=>s.name===o)}query(o){return G0t(this.config,o.toUpperCase()).onComplete.then(s=>{let a=[];s.featureResults.length>0?s.resultType==="fsa"?a=s.featureResults.map(c=>({name:c.fsa,bbox:[c.LatLon.lon+.02,c.LatLon.lat-.02,c.LatLon.lon-.02,c.LatLon.lat+.02],type:c.desc,position:[c.LatLon.lon,c.LatLon.lat],location:{latitude:c.LatLon.lat,longitude:c.LatLon.lon,province:this.findProvinceObj(c.province)},order:-1})):s.resultType==="nts"?a=s.featureResults.map(c=>({name:c.nts,bbox:c.bbox??[c.LatLon.lon+.02,c.LatLon.lat-.02,c.LatLon.lon-.02,c.LatLon.lat+.02],type:c.desc,position:[c.LatLon.lon,c.LatLon.lat],location:{city:c.location,latitude:c.LatLon.lat,longitude:c.LatLon.lon},order:-1})):s.resultType==="address"&&(a=s.featureResults.map(c=>({name:c.name,bbox:[c.LatLon.lon+.002,c.LatLon.lat-.002,c.LatLon.lon-.002,c.LatLon.lat+.002],type:c.desc,position:[c.LatLon.lon,c.LatLon.lat],location:{city:c.city,latitude:c.LatLon.lat,longitude:c.LatLon.lon,province:this.findProvinceObj(c.province)},order:this.config.sortOrder.indexOf("ADDR")>=0?this.config.sortOrder.indexOf("ADDR"):this.config.sortOrder.length})),this.config.sortOrder.length>0&&(a=a.sort((c,u)=>this.levenshteinDistance(s,c.name)>this.levenshteinDistance(s,u.name)?1:-1))):s.resultType==="latlong"&&(a=[s.latLongResult],a[0].order=-1);const l=s.results.map(c=>({name:c.name,bbox:c.bbox,type:c.type,position:[c.LatLon.lon,c.LatLon.lat],location:{city:c.location,latitude:c.LatLon.lat,longitude:c.LatLon.lon,province:this.findProvinceObj(c.province)},order:c.order}));return{results:a.concat(l).slice(0,this.config.maxResults).sort((c,u)=>this.config.sortOrder.length>0?c.order>u.order?1:-1:this.levenshteinDistance(s,c.name)>this.levenshteinDistance(s,u.name)?1:-1),failedServs:s.failedServs}})}fetchProvinces(){return new Promise(o=>{const s=setInterval(()=>{if(this.config.provinces.listFetched){clearInterval(s);const a=[],l={code:-1,abbr:"...",name:"..."};a.push(l);const c=this.config.provinces.list;for(const u in c)a.push({code:u,abbr:B0t[u],name:c[u]});this.provinceList=a,o(this.provinceList)}})})}fetchTypes(){return new Promise(o=>{const s=setInterval(()=>{if(this.config.types.typesFetched){clearInterval(s);const a=[],l={code:-1,name:"..."};a.push(l);const c=this.config.types.allTypes;for(const u in c)this._excludedTypes.includes(u)||a.push({code:u,name:c[u]});this.typeList=a,o(this.typeList)}},250)})}};function bG$1(r,o,s){return r&&o.extent&&(s=s.filter(a=>a.bbox[0]<=o.extent.xmax&&a.bbox[1]<=o.extent.ymax&&a.bbox[2]>=o.extent.xmin&&a.bbox[3]>=o.extent.ymin)),o.province&&o.province!=="..."&&(s=s.filter(a=>a.location.province?.name&&a.location.province.name===o.province)),o.type&&o.type!=="..."&&(s=s.filter(a=>a.type===o.type)),s}const _G$1=ln$1("geosearch",()=>{const r=tt$3(new vG$1("en",void 0)),o=tt$3({type:"",province:"",extent:void 0}),s=tt$3(!1),a=tt$3(""),l=tt$3(""),c=tt$3(""),u=tt$3([]),d=tt$3([]),m=tt$3(!1),g=tt$3([]),y=te(()=>new Promise(N=>{r.value.fetchProvinces().then(D=>{D.sort((P,I)=>P.name>I.name?1:-1),N(D)})})),_=te(()=>new Promise(N=>{r.value.fetchTypes().then(D=>{D.sort((P,I)=>P.name>I.name?1:-1),N(D)})}));function E(N,D){r.value=new vG$1(N,D)}function w(N){m.value=!0;const D=a.value.replace(/["!*$+?^{}()|[\]\\]/g,"").trim();if(!D)u.value=[],d.value=[],m.value=!1;else if(D&&D!==c.value||N){const P=setInterval(()=>{r.value.config.provinces.listFetched&&r.value.config.types.typesFetched&&(clearInterval(P),r.value.query(`${D}*`).then(I=>{g.value=I.failedServs,c.value=D,d.value=I.results;const L=bG$1(s.value,o.value,d.value);u.value=L||[],m.value=!1}))},250)}else{const P=bG$1(s.value,o.value,d.value);u.value=P||[],m.value=!1}}function T(N){o.value.province=typeof N.province>"u"?"":N.province,w(N.forceReRun)}function k(N){o.value.type=typeof N.type>"u"?"":N.type,w(N.forceReRun)}function O(N){c.value=a.value.replace(/["!*$+?^{}()|[\]\\]/g,"").trim(),a.value=N,w()}function R(N){const D={a:"àáâãäåāăąǎȁȃȧạảấầẩẫậắằẳẵặ",b:"ḃɓḅḇ",c:"çćĉċč",d:"ďḋḍḏḑḓ",e:"èéêëēĕėęěȅȇẹẻẽếềểễệ",f:"ƒḟ",g:"ĝğġģǧǵḡ",h:"ĥȟḣḥḧḩḫẖ",i:"ìíîïĩīĭįıȉȋịỉĩ",j:"ĵǰɉ",k:"ķĸƙḳḵ",l:"ĺļľŀłḷḹḻḽ",m:"ḿṁṃ",n:"ñńņňʼnŋǹṅṇṉṋ",o:"òóôõöōŏőơǒǫǭȍȏȯọỏốồổỗộớờởỡợ",p:"ṕṗ",r:"ŕŗřȑȓṛṝṟ",s:"śŝşšșṡṣṥṧṩ",t:"ţťŧțṫṭṯṱẗ",u:"ùúûüũūŭůűųưǔǖǘǚǜȕȗụủứừửữự",v:"ṽṿ",w:"ẁẃŵẅẇẉẋ",x:"ẋẍ",y:"ỳýŷÿỹȳẏẙỵỷỹ",z:"źżžẑẓẕ"};N=N.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),l.value=Array.from(N).map(P=>Object.keys(D).includes(P)?"["+P+D[P]+"]":P.replace(/["$!*+?^{}()|[\]\\]/g,"").replace(/[.\\]/g,"\\$&").trim()).join("")}function M(N){if(N.visible!==void 0&&(s.value=N.visible),N.extent.sr.wkid!==4326)throw new Error("an extent that was not projected to wkid 4326 was passed to the geosearch store");o.value.extent=N.extent,w()}return{GSservice:r,queryParams:o,resultsVisible:s,searchVal:a,searchRegex:l,lastSearchVal:c,searchResults:u,savedResults:d,loadingResults:m,failedServices:g,getProvinces:y,getTypes:_,initService:E,runQuery:w,setProvince:T,setType:k,setSearchTerm:O,setSearchRegex:R,setMapExtent:M}}),wG$1=ln$1("help",()=>({location:tt$3("./help/")}));var b4$1=(r=>(r.Visibility="visibilityButton",r.Expand="expandButton",r))(b4$1||{}),Ob$2=(r=>(r.Item="item",r.Placeholder="placeholder",r.Error="error",r))(Ob$2||{});let _4$1=class extends Tn$2{_uid;_name;_type;_children=[];_parent=void 0;_loadPromise;_hidden;_expanded;_visibility;_exclusive;_controls;_disabledControls;_lastVisible;_visibleChildren;constructor(o,s,a){super(o),this._uid=Ou$2.sharedUtils.generateUUID(),this._name=s.name,this._type=s.type??"placeholder",this._parent=a,this._children=[],this._loadPromise=new xn$2,this._hidden=s.hidden??!1,this._expanded=s.expanded??!0,this._visibility=!0,this._exclusive=s.exclusive??!1,this._controls=s.controls?.slice()??["visibilityButton","expandButton"],this._disabledControls=s.disabledControls?.slice(),this._lastVisible,this._visibleChildren=[]}get uid(){return this._uid}get name(){return this._name}set name(o){this._name=o}get type(){return this._type}get children(){return this._children}set children(o){this._children=o}get parent(){return this._parent}set parent(o){this._parent=o}get loadPromise(){return this._loadPromise.getPromise()}get hidden(){return this._hidden}get expanded(){return this._expanded}get visibility(){return this._visibility}get exclusive(){return this._exclusive}controlAvailable(o){return this._disabledControls?.includes(o)?!1:this._controls?.includes(o)}setControl(o,s){s&&this._disabledControls?.includes(o)?(this._disabledControls=this._disabledControls.filter(a=>a!==o),this._controls?.push(o)):!s&&this._controls?.includes(o)&&(this._controls=this._controls.filter(a=>a!==o),this._disabledControls?.push(o))}toggleHidden(o){this._hidden=o??!this.hidden}toggleExpanded(o){this._expanded=o??!this.expanded}toggleVisibility(o,s=!0){if(this.visibility!==o){if(this._visibility=o??!this.visibility,!this.exclusive)this.visibility?this._visibleChildren.length>0?this._visibleChildren.forEach(a=>a.toggleVisibility(!0,!1)):this.children.forEach(a=>a.toggleVisibility(!0,!1)):this.children.forEach(a=>a.toggleVisibility(!1,!1));else if(this.visibility)if(this._lastVisible&&(!(this._lastVisible instanceof fa$2)||this._lastVisible.layerControlAvailable(pn$2.Visibility)))this._lastVisible.toggleVisibility(!0);else{const a=this.children.find(l=>!(l instanceof fa$2)||l.layerControlAvailable(pn$2.Visibility));a&&a.toggleVisibility(!0)}else this._lastVisible=this.children.find(a=>a.visibility),this._lastVisible?.toggleVisibility(!1);this.parent&&s&&this.parent.checkVisibility(this)}}checkVisibilityRules(){this.parent&&!this.parent.visibility?this.toggleVisibility(!1,!1):this.parent?.exclusive&&this.parent.children.some(o=>o.visibility&&o!==this&&o.type==="item")&&this.toggleVisibility(!1,!1)}checkVisibility(o){this instanceof fa$2&&!this.layerControlAvailable(pn$2.Visibility)||(this.exclusive?o.visibility?(this.children.forEach(s=>{s.uid!==o.uid&&s.toggleVisibility(!1,!1)}),this._lastVisible=o,this._visibility=!0,this instanceof fa$2&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this instanceof fa$2&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!1),this._lastVisible=o):this.children.some(s=>s.visibility)?(this._visibility=!0,this._visibleChildren=this.children.filter(s=>s.visibility),this instanceof fa$2&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this._visibleChildren=[],this instanceof fa$2&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!1)),this.parent&&this.parent.checkVisibility(this))}getConfig(){const o={name:this._name,hidden:this._hidden,expanded:this._expanded,exclusive:this._exclusive,controls:this._controls,disabledControls:this._disabledControls},s=[];return this.children.forEach(a=>{s.push(a.getConfig())}),this.exclusive?o.exclusiveVisibility=s:o.children=s,o}onAdded(){}onRemoved(){this.toggleVisibility(!1)}load(){this._type="item",this._loadPromise.resolveMe(),this.checkVisibilityRules()}reload(){this._type="placeholder",this._loadPromise=new xn$2}error(){this._type!=="error"&&(this._type="error",this._loadPromise.getPromise().catch(()=>{}),this._loadPromise.rejectMe(),this.checkVisibilityRules())}},fa$2=class extends _4$1{_layerId;_layerIdx;_layerUid="";_isSublayer=!1;_layer;_layerInitVis;_layerRedrawing=!1;_layerOffscale=!1;_treeGrown=!1;_customSymbology=!1;_coverIcon;_description;_symbologyExpanded;_origLayerControls;_origLayerDisabledControls;_layerControls;_layerDisabledControls;_maxLines;_symbologyRenderStyle;_symbologyStack;handlers=[];constructor(o,s,a){super(o,s,a),this._type=Ob$2.Placeholder,this._layerId=s.layerId,this._layerIdx=s.sublayerIndex,this._isSublayer=s.sublayerIndex!==void 0,this._layerControls=s.layerControls??[],this._origLayerControls=s.layerControls,this._layerDisabledControls=s.disabledLayerControls??[],this._origLayerDisabledControls=s.disabledLayerControls,this._layerRedrawing=!1,this._symbologyExpanded=s.symbologyExpanded||!1,s.coverIcon&&(this._coverIcon=s.coverIcon),s.description&&(this._description=s.description),this._symbologyRenderStyle=s.symbologyRenderStyle??"icons",this._customSymbology=!!s.symbologyStack,this._symbologyStack=s.symbologyStack?.map(l=>({uid:this.$iApi.geo.shared.generateUUID(),label:l.text,definitionClause:l.sqlQuery,imgUrl:l.image??"",drawPromise:Promise.resolve(),visibility:!0,lastVisibility:!0})),this._maxLines=s.maxLines&&[1,2,3,4,5,6].includes(s.maxLines)?s.maxLines:void 0}get parentLayerId(){return this._isSublayer?this._layerId.slice(0,this._layerId.length-`-${this._layerIdx}`.length):void 0}get layerId(){return this._layerId}get layerIdx(){return this._layerIdx}get isSublayer(){return this._isSublayer}get layerUid(){return this._layerUid}get layer(){return this._layer}set layer(o){this._layer=o,this._layerId=o.id,this._layerIdx=o.isSublayer?o.layerIdx:void 0,this._layerUid=o.uid,this._name=this._name||o.name,this._symbologyStack=this._customSymbology?this._symbologyStack:o.legend,this.updateLayerControls()}get layerOffscale(){return this._layerOffscale}set layerOffscale(o){this._layerOffscale=o}get layerRedrawing(){return this._layerRedrawing}set layerRedrawing(o){this._layerRedrawing=o}get coverIcon(){return this._coverIcon}set coverIcon(o){this._coverIcon=o}get description(){return this._description}set description(o){this._description=o}get symbologyExpanded(){return this._symbologyExpanded}get treeGrown(){return this._treeGrown}set treeGrown(o){this._treeGrown=o}get origLayerControls(){return this._origLayerControls}get origDisabledLayerControls(){return this._origLayerDisabledControls}set symbologyRenderStyle(o){this._symbologyRenderStyle=o}get symbologyRenderStyle(){return this._symbologyRenderStyle}set symbologyStack(o){this._symbologyStack=o}get symbologyStack(){return this._symbologyStack}get maxLines(){return this._maxLines}getConfig(){const o={layerId:this._layerId,sublayerIndex:this._layerIdx,layerControls:this._layerControls,disabledLayerControls:this._layerDisabledControls,symbologyExpanded:this._symbologyExpanded,coverIcon:this._coverIcon,description:this._description,maxLines:this._maxLines};return{...super.getConfig(),...o}}toggleVisibility(o,s=!0,a=!1){if(!(!this.layerControlAvailable(pn$2.Visibility)&&!a)&&(super.toggleVisibility(o,s),this.layer&&this.layer.layerExists)){this.layer.visibility=this.visibility;const l=this._symbologyStack.some(c=>c.lastVisbility);this._symbologyStack.forEach(c=>{l||(c.lastVisbility=!0),c.visibility=this.visibility?c.lastVisbility:!1})}}toggleSymbology(o){return this._symbologyExpanded=o??!this._symbologyExpanded,this._symbologyExpanded}setSymbologyVisibility(o,s){this._symbologyStack.some(a=>((o===void 0||a.uid===o)&&(a.visibility=s,a.lastVisbility=s),o!==void 0&&a.uid===o))}load(o){const s=o instanceof kb$2?o:this.$iApi.geo.layer.getLayer(this._layerId??this._layerUid);s&&(this.layer=s,this._layerRedrawing=s.mapLayer&&s.drawState!==$r$2.UP_TO_DATE,s.loadPromise().then(()=>{this._layerInitVis=typeof this._layerInitVis<"u"?this._visibility:s.visibility,super.load(),this.toggleVisibility(this._layerInitVis,!0,!0),s.visibility||this.setSymbologyVisibility(void 0,!1),this.handlers.push(this.$iApi.event.on(Mt$2.LAYER_VISIBILITYCHANGE,a=>{a.layer.uid===this.layer.uid&&this._type===Ob$2.Item&&this.toggleVisibility(a.visibility,!0,!0)})),this.handlers.push(this.$iApi.event.on(Mt$2.LAYER_DRAWSTATECHANGE,a=>{this.layer.uid===a.layer.uid&&(a.layer.drawState===$r$2.REFRESH?this.layerRedrawing=!0:setTimeout(()=>{this.layerRedrawing=a.layer.drawState===$r$2.REFRESH},500))})),this._layerOffscale=this.$iApi.geo.map.created?s.isOffscale():!1,this.handlers.push(this.$iApi.event.on(Mt$2.MAP_SCALECHANGE,()=>{this.$iApi.geo.map.created&&(this._layerOffscale=this.layer?.isOffscale())}))}).catch(()=>{this.error()}))}error(){this.updateLayerControls(),super.error()}layerControlAvailable(o){return this._layerDisabledControls?.includes(o)?!1:!!this._layerControls?.includes(o)}updateLayerControls(){const o=this.$iApi.geo.layer.getLayerControls(this.layerId)??this.$iApi.geo.layer.getLayerControls(this.parentLayerId??"");this._origLayerControls||(this._layerControls=o?.controls??[]),this._origLayerDisabledControls||(this._layerDisabledControls=o?.disabledControls??[])}};var xG$1=(r=>(r.Title="title",r.Text="text",r.Image="image",r.Markdown="markdown",r.Template="template",r))(xG$1||{});let w4$1=class extends _4$1{_infoType;_content;constructor(o,s,a){super(o,s,a),this._infoType=s.infoType??"title",this._content=s.content??"",s.infoType==="template"&&this.$element.component(`${this._uid}-info-section`,{template:this._content}),(s.infoType||s.content)&&(this._controls=s.controls?.slice()??[b4$1.Expand]),super.load()}get infoType(){return this._infoType}get content(){return this._content}set content(o){this._content=o}getConfig(){const o={infoType:this._infoType,content:this._content};return{...super.getConfig(),...o}}};const EG$1=ln$1("legend",()=>{const r=tt$3(),o=tt$3([]),s=tt$3([]),a=tt$3(!0),l=tt$3(3);function c(m){if(m.parent===void 0)o.value.push(m.item);else{if(!(m.item instanceof w4$1)&&!(m.item instanceof fa$2)){console.error("attempted to add an unsupported legend item type");return}m.parent.children.push(m.item)}}function u(m){const g=y=>(y=y.filter(_=>(_===m&&!_.children.length&&_.onRemoved(),_!==m)),y.forEach(_=>{_.children=g(_.children)}),y=y.filter(_=>!(_ instanceof w4$1&&!_.children.length&&_.content==="")),y);o.value=g(o.value)}function d(m){if(m.oldItem.parent===void 0){const g=o.value,y=g.indexOf(m.oldItem);y>-1&&(o.value[y]=m.newItem),o.value=g}else{const g=m.oldItem.parent.children,y=g.indexOf(m.oldItem);y>-1&&(g[y]=m.newItem),m.oldItem.parent.children=g}}return{legendConfig:r,multilineItems:a,maxLines:l,children:o,headerControls:s,addItem:c,removeItem:u,replaceItem:d}}),TG$1=ln$1("mapnav",()=>{const r=tt$3({}),o=tt$3([]);function s(a){a in r.value&&delete r.value[a];const l=o.value.indexOf(a);l!==-1&&o.value.splice(l,1)}return{items:r,order:o,removeItem:s}}),SG$1=ln$1("metadata",()=>{const r=tt$3(""),o=tt$3({type:"LineString",coordinates:[]});return{status:r,response:o}}),AG$1=ln$1("northarrow",()=>{const r=tt$3(""),o=tt$3("");return{arrowIcon:r,poleIcon:o}}),IG$1=ln$1("overviewmap",()=>{const r=tt$3({lodSets:[],extentSets:[],basemaps:[],tileSchemas:[],initialBasemapId:""}),o=tt$3({}),s=tt$3(!0),a=tt$3(1.5),l=tt$3("#FF0000"),c=tt$3(1),u=tt$3("#000000"),d=tt$3(.25);function m(g){r.value.initialBasemapId=g}return{mapConfig:r,basemaps:o,startMinimized:s,expandFactor:a,borderColour:l,borderWidth:c,areaColour:u,areaOpacity:d,updateInitialBasemap:m}}),MG$1=ln$1("scrollguard",()=>{const r=tt$3(!1);function o(s){r.value=s}return{enabled:r,setEnabled:o}});var lr$2=(r=>(r[r.UPLOAD=0]="UPLOAD",r[r.FORMAT=1]="FORMAT",r[r.CONFIGURE=2]="CONFIGURE",r))(lr$2||{});const NG$1=ln$1("wizard",()=>{const r={id:"Placeholder",layerType:Ct$1.UNKNOWN,url:""},o=tt$3(),s=tt$3(""),a=tt$3(""),l=tt$3(!0),c=tt$3(null),u=tt$3({config:r,configOptions:[]}),d=tt$3(lr$2.UPLOAD);function m(g){switch(d.value){case lr$2.UPLOAD:g===lr$2.UPLOAD?s.value="":g===lr$2.FORMAT&&(d.value=lr$2.FORMAT);break;case lr$2.FORMAT:g===lr$2.UPLOAD?(c.value&&(s.value="",c.value=null),a.value="",d.value=lr$2.UPLOAD):g===lr$2.CONFIGURE&&(d.value=lr$2.CONFIGURE);break;case lr$2.CONFIGURE:g===lr$2.UPLOAD?(s.value="",a.value="",c.value=null,l.value=!0,u.value={config:r,configOptions:[]},d.value=lr$2.UPLOAD):g===lr$2.FORMAT&&(u.value={config:r,configOptions:[]},l.value=!0,d.value=lr$2.FORMAT);break}}return{layerSource:o,url:s,typeSelection:a,nested:l,fileData:c,layerInfo:u,currStep:d,goToStep:m}});class V0t{fixture;panel;event;geo;notify;ui;startRequired=!1;_eventsOn=!1;$vApp;$element;$i18n;$rootEl;_isFullscreen;constructor(o,s,a){this.event=new Uat(this);const l=z0t(o,this);this.$vApp=l.app,this.$element=l.element,this.$i18n=l.i18n,this.$rootEl=l.app.$root?.$el,this.fixture=new tgt(this),this.panel=new egt(this),this.geo=new Qyt(this),this.ui={maptip:this.geo.map.maptip,exposeOids:!1,exposeMeasurements:!0,getZoomIcon:()=>"",formatNumber:()=>"",scrollToInstance:!1,suppressNumberLocalization:!1,escapeHtml:()=>"",isPlainText:()=>!0},this.notify=new Jht(this),this._isFullscreen=uo$2.isEnabled&&!!this.$vApp.$root&&uo$2.isFullscreen&&uo$2.element===this.$vApp.$root.$el,uo$2.isEnabled&&uo$2.onchange(()=>{this._isFullscreen=uo$2.isEnabled&&!!this.$vApp.$root&&uo$2.isFullscreen&&uo$2.element===this.$vApp.$root.$el}),this.initialize(!0,s,a)}initialize(o,s,a){const l=Dr$2(this.$vApp.$pinia),c=Ul$2(this.$vApp.$pinia),u=Uv$2(this.$vApp.$pinia);if(s?.configs!==void 0){const m=s.configs,g=m[this.$i18n.locale.value]??m[Object.keys(m)[0]];l.newConfig(g),l.registerConfig({config:g,configLangs:Object.keys(m),allLangs:Object.keys(this.$i18n.messages.value)});for(const T in m)l.registerConfig({config:m[T],configLangs:[T]});l.activeBasemapConfig=g.map.basemaps.find(T=>T.id===g.map.initialBasemapId);const y=setInterval(()=>{const T=this.$vApp.$el.querySelector("#esriMap");T&&(clearInterval(y),this.geo.map.createMap(g.map,T).then(()=>{if(T._tippy.hide(0),u.setMaptipInstance(T._tippy),g.layers&&g.layers.length>0){let k=0;g.layers.forEach(O=>{const R=this.geo.layer.createLayer(O);this.geo.map.addLayer(R,k).catch(()=>{}),R.mapLayer&&k++})}}))},100);if(g.panels){if(g.panels.open&&g.panels.open.length>0){const T=g.panels.open.map(k=>k.id);this.panel.isRegistered(T).then(()=>{g.panels?.open?.forEach(k=>{this.panel.open({id:k.id,screen:k.screen}),k.pin&&this.panel.pin(k.id)})})}c.reorderable=g.panels.reorderable??!0}!g.system?.animate&&this.$element._container&&this.$element._container.children[0]&&this.$element._container.children[0].classList.remove("animation-enabled"),g.system?.proxyUrl&&(this.geo.proxy=g.system.proxyUrl),g.system?.exposeOid&&(this.ui.exposeOids=g.system.exposeOid),g.system?.exposeMeasurements!=null&&(this.ui.exposeMeasurements=g.system.exposeMeasurements),g.system?.scrollToInstance&&(this.ui.scrollToInstance=g.system?.scrollToInstance),g.system?.suppressNumberLocalization&&(this.ui.suppressNumberLocalization=g.system?.suppressNumberLocalization);const _={magnify:'',globe:''},E=g.system?.zoomIcon||"globe",w=_[E]||E;this.ui.getZoomIcon=()=>w,this.ui.formatNumber=T=>this.ui.suppressNumberLocalization?T.toString():this.$i18n.n(T,"number"),this.ui.escapeHtml=T=>{const k={"<":"<",">":">",'"':""","'":"'"};return T.replace(/[<>"']/g,O=>k[O])},this.ui.isPlainText=T=>typeof T=="string"?!this.containsValidHtml(T)&&!this.representsObject(T):!1}a||(a={});const d=Fp$2(this.$vApp.$pinia);a?.startRequired?(this.startRequired=!0,d.started=!1):(this.startRequired=!1,d.started=!0,this.event.emit(Mt$2.MAP_START)),o&&(a.loadDefaultFixtures!==!1||s?.startingFixtures!==void 0)?this.fixture.addDefaultFixtures(s?.startingFixtures):o||this.fixture.restore(),a.loadDefaultEvents!==!1&&!this._eventsOn&&(this.event.addDefaultEvents(),this._eventsOn=!0)}reload(o,s){const a=Fp$2(this.$vApp.$pinia),l=Cs$2(this.$vApp.$pinia),c=Dr$2(this.$vApp.$pinia),u=Ji$2(this.$vApp.$pinia),d=As$1(this.$vApp.$pinia),m=Nv$2(this.$vApp.$pinia),g=!!o;g?Object.keys(u.items).forEach(y=>{this.fixture.exists(y)&&this.fixture.remove(y)}):this.fixture.flush(),Object.keys(m.grids).forEach(y=>{m.removeGrid(y)}),a.started=!1,this.geo.map.destroyMap(),d.$reset(),s?.loadDefaultEvents===!1&&(this.event.removeDefaultEvents(),this._eventsOn=!1),o===void 0&&(o=JSON.parse(JSON.stringify({startingFixtures:c.startingFixtures,configs:c.registeredConfigs}))),l.clearAll(),this.geo.map.maptip.clear(),this.initialize(g,o,s)}component(o,s){if(s){const a=this.$element.component(o,s);return this.event.emit(Mt$2.COMPONENT,o),a}return this.$element.component(o)}get screenSize(){if(!this.$vApp?.$root||!this.$vApp.$root.$refs["app-size"])return null;const o=this.$vApp.$root.$refs["app-size"].classList;return o.contains("lg")?"lg":o.contains("md")?"md":o.contains("sm")?"sm":"xs"}getConfig(){const o=Dr$2(this.$vApp.$pinia);return JSON.parse(JSON.stringify(o.getActiveConfig(this.language)))}useStore(o){if(!(["appbar","areas-of-interest","details","export","extentguard","geosearch","grid","help","legend","mapnav","metadata","northarrow","overviewmap","scrollguard","wizard"].includes(o)&&!this.fixture.exists(o)))switch(o){case"appbar":return Gm$2(this.$vApp.$pinia);case"areas-of-interest":return hG$1(this.$vApp.$pinia);case"details":return B3$1(this.$vApp.$pinia);case"export":return pG$1(this.$vApp.$pinia);case"extentguard":return dG$1(this.$vApp.$pinia);case"geosearch":return _G$1(this.$vApp.$pinia);case"grid":return Nv$2(this.$vApp.$pinia);case"help":return wG$1(this.$vApp.$pinia);case"legend":return EG$1(this.$vApp.$pinia);case"mapnav":return TG$1(this.$vApp.$pinia);case"metadata":return SG$1(this.$vApp.$pinia);case"northarrow":return AG$1(this.$vApp.$pinia);case"overviewmap":return IG$1(this.$vApp.$pinia);case"scrollguard":return MG$1(this.$vApp.$pinia);case"wizard":return NG$1(this.$vApp.$pinia);case"config":return Dr$2(this.$vApp.$pinia);case"fixture":return Ji$2(this.$vApp.$pinia);case"instance":return Fp$2(this.$vApp.$pinia);case"layer":return As$1(this.$vApp.$pinia);case"map-caption":return Ll$2(this.$vApp.$pinia);case"maptip":return Uv$2(this.$vApp.$pinia);case"notification":return Cs$2(this.$vApp.$pinia);case"panel":return Ul$2(this.$vApp.$pinia);default:console.error(`The store ${o} does not exist.`);return}}setLanguage(o){if(this.$i18n.locale.value===o)return;const s=Dr$2(this.$vApp.$pinia),a=Cs$2(this.$vApp.$pinia),l=s.registeredLangs;Object.keys(s.registeredConfigs).length===1&&a.clearAll();const c=this.$i18n.locale.value;this.$i18n.locale.value=o;const u=this.getConfig();l[c]!==l[o]&&(this.event.emit(Mt$2.CONFIG_CHANGE,u),this.reload()),this.event.emit(Mt$2.LANG_CHANGE,{oldLang:c,newLang:o})}get language(){return this.$vApp.$i18n.locale}get animate(){return!!(this.$element._container&&this.$element._container.children[0]&&this.$element._container.children[0].classList.contains("animation-enabled"))}toggleFullscreen(){uo$2.isEnabled&&uo$2.toggle(this.$element._container||void 0)}get isFullscreen(){return this._isFullscreen}get started(){return Fp$2(this.$vApp.$pinia).started}updateAlert(o){const s=this.$vApp.$el.querySelector(".screen-reader-alert");s.childNodes.length>0&&(s.innerHTML="");const a=document.createElement("span");a.setAttribute("role","alert");const l=document.createTextNode(o);a.appendChild(l),s.insertBefore(a,null)}scrollToInstance(){this.ui.scrollToInstance&&this.$element._container?.scrollIntoView({behavior:"smooth"})}start(){const o=Fp$2(this.$vApp.$pinia);!o.started&&this.startRequired?(this.event.emit(Mt$2.MAP_START),o.started=!0):o.started&&console.warn("start has already been called")}containsValidHtml(o){return/<(\w+)([^>]*)>(.*?)<\/\1>/.test(o)}representsObject(o){return/^(?:\[\s*(?:[\s\S]*?)\s*\]|\{\s*(?:[\s\S]*?)\s*\})$/.test(o)}}function z0t(r,o){const s=kat();s.use(({store:u})=>{const d=lD$2(u.$state);u.$reset=()=>u.$patch(lD$2(d))});const a=nut(),l=Ml$1(Hft).use(a).use(Uft,{directive:"tippy",component:"tippy"}).use(s);l.directive("focus-container",Kft),l.directive("focus-list",Yft),l.directive("focus-item",qft),l.directive("truncate",Fmt),l.component("panel-screen",Xmt),l.component("pin",Zmt),l.component("close",t0t),l.component("back",r0t),l.component("expand",l0t),l.component("panel-options-menu",b0t),l.component("dropdown-menu",CS$2),l.component("minimize",h0t),l.component("right",f0t),l.component("left",g0t),l.component("fullscreen-nav-button",x0t),l.component("geolocator-nav-button",E0t),l.component("home-nav-button",T0t),l.component("mapnav-button",I0t),l.component("appbar-button",C0t),l.component("transition",xm$2),l.component("transition-group",rv$2),l.config.globalProperties.$iApi=o,l.config.globalProperties.$pinia=s,l.provide("iApi",o);const c=l.mount(r);return{element:l,app:c,i18n:a.global}}let Gb$2=class vie{esriBasemap;config;createErr=!1;constructor(o){this.config=o}static async create(o){const s=new vie(o),a=o.layers.map(c=>{if(c.layerType===Ct$1.TILE)return Pe.TileLayer({url:c.url,opacity:c.opacity});if(c.layerType===Ct$1.MAPIMAGE)return Pe.MapImageLayer({url:c.url,opacity:c.opacity});if(c.layerType===Ct$1.OSM)return Pe.OpenStreetMapLayer({opacity:c.opacity});throw new Error(`Unsupported layer type provided to basemap config: ${c.layerType}`)}),l=(await Promise.allSettled(a)).filter(c=>c.status==="rejected"?(console.error(c.reason),s.createErr=!0,!1):!0).map(c=>{if(c.status==="fulfilled")return c.value;throw new Error("TS is fun")});return s.esriBasemap=await Pe.Basemap({baseLayers:l,title:o.name||"",id:o.id}),s}get tileSchemaId(){return this.config.tileSchemaId}get id(){return this.config.id}get name(){return this.config.name}set name(o){this.config.name=o||""}get description(){return this.config.description}set description(o){this.config.description=o||""}get altText(){return this.config.altText}set altText(o){this.config.altText=o||""}get attribution(){return this.config.attribution}set attribution(o){this.config.attribution=o}get backgroundColour(){return this.config.backgroundColour??"#FFFFFF"}},OG$1=class extends Tn$2{esriMap;_basemapStore;created=!1;trackFirstBasemap=!1;esriView;_viewPromise;get viewPromise(){return this._viewPromise.getPromise()}_rampSR;_rampExtentSet;_targetDiv;handlers;pointZoomScale;constructor(o){super(o),this.esriMap=void 0,this._basemapStore=[],this._viewPromise=new xn$2,this.handlers=[],this.pointZoomScale=5e4}noMapErr(){console.error("Attempted to manipulate the map before calling createMap()")}abstractError(){throw new Error("Attempted to call an abstract method in the parent CommonMapAPI")}labelsDefault={visible:void 0};async createMap(o,s){const a=d=>{this.$iApi.notify.show(oi$1.ERROR,this.$iApi.$i18n.t("layer.error",{id:d.name}))},l=o.basemaps.map(d=>Gb$2.create(d)),c=(await Promise.all(l)).filter(d=>(d.createErr&&a(d),d.esriBasemap.baseLayers.length>0));c.forEach(d=>{d.esriBasemap.baseLayers.forEach(m=>{m.watch("loadStatus",()=>{m.loadStatus==="loaded"?this.trackFirstBasemap=!1:m.loadStatus==="failed"&&(a(d),this.trackFirstBasemap&&this.recoverBasemap(d.tileSchemaId))})})}),this._basemapStore=c,o.labelsDefault&&(this.labelsDefault.visible=o.labelsDefault.visible);const u={};this.esriMap=yn$2(await Pe.Map(u)),this.pointZoomScale=o.pointZoomScale&&o.pointZoomScale>0?o.pointZoomScale:5e4,this._targetDiv=s,this.createMapView(o.initialBasemapId)}destroyMap(){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.destroyMapView(),this.esriMap.destroy(),delete this.esriMap,this._basemapStore.forEach(o=>o.esriBasemap.destroy()),this._basemapStore=[]}async reloadMap(o,s){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.destroyMap(),await this.createMap(o,s)}async createMapView(o){this.abstractError()}destroyMapView(){if(!this.esriView){this.noMapErr();return}this._viewPromise=new xn$2,this.created=!1,this.handlers.forEach(o=>o.handler.remove()),this.handlers=[],this.esriView.map=null,this.esriView.container=null,this.esriView.spatialReference=null,this.esriView.extent=null,this.esriView.navigation=null,this.esriView.destroy(),delete this.esriView}async findBasemap(o){const s=this._basemapStore.find(a=>a.id===o);if(s)return s;throw new Error(`Invalid basemap id requested: ${o}`)}async applyBasemap(o){if(!this.esriMap){this.noMapErr();return}const s=typeof o=="string"?await this.findBasemap(o):o;this.esriMap.basemap=Ut$2(s.esriBasemap)}async setBasemap(o){return this.abstractError(),!1}async recoverBasemap(o){}getCurrentBasemapId(){if(this.esriMap)return this.esriMap.basemap.id;this.noMapErr()}geomToMapSR(o){if(!this._rampSR)throw new Error("call to map.geomToMapSR before the map spatial ref was created");return this._rampSR.isEqual(o.sr)?Promise.resolve(o):this.$iApi.geo.proj.projectGeometry(this._rampSR,o)}async zoomMapTo(o,s,a=!0,l=200,c="ease"){if(this.esriView){if(o.invalid())throw new Error("attempt to zoom to invalid geometry");const u=await this.geomToMapSR(o),d={target:this.$iApi.geo.geom.geomRampToEsri(u)};u.type===qt$2.POINT&&(d.scale=s||this.pointZoomScale);const m={animate:a,duration:l,easing:c};return this.viewPromise.then(()=>this.esriView.goTo(d,m))}else this.noMapErr()}getZoomLevel(){return this.esriView?this.esriView.zoom:(this.noMapErr(),1)}getScale(){return this.esriView?this.esriView.scale:(this.noMapErr(),1)}getResolution(){return this.esriView?this.esriView.resolution:(this.noMapErr(),1)}getExtent(){return this.esriView?tn$2.fromESRI(this.esriView.extent):(this.noMapErr(),tn$2.fromParams("i_am_error",0,1,0,1))}getExtentSet(){return this._rampExtentSet?this._rampExtentSet:(this.noMapErr(),f0$2.fromConfig({id:"i_am_error_extent_set",default:{xmin:0,xmax:1,ymin:0,ymax:1,spatialReference:{wkid:4326}}}))}getSR(){return this._rampSR?this._rampSR.clone():(this.noMapErr(),Bt$2.latLongSR())}getPixelHeight(){return this.esriView?this.esriView.height:(this.noMapErr(),1)}getPixelWidth(){return this.esriView?this.esriView.width:(this.noMapErr(),1)}setPointZoomScale(o){return o>0?(this.pointZoomScale=o,!0):(console.error(`Cannot set pointZoomScale to non-positive number: ${o}.`),!1)}};class H0t extends Tn$2{maptipStore;constructor(o){super(o),this.maptipStore=Uv$2(this.$vApp.$pinia)}#e=void 0;#t=void 0;async checkAtCoord(o){this.#t=o;const s=await this.$iApi.geo.map.getGraphicAtCoord(o);if(this.#t!==o)return;if(!s){this.clear();return}const a=this.$iApi.geo.layer.getLayer(s.layerId);if(a?.geomType!=qt$2.POLYGON&&this.#e&&this.#e.layerId===s.layerId&&this.#e.oid===s.oid&&this.#e.layerIdx===s.layerIdx)return;if(this.clear(),this.#e=s,!a){console.error(`graphic hit test returned non-existent layer id: ${s.layerId}`);return}if(!a.hovertips)return;const l=await a.getIcon(s.oid),c=await a.getGraphic(s.oid,{getAttribs:!0});this.setPoint(this.$iApi.geo.map.screenPointToMapPoint(o)),this.$iApi.event.emit(Mt$2.MAP_GRAPHICHIT,{layer:a,graphicHit:s,attributes:c.attributes,icon:l,screenPoint:o})}generateDefaultMaptip(o){this.setContent(`
${o.icon}${o.attributes[o.layer.config.tooltipField||o.layer.nameField]}
`)}clear(){this.#e=void 0,this.maptipStore.setMaptipPoint(void 0),this.maptipStore.setMaptipContent("")}getInstance(){return this.maptipStore.maptipInstance}getPoint(){return this.maptipStore.maptipPoint}setPoint(o){this.maptipStore.setMaptipPoint(o)}setContent(o){this.maptipStore.setMaptipContent(o)}}class W0t extends Tn$2{DEFAULT_POINT_FORMATTERS={LAT_LONG_DMS:this.formatLatLongDMS,LAT_LONG_DD:this.formatLatLongDD,LAT_LONG_DDM:this.formatLatLongDDM,WEB_MERCATOR:this.formatMercator,CANADA_ATLAS_LAMBERT:this.formatLambert,UTM:this.formatUTM,BASEMAP:this.formatBasemap};pointFormatter;constructor(o){super(o),this.pointFormatter=this.DEFAULT_POINT_FORMATTERS.LAT_LONG_DMS}createCaption(o){if(!o)return;const s=Ll$2(this.$vApp.$pinia);if(s.coords.disabled=!1,s.scale.disabled=!1,s.scale.isImperialScale=!1,o.mapCoords)if(o.mapCoords.disabled)s.coords.disabled=!0;else{const a=o.mapCoords.formatter;a!==void 0&&this.setPointFormatter(a)}if(o.scaleBar)if(o.scaleBar.disabled)s.scale.disabled=!0;else{const a=o.scaleBar.imperialScale;a!==void 0&&(s.toggleScale(a),this.$iApi.geo.map.viewPromise.then(()=>{this.updateScale()}))}s.langtoggle={disabled:o?.langToggle?.disabled??!1}}updateAttribution(o){const s={disabled:!1,value:this.$iApi.$i18n.t("caption.attributionDefaultText")},a={disabled:!1,altText:this.$iApi.$i18n.t("caption.attributionLogoAltText"),link:this.$iApi.$i18n.t("caption.attributionLink"),value:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAAkCAYAAADWzlesAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADO9JREFUeNq0Wgl0jlca/pfvzyo6qNBSmhLLKE1kKEUtB9NTat+OYnBacwwJY19DZRC7sR41th60lWaizFSqRTOEw0lsrQSJGFIESSxJ/uRfv3nef+7Vt9f3p2E695z3fMt97/3ufe+7PO+9n9n0UzELsjKyiHdUdMZnVHTl2VyFe9nO7Kc/Io+4epUxmpWxeVkbr3hvUebgFf15GL9XUwZHndtAAYI09jGvIghOuoEwLOLeYiBoXrwGfZjYYOWAvWyMGlsk2YebXeV3NUEW1qcT5BBX4jUbCYEmHwwKEfdW1gEXgoWtiIlNRFeezcrkrQaTNSuraRYDdImrR1ylAALZBPnkXIJ0wRskeG2Cj3jsoFI2HhcfDDFWA9UBNdZZyc/PP4Z3HZYsWTLGbrffond0Xb9+/Qy6P3jw4F+HDx8+mu7XrVs3c+7cuX+i+3nz5o3n/Rw4cGAdf/7hhx9SZ8yYEcffHT9+/G/8uaSkJGvDhg3D8P3moNdXrlw5UtYVFxfnXL9+/V8PHz68grr2N2/eTC4tLb2E+9+Cotq1a/dOenr6njt37nxPdOrUqd0dO3bsjromoHBQKBPkEyFUB71MH6SPbNy4cRqfkMvlenzixImtqO/x3XffbXc6nSW5ubnpOTk5J1NTU/cQH91//fXXu3/88ccLy5cvj6d34B8gaBA9JyQk/OWjjz5aIu8Fz2DiWbZs2QLx/A4m0Qf9f/n48eNsPEeDfrdly5Y/U31UVNT7dJ04ceIsGseNGzfS6DkuLq4v8YE6Y/G+93g8XKZ6QUHBRVHfAPQC0xJfCRAv65EkeUP6gFx11JEkfw/qTc8ff/zxKofDUXrv3r08rOIBeU9CWbx48SLej5y4LGlpaf9YuHDhUv5OtqH+6Vty0riPAbWjheH8n3322VYpuG+//Xa5mGB7CGM8hKN7vV5dLfHx8WNI20E1aN4WP97YZyc7d+6MM5vNHRs2bDg3NjY23e12l5w8eZJWzIUJ9IdmlI4bNy4tICAgtHbt2hGdOnXaSe3oftu2bWmBgYFOn3MwmwcQLViwIJOeYVYJGGAZVuW2zWZzCZ6hoIGapnmknUMTQnr16vUeTOKydHqyHrx9t27dunro0KEfzJw5M4Pe3bp166Z0pHXr1g0Fj2EYCw8PD+N+SjNwUuSAKnxexOkswOWxZN63b9/MAQMGzIUwx5WXl99eunTpFLx+hJU/K9o/yM7OPhgZGdk5KSkpp0WLFv+Vrq7/na5nz57dR1dM6t7hw4e3DRkyJG7WrFlxgudzukIw58TzV3SF3Z+ByUzFbTk5O9j8fVH/JV3PnTv3uRijSdSR5/empKRkT5kypQxCC+UTxMKVQXuyWBT5WbiS4VFjIZLHWQsLN1ZFgFbm0U1KSNWUUMlDp9kAh0iNdCkRwiva2FjUsjJeJ5sYRYQwCGIYNGk8tC1UCuDQoUOb+vbtuxuPRUJ4FVwIFhZ7pUD45OXEbUpo9DIz8hgAFk0BORblWypm8BiQzkKnpoRnM+PxsEWhiYfFxMTUHTx4cDOYhg7tzM7IyLhNCiYEUEbCMxsAGYuCGjl4ClKE4GY+xCnIw95zBKqxvmyCOJqT7dws5ntZzLcoaJEjQiPUahMaESzudWEqhBEeiSuZvUvzA1+lxIMEhbD7QGYKUl0rBAgxC9vlq6IzNZZ9BYt+rMw8pBDLmSZZFBPQmBC8imaofo1roa5oKH82aQaaIH0CDTZM0sCBAxvBKbZ+7bXXGr3yyisN4ZjMDx48uAeAkofQdHbt2rUXhIpJKevMJwSLfqq3bt365enTp3eFh365SZMmBGpMFRUVZcAV1wFmzs2ZMyddtCkXk9ESExOjq1Wr9iLCbwAilA9xwrnlwimS4G2ffvppj1atWrWoWbNmbWCKAtj9V5MnT84cMWJEvTfeeKM+wqSFzCEoKMgJ3HEVgO6SkTlKMwgUgImwArn2DpMmTYrDALP0XyjEA9sbjTZtQZGij7qghqBWoK4AWPswkbLK+qHIsWPHjoXgfwvUhsZAAEflg+dfg0kuBlosUuvoO2jXl65qXWZm5g7UNRPIOIQLQqpcmECMJIAuRp1UVmiCACmTxAReFx+LhnPqV1hY+O9n6evIkSObSXCEHI0WASDtMMJ0uVHb7du3E6p9HxpxQK0DjN4r0Gc9kSZYeZiSNkuaUOv06dPTO3fuPNj0DAWgKWTFihVL+vfvT0J8kfohAsobV6tWrYbP0hf460pnLE2AF2jB21DvIKO2gO6FNB+ERJtaB+xjY37NN3+LogmkHi9s2rTp3bZt277LG8NuK5AopXbv3n0O7Gtsjx49ZmNye6GOD1RBwD9MFUKoSQSc30UdzJUrV26uWrVqP7D/lt27d+9/9OhRMas7gjYbhROzkv9R2wcHBwdWshjkYL1G7SBQTXGwTwQQLLIqWsGeGFAhVyFSO6C7Naj7ADRUJENDQGMjIiLmQl0LVLUbNWrUItSPhBNcodYhFyFklwAiYf0RNKZZs2YfFhUVXYcAvhFm0FFc++fl5eX4Mxto7JnRo0cvID4yHWSz70dHRw+khAxZ6yGVH8ndftS9DWokciWNx15fTN2zZ0+f6tWr1+LS279/fwYgcz4LPzJvdyGVLUFidFiVOIRAqx8KlQysZCdKboJUXL58uRAmMLFp06aLRbh1cGhrVEiD3nzzzTXIcU5R6gC6vXfv3kuIGgSIyq1Wq6cqpmdhiNAXFtu0adNeZVq9enUWA0xywyVECC4AicwttQ2SrvpkYnfv3i1X6xo0aPAiJv2H+fPnt27UqFEN4YsCDBCk33Lt2rW8kSNHJuP2LqUc4kq+4KFAgg6LxeKtSl+a4hMC6tSp85QD27VrVy9I1U2SJaKYS/ZG8Rf5uhVXq91ud4aEhATINo0bN46glUQMv4aQV46MMpj3iRVvsGjRohFEENQtygCRmZ5B6DsqNNPFANJT5cyZM5RoPRBE/qREaJYEYm4aZ1WFwDG9ppoClebNm9czPV/xYXOo6J4xY8Z84I8Jgq9HBCDVfsKECR+mpqZ+gSQnRVQHGTm4CxcuXBP9l4qrneUNPtheVSFYKtkF/jUKqWbx2LFjUxBJViA82asSZvv06TPq+PHjE/D4GzI70jiVT+xDyBzDo8DhZyoWNXsD4Cn/FYVQLKgIofCfMIkhgKyr4bhO8pBoVGgvsEuXLq+SEIw0Qayyl5H+vIPUmJf2ZYOwz5twXE05U/369TfBZu+wvMBpkH7L3dwyYZ+l4uoRPL50FzCcQuAJstvIyMjacG5Rw4YN64b7V9XBxcbGdgJq/cZIE4TT0/2ceTyzJsiMj0JSxfnz50+rTECBUUq2aGd2WC7Izib+WFwdLJs0sczT1w+Q3d34+PhTSKQ2w4GeVL9LTtefY1Q2YEz/qxC8LIe3f/LJJ2kqU79+/WIGDRpUj+0L8N0lG7B6N+QGiS1btgxR9ha8gi949uzZ0UiENgBSR4iQyFNiL0zkrh+V/78XfjJDq1aWnJx85dixY8kqRE1KSopNSUkZ0K1btwjhsGpMmzatbVZW1nTy/JQbQHUXA26HMRul/gOQHkcBUK1BBGiJFHgtcMV7YqeXeEM7dOhQB4lXh6dCS1kZaZbDSBjinV6ZhsBkdAMz0o00SO4hhIrUl7K/7vfv37+hP0eBw8tBftFRpNNNExMThyMqlKp8SEXsADy5t1GM+qF6CHwe+hifm5t7Ta1PSEiYj7rWIhsMZaCPEkDyL+2PHj36hdqO3lGd4KkuYbN0jC5h22TPRT179pwCZ5j9rKqF0FWtd+/eL0kBA9Y2kRudvBB4og2al1CM+iFsgQFfJTCkaZrboL2DhUfd4NjAadROvHPyvUsLayxNghxaMWw0D1EhFiguqSrxXWZ/EN7IyZMnX5QHn127dk0Gxo+nnd6q9EHf2rx58zJgC1oxSrQKgR1cKl9YWJhdOFg329TlC1oBM3YYZJ8OubcozVZTJPjkzEEwOBGr1yIr+xz23xX23i48PPxVjiqRQV6GRuetXLkSbiPpCsPuTulzEAYPAh+cnzp1ao+YmJi31D5gevkwo3sZGRmn0M+RzMzMAhFtaGG0ixcvfpmfn39WbpNBC1zILK8KHqdykCsXszQ7O/sE8WMBNKGlbrxLF1HsSeQyV5JQBSrJUghLdDQmKB46ywTJFTKzfqqxftScwM1OjGXY/Vl0UU7IHcq3XMrutkz0QsX3bOwEWo5TfsNj9hMxjP5VCFR2fPl/AS4xMH7u71X6CWR92JQjer5t72AHLrpyKGRRhKbCZrNybhJg8HvBU+385Qv8DMKi/BjBEaKuHJK42YDU/x789cFhu1s5cFH/hTAp3/UqhzMm5cTM6G8br/qnyi8lTWYDoZiUP1TUEyc1Ble1D5OSA+gG7U0GR3b+fhUy+kVIN0Kb/xFgANrk0XIqRaL0AAAAAElFTkSuQmCC"},l={text:{value:"",disabled:!1},logo:{disabled:!1,altText:"",link:"",value:""}};if(o?(o.logo?o.logo.disabled?l.logo.disabled=!0:(l.logo.altText=o.logo.altText||a.altText,l.logo.link=o.logo.link||a.link,l.logo.value=o.logo.value||a.value):(l.logo.altText=a.altText,l.logo.link=a.link,l.logo.value=a.value),o.text?o.text.disabled?l.text.disabled=!0:l.text.value=o.text.value||s.value:l.text.value=s.value,Ll$2(this.$vApp.$pinia).setAttribution(l)):(l.logo.altText=a.altText,l.logo.link=a.link,l.logo.value=a.value,l.text.value=s.value),!o||o.text?.disabled||!o.text){if(!this.$iApi.geo.map.esriMap){console.warn("Attempted to fetch map attribution with undefined map");return}let c="";const u=5e3,d=20,m=this.$iApi.geo.map.esriMap.basemap.baseLayers.map(g=>new Promise(y=>{let _=0;const E=u/d,w=setInterval(function(){g.loaded&&!g.loadError?(clearInterval(w),y(g)):_>E&&(clearInterval(w),y(null)),_++},d)})).toArray();Promise.all(m).then(g=>{c=g.filter(y=>y?.copyright).map(y=>y.copyright).join(" | "),l.text.value=c||l.text.value||s.value,Ll$2(this.$vApp.$pinia).setAttribution(l)})}}updateScale(){const o=Ll$2(this.$vApp.$pinia),s=o.scale;if(s?.disabled)return;const a=s?.isImperialScale||!1,l=this.scaleHelper().find(c=>c.isImperialScale===a)??{isImperialScale:!1,units:"error",pixels:1,distance:1};o.scale={width:`${l.pixels}px`,label:`${this.$iApi.$i18n.n(l.distance,"number")}${l.units}`,isImperialScale:a}}async formatPoint(o){return o?await this.pointFormatter(o):""}setPointFormatter(o){if(typeof o=="string"){if(!(o in this.DEFAULT_POINT_FORMATTERS)){console.warn(`Could not find point formatter with id: ${o}`);return}this.pointFormatter=this.DEFAULT_POINT_FORMATTERS[o]}else this.pointFormatter=o}scaleHelper(){const o=window.innerWidth>600?70:35,s=this.$iApi.geo.map.getResolution(),a=[],l=s*o,c=1609.34,u=3.28084,d=l>1e3?["km","mi"]:["m","ft"];for(let m=0;m<2;m++){const g=m===1;if(a.push({isImperialScale:g,units:d[m],pixels:0,distance:0}),l>1e3){const y=s*o/(g?c:1e3),_=Math.round(y).toString().length,E=Math.pow(10,_-1);a[m].distance=Math.ceil(y/E)*E,a[m].pixels=a[m].distance*(g?c:1e3)/s}else a[m].distance=Math.ceil(g?l*u:l),a[m].pixels=l/s}return a}wrapValue(o,s,a){return((o-s)%(a-s)+(a-s))%(a-s)+s}async formatLatLongDMS(o){const s=await this.$iApi.geo.proj.projectGeometry(4326,o),a=this.wrapValue(s.y,-90,90),l=this.wrapValue(s.x,-180,180),c="°",u=Math.floor(Math.abs(a))*(a<0?-1:1),d=Math.floor(Math.abs((a-u)*60)),m=Math.floor((Math.abs(a)-Math.abs(u)-d/60)*3600),g=Math.floor(Math.abs(l))*(l<0?-1:1),y=Math.floor(Math.abs((l-g)*60)),_=Math.floor((Math.abs(l)-Math.abs(g)-y/60)*3600);return`${this.$iApi.$i18n.n(Math.abs(u),"number")}${c} ${this.$iApi.$i18n.n(d,"number",{minimumIntegerDigits:2})}' ${this.$iApi.$i18n.n(m,"number",{minimumIntegerDigits:2})}" ${this.$iApi.$i18n.t("map.coordinates."+(a>0?"north":"south"))} | ${this.$iApi.$i18n.n(Math.abs(g),"number")}${c} ${this.$iApi.$i18n.n(y,"number",{minimumIntegerDigits:2})}' ${this.$iApi.$i18n.n(_,"number",{minimumIntegerDigits:2})}" ${this.$iApi.$i18n.t("map.coordinates."+(0>l?"west":"east"))}`}async formatLatLongDDM(o){const s=await this.$iApi.geo.proj.projectGeometry(4326,o),a=this.wrapValue(s.y,-90,90),l=this.wrapValue(s.x,-180,180),c="°",u=Math.floor(Math.abs(a))*(a<0?-1:1),d=Math.abs((a-u)*60),m=Math.floor(Math.abs(l))*(l<0?-1:1),g=Math.abs((l-m)*60);return`${this.$iApi.$i18n.n(Math.abs(u),"number")}${c} ${this.$iApi.$i18n.n(d,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})} ${this.$iApi.$i18n.t("map.coordinates."+(a>0?"north":"south"))} | ${this.$iApi.$i18n.n(Math.abs(m),"number")}${c} ${this.$iApi.$i18n.n(g,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})} ${this.$iApi.$i18n.t("map.coordinates."+(0>l?"west":"east"))}`}async formatLatLongDD(o){const s=await this.$iApi.geo.proj.projectGeometry(4326,o),a=this.wrapValue(s.y,-90,90),l=this.wrapValue(s.x,-180,180),c="°",u=Math.abs(a),d=Math.abs(l);return`${this.$iApi.$i18n.n(u,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})}${c} ${this.$iApi.$i18n.t("map.coordinates."+(a>0?"north":"south"))} | ${this.$iApi.$i18n.n(d,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})}${c} ${this.$iApi.$i18n.t("map.coordinates."+(0>l?"west":"east"))}`}async formatMercator(o){const s=await this.$iApi.geo.proj.projectGeometry(102100,o);return`${this.$iApi.$i18n.n(Math.floor(s.x),"number")} m | ${this.$iApi.$i18n.n(Math.floor(s.y),"number")} m`}async formatLambert(o){const s=await this.$iApi.geo.proj.projectGeometry(3978,o);return`${this.$iApi.$i18n.n(Math.abs(Math.floor(s.x)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(0>s.x?"west":"east"))} | ${this.$iApi.$i18n.n(Math.abs(Math.floor(s.y)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(s.y>0?"north":"south"))}`}async formatUTM(o){const s=await this.$iApi.geo.proj.projectGeometry(4326,o),a=this.wrapValue(s.y,-90,90),l=this.wrapValue(s.x,-180,180),c=Math.ceil((l+180)/6),u=await this.$iApi.geo.proj.projectGeometry(parseInt("326"+c),o);return`${this.$iApi.$i18n.n(c,"number",{minimumIntegerDigits:2})} ${this.$iApi.$i18n.t("map.coordinates."+(a>0?"north":"south"))} ${this.$iApi.$i18n.n(Math.floor(u.x),"number")} m${this.$iApi.$i18n.t("map.coordinates.east")} | ${this.$iApi.$i18n.n(Math.abs(Math.floor(u.y)),"number")} m${this.$iApi.$i18n.t("map.coordinates.north")}`}async formatBasemap(o){const s=await this.$iApi.geo.proj.projectGeometry(this.$iApi.geo.map.getSR(),o);return`${this.$iApi.$i18n.n(s.x,"number")} | ${this.$iApi.$i18n.n(s.y,"number")}`}}class X0t extends OG$1{maptip;caption;mapMouseThrottle;layerDefaultTimes={draw:1e4,load:1e4,fail:9e4};constructor(o){super(o),this.maptip=new H0t(o),this.caption=new W0t(o),this.mapMouseThrottle=0}async createMap(o,s){this.setMapMouseThrottle(o.mapMouseThrottle??0),this.trackFirstBasemap=!0,this.layerDefaultTimes.draw=o.layerTimeDefault?.expectedDrawTime??1e4,this.layerDefaultTimes.load=o.layerTimeDefault?.expectedLoadTime??1e4,this.layerDefaultTimes.fail=o.layerTimeDefault?.maxLoadTime||9e4,await super.createMap(o,s),this.viewPromise.then(()=>{this.$iApi.event.emit(Mt$2.MAP_CREATED)})}destroyMap(){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.$iApi.geo.layer.allLayersOnMap(!1).map(o=>o.uid).forEach(o=>this.removeLayer(o)),super.destroyMap(),this.$iApi.event.emit(Mt$2.MAP_DESTROYED)}async createMapView(o){const s=Dr$2(this.$vApp.$pinia).config.map;if(!s)throw new Error("Attempted to create map view without a map config");const a=(typeof o=="string"?await this.findBasemap(o):o)||await this.findBasemap(s.initialBasemapId),l=s.tileSchemas.find(d=>d.id===a.tileSchemaId);if(!l)throw new Error(`Could not find tile schema for the given basemap id: ${a.id}`);const c=s.extentSets.find(d=>d.id===l.extentSetId);if(!c)throw new Error(`Could not find extent set with the given id: ${l.extentSetId}`);this._rampExtentSet=f0$2.fromConfig(c),this._rampSR=this._rampExtentSet.sr.clone();const u=s.lodSets.find(d=>d.id===l.lodSetId);if(!u)throw new Error(`Could not find lod set with the given id: ${l.lodSetId}`);this.esriView=yn$2(await Pe.MapView({map:this.esriMap,container:this._targetDiv,constraints:{lods:u.lods,rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this._rampExtentSet.defaultExtent.toESRI(),navigation:{browserTouchPanEnabled:!1},background:{color:a.backgroundColour}})),this.esriView.ui.components=[],this.handlers.push({type:"extent",handler:this.esriView.watch("extent",d=>{if(d){const m=this.$iApi.geo.geom.geomEsriToRamp(d,"map_extent_event");this.$iApi.event.emit(Mt$2.MAP_EXTENTCHANGE,m),this.$iApi.event.emit(Mt$2.FILTER_CHANGE,{extent:m,filterKey:dr$2.EXTENT})}})}),this.handlers.push({type:"scale",handler:this.esriView.watch("scale",d=>{this.$iApi.event.emit(Mt$2.MAP_SCALECHANGE,d)})}),this.handlers.push({type:"resize",handler:this.esriView.on("resize",d=>{this.$iApi.event.emit(Mt$2.MAP_RESIZED,{height:d.height,width:d.width})})}),this.handlers.push({type:"click",handler:this.esriView.on("click",d=>{this.$iApi.event.emit(Mt$2.MAP_CLICK,this.$iApi.geo.geom.esriMapClickToRamp(d,"map_click_point"))})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",d=>{this.$iApi.event.emit(Mt$2.MAP_DOUBLECLICK,this.$iApi.geo.geom.esriMapClickToRamp(d,"map_doubleclick_point"))})}),this.handlers.push({type:"pointer-move",handler:this.esriView.on("pointer-move",this.createMouseMoveHandler())}),this.handlers.push({type:"pointer-move-start",handler:this.esriView.on("pointer-move",Fm$1(100,!0,d=>{this.$iApi.event.emit(Mt$2.MAP_MOUSEMOVE_START,this.$iApi.geo.geom.esriMapMouseToRamp(d))}))}),this.handlers.push({type:"pointer-move-end",handler:this.esriView.on("pointer-move",Fm$1(100,d=>{this.$iApi.event.emit(Mt$2.MAP_MOUSEMOVE_END,this.$iApi.geo.geom.esriMapMouseToRamp(d))}))}),this.handlers.push({type:"pointer-leave",handler:this.esriView.on("pointer-leave",d=>{setTimeout(()=>{this.$iApi.event.emit(Mt$2.MAP_MOUSELEAVE,d.native)},Math.max(this.mapMouseThrottle,100)+1)})}),this.handlers.push({type:"pointer-down",handler:this.esriView.on("pointer-down",d=>{this.$iApi.event.emit(Mt$2.MAP_MOUSEDOWN,d.native)})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",d=>{this.$iApi.event.emit(Mt$2.MAP_KEYDOWN,d.native),d.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",d=>{this.$iApi.event.emit(Mt$2.MAP_KEYUP,d.native),d.stopPropagation()})}),this.handlers.push({type:"focus",handler:this.esriView.on("focus",d=>{this.$iApi.event.emit(Mt$2.MAP_FOCUS,d.native)})}),this.handlers.push({type:"blur",handler:this.esriView.on("blur",d=>{this.$iApi.event.emit(Mt$2.MAP_BLUR,d.native)})}),this.esriView.container.addEventListener("touchmove",d=>{d.preventDefault()}),this.esriView.watch("fatalError",()=>{const d=new IntersectionObserver(m=>{m.forEach(g=>{g.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),d.disconnect())})});d.observe(this.esriView.container)}),this.esriView.when(()=>{if(this._viewPromise.resolveMe(),this.created=!0,this.applyBasemap(a),l.recoveryBasemap?.basemapId){const d=l.recoveryBasemap.timeout??8e3;d>0&&setTimeout(()=>{this.trackFirstBasemap&&this.recoverBasemap(l.id)},d)}})}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",o=>{o.preventDefault()}),super.destroyMapView()}async applyBasemap(o){if(!this.esriMap){this.noMapErr();return}const s=typeof o=="string"?await this.findBasemap(o):o;this.esriMap.basemap=Ut$2(s.esriBasemap);const a=Dr$2(this.$vApp.$pinia);a.activeBasemapConfig=s.config}async setBasemap(o){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const s=Dr$2(this.$vApp.$pinia),a=await this.findBasemap(o),l=s.activeBasemapConfig.tileSchemaId!==a.tileSchemaId;if(l){const c=this.getExtent().center(),u=this.getScale();this._viewPromise=new xn$2,this.created=!1,this.$iApi.event.emit(Mt$2.MAP_REFRESH_START),this.destroyMapView(),this.createMapView(a),await this.viewPromise.then(()=>{this.$iApi.event.emit(Mt$2.MAP_REFRESH_END),this.$iApi.event.emit(Mt$2.MAP_BASEMAPCHANGE,{basemapId:o,schemaChanged:l});const d=this.findClosestScale(u);this.$iApi.geo.proj.projectGeometry(this._rampSR,c).then(m=>this.zoomMapTo(m,d,!1))})}else{await this.applyBasemap(a);const c=await Pe.ColorBackground({color:new ya$1(a.backgroundColour).toESRI()});this.esriView.background=c,this.$iApi.event.emit(Mt$2.MAP_BASEMAPCHANGE,{basemapId:o,schemaChanged:l})}return l}async recoverBasemap(o){this.esriMap||this.noMapErr(),this.trackFirstBasemap=!1;const s=Dr$2(this.$vApp.$pinia).config.map;if(s){const a=s.tileSchemas.find(l=>l.id===o);if(a?.recoveryBasemap?.basemapId){const l=await this.findBasemap(a.recoveryBasemap.basemapId);await this.applyBasemap(l)}}}addLayer(o,s=void 0){return new Promise((a,l)=>{if(this.esriMap||(this.noMapErr(),l()),o.initiationState!==Ye$2.INITIATING&&o.initiationState!==Ye$2.INITIATED&&o.layerState!==sn$2.ERROR&&o.initiate(),o.mapLayer&&s===void 0){const m=this.$iApi.geo.layer.layerOrderIds();if(o.isCosmetic)s=m.length;else{const g=this.$iApi.geo.layer.allLayers();let y=!0;for(let _=m.length-1;_>=0&&y;_--){const E=g.find(w=>w.id===m[_]);E&&!E.isCosmetic&&(s=_+1,y=!1)}y&&(s=0)}}As$1(this.$vApp.$pinia).addLayer(o,s),this.$iApi.event.emit(Mt$2.LAYER_REGISTERED,o);const c=Date.now();let u=0;const d=setInterval(()=>{u+=250,u>=o.expectedTime.fail||o.layerState===sn$2.ERROR?(clearInterval(d),o.lastCancel0){const l=this.$iApi.geo.layer.layerOrderIds(),c=this.$iApi.geo.layer.allLayers();for(let u=a-1;u>-1;u--){const d=l[u],m=c.find(g=>g.id===d);if(m&&m.esriLayer){const g=this.esriMap.layers.indexOf(m.esriLayer);if(g>-1){s=g+1;break}}else m||console.error("ESRI Layer insert encountered bad state. Layer likely inserted at bottom of map.")}}a>-1&&this.esriMap?.add(o.esriLayer,s)}reorder(o,s,a=!1){if(s<0){console.error("Negative index passed to map reorder");return}if(!this.esriMap){this.noMapErr();return}if(o.isSublayer&&(o=o.parentLayer),!o.mapLayer){console.error("Attempted to reorder a data layer");return}const l=this.$iApi.geo.layer.allLayers();let c=this.$iApi.geo.layer.layerOrderIds();if(a){if(o.isCosmetic)return;if(s>0){const d=c.filter(m=>{const g=l.find(y=>y.id===m);return g?!g.isCosmetic:(console.error("Layer reorder had critical error"),!1)});s>=d.length&&(console.error("non-cosmetic reorder index was too high"),s=d.length-1),s=c.indexOf(d[s])}}else s>=c.length&&(console.error("reorder index was too high"),s=c.length-1);const u=c.indexOf(o.id);if(u!==s){if(As$1(this.$vApp.$pinia).reorderLayer(o,s),o.esriLayer&&this.esriMap.layers.indexOf(o.esriLayer)>-1){let d=0;if(s>0){c=this.$iApi.geo.layer.layerOrderIds();for(let m=s-1;m>-1;m--){const g=c[m],y=l.find(_=>_.id===g);if(y&&y.esriLayer){const _=this.esriMap.layers.indexOf(y.esriLayer);if(_>-1){const E=sl.isRemoved)&&this.removeLayer(a.parentLayer)}removeLayer(o){if(!this.esriMap){this.noMapErr();return}let s;if(o instanceof kb$2?s=o:s=this.$iApi.geo.layer.getLayer(o),!s)throw new Error("Layer could not be found for removal.");if(s.isSublayer){this.removeSublayer(s);return}s.supportsSublayers&&s.sublayers.forEach(l=>{l.isRemoved||this.removeSublayer(l)});const a=As$1(this.$vApp.$pinia);a.removeLayer(s),a.removeLayerConfig(s.id),s.removeEsriLayer(),s.initiationState===Ye$2.INITIATED&&s.terminate(),s.isRemoved=!0,this.$iApi.event.emit(Mt$2.LAYER_REMOVE,s)}setMapMouseThrottle(o){if(o<0)return console.error("Cannot set map mouse throttle to value that is less than 0."),!1;this.mapMouseThrottle=o;const s=this.handlers.findIndex(a=>a.type==="pointer-move");if(s!==-1){const a=this.handlers[s];this.handlers.splice(s,1),a.handler.remove()}return s!==-1&&this.esriView&&this.handlers.push({type:"pointer-move",handler:this.esriView.on("pointer-move",this.createMouseMoveHandler())}),!0}createMouseMoveHandler(){if(!this.esriView){this.noMapErr();return}return kl$2(this.mapMouseThrottle,o=>{this.$iApi.event.emit(Mt$2.MAP_MOUSEMOVE,this.$iApi.geo.geom.esriMapMouseToRamp(o))})}async zoomToLevel(o){if(this.esriView)return this.esriView.goTo({zoom:o});this.noMapErr()}async zoomIn(){if(this.esriView)return this.zoomToLevel(this.esriView.zoom+1);this.noMapErr()}async zoomOut(){if(this.esriView)return this.zoomToLevel(this.esriView.zoom-1);this.noMapErr()}async zoomToVisibleScale(o){if(!this.esriView){this.noMapErr();return}const s=o.isOffScale(this.getScale());if(!s.offScale)return;const a=this.esriView.constraints.lods;if(!a)return this.zoomMapTo(this.getExtent().center(),(s.zoomIn,o.minScale));const l=s.zoomIn?a:[...a].reverse(),c=l.find(u=>s.zoomIn?u.scaleo.maxScale)||l[l.length-1];return this.zoomToLevel(c.level)}findClosestScale(o){const s=this.esriView?.constraints.lods;if(!s)return o;const a=s.map(c=>Math.abs(c.scale-o)),l=a.indexOf(Math.min(...a));return s[l].scale}async takeScreenshot(o){if(this.esriView)return o.quality||(o.quality=1),o.format||(o.format="png"),this.esriView.takeScreenshot(o);throw new Error("Export attempted without a map view available")}screenPointToMapPoint(o){return this.esriView?gr$2.fromESRI(this.esriView.toMap({x:o.screenX,y:o.screenY}),"mappoint"):(this.noMapErr(),new gr$2("i_am_error",[0,0],void 0,!0))}mapPointToScreenPoint(o){if(this.esriView){const s=this.esriView.toScreen(o.toESRI());return{screenX:s.x,screenY:s.y}}else return this.noMapErr(),{screenX:1,screenY:1}}runIdentify(o){const s=this.$iApi.geo.layer.allLayersOnMap(!1).filter(g=>g.canIdentify());let a;if(o instanceof gr$2){const g=this.mapPointToScreenPoint(o);a={mapPoint:o,screenX:g.screenX,screenY:g.screenY,button:0,input:"mouse",clickTime:Date.now()}}else a=o;if(s===void 0)return{click:a,results:[]};let l=Promise.resolve([]);s.some(g=>g.identifyMode===Fn$1.HYBRID||g.identifyMode===Fn$1.SYMBOLIC)&&(l=this.esriView.hitTest({x:a.screenX,y:a.screenY}).then(g=>g.results.map(y=>({layerId:y.layer.id,layerIdx:0,oid:y.graphic.getObjectId()}))));const c={geometry:a.mapPoint,hitTest:l},u=s.filter(g=>g.supportsIdentify).map(g=>(c.tolerance=a.input=="touch"?g.touchTolerance:g.mouseTolerance,g.runIdentify(c))).flat(),d=Date.now();u.forEach(g=>{g.requestTime=d});const m={results:u,click:a};return this.$iApi.event.emit(Mt$2.MAP_IDENTIFY,m),m}async getGraphicAtCoord(o){if(!this.esriView){this.noMapErr();return}const s=this.$iApi.geo.layer.allLayersOnMap(!1).filter(m=>m.supportsFeatures||m.layerType===Ct$1.GRAPHIC);if(s.length===0)return;const a=await this.esriView.hitTest({x:o.screenX,y:o.screenY});if(a.results.length===0)return;const l=a.results;let c,u;const d=new Set;if(l.some(m=>{if(d.has(m.layer.id))return!1;const g=s.find(y=>y.id===m.layer.id);return g?(!g.isCosmetic&&g.layerType!==Ct$1.GRAPHIC&&(c=g,u=m.graphic),!0):(d.add(m.layer.id),!1)}),c&&u)return{oid:u.getObjectId(),layerId:c.id,layerIdx:c.layerIdx}}_activeKeys=[];_panInterval;_mouseFocus=!1;mapKeyDown(o){const s=["=","-"];["Shift","Control","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"].includes(o.key)&&!this._activeKeys.includes(o.key)?(this._activeKeys.push(o.key),this._activeKeys.some(a=>s.includes(a))||this.keyPan()):s.includes(o.key)&&!this._activeKeys.includes(o.key)?(this._activeKeys.push(o.key),this.keyZoom(o)):o.key==="Enter"?this.runIdentify(this.getExtent().center()):o.key==="Tab"&&this._activeKeys.push(o.key)}mapKeyUp(o){const s=["=","-"];this._activeKeys.includes(o.key)&&!s.includes(o.key)&&(this._activeKeys.splice(this._activeKeys.indexOf(o.key),1),this._activeKeys.some(a=>s.includes(a))||this.keyPan())}setMouseFocus(){this._mouseFocus=!0}stopKeyPan(){this._activeKeys.includes("Tab")&&(this._mouseFocus=!1),this._activeKeys=[],clearInterval(this._panInterval)}get keysActive(){return this._activeKeys.filter(o=>!["Control","Shift"].includes(o)).length!==0}get mouseFocus(){return this._mouseFocus}async keyZoom(o){clearInterval(this._panInterval),o.key==="="?await this.zoomIn():o.key==="-"&&await this.zoomOut(),this._activeKeys.splice(this._activeKeys.indexOf(o.key),1),this.keyPan()}keyPan(){if(clearInterval(this._panInterval),!this.keysActive)return;const o=this.getExtent().center(),s=this.mapPointToScreenPoint(o),a=this.screenPointToMapPoint({screenX:s.screenX+5,screenY:s.screenY+5}),l=Math.abs(a.x-o.x),c=Math.abs(a.y-o.y);let u=0,d=0,m=1;for(let y=0;y{o.x+=m*u,o.y+=m*d,this.zoomMapTo(o,g,!1)},25)}}const Y0t={geometryType:"point",renderer:{type:"simple",symbol:{type:"esriSMS",style:"esriSMSCircle",color:[67,100,255,200],size:7,outline:{color:[0,0,0,255],width:1}}}},J0t={geometryType:"polyline",renderer:{type:"simple",symbol:{type:"esriSLS",style:"esriSLSSolid",color:[90,90,90,200],width:2}}},q0t={geometryType:"polygon",renderer:{type:"simple",symbol:{type:"esriSFS",style:"esriSFSSolid",color:[76,76,125,200],outline:{type:"esriSLS",style:"esriSLSSolid",color:[110,110,110,255],width:1}}}},Z0t={geometryType:"polygon",renderer:{type:"simple",symbol:{type:"esriSFS",style:"esriSFSSolid",color:[255,0,0,64],outline:{type:"esriSLS",style:"esriSLSSolid",color:[240,128,128,255],width:1}}}},Q0t={circlePoint:Y0t,solidLine:J0t,outlinedPoly:q0t,boundingBoxPoly:Z0t};var x4$1={exports:{}},K0t=x4$1.exports,CG$1;function tyt(){return CG$1||(CG$1=1,function(r,o){(function(s,a){if(r.exports=a(kR$2()),typeof s.navigator=="object"){if(!s.Terraformer)throw new Error("Terraformer.ArcGIS requires the core Terraformer library. https://github.com/esri/Terraformer");s.Terraformer.ArcGIS=a(s.Terraformer)}})(K0t,function(s){var a={};function l(O){var R=0,M=0,N=[],D,P,I,L;I=O.match(/((\+|\-)[^\+\-]+)/g),L=parseInt(I[0],32);for(var F=1;F=0}function g(O){var R=[],M=O.slice(0),N=c(M.shift().slice(0));if(N.length>=4){m(N)||N.reverse(),R.push(N);for(var D=0;D=4&&(m(P)&&P.reverse(),R.push(P))}}return R}function y(O){for(var R=[],M=0;M=0;D--){var P=N[D].slice(0);R.push(P)}return R}function _(O,R){var M=s.Tools.arraysIntersectArrays(O,R),N=s.Tools.coordinatesContainPoint(O,R[0]);return!!(!M&&N)}function E(O){for(var R=[],M=[],N,D,P,I=0;I=0;N--)if(D=R[N][0],_(D,P)){R[N].push(P),J=!0;break}J||U.push(P)}for(;U.length;){P=U.pop();var z=!1;for(N=R.length-1;N>=0;N--)if(D=R[N][0],s.Tools.arraysIntersectArrays(D,P)){R[N].push(P),z=!0;break}z||R.push([P.reverse()])}return R.length===1?{type:"Polygon",coordinates:R[0]}:{type:"MultiPolygon",coordinates:R}}function w(O,R){var M={};return R=R||{},R.idAttribute=R.idAttribute||void 0,O.spatialReference&&(O.spatialReference.wkid===3857||O.spatialReference.wkid===102100)&&(M.crs=s.MercatorCRS),typeof O.x=="number"&&typeof O.y=="number"&&(M.type="Point",M.coordinates=[O.x,O.y],(O.z||O.m)&&M.coordinates.push(O.z),O.m&&M.coordinates.push(O.m)),O.points&&(M.type="MultiPoint",M.coordinates=O.points.slice(0)),O.paths&&(O.paths.length===1?(M.type="LineString",M.coordinates=O.paths[0].slice(0)):(M.type="MultiLineString",M.coordinates=O.paths.slice(0))),O.rings&&(M=E(O.rings.slice(0))),typeof O.xmin=="number"&&typeof O.ymin=="number"&&typeof O.xmax=="number"&&typeof O.ymax=="number"&&(M.type="Polygon",M.coordinates=[[[O.xmax,O.ymax],[O.xmin,O.ymax],[O.xmin,O.ymin],[O.xmax,O.ymin],[O.xmax,O.ymax]]]),(O.compressedGeometry||O.geometry||O.attributes)&&(M.type="Feature",O.compressedGeometry&&(O.geometry={paths:[l(O.compressedGeometry)]}),M.geometry=O.geometry?w(O.geometry):null,M.properties=O.attributes?d(O.attributes):null,O.attributes&&(M.id=O.attributes[R.idAttribute]||O.attributes.OBJECTID||O.attributes.FID)),new s.Primitive(M)}function T(O,R){var M;R=R||{};var N=R.idAttribute||"OBJECTID";R.sr?M={wkid:R.sr}:O&&O.crs&&O.crs.properties.name!="urn:ogc:def:crs:OGC:1.3:CRS84"?M=null:M={wkid:4326};var D={},P;switch(O.type){case"Point":D.x=O.coordinates[0],D.y=O.coordinates[1],O.coordinates[2]&&(D.z=O.coordinates[2]),O.coordinates[3]&&(D.m=O.coordinates[3]),D.spatialReference=M;break;case"MultiPoint":D.points=O.coordinates.slice(0),D.spatialReference=M;break;case"LineString":D.paths=[O.coordinates.slice(0)],D.spatialReference=M;break;case"MultiLineString":D.paths=O.coordinates.slice(0),D.spatialReference=M;break;case"Polygon":D.rings=g(O.coordinates.slice(0)),D.spatialReference=M;break;case"MultiPolygon":D.rings=y(O.coordinates.slice(0)),D.spatialReference=M;break;case"Feature":O.geometry&&(D.geometry=T(O.geometry,R)),D.attributes=O.properties?d(O.properties):{},O.id&&(D.attributes[N]=O.id);break;case"FeatureCollection":for(D=[],P=0;P=T)return E;if(M)return M=!1,_;var P=k,I;if(g.charCodeAt(P)===34){for(var L=P;L++=0?0:1],_=Math.abs(d),E=Math.floor(_),w=_-E,T=w*60,k=Math.floor(T),O=Math.floor((T-k)*60);return{whole:E,minutes:k,seconds:O,dir:y}}function l(d,m){if(m||(m="NSEW"),typeof d!="string")return null;d=d.toUpperCase();var g=/^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/,y=d.match(g);if(!y)return null;var _=y[0],E;if(y[1]&&y[5]?(E=y[1],_=_.slice(0,-1)):E=y[1]||y[5],E&&m.indexOf(E)===-1)return null;var w=y[2]?parseFloat(y[2]):0,T=y[3]?parseFloat(y[3])/60:0,k=y[4]?parseFloat(y[4])/3600:0,O=w<0?-1:1;return(E==="S"||E==="W")&&(O*=-1),{val:(Math.abs(w)+T+k)*O,dim:E,matched:_,remain:d.slice(_.length)}}function c(d,m){d=d.trim();var g=l(d,m);if(!g)return null;d=g.remain.trim();var y=l(d,m);return!y||y.remain?null:g.dim?u(g.val,y.val,g.dim):[g.val,y.val]}function u(d,m,g){if(g==="N"||g==="S")return[d,m];if(g==="W"||g==="E")return[m,d]}return Iu$2.exports}var T4$1,LG$1;function yyt(){if(LG$1)return T4$1;LG$1=1;var r=fyt,o=myt(),s=/(Lat)(itude)?/gi,a=/(L)(on|ng)(gitude)?/i;function l(O,R){var M,N,D;for(var P in O)N=P.match(R),N&&(!M||N[0].length/P.length>D)&&(D=N[0].length/P.length,M=P);return M}function c(O){return l(O,s)}function u(O){return l(O,a)}function d(O){return!!O.match(s)}function m(O){return!!O.match(a)}function g(O){return typeof O=="object"?Object.keys(O).length:0}function y(O){var R=[",",";"," ","|"],M=[];return R.forEach(function(N){var D=r.dsvFormat(N).parse(O);if(D.length>=1){for(var P=g(D[0]),I=0;Ia.indexOf(" ")>-1;o.fields?.forEach(a=>{if(a.name&&s(a.name)){const l=a.name;let c,u="_",d;do c=l.replace(/ /g,u),d=o.fields?.find(m=>m.name===c),d&&(u+="_");while(d);a.alias=l,a.name=c;for(let m=0;ml.coordinates);r.features[o].geometry={type:`Multi${s[0].type}`,coordinates:a}}}function wyt(r){return r==="MultiLineString"?"LineString":r==="MultiPolygon"?"Polygon":r}class xyt extends Tn$2{async fetchFileData(o,s){const a=await u0$2.get(o,{responseType:"arrayBuffer"});switch(s){case Ct$1.GEOJSON:case Ct$1.DATAJSON:return JSON.parse(this.arbToStr(a.data));case Ct$1.SHAPEFILE:case Ct$1.GEOJSONZIPPED:case Ct$1.FLATGEOBUF:case Ct$1.FLATGEOBUFZIPPED:return a.data;case Ct$1.CSV:case Ct$1.DATACSV:return this.arbToStr(a.data);default:console.error(`Unsupported file type passed to fetchFileData- '${s}'`)}}extractGeoJsonFields(o){if(o.features.length<1)throw new Error("GeoJSON field extraction requires at least one feature");let s="";for(let u=0;u({name:u,type:"string"}));let l=0;const c=Object.keys(o.features[0].properties);for(;lc.includes(d)).forEach(d=>{const m=u.properties[d];if(m!=null){const g=a.findIndex(y=>y.name===d);a[g]={name:d,type:this.inferType(m)},c.splice(c.indexOf(d),1)}}),c.length===0)break;l++}return a}extractCsvFields(o,s=","){return S4$1.dsv.dsvFormat(s).parseRows(o)[0].map(a=>({name:a,type:Gs$2.STRING}))}filterCsvLatLonFields(o,s=","){const a=S4$1.dsv.dsvFormat(s).parseRows(o),l=a[0],c={lat:JSON.parse(JSON.stringify(l)),lon:JSON.parse(JSON.stringify(l))};for(let u=0;u90)&&g!==-1&&c.lat.splice(g,1),(isNaN(m)||m<-180||m>180)&&y!==-1&&c.lon.splice(y,1),g===-1&&y===-1)break}return c}async geoJsonToEsriJson(o,s){let a,l="",c;const u={objectIdField:"OBJECTID",fields:[{name:"OBJECTID",type:Gs$2.OID}]};vyt(o);const d=o.features[0].geometry.type,m=gyt[d],g=JSON.parse(JSON.stringify(Q0t[m]));if(s){if(s.sourceProjection&&(l=this.$iApi.geo.proj.normalizeProj(s.sourceProjection)),s.targetSR)a=s.targetSR;else throw new Error("geoJsonToEsriJson - missing opts.targetSR arguement");s.layerId?c=s.layerId:c=this.$iApi.geo.shared.generateUUID(),s.colour&&(g.renderer.symbol.color=new ya$1(s.colour).toArcServer())}else throw new Error("geoJsonToEsriJson - missing opts arguement");l||(l=Bt$2.parseGeoJsonCrs(o.crs)),u.renderer=await Pe.RendererFromJson(g.renderer),u.fields=(u.fields||[]).concat(s.fieldMetadata?.exclusiveFields?this.extractGeoJsonFields(o).filter(T=>s.fieldMetadata?.fieldInfo?.find(k=>k.name===T.name)):this.extractGeoJsonFields(o)),s.fieldMetadata?.enforceOrder&&s.fieldMetadata?.fieldInfo&&s.fieldMetadata?.fieldInfo.length>0&&(u.fields=this.$iApi.geo.attributes.orderFields(u.fields,s.fieldMetadata?.fieldInfo)),byt(o,u);const y=this.$iApi.geo.proj.normalizeProj(a);if(s){if(s.latField){const T=u.fields.find(k=>k.name===s.latField||k.alias===s.latField);T&&(T.type=Gs$2.DOUBLE)}if(s.lonField){const T=u.fields.find(k=>k.name===s.lonField||k.alias===s.lonField);T&&(T.type=Gs$2.DOUBLE)}}await this.$iApi.geo.proj.checkProjBomber([l,a]);const _=Bt$2.parseSR(a).toESRI();await this.$iApi.geo.proj.projectGeoJson(o,l,y);const E=nyt.convert(o,{sr:8888});u.geometryType=this.$iApi.geo.geom.geoJsonGeomTypeToEsriGeomType(d);const w=u.fields.map(T=>T.name);for(let T=0;T{w.includes(O)?(Array.isArray(k.attributes[O])||typeof k.attributes[O]=="object")&&k.attributes[O]!=null&&(k.attributes[O]=JSON.stringify(k.attributes[O])):delete k.attributes[O]})}return(s.fieldMetadata?.fieldInfo&&s.fieldMetadata?.fieldInfo.length>0?s.fieldMetadata.fieldInfo.filter(T=>T.trim&&w.includes(T.name)).map(T=>T.name):[]).forEach(T=>{for(let k=0;k{S4$1.csv2geojson(o,a,(u,d)=>{u?(console.error("csv conversion error"),console.error(u),c(u)):(d.features.map(m=>{m.properties[a.lonfield]=m.geometry.coordinates[0],m.properties[a.latfield]=m.geometry.coordinates[1]}),l(d))})})}async shapefileToGeoJson(o){return(await __vitePreload(()=>import("./shp.min-rg-oXwj1-DJmkRAgl.js"),__vite__mapDeps([183,184]),import.meta.url).then(s=>s.s)).default(o)}fgbToGeoJson(o,s){return __vitePreload(async()=>{const{geojson:a}=await import("./flatgeobuf-Dd2813h3-BUA_MfuC.js");return{geojson:a}},[],import.meta.url).then(({geojson:a})=>new Promise(l=>{let c=!1,u=null;const d=a.deserialize(new Uint8Array(o),void 0,y=>{u=y.crs,c=!0});let m=0;const g=setInterval(()=>{if(d&&c){clearInterval(g);let y;u&&(u.code&&u.code!==4326&&u.org==="EPSG"?y=new Bt$2(u.code):u.wkt?y=new Bt$2(u.wkt):console.error("Encountered FlatGeobuf with non-EPSG org: ",u)),y&&(d.crs=y.toGeoJSON()),l(d)}else m+=60,m>s&&(clearInterval(g),l({}))},60)}))}inferType(o){return typeof o=="number"?Gs$2.DOUBLE:Gs$2.STRING}rawDataJsonParser(o,s=!1){let a;return typeof o=="string"?a=JSON.parse(o):s?a=structuredClone(o):a=o,a}async unzipSingleFile(o){const s=await __vitePreload(()=>import("./jszip.min-C61Pcz7i-DlvfXQ6c.js"),__vite__mapDeps([185,184]),import.meta.url).then(c=>c.j),a=await new s.default().loadAsync(o),l=Object.keys(a.files)[0];if(l&&a.file(l))return await a.file(l).async("arraybuffer");throw new Error("Could not find file in zipfile data.")}async binaryInitHelper(o){if(o.rawData&&o.rawData instanceof ArrayBuffer)return o.rawData;if(o.url)return this.$iApi.geo.layer.files.fetchFileData(o.url,o.layerType);throw new Error(`${o.layerType} config contains no url or invalid/missing raw data`)}arbToStr(o){return new TextDecoder("utf-8").decode(new Uint8Array(o))}}const Eyt=JSON.parse("[4326,4269,4258,31467,31468,31469,2166,2167,2168,2036,2044,2045,2065,2081,2082,2083,2085,2086,2091,2092,2093,2096,2097,2098,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2193,2199,2200,2206,2207,2208,2209,2210,2211,2212,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2935,2936,2937,2938,2939,2940,2941,2953,2963,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3034,3035,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3058,3059,3068,3114,3115,3116,3117,3118,3120,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3146,3147,3150,3151,3152,3300,3301,3328,3329,3330,3331,3332,3333,3334,3335,3346,3350,3351,3352,3366,3386,3387,3388,3389,3390,3396,3397,3398,3399,3407,3414,3416,3764,3788,3789,3790,3791,3793,3795,3796,3819,3821,3823,3824,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,3850,3851,3852,3854,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3888,3889,3906,3907,3908,3909,3910,3911,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4040,4041,4042,4043,4044,4045,4046,4047,4052,4053,4054,4055,4074,4075,4080,4081,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4178,4179,4180,4181,4182,4183,4184,4185,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4322,4324,4327,4329,4339,4341,4343,4345,4347,4349,4351,4353,4355,4357,4359,4361,4363,4365,4367,4369,4371,4373,4375,4377,4379,4381,4383,4386,4388,4417,4434,4463,4466,4469,4470,4472,4475,4480,4482,4483,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4557,4558,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4839,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4883,4885,4887,4889,4891,4893,4895,4898,4900,4901,4902,4903,4904,4907,4909,4921,4923,4925,4927,4929,4931,4933,4935,4937,4939,4941,4943,4945,4947,4949,4951,4953,4955,4957,4959,4961,4963,4965,4967,4969,4971,4973,4975,4977,4979,4981,4983,4985,4987,4989,4991,4993,4995,4997,4999,5012,5013,5017,5048,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5132,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5224,5228,5229,5233,5245,5246,5251,5252,5253,5254,5255,5256,5257,5258,5259,5263,5264,5269,5270,5271,5272,5273,5274,5275,5801,5802,5803,5804,5808,5809,5810,5811,5812,5813,5814,5815,5816,20004,20005,20006,20007,20008,20009,20010,20011,20012,20013,20014,20015,20016,20017,20018,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030,20031,20032,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,20076,20077,20078,20079,20080,20081,20082,20083,20084,20085,20086,20087,20088,20089,20090,20091,20092,21413,21414,21415,21416,21417,21418,21419,21420,21421,21422,21423,21453,21454,21455,21456,21457,21458,21459,21460,21461,21462,21463,21473,21474,21475,21476,21477,21478,21479,21480,21481,21482,21483,21896,21897,21898,21899,22171,22172,22173,22174,22175,22176,22177,22181,22182,22183,22184,22185,22186,22187,22191,22192,22193,22194,22195,22196,22197,25884,27205,27206,27207,27208,27209,27210,27211,27212,27213,27214,27215,27216,27217,27218,27219,27220,27221,27222,27223,27224,27225,27226,27227,27228,27229,27230,27231,27232,27391,27392,27393,27394,27395,27396,27397,27398,27492,28402,28403,28404,28405,28406,28407,28408,28409,28410,28411,28412,28413,28414,28415,28416,28417,28418,28419,28420,28421,28422,28423,28424,28425,28426,28427,28428,28429,28430,28431,28432,28462,28463,28464,28465,28466,28467,28468,28469,28470,28471,28472,28473,28474,28475,28476,28477,28478,28479,28480,28481,28482,28483,28484,28485,28486,28487,28488,28489,28490,28491,28492,29701,29702,30161,30162,30163,30164,30165,30166,30167,30168,30169,30170,30171,30172,30173,30174,30175,30176,30177,30178,30179,30800,31251,31252,31253,31254,31255,31256,31257,31258,31259,31275,31276,31277,31278,31279,31281,31282,31283,31284,31285,31286,31287,31288,31289,31290,31466,31700]");function Wl$2(r,o){return r.then(function(s){return[null,s]}).catch(function(s){return[s,void 0]})}class Tyt extends Tn$2{async loadWfsData(o,s=-1,a=0,l=1e3,c={type:"FeatureCollection",features:[]},u=!1){let d={offset:a.toString(),limit:l.toString()};s===-1&&(d={resulttype:"hits"});const m=new Rf$1(o).updateQuery(d),[g,y]=await Wl$2(u0$2.get(m));if(!y)return console.error(`WFS data failed to load for ${o}`,g),Promise.reject(g);const _=y.data;if(s===-1)return s=y.data.numberMatched,this.loadWfsData(o,s,a,l,c,u);if(c.features=c.features.concat(_.features),_.features.length0&&c.features[0].geometry.type===hn$2.POINT&&c.features.forEach(E=>{const w=E.geometry.coordinates;E.properties.rvInternalCoordX=w[0],E.properties.rvInternalCoordY=w[1]}),c}reversedAxisWKIDs(){return Eyt}parseCapabilities(o){const s=()=>{let u=o;if(o.indexOf("?")===-1)u+="?service=WMS&request=GetCapabilities";else{const d=new Rf$1(o.toUpperCase());"SERVICE"in d.queryMap||(u+="&service=WMS"),"REQUEST"in d.queryMap||(u+="&request=GetCapabilities")}return fn$2(u,{responseType:"xml"}).then(d=>d.data)},a=new Promise(u=>{s().then(d=>u(d)).catch(()=>{console.error("Get capabilities failed; trying the second time;"),u(s())})}),l=u=>{let d=u.Layer;return d?(Array.isArray(d)||(d=[d]),d.map(m=>{const g=m.Name,y=m.Title;let _=m.Style;const E=[],w={};return _&&(Array.isArray(_)||(_=[_]),_.forEach(T=>{const k=T.Name;if(E.push(k),T.LegendURL){const O=T.LegendURL.OnlineResource["@_xlink:href"];w[k]=O.replaceAll("&","&")}})),{name:g?.toString()??null,title:y,queryable:m["@_queryable"]==="1",layers:l(m),allStyles:E,styleToURL:w,currentStyle:E[0]}})):[]},c=u=>{let d=u.Format;return Array.isArray(d)||(d=[d]),d};return __vitePreload(()=>import("./fxp-BPfEykj3-DQYybnRw.js"),[],import.meta.url).then(u=>u.f).then(({XMLParser:u})=>a.then(d=>{if(!d)return[];const m=new XMLSerializer().serializeToString(d),g={ignoreAttributes:!1},y=new u(g).parse(m);if("ServiceExceptionReport"in y)return console.error(y.ServiceExceptionReport.ServiceException),[];const _=y.WMS_Capabilities.Capability;return{layers:l(_),queryTypes:c(_.Request.GetFeatureInfo)}}))}}let Kp$2=class{static makeRawItem(o,s){const a=Promise.resolve();return Vn$1({format:o,data:s,started:!0,loaded:!0,loading:a,load(){return a}})}static makeOidItem(o,s){const a=new xn$2,l={format:Ql$2.ESRI,data:void 0,started:!1,loaded:!1,loading:a.getPromise(),async load(){if(!this.started){this.started=!0;const c=await s.getGraphic(o,{getAttribs:!0});this.data=c.attributes,this.loaded=!0,a.resolveMe()}return a.getPromise()}};return Vn$1(l)}};class Syt extends Tn$2{files;ogc;constructor(o){super(o),this.files=new xyt(o),this.ogc=new Tyt(o)}createLayer(o){let s;switch(o.layerType){case Ct$1.FEATURE:s=Ryt;break;case Ct$1.MAPIMAGE:s=kyt;break;case Ct$1.GRAPHIC:s=GG$1;break;case Ct$1.TILE:s=FG$1;break;case Ct$1.WFS:s=Fyt;break;case Ct$1.DATATABLE:s=Uyt;break;case Ct$1.WMS:s=Gyt;break;case Ct$1.GEOJSON:s=Ayt;break;case Ct$1.GEOJSONZIPPED:s=Nyt;break;case Ct$1.FLATGEOBUFZIPPED:s=Cyt;break;case Ct$1.CSV:s=Myt;break;case Ct$1.DATAJSON:s=jyt;break;case Ct$1.IMAGERY:s=Dyt;break;case Ct$1.SHAPEFILE:s=Iyt;break;case Ct$1.FLATGEOBUF:s=Oyt;break;case Ct$1.OSM:s=Pyt;break;default:throw new Error("Unsupported Layer Type "+o.layerType)}return new s(o,this.$iApi)}getLayer(o){return As$1(this.$vApp.$pinia).getLayerByAny(o)}getSublayer(o,s){const a=As$1(this.$vApp.$pinia).getLayerById(o);if(a&&a.supportsSublayers&&sc===a);return l===-1?void 0:l}else return}layerOrderIds(){return As$1(this.$vApp.$pinia).mapOrder.slice(0)||[]}allLayers(){return As$1(this.$vApp.$pinia).layers||[]}allActiveLayers(){return this.allLayers().filter(o=>o.layerState!==sn$2.ERROR&&o.initiationState===Ye$2.INITIATED)}allLayersOnMap(o=!0){let s=this.allLayers().filter(a=>a.mapLayer&&a.initiationState===Ye$2.INITIATED);if(o){const a=this.layerOrderIds(),l=new Map(a.map((c,u)=>[c,u]));s.sort((c,u)=>l.get(c.id)-l.get(u.id))}return s}allDataLayers(){return this.allLayers().filter(o=>!o.mapLayer&&o.initiationState===Ye$2.INITIATED)}allErrorLayers(){return this.allLayers().filter(o=>o.layerState===sn$2.ERROR)}allInitiatingLayers(){return this.allLayers().filter(o=>o.initiationState===Ye$2.INITIATING)}getLayerControls(o){const s=this.getLayer(o);if(!s)return;const a=s.config.controls?.slice()??[pn$2.BoundaryZoom,pn$2.Datatable,pn$2.Identify,pn$2.Metadata,pn$2.Opacity,pn$2.Refresh,pn$2.Reload,pn$2.Remove,pn$2.Settings,pn$2.Symbology,pn$2.Visibility],l=[];return s.supportsFeatures||l.push(pn$2.Datatable),s.extent===void 0&&l.push(pn$2.BoundaryZoom),(s.config?.metadata||(s.isSublayer?s.parentLayer?.config?.metadata:{})||{}).url||l.push(pn$2.Metadata),!s.mapLayer&&!s.config.controls?.includes(pn$2.Settings)&&l.push(pn$2.Settings),l.forEach(c=>{const u=a?.indexOf(c)??-1;u!==-1&&a?.splice(u,1)}),{controls:a,disabledControls:s.config.disabledControls??[]}}async loadLayerMetadata(o){if(!o.trim())throw new Error("url missing on layer server metadata request.");const[s,a]=await Wl$2(fn$2(o,{query:{f:"json"}}));if(!a)throw console.error(`Service metadata load error: ${o}`,s),new Error(`Service metadata load error: ${o}`);if(!a.data)throw console.error(`Service metadata load error: ${o}`),new Error(`Service metadata load error: ${o}`);const l=a.data,c={geometryType:qt$2.NONE,minScale:0,maxScale:0,canModifyLayer:!0,extent:void 0,defaultVisibility:!0,fields:[],displayField:"",objectIdField:"",renderer:void 0,currentVersion:0,name:"",dataFormat:nr$2.UNKNOWN,mapLayer:!0};if(c.name=l.name||"",c.currentVersion=l.currentVersion||-1,c.minScale=l.effectiveMinScale||l.minScale||0,c.maxScale=l.effectiveMaxScale||l.maxScale||0,c.extent=l.extent?tn$2.fromArcServer(l.extent,"layer_extent"):void 0,c.defaultVisibility=l.defaultVisibility??!0,c.canModifyLayer=l.canModifyLayer??!0,l.type==="Feature Layer"||l.type==="Table"){if(c.dataFormat=nr$2.ESRI_FEATURE,c.displayField=l.displayField||"",Array.isArray(l.fields)){const u=await Promise.all(l.fields.map(d=>Pe.FieldFromJson(d)));c.fields=u.map(d=>({name:d.name,alias:d.alias,type:d.type,length:d.length})),u.every(d=>d.type==="oid"?(c.objectIdField=d.name,!1):!0)&&(c.objectIdField=l.objectIdField||(console.error(`Encountered service with no OID defined: ${o}`),"")),l.type==="Feature Layer"?(c.geometryType=this.$iApi.geo.geom.serverGeomTypeToRampGeomType(l.geometryType),l.drawingInfo?.renderer&&(c.renderer=await Pe.RendererFromJson(l.drawingInfo.renderer)),l.sourceSpatialReference&&(c.sourceSR=Bt$2.fromConfig(l.sourceSpatialReference))):c.mapLayer=!1}}else c.dataFormat=nr$2.ESRI_RASTER;return c}async loadFeatureCount(o,s=""){if(!o)return console.error("A layer without a url attempted to run the server based feature count routine."),0;const a={query:{f:"json",where:s||"1=1",returnCountOnly:!0,returnGeometry:!1}},[l,c]=await Wl$2(fn$2(`${o}/query`,a));return c?c.data?Number.isInteger(c.data.count)?c.data.count:(console.error(`Funny result (${c.data.count}) during feature count: ${o}`),0):(console.error(`Unable to load feature count: ${o}`),0):(console.error(`Feature count request unsuccessful: ${o}`,l),0)}}let kb$2=class extends Tn$2{config={};id;uid;name;layerState;initiationState;drawState;layerIdx;layerType;layerFormat;dataFormat;supportsIdentify;supportsFeatures;mapLayer;featureCount;fields;fieldList;nameField;oidField;expectedTime;lastCancel;supportsSublayers;isSublayer;isRemoved;isFile;isCosmetic;userAdded;identify;identifyMode;hovertips;geomType;legend;esriLayer;esriSubLayer;esriView;extent;sourceSR;canModifyLayer;canReload;url;_parentLayer;_sublayers;constructor(o,s){super(s),this.config=o,this.id="",this.uid="",this.name="error",this.layerState=sn$2.NEW,this.drawState=$r$2.NOT_LOADED,this.initiationState=Ye$2.NEW,this.layerIdx=-1,this.layerFormat=ui$1.UNKNOWN,this.layerType=Ct$1.UNKNOWN,this.dataFormat=nr$2.UNKNOWN,this.supportsIdentify=!1,this.identifyMode=Fn$1.NONE,this.supportsFeatures=!1,this.mapLayer=!0,this.featureCount=0,this.fields=[],this.fieldList="",this.nameField="",this.oidField="",this.supportsSublayers=!1,this.isSublayer=!1,this.isRemoved=!1,this.isFile=!1,this.isCosmetic=!1,this.userAdded=!1,this.identify=!1,this.hovertips=!1,this.geomType=qt$2.UNKNOWN,this.legend=[],this._sublayers=[],this.expectedTime={draw:0,load:0,fail:0},this.lastCancel=0,this.canModifyLayer=!0,this.canReload=!0,this.url=""}async initiate(){return Promise.resolve()}async terminate(){return Promise.resolve()}async reload(){return Promise.resolve()}cancelLoad(){}removeEsriLayer(){}loadPromise(){return Promise.resolve()}get isLoaded(){return!1}get layerExists(){return!1}getFieldsToTrim(){return[]}getLayerTree(){return new Vg$2(0,"Fake tree","getLayerTree() was not implemented in layer")}getSR(){return Bt$2.latLongSR()}get visibility(){return!1}set visibility(o){}get opacity(){return 0}set opacity(o){}get scaleSet(){return new MR$2}set scaleSet(o){}isOffscale(o=void 0){return!1}zoomToVisibleScale(){return Promise.resolve()}zoomToLayerBoundary(){return Promise.resolve()}get mouseTolerance(){return 0}set mouseTolerance(o){}get touchTolerance(){return 0}set touchTolerance(o){}get drawOrder(){return[]}canIdentify(){return!1}runIdentify(o){return[]}getAttributes(){return Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){}clearFeatureCache(){}downloadedAttributes(){return 0}attribLoadAborted(){return!1}getTabularAttributes(){return Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(o,s){return Promise.resolve(new Si$1(new al$2))}getIcon(o){return Promise.resolve("")}getSqlFilter(o){return""}setSqlFilter(o,s){}applySqlFilter(o=[]){}getFilterOIDs(o=[],s=void 0){return Promise.resolve(void 0)}getGraphicExtent(o){return Promise.resolve(tn$2.fromParams("fake",0,0,0,0))}get parentLayer(){if(this.isSublayer)return this._parentLayer;throw new Error("Attempted to get parent layer of a non-sublayer object")}set parentLayer(o){if(!this.isSublayer&&o)throw new Error("Attempted to set parent layer for a non-sublayer object");this._parentLayer=o}get sublayers(){return this._sublayers}onLoad(){}onError(o=!0){}updateLayerState(o,s=!1){}updateDrawState(o){}updateInitiationState(o){}uidToIdx(o){if(o===this.uid)return-1;{const s=this._sublayers.findIndex(a=>a?.uid===o);if(s===-1)throw new Error(`Attempt to access non-existing unique id [layerid ${this.id}, uid ${o}]`);return s}}getSublayer(o){if(!this.supportsSublayers){console.warn(`Attempted to call getSublayer on a layer (layer id: ${this.id}) that does not support FCs`);return}let s;if(typeof o=="string"?s=this.uidToIdx(o):s=o,this._sublayers[s]===void 0)throw new Error(`Attempt to access non-existing layer index [layerid ${this.id}, lookup value ${o}]`);return this._sublayers[s]}controlAvailable(o){const s=this.$iApi.geo.layer.getLayerControls(this.id);return this.$iApi.geo.shared.controlAvailable(o,s)}},PG$1=class extends kb$2{timers;origRampConfig;loadDefProm;loadPromDone;layerTree;constructor(o,s){super(o,s),this.name=o.name||"",this.geomType=qt$2.NONE,this.dataFormat=nr$2.UNKNOWN,this.layerType=Ct$1.UNKNOWN,this.layerFormat=ui$1.UNKNOWN;const a=s.geo.map.layerDefaultTimes;this.expectedTime.draw=o.expectedDrawTime??a.draw,this.expectedTime.load=o.expectedLoadTime??a.load,this.expectedTime.fail=o.maxLoadTime||a.fail,this.lastCancel=0,this.timers={draw:void 0,load:void 0},this.origRampConfig=o,this.id=o.id||"",this.uid=this.$iApi.geo.shared.generateUUID(),this.isCosmetic=!1,this.isRemoved=!1,this.isSublayer=!1,this.supportsIdentify=!1,this.mapLayer=!0,this.identifyMode=Fn$1.NONE,this.supportsFeatures=!1,this.hovertips=!1,this.supportsSublayers=!1,this.isFile=!1,this.layerState=sn$2.NEW,this.initiationState=Ye$2.NEW,this.drawState=$r$2.NOT_LOADED,this.loadDefProm=new xn$2,this.url=this.origRampConfig.url,this.canReload=!!(this.url||this.origRampConfig.caching),this.loadPromDone=!1,this.layerTree=new Vg$2(0,this.uid,this.name,!0)}updateInitiationState(o){this.initiationState=o,this.$iApi.event.emit(Mt$2.LAYER_INITIATIONSTATECHANGE,{state:o,layer:this})}updateLayerState(o,s=!1){this.layerState=o,this.$iApi.event.emit(Mt$2.LAYER_LAYERSTATECHANGE,{state:o,layer:this,userCancel:s})}updateDrawState(o){this.drawState=o,o===$r$2.REFRESH?this.startTimer("draw"):o===$r$2.UP_TO_DATE&&this.stopTimer("draw"),this.$iApi.event.emit(Mt$2.LAYER_DRAWSTATECHANGE,{state:o,layer:this})}async initiate(){this.updateInitiationState(Ye$2.INITIATING),this.startTimer("load");const o=c=>{this.layerState!==sn$2.ERROR&&(console.error(c),this.onError())},s=Date.now(),a=setTimeout(()=>{s>this.lastCancel&&(this.lastCancel=Date.now(),o("Layer timed out during initialize. Id: "+this.id))},this.expectedTime.fail),[l]=await Wl$2(this.onInitiate());clearTimeout(a),s>this.lastCancel&&(this.drawState!==$r$2.UP_TO_DATE&&this.startTimer("draw"),l?o(`Init error on layer id: ${this.id} . ${l.message}`):this.updateInitiationState(Ye$2.INITIATED))}async onInitiate(){if(this.isSublayer)return console.warn("Attempted to initiate a sublayer as a CommonLayer"),Promise.resolve();this.initiationState===Ye$2.INITIATED&&console.error(`Encountered layer initialize while already initiated, layer id ${this.id}`)}async terminate(){this.updateInitiationState(Ye$2.TERMINATING),await Promise.all(this.sublayers.map(o=>o.terminate())),this.loadDefProm=new xn$2,this.loadPromDone=!1,this.updateLayerState(sn$2.NEW),this.updateDrawState($r$2.NOT_LOADED),this.updateInitiationState(Ye$2.TERMINATED)}onLoad(){const o=Date.now();let s=!1;const a=setTimeout(()=>{s=!0,this.onError()},this.expectedTime.fail);try{const l=this.onLoadActions();Promise.all(l).then(()=>{clearTimeout(a),s?this.visibility=!1:(this.stopTimer("load"),o>this.lastCancel&&(this.loadPromDone&&(this.loadDefProm=new xn$2),this.loadDefProm.resolveMe(),this.loadPromDone=!0,this.sublayers.forEach(c=>c.onLoad()),this.updateLayerState(sn$2.LOADED)))}).catch(()=>{clearTimeout(a),this.onError()})}catch(l){console.error("Encountered error on layer load: ",l),clearTimeout(a),this.onError()}}onError(o=!0){this.layerState!==sn$2.ERROR&&(this.initiationState===Ye$2.INITIATING&&this.updateInitiationState(Ye$2.NEW),this.loadPromDone&&(this.loadDefProm=new xn$2),this.loadDefProm.rejectMe(),this.loadPromDone=!0,this.sublayers.forEach(s=>s.onError(o)),o&&this.$iApi.notify.show(oi$1.ERROR,this.$iApi.$i18n.t("layer.error",{id:this.id})),this.stopTimer("draw"),this.stopTimer("load"),this.updateLayerState(sn$2.ERROR,!o))}onLoadActions(){return[]}cancelLoad(){this.isLoaded||this.initiationState===Ye$2.NEW||this.initiationState===Ye$2.TERMINATING||this.initiationState===Ye$2.TERMINATED||(this.lastCancel=Date.now(),this.esriLayer&&this.esriLayer.loadStatus==="loading"&&this.esriLayer.cancelLoad(),this.removeEsriLayer(),this.onError(!1))}loadPromise(){return this.loadDefProm.getPromise()}get isLoaded(){return this.layerState===sn$2.LOADED}canIdentify(){return this.supportsIdentify&&this.isLoaded&&this.visibility&&this.identify&&!this.scaleSet.isOffScale(this.$iApi.geo.map.getScale()).offScale}getLayerTree(){return this.layerTree}stubError(){throw new Error(`Attempted to use a method not valid for ${this.layerType}`)}getAttributes(){return this.stubError(),Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){this.stubError()}clearFeatureCache(){this.stubError()}getTabularAttributes(){return this.stubError(),Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(o,s){return this.stubError(),Promise.resolve(new Si$1(new al$2))}getIcon(o){return this.stubError(),Promise.resolve("")}getSqlFilter(o){return this.stubError(),""}setSqlFilter(o,s){this.stubError()}getFilterOIDs(o=[],s=void 0){return this.stubError(),Promise.resolve(void 0)}getGraphicExtent(o){return this.stubError(),Promise.resolve(tn$2.fromParams("fake",0,0,0,0))}applySqlFilter(o=[]){this.stubError()}setCustomParameter(o,s,a=!0){this.stubError()}startTimer(o){this.stopTimer(o),this.expectedTime[o]>0&&(this.timers[o]=window.setTimeout(()=>this.$iApi.notify.show(oi$1.WARNING,this.$iApi.$i18n.t(`layer.long${o}`,{id:this.name||this.id})),this.expectedTime[o]))}stopTimer(o){this.timers[o]&&(clearTimeout(this.timers[o]),this.timers[o]=void 0)}},Mu$3=class extends PG$1{_serverVisibility;_scaleSet;_mouseTolerance;_touchTolerance;_drawOrder;_lastFilterUpdate="";viewDefProm;esriWatches;constructor(o,s){super(o,s),this._scaleSet=new MR$2,this._mouseTolerance=o.mouseTolerance!=null?o.mouseTolerance:5,this._touchTolerance=o.touchTolerance!=null?o.touchTolerance:15,this._drawOrder=[],this._serverVisibility=void 0,this.isCosmetic=o.cosmetic||!1,this.extent=o.extent?tn$2.fromConfig(`${this.id}_extent`,o.extent):void 0,this.viewDefProm=new xn$2,this.esriWatches=[]}noLayerErr(){console.error("Attempted to manipulate the layer but no layer found. Likely .initiate() was not finished or failed. Layer id "+this.id),console.trace()}notLoadedErr(){console.error("Attempted to manipulate the layer before it was loaded. Layer id "+this.id),console.trace()}async onInitiate(){if(await super.onInitiate(),!this.esriLayer){this.noLayerErr();return}this.esriWatches.push(this.esriLayer.watch("visible",o=>{this.$iApi.event.emit(Mt$2.LAYER_VISIBILITYCHANGE,{visibility:o,layer:this})})),this.esriWatches.push(this.esriLayer.watch("opacity",o=>{this.$iApi.event.emit(Mt$2.LAYER_OPACITYCHANGE,{opacity:o,layer:this})})),this.esriWatches.push(this.esriLayer.watch("loadStatus",o=>{const s={"not-loaded":sn$2.LOADING,loading:sn$2.LOADING,loaded:sn$2.LOADED,failed:sn$2.ERROR};o==="loaded"?this.onLoad():o==="failed"?this.onError():this.updateLayerState(s[o])})),this.esriLayer.on("layerview-create",o=>{this.esriView=o.layerView,this.esriWatches.push(o.layerView.watch("updating",s=>{this.updateDrawState(s?$r$2.REFRESH:$r$2.UP_TO_DATE)})),this.viewDefProm.resolveMe()}),this.sublayers.forEach(o=>o.initiate())}async terminate(){this.esriLayer=void 0,await super.terminate(),this.viewDefProm=new xn$2,this.esriWatches.forEach(o=>o.remove()),this.esriWatches=[]}async reload(){if(!this.$iApi.geo.map.esriMap){console.error("Attempted layer reload when no map exists");return}this.removeEsriLayer();const o=Date.now();if(this.$iApi.event.emit(Mt$2.LAYER_RELOAD_START,this),this.sublayers.forEach(s=>this.$iApi.event.emit(Mt$2.LAYER_RELOAD_START,s)),await this.terminate(),await this.initiate(),!(this.lastCancel>o)){if(!this.esriLayer){console.error("ESRI layer failed to re-create during reload.");return}this.$iApi.geo.map.insertToEsriMap(this),this.$iApi.event.emit(Mt$2.LAYER_RELOAD_END,this),this.sublayers.forEach(s=>this.$iApi.event.emit(Mt$2.LAYER_RELOAD_END,s))}}makeEsriLayerConfig(o){return{id:o.id,url:o.url,opacity:o?.state?.opacity??1,visible:o?.state?.visibility??!0}}removeEsriLayer(){this.esriLayer&&this.$iApi.geo.map.esriMap&&this.$iApi.geo.map.esriMap.layers.findIndex(o=>o.id===this.id)>-1&&this.$iApi.geo.map.esriMap.layers.remove(this.esriLayer)}onLoadActions(){const o=super.onLoadActions();this.name||(this.name=this.esriLayer?.title||this.id),this.isCosmetic||(this.identify=this.config.state?.identify??this.supportsIdentify);const s=this.$iApi.geo.proj.checkProj(this.getSR()).then(a=>a?Promise.resolve():Promise.reject());return o.push(s),o}mapCheck(){return this.$iApi.geo.map.created?!0:(console.error("Attempting to use map-dependent logic before the layer has been added to the map"),console.trace(),!1)}get scaleSet(){return this._scaleSet}set scaleSet(o){this._scaleSet=o}isOffscale(o=void 0){let s;if(typeof o>"u")if(this.mapCheck())s=this.$iApi.geo.map.getScale();else return!1;else s=o;return this.scaleSet.isOffScale(s).offScale}zoomToVisibleScale(){return this.mapCheck()?this.$iApi.geo.map.zoomToVisibleScale(this.scaleSet):Promise.resolve()}zoomToLayerBoundary(){return this.extent?this.mapCheck()?this.$iApi.geo.map.zoomMapTo(this.extent):Promise.resolve():(console.error(`Attempted to zoom to boundary of a layer with no extent (Layer Id: ${this.id})`),Promise.resolve())}get mouseTolerance(){return this._mouseTolerance}set mouseTolerance(o){if(!this.supportsIdentify){console.warn("Attempted to set click tolerance on a layer that doesn't support identify");return}if(o<0){console.error("Attempted to set a negative click tolerance");return}this._mouseTolerance=o}get touchTolerance(){return this._touchTolerance}set touchTolerance(o){if(!this.supportsIdentify){console.warn("Attempted to set touch tolerance on a layer that doesn't support identify");return}if(o<0){console.error("Attempted to set a negative touch tolerance");return}this._touchTolerance=o}get layerExists(){return this.initiationState===Ye$2.INITIATED&&!!this.esriLayer}get drawOrder(){return this._drawOrder}get visibility(){return this.layerExists?this.esriLayer.visible:!1}set visibility(o){this.layerExists?this.esriLayer.visible=o:this.noLayerErr()}checkVisibility(){this.supportsSublayers&&this.layerExists&&(this.visibility=this.sublayers.some(o=>o.visibility))}get opacity(){return this.layerExists?this.esriLayer.opacity:0}set opacity(o){this.layerExists?this.esriLayer.opacity=o:this.noLayerErr()}getSR(){return this.esriLayer?Bt$2.fromESRI(this.esriLayer.spatialReference):(this.noLayerErr(),Bt$2.latLongSR())}},A4$1=class extends Mu$3{attribs;renderer;serviceUrl;canModifyLayer;filter;constructor(o,s){super(o,s),this.supportsIdentify=!0,this.geomType=qt$2.UNKNOWN,this.serviceUrl="",this.fieldList="",this.canModifyLayer=!0,this.filter=new NR$2(o.permanentFilteredQuery||"",o.initialFilteredQuery||""),this.hovertips=o.state?.hovertips??!0,this.attribs=new UG$1}makeEsriLayerConfig(o){return super.makeEsriLayerConfig(o)}async loadLayerMetadata(o={}){if(!this.serviceUrl)return;const s=Date.now(),a=await this.$iApi.geo.layer.loadLayerMetadata(this.serviceUrl);if(!(s{u.field&&this.fields.findIndex(d=>d.name===u.field)===-1&&console.error(`Draw order for layer ${this.id} references invalid field ${u.field}`)});const l=o&&o.customRenderer&&o.customRenderer.type?o.customRenderer:a.renderer;this.renderer=this.$iApi.geo.symbology.makeRenderer(l,this.fields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const c={supportsLimit:(a.currentVersion||1)>=10.1,serviceUrl:this.serviceUrl,oidField:this.oidField,batchSize:-1,attribs:"*",permanentFilter:this.getSqlFilter(dr$2.PERMANENT)};this.attribs.attLoader=new BG$1(this.$iApi,c)}else this.supportsFeatures=!1,this.supportsIdentify=!1}getAttributes(){return this.attribs.attLoader.getAttribs()}abortAttributeLoad(){this.attribs.attLoader.abortAttribLoad()}clearFeatureCache(){this.attribs.clearAll()}downloadedAttributes(){return this.isLoaded?this.attribs.attLoader.loadCount():0}attribLoadAborted(){return this.isLoaded?this.attribs.attLoader.isLoadAborted():!1}getFieldsToTrim(){return this.fields.filter(o=>o.trim).map(o=>o.name)}getTabularAttributes(){return this.$iApi.geo.attributes.generateTabularAttributes(this,this.attribs)}async getGraphic(o,s){let a={},l=new al$2;const c=this.$iApi.geo.map;let u=!1,d=!1,m=0;if(s.getAttribs||s.getStyle){const y=this.attribs.quickCache.getAttribs(o);if(y)a=y;else if(this.attribs.attLoader.isLoaded()||this.isFile){const _=await this.attribs.attLoader.getAttribs();a=_.features[_.oidIndex[o]]}else u=!0}if(s.getGeom){m=c.getScale();const y=this.attribs.quickCache.getGeom(o,m);y?l=y:d=!0}if(u||d){const y={oid:o,serviceUrl:this.serviceUrl,includeGeometry:d,attribs:this.fieldList,fieldsToTrim:this.getFieldsToTrim()};d&&(y.mapSR=c.getSR().wkid?.toString(),this.attribs.quickCache.isPoint||(y.maxOffset=c.esriView?.resolution));const _=await this.$iApi.geo.attributes.loadSingleFeature(y);d&&(this.attribs.quickCache.setGeom(o,_.geometry,m),l=_.geometry),(u||typeof this.attribs.quickCache.getAttribs(o)>"u")&&(this.attribs.quickCache.setAttribs(o,_.attributes),u&&(a=_.attributes))}const g=new Si$1(l,"",s.getAttribs?a:void 0);if(s.getStyle){const y=Ut$2(this.renderer.getGraphicSymbol(a));g.style=this.$iApi.geo.geom.styleEsriToRamp(y)}return g}async getIcon(o){if(!this.renderer)throw new Error("getIcon called before renderer is defined");const s=await this.getGraphic(o,{getAttribs:!0});return this.$iApi.geo.symbology.getGraphicIcon(s.attributes||{},this.renderer)}setSqlFilter(o,s){const a=this.filter.getSql(o);if(s===a)return;this.filter.setSql(o,s),this.$iApi.event.emit(Mt$2.FILTER_CHANGE,{uid:this.uid,filterKey:o});const l=`${this.uid}-${o}-${s}`;this._lastFilterUpdate=l,setTimeout(()=>{this._lastFilterUpdate===l&&this.applySqlFilter()},100)}applySqlFilter(o=[]){throw new Error(`attempted to apply sql filter ${o} to a layer not equipped for it. likely a new subclass of AttribLayer did not override applySqlFilter`)}getSqlFilter(o){return this.filter.getSql(o)}getCombinedSqlFilter(o){return this.filter.getCombinedSql(o)}async getFilterOIDs(o=[],s=void 0){const a=this.filter.getCombinedSql(o),l=!!s;if(!(a||l))return;s&&this.filter.setExtent(s);const c=this.filter.sqlActiveFilters(o);let u=this.filter.getCache(c,l);if(!u){const d={filterGeometry:s,filterSql:a,includeGeometry:!1,sourceSR:this.sourceSR};u=this.queryOIDs(d),this.filter.setCache(u,c,l)}return u}queryOIDs(o){this.isFile&&(console.error("a file layer called a server based query function"),console.trace());const s={url:this.serviceUrl,...o};return this.$iApi.geo.query.arcGisServerQueryIds(s)}async queryFeaturesDiscrete(o){const s=await this.queryOIDs(o),a={getGeom:!!o.includeGeometry,getAttribs:!0};return s.map(l=>({oid:l,graphic:this.getGraphic(l,a)}))}async queryFeatures(o){const s=await this.queryFeaturesDiscrete(o);return Promise.all(s.map(a=>a.graphic))}configDrawOrder(o,s){Array.isArray(o.drawOrder)&&o.drawOrder.length>0&&(s.orderBy=o.drawOrder.map(a=>{const l=a.ascending??!0?"ascending":"descending";return a.field?{field:a.field,order:l}:{valueExpression:a.arcade,order:l}}),this._drawOrder=o.drawOrder.slice())}},DG$1=class extends Mu$3{constructor(o,s){super(o,s),this.dataFormat=nr$2.ESRI_FEATURE,this.layerFormat=ui$1.GRAPHIC,this.hovertips=!1}_graphics=[];makeEsriLayerConfig(o){return super.makeEsriLayerConfig(o)}getGraphicCount(){return this._graphics.length}getLocalGraphic(o){return this._graphics.find(s=>s.id===o)}getEsriGraphic(o){return this.esriLayer?.graphics.find(s=>s.id===o)}get graphics(){return this._graphics.slice()}async addGraphic(o){if(!this.layerExists){this.noLayerErr();return}let s;o instanceof Array?s=o:s=[o];const a=s.filter(m=>this._graphics.findIndex(g=>g.id===m.id)===-1?(this._graphics.push(m),!0):(console.error(`Attempting to add graphic with id '${m.id}' that has already been added.`),!1)),l=this.$iApi.geo.map.getSR(),c=a.map(m=>this.$iApi.geo.proj.projectGeometry(l,m.geometry)),u=await Promise.all(c),d=a.map((m,g)=>{const y=new Si$1(u[g],m.id,m.attributes);return y.style=m.style,this.$iApi.geo.geom.graphicRampToEsri(y)});this.esriLayer.addMany(d)}removeGraphic(o){if(!this.layerExists){this.noLayerErr();return}if(typeof o>"u"){this.esriLayer.removeAll(),this._graphics=[];return}let s;Array.isArray(o)?s=o:s=[o],s.map(a=>typeof a=="string"?a:a.id).forEach(a=>{const l=this.esriLayer.graphics.findIndex(u=>u.id===a);l>-1&&this.esriLayer.graphics.removeAt(l);const c=this._graphics.findIndex(u=>u.id===a);c>-1&&this._graphics.splice(c,1)})}},GG$1=class extends DG$1{constructor(o,s){super(o,s),this.layerType=Ct$1.GRAPHIC}async onInitiate(){this.esriLayer=yn$2(await Pe.GraphicsLayer(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(o){return super.makeEsriLayerConfig(o)}onLoadActions(){const o=super.onLoadActions();return this.layerTree.name=this.name,this.updateDrawState($r$2.UP_TO_DATE),o}},Nu$3=class extends A4$1{esriJson;sourceGeoJson;tooltipField;constructor(o,s){super(o,s),this.supportsIdentify=!0,this.isFile=!0,this.dataFormat=nr$2.ESRI_FEATURE,this.layerFormat=ui$1.FEATURE,this.tooltipField="",this.layerIdx=0,o.identifyMode&&o.identifyMode!==Fn$1.NONE?this.identifyMode=o.identifyMode:this.identifyMode=Fn$1.HYBRID}async reload(){if(this.origRampConfig.caching!==!0&&!this.origRampConfig.url){console.error("Attempted to reload file layer from non server source without caching enabled.");return}await super.reload()}async onInitiate(){if(!this.sourceGeoJson)throw new Error("File Layer is missing source data.");const o={layerId:this.origRampConfig.id||"",targetSR:this.$iApi.geo.map.getSR(),colour:this.origRampConfig.colour,fieldMetadata:this.origRampConfig.fieldMetadata,latField:this.origRampConfig.latField||"",lonField:this.origRampConfig.longField||""};this.esriJson=await this.$iApi.geo.layer.files.geoJsonToEsriJson(this.sourceGeoJson,o),this.esriLayer=yn$2(await Pe.FeatureLayer(this.makeEsriLayerConfig(this.origRampConfig))),this.esriJson=void 0,this.origRampConfig.caching||delete this.origRampConfig.rawData,delete this.sourceGeoJson,await super.onInitiate()}makeEsriLayerConfig(o){const s=super.makeEsriLayerConfig(o),a="OBJECTID";return["source","objectIdField","id","fields","renderer","spatialReference","geometryType"].forEach(l=>{s[l]=this.esriJson[l]}),this.origRampConfig.nameField?s.displayField=this.$iApi.geo.attributes.fieldValidator(s.fields,this.origRampConfig.nameField)||a:s.displayField=a,s.outFields=["*"],delete s.url,this.configDrawOrder(o,s),s}onLoadActions(){const o=super.onLoadActions(),s=async()=>{this.esriLayer&&this.origRampConfig.customRenderer?.type&&(this.esriLayer.renderer=await Pe.RendererFromJson(this.config.customRenderer)),this.layerTree.name=this.name,this.extractLayerMetadata(),this.origRampConfig.tooltipField?this.tooltipField=this.$iApi.geo.attributes.fieldValidator(this.fields,this.origRampConfig.tooltipField)||this.nameField:this.tooltipField=this.nameField,this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.attribs.attLoader.updateFieldList(this.fieldList),this.featureCount=this.esriLayer?.source.length||0};return o.push(s()),o.push(this.viewDefProm.getPromise()),this.filter.getCombinedSql()&&Promise.all(o).then(()=>{this.applySqlFilter()}),o}runIdentify(o){if(!this.canIdentify())return[];const s=new xn$2,a=Vn$1({items:[],loading:s.getPromise(),loaded:!1,errored:!1,uid:this.uid,layerId:this.id,requestTime:Date.now()});let l=Promise.resolve(),c=Promise.resolve(),u=[],d=[];if(this.identifyMode===Fn$1.HYBRID||this.identifyMode===Fn$1.GEOMETRIC){const m={includeGeometry:!1};this.geomType!==qt$2.POLYGON&&o.geometry.type===qt$2.POINT?m.filterGeometry=this.$iApi.geo.query.makeClickBuffer(o.geometry,o.tolerance):m.filterGeometry=o.geometry,m.filterSql=this.getCombinedSqlFilter(),c=this.queryFeatures(m).then(g=>{u=g})}return o.hitTest&&(this.identifyMode===Fn$1.HYBRID||this.identifyMode===Fn$1.SYMBOLIC)&&(l=c.then(async()=>{const m=await o.hitTest;d=await Promise.all(m.filter(g=>g.layerId===this.id&&u.findIndex(y=>g.oid===y.attributes[this.oidField])===-1).map(g=>g.oid))})),Promise.all([l,c]).then(()=>{u.forEach(m=>{a.items.push(Kp$2.makeRawItem(Ql$2.ESRI,m.attributes))}),d.forEach(m=>{a.items.push(Kp$2.makeOidItem(m,this))}),a.loaded=!0,s.resolveMe()}).catch(()=>{a.errored=!0,s.resolveMe()}),[a]}extractLayerMetadata(){const o=this.esriLayer;if(!o)throw new Error("file layer attempted to extract data from esri layer, esri layer did not exist");this.supportsFeatures=!0,this.geomType=this.$iApi.geo.geom.clientGeomTypeToRampGeomType(o.geometryType),this.scaleSet.minScale=o.minScale||0,this.scaleSet.maxScale=o.maxScale||0,this.extent=this.extent??tn$2.fromESRI(o.fullExtent,this.id+"_extent");const s=yn$2(o.fields.slice());this.fields=s.map(l=>({name:l.name,alias:l.alias,type:l.type,length:l.length})),this.nameField=o.displayField,this.oidField=o.objectIdField,this.renderer=this.$iApi.geo.symbology.makeRenderer(o.renderer,this.fields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const a={sourceGraphics:o.source,oidField:this.oidField,attribs:"*",batchSize:-1,fieldsToTrim:[]};this.attribs.attLoader=new Byt(this.$iApi,a)}async getGraphic(o,s){let a;if(!s.getGeom&&this.attribs.attLoader.isLoaded()){const l=await this.attribs.attLoader.getAttribs();a=new Si$1(new al$2,"",l.features[l.oidIndex[o]])}else{const l={filterOIDs:[o],includeGeometry:!!s.getGeom},c=await this.queryFeatures(l);if(c.length===0)throw new Error(`Could not find object id ${o}`);c.length!==1&&console.warn("did not get a single result on a query for a specific object id"),a=c[0]}if(s.getStyle){const l=Ut$2(this.renderer.getGraphicSymbol(a.attributes));a.style=this.$iApi.geo.geom.styleEsriToRamp(l)}return a}async queryFeatures(o){const s={layer:this,...o};return this.$iApi.geo.query.geoJsonQuery(s)}async queryOIDs(o){const s={layer:this,...o};return(await this.$iApi.geo.query.geoJsonQuery(s)).map(a=>a.attributes?a.attributes[this.oidField]:-1)}applySqlFilter(o=[]){if(!this.esriView){this.noLayerErr();return}const s=this.filter.getCombinedSql(o);Pe.FeatureFilter({where:s}).then(a=>{Ut$2(this.esriView).filter=a})}};class Ayt extends Nu$3{constructor(o,s){super(o,s),this.layerType=Ct$1.GEOJSON}async onInitiate(){let o;const s=Date.now();if(this.origRampConfig.rawData)o=this.$iApi.geo.layer.files.rawDataJsonParser(this.origRampConfig.rawData,this.origRampConfig.caching);else if(this.origRampConfig.url)o=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("GeoJson layer config contains no raw data or url");s>this.lastCancel&&(this.sourceGeoJson=o,await super.onInitiate())}}class Iyt extends Nu$3{constructor(o,s){super(o,s),this.layerType=Ct$1.SHAPEFILE}async onInitiate(){const o=Date.now(),s=await this.$iApi.geo.layer.files.binaryInitHelper(this.origRampConfig);if(o>this.lastCancel){const a=await this.$iApi.geo.layer.files.shapefileToGeoJson(s);o>this.lastCancel&&(this.sourceGeoJson=a,await super.onInitiate())}}}class Myt extends Nu$3{constructor(o,s){super(o,s),this.layerType=Ct$1.CSV}async onInitiate(){if(!this.origRampConfig.latField||!this.origRampConfig.longField)throw new Error("csv file config missing lat or long field names");let o;const s=Date.now();if(this.origRampConfig.rawData&&typeof this.origRampConfig.rawData=="string")o=this.origRampConfig.rawData;else if(this.origRampConfig.url)o=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("Csv file config contains no raw data or url");if(s>this.lastCancel){const a=await this.$iApi.geo.layer.files.csvToGeoJson(o,{latfield:this.origRampConfig.latField,lonfield:this.origRampConfig.longField});s>this.lastCancel&&(this.sourceGeoJson=a,await super.onInitiate())}}}class Nyt extends Nu$3{constructor(o,s){super(o,s),this.layerType=Ct$1.GEOJSONZIPPED}async onInitiate(){const o=Date.now(),s=await this.$iApi.geo.layer.files.binaryInitHelper(this.origRampConfig);if(o>this.lastCancel){const a=await this.$iApi.geo.layer.files.unzipSingleFile(s);o>this.lastCancel&&(this.sourceGeoJson=JSON.parse(this.$iApi.geo.layer.files.arbToStr(a)),await super.onInitiate())}}}class Oyt extends Nu$3{constructor(o,s){super(o,s),this.layerType=Ct$1.FLATGEOBUF}async onInitiate(){const o=Date.now(),s=await this.$iApi.geo.layer.files.binaryInitHelper(this.origRampConfig);if(o>this.lastCancel){const a=await this.$iApi.geo.layer.files.fgbToGeoJson(s,this.expectedTime.fail+1e3);o>this.lastCancel&&(this.sourceGeoJson=a,await super.onInitiate())}}}class Cyt extends Nu$3{constructor(o,s){super(o,s),this.layerType=Ct$1.FLATGEOBUFZIPPED}async onInitiate(){const o=Date.now(),s=await this.$iApi.geo.layer.files.binaryInitHelper(this.origRampConfig);if(o>this.lastCancel){const a=await this.$iApi.geo.layer.files.unzipSingleFile(s);if(o>this.lastCancel){const l=await this.$iApi.geo.layer.files.fgbToGeoJson(a,this.expectedTime.fail+1e3);o>this.lastCancel&&(this.sourceGeoJson=l,await super.onInitiate())}}}}class Ryt extends A4$1{tooltipField;constructor(o,s){super(o,s),this.dataFormat=nr$2.ESRI_FEATURE,this.tooltipField="",this.supportsIdentify=!0,this.layerType=Ct$1.FEATURE,this.layerFormat=ui$1.FEATURE,o.identifyMode&&o.identifyMode!==Fn$1.NONE?this.identifyMode=o.identifyMode:this.identifyMode=Fn$1.HYBRID}async onInitiate(){yn$2(this.esriLayer=await Pe.FeatureLayer(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(o){const s=super.makeEsriLayerConfig(o);return(o.initialFilteredQuery||o.permanentFilteredQuery)&&(s.definitionExpression=this.filter.getCombinedSql()),this.configDrawOrder(o,s),s}onLoadActions(){const o=Date.now(),s=super.onLoadActions(),a=this.esriLayer.parsedUrl.path,l=this.$iApi.geo.shared.parseUrlIndex(a).index||0;this.layerIdx=l,this.serviceUrl=a;const c=async()=>{let d;if(this.esriLayer&&this.origRampConfig.customRenderer?.type){const m=await Pe.RendererFromJson(this.origRampConfig.customRenderer);this.esriLayer.renderer=m,d={customRenderer:m}}else d={};await this.loadLayerMetadata(d),o>this.lastCancel&&(this.layerTree.name=this.name,this.visibility=this.origRampConfig?.state?.visibility??this._serverVisibility??!0,this.nameField=this.origRampConfig.nameField||this.nameField||"",this.tooltipField=this.origRampConfig.tooltipField||this.nameField,this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.attribs.attLoader.updateFieldList(this.fieldList),this.attribs.attLoader.updateFieldsToTrim(this.getFieldsToTrim()))},u=this.$iApi.geo.layer.loadFeatureCount(this.serviceUrl,this.getSqlFilter(dr$2.PERMANENT)).then(d=>{o>this.lastCancel&&(this.featureCount=d)});return this.layerTree.layerIdx=l,s.push(u,c()),s}runIdentify(o){if(!this.canIdentify())return[];const s=new xn$2,a=Vn$1({items:[],loading:s.getPromise(),loaded:!1,errored:!1,uid:this.uid,layerId:this.id,requestTime:Date.now()});let l=Promise.resolve(),c=Promise.resolve(),u=[];if(this.identifyMode===Fn$1.HYBRID||this.identifyMode===Fn$1.GEOMETRIC){const d={includeGeometry:!1,sourceSR:this.sourceSR};this.geomType!==qt$2.POLYGON&&o.geometry.type===qt$2.POINT?d.filterGeometry=this.$iApi.geo.query.makeClickBuffer(o.geometry,o.tolerance):d.filterGeometry=o.geometry,d.filterSql=this.getCombinedSqlFilter(),c=this.queryOIDs(d).then(m=>{u=m})}return o.hitTest&&(this.identifyMode===Fn$1.HYBRID||this.identifyMode===Fn$1.SYMBOLIC)&&(l=c.then(async()=>{(await o.hitTest).filter(d=>d.layerId===this.id&&u.findIndex(m=>d.oid===m)===-1).forEach(d=>{u.push(d.oid)})})),Promise.all([l,c]).then(()=>{u.forEach(d=>{a.items.push(Kp$2.makeOidItem(d,this))}),a.loaded=!0,s.resolveMe()}).catch(()=>{a.errored=!0,s.resolveMe()}),[a]}applySqlFilter(o=[]){if(this.layerExists){const s=this.filter.getCombinedSql(o);this.esriLayer.definitionExpression=s}else this.noLayerErr()}getGraphicExtent(o){return new Promise((s,a)=>{if(!this.layerExists)this.noLayerErr(),a();else if(!["multipoint","polyline","polygon"].includes(this.esriLayer.geometryType))console.error(`Attempted to query extent for invalid geometry type ${this.esriLayer.geometryType}.`),a();else{const l=this.attribs.quickCache.getExtent(o);l?s(l):this.esriLayer.queryExtent({objectIds:[o],outSpatialReference:this.$iApi.geo.map.getSR().toESRI()}).then(c=>{const u=tn$2.fromESRI(c.extent);this.attribs.quickCache.setExtent(o,u),s(u)}).catch(()=>{console.error(`Extent querying failed for ${o}.`),a()})}})}}class kyt extends Mu$3{isDynamic;origState;constructor(o,s){super(o,s),this.supportsIdentify=!0,this.supportsSublayers=!0,this.layerType=Ct$1.MAPIMAGE,this.layerFormat=ui$1.MAPIMAGE,this.isDynamic=!1,this.hovertips=!1,this.layerTree.layerIdx=-1,this.identifyMode=Fn$1.GEOMETRIC}async onInitiate(){this.esriLayer=yn$2(await Pe.MapImageLayer(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(o){const s=super.makeEsriLayerConfig(o);return this.origState={visibility:s.visible,opacity:s.opacity},s.visible=!1,o.imageFormat&&(s.imageFormat=o.imageFormat),s}onLoadActions(){const o=super.onLoadActions();if(!this.layerExists)return this.noLayerErr(),o;const s=Date.now();if(this.layerTree.name=this.name,!this.esriLayer.capabilities.exportMap)throw this.$iApi.notify.show(oi$1.WARNING,this.$iApi.$i18n.t("layer.noexportmap",{name:this.name||this.id})),new Error("Service does not support Map Image Layer, Map Export is not enabled");this.isDynamic=this.esriLayer.capabilities.exportMap.supportsDynamicLayers,this.extent=this.extent??tn$2.fromESRI(this.esriLayer.fullExtent,this.id+"_extent");const a=m=>{const g=this.esriLayer?.allSublayers.find(y=>y.id===m);if(!g)throw new Error("attempt to find map image sublayer failed");return g},l={};this.origRampConfig.sublayers.forEach(m=>{l[m.index||0]=m});const c=[],u=(m,g)=>{const y=m.id,_=l[y];if(m.sublayers&&m.sublayers.length>0){const E=(_?_.name:"")||m.title||"",w=new Vg$2(y,"",E,!1);g.findChildByIdx(y)||g.children.push(w),m.sublayers.reverse().forEach(T=>{u(T,w)})}else{this._sublayers[y]||(this._sublayers[y]=new Lyt({id:`${this.id}-${y}`,index:y,layerType:Ct$1.SUBLAYER,name:_?.name,state:_?.state??{opacity:this.opacity,visibility:this.visibility,hovertips:this.hovertips,identify:this.identify},extent:_?.extent,controls:_?.controls,disabledControls:_?.disabledControls,initialFilteredQuery:_?.initialFilteredQuery,permanentFilteredQuery:_?.permanentFilteredQuery,labels:_?.labels},this.$iApi,this));const E=this._sublayers[y];if(E.isRemoved)return;if(E.name=_?.name||m.title||"",c.push(E),!g.children.map(w=>w.layerIdx).includes(y)){const w=new Vg$2(y,E.uid,E.name,!1);g.children.push(w)}E.esriWatches.push(m.watch("visible",()=>{this.$iApi.event.emit(Mt$2.LAYER_VISIBILITYCHANGE,{visibility:E.visibility,layer:E}),E.parentLayer?.checkVisibility()}),m.watch("opacity",w=>{this.$iApi.event.emit(Mt$2.LAYER_OPACITYCHANGE,{opacity:w,layer:E})}))}};this.origRampConfig.sublayers.forEach(m=>{if(!m.cosmetic){const g=a(m.index||0);u(g,this.layerTree)}});const d=c.map(async m=>{const g=a(m.layerIdx),y=l[m.layerIdx];if(m.serviceUrl=g.url,m.fetchEsriSublayer(this),await m.initiate(),sthis.lastCancel&&(m.featureCount=w)}});return o.push(...d),this.esriLayer.allSublayers.forEach(m=>{!m.sublayers&&!c.find(g=>g.layerIdx===m.id)?(m.visible=!1,m.opacity=0):m.sublayers&&(m.visible=!0)}),this.visibility=this.origState.visibility??!0,o}updateLayerState(o,s=!1){super.updateLayerState(o,s),this.sublayers.forEach(a=>a.updateLayerState(o,s))}updateDrawState(o){super.updateDrawState(o),this.sublayers.forEach(s=>s.updateDrawState(o))}runIdentify(o){if(!this.canIdentify())return[];o.sublayerIds&&(o.sublayerIds=o.sublayerIds.map(l=>typeof l=="number"?this.layerTree?.findChildByIdx(l)?.uid:l));const s=o.sublayerIds?this._sublayers.filter(l=>o.sublayerIds?.includes(l.uid)):this._sublayers.filter(l=>l.canIdentify());if(s.length===0)return[];let a;return o.geometry.type===qt$2.POINT&&(a=this.$iApi.geo.query.makeClickBuffer(o.geometry,o.tolerance)),s.map(l=>{const c=new xn$2,u={},d=Vn$1({items:[],loading:c.getPromise(),loaded:!1,errored:!1,uid:l.uid,layerId:l.id,requestTime:Date.now()});return l.geomType!==qt$2.POLYGON&&a?u.filterGeometry=a:u.filterGeometry=o.geometry,u.filterSql=l.getCombinedSqlFilter(),u.sourceSR=l.sourceSR,l.queryOIDs(u).then(m=>{m.forEach(g=>{d.items.push(Kp$2.makeOidItem(g,l))}),d.loaded=!0,c.resolveMe()}).catch(()=>{d.errored=!0,c.resolveMe()}),d})}}class Lyt extends A4$1{tooltipField;constructor(o,s,a){if(super(o,s),this.layerType=Ct$1.SUBLAYER,this.layerFormat=ui$1.MAPIMAGE,this.isSublayer=!0,this.layerIdx=o.index,this.parentLayer=a,this.dataFormat=nr$2.ESRI_FEATURE,this.supportsFeatures=!0,this.tooltipField="",this.hovertips=!1,this.url=this.parentLayer?.url,this.canReload=!!(this.url||this.origRampConfig.caching),!a.esriLayer)throw new Error("Map Image Layer with no internal esri layer encountered in sublayer creation");this.fetchEsriSublayer(a),(o.initialFilteredQuery||o.permanentFilteredQuery)&&this.applySqlFilter()}fetchEsriSublayer(o){if(!o.esriLayer){console.error("Attempted to fetch the ESRI sublayer when parent has no ESRI layer");return}this.esriSubLayer=yn$2(o.esriLayer.allSublayers.find(s=>s.id===this.layerIdx))}onLoadActions(){return this.layerTree=this.parentLayer.getLayerTree().findChildByUid(this.uid),this.layerTree.name=this.name,this.layerTree.layerIdx=this.layerIdx,this.identify=this.config.state.identify!=null?this.config.state.identify:this.supportsIdentify,[]}async onInitiate(){this.initiationState=Ye$2.INITIATED;const o=this.labelVizOverride();o!==void 0&&(this.labelVisibility=o)}async reload(){if(!this.$iApi.geo.map.esriMap){console.error("Attempted layer reload when no map exists");return}this.parentLayer?.reload()}cancelLoad(){this.parentLayer?.cancelLoad()}get layerExists(){return!!(this.parentLayer?.layerExists&&this.esriSubLayer&&this.initiationState===Ye$2.INITIATED)}get visibility(){return this.layerExists?this.esriSubLayer.visible:!1}set visibility(o){this.layerExists?this.esriSubLayer.visible=o:this.noLayerErr()}get opacity(){return this.layerExists?this.esriSubLayer.opacity:0}set opacity(o){if(!this.layerExists){this.noLayerErr();return}this.parentLayer.isDynamic||console.warn(`Opacity of a Map Image Sublayer was set. The service does not support sublayer opacity. LayerId ${this.id}`),this.esriSubLayer.opacity=o}get mouseTolerance(){return this.layerExists?this.parentLayer.mouseTolerance:0}set mouseTolerance(o){this.layerExists?this.parentLayer.mouseTolerance=o:this.noLayerErr()}get touchTolerance(){return this.layerExists?this.parentLayer.touchTolerance:0}set touchTolerance(o){this.layerExists?this.parentLayer.touchTolerance=o:this.noLayerErr()}applySqlFilter(o=[]){if(this.parentLayer?.layerExists&&this.esriSubLayer)if(this.supportsFeatures){const s=this.filter.getCombinedSql(o);this.esriSubLayer.definitionExpression=s}else console.error("Attempted to apply an SQL filter to a sublayer that does not support it (likely Raster datatype)");else this.noLayerErr()}getSR(){return this.parentLayer?.esriLayer?Bt$2.fromESRI(this._parentLayer?.esriLayer?.spatialReference):(this.noLayerErr(),Bt$2.latLongSR())}updateFieldList(){this.attribs.attLoader.updateFieldList(this.fieldList)}updateFieldsToTrim(){this.attribs.attLoader.updateFieldsToTrim(this.getFieldsToTrim())}get labelVisibility(){return this.layerExists?this.esriSubLayer.labelsVisible:!1}set labelVisibility(o){this.layerExists?this.esriSubLayer.labelsVisible=o:this.noLayerErr()}labelVizOverride(){let o=this.origRampConfig.labels?.visible;if(o!==void 0||(o=this.$iApi.geo.map.labelsDefault?.visible,o!==void 0))return o}}class Pyt extends Mu$3{constructor(o,s){super(o,s),this.supportsIdentify=!1,this.layerType=Ct$1.OSM,this.layerFormat=ui$1.OSM,this.dataFormat=nr$2.OSM_TILE,this.supportsFeatures=!1}async onInitiate(){this.esriLayer=yn$2(await Pe.OpenStreetMapLayer(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(o){return super.makeEsriLayerConfig(o)}onLoadActions(){const o=super.onLoadActions();this.layerTree.name=this.name;const s=this.$iApi.geo.symbology.generatePlaceholderSymbology("O","#03fc4e"),a={uid:this.$iApi.geo.shared.generateUUID(),label:"OpenStreetMap",svgcode:s.svgcode,esriStandard:!0,drawPromise:Promise.resolve()};return this.legend.push(a),o}}class Dyt extends Mu$3{constructor(o,s){super(o,s),this.supportsIdentify=!1,this.layerType=Ct$1.IMAGERY,this.layerFormat=ui$1.IMAGERY,this.dataFormat=nr$2.ESRI_RASTER}async onInitiate(){this.esriLayer=yn$2(await Pe.ImageryLayer(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(o){return super.makeEsriLayerConfig(o)}onLoadActions(){const o=super.onLoadActions();this.layerTree.name=this.name;const s=Date.now(),a=this.$iApi.geo.symbology.mapServerToLocalLegend(this.origRampConfig.url).then(l=>{s>this.lastCancel&&(this.legend=l)});return o.push(a),o}}let FG$1=class extends Mu$3{constructor(o,s){super(o,s),this.supportsIdentify=!1,this.layerType=Ct$1.TILE,this.layerFormat=ui$1.TILE,this.dataFormat=nr$2.ESRI_TILE}async onInitiate(){this.esriLayer=yn$2(await Pe.TileLayer(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(o){return super.makeEsriLayerConfig(o)}onLoadActions(){const o=super.onLoadActions(),s=Date.now();this.layerTree.name=this.name;const a=this.$iApi.geo.symbology.mapServerToLocalLegend(this.origRampConfig.url).then(l=>{s>this.lastCancel&&(this.legend=l)});return o.push(a),o.push(this.checkProj()),o}checkProj(){const o=this.getSR(),s=this.$iApi.geo.map.getSR().isEqual(o);if(this.layerState===sn$2.LOADED&&!s)this.$iApi.notify.show(oi$1.WARNING,this.$iApi.$i18n.t("layer.mismatch",{name:this.name||this.id})),this.onError();else if(this.layerState===sn$2.ERROR&&s)this.reload();else if(this.layerState!==sn$2.ERROR&&!s)return this.$iApi.notify.show(oi$1.WARNING,this.$iApi.$i18n.t("layer.mismatch",{name:this.name||this.id})),Promise.reject();return Promise.resolve()}};class Gyt extends Mu$3{sublayerNames;mimeType;constructor(o,s){super(o,s),this.supportsIdentify=!0,this.layerType=Ct$1.WMS,this.layerFormat=ui$1.WMS,this.mimeType=o.featureInfoMimeType||"",this.sublayerNames=[],this.dataFormat=nr$2.OGC_RASTER,this.identifyMode=Fn$1.GEOMETRIC}async onInitiate(){this.esriLayer=yn$2(await Pe.WMSLayer(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(o){const s=super.makeEsriLayerConfig(o),a=o.sublayers;this.sublayerNames=a.map(c=>c.id||"error_no_wms_id");const l=a.map(c=>c.currentStyle).join();return s.customParameters={styles:l},o.url.indexOf("/geomet")!==-1&&(s.customParameters.layers=a[0].id),s}onLoadActions(){const o=super.onLoadActions();this.layerTree.name=this.name;const s=a=>{let l=!1;return a.forEach(c=>{this.sublayerNames.indexOf(c.name)>-1||c.sublayers&&c.sublayers.length>0&&s(c.sublayers)?l=!0:c.visible=!1}),l};return this.layerExists?s(this.esriLayer.sublayers):this.noLayerErr(),this.loadSymbology(),o}canIdentify(){return super.canIdentify()}runIdentify(o){if(o.geometry.type!==qt$2.POINT)throw new Error("a point must be used for WMS Identify");if(!this.canIdentify())return[];const s=new xn$2,a=Vn$1({items:[],loading:s.getPromise(),loaded:!1,errored:!1,uid:this.uid,layerId:this.id,requestTime:Date.now()});return this.getFeatureInfo(this.sublayerNames,o.geometry,this.mimeType).then(l=>{if(l){let c=!0,u;typeof l!="string"?u=Ql$2.JSON:l.indexOf("Search returned no results")===-1&&l!==""?u=Ql$2.TEXT:(c=!1,u=Ql$2.UNKNOWN),c&&a.items.push(Kp$2.makeRawItem(u,l))}a.loaded=!0,s.resolveMe()}).catch(()=>{a.errored=!0,s.resolveMe()}),[a]}setCustomParameter(o,s,a=!0){this.layerExists?(this.esriLayer.customLayerParameters||(this.esriLayer.customLayerParameters={}),this.esriLayer.customLayerParameters[o]=s,a&&this.esriLayer.refresh()):this.noLayerErr()}getFeatureInfo(o,s,a){const l=this.$iApi.geo.map,c=this.esriLayer;if(!l.esriView)throw new Error("WMS get feature, no map view exists. Cannot derive click coords");if(!c)throw this.noLayerErr(),new Error("wms get feature failed, no layer");let u,d;const m=l.getExtent(),g=c.spatialReferences,y=o.join(","),_=l.esriView.toScreen(s.toESRI()),E=Math.floor(_.x),w=Math.floor(_.y),T={"application/json":"json","text/html":"text","text/plain":"text"}[a]||"text",k=l.getSR();k.wkid?u=k.wkid:(u=4326,console.error("Map is likely in a WKT projection. WMS Identify request will likely fail.")),g&&g.length>1?g.indexOf(u)===-1&&(k.latestWkid&&g.indexOf(k.latestWkid)>-1?u=k.latestWkid:console.error("WMS service does not support the maps projection. Identify request will likely fail.")):console.error("No supported wkid/epsg code found for WMS service. Identify request will likely fail."),c.version==="1.3"||c.version==="1.3.0"?(d={CRS:"EPSG:"+u,I:E,J:w,STYLES:"",FORMAT:c.imageFormat},this.$iApi.geo.layer.ogc.reversedAxisWKIDs().indexOf(u)>-1&&(d.BBOX=`${m.ymin},${m.xmin},${m.ymax},${m.xmax}`)):d={SRS:"EPSG:"+u,X:E,Y:w},Object.prototype.hasOwnProperty.call(d,"BBOX")||(d.BBOX=`${m.xmin},${m.ymin},${m.xmax},${m.ymax}`);const O={SERVICE:"WMS",REQUEST:"GetFeatureInfo",VERSION:c.version,WIDTH:l.getPixelWidth(),HEIGHT:l.getPixelHeight(),QUERY_LAYERS:y,LAYERS:y,INFO_FORMAT:a},R=c.customLayerParameters;return R&&Object.keys(R).forEach(M=>{M.toLowerCase()!=="styles"&&(O[M]=R[M])}),Object.keys(O).forEach(M=>d[M]=O[M]),fn$2(c.url.split("?")[0],{query:d,responseType:T})}getLegendUrls(o){if(!this.layerExists)return this.noLayerErr(),[];const s=new Map;this.esriLayer.allSublayers.forEach(l=>{l.visible&&(l.legendUrl&&this.origRampConfig.sublayers?.forEach(c=>{if(c.id&&c.currentStyle&&c.id===l.name){const u=new Rf$1(l.legendUrl);"STYLE"in u.queryMap&&u.queryMap.STYLE!==c.currentStyle&&(l.legendUrl=u.updateQuery({STYLE:c.currentStyle}))}}),s.set(l.name,l.legendUrl))});const a=o.map(l=>l.styleLegends&&l.currentStyle?l.styleLegends.find(c=>c.name===l.currentStyle).url:void 0);return a.forEach((l,c)=>{l||(a[c]=s.get(o[c].id))}),a}getWMSLayerTitle(o){if(!this.esriLayer)return"";let s;return this.esriLayer.allSublayers.some(a=>{if(a.name===o)return s=a.title,!0}),s||""}loadSymbology(){const o=Date.now(),s=this.config.sublayers,a=this.getLegendUrls(s.map(l=>({id:l.id,styleLegends:l.styleLegends,currentStyle:l.currentStyle}))).map((l,c)=>{const u=s[c].name||this.getWMSLayerTitle(s[c].id)||s[c].id,d={uid:this.$iApi.geo.shared.generateUUID(),label:u,svgcode:"",esriStandard:!1,drawPromise:this.$iApi.geo.symbology.generateWMSSymbology(l).then(m=>{o>this.lastCancel&&(d.svgcode=m.svgcode,d.imgHeight=m.imgHeight,d.imgWidth=m.imgWidth)})};return d});this.legend=a}}class Fyt extends Nu$3{constructor(o,s){super(o,s),this.layerType=Ct$1.WFS}async onInitiate(){const o=Date.now(),s=new Rf$1(this.config.url),{offset:a,limit:l}=s.queryMap,c=await this.$iApi.geo.layer.ogc.loadWfsData(this.config.url,-1,parseInt(a)||0,parseInt(l)||1e3,void 0,this.config.xyInAttribs);o>this.lastCancel&&(this.sourceGeoJson=c,await super.onInitiate())}}let jG$1=class extends PG$1{sourceJson;attribs;_visibility;constructor(o,s){super(o,s),this.dataFormat=nr$2.ESRI_FEATURE,this.layerFormat=ui$1.NOLAYER,this.drawState=$r$2.NOT_VISUAL,this.attribs=new UG$1,this.supportsFeatures=!0,this.mapLayer=!1,this.isFile=!1,this._visibility=o.state?.visibility??!0,this.expectedTime.draw=0}async onInitiate(){if(this.sourceJson){const o=this.sourceJson;if(o.data.length===0||o.fields.length===0)throw new Error("Data layer with no columns or now rows.");const s=o.fields.slice(),a=o.data[0].slice(),l=/ /gi;this.fields=s.map((u,d)=>{let m="",g=u;u.indexOf(" ")>-1&&(m=u,g=u.trim().replace(l,"-"),o.fields[d]=g);const y=this.$iApi.geo.layer.files.inferType(a[d]);return{name:g,alias:m,type:y,length:y===Gs$2.STRING?256:void 0}}),this.oidField="rampOID",this.fields.push({name:this.oidField,type:Gs$2.OID}),o.fields.push(this.oidField),o.data.forEach((u,d)=>u.push(d+1)),this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.fieldList="*";const c={batchSize:-1,sourceDataJson:o,oidField:this.oidField,attribs:"*",fieldsToTrim:this.getFieldsToTrim()};this.attribs.attLoader=new Vyt(this.$iApi,c),await this.attribs.attLoader.getAttribs(),this.featureCount=o.data.length,this.origRampConfig.nameField?this.nameField=this.$iApi.geo.attributes.fieldValidator(this.fields,this.origRampConfig.nameField)||this.oidField:this.nameField=this.oidField,this.sourceJson=void 0,this.origRampConfig.caching||delete this.origRampConfig.rawData}else throw new Error("Attempted to initiate file based data layer, sourceJson is missing")}async terminate(){await super.terminate()}async reload(){this.$iApi.event.emit(Mt$2.LAYER_RELOAD_START,this),await this.terminate(),await this.initiate(),this.layerState!==sn$2.ERROR&&this.onLoad(),setTimeout(()=>{this.$iApi.event.emit(Mt$2.LAYER_RELOAD_END,this)},300)}onLoadActions(){const o=super.onLoadActions();return this.legend=[{uid:this.$iApi.geo.shared.generateUUID(),label:"",svgcode:"",esriStandard:!0,visibility:!0,lastVisbility:!0,drawPromise:this.getIcon(0).then(s=>{this.legend[0].svgcode=s})}],o}getAttributes(){return this.attribs.attLoader.getAttribs()}getTabularAttributes(){return this.$iApi.geo.attributes.generateTabularAttributes(this,this.attribs)}async getGraphic(o,s){let a={};if(this.attribs.attLoader.isLoaded()){const l=await this.attribs.attLoader.getAttribs();a=l.features[l.oidIndex[o]]}else throw new Error("Non ESRI data layer did not have attributes populated.");return new Si$1(new al$2,"",a)}async getIcon(o){return' D '}async getFilterOIDs(o=[],s=void 0){}abortAttributeLoad(){}attribLoadAborted(){return!1}clearFeatureCache(){}downloadedAttributes(){return this.featureCount}get layerExists(){return this.isLoaded}get visibility(){return this._visibility}set visibility(o){this._visibility!==o&&(this._visibility=o,this.$iApi.event.emit(Mt$2.LAYER_VISIBILITYCHANGE,{visibility:o,layer:this}))}};class jyt extends jG$1{constructor(o,s){super(o,s),this.layerType=Ct$1.DATAJSON}async onInitiate(){const o=Date.now();let s;if(this.origRampConfig.rawData)s=this.$iApi.geo.layer.files.rawDataJsonParser(this.origRampConfig.rawData,this.origRampConfig.caching);else if(this.origRampConfig.url)s=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("Json Data layer config contains no raw data or url");o>this.lastCancel&&(this.sourceJson=s,await super.onInitiate())}}class Uyt extends jG$1{filter;serviceUrl;constructor(o,s){super(o,s),this.layerType=Ct$1.DATATABLE,this.serviceUrl=o.url,this.filter=new NR$2(o.permanentFilteredQuery||"",o.initialFilteredQuery||"")}async onInitiate(){}onLoadActions(){const o=super.onLoadActions(),s=Date.now(),a=this.$iApi.geo.shared.parseUrlIndex(this.serviceUrl).index||0,l=this.$iApi.geo.layer.loadLayerMetadata(this.serviceUrl).then(u=>{if(s=10.1,serviceUrl:this.serviceUrl,oidField:this.oidField,batchSize:-1,attribs:this.fieldList,permanentFilter:this.getSqlFilter(dr$2.PERMANENT),fieldsToTrim:this.getFieldsToTrim()};this.attribs.attLoader=new BG$1(this.$iApi,d),this.attribs.quickCache=new VG$1(this.geomType)}),c=this.$iApi.geo.layer.loadFeatureCount(this.serviceUrl,this.getSqlFilter(dr$2.PERMANENT)).then(u=>{s>this.lastCancel&&(this.featureCount=u)});return this.layerTree.layerIdx=a,o.push(l,c),o}async getGraphic(o,s){let a={};const l=this.attribs.quickCache.getAttribs(o);if(l)a=l;else if(this.attribs.attLoader.isLoaded()){const c=await this.attribs.attLoader.getAttribs();a=c.features[c.oidIndex[o]]}else{const c={oid:o,serviceUrl:this.serviceUrl,includeGeometry:!1,attribs:this.fieldList},u=await this.$iApi.geo.attributes.loadSingleFeature(c);this.attribs.quickCache.setAttribs(o,u.attributes),a=u.attributes}return new Si$1(new al$2,"",a)}abortAttributeLoad(){this.attribs.attLoader.abortAttribLoad()}clearFeatureCache(){this.attribs.clearAll()}downloadedAttributes(){return this.isLoaded?this.attribs.attLoader.loadCount():0}attribLoadAborted(){return this.isLoaded?this.attribs.attLoader.isLoadAborted():!1}setSqlFilter(o,s){const a=this.filter.getSql(o);s!==a&&(this.filter.setSql(o,s),this.$iApi.event.emit(Mt$2.FILTER_CHANGE,{uid:this.uid,filterKey:o}))}getSqlFilter(o){return this.filter.getSql(o)}getCombinedSqlFilter(o){return this.filter.getCombinedSql(o)}async getFilterOIDs(o=[],s=void 0){const a=this.filter.getCombinedSql(o);if(!a)return;const l=this.filter.sqlActiveFilters(o);let c=this.filter.getCache(l,!1);if(!c){const u={filterSql:a,includeGeometry:!1};c=this.queryOIDs(u),this.filter.setCache(c,l,!1)}return c}queryOIDs(o){const s={url:this.serviceUrl,...o};return this.$iApi.geo.query.arcGisServerQueryIds(s)}async queryFeaturesDiscrete(o){const s=await this.queryOIDs(o),a={getAttribs:!0};return s.map(l=>({oid:l,graphic:this.getGraphic(l,a)}))}async queryFeatures(o){const s=await this.queryFeaturesDiscrete(o);return Promise.all(s.map(a=>a.graphic))}}class $yt extends Tn$2{oidIndexer(o,s){o.features.forEach((a,l)=>{o.oidIndex[a[s]]=l})}async arcGisBatchLoad(o,s){if(s.loadAbortFlag)return[];const a=o.permanentFilter?` AND ${o.permanentFilter}`:"",l={query:{where:`${o.oidField}>${o.maxId}${a}`,outFields:o.attribs,orderByFields:o.oidField,returnGeometry:"false",f:"json"}},[c,u]=await Wl$2(fn$2(o.serviceUrl+"/query",l));if(!u)return console.error(`ArcGIS batch load error: ${o.serviceUrl}`,c),Promise.reject(new Error(`ArcGIS batch load error: ${o.serviceUrl}`));if(!u.data||!u.data.features)return console.error(`ArcGIS batch load gave no data/features: ${o.serviceUrl}`),Promise.reject(new Error(`ArcGIS batch load gave no data/features: ${o.serviceUrl}`));let d=u.data.features;const m=d.length;if(m>0){s.loadedCount+=m;let g;if(o.supportsLimit?g=u.data.exceededTransferLimit:(o.batchSize===-1&&(o.batchSize=m),g=m>=o.batchSize),d=this.trimFeatureSetAttributes(d,o.fieldsToTrim??[]),g){o.maxId=d[m-1].attributes[o.oidField];const y=await this.arcGisBatchLoad(o,s);return s.loadAbortFlag?[]:d.concat(y)}else return s.loadAbortFlag?[]:d}else return[]}async loadArcGisServerAttributes(o,s){o.maxId=-1,o.batchSize=-1;const a={features:(await this.arcGisBatchLoad(o,s)).map(l=>l.attributes),oidIndex:{}};return this.oidIndexer(a,o.oidField),s.loadIsDone=!0,a}async loadGraphicsAttributes(o,s){if(!o.sourceGraphics)throw new Error("No .sourceGraphics provided to file layer attribute loader");const a={features:o.sourceGraphics.map(l=>Ut$2(l).attributes).toArray(),oidIndex:{}};return this.oidIndexer(a,o.oidField),s.loadIsDone=!0,s.loadedCount=a.features.length,a}async loadCompactJsonAttributes(o,s){if(!o.sourceDataJson)throw new Error("No .sourceDataJson provided to file data-layer attribute loader");const a=o.sourceDataJson.fields,l=o.fieldsToTrim??[],c={features:o.sourceDataJson.data.map(u=>{const d={};return u.forEach((m,g)=>{d[a[g]]=typeof m=="string"&&l.includes(a[g])?m.trim():m}),d}),oidIndex:{}};return this.oidIndexer(c,o.oidField),s.loadIsDone=!0,s.loadedCount=c.features.length,o.sourceDataJson=void 0,c}async loadSingleFeature(o){const s={query:{f:"json",objectIds:o.oid,returnGeometry:o.includeGeometry,outFields:o.attribs}};typeof o.maxOffset<"u"&&(s.query.maxAllowableOffset=o.maxOffset),typeof o.mapSR<"u"&&(s.query.outSR=o.mapSR),typeof o.geometryPrecision<"u"&&o.geometryPrecision>=0&&(s.query.geometryPrecision=o.geometryPrecision);const[a,l]=await Wl$2(fn$2(o.serviceUrl+"/query",s));if(!l)return console.error(`ArcGIS single feature load error: ${o.serviceUrl}`,a),Promise.reject(new Error(`ArcGIS single feature load error: ${o.serviceUrl}`));if(!l.data||!l.data.features)return console.error(`Could not locate feature ${o.oid} for layer ${o.serviceUrl}`),Promise.reject(new Error(`Could not locate feature ${o.oid} for layer ${o.serviceUrl}`));const c=l.data.features;if(c.length>0){let u,d=this.trimFeatureSetAttributes([c[0]],o.fieldsToTrim??[])[0];if(o.includeGeometry){d.geometry.spatialReference=l.data.spatialReference;const m=Ly$2(d.geometry);u=this.$iApi.geo.geom.geomEsriToRamp(m)}else u=new al$2;return new Si$1(u,"",d.attributes)}return Promise.reject(new Error(`Could not locate feature ${o.oid} for layer ${o.serviceUrl}`))}trimFeatureSetAttributes(o,s){return s.forEach(a=>{o.forEach(l=>{typeof l.attributes[a]=="string"&&(l.attributes[a]=l.attributes[a].trim())})}),o}orderFields(o,s){const a=(c,u)=>c.findIndex(d=>d.name===u),l=(c,u)=>{const d=a(s,c.name),m=a(s,u.name);return d===-1&&m===-1?a(o,c.name)-a(o,u.name):d===-1?1:m===-1?-1:d-m};return o.slice().sort(l)}applyFieldMetadata(o,s=void 0){if(!s||!s.fieldInfo){o.fieldList="*";return}let a=s.fieldInfo.filter(l=>l.trim).map(l=>l.name);if(o.fields.forEach(l=>{a.includes(l.name)&&(l.trim=!0)}),s?.enforceOrder&&s?.fieldInfo&&s?.fieldInfo.length>0&&(o.fields=this.orderFields(o.fields,s.fieldInfo),o.fieldList=s.fieldInfo.map(l=>l.name).join(",")),s.exclusiveFields){s.fieldInfo.find(c=>c.name===o.oidField)||s.fieldInfo.push({name:o.oidField}),o.fieldList=s.fieldInfo.map(c=>c.name).join(",");const l=s.fieldInfo;o.fields=o.fields.filter(c=>l.find(u=>u.name===c.name))}else o.fieldList="*";s.fieldInfo.forEach(l=>{if(l.alias){const c=o.fields.find(u=>u.name===l.name);c&&(c.alias=l.alias)}})}fieldValidator(o,s){if(o.findIndex(a=>a.name===s)===-1){const a=o.find(l=>l.alias===s);return a?a.name:(console.warn(`Cannot find name field in layer field list: ${s}`),"")}else return s}async generateTabularAttributes(o,s){return s.attLoader.tabularAttributesCache||(s.attLoader.tabularAttributesCache=this.$iApi.geo.attributes.generateTabularAttributesWorker(o,s)),s.attLoader.tabularAttributesCache}async generateTabularAttributesWorker(o,s){if(o.dataFormat===nr$2.ESRI_RASTER)throw new Error("Attempting to get attributes on a raster layer.");const a=await s.attLoader.getAttribs();if(!a.features||a.features.length===0)return{columns:[],rows:[],fields:[],oidField:""};const l=o.fields.filter(u=>Object.prototype.hasOwnProperty.call(a.features[0],Ut$2(u).name)).map(u=>({data:Ut$2(u).name,title:Ut$2(u).alias||Ut$2(u).name})),c=a.features.map(u=>{const d=EE$2({},u);return d.rvInteractive="",d.rvSymbol=o.getIcon(u[o.oidField]),d.rvUid=o.uid,d});return l.forEach(u=>{if(u.data.slice(-2)==="()"){const d=function(){return this[u.data]},m=u.data.slice(0,-2);c.forEach(g=>{g[m]=d})}}),{columns:l,rows:c,fields:o.fields,oidField:o.oidField}}}let UG$1=class{_attribLoader;_quickCache;get attLoader(){if(this._attribLoader)return this._attribLoader;throw console.trace(),new Error("Attempted to load attributes prior to layer being loaded.")}set attLoader(o){this._attribLoader=o}get quickCache(){if(this._quickCache)return this._quickCache;throw console.trace(),new Error("Attempted to access attribute cache prior to layer being loaded.")}set quickCache(o){this._quickCache=o}clearAll(){this._attribLoader&&this._attribLoader.destroyAttribs(),this._quickCache&&this._quickCache.clearAll()}},$G$1=class{loadedCount;loadAbortFlag;loadIsDone;constructor(){this.loadedCount=0,this.loadAbortFlag=!1,this.loadIsDone=!1}},I4$1=class extends Tn$2{aac;loadPromise;details;tabularAttributesCache;constructor(o,s){super(o),this.aac=new $G$1,this.details=s}updateFieldList(o){this.details.attribs=o}updateFieldsToTrim(o){this.details.fieldsToTrim=o}getAttribs(){return this.loadPromise||(this.aac=new $G$1,this.loadPromise=this.loadPromiseGenerator()),this.loadPromise}abortAttribLoad(){this.aac.loadAbortFlag=!0}destroyAttribs(){this.loadPromise=void 0,this.tabularAttributesCache=void 0,this.aac.loadIsDone=!1,this.aac.loadedCount=0}loadCount(){return this.aac.loadedCount}isLoaded(){return this.aac.loadIsDone}isLoadAborted(){return this.aac.loadAbortFlag}loadPromiseGenerator(){return Promise.reject(new Error("Subclass of AttributeLoaderBase did not implement loadPromiseGenerator"))}},BG$1=class extends I4$1{constructor(o,s){super(o,s)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadArcGisServerAttributes(this.details,this.aac)}};class Byt extends I4$1{constructor(o,s){super(o,s)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadGraphicsAttributes(this.details,this.aac)}}class Vyt extends I4$1{constructor(o,s){super(o,s)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadCompactJsonAttributes(this.details,this.aac)}}let VG$1=class{attribs;geoms;extents;isPoint;constructor(o){this.attribs={},this.geoms={},this.extents={},this.isPoint=o===qt$2.POINT||o===qt$2.MULTIPOINT}getScaleStore(o){return this.geoms[o]||(this.geoms[o]={}),this.geoms[o]}getGeomStore(o=void 0){if(this.isPoint)return this.geoms;if(typeof o>"u")throw new Error("Attempted to access geometry store for non-point layer without providing a map scale");return this.getScaleStore(o)}getAttribs(o){return this.attribs[o]}setAttribs(o,s){this.attribs[o]=s}getGeom(o,s=void 0){return this.getGeomStore(s)[o]}setGeom(o,s,a=void 0){const l=this.getGeomStore(a);l[o]=s}getExtent(o){return this.extents[o]}setExtent(o,s){this.extents[o]=s}clearAll(){this.attribs={},this.geoms={},this.extents={}}},M4$1=class{innerRenderer;symbolUnits;defaultUnit;type;falseRenderer;constructor(o,s,a=!1){this.innerRenderer=o,this.symbolUnits=[],this.falseRenderer=a,this.type=b0$2.Unknown}makeSearchParams(o){return o}searchRenderer(o){const s=this.makeSearchParams(o),a=this.symbolUnits.find(c=>c.match(s));if(a)return a;if(this.defaultUnit)return this.defaultUnit;console.error(`renderer search could not find match for ${s}`);const l=new Lb$2(this);return l.svgCode="",l}getGraphicIcon(o){return this.searchRenderer(o).svgCode}getGraphicSymbol(o){return this.searchRenderer(o).symbol}getFieldDelimiter(o,s){let a="'";if(!s||s.length===0)return a;const l=s.find(c=>c.name===o);return l&&l.type&&l.type!=="string"&&(a=""),a}cleanFieldName(o,s){if(!o)return o;let a=s.find(l=>l.name===o);if(a)return o;{const l=o.toLowerCase();return a=s.find(c=>c.name.toLowerCase()===l),a?a.name:o}}makeElseClause(){return this.falseRenderer?"":`(NOT (${this.symbolUnits.map(o=>o.definitionClause).join(" OR ")}))`}},Lb$2=class{isDefault=!1;svgCode="";symbol;definitionClause="";label="";parent;constructor(o){this.parent=o,this.symbol=new gs$2}match(o){return!!o}};class zyt extends M4$1{constructor(o,s){super(o,s),this.type=b0$2.Simple;const a=new Lb$2(this);a.label=o.label||"",a.symbol=o.symbol,a.definitionClause="",this.symbolUnits.push(a)}}class Hyt extends M4$1{delim;keyFields;constructor(o,s,a=!1){super(o,s,a),this.type=b0$2.Unique,this.delim=o.fieldDelimiter||", ";const l=u=>u.replace(/'/g,"''");this.keyFields=[o.field,o.field2,o.field3].filter(u=>u).map(u=>this.cleanFieldName(u,s));const c=this.keyFields.map(u=>this.getFieldDelimiter(u,s));if(o.uniqueValueInfos.forEach(u=>{const d=new zG$1(this,u.value);if(d.label=u.label||"",d.symbol=u.symbol,!this.falseRenderer){const m=d.matchValue.split(this.delim),g=this.keyFields.map((y,_)=>m[_]===""?`${y} IS NULL`:`${y} = ${c[_]}${l(m[_])}${c[_]}`).join(" AND ");d.definitionClause=`(${g})`,d.matchValue=d.matchValue.replace(//g,"")}this.symbolUnits.push(d)}),o.defaultSymbol){const u=new zG$1(this,"");u.isDefault=!0,u.label=o.defaultLabel||"",u.symbol=o.defaultSymbol,u.definitionClause=this.makeElseClause(),this.defaultUnit=u}}makeSearchParams(o){return this.keyFields.map(s=>{let a=o[s]===null?"":o[s];return typeof a!="string"&&(a=a.toString()),a}).join(this.delim)}}let zG$1=class extends Lb$2{matchValue;constructor(o,s){super(o),typeof s=="number"?this.matchValue=s.toString():this.matchValue=s}match(o){return this.matchValue===o}};class Wyt extends M4$1{valField;constructor(o,s,a=!1){if(super(o,s,a),this.valField=this.cleanFieldName(o.field,s),o.classBreakInfos.forEach((l,c)=>{const u=c===0,d=new HG$1(this,l.minValue,l.maxValue,u);d.label=l.label||"",d.symbol=l.symbol,this.falseRenderer||(d.definitionClause=`(${this.valField} >${u?"=":""} ${l.minValue} AND ${this.valField} <= ${l.maxValue})`),this.symbolUnits.push(d)}),o.defaultSymbol){const l=new HG$1(this,0,0,!1);l.isDefault=!0,l.label=o.defaultLabel||"",l.symbol=o.defaultSymbol,l.definitionClause=this.makeElseClause(),this.defaultUnit=l}}makeSearchParams(o){return parseFloat(o[this.valField])}}let HG$1=class extends Lb$2{minValue;maxValue;firstBreak;constructor(o,s,a,l){super(o),this.minValue=s,this.maxValue=a,this.firstBreak=l}match(o){return this.minValue===this.maxValue?this.maxValue===o:this.firstBreak?this.minValue<=o&&this.maxValue>=o:this.minValue=o}};var N4$1={exports:{}},Xyt=N4$1.exports,WG$1;function Yyt(){return WG$1||(WG$1=1,function(r,o){(function(s,a){r.exports=s.document?a(s,s.document):function(l){return a(l,l.document)}})(typeof window<"u"?window:Xyt,function(s,a){var l=typeof this<"u"?this:s,c=l.SVG=function(B){if(c.supported)return B=new c.Doc(B),c.parser.draw||c.prepare(),B};if(c.ns="http://www.w3.org/2000/svg",c.xmlns="http://www.w3.org/2000/xmlns/",c.xlink="http://www.w3.org/1999/xlink",c.svgjs="http://svgjs.com/svgjs",c.supported=function(){return!!a.createElementNS&&!!a.createElementNS(c.ns,"svg").createSVGRect}(),!c.supported)return!1;c.did=1e3,c.eid=function(B){return"Svgjs"+O(B)+c.did++},c.create=function(B){var V=a.createElementNS(this.ns,B);return V.setAttribute("id",this.eid(B)),V},c.extend=function(){var B,V,Ge,St;for(B=[].slice.call(arguments),V=B.pop(),St=B.length-1;St>=0;St--)if(B[St])for(Ge in V)B[St].prototype[Ge]=V[Ge];c.Set&&c.Set.inherit&&c.Set.inherit()},c.invent=function(B){var V=typeof B.create=="function"?B.create:function(){this.constructor.call(this,c.create(B.create))};return B.inherit&&(V.prototype=new B.inherit),B.extend&&c.extend(V,B.extend),B.construct&&c.extend(B.parent||c.Container,B.construct),V},c.adopt=function(B){if(!B)return null;if(B.instance)return B.instance;var V;return B.nodeName=="svg"?V=B.parentNode instanceof s.SVGElement?new c.Nested:new c.Doc:B.nodeName=="linearGradient"?V=new c.Gradient("linear"):B.nodeName=="radialGradient"?V=new c.Gradient("radial"):c[O(B.nodeName)]?V=new c[O(B.nodeName)]:V=new c.Element(B),V.type=B.nodeName,V.node=B,B.instance=V,V instanceof c.Doc&&V.namespace().defs(),V.setData(JSON.parse(B.getAttribute("svgjs:data"))||{}),V},c.prepare=function(){var B=a.getElementsByTagName("body")[0],V=(B?new c.Doc(B):c.adopt(a.documentElement).nested()).size(2,0);c.parser={body:B||a.documentElement,draw:V.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:V.polyline().node,path:V.path().node,native:c.create("svg")}},c.parser={native:c.create("svg")},a.addEventListener("DOMContentLoaded",function(){c.parser.draw||c.prepare()},!1),c.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},c.utils={map:function(B,V){var Ge,St=B.length,Dee=[];for(Ge=0;Ge1?1:B,new c.Color({r:~~(this.r+(this.destination.r-this.r)*B),g:~~(this.g+(this.destination.g-this.g)*B),b:~~(this.b+(this.destination.b-this.b)*B)})):this}}),c.Color.test=function(B){return B+="",c.regex.isHex.test(B)||c.regex.isRgb.test(B)},c.Color.isRgb=function(B){return B&&typeof B.r=="number"&&typeof B.g=="number"&&typeof B.b=="number"},c.Color.isColor=function(B){return c.Color.isRgb(B)||c.Color.test(B)},c.Array=function(B,V){B=(B||[]).valueOf(),B.length==0&&V&&(B=V.valueOf()),this.value=this.parse(B)},c.extend(c.Array,{morph:function(B){if(this.destination=this.parse(B),this.value.length!=this.destination.length){for(var V=this.value[this.value.length-1],Ge=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(Ge);for(;this.value.length=0;St--)this.value[St]=[this.value[St][0]+B,this.value[St][1]+V];return this},size:function(B,V){var Ge,St=this.bbox();for(Ge=this.value.length-1;Ge>=0;Ge--)St.width&&(this.value[Ge][0]=(this.value[Ge][0]-St.x)*B/St.width+St.x),St.height&&(this.value[Ge][1]=(this.value[Ge][1]-St.y)*V/St.height+St.y);return this},bbox:function(){return c.parser.poly.setAttribute("points",this.toString()),c.parser.poly.getBBox()}});for(var u={M:function(B,V,Ge){return V.x=Ge.x=B[0],V.y=Ge.y=B[1],["M",V.x,V.y]},L:function(B,V){return V.x=B[0],V.y=B[1],["L",B[0],B[1]]},H:function(B,V){return V.x=B[0],["H",B[0]]},V:function(B,V){return V.y=B[0],["V",B[0]]},C:function(B,V){return V.x=B[4],V.y=B[5],["C",B[0],B[1],B[2],B[3],B[4],B[5]]},S:function(B,V){return V.x=B[2],V.y=B[3],["S",B[0],B[1],B[2],B[3]]},Q:function(B,V){return V.x=B[2],V.y=B[3],["Q",B[0],B[1],B[2],B[3]]},T:function(B,V){return V.x=B[0],V.y=B[1],["T",B[0],B[1]]},Z:function(B,V,Ge){return V.x=Ge.x,V.y=Ge.y,["Z"]},A:function(B,V){return V.x=B[5],V.y=B[6],["A",B[0],B[1],B[2],B[3],B[4],B[5],B[6]]}},d="mlhvqtcsaz".split(""),m=0,g=d.length;m=0;Dee--)St=this.value[Dee][0],St=="M"||St=="L"||St=="T"?(this.value[Dee][1]+=B,this.value[Dee][2]+=V):St=="H"?this.value[Dee][1]+=B:St=="V"?this.value[Dee][1]+=V:St=="C"||St=="S"||St=="Q"?(this.value[Dee][1]+=B,this.value[Dee][2]+=V,this.value[Dee][3]+=B,this.value[Dee][4]+=V,St=="C"&&(this.value[Dee][5]+=B,this.value[Dee][6]+=V)):St=="A"&&(this.value[Dee][6]+=B,this.value[Dee][7]+=V);return this},size:function(B,V){var Ge,St,Dee=this.bbox();for(Ge=this.value.length-1;Ge>=0;Ge--)St=this.value[Ge][0],St=="M"||St=="L"||St=="T"?(this.value[Ge][1]=(this.value[Ge][1]-Dee.x)*B/Dee.width+Dee.x,this.value[Ge][2]=(this.value[Ge][2]-Dee.y)*V/Dee.height+Dee.y):St=="H"?this.value[Ge][1]=(this.value[Ge][1]-Dee.x)*B/Dee.width+Dee.x:St=="V"?this.value[Ge][1]=(this.value[Ge][1]-Dee.y)*V/Dee.height+Dee.y:St=="C"||St=="S"||St=="Q"?(this.value[Ge][1]=(this.value[Ge][1]-Dee.x)*B/Dee.width+Dee.x,this.value[Ge][2]=(this.value[Ge][2]-Dee.y)*V/Dee.height+Dee.y,this.value[Ge][3]=(this.value[Ge][3]-Dee.x)*B/Dee.width+Dee.x,this.value[Ge][4]=(this.value[Ge][4]-Dee.y)*V/Dee.height+Dee.y,St=="C"&&(this.value[Ge][5]=(this.value[Ge][5]-Dee.x)*B/Dee.width+Dee.x,this.value[Ge][6]=(this.value[Ge][6]-Dee.y)*V/Dee.height+Dee.y)):St=="A"&&(this.value[Ge][1]=this.value[Ge][1]*B/Dee.width,this.value[Ge][2]=this.value[Ge][2]*V/Dee.height,this.value[Ge][6]=(this.value[Ge][6]-Dee.x)*B/Dee.width+Dee.x,this.value[Ge][7]=(this.value[Ge][7]-Dee.y)*V/Dee.height+Dee.y);return this},equalCommands:function(B){var V,Ge,St;for(B=new c.PathArray(B),St=this.value.length===B.value.length,V=0,Ge=this.value.length;St&&Vjr);return St},bbox:function(){return c.parser.path.setAttribute("d",this.toString()),c.parser.path.getBBox()}}),c.Number=c.invent({create:function(B,V){this.value=0,this.unit=V||"",typeof B=="number"?this.value=isNaN(B)?0:isFinite(B)?B:B<0?-34e37:34e37:typeof B=="string"?(V=B.match(c.regex.numberAndUnit),V&&(this.value=parseFloat(V[1]),V[5]=="%"?this.value/=100:V[5]=="s"&&(this.value*=1e3),this.unit=V[5])):B instanceof c.Number&&(this.value=B.valueOf(),this.unit=B.unit)},extend:{toString:function(){return(this.unit=="%"?~~(this.value*1e8)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(B){return B=new c.Number(B),new c.Number(this+B,this.unit||B.unit)},minus:function(B){return B=new c.Number(B),new c.Number(this-B,this.unit||B.unit)},times:function(B){return B=new c.Number(B),new c.Number(this*B,this.unit||B.unit)},divide:function(B){return B=new c.Number(B),new c.Number(this/B,this.unit||B.unit)},to:function(B){var V=new c.Number(this);return typeof B=="string"&&(V.unit=B),V},morph:function(B){return this.destination=new c.Number(B),B.relative&&(this.destination.value+=this.value),this},at:function(B){return this.destination?new c.Number(this.destination).minus(this).times(B).plus(this):this}}}),c.Element=c.invent({create:function(B){this._stroke=c.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=B)&&(this.type=B.nodeName,this.node.instance=this,this._events=B._events||{},this._stroke=B.getAttribute("stroke")||this._stroke)},extend:{x:function(B){return this.attr("x",B)},y:function(B){return this.attr("y",B)},cx:function(B){return B==null?this.x()+this.width()/2:this.x(B-this.width()/2)},cy:function(B){return B==null?this.y()+this.height()/2:this.y(B-this.height()/2)},move:function(B,V){return this.x(B).y(V)},center:function(B,V){return this.cx(B).cy(V)},width:function(B){return this.attr("width",B)},height:function(B){return this.attr("height",B)},size:function(B,V){var Ge=N(this,B,V);return this.width(new c.Number(Ge.width)).height(new c.Number(Ge.height))},clone:function(B){this.writeDataToDom();var V=U(this.node.cloneNode(!0));return B?B.add(V):this.after(V),V},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(B){return this.after(B).remove(),B},addTo:function(B){return B.put(this)},putIn:function(B){return B.add(this)},id:function(B){return this.attr("id",B)},inside:function(B,V){var Ge=this.bbox();return B>Ge.x&&V>Ge.y&&B/g,"<$1$2>")+"";for(var Ge=0,St=V.firstChild.childNodes.length;Ge/,"").replace(/<\/svg>$/,"");return this},writeDataToDom:function(){if(this.each||this.lines){var B=this.each?this:this.lines();B.each(function(){this.writeDataToDom()})}return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(B){return this.dom=B,this},is:function(B){return w(this,B)}}}),c.easing={"-":function(B){return B},"<>":function(B){return-Math.cos(B*Math.PI)/2+.5},">":function(B){return Math.sin(B*Math.PI/2)},"<":function(B){return-Math.cos(B*Math.PI/2)+1}},c.morph=function(B){return function(V,Ge){return new c.MorphObj(V,Ge).at(B)}},c.Situation=c.invent({create:function(B){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new c.Number(B.duration).valueOf(),this.delay=new c.Number(B.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=B.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),c.FX=c.invent({create:function(B){this._target=B,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(B,V,Ge){typeof B=="object"&&(V=B.ease,Ge=B.delay,B=B.duration);var St=new c.Situation({duration:B||1e3,delay:Ge||0,ease:c.easing[V||"-"]||V});return this.queue(St),this},delay:function(B){var V=new c.Situation({duration:B,delay:0,ease:c.easing["-"]});return this.queue(V)},target:function(B){return B&&B instanceof c.Element?(this._target=B,this):this._target},timeToAbsPos:function(B){return(B-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(B){return this.situation.duration/this._speed*B+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=s.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){s.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(B){return(typeof B=="function"||B instanceof c.Situation)&&this.situations.push(B),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof c.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var B,V,Ge,St=this.situation;if(St.init)return this;for(B in St.animations)for(Ge=this.target()[B](),Array.isArray(Ge)||(Ge=[Ge]),Array.isArray(St.animations[B])||(St.animations[B]=[St.animations[B]]),V=Ge.length;V--;)St.animations[B][V]instanceof c.Number&&(Ge[V]=new c.Number(Ge[V])),St.animations[B][V]=Ge[V].morph(St.animations[B][V]);for(B in St.attrs)St.attrs[B]=new c.MorphObj(this.target().attr(B),St.attrs[B]);for(B in St.styles)St.styles[B]=new c.MorphObj(this.target().style(B),St.styles[B]);return St.initialTransformation=this.target().matrixify(),St.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(B,V){var Ge=this.active;return this.active=!1,V&&this.clearQueue(),B&&this.situation&&(!Ge&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var B=this.situation;this.stop(),this.situation=B,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(B,V){var Ge=this.situation.duration/this._speed;return this.absPos=B,V||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*Ge,this.situation.finish=this.situation.start+Ge,this.step(!0)},speed:function(B){return B===0?this.pause():B?(this._speed=B,this.at(this.absPos,!0)):this._speed},loop:function(B,V){var Ge=this.last();return Ge.loops=B??!0,Ge.loop=0,V&&(Ge.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(B){var V=this.last();return typeof B>"u"?V.reversed=!V.reversed:V.reversed=B,this},progress:function(B){return B?this.situation.ease(this.pos):this.pos},after:function(B){var V=this.last(),Ge=function St(Dee){Dee.detail.situation==V&&(B.call(this,V),this.off("finished.fx",St))};return this.target().on("finished.fx",Ge),this._callStart()},during:function(B){var V=this.last(),Ge=function(St){St.detail.situation==V&&B.call(this,St.detail.pos,c.morph(St.detail.pos),St.detail.eased,V)};return this.target().off("during.fx",Ge).on("during.fx",Ge),this.after(function(){this.off("during.fx",Ge)}),this._callStart()},afterAll:function(B){var V=function Ge(St){B.call(this),this.off("allfinished.fx",Ge)};return this.target().off("allfinished.fx",V).on("allfinished.fx",V),this._callStart()},duringAll:function(B){var V=function(Ge){B.call(this,Ge.detail.pos,c.morph(Ge.detail.pos),Ge.detail.eased,Ge.detail.situation)};return this.target().off("during.fx",V).on("during.fx",V),this.afterAll(function(){this.off("during.fx",V)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(B,V,Ge){return this.last()[Ge||"animations"][B]=V,this._callStart()},step:function(B){if(B||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1){var V,Ge,St;V=Math.max(this.absPos,0),Ge=Math.floor(V),this.situation.loops===!0||Gethis.lastPos&&pee<=Dee&&(this.situation.once[pee].call(this.target(),this.pos,Dee),delete this.situation.once[pee]);return this.active&&this.target().fire("during",{pos:this.pos,eased:Dee,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=Dee,this):this},eachAt:function(){var B,V,Ge,St=this,Dee=this.target(),pee=this.situation;for(B in pee.animations)Ge=[].concat(pee.animations[B]).map(function(Tee){return typeof Tee!="string"&&Tee.at?Tee.at(pee.ease(St.pos),St.pos):Tee}),Dee[B].apply(Dee,Ge);for(B in pee.attrs)Ge=[B].concat(pee.attrs[B]).map(function(Tee){return typeof Tee!="string"&&Tee.at?Tee.at(pee.ease(St.pos),St.pos):Tee}),Dee.attr.apply(Dee,Ge);for(B in pee.styles)Ge=[B].concat(pee.styles[B]).map(function(Tee){return typeof Tee!="string"&&Tee.at?Tee.at(pee.ease(St.pos),St.pos):Tee}),Dee.style.apply(Dee,Ge);if(pee.transforms.length){for(Ge=pee.initialTransformation,B=0,V=pee.transforms.length;B=0;--V)this[ce[V]]=B[ce[V]]!=null?B[ce[V]]:Ge[ce[V]]},extend:{extract:function(){var B=D(this,0,1),V=D(this,1,0),Ge=180/Math.PI*Math.atan2(B.y,B.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(Ge*Math.PI/180)+this.f*Math.sin(Ge*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(Ge*Math.PI/180)+this.e*Math.sin(-Ge*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-Ge,skewY:180/Math.PI*Math.atan2(V.y,V.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:Ge,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new c.Matrix(this)}},clone:function(){return new c.Matrix(this)},morph:function(B){return this.destination=new c.Matrix(B),this},at:function(B){if(!this.destination)return this;var V=new c.Matrix({a:this.a+(this.destination.a-this.a)*B,b:this.b+(this.destination.b-this.b)*B,c:this.c+(this.destination.c-this.c)*B,d:this.d+(this.destination.d-this.d)*B,e:this.e+(this.destination.e-this.e)*B,f:this.f+(this.destination.f-this.f)*B});return V},multiply:function(B){return new c.Matrix(this.native().multiply(I(B).native()))},inverse:function(){return new c.Matrix(this.native().inverse())},translate:function(B,V){return new c.Matrix(this.native().translate(B||0,V||0))},scale:function(B,V,Ge,St){return arguments.length==1?V=B:arguments.length==3&&(St=Ge,Ge=V,V=B),this.around(Ge,St,new c.Matrix(B,0,0,V,0,0))},rotate:function(B,V,Ge){return B=c.utils.radians(B),this.around(V,Ge,new c.Matrix(Math.cos(B),Math.sin(B),-Math.sin(B),Math.cos(B),0,0))},flip:function(B,V){return B=="x"?this.scale(-1,1,V,0):B=="y"?this.scale(1,-1,0,V):this.scale(-1,-1,B,V??B)},skew:function(B,V,Ge,St){return arguments.length==1?V=B:arguments.length==3&&(St=Ge,Ge=V,V=B),B=c.utils.radians(B),V=c.utils.radians(V),this.around(Ge,St,new c.Matrix(1,Math.tan(V),Math.tan(B),1,0,0))},skewX:function(B,V,Ge){return this.skew(B,0,V,Ge)},skewY:function(B,V,Ge){return this.skew(0,B,V,Ge)},around:function(B,V,Ge){return this.multiply(new c.Matrix(1,0,0,1,B||0,V||0)).multiply(Ge).multiply(new c.Matrix(1,0,0,1,-B||0,-V||0))},native:function(){for(var B=c.parser.native.createSVGMatrix(),V=ce.length-1;V>=0;V--)B[ce[V]]=this[ce[V]];return B},toString:function(){return"matrix("+ie(this.a)+","+ie(this.b)+","+ie(this.c)+","+ie(this.d)+","+ie(this.e)+","+ie(this.f)+")"}},parent:c.Element,construct:{ctm:function(){return new c.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof c.Nested){var B=this.rect(1,1),V=B.node.getScreenCTM();return B.remove(),new c.Matrix(V)}return new c.Matrix(this.node.getScreenCTM())}}}),c.Point=c.invent({create:function(B,V){var Ge,St={x:0,y:0};Ge=Array.isArray(B)?{x:B[0],y:B[1]}:typeof B=="object"?{x:B.x,y:B.y}:B!=null?{x:B,y:V??B}:St,this.x=Ge.x,this.y=Ge.y},extend:{clone:function(){return new c.Point(this)},morph:function(B,V){return this.destination=new c.Point(B,V),this},at:function(B){if(!this.destination)return this;var V=new c.Point({x:this.x+(this.destination.x-this.x)*B,y:this.y+(this.destination.y-this.y)*B});return V},native:function(){var B=c.parser.native.createSVGPoint();return B.x=this.x,B.y=this.y,B},transform:function(B){return new c.Point(this.native().matrixTransform(B.native()))}}}),c.extend(c.Element,{point:function(B,V){return new c.Point(B,V).transform(this.screenCTM().inverse())}}),c.extend(c.Element,{attr:function(B,V,Ge){if(B==null){for(B={},V=this.node.attributes,Ge=V.length-1;Ge>=0;Ge--)B[V[Ge].nodeName]=c.regex.isNumber.test(V[Ge].nodeValue)?parseFloat(V[Ge].nodeValue):V[Ge].nodeValue;return B}else if(typeof B=="object")for(V in B)this.attr(V,B[V]);else if(V===null)this.node.removeAttribute(B);else{if(V==null)return V=this.node.getAttribute(B),V==null?c.defaults.attrs[B]:c.regex.isNumber.test(V)?parseFloat(V):V;B=="stroke-width"?this.attr("stroke",parseFloat(V)>0?this._stroke:null):B=="stroke"&&(this._stroke=V),(B=="fill"||B=="stroke")&&(c.regex.isImage.test(V)&&(V=this.doc().defs().image(V,0,0)),V instanceof c.Image&&(V=this.doc().defs().pattern(0,0,function(){this.add(V)}))),typeof V=="number"?V=new c.Number(V):c.Color.isColor(V)?V=new c.Color(V):Array.isArray(V)&&(V=new c.Array(V)),B=="leading"?this.leading&&this.leading(V):typeof Ge=="string"?this.node.setAttributeNS(Ge,B,V.toString()):this.node.setAttribute(B,V.toString()),this.rebuild&&(B=="font-size"||B=="x")&&this.rebuild(B,V)}return this}}),c.extend(c.Element,{transform:function(B,V){var Ge=this,St,Dee;if(typeof B!="object")return St=new c.Matrix(Ge).extract(),typeof B=="string"?St[B]:St;if(St=new c.Matrix(Ge),V=!!V||!!B.relative,B.a!=null)St=V?St.multiply(new c.Matrix(B)):new c.Matrix(B);else if(B.rotation!=null)L(B,Ge),St=V?St.rotate(B.rotation,B.cx,B.cy):St.rotate(B.rotation-St.extract().rotation,B.cx,B.cy);else if(B.scale!=null||B.scaleX!=null||B.scaleY!=null){if(L(B,Ge),B.scaleX=B.scale!=null?B.scale:B.scaleX!=null?B.scaleX:1,B.scaleY=B.scale!=null?B.scale:B.scaleY!=null?B.scaleY:1,!V){var pee=St.extract();B.scaleX=B.scaleX*1/pee.scaleX,B.scaleY=B.scaleY*1/pee.scaleY}St=St.scale(B.scaleX,B.scaleY,B.cx,B.cy)}else if(B.skew!=null||B.skewX!=null||B.skewY!=null){if(L(B,Ge),B.skewX=B.skew!=null?B.skew:B.skewX!=null?B.skewX:0,B.skewY=B.skew!=null?B.skew:B.skewY!=null?B.skewY:0,!V){var pee=St.extract();St=St.multiply(new c.Matrix().skew(pee.skewX,pee.skewY,B.cx,B.cy).inverse())}St=St.skew(B.skewX,B.skewY,B.cx,B.cy)}else B.flip?(B.flip=="x"||B.flip=="y"?B.offset=B.offset==null?Ge.bbox()["c"+B.flip]:B.offset:B.offset==null?(Dee=Ge.bbox(),B.flip=Dee.cx,B.offset=Dee.cy):B.flip=B.offset,St=new c.Matrix().flip(B.flip,B.offset)):(B.x!=null||B.y!=null)&&(V?St=St.translate(B.x,B.y):(B.x!=null&&(St.e=B.x),B.y!=null&&(St.f=B.y)));return this.attr("transform",St)}}),c.extend(c.FX,{transform:function(B,V){var Ge=this.target(),St,Dee;return typeof B!="object"?(St=new c.Matrix(Ge).extract(),typeof B=="string"?St[B]:St):(V=!!V||!!B.relative,B.a!=null?St=new c.Matrix(B):B.rotation!=null?(L(B,Ge),St=new c.Rotate(B.rotation,B.cx,B.cy)):B.scale!=null||B.scaleX!=null||B.scaleY!=null?(L(B,Ge),B.scaleX=B.scale!=null?B.scale:B.scaleX!=null?B.scaleX:1,B.scaleY=B.scale!=null?B.scale:B.scaleY!=null?B.scaleY:1,St=new c.Scale(B.scaleX,B.scaleY,B.cx,B.cy)):B.skewX!=null||B.skewY!=null?(L(B,Ge),B.skewX=B.skewX!=null?B.skewX:0,B.skewY=B.skewY!=null?B.skewY:0,St=new c.Skew(B.skewX,B.skewY,B.cx,B.cy)):B.flip?(B.flip=="x"||B.flip=="y"?B.offset=B.offset==null?Ge.bbox()["c"+B.flip]:B.offset:B.offset==null?(Dee=Ge.bbox(),B.flip=Dee.cx,B.offset=Dee.cy):B.flip=B.offset,St=new c.Matrix().flip(B.flip,B.offset)):(B.x!=null||B.y!=null)&&(St=new c.Translate(B.x,B.y)),St?(St.relative=V,this.last().transforms.push(St),this._callStart()):this)}}),c.extend(c.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var B=(this.attr("transform")||"").split(c.regex.transforms).slice(0,-1).map(function(V){var Ge=V.trim().split("(");return[Ge[0],Ge[1].split(c.regex.delimiter).map(function(St){return parseFloat(St)})]}).reduce(function(V,Ge){return Ge[0]=="matrix"?V.multiply(P(Ge[1])):V[Ge[0]].apply(V,Ge[1])},new c.Matrix);return B},toParent:function(B){if(this==B)return this;var V=this.screenCTM(),Ge=B.screenCTM().inverse();return this.addTo(B).untransform().transform(Ge.multiply(V)),this},toDoc:function(){return this.toParent(this.doc())}}),c.Transformation=c.invent({create:function(B,V){if(arguments.length>1&&typeof V!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(B))for(var Ge=0,St=this.arguments.length;Ge"u"?0:B[this.arguments[V]];return B.cx=this.cx,B.cy=this.cy,this._undo=new c[O(this.method)](B,!0).at(1),this}}}),c.Translate=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(B,V){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),c.Rotate=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(B,V){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(B){var V=new c.Matrix().rotate(new c.Number().morph(this.rotation-(this._undo?this._undo.rotation:0)).at(B),this.cx,this.cy);return this.inversed?V.inverse():V},undo:function(B){return this._undo=B,this}}}),c.Scale=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(B,V){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),c.Skew=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(B,V){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),c.extend(c.Element,{style:function(B,V){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(typeof B=="object")for(V in B)this.style(V,B[V]);else if(c.regex.isCss.test(B))for(B=B.split(/\s*;\s*/).filter(function(Ge){return!!Ge}).map(function(Ge){return Ge.split(/\s*:\s*/)});V=B.pop();)this.style(V[0],V[1]);else return this.node.style[k(B)];else this.node.style[k(B)]=V===null||c.regex.isBlank.test(V)?"":V;return this}}),c.Parent=c.invent({create:function(B){this.constructor.call(this,B)},inherit:c.Element,extend:{children:function(){return c.utils.map(c.utils.filterSVGElements(this.node.childNodes),function(B){return c.adopt(B)})},add:function(B,V){return V==null?this.node.appendChild(B.node):B.node!=this.node.childNodes[V]&&this.node.insertBefore(B.node,this.node.childNodes[V]),this},put:function(B,V){return this.add(B,V),B},has:function(B){return this.index(B)>=0},index:function(B){return[].slice.call(this.node.childNodes).indexOf(B.node)},get:function(B){return c.adopt(this.node.childNodes[B])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(B,V){var Ge,St,Dee=this.children();for(Ge=0,St=Dee.length;GeDee/pee?this.height/pee:this.width/Dee,this.x=Ge,this.y=St,this.width=Dee,this.height=pee)}else B=typeof B=="string"?B.match(ete).map(function(xte){return parseFloat(xte)}):Array.isArray(B)?B:typeof B=="object"?[B.x,B.y,B.width,B.height]:arguments.length==4?[].slice.call(arguments):V,this.x=B[0],this.y=B[1],this.width=B[2],this.height=B[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(B,V,Ge,St){return this.destination=new c.ViewBox(B,V,Ge,St),this},at:function(B){return this.destination?new c.ViewBox([this.x+(this.destination.x-this.x)*B,this.y+(this.destination.y-this.y)*B,this.width+(this.destination.width-this.width)*B,this.height+(this.destination.height-this.height)*B]):this}},parent:c.Container,construct:{viewbox:function(B,V,Ge,St){return arguments.length==0?new c.ViewBox(this):this.attr("viewBox",new c.ViewBox(B,V,Ge,St))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(B){c.Element.prototype[B]=function(V){return V==null?c.off(this,B):c.on(this,B,V),this}}),c.listenerId=0,c.on=function(B,V,Ge,St,Dee){var pee=Ge.bind(St||B),jr=B instanceof c.Element?B.node:B;jr.instance=jr.instance||{_events:{}};var Tee=jr.instance._events;Ge._svgjsListenerId||(Ge._svgjsListenerId=++c.listenerId),V.split(c.regex.delimiter).forEach(function(et){var ft=et.split(".")[0],yee=et.split(".")[1]||"*";Tee[ft]=Tee[ft]||{},Tee[ft][yee]=Tee[ft][yee]||{},Tee[ft][yee][Ge._svgjsListenerId]=pee,jr.addEventListener(ft,pee,Dee||!1)})},c.off=function(B,V,Ge,St){var Dee=B instanceof c.Element?B.node:B;if(Dee.instance&&!(typeof Ge=="function"&&(Ge=Ge._svgjsListenerId,!Ge))){var pee=Dee.instance._events;(V||"").split(c.regex.delimiter).forEach(function(jr){var Tee=jr&&jr.split(".")[0],et=jr&&jr.split(".")[1],ft,yee;if(Ge)pee[Tee]&&pee[Tee][et||"*"]&&(Dee.removeEventListener(Tee,pee[Tee][et||"*"][Ge],St||!1),delete pee[Tee][et||"*"][Ge]);else if(Tee&&et){if(pee[Tee]&&pee[Tee][et]){for(yee in pee[Tee][et])c.off(Dee,[Tee,et].join("."),yee);delete pee[Tee][et]}}else if(et)for(jr in pee)for(ft in pee[jr])et===ft&&c.off(Dee,[jr,et].join("."));else if(Tee){if(pee[Tee]){for(ft in pee[Tee])c.off(Dee,[Tee,ft].join("."));delete pee[Tee]}}else{for(jr in pee)c.off(Dee,jr);Dee.instance._events={}}})}},c.extend(c.Element,{on:function(B,V,Ge,St){return c.on(this,B,V,Ge,St),this},off:function(B,V){return c.off(this.node,B,V),this},fire:function(B,V){return B instanceof s.Event?this.node.dispatchEvent(B):this.node.dispatchEvent(B=new c.CustomEvent(B,{detail:V,cancelable:!0})),this._event=B,this},event:function(){return this._event}}),c.Defs=c.invent({create:"defs",inherit:c.Container}),c.G=c.invent({create:"g",inherit:c.Container,extend:{x:function(B){return B==null?this.transform("x"):this.transform({x:B-this.x()},!0)},y:function(B){return B==null?this.transform("y"):this.transform({y:B-this.y()},!0)},cx:function(B){return B==null?this.gbox().cx:this.x(B-this.gbox().width/2)},cy:function(B){return B==null?this.gbox().cy:this.y(B-this.gbox().height/2)},gbox:function(){var B=this.bbox(),V=this.transform();return B.x+=V.x,B.x2+=V.x,B.cx+=V.x,B.y+=V.y,B.y2+=V.y,B.cy+=V.y,B}},construct:{group:function(){return this.put(new c.G)}}}),c.Doc=c.invent({create:function(B){B&&(B=typeof B=="string"?a.getElementById(B):B,B.nodeName=="svg"?this.constructor.call(this,B):(this.constructor.call(this,c.create("svg")),B.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:c.Container,extend:{namespace:function(){return this.attr({xmlns:c.ns,version:"1.1"}).attr("xmlns:xlink",c.xlink,c.xmlns).attr("xmlns:svgjs",c.svgjs,c.xmlns)},defs:function(){if(!this._defs){var B;(B=this.node.getElementsByTagName("defs")[0])?this._defs=c.adopt(B):this._defs=new c.Defs,this.node.appendChild(this._defs.node)}return this._defs},parent:function(){return!this.node.parentNode||this.node.parentNode.nodeName=="#document"||this.node.parentNode.nodeName=="#document-fragment"?null:this.node.parentNode},spof:function(){var B=this.node.getScreenCTM();return B&&this.style("left",-B.e%1+"px").style("top",-B.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,c.parser.draw.parentNode||this.node.appendChild(c.parser.draw),this},clone:function(B){this.writeDataToDom();var V=this.node,Ge=U(V.cloneNode(!0));return B?(B.node||B).appendChild(Ge.node):V.parentNode.insertBefore(Ge.node,V.nextSibling),Ge}}}),c.extend(c.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var B=this.position()+1,V=this.parent();return V.removeElement(this).add(this,B),V instanceof c.Doc&&V.node.appendChild(V.defs().node),this},backward:function(){var B=this.position();return B>0&&this.parent().removeElement(this).add(this,B-1),this},front:function(){var B=this.parent();return B.node.appendChild(this.node),B instanceof c.Doc&&B.node.appendChild(B.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(B){B.remove();var V=this.position();return this.parent().add(B,V),this},after:function(B){B.remove();var V=this.position();return this.parent().add(B,V+1),this}}),c.Mask=c.invent({create:function(){this.constructor.call(this,c.create("mask")),this.targets=[]},inherit:c.Container,extend:{remove:function(){for(var B=this.targets.length-1;B>=0;B--)this.targets[B]&&this.targets[B].unmask();return this.targets=[],c.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new c.Mask)}}}),c.extend(c.Element,{maskWith:function(B){return this.masker=B instanceof c.Mask?B:this.parent().mask().add(B),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),c.ClipPath=c.invent({create:function(){this.constructor.call(this,c.create("clipPath")),this.targets=[]},inherit:c.Container,extend:{remove:function(){for(var B=this.targets.length-1;B>=0;B--)this.targets[B]&&this.targets[B].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new c.ClipPath)}}}),c.extend(c.Element,{clipWith:function(B){return this.clipper=B instanceof c.ClipPath?B:this.parent().clip().add(B),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),c.Gradient=c.invent({create:function(B){this.constructor.call(this,c.create(B+"Gradient")),this.type=B},inherit:c.Container,extend:{at:function(B,V,Ge){return this.put(new c.Stop).update(B,V,Ge)},update:function(B){return this.clear(),typeof B=="function"&&B.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(B,V,Ge){return B=="transform"&&(B="gradientTransform"),c.Container.prototype.attr.call(this,B,V,Ge)}},construct:{gradient:function(B,V){return this.defs().gradient(B,V)}}}),c.extend(c.Gradient,c.FX,{from:function(B,V){return(this._target||this).type=="radial"?this.attr({fx:new c.Number(B),fy:new c.Number(V)}):this.attr({x1:new c.Number(B),y1:new c.Number(V)})},to:function(B,V){return(this._target||this).type=="radial"?this.attr({cx:new c.Number(B),cy:new c.Number(V)}):this.attr({x2:new c.Number(B),y2:new c.Number(V)})}}),c.extend(c.Defs,{gradient:function(B,V){return this.put(new c.Gradient(B)).update(V)}}),c.Stop=c.invent({create:"stop",inherit:c.Element,extend:{update:function(B){return(typeof B=="number"||B instanceof c.Number)&&(B={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),B.opacity!=null&&this.attr("stop-opacity",B.opacity),B.color!=null&&this.attr("stop-color",B.color),B.offset!=null&&this.attr("offset",new c.Number(B.offset)),this}}}),c.Pattern=c.invent({create:"pattern",inherit:c.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(B){return this.clear(),typeof B=="function"&&B.call(this,this),this},toString:function(){return this.fill()},attr:function(B,V,Ge){return B=="transform"&&(B="patternTransform"),c.Container.prototype.attr.call(this,B,V,Ge)}},construct:{pattern:function(B,V,Ge){return this.defs().pattern(B,V,Ge)}}}),c.extend(c.Defs,{pattern:function(B,V,Ge){return this.put(new c.Pattern).update(Ge).attr({x:0,y:0,width:B,height:V,patternUnits:"userSpaceOnUse"})}}),c.Shape=c.invent({create:function(B){this.constructor.call(this,B)},inherit:c.Element}),c.Bare=c.invent({create:function(B,V){if(this.constructor.call(this,c.create(B)),V)for(var Ge in V.prototype)typeof V.prototype[Ge]=="function"&&(this[Ge]=V.prototype[Ge])},inherit:c.Element,extend:{words:function(B){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(a.createTextNode(B)),this}}}),c.extend(c.Parent,{element:function(B,V){return this.put(new c.Bare(B,V))}}),c.Symbol=c.invent({create:"symbol",inherit:c.Container,construct:{symbol:function(){return this.put(new c.Symbol)}}}),c.Use=c.invent({create:"use",inherit:c.Shape,extend:{element:function(B,V){return this.attr("href",(V||"")+"#"+B,c.xlink)}},construct:{use:function(B,V){return this.put(new c.Use).element(B,V)}}}),c.Rect=c.invent({create:"rect",inherit:c.Shape,construct:{rect:function(B,V){return this.put(new c.Rect).size(B,V)}}}),c.Circle=c.invent({create:"circle",inherit:c.Shape,construct:{circle:function(B){return this.put(new c.Circle).rx(new c.Number(B).divide(2)).move(0,0)}}}),c.extend(c.Circle,c.FX,{rx:function(B){return this.attr("r",B)},ry:function(B){return this.rx(B)}}),c.Ellipse=c.invent({create:"ellipse",inherit:c.Shape,construct:{ellipse:function(B,V){return this.put(new c.Ellipse).size(B,V).move(0,0)}}}),c.extend(c.Ellipse,c.Rect,c.FX,{rx:function(B){return this.attr("rx",B)},ry:function(B){return this.attr("ry",B)}}),c.extend(c.Circle,c.Ellipse,{x:function(B){return B==null?this.cx()-this.rx():this.cx(B+this.rx())},y:function(B){return B==null?this.cy()-this.ry():this.cy(B+this.ry())},cx:function(B){return B==null?this.attr("cx"):this.attr("cx",B)},cy:function(B){return B==null?this.attr("cy"):this.attr("cy",B)},width:function(B){return B==null?this.rx()*2:this.rx(new c.Number(B).divide(2))},height:function(B){return B==null?this.ry()*2:this.ry(new c.Number(B).divide(2))},size:function(B,V){var Ge=N(this,B,V);return this.rx(new c.Number(Ge.width).divide(2)).ry(new c.Number(Ge.height).divide(2))}}),c.Line=c.invent({create:"line",inherit:c.Shape,extend:{array:function(){return new c.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(B,V,Ge,St){return B==null?this.array():(typeof V<"u"?B={x1:B,y1:V,x2:Ge,y2:St}:B=new c.PointArray(B).toLine(),this.attr(B))},move:function(B,V){return this.attr(this.array().move(B,V).toLine())},size:function(B,V){var Ge=N(this,B,V);return this.attr(this.array().size(Ge.width,Ge.height).toLine())}},construct:{line:function(B,V,Ge,St){return c.Line.prototype.plot.apply(this.put(new c.Line),B!=null?[B,V,Ge,St]:[0,0,0,0])}}}),c.Polyline=c.invent({create:"polyline",inherit:c.Shape,construct:{polyline:function(B){return this.put(new c.Polyline).plot(B||new c.PointArray)}}}),c.Polygon=c.invent({create:"polygon",inherit:c.Shape,construct:{polygon:function(B){return this.put(new c.Polygon).plot(B||new c.PointArray)}}}),c.extend(c.Polyline,c.Polygon,{array:function(){return this._array||(this._array=new c.PointArray(this.attr("points")))},plot:function(B){return B==null?this.array():this.clear().attr("points",typeof B=="string"?B:this._array=new c.PointArray(B))},clear:function(){return delete this._array,this},move:function(B,V){return this.attr("points",this.array().move(B,V))},size:function(B,V){var Ge=N(this,B,V);return this.attr("points",this.array().size(Ge.width,Ge.height))}}),c.extend(c.Line,c.Polyline,c.Polygon,{morphArray:c.PointArray,x:function(B){return B==null?this.bbox().x:this.move(B,this.bbox().y)},y:function(B){return B==null?this.bbox().y:this.move(this.bbox().x,B)},width:function(B){var V=this.bbox();return B==null?V.width:this.size(B,V.height)},height:function(B){var V=this.bbox();return B==null?V.height:this.size(V.width,B)}}),c.Path=c.invent({create:"path",inherit:c.Shape,extend:{morphArray:c.PathArray,array:function(){return this._array||(this._array=new c.PathArray(this.attr("d")))},plot:function(B){return B==null?this.array():this.clear().attr("d",typeof B=="string"?B:this._array=new c.PathArray(B))},clear:function(){return delete this._array,this},move:function(B,V){return this.attr("d",this.array().move(B,V))},x:function(B){return B==null?this.bbox().x:this.move(B,this.bbox().y)},y:function(B){return B==null?this.bbox().y:this.move(this.bbox().x,B)},size:function(B,V){var Ge=N(this,B,V);return this.attr("d",this.array().size(Ge.width,Ge.height))},width:function(B){return B==null?this.bbox().width:this.size(B,this.bbox().height)},height:function(B){return B==null?this.bbox().height:this.size(this.bbox().width,B)}},construct:{path:function(B){return this.put(new c.Path).plot(B||new c.PathArray)}}}),c.Image=c.invent({create:"image",inherit:c.Shape,extend:{load:function(B){if(!B)return this;var V=this,Ge=new s.Image;return c.on(Ge,"load",function(){c.off(Ge);var St=V.parent(c.Pattern);St!==null&&(V.width()==0&&V.height()==0&&V.size(Ge.width,Ge.height),St&&St.width()==0&&St.height()==0&&St.size(V.width(),V.height()),typeof V._loaded=="function"&&V._loaded.call(V,{width:Ge.width,height:Ge.height,ratio:Ge.width/Ge.height,url:B}))}),c.on(Ge,"error",function(St){c.off(Ge),typeof V._error=="function"&&V._error.call(V,St)}),this.attr("href",Ge.src=this.src=B,c.xlink)},loaded:function(B){return this._loaded=B,this},error:function(B){return this._error=B,this}},construct:{image:function(B,V,Ge){return this.put(new c.Image).load(B).size(V||0,Ge||V||0)}}}),c.Text=c.invent({create:function(){this.constructor.call(this,c.create("text")),this.dom.leading=new c.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",c.defaults.attrs["font-family"])},inherit:c.Shape,extend:{x:function(B){return B==null?this.attr("x"):this.attr("x",B)},y:function(B){var V=this.attr("y"),Ge=typeof V=="number"?V-this.bbox().y:0;return B==null?typeof V=="number"?V-Ge:V:this.attr("y",typeof B.valueOf()=="number"?B+Ge:B)},cx:function(B){return B==null?this.bbox().cx:this.x(B-this.bbox().width/2)},cy:function(B){return B==null?this.bbox().cy:this.y(B-this.bbox().height/2)},text:function(B){if(typeof B>"u"){for(var B="",V=this.node.childNodes,Ge=0,St=V.length;Ge"u")return this;if(typeof St=="string"||c.Color.isRgb(St)||St&&typeof St.fill=="function")this.attr(B,St);else for(V=y[B].length-1;V>=0;V--)St[y[B][V]]!=null&&this.attr(y.prefix(B,y[B][V]),St[y[B][V]]);return this},c.extend(c.Element,c.FX,Ge)}),c.extend(c.Element,c.FX,{rotate:function(B,V,Ge){return this.transform({rotation:B,cx:V,cy:Ge})},skew:function(B,V,Ge,St){return arguments.length==1||arguments.length==3?this.transform({skew:B,cx:V,cy:Ge}):this.transform({skewX:B,skewY:V,cx:Ge,cy:St})},scale:function(B,V,Ge,St){return arguments.length==1||arguments.length==3?this.transform({scale:B,cx:V,cy:Ge}):this.transform({scaleX:B,scaleY:V,cx:Ge,cy:St})},translate:function(B,V){return this.transform({x:B,y:V})},flip:function(B,V){return V=typeof B=="number"?B:V,this.transform({flip:B||"both",offset:V})},matrix:function(B){return this.attr("transform",new c.Matrix(arguments.length==6?[].slice.call(arguments):B))},opacity:function(B){return this.attr("opacity",B)},dx:function(B){return this.x(new c.Number(B).plus(this instanceof c.FX?0:this.x()),!0)},dy:function(B){return this.y(new c.Number(B).plus(this instanceof c.FX?0:this.y()),!0)},dmove:function(B,V){return this.dx(B).dy(V)}}),c.extend(c.Rect,c.Ellipse,c.Circle,c.Gradient,c.FX,{radius:function(B,V){var Ge=(this._target||this).type;return Ge=="radial"||Ge=="circle"?this.attr("r",new c.Number(B)):this.rx(B).ry(V??B)}}),c.extend(c.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(B){return this.node.getPointAtLength(B)}}),c.extend(c.Parent,c.Text,c.Tspan,c.FX,{font:function(B,V){if(typeof B=="object")for(V in B)this.font(V,B[V]);return B=="leading"?this.leading(V):B=="anchor"?this.attr("text-anchor",V):B=="size"||B=="family"||B=="weight"||B=="stretch"||B=="variant"||B=="style"?this.attr("font-"+B,V):this.attr(B,V)}}),c.Set=c.invent({create:function(B){B instanceof c.Set?this.members=B.members.slice():Array.isArray(B)?this.members=B:this.clear()},extend:{add:function(){var B,V,Ge=[].slice.call(arguments);for(B=0,V=Ge.length;B-1&&this.members.splice(V,1),this},each:function(B){for(var V=0,Ge=this.members.length;V=0},index:function(B){return this.members.indexOf(B)},get:function(B){return this.members[B]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(this.members.length==0)return new c.RBox;var B=this.members[0].rbox(this.members[0].doc());return this.each(function(){B=B.merge(this.rbox(this.doc()))}),B}},construct:{set:function(B){return new c.Set(B)}}}),c.FX.Set=c.invent({create:function(B){this.set=B}}),c.Set.inherit=function(){var B,V=[];for(var B in c.Shape.prototype)typeof c.Shape.prototype[B]=="function"&&typeof c.Set.prototype[B]!="function"&&V.push(B);V.forEach(function(Ge){c.Set.prototype[Ge]=function(){for(var St=0,Dee=this.members.length;St=0;B--)delete this.memory()[arguments[B]];return this},memory:function(){return this._memory||(this._memory={})}}),c.get=function(B){var V=a.getElementById(z(B)||B);return c.adopt(V)},c.select=function(B,V){return new c.Set(c.utils.map((V||a).querySelectorAll(B),function(Ge){return c.adopt(Ge)}))},c.extend(c.Parent,{select:function(B){return c.select(B,this.node)}});function _(B,V,Ge,St){return Ge+St.replace(c.regex.dots," .")}function E(B){for(var V=B.slice(0),Ge=V.length;Ge--;)Array.isArray(V[Ge])&&(V[Ge]=E(V[Ge]));return V}function w(B,V){return B instanceof V}function T(B,V){return(B.matches||B.matchesSelector||B.msMatchesSelector||B.mozMatchesSelector||B.webkitMatchesSelector||B.oMatchesSelector).call(B,V)}function k(B){return B.toLowerCase().replace(/-(.)/g,function(V,Ge){return Ge.toUpperCase()})}function O(B){return B.charAt(0).toUpperCase()+B.slice(1)}function R(B){return B.length==4?["#",B.substring(1,2),B.substring(1,2),B.substring(2,3),B.substring(2,3),B.substring(3,4),B.substring(3,4)].join(""):B}function M(B){var V=B.toString(16);return V.length==1?"0"+V:V}function N(B,V,Ge){if(V==null||Ge==null){var St=B.bbox();V==null?V=St.width/St.height*Ge:Ge==null&&(Ge=St.height/St.width*V)}return{width:V,height:Ge}}function D(B,V,Ge){return{x:V*B.a+Ge*B.c+0,y:V*B.b+Ge*B.d+0}}function P(B){return{a:B[0],b:B[1],c:B[2],d:B[3],e:B[4],f:B[5]}}function I(B){return B instanceof c.Matrix||(B=new c.Matrix(B)),B}function L(B,V){B.cx=B.cx==null?V.bbox().cx:B.cx,B.cy=B.cy==null?V.bbox().cy:B.cy}function F(B){for(var V=0,Ge=B.length,St="";V=0;V--)B.childNodes[V]instanceof s.SVGElement&&U(B.childNodes[V]);return c.adopt(B).id(c.eid(B.nodeName))}function J(B){return B.x==null&&(B.x=0,B.y=0,B.width=0,B.height=0),B.w=B.width,B.h=B.height,B.x2=B.x+B.width,B.y2=B.y+B.height,B.cx=B.x+B.width/2,B.cy=B.y+B.height/2,B}function z(B){var V=(B||"").toString().match(c.regex.reference);if(V)return V[1]}function ie(B){return Math.abs(B)>1e-37?B:0}var ce="abcdef".split("");if(typeof s.CustomEvent!="function"){var Y=function(B,V){V=V||{bubbles:!1,cancelable:!1,detail:void 0};var Ge=a.createEvent("CustomEvent");return Ge.initCustomEvent(B,V.bubbles,V.cancelable,V.detail),Ge};Y.prototype=s.Event.prototype,c.CustomEvent=Y}else c.CustomEvent=s.CustomEvent;return function(B){for(var V=0,Ge=["moz","webkit"],St=0;St{const c={name:a,image:l,svgcode:""};return o(l).then(u=>{c.svgcode=u}),c})}listToIconSymbology(o){return this.listToSymbology(this.renderSymbologyIcon,o)}listToImageSymbology(o){return this.listToSymbology(this.renderSymbologyImage,o)}async renderSymbologyImage(o,s=null){s===null&&(s=td$1(document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,0,0));const a=await this.$iApi.geo.shared.convertImagetoDataURL(o);if(a===o)return"";const{loader:l}=await this.svgDrawImage(s,a);return s.viewbox(0,0,l.width,l.height),s.svg()}async renderSymbologyIcon(o,s=null){if(s===null){const c=document.createElement("div");c.setAttribute("style","opacity:0;position:fixed;left:100%;top:100%;overflow:hidden"),document.body.appendChild(c),s=td$1(c).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE)}const a=await this.$iApi.geo.shared.convertImagetoDataURL(o),{image:l}=await this.svgDrawImage(s,a);return l.center(this.CONTAINER_CENTER,this.CONTAINER_CENTER),this.fitInto(l,this.CONTENT_IMAGE_SIZE),s.svg()}generatePlaceholderSymbology(o,s="#000"){const a=td$1(document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE);return a.rect(this.CONTENT_IMAGE_SIZE,this.CONTENT_IMAGE_SIZE).center(this.CONTAINER_CENTER,this.CONTAINER_CENTER).fill(s),a.text(o[0].toUpperCase()).size(23).fill("#fff").attr({"font-weight":"bold","font-family":"Roboto"}).center(this.CONTAINER_CENTER,this.CONTAINER_CENTER).tspan(o[0].toUpperCase()).addClass("grid-icons").attr({dy:"29.900000000000002",x:"7.6875"}),{name:o,svgcode:a.svg()}}async generateBlankSymbology(){return td$1(document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).svg()}async symbolToSvg(o){const s=this,a=1.33333,l=document.createElement("div");l.setAttribute("style","opacity:0;position:fixed;left:100%;top:100%;overflow:hidden"),document.body.appendChild(l);const c=td$1(l).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE),u={path({size:T,path:k}){return c.path(k).size(T*a)},circle({size:T}){return c.circle(T*a)},cross({size:T}){return c.path("M 0,10 L 20,10 M 10,0 L 10,20").size(T*a)},x({size:T}){return c.path("M 0,0 L 20,20 M 20,0 L 0,20").size(T*a)},triangle({size:T}){return c.path("M 20,20 L 10,0 0,20 Z").size(T*a)},diamond({size:T}){return c.path("M 20,10 L 10,0 0,10 10,20 Z").size(T*a)},square({size:T}){return c.path("M 0,0 20,0 20,20 0,20 Z").size(T*a)}},d={[Ur$2.SOLID]:"none",[Ur$2.NONE]:"none",[Ur$2.DASH]:"5.333,4",[Ur$2.DOT]:"1.333,4",[Ur$2.DASHDOT]:"5.333,4,1.333,4",[Ur$2.LONGDASH]:"10.666,4",[Ur$2.LONGDASHDOT]:"10.666,4,1.333,4",[Ur$2.LONGDASHDOTDOT]:"10.666,4,1.333,4,1.333,4",[Ur$2.SHORTDOT]:"1.333,1.333",[Ur$2.SHORTDASH]:"5.333,1.333",[Ur$2.SHORTDASHDOT]:"5.333,1.333,1.333,1.333",[Ur$2.SHORTDASHDOTDOT]:"5.333,1.333,1.333,1.333,1.333,1.333"},m={color:"#000",opacity:1,width:1,linecap:"square",linejoin:"miter",miterlimit:4},g={color:[0,0,0,0],width:0,style:d.none},y={solid:T=>({color:T.colour,opacity:T.opacity}),none:()=>"transparent",horizontal:(T,k)=>c.pattern(5,5,O=>O.line(0,5/2,5,5/2)).stroke(k),vertical:(T,k)=>c.pattern(5,5,O=>O.line(5/2,0,5/2,5)).stroke(k),"forward-diagonal":(T,k)=>c.pattern(5,5,O=>{O.line(0,0,5,5).stroke(k),O.line(0,0,5,5).move(0,5).stroke(k),O.line(0,0,5,5).move(5,0).stroke(k)}),"backward-diagonal":(T,k)=>c.pattern(5,5,O=>{O.line(5,0,0,5).stroke(k),O.line(5,0,0,5).move(5/2,5/2).stroke(k),O.line(5,0,0,5).move(-5/2,-5/2).stroke(k)}),cross:(T,k)=>c.pattern(5,5,O=>{O.line(5/2,0,5/2,5).stroke(k),O.line(0,5/2,5,5/2).stroke(k)}),"diagonal-cross":(T,k)=>c.pattern(7,7,O=>{O.line(0,0,7,7).stroke(k),O.line(7,0,0,7).stroke(k)})},_={"simple-marker"(){const T=w(o.color);o.outline=o.outline||g;const k=w(o.outline.color),O=E({color:k.colour,opacity:k.opacity,width:o.outline.width,dasharray:d[o.outline.style]}),R=u[o.style](o).fill({color:T.colour,opacity:T.opacity}).stroke(O).center(s.CONTAINER_CENTER,s.CONTAINER_CENTER).rotate(o.angle||0);s.fitInto(R,s.CONTENT_SIZE)},"simple-line"(){const T=w(o.color),k=E({color:T.colour,opacity:T.opacity,width:o.width,linecap:"butt",dasharray:d[o.style]}),O=s.CONTENT_PADDING,R=s.CONTAINER_SIZE-s.CONTENT_PADDING;c.line(O,O,R,R).stroke(k)},esriCLS(){this["simple-line"]()},"simple-fill"(){const T=w(o.color),k=E({color:T.colour,opacity:T.opacity}),O=y[o.style](T,k);o.outline=o.outline||g;const R=w(o.outline.color),M=E({color:R.colour,opacity:R.opacity,width:o.outline.width,linecap:"butt",dasharray:d[o.outline.style]});c.rect(s.CONTENT_SIZE,s.CONTENT_SIZE).center(s.CONTAINER_CENTER,s.CONTAINER_CENTER).fill(O).stroke(M)},text(){console.error("no support for feature service legend of text symbols")},"picture-fill"(){const T=o.imageData?`data:${o.contentType};base64,${o.imageData}`:o.url,k=o.width*o.xscale,O=o.height*o.yscale;o.outline=o.outline||g;const R=w(o.outline.color),M=E({color:R.colour,opacity:R.opacity,width:o.outline.width,dasharray:d[o.outline.style]});return s.$iApi.geo.shared.convertImagetoDataURL(T).then(N=>{const D=c.pattern(k,O,P=>P.image(N,k,O));c.rect(s.CONTENT_SIZE,s.CONTENT_SIZE).center(s.CONTAINER_CENTER,s.CONTAINER_CENTER).fill(D).stroke(M)})},"picture-marker"(){const T=o.source,k=T&&T.imageData?`data:${T.contentType};base64,${T.imageData}`:o.url;return s.$iApi.geo.shared.convertImagetoDataURL(k).then(O=>s.svgDrawImage(c,O)).then(({image:O})=>{O.center(s.CONTAINER_CENTER,s.CONTAINER_CENTER).rotate(o.angle||0),s.fitInto(O,s.CONTENT_IMAGE_SIZE)})}};try{return await Promise.resolve(_[o.type]()),document.body.removeChild(l),c.svg()}catch(T){return console.error(T),this.generateBlankSymbology()}function E(T){return Object.assign({},m,T)}function w(T){return T?{colour:`rgb(${T.r},${T.g},${T.b})`,opacity:T.a}:{colour:"rgb(0, 0, 0)",opacity:0}}}async svgDrawImage(o,s,a=0,l=0,c=!0){return new Promise((u,d)=>{const m=o.image(s,a,l,c).loaded(g=>u({image:m,loader:g})).error(g=>{d(g),console.error(g)})})}fitInto(o,s){const a=o.node.getBoundingClientRect(),l=s/Math.max(a.width,a.height);l<1&&o.scale(l)}rendererToLegend(o){let s;const a=o.symbolUnits.slice(0);if(o.defaultUnit&&a.push(o.defaultUnit),o.falseRenderer)s=a.map(l=>[l]);else{const l=new Map;a.forEach(c=>{const u=l.get(c.label);u?u.push(c):l.set(c.label,[c])}),s=[],l.forEach(c=>s.push(c))}return s.map(l=>{const c=l[0],u={uid:this.$iApi.geo.shared.generateUUID(),label:c.label||"",definitionClause:l.length===1?c.definitionClause:`(${l.map(d=>d.definitionClause).join(" OR ")})`,svgcode:"",esriStandard:!0,visibility:!0,lastVisbility:!0,drawPromise:this.symbolToSvg(c.symbol).then(d=>{u.svgcode=d,l.forEach(m=>{m.svgCode=d})})};return u})}async getMapServerLegend(o){if(!o)throw new Error("Legend server request is missing the required url.");const s={query:{f:"json"}},a={layers:[]},[l,c]=await Wl$2(fn$2(`${o}/legend`,s));return c?c.data?c.data:(console.error(`Error loading legend data for ${o}`),a):(console.error(`Error loading legend for ${o}`,l),a)}async mapServerLegendToRenderer(o,s){const a=o.layers.find(c=>c.layerId===s);let l;if(typeof a<"u"){l={type:"uniqueValue",field:"fakefield",uniqueValueInfos:a.legend.map(u=>({label:u.label,value:u.label,symbol:{type:"esriPMS",imageData:u.imageData,contentType:u.contentType}}))};const c=await Pe.RendererFromJson(l);return this.makeRenderer(c,[],!0)}else throw new Error("attempted to make renderer from non-existing legend data")}async mapServerLegendToRendererAll(o){const s=o.layers.map(c=>c.legend.map(u=>({label:u.label,value:u.label,symbol:{type:"esriPMS",imageData:u.imageData,contentType:u.contentType}}))),a={type:"uniqueValue",field1:"fakefield",uniqueValueInfos:[].concat(...s)},l=await Pe.RendererFromJson(a);return this.makeRenderer(l,[],!0)}async mapServerToLocalLegend(o,s=void 0){const a=await this.getMapServerLegend(o);let l,c;return typeof s>"u"?(c=0,l=await this.mapServerLegendToRendererAll(a)):(c=parseInt(s),l=await this.mapServerLegendToRenderer(a,c)),this.rendererToLegend(l)}}class Zyt extends Tn$2{constructor(o){super(o)}async arcGisServerQueryIds(o){if(!(o.filterGeometry||o.filterSql))return console.error("arcGisServerQueryIds called without any filter"),[];const s=await Pe.Query();s.returnGeometry=!1,o.filterSql&&(s.where=o.filterSql),o.filterGeometry&&(s.geometry=await this.queryGeometryHelper(o.filterGeometry,!1,this.$iApi.geo.map.getScale(),o.sourceSR),s.spatialRelationship="intersects");const a=await Pe.QueryByIds(o.url,s);return Array.isArray(a)?a:[]}async geoJsonQuery(o){const s=await Pe.Query();if(s.returnGeometry=!!o.includeGeometry,s.outFields=["*"],o.filterGeometry&&(s.geometry=await this.queryGeometryHelper(o.filterGeometry,!0),s.spatialRelationship="intersects"),o.filterSql&&(s.where=o.filterSql),o.filterOIDs&&(s.objectIds=o.filterOIDs),await o.layer.loadPromise(),!o.layer.esriLayer)throw new Error("file layer being queried contains no ESRI layer");return(await o.layer.esriLayer.queryFeatures(s)).features.map((a,l)=>{let c;return s.returnGeometry?c=this.$iApi.geo.geom.geomEsriToRamp(a.geometry,`queryResult${l}`):c=new al$2,new Si$1(c,"",a.attributes)})}async queryGeometryHelper(o,s,a,l){return!s&&o.type===qt$2.EXTENT&&l&&!l.isEqual(o.sr)&&!(a&&a>2e7&&o.sr.wkid===3978&&l.wkid===4326)?(await this.$iApi.geo.proj.projectExtent(l,o)).toESRI():o.toESRI()}makeClickBuffer(o,s=5){const a=this.$iApi.geo.map,l=a.getExtent(),c=s*(l.xmax-l.xmin)/a.getPixelWidth();return new tn$2("ze_buffer",[o.x-c,o.y-c],[o.x+c,o.y+c],o.sr)}}class Qyt extends Tn$2{attributes;geom;layer;map;proj;query;shared;symbology;constructor(o){super(o),this.geom=Ou$2.geom,this.proj=Ou$2.proj,this.shared=Ou$2.sharedUtils,this.map=new X0t(o),this.layer=new Syt(o),this.attributes=new $yt(o),this.query=new Zyt(o),this.symbology=new qyt(o),Array.isArray(Ce$1.request.interceptors)||(Ce$1.request.interceptors=[]),Ce$1.request.interceptors.push({before:s=>{s.url.includes("?blankTile=false")&&(s.url=s.url.replace("?blankTile=false","?blankTile=true"))}})}set proxy(o){Ce$1.request.proxyUrl=o}get proxy(){return Ce$1.request.proxyUrl||""}}const Kyt=Object.assign({"../fixtures/appbar/index.ts":()=>__vitePreload(()=>import("./index-Bo-4afBP-Lk4ytFSu.js"),[],import.meta.url),"../fixtures/areas-of-interest/index.ts":()=>__vitePreload(()=>import("./index-DDW2D8Uj-BjwR1abY.js"),__vite__mapDeps([186,187]),import.meta.url),"../fixtures/basemap/index.ts":()=>__vitePreload(()=>import("./index-ChMe1Rap-BNV_tYQB.js"),[],import.meta.url),"../fixtures/crosshairs/index.ts":()=>__vitePreload(()=>import("./index-I3HFsMjx-CG5Sm96R.js"),[],import.meta.url),"../fixtures/details/index.ts":()=>__vitePreload(()=>import("./index-DmuJEjwc-CDkpM4Gs.js"),__vite__mapDeps([188,189]),import.meta.url),"../fixtures/export-footnote/index.ts":()=>__vitePreload(()=>import("./index-CWPzg1w2-BKAJsH0v.js"),__vite__mapDeps([190,191]),import.meta.url),"../fixtures/export-legend/index.ts":()=>__vitePreload(()=>import("./index-DLWeBByc-lUlQN2kJ.js"),__vite__mapDeps([192,191]),import.meta.url),"../fixtures/export-map/index.ts":()=>__vitePreload(()=>import("./index--i98kM5n-ftbcqF2Z.js"),__vite__mapDeps([193,191]),import.meta.url),"../fixtures/export-northarrow/index.ts":()=>__vitePreload(()=>import("./index-98it_ulG-wSo8snBa.js"),__vite__mapDeps([194,191]),import.meta.url),"../fixtures/export-scalebar/index.ts":()=>__vitePreload(()=>import("./index-7blUq_oP-BarAXEha.js"),__vite__mapDeps([195,191]),import.meta.url),"../fixtures/export-timestamp/index.ts":()=>__vitePreload(()=>import("./index-B0lfXXMz-DzFhF9zr.js"),__vite__mapDeps([196,191]),import.meta.url),"../fixtures/export-title/index.ts":()=>__vitePreload(()=>import("./index-DY4XJa1m-BzpaGS2E.js"),__vite__mapDeps([197,191]),import.meta.url),"../fixtures/export/index.ts":()=>__vitePreload(()=>import("./index-BSr9u_6r-Dy8QdhWp.js"),__vite__mapDeps([198,199]),import.meta.url),"../fixtures/extentguard/index.ts":()=>__vitePreload(()=>import("./index-CfINOE3J-Dlc8hOFR.js"),[],import.meta.url),"../fixtures/gazebo/index.ts":()=>__vitePreload(()=>import("./index-DxH-DOHz-C6kQPUJT.js"),[],import.meta.url),"../fixtures/geosearch/index.ts":()=>__vitePreload(()=>import("./index-CDhNyq-A-B2KtZCFy.js"),[],import.meta.url),"../fixtures/grid/index.ts":()=>__vitePreload(()=>import("./index-BCHMro24-DSRXjkAB.js"),__vite__mapDeps([200,201]),import.meta.url),"../fixtures/help/index.ts":()=>__vitePreload(()=>import("./index-BAU9PUzR-CeCoKAoi.js"),[],import.meta.url),"../fixtures/hilight/index.ts":()=>__vitePreload(()=>import("./index-CRabsHaP-BibU_USN.js"),__vite__mapDeps([202,189]),import.meta.url),"../fixtures/layer-reorder/index.ts":()=>__vitePreload(()=>import("./index-DfBq89c3-MDA3Qpqd.js"),[],import.meta.url),"../fixtures/legend/index.ts":()=>__vitePreload(()=>import("./index-DMxHNnSm-DUAhihws.js"),[],import.meta.url),"../fixtures/mapnav/index.ts":()=>__vitePreload(()=>import("./index-sFd78-sx-DDv34NyC.js"),[],import.meta.url),"../fixtures/metadata/index.ts":()=>__vitePreload(()=>import("./index-CMEOtVDx-DFb8p2Q0.js"),[],import.meta.url),"../fixtures/northarrow/index.ts":()=>__vitePreload(()=>import("./index-5nGe0Bgx-CtG6tTZq.js"),[],import.meta.url),"../fixtures/overviewmap/index.ts":()=>__vitePreload(()=>import("./index-CuDicHX--BC1E38-6.js"),[],import.meta.url),"../fixtures/panguard/index.ts":()=>__vitePreload(()=>import("./index-DH-yVcMF-CZH029EB.js"),[],import.meta.url),"../fixtures/scrollguard/index.ts":()=>__vitePreload(()=>import("./index-Czft7XuG-pRfu2ETS.js"),[],import.meta.url),"../fixtures/settings/index.ts":()=>__vitePreload(()=>import("./index-WLSkOrf3-BPXETI0x.js"),[],import.meta.url),"../fixtures/snowman/index.ts":()=>__vitePreload(()=>import("./index-DRrktYRZ-CXeJFIAZ.js"),[],import.meta.url),"../fixtures/wizard/index.ts":()=>__vitePreload(()=>import("./index-CobT58Py-B6-BeYc6.js"),[],import.meta.url)});class tgt extends Tn$2{constructor(o){super(o)}exists(o){return o in Ji$2(this.$vApp.$pinia).items}async add(o,s){let a;if(o in Ji$2(this.$vApp.$pinia).items)return this.get(o);if(s){if(typeof s!="function")throw new Error("malformed fixture constructor");a=Fb$2.updateBaseToInstance(new s,o,this.$iApi)}else{const l=(await Kyt[`../fixtures/${o}/index.ts`]()).default;a=new l(o,this.$iApi)}return Ji$2(this.$vApp.$pinia).addFixture(a),this.$iApi.event.emit(Mt$2.FIXTURE_ADDED,a),this.$iApi.geo.map.created&&a.initialized?.(),a}remove(o){const s=this.get(o);if(!s)throw new Error(`Could not find fixture ${o} for removal`);return Ji$2(this.$vApp.$pinia).removeFixture(s),this.$iApi.event.emit(Mt$2.FIXTURE_REMOVED,s),s}flush(){const o=Ji$2(this.$vApp.$pinia);Object.keys(o.items).forEach(s=>{const a=this.get(s);a?.persist&&typeof a?.removed=="function"?a.removed():a&&this.remove(s)})}restore(){const o=Ji$2(this.$vApp.$pinia);Object.keys(o.items).forEach(s=>{const a=o.items[s];typeof a.added=="function"&&a.added(),this.$iApi.geo.map.created&&typeof a.initialized=="function"&&a.initialized()})}get(o){const s=[];typeof o=="string"?s.push(o):Array.isArray(o)?s.push(...o):s.push(o.id);const a=s.map(l=>{const c=Ji$2(this.$vApp.$pinia).items[l];if(c)return c});return a.length===1?a[0]:a}isLoaded(o){const s=Ji$2(this.$vApp.$pinia),a=Array.isArray(o)?o:[o];a.forEach(c=>{s.loadPromises[c]===void 0&&s.addLoadPromise(c)});const l=s.getLoadPromises(a);return Array.isArray(o)?Promise.all(l):l[0]}addDefaultFixtures(o){(!Array.isArray(o)||o.length===0)&&(o=["appbar","basemap","crosshairs","details","geosearch","grid","help","hilight","layer-reorder","legend","mapnav","northarrow","overviewmap","panguard","scrollguard","settings","wizard"]);const s=Dr$2(this.$vApp.$pinia);return s.startingFixtures=o,Promise.all(o.map(a=>this.add(a)))}}let Fb$2=class _ie extends Tn$2{static updateBaseToInstance(o,s,a){const l=new _ie(s,a);return Object.defineProperties(o,{id:{value:s},$iApi:{value:a},persist:{value:o.persist??!0},$vApp:{get(){return l.$vApp}},remove:{value:l.remove},extend:{value:l.extend},config:{get(){return l.config}},mount:{value:l.mount}}),o}id;persist;constructor(o,s){super(s),this.id=o,this.persist=!0}remove(){return this.$iApi.fixture.remove(this),this}extend(o,s={}){const a=ne$1({extends:o,iApi:this.$iApi,data(){return{...s}}}),l=Ml$1(a),{el:c}=this.mount(a,{props:{...s.propsData},app:l});return c}mount(o,{props:s,children:a,element:l,app:c}={}){let u=l,d=vi$1(o,s,a);return c&&c._context&&(d.appContext=c._context),u?ou$2(d,u):ou$2(d,u=document.createElement("div")),{vNode:d,destroy:()=>{u&&ou$2(null,u),u=null,d=null},el:u}}get config(){return Dr$2(this.$vApp.$pinia).config.fixtures[this.id]}getLayerFixtureConfig(o){return this.getLayerFixtureConfigs()[o]}getLayerFixtureConfigs(){const o={},s=(a,l=void 0)=>{if(a.fixtures&&a.fixtures[this.id]!==void 0){let c=a.id;l!==void 0&&(c=`${l.id}-${a.index}`),o[c]=a.fixtures[this.id]}a.sublayers&&a.sublayers.forEach(c=>s(c,a))};return this.$iApi.geo.layer.allLayers().forEach(a=>s(a.config)),o}handlePanelWidths(o){if(this.config?.panelWidth){const s={};typeof this.config?.panelWidth=="number"&&(this.config.panelWidth={default:this.config?.panelWidth}),this.config.panelWidth.default&&o.forEach(a=>{s[a]=this.config.panelWidth.default});for(const a in this.config.panelWidth)a!="default"&&(s[a]=this.config.panelWidth[a]);for(const a in s){const l=this.$iApi.panel.get(a);this.$iApi.panel.setStyle(l,{"flex-basis":`${s[a]}px`})}}}handlePanelTeleports(o){if(this.config?.panelTeleport){const s=Ul$2(this.$vApp.$pinia),a=!!this.config.panelTeleport.target;o.forEach(l=>{s.items[l].teleport=a?this.config.panelTeleport:this.config.panelTeleport[l],s.items[l].style.width="100%"})}}};class egt extends Tn$2{panelStore=Ul$2(this.$vApp.$pinia);updateHTML(o,s,a){const l=this.get(o),c=a?l.screens[a]:Object.values(l.screens)[0];if(bk$2(c))for(const u in s)c[u].innerHTML=s[u]instanceof HTMLElement?s[u].outerHTML:s[u];else console.error("Screen must be an HTML object")}registerHTMLConfig(o){for(const a in o.content)if(typeof o.content[a]=="string"){const l=document.createElement("div");l.innerHTML=o.content[a],o.content[a]=l}const s={};return s[o.id]={screens:{},style:o.style??{width:"350px"},alertName:o.alertName},s[o.id].screens[o.id]=o.content,s}registerHTML(o){const s=this.get(o.id);if(s)return console.error("panel already exist"),s;const a=this.registerHTMLConfig(o);return this.register(a,o.options)}register(o,s){const a=ngt$1(o)?{[o.id]:o.config}:o;if(s){const c=s.i18n||{},u=this.$iApi.$i18n;Object.entries(c.messages||{}).forEach(d=>u.mergeLocaleMessage(...d)),Object.entries(c.dateTimeFormats||{}).forEach(d=>u.mergeDateTimeFormat(...d)),Object.entries(c.numberFormats||{}).forEach(d=>u.mergeNumberFormat(...d))}const l=Object.entries(a).reduce((c,[u,d])=>(c.push(new h0$2(this.$iApi,u,d)),c),[]);return l.forEach(c=>this.panelStore.registerPanel(c)),l.length===1?l[0]:l.reduce((c,u)=>(c[u.id]=u,c),{})}async isRegistered(o){const s=Array.isArray(o)?o:[o];s.forEach(l=>{this.panelStore.regPromises[l]===void 0&&this.panelStore.addRegPromise(l)});const a=this.panelStore.getRegPromises(s);return Array.isArray(o)?Promise.all(a):a[0]}remove(o){const s=this.get(o);s&&(s.isOpen&&this.close(s),this.panelStore.removePanel(s))}get(o){const s=typeof o=="string"?o:o.id;return this.panelStore.items[s]}open(o){let s,a,l;if(typeof o=="string"||o instanceof h0$2?s=this.get(o):(s=this.get(o.id),{screen:a,props:l}=o),!s)return s;if(s.isOpen&&!s.isVisible)s.minimize();else if(s.isOpen)return s;return a||(s.route&&!l?{screen:a,props:l}=s.route:a=Object.keys(s.screens).pop()),this.show(s,{screen:a,props:l})?(this.panelStore.openPanel(s),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.open",{name:s.alertName?this.$iApi.$i18n.t(s.alertName):s.id})),this.$iApi.event.emit(Mt$2.PANEL_OPENED,s)):console.error(`Failed to open ${s.id} panel.`),s}get opened(){return this.panelStore.orderedItems.concat(this.panelStore.teleported)}get visible(){return this.panelStore.visible.concat(this.panelStore.teleported)}close(o){const s=this.get(o);return s&&(s.isPinned&&s.pin(!1),this.panelStore.closePanel(s),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.close",{name:s.alertName?this.$iApi.$i18n.t(s.alertName):s.id})),this.$iApi.event.emit(Mt$2.PANEL_CLOSED,s),s)}minimize(o){const s=this.get(o);return s&&(s.isPinned&&s.pin(!1),this.panelStore.closePanel(s),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.minimize",{name:s.alertName?this.$iApi.$i18n.t(s.alertName):s.id})),this.$iApi.event.emit(Mt$2.PANEL_MINIMIZED,s),s)}move(o,s){const a=this.get(o);return a&&(this.panelStore.movePanel(a,s),a)}toggle(o,s){let a;return typeof o=="string"||o instanceof h0$2?a=this.get(o):a=this.get(o.id),a&&(s=typeof s<"u"?s:!a.isVisible,s!==a.isVisible&&(s?this.open(o):this.close(a)),a)}toggleMinimize(o,s){let a;return typeof o=="string"||o instanceof h0$2?a=this.get(o):a=this.get(o.id),a&&(s=typeof s<"u"?s:!a.isVisible,s!==a.isVisible&&(s?this.open(a):this.minimize(a)),a)}pin(o,s){const a=this.get(o);return!a||(s=typeof s<"u"?s:!a.isPinned,!a.isPinned&&!s)||(this.panelStore.pinned=s?a:void 0),a}get pinned(){return this.panelStore.pinned||void 0}show(o,s){const a=this.get(o);if(!a)return a;if(a.screens[s.screen]){if(a.screens[s.screen]?.props){const l=Object.keys(a.screens[s.screen]?.props).filter(u=>u!=="panel"),c=s.props?Object.keys(s.props):[];for(let u=0;uo[0]||(o[0]=[lt$3("div",{class:"loader"},null,-1)])),_:1})}const sgt=fo$2(rgt,[["render",igt],["__scopeId","data-v-a3c61802"]]),ogt$1=Object.assign({"../fixtures/areas-of-interest/screen.vue":()=>__vitePreload(()=>import("./screen-bYjBkDBU-DX1BIa_V.js"),[],import.meta.url),"../fixtures/basemap/screen.vue":()=>__vitePreload(()=>import("./screen-CcinMdyM-DogH0BTu.js"),[],import.meta.url),"../fixtures/export/screen.vue":()=>__vitePreload(()=>import("./screen-CmNk4p3g-TP4639ra.js"),[],import.meta.url),"../fixtures/geosearch/screen.vue":()=>__vitePreload(()=>import("./screen-oq2ZVtwf-DpZgdQz_.js"),[],import.meta.url),"../fixtures/grid/screen.vue":()=>__vitePreload(()=>import("./screen-DOMT-YVI-BLHSGxaA.js"),__vite__mapDeps([203,201]),import.meta.url),"../fixtures/help/screen.vue":()=>__vitePreload(()=>import("./screen-x-yg_fPu-jgspjjII.js"),__vite__mapDeps([204,205]),import.meta.url),"../fixtures/layer-reorder/screen.vue":()=>__vitePreload(()=>import("./screen-N-CoZlcH-BOOrXpPL.js"),__vite__mapDeps([206,207]),import.meta.url),"../fixtures/legend/screen.vue":()=>__vitePreload(()=>import("./screen-DTrOvIb7-BGa_mWMv.js"),[],import.meta.url),"../fixtures/metadata/screen.vue":()=>__vitePreload(()=>import("./screen-D-fcMt_1-YQxyJ36o.js"),__vite__mapDeps([208,205]),import.meta.url),"../fixtures/settings/screen.vue":()=>__vitePreload(()=>import("./screen-BGsID61t-RVI9ARar.js"),__vite__mapDeps([209,207,210]),import.meta.url),"../fixtures/wizard/screen.vue":()=>__vitePreload(()=>import("./screen-NGXXpKUs-Gl0YtMtY.js"),__vite__mapDeps([211,207]),import.meta.url)});let h0$2=class extends Tn$2{id;screens;loadedScreens=[];alertName;teleport;controls;button;isScreenLoaded(o){return this.loadedScreens.indexOf(o)!==-1}registerScreen(o){const s=this.screens[o];let a;if(qnt(s)||Jnt(s))a=s,this.loadedScreens.push(o);else if(bk$2(s))a={template:` - `};else{let l;typeof s=="string"?l=ogt$1[`../fixtures/${s}`]():l=s();const c=new Promise((u,d)=>{l.then(m=>{this.loadedScreens.push(o),u(Znt(m)?m.default:m)}),l.catch(m=>d(m))});a=G1$2({loader:()=>c,loadingComponent:sgt,delay:200})}this.$iApi.$element.component(o,a)}style;expanded;get width(){if(!(!this.style.width||this.style.width.slice(-2)!=="px"))return parseInt(this.style.width)}route;constructor(o,s,a){if(super(o),{id:this.id,screens:this.screens,style:this.style,expanded:this.expanded,alertName:this.alertName,button:this.button,controls:this.controls}={id:s,style:{},expanded:!1,controls:{expand:!1,...a.controls},...a},Object.keys(this.screens).length===0)throw new Error("panel must have at least a single screen");this.route={screen:Object.keys(this.screens).pop()},this.style["flex-basis"]||(this.style["flex-basis"]=this.style.width||"350px"),this.style.width="80%"}open(o){return typeof o>"u"?this.$iApi.panel.open(this):this.$iApi.panel.open({id:this.id,...typeof o=="string"?{screen:o}:o}),this}get isOpen(){return this.$iApi.panel.opened.indexOf(this)!==-1}get isVisible(){return this.$iApi.panel.visible.indexOf(this)!==-1}close(){return this.$iApi.panel.close(this),this}minimize(){return this.$iApi.panel.minimize(this),this}move(o){return this.$iApi.panel.move(this,o),this}get isLeftMostPanel(){if(this.$iApi.panel.visible.length>0){for(const o of this.$iApi.panel.visible)if(!o.teleport)return this.id===o.id}return!1}get isRightMostPanel(){if(this.$iApi.panel.visible.length>0){for(let o=this.$iApi.panel.visible.length-1;o>=0;o--)if(!this.$iApi.panel.visible[o].teleport)return this.id===this.$iApi.panel.visible[o].id}return!1}remove(){return this.$iApi.panel.remove(this),this}toggle(o){return typeof o>"u"?this.$iApi.panel.toggle(this,!this.isOpen):typeof o=="boolean"?o!==this.isOpen&&this.$iApi.panel.toggle(this,o):this.$iApi.panel.toggle({id:this.id,screen:o.screen,props:o.props},typeof o.toggle<"u"?o.toggle:!this.isOpen),this}toggleMinimize(o){return typeof o>"u"||typeof o=="boolean"?this.$iApi.panel.toggleMinimize(this,o):this.$iApi.panel.toggleMinimize({id:this.id,screen:o.screen,props:o.props},typeof o.toggle<"u"?o.toggle:!this.isOpen),this}pin(o){return o=typeof o<"u"?o:!this.isPinned,this.$iApi.panel.pin(this,o),this}get isPinned(){return!!this.$iApi.panel.pinned&&this.$iApi.panel.pinned.id===this.id}show(o){const s=typeof o=="string"?{screen:o}:o;return this.route=s,this.$iApi.panel.show(this,s),this}setStyles(o,s=!1){return this.$iApi.panel.setStyle(this,o,s),this}expand(o){return this.$iApi.panel.expand(this,o),this}};var nd$1={major:"4",minor:"10",patch:"2",timestamp:"Fri Jan 3 11:01:45 2025 -0500",hash:"fa0f10c999815c2d04c2a2995ad908a1a183631b"};console.info(`RAMP v${nd$1.major}.${nd$1.minor}.${nd$1.patch} [${nd$1.hash.slice(0,9)}] (Built on ${new Date(nd$1.timestamp.toString()).toLocaleString()})`);const rd$2=nd$1,ygt=(r,o,s)=>new V0t(r,o,s),Ou$2=new Ynt;/** -* @vue/shared v3.4.37 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function U_$1(r,o){const s=new Set(r.split(","));return a=>s.has(a)}const Lg$1=()=>{},of$1=Object.assign,j_$1=Object.prototype.hasOwnProperty,Wl$1=(r,o)=>j_$1.call(r,o),xo$1=Array.isArray,Ms$1=r=>Pg$1(r)==="[object Map]",sf$1=r=>typeof r=="function",B_$1=r=>typeof r=="string",Ta$1=r=>typeof r=="symbol",xa$1=r=>r!==null&&typeof r=="object",H_$1=Object.prototype.toString,Pg$1=r=>H_$1.call(r),Rg$1=r=>Pg$1(r).slice(8,-1),af$2=r=>B_$1(r)&&r!=="NaN"&&r[0]!=="-"&&""+parseInt(r,10)===r,gs$1=(r,o)=>!Object.is(r,o),K_$1=(r,o,s,a=!1)=>{Object.defineProperty(r,o,{configurable:!0,enumerable:!1,writable:a,value:s})};let $n$1,Cc$1=class{constructor(o=!1){this.detached=o,this._active=!0,this.effects=[],this.cleanups=[],this.parent=$n$1,!o&&$n$1&&(this.index=($n$1.scopes||($n$1.scopes=[])).push(this)-1)}get active(){return this._active}run(o){if(this._active){const s=$n$1;try{return $n$1=this,o()}finally{$n$1=s}}}on(){$n$1=this}off(){$n$1=this.parent}stop(o){if(this._active){let s,a;for(s=0,a=this.effects.length;s=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),ro$1()}return this._dirtyLevel>=4}set dirty(o){this._dirtyLevel=o?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let o=wo$1,s=ii$2;try{return wo$1=!0,ii$2=this,this._runnings++,Qp$1(this),this.fn()}finally{qp$1(this),this._runnings--,ii$2=s,wo$1=o}}stop(){this.active&&(Qp$1(this),qp$1(this),this.onStop&&this.onStop(),this.active=!1)}};function Y_$1(r){return r.value}function Qp$1(r){r._trackId++,r._depsLength=0}function qp$1(r){if(r.deps.length>r._depsLength){for(let o=r._depsLength;o{s.dirty&&s.run()});o&&(of$1(s,o),o.scope&&Mg$1(s,o.scope)),(!o||!o.lazy)&&s.run();const a=s.run.bind(s);return a.effect=s,a}function Fg$1(r){r.effect.stop()}let wo$1=!0,Ju$1=0;const Ug$1=[];function no$1(){Ug$1.push(wo$1),wo$1=!1}function ro$1(){const r=Ug$1.pop();wo$1=r===void 0?!0:r}function cf$1(){Ju$1++}function uf$1(){for(Ju$1--;!Ju$1&&Qu$1.length;)Qu$1.shift()()}function jg$1(r,o,s){if(o.get(r)!==r._trackId){o.set(r,r._trackId);const a=r.deps[r._depsLength];a!==o?(a&&$g$1(a,r),r.deps[r._depsLength++]=o):r._depsLength++}}const Qu$1=[];function Bg$1(r,o,s){cf$1();for(const a of r.keys()){let l;a._dirtyLevel{const s=new Map;return s.cleanup=r,s.computed=o,s},Gl$1=new WeakMap,si$1=Symbol(""),qu$1=Symbol("");function sn$1(r,o,s){if(wo$1&&ii$2){let a=Gl$1.get(r);a||Gl$1.set(r,a=new Map);let l=a.get(s);l||a.set(s,l=Hg$1(()=>a.delete(s))),jg$1(ii$2,l)}}function Ir$1(r,o,s,a,l,c){const u=Gl$1.get(r);if(!u)return;let d=[];if(o==="clear")d=[...u.values()];else if(s==="length"&&xo$1(r)){const m=Number(a);u.forEach((g,y)=>{(y==="length"||!Ta$1(y)&&y>=m)&&d.push(g)})}else switch(s!==void 0&&d.push(u.get(s)),o){case"add":xo$1(r)?af$2(s)&&d.push(u.get("length")):(d.push(u.get(si$1)),Ms$1(r)&&d.push(u.get(qu$1)));break;case"delete":xo$1(r)||(d.push(u.get(si$1)),Ms$1(r)&&d.push(u.get(qu$1)));break;case"set":Ms$1(r)&&d.push(u.get(si$1));break}cf$1();for(const m of d)m&&Bg$1(m,4);uf$1()}function X_$1(r,o){const s=Gl$1.get(r);return s&&s.get(o)}const z_$1=U_$1("__proto__,__v_isRef,__isVue"),Wg$1=new Set(Object.getOwnPropertyNames(Symbol).filter(r=>r!=="arguments"&&r!=="caller").map(r=>Symbol[r]).filter(Ta$1)),Zp$1=J_$1();function J_$1(){const r={};return["includes","indexOf","lastIndexOf"].forEach(o=>{r[o]=function(...s){const a=Le(this);for(let c=0,u=this.length;c{r[o]=function(...s){no$1(),cf$1();const a=Le(this)[o].apply(this,s);return uf$1(),ro$1(),a}}),r}function Q_$1(r){Ta$1(r)||(r=String(r));const o=Le(this);return sn$1(o,"has",r),o.hasOwnProperty(r)}let Gg$2=class{constructor(o=!1,s=!1){this._isReadonly=o,this._isShallow=s}get(o,s,a){const l=this._isReadonly,c=this._isShallow;if(s==="__v_isReactive")return!l;if(s==="__v_isReadonly")return l;if(s==="__v_isShallow")return c;if(s==="__v_raw")return a===(l?c?qg$1:Qg$1:c?Jg$1:zg$1).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(a)?o:void 0;const u=xo$1(o);if(!l){if(u&&Wl$1(Zp$1,s))return Reflect.get(Zp$1,s,a);if(s==="hasOwnProperty")return Q_$1}const d=Reflect.get(o,s,a);return(Ta$1(s)?Wg$1.has(s):z_$1(s))||(l||sn$1(o,"get",s),c)?d:Ce(d)?u&&af$2(s)?d:d.value:xa$1(d)?l?Lc$1(d):De(d):d}},Kg$1=class extends Gg$2{constructor(o=!1){super(!1,o)}set(o,s,a,l){let c=o[s];if(!this._isShallow){const m=yr$1(c);if(!mr$1(a)&&!yr$1(a)&&(c=Le(c),a=Le(a)),!xo$1(o)&&Ce(c)&&!Ce(a))return m?!1:(c.value=a,!0)}const u=xo$1(o)&&af$2(s)?Number(s)r,Dc$1=r=>Reflect.getPrototypeOf(r);function Za$1(r,o,s=!1,a=!1){r=r.__v_raw;const l=Le(r),c=Le(o);s||(gs$1(o,c)&&sn$1(l,"get",o),sn$1(l,"get",c));const{has:u}=Dc$1(l),d=a?df$1:s?pf$1:ea$1;if(u.call(l,o))return d(r.get(o));if(u.call(l,c))return d(r.get(c));r!==l&&r.get(o)}function el$2(r,o=!1){const s=this.__v_raw,a=Le(s),l=Le(r);return o||(gs$1(r,l)&&sn$1(a,"has",r),sn$1(a,"has",l)),r===l?s.has(r):s.has(r)||s.has(l)}function tl$1(r,o=!1){return r=r.__v_raw,!o&&sn$1(Le(r),"iterate",si$1),Reflect.get(r,"size",r)}function em$1(r,o=!1){!o&&!mr$1(r)&&!yr$1(r)&&(r=Le(r));const s=Le(this);return Dc$1(s).has.call(s,r)||(s.add(r),Ir$1(s,"add",r,r)),this}function tm$1(r,o,s=!1){!s&&!mr$1(o)&&!yr$1(o)&&(o=Le(o));const a=Le(this),{has:l,get:c}=Dc$1(a);let u=l.call(a,r);u||(r=Le(r),u=l.call(a,r));const d=c.call(a,r);return a.set(r,o),u?gs$1(o,d)&&Ir$1(a,"set",r,o):Ir$1(a,"add",r,o),this}function nm$1(r){const o=Le(this),{has:s,get:a}=Dc$1(o);let l=s.call(o,r);l||(r=Le(r),l=s.call(o,r)),a&&a.call(o,r);const c=o.delete(r);return l&&Ir$1(o,"delete",r,void 0),c}function rm$1(){const r=Le(this),o=r.size!==0,s=r.clear();return o&&Ir$1(r,"clear",void 0,void 0),s}function nl$1(r,o){return function(s,a){const l=this,c=l.__v_raw,u=Le(c),d=o?df$1:r?pf$1:ea$1;return!r&&sn$1(u,"iterate",si$1),c.forEach((m,g)=>s.call(a,d(m),d(g),l))}}function rl$1(r,o,s){return function(...a){const l=this.__v_raw,c=Le(l),u=Ms$1(c),d=r==="entries"||r===Symbol.iterator&&u,m=r==="keys"&&u,g=l[r](...a),y=s?df$1:o?pf$1:ea$1;return!o&&sn$1(c,"iterate",m?qu$1:si$1),{next(){const{value:_,done:E}=g.next();return E?{value:_,done:E}:{value:d?[y(_[0]),y(_[1])]:y(_),done:E}},[Symbol.iterator](){return this}}}}function ao$1(r){return function(...o){return r==="delete"?!1:r==="clear"?void 0:this}}function nO$1(){const r={get(l){return Za$1(this,l)},get size(){return tl$1(this)},has:el$2,add:em$1,set:tm$1,delete:nm$1,clear:rm$1,forEach:nl$1(!1,!1)},o={get(l){return Za$1(this,l,!1,!0)},get size(){return tl$1(this)},has:el$2,add(l){return em$1.call(this,l,!0)},set(l,c){return tm$1.call(this,l,c,!0)},delete:nm$1,clear:rm$1,forEach:nl$1(!1,!0)},s={get(l){return Za$1(this,l,!0)},get size(){return tl$1(this,!0)},has(l){return el$2.call(this,l,!0)},add:ao$1("add"),set:ao$1("set"),delete:ao$1("delete"),clear:ao$1("clear"),forEach:nl$1(!0,!1)},a={get(l){return Za$1(this,l,!0,!0)},get size(){return tl$1(this,!0)},has(l){return el$2.call(this,l,!0)},add:ao$1("add"),set:ao$1("set"),delete:ao$1("delete"),clear:ao$1("clear"),forEach:nl$1(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(l=>{r[l]=rl$1(l,!1,!1),s[l]=rl$1(l,!0,!1),o[l]=rl$1(l,!1,!0),a[l]=rl$1(l,!0,!0)}),[r,s,o,a]}const[rO$1,oO$1,iO$1,sO$1]=nO$1();function Ac$1(r,o){const s=o?r?sO$1:iO$1:r?oO$1:rO$1;return(a,l,c)=>l==="__v_isReactive"?!r:l==="__v_isReadonly"?r:l==="__v_raw"?a:Reflect.get(Wl$1(s,l)&&l in a?s:a,l,c)}const aO$1={get:Ac$1(!1,!1)},lO$1={get:Ac$1(!1,!0)},cO$1={get:Ac$1(!0,!1)},uO$1={get:Ac$1(!0,!0)},zg$1=new WeakMap,Jg$1=new WeakMap,Qg$1=new WeakMap,qg$1=new WeakMap;function dO$1(r){switch(r){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function fO$1(r){return r.__v_skip||!Object.isExtensible(r)?0:dO$1(Rg$1(r))}function De(r){return yr$1(r)?r:Pc$1(r,!1,q_$1,aO$1,zg$1)}function ff$1(r){return Pc$1(r,!1,eO$1,lO$1,Jg$1)}function Lc$1(r){return Pc$1(r,!0,Z_$1,cO$1,Qg$1)}function zn$1(r){return Pc$1(r,!0,tO$1,uO$1,qg$1)}function Pc$1(r,o,s,a,l){if(!xa$1(r)||r.__v_raw&&!(o&&r.__v_isReactive))return r;const c=l.get(r);if(c)return c;const u=fO$1(r);if(u===0)return r;const d=new Proxy(r,u===2?a:s);return l.set(r,d),d}function Cn$1(r){return yr$1(r)?Cn$1(r.__v_raw):!!(r&&r.__v_isReactive)}function yr$1(r){return!!(r&&r.__v_isReadonly)}function mr$1(r){return!!(r&&r.__v_isShallow)}function zi(r){return r?!!r.__v_raw:!1}function Le(r){const o=r&&r.__v_raw;return o?Le(o):r}function xr$1(r){return Object.isExtensible(r)&&K_$1(r,"__v_skip",!0),r}const ea$1=r=>xa$1(r)?De(r):r,pf$1=r=>xa$1(r)?Lc$1(r):r;let Zg$1=class{constructor(o,s,a,l){this.getter=o,this._setter=s,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new hi$1(()=>o(this._value),()=>Hi$1(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!l,this.__v_isReadonly=a}get value(){const o=Le(this);return(!o._cacheable||o.effect.dirty)&&gs$1(o._value,o._value=o.effect.run())&&Hi$1(o,4),mf$1(o),o.effect._dirtyLevel>=2&&Hi$1(o,2),o._value}set value(o){this._setter(o)}get _dirty(){return this.effect.dirty}set _dirty(o){this.effect.dirty=o}};function mO$1(r,o,s=!1){let a,l;const c=sf$1(r);return c?(a=r,l=Lg$1):(a=r.get,l=r.set),new Zg$1(a,l,c||!l,s)}function mf$1(r){var o;wo$1&&ii$2&&(r=Le(r),jg$1(ii$2,(o=r.dep)!=null?o:r.dep=Hg$1(()=>r.dep=void 0,r instanceof Zg$1?r:void 0)))}function Hi$1(r,o=4,s,a){r=Le(r);const l=r.dep;l&&Bg$1(l,o)}function Ce(r){return!!(r&&r.__v_isRef===!0)}function $e(r){return ev$1(r,!1)}function Ia$1(r){return ev$1(r,!0)}function ev$1(r,o){return Ce(r)?r:new hO$1(r,o)}let hO$1=class{constructor(o,s){this.__v_isShallow=s,this.dep=void 0,this.__v_isRef=!0,this._rawValue=s?o:Le(o),this._value=s?o:ea$1(o)}get value(){return mf$1(this),this._value}set value(o){const s=this.__v_isShallow||mr$1(o)||yr$1(o);o=s?o:Le(o),gs$1(o,this._rawValue)&&(this._rawValue,this._rawValue=o,this._value=s?o:ea$1(o),Hi$1(this,4))}};function tv$1(r){Hi$1(r,4)}function x(r){return Ce(r)?r.value:r}function nv$1(r){return sf$1(r)?r():x(r)}const gO$1={get:(r,o,s)=>x(Reflect.get(r,o,s)),set:(r,o,s,a)=>{const l=r[o];return Ce(l)&&!Ce(s)?(l.value=s,!0):Reflect.set(r,o,s,a)}};function Rc$1(r){return Cn$1(r)?r:new Proxy(r,gO$1)}let vO$1=class{constructor(o){this.dep=void 0,this.__v_isRef=!0;const{get:s,set:a}=o(()=>mf$1(this),()=>Hi$1(this));this._get=s,this._set=a}get value(){return this._get()}set value(o){this._set(o)}};function hf$1(r){return new vO$1(r)}function Kl$1(r){const o=xo$1(r)?new Array(r.length):{};for(const s in r)o[s]=rv$1(r,s);return o}let yO$1=class{constructor(o,s,a){this._object=o,this._key=s,this._defaultValue=a,this.__v_isRef=!0}get value(){const o=this._object[this._key];return o===void 0?this._defaultValue:o}set value(o){this._object[this._key]=o}get dep(){return X_$1(Le(this._object),this._key)}},bO$1=class{constructor(o){this._getter=o,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}};function $s$1(r,o,s){return Ce(r)?r:sf$1(r)?new bO$1(r):xa$1(r)&&arguments.length>1?rv$1(r,o,s):$e(r)}function rv$1(r,o,s){const a=r[o];return Ce(a)?a:new yO$1(r,o,s)}const ov$1={GET:"get",HAS:"has",ITERATE:"iterate"},iv$1={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"};/** -* @vue/shared v3.4.37 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function ko$1(r,o){const s=new Set(r.split(","));return a=>s.has(a)}const ut={},Wi$1=[],Ht$1=()=>{},EO$1=()=>!1,Ca$1=r=>r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&(r.charCodeAt(2)>122||r.charCodeAt(2)<97),Zu$1=r=>r.startsWith("onUpdate:"),kt$1=Object.assign,gf$1=(r,o)=>{const s=r.indexOf(o);s>-1&&r.splice(s,1)},_O$1=Object.prototype.hasOwnProperty,at=(r,o)=>_O$1.call(r,o),ke=Array.isArray,sv$1=r=>Va$1(r)==="[object Map]",av$1=r=>Va$1(r)==="[object Set]",OO$1=r=>Va$1(r)==="[object RegExp]",Ve$1=r=>typeof r=="function",_t$1=r=>typeof r=="string",lv$1=r=>typeof r=="symbol",ht=r=>r!==null&&typeof r=="object",Mc$1=r=>(ht(r)||Ve$1(r))&&Ve$1(r.then)&&Ve$1(r.catch),cv$1=Object.prototype.toString,Va$1=r=>cv$1.call(r),uv$1=r=>Va$1(r)==="[object Object]",Gi$1=ko$1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),$c$1=r=>{const o=Object.create(null);return s=>o[s]||(o[s]=r(s))},TO$1=/-(\w)/g,pn$1=$c$1(r=>r.replace(TO$1,(o,s)=>s?s.toUpperCase():"")),xO$1=/\B([A-Z])/g,Zr$1=$c$1(r=>r.replace(xO$1,"-$1").toLowerCase()),gi$1=$c$1(r=>r.charAt(0).toUpperCase()+r.slice(1)),Nr$1=$c$1(r=>r?`on${gi$1(r)}`:""),Kr$1=(r,o)=>!Object.is(r,o),Zo$1=(r,...o)=>{for(let s=0;s{Object.defineProperty(r,o,{configurable:!0,enumerable:!1,writable:a,value:s})},wO$1=r=>{const o=parseFloat(r);return isNaN(o)?r:o},IO$1=r=>{const o=_t$1(r)?Number(r):NaN;return isNaN(o)?r:o};let om$1;const vf$1=()=>om$1||(om$1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),CO$1="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error",VO$1=ko$1(CO$1);function wi$1(r){if(ke(r)){const o={};for(let s=0;s{if(s){const a=s.split(AO$1);a.length>1&&(o[a[0].trim()]=a[1].trim())}}),o}function yt$1(r){let o="";if(_t$1(r))o=r;else if(ke(r))for(let s=0;s!!(r&&r.__v_isRef===!0),Ct=r=>_t$1(r)?r:r==null?"":ke(r)||ht(r)&&(r.toString===cv$1||!Ve$1(r.toString))?fv$1(r)?Ct(r.value):JSON.stringify(r,pv$1,2):String(r),pv$1=(r,o)=>fv$1(o)?pv$1(r,o.value):sv$1(o)?{[`Map(${o.size})`]:[...o.entries()].reduce((s,[a,l],c)=>(s[pu$1(a,c)+" =>"]=l,s),{})}:av$1(o)?{[`Set(${o.size})`]:[...o.values()].map(s=>pu$1(s))}:lv$1(o)?pu$1(o):ht(o)&&!ke(o)&&!uv$1(o)?String(o):o,pu$1=(r,o="")=>{var s;return lv$1(r)?`Symbol(${(s=r.description)!=null?s:o})`:r};/** -* @vue/runtime-core v3.4.37 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const ai$1=[];let mu$2=!1;function re$1(r,...o){if(mu$2)return;mu$2=!0,no$1();const s=ai$1.length?ai$1[ai$1.length-1].component:null,a=s&&s.appContext.config.warnHandler,l=jO$1();if(a)hr$2(a,s,11,[r+o.map(c=>{var u,d;return(d=(u=c.toString)==null?void 0:u.call(c))!=null?d:JSON.stringify(c)}).join(""),s&&s.proxy,l.map(({vnode:c})=>`at <${Xc$1(s,c.type)}>`).join(` -`),l]);else{const c=[`[Vue warn]: ${r}`,...o];l.length&&c.push(` -`,...BO$1(l)),console.warn(...c)}ro$1(),mu$2=!1}function jO$1(){let r=ai$1[ai$1.length-1];if(!r)return[];const o=[];for(;r;){const s=o[0];s&&s.vnode===r?s.recurseCount++:o.push({vnode:r,recurseCount:0});const a=r.component&&r.component.parent;r=a&&a.vnode}return o}function BO$1(r){const o=[];return r.forEach((s,a)=>{o.push(...a===0?[]:[` -`],...HO$1(s))}),o}function HO$1({vnode:r,recurseCount:o}){const s=o>0?`... (${o} recursive calls)`:"",a=r.component?r.component.parent==null:!1,l=` at <${Xc$1(r.component,r.type,a)}`,c=">"+s;return r.props?[l,...WO$1(r.props),c]:[l+c]}function WO$1(r){const o=[],s=Object.keys(r);return s.slice(0,3).forEach(a=>{o.push(...mv$1(a,r[a]))}),s.length>3&&o.push(" ..."),o}function mv$1(r,o,s){return _t$1(o)?(o=JSON.stringify(o),s?o:[`${r}=${o}`]):typeof o=="number"||typeof o=="boolean"||o==null?s?o:[`${r}=${o}`]:Ce(o)?(o=mv$1(r,Le(o.value),!0),s?o:[`${r}=Ref<`,o,">"]):Ve$1(o)?[`${r}=fn${o.name?`<${o.name}>`:""}`]:(o=Le(o),s?o:[`${r}=`,o])}function kc$1(r,o){}const hv$1={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",WATCH_GETTER:2,2:"WATCH_GETTER",WATCH_CALLBACK:3,3:"WATCH_CALLBACK",WATCH_CLEANUP:4,4:"WATCH_CLEANUP",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE"},Fc$1={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update"};function hr$2(r,o,s,a){try{return a?r(...a):r()}catch(l){oo$1(l,o,s)}}function Vn(r,o,s,a){if(Ve$1(r)){const l=hr$2(r,o,s,a);return l&&Mc$1(l)&&l.catch(c=>{oo$1(c,o,s)}),l}if(ke(r)){const l=[];for(let c=0;c>>1,l=un$1[a],c=ra$1(l);cTr$1&&un$1.splice(o,1)}function Ji$1(r){ke(r)?Ki$1.push(...r):(!po$1||!po$1.includes(r,r.allowRecurse?ei$1+1:ei$1))&&Ki$1.push(r),vv$1()}function sm$1(r,o,s=na$1?Tr$1+1:0){for(!1;sra$1(s)-ra$1(a));if(Ki$1.length=0,po$1){po$1.push(...o);return}for(po$1=o,ei$1=0;ei$1r.id==null?1/0:r.id,zO$1=(r,o)=>{const s=ra$1(r)-ra$1(o);if(s===0){if(r.pre&&!o.pre)return-1;if(o.pre&&!r.pre)return 1}return s};function yv$1(r){ed$1=!1,na$1=!0,un$1.sort(zO$1);try{for(Tr$1=0;Tr$1cr$1.emit(l,...c)),Is$1=[]):typeof window<"u"&&window.HTMLElement&&!((a=(s=window.navigator)==null?void 0:s.userAgent)!=null&&a.includes("jsdom"))?((o.__VUE_DEVTOOLS_HOOK_REPLAY__=o.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(l=>{Ef$1(l,o)}),setTimeout(()=>{cr$1||(o.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Is$1=[])},3e3)):Is$1=[]}let Pt=null,Uc$1=null;function oa$1(r){const o=Pt;return Pt=r,Uc$1=r&&r.type.__scopeId||null,o}function Ov$1(r){Uc$1=r}function Nv$1(){Uc$1=null}const Sv$1=r=>ye;function ye(r,o=Pt,s){if(!o||r._n)return r;const a=(...l)=>{a._d&&nc$1(-1);const c=oa$1(o);let u;try{u=r(...l)}finally{oa$1(c),a._d&&nc$1(1)}return u};return a._n=!0,a._c=!0,a._d=!0,a}function Q(r,o){if(Pt===null)return r;const s=Fa$1(Pt),a=r.dirs||(r.dirs=[]);for(let l=0;l{r.isMounted=!0}),Ma$1(()=>{r.isUnmounting=!0}),r}const Wn$1=[Function,Array],Bc$1={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Wn$1,onEnter:Wn$1,onAfterEnter:Wn$1,onEnterCancelled:Wn$1,onBeforeLeave:Wn$1,onLeave:Wn$1,onAfterLeave:Wn$1,onLeaveCancelled:Wn$1,onBeforeAppear:Wn$1,onAppear:Wn$1,onAfterAppear:Wn$1,onAppearCancelled:Wn$1},xv$1=r=>{const o=r.subTree;return o.component?xv$1(o.component):o},aN$1={name:"BaseTransition",props:Bc$1,setup(r,{slots:o}){const s=qt$1(),a=jc$1();return()=>{const l=o.default&&La$1(o.default(),!0);if(!l||!l.length)return;let c=l[0];if(l.length>1){for(const E of l)if(E.type!==Et){c=E;break}}const u=Le(r),{mode:d}=u;if(a.isLeaving)return gu$1(c);const m=lm$1(c);if(!m)return gu$1(c);let g=yi$1(m,u,a,s,E=>g=E);eo$1(m,g);const y=s.subTree,_=y&&lm$1(y);if(_&&_.type!==Et&&!ur$1(m,_)&&xv$1(s).type!==Et){const E=yi$1(_,u,a,s);if(eo$1(_,E),d==="out-in"&&m.type!==Et)return a.isLeaving=!0,E.afterLeave=()=>{a.isLeaving=!1,s.update.active!==!1&&(s.effect.dirty=!0,s.update())},gu$1(c);d==="in-out"&&m.type!==Et&&(E.delayLeave=(w,T,k)=>{const O=wv$1(a,_);O[String(_.key)]=_,w[mo$1]=()=>{T(),w[mo$1]=void 0,delete g.delayedLeave},g.delayedLeave=k})}return c}}},Of$1=aN$1;function wv$1(r,o){const{leavingVNodes:s}=r;let a=s.get(o.type);return a||(a=Object.create(null),s.set(o.type,a)),a}function yi$1(r,o,s,a,l){const{appear:c,mode:u,persisted:d=!1,onBeforeEnter:m,onEnter:g,onAfterEnter:y,onEnterCancelled:_,onBeforeLeave:E,onLeave:w,onAfterLeave:T,onLeaveCancelled:k,onBeforeAppear:O,onAppear:R,onAfterAppear:M,onAppearCancelled:N}=o,D=String(r.key),P=wv$1(s,r),I=(U,J)=>{U&&Vn(U,a,9,J)},L=(U,J)=>{const z=J[1];I(U,J),ke(U)?U.every(ie=>ie.length<=1)&&z():U.length<=1&&z()},F={mode:u,persisted:d,beforeEnter(U){let J=m;if(!s.isMounted)if(c)J=O||m;else return;U[mo$1]&&U[mo$1](!0);const z=P[D];z&&ur$1(r,z)&&z.el[mo$1]&&z.el[mo$1](),I(J,[U])},enter(U){let J=g,z=y,ie=_;if(!s.isMounted)if(c)J=R||g,z=M||y,ie=N||_;else return;let ce=!1;const Y=U[ol$1]=B=>{ce||(ce=!0,B?I(ie,[U]):I(z,[U]),F.delayedLeave&&F.delayedLeave(),U[ol$1]=void 0)};J?L(J,[U,Y]):Y()},leave(U,J){const z=String(r.key);if(U[ol$1]&&U[ol$1](!0),s.isUnmounting)return J();I(E,[U]);let ie=!1;const ce=U[mo$1]=Y=>{ie||(ie=!0,J(),Y?I(k,[U]):I(T,[U]),U[mo$1]=void 0,P[z]===r&&delete P[z])};P[z]=r,w?L(w,[U,ce]):ce()},clone(U){const J=yi$1(U,o,s,a,l);return l&&l(J),J}};return F}function gu$1(r){if(vs$1(r))return r=jn$1(r),r.children=null,r}function lm$1(r){if(!vs$1(r))return r;const{shapeFlag:o,children:s}=r;if(s){if(o&16)return s[0];if(o&32&&Ve$1(s.default))return s.default()}}function eo$1(r,o){r.shapeFlag&6&&r.component?eo$1(r.component.subTree,o):r.shapeFlag&128?(r.ssContent.transition=o.clone(r.ssContent),r.ssFallback.transition=o.clone(r.ssFallback)):r.transition=o}function La$1(r,o=!1,s){let a=[],l=0;for(let c=0;c1)for(let c=0;c!!r.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function Iv$1(r){Ve$1(r)&&(r={loader:r});const{loader:o,loadingComponent:s,errorComponent:a,delay:l=200,timeout:c,suspensible:u=!0,onError:d}=r;let m=null,g,y=0;const _=()=>(y++,m=null,E()),E=()=>{let w;return m||(w=m=o().catch(T=>{if(T=T instanceof Error?T:new Error(String(T)),d)return new Promise((k,O)=>{d(T,()=>k(_()),()=>O(T),y+1)});throw T}).then(T=>w!==m&&m?m:(T&&(T.__esModule||T[Symbol.toStringTag]==="Module")&&(T=T.default),g=T,T)))};return Ee({name:"AsyncComponentWrapper",__asyncLoader:E,get __asyncResolved(){return g},setup(){const w=Mt$1;if(g)return()=>vu$1(g,w);const T=M=>{m=null,oo$1(M,w,13,!a)};if(u&&w.suspense||ka$1)return E().then(M=>()=>vu$1(M,w)).catch(M=>(T(M),()=>a?A(a,{error:M}):null));const k=$e(!1),O=$e(),R=$e(!!l);return l&&setTimeout(()=>{R.value=!1},l),c!=null&&setTimeout(()=>{if(!k.value&&!O.value){const M=new Error(`Async component timed out after ${c}ms.`);T(M),O.value=M}},c),E().then(()=>{k.value=!0,w.parent&&vs$1(w.parent.vnode)&&(w.parent.effect.dirty=!0,Da$1(w.parent.update))}).catch(M=>{T(M),O.value=M}),()=>{if(k.value&&g)return vu$1(g,w);if(O.value&&a)return A(a,{error:O.value});if(s&&!R.value)return A(s)}}})}function vu$1(r,o){const{ref:s,props:a,children:l,ce:c}=o.vnode,u=A(r,a,l);return u.ref=s,u.ce=c,delete o.vnode.ce,u}const vs$1=r=>r.type.__isKeepAlive,lN$1={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(r,{slots:o}){const s=qt$1(),a=s.ctx;if(!a.renderer)return()=>{const M=o.default&&o.default();return M&&M.length===1?M[0]:M};const l=new Map,c=new Set;let u=null;const d=s.suspense,{renderer:{p:m,m:g,um:y,o:{createElement:_}}}=a,E=_("div");a.activate=(M,N,D,P,I)=>{const L=M.component;g(M,N,D,0,d),m(L.vnode,M,N,D,L,d,P,M.slotScopeIds,I),Xt$1(()=>{L.isDeactivated=!1,L.a&&Zo$1(L.a);const F=M.props&&M.props.onVnodeMounted;F&&xn$1(F,L.parent,M)},d)},a.deactivate=M=>{const N=M.component;Zl$1(N.m),Zl$1(N.a),g(M,E,null,1,d),Xt$1(()=>{N.da&&Zo$1(N.da);const D=M.props&&M.props.onVnodeUnmounted;D&&xn$1(D,N.parent,M),N.isDeactivated=!0},d)};function w(M){yu$1(M),y(M,s,d,!0)}function T(M){l.forEach((N,D)=>{const P=aa$1(N.type);P&&(!M||!M(P))&&k(D)})}function k(M){const N=l.get(M);N&&(!u||!ur$1(N,u))?w(N):u&&yu$1(u),l.delete(M),c.delete(M)}Oe(()=>[r.include,r.exclude],([M,N])=>{M&&T(D=>Cs$1(M,D)),N&&T(D=>!Cs$1(N,D))},{flush:"post",deep:!0});let O=null;const R=()=>{O!=null&&(ud$1(s.subTree.type)?Xt$1(()=>{l.set(O,il$1(s.subTree))},s.subTree.suspense):l.set(O,il$1(s.subTree)))};return Pn$1(R),Ra$1(R),Ma$1(()=>{l.forEach(M=>{const{subTree:N,suspense:D}=s,P=il$1(N);if(M.type===P.type&&M.key===P.key){yu$1(P);const I=P.component.da;I&&Xt$1(I,D);return}w(M)})}),()=>{if(O=null,!o.default)return null;const M=o.default(),N=M[0];if(M.length>1)return u=null,M;if(!br$1(N)||!(N.shapeFlag&4)&&!(N.shapeFlag&128))return u=null,N;let D=il$1(N);if(D.type===Et)return u=null,D;const P=D.type,I=aa$1(li$1(D)?D.type.__asyncResolved||{}:P),{include:L,exclude:F,max:U}=r;if(L&&(!I||!Cs$1(L,I))||F&&I&&Cs$1(F,I))return u=D,N;const J=D.key==null?P:D.key,z=l.get(J);return D.el&&(D=jn$1(D),N.shapeFlag&128&&(N.ssContent=D)),O=J,z?(D.el=z.el,D.component=z.component,D.transition&&eo$1(D,D.transition),D.shapeFlag|=512,c.delete(J),c.add(J)):(c.add(J),U&&c.size>parseInt(U,10)&&k(c.values().next().value)),D.shapeFlag|=256,u=D,ud$1(N.type)?N:D}}},Cv$1=lN$1;function Cs$1(r,o){return ke(r)?r.some(s=>Cs$1(s,o)):_t$1(r)?r.split(",").includes(o):OO$1(r)?r.test(o):!1}function Nf$1(r,o){Vv$1(r,"a",o)}function Sf$1(r,o){Vv$1(r,"da",o)}function Vv$1(r,o,s=Mt$1){const a=r.__wdc||(r.__wdc=()=>{let l=s;for(;l;){if(l.isDeactivated)return;l=l.parent}return r()});if(Hc$1(o,a,s),s){let l=s.parent;for(;l&&l.parent;)vs$1(l.parent.vnode)&&cN$1(a,o,s,l),l=l.parent}}function cN$1(r,o,s,a){const l=Hc$1(o,r,a,!0);Ii$1(()=>{gf$1(a[o],l)},s)}function yu$1(r){r.shapeFlag&=-257,r.shapeFlag&=-513}function il$1(r){return r.shapeFlag&128?r.ssContent:r}function Hc$1(r,o,s=Mt$1,a=!1){if(s){const l=s[r]||(s[r]=[]),c=o.__weh||(o.__weh=(...u)=>{no$1();const d=Ei$1(s),m=Vn(o,s,r,u);return d(),ro$1(),m});return a?l.unshift(c):l.push(c),c}}const io$1=r=>(o,s=Mt$1)=>{(!ka$1||r==="sp")&&Hc$1(r,(...a)=>o(...a),s)},Pa$1=io$1("bm"),Pn$1=io$1("m"),Tf$1=io$1("bu"),Ra$1=io$1("u"),Ma$1=io$1("bum"),Ii$1=io$1("um"),xf$1=io$1("sp"),wf$1=io$1("rtg"),If$1=io$1("rtc");function Cf$1(r,o=Mt$1){Hc$1("ec",r,o)}const zl$1="components",uN$1="directives";function Vf$1(r,o){return Lf$1(zl$1,r,!0,o)||r}const Df$1=Symbol.for("v-ndc");function Af$1(r){return _t$1(r)?Lf$1(zl$1,r,!1)||r:r||Df$1}function Wc$1(r){return Lf$1(uN$1,r)}function Lf$1(r,o,s=!0,a=!1){const l=Pt||Mt$1;if(l){const c=l.type;if(r===zl$1){const d=aa$1(c,!1);if(d&&(d===o||d===pn$1(o)||d===gi$1(pn$1(o))))return c}const u=cm$1(l[r]||c[r],o)||cm$1(l.appContext[r],o);return!u&&a?c:u}}function cm$1(r,o){return r&&(r[o]||r[pn$1(o)]||r[gi$1(pn$1(o))])}function Qt$1(r,o,s,a){let l;const c=s&&s[a];if(ke(r)||_t$1(r)){l=new Array(r.length);for(let u=0,d=r.length;uo(u,d,void 0,c&&c[d]));else{const u=Object.keys(r);l=new Array(u.length);for(let d=0,m=u.length;d{const c=a.fn(...l);return c&&(c.key=a.key),c}:a.fn)}return r}function Qi$1(r,o,s={},a,l){if(Pt.isCE||Pt.parent&&li$1(Pt.parent)&&Pt.parent.isCE)return o!=="default"&&(s.name=o),A("slot",s,a&&a());let c=r[o];c&&c._c&&(c._d=!1),H();const u=c&&Pf$1(c(s)),d=be(Ze,{key:(s.key||u&&u.key||`_${o}`)+(!u&&a?"_fb":"")},u||(a?a():[]),u&&r._===1?64:-2);return!l&&d.scopeId&&(d.slotScopeIds=[d.scopeId+"-s"]),c&&c._c&&(c._d=!0),d}function Pf$1(r){return r.some(o=>br$1(o)?!(o.type===Et||o.type===Ze&&!Pf$1(o.children)):!0)?r:null}function Av$1(r,o){const s={};for(const a in r)s[o&&/[A-Z]/.test(a)?`on:${a}`:Nr$1(a)]=r[a];return s}const rd$1=r=>r?xy$1(r)?Fa$1(r):rd$1(r.parent):null,ci$1=kt$1(Object.create(null),{$:r=>r,$el:r=>r.vnode.el,$data:r=>r.data,$props:r=>r.props,$attrs:r=>r.attrs,$slots:r=>r.slots,$refs:r=>r.refs,$parent:r=>rd$1(r.parent),$root:r=>rd$1(r.root),$emit:r=>r.emit,$options:r=>kf$1(r),$forceUpdate:r=>r.f||(r.f=()=>{r.effect.dirty=!0,Da$1(r.update)}),$nextTick:r=>r.n||(r.n=Ao$1.bind(r.proxy)),$watch:r=>YN$1.bind(r)}),bu$1=(r,o)=>r!==ut&&!r.__isScriptSetup&&at(r,o),Us$1={get({_:r},o){if(o==="__v_skip")return!0;const{ctx:s,setupState:a,data:l,props:c,accessCache:u,type:d,appContext:m}=r;let g;if(o[0]!=="$"){const w=u[o];if(w!==void 0)switch(w){case 1:return a[o];case 2:return l[o];case 4:return s[o];case 3:return c[o]}else{if(bu$1(a,o))return u[o]=1,a[o];if(l!==ut&&at(l,o))return u[o]=2,l[o];if((g=r.propsOptions[0])&&at(g,o))return u[o]=3,c[o];if(s!==ut&&at(s,o))return u[o]=4,s[o];od$1&&(u[o]=0)}}const y=ci$1[o];let _,E;if(y)return o==="$attrs"&&sn$1(r.attrs,"get",""),y(r);if((_=d.__cssModules)&&(_=_[o]))return _;if(s!==ut&&at(s,o))return u[o]=4,s[o];if(E=m.config.globalProperties,at(E,o))return E[o]},set({_:r},o,s){const{data:a,setupState:l,ctx:c}=r;return bu$1(l,o)?(l[o]=s,!0):a!==ut&&at(a,o)?(a[o]=s,!0):at(r.props,o)||o[0]==="$"&&o.slice(1)in r?!1:(c[o]=s,!0)},has({_:{data:r,setupState:o,accessCache:s,ctx:a,appContext:l,propsOptions:c}},u){let d;return!!s[u]||r!==ut&&at(r,u)||bu$1(o,u)||(d=c[0])&&at(d,u)||at(a,u)||at(ci$1,u)||at(l.config.globalProperties,u)},defineProperty(r,o,s){return s.get!=null?r._.accessCache[o]=0:at(s,"value")&&this.set(r,o,s.value,null),Reflect.defineProperty(r,o,s)}},dN$1=kt$1({},Us$1,{get(r,o){if(o!==Symbol.unscopables)return Us$1.get(r,o,r)},has(r,o){return o[0]!=="_"&&!VO$1(o)}});function Lv$1(){return null}function Pv$1(){return null}function Rv$1(r){}function Mv$1(r){}function $v$1(){return null}function kv$1(){}function Fv$1(r,o){return null}function Mf$1(){return jv$1().slots}function Uv$1(){return jv$1().attrs}function jv$1(){const r=qt$1();return r.setupContext||(r.setupContext=Cy$1(r))}function ia$1(r){return ke(r)?r.reduce((o,s)=>(o[s]=null,o),{}):r}function Bv$1(r,o){const s=ia$1(r);for(const a in o){if(a.startsWith("__skip"))continue;let l=s[a];l?ke(l)||Ve$1(l)?l=s[a]={type:l,default:o[a]}:l.default=o[a]:l===null&&(l=s[a]={default:o[a]}),l&&o[`__skip_${a}`]&&(l.skipFactory=!0)}return s}function $f$1(r,o){return!r||!o?r||o:ke(r)&&ke(o)?r.concat(o):kt$1({},ia$1(r),ia$1(o))}function Hv$1(r,o){const s={};for(const a in r)o.includes(a)||Object.defineProperty(s,a,{enumerable:!0,get:()=>r[a]});return s}function Wv$1(r){const o=qt$1();let s=r();return md$1(),Mc$1(s)&&(s=s.catch(a=>{throw Ei$1(o),a})),[s,()=>Ei$1(o)]}let od$1=!0;function gN$1(r){const o=kf$1(r),s=r.proxy,a=r.ctx;od$1=!1,o.beforeCreate&&um$1(o.beforeCreate,r,"bc");const{data:l,computed:c,methods:u,watch:d,provide:m,inject:g,created:y,beforeMount:_,mounted:E,beforeUpdate:w,updated:T,activated:k,deactivated:O,beforeDestroy:R,beforeUnmount:M,destroyed:N,unmounted:D,render:P,renderTracked:I,renderTriggered:L,errorCaptured:F,serverPrefetch:U,expose:J,inheritAttrs:z,components:ie,directives:ce,filters:Y}=o;if(g&&vN$1(g,a,null),u)for(const Ge in u){const St=u[Ge];Ve$1(St)&&(a[Ge]=St.bind(s))}if(l){const Ge=l.call(s,s);ht(Ge)&&(r.data=De(Ge))}if(od$1=!0,c)for(const Ge in c){const St=c[Ge],Dee=Ve$1(St)?St.bind(s,s):Ve$1(St.get)?St.get.bind(s,s):Ht$1,pee=!Ve$1(St)&&Ve$1(St.set)?St.set.bind(s):Ht$1,jr=xt$1({get:Dee,set:pee});Object.defineProperty(a,Ge,{enumerable:!0,configurable:!0,get:()=>jr.value,set:Tee=>jr.value=Tee})}if(d)for(const Ge in d)Gv$1(d[Ge],a,s,Ge);if(m){const Ge=Ve$1(m)?m.call(s):m;Reflect.ownKeys(Ge).forEach(St=>{Ff$1(St,Ge[St])})}y&&um$1(y,r,"c");function V(Ge,St){ke(St)?St.forEach(Dee=>Ge(Dee.bind(s))):St&&Ge(St.bind(s))}if(V(Pa$1,_),V(Pn$1,E),V(Tf$1,w),V(Ra$1,T),V(Nf$1,k),V(Sf$1,O),V(Cf$1,F),V(If$1,I),V(wf$1,L),V(Ma$1,M),V(Ii$1,D),V(xf$1,U),ke(J))if(J.length){const Ge=r.exposed||(r.exposed={});J.forEach(St=>{Object.defineProperty(Ge,St,{get:()=>s[St],set:Dee=>s[St]=Dee})})}else r.exposed||(r.exposed={});P&&r.render===Ht$1&&(r.render=P),z!=null&&(r.inheritAttrs=z),ie&&(r.components=ie),ce&&(r.directives=ce)}function vN$1(r,o,s=Ht$1){ke(r)&&(r=id$1(r));for(const a in r){const l=r[a];let c;ht(l)?"default"in l?c=Co$1(l.from||a,l.default,!0):c=Co$1(l.from||a):c=Co$1(l),Ce(c)?Object.defineProperty(o,a,{enumerable:!0,configurable:!0,get:()=>c.value,set:u=>c.value=u}):o[a]=c}}function um$1(r,o,s){Vn(ke(r)?r.map(a=>a.bind(o.proxy)):r.bind(o.proxy),o,s)}function Gv$1(r,o,s,a){const l=a.includes(".")?dy$1(s,a):()=>s[a];if(_t$1(r)){const c=o[r];Ve$1(c)&&Oe(l,c)}else if(Ve$1(r))Oe(l,r.bind(s));else if(ht(r))if(ke(r))r.forEach(c=>Gv$1(c,o,s,a));else{const c=Ve$1(r.handler)?r.handler.bind(s):o[r.handler];Ve$1(c)&&Oe(l,c,r)}}function kf$1(r){const o=r.type,{mixins:s,extends:a}=o,{mixins:l,optionsCache:c,config:{optionMergeStrategies:u}}=r.appContext,d=c.get(o);let m;return d?m=d:!l.length&&!s&&!a?m=o:(m={},l.length&&l.forEach(g=>Jl$1(m,g,u,!0)),Jl$1(m,o,u)),ht(o)&&c.set(o,m),m}function Jl$1(r,o,s,a=!1){const{mixins:l,extends:c}=o;c&&Jl$1(r,c,s,!0),l&&l.forEach(u=>Jl$1(r,u,s,!0));for(const u in o)if(!(a&&u==="expose")){const d=yN$1[u]||s&&s[u];r[u]=d?d(r[u],o[u]):o[u]}return r}const yN$1={data:dm$1,props:fm$1,emits:fm$1,methods:Vs$1,computed:Vs$1,beforeCreate:hn$1,created:hn$1,beforeMount:hn$1,mounted:hn$1,beforeUpdate:hn$1,updated:hn$1,beforeDestroy:hn$1,beforeUnmount:hn$1,destroyed:hn$1,unmounted:hn$1,activated:hn$1,deactivated:hn$1,errorCaptured:hn$1,serverPrefetch:hn$1,components:Vs$1,directives:Vs$1,watch:EN$1,provide:dm$1,inject:bN$1};function dm$1(r,o){return o?r?function(){return kt$1(Ve$1(r)?r.call(this,this):r,Ve$1(o)?o.call(this,this):o)}:o:r}function bN$1(r,o){return Vs$1(id$1(r),id$1(o))}function id$1(r){if(ke(r)){const o={};for(let s=0;s1)return s&&Ve$1(o)?o.call(a&&a.proxy):o}}function Uf$1(){return!!(Mt$1||Pt||ui)}const Yv$1={},Xv$1=()=>Object.create(Yv$1),zv$1=r=>Object.getPrototypeOf(r)===Yv$1;function NN$1(r,o,s,a=!1){const l={},c=Xv$1();r.propsDefaults=Object.create(null),Jv$1(r,o,l,c);for(const u in r.propsOptions[0])u in l||(l[u]=void 0);s?r.props=a?l:ff$1(l):r.type.props?r.props=l:r.props=c,r.attrs=c}function TN$1(r,o,s,a){const{props:l,attrs:c,vnode:{patchFlag:u}}=r,d=Le(l),[m]=r.propsOptions;let g=!1;if((a||u>0)&&!(u&16)){if(u&8){const y=r.vnode.dynamicProps;for(let _=0;_{m=!0;const[E,w]=Qv$1(_,o,!0);kt$1(u,E),w&&d.push(...w)};!s&&o.mixins.length&&o.mixins.forEach(y),r.extends&&y(r.extends),r.mixins&&r.mixins.forEach(y)}if(!c&&!m)return ht(r)&&a.set(r,Wi$1),Wi$1;if(ke(c))for(let y=0;yr[0]==="_"||r==="$stable",jf$1=r=>ke(r)?r.map(bn$1):[bn$1(r)],LN$1=(r,o,s)=>{if(o._n)return o;const a=ye((...l)=>jf$1(o(...l)),s);return a._c=!1,a},ey$1=(r,o,s)=>{const a=r._ctx;for(const l in r){if(Zv$1(l))continue;const c=r[l];if(Ve$1(c))o[l]=LN$1(l,c,a);else if(c!=null){const u=jf$1(c);o[l]=()=>u}}},ty$1=(r,o)=>{const s=jf$1(o);r.slots.default=()=>s},ad$1=(r,o,s)=>{for(const a in o)(s||a!=="_")&&(r[a]=o[a])},PN$1=(r,o,s)=>{const a=r.slots=Xv$1();if(r.vnode.shapeFlag&32){const l=o._;l?(ad$1(a,o,s),s&&ta$2(a,"_",l,!0)):ey$1(o,a)}else o&&ty$1(r,o)},RN$1=(r,o,s)=>{const{vnode:a,slots:l}=r;let c=!0,u=ut;if(a.shapeFlag&32){const d=o._;d?s&&d===1?c=!1:ad$1(l,o,s):(c=!o.$stable,ey$1(o,l)),u=o}else o&&(ty$1(r,o),u={default:1});if(c)for(const d in l)!Zv$1(d)&&u[d]==null&&delete l[d]};function Ql$1(r,o,s,a,l=!1){if(ke(r)){r.forEach((E,w)=>Ql$1(E,o&&(ke(o)?o[w]:o),s,a,l));return}if(li$1(a)&&!l)return;const c=a.shapeFlag&4?Fa$1(a.component):a.el,u=l?null:c,{i:d,r:m}=r,g=o&&o.r,y=d.refs===ut?d.refs={}:d.refs,_=d.setupState;if(g!=null&&g!==m&&(_t$1(g)?(y[g]=null,at(_,g)&&(_[g]=null)):Ce(g)&&(g.value=null)),Ve$1(m))hr$2(m,d,12,[u,y]);else{const E=_t$1(m),w=Ce(m);if(E||w){const T=()=>{if(r.f){const k=E?at(_,m)?_[m]:y[m]:m.value;l?ke(k)&&gf$1(k,c):ke(k)?k.includes(c)||k.push(c):E?(y[m]=[c],at(_,m)&&(_[m]=y[m])):(m.value=[c],r.k&&(y[r.k]=m.value))}else E?(y[m]=u,at(_,m)&&(_[m]=u)):w&&(m.value=u,r.k&&(y[r.k]=u))};u?(T.id=-1,Xt$1(T,s)):T()}}}const ny$1=Symbol("_vte"),MN$1=r=>r.__isTeleport,di$1=r=>r&&(r.disabled||r.disabled===""),gm$1=r=>typeof SVGElement<"u"&&r instanceof SVGElement,vm$1=r=>typeof MathMLElement=="function"&&r instanceof MathMLElement,ld$1=(r,o)=>{const s=r&&r.to;return _t$1(s)?o?o(s):null:s},$N$1={name:"Teleport",__isTeleport:!0,process(r,o,s,a,l,c,u,d,m,g){const{mc:y,pc:_,pbc:E,o:{insert:w,querySelector:T,createText:k,createComment:O}}=g,R=di$1(o.props);let{shapeFlag:M,children:N,dynamicChildren:D}=o;if(r==null){const P=o.el=k(""),I=o.anchor=k("");w(P,s,a),w(I,s,a);const L=o.target=ld$1(o.props,T),F=iy$1(L,o,k,w);L&&(u==="svg"||gm$1(L)?u="svg":(u==="mathml"||vm$1(L))&&(u="mathml"));const U=(J,z)=>{M&16&&y(N,J,z,l,c,u,d,m)};R?U(s,I):L&&U(L,F)}else{o.el=r.el,o.targetStart=r.targetStart;const P=o.anchor=r.anchor,I=o.target=r.target,L=o.targetAnchor=r.targetAnchor,F=di$1(r.props),U=F?s:I,J=F?P:L;if(u==="svg"||gm$1(I)?u="svg":(u==="mathml"||vm$1(I))&&(u="mathml"),D?(E(r.dynamicChildren,D,U,l,c,u,d),js$1(r,o,!0)):m||_(r,o,U,J,l,c,u,d,!1),R)F?o.props&&r.props&&o.props.to!==r.props.to&&(o.props.to=r.props.to):sl$1(o,s,P,g,1);else if((o.props&&o.props.to)!==(r.props&&r.props.to)){const z=o.target=ld$1(o.props,T);z&&sl$1(o,z,null,g,0)}else F&&sl$1(o,I,L,g,1)}oy$1(o)},remove(r,o,s,{um:a,o:{remove:l}},c){const{shapeFlag:u,children:d,anchor:m,targetStart:g,targetAnchor:y,target:_,props:E}=r;if(_&&(l(g),l(y)),c&&l(m),u&16){const w=c||!di$1(E);for(let T=0;T{ym$1||(console.error("Hydration completed but contains mismatches."),ym$1=!0)},FN$1=r=>r.namespaceURI.includes("svg")&&r.tagName!=="foreignObject",UN$1=r=>r.namespaceURI.includes("MathML"),al$1=r=>{if(FN$1(r))return"svg";if(UN$1(r))return"mathml"},bs$1=r=>r.nodeType===8;function jN$1(r){const{mt:o,p:s,o:{patchProp:a,createText:l,nextSibling:c,parentNode:u,remove:d,insert:m,createComment:g}}=r,y=(N,D)=>{if(!D.hasChildNodes()){s(null,N,D),Yl$1(),D._vnode=N;return}_(D.firstChild,N,null,null,null),Yl$1(),D._vnode=N},_=(N,D,P,I,L,F=!1)=>{F=F||!!D.dynamicChildren;const U=bs$1(N)&&N.data==="[",J=()=>k(N,D,P,I,L,U),{type:z,ref:ie,shapeFlag:ce,patchFlag:Y}=D;let B=N.nodeType;D.el=N,Y===-2&&(F=!1,D.dynamicChildren=null);let V=null;switch(z){case gr$1:B!==3?D.children===""?(m(D.el=l(""),u(N),N),V=N):V=J():(N.data!==D.children&&(Bo$1(),N.data=D.children),V=c(N));break;case Et:M(N)?(V=c(N),R(D.el=N.content.firstChild,N,P)):B!==8||U?V=J():V=c(N);break;case zr$1:if(U&&(N=c(N),B=N.nodeType),B===1||B===3){V=N;const Ge=!D.children.length;for(let St=0;St{F=F||!!D.dynamicChildren;const{type:U,props:J,patchFlag:z,shapeFlag:ie,dirs:ce,transition:Y}=D,B=U==="input"||U==="option";if(B||z!==-1){ce&&Or$2(D,null,P,"created");let V=!1;if(M(N)){V=ly$1(I,Y)&&P&&P.vnode.props&&P.vnode.props.appear;const St=N.content.firstChild;V&&Y.beforeEnter(St),R(St,N,P),D.el=N=St}if(ie&16&&!(J&&(J.innerHTML||J.textContent))){let St=w(N.firstChild,D,N,P,I,L,F);for(;St;){Bo$1();const Dee=St;St=St.nextSibling,d(Dee)}}else ie&8&&N.textContent!==D.children&&(Bo$1(),N.textContent=D.children);if(J){if(B||!F||z&48){const St=N.tagName.includes("-");for(const Dee in J)(B&&(Dee.endsWith("value")||Dee==="indeterminate")||Ca$1(Dee)&&!Gi$1(Dee)||Dee[0]==="."||St)&&a(N,Dee,null,J[Dee],void 0,P)}else if(J.onClick)a(N,"onClick",null,J.onClick,void 0,P);else if(z&4&&Cn$1(J.style))for(const St in J.style)J.style[St]}let Ge;(Ge=J&&J.onVnodeBeforeMount)&&xn$1(Ge,P,D),ce&&Or$2(D,null,P,"beforeMount"),((Ge=J&&J.onVnodeMounted)||ce||V)&&vy$1(()=>{Ge&&xn$1(Ge,P,D),V&&Y.enter(N),ce&&Or$2(D,null,P,"mounted")},I)}return N.nextSibling},w=(N,D,P,I,L,F,U)=>{U=U||!!D.dynamicChildren;const J=D.children,z=J.length;for(let ie=0;ie{const{slotScopeIds:U}=D;U&&(L=L?L.concat(U):U);const J=u(N),z=w(c(N),D,J,P,I,L,F);return z&&bs$1(z)&&z.data==="]"?c(D.anchor=z):(Bo$1(),m(D.anchor=g("]"),J,z),z)},k=(N,D,P,I,L,F)=>{if(Bo$1(),D.el=null,F){const z=O(N);for(;;){const ie=c(N);if(ie&&ie!==z)d(ie);else break}}const U=c(N),J=u(N);return d(N),s(null,D,J,U,P,I,al$1(J),L),U},O=(N,D="[",P="]")=>{let I=0;for(;N;)if(N=c(N),N&&bs$1(N)&&(N.data===D&&I++,N.data===P)){if(I===0)return c(N);I--}return N},R=(N,D,P)=>{const I=D.parentNode;I&&I.replaceChild(N,D);let L=P;for(;L;)L.vnode.el===D&&(L.vnode.el=L.subTree.el=N),L=L.parent},M=N=>N.nodeType===1&&N.tagName.toLowerCase()==="template";return[y,_]}const Xt$1=vy$1;function Bf$1(r){return ay$1(r)}function Hf$1(r){return ay$1(r,jN$1)}function ay$1(r,o){const s=vf$1();s.__VUE__=!0;const{insert:a,remove:l,patchProp:c,createElement:u,createText:d,createComment:m,setText:g,setElementText:y,parentNode:_,nextSibling:E,setScopeId:w=Ht$1,insertStaticContent:T}=r,k=(_ee,st,Lee,$te=null,Kee=null,Iee=null,Rte=void 0,dee=null,fee=!!st.dynamicChildren)=>{if(_ee===st)return;_ee&&!ur$1(_ee,st)&&($te=xte(_ee),Tee(_ee,Kee,Iee,!0),_ee=null),st.patchFlag===-2&&(fee=!1,st.dynamicChildren=null);const{type:Oee,ref:xee,shapeFlag:kee}=st;switch(Oee){case gr$1:O(_ee,st,Lee,$te);break;case Et:R(_ee,st,Lee,$te);break;case zr$1:_ee==null&&M(st,Lee,$te,Rte);break;case Ze:ie(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee);break;default:kee&1?P(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee):kee&6?ce(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee):(kee&64||kee&128)&&Oee.process(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee,Wee)}xee!=null&&Kee&&Ql$1(xee,_ee&&_ee.ref,Iee,st||_ee,!st)},O=(_ee,st,Lee,$te)=>{if(_ee==null)a(st.el=d(st.children),Lee,$te);else{const Kee=st.el=_ee.el;st.children!==_ee.children&&g(Kee,st.children)}},R=(_ee,st,Lee,$te)=>{_ee==null?a(st.el=m(st.children||""),Lee,$te):st.el=_ee.el},M=(_ee,st,Lee,$te)=>{[_ee.el,_ee.anchor]=T(_ee.children,st,Lee,$te,_ee.el,_ee.anchor)},N=({el:_ee,anchor:st},Lee,$te)=>{let Kee;for(;_ee&&_ee!==st;)Kee=E(_ee),a(_ee,Lee,$te),_ee=Kee;a(st,Lee,$te)},D=({el:_ee,anchor:st})=>{let Lee;for(;_ee&&_ee!==st;)Lee=E(_ee),l(_ee),_ee=Lee;l(st)},P=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{st.type==="svg"?Rte="svg":st.type==="math"&&(Rte="mathml"),_ee==null?I(st,Lee,$te,Kee,Iee,Rte,dee,fee):U(_ee,st,Kee,Iee,Rte,dee,fee)},I=(_ee,st,Lee,$te,Kee,Iee,Rte,dee)=>{let fee,Oee;const{props:xee,shapeFlag:kee,transition:Dte,dirs:Ite}=_ee;if(fee=_ee.el=u(_ee.type,Iee,xee&&xee.is,xee),kee&8?y(fee,_ee.children):kee&16&&F(_ee.children,fee,null,$te,Kee,Eu$1(_ee,Iee),Rte,dee),Ite&&Or$2(_ee,null,$te,"created"),L(fee,_ee,_ee.scopeId,Rte,$te),xee){for(const Vte in xee)Vte!=="value"&&!Gi$1(Vte)&&c(fee,Vte,null,xee[Vte],Iee,$te);"value"in xee&&c(fee,"value",null,xee.value,Iee),(Oee=xee.onVnodeBeforeMount)&&xn$1(Oee,$te,_ee)}Ite&&Or$2(_ee,null,$te,"beforeMount");const Lte=ly$1(Kee,Dte);Lte&&Dte.beforeEnter(fee),a(fee,st,Lee),((Oee=xee&&xee.onVnodeMounted)||Lte||Ite)&&Xt$1(()=>{Oee&&xn$1(Oee,$te,_ee),Lte&&Dte.enter(fee),Ite&&Or$2(_ee,null,$te,"mounted")},Kee)},L=(_ee,st,Lee,$te,Kee)=>{if(Lee&&w(_ee,Lee),$te)for(let Iee=0;Iee<$te.length;Iee++)w(_ee,$te[Iee]);if(Kee){let Iee=Kee.subTree;if(st===Iee){const Rte=Kee.vnode;L(_ee,Rte,Rte.scopeId,Rte.slotScopeIds,Kee.parent)}}},F=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee=0)=>{for(let Oee=fee;Oee<_ee.length;Oee++){const xee=_ee[Oee]=dee?ho$1(_ee[Oee]):bn$1(_ee[Oee]);k(null,xee,st,Lee,$te,Kee,Iee,Rte,dee)}},U=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=st.el=_ee.el;let{patchFlag:fee,dynamicChildren:Oee,dirs:xee}=st;fee|=_ee.patchFlag&16;const kee=_ee.props||ut,Dte=st.props||ut;let Ite;if(Lee&&Ho(Lee,!1),(Ite=Dte.onVnodeBeforeUpdate)&&xn$1(Ite,Lee,st,_ee),xee&&Or$2(st,_ee,Lee,"beforeUpdate"),Lee&&Ho(Lee,!0),(kee.innerHTML&&Dte.innerHTML==null||kee.textContent&&Dte.textContent==null)&&y(dee,""),Oee?J(_ee.dynamicChildren,Oee,dee,Lee,$te,Eu$1(st,Kee),Iee):Rte||St(_ee,st,dee,null,Lee,$te,Eu$1(st,Kee),Iee,!1),fee>0){if(fee&16)z(dee,kee,Dte,Lee,Kee);else if(fee&2&&kee.class!==Dte.class&&c(dee,"class",null,Dte.class,Kee),fee&4&&c(dee,"style",kee.style,Dte.style,Kee),fee&8){const Lte=st.dynamicProps;for(let Vte=0;Vte{Ite&&xn$1(Ite,Lee,st,_ee),xee&&Or$2(st,_ee,Lee,"updated")},$te)},J=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{for(let dee=0;dee{if(st!==Lee){if(st!==ut)for(const Iee in st)!Gi$1(Iee)&&!(Iee in Lee)&&c(_ee,Iee,st[Iee],null,Kee,$te);for(const Iee in Lee){if(Gi$1(Iee))continue;const Rte=Lee[Iee],dee=st[Iee];Rte!==dee&&Iee!=="value"&&c(_ee,Iee,dee,Rte,Kee,$te)}"value"in Lee&&c(_ee,"value",st.value,Lee.value,Kee)}},ie=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{const Oee=st.el=_ee?_ee.el:d(""),xee=st.anchor=_ee?_ee.anchor:d("");let{patchFlag:kee,dynamicChildren:Dte,slotScopeIds:Ite}=st;Ite&&(dee=dee?dee.concat(Ite):Ite),_ee==null?(a(Oee,Lee,$te),a(xee,Lee,$te),F(st.children||[],Lee,xee,Kee,Iee,Rte,dee,fee)):kee>0&&kee&64&&Dte&&_ee.dynamicChildren?(J(_ee.dynamicChildren,Dte,Lee,Kee,Iee,Rte,dee),(st.key!=null||Kee&&st===Kee.subTree)&&js$1(_ee,st,!0)):St(_ee,st,Lee,xee,Kee,Iee,Rte,dee,fee)},ce=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{st.slotScopeIds=dee,_ee==null?st.shapeFlag&512?Kee.ctx.activate(st,Lee,$te,Rte,fee):Y(st,Lee,$te,Kee,Iee,Rte,fee):B(_ee,st,fee)},Y=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=_ee.component=Ty$1(_ee,$te,Kee);if(vs$1(_ee)&&(dee.ctx.renderer=Wee),wy$1(dee,!1,Rte),dee.asyncDep){if(Kee&&Kee.registerDep(dee,V,Rte),!_ee.el){const fee=dee.subTree=A(Et);R(null,fee,st,Lee)}}else V(dee,_ee,st,Lee,Kee,Iee,Rte)},B=(_ee,st,Lee)=>{const $te=st.component=_ee.component;if(QN$1(_ee,st,Lee))if($te.asyncDep&&!$te.asyncResolved){Ge($te,st,Lee);return}else $te.next=st,XO$1($te.update),$te.effect.dirty=!0,$te.update();else st.el=_ee.el,$te.vnode=st},V=(_ee,st,Lee,$te,Kee,Iee,Rte)=>{const dee=()=>{if(_ee.isMounted){let{next:xee,bu:kee,u:Dte,parent:Ite,vnode:Lte}=_ee;{const Gte=cy$1(_ee);if(Gte){xee&&(xee.el=Lte.el,Ge(_ee,xee,Rte)),Gte.asyncDep.then(()=>{_ee.isUnmounted||dee()});return}}let Vte=xee,Pte;Ho(_ee,!1),xee?(xee.el=Lte.el,Ge(_ee,xee,Rte)):xee=Lte,kee&&Zo$1(kee),(Pte=xee.props&&xee.props.onVnodeBeforeUpdate)&&xn$1(Pte,Ite,xee,Lte),Ho(_ee,!0);const Fte=Tl$1(_ee),Ute=_ee.subTree;_ee.subTree=Fte,k(Ute,Fte,_(Ute.el),xte(Ute),_ee,Kee,Iee),xee.el=Fte.el,Vte===null&&Xf$1(_ee,Fte.el),Dte&&Xt$1(Dte,Kee),(Pte=xee.props&&xee.props.onVnodeUpdated)&&Xt$1(()=>xn$1(Pte,Ite,xee,Lte),Kee)}else{let xee;const{el:kee,props:Dte}=st,{bm:Ite,m:Lte,parent:Vte}=_ee,Pte=li$1(st);if(Ho(_ee,!1),Ite&&Zo$1(Ite),!Pte&&(xee=Dte&&Dte.onVnodeBeforeMount)&&xn$1(xee,Vte,st),Ho(_ee,!0),kee&&Nte){const Fte=()=>{_ee.subTree=Tl$1(_ee),Nte(kee,_ee.subTree,_ee,Kee,null)};Pte?st.type.__asyncLoader().then(()=>!_ee.isUnmounted&&Fte()):Fte()}else{const Fte=_ee.subTree=Tl$1(_ee);k(null,Fte,Lee,$te,_ee,Kee,Iee),st.el=Fte.el}if(Lte&&Xt$1(Lte,Kee),!Pte&&(xee=Dte&&Dte.onVnodeMounted)){const Fte=st;Xt$1(()=>xn$1(xee,Vte,Fte),Kee)}(st.shapeFlag&256||Vte&&li$1(Vte.vnode)&&Vte.vnode.shapeFlag&256)&&_ee.a&&Xt$1(_ee.a,Kee),_ee.isMounted=!0,st=Lee=$te=null}},fee=_ee.effect=new hi$1(dee,Ht$1,()=>Da$1(Oee),_ee.scope),Oee=_ee.update=()=>{fee.dirty&&fee.run()};Oee.i=_ee,Oee.id=_ee.uid,Ho(_ee,!0),Oee()},Ge=(_ee,st,Lee)=>{st.component=_ee;const $te=_ee.vnode.props;_ee.vnode=st,_ee.next=null,TN$1(_ee,st.props,$te,Lee),RN$1(_ee,st.children,Lee),no$1(),sm$1(_ee),ro$1()},St=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee=!1)=>{const Oee=_ee&&_ee.children,xee=_ee?_ee.shapeFlag:0,kee=st.children,{patchFlag:Dte,shapeFlag:Ite}=st;if(Dte>0){if(Dte&128){pee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee);return}else if(Dte&256){Dee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee);return}}Ite&8?(xee&16&&ete(Oee,Kee,Iee),kee!==Oee&&y(Lee,kee)):xee&16?Ite&16?pee(Oee,kee,Lee,$te,Kee,Iee,Rte,dee,fee):ete(Oee,Kee,Iee,!0):(xee&8&&y(Lee,""),Ite&16&&F(kee,Lee,$te,Kee,Iee,Rte,dee,fee))},Dee=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{_ee=_ee||Wi$1,st=st||Wi$1;const Oee=_ee.length,xee=st.length,kee=Math.min(Oee,xee);let Dte;for(Dte=0;Dtexee?ete(_ee,Kee,Iee,!0,!1,kee):F(st,Lee,$te,Kee,Iee,Rte,dee,fee,kee)},pee=(_ee,st,Lee,$te,Kee,Iee,Rte,dee,fee)=>{let Oee=0;const xee=st.length;let kee=_ee.length-1,Dte=xee-1;for(;Oee<=kee&&Oee<=Dte;){const Ite=_ee[Oee],Lte=st[Oee]=fee?ho$1(st[Oee]):bn$1(st[Oee]);if(ur$1(Ite,Lte))k(Ite,Lte,Lee,null,Kee,Iee,Rte,dee,fee);else break;Oee++}for(;Oee<=kee&&Oee<=Dte;){const Ite=_ee[kee],Lte=st[Dte]=fee?ho$1(st[Dte]):bn$1(st[Dte]);if(ur$1(Ite,Lte))k(Ite,Lte,Lee,null,Kee,Iee,Rte,dee,fee);else break;kee--,Dte--}if(Oee>kee){if(Oee<=Dte){const Ite=Dte+1,Lte=IteDte)for(;Oee<=kee;)Tee(_ee[Oee],Kee,Iee,!0),Oee++;else{const Ite=Oee,Lte=Oee,Vte=new Map;for(Oee=Lte;Oee<=Dte;Oee++){const zte=st[Oee]=fee?ho$1(st[Oee]):bn$1(st[Oee]);zte.key!=null&&Vte.set(zte.key,Oee)}let Pte,Fte=0;const Ute=Dte-Lte+1;let Gte=!1,jte=0;const Bte=new Array(Ute);for(Oee=0;Oee=Ute){Tee(zte,Kee,Iee,!0);continue}let qte;if(zte.key!=null)qte=Vte.get(zte.key);else for(Pte=Lte;Pte<=Dte;Pte++)if(Bte[Pte-Lte]===0&&ur$1(zte,st[Pte])){qte=Pte;break}qte===void 0?Tee(zte,Kee,Iee,!0):(Bte[qte-Lte]=Oee+1,qte>=jte?jte=qte:Gte=!0,k(zte,st[qte],Lee,null,Kee,Iee,Rte,dee,fee),Fte++)}const Hte=Gte?KN$1(Bte):Wi$1;for(Pte=Hte.length-1,Oee=Ute-1;Oee>=0;Oee--){const zte=Lte+Oee,qte=st[zte],Wte=zte+1{const{el:Iee,type:Rte,transition:dee,children:fee,shapeFlag:Oee}=_ee;if(Oee&6){jr(_ee.component.subTree,st,Lee,$te);return}if(Oee&128){_ee.suspense.move(st,Lee,$te);return}if(Oee&64){Rte.move(_ee,st,Lee,Wee);return}if(Rte===Ze){a(Iee,st,Lee);for(let xee=0;xeedee.enter(Iee),Kee);else{const{leave:xee,delayLeave:kee,afterLeave:Dte}=dee,Ite=()=>a(Iee,st,Lee),Lte=()=>{xee(Iee,()=>{Ite(),Dte&&Dte()})};kee?kee(Iee,Ite,Lte):Lte()}else a(Iee,st,Lee)},Tee=(_ee,st,Lee,$te=!1,Kee=!1)=>{const{type:Iee,props:Rte,ref:dee,children:fee,dynamicChildren:Oee,shapeFlag:xee,patchFlag:kee,dirs:Dte,cacheIndex:Ite}=_ee;if(kee===-2&&(Kee=!1),dee!=null&&Ql$1(dee,null,Lee,_ee,!0),Ite!=null&&(st.renderCache[Ite]=void 0),xee&256){st.ctx.deactivate(_ee);return}const Lte=xee&1&&Dte,Vte=!li$1(_ee);let Pte;if(Vte&&(Pte=Rte&&Rte.onVnodeBeforeUnmount)&&xn$1(Pte,st,_ee),xee&6)yee(_ee.component,Lee,$te);else{if(xee&128){_ee.suspense.unmount(Lee,$te);return}Lte&&Or$2(_ee,null,st,"beforeUnmount"),xee&64?_ee.type.remove(_ee,st,Lee,Wee,$te):Oee&&!Oee.hasOnce&&(Iee!==Ze||kee>0&&kee&64)?ete(Oee,st,Lee,!1,!0):(Iee===Ze&&kee&384||!Kee&&xee&16)&&ete(fee,st,Lee),$te&&et(_ee)}(Vte&&(Pte=Rte&&Rte.onVnodeUnmounted)||Lte)&&Xt$1(()=>{Pte&&xn$1(Pte,st,_ee),Lte&&Or$2(_ee,null,st,"unmounted")},Lee)},et=_ee=>{const{type:st,el:Lee,anchor:$te,transition:Kee}=_ee;if(st===Ze){ft(Lee,$te);return}if(st===zr$1){D(_ee);return}const Iee=()=>{l(Lee),Kee&&!Kee.persisted&&Kee.afterLeave&&Kee.afterLeave()};if(_ee.shapeFlag&1&&Kee&&!Kee.persisted){const{leave:Rte,delayLeave:dee}=Kee,fee=()=>Rte(Lee,Iee);dee?dee(_ee.el,Iee,fee):fee()}else Iee()},ft=(_ee,st)=>{let Lee;for(;_ee!==st;)Lee=E(_ee),l(_ee),_ee=Lee;l(st)},yee=(_ee,st,Lee)=>{const{bum:$te,scope:Kee,update:Iee,subTree:Rte,um:dee,m:fee,a:Oee}=_ee;Zl$1(fee),Zl$1(Oee),$te&&Zo$1($te),Kee.stop(),Iee&&(Iee.active=!1,Tee(Rte,_ee,st,Lee)),dee&&Xt$1(dee,st),Xt$1(()=>{_ee.isUnmounted=!0},st),st&&st.pendingBranch&&!st.isUnmounted&&_ee.asyncDep&&!_ee.asyncResolved&&_ee.suspenseId===st.pendingId&&(st.deps--,st.deps===0&&st.resolve())},ete=(_ee,st,Lee,$te=!1,Kee=!1,Iee=0)=>{for(let Rte=Iee;Rte<_ee.length;Rte++)Tee(_ee[Rte],st,Lee,$te,Kee)},xte=_ee=>{if(_ee.shapeFlag&6)return xte(_ee.component.subTree);if(_ee.shapeFlag&128)return _ee.suspense.next();const st=E(_ee.anchor||_ee.el),Lee=st&&st[ny$1];return Lee?E(Lee):st};let Ote=!1;const nee=(_ee,st,Lee)=>{_ee==null?st._vnode&&Tee(st._vnode,null,null,!0):k(st._vnode||null,_ee,st,null,null,null,Lee),st._vnode=_ee,Ote||(Ote=!0,sm$1(),Yl$1(),Ote=!1)},Wee={p:k,um:Tee,m:jr,r:et,mt:Y,mc:F,pc:St,pbc:J,n:xte,o:r};let Bee,Nte;return o&&([Bee,Nte]=o(Wee)),{render:nee,hydrate:Bee,createApp:ON$1(nee,Bee)}}function Eu$1({type:r,props:o},s){return s==="svg"&&r==="foreignObject"||s==="mathml"&&r==="annotation-xml"&&o&&o.encoding&&o.encoding.includes("html")?void 0:s}function Ho({effect:r,update:o},s){r.allowRecurse=o.allowRecurse=s}function ly$1(r,o){return(!r||r&&!r.pendingBranch)&&o&&!o.persisted}function js$1(r,o,s=!1){const a=r.children,l=o.children;if(ke(a)&&ke(l))for(let c=0;c>1,r[s[d]]0&&(o[a]=s[c-1]),s[c]=a)}}for(c=s.length,u=s[c-1];c-- >0;)s[c]=u,u=o[u];return s}function cy$1(r){const o=r.subTree.component;if(o)return o.asyncDep&&!o.asyncResolved?o:cy$1(o)}function Zl$1(r){if(r)for(let o=0;oCo$1(Wf$1);function uy$1(r,o){return $a$1(r,null,o)}function Kf$1(r,o){return $a$1(r,null,{flush:"post"})}function Yf$1(r,o){return $a$1(r,null,{flush:"sync"})}const ll$2={};function Oe(r,o,s){return $a$1(r,o,s)}function $a$1(r,o,{immediate:s,deep:a,flush:l,once:c,onTrack:u,onTrigger:d}=ut){if(o&&c){const I=o;o=(...L)=>{I(...L),P()}}const m=Mt$1,g=I=>a===!0?I:bo$1(I,a===!1?1:void 0);let y,_=!1,E=!1;if(Ce(r)?(y=()=>r.value,_=mr$1(r)):Cn$1(r)?(y=()=>g(r),_=!0):ke(r)?(E=!0,_=r.some(I=>Cn$1(I)||mr$1(I)),y=()=>r.map(I=>{if(Ce(I))return I.value;if(Cn$1(I))return g(I);if(Ve$1(I))return hr$2(I,m,2)})):Ve$1(r)?o?y=()=>hr$2(r,m,2):y=()=>(w&&w(),Vn(r,m,3,[T])):y=Ht$1,o&&a){const I=y;y=()=>bo$1(I())}let w,T=I=>{w=N.onStop=()=>{hr$2(I,m,4),w=N.onStop=void 0}},k;if(ka$1)if(T=Ht$1,o?s&&Vn(o,m,3,[y(),E?[]:void 0,T]):y(),l==="sync"){const I=Gf$1();k=I.__watcherHandles||(I.__watcherHandles=[])}else return Ht$1;let O=E?new Array(r.length).fill(ll$2):ll$2;const R=()=>{if(!(!N.active||!N.dirty))if(o){const I=N.run();(a||_||(E?I.some((L,F)=>Kr$1(L,O[F])):Kr$1(I,O)))&&(w&&w(),Vn(o,m,3,[I,O===ll$2?void 0:E&&O[0]===ll$2?[]:O,T]),O=I)}else N.run()};R.allowRecurse=!!o;let M;l==="sync"?M=R:l==="post"?M=()=>Xt$1(R,m&&m.suspense):(R.pre=!0,m&&(R.id=m.uid),M=()=>Da$1(R));const N=new hi$1(y,Ht$1,M),D=Vc$1(),P=()=>{N.stop(),D&&gf$1(D.effects,N)};return o?s?R():O=N.run():l==="post"?Xt$1(N.run.bind(N),m&&m.suspense):N.run(),k&&k.push(P),P}function YN$1(r,o,s){const a=this.proxy,l=_t$1(r)?r.includes(".")?dy$1(a,r):()=>a[r]:r.bind(a,a);let c;Ve$1(o)?c=o:(c=o.handler,s=o);const u=Ei$1(this),d=$a$1(l,c.bind(a),s);return u(),d}function dy$1(r,o){const s=o.split(".");return()=>{let a=r;for(let l=0;l{bo$1(a,o,s)});else if(uv$1(r)){for(const a in r)bo$1(r[a],o,s);for(const a of Object.getOwnPropertySymbols(r))Object.prototype.propertyIsEnumerable.call(r,a)&&bo$1(r[a],o,s)}return r}function ec$1(r,o,s=ut){const a=qt$1(),l=pn$1(o),c=Zr$1(o),u=fy$1(r,o),d=hf$1((m,g)=>{let y,_=ut,E;return Yf$1(()=>{const w=r[o];Kr$1(y,w)&&(y=w,g())}),{get(){return m(),s.get?s.get(y):y},set(w){const T=s.set?s.set(w):w;if(!Kr$1(T,y)&&!(_!==ut&&Kr$1(w,_)))return;const k=a.vnode.props;k&&(o in k||l in k||c in k)&&(`onUpdate:${o}`in k||`onUpdate:${l}`in k||`onUpdate:${c}`in k)||(y=w,g()),a.emit(`update:${o}`,T),Kr$1(w,T)&&Kr$1(w,_)&&!Kr$1(T,E)&&g(),_=w,E=T}}});return d[Symbol.iterator]=()=>{let m=0;return{next(){return m<2?{value:m++?u||ut:d,done:!1}:{done:!0}}}},d}const fy$1=(r,o)=>o==="modelValue"||o==="model-value"?r.modelModifiers:r[`${o}Modifiers`]||r[`${pn$1(o)}Modifiers`]||r[`${Zr$1(o)}Modifiers`];function XN$1(r,o,...s){if(r.isUnmounted)return;const a=r.vnode.props||ut;let l=s;const c=o.startsWith("update:"),u=c&&fy$1(a,o.slice(7));u&&(u.trim&&(l=s.map(y=>_t$1(y)?y.trim():y)),u.number&&(l=s.map(wO$1)));let d,m=a[d=Nr$1(o)]||a[d=Nr$1(pn$1(o))];!m&&c&&(m=a[d=Nr$1(Zr$1(o))]),m&&Vn(m,r,6,l);const g=a[d+"Once"];if(g){if(!r.emitted)r.emitted={};else if(r.emitted[d])return;r.emitted[d]=!0,Vn(g,r,6,l)}}function py$1(r,o,s=!1){const a=o.emitsCache,l=a.get(r);if(l!==void 0)return l;const c=r.emits;let u={},d=!1;if(!Ve$1(r)){const m=g=>{const y=py$1(g,o,!0);y&&(d=!0,kt$1(u,y))};!s&&o.mixins.length&&o.mixins.forEach(m),r.extends&&m(r.extends),r.mixins&&r.mixins.forEach(m)}return!c&&!d?(ht(r)&&a.set(r,null),null):(ke(c)?c.forEach(m=>u[m]=null):kt$1(u,c),ht(r)&&a.set(r,u),u)}function Gc$1(r,o){return!r||!Ca$1(o)?!1:(o=o.slice(2).replace(/Once$/,""),at(r,o[0].toLowerCase()+o.slice(1))||at(r,Zr$1(o))||at(r,o))}function tc$1(){}function Tl$1(r){const{type:o,vnode:s,proxy:a,withProxy:l,propsOptions:[c],slots:u,attrs:d,emit:m,render:g,renderCache:y,props:_,data:E,setupState:w,ctx:T,inheritAttrs:k}=r,O=oa$1(r);let R,M;try{if(s.shapeFlag&4){const D=l||a,P=D;R=bn$1(g.call(P,D,y,_,w,E,T)),M=d}else{const D=o;R=bn$1(D.length>1?D(_,{attrs:d,slots:u,emit:m}):D(_,null)),M=o.props?d:zN$1(d)}}catch(D){Bs$1.length=0,oo$1(D,r,1),R=A(Et)}let N=R;if(M&&k!==!1){const D=Object.keys(M),{shapeFlag:P}=N;D.length&&P&7&&(c&&D.some(Zu$1)&&(M=JN$1(M,c)),N=jn$1(N,M,!1,!0))}return s.dirs&&(N=jn$1(N,null,!1,!0),N.dirs=N.dirs?N.dirs.concat(s.dirs):s.dirs),s.transition&&(N.transition=s.transition),R=N,oa$1(O),R}function Kc$1(r,o=!0){let s;for(let a=0;a{let o;for(const s in r)(s==="class"||s==="style"||Ca$1(s))&&((o||(o={}))[s]=r[s]);return o},JN$1=(r,o)=>{const s={};for(const a in r)(!Zu$1(a)||!(a.slice(9)in o))&&(s[a]=r[a]);return s};function QN$1(r,o,s){const{props:a,children:l,component:c}=r,{props:u,children:d,patchFlag:m}=o,g=c.emitsOptions;if(o.dirs||o.transition)return!0;if(s&&m>=0){if(m&1024)return!0;if(m&16)return a?Om$1(a,u,g):!!u;if(m&8){const y=o.dynamicProps;for(let _=0;_r.__isSuspense;let dd$2=0;const qN$1={name:"Suspense",__isSuspense:!0,process(r,o,s,a,l,c,u,d,m,g){if(r==null)ZN$1(o,s,a,l,c,u,d,m,g);else{if(c&&c.deps>0&&!r.suspense.isInFallback){o.suspense=r.suspense,o.suspense.vnode=o,o.el=r.el;return}e0$1(r,o,s,a,l,u,d,m,g)}},hydrate:t0$1,normalize:n0$1},hy$1=qN$1;function sa$1(r,o){const s=r.props&&r.props[o];Ve$1(s)&&s()}function ZN$1(r,o,s,a,l,c,u,d,m){const{p:g,o:{createElement:y}}=m,_=y("div"),E=r.suspense=gy$1(r,l,a,o,_,s,c,u,d,m);g(null,E.pendingBranch=r.ssContent,_,null,a,E,c,u),E.deps>0?(sa$1(r,"onPending"),sa$1(r,"onFallback"),g(null,r.ssFallback,o,s,a,null,c,u),Yi$1(E,r.ssFallback)):E.resolve(!1,!0)}function e0$1(r,o,s,a,l,c,u,d,{p:m,um:g,o:{createElement:y}}){const _=o.suspense=r.suspense;_.vnode=o,o.el=r.el;const E=o.ssContent,w=o.ssFallback,{activeBranch:T,pendingBranch:k,isInFallback:O,isHydrating:R}=_;if(k)_.pendingBranch=E,ur$1(E,k)?(m(k,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0?_.resolve():O&&(R||(m(T,w,s,a,l,null,c,u,d),Yi$1(_,w)))):(_.pendingId=dd$2++,R?(_.isHydrating=!1,_.activeBranch=k):g(k,l,_),_.deps=0,_.effects.length=0,_.hiddenContainer=y("div"),O?(m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0?_.resolve():(m(T,w,s,a,l,null,c,u,d),Yi$1(_,w))):T&&ur$1(E,T)?(m(T,E,s,a,l,_,c,u,d),_.resolve(!0)):(m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0&&_.resolve()));else if(T&&ur$1(E,T))m(T,E,s,a,l,_,c,u,d),Yi$1(_,E);else if(sa$1(o,"onPending"),_.pendingBranch=E,E.shapeFlag&512?_.pendingId=E.component.suspenseId:_.pendingId=dd$2++,m(null,E,_.hiddenContainer,null,l,_,c,u,d),_.deps<=0)_.resolve();else{const{timeout:M,pendingId:N}=_;M>0?setTimeout(()=>{_.pendingId===N&&_.fallback(w)},M):M===0&&_.fallback(w)}}function gy$1(r,o,s,a,l,c,u,d,m,g,y=!1){const{p:_,m:E,um:w,n:T,o:{parentNode:k,remove:O}}=g;let R;const M=r0$1(r);M&&o&&o.pendingBranch&&(R=o.pendingId,o.deps++);const N=r.props?IO$1(r.props.timeout):void 0,D=c,P={vnode:r,parent:o,parentComponent:s,namespace:u,container:a,hiddenContainer:l,deps:0,pendingId:dd$2++,timeout:typeof N=="number"?N:-1,activeBranch:null,pendingBranch:null,isInFallback:!y,isHydrating:y,isUnmounted:!1,effects:[],resolve(I=!1,L=!1){const{vnode:F,activeBranch:U,pendingBranch:J,pendingId:z,effects:ie,parentComponent:ce,container:Y}=P;let B=!1;P.isHydrating?P.isHydrating=!1:I||(B=U&&J.transition&&J.transition.mode==="out-in",B&&(U.transition.afterLeave=()=>{z===P.pendingId&&(E(J,Y,c===D?T(U):c,0),Ji$1(ie))}),U&&(k(U.el)!==P.hiddenContainer&&(c=T(U)),w(U,ce,P,!0)),B||E(J,Y,c,0)),Yi$1(P,J),P.pendingBranch=null,P.isInFallback=!1;let V=P.parent,Ge=!1;for(;V;){if(V.pendingBranch){V.effects.push(...ie),Ge=!0;break}V=V.parent}!Ge&&!B&&Ji$1(ie),P.effects=[],M&&o&&o.pendingBranch&&R===o.pendingId&&(o.deps--,o.deps===0&&!L&&o.resolve()),sa$1(F,"onResolve")},fallback(I){if(!P.pendingBranch)return;const{vnode:L,activeBranch:F,parentComponent:U,container:J,namespace:z}=P;sa$1(L,"onFallback");const ie=T(F),ce=()=>{P.isInFallback&&(_(null,I,J,ie,U,null,z,d,m),Yi$1(P,I))},Y=I.transition&&I.transition.mode==="out-in";Y&&(F.transition.afterLeave=ce),P.isInFallback=!0,w(F,U,null,!0),Y||ce()},move(I,L,F){P.activeBranch&&E(P.activeBranch,I,L,F),P.container=I},next(){return P.activeBranch&&T(P.activeBranch)},registerDep(I,L,F){const U=!!P.pendingBranch;U&&P.deps++;const J=I.vnode.el;I.asyncDep.catch(z=>{oo$1(z,I,0)}).then(z=>{if(I.isUnmounted||P.isUnmounted||P.pendingId!==I.suspenseId)return;I.asyncResolved=!0;const{vnode:ie}=I;gd$1(I,z,!1),J&&(ie.el=J);const ce=!J&&I.subTree.el;L(I,ie,k(J||I.subTree.el),J?null:T(I.subTree),P,u,F),ce&&O(ce),Xf$1(I,ie.el),U&&--P.deps===0&&P.resolve()})},unmount(I,L){P.isUnmounted=!0,P.activeBranch&&w(P.activeBranch,s,I,L),P.pendingBranch&&w(P.pendingBranch,s,I,L)}};return P}function t0$1(r,o,s,a,l,c,u,d,m){const g=o.suspense=gy$1(o,a,s,r.parentNode,document.createElement("div"),null,l,c,u,d,!0),y=m(r,g.pendingBranch=o.ssContent,s,g,c,u);return g.deps===0&&g.resolve(!1,!0),y}function n0$1(r){const{shapeFlag:o,children:s}=r,a=o&32;r.ssContent=Sm$1(a?s.default:s),r.ssFallback=a?Sm$1(s.fallback):A(Et)}function Sm$1(r){let o;if(Ve$1(r)){const s=bi$1&&r._c;s&&(r._d=!1,H()),r=r(),s&&(r._d=!0,o=fn$1,yy$1())}return ke(r)&&(r=Kc$1(r)),r=bn$1(r),o&&!r.dynamicChildren&&(r.dynamicChildren=o.filter(s=>s!==r)),r}function vy$1(r,o){o&&o.pendingBranch?ke(r)?o.effects.push(...r):o.effects.push(r):Ji$1(r)}function Yi$1(r,o){r.activeBranch=o;const{vnode:s,parentComponent:a}=r;let l=o.el;for(;!l&&o.component;)o=o.component.subTree,l=o.el;s.el=l,a&&a.subTree===s&&(a.vnode.el=l,Xf$1(a,l))}function r0$1(r){const o=r.props&&r.props.suspensible;return o!=null&&o!==!1}const Ze=Symbol.for("v-fgt"),gr$1=Symbol.for("v-txt"),Et=Symbol.for("v-cmt"),zr$1=Symbol.for("v-stc"),Bs$1=[];let fn$1=null;function H(r=!1){Bs$1.push(fn$1=r?null:[])}function yy$1(){Bs$1.pop(),fn$1=Bs$1[Bs$1.length-1]||null}let bi$1=1;function nc$1(r){bi$1+=r,r<0&&fn$1&&(fn$1.hasOnce=!0)}function by$1(r){return r.dynamicChildren=bi$1>0?fn$1||Wi$1:null,yy$1(),bi$1>0&&fn$1&&fn$1.push(r),r}function ae(r,o,s,a,l,c){return by$1(b(r,o,s,a,l,c,!0))}function be(r,o,s,a,l){return by$1(A(r,o,s,a,l,!0))}function br$1(r){return r?r.__v_isVNode===!0:!1}function ur$1(r,o){return r.type===o.type&&r.key===o.key}function Ey$1(r){}const _y$1=({key:r})=>r??null,xl$1=({ref:r,ref_key:o,ref_for:s})=>(typeof r=="number"&&(r=""+r),r!=null?_t$1(r)||Ce(r)||Ve$1(r)?{i:Pt,r,k:o,f:!!s}:r:null);function b(r,o=null,s=null,a=0,l=null,c=r===Ze?0:1,u=!1,d=!1){const m={__v_isVNode:!0,__v_skip:!0,type:r,props:o,key:o&&_y$1(o),ref:o&&xl$1(o),scopeId:Uc$1,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:a,dynamicProps:l,dynamicChildren:null,appContext:null,ctx:Pt};return d?(Jf$1(m,s),c&128&&r.normalize(m)):s&&(m.shapeFlag|=_t$1(s)?8:16),bi$1>0&&!u&&fn$1&&(m.patchFlag>0||c&6)&&m.patchFlag!==32&&fn$1.push(m),m}const A=Oy$1;function Oy$1(r,o=null,s=null,a=0,l=null,c=!1){if((!r||r===Df$1)&&(r=Et),br$1(r)){const d=jn$1(r,o,!0);return s&&Jf$1(d,s),bi$1>0&&!c&&fn$1&&(d.shapeFlag&6?fn$1[fn$1.indexOf(r)]=d:fn$1.push(d)),d.patchFlag=-2,d}if(Vy$1(r)&&(r=r.__vccOpts),o){o=zf$1(o);let{class:d,style:m}=o;d&&!_t$1(d)&&(o.class=yt$1(d)),ht(m)&&(zi(m)&&!ke(m)&&(m=kt$1({},m)),o.style=wi$1(m))}const u=_t$1(r)?1:ud$1(r)?128:MN$1(r)?64:ht(r)?4:Ve$1(r)?2:0;return b(r,o,s,a,l,u,c,!0)}function zf$1(r){return r?zi(r)||zv$1(r)?kt$1({},r):r:null}function jn$1(r,o,s=!1,a=!1){const{props:l,ref:c,patchFlag:u,children:d,transition:m}=r,g=o?Qf$1(l||{},o):l,y={__v_isVNode:!0,__v_skip:!0,type:r.type,props:g,key:g&&_y$1(g),ref:o&&o.ref?s&&c?ke(c)?c.concat(xl$1(o)):[c,xl$1(o)]:xl$1(o):c,scopeId:r.scopeId,slotScopeIds:r.slotScopeIds,children:d,target:r.target,targetStart:r.targetStart,targetAnchor:r.targetAnchor,staticCount:r.staticCount,shapeFlag:r.shapeFlag,patchFlag:o&&r.type!==Ze?u===-1?16:u|16:u,dynamicProps:r.dynamicProps,dynamicChildren:r.dynamicChildren,appContext:r.appContext,dirs:r.dirs,transition:m,component:r.component,suspense:r.suspense,ssContent:r.ssContent&&jn$1(r.ssContent),ssFallback:r.ssFallback&&jn$1(r.ssFallback),el:r.el,anchor:r.anchor,ctx:r.ctx,ce:r.ce};return m&&a&&eo$1(y,m.clone(y)),y}function to$1(r=" ",o=0){return A(gr$1,null,r,o)}function Sy$1(r,o){const s=A(zr$1,null,r);return s.staticCount=o,s}function xe(r="",o=!1){return o?(H(),be(Et,null,r)):A(Et,null,r)}function bn$1(r){return r==null||typeof r=="boolean"?A(Et):ke(r)?A(Ze,null,r.slice()):typeof r=="object"?ho$1(r):A(gr$1,null,String(r))}function ho$1(r){return r.el===null&&r.patchFlag!==-1||r.memo?r:jn$1(r)}function Jf$1(r,o){let s=0;const{shapeFlag:a}=r;if(o==null)o=null;else if(ke(o))s=16;else if(typeof o=="object")if(a&65){const l=o.default;l&&(l._c&&(l._d=!1),Jf$1(r,l()),l._c&&(l._d=!0));return}else{s=32;const l=o._;!l&&!zv$1(o)?o._ctx=Pt:l===3&&Pt&&(Pt.slots._===1?o._=1:(o._=2,r.patchFlag|=1024))}else Ve$1(o)?(o={default:o,_ctx:Pt},s=32):(o=String(o),a&64?(s=16,o=[to$1(o)]):s=8);r.children=o,r.shapeFlag|=s}function Qf$1(...r){const o={};for(let s=0;sMt$1||Pt;let rc$1,pd$1;{const r=vf$1(),o=(s,a)=>{let l;return(l=r[s])||(l=r[s]=[]),l.push(a),c=>{l.length>1?l.forEach(u=>u(c)):l[0](c)}};rc$1=o("__VUE_INSTANCE_SETTERS__",s=>Mt$1=s),pd$1=o("__VUE_SSR_SETTERS__",s=>ka$1=s)}const Ei$1=r=>{const o=Mt$1;return rc$1(r),r.scope.on(),()=>{r.scope.off(),rc$1(o)}},md$1=()=>{Mt$1&&Mt$1.scope.off(),rc$1(null)};function xy$1(r){return r.vnode.shapeFlag&4}let ka$1=!1;function wy$1(r,o=!1,s=!1){o&&pd$1(o);const{props:a,children:l}=r.vnode,c=xy$1(r);NN$1(r,a,c,o),PN$1(r,l,s);const u=c?l0$1(r,o):void 0;return o&&pd$1(!1),u}function l0$1(r,o){const s=r.type;r.accessCache=Object.create(null),r.proxy=new Proxy(r.ctx,Us$1);const{setup:a}=s;if(a){const l=r.setupContext=a.length>1?Cy$1(r):null,c=Ei$1(r);no$1();const u=hr$2(a,r,0,[r.props,l]);if(ro$1(),c(),Mc$1(u)){if(u.then(md$1,md$1),o)return u.then(d=>{gd$1(r,d,o)}).catch(d=>{oo$1(d,r,0)});r.asyncDep=u}else gd$1(r,u,o)}else Iy$1(r,o)}function gd$1(r,o,s){Ve$1(o)?r.type.__ssrInlineRender?r.ssrRender=o:r.render=o:ht(o)&&(r.setupState=Rc$1(o)),Iy$1(r,s)}let Hs$1,vd$1;function qf$1(r){Hs$1=r,vd$1=o=>{o.render._rc&&(o.withProxy=new Proxy(o.ctx,dN$1))}}const Yc$1=()=>!Hs$1;function Iy$1(r,o,s){const a=r.type;if(!r.render){if(!o&&Hs$1&&!a.render){const l=a.template||kf$1(r).template;if(l){const{isCustomElement:c,compilerOptions:u}=r.appContext.config,{delimiters:d,compilerOptions:m}=a,g=kt$1(kt$1({isCustomElement:c,delimiters:d},u),m);a.render=Hs$1(l,g)}}r.render=a.render||Ht$1,vd$1&&vd$1(r)}{const l=Ei$1(r);no$1();try{gN$1(r)}finally{ro$1(),l()}}}const Tm$1={get(r,o){return sn$1(r,"get",""),r[o]}};function Cy$1(r){const o=s=>{r.exposed=s||{}};return{attrs:new Proxy(r.attrs,Tm$1),slots:r.slots,emit:r.emit,expose:o}}function Fa$1(r){return r.exposed?r.exposeProxy||(r.exposeProxy=new Proxy(Rc$1(xr$1(r.exposed)),{get(o,s){if(s in o)return o[s];if(s in ci$1)return ci$1[s](r)},has(o,s){return s in o||s in ci$1}})):r.proxy}const u0$1=/(?:^|[-_])(\w)/g,d0$1=r=>r.replace(u0$1,o=>o.toUpperCase()).replace(/[-_]/g,"");function aa$1(r,o=!0){return Ve$1(r)?r.displayName||r.name:r.name||o&&r.__name}function Xc$1(r,o,s=!1){let a=aa$1(o);if(!a&&o.__file){const l=o.__file.match(/([^/\\]+)\.\w+$/);l&&(a=l[1])}if(!a&&r&&r.parent){const l=c=>{for(const u in c)if(c[u]===o)return u};a=l(r.components||r.parent.type.components)||l(r.appContext.components)}return a?d0$1(a):s?"App":"Anonymous"}function Vy$1(r){return Ve$1(r)&&"__vccOpts"in r}const xt$1=(r,o)=>mO$1(r,o,ka$1);function dr$1(r,o,s){const a=arguments.length;return a===2?ht(o)&&!ke(o)?br$1(o)?A(r,null,[o]):A(r,o):A(r,null,o):(a>3?s=Array.prototype.slice.call(arguments,2):a===3&&br$1(s)&&(s=[s]),A(r,o,s))}function Zf$1(){}function Dy$1(r,o,s,a){const l=s[a];if(l&&ep$1(l,r))return l;const c=o();return c.memo=r.slice(),c.cacheIndex=a,s[a]=c}function ep$1(r,o){const s=r.memo;if(s.length!=o.length)return!1;for(let a=0;a0&&fn$1&&fn$1.push(r),!0}const oc$1="3.4.37",Ut$1=Ht$1,Ay$1=Fc$1,Ly$1=cr$1,Py$1=Ef$1,f0$1={createComponentInstance:Ty$1,setupComponent:wy$1,renderComponentRoot:Tl$1,setCurrentRenderingInstance:oa$1,isVNode:br$1,normalizeVNode:bn$1,getComponentPublicInstance:Fa$1,ensureValidVNode:Pf$1},Ry$1=f0$1,My$1=null,$y$1=null,ky$1=null;/** -* @vue/shared v3.4.37 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function zc$1(r,o){const s=new Set(r.split(","));return a=>s.has(a)}const _u$1={},m0$1=r=>r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&(r.charCodeAt(2)>122||r.charCodeAt(2)<97),h0$1=r=>r.startsWith("onUpdate:"),Ua$1=Object.assign,Ln$1=Array.isArray,ja$1=r=>Fy$1(r)==="[object Set]",xm$1=r=>Fy$1(r)==="[object Date]",tp$1=r=>typeof r=="function",la$1=r=>typeof r=="string",yd$1=r=>typeof r=="symbol",bd$1=r=>r!==null&&typeof r=="object",g0$1=Object.prototype.toString,Fy$1=r=>g0$1.call(r),np$1=r=>{const o=Object.create(null);return s=>o[s]||(o[s]=r(s))},v0$1=/-(\w)/g,Ou$1=np$1(r=>r.replace(v0$1,(o,s)=>s?s.toUpperCase():"")),y0$1=/\B([A-Z])/g,Eo$1=np$1(r=>r.replace(y0$1,"-$1").toLowerCase()),b0$1=np$1(r=>r.charAt(0).toUpperCase()+r.slice(1)),E0$1=(r,...o)=>{for(let s=0;s{const o=parseFloat(r);return isNaN(o)?r:o},_d$1=r=>{const o=la$1(r)?Number(r):NaN;return isNaN(o)?r:o},w0$1="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",I0$1=zc$1(w0$1);function Uy$1(r){return!!r||r===""}function C0$1(r,o){if(r.length!==o.length)return!1;let s=!0;for(let a=0;s&&aLo$1(s,o))}/** -* @vue/runtime-dom v3.4.37 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const V0$1="http://www.w3.org/2000/svg",D0$1="http://www.w3.org/1998/Math/MathML",Gr$1=typeof document<"u"?document:null,wm$1=Gr$1&&Gr$1.createElement("template"),A0$1={insert:(r,o,s)=>{o.insertBefore(r,s||null)},remove:r=>{const o=r.parentNode;o&&o.removeChild(r)},createElement:(r,o,s,a)=>{const l=o==="svg"?Gr$1.createElementNS(V0$1,r):o==="mathml"?Gr$1.createElementNS(D0$1,r):s?Gr$1.createElement(r,{is:s}):Gr$1.createElement(r);return r==="select"&&a&&a.multiple!=null&&l.setAttribute("multiple",a.multiple),l},createText:r=>Gr$1.createTextNode(r),createComment:r=>Gr$1.createComment(r),setText:(r,o)=>{r.nodeValue=o},setElementText:(r,o)=>{r.textContent=o},parentNode:r=>r.parentNode,nextSibling:r=>r.nextSibling,querySelector:r=>Gr$1.querySelector(r),setScopeId(r,o){r.setAttribute(o,"")},insertStaticContent(r,o,s,a,l,c){const u=s?s.previousSibling:o.lastChild;if(l&&(l===c||l.nextSibling))for(;o.insertBefore(l.cloneNode(!0),s),!(l===c||!(l=l.nextSibling)););else{wm$1.innerHTML=a==="svg"?`${r}`:a==="mathml"?`${r}`:r;const d=wm$1.content;if(a==="svg"||a==="mathml"){const m=d.firstChild;for(;m.firstChild;)d.appendChild(m.firstChild);d.removeChild(m)}o.insertBefore(d,s)}return[u?u.nextSibling:o.firstChild,s?s.previousSibling:o.lastChild]}},lo$1="transition",_s$1="animation",qi$1=Symbol("_vtc"),Qc$1=(r,{slots:o})=>dr$1(Of$1,By$1(r),o);Qc$1.displayName="Transition";const jy$1={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},L0$1=Qc$1.props=Ua$1({},Bc$1,jy$1),Wo=(r,o=[])=>{Ln$1(r)?r.forEach(s=>s(...o)):r&&r(...o)},Im$2=r=>r?Ln$1(r)?r.some(o=>o.length>1):r.length>1:!1;function By$1(r){const o={};for(const ie in r)ie in jy$1||(o[ie]=r[ie]);if(r.css===!1)return o;const{name:s="v",type:a,duration:l,enterFromClass:c=`${s}-enter-from`,enterActiveClass:u=`${s}-enter-active`,enterToClass:d=`${s}-enter-to`,appearFromClass:m=c,appearActiveClass:g=u,appearToClass:y=d,leaveFromClass:_=`${s}-leave-from`,leaveActiveClass:E=`${s}-leave-active`,leaveToClass:w=`${s}-leave-to`}=r,T=P0$1(l),k=T&&T[0],O=T&&T[1],{onBeforeEnter:R,onEnter:M,onEnterCancelled:N,onLeave:D,onLeaveCancelled:P,onBeforeAppear:I=R,onAppear:L=M,onAppearCancelled:F=N}=o,U=(ie,ce,Y)=>{fo$1(ie,ce?y:d),fo$1(ie,ce?g:u),Y&&Y()},J=(ie,ce)=>{ie._isLeaving=!1,fo$1(ie,_),fo$1(ie,w),fo$1(ie,E),ce&&ce()},z=ie=>(ce,Y)=>{const B=ie?L:M,V=()=>U(ce,ie,Y);Wo(B,[ce,V]),Cm$1(()=>{fo$1(ce,ie?m:c),Hr$1(ce,ie?y:d),Im$2(B)||Vm$1(ce,a,k,V)})};return Ua$1(o,{onBeforeEnter(ie){Wo(R,[ie]),Hr$1(ie,c),Hr$1(ie,u)},onBeforeAppear(ie){Wo(I,[ie]),Hr$1(ie,m),Hr$1(ie,g)},onEnter:z(!1),onAppear:z(!0),onLeave(ie,ce){ie._isLeaving=!0;const Y=()=>J(ie,ce);Hr$1(ie,_),Hr$1(ie,E),Wy$1(),Cm$1(()=>{ie._isLeaving&&(fo$1(ie,_),Hr$1(ie,w),Im$2(D)||Vm$1(ie,a,O,Y))}),Wo(D,[ie,Y])},onEnterCancelled(ie){U(ie,!1),Wo(N,[ie])},onAppearCancelled(ie){U(ie,!0),Wo(F,[ie])},onLeaveCancelled(ie){J(ie),Wo(P,[ie])}})}function P0$1(r){if(r==null)return null;if(bd$1(r))return[Nu$2(r.enter),Nu$2(r.leave)];{const o=Nu$2(r);return[o,o]}}function Nu$2(r){return _d$1(r)}function Hr$1(r,o){o.split(/\s+/).forEach(s=>s&&r.classList.add(s)),(r[qi$1]||(r[qi$1]=new Set)).add(o)}function fo$1(r,o){o.split(/\s+/).forEach(a=>a&&r.classList.remove(a));const s=r[qi$1];s&&(s.delete(o),s.size||(r[qi$1]=void 0))}function Cm$1(r){requestAnimationFrame(()=>{requestAnimationFrame(r)})}let R0$1=0;function Vm$1(r,o,s,a){const l=r._endId=++R0$1,c=()=>{l===r._endId&&a()};if(s)return setTimeout(c,s);const{type:u,timeout:d,propCount:m}=Hy$1(r,o);if(!u)return a();const g=u+"end";let y=0;const _=()=>{r.removeEventListener(g,E),c()},E=w=>{w.target===r&&++y>=m&&_()};setTimeout(()=>{y(s[T]||"").split(", "),l=a(`${lo$1}Delay`),c=a(`${lo$1}Duration`),u=Dm$1(l,c),d=a(`${_s$1}Delay`),m=a(`${_s$1}Duration`),g=Dm$1(d,m);let y=null,_=0,E=0;o===lo$1?u>0&&(y=lo$1,_=u,E=c.length):o===_s$1?g>0&&(y=_s$1,_=g,E=m.length):(_=Math.max(u,g),y=_>0?u>g?lo$1:_s$1:null,E=y?y===lo$1?c.length:m.length:0);const w=y===lo$1&&/\b(transform|all)(,|$)/.test(a(`${lo$1}Property`).toString());return{type:y,timeout:_,propCount:E,hasTransform:w}}function Dm$1(r,o){for(;r.lengthAm$1(s)+Am$1(r[a])))}function Am$1(r){return r==="auto"?0:Number(r.slice(0,-1).replace(",","."))*1e3}function Wy$1(){return document.body.offsetHeight}function M0$1(r,o,s){const a=r[qi$1];a&&(o=(o?[o,...a]:[...a]).join(" ")),o==null?r.removeAttribute("class"):s?r.setAttribute("class",o):r.className=o}const ic$2=Symbol("_vod"),Gy$1=Symbol("_vsh"),qc$1={beforeMount(r,{value:o},{transition:s}){r[ic$2]=r.style.display==="none"?"":r.style.display,s&&o?s.beforeEnter(r):Os(r,o)},mounted(r,{value:o},{transition:s}){s&&o&&s.enter(r)},updated(r,{value:o,oldValue:s},{transition:a}){!o!=!s&&(a?o?(a.beforeEnter(r),Os(r,!0),a.enter(r)):a.leave(r,()=>{Os(r,!1)}):Os(r,o))},beforeUnmount(r,{value:o}){Os(r,o)}};function Os(r,o){r.style.display=o?r[ic$2]:"none",r[Gy$1]=!o}function $0$1(){qc$1.getSSRProps=({value:r})=>{if(!r)return{style:{display:"none"}}}}const Ky$1=Symbol("");function Yy$1(r){const o=qt$1();if(!o)return;const s=o.ut=(l=r(o.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${o.uid}"]`)).forEach(c=>Nd(c,l))},a=()=>{const l=r(o.proxy);Od$1(o.subTree,l),s(l)};Pa$1(()=>{Kf$1(a)}),Pn$1(()=>{const l=new MutationObserver(a);l.observe(o.subTree.el.parentNode,{childList:!0}),Ii$1(()=>l.disconnect())})}function Od$1(r,o){if(r.shapeFlag&128){const s=r.suspense;r=s.activeBranch,s.pendingBranch&&!s.isHydrating&&s.effects.push(()=>{Od$1(s.activeBranch,o)})}for(;r.component;)r=r.component.subTree;if(r.shapeFlag&1&&r.el)Nd(r.el,o);else if(r.type===Ze)r.children.forEach(s=>Od$1(s,o));else if(r.type===zr$1){let{el:s,anchor:a}=r;for(;s&&(Nd(s,o),s!==a);)s=s.nextSibling}}function Nd(r,o){if(r.nodeType===1){const s=r.style;let a="";for(const l in o)s.setProperty(`--${l}`,o[l]),a+=`--${l}: ${o[l]};`;s[Ky$1]=a}}const k0$1=/(^|;)\s*display\s*:/;function F0$1(r,o,s){const a=r.style,l=la$1(s);let c=!1;if(s&&!l){if(o)if(la$1(o))for(const u of o.split(";")){const d=u.slice(0,u.indexOf(":")).trim();s[d]==null&&wl$1(a,d,"")}else for(const u in o)s[u]==null&&wl$1(a,u,"");for(const u in s)u==="display"&&(c=!0),wl$1(a,u,s[u])}else if(l){if(o!==s){const u=a[Ky$1];u&&(s+=";"+u),a.cssText=s,c=k0$1.test(s)}}else o&&r.removeAttribute("style");ic$2 in r&&(r[ic$2]=c?a.display:"",r[Gy$1]&&(a.display="none"))}const Lm$1=/\s*!important$/;function wl$1(r,o,s){if(Ln$1(s))s.forEach(a=>wl$1(r,o,a));else if(s==null&&(s=""),o.startsWith("--"))r.setProperty(o,s);else{const a=j0$1(r,o);Lm$1.test(s)?r.setProperty(Eo$1(a),s.replace(Lm$1,""),"important"):r[a]=s}}const Pm$1=["Webkit","Moz","ms"],Su$1={};function j0$1(r,o){const s=Su$1[o];if(s)return s;let a=pn$1(o);if(a!=="filter"&&a in r)return Su$1[o]=a;a=b0$1(a);for(let l=0;lTu$1||(K0$1.then(()=>Tu$1=0),Tu$1=Date.now());function X0$1(r,o){const s=a=>{if(!a._vts)a._vts=Date.now();else if(a._vts<=s.attached)return;Vn(z0$1(a,s.value),o,5,[a])};return s.value=r,s.attached=Y0$1(),s}function z0$1(r,o){if(Ln$1(o)){const s=r.stopImmediatePropagation;return r.stopImmediatePropagation=()=>{s.call(r),r._stopped=!0},o.map(a=>l=>!l._stopped&&a&&a(l))}else return o}const Um$1=r=>r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&r.charCodeAt(2)>96&&r.charCodeAt(2)<123,J0$1=(r,o,s,a,l,c)=>{const u=l==="svg";o==="class"?M0$1(r,a,u):o==="style"?F0$1(r,s,a):m0$1(o)?h0$1(o)||W0$1(r,o,s,a,c):(o[0]==="."?(o=o.slice(1),!0):o[0]==="^"?(o=o.slice(1),!1):Q0$1(r,o,a,u))?(B0$1(r,o,a),!r.tagName.includes("-")&&(o==="value"||o==="checked"||o==="selected")&&Mm$1(r,o,a,u,c,o!=="value")):(o==="true-value"?r._trueValue=a:o==="false-value"&&(r._falseValue=a),Mm$1(r,o,a,u))};function Q0$1(r,o,s,a){if(a)return!!(o==="innerHTML"||o==="textContent"||o in r&&Um$1(o)&&tp$1(s));if(o==="spellcheck"||o==="draggable"||o==="translate"||o==="form"||o==="list"&&r.tagName==="INPUT"||o==="type"&&r.tagName==="TEXTAREA")return!1;if(o==="width"||o==="height"){const l=r.tagName;if(l==="IMG"||l==="VIDEO"||l==="CANVAS"||l==="SOURCE")return!1}return Um$1(o)&&la$1(s)?!1:o in r}/*! #__NO_SIDE_EFFECTS__ */function rp$1(r,o,s){const a=Ee(r,o);class l extends Ba$1{constructor(u){super(a,u,s)}}return l.def=a,l}/*! #__NO_SIDE_EFFECTS__ */const Xy$1=(r,o)=>rp$1(r,o,op$1),q0$1=typeof HTMLElement<"u"?HTMLElement:class{};let Ba$1=class bie extends q0$1{constructor(o,s={},a){super(),this._def=o,this._props=s,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this._ob=null,this.shadowRoot&&a?a(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,Ao$1(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),ac$2(null,this.shadowRoot),this._instance=null)})}_resolveDef(){this._resolved=!0;for(let a=0;a{for(const l of a)this._setAttr(l.attributeName)}),this._ob.observe(this,{attributes:!0});const o=(a,l=!1)=>{const{props:c,styles:u}=a;let d;if(c&&!Ln$1(c))for(const m in c){const g=c[m];(g===Number||g&&g.type===Number)&&(m in this._props&&(this._props[m]=_d$1(this._props[m])),(d||(d=Object.create(null)))[Ou$1(m)]=!0)}this._numberProps=d,l&&this._resolveProps(a),this._applyStyles(u),this._update()},s=this._def.__asyncLoader;s?s().then(a=>o(a,!0)):o(this._def)}_resolveProps(o){const{props:s}=o,a=Ln$1(s)?s:Object.keys(s||{});for(const l of Object.keys(this))l[0]!=="_"&&a.includes(l)&&this._setProp(l,this[l],!0,!1);for(const l of a.map(Ou$1))Object.defineProperty(this,l,{get(){return this._getProp(l)},set(c){this._setProp(l,c)}})}_setAttr(o){let s=this.hasAttribute(o)?this.getAttribute(o):void 0;const a=Ou$1(o);this._numberProps&&this._numberProps[a]&&(s=_d$1(s)),this._setProp(a,s,!1)}_getProp(o){return this._props[o]}_setProp(o,s,a=!0,l=!0){s!==this._props[o]&&(this._props[o]=s,l&&this._instance&&this._update(),a&&(s===!0?this.setAttribute(Eo$1(o),""):typeof s=="string"||typeof s=="number"?this.setAttribute(Eo$1(o),s+""):s||this.removeAttribute(Eo$1(o))))}_update(){ac$2(this._createVNode(),this.shadowRoot)}_createVNode(){const o=A(this._def,Ua$1({},this._props));return this._instance||(o.ce=s=>{this._instance=s,s.isCE=!0;const a=(c,u)=>{this.dispatchEvent(new CustomEvent(c,{detail:u}))};s.emit=(c,...u)=>{a(c,u),Eo$1(c)!==c&&a(Eo$1(c),u)};let l=this;for(;l=l&&(l.parentNode||l.host);)if(l instanceof bie){s.parent=l._instance,s.provides=l._instance.provides;break}}),o}_applyStyles(o){o&&o.forEach(s=>{const a=document.createElement("style");a.textContent=s,this.shadowRoot.appendChild(a)})}};function zy$1(r="$style"){{const o=qt$1();if(!o)return _u$1;const s=o.type.__cssModules;return s&&s[r]||_u$1}}const Jy$1=new WeakMap,Qy$1=new WeakMap,sc$2=Symbol("_moveCb"),jm$1=Symbol("_enterCb"),qy$1={name:"TransitionGroup",props:Ua$1({},L0$1,{tag:String,moveClass:String}),setup(r,{slots:o}){const s=qt$1(),a=jc$1();let l,c;return Ra$1(()=>{if(!l.length)return;const u=r.moveClass||`${r.name||"v"}-move`;if(!rS$1(l[0].el,s.vnode.el,u))return;l.forEach(eS$1),l.forEach(tS$1);const d=l.filter(nS$1);Wy$1(),d.forEach(m=>{const g=m.el,y=g.style;Hr$1(g,u),y.transform=y.webkitTransform=y.transitionDuration="";const _=g[sc$2]=E=>{E&&E.target!==g||(!E||/transform$/.test(E.propertyName))&&(g.removeEventListener("transitionend",_),g[sc$2]=null,fo$1(g,u))};g.addEventListener("transitionend",_)})}),()=>{const u=Le(r),d=By$1(u);let m=u.tag||Ze;if(l=[],c)for(let g=0;g{d.split(/\s+/).forEach(m=>m&&a.classList.remove(m))}),s.split(/\s+/).forEach(d=>d&&a.classList.add(d)),a.style.display="none";const c=o.nodeType===1?o:o.parentNode;c.appendChild(a);const{hasTransform:u}=Hy$1(a);return c.removeChild(a),u}const Po$1=r=>{const o=r.props["onUpdate:modelValue"]||!1;return Ln$1(o)?s=>E0$1(o,s):o};function oS$2(r){r.target.composing=!0}function Bm$1(r){const o=r.target;o.composing&&(o.composing=!1,o.dispatchEvent(new Event("input")))}const qn$1=Symbol("_assign"),me={created(r,{modifiers:{lazy:o,trim:s,number:a}},l){r[qn$1]=Po$1(l);const c=a||l.props&&l.props.type==="number";Yr$1(r,o?"change":"input",u=>{if(u.target.composing)return;let d=r.value;s&&(d=d.trim()),c&&(d=Ed$1(d)),r[qn$1](d)}),s&&Yr$1(r,"change",()=>{r.value=r.value.trim()}),o||(Yr$1(r,"compositionstart",oS$2),Yr$1(r,"compositionend",Bm$1),Yr$1(r,"change",Bm$1))},mounted(r,{value:o}){r.value=o??""},beforeUpdate(r,{value:o,oldValue:s,modifiers:{lazy:a,trim:l,number:c}},u){if(r[qn$1]=Po$1(u),r.composing)return;const d=(c||r.type==="number")&&!/^0\d/.test(r.value)?Ed$1(r.value):r.value,m=o??"";d!==m&&(document.activeElement===r&&r.type!=="range"&&(a&&o===s||l&&r.value.trim()===m)||(r.value=m))}},Ye$1={deep:!0,created(r,o,s){r[qn$1]=Po$1(s),Yr$1(r,"change",()=>{const a=r._modelValue,l=Zi$1(r),c=r.checked,u=r[qn$1];if(Ln$1(a)){const d=Jc$1(a,l),m=d!==-1;if(c&&!m)u(a.concat(l));else if(!c&&m){const g=[...a];g.splice(d,1),u(g)}}else if(ja$1(a)){const d=new Set(a);c?d.add(l):d.delete(l),u(d)}else u(eb$1(r,c))})},mounted:Hm$1,beforeUpdate(r,o,s){r[qn$1]=Po$1(s),Hm$1(r,o,s)}};function Hm$1(r,{value:o,oldValue:s},a){r._modelValue=o,Ln$1(o)?r.checked=Jc$1(o,a.props.value)>-1:ja$1(o)?r.checked=o.has(a.props.value):o!==s&&(r.checked=Lo$1(o,eb$1(r,!0)))}const Zc$1={created(r,{value:o},s){r.checked=Lo$1(o,s.props.value),r[qn$1]=Po$1(s),Yr$1(r,"change",()=>{r[qn$1](Zi$1(r))})},beforeUpdate(r,{value:o,oldValue:s},a){r[qn$1]=Po$1(a),o!==s&&(r.checked=Lo$1(o,a.props.value))}},rn$1={deep:!0,created(r,{value:o,modifiers:{number:s}},a){const l=ja$1(o);Yr$1(r,"change",()=>{const c=Array.prototype.filter.call(r.options,u=>u.selected).map(u=>s?Ed$1(Zi$1(u)):Zi$1(u));r[qn$1](r.multiple?l?new Set(c):c:c[0]),r._assigning=!0,Ao$1(()=>{r._assigning=!1})}),r[qn$1]=Po$1(a)},mounted(r,{value:o,modifiers:{number:s}}){Wm$1(r,o)},beforeUpdate(r,o,s){r[qn$1]=Po$1(s)},updated(r,{value:o,modifiers:{number:s}}){r._assigning||Wm$1(r,o)}};function Wm$1(r,o,s){const a=r.multiple,l=Ln$1(o);if(!(a&&!l&&!ja$1(o))){for(let c=0,u=r.options.length;cString(y)===String(m)):d.selected=Jc$1(o,m)>-1}else d.selected=o.has(m);else if(Lo$1(Zi$1(d),o)){r.selectedIndex!==c&&(r.selectedIndex=c);return}}!a&&r.selectedIndex!==-1&&(r.selectedIndex=-1)}}function Zi$1(r){return"_value"in r?r._value:r.value}function eb$1(r,o){const s=o?"_trueValue":"_falseValue";return s in r?r[s]:o}const _i$1={created(r,o,s){cl$1(r,o,s,null,"created")},mounted(r,o,s){cl$1(r,o,s,null,"mounted")},beforeUpdate(r,o,s,a){cl$1(r,o,s,a,"beforeUpdate")},updated(r,o,s,a){cl$1(r,o,s,a,"updated")}};function tb$1(r,o){switch(r){case"SELECT":return rn$1;case"TEXTAREA":return me;default:switch(o){case"checkbox":return Ye$1;case"radio":return Zc$1;default:return me}}}function cl$1(r,o,s,a,l){const c=tb$1(r.tagName,s.props&&s.props.type)[l];c&&c(r,o,s,a)}function iS$1(){me.getSSRProps=({value:r})=>({value:r}),Zc$1.getSSRProps=({value:r},o)=>{if(o.props&&Lo$1(o.props.value,r))return{checked:!0}},Ye$1.getSSRProps=({value:r},o)=>{if(Ln$1(r)){if(o.props&&Jc$1(r,o.props.value)>-1)return{checked:!0}}else if(ja$1(r)){if(o.props&&r.has(o.props.value))return{checked:!0}}else if(r)return{checked:!0}},_i$1.getSSRProps=(r,o)=>{if(typeof o.type!="string")return;const s=tb$1(o.type.toUpperCase(),o.props&&o.props.type);if(s.getSSRProps)return s.getSSRProps(r,o)}}const sS$1=["ctrl","shift","alt","meta"],aS$1={stop:r=>r.stopPropagation(),prevent:r=>r.preventDefault(),self:r=>r.target!==r.currentTarget,ctrl:r=>!r.ctrlKey,shift:r=>!r.shiftKey,alt:r=>!r.altKey,meta:r=>!r.metaKey,left:r=>"button"in r&&r.button!==0,middle:r=>"button"in r&&r.button!==1,right:r=>"button"in r&&r.button!==2,exact:(r,o)=>sS$1.some(s=>r[`${s}Key`]&&!o.includes(s))},nn$1=(r,o)=>{const s=r._withMods||(r._withMods={}),a=o.join(".");return s[a]||(s[a]=(l,...c)=>{for(let u=0;u{const s=r._withKeys||(r._withKeys={}),a=o.join(".");return s[a]||(s[a]=l=>{if(!("key"in l))return;const c=Eo$1(l.key);if(o.some(u=>u===c||lS$1[u]===c))return r(l)})},rb$1=Ua$1({patchProp:J0$1},A0$1);let Ws$1,Gm$1=!1;function ob$1(){return Ws$1||(Ws$1=Bf$1(rb$1))}function ib$1(){return Ws$1=Gm$1?Ws$1:Hf$1(rb$1),Gm$1=!0,Ws$1}const ac$2=(...r)=>{ob$1().render(...r)},op$1=(...r)=>{ib$1().hydrate(...r)},ca$1=(...r)=>{const o=ob$1().createApp(...r),{mount:s}=o;return o.mount=a=>{const l=ub$1(a);if(!l)return;const c=o._component;!tp$1(c)&&!c.render&&!c.template&&(c.template=l.innerHTML),l.innerHTML="";const u=s(l,!1,ab$1(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),u},o},sb$1=(...r)=>{const o=ib$1().createApp(...r),{mount:s}=o;return o.mount=a=>{const l=ub$1(a);if(l)return s(l,!0,ab$1(l))},o};function ab$1(r){if(r instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&r instanceof MathMLElement)return"mathml"}function ub$1(r){return la$1(r)?document.querySelector(r):r}let Km$1=!1;const db$1=()=>{Km$1||(Km$1=!0,iS$1(),$0$1())},cS$1=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:Of$1,BaseTransitionPropsValidators:Bc$1,Comment:Et,DeprecationTypes:ky$1,EffectScope:Cc$1,ErrorCodes:hv$1,ErrorTypeStrings:Ay$1,Fragment:Ze,KeepAlive:Cv$1,ReactiveEffect:hi$1,Static:zr$1,Suspense:hy$1,Teleport:ry$1,Text:gr$1,TrackOpTypes:ov$1,Transition:Qc$1,TransitionGroup:Zy$1,TriggerOpTypes:iv$1,VueElement:Ba$1,assertNumber:kc$1,callWithAsyncErrorHandling:Vn,callWithErrorHandling:hr$2,camelize:pn$1,capitalize:gi$1,cloneVNode:jn$1,compatUtils:$y$1,computed:xt$1,createApp:ca$1,createBlock:be,createCommentVNode:xe,createElementBlock:ae,createElementVNode:b,createHydrationRenderer:Hf$1,createPropsRestProxy:Hv$1,createRenderer:Bf$1,createSSRApp:sb$1,createSlots:Dv$1,createStaticVNode:Sy$1,createTextVNode:to$1,createVNode:A,customRef:hf$1,defineAsyncComponent:Iv$1,defineComponent:Ee,defineCustomElement:rp$1,defineEmits:Pv$1,defineExpose:Rv$1,defineModel:kv$1,defineOptions:Mv$1,defineProps:Lv$1,defineSSRCustomElement:Xy$1,defineSlots:$v$1,devtools:Ly$1,effect:kg$1,effectScope:wa$1,getCurrentInstance:qt$1,getCurrentScope:Vc$1,getTransitionRawChildren:La$1,guardReactiveProps:zf$1,h:dr$1,handleError:oo$1,hasInjectionContext:Uf$1,hydrate:op$1,initCustomFormatter:Zf$1,initDirectivesForSSR:db$1,inject:Co$1,isMemoSame:ep$1,isProxy:zi,isReactive:Cn$1,isReadonly:yr$1,isRef:Ce,isRuntimeOnly:Yc$1,isShallow:mr$1,isVNode:br$1,markRaw:xr$1,mergeDefaults:Bv$1,mergeModels:$f$1,mergeProps:Qf$1,nextTick:Ao$1,normalizeClass:yt$1,normalizeProps:dv$1,normalizeStyle:wi$1,onActivated:Nf$1,onBeforeMount:Pa$1,onBeforeUnmount:Ma$1,onBeforeUpdate:Tf$1,onDeactivated:Sf$1,onErrorCaptured:Cf$1,onMounted:Pn$1,onRenderTracked:If$1,onRenderTriggered:wf$1,onScopeDispose:lf$1,onServerPrefetch:xf$1,onUnmounted:Ii$1,onUpdated:Ra$1,openBlock:H,popScopeId:Nv$1,provide:Ff$1,proxyRefs:Rc$1,pushScopeId:Ov$1,queuePostFlushCb:Ji$1,reactive:De,readonly:Lc$1,ref:$e,registerRuntimeCompiler:qf$1,render:ac$2,renderList:Qt$1,renderSlot:Qi$1,resolveComponent:Vf$1,resolveDirective:Wc$1,resolveDynamicComponent:Af$1,resolveFilter:My$1,resolveTransitionHooks:yi$1,setBlockTracking:nc$1,setDevtoolsHook:Py$1,setTransitionHooks:eo$1,shallowReactive:ff$1,shallowReadonly:zn$1,shallowRef:Ia$1,ssrContextKey:Wf$1,ssrUtils:Ry$1,stop:Fg$1,toDisplayString:Ct,toHandlerKey:Nr$1,toHandlers:Av$1,toRaw:Le,toRef:$s$1,toRefs:Kl$1,toValue:nv$1,transformVNodeArgs:Ey$1,triggerRef:tv$1,unref:x,useAttrs:Uv$1,useCssModule:zy$1,useCssVars:Yy$1,useModel:ec$1,useSSRContext:Gf$1,useSlots:Mf$1,useTransitionState:jc$1,vModelCheckbox:Ye$1,vModelDynamic:_i$1,vModelRadio:Zc$1,vModelSelect:rn$1,vModelText:me,vShow:qc$1,version:oc$1,warn:Ut$1,watch:Oe,watchEffect:uy$1,watchPostEffect:Kf$1,watchSyncEffect:Yf$1,withAsyncContext:Wv$1,withCtx:ye,withDefaults:Fv$1,withDirectives:Q,withKeys:nb$1,withMemo:Dy$1,withModifiers:nn$1,withScopeId:Sv$1},Symbol.toStringTag,{value:"Module"}));/** -* @vue/shared v3.4.37 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function Mr$1(r,o){const s=new Set(r.split(","));return o?a=>s.has(a.toLowerCase()):a=>s.has(a)}const Sd$1={},Gs$1=()=>{},xu$1=()=>!1,Td$1=r=>r.charCodeAt(0)===111&&r.charCodeAt(1)===110&&(r.charCodeAt(2)>122||r.charCodeAt(2)<97),Jr$1=Object.assign,es$1=Array.isArray,Kt$1=r=>typeof r=="string",ip$1=r=>typeof r=="symbol",uS$1=r=>r!==null&&typeof r=="object",Ym$1=Mr$1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),dS$1=Mr$1("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),sp$1=r=>{const o=Object.create(null);return s=>o[s]||(o[s]=r(s))},fS$1=/-(\w)/g,Vo=sp$1(r=>r.replace(fS$1,(o,s)=>s?s.toUpperCase():"")),ap$2=sp$1(r=>r.charAt(0).toUpperCase()+r.slice(1)),pS$1=sp$1(r=>r?`on${ap$2(r)}`:""),gS$1=/;(?![^(]*\))/g,vS$1=/:([^]+)/,yS$1=/\/\*[^]*?\*\//g;function bS$1(r){const o={};return r.replace(yS$1,"").split(gS$1).forEach(s=>{if(s){const a=s.split(vS$1);a.length>1&&(o[a[0].trim()]=a[1].trim())}}),o}const ES$1="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",_S$1="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",OS$1="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",NS$1="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",SS$1=Mr$1(ES$1),TS$1=Mr$1(_S$1),xS$1=Mr$1(OS$1),wS$1=Mr$1(NS$1);/** -* @vue/compiler-core v3.4.37 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const ua$1=Symbol(""),Ks$1=Symbol(""),lp$1=Symbol(""),lc$1=Symbol(""),fb$1=Symbol(""),Oi$1=Symbol(""),pb$1=Symbol(""),mb$1=Symbol(""),cp$1=Symbol(""),up$1=Symbol(""),Ha$1=Symbol(""),dp$1=Symbol(""),hb$1=Symbol(""),fp$1=Symbol(""),pp$1=Symbol(""),mp$2=Symbol(""),hp$1=Symbol(""),gp$1=Symbol(""),vp$1=Symbol(""),gb$1=Symbol(""),vb$1=Symbol(""),eu$1=Symbol(""),cc$1=Symbol(""),yp$1=Symbol(""),bp$1=Symbol(""),da$1=Symbol(""),Wa$1=Symbol(""),Ep$1=Symbol(""),xd$1=Symbol(""),IS$1=Symbol(""),wd$1=Symbol(""),uc$1=Symbol(""),CS$1=Symbol(""),VS$1=Symbol(""),_p$1=Symbol(""),DS$1=Symbol(""),AS$1=Symbol(""),Op$1=Symbol(""),yb$1=Symbol(""),ts$2={[ua$1]:"Fragment",[Ks$1]:"Teleport",[lp$1]:"Suspense",[lc$1]:"KeepAlive",[fb$1]:"BaseTransition",[Oi$1]:"openBlock",[pb$1]:"createBlock",[mb$1]:"createElementBlock",[cp$1]:"createVNode",[up$1]:"createElementVNode",[Ha$1]:"createCommentVNode",[dp$1]:"createTextVNode",[hb$1]:"createStaticVNode",[fp$1]:"resolveComponent",[pp$1]:"resolveDynamicComponent",[mp$2]:"resolveDirective",[hp$1]:"resolveFilter",[gp$1]:"withDirectives",[vp$1]:"renderList",[gb$1]:"renderSlot",[vb$1]:"createSlots",[eu$1]:"toDisplayString",[cc$1]:"mergeProps",[yp$1]:"normalizeClass",[bp$1]:"normalizeStyle",[da$1]:"normalizeProps",[Wa$1]:"guardReactiveProps",[Ep$1]:"toHandlers",[xd$1]:"camelize",[IS$1]:"capitalize",[wd$1]:"toHandlerKey",[uc$1]:"setBlockTracking",[CS$1]:"pushScopeId",[VS$1]:"popScopeId",[_p$1]:"withCtx",[DS$1]:"unref",[AS$1]:"isRef",[Op$1]:"withMemo",[yb$1]:"isMemoSame"};function LS$1(r){Object.getOwnPropertySymbols(r).forEach(o=>{ts$2[o]=r[o]})}const Hn$1={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function PS$1(r,o=""){return{type:0,source:o,children:r,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:Hn$1}}function fa$1(r,o,s,a,l,c,u,d=!1,m=!1,g=!1,y=Hn$1){return r&&(d?(r.helper(Oi$1),r.helper(os$1(r.inSSR,g))):r.helper(rs$1(r.inSSR,g)),u&&r.helper(gp$1)),{type:13,tag:o,props:s,children:a,patchFlag:l,dynamicProps:c,directives:u,isBlock:d,disableTracking:m,isComponent:g,loc:y}}function Ga$1(r,o=Hn$1){return{type:17,loc:o,elements:r}}function Jn$1(r,o=Hn$1){return{type:15,loc:o,properties:r}}function $t$1(r,o){return{type:16,loc:Hn$1,key:Kt$1(r)?ze(r,!0):r,value:o}}function ze(r,o=!1,s=Hn$1,a=0){return{type:4,loc:s,content:r,isStatic:o,constType:o?3:a}}function vr$1(r,o=Hn$1){return{type:8,loc:o,children:r}}function Bt$1(r,o=[],s=Hn$1){return{type:14,loc:s,callee:r,arguments:o}}function ns$1(r,o=void 0,s=!1,a=!1,l=Hn$1){return{type:18,params:r,returns:o,newline:s,isSlot:a,loc:l}}function Id(r,o,s,a=!0){return{type:19,test:r,consequent:o,alternate:s,newline:a,loc:Hn$1}}function RS$1(r,o,s=!1){return{type:20,index:r,value:o,isVOnce:s,loc:Hn$1}}function MS$1(r){return{type:21,body:r,loc:Hn$1}}function rs$1(r,o){return r||o?cp$1:up$1}function os$1(r,o){return r||o?pb$1:mb$1}function Np$1(r,{helper:o,removeHelper:s,inSSR:a}){r.isBlock||(r.isBlock=!0,s(rs$1(a,r.isComponent)),o(Oi$1),o(os$1(a,r.isComponent)))}const zm$1=new Uint8Array([123,123]),Jm$1=new Uint8Array([125,125]);function Qm$1(r){return r>=97&&r<=122||r>=65&&r<=90}function kn$1(r){return r===32||r===10||r===9||r===12||r===13}function co$1(r){return r===47||r===62||kn$1(r)}function dc(r){const o=new Uint8Array(r.length);for(let s=0;s=0;l--){const c=this.newlines[l];if(o>c){s=l+2,a=o-c;break}}return{column:a,line:s,offset:o}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(o){o===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&o===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(o))}stateInterpolationOpen(o){if(o===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const s=this.index+1-this.delimiterOpen.length;s>this.sectionStart&&this.cbs.ontext(this.sectionStart,s),this.state=3,this.sectionStart=s}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(o)):(this.state=1,this.stateText(o))}stateInterpolation(o){o===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(o))}stateInterpolationClose(o){o===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(o))}stateSpecialStartSequence(o){const s=this.sequenceIndex===this.currentSequence.length;if(!(s?co$1(o):(o|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!s){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(o)}stateInRCDATA(o){if(this.sequenceIndex===this.currentSequence.length){if(o===62||kn$1(o)){const s=this.index-this.currentSequence.length;if(this.sectionStart=o||(this.state===28?this.currentSequence===Zt$1.CdataEnd?this.cbs.oncdata(this.sectionStart,o):this.cbs.oncomment(this.sectionStart,o):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,o))}emitCodePoint(o,s){}};function Cd$1(r,{compatConfig:o}){const s=o&&o[r];return r==="MODE"?s||3:s}function Do$1(r,o){const s=Cd$1("MODE",o),a=Cd$1(r,o);return s===3?a===!0:a!==!1}function is$1(r,o,s,...a){return Do$1(r,o)}function Sp$1(r){throw r}function bb$1(r){}function dt(r,o,s,a){const l=`https://vuejs.org/error-reference/#compiler-${r}`,c=new SyntaxError(String(l));return c.code=r,c.loc=o,c}const In$1=r=>r.type===4&&r.isStatic;function Eb$1(r){switch(r){case"Teleport":case"teleport":return Ks$1;case"Suspense":case"suspense":return lp$1;case"KeepAlive":case"keep-alive":return lc$1;case"BaseTransition":case"base-transition":return fb$1}}const US$1=/^\d|[^\$\w\xA0-\uFFFF]/,Tp$1=r=>!US$1.test(r),jS$1=/[A-Za-z_$\xA0-\uFFFF]/,BS$1=/[\.\?\w$\xA0-\uFFFF]/,HS$1=/\s+[.[]\s*|\s*[.[]\s+/g,WS$2=r=>{r=r.trim().replace(HS$1,u=>u.trim());let o=0,s=[],a=0,l=0,c=null;for(let u=0;uo.type===7&&o.name==="bind"&&(!o.arg||o.arg.type!==4||!o.arg.isStatic))}function wu$1(r){return r.type===5||r.type===2}function KS$1(r){return r.type===7&&r.name==="slot"}function pc(r){return r.type===1&&r.tagType===3}function mc$1(r){return r.type===1&&r.tagType===2}const YS$1=new Set([da$1,Wa$1]);function Ob$1(r,o=[]){if(r&&!Kt$1(r)&&r.type===14){const s=r.callee;if(!Kt$1(s)&&YS$1.has(s))return Ob$1(r.arguments[0],o.concat(r))}return[r,o]}function hc(r,o,s){let a,l=r.type===13?r.props:r.arguments[2],c=[],u;if(l&&!Kt$1(l)&&l.type===14){const d=Ob$1(l);l=d[0],c=d[1],u=c[c.length-1]}if(l==null||Kt$1(l))a=Jn$1([o]);else if(l.type===14){const d=l.arguments[0];!Kt$1(d)&&d.type===15?Zm$1(o,d)||d.properties.unshift(o):l.callee===Ep$1?a=Bt$1(s.helper(cc$1),[Jn$1([o]),l]):l.arguments.unshift(Jn$1([o])),!a&&(a=l)}else l.type===15?(Zm$1(o,l)||l.properties.unshift(o),a=l):(a=Bt$1(s.helper(cc$1),[Jn$1([o]),l]),u&&u.callee===Wa$1&&(u=c[c.length-2]));r.type===13?u?u.arguments[0]=a:r.props=a:u?u.arguments[0]=a:r.arguments[2]=a}function Zm$1(r,o){let s=!1;if(r.key.type===4){const a=r.key.content;s=o.properties.some(l=>l.key.type===4&&l.key.content===a)}return s}function ma$1(r,o){return`_${o}_${r.replace(/[^\w]/g,(s,a)=>s==="-"?"_":r.charCodeAt(a).toString())}`}function XS$1(r){return r.type===14&&r.callee===Op$1?r.arguments[1].returns:r}const zS$1=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,Nb$1={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:xu$1,isPreTag:xu$1,isCustomElement:xu$1,onError:Sp$1,onWarn:bb$1,comments:!1,prefixIdentifiers:!1};let nt=Nb$1,ha$1=null,Qr$1="",ln=null,rt$1=null,Sn$1="",Wr$1=-1,zo=-1,gc$1=0,go$1=!1,Vd$1=null;const Nt$1=[],vt=new $S$1(Nt$1,{onerr:En$1,ontext(r,o){ul$1(tn$1(r,o),r,o)},ontextentity(r,o,s){ul$1(r,o,s)},oninterpolation(r,o){if(go$1)return ul$1(tn$1(r,o),r,o);let s=r+vt.delimiterOpen.length,a=o-vt.delimiterClose.length;for(;kn$1(Qr$1.charCodeAt(s));)s++;for(;kn$1(Qr$1.charCodeAt(a-1));)a--;let l=tn$1(s,a);l.includes("&")&&(l=nt.decodeEntities(l,!1)),Dd$1({type:5,content:Vl$1(l,!1,jt$1(s,a)),loc:jt$1(r,o)})},onopentagname(r,o){const s=tn$1(r,o);ln={type:1,tag:s,ns:nt.getNamespace(s,Nt$1[0],nt.ns),tagType:0,props:[],children:[],loc:jt$1(r-1,o),codegenNode:void 0}},onopentagend(r){th$1(r)},onclosetag(r,o){const s=tn$1(r,o);if(!nt.isVoidTag(s)){let a=!1;for(let l=0;l0&&En$1(24,Nt$1[0].loc.start.offset);for(let c=0;c<=l;c++){const u=Nt$1.shift();Cl$1(u,o,c(a.type===7?a.rawName:a.name)===s)&&En$1(2,o)},onattribend(r,o){if(ln&&rt$1){if(ni$2(rt$1.loc,o),r!==0)if(Sn$1.includes("&")&&(Sn$1=nt.decodeEntities(Sn$1,!0)),rt$1.type===6)rt$1.name==="class"&&(Sn$1=xb$1(Sn$1).trim()),r===1&&!Sn$1&&En$1(13,o),rt$1.value={type:2,content:Sn$1,loc:r===1?jt$1(Wr$1,zo):jt$1(Wr$1-1,zo+1)},vt.inSFCRoot&&ln.tag==="template"&&rt$1.name==="lang"&&Sn$1&&Sn$1!=="html"&&vt.enterRCDATA(dc("-1&&is$1("COMPILER_V_BIND_SYNC",nt,rt$1.loc,rt$1.rawName)&&(rt$1.name="model",rt$1.modifiers.splice(a,1))}(rt$1.type!==7||rt$1.name!=="pre")&&ln.props.push(rt$1)}Sn$1="",Wr$1=zo=-1},oncomment(r,o){nt.comments&&Dd$1({type:3,content:tn$1(r,o),loc:jt$1(r-4,o+3)})},onend(){const r=Qr$1.length;for(let o=0;o{const T=o.start.offset+E,k=T+_.length;return Vl$1(_,!1,jt$1(T,k),0,w?1:0)},d={source:u(c.trim(),s.indexOf(c,l.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let m=l.trim().replace(JS$1,"").trim();const g=l.indexOf(m),y=m.match(eh$1);if(y){m=m.replace(eh$1,"").trim();const _=y[1].trim();let E;if(_&&(E=s.indexOf(_,g+m.length),d.key=u(_,E,!0)),y[2]){const w=y[2].trim();w&&(d.index=u(w,s.indexOf(w,d.key?E+_.length:g+m.length),!0))}}return m&&(d.value=u(m,g,!0)),d}function tn$1(r,o){return Qr$1.slice(r,o)}function th$1(r){vt.inSFCRoot&&(ln.innerLoc=jt$1(r+1,r+1)),Dd$1(ln);const{tag:o,ns:s}=ln;s===0&&nt.isPreTag(o)&&gc$1++,nt.isVoidTag(o)?Cl$1(ln,r):(Nt$1.unshift(ln),(s===1||s===2)&&(vt.inXML=!0)),ln=null}function ul$1(r,o,s){{const c=Nt$1[0]&&Nt$1[0].tag;c!=="script"&&c!=="style"&&r.includes("&")&&(r=nt.decodeEntities(r,!1))}const a=Nt$1[0]||ha$1,l=a.children[a.children.length-1];l&&l.type===2?(l.content+=r,ni$2(l.loc,s)):a.children.push({type:2,content:r,loc:jt$1(o,s)})}function Cl$1(r,o,s=!1){s?ni$2(r.loc,Sb$1(o,60)):ni$2(r.loc,qS$1(o,62)+1),vt.inSFCRoot&&(r.children.length?r.innerLoc.end=Jr$1({},r.children[r.children.length-1].loc.end):r.innerLoc.end=Jr$1({},r.innerLoc.start),r.innerLoc.source=tn$1(r.innerLoc.start.offset,r.innerLoc.end.offset));const{tag:a,ns:l}=r;go$1||(a==="slot"?r.tagType=2:nh$1(r)?r.tagType=3:e1$1(r)&&(r.tagType=1)),vt.inRCDATA||(r.children=Tb$1(r.children,r.tag)),l===0&&nt.isPreTag(a)&&gc$1--,Vd$1===r&&(go$1=vt.inVPre=!1,Vd$1=null),vt.inXML&&(Nt$1[0]?Nt$1[0].ns:nt.ns)===0&&(vt.inXML=!1);{const c=r.props;if(!vt.inSFCRoot&&Do$1("COMPILER_NATIVE_TEMPLATE",nt)&&r.tag==="template"&&!nh$1(r)){const d=Nt$1[0]||ha$1,m=d.children.indexOf(r);d.children.splice(m,1,...r.children)}const u=c.find(d=>d.type===6&&d.name==="inline-template");u&&is$1("COMPILER_INLINE_TEMPLATE",nt,u.loc)&&r.children.length&&(u.value={type:2,content:tn$1(r.children[0].loc.start.offset,r.children[r.children.length-1].loc.end.offset),loc:u.loc})}}function qS$1(r,o){let s=r;for(;Qr$1.charCodeAt(s)!==o&&s=0;)s--;return s}const ZS$1=new Set(["if","else","else-if","for","slot"]);function nh$1({tag:r,props:o}){if(r==="template"){for(let s=0;s64&&r<91}const n1$1=/\r\n/g;function Tb$1(r,o){const s=nt.whitespace!=="preserve";let a=!1;for(let l=0;l0){if(m>=2){d.codegenNode.patchFlag=-1,d.codegenNode=o.hoist(d.codegenNode),c++;continue}}else{const g=d.codegenNode;if(g.type===13){const y=g.patchFlag;if((y===void 0||y===512||y===1)&&Cb$1(d,o)>=2){const _=Vb$1(d);_&&(g.props=o.hoist(_))}g.dynamicProps&&(g.dynamicProps=o.hoist(g.dynamicProps))}}}if(d.type===1){const m=d.tagType===1;m&&o.scopes.vSlot++,Dl$1(d,o),m&&o.scopes.vSlot--}else if(d.type===11)Dl$1(d,o,d.children.length===1);else if(d.type===9)for(let m=0;m1)for(let m=0;mz&&(F.childIndex--,F.onNodeRemoved()),F.parent.children.splice(z,1)},onNodeRemoved:Gs$1,addIdentifiers(U){},removeIdentifiers(U){},hoist(U){Kt$1(U)&&(U=ze(U)),F.hoists.push(U);const J=ze(`_hoisted_${F.hoists.length}`,!1,U.loc,2);return J.hoisted=U,J},cache(U,J=!1){return RS$1(F.cached++,U,J)}};return F.filters=new Set,F}function d1$1(r,o){const s=u1$1(r,o);tu$1(r,s),o.hoistStatic&&l1$1(r,s),o.ssr||f1$1(r,s),r.helpers=new Set([...s.helpers.keys()]),r.components=[...s.components],r.directives=[...s.directives],r.imports=s.imports,r.hoists=s.hoists,r.temps=s.temps,r.cached=s.cached,r.transformed=!0,r.filters=[...s.filters]}function f1$1(r,o){const{helper:s}=o,{children:a}=r;if(a.length===1){const l=a[0];if(wb$1(r,l)&&l.codegenNode){const c=l.codegenNode;c.type===13&&Np$1(c,o),r.codegenNode=c}else r.codegenNode=l}else if(a.length>1){let l=64;r.codegenNode=fa$1(o,s(ua$1),void 0,r.children,l,void 0,void 0,!0,void 0,!1)}}function p1$1(r,o){let s=0;const a=()=>{s--};for(;sa===r:a=>r.test(a);return(a,l)=>{if(a.type===1){const{props:c}=a;if(a.tagType===3&&c.some(KS$1))return;const u=[];for(let d=0;d`${ts$2[r]}: _${ts$2[r]}`;function m1$1(r,{mode:o="function",prefixIdentifiers:s=o==="module",sourceMap:a=!1,filename:l="template.vue.html",scopeId:c=null,optimizeImports:u=!1,runtimeGlobalName:d="Vue",runtimeModuleName:m="vue",ssrRuntimeModuleName:g="vue/server-renderer",ssr:y=!1,isTS:_=!1,inSSR:E=!1}){const w={mode:o,prefixIdentifiers:s,sourceMap:a,filename:l,scopeId:c,optimizeImports:u,runtimeGlobalName:d,runtimeModuleName:m,ssrRuntimeModuleName:g,ssr:y,isTS:_,inSSR:E,source:r.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(k){return`_${ts$2[k]}`},push(k,O=-2,R){w.code+=k},indent(){T(++w.indentLevel)},deindent(k=!1){k?--w.indentLevel:T(--w.indentLevel)},newline(){T(w.indentLevel)}};function T(k){w.push(` -`+" ".repeat(k),0)}return w}function h1$1(r,o={}){const s=m1$1(r,o);o.onContextCreated&&o.onContextCreated(s);const{mode:a,push:l,prefixIdentifiers:c,indent:u,deindent:d,newline:m,scopeId:g,ssr:y}=s,_=Array.from(r.helpers),E=_.length>0,w=!c&&a!=="module";g1$1(r,s);const T=y?"ssrRender":"render",k=(y?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(l(`function ${T}(${k}) {`),u(),w&&(l("with (_ctx) {"),u(),E&&(l(`const { ${_.map(Ab$1).join(", ")} } = _Vue -`,-1),m())),r.components.length&&(Iu$1(r.components,"component",s),(r.directives.length||r.temps>0)&&m()),r.directives.length&&(Iu$1(r.directives,"directive",s),r.temps>0&&m()),r.filters&&r.filters.length&&(m(),Iu$1(r.filters,"filter",s),m()),r.temps>0){l("let ");for(let O=0;O0?", ":""}_temp${O}`)}return(r.components.length||r.directives.length||r.temps)&&(l(` -`,0),m()),y||l("return "),r.codegenNode?mn$1(r.codegenNode,s):l("null"),w&&(d(),l("}")),d(),l("}"),{ast:r,code:s.code,preamble:"",map:s.map?s.map.toJSON():void 0}}function g1$1(r,o){const{ssr:s,prefixIdentifiers:a,push:l,newline:c,runtimeModuleName:u,runtimeGlobalName:d,ssrRuntimeModuleName:m}=o,g=d,y=Array.from(r.helpers);if(y.length>0&&(l(`const _Vue = ${g} -`,-1),r.hoists.length)){const _=[cp$1,up$1,Ha$1,dp$1,hb$1].filter(E=>y.includes(E)).map(Ab$1).join(", ");l(`const { ${_} } = _Vue -`,-1)}v1$1(r.hoists,o),c(),l("return ")}function Iu$1(r,o,{helper:s,push:a,newline:l,isTS:c}){const u=s(o==="filter"?hp$1:o==="component"?fp$1:mp$2);for(let d=0;d3||!1;o.push("["),s&&o.indent(),Ka$1(r,o,s),s&&o.deindent(),o.push("]")}function Ka$1(r,o,s=!1,a=!0){const{push:l,newline:c}=o;for(let u=0;us||"null")}function T1$1(r,o){const{push:s,helper:a,pure:l}=o,c=Kt$1(r.callee)?r.callee:a(r.callee);l&&s(nu$2),s(c+"(",-2,r),Ka$1(r.arguments,o),s(")")}function x1$1(r,o){const{push:s,indent:a,deindent:l,newline:c}=o,{properties:u}=r;if(!u.length){s("{}",-2,r);return}const d=u.length>1||!1;s(d?"{":"{ "),d&&a();for(let m=0;m "),(m||d)&&(s("{"),a()),u?(m&&s("return "),es$1(u)?xp$1(u,o):mn$1(u,o)):d&&mn$1(d,o),(m||d)&&(l(),s("}")),g&&(r.isNonScopedSlot&&s(", undefined, true"),s(")"))}function C1$1(r,o){const{test:s,consequent:a,alternate:l,newline:c}=r,{push:u,indent:d,deindent:m,newline:g}=o;if(s.type===4){const _=!Tp$1(s.content);_&&u("("),Lb$1(s,o),_&&u(")")}else u("("),mn$1(s,o),u(")");c&&d(),o.indentLevel++,c||u(" "),u("? "),mn$1(a,o),o.indentLevel--,c&&g(),c||u(" "),u(": ");const y=l.type===19;y||o.indentLevel++,mn$1(l,o),y||o.indentLevel--,c&&m(!0)}function V1$1(r,o){const{push:s,helper:a,indent:l,deindent:c,newline:u}=o;s(`_cache[${r.index}] || (`),r.isVOnce&&(l(),s(`${a(uc$1)}(-1),`),u(),s("(")),s(`_cache[${r.index}] = `),mn$1(r.value,o),r.isVOnce&&(s(`).cacheIndex = ${r.index},`),u(),s(`${a(uc$1)}(1),`),u(),s(`_cache[${r.index}]`),c()),s(")")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const P1$1=Db$1(/^(if|else|else-if)$/,(r,o,s)=>R1$1(r,o,s,(a,l,c)=>{const u=s.parent.children;let d=u.indexOf(a),m=0;for(;d-->=0;){const g=u[d];g&&g.type===9&&(m+=g.branches.length)}return()=>{if(c)a.codegenNode=oh$1(l,m,s);else{const g=$1$1(a.codegenNode);g.alternate=oh$1(l,m+a.branches.length-1,s)}}}));function R1$1(r,o,s,a){if(o.name!=="else"&&(!o.exp||!o.exp.content.trim())){const l=o.exp?o.exp.loc:r.loc;s.onError(dt(28,o.loc)),o.exp=ze("true",!1,l)}if(o.name==="if"){const l=rh$1(r,o),c={type:9,loc:r.loc,branches:[l]};if(s.replaceNode(c),a)return a(c,l,!0)}else{const l=s.parent.children;let c=l.indexOf(r);for(;c-->=-1;){const u=l[c];if(u&&u.type===3){s.removeNode(u);continue}if(u&&u.type===2&&!u.content.trim().length){s.removeNode(u);continue}if(u&&u.type===9){o.name==="else-if"&&u.branches[u.branches.length-1].condition===void 0&&s.onError(dt(30,r.loc)),s.removeNode();const d=rh$1(r,o);u.branches.push(d);const m=a&&a(u,d,!1);tu$1(d,s),m&&m(),s.currentNode=null}else s.onError(dt(30,r.loc));break}}}function rh$1(r,o){const s=r.tagType===3;return{type:10,loc:r.loc,condition:o.name==="else"?void 0:o.exp,children:s&&!Yn$1(r,"for")?r.children:[r],userKey:pa$1(r,"key"),isTemplateIf:s}}function oh$1(r,o,s){return r.condition?Id(r.condition,ih$1(r,o,s),Bt$1(s.helper(Ha$1),['""',"true"])):ih$1(r,o,s)}function ih$1(r,o,s){const{helper:a}=s,l=$t$1("key",ze(`${o}`,!1,Hn$1,2)),{children:c}=r,u=c[0];if(c.length!==1||u.type!==1)if(c.length===1&&u.type===11){const d=u.codegenNode;return hc(d,l,s),d}else return fa$1(s,a(ua$1),Jn$1([l]),c,64,void 0,void 0,!0,!1,!1,r.loc);else{const d=u.codegenNode,m=XS$1(d);return m.type===13&&Np$1(m,s),hc(m,l,s),d}}function $1$1(r){for(;;)if(r.type===19)if(r.alternate.type===19)r=r.alternate;else return r;else r.type===20&&(r=r.value)}const k1$1=(r,o,s)=>{const{modifiers:a,loc:l}=r,c=r.arg;let{exp:u}=r;if(u&&u.type===4&&!u.content.trim()&&(u=void 0),!u){if(c.type!==4||!c.isStatic)return s.onError(dt(52,c.loc)),{props:[$t$1(c,ze("",!0,l))]};Rb$1(r),u=r.exp}return c.type!==4?(c.children.unshift("("),c.children.push(') || ""')):c.isStatic||(c.content=`${c.content} || ""`),a.includes("camel")&&(c.type===4?c.isStatic?c.content=Vo(c.content):c.content=`${s.helperString(xd$1)}(${c.content})`:(c.children.unshift(`${s.helperString(xd$1)}(`),c.children.push(")"))),s.inSSR||(a.includes("prop")&&sh$1(c,"."),a.includes("attr")&&sh$1(c,"^")),{props:[$t$1(c,u)]}},Rb$1=(r,o)=>{const s=r.arg,a=Vo(s.content);r.exp=ze(a,!1,s.loc)},sh$1=(r,o)=>{r.type===4?r.isStatic?r.content=o+r.content:r.content=`\`${o}\${${r.content}}\``:(r.children.unshift(`'${o}' + (`),r.children.push(")"))},F1$1=Db$1("for",(r,o,s)=>{const{helper:a,removeHelper:l}=s;return U1$1(r,o,s,c=>{const u=Bt$1(a(vp$1),[c.source]),d=pc(r),m=Yn$1(r,"memo"),g=pa$1(r,"key",!1,!0);g&&g.type===7&&!g.exp&&Rb$1(g);const y=g&&(g.type===6?g.value?ze(g.value.content,!0):void 0:g.exp),_=g&&y?$t$1("key",y):null,E=c.source.type===4&&c.source.constType>0,w=E?64:g?128:256;return c.codegenNode=fa$1(s,a(ua$1),void 0,u,w,void 0,void 0,!0,!E,!1,r.loc),()=>{let T;const{children:k}=c,O=k.length!==1||k[0].type!==1,R=mc$1(r)?r:d&&r.children.length===1&&mc$1(r.children[0])?r.children[0]:null;if(R?(T=R.codegenNode,d&&_&&hc(T,_,s)):O?T=fa$1(s,a(ua$1),_?Jn$1([_]):void 0,r.children,64,void 0,void 0,!0,void 0,!1):(T=k[0].codegenNode,d&&_&&hc(T,_,s),T.isBlock!==!E&&(T.isBlock?(l(Oi$1),l(os$1(s.inSSR,T.isComponent))):l(rs$1(s.inSSR,T.isComponent))),T.isBlock=!E,T.isBlock?(a(Oi$1),a(os$1(s.inSSR,T.isComponent))):a(rs$1(s.inSSR,T.isComponent))),m){const M=ns$1(Ad$1(c.parseResult,[ze("_cached")]));M.body=MS$1([vr$1(["const _memo = (",m.exp,")"]),vr$1(["if (_cached",...y?[" && _cached.key === ",y]:[],` && ${s.helperString(yb$1)}(_cached, _memo)) return _cached`]),vr$1(["const _item = ",T]),ze("_item.memo = _memo"),ze("return _item")]),u.arguments.push(M,ze("_cache"),ze(String(s.cached++)))}else u.arguments.push(ns$1(Ad$1(c.parseResult),T,!0))}})});function U1$1(r,o,s,a){if(!o.exp){s.onError(dt(31,o.loc));return}const l=o.forParseResult;if(!l){s.onError(dt(32,o.loc));return}Mb$1(l);const{addIdentifiers:c,removeIdentifiers:u,scopes:d}=s,{source:m,value:g,key:y,index:_}=l,E={type:11,loc:o.loc,source:m,valueAlias:g,keyAlias:y,objectIndexAlias:_,parseResult:l,children:pc(r)?r.children:[r]};s.replaceNode(E),d.vFor++;const w=a&&a(E);return()=>{d.vFor--,w&&w()}}function Mb$1(r,o){r.finalized||(r.finalized=!0)}function Ad$1({value:r,key:o,index:s},a=[]){return j1$1([r,o,s,...a])}function j1$1(r){let o=r.length;for(;o--&&!r[o];);return r.slice(0,o+1).map((s,a)=>s||ze("_".repeat(a+1),!1))}const ah$1=ze("undefined",!1),B1$1=(r,o)=>{if(r.type===1&&(r.tagType===1||r.tagType===3)){const s=Yn$1(r,"slot");if(s)return s.exp,o.scopes.vSlot++,()=>{o.scopes.vSlot--}}},H1$1=(r,o,s,a)=>ns$1(r,s,!1,!0,s.length?s[0].loc:a);function W1$1(r,o,s=H1$1){o.helper(_p$1);const{children:a,loc:l}=r,c=[],u=[];let d=o.scopes.vSlot>0||o.scopes.vFor>0;const m=Yn$1(r,"slot",!0);if(m){const{arg:O,exp:R}=m;O&&!In$1(O)&&(d=!0),c.push($t$1(O||ze("default",!0),s(R,void 0,a,l)))}let g=!1,y=!1;const _=[],E=new Set;let w=0;for(let O=0;O{const N=s(R,void 0,M,l);return o.compatConfig&&(N.isNonScopedSlot=!0),$t$1("default",N)};g?_.length&&_.some(R=>$b$1(R))&&(y?o.onError(dt(39,_[0].loc)):c.push(O(void 0,_))):c.push(O(void 0,a))}const T=d?2:Al$1(r.children)?3:1;let k=Jn$1(c.concat($t$1("_",ze(T+"",!1))),l);return u.length&&(k=Bt$1(o.helper(vb$1),[k,Ga$1(u)])),{slots:k,hasDynamicSlots:d}}function dl$1(r,o,s){const a=[$t$1("name",r),$t$1("fn",o)];return s!=null&&a.push($t$1("key",ze(String(s),!0))),Jn$1(a)}function Al$1(r){for(let o=0;ofunction(){if(r=o.currentNode,!(r.type===1&&(r.tagType===0||r.tagType===1)))return;const{tag:s,props:a}=r,l=r.tagType===1;let c=l?K1$1(r,o):`"${s}"`;const u=uS$1(c)&&c.callee===pp$1;let d,m,g=0,y,_,E,w=u||c===Ks$1||c===lp$1||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(a.length>0){const T=Fb$1(r,o,void 0,l,u);d=T.props,g=T.patchFlag,_=T.dynamicPropNames;const k=T.directives;E=k&&k.length?Ga$1(k.map(O=>X1$1(O,o))):void 0,T.shouldUseBlock&&(w=!0)}if(r.children.length>0)if(c===lc$1&&(w=!0,g|=1024),l&&c!==Ks$1&&c!==lc$1){const{slots:T,hasDynamicSlots:k}=W1$1(r,o);m=T,k&&(g|=1024)}else if(r.children.length===1&&c!==Ks$1){const T=r.children[0],k=T.type,O=k===5||k===8;O&&Qn$1(T,o)===0&&(g|=1),O||k===2?m=T:m=r.children}else m=r.children;_&&_.length&&(y=z1$1(_)),r.codegenNode=fa$1(o,c,d,m,g===0?void 0:g,y,E,!!w,!1,l,r.loc)};function K1$1(r,o,s=!1){let{tag:a}=r;const l=Ld$1(a),c=pa$1(r,"is",!1,!0);if(c)if(l||Do$1("COMPILER_IS_ON_ELEMENT",o)){let d;if(c.type===6?d=c.value&&ze(c.value.content,!0):(d=c.exp,d||(d=ze("is",!1,c.arg.loc))),d)return Bt$1(o.helper(pp$1),[d])}else c.type===6&&c.value.content.startsWith("vue:")&&(a=c.value.content.slice(4));const u=Eb$1(a)||o.isBuiltInComponent(a);return u?(s||o.helper(u),u):(o.helper(fp$1),o.components.add(a),ma$1(a,"component"))}function Fb$1(r,o,s=r.props,a,l,c=!1){const{tag:u,loc:d,children:m}=r;let g=[];const y=[],_=[],E=m.length>0;let w=!1,T=0,k=!1,O=!1,R=!1,M=!1,N=!1,D=!1;const P=[],I=J=>{g.length&&(y.push(Jn$1(lh$1(g),d)),g=[]),J&&y.push(J)},L=()=>{o.scopes.vFor>0&&g.push($t$1(ze("ref_for",!0),ze("true")))},F=({key:J,value:z})=>{if(In$1(J)){const ie=J.content,ce=Td$1(ie);if(ce&&(!a||l)&&ie.toLowerCase()!=="onclick"&&ie!=="onUpdate:modelValue"&&!Ym$1(ie)&&(M=!0),ce&&Ym$1(ie)&&(D=!0),ce&&z.type===14&&(z=z.arguments[0]),z.type===20||(z.type===4||z.type===8)&&Qn$1(z,o)>0)return;ie==="ref"?k=!0:ie==="class"?O=!0:ie==="style"?R=!0:ie!=="key"&&!P.includes(ie)&&P.push(ie),a&&(ie==="class"||ie==="style")&&!P.includes(ie)&&P.push(ie)}else N=!0};for(let J=0;J1?U=Bt$1(o.helper(cc$1),y,d):U=y[0]):g.length&&(U=Jn$1(lh$1(g),d)),N?T|=16:(O&&!a&&(T|=2),R&&!a&&(T|=4),P.length&&(T|=8),M&&(T|=32)),!w&&(T===0||T===32)&&(k||D||_.length>0)&&(T|=512),!o.inSSR&&U)switch(U.type){case 15:let J=-1,z=-1,ie=!1;for(let B=0;B$t$1(u,c)),l))}return Ga$1(s,r.loc)}function z1$1(r){let o="[";for(let s=0,a=r.length;s{if(mc$1(r)){const{children:s,loc:a}=r,{slotName:l,slotProps:c}=Q1$1(r,o),u=[o.prefixIdentifiers?"_ctx.$slots":"$slots",l,"{}","undefined","true"];let d=2;c&&(u[2]=c,d=3),s.length&&(u[3]=ns$1([],s,!1,!1,a),d=4),o.scopeId&&!o.slotted&&(d=5),u.splice(d),r.codegenNode=Bt$1(o.helper(gb$1),u,a)}};function Q1$1(r,o){let s='"default"',a;const l=[];for(let c=0;c0){const{props:c,directives:u}=Fb$1(r,o,l,!1,!1);a=c,u.length&&o.onError(dt(36,u[0].loc))}return{slotName:s,slotProps:a}}const q1$1=/^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,Ub$1=(r,o,s,a)=>{const{loc:l,modifiers:c,arg:u}=r;!r.exp&&!c.length&&s.onError(dt(35,l));let d;if(u.type===4)if(u.isStatic){let _=u.content;_.startsWith("vue:")&&(_=`vnode-${_.slice(4)}`);const E=o.tagType!==0||_.startsWith("vnode")||!/[A-Z]/.test(_)?pS$1(Vo(_)):`on:${_}`;d=ze(E,!0,u.loc)}else d=vr$1([`${s.helperString(wd$1)}(`,u,")"]);else d=u,d.children.unshift(`${s.helperString(wd$1)}(`),d.children.push(")");let m=r.exp;m&&!m.content.trim()&&(m=void 0);let g=s.cacheHandlers&&!m&&!s.inVOnce;if(m){const _=_b$1(m.content),E=!(_||q1$1.test(m.content)),w=m.content.includes(";");(E||g&&_)&&(m=vr$1([`${E?"$event":"(...args)"} => ${w?"{":"("}`,m,w?"}":")"]))}let y={props:[$t$1(d,m||ze("() => {}",!1,l))]};return a&&(y=a(y)),g&&(y.props[0].value=s.cache(y.props[0].value)),y.props.forEach(_=>_.key.isHandlerKey=!0),y},Z1$1=(r,o)=>{if(r.type===0||r.type===1||r.type===11||r.type===10)return()=>{const s=r.children;let a,l=!1;for(let c=0;cc.type===7&&!o.directiveTransforms[c.name])&&r.tag!=="template")))for(let c=0;c{if(r.type===1&&Yn$1(r,"once",!0))return ch$1.has(r)||o.inVOnce||o.inSSR?void 0:(ch$1.add(r),o.inVOnce=!0,o.helper(uc$1),()=>{o.inVOnce=!1;const s=o.currentNode;s.codegenNode&&(s.codegenNode=o.cache(s.codegenNode,!0))})},jb$1=(r,o,s)=>{const{exp:a,arg:l}=r;if(!a)return s.onError(dt(41,r.loc)),fl$1();const c=a.loc.source,u=a.type===4?a.content:c,d=s.bindingMetadata[c];if(d==="props"||d==="props-aliased")return s.onError(dt(44,a.loc)),fl$1();if(!u.trim()||!_b$1(u)&&!!1)return s.onError(dt(42,a.loc)),fl$1();const g=l||ze("modelValue",!0),y=l?In$1(l)?`onUpdate:${Vo(l.content)}`:vr$1(['"onUpdate:" + ',l]):"onUpdate:modelValue";let _;const E=s.isTS?"($event: any)":"$event";_=vr$1([`${E} => ((`,a,") = $event)"]);const w=[$t$1(g,r.exp),$t$1(y,_)];if(r.modifiers.length&&o.tagType===1){const T=r.modifiers.map(O=>(Tp$1(O)?O:JSON.stringify(O))+": true").join(", "),k=l?In$1(l)?`${l.content}Modifiers`:vr$1([l,' + "Modifiers"']):"modelModifiers";w.push($t$1(k,ze(`{ ${T} }`,!1,r.loc,2)))}return fl$1(w)};function fl$1(r=[]){return{props:r}}const tT$1=/[\w).+\-_$\]]/,nT$1=(r,o)=>{Do$1("COMPILER_FILTERS",o)&&(r.type===5?vc$1(r.content,o):r.type===1&&r.props.forEach(s=>{s.type===7&&s.name!=="for"&&s.exp&&vc$1(s.exp,o)}))};function vc$1(r,o){if(r.type===4)uh$1(r,o);else for(let s=0;s=0&&(M=s.charAt(R),M===" ");R--);(!M||!tT$1.test(M))&&(u=!0)}}T===void 0?T=s.slice(0,w).trim():y!==0&&O();function O(){k.push(s.slice(y,w).trim()),y=w+1}if(k.length){for(w=0;w{if(r.type===1){const s=Yn$1(r,"memo");return!s||dh.has(r)?void 0:(dh.add(r),()=>{const a=r.codegenNode||o.currentNode.codegenNode;a&&a.type===13&&(r.tagType!==1&&Np$1(a,o),r.codegenNode=Bt$1(o.helper(Op$1),[s.exp,ns$1(void 0,a),"_cache",String(o.cached++)]))})}};function iT$1(r){return[[eT$1,P1$1,oT$1,F1$1,nT$1,J1$1,G1$1,B1$1,Z1$1],{on:Ub$1,bind:k1$1,model:jb$1}]}function sT$1(r,o={}){const s=o.onError||Sp$1,a=o.mode==="module";o.prefixIdentifiers===!0?s(dt(47)):a&&s(dt(48));const l=!1;o.cacheHandlers&&s(dt(49)),o.scopeId&&!a&&s(dt(50));const c=Jr$1({},o,{prefixIdentifiers:l}),u=Kt$1(r)?a1$1(r,c):r,[d,m]=iT$1();return d1$1(u,Jr$1({},c,{nodeTransforms:[...d,...o.nodeTransforms||[]],directiveTransforms:Jr$1({},m,o.directiveTransforms||{})})),h1$1(u,c)}const aT$1=()=>({props:[]});/** -* @vue/compiler-dom v3.4.37 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const Bb$1=Symbol(""),Hb$1=Symbol(""),Wb$1=Symbol(""),Gb$1=Symbol(""),Pd$1=Symbol(""),Kb$1=Symbol(""),Yb$1=Symbol(""),Xb$1=Symbol(""),wp$2=Symbol(""),zb$1=Symbol("");LS$1({[Bb$1]:"vModelRadio",[Hb$1]:"vModelCheckbox",[Wb$1]:"vModelText",[Gb$1]:"vModelSelect",[Pd$1]:"vModelDynamic",[Kb$1]:"withModifiers",[Yb$1]:"withKeys",[Xb$1]:"vShow",[wp$2]:"Transition",[zb$1]:"TransitionGroup"});let Di$1;function lT$1(r,o=!1){return Di$1||(Di$1=document.createElement("div")),o?(Di$1.innerHTML=`
`,Di$1.children[0].getAttribute("foo")):(Di$1.innerHTML=r,Di$1.textContent)}const cT$1={parseMode:"html",isVoidTag:wS$1,isNativeTag:r=>SS$1(r)||TS$1(r)||xS$1(r),isPreTag:r=>r==="pre",decodeEntities:lT$1,isBuiltInComponent:r=>{if(r==="Transition"||r==="transition")return wp$2;if(r==="TransitionGroup"||r==="transition-group")return zb$1},getNamespace(r,o,s){let a=o?o.ns:s;if(o&&a===2)if(o.tag==="annotation-xml"){if(r==="svg")return 1;o.props.some(l=>l.type===6&&l.name==="encoding"&&l.value!=null&&(l.value.content==="text/html"||l.value.content==="application/xhtml+xml"))&&(a=0)}else/^m(?:[ions]|text)$/.test(o.tag)&&r!=="mglyph"&&r!=="malignmark"&&(a=0);else o&&a===1&&(o.tag==="foreignObject"||o.tag==="desc"||o.tag==="title")&&(a=0);if(a===0){if(r==="svg")return 1;if(r==="math")return 2}return a}},uT$1=r=>{r.type===1&&r.props.forEach((o,s)=>{o.type===6&&o.name==="style"&&o.value&&(r.props[s]={type:7,name:"bind",arg:ze("style",!0,o.loc),exp:dT$1(o.value.content,o.loc),modifiers:[],loc:o.loc})})},dT$1=(r,o)=>{const s=bS$1(r);return ze(JSON.stringify(s),!1,o,3)};function fr$1(r,o){return dt(r,o)}const pT$1=(r,o,s)=>{const{exp:a,loc:l}=r;return a||s.onError(fr$1(53,l)),o.children.length&&(s.onError(fr$1(54,l)),o.children.length=0),{props:[$t$1(ze("innerHTML",!0,l),a||ze("",!0))]}},mT$1=(r,o,s)=>{const{exp:a,loc:l}=r;return a||s.onError(fr$1(55,l)),o.children.length&&(s.onError(fr$1(56,l)),o.children.length=0),{props:[$t$1(ze("textContent",!0),a?Qn$1(a,s)>0?a:Bt$1(s.helperString(eu$1),[a],l):ze("",!0))]}},hT$1=(r,o,s)=>{const a=jb$1(r,o,s);if(!a.props.length||o.tagType===1)return a;r.arg&&s.onError(fr$1(58,r.arg.loc));const{tag:l}=o,c=s.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||c){let u=Wb$1,d=!1;if(l==="input"||c){const m=pa$1(o,"type");if(m){if(m.type===7)u=Pd$1;else if(m.value)switch(m.value.content){case"radio":u=Bb$1;break;case"checkbox":u=Hb$1;break;case"file":d=!0,s.onError(fr$1(59,r.loc));break}}else GS$1(o)&&(u=Pd$1)}else l==="select"&&(u=Gb$1);d||(a.needRuntime=s.helper(u))}else s.onError(fr$1(57,r.loc));return a.props=a.props.filter(u=>!(u.key.type===4&&u.key.content==="modelValue")),a},gT$1=Mr$1("passive,once,capture"),vT$1=Mr$1("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),yT$1=Mr$1("left,right"),Jb$1=Mr$1("onkeyup,onkeydown,onkeypress",!0),bT$1=(r,o,s,a)=>{const l=[],c=[],u=[];for(let d=0;dIn$1(r)&&r.content.toLowerCase()==="onclick"?ze(o,!0):r.type!==4?vr$1(["(",r,`) === "onClick" ? "${o}" : (`,r,")"]):r,ET$1=(r,o,s)=>Ub$1(r,o,s,a=>{const{modifiers:l}=r;if(!l.length)return a;let{key:c,value:u}=a.props[0];const{keyModifiers:d,nonKeyModifiers:m,eventOptionModifiers:g}=bT$1(c,l,s,r.loc);if(m.includes("right")&&(c=fh(c,"onContextmenu")),m.includes("middle")&&(c=fh(c,"onMouseup")),m.length&&(u=Bt$1(s.helper(Kb$1),[u,JSON.stringify(m)])),d.length&&(!In$1(c)||Jb$1(c.content))&&(u=Bt$1(s.helper(Yb$1),[u,JSON.stringify(d)])),g.length){const y=g.map(ap$2).join("");c=In$1(c)?ze(`${c.content}${y}`,!0):vr$1(["(",c,`) + "${y}"`])}return{props:[$t$1(c,u)]}}),_T$1=(r,o,s)=>{const{exp:a,loc:l}=r;return a||s.onError(fr$1(61,l)),{props:[],needRuntime:s.helper(Xb$1)}},NT$1=(r,o)=>{r.type===1&&r.tagType===0&&(r.tag==="script"||r.tag==="style")&&o.removeNode()},ST$1=[uT$1],TT$1={cloak:aT$1,html:pT$1,text:mT$1,model:hT$1,on:ET$1,show:_T$1};function xT$1(r,o={}){return sT$1(r,Jr$1({},cT$1,o,{nodeTransforms:[NT$1,...ST$1,...o.nodeTransforms||[]],directiveTransforms:Jr$1({},TT$1,o.directiveTransforms||{}),transformHoist:null}))}const ph=new WeakMap;function IT$1(r){let o=ph.get(r??Sd$1);return o||(o=Object.create(null),ph.set(r??Sd$1,o)),o}function qb$1(r,o){if(!Kt$1(r))if(r.nodeType)r=r.innerHTML;else return Gs$1;const s=r,a=IT$1(o),l=a[s];if(l)return l;if(r[0]==="#"){const m=document.querySelector(r);r=m?m.innerHTML:""}const c=Jr$1({hoistStatic:!0,onError:void 0,onWarn:Gs$1},o);!c.isCustomElement&&typeof customElements<"u"&&(c.isCustomElement=m=>!!customElements.get(m));const{code:u}=xT$1(r,c),d=new Function("Vue",u)(cS$1);return d._rc=!0,a[s]=d}qf$1(qb$1);const CT$1=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:Of$1,BaseTransitionPropsValidators:Bc$1,Comment:Et,DeprecationTypes:ky$1,EffectScope:Cc$1,ErrorCodes:hv$1,ErrorTypeStrings:Ay$1,Fragment:Ze,KeepAlive:Cv$1,ReactiveEffect:hi$1,Static:zr$1,Suspense:hy$1,Teleport:ry$1,Text:gr$1,TrackOpTypes:ov$1,Transition:Qc$1,TransitionGroup:Zy$1,TriggerOpTypes:iv$1,VueElement:Ba$1,assertNumber:kc$1,callWithAsyncErrorHandling:Vn,callWithErrorHandling:hr$2,camelize:pn$1,capitalize:gi$1,cloneVNode:jn$1,compatUtils:$y$1,compile:qb$1,computed:xt$1,createApp:ca$1,createBlock:be,createCommentVNode:xe,createElementBlock:ae,createElementVNode:b,createHydrationRenderer:Hf$1,createPropsRestProxy:Hv$1,createRenderer:Bf$1,createSSRApp:sb$1,createSlots:Dv$1,createStaticVNode:Sy$1,createTextVNode:to$1,createVNode:A,customRef:hf$1,defineAsyncComponent:Iv$1,defineComponent:Ee,defineCustomElement:rp$1,defineEmits:Pv$1,defineExpose:Rv$1,defineModel:kv$1,defineOptions:Mv$1,defineProps:Lv$1,defineSSRCustomElement:Xy$1,defineSlots:$v$1,devtools:Ly$1,effect:kg$1,effectScope:wa$1,getCurrentInstance:qt$1,getCurrentScope:Vc$1,getTransitionRawChildren:La$1,guardReactiveProps:zf$1,h:dr$1,handleError:oo$1,hasInjectionContext:Uf$1,hydrate:op$1,initCustomFormatter:Zf$1,initDirectivesForSSR:db$1,inject:Co$1,isMemoSame:ep$1,isProxy:zi,isReactive:Cn$1,isReadonly:yr$1,isRef:Ce,isRuntimeOnly:Yc$1,isShallow:mr$1,isVNode:br$1,markRaw:xr$1,mergeDefaults:Bv$1,mergeModels:$f$1,mergeProps:Qf$1,nextTick:Ao$1,normalizeClass:yt$1,normalizeProps:dv$1,normalizeStyle:wi$1,onActivated:Nf$1,onBeforeMount:Pa$1,onBeforeUnmount:Ma$1,onBeforeUpdate:Tf$1,onDeactivated:Sf$1,onErrorCaptured:Cf$1,onMounted:Pn$1,onRenderTracked:If$1,onRenderTriggered:wf$1,onScopeDispose:lf$1,onServerPrefetch:xf$1,onUnmounted:Ii$1,onUpdated:Ra$1,openBlock:H,popScopeId:Nv$1,provide:Ff$1,proxyRefs:Rc$1,pushScopeId:Ov$1,queuePostFlushCb:Ji$1,reactive:De,readonly:Lc$1,ref:$e,registerRuntimeCompiler:qf$1,render:ac$2,renderList:Qt$1,renderSlot:Qi$1,resolveComponent:Vf$1,resolveDirective:Wc$1,resolveDynamicComponent:Af$1,resolveFilter:My$1,resolveTransitionHooks:yi$1,setBlockTracking:nc$1,setDevtoolsHook:Py$1,setTransitionHooks:eo$1,shallowReactive:ff$1,shallowReadonly:zn$1,shallowRef:Ia$1,ssrContextKey:Wf$1,ssrUtils:Ry$1,stop:Fg$1,toDisplayString:Ct,toHandlerKey:Nr$1,toHandlers:Av$1,toRaw:Le,toRef:$s$1,toRefs:Kl$1,toValue:nv$1,transformVNodeArgs:Ey$1,triggerRef:tv$1,unref:x,useAttrs:Uv$1,useCssModule:zy$1,useCssVars:Yy$1,useModel:ec$1,useSSRContext:Gf$1,useSlots:Mf$1,useTransitionState:jc$1,vModelCheckbox:Ye$1,vModelDynamic:_i$1,vModelRadio:Zc$1,vModelSelect:rn$1,vModelText:me,vShow:qc$1,version:oc$1,warn:Ut$1,watch:Oe,watchEffect:uy$1,watchPostEffect:Kf$1,watchSyncEffect:Yf$1,withAsyncContext:Wv$1,withCtx:ye,withDefaults:Fv$1,withDirectives:Q,withKeys:nb$1,withMemo:Dy$1,withModifiers:nn$1,withScopeId:Sv$1},Symbol.toStringTag,{value:"Module"}));var Zb$1=!1;/*! - * pinia v2.2.2 - * (c) 2024 Eduardo San Martin Morote - * @license MIT - */let Ds$1;const ga$1=r=>Ds$1=r,tE$1=Symbol();function Ni$1(r){return r&&typeof r=="object"&&Object.prototype.toString.call(r)==="[object Object]"&&typeof r.toJSON!="function"}var Cr$1;(function(r){r.direct="direct",r.patchObject="patch object",r.patchFunction="patch function"})(Cr$1||(Cr$1={}));function ex$1(){const r=wa$1(!0),o=r.run(()=>$e({}));let s=[],a=[];const l=xr$1({install(c){ga$1(l),l._a=c,c.provide(tE$1,l),c.config.globalProperties.$pinia=l,a.forEach(u=>s.push(u)),a=[]},use(c){return!this._a&&!Zb$1?a.push(c):s.push(c),this},_p:s,_a:null,_e:r,_s:new Map,state:o});return l}const dE$1=()=>{};function hh(r,o,s,a=dE$1){r.push(o);const l=()=>{const c=r.indexOf(o);c>-1&&(r.splice(c,1),a())};return!s&&Vc$1()&&lf$1(l),l}function Li$1(r,...o){r.slice().forEach(s=>{s(...o)})}const tx$1=r=>r(),gh=Symbol(),Du$1=Symbol();function Md$1(r,o){r instanceof Map&&o instanceof Map?o.forEach((s,a)=>r.set(a,s)):r instanceof Set&&o instanceof Set&&o.forEach(r.add,r);for(const s in o){if(!o.hasOwnProperty(s))continue;const a=o[s],l=r[s];Ni$1(l)&&Ni$1(a)&&r.hasOwnProperty(s)&&!Ce(a)&&!Cn$1(a)?r[s]=Md$1(l,a):r[s]=a}return r}const nx$1=Symbol();function rx$2(r){return!Ni$1(r)||!r.hasOwnProperty(nx$1)}const{assign:Kn$1}=Object;function vh$2(r){return!!(Ce(r)&&r.effect)}function yh(r,o,s,a){const{state:l,actions:c,getters:u}=o,d=s.state.value[r];let m;function g(){!d&&(s.state.value[r]=l?l():{});const y=Kl$1(s.state.value[r]);return Kn$1(y,c,Object.keys(u||{}).reduce((_,E)=>(_[E]=xr$1(xt$1(()=>{ga$1(s);const w=s._s.get(r);return u[E].call(w,w)})),_),{}))}return m=$d$1(r,g,o,s,a,!0),m}function $d$1(r,o,s={},a,l,c){let u;const d=Kn$1({actions:{}},s),m={deep:!0};let g,y,_=[],E=[],w;const T=a.state.value[r];!c&&!T&&(a.state.value[r]={}),$e({});let k;function O(L){let F;g=y=!1,typeof L=="function"?(L(a.state.value[r]),F={type:Cr$1.patchFunction,storeId:r,events:w}):(Md$1(a.state.value[r],L),F={type:Cr$1.patchObject,payload:L,storeId:r,events:w});const U=k=Symbol();Ao$1().then(()=>{k===U&&(g=!0)}),y=!0,Li$1(_,F,a.state.value[r])}const R=c?function(){const{state:L}=s,F=L?L():{};this.$patch(U=>{Kn$1(U,F)})}:dE$1;function M(){u.stop(),_=[],E=[],a._s.delete(r)}const N=(L,F="")=>{if(gh in L)return L[Du$1]=F,L;const U=function(){ga$1(a);const J=Array.from(arguments),z=[],ie=[];function ce(V){z.push(V)}function Y(V){ie.push(V)}Li$1(E,{args:J,name:U[Du$1],store:P,after:ce,onError:Y});let B;try{B=L.apply(this&&this.$id===r?this:P,J)}catch(V){throw Li$1(ie,V),V}return B instanceof Promise?B.then(V=>(Li$1(z,V),V)).catch(V=>(Li$1(ie,V),Promise.reject(V))):(Li$1(z,B),B)};return U[gh]=!0,U[Du$1]=F,U},D={_p:a,$id:r,$onAction:hh.bind(null,E),$patch:O,$reset:R,$subscribe(L,F={}){const U=hh(_,L,F.detached,()=>J()),J=u.run(()=>Oe(()=>a.state.value[r],z=>{(F.flush==="sync"?y:g)&&L({storeId:r,type:Cr$1.direct,events:w},z)},Kn$1({},m,F)));return U},$dispose:M},P=De(D);a._s.set(r,P);const I=(a._a&&a._a.runWithContext||tx$1)(()=>a._e.run(()=>(u=wa$1()).run(()=>o({action:N}))));for(const L in I){const F=I[L];if(Ce(F)&&!vh$2(F)||Cn$1(F))c||(T&&rx$2(F)&&(Ce(F)?F.value=T[L]:Md$1(F,T[L])),a.state.value[r][L]=F);else if(typeof F=="function"){const U=N(F,L);I[L]=U,d.actions[L]=F}}return Kn$1(P,I),Kn$1(Le(P),I),Object.defineProperty(P,"$state",{get:()=>a.state.value[r],set:L=>{O(F=>{Kn$1(F,L)})}}),a._p.forEach(L=>{Kn$1(P,u.run(()=>L({store:P,app:a._a,pinia:a,options:d})))}),T&&c&&s.hydrate&&s.hydrate(P.$state,T),g=!0,y=!0,P}function ox$1(r,o,s){let a,l;const c=typeof o=="function";a=r,l=c?s:o;function u(d,m){const g=Uf$1();return d=d||(g?Co$1(tE$1,null):null),d&&ga$1(d),d=Ds$1,d._s.has(a)||(c?$d$1(a,o,l,d):yh(a,l,d)),d._s.get(a)}return u.$id=a,u}/*! - * shared v9.14.0 - * (c) 2024 kazuya kawaguchi - * Released under the MIT License. - */const Er$1=typeof window<"u",$r$1=(r,o=!1)=>o?Symbol.for(r):Symbol(r),sx$1=(r,o,s)=>ax$1({l:r,k:o,s}),ax$1=r=>JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Wt$1=r=>typeof r=="number"&&isFinite(r),lx$1=r=>pE$1(r)==="[object Date]",Ro$1=r=>pE$1(r)==="[object RegExp]",ru$1=r=>Ue(r)&&Object.keys(r).length===0,on$1=Object.assign;let bh;const Xr$1=()=>bh||(bh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Eh$1(r){return r.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const cx$1=Object.prototype.hasOwnProperty;function bc$1(r,o){return cx$1.call(r,o)}const bt$1=Array.isArray,pt=r=>typeof r=="function",ve=r=>typeof r=="string",Qe=r=>typeof r=="boolean",lt$2=r=>r!==null&&typeof r=="object",ux$1=r=>lt$2(r)&&pt(r.then)&&pt(r.catch),fE$1=Object.prototype.toString,pE$1=r=>fE$1.call(r),Ue=r=>{if(!lt$2(r))return!1;const o=Object.getPrototypeOf(r);return o===null||o.constructor===Object},dx$1=r=>r==null?"":bt$1(r)||Ue(r)&&r.toString===fE$1?JSON.stringify(r,null,2):String(r);function fx$1(r,o=""){return r.reduce((s,a,l)=>l===0?s+a:s+o+a,"")}function ou$1(r){let o=r;return()=>++o}function Gt$2(r,o){typeof console<"u"&&(console.warn("[intlify] "+r),o&&console.warn(o.stack))}const ml$1=r=>!lt$2(r)||bt$1(r);function $l$1(r,o){if(ml$1(r)||ml$1(o))throw new Error("Invalid value");const s=[{src:r,des:o}];for(;s.length;){const{src:a,des:l}=s.pop();Object.keys(a).forEach(c=>{ml$1(a[c])||ml$1(l[c])?l[c]=a[c]:s.push({src:a[c],des:l[c]})})}}/*! - * message-compiler v9.14.0 - * (c) 2024 kazuya kawaguchi - * Released under the MIT License. - */function mx$1(r,o,s){return{line:r,column:o,offset:s}}function Ec$1(r,o,s){return{start:r,end:o}}const hx$1=/\{([0-9a-zA-Z]+)\}/g;function hE$1(r,...o){return o.length===1&&gx$1(o[0])&&(o=o[0]),(!o||!o.hasOwnProperty)&&(o={}),r.replace(hx$1,(s,a)=>o.hasOwnProperty(a)?o[a]:"")}const gE$2=Object.assign,Nh$1=r=>typeof r=="string",gx$1=r=>r!==null&&typeof r=="object";function vE$1(r,o=""){return r.reduce((s,a,l)=>l===0?s+a:s+o+a,"")}const iu$1={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},vx$1={[iu$1.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function yx$1(r,o,...s){const a=hE$1(vx$1[r],...s||[]),l={message:String(a),code:r};return o&&(l.location=o),l}const Me$1={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},bx$1={[Me$1.EXPECTED_TOKEN]:"Expected token: '{0}'",[Me$1.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[Me$1.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[Me$1.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[Me$1.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[Me$1.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[Me$1.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[Me$1.EMPTY_PLACEHOLDER]:"Empty placeholder",[Me$1.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[Me$1.INVALID_LINKED_FORMAT]:"Invalid linked format",[Me$1.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[Me$1.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[Me$1.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[Me$1.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[Me$1.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[Me$1.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function ys$1(r,o,s={}){const{domain:a,messages:l,args:c}=s,u=hE$1((l||bx$1)[r]||"",...c||[]),d=new SyntaxError(String(u));return d.code=r,o&&(d.location=o),d.domain=a,d}function Ex$1(r){throw r}const Fr$1=" ",Nx$1="\r",vn$1=` -`,Sx$1="\u2028",Tx$1="\u2029";function xx$1(r){const o=r;let s=0,a=1,l=1,c=0;const u=L=>o[L]===Nx$1&&o[L+1]===vn$1,d=L=>o[L]===vn$1,m=L=>o[L]===Tx$1,g=L=>o[L]===Sx$1,y=L=>u(L)||d(L)||m(L)||g(L),_=()=>s,E=()=>a,w=()=>l,T=()=>c,k=L=>u(L)||m(L)||g(L)?vn$1:o[L],O=()=>k(s),R=()=>k(s+c);function M(){return c=0,y(s)&&(a++,l=0),u(s)&&s++,s++,l++,o[s]}function N(){return u(s+c)&&c++,c++,o[s+c]}function D(){s=0,a=1,l=1,c=0}function P(L=0){c=L}function I(){const L=s+c;for(;L!==s;)M();c=0}return{index:_,line:E,column:w,peekOffset:T,charAt:k,currentChar:O,currentPeek:R,next:M,peek:N,reset:D,resetPeek:P,skipToPeek:I}}const uo$1=void 0,Sh$1="'",Ix$1="tokenizer";function Cx$1(r,o={}){const s=o.location!==!1,a=xx$1(r),l=()=>a.index(),c=()=>mx$1(a.line(),a.column(),a.index()),u=c(),d=l(),m={currentType:14,offset:d,startLoc:u,endLoc:u,lastType:14,lastOffset:d,lastStartLoc:u,lastEndLoc:u,braceNest:0,inLinked:!1,text:""},g=()=>m,{onError:y}=o;function _(dee,fee,Oee,...xee){const kee=g();if(fee.column+=Oee,fee.offset+=Oee,y){const Dte=s?Ec$1(kee.startLoc,fee):null,Ite=ys$1(dee,Dte,{domain:Ix$1,args:xee});y(Ite)}}function E(dee,fee,Oee){dee.endLoc=c(),dee.currentType=fee;const xee={type:fee};return s&&(xee.loc=Ec$1(dee.startLoc,dee.endLoc)),Oee!=null&&(xee.value=Oee),xee}const w=dee=>E(dee,14);function T(dee,fee){return dee.currentChar()===fee?(dee.next(),fee):(_(Me$1.EXPECTED_TOKEN,c(),0,fee),"")}function k(dee){let fee="";for(;dee.currentPeek()===Fr$1||dee.currentPeek()===vn$1;)fee+=dee.currentPeek(),dee.peek();return fee}function O(dee){const fee=k(dee);return dee.skipToPeek(),fee}function R(dee){if(dee===uo$1)return!1;const fee=dee.charCodeAt(0);return fee>=97&&fee<=122||fee>=65&&fee<=90||fee===95}function M(dee){if(dee===uo$1)return!1;const fee=dee.charCodeAt(0);return fee>=48&&fee<=57}function N(dee,fee){const{currentType:Oee}=fee;if(Oee!==2)return!1;k(dee);const xee=R(dee.currentPeek());return dee.resetPeek(),xee}function D(dee,fee){const{currentType:Oee}=fee;if(Oee!==2)return!1;k(dee);const xee=dee.currentPeek()==="-"?dee.peek():dee.currentPeek(),kee=M(xee);return dee.resetPeek(),kee}function P(dee,fee){const{currentType:Oee}=fee;if(Oee!==2)return!1;k(dee);const xee=dee.currentPeek()===Sh$1;return dee.resetPeek(),xee}function I(dee,fee){const{currentType:Oee}=fee;if(Oee!==8)return!1;k(dee);const xee=dee.currentPeek()===".";return dee.resetPeek(),xee}function L(dee,fee){const{currentType:Oee}=fee;if(Oee!==9)return!1;k(dee);const xee=R(dee.currentPeek());return dee.resetPeek(),xee}function F(dee,fee){const{currentType:Oee}=fee;if(!(Oee===8||Oee===12))return!1;k(dee);const xee=dee.currentPeek()===":";return dee.resetPeek(),xee}function U(dee,fee){const{currentType:Oee}=fee;if(Oee!==10)return!1;const xee=()=>{const Dte=dee.currentPeek();return Dte==="{"?R(dee.peek()):Dte==="@"||Dte==="%"||Dte==="|"||Dte===":"||Dte==="."||Dte===Fr$1||!Dte?!1:Dte===vn$1?(dee.peek(),xee()):ie(dee,!1)},kee=xee();return dee.resetPeek(),kee}function J(dee){k(dee);const fee=dee.currentPeek()==="|";return dee.resetPeek(),fee}function z(dee){const fee=k(dee),Oee=dee.currentPeek()==="%"&&dee.peek()==="{";return dee.resetPeek(),{isModulo:Oee,hasSpace:fee.length>0}}function ie(dee,fee=!0){const Oee=(kee=!1,Dte="",Ite=!1)=>{const Lte=dee.currentPeek();return Lte==="{"?Dte==="%"?!1:kee:Lte==="@"||!Lte?Dte==="%"?!0:kee:Lte==="%"?(dee.peek(),Oee(kee,"%",!0)):Lte==="|"?Dte==="%"||Ite?!0:!(Dte===Fr$1||Dte===vn$1):Lte===Fr$1?(dee.peek(),Oee(!0,Fr$1,Ite)):Lte===vn$1?(dee.peek(),Oee(!0,vn$1,Ite)):!0},xee=Oee();return fee&&dee.resetPeek(),xee}function ce(dee,fee){const Oee=dee.currentChar();return Oee===uo$1?uo$1:fee(Oee)?(dee.next(),Oee):null}function Y(dee){const fee=dee.charCodeAt(0);return fee>=97&&fee<=122||fee>=65&&fee<=90||fee>=48&&fee<=57||fee===95||fee===36}function B(dee){return ce(dee,Y)}function V(dee){const fee=dee.charCodeAt(0);return fee>=97&&fee<=122||fee>=65&&fee<=90||fee>=48&&fee<=57||fee===95||fee===36||fee===45}function Ge(dee){return ce(dee,V)}function St(dee){const fee=dee.charCodeAt(0);return fee>=48&&fee<=57}function Dee(dee){return ce(dee,St)}function pee(dee){const fee=dee.charCodeAt(0);return fee>=48&&fee<=57||fee>=65&&fee<=70||fee>=97&&fee<=102}function jr(dee){return ce(dee,pee)}function Tee(dee){let fee="",Oee="";for(;fee=Dee(dee);)Oee+=fee;return Oee}function et(dee){O(dee);const fee=dee.currentChar();return fee!=="%"&&_(Me$1.EXPECTED_TOKEN,c(),0,fee),dee.next(),"%"}function ft(dee){let fee="";for(;;){const Oee=dee.currentChar();if(Oee==="{"||Oee==="}"||Oee==="@"||Oee==="|"||!Oee)break;if(Oee==="%")if(ie(dee))fee+=Oee,dee.next();else break;else if(Oee===Fr$1||Oee===vn$1)if(ie(dee))fee+=Oee,dee.next();else{if(J(dee))break;fee+=Oee,dee.next()}else fee+=Oee,dee.next()}return fee}function yee(dee){O(dee);let fee="",Oee="";for(;fee=Ge(dee);)Oee+=fee;return dee.currentChar()===uo$1&&_(Me$1.UNTERMINATED_CLOSING_BRACE,c(),0),Oee}function ete(dee){O(dee);let fee="";return dee.currentChar()==="-"?(dee.next(),fee+=`-${Tee(dee)}`):fee+=Tee(dee),dee.currentChar()===uo$1&&_(Me$1.UNTERMINATED_CLOSING_BRACE,c(),0),fee}function xte(dee){return dee!==Sh$1&&dee!==vn$1}function Ote(dee){O(dee),T(dee,"'");let fee="",Oee="";for(;fee=ce(dee,xte);)fee==="\\"?Oee+=nee(dee):Oee+=fee;const xee=dee.currentChar();return xee===vn$1||xee===uo$1?(_(Me$1.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,c(),0),xee===vn$1&&(dee.next(),T(dee,"'")),Oee):(T(dee,"'"),Oee)}function nee(dee){const fee=dee.currentChar();switch(fee){case"\\":case"'":return dee.next(),`\\${fee}`;case"u":return Wee(dee,fee,4);case"U":return Wee(dee,fee,6);default:return _(Me$1.UNKNOWN_ESCAPE_SEQUENCE,c(),0,fee),""}}function Wee(dee,fee,Oee){T(dee,fee);let xee="";for(let kee=0;kee{const xee=dee.currentChar();return xee==="{"||xee==="%"||xee==="@"||xee==="|"||xee==="("||xee===")"||!xee||xee===Fr$1?Oee:(Oee+=xee,dee.next(),fee(Oee))};return fee("")}function Lee(dee){O(dee);const fee=T(dee,"|");return O(dee),fee}function $te(dee,fee){let Oee=null;switch(dee.currentChar()){case"{":return fee.braceNest>=1&&_(Me$1.NOT_ALLOW_NEST_PLACEHOLDER,c(),0),dee.next(),Oee=E(fee,2,"{"),O(dee),fee.braceNest++,Oee;case"}":return fee.braceNest>0&&fee.currentType===2&&_(Me$1.EMPTY_PLACEHOLDER,c(),0),dee.next(),Oee=E(fee,3,"}"),fee.braceNest--,fee.braceNest>0&&O(dee),fee.inLinked&&fee.braceNest===0&&(fee.inLinked=!1),Oee;case"@":return fee.braceNest>0&&_(Me$1.UNTERMINATED_CLOSING_BRACE,c(),0),Oee=Kee(dee,fee)||w(fee),fee.braceNest=0,Oee;default:{let xee=!0,kee=!0,Dte=!0;if(J(dee))return fee.braceNest>0&&_(Me$1.UNTERMINATED_CLOSING_BRACE,c(),0),Oee=E(fee,1,Lee(dee)),fee.braceNest=0,fee.inLinked=!1,Oee;if(fee.braceNest>0&&(fee.currentType===5||fee.currentType===6||fee.currentType===7))return _(Me$1.UNTERMINATED_CLOSING_BRACE,c(),0),fee.braceNest=0,Iee(dee,fee);if(xee=N(dee,fee))return Oee=E(fee,5,yee(dee)),O(dee),Oee;if(kee=D(dee,fee))return Oee=E(fee,6,ete(dee)),O(dee),Oee;if(Dte=P(dee,fee))return Oee=E(fee,7,Ote(dee)),O(dee),Oee;if(!xee&&!kee&&!Dte)return Oee=E(fee,13,Nte(dee)),_(Me$1.INVALID_TOKEN_IN_PLACEHOLDER,c(),0,Oee.value),O(dee),Oee;break}}return Oee}function Kee(dee,fee){const{currentType:Oee}=fee;let xee=null;const kee=dee.currentChar();switch((Oee===8||Oee===9||Oee===12||Oee===10)&&(kee===vn$1||kee===Fr$1)&&_(Me$1.INVALID_LINKED_FORMAT,c(),0),kee){case"@":return dee.next(),xee=E(fee,8,"@"),fee.inLinked=!0,xee;case".":return O(dee),dee.next(),E(fee,9,".");case":":return O(dee),dee.next(),E(fee,10,":");default:return J(dee)?(xee=E(fee,1,Lee(dee)),fee.braceNest=0,fee.inLinked=!1,xee):I(dee,fee)||F(dee,fee)?(O(dee),Kee(dee,fee)):L(dee,fee)?(O(dee),E(fee,12,_ee(dee))):U(dee,fee)?(O(dee),kee==="{"?$te(dee,fee)||xee:E(fee,11,st(dee))):(Oee===8&&_(Me$1.INVALID_LINKED_FORMAT,c(),0),fee.braceNest=0,fee.inLinked=!1,Iee(dee,fee))}}function Iee(dee,fee){let Oee={type:14};if(fee.braceNest>0)return $te(dee,fee)||w(fee);if(fee.inLinked)return Kee(dee,fee)||w(fee);switch(dee.currentChar()){case"{":return $te(dee,fee)||w(fee);case"}":return _(Me$1.UNBALANCED_CLOSING_BRACE,c(),0),dee.next(),E(fee,3,"}");case"@":return Kee(dee,fee)||w(fee);default:{if(J(dee))return Oee=E(fee,1,Lee(dee)),fee.braceNest=0,fee.inLinked=!1,Oee;const{isModulo:xee,hasSpace:kee}=z(dee);if(xee)return kee?E(fee,0,ft(dee)):E(fee,4,et(dee));if(ie(dee))return E(fee,0,ft(dee));break}}return Oee}function Rte(){const{currentType:dee,offset:fee,startLoc:Oee,endLoc:xee}=m;return m.lastType=dee,m.lastOffset=fee,m.lastStartLoc=Oee,m.lastEndLoc=xee,m.offset=l(),m.startLoc=c(),a.currentChar()===uo$1?E(m,14):Iee(a,m)}return{nextToken:Rte,currentOffset:l,currentPosition:c,context:g}}const Vx$1="parser",Dx$1=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Ax$1(r,o,s){switch(r){case"\\\\":return"\\";case"\\'":return"'";default:{const a=parseInt(o||s,16);return a<=55295||a>=57344?String.fromCodePoint(a):"�"}}}function Lx$1(r={}){const o=r.location!==!1,{onError:s,onWarn:a}=r;function l(N,D,P,I,...L){const F=N.currentPosition();if(F.offset+=I,F.column+=I,s){const U=o?Ec$1(P,F):null,J=ys$1(D,U,{domain:Vx$1,args:L});s(J)}}function c(N,D,P,I,...L){const F=N.currentPosition();if(F.offset+=I,F.column+=I,a){const U=o?Ec$1(P,F):null;a(yx$1(D,U,L))}}function u(N,D,P){const I={type:N};return o&&(I.start=D,I.end=D,I.loc={start:P,end:P}),I}function d(N,D,P,I){o&&(N.end=D,N.loc&&(N.loc.end=P))}function m(N,D){const P=N.context(),I=u(3,P.offset,P.startLoc);return I.value=D,d(I,N.currentOffset(),N.currentPosition()),I}function g(N,D){const P=N.context(),{lastOffset:I,lastStartLoc:L}=P,F=u(5,I,L);return F.index=parseInt(D,10),N.nextToken(),d(F,N.currentOffset(),N.currentPosition()),F}function y(N,D,P){const I=N.context(),{lastOffset:L,lastStartLoc:F}=I,U=u(4,L,F);return U.key=D,P===!0&&(U.modulo=!0),N.nextToken(),d(U,N.currentOffset(),N.currentPosition()),U}function _(N,D){const P=N.context(),{lastOffset:I,lastStartLoc:L}=P,F=u(9,I,L);return F.value=D.replace(Dx$1,Ax$1),N.nextToken(),d(F,N.currentOffset(),N.currentPosition()),F}function E(N){const D=N.nextToken(),P=N.context(),{lastOffset:I,lastStartLoc:L}=P,F=u(8,I,L);return D.type!==12?(l(N,Me$1.UNEXPECTED_EMPTY_LINKED_MODIFIER,P.lastStartLoc,0),F.value="",d(F,I,L),{nextConsumeToken:D,node:F}):(D.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,P.lastStartLoc,0,or$2(D)),F.value=D.value||"",d(F,N.currentOffset(),N.currentPosition()),{node:F})}function w(N,D){const P=N.context(),I=u(7,P.offset,P.startLoc);return I.value=D,d(I,N.currentOffset(),N.currentPosition()),I}function T(N){const D=N.context(),P=u(6,D.offset,D.startLoc);let I=N.nextToken();if(I.type===9){const L=E(N);P.modifier=L.node,I=L.nextConsumeToken||N.nextToken()}switch(I.type!==10&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(I)),I=N.nextToken(),I.type===2&&(I=N.nextToken()),I.type){case 11:I.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(I)),P.key=w(N,I.value||"");break;case 5:I.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(I)),P.key=y(N,I.value||"");break;case 6:I.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(I)),P.key=g(N,I.value||"");break;case 7:I.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(I)),P.key=_(N,I.value||"");break;default:{l(N,Me$1.UNEXPECTED_EMPTY_LINKED_KEY,D.lastStartLoc,0);const L=N.context(),F=u(7,L.offset,L.startLoc);return F.value="",d(F,L.offset,L.startLoc),P.key=F,d(P,L.offset,L.startLoc),{nextConsumeToken:I,node:P}}}return d(P,N.currentOffset(),N.currentPosition()),{node:P}}function k(N){const D=N.context(),P=D.currentType===1?N.currentOffset():D.offset,I=D.currentType===1?D.endLoc:D.startLoc,L=u(2,P,I);L.items=[];let F=null,U=null;do{const ie=F||N.nextToken();switch(F=null,ie.type){case 0:ie.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(ie)),L.items.push(m(N,ie.value||""));break;case 6:ie.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(ie)),L.items.push(g(N,ie.value||""));break;case 4:U=!0;break;case 5:ie.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(ie)),L.items.push(y(N,ie.value||"",!!U)),U&&(c(N,iu$1.USE_MODULO_SYNTAX,D.lastStartLoc,0,or$2(ie)),U=null);break;case 7:ie.value==null&&l(N,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,D.lastStartLoc,0,or$2(ie)),L.items.push(_(N,ie.value||""));break;case 8:{const ce=T(N);L.items.push(ce.node),F=ce.nextConsumeToken||null;break}}}while(D.currentType!==14&&D.currentType!==1);const J=D.currentType===1?D.lastOffset:N.currentOffset(),z=D.currentType===1?D.lastEndLoc:N.currentPosition();return d(L,J,z),L}function O(N,D,P,I){const L=N.context();let F=I.items.length===0;const U=u(1,D,P);U.cases=[],U.cases.push(I);do{const J=k(N);F||(F=J.items.length===0),U.cases.push(J)}while(L.currentType!==14);return F&&l(N,Me$1.MUST_HAVE_MESSAGES_IN_PLURAL,P,0),d(U,N.currentOffset(),N.currentPosition()),U}function R(N){const D=N.context(),{offset:P,startLoc:I}=D,L=k(N);return D.currentType===14?L:O(N,P,I,L)}function M(N){const D=Cx$1(N,gE$2({},r)),P=D.context(),I=u(0,P.offset,P.startLoc);return o&&I.loc&&(I.loc.source=N),I.body=R(D),r.onCacheKey&&(I.cacheKey=r.onCacheKey(N)),P.currentType!==14&&l(D,Me$1.UNEXPECTED_LEXICAL_ANALYSIS,P.lastStartLoc,0,N[P.offset]||""),d(I,D.currentOffset(),D.currentPosition()),I}return{parse:M}}function or$2(r){if(r.type===14)return"EOF";const o=(r.value||"").replace(/\r?\n/gu,"\\n");return o.length>10?o.slice(0,9)+"…":o}function Px$1(r,o={}){const s={ast:r,helpers:new Set};return{context:()=>s,helper:a=>(s.helpers.add(a),a)}}function Th$1(r,o){for(let s=0;sxh(s)),r}function xh(r){if(r.items.length===1){const o=r.items[0];(o.type===3||o.type===9)&&(r.static=o.value,delete o.value)}else{const o=[];for(let s=0;sd;function g(T,k){d.code+=T}function y(T,k=!0){const O=k?l:"";g(c?O+" ".repeat(T):O)}function _(T=!0){const k=++d.indentLevel;T&&y(k)}function E(T=!0){const k=--d.indentLevel;T&&y(k)}function w(){y(d.indentLevel)}return{context:m,push:g,indent:_,deindent:E,newline:w,helper:T=>`_${T}`,needIndent:()=>d.needIndent}}function Ux$1(r,o){const{helper:s}=r;r.push(`${s("linked")}(`),ss$1(r,o.key),o.modifier?(r.push(", "),ss$1(r,o.modifier),r.push(", _type")):r.push(", undefined, _type"),r.push(")")}function jx$1(r,o){const{helper:s,needIndent:a}=r;r.push(`${s("normalize")}([`),r.indent(a());const l=o.items.length;for(let c=0;c1){r.push(`${s("plural")}([`),r.indent(a());const l=o.cases.length;for(let c=0;c{const s=Nh$1(o.mode)?o.mode:"normal",a=Nh$1(o.filename)?o.filename:"message.intl",l=!!o.sourceMap,c=o.breakLineCode!=null?o.breakLineCode:s==="arrow"?";":` -`,u=o.needIndent?o.needIndent:s!=="arrow",d=r.helpers||[],m=Fx$1(r,{mode:s,filename:a,sourceMap:l,breakLineCode:c,needIndent:u});m.push(s==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),m.indent(u),d.length>0&&(m.push(`const { ${vE$1(d.map(_=>`${_}: _${_}`),", ")} } = ctx`),m.newline()),m.push("return "),ss$1(m,r),m.deindent(u),m.push("}"),delete r.helpers;const{code:g,map:y}=m.context();return{ast:r,code:g,map:y?y.toJSON():void 0}};function Gx$1(r,o={}){const s=gE$2({},o),a=!!s.jit,l=!!s.minify,c=s.optimize==null?!0:s.optimize,u=Lx$1(s).parse(r);return a?(c&&Mx$1(u),l&&ki$1(u),{ast:u,code:""}):(Rx$1(u,s),Wx$1(u,s))}/*! - * core-base v9.14.0 - * (c) 2024 kazuya kawaguchi - * Released under the MIT License. - */function Kx$1(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Xr$1().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Xr$1().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Xr$1().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}const Fo$1=[];Fo$1[0]={w:[0],i:[3,0],"[":[4],o:[7]};Fo$1[1]={w:[1],".":[2],"[":[4],o:[7]};Fo$1[2]={w:[2],i:[3,0],0:[3,0]};Fo$1[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Fo$1[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Fo$1[5]={"'":[4,0],o:8,l:[5,0]};Fo$1[6]={'"':[4,0],o:8,l:[6,0]};const Yx$1=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Xx$1(r){return Yx$1.test(r)}function zx$1(r){const o=r.charCodeAt(0),s=r.charCodeAt(r.length-1);return o===s&&(o===34||o===39)?r.slice(1,-1):r}function Jx$1(r){if(r==null)return"o";switch(r.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return r;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Qx$1(r){const o=r.trim();return r.charAt(0)==="0"&&isNaN(parseInt(r))?!1:Xx$1(o)?zx$1(o):"*"+o}function qx$1(r){const o=[];let s=-1,a=0,l=0,c,u,d,m,g,y,_;const E=[];E[0]=()=>{u===void 0?u=d:u+=d},E[1]=()=>{u!==void 0&&(o.push(u),u=void 0)},E[2]=()=>{E[0](),l++},E[3]=()=>{if(l>0)l--,a=4,E[0]();else{if(l=0,u===void 0||(u=Qx$1(u),u===!1))return!1;E[1]()}};function w(){const T=r[s+1];if(a===5&&T==="'"||a===6&&T==='"')return s++,d="\\"+T,E[0](),!0}for(;a!==null;)if(s++,c=r[s],!(c==="\\"&&w())){if(m=Jx$1(c),_=Fo$1[a],g=_[m]||_.l||8,g===8||(a=g[0],g[1]!==void 0&&(y=E[g[1]],y&&(d=c,y()===!1))))return;if(a===7)return o}}const wh$1=new Map;function Zx$1(r,o){return lt$2(r)?r[o]:null}function ew$1(r,o){if(!lt$2(r))return null;let s=wh$1.get(o);if(s||(s=qx$1(o),s&&wh$1.set(o,s)),!s)return null;const a=s.length;let l=r,c=0;for(;cr,nw$1=r=>"",rw$1="text",ow$1=r=>r.length===0?"":fx$1(r),iw$1=dx$1;function Ih$1(r,o){return r=Math.abs(r),o===2?r?r>1?1:0:1:r?Math.min(r,2):0}function sw$1(r){const o=Wt$1(r.pluralIndex)?r.pluralIndex:-1;return r.named&&(Wt$1(r.named.count)||Wt$1(r.named.n))?Wt$1(r.named.count)?r.named.count:Wt$1(r.named.n)?r.named.n:o:o}function aw$1(r,o){o.count||(o.count=r),o.n||(o.n=r)}function lw$1(r={}){const o=r.locale,s=sw$1(r),a=lt$2(r.pluralRules)&&ve(o)&&pt(r.pluralRules[o])?r.pluralRules[o]:Ih$1,l=lt$2(r.pluralRules)&&ve(o)&&pt(r.pluralRules[o])?Ih$1:void 0,c=O=>O[a(s,O.length,l)],u=r.list||[],d=O=>u[O],m=r.named||{};Wt$1(r.pluralIndex)&&aw$1(s,m);const g=O=>m[O];function y(O){return(pt(r.messages)?r.messages(O):lt$2(r.messages)?r.messages[O]:!1)||(r.parent?r.parent.message(O):nw$1)}const _=O=>r.modifiers?r.modifiers[O]:tw$1,E=Ue(r.processor)&&pt(r.processor.normalize)?r.processor.normalize:ow$1,w=Ue(r.processor)&&pt(r.processor.interpolate)?r.processor.interpolate:iw$1,T=Ue(r.processor)&&ve(r.processor.type)?r.processor.type:rw$1,k={list:d,named:g,plural:c,linked:(O,...R)=>{const[M,N]=R;let D="text",P="";R.length===1?lt$2(M)?(P=M.modifier||P,D=M.type||D):ve(M)&&(P=M||P):R.length===2&&(ve(M)&&(P=M||P),ve(N)&&(D=N||D));const I=y(O)(k),L=D==="vnode"&&bt$1(I)&&P?I[0]:I;return P?_(P)(L,D):L},message:y,type:T,interpolate:w,normalize:E,values:on$1({},u,m)};return k}let va$1=null;function cw$1(r){va$1=r}function uw$1(r,o,s){va$1&&va$1.emit("i18n:init",{timestamp:Date.now(),i18n:r,version:o,meta:s})}const dw$1=fw$1("function:translate");function fw$1(r){return o=>va$1&&va$1.emit(r,o)}const yE$1=iu$1.__EXTEND_POINT__,Go=ou$1(yE$1),yn$1={NOT_FOUND_KEY:yE$1,FALLBACK_TO_TRANSLATE:Go(),CANNOT_FORMAT_NUMBER:Go(),FALLBACK_TO_NUMBER_FORMAT:Go(),CANNOT_FORMAT_DATE:Go(),FALLBACK_TO_DATE_FORMAT:Go(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:Go(),__EXTEND_POINT__:Go()},bE$1=Me$1.__EXTEND_POINT__,Ko$1=ou$1(bE$1),Jt$1={INVALID_ARGUMENT:bE$1,INVALID_DATE_ARGUMENT:Ko$1(),INVALID_ISO_DATE_ARGUMENT:Ko$1(),NOT_SUPPORT_NON_STRING_MESSAGE:Ko$1(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:Ko$1(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:Ko$1(),NOT_SUPPORT_LOCALE_TYPE:Ko$1(),__EXTEND_POINT__:Ko$1()};function wr$2(r){return ys$1(r,null,void 0)}function Pp$1(r,o){return o.locale!=null?Ch$1(o.locale):Ch$1(r.locale)}let Au$1;function Ch$1(r){if(ve(r))return r;if(pt(r)){if(r.resolvedOnce&&Au$1!=null)return Au$1;if(r.constructor.name==="Function"){const o=r();if(ux$1(o))throw wr$2(Jt$1.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Au$1=o}else throw wr$2(Jt$1.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw wr$2(Jt$1.NOT_SUPPORT_LOCALE_TYPE)}function hw$1(r,o,s){return[...new Set([s,...bt$1(o)?o:lt$2(o)?Object.keys(o):ve(o)?[o]:[s]])]}function EE$1(r,o,s){const a=ve(s)?s:as$1,l=r;l.__localeChainCache||(l.__localeChainCache=new Map);let c=l.__localeChainCache.get(a);if(!c){c=[];let u=[s];for(;bt$1(u);)u=Vh$1(c,u,o);const d=bt$1(o)||!Ue(o)?o:o.default?o.default:null;u=ve(d)?[d]:d,bt$1(u)&&Vh$1(c,u,!1),l.__localeChainCache.set(a,c)}return c}function Vh$1(r,o,s){let a=!0;for(let l=0;l`${r.charAt(0).toLocaleUpperCase()}${r.substr(1)}`;function bw$1(){return{upper:(r,o)=>o==="text"&&ve(r)?r.toUpperCase():o==="vnode"&<$2(r)&&"__v_isVNode"in r?r.children.toUpperCase():r,lower:(r,o)=>o==="text"&&ve(r)?r.toLowerCase():o==="vnode"&<$2(r)&&"__v_isVNode"in r?r.children.toLowerCase():r,capitalize:(r,o)=>o==="text"&&ve(r)?Dh$1(r):o==="vnode"&<$2(r)&&"__v_isVNode"in r?Dh$1(r.children):r}}let _E$1;function Ah$1(r){_E$1=r}let OE$1;function Ew$1(r){OE$1=r}let NE$1;function _w$1(r){NE$1=r}let TE$1=null;const Lh$1=r=>{TE$1=r},Sw$1=()=>TE$1;let Ph$1=0;function Tw$1(r={}){const o=pt(r.onWarn)?r.onWarn:Gt$2,s=ve(r.version)?r.version:yw$1,a=ve(r.locale)||pt(r.locale)?r.locale:as$1,l=pt(a)?as$1:a,c=bt$1(r.fallbackLocale)||Ue(r.fallbackLocale)||ve(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:l,u=Ue(r.messages)?r.messages:{[l]:{}},d=Ue(r.datetimeFormats)?r.datetimeFormats:{[l]:{}},m=Ue(r.numberFormats)?r.numberFormats:{[l]:{}},g=on$1({},r.modifiers||{},bw$1()),y=r.pluralRules||{},_=pt(r.missing)?r.missing:null,E=Qe(r.missingWarn)||Ro$1(r.missingWarn)?r.missingWarn:!0,w=Qe(r.fallbackWarn)||Ro$1(r.fallbackWarn)?r.fallbackWarn:!0,T=!!r.fallbackFormat,k=!!r.unresolving,O=pt(r.postTranslation)?r.postTranslation:null,R=Ue(r.processor)?r.processor:null,M=Qe(r.warnHtmlMessage)?r.warnHtmlMessage:!0,N=!!r.escapeParameter,D=pt(r.messageCompiler)?r.messageCompiler:_E$1,P=pt(r.messageResolver)?r.messageResolver:OE$1||Zx$1,I=pt(r.localeFallbacker)?r.localeFallbacker:NE$1||hw$1,L=lt$2(r.fallbackContext)?r.fallbackContext:void 0,F=r,U=lt$2(F.__datetimeFormatters)?F.__datetimeFormatters:new Map,J=lt$2(F.__numberFormatters)?F.__numberFormatters:new Map,z=lt$2(F.__meta)?F.__meta:{};Ph$1++;const ie={version:s,cid:Ph$1,locale:a,fallbackLocale:c,messages:u,modifiers:g,pluralRules:y,missing:_,missingWarn:E,fallbackWarn:w,fallbackFormat:T,unresolving:k,postTranslation:O,processor:R,warnHtmlMessage:M,escapeParameter:N,messageCompiler:D,messageResolver:P,localeFallbacker:I,fallbackContext:L,onWarn:o,__meta:z};return ie.datetimeFormats=d,ie.numberFormats=m,ie.__datetimeFormatters=U,ie.__numberFormatters=J,__INTLIFY_PROD_DEVTOOLS__&&uw$1(ie,s,z),ie}function Rp$1(r,o,s,a,l){const{missing:c,onWarn:u}=r;if(c!==null){const d=c(r,s,o,l);return ve(d)?d:o}else return o}function Ns$1(r,o,s){const a=r;a.__localeChainCache=new Map,r.localeFallbacker(r,s,o)}function wE$1(r,o){return r===o?!1:r.split("-")[0]===o.split("-")[0]}function xw$1(r,o){const s=o.indexOf(r);if(s===-1)return!1;for(let a=s+1;aww$1(o,r)}function ww$1(r,o){const s=o.b||o.body;if((s.t||s.type)===1){const a=s,l=a.c||a.cases;return r.plural(l.reduce((c,u)=>[...c,Rh$1(r,u)],[]))}else return Rh$1(r,s)}function Rh$1(r,o){const s=o.s||o.static;if(s)return r.type==="text"?s:r.normalize([s]);{const a=(o.i||o.items).reduce((l,c)=>[...l,kd$1(r,c)],[]);return r.normalize(a)}}function kd$1(r,o){const s=o.t||o.type;switch(s){case 3:{const a=o;return a.v||a.value}case 9:{const a=o;return a.v||a.value}case 4:{const a=o;return r.interpolate(r.named(a.k||a.key))}case 5:{const a=o;return r.interpolate(r.list(a.i!=null?a.i:a.index))}case 6:{const a=o,l=a.m||a.modifier;return r.linked(kd$1(r,a.k||a.key),l?kd$1(r,l):void 0,r.type)}case 7:{const a=o;return a.v||a.value}case 8:{const a=o;return a.v||a.value}default:throw new Error(`unhandled node type on format message part: ${s}`)}}const CE$1=r=>r;let ji=Object.create(null);const Mo$1=r=>lt$2(r)&&(r.t===0||r.type===0)&&("b"in r||"body"in r);function DE$1(r,o={}){let s=!1;const a=o.onError||Ex$1;return o.onError=l=>{s=!0,a(l)},{...Gx$1(r,o),detectError:s}}const Cw$1=(r,o)=>{if(!ve(r))throw wr$2(Jt$1.NOT_SUPPORT_NON_STRING_MESSAGE);{Qe(o.warnHtmlMessage)&&o.warnHtmlMessage;const s=(o.onCacheKey||CE$1)(r),a=ji[s];if(a)return a;const{code:l,detectError:c}=DE$1(r,o),u=new Function(`return ${l}`)();return c?u:ji[s]=u}};function Vw$1(r,o){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&ve(r)){Qe(o.warnHtmlMessage)&&o.warnHtmlMessage;const s=(o.onCacheKey||CE$1)(r),a=ji[s];if(a)return a;const{ast:l,detectError:c}=DE$1(r,{...o,location:!1,jit:!0}),u=Lu$1(l);return c?u:ji[s]=u}else{const s=r.cacheKey;return s?ji[s]||(ji[s]=Lu$1(r)):Lu$1(r)}}const Mh$1=()=>"",Xn$1=r=>pt(r);function $h$1(r,...o){const{fallbackFormat:s,postTranslation:a,unresolving:l,messageCompiler:c,fallbackLocale:u,messages:d}=r,[m,g]=Fd$1(...o),y=Qe(g.missingWarn)?g.missingWarn:r.missingWarn,_=Qe(g.fallbackWarn)?g.fallbackWarn:r.fallbackWarn,E=Qe(g.escapeParameter)?g.escapeParameter:r.escapeParameter,w=!!g.resolvedMessage,T=ve(g.default)||Qe(g.default)?Qe(g.default)?c?m:()=>m:g.default:s?c?m:()=>m:"",k=s||T!=="",O=Pp$1(r,g);E&&Dw$1(g);let[R,M,N]=w?[m,O,d[O]||{}]:AE$1(r,m,O,u,_,y),D=R,P=m;if(!w&&!(ve(D)||Mo$1(D)||Xn$1(D))&&k&&(D=T,P=D),!w&&(!(ve(D)||Mo$1(D)||Xn$1(D))||!ve(M)))return l?su$1:m;let I=!1;const L=()=>{I=!0},F=Xn$1(D)?D:LE$1(r,m,M,D,P,L);if(I)return D;const U=Rw$1(r,M,N,g),J=lw$1(U),z=Aw$1(r,F,J),ie=a?a(z,m):z;if(__INTLIFY_PROD_DEVTOOLS__){const ce={timestamp:Date.now(),key:ve(m)?m:Xn$1(D)?D.key:"",locale:M||(Xn$1(D)?D.locale:""),format:ve(D)?D:Xn$1(D)?D.source:"",message:ie};ce.meta=on$1({},r.__meta,{}),dw$1(ce)}return ie}function Dw$1(r){bt$1(r.list)?r.list=r.list.map(o=>ve(o)?Eh$1(o):o):lt$2(r.named)&&Object.keys(r.named).forEach(o=>{ve(r.named[o])&&(r.named[o]=Eh$1(r.named[o]))})}function AE$1(r,o,s,a,l,c){const{messages:u,onWarn:d,messageResolver:m,localeFallbacker:g}=r,y=g(r,a,s);let _={},E,w=null;const T="translate";for(let k=0;ka;return g.locale=s,g.key=o,g}const m=u(a,Lw$1(r,s,l,a,d,c));return m.locale=s,m.key=o,m.source=a,m}function Aw$1(r,o,s){return o(s)}function Fd$1(...r){const[o,s,a]=r,l={};if(!ve(o)&&!Wt$1(o)&&!Xn$1(o)&&!Mo$1(o))throw wr$2(Jt$1.INVALID_ARGUMENT);const c=Wt$1(o)?String(o):o;return Wt$1(s)?l.plural=s:ve(s)?l.default=s:Ue(s)&&!ru$1(s)?l.named=s:bt$1(s)&&(l.list=s),Wt$1(a)?l.plural=a:ve(a)?l.default=a:Ue(a)&&on$1(l,a),[c,l]}function Lw$1(r,o,s,a,l,c){return{locale:o,key:s,warnHtmlMessage:l,onError:u=>{throw c&&c(u),u},onCacheKey:u=>sx$1(o,s,u)}}function Rw$1(r,o,s,a){const{modifiers:l,pluralRules:c,messageResolver:u,fallbackLocale:d,fallbackWarn:m,missingWarn:g,fallbackContext:y}=r,_={locale:o,modifiers:l,pluralRules:c,messages:E=>{let w=u(s,E);if(w==null&&y){const[,,T]=AE$1(y,E,o,d,m,g);w=u(T,E)}if(ve(w)||Mo$1(w)){let T=!1;const k=LE$1(r,E,o,w,E,()=>{T=!0});return T?Mh$1:k}else return Xn$1(w)?w:Mh$1}};return r.processor&&(_.processor=r.processor),a.list&&(_.list=a.list),a.named&&(_.named=a.named),Wt$1(a.plural)&&(_.pluralIndex=a.plural),_}function Fh$1(r,...o){const{datetimeFormats:s,unresolving:a,fallbackLocale:l,onWarn:c,localeFallbacker:u}=r,{__datetimeFormatters:d}=r,[m,g,y,_]=Ud$1(...o),E=Qe(y.missingWarn)?y.missingWarn:r.missingWarn;Qe(y.fallbackWarn)?y.fallbackWarn:r.fallbackWarn;const w=!!y.part,T=Pp$1(r,y),k=u(r,l,T);if(!ve(m)||m==="")return new Intl.DateTimeFormat(T,_).format(g);let O={},R,M=null;const N="datetime format";for(let I=0;I{RE$1.includes(m)?u[m]=s[m]:c[m]=s[m]}),ve(a)?c.locale=a:Ue(a)&&(u=a),Ue(l)&&(u=l),[c.key||"",d,c,u]}function Uh(r,o,s){const a=r;for(const l in s){const c=`${o}__${l}`;a.__datetimeFormatters.has(c)&&a.__datetimeFormatters.delete(c)}}function jh$1(r,...o){const{numberFormats:s,unresolving:a,fallbackLocale:l,onWarn:c,localeFallbacker:u}=r,{__numberFormatters:d}=r,[m,g,y,_]=jd$1(...o),E=Qe(y.missingWarn)?y.missingWarn:r.missingWarn;Qe(y.fallbackWarn)?y.fallbackWarn:r.fallbackWarn;const w=!!y.part,T=Pp$1(r,y),k=u(r,l,T);if(!ve(m)||m==="")return new Intl.NumberFormat(T,_).format(g);let O={},R,M=null;const N="number format";for(let I=0;I{ME$1.includes(m)?u[m]=s[m]:c[m]=s[m]}),ve(a)?c.locale=a:Ue(a)&&(u=a),Ue(l)&&(u=l),[c.key||"",d,c,u]}function Bh$1(r,o,s){const a=r;for(const l in s){const c=`${o}__${l}`;a.__numberFormatters.has(c)&&a.__numberFormatters.delete(c)}}Kx$1();/*! - * vue-i18n v9.14.0 - * (c) 2024 kazuya kawaguchi - * Released under the MIT License. - */const Mw$1="9.14.0";function $w$1(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Xr$1().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Xr$1().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Xr$1().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Xr$1().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Xr$1().__INTLIFY_PROD_DEVTOOLS__=!1)}const $E$1=yn$1.__EXTEND_POINT__,Ur$1=ou$1($E$1);Ur$1(),Ur$1(),Ur$1(),Ur$1(),Ur$1(),Ur$1(),Ur$1(),Ur$1(),Ur$1();const kE$1=Jt$1.__EXTEND_POINT__,_n$1=ou$1(kE$1),ot={UNEXPECTED_RETURN_TYPE:kE$1,INVALID_ARGUMENT:_n$1(),MUST_BE_CALL_SETUP_TOP:_n$1(),NOT_INSTALLED:_n$1(),NOT_AVAILABLE_IN_LEGACY_MODE:_n$1(),REQUIRED_VALUE:_n$1(),INVALID_VALUE:_n$1(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:_n$1(),NOT_INSTALLED_WITH_PROVIDE:_n$1(),UNEXPECTED_ERROR:_n$1(),NOT_COMPATIBLE_LEGACY_VUE_I18N:_n$1(),BRIDGE_SUPPORT_VUE_2_ONLY:_n$1(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:_n$1(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:_n$1(),__EXTEND_POINT__:_n$1()};function Yt$1(r,...o){return ys$1(r,null,void 0)}const Bd$1=$r$1("__translateVNode"),Hd$1=$r$1("__datetimeParts"),Wd$1=$r$1("__numberParts"),FE$1=$r$1("__setPluralRules"),UE$1=$r$1("__injectWithOption"),Gd$1=$r$1("__dispose");function ba$1(r){if(!lt$2(r))return r;for(const o in r)if(bc$1(r,o))if(!o.includes("."))lt$2(r[o])&&ba$1(r[o]);else{const s=o.split("."),a=s.length-1;let l=r,c=!1;for(let u=0;u{if("locale"in d&&"resource"in d){const{locale:m,resource:g}=d;m?(u[m]=u[m]||{},$l$1(g,u[m])):$l$1(g,u)}else ve(d)&&$l$1(JSON.parse(d),u)}),l==null&&c)for(const d in u)bc$1(u,d)&&ba$1(u[d]);return u}function jE$1(r){return r.type}function BE$1(r,o,s){let a=lt$2(o.messages)?o.messages:{};"__i18nGlobal"in s&&(a=lu$1(r.locale.value,{messages:a,__i18n:s.__i18nGlobal}));const l=Object.keys(a);l.length&&l.forEach(c=>{r.mergeLocaleMessage(c,a[c])});{if(lt$2(o.datetimeFormats)){const c=Object.keys(o.datetimeFormats);c.length&&c.forEach(u=>{r.mergeDateTimeFormat(u,o.datetimeFormats[u])})}if(lt$2(o.numberFormats)){const c=Object.keys(o.numberFormats);c.length&&c.forEach(u=>{r.mergeNumberFormat(u,o.numberFormats[u])})}}}function Hh$1(r){return A(gr$1,null,r,0)}const Gh$1=()=>[],Uw$1=()=>!1;let Kh$1=0;function Yh$1(r){return(o,s,a,l)=>r(s,a,qt$1()||void 0,l)}function Mp$1(r={},o){const{__root:s,__injectWithOption:a}=r,l=s===void 0,c=r.flatJson,u=Er$1?$e:Ia$1,d=!!r.translateExistCompatible;let m=Qe(r.inheritLocale)?r.inheritLocale:!0;const g=u(s&&m?s.locale.value:ve(r.locale)?r.locale:as$1),y=u(s&&m?s.fallbackLocale.value:ve(r.fallbackLocale)||bt$1(r.fallbackLocale)||Ue(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:g.value),_=u(lu$1(g.value,r)),E=u(Ue(r.datetimeFormats)?r.datetimeFormats:{[g.value]:{}}),w=u(Ue(r.numberFormats)?r.numberFormats:{[g.value]:{}});let T=s?s.missingWarn:Qe(r.missingWarn)||Ro$1(r.missingWarn)?r.missingWarn:!0,k=s?s.fallbackWarn:Qe(r.fallbackWarn)||Ro$1(r.fallbackWarn)?r.fallbackWarn:!0,O=s?s.fallbackRoot:Qe(r.fallbackRoot)?r.fallbackRoot:!0,R=!!r.fallbackFormat,M=pt(r.missing)?r.missing:null,N=pt(r.missing)?Yh$1(r.missing):null,D=pt(r.postTranslation)?r.postTranslation:null,P=s?s.warnHtmlMessage:Qe(r.warnHtmlMessage)?r.warnHtmlMessage:!0,I=!!r.escapeParameter;const L=s?s.modifiers:Ue(r.modifiers)?r.modifiers:{};let F=r.pluralRules||s&&s.pluralRules,U;U=(()=>{l&&Lh$1(null);const kee={version:Mw$1,locale:g.value,fallbackLocale:y.value,messages:_.value,modifiers:L,pluralRules:F,missing:N===null?void 0:N,missingWarn:T,fallbackWarn:k,fallbackFormat:R,unresolving:!0,postTranslation:D===null?void 0:D,warnHtmlMessage:P,escapeParameter:I,messageResolver:r.messageResolver,messageCompiler:r.messageCompiler,__meta:{framework:"vue"}};kee.datetimeFormats=E.value,kee.numberFormats=w.value,kee.__datetimeFormatters=Ue(U)?U.__datetimeFormatters:void 0,kee.__numberFormatters=Ue(U)?U.__numberFormatters:void 0;const Dte=Tw$1(kee);return l&&Lh$1(Dte),Dte})(),Ns$1(U,g.value,y.value);function J(){return[g.value,y.value,_.value,E.value,w.value]}const z=xt$1({get:()=>g.value,set:kee=>{g.value=kee,U.locale=g.value}}),ie=xt$1({get:()=>y.value,set:kee=>{y.value=kee,U.fallbackLocale=y.value,Ns$1(U,g.value,kee)}}),ce=xt$1(()=>_.value),Y=xt$1(()=>E.value),B=xt$1(()=>w.value);function V(){return pt(D)?D:null}function Ge(kee){D=kee,U.postTranslation=kee}function St(){return M}function Dee(kee){kee!==null&&(N=Yh$1(kee)),M=kee,U.missing=N}const pee=(kee,Dte,Ite,Lte,Vte,Pte)=>{J();let Fte;try{__INTLIFY_PROD_DEVTOOLS__,l||(U.fallbackContext=s?Sw$1():void 0),Fte=kee(U)}finally{__INTLIFY_PROD_DEVTOOLS__,l||(U.fallbackContext=void 0)}if(Ite!=="translate exists"&&Wt$1(Fte)&&Fte===su$1||Ite==="translate exists"&&!Fte){const[Ute,Gte]=Dte();return s&&O?Lte(s):Vte(Ute)}else{if(Pte(Fte))return Fte;throw Yt$1(ot.UNEXPECTED_RETURN_TYPE)}};function jr(...kee){return pee(Dte=>Reflect.apply($h$1,null,[Dte,...kee]),()=>Fd$1(...kee),"translate",Dte=>Reflect.apply(Dte.t,Dte,[...kee]),Dte=>Dte,Dte=>ve(Dte))}function Tee(...kee){const[Dte,Ite,Lte]=kee;if(Lte&&!lt$2(Lte))throw Yt$1(ot.INVALID_ARGUMENT);return jr(Dte,Ite,on$1({resolvedMessage:!0},Lte||{}))}function et(...kee){return pee(Dte=>Reflect.apply(Fh$1,null,[Dte,...kee]),()=>Ud$1(...kee),"datetime format",Dte=>Reflect.apply(Dte.d,Dte,[...kee]),()=>_c$1,Dte=>ve(Dte))}function ft(...kee){return pee(Dte=>Reflect.apply(jh$1,null,[Dte,...kee]),()=>jd$1(...kee),"number format",Dte=>Reflect.apply(Dte.n,Dte,[...kee]),()=>_c$1,Dte=>ve(Dte))}function yee(kee){return kee.map(Dte=>ve(Dte)||Wt$1(Dte)||Qe(Dte)?Hh$1(String(Dte)):Dte)}const ete={normalize:yee,interpolate:kee=>kee,type:"vnode"};function xte(...kee){return pee(Dte=>{let Ite;const Lte=Dte;try{Lte.processor=ete,Ite=Reflect.apply($h$1,null,[Lte,...kee])}finally{Lte.processor=null}return Ite},()=>Fd$1(...kee),"translate",Dte=>Dte[Bd$1](...kee),Dte=>[Hh$1(Dte)],Dte=>bt$1(Dte))}function Ote(...kee){return pee(Dte=>Reflect.apply(jh$1,null,[Dte,...kee]),()=>jd$1(...kee),"number format",Dte=>Dte[Wd$1](...kee),Gh$1,Dte=>ve(Dte)||bt$1(Dte))}function nee(...kee){return pee(Dte=>Reflect.apply(Fh$1,null,[Dte,...kee]),()=>Ud$1(...kee),"datetime format",Dte=>Dte[Hd$1](...kee),Gh$1,Dte=>ve(Dte)||bt$1(Dte))}function Wee(kee){F=kee,U.pluralRules=F}function Bee(kee,Dte){return pee(()=>{if(!kee)return!1;const Ite=ve(Dte)?Dte:g.value,Lte=st(Ite),Vte=U.messageResolver(Lte,kee);return d?Vte!=null:Mo$1(Vte)||Xn$1(Vte)||ve(Vte)},()=>[kee],"translate exists",Ite=>Reflect.apply(Ite.te,Ite,[kee,Dte]),Uw$1,Ite=>Qe(Ite))}function Nte(kee){let Dte=null;const Ite=EE$1(U,y.value,g.value);for(let Lte=0;Lte{m&&(g.value=kee,U.locale=kee,Ns$1(U,g.value,y.value))}),Oe(s.fallbackLocale,kee=>{m&&(y.value=kee,U.fallbackLocale=kee,Ns$1(U,g.value,y.value))}));const xee={id:Kh$1,locale:z,fallbackLocale:ie,get inheritLocale(){return m},set inheritLocale(kee){m=kee,kee&&s&&(g.value=s.locale.value,y.value=s.fallbackLocale.value,Ns$1(U,g.value,y.value))},get availableLocales(){return Object.keys(_.value).sort()},messages:ce,get modifiers(){return L},get pluralRules(){return F||{}},get isGlobal(){return l},get missingWarn(){return T},set missingWarn(kee){T=kee,U.missingWarn=T},get fallbackWarn(){return k},set fallbackWarn(kee){k=kee,U.fallbackWarn=k},get fallbackRoot(){return O},set fallbackRoot(kee){O=kee},get fallbackFormat(){return R},set fallbackFormat(kee){R=kee,U.fallbackFormat=R},get warnHtmlMessage(){return P},set warnHtmlMessage(kee){P=kee,U.warnHtmlMessage=kee},get escapeParameter(){return I},set escapeParameter(kee){I=kee,U.escapeParameter=kee},t:jr,getLocaleMessage:st,setLocaleMessage:Lee,mergeLocaleMessage:$te,getPostTranslationHandler:V,setPostTranslationHandler:Ge,getMissingHandler:St,setMissingHandler:Dee,[FE$1]:Wee};return xee.datetimeFormats=Y,xee.numberFormats=B,xee.rt=Tee,xee.te=Bee,xee.tm=_ee,xee.d=et,xee.n=ft,xee.getDateTimeFormat=Kee,xee.setDateTimeFormat=Iee,xee.mergeDateTimeFormat=Rte,xee.getNumberFormat=dee,xee.setNumberFormat=fee,xee.mergeNumberFormat=Oee,xee[UE$1]=a,xee[Bd$1]=xte,xee[Hd$1]=nee,xee[Wd$1]=Ote,xee}function Bw$1(r){const o=ve(r.locale)?r.locale:as$1,s=ve(r.fallbackLocale)||bt$1(r.fallbackLocale)||Ue(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:o,a=pt(r.missing)?r.missing:void 0,l=Qe(r.silentTranslationWarn)||Ro$1(r.silentTranslationWarn)?!r.silentTranslationWarn:!0,c=Qe(r.silentFallbackWarn)||Ro$1(r.silentFallbackWarn)?!r.silentFallbackWarn:!0,u=Qe(r.fallbackRoot)?r.fallbackRoot:!0,d=!!r.formatFallbackMessages,m=Ue(r.modifiers)?r.modifiers:{},g=r.pluralizationRules,y=pt(r.postTranslation)?r.postTranslation:void 0,_=ve(r.warnHtmlInMessage)?r.warnHtmlInMessage!=="off":!0,E=!!r.escapeParameterHtml,w=Qe(r.sync)?r.sync:!0;let T=r.messages;if(Ue(r.sharedMessages)){const I=r.sharedMessages;T=Object.keys(I).reduce((L,F)=>{const U=L[F]||(L[F]={});return on$1(U,I[F]),L},T||{})}const{__i18n:k,__root:O,__injectWithOption:R}=r,M=r.datetimeFormats,N=r.numberFormats,D=r.flatJson,P=r.translateExistCompatible;return{locale:o,fallbackLocale:s,messages:T,flatJson:D,datetimeFormats:M,numberFormats:N,missing:a,missingWarn:l,fallbackWarn:c,fallbackRoot:u,fallbackFormat:d,modifiers:m,pluralRules:g,postTranslation:y,warnHtmlMessage:_,escapeParameter:E,messageResolver:r.messageResolver,inheritLocale:w,translateExistCompatible:P,__i18n:k,__root:O,__injectWithOption:R}}function Kd$1(r={},o){{const s=Mp$1(Bw$1(r)),{__extender:a}=r,l={id:s.id,get locale(){return s.locale.value},set locale(c){s.locale.value=c},get fallbackLocale(){return s.fallbackLocale.value},set fallbackLocale(c){s.fallbackLocale.value=c},get messages(){return s.messages.value},get datetimeFormats(){return s.datetimeFormats.value},get numberFormats(){return s.numberFormats.value},get availableLocales(){return s.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(c){},get missing(){return s.getMissingHandler()},set missing(c){s.setMissingHandler(c)},get silentTranslationWarn(){return Qe(s.missingWarn)?!s.missingWarn:s.missingWarn},set silentTranslationWarn(c){s.missingWarn=Qe(c)?!c:c},get silentFallbackWarn(){return Qe(s.fallbackWarn)?!s.fallbackWarn:s.fallbackWarn},set silentFallbackWarn(c){s.fallbackWarn=Qe(c)?!c:c},get modifiers(){return s.modifiers},get formatFallbackMessages(){return s.fallbackFormat},set formatFallbackMessages(c){s.fallbackFormat=c},get postTranslation(){return s.getPostTranslationHandler()},set postTranslation(c){s.setPostTranslationHandler(c)},get sync(){return s.inheritLocale},set sync(c){s.inheritLocale=c},get warnHtmlInMessage(){return s.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(c){s.warnHtmlMessage=c!=="off"},get escapeParameterHtml(){return s.escapeParameter},set escapeParameterHtml(c){s.escapeParameter=c},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(c){},get pluralizationRules(){return s.pluralRules||{}},__composer:s,t(...c){const[u,d,m]=c,g={};let y=null,_=null;if(!ve(u))throw Yt$1(ot.INVALID_ARGUMENT);const E=u;return ve(d)?g.locale=d:bt$1(d)?y=d:Ue(d)&&(_=d),bt$1(m)?y=m:Ue(m)&&(_=m),Reflect.apply(s.t,s,[E,y||_||{},g])},rt(...c){return Reflect.apply(s.rt,s,[...c])},tc(...c){const[u,d,m]=c,g={plural:1};let y=null,_=null;if(!ve(u))throw Yt$1(ot.INVALID_ARGUMENT);const E=u;return ve(d)?g.locale=d:Wt$1(d)?g.plural=d:bt$1(d)?y=d:Ue(d)&&(_=d),ve(m)?g.locale=m:bt$1(m)?y=m:Ue(m)&&(_=m),Reflect.apply(s.t,s,[E,y||_||{},g])},te(c,u){return s.te(c,u)},tm(c){return s.tm(c)},getLocaleMessage(c){return s.getLocaleMessage(c)},setLocaleMessage(c,u){s.setLocaleMessage(c,u)},mergeLocaleMessage(c,u){s.mergeLocaleMessage(c,u)},d(...c){return Reflect.apply(s.d,s,[...c])},getDateTimeFormat(c){return s.getDateTimeFormat(c)},setDateTimeFormat(c,u){s.setDateTimeFormat(c,u)},mergeDateTimeFormat(c,u){s.mergeDateTimeFormat(c,u)},n(...c){return Reflect.apply(s.n,s,[...c])},getNumberFormat(c){return s.getNumberFormat(c)},setNumberFormat(c,u){s.setNumberFormat(c,u)},mergeNumberFormat(c,u){s.mergeNumberFormat(c,u)},getChoiceIndex(c,u){return-1}};return l.__extender=a,l}}const $p$1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:r=>r==="parent"||r==="global",default:"parent"},i18n:{type:Object}};function Hw$1({slots:r},o){return o.length===1&&o[0]==="default"?(r.default?r.default():[]).reduce((s,a)=>[...s,...a.type===Ze?a.children:[a]],[]):o.reduce((s,a)=>{const l=r[a];return l&&(s[a]=l()),s},{})}function HE$1(r){return Ze}const Ww$1=Ee({name:"i18n-t",props:on$1({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:r=>Wt$1(r)||!isNaN(r)}},$p$1),setup(r,o){const{slots:s,attrs:a}=o,l=r.i18n||Ya$1({useScope:r.scope,__useComponent:!0});return()=>{const c=Object.keys(s).filter(_=>_!=="_"),u={};r.locale&&(u.locale=r.locale),r.plural!==void 0&&(u.plural=ve(r.plural)?+r.plural:r.plural);const d=Hw$1(o,c),m=l[Bd$1](r.keypath,d,u),g=on$1({},a),y=ve(r.tag)||lt$2(r.tag)?r.tag:HE$1();return dr$1(y,g,m)}}}),Pu$1=Ww$1;function Gw$1(r){return bt$1(r)&&!ve(r[0])}function WE$1(r,o,s,a){const{slots:l,attrs:c}=o;return()=>{const u={part:!0};let d={};r.locale&&(u.locale=r.locale),ve(r.format)?u.key=r.format:lt$2(r.format)&&(ve(r.format.key)&&(u.key=r.format.key),d=Object.keys(r.format).reduce((E,w)=>s.includes(w)?on$1({},E,{[w]:r.format[w]}):E,{}));const m=a(r.value,u,d);let g=[u.key];bt$1(m)?g=m.map((E,w)=>{const T=l[E.type],k=T?T({[E.type]:E.value,index:w,parts:m}):[E.value];return Gw$1(k)&&(k[0].key=`${E.type}-${w}`),k}):ve(m)&&(g=[m]);const y=on$1({},c),_=ve(r.tag)||lt$2(r.tag)?r.tag:HE$1();return dr$1(_,y,g)}}const Kw$1=Ee({name:"i18n-n",props:on$1({value:{type:Number,required:!0},format:{type:[String,Object]}},$p$1),setup(r,o){const s=r.i18n||Ya$1({useScope:r.scope,__useComponent:!0});return WE$1(r,o,ME$1,(...a)=>s[Wd$1](...a))}}),Xh$1=Kw$1,Yw$1=Ee({name:"i18n-d",props:on$1({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},$p$1),setup(r,o){const s=r.i18n||Ya$1({useScope:r.scope,__useComponent:!0});return WE$1(r,o,RE$1,(...a)=>s[Hd$1](...a))}}),zh$1=Yw$1;function Xw$1(r,o){const s=r;if(r.mode==="composition")return s.__getInstance(o)||r.global;{const a=s.__getInstance(o);return a!=null?a.__composer:r.global.__composer}}function zw$1(r){const o=s=>{const{instance:a,modifiers:l,value:c}=s;if(!a||!a.$)throw Yt$1(ot.UNEXPECTED_ERROR);const u=Xw$1(r,a.$),d=Jh$1(c);return[Reflect.apply(u.t,u,[...Qh$1(d)]),u]};return{created:(s,a)=>{const[l,c]=o(a);Er$1&&r.global===c&&(s.__i18nWatcher=Oe(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),s.__composer=c,s.textContent=l},unmounted:s=>{Er$1&&s.__i18nWatcher&&(s.__i18nWatcher(),s.__i18nWatcher=void 0,delete s.__i18nWatcher),s.__composer&&(s.__composer=void 0,delete s.__composer)},beforeUpdate:(s,{value:a})=>{if(s.__composer){const l=s.__composer,c=Jh$1(a);s.textContent=Reflect.apply(l.t,l,[...Qh$1(c)])}},getSSRProps:s=>{const[a]=o(s);return{textContent:a}}}}function Jh$1(r){if(ve(r))return{path:r};if(Ue(r)){if(!("path"in r))throw Yt$1(ot.REQUIRED_VALUE,"path");return r}else throw Yt$1(ot.INVALID_VALUE)}function Qh$1(r){const{path:o,locale:s,args:a,choice:l,plural:c}=r,u={},d=a||{};return ve(s)&&(u.locale=s),Wt$1(l)&&(u.plural=l),Wt$1(c)&&(u.plural=c),[o,d,u]}function Jw$1(r,o,...s){const a=Ue(s[0])?s[0]:{},l=!!a.useI18nComponentName;(Qe(a.globalInstall)?a.globalInstall:!0)&&([l?"i18n":Pu$1.name,"I18nT"].forEach(u=>r.component(u,Pu$1)),[Xh$1.name,"I18nN"].forEach(u=>r.component(u,Xh$1)),[zh$1.name,"I18nD"].forEach(u=>r.component(u,zh$1))),r.directive("t",zw$1(o))}function uI$1(r,o,s){return{beforeCreate(){const a=qt$1();if(!a)throw Yt$1(ot.UNEXPECTED_ERROR);const l=this.$options;if(l.i18n){const c=l.i18n;if(l.__i18n&&(c.__i18n=l.__i18n),c.__root=o,this===this.$root)this.$i18n=Zh$1(r,c);else{c.__injectWithOption=!0,c.__extender=s.__vueI18nExtend,this.$i18n=Kd$1(c);const u=this.$i18n;u.__extender&&(u.__disposer=u.__extender(this.$i18n))}}else if(l.__i18n)if(this===this.$root)this.$i18n=Zh$1(r,l);else{this.$i18n=Kd$1({__i18n:l.__i18n,__injectWithOption:!0,__extender:s.__vueI18nExtend,__root:o});const c=this.$i18n;c.__extender&&(c.__disposer=c.__extender(this.$i18n))}else this.$i18n=r;l.__i18nGlobal&&BE$1(o,l,l),this.$t=(...c)=>this.$i18n.t(...c),this.$rt=(...c)=>this.$i18n.rt(...c),this.$tc=(...c)=>this.$i18n.tc(...c),this.$te=(c,u)=>this.$i18n.te(c,u),this.$d=(...c)=>this.$i18n.d(...c),this.$n=(...c)=>this.$i18n.n(...c),this.$tm=c=>this.$i18n.tm(c),s.__setInstance(a,this.$i18n)},mounted(){},unmounted(){const a=qt$1();if(!a)throw Yt$1(ot.UNEXPECTED_ERROR);const l=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,l.__disposer&&(l.__disposer(),delete l.__disposer,delete l.__extender),s.__deleteInstance(a),delete this.$i18n}}}function Zh$1(r,o){r.locale=o.locale||r.locale,r.fallbackLocale=o.fallbackLocale||r.fallbackLocale,r.missing=o.missing||r.missing,r.silentTranslationWarn=o.silentTranslationWarn||r.silentFallbackWarn,r.silentFallbackWarn=o.silentFallbackWarn||r.silentFallbackWarn,r.formatFallbackMessages=o.formatFallbackMessages||r.formatFallbackMessages,r.postTranslation=o.postTranslation||r.postTranslation,r.warnHtmlInMessage=o.warnHtmlInMessage||r.warnHtmlInMessage,r.escapeParameterHtml=o.escapeParameterHtml||r.escapeParameterHtml,r.sync=o.sync||r.sync,r.__composer[FE$1](o.pluralizationRules||r.pluralizationRules);const s=lu$1(r.locale,{messages:o.messages,__i18n:o.__i18n});return Object.keys(s).forEach(a=>r.mergeLocaleMessage(a,s[a])),o.datetimeFormats&&Object.keys(o.datetimeFormats).forEach(a=>r.mergeDateTimeFormat(a,o.datetimeFormats[a])),o.numberFormats&&Object.keys(o.numberFormats).forEach(a=>r.mergeNumberFormat(a,o.numberFormats[a])),r}const dI$1=$r$1("global-vue-i18n");function fI$1(r={},o){const s=__VUE_I18N_LEGACY_API__&&Qe(r.legacy)?r.legacy:__VUE_I18N_LEGACY_API__,a=Qe(r.globalInjection)?r.globalInjection:!0,l=__VUE_I18N_LEGACY_API__&&s?!!r.allowComposition:!0,c=new Map,[u,d]=pI$1(r,s),m=$r$1("");function g(E){return c.get(E)||null}function y(E,w){c.set(E,w)}function _(E){c.delete(E)}{const E={get mode(){return __VUE_I18N_LEGACY_API__&&s?"legacy":"composition"},get allowComposition(){return l},async install(w,...T){if(w.__VUE_I18N_SYMBOL__=m,w.provide(w.__VUE_I18N_SYMBOL__,E),Ue(T[0])){const R=T[0];E.__composerExtend=R.__composerExtend,E.__vueI18nExtend=R.__vueI18nExtend}let k=null;!s&&a&&(k=OI$1(w,E.global)),__VUE_I18N_FULL_INSTALL__&&Jw$1(w,E,...T),__VUE_I18N_LEGACY_API__&&s&&w.mixin(uI$1(d,d.__composer,E));const O=w.unmount;w.unmount=()=>{k&&k(),E.dispose(),O()}},get global(){return d},dispose(){u.stop()},__instances:c,__getInstance:g,__setInstance:y,__deleteInstance:_};return E}}function Ya$1(r={}){const o=qt$1();if(o==null)throw Yt$1(ot.MUST_BE_CALL_SETUP_TOP);if(!o.isCE&&o.appContext.app!=null&&!o.appContext.app.__VUE_I18N_SYMBOL__)throw Yt$1(ot.NOT_INSTALLED);const s=mI$1(o),a=gI$1(s),l=jE$1(o),c=hI$1(r,l);if(__VUE_I18N_LEGACY_API__&&s.mode==="legacy"&&!r.__useComponent){if(!s.allowComposition)throw Yt$1(ot.NOT_AVAILABLE_IN_LEGACY_MODE);return EI$1(o,c,a,r)}if(c==="global")return BE$1(a,r,l),a;if(c==="parent"){let m=vI$1(s,o,r.__useComponent);return m==null&&(m=a),m}const u=s;let d=u.__getInstance(o);if(d==null){const m=on$1({},r);"__i18n"in l&&(m.__i18n=l.__i18n),a&&(m.__root=a),d=Mp$1(m),u.__composerExtend&&(d[Gd$1]=u.__composerExtend(d)),bI$1(u,o,d),u.__setInstance(o,d)}return d}function pI$1(r,o,s){const a=wa$1();{const l=__VUE_I18N_LEGACY_API__&&o?a.run(()=>Kd$1(r)):a.run(()=>Mp$1(r));if(l==null)throw Yt$1(ot.UNEXPECTED_ERROR);return[a,l]}}function mI$1(r){{const o=Co$1(r.isCE?dI$1:r.appContext.app.__VUE_I18N_SYMBOL__);if(!o)throw Yt$1(r.isCE?ot.NOT_INSTALLED_WITH_PROVIDE:ot.UNEXPECTED_ERROR);return o}}function hI$1(r,o){return ru$1(r)?"__i18n"in o?"local":"global":r.useScope?r.useScope:"local"}function gI$1(r){return r.mode==="composition"?r.global:r.global.__composer}function vI$1(r,o,s=!1){let a=null;const l=o.root;let c=yI$1(o,s);for(;c!=null;){const u=r;if(r.mode==="composition")a=u.__getInstance(c);else if(__VUE_I18N_LEGACY_API__){const d=u.__getInstance(c);d!=null&&(a=d.__composer,s&&a&&!a[UE$1]&&(a=null))}if(a!=null||l===c)break;c=c.parent}return a}function yI$1(r,o=!1){return r==null?null:o&&r.vnode.ctx||r.parent}function bI$1(r,o,s){Pn$1(()=>{},o),Ii$1(()=>{const a=s;r.__deleteInstance(o);const l=a[Gd$1];l&&(l(),delete a[Gd$1])},o)}function EI$1(r,o,s,a={}){const l=o==="local",c=Ia$1(null);if(l&&r.proxy&&!(r.proxy.$options.i18n||r.proxy.$options.__i18n))throw Yt$1(ot.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const u=Qe(a.inheritLocale)?a.inheritLocale:!ve(a.locale),d=$e(!l||u?s.locale.value:ve(a.locale)?a.locale:as$1),m=$e(!l||u?s.fallbackLocale.value:ve(a.fallbackLocale)||bt$1(a.fallbackLocale)||Ue(a.fallbackLocale)||a.fallbackLocale===!1?a.fallbackLocale:d.value),g=$e(lu$1(d.value,a)),y=$e(Ue(a.datetimeFormats)?a.datetimeFormats:{[d.value]:{}}),_=$e(Ue(a.numberFormats)?a.numberFormats:{[d.value]:{}}),E=l?s.missingWarn:Qe(a.missingWarn)||Ro$1(a.missingWarn)?a.missingWarn:!0,w=l?s.fallbackWarn:Qe(a.fallbackWarn)||Ro$1(a.fallbackWarn)?a.fallbackWarn:!0,T=l?s.fallbackRoot:Qe(a.fallbackRoot)?a.fallbackRoot:!0,k=!!a.fallbackFormat,O=pt(a.missing)?a.missing:null,R=pt(a.postTranslation)?a.postTranslation:null,M=l?s.warnHtmlMessage:Qe(a.warnHtmlMessage)?a.warnHtmlMessage:!0,N=!!a.escapeParameter,D=l?s.modifiers:Ue(a.modifiers)?a.modifiers:{},P=a.pluralRules||l&&s.pluralRules;function I(){return[d.value,m.value,g.value,y.value,_.value]}const L=xt$1({get:()=>c.value?c.value.locale.value:d.value,set:st=>{c.value&&(c.value.locale.value=st),d.value=st}}),F=xt$1({get:()=>c.value?c.value.fallbackLocale.value:m.value,set:st=>{c.value&&(c.value.fallbackLocale.value=st),m.value=st}}),U=xt$1(()=>c.value?c.value.messages.value:g.value),J=xt$1(()=>y.value),z=xt$1(()=>_.value);function ie(){return c.value?c.value.getPostTranslationHandler():R}function ce(st){c.value&&c.value.setPostTranslationHandler(st)}function Y(){return c.value?c.value.getMissingHandler():O}function B(st){c.value&&c.value.setMissingHandler(st)}function V(st){return I(),st()}function Ge(...st){return c.value?V(()=>Reflect.apply(c.value.t,null,[...st])):V(()=>"")}function St(...st){return c.value?Reflect.apply(c.value.rt,null,[...st]):""}function Dee(...st){return c.value?V(()=>Reflect.apply(c.value.d,null,[...st])):V(()=>"")}function pee(...st){return c.value?V(()=>Reflect.apply(c.value.n,null,[...st])):V(()=>"")}function jr(st){return c.value?c.value.tm(st):{}}function Tee(st,Lee){return c.value?c.value.te(st,Lee):!1}function et(st){return c.value?c.value.getLocaleMessage(st):{}}function ft(st,Lee){c.value&&(c.value.setLocaleMessage(st,Lee),g.value[st]=Lee)}function yee(st,Lee){c.value&&c.value.mergeLocaleMessage(st,Lee)}function ete(st){return c.value?c.value.getDateTimeFormat(st):{}}function xte(st,Lee){c.value&&(c.value.setDateTimeFormat(st,Lee),y.value[st]=Lee)}function Ote(st,Lee){c.value&&c.value.mergeDateTimeFormat(st,Lee)}function nee(st){return c.value?c.value.getNumberFormat(st):{}}function Wee(st,Lee){c.value&&(c.value.setNumberFormat(st,Lee),_.value[st]=Lee)}function Bee(st,Lee){c.value&&c.value.mergeNumberFormat(st,Lee)}const Nte={get id(){return c.value?c.value.id:-1},locale:L,fallbackLocale:F,messages:U,datetimeFormats:J,numberFormats:z,get inheritLocale(){return c.value?c.value.inheritLocale:u},set inheritLocale(st){c.value&&(c.value.inheritLocale=st)},get availableLocales(){return c.value?c.value.availableLocales:Object.keys(g.value)},get modifiers(){return c.value?c.value.modifiers:D},get pluralRules(){return c.value?c.value.pluralRules:P},get isGlobal(){return c.value?c.value.isGlobal:!1},get missingWarn(){return c.value?c.value.missingWarn:E},set missingWarn(st){c.value&&(c.value.missingWarn=st)},get fallbackWarn(){return c.value?c.value.fallbackWarn:w},set fallbackWarn(st){c.value&&(c.value.missingWarn=st)},get fallbackRoot(){return c.value?c.value.fallbackRoot:T},set fallbackRoot(st){c.value&&(c.value.fallbackRoot=st)},get fallbackFormat(){return c.value?c.value.fallbackFormat:k},set fallbackFormat(st){c.value&&(c.value.fallbackFormat=st)},get warnHtmlMessage(){return c.value?c.value.warnHtmlMessage:M},set warnHtmlMessage(st){c.value&&(c.value.warnHtmlMessage=st)},get escapeParameter(){return c.value?c.value.escapeParameter:N},set escapeParameter(st){c.value&&(c.value.escapeParameter=st)},t:Ge,getPostTranslationHandler:ie,setPostTranslationHandler:ce,getMissingHandler:Y,setMissingHandler:B,rt:St,d:Dee,n:pee,tm:jr,te:Tee,getLocaleMessage:et,setLocaleMessage:ft,mergeLocaleMessage:yee,getDateTimeFormat:ete,setDateTimeFormat:xte,mergeDateTimeFormat:Ote,getNumberFormat:nee,setNumberFormat:Wee,mergeNumberFormat:Bee};function _ee(st){st.locale.value=d.value,st.fallbackLocale.value=m.value,Object.keys(g.value).forEach(Lee=>{st.mergeLocaleMessage(Lee,g.value[Lee])}),Object.keys(y.value).forEach(Lee=>{st.mergeDateTimeFormat(Lee,y.value[Lee])}),Object.keys(_.value).forEach(Lee=>{st.mergeNumberFormat(Lee,_.value[Lee])}),st.escapeParameter=N,st.fallbackFormat=k,st.fallbackRoot=T,st.fallbackWarn=w,st.missingWarn=E,st.warnHtmlMessage=M}return Pa$1(()=>{if(r.proxy==null||r.proxy.$i18n==null)throw Yt$1(ot.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const st=c.value=r.proxy.$i18n.__composer;o==="global"?(d.value=st.locale.value,m.value=st.fallbackLocale.value,g.value=st.messages.value,y.value=st.datetimeFormats.value,_.value=st.numberFormats.value):l&&_ee(st)}),Nte}const _I$1=["locale","fallbackLocale","availableLocales"],eg$2=["t","rt","d","n","tm","te"];function OI$1(r,o){const s=Object.create(null);return _I$1.forEach(a=>{const l=Object.getOwnPropertyDescriptor(o,a);if(!l)throw Yt$1(ot.UNEXPECTED_ERROR);const c=Ce(l.value)?{get(){return l.value.value},set(u){l.value.value=u}}:{get(){return l.get&&l.get()}};Object.defineProperty(s,a,c)}),r.config.globalProperties.$i18n=s,eg$2.forEach(a=>{const l=Object.getOwnPropertyDescriptor(o,a);if(!l||!l.value)throw Yt$1(ot.UNEXPECTED_ERROR);Object.defineProperty(r.config.globalProperties,`$${a}`,l)}),()=>{delete r.config.globalProperties.$i18n,eg$2.forEach(a=>{delete r.config.globalProperties[`$${a}`]})}}$w$1();__INTLIFY_JIT_COMPILATION__?Ah$1(Vw$1):Ah$1(Cw$1);Ew$1(ew$1);_w$1(EE$1);if(__INTLIFY_PROD_DEVTOOLS__){const r=Xr$1();r.__INTLIFY__=!0,cw$1(r.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const NI$1={en:{title:"RAMP4 Config Editor",loading:"Waiting for config..."},fr:{title:"[FR] RAMP4 Config Editor",fr:"[FR] Waiting for config..."}},SI$1=fI$1({legacy:!1,locale:"en",fallbackLocale:"en",globalInjection:!0,messages:NI$1}),TI$1={class:"loader"},xI$1=Ee({__name:"loading",setup(r){const{t:o}=Ya$1();return(s,a)=>(H(),ae("div",TI$1,Ct(x(o)("loading")),1))}}),Un$1=ox$1("store",()=>{const r=$e(!1),o=$e(""),s=$e(""),a=$e([]),l=$e({}),c=$e({});return{initialized:r,startingFixtures:a,editingLang:s,editingTemplate:o,configs:l,options:c}}),wI$1={class:"flex flex-col items-center border-black border-2 sm:text-lg divide-y divide-slate-200"},II$1={class:"w-full"},CI$1=b("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1),VI$1=[CI$1],DI$1={class:"ml-2 sm:ml-5"},AI$1=["onClick"],LI$1=b("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1),PI$1=[LI$1],RI$1=["onClick"],MI$1={class:"w-full flex justify-center"},$I$1=Ee({__name:"navbar",emits:["templateUpdated","langUpdated"],setup(r,{emit:o}){const s=Un$1(),a=["Map","Layers","Fixtures","Panels","System"],l=$e(!1),c=$e({}),u=(d,m)=>{s.editingTemplate=d,m&&(s.editingLang=m)};return Pn$1(()=>{Object.keys(s.configs).forEach(d=>{c.value[d]=!1})}),(d,m)=>(H(),ae("div",wI$1,[b("div",{class:yt$1(["w-full p-1 sm:p-3 hover:bg-gray-200 cursor-pointer border-gray-800",{"bg-gray-200":x(s).editingTemplate==="starting-fixtures"}]),onClick:m[0]||(m[0]=g=>u("starting-fixtures"))}," Starting Fixtures ",2),b("div",II$1,[b("div",{class:"flex items-center hover:bg-gray-200 cursor-pointer w-full p-1 sm:p-3",onClick:m[1]||(m[1]=()=>{l.value=!l.value})},[(H(),ae("svg",{class:yt$1(["sm:mr-1",{"rotate-180":l.value}]),xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},VI$1,2)),to$1(" Configs ")]),l.value?(H(!0),ae(Ze,{key:0},Qt$1(Object.keys(x(s).configs),g=>(H(),ae("div",DI$1,[b("div",{class:"flex items-center hover:bg-gray-200 cursor-pointer",onClick:()=>{c.value[g]=!c.value[g]}},[(H(),ae("svg",{class:yt$1(["sm:mr-1",{"rotate-180":c.value[g]}]),xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},PI$1,2)),to$1(" "+Ct(g),1)],8,AI$1),c.value[g]?(H(),ae(Ze,{key:0},Qt$1(a,y=>b("div",{class:yt$1(["hover:bg-gray-200 cursor-pointer ml-1 sm:ml-3 pl-1 sm:pl-2",{"bg-gray-200":x(s).editingTemplate===y.toLowerCase()&&x(s).editingLang===g}]),onClick:_=>u(y.toLowerCase(),g)},Ct(y),11,RI$1)),64)):xe("",!0)]))),256)):xe("",!0)]),b("div",{class:yt$1(["hover:bg-gray-200 cursor-pointer w-full p-1 sm:p-3",{"bg-gray-200":x(s).editingTemplate==="options"}]),onClick:m[2]||(m[2]=g=>u("options"))}," Options ",2),b("div",MI$1,[b("button",{class:"mt-3 bg-black text-white p-2 hover:bg-gray-800 rounded-md mx-1 w-full sm:w-4/5",onClick:m[3]||(m[3]=g=>u("preview"))}," Preview ")])]))}}),kI$1=b("h1",{class:"text-2xl font-semibold"},"Starting Fixtures",-1),FI$1=b("p",{class:"mt-5"},"Comma separated fixture IDs:",-1),UI$1=["value"],jI$1=Ee({__name:"starting-fixtures",setup(r){const o=Un$1(),s=$e(o.startingFixtures?.join(",")??""),a=l=>{s.value=l.target.value,o.startingFixtures=s.value===""?[]:s.value.split(",").map(c=>c.trim())};return(l,c)=>(H(),ae("div",null,[kI$1,FI$1,b("input",{"aria-label":"Starting Fixtures",class:"mt-2 border-2 border-black p-3 w-full sm:w-[500px]",value:s.value,onInput:a},null,40,UI$1)]))}}),BI$1=["content","aria-label"],HI$1=b("svg",{class:"fill-current w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[b("path",{d:"M0 0h24v24H0z",fill:"none"}),b("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"})],-1),WI$1=[HI$1],X=Ee({__name:"input-header",props:{title:{type:String,required:!0},description:{type:String,required:!1},required:{type:Boolean,required:!1},type:{type:String,required:!1}},setup(r){return(o,s)=>{const a=Wc$1("tippy");return H(),ae("div",{class:yt$1(["flex items-center",{"mb-1":r.type!=="checkbox"&&r.type!=="header","h-full":r.type==="checkbox"||r.type==="header"}])},[b("p",{class:yt$1(["mr-2",{required:r.required,"text-lg":r.type==="header"}])},Ct(r.title),3),r.description?Q((H(),ae("button",{key:0,content:r.description,"aria-label":r.description,onClick:s[0]||(s[0]=nn$1(()=>{},["stop"]))},WI$1,8,BI$1)),[[a,{placement:"top",trigger:"click focus"}]]):xe("",!0)],2)}}}),GI$1=["aria-label"],KI$1=b("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1),YI$1=[KI$1],XI$1={key:0},zI$1=b("hr",{class:"border-solid border-t border-gray-300 my-2"},null,-1),JI$1={class:"mt-4"},Ae=Ee({__name:"collapsible",props:["title","description","thickBorder","required"],setup(r){const o=$e(!1),s=$e();return(a,l)=>(H(),ae("div",{class:yt$1(["mt-4 p-3 border-black rounded-md",{"border-2":r.thickBorder,border:!r.thickBorder}]),ref_key:"el",ref:s},[b("div",{class:"flex items-center cursor-pointer",onClick:l[0]||(l[0]=()=>{o.value=!o.value,o.value?s.value?.querySelector(".arrow")?.classList.add("rotate-180"):s.value?.querySelector(".arrow")?.classList.remove("rotate-180")})},[Qi$1(a.$slots,"header",{},()=>[b("button",{class:"mr-1 sm:mr-3","aria-label":o.value?"Collapse":"Expand"},[(H(),ae("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 24 24",width:"20",class:yt$1({"rotate-180":o.value})},YI$1,2))],8,GI$1),A(X,{title:r.title,description:r.description,type:"header",required:r.required},null,8,["title","description","required"])])]),o.value?(H(),ae("div",XI$1,[zI$1,b("div",JI$1,[Qi$1(a.$slots,"default")])])):xe("",!0)],2))}});var QI$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function XE$1(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function zE$1(r){if(r.__esModule)return r;var o=r.default;if(typeof o=="function"){var s=function a(){return this instanceof a?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};s.prototype=o.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(r).forEach(function(a){var l=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(s,a,l.get?l:{enumerable:!0,get:function(){return r[a]}})}),s}var JE$1={exports:{}};const qI$1=zE$1(CT$1);/**! - * Sortable 1.14.0 - * @author RubaXa - * @author owenm - * @license MIT - */function tg$1(r,o){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),s.push.apply(s,a)}return s}function Lr$1(r){for(var o=1;o=0)&&(s[l]=r[l]);return s}function tC$1(r,o){if(r==null)return{};var s=eC$1(r,o),a,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(r,a)&&(s[a]=r[a])}return s}function nC$1(r){return rC$1(r)||oC$1(r)||iC$1(r)||sC$1()}function rC$1(r){if(Array.isArray(r))return Xd$1(r)}function oC$1(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function iC$1(r,o){if(r){if(typeof r=="string")return Xd$1(r,o);var s=Object.prototype.toString.call(r).slice(8,-1);if(s==="Object"&&r.constructor&&(s=r.constructor.name),s==="Map"||s==="Set")return Array.from(r);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return Xd$1(r,o)}}function Xd$1(r,o){(o==null||o>r.length)&&(o=r.length);for(var s=0,a=new Array(o);s"&&(o=o.substring(1)),r)try{if(r.matches)return r.matches(o);if(r.msMatchesSelector)return r.msMatchesSelector(o);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(o)}catch{return!1}return!1}}function cC$1(r){return r.host&&r!==document&&r.host.nodeType?r.host:r.parentNode}function lr$1(r,o,s,a){if(r){s=s||document;do{if(o!=null&&(o[0]===">"?r.parentNode===s&&Oc$1(r,o):Oc$1(r,o))||a&&r===s)return r;if(r===s)break}while(r=cC$1(r))}return null}var rg$1=/\s+/g;function It$1(r,o,s){if(r&&o)if(r.classList)r.classList[s?"add":"remove"](o);else{var a=(" "+r.className+" ").replace(rg$1," ").replace(" "+o+" "," ");r.className=(a+(s?" "+o:"")).replace(rg$1," ")}}function Se(r,o,s){var a=r&&r.style;if(a){if(s===void 0)return document.defaultView&&document.defaultView.getComputedStyle?s=document.defaultView.getComputedStyle(r,""):r.currentStyle&&(s=r.currentStyle),o===void 0?s:s[o];!(o in a)&&o.indexOf("webkit")===-1&&(o="-webkit-"+o),a[o]=s+(typeof s=="string"?"":"px")}}function fi$1(r,o){var s="";if(typeof r=="string")s=r;else do{var a=Se(r,"transform");a&&a!=="none"&&(s=a+" "+s)}while(!o&&(r=r.parentNode));var l=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return l&&new l(s)}function ZE$1(r,o,s){if(r){var a=r.getElementsByTagName(o),l=0,c=a.length;if(s)for(;l=c,!u)return a;if(a===Vr$1())break;a=To$1(a,!1)}return!1}function ls$1(r,o,s,a){for(var l=0,c=0,u=r.children;c2&&arguments[2]!==void 0?arguments[2]:{},a=s.evt,l=tC$1(s,gC$1);za$1.pluginEvent.bind(Re$2)(r,o,Lr$1({dragEl:pe,parentEl:Dt,ghostEl:Ke,rootEl:Ot$1,nextEl:Qo$1,lastDownEl:Fl$1,cloneEl:At$1,cloneHidden:_o$1,dragStarted:Ls$1,putSortable:en$1,activeSortable:Re$2.active,originalEvent:a,oldIndex:Bi$1,oldDraggableIndex:zs$1,newIndex:Mn$1,newDraggableIndex:vo$1,hideGhostForTarget:i_$1,unhideGhostForTarget:s_$1,cloneNowHidden:function(){_o$1=!0},cloneNowShown:function(){_o$1=!1},dispatchSortableEvent:function(c){gn({sortable:o,name:c,originalEvent:a})}},l))};function gn(r){As(Lr$1({putSortable:en$1,cloneEl:At$1,targetEl:pe,rootEl:Ot$1,oldIndex:Bi$1,oldDraggableIndex:zs$1,newIndex:Mn$1,newDraggableIndex:vo$1},r))}var pe,Dt,Ke,Ot$1,Qo$1,Fl$1,At$1,_o$1,Bi$1,Mn$1,zs$1,vo$1,hl$1,en$1,Fi$1=!1,Nc$1=!1,Sc$1=[],Yo,ir$1,Fu$1,Uu$1,ag$1,lg$2,Ls$1,Ri$1,Js$1,Qs=!1,gl$2=!1,Ul$1,an$1,ju$1=[],zd$1=!1,Tc$1=[],cu$1=typeof document<"u",vl$1=QE$1,cg$1=Xa$1||so$1?"cssFloat":"float",vC$1=cu$1&&!lC$1&&!QE$1&&"draggable"in document.createElement("div"),n_$1=function(){if(cu$1){if(so$1)return!1;var r=document.createElement("x");return r.style.cssText="pointer-events:auto",r.style.pointerEvents==="auto"}}(),r_$1=function(r,o){var s=Se(r),a=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),l=ls$1(r,0,o),c=ls$1(r,1,o),u=l&&Se(l),d=c&&Se(c),m=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+Tt(l).width,g=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+Tt(c).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(l&&u.float&&u.float!=="none"){var y=u.float==="left"?"left":"right";return c&&(d.clear==="both"||d.clear===y)?"vertical":"horizontal"}return l&&(u.display==="block"||u.display==="flex"||u.display==="table"||u.display==="grid"||m>=a&&s[cg$1]==="none"||c&&s[cg$1]==="none"&&m+g>a)?"vertical":"horizontal"},yC$1=function(r,o,s){var a=s?r.left:r.top,l=s?r.right:r.bottom,c=s?r.width:r.height,u=s?o.left:o.top,d=s?o.right:o.bottom,m=s?o.width:o.height;return a===u||l===d||a+c/2===u+m/2},bC$1=function(r,o){var s;return Sc$1.some(function(a){var l=a[dn].options.emptyInsertThreshold;if(!(!l||Fp$1(a))){var c=Tt(a),u=r>=c.left-l&&r<=c.right+l,d=o>=c.top-l&&o<=c.bottom+l;if(u&&d)return s=a}}),s},o_$1=function(r){function o(l,c){return function(u,d,m,g){var y=u.options.group.name&&d.options.group.name&&u.options.group.name===d.options.group.name;if(l==null&&(c||y))return!0;if(l==null||l===!1)return!1;if(c&&l==="clone")return l;if(typeof l=="function")return o(l(u,d,m,g),c)(u,d,m,g);var _=(c?u:d).options.group.name;return l===!0||typeof l=="string"&&l===_||l.join&&l.indexOf(_)>-1}}var s={},a=r.group;(!a||kl$1(a)!="object")&&(a={name:a}),s.name=a.name,s.checkPull=o(a.pull,!0),s.checkPut=o(a.put),s.revertClone=a.revertClone,r.group=s},i_$1=function(){!n_$1&&Ke&&Se(Ke,"display","none")},s_$1=function(){!n_$1&&Ke&&Se(Ke,"display","")};cu$1&&document.addEventListener("click",function(r){if(Nc$1)return r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.stopImmediatePropagation&&r.stopImmediatePropagation(),Nc$1=!1,!1},!0);var Xo$1=function(r){if(pe){r=r.touches?r.touches[0]:r;var o=bC$1(r.clientX,r.clientY);if(o){var s={};for(var a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);s.target=s.rootEl=o,s.preventDefault=void 0,s.stopPropagation=void 0,o[dn]._onDragOver(s)}}},EC$1=function(r){pe&&pe.parentNode[dn]._isOutsideThisEl(r.target)};function Re$2(r,o){if(!(r&&r.nodeType&&r.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(r));this.el=r,this.options=o=er$1({},o),r[dn]=this;var s={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(r.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return r_$1(r,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,u){c.setData("Text",u.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Re$2.supportPointer!==!1&&"PointerEvent"in window&&!Ys$1,emptyInsertThreshold:5};za$1.initializePlugins(this,r,s);for(var a in s)!(a in o)&&(o[a]=s[a]);o_$1(o);for(var l in this)l.charAt(0)==="_"&&typeof this[l]=="function"&&(this[l]=this[l].bind(this));this.nativeDraggable=o.forceFallback?!1:vC$1,this.nativeDraggable&&(this.options.touchStartThreshold=1),o.supportPointer?tt$2(r,"pointerdown",this._onTapStart):(tt$2(r,"mousedown",this._onTapStart),tt$2(r,"touchstart",this._onTapStart)),this.nativeDraggable&&(tt$2(r,"dragover",this),tt$2(r,"dragenter",this)),Sc$1.push(this.el),o.store&&o.store.get&&this.sort(o.store.get(this)||[]),er$1(this,pC$1())}Re$2.prototype={constructor:Re$2,_isOutsideThisEl:function(r){!this.el.contains(r)&&r!==this.el&&(Ri$1=null)},_getDirection:function(r,o){return typeof this.options.direction=="function"?this.options.direction.call(this,r,o,pe):this.options.direction},_onTapStart:function(r){if(r.cancelable){var o=this,s=this.el,a=this.options,l=a.preventOnFilter,c=r.type,u=r.touches&&r.touches[0]||r.pointerType&&r.pointerType==="touch"&&r,d=(u||r).target,m=r.target.shadowRoot&&(r.path&&r.path[0]||r.composedPath&&r.composedPath()[0])||d,g=a.filter;if(IC$1(s),!pe&&!(/mousedown|pointerdown/.test(c)&&r.button!==0||a.disabled)&&!m.isContentEditable&&!(!this.nativeDraggable&&Ys$1&&d&&d.tagName.toUpperCase()==="SELECT")&&(d=lr$1(d,a.draggable,s,!1),!(d&&d.animated)&&Fl$1!==d)){if(Bi$1=Lt$2(d),zs$1=Lt$2(d,a.draggable),typeof g=="function"){if(g.call(this,r,d,this)){gn({sortable:o,rootEl:m,name:"filter",targetEl:d,toEl:s,fromEl:s}),On$1("filter",o,{evt:r}),l&&r.cancelable&&r.preventDefault();return}}else if(g&&(g=g.split(",").some(function(y){if(y=lr$1(m,y.trim(),s,!1),y)return gn({sortable:o,rootEl:y,name:"filter",targetEl:d,fromEl:s,toEl:s}),On$1("filter",o,{evt:r}),!0}),g)){l&&r.cancelable&&r.preventDefault();return}a.handle&&!lr$1(m,a.handle,s,!1)||this._prepareDragStart(r,u,d)}}},_prepareDragStart:function(r,o,s){var a=this,l=a.el,c=a.options,u=l.ownerDocument,d;if(s&&!pe&&s.parentNode===l){var m=Tt(s);if(Ot$1=l,pe=s,Dt=pe.parentNode,Qo$1=pe.nextSibling,Fl$1=s,hl$1=c.group,Re$2.dragged=pe,Yo={target:pe,clientX:(o||r).clientX,clientY:(o||r).clientY},ag$1=Yo.clientX-m.left,lg$2=Yo.clientY-m.top,this._lastX=(o||r).clientX,this._lastY=(o||r).clientY,pe.style["will-change"]="all",d=function(){if(On$1("delayEnded",a,{evt:r}),Re$2.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!ng$1&&a.nativeDraggable&&(pe.draggable=!0),a._triggerDragStart(r,o),gn({sortable:a,name:"choose",originalEvent:r}),It$1(pe,c.chosenClass,!0)},c.ignore.split(",").forEach(function(g){ZE$1(pe,g.trim(),Bu$1)}),tt$2(u,"dragover",Xo$1),tt$2(u,"mousemove",Xo$1),tt$2(u,"touchmove",Xo$1),tt$2(u,"mouseup",a._onDrop),tt$2(u,"touchend",a._onDrop),tt$2(u,"touchcancel",a._onDrop),ng$1&&this.nativeDraggable&&(this.options.touchStartThreshold=4,pe.draggable=!0),On$1("delayStart",this,{evt:r}),c.delay&&(!c.delayOnTouchOnly||o)&&(!this.nativeDraggable||!(Xa$1||so$1))){if(Re$2.eventCanceled){this._onDrop();return}tt$2(u,"mouseup",a._disableDelayedDrag),tt$2(u,"touchend",a._disableDelayedDrag),tt$2(u,"touchcancel",a._disableDelayedDrag),tt$2(u,"mousemove",a._delayedDragTouchMoveHandler),tt$2(u,"touchmove",a._delayedDragTouchMoveHandler),c.supportPointer&&tt$2(u,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(d,c.delay)}else d()}},_delayedDragTouchMoveHandler:function(r){var o=r.touches?r.touches[0]:r;Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){pe&&Bu$1(pe),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var r=this.el.ownerDocument;qe(r,"mouseup",this._disableDelayedDrag),qe(r,"touchend",this._disableDelayedDrag),qe(r,"touchcancel",this._disableDelayedDrag),qe(r,"mousemove",this._delayedDragTouchMoveHandler),qe(r,"touchmove",this._delayedDragTouchMoveHandler),qe(r,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(r,o){o=o||r.pointerType=="touch"&&r,!this.nativeDraggable||o?this.options.supportPointer?tt$2(document,"pointermove",this._onTouchMove):o?tt$2(document,"touchmove",this._onTouchMove):tt$2(document,"mousemove",this._onTouchMove):(tt$2(pe,"dragend",this),tt$2(Ot$1,"dragstart",this._onDragStart));try{document.selection?jl$1(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(r,o){if(Fi$1=!1,Ot$1&&pe){On$1("dragStarted",this,{evt:o}),this.nativeDraggable&&tt$2(document,"dragover",EC$1);var s=this.options;!r&&It$1(pe,s.dragClass,!1),It$1(pe,s.ghostClass,!0),Re$2.active=this,r&&this._appendGhost(),gn({sortable:this,name:"start",originalEvent:o})}else this._nulling()},_emulateDragOver:function(){if(ir$1){this._lastX=ir$1.clientX,this._lastY=ir$1.clientY,i_$1();for(var r=document.elementFromPoint(ir$1.clientX,ir$1.clientY),o=r;r&&r.shadowRoot&&(r=r.shadowRoot.elementFromPoint(ir$1.clientX,ir$1.clientY),r!==o);)o=r;if(pe.parentNode[dn]._isOutsideThisEl(r),o)do{if(o[dn]){var s=void 0;if(s=o[dn]._onDragOver({clientX:ir$1.clientX,clientY:ir$1.clientY,target:r,rootEl:o}),s&&!this.options.dragoverBubble)break}r=o}while(o=o.parentNode);s_$1()}},_onTouchMove:function(r){if(Yo){var o=this.options,s=o.fallbackTolerance,a=o.fallbackOffset,l=r.touches?r.touches[0]:r,c=Ke&&fi$1(Ke,!0),u=Ke&&c&&c.a,d=Ke&&c&&c.d,m=vl$1&&an$1&&ig$1(an$1),g=(l.clientX-Yo.clientX+a.x)/(u||1)+(m?m[0]-ju$1[0]:0)/(u||1),y=(l.clientY-Yo.clientY+a.y)/(d||1)+(m?m[1]-ju$1[1]:0)/(d||1);if(!Re$2.active&&!Fi$1){if(s&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))=0&&(gn({rootEl:Dt,name:"add",toEl:Dt,fromEl:Ot$1,originalEvent:r}),gn({sortable:this,name:"remove",toEl:Dt,originalEvent:r}),gn({rootEl:Dt,name:"sort",toEl:Dt,fromEl:Ot$1,originalEvent:r}),gn({sortable:this,name:"sort",toEl:Dt,originalEvent:r})),en$1&&en$1.save()):Mn$1!==Bi$1&&Mn$1>=0&&(gn({sortable:this,name:"update",toEl:Dt,originalEvent:r}),gn({sortable:this,name:"sort",toEl:Dt,originalEvent:r})),Re$2.active&&((Mn$1==null||Mn$1===-1)&&(Mn$1=Bi$1,vo$1=zs$1),gn({sortable:this,name:"end",toEl:Dt,originalEvent:r}),this.save()))),this._nulling()},_nulling:function(){On$1("nulling",this),Ot$1=pe=Dt=Ke=Qo$1=At$1=Fl$1=_o$1=Yo=ir$1=Ls$1=Mn$1=vo$1=Bi$1=zs$1=Ri$1=Js$1=en$1=hl$1=Re$2.dragged=Re$2.ghost=Re$2.clone=Re$2.active=null,Tc$1.forEach(function(r){r.checked=!0}),Tc$1.length=Fu$1=Uu$1=0},handleEvent:function(r){switch(r.type){case"drop":case"dragend":this._onDrop(r);break;case"dragenter":case"dragover":pe&&(this._onDragOver(r),_C$1(r));break;case"selectstart":r.preventDefault();break}},toArray:function(){for(var r=[],o,s=this.el.children,a=0,l=s.length,c=this.options;aa.right+l||r.clientX<=a.right&&r.clientY>a.bottom&&r.clientX>=a.left:r.clientX>a.right&&r.clientY>a.top||r.clientX<=a.right&&r.clientY>a.bottom+l}function TC$1(r,o,s,a,l,c,u,d){var m=a?r.clientY:r.clientX,g=a?s.height:s.width,y=a?s.top:s.left,_=a?s.bottom:s.right,E=!1;if(!u){if(d&&Ul$1y+g*c/2:m<_-g*c/2)&&(Qs=!0),Qs)E=!0;else if(Js$1===1?m_-Ul$1)return-Js$1}else if(m>y+g*(1-l)/2&&m<_-g*(1-l)/2)return xC$1(o)}return E=E||u,E&&(m_-g*c/2)?m>y+g/2?1:-1:0}function xC$1(r){return Lt$2(pe)1&&(je$1.forEach(function(u){l.addAnimationState({target:u,rect:Nn$1?Tt(u):c}),$u$1(u),u.fromRect=c,s.removeAnimationState(u)}),Nn$1=!1,LC$1(!this.options.removeCloneOnHide,a))},dragOverCompleted:function(o){var s=o.sortable,a=o.isOwner,l=o.insertion,c=o.activeSortable,u=o.parentEl,d=o.putSortable,m=this.options;if(l){if(a&&c._hideClone(),Ts=!1,m.animation&&je$1.length>1&&(Nn$1||!a&&!c.options.sort&&!d)){var g=Tt(gt$2,!1,!0,!0);je$1.forEach(function(_){_!==gt$2&&(sg$1(_,g),u.appendChild(_))}),Nn$1=!0}if(!a)if(Nn$1||El$1(),je$1.length>1){var y=bl$1;c._showClone(s),c.options.animation&&!bl$1&&y&&Rn$1.forEach(function(_){c.addAnimationState({target:_,rect:xs$1}),_.fromRect=xs$1,_.thisAnimationDuration=null})}else c._showClone(s)}},dragOverAnimationCapture:function(o){var s=o.dragRect,a=o.isOwner,l=o.activeSortable;if(je$1.forEach(function(u){u.thisAnimationDuration=null}),l.options.animation&&!a&&l.multiDrag.isMultiDrag){xs$1=er$1({},s);var c=fi$1(gt$2,!0);xs$1.top-=c.f,xs$1.left-=c.e}},dragOverAnimationComplete:function(){Nn$1&&(Nn$1=!1,El$1())},drop:function(o){var s=o.originalEvent,a=o.rootEl,l=o.parentEl,c=o.sortable,u=o.dispatchSortableEvent,d=o.oldIndex,m=o.putSortable,g=m||this.sortable;if(s){var y=this.options,_=l.children;if(!Mi$1)if(y.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),It$1(gt$2,y.selectedClass,!~je$1.indexOf(gt$2)),~je$1.indexOf(gt$2))je$1.splice(je$1.indexOf(gt$2),1),Ss=null,As({sortable:c,rootEl:a,name:"deselect",targetEl:gt$2,originalEvt:s});else{if(je$1.push(gt$2),As({sortable:c,rootEl:a,name:"select",targetEl:gt$2,originalEvt:s}),s.shiftKey&&Ss&&c.el.contains(Ss)){var E=Lt$2(Ss),w=Lt$2(gt$2);if(~E&&~w&&E!==w){var T,k;for(w>E?(k=E,T=w):(k=w,T=E+1);k1){var O=Tt(gt$2),R=Lt$2(gt$2,":not(."+this.options.selectedClass+")");if(!Ts&&y.animation&&(gt$2.thisAnimationDuration=null),g.captureAnimationState(),!Ts&&(y.animation&&(gt$2.fromRect=O,je$1.forEach(function(N){if(N.thisAnimationDuration=null,N!==gt$2){var D=Nn$1?Tt(N):O;N.fromRect=D,g.addAnimationState({target:N,rect:D})}})),El$1(),je$1.forEach(function(N){_[R]?l.insertBefore(N,_[R]):l.appendChild(N),R++}),d===Lt$2(gt$2))){var M=!1;je$1.forEach(function(N){if(N.sortableIndex!==Lt$2(N)){M=!0;return}}),M&&u("update")}je$1.forEach(function(N){$u$1(N)}),g.animateAll()}sr$1=g}(a===l||m&&m.lastPutMode!=="clone")&&Rn$1.forEach(function(N){N.parentNode&&N.parentNode.removeChild(N)})}},nullingGlobal:function(){this.isMultiDrag=Mi$1=!1,Rn$1.length=0},destroyGlobal:function(){this._deselectMultiDrag(),qe(document,"pointerup",this._deselectMultiDrag),qe(document,"mouseup",this._deselectMultiDrag),qe(document,"touchend",this._deselectMultiDrag),qe(document,"keydown",this._checkKeyDown),qe(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(o){if(!(typeof Mi$1<"u"&&Mi$1)&&sr$1===this.sortable&&!(o&&lr$1(o.target,this.options.draggable,this.sortable.el,!1))&&!(o&&o.button!==0))for(;je$1.length;){var s=je$1[0];It$1(s,this.options.selectedClass,!1),je$1.shift(),As({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:s,originalEvt:o})}},_checkKeyDown:function(o){o.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(o){o.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},er$1(r,{pluginName:"multiDrag",utils:{select:function(o){var s=o.parentNode[dn];!s||!s.options.multiDrag||~je$1.indexOf(o)||(sr$1&&sr$1!==s&&(sr$1.multiDrag._deselectMultiDrag(),sr$1=s),It$1(o,s.options.selectedClass,!0),je$1.push(o))},deselect:function(o){var s=o.parentNode[dn],a=je$1.indexOf(o);!s||!s.options.multiDrag||!~a||(It$1(o,s.options.selectedClass,!1),je$1.splice(a,1))}},eventProperties:function(){var o=this,s=[],a=[];return je$1.forEach(function(l){s.push({multiDragElement:l,index:l.sortableIndex});var c;Nn$1&&l!==gt$2?c=-1:Nn$1?c=Lt$2(l,":not(."+o.options.selectedClass+")"):c=Lt$2(l),a.push({multiDragElement:l,index:c})}),{items:nC$1(je$1),clones:[].concat(Rn$1),oldIndicies:s,newIndicies:a}},optionListeners:{multiDragKey:function(o){return o=o.toLowerCase(),o==="ctrl"?o="Control":o.length>1&&(o=o.charAt(0).toUpperCase()+o.substr(1)),o}}})}function LC$1(r,o){je$1.forEach(function(s,a){var l=o.children[s.sortableIndex+(r?Number(a):0)];l?o.insertBefore(s,l):o.appendChild(s)})}function dg$1(r,o){Rn$1.forEach(function(s,a){var l=o.children[s.sortableIndex+(r?Number(a):0)];l?o.insertBefore(s,l):o.appendChild(s)})}function El$1(){je$1.forEach(function(r){r!==gt$2&&r.parentNode&&r.parentNode.removeChild(r)})}Re$2.mount(new CC$1);Re$2.mount(Bp$1,jp$1);const PC$1=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:AC$1,Sortable:Re$2,Swap:VC$1,default:Re$2},Symbol.toStringTag,{value:"Module"})),RC$1=zE$1(PC$1);(function(r,o){(function(s,a){r.exports=a(qI$1,RC$1)})(typeof self<"u"?self:QI$1,function(s,a){return function(l){var c={};function u(d){if(c[d])return c[d].exports;var m=c[d]={i:d,l:!1,exports:{}};return l[d].call(m.exports,m,m.exports,u),m.l=!0,m.exports}return u.m=l,u.c=c,u.d=function(d,m,g){u.o(d,m)||Object.defineProperty(d,m,{enumerable:!0,get:g})},u.r=function(d){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},u.t=function(d,m){if(m&1&&(d=u(d)),m&8||m&4&&typeof d=="object"&&d&&d.__esModule)return d;var g=Object.create(null);if(u.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:d}),m&2&&typeof d!="string")for(var y in d)u.d(g,y,function(_){return d[_]}.bind(null,y));return g},u.n=function(d){var m=d&&d.__esModule?function(){return d.default}:function(){return d};return u.d(m,"a",m),m},u.o=function(d,m){return Object.prototype.hasOwnProperty.call(d,m)},u.p="",u(u.s="fb15")}({"00ee":function(l,c,u){var d=u("b622"),m=d("toStringTag"),g={};g[m]="z",l.exports=String(g)==="[object z]"},"0366":function(l,c,u){var d=u("1c0b");l.exports=function(m,g,y){if(d(m),g===void 0)return m;switch(y){case 0:return function(){return m.call(g)};case 1:return function(_){return m.call(g,_)};case 2:return function(_,E){return m.call(g,_,E)};case 3:return function(_,E,w){return m.call(g,_,E,w)}}return function(){return m.apply(g,arguments)}}},"057f":function(l,c,u){var d=u("fc6a"),m=u("241c").f,g={}.toString,y=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],_=function(E){try{return m(E)}catch{return y.slice()}};l.exports.f=function(E){return y&&g.call(E)=="[object Window]"?_(E):m(d(E))}},"06cf":function(l,c,u){var d=u("83ab"),m=u("d1e7"),g=u("5c6c"),y=u("fc6a"),_=u("c04e"),E=u("5135"),w=u("0cfb"),T=Object.getOwnPropertyDescriptor;c.f=d?T:function(k,O){if(k=y(k),O=_(O,!0),w)try{return T(k,O)}catch{}if(E(k,O))return g(!m.f.call(k,O),k[O])}},"0cfb":function(l,c,u){var d=u("83ab"),m=u("d039"),g=u("cc12");l.exports=!d&&!m(function(){return Object.defineProperty(g("div"),"a",{get:function(){return 7}}).a!=7})},"13d5":function(l,c,u){var d=u("23e7"),m=u("d58f").left,g=u("a640"),y=u("ae40"),_=g("reduce"),E=y("reduce",{1:0});d({target:"Array",proto:!0,forced:!_||!E},{reduce:function(w){return m(this,w,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(l,c,u){var d=u("c6b6"),m=u("9263");l.exports=function(g,y){var _=g.exec;if(typeof _=="function"){var E=_.call(g,y);if(typeof E!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return E}if(d(g)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return m.call(g,y)}},"159b":function(l,c,u){var d=u("da84"),m=u("fdbc"),g=u("17c2"),y=u("9112");for(var _ in m){var E=d[_],w=E&&E.prototype;if(w&&w.forEach!==g)try{y(w,"forEach",g)}catch{w.forEach=g}}},"17c2":function(l,c,u){var d=u("b727").forEach,m=u("a640"),g=u("ae40"),y=m("forEach"),_=g("forEach");l.exports=!y||!_?function(E){return d(this,E,arguments.length>1?arguments[1]:void 0)}:[].forEach},"1be4":function(l,c,u){var d=u("d066");l.exports=d("document","documentElement")},"1c0b":function(l,c){l.exports=function(u){if(typeof u!="function")throw TypeError(String(u)+" is not a function");return u}},"1c7e":function(l,c,u){var d=u("b622"),m=d("iterator"),g=!1;try{var y=0,_={next:function(){return{done:!!y++}},return:function(){g=!0}};_[m]=function(){return this},Array.from(_,function(){throw 2})}catch{}l.exports=function(E,w){if(!w&&!g)return!1;var T=!1;try{var k={};k[m]=function(){return{next:function(){return{done:T=!0}}}},E(k)}catch{}return T}},"1d80":function(l,c){l.exports=function(u){if(u==null)throw TypeError("Can't call method on "+u);return u}},"1dde":function(l,c,u){var d=u("d039"),m=u("b622"),g=u("2d00"),y=m("species");l.exports=function(_){return g>=51||!d(function(){var E=[],w=E.constructor={};return w[y]=function(){return{foo:1}},E[_](Boolean).foo!==1})}},"23cb":function(l,c,u){var d=u("a691"),m=Math.max,g=Math.min;l.exports=function(y,_){var E=d(y);return E<0?m(E+_,0):g(E,_)}},"23e7":function(l,c,u){var d=u("da84"),m=u("06cf").f,g=u("9112"),y=u("6eeb"),_=u("ce4e"),E=u("e893"),w=u("94ca");l.exports=function(T,k){var O=T.target,R=T.global,M=T.stat,N,D,P,I,L,F;if(R?D=d:M?D=d[O]||_(O,{}):D=(d[O]||{}).prototype,D)for(P in k){if(L=k[P],T.noTargetGet?(F=m(D,P),I=F&&F.value):I=D[P],N=w(R?P:O+(M?".":"#")+P,T.forced),!N&&I!==void 0){if(typeof L==typeof I)continue;E(L,I)}(T.sham||I&&I.sham)&&g(L,"sham",!0),y(D,P,L,T)}}},"241c":function(l,c,u){var d=u("ca84"),m=u("7839"),g=m.concat("length","prototype");c.f=Object.getOwnPropertyNames||function(y){return d(y,g)}},"25f0":function(l,c,u){var d=u("6eeb"),m=u("825a"),g=u("d039"),y=u("ad6d"),_="toString",E=RegExp.prototype,w=E[_],T=g(function(){return w.call({source:"a",flags:"b"})!="/a/b"}),k=w.name!=_;(T||k)&&d(RegExp.prototype,_,function(){var O=m(this),R=String(O.source),M=O.flags,N=String(M===void 0&&O instanceof RegExp&&!("flags"in E)?y.call(O):M);return"/"+R+"/"+N},{unsafe:!0})},"2ca0":function(l,c,u){var d=u("23e7"),m=u("06cf").f,g=u("50c4"),y=u("5a34"),_=u("1d80"),E=u("ab13"),w=u("c430"),T="".startsWith,k=Math.min,O=E("startsWith"),R=!w&&!O&&!!function(){var M=m(String.prototype,"startsWith");return M&&!M.writable}();d({target:"String",proto:!0,forced:!R&&!O},{startsWith:function(M){var N=String(_(this));y(M);var D=g(k(arguments.length>1?arguments[1]:void 0,N.length)),P=String(M);return T?T.call(N,P,D):N.slice(D,D+P.length)===P}})},"2d00":function(l,c,u){var d=u("da84"),m=u("342f"),g=d.process,y=g&&g.versions,_=y&&y.v8,E,w;_?(E=_.split("."),w=E[0]+E[1]):m&&(E=m.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=m.match(/Chrome\/(\d+)/),E&&(w=E[1]))),l.exports=w&&+w},"342f":function(l,c,u){var d=u("d066");l.exports=d("navigator","userAgent")||""},"35a1":function(l,c,u){var d=u("f5df"),m=u("3f8c"),g=u("b622"),y=g("iterator");l.exports=function(_){if(_!=null)return _[y]||_["@@iterator"]||m[d(_)]}},"37e8":function(l,c,u){var d=u("83ab"),m=u("9bf2"),g=u("825a"),y=u("df75");l.exports=d?Object.defineProperties:function(_,E){g(_);for(var w=y(E),T=w.length,k=0,O;T>k;)m.f(_,O=w[k++],E[O]);return _}},"3bbe":function(l,c,u){var d=u("861d");l.exports=function(m){if(!d(m)&&m!==null)throw TypeError("Can't set "+String(m)+" as a prototype");return m}},"3ca3":function(l,c,u){var d=u("6547").charAt,m=u("69f3"),g=u("7dd0"),y="String Iterator",_=m.set,E=m.getterFor(y);g(String,"String",function(w){_(this,{type:y,string:String(w),index:0})},function(){var w=E(this),T=w.string,k=w.index,O;return k>=T.length?{value:void 0,done:!0}:(O=d(T,k),w.index+=O.length,{value:O,done:!1})})},"3f8c":function(l,c){l.exports={}},4160:function(l,c,u){var d=u("23e7"),m=u("17c2");d({target:"Array",proto:!0,forced:[].forEach!=m},{forEach:m})},"428f":function(l,c,u){var d=u("da84");l.exports=d},"44ad":function(l,c,u){var d=u("d039"),m=u("c6b6"),g="".split;l.exports=d(function(){return!Object("z").propertyIsEnumerable(0)})?function(y){return m(y)=="String"?g.call(y,""):Object(y)}:Object},"44d2":function(l,c,u){var d=u("b622"),m=u("7c73"),g=u("9bf2"),y=d("unscopables"),_=Array.prototype;_[y]==null&&g.f(_,y,{configurable:!0,value:m(null)}),l.exports=function(E){_[y][E]=!0}},"44e7":function(l,c,u){var d=u("861d"),m=u("c6b6"),g=u("b622"),y=g("match");l.exports=function(_){var E;return d(_)&&((E=_[y])!==void 0?!!E:m(_)=="RegExp")}},4930:function(l,c,u){var d=u("d039");l.exports=!!Object.getOwnPropertySymbols&&!d(function(){return!String(Symbol())})},"4d64":function(l,c,u){var d=u("fc6a"),m=u("50c4"),g=u("23cb"),y=function(_){return function(E,w,T){var k=d(E),O=m(k.length),R=g(T,O),M;if(_&&w!=w){for(;O>R;)if(M=k[R++],M!=M)return!0}else for(;O>R;R++)if((_||R in k)&&k[R]===w)return _||R||0;return!_&&-1}};l.exports={includes:y(!0),indexOf:y(!1)}},"4de4":function(l,c,u){var d=u("23e7"),m=u("b727").filter,g=u("1dde"),y=u("ae40"),_=g("filter"),E=y("filter");d({target:"Array",proto:!0,forced:!_||!E},{filter:function(w){return m(this,w,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(l,c,u){var d=u("0366"),m=u("7b0b"),g=u("9bdd"),y=u("e95a"),_=u("50c4"),E=u("8418"),w=u("35a1");l.exports=function(T){var k=m(T),O=typeof this=="function"?this:Array,R=arguments.length,M=R>1?arguments[1]:void 0,N=M!==void 0,D=w(k),P=0,I,L,F,U,J,z;if(N&&(M=d(M,R>2?arguments[2]:void 0,2)),D!=null&&!(O==Array&&y(D)))for(U=D.call(k),J=U.next,L=new O;!(F=J.call(U)).done;P++)z=N?g(U,M,[F.value,P],!0):F.value,E(L,P,z);else for(I=_(k.length),L=new O(I);I>P;P++)z=N?M(k[P],P):k[P],E(L,P,z);return L.length=P,L}},"4fad":function(l,c,u){var d=u("23e7"),m=u("6f53").entries;d({target:"Object",stat:!0},{entries:function(g){return m(g)}})},"50c4":function(l,c,u){var d=u("a691"),m=Math.min;l.exports=function(g){return g>0?m(d(g),9007199254740991):0}},5135:function(l,c){var u={}.hasOwnProperty;l.exports=function(d,m){return u.call(d,m)}},5319:function(l,c,u){var d=u("d784"),m=u("825a"),g=u("7b0b"),y=u("50c4"),_=u("a691"),E=u("1d80"),w=u("8aa5"),T=u("14c3"),k=Math.max,O=Math.min,R=Math.floor,M=/\$([$&'`]|\d\d?|<[^>]*>)/g,N=/\$([$&'`]|\d\d?)/g,D=function(P){return P===void 0?P:String(P)};d("replace",2,function(P,I,L,F){var U=F.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,J=F.REPLACE_KEEPS_$0,z=U?"$":"$0";return[function(ce,Y){var B=E(this),V=ce?.[P];return V!==void 0?V.call(ce,B,Y):I.call(String(B),ce,Y)},function(ce,Y){if(!U&&J||typeof Y=="string"&&Y.indexOf(z)===-1){var B=L(I,ce,this,Y);if(B.done)return B.value}var V=m(ce),Ge=String(this),St=typeof Y=="function";St||(Y=String(Y));var Dee=V.global;if(Dee){var pee=V.unicode;V.lastIndex=0}for(var jr=[];;){var Tee=T(V,Ge);if(Tee===null||(jr.push(Tee),!Dee))break;var et=String(Tee[0]);et===""&&(V.lastIndex=w(Ge,y(V.lastIndex),pee))}for(var ft="",yee=0,ete=0;ete=yee&&(ft+=Ge.slice(yee,Ote)+_ee,yee=Ote+xte.length)}return ft+Ge.slice(yee)}];function ie(ce,Y,B,V,Ge,St){var Dee=B+ce.length,pee=V.length,jr=N;return Ge!==void 0&&(Ge=g(Ge),jr=M),I.call(St,jr,function(Tee,et){var ft;switch(et.charAt(0)){case"$":return"$";case"&":return ce;case"`":return Y.slice(0,B);case"'":return Y.slice(Dee);case"<":ft=Ge[et.slice(1,-1)];break;default:var yee=+et;if(yee===0)return Tee;if(yee>pee){var ete=R(yee/10);return ete===0?Tee:ete<=pee?V[ete-1]===void 0?et.charAt(1):V[ete-1]+et.charAt(1):Tee}ft=V[yee-1]}return ft===void 0?"":ft})}})},5692:function(l,c,u){var d=u("c430"),m=u("c6cd");(l.exports=function(g,y){return m[g]||(m[g]=y!==void 0?y:{})})("versions",[]).push({version:"3.6.5",mode:d?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(l,c,u){var d=u("d066"),m=u("241c"),g=u("7418"),y=u("825a");l.exports=d("Reflect","ownKeys")||function(_){var E=m.f(y(_)),w=g.f;return w?E.concat(w(_)):E}},"5a34":function(l,c,u){var d=u("44e7");l.exports=function(m){if(d(m))throw TypeError("The method doesn't accept regular expressions");return m}},"5c6c":function(l,c){l.exports=function(u,d){return{enumerable:!(u&1),configurable:!(u&2),writable:!(u&4),value:d}}},"5db7":function(l,c,u){var d=u("23e7"),m=u("a2bf"),g=u("7b0b"),y=u("50c4"),_=u("1c0b"),E=u("65f0");d({target:"Array",proto:!0},{flatMap:function(w){var T=g(this),k=y(T.length),O;return _(w),O=E(T,0),O.length=m(O,T,T,k,0,1,w,arguments.length>1?arguments[1]:void 0),O}})},6547:function(l,c,u){var d=u("a691"),m=u("1d80"),g=function(y){return function(_,E){var w=String(m(_)),T=d(E),k=w.length,O,R;return T<0||T>=k?y?"":void 0:(O=w.charCodeAt(T),O<55296||O>56319||T+1===k||(R=w.charCodeAt(T+1))<56320||R>57343?y?w.charAt(T):O:y?w.slice(T,T+2):(O-55296<<10)+(R-56320)+65536)}};l.exports={codeAt:g(!1),charAt:g(!0)}},"65f0":function(l,c,u){var d=u("861d"),m=u("e8b5"),g=u("b622"),y=g("species");l.exports=function(_,E){var w;return m(_)&&(w=_.constructor,typeof w=="function"&&(w===Array||m(w.prototype))?w=void 0:d(w)&&(w=w[y],w===null&&(w=void 0))),new(w===void 0?Array:w)(E===0?0:E)}},"69f3":function(l,c,u){var d=u("7f9a"),m=u("da84"),g=u("861d"),y=u("9112"),_=u("5135"),E=u("f772"),w=u("d012"),T=m.WeakMap,k,O,R,M=function(U){return R(U)?O(U):k(U,{})},N=function(U){return function(J){var z;if(!g(J)||(z=O(J)).type!==U)throw TypeError("Incompatible receiver, "+U+" required");return z}};if(d){var D=new T,P=D.get,I=D.has,L=D.set;k=function(U,J){return L.call(D,U,J),J},O=function(U){return P.call(D,U)||{}},R=function(U){return I.call(D,U)}}else{var F=E("state");w[F]=!0,k=function(U,J){return y(U,F,J),J},O=function(U){return _(U,F)?U[F]:{}},R=function(U){return _(U,F)}}l.exports={set:k,get:O,has:R,enforce:M,getterFor:N}},"6eeb":function(l,c,u){var d=u("da84"),m=u("9112"),g=u("5135"),y=u("ce4e"),_=u("8925"),E=u("69f3"),w=E.get,T=E.enforce,k=String(String).split("String");(l.exports=function(O,R,M,N){var D=N?!!N.unsafe:!1,P=N?!!N.enumerable:!1,I=N?!!N.noTargetGet:!1;if(typeof M=="function"&&(typeof R=="string"&&!g(M,"name")&&m(M,"name",R),T(M).source=k.join(typeof R=="string"?R:"")),O===d){P?O[R]=M:y(R,M);return}else D?!I&&O[R]&&(P=!0):delete O[R];P?O[R]=M:m(O,R,M)})(Function.prototype,"toString",function(){return typeof this=="function"&&w(this).source||_(this)})},"6f53":function(l,c,u){var d=u("83ab"),m=u("df75"),g=u("fc6a"),y=u("d1e7").f,_=function(E){return function(w){for(var T=g(w),k=m(T),O=k.length,R=0,M=[],N;O>R;)N=k[R++],(!d||y.call(T,N))&&M.push(E?[N,T[N]]:T[N]);return M}};l.exports={entries:_(!0),values:_(!1)}},"73d9":function(l,c,u){var d=u("44d2");d("flatMap")},7418:function(l,c){c.f=Object.getOwnPropertySymbols},"746f":function(l,c,u){var d=u("428f"),m=u("5135"),g=u("e538"),y=u("9bf2").f;l.exports=function(_){var E=d.Symbol||(d.Symbol={});m(E,_)||y(E,_,{value:g.f(_)})}},7839:function(l,c){l.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(l,c,u){var d=u("1d80");l.exports=function(m){return Object(d(m))}},"7c73":function(l,c,u){var d=u("825a"),m=u("37e8"),g=u("7839"),y=u("d012"),_=u("1be4"),E=u("cc12"),w=u("f772"),T=">",k="<",O="prototype",R="script",M=w("IE_PROTO"),N=function(){},D=function(U){return k+R+T+U+k+"/"+R+T},P=function(U){U.write(D("")),U.close();var J=U.parentWindow.Object;return U=null,J},I=function(){var U=E("iframe"),J="java"+R+":",z;return U.style.display="none",_.appendChild(U),U.src=String(J),z=U.contentWindow.document,z.open(),z.write(D("document.F=Object")),z.close(),z.F},L,F=function(){try{L=document.domain&&new ActiveXObject("htmlfile")}catch{}F=L?P(L):I();for(var U=g.length;U--;)delete F[O][g[U]];return F()};y[M]=!0,l.exports=Object.create||function(U,J){var z;return U!==null?(N[O]=d(U),z=new N,N[O]=null,z[M]=U):z=F(),J===void 0?z:m(z,J)}},"7dd0":function(l,c,u){var d=u("23e7"),m=u("9ed3"),g=u("e163"),y=u("d2bb"),_=u("d44e"),E=u("9112"),w=u("6eeb"),T=u("b622"),k=u("c430"),O=u("3f8c"),R=u("ae93"),M=R.IteratorPrototype,N=R.BUGGY_SAFARI_ITERATORS,D=T("iterator"),P="keys",I="values",L="entries",F=function(){return this};l.exports=function(U,J,z,ie,ce,Y,B){m(z,J,ie);var V=function(ete){if(ete===ce&&jr)return jr;if(!N&&ete in Dee)return Dee[ete];switch(ete){case P:return function(){return new z(this,ete)};case I:return function(){return new z(this,ete)};case L:return function(){return new z(this,ete)}}return function(){return new z(this)}},Ge=J+" Iterator",St=!1,Dee=U.prototype,pee=Dee[D]||Dee["@@iterator"]||ce&&Dee[ce],jr=!N&&pee||V(ce),Tee=J=="Array"&&Dee.entries||pee,et,ft,yee;if(Tee&&(et=g(Tee.call(new U)),M!==Object.prototype&&et.next&&(!k&&g(et)!==M&&(y?y(et,M):typeof et[D]!="function"&&E(et,D,F)),_(et,Ge,!0,!0),k&&(O[Ge]=F))),ce==I&&pee&&pee.name!==I&&(St=!0,jr=function(){return pee.call(this)}),(!k||B)&&Dee[D]!==jr&&E(Dee,D,jr),O[J]=jr,ce)if(ft={values:V(I),keys:Y?jr:V(P),entries:V(L)},B)for(yee in ft)(N||St||!(yee in Dee))&&w(Dee,yee,ft[yee]);else d({target:J,proto:!0,forced:N||St},ft);return ft}},"7f9a":function(l,c,u){var d=u("da84"),m=u("8925"),g=d.WeakMap;l.exports=typeof g=="function"&&/native code/.test(m(g))},"825a":function(l,c,u){var d=u("861d");l.exports=function(m){if(!d(m))throw TypeError(String(m)+" is not an object");return m}},"83ab":function(l,c,u){var d=u("d039");l.exports=!d(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},8418:function(l,c,u){var d=u("c04e"),m=u("9bf2"),g=u("5c6c");l.exports=function(y,_,E){var w=d(_);w in y?m.f(y,w,g(0,E)):y[w]=E}},"861d":function(l,c){l.exports=function(u){return typeof u=="object"?u!==null:typeof u=="function"}},8875:function(l,c,u){var d,m,g;(function(y,_){m=[],d=_,g=typeof d=="function"?d.apply(c,m):d,g!==void 0&&(l.exports=g)})(typeof self<"u"?self:this,function(){function y(){var _=Object.getOwnPropertyDescriptor(document,"currentScript");if(!_&&"currentScript"in document&&document.currentScript||_&&_.get!==y&&document.currentScript)return document.currentScript;try{throw new Error}catch(L){var E=/.*at [^(]*\((.*):(.+):(.+)\)$/ig,w=/@([^@]*):(\d+):(\d+)\s*$/ig,T=E.exec(L.stack)||w.exec(L.stack),k=T&&T[1]||!1,O=T&&T[2]||!1,R=document.location.href.replace(document.location.hash,""),M,N,D,P=document.getElementsByTagName("script");k===R&&(M=document.documentElement.outerHTML,N=new RegExp("(?:[^\\n]+?\\n){0,"+(O-2)+"}[^<]* - + diff --git a/main/index-ca-fr.html b/main/index-ca-fr.html index 4e52003e6..7c9ff4f0f 100644 --- a/main/index-ca-fr.html +++ b/main/index-ca-fr.html @@ -24,7 +24,7 @@ - + diff --git a/main/index.html b/main/index.html index 8681795e6..88df7dd60 100644 --- a/main/index.html +++ b/main/index.html @@ -12,7 +12,7 @@ RAMP Storylines Editor - +